[
  {
    "path": ".gitattributes",
    "content": "pkg/gocv/cgo/third_path/** linguist-vendored \n"
  },
  {
    "path": ".gitignore",
    "content": "#\n# NOTE! Please use 'git ls-files -i --exclude-standard'\n# command after changing this file, to see if there are\n# any tracked files which get ignored after the change.\n#\n# Temp files (e.g. editors).\n*~\n*.sw[op]\n\n# Compiled objects.\n#*.a\n*.o\n*.l[ao]\n#*.so\n*.exe\n\n*.d\n!**/tmpfiles.d\n!crosh/dev.d\n*.depends\n.deps\n.libs\n\n*.gch\n*.gcda\n*.gcno\n\n# Common output files.\n*.dump\n*.out\n*.test\n\n# Protobuf files.\n# *.pb.cc\n# *.pb.h\n\n# Python files.\n*.pyc\n\n# Debug (e.g. gdb).\n.gdb_history\n.gdbinit\n\n# xxx.core file\n*.core\ncscope.*\ntags\ntags_sorted_by_file\n\n# Patch files.\n*.diff\n*.patch\n*.orig\n*.rej\n\n# Nested git repos.\n/glbench/images/\n\n# Cargo lock file.\nCargo.lock\n\n# Cargo build directories.\ntarget/\n\n# VSCode source dirs\n.vscode/\n\n# Intellij project dirs\n.idea\n\n# clangd cache dir\n.clangd\n.cache\n\n# Other\n.DS_Store\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2020 kay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# golang\n\nGolang lib is a comprehensive programming toolkit for building microservices in Go. It provides a rich set of interfaces and services to accelerate your development.\n\n## Overview\n\nThis library offers a complete set of tools and utilities for developing Go microservices, including web servers, database connections, message queues, service discovery, monitoring, logging, and much more. It's designed to speed up development by providing production-ready components with sensible defaults.\n\n## Features\n\n### Core Components\n\n- **Web Server** (`pkg/webserver`): High-performance web server built on Gin and gRPC-Gateway\n  - HTTP and gRPC support\n  - Graceful shutdown\n  - Health checks and profiling endpoints\n  - Service registry integration (Consul)\n  - Request/response middleware\n\n- **Configuration** (`pkg/viper`, `pkg/config`): Flexible configuration management\n  - Viper integration for YAML/JSON/TOML configs\n  - Environment variable support\n  - Configuration validation\n\n- **Logging** (`pkg/logs`): Advanced logging capabilities\n  - Logrus-based logging\n  - Log rotation (size/time-based)\n  - Context-aware logging with request IDs\n  - Multiple output formats (JSON, text)\n\n- **Database** (`pkg/database`): Database connectivity\n  - MySQL support with connection pooling\n  - Redis client with advanced features\n  - Transaction management\n\n- **Message Queue** (`pkg/mq`): Message queue integration\n  - Kafka producer and consumer\n  - Batch processing\n  - Error handling and retry mechanisms\n\n- **Service Discovery** (`pkg/discovery`): Service registration and discovery\n  - Consul integration\n  - Etcd support\n  - Health check integration\n\n- **Monitoring** (`pkg/monitor`): Observability tools\n  - OpenTelemetry integration\n  - Prometheus metrics\n  - Distributed tracing\n\n- **Middleware** (`pkg/middleware`): HTTP and gRPC middleware\n  - Authentication/Authorization\n  - Rate limiting\n  - Request logging\n  - Error handling\n\n- **Storage** (`pkg/storage`): Object storage support\n  - S3-compatible storage\n  - File mount utilities\n\n- **Task Management** (`pkg/scheduler`, `pkg/crontab`, `pkg/pool`):\n  - Task scheduler\n  - Cron job support\n  - Connection and task pools\n  - Work queues\n\n- **File Operations**:\n  - File rotation (`pkg/file-rotate`)\n  - File transfer (`pkg/file-transfer`)\n  - File cleanup (`pkg/file-cleanup`)\n  - File system monitoring (`pkg/fsnotify`)\n\n- **gRPC Gateway** (`pkg/grpc-gateway`): RESTful API gateway for gRPC services\n\n- **DNS Resolver** (`pkg/resolver`): Advanced DNS resolution with caching\n\n- **Binary Log** (`pkg/binlog`): Binary log management for data replication\n\n- **Other Utilities**:\n  - Proxy support (`pkg/proxy`)\n  - Performance profiling (`pkg/profile`)\n  - Protobuf utilities (`pkg/protobuf`)\n  - OpenCV bindings (`pkg/gocv`)\n\n### Standard Library Enhancements (`go/`)\n\nThe `go/` directory contains enhanced versions of standard library packages with additional functionality:\n\n- **Context**: Request ID extraction and propagation\n- **Errors**: Structured error handling with codes\n- **Time**: Exponential backoff, rate limiting, time utilities\n- **Net**: gRPC/HTTP clients, DNS resolver, IP/MAC utilities\n- **Crypto**: AES, MD5, SHA256 utilities\n- **IO**: File operations, copy utilities\n- **Reflect**: Advanced reflection utilities\n- **Container**: Heap, Set, WorkQueue data structures\n- **And more...**\n\n### Tutorials (`tutorial/`)\n\nProgramming paradigm examples including:\n- Function options pattern\n- Decorator pattern\n- Factory pattern\n- Error handling patterns\n- Pipeline pattern\n- Visitor pattern\n- And more...\n\n## Quick Start\n\n### Installation\n\n```bash\ngo get github.com/kaydxh/golang\n```\n\n### Basic Web Server Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\twebserver_ \"github.com/kaydxh/golang/pkg/webserver\"\n)\n\nfunc main() {\n\tcfgFile := \"./webserver.yaml\"\n\tconfig := webserver_.NewConfig(webserver_.WithViper(viper_.GetViper(cfgFile, \"web\")))\n\n\ts, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t\n\t// Install your web handlers\n\ts.InstallWebHandlers(/* your handlers */)\n\t\n\tprepared, err := s.PrepareRun()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tprepared.Run(context.Background())\n}\n```\n\n### Configuration Example\n\nCreate a `webserver.yaml` file:\n\n```yaml\nweb:\n  bind_address:\n    host: 0.0.0.0\n    port: 10000\n  grpc:\n    max_concurrency_unary: 0\n    max_concurrency_stream: 0\n    max_receive_message_size: 0\n    max_send_message_size: 0\n    timeout: 0s\n  http:\n    max_concurrency: 0\n    timeout: 0s\n  debug:\n    enable_profiling: true\n  monitor:\n    open_telemetry:\n      enabled: true\n      metric_collect_duration: 60s\n      otel_trace_exporter_type: trace_stdout\n      otel_metric_exporter_type: metric_stdout\n```\n\n## Package Structure\n\n```\ngolang/\n├── go/              # Standard library enhancements\n├── pkg/             # Main packages\n│   ├── webserver/   # Web server framework\n│   ├── logs/        # Logging\n│   ├── database/    # Database clients\n│   ├── mq/          # Message queues\n│   ├── discovery/   # Service discovery\n│   ├── monitor/     # Monitoring\n│   └── ...          # Other packages\n├── tutorial/        # Programming examples\n└── script/          # Utility scripts\n```\n\n## Requirements\n\n- Go 1.24.0 or higher\n- See `go.mod` for specific dependency versions\n\n## Documentation\n\n- Each package contains detailed documentation\n- Check `tutorial/` directory for usage examples\n- Review package-level comments for API documentation\n\n## Contributing\n\nIf you need support, start with your branch, and create a pull request for us. We appreciate your help!\n\n### Development Guidelines\n\n1. Follow Go coding standards\n2. Add tests for new features\n3. Update documentation\n4. Ensure backward compatibility when possible\n\n## License\n\nSee [LICENSE](LICENSE) file for details.\n\n## Evolution\n\nGolang started in Oct 8, 2020.\n\n## Related Projects\n\nThis library is designed to work seamlessly with:\n- Gin web framework\n- gRPC\n- Consul\n- Etcd\n- Kafka\n- Prometheus\n- OpenTelemetry\n\n## Support\n\nFor issues, questions, or contributions, please open an issue or pull request on GitHub.\n"
  },
  {
    "path": "doc/health_check_design.md",
    "content": "# 健康检查增强功能设计文档\n\n## 1. 概述\n\n本文档描述了 golang 库中健康检查（Health Check）功能的设计思路和实现细节。该功能提供了 Kubernetes 兼容的健康检查端点，支持存活探针（Liveness）和就绪探针（Readiness），并具备良好的可扩展性。\n\n## 2. 设计目标\n\n- **Kubernetes 兼容**：支持标准的 `/healthz`、`/livez`、`/readyz` 端点\n- **可扩展性**：通过接口抽象支持自定义健康检查器\n- **组合能力**：支持聚合多个检查器，统一管理\n- **优雅关闭**：关闭时先标记不就绪，允许负载均衡器排空连接\n- **可观测性**：提供详细模式，返回每个检查器的状态和延迟\n\n## 3. 架构设计\n\n### 3.1 整体架构\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                      WebServer                              │\n│  ┌───────────────────────────────────────────────────────┐  │\n│  │              HealthzController                         │  │\n│  │  ┌─────────────────┐    ┌─────────────────┐           │  │\n│  │  │ livezCheckers   │    │ readyzCheckers  │           │  │\n│  │  │ (Composite)     │    │ (Composite)     │           │  │\n│  │  │  ┌───────────┐  │    │  ┌───────────┐  │           │  │\n│  │  │  │   Ping    │  │    │  │   HTTP    │  │           │  │\n│  │  │  ├───────────┤  │    │  ├───────────┤  │           │  │\n│  │  │  │   TCP     │  │    │  │   TCP     │  │           │  │\n│  │  │  ├───────────┤  │    │  ├───────────┤  │           │  │\n│  │  │  │  Custom   │  │    │  │  Custom   │  │           │  │\n│  │  │  └───────────┘  │    │  └───────────┘  │           │  │\n│  │  └─────────────────┘    └─────────────────┘           │  │\n│  └───────────────────────────────────────────────────────┘  │\n│                                                             │\n│  HTTP Endpoints:                                            │\n│  - GET /healthz          综合健康检查                       │\n│  - GET /livez            存活探针                           │\n│  - GET /readyz           就绪探针                           │\n│  - GET /healthz/verbose  详细健康检查结果                   │\n│  - GET /livez/verbose    详细存活检查结果                   │\n│  - GET /readyz/verbose   详细就绪检查结果                   │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### 3.2 核心组件\n\n| 组件 | 职责 |\n|------|------|\n| `HealthChecker` | 健康检查器接口，定义检查行为 |\n| `CompositeHealthChecker` | 组合检查器，聚合多个检查器 |\n| `Controller` | 健康检查控制器，管理端点和检查逻辑 |\n| `WebServer` | 集成健康检查控制器，处理生命周期 |\n\n## 4. 核心接口设计\n\n### 4.1 HealthChecker 接口\n\n```go\n// HealthChecker 是健康检查的核心接口\ntype HealthChecker interface {\n    // Name 返回检查器名称，用于日志和详细结果展示\n    Name() string\n    // Check 执行健康检查，返回 nil 表示健康，返回 error 表示不健康\n    Check(ctx context.Context) error\n}\n```\n\n### 4.2 内置检查器实现\n\n| 检查器类型 | 用途 | 实现要点 |\n|-----------|------|---------|\n| `PingHealthChecker` | 基础检查，始终返回健康 | 用于默认存活检查 |\n| `HTTPHealthChecker` | HTTP 端点健康检查 | 检查状态码 200-299 |\n| `TCPHealthChecker` | TCP 端口连通性检查 | 使用 `net.Dialer` |\n| `FuncHealthChecker` | 函数包装器 | 支持自定义检查逻辑 |\n| `CompositeHealthChecker` | 组合检查器 | 聚合多个检查器 |\n\n## 5. 关键实现\n\n### 5.1 HTTP 健康检查器\n\n```go\ntype HTTPHealthChecker struct {\n    name    string\n    url     string\n    timeout time.Duration\n    client  *http.Client\n}\n\nfunc (h *HTTPHealthChecker) Check(ctx context.Context) error {\n    req, err := http.NewRequestWithContext(ctx, http.MethodGet, h.url, nil)\n    if err != nil {\n        return fmt.Errorf(\"failed to create request: %w\", err)\n    }\n\n    resp, err := h.client.Do(req)\n    if err != nil {\n        return fmt.Errorf(\"failed to connect: %w\", err)\n    }\n    defer resp.Body.Close()\n\n    if resp.StatusCode < 200 || resp.StatusCode >= 300 {\n        return fmt.Errorf(\"unhealthy status code: %d\", resp.StatusCode)\n    }\n    return nil\n}\n```\n\n### 5.2 TCP 健康检查器\n\n```go\ntype TCPHealthChecker struct {\n    name    string\n    addr    string\n    timeout time.Duration\n}\n\nfunc (t *TCPHealthChecker) Check(ctx context.Context) error {\n    dialer := &net.Dialer{Timeout: t.timeout}\n    conn, err := dialer.DialContext(ctx, \"tcp\", t.addr)\n    if err != nil {\n        return fmt.Errorf(\"failed to connect to %s: %w\", t.addr, err)\n    }\n    conn.Close()\n    return nil\n}\n```\n\n### 5.3 组合健康检查器\n\n```go\ntype CompositeHealthChecker struct {\n    name     string\n    mu       sync.RWMutex\n    checkers []HealthChecker\n}\n\nfunc (c *CompositeHealthChecker) Check(ctx context.Context) error {\n    c.mu.RLock()\n    defer c.mu.RUnlock()\n\n    for _, checker := range c.checkers {\n        if err := checker.Check(ctx); err != nil {\n            return fmt.Errorf(\"%s: %w\", checker.Name(), err)\n        }\n    }\n    return nil\n}\n\n// AddChecker 线程安全地添加检查器\nfunc (c *CompositeHealthChecker) AddChecker(checker HealthChecker) {\n    c.mu.Lock()\n    defer c.mu.Unlock()\n    c.checkers = append(c.checkers, checker)\n}\n```\n\n### 5.4 健康检查控制器\n\n```go\ntype Controller struct {\n    livezCheckers  *CompositeHealthChecker  // 存活检查器\n    readyzCheckers *CompositeHealthChecker  // 就绪检查器\n    ready          atomic.Bool               // 就绪状态\n    checkTimeout   time.Duration             // 检查超时（默认 10s）\n}\n\n// Healthz 综合健康检查端点\nfunc (c *Controller) Healthz() gin.HandlerFunc {\n    return func(ctx *gin.Context) {\n        checkCtx, cancel := context.WithTimeout(ctx.Request.Context(), c.checkTimeout)\n        defer cancel()\n\n        // 检查存活状态\n        if err := c.livezCheckers.Check(checkCtx); err != nil {\n            ctx.JSON(http.StatusServiceUnavailable, gin.H{\n                \"status\": \"unhealthy\", \"type\": \"livez\", \"error\": err.Error(),\n            })\n            return\n        }\n\n        // 检查就绪状态\n        if !c.ready.Load() {\n            ctx.JSON(http.StatusServiceUnavailable, gin.H{\n                \"status\": \"not ready\", \"type\": \"readyz\", \"error\": \"server is shutting down\",\n            })\n            return\n        }\n\n        if err := c.readyzCheckers.Check(checkCtx); err != nil {\n            ctx.JSON(http.StatusServiceUnavailable, gin.H{\n                \"status\": \"not ready\", \"type\": \"readyz\", \"error\": err.Error(),\n            })\n            return\n        }\n\n        ctx.String(http.StatusOK, \"ok\")\n    }\n}\n```\n\n## 6. 优雅关闭设计\n\n### 6.1 关闭流程\n\n```\n收到关闭信号 (ctx.Done())\n       │\n       ▼\n标记服务为不就绪 (SetReady(false))\n       │\n       ▼\n/readyz 开始返回 503\n       │\n       ▼\n等待 ShutdownDelayDuration (允许 LB 排空连接)\n       │\n       ▼\n关闭 HTTP/gRPC 服务器\n```\n\n### 6.2 实现代码\n\n```go\nfunc (s preparedGenericWebServer) Run(ctx context.Context) error {\n    // ... 启动代码 ...\n\n    <-ctx.Done()  // 等待关闭信号\n\n    // 1. 标记服务器为不就绪\n    if s.HealthzController != nil {\n        s.HealthzController.SetReady(false)\n    }\n\n    // 2. 等待关闭延迟，允许负载均衡器排空连接\n    if s.ShutdownDelayDuration > 0 {\n        time.Sleep(s.ShutdownDelayDuration)\n    }\n\n    // 3. 关闭服务器\n    // ...\n}\n```\n\n## 7. 与 Consul 服务发现集成\n\n```go\nfunc (srv *ServiceRegistryServer) Register() error {\n    checkUrl := fmt.Sprintf(\"http://%v:%v/api/%v/v1/health\", \n        srv.Ip, srv.Port, srv.ServiceName)\n\n    reg := &api.AgentServiceRegistration{\n        ID:   srv.ServiceId,\n        Name: srv.ServiceName,\n        Check: &api.AgentServiceCheck{\n            Interval:                       srv.CheckInterval.String(),\n            HTTP:                           checkUrl,\n            DeregisterCriticalServiceAfter: srv.TTL.String(),\n        },\n    }\n    return agent.ServiceRegister(reg)\n}\n```\n\n## 8. 使用示例\n\n### 8.1 添加自定义检查器\n\n```go\n// 添加数据库健康检查\ndbChecker := healthz.NewTCPHealthChecker(\"mysql\", \"localhost:3306\", 5*time.Second)\nserver.HealthzController.AddReadyzChecker(dbChecker)\n\n// 添加 Redis 健康检查\nredisChecker := healthz.NewTCPHealthChecker(\"redis\", \"localhost:6379\", 5*time.Second)\nserver.HealthzController.AddReadyzChecker(redisChecker)\n\n// 添加自定义检查逻辑\ncustomChecker := healthz.NewFuncHealthChecker(\"custom\", func(ctx context.Context) error {\n    // 自定义检查逻辑\n    if someCondition {\n        return errors.New(\"unhealthy\")\n    }\n    return nil\n})\nserver.HealthzController.AddLivezChecker(customChecker)\n```\n\n### 8.2 Kubernetes 部署配置\n\n```yaml\napiVersion: v1\nkind: Pod\nspec:\n  containers:\n  - name: app\n    livenessProbe:\n      httpGet:\n        path: /livez\n        port: 8080\n      initialDelaySeconds: 10\n      periodSeconds: 10\n    readinessProbe:\n      httpGet:\n        path: /readyz\n        port: 8080\n      initialDelaySeconds: 5\n      periodSeconds: 5\n```\n\n## 9. API 响应格式\n\n### 9.1 健康状态正常\n\n```\nGET /healthz\nResponse: 200 OK\nBody: ok\n```\n\n### 9.2 健康状态异常\n\n```\nGET /healthz\nResponse: 503 Service Unavailable\nBody: {\"status\": \"unhealthy\", \"type\": \"livez\", \"error\": \"mysql: connection refused\"}\n```\n\n### 9.3 详细检查结果\n\n```\nGET /healthz/verbose\nResponse: 200 OK\nBody:\n{\n  \"status\": \"ok\",\n  \"livez\": {\n    \"status\": \"ok\",\n    \"checks\": [\n      {\"name\": \"ping\", \"status\": \"ok\", \"latency\": \"0.1ms\"}\n    ]\n  },\n  \"readyz\": {\n    \"status\": \"ok\",\n    \"checks\": [\n      {\"name\": \"mysql\", \"status\": \"ok\", \"latency\": \"2.3ms\"},\n      {\"name\": \"redis\", \"status\": \"ok\", \"latency\": \"1.1ms\"}\n    ]\n  }\n}\n```\n\n## 10. 设计特点总结\n\n| 特点 | 说明 |\n|------|------|\n| Kubernetes 兼容 | 支持标准的存活/就绪探针端点 |\n| 可扩展性 | 通过接口支持自定义检查器 |\n| 组合模式 | 支持聚合多个检查器 |\n| 详细模式 | 提供每个检查器的详细结果和延迟 |\n| 优雅关闭 | 关闭时先标记不就绪 |\n| 超时控制 | 默认 10 秒检查超时，可配置 |\n| 线程安全 | 使用互斥锁和原子操作保证并发安全 |\n| 服务发现集成 | 支持 Consul HTTP 健康检查 |\n\n## 11. 文件结构\n\n```\npkg/webserver/controller/healthz/\n├── checker.go      # 健康检查器接口和实现\n├── healthz.go      # 健康检查控制器\n└── healthz_test.go # 单元测试\n\npkg/webserver/\n├── webserver.go    # WebServer 集成健康检查\n└── config.go       # 配置和初始化\n\npkg/discovery/consul/\n└── discovery.go    # Consul 服务注册健康检查\n```\n"
  },
  {
    "path": "doc/opentelemetry_design.md",
    "content": "# OpenTelemetry 监控设计文档\n\n## 1. 概述\n\n本文档描述了 golang 库中 OpenTelemetry 监控功能的设计思路和实现细节。该功能提供统一的可观测性能力，支持 **Metrics（指标）**、**Traces（链路追踪）** 和 **Logs（日志）**，并支持多种后端导出器（Prometheus、Jaeger、OTLP 等）。\n\n## 2. 设计目标\n\n- **统一的可观测性**：通过 OpenTelemetry 标准实现 Metrics、Traces、Logs 的统一采集\n- **多后端支持**：支持 Prometheus、Jaeger、OTLP、Stdout 等多种导出器\n- **腾讯云兼容**：支持腾讯云 Prometheus Remote Write 接入\n- **配置驱动**：通过 YAML 配置文件灵活配置各种导出器\n- **低侵入性**：通过中间件自动采集 gRPC/HTTP 请求指标和链路追踪\n\n## 3. 架构设计\n\n### 3.1 整体架构\n\n```\n┌─────────────────────────────────────────────────────────────────────────┐\n│                           应用层                                         │\n│  ┌───────────────────────────────────────────────────────────────────┐ │\n│  │                    gRPC/HTTP Server                                │ │\n│  │  ┌─────────────────┐    ┌─────────────────┐    ┌───────────────┐  │ │\n│  │  │ Metric 中间件    │    │ Trace 中间件    │    │ 业务代码       │  │ │\n│  │  └────────┬────────┘    └────────┬────────┘    └───────────────┘  │ │\n│  └───────────│──────────────────────│────────────────────────────────┘ │\n└──────────────│──────────────────────│──────────────────────────────────┘\n               │                      │\n               ▼                      ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                      OpenTelemetry SDK 层                                │\n│  ┌───────────────────────────────────────────────────────────────────┐ │\n│  │                 OpenTelemetryService                              │ │\n│  │  ┌─────────────────┐    ┌─────────────────┐                       │ │\n│  │  │   MeterProvider │    │  TracerProvider │                       │ │\n│  │  │  ┌───────────┐  │    │  ┌───────────┐  │                       │ │\n│  │  │  │  Reader   │  │    │  │  Exporter │  │                       │ │\n│  │  │  └───────────┘  │    │  └───────────┘  │                       │ │\n│  │  └─────────────────┘    └─────────────────┘                       │ │\n│  └───────────────────────────────────────────────────────────────────┘ │\n└─────────────────────────────────────────────────────────────────────────┘\n               │                      │\n               ▼                      ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                         导出器层 (Exporter)                              │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐   │\n│  │ Prometheus  │  │    OTLP     │  │   Jaeger    │  │   Stdout    │   │\n│  │   (Pull)    │  │   (Push)    │  │   (Push)    │  │   (Push)    │   │\n│  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘   │\n└─────────│────────────────│────────────────│────────────────│──────────┘\n          │                │                │                │\n          ▼                ▼                ▼                ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                         后端存储层                                       │\n│  ┌─────────────┐  ┌─────────────────────┐  ┌─────────────┐             │\n│  │ Prometheus  │  │ 腾讯云 Prometheus    │  │   Jaeger    │             │\n│  │   Server    │  │   Remote Write      │  │   Server    │             │\n│  └─────────────┘  └─────────────────────┘  └─────────────┘             │\n└─────────────────────────────────────────────────────────────────────────┘\n```\n\n### 3.2 核心组件\n\n| 组件 | 职责 |\n|------|------|\n| `OpenTelemetryService` | 统一管理 Meter 和 Tracer 的生命周期 |\n| `MeterProvider` | 管理指标的采集和导出 |\n| `TracerProvider` | 管理链路追踪的采集和导出 |\n| `PullExporter` | Pull 模式导出器（如 Prometheus） |\n| `PushExporter` | Push 模式导出器（如 OTLP、Jaeger、Stdout） |\n| `ResourceStatsService` | 资源统计服务（CPU、内存等） |\n\n## 4. 指标采集模式\n\n### 4.1 Pull 模式 vs Push 模式\n\n```\n┌─────────────────────────────────────────────────────────────────────────┐\n│                         Pull 模式 (Prometheus)                          │\n│                                                                         │\n│   ┌─────────────┐                           ┌─────────────────────┐     │\n│   │   服务      │ ──────── /metrics ───────→ │   Prometheus       │     │\n│   │ (暴露端口)  │ ←─────── 主动抓取 ────────│   Server           │     │\n│   └─────────────┘                           └─────────────────────┘     │\n│                                                                         │\n│   特点：服务暴露端口，Prometheus 主动拉取                                │\n│   适用：同 VPC、K8s 内部、ServiceMonitor                                │\n└─────────────────────────────────────────────────────────────────────────┘\n\n┌─────────────────────────────────────────────────────────────────────────┐\n│                         Push 模式 (OTLP)                                │\n│                                                                         │\n│   ┌─────────────┐                           ┌─────────────────────┐     │\n│   │   服务      │ ──────── 主动推送 ───────→ │   腾讯云 Prometheus │     │\n│   │ (定时推送)  │                           │   Remote Write      │     │\n│   └─────────────┘                           └─────────────────────┘     │\n│                                                                         │\n│   特点：服务主动推送，无需暴露端口                                       │\n│   适用：跨 VPC、公网、防火墙限制场景                                     │\n└─────────────────────────────────────────────────────────────────────────┘\n```\n\n### 4.2 模式对比\n\n| 特性 | Pull 模式 (Prometheus) | Push 模式 (OTLP) |\n|------|------------------------|------------------|\n| **数据流向** | 后端主动拉取服务 | 服务主动推送到后端 |\n| **端口暴露** | 需要暴露 `/metrics` 端点 | 无需暴露端口 |\n| **网络要求** | Prometheus 需能访问服务 | 服务需能访问采集端 |\n| **适用场景** | 同 VPC、K8s ServiceMonitor | 跨 VPC、无法暴露端口 |\n| **配置类型** | `metric_prometheus` | `metric_otlp` |\n| **Exporter** | `WithMeterPullExporter` | `WithMeterPushExporter` |\n\n### 4.3 选择建议\n\n| 场景 | 推荐模式 | 原因 |\n|------|---------|------|\n| K8s 集群内部 | Pull (Prometheus) | Prometheus Operator 原生支持 ServiceMonitor |\n| 同 VPC 部署 | Pull (Prometheus) | 网络直连，配置简单 |\n| 跨 VPC / 公网 | Push (OTLP) | 无需暴露端口，穿透防火墙 |\n| 边缘节点 | Push (OTLP) | 边缘网络不稳定，主动推送更可靠 |\n| 腾讯云托管 Prometheus | 两者皆可 | 根据网络拓扑选择 |\n\n## 5. 配置设计\n\n### 5.1 配置结构 (Proto 定义)\n\n```protobuf\nmessage OpenTelemetry {\n  bool enabled = 1;\n  google.protobuf.Duration metric_collect_duration = 2;  // 指标采集周期\n  \n  OtelTraceExporterType otel_trace_exporter_type = 3;    // 链路导出器类型\n  OtelMetricExporterType otel_metric_exporter_type = 4;  // 指标导出器类型\n  OtelLogExporterType otel_log_exporter_type = 5;        // 日志导出器类型\n  \n  OtelMetricExporter otel_metric_exporter = 6;           // 指标导出器配置\n  OtelTraceExporter otel_trace_exporter = 7;             // 链路导出器配置\n  \n  Resource resource = 8;                                  // 资源标识\n}\n\n// 指标导出器配置\nmessage OtelMetricExporter {\n  Prometheus prometheus = 1;  // Prometheus Pull 模式\n  Stdout stdout = 2;          // 标准输出\n  OTLP otlp = 3;              // OTLP Push 模式\n}\n\n// OTLP 导出器配置\nmessage OTLP {\n  string endpoint = 1;              // 目标地址\n  string token = 2;                 // 认证 Token\n  string protocol = 3;              // 协议：http 或 grpc\n  bool insecure = 4;                // 是否禁用 TLS\n  map<string, string> headers = 5;  // 自定义请求头\n  string url_path = 6;              // HTTP URL 路径\n}\n```\n\n### 5.2 导出器类型枚举\n\n```protobuf\nenum OtelMetricExporterType {\n  metric_none = 0;        // 不启用\n  metric_prometheus = 1;  // Prometheus Pull 模式\n  metric_stdout = 2;      // 标准输出\n  metric_otlp = 3;        // OTLP Push 模式\n}\n\nenum OtelTraceExporterType {\n  trace_none = 0;         // 不启用\n  trace_jaeger = 1;       // Jaeger\n  trace_stdout = 2;       // 标准输出\n  trace_otlp = 3;         // OTLP Push 模式\n}\n```\n\n### 5.3 配置示例\n\n#### Prometheus Pull 模式（同 VPC）\n\n```yaml\nopen_telemetry:\n  enabled: true\n  metric_collect_duration: 60s\n  otel_metric_exporter_type: metric_prometheus\n  otel_trace_exporter_type: trace_jaeger\n  otel_metric_exporter:\n    prometheus:\n      url: /metrics  # 暴露的端点路径\n  otel_trace_exporter:\n    jaeger:\n      url: http://jaeger:14268/api/traces\n  resource:\n    service_name: \"my-service\"\n    attrs:\n      env: \"production\"\n```\n\n#### OTLP Push 模式（腾讯云 Prometheus）\n\n```yaml\nopen_telemetry:\n  enabled: true\n  metric_collect_duration: 60s\n  otel_metric_exporter_type: metric_otlp\n  otel_trace_exporter_type: trace_stdout\n  otel_metric_exporter:\n    otlp:\n      # 腾讯云 Prometheus Remote Write 地址（从控制台获取）\n      endpoint: \"your-instance.tencentcloudprom.com\"\n      # 认证 Token（从控制台获取）\n      token: \"your-prometheus-token\"\n      # 协议：http 或 grpc\n      protocol: \"http\"\n      # 内网访问可设为 true，公网访问设为 false\n      insecure: false\n      # OTLP 默认路径\n      url_path: \"/v1/metrics\"\n  resource:\n    service_name: \"my-service\"\n    attrs:\n      env: \"production\"\n      region: \"ap-guangzhou\"\n```\n\n## 6. 核心实现\n\n### 6.1 OTLP Exporter 实现\n\n```go\n// OTLPExporterBuilder OTLP 导出器构建器\ntype OTLPExporterBuilder struct {\n    opts struct {\n        endpoint string              // 目标地址\n        headers  map[string]string   // 请求头\n        timeout  time.Duration       // 超时时间\n        insecure bool                // 是否禁用 TLS\n        protocol Protocol            // 协议类型\n        urlPath  string              // URL 路径\n    }\n}\n\n// Protocol 协议类型\ntype Protocol int\n\nconst (\n    ProtocolHTTP Protocol = iota  // HTTP 协议\n    ProtocolGRPC                  // gRPC 协议\n)\n\n// Build 构建 OTLP Exporter\nfunc (b *OTLPExporterBuilder) Build(ctx context.Context) (metric.Exporter, error) {\n    switch b.opts.protocol {\n    case ProtocolHTTP:\n        return b.buildHTTPExporter(ctx)\n    case ProtocolGRPC:\n        return b.buildGRPCExporter(ctx)\n    default:\n        return b.buildHTTPExporter(ctx)\n    }\n}\n\n// buildHTTPExporter 构建 HTTP 导出器\nfunc (b *OTLPExporterBuilder) buildHTTPExporter(ctx context.Context) (metric.Exporter, error) {\n    opts := []otlpmetrichttp.Option{\n        otlpmetrichttp.WithEndpoint(b.opts.endpoint),\n    }\n    \n    if b.opts.insecure {\n        opts = append(opts, otlpmetrichttp.WithInsecure())\n    }\n    if len(b.opts.headers) > 0 {\n        opts = append(opts, otlpmetrichttp.WithHeaders(b.opts.headers))\n    }\n    if b.opts.timeout > 0 {\n        opts = append(opts, otlpmetrichttp.WithTimeout(b.opts.timeout))\n    }\n    if b.opts.urlPath != \"\" {\n        opts = append(opts, otlpmetrichttp.WithURLPath(b.opts.urlPath))\n    }\n    \n    return otlpmetrichttp.New(ctx, opts...)\n}\n```\n\n### 6.2 配置加载实现\n\n```go\nfunc (c *completedConfig) installMeter(ctx context.Context) ([]OpenTelemetryServiceOption, error) {\n    var opts []OpenTelemetryServiceOption\n    \n    // 设置采集周期\n    collectDuration := c.Proto.GetMetricCollectDuration().AsDuration()\n    if collectDuration > 0 {\n        opts = append(opts, WithMetricCollectDuration(collectDuration))\n    }\n\n    metricType := c.Proto.OtelMetricExporterType\n    switch metricType {\n    case OtelMetricExporterType_metric_prometheus:\n        // Pull 模式：Prometheus 主动抓取\n        builder := prometheus_.NewPrometheusExporterBuilder(\n            prometheus_.WithMetricUrlPath(c.Proto.GetOtelMetricExporter().GetPrometheus().GetUrl()),\n        )\n        opts = append(opts, WithMeterPullExporter(builder))\n\n    case OtelMetricExporterType_metric_otlp:\n        // Push 模式：服务主动推送\n        otlpConfig := c.Proto.GetOtelMetricExporter().GetOtlp()\n        var otlpOpts []otlpmetric_.OTLPExporterBuilderOption\n        \n        // 配置 endpoint\n        if otlpConfig.GetEndpoint() != \"\" {\n            otlpOpts = append(otlpOpts, otlpmetric_.WithEndpoint(otlpConfig.GetEndpoint()))\n        }\n        \n        // 配置协议\n        if otlpConfig.GetProtocol() == \"grpc\" {\n            otlpOpts = append(otlpOpts, otlpmetric_.WithProtocol(otlpmetric_.ProtocolGRPC))\n        } else {\n            otlpOpts = append(otlpOpts, otlpmetric_.WithProtocol(otlpmetric_.ProtocolHTTP))\n        }\n        \n        // 配置认证头\n        headers := make(map[string]string)\n        for k, v := range otlpConfig.GetHeaders() {\n            headers[k] = v\n        }\n        if otlpConfig.GetToken() != \"\" {\n            headers[\"Authorization\"] = \"Bearer \" + otlpConfig.GetToken()\n        }\n        if len(headers) > 0 {\n            otlpOpts = append(otlpOpts, otlpmetric_.WithHeaders(headers))\n        }\n        \n        builder := otlpmetric_.NewOTLPExporterBuilder(otlpOpts...)\n        opts = append(opts, WithMeterPushExporter(builder))\n\n    case OtelMetricExporterType_metric_stdout:\n        // 标准输出（调试用）\n        builder := stdoutmetric_.NewStdoutExporterBuilder(\n            stdoutmetric_.WithPrettyPrint(c.Proto.GetOtelMetricExporter().GetStdout().GetPrettyPrint()),\n        )\n        opts = append(opts, WithMeterPushExporter(builder))\n    }\n\n    return opts, nil\n}\n```\n\n### 6.3 中间件集成\n\n#### gRPC 指标拦截器\n\n```go\n// UnaryServerInterceptorOfMetric gRPC 一元调用指标拦截器\nfunc UnaryServerInterceptorOfMetric() grpc.UnaryServerInterceptor {\n    return func(ctx context.Context, req interface{}, \n        info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n        \n        start := time.Now()\n        resp, err := handler(ctx, req)\n        duration := time.Since(start)\n        \n        // 记录请求指标\n        meter_.RecordRequest(ctx, info.FullMethod, duration, err)\n        \n        return resp, err\n    }\n}\n```\n\n#### HTTP 指标中间件\n\n```go\n// MetricMiddleware HTTP 指标中间件\nfunc MetricMiddleware() gin.HandlerFunc {\n    return func(c *gin.Context) {\n        start := time.Now()\n        c.Next()\n        duration := time.Since(start)\n        \n        // 记录请求指标\n        meter_.RecordHTTPRequest(c.Request.Context(), \n            c.Request.Method, c.Request.URL.Path, \n            c.Writer.Status(), duration)\n    }\n}\n```\n\n## 7. 腾讯云 Prometheus 接入指南\n\n### 7.1 获取配置信息\n\n1. 登录 [腾讯云 Prometheus 监控控制台](https://console.cloud.tencent.com/monitor/prometheus)\n2. 选择对应实例，进入**基本信息** > **服务地址**\n3. 获取以下信息：\n   - **Remote Write 地址**：填入 `endpoint`\n   - **Token**：填入 `token`\n\n### 7.2 配置参数说明\n\n| 参数 | 说明 | 示例 |\n|------|------|------|\n| `endpoint` | Remote Write 地址（不含 https://） | `your-instance.tencentcloudprom.com` |\n| `token` | 认证 Token | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` |\n| `protocol` | 传输协议 | `http`（推荐）或 `grpc` |\n| `insecure` | 是否禁用 TLS | 同 VPC 可用 `true`，公网用 `false` |\n| `url_path` | OTLP URL 路径 | `/v1/metrics` |\n\n### 7.3 完整配置示例\n\n```yaml\nweb:\n  monitor:\n    open_telemetry:\n      enabled: true\n      metric_collect_duration: 60s\n      otel_metric_exporter_type: metric_otlp\n      otel_trace_exporter_type: trace_stdout\n      otel_metric_exporter:\n        otlp:\n          endpoint: \"your-instance.tencentcloudprom.com\"\n          token: \"your-prometheus-token\"\n          protocol: \"http\"\n          insecure: false\n          url_path: \"/v1/metrics\"\n      resource:\n        service_name: \"sea-date\"\n        attrs:\n          env: \"production\"\n          region: \"ap-guangzhou\"\n```\n\n## 8. K8s Resource 属性\n\n### 8.1 概述\n\n自动从 K8s 环境变量中采集容器运行时信息，作为 OpenTelemetry Resource 属性注入到所有 Metrics 和 Traces 中。\n\n### 8.2 支持的 K8s 属性\n\n| 环境变量 | 属性名 | 说明 |\n|----------|--------|------|\n| `NODE_IP` | `k8s.node.ip` | 宿主机节点 IP |\n| `POD_NAMESPACE` | `k8s.namespace.name` | Pod 命名空间 |\n| `POD_NAME` | `k8s.pod.name` | Pod 名称 |\n| `POD_IP` | `k8s.pod.ip` | Pod IP |\n| `CONTAINER_NAME` | `k8s.container.name` | 容器名称 |\n| `CONTAINER_PLATFORM` | `k8s.container.platform` | 容器平台 (STKE/TKE) |\n\n### 8.3 K8s Deployment 配置示例\n\n```yaml\nspec:\n  containers:\n  - name: my-app\n    env:\n    - name: NODE_IP\n      valueFrom:\n        fieldRef:\n          fieldPath: status.hostIP\n    - name: POD_NAMESPACE\n      valueFrom:\n        fieldRef:\n          fieldPath: metadata.namespace\n    - name: POD_NAME\n      valueFrom:\n        fieldRef:\n          fieldPath: metadata.name\n    - name: POD_IP\n      valueFrom:\n        fieldRef:\n          fieldPath: status.podIP\n    - name: CONTAINER_NAME\n      value: \"my-app\"\n    - name: CONTAINER_PLATFORM\n      value: \"STKE\"\n```\n\n### 8.4 YAML 配置\n\n```yaml\nopen_telemetry:\n  resource:\n    service_name: \"my-service\"\n    service_version: \"1.0.0\"\n    attrs:\n      env: \"production\"\n    k8s:\n      enabled: true  # 是否启用 K8s 属性自动检测（默认 true）\n      # 以下属性会自动从环境变量读取，也可以手动覆盖\n      # node_ip: \"\"\n      # pod_namespace: \"\"\n      # pod_name: \"\"\n      # pod_ip: \"\"\n      # container_name: \"\"\n      # container_platform: \"\"\n    apm:\n      token: \"\"  # APM Token，与业务系统关联，从 APM 控制台获取\n```\n\n### 8.5 APM Token 配置\n\n#### 概述\n\nAPM（Application Performance Management）Token 用于腾讯云 APM 服务的身份认证和数据关联。Token 会作为 Resource attribute 添加到所有 trace span 中。\n\n#### 获取 APM Token\n\n1. 登录 [腾讯云 APM 控制台](https://console.cloud.tencent.com/apm/monitor/access)\n2. 选择对应业务系统\n3. 获取 Token\n\n#### YAML 配置\n\n```yaml\nopen_telemetry:\n  enabled: true\n  resource:\n    service_name: \"my-service\"\n    apm:\n      token: \"your-apm-token\"  # 从 APM 控制台获取\n```\n\n#### Proto 定义\n\n```protobuf\nmessage Resource {\n  string service_name = 1;\n  string service_version = 2;\n  map<string, string> attrs = 3;\n  K8sResource k8s = 10;\n  Apm apm = 11;      // 腾讯云 APM 配置\n  ZhiYan zhiyan = 12; // 智研平台配置\n}\n\nmessage Apm {\n  string token = 1;  // APM Token，与业务系统关联\n}\n\nmessage ZhiYan {\n  string app_mark = 1;         // 业务指标上报 appMark\n  string global_app_mark = 2;  // 全局指标上报 appMark\n  string env = 3;              // 环境标识 (prod/test/dev)\n  string instance_mark = 4;    // 实例标识\n  string zhiyan_apm_token = 5; // 智研 APM Token\n  string expand_key = 6;       // 是否扩展属性到维度\n}\n```\n\n#### 核心实现\n\n```go\n// APM Token key\nvar ApmTokenKey = attribute.Key(\"token\")\n\n// WithApmToken 设置 APM Token\nfunc WithApmToken(token string) ResourceOption {\n    return func(o *ResourceOptions) {\n        o.ApmToken = token\n    }\n}\n\n// 在 NewResource 中添加 APM Token\nif options.ApmToken != \"\" {\n    attrs = append(attrs, ApmTokenKey.String(options.ApmToken))\n}\n```\n\n### 8.6 智研 (ZhiYan) 平台配置\n\n#### 概述\n\n智研是腾讯内部的可观测平台，支持 Metrics、Traces、Logs 的统一上报和分析。通过 OpenTelemetry 协议接入。\n\n#### 智研 vs 腾讯云 APM 对比\n\n| 平台 | 访问范围 | 认证方式 | 上报地址 |\n|------|---------|---------|---------|\n| 腾讯云 APM | 公网 | `Authorization: Bearer <token>` | `xxx.tencentcloudapi.com` |\n| 智研平台 | 内网 | `tps.tenant.id` Resource Attribute | `<智研内网trace地址>:4317` |\n\n#### 获取智研租户\n\n1. 登录 \n2. 进入 监控宝 > 应用性能监控 > 接入管理\n3. 获取租户信息，格式：`空间ID#日志租户#监控宝租户`\n   - 示例：`<空间ID>#<日志租户>#<监控宝租户>`\n\n#### 智研上报地址\n\n| 网络环境 | 类型 | 服务地址 | 协议 | 备注 |\n|----------|------|---------|------|------|\n| **内网** | Metric | `<内网metric上报地址>:4318` | HTTP | 推荐，无需 TLS |\n| **外网** | Metric | `<外网metric上报地址>:4318` | **HTTPS** | 必须启用 TLS |\n| 内网 | Trace | `<内网trace上报地址>:4317` | gRPC | IDC 内网 |\n| 内网 | Trace | `<内网trace上报地址>:4318` | HTTP | IDC 内网 |\n| 公网 | Trace | `<外网trace上报地址>:4317` | gRPC | DevCloud/研发环境 |\n\n> **⚠️ 重要**: 外网域名 **必须使用 HTTPS**（`insecure: false`），否则会连接超时。\n\n#### YAML 配置示例\n\n```yaml\nopen_telemetry:\n  enabled: true\n  \n  # Trace 上报到智研\n  otel_trace_exporter_type: trace_otlp\n  otel_trace_exporter:\n    otlp:\n      endpoint: \"<智研trace上报地址>:4317\"\n      protocol: \"grpc\"\n      insecure: true\n  \n  # Metric 上报到智研\n  otel_metric_exporter_type: metric_otlp\n  otel_metric_exporter:\n    otlp:\n      endpoint: \"<智研metric上报地址>:4317\"\n      protocol: \"grpc\"\n      insecure: true\n  \n  resource:\n    service_name: \"my-service\"\n    zhiyan:\n      # 业务指标上报 appMark（用于 App MeterProvider）\n      app_mark: \"<your_app_mark>\"\n      \n      # 全局指标上报 appMark（用于 Global MeterProvider）\n      global_app_mark: \"<your_global_app_mark>\"\n      \n      # 环境标识\n      env: \"prod\"\n      \n      # 智研 APM Token（用于 Trace 上报）\n      # 格式：空间ID#日志租户#监控宝租户\n      zhiyan_apm_token: \"<空间ID>#<日志租户>#<监控宝租户>\"\n      \n      # 是否将 resource 属性扩展到指标维度\n      expand_key: \"no\"\n```\n\n#### 智研 Resource Attribute Keys\n\n| Attribute Key | 说明 | 是否必填 | 类型 |\n|---------------|------|---------|------|\n| `__zhiyan_app_mark__` | 上报应用标记 | **是** | string |\n| `__zhiyan_env__` | 环境标识 (prod/test/dev) | **是** | string |\n| `__zhiyan_instance_mark__` | 上报实例标识 | 否 | string |\n| `__zhiyan_expand_tag_enable__` | 是否扩展属性到维度 | 否（默认 no） | string |\n| `__zhiyan_data_grain__` | 数据粒度 (10/30/60) | 否（默认 60） | int |\n| `__zhiyan_data_type__` | 数据类型，秒级填 \"second\" | 否 | string |\n| `tps.tenant.id` | 智研 APM 租户 ID | Trace 上报必填 | string |\n\n#### 智研上报必须配置\n\n根据智研对接文档，以下配置项**必须正确设置**：\n\n| 配置项 | 要求 | 说明 |\n|--------|------|------|\n| Delta Temporality | `temporality_delta: true` | 智研只支持 Delta 时间性 |\n| Gzip 压缩 | `compression: true` | 建议启用以减少带宽 |\n| 采集周期 | 与数据粒度一致 | 如分钟级数据设置 60s |\n| HTTP 端口 | 4318 | OTLP HTTP 标准端口 |\n\n#### 核心实现\n\n```go\n// 智研平台 attribute keys\nvar (\n    ZhiYanAppMarkKey      = attribute.Key(\"__zhiyan_app_mark__\")\n    ZhiYanInstanceMarkKey = attribute.Key(\"__zhiyan_instance_mark__\")\n    ZhiYanEnvKey          = attribute.Key(\"__zhiyan_env__\")\n    ZhiYanExpandKey       = attribute.Key(\"__zhiyan_expand_tag_enable__\")\n    ZhiYanDataGrainKey    = attribute.Key(\"__zhiyan_data_grain__\")\n    ZhiYanDataTypeKey     = attribute.Key(\"__zhiyan_data_type__\")\n    ZhiYanTpsTenantIDKey  = attribute.Key(\"tps.tenant.id\")\n)\n\n// 在 NewResource 中添加智研属性\nif options.ZhiYanAppMark != \"\" {\n    attrs = append(attrs, ZhiYanAppMarkKey.String(options.ZhiYanAppMark))\n    attrs = append(attrs, ZhiYanEnvKey.String(options.ZhiYanEnv))\n    attrs = append(attrs, ZhiYanExpandKey.String(\"no\"))\n}\n\nif options.ZhiYanApmToken != \"\" {\n    attrs = append(attrs, ZhiYanTpsTenantIDKey.String(options.ZhiYanApmToken))\n}\n```\n\n### 8.7 核心实现\n\n```go\n// K8s 环境变量映射\nvar k8sEnvToAttribute = map[string]attribute.Key{\n    \"NODE_IP\":            semconv.K8SNodeNameKey,\n    \"POD_NAMESPACE\":      semconv.K8SNamespaceNameKey,\n    \"POD_NAME\":           semconv.K8SPodNameKey,\n    \"POD_IP\":             attribute.Key(\"k8s.pod.ip\"),\n    \"CONTAINER_NAME\":     semconv.K8SContainerNameKey,\n    \"CONTAINER_PLATFORM\": attribute.Key(\"k8s.container.platform\"),\n}\n\n// NewResource 创建包含 K8s 属性的 Resource\nfunc NewResource(opts ...ResourceOption) (*resource.Resource, error) {\n    cfg := defaultResourceConfig()\n    for _, opt := range opts {\n        opt(cfg)\n    }\n    \n    var attrs []attribute.KeyValue\n    \n    // 添加服务信息\n    if cfg.serviceName != \"\" {\n        attrs = append(attrs, semconv.ServiceName(cfg.serviceName))\n    }\n    if cfg.serviceVersion != \"\" {\n        attrs = append(attrs, semconv.ServiceVersion(cfg.serviceVersion))\n    }\n    \n    // 添加 K8s 属性\n    if cfg.enableK8s {\n        attrs = append(attrs, getK8sAttributes()...)\n    }\n    \n    // 添加自定义属性\n    for k, v := range cfg.attrs {\n        attrs = append(attrs, attribute.String(k, v))\n    }\n    \n    return resource.NewWithAttributes(semconv.SchemaURL, attrs...)\n}\n```\n\n## 9. 模调上报（主/被调）\n\n### 9.1 概述\n\n模调上报是一种标准化的服务调用监控方案，支持：\n- **被调上报 (P)**：服务端记录被调用的指标\n- **主调上报 (A)**：客户端记录调用其他服务的指标\n\n### 9.2 上报指标\n\n| 指标名 | 类型 | 说明 |\n|--------|------|------|\n| `requests` | Counter | 请求数 |\n| `success` | Counter | 成功数 |\n| `timeout` | Counter | 超时数 |\n| `abnormal` | Counter | 异常数 |\n| `cost` | Counter | 累计耗时(ms) |\n| `duration` | Histogram | 耗时分布 |\n\n### 9.3 维度属性\n\n#### 被调方 (P) 维度\n\n| 属性 | 说明 |\n|------|------|\n| `ret_code` | 返回码 |\n| `p_ip` | 被调 IP |\n| `p_app` | 被调应用名 |\n| `p_server` | 被调服务名 |\n| `p_service` | 被调 Service |\n| `p_interface` | 被调接口 |\n\n#### 主调方 (A) 维度\n\n| 属性 | 说明 |\n|------|------|\n| `a_ip` | 主调 IP |\n| `a_app` | 主调应用名 |\n| `a_server` | 主调服务名 |\n| `a_service` | 主调 Service |\n| `a_interface` | 主调接口 |\n\n### 9.4 gRPC 拦截器使用示例\n\n#### Server 端（被调上报）\n\n```go\nimport interceptoropentelemetry \"github.com/kaydxh/golang/pkg/middleware/grpc-middleware/opentelemetry\"\n\nserver := grpc.NewServer(\n    grpc.ChainUnaryInterceptor(\n        interceptoropentelemetry.UnaryServerModularInterceptor(\n            interceptoropentelemetry.ModularServerConfig{\n                AppName:    \"my-app\",\n                ServerName: \"my-server\",\n            },\n        ),\n    ),\n    grpc.ChainStreamInterceptor(\n        interceptoropentelemetry.StreamServerModularInterceptor(\n            interceptoropentelemetry.ModularServerConfig{\n                AppName:    \"my-app\",\n                ServerName: \"my-server\",\n            },\n        ),\n    ),\n)\n```\n\n#### Client 端（主调上报）\n\n```go\nconn, err := grpc.Dial(target,\n    grpc.WithChainUnaryInterceptor(\n        interceptoropentelemetry.UnaryClientModularInterceptor(\n            interceptoropentelemetry.ModularClientConfig{\n                AppName:     \"my-app\",\n                ServerName:  \"my-server\",\n                ServiceName: \"my-service\",\n            },\n        ),\n    ),\n    grpc.WithChainStreamInterceptor(\n        interceptoropentelemetry.StreamClientModularInterceptor(\n            interceptoropentelemetry.ModularClientConfig{\n                AppName:     \"my-app\",\n                ServerName:  \"my-server\",\n                ServiceName: \"my-service\",\n            },\n        ),\n    ),\n)\n```\n\n### 9.5 核心实现\n\n```go\n// MetricReporter 模调上报器\ntype MetricReporter struct {\n    meterProvider otelmetric.MeterProvider\n    counters      map[string]otelmetric.Int64Counter\n    histograms    map[string]otelmetric.Float64Histogram\n    mu            sync.RWMutex\n}\n\n// ReportServerMetric 被调上报\nfunc (r *MetricReporter) ReportServerMetric(ctx context.Context, dim *ServerDimension, costMs float64) {\n    attrs := dim.ToAttributes()\n    \n    // 请求数\n    r.getCounter(ServerReportMeterName, RequestsMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n    \n    // 成功/超时/异常\n    if dim.IsSuccess() {\n        r.getCounter(ServerReportMeterName, SuccessMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n    } else if dim.IsTimeout() {\n        r.getCounter(ServerReportMeterName, TimeoutMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n    } else {\n        r.getCounter(ServerReportMeterName, AbnormalMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n    }\n    \n    // 耗时\n    r.getCounter(ServerReportMeterName, CostMetricName).Add(ctx, int64(costMs), otelmetric.WithAttributes(attrs...))\n    r.getHistogram(ServerReportMeterName, DurationMetricName, DefaultDurationBounds).Record(ctx, costMs, otelmetric.WithAttributes(attrs...))\n}\n```\n\n## 10. 自定义 Metric API\n\n### 10.1 概述\n\n提供便捷的 Metric API，简化指标上报操作，支持：\n- 函数式 API（Context 属性传递）\n- 函数式 API（显式属性传递）\n- 面向对象 API（Instrument 封装）\n- Global/App 双 Provider 支持\n\n### 10.2 函数式 API（Context 属性）\n\n```go\nimport \"github.com/kaydxh/golang/pkg/opentelemetry/metric/api\"\n\n// 通过 context 传递属性\nctx = api.WithAttribute(ctx, \"meter_name\", \"user_id\", \"12345\")\nctx = api.WithAttributes(ctx, \"meter_name\", map[string]any{\n    \"region\":     \"us-west-2\",\n    \"version\":    \"1.2.3\",\n})\n\n// Counter\napi.AddCounter(ctx, \"business\", \"orders_count\", 10)\napi.IncrCounter(ctx, \"business\", \"user_signups\")\n\n// Histogram\napi.RecordHistogram(ctx, \"latency\", \"api_duration\", 125.5, nil)\napi.RecordDuration(ctx, \"latency\", \"db_query\", 45.2)  // 使用默认 bounds\n```\n\n### 10.3 函数式 API（显式属性）\n\n```go\nimport \"go.opentelemetry.io/otel/attribute\"\n\n// 直接传入属性，不依赖 context\napi.IncrCounterWithAttrs(ctx, \"http\", \"requests\",\n    attribute.String(\"endpoint\", \"/api/v1/users\"),\n    attribute.Int(\"status\", 200),\n)\n\napi.RecordDurationWithAttrs(ctx, \"http\", \"latency\", 45.2,\n    attribute.String(\"method\", \"GET\"),\n    attribute.String(\"path\", \"/users\"),\n)\n```\n\n### 10.4 面向对象 API\n\n```go\n// Counter 对象\ncounter := api.NewCounter(\"business\", \"api_calls\")\ncounter.SetAttribute(\"service\", \"user-service\")\ncounter.Incr(ctx)\n\n// 链式调用\ncounter.With(\"method\", \"GET\").With(\"path\", \"/users\").Incr(ctx)\n\n// Histogram 对象\nhistogram := api.NewHistogram(\"latency\", \"processing_time\",\n    api.WithBounds([]float64{10, 50, 100, 500, 1000}),\n)\nhistogram.SetAttribute(\"processor\", \"image\")\nhistogram.Record(ctx, 234.5)\n\n// Timer 对象\ntimer := api.NewTimer(\"performance\", \"operation_duration\")\ntimer.SetAttribute(\"operation\", \"data_processing\")\ntimer.Record(ctx, float64(elapsed.Milliseconds()))\n```\n\n### 10.5 Global vs App Provider\n\n```go\n// App Provider（应用级指标）- 默认\napi.IncrCounter(ctx, \"business\", \"orders\")\ncounter := api.NewCounter(\"app\", \"signups\")\n\n// Global Provider（基础设施指标）\napi.GlobalIncrCounter(ctx, \"infra\", \"gc_cycles\")\nglobalCounter := api.NewGlobalCounter(\"system\", \"allocations\")\n\n// 设置自定义 App Provider（可选）\napi.SetAppMeterProvider(myCustomProvider)\n```\n\n### 10.6 配置驱动的双 MeterProvider\n\n支持通过配置文件自动初始化 Global 和 App 两个独立的 MeterProvider：\n\n#### Proto 配置定义\n\n```protobuf\nmessage OpenTelemetry {\n  // ... 其他字段 ...\n\n  // App MeterProvider configuration (separate from global)\n  AppMeterProvider app_meter_provider = 11;\n}\n\nmessage AppMeterProvider {\n  bool enabled = 1;  // Enable separate App MeterProvider\n\n  // Exporter type for app metrics (if different from global)\n  OtelMetricExporterType exporter_type = 2;\n\n  // Exporter configuration (if different from global)\n  OtelMetricExporter exporter = 3;\n\n  // Collect duration for app metrics\n  google.protobuf.Duration collect_duration = 4;\n\n  // Resource attributes specific to app metrics\n  Resource resource = 5;\n}\n```\n\n#### YAML 配置示例\n\n```yaml\nopen_telemetry:\n  enabled: true\n\n  # Global MeterProvider (基础设施指标)\n  otel_metric_exporter_type: metric_prometheus\n  otel_metric_exporter:\n    prometheus:\n      url: \"/metrics\"\n  metric_collect_duration: \"60s\"\n\n  # App MeterProvider (应用级指标，独立配置)\n  app_meter_provider:\n    enabled: true\n    exporter_type: metric_otlp  # 可以使用不同的导出器\n    exporter:\n      otlp:\n        endpoint: \"prometheus.tencentcloudapi.com:4317\"\n        protocol: \"grpc\"\n        token: \"your-app-token\"\n    collect_duration: \"30s\"  # 可以使用不同的采集周期\n    resource:\n      service_name: \"my-app-metrics\"\n      attrs:\n        metric_type: \"business\"\n```\n\n#### 使用场景\n\n| 场景 | Global Provider | App Provider |\n|------|-----------------|--------------|\n| **用途** | 基础设施/运维指标 | 业务/应用指标 |\n| **指标类型** | CPU、内存、GC、网络 | 订单数、用户注册、业务延迟 |\n| **采集周期** | 较长（60s） | 较短（15-30s） |\n| **导出目标** | 本地 Prometheus | 腾讯云/远程 OTLP |\n| **资源属性** | 通用服务信息 | 业务相关属性 |\n\n#### 编程方式配置\n\n```go\n// 方式1：使用配置文件自动初始化\ncfg := opentelemetry.NewConfig(\n    opentelemetry.WithViper(v),\n)\ncfg.Complete().New(ctx)\n\n// 方式2：编程方式手动配置双 Provider\not := opentelemetry.NewOpenTelemetryService(\n    // Global Provider\n    opentelemetry.WithMeterPullExporter(prometheusBuilder),\n    opentelemetry.WithMetricCollectDuration(time.Minute),\n\n    // App Provider\n    opentelemetry.WithAppMeterPushExporter(otlpBuilder),\n    opentelemetry.WithAppMetricCollectDuration(30 * time.Second),\n    opentelemetry.WithAppMeterResource(appResource),\n)\not.Install(ctx)\n```\n\n### 10.7 支持的属性类型\n\n| 类型 | 示例 |\n|------|------|\n| `string` | `\"value\"` |\n| `int`, `int8`, `int16`, `int32`, `int64` | `123` |\n| `uint`, `uint8`, `uint16`, `uint32`, `uint64` | `456` |\n| `float32`, `float64` | `3.14` |\n| `bool` | `true` |\n\n### 10.8 默认 Histogram Bounds\n\n```go\n// 延迟类（毫秒）\nDefaultDurationBounds = []float64{1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000}\n\n// 大小类（字节）\nDefaultSizeBounds = []float64{100, 1000, 10000, 100000, 1000000, 10000000}\n```\n\n## 11. 资源统计\n\n### 11.1 ResourceStatsService\n\n自动采集系统资源指标：\n\n```go\ntype ResourceStatsService struct {\n    checkInterval time.Duration\n    // 采集的指标\n    cpuUsage      float64   // CPU 使用率\n    memoryUsage   float64   // 内存使用率\n    goroutines    int       // Goroutine 数量\n    gcPauseNs     uint64    // GC 暂停时间\n}\n```\n\n### 11.2 采集的指标\n\n| 指标 | 说明 | 类型 |\n|------|------|------|\n| `process_cpu_usage` | 进程 CPU 使用率 | Gauge |\n| `process_memory_usage` | 进程内存使用率 | Gauge |\n| `go_goroutines` | Goroutine 数量 | Gauge |\n| `go_gc_duration_seconds` | GC 暂停时间 | Histogram |\n| `go_memstats_alloc_bytes` | 已分配内存 | Gauge |\n\n## 12. 使用示例\n\n### 12.1 编程方式配置\n\n```go\nimport (\n    \"github.com/kaydxh/golang/pkg/opentelemetry\"\n    \"github.com/kaydxh/golang/pkg/opentelemetry/metric/otlp\"\n)\n\n// 方式一：使用腾讯云 Prometheus 快捷方法\notelService := opentelemetry.NewOpenTelemetryService(\n    opentelemetry.WithMeterOptions(\n        otlp.WithTencentCloudPrometheus(\n            \"your-instance.tencentcloudprom.com\",\n            \"your-token\",\n            false,  // 使用 TLS\n        ),\n    ),\n)\notelService.Install(ctx)\n\n// 方式二：自定义 OTLP 配置\notelService := opentelemetry.NewOpenTelemetryService(\n    opentelemetry.WithMeterOptions(\n        otlp.WithOTLPPushExporter(\n            \"prometheus.example.com:4318\",\n            otlp.WithProtocol(otlp.ProtocolHTTP),\n            otlp.WithHeaders(map[string]string{\n                \"Authorization\": \"Bearer xxx\",\n            }),\n            otlp.WithInsecure(true),\n        ),\n    ),\n)\n```\n\n### 12.2 配置文件方式\n\n```yaml\n# sea-date.yaml\nweb:\n  monitor:\n    open_telemetry:\n      enabled: true\n      metric_collect_duration: 60s\n      otel_metric_exporter_type: metric_otlp\n      otel_metric_exporter:\n        otlp:\n          endpoint: \"your-instance.tencentcloudprom.com\"\n          token: \"your-prometheus-token\"\n          protocol: \"http\"\n          insecure: false\n```\n\n## 13. 文件结构\n\n```\npkg/opentelemetry/\n├── opentelemetry.go              # OpenTelemetryService 主入口\n├── opentelemetry.proto           # Proto 配置定义\n├── opentelemetry.pb.go           # 生成的 Proto 代码\n├── opentelemetry.yaml            # 配置示例\n├── opentelemetry.option.go       # OpenTelemetry 选项\n├── config.go                     # 配置加载和安装\n├── config.option.go              # 配置选项\n├── metric/\n│   ├── meter.go                  # MeterProvider 管理\n│   ├── meter.option.go           # Meter 选项\n│   ├── meter.pull.exporter.go    # Pull 模式导出器接口\n│   ├── meter.push.exporter.go    # Push 模式导出器接口\n│   ├── api/                      # 自定义 Metric API\n│   │   ├── api.go                # 便捷 API 函数\n│   │   └── instrument.go         # Instrument 对象封装\n│   ├── report/                   # 模调上报\n│   │   ├── report.go             # 上报核心实现\n│   │   └── dimension.go          # 维度定义\n│   ├── prometheus/               # Prometheus Pull 导出器\n│   │   ├── prometheus.metric.go\n│   │   └── prometheus.metric_option.go\n│   ├── otlp/                     # OTLP Push 导出器\n│   │   ├── otlp.metric.go\n│   │   ├── otlp.metric.option.go\n│   │   └── otlp.metric_option.go\n│   └── stdout/                   # Stdout 导出器\n│       └── stdout.metric.go\n├── tracer/\n│   ├── tracer.go                 # TracerProvider 管理\n│   ├── tracer.option.go          # Tracer 选项\n│   ├── jaeger/                   # Jaeger 导出器\n│   └── stdout/                   # Stdout 导出器\n└── resource/\n    └── resource.go               # K8s Resource 属性\n\npkg/middleware/grpc-middleware/opentelemetry/\n├── metric_server.interceptor.go      # gRPC 指标拦截器\n├── trace_server.interceptor.go       # gRPC 链路拦截器（Server）\n├── trace_client.interceptor.go       # gRPC 链路拦截器（Client）\n├── modular_server.interceptor.go     # 模调上报拦截器（Server/被调）\n└── modular_client.interceptor.go     # 模调上报拦截器（Client/主调）\n```\n\n## 14. 设计特点总结\n\n| 特点 | 说明 |\n|------|------|\n| OpenTelemetry 标准 | 基于 CNCF OpenTelemetry 标准实现 |\n| 多后端支持 | 支持 Prometheus、OTLP、Jaeger、Stdout 等 |\n| Pull/Push 双模式 | 同时支持 Pull（Prometheus）和 Push（OTLP）模式 |\n| 腾讯云兼容 | 原生支持腾讯云 Prometheus Remote Write |\n| APM Token 支持 | 支持腾讯云 APM Token 认证，作为 Resource attribute 注入 |\n| 智研平台支持 | 支持腾讯内部智研平台，通过 tps.tenant.id 认证，支持 Metric/Trace 上报 |\n| 配置驱动 | 通过 YAML/Proto 配置灵活切换后端 |\n| 中间件集成 | gRPC/HTTP 请求自动采集指标和链路 |\n| 资源监控 | 自动采集 CPU、内存、GC 等系统指标 |\n| 低侵入性 | 通过中间件透明接入，业务代码无感知 |\n| K8s 属性 | 自动采集 K8s 容器运行时信息 |\n| 模调上报 | 支持主调/被调标准化监控 |\n| 自定义 Metric API | 提供便捷的指标上报 API |\n| Global/App 双 Provider | 支持基础设施和应用级指标分离 |\n\n## 15. 常见问题排查\n\n### 15.1 智研上报超时\n\n**现象**：\n```\n[ERRO] metric export failed: context deadline exceeded: retry-able request failure\n```\n\n**原因与解决方案**：\n\n| 错误原因 | 解决方案 |\n|----------|----------|\n| 使用内网地址但不在内网 | 切换到外网地址 + HTTPS |\n| 使用外网地址但未启用 TLS | 设置 `insecure: false` |\n| 网络不通 | 检查防火墙和网络连通性 |\n\n**配置对照表**：\n\n```yaml\n# 内网环境（推荐）\nendpoint: \"<内网metric上报地址>:4318\"\ninsecure: true   # HTTP\n\n# 外网环境\nendpoint: \"<外网metric上报地址>:4318\"\ninsecure: false  # 必须 HTTPS\n```\n\n### 15.2 指标未上报到智研\n\n**检查清单**：\n\n1. **必填字段是否配置**：\n   - `__zhiyan_app_mark__`：必须配置 appMark\n   - `__zhiyan_env__`：必须配置环境标识\n\n2. **Temporality 是否正确**：\n   - 智研只支持 `Delta Temporality`\n   - 配置：`temporality_delta: true`\n\n3. **采集周期是否匹配**：\n   - 数据粒度为 60 时，采集周期应为 60s\n   - 配置：`metric_collect_duration: 60s`\n\n4. **压缩是否启用**：\n   - 建议启用 gzip：`compression: true`\n\n### 15.3 指标组/Scope Name 配置\n\n智研模调分析需要正确的指标组：\n\n| 指标组 | 用途 | 配置 |\n|--------|------|------|\n| `server_report` | 被调上报 | 服务端拦截器 |\n| `client_report` | 主调上报 | 客户端拦截器 |\n| `attr_report` | 属性监控 | 自定义业务指标 |\n| `default` | 默认 | 通用指标 |\n\n```yaml\nresource:\n  zhiyan:\n    metric_group: \"server_report\"  # 指标组名称\n```\n\n### 15.4 完整的智研配置示例\n\n```yaml\nopen_telemetry:\n  enabled: true\n  metric_collect_duration: 60s           # 采集周期与数据粒度一致\n  otel_metric_exporter_type: metric_otlp\n  otel_metric_exporter:\n    otlp:\n      # 根据网络环境选择内网或外网地址\n      endpoint: \"<智研metric上报地址>:4318\"\n      protocol: \"http\"\n      insecure: true                      # 内网 HTTP / 外网必须 false\n      url_path: \"/v1/metrics\"\n      compression: true                   # 启用 gzip 压缩\n      temporality_delta: true             # 必须使用 Delta\n\n  resource:\n    service_name: \"my-service\"\n    zhiyan:\n      global_app_mark: \"<your_global_app_mark>\" # 必填：appMark\n      env: \"prod\"                         # 必填：环境\n      instance_mark: \"\"                   # 选填：实例标识\n      expand_key: \"no\"                    # 选填：是否扩展属性\n      metric_group: \"server_report\"       # 选填：指标组\n      # data_grain: 60                    # 选填：数据粒度 (10/30/60)\n      # data_type: \"\"                     # 选填：秒级填 \"second\"\n```\n\n### 15.5 Trace 没有上报日志\n\n**现象**：\n- Meter 指标正常上报，但 Trace 没有任何 export 日志\n- 调用 HTTP 接口后没有看到 span 创建\n\n**原因分析**：\n\n| 原因 | 说明 |\n|------|------|\n| TracerProvider 初始化时机错误 | otelgrpc interceptor 在创建时会缓存全局 TracerProvider，如果此时 TracerProvider 还没设置，会拿到 noop TracerProvider |\n| HTTP 请求没有 trace interceptor | gRPC trace interceptor 只对 gRPC 请求生效，HTTP 请求需要单独的 HTTP trace middleware |\n| Sampler 配置问题 | 默认 Sampler 可能不是 AlwaysSample，导致部分 span 被丢弃 |\n\n**解决方案**：\n\n1. **确保 TracerProvider 在 WebServer.Run() 之前初始化**：\n\n```go\n// options.go 中的正确顺序\ns.installLogsOrDie()\ns.installConfigOrDie()\n\nws, err := s.webServerConfig.Complete().New(ctx)  // ← 先创建 WebServer\n\n// TracerProvider 可以在 WebServer.New() 之后初始化\n// 但必须在 WebServer.Run() 之前完成\ns.installOpenTelemetryTracerOrDie(ctx)\ns.installOpenTelemetryMeterOrDie(ctx, ws)\n\nws.PrepareRun().Run(ctx)  // ← 启动前 Provider 已设置好\n```\n\n2. **HTTP trace middleware 动态获取 TracerProvider**：\n\n```go\n// HTTP middleware 在每次请求时动态获取 TracerProvider\nfunc Trace(next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        tracer := otel.Tracer(tracerName)  // ← 请求时获取，此时已设置好\n        ctx, span := tracer.Start(ctx, spanName, ...)\n        // ...\n    })\n}\n```\n\n3. **gRPC trace interceptor 创建时缓存（注意）**：\n\n```go\nfunc UnaryServerTraceInterceptor(opts ...otelgrpc.Option) grpc.UnaryServerInterceptor {\n    // gRPC interceptor 在创建时缓存 TracerProvider\n    tp := otel.GetTracerProvider()\n    defaultOpts := []otelgrpc.Option{\n        otelgrpc.WithTracerProvider(tp),\n    }\n    defaultOpts = append(defaultOpts, opts...)\n    return otelgrpc.UnaryServerInterceptor(defaultOpts...)\n}\n```\n\n3. **添加 HTTP trace middleware**：\n\nHTTP 请求（如 `GET /Now`）不经过 gRPC interceptor，需要单独添加 HTTP trace middleware：\n\n```go\n// http trace interceptor\nfunc Trace(next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        ctx := r.Context()\n        \n        // 提取 trace context\n        propagator := otel.GetTextMapPropagator()\n        ctx = propagator.Extract(ctx, propagation.HeaderCarrier(r.Header))\n        \n        // 创建 span\n        tracer := otel.Tracer(\"http-trace\")\n        spanName := r.Method + \" \" + r.URL.Path\n        ctx, span := tracer.Start(ctx, spanName, trace.WithSpanKind(trace.SpanKindServer))\n        defer span.End()\n        \n        r = r.WithContext(ctx)\n        next.ServeHTTP(w, r)\n    })\n}\n```\n\n4. **确保使用 AlwaysSample**：\n\n```go\ntp := sdktrace.NewTracerProvider(\n    sdktrace.WithBatcher(exp, batchOpts...),\n    sdktrace.WithResource(res),\n    sdktrace.WithSampler(sdktrace.AlwaysSample()),  // 确保所有 span 都被记录\n)\n```\n\n**验证日志**：\n\n正确配置后，启动日志应显示：\n```\n[INFO] TracerProvider created with BatchSpanProcessor (batch_timeout=5s, sampler=AlwaysSample)\n[INFO] UnaryServerTraceInterceptor: creating trace interceptor, TracerProvider type=*trace.TracerProvider\n```\n\n如果显示 `TracerProvider type=*trace.noopTracerProvider`，说明 TracerProvider 初始化顺序有问题。\n\n### 15.6 Trace 上报连接失败 (EOF)\n\n**现象**：\n```\n[ERRO] [OTLP] trace export failed: traces export: Post \"http://xxx:4318/v1/traces\": EOF\n```\n\nSpan 创建成功，但导出到远程服务器失败。\n\n**原因分析**：\n\n| 原因 | 说明 |\n|------|------|\n| Endpoint 地址不可达 | 网络不通、DNS 解析失败、防火墙阻断 |\n| 协议不匹配 | 外网地址需要 HTTPS，但配置了 `insecure: true` |\n| 端口错误 | gRPC 用 4317，HTTP 用 4318 |\n\n**解决方案**：\n\n根据网络环境选择正确的配置：\n\n```yaml\n# 方案1：内网 gRPC（推荐）\notel_trace_exporter:\n  otlp:\n    endpoint: \"<内网trace上报地址>:4317\"\n    protocol: \"grpc\"\n    insecure: true\n\n# 方案2：内网 HTTP\notel_trace_exporter:\n  otlp:\n    endpoint: \"<内网trace上报地址>:4318\"\n    protocol: \"http\"\n    insecure: true\n\n# 方案3：外网 HTTP（必须 HTTPS）\notel_trace_exporter:\n  otlp:\n    endpoint: \"<外网trace上报地址>:4318\"\n    protocol: \"http\"\n    insecure: false  # 外网必须启用 TLS\n\n# 方案4：本地调试（stdout）\notel_trace_exporter_type: trace_stdout\n```\n\n**智研 Trace 上报地址汇总**：\n\n| 网络环境 | 协议 | 地址 | 端口 | TLS |\n|----------|------|------|------|-----|\n| 内网 IDC | gRPC | `<内网trace上报地址>` | 4317 | 否 |\n| 内网 IDC | HTTP | `<内网trace上报地址>` | 4318 | 否 |\n| 外网/DevCloud | gRPC | `<外网trace上报地址>` | 4317 | 否 |\n| 外网 | HTTP | `<外网metric上报地址>` | 4318 | **是** |\n\n### 15.7 Tracer 和 Meter 初始化顺序问题\n\n**问题**：Tracer 和 Meter 的初始化顺序有什么要求？\n\n**原因分析**：\n\n| 组件 | 必须在 WebServer 之前？ | 原因 |\n|------|------------------------|------|\n| **Tracer** | **否** | HTTP trace middleware 在请求时动态调用 `otel.Tracer()` 获取 TracerProvider |\n| **Meter** | 否（但有例外） | 指标也是在请求处理时动态调用 `otel.Meter()` 获取 |\n\n**HTTP Trace Middleware（动态获取）**：\n\n```go\n// HTTP trace middleware 在每次请求时动态获取 TracerProvider\nfunc Trace(next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        // 请求时动态获取，此时 TracerProvider 已设置\n        tracer := otel.Tracer(tracerName)  // ← 每次请求时获取\n        ctx, span := tracer.Start(ctx, spanName, ...)\n        defer span.End()\n        next.ServeHTTP(w, r)\n    })\n}\n```\n\n**gRPC Trace Interceptor（创建时缓存）**：\n\n```go\n// gRPC interceptor 在创建时获取并缓存 TracerProvider\nfunc UnaryServerTraceInterceptor(opts ...otelgrpc.Option) grpc.UnaryServerInterceptor {\n    // 创建时获取全局 TracerProvider 并传入\n    tp := otel.GetTracerProvider()\n    return otelgrpc.UnaryServerInterceptor(otelgrpc.WithTracerProvider(tp)...)\n}\n```\n\n> **注意**：如果 gRPC interceptor 在 TracerProvider 设置之前创建，会缓存 noop TracerProvider。但当前实现中，HTTP middleware 是动态获取的，所以 Tracer 可以在 WebServer 之后初始化。\n\n**Meter 的例外情况**：\n\n当使用 **Prometheus Pull 模式** 时，需要在 Gin Router 上注册 `/metrics` 端点，此时需要先有 WebServer：\n\n```go\n// 需要 ws.GetGinEngine() 来注册 /metrics\ns.opentelemetryConfig.ApplyOptions(opentelemetry_.WithGinRouter(ws.GetGinEngine()))\n```\n\n**推荐的初始化顺序**：\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                     启动顺序                                  │\n├─────────────────────────────────────────────────────────────┤\n│  1. installLogs                                              │\n│  2. installConfig                                            │\n│  3. WebServer.New()                                          │\n│  4. installMysql/Redis                                       │\n│  5. installOpenTelemetryTracer  ←── 可以在 WebServer 之后     │\n│  6. installOpenTelemetryMeter   ←── 可以在 WebServer 之后     │\n│  7. WebServer.Run()             ←── 必须在 Run() 之前完成     │\n└─────────────────────────────────────────────────────────────┘\n```\n\n> **关键点**：只要在 `WebServer.Run()` 之前完成 TracerProvider 和 MeterProvider 的初始化即可，因为 HTTP middleware 是在请求时动态获取 Provider 的。\n\n### 15.8 调试技巧\n\n**1. 启用 stdout exporter 验证 span 创建**：\n\n```yaml\notel_trace_exporter_type: trace_stdout  # 临时切换到 stdout\notel_trace_exporter:\n  stdout:\n    pretty_print: true\n```\n\n**2. 启用 metric stdout exporter 查看上报数据**：\n\n```yaml\notel_metric_exporter_type: metric_stdout\notel_metric_exporter:\n  stdout:\n    pretty_print: true\n```\n\n**3. 日志中确认 Resource Attribute**：\n```\n[DEBU] [OTLP] resource attribute: __zhiyan_app_mark__=<your_app_mark>\n```\n\n**4. 确认 TracerProvider 类型**：\n```\n[INFO] UnaryServerTraceInterceptor: creating trace interceptor, TracerProvider type=*trace.TracerProvider\n```\n\n如果显示 `*trace.noopTracerProvider`，说明初始化顺序有问题。\n\n**5. 检查 span export 日志**：\n```\n[DEBU] [OTLP] exporting 1 spans to <trace上报地址>:4317\n[INFO] [OTLP] trace export success: endpoint=xxx, spans=1, duration=xxx\n```\n\n**6. 网络连通性测试**：\n```bash\n# 测试 gRPC 端口\nnc -zv <trace上报地址> 4317\n\n# 测试 HTTP 端口\ncurl -v http://<trace上报地址>:4318/v1/traces\n```\n"
  },
  {
    "path": "doc/rate_limit_design.md",
    "content": "# 限流增强功能设计文档\n\n## 1. 概述\n\n本文档描述了 golang 库中限流（Rate Limit）功能的增强设计，支持**基于 QPS 的限流**、**并发数控制**和**不同接口不同限流策略**的能力。\n\n## 2. 限流模式分析\n\n### 2.1 并发控制限流器 (Limiter)\n\n基于**Channel 信号量**的并发控制器：\n\n```go\ntype Limiter struct {\n  mu    sync.Mutex\n  burst int             // 最大令牌数（最大并发数）\n  sem   chan struct{}   // 信号量通道\n}\n```\n\n**特点**：\n- 控制**同时处理的请求数**（并发数）\n- 请求完成后需要调用 `Put()` 归还令牌\n- 适合控制资源占用，如数据库连接数、goroutine 数量\n- 基于 Channel 实现，原生支持超时和 Context 取消\n\n### 2.2 QPS 限流器 (QPSLimiter)\n\n基于**令牌桶算法**的速率控制器：\n\n```go\ntype QPSLimiter struct {\n  qps        float64   // 每秒生成的令牌数\n  burst      int       // 桶容量（允许的突发流量）\n  tokens     float64   // 当前可用令牌\n  lastUpdate time.Time // 上次更新时间\n}\n```\n\n**特点**：\n- 控制**每秒允许的请求数**（速率）\n- 令牌按时间自动恢复，无需归还\n- 适合流量控制和防止突发流量\n\n### 2.3 两种模式对比\n\n| 特性 | 并发限流器 (Limiter) | QPS 限流器 (QPSLimiter) |\n|------|---------------------|------------------------|\n| 控制目标 | 同时处理的请求数 | 每秒允许的请求数 |\n| 令牌归还 | 需要 Put() | 不需要（时间自动恢复） |\n| 适用场景 | 资源保护 | 流量控制 |\n| 限制维度 | 资源维度 | 时间维度 |\n| 实现方式 | Channel 信号量 | 令牌桶算法 |\n| Context 支持 | 原生支持 | 原生支持 |\n\n### 2.4 组合使用\n\n**当 QPS 和并发数同时配置时，两种限流同时生效，取更严格的限制**：\n\n```\n请求进入\n    ↓\n┌─────────────────────┐\n│  QPS限流检查        │ ← 令牌桶算法，按时间恢复\n│  (default_qps=1000) │\n└─────────┬───────────┘\n          │ 通过\n          ↓\n┌─────────────────────┐\n│  并发数检查         │ ← 信号量算法，请求完成归还\n│  (max_concurrency=100) │\n└─────────┬───────────┘\n          │ 通过\n          ↓\n      处理请求\n          ↓\n      归还并发令牌\n```\n\n**实际吞吐量 = min(QPS限制, 并发数 × (1000/平均处理时间ms))**\n\n## 3. 架构设计\n\n### 3.1 整体架构\n\n```\n┌─────────────────────────────────────────────────────────────────────┐\n│                         配置层 (YAML)                                │\n│  ┌───────────────────────────────────────────────────────────────┐ │\n│  │ web:                                                           │ │\n│  │   qps_limit:                                                   │ │\n│  │     grpc:                                                      │ │\n│  │       default_qps: 1000                                        │ │\n│  │       max_concurrency: 100                                     │ │\n│  │     http:                                                      │ │\n│  │       default_qps: 1000                                        │ │\n│  │       max_concurrency: 100                                     │ │\n│  └───────────────────────────────────────────────────────────────┘ │\n└─────────────────────────────────────────────────────────────────────┘\n                                  │\n                                  ▼\n┌─────────────────────────────────────────────────────────────────────┐\n│                       中间件层 (Interceptor)                         │\n│  ┌─────────────────────────┐    ┌─────────────────────────────────┐│\n│  │   gRPC 拦截器            │    │   HTTP 中间件                    ││\n│  │   - QPS 限流拦截器       │    │   - QPS 限流中间件               ││\n│  │   - 并发控制拦截器       │    │   - 并发控制中间件               ││\n│  └─────────────────────────┘    └─────────────────────────────────┘│\n└─────────────────────────────────────────────────────────────────────┘\n                                  │\n                                  ▼\n┌─────────────────────────────────────────────────────────────────────┐\n│                       核心限流器层                                   │\n│  ┌─────────────────────────┐    ┌─────────────────────────────────┐│\n│  │   MethodQPSLimiter      │    │   MethodLimiter                 ││\n│  │   (方法级 QPS 限流)      │    │   (方法级并发控制)               ││\n│  └─────────────────────────┘    └─────────────────────────────────┘│\n│                 │                              │                    │\n│                 ▼                              ▼                    │\n│  ┌─────────────────────────┐    ┌─────────────────────────────────┐│\n│  │   QPSLimiter            │    │   Limiter                       ││\n│  │   (令牌桶算法)           │    │   (信号量算法)                   ││\n│  └─────────────────────────┘    └─────────────────────────────────┘│\n└─────────────────────────────────────────────────────────────────────┘\n```\n\n### 3.2 方法级限流\n\n支持为不同的 API 接口配置不同的限流策略：\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                   MethodQPSLimiter                          │\n│  ┌───────────────────────────────────────────────────────┐ │\n│  │                   Method -> Limiter Map               │ │\n│  │  ┌─────────────────────────────────────────────────┐  │ │\n│  │  │ /api/v1/users    -> QPSLimiter(qps=100, burst=20)│ │ │\n│  │  │ /api/v1/orders   -> QPSLimiter(qps=50,  burst=10)│ │ │\n│  │  │ /api/v1/products -> QPSLimiter(qps=200, burst=50)│ │ │\n│  │  │ *                -> QPSLimiter(qps=10,  burst=5) │ │ │\n│  │  └─────────────────────────────────────────────────┘  │ │\n│  └───────────────────────────────────────────────────────┘ │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## 4. 配置设计\n\n### 4.1 配置结构\n\n限流配置统一放在 `web.qps_limit` 下，支持 gRPC 和 HTTP 分别配置：\n\n```yaml\nweb:\n  bind_address:\n    port: 10001\n  grpc:\n    timeout: 0s\n  http:\n    api_formatter: trivial_api_v20\n  # QPS限流配置（统一在 web 配置内）\n  qps_limit:\n    # gRPC QPS限流配置\n    grpc:\n      default_qps: 1000       # 默认QPS，0表示不限制\n      default_burst: 1500     # 默认突发容量，0表示使用default_qps值\n      max_concurrency: 100    # 最大并发数限制，0表示不限制\n      method_qps:             # 方法级配置（可选）\n      - method: \"/seadate.v1.SeaDateService/Now\"\n        qps: 500\n        burst: 750\n        max_concurrency: 50\n    # HTTP QPS限流配置\n    http:\n      default_qps: 1000\n      default_burst: 1500\n      max_concurrency: 100\n      method_qps:             # 路径级配置（可选）\n      - method: \"/v1/now\"\n        qps: 500\n        burst: 750\n        max_concurrency: 50\n```\n\n### 4.2 配置优先级\n\n```\n方法级配置 (method_qps) > 全局默认配置 (default_*)\n```\n\n| 请求路径 | method_qps 配置 | 实际使用 |\n|---------|----------------|---------|\n| `/v1/now` | 有配置 `qps:500` | 使用 500 QPS |\n| `/v1/users` | 无配置 | 使用 `default_qps: 1000` |\n\n### 4.3 配置参数说明\n\n| 参数 | 类型 | 说明 | 默认值 |\n|------|------|------|--------|\n| `default_qps` | float64 | 默认每秒请求数限制，0表示不限制 | 0 |\n| `default_burst` | int | 默认突发容量，0表示使用default_qps值 | 0 |\n| `max_concurrency` | int | 最大并发数限制，0表示不限制 | 0 |\n| `method_qps` | array | 方法级配置列表 | [] |\n\n## 5. 核心实现\n\n### 5.1 Limiter (并发控制)\n\n基于 **Channel 信号量**实现，移除了对自定义 `sync.Cond` 的依赖：\n\n```go\ntype Limiter struct {\n  mu    sync.Mutex\n  burst int             // 最大并发数\n  sem   chan struct{}   // 信号量通道\n}\n\n// 创建并发限流器\nfunc NewLimiter(b int) *Limiter\n\n// 核心方法\nfunc (lim *Limiter) Allow() bool                        // 立即获取，不等待\nfunc (lim *Limiter) AllowN(n int) bool                  // 获取 n 个令牌\nfunc (lim *Limiter) AllowFor(timeout time.Duration) bool // 带超时等待\nfunc (lim *Limiter) AllowContext(ctx context.Context) error // Context 支持\nfunc (lim *Limiter) Put()                               // 归还令牌\nfunc (lim *Limiter) PutN(n int)                         // 归还 n 个令牌\n\n// 等待方法\nfunc (lim *Limiter) WaitFor(timeout time.Duration) error\nfunc (lim *Limiter) WaitN(timeout time.Duration, n int) error\nfunc (lim *Limiter) WaitContext(ctx context.Context) error\nfunc (lim *Limiter) WaitNContext(ctx context.Context, n int) error\n\n// 查询和动态调整\nfunc (lim *Limiter) Burst() int     // 获取最大并发数\nfunc (lim *Limiter) Tokens() int    // 获取当前可用令牌\nfunc (lim *Limiter) Bursting() int  // 获取当前正在使用的令牌数\nfunc (lim *Limiter) SetBurst(int)   // 动态调整最大并发数\n```\n\n**实现原理**：\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    Limiter (Channel 信号量)                  │\n│  ┌───────────────────────────────────────────────────────┐ │\n│  │   sem: chan struct{} (buffered channel)               │ │\n│  │   ┌─────────────────────────────────────────────────┐ │ │\n│  │   │  [token] [token] [token] ... [token]            │ │ │\n│  │   │  ← burst 个预填充令牌                            │ │ │\n│  │   └─────────────────────────────────────────────────┘ │ │\n│  │                                                       │ │\n│  │   Allow():  select { case <-sem: return true }        │ │\n│  │   Put():    select { case sem <- struct{}{}: }        │ │\n│  └───────────────────────────────────────────────────────┘ │\n└─────────────────────────────────────────────────────────────┘\n```\n\n**相比旧实现的改进**：\n\n| 改进点 | 旧实现 | 新实现 |\n|-------|-------|-------|\n| 依赖 | 自定义 `sync_.Cond` | 标准库 `channel` |\n| 超时机制 | `cond.WaitForDo` | `select` + `time.After` |\n| Context 支持 | 无 | 原生支持 |\n| 动态调整 | 无 | `SetBurst()` |\n| 代码复杂度 | 较高 | 简洁 |\n\n### 5.2 QPSLimiter\n\n基于**令牌桶算法**实现：\n\n```go\ntype QPSLimiter struct {\n  mu         sync.Mutex\n  qps        float64   // 每秒生成的令牌数\n  burst      int       // 桶容量（最大令牌数）\n  tokens     float64   // 当前可用令牌\n  lastUpdate time.Time // 上次更新时间\n}\n\n// 创建 QPS 限流器\nfunc NewQPSLimiter(qps float64, burst int) *QPSLimiter\n\n// 核心方法\nfunc (l *QPSLimiter) Allow() bool                    // 立即判断是否允许\nfunc (l *QPSLimiter) AllowN(n int) bool              // 请求 n 个令牌\nfunc (l *QPSLimiter) Wait(ctx context.Context) error // 阻塞等待令牌\nfunc (l *QPSLimiter) AllowFor(timeout time.Duration) bool // 带超时等待\n```\n\n### 5.3 MethodQPSLimiter\n\n```go\ntype MethodQPSLimiter struct {\n  mu       sync.RWMutex\n  limiters map[string]*QPSLimiter // 方法 -> 限流器映射\n  global   *QPSLimiter            // 默认全局限流器\n}\n\n// 方法 QPS 配置\ntype MethodQPSConfig struct {\n  Method string  // API 方法名\n  QPS    float64 // 每秒请求数\n  Burst  int     // 突发容量\n}\n\n// 创建方法级限流器\nfunc NewMethodQPSLimiter(defaultQPS float64, defaultBurst int) *MethodQPSLimiter\nfunc NewMethodQPSLimiterWithConfigs(defaultQPS float64, defaultBurst int, \n    configs []MethodQPSConfig) (*MethodQPSLimiter, error)\n\n// 动态管理方法限流\nfunc (m *MethodQPSLimiter) AddMethod(method string, qps float64, burst int) error\nfunc (m *MethodQPSLimiter) SetMethodQPS(method string, qps float64, burst int) error\nfunc (m *MethodQPSLimiter) RemoveMethod(method string)\n\n// 限流判断（自动选择对应的限流器）\nfunc (m *MethodQPSLimiter) Allow(method string) bool\nfunc (m *MethodQPSLimiter) AllowFor(method string, timeout time.Duration) bool\n```\n\n### 5.4 配置转换\n\n```go\n// QPSLimitConfig 限流配置结构\ntype QPSLimitConfig struct {\n  DefaultQPS     float64\n  DefaultBurst   int\n  MaxConcurrency int\n  MethodQPS      []MethodQPSConfigItem\n}\n\n// 转换为gRPC网关QPS限流配置\nfunc (c *QPSLimitConfig) ToGRPCQPSLimitConfig() gw_.QPSLimitConfig\n\n// 转换为HTTP QPS限流配置\nfunc (c *QPSLimitConfig) ToHTTPQPSLimitConfig() gw_.HTTPQPSLimitConfig\n```\n\n## 6. 中间件集成\n\n### 6.1 gRPC 拦截器\n\n```go\n// 创建方法级 QPS 限流器\nlimiter := ratelimit.NewMethodQPSLimiter(100, 20) // 默认 100 QPS\nlimiter.AddMethod(\"/service.UserService/GetUser\", 500, 100)\nlimiter.AddMethod(\"/service.OrderService/CreateOrder\", 50, 10)\n\n// 应用拦截器\nserver := grpc.NewServer(\n  grpc.UnaryInterceptor(ratelimit.UnaryServerInterceptorQPS(limiter)),\n  grpc.StreamInterceptor(ratelimit.StreamServerInterceptorQPS(limiter)),\n)\n```\n\n### 6.2 HTTP 中间件\n\n```go\n// 创建 QPS 限流器\nlimiter := ratelimit.NewQPSRateLimiter(100, 20) // 默认 100 QPS\nlimiter.AddPath(\"/api/v1/users\", 500, 100)\nlimiter.AddPath(\"/api/v1/orders\", 50, 10)\n\n// 应用中间件\nhttp.Handle(\"/\", limiter.Handler(yourHandler))\n\n// 暴露限流统计\nhttp.Handle(\"/debug/ratelimit\", limiter.StatsHandler())\n```\n\n### 6.3 通过配置自动集成\n\n在 `webserver.Config` 中自动安装限流中间件：\n\n```go\n// installHttpMiddlewareChain 安装 HTTP 中间件链\nfunc (c *Config) installHttpMiddlewareChain() []gw_.GRPCGatewayOption {\n  // ... 其他中间件\n\n  // QPS限流和并发控制（通过扩展配置）\n  if c.opts.httpQPSLimit != nil {\n    opts = append(opts, gw_.WithHttpHandlerInterceptorsQPSLimitOptions(\n      c.opts.httpQPSLimit.ToHTTPQPSLimitConfig(),\n    ))\n  }\n  \n  return opts\n}\n\n// installGrpcMiddlewareChain 安装 gRPC 中间件链\nfunc (c *Config) installGrpcMiddlewareChain() []gw_.GRPCGatewayOption {\n  // ... 其他中间件\n\n  // QPS限流和并发控制（通过扩展配置）\n  if c.opts.grpcQPSLimit != nil {\n    opts = append(opts, gw_.WithServerInterceptorsQPSLimitOptions(\n      c.opts.grpcQPSLimit.ToGRPCQPSLimitConfig(),\n    ))\n  }\n\n  return opts\n}\n```\n\n## 7. 使用示例\n\n### 7.1 并发限流器基本使用\n\n```go\n// 创建并发限流器：最大 100 并发\nlimiter := rate.NewLimiter(100)\n\n// 立即获取令牌\nif limiter.Allow() {\n  defer limiter.Put()\n  // 处理请求\n}\n\n// 带超时等待\nif limiter.AllowFor(100 * time.Millisecond) {\n  defer limiter.Put()\n  // 处理请求\n}\n\n// 使用 Context（推荐）\nctx, cancel := context.WithTimeout(context.Background(), time.Second)\ndefer cancel()\nif err := limiter.AllowContext(ctx); err == nil {\n  defer limiter.Put()\n  // 处理请求\n}\n\n// 动态调整最大并发数\nlimiter.SetBurst(200)\n```\n\n### 7.2 QPS 限流器基本使用\n\n```go\n// 创建 QPS 限流器：100 QPS，允许突发 20 个请求\nlimiter := rate.NewQPSLimiter(100, 20)\n\n// 判断是否允许\nif limiter.Allow() {\n  // 处理请求\n}\n\n// 带超时等待\nif limiter.AllowFor(100 * time.Millisecond) {\n  // 处理请求\n}\n\n// 阻塞等待\nctx, cancel := context.WithTimeout(context.Background(), time.Second)\ndefer cancel()\nif err := limiter.Wait(ctx); err == nil {\n  // 处理请求\n}\n```\n\n### 7.3 方法级限流\n\n```go\n// 配置不同接口的 QPS\nconfigs := []rate.MethodQPSConfig{\n  {Method: \"/api/v1/users\", QPS: 100, Burst: 20},\n  {Method: \"/api/v1/orders\", QPS: 50, Burst: 10},\n  {Method: \"/api/v1/products\", QPS: 200, Burst: 50},\n}\n\n// 创建限流器，默认 10 QPS\nlimiter, _ := rate.NewMethodQPSLimiterWithConfigs(10, 5, configs)\n\n// 使用（自动选择对应的限流器）\nlimiter.Allow(\"/api/v1/users\")    // 使用 100 QPS\nlimiter.Allow(\"/api/v1/orders\")   // 使用 50 QPS\nlimiter.Allow(\"/api/v1/unknown\")  // 使用默认 10 QPS\n```\n\n### 7.4 动态调整\n\n```go\nlimiter := rate.NewMethodQPSLimiter(100, 20)\n\n// 动态添加方法限流\nlimiter.AddMethod(\"/api/v1/hot-endpoint\", 500, 100)\n\n// 动态调整 QPS\nlimiter.SetMethodQPS(\"/api/v1/hot-endpoint\", 1000, 200)\n\n// 移除方法限流（使用全局限流）\nlimiter.RemoveMethod(\"/api/v1/hot-endpoint\")\n\n// 调整全局 QPS\nlimiter.SetGlobalQPS(200, 50)\n```\n\n### 7.5 查看统计\n\n```go\nlimiter := rate.NewMethodQPSLimiter(100, 20)\nlimiter.AddMethod(\"/api/v1/users\", 500, 100)\n\n// 获取统计信息\nstats := limiter.Stats()\nfor _, s := range stats {\n  fmt.Printf(\"Method: %s, QPS: %.0f, Burst: %d, Available: %.1f\\n\",\n    s.Method, s.QPS, s.Burst, s.Tokens)\n}\n// Output:\n// Method: *, QPS: 100, Burst: 20, Available: 20.0\n// Method: /api/v1/users, QPS: 500, Burst: 100, Available: 100.0\n```\n\n### 7.6 压测验证\n\n```bash\n# 配置 max_concurrency: 10 后进行压测\nbombardier -n 30000 -c 3000 -t 10s -H Content-type:application/json -m POST http://127.0.0.1:10001/Now\n\n# 预期结果：大量请求被限流拒绝，返回 429\n# HTTP codes:\n#   1xx - 0, 2xx - 2047, 3xx - 0, 4xx - 27869, 5xx - 0\n# 4xx 表示被限流拒绝的请求（HTTP 429 Too Many Requests）\n```\n\n## 8. API 响应格式\n\n### 8.1 HTTP 限流响应\n\n**QPS 限流**：\n```json\nHTTP/1.1 429 Too Many Requests\nContent-Type: application/json\nRetry-After: 1\n\n{\n  \"error\": \"rate_limit_exceeded\",\n  \"message\": \"GET /api/v1/users is rejected by http_qps middleware, QPS limit exceeded\",\n  \"code\": 429\n}\n```\n\n**并发数限流**：\n```json\nHTTP/1.1 429 Too Many Requests\nContent-Type: application/json\n\n{\n  \"error\": \"concurrency_limit_exceeded\",\n  \"message\": \"POST /Now is rejected by http_concurrency middleware, max concurrency exceeded\",\n  \"code\": 429\n}\n```\n\n### 8.2 gRPC 限流响应\n\n```\ncode: RESOURCE_EXHAUSTED\nmessage: \"/service.UserService/GetUser is rejected, QPS limit exceeded\"\n```\n\n## 9. 文件结构\n\n```\ngo/time/rate/\n├── rate.go              # 并发控制限流器（信号量）\n├── rate_method.go       # 方法级并发限流器\n├── rate_qps.go          # QPS 限流器（令牌桶）\n├── rate_qps_method.go   # 方法级 QPS 限流器\n├── rate_qps_test.go     # QPS 限流器测试\n└── rate_test.go         # 并发限流器测试\n\npkg/webserver/\n├── config.go            # Web 服务配置（安装限流中间件）\n├── config.option.go     # 配置选项\n├── webserver.proto      # Proto 定义\n├── webserver.yaml       # 示例配置\n└── webserver_qps_limit.go # QPS 限流配置转换\n\npkg/grpc-gateway/\n├── grpc_gateway_grpc.option.go  # gRPC QPS 限流选项\n└── grpc_gateway_http.option.go  # HTTP QPS 限流选项\n\npkg/middleware/grpc-middleware/ratelimit/\n├── ratelimit_server.interceptor.go      # 并发限流拦截器\n└── ratelimit_qps_server.interceptor.go  # QPS 限流拦截器\n\npkg/middleware/http-middleware/ratelimiter/\n├── ratelimiter.go       # 并发限流中间件\n└── ratelimiter_qps.go   # QPS 限流中间件\n```\n\n## 10. 设计特点总结\n\n| 特点 | 说明 |\n|------|------|\n| 双重限流 | 同时支持 QPS 限流（令牌桶）和并发控制（Channel 信号量） |\n| 配置统一 | 限流配置统一放在 `web.qps_limit` 下，结构清晰 |\n| 方法级配置 | 支持为不同 API 接口配置不同的限流策略 |\n| 动态调整 | 运行时动态添加、修改、删除方法限流配置，支持 `SetBurst()` |\n| 等待模式 | 支持立即返回、带超时等待、阻塞等待三种模式 |\n| Context 支持 | 原生支持 `context.Context`，符合 Go 惯例 |\n| 统计信息 | 提供限流统计接口，便于监控和调试 |\n| 线程安全 | 使用 Channel 和互斥锁保证并发安全 |\n| 无外部依赖 | 仅依赖标准库，移除了对自定义 `sync.Cond` 的依赖 |\n| 向后兼容 | 旧的 `max_concurrency_unary` 等配置已废弃，统一使用新配置 |\n\n## 11. 废弃配置说明\n\n以下配置已废弃，统一使用 `web.qps_limit` 配置：\n\n| 废弃配置 | 新配置 |\n|---------|-------|\n| `web.grpc.max_concurrency_unary` | `web.qps_limit.grpc.max_concurrency` |\n| `web.grpc.max_concurrency_stream` | `web.qps_limit.grpc.max_concurrency` |\n| `web.http.max_concurrency` | `web.qps_limit.http.max_concurrency` |\n\n## 12. 实现演进\n\n### 12.1 Limiter 重构（v2.0）\n\n**变更原因**：\n- 旧实现依赖自定义 `sync_.Cond`，增加了维护成本\n- 自定义 Cond 的超时实现复杂，不如 Channel 原生支持\n\n**变更内容**：\n\n| 项目 | 旧实现 | 新实现 |\n|------|-------|-------|\n| 核心数据结构 | `tokens int` + `sync_.Cond` | `sem chan struct{}` |\n| 超时等待 | `cond.WaitForDo(timeout, pred, do)` | `select { case <-sem: case <-time.After(timeout): }` |\n| Context 支持 | 无 | `AllowContext()`, `WaitContext()` |\n| 动态调整 | 无 | `SetBurst()` |\n| 依赖 | `github.com/kaydxh/golang/go/sync` | 仅标准库 |\n\n**API 兼容性**：\n- ✅ `Allow()`, `AllowFor()`, `AllowWaitUntil()` - 签名不变\n- ✅ `Put()`, `PutN()` - 签名不变\n- ✅ `WaitFor()`, `WaitN()` - 签名不变\n- ✅ `Burst()`, `Bursting()` - 签名不变\n- ➕ 新增 `Tokens()`, `SetBurst()`, `AllowN()`, `AllowContext()`, `WaitContext()`, `WaitNContext()`\n"
  },
  {
    "path": "doc.go",
    "content": "package golang\n\nimport _ \"github.com/kaydxh/golang/go\"\n"
  },
  {
    "path": "go/archive/archive.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage archive\n\nimport (\n\t\"github.com/kaydxh/golang/go/archive/option\"\n)\n\n// Archiver defines the interface for archive extraction operations\ntype Archiver interface {\n\t// Extract extracts all files from srcFile to destDir and returns a list of extracted file info\n\tExtract(srcFile, destDir string) ([]*option.FileInfo, error)\n\t// ExtractStream extracts files from srcFile to destDir and streams the results through a channel\n\tExtractStream(srcFile, destDir string) <-chan option.ExtractMsg\n}\n"
  },
  {
    "path": "go/archive/option/file_info.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage option\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\ntype FileInfo struct {\n\tPath     string\n\tFileInfo os.FileInfo\n}\n\nfunc (e *FileInfo) String() string {\n\treturn fmt.Sprintf(\n\t\t\"{path: [%v], size: [%v], modeTime: [%v]}\",\n\t\te.Path,\n\t\te.FileInfo.Size(),\n\t\te.FileInfo.ModTime(),\n\t)\n}\n\ntype ExtractMsg struct {\n\tFileInfo *FileInfo\n\tError    error\n}\n\nfunc (e *ExtractMsg) String() string {\n\tif e.Error != nil {\n\t\treturn fmt.Sprintf(\"{error: %v}\", e.Error)\n\t}\n\tif e.FileInfo == nil {\n\t\treturn \"{fileInfo: nil}\"\n\t}\n\treturn fmt.Sprintf(\n\t\t\"{path: [%v], size: [%v], modeTime: [%v]}\",\n\t\te.FileInfo.Path,\n\t\te.FileInfo.FileInfo.Size(),\n\t\te.FileInfo.FileInfo.ModTime(),\n\t)\n}\n"
  },
  {
    "path": "go/archive/zip/zip.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage zip\n\nimport (\n\t\"archive/zip\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/kaydxh/golang/go/archive/option\"\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\t\"golang.org/x/text/encoding/simplifiedchinese\"\n\t\"golang.org/x/text/transform\"\n)\n\n// Zip implements the Archiver interface for ZIP archive extraction\ntype Zip struct {\n}\n\nfunc (z Zip) Extract(srcFile, destDir string) ([]*option.FileInfo, error) {\n\tr, err := zip.OpenReader(srcFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open zip file %s: %w\", srcFile, err)\n\t}\n\tdefer r.Close()\n\n\terr = os_.MakeDirAll(destDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create destination directory %s: %w\", destDir, err)\n\t}\n\n\tvar extractedFiles []*option.FileInfo\n\tfor _, f := range r.File {\n\t\tfileInfo, err := z.extractAndWriteFile(destDir, f)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to extract file %s: %w\", f.Name, err)\n\t\t}\n\n\t\tif fileInfo != nil {\n\t\t\textractedFiles = append(extractedFiles, fileInfo)\n\t\t}\n\t}\n\n\treturn extractedFiles, nil\n}\n\nfunc (z Zip) ExtractStream(\n\tsrcFile, destDir string,\n) <-chan option.ExtractMsg {\n\n\tfileInfoCh := make(chan option.ExtractMsg, 1024)\n\n\tgo func() {\n\t\tdefer close(fileInfoCh)\n\t\tr, err := zip.OpenReader(srcFile)\n\t\tif err != nil {\n\t\t\tfileInfoCh <- option.ExtractMsg{\n\t\t\t\tError: fmt.Errorf(\"failed to open zip file %s: %w\", srcFile, err),\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tdefer r.Close()\n\n\t\terr = os_.MakeDirAll(destDir)\n\t\tif err != nil {\n\t\t\tfileInfoCh <- option.ExtractMsg{\n\t\t\t\tError: fmt.Errorf(\"failed to create destination directory %s: %w\", destDir, err),\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tfor _, f := range r.File {\n\t\t\tfileInfo, err := z.extractAndWriteFile(destDir, f)\n\t\t\tif err != nil {\n\t\t\t\tfileInfoCh <- option.ExtractMsg{\n\t\t\t\t\tError: fmt.Errorf(\"failed to extract file %s: %w\", f.Name, err),\n\t\t\t\t}\n\t\t\t\t// Continue processing other files instead of returning\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif fileInfo != nil {\n\t\t\t\tfileInfoCh <- option.ExtractMsg{\n\t\t\t\t\tFileInfo: fileInfo,\n\t\t\t\t\tError:    nil,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn fileInfoCh\n}\n\nfunc (z Zip) extractAndWriteFile(\n\tdestDir string,\n\tf *zip.File,\n) (*option.FileInfo, error) {\n\n\tif f == nil {\n\t\treturn nil, fmt.Errorf(\"invalid zip file\")\n\t}\n\n\tdecodeName := f.Name\n\tif !utf8.Valid([]byte(f.Name)) {\n\t\ti := bytes.NewReader([]byte(f.Name))\n\t\tdecoder := transform.NewReader(\n\t\t\ti,\n\t\t\tsimplifiedchinese.GB18030.NewDecoder(),\n\t\t)\n\t\tcontent, err := io.ReadAll(decoder)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to decode filename %s: %w\", f.Name, err)\n\t\t}\n\t\tdecodeName = string(content)\n\t}\n\n\tbaseName := filepath.Base(f.Name)\n\tif strings.HasPrefix(baseName, \".\") {\n\t\treturn nil, nil\n\t}\n\n\trc, err := f.Open()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open file %s from zip: %w\", f.Name, err)\n\t}\n\tdefer func() {\n\t\tif closeErr := rc.Close(); closeErr != nil {\n\t\t\t// If there's already an error, wrap it; otherwise set the close error\n\t\t\tif err != nil {\n\t\t\t\terr = fmt.Errorf(\"%w; close error: %v\", err, closeErr)\n\t\t\t} else {\n\t\t\t\terr = fmt.Errorf(\"failed to close file %s: %w\", f.Name, closeErr)\n\t\t\t}\n\t\t}\n\t}()\n\n\t// Security check: prevent zip slip attack by ensuring the resolved path is within destDir\n\tpath := filepath.Join(destDir, decodeName)\n\tresolvedPath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to resolve path %s: %w\", path, err)\n\t}\n\tdestDirAbs, err := filepath.Abs(destDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to resolve destination directory %s: %w\", destDir, err)\n\t}\n\tif !strings.HasPrefix(resolvedPath, destDirAbs+string(filepath.Separator)) && resolvedPath != destDirAbs {\n\t\treturn nil, fmt.Errorf(\"zip slip detected: file path %s is outside destination directory %s\", decodeName, destDir)\n\t}\n\n\tif f.FileInfo().IsDir() {\n\t\terr = os_.MakeDirAll(resolvedPath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create directory %s: %w\", resolvedPath, err)\n\t\t}\n\n\t\treturn nil, nil\n\t}\n\n\tfn, err := os_.OpenFile(resolvedPath, false)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create file %s: %w\", resolvedPath, err)\n\t}\n\tdefer fn.Close()\n\n\t_, err = io.Copy(fn, rc)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to write file %s: %w\", resolvedPath, err)\n\t}\n\n\treturn &option.FileInfo{\n\t\tPath:     fn.Name(),\n\t\tFileInfo: f.FileInfo(),\n\t}, nil\n}\n"
  },
  {
    "path": "go/archive/zip/zip_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage zip_test\n\nimport (\n\t\"testing\"\n\n\tzip_ \"github.com/kaydxh/golang/go/archive/zip\"\n)\n\nfunc TestExtractZip(t *testing.T) {\n\tsrcFile := \"./新词词典.zip\"\n\tdestDir := \"unzip\"\n\tfileInfos, err := zip_.Zip{}.Extract(srcFile, destDir)\n\tif err != nil {\n\t\tt.Errorf(\"failed to Extract zip file: [%v], err: [%v]\", srcFile, err)\n\t}\n\n\tt.Logf(\"extract file: [%v], result: [%+v]\", srcFile, fileInfos)\n\t/*\n\n\t\tfor extractMsg := range zip_.Zip{}.Extract(srcFile, destDir) {\n\t\t\tif extractMsg.Err != nil {\n\t\t\t\tfmt.Println(msg.Error)\n\t\t\t} else {\n\t\t\t  fmt.Printf(\"fileInfo:[%v]\", *msg.FileInfo)\n\t\t\t}\n\t\t}\n\t*/\n}\n"
  },
  {
    "path": "go/bytes/bytes.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage bytes\n\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\nfunc Truncate(s []byte, n int) []byte {\n\tif n < 0 {\n\t\tn = 0\n\t}\n\n\tif len(s) <= n {\n\t\treturn s\n\t}\n\n\treturn s[:n]\n}\n\nfunc Encode[T any](m T) []byte {\n\tif reflect.ValueOf(m).IsZero() {\n\t\treturn nil\n\t}\n\n\tsz := int(unsafe.Sizeof(m))\n\tp := make([]byte, sz)\n\n\tslice := (*reflect.SliceHeader)(unsafe.Pointer(&p))\n\tslice.Data = uintptr(unsafe.Pointer(&m))\n\tslice.Len = sz\n\tslice.Cap = sz\n\treturn p\n}\n\nfunc Decode[T any](b []byte) T {\n\tvar zero T\n\tif len(b) == 0 {\n\t\treturn zero\n\t}\n\n\tvar m T = *(*T)(unsafe.Pointer(&b[0]))\n\treturn m\n}\n"
  },
  {
    "path": "go/bytes/bytes_test.go",
    "content": "package bytes_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"unsafe\"\n\n\tbytes_ \"github.com/kaydxh/golang/go/bytes\"\n)\n\nfunc TestEncodeAndDecode(t *testing.T) {\n\t// to bytes\n\ttype MyStruct struct {\n\t\tX, Y, Z int\n\t\tName    string\n\t}\n\n\ttestCases := []struct {\n\t\ts        MyStruct\n\t\texpected string\n\t}{\n\t\t{\n\t\t\ts:        MyStruct{1, 20, 30, \"foobar\"},\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\tconst sz = int(unsafe.Sizeof(MyStruct{}))\n\tfmt.Printf(\"MyStruct size: %v\\n\", int(unsafe.Sizeof(MyStruct{})))\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%d\", i), func(t *testing.T) {\n\n\t\t\tb := bytes_.Encode(testCase.s)\n\t\t\tfmt.Println(b)\n\t\t\tfmt.Printf(\"size of b: %v\\n\", len(b))\n\n\t\t\t/*\n\t\t\t\tvar p []byte = (*(*[sz]byte)(unsafe.Pointer(&testCase.s)))[:]\n\t\t\t\tfmt.Println(p)\n\t\t\t\tfmt.Printf(\"size of p: %v\\n\", len(p))\n\t\t\t*/\n\n\t\t\t/*\n\t\t\t\tvar m = *(*MyStruct)(unsafe.Pointer(&b[0]))\n\t\t\t\tfmt.Println(m)\n\t\t\t*/\n\n\t\t\tr := bytes_.Decode[MyStruct](b)\n\t\t\tfmt.Println(r)\n\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/client/client.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage client\n\nimport (\n\t\"log\"\n)\n\ntype Client struct {\n\t// options\n\topts struct {\n\t\tPath     string\n\t\tErrorLog *log.Logger\n\t}\n}\n\nfunc New(options ...ClientOption) *Client {\n\tc := &Client{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n\nfunc (c *Client) logf(format string, args ...interface{}) {\n\tif c.opts.ErrorLog != nil {\n\t\tc.opts.ErrorLog.Printf(format, args...)\n\t} else {\n\t\tlog.Printf(format, args...)\n\t}\n}\n"
  },
  {
    "path": "go/client/client.options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage client\n\nfunc WithClientOptionPath(path string) ClientOption {\n\treturn ClientOptionFunc(func(opt *Client) {\n\t\topt.opts.Path = path\n\t})\n}\n"
  },
  {
    "path": "go/client/client_options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage client\n\n// A ClientOption sets options.\ntype ClientOption interface {\n\tapply(*Client)\n}\n\n// EmptyClientUrlOption does not alter the Clienturation. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyClientOption struct{}\n\nfunc (EmptyClientOption) apply(*Client) {}\n\n// ClientOptionFunc wraps a function that modifies Client into an\n// implementation of the ClientOption interface.\ntype ClientOptionFunc func(*Client)\n\nfunc (f ClientOptionFunc) apply(do *Client) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ClientOptionWithDefault() ClientOption {\n\treturn ClientOptionFunc(func(*Client) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Client) ApplyOptions(options ...ClientOption) *Client {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/client/client_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage client_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/kaydxh/golang/go/client\"\n)\n\nfunc TestNew(t *testing.T) {\n\tconf := client.New(client.WithClientOptionPath(\"/data/conf\"))\n\tfmt.Println(conf)\n}\n"
  },
  {
    "path": "go/container/heap/heap.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage heap\n\nimport (\n\t\"container/heap\"\n\t\"fmt\"\n\t\"sync\"\n)\n\nconst (\n\tclosedMsg = \"heap is closed\"\n)\n\n// LessFunc is used to compare two objects in the heap.\ntype LessFunc func(interface{}, interface{}) bool\n\n// KeyFunc knows how to make a key from an object. Implementations\n// should be deterministic.\ntype KeyFunc func(interface{}) string\n\ntype heapItem struct {\n\tobj   interface{} // The object which is stored in the heap.\n\tindex int         // The index of the object's key in the Heap.queue.\n}\n\ntype itemKeyValue struct {\n\tkey string\n\tobj interface{}\n}\n\n// heapData is an internal struct that implements the standard heap interface\n// and keeps the data stored in the heap.\ntype heapData struct {\n\t// items is a map from key of the objects to the objects and their index.\n\t// We depend on the property that items in the map are in the queue and vice versa.\n\titems map[string]*heapItem\n\t// queue implements a heap data structure and keeps the order of elements\n\t// according to the heap invariant. The queue keeps the keys of objects stored\n\t// in \"items\".\n\tqueue []string\n\n\t// keyFunc is used to make the key used for queued item insertion and retrieval, and\n\t// should be deterministic.\n\tkeyFunc KeyFunc\n\t// lessFunc is used to compare two objects in the heap.\n\tlessFunc LessFunc\n}\n\nvar (\n\t_ = heap.Interface(&heapData{}) // heapData is a standard heap\n)\n\n// Less compares two objects and returns true if the first one should go\n// in front of the second one in the heap.\nfunc (h *heapData) Less(i, j int) bool {\n\tif i > len(h.queue) || j > len(h.queue) {\n\t\treturn false\n\t}\n\titemi, ok := h.items[h.queue[i]]\n\tif !ok {\n\t\treturn false\n\t}\n\titemj, ok := h.items[h.queue[j]]\n\tif !ok {\n\t\treturn false\n\t}\n\treturn h.lessFunc(itemi.obj, itemj.obj)\n}\n\n// Len returns the number of items in the Heap.\nfunc (h *heapData) Len() int { return len(h.queue) }\n\n// Swap implements swapping of two elements in the heap. This is a part of standard\n// heap interface and should never be called directly.\nfunc (h *heapData) Swap(i, j int) {\n\th.queue[i], h.queue[j] = h.queue[j], h.queue[i]\n\titem := h.items[h.queue[i]]\n\titem.index = i\n\titem = h.items[h.queue[j]]\n\titem.index = j\n}\n\n// Push is supposed to be called by heap.Push only.\nfunc (h *heapData) Push(kv interface{}) {\n\tkeyValue := kv.(*itemKeyValue)\n\tn := len(h.queue)\n\th.items[keyValue.key] = &heapItem{keyValue.obj, n}\n\th.queue = append(h.queue, keyValue.key)\n}\n\n// Pop is supposed to be called by heap.Pop only.\nfunc (h *heapData) Pop() interface{} {\n\tkey := h.queue[len(h.queue)-1]\n\th.queue = h.queue[0 : len(h.queue)-1]\n\titem, ok := h.items[key]\n\tif !ok {\n\t\t// This is an error\n\t\treturn nil\n\t}\n\tdelete(h.items, key)\n\treturn item.obj\n}\n\n// Heap is a thread-safe producer/consumer queue that implements a heap data structure.\n// It can be used to implement priority queues and similar data structures.\ntype Heap struct {\n\tlock sync.RWMutex\n\tcond sync.Cond\n\n\t// data stores objects and has a queue that keeps their ordering according\n\t// to the heap invariant.\n\tdata *heapData\n\n\t// closed indicates that the queue is closed.\n\t// It is mainly used to let Pop() exit its control loop while waiting for an item.\n\tclosed bool\n}\n\n// Close the Heap and signals condition variables that may be waiting to pop\n// items from the heap.\nfunc (h *Heap) Close() {\n\th.lock.Lock()\n\tdefer h.lock.Unlock()\n\th.closed = true\n\th.cond.Broadcast()\n}\n\n// Add inserts an item, and puts it in the queue. The item is updated if it\n// already exists.\nfunc (h *Heap) Add(obj interface{}) error {\n\tkey := h.data.keyFunc(obj)\n\th.lock.Lock()\n\tdefer h.lock.Unlock()\n\tif h.closed {\n\t\treturn fmt.Errorf(closedMsg)\n\t}\n\tif _, exists := h.data.items[key]; exists {\n\t\th.data.items[key].obj = obj\n\t\theap.Fix(h.data, h.data.items[key].index)\n\t} else {\n\t\th.addIfNotPresentLocked(key, obj)\n\t}\n\th.cond.Broadcast()\n\treturn nil\n}\n\n// BulkAdd adds all the items in the list to the queue and then signals the condition\n// variable. It is useful when the caller would like to add all of the items\n// to the queue before consumer starts processing them.\nfunc (h *Heap) BulkAdd(list []interface{}) error {\n\th.lock.Lock()\n\tdefer h.lock.Unlock()\n\tif h.closed {\n\t\treturn fmt.Errorf(closedMsg)\n\t}\n\tfor _, obj := range list {\n\t\tkey := h.data.keyFunc(obj)\n\t\tif _, exists := h.data.items[key]; exists {\n\t\t\th.data.items[key].obj = obj\n\t\t\theap.Fix(h.data, h.data.items[key].index)\n\t\t} else {\n\t\t\th.addIfNotPresentLocked(key, obj)\n\t\t}\n\t}\n\th.cond.Broadcast()\n\treturn nil\n}\n\n// AddIfNotPresent inserts an item, and puts it in the queue. If an item with\n// the key is present in the map, no changes is made to the item.\n//\n// This is useful in a single producer/consumer scenario so that the consumer can\n// safely retry items without contending with the producer and potentially enqueueing\n// stale items.\nfunc (h *Heap) AddIfNotPresent(obj interface{}) error {\n\tid := h.data.keyFunc(obj)\n\th.lock.Lock()\n\tdefer h.lock.Unlock()\n\tif h.closed {\n\t\treturn fmt.Errorf(closedMsg)\n\t}\n\th.addIfNotPresentLocked(id, obj)\n\th.cond.Broadcast()\n\treturn nil\n}\n\n// AddIfHeapOrder inserts an item, and puts it in the queue. If an item with\n// the key is present in the map, and new obj meet the sort of heap,\n// then update the item, or  no changes is made to the item.\nfunc (h *Heap) AddIfHeapOrder(obj interface{}) error {\n\tkey := h.data.keyFunc(obj)\n\th.lock.Lock()\n\tdefer h.lock.Unlock()\n\tif h.closed {\n\t\treturn fmt.Errorf(closedMsg)\n\t}\n\tif existedObj, exists := h.data.items[key]; exists {\n\t\tif !h.data.lessFunc(existedObj.obj, obj) {\n\t\t\th.data.items[key].obj = obj\n\t\t\theap.Fix(h.data, h.data.items[key].index)\n\t\t}\n\t} else {\n\t\th.addIfNotPresentLocked(key, obj)\n\t}\n\th.cond.Broadcast()\n\treturn nil\n}\n\n// addIfNotPresentLocked assumes the lock is already held and adds the provided\n// item to the queue if it does not already exist.\nfunc (h *Heap) addIfNotPresentLocked(key string, obj interface{}) {\n\tif _, exists := h.data.items[key]; exists {\n\t\treturn\n\t}\n\theap.Push(h.data, &itemKeyValue{key, obj})\n}\n\n// Update is the same as Add in this implementation. When the item does not\n// exist, it is added.\nfunc (h *Heap) Update(obj interface{}) error {\n\treturn h.Add(obj)\n}\n\n// Delete removes an item.\nfunc (h *Heap) Delete(obj interface{}) error {\n\tkey := h.data.keyFunc(obj)\n\th.lock.Lock()\n\tdefer h.lock.Unlock()\n\tif item, ok := h.data.items[key]; ok {\n\t\theap.Remove(h.data, item.index)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"object not found\")\n}\n\n// Pop waits until an item is ready. If multiple items are\n// ready, they are returned in the order given by Heap.data.lessFunc.\nfunc (h *Heap) Pop() (interface{}, error) {\n\th.lock.Lock()\n\tdefer h.lock.Unlock()\n\tfor len(h.data.queue) == 0 {\n\t\t// When the queue is empty, invocation of Pop() is blocked until new item is enqueued.\n\t\t// When Close() is called, the h.closed is set and the condition is broadcast,\n\t\t// which causes this loop to continue and return from the Pop().\n\t\tif h.closed {\n\t\t\treturn nil, fmt.Errorf(\"heap is closed\")\n\t\t}\n\t\th.cond.Wait()\n\t}\n\tobj := heap.Pop(h.data)\n\tif obj == nil {\n\t\treturn nil, fmt.Errorf(\"object was removed from heap data\")\n\t}\n\n\treturn obj, nil\n}\n\n// List returns a list of all the items.\nfunc (h *Heap) List() []interface{} {\n\th.lock.RLock()\n\tdefer h.lock.RUnlock()\n\tlist := make([]interface{}, 0, len(h.data.items))\n\tfor _, item := range h.data.items {\n\t\tlist = append(list, item.obj)\n\t}\n\treturn list\n}\n\n// ListKeys returns a list of all the keys of the objects currently in the Heap.\n// Note: the key order is random, because it's data structure is map\nfunc (h *Heap) ListKeys() []string {\n\th.lock.RLock()\n\tdefer h.lock.RUnlock()\n\tlist := make([]string, 0, len(h.data.items))\n\tfor key := range h.data.items {\n\t\tlist = append(list, key)\n\t}\n\treturn list\n}\n\n// Get returns the requested item, or sets exists=false.\n// return item.obj, exists\nfunc (h *Heap) Get(obj interface{}) (interface{}, bool) {\n\tkey := h.data.keyFunc(obj)\n\treturn h.GetByKey(key)\n}\n\n// GetByKey returns the requested item, or sets exists=false.\nfunc (h *Heap) GetByKey(key string) (interface{}, bool) {\n\th.lock.RLock()\n\tdefer h.lock.RUnlock()\n\titem, exists := h.data.items[key]\n\tif !exists {\n\t\treturn nil, false\n\t}\n\treturn item.obj, true\n}\n\n// IsClosed returns true if the queue is closed.\nfunc (h *Heap) IsClosed() bool {\n\th.lock.RLock()\n\tdefer h.lock.RUnlock()\n\tif h.closed {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NewHeap returns a Heap which can be used to queue up items to process.\nfunc NewHeap(keyFn KeyFunc, lessFn LessFunc) *Heap {\n\th := &Heap{\n\t\tdata: &heapData{\n\t\t\titems:    map[string]*heapItem{},\n\t\t\tqueue:    []string{},\n\t\t\tkeyFunc:  keyFn,\n\t\t\tlessFunc: lessFn,\n\t\t},\n\t}\n\th.cond.L = &h.lock\n\treturn h\n}\n"
  },
  {
    "path": "go/container/heap/heap_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage heap_test\n\nimport (\n\t\"sync\"\n\t\"testing\"\n\n\theap_ \"github.com/kaydxh/golang/go/container/heap\"\n)\n\nfunc testHeapObjectKeyFunc(obj interface{}) string {\n\treturn obj.(testHeapObject).name\n}\n\ntype testHeapObject struct {\n\tname string\n\tval  interface{}\n}\n\nfunc mkHeapObj(name string, val interface{}) testHeapObject {\n\treturn testHeapObject{name: name, val: val}\n}\n\n//minheap\nfunc compareInts(val1 interface{}, val2 interface{}) bool {\n\tfirst := val1.(testHeapObject).val.(int)\n\tsecond := val2.(testHeapObject).val.(int)\n\treturn first < second\n}\n\n// TestHeapBasic tests Heap invariant and synchronization.\nfunc TestHeapBasic(t *testing.T) {\n\th := heap_.NewHeap(testHeapObjectKeyFunc, compareInts)\n\tvar wg sync.WaitGroup\n\twg.Add(2)\n\tconst amount = 10\n\tvar i, u int\n\t// Insert items in the heap in opposite orders in two go routines.\n\tgo func() {\n\t\tfor i = amount; i > 0; i-- {\n\t\t\th.Add(mkHeapObj(string([]rune{'a', rune(i)}), i))\n\t\t}\n\t\twg.Done()\n\t}()\n\tgo func() {\n\t\tfor u = 0; u < amount; u++ {\n\t\t\th.Add(mkHeapObj(string([]rune{'b', rune(u)}), u+1))\n\t\t}\n\t\twg.Done()\n\t}()\n\t// Wait for the two go routines to finish.\n\twg.Wait()\n\n\tt.Logf(\"heap: %+v\", h.List())\n\t// Make sure that the numbers are popped in ascending order.\n\tprevNum := 0\n\tfor i := 0; i < amount*2; i++ {\n\t\tobj, err := h.Pop()\n\t\tnum := obj.(testHeapObject).val.(int)\n\t\t// All the items must be sorted.\n\t\tif err != nil || prevNum > num {\n\t\t\tt.Errorf(\"got %v out of order, last was %v\", obj, prevNum)\n\t\t}\n\t\tt.Logf(\"get %v\", num)\n\t\tprevNum = num\n\t}\n\n}\n\n// TestHeap_Get tests Heap.Get.\nfunc TestHeap_Get(t *testing.T) {\n\th := heap_.NewHeap(testHeapObjectKeyFunc, compareInts)\n\th.Add(mkHeapObj(\"foo\", 10))\n\th.Add(mkHeapObj(\"bar\", 1))\n\th.Add(mkHeapObj(\"bal\", 31))\n\th.Add(mkHeapObj(\"baz\", 11))\n\n\t// Get works with the key.\n\tobj, exists := h.Get(mkHeapObj(\"baz\", 0))\n\tif !exists || obj.(testHeapObject).val != 11 {\n\t\tt.Fatalf(\"unexpected error in getting element\")\n\t}\n\t// Get non-existing object.\n\t_, exists = h.Get(mkHeapObj(\"non-existing\", 0))\n\tif exists {\n\t\tt.Fatalf(\"didn't expect to get any object\")\n\t}\n}\n\n// TestHeap_GetByKey tests Heap.GetByKey and is very similar to TestHeap_Get.\nfunc TestHeap_GetByKey(t *testing.T) {\n\th := heap_.NewHeap(testHeapObjectKeyFunc, compareInts)\n\th.Add(mkHeapObj(\"foo\", 10))\n\th.Add(mkHeapObj(\"bar\", 1))\n\th.Add(mkHeapObj(\"bal\", 31))\n\th.Add(mkHeapObj(\"baz\", 11))\n\n\tobj, exists := h.GetByKey(\"baz\")\n\tif exists == false || obj.(testHeapObject).val != 11 {\n\t\tt.Fatalf(\"unexpected error in getting element\")\n\t}\n\t// Get non-existing object.\n\t_, exists = h.GetByKey(\"non-existing\")\n\tif exists {\n\t\tt.Fatalf(\"didn't expect to get any object\")\n\t}\n}\n\ntype Student struct {\n\tId    string\n\tName  string\n\tScore float32\n}\n\nfunc testStudentObjectKeyFunc(obj interface{}) string {\n\treturn obj.(*Student).Id\n}\n\n//maxheap\nfunc compareStudentScore(val1 interface{}, val2 interface{}) bool {\n\tfirst := val1.(*Student).Score\n\tsecond := val2.(*Student).Score\n\treturn first > second\n}\n\nfunc TestMaxHeap(t *testing.T) {\n\th := heap_.NewHeap(testStudentObjectKeyFunc, compareStudentScore)\n\th.AddIfHeapOrder(&Student{\n\t\tId:    \"id_1\",\n\t\tName:  \"name_1\",\n\t\tScore: 89.2,\n\t})\n\th.AddIfHeapOrder(&Student{\n\t\tId:    \"id_2\",\n\t\tName:  \"name_2\",\n\t\tScore: 87.2,\n\t})\n\th.AddIfHeapOrder(&Student{\n\t\tId:    \"id_3\",\n\t\tName:  \"name_3\",\n\t\tScore: 97.2,\n\t})\n\th.AddIfHeapOrder(&Student{\n\t\tId:    \"id_1\",\n\t\tName:  \"name_3\",\n\t\tScore: 88.2,\n\t})\n\tt.Logf(\"list key: %v\", h.ListKeys())\n\n\tsz := len(h.ListKeys())\n\tfor i := 0; i < sz; i++ {\n\t\tobj, err := h.Pop()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to pop, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"get obj: %v\", obj.(*Student))\n\t}\n}\n"
  },
  {
    "path": "go/container/set/set.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage set\n\nimport (\n\t\"encoding/json\"\n\t\"sort\"\n)\n\n// type Set[type T comparable] map[T]Empty\ntype Set[T comparable] map[T]Empty\n\nfunc New[T comparable](items ...T) Set[T] {\n\t// func New[T comparable]() Set[T] {\n\tss := make(Set[T], len(items))\n\tss.Insert(items...)\n\treturn ss\n}\n\n// Insert adds items to the set.\nfunc (s Set[T]) Insert(items ...T) Set[T] {\n\tfor _, item := range items {\n\t\ts[item] = Empty{}\n\t}\n\n\treturn s\n}\n\n// Delete removes all items from the set.\nfunc (s Set[T]) Delete(items ...T) Set[T] {\n\tfor _, item := range items {\n\t\tdelete(s, item)\n\t}\n\treturn s\n}\n\n// Has returns true if and only if item is contained in the set.\nfunc (s Set[T]) Has(item T) bool {\n\t_, contained := s[item]\n\treturn contained\n}\n\n// HasAll returns true if and only if all items are contained in the set.\nfunc (s Set[T]) HasAll(items ...T) bool {\n\tfor _, item := range items {\n\t\tif !s.Has(item) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// HasAny returns true if any items are contained in the set.\nfunc (s Set[T]) HasAny(items ...T) bool {\n\tfor _, item := range items {\n\t\tif s.Has(item) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Difference returns a set of objects that are not in s2\n// For example:\n// s1 = {a1, a2, a3}\n// s2 = {a1, a2, a4, a5}\n// s1.Difference(s2) = {a3}\n// s2.Difference(s1) = {a4, a5}\nfunc (s Set[T]) Difference(s2 Set[T]) Set[T] {\n\tresult := New[T]()\n\tfor key := range s {\n\t\tif !s2.Has(key) {\n\t\t\tresult.Insert(key)\n\t\t}\n\t}\n\treturn result\n}\n\n// Union returns a new set which includes items in either s1 or s2.\n// For example:\n// s1 = {a1, a2}\n// s2 = {a3, a4}\n// s1.Union(s2) = {a1, a2, a3, a4}\n// s2.Union(s1) = {a1, a2, a3, a4}\nfunc (s1 Set[T]) Union(s2 Set[T]) Set[T] {\n\tresult := New[T]()\n\tfor key := range s1 {\n\t\tresult.Insert(key)\n\t}\n\tfor key := range s2 {\n\t\tresult.Insert(key)\n\t}\n\treturn result\n}\n\n// Intersection returns a new set which includes the item in BOTH s1 and s2\n// For example:\n// s1 = {a1, a2}\n// s2 = {a2, a3}\n// s1.Intersection(s2) = {a2}\nfunc (s1 Set[T]) Intersection(s2 Set[T]) Set[T] {\n\tvar walk, other Set[T]\n\tresult := New[T]()\n\tif s1.Len() < s2.Len() {\n\t\twalk = s1\n\t\tother = s2\n\t} else {\n\t\twalk = s2\n\t\tother = s1\n\t}\n\tfor key := range walk {\n\t\tif other.Has(key) {\n\t\t\tresult.Insert(key)\n\t\t}\n\t}\n\treturn result\n}\n\n// IsSuperset returns true if and only if s1 is a superset of s2.\nfunc (s1 Set[T]) IsSuperset(s2 Set[T]) bool {\n\tfor item := range s2 {\n\t\tif !s1.Has(item) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Equal returns true if and only if s1 is equal (as a set) to s2.\n// Two sets are equal if their membership is identical.\n// (In practice, this means same elements, order doesn't matter)\nfunc (s1 Set[T]) Equal(s2 Set[T]) bool {\n\treturn len(s1) == len(s2) && s1.IsSuperset(s2)\n}\n\ntype sortableSliceOfT[T comparable] []T\n\nfunc (s sortableSliceOfT[T]) Len() int           { return len(s) }\nfunc (s sortableSliceOfT[T]) Less(i, j int) bool { return lessT(s[i], s[j]) }\nfunc (s sortableSliceOfT[T]) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }\n\n// List returns the contents as a sorted Object slice.\nfunc (s Set[T]) List() []T {\n\tres := make(sortableSliceOfT[T], 0, len(s))\n\tfor key := range s {\n\t\tres = append(res, key)\n\t}\n\tsort.Sort(res)\n\treturn []T(res)\n}\n\n// UnsortedList returns the slice with contents in random order.\nfunc (s Set[T]) UnsortedList() []T {\n\tres := make([]T, 0, len(s))\n\tfor key := range s {\n\t\tres = append(res, key)\n\t}\n\treturn res\n}\n\n// Returns a single element from the set.\nfunc (s Set[T]) PopAny() (T, bool) {\n\tfor key := range s {\n\t\ts.Delete(key)\n\t\treturn key, true\n\t}\n\tvar zeroValue T\n\treturn zeroValue, false\n}\n\n// Len returns the size of the set.\nfunc (s Set[T]) Len() int {\n\treturn len(s)\n}\n\ntype LesserT[T comparable] interface {\n\tLess(a, b T) bool\n}\n\nfunc lessT[T comparable](lhs, rhs T) bool {\n\tjbl, err := json.Marshal(lhs)\n\tif err != nil {\n\t\treturn false\n\t}\n\tjbr, err := json.Marshal(rhs)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn string(jbl) < string(jbr)\n}\n"
  },
  {
    "path": "go/container/set/set.interface.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage set\n\nimport (\n\t\"encoding/json\"\n\t\"reflect\"\n\t\"sort\"\n)\n\n// sets.Object is a set of Objects, implemented via map[Object]struct{} for minimal memory consumption.\ntype Object map[interface{}]Empty\n\n// NewObject creates a Object from a list of values.\nfunc NewObject(items ...interface{}) Object {\n\tss := Object{}\n\tss.Insert(items...)\n\treturn ss\n}\n\n// ObjectKeySet creates a Object from a keys of a map[Object](? extends interface{}).\n// If the value passed in is not actually a map, this will panic.\nfunc KeySet(theMap interface{}) Object {\n\tv := reflect.ValueOf(theMap)\n\tret := Object{}\n\n\tfor _, keyValue := range v.MapKeys() {\n\t\tret.Insert(keyValue.Interface().(Object))\n\t}\n\treturn ret\n}\n\n// Insert adds items to the set.\nfunc (s Object) Insert(items ...interface{}) Object {\n\tfor _, item := range items {\n\t\ts[item] = Empty{}\n\t}\n\treturn s\n}\n\n// Delete removes all items from the set.\nfunc (s Object) Delete(items ...interface{}) Object {\n\tfor _, item := range items {\n\t\tdelete(s, item)\n\t}\n\treturn s\n}\n\n// Has returns true if and only if item is contained in the set.\nfunc (s Object) Has(item interface{}) bool {\n\t_, contained := s[item]\n\treturn contained\n}\n\n// HasAll returns true if and only if all items are contained in the set.\nfunc (s Object) HasAll(items ...interface{}) bool {\n\tfor _, item := range items {\n\t\tif !s.Has(item) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// HasAny returns true if any items are contained in the set.\nfunc (s Object) HasAny(items ...interface{}) bool {\n\tfor _, item := range items {\n\t\tif s.Has(item) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Difference returns a set of objects that are not in s2\n// For example:\n// s1 = {a1, a2, a3}\n// s2 = {a1, a2, a4, a5}\n// s1.Difference(s2) = {a3}\n// s2.Difference(s1) = {a4, a5}\nfunc (s Object) Difference(s2 Object) Object {\n\tresult := NewObject()\n\tfor key := range s {\n\t\tif !s2.Has(key) {\n\t\t\tresult.Insert(key)\n\t\t}\n\t}\n\treturn result\n}\n\n// Union returns a new set which includes items in either s1 or s2.\n// For example:\n// s1 = {a1, a2}\n// s2 = {a3, a4}\n// s1.Union(s2) = {a1, a2, a3, a4}\n// s2.Union(s1) = {a1, a2, a3, a4}\nfunc (s1 Object) Union(s2 Object) Object {\n\tresult := NewObject()\n\tfor key := range s1 {\n\t\tresult.Insert(key)\n\t}\n\tfor key := range s2 {\n\t\tresult.Insert(key)\n\t}\n\treturn result\n}\n\n// Intersection returns a new set which includes the item in BOTH s1 and s2\n// For example:\n// s1 = {a1, a2}\n// s2 = {a2, a3}\n// s1.Intersection(s2) = {a2}\nfunc (s1 Object) Intersection(s2 Object) Object {\n\tvar walk, other Object\n\tresult := NewObject()\n\tif s1.Len() < s2.Len() {\n\t\twalk = s1\n\t\tother = s2\n\t} else {\n\t\twalk = s2\n\t\tother = s1\n\t}\n\tfor key := range walk {\n\t\tif other.Has(key) {\n\t\t\tresult.Insert(key)\n\t\t}\n\t}\n\treturn result\n}\n\n// IsSuperset returns true if and only if s1 is a superset of s2.\nfunc (s1 Object) IsSuperset(s2 Object) bool {\n\tfor item := range s2 {\n\t\tif !s1.Has(item) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Equal returns true if and only if s1 is equal (as a set) to s2.\n// Two sets are equal if their membership is identical.\n// (In practice, this means same elements, order doesn't matter)\nfunc (s1 Object) Equal(s2 Object) bool {\n\treturn len(s1) == len(s2) && s1.IsSuperset(s2)\n}\n\ntype sortableSliceOfObject []interface{}\n\nfunc (s sortableSliceOfObject) Len() int           { return len(s) }\nfunc (s sortableSliceOfObject) Less(i, j int) bool { return lessObject(s[i], s[j]) }\nfunc (s sortableSliceOfObject) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }\n\n// List returns the contents as a sorted Object slice.\nfunc (s Object) List() []interface{} {\n\tres := make(sortableSliceOfObject, 0, len(s))\n\tfor key := range s {\n\t\tres = append(res, key)\n\t}\n\tsort.Sort(res)\n\treturn []interface{}(res)\n}\n\n// UnsortedList returns the slice with contents in random order.\nfunc (s Object) UnsortedList() []interface{} {\n\tres := make([]interface{}, 0, len(s))\n\tfor key := range s {\n\t\tres = append(res, key)\n\t}\n\treturn res\n}\n\n// Returns a single element from the set.\nfunc (s Object) PopAny() (interface{}, bool) {\n\tfor key := range s {\n\t\ts.Delete(key)\n\t\treturn key, true\n\t}\n\tvar zeroValue Object\n\treturn zeroValue, false\n}\n\n// Len returns the size of the set.\nfunc (s Object) Len() int {\n\treturn len(s)\n}\n\ntype Lesser interface {\n\tLess(a interface{}, b interface{}) bool\n}\n\n/*\nfunc lessObject(lhs, rhs interface{}) bool {\n\tif lhs == nil {\n\t\treturn false\n\t}\n\n\tif rhs == nil {\n\t\treturn true\n\t}\n\n\tswitch lhs := lhs.(type) {\n\tcase nil:\n\t\treturn false\n\n\tcase *string:\n\t\trhs, ok := rhs.(*string)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\n\t\treturn lhs != nil && rhs != nil && *lhs < *rhs\n\n\tcase *[]byte:\n\t\trhs, ok := rhs.(*[]byte)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn lhs != nil && rhs != nil && string(*lhs) < string(*rhs)\n\n\tcase *int:\n\t\trhs, ok := rhs.(*int)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn lhs != nil && rhs != nil && *lhs < *rhs\n\n\tcase *int32:\n\t\trhs, ok := rhs.(*int32)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn lhs != nil && rhs != nil && *lhs < *rhs\n\n\tcase *uint32:\n\t\trhs, ok := rhs.(*uint32)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn lhs != nil && rhs != nil && *lhs < *rhs\n\n\tcase *int64:\n\t\trhs, ok := rhs.(*int64)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn lhs != nil && rhs != nil && *lhs < *rhs\n\n\tcase *uint64:\n\t\trhs, ok := rhs.(*uint64)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn lhs != nil && rhs != nil && *lhs < *rhs\n\n\tcase *float32:\n\t\trhs, ok := rhs.(*float32)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn lhs != nil && rhs != nil && *lhs < *rhs\n\n\tcase *float64:\n\t\trhs, ok := rhs.(*float64)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn lhs != nil && rhs != nil && *lhs < *rhs\n\n\n\tdefault:\n\t\tvar ll Lesser\n\t\tll, ok = lhs.(Lesser)\n\t\tif !ok {\n\n\t\t}\n\n\t\t\tvar err error\n\t\t\tjb, err = json.Marshal(v)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"jsonpb.Marshal: %v\", err)\n\t\t\t}\n\n\t}\n\treturn false\n}\n*/\n\nfunc lessObject(lhs, rhs interface{}) bool {\n\tjbl, err := json.Marshal(lhs)\n\tif err != nil {\n\t\treturn false\n\t}\n\tjbr, err := json.Marshal(rhs)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn string(jbl) < string(jbr)\n}\n\n/*\nfunc LessObject(lhs, rhs interface{}) bool {\n\tjbl, err := json.Marshal(lhs)\n\tif err != nil {\n\t\treturn false\n\t}\n\tjbr, err := json.Marshal(rhs)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn string(jbl) < string(jbr)\n}\n*/\n"
  },
  {
    "path": "go/container/set/set_interface_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage set_test\n\nimport (\n\t\"testing\"\n\n\tset_ \"github.com/kaydxh/golang/go/container/set\"\n)\n\nfunc TestSetInsert(t *testing.T) {\n\ts := set_.NewObject(\"10\", \"2\", \"5\")\n\ts.Insert(\"a\", \"d\", \"e\")\n\tif len(s) != 5 {\n\t\tt.Errorf(\"Expected len=5: %d\", len(s))\n\t}\n\n\tif !s.Has(\"a\") || !s.Has(\"b\") || !s.Has(\"c\") || !s.Has(\"d\") || !s.Has(\"e\") {\n\t\tt.Errorf(\"UnExpected contents: %#v\", s)\n\t}\n\n\t//%v output value\n\t//map[a:{} b:{} c:{} d:{} e:{}]\n\tt.Logf(\"s: %v\", s)\n\n\t//%+v output field name + value\n\t//map[a:{} b:{} c:{} d:{} e:{}]\n\tt.Logf(\"s: %+v\", s)\n\n\t//%#v output struct name + field name + value\n\t//set.Object{\"a\":set.Empty{}, \"b\":set.Empty{}, \"c\":set.Empty{}, \"d\":set.Empty{}, \"e\":set.Empty{}}\n\tt.Logf(\"s: %#v\", s)\n\n\t//[a b c d e]\n\tt.Logf(\"s: %v\", s.List())\n\n}\n\nfunc TestSetEquals(t *testing.T) {\n\n\ta := set_.NewObject(\"1\", \"2\")\n\tb := set_.NewObject(\"2\", \"1\")\n\n\tif !a.Equal(b) {\n\t\tt.Errorf(\"Expected to be equal: %v vs %v\", a, b)\n\t}\n\n\t//It is a set; duplicates are ignored\n\tb = set_.NewObject(\"2\", \"1\", \"1\")\n\tif !a.Equal(b) {\n\t\tt.Errorf(\"Expected to be equal: %v vs %v\", a, b)\n\t}\n}\n\nfunc TestSetUnion(t *testing.T) {\n\ttests := []struct {\n\t\ts1       set_.Object\n\t\ts2       set_.Object\n\t\texpected set_.Object\n\t}{\n\t\t{\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewObject(\"3\", \"4\", \"5\", \"6\"),\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewObject(),\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewObject(),\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewObject(),\n\t\t\tset_.NewObject(),\n\t\t\tset_.NewObject(),\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tunion := test.s1.Union(test.s2)\n\t\tif union.Len() != test.expected.Len() {\n\t\t\tt.Errorf(\"Expected union.Len()=%d but got %d\", test.expected.Len(), union.Len())\n\t\t}\n\n\t\tif !union.Equal(test.expected) {\n\t\t\tt.Errorf(\n\t\t\t\t\"Expected union.Equal(expected) but not true.  union:%v expected:%v\",\n\t\t\t\tunion.List(),\n\t\t\t\ttest.expected.List(),\n\t\t\t)\n\t\t}\n\t}\n\n}\n\nfunc TestSetIntersection(t *testing.T) {\n\ttests := []struct {\n\t\ts1       set_.Object\n\t\ts2       set_.Object\n\t\texpected set_.Object\n\t}{\n\t\t{\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewObject(\"3\", \"4\", \"5\", \"6\"),\n\t\t\tset_.NewObject(\"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewObject(),\n\t\t\tset_.NewObject(),\n\t\t},\n\t\t{\n\t\t\tset_.NewObject(),\n\t\t\tset_.NewObject(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewObject(),\n\t\t},\n\t\t{\n\t\t\tset_.NewObject(),\n\t\t\tset_.NewObject(),\n\t\t\tset_.NewObject(),\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tintersection := test.s1.Intersection(test.s2)\n\t\tif intersection.Len() != test.expected.Len() {\n\t\t\tt.Errorf(\"Expected intersection.Len()=%d but got %d\", test.expected.Len(), intersection.Len())\n\t\t}\n\n\t\tif !intersection.Equal(test.expected) {\n\t\t\tt.Errorf(\n\t\t\t\t\"Expected intersection.Equal(expected) but not true.  intersection:%v expected:%v\",\n\t\t\t\tintersection.List(),\n\t\t\t\ttest.expected.List(),\n\t\t\t)\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "go/container/set/set_string.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage set\n\nimport (\n\t\"reflect\"\n\t\"sort\"\n)\n\ntype Empty struct{}\n\n// sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption.\ntype String map[string]Empty\n\n// NewString creates a String from a list of values.\nfunc NewString(items ...string) String {\n\tss := String{}\n\tss.Insert(items...)\n\treturn ss\n}\n\n// StringKeySet creates a String from a keys of a map[string](? extends interface{}).\n// If the value passed in is not actually a map, this will panic.\nfunc StringKeySet(theMap interface{}) String {\n\tv := reflect.ValueOf(theMap)\n\tret := String{}\n\n\tfor _, keyValue := range v.MapKeys() {\n\t\tret.Insert(keyValue.Interface().(string))\n\t}\n\treturn ret\n}\n\n// Insert adds items to the set.\nfunc (s String) Insert(items ...string) String {\n\tfor _, item := range items {\n\t\ts[item] = Empty{}\n\t}\n\treturn s\n}\n\n// Delete removes all items from the set.\nfunc (s String) Delete(items ...string) String {\n\tfor _, item := range items {\n\t\tdelete(s, item)\n\t}\n\treturn s\n}\n\n// Has returns true if and only if item is contained in the set.\nfunc (s String) Has(item string) bool {\n\t_, contained := s[item]\n\treturn contained\n}\n\n// HasAll returns true if and only if all items are contained in the set.\nfunc (s String) HasAll(items ...string) bool {\n\tfor _, item := range items {\n\t\tif !s.Has(item) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// HasAny returns true if any items are contained in the set.\nfunc (s String) HasAny(items ...string) bool {\n\tfor _, item := range items {\n\t\tif s.Has(item) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Difference returns a set of objects that are not in s2\n// For example:\n// s1 = {a1, a2, a3}\n// s2 = {a1, a2, a4, a5}\n// s1.Difference(s2) = {a3}\n// s2.Difference(s1) = {a4, a5}\nfunc (s String) Difference(s2 String) String {\n\tresult := NewString()\n\tfor key := range s {\n\t\tif !s2.Has(key) {\n\t\t\tresult.Insert(key)\n\t\t}\n\t}\n\treturn result\n}\n\n// Union returns a new set which includes items in either s1 or s2.\n// For example:\n// s1 = {a1, a2}\n// s2 = {a3, a4}\n// s1.Union(s2) = {a1, a2, a3, a4}\n// s2.Union(s1) = {a1, a2, a3, a4}\nfunc (s1 String) Union(s2 String) String {\n\tresult := NewString()\n\tfor key := range s1 {\n\t\tresult.Insert(key)\n\t}\n\tfor key := range s2 {\n\t\tresult.Insert(key)\n\t}\n\treturn result\n}\n\n// Intersection returns a new set which includes the item in BOTH s1 and s2\n// For example:\n// s1 = {a1, a2}\n// s2 = {a2, a3}\n// s1.Intersection(s2) = {a2}\nfunc (s1 String) Intersection(s2 String) String {\n\tvar walk, other String\n\tresult := NewString()\n\tif s1.Len() < s2.Len() {\n\t\twalk = s1\n\t\tother = s2\n\t} else {\n\t\twalk = s2\n\t\tother = s1\n\t}\n\tfor key := range walk {\n\t\tif other.Has(key) {\n\t\t\tresult.Insert(key)\n\t\t}\n\t}\n\treturn result\n}\n\n// IsSuperset returns true if and only if s1 is a superset of s2.\nfunc (s1 String) IsSuperset(s2 String) bool {\n\tfor item := range s2 {\n\t\tif !s1.Has(item) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// Equal returns true if and only if s1 is equal (as a set) to s2.\n// Two sets are equal if their membership is identical.\n// (In practice, this means same elements, order doesn't matter)\nfunc (s1 String) Equal(s2 String) bool {\n\treturn len(s1) == len(s2) && s1.IsSuperset(s2)\n}\n\ntype sortableSliceOfString []string\n\nfunc (s sortableSliceOfString) Len() int           { return len(s) }\nfunc (s sortableSliceOfString) Less(i, j int) bool { return lessString(s[i], s[j]) }\nfunc (s sortableSliceOfString) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }\n\n// List returns the contents as a sorted string slice.\nfunc (s String) List() []string {\n\tres := make(sortableSliceOfString, 0, len(s))\n\tfor key := range s {\n\t\tres = append(res, key)\n\t}\n\tsort.Sort(res)\n\treturn []string(res)\n}\n\n// UnsortedList returns the slice with contents in random order.\nfunc (s String) UnsortedList() []string {\n\tres := make([]string, 0, len(s))\n\tfor key := range s {\n\t\tres = append(res, key)\n\t}\n\treturn res\n}\n\n// Returns a single element from the set.\nfunc (s String) PopAny() (string, bool) {\n\tfor key := range s {\n\t\ts.Delete(key)\n\t\treturn key, true\n\t}\n\tvar zeroValue string\n\treturn zeroValue, false\n}\n\n// Len returns the size of the set.\nfunc (s String) Len() int {\n\treturn len(s)\n}\n\nfunc lessString(lhs, rhs string) bool {\n\treturn lhs < rhs\n}\n"
  },
  {
    "path": "go/container/set/set_string_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage set_test\n\nimport (\n\t\"testing\"\n\n\tset_ \"github.com/kaydxh/golang/go/container/set\"\n)\n\nfunc TestStringSetInsert(t *testing.T) {\n\ts := set_.NewString(\"a\", \"b\", \"c\")\n\ts.Insert(\"a\", \"d\", \"e\")\n\tif len(s) != 5 {\n\t\tt.Errorf(\"Expected  len=5: %d\", len(s))\n\t}\n\n\tif !s.Has(\"a\") || !s.Has(\"b\") || !s.Has(\"c\") || !s.Has(\"d\") || !s.Has(\"e\") {\n\t\tt.Errorf(\"UnExpected contents: %#v\", s)\n\t}\n\n\t//%v output value\n\t//map[a:{} b:{} c:{} d:{} e:{}]\n\tt.Logf(\"s: %v\", s)\n\n\t//%+v output field name + value\n\t//map[a:{} b:{} c:{} d:{} e:{}]\n\tt.Logf(\"s: %+v\", s)\n\n\t//%#v output struct name + field name + value\n\t//set.String{\"a\":set.Empty{}, \"b\":set.Empty{}, \"c\":set.Empty{}, \"d\":set.Empty{}, \"e\":set.Empty{}}\n\tt.Logf(\"s: %#v\", s)\n\n\t//[a b c d e]\n\tt.Logf(\"s: %v\", s.List())\n\n}\n\nfunc TestStringSetEquals(t *testing.T) {\n\n\ta := set_.NewString(\"1\", \"2\")\n\tb := set_.NewString(\"2\", \"1\")\n\n\tif !a.Equal(b) {\n\t\tt.Errorf(\"Expected to be equal: %v vs %v\", a, b)\n\t}\n\n\t//It is a set; duplicates are ignored\n\tb = set_.NewString(\"2\", \"1\", \"1\")\n\tif !a.Equal(b) {\n\t\tt.Errorf(\"Expected to be equal: %v vs %v\", a, b)\n\t}\n}\n\nfunc TestStringSetUnion(t *testing.T) {\n\ttests := []struct {\n\t\ts1       set_.String\n\t\ts2       set_.String\n\t\texpected set_.String\n\t}{\n\t\t{\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewString(\"3\", \"4\", \"5\", \"6\"),\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewString(),\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewString(),\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewString(),\n\t\t\tset_.NewString(),\n\t\t\tset_.NewString(),\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tunion := test.s1.Union(test.s2)\n\t\tif union.Len() != test.expected.Len() {\n\t\t\tt.Errorf(\"Expected union.Len()=%d but got %d\", test.expected.Len(), union.Len())\n\t\t}\n\n\t\tif !union.Equal(test.expected) {\n\t\t\tt.Errorf(\n\t\t\t\t\"Expected union.Equal(expected) but not true.  union:%v expected:%v\",\n\t\t\t\tunion.List(),\n\t\t\t\ttest.expected.List(),\n\t\t\t)\n\t\t}\n\t}\n\n}\n\nfunc TestStringSetIntersection(t *testing.T) {\n\ttests := []struct {\n\t\ts1       set_.String\n\t\ts2       set_.String\n\t\texpected set_.String\n\t}{\n\t\t{\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewString(\"3\", \"4\", \"5\", \"6\"),\n\t\t\tset_.NewString(\"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewString(),\n\t\t\tset_.NewString(),\n\t\t},\n\t\t{\n\t\t\tset_.NewString(),\n\t\t\tset_.NewString(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.NewString(),\n\t\t},\n\t\t{\n\t\t\tset_.NewString(),\n\t\t\tset_.NewString(),\n\t\t\tset_.NewString(),\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tintersection := test.s1.Intersection(test.s2)\n\t\tif intersection.Len() != test.expected.Len() {\n\t\t\tt.Errorf(\"Expected intersection.Len()=%d but got %d\", test.expected.Len(), intersection.Len())\n\t\t}\n\n\t\tif !intersection.Equal(test.expected) {\n\t\t\tt.Errorf(\n\t\t\t\t\"Expected intersection.Equal(expected) but not true.  intersection:%v expected:%v\",\n\t\t\t\tintersection.List(),\n\t\t\t\ttest.expected.List(),\n\t\t\t)\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "go/container/set/set_test.go",
    "content": "package set_test\n\nimport (\n\t\"testing\"\n\n\tset_ \"github.com/kaydxh/golang/go/container/set\"\n)\n\nfunc TestGenericSetNew(t *testing.T) {\n\ts := set_.New[int]()\n\ts.Insert(2)\n\tt.Logf(\"s: %v\", s)\n}\n\nfunc TestGenericSetInsert(t *testing.T) {\n\ts := set_.New(\"10\", \"2\", \"5\")\n\ts.Insert(\"a\", \"d\", \"e\")\n\tif len(s) != 5 {\n\t\tt.Errorf(\"Expected  len=5: %d\", len(s))\n\t}\n\n\tif !s.Has(\"a\") || !s.Has(\"b\") || !s.Has(\"c\") || !s.Has(\"d\") || !s.Has(\"e\") {\n\t\tt.Errorf(\"UnExpected  contents: %#v\", s)\n\t}\n\n\t//%v output value\n\t//map[a:{} b:{} c:{} d:{} e:{}]\n\tt.Logf(\"s: %v\", s)\n\n\t//%+v output field name + value\n\t//map[a:{} b:{} c:{} d:{} e:{}]\n\tt.Logf(\"s: %+v\", s)\n\n\t//%#v output struct name + field name + value\n\t//set.Object{\"a\":set.Empty{}, \"b\":set.Empty{}, \"c\":set.Empty{}, \"d\":set.Empty{}, \"e\":set.Empty{}}\n\tt.Logf(\"s: %#v\", s)\n\n\t//[a b c d e]\n\tt.Logf(\"s: %v\", s.List())\n\n}\n\nfunc TestGenericSetEquals(t *testing.T) {\n\n\ta := set_.New(\"1\", \"2\")\n\tb := set_.New(\"2\", \"1\")\n\n\tif !a.Equal(b) {\n\t\tt.Errorf(\"Expected to be equal: %v vs %v\", a, b)\n\t}\n\n\t//It is a set; duplicates are ignored\n\tb = set_.New(\"2\", \"1\", \"1\")\n\tif !a.Equal(b) {\n\t\tt.Errorf(\"Expected to be equal: %v vs %v\", a, b)\n\t}\n}\n\nfunc TestGenericSetUnion(t *testing.T) {\n\ttests := []struct {\n\t\ts1       set_.Set[string]\n\t\ts2       set_.Set[string]\n\t\texpected set_.Set[string]\n\t}{\n\t\t{\n\t\t\tset_.New(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.New(\"3\", \"4\", \"5\", \"6\"),\n\t\t\tset_.New(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"),\n\t\t},\n\t\t{\n\t\t\tset_.New(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.New[string](),\n\t\t\tset_.New(\"1\", \"2\", \"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.New[string](),\n\t\t\tset_.New(\"1\", \"2\", \"3\", \"4\"),\n\t\t\tset_.New(\"1\", \"2\", \"3\", \"4\"),\n\t\t},\n\t\t{\n\t\t\tset_.New[string](),\n\t\t\tset_.New[string](),\n\t\t\tset_.New[string](),\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tunion := test.s1.Union(test.s2)\n\t\tif union.Len() != test.expected.Len() {\n\t\t\tt.Errorf(\"Expected union.Len()=%d but got %d\", test.expected.Len(), union.Len())\n\t\t}\n\n\t\tif !union.Equal(test.expected) {\n\t\t\tt.Errorf(\n\t\t\t\t\"Expected union.Equal(expected) but not true.  union:%v expected:%v\",\n\t\t\t\tunion.List(),\n\t\t\t\ttest.expected.List(),\n\t\t\t)\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "go/container/workqueue/queue.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage workqueue\n\nimport (\n\t\"sync\"\n)\n\ntype Interface interface {\n\tAdd(item interface{})\n\tLen() int\n\tGet() (item interface{}, shutdown bool)\n\tDone(item interface{})\n\tShutDown()\n\tShuttingDown() bool\n}\n\nfunc NewQueue() *Type {\n\tt := &Type{\n\t\tdirty:      set{},\n\t\tprocessing: set{},\n\t\tcond:       sync.NewCond(&sync.Mutex{}),\n\t}\n\n\treturn t\n}\n\n// Type is a work queue (see the package comment).\ntype Type struct {\n\t// queue defines the order in which we will work on items. Every\n\t// element of queue should be in the dirty set and not in the\n\t// processing set.\n\tqueue []t\n\n\t// dirty defines all of the items that need to be processed.\n\tdirty set\n\n\t// Things that are currently being processed are in the processing set.\n\t// These things may be simultaneously in the dirty set. When we finish\n\t// processing something and remove it from this set, we'll check if\n\t// it's in the dirty set, and if so, add it to the queue.\n\tprocessing set\n\n\tcond *sync.Cond\n\n\tshuttingDown bool\n\tdrain        bool\n}\n\ntype empty struct{}\ntype t interface{}\ntype set map[t]empty\n\nfunc (s set) has(item t) bool {\n\t_, exists := s[item]\n\treturn exists\n}\n\nfunc (s set) insert(item t) {\n\ts[item] = empty{}\n}\n\nfunc (s set) delete(item t) {\n\tdelete(s, item)\n}\n\nfunc (s set) len() int {\n\treturn len(s)\n}\n\n// Add marks item as needing processing.\nfunc (q *Type) Add(item interface{}) {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\tif q.shuttingDown {\n\t\treturn\n\t}\n\tif q.dirty.has(item) {\n\t\treturn\n\t}\n\n\tq.dirty.insert(item)\n\tif q.processing.has(item) {\n\t\treturn\n\t}\n\n\tq.queue = append(q.queue, item)\n\tq.cond.Signal()\n}\n\nfunc (q *Type) Len() int {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\treturn len(q.queue)\n}\n\nfunc (q *Type) Get() (item interface{}, shutdown bool) {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\tfor len(q.queue) == 0 && !q.shuttingDown {\n\t\tq.cond.Wait()\n\t}\n\tif len(q.queue) == 0 {\n\t\t// We must be shutting down.\n\t\treturn nil, true\n\t}\n\n\titem = q.queue[0]\n\t// The underlying array still exists and reference this object, so the object will not be garbage collected.\n\tq.queue[0] = nil\n\tq.queue = q.queue[1:]\n\n\tq.processing.insert(item)\n\tq.dirty.delete(item)\n\n\treturn item, false\n}\n\nfunc (q *Type) Done(item interface{}) {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\n\tq.processing.delete(item)\n\tif q.dirty.has(item) {\n\t\tq.queue = append(q.queue, item)\n\t\tq.cond.Signal()\n\t} else if q.processing.len() == 0 {\n\t\tq.cond.Signal()\n\t}\n}\n\n// ShutDown will cause q to ignore all new items added to it and\n// immediately instruct the worker goroutines to exit.\nfunc (q *Type) ShutDown() {\n\tq.setDrain(false)\n\tq.shutdown()\n}\n\n// ShutDownWithDrain will cause q to ignore all new items added to it. As soon\n// as the worker goroutines have \"drained\", i.e: finished processing and called\n// Done on all existing items in the queue; they will be instructed to exit and\n// ShutDownWithDrain will return. Hence: a strict requirement for using this is;\n// your workers must ensure that Done is called on all items in the queue once\n// the shut down has been initiated, if that is not the case: this will block\n// indefinitely. It is, however, safe to call ShutDown after having called\n// ShutDownWithDrain, as to force the queue shut down to terminate immediately\n// without waiting for the drainage.\nfunc (q *Type) ShutDownWithDrain() {\n\tq.setDrain(true)\n\tq.shutdown()\n\tfor q.isProcessing() && q.shouldDrain() {\n\t\tq.waitForProcessing()\n\t}\n}\n\n// isProcessing indicates if there are still items on the work queue being\n// processed. It's used to drain the work queue on an eventual shutdown.\nfunc (q *Type) isProcessing() bool {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\treturn q.processing.len() != 0\n}\n\n// waitForProcessing waits for the worker goroutines to finish processing items\n// and call Done on them.\nfunc (q *Type) waitForProcessing() {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\t// Ensure that we do not wait on a queue which is already empty, as that\n\t// could result in waiting for Done to be called on items in an empty queue\n\t// which has already been shut down, which will result in waiting\n\t// indefinitely.\n\tif q.processing.len() == 0 {\n\t\treturn\n\t}\n\tq.cond.Wait()\n}\n\nfunc (q *Type) setDrain(shouldDrain bool) {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\tq.drain = shouldDrain\n}\n\nfunc (q *Type) shouldDrain() bool {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\treturn q.drain\n}\n\nfunc (q *Type) shutdown() {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\tq.shuttingDown = true\n\tq.cond.Broadcast()\n}\n\nfunc (q *Type) ShuttingDown() bool {\n\tq.cond.L.Lock()\n\tdefer q.cond.L.Unlock()\n\n\treturn q.shuttingDown\n}\n"
  },
  {
    "path": "go/container/workqueue/queue_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage workqueue_test\n\nimport (\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\tworkqueue_ \"github.com/kaydxh/golang/go/container/workqueue\"\n)\n\nfunc TestBasic(t *testing.T) {\n\ttestCases := []struct {\n\t\tqueue         *workqueue_.Type\n\t\tqueueShutDown func(workqueue_.Interface)\n\t}{\n\t\t{\n\t\t\tqueue:         workqueue_.NewQueue(),\n\t\t\tqueueShutDown: workqueue_.Interface.ShutDown,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\n\t\t// Start producers\n\t\tconst producers = 10\n\t\tproducerWG := sync.WaitGroup{}\n\t\tproducerWG.Add(producers)\n\t\tfor i := 0; i < producers; i++ {\n\t\t\tgo func(i int) {\n\t\t\t\tdefer producerWG.Done()\n\t\t\t\tfor j := 0; j < 2; j++ {\n\t\t\t\t\ttestCase.queue.Add(i)\n\t\t\t\t\ttime.Sleep(time.Millisecond)\n\t\t\t\t}\n\t\t\t}(i)\n\t\t}\n\n\t\t// Start consumers\n\t\tconst consumers = 10\n\t\tconsumerWG := sync.WaitGroup{}\n\t\tconsumerWG.Add(consumers)\n\t\tfor i := 0; i < consumers; i++ {\n\t\t\tgo func(i int) {\n\t\t\t\tdefer consumerWG.Done()\n\t\t\t\tfor {\n\t\t\t\t\titem, quit := testCase.queue.Get()\n\t\t\t\t\tif quit {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tt.Logf(\"Woker %v: begin processing %v\", i, item)\n\t\t\t\t\ttime.Sleep(3 * time.Millisecond)\n\t\t\t\t\tt.Logf(\"Woker %v: done processing %v\", i, item)\n\t\t\t\t\ttestCase.queue.Done(item)\n\n\t\t\t\t}\n\t\t\t}(i)\n\t\t}\n\n\t\tproducerWG.Wait()\n\t\ttestCase.queueShutDown(testCase.queue)\n\t\ttestCase.queue.Add(\"add after shutdown!\")\n\t\tconsumerWG.Wait()\n\n\t\tif testCase.queue.Len() != 0 {\n\t\t\tt.Errorf(\"Expected the queue to be empty, had: %v items\", testCase.queue.Len())\n\t\t}\n\t}\n\n}\n\nfunc TestReinsert(t *testing.T) {\n\tq := workqueue_.NewQueue()\n\tq.Add(\"foo\")\n\n\t// Start processing\n\ti, _ := q.Get()\n\tif i != \"foo\" {\n\t\tt.Errorf(\"Expected %v, got %v\", \"foo\", i)\n\t}\n\n\t// Add it back while processing\n\tq.Add(i)\n\n\t// Finish it up\n\tq.Done(i)\n\n\t// It should be back on the queue\n\ti, _ = q.Get()\n\tif i != \"foo\" {\n\t\tt.Errorf(\"Expected %v, got %v\", \"foo\", i)\n\t}\n\n\t// Finish that one up\n\tq.Done(i)\n\n\tif a := q.Len(); a != 0 {\n\t\tt.Errorf(\"Expected queue to be empty. Has %v items\", a)\n\t}\n}\n"
  },
  {
    "path": "go/context/context.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage context\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// RequestIdKey is metadata key name for request ID\nconst (\n\tDefaultHTTPRequestIDKey = \"X-Request-ID\"\n\tDefaultHTTPTraceIDKey   = \"X-Traceid\"\n)\n\nfunc WithTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc) {\n\n\tif timeout > 0 {\n\t\treturn context.WithTimeout(ctx, timeout)\n\t}\n\treturn ctx, func() {}\n}\n\nfunc ExtractStringFromContext(ctx context.Context, key string) string {\n\tif v, ok := ctx.Value(key).(string); ok {\n\t\treturn v\n\t}\n\n\treturn \"\"\n}\n\nfunc ExtractIntegerFromContext(ctx context.Context, key string) (int64, error) {\n\tv, ok := ctx.Value(key).(string)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"key[%v] value type is not string\", key)\n\t}\n\n\tnumber, err := strconv.ParseInt(v, 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"key[%v] value type is not number: %v\", key, err)\n\t}\n\n\treturn number, nil\n}\n\nfunc ExtractFromContext(ctx context.Context, key string) string {\n\tswitch value := ctx.Value(key).(type) {\n\tcase string:\n\t\tif value != \"\" {\n\t\t\treturn value\n\t\t}\n\tcase []string:\n\t\tif len(value) > 0 {\n\t\t\treturn value[0]\n\t\t}\n\tdefault:\n\t\treturn \"\"\n\t}\n\n\treturn \"\"\n}\n\nfunc UpdateContext(ctx context.Context, key string, values map[string]interface{}) error {\n\tcurrentValues, ok := ctx.Value(key).(map[string]interface{})\n\tif ok {\n\t\tfor k, v := range values {\n\t\t\tcurrentValues[k] = v\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"key[%v] is not exist in context\", key)\n}\n\nfunc SetPairContext(ctx context.Context, key, value string) context.Context {\n\treturn context.WithValue(ctx, key, value)\n}\n\nfunc AppendContext(ctx context.Context, key string, values ...string) context.Context {\n\tcurrentValues, _ := ctx.Value(key).([]string)\n\tcurrentValues = append(currentValues, values...)\n\treturn context.WithValue(ctx, key, currentValues)\n}\n\nfunc WithContextRequestId(ctx context.Context, id string) context.Context {\n\treturn context.WithValue(ctx, DefaultHTTPRequestIDKey, id)\n}\n\nfunc ExtractRequestIDFromContext(ctx context.Context) string {\n\n\tif v, ok := ctx.Value(DefaultHTTPRequestIDKey).(string); ok {\n\t\treturn v\n\t}\n\n\treturn \"\"\n}\n\nfunc ExtractTraceIDFromContext(ctx context.Context) string {\n\tif v, ok := ctx.Value(DefaultHTTPTraceIDKey).(string); ok {\n\t\treturn v\n\t}\n\n\treturn \"\"\n}\n"
  },
  {
    "path": "go/context/context_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage context_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n)\n\nfunc withField(ctx context.Context) {\n\tctx = context.WithValue(ctx, \"abc\", \"abc\")\n\tfmt.Printf(\"context: %+v\\n\", ctx)\n}\n\nfunc TestContext(t *testing.T) {\n\tctx := context.Background()\n\tt.Logf(\"context: %v\", ctx)\n\twithField(ctx)\n\tt.Logf(\"context: %v\", ctx)\n}\n\nfunc doA(ctx context.Context) {\n\n\t{\n\t\tvar cancel context.CancelFunc\n\t\tctx, cancel = context.WithTimeout(ctx, time.Second)\n\t\tdefer cancel()\n\t}\n\n\ttimer := time.NewTimer(3 * time.Second)\n\tdefer timer.Stop()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\tfmt.Println(\"doA timeout\")\n\n\tcase <-timer.C:\n\t\tfmt.Println(\"doA finish\")\n\t}\n}\n\nfunc doB(ctx context.Context) {\n\n\t{\n\t\tvar cancel context.CancelFunc\n\t\tctx, cancel = context.WithTimeout(ctx, 10*time.Second)\n\t\tdefer cancel()\n\t}\n\n\ttimer := time.NewTimer(3 * time.Second)\n\tdefer timer.Stop()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\tfmt.Println(\"doB timeout\")\n\n\tcase <-timer.C:\n\t\tfmt.Println(\"doB finish\")\n\t}\n}\n\nfunc TestContextTimeout(t *testing.T) {\n\tctx := context.Background()\n\tdoA(ctx)\n\tdoB(ctx)\n}\n\nfunc TestExtractIntegerFromContext(t *testing.T) {\n\tctx := context.Background()\n\n\ttestCases := []struct {\n\t\tkey      string\n\t\tvalue    string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tkey:   \"test-1\",\n\t\t\tvalue: \"123\",\n\t\t},\n\t\t{\n\t\t\tkey:   \"test-2\",\n\t\t\tvalue: \"test-123\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.key, func(t *testing.T) {\n\t\t\tctx = context_.SetPairContext(ctx, testCase.key, testCase.value)\n\n\t\t\tnumber, err := context_.ExtractIntegerFromContext(ctx, testCase.key)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt.Logf(\"extract value %v by key %v \", number, testCase.key)\n\n\t\t})\n\t}\n\n}\n\nfunc TestExtractStringFromContext(t *testing.T) {\n\tctx := context.Background()\n\n\ttestCases := []struct {\n\t\tkey      string\n\t\tvalue    string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tkey:   \"test-1\",\n\t\t\tvalue: \"123\",\n\t\t},\n\t\t{\n\t\t\tkey:   \"test-2\",\n\t\t\tvalue: \"test-123\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.key, func(t *testing.T) {\n\t\t\tctx = context_.SetPairContext(ctx, testCase.key, testCase.value)\n\n\t\t\tvalue := context_.ExtractStringFromContext(ctx, testCase.key)\n\t\t\tt.Logf(\"extract value %v by key %v \", value, testCase.key)\n\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "go/crypto/aes/aes_cbc.go",
    "content": "/*\nMIT License\n\nCopyright (c) 2020 kay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\npackage aes\n\nimport (\n\t\"bytes\"\n\t\"crypto/aes\"\n\t\"crypto/cipher\"\n\t\"crypto/rand\"\n\t\"io\"\n)\n\nfunc AesCbcEncrypt(plainText, key []byte) ([]byte, error) {\n\tif len(key) != 16 && len(key) != 32 {\n\t\treturn nil, ErrKeyLength\n\t}\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpaddingText := pad(plainText, aes.BlockSize)\n\tcipherText := make([]byte, aes.BlockSize+len(paddingText))\n\tiv := cipherText[:aes.BlockSize]\n\tif _, err := io.ReadFull(rand.Reader, iv); err != nil {\n\t\treturn nil, err\n\t}\n\n\tblockMode := cipher.NewCBCEncrypter(block, iv)\n\tblockMode.CryptBlocks(cipherText[aes.BlockSize:], paddingText)\n\treturn cipherText, nil\n}\n\nfunc AesCbcDecrypt(cipherText, key []byte) ([]byte, error) {\n\tif len(key) != 16 && len(key) != 24 {\n\t\treturn nil, ErrKeyLength\n\t}\n\n\tif len(cipherText) < aes.BlockSize {\n\t\treturn nil, ErrCipherTextLength\n\t}\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tiv := cipherText[:aes.BlockSize]\n\tcb := cipherText[aes.BlockSize:]\n\n\tblockMode := cipher.NewCBCDecrypter(block, iv)\n\tblockMode.CryptBlocks(cb, cb)\n\tplainText, err := unpad(cb)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn plainText, nil\n}\n\nfunc pad(plainText []byte, blockSize int) []byte {\n\tpadding := blockSize - (len(plainText) % blockSize)\n\tpadText := bytes.Repeat([]byte{byte(padding)}, padding)\n\tnewText := append(plainText, padText...)\n\treturn newText\n}\n\nfunc unpad(plainText []byte) ([]byte, error) {\n\tlength := len(plainText)\n\tunpadding := int(plainText[length-1])\n\tif unpadding > length {\n\t\treturn nil, ErrPaddingSize\n\t}\n\n\treturn plainText[:length-unpadding], nil\n}\n"
  },
  {
    "path": "go/crypto/aes/aes_cbc_test.go",
    "content": "/*\nMIT License\n\nCopyright (c) 2020 kay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\npackage aes_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"flag\"\n\n\taes_ \"github.com/kaydxh/golang/go/crypto/aes\"\n\tio_ \"github.com/kaydxh/golang/go/io\"\n)\n\nfunc TestAesCbcEncryptDecrypt(t *testing.T) {\n\tplainText := []byte(\"Hello World\")\n\tfmt.Println(\"plainText: \", string(plainText))\n\n\tkey := []byte(\"daW3eDgPEa9TjknE\")\n\tcryptText, err := aes_.AesCbcEncrypt(plainText, key)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tfmt.Println(\"cryptText: \", string(cryptText))\n\n\tnewplainText, err := aes_.AesCbcDecrypt(cryptText, key)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tfmt.Println(\"newplainText: \", string(newplainText))\n\tif string(newplainText) != string(plainText) {\n\t\tt.Errorf(\"newplainText not equal plainText\")\n\t}\n}\n\n// build: go test -c  aes_cbc_test.go -o decrypt_tool\n// run: ./decrypt_tool -test.v  --test.run TestAesCbcDecrypt -srcePath=1.jpg -destPath=2.jpg\nvar (\n\tsrcePath = flag.String(\"srcePath\", \"\", \"source encrypt image path\")\n\tdestPath = flag.String(\"destPath\", \"./decryptImage.jpg\", \"dest decrypt image path\")\n)\n\nfunc TestAesCbcDecrypt(t *testing.T) {\n\tcryptText, err := io_.ReadFile(*srcePath)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\treturn\n\t}\n\n\tkey := []byte(\"daW3eDgPEa9TjknE\")\n\tnewplainText, err := aes_.AesCbcDecrypt(cryptText, key)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tio_.WriteFile(*destPath, newplainText, false)\n}\n"
  },
  {
    "path": "go/crypto/aes/error.go",
    "content": "/*\nMIT License\n\nCopyright (c) 2020 kay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\npackage aes\n\nimport \"errors\"\n\nvar (\n\tErrKeyLength        = errors.New(\"err key lenght\")\n\tErrPaddingSize      = errors.New(\"err padding size\")\n\tErrCipherTextLength = errors.New(\"err cipherText lenght\")\n)\n"
  },
  {
    "path": "go/crypto/md5/md5.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage md5\n\nimport (\n\t\"bytes\"\n\t\"crypto/md5\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"os\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n)\n\nfunc SumBytes(b []byte) string {\n\th := md5.New()\n\th.Write(b)\n\treturn hex.EncodeToString(h.Sum(nil))\n}\n\nfunc SumString(s string) string {\n\treturn SumBytes([]byte(s))\n}\n\nfunc SumReader(r io.Reader) (string, error) {\n\th := md5.New()\n\tif _, err := io.Copy(h, r); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn hex.EncodeToString(h.Sum(nil)), nil\n}\n\nfunc SumReaderN(r io.Reader, n int64) (string, error) {\n\th := md5.New()\n\tif _, err := io.CopyN(h, r, n); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn hex.EncodeToString(h.Sum(nil)), nil\n}\n\nfunc SumReaderAt(r io.ReaderAt, offset, length int64) (string, error) {\n\th := md5.New()\n\tbuf := make([]byte, 1024)\n\tvar total int64\n\n\tfor total < length {\n\t\tn, err := r.ReadAt(buf, offset)\n\t\tif err == nil || err == io.EOF {\n\t\t\tif n > 0 {\n\t\t\t\t_, tmpErr := io.CopyN(h, bytes.NewReader(buf), int64(n))\n\t\t\t\tif tmpErr != nil {\n\t\t\t\t\treturn \"\", tmpErr\n\t\t\t\t}\n\t\t\t\toffset += int64(n)\n\t\t\t\ttotal += int64(n)\n\n\t\t\t}\n\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"\", err\n\t\t}\n\n\t}\n\n\treturn hex.EncodeToString(h.Sum(nil)), nil\n}\n\nfunc SumFile(fileName string) (string, error) {\n\tfile, err := os_.OpenFile(fileName, true)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\treturn SumReader(file)\n}\n\nfunc SumFileAt(fileName string, offset int64, length int64) (string, error) {\n\tfile, err := os_.OpenAll(fileName, os.O_RDWR, os.ModePerm)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\treturn SumReaderAt(file, offset, length)\n}\n"
  },
  {
    "path": "go/crypto/md5/md5_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage md5_test\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n\n\tmd5_ \"github.com/kaydxh/golang/go/crypto/md5\"\n\t\"gotest.tools/assert\"\n)\n\nfunc TestMd5File(t *testing.T) {\n\tfile, err := ioutil.TempFile(\".\", \"file\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tdefer os.RemoveAll(file.Name())\n\n\tstrContext := \"hello world\"\n\t//\tn, err := io.WriteString(file, \"hello world\")\n\tn, err := file.Write([]byte(strContext))\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tassert.Equal(t, len(strContext), n)\n\tfmt.Printf(\"fileName: %v, n: %v\\n\", file.Name(), n)\n\n\tsum, err := md5_.SumFile(file.Name())\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tassert.Equal(t, sum, md5_.SumString(strContext))\n}\n\nfunc TestMd5FileAt(t *testing.T) {\n\tfile, err := ioutil.TempFile(\".\", \"file\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tdefer os.RemoveAll(file.Name())\n\n\ttestCases := []struct {\n\t\tname     string\n\t\twords    []byte\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test1\"),\n\t\t\texpected: \"test1\",\n\t\t},\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test2\"),\n\t\t\texpected: \"test2\",\n\t\t},\n\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test3\"),\n\t\t\texpected: \"test3\",\n\t\t},\n\t}\n\n\tvar offset int64\n\tfor i, testCase := range testCases {\n\t\t_, err := file.Write(testCase.words)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\t}\n\n\t\tif i > 0 {\n\t\t\toffset += int64(len(testCases[i-1].words))\n\t\t}\n\t\tfmt.Printf(\"i: %d, offset: %v, testCase: %s\\n\", i, offset, testCase.words)\n\t\tsum, err := md5_.SumFileAt(file.Name(), offset, int64(len(testCase.words)))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\t}\n\t\tfmt.Println(\"sum: \", sum)\n\t\tassert.Equal(t, sum, md5_.SumBytes(testCase.words))\n\t}\n\n}\n"
  },
  {
    "path": "go/crypto/sha256/sha256.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage sha256\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"os\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n)\n\nfunc SumBytes(b []byte) string {\n\th := sha256.New()\n\th.Write(b)\n\treturn hex.EncodeToString(h.Sum(nil))\n}\n\nfunc SumString(s string) string {\n\treturn SumBytes([]byte(s))\n}\n\nfunc SumReader(r io.Reader) (string, error) {\n\th := sha256.New()\n\tif _, err := io.Copy(h, r); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn hex.EncodeToString(h.Sum(nil)), nil\n}\n\nfunc SumReaderN(r io.Reader, n int64) (string, error) {\n\th := sha256.New()\n\tif _, err := io.CopyN(h, r, n); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn hex.EncodeToString(h.Sum(nil)), nil\n}\n\nfunc SumReaderAt(r io.ReaderAt, offset, length int64) (string, error) {\n\th := sha256.New()\n\tbuf := make([]byte, 1024)\n\tvar total int64\n\n\tfor total < length {\n\t\tn, err := r.ReadAt(buf, offset)\n\t\tif err == nil || err == io.EOF {\n\t\t\tif n > 0 {\n\t\t\t\t_, tmpErr := io.CopyN(h, bytes.NewReader(buf), int64(n))\n\t\t\t\tif tmpErr != nil {\n\t\t\t\t\treturn \"\", tmpErr\n\t\t\t\t}\n\t\t\t\toffset += int64(n)\n\t\t\t\ttotal += int64(n)\n\n\t\t\t}\n\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"\", err\n\t\t}\n\n\t}\n\n\treturn hex.EncodeToString(h.Sum(nil)), nil\n}\n\nfunc SumFile(fileName string) (string, error) {\n\tfile, err := os_.OpenFile(fileName, true)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\treturn SumReader(file)\n}\n\nfunc SumFileAt(fileName string, offset int64, length int64) (string, error) {\n\tfile, err := os_.OpenAll(fileName, os.O_RDWR, os.ModePerm)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer file.Close()\n\n\treturn SumReaderAt(file, offset, length)\n}\n"
  },
  {
    "path": "go/crypto/sha256/sha256_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage sha256_test\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n\n\tsha256_ \"github.com/kaydxh/golang/go/crypto/sha256\"\n\t\"gotest.tools/assert\"\n)\n\nfunc TestSha256File(t *testing.T) {\n\tfile, err := ioutil.TempFile(\".\", \"file\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tdefer os.RemoveAll(file.Name())\n\n\tstrContext := \"hello world\"\n\t//\tn, err := io.WriteString(file, \"hello world\")\n\tn, err := file.Write([]byte(strContext))\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tassert.Equal(t, len(strContext), n)\n\tfmt.Printf(\"fileName: %v, n: %v\\n\", file.Name(), n)\n\n\tsum, err := sha256_.SumFile(file.Name())\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tassert.Equal(t, sum, sha256_.SumString(strContext))\n}\n\nfunc TestSha256FileAt(t *testing.T) {\n\tfile, err := ioutil.TempFile(\".\", \"file\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tdefer os.RemoveAll(file.Name())\n\n\ttestCases := []struct {\n\t\tname     string\n\t\twords    []byte\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test1\"),\n\t\t\texpected: \"test1\",\n\t\t},\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test2\"),\n\t\t\texpected: \"test2\",\n\t\t},\n\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test3\"),\n\t\t\texpected: \"test3\",\n\t\t},\n\t}\n\n\tvar offset int64\n\tfor i, testCase := range testCases {\n\t\t_, err := file.Write(testCase.words)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\t}\n\n\t\tif i > 0 {\n\t\t\toffset += int64(len(testCases[i-1].words))\n\t\t}\n\t\tfmt.Printf(\"i: %d, offset: %v, testCase: %s\\n\", i, offset, testCase.words)\n\t\tsum, err := sha256_.SumFileAt(file.Name(), offset, int64(len(testCase.words)))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\t}\n\t\tfmt.Println(\"sum: \", sum)\n\t\tassert.Equal(t, sum, sha256_.SumBytes(testCase.words))\n\t}\n\n}\n"
  },
  {
    "path": "go/doc.go",
    "content": "package _go\n"
  },
  {
    "path": "go/encoding/base64/base64.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage base64\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n)\n\nfunc EncodeString(v string) string {\n\treturn base64.StdEncoding.EncodeToString([]byte(v))\n}\n\nfunc DecodeString(v string) (string, error) {\n\tdata, err := base64.StdEncoding.DecodeString(v)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"base64 decode failed: %v\", err)\n\t}\n\n\treturn string(data), nil\n}\n\nfunc EncodeURL(v string) string {\n\treturn base64.URLEncoding.EncodeToString([]byte(v))\n}\n\nfunc DecodeURL(v string) (string, error) {\n\tdata, err := base64.URLEncoding.DecodeString(v)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"base64 decode url failed: %v\", err)\n\t}\n\n\treturn string(data), nil\n}\n"
  },
  {
    "path": "go/encoding/base64/base64_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */package base64_test\n\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"math\"\n\t\"testing\"\n\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\tbase64_ \"github.com/kaydxh/golang/go/encoding/base64\"\n\t\"gotest.tools/v3/assert\"\n)\n\nfunc TestString(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"hello word\",\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tname:     \"http://12306.com?a=%b\",\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\tencoded := base64_.EncodeString(testCase.name)\n\t\t\tt.Logf(\"base64 encode : %v\", encoded)\n\t\t\tdecoded, err := base64_.DecodeString(encoded)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to decode string, err: %v\", err)\n\t\t\t}\n\n\t\t\tassert.Equal(t, testCase.name, decoded)\n\t\t})\n\t}\n\t/*\n\t\tcontent := \"hello word\"\n\n\t\tencoded := base64_.EncodeString(content)\n\t\tt.Logf(\"base64 encode : %v\", encoded)\n\n\t\tdecoded, err := base64_.DecodeString(encoded)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to decode string, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"base64 decode : %v\", decoded)\n\t*/\n\t//assert.Equal(t, content, decoded)\n}\n\nfunc TestURL(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     `http://baidu.com?a=10&b=\"hello\"`,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tname:     \"http://12306.com?a=%b\",\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\tencoded := base64_.EncodeURL(testCase.name)\n\t\t\tt.Logf(\"base64 encode : %v\", encoded)\n\t\t\tdecoded, err := base64_.DecodeURL(encoded)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to decode url, err: %v\", err)\n\t\t\t}\n\n\t\t\tassert.Equal(t, testCase.name, decoded)\n\t\t})\n\t}\n}\n\nfunc TestDecodeString(t *testing.T) {\n\ttestCases := []struct {\n\t\tvalue    string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tvalue:    \"PeNT+D5jU/g=\",\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tdecoded, err := base64_.DecodeString(testCase.value)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to decode string, err: %v\", err)\n\t\t\t}\n\t\t\tt.Logf(\"decode string len: %v, value len: %v\", len(decoded), len(testCase.value))\n\n\t\t\tj := 0\n\t\t\tfor i := 0; i < len(decoded); i += 4 {\n\t\t\t\tbits := binary.LittleEndian.Uint32([]byte(decoded[i : i+4]))\n\t\t\t\tfmt.Printf(\"%f \", math.Float32frombits(bits))\n\t\t\t\tj++\n\t\t\t}\n\t\t\tfmt.Printf(\"j=%v\", j)\n\n\t\t})\n\t}\n}\n\nfunc TestDecodeFile(t *testing.T) {\n\ttestCases := []struct {\n\t\tvalue    string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tvalue:    \"./1.txt\",\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t  encodedValue, err := io_.ReadFile(testCase.value)\n\t  if err != nil {\n\t\tt.Fatalf(\"failed to read file: %v, err: %v\", testCase.value, err)\n\t  }\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tdecoded, err := base64_.DecodeString(string(encodedValue))\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to decode string, err: %v\", err)\n\t\t\t}\n\t\t\tt.Logf(\"decode string len: %v, value len: %v\", len(decoded), len(testCase.value))\n\n\t\t\tio_.WriteFile(testCase.value+\".mp4\", []byte(decoded), false)\n\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/encoding/hash/hash.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage hash\n\nimport \"hash/crc32\"\n\nfunc HashCode(s string) uint32 {\n\treturn crc32.ChecksumIEEE([]byte(s))\n}\n"
  },
  {
    "path": "go/encoding/hash/hash_test.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage hash_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\thash_ \"github.com/kaydxh/golang/go/encoding/hash\"\n)\n\nfunc TestHashCode(t *testing.T) {\n\ttestCases := []struct {\n\t\tvalue    string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tvalue:    \"0\",\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tvalue:    \"1\",\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tvalue:    \"2\",\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tvalue:    \"10\",\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%v\", i), func(t *testing.T) {\n\t\t\thashCode := hash_.HashCode(testCase.value)\n\t\t\tt.Logf(\"%v hash code %v, mod10 %v\", testCase.value, hashCode, hashCode%10)\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "go/encoding/jwt/jwt.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\n// Package jwt 提供轻量级的 JWT（JSON Web Token）解析工具。\n//\n// 注意：本包仅解析 JWT payload，不验证签名。适用于以下场景：\n//   - Token 来自可信的服务端（server-to-server）\n//   - 仅需提取 claims 中的字段用于日志、路由等非鉴权用途\n//\n// 如果 Token 来自不可信客户端或用于鉴权决策，必须使用带签名验证的 JWT 库。\npackage jwt\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// ParsePayload 解析 JWT token 的 payload 部分，返回 claims map。\n// 不验证签名，仅做 base64url 解码 + JSON 反序列化。\n// token 格式必须为标准 JWT 三段式：header.payload.signature。\nfunc ParsePayload(token string) (map[string]interface{}, error) {\n\tif token == \"\" {\n\t\treturn nil, fmt.Errorf(\"jwt: empty token\")\n\t}\n\n\tparts := strings.Split(token, \".\")\n\tif len(parts) != 3 {\n\t\treturn nil, fmt.Errorf(\"jwt: invalid token format, expected 3 parts, got %d\", len(parts))\n\t}\n\n\t// base64url 解码 payload（JWT 标准使用无 padding 的 base64url）\n\tdecoded, err := base64.RawURLEncoding.DecodeString(parts[1])\n\tif err != nil {\n\t\t// 兼容带 padding 的 base64url\n\t\tdecoded, err = base64.URLEncoding.DecodeString(padBase64(parts[1]))\n\t\tif err != nil {\n\t\t\t// 最后尝试标准 base64（某些非标准实现可能使用）\n\t\t\tdecoded, err = base64.StdEncoding.DecodeString(padBase64(parts[1]))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"jwt: decode payload: %w\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tvar claims map[string]interface{}\n\tif err := json.Unmarshal(decoded, &claims); err != nil {\n\t\treturn nil, fmt.Errorf(\"jwt: unmarshal payload: %w\", err)\n\t}\n\n\treturn claims, nil\n}\n\n// GetClaimString 从 claims 中安全提取字符串类型的字段值。\n// 如果字段不存在或类型不是 string，返回空字符串。\nfunc GetClaimString(claims map[string]interface{}, key string) string {\n\tif claims == nil {\n\t\treturn \"\"\n\t}\n\tv, ok := claims[key].(string)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\treturn v\n}\n\n// GetClaimFloat64 从 claims 中安全提取数值类型的字段值。\n// JSON 数字默认反序列化为 float64，如果字段不存在或类型不匹配，返回 0。\nfunc GetClaimFloat64(claims map[string]interface{}, key string) float64 {\n\tif claims == nil {\n\t\treturn 0\n\t}\n\tv, ok := claims[key].(float64)\n\tif !ok {\n\t\treturn 0\n\t}\n\treturn v\n}\n\n// padBase64 为 base64 字符串补齐 padding。\nfunc padBase64(s string) string {\n\tswitch len(s) % 4 {\n\tcase 2:\n\t\treturn s + \"==\"\n\tcase 3:\n\t\treturn s + \"=\"\n\t}\n\treturn s\n}\n"
  },
  {
    "path": "go/encoding/jwt/jwt_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage jwt\n\nimport (\n\t\"testing\"\n)\n\nfunc TestParsePayload(t *testing.T) {\n\ttests := []struct {\n\t\tname    string\n\t\ttoken   string\n\t\twantErr bool\n\t\tcheck   func(claims map[string]interface{}) bool\n\t}{\n\t\t{\n\t\t\tname:    \"空 token\",\n\t\t\ttoken:   \"\",\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname:    \"非法格式（只有一段）\",\n\t\t\ttoken:   \"abc\",\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname:    \"非法格式（只有两段）\",\n\t\t\ttoken:   \"abc.def\",\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname:  \"合法 JWT（base64url 无 padding）\",\n\t\t\ttoken: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYWxpY2UiLCJleHAiOjE3MTk5OTk5OTl9.signature\",\n\t\t\tcheck: func(claims map[string]interface{}) bool {\n\t\t\t\treturn GetClaimString(claims, \"user_id\") == \"alice\"\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:  \"payload 为空 JSON 对象\",\n\t\t\ttoken: \"eyJhbGciOiJIUzI1NiJ9.e30.signature\",\n\t\t\tcheck: func(claims map[string]interface{}) bool {\n\t\t\t\treturn len(claims) == 0\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tclaims, err := ParsePayload(tt.token)\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"ParsePayload() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif tt.check != nil && !tt.check(claims) {\n\t\t\t\tt.Errorf(\"ParsePayload() claims check failed, claims = %v\", claims)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestGetClaimString(t *testing.T) {\n\tclaims := map[string]interface{}{\n\t\t\"user_id\": \"bob\",\n\t\t\"count\":   float64(42),\n\t}\n\n\tif got := GetClaimString(claims, \"user_id\"); got != \"bob\" {\n\t\tt.Errorf(\"GetClaimString(user_id) = %q, want %q\", got, \"bob\")\n\t}\n\tif got := GetClaimString(claims, \"missing\"); got != \"\" {\n\t\tt.Errorf(\"GetClaimString(missing) = %q, want empty\", got)\n\t}\n\tif got := GetClaimString(claims, \"count\"); got != \"\" {\n\t\tt.Errorf(\"GetClaimString(count) = %q, want empty (type mismatch)\", got)\n\t}\n\tif got := GetClaimString(nil, \"user_id\"); got != \"\" {\n\t\tt.Errorf(\"GetClaimString(nil) = %q, want empty\", got)\n\t}\n}\n\nfunc TestGetClaimFloat64(t *testing.T) {\n\tclaims := map[string]interface{}{\n\t\t\"exp\":     float64(1719999999),\n\t\t\"user_id\": \"alice\",\n\t}\n\n\tif got := GetClaimFloat64(claims, \"exp\"); got != 1719999999 {\n\t\tt.Errorf(\"GetClaimFloat64(exp) = %v, want %v\", got, 1719999999)\n\t}\n\tif got := GetClaimFloat64(claims, \"user_id\"); got != 0 {\n\t\tt.Errorf(\"GetClaimFloat64(user_id) = %v, want 0 (type mismatch)\", got)\n\t}\n\tif got := GetClaimFloat64(nil, \"exp\"); got != 0 {\n\t\tt.Errorf(\"GetClaimFloat64(nil) = %v, want 0\", got)\n\t}\n}\n"
  },
  {
    "path": "go/encoding/protojson/decode.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage protojson\n\nimport (\n\t\"google.golang.org/protobuf/encoding/protojson\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype Unmarshaler struct {\n\t// UnmarshalOptions is a configurable JSON format parser.\n\tprotojson.UnmarshalOptions\n}\n\nfunc Unmarshal(data []byte, pb proto.Message, options ...UnmarshalerOption) error {\n\tm := Unmarshaler{\n\t\tUnmarshalOptions: protojson.UnmarshalOptions{\n\t\t\tAllowPartial:   true,\n\t\t\tDiscardUnknown: true,\n\t\t},\n\t}\n\tm.ApplyOptions(options...)\n\n\treturn m.Unmarshal(data, pb)\n}\n"
  },
  {
    "path": "go/encoding/protojson/decode.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage protojson\n\n// If AllowPartial is set, input for messages that will result in missing\nfunc WithUnMashalAllowPartial(allowPartial bool) UnmarshalerOption {\n\treturn UnmarshalerOptionFunc(func(m *Unmarshaler) {\n\t\tm.AllowPartial = allowPartial\n\t})\n}\n\n// If DiscardUnknown is set, unknown fields are ignored.\nfunc WithUnmashalDiscardUnknown(discardUnknown bool) UnmarshalerOption {\n\treturn UnmarshalerOptionFunc(func(m *Unmarshaler) {\n\t\tm.DiscardUnknown = discardUnknown\n\t})\n}\n"
  },
  {
    "path": "go/encoding/protojson/decode_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage protojson\n\n// A UnmarshalerOption sets options.\ntype UnmarshalerOption interface {\n\tapply(*Unmarshaler)\n}\n\n// EmptyUnmarshalerOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyUnmarshalerOption struct{}\n\nfunc (EmptyUnmarshalerOption) apply(*Unmarshaler) {}\n\n// UnmarshalerOptionFunc wraps a function that modifies Client into an\n// implementation of the UnmarshalerOption interface.\ntype UnmarshalerOptionFunc func(*Unmarshaler)\n\nfunc (f UnmarshalerOptionFunc) apply(do *Unmarshaler) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _UnmarshalerOptionWithDefault() UnmarshalerOption {\n\treturn UnmarshalerOptionFunc(func(*Unmarshaler) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Unmarshaler) ApplyOptions(options ...UnmarshalerOption) *Unmarshaler {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/encoding/protojson/encode.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage protojson\n\nimport (\n\t\"google.golang.org/protobuf/encoding/protojson\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype Marshaler struct {\n\t// MarshalOptions is a configurable JSON format marshaler.\n\tprotojson.MarshalOptions\n}\n\nfunc Marshal(pb proto.Message, options ...MarshalerOption) ([]byte, error) {\n\tm := Marshaler{\n\t\tMarshalOptions: protojson.MarshalOptions{\n\t\t\tAllowPartial: true,\n\t\t},\n\t}\n\tm.ApplyOptions(options...)\n\n\treturn m.Marshal(pb)\n}\n"
  },
  {
    "path": "go/encoding/protojson/encode.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage protojson\n\nfunc WithMashalMultiline(multiline bool) MarshalerOption {\n\treturn MarshalerOptionFunc(func(m *Marshaler) {\n\t\tm.Multiline = multiline\n\t})\n}\n\nfunc WithMashalUseProtoNames(useProtoNames bool) MarshalerOption {\n\treturn MarshalerOptionFunc(func(m *Marshaler) {\n\t\tm.UseProtoNames = useProtoNames\n\t})\n}\n\nfunc WithMashalUseEnumNumbers(useEnumNumbers bool) MarshalerOption {\n\treturn MarshalerOptionFunc(func(m *Marshaler) {\n\t\tm.UseEnumNumbers = useEnumNumbers\n\t})\n}\n\nfunc WithMashalEmitUnpopulated(emitUnpopulated bool) MarshalerOption {\n\treturn MarshalerOptionFunc(func(m *Marshaler) {\n\t\tm.EmitUnpopulated = emitUnpopulated\n\t})\n}\n"
  },
  {
    "path": "go/encoding/protojson/encode_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage protojson\n\n// A MarshalerOption sets options.\ntype MarshalerOption interface {\n\tapply(*Marshaler)\n}\n\n// EmptyMarshalerOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyMarshalerOption struct{}\n\nfunc (EmptyMarshalerOption) apply(*Marshaler) {}\n\n// MarshalerOptionFunc wraps a function that modifies Client into an\n// implementation of the MarshalerOption interface.\ntype MarshalerOptionFunc func(*Marshaler)\n\nfunc (f MarshalerOptionFunc) apply(do *Marshaler) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _MarshalerOptionWithDefault() MarshalerOption {\n\treturn MarshalerOptionFunc(func(*Marshaler) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Marshaler) ApplyOptions(options ...MarshalerOption) *Marshaler {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/encoding/protojson/protojson_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage protojson_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/google/uuid\"\n\tprotojson_ \"github.com/kaydxh/golang/go/encoding/protojson\"\n\ttestdata_ \"github.com/kaydxh/golang/go/encoding/protojson/testdata\"\n)\n\nfunc TestMarshal(t *testing.T) {\n\trequest := &testdata_.DateRequest{\n\t\tRequestId: uuid.New().String(),\n\t}\n\n\tdata, err := protojson_.Marshal(request)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to marshal, err: %v\", err)\n\t}\n\tt.Logf(\"marshal data: %v\", string(data))\n\n\tvar req testdata_.DateRequest\n\terr = protojson_.Unmarshal(data, &req)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to unmarshal, err: %v\", err)\n\t}\n\tt.Logf(\"unmarshal object: %v\", req.String())\n}\n"
  },
  {
    "path": "go/encoding/protojson/testdata/date.pb.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.27.0\n// \tprotoc        v3.13.0\n// source: go/encoding/protojson/testdata/date.proto\n\npackage date\n\nimport (\n\t_ \"github.com/golang/protobuf/protoc-gen-go/descriptor\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype DateRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRequestId string `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"`\n}\n\nfunc (x *DateRequest) Reset() {\n\t*x = DateRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_go_encoding_protojson_testdata_date_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *DateRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DateRequest) ProtoMessage() {}\n\nfunc (x *DateRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_go_encoding_protojson_testdata_date_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use DateRequest.ProtoReflect.Descriptor instead.\nfunc (*DateRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_encoding_protojson_testdata_date_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *DateRequest) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\ntype DateResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRequestId string `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"`\n\tDate      string `protobuf:\"bytes,2,opt,name=date,json=Date,proto3\" json:\"date,omitempty\"`\n}\n\nfunc (x *DateResponse) Reset() {\n\t*x = DateResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_go_encoding_protojson_testdata_date_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *DateResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DateResponse) ProtoMessage() {}\n\nfunc (x *DateResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_go_encoding_protojson_testdata_date_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use DateResponse.ProtoReflect.Descriptor instead.\nfunc (*DateResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_encoding_protojson_testdata_date_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *DateResponse) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\nfunc (x *DateResponse) GetDate() string {\n\tif x != nil {\n\t\treturn x.Date\n\t}\n\treturn \"\"\n}\n\nvar File_go_encoding_protojson_testdata_date_proto protoreflect.FileDescriptor\n\nvar file_go_encoding_protojson_testdata_date_proto_rawDesc = []byte{\n\t0x0a, 0x29, 0x67, 0x6f, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61,\n\t0x2f, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x67, 0x6f, 0x6c,\n\t0x61, 0x6e, 0x67, 0x2e, 0x67, 0x6f, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e,\n\t0x64, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,\n\t0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x0b, 0x44, 0x61, 0x74,\n\t0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75,\n\t0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x52, 0x65,\n\t0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x0c, 0x44, 0x61, 0x74, 0x65, 0x52,\n\t0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65,\n\t0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x52, 0x65, 0x71,\n\t0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02,\n\t0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69,\n\t0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f,\n\t0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69,\n\t0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x61, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x33,\n}\n\nvar (\n\tfile_go_encoding_protojson_testdata_date_proto_rawDescOnce sync.Once\n\tfile_go_encoding_protojson_testdata_date_proto_rawDescData = file_go_encoding_protojson_testdata_date_proto_rawDesc\n)\n\nfunc file_go_encoding_protojson_testdata_date_proto_rawDescGZIP() []byte {\n\tfile_go_encoding_protojson_testdata_date_proto_rawDescOnce.Do(func() {\n\t\tfile_go_encoding_protojson_testdata_date_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_encoding_protojson_testdata_date_proto_rawDescData)\n\t})\n\treturn file_go_encoding_protojson_testdata_date_proto_rawDescData\n}\n\nvar file_go_encoding_protojson_testdata_date_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_go_encoding_protojson_testdata_date_proto_goTypes = []interface{}{\n\t(*DateRequest)(nil),  // 0: golang.go.encoding.date.v1.DateRequest\n\t(*DateResponse)(nil), // 1: golang.go.encoding.date.v1.DateResponse\n}\nvar file_go_encoding_protojson_testdata_date_proto_depIdxs = []int32{\n\t0, // [0:0] is the sub-list for method output_type\n\t0, // [0:0] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_go_encoding_protojson_testdata_date_proto_init() }\nfunc file_go_encoding_protojson_testdata_date_proto_init() {\n\tif File_go_encoding_protojson_testdata_date_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_go_encoding_protojson_testdata_date_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*DateRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_go_encoding_protojson_testdata_date_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*DateResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_go_encoding_protojson_testdata_date_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_go_encoding_protojson_testdata_date_proto_goTypes,\n\t\tDependencyIndexes: file_go_encoding_protojson_testdata_date_proto_depIdxs,\n\t\tMessageInfos:      file_go_encoding_protojson_testdata_date_proto_msgTypes,\n\t}.Build()\n\tFile_go_encoding_protojson_testdata_date_proto = out.File\n\tfile_go_encoding_protojson_testdata_date_proto_rawDesc = nil\n\tfile_go_encoding_protojson_testdata_date_proto_goTypes = nil\n\tfile_go_encoding_protojson_testdata_date_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "go/encoding/protojson/testdata/date.proto",
    "content": "syntax = \"proto3\";\n\npackage golang.go.encoding.date.v1;\nimport \"google/protobuf/descriptor.proto\";\n\noption go_package = \"github.com/kaydxh/golang/go/encoding/v1;date\";\n\n\nmessage DateRequest {\n  string request_id = 1[json_name = \"RequestId\"];\n}\n\nmessage DateResponse {\n  string request_id = 1 [json_name = \"RequestId\"];\n  string date = 2 [json_name = \"Date\"];\n}\n"
  },
  {
    "path": "go/errors/error.code.go",
    "content": "package errors\n\nimport \"errors\"\n\nvar (\n\tErrNotEnabled = errors.New(\"not enabled\")\n)\n"
  },
  {
    "path": "go/errors/error.grpc.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage errors\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"google.golang.org/genproto/googleapis/rpc/errdetails\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\nfunc FromError(err error) (s *status.Status, ok bool) {\n\ts, ok = status.FromError(err)\n\tif ok {\n\t\treturn s, ok\n\t}\n\tvar gRPCStatus interface {\n\t\tGRPCStatus() *status.Status\n\t}\n\tif errors.As(err, &gRPCStatus) {\n\t\ts = gRPCStatus.GRPCStatus()\n\t\t//ok = true\n\t\tok = s != nil\n\t}\n\treturn s, ok\n}\n\nfunc ErrorToCodeString(err error) string {\n\tif err == nil {\n\t\treturn codes.OK.String()\n\t}\n\n\ts, ok := FromError(err)\n\tif !ok {\n\t\treturn err.Error()\n\t}\n\tcodeString := s.Code().String()\n\tfor _, detail := range s.Details() {\n\t\tswitch detail := detail.(type) {\n\t\tcase *errdetails.ErrorInfo:\n\t\t\tif detail.GetReason() != \"\" {\n\t\t\t\tcodeString = detail.GetReason()\n\t\t\t}\n\t\t}\n\t}\n\n\treturn codeString\n}\n\n// Error Message\nfunc ErrorToString(err error) string {\n\tif err == nil {\n\t\treturn codes.OK.String()\n\t}\n\n\ts, ok := FromError(err)\n\tif !ok {\n\t\treturn err.Error()\n\t}\n\treturn s.Message()\n}\n\nfunc ErrorToCode(err error) codes.Code {\n\tif err == nil {\n\t\treturn codes.OK\n\t}\n\n\ts, ok := FromError(err)\n\tif !ok {\n\t\treturn codes.Unknown\n\t}\n\n\treturn s.Code()\n}\n\nfunc Errorf(code interface{}, format string, a ...interface{}) error {\n\tc, ok := code.(codes.Code)\n\tif !ok {\n\t\tc = codes.Unknown\n\t\tnum, err := strconv.Atoi(fmt.Sprintf(\"%d\", code))\n\t\tif err == nil {\n\t\t\tc = codes.Code(num)\n\t\t}\n\t}\n\n\tif c == codes.OK {\n\t\treturn nil\n\t}\n\n\tvar message string\n\tcodeStringer, ok := code.(fmt.Stringer)\n\tif ok {\n\t\tmessage = strings.ReplaceAll(codeStringer.String(), \"__\", \".\")\n\t} else {\n\t\tmessage = c.String()\n\t}\n\ts := status.New(c, fmt.Sprintf(format, a...))\n\tif s.Code() != codes.OK && message != \"\" {\n\t\tdetail, err := s.WithDetails(&errdetails.ErrorInfo{\n\t\t\tReason: message,\n\t\t})\n\t\tif err == nil {\n\t\t\t// replace new status with reason\n\t\t\ts = detail\n\t\t}\n\t}\n\n\treturn s.Err()\n}\n\nfunc Errore(errlist ...error) error {\n\treturn NewAggregate(errlist)\n}\n"
  },
  {
    "path": "go/errors/errors.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage errors\n\nimport (\n\t\"errors\"\n)\n\ntype Aggregate interface {\n\terror\n\tErrors() []error\n\tIs(error) bool\n}\n\n// NewAggregate converts a slice of errors into an Aggregate interface, which\n// is itself an implementation of the error interface.  If the slice is empty,\n// this returns nil.\n// It will check if any of the element of input error list is nil, to avoid\n// nil pointer panic when call Error().\nfunc NewAggregate(errlist []error) Aggregate {\n\tif len(errlist) == 0 {\n\t\treturn nil\n\t}\n\t// In case of input error list contains nil\n\tvar errs []error\n\tfor _, e := range errlist {\n\t\tif e != nil {\n\t\t\terrs = append(errs, e)\n\t\t}\n\t}\n\tif len(errs) == 0 {\n\t\treturn nil\n\t}\n\treturn aggregate(errs)\n}\n\n// This helper implements the error and Errors interfaces.  Keeping it private\n// prevents people from making an aggregate of 0 errors, which is not\n// an error, but does satisfy the error interface.\ntype aggregate []error\n\n// Error is part of the error interface.\nfunc (agg aggregate) Error() string {\n\tif len(agg) == 0 {\n\t\t// This should never happen, really.\n\t\treturn \"\"\n\t}\n\tif len(agg) == 1 {\n\t\treturn agg[0].Error()\n\t}\n\tresult := \"\"\n\tagg.visit(func(err error) bool {\n\t\tmsg := err.Error()\n\t\tif len(result) > 0 {\n\t\t\tresult += \", \"\n\t\t}\n\t\tresult += msg\n\t\treturn false\n\t})\n\treturn \"[\" + result + \"]\"\n}\n\nfunc (agg aggregate) Is(target error) bool {\n\treturn agg.visit(func(err error) bool {\n\t\treturn errors.Is(err, target)\n\t})\n}\n\nfunc (agg aggregate) visit(f func(err error) bool) bool {\n\tfor _, err := range agg {\n\t\tswitch err := err.(type) {\n\t\tcase aggregate:\n\t\t\tif match := err.visit(f); match {\n\t\t\t\treturn match\n\t\t\t}\n\t\tcase Aggregate:\n\t\t\tfor _, nestedErr := range err.Errors() {\n\t\t\t\tif match := f(nestedErr); match {\n\t\t\t\t\treturn match\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tif match := f(err); match {\n\t\t\t\treturn match\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\n// Errors is part of the Aggregate interface.\nfunc (agg aggregate) Errors() []error {\n\treturn []error(agg)\n}\n"
  },
  {
    "path": "go/errors/errors_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage errors_test\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"testing\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n)\n\nfunc TestError(t *testing.T) {\n\tvar errs = []error{fmt.Errorf(\"error 1\"), fmt.Errorf(\"error 2\")}\n\n\tvar err error\n\t//Aggregate  implemnet interface error \tError() string\n\terr = errors_.NewAggregate(errs)\n\t//multiErrorStrings := err errors_.NewAggregate(errs).Errors()\n\tmultiErrorStrings := err.Error()\n\tt.Logf(\"multiErrorStrings: %v\", multiErrorStrings)\n\n}\n\nfunc TestErrorIs(t *testing.T) {\n\tvar ErrInternal = errors.New(\"internal error\")\n\ttestCases := []struct {\n\t\terr1     error\n\t\terr2     error\n\t\texpected bool\n\t}{\n\t\t{\n\t\t\terr1:     ErrInternal,\n\t\t\terr2:     ErrInternal,\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\t// the same error messge is not mean the same error\n\t\t\terr1:     errors.New(\"internal error\"),\n\t\t\terr2:     errors.New(\"internal error\"),\n\t\t\texpected: false,\n\t\t},\n\n\t\t{\n\t\t\terr1:     errors.New(\"internal error1\"),\n\t\t\terr2:     errors.New(\"internal error2\"),\n\t\t\texpected: false,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%v\", i), func(t *testing.T) {\n\t\t\terr := errors_.NewAggregate([]error{testCase.err1})\n\t\t\tif err.Is(testCase.err2) != testCase.expected {\n\t\t\t\tt.Fatalf(\"err[%v] is not expected err2[%v]\", err, testCase.err2)\n\t\t\t}\n\n\t\t})\n\t}\n}\n\nfunc TestErrore(t *testing.T) {\n\tvar ErrInternal = errors.New(\"FailedOperation__Internal\")\n\ttestCases := []struct {\n\t\terr      error\n\t\tcode     int32\n\t\texpected bool\n\t}{\n\t\t{\n\t\t\terr:      ErrInternal,\n\t\t\tcode:     100,\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\terr:      errors_.Errore(fmt.Errorf(\"failed to process,%d\", 2), ErrInternal),\n\t\t\tcode:     100,\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\terr:      fmt.Errorf(\"failed to process, %v\", 2),\n\t\t\tcode:     100,\n\t\t\texpected: false,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%v\", i), func(t *testing.T) {\n\t\t\t//err := errors_.Errore(testCase.code, testCase.err)\n\t\t\terr := errors_.Errore(testCase.err)\n\t\t\tif errors.Is(err, ErrInternal) != testCase.expected {\n\t\t\t\tt.Fatalf(\"err[%v], epected[%v] test err[%v]\", err, testCase.expected, testCase.err)\n\t\t\t}\n\t\t\tt.Logf(\"err[%v] expected[%v] test err[%v] \", err, testCase.expected, testCase.err)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/errors/handler.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage errors\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"golang.org/x/time/rate\"\n)\n\n// ErrorHandlers is a list of functions which will be invoked when a nonreturnable\n// error occurs.\n// should be packaged up into a testable and reusable object.\nvar ErrorHandlers = []func(error){\n\tfunc() func(err error) {\n\t\tlimiter := rate.NewLimiter(rate.Every(time.Millisecond), 1)\n\t\treturn func(err error) {\n\t\t\t// 1ms was the number folks were able to stomach as a global rate limit.\n\t\t\t// If you need to log errors more than 1000 times a second you\n\t\t\t// should probably consider fixing your code instead. :)\n\t\t\t_ = limiter.Wait(context.Background())\n\t\t}\n\t}(),\n}\n\n// HandlerError is a method to invoke when a non-user facing piece of code cannot\n// return an error and needs to indicate it has been ignored. Invoking this method\n// is preferable to logging the error - the default behavior is to log but the\n// errors may be sent to a remote server for analysis.\nfunc HandleError(err error) {\n\t// this is sometimes called with a nil error.  We probably shouldn't fail and should do nothing instead\n\tif err == nil {\n\t\treturn\n\t}\n\n\tfor _, fn := range ErrorHandlers {\n\t\tfn(err)\n\t}\n}\n\nfunc ErrorChain(handlers ...func(err error, handled bool) (error, bool)) func(err error, handled bool) error {\n\treturn func(err error, handled bool) error {\n\t\tfor _, h := range handlers {\n\t\t\tif h != nil {\n\t\t\t\terr, handled = h(err, handled)\n\t\t\t}\n\t\t}\n\t\treturn err\n\t}\n}\n"
  },
  {
    "path": "go/filesystem/filesystem.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filesystem\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n)\n\n// Filesystem is an interface that we can use to mock various filesystem operations\ntype Filesystem interface {\n\t// from \"os\"\n\tStat(name string) (os.FileInfo, error)\n\tCreate(name string) (File, error)\n\tRename(oldpath, newpath string) error\n\tMkdirAll(path string, perm os.FileMode) error\n\tChtimes(name string, atime time.Time, mtime time.Time) error\n\tRemoveAll(path string) error\n\tRemove(name string) error\n\n\t// from \"io/ioutil\"\n\tReadFile(filename string) ([]byte, error)\n\tTempDir(dir, prefix string) (string, error)\n\tTempFile(dir, prefix string) (File, error)\n\tReadDir(dirname string) ([]os.FileInfo, error)\n\tWalk(root string, walkFn filepath.WalkFunc) error\n}\n\n// File is an interface that we can use to mock various filesystem operations typically\n// accessed through the File object from the \"os\" package\ntype File interface {\n\t// for now, the only os.File methods used are those below, add more as necessary\n\tName() string\n\tWrite(b []byte) (n int, err error)\n\tSync() error\n\tClose() error\n}\n"
  },
  {
    "path": "go/filesystem/mountpoint.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filesystem\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\tfilepath_ \"github.com/kaydxh/golang/go/path/filepath\"\n\n\t\"github.com/pkg/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"golang.org/x/sys/unix\"\n)\n\nvar (\n\tmountsByDevice    map[DeviceNumber]*Mount\n\tmountsByPath      map[string]*Mount\n\tmountMutex        sync.Mutex\n\tmountsInitialized bool\n\tallMountsByDevice map[DeviceNumber][]*Mount\n)\n\ntype DeviceNumber uint64\n\nfunc (num DeviceNumber) String() string {\n\treturn fmt.Sprintf(\"%d:%d\", unix.Major(uint64(num)), unix.Minor(uint64(num)))\n}\n\n// getNumberOfContainingDevice returns the device number of the filesystem which\n// contains the given file.  If the file is a symlink, it is not dereferenced.\nfunc getNumberOfContainingDevice(path string) (DeviceNumber, error) {\n\tvar stat unix.Stat_t\n\tif err := unix.Lstat(path, &stat); err != nil {\n\t\treturn 0, err\n\t}\n\treturn DeviceNumber(stat.Dev), nil\n}\n\nfunc filesystemLacksMainMountError(deviceNumber DeviceNumber) error {\n\treturn errors.Errorf(\n\t\t\"Device %q (%v) lacks a \\\"main\\\" mountpoint in the current mount namespace, so it's ambiguous where to store the fscrypt metadata.\",\n\t\tgetDeviceName(deviceNumber),\n\t\tdeviceNumber,\n\t)\n}\n\ntype Mount struct {\n\tPath           string\n\tFilesystemType string\n\tDevice         string\n\tDeviceNumber   DeviceNumber\n\tSubtree        string\n\tReadOnly       bool\n}\n\nfunc FindMount(path string) (*Mount, error) {\n\tmountMutex.Lock()\n\tdefer mountMutex.Unlock()\n\tif err := loadMountInfo(); err != nil {\n\t\treturn nil, err\n\t}\n\t// First try to find the mount by the number of the containing device.\n\tdeviceNumber, err := getNumberOfContainingDevice(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmnt, ok := mountsByDevice[deviceNumber]\n\n\tif ok {\n\t\tif mnt == nil {\n\t\t\tmnts, ok := allMountsByDevice[deviceNumber]\n\t\t\tif ok {\n\t\t\t\tif len(mnts) == 0 {\n\t\t\t\t\treturn nil, filesystemLacksMainMountError(deviceNumber)\n\t\t\t\t}\n\n\t\t\t\tfor _, mnt := range mnts {\n\t\t\t\t\tif strings.HasPrefix(path, mnt.Path) {\n\t\t\t\t\t\treturn mnt, nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil, filesystemLacksMainMountError(deviceNumber)\n\t\t}\n\n\t\treturn mnt, nil\n\t}\n\t// The mount couldn't be found by the number of the containing device.\n\t// Fall back to walking up the directory hierarchy and checking for a\n\t// mount at each directory path.  This is necessary for btrfs, where\n\t// files report a different st_dev from the /proc/self/mountinfo entry.\n\tcurPath, err := filepath_.CanonicalizePath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor {\n\t\tmnt := mountsByPath[curPath]\n\t\tif mnt != nil {\n\t\t\treturn mnt, nil\n\t\t}\n\t\t// Move to the parent directory unless we have reached the root.\n\t\tparent := filepath.Dir(curPath)\n\t\tif parent == curPath {\n\t\t\treturn nil, errors.Errorf(\"couldn't find mountpoint containing %q\", path)\n\t\t}\n\t\tcurPath = parent\n\t}\n}\n\n// loadMountInfo populates the Mount mappings by parsing /proc/self/mountinfo.\n// It returns an error if the Mount mappings cannot be populated.\nfunc loadMountInfo() error {\n\tif !mountsInitialized {\n\t\tfile, err := os.Open(\"/proc/self/mountinfo\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer file.Close()\n\t\tif err := readMountInfo(file); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tmountsInitialized = true\n\t}\n\treturn nil\n}\n\n// This is separate from loadMountInfo() only for unit testing.\nfunc readMountInfo(r io.Reader) error {\n\tmountsByDevice = make(map[DeviceNumber]*Mount)\n\tmountsByPath = make(map[string]*Mount)\n\tallMountsByDevice = make(map[DeviceNumber][]*Mount)\n\tallMountsByPath := make(map[string]*Mount)\n\n\tscanner := bufio.NewScanner(r)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tmnt := parseMountInfoLine(line)\n\t\tif mnt == nil {\n\t\t\tlogrus.Warnf(\"ignoring invalid mountinfo line %q\", line)\n\t\t\tcontinue\n\t\t}\n\n\t\t// We can only use mountpoints that are directories for fscrypt.\n\t\tisDir, err := os_.IsDir(mnt.Path)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"ignoring mountpoint %v because isDir failed\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif !isDir {\n\t\t\tlogrus.Infof(\"ignoring mountpoint %q because it is not a directory\", mnt.Path)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Note this overrides the info if we have seen the mountpoint\n\t\t// earlier in the file. This is correct behavior because the\n\t\t// mountpoints are listed in mount order.\n\t\tallMountsByPath[mnt.Path] = mnt\n\t}\n\t// For each filesystem, choose a \"main\" Mount and discard any additional\n\t// bind mounts.  fscrypt only cares about the main Mount, since it's\n\t// where the fscrypt metadata is stored.  Store all the main Mounts in\n\t// mountsByDevice and mountsByPath so that they can be found later.\n\tfor _, mnt := range allMountsByPath {\n\t\tallMountsByDevice[mnt.DeviceNumber] =\n\t\t\tappend(allMountsByDevice[mnt.DeviceNumber], mnt)\n\t}\n\n\tfor deviceNumber, filesystemMounts := range allMountsByDevice {\n\t\tmnt := findMainMount(filesystemMounts)\n\t\tmountsByDevice[deviceNumber] = mnt // may store an explicit nil entry\n\t\tif mnt != nil {\n\t\t\tmountsByPath[mnt.Path] = mnt\n\t\t}\n\t}\n\treturn nil\n}\n\n// For more details, see https://www.kernel.org/doc/Documentation/filesystems/proc.txt\nfunc parseMountInfoLine(line string) *Mount {\n\tfields := strings.Split(line, \" \")\n\tif len(fields) < 10 {\n\t\treturn nil\n\t}\n\n\t// Count the optional fields.  In case new fields are appended later,\n\t// don't simply assume that n == len(fields) - 4.\n\tn := 6\n\tfor fields[n] != \"-\" {\n\t\tn++\n\t\tif n >= len(fields) {\n\t\t\treturn nil\n\t\t}\n\t}\n\tif n+3 >= len(fields) {\n\t\treturn nil\n\t}\n\n\tvar mnt *Mount = &Mount{}\n\tvar err error\n\tmnt.DeviceNumber, err = newDeviceNumberFromString(fields[2])\n\tif err != nil {\n\t\treturn nil\n\t}\n\tmnt.Subtree = unescapeString(fields[3])\n\tmnt.Path = unescapeString(fields[4])\n\tfor _, opt := range strings.Split(fields[5], \",\") {\n\t\tif opt == \"ro\" {\n\t\t\tmnt.ReadOnly = true\n\t\t}\n\t}\n\tmnt.FilesystemType = unescapeString(fields[n+1])\n\tmnt.Device = getDeviceName(mnt.DeviceNumber)\n\treturn mnt\n}\n\nfunc newDeviceNumberFromString(str string) (DeviceNumber, error) {\n\tvar major, minor uint32\n\tif count, _ := fmt.Sscanf(str, \"%d:%d\", &major, &minor); count != 2 {\n\t\treturn 0, errors.Errorf(\"invalid device number string %q\", str)\n\t}\n\treturn DeviceNumber(unix.Mkdev(major, minor)), nil\n}\n\n// Unescape octal-encoded escape sequences in a string from the mountinfo file.\n// The kernel encodes the ' ', '\\t', '\\n', and '\\\\' bytes this way.  This\n// function exactly inverts what the kernel does, including by preserving\n// invalid UTF-8.\nfunc unescapeString(str string) string {\n\tvar sb strings.Builder\n\tfor i := 0; i < len(str); i++ {\n\t\tb := str[i]\n\t\tif b == '\\\\' && i+3 < len(str) {\n\t\t\tif parsed, err := strconv.ParseInt(str[i+1:i+4], 8, 8); err == nil {\n\t\t\t\tb = uint8(parsed)\n\t\t\t\ti += 3\n\t\t\t}\n\t\t}\n\t\tsb.WriteByte(b)\n\t}\n\treturn sb.String()\n}\n\n// We get the device name via the device number rather than use the mount source\n// field directly.  This is necessary to handle a rootfs that was mounted via\n// the kernel command line, since mountinfo always shows /dev/root for that.\n// This assumes that the device nodes are in the standard location.\nfunc getDeviceName(num DeviceNumber) string {\n\tlinkPath := fmt.Sprintf(\"/sys/dev/block/%v\", num)\n\tif target, err := os.Readlink(linkPath); err == nil {\n\t\treturn fmt.Sprintf(\"/dev/%s\", filepath.Base(target))\n\t}\n\treturn \"\"\n}\n\ntype mountpointTreeNode struct {\n\tmount    *Mount\n\tparent   *mountpointTreeNode\n\tchildren []*mountpointTreeNode\n}\n\nfunc addUncontainedSubtreesRecursive(dst map[string]bool,\n\tnode *mountpointTreeNode, allUncontainedSubtrees map[string]bool) {\n\tif allUncontainedSubtrees[node.mount.Subtree] {\n\t\tdst[node.mount.Subtree] = true\n\t}\n\tfor _, child := range node.children {\n\t\taddUncontainedSubtreesRecursive(dst, child, allUncontainedSubtrees)\n\t}\n}\n\nfunc findMainMount(filesystemMounts []*Mount) *Mount {\n\t// Index this filesystem's mounts by path.  Note: paths are unique here,\n\t// since non-last mounts were already excluded earlier.\n\t//\n\t// Also build the set of all mounted subtrees.\n\tfilesystemMountsByPath := make(map[string]*mountpointTreeNode)\n\tallSubtrees := make(map[string]bool)\n\tfor _, mnt := range filesystemMounts {\n\t\tfilesystemMountsByPath[mnt.Path] = &mountpointTreeNode{mount: mnt}\n\t\tallSubtrees[mnt.Subtree] = true\n\t}\n\n\t// Divide the mounts into non-overlapping trees of mountpoints.\n\tfor path, mntNode := range filesystemMountsByPath {\n\t\tfor path != \"/\" && mntNode.parent == nil {\n\t\t\tpath = filepath.Dir(path)\n\t\t\tif parent := filesystemMountsByPath[path]; parent != nil {\n\t\t\t\tmntNode.parent = parent\n\t\t\t\tparent.children = append(parent.children, mntNode)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Build the set of mounted subtrees that aren't contained in any other\n\t// mounted subtree.\n\tallUncontainedSubtrees := make(map[string]bool)\n\tfor subtree := range allSubtrees {\n\t\tcontained := false\n\t\tfor t := subtree; t != \"/\" && !contained; {\n\t\t\tt = filepath.Dir(t)\n\t\t\tcontained = allSubtrees[t]\n\t\t}\n\t\tif !contained {\n\t\t\tallUncontainedSubtrees[subtree] = true\n\t\t}\n\t}\n\n\t// Select the root of a mountpoint tree whose mounted subtrees contain\n\t// *all* mounted subtrees.  Equivalently, select a mountpoint tree in\n\t// which every uncontained subtree is mounted.\n\tvar mainMount *Mount\n\tfor _, mntNode := range filesystemMountsByPath {\n\t\tmnt := mntNode.mount\n\t\tif mntNode.parent != nil {\n\t\t\tcontinue\n\t\t}\n\t\tuncontainedSubtrees := make(map[string]bool)\n\t\taddUncontainedSubtreesRecursive(uncontainedSubtrees, mntNode, allUncontainedSubtrees)\n\t\tif len(uncontainedSubtrees) != len(allUncontainedSubtrees) {\n\t\t\tcontinue\n\t\t}\n\t\t// If there's more than one eligible mount, they should have the\n\t\t// same Subtree.  Otherwise it's ambiguous which one to use.\n\t\tif mainMount != nil && mainMount.Subtree != mnt.Subtree {\n\t\t\tlogrus.Errorf(\n\t\t\t\t\"Unsupported case: %q (%v) has multiple non-overlapping mounts. This filesystem will be ignored!\",\n\t\t\t\tmnt.Device,\n\t\t\t\tmnt.DeviceNumber,\n\t\t\t)\n\t\t\treturn nil\n\t\t}\n\t\t// Prefer a read-write mount to a read-only one.\n\t\tif mainMount == nil || mainMount.ReadOnly {\n\t\t\tmainMount = mnt\n\t\t}\n\t}\n\treturn mainMount\n}\n"
  },
  {
    "path": "go/flag/flag.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage flag\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tusageFmt = \"Usage:\\n  %s\\n\"\n)\n\n// NamedFlagSets stores named flag sets in the order of calling FlagSet.\ntype NamedFlagSets struct {\n\t// Order is an ordered list of flag set names.\n\tOrder []string\n\t// FlagSets stores the flag sets by name.\n\tFlagSets map[string]*pflag.FlagSet\n\t// NormalizeNameFunc is the normalize function which used to initialize FlagSets created by NamedFlagSets.\n\tNormalizeNameFunc func(f *pflag.FlagSet, name string) pflag.NormalizedName\n}\n\n// FlagSet returns the flag set with the given name and adds it to the\n// ordered name list if it is not in there yet.\nfunc (nfs *NamedFlagSets) FlagSet(name string) *pflag.FlagSet {\n\tif nfs.FlagSets == nil {\n\t\tnfs.FlagSets = map[string]*pflag.FlagSet{}\n\t}\n\tif _, ok := nfs.FlagSets[name]; !ok {\n\t\tflagSet := pflag.NewFlagSet(name, pflag.ExitOnError)\n\t\tflagSet.SetNormalizeFunc(pflag.CommandLine.GetNormalizeFunc())\n\t\tif nfs.NormalizeNameFunc != nil {\n\t\t\tflagSet.SetNormalizeFunc(nfs.NormalizeNameFunc)\n\t\t}\n\t\tnfs.FlagSets[name] = flagSet\n\t\tnfs.Order = append(nfs.Order, name)\n\t}\n\treturn nfs.FlagSets[name]\n}\n\n// PrintSections prints the given names flag sets in sections, with the maximal given column number.\n// If cols is zero, lines are not wrapped.\nfunc PrintSections(w io.Writer, fss NamedFlagSets, cols int) {\n\tfor _, name := range fss.Order {\n\t\tfs := fss.FlagSets[name]\n\t\tif !fs.HasFlags() {\n\t\t\tcontinue\n\t\t}\n\n\t\twideFS := pflag.NewFlagSet(\"\", pflag.ExitOnError)\n\t\twideFS.AddFlagSet(fs)\n\n\t\tvar zzz string\n\t\tif cols > 24 {\n\t\t\tzzz = strings.Repeat(\"z\", cols-24)\n\t\t\twideFS.Int(zzz, 0, strings.Repeat(\"z\", cols-24))\n\t\t}\n\n\t\tvar buf bytes.Buffer\n\t\tfmt.Fprintf(&buf, \"\\n%s flags:\\n\\n%s\", strings.ToUpper(name[:1])+name[1:], wideFS.FlagUsagesWrapped(cols))\n\n\t\tif cols > 24 {\n\t\t\ti := strings.Index(buf.String(), zzz)\n\t\t\tlines := strings.Split(buf.String()[:i], \"\\n\")\n\t\t\tfmt.Fprint(w, strings.Join(lines[:len(lines)-1], \"\\n\"))\n\t\t\tfmt.Fprintln(w)\n\t\t} else {\n\t\t\tfmt.Fprint(w, buf.String())\n\t\t}\n\t}\n}\n\n// SetUsageAndHelpFunc set both usage and help function.\n// Print the flag sets we need instead of all of them.\nfunc SetUsageAndHelpFunc(cmd *cobra.Command, fss NamedFlagSets, cols int) {\n\tcmd.SetUsageFunc(func(cmd *cobra.Command) error {\n\t\tfmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine())\n\t\tPrintSections(cmd.OutOrStderr(), fss, cols)\n\t\treturn nil\n\t})\n\tcmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {\n\t\tfmt.Fprintf(cmd.OutOrStdout(), \"%s\\n\\n\"+usageFmt, cmd.Long, cmd.UseLine())\n\t\tPrintSections(cmd.OutOrStdout(), fss, cols)\n\t})\n}\n"
  },
  {
    "path": "go/go.mod",
    "content": "module github.com/kaydxh/golang/go\n\ngo 1.24.0\n\nrequire (\n\tgithub.com/gin-gonic/gin v1.11.0\n\tgithub.com/go-playground/validator/v10 v10.28.0\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/google/uuid v1.6.0\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3\n\tgithub.com/moby/term v0.5.2\n\tgithub.com/pkg/errors v0.9.1\n\tgithub.com/shirou/gopsutil v3.21.11+incompatible\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/cobra v1.10.1\n\tgithub.com/spf13/pflag v1.0.10\n\tgithub.com/stretchr/testify v1.11.1\n\tgolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6\n\tgolang.org/x/net v0.48.0\n\tgolang.org/x/sys v0.39.0\n\tgolang.org/x/text v0.32.0\n\tgolang.org/x/time v0.14.0\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217\n\tgoogle.golang.org/grpc v1.77.0\n\tgoogle.golang.org/protobuf v1.36.10\n\tgotest.tools v2.2.0+incompatible\n\tgotest.tools/v3 v3.5.2\n)\n\nrequire (\n\tgithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/go-ole/go-ole v1.2.6 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/google/go-cmp v0.7.0 // indirect\n\tgithub.com/inconshreveable/mousetrap v1.1.0 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/kr/text v0.2.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect\n\tgithub.com/rogpeppe/go-internal v1.14.1 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgithub.com/yusufpapurcu/wmi v1.2.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n)\n"
  },
  {
    "path": "go/go.sum",
    "content": "github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=\ngithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=\ngithub.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=\ngithub.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=\ngithub.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=\ngithub.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=\ngithub.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=\ngithub.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=\ngithub.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=\ngithub.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 h1:zfMcR1Cs4KNuomFFgGefv5N0czO2XZpUbxGUy8i8ug0=\ngolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\n"
  },
  {
    "path": "go/idgen/id_gen.go",
    "content": "// Package idgen 提供基于 Snowflake 算法的分布式唯一 ID 生成器\n//\n// ID 结构 (64位):\n//   - 1位: 保留位(始终为0)\n//   - 41位: 时间戳(毫秒级)\n//   - 10位: 机器ID(支持0-1023台机器)\n//   - 12位: 序列号(每毫秒最多4096个ID)\n//\n// 使用示例:\n//\n//\tgen := idgen.NewGenerator(1) // 机器ID为1\n//\tid := gen.NextID()\n//\tfmt.Printf(\"生成的ID: %d\\n\", id)\npackage idgen\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nconst (\n\t// Epoch 是自定义纪元时间戳(毫秒)，默认为 2024-01-01 00:00:00 UTC\n\t// 可以根据项目实际启动时间调整，以获得更长的使用寿命\n\tEpoch int64 = 1704067200000 // 2024-01-01 00:00:00 UTC\n\n\t// 各部分的位数\n\tworkerIDBits = 10 // 机器ID位数\n\tsequenceBits = 12 // 序列号位数\n\n\t// 最大值\n\tmaxWorkerID = -1 ^ (-1 << workerIDBits) // 1023\n\tmaxSequence = -1 ^ (-1 << sequenceBits) // 4095\n\n\t// 位移量\n\tworkerIDShift  = sequenceBits                // 12\n\ttimestampShift = sequenceBits + workerIDBits // 22\n)\n\nvar (\n\t// ErrInvalidWorkerID 当机器ID超出范围时返回\n\tErrInvalidWorkerID = errors.New(\"worker ID must be between 0 and 1023\")\n\n\t// ErrClockMovedBackwards 当系统时钟回拨时返回\n\tErrClockMovedBackwards = errors.New(\"clock moved backwards\")\n)\n\n// Generator 是一个线程安全的 ID 生成器\ntype Generator struct {\n\tmu            sync.Mutex\n\tworkerID      int64\n\tsequence      int64\n\tlastTimestamp int64\n}\n\n// NewGenerator 创建一个新的 ID 生成器\n// workerID 必须在 0-1023 范围内，用于区分不同的机器或实例\nfunc NewGenerator(workerID int64) (*Generator, error) {\n\tif workerID < 0 || workerID > maxWorkerID {\n\t\treturn nil, ErrInvalidWorkerID\n\t}\n\n\treturn &Generator{\n\t\tworkerID:      workerID,\n\t\tsequence:      0,\n\t\tlastTimestamp: 0,\n\t}, nil\n}\n\n// MustNewGenerator 创建一个新的 ID 生成器，如果出错则 panic\n// 适用于在初始化阶段使用\nfunc MustNewGenerator(workerID int64) *Generator {\n\tgen, err := NewGenerator(workerID)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to create generator: %v\", err))\n\t}\n\treturn gen\n}\n\n// NextID 生成下一个唯一 ID\n// 返回一个 uint64 类型的唯一标识符\nfunc (g *Generator) NextID() (uint64, error) {\n\tg.mu.Lock()\n\tdefer g.mu.Unlock()\n\n\ttimestamp := g.currentMillis()\n\n\t// 检测时钟回拨\n\tif timestamp < g.lastTimestamp {\n\t\treturn 0, fmt.Errorf(\"%w: refused to generate id for %d milliseconds\",\n\t\t\tErrClockMovedBackwards, g.lastTimestamp-timestamp)\n\t}\n\n\t// 同一毫秒内\n\tif timestamp == g.lastTimestamp {\n\t\tg.sequence = (g.sequence + 1) & maxSequence\n\t\tif g.sequence == 0 {\n\t\t\t// 序列号溢出，等待下一毫秒\n\t\t\ttimestamp = g.waitNextMillis(g.lastTimestamp)\n\t\t}\n\t} else {\n\t\t// 新的毫秒，重置序列号\n\t\tg.sequence = 0\n\t}\n\n\tg.lastTimestamp = timestamp\n\n\t// 组合各部分生成最终 ID\n\tid := uint64((timestamp-Epoch)<<timestampShift |\n\t\t(g.workerID << workerIDShift) |\n\t\tg.sequence)\n\n\treturn id, nil\n}\n\n// MustNextID 生成下一个唯一 ID，如果出错则 panic\nfunc (g *Generator) MustNextID() uint64 {\n\tid, err := g.NextID()\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to generate id: %v\", err))\n\t}\n\treturn id\n}\n\n// currentMillis 返回当前时间戳(毫秒)\nfunc (g *Generator) currentMillis() int64 {\n\treturn time.Now().UnixMilli()\n}\n\n// waitNextMillis 等待直到下一毫秒\nfunc (g *Generator) waitNextMillis(lastTimestamp int64) int64 {\n\ttimestamp := g.currentMillis()\n\tfor timestamp <= lastTimestamp {\n\t\ttimestamp = g.currentMillis()\n\t}\n\treturn timestamp\n}\n\n// ParseID 解析 ID，返回时间戳、机器ID和序列号\nfunc ParseID(id uint64) (timestamp int64, workerID int64, sequence int64) {\n\tsequence = int64(id) & maxSequence\n\tworkerID = (int64(id) >> workerIDShift) & maxWorkerID\n\ttimestamp = (int64(id) >> timestampShift) + Epoch\n\treturn\n}\n\n// GetTimestamp 从 ID 中提取时间戳\nfunc GetTimestamp(id uint64) time.Time {\n\ttimestamp, _, _ := ParseID(id)\n\treturn time.UnixMilli(timestamp)\n}\n\n// GetWorkerID 从 ID 中提取机器ID\nfunc GetWorkerID(id uint64) int64 {\n\t_, workerID, _ := ParseID(id)\n\treturn workerID\n}\n\n// GetSequence 从 ID 中提取序列号\nfunc GetSequence(id uint64) int64 {\n\t_, _, sequence := ParseID(id)\n\treturn sequence\n}\n\n// GenerateUint64FromUUID 生成uint64\nfunc GenerateUint64FromUUID() uint64 {\n\tid := uuid.New()\n\treturn UUIDToUint64XOR(id)\n}\n\n// UUIDToUint64XOR 将UUID转换为uint64\nfunc UUIDToUint64XOR(id uuid.UUID) uint64 {\n\thigh := binary.BigEndian.Uint64(id[:8])\n\tlow := binary.BigEndian.Uint64(id[8:])\n\treturn high ^ low\n}\n"
  },
  {
    "path": "go/idgen/id_gen_test.go",
    "content": "package idgen\n\nimport (\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\n// TestNewGenerator 测试生成器的创建\nfunc TestNewGenerator(t *testing.T) {\n\ttests := []struct {\n\t\tname      string\n\t\tworkerID  int64\n\t\twantError bool\n\t}{\n\t\t{\"valid worker ID 0\", 0, false},\n\t\t{\"valid worker ID 1\", 1, false},\n\t\t{\"valid worker ID 512\", 512, false},\n\t\t{\"valid worker ID 1023\", 1023, false},\n\t\t{\"invalid worker ID -1\", -1, true},\n\t\t{\"invalid worker ID 1024\", 1024, true},\n\t\t{\"invalid worker ID 2000\", 2000, true},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tgen, err := NewGenerator(tt.workerID)\n\t\t\tif tt.wantError {\n\t\t\t\tif err == nil {\n\t\t\t\t\tt.Errorf(\"NewGenerator(%d) expected error, got nil\", tt.workerID)\n\t\t\t\t}\n\t\t\t\tif gen != nil {\n\t\t\t\t\tt.Errorf(\"NewGenerator(%d) expected nil generator on error\", tt.workerID)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"NewGenerator(%d) unexpected error: %v\", tt.workerID, err)\n\t\t\t\t}\n\t\t\t\tif gen == nil {\n\t\t\t\t\tt.Errorf(\"NewGenerator(%d) returned nil generator\", tt.workerID)\n\t\t\t\t}\n\t\t\t\tif gen.workerID != tt.workerID {\n\t\t\t\t\tt.Errorf(\"NewGenerator(%d) workerID = %d, want %d\", tt.workerID, gen.workerID, tt.workerID)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\n// TestMustNewGenerator 测试 MustNewGenerator\nfunc TestMustNewGenerator(t *testing.T) {\n\t// 正常情况\n\tt.Run(\"valid worker ID\", func(t *testing.T) {\n\t\tdefer func() {\n\t\t\tif r := recover(); r != nil {\n\t\t\t\tt.Errorf(\"MustNewGenerator(1) should not panic, got: %v\", r)\n\t\t\t}\n\t\t}()\n\t\tgen := MustNewGenerator(1)\n\t\tif gen == nil {\n\t\t\tt.Error(\"MustNewGenerator(1) returned nil\")\n\t\t}\n\t})\n\n\t// 应该 panic 的情况\n\tt.Run(\"invalid worker ID should panic\", func(t *testing.T) {\n\t\tdefer func() {\n\t\t\tif r := recover(); r == nil {\n\t\t\t\tt.Error(\"MustNewGenerator(1024) should panic but didn't\")\n\t\t\t}\n\t\t}()\n\t\tMustNewGenerator(1024)\n\t})\n}\n\n// TestNextID 测试基本的ID生成\nfunc TestNextID(t *testing.T) {\n\tgen := MustNewGenerator(1)\n\n\t// 生成多个ID，确保都能成功\n\tids := make([]uint64, 100)\n\tfor i := 0; i < 100; i++ {\n\t\tid, err := gen.NextID()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"NextID() error: %v\", err)\n\t\t}\n\t\tif id == 0 {\n\t\t\tt.Error(\"NextID() returned 0\")\n\t\t}\n\t\tids[i] = id\n\t}\n\n\t// 检查ID是否递增\n\tfor i := 1; i < len(ids); i++ {\n\t\tif ids[i] <= ids[i-1] {\n\t\t\tt.Errorf(\"IDs not increasing: ids[%d]=%d, ids[%d]=%d\", i-1, ids[i-1], i, ids[i])\n\t\t}\n\t}\n}\n\n// TestMustNextID 测试 MustNextID\nfunc TestMustNextID(t *testing.T) {\n\tgen := MustNewGenerator(1)\n\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tt.Errorf(\"MustNextID() should not panic, got: %v\", r)\n\t\t}\n\t}()\n\n\tid := gen.MustNextID()\n\tif id == 0 {\n\t\tt.Error(\"MustNextID() returned 0\")\n\t}\n}\n\n// TestIDUniqueness 测试ID的唯一性\nfunc TestIDUniqueness(t *testing.T) {\n\tgen := MustNewGenerator(1)\n\tcount := 10000\n\tids := make(map[uint64]bool, count)\n\n\tfor i := 0; i < count; i++ {\n\t\tid := gen.MustNextID()\n\t\tif ids[id] {\n\t\t\tt.Fatalf(\"Duplicate ID found: %d\", id)\n\t\t}\n\t\tids[id] = true\n\t}\n\n\tif len(ids) != count {\n\t\tt.Errorf(\"Expected %d unique IDs, got %d\", count, len(ids))\n\t}\n}\n\n// TestWorkerIDInGeneratedID 测试生成的ID中是否包含正确的机器ID\nfunc TestWorkerIDInGeneratedID(t *testing.T) {\n\ttests := []int64{0, 1, 100, 512, 1023}\n\n\tfor _, workerID := range tests {\n\t\tt.Run(formatWorkerID(workerID), func(t *testing.T) {\n\t\t\tgen := MustNewGenerator(workerID)\n\t\t\tid := gen.MustNextID()\n\n\t\t\textractedWorkerID := GetWorkerID(id)\n\t\t\tif extractedWorkerID != workerID {\n\t\t\t\tt.Errorf(\"WorkerID mismatch: generated with %d, extracted %d\", workerID, extractedWorkerID)\n\t\t\t}\n\t\t})\n\t}\n}\n\n// TestParseID 测试ID解析功能\nfunc TestParseID(t *testing.T) {\n\tworkerID := int64(123)\n\tgen := MustNewGenerator(workerID)\n\n\tbeforeTime := time.Now()\n\tid := gen.MustNextID()\n\tafterTime := time.Now()\n\n\ttimestamp, parsedWorkerID, sequence := ParseID(id)\n\n\t// 检查时间戳是否在合理范围内\n\tif timestamp < beforeTime.UnixMilli() || timestamp > afterTime.UnixMilli() {\n\t\tt.Errorf(\"Timestamp out of range: %d not between %d and %d\",\n\t\t\ttimestamp, beforeTime.UnixMilli(), afterTime.UnixMilli())\n\t}\n\n\t// 检查机器ID\n\tif parsedWorkerID != workerID {\n\t\tt.Errorf(\"WorkerID mismatch: expected %d, got %d\", workerID, parsedWorkerID)\n\t}\n\n\t// 检查序列号\n\tif sequence < 0 || sequence > maxSequence {\n\t\tt.Errorf(\"Sequence out of range: %d\", sequence)\n\t}\n}\n\n// TestGetTimestamp 测试时间戳提取\nfunc TestGetTimestamp(t *testing.T) {\n\tgen := MustNewGenerator(1)\n\n\tbefore := time.Now()\n\ttime.Sleep(10 * time.Millisecond)\n\tid := gen.MustNextID()\n\ttime.Sleep(10 * time.Millisecond)\n\tafter := time.Now()\n\n\ttimestamp := GetTimestamp(id)\n\n\tif timestamp.Before(before) || timestamp.After(after) {\n\t\tt.Errorf(\"Timestamp %v not between %v and %v\", timestamp, before, after)\n\t}\n}\n\n// TestSequenceOverflow 测试同一毫秒内的序列号溢出\nfunc TestSequenceOverflow(t *testing.T) {\n\tgen := MustNewGenerator(1)\n\n\t// 快速生成大量ID，可能触发序列号溢出\n\tcount := 5000\n\tids := make([]uint64, count)\n\n\tstart := time.Now()\n\tfor i := 0; i < count; i++ {\n\t\tids[i] = gen.MustNextID()\n\t}\n\telapsed := time.Since(start)\n\n\tt.Logf(\"Generated %d IDs in %v\", count, elapsed)\n\n\t// 检查唯一性\n\tidMap := make(map[uint64]bool)\n\tfor _, id := range ids {\n\t\tif idMap[id] {\n\t\t\tt.Fatalf(\"Duplicate ID found: %d\", id)\n\t\t}\n\t\tidMap[id] = true\n\t}\n}\n\n// TestConcurrentGeneration 并发测试\nfunc TestConcurrentGeneration(t *testing.T) {\n\tgen := MustNewGenerator(1)\n\n\tgoroutines := 100\n\tidsPerGoroutine := 1000\n\ttotalIDs := goroutines * idsPerGoroutine\n\n\tvar wg sync.WaitGroup\n\tidChan := make(chan uint64, totalIDs)\n\n\tstart := time.Now()\n\n\t// 启动多个goroutine并发生成ID\n\tfor i := 0; i < goroutines; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tfor j := 0; j < idsPerGoroutine; j++ {\n\t\t\t\tid := gen.MustNextID()\n\t\t\t\tidChan <- id\n\t\t\t}\n\t\t}()\n\t}\n\n\t// 等待所有goroutine完成\n\twg.Wait()\n\tclose(idChan)\n\n\telapsed := time.Since(start)\n\tt.Logf(\"Generated %d IDs concurrently in %v (%.0f IDs/sec)\",\n\t\ttotalIDs, elapsed, float64(totalIDs)/elapsed.Seconds())\n\n\t// 检查唯一性\n\tidMap := make(map[uint64]bool, totalIDs)\n\tduplicates := 0\n\n\tfor id := range idChan {\n\t\tif idMap[id] {\n\t\t\tduplicates++\n\t\t\tt.Errorf(\"Duplicate ID found: %d\", id)\n\t\t}\n\t\tidMap[id] = true\n\t}\n\n\tif duplicates > 0 {\n\t\tt.Errorf(\"Found %d duplicate IDs\", duplicates)\n\t}\n\n\tif len(idMap) != totalIDs {\n\t\tt.Errorf(\"Expected %d unique IDs, got %d\", totalIDs, len(idMap))\n\t}\n}\n\n// TestMultipleGenerators 测试多个生成器同时工作\nfunc TestMultipleGenerators(t *testing.T) {\n\tworkers := 10\n\tidsPerWorker := 1000\n\ttotalIDs := workers * idsPerWorker\n\n\tvar wg sync.WaitGroup\n\tidChan := make(chan uint64, totalIDs)\n\n\t// 创建多个生成器，每个使用不同的机器ID\n\tfor workerID := 0; workerID < workers; workerID++ {\n\t\twg.Add(1)\n\t\tgo func(wID int64) {\n\t\t\tdefer wg.Done()\n\t\t\tgen := MustNewGenerator(wID)\n\t\t\tfor i := 0; i < idsPerWorker; i++ {\n\t\t\t\tid := gen.MustNextID()\n\t\t\t\tidChan <- id\n\t\t\t}\n\t\t}(int64(workerID))\n\t}\n\n\twg.Wait()\n\tclose(idChan)\n\n\t// 检查所有ID的唯一性\n\tidMap := make(map[uint64]bool, totalIDs)\n\tfor id := range idChan {\n\t\tif idMap[id] {\n\t\t\tt.Errorf(\"Duplicate ID found: %d\", id)\n\t\t}\n\t\tidMap[id] = true\n\t}\n\n\tif len(idMap) != totalIDs {\n\t\tt.Errorf(\"Expected %d unique IDs, got %d\", totalIDs, len(idMap))\n\t}\n}\n\n// TestConcurrentSameWorker 测试同一个生成器的高并发场景\nfunc TestConcurrentSameWorker(t *testing.T) {\n\tgen := MustNewGenerator(1)\n\n\tgoroutines := 1000\n\tidsPerGoroutine := 100\n\ttotalIDs := goroutines * idsPerGoroutine\n\n\tvar wg sync.WaitGroup\n\tvar mu sync.Mutex\n\tidMap := make(map[uint64]bool, totalIDs)\n\tduplicates := 0\n\n\tstart := time.Now()\n\n\tfor i := 0; i < goroutines; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tfor j := 0; j < idsPerGoroutine; j++ {\n\t\t\t\tid := gen.MustNextID()\n\n\t\t\t\tmu.Lock()\n\t\t\t\tif idMap[id] {\n\t\t\t\t\tduplicates++\n\t\t\t\t}\n\t\t\t\tidMap[id] = true\n\t\t\t\tmu.Unlock()\n\t\t\t}\n\t\t}()\n\t}\n\n\twg.Wait()\n\telapsed := time.Since(start)\n\n\tt.Logf(\"Generated %d IDs with %d goroutines in %v (%.0f IDs/sec)\",\n\t\ttotalIDs, goroutines, elapsed, float64(totalIDs)/elapsed.Seconds())\n\n\tif duplicates > 0 {\n\t\tt.Errorf(\"Found %d duplicate IDs in concurrent test\", duplicates)\n\t}\n\n\tif len(idMap) != totalIDs {\n\t\tt.Errorf(\"Expected %d unique IDs, got %d\", totalIDs, len(idMap))\n\t}\n}\n\n// BenchmarkNextID 基准测试：单线程生成性能\nfunc BenchmarkNextID(b *testing.B) {\n\tgen := MustNewGenerator(1)\n\tb.ResetTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tgen.MustNextID()\n\t}\n}\n\n// BenchmarkNextIDParallel 基准测试：并发生成性能\nfunc BenchmarkNextIDParallel(b *testing.B) {\n\tgen := MustNewGenerator(1)\n\tb.ResetTimer()\n\n\tb.RunParallel(func(pb *testing.PB) {\n\t\tfor pb.Next() {\n\t\t\tgen.MustNextID()\n\t\t}\n\t})\n}\n\n// BenchmarkParseID 基准测试：ID解析性能\nfunc BenchmarkParseID(b *testing.B) {\n\tgen := MustNewGenerator(1)\n\tid := gen.MustNextID()\n\tb.ResetTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tParseID(id)\n\t}\n}\n\n// 辅助函数：格式化机器ID用于测试名称\nfunc formatWorkerID(workerID int64) string {\n\treturn string(rune('0' + workerID%10))\n}\n"
  },
  {
    "path": "go/idgen/wk_id_gen.go",
    "content": "package idgen\n\nimport (\n\t\"crypto/md5\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"strings\"\n)\n\n// WorkerIDGenerator 用于根据机器信息自动生成 WorkerID\ntype WorkerIDGenerator struct{}\n\n// NewWorkerIDGenerator 创建一个 WorkerID 生成器\nfunc NewWorkerIDGenerator() *WorkerIDGenerator {\n\treturn &WorkerIDGenerator{}\n}\n\n// GenerateWorkerID 根据机器信息自动生成 WorkerID (0-1023)\n// 优先级: 环境变量 > IP地址 > MAC地址 > 主机名\nfunc (w *WorkerIDGenerator) GenerateWorkerID() (int64, error) {\n\t// 方法1: 从环境变量读取\n\tif id, ok := w.fromEnv(); ok {\n\t\treturn id, nil\n\t}\n\n\t// 方法2: 基于IP地址生成\n\tif id, ok := w.fromIP(); ok {\n\t\treturn id, nil\n\t}\n\n\t// 方法3: 基于MAC地址生成\n\tif id, ok := w.fromMAC(); ok {\n\t\treturn id, nil\n\t}\n\n\t// 方法4: 基于主机名生成\n\tif id, ok := w.fromHostname(); ok {\n\t\treturn id, nil\n\t}\n\n\treturn 0, fmt.Errorf(\"failed to generate worker ID from machine info\")\n}\n\n// fromEnv 从环境变量读取 WorkerID\nfunc (w *WorkerIDGenerator) fromEnv() (int64, bool) {\n\tenvVars := []string{\"WORKER_ID\", \"MACHINE_ID\", \"NODE_ID\", \"POD_ID\"}\n\n\tfor _, envVar := range envVars {\n\t\tif value := os.Getenv(envVar); value != \"\" {\n\t\t\tvar id int64\n\t\t\t_, err := fmt.Sscanf(value, \"%d\", &id)\n\t\t\tif err == nil && id >= 0 && id <= maxWorkerID {\n\t\t\t\treturn id, true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn 0, false\n}\n\n// fromIP 基于本机IP地址生成 WorkerID\n// 优先使用非回环的IPv4地址\nfunc (w *WorkerIDGenerator) fromIP() (int64, bool) {\n\taddrs, err := net.InterfaceAddrs()\n\tif err != nil {\n\t\treturn 0, false\n\t}\n\n\tfor _, addr := range addrs {\n\t\tif ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {\n\t\t\tif ipv4 := ipnet.IP.To4(); ipv4 != nil {\n\t\t\t\t// 使用IP地址的后两个字节\n\t\t\t\t// 例如: 192.168.1.100 -> (1 << 8) + 100 = 356\n\t\t\t\tid := int64(ipv4[2])<<8 | int64(ipv4[3])\n\t\t\t\treturn id & maxWorkerID, true // 确保在0-1023范围内\n\t\t\t}\n\t\t}\n\t}\n\n\treturn 0, false\n}\n\n// fromMAC 基于MAC地址生成 WorkerID\nfunc (w *WorkerIDGenerator) fromMAC() (int64, bool) {\n\tinterfaces, err := net.Interfaces()\n\tif err != nil {\n\t\treturn 0, false\n\t}\n\n\tfor _, iface := range interfaces {\n\t\t// 跳过回环接口和没有MAC地址的接口\n\t\tif iface.Flags&net.FlagLoopback != 0 || len(iface.HardwareAddr) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\t// 使用MAC地址的后两个字节\n\t\tmac := iface.HardwareAddr\n\t\tif len(mac) >= 6 {\n\t\t\tid := int64(mac[4])<<8 | int64(mac[5])\n\t\t\treturn id & maxWorkerID, true\n\t\t}\n\t}\n\n\treturn 0, false\n}\n\n// fromHostname 基于主机名生成 WorkerID\nfunc (w *WorkerIDGenerator) fromHostname() (int64, bool) {\n\thostname, err := os.Hostname()\n\tif err != nil || hostname == \"\" {\n\t\treturn 0, false\n\t}\n\n\t// 使用MD5哈希主机名，取前8字节转换为int64\n\thash := md5.Sum([]byte(hostname))\n\tid := int64(binary.BigEndian.Uint64(hash[:8]))\n\treturn (id & maxWorkerID), true\n}\n\n// GetMachineInfo 获取机器信息用于调试\nfunc (w *WorkerIDGenerator) GetMachineInfo() map[string]string {\n\tinfo := make(map[string]string)\n\n\t// 主机名\n\tif hostname, err := os.Hostname(); err == nil {\n\t\tinfo[\"hostname\"] = hostname\n\t}\n\n\t// IP地址\n\tif ips := w.getIPAddresses(); len(ips) > 0 {\n\t\tinfo[\"ips\"] = strings.Join(ips, \", \")\n\t}\n\n\t// MAC地址\n\tif macs := w.getMACAddresses(); len(macs) > 0 {\n\t\tinfo[\"macs\"] = strings.Join(macs, \", \")\n\t}\n\n\t// 环境变量\n\tenvVars := []string{\"WORKER_ID\", \"MACHINE_ID\", \"NODE_ID\", \"POD_ID\"}\n\tfor _, envVar := range envVars {\n\t\tif value := os.Getenv(envVar); value != \"\" {\n\t\t\tinfo[envVar] = value\n\t\t}\n\t}\n\n\treturn info\n}\n\n// getIPAddresses 获取所有非回环的IPv4地址\nfunc (w *WorkerIDGenerator) getIPAddresses() []string {\n\tvar ips []string\n\taddrs, err := net.InterfaceAddrs()\n\tif err != nil {\n\t\treturn ips\n\t}\n\n\tfor _, addr := range addrs {\n\t\tif ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {\n\t\t\tif ipv4 := ipnet.IP.To4(); ipv4 != nil {\n\t\t\t\tips = append(ips, ipv4.String())\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ips\n}\n\n// getMACAddresses 获取所有网络接口的MAC地址\nfunc (w *WorkerIDGenerator) getMACAddresses() []string {\n\tvar macs []string\n\tinterfaces, err := net.Interfaces()\n\tif err != nil {\n\t\treturn macs\n\t}\n\n\tfor _, iface := range interfaces {\n\t\tif iface.Flags&net.FlagLoopback == 0 && len(iface.HardwareAddr) > 0 {\n\t\t\tmacs = append(macs, iface.HardwareAddr.String())\n\t\t}\n\t}\n\n\treturn macs\n}\n\n// GenerateFromIP 根据指定IP地址生成 WorkerID\nfunc GenerateFromIP(ip string) (int64, error) {\n\tparsedIP := net.ParseIP(ip)\n\tif parsedIP == nil {\n\t\treturn 0, fmt.Errorf(\"invalid IP address: %s\", ip)\n\t}\n\n\tipv4 := parsedIP.To4()\n\tif ipv4 == nil {\n\t\treturn 0, fmt.Errorf(\"only IPv4 addresses are supported\")\n\t}\n\n\t// 使用IP的后两个字节\n\tid := int64(ipv4[2])<<8 | int64(ipv4[3])\n\treturn id & maxWorkerID, nil\n}\n\n// GenerateFromMAC 根据指定MAC地址生成 WorkerID\nfunc GenerateFromMAC(mac string) (int64, error) {\n\thwAddr, err := net.ParseMAC(mac)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"invalid MAC address: %s\", mac)\n\t}\n\n\tif len(hwAddr) < 6 {\n\t\treturn 0, fmt.Errorf(\"MAC address too short\")\n\t}\n\n\t// 使用MAC地址的后两个字节\n\tid := int64(hwAddr[4])<<8 | int64(hwAddr[5])\n\treturn id & maxWorkerID, nil\n}\n\n// GenerateFromString 根据任意字符串生成 WorkerID\nfunc GenerateFromString(s string) int64 {\n\thash := md5.Sum([]byte(s))\n\tid := int64(binary.BigEndian.Uint64(hash[:8]))\n\treturn id & maxWorkerID\n}\n\n// AutoGenerator 自动生成并创建 Generator\n// 这是一个便捷函数，结合了 WorkerID 生成和 Generator 创建\nfunc AutoGenerator() (*Generator, error) {\n\twg := NewWorkerIDGenerator()\n\tworkerID, err := wg.GenerateWorkerID()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to generate worker ID: %w\", err)\n\t}\n\n\tgen, err := NewGenerator(workerID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create generator with worker ID %d: %w\", workerID, err)\n\t}\n\n\treturn gen, nil\n}\n\n// MustAutoGenerator 自动生成并创建 Generator，失败则 panic\nfunc MustAutoGenerator() *Generator {\n\tgen, err := AutoGenerator()\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to auto-generate: %v\", err))\n\t}\n\treturn gen\n}\n"
  },
  {
    "path": "go/idgen/wk_id_gen_test.go",
    "content": "package idgen\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\n// TestGenerateWorkerID 测试自动生成 WorkerID\nfunc TestGenerateWorkerID(t *testing.T) {\n\twg := NewWorkerIDGenerator()\n\tworkerID, err := wg.GenerateWorkerID()\n\n\tif err != nil {\n\t\tt.Fatalf(\"GenerateWorkerID() error: %v\", err)\n\t}\n\n\tif workerID < 0 || workerID > maxWorkerID {\n\t\tt.Errorf(\"WorkerID out of range: %d, expected 0-%d\", workerID, maxWorkerID)\n\t}\n\n\tt.Logf(\"Generated WorkerID: %d\", workerID)\n}\n\n// TestFromEnv 测试从环境变量生成\nfunc TestFromEnv(t *testing.T) {\n\ttests := []struct {\n\t\tname     string\n\t\tenvVar   string\n\t\tenvValue string\n\t\twant     int64\n\t\twantOK   bool\n\t}{\n\t\t{\"valid WORKER_ID\", \"WORKER_ID\", \"42\", 42, true},\n\t\t{\"valid MACHINE_ID\", \"MACHINE_ID\", \"100\", 100, true},\n\t\t{\"valid NODE_ID\", \"NODE_ID\", \"1023\", 1023, true},\n\t\t{\"invalid value\", \"WORKER_ID\", \"abc\", 0, false},\n\t\t{\"out of range\", \"WORKER_ID\", \"2000\", 0, false},\n\t\t{\"negative value\", \"WORKER_ID\", \"-1\", 0, false},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\t// 设置环境变量\n\t\t\tos.Setenv(tt.envVar, tt.envValue)\n\t\t\tdefer os.Unsetenv(tt.envVar)\n\n\t\t\twg := NewWorkerIDGenerator()\n\t\t\tgot, ok := wg.fromEnv()\n\n\t\t\tif ok != tt.wantOK {\n\t\t\t\tt.Errorf(\"fromEnv() ok = %v, want %v\", ok, tt.wantOK)\n\t\t\t}\n\n\t\t\tif ok && got != tt.want {\n\t\t\t\tt.Errorf(\"fromEnv() = %d, want %d\", got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}\n\n// TestGenerateFromIP 测试从IP生成\nfunc TestGenerateFromIP(t *testing.T) {\n\ttests := []struct {\n\t\tname    string\n\t\tip      string\n\t\twantErr bool\n\t}{\n\t\t{\"valid IPv4\", \"192.168.1.100\", false},\n\t\t{\"valid IPv4 2\", \"10.0.0.50\", false},\n\t\t{\"valid IPv4 3\", \"172.16.5.200\", false},\n\t\t{\"invalid IP\", \"256.1.1.1\", true},\n\t\t{\"invalid format\", \"not-an-ip\", true},\n\t\t{\"IPv6 not supported\", \"2001:0db8::1\", true},\n\t\t{\"empty string\", \"\", true},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tworkerID, err := GenerateFromIP(tt.ip)\n\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"GenerateFromIP() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif err == nil {\n\t\t\t\tif workerID < 0 || workerID > maxWorkerID {\n\t\t\t\t\tt.Errorf(\"WorkerID out of range: %d\", workerID)\n\t\t\t\t}\n\t\t\t\tt.Logf(\"IP %s -> WorkerID: %d\", tt.ip, workerID)\n\t\t\t}\n\t\t})\n\t}\n}\n\n// TestGenerateFromMAC 测试从MAC地址生成\nfunc TestGenerateFromMAC(t *testing.T) {\n\ttests := []struct {\n\t\tname    string\n\t\tmac     string\n\t\twantErr bool\n\t}{\n\t\t{\"valid MAC\", \"00:1A:2B:3C:4D:5E\", false},\n\t\t{\"valid MAC 2\", \"AA:BB:CC:DD:EE:FF\", false},\n\t\t{\"valid MAC hyphen\", \"00-1A-2B-3C-4D-5E\", false},\n\t\t{\"invalid MAC\", \"not-a-mac\", true},\n\t\t{\"invalid format\", \"00:1A:2B:3C\", true},\n\t\t{\"empty string\", \"\", true},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tworkerID, err := GenerateFromMAC(tt.mac)\n\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"GenerateFromMAC() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif err == nil {\n\t\t\t\tif workerID < 0 || workerID > maxWorkerID {\n\t\t\t\t\tt.Errorf(\"WorkerID out of range: %d\", workerID)\n\t\t\t\t}\n\t\t\t\tt.Logf(\"MAC %s -> WorkerID: %d\", tt.mac, workerID)\n\t\t\t}\n\t\t})\n\t}\n}\n\n// TestGenerateFromString 测试从字符串生成\nfunc TestGenerateFromString(t *testing.T) {\n\ttests := []string{\n\t\t\"web-server-1\",\n\t\t\"api-gateway-node-3\",\n\t\t\"database-replica-5\",\n\t\t\"my-app-pod-abc123\",\n\t\t\"\",\n\t\t\"very-long-string-with-many-characters-to-test-hashing\",\n\t}\n\n\tfor _, s := range tests {\n\t\tt.Run(s, func(t *testing.T) {\n\t\t\tworkerID := GenerateFromString(s)\n\n\t\t\tif workerID < 0 || workerID > maxWorkerID {\n\t\t\t\tt.Errorf(\"WorkerID out of range: %d\", workerID)\n\t\t\t}\n\n\t\t\tt.Logf(\"String '%s' -> WorkerID: %d\", s, workerID)\n\t\t})\n\t}\n}\n\n// TestGenerateFromStringConsistency 测试字符串生成的一致性\nfunc TestGenerateFromStringConsistency(t *testing.T) {\n\ttestString := \"test-pod-123\"\n\n\t// 多次生成应该返回相同的 WorkerID\n\tfirst := GenerateFromString(testString)\n\tfor i := 0; i < 100; i++ {\n\t\tid := GenerateFromString(testString)\n\t\tif id != first {\n\t\t\tt.Errorf(\"Inconsistent WorkerID: first=%d, iteration %d=%d\", first, i, id)\n\t\t}\n\t}\n\n\tt.Logf(\"Consistent WorkerID for '%s': %d\", testString, first)\n}\n\n// TestGenerateFromStringUniqueness 测试不同字符串生成不同的 WorkerID\nfunc TestGenerateFromStringUniqueness(t *testing.T) {\n\tstrings := []string{\n\t\t\"pod-1\", \"pod-2\", \"pod-3\", \"pod-4\", \"pod-5\",\n\t\t\"node-a\", \"node-b\", \"node-c\", \"node-d\", \"node-e\",\n\t}\n\n\tseen := make(map[int64]string)\n\tcollisions := 0\n\n\tfor _, s := range strings {\n\t\tid := GenerateFromString(s)\n\t\tif existing, exists := seen[id]; exists {\n\t\t\tcollisions++\n\t\t\tt.Logf(\"Collision: '%s' and '%s' both generate WorkerID %d\", s, existing, id)\n\t\t} else {\n\t\t\tseen[id] = s\n\t\t}\n\t}\n\n\tt.Logf(\"Generated %d WorkerIDs from %d strings, %d collisions\",\n\t\tlen(seen), len(strings), collisions)\n\n\t// 碰撞率应该很低（对于10个字符串，期望0-1个碰撞）\n\tif collisions > 2 {\n\t\tt.Errorf(\"Too many collisions: %d\", collisions)\n\t}\n}\n\n// TestAutoGenerator 测试自动生成器\nfunc TestAutoGenerator(t *testing.T) {\n\tgen, err := AutoGenerator()\n\tif err != nil {\n\t\tt.Fatalf(\"AutoGenerator() error: %v\", err)\n\t}\n\n\tif gen == nil {\n\t\tt.Fatal(\"AutoGenerator() returned nil\")\n\t}\n\n\t// 测试生成ID\n\tid, err := gen.NextID()\n\tif err != nil {\n\t\tt.Errorf(\"NextID() error: %v\", err)\n\t}\n\n\tif id == 0 {\n\t\tt.Error(\"NextID() returned 0\")\n\t}\n\n\tt.Logf(\"AutoGenerator created successfully, generated ID: %d\", id)\n}\n\n// TestMustAutoGenerator 测试 MustAutoGenerator\nfunc TestMustAutoGenerator(t *testing.T) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tt.Errorf(\"MustAutoGenerator() should not panic, got: %v\", r)\n\t\t}\n\t}()\n\n\tgen := MustAutoGenerator()\n\tif gen == nil {\n\t\tt.Fatal(\"MustAutoGenerator() returned nil\")\n\t}\n\n\tid := gen.MustNextID()\n\tif id == 0 {\n\t\tt.Error(\"MustNextID() returned 0\")\n\t}\n\n\tt.Logf(\"MustAutoGenerator created successfully, generated ID: %d\", id)\n}\n\n// TestGetMachineInfo 测试获取机器信息\nfunc TestGetMachineInfo(t *testing.T) {\n\twg := NewWorkerIDGenerator()\n\tinfo := wg.GetMachineInfo()\n\n\tif len(info) == 0 {\n\t\tt.Error(\"GetMachineInfo() returned empty map\")\n\t}\n\n\tt.Log(\"Machine Info:\")\n\tfor key, value := range info {\n\t\tt.Logf(\"  %s: %s\", key, value)\n\t}\n}\n\n// TestWorkerIDRange 测试所有生成方法都返回有效范围的 WorkerID\nfunc TestWorkerIDRange(t *testing.T) {\n\twg := NewWorkerIDGenerator()\n\n\t// 测试自动生成\n\tif id, err := wg.GenerateWorkerID(); err == nil {\n\t\tif id < 0 || id > maxWorkerID {\n\t\t\tt.Errorf(\"GenerateWorkerID() = %d, out of range [0, %d]\", id, maxWorkerID)\n\t\t}\n\t}\n\n\t// 测试从字符串生成\n\tfor i := 0; i < 100; i++ {\n\t\tid := GenerateFromString(string(rune(i)))\n\t\tif id < 0 || id > maxWorkerID {\n\t\t\tt.Errorf(\"GenerateFromString() = %d, out of range [0, %d]\", id, maxWorkerID)\n\t\t}\n\t}\n}\n\n// TestEnvironmentPriority 测试环境变量优先级\nfunc TestEnvironmentPriority(t *testing.T) {\n\t// 设置环境变量\n\tos.Setenv(\"WORKER_ID\", \"999\")\n\tdefer os.Unsetenv(\"WORKER_ID\")\n\n\twg := NewWorkerIDGenerator()\n\tworkerID, err := wg.GenerateWorkerID()\n\n\tif err != nil {\n\t\tt.Fatalf(\"GenerateWorkerID() error: %v\", err)\n\t}\n\n\t// 应该使用环境变量的值\n\tif workerID != 999 {\n\t\tt.Errorf(\"Expected WorkerID from env (999), got %d\", workerID)\n\t}\n\n\tt.Logf(\"Environment variable correctly prioritized: %d\", workerID)\n}\n\n// BenchmarkGenerateWorkerID 基准测试：自动生成\nfunc BenchmarkGenerateWorkerID(b *testing.B) {\n\twg := NewWorkerIDGenerator()\n\tb.ResetTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\twg.GenerateWorkerID()\n\t}\n}\n\n// BenchmarkGenerateFromString 基准测试：从字符串生成\nfunc BenchmarkGenerateFromString(b *testing.B) {\n\ttestString := \"my-pod-name-123\"\n\tb.ResetTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tGenerateFromString(testString)\n\t}\n}\n\n// BenchmarkGenerateFromIP 基准测试：从IP生成\nfunc BenchmarkGenerateFromIP(b *testing.B) {\n\ttestIP := \"192.168.1.100\"\n\tb.ResetTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tGenerateFromIP(testIP)\n\t}\n}\n\n// BenchmarkAutoGenerator 基准测试：自动生成器\nfunc BenchmarkAutoGenerator(b *testing.B) {\n\tb.ResetTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\tAutoGenerator()\n\t}\n}\n"
  },
  {
    "path": "go/io/copy.go",
    "content": "/*\nMIT License\n\nCopyright (c) 2020 kay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\npackage io\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n)\n\n// Mode indicates whether to use hardlink or copy content\ntype Mode int\n\nconst (\n\t// Content creates a new file, and copies the content of the file\n\tContent Mode = iota\n\t// Hardlink creates a new hardlink to the existing file\n\tHardlink\n)\n\nfunc CopyAll(src, dst string) (err error) {\n\tisDir, err := os_.IsDir(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif isDir {\n\t\treturn CopyDir(src, dst, Content)\n\t}\n\n\treturn CopyFile(src, dst)\n}\n\nfunc CopyDir(srcDir, dstDir string, copyMode Mode) (err error) {\n\treturn filepath.Walk(srcDir, func(srcPath string, f os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Rebase path\n\t\trelPath, err := filepath.Rel(srcDir, srcPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdstPath := filepath.Join(dstDir, relPath)\n\n\t\treturn CopyPath(srcPath, dstPath, f, copyMode)\n\t})\n}\n\nfunc CopyRegular(srcPath, dstPath string, fileInfo os.FileInfo) error {\n\tsrcFile, err := os.Open(srcPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer srcFile.Close()\n\n\t// If the destination file already exists, we shouldn't blow it away\n\tdstFile, err := os.OpenFile(dstPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, fileInfo.Mode())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer dstFile.Close()\n\n\tif err = doCopyWithFileClone(srcFile, dstFile); err == nil {\n\t\treturn nil\n\t}\n\n\tif err = doCopyWithFileRange(srcFile, dstFile, fileInfo); err == nil {\n\t\treturn nil\n\t}\n\n\treturn legacyCopy(srcFile, dstFile)\n}\n\nfunc legacyCopy(srcFile io.Reader, dstFile io.Writer) error {\n\t_, err := io.Copy(dstFile, srcFile)\n\n\treturn err\n}\n\nfunc CopyFile(src, dst string) (err error) {\n\tsrcAbs, err := filepath.Abs(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdstAbs, err := filepath.Abs(dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// open source file\n\tsfi, err := os.Stat(srcAbs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !sfi.Mode().IsRegular() {\n\t\treturn fmt.Errorf(\n\t\t\t\"CopyFile: non-regular source file %s (%q)\",\n\t\t\tsfi.Name(),\n\t\t\tsfi.Mode().String(),\n\t\t)\n\t}\n\n\t// open dest file\n\tdfi, err := os.Stat(dstAbs)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn\n\t\t}\n\n\t\t// file doesn't exist\n\t\terr := os.MkdirAll(filepath.Dir(dst), 0755)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t} else {\n\n\t\tif dfi.Mode().IsRegular() {\n\t\t\tif os.SameFile(sfi, dfi) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t} else if dfi.Mode().IsDir() {\n\t\t\t// dst path is exist and dst is dir, so copy file to dst dir\n\t\t\t// src: src/1.jpg  dst: dst/dir/ => dst/dir/1.jpg\n\t\t\tdst = filepath.Join(dst, filepath.Base(src))\n\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"CopyFile: non-regular destination file %s (%q)\", dfi.Name(), dfi.Mode().String())\n\t\t}\n\t}\n\n\treturn copyFileContents(src, dst)\n}\n\n//copyFileContentes copies the contents of the file named src to the file named dst\n//The destination file will be created if it does not alreay exist. If the destination\n//file exists, all it's contents will be replaced by the contents of the source file\nfunc copyFileContents(src, dst string) (err error) {\n\tsrcFile, err := os.Open(src)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer srcFile.Close()\n\n\tdstFile, err := os.Create(dst)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tdefer func() {\n\t\tcerr := dstFile.Close()\n\t\tif err == nil {\n\t\t\terr = cerr\n\t\t}\n\t}()\n\n\tif _, err = io.Copy(dstFile, srcFile); err != nil {\n\t\treturn\n\t}\n\n\terr = dstFile.Sync()\n\treturn\n}\n"
  },
  {
    "path": "go/io/copy_darwin.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage io\n\nimport \"os\"\n\nfunc CopyPath(srcPath, dstPath string, f os.FileInfo, copyMode Mode) error {\n\treturn nil\n}\n\nfunc doCopyWithFileClone(srcFile, dstFile *os.File) error {\n\treturn nil\n}\n\nfunc doCopyWithFileRange(srcFile, dstFile *os.File, fileinfo os.FileInfo) error {\n\treturn nil\n}\n"
  },
  {
    "path": "go/io/copy_linux.go",
    "content": "/*\nMIT License\n\nCopyright (c) 2020 kay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\npackage io\n\nimport (\n\t\"fmt\"\n\t\"golang.org/x/sys/unix\"\n\t\"os\"\n\t\"syscall\"\n)\n\nfunc CopyPath(srcPath, dstPath string, f os.FileInfo, copyMode Mode) error {\n\tstat, ok := f.Sys().(*syscall.Stat_t)\n\tif !ok {\n\t\treturn fmt.Errorf(\"Unable to get raw syscall.Stat_t data for %s\", srcPath)\n\t}\n\n\tisHardlink := false\n\n\tswitch mode := f.Mode(); {\n\tcase mode.IsRegular():\n\t\tif copyMode == Hardlink {\n\t\t\tisHardlink = true\n\t\t\tif err := os.Link(srcPath, dstPath); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tif err := CopyRegular(srcPath, dstPath, f); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\tcase mode.IsDir():\n\t\tif err := os.Mkdir(dstPath, f.Mode()); err != nil && !os.IsExist(err) {\n\t\t\treturn err\n\t\t}\n\tcase mode&os.ModeSymlink != 0:\n\t\tlink, err := os.Readlink(srcPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := os.Symlink(link, dstPath); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase mode&os.ModeNamedPipe != 0:\n\t\tfallthrough\n\n\tcase mode&os.ModeSocket != 0:\n\t\tif err := unix.Mkfifo(dstPath, uint32(stat.Mode)); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase mode&os.ModeDevice != 0:\n\t\tif err := unix.Mknod(dstPath, uint32(stat.Mode), int(stat.Rdev)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown file type (%d / %s) for %s\", f.Mode(), f.Mode().String(), srcPath)\n\n\t}\n\n\t// Everything below is copying metadata from src to dst. All this metadata\n\t// already shares an inode for hardlinks.\n\tif isHardlink {\n\t\treturn nil\n\t}\n\n\tif err := os.Lchown(dstPath, int(stat.Uid), int(stat.Gid)); err != nil {\n\t\treturn err\n\t}\n\n\tisSymlink := f.Mode()&os.ModeSymlink != 0\n\t// There is no LChmod, so ignore mode for symlink. Also, this\n\t// must happen after chown, as that can modify the file mode\n\tif !isSymlink {\n\t\tif err := os.Chmod(dstPath, f.Mode()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc doCopyWithFileClone(srcFile, dstFile *os.File) error {\n\treturn unix.IoctlFileClone(int(dstFile.Fd()), int(srcFile.Fd()))\n}\n\nfunc doCopyWithFileRange(srcFile, dstFile *os.File, fileinfo os.FileInfo) error {\n\tamountLeftToCopy := fileinfo.Size()\n\n\tfor amountLeftToCopy > 0 {\n\t\tn, err := unix.CopyFileRange(int(srcFile.Fd()), nil, int(dstFile.Fd()), nil, int(amountLeftToCopy), 0)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tamountLeftToCopy = amountLeftToCopy - int64(n)\n\t}\n\n\treturn nil\n\n}\n"
  },
  {
    "path": "go/io/copy_test.go",
    "content": "/*\nMIT License\n\nCopyright (c) 2020 kay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\npackage io_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"math/rand\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/kaydxh/golang/go/io\"\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\t\"gotest.tools/v3/assert\"\n)\n\nfunc TestCopyDir(t *testing.T) {\n\tsrcDir, err := ioutil.TempDir(\"\", \"srcDir\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tpopulateSrcDir(t, srcDir, 3)\n\n\tdstDir, err := ioutil.TempDir(\"\", \"dstDir\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tdefer os.RemoveAll(dstDir)\n\n\terr = io.CopyDir(srcDir, dstDir, io.Content)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\terr = filepath.Walk(srcDir, func(srcPath string, f os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Rebase path\n\t\trelPath, err := filepath.Rel(srcDir, srcPath)\n\t\tassert.NilError(t, err)\n\t\tif relPath == \".\" {\n\t\t\treturn nil\n\t\t}\n\n\t\tdstPath := filepath.Join(dstDir, relPath)\n\t\t// If we add non-regular dirs and files to the test\n\t\t// then we need to add more checks here.\n\t\tdstFileInfo, err := os.Lstat(dstPath)\n\t\tassert.NilError(t, err)\n\n\t\tfmt.Println(\"dstFileInfo: \", dstFileInfo)\n\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n}\n\nfunc TestCopyFile(t *testing.T) {\n\tdir, err := ioutil.TempDir(\"\", \"file-copy-check\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tdefer os.RemoveAll(dir)\n\n\tsrcFilename := filepath.Join(dir, \"srcFilename\")\n\tdstFilename := filepath.Join(dir, \"dstilename\")\n\tfmt.Println(\"srcFilename: , dstFilename: \", srcFilename, dstFilename)\n\n\tbuf := []byte(\"hello world\")\n\terr = ioutil.WriteFile(srcFilename, buf, 0777)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\terr = io.CopyFile(srcFilename, dstFilename)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\treadBuf, err := ioutil.ReadFile(srcFilename)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tfmt.Println(\"srcFilename content: \", string(readBuf))\n\n\treadBuf, err = ioutil.ReadFile(dstFilename)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tfmt.Println(\"dstFilename content: \", string(readBuf))\n\n\tif !bytes.Equal(buf, readBuf) {\n\t\tt.Errorf(\"expect true, got %v\", false)\n\t}\n}\n\nfunc TestCopyAll(t *testing.T) {\n\ttestCases := []struct {\n\t\tsrc string\n\t\tdst string\n\t}{\n\t\t{\n\t\t\tsrc: \"./testdata/file/1.txt\",\n\t\t\tdst: \"./testdata.copy/file\",\n\t\t},\n\t\t/*\n\t\t\t{\n\t\t\t\tsrc: \"./testdata/dir\",\n\t\t\t\tdst: \"./testdata.copy/dir\",\n\t\t\t},\n\t\t*/\n\t}\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"test-%d\", i), func(t *testing.T) {\n\t\t\terr := io_.CopyAll(testCase.src, testCase.dst)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"copy all expected nil, got %v\", err)\n\t\t\t}\n\t\t})\n\t}\n\n}\n\nfunc randomMode(baseMode int) os.FileMode {\n\tfor i := 0; i < 7; i++ {\n\t\tbaseMode = baseMode | (1&rand.Intn(2))<<uint(i)\n\t}\n\treturn os.FileMode(baseMode)\n}\n\nfunc populateSrcDir(t *testing.T, srcDir string, remainingDepth int) {\n\tif remainingDepth == 0 {\n\t\treturn\n\t}\n\n\tfor i := 0; i < 10; i++ {\n\t\tdirName := filepath.Join(srcDir, fmt.Sprintf(\"srcdir-%d\", i))\n\t\t// Owner all bits set\n\t\tassert.NilError(t, os.Mkdir(dirName, randomMode(0700)))\n\t\tpopulateSrcDir(t, dirName, remainingDepth-1)\n\t}\n\n\tfor i := 0; i < 10; i++ {\n\t\tfileName := filepath.Join(srcDir, fmt.Sprintf(\"srcfile-%d\", i))\n\t\t// Owner read bit set\n\t\tassert.NilError(t, ioutil.WriteFile(fileName, []byte{}, randomMode(0400)))\n\t}\n\n}\n"
  },
  {
    "path": "go/io/io.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage io\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n)\n\n// ReadFileLines read line from file divide with \\n\nfunc ReadFileLines(filepath string) ([]string, error) {\n\tfile, err := os_.OpenAll(filepath, os.O_RDONLY, 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tvar lines []string\n\tscanner := bufio.NewScanner(file)\n\tscanner.Split(bufio.ScanLines)\n\tfor scanner.Scan() {\n\t\tlines = append(lines, scanner.Text())\n\t}\n\n\treturn lines, nil\n}\n\n// ReadLines read line from byteArray divide with \\n\nfunc ReadLines(byteArray []byte) []string {\n\tvar lines []string\n\tindex := 0\n\treadIndex := 0\n\tfor ; readIndex < len(byteArray); index++ {\n\t\tline, n := ReadLineAt(readIndex, byteArray)\n\t\treadIndex = n\n\n\t\tlines = append(lines, string(line))\n\t}\n\n\treturn lines\n}\n\nfunc ReadLineAt(readIndex int, byteArray []byte) ([]byte, int) {\n\tcurrentReadIndex := readIndex\n\n\t// consume left spaces\n\tfor currentReadIndex < len(byteArray) {\n\t\tif byteArray[currentReadIndex] == ' ' {\n\t\t\tcurrentReadIndex++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// leftTrimIndex stores the left index of the line after the line is left-trimmed\n\tleftTrimIndex := currentReadIndex\n\n\t// rightTrimIndex stores the right index of the line after the line is right-trimmed\n\t// it is set to -1 since the correct value has not yet been determined.\n\trightTrimIndex := -1\n\n\tfor ; currentReadIndex < len(byteArray); currentReadIndex++ {\n\t\tif byteArray[currentReadIndex] == ' ' {\n\t\t\t// set rightTrimIndex\n\t\t\tif rightTrimIndex == -1 {\n\t\t\t\trightTrimIndex = currentReadIndex\n\t\t\t}\n\t\t} else if (byteArray[currentReadIndex] == '\\n') || (currentReadIndex == (len(byteArray) - 1)) {\n\t\t\t// end of line or byte buffer is reached\n\t\t\tif currentReadIndex <= leftTrimIndex {\n\t\t\t\treturn nil, currentReadIndex + 1\n\t\t\t}\n\t\t\t// set the rightTrimIndex\n\t\t\tif rightTrimIndex == -1 {\n\t\t\t\trightTrimIndex = currentReadIndex\n\t\t\t\tif currentReadIndex == (len(byteArray)-1) && (byteArray[currentReadIndex] != '\\n') {\n\t\t\t\t\t// ensure that the last character is part of the returned string,\n\t\t\t\t\t// unless the last character is '\\n'\n\t\t\t\t\trightTrimIndex = currentReadIndex + 1\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Avoid unnecessary allocation.\n\t\t\treturn byteArray[leftTrimIndex:rightTrimIndex], currentReadIndex + 1\n\t\t} else {\n\t\t\t// unset rightTrimIndex\n\t\t\trightTrimIndex = -1\n\t\t}\n\t}\n\n\treturn nil, currentReadIndex\n}\n\n//ReadFile read data from file\nfunc ReadFile(filePath string) ([]byte, error) {\n\tdata, err := ioutil.ReadFile(filePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn data, err\n}\n\nfunc WriteFile(filePath string, content []byte, appended bool) error {\n\tfile, err := os_.OpenFile(filePath, appended)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tbuf := bufio.NewWriter(file)\n\t_, err = buf.Write(content)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := buf.Flush(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// WriteLine join all line to file.\nfunc WriteFileLines(filePath string, lines []string, appended bool) (err error) {\n\n\tfile, err := os_.OpenFile(filePath, appended)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tbuf := bufio.NewWriter(file)\n\tfor i := range lines {\n\t\tif _, err = buf.WriteString(lines[i] + \"\\n\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := buf.Flush(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// WriteLine join all words with spaces, terminate with newline and\n// write to file.\nfunc WriteFileLine(filePath string, words []string, appended bool) (err error) {\n\tfile, err := os_.OpenFile(filePath, appended)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tbuf := bytes.NewBuffer(nil)\n\terr = WriteLine(buf, words...)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = file.Write(buf.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// WriteLine join all words with spaces, terminate with newline and write to buff.\nfunc WriteLine(buf *bytes.Buffer, words ...string) error {\n\t// We avoid strings.Join for performance reasons.\n\tfor i := range words {\n\t\t_, err := buf.WriteString(words[i])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif i < len(words)-1 {\n\t\t\terr = buf.WriteByte(' ')\n\t\t} else {\n\t\t\terr = buf.WriteByte('\\n')\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\treturn nil\n}\n\n// WriteBytesLine write bytes to buffer, terminate with newline\nfunc WriteBytesLine(buf *bytes.Buffer, bytes []byte) error {\n\t_, err := buf.Write(bytes)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = buf.WriteByte('\\n')\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc WriteBytesAt(filepath string, bytes []byte, offset int64) error {\n\tfile, err := os_.OpenAll(filepath, os.O_CREATE|os.O_RDWR, os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tn, err := file.Seek(offset, io.SeekStart)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = file.WriteAt(bytes, n)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc WriteReader(filepath string, r io.Reader) error {\n\tfile, err := os_.OpenAll(filepath, os.O_CREATE|os.O_RDWR, os.ModePerm)\n\t//\tfile, err := os_.OpenFile(filepath, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\t_, err = io.Copy(file, r)\n\treturn err\n}\n\nfunc WriteReaderAt(filepath string, r io.Reader, offset, length int64) error {\n\tfile, err := os_.OpenAll(filepath, os.O_CREATE|os.O_RDWR, os.ModePerm)\n\t//\tfile, err := os_.OpenFile(filepath, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tbuf := make([]byte, 1024)\n\tvar total int64\n\n\tfor total < length {\n\t\tnr, err := r.Read(buf)\n\t\tif err == nil || err == io.EOF {\n\t\t\tif nr > 0 {\n\t\t\t\tn, err := file.Seek(offset, io.SeekStart)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t_, err = file.WriteAt(buf[:nr], n)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\toffset += int64(nr)\n\t\t\t\ttotal += int64(nr)\n\t\t\t}\n\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "go/io/io_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage io_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\n\tmd5_ \"github.com/kaydxh/golang/go/crypto/md5\"\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestWriteFile(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\twords    []byte\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"./tmp/1.txt\",\n\t\t\twords:    []byte(\"hello world\"),\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\terr := io_.WriteFile(testCase.name, testCase.words, false)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to write file: %v, got : %s\", testCase.name, err)\n\n\t\t\t}\n\n\t\t})\n\t}\n}\n\nfunc TestWriteReadLine(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\twords    []string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"write no word\",\n\t\t\twords:    []string{},\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []string{\"test1\"},\n\t\t\texpected: \"test1\\n\",\n\t\t},\n\n\t\t{\n\t\t\tname:     \"write multi words\",\n\t\t\twords:    []string{\"test1\", \"test2\", \"test3\"},\n\t\t\texpected: \"test1 test2 test3\\n\",\n\t\t},\n\t}\n\n\ttestBuffer := bytes.NewBuffer(nil)\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\ttestBuffer.Reset()\n\t\t\tio_.WriteLine(testBuffer, testCase.words...)\n\t\t\tif !strings.EqualFold(testBuffer.String(), testCase.expected) {\n\t\t\t\tt.Fatalf(\n\t\t\t\t\t\"write word is %v\\n expected: %s, got: %s\",\n\t\t\t\t\ttestCase.words,\n\t\t\t\t\ttestCase.expected,\n\t\t\t\t\ttestBuffer.String(),\n\t\t\t\t)\n\n\t\t\t}\n\t\t})\n\t}\n\n\tlines := io_.ReadLines(testBuffer.Bytes())\n\tassert.Equal(t, \"test1 test2 test3\", lines[0])\n\n}\n\nfunc TestWriteReadFileLine(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\twords    []string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"write no word\",\n\t\t\twords:    []string{},\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []string{\"test1\"},\n\t\t\texpected: \"test1\\n\",\n\t\t},\n\n\t\t{\n\t\t\tname:     \"write multi words\",\n\t\t\twords:    []string{\"test1\", \"test2\", \"test3\"},\n\t\t\texpected: \"test1 test2 test3\\n\",\n\t\t},\n\t}\n\n\tworkDir, _ := os_.Getwd()\n\ttestFileNew := filepath.Join(workDir, \"test-file-new\")\n\ttestFileAppend := filepath.Join(workDir, \"test-file-append\")\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\terr := io_.WriteFileLine(testFileNew, testCase.words, false)\n\t\t\tassert.Nil(t, err)\n\t\t\terr = io_.WriteFileLine(testFileAppend, testCase.words, true)\n\t\t\tassert.Nil(t, err)\n\t\t\t/*\n\t\t\t\tif !strings.EqualFold(testBuffer.String(), testCase.expected) {\n\t\t\t\t\tt.Fatalf(\n\t\t\t\t\t\t\"write word is %v\\n expected: %s, got: %s\",\n\t\t\t\t\t\ttestCase.words,\n\t\t\t\t\t\ttestCase.expected,\n\t\t\t\t\t\ttestBuffer.String(),\n\t\t\t\t\t)\n\n\t\t\t\t}\n\t\t\t*/\n\t\t})\n\t}\n\n\tlines, err := io_.ReadFileLines(testFileAppend)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tfmt.Println(\"read lines:\", lines)\n}\n\nfunc TestWriteFileLines(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\twords    []string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"write no word\",\n\t\t\twords:    []string{},\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []string{\"test1\"},\n\t\t\texpected: \"test1\\n\",\n\t\t},\n\n\t\t{\n\t\t\tname:     \"write multi words\",\n\t\t\twords:    []string{\"test1\", \"test2\", \"test3\"},\n\t\t\texpected: \"test1 test2 test3\\n\",\n\t\t},\n\t}\n\n\tworkDir, _ := os_.Getwd()\n\ttestFileNew := filepath.Join(workDir, \"test-file-new\")\n\ttestFileAppend := filepath.Join(workDir, \"test-file-append\")\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\terr := io_.WriteFileLines(testFileNew, testCase.words, false)\n\t\t\tassert.Nil(t, err)\n\t\t\terr = io_.WriteFileLines(testFileAppend, testCase.words, true)\n\t\t\tassert.Nil(t, err)\n\t\t\t/*\n\t\t\t\tif !strings.EqualFold(testBuffer.String(), testCase.expected) {\n\t\t\t\t\tt.Fatalf(\n\t\t\t\t\t\t\"write word is %v\\n expected: %s, got: %s\",\n\t\t\t\t\t\ttestCase.words,\n\t\t\t\t\t\ttestCase.expected,\n\t\t\t\t\t\ttestBuffer.String(),\n\t\t\t\t\t)\n\n\t\t\t\t}\n\t\t\t*/\n\t\t})\n\t}\n}\n\nfunc TestWriteAtOneThread(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\twords    []byte\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test1\"),\n\t\t\texpected: \"test1\",\n\t\t},\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test2\"),\n\t\t\texpected: \"test2\",\n\t\t},\n\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test3\"),\n\t\t\texpected: \"test3\",\n\t\t},\n\t}\n\n\tvar offsets []int64 = []int64{10, 0, 5}\n\tworkDir, _ := os_.Getwd()\n\ttestFileOffset := filepath.Join(workDir, \"test-file-offset\")\n\tfor i, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\tvar offset int64\n\t\t\tif i > 0 {\n\t\t\t\toffset += int64(i * len(testCases[i-1].words))\n\t\t\t}\n\t\t\tfmt.Println(\"offset: \", offsets[i])\n\t\t\t//err := io_.WriteBytesAt(testFileOffset, testCases[i].words, offset)\n\t\t\terr := io_.WriteBytesAt(testFileOffset, testCases[i].words, offsets[i])\n\t\t\tassert.Nil(t, err)\n\t\t})\n\t}\n}\n\nfunc TestWriteAtMutilThreads(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\twords    []byte\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test1\"),\n\t\t\texpected: \"test1\",\n\t\t},\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test2\"),\n\t\t\texpected: \"test2\",\n\t\t},\n\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []byte(\"test3\"),\n\t\t\texpected: \"test3\",\n\t\t},\n\t}\n\n\tworkDir, _ := os_.Getwd()\n\ttestFileOffset := filepath.Join(workDir, \"test-file-offset\")\n\twg := sync.WaitGroup{}\n\tfor i, testCase := range testCases {\n\t\twg.Add(1)\n\t\tgo func(name string, index int) {\n\t\t\tdefer wg.Done()\n\t\t\tt.Run(name, func(t *testing.T) {\n\t\t\t\tvar offset int64\n\t\t\t\tfor j := 0; j < index; j++ {\n\t\t\t\t\toffset += int64(len(testCases[j].words))\n\t\t\t\t}\n\t\t\t\tfmt.Printf(\"write: %s, offset: %d\", testCases[index].words, offset)\n\t\t\t\terr := io_.WriteBytesAt(testFileOffset, testCases[index].words, offset)\n\t\t\t\tassert.Nil(t, err)\n\t\t\t})\n\t\t}(testCase.name, i)\n\t}\n\twg.Wait()\n}\n\nfunc TestWriteReaderAtOneThread(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\twords    []string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []string{\"test1\"},\n\t\t\texpected: \"test1\",\n\t\t},\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []string{\"test2\"},\n\t\t\texpected: \"test2\",\n\t\t},\n\n\t\t{\n\t\t\tname:     \"write one word\",\n\t\t\twords:    []string{\"test3\"},\n\t\t\texpected: \"test3\",\n\t\t},\n\t}\n\n\tworkDir, _ := os_.Getwd()\n\ttestFile := filepath.Join(workDir, \"test-file\")\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\terr := io_.WriteFileLine(testFile, testCase.words, true)\n\t\t\tassert.Nil(t, err)\n\t\t})\n\t}\n\n\tfile, err := os_.OpenFile(testFile, true)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer file.Close()\n\n\t/*\n\t\tfileInfo, err := file.Stat()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t*/\n\n\ttestFileCopy := filepath.Join(workDir, \"test-file-copy\")\n\tvar offset int64\n\n\tfor _, testCase := range testCases {\n\n\t\terr = io_.WriteReaderAt(testFileCopy, file, offset, int64(len(testCase.words[0])+1))\n\t\toffset += int64(len(testCase.words[0]) + 1)\n\t\tassert.Nil(t, err)\n\t}\n\n\tsumTestFile, _ := md5_.SumFile(testFile)\n\tsumTestFileCopy, _ := md5_.SumFile(testFileCopy)\n\n\tassert.Equal(t, sumTestFile, sumTestFileCopy)\n\n}\n"
  },
  {
    "path": "go/io/testdata/dir/file/1.txt",
    "content": "hello word\n"
  },
  {
    "path": "go/io/testdata/dir/hello.text",
    "content": "hello word\n"
  },
  {
    "path": "go/io/testdata/file/1.txt",
    "content": "hello word\n"
  },
  {
    "path": "go/math/exp/exp.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage exp\n\nimport (\n\t\"math\"\n\n\t\"golang.org/x/exp/constraints\"\n)\n\nconst PRECISION = 1e-6\n\nfunc Max[T constraints.Ordered](s ...T) T {\n\tif len(s) == 0 {\n\t\tvar zero T\n\t\treturn zero\n\t}\n\tm := s[0]\n\tfor _, v := range s[1:] {\n\t\tif m < v {\n\t\t\tm = v\n\t\t}\n\t}\n\treturn m\n}\n\nfunc Min[T constraints.Ordered](s ...T) T {\n\tif len(s) == 0 {\n\t\tvar zero T\n\t\treturn zero\n\t}\n\tm := s[0]\n\tfor _, v := range s[1:] {\n\t\tif m > v {\n\t\t\tm = v\n\t\t}\n\t}\n\treturn m\n}\n\nfunc Value[T constraints.Ordered](v, min, max T) T {\n\tif v < min {\n\t\treturn min\n\t}\n\tif v > max {\n\t\treturn max\n\t}\n\n\treturn v\n}\n\nfunc Equal[T float32 | float64](a, b T) bool {\n\treturn math.Abs(float64(a-b)) < PRECISION\n}\n\nfunc Sum[T constraints.Ordered](t ...T) T {\n\tvar sum T\n\tfor _, v := range t {\n\t\tsum += v\n\t}\n\treturn sum\n}\n"
  },
  {
    "path": "go/math/exp/exp_test.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage exp_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\texp_ \"github.com/kaydxh/golang/go/math/exp\"\n)\n\nfunc TestMax(t *testing.T) {\n\ttestCases := []struct {\n\t\tv1       int64\n\t\tv2       int64\n\t\texpected int64\n\t}{\n\t\t{\n\t\t\tv1:       10,\n\t\t\tv2:       20,\n\t\t\texpected: 20,\n\t\t},\n\t\t{\n\t\t\tv1:       100,\n\t\t\tv2:       20,\n\t\t\texpected: 100,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tvalue := exp_.Max(testCase.v1, testCase.v2)\n\t\t\tif value != testCase.expected {\n\t\t\t\tt.Fatalf(\"failed to get max for [%v] [%v] got : %v\", testCase.v1, testCase.v2, value)\n\n\t\t\t}\n\n\t\t})\n\t}\n}\n\nfunc TestEqual(t *testing.T) {\n\ttestCases := []struct {\n\t\ta        float32\n\t\tb        float32\n\t\texpected string\n\t}{\n\t\t{\n\t\t\ta:        10.1,\n\t\t\tb:        10.1009,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\ta:        10.1,\n\t\t\tb:        10.100000009,\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%v\", i), func(t *testing.T) {\n\t\t\tequal := exp_.Equal(testCase.a, testCase.b)\n\t\t\tt.Logf(\"equal: %v\", equal)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/math/math.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage math\n\nimport \"golang.org/x/exp/constraints\"\n\nfunc CountOne[T constraints.Integer](n T) int32 {\n\tcount := int32(0)\n\tfor n != 0 {\n\t\tcount++\n\t\tn = n & (n - 1)\n\t}\n\treturn count\n}\n"
  },
  {
    "path": "go/math/math_test.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage math_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tmath_ \"github.com/kaydxh/golang/go/math\"\n)\n\nfunc TestCountOne(t *testing.T) {\n\ttestCases := []struct {\n\t\tvalue    int64\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tvalue:    10,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tvalue:    2,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tvalue:    256,\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%d\", i), func(t *testing.T) {\n\t\t\tn := math_.CountOne(testCase.value)\n\t\t\tt.Logf(\"count one %v for %v\", n, testCase.value)\n\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/math/rand/rand.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rand\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar (\n\tglobalRand  = rand.New(rand.NewSource(time.Now().UnixNano()))\n\tmu          sync.Mutex\n\tletterRunes = []rune(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n)\n\n// Int implements rand.Int on the global source.\nfunc Int() int {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn globalRand.Int()\n}\n\n// Int31n implements rand.Int31n on the global source.\nfunc Int31n(n int32) int32 {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn globalRand.Int31n(n)\n}\n\n// Uint32 implements rand.Uint32 on the global source.\nfunc Uint32() uint32 {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn globalRand.Uint32()\n}\n\n// Int63n implements rand.Int63n on the global source.\nfunc Int63n(n int64) int64 {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn globalRand.Int63n(n)\n}\n\n// Intn implements rand.Intn on the global source.\nfunc Intn(n int) int {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn globalRand.Intn(n)\n}\n\n// Float32 implements rand.Float32 on the global source.\nfunc Float32() float32 {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn globalRand.Float32()\n}\n\n// Float64 implements rand.Float64 on the global source.\nfunc Float64() float64 {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn globalRand.Float64()\n}\n\n// Uint64 implements rand.Uint64 on the global source.\nfunc Uint64() uint64 {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn globalRand.Uint64()\n}\n\n// Read implements rand.Read on the global source.\nfunc Read(p []byte) (n int, err error) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\treturn globalRand.Read(p)\n}\n\n// RandInt generate number [min, max).\nfunc RangeInt(min, max int) (int, error) {\n\tif min < 0 || max < 0 || max <= min {\n\t\treturn 0, fmt.Errorf(\"min or max must > 0 and max > min\")\n\t}\n\treturn Intn(max-min) + min, nil\n}\n\n//  RangeString generate string length [0, n].\nfunc RangeString(n int) string {\n\tb := make([]rune, n)\n\tfor i := range b {\n\t\tb[i] = letterRunes[rand.Intn(len(letterRunes))]\n\t}\n\treturn string(b)\n}\n"
  },
  {
    "path": "go/math/rand/rand_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rand_test\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\trand_ \"github.com/kaydxh/golang/go/math/rand\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestRand(t *testing.T) {\n\ts := fmt.Sprintf(\"%08v\", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(100000000))\n\tfmt.Printf(\"s: %v\\n\", s)\n\n\tss := \"abc_dvg_123\"\n\tfmt.Printf(\"ss %v\\n\", ss)\n\tts := strings.TrimPrefix(ss, \"abc_dvg\")\n\tfmt.Printf(\"ts: %v\\n\", ts)\n\n\tns := \"_abc\"\n\tnns := strings.Split(ns, \"_\")\n\tfmt.Printf(\"nns: %v\\n\", nns)\n\n}\n\nfunc TestRangeInt(t *testing.T) {\n\ttestCases := []struct {\n\t\tmin int\n\t\tmax int\n\t}{\n\t\t{\n\t\t\tmin: 10,\n\t\t\tmax: 12,\n\t\t},\n\t\t{\n\t\t\tmin: 10000000,\n\t\t\tmax: 100000000,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"test-%v\", i), func(t *testing.T) {\n\t\t\tr, err := rand_.RangeInt(testCase.min, testCase.max)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to rand int, err: %v\", err)\n\t\t\t}\n\t\t\tt.Logf(\"random: %v\", r)\n\n\t\t\tassert.GreaterOrEqual(t, r, testCase.min)\n\t\t\tassert.LessOrEqual(t, r, testCase.max)\n\n\t\t})\n\t}\n}\n\nfunc TestRead(t *testing.T) {\n\ttestCases := []struct {\n\t\tp []byte\n\t}{\n\t\t{\n\t\t\tp: make([]byte, 10),\n\t\t},\n\t\t{\n\t\t\tp: make([]byte, 20),\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"test-%v\", i), func(t *testing.T) {\n\t\t\tn, err := rand_.Read(testCase.p)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to rand int, err: %v\", err)\n\t\t\t}\n\t\t\tt.Logf(\"read n: %v, p: %v\", n, testCase.p)\n\n\t\t\tassert.Equal(t, len(testCase.p), n)\n\n\t\t})\n\t}\n}\n\nfunc TestRangeString(t *testing.T) {\n\ttestCases := []struct {\n\t\tn int\n\t}{\n\t\t{\n\t\t\tn: 0,\n\t\t},\n\t\t{\n\t\t\tn: 5,\n\t\t},\n\t\t{\n\t\t\tn: 8,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"test-%v\", i), func(t *testing.T) {\n\t\t\tstr := rand_.RangeString(testCase.n)\n\t\t\tt.Logf(\"str: %v\", str)\n\t\t\tassert.Equal(t, len(str), testCase.n)\n\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "go/net/grpc/example/data.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.36.10\n// \tprotoc        v5.29.3\n// source: go/net/grpc/example/data.proto\n\npackage v1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\t_ \"google.golang.org/protobuf/types/descriptorpb\"\n\treflect \"reflect\"\n\tsync \"sync\"\n\tunsafe \"unsafe\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype NowRequest struct {\n\tstate protoimpl.MessageState `protogen:\"open.v1\"`\n\t// proto name 默认为变量名，proto json默认为小驼峰模式, json默认为变量名\n\t// [json_name = \"RequestId\"]将指定proto json的标签, 此时需要设置\n\t// protojson编解码器选项UseProtoNames为false\n\tRequestId     string `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"` // 请求ID\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *NowRequest) Reset() {\n\t*x = NowRequest{}\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *NowRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NowRequest) ProtoMessage() {}\n\nfunc (x *NowRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[0]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use NowRequest.ProtoReflect.Descriptor instead.\nfunc (*NowRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_net_grpc_example_data_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *NowRequest) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\ntype NowResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tRequestId     string                 `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"` // 请求ID\n\tDate          string                 `protobuf:\"bytes,2,opt,name=date,json=Date,proto3\" json:\"date,omitempty\"`                  // 当前时间\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *NowResponse) Reset() {\n\t*x = NowResponse{}\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *NowResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NowResponse) ProtoMessage() {}\n\nfunc (x *NowResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[1]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use NowResponse.ProtoReflect.Descriptor instead.\nfunc (*NowResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_net_grpc_example_data_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *NowResponse) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\nfunc (x *NowResponse) GetDate() string {\n\tif x != nil {\n\t\treturn x.Date\n\t}\n\treturn \"\"\n}\n\ntype NowErrorRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tRequestId     string                 `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"` // 请求ID\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *NowErrorRequest) Reset() {\n\t*x = NowErrorRequest{}\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *NowErrorRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NowErrorRequest) ProtoMessage() {}\n\nfunc (x *NowErrorRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[2]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use NowErrorRequest.ProtoReflect.Descriptor instead.\nfunc (*NowErrorRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_net_grpc_example_data_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (x *NowErrorRequest) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\ntype NowErrorResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tRequestId     string                 `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"` // 请求ID\n\tDate          string                 `protobuf:\"bytes,2,opt,name=date,json=Date,proto3\" json:\"date,omitempty\"`                  // 当前时间\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *NowErrorResponse) Reset() {\n\t*x = NowErrorResponse{}\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *NowErrorResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NowErrorResponse) ProtoMessage() {}\n\nfunc (x *NowErrorResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[3]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use NowErrorResponse.ProtoReflect.Descriptor instead.\nfunc (*NowErrorResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_net_grpc_example_data_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *NowErrorResponse) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\nfunc (x *NowErrorResponse) GetDate() string {\n\tif x != nil {\n\t\treturn x.Date\n\t}\n\treturn \"\"\n}\n\nvar File_go_net_grpc_example_data_proto protoreflect.FileDescriptor\n\nconst file_go_net_grpc_example_data_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"\\x1ego/net/grpc/example/data.proto\\x12\\x0fsea.api.seadate\\x1a google/protobuf/descriptor.proto\\\"+\\n\" +\n\t\"\\n\" +\n\t\"NowRequest\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"request_id\\x18\\x01 \\x01(\\tR\\tRequestId\\\"@\\n\" +\n\t\"\\vNowResponse\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"request_id\\x18\\x01 \\x01(\\tR\\tRequestId\\x12\\x12\\n\" +\n\t\"\\x04date\\x18\\x02 \\x01(\\tR\\x04Date\\\"0\\n\" +\n\t\"\\x0fNowErrorRequest\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"request_id\\x18\\x01 \\x01(\\tR\\tRequestId\\\"E\\n\" +\n\t\"\\x10NowErrorResponse\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"request_id\\x18\\x01 \\x01(\\tR\\tRequestId\\x12\\x12\\n\" +\n\t\"\\x04date\\x18\\x02 \\x01(\\tR\\x04Date2\\xa7\\x01\\n\" +\n\t\"\\x0eSeaDateService\\x12B\\n\" +\n\t\"\\x03Now\\x12\\x1b.sea.api.seadate.NowRequest\\x1a\\x1c.sea.api.seadate.NowResponse\\\"\\x00\\x12Q\\n\" +\n\t\"\\bNowError\\x12 .sea.api.seadate.NowErrorRequest\\x1a!.sea.api.seadate.NowErrorResponse\\\"\\x00B7Z5github.com/kaydxh/sea/api/protoapi-spec/seadate/v1;v1b\\x06proto3\"\n\nvar (\n\tfile_go_net_grpc_example_data_proto_rawDescOnce sync.Once\n\tfile_go_net_grpc_example_data_proto_rawDescData []byte\n)\n\nfunc file_go_net_grpc_example_data_proto_rawDescGZIP() []byte {\n\tfile_go_net_grpc_example_data_proto_rawDescOnce.Do(func() {\n\t\tfile_go_net_grpc_example_data_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_go_net_grpc_example_data_proto_rawDesc), len(file_go_net_grpc_example_data_proto_rawDesc)))\n\t})\n\treturn file_go_net_grpc_example_data_proto_rawDescData\n}\n\nvar file_go_net_grpc_example_data_proto_msgTypes = make([]protoimpl.MessageInfo, 4)\nvar file_go_net_grpc_example_data_proto_goTypes = []any{\n\t(*NowRequest)(nil),       // 0: sea.api.seadate.NowRequest\n\t(*NowResponse)(nil),      // 1: sea.api.seadate.NowResponse\n\t(*NowErrorRequest)(nil),  // 2: sea.api.seadate.NowErrorRequest\n\t(*NowErrorResponse)(nil), // 3: sea.api.seadate.NowErrorResponse\n}\nvar file_go_net_grpc_example_data_proto_depIdxs = []int32{\n\t0, // 0: sea.api.seadate.SeaDateService.Now:input_type -> sea.api.seadate.NowRequest\n\t2, // 1: sea.api.seadate.SeaDateService.NowError:input_type -> sea.api.seadate.NowErrorRequest\n\t1, // 2: sea.api.seadate.SeaDateService.Now:output_type -> sea.api.seadate.NowResponse\n\t3, // 3: sea.api.seadate.SeaDateService.NowError:output_type -> sea.api.seadate.NowErrorResponse\n\t2, // [2:4] is the sub-list for method output_type\n\t0, // [0:2] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_go_net_grpc_example_data_proto_init() }\nfunc file_go_net_grpc_example_data_proto_init() {\n\tif File_go_net_grpc_example_data_proto != nil {\n\t\treturn\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: unsafe.Slice(unsafe.StringData(file_go_net_grpc_example_data_proto_rawDesc), len(file_go_net_grpc_example_data_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   4,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_go_net_grpc_example_data_proto_goTypes,\n\t\tDependencyIndexes: file_go_net_grpc_example_data_proto_depIdxs,\n\t\tMessageInfos:      file_go_net_grpc_example_data_proto_msgTypes,\n\t}.Build()\n\tFile_go_net_grpc_example_data_proto = out.File\n\tfile_go_net_grpc_example_data_proto_goTypes = nil\n\tfile_go_net_grpc_example_data_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "go/net/grpc/example/data.proto",
    "content": "syntax = \"proto3\";\n\npackage sea.api.seadate;\nimport \"google/protobuf/descriptor.proto\";\n\noption go_package = \"github.com/kaydxh/sea/api/protoapi-spec/seadate/v1;v1\";\n\nservice SeaDateService {\n  // 生成当前时间\n  rpc Now(NowRequest) returns (NowResponse) {};\n  rpc NowError(NowErrorRequest) returns (NowErrorResponse) {};\n}\n\nmessage NowRequest {\n  // proto name 默认为变量名，proto json默认为小驼峰模式, json默认为变量名\n  // [json_name = \"RequestId\"]将指定proto json的标签, 此时需要设置\n  // protojson编解码器选项UseProtoNames为false\n  string request_id = 1 [json_name = \"RequestId\"];  // 请求ID\n}\n\nmessage NowResponse {\n  string request_id = 1 [json_name = \"RequestId\"];  // 请求ID\n  string date = 2 [json_name = \"Date\"];             // 当前时间\n}\n\nmessage NowErrorRequest {\n  string request_id = 1 [json_name = \"RequestId\"];  // 请求ID\n}\n\nmessage NowErrorResponse {\n  string request_id = 1 [json_name = \"RequestId\"];  // 请求ID\n  string date = 2 [json_name = \"Date\"];             // 当前时间\n}\n"
  },
  {
    "path": "go/net/grpc/example/data.repository.go",
    "content": "package v1\n\nimport (\n\t\"context\"\n\n\tgrpc_ \"github.com/kaydxh/golang/go/net/grpc\"\n)\n\ntype Repository struct {\n\tgrpc_.Repository[SeaDateServiceClient]\n}\n\nfunc (r *Repository) Now(ctx context.Context, req *NowRequest) (resp *NowResponse, err error) {\n\n\terr = r.Call(ctx, func(ctx context.Context) error {\n\t\tnowResp, err := r.Client.Now(ctx, &NowRequest{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tresp = &NowResponse{\n\t\t\tRequestId: req.RequestId,\n\t\t\tDate:      nowResp.GetDate(),\n\t\t}\n\t\treturn nil\n\t})\n\n\treturn resp, err\n}\n"
  },
  {
    "path": "go/net/grpc/example/data.repository_test.go",
    "content": "package v1_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"context\"\n\n\tgrpc_ \"github.com/kaydxh/golang/go/net/grpc\"\n\tdate_ \"github.com/kaydxh/golang/go/net/grpc/example\"\n\t_ \"github.com/kaydxh/golang/go/net/resolver/dns\"\n\t_ \"github.com/kaydxh/golang/go/net/resolver/passthrough\"\n\t\"google.golang.org/grpc\"\n)\n\nfunc TestNow(t *testing.T) {\n\n\tctx := context.Background()\n\t/*\n\t\trepository, err := grpc_.NewRepository(ctx, grpc_.FactoryConfig[date_.DateServiceClient]{\n\t\t\tAddr:    \"localhost:10001\",\n\t\t\tTimeout: 5 * time.Second,\n\t\t\tNewServiceClient: func(c *grpc.ClientConn) date_.DateServiceClient {\n\t\t\t\treturn date_.NewDateServiceClient(c)\n\t\t\t},\n\t\t},\n\t\t)\n\t*/\n\n\tfactory, err := grpc_.NewFactory(grpc_.FactoryConfig[date_.SeaDateServiceClient]{\n\t\t//Addr:    \"localhost:10001\",\n\t\tAddr:    \"127.0.0.1:10001\",\n\t\tTimeout: 5 * time.Second,\n\t\tNewServiceClient: func(c *grpc.ClientConn) date_.SeaDateServiceClient {\n\t\t\treturn date_.NewSeaDateServiceClient(c)\n\t\t},\n\t},\n\t)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new factory, err: %v\", err)\n\t}\n\trepository, err := factory.NewClient(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new respository client, err: %v\", err)\n\t}\n\n\trespWrap := date_.Repository{\n\t\tRepository: repository,\n\t}\n\n\tvar resp any\n\terr = respWrap.Call(ctx,\n\t\tfunc(ctx context.Context) error {\n\t\t\t// short connection\n\t\t\tnewClient, conn, err := respWrap.NewConnect(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer conn.Close()\n\n\t\t\tresp, err = newClient.Now(ctx, &date_.NowRequest{})\n\t\t\t//long connection\n\t\t\t//resp, err = respWrap.Now(ctx, &date_.NowRequest{})\n\t\t\treturn err\n\t\t})\n\tif err != nil {\n\t\tt.Errorf(\"failed to call Now, err: %v\", err)\n\t\treturn\n\t}\n\n\t//t.Logf(\"resp: %v\", resp.RequestId)\n\tt.Logf(\"resp: %v\", resp)\n\n}\n"
  },
  {
    "path": "go/net/grpc/example/data_grpc.pb.go",
    "content": "// Code generated by protoc-gen-go-grpc. DO NOT EDIT.\n// versions:\n// - protoc-gen-go-grpc v1.5.1\n// - protoc             v5.29.3\n// source: go/net/grpc/example/data.proto\n\npackage v1\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatus \"google.golang.org/grpc/status\"\n)\n\n// This is a compile-time assertion to ensure that this generated file\n// is compatible with the grpc package it is being compiled against.\n// Requires gRPC-Go v1.64.0 or later.\nconst _ = grpc.SupportPackageIsVersion9\n\nconst (\n\tSeaDateService_Now_FullMethodName      = \"/sea.api.seadate.SeaDateService/Now\"\n\tSeaDateService_NowError_FullMethodName = \"/sea.api.seadate.SeaDateService/NowError\"\n)\n\n// SeaDateServiceClient is the client API for SeaDateService service.\n//\n// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.\ntype SeaDateServiceClient interface {\n\t// 生成当前时间\n\tNow(ctx context.Context, in *NowRequest, opts ...grpc.CallOption) (*NowResponse, error)\n\tNowError(ctx context.Context, in *NowErrorRequest, opts ...grpc.CallOption) (*NowErrorResponse, error)\n}\n\ntype seaDateServiceClient struct {\n\tcc grpc.ClientConnInterface\n}\n\nfunc NewSeaDateServiceClient(cc grpc.ClientConnInterface) SeaDateServiceClient {\n\treturn &seaDateServiceClient{cc}\n}\n\nfunc (c *seaDateServiceClient) Now(ctx context.Context, in *NowRequest, opts ...grpc.CallOption) (*NowResponse, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(NowResponse)\n\terr := c.cc.Invoke(ctx, SeaDateService_Now_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\nfunc (c *seaDateServiceClient) NowError(ctx context.Context, in *NowErrorRequest, opts ...grpc.CallOption) (*NowErrorResponse, error) {\n\tcOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)\n\tout := new(NowErrorResponse)\n\terr := c.cc.Invoke(ctx, SeaDateService_NowError_FullMethodName, in, out, cOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\n// SeaDateServiceServer is the server API for SeaDateService service.\n// All implementations must embed UnimplementedSeaDateServiceServer\n// for forward compatibility.\ntype SeaDateServiceServer interface {\n\t// 生成当前时间\n\tNow(context.Context, *NowRequest) (*NowResponse, error)\n\tNowError(context.Context, *NowErrorRequest) (*NowErrorResponse, error)\n\tmustEmbedUnimplementedSeaDateServiceServer()\n}\n\n// UnimplementedSeaDateServiceServer must be embedded to have\n// forward compatible implementations.\n//\n// NOTE: this should be embedded by value instead of pointer to avoid a nil\n// pointer dereference when methods are called.\ntype UnimplementedSeaDateServiceServer struct{}\n\nfunc (UnimplementedSeaDateServiceServer) Now(context.Context, *NowRequest) (*NowResponse, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method Now not implemented\")\n}\nfunc (UnimplementedSeaDateServiceServer) NowError(context.Context, *NowErrorRequest) (*NowErrorResponse, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method NowError not implemented\")\n}\nfunc (UnimplementedSeaDateServiceServer) mustEmbedUnimplementedSeaDateServiceServer() {}\nfunc (UnimplementedSeaDateServiceServer) testEmbeddedByValue()                        {}\n\n// UnsafeSeaDateServiceServer may be embedded to opt out of forward compatibility for this service.\n// Use of this interface is not recommended, as added methods to SeaDateServiceServer will\n// result in compilation errors.\ntype UnsafeSeaDateServiceServer interface {\n\tmustEmbedUnimplementedSeaDateServiceServer()\n}\n\nfunc RegisterSeaDateServiceServer(s grpc.ServiceRegistrar, srv SeaDateServiceServer) {\n\t// If the following call pancis, it indicates UnimplementedSeaDateServiceServer was\n\t// embedded by pointer and is nil.  This will cause panics if an\n\t// unimplemented method is ever invoked, so we test this at initialization\n\t// time to prevent it from happening at runtime later due to I/O.\n\tif t, ok := srv.(interface{ testEmbeddedByValue() }); ok {\n\t\tt.testEmbeddedByValue()\n\t}\n\ts.RegisterService(&SeaDateService_ServiceDesc, srv)\n}\n\nfunc _SeaDateService_Now_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(NowRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(SeaDateServiceServer).Now(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: SeaDateService_Now_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(SeaDateServiceServer).Now(ctx, req.(*NowRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\nfunc _SeaDateService_NowError_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(NowErrorRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(SeaDateServiceServer).NowError(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: SeaDateService_NowError_FullMethodName,\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(SeaDateServiceServer).NowError(ctx, req.(*NowErrorRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\n// SeaDateService_ServiceDesc is the grpc.ServiceDesc for SeaDateService service.\n// It's only intended for direct use with grpc.RegisterService,\n// and not to be introspected or modified (even as a copy)\nvar SeaDateService_ServiceDesc = grpc.ServiceDesc{\n\tServiceName: \"sea.api.seadate.SeaDateService\",\n\tHandlerType: (*SeaDateServiceServer)(nil),\n\tMethods: []grpc.MethodDesc{\n\t\t{\n\t\t\tMethodName: \"Now\",\n\t\t\tHandler:    _SeaDateService_Now_Handler,\n\t\t},\n\t\t{\n\t\t\tMethodName: \"NowError\",\n\t\t\tHandler:    _SeaDateService_NowError_Handler,\n\t\t},\n\t},\n\tStreams:  []grpc.StreamDesc{},\n\tMetadata: \"go/net/grpc/example/data.proto\",\n}\n"
  },
  {
    "path": "go/net/grpc/grpc_client.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpc\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sync\"\n\t\"time\"\n\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/connectivity\"\n\t\"google.golang.org/grpc/credentials/insecure\"\n\t\"google.golang.org/grpc/keepalive\"\n)\n\nconst (\n\t// defaultMaxMsgSize 默认最大消息大小\n\tdefaultMaxMsgSize = math.MaxInt32 // 16 * 1024 * 1024\n\t// defaultCallTimeout 默认调用超时时间\n\tdefaultCallTimeout = 3 * time.Second\n\t// defaultKeepaliveTime 默认 keepalive 时间间隔\n\tdefaultKeepaliveTime = 10 * time.Second\n\t// defaultKeepaliveTimeout 默认 keepalive 超时时间\n\tdefaultKeepaliveTimeout = 3 * time.Second\n)\n\n// connPoolEntry 连接池条目\ntype connPoolEntry struct {\n\tconn *grpc.ClientConn\n\tmu   sync.Mutex\n}\n\nvar (\n\t// connPool 全局连接池，key 为 address，value 为 *connPoolEntry\n\tconnPool sync.Map\n)\n\n// GrpcClient gRPC 客户端封装\ntype GrpcClient struct {\n\tconn *grpc.ClientConn\n\topts grpcClientOptions\n}\n\n// grpcClientOptions gRPC 客户端配置选项\ntype grpcClientOptions struct {\n\tmaxMsgSize           int                          // 最大消息大小\n\tdisablePrintMethods  []string                     // 禁止打印的方法列表\n\tcallTimeout          time.Duration                // 默认调用超时时间\n\tkeepaliveTime        time.Duration                // keepalive 时间间隔\n\tkeepaliveTimeout     time.Duration                // keepalive 超时时间\n\tunaryInterceptors    []grpc.UnaryClientInterceptor  // 自定义 Unary 拦截器\n\tstreamInterceptors   []grpc.StreamClientInterceptor // 自定义 Stream 拦截器\n\tadditionalDialOpts   []grpc.DialOption            // 额外的拨号选项\n}\n\n// NewGrpcClient 创建一个新的 gRPC 客户端\nfunc NewGrpcClient(addr string, options ...GrpcClientOption) (*GrpcClient, error) {\n\tc := &GrpcClient{}\n\tc.ApplyOptions(options...)\n\tc.setDefaults()\n\n\tdialOpts := c.buildDialOptions()\n\tconn, err := grpc.NewClient(addr, dialOpts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to connect address %s: %w\", addr, err)\n\t}\n\tc.conn = conn\n\n\treturn c, nil\n}\n\n// setDefaults 设置默认配置值\nfunc (g *GrpcClient) setDefaults() {\n\tif g.opts.maxMsgSize == 0 {\n\t\tg.opts.maxMsgSize = defaultMaxMsgSize\n\t}\n\tif g.opts.callTimeout == 0 {\n\t\tg.opts.callTimeout = defaultCallTimeout\n\t}\n\tif g.opts.keepaliveTime == 0 {\n\t\tg.opts.keepaliveTime = defaultKeepaliveTime\n\t}\n\tif g.opts.keepaliveTimeout == 0 {\n\t\tg.opts.keepaliveTimeout = defaultKeepaliveTimeout\n\t}\n}\n\n// buildDialOptions 构建拨号选项\nfunc (g *GrpcClient) buildDialOptions() []grpc.DialOption {\n\treturn ClientDialOptions(\n\t\tg.opts.maxMsgSize,\n\t\tg.opts.keepaliveTime,\n\t\tg.opts.keepaliveTimeout,\n\t\tg.opts.unaryInterceptors,\n\t\tg.opts.streamInterceptors,\n\t\tg.opts.additionalDialOpts...,\n\t)\n}\n\n// Conn 返回底层的 gRPC 连接\nfunc (g *GrpcClient) Conn() *grpc.ClientConn {\n\treturn g.conn\n}\n\n// CallTimeout 返回默认的调用超时时间\nfunc (g *GrpcClient) CallTimeout() time.Duration {\n\treturn g.opts.callTimeout\n}\n\n// Close 关闭 gRPC 连接\nfunc (g *GrpcClient) Close() error {\n\tif g.conn == nil {\n\t\treturn nil\n\t}\n\treturn g.conn.Close()\n}\n\n// ClientDialOptions 创建 gRPC 拨号选项\nfunc ClientDialOptions(\n\tmaxMsgSize int,\n\tkeepaliveTime, keepaliveTimeout time.Duration,\n\tunaryInterceptors []grpc.UnaryClientInterceptor,\n\tstreamInterceptors []grpc.StreamClientInterceptor,\n\tadditionalOpts ...grpc.DialOption,\n) []grpc.DialOption {\n\t// 设置默认值\n\tif maxMsgSize == 0 {\n\t\tmaxMsgSize = defaultMaxMsgSize\n\t}\n\tif keepaliveTime == 0 {\n\t\tkeepaliveTime = defaultKeepaliveTime\n\t}\n\tif keepaliveTimeout == 0 {\n\t\tkeepaliveTimeout = defaultKeepaliveTimeout\n\t}\n\n\topts := []grpc.DialOption{\n\t\tgrpc.WithTransportCredentials(insecure.NewCredentials()),\n\t\tgrpc.WithDefaultCallOptions(\n\t\t\tgrpc.MaxCallRecvMsgSize(maxMsgSize),\n\t\t\tgrpc.MaxCallSendMsgSize(maxMsgSize),\n\t\t),\n\t\tgrpc.WithInitialWindowSize(int32(maxMsgSize)),\n\t\tgrpc.WithInitialConnWindowSize(int32(maxMsgSize)),\n\t\tgrpc.WithStatsHandler(&statHandler{}),\n\t\tgrpc.WithKeepaliveParams(keepalive.ClientParameters{\n\t\t\tTime:                keepaliveTime,\n\t\t\tTimeout:             keepaliveTimeout,\n\t\t\tPermitWithoutStream: true,\n\t\t}),\n\t}\n\n\t// 添加自定义 Unary 拦截器\n\tif len(unaryInterceptors) > 0 {\n\t\topts = append(opts, grpc.WithChainUnaryInterceptor(unaryInterceptors...))\n\t}\n\n\t// 添加自定义 Stream 拦截器\n\tif len(streamInterceptors) > 0 {\n\t\topts = append(opts, grpc.WithChainStreamInterceptor(streamInterceptors...))\n\t}\n\n\t// 添加额外的拨号选项\n\topts = append(opts, additionalOpts...)\n\n\treturn opts\n}\n\n// GetGrpcClientConn 获取一个 gRPC 客户端长连接（支持连接复用）\n// 对于相同的地址和配置，会复用已存在的连接；如果连接不存在或已关闭，则创建新连接\n// 参数 opts 可以传入自定义的拨号选项，如拦截器等\nfunc GetGrpcClientConn(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error) {\n\t// 获取或创建连接池条目\n\tvalue, _ := connPool.LoadOrStore(addr, &connPoolEntry{})\n\tentry := value.(*connPoolEntry)\n\n\tentry.mu.Lock()\n\tdefer entry.mu.Unlock()\n\n\t// 检查现有连接是否可用\n\tif entry.conn != nil {\n\t\tstate := entry.conn.GetState()\n\t\t// 检查连接是否处于可用状态或可恢复状态\n\t\tif isConnAvailable(state) {\n\t\t\t// 检查配置是否一致\n\t\t\treturn entry.conn, nil\n\n\t\t} else {\n\t\t\tentry.conn.Close()\n\t\t\t// 连接不可用，清理\n\t\t\tentry.conn = nil\n\t\t}\n\t}\n\n\t// 创建新连接\n\tdialOpts := ClientDialOptions(\n\t\tdefaultMaxMsgSize,\n\t\tdefaultKeepaliveTime,\n\t\tdefaultKeepaliveTimeout,\n\t\tnil, // 不再硬编码拦截器\n\t\tnil,\n\t\topts..., // 允许调用方传入自定义选项\n\t)\n\tconn, err := grpc.NewClient(addr, dialOpts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create grpc client for address %s: %w\", addr, err)\n\t}\n\n\t// 保存新连接\n\tentry.conn = conn\n\n\treturn conn, nil\n}\n\n// isConnAvailable 检查连接状态是否可用\nfunc isConnAvailable(state connectivity.State) bool {\n\t// Ready: 连接就绪\n\t// Idle: 连接空闲但可用\n\t// Connecting: 正在连接，可以等待\n\t// TransientFailure: 暂时失败，不可用\n\t// Shutdown: 已关闭，不可用\n\treturn state == connectivity.Ready || state == connectivity.Idle || state == connectivity.Connecting\n}\n\n// CloseGrpcClientConn 关闭指定地址的 gRPC 连接并从连接池中移除\nfunc CloseGrpcClientConn(addr string) error {\n\tif value, ok := connPool.LoadAndDelete(addr); ok {\n\t\tentry := value.(*connPoolEntry)\n\t\tentry.mu.Lock()\n\t\tdefer entry.mu.Unlock()\n\t\tif entry.conn != nil {\n\t\t\treturn entry.conn.Close()\n\t\t}\n\t}\n\treturn nil\n}\n\n// CloseAllGrpcClientConns 关闭所有连接池中的连接\nfunc CloseAllGrpcClientConns() error {\n\tvar lastErr error\n\tvar keys []interface{}\n\n\t// 先收集所有的 key\n\tconnPool.Range(func(key, value interface{}) bool {\n\t\tkeys = append(keys, key)\n\t\treturn true\n\t})\n\n\t// 逐个关闭并删除\n\tfor _, key := range keys {\n\t\tif value, ok := connPool.LoadAndDelete(key); ok {\n\t\t\tentry := value.(*connPoolEntry)\n\t\t\tentry.mu.Lock()\n\t\t\tif entry.conn != nil {\n\t\t\t\tif err := entry.conn.Close(); err != nil {\n\t\t\t\t\tlastErr = err\n\t\t\t\t}\n\t\t\t}\n\t\t\tentry.mu.Unlock()\n\t\t}\n\t}\n\n\treturn lastErr\n}\n"
  },
  {
    "path": "go/net/grpc/grpc_client.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpc\n\nimport \"time\"\n\n// WithMaxMsgSize 设置最大消息大小\nfunc WithMaxMsgSize(maxMsgSize int) GrpcClientOption {\n\treturn GrpcClientOptionFunc(func(c *GrpcClient) {\n\t\tc.opts.maxMsgSize = maxMsgSize\n\t})\n}\n\n// WithCallTimeout 设置默认调用超时时间\nfunc WithCallTimeout(timeout time.Duration) GrpcClientOption {\n\treturn GrpcClientOptionFunc(func(c *GrpcClient) {\n\t\tc.opts.callTimeout = timeout\n\t})\n}\n\n// WithKeepaliveTime 设置 keepalive 时间间隔\nfunc WithKeepaliveTime(keepaliveTime time.Duration) GrpcClientOption {\n\treturn GrpcClientOptionFunc(func(c *GrpcClient) {\n\t\tc.opts.keepaliveTime = keepaliveTime\n\t})\n}\n\n// WithKeepaliveTimeout 设置 keepalive 超时时间\nfunc WithKeepaliveTimeout(keepaliveTimeout time.Duration) GrpcClientOption {\n\treturn GrpcClientOptionFunc(func(c *GrpcClient) {\n\t\tc.opts.keepaliveTimeout = keepaliveTimeout\n\t})\n}\n\n// WithDisablePrintMethods 设置不需要在调试日志中打印的方法列表\nfunc WithDisablePrintMethods(methods ...string) GrpcClientOption {\n\treturn GrpcClientOptionFunc(func(c *GrpcClient) {\n\t\tc.opts.disablePrintMethods = methods\n\t})\n}\n"
  },
  {
    "path": "go/net/grpc/grpc_client.repository.factory.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/go-playground/validator/v10\"\n\tresolve_ \"github.com/kaydxh/golang/go/net/resolver/resolve\"\n\t\"google.golang.org/grpc\"\n)\n\ntype FactoryConfigFunc[T any] func(c *FactoryConfig[T]) error\n\ntype FactoryConfig[T any] struct {\n\tValidator        *validator.Validate\n\tAddr             string\n\tTimeout          time.Duration //接口处理超时时间\n\tNewServiceClient func(*grpc.ClientConn) T\n\n\t// not include the first call\n\tRetryTimes    int\n\tRetryInterval time.Duration\n\n\tDisablePrintInoutMethods []string\n}\n\nfunc (fc *FactoryConfig[T]) ApplyOptions(configFuncs ...FactoryConfigFunc[T]) error {\n\n\tfor _, f := range configFuncs {\n\t\terr := f(fc)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to apply factory config, err: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (fc FactoryConfig[T]) Validate() error {\n\tvalid := fc.Validator\n\tif valid == nil {\n\t\tvalid = validator.New()\n\t}\n\treturn valid.Struct(fc)\n}\n\ntype Repository[T any] struct {\n\tTimeout time.Duration\n\n\tAddr             string\n\tNewServiceClient func(*grpc.ClientConn) T\n\tConn             *grpc.ClientConn\n\tClient           T\n\n\t// not include the first call\n\tRetryTimes    int\n\tRetryInterval time.Duration\n\n\tDisablePrintInoutMethods []string\n}\n\nfunc (r *Repository[T]) NewConnect(ctx context.Context) (client T, conn *grpc.ClientConn, err error) {\n\n\tvar zeroClient T\n\n\taddr := r.Addr\n\taddress, err := resolve_.ResolveOne(ctx, addr)\n\tif err != nil {\n\t\treturn zeroClient, nil, err\n\t}\n\tif address.Addr != \"\" {\n\t\taddr = address.Addr\n\t}\n\n\tconn, err = GetGrpcClientConn(addr)\n\tif err != nil {\n\t\treturn zeroClient, nil, err\n\t}\n\n\treturn r.NewServiceClient(conn), conn, nil\n}\n\nfunc (r *Repository[T]) Close(conn *grpc.ClientConn) (err error) {\n\treturn conn.Close()\n}\n\nfunc newRepository[T any](ctx context.Context, fc FactoryConfig[T]) (Repository[T], error) {\n\tconn, err := GetGrpcClientConn(fc.Addr)\n\tif err != nil {\n\t\treturn Repository[T]{}, err\n\t}\n\n\trepo := Repository[T]{\n\t\tTimeout:                  fc.Timeout,\n\t\tAddr:                     fc.Addr,\n\t\tNewServiceClient:         fc.NewServiceClient,\n\t\tConn:                     conn,\n\t\tClient:                   fc.NewServiceClient(conn),\n\t\tRetryTimes:               fc.RetryTimes,\n\t\tRetryInterval:            fc.RetryInterval,\n\t\tDisablePrintInoutMethods: fc.DisablePrintInoutMethods,\n\t}\n\n\treturn repo, nil\n}\n\ntype Factory[T any] struct {\n\tfc FactoryConfig[T]\n}\n\nfunc NewFactory[T any](fc FactoryConfig[T], configFuncs ...FactoryConfigFunc[T]) (Factory[T], error) {\n\terr := fc.ApplyOptions(configFuncs...)\n\tif err != nil {\n\t\treturn Factory[T]{}, err\n\t}\n\n\terr = fc.Validate()\n\tif err != nil {\n\t\treturn Factory[T]{}, err\n\t}\n\n\treturn Factory[T]{fc: fc}, nil\n}\n\nfunc (f Factory[T]) NewClient(ctx context.Context) (Repository[T], error) {\n\treturn newRepository(ctx, f.fc)\n}\n"
  },
  {
    "path": "go/net/grpc/grpc_client.repository.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpc\n\nimport (\n\t\"context\"\n\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc (r *Repository[T]) Call(ctx context.Context, f func(ctx context.Context) error) (err error) {\n\n\tlogger := logrus.WithContext(ctx)\n\terr = time_.RetryWithContext(ctx, func(ctx context.Context) error {\n\t\tctx, cancel := context_.WithTimeout(ctx, r.Timeout)\n\t\tdefer cancel()\n\n\t\terr = f(ctx)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"failed to call f\")\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}, r.RetryInterval, r.RetryTimes)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "go/net/grpc/grpc_client_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpc\n\n// A GrpcClientOption sets options.\ntype GrpcClientOption interface {\n\tapply(*GrpcClient)\n}\n\n// EmptyGrpcClientOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyGrpcClientOption struct{}\n\nfunc (EmptyGrpcClientOption) apply(*GrpcClient) {}\n\n// GrpcClientOptionFunc wraps a function that modifies Client into an\n// implementation of the GrpcClientOption interface.\ntype GrpcClientOptionFunc func(*GrpcClient)\n\nfunc (f GrpcClientOptionFunc) apply(do *GrpcClient) {\n\tf(do)\n}\n\nfunc (o *GrpcClient) ApplyOptions(options ...GrpcClientOption) *GrpcClient {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/grpc/grpc_client_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpc_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\tgrpc_ \"github.com/kaydxh/golang/go/net/grpc\"\n)\n\nfunc TestGetGrpcClientConn(t *testing.T) {\n\n\tvar (\n\t\tserverAddress = \"127.0.0.1:8001\"\n\t)\n\n\tconn, err := grpc_.GetGrpcClientConn(serverAddress)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get grpc client conn, err: %v\", err)\n\t\treturn\n\t}\n\tdefer conn.Close()\n}\n\nfunc TestNewGrpcClient(t *testing.T) {\n\n\tvar (\n\t\tserverAddress = \"127.0.0.1:8001\"\n\t\tcallTimeout   = 5 * time.Second\n\t)\n\n\tgClient, err := grpc_.NewGrpcClient(serverAddress, grpc_.WithCallTimeout(callTimeout))\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create grpc client, err: %v\", err)\n\t\treturn\n\t}\n\tdefer gClient.Close()\n}\n"
  },
  {
    "path": "go/net/grpc/grpc_stats.handler.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpc\n\nimport (\n\t\"context\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"google.golang.org/grpc/stats\"\n)\n\ntype statHandler struct {\n}\n\n// TagRPC can attach some information to the given context.\n// The context used for the rest lifetime of the RPC will be derived from\n// the returned context.\nfunc (h *statHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {\n\treturn ctx\n}\n\n// HandleRPC processes the RPC stats.\nfunc (h *statHandler) HandleRPC(ctx context.Context, s stats.RPCStats) {\n\tlogger := logrus.WithContext(ctx)\n\tswitch v := s.(type) {\n\tcase *stats.OutHeader:\n\t\tlogger.WithField(\"local_addr\", v.LocalAddr).WithField(\"remote_addr\", v.RemoteAddr).Infof(\"HandleRPC method %v\", v.FullMethod)\n\t}\n\n}\n\n// TagConn can attach some information to the given context.\n// The returned context will be used for stats handling.\n// For conn stats handling, the context used in HandleConn for this\n// connection will be derived from the context returned.\n// For RPC stats handling,\n//  - On server side, the context used in HandleRPC for all RPCs on this\n// connection will be derived from the context returned.\n//  - On client side, the context is not derived from the context returned.\nfunc (s *statHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context {\n\tlogger := logrus.WithContext(ctx)\n\tlogger.WithField(\"local_addr\", info.LocalAddr).WithField(\"remote_addr\", info.RemoteAddr).Debugf(\"tag conn\")\n\treturn ctx\n}\n\n// HandleConn processes the Conn stats.\nfunc (s *statHandler) HandleConn(context.Context, stats.ConnStats) {\n}\n"
  },
  {
    "path": "go/net/grpc/ip.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\n\t\"google.golang.org/grpc/metadata\"\n\t\"google.golang.org/grpc/peer\"\n)\n\n// returns IP address from grpc context.\n// It will lookup IP in  X-Forwarded-For and X-Real-IP headers, if both\n// get empty, lookup IP from peer context\nfunc GetIPFromContext(ctx context.Context) (net.IP, error) {\n\t// FromIncomingContext returns the incoming metadata in ctx if it exists.\n\tmd, ok := metadata.FromIncomingContext(ctx)\n\tif ok {\n\t\tpeerAddr := md.Get(\"x-real-ip\")\n\t\tif len(peerAddr) > 0 {\n\t\t\treturn net.ParseIP(peerAddr[0]), nil\n\t\t}\n\n\t\tpeerAddr = md.Get(\"x-forwarded-for\")\n\t\tif len(peerAddr) > 0 {\n\t\t\treturn net.ParseIP(peerAddr[0]), nil\n\t\t}\n\t}\n\n\t//if use proxy, only return proxy address\n\t// FromContext returns the peer information in ctx if it exists.\n\tpeerAddr, ok := peer.FromContext(ctx)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unexpected context\")\n\t}\n\n\tif peerAddr.Addr == net.Addr(nil) {\n\t\treturn nil, fmt.Errorf(\"unexpected err: peer address is nil\")\n\t}\n\n\thost, _, err := net.SplitHostPort(peerAddr.Addr.String())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid peer host: %v, err: %v\", peerAddr.Addr.String(), err)\n\t}\n\n\treturn net.ParseIP(host), nil\n}\n"
  },
  {
    "path": "go/net/http/clone.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"mime/multipart\"\n\t\"net/http\"\n\t\"net/url\"\n\n\t_ \"unsafe\" // for go:linkname\n)\n\n//go:linkname CloneURLValues net/http.cloneURLValues\nfunc CloneURLValues(v url.Values) url.Values\n\n//go:linkname CloneURL net/http.cloneURL\nfunc CloneURL(u *url.URL) *url.URL\n\n//go:linkname CloneMultipartForm net/http.cloneMultipartForm\nfunc CloneMultipartForm(f *multipart.Form) *multipart.Form\n\n//go:linkname CloneMultipartFileHeader net/http.cloneMultipartFileHeader\nfunc CloneMultipartFileHeader(fh *multipart.FileHeader) *multipart.FileHeader\n\n// CloneOrMakeHeader invokes Header.Clone but if the\n// result is nil, it'll instead make and return a non-nil Header.\n//go:linkname CloneOrMakeHeader net/http.cloneOrMakeHeader\nfunc CloneOrMakeHeader(hdr http.Header) http.Header\n"
  },
  {
    "path": "go/net/http/example/data.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: go/net/grpc/example/data.proto\n\npackage date\n\nimport (\n\t_ \"github.com/golang/protobuf/protoc-gen-go/descriptor\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype NowRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRequestId string `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"` //请求ID\n}\n\nfunc (x *NowRequest) Reset() {\n\t*x = NowRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_go_net_grpc_example_data_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *NowRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NowRequest) ProtoMessage() {}\n\nfunc (x *NowRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use NowRequest.ProtoReflect.Descriptor instead.\nfunc (*NowRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_net_grpc_example_data_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *NowRequest) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\ntype NowResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRequestId string `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"` // 请求ID\n\tDate      string `protobuf:\"bytes,2,opt,name=date,json=Date,proto3\" json:\"date,omitempty\"`                  //当前时间\n}\n\nfunc (x *NowResponse) Reset() {\n\t*x = NowResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_go_net_grpc_example_data_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *NowResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NowResponse) ProtoMessage() {}\n\nfunc (x *NowResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_go_net_grpc_example_data_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use NowResponse.ProtoReflect.Descriptor instead.\nfunc (*NowResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_net_grpc_example_data_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *NowResponse) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\nfunc (x *NowResponse) GetDate() string {\n\tif x != nil {\n\t\treturn x.Date\n\t}\n\treturn \"\"\n}\n\nvar File_go_net_grpc_example_data_proto protoreflect.FileDescriptor\n\nvar file_go_net_grpc_example_data_proto_rawDesc = []byte{\n\t0x0a, 0x1e, 0x67, 0x6f, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x78,\n\t0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x12, 0x0c, 0x73, 0x65, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x64, 0x61, 0x74, 0x65, 0x1a, 0x20,\n\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,\n\t0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x22, 0x2b, 0x0a, 0x0a, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d,\n\t0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,\n\t0x28, 0x09, 0x52, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x40, 0x0a,\n\t0x0b, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a,\n\t0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,\n\t0x52, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64,\n\t0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, 0x32,\n\t0x4b, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3c,\n\t0x0a, 0x03, 0x4e, 0x6f, 0x77, 0x12, 0x18, 0x2e, 0x73, 0x65, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e,\n\t0x64, 0x61, 0x74, 0x65, 0x2e, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,\n\t0x19, 0x2e, 0x73, 0x65, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x4e,\n\t0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x32, 0x5a, 0x30,\n\t0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78,\n\t0x68, 0x2f, 0x73, 0x65, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70,\n\t0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3b, 0x64, 0x61, 0x74, 0x65,\n\t0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_go_net_grpc_example_data_proto_rawDescOnce sync.Once\n\tfile_go_net_grpc_example_data_proto_rawDescData = file_go_net_grpc_example_data_proto_rawDesc\n)\n\nfunc file_go_net_grpc_example_data_proto_rawDescGZIP() []byte {\n\tfile_go_net_grpc_example_data_proto_rawDescOnce.Do(func() {\n\t\tfile_go_net_grpc_example_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_net_grpc_example_data_proto_rawDescData)\n\t})\n\treturn file_go_net_grpc_example_data_proto_rawDescData\n}\n\nvar file_go_net_grpc_example_data_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_go_net_grpc_example_data_proto_goTypes = []interface{}{\n\t(*NowRequest)(nil),  // 0: sea.api.date.NowRequest\n\t(*NowResponse)(nil), // 1: sea.api.date.NowResponse\n}\nvar file_go_net_grpc_example_data_proto_depIdxs = []int32{\n\t0, // 0: sea.api.date.DateService.Now:input_type -> sea.api.date.NowRequest\n\t1, // 1: sea.api.date.DateService.Now:output_type -> sea.api.date.NowResponse\n\t1, // [1:2] is the sub-list for method output_type\n\t0, // [0:1] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_go_net_grpc_example_data_proto_init() }\nfunc file_go_net_grpc_example_data_proto_init() {\n\tif File_go_net_grpc_example_data_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_go_net_grpc_example_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*NowRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_go_net_grpc_example_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*NowResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_go_net_grpc_example_data_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_go_net_grpc_example_data_proto_goTypes,\n\t\tDependencyIndexes: file_go_net_grpc_example_data_proto_depIdxs,\n\t\tMessageInfos:      file_go_net_grpc_example_data_proto_msgTypes,\n\t}.Build()\n\tFile_go_net_grpc_example_data_proto = out.File\n\tfile_go_net_grpc_example_data_proto_rawDesc = nil\n\tfile_go_net_grpc_example_data_proto_goTypes = nil\n\tfile_go_net_grpc_example_data_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "go/net/http/example/data.proto",
    "content": "syntax = \"proto3\";\n\npackage sea.api.date;\nimport \"google/protobuf/descriptor.proto\";\n\noption go_package = \"github.com/kaydxh/sea/api/openapi-spec/date;date\";\n\nservice DateService {\n  // 生成当前时间\n  rpc Now(NowRequest) returns (NowResponse) {};\n}\n\nmessage NowRequest {\n  string request_id = 1 [json_name = \"RequestId\"];  //请求ID\n}\n\nmessage NowResponse {\n  string request_id = 1 [json_name = \"RequestId\"];  // 请求ID\n  string date = 2 [json_name = \"Date\"];             //当前时间\n}\n\n"
  },
  {
    "path": "go/net/http/example/http_client.repository_test.go",
    "content": "package date_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"context\"\n\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\tdate_ \"github.com/kaydxh/golang/go/net/http/example\"\n)\n\nfunc TestNowPbJson(t *testing.T) {\n\n\tctx := context.Background()\n\tclient, err := http_.NewClient()\n\tif err != nil {\n\t\tt.Errorf(\"failed to new http client, err: %v\", err)\n\t}\n\tfactory, err := http_.NewFactory[date_.NowRequest, date_.NowResponse](http_.FactoryConfig{\n\t\tUrl:        \"http://localhost:10001/Now\",\n\t\tTimeout:    5 * time.Second,\n\t\tClient:     client,\n\t\tRetryTimes: 3,\n\t},\n\t)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new factory, err: %v\", err)\n\t}\n\trepository, err := factory.NewClient(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new respository client, err: %v\", err)\n\t}\n\n\tnowResponse, err := repository.PostPbJson(ctx, &date_.NowRequest{})\n\tif err != nil {\n\t\tt.Errorf(\"failed to call Now, err: %v\", err)\n\t}\n\n\tt.Logf(\"resp: %v\", nowResponse)\n\n}\n\nfunc TestNowPb(t *testing.T) {\n\n\tctx := context.Background()\n\tclient, err := http_.NewClient()\n\tif err != nil {\n\t\tt.Errorf(\"failed to new http client, err: %v\", err)\n\t}\n\tfactory, err := http_.NewFactory[date_.NowRequest, date_.NowResponse](http_.FactoryConfig{\n\t\tUrl:        \"http://localhost:10001/Now\",\n\t\tTimeout:    5 * time.Second,\n\t\tClient:     client,\n\t\tRetryTimes: 3,\n\t},\n\t)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new factory, err: %v\", err)\n\t}\n\trepository, err := factory.NewClient(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new respository client, err: %v\", err)\n\t}\n\n\tnowResponse, err := repository.PostPb(ctx, &date_.NowRequest{})\n\tif err != nil {\n\t\tt.Errorf(\"failed to call Now, err: %v\", err)\n\t}\n\n\tt.Logf(\"resp: %v\", nowResponse)\n\n}\n"
  },
  {
    "path": "go/net/http/http_client.do.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net/http\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc (c *Client) get(ctx context.Context, url string) (*http.Response, error) {\n\treturn c.HttpDo(ctx, http.MethodGet, url, \"\", nil, nil, nil)\n}\n\nfunc (c *Client) post(ctx context.Context, url string, contentType string, headers map[string]string,\n\tauth func(r *http.Request) error,\n\tbody io.Reader,\n) (*http.Response, error) {\n\treturn c.HttpDo(ctx, http.MethodPost, url, contentType, headers, auth, body)\n}\n\nfunc (c *Client) put(ctx context.Context, url string, contentType string, headers map[string]string,\n\tauth func(r *http.Request) error,\n\tbody io.Reader,\n) (*http.Response, error) {\n\treturn c.HttpDo(ctx, http.MethodPut, url, contentType, headers, auth, body)\n}\n\nfunc (c *Client) HttpDo(ctx context.Context, method string, url string, contentType string, headers map[string]string,\n\tauth func(r *http.Request) error,\n\tbody io.Reader,\n) (*http.Response, error) {\n\treq, err := http.NewRequest(method, url, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif contentType != \"\" {\n\t\treq.Header.Set(\"Content-Type\", contentType)\n\t}\n\tfor key, value := range headers {\n\t\treq.Header.Set(key, value)\n\t}\n\n\tif auth != nil {\n\t\terr = auth(req)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn c.Do(ctx, req)\n}\n\nfunc (c *Client) Do(ctx context.Context, req *http.Request) (*http.Response, error) {\n\t/*\n\t\terr := RequestWithTargetHost(req, c.opts.targetHost)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t*/\n\n\ttc := time_.New(true)\n\tlogger := logrus.WithContext(ctx)\n\tlogger.WithField(\"target_addr\", req.Host).Infof(\"http do %v\", req.URL.Path)\n\tsummary := func() {\n\t\ttc.Tick(req.Method)\n\t\tlogger.WithField(\"method\", req.Method).Infof(tc.String())\n\t}\n\tdefer summary()\n\n\treturn c.Client.Do(req)\n}\n"
  },
  {
    "path": "go/net/http/http_client.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/gin-gonic/gin/binding\"\n)\n\ntype Client struct {\n\thttp.Client\n\topts struct {\n\t\t// Timeout specifies a time limit for requests made by this\n\t\t// Client. The timeout includes connection time, any\n\t\t// redirects, and reading the response body. The timer remains\n\t\t// running after Get, Head, Post, or Do return and will\n\t\t// interrupt reading of the Response.Body.\n\t\t//\n\t\t// A Timeout of zero means no timeout.\n\t\t//\n\t\t// The Client cancels requests to the underlying Transport\n\t\t// as if the Request's Context ended.\n\t\t//\n\t\t// For compatibility, the Client will also use the deprecated\n\t\t// CancelRequest method on Transport if found. New\n\t\t// RoundTripper implementations should use the Request's Context\n\t\t// for cancellation instead of implementing CancelRequest.\n\t\ttimeout               time.Duration\n\t\tdialTimeout           time.Duration\n\t\tresponseHeaderTimeout time.Duration\n\t\tidleConnTimeout       time.Duration\n\t\tmaxIdleConns          int\n\t\tdisableKeepAlives     bool\n\n\t\t// Proxy specifies a function to return a proxy for a given\n\t\t// Request. If the function returns a non-nil error, the\n\t\t// request is aborted with the provided error.\n\t\t//\n\t\t// The proxy type is determined by the URL scheme. \"http\",\n\t\t// \"https\", and \"socks5\" are supported. If the scheme is empty,\n\t\t// \"http\" is assumed.\n\t\t//\n\t\t// If Proxy is nil or returns a nil *URL, no proxy is used.\n\t\t//proxy func(*http.Request) (*url.URL, error)\n\t\t// like forward proxy\n\t\tproxyURL string\n\n\t\t// proxyHost is host:port, or domain, replace host in proxy\n\t\tproxyHost string\n\n\t\t// targetHost is host:port, redirect to it, like reverse proxy\n\t\ttargetHost string\n\n\t\tErrorLog *log.Logger\n\t}\n}\n\nfunc NewClient(options ...ClientOption) (*Client, error) {\n\tc := &Client{}\n\tc.ApplyOptions(options...)\n\ttransport := DefaultTransportInsecure\n\t/*\n\t\ttransport := &http.Transport{\n\n\t\t\t// ProxyFromEnvironment returns the URL of the proxy to use for a\n\t\t\t// given request, as indicated by the environment variables\n\t\t\t// HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions\n\t\t\t// thereof). HTTPS_PROXY takes precedence over HTTP_PROXY for https\n\t\t\t// requests.\n\t\t\t//\n\t\t\t// The environment values may be either a complete URL or a\n\t\t\t// \"host[:port]\", in which case the \"http\" scheme is assumed.\n\t\t\t// The schemes \"http\", \"https\", and \"socks5\" are supported.\n\t\t\t// An error is returned if the value is a different form.\n\t\t\t//\n\t\t\t// A nil URL and nil error are returned if no proxy is defined in the\n\t\t\t// environment, or a proxy should not be used for the given request,\n\t\t\t// as defined by NO_PROXY.\n\t\t\t//\n\t\t\t// As a special case, if req.URL.Host is \"localhost\" (with or without\n\t\t\t// a port number), then a nil URL and nil error will be returned.\n\t\t\tProxy: http.ProxyFromEnvironment,\n\t\t\t// skip verify for https\n\t\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n\t\t}\n\t*/\n\tif c.opts.timeout != 0 {\n\t\tc.Client.Timeout = c.opts.timeout\n\t}\n\tif c.opts.dialTimeout != 0 {\n\t\ttransport.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {\n\t\t\tconn, err := net.DialTimeout(\n\t\t\t\tnetwork,\n\t\t\t\taddr,\n\t\t\t\tc.opts.dialTimeout,\n\t\t\t)\n\t\t\tif nil != err {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn conn, nil\n\t\t}\n\t}\n\n\tif c.opts.responseHeaderTimeout != 0 {\n\t\ttransport.ResponseHeaderTimeout = c.opts.responseHeaderTimeout\n\t}\n\tif c.opts.maxIdleConns != 0 {\n\t\ttransport.MaxIdleConns = c.opts.maxIdleConns\n\t}\n\tif c.opts.idleConnTimeout != 0 {\n\t\ttransport.IdleConnTimeout = c.opts.idleConnTimeout\n\t}\n\tif c.opts.disableKeepAlives {\n\t\ttransport.DisableKeepAlives = c.opts.disableKeepAlives\n\t}\n\tc.Transport = RoundTripFunc(func(req *http.Request) (resp *http.Response, err error) {\n\t\tif c.opts.proxyURL != \"\" || c.opts.proxyHost != \"\" {\n\t\t\ttransport.Proxy = ProxyFuncFromContextOrEnvironment\n\n\t\t\tproxyUrl := \"http://\"\n\t\t\tif c.opts.proxyURL != \"\" {\n\t\t\t\tproxyUrl = c.opts.proxyURL\n\t\t\t}\n\t\t\tproxy := &Proxy{\n\t\t\t\tProxyUrl:    proxyUrl,\n\t\t\t\tProxyTarget: c.opts.proxyHost,\n\t\t\t}\n\t\t\treq = RequestWithContextProxy(req, proxy)\n\t\t}\n\n\t\tif c.opts.targetHost != \"\" {\n\t\t\thost := &Host{\n\t\t\t\tHostTarget:           c.opts.targetHost,\n\t\t\t\tReplaceHostInRequest: true,\n\t\t\t}\n\t\t\treq = RequestWithContextTargetHost(req, host)\n\t\t}\n\n\t\treturn RoundTripperWithTarget(transport).RoundTrip(req)\n\n\t})\n\n\treturn c, nil\n}\n\nfunc (c *Client) Get(ctx context.Context, url string) ([]byte, error) {\n\tr, err := c.get(ctx, url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer r.Body.Close()\n\n\tdata, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn data, nil\n}\n\nfunc (c *Client) Post(\n\tctx context.Context,\n\turl, contentType string,\n\theaders map[string]string,\n\tbody []byte,\n) ([]byte, error) {\n\tbodyReader := bytes.NewReader(body)\n\treturn c.PostReader(ctx, url, contentType, headers, nil, bodyReader)\n}\n\nfunc (c *Client) Put(\n\tctx context.Context,\n\turl, contentType string,\n\theaders map[string]string,\n\tbody []byte,\n) ([]byte, error) {\n\tbodyReader := bytes.NewReader(body)\n\treturn c.PutReader(ctx, url, contentType, headers, nil, bodyReader)\n}\n\nfunc (c *Client) PostJson(\n\tctx context.Context,\n\turl string,\n\theaders map[string]string,\n\tbody []byte,\n) ([]byte, error) {\n\tbodyReader := bytes.NewReader(body)\n\treturn c.PostReader(ctx, url, binding.MIMEJSON, headers, nil, bodyReader)\n}\n\nfunc (c *Client) PostPb(\n\tctx context.Context,\n\turl string,\n\theaders map[string]string,\n\tbody []byte,\n) ([]byte, error) {\n\tbodyReader := bytes.NewReader(body)\n\treturn c.PostReader(ctx, url, binding.MIMEPROTOBUF, headers, nil, bodyReader)\n}\n\nfunc (c *Client) PostJsonWithAuthorize(\n\tctx context.Context,\n\turl string,\n\theaders map[string]string,\n\tauth func(r *http.Request) error,\n\tbody []byte,\n) ([]byte, error) {\n\tbodyReader := bytes.NewReader(body)\n\treturn c.PostReader(ctx, url, binding.MIMEJSON, headers, auth, bodyReader)\n}\n\nfunc (c *Client) PostReader(\n\tctx context.Context,\n\turl, contentType string,\n\theaders map[string]string,\n\tauth func(r *http.Request) error,\n\tbody io.Reader,\n) ([]byte, error) {\n\treturn c.HttpReader(ctx, http.MethodPost, url, contentType, headers, auth, body)\n}\n\nfunc (c *Client) PutReader(\n\tctx context.Context,\n\turl, contentType string,\n\theaders map[string]string,\n\tauth func(r *http.Request) error,\n\tbody io.Reader,\n) ([]byte, error) {\n\treturn c.HttpReader(ctx, http.MethodPut, url, contentType, headers, auth, body)\n}\n\nfunc (c *Client) HttpReader(\n\tctx context.Context,\n\tmethod, url, contentType string,\n\theaders map[string]string,\n\tauth func(r *http.Request) error,\n\tbody io.Reader,\n) ([]byte, error) {\n\tr, err := c.HttpDo(ctx, method, url, contentType, headers, auth, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer r.Body.Close()\n\n\tdata, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif r.StatusCode >= http.StatusBadRequest {\n\t\treturn data, fmt.Errorf(\"http status code: %v\", r.StatusCode)\n\t}\n\n\treturn data, nil\n}\n\nfunc (c *Client) logf(format string, args ...interface{}) {\n\tif c.opts.ErrorLog != nil {\n\t\tc.opts.ErrorLog.Printf(format, args...)\n\t} else {\n\t\tlog.Printf(format, args...)\n\t}\n}\n"
  },
  {
    "path": "go/net/http/http_client.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"log\"\n\t\"time\"\n)\n\nfunc WithTimeout(timeout time.Duration) ClientOption {\n\treturn ClientOptionFunc(func(c *Client) {\n\t\tc.opts.timeout = timeout\n\t})\n}\n\nfunc WithResonseHeaderTimeout(responseHeaderTimeout time.Duration) ClientOption {\n\t// https://cos.ap-beijing.myqcloud.com\n\treturn ClientOptionFunc(func(c *Client) {\n\t\tc.opts.responseHeaderTimeout = responseHeaderTimeout\n\t})\n}\n\nfunc WithMaxIdleConns(maxIdleConns int) ClientOption {\n\treturn ClientOptionFunc(func(c *Client) {\n\t\tc.opts.maxIdleConns = maxIdleConns\n\t})\n}\n\nfunc WithIdleConnTimeout(idleConnTimeout time.Duration) ClientOption {\n\treturn ClientOptionFunc(func(c *Client) {\n\t\tc.opts.idleConnTimeout = idleConnTimeout\n\t})\n}\n\nfunc WithDisableKeepAlives(disableKeepAlives bool) ClientOption {\n\treturn ClientOptionFunc(func(c *Client) {\n\t\tc.opts.disableKeepAlives = disableKeepAlives\n\t})\n}\n\n// http://xxx:yyy@goproxy.com\nfunc WithProxyURL(proxyURL string) ClientOption {\n\treturn ClientOptionFunc(func(c *Client) {\n\t\tc.opts.proxyURL = proxyURL\n\t})\n}\n\n//dns:///ai-media-1256936300.cos.ap-guangzhou.myqcloud.com\n// redirect\nfunc WithTargetHost(target string) ClientOption {\n\treturn ClientOptionFunc(func(c *Client) {\n\t\tc.opts.targetHost = target\n\t})\n}\n\n// replace host in proxy url\nfunc WithProxyHost(target string) ClientOption {\n\treturn ClientOptionFunc(func(c *Client) {\n\t\tc.opts.proxyHost = target\n\t})\n}\n\n// WithLogger\nfunc WithLogger(l *log.Logger) ClientOption {\n\treturn ClientOptionFunc(func(c *Client) {\n\t\tc.opts.ErrorLog = l\n\t})\n}\n"
  },
  {
    "path": "go/net/http/http_client.repository.factory.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/go-playground/validator/v10\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype FactoryConfigFunc func(c *FactoryConfig) error\n\ntype FactoryConfig struct {\n\tValidator *validator.Validate\n\tUrl       string\n\tTimeout   time.Duration //接口处理超时时间\n\t*Client\n\tRetryTimes    int\n\tRetryInterval time.Duration\n}\n\nfunc (fc *FactoryConfig) ApplyOptions(configFuncs ...FactoryConfigFunc) error {\n\n\tfor _, f := range configFuncs {\n\t\terr := f(fc)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to apply factory config, err: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (fc FactoryConfig) Validate() error {\n\tvalid := fc.Validator\n\tif valid == nil {\n\t\tvalid = validator.New()\n\t}\n\treturn valid.Struct(fc)\n}\n\ntype ProtoMessage interface {\n\tproto.Message\n}\n\ntype Repository[REQ any, RESP any] struct {\n\tUrl     string\n\tTimeout time.Duration\n\n\t*Client\n\n\t// not include the first call\n\tRetryTimes    int\n\tRetryInterval time.Duration\n}\n\nfunc newRepository[REQ any, RESP any](ctx context.Context, fc FactoryConfig) (*Repository[REQ, RESP], error) {\n\trepo := &Repository[REQ, RESP]{\n\t\tUrl:           fc.Url,\n\t\tTimeout:       fc.Timeout,\n\t\tClient:        fc.Client,\n\t\tRetryTimes:    fc.RetryTimes,\n\t\tRetryInterval: fc.RetryInterval,\n\t}\n\n\treturn repo, nil\n\n}\n\ntype Factory[REQ any, RESP any] struct {\n\tfc FactoryConfig\n}\n\nfunc NewFactory[REQ any, RESP any](fc FactoryConfig, configFuncs ...FactoryConfigFunc) (Factory[REQ, RESP], error) {\n\terr := fc.ApplyOptions(configFuncs...)\n\tif err != nil {\n\t\treturn Factory[REQ, RESP]{}, err\n\t}\n\n\terr = fc.Validate()\n\tif err != nil {\n\t\treturn Factory[REQ, RESP]{}, err\n\t}\n\n\treturn Factory[REQ, RESP]{fc: fc}, nil\n}\n\nfunc (f Factory[REQ, RESP]) NewClient(ctx context.Context) (*Repository[REQ, RESP], error) {\n\treturn newRepository[REQ, RESP](ctx, f.fc)\n}\n"
  },
  {
    "path": "go/net/http/http_client.repository.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\t\"github.com/kaydxh/golang/go/encoding/protojson\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"github.com/sirupsen/logrus\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\nfunc (r *Repository[REQ, RESP]) PostPbJson(ctx context.Context, req *REQ) (resp *RESP, err error) {\n\treturn r.PostPbJsonWithUrl(ctx, r.Url, req)\n}\n\nfunc (r *Repository[REQ, RESP]) PostPbJsonWithUrl(ctx context.Context, url string, req *REQ) (resp *RESP, err error) {\n\n\tlogger := logrus.WithContext(ctx)\n\ttc := time_.New(true)\n\tsummary := func() {\n\t\ttc.Tick(\"PostPbJson\")\n\t\trespProto, ok := any(resp).(proto.Message)\n\t\tif ok {\n\t\t\tlogger.WithField(\"response\", reflect_.TruncateBytes(proto.Clone(respProto))).\n\t\t\t\tWithField(\"cost\", tc.String()).\n\t\t\t\tInfo(\"recv\")\n\t\t}\n\t}\n\tdefer summary()\n\n\treqProto, ok := any(req).(proto.Message)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"req is not proto message type\")\n\t}\n\tlogger.WithField(\"request\", reflect_.TruncateBytes(proto.Clone(reqProto))).Info(\"send\")\n\n\treqData, err := protojson.Marshal(reqProto)\n\tif err != nil {\n\t\tlogger.WithError(err).WithField(\"req\", req).Errorf(\"failed to marshal request\")\n\t\treturn resp, err\n\t}\n\n\tvar respData []byte\n\terr = time_.RetryWithContext(ctx, func(ctx context.Context) error {\n\t\tctx, cancel := context_.WithTimeout(ctx, r.Timeout)\n\t\tdefer cancel()\n\n\t\trespData, err = r.Client.PostJson(ctx, url, nil, reqData)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"failed to post json\")\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}, r.RetryInterval, r.RetryTimes)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\tvar zeroResp RESP\n\tresp = &zeroResp\n\terr = protojson.Unmarshal(respData, any(resp).(proto.Message))\n\tif err != nil {\n\t\tlogger.WithError(err).Errorf(\"failed to unmarshal post response data\")\n\t\treturn nil, err\n\t}\n\n\treturn resp, nil\n}\n\nfunc (r *Repository[REQ, RESP]) PostPb(ctx context.Context, req *REQ) (resp *RESP, err error) {\n\n\tlogger := logrus.WithContext(ctx)\n\ttc := time_.New(true)\n\tsummary := func() {\n\t\ttc.Tick(\"PostPbJson\")\n\t\trespProto, ok := any(resp).(proto.Message)\n\t\tif ok {\n\t\t\tlogger.WithField(\"response\", reflect_.TruncateBytes(proto.Clone(respProto))).\n\t\t\t\tWithField(\"cost\", tc.String()).\n\t\t\t\tInfo(\"recv\")\n\t\t}\n\t}\n\tdefer summary()\n\n\treqProto, ok := any(req).(proto.Message)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"req is not proto message type\")\n\t}\n\tlogger.WithField(\"request\", reflect_.TruncateBytes(proto.Clone(reqProto))).Info(\"recv\")\n\n\treqData, err := proto.Marshal(reqProto)\n\tif err != nil {\n\t\tlogger.WithError(err).WithField(\"req\", req).Errorf(\"failed to marshal request\")\n\t\treturn resp, err\n\t}\n\n\tvar respData []byte\n\terr = time_.RetryWithContext(ctx, func(ctx context.Context) error {\n\t\tctx, cancel := context_.WithTimeout(ctx, r.Timeout)\n\t\tdefer cancel()\n\n\t\trespData, err = r.Client.PostPb(ctx, r.Url, nil, reqData)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"failed to post json, url: %v\", r.Url)\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}, r.RetryInterval, r.RetryTimes)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\tvar zeroResp RESP\n\tresp = &zeroResp\n\terr = proto.Unmarshal(respData, any(resp).(proto.Message))\n\tif err != nil {\n\t\tlogger.WithError(err).Errorf(\"failed to unmarshal post response data\")\n\t\treturn nil, err\n\t}\n\n\treturn resp, nil\n}\n\n/*\nfunc (r *Repository[REQ, RESP]) Do(ctx context.Context, method string, contentType string, req *REQ) (resp *RESP, err error) {\n\n\tlogger := logrus.WithContext(ctx)\n\ttc := time_.New(true)\n\tsummary := func() {\n\t\ttc.Tick(\"PostPbJson\")\n\t\trespProto, ok := any(resp).(proto.Message)\n\t\tif ok {\n\t\t\tlogger.WithField(\"response\", reflect_.TruncateBytes(proto.Clone(respProto))).\n\t\t\t\tWithField(\"cost\", tc.String()).\n\t\t\t\tInfo(\"recv\")\n\t\t}\n\t}\n\tdefer summary()\n\n\treqProto, ok := any(req).(proto.Message)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"req is not proto message type\")\n\t}\n\tlogger.WithField(\"request\", reflect_.TruncateBytes(proto.Clone(reqProto))).Info(\"recv\")\n\n\tvar (\n\t\treqData  []byte\n\t\trespData []byte\n\t)\n\tswitch contentType {\n\tcase binding.MIMEJSON:\n\t\treqData, err = protojson.Marshal(reqProto)\n\tcase binding.MIMEPROTOBUF:\n\t\treqData, err = proto.Marshal(reqProto)\n\n\tdefault:\n\t\treqData, err = protojson.Marshal(reqProto)\n\t}\n\tif err != nil {\n\t\tlogger.WithError(err).WithField(\"req\", req).Errorf(\"failed to marshal request\")\n\t\treturn resp, err\n\t}\n\n\terr = time_.RetryWithContext(ctx, func(ctx context.Context) error {\n\t\tctx, cancel := context_.WithTimeout(ctx, r.Timeout)\n\t\tdefer cancel()\n\n\t\trespData, err = r.Client.PostPb(r.Url, nil, reqData)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"failed to post json\")\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}, r.RetryInterval, r.RetryTimes)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\tvar zeroResp RESP\n\tresp = &zeroResp\n\terr = proto.Unmarshal(respData, any(resp).(proto.Message))\n\tif err != nil {\n\t\tlogger.WithError(err).Errorf(\"failed to unmarshal post response data\")\n\t\treturn nil, err\n\t}\n\n\treturn resp, nil\n}\n*/\n"
  },
  {
    "path": "go/net/http/http_client_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\n// A ClientOption sets options.\ntype ClientOption interface {\n\tapply(*Client)\n}\n\n// EmptyClientOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyClientOption struct{}\n\nfunc (EmptyClientOption) apply(*Client) {}\n\n// ClientOptionFunc wraps a function that modifies Client into an\n// implementation of the ClientOption interface.\ntype ClientOptionFunc func(*Client)\n\nfunc (f ClientOptionFunc) apply(do *Client) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ClientOptionWithDefault() ClientOption {\n\treturn ClientOptionFunc(func(*Client) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Client) ApplyOptions(options ...ClientOption) *Client {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/http/http_client_proxy.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"net/http\"\n\n\turl_ \"github.com/kaydxh/golang/go/net/url\"\n)\n\nfunc RequestWithTargetHost(req *http.Request, target string) error {\n\tif target == \"\" {\n\t\treturn nil\n\t}\n\n\tnewUrl, err := url_.ResolveWithTarget(req.Context(), req.URL, target)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.URL = newUrl\n\treq.Host = newUrl.Host\n\n\treturn nil\n}\n\nfunc NewClientWithTargetHost(target string, opts ...ClientOption) *Client {\n\topts = append(opts, WithTargetHost(target))\n\tc, _ := NewClient(opts...)\n\treturn c\n}\n"
  },
  {
    "path": "go/net/http/http_client_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\t\"golang.org/x/net/context\"\n\t\"gotest.tools/v3/assert\"\n)\n\nfunc TestHttpClientGet(t *testing.T) {\n\tctx := context.Background()\n\tclient, err := http_.NewClient(http_.WithTimeout(5 * time.Second))\n\tif err != nil {\n\t\tt.Fatalf(\"expect nil, got %v\", err)\n\t}\n\n\ttestCases := []struct {\n\t\turl      string\n\t\texpected bool\n\t}{\n\t\t{\n\t\t\turl:      \"http://127.0.0.1\",\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\turl:      \"http://127.0.0.2\",\n\t\t\texpected: false,\n\t\t},\n\t}\n\n\tfor _, test := range testCases {\n\t\tdata, err := client.Get(ctx, test.url)\n\t\tif test.expected {\n\t\t\tassert.NilError(t, err)\n\t\t} else {\n\t\t\tassert.Assert(t, err != nil) // NotNil\n\t\t\tt.Logf(\"got %v\", err)\n\t\t}\n\n\t\tt.Logf(\"response data: %v\", string(data))\n\t}\n}\n\nfunc TestHttpClientGetWithProxy(t *testing.T) {\n\tctx := context.Background()\n\tclient, err := http_.NewClient(http_.WithTimeout(5*time.Second), http_.WithTargetHost(\"dns:///ai-media-1256936300.cos.ap-guangzhou.myqcloud.com\"))\n\tif err != nil {\n\t\tt.Fatalf(\"expect nil, got %v\", err)\n\t}\n\n\ttestCases := []struct {\n\t\turl      string\n\t\texpected bool\n\t}{\n\t\t{\n\t\t\t//url:      \"https://ai-media-1256936300.cos.ap-guangzhou.myqcloud.com/find.sh?q-sign-algorithm=sha1&q-ak=AKIDCDyve81SJuISPkMq0IukLg7tupWyoqCg&q-sign-time=1659955959;8640000001659870000&q-key-time=1659955959;8640000001659870000&q-header-list=&q-url-param-list=&q-signature=5695f17ee30c3cd2d37197c773a445eda8a70c8c\",\n\t\t\turl:      \"http://127.0.0.1/find.sh?q-sign-algorithm=sha1&q-ak=AKIDCDyve81SJuISPkMq0IukLg7tupWyoqCg&q-sign-time=1659955959;8640000001659870000&q-key-time=1659955959;8640000001659870000&q-header-list=&q-url-param-list=&q-signature=5695f17ee30c3cd2d37197c773a445eda8a70c8c\",\n\t\t\texpected: true,\n\t\t},\n\t}\n\n\tfor _, test := range testCases {\n\t\tdata, err := client.Get(ctx, test.url)\n\t\tif test.expected {\n\t\t\tassert.NilError(t, err)\n\t\t} else {\n\t\t\tassert.Assert(t, err != nil) // NotNil\n\t\t\tt.Logf(\"got %v\", err)\n\t\t}\n\n\t\tt.Logf(\"response data size: %v\", len(data))\n\t}\n}\n\nfunc TestHttpClientPost(t *testing.T) {\n\tctx := context.Background()\n\tclient, err := http_.NewClient(http_.WithTimeout(5 * time.Second))\n\tif err != nil {\n\t\tt.Fatalf(\"expect nil, got %v\", err)\n\t}\n\n\ttestCases := []struct {\n\t\turl      string\n\t\tdata     []byte\n\t\texpected bool\n\t}{\n\t\t{\n\t\t\turl:      \"http://127.0.0.1\",\n\t\t\tdata:     []byte(\"hello world test1\"),\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\turl:      \"http://127.0.0.2\",\n\t\t\tdata:     []byte(\"hello world test2\"),\n\t\t\texpected: false,\n\t\t},\n\t}\n\n\tfor _, test := range testCases {\n\t\tdata, err := client.Post(ctx, test.url, \"application/text\", nil, test.data)\n\t\tif test.expected {\n\t\t\tassert.NilError(t, err)\n\t\t} else {\n\t\t\tassert.Assert(t, err != nil) // NotNil\n\t\t\tt.Logf(\"got %v\", err)\n\t\t}\n\n\t\tt.Logf(\"response data: %v\", string(data))\n\t}\n}\n"
  },
  {
    "path": "go/net/http/http_error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n)\n\nfunc ErrorFromHttp(code int) error {\n\n\tif code >= http.StatusOK && code < http.StatusBadRequest {\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"unexpected http status code: %v\", code)\n}\n"
  },
  {
    "path": "go/net/http/http_handler_chain.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\n// A HandlerChainOption sets options.\ntype HandlerChainOption interface {\n\tapply(*HandlerChain)\n}\n\n// EmptyHandlerChainOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyHandlerChainOption struct{}\n\nfunc (EmptyHandlerChainOption) apply(*HandlerChain) {}\n\n// HandlerChainOptionFunc wraps a function that modifies HandlerChain into an\n// implementation of the HandlerChainOption interface.\ntype HandlerChainOptionFunc func(*HandlerChain)\n\nfunc (f HandlerChainOptionFunc) apply(do *HandlerChain) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _HandlerChainOptionWithDefault() HandlerChainOption {\n\treturn HandlerChainOptionFunc(func(*HandlerChain) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *HandlerChain) ApplyOptions(options ...HandlerChainOption) *HandlerChain {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/http/http_handler_interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"net/http\"\n\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n)\n\ntype HandlerInterceptor struct {\n\t//http middleware\n\tInterceptor func(h http.Handler) http.Handler\n}\n\nfunc NewHandlerInterceptor(opts ...HandlerInterceptorOption) *HandlerInterceptor {\n\thanders := &HandlerInterceptor{}\n\thanders.ApplyOptions(opts...)\n\treturn handers\n}\n\ntype HandlerChain struct {\n\t//invoke before http handler\n\tPreHandlers []func(w http.ResponseWriter, r *http.Request) error\n\tHandlers    []HandlerInterceptor\n\t//invoke after http handler\n\tPostHandlers []func(w http.ResponseWriter, r *http.Request)\n}\n\nfunc NewHandlerChain(opts ...HandlerChainOption) *HandlerChain {\n\tc := &HandlerChain{}\n\tc.ApplyOptions(opts...)\n\n\treturn c\n}\n\nfunc (c *HandlerChain) WrapH(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\n\t\tdefer runtime_.Recover()\n\n\t\tfor _, preH := range c.PreHandlers {\n\t\t\terr := preH(w, r)\n\t\t\tif err != nil {\n\t\t\t\t// assume PreHandler already process response by self\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\t// reverse iterate handlers, so called handler as registed order\n\t\tfor i := len(c.Handlers) - 1; i >= 0; i-- {\n\t\t\t// filter interceptor is nil\n\t\t\tif c.Handlers[i].Interceptor != nil {\n\t\t\t\tnext = c.Handlers[i].Interceptor(next)\n\t\t\t}\n\t\t}\n\n\t\tnext.ServeHTTP(w, r)\n\n\t\tfor _, postH := range c.PostHandlers {\n\t\t\tpostH(w, r)\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "go/net/http/http_handler_interceptor.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\n// A HandlerInterceptorOption sets options.\ntype HandlerInterceptorOption interface {\n\tapply(*HandlerInterceptor)\n}\n\n// EmptyHandlerInterceptorOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyHandlerInterceptorOption struct{}\n\nfunc (EmptyHandlerInterceptorOption) apply(*HandlerInterceptor) {}\n\n// HandlerInterceptorOptionFunc wraps a function that modifies HandlerInterceptor into an\n// implementation of the HandlerInterceptorOption interface.\ntype HandlerInterceptorOptionFunc func(*HandlerInterceptor)\n\nfunc (f HandlerInterceptorOptionFunc) apply(do *HandlerInterceptor) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _HandlerInterceptorOptionWithDefault() HandlerInterceptorOption {\n\treturn HandlerInterceptorOptionFunc(func(*HandlerInterceptor) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *HandlerInterceptor) ApplyOptions(options ...HandlerInterceptorOption) *HandlerInterceptor {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/http/http_host_context.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/kaydxh/golang/go/net/resolver\"\n)\n\ntype hostContextKey struct{}\n\ntype Host struct {\n\tHostTarget           string\n\tReplaceHostInRequest bool\n\n\tHostTargetAddrResolved resolver.Address\n}\n\nfunc FromContextHost(ctx context.Context) *Host {\n\thost, _ := ctx.Value(hostContextKey{}).(*Host)\n\treturn host\n}\n\nfunc WithContextHost(ctx context.Context, host *Host) context.Context {\n\tif host == nil {\n\t\tpanic(\"nil host\")\n\t}\n\treturn context.WithValue(ctx, hostContextKey{}, host)\n}\n\nfunc ParseTargetUrl(host string) (*url.URL, error) {\n\tif host == \"\" {\n\t\treturn nil, nil\n\t}\n\n\thostURL, err := url.Parse(host)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid host address %q: %v\", host, err)\n\t}\n\treturn hostURL, nil\n}\n"
  },
  {
    "path": "go/net/http/http_proxy_context.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/kaydxh/golang/go/net/resolver\"\n)\n\ntype proxyContextKey struct{}\n\ntype Proxy struct {\n\tProxyUrl    string\n\tProxyTarget string\n\n\tProxyAddrResolved resolver.Address\n}\n\nfunc FromContextProxy(ctx context.Context) *Proxy {\n\tproxy, _ := ctx.Value(proxyContextKey{}).(*Proxy)\n\treturn proxy\n}\n\nfunc WithContextProxy(ctx context.Context, proxy *Proxy) context.Context {\n\tif proxy == nil {\n\t\tpanic(\"nil proxy\")\n\t}\n\treturn context.WithValue(ctx, proxyContextKey{}, proxy)\n}\n\nfunc ParseProxyUrl(proxy string) (*url.URL, error) {\n\tif proxy == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tproxyURL, err := url.Parse(proxy)\n\tif err != nil ||\n\t\t(proxyURL.Scheme != \"http\" &&\n\t\t\tproxyURL.Scheme != \"https\" &&\n\t\t\tproxyURL.Scheme != \"socks5\") {\n\n\t\t//default use http://\n\t\tif proxyURL, err := url.Parse(\"http://\" + proxy); err == nil {\n\t\t\treturn proxyURL, nil\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid proxy address %q: %v\", proxy, err)\n\t}\n\treturn proxyURL, nil\n}\n"
  },
  {
    "path": "go/net/http/http_request_id.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n)\n\n// RequestIdKey is metadata key name for request ID\nconst (\n\tDefaultHTTPRequestIDKey = \"X-Request-ID\"\n\tDefaultHTTPTraceIDKey   = \"X-Traceid\"\n)\n\nfunc ExtractRequestIdHTTPAndContext(r *http.Request) string {\n\treturn ExtractHTTPAndContext(r, DefaultHTTPRequestIDKey)\n}\n\nfunc ExtractTraceIdHTTPAndContext(r *http.Request) string {\n\treturn ExtractHTTPAndContext(r, DefaultHTTPTraceIDKey)\n}\n\nfunc ExtractHTTPAndContext(r *http.Request, key string) string {\n\tif value := ExtractFromHTTP(r, key); value != \"\" {\n\t\treturn value\n\t}\n\n\treturn context_.ExtractFromContext(r.Context(), key)\n}\n\nfunc ExtractFromHTTP(r *http.Request, key string) string {\n\tif value := r.Header.Get(key); value != \"\" {\n\t\treturn value\n\t}\n\tif value := r.URL.Query().Get(key); value != \"\" {\n\t\treturn value\n\t}\n\tif value := r.FormValue(key); value != \"\" {\n\t\treturn value\n\t}\n\tif value := r.PostFormValue(key); value != \"\" {\n\t\treturn value\n\t}\n\n\treturn \"\"\n}\n\n/*\nfunc ExtractRequestIDFromContext(ctx context.Context) string {\n\n\tif v, ok := ctx.Value(DefaultHTTPRequestIDKey).(string); ok {\n\t\treturn v\n\t}\n\n\treturn \"\"\n}\n\nfunc ExtractFromContext(ctx context.Context, key string) string {\n\tswitch requestIDs := ctx.Value(key).(type) {\n\tcase string:\n\t\tif requestIDs != \"\" {\n\t\t\treturn requestIDs\n\t\t}\n\tcase []string:\n\t\tif len(requestIDs) > 0 {\n\t\t\treturn requestIDs[0]\n\t\t}\n\tdefault:\n\t\treturn \"\"\n\t}\n\n\treturn \"\"\n}\n*/\n\nfunc SetPairContext(r *http.Request, key, value string) *http.Request {\n\tctx := context.WithValue(r.Context(), key, value)\n\tr = r.WithContext(ctx)\n\n\treturn r\n}\n\nfunc SetRequestIdContext(r *http.Request, requestID string) *http.Request {\n\treturn SetPairContext(r, DefaultHTTPRequestIDKey, requestID)\n}\n\nfunc SetTraceIdContext(r *http.Request, traceID string) *http.Request {\n\treturn SetPairContext(r, DefaultHTTPTraceIDKey, traceID)\n}\n"
  },
  {
    "path": "go/net/http/http_round_trip.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport \"net/http\"\n\ntype RoundTripFunc func(req *http.Request) (resp *http.Response, err error)\n\nfunc (f RoundTripFunc) RoundTrip(req *http.Request) (resp *http.Response, err error) {\n\treturn f(req)\n}\n"
  },
  {
    "path": "go/net/http/http_transport.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"crypto/tls\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n)\n\nvar DefaultTransportInsecure = &http.Transport{\n\tProxy: http.ProxyFromEnvironment,\n\tDialContext: (&net.Dialer{\n\t\tTimeout:   30 * time.Second,\n\t\tKeepAlive: 30 * time.Second,\n\t}).DialContext,\n\tForceAttemptHTTP2:     true,\n\tMaxIdleConns:          100,\n\tIdleConnTimeout:       90 * time.Second,\n\tTLSHandshakeTimeout:   10 * time.Second,\n\tExpectContinueTimeout: 1 * time.Second,\n\n\t// skip verify for https\n\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n}\n\nvar DefaultTransportInsecureWithHostAndProxy = RoundTripperWithTarget(DefaultTransportInsecureWithProxy)\n"
  },
  {
    "path": "go/net/http/http_transport.host.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"net/http\"\n\n\tresolve_ \"github.com/kaydxh/golang/go/net/resolver/resolve\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc RequestWithContextTargetHost(req *http.Request, target *Host) *http.Request {\n\tif target == nil {\n\t\treturn req\n\t}\n\treturn req.WithContext(WithContextHost(req.Context(), target))\n}\n\nfunc TargetHostFuncFromContext(req *http.Request) error {\n\thost := FromContextHost(req.Context())\n\tif host == nil || host.HostTarget == \"\" {\n\t\treturn nil\n\t}\n\n\tif req.URL == nil {\n\t\treturn nil\n\t}\n\n\tif host.HostTarget == \"\" {\n\t\treturn nil\n\t}\n\n\t// replace host of host if target of host if resolved\n\taddress, err := resolve_.ResolveOne(req.Context(), host.HostTarget)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif address.Addr != \"\" {\n\t\treq.URL.Host = address.Addr\n\t}\n\thost.HostTargetAddrResolved = address\n\tif host.ReplaceHostInRequest {\n\t\treq.Host = req.URL.Host\n\t}\n\treturn nil\n}\n\nfunc RoundTripperWithTarget(rt http.RoundTripper) http.RoundTripper {\n\treturn RoundTripFunc(func(req *http.Request) (resp *http.Response, err error) {\n\n\t\tlogger := logrus.WithContext(req.Context())\n\t\tdefer func() {\n\t\t\tlogger.Infof(\"http request host: %v\", req.Host)\n\t\t}()\n\t\terr = TargetHostFuncFromContext(req)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn rt.RoundTrip(req)\n\t})\n}\n\nvar DefaultTransportInsecureWithHost = RoundTripperWithTarget(DefaultTransportInsecure)\n"
  },
  {
    "path": "go/net/http/http_transport.proxy.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"crypto/tls\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"time\"\n\n\tresolve_ \"github.com/kaydxh/golang/go/net/resolver/resolve\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc RequestWithContextProxy(req *http.Request, proxy *Proxy) *http.Request {\n\tif proxy == nil {\n\t\treturn req\n\t}\n\treturn req.WithContext(WithContextProxy(req.Context(), proxy))\n}\n\nfunc ProxyFuncFromContextOrEnvironment(req *http.Request) (*url.URL, error) {\n\tlogger := logrus.WithContext(req.Context())\n\tproxy := FromContextProxy(req.Context())\n\tif proxy == nil || proxy.ProxyUrl == \"\" {\n\t\treturn http.ProxyFromEnvironment(req)\n\t}\n\tdefer func() {\n\t\tlogger.Infof(\"http request proxy: %v\", proxy)\n\t}()\n\n\tproxyUrl, err := ParseProxyUrl(proxy.ProxyUrl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif proxyUrl == nil {\n\t\treturn nil, nil\n\t}\n\n\tif proxy.ProxyTarget == \"\" {\n\t\treturn proxyUrl, nil\n\t}\n\n\t// replace host of proxy if target of proxy if resolved\n\taddress, err := resolve_.ResolveOne(req.Context(), proxy.ProxyTarget)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif address.Addr != \"\" {\n\t\tproxyUrl.Host = address.Addr\n\t}\n\tproxy.ProxyAddrResolved = address\n\n\treturn proxyUrl, nil\n}\n\nvar DefaultTransportInsecureWithProxy http.RoundTripper = &http.Transport{\n\tProxy: ProxyFuncFromContextOrEnvironment,\n\tDialContext: (&net.Dialer{\n\t\tTimeout:   30 * time.Second,\n\t\tKeepAlive: 30 * time.Second,\n\t}).DialContext,\n\tForceAttemptHTTP2:     true,\n\tMaxIdleConns:          100,\n\tIdleConnTimeout:       90 * time.Second,\n\tTLSHandshakeTimeout:   10 * time.Second,\n\tExpectContinueTimeout: 1 * time.Second,\n\t// skip verify for https\n\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n}\n"
  },
  {
    "path": "go/net/http/ip.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"strings\"\n)\n\n// returns IP address from request.\n// It will lookup IP in  X-Forwarded-For and X-Real-IP headers.\nfunc GetIPFromRequest(r *http.Request) (net.IP, error) {\n\tif r == nil {\n\t\treturn nil, fmt.Errorf(\"http request is nil\")\n\t}\n\n\tip := r.Header.Get(\"X-Forwarded-For\")\n\tif ip != \"\" {\n\t\tparts := strings.SplitN(ip, \",\", 2)\n\t\tpart := strings.TrimSpace(parts[0])\n\t\treturn net.ParseIP(part), nil\n\t}\n\n\tip = strings.TrimSpace(r.Header.Get(\"X-Real-IP\"))\n\tif ip != \"\" {\n\t\treturn net.ParseIP(ip), nil\n\t}\n\n\tremoteAddr := strings.TrimSpace(r.RemoteAddr)\n\thost, _, err := net.SplitHostPort(remoteAddr)\n\tif err != nil {\n\t\treturn net.ParseIP(remoteAddr), err\n\t}\n\n\treturn net.ParseIP(host), nil\n}\n"
  },
  {
    "path": "go/net/http/response_writer.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage http\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// ResponseWriterWrapper\ntype ResponseWriterWrapper struct {\n\tw          http.ResponseWriter\n\tbody       bytes.Buffer\n\tstatusCode int\n}\n\nfunc NewResponseWriterWrapper(w http.ResponseWriter) *ResponseWriterWrapper {\n\treturn &ResponseWriterWrapper{\n\t\tw:          w,\n\t\tstatusCode: http.StatusOK,\n\t}\n}\n\nfunc (rww *ResponseWriterWrapper) Write(buf []byte) (int, error) {\n\trww.body.Write(buf)\n\treturn rww.w.Write(buf)\n}\n\n// Header function overwrites the http.ResponseWriter Header() function\nfunc (rww *ResponseWriterWrapper) Header() http.Header {\n\treturn rww.w.Header()\n}\n\n// WriteHeader function overwrites the http.ResponseWriter WriteHeader() function\nfunc (rww *ResponseWriterWrapper) WriteHeader(statusCode int) {\n\trww.statusCode = statusCode\n\trww.w.WriteHeader(statusCode)\n}\n\n// BodyBytes 返回已写入响应的原始 body 字节切片（不包含 headers 和 status code）。\n// 返回的是底层缓冲区的引用，调用方不应修改；如需长期持有请自行拷贝。\nfunc (rww *ResponseWriterWrapper) BodyBytes() []byte {\n\treturn rww.body.Bytes()\n}\n\n// StatusCode 返回当前响应的 HTTP 状态码。\nfunc (rww *ResponseWriterWrapper) StatusCode() int {\n\treturn rww.statusCode\n}\n\n//  String function pack respose header, http status code and body\nfunc (rww *ResponseWriterWrapper) String() string {\n\tvar buf bytes.Buffer\n\n\tbuf.WriteString(\"Headers:\")\n\tfor k, v := range rww.w.Header() {\n\t\tbuf.WriteString(fmt.Sprintf(\"%s: %v\", k, v))\n\t}\n\n\tbuf.WriteString(fmt.Sprintf(\" Status Code:%d\", rww.statusCode))\n\n\tbuf.WriteString(\" Body:\")\n\tbuf.WriteString(rww.body.String())\n\treturn buf.String()\n}\n"
  },
  {
    "path": "go/net/ip.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage net\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"strconv\"\n\n\thash_ \"github.com/kaydxh/golang/go/encoding/hash\"\n\tos_ \"github.com/kaydxh/golang/go/os\"\n)\n\n// This code is borrowed from https://github.com/uber/tchannel-go/blob/dev/localip.go\n\n// scoreAddr scores how likely the given addr is to be a remote address and returns the\n// IP to use when listening. Any address which receives a negative score should not be used.\n// Scores are calculated as:\n// -1 for any unknown IP addresses.\n// +300 for IPv4 addresses\n// +100 for non-local addresses, extra +100 for \"up\" interaces.\nfunc scoreAddr(iface net.Interface, addr net.Addr) (int, net.IP) {\n\tvar ip net.IP\n\tif netAddr, ok := addr.(*net.IPNet); ok {\n\t\tip = netAddr.IP\n\t} else if netIP, ok := addr.(*net.IPAddr); ok {\n\t\tip = netIP.IP\n\t} else {\n\t\treturn -1, nil\n\t}\n\n\tvar score int\n\tif ip.To4() != nil {\n\t\tscore += 300\n\t}\n\tif iface.Flags&net.FlagLoopback == 0 && !ip.IsLoopback() {\n\t\tscore += 100\n\t\tif iface.Flags&net.FlagUp != 0 {\n\t\t\tscore += 100\n\t\t}\n\t}\n\n\treturn score, ip\n}\n\n// HostIP tries to find an IP that can be used by other machines to reach this machine.\nfunc GetHostIP() (net.IP, error) {\n\tinterfaces, err := net.Interfaces()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbestScore := -1\n\tvar bestIP net.IP\n\t// Select the highest scoring IP as the best IP.\n\tfor _, iface := range interfaces {\n\t\taddrs, err := iface.Addrs()\n\t\tif err != nil {\n\t\t\t// Skip this interface if there is an error.\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, addr := range addrs {\n\t\t\tscore, ip := scoreAddr(iface, addr)\n\t\t\tif score > bestScore {\n\t\t\t\tbestScore = score\n\t\t\t\tbestIP = ip\n\t\t\t}\n\t\t}\n\t}\n\n\tif bestScore == -1 {\n\t\treturn nil, errors.New(\"no addresses to listen on\")\n\t}\n\n\treturn bestIP, nil\n}\n\nfunc GetLocalFirstIP() (string, error) {\n\tips, err := GetLocalIPs()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(ips) == 0 {\n\t\treturn \"\", fmt.Errorf(\"no valid ip\")\n\t}\n\n\treturn ips[0], nil\n}\n\nfunc GetLocalIPs() ([]string, error) {\n\tlocalAddrs, err := GetLocalAddrs()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar ips []string\n\tfor _, addr := range localAddrs {\n\t\tif addr.IP.To4() != nil && !addr.IP.IsLoopback() {\n\t\t\tips = append(ips, addr.IP.String())\n\t\t}\n\n\t}\n\n\treturn ips, nil\n}\n\nfunc GetLocalAddrs() ([]*net.IPNet, error) {\n\tvar localAddrs []*net.IPNet\n\taddrs, err := net.InterfaceAddrs()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, addr := range addrs {\n\t\tipNet, ok := addr.(*net.IPNet)\n\t\tif ok {\n\t\t\tlocalAddrs = append(localAddrs, ipNet)\n\t\t}\n\t}\n\n\treturn localAddrs, nil\n}\n\n// IsIPv4 returns if netIP is IPv4.\nfunc IsIPv4(netIP net.IP) bool {\n\treturn netIP != nil && netIP.To4() != nil\n}\n\nfunc IsIPv4String(ip string) bool {\n\tnetIP := ParseIP(ip)\n\treturn IsIPv4(netIP)\n}\n\nfunc LookupHostIPv4(host string) (addrs []string, err error) {\n\treturn LookupHostIPv4WithContext(context.Background(), host)\n}\n\nfunc LookupHostIPv4WithContext(ctx context.Context, host string) (addrs []string, err error) {\n\tips, err := net.DefaultResolver.LookupHost(ctx, host)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor _, ip := range ips {\n\t\tif IsIPv4String(ip) {\n\t\t\taddrs = append(addrs, ip)\n\t\t}\n\t}\n\n\treturn addrs, err\n}\n\n// SplitHostIntPort split host and integral port\nfunc SplitHostIntPort(s string) (string, int, error) {\n\thost, port, err := net.SplitHostPort(s)\n\tif err != nil {\n\t\treturn \"\", 0, err\n\t}\n\tportInt, err := strconv.Atoi(port)\n\tif err != nil {\n\t\treturn \"\", 0, err\n\t}\n\treturn host, portInt, err\n}\n\n// parseTarget takes the user input target string and default port, returns formatted host and port info.\n// If target doesn't specify a port, set the port to be the defaultPort.\n// If target is in IPv6 format and host-name is enclosed in square brackets, brackets\n// are stripped when setting the host.\n// examples:\n// target: \"www.google.com\" defaultPort: \"443\" returns host: \"www.google.com\", port: \"443\"\n// target: \"ipv4-host:80\" defaultPort: \"443\" returns host: \"ipv4-host\", port: \"80\"\n// target: \"[ipv6-host]\" defaultPort: \"443\" returns host: \"ipv6-host\", port: \"443\"\n// target: \":80\" defaultPort: \"443\" returns host: \"localhost\", port: \"80\"\nfunc ParseTarget(target, defaultPort string) (host, port string, err error) {\n\tif target == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"target is empty\")\n\t}\n\tif ip := net.ParseIP(target); ip != nil {\n\t\t// target is an IPv4 or IPv6(without brackets) address\n\t\treturn target, defaultPort, nil\n\t}\n\tif host, port, err = net.SplitHostPort(target); err == nil {\n\t\tif port == \"\" {\n\t\t\t// If the port field is empty (target ends with colon), e.g. \"[::1]:\", this is an error.\n\t\t\treturn \"\", \"\", fmt.Errorf(\"missing port after port-separator colon\")\n\t\t}\n\t\t// target has port, i.e ipv4-host:port, [ipv6-host]:port, host-name:port\n\t\tif host == \"\" {\n\t\t\t// Keep consistent with net.Dial(): If the host is empty, as in \":80\", the local system is assumed.\n\t\t\thost = \"localhost\"\n\t\t}\n\t\treturn host, port, nil\n\t}\n\tif host, port, err = net.SplitHostPort(target + \":\" + defaultPort); err == nil {\n\t\t// target doesn't have port\n\t\treturn host, port, nil\n\t}\n\treturn \"\", \"\", fmt.Errorf(\"invalid target address %v, error info: %v\", target, err)\n}\n\n// 1 get k8s pod name\n// 2 get ip:pid\nfunc GetServerName() string {\n\tserverName := fmt.Sprintf(\"%v:%v\", os.Getenv(\"POD_NAMESPACE\"), os.Getenv(\"POD_NAME\"))\n\tif serverName == \":\" {\n\t\tip, _ := GetHostIP()\n\t\tpid := os_.GetProcId()\n\t\treturn fmt.Sprintf(\"%s:%v\", ip.String(), pid)\n\t}\n\treturn serverName\n}\n\nfunc GetServerId() uint32 {\n\treturn hash_.HashCode(GetServerName())\n}\n"
  },
  {
    "path": "go/net/ip_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage net_test\n\nimport (\n\t\"net\"\n\t\"testing\"\n\n\tnet_ \"github.com/kaydxh/golang/go/net\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestGetLocalAddrs(t *testing.T) {\n\taddrs, err := net_.GetLocalAddrs()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get local addrs, err: %v\", err)\n\t\treturn\n\t}\n\tt.Logf(\"addrs: %v\", addrs)\n}\n\nfunc TestGetLocalIPs(t *testing.T) {\n\tips, err := net_.GetLocalIPs()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get local addrs, err: %v\", err)\n\t\treturn\n\t}\n\tt.Logf(\"ips: %v\", ips)\n}\n\nfunc TestGetLocalFirstIP(t *testing.T) {\n\tip, err := net_.GetLocalFirstIP()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get local first addr, err: %v\", err)\n\t\treturn\n\t}\n\tt.Logf(\"ip: %v\", ip)\n}\n\nfunc TestGetHostIP(t *testing.T) {\n\tip, err := net_.GetHostIP()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get host ip, err: %v\", err)\n\t\treturn\n\t}\n\tt.Logf(\"ip: %v\", ip.String())\n}\n\nfunc TestIsIPv4String(t *testing.T) {\n\tisIPv4 := net_.IsIPv4String(\"199.591.149.232\")\n\tassert.Equal(t, true, isIPv4)\n\tt.Logf(\"ipv4: %v\", isIPv4)\n}\n\nfunc TestLookupHost(t *testing.T) {\n\tips, err := net.LookupHost(\"www.google.com\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get host ip, err: %v\", err)\n\t\treturn\n\t}\n\tt.Logf(\"ips: %v\", ips)\n}\n\nfunc TestLookupHostIPv4(t *testing.T) {\n\tips, err := net_.LookupHostIPv4(\"www.google.com\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get host ip, err: %v\", err)\n\t\treturn\n\t}\n\tt.Logf(\"ips: %v\", ips)\n}\n\nfunc TestGetServerName(t *testing.T) {\n\tserverName := net_.GetServerName()\n\tt.Logf(\"serverName: %v\", serverName)\n}\n"
  },
  {
    "path": "go/net/mac.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage net\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\nfunc GetLocalFirstMac() (string, error) {\n\tinterfaces, err := net.Interfaces()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar macs []string\n\tfor _, netInterface := range interfaces {\n\t\tmac := netInterface.HardwareAddr.String()\n\t\tif len(mac) == 0 {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tmacs = append(macs, mac)\n\t\t}\n\t}\n\tif len(macs) == 0 {\n\t\treturn \"\", fmt.Errorf(\"no valid mac\")\n\t}\n\n\treturn macs[0], nil\n}\n\nfunc GetLocalMacs() ([]string, error) {\n\tinterfaces, err := net.Interfaces()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar macs []string\n\tfor _, netInterface := range interfaces {\n\t\tmac := netInterface.HardwareAddr.String()\n\t\tif len(mac) == 0 {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tmacs = append(macs, mac)\n\t\t}\n\t}\n\n\treturn macs, nil\n}\n"
  },
  {
    "path": "go/net/mac_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage net_test\n\nimport (\n\t\"testing\"\n\n\tnet_ \"github.com/kaydxh/golang/go/net\"\n)\n\nfunc TestGetLocalMacs(t *testing.T) {\n\tmacs, err := net_.GetLocalMacs()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get local addrs, err: %v\", err)\n\t\treturn\n\t}\n\tt.Logf(\"macs: %v\", macs)\n}\n\nfunc TestGetLocalFirstMac(t *testing.T) {\n\tmac, err := net_.GetLocalFirstMac()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get local first addr, err: %v\", err)\n\t\treturn\n\t}\n\tt.Logf(\"mac: %v\", mac)\n}\n"
  },
  {
    "path": "go/net/parse.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage net\n\nimport \"net\"\n\n// ParseIP parses s as an IP address, returning the result.\n// The string s can be in IPv4 dotted decimal (\"192.0.2.1\"), IPv6\n// (\"2001:db8::68\"), or IPv4-mapped IPv6 (\"::ffff:192.0.2.1\") form.\n// If s is not a valid textual representation of an IP address,\n// ParseIP returns nil.\nfunc ParseIP(s string) net.IP {\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tcase '.':\n\t\t\treturn parseIPv4(s)\n\t\tcase ':':\n\t\t\treturn parseIPv6(s)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Parse IPv4 address (d.d.d.d).\nfunc parseIPv4(s string) net.IP {\n\tvar p [net.IPv4len]byte\n\tfor i := 0; i < net.IPv4len; i++ {\n\t\tif len(s) == 0 {\n\t\t\t// Missing octets.\n\t\t\treturn nil\n\t\t}\n\t\tif i > 0 {\n\t\t\tif s[0] != '.' {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\ts = s[1:]\n\t\t}\n\t\tn, c, ok := dtoi(s)\n\t\tif !ok || n > 0xFF {\n\t\t\treturn nil\n\t\t}\n\t\t//\n\t\t// NOTE: This correct check was added for go-1.17, but is a\n\t\t// backwards-incompatible change for kubernetes users, who might have\n\t\t// stored data which uses these leading zeroes already.\n\t\t//\n\t\t// See https://issue.k8s.io/100895\n\t\t//\n\t\t//if c > 1 && s[0] == '0' {\n\t\t//\t// Reject non-zero components with leading zeroes.\n\t\t//\treturn nil\n\t\t//}\n\t\ts = s[c:]\n\t\tp[i] = byte(n)\n\t}\n\tif len(s) != 0 {\n\t\treturn nil\n\t}\n\treturn net.IPv4(p[0], p[1], p[2], p[3])\n}\n\n// parseIPv6 parses s as a literal IPv6 address described in RFC 4291\n// and RFC 5952.\nfunc parseIPv6(s string) (ip net.IP) {\n\tip = make(net.IP, net.IPv6len)\n\tellipsis := -1 // position of ellipsis in ip\n\n\t// Might have leading ellipsis\n\tif len(s) >= 2 && s[0] == ':' && s[1] == ':' {\n\t\tellipsis = 0\n\t\ts = s[2:]\n\t\t// Might be only ellipsis\n\t\tif len(s) == 0 {\n\t\t\treturn ip\n\t\t}\n\t}\n\n\t// Loop, parsing hex numbers followed by colon.\n\ti := 0\n\tfor i < net.IPv6len {\n\t\t// Hex number.\n\t\tn, c, ok := xtoi(s)\n\t\tif !ok || n > 0xFFFF {\n\t\t\treturn nil\n\t\t}\n\n\t\t// If followed by dot, might be in trailing IPv4.\n\t\tif c < len(s) && s[c] == '.' {\n\t\t\tif ellipsis < 0 && i != net.IPv6len-net.IPv4len {\n\t\t\t\t// Not the right place.\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif i+net.IPv4len > net.IPv6len {\n\t\t\t\t// Not enough room.\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tip4 := parseIPv4(s)\n\t\t\tif ip4 == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tip[i] = ip4[12]\n\t\t\tip[i+1] = ip4[13]\n\t\t\tip[i+2] = ip4[14]\n\t\t\tip[i+3] = ip4[15]\n\t\t\ts = \"\"\n\t\t\ti += net.IPv4len\n\t\t\tbreak\n\t\t}\n\n\t\t// Save this 16-bit chunk.\n\t\tip[i] = byte(n >> 8)\n\t\tip[i+1] = byte(n)\n\t\ti += 2\n\n\t\t// Stop at end of string.\n\t\ts = s[c:]\n\t\tif len(s) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// Otherwise must be followed by colon and more.\n\t\tif s[0] != ':' || len(s) == 1 {\n\t\t\treturn nil\n\t\t}\n\t\ts = s[1:]\n\n\t\t// Look for ellipsis.\n\t\tif s[0] == ':' {\n\t\t\tif ellipsis >= 0 { // already have one\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tellipsis = i\n\t\t\ts = s[1:]\n\t\t\tif len(s) == 0 { // can be at end\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// Must have used entire string.\n\tif len(s) != 0 {\n\t\treturn nil\n\t}\n\n\t// If didn't parse enough, expand ellipsis.\n\tif i < net.IPv6len {\n\t\tif ellipsis < 0 {\n\t\t\treturn nil\n\t\t}\n\t\tn := net.IPv6len - i\n\t\tfor j := i - 1; j >= ellipsis; j-- {\n\t\t\tip[j+n] = ip[j]\n\t\t}\n\t\tfor j := ellipsis + n - 1; j >= ellipsis; j-- {\n\t\t\tip[j] = 0\n\t\t}\n\t} else if ellipsis >= 0 {\n\t\t// Ellipsis must represent at least one 0 group.\n\t\treturn nil\n\t}\n\treturn ip\n}\n\n// Bigger than we need, not too big to worry about overflow\nconst big = 0xFFFFFF\n\n// Decimal to integer.\n// Returns number, characters consumed, success.\nfunc dtoi(s string) (n int, i int, ok bool) {\n\tn = 0\n\tfor i = 0; i < len(s) && '0' <= s[i] && s[i] <= '9'; i++ {\n\t\tn = n*10 + int(s[i]-'0')\n\t\tif n >= big {\n\t\t\treturn big, i, false\n\t\t}\n\t}\n\tif i == 0 {\n\t\treturn 0, 0, false\n\t}\n\treturn n, i, true\n}\n\n// Hexadecimal to integer.\n// Returns number, characters consumed, success.\nfunc xtoi(s string) (n int, i int, ok bool) {\n\tn = 0\n\tfor i = 0; i < len(s); i++ {\n\t\tif '0' <= s[i] && s[i] <= '9' {\n\t\t\tn *= 16\n\t\t\tn += int(s[i] - '0')\n\t\t} else if 'a' <= s[i] && s[i] <= 'f' {\n\t\t\tn *= 16\n\t\t\tn += int(s[i]-'a') + 10\n\t\t} else if 'A' <= s[i] && s[i] <= 'F' {\n\t\t\tn *= 16\n\t\t\tn += int(s[i]-'A') + 10\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tif n >= big {\n\t\t\treturn 0, i, false\n\t\t}\n\t}\n\tif i == 0 {\n\t\treturn 0, i, false\n\t}\n\treturn n, i, true\n}\n"
  },
  {
    "path": "go/net/resolver/build.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport (\n\t\"context\"\n\t\"net\"\n)\n\n// Address represents a server the client connects to.\n//\n// Experimental\n//\n// Notice: This type is EXPERIMENTAL and may be changed or removed in a\n// later release.\ntype Address struct {\n\t// Addr is the server address on which a connection will be established.\n\tAddr string\n\n\t// ServerName is the name of this address.\n\t// If non-empty, the ServerName is used as the transport certification authority for\n\t// the address, instead of the hostname from the Dial target string. In most cases,\n\t// this should not be set.\n\t//\n\t// If Type is GRPCLB, ServerName should be the name of the remote load\n\t// balancer, not the name of the backend.\n\t//\n\t// WARNING: ServerName must only be populated with trusted values. It\n\t// is insecure to populate it with data from untrusted inputs since untrusted\n\t// values could be used to bypass the authority checks performed by TLS.\n\tServerName string\n}\n\n// State contains the current Resolver state relevant to the ClientConn.\ntype State struct {\n\t// Addresses is the latest set of resolved addresses for the target.\n\tAddresses []Address\n}\n\n// ClientConn contains the callbacks for resolver to notify any updates\n// to the gRPC ClientConn.\n//\n// This interface is to be implemented by gRPC. Users should not need a\n// brand new implementation of this interface. For the situations like\n// testing, the new implementation should embed this interface. This allows\n// gRPC to add new methods to this interface.\ntype ClientConn interface {\n\t// UpdateState updates the state of the ClientConn appropriately.\n\tUpdateState(State) error\n\t// ReportError notifies the ClientConn that the Resolver encountered an\n\t// error.  The ClientConn will notify the load balancer and begin calling\n\t// ResolveNow on the Resolver with exponential backoff.\n\tReportError(error)\n}\n\ntype ResolverBuildOptions struct {\n\t// if cc is not nil, will update client connection state when resolved\n\tCc ClientConn\n\t// Dialer is the custom dialer used by the ClientConn for dialling the\n\t// target gRPC service (set via WithDialer). In cases where a name\n\t// resolution service requires the same dialer, the resolver may use this\n\t// field. In most cases though, it is not appropriate, and this field may\n\t// be ignored.\n\tDialer func(context.Context, string) (net.Conn, error)\n}\n\n/*\ntype ResolverBuild struct {\n\tOpts ResolverBuildOptions\n}\n\nfunc NewResolverBuild() {\n}\n*/\n\n// Builder creates a resolver that will be used to watch name resolution updates.\ntype Builder interface {\n\t// Build creates a new resolver for the given target\n\t//\n\t// gRPC dial calls Build synchronously, and fails if the returned error is\n\t// not nil.\n\t// Note: only call once for one schema, or will memory leak\n\tBuild(target Target, opts ...ResolverBuildOption) (Resolver, error)\n\t// Scheme returns the scheme supported by this resolver.\n\t// Scheme is defined at https://github.com/grpc/grpc/blob/master/doc/naming.md.\n\tScheme() string\n}\n"
  },
  {
    "path": "go/net/resolver/build.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport (\n\t\"context\"\n\t\"net\"\n)\n\nfunc WithBuildDialer(dialer func(context.Context, string) (net.Conn, error)) ResolverBuildOptionFunc {\n\treturn ResolverBuildOptionFunc(func(b *ResolverBuildOptions) {\n\t\tb.Dialer = dialer\n\t})\n}\n"
  },
  {
    "path": "go/net/resolver/build_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\n// A ResolverBuildOption sets options.\ntype ResolverBuildOption interface {\n\tapply(*ResolverBuildOptions)\n}\n\n// EmptyResolverBuildUrlOption does not alter the ResolverBuilduration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyResolverBuildOption struct{}\n\nfunc (EmptyResolverBuildOption) apply(*ResolverBuildOptions) {}\n\n// ResolverBuildOptionFunc wraps a function that modifies ResolverBuildOptions into an\n// implementation of the ResolverBuildOption interface.\ntype ResolverBuildOptionFunc func(*ResolverBuildOptions)\n\nfunc (f ResolverBuildOptionFunc) apply(do *ResolverBuildOptions) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ResolverBuildOptionWithDefault() ResolverBuildOption {\n\treturn ResolverBuildOptionFunc(func(*ResolverBuildOptions) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *ResolverBuildOptions) ApplyOptions(options ...ResolverBuildOption) *ResolverBuildOptions {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/resolver/dns/dns_resolver.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage dns\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\trand_ \"github.com/kaydxh/golang/go/math/rand\"\n\tnet_ \"github.com/kaydxh/golang/go/net\"\n\t\"github.com/kaydxh/golang/go/net/resolver\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n)\n\n// EnableSRVLookups controls whether the DNS resolver attempts to fetch gRPCLB\n// addresses from SRV records.  Must not be changed after init time.\nvar EnableSRVLookups = false\n\n// Globals to stub out in tests. TODO: Perhaps these two can be combined into a\n// single variable for testing the resolver?\nvar (\n\tnewTimer = time.NewTimer\n)\n\nfunc init() {\n\tresolver.Register(NewBuilder())\n}\n\nconst (\n\tdefaultPort       = \"443\"\n\tdefaultDNSSvrPort = \"53\"\n)\n\nvar (\n\tdefaultResolver netResolver = net.DefaultResolver\n\t// To prevent excessive re-resolution, we enforce a rate limit on DNS\n\t// resolution requests.\n\tdefaultSyncInterval = 30 * time.Second\n)\n\nvar customAuthorityDialler = func(authority string) func(ctx context.Context, network, address string) (net.Conn, error) {\n\treturn func(ctx context.Context, network, address string) (net.Conn, error) {\n\t\tvar dialer net.Dialer\n\t\treturn dialer.DialContext(ctx, network, authority)\n\t}\n}\n\nvar customAuthorityResolver = func(authority string) (netResolver, error) {\n\thost, port, err := net_.ParseTarget(authority, defaultDNSSvrPort)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tauthorityWithPort := net.JoinHostPort(host, port)\n\n\treturn &net.Resolver{\n\t\tPreferGo: true,\n\t\tDial:     customAuthorityDialler(authorityWithPort),\n\t}, nil\n}\n\n// NewBuilder creates a dnsBuilder which is used to factory DNS resolvers.\nfunc NewBuilder(opts ...dnsBuilderOption) resolver.Builder {\n\tb := &dnsBuilder{}\n\tb.ApplyOptions(opts...)\n\tif b.opts.syncInterval == 0 {\n\t\tb.opts.syncInterval = defaultSyncInterval\n\t}\n\n\treturn b\n}\n\ntype dnsBuilder struct {\n\topts struct {\n\t\tsyncInterval time.Duration\n\t}\n}\n\n// Build creates and starts a DNS resolver that watches the name resolution of the target.\nfunc (b *dnsBuilder) Build(target resolver.Target, opts ...resolver.ResolverBuildOption) (resolver.Resolver, error) {\n\tvar opt resolver.ResolverBuildOptions\n\topt.ApplyOptions(opts...)\n\thost, port, err := net_.ParseTarget(target.Endpoint, defaultPort)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcc := opt.Cc\n\n\t// IP address.\n\tif ipAddr, ok := formatIP(host); ok {\n\t\taddr := []resolver.Address{{Addr: ipAddr + \":\" + port}}\n\t\tif cc != nil {\n\t\t\tcc.UpdateState(resolver.State{Addresses: addr})\n\t\t}\n\t\treturn deadResolver{\n\t\t\taddrs: addr,\n\t\t}, nil\n\t}\n\n\t// DNS address (non-IP).\n\tctx, cancel := context.WithCancel(context.Background())\n\td := &dnsResolver{\n\t\thost:         host,\n\t\tport:         port,\n\t\tsyncInterval: b.opts.syncInterval,\n\t\tctx:          ctx,\n\t\tcancel:       cancel,\n\t\tcc:           cc,\n\t\trn:           make(chan struct{}, 1),\n\t}\n\n\tif target.Authority == \"\" {\n\t\td.resolver = defaultResolver\n\t} else {\n\t\td.resolver, err = customAuthorityResolver(target.Authority)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\td.wg.Add(1)\n\tgo d.watcher()\n\treturn d, nil\n}\n\n// Scheme returns the naming scheme of this resolver builder, which is \"dns\".\nfunc (b *dnsBuilder) Scheme() string {\n\treturn \"dns\"\n}\n\ntype netResolver interface {\n\tLookupHost(ctx context.Context, host string) (addrs []string, err error)\n\tLookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error)\n\tLookupTXT(ctx context.Context, name string) (txts []string, err error)\n}\n\n// deadResolver is a resolver that does nothing.\ntype deadResolver struct {\n\taddrs []resolver.Address\n}\n\nfunc (d deadResolver) ResolveOne(opts ...resolver.ResolveOneOption) (resolver.Address, error) {\n\tvar opt resolver.ResolveOneOptions\n\topt.ApplyOptions(opts...)\n\n\taddrs, err := d.ResolveAll(resolver.WithIPTypeForResolveAll(opt.IPType))\n\tif err != nil {\n\t\treturn resolver.Address{}, err\n\t}\n\n\tswitch opt.PickMode {\n\tcase resolver.Resolver_pick_mode_random:\n\t\treturn addrs[rand_.Intn(len(addrs))], nil\n\tcase resolver.Resolver_pick_mode_first:\n\t\treturn addrs[0], nil\n\tdefault:\n\t\treturn addrs[rand_.Intn(len(addrs))], nil\n\n\t}\n}\n\nfunc (d deadResolver) ResolveAll(opts ...resolver.ResolveAllOption) ([]resolver.Address, error) {\n\tvar opt resolver.ResolveAllOptions\n\topt.ApplyOptions(opts...)\n\tif len(d.addrs) == 0 {\n\t\treturn nil, fmt.Errorf(\"resolve target's addresses are empty\")\n\t}\n\n\tvar pickAddrs []resolver.Address\n\tif opt.IPType == resolver.Resolver_ip_type_all {\n\t\tpickAddrs = d.addrs\n\t} else {\n\t\tfor _, addr := range d.addrs {\n\t\t\tv4 := (opt.IPType == resolver.Resolver_ip_type_v4)\n\t\t\tip, _, _ := net_.SplitHostIntPort(addr.Addr)\n\t\t\tif net_.IsIPv4String(ip) {\n\t\t\t\tif v4 {\n\t\t\t\t\tpickAddrs = append(pickAddrs, addr)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//v6\n\t\t\t\tif !v4 {\n\t\t\t\t\tpickAddrs = append(pickAddrs, addr)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif len(pickAddrs) == 0 {\n\t\treturn nil, fmt.Errorf(\"resolve target's addresses type[%v] are empty\", opt.IPType)\n\t}\n\treturn pickAddrs, nil\n}\n\nfunc (deadResolver) ResolveNow(opts ...resolver.ResolveNowOption) {}\n\nfunc (deadResolver) Close() {}\n\n// dnsResolver watches for the name resolution update for a non-IP target.\ntype dnsResolver struct {\n\thost         string\n\tport         string\n\tresolver     netResolver\n\tsyncInterval time.Duration\n\n\tctx    context.Context\n\tcancel context.CancelFunc\n\tcc     resolver.ClientConn\n\t// rn channel is used by ResolveNow() to force an immediate resolution of the target.\n\trn chan struct{}\n\t// wg is used to enforce Close() to return after the watcher() goroutine has finished.\n\t// Otherwise, data race will be possible. [Race Example] in dns_resolver_test we\n\t// replace the real lookup functions with mocked ones to facilitate testing.\n\t// If Close() doesn't wait for watcher() goroutine finishes, race detector sometimes\n\t// will warns lookup (READ the lookup function pointers) inside watcher() goroutine\n\t// has data race with replaceNetFunc (WRITE the lookup function pointers).\n\twg sync.WaitGroup\n}\n\nfunc (d *dnsResolver) ResolveOne(opts ...resolver.ResolveOneOption) (resolver.Address, error) {\n\tvar opt resolver.ResolveOneOptions\n\topt.ApplyOptions(opts...)\n\n\taddrs, err := d.ResolveAll(resolver.WithIPTypeForResolveAll(opt.IPType))\n\tif err != nil {\n\t\treturn resolver.Address{}, err\n\t}\n\n\tswitch opt.PickMode {\n\tcase resolver.Resolver_pick_mode_random:\n\t\treturn addrs[rand_.Intn(len(addrs))], nil\n\tcase resolver.Resolver_pick_mode_first:\n\t\treturn addrs[0], nil\n\tdefault:\n\t\treturn addrs[rand_.Intn(len(addrs))], nil\n\n\t}\n}\n\nfunc (d *dnsResolver) ResolveAll(opts ...resolver.ResolveAllOption) ([]resolver.Address, error) {\n\tvar opt resolver.ResolveAllOptions\n\topt.ApplyOptions(opts...)\n\td.ResolveNow()\n\taddrs, err := d.lookupHost()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(addrs) == 0 {\n\t\treturn nil, fmt.Errorf(\"resolve target's addresses are empty\")\n\t}\n\n\tvar pickAddrs []resolver.Address\n\tif opt.IPType == resolver.Resolver_ip_type_all {\n\t\tpickAddrs = addrs\n\t} else {\n\t\tfor _, addr := range addrs {\n\t\t\tv4 := (opt.IPType == resolver.Resolver_ip_type_v4)\n\t\t\tip, _, _ := net_.SplitHostIntPort(addr.Addr)\n\t\t\tif net_.IsIPv4String(ip) {\n\t\t\t\tif v4 {\n\t\t\t\t\tpickAddrs = append(pickAddrs, addr)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//v6\n\t\t\t\tif !v4 {\n\t\t\t\t\tpickAddrs = append(pickAddrs, addr)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif len(pickAddrs) == 0 {\n\t\treturn nil, fmt.Errorf(\"resolve target's addresses type[%v] are empty\", opt.IPType)\n\t}\n\treturn pickAddrs, nil\n}\n\n// ResolveNow invoke an immediate resolution of the target that this dnsResolver watches.\nfunc (d *dnsResolver) ResolveNow(opts ...resolver.ResolveNowOption) {\n\tselect {\n\tcase d.rn <- struct{}{}:\n\tdefault:\n\t}\n}\n\n// Close closes the dnsResolver.\nfunc (d *dnsResolver) Close() {\n\td.cancel()\n\td.wg.Wait()\n}\n\nfunc (d *dnsResolver) watcher() {\n\tdefer d.wg.Done()\n\n\tbackoff := time_.NewExponentialBackOff()\n\tfor {\n\t\taddrs, err := d.lookupHost()\n\t\tif d.cc != nil {\n\t\t\tif err != nil {\n\t\t\t\t// Report error to the underlying grpc.ClientConn.\n\t\t\t\td.cc.ReportError(err)\n\t\t\t} else {\n\t\t\t\terr = d.cc.UpdateState(resolver.State{Addresses: addrs})\n\t\t\t}\n\t\t}\n\n\t\tvar timer *time.Timer\n\t\tif err == nil {\n\t\t\t// Success resolving, wait for the next ResolveNow. However, also wait 30 seconds at the very least\n\t\t\t// to prevent constantly re-resolving.\n\t\t\tbackoff.Reset()\n\t\t\ttimer = newTimer(d.syncInterval)\n\t\t\tselect {\n\t\t\tcase <-d.ctx.Done():\n\t\t\t\ttimer.Stop()\n\t\t\t\treturn\n\t\t\tcase <-d.rn:\n\t\t\t}\n\t\t} else {\n\t\t\t// Poll on an error found in DNS Resolver or an error received from ClientConn.\n\t\t\tactualInterval, _ := backoff.NextBackOff()\n\t\t\ttimer = newTimer(actualInterval)\n\t\t}\n\t\tselect {\n\t\tcase <-d.ctx.Done():\n\t\t\ttimer.Stop()\n\t\t\treturn\n\t\tcase <-timer.C:\n\t\t}\n\t}\n}\n\nfunc (d *dnsResolver) lookupSRV() ([]resolver.Address, error) {\n\tif !EnableSRVLookups {\n\t\treturn nil, nil\n\t}\n\tvar newAddrs []resolver.Address\n\t_, srvs, err := d.resolver.LookupSRV(d.ctx, \"grpclb\", \"tcp\", d.host)\n\tif err != nil {\n\t\terr = handleDNSError(err, \"SRV\") // may become nil\n\t\treturn nil, err\n\t}\n\tfor _, s := range srvs {\n\t\tlbAddrs, err := d.resolver.LookupHost(d.ctx, s.Target)\n\t\tif err != nil {\n\t\t\terr = handleDNSError(err, \"A\") // may become nil\n\t\t\tif err == nil {\n\t\t\t\t// If there are other SRV records, look them up and ignore this\n\t\t\t\t// one that does not exist.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, a := range lbAddrs {\n\t\t\tip, ok := formatIP(a)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"dns: error parsing A record IP address %v\", a)\n\t\t\t}\n\t\t\taddr := ip + \":\" + strconv.Itoa(int(s.Port))\n\t\t\tnewAddrs = append(newAddrs, resolver.Address{Addr: addr, ServerName: s.Target})\n\t\t}\n\t}\n\treturn newAddrs, nil\n}\n\nfunc handleDNSError(err error, lookupType string) error {\n\tif dnsErr, ok := err.(*net.DNSError); ok && !dnsErr.IsTimeout && !dnsErr.IsTemporary {\n\t\t// Timeouts and temporary errors should be communicated to gRPC to\n\t\t// attempt another DNS query (with backoff).  Other errors should be\n\t\t// suppressed (they may represent the absence of a TXT record).\n\t\treturn nil\n\t}\n\tif err != nil {\n\t\terr = fmt.Errorf(\"dns: %v record lookup error: %v\", lookupType, err)\n\t}\n\treturn err\n}\n\nfunc (d *dnsResolver) lookupHost() ([]resolver.Address, error) {\n\taddrs, err := d.resolver.LookupHost(d.ctx, d.host)\n\tif err != nil {\n\t\terr = handleDNSError(err, \"A\")\n\t\treturn nil, err\n\t}\n\tnewAddrs := make([]resolver.Address, 0, len(addrs))\n\tfor _, a := range addrs {\n\t\tip, ok := formatIP(a)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"dns: error parsing A record IP address %v\", a)\n\t\t}\n\t\taddr := ip + \":\" + d.port\n\t\tnewAddrs = append(newAddrs, resolver.Address{Addr: addr})\n\t}\n\treturn newAddrs, nil\n}\n\n// formatIP returns ok = false if addr is not a valid textual representation of an IP address.\n// If addr is an IPv4 address, return the addr and ok = true.\n// If addr is an IPv6 address, return the addr enclosed in square brackets and ok = true.\nfunc formatIP(addr string) (addrIP string, ok bool) {\n\tip := net.ParseIP(addr)\n\tif ip == nil {\n\t\treturn \"\", false\n\t}\n\tif ip.To4() != nil {\n\t\treturn addr, true\n\t}\n\treturn \"[\" + addr + \"]\", true\n}\n"
  },
  {
    "path": "go/net/resolver/dns/dns_resolver_builder.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage dns\n\nimport (\n\t\"time\"\n)\n\nfunc WithSyncInterval(syncInterval time.Duration) dnsBuilderOption {\n\treturn dnsBuilderOptionFunc(func(c *dnsBuilder) {\n\t\tc.opts.syncInterval = syncInterval\n\t})\n}\n"
  },
  {
    "path": "go/net/resolver/dns/dns_resolver_builder_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage dns\n\n// A dnsBuilderOption sets options.\ntype dnsBuilderOption interface {\n\tapply(*dnsBuilder)\n}\n\n// EmptydnsBuilderUrlOption does not alter the dnsBuilderuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptydnsBuilderOption struct{}\n\nfunc (EmptydnsBuilderOption) apply(*dnsBuilder) {}\n\n// dnsBuilderOptionFunc wraps a function that modifies dnsBuilder into an\n// implementation of the dnsBuilderOption interface.\ntype dnsBuilderOptionFunc func(*dnsBuilder)\n\nfunc (f dnsBuilderOptionFunc) apply(do *dnsBuilder) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _dnsBuilderOptionWithDefault() dnsBuilderOption {\n\treturn dnsBuilderOptionFunc(func(*dnsBuilder) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *dnsBuilder) ApplyOptions(options ...dnsBuilderOption) *dnsBuilder {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/resolver/passthrough/passthrough.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage passthrough\n\nimport (\n\t\"github.com/kaydxh/golang/go/net/resolver\"\n)\n\nconst scheme = \"passthrough\"\n\ntype passthroughBuilder struct{}\n\nfunc (*passthroughBuilder) Build(target resolver.Target, opts ...resolver.ResolverBuildOption) (resolver.Resolver, error) {\n\tvar opt resolver.ResolverBuildOptions\n\topt.ApplyOptions(opts...)\n\tr := &passthroughResolver{\n\t\ttarget: target,\n\t}\n\treturn r, nil\n}\n\nfunc (*passthroughBuilder) Scheme() string {\n\treturn scheme\n}\n\ntype passthroughResolver struct {\n\ttarget resolver.Target\n}\n\nfunc (r *passthroughResolver) ResolveOne(opts ...resolver.ResolveOneOption) (resolver.Address, error) {\n\treturn resolver.Address{Addr: r.target.Endpoint}, nil\n}\n\nfunc (r *passthroughResolver) ResolveAll(opts ...resolver.ResolveAllOption) ([]resolver.Address, error) {\n\treturn []resolver.Address{{Addr: r.target.Endpoint}}, nil\n}\n\nfunc (r *passthroughResolver) ResolveNow(opts ...resolver.ResolveNowOption) {}\n\nfunc (*passthroughResolver) Close() {}\n\nfunc init() {\n\tresolver.Register(&passthroughBuilder{})\n}\n"
  },
  {
    "path": "go/net/resolver/register.reslover.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport \"sync\"\n\nvar (\n\tbuilderMu   sync.RWMutex\n\tresolversMu sync.RWMutex\n\t// m is a map from scheme to resolver builder.\n\tm            = make(map[string]Builder)\n\tresolverPool = make(map[string]Resolver)\n\t// defaultScheme is the default scheme to use.\n\tdefaultScheme = \"passthrough\"\n)\n\n// TODO(bar) install dns resolver in init(){}.\n\n// Register registers the resolver builder to the resolver map. b.Scheme will be\n// used as the scheme registered with this builder.\n//\nfunc Register(b Builder) {\n\tbuilderMu.Lock()\n\tdefer builderMu.Unlock()\n\n\tif b == nil {\n\t\tpanic(\"register builder is nil\")\n\t}\n\tif _, ok := m[b.Scheme()]; ok {\n\t\tpanic(\"double register scheme \" + b.Scheme())\n\t}\n\tm[b.Scheme()] = b\n}\n\n// Get returns the resolver builder registered with the given scheme.\n//\n// If no builder is register with the scheme, nil will be returned.\nfunc Get(scheme string) Builder {\n\tbuilderMu.Lock()\n\tdefer builderMu.Unlock()\n\n\tif b, ok := m[scheme]; ok {\n\t\treturn b\n\t}\n\treturn nil\n}\n\nfunc GetDefault() Builder {\n\tbuilderMu.Lock()\n\tdefer builderMu.Unlock()\n\n\tif b, ok := m[defaultScheme]; ok {\n\t\treturn b\n\t}\n\treturn nil\n}\n\nfunc getResolver(target string) Resolver {\n\tresolversMu.Lock()\n\tdefer resolversMu.Unlock()\n\n\tif b, ok := resolverPool[target]; ok {\n\t\treturn b\n\t}\n\treturn nil\n}\n\nfunc setResolver(target string, r Resolver) {\n\tresolversMu.Lock()\n\tdefer resolversMu.Unlock()\n\n\tif r == nil {\n\t\tpanic(\"register resolver is nil\")\n\t}\n\tif _, ok := resolverPool[target]; ok {\n\t\tpanic(\"double register target \" + target)\n\t}\n\tresolverPool[target] = r\n}\n\n// SetDefaultScheme sets the default scheme that will be used. The default\n// default scheme is \"passthrough\".\n//\n// NOTE: this function must only be called during initialization time (i.e. in\n// an init() function), and is not thread-safe. The scheme set last overrides\n// previously set values.\nfunc SetDefaultScheme(scheme string) {\n\tdefaultScheme = scheme\n}\n\n// GetDefaultScheme gets the default scheme that will be used.\nfunc GetDefaultScheme() string {\n\treturn defaultScheme\n}\n"
  },
  {
    "path": "go/net/resolver/resolve/resolve.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolve\n\nimport (\n\t\"context\"\n\n\t\"github.com/kaydxh/golang/go/net/resolver\"\n\t_ \"github.com/kaydxh/golang/go/net/resolver/dns\"\n\t_ \"github.com/kaydxh/golang/go/net/resolver/passthrough\"\n\t_ \"github.com/kaydxh/golang/go/net/resolver/unix\"\n)\n\nfunc ResolveOne(ctx context.Context, target string, opts ...resolver.ResolveOneOption) (resolver.Address, error) {\n\tr, err := resolver.GetResolver(ctx, target)\n\tif err != nil {\n\t\treturn resolver.Address{}, err\n\t}\n\treturn r.ResolveOne(opts...)\n}\n\nfunc ResolveAll(ctx context.Context, target string, opts ...resolver.ResolveAllOption) ([]resolver.Address, error) {\n\tr, err := resolver.GetResolver(ctx, target)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r.ResolveAll(opts...)\n}\n"
  },
  {
    "path": "go/net/resolver/resolve.all.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nfunc WithIPTypeForResolveAll(ipType Resolver_IPType) ResolveAllOptionFunc {\n\treturn ResolveAllOptionFunc(func(r *ResolveAllOptions) {\n\t\tr.IPType = ipType\n\t})\n}\n"
  },
  {
    "path": "go/net/resolver/resolve.all_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\n// A ResolveAllOption sets options.\ntype ResolveAllOption interface {\n\tapply(*ResolveAllOptions)\n}\n\n// EmptyResolveAllUrlOption does not alter the ResolveAlluration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyResolveAllOption struct{}\n\nfunc (EmptyResolveAllOption) apply(*ResolveAllOptions) {}\n\n// ResolveAllOptionFunc wraps a function that modifies ResolveAllOptions into an\n// implementation of the ResolveAllOption interface.\ntype ResolveAllOptionFunc func(*ResolveAllOptions)\n\nfunc (f ResolveAllOptionFunc) apply(do *ResolveAllOptions) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ResolveAllOptionWithDefault() ResolveAllOption {\n\treturn ResolveAllOptionFunc(func(*ResolveAllOptions) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *ResolveAllOptions) ApplyOptions(options ...ResolveAllOption) *ResolveAllOptions {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/resolver/resolve.now_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\n// A ResolveNowOption sets options.\ntype ResolveNowOption interface {\n\tapply(*ResolveNowOptions)\n}\n\n// EmptyResolveNowUrlOption does not alter the ResolveNowuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyResolveNowOption struct{}\n\nfunc (EmptyResolveNowOption) apply(*ResolveNowOptions) {}\n\n// ResolveNowOptionFunc wraps a function that modifies ResolveNowOptions into an\n// implementation of the ResolveNowOption interface.\ntype ResolveNowOptionFunc func(*ResolveNowOptions)\n\nfunc (f ResolveNowOptionFunc) apply(do *ResolveNowOptions) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ResolveNowOptionWithDefault() ResolveNowOption {\n\treturn ResolveNowOptionFunc(func(*ResolveNowOptions) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *ResolveNowOptions) ApplyOptions(options ...ResolveNowOption) *ResolveNowOptions {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/resolver/resolve.one.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nfunc WithPickMode(mode Resolver_PickMode) ResolveOneOptionFunc {\n\treturn ResolveOneOptionFunc(func(r *ResolveOneOptions) {\n\t\tr.PickMode = mode\n\t})\n}\n\nfunc WithIPTypeForResolverOne(ipType Resolver_IPType) ResolveOneOptionFunc {\n\treturn ResolveOneOptionFunc(func(r *ResolveOneOptions) {\n\t\tr.IPType = ipType\n\t})\n}\n"
  },
  {
    "path": "go/net/resolver/resolve.one_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\n// A ResolveOneOption sets options.\ntype ResolveOneOption interface {\n\tapply(*ResolveOneOptions)\n}\n\n// EmptyResolveOneUrlOption does not alter the ResolveOneuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyResolveOneOption struct{}\n\nfunc (EmptyResolveOneOption) apply(*ResolveOneOptions) {}\n\n// ResolveOneOptionFunc wraps a function that modifies ResolveOneOptions into an\n// implementation of the ResolveOneOption interface.\ntype ResolveOneOptionFunc func(*ResolveOneOptions)\n\nfunc (f ResolveOneOptionFunc) apply(do *ResolveOneOptions) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ResolveOneOptionWithDefault() ResolveOneOption {\n\treturn ResolveOneOptionFunc(func(*ResolveOneOptions) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *ResolveOneOptions) ApplyOptions(options ...ResolveOneOption) *ResolveOneOptions {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/resolver/resolver.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport (\n\t\"fmt\"\n\n\t\"context\"\n)\n\n// ResolveNowOptions includes additional information for ResolveNow.\ntype ResolveNowOptions struct{}\n\n// Resolver watches for the updates on the specified target.\n// Updates include address updates and service config updates.\ntype Resolver interface {\n\t// It could be called multiple times concurrently.\n\tResolveOne(opts ...ResolveOneOption) (Address, error)\n\n\tResolveAll(opts ...ResolveAllOption) ([]Address, error)\n\n\t// ResolveNow will be called by gRPC to try to resolve the target name\n\t// again. It's just a hint, resolver can ignore this if it's not necessary.\n\t//\n\t// It could be called multiple times concurrently.\n\tResolveNow(opts ...ResolveNowOption)\n\t// Close closes the resolver.\n\tClose()\n}\n\ntype Resolver_PickMode int32\n\nconst (\n\tResolver_pick_mode_random Resolver_PickMode = 0\n\tResolver_pick_mode_first  Resolver_PickMode = 1\n)\n\ntype Resolver_IPType int32\n\nconst (\n\tResolver_ip_type_all Resolver_IPType = 0\n\tResolver_ip_type_v4  Resolver_IPType = 1\n\tResolver_ip_type_v6  Resolver_IPType = 2\n)\n\ntype ResolveOneOptions struct {\n\tPickMode Resolver_PickMode\n\tIPType   Resolver_IPType\n}\n\ntype ResolveAllOptions struct {\n\tIPType Resolver_IPType\n}\n\nfunc GetResolver(ctx context.Context, target string, opts ...ResolverBuildOption) (Resolver, error) {\n\tvar opt ResolverBuildOptions\n\topt.ApplyOptions(opts...)\n\ttargetInfo, err := ParseTarget(target)\n\tif err != nil {\n\t\t// support no scheme, just ip:port format\n\t\tif targetInfo.Scheme == \"\" {\n\t\t\treturn GetDefault().Build(Target{\n\t\t\t\tEndpoint: target,\n\t\t\t})\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"target[%v] is invalid\", targetInfo)\n\t}\n\n\tr := getResolver(target)\n\tif r == nil {\n\t\tbuilder := Get(targetInfo.Scheme)\n\t\tif builder == nil {\n\t\t\treturn nil, fmt.Errorf(\"scheme[%v] was not registered\", targetInfo.Scheme)\n\t\t}\n\n\t\tr, err = builder.Build(targetInfo)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to build target[%v], err: %v\", targetInfo, err)\n\t\t}\n\n\t\tsetResolver(target, r)\n\t}\n\treturn r, nil\n}\n"
  },
  {
    "path": "go/net/resolver/resolver_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"context\"\n\n\t\"github.com/kaydxh/golang/go/net/resolver\"\n\tresolver_ \"github.com/kaydxh/golang/go/net/resolver\"\n\t_ \"github.com/kaydxh/golang/go/net/resolver/dns\"\n\t_ \"github.com/kaydxh/golang/go/net/resolver/passthrough\"\n\tresolve_ \"github.com/kaydxh/golang/go/net/resolver/resolve\"\n)\n\nfunc TestResolveOne(t *testing.T) {\n\ttestCases := []struct {\n\t\ttarget   string\n\t\tiptype   resolver.Resolver_IPType\n\t\texpected string\n\t}{\n\t\t{\n\t\t\ttarget:   \"dns:///www.baidu.com:10000\",\n\t\t\tiptype:   resolver.Resolver_ip_type_v4,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\ttarget:   \"dns:///www.google.com\",\n\t\t\tiptype:   resolver.Resolver_ip_type_v4,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\ttarget:   \"dns:///198.121.11.1\",\n\t\t\tiptype:   resolver.Resolver_ip_type_v4,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\ttarget:   \"passthrough:///198.121.11.2\",\n\t\t\tiptype:   resolver.Resolver_ip_type_v4,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\ttarget:   \"198.121.11.2\",\n\t\t\tiptype:   resolver.Resolver_ip_type_v4,\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d-test\", i), func(t *testing.T) {\n\t\t\taddr, err := resolve_.ResolveOne(context.Background(), testCase.target, resolver_.WithPickMode(resolver_.Resolver_pick_mode_first))\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to resolve target: %v, err: %v\", testCase.target, err)\n\t\t\t}\n\t\t\tt.Logf(\"resolve one addr %v for target %v\", addr, testCase.target)\n\t\t})\n\t}\n}\n\nfunc TestResolveAll(t *testing.T) {\n\ttestCases := []struct {\n\t\ttarget   string\n\t\tiptype   resolver.Resolver_IPType\n\t\texpected string\n\t}{\n\t\t{\n\t\t\ttarget:   \"dns:///www.baidu.com\",\n\t\t\tiptype:   resolver.Resolver_ip_type_v4,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\ttarget:   \"dns:///www.google.com\",\n\t\t\tiptype:   resolver.Resolver_ip_type_v4,\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d-test\", i), func(t *testing.T) {\n\t\t\taddrs, err := resolve_.ResolveAll(context.Background(), testCase.target, resolver.WithIPTypeForResolveAll(testCase.iptype))\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to resolve target: %v, err: %v\", testCase.target, err)\n\t\t\t}\n\t\t\tt.Logf(\"resolve all addrs %v for target %v\", addrs, testCase.target)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/net/resolver/target.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n)\n\n// Target represents a target for gRPC, as specified in:\n// https://github.com/grpc/grpc/blob/master/doc/naming.md.\n// It is parsed from the target string that gets passed into Dial or DialContext by the user. And\n// grpc passes it to the resolver and the balancer.\n//\n// If the target follows the naming spec, and the parsed scheme is registered with grpc, we will\n// parse the target string according to the spec. e.g. \"dns://some_authority/foo.bar\" will be parsed\n// into &Target{Scheme: \"dns\", Authority: \"some_authority\", Endpoint: \"foo.bar\"}\n//\n// If the target does not contain a scheme, we will apply the default scheme, and set the Target to\n// be the full target string. e.g. \"foo.bar\" will be parsed into\n// &Target{Scheme: resolver.GetDefaultScheme(), Endpoint: \"foo.bar\"}.\n//\n// If the parsed scheme is not registered (i.e. no corresponding resolver available to resolve the\n// endpoint), we set the Scheme to be the default scheme, and set the Endpoint to be the full target\n// string. e.g. target string \"unknown_scheme://authority/endpoint\" will be parsed into\n// &Target{Scheme: resolver.GetDefaultScheme(), Endpoint: \"unknown_scheme://authority/endpoint\"}.\ntype Target struct {\n\tScheme    string\n\tAuthority string\n\tEndpoint  string\n\tURL       url.URL\n}\n\n// parseTarget uses RFC 3986 semantics to parse the given target into a\n// resolver.Target struct containing scheme, authority and endpoint. Query\n// params are stripped from the endpoint.\n// use URL first\nfunc ParseTarget(target string) (Target, error) {\n\tu, err := url.Parse(target)\n\tif err != nil {\n\t\treturn Target{}, err\n\t}\n\t// For targets of the form \"[scheme]://[authority]/endpoint, the endpoint\n\t// value returned from url.Parse() contains a leading \"/\". Although this is\n\t// in accordance with RFC 3986, we do not want to break existing resolver\n\t// implementations which expect the endpoint without the leading \"/\". So, we\n\t// end up stripping the leading \"/\" here. But this will result in an\n\t// incorrect parsing for something like \"unix:///path/to/socket\". Since we\n\t// own the \"unix\" resolver, we can workaround in the unix resolver by using\n\t// the `URL` field instead of the `Endpoint` field.\n\tendpoint := u.Path\n\tif endpoint == \"\" {\n\t\tendpoint = u.Opaque\n\t}\n\n\tendpoint = strings.TrimPrefix(endpoint, \"/\")\n\treturn Target{\n\t\tScheme:    u.Scheme,\n\t\tAuthority: u.Host,\n\t\tEndpoint:  endpoint,\n\t\tURL:       *u,\n\t}, nil\n}\n\n// ParseTarget splits target into a resolver.Target struct containing scheme,\n// authority and endpoint. skipUnixColonParsing indicates that the parse should\n// not parse \"unix:[path]\" cases. This should be true in cases where a custom\n// dialer is present, to prevent a behavior change.\n//\n// If target is not a valid scheme://authority/endpoint as specified in\n// https://github.com/grpc/grpc/blob/master/doc/naming.md,\n// it returns {Endpoint: target}.\n/*\nfunc ParseTarget(target string, skipUnixColonParsing bool) (ret Target) {\n\tvar ok bool\n\tif strings.HasPrefix(target, \"unix-abstract:\") {\n\t\tif strings.HasPrefix(target, \"unix-abstract://\") {\n\t\t\t// Maybe, with Authority specified, try to parse it\n\t\t\tvar remain string\n\t\t\tret.Scheme, remain, _ = strings_.Split2(target, \"://\")\n\t\t\tret.Authority, ret.Endpoint, ok = strings_.Split2(remain, \"/\")\n\t\t\tif !ok {\n\t\t\t\t// No Authority, add the \"//\" back\n\t\t\t\tret.Endpoint = \"//\" + remain\n\t\t\t} else {\n\t\t\t\t// Found Authority, add the \"/\" back\n\t\t\t\tret.Endpoint = \"/\" + ret.Endpoint\n\t\t\t}\n\t\t} else {\n\t\t\t// Without Authority specified, split target on \":\"\n\t\t\tret.Scheme, ret.Endpoint, _ = strings_.Split2(target, \":\")\n\t\t}\n\t\treturn ret\n\t}\n\tret.Scheme, ret.Endpoint, ok = strings_.Split2(target, \"://\")\n\tif !ok {\n\t\tif strings.HasPrefix(target, \"unix:\") && !skipUnixColonParsing {\n\t\t\t// Handle the \"unix:[local/path]\" and \"unix:[/absolute/path]\" cases,\n\t\t\t// because splitting on :// only handles the\n\t\t\t// \"unix://[/absolute/path]\" case. Only handle if the dialer is nil,\n\t\t\t// to avoid a behavior change with custom dialers.\n\t\t\treturn Target{Scheme: \"unix\", Endpoint: target[len(\"unix:\"):]}\n\t\t}\n\t\treturn Target{Endpoint: target}\n\t}\n\tret.Authority, ret.Endpoint, ok = strings_.Split2(ret.Endpoint, \"/\")\n\tif !ok {\n\t\treturn Target{Endpoint: target}\n\t}\n\tif ret.Scheme == \"unix\" {\n\t\t// Add the \"/\" back in the unix case, so the unix resolver receives the\n\t\t// actual endpoint in the \"unix://[/absolute/path]\" case.\n\t\tret.Endpoint = \"/\" + ret.Endpoint\n\t}\n\treturn ret\n}\n*/\n"
  },
  {
    "path": "go/net/resolver/unix/unix.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage unix\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/kaydxh/golang/go/net/resolver\"\n)\n\nconst unixScheme = \"unix\"\nconst unixAbstractScheme = \"unix-abstract\"\n\ntype builder struct {\n\tscheme string\n}\n\nfunc (b *builder) Build(target resolver.Target, opts ...resolver.ResolverBuildOption) (resolver.Resolver, error) {\n\tif target.Authority != \"\" {\n\t\treturn nil, fmt.Errorf(\"invalid (non-empty) authority: %v\", target.Authority)\n\t}\n\tvar opt resolver.ResolverBuildOptions\n\topt.ApplyOptions(opts...)\n\taddr := resolver.Address{Addr: target.Endpoint}\n\tif b.scheme == unixAbstractScheme {\n\t\t// prepend \"\\x00\" to address for unix-abstract\n\t\taddr.Addr = \"\\x00\" + addr.Addr\n\t}\n\tcc := opt.Cc\n\tif cc != nil {\n\t\tcc.UpdateState(resolver.State{Addresses: []resolver.Address{{Addr: addr.Addr}}})\n\t}\n\treturn &nopResolver{addrs: []resolver.Address{{Addr: addr.Addr}}}, nil\n}\n\nfunc (b *builder) Scheme() string {\n\treturn b.scheme\n}\n\ntype nopResolver struct {\n\taddrs []resolver.Address\n}\n\nfunc (*nopResolver) ResolveOne(opts ...resolver.ResolveOneOption) (resolver.Address, error) {\n\treturn resolver.Address{}, nil\n}\n\nfunc (*nopResolver) ResolveAll(opts ...resolver.ResolveAllOption) ([]resolver.Address, error) {\n\treturn nil, nil\n}\n\nfunc (*nopResolver) ResolveNow(opts ...resolver.ResolveNowOption) {}\n\nfunc (*nopResolver) Close() {}\n\nfunc init() {\n\tresolver.Register(&builder{scheme: unixScheme})\n\tresolver.Register(&builder{scheme: unixAbstractScheme})\n}\n"
  },
  {
    "path": "go/net/url/url.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage url\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"sync\"\n)\n\ntype Client struct {\n\tmutex  sync.Mutex\n\tbuffer *bytes.Buffer\n\n\topts struct {\n\t\tneedEmptyValue bool\n\t\turlCodec       UrlCodec\n\t}\n}\n\nfunc New(ctx context.Context, options ...ClientOption) (*Client, error) {\n\tc := &Client{}\n\tc.opts.urlCodec = DefaultUrlCodec{}\n\tc.ApplyOptions(options...)\n\n\treturn c, nil\n}\n\n//can convert struct to url encode for url paratment\nfunc (c *Client) Encode(data interface{}) (string, error) {\n\tc.mutex.Lock()\n\tdefer c.mutex.Unlock()\n\n\tc.buffer = new(bytes.Buffer)\n\trv := reflect.ValueOf(data)\n\n\terr := c.build(rv, \"\", reflect.Interface)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tbuf := c.buffer.Bytes()\n\tc.buffer = nil\n\n\treturn string(buf[0 : len(buf)-1]), nil\n\n}\n\nfunc (c *Client) encode(rv reflect.Value) (string, error) {\n\tencoder := getEncoder(rv.Kind())\n\tif encoder == nil {\n\t\treturn \"\", fmt.Errorf(\"unsupport type: %v\", rv.Type().String())\n\t}\n\n\treturn encoder.Encode(rv), nil\n}\n\nfunc (c *Client) build(\n\trv reflect.Value,\n\tparentKey string,\n\tparentKind reflect.Kind,\n) error {\n\tfmt.Println(\"-- parentKey: \", parentKey)\n\tswitch rv.Kind() {\n\tcase reflect.Map:\n\t\tfor _, key := range rv.MapKeys() {\n\t\t\tcheckKey := key\n\t\t\tif key.Kind() == reflect.Interface || key.Kind() == reflect.Ptr {\n\t\t\t\tcheckKey = checkKey.Elem()\n\t\t\t}\n\n\t\t\tkeyStr, err := c.encode(checkKey)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tc.build(rv.MapIndex(key), keyStr, rv.Kind())\n\n\t\t}\n\n\tcase reflect.Slice, reflect.Array:\n\t\tfor i := 0; i < rv.Len(); i++ {\n\t\t\tc.build(rv.Index(i), parentKey+\"[\"+strconv.Itoa(i)+\"]\", rv.Kind())\n\t\t}\n\n\tcase reflect.Struct:\n\t\trt := rv.Type()\n\t\tfor i := 0; i < rt.NumField(); i++ {\n\t\t\tft := rt.Field(i)\n\t\t\t//unexported\n\t\t\tif ft.PkgPath != \"\" && !ft.Anonymous {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t//specially handle anonymous fields\n\t\t\tif ft.Anonymous && rv.Field(i).Kind() == reflect.Struct {\n\t\t\t\tc.build(rv.Field(i), parentKey, rv.Kind())\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\ttag := ft.Tag.Get(\"query\")\n\t\t\t\t//all ignore\n\t\t\t\tif tag == \"-\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tt := newTag(tag)\n\t\t\t\t//get the related name\n\t\t\t\tname := t.getName()\n\t\t\t\tif name == \"\" {\n\t\t\t\t\tname = ft.Name\n\t\t\t\t}\n\t\t\t*/\n\n\t\t\tname := ft.Name\n\t\t\tc.build(rv.Field(i), name, rv.Kind())\n\t\t}\n\n\tcase reflect.Ptr, reflect.Interface:\n\t\tif !rv.IsNil() {\n\t\t\tc.build(rv.Elem(), parentKey, parentKind)\n\t\t}\n\n\tdefault:\n\t\tc.appendKeyValue(parentKey, rv, parentKind)\n\n\t}\n\n\treturn nil\n\n}\n\n//basic structure can be translated directly\nfunc (c *Client) appendKeyValue(key string, rv reflect.Value, parentKind reflect.Kind) error {\n\t//If parent type is struct and empty value will be ignored by default. unless needEmptyValue is true.\n\tif parentKind == reflect.Struct && !c.opts.needEmptyValue && isEmptyValue(rv) {\n\t\treturn nil\n\t}\n\n\t//If parent type is slice or array, then repack key. eg. students[0] -> students[]\n\tif parentKind == reflect.Slice || parentKind == reflect.Array {\n\t\tkey = repackArrayQueryKey(key)\n\t}\n\n\ts, err := c.encode(rv)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = c.buffer.WriteString(\n\t\tc.opts.urlCodec.Escape(key) + \"=\" + c.opts.urlCodec.Escape(s) + \"&\",\n\t)\n\n\treturn err\n}\n\n//Is Zero-value\nfunc isEmptyValue(v reflect.Value) bool {\n\tswitch v.Kind() {\n\tcase reflect.Array, reflect.Map, reflect.Slice, reflect.String:\n\t\treturn v.Len() == 0\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Uint,\n\t\treflect.Uint8,\n\t\treflect.Uint16,\n\t\treflect.Uint32,\n\t\treflect.Uint64,\n\t\treflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn v.Float() == 0\n\tcase reflect.Interface, reflect.Ptr:\n\t\treturn v.IsNil()\n\t}\n\treturn false\n}\n\n//if key like `students[0]` , repack it to `students[]`\nfunc repackArrayQueryKey(key string) string {\n\tl := len(key)\n\tif l > 0 && key[l-1] == ']' {\n\t\tfor l--; l >= 0; l-- {\n\t\t\tif key[l] == '[' {\n\t\t\t\treturn key[:l+1] + \"]\"\n\t\t\t}\n\t\t}\n\t}\n\treturn key\n}\n"
  },
  {
    "path": "go/net/url/url.resolve.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage url\n\nimport (\n\t\"context\"\n\t\"net/url\"\n\n\tresolve_ \"github.com/kaydxh/golang/go/net/resolver/resolve\"\n)\n\nfunc ResolveWithTarget(ctx context.Context, u *url.URL, target string) (*url.URL, error) {\n\n\tif u == nil {\n\t\treturn nil, nil\n\t}\n\tnewUrl := u\n\tif target == \"\" {\n\t\treturn newUrl, nil\n\t}\n\n\taddr, err := resolve_.ResolveOne(ctx, target)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewUrl.Host = addr.Addr\n\treturn newUrl, nil\n}\n"
  },
  {
    "path": "go/net/url/url_codec.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage url\n\nimport \"net/url\"\n\ntype UrlCodec interface {\n\tEscape(s string) string\n\tUnEscape(s string) (string, error)\n}\n\n//default url codec\ntype DefaultUrlCodec struct{}\n\nfunc (u DefaultUrlCodec) Escape(s string) string {\n\treturn url.QueryEscape(s)\n}\n\nfunc (u DefaultUrlCodec) UnEscape(s string) (string, error) {\n\treturn url.QueryUnescape(s)\n}\n"
  },
  {
    "path": "go/net/url/url_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage url\n\n// A ClientOption sets options.\ntype ClientOption interface {\n\tapply(*Client)\n}\n\n// EmptyClientOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyClientOption struct{}\n\nfunc (EmptyClientOption) apply(*Client) {}\n\n// ClientOptionFunc wraps a function that modifies Client into an\n// implementation of the ClientOption interface.\ntype ClientOptionFunc func(*Client)\n\nfunc (f ClientOptionFunc) apply(do *Client) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ClientOptionWithDefault() ClientOption {\n\treturn ClientOptionFunc(func(*Client) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Client) ApplyOptions(options ...ClientOption) *Client {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/net/url/url_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage url_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\turl_ \"github.com/kaydxh/golang/go/net/url\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc TestUrlEncode(t *testing.T) {\n\ttype SimpleChild struct {\n\t\tStatus bool\n\t\tName   string\n\t}\n\n\ttype SimpleData struct {\n\t\tId           int\n\t\tName         string\n\t\tChild        SimpleChild\n\t\tParamsInt8   map[string]int8\n\t\tParamsString map[string]string\n\t\tArray        [3]uint16\n\t}\n\n\tdata := SimpleData{\n\t\tId:   2,\n\t\tName: \"http://localhost/test.php?id=2\",\n\t\tChild: SimpleChild{\n\t\t\tStatus: true,\n\t\t},\n\t\tParamsInt8: map[string]int8{\n\t\t\t\"one\": 1,\n\t\t},\n\t\tParamsString: map[string]string{\n\t\t\t\"two\": \"你好\",\n\t\t},\n\n\t\tArray: [3]uint16{2, 3, 300},\n\t}\n\n\tc, _ := url_.New(context.Background())\n\tbytes, err := c.Encode(data)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tfmt.Println(string(bytes))\n}\n"
  },
  {
    "path": "go/net/url/value.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage url\n\nimport (\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar (\n\tboolV      = boolValue{}\n\tintV       = intValue{}\n\tunitV      = uintValue{}\n\tfloatV     = floatValue{}\n\tstringV    = stringValue{}\n\tencoderMap = map[reflect.Kind]Value{\n\t\treflect.Bool:    boolV,\n\t\treflect.Int:     intV,\n\t\treflect.Int8:    intV,\n\t\treflect.Int16:   intV,\n\t\treflect.Int32:   intV,\n\t\treflect.Int64:   intV,\n\t\treflect.Uint:    unitV,\n\t\treflect.Uint8:   unitV,\n\t\treflect.Uint16:  unitV,\n\t\treflect.Uint32:  unitV,\n\t\treflect.Uint64:  unitV,\n\t\treflect.Uintptr: unitV,\n\t\treflect.Float32: floatV,\n\t\treflect.Float64: floatV,\n\t\treflect.String:  stringV,\n\t}\n)\n\ntype Value interface {\n\tEncode(value reflect.Value) string\n\t//Decode(value string) (reflect.Value, error)\n}\n\ntype boolValue struct{}\n\nfunc (e boolValue) Encode(value reflect.Value) string {\n\tif value.Bool() {\n\t\treturn \"1\"\n\t}\n\treturn \"0\"\n}\n\ntype intValue struct{}\n\nfunc (e intValue) Encode(value reflect.Value) string {\n\treturn strconv.FormatInt(value.Int(), 10)\n}\n\ntype uintValue struct{}\n\nfunc (e uintValue) Encode(value reflect.Value) string {\n\treturn strconv.FormatUint(value.Uint(), 10)\n}\n\ntype floatValue struct{}\n\nfunc (e floatValue) Encode(value reflect.Value) string {\n\treturn strconv.FormatFloat(value.Float(), 'f', -1, 64)\n}\n\ntype stringValue struct{}\n\nfunc (e stringValue) Encode(value reflect.Value) string {\n\treturn value.String()\n}\n\nfunc getEncoder(kind reflect.Kind) Value {\n\tif encoder, ok := encoderMap[kind]; ok {\n\t\treturn encoder\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "go/os/env.go",
    "content": "/*\nMIT License\n\nCopyright (c) 2020 kay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\npackage os\n\nimport (\n\t\"os\"\n\t\"strconv\"\n)\n\n// GetEnvAsStringOrFallback returns the env variable for the given key\n// and falls back to the given defaultValue if not set\nfunc GetEnvAsStringOrFallback(key, defaultValue string) string {\n\tif v := os.Getenv(key); v != \"\" {\n\t\treturn v\n\t}\n\treturn defaultValue\n}\n\n// GetEnvAsIntOrFallback returns the env variable (parsed as integer) for\n// the given key and falls back to the given defaultValue if not set\nfunc GetEnvAsIntOrFallback(key string, defaultValue int) (int, error) {\n\tif v := os.Getenv(key); v != \"\" {\n\t\tvalue, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\treturn defaultValue, err\n\t\t}\n\t\treturn value, nil\n\t}\n\treturn defaultValue, nil\n}\n\n// GetEnvAsFloat64OrFallback returns the env variable (parsed as float64) for\n// the given key and falls back to the given defaultValue if not set\nfunc GetEnvAsFloat64OrFallback(key string, defaultValue float64) (float64, error) {\n\tif v := os.Getenv(key); v != \"\" {\n\t\tvalue, err := strconv.ParseFloat(v, 64)\n\t\tif err != nil {\n\t\t\treturn defaultValue, err\n\t\t}\n\t\treturn value, nil\n\t}\n\treturn defaultValue, nil\n}\n"
  },
  {
    "path": "go/os/env_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os_test\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/google/uuid\"\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestGetEnvAsStringOrFallback(t *testing.T) {\n\tconst expected = \"foo\"\n\n\tassert := assert.New(t)\n\tkey := \"FLOCKER_SET_VAR\"\n\tos.Setenv(key, expected)\n\n\tassert.Equal(expected, os_.GetEnvAsStringOrFallback(key, \"~\"+expected))\n\n\tkey = \"FLOCKER_UNSET_VAR\"\n\tassert.Equal(expected, os_.GetEnvAsStringOrFallback(key, expected))\n\tassert.NotEqual(expected, os_.GetEnvAsStringOrFallback(key, \"~\"+expected))\n}\n\n//gotests -w  -all go/os/env.go\n//gotests -only GetEnvAsIntOrFallback go/os/env.go\nfunc TestUUID(t *testing.T) {\n\tid := uuid.New().String()\n\tt.Logf(\"uuid: %v \", id)\n}\n\nfunc TestGetEnvAsIntOrFallback(t *testing.T) {\n\ttype args struct {\n\t\tkey          string\n\t\tdefaultValue int\n\t}\n\ttests := []struct {\n\t\tname    string\n\t\targs    args\n\t\twant    int\n\t\twantErr bool\n\t}{\n\t\t// TODO: Add test cases.\n\t\t{\n\t\t\tname: \"test1\",\n\t\t\targs: args{\n\t\t\t\tkey:          \"FLOCKER_SET_VAR_INT\",\n\t\t\t\tdefaultValue: 0,\n\t\t\t},\n\t\t\twant:    0,\n\t\t\twantErr: false,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tgot, err := os_.GetEnvAsIntOrFallback(tt.args.key, tt.args.defaultValue)\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"GetEnvAsIntOrFallback() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif got != tt.want {\n\t\t\t\tt.Errorf(\"GetEnvAsIntOrFallback() = %v, want %v\", got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestGetEnvAsFloat64OrFallback(t *testing.T) {\n\ttype args struct {\n\t\tkey          string\n\t\tdefaultValue float64\n\t}\n\ttests := []struct {\n\t\tname    string\n\t\targs    args\n\t\twant    float64\n\t\twantErr bool\n\t}{\n\t\t// TODO: Add test cases.\n\t\t{\n\t\t\tname: \"test1\",\n\t\t\targs: args{\n\t\t\t\tkey:          \"FLOCKER_SET_VAR_FLOAT\",\n\t\t\t\tdefaultValue: 1.0,\n\t\t\t},\n\t\t\twant:    1.0,\n\t\t\twantErr: false,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tgot, err := os_.GetEnvAsFloat64OrFallback(tt.args.key, tt.args.defaultValue)\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"GetEnvAsFloat64OrFallback() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif got != tt.want {\n\t\t\t\tt.Errorf(\"GetEnvAsFloat64OrFallback() = %v, want %v\", got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/os/exec/exec.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage exec\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"syscall\"\n\t\"time\"\n\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n)\n\ntype CommandBuilder struct {\n\tcmd exec.Cmd\n\n\topts struct {\n\t\tTimeout time.Duration\n\t}\n}\n\nfunc NewCommandBuilder(\n\toptions ...CommandBuilderOption,\n) (*CommandBuilder, error) {\n\tc := &CommandBuilder{}\n\tc.ApplyOptions(options...)\n\n\treturn c, nil\n}\n\n// Exec return output result, err messgae, error\nfunc (c *CommandBuilder) Exec(cmdName string,\n\targs ...string,\n) (string, string, error) {\n\treturn Exec(c.opts.Timeout, cmdName, args...)\n}\n\n//timout ms\nfunc Exec(\n\ttimeout time.Duration,\n\tcmdName string,\n\targs ...string,\n) (string, string, error) {\n\tctx, cancel := context_.WithTimeout(\n\t\tcontext.Background(),\n\t\ttimeout,\n\t)\n\tdefer cancel()\n\n\tvar stdout, stderr bytes.Buffer\n\targs = append([]string{\"-c\", cmdName}, args...)\n\tcmd := exec.CommandContext(ctx, \"/bin/sh\", args...)\n\tcmd.Stdout, cmd.Stderr = &stdout, &stderr\n\tcmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}\n\tif err := cmd.Start(); err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\n\t\t\t\"error starting %v:\\nCommand stdout:\\n%v\\nstderr:\\n%v\\nerror:\\n%v\",\n\t\t\tcmd,\n\t\t\tcmd.Stdout,\n\t\t\tcmd.Stderr,\n\t\t\terr,\n\t\t)\n\t}\n\n\terrCh := make(chan error, 1)\n\tgo func() {\n\t\terrCh <- cmd.Wait()\n\t}()\n\tselect {\n\tcase err := <-errCh:\n\t\tif err != nil {\n\t\t\tvar rc = 127\n\t\t\tif ee, ok := err.(*exec.ExitError); ok {\n\t\t\t\trc = int(ee.Sys().(syscall.WaitStatus).ExitStatus())\n\t\t\t}\n\t\t\treturn stdout.String(), stderr.String(),\n\t\t\t\tfmt.Errorf(\n\t\t\t\t\t\"error running %v:\\nCommand stdout:\\n%v\\nstderr:\\n%v\\nerror:\\n%v\\ncode:\\n%v\",\n\t\t\t\t\tcmd,\n\t\t\t\t\tcmd.Stdout,\n\t\t\t\t\tcmd.Stderr,\n\t\t\t\t\terr,\n\t\t\t\t\trc,\n\t\t\t\t)\n\t\t}\n\tcase <-ctx.Done():\n\t\tcmd.Process.Kill()\n\t\treturn \"\", \"\", fmt.Errorf(\n\t\t\t\"timed out waiting for command %v:\\nCommand stdout:\\n%v\\nstderr:\\n%v\",\n\t\t\tcmd,\n\t\t\tcmd.Stdout,\n\t\t\tcmd.Stderr,\n\t\t)\n\t}\n\n\treturn stdout.String(), stderr.String(), nil\n}\n"
  },
  {
    "path": "go/os/exec/exec.options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage exec\n\nimport \"time\"\n\n//timeout\nfunc WithTimeout(timeout time.Duration) CommandBuilderOption {\n\treturn CommandBuilderOptionFunc(func(c *CommandBuilder) {\n\t\tc.opts.Timeout = timeout\n\t})\n}\n"
  },
  {
    "path": "go/os/exec/exec_options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage exec\n\nvar _default_CommandBuilder_value = func() (val CommandBuilder) { return }()\n\ntype CommandBuilderOption interface {\n\tapply(*CommandBuilder)\n}\n\n// EmptyCommandBuilderOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyCommandBuilderOption struct{}\n\nfunc (EmptyCommandBuilderOption) apply(*CommandBuilder) {}\n\n// CopyDirOptionFunc wraps a function that modifies CopyDir into an\n// implementation of the CopyDirOption interface.\ntype CommandBuilderOptionFunc func(*CommandBuilder)\n\nfunc (f CommandBuilderOptionFunc) apply(do *CommandBuilder) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _CommandBuilderOptionWithDefault() CommandBuilderOption {\n\treturn CommandBuilderOptionFunc(func(*CommandBuilder) {\n\t\t// nothing to change\n\t})\n}\n\nfunc (o *CommandBuilder) ApplyOptions(\n\toptions ...CommandBuilderOption,\n) *CommandBuilder {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/os/exec/exec_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage exec_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\texec_ \"github.com/kaydxh/golang/go/os/exec\"\n)\n\nfunc TestExec(t *testing.T) {\n\tcmd := fmt.Sprintf(`ps -elf`)\n\ttimeout := 5 * time.Second //ms\n\tresult, msg, err := exec_.Exec(time.Duration(timeout), cmd)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v, msg: %v\", err, msg)\n\t}\n\tt.Logf(\"result: %v\", result)\n}\n\nfunc TestExecTimeout(t *testing.T) {\n\t// sleep 2s\n\tcmd := fmt.Sprintf(`sleep 2`)\n\ttimeout := time.Second\n\tresult, msg, err := exec_.Exec(time.Duration(timeout), cmd)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v, msg: %v\", err, msg)\n\t}\n\tt.Logf(\"result: %v\", result)\n}\n"
  },
  {
    "path": "go/os/file.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\nfunc PathExist(path string) (bool, error) {\n\t_, err := os.Stat(path)\n\tif err == nil {\n\t\treturn true, nil\n\t}\n\tif os.IsNotExist(err) {\n\t\treturn false, nil\n\t}\n\treturn false, err\n\n}\n\nfunc IsDir(path string) (bool, error) {\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn fi.IsDir(), nil\n}\n\nfunc IsHidden(path string) (bool, error) {\n\t_, err := os.Stat(path)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tbase := filepath.Base(path)\n\tif base == \".\" || base == \"..\" {\n\t\treturn false, nil\n\t}\n\tif len(base) > 0 && base[0] == '.' {\n\t\treturn true, nil\n\t}\n\n\treturn false, nil\n}\n\n// MkdirAll creates a directory named path,\n// along with any necessary parents, and returns nil,\n// or else returns an error.\n// The permission(0755) bits perm (before umask) are used for all\n// directories that MkdirAll creates.\n// If path is already a directory, MkdirAll does nothing\nfunc MakeDirAll(name string) error {\n\treturn os.MkdirAll(name, 0755)\n}\n\nfunc MakeDir(name string) error {\n\treturn os.Mkdir(name, 0755)\n}\n\n// if name is empty, create a directory named name, or creates a new temporary directory in the directory dir\n// pattern can be empty\nfunc MakeTempDirAll(name, pattern string) (string, error) {\n\tif name != \"\" {\n\t\t// make base dir, or if the dir is not exist, MakeTempDirAll return error\n\t\terr := MakeDirAll(name)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\treturn os.MkdirTemp(name, pattern)\n}\n\nfunc OpenAll(path string, flag int, perm os.FileMode) (*os.File, error) {\n\tdir, file := filepath.Split(path)\n\t// file or dir exists\n\tif _, err := os.Stat(path); err == nil {\n\t\treturn os.OpenFile(path, flag, perm)\n\t}\n\n\t// mkdir -p dir\n\tif dir != \"\" {\n\t\tif err := MakeDirAll(dir); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif file == \"\" {\n\t\treturn nil, nil\n\t}\n\n\treturn os.OpenFile(path, flag, perm)\n}\n\nfunc OpenFile(path string, appended bool) (file *os.File, err error) {\n\tif !appended {\n\t\tfile, err = OpenAll(path, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0666)\n\t} else {\n\t\tfile, err = OpenAll(path, os.O_CREATE|os.O_RDWR|os.O_APPEND, 0666)\n\t}\n\n\treturn file, err\n\n}\n\n// SameFile reports whether fi1 and fi2 describe the same file.\nfunc SameFile(fi1, fi2 string) bool {\n\tstat1, err := os.Stat(fi1)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tstat2, err := os.Stat(fi2)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn os.SameFile(stat1, stat2)\n}\n\n// oldname and newname is full path\nfunc SymLink(oldname, newname string) error {\n\n\toldname, err := filepath.Abs(oldname)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnewname, err = filepath.Abs(newname)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = os.Stat(oldname)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to stat oldname: %v, err: %v\", oldname, err)\n\t}\n\n\tlinkdir := filepath.Dir(newname)\n\terr = MakeDirAll(linkdir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to make dir: %v, err: %v\", linkdir, err)\n\t}\n\n\t// check link file is valid\n\ttargetname, err := os.Readlink(newname)\n\tif err == nil {\n\t\tif targetname == oldname {\n\t\t\treturn nil\n\t\t}\n\t}\n\t//link file is invalid\n\tos.Remove(newname)\n\t/*\n\t\t_, err = os.Stat(newname)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tos.Remove(newname)\n\t\t\t}\n\t\t}\n\t*/\n\terr = os.Symlink(oldname, newname)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to symlink err: %v\", err)\n\t}\n\n\t_, err = os.Lstat(newname)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to stat newname: %v, err: %v\", newname, err)\n\t}\n\n\treturn err\n}\n\n// include subdir, file and hidden file\nfunc ReadDirNames(path string, filterHiddenFile bool) ([]string, error) {\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tnames, err := file.Readdirnames(-1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !filterHiddenFile {\n\t\treturn names, nil\n\t}\n\n\tnoHiddenFiles := []string{}\n\n\tfor _, name := range names {\n\t\tif strings.HasPrefix(filepath.Base(name), \".\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tnoHiddenFiles = append(noHiddenFiles, name)\n\n\t}\n\n\treturn noHiddenFiles, nil\n\n}\n\n// only inlcude subdir\n// filterHiddenFile  is true, then filter hidden files from result\nfunc ReadDirSubDirNames(path string, filterHiddenFile bool) ([]string, error) {\n\tnames, err := ReadDirNames(path, filterHiddenFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdirs := []string{}\n\tfor _, name := range names {\n\n\t\tfilePath := filepath.Join(path, name)\n\t\tok, _ := IsDir(filePath)\n\t\tif ok {\n\t\t\tdirs = append(dirs, name)\n\t\t}\n\t}\n\n\treturn dirs, nil\n}\n\nfunc ReadDirFileNames(path string, filterHiddenFile bool) ([]string, error) {\n\tnames, err := ReadDirNames(path, filterHiddenFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdirs := []string{}\n\tfor _, name := range names {\n\n\t\tfilePath := filepath.Join(path, name)\n\t\tok, err := IsDir(filePath)\n\t\tif err == nil && !ok {\n\t\t\tdirs = append(dirs, name)\n\t\t}\n\t}\n\n\treturn dirs, nil\n}\n"
  },
  {
    "path": "go/os/file_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os_test\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestOpenAll(t *testing.T) {\n\tdir, err := ioutil.TempDir(\"\", \"dir\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tdefer os.RemoveAll(dir)\n\n\tf, err := os_.OpenAll(dir, os.O_CREATE, 0755)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\t_ = f\n\n\tfmt.Println(dir)\n\n\tfor i := 0; i < 10; i++ {\n\t\tdirName := filepath.Join(dir, fmt.Sprintf(\"dir-%d\", i))\n\t\tf, err = os_.OpenAll(dirName, os.O_CREATE|os.O_RDWR, 0755)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\t}\n\t\tdefer f.Close()\n\n\t\tn, err := io.WriteString(f, \"hello world\")\n\t\tif err != nil {\n\t\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\t}\n\t\tassert.Equal(t, len(\"hello world\"), n)\n\t\tfmt.Println(dirName)\n\t}\n}\n\nfunc TestSameFile(t *testing.T) {\n\ttotal := 2\n\tfileNames := make([]string, total)\n\tdir, err := ioutil.TempDir(\"\", \"dir\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tdefer os.RemoveAll(dir)\n\n\tfor i := 0; i < total; i++ {\n\t\tfileNames[i] = filepath.Join(dir, fmt.Sprintf(\"dir-%d\", i))\n\n\t\tbuf := []byte(\"hello world\")\n\t\terr = ioutil.WriteFile(fileNames[i], buf, 0777)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\t}\n\t\tfmt.Println(fileNames[i])\n\t}\n\n\tok := os_.SameFile(fileNames[0], fileNames[0])\n\tassert.Truef(t, ok, \"fileName %s is the same of %s\", fileNames[0], fileNames[0])\n\n\tok = os_.SameFile(fileNames[0], fileNames[1])\n\tassert.Falsef(t, ok, \"fileName %s is not the same of %s\", fileNames[0], fileNames[1])\n\n}\n\nfunc TestSymLink(t *testing.T) {\n\tdir, err := ioutil.TempDir(\"\", \"dir\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\tdefer os.RemoveAll(dir)\n\n\toldname := filepath.Join(dir, \"oldname\")\n\n\tbuf := []byte(\"hello world\")\n\terr = ioutil.WriteFile(oldname, buf, 0777)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tnewname := \"test.link\"\n\terr = os_.SymLink(oldname, newname)\n\tif err != nil {\n\t\tt.Fatalf(\"expect nil, got %v\", err)\n\t}\n\n\tdata, err := io_.ReadFile(newname)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tassert.Equal(t, buf, data)\n\n}\n\nfunc TestPath(t *testing.T) {\n\n\tfilename := \"./workspace/studyspace/.././11.jpg\"\n\t///Users/kayxhding/workspace/studyspace/git-kayxhding/github.com/kaydxh/golang/go/os/workspace/11.jpg\n\tfmt.Println(filepath.Abs(filename))\n\t//workspace/11.jpg\n\tfmt.Println(filepath.Clean(filename))\n\t//../11.jpg\n\tfmt.Println(filepath.Rel(\"./workspace/22\", filename))\n}\n\nfunc TestReadDirNames(t *testing.T) {\n\tdir := \"/usr/local\"\n\tallFiles, err := os_.ReadDirNames(dir, true)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tt.Logf(\"got sub dirs: %v\", allFiles)\n\n}\n\nfunc TestReadSubDirs(t *testing.T) {\n\tdir := \"/usr/local\"\n\tsubDirs, err := os_.ReadDirSubDirNames(dir, true)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tt.Logf(\"got sub dirs: %v\", subDirs)\n}\n\nfunc TestReadDirFileNames(t *testing.T) {\n\tdir := \"/usr/local\"\n\tfileNames, err := os_.ReadDirFileNames(dir, true)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tt.Logf(\"got filenames: %v\", fileNames)\n\n}\n\nfunc TestMakeTempDirAll(t *testing.T) {\n\t//  /var/folders/by/jt3bf2n52fv6v7lrbndtdmjr0000gn/T/example690523200.12\n\tdir, err := os_.MakeTempDirAll(\"\", \"example*.12\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tt.Logf(\"got dir: %v\", dir)\n\n}\n"
  },
  {
    "path": "go/os/getwd.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os\n\nimport \"os\"\n\nfunc Getwd() (string, error) {\n\treturn os.Getwd()\n}\n"
  },
  {
    "path": "go/os/getwd_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n)\n\nfunc TestGetwd(t *testing.T) {\n\tpath, err := os_.Getwd()\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tfmt.Println(path)\n}\n"
  },
  {
    "path": "go/os/proc.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\texec_ \"github.com/kaydxh/golang/go/os/exec\"\n)\n\nfunc GetPidsByName(\n\ttimeout time.Duration,\n\tname string) ([]int, string, error) {\n\tcmd := fmt.Sprintf(\n\t\t`ps ux | grep '%s'| grep -v grep | awk '{print $2}'`,\n\t\tname,\n\t)\n\tresult, msg, err := exec_.Exec(timeout, cmd)\n\tif err != nil {\n\t\treturn nil, msg, err\n\t}\n\n\tpids := strings.TrimSpace(string(result))\n\tsPids := strings.Split(pids, \"\\n\")\n\tvar nPids []int\n\tfor _, pid := range sPids {\n\t\tnPid, err := strconv.Atoi(pid)\n\t\tif err != nil {\n\t\t\treturn nil, msg, err\n\t\t}\n\t\tnPids = append(nPids, nPid)\n\t}\n\n\treturn nPids, msg, nil\n}\n\n// 获取进程唯一标识符\nfunc GetProcIdWithRand() string {\n\ts, _ := os.Hostname()\n\treturn fmt.Sprintf(\"%s:pid:%v:%v\", s, os.Getpid(), rand.Int())\n}\n\nfunc GetProcId() string {\n\ts, _ := os.Hostname()\n\treturn fmt.Sprintf(\"%s:pid:%v\", s, os.Getpid())\n}\n"
  },
  {
    "path": "go/os/proc_darwin.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage os\n\nimport \"golang.org/x/sys/unix\"\n\nfunc ExistPid(pid int) bool {\n\t// OS X & BSD systems don't have a proc filesystem.\n\t// Use kill -0 pid to judge if the process exists.\n\terr := unix.Kill(pid, 0)\n\treturn err == nil\n}\n"
  },
  {
    "path": "go/os/proc_linux.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage os\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n)\n\nfunc ExistPid(pid int) bool {\n\t_, err := os.Stat(filepath.Join(\"/proc\", strconv.Itoa(pid)))\n\treturn err == nil // err is nil if file exists\n}\n"
  },
  {
    "path": "go/os/proc_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n)\n\nfunc TestGetPidsByName(t *testing.T) {\n\ttimeout := 3000\n\tpids, msg, err := os_.GetPidsByName(time.Duration(timeout), \"kay\")\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v, msg: %v\", err, msg)\n\t}\n\n\tt.Logf(\"pids: %v\", pids)\n}\n\nfunc TestExistPid(t *testing.T) {\n\tpid := 35458\n\texist := os_.ExistPid(pid)\n\tt.Logf(\"pid: %v %v\", pid, exist)\n}\n"
  },
  {
    "path": "go/os/remove_file.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os\n\nimport (\n\t\"os\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\tfilepath_ \"github.com/kaydxh/golang/go/path/filepath\"\n)\n\nfunc RemoveBatch(filenames []string) error {\n\tvar errs []error\n\tfor _, path := range filenames {\n\t\terr := os.Remove(path)\n\t\tif err != nil {\n\t\t\terrs = append(errs, err)\n\t\t}\n\t}\n\n\treturn errors_.NewAggregate(errs)\n}\n\nfunc RemoveWithGlob(pattern string) error {\n\tmatches, err := filepath_.Glob(pattern)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn RemoveBatch(matches)\n\n}\n"
  },
  {
    "path": "go/os/signal_posix.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os\n\nimport (\n\t\"os\"\n\t\"syscall\"\n)\n\n//CTRL + C for SIGINT\n//docker stop for SIGTERM\nvar ShutdownSignals = []os.Signal{syscall.SIGINT, syscall.SIGTERM}\n"
  },
  {
    "path": "go/os/term/term.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage term\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/moby/term\"\n)\n\n// TerminalSize returns the current width and height of the user's terminal. If it isn't a terminal,\n// nil is returned. On error, zero values are returned for width and height.\n// Usually w must be the stdout of the process. Stderr won't work.\nfunc TerminalSize(w io.Writer) (int, int, error) {\n\toutFd, isTerminal := term.GetFdInfo(w)\n\tif !isTerminal {\n\t\treturn 0, 0, fmt.Errorf(\"given writer is no terminal\")\n\t}\n\twinsize, err := term.GetWinsize(outFd)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\treturn int(winsize.Width), int(winsize.Height), nil\n}\n"
  },
  {
    "path": "go/os/value.go",
    "content": "package os\n\nfunc GetValueOrFallback[T comparable](v, defaultValue T) T {\n\tvar zeroE T\n\tif v != zeroE {\n\t\treturn v\n\t}\n\n\treturn defaultValue\n}\n"
  },
  {
    "path": "go/os/value_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage os_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n)\n\nfunc TestGetOrFallback(t *testing.T) {\n\ttestCases := []struct {\n\t\tvalue        string\n\t\tdefaultValue string\n\t\texpected     string\n\t}{\n\t\t{\n\t\t\tvalue:        \"value\",\n\t\t\tdefaultValue: \"defaultValue\",\n\t\t\texpected:     \"value\",\n\t\t},\n\t\t{\n\t\t\tvalue:        \"\",\n\t\t\tdefaultValue: \"defaultValue\",\n\t\t\texpected:     \"defaultValue\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tv := os_.GetValueOrFallback(testCase.value, testCase.defaultValue)\n\t\t\tif v != testCase.expected {\n\t\t\t\tt.Fatalf(\"failed to get or fall back, got : %s\", v)\n\t\t\t}\n\t\t\tt.Logf(\"got value: %v\", v)\n\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/path/filepath/match.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filepath\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc Glob(pattern string) (matches []string, err error) {\n\tmatches, err = filepath.Glob(pattern)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmatchFilters := make([]string, 0, len(matches))\n\n\tfor _, path := range matches {\n\t\t_, err := os.Stat(path)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t_, err = os.Lstat(path)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tmatchFilters = append(matchFilters, path)\n\t}\n\n\treturn matchFilters, nil\n}\n"
  },
  {
    "path": "go/path/filepath/path.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filepath\n\nimport (\n\t\"path\"\n\t\"path/filepath\"\n)\n\nfunc GetParentRelPath(filePath string) string {\n\tfileName := path.Base(filePath)\n\tparentDir := GetParentRelDir(filePath)\n\treturn filepath.Join(parentDir, fileName)\n}\n\nfunc GetParentRelDir(filePath string) string {\n\tdir := path.Dir(filePath)\n\treturn path.Base(dir)\n}\n\nfunc LastChar(str string) uint8 {\n\tif str == \"\" {\n\t\t// char '0' means dec 48, 0 means null\n\t\treturn 0\n\t}\n\n\treturn str[len(str)-1]\n}\n\n// join paths, keep relativePath suffix\nfunc JoinPaths(rootPath, relativePath string) (string, error) {\n\tabsolutePath, err := filepath.Abs(rootPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif relativePath == \"\" {\n\t\treturn absolutePath, nil\n\t}\n\n\tfinalPath := path.Join(absolutePath, relativePath)\n\tif LastChar(relativePath) == '/' && LastChar(finalPath) != '/' {\n\t\treturn finalPath + \"/\", nil\n\t}\n\n\treturn finalPath, nil\n}\n\n// CanonicalizePath turns path into an absolute path without symlinks.\nfunc CanonicalizePath(path string) (string, error) {\n\tpath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tactivepath, err := filepath.EvalSymlinks(path)\n\tif err == nil {\n\t\treturn activepath, nil\n\t}\n\n\t/*\n\t\t// Get a better error if we have an invalid path\n\t\tif pathErr, ok := err.(*os.PathError); ok {\n\t\t\terr = errors.Wrap(pathErr.Err, pathErr.Path)\n\t\t}\n\t*/\n\n\treturn path, nil\n}\n"
  },
  {
    "path": "go/path/filepath/path_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filepath_test\n\nimport (\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\tfilepath_ \"github.com/kaydxh/golang/go/path/filepath\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestGetParentRelPath(t *testing.T) {\n\ttestCases := []struct {\n\t\tfilePath string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tfilePath: \"/data/home/deploy/bin/run.exe\",\n\t\t\texpected: \"bin/run.exe\",\n\t\t},\n\t\t{\n\t\t\tfilePath: \"/run.exe\",\n\t\t\texpected: \"/run.exe\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.filePath, func(t *testing.T) {\n\t\t\trel := filepath_.GetParentRelPath(testCase.filePath)\n\t\t\tassert.Equal(t, testCase.expected, rel)\n\t\t\tt.Logf(\"rel: %v\", rel)\n\n\t\t})\n\t}\n}\n\nfunc TestAbsPath(t *testing.T) {\n\ttestCases := []struct {\n\t\tfilePath string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tfilePath: \"\",\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tfilePath: \".\",\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.filePath, func(t *testing.T) {\n\t\t\tabs, err := filepath.Abs(testCase.filePath)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"abs err: %v\", err)\n\t\t\t}\n\t\t\tt.Logf(\"abs: %v\", abs)\n\n\t\t})\n\t}\n}\n\nfunc TestJoinPaths(t *testing.T) {\n\ttestCases := []struct {\n\t\tabsolutePath string\n\t\trelativePath string\n\t\texpected     string\n\t}{\n\t\t{\n\t\t\tabsolutePath: \"/data\",\n\t\t\trelativePath: \"./relative\",\n\t\t\texpected:     \"\",\n\t\t},\n\t\t{\n\t\t\tabsolutePath: \"./data\",\n\t\t\trelativePath: \"./relative\",\n\t\t\texpected:     \"\",\n\t\t},\n\t\t{\n\t\t\tabsolutePath: \"./data\",\n\t\t\trelativePath: \"./relative/\",\n\t\t\texpected:     \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"test-case-%d\", i), func(t *testing.T) {\n\t\t\tfullPath, err := filepath_.JoinPaths(testCase.absolutePath, testCase.relativePath)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"joinPaths err: %v\", err)\n\t\t\t}\n\t\t\tt.Logf(\"fullPath : %v\", fullPath)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/reflect/array.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect\n\nimport (\n\t\"reflect\"\n)\n\nfunc ArrayAllTagsVaules(req interface{}, key string) []map[string]interface{} {\n\tsliceValues := reflect.ValueOf(req)\n\n\tvar valuesMap []map[string]interface{}\n\tfor i := 0; i < sliceValues.Len(); i++ {\n\t\tstructValue := sliceValues.Index(i)\n\t\tstructType := structValue.Type()\n\n\t\ttagValues := make(map[string]interface{})\n\n\t\tif structType.Kind() == reflect.Ptr {\n\t\t\tstructType = structType.Elem()\n\t\t\tstructValue = structValue.Elem()\n\t\t}\n\n\t\tif !structValue.CanInterface() {\n\t\t\tcontinue\n\t\t}\n\n\t\ttagValues = AllTagsValues(structValue.Interface(), key)\n\t\t/*\n\t\t\t// get tags for struct\n\t\t\t\tif structType.Kind() != reflect.Struct {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\tfor j := 0; j < structType.NumField(); j++ {\n\t\t\t\t\tfield := structType.Field(j)\n\t\t\t\t\tvalue := structValue.Field(j)\n\t\t\t\t\tif !value.CanInterface() {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\ttag := field.Tag.Get(key)\n\t\t\t\t\tif tag != \"\" {\n\t\t\t\t\t\ttagValues[tag] = value.Interface()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t*/\n\n\t\tvaluesMap = append(valuesMap, tagValues)\n\t}\n\n\treturn valuesMap\n}\n"
  },
  {
    "path": "go/reflect/array_test.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect_test\n\nimport (\n\t\"testing\"\n\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n)\n\nfunc TestPointerStructArrayAllTagsValues(t *testing.T) {\n\ttype HttpRequest struct {\n\t\tRequestId string `db:\"request_id\"`\n\t\tUsername  string `db:\"username\"`\n\t}\n\n\treq := []*HttpRequest{\n\t\t&HttpRequest{\n\t\t\tRequestId: \"123\",\n\t\t\tUsername:  \"123-username\",\n\t\t},\n\t\t&HttpRequest{\n\t\t\tRequestId: \"456\",\n\t\t\tUsername:  \"456-username\",\n\t\t},\n\t}\n\n\ttagsValues := reflect_.ArrayAllTagsVaules(req, \"db\")\n\tt.Logf(\"tagsValues: %v\", tagsValues)\n\t//assert.Equal(t, []string{\"request_id\"}, fields)\n}\n\nfunc TestStructArrayAllTagsValues(t *testing.T) {\n\ttype HttpRequest struct {\n\t\tRequestId string `db:\"request_id\"`\n\t\tUsername  string `db:\"username\"`\n\t}\n\n\treq := []HttpRequest{\n\t\tHttpRequest{\n\t\t\tRequestId: \"123\",\n\t\t\tUsername:  \"123-username\",\n\t\t},\n\t\tHttpRequest{\n\t\t\tRequestId: \"456\",\n\t\t\tUsername:  \"456-username\",\n\t\t},\n\t}\n\n\ttagsValues := reflect_.ArrayAllTagsVaules(req, \"db\")\n\tt.Logf(\"tagsValues: %v\", tagsValues)\n\t//assert.Equal(t, []string{\"request_id\"}, fields)\n}\n"
  },
  {
    "path": "go/reflect/error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect\n\nimport \"fmt\"\n\n// ErrUnsupportedType ...\ntype ErrUnsupportedType struct {\n\tvalueType string\n}\n\n// NewErrUnsupportedType returns new ErrUnsupportedType\nfunc NewErrUnsupportedType(valueType string) ErrUnsupportedType {\n\treturn ErrUnsupportedType{valueType}\n}\n\n// Error method so we implement the error interface\nfunc (e ErrUnsupportedType) Error() string {\n\treturn fmt.Sprintf(\"%v is not one of supported types\", e.valueType)\n}\n"
  },
  {
    "path": "go/reflect/id.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect\n\nvar (\n\tFieldNameRequestId = \"RequestId\"\n\tFieldNameSessionId = \"SessionId\"\n)\n\ntype IdRetriever interface {\n\tGetId() string\n}\n\nfunc RetrieveId(req interface{}, key string) string {\n\tif req == nil {\n\t\treturn \"\"\n\t}\n\t// if defined GetRequestId()string method, use it get requestId\n\tif req, ok := req.(IdRetriever); ok {\n\t\tif req != nil {\n\t\t\treturn req.GetId()\n\t\t}\n\t}\n\treturn RetrieveStructField(req, key)\n}\n\nfunc TrySetId(req interface{}, key, id string) {\n\tTrySetStructFiled(req, key, id)\n}\n"
  },
  {
    "path": "go/reflect/struct.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect\n\nimport (\n\t\"reflect\"\n)\n\n//req must be pointer to struct\n// IsNil reports whether its argument v is nil. The argument must be\n// a chan, func, interface, map, pointer, or slice value; if it is\n// not, IsNil panics. Note that IsNil is not always equivalent to a\n// regular comparison with nil in Go. For example, if v was created\n// by calling ValueOf with an uninitialized interface variable i,\n// i==nil will be true but v.IsNil will panic as v will be the zero\n// Value.\nfunc indirectStruct(req interface{}) (reflect.Value, bool) {\n\tif req == nil {\n\t\treturn reflect.Value{}, false\n\t}\n\n\tv := reflect.ValueOf(req)\n\t/*\n\t\tif v.IsNil() {\n\t\t\treturn reflect.Value{}, false\n\t\t}\n\t*/\n\n\treturn reflect.Indirect(v), true\n}\n\nfunc RetrieveStructField(req interface{}, name string) string {\n\tv, ok := indirectStruct(req)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\n\tif !v.IsValid() {\n\t\treturn \"\"\n\t}\n\n\t//nested field: reflect.Indirect(v).FieldByName(\"layout1\").Index(0).FieldByName(\"layout2\")\n\tf := v.FieldByName(name)\n\tif f.IsValid() && f.Kind() == reflect.String {\n\t\treturn f.String()\n\t}\n\treturn \"\"\n\n}\n\nfunc TrySetStructFiled(req interface{}, name, value string) {\n\tv, ok := indirectStruct(req)\n\tif !ok {\n\t\treturn\n\t}\n\n\tif !v.IsValid() {\n\t\treturn\n\t}\n\n\tf := v.FieldByName(name)\n\tif f.IsValid() && f.Kind() == reflect.String {\n\t\tf.SetString(value)\n\t}\n}\n\nfunc AllFieldTags(req interface{}, key string) []string {\n\treturn fieldTags(req, key, false)\n}\n\n// req must be struct(Not pointer to struct), or return nil(tt.Field() will panic)\n// key for tag , db or json, if key is empty, use field name instead\nfunc NonzeroFieldTags(req interface{}, key string) []string {\n\treturn fieldTags(req, key, true)\n}\n\n// req must be struct(Not pointer to struct), or return nil(tt.Field() will panic)\n// key for tag , db or json, if key is empty, use field name instead\n//nonzere true, noly return field tags for values that nonzero\nfunc fieldTags(req interface{}, key string, nonzero bool) []string {\n\tvar tags []string\n\n\ttagsValues := fieldTagsValues(req, key, nonzero)\n\tfor tag := range tagsValues {\n\t\ttags = append(tags, tag)\n\t}\n\n\treturn tags\n}\n\n// only get export Fields\nfunc AllTagsValues(req interface{}, key string) map[string]interface{} {\n\treturn fieldTagsValues(req, key, false)\n}\n\n// req must be struct(Not pointer to struct), or return nil(tt.Field() will panic)\n// key for tag , db or json ..., if key is empty or tag is empty, ignore it\n// nonzere true, noly return field tags for values that nonzero\nfunc fieldTagsValues(req interface{}, key string, nonzero bool) map[string]interface{} {\n\tif req == nil {\n\t\treturn nil\n\t}\n\n\tv, ok := indirectStruct(req)\n\tif !ok {\n\t\treturn nil\n\t}\n\tif !v.IsValid() {\n\t\treturn nil\n\t}\n\n\ttt := reflect.TypeOf(req)\n\tif tt.Kind() == reflect.Ptr {\n\t\ttt = tt.Elem()\n\t}\n\n\tif tt.Kind() != reflect.Struct {\n\t\treturn nil\n\t}\n\n\ttagsValues := make(map[string]interface{})\n\tfor i := 0; i < tt.NumField(); i++ {\n\t\tfield := tt.Field(i)\n\t\tproperty := string(field.Name)\n\t\tf := v.FieldByName(property)\n\n\t\tif !f.CanInterface() {\n\t\t\tcontinue\n\t\t}\n\n\t\tif nonzero {\n\t\t\tif IsZeroValue(f) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif key == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\ttag := field.Tag.Get(key)\n\t\tif len(tag) > 0 {\n\t\t\t// field.Type.Name() -> \"string\", \"int64\" ...\n\t\t\ttagsValues[tag] = f.Interface()\n\t\t}\n\t}\n\n\treturn tagsValues\n}\n"
  },
  {
    "path": "go/reflect/struct_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/google/uuid\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestRetrieveStructField(t *testing.T) {\n\ttype HttpRequest struct {\n\t\tRequestId string\n\t\tUsername  string\n\t}\n\n\tid := uuid.NewString()\n\treq := &HttpRequest{\n\t\tRequestId: id,\n\t}\n\n\trequestId := reflect_.RetrieveStructField(req, \"RequestId\")\n\tt.Logf(\"requestId: %v\", requestId)\n\tassert.Equal(t, id, requestId)\n}\n\nfunc TestTrySetStructField(t *testing.T) {\n\ttype HttpRequest struct {\n\t\tRequestId string\n\t\tUsername  string\n\t}\n\n\tid := uuid.NewString()\n\treq := &HttpRequest{\n\t\t//\tRequestId: id,\n\t}\n\n\treflect_.TrySetStructFiled(req, \"RequestId\", id)\n\tt.Logf(\"requestId: %v\", req.RequestId)\n\tassert.Equal(t, id, req.RequestId)\n}\n\nfunc TestNonzeroFieldTags(t *testing.T) {\n\ttype HttpRequest struct {\n\t\tRequestId string `db:\"request_id\"`\n\t\tUsername  string `db:\"username\"`\n\t}\n\n\tid := uuid.NewString()\n\treq := &HttpRequest{\n\t\tRequestId: id,\n\t\t//\tUsername:  \"username 1\",\n\t}\n\tfields := reflect_.NonzeroFieldTags(req, \"db\")\n\tt.Logf(\"fields: %v\", fields)\n\tassert.Equal(t, []string{\"request_id\"}, fields)\n}\n\nfunc TestAllFieldTags(t *testing.T) {\n\ttype HttpRequest struct {\n\t\tRequestId string `db:\"request_id\"`\n\t\tUsername  string `db:\"username\"`\n\t}\n\n\tid := uuid.NewString()\n\treq := HttpRequest{\n\t\tRequestId: id,\n\t\t//\tUsername:  \"username 1\",\n\t}\n\tfields := reflect_.AllFieldTags(req, \"db\")\n\tt.Logf(\"fields: %v\", fields)\n\t//assert.Equal(t, []string{\"request_id\"}, fields)\n}\n\nfunc TestAllTagsValues(t *testing.T) {\n\ttype HttpRequest struct {\n\t\tRequestId string `db:\"request_id\"`\n\t\tUsername  string `db:\"username\"`\n\t}\n\n\tid := uuid.NewString()\n\treq := &HttpRequest{\n\t\tRequestId: id,\n\t\tUsername:  \"admin\",\n\t}\n\ttagsValues := reflect_.AllTagsValues(req, \"db\")\n\tt.Logf(\"tagsValues: %v\", tagsValues)\n\t//assert.Equal(t, []string{\"request_id\"}, fields)\n}\n"
  },
  {
    "path": "go/reflect/truncate.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"reflect\"\n)\n\nconst (\n\t// DefaultTruncateThreshold 默认截断阈值，超过此长度才截断\n\tDefaultTruncateThreshold = 1024\n\t// DefaultTruncatePrefix 默认保留的前缀字节数\n\tDefaultTruncatePrefix = 10\n\t// MaxTruncateDepth 最大递归深度，防止循环引用（如 google.protobuf.Struct）导致堆栈溢出\n\tMaxTruncateDepth = 32\n)\n\nfunc TruncateBytes(v interface{}) interface{} {\n\treturn TruncateBytesWithThreshold(v, DefaultTruncateThreshold, DefaultTruncatePrefix)\n}\n\n// TruncateBytesWithThreshold 截断 []byte 类型字段，超过 threshold 长度时保留前 prefix 字节并附带总长度\nfunc TruncateBytesWithThreshold(v interface{}, threshold, prefix int) interface{} {\n\treturn Truncate(v, func(v interface{}) bool {\n\t\t_, ok := v.([]byte)\n\t\treturn ok\n\t}, threshold, prefix)\n}\n\n// TruncateBytesAndStrings 同时截断 []byte 和 string 类型字段\nfunc TruncateBytesAndStrings(v interface{}) interface{} {\n\treturn TruncateBytesAndStringsWithThreshold(v, DefaultTruncateThreshold, DefaultTruncatePrefix)\n}\n\n// TruncateBytesAndStringsWithThreshold 截断 []byte 和 string 类型字段，超过 threshold 长度时保留前 prefix 字节并附带总长度\nfunc TruncateBytesAndStringsWithThreshold(v interface{}, threshold, prefix int) interface{} {\n\treturn Truncate(v, func(v interface{}) bool {\n\t\tswitch v.(type) {\n\t\tcase []byte:\n\t\t\treturn true\n\t\tcase string:\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}, threshold, prefix)\n}\n\nfunc Truncate(v interface{}, f func(v interface{}) bool, threshold, prefix int) interface{} {\n\ttruncate(reflect.ValueOf(v), f, threshold, prefix, 0)\n\treturn v\n}\n\n//https://stackoverflow.com/questions/6395076/using-reflect-how-do-you-set-the-value-of-a-struct-field\n// truncate []byte, [][]byte, string, map values, not support others, eg: [][][]byte\n// struct must use pointer of struct, or not rewrite it\n// depth 参数用于限制递归深度，防止循环引用（如 google.protobuf.Struct）导致堆栈溢出\nfunc truncate(v reflect.Value, f func(v interface{}) bool, threshold, prefix int, depth int) {\n\tif !v.IsValid() {\n\t\treturn\n\t}\n\n\tif v.Type() == nil {\n\t\treturn\n\t}\n\n\t// 递归深度限制，防止循环引用（如 google.protobuf.Struct -> Value -> Struct）导致堆栈溢出\n\tif depth > MaxTruncateDepth {\n\t\treturn\n\t}\n\n\tif v.CanInterface() {\n\t\tvv := v.Interface()\n\t\tif f(vv) {\n\t\t\ttruncateToLen(v, threshold, prefix)\n\t\t}\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.Struct:\n\t\tfor i := 0; i < v.NumField(); i++ {\n\t\t\ttruncate(v.Field(i), f, threshold, prefix, depth+1)\n\t\t}\n\n\tcase reflect.Array, reflect.Slice:\n\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\ttruncate(v.Index(i), f, threshold, prefix, depth+1)\n\t\t}\n\n\tcase reflect.Ptr:\n\t\tif !v.IsNil() {\n\t\t\ttruncate(reflect.Indirect(v), f, threshold, prefix, depth+1)\n\t\t}\n\n\tcase reflect.Map:\n\t\titer := v.MapRange()\n\t\tfor iter.Next() {\n\t\t\tmapVal := iter.Value()\n\t\t\t// map 的 value 不能直接修改，需要通过 Elem 解引用指针后修改\n\t\t\tif mapVal.Kind() == reflect.Ptr && !mapVal.IsNil() {\n\t\t\t\ttruncate(mapVal.Elem(), f, threshold, prefix, depth+1)\n\t\t\t} else if mapVal.Kind() == reflect.Interface && !mapVal.IsNil() {\n\t\t\t\ttruncate(mapVal.Elem(), f, threshold, prefix, depth+1)\n\t\t\t}\n\t\t}\n\n\tcase reflect.Interface:\n\t\tif !v.IsNil() {\n\t\t\ttruncate(v.Elem(), f, threshold, prefix, depth+1)\n\t\t}\n\n\tdefault:\n\n\t}\n\n\treturn\n}\n\nfunc truncateToLen(oldValue reflect.Value, threshold, prefix int) {\n\tif !oldValue.IsValid() {\n\t\treturn\n\t}\n\tif !oldValue.CanInterface() {\n\t\treturn\n\t}\n\n\tvv := oldValue.Interface()\n\tswitch vv := vv.(type) {\n\tcase []byte:\n\t\tif len(vv) > threshold {\n\t\t\twriteBytesLenToReflectValue(oldValue, vv, prefix)\n\t\t}\n\tcase string:\n\t\tif len(vv) > threshold {\n\t\t\twriteStringLenToReflectValue(oldValue, vv, prefix)\n\t\t}\n\t}\n\n\treturn\n}\n\n// writeBytesLenToReflectValue 将 []byte 截断为前 prefix 字节 + 总长度信息\nfunc writeBytesLenToReflectValue(v reflect.Value, data []byte, prefix int) interface{} {\n\t// if v can not set, return truncate result\n\tif !v.CanAddr() {\n\t\treturn fmt.Sprintf(\"%s...(bytes len: %d)\", string(data[:min(prefix, len(data))]), len(data))\n\t}\n\n\tvar buf bytes.Buffer\n\tif prefix > 0 && prefix < len(data) {\n\t\tbuf.Write(data[:prefix])\n\t\tbuf.WriteString(fmt.Sprintf(\"...(bytes len: %d)\", len(data)))\n\t} else {\n\t\tbuf.WriteString(fmt.Sprintf(\"bytes len: %d\", len(data)))\n\t}\n\tv.SetBytes(buf.Bytes())\n\treturn v\n}\n\n// writeStringLenToReflectValue 将 string 截断为前 prefix 字节 + 总长度信息\nfunc writeStringLenToReflectValue(v reflect.Value, data string, prefix int) {\n\tif !v.CanSet() {\n\t\treturn\n\t}\n\n\tif prefix > 0 && prefix < len(data) {\n\t\tv.SetString(fmt.Sprintf(\"%s...(string len: %d)\", data[:prefix], len(data)))\n\t} else {\n\t\tv.SetString(fmt.Sprintf(\"string len: %d\", len(data)))\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}"
  },
  {
    "path": "go/reflect/truncate_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect_test\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t//\t\"github.com/google/uuid\"\n\n\t\"github.com/google/uuid\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n)\n\nfunc TestTruncateBytes(t *testing.T) {\n\n\ttmp := []byte(\"12345678\")\n\ttmp2 := [][]byte{[]byte(\"12345678\"), []byte(\"12345678\")}\n\t_ = tmp\n\ttestCases := []struct {\n\t\treq interface{}\n\t}{\n\t\t{\n\t\t\treq: &struct {\n\t\t\t\tRequestId string\n\t\t\t\tImage     []byte\n\t\t\t\tItem      struct {\n\t\t\t\t\ta     int\n\t\t\t\t\tImage []byte\n\t\t\t\t}\n\t\t\t}{\n\t\t\t\tRequestId: uuid.New().String(),\n\t\t\t\tImage:     []byte(\"12345678\"),\n\t\t\t\tItem: struct {\n\t\t\t\t\ta     int\n\t\t\t\t\tImage []byte\n\t\t\t\t}{\n\t\t\t\t\ta:     1,\n\t\t\t\t\tImage: []byte(\"12345678\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\treq: []byte(\"12345678\"),\n\t\t},\n\t\t{\n\t\t\treq: &tmp,\n\t\t},\n\t\t{\n\t\t\treq: [][]byte{[]byte(\"12345678\"), []byte(\"12345678\")},\n\t\t},\n\t\t{\n\t\t\treq: &tmp2,\n\t\t},\n\t\t{\n\t\t\treq: &struct {\n\t\t\t\tImages [][]byte\n\t\t\t}{\n\t\t\t\tImages: [][]byte{\n\t\t\t\t\t[]byte(\"12345678\"),\n\t\t\t\t\t[]byte(\"12345678\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\treq: &struct {\n\t\t\t\tImages [][][]byte\n\t\t\t}{\n\t\t\t\tImages: [][][]byte{\n\t\t\t\t\t[][]byte{[]byte(\"12345678\")},\n\t\t\t\t\t[][]byte{[]byte(\"12345678\")},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\treq: &struct {\n\t\t\t\tRequstId   string\n\t\t\t\tFrameImage []byte\n\t\t\t\tJobs       []struct {\n\t\t\t\t\tJobType   int\n\t\t\t\t\tJobOutput struct {\n\t\t\t\t\t\tOccupyData struct {\n\t\t\t\t\t\t\tGroupCode  string\n\t\t\t\t\t\t\tFrameImage []byte\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}{\n\t\t\t\tRequstId:   \"RRRRRRID\",\n\t\t\t\tFrameImage: []byte(\"frame data\"),\n\t\t\t\tJobs: []struct {\n\t\t\t\t\tJobType   int\n\t\t\t\t\tJobOutput struct {\n\t\t\t\t\t\tOccupyData struct {\n\t\t\t\t\t\t\tGroupCode  string\n\t\t\t\t\t\t\tFrameImage []byte\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}{\n\t\t\t\t\t{\n\t\t\t\t\t\tJobType: 1,\n\t\t\t\t\t\tJobOutput: struct {\n\t\t\t\t\t\t\tOccupyData struct {\n\t\t\t\t\t\t\t\tGroupCode  string\n\t\t\t\t\t\t\t\tFrameImage []byte\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}{\n\t\t\t\t\t\t\tOccupyData: struct {\n\t\t\t\t\t\t\t\tGroupCode  string\n\t\t\t\t\t\t\t\tFrameImage []byte\n\t\t\t\t\t\t\t}{\n\t\t\t\t\t\t\t\tGroupCode:  \"group code\",\n\t\t\t\t\t\t\t\tFrameImage: []byte(\"frame data\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%v\", i), func(t *testing.T) {\n\t\t\tt.Logf(\"req: %+v\\n, \", testCase.req)\n\t\t\ttruncateReq := reflect_.TruncateBytes(testCase.req)\n\t\t\t//t.Logf(\"req: %+v\\n, truncateReq: %+v\", testCase.req, truncateReq)\n\t\t\tt.Logf(\"truncateReq: %+v\", truncateReq)\n\t\t})\n\t}\n}\n\nfunc TestTruncateBytesWithMaxArraySize(t *testing.T) {\n\n\ttestCases := []struct {\n\t\treq interface{}\n\t}{\n\t\t{\n\t\t\treq: &struct {\n\t\t\t\tRequestId string\n\t\t\t\tImage     []byte\n\t\t\t\tItem      []struct {\n\t\t\t\t\ta     int\n\t\t\t\t\tImage []byte\n\t\t\t\t}\n\t\t\t}{\n\t\t\t\tRequestId: uuid.New().String(),\n\t\t\t\tImage:     []byte(\"12345678\"),\n\t\t\t\tItem: []struct {\n\t\t\t\t\ta     int\n\t\t\t\t\tImage []byte\n\t\t\t\t}{\n\t\t\t\t\t{\n\t\t\t\t\t\ta:     1,\n\t\t\t\t\t\tImage: []byte(\"12345678\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ta:     2,\n\t\t\t\t\t\tImage: []byte(\"12345678\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ta:     3,\n\t\t\t\t\t\tImage: []byte(\"12345678\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%v\", i), func(t *testing.T) {\n\t\t\tt.Logf(\"req: %+v\\n\", testCase.req)\n\t\t\t//\ttruncateReq := reflect_.TruncateBytesWithMaxArraySize(testCase.req, 1)\n\t\t\t//\tt.Logf(\"truncateReq: %+v\", truncateReq)\n\t\t})\n\t}\n\n}\n\nfunc TestTruncateBytesWithThreshold(t *testing.T) {\n\t// 生成超过 1024 字节的数据\n\tlongBytes := make([]byte, 2048)\n\tfor i := range longBytes {\n\t\tlongBytes[i] = byte('A' + (i % 26))\n\t}\n\tshortBytes := []byte(\"short data\")\n\n\ttestCases := []struct {\n\t\tname        string\n\t\treq         interface{}\n\t\texpectTrunc bool // 是否期望被截断\n\t}{\n\t\t{\n\t\t\tname: \"bytes超过阈值应被截断\",\n\t\t\treq: &struct {\n\t\t\t\tRequestId string\n\t\t\t\tImage     []byte\n\t\t\t}{\n\t\t\t\tRequestId: \"test-id\",\n\t\t\t\tImage:     longBytes,\n\t\t\t},\n\t\t\texpectTrunc: true,\n\t\t},\n\t\t{\n\t\t\tname: \"bytes未超过阈值不应被截断\",\n\t\t\treq: &struct {\n\t\t\t\tRequestId string\n\t\t\t\tImage     []byte\n\t\t\t}{\n\t\t\t\tRequestId: \"test-id\",\n\t\t\t\tImage:     shortBytes,\n\t\t\t},\n\t\t\texpectTrunc: false,\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tresult := reflect_.TruncateBytes(tc.req)\n\t\t\tt.Logf(\"truncateReq: %+v\", result)\n\t\t})\n\t}\n}\n\nfunc TestTruncateBytesAndStrings(t *testing.T) {\n\t// 生成超过 1024 字节的数据\n\tlongString := strings.Repeat(\"ABCDEFGHIJ\", 200) // 2000 字节\n\tshortString := \"short string\"\n\tlongBytes := make([]byte, 2048)\n\tfor i := range longBytes {\n\t\tlongBytes[i] = byte('0' + (i % 10))\n\t}\n\tshortBytes := []byte(\"short bytes\")\n\n\ttestCases := []struct {\n\t\tname string\n\t\treq  interface{}\n\t}{\n\t\t{\n\t\t\tname: \"string和bytes都超过阈值\",\n\t\t\treq: &struct {\n\t\t\t\tRequestId string\n\t\t\t\tData      string\n\t\t\t\tImage     []byte\n\t\t\t}{\n\t\t\t\tRequestId: \"test-id\",\n\t\t\t\tData:      longString,\n\t\t\t\tImage:     longBytes,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"string和bytes都未超过阈值\",\n\t\t\treq: &struct {\n\t\t\t\tRequestId string\n\t\t\t\tData      string\n\t\t\t\tImage     []byte\n\t\t\t}{\n\t\t\t\tRequestId: \"test-id\",\n\t\t\t\tData:      shortString,\n\t\t\t\tImage:     shortBytes,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"嵌套结构体中的长string和bytes\",\n\t\t\treq: &struct {\n\t\t\t\tRequestId string\n\t\t\t\tItem      struct {\n\t\t\t\t\tName  string\n\t\t\t\t\tImage []byte\n\t\t\t\t}\n\t\t\t}{\n\t\t\t\tRequestId: \"test-id\",\n\t\t\t\tItem: struct {\n\t\t\t\t\tName  string\n\t\t\t\t\tImage []byte\n\t\t\t\t}{\n\t\t\t\t\tName:  longString,\n\t\t\t\t\tImage: longBytes,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"自定义阈值测试\",\n\t\t\treq: &struct {\n\t\t\t\tData string\n\t\t\t}{\n\t\t\t\tData: \"hello world, this is a test string\",\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Logf(\"before: %+v\", tc.req)\n\t\t\tresult := reflect_.TruncateBytesAndStrings(tc.req)\n\t\t\tt.Logf(\"after:  %+v\", result)\n\t\t})\n\t}\n\n\t// 单独测试自定义阈值\n\tt.Run(\"自定义阈值-threshold=10-prefix=5\", func(t *testing.T) {\n\t\treq := &struct {\n\t\t\tData  string\n\t\t\tImage []byte\n\t\t}{\n\t\t\tData:  \"hello world, this is a long string\",\n\t\t\tImage: []byte(\"hello world, this is long bytes\"),\n\t\t}\n\t\tt.Logf(\"before: %+v\", req)\n\t\tresult := reflect_.TruncateBytesAndStringsWithThreshold(req, 10, 5)\n\t\tt.Logf(\"after:  %+v\", result)\n\t})\n}\n\n// TestTruncateWithMap 测试包含 map 类型的结构体截断（模拟 google.protobuf.Struct 场景）\nfunc TestTruncateWithMap(t *testing.T) {\n\tlongBytes := make([]byte, 2048)\n\tfor i := range longBytes {\n\t\tlongBytes[i] = byte('X')\n\t}\n\n\ttestCases := []struct {\n\t\tname string\n\t\treq  interface{}\n\t}{\n\t\t{\n\t\t\tname: \"包含map的结构体\",\n\t\t\treq: &struct {\n\t\t\t\tFields map[string]*struct {\n\t\t\t\t\tData  string\n\t\t\t\t\tImage []byte\n\t\t\t\t}\n\t\t\t}{\n\t\t\t\tFields: map[string]*struct {\n\t\t\t\t\tData  string\n\t\t\t\t\tImage []byte\n\t\t\t\t}{\n\t\t\t\t\t\"key1\": {\n\t\t\t\t\t\tData:  strings.Repeat(\"A\", 2000),\n\t\t\t\t\t\tImage: longBytes,\n\t\t\t\t\t},\n\t\t\t\t\t\"key2\": {\n\t\t\t\t\t\tData:  \"short\",\n\t\t\t\t\t\tImage: []byte(\"short\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"包含map[string]interface{}的结构体\",\n\t\t\treq: &struct {\n\t\t\t\tMeta map[string]interface{}\n\t\t\t}{\n\t\t\t\tMeta: map[string]interface{}{\n\t\t\t\t\t\"name\": \"test\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Logf(\"before: %+v\", tc.req)\n\t\t\tresult := reflect_.TruncateBytesAndStrings(tc.req)\n\t\t\tt.Logf(\"after:  %+v\", result)\n\t\t})\n\t}\n}\n\n// TestTruncateWithCircularLikeStruct 测试模拟循环引用结构（类似 google.protobuf.Struct）不会堆栈溢出\nfunc TestTruncateWithCircularLikeStruct(t *testing.T) {\n\t// 模拟 google.protobuf.Struct 的循环引用结构\n\ttype Value struct {\n\t\tStringValue string\n\t\tBytesValue  []byte\n\t\tStructValue *struct {\n\t\t\tFields map[string]*Value\n\t\t}\n\t}\n\n\ttype Struct struct {\n\t\tFields map[string]*Value\n\t}\n\n\treq := &Struct{\n\t\tFields: map[string]*Value{\n\t\t\t\"image_data\": {\n\t\t\t\tBytesValue: make([]byte, 2048),\n\t\t\t},\n\t\t\t\"long_text\": {\n\t\t\t\tStringValue: strings.Repeat(\"Z\", 2000),\n\t\t\t},\n\t\t\t\"nested\": {\n\t\t\t\tStructValue: &struct {\n\t\t\t\t\tFields map[string]*Value\n\t\t\t\t}{\n\t\t\t\t\tFields: map[string]*Value{\n\t\t\t\t\t\t\"inner_data\": {\n\t\t\t\t\t\t\tBytesValue: make([]byte, 1500),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\t// 这个测试的关键是：不会因为类似循环引用的结构导致堆栈溢出\n\tt.Logf(\"before: %+v\", req)\n\tresult := reflect_.TruncateBytesAndStrings(req)\n\tt.Logf(\"after:  %+v\", result)\n}"
  },
  {
    "path": "go/reflect/value.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"strings\"\n)\n\nvar (\n\ttypesMap = map[string]reflect.Type{\n\t\t// base types\n\t\t\"bool\":    reflect.TypeOf(true),\n\t\t\"int\":     reflect.TypeOf(int(1)),\n\t\t\"int8\":    reflect.TypeOf(int8(1)),\n\t\t\"int16\":   reflect.TypeOf(int16(1)),\n\t\t\"int32\":   reflect.TypeOf(int32(1)),\n\t\t\"int64\":   reflect.TypeOf(int64(1)),\n\t\t\"uint\":    reflect.TypeOf(uint(1)),\n\t\t\"uint8\":   reflect.TypeOf(uint8(1)),\n\t\t\"uint16\":  reflect.TypeOf(uint16(1)),\n\t\t\"uint32\":  reflect.TypeOf(uint32(1)),\n\t\t\"uint64\":  reflect.TypeOf(uint64(1)),\n\t\t\"float32\": reflect.TypeOf(float32(0.5)),\n\t\t\"float64\": reflect.TypeOf(float64(0.5)),\n\t\t\"string\":  reflect.TypeOf(string(\"\")),\n\t\t// slices\n\t\t\"[]bool\":    reflect.TypeOf(make([]bool, 0)),\n\t\t\"[]int\":     reflect.TypeOf(make([]int, 0)),\n\t\t\"[]int8\":    reflect.TypeOf(make([]int8, 0)),\n\t\t\"[]int16\":   reflect.TypeOf(make([]int16, 0)),\n\t\t\"[]int32\":   reflect.TypeOf(make([]int32, 0)),\n\t\t\"[]int64\":   reflect.TypeOf(make([]int64, 0)),\n\t\t\"[]uint\":    reflect.TypeOf(make([]uint, 0)),\n\t\t\"[]uint8\":   reflect.TypeOf(make([]uint8, 0)),\n\t\t\"[]uint16\":  reflect.TypeOf(make([]uint16, 0)),\n\t\t\"[]uint32\":  reflect.TypeOf(make([]uint32, 0)),\n\t\t\"[]uint64\":  reflect.TypeOf(make([]uint64, 0)),\n\t\t\"[]float32\": reflect.TypeOf(make([]float32, 0)),\n\t\t\"[]float64\": reflect.TypeOf(make([]float64, 0)),\n\t\t\"[]byte\":    reflect.TypeOf(make([]byte, 0)),\n\t\t\"[]string\":  reflect.TypeOf([]string{\"\"}),\n\t}\n\n\tctxType = reflect.TypeOf((*context.Context)(nil)).Elem()\n\n\ttypeConversionError = func(argValue interface{}, argTypeStr string) error {\n\t\treturn fmt.Errorf(\"%v is not %v\", argValue, argTypeStr)\n\t}\n)\n\n// cmd/compile/internal/gc/dump.go\nfunc IsZeroValue(v reflect.Value) bool {\n\tif !v.IsValid() {\n\t\treturn true\n\t}\n\n\tswitch v.Kind() {\n\tcase reflect.Bool:\n\t\treturn !v.Bool()\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn v.Int() == 0\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\treturn v.Uint() == 0\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn math.Float64bits(v.Float()) == 0\n\tcase reflect.Complex64, reflect.Complex128:\n\t\tc := v.Complex()\n\t\treturn math.Float64bits(real(c)) == 0 && math.Float64bits(imag(c)) == 0\n\tcase reflect.String:\n\t\treturn v.String() == \"\"\n\tcase reflect.Array:\n\t\tfor i := 0; i < v.Len(); i++ {\n\t\t\tif !v.Index(i).IsZero() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\tcase reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer:\n\t\treturn v.IsNil()\n\tcase reflect.Struct:\n\t\tfor i := 0; i < v.NumField(); i++ {\n\t\t\tif !v.Field(i).IsZero() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\tdefault:\n\t}\n\n\treturn reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())\n}\n\n// ReflectValue converts interface{} to reflect.Value based on string type\nfunc ReflectValue(valueType string, value interface{}) (reflect.Value, error) {\n\t/*\n\t\tif strings.HasPrefix(valueType, \"[]\") {\n\t\t\treturn reflectValues(valueType, value)\n\t\t}\n\t*/\n\n\treturn reflectValue(valueType, value)\n}\n\n// reflectValue converts interface{} to reflect.Value based on string type\n// representing a base type (not a slice)\nfunc reflectValue(valueType string, value interface{}) (reflect.Value, error) {\n\ttheType, ok := typesMap[valueType]\n\tif !ok {\n\t\treturn reflect.Value{}, NewErrUnsupportedType(valueType)\n\t}\n\ttheValue := reflect.New(theType)\n\n\t// Booleans\n\tif theType.String() == \"bool\" {\n\t\tboolValue, err := getBoolValue(theType.String(), value)\n\t\tif err != nil {\n\t\t\treturn reflect.Value{}, err\n\t\t}\n\n\t\ttheValue.Elem().SetBool(boolValue)\n\t\treturn theValue.Elem(), nil\n\t}\n\n\t// Integers\n\tif strings.HasPrefix(theType.String(), \"int\") {\n\t\tintValue, err := getIntValue(theType.String(), value)\n\t\tif err != nil {\n\t\t\treturn reflect.Value{}, err\n\t\t}\n\n\t\ttheValue.Elem().SetInt(intValue)\n\t\treturn theValue.Elem(), err\n\t}\n\n\t// Unsigned integers\n\tif strings.HasPrefix(theType.String(), \"uint\") {\n\t\tuintValue, err := getUintValue(theType.String(), value)\n\t\tif err != nil {\n\t\t\treturn reflect.Value{}, err\n\t\t}\n\n\t\ttheValue.Elem().SetUint(uintValue)\n\t\treturn theValue.Elem(), err\n\t}\n\n\t// Floating point numbers\n\tif strings.HasPrefix(theType.String(), \"float\") {\n\t\tfloatValue, err := getFloatValue(theType.String(), value)\n\t\tif err != nil {\n\t\t\treturn reflect.Value{}, err\n\t\t}\n\n\t\ttheValue.Elem().SetFloat(floatValue)\n\t\treturn theValue.Elem(), err\n\t}\n\n\t// Strings\n\tif theType.String() == \"string\" {\n\t\tstringValue, err := getStringValue(theType.String(), value)\n\t\tif err != nil {\n\t\t\treturn reflect.Value{}, err\n\t\t}\n\n\t\ttheValue.Elem().SetString(stringValue)\n\t\treturn theValue.Elem(), nil\n\t}\n\n\treturn reflect.Value{}, NewErrUnsupportedType(valueType)\n}\n\nfunc getBoolValue(theType string, value interface{}) (bool, error) {\n\tb, ok := value.(bool)\n\tif !ok {\n\t\treturn false, typeConversionError(value, typesMap[theType].String())\n\t}\n\n\treturn b, nil\n}\n\nfunc getIntValue(theType string, value interface{}) (int64, error) {\n\t// We use https://golang.org/pkg/encoding/json/#Decoder.UseNumber when unmarshaling signatures.\n\t// This is because JSON only supports 64-bit floating point numbers and we could lose precision\n\t// when converting from float64 to signed integer\n\tif strings.HasPrefix(fmt.Sprintf(\"%T\", value), \"json.Number\") {\n\t\tn, ok := value.(json.Number)\n\t\tif !ok {\n\t\t\treturn 0, typeConversionError(value, typesMap[theType].String())\n\t\t}\n\n\t\treturn n.Int64()\n\t}\n\n\tvar n int64\n\tswitch value := value.(type) {\n\tcase int:\n\t\tn = int64(value)\n\tcase int64:\n\t\tn = value\n\tcase int32:\n\t\tn = int64(value)\n\tcase int16:\n\t\tn = int64(value)\n\tcase int8:\n\t\tn = int64(value)\n\tdefault:\n\t\tfmt.Printf(\"value: %v\\n\", value)\n\t\treturn 0, typeConversionError(value, typesMap[theType].String())\n\t}\n\n\treturn n, nil\n}\n\nfunc getUintValue(theType string, value interface{}) (uint64, error) {\n\t// We use https://golang.org/pkg/encoding/json/#Decoder.UseNumber when unmarshaling signatures.\n\t// This is because JSON only supports 64-bit floating point numbers and we could lose precision\n\t// when converting from float64 to unsigned integer\n\tif strings.HasPrefix(fmt.Sprintf(\"%T\", value), \"json.Number\") {\n\t\tn, ok := value.(json.Number)\n\t\tif !ok {\n\t\t\tfmt.Printf(\"00000\\n\")\n\t\t\treturn 0, typeConversionError(value, typesMap[theType].String())\n\t\t}\n\n\t\tintVal, err := n.Int64()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\treturn uint64(intVal), nil\n\t}\n\n\tvar n uint64\n\tswitch value := value.(type) {\n\tcase uint:\n\t\tn = uint64(value)\n\tcase uint64:\n\t\tn = value\n\tcase uint32:\n\t\tn = uint64(value)\n\tcase uint16:\n\t\tn = uint64(value)\n\tcase uint8:\n\t\tn = uint64(value)\n\tdefault:\n\t\tfmt.Printf(\"value: %v\\n\", value)\n\t\treturn 0, typeConversionError(value, typesMap[theType].String())\n\t}\n\treturn n, nil\n}\n\nfunc getFloatValue(theType string, value interface{}) (float64, error) {\n\t// We use https://golang.org/pkg/encoding/json/#Decoder.UseNumber when unmarshaling signatures.\n\t// This is because JSON only supports 64-bit floating point numbers and we could lose precision\n\tif strings.HasPrefix(fmt.Sprintf(\"%T\", value), \"json.Number\") {\n\t\tn, ok := value.(json.Number)\n\t\tif !ok {\n\t\t\treturn 0, typeConversionError(value, typesMap[theType].String())\n\t\t}\n\n\t\treturn n.Float64()\n\t}\n\n\tf, ok := value.(float64)\n\tif !ok {\n\t\treturn 0, typeConversionError(value, typesMap[theType].String())\n\t}\n\n\treturn f, nil\n}\n\nfunc getStringValue(theType string, value interface{}) (string, error) {\n\ts, ok := value.(string)\n\tif !ok {\n\t\treturn \"\", typeConversionError(value, typesMap[theType].String())\n\t}\n\n\treturn s, nil\n}\n"
  },
  {
    "path": "go/reflect/value_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage reflect_test\n\nimport (\n\t\"testing\"\n\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n)\n\nfunc TestReflectValue(t *testing.T) {\n\ttestCases := []struct {\n\t\tvalueType string\n\t\tvalue     interface{}\n\t\texpected  string\n\t}{\n\t\t{\n\t\t\tvalueType: \"bool\",\n\t\t\tvalue:     true,\n\t\t\texpected:  \"\",\n\t\t},\n\t\t{\n\t\t\tvalueType: \"int\",\n\t\t\tvalue:     123456789,\n\t\t\texpected:  \"\",\n\t\t},\n\t\t{\n\t\t\tvalueType: \"uint\",\n\t\t\tvalue:     uint(123456789),\n\t\t\texpected:  \"\",\n\t\t},\n\t\t{\n\t\t\tvalueType: \"float32\",\n\t\t\tvalue:     0.123456789,\n\t\t\texpected:  \"\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.valueType, func(t *testing.T) {\n\t\t\trvalue, err := reflect_.ReflectValue(testCase.valueType, testCase.value)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to reflect value: %v, got : %s\", testCase.value, err)\n\n\t\t\t}\n\n\t\t\tt.Logf(\"reflect value: %v\", rvalue)\n\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "go/runtime/extern.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage runtime\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\t\"runtime\"\n\t\"strings\"\n)\n\n// GetCaller returns the caller of the function that calls it.\n//The argument skip is the number of stack frames to skip before recording in pc, with 0 identifying the frame for Callers itself and 1 identifying the caller of Callers\nfunc GetCallerWithSkip(skip int) string {\n\tvar pc [1]uintptr\n\truntime.Callers(skip+1, pc[:])\n\tf := runtime.FuncForPC(pc[0])\n\tif f == nil {\n\t\treturn fmt.Sprintf(\"Unable to find caller\")\n\t}\n\treturn f.Name()\n}\n\nfunc GetCaller() string {\n\t//4 skip, 1 GetCaller, 1 GetCallerWithSkip, 1 runtime.Callers, 1 caller of  GetCaller\n\treturn GetCallerWithSkip(3)\n}\n\nfunc GetShortCaller() string {\n\tfn := GetCallerWithSkip(3)\n\treturn strings.TrimPrefix(path.Ext(fn), \".\")\n}\n\nfunc GetCallStackTrace() string {\n\tconst size = 64 << 10\n\tstacktrace := make([]byte, size)\n\tstacktrace = stacktrace[:runtime.Stack(stacktrace, false)]\n\n\treturn string(stacktrace)\n}\n"
  },
  {
    "path": "go/runtime/extern_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage runtime_test\n\nimport (\n\t\"testing\"\n\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n)\n\nfunc TestGetCaller(t *testing.T) {\n\t// fn shoud be testing.tRunner, caller of TestGetParentCaller\n\tfn := runtime_.GetCaller()\n\tt.Logf(\"fn: %v\", fn)\n\n}\n"
  },
  {
    "path": "go/runtime/function.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage runtime\n\nimport (\n\t\"reflect\"\n\t\"runtime\"\n)\n\nfunc NameOfFunction(f interface{}) string {\n\tv := reflect.ValueOf(f)\n\tif v.Kind() == reflect.Func {\n\t\treturn runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()\n\t}\n\n\treturn \"???\"\n}\n"
  },
  {
    "path": "go/runtime/function_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage runtime_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc testA(a int) int {\n\treturn a\n}\n\nfunc TestNameOfFunction(t *testing.T) {\n\ttestCases := []struct {\n\t\tf        interface{}\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tf: func(a int) int {\n\t\t\t\treturn a\n\t\t\t},\n\t\t\texpected: \"github.com/kaydxh/golang/go/runtime_test.TestNameOfFunction.func1\",\n\t\t},\n\t\t{\n\t\t\tf: func(a int) int {\n\t\t\t\treturn a\n\t\t\t},\n\t\t\texpected: \"github.com/kaydxh/golang/go/runtime_test.TestNameOfFunction.func2\",\n\t\t},\n\t\t{\n\t\t\tf:        testA,\n\t\t\texpected: \"github.com/kaydxh/golang/go/runtime_test.testA\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"test-case-%d\", i), func(t *testing.T) {\n\t\t\tfuncName := runtime_.NameOfFunction(testCase.f)\n\t\t\tassert.Equal(t, testCase.expected, funcName)\n\t\t\tt.Logf(\"funcName: %v\", funcName)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/runtime/goroutine.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage runtime\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"sync\"\n)\n\nvar goroutineSpace = []byte(\"goroutine \")\n\n//low performance\nfunc GoroutineID() uint64 {\n\tbp := littleBuf.Get().(*[]byte)\n\tdefer littleBuf.Put(bp)\n\tb := *bp\n\tb = b[:runtime.Stack(b, false)]\n\t// Parse the 4707 out of \"goroutine 4707 [\"\n\tb = bytes.TrimPrefix(b, goroutineSpace)\n\ti := bytes.IndexByte(b, ' ')\n\tif i < 0 {\n\t\tpanic(fmt.Sprintf(\"No space found in %q\", b))\n\t}\n\tb = b[:i]\n\tn, err := parseUintBytes(b, 10, 64)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to parse goroutine ID out of %q: %v\", b, err))\n\t}\n\treturn n\n}\n\nvar littleBuf = sync.Pool{\n\tNew: func() interface{} {\n\t\tbuf := make([]byte, 64)\n\t\treturn &buf\n\t},\n}\n\n// parseUintBytes is like strconv.ParseUint, but using a []byte.\nfunc parseUintBytes(s []byte, base int, bitSize int) (n uint64, err error) {\n\tvar cutoff, maxVal uint64\n\n\tif bitSize == 0 {\n\t\tbitSize = int(strconv.IntSize)\n\t}\n\n\ts0 := s\n\tswitch {\n\tcase len(s) < 1:\n\t\terr = strconv.ErrSyntax\n\t\tgoto Error\n\n\tcase 2 <= base && base <= 36:\n\t\t// valid base; nothing to do\n\n\tcase base == 0:\n\t\t// Look for octal, hex prefix.\n\t\tswitch {\n\t\tcase s[0] == '0' && len(s) > 1 && (s[1] == 'x' || s[1] == 'X'):\n\t\t\tbase = 16\n\t\t\ts = s[2:]\n\t\t\tif len(s) < 1 {\n\t\t\t\terr = strconv.ErrSyntax\n\t\t\t\tgoto Error\n\t\t\t}\n\t\tcase s[0] == '0':\n\t\t\tbase = 8\n\t\tdefault:\n\t\t\tbase = 10\n\t\t}\n\n\tdefault:\n\t\terr = errors.New(\"invalid base \" + strconv.Itoa(base))\n\t\tgoto Error\n\t}\n\n\tn = 0\n\tcutoff = cutoff64(base)\n\tmaxVal = 1<<uint(bitSize) - 1\n\n\tfor i := 0; i < len(s); i++ {\n\t\tvar v byte\n\t\td := s[i]\n\t\tswitch {\n\t\tcase '0' <= d && d <= '9':\n\t\t\tv = d - '0'\n\t\tcase 'a' <= d && d <= 'z':\n\t\t\tv = d - 'a' + 10\n\t\tcase 'A' <= d && d <= 'Z':\n\t\t\tv = d - 'A' + 10\n\t\tdefault:\n\t\t\tn = 0\n\t\t\terr = strconv.ErrSyntax\n\t\t\tgoto Error\n\t\t}\n\t\tif int(v) >= base {\n\t\t\tn = 0\n\t\t\terr = strconv.ErrSyntax\n\t\t\tgoto Error\n\t\t}\n\n\t\tif n >= cutoff {\n\t\t\t// n*base overflows\n\t\t\tn = 1<<64 - 1\n\t\t\terr = strconv.ErrRange\n\t\t\tgoto Error\n\t\t}\n\t\tn *= uint64(base)\n\n\t\tn1 := n + uint64(v)\n\t\tif n1 < n || n1 > maxVal {\n\t\t\t// n+v overflows\n\t\t\tn = 1<<64 - 1\n\t\t\terr = strconv.ErrRange\n\t\t\tgoto Error\n\t\t}\n\t\tn = n1\n\t}\n\n\treturn n, nil\n\nError:\n\treturn n, &strconv.NumError{Func: \"ParseUint\", Num: string(s0), Err: err}\n}\n\n// Return the first number n such that n*base >= 1<<64.\nfunc cutoff64(base int) uint64 {\n\tif base < 2 {\n\t\treturn 0\n\t}\n\treturn (1<<64-1)/uint64(base) + 1\n}\n"
  },
  {
    "path": "go/runtime/marshaler/jsonpb.marshaler.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage marshaler\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\tstructpb \"github.com/golang/protobuf/ptypes/struct\"\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype JSONPb struct {\n\truntime.JSONPb\n\topts struct {\n\t\tuseProtoNames   bool\n\t\tuseEnumNumbers  bool\n\t\temitUnpopulated bool\n\t\tdiscardUnknown  bool\n\t\tallowPartial    bool\n\t\tindent          string\n\t}\n}\n\nfunc NewDefaultJSONPb() *JSONPb {\n\treturn NewJSONPb(\n\t\t// ummarshal for input\n\t\t// marshal for output\n\t\t// use json name\n\t\t// only for mashaler\n\t\tWithUseProtoNames(false),\n\t\t//false means use enum string for output\n\t\tWithUseEnumNumbers(false),\n\t\tWithEmitUnpopulated(true),\n\t\tWithIndent(\"\\t\"),\n\t\t// only for unmarshal\n\t\tWithDiscardUnknown(true),\n\t\t// for marshal , unmarshal\n\t\tWithAllowPartial(true),\n\t)\n}\n\nfunc NewJSONPb(options ...JSONPbOption) *JSONPb {\n\tj := &JSONPb{}\n\tj.ApplyOptions(options...)\n\n\tif j.opts.useProtoNames {\n\t\tj.MarshalOptions.UseProtoNames = true\n\t}\n\tif j.opts.useEnumNumbers {\n\t\tj.MarshalOptions.UseEnumNumbers = true\n\t}\n\tif j.opts.emitUnpopulated {\n\t\tj.MarshalOptions.EmitUnpopulated = true\n\t}\n\tif j.opts.indent != \"\" {\n\t\tj.MarshalOptions.Indent = j.opts.indent\n\t}\n\tif j.opts.allowPartial {\n\t\tj.MarshalOptions.AllowPartial = true\n\t\tj.UnmarshalOptions.AllowPartial = true\n\t}\n\tif j.opts.discardUnknown {\n\t\tj.UnmarshalOptions.DiscardUnknown = true\n\t}\n\n\treturn j\n}\n\nfunc (j *JSONPb) Marshal(v interface{}) ([]byte, error) {\n\treturn j.JSONPb.Marshal(v)\n}\n\nfunc (j *JSONPb) MarshaToStructpb(v interface{}) (*structpb.Struct, error) {\n\tvar jb []byte\n\tswitch v := v.(type) {\n\tcase nil:\n\t\treturn &structpb.Struct{}, nil\n\n\tcase *structpb.Struct:\n\t\treturn v, nil\n\n\tcase proto.Message:\n\t\tdata, err := j.JSONPb.Marshal(v)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to Marshal json: %v\", err)\n\t\t}\n\t\tjb = []byte(data)\n\n\tcase []byte:\n\t\tjb = v\n\tcase *[]byte:\n\t\tjb = *v\n\tcase string:\n\t\tjb = []byte(v)\n\tcase *string:\n\t\tjb = []byte(*v)\n\tdefault:\n\t\tvar err error\n\t\tjb, err = json.Marshal(v)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to Marshal json: %v\", err)\n\t\t}\n\t}\n\n\tvar dataStructpb structpb.Struct\n\tif err := j.JSONPb.Unmarshal(jb, &dataStructpb); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &dataStructpb, nil\n}\n\n/*\n// if implemet the function, can parse some field from req data\nfunc (j *JSONPb) NewDecoder(r io.Reader) runtime.Decoder {\n\treturn runtime.DecoderFunc(func(v interface{}) error {\n\t\trawData, err := ioutil.ReadAll(r)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = j.JSONPb.Unmarshal(rawData, v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tid := reflect_.RetrieveId(v, reflect_.FieldNameRequestId)\n\t\t_ = id\n\t\treturn nil\n\t})\n}\n*/\n"
  },
  {
    "path": "go/runtime/marshaler/jsonpb.marshaler.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage marshaler\n\nfunc WithUseProtoNames(useProtoNames bool) JSONPbOption {\n\treturn JSONPbOptionFunc(func(c *JSONPb) {\n\t\tc.opts.useProtoNames = useProtoNames\n\t})\n}\n\nfunc WithUseEnumNumbers(useEnumNumbers bool) JSONPbOption {\n\treturn JSONPbOptionFunc(func(c *JSONPb) {\n\t\tc.opts.useEnumNumbers = useEnumNumbers\n\t})\n}\n\nfunc WithEmitUnpopulated(emitUnpopulated bool) JSONPbOption {\n\treturn JSONPbOptionFunc(func(c *JSONPb) {\n\t\tc.opts.emitUnpopulated = emitUnpopulated\n\t})\n}\n\nfunc WithDiscardUnknown(discardUnknown bool) JSONPbOption {\n\treturn JSONPbOptionFunc(func(c *JSONPb) {\n\t\tc.opts.discardUnknown = discardUnknown\n\t})\n}\n\nfunc WithIndent(indent string) JSONPbOption {\n\treturn JSONPbOptionFunc(func(c *JSONPb) {\n\t\tc.opts.indent = indent\n\t})\n}\n\nfunc WithAllowPartial(allowPartial bool) JSONPbOption {\n\treturn JSONPbOptionFunc(func(c *JSONPb) {\n\t\tc.opts.allowPartial = allowPartial\n\t})\n}\n"
  },
  {
    "path": "go/runtime/marshaler/jsonpb.marshaler_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage marshaler\n\n// A JSONPbOption sets options.\ntype JSONPbOption interface {\n\tapply(*JSONPb)\n}\n\n// EmptyJSONPbOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyJSONPbOption struct{}\n\nfunc (EmptyJSONPbOption) apply(*JSONPb) {}\n\n// JSONPbOptionFunc wraps a function that modifies Client into an\n// implementation of the JSONPbOption interface.\ntype JSONPbOptionFunc func(*JSONPb)\n\nfunc (f JSONPbOptionFunc) apply(do *JSONPb) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _JSONPbOptionWithDefault() JSONPbOption {\n\treturn JSONPbOptionFunc(func(*JSONPb) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *JSONPb) ApplyOptions(options ...JSONPbOption) *JSONPb {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/runtime/marshaler/proto.marshaler.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage marshaler\n\nimport (\n\t\"github.com/gin-gonic/gin/binding\"\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n)\n\n// ProtoMarshaller is a Marshaller which marshals/unmarshals into/from serialize proto bytes\ntype ProtoMarshaller struct {\n\truntime.ProtoMarshaller\n}\n\n// ContentType always returns \"application/x-protobuf\".\nfunc (*ProtoMarshaller) ContentType(_ interface{}) string {\n\treturn binding.MIMEPROTOBUF\n}\n"
  },
  {
    "path": "go/runtime/meta.data.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage runtime\n\nimport (\n\t\"context\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n)\n\nfunc GetMetadata(ctx context.Context, key string) []string {\n\tmd, ok := runtime.ServerMetadataFromContext(ctx)\n\tif !ok || md.HeaderMD == nil {\n\t\treturn nil\n\t}\n\n\treturn md.HeaderMD.Get(key)\n}\n"
  },
  {
    "path": "go/runtime/panic.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage runtime\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\n// PanicHandlers is a list of functions which will be invoked when a panic happens.\nvar PanicHandlers = []func(interface{}){logPanic}\n\n//must use defer Recover()\n//not effective for calling defer func() {Recover()}()\nfunc Recover() {\n\tif r := recover(); r != nil {\n\t\tfor _, fn := range PanicHandlers {\n\t\t\tfn(r)\n\t\t}\n\t}\n}\n\n// logPanic logs the caller tree when a panic occurs (except in the special case of http.ErrAbortHandler).\nfunc logPanic(r interface{}) {\n\tif r == http.ErrAbortHandler {\n\t\t// honor the http.ErrAbortHandler sentinel panic value:\n\t\t//   ErrAbortHandler is a sentinel panic value to abort a handler.\n\t\t//   While any panic from ServeHTTP aborts the response to the client,\n\t\t//   panicking with ErrAbortHandler also suppresses logging of a stack trace to the server's error log.\n\t\treturn\n\t}\n\n\t// Same as stdlib http server code. Manually allocate stack trace buffer size\n\t// to prevent excessively large logs\n\tstacktrace := GetCallStackTrace()\n\tif _, ok := r.(string); ok {\n\t\tlogrus.Errorf(\"Observed a panic: %s\\n%s\", r, stacktrace)\n\t} else {\n\t\tlogrus.Errorf(\"Observed a panic: %#v (%v)\\n%s\", r, r, stacktrace)\n\t}\n}\n\n// RecoverFromPanic replaces the specified error with an error containing the\n// original error, and  the call tree when a panic occurs. This enables error\n// handlers to handle errors and panics the same way.\nfunc RecoverFromPanic(err *error) {\n\tif r := recover(); r != nil {\n\t\t// Same as stdlib http server code. Manually allocate stack trace buffer size\n\t\t// to prevent excessively large logs\n\t\tstacktrace := GetCallStackTrace()\n\t\t*err = fmt.Errorf(\n\t\t\t\"recovered from panic %q. (err=%v) Call stack:\\n%s\",\n\t\t\tr,\n\t\t\t*err,\n\t\t\tstacktrace)\n\t}\n}\n\n// Must panics on non-nil errors. Useful to handling programmer level errors\nfunc Must(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n"
  },
  {
    "path": "go/runtime/panic_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage runtime_test\n\nimport (\n\t\"testing\"\n\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n)\n\nfunc TestRecover(t *testing.T) {\n\tdefer runtime_.Recover()\n\tpanic(\"test panic\")\n}\n\nfunc testRecoverFromPanic() (err error) {\n\tdefer runtime_.RecoverFromPanic(&err)\n\tpanic(\"test panic\")\n}\n\nfunc TestRecoverFromPanic(t *testing.T) {\n\terr := testRecoverFromPanic()\n\tt.Logf(\"err: %v\", err)\n}\n"
  },
  {
    "path": "go/runtime/stack.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage runtime\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"runtime/debug\"\n\t\"strings\"\n)\n\nfunc FormatStack() ([]byte, error) {\n\tdebugStack := debug.Stack()\n\treturn prettyStack{}.parse(debugStack)\n}\n\ntype prettyStack struct {\n}\n\nfunc (s prettyStack) parse(debugStack []byte) ([]byte, error) {\n\tvar err error\n\tbuf := &bytes.Buffer{}\n\n\tfmt.Fprintf(buf, \"\\n\")\n\tfmt.Fprintf(buf, \" panic: \")\n\tfmt.Fprintf(buf, \"\\n\")\n\n\t// process debug stack info\n\tstack := strings.Split(string(debugStack), \"\\n\")\n\tlines := []string{}\n\n\t// locate panic line, as we may have nested panics\n\tfor i := len(stack) - 1; i > 0; i-- {\n\t\tlines = append(lines, stack[i])\n\t\tif strings.HasPrefix(stack[i], \"panic(\") {\n\t\t\tlines = lines[0 : len(lines)-2] // remove boilerplate\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// reverse\n\tfor i := len(lines)/2 - 1; i >= 0; i-- {\n\t\topp := len(lines) - 1 - i\n\t\tlines[i], lines[opp] = lines[opp], lines[i]\n\t}\n\n\t// decorate\n\tfor i, line := range lines {\n\t\tlines[i], err = s.decorateLine(line, i)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tfor _, l := range lines {\n\t\tfmt.Fprintf(buf, \"%s\", l)\n\t}\n\treturn buf.Bytes(), nil\n}\n\nfunc (s prettyStack) decorateLine(line string, num int) (string, error) {\n\tline = strings.TrimSpace(line)\n\tif strings.HasPrefix(line, \"\\t\") || strings.Contains(line, \".go:\") {\n\t\treturn s.decorateSourceLine(line, num)\n\t} else if strings.HasSuffix(line, \")\") {\n\t\treturn s.decorateFuncCallLine(line, num)\n\t} else {\n\t\tif strings.HasPrefix(line, \"\\t\") {\n\t\t\treturn strings.Replace(line, \"\\t\", \"      \", 1), nil\n\t\t} else {\n\t\t\treturn fmt.Sprintf(\"    %s\\n\", line), nil\n\t\t}\n\t}\n}\n\nfunc (s prettyStack) decorateFuncCallLine(line string, num int) (string, error) {\n\tidx := strings.LastIndex(line, \"(\")\n\tif idx < 0 {\n\t\treturn \"\", errors.New(\"not a func call line\")\n\t}\n\n\tbuf := &bytes.Buffer{}\n\tpkg := line[0:idx]\n\t// addr := line[idx:]\n\tmethod := \"\"\n\n\tif idx := strings.LastIndex(pkg, string(os.PathSeparator)); idx < 0 {\n\t\tif idx := strings.Index(pkg, \".\"); idx > 0 {\n\t\t\tmethod = pkg[idx:]\n\t\t\tpkg = pkg[0:idx]\n\t\t}\n\t} else {\n\t\tmethod = pkg[idx+1:]\n\t\tpkg = pkg[0 : idx+1]\n\t\tif idx := strings.Index(method, \".\"); idx > 0 {\n\t\t\tpkg += method[0:idx]\n\t\t\tmethod = method[idx:]\n\t\t}\n\t}\n\n\tif num == 0 {\n\t\tfmt.Fprintf(buf, \" -> \")\n\t} else {\n\t\tfmt.Fprintf(buf, \"    \")\n\t}\n\tfmt.Fprintf(buf, \"%s\", pkg)\n\tfmt.Fprintf(buf, \"%s\\n\", method)\n\treturn buf.String(), nil\n}\n\nfunc (s prettyStack) decorateSourceLine(line string, num int) (string, error) {\n\tidx := strings.LastIndex(line, \".go:\")\n\tif idx < 0 {\n\t\treturn \"\", errors.New(\"not a source line\")\n\t}\n\n\tbuf := &bytes.Buffer{}\n\tpath := line[0 : idx+3]\n\tlineno := line[idx+3:]\n\n\tidx = strings.LastIndex(path, string(os.PathSeparator))\n\tdir := path[0 : idx+1]\n\tfile := path[idx+1:]\n\n\tidx = strings.Index(lineno, \" \")\n\tif idx > 0 {\n\t\tlineno = lineno[0:idx]\n\t}\n\n\tif num == 1 {\n\t\tfmt.Fprintf(buf, \" -> \")\n\t} else {\n\t\tfmt.Fprintf(buf, \"    \")\n\t}\n\tfmt.Fprintf(buf, \"%s\", dir)\n\tfmt.Fprintf(buf, \"%s\", file)\n\tfmt.Fprintf(buf, \"%s\", lineno)\n\n\tif num == 1 {\n\t\tfmt.Fprintf(buf, \"\\n\")\n\t}\n\tfmt.Fprintf(buf, \"\\n\")\n\n\treturn buf.String(), nil\n}\n"
  },
  {
    "path": "go/slices/slices.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage slices\n\nimport (\n\tset_ \"github.com/kaydxh/golang/go/container/set\"\n\t\"golang.org/x/exp/slices\"\n)\n\nfunc Unique[S ~[]E, E comparable](s S) S {\n\tss := set_.New[E]()\n\tfor _, v := range s {\n\t\tss.Insert(v)\n\t}\n\n\treturn ss.List()\n}\n\nfunc SliceIntersection[S ~[]E, E comparable](s1, s2 S) S {\n\tss1 := set_.New[E]()\n\tfor _, s := range s1 {\n\t\tss1.Insert(s)\n\t}\n\n\tss2 := set_.New[E]()\n\tfor _, s := range s2 {\n\t\tss2.Insert(s)\n\t}\n\n\tvar ss S\n\tfor _, v := range ss1.Intersection(ss2).List() {\n\t\tss = append(ss, v)\n\t}\n\treturn ss\n}\n\nfunc SliceDifference[S ~[]E, E comparable](s1, s2 S) S {\n\tss1 := set_.New[E]()\n\tfor _, s := range s1 {\n\t\tss1.Insert(s)\n\t}\n\n\tss2 := set_.New[E]()\n\tfor _, s := range s2 {\n\t\tss2.Insert(s)\n\t}\n\n\tvar ss S\n\tfor _, v := range ss1.Difference(ss2).List() {\n\t\tss = append(ss, v)\n\t}\n\n\treturn ss\n}\n\nfunc SliceWithCondition[S ~[]E, E comparable](s1 S, cond func(e E) bool) S {\n\tss1 := set_.New[E]()\n\tfor _, s := range s1 {\n\t\tif cond(s) {\n\t\t\tss1.Insert(s)\n\t\t}\n\t}\n\n\tvar ss S\n\tfor _, v := range ss1.List() {\n\t\tss = append(ss, v)\n\t}\n\n\treturn ss\n}\n\nfunc FirstOrDefaultZero[S ~[]E, E comparable](s S) E {\n\tvar zeroE E\n\tcond := func(e E) bool {\n\t\treturn e != zeroE\n\t}\n\ti := slices.IndexFunc(s, cond)\n\tif i == -1 {\n\t\treturn zeroE\n\t}\n\treturn s[i]\n}\n\nfunc RemoveEmpty[S ~[]E, E comparable](s S) S {\n\tvar ss S\n\tvar zero E\n\tfor _, v := range s {\n\t\tif v != zero {\n\t\t\tss = append(ss, v)\n\t\t}\n\t}\n\n\treturn ss\n}\n"
  },
  {
    "path": "go/slices/slices_test.go",
    "content": "package slices_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tslices_ \"github.com/kaydxh/golang/go/slices\"\n)\n\nfunc TestSliceIntersection(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\ts1       []string\n\t\ts2       []string\n\t\texpected []string\n\t}{\n\t\t{\n\t\t\tname:     \"test string\",\n\t\t\ts1:       []string{\"1\", \"2\", \"3\", \"4\"},\n\t\t\ts2:       []string{\"3\", \"4\", \"5\", \"6\"},\n\t\t\texpected: []string{\"3\", \"4\"},\n\t\t},\n\t\t{\n\t\t\tname:     \"test string2\",\n\t\t\ts1:       []string{\"1\", \"2\", \"3\", \"4\"},\n\t\t\ts2:       []string{\"5\", \"6\"},\n\t\t\texpected: []string{},\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\tintersection := slices_.SliceIntersection(testCase.s1, testCase.s2)\n\t\t\tif len(intersection) != len(testCase.expected) {\n\t\t\t\tt.Fatalf(\"Expected Intersection len: %v, got : %v\", len(testCase.expected), len(intersection))\n\t\t\t}\n\t\t\tt.Logf(\"intersection :%v\", intersection)\n\t\t})\n\t}\n}\n\nfunc TestSliceDifference(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\ts1       []string\n\t\ts2       []string\n\t\texpected []string\n\t}{\n\t\t{\n\t\t\tname:     \"test string\",\n\t\t\ts1:       []string{\"1\", \"2\", \"3\", \"4\"},\n\t\t\ts2:       []string{\"3\", \"4\", \"5\", \"6\"},\n\t\t\texpected: []string{\"1\", \"2\"},\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\tdifference := slices_.SliceDifference(testCase.s1, testCase.s2)\n\t\t\tif len(difference) != len(testCase.expected) {\n\t\t\t\tt.Fatalf(\"Expected Difference len: %v, got : %v\", len(testCase.expected), len(difference))\n\t\t\t}\n\t\t\tt.Logf(\"difference :%v\", difference)\n\t\t})\n\t}\n}\n\nfunc TestRemoveEmpty(t *testing.T) {\n\ttestCases := []struct {\n\t\ts []string\n\t}{\n\t\t{\n\t\t\ts: []string{\"1\", \"\", \"3\", \"4\"},\n\t\t},\n\t\t{\n\t\t\ts: []string{\"\", \"\", \"\", \"\"},\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%d\", i), func(t *testing.T) {\n\t\t\tintersection := slices_.RemoveEmpty(testCase.s)\n\t\t\tt.Logf(\"intersection :%v\", intersection)\n\t\t})\n\t}\n}\n\nfunc TestFirstOrDefaultZero(t *testing.T) {\n\ttestCases := []struct {\n\t\ts []string\n\t}{\n\t\t{\n\t\t\ts: []string{\"1\", \"\", \"3\", \"4\"},\n\t\t},\n\t\t{\n\t\t\ts: []string{\"\", \"\", \"\", \"2\"},\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%d\", i), func(t *testing.T) {\n\t\t\tintersection := slices_.FirstOrDefaultZero(testCase.s)\n\t\t\tt.Logf(\"FirstOrDefaultZero :%v\", intersection)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/strconv/atoi.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage strconv\n\nimport (\n\t\"strconv\"\n)\n\nfunc ParseUintOrFallback(s string, base int, bitSize int, defaultValue uint64) (uint64, error) {\n\tns, err := strconv.ParseUint(s, base, bitSize)\n\tif err != nil {\n\t\treturn defaultValue, err\n\t}\n\n\treturn ns, nil\n}\n\nfunc ParseInt64Batch(m map[string]string) (map[string]int64, error) {\n\tnm := make(map[string]int64, 0)\n\n\tfor k, v := range m {\n\t\tns, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnm[k] = ns\n\t}\n\n\treturn nm, nil\n}\n"
  },
  {
    "path": "go/strconv/atoi_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage strconv_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tstrconv_ \"github.com/kaydxh/golang/go/strconv\"\n\t\"gotest.tools/v3/assert\"\n)\n\nfunc TestParseInt64Batch(t *testing.T) {\n\n\tm := map[string]string{\n\t\t\"fileId\": \"12345\",\n\t\t\"partId\": \"1\",\n\t}\n\tnm, err := strconv_.ParseInt64Batch(m)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tassert.Equal(t, nm[\"fileId\"], int64(12345))\n\tassert.Equal(t, nm[\"partId\"], int64(1))\n\n\tfmt.Println(nm)\n}\n"
  },
  {
    "path": "go/strconv/atonum.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage strconv\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc ToFloat(str string) (float64, error) {\n\treturn strconv.ParseFloat(str, 64)\n}\n\nfunc ToInt(str string) (int, error) {\n\treturn strconv.Atoi(str)\n}\n\nfunc ToInt64(str string) (int64, error) {\n  return  strconv.ParseInt(str, 10, 64)\n}\n\nfunc ToUInt64(str string) (uint64, error) {\n  return  strconv.ParseUint(str, 10, 64)\n}\n\nfunc ParseNumOrDefault[T any](str string, _default T, convert func(string) (T, error)) T {\n\tif str == \"\" {\n\t\treturn _default\n\t}\n\tn, err := convert(str)\n\tif err != nil {\n\t\t//logurs.Infof(\"Invalid number value: %s\", err)\n\t\treturn _default\n\t}\n\treturn n\n}\n\nfunc ParseNum[T any](str string, convert func(string) (T, error)) (T, error) {\n    var t T\n\tif str == \"\" {\n\t\treturn t,  fmt.Errorf(\"string is empty\")\n\t}\n\treturn convert(str)\n}\n\nfunc ParseNums[T any](strs []string, convert func(string) (T, error)) ([]T, error) {\n    var ts []T\n\tif len(strs) == 0{\n\t\treturn ts,  fmt.Errorf(\"string is empty\")\n\t}\n\n\tfor _, str := range strs {\n\t  t, err := convert(str)\n\t  if err != nil {\n\t\treturn nil, err\n\t  }\n\t  ts = append(ts, t)\n\t}\n\treturn  ts, nil\n}\n"
  },
  {
    "path": "go/strconv/atonum_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage strconv_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tstrconv_ \"github.com/kaydxh/golang/go/strconv\"\n)\n\nfunc TestParseNumOrDefault(t *testing.T) {\n\n\ttestCases := []struct {\n\t\tstr      string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tstr:      \"12345\",\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tnum := strconv_.ParseNumOrDefault(testCase.str, 0, strconv_.ToInt)\n\t\t\tt.Logf(\"get num: %v\", num)\n\n\t\t})\n\t}\n\n}\n\nfunc TestParseNum(t *testing.T) {\n\n\ttestCases := []struct {\n\t\tstr      string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tstr:      \"12345\",\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tstr:      \"badcase\",\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tnum, err := strconv_.ParseNum(testCase.str, strconv_.ToInt)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"expecet nil, got %v\", err)\n\t\t\t}\n\t\t\tt.Logf(\"get num: %v\", num)\n\t\t})\n\t}\n\n}\n\nfunc TestParseNums(t *testing.T) {\n\n\ttestCases := []struct {\n\t\tstrs     []string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tstrs:     []string{\"12345\"},\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tnums, err := strconv_.ParseNums(testCase.strs, strconv_.ToInt)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"expecet nil, got %v\", err)\n\t\t\t}\n\t\t\tt.Logf(\"get nums: %v\", nums)\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "go/strconv/itoa.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage strconv\n"
  },
  {
    "path": "go/strings/string_slice.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage strings\n\nimport (\n\t\"strings\"\n\n\tset_ \"github.com/kaydxh/golang/go/container/set\"\n)\n\nfunc SliceUnique(s ...string) []string {\n\tss := set_.NewString()\n\tfor _, v := range s {\n\t\tss.Insert(v)\n\t}\n\n\treturn ss.List()\n}\n\nfunc SliceIntersection(s1 []string, s2 []string) []string {\n\tss1 := set_.NewObject()\n\tfor _, s := range s1 {\n\t\tss1.Insert(s)\n\t}\n\n\tss2 := set_.NewObject()\n\tfor _, s := range s2 {\n\t\tss2.Insert(s)\n\t}\n\n\tss := []string{}\n\tfor _, v := range ss1.Intersection(ss2).List() {\n\t\ts, ok := v.(string)\n\t\tif ok {\n\t\t\tss = append(ss, s)\n\t\t}\n\t}\n\treturn ss\n}\n\nfunc SliceDifference(s1 []string, s2 []string) []string {\n\tss1 := set_.NewObject()\n\tfor _, s := range s1 {\n\t\tss1.Insert(s)\n\t}\n\n\tss2 := set_.NewObject()\n\tfor _, s := range s2 {\n\t\tss2.Insert(s)\n\t}\n\n\tss := []string{}\n\tfor _, v := range ss1.Difference(ss2).List() {\n\t\ts, ok := v.(string)\n\t\tif ok {\n\t\t\tss = append(ss, s)\n\t\t}\n\t}\n\n\treturn ss\n}\n\nfunc SliceWithCondition(s1 []string, cond func(s2 string) bool) []string {\n\tss1 := set_.NewObject()\n\tfor _, s := range s1 {\n\t\tif cond(s) {\n\t\t\tss1.Insert(s)\n\t\t}\n\t}\n\n\tss := []string{}\n\tfor _, v := range ss1.List() {\n\t\ts, ok := v.(string)\n\t\tif ok {\n\t\t\tss = append(ss, s)\n\t\t}\n\t}\n\n\treturn ss\n}\n\nfunc RemoveEmpty(s []string) []string {\n\tvar ss []string\n\tfor _, v := range s {\n\t\tif v != \"\" {\n\t\t\tss = append(ss, v)\n\t\t}\n\t}\n\n\treturn ss\n}\n\n// sliceContains reports whether the provided string is present in the given slice of strings.\nfunc SliceContainsCaseInSensitive(list []string, target string) bool {\n\treturn SliceContains(list, target, false)\n}\n\nfunc SliceContains(list []string, target string, caseSensitive bool) bool {\n\tif !caseSensitive {\n\t\ttarget = strings.ToLower(target)\n\t}\n\n\tfor _, s := range list {\n\t\tif !caseSensitive {\n\t\t\ts = strings.ToLower(s)\n\t\t}\n\n\t\tif s == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n/*\nfunc SliceIntersectionInt(s1 []int, s2 []int) []int {\n\tss1 := set_.NewObject(set_.GenerateArray([...]int(s1...)))\n\tfor _, s := range s1 {\n\t\tss1.Insert(s)\n\t}\n\n\tss2 := set_.NewObject()\n\tfor _, s := range s2 {\n\t\tss2.Insert(s)\n\t}\n\n\tss := []string{}\n\tfor _, v := range ss1.Intersection(ss2).List() {\n\t\ts, ok := v.(string)\n\t\tif ok {\n\t\t\tss = append(ss, s)\n\t\t}\n\t}\n\treturn ss\n}\n*/\n\nfunc Filter(ss []string, cond func(string) bool) []string {\n\tvar res []string\n\tfor _, s := range ss {\n\t\tif cond(s) {\n\t\t\tres = append(res, s)\n\t\t}\n\t}\n\n\treturn res\n}\n"
  },
  {
    "path": "go/strings/string_slice_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage strings_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tstrings_ \"github.com/kaydxh/golang/go/strings\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestStringIntersection(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\ts1       []string\n\t\ts2       []string\n\t\texpected []string\n\t}{\n\t\t{\n\t\t\tname:     \"test string\",\n\t\t\ts1:       []string{\"1\", \"2\", \"3\", \"4\"},\n\t\t\ts2:       []string{\"3\", \"4\", \"5\", \"6\"},\n\t\t\texpected: []string{\"3\", \"4\"},\n\t\t},\n\t\t{\n\t\t\tname:     \"test string2\",\n\t\t\ts1:       []string{\"1\", \"2\", \"3\", \"4\"},\n\t\t\ts2:       []string{\"5\", \"6\"},\n\t\t\texpected: []string{},\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\tintersection := strings_.SliceIntersection(testCase.s1, testCase.s2)\n\t\t\tif len(intersection) != len(testCase.expected) {\n\t\t\t\tt.Fatalf(\"Expected Intersection len: %v, got : %v\", len(testCase.expected), len(intersection))\n\t\t\t}\n\t\t\tt.Logf(\"intersection :%v\", intersection)\n\t\t})\n\t}\n}\n\nfunc TestSliceDifference(t *testing.T) {\n\ttestCases := []struct {\n\t\tname     string\n\t\ts1       []string\n\t\ts2       []string\n\t\texpected []string\n\t}{\n\t\t{\n\t\t\tname:     \"test string\",\n\t\t\ts1:       []string{\"1\", \"2\", \"3\", \"4\"},\n\t\t\ts2:       []string{\"3\", \"4\", \"5\", \"6\"},\n\t\t\texpected: []string{\"1\", \"2\"},\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\tdifference := strings_.SliceDifference(testCase.s1, testCase.s2)\n\t\t\tif len(difference) != len(testCase.expected) {\n\t\t\t\tt.Fatalf(\"Expected Difference len: %v, got : %v\", len(testCase.expected), len(difference))\n\t\t\t}\n\t\t\tt.Logf(\"difference :%v\", difference)\n\t\t})\n\t}\n}\n\nfunc TestRemoveEmpty(t *testing.T) {\n\ttestCases := []struct {\n\t\ts []string\n\t}{\n\t\t{\n\t\t\ts: []string{\"1\", \"\", \"3\", \"4\"},\n\t\t},\n\t\t{\n\t\t\ts: []string{\"\", \"\", \"\", \"\"},\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%d\", i), func(t *testing.T) {\n\t\t\tintersection := strings_.RemoveEmpty(testCase.s)\n\t\t\tt.Logf(\"intersection :%v\", intersection)\n\t\t})\n\t}\n}\n\nfunc TestSliceContains(t *testing.T) {\n\ttestCases := []struct {\n\t\ts             []string\n\t\ttarget        string\n\t\tcaseSensitive bool\n\t\texpected      bool\n\t}{\n\t\t{\n\t\t\ts:             []string{\"a\", \"bdx\"},\n\t\t\ttarget:        \"bDx\",\n\t\t\tcaseSensitive: false,\n\t\t\texpected:      true,\n\t\t},\n\t\t{\n\t\t\ts:             []string{\"a\", \"bdx\"},\n\t\t\ttarget:        \"bdx\",\n\t\t\tcaseSensitive: true,\n\t\t\texpected:      true,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%d\", i), func(t *testing.T) {\n\t\t\thas := strings_.SliceContains(testCase.s, testCase.target, testCase.caseSensitive)\n\t\t\tt.Logf(\"has :%v\", has)\n\t\t\tassert.Equal(t, testCase.expected, has)\n\t\t})\n\t}\n}\n\nfunc TestFilter(t *testing.T) {\n\ttestCases := []struct {\n\t\ts        []string\n\t\tcond     func(string) bool\n\t\texpected []string\n\t}{\n\t\t{\n\t\t\ts: []string{\"a\", \"bdx\"},\n\t\t\tcond: func(s string) bool {\n\t\t\t\treturn s == \"a\"\n\t\t\t},\n\t\t\texpected: []string{\"a\"},\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%d\", i), func(t *testing.T) {\n\t\t\tresult := strings_.Filter(testCase.s, testCase.cond)\n\t\t\tt.Logf(\"result:%v\", result)\n\t\t\tassert.Equal(t, testCase.expected, result)\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "go/strings/strings.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage strings\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\tstrconv_ \"github.com/kaydxh/golang/go/strconv\"\n)\n\nfunc GetStringOrFallback(values ...string) string {\n\tfor _, v := range values {\n\t\tif v != \"\" {\n\t\t\treturn v\n\t\t}\n\t}\n\n\treturn \"\"\n}\n\n/*\nfunc Replace(s string, old string, news []string, n int) string {\n\tif len(news) == 0 || n == 0 {\n\t\treturn s\n\t}\n\n\tif m := strings.Count(s, old); m == 0 {\n\t\treturn s // avoid allocation\n\t} else if n < 0 || m < n {\n\t\tn = m\n\t}\n\t// if len(news) < n , padding news use last element in news\n\tfor i := 0; i < n-len(news); i++ {\n\t\tnews = append(news, news[len(news)-1])\n\t}\n\n\tincLen := 0\n\tfor i := 0; i < n; i++ {\n\t\tincLen += len(news[i]) - len(old)\n\t}\n\n\t// Apply replacements to buffer.\n\tvar b strings.Builder\n\tb.Grow(len(s) + incLen)\n\tstart := 0\n\tfor i := 0; i < n; i++ {\n\t\tj := start\n\t\tif len(old) == 0 {\n\t\t\tif i > 0 {\n\t\t\t\t_, wid := utf8.DecodeRuneInString(s[start:])\n\t\t\t\tj += wid\n\t\t\t}\n\t\t} else {\n\t\t\tj += strings.Index(s[start:], old)\n\t\t}\n\t\tb.WriteString(s[start:j])\n\t\tb.WriteString(news[i])\n\t\tstart = j + len(old)\n\t}\n\tb.WriteString(s[start:])\n\treturn b.String()\n\n}\n*/\n\n/*\nfunc ReplaceAll(s, old string, news []string) string {\n\treturn Replace(s, old, news, -1)\n}\n*/\n\nfunc Replace(s string, old string, news []interface{}, useQuote bool, n int) string {\n\tif len(news) == 0 || n == 0 {\n\t\treturn s\n\t}\n\n\tif m := strings.Count(s, old); m == 0 {\n\t\treturn s // avoid allocation\n\t} else if n < 0 || m < n {\n\t\tn = m\n\t}\n\t// if len(news) < n , padding news use last element in news\n\tfor i := 0; i < n-len(news); i++ {\n\t\tnews = append(news, news[len(news)-1])\n\t}\n\n\tvar b strings.Builder\n\tstart := 0\n\tfor i := 0; i < n; i++ {\n\t\tj := start\n\t\tif len(old) == 0 {\n\t\t\tif i > 0 {\n\t\t\t\t_, wid := utf8.DecodeRuneInString(s[start:])\n\t\t\t\tj += wid\n\t\t\t}\n\t\t} else {\n\t\t\tj += strings.Index(s[start:], old)\n\t\t}\n\t\tb.WriteString(s[start:j])\n\t\tif useQuote {\n\t\t\tb.WriteString(fmt.Sprintf(`\"%v\"`, news[i]))\n\t\t} else {\n\t\t\tb.WriteString(fmt.Sprintf(\"%v\", news[i]))\n\t\t}\n\t\tstart = j + len(old)\n\t}\n\tb.WriteString(s[start:])\n\treturn b.String()\n\n}\n\nfunc ReplaceAll(s, old string, news []interface{}, useQuote bool) string {\n\treturn Replace(s, old, news, useQuote, -1)\n}\n\n// Split slices s into all substrings separated by sep and returns a slice of\n// the substrings between those separators.\n//\n// If s does not contain sep and sep is not empty, Split returns a\n// slice of length 0.\n//\n// If sep is empty, Split splits after each UTF-8 sequence. If both s\n// and sep are empty, Split returns an empty slice.\n//\n// It is equivalent to SplitN with a count of -1.\nfunc SplitOmitEmpty(s, sep string) []string {\n\tvar res []string\n\ta := strings.Split(s, sep)\n\tfor _, v := range a {\n\t\tif v != \"\" {\n\t\t\tres = append(res, v)\n\t\t}\n\t}\n\n\treturn res\n}\n\n// Split2 returns the values from strings.SplitN(s, sep, 2).\n// If sep is not found, it returns (\"\", \"\", false) instead.\nfunc Split2(s, sep string) (string, string, bool) {\n\tspl := strings.SplitN(s, sep, 2)\n\tif len(spl) < 2 {\n\t\treturn \"\", \"\", false\n\t}\n\treturn spl[0], spl[1], true\n}\n\nfunc SplitToNums[T any](s, sep string, convert func(string) (T, error)) ([]T, error) {\n\tss := SplitOmitEmpty(s, sep)\n\treturn strconv_.ParseNums(ss, convert)\n}\n\nfunc EqualCaseInsensitive(src, dst string) bool {\n\treturn strings.ToLower(src) == strings.ToLower(dst)\n}\n\nfunc EmptyString(str string) bool {\n\treturn strings.TrimSpace(str) == \"\"\n}\n"
  },
  {
    "path": "go/strings/strings_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage strings_test\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\tstrconv_ \"github.com/kaydxh/golang/go/strconv\"\n\tstrings_ \"github.com/kaydxh/golang/go/strings\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestReplace(t *testing.T) {\n\ttestCases := []struct {\n\t\ts        string\n\t\told      string\n\t\tnews     []interface{}\n\t\tn        int\n\t\texpected string\n\t}{\n\t\t{\n\t\t\ts:        \"task_id in (?)\",\n\t\t\told:      \"?\",\n\t\t\tnews:     []interface{}{\"a\"},\n\t\t\tn:        1,\n\t\t\texpected: `task_id in (\"a\")`,\n\t\t},\n\t\t{\n\t\t\ts:        \"task_id in (?, ?, ?, ?, ?)\",\n\t\t\told:      \"?\",\n\t\t\tnews:     []interface{}{\"a\", \"a\", \"a\", \"a\"},\n\t\t\tn:        5,\n\t\t\texpected: `task_id in (\"a\", \"a\", \"a\", \"a\", \"a\")`,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.s, func(t *testing.T) {\n\t\t\tnewStr := strings_.Replace(testCase.s, testCase.old, testCase.news, true, testCase.n)\n\t\t\tt.Logf(\"newStr: %v\", newStr)\n\t\t\tassert.Equal(t, testCase.expected, newStr)\n\n\t\t})\n\n\t}\n}\n\nfunc TestReplaceAll(t *testing.T) {\n\ttestCases := []struct {\n\t\ts        string\n\t\told      string\n\t\tnews     []interface{}\n\t\texpected string\n\t}{\n\t\t{\n\t\t\ts:        \"task_id in (?)\",\n\t\t\told:      \"?\",\n\t\t\tnews:     []interface{}{\"a\"},\n\t\t\texpected: `task_id in (\"a\")`,\n\t\t},\n\t\t{\n\t\t\ts:        \"task_id in (?, ?, ?, ?, ?)\",\n\t\t\told:      \"?\",\n\t\t\tnews:     []interface{}{\"a\", \"a\", \"a\", \"a\"},\n\t\t\texpected: `task_id in (\"a\", \"a\", \"a\", \"a\", \"a\")`,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.s, func(t *testing.T) {\n\t\t\tnewStr := strings_.ReplaceAll(testCase.s, testCase.old, testCase.news, true)\n\t\t\tt.Logf(\"newStr: %v\", newStr)\n\t\t\tassert.Equal(t, testCase.expected, newStr)\n\n\t\t})\n\n\t}\n}\n\nfunc TestSplit(t *testing.T) {\n\ttestCases := []struct {\n\t\ts   string\n\t\tsep string\n\t}{\n\t\t{\n\t\t\ts:   \"1\",\n\t\t\tsep: \",\",\n\t\t},\n\t\t{\n\t\t\ts:   \"a,b,c\",\n\t\t\tsep: \",\",\n\t\t},\n\t\t{\n\t\t\ts:   \"a,b,c,,,,,\",\n\t\t\tsep: \",\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.s, func(t *testing.T) {\n\t\t\tss := strings_.SplitOmitEmpty(testCase.s, testCase.sep)\n\t\t\tt.Logf(\"ss: %v. len(ss): %v\", ss, len(ss))\n\n\t\t})\n\n\t}\n\n}\n\nfunc TestSplitToNums(t *testing.T) {\n\ttestCases := []struct {\n\t\ts   string\n\t\tsep string\n\t}{\n\t\t{\n\t\t\ts:   \"1,2,3,4\",\n\t\t\tsep: \",\",\n\t\t},\n\t\t{\n\t\t\ts:   \"1,2,3,4,\",\n\t\t\tsep: \",\",\n\t\t},\n\t\t{\n\t\t\ts:   \"1,2,3,4,a\",\n\t\t\tsep: \",\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.s, func(t *testing.T) {\n\t\t\tnums, err := strings_.SplitToNums(testCase.s, testCase.sep, strconv_.ToInt64)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"failed to split to nums, err: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt.Logf(\"got nums %v\", nums)\n\n\t\t})\n\n\t}\n\n}\n\nfunc TestGetStringOrFallback(t *testing.T) {\n\ttype args struct {\n\t\tvalue        string\n\t\tdefaultValue string\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs args\n\t\twant string\n\t}{\n\t\t// TODO: Add test cases.\n\t\t{\n\t\t\tname: \"test1\",\n\t\t\targs: args{\n\t\t\t\tvalue:        \"abc\",\n\t\t\t\tdefaultValue: \"default\",\n\t\t\t},\n\t\t\twant: \"abc\",\n\t\t},\n\t\t{\n\t\t\tname: \"test2\",\n\t\t\targs: args{\n\t\t\t\tvalue:        \"\",\n\t\t\t\tdefaultValue: \"default\",\n\t\t\t},\n\t\t\twant: \"default\",\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tif got := strings_.GetStringOrFallback(tt.args.value, tt.args.defaultValue); got != tt.want {\n\t\t\t\tt.Errorf(\"GetStringOrFallback() = %v, want %v\", got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestLastIndex(t *testing.T) {\n\ttests := []struct {\n\t\tvalue string\n\t\ttag   string\n\t}{\n\t\t// TODO: Add test cases.\n\t\t{\n\t\t\tvalue: \"abc_fashion_0\",\n\t\t\ttag:   \"_fashion\",\n\t\t},\n\t}\n\tfor i, tt := range tests {\n\t\tt.Run(fmt.Sprintf(\"%v\", i), func(t *testing.T) {\n\t\t\tindex := strings.LastIndex(tt.value, tt.tag)\n\t\t\tif index != -1 {\n\t\t\t\tt.Logf(\"result: %v\", tt.value[:index])\n\t\t\t} else {\n\t\t\t\tt.Logf(\"result: %v\", tt.value)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/sync/atomic/file_lock.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage atomic\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n)\n\ntype FileLock string\n\nfunc (m *FileLock) TryLock() error {\n\tif m == nil {\n\t\treturn fmt.Errorf(\"nil pointer\")\n\t}\n\tif *m == \"\" {\n\t\treturn fmt.Errorf(\"invalid file\")\n\t}\n\tname := string(*m)\n\tif !strings.HasSuffix(name, \".lock\") {\n\t\t*m += \".lock\"\n\t}\n\n\tdir := filepath.Dir(name)\n\terr := os_.MakeDirAll(dir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tf, err := os.OpenFile(string(*m), os.O_CREATE|os.O_EXCL, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn f.Close()\n}\n\nfunc (m *FileLock) TryUnLock() error {\n\tif m == nil || *m == \"\" {\n\t\treturn nil\n\t}\n\n\treturn os.Remove(string(*m))\n}\n\n/*\nfunc makePidFile(name string) (tmpname string, cleanup func(), err error) {\n\ttmplock, err := ioutil.TempFile(\n\t\tfilepath.Dir(name),\n\t\tfilepath.Base(name)+fmt.Sprintf(\"%d\", os.GetPid())+\".lock\",\n\t)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tcleanup = func() {\n\t\t_ = tmplock.Close()\n\t\t_ = os.Remove(tmplock.Name())\n\t}\n\n}\n*/\n"
  },
  {
    "path": "go/sync/atomic/file_lock_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage atomic_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/kaydxh/golang/go/sync/atomic\"\n\tatomic_ \"github.com/kaydxh/golang/go/sync/atomic\"\n)\n\nfunc TestTryLock(t *testing.T) {\n\tvar mu atomic_.FileLock = atomic.FileLock(\"test_lockfile\")\n\terr := mu.TryLock()\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\treturn\n\t}\n\n\terr = mu.TryUnLock()\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\treturn\n\t}\n\n\treturn\n}\n"
  },
  {
    "path": "go/sync/cond.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage sync\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\t\"unsafe\"\n)\n\n// Cond 条件变量不保证顺序性，即signal只是通知wait去获取数据，wait拿到的数据是不是\n// signal当时给的数据，不能保证\ntype Cond struct {\n\tL       sync.Locker\n\tch      chan struct{}\n\tchecker copyChecker\n\tnoCopy  noCopy\n}\n\nfunc NewCond(l sync.Locker) *Cond {\n\tc := &Cond{\n\t\tL:  l,\n\t\tch: make(chan struct{}),\n\t}\n\treturn c\n}\n\nfunc (c *Cond) wait() {\n\tc.checker.check()\n\tc.L.Unlock()\n\tdefer c.L.Lock()\n\t<-c.ch\n\n}\n\nfunc (c *Cond) waitFor(timeout time.Duration) error {\n\tc.L.Unlock()\n\tdefer c.L.Lock()\n\n\tselect {\n\tcase <-c.ch:\n\t\treturn nil\n\tcase <-time.After(timeout):\n\t\treturn fmt.Errorf(\"wait timeout: %v\\n\", timeout)\n\t}\n\n}\n\nfunc (c *Cond) WaitForDo(timeout time.Duration, pred func() bool, do func() error) error {\n\tc.checker.check()\n\tc.L.Lock()\n\tdefer c.L.Unlock()\n\n\tfor !pred() {\n\t\tstart := time.Now()\n\t\terr := c.waitFor(timeout)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\ttimeout -= time.Now().Sub(start)\n\t}\n\tif do != nil {\n\t\tdo()\n\t}\n\treturn nil\n}\n\nfunc (c *Cond) WaitUntil(pred func() bool) {\n\tc.checker.check()\n\tc.WaitUntilDo(pred, func() error { return nil })\n}\n\nfunc (c *Cond) WaitUntilDo(pred func() bool, do func() error) {\n\tc.checker.check()\n\tfor {\n\t\terr := c.WaitForDo(5*time.Second, pred, do)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t}\n\n}\n\nfunc (c *Cond) SignalDo(do func() error) {\n\tc.L.Lock()\n\tif do != nil {\n\t\tdo()\n\t}\n\tc.L.Unlock()\n\n\tc.Signal()\n}\n\nfunc (c *Cond) BroadcastDo(do func() error) {\n\tc.L.Lock()\n\tif do != nil {\n\t\tdo()\n\t}\n\tc.L.Unlock()\n\n\tc.Broadcast()\n}\n\nfunc (c *Cond) Signal() {\n\tc.checker.check()\n\tgo func() {\n\t\tselect {\n\t\tcase c.ch <- struct{}{}:\n\t\tdefault:\n\t\t}\n\t}()\n}\n\nfunc (c *Cond) Broadcast() {\n\tc.checker.check()\n\tgo func() {\n\t\tclose(c.ch)\n\t\tc.ch = make(chan struct{})\n\t}()\n}\n\n// copyChecker holds back pointer to itself to detect object copying.\ntype copyChecker uintptr\n\nfunc (c *copyChecker) check() {\n\tif uintptr(*c) != uintptr(unsafe.Pointer(c)) &&\n\t\t!atomic.CompareAndSwapUintptr((*uintptr)(c), 0, uintptr(unsafe.Pointer(c))) &&\n\t\tuintptr(*c) != uintptr(unsafe.Pointer(c)) {\n\t\tpanic(\"sync.Cond is copied\")\n\t}\n}\n\n// noCopy may be embedded into structs which must not be copied\n// after the first use.\n//\n// See https://golang.org/issues/8005#issuecomment-190753527\n// for details.\ntype noCopy struct{}\n\n// Lock is a no-op used by -copylocks checker from `go vet`.\nfunc (*noCopy) Lock()   {}\nfunc (*noCopy) Unlock() {}\n"
  },
  {
    "path": "go/sync/cond_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage sync_test\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\tsync_ \"github.com/kaydxh/golang/go/sync\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestWaitForDo(t *testing.T) {\n\tassert := assert.New(t)\n\n\tl := new(sync.Mutex)\n\tcond := sync_.NewCond(l)\n\ta := 5\n\ttimout := 4 * time.Second\n\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\terr := cond.WaitForDo(timout, func() bool {\n\t\t\tfmt.Printf(\"==>a = %v\\n\", a)\n\t\t\treturn a == 3\n\t\t}, func() error {\n\t\t\ta += 100\n\t\t\tfmt.Printf(\"a: %v\\n\", a)\n\t\t\tassert.Equal(103, a)\n\t\t\treturn nil\n\t\t})\n\t\tassert.Equal(nil, err)\n\t}()\n\n\tgo func() {\n\t\tfor {\n\t\t\tcond.SignalDo(func() error {\n\t\t\t\ta--\n\t\t\t\t//this sleep can increase the probability to waitforDo\n\t\t\t\t//miss condition = > a==3\n\t\t\t\ttime.Sleep(1 * time.Second)\n\t\t\t\tfmt.Printf(\"a: %v\\n\", a)\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\t//time.Sleep(1 * time.Second)\n\t\t}\n\t}()\n\n\twg.Wait()\n}\n\n// condion only be fit for range condition\nfunc TestWaitUntilDo(t *testing.T) {\n\tassert := assert.New(t)\n\n\tl := new(sync.Mutex)\n\tcond := sync_.NewCond(l)\n\ta := 5\n\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tcond.WaitUntilDo(func() bool {\n\t\t\tfmt.Printf(\"==>a = %v\\n\", a)\n\t\t\treturn a < 0\n\t\t}, func() error {\n\t\t\tfmt.Printf(\"a: %v\\n\", a)\n\t\t\tassert.LessOrEqual(a, 0)\n\t\t\treturn nil\n\t\t})\n\t}()\n\n\tgo func() {\n\t\tfor {\n\t\t\tcond.SignalDo(func() error {\n\t\t\t\ta--\n\t\t\t\t//this sleep can increase the probability to waitforDo\n\t\t\t\t//miss condition = > a==3\n\t\t\t\ttime.Sleep(1 * time.Second)\n\t\t\t\tfmt.Printf(\"a: %v\\n\", a)\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\t//time.Sleep(1 * time.Second)\n\t\t}\n\t}()\n\n\twg.Wait()\n}\n\nfunc TestBroadCast(t *testing.T) {\n\tassert := assert.New(t)\n\n\tl := new(sync.Mutex)\n\tcond := sync_.NewCond(l)\n\n\tinitValue := 10\n\texpected := 3\n\tthreads := 5\n\n\tvar wg sync.WaitGroup\n\n\tfor i := 0; i < threads; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tcond.WaitForDo(10*time.Second, func() bool {\n\t\t\t\treturn expected == initValue\n\t\t\t}, func() error {\n\t\t\t\tassert.Equal(initValue, expected)\n\t\t\t\tt.Logf(\"wait done\")\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}()\n\t}\n\n\tgo func() {\n\t\tfor {\n\t\t\ttime.Sleep(time.Second)\n\t\t\tcond.BroadcastDo(func() error {\n\t\t\t\tinitValue--\n\t\t\t\tt.Logf(\"init: %v\\n\", initValue)\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t}()\n\n\twg.Wait()\n}\n"
  },
  {
    "path": "go/syscall/disk.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage syscall\n\nimport (\n\t\"syscall\"\n)\n\ntype DiskUsage struct {\n\tstat *syscall.Statfs_t\n}\n\n// NewDiskUsage 直接对目标路径调用 syscall.Statfs 获取磁盘使用信息，\n// 兼容 Linux 和 macOS（不再依赖 /proc/self/mountinfo）。\nfunc NewDiskUsage(path string) (*DiskUsage, error) {\n\tvar stat syscall.Statfs_t\n\terr := syscall.Statfs(path, &stat)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &DiskUsage{&stat}, nil\n}\n\n// Free returns total free bytes on file system\nfunc (du *DiskUsage) Free() uint64 {\n\treturn du.stat.Bfree * uint64(du.stat.Bsize)\n}\n\n//  Avail returns total avail bytes on file system\nfunc (du *DiskUsage) Avail() uint64 {\n\treturn du.stat.Bavail * uint64(du.stat.Bsize)\n}\n\n// Size returns total size of the file system\nfunc (du *DiskUsage) Size() uint64 {\n\treturn uint64(du.stat.Blocks) * uint64(du.stat.Bsize)\n}\n\n// Size returns total used bytes on the file system\nfunc (du *DiskUsage) Used() uint64 {\n\treturn du.Size() - du.Free()\n}\n\n// Usage returns percentage of used on the file system\n/*\nhttps://github.com/coreutils/coreutils/blob/master/src/df.c#:~:text=pct%20%3D%20u100%20/%20nonroot_total%20%2B%20(u100%20%25%20nonroot_total%20!%3D%200)%3B\nBy default, ext2/3/4 filesystems reserve 5% of the space to be useable only by root. This is to avoid a normal user completely filling the disk which would\nthen cause system components to fail whenever they next needed to write to the disk\n*/\nfunc (du *DiskUsage) Usage() float32 {\n\tvar deta float32\n\tu100 := du.Used() * 100\n\tnonrootTotal := du.Used() + du.Avail()\n\tif u100%nonrootTotal != 0 {\n\t\tdeta = 1.0\n\t}\n\treturn float32(u100)/float32(nonrootTotal) + deta\n}\n"
  },
  {
    "path": "go/syscall/disk_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage syscall_test\n\nimport (\n\t\"testing\"\n\n\tsyscall_ \"github.com/kaydxh/golang/go/syscall\"\n)\n\n// GOOS=linux  GOARCH=amd64  go test -c disk_test.go -o test\n// /test -test.v\nfunc TestDiskUsage(t *testing.T) {\n\ttestCases := []struct {\n\t\tvolumePath string\n\t\texpected   string\n\t}{\n\t\t{\n\t\t\tvolumePath: \"/dev\",\n\t\t\texpected:   \"\",\n\t\t},\n\t\t{\n\t\t\tvolumePath: \"/data\",\n\t\t\texpected:   \"\",\n\t\t},\n\t\t{\n\t\t\tvolumePath: \"/data/home/log\",\n\t\t\texpected:   \"\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.volumePath, func(t *testing.T) {\n\t\t\tdu, err := syscall_.NewDiskUsage(testCase.volumePath)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"new disk for path[%v] err, got : %s\", testCase.volumePath, err)\n\t\t\t\treturn\n\n\t\t\t}\n\t\t\tt.Logf(\n\t\t\t\t\"disk free[%v], avali[%v], size[%v], used[%v], usage: %v\",\n\t\t\t\tdu.Free(),\n\t\t\t\tdu.Avail(),\n\t\t\t\tdu.Size(),\n\t\t\t\tdu.Used(),\n\t\t\t\tdu.Usage(),\n\t\t\t)\n\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/syscall/memory_darwin.go",
    "content": "package syscall\n\ntype MemoryUsage struct {\n}\n\nfunc (m MemoryUsage) SysTotalMemory() uint64 {\n\treturn 0\n}\n\nfunc (m MemoryUsage) SysFreeMemory() uint64 {\n\treturn 0\n}\n\nfunc (m MemoryUsage) SysUsageMemory() float64 {\n\treturn 0\n}\n"
  },
  {
    "path": "go/syscall/memory_linux.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage syscall\n\nimport \"syscall\"\n\n// 其他实现可以参考https://github.com/shirou/gopsutil\n// /proc/meminfo\n// /proc/pid/status\ntype MemoryUsage struct {\n}\n\nfunc (m MemoryUsage) SysTotalMemory() uint64 {\n\tin := &syscall.Sysinfo_t{}\n\terr := syscall.Sysinfo(in)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn uint64(in.Totalram) * uint64(in.Unit)\n}\n\nfunc (m MemoryUsage) SysFreeMemory() uint64 {\n\tin := &syscall.Sysinfo_t{}\n\terr := syscall.Sysinfo(in)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn uint64(in.Freeram) * uint64(in.Unit)\n}\n"
  },
  {
    "path": "go/syscall/memory_linux_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */package syscall_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\tsyscall_ \"github.com/kaydxh/golang/go/syscall\"\n\t\"github.com/shirou/gopsutil/mem\"\n)\n\nfunc TestSysTotalMemory(t *testing.T) {\n\ttotal := syscall_.MemoryUsage{}.SysTotalMemory()\n\tt.Logf(\"total: %vG\", total/1024/1024/1024)\n\n\tfree := syscall_.MemoryUsage{}.SysFreeMemory()\n\tt.Logf(\"free: %vG\", free/1024/1024/1024)\n\n\tfor {\n\t\ttime.Sleep(time.Second)\n\t\tv, _ := mem.VirtualMemory()\n\n\t\tfmt.Printf(\n\t\t\t\"Total: %v, Free:%v, UsedPercent:%f%%, Used:%v, Available: %v\\n\",\n\t\t\tv.Total,\n\t\t\tv.Free,\n\t\t\tv.UsedPercent,\n\t\t\tv.Used,\n\t\t\tv.Available,\n\t\t)\n\n\t}\n\n}\n"
  },
  {
    "path": "go/syscall/rlimit.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage syscall\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\n// SetNumFiles sets the linux rlimit for the maximum open files.\nfunc SetNumFiles(maxOpenFiles uint64) error {\n\treturn unix.Setrlimit(unix.RLIMIT_NOFILE, &unix.Rlimit{Max: maxOpenFiles, Cur: maxOpenFiles})\n}\n\nfunc GetNumFiles() (uint64, uint64, error) {\n\tvar (\n\t\trlimit unix.Rlimit\n\t\tzero   unix.Rlimit\n\t)\n\n\terr := unix.Getrlimit(syscall.RLIMIT_NOFILE, &rlimit)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tif rlimit == zero {\n\t\treturn 0, 0, fmt.Errorf(\"failed to get rlimit, got zero value: %#v\", rlimit)\n\t}\n\n\treturn rlimit.Cur, rlimit.Max, nil\n}\n\nfunc SetMaxNumFiles() (uint64, error) {\n\n\t_, maxOpenFiles, err := GetNumFiles()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\terr = SetNumFiles(maxOpenFiles)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tnewCurOpenFiles, _, err := GetNumFiles()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif newCurOpenFiles != maxOpenFiles {\n\t\treturn 0, fmt.Errorf(\"failed to set %d files, current open %v files\", maxOpenFiles, newCurOpenFiles)\n\n\t}\n\n\treturn newCurOpenFiles, nil\n}\n"
  },
  {
    "path": "go/syscall/rlimit_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage syscall_test\n\nimport (\n\t\"testing\"\n\n\tsyscall_ \"github.com/kaydxh/golang/go/syscall\"\n)\n\nfunc TestGetNumFiles(t *testing.T) {\n\n\tcurOpenFiles, maxOpenFiles, err := syscall_.GetNumFiles()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get num files, err: %v\", err)\n\t}\n\n\tt.Logf(\"curOpenFiles: %v,  maxOpenFiles: %v\", curOpenFiles, maxOpenFiles)\n}\n\nfunc TestSetMaxNumFiles(t *testing.T) {\n\n\tcurOpenFiles, err := syscall_.SetMaxNumFiles()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to set max num files, err: %v\", err)\n\t}\n\n\tt.Logf(\"curOpenFiles: %v\", curOpenFiles)\n}\n"
  },
  {
    "path": "go/syscall/syscall.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage syscall\n\nimport (\n\t\"syscall\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n)\n\nfunc KillBatch(pids []int, sig syscall.Signal) (errorPids []int, err error) {\n\tvar errs []error\n\tfor _, pid := range pids {\n\t\terr = syscall.Kill(pid, sig)\n\t\tif err != nil {\n\t\t\terrorPids = append(errorPids, pid)\n\t\t\terrs = append(errs, err)\n\t\t}\n\t}\n\n\treturn errorPids, errors_.NewAggregate(errs)\n}\n"
  },
  {
    "path": "go/time/backoff.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time\n\nimport \"time\"\n\ntype Backoff interface {\n\tNextBackOff() (time.Duration, bool)\n\tReset()\n}\n"
  },
  {
    "path": "go/time/exponential_backoff.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time\n\nimport (\n\t\"math/rand\"\n\t\"time\"\n)\n\n// Default values for ExponentialBackOff.\nconst (\n\tDefaultInitialInterval     = 500 * time.Millisecond\n\tDefaultRandomizationFactor = 0.5\n\t// The default multiplier value used for increment current interval\n\tDefaultMultiplier      = 1.5\n\tDefaultMaxInterval     = 60 * time.Second\n\tDefaultMinInterval     = DefaultInitialInterval\n\tDefaultMaxElapsedTime  = 15 * time.Minute\n\tDefaultMaxElapsedCount = -1\n)\n\ntype ExponentialBackOff struct {\n\tcurrentInterval time.Duration\n\tstartTime       time.Time\n\telapsedCount    int\n\n\topts struct {\n\t\tInitialInterval     time.Duration\n\t\tRandomizationFactor float64\n\t\tMultiplier          float64\n\t\tMinInterval         time.Duration\n\t\tMaxInterval         time.Duration\n\t\t// After MaxElapsedTime the ExponentialBackOff returns Stop.\n\t\t// It never stops if MaxElapsedTime == 0.\n\t\tMaxElapsedTime time.Duration\n\t\t// It never stops if MaxElapsedCount == -1.\n\t\tMaxElapsedCount int\n\t\t//notes: when to stop deps on which condition come first, MaxElapsedTime or MaxElapsedCount\n\t}\n}\n\nfunc NewExponentialBackOff(opts ...ExponentialBackOffOption) *ExponentialBackOff {\n\tbo := &ExponentialBackOff{}\n\tbo.opts.InitialInterval = DefaultInitialInterval\n\tbo.opts.RandomizationFactor = DefaultRandomizationFactor\n\tbo.opts.Multiplier = DefaultMultiplier\n\tbo.opts.MaxInterval = DefaultMaxInterval\n\tbo.opts.MinInterval = DefaultMinInterval\n\tbo.opts.MaxElapsedTime = DefaultMaxElapsedTime\n\tbo.opts.MaxElapsedCount = DefaultMaxElapsedCount\n\n\tbo.ApplyOptions(opts...)\n\tbo.Reset()\n\treturn bo\n}\n\nfunc (b *ExponentialBackOff) Reset() {\n\tb.currentInterval = b.opts.InitialInterval\n\tb.startTime = time.Now()\n}\n\nfunc (b *ExponentialBackOff) ResetWithInterval(initialInterval time.Duration) {\n\tb.currentInterval = initialInterval\n\tb.startTime = time.Now()\n}\n\nfunc (b *ExponentialBackOff) GetCurrentInterval() time.Duration {\n\treturn b.currentInterval\n}\n\n// PreBackOff is get previos time duration\n// false : have gone over the maximu elapsed time\n// true : return remaining time\nfunc (b *ExponentialBackOff) PreBackOff() (time.Duration, bool) {\n\tnextRandomizedInterval, ok := b.validateAndGetNextInterval()\n\tif !ok {\n\t\treturn nextRandomizedInterval, false\n\t}\n\tb.elapsedCount++\n\n\t//update currentInterval\n\tb.decrementCurrentInterval()\n\n\treturn nextRandomizedInterval, true\n}\n\n//  NextBackOff is get next time duration\nfunc (b *ExponentialBackOff) NextBackOff() (time.Duration, bool) {\n\tb.elapsedCount++\n\tnextRandomizedInterval, ok := b.validateAndGetNextInterval()\n\tif !ok {\n\t\treturn nextRandomizedInterval, false\n\t}\n\n\t//update currentInterval\n\tb.incrementCurrentInterval()\n\n\treturn nextRandomizedInterval, true\n}\n\nfunc (b *ExponentialBackOff) GetElapsedTime() time.Duration {\n\treturn time.Now().Sub(b.startTime)\n}\n\nfunc (b *ExponentialBackOff) MaxElapsedTime() time.Duration {\n\treturn b.opts.MaxElapsedTime\n}\n\nfunc (b *ExponentialBackOff) validateAndGetNextInterval() (time.Duration, bool) {\n\telapsed := b.GetElapsedTime()\n\tnextRandomizedInterval := getRandomValueFromInterval(b.opts.RandomizationFactor, b.currentInterval)\n\n\tif b.opts.MaxElapsedTime > 0 && elapsed > b.opts.MaxElapsedTime {\n\t\treturn nextRandomizedInterval, false\n\t}\n\n\tif b.opts.MaxElapsedCount > -1 && b.elapsedCount > b.opts.MaxElapsedCount {\n\t\treturn nextRandomizedInterval, false\n\t}\n\n\treturn nextRandomizedInterval, true\n}\n\n// Increment the current interval by multiplying it with the multiplier\nfunc (b *ExponentialBackOff) incrementCurrentInterval() {\n\tif b.opts.MaxInterval > 0 && time.Duration(float64(b.currentInterval)*b.opts.Multiplier) > b.opts.MaxInterval {\n\t\tb.currentInterval = b.opts.MaxInterval\n\t\treturn\n\t}\n\n\tif b.opts.MinInterval > 0 && time.Duration(float64(b.currentInterval)*b.opts.Multiplier) < b.opts.MinInterval {\n\t\tb.currentInterval = b.opts.MinInterval\n\t\treturn\n\t}\n\n\tb.currentInterval = time.Duration(float64(b.currentInterval) * b.opts.Multiplier)\n}\n\n// decrement the current interval by multiplying it with the multiplier\nfunc (b *ExponentialBackOff) decrementCurrentInterval() {\n\tif b.opts.MaxInterval > 0 &&\n\t\ttime.Duration(float64(b.currentInterval)*(1.0/b.opts.Multiplier)) > b.opts.MaxInterval {\n\t\tb.currentInterval = b.opts.MaxInterval\n\t\treturn\n\t}\n\n\tif b.opts.MinInterval > 0 &&\n\t\ttime.Duration(float64(b.currentInterval)*(1.0/b.opts.Multiplier)) < b.opts.MinInterval {\n\t\tb.currentInterval = b.opts.MinInterval\n\t\treturn\n\t}\n\n\tb.currentInterval = time.Duration(float64(b.currentInterval) * (1.0 / b.opts.Multiplier))\n}\n\nfunc getRandomValueFromInterval(\n\trandomizationFactor float64,\n\tcurrentInterval time.Duration,\n) time.Duration {\n\tvar delta = randomizationFactor * float64(currentInterval)\n\tvar minInterval = float64(currentInterval) - delta\n\tvar maxInterval = float64(currentInterval) + delta\n\n\t// Get a random value from the range [minInterval, maxInterval].\n\t// The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then\n\t// we want a 33% chance for selecting either 1, 2 or 3.\n\t//Float64 returns, as a float64, a pseudo-random number in [0.0,1.0)\n\t//from the default Source.\n\treturn time.Duration(minInterval + (rand.Float64() * (maxInterval - minInterval + 1)))\n\n}\n"
  },
  {
    "path": "go/time/exponential_backoff.options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time\n\nimport \"time\"\n\nfunc WithExponentialBackOffOptionInitialInterval(initialInterval time.Duration) ExponentialBackOffOption {\n\treturn ExponentialBackOffOptionFunc(func(opt *ExponentialBackOff) {\n\t\topt.opts.InitialInterval = initialInterval\n\t})\n}\n\nfunc WithExponentialBackOffOptionRandomizationFactor(randomizationFactor float64) ExponentialBackOffOption {\n\treturn ExponentialBackOffOptionFunc(func(opt *ExponentialBackOff) {\n\t\topt.opts.RandomizationFactor = randomizationFactor\n\t})\n}\n\nfunc WithExponentialBackOffOptionMultiplier(multiplier float64) ExponentialBackOffOption {\n\treturn ExponentialBackOffOptionFunc(func(opt *ExponentialBackOff) {\n\t\topt.opts.Multiplier = multiplier\n\t})\n}\n\nfunc WithExponentialBackOffOptionMaxInterval(maxInterval time.Duration) ExponentialBackOffOption {\n\treturn ExponentialBackOffOptionFunc(func(opt *ExponentialBackOff) {\n\t\topt.opts.MaxInterval = maxInterval\n\t})\n}\n\nfunc WithExponentialBackOffOptionMinInterval(minInterval time.Duration) ExponentialBackOffOption {\n\treturn ExponentialBackOffOptionFunc(func(opt *ExponentialBackOff) {\n\t\topt.opts.MinInterval = minInterval\n\t})\n}\n\nfunc WithExponentialBackOffOptionMaxElapsedTime(maxElapsedTime time.Duration) ExponentialBackOffOption {\n\treturn ExponentialBackOffOptionFunc(func(opt *ExponentialBackOff) {\n\t\topt.opts.MaxElapsedTime = maxElapsedTime\n\t})\n}\n\nfunc WithExponentialBackOffOptionMaxElapsedCount(maxElapsedCount int) ExponentialBackOffOption {\n\treturn ExponentialBackOffOptionFunc(func(opt *ExponentialBackOff) {\n\t\topt.opts.MaxElapsedCount = maxElapsedCount\n\t})\n}\n"
  },
  {
    "path": "go/time/exponential_backoff_options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time\n\n// A ExponentialBackOffOption sets options.\ntype ExponentialBackOffOption interface {\n\tapply(*ExponentialBackOff)\n}\n\n// EmptyExponentialBackOffUrlOption does not alter the ExponentialBackOffuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyExponentialBackOffOption struct{}\n\nfunc (EmptyExponentialBackOffOption) apply(*ExponentialBackOff) {}\n\n// ExponentialBackOffOptionFunc wraps a function that modifies ExponentialBackOff into an\n// implementation of the ExponentialBackOffOption interface.\ntype ExponentialBackOffOptionFunc func(*ExponentialBackOff)\n\nfunc (f ExponentialBackOffOptionFunc) apply(do *ExponentialBackOff) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ExponentialBackOffOptionWithDefault() ExponentialBackOffOption {\n\treturn ExponentialBackOffOptionFunc(func(*ExponentialBackOff) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *ExponentialBackOff) ApplyOptions(options ...ExponentialBackOffOption) *ExponentialBackOff {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "go/time/exponential_backoff_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"gotest.tools/assert\"\n)\n\nfunc TestExponentialBackOff(t *testing.T) {\n\tvar (\n\t\ttestInitialInterval     = 500 * time.Millisecond\n\t\ttestRandomizationFactor = 0.1\n\t\ttestMultiplier          = 2.0\n\t\ttestMaxInterval         = 5 * time.Second\n\t\ttestMaxElapsedTime      = 15 * time.Minute\n\t\ttestMaxElasedCount      = 1\n\t)\n\n\texp := time_.NewExponentialBackOff(\n\t\ttime_.WithExponentialBackOffOptionInitialInterval(testInitialInterval),\n\t\ttime_.WithExponentialBackOffOptionRandomizationFactor(testRandomizationFactor),\n\t\ttime_.WithExponentialBackOffOptionMultiplier(testMultiplier),\n\t\ttime_.WithExponentialBackOffOptionMaxInterval(testMaxInterval),\n\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(testMaxElapsedTime),\n\t\ttime_.WithExponentialBackOffOptionMaxElapsedCount(testMaxElasedCount),\n\t)\n\n\texpectedResults := []time.Duration{500, 1000, 2000, 4000, 5000, 5000, 5000, 5000, 5000, 5000}\n\tfor i, d := range expectedResults {\n\t\texpectedResults[i] = d * time.Millisecond\n\t}\n\tfor _, expected := range expectedResults {\n\t\tassert.Equal(t, expected, exp.GetCurrentInterval())\n\t\t// Assert that the next backoff falls in the expected range.\n\t\tvar minInterval = expected - time.Duration(testRandomizationFactor*float64(expected))\n\t\tvar maxInterval = expected + time.Duration(testRandomizationFactor*float64(expected))\n\t\tactualInterval, over := exp.NextBackOff()\n\t\tt.Logf(\"over: %v, actualInterval: %v\", over, actualInterval)\n\t\tif !(minInterval <= actualInterval && actualInterval <= maxInterval) {\n\t\t\tt.Error(\"error\")\n\t\t}\n\t}\n\n}\n\nfunc TestExponentialBackOffMaxElaspedTimeFailOver(t *testing.T) {\n\tvar (\n\t\ttestInitialInterval     = 500 * time.Millisecond\n\t\ttestRandomizationFactor = 0.1\n\t\ttestMultiplier          = 2.0\n\t\ttestMaxInterval         = 5 * time.Second\n\t\ttestMaxElapsedTime      = 10 * time.Second\n\t)\n\n\texp := time_.NewExponentialBackOff(\n\t\ttime_.WithExponentialBackOffOptionInitialInterval(testInitialInterval),\n\t\ttime_.WithExponentialBackOffOptionRandomizationFactor(testRandomizationFactor),\n\t\ttime_.WithExponentialBackOffOptionMultiplier(testMultiplier),\n\t\ttime_.WithExponentialBackOffOptionMaxInterval(testMaxInterval),\n\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(testMaxElapsedTime),\n\t)\n\n\texpectedResults := []time.Duration{500, 1000, 2000, 4000, 5000, 5000, 5000, 5000, 5000, 5000}\n\tfor i, d := range expectedResults {\n\t\texpectedResults[i] = d * time.Millisecond\n\t}\n\tfor _, expected := range expectedResults {\n\t\tassert.Equal(t, expected, exp.GetCurrentInterval())\n\t\t// Assert that the next backoff falls in the expected range.\n\t\tvar minInterval = expected - time.Duration(testRandomizationFactor*float64(expected))\n\t\tvar maxInterval = expected + time.Duration(testRandomizationFactor*float64(expected))\n\t\tactualInterval, over := exp.NextBackOff()\n\t\tt.Logf(\"over: %v, actualInterval: %v\", over, actualInterval)\n\t\tif !(minInterval <= actualInterval && actualInterval <= maxInterval) {\n\t\t\tt.Error(\"error\")\n\t\t}\n\t\ttime.Sleep(actualInterval)\n\t}\n\n}\n\nfunc TestDescExponentialBackOff(t *testing.T) {\n\tvar (\n\t\ttestInitialInterval     = 5 * time.Second\n\t\ttestRandomizationFactor = 0.1\n\t\ttestMultiplier          = 0.5\n\t\ttestMaxInterval         = testInitialInterval\n\t\ttestMinInterval         = 100 * time.Millisecond\n\t\ttestMaxElapsedTime      = time.Duration(0)\n\t)\n\n\texp := time_.NewExponentialBackOff(\n\t\ttime_.WithExponentialBackOffOptionInitialInterval(testInitialInterval),\n\t\ttime_.WithExponentialBackOffOptionRandomizationFactor(testRandomizationFactor),\n\t\ttime_.WithExponentialBackOffOptionMultiplier(testMultiplier),\n\t\ttime_.WithExponentialBackOffOptionMaxInterval(testMaxInterval),\n\t\ttime_.WithExponentialBackOffOptionMinInterval(testMinInterval),\n\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(testMaxElapsedTime),\n\t)\n\n\texpectedResults := []time.Duration{500, 250, 125, 62, 31, 16, 8, 4, 2, 2, 2}\n\tfor i, d := range expectedResults {\n\t\texpectedResults[i] = d * time.Millisecond\n\t}\n\tfor _, expected := range expectedResults {\n\t\t//\tassert.Equal(t, expected, exp.GetCurrentInterval())\n\t\t// Assert that the next backoff falls in the expected range.\n\t\tvar minInterval = expected - time.Duration(testRandomizationFactor*float64(expected))\n\t\tvar maxInterval = expected + time.Duration(testRandomizationFactor*float64(expected))\n\t\tactualInterval, over := exp.NextBackOff()\n\t\tt.Logf(\"over: %v, actualInterval: %v\", over, actualInterval)\n\t\tif !(minInterval <= actualInterval && actualInterval <= maxInterval) {\n\t\t}\n\t}\n\n\tt.Logf(\"starting back...\")\n\tfor _, expected := range expectedResults {\n\t\t//\tassert.Equal(t, expected, exp.GetCurrentInterval())\n\t\t// Assert that the next backoff falls in the expected range.\n\t\tvar minInterval = expected - time.Duration(testRandomizationFactor*float64(expected))\n\t\tvar maxInterval = expected + time.Duration(testRandomizationFactor*float64(expected))\n\t\tactualInterval, over := exp.PreBackOff()\n\t\tt.Logf(\"over: %v, actualInterval: %v\", over, actualInterval)\n\t\tif !(minInterval <= actualInterval && actualInterval <= maxInterval) {\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "go/time/exponentialbackeoff_syncmap.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time\n\nimport (\n\t\"sync\" // Used by sync.Map.\n)\n\ntype ExponentialBackOffMap sync.Map\n\n// Generate code that will fail if the constants change value.\nfunc _() {\n\t// An \"cannot convert ExponentialBackOffMap literal (type ExponentialBackOffMap) to type sync.Map\" compiler error signifies that the base type have changed.\n\t// Re-run the go-syncmap command to generate them again.\n\t_ = (sync.Map)(ExponentialBackOffMap{})\n}\n\nvar _nil_ExponentialBackOffMap_ExponentialBackOff_value = func() (val ExponentialBackOff) { return }()\n\n// Load returns the value stored in the map for a key, or nil if no\n// value is present.\n// The ok result indicates whether value was found in the map.\nfunc (m *ExponentialBackOffMap) Load(key string) (ExponentialBackOff, bool) {\n\tvalue, ok := (*sync.Map)(m).Load(key)\n\tif value == nil {\n\t\treturn _nil_ExponentialBackOffMap_ExponentialBackOff_value, ok\n\t}\n\treturn value.(ExponentialBackOff), ok\n}\n\n// Store sets the value for a key.\nfunc (m *ExponentialBackOffMap) Store(key string, value ExponentialBackOff) {\n\t(*sync.Map)(m).Store(key, value)\n}\n\n// LoadOrStore returns the existing value for the key if present.\n// Otherwise, it stores and returns the given value.\n// The loaded result is true if the value was loaded, false if stored.\nfunc (m *ExponentialBackOffMap) LoadOrStore(key string, value ExponentialBackOff) (ExponentialBackOff, bool) {\n\tactual, loaded := (*sync.Map)(m).LoadOrStore(key, value)\n\tif actual == nil {\n\t\treturn _nil_ExponentialBackOffMap_ExponentialBackOff_value, loaded\n\t}\n\treturn actual.(ExponentialBackOff), loaded\n}\n\n// LoadAndDelete deletes the value for a key, returning the previous value if any.\n// The loaded result reports whether the key was present.\nfunc (m *ExponentialBackOffMap) LoadAndDelete(key string) (value ExponentialBackOff, loaded bool) {\n\tactual, loaded := (*sync.Map)(m).LoadAndDelete(key)\n\tif actual == nil {\n\t\treturn _nil_ExponentialBackOffMap_ExponentialBackOff_value, loaded\n\t}\n\treturn actual.(ExponentialBackOff), loaded\n}\n\n// Delete deletes the value for a key.\nfunc (m *ExponentialBackOffMap) Delete(key string) {\n\t(*sync.Map)(m).Delete(key)\n}\n\n// Range calls f sequentially for each key and value present in the map.\n// If f returns false, range stops the iteration.\n//\n// Range does not necessarily correspond to any consistent snapshot of the Map's\n// contents: no key will be visited more than once, but if the value for any key\n// is stored or deleted concurrently, Range may reflect any mapping for that key\n// from any point during the Range call.\n//\n// Range may be O(N) with the number of elements in the map even if f returns\n// false after a constant number of calls.\nfunc (m *ExponentialBackOffMap) Range(f func(key string, value ExponentialBackOff) bool) {\n\t(*sync.Map)(m).Range(func(key, value interface{}) bool {\n\t\treturn f(key.(string), value.(ExponentialBackOff))\n\t})\n}\n"
  },
  {
    "path": "go/time/rate/rate.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n)\n\n// Limiter 基于 channel 信号量的并发控制限流器\ntype Limiter struct {\n\tmu    sync.Mutex\n\tburst int\n\tsem   chan struct{}\n}\n\n// NewLimiter returns a new Limiter that permits bursts of at most b tokens.\nfunc NewLimiter(b int) *Limiter {\n\tif b <= 0 {\n\t\tb = 1\n\t}\n\tl := &Limiter{\n\t\tburst: b,\n\t\tsem:   make(chan struct{}, b),\n\t}\n\t// 预填充令牌\n\tfor i := 0; i < b; i++ {\n\t\tl.sem <- struct{}{}\n\t}\n\treturn l\n}\n\n// Burst returns the maximum burst size.\nfunc (lim *Limiter) Burst() int {\n\tlim.mu.Lock()\n\tdefer lim.mu.Unlock()\n\treturn lim.burst\n}\n\n// Tokens returns the current available tokens.\nfunc (lim *Limiter) Tokens() int {\n\treturn len(lim.sem)\n}\n\n// Bursting returns the number of tokens currently in use.\nfunc (lim *Limiter) Bursting() int {\n\tlim.mu.Lock()\n\tdefer lim.mu.Unlock()\n\treturn lim.burst - len(lim.sem)\n}\n\n// Allow attempts to acquire a token immediately without waiting.\nfunc (lim *Limiter) Allow() bool {\n\tselect {\n\tcase <-lim.sem:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// AllowN attempts to acquire n tokens immediately without waiting.\nfunc (lim *Limiter) AllowN(n int) bool {\n\tif n <= 0 {\n\t\treturn true\n\t}\n\tif n > lim.burst {\n\t\treturn false\n\t}\n\n\tacquired := 0\n\tfor i := 0; i < n; i++ {\n\t\tselect {\n\t\tcase <-lim.sem:\n\t\t\tacquired++\n\t\tdefault:\n\t\t\t// 获取失败，归还已获取的令牌\n\t\t\tfor j := 0; j < acquired; j++ {\n\t\t\t\tlim.sem <- struct{}{}\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// AllowWaitUntil waits indefinitely until a token is available.\nfunc (lim *Limiter) AllowWaitUntil() bool {\n\t<-lim.sem\n\treturn true\n}\n\n// AllowFor attempts to acquire a token with timeout.\n// If timeout < 0, it waits indefinitely.\n// If timeout == 0, it returns immediately.\nfunc (lim *Limiter) AllowFor(timeout time.Duration) bool {\n\tif timeout == 0 {\n\t\treturn lim.Allow()\n\t}\n\tif timeout < 0 {\n\t\treturn lim.AllowWaitUntil()\n\t}\n\n\tselect {\n\tcase <-lim.sem:\n\t\treturn true\n\tcase <-time.After(timeout):\n\t\treturn false\n\t}\n}\n\n// AllowContext attempts to acquire a token with context support.\nfunc (lim *Limiter) AllowContext(ctx context.Context) error {\n\tselect {\n\tcase <-lim.sem:\n\t\treturn nil\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\t}\n}\n\n// Put returns one token to the limiter.\nfunc (lim *Limiter) Put() {\n\tlim.PutN(1)\n}\n\n// PutN returns n tokens to the limiter.\nfunc (lim *Limiter) PutN(n int) {\n\tfor i := 0; i < n; i++ {\n\t\tselect {\n\t\tcase lim.sem <- struct{}{}:\n\t\tdefault:\n\t\t\t// channel is full, ignore\n\t\t}\n\t}\n}\n\n// WaitFor waits for one token with timeout.\nfunc (lim *Limiter) WaitFor(timeout time.Duration) error {\n\treturn lim.WaitN(timeout, 1)\n}\n\n// WaitN waits for n tokens with timeout.\nfunc (lim *Limiter) WaitN(timeout time.Duration, n int) error {\n\tif n <= 0 {\n\t\treturn nil\n\t}\n\tif n > lim.burst {\n\t\treturn fmt.Errorf(\"rate: Wait(n=%d) exceeds limiter's burst %d\", n, lim.burst)\n\t}\n\n\tacquired := 0\n\t// 失败时归还已获取的令牌\n\tdefer func() {\n\t\tif acquired < n {\n\t\t\tlim.PutN(acquired)\n\t\t}\n\t}()\n\n\t// 无限等待\n\tif timeout < 0 {\n\t\tfor acquired < n {\n\t\t\t<-lim.sem\n\t\t\tacquired++\n\t\t}\n\t\treturn nil\n\t}\n\n\t// 带超时等待\n\tdeadline := time.Now().Add(timeout)\n\tfor acquired < n {\n\t\tremaining := time.Until(deadline)\n\t\tif remaining <= 0 {\n\t\t\treturn fmt.Errorf(\"rate: Wait timeout after acquiring %d/%d tokens\", acquired, n)\n\t\t}\n\n\t\tselect {\n\t\tcase <-lim.sem:\n\t\t\tacquired++\n\t\tcase <-time.After(remaining):\n\t\t\treturn fmt.Errorf(\"rate: Wait timeout after acquiring %d/%d tokens\", acquired, n)\n\t\t}\n\t}\n\treturn nil\n}\n\n// WaitContext waits for one token with context support.\nfunc (lim *Limiter) WaitContext(ctx context.Context) error {\n\treturn lim.WaitNContext(ctx, 1)\n}\n\n// WaitNContext waits for n tokens with context support.\nfunc (lim *Limiter) WaitNContext(ctx context.Context, n int) error {\n\tif n <= 0 {\n\t\treturn nil\n\t}\n\tif n > lim.burst {\n\t\treturn fmt.Errorf(\"rate: Wait(n=%d) exceeds limiter's burst %d\", n, lim.burst)\n\t}\n\n\tacquired := 0\n\tdefer func() {\n\t\tif acquired < n {\n\t\t\tlim.PutN(acquired)\n\t\t}\n\t}()\n\n\tfor acquired < n {\n\t\tselect {\n\t\tcase <-lim.sem:\n\t\t\tacquired++\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\t}\n\t}\n\treturn nil\n}\n\n// SetBurst dynamically adjusts the burst size.\nfunc (lim *Limiter) SetBurst(newBurst int) {\n\tif newBurst <= 0 {\n\t\tnewBurst = 1\n\t}\n\n\tlim.mu.Lock()\n\tdefer lim.mu.Unlock()\n\n\toldBurst := lim.burst\n\tif newBurst == oldBurst {\n\t\treturn\n\t}\n\n\t// 创建新的 channel\n\tnewSem := make(chan struct{}, newBurst)\n\n\t// 转移现有令牌\n\tcurrentTokens := len(lim.sem)\n\ttransferTokens := currentTokens\n\tif transferTokens > newBurst {\n\t\ttransferTokens = newBurst\n\t}\n\n\tfor i := 0; i < transferTokens; i++ {\n\t\tnewSem <- struct{}{}\n\t}\n\n\t// 消耗旧 channel 中多余的令牌\n\tfor i := 0; i < currentTokens-transferTokens; i++ {\n\t\t<-lim.sem\n\t}\n\n\tlim.sem = newSem\n\tlim.burst = newBurst\n}\n"
  },
  {
    "path": "go/time/rate/rate_method.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rate\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n)\n\n// Limiters support for differenet methods\n\ntype MethodLimiter struct {\n\tmu       sync.RWMutex\n\tLimiters map[string]*Limiter\n\t*Limiter\n}\n\nfunc NewMethodLimiter(burst int) *MethodLimiter {\n\tml := &MethodLimiter{\n\t\tLimiters: make(map[string]*Limiter, 0),\n\t\tLimiter:  NewLimiter(burst),\n\t}\n\n\treturn ml\n}\n\nfunc (m *MethodLimiter) AddLimiter(method string, limiter *Limiter) error {\n\tif method == \"\" {\n\t\treturn fmt.Errorf(\"the method can not be empty\")\n\t}\n\tif limiter == nil {\n\t\treturn fmt.Errorf(\"limiter can not be nil\")\n\t}\n\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tif _, ok := m.Limiters[method]; ok {\n\t\treturn fmt.Errorf(\"method: %s already exist\", method)\n\t}\n\tm.Limiters[method] = limiter\n\treturn nil\n}\n\nfunc (m *MethodLimiter) Allow(method string) bool {\n\tm.mu.RLock()\n\tdefer m.mu.RUnlock()\n\n\tlimiter, ok := m.Limiters[method]\n\tif !ok {\n\t\treturn m.Limiter.Allow()\n\t}\n\n\treturn limiter.Allow()\n}\n\nfunc (m *MethodLimiter) AllowFor(method string, timeout time.Duration) bool {\n\tm.mu.RLock()\n\tdefer m.mu.RUnlock()\n\n\tlimiter, ok := m.Limiters[method]\n\tif !ok {\n\t\treturn m.Limiter.AllowFor(timeout)\n\t}\n\n\treturn limiter.AllowFor(timeout)\n}\n\nfunc (m *MethodLimiter) Put(method string) {\n\tm.mu.RLock()\n\tdefer m.mu.RUnlock()\n\n\tlimiter, ok := m.Limiters[method]\n\tif !ok {\n\t\tm.Limiter.Put()\n\t\treturn\n\t}\n\n\tlimiter.Put()\n}\n"
  },
  {
    "path": "go/time/rate/rate_qps.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rate\n\nimport (\n  \"context\"\n  \"sync\"\n  \"time\"\n)\n\n// QPSLimiter is a rate limiter based on token bucket algorithm.\n// It controls the rate of requests per second (QPS).\ntype QPSLimiter struct {\n  mu         sync.Mutex\n  qps        float64   // tokens generated per second\n  burst      int       // max tokens (bucket size)\n  tokens     float64   // current available tokens\n  lastUpdate time.Time // last token update time\n}\n\n// NewQPSLimiter creates a new QPS-based rate limiter.\n// qps: the rate of tokens generated per second (queries per second)\n// burst: the maximum number of tokens that can be stored (allows burst traffic)\nfunc NewQPSLimiter(qps float64, burst int) *QPSLimiter {\n  return &QPSLimiter{\n    qps:        qps,\n    burst:      burst,\n    tokens:     float64(burst),\n    lastUpdate: time.Now(),\n  }\n}\n\n// SetQPS dynamically updates the QPS rate.\nfunc (l *QPSLimiter) SetQPS(qps float64) {\n  l.mu.Lock()\n  defer l.mu.Unlock()\n  l.qps = qps\n}\n\n// SetBurst dynamically updates the burst size.\nfunc (l *QPSLimiter) SetBurst(burst int) {\n  l.mu.Lock()\n  defer l.mu.Unlock()\n  l.burst = burst\n  if l.tokens > float64(burst) {\n    l.tokens = float64(burst)\n  }\n}\n\n// QPS returns the current QPS rate.\nfunc (l *QPSLimiter) QPS() float64 {\n  l.mu.Lock()\n  defer l.mu.Unlock()\n  return l.qps\n}\n\n// Burst returns the current burst size.\nfunc (l *QPSLimiter) Burst() int {\n  l.mu.Lock()\n  defer l.mu.Unlock()\n  return l.burst\n}\n\n// Tokens returns the current available tokens.\nfunc (l *QPSLimiter) Tokens() float64 {\n  l.mu.Lock()\n  defer l.mu.Unlock()\n  l.refillTokens()\n  return l.tokens\n}\n\n// refillTokens adds tokens based on elapsed time since last update.\n// Must be called with lock held.\nfunc (l *QPSLimiter) refillTokens() {\n  now := time.Now()\n  elapsed := now.Sub(l.lastUpdate).Seconds()\n  l.lastUpdate = now\n\n  // Add tokens based on QPS and elapsed time\n  l.tokens += elapsed * l.qps\n  if l.tokens > float64(l.burst) {\n    l.tokens = float64(l.burst)\n  }\n}\n\n// Allow reports whether one event may happen now.\n// It returns true if the event is allowed, false otherwise.\n// This method does not block.\nfunc (l *QPSLimiter) Allow() bool {\n  return l.AllowN(1)\n}\n\n// AllowN reports whether n events may happen now.\n// It returns true if the events are allowed, false otherwise.\n// This method does not block.\nfunc (l *QPSLimiter) AllowN(n int) bool {\n  l.mu.Lock()\n  defer l.mu.Unlock()\n\n  l.refillTokens()\n\n  if l.tokens >= float64(n) {\n    l.tokens -= float64(n)\n    return true\n  }\n  return false\n}\n\n// Wait blocks until one event is allowed or the context is canceled.\nfunc (l *QPSLimiter) Wait(ctx context.Context) error {\n  return l.WaitN(ctx, 1)\n}\n\n// WaitN blocks until n events are allowed or the context is canceled.\nfunc (l *QPSLimiter) WaitN(ctx context.Context, n int) error {\n  l.mu.Lock()\n  l.refillTokens()\n\n  if l.tokens >= float64(n) {\n    l.tokens -= float64(n)\n    l.mu.Unlock()\n    return nil\n  }\n\n  // Calculate wait time\n  tokensNeeded := float64(n) - l.tokens\n  waitDuration := time.Duration(tokensNeeded / l.qps * float64(time.Second))\n  l.mu.Unlock()\n\n  // Check if context has deadline and if we can wait that long\n  if deadline, ok := ctx.Deadline(); ok {\n    if time.Until(deadline) < waitDuration {\n      return context.DeadlineExceeded\n    }\n  }\n\n  timer := time.NewTimer(waitDuration)\n  defer timer.Stop()\n\n  select {\n  case <-timer.C:\n    l.mu.Lock()\n    l.refillTokens()\n    if l.tokens >= float64(n) {\n      l.tokens -= float64(n)\n      l.mu.Unlock()\n      return nil\n    }\n    l.mu.Unlock()\n    // Retry if not enough tokens (rare case due to timing)\n    return l.WaitN(ctx, n)\n  case <-ctx.Done():\n    return ctx.Err()\n  }\n}\n\n// AllowFor tries to get a token within the specified timeout.\n// Returns true if a token is obtained, false if timeout expires.\nfunc (l *QPSLimiter) AllowFor(timeout time.Duration) bool {\n  if timeout <= 0 {\n    return l.Allow()\n  }\n\n  ctx, cancel := context.WithTimeout(context.Background(), timeout)\n  defer cancel()\n\n  err := l.Wait(ctx)\n  return err == nil\n}\n\n// Put is a no-op for QPS limiter (tokens are time-based, not returned).\n// This method exists to satisfy the Limiter interface compatibility.\nfunc (l *QPSLimiter) Put() {\n  // QPS limiter uses time-based token refill, no need to return tokens\n}\n\n// Reserve returns a Reservation that can be used to wait for the token.\nfunc (l *QPSLimiter) Reserve() *QPSReservation {\n  return l.ReserveN(1)\n}\n\n// ReserveN returns a Reservation for n tokens.\nfunc (l *QPSLimiter) ReserveN(n int) *QPSReservation {\n  l.mu.Lock()\n  defer l.mu.Unlock()\n\n  l.refillTokens()\n\n  r := &QPSReservation{\n    limiter: l,\n    tokens:  n,\n  }\n\n  if l.tokens >= float64(n) {\n    l.tokens -= float64(n)\n    r.ok = true\n    r.timeToAct = time.Now()\n    return r\n  }\n\n  // Calculate when we'll have enough tokens\n  tokensNeeded := float64(n) - l.tokens\n  waitDuration := time.Duration(tokensNeeded / l.qps * float64(time.Second))\n\n  r.ok = true\n  r.timeToAct = time.Now().Add(waitDuration)\n  l.tokens = 0 // Reserve all current tokens\n\n  return r\n}\n\n// QPSReservation holds information about a rate-limited event.\ntype QPSReservation struct {\n  limiter   *QPSLimiter\n  ok        bool\n  tokens    int\n  timeToAct time.Time\n}\n\n// OK returns whether the reservation is valid.\nfunc (r *QPSReservation) OK() bool {\n  return r.ok\n}\n\n// Delay returns the duration to wait before the event can happen.\nfunc (r *QPSReservation) Delay() time.Duration {\n  delay := time.Until(r.timeToAct)\n  if delay < 0 {\n    return 0\n  }\n  return delay\n}\n\n// Cancel cancels the reservation.\nfunc (r *QPSReservation) Cancel() {\n  if !r.ok {\n    return\n  }\n\n  r.limiter.mu.Lock()\n  defer r.limiter.mu.Unlock()\n\n  // Return tokens if we haven't acted yet\n  if time.Now().Before(r.timeToAct) {\n    r.limiter.tokens += float64(r.tokens)\n    if r.limiter.tokens > float64(r.limiter.burst) {\n      r.limiter.tokens = float64(r.limiter.burst)\n    }\n  }\n  r.ok = false\n}\n"
  },
  {
    "path": "go/time/rate/rate_qps_method.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rate\n\nimport (\n  \"context\"\n  \"fmt\"\n  \"sync\"\n  \"time\"\n)\n\n// MethodQPSLimiter supports different QPS limits for different API methods.\ntype MethodQPSLimiter struct {\n  mu       sync.RWMutex\n  limiters map[string]*QPSLimiter // method -> limiter mapping\n  global   *QPSLimiter            // default global limiter\n}\n\n// MethodQPSConfig defines QPS configuration for a specific method.\ntype MethodQPSConfig struct {\n  Method string  // API method name (e.g., \"/api/v1/users\", \"/service.Method\")\n  QPS    float64 // queries per second\n  Burst  int     // max burst size\n}\n\n// NewMethodQPSLimiter creates a new method-level QPS limiter.\n// defaultQPS and defaultBurst are used for methods without specific configuration.\nfunc NewMethodQPSLimiter(defaultQPS float64, defaultBurst int) *MethodQPSLimiter {\n  return &MethodQPSLimiter{\n    limiters: make(map[string]*QPSLimiter),\n    global:   NewQPSLimiter(defaultQPS, defaultBurst),\n  }\n}\n\n// NewMethodQPSLimiterWithConfigs creates a limiter with predefined method configurations.\nfunc NewMethodQPSLimiterWithConfigs(defaultQPS float64, defaultBurst int, configs []MethodQPSConfig) (*MethodQPSLimiter, error) {\n  m := NewMethodQPSLimiter(defaultQPS, defaultBurst)\n  for _, cfg := range configs {\n    if err := m.AddMethod(cfg.Method, cfg.QPS, cfg.Burst); err != nil {\n      return nil, err\n    }\n  }\n  return m, nil\n}\n\n// AddMethod adds a QPS limit for a specific method.\nfunc (m *MethodQPSLimiter) AddMethod(method string, qps float64, burst int) error {\n  if method == \"\" {\n    return fmt.Errorf(\"method cannot be empty\")\n  }\n  if qps <= 0 {\n    return fmt.Errorf(\"qps must be positive, got %v\", qps)\n  }\n  if burst <= 0 {\n    return fmt.Errorf(\"burst must be positive, got %v\", burst)\n  }\n\n  m.mu.Lock()\n  defer m.mu.Unlock()\n\n  if _, exists := m.limiters[method]; exists {\n    return fmt.Errorf(\"method %q already has a limiter configured\", method)\n  }\n\n  m.limiters[method] = NewQPSLimiter(qps, burst)\n  return nil\n}\n\n// SetMethodQPS dynamically updates the QPS for a specific method.\n// If the method doesn't exist, it creates a new limiter.\nfunc (m *MethodQPSLimiter) SetMethodQPS(method string, qps float64, burst int) error {\n  if method == \"\" {\n    return fmt.Errorf(\"method cannot be empty\")\n  }\n  if qps <= 0 {\n    return fmt.Errorf(\"qps must be positive, got %v\", qps)\n  }\n  if burst <= 0 {\n    return fmt.Errorf(\"burst must be positive, got %v\", burst)\n  }\n\n  m.mu.Lock()\n  defer m.mu.Unlock()\n\n  if limiter, exists := m.limiters[method]; exists {\n    limiter.SetQPS(qps)\n    limiter.SetBurst(burst)\n  } else {\n    m.limiters[method] = NewQPSLimiter(qps, burst)\n  }\n  return nil\n}\n\n// RemoveMethod removes the QPS limit for a specific method.\n// After removal, the method will use the global limiter.\nfunc (m *MethodQPSLimiter) RemoveMethod(method string) {\n  m.mu.Lock()\n  defer m.mu.Unlock()\n  delete(m.limiters, method)\n}\n\n// SetGlobalQPS updates the global (default) QPS limit.\nfunc (m *MethodQPSLimiter) SetGlobalQPS(qps float64, burst int) {\n  m.global.SetQPS(qps)\n  m.global.SetBurst(burst)\n}\n\n// getLimiter returns the limiter for the given method.\n// Falls back to global limiter if no specific limiter is configured.\nfunc (m *MethodQPSLimiter) getLimiter(method string) *QPSLimiter {\n  m.mu.RLock()\n  defer m.mu.RUnlock()\n\n  if limiter, exists := m.limiters[method]; exists {\n    return limiter\n  }\n  return m.global\n}\n\n// Allow checks if a request for the given method is allowed.\n// Returns true if allowed, false if rate limited.\nfunc (m *MethodQPSLimiter) Allow(method string) bool {\n  return m.getLimiter(method).Allow()\n}\n\n// AllowN checks if n requests for the given method are allowed.\nfunc (m *MethodQPSLimiter) AllowN(method string, n int) bool {\n  return m.getLimiter(method).AllowN(n)\n}\n\n// AllowFor tries to get permission within the specified timeout.\nfunc (m *MethodQPSLimiter) AllowFor(method string, timeout time.Duration) bool {\n  return m.getLimiter(method).AllowFor(timeout)\n}\n\n// Wait blocks until a request for the given method is allowed.\nfunc (m *MethodQPSLimiter) Wait(ctx context.Context, method string) error {\n  return m.getLimiter(method).Wait(ctx)\n}\n\n// WaitN blocks until n requests for the given method are allowed.\nfunc (m *MethodQPSLimiter) WaitN(ctx context.Context, method string, n int) error {\n  return m.getLimiter(method).WaitN(ctx, n)\n}\n\n// Put is a no-op for QPS limiter (for interface compatibility).\nfunc (m *MethodQPSLimiter) Put(method string) {\n  // QPS limiter uses time-based token refill, no need to return tokens\n}\n\n// GetMethodQPS returns the QPS configuration for a specific method.\n// Returns (qps, burst, exists).\nfunc (m *MethodQPSLimiter) GetMethodQPS(method string) (qps float64, burst int, exists bool) {\n  m.mu.RLock()\n  defer m.mu.RUnlock()\n\n  if limiter, ok := m.limiters[method]; ok {\n    return limiter.QPS(), limiter.Burst(), true\n  }\n  return m.global.QPS(), m.global.Burst(), false\n}\n\n// ListMethods returns all methods with specific QPS limits configured.\nfunc (m *MethodQPSLimiter) ListMethods() []string {\n  m.mu.RLock()\n  defer m.mu.RUnlock()\n\n  methods := make([]string, 0, len(m.limiters))\n  for method := range m.limiters {\n    methods = append(methods, method)\n  }\n  return methods\n}\n\n// Stats returns current QPS stats for all configured methods.\ntype MethodQPSStats struct {\n  Method string  `json:\"method\"`\n  QPS    float64 `json:\"qps\"`\n  Burst  int     `json:\"burst\"`\n  Tokens float64 `json:\"tokens\"` // current available tokens\n}\n\nfunc (m *MethodQPSLimiter) Stats() []MethodQPSStats {\n  m.mu.RLock()\n  defer m.mu.RUnlock()\n\n  stats := make([]MethodQPSStats, 0, len(m.limiters)+1)\n\n  // Global limiter stats\n  stats = append(stats, MethodQPSStats{\n    Method: \"*\",\n    QPS:    m.global.QPS(),\n    Burst:  m.global.Burst(),\n    Tokens: m.global.Tokens(),\n  })\n\n  // Per-method stats\n  for method, limiter := range m.limiters {\n    stats = append(stats, MethodQPSStats{\n      Method: method,\n      QPS:    limiter.QPS(),\n      Burst:  limiter.Burst(),\n      Tokens: limiter.Tokens(),\n    })\n  }\n\n  return stats\n}\n"
  },
  {
    "path": "go/time/rate/rate_qps_test.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rate_test\n\nimport (\n  \"context\"\n  \"sync\"\n  \"sync/atomic\"\n  \"testing\"\n  \"time\"\n\n  \"github.com/kaydxh/golang/go/time/rate\"\n)\n\nfunc TestQPSLimiter_Allow(t *testing.T) {\n  // Create a limiter with 10 QPS and burst of 5\n  limiter := rate.NewQPSLimiter(10, 5)\n\n  // Should allow burst requests immediately\n  for i := 0; i < 5; i++ {\n    if !limiter.Allow() {\n      t.Errorf(\"Allow() should return true for burst request %d\", i)\n    }\n  }\n\n  // 6th request should be rejected (burst exhausted)\n  if limiter.Allow() {\n    t.Error(\"Allow() should return false when burst is exhausted\")\n  }\n\n  // Wait for token refill (100ms = 1 token at 10 QPS)\n  time.Sleep(110 * time.Millisecond)\n\n  // Should allow one more request\n  if !limiter.Allow() {\n    t.Error(\"Allow() should return true after token refill\")\n  }\n}\n\nfunc TestQPSLimiter_Wait(t *testing.T) {\n  limiter := rate.NewQPSLimiter(100, 1) // 100 QPS, burst 1\n\n  // Exhaust the burst\n  limiter.Allow()\n\n  // Wait with timeout\n  ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)\n  defer cancel()\n\n  start := time.Now()\n  err := limiter.Wait(ctx)\n  elapsed := time.Since(start)\n\n  if err != nil {\n    t.Errorf(\"Wait() error = %v\", err)\n  }\n\n  // Should wait approximately 10ms (1/100 second)\n  if elapsed < 5*time.Millisecond || elapsed > 30*time.Millisecond {\n    t.Errorf(\"Wait() took %v, expected ~10ms\", elapsed)\n  }\n}\n\nfunc TestQPSLimiter_WaitTimeout(t *testing.T) {\n  limiter := rate.NewQPSLimiter(1, 1) // 1 QPS, burst 1\n\n  // Exhaust the burst\n  limiter.Allow()\n\n  // Wait with very short timeout (should fail)\n  ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond)\n  defer cancel()\n\n  err := limiter.Wait(ctx)\n  if err != context.DeadlineExceeded {\n    t.Errorf(\"Wait() error = %v, want context.DeadlineExceeded\", err)\n  }\n}\n\nfunc TestQPSLimiter_Concurrent(t *testing.T) {\n  limiter := rate.NewQPSLimiter(1000, 100) // 1000 QPS, burst 100\n\n  var allowed int64\n  var denied int64\n  var wg sync.WaitGroup\n\n  // Launch 200 concurrent requests\n  for i := 0; i < 200; i++ {\n    wg.Add(1)\n    go func() {\n      defer wg.Done()\n      if limiter.Allow() {\n        atomic.AddInt64(&allowed, 1)\n      } else {\n        atomic.AddInt64(&denied, 1)\n      }\n    }()\n  }\n\n  wg.Wait()\n\n  // Should allow exactly burst size immediately\n  if allowed != 100 {\n    t.Logf(\"Allowed: %d, Denied: %d (expected 100 allowed)\", allowed, denied)\n  }\n}\n\nfunc TestMethodQPSLimiter_DifferentMethods(t *testing.T) {\n  limiter := rate.NewMethodQPSLimiter(10, 5) // Default: 10 QPS, burst 5\n\n  // Configure different QPS for different methods\n  err := limiter.AddMethod(\"/api/v1/users\", 100, 20)\n  if err != nil {\n    t.Fatalf(\"AddMethod() error = %v\", err)\n  }\n\n  err = limiter.AddMethod(\"/api/v1/orders\", 50, 10)\n  if err != nil {\n    t.Fatalf(\"AddMethod() error = %v\", err)\n  }\n\n  // Test method-specific limits\n  // /api/v1/users has burst of 20\n  for i := 0; i < 20; i++ {\n    if !limiter.Allow(\"/api/v1/users\") {\n      t.Errorf(\"Allow() should return true for /api/v1/users request %d\", i)\n    }\n  }\n  if limiter.Allow(\"/api/v1/users\") {\n    t.Error(\"Allow() should return false when /api/v1/users burst is exhausted\")\n  }\n\n  // /api/v1/orders has burst of 10\n  for i := 0; i < 10; i++ {\n    if !limiter.Allow(\"/api/v1/orders\") {\n      t.Errorf(\"Allow() should return true for /api/v1/orders request %d\", i)\n    }\n  }\n  if limiter.Allow(\"/api/v1/orders\") {\n    t.Error(\"Allow() should return false when /api/v1/orders burst is exhausted\")\n  }\n\n  // Unknown method uses global limiter (burst 5)\n  for i := 0; i < 5; i++ {\n    if !limiter.Allow(\"/api/v1/unknown\") {\n      t.Errorf(\"Allow() should return true for unknown method request %d\", i)\n    }\n  }\n  if limiter.Allow(\"/api/v1/unknown\") {\n    t.Error(\"Allow() should return false when global burst is exhausted\")\n  }\n}\n\nfunc TestMethodQPSLimiter_SetMethodQPS(t *testing.T) {\n  limiter := rate.NewMethodQPSLimiter(10, 5)\n\n  // Add initial config\n  limiter.AddMethod(\"/api/v1/test\", 100, 10)\n\n  // Update QPS\n  err := limiter.SetMethodQPS(\"/api/v1/test\", 200, 20)\n  if err != nil {\n    t.Fatalf(\"SetMethodQPS() error = %v\", err)\n  }\n\n  qps, burst, exists := limiter.GetMethodQPS(\"/api/v1/test\")\n  if !exists {\n    t.Error(\"Method should exist\")\n  }\n  if qps != 200 {\n    t.Errorf(\"QPS = %v, want 200\", qps)\n  }\n  if burst != 20 {\n    t.Errorf(\"Burst = %v, want 20\", burst)\n  }\n}\n\nfunc TestMethodQPSLimiter_Stats(t *testing.T) {\n  limiter := rate.NewMethodQPSLimiter(10, 5)\n  limiter.AddMethod(\"/api/v1/users\", 100, 20)\n  limiter.AddMethod(\"/api/v1/orders\", 50, 10)\n\n  stats := limiter.Stats()\n\n  if len(stats) != 3 { // global + 2 methods\n    t.Errorf(\"Stats() returned %d entries, want 3\", len(stats))\n  }\n\n  // Check that global is included\n  hasGlobal := false\n  for _, s := range stats {\n    if s.Method == \"*\" {\n      hasGlobal = true\n      if s.QPS != 10 {\n        t.Errorf(\"Global QPS = %v, want 10\", s.QPS)\n      }\n    }\n  }\n  if !hasGlobal {\n    t.Error(\"Stats() should include global limiter\")\n  }\n}\n\nfunc TestMethodQPSLimiter_WithConfigs(t *testing.T) {\n  configs := []rate.MethodQPSConfig{\n    {Method: \"/api/v1/users\", QPS: 100, Burst: 20},\n    {Method: \"/api/v1/orders\", QPS: 50, Burst: 10},\n    {Method: \"/api/v1/products\", QPS: 200, Burst: 50},\n  }\n\n  limiter, err := rate.NewMethodQPSLimiterWithConfigs(10, 5, configs)\n  if err != nil {\n    t.Fatalf(\"NewMethodQPSLimiterWithConfigs() error = %v\", err)\n  }\n\n  methods := limiter.ListMethods()\n  if len(methods) != 3 {\n    t.Errorf(\"ListMethods() returned %d methods, want 3\", len(methods))\n  }\n\n  // Verify each method's config\n  for _, cfg := range configs {\n    qps, burst, exists := limiter.GetMethodQPS(cfg.Method)\n    if !exists {\n      t.Errorf(\"Method %q should exist\", cfg.Method)\n    }\n    if qps != cfg.QPS {\n      t.Errorf(\"Method %q QPS = %v, want %v\", cfg.Method, qps, cfg.QPS)\n    }\n    if burst != cfg.Burst {\n      t.Errorf(\"Method %q Burst = %v, want %v\", cfg.Method, burst, cfg.Burst)\n    }\n  }\n}\n\nfunc BenchmarkQPSLimiter_Allow(b *testing.B) {\n  limiter := rate.NewQPSLimiter(1000000, 10000)\n\n  b.ResetTimer()\n  b.RunParallel(func(pb *testing.PB) {\n    for pb.Next() {\n      limiter.Allow()\n    }\n  })\n}\n\nfunc BenchmarkMethodQPSLimiter_Allow(b *testing.B) {\n  limiter := rate.NewMethodQPSLimiter(1000000, 10000)\n  limiter.AddMethod(\"/api/v1/users\", 1000000, 10000)\n\n  b.ResetTimer()\n  b.RunParallel(func(pb *testing.PB) {\n    for pb.Next() {\n      limiter.Allow(\"/api/v1/users\")\n    }\n  })\n}\n"
  },
  {
    "path": "go/time/rate/rate_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rate_test\n\nimport (\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"time\"\n\n\trate_ \"github.com/kaydxh/golang/go/time/rate\"\n\t\"gotest.tools/assert\"\n)\n\nfunc TestLimitAllow(t *testing.T) {\n\t// The test runs for a few seconds executing many requests and then checks\n\t// that overall number of requests is reasonable.\n\tconst (\n\t\tlimit = 100\n\t\tburst = 100\n\t)\n\n\tvar (\n\t\tnumAll    int32 = 0\n\t\tnumOK     int32 = 0\n\t\tnumFailed int32 = 0\n\t)\n\n\tlim := rate_.NewLimiter(burst)\n\n\tvar wg sync.WaitGroup\n\tf := func() {\n\t\tif ok := lim.Allow(); ok {\n\t\t\tdefer lim.Put()\n\t\t\tatomic.AddInt32(&numOK, 1)\n\t\t\ttime.Sleep(10 * time.Millisecond)\n\n\t\t} else {\n\t\t\tatomic.AddInt32(&numFailed, 1)\n\t\t\t//\t\t\tt.Logf(\"not Allowed, bursting: %v\", lim.Bursting())\n\t\t}\n\n\t\tatomic.AddInt32(&numAll, 1)\n\t\twg.Done()\n\t}\n\n\tstart := time.Now()\n\tend := start.Add(5 * time.Second)\n\n\tfor time.Now().Before(end) {\n\t\twg.Add(1)\n\t\tgo f()\n\t}\n\twg.Wait()\n\n\tassert.Equal(t, numAll, numOK+numFailed)\n\n\t// numOK should get very close to the number of requests allowed  50000.\n\tt.Logf(\"%v request ==> %v requset Allowed, %v request Unallowed \", numAll, numOK, numFailed)\n\n}\n\nfunc TestLimitAllowFor(t *testing.T) {\n\t// The test runs for a few seconds executing many requests and then checks\n\t// that overall number of requests is reasonable.\n\tconst (\n\t\tlimit = 100\n\t\tburst = 100\n\t)\n\n\tvar (\n\t\tnumAll    int32 = 0\n\t\tnumOK     int32 = 0\n\t\tnumFailed int32 = 0\n\t)\n\n\t//timout > 5s, so must process 50001 times\n\ttimeout := 6 * time.Second\n\n\tlim := rate_.NewLimiter(burst)\n\n\tvar wg sync.WaitGroup\n\tf := func() {\n\t\tif ok := lim.AllowFor(timeout); ok {\n\t\t\tdefer lim.Put()\n\t\t\tatomic.AddInt32(&numOK, 1)\n\t\t\t//about process 50000 times in 5s\n\t\t\ttime.Sleep(10 * time.Millisecond)\n\n\t\t} else {\n\t\t\tatomic.AddInt32(&numFailed, 1)\n\t\t\t//\t\t\tt.Logf(\"not Allowed, bursting: %v\", lim.Bursting())\n\t\t}\n\n\t\tatomic.AddInt32(&numAll, 1)\n\t\twg.Done()\n\t}\n\n\tfor i := 0; i < 50001; i++ {\n\t\twg.Add(1)\n\t\tgo f()\n\t}\n\twg.Wait()\n\n\tassert.Equal(t, numAll, numOK+numFailed)\n\n\t// numOK should get very close to the number of requests allowed  50000.\n\tt.Logf(\"%v request ==> %v requset Allowed, %v request Unallowed \", numAll, numOK, numFailed)\n\n}\n"
  },
  {
    "path": "go/time/time.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time\n\nimport \"time\"\n\nconst (\n\tDayFormat             = \"20060102\"\n\tTimeMillFormat        = \"20060102150405.000\"\n\tShortTimeFormat       = \"20060102150405\"\n\tShortDashTimeFormat   = \"2006-01-02-15:04:05\"\n\tDefaultTimeFormat     = \"2006-01-02 15:04:05\"\n\tDefaultTimeMillFormat = \"2006-01-02 15:04:05.000\"\n)\n\nfunc Now() time.Time {\n\tnow := time.Now()\n\treturn now\n}\n\nfunc NowString(layout string) string {\n\ttm := Now()\n\tif layout == \"\" {\n\t\tlayout = DefaultTimeFormat\n\t}\n\n\treturn tm.Format(layout)\n}\n\nfunc BeginningOfDay(days int) time.Time {\n\tnow := time.Now()\n\ttheDay := now.AddDate(0, 0, days)\n\ty, m, d := theDay.Date()\n\treturn time.Date(y, m, d, 0, 0, 0, 0, theDay.Location())\n}\n\nfunc BeginningOfDayString(days int, layout string) string {\n\tnow := time.Now()\n\ttheDay := now.AddDate(0, 0, days)\n\ty, m, d := theDay.Date()\n\n\tif layout == \"\" {\n\t\tlayout = DefaultTimeFormat\n\t}\n\treturn time.Date(y, m, d, 0, 0, 0, 0, theDay.Location()).Format(layout)\n}\n\nfunc EndOfDay(days int) time.Time {\n\tnow := time.Now()\n\ttheDay := now.AddDate(0, 0, days)\n\ty, m, d := theDay.Date()\n\treturn time.Date(y, m, d, 23, 59, 59, int(time.Second-time.Nanosecond), theDay.Location())\n}\n\nfunc EndOfDayString(days int, layout string) string {\n\tnow := time.Now()\n\ttheDay := now.AddDate(0, 0, days)\n\ty, m, d := theDay.Date()\n\n\tif layout == \"\" {\n\t\tlayout = DefaultTimeFormat\n\t}\n\treturn time.Date(\n\t\ty,\n\t\tm,\n\t\td,\n\t\t23,\n\t\t59,\n\t\t59,\n\t\tint(time.Second-time.Nanosecond),\n\t\ttheDay.Location(),\n\t).Format(layout)\n}\n\n// Truncate only happens in UTC semantics, apparently.\n// observed values for truncating given time with 86400 secs:\n//\n// before truncation: 2018/06/01 03:54:54 2018-06-01T03:18:00+09:00\n// after  truncation: 2018/06/01 03:54:54 2018-05-31T09:00:00+09:00\n//\n// This is really annoying when we want to truncate in local time\n// so we hack: we take the apparent local time in the local zone,\n// and pretend that it's in UTC. do our math, and put it back to\n// the local zone\nfunc TruncateToUTC(t time.Time, d time.Duration) time.Time {\n\tif t.Location() == time.UTC {\n\t\treturn t.Truncate(d)\n\t}\n\n\tbase := time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), time.UTC)\n\tbase = base.Truncate(d)\n\n\treturn time.Date(\n\t\tbase.Year(),\n\t\tbase.Month(),\n\t\tbase.Day(),\n\t\tbase.Hour(),\n\t\tbase.Minute(),\n\t\tbase.Second(),\n\t\tbase.Nanosecond(),\n\t\tbase.Location(),\n\t)\n}\n\nfunc TruncateToUTCString(t time.Time, d time.Duration, layout string) string {\n\tutc := TruncateToUTC(t, d)\n\n\tif layout == \"\" {\n\t\tlayout = DefaultTimeFormat\n\t}\n\n\treturn utc.Format(layout)\n}\n"
  },
  {
    "path": "go/time/time_counter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype TimeCounter struct {\n\tstarts  []time.Time\n\tmessage []string\n\teffect  bool\n}\n\nfunc New(effect bool) *TimeCounter {\n\tt := &TimeCounter{\n\t\teffect: effect,\n\t}\n\tif effect {\n\t\tt.starts = append(t.starts, time.Now())\n\t\tt.message = append(t.message, \"start\")\n\t}\n\n\treturn t\n}\n\nfunc (t *TimeCounter) Tick(msg string) {\n\tif t.effect {\n\t\tt.starts = append(t.starts, time.Now())\n\t\tt.message = append(t.message, msg)\n\t}\n}\n\nfunc (t *TimeCounter) Elapse() time.Duration {\n\tif !t.effect {\n\t\treturn time.Duration(0)\n\t}\n\n\tif len(t.starts) == 0 {\n\t\treturn time.Duration(0)\n\t}\n\n\treturn time.Now().Sub(t.starts[0])\n}\n\nfunc (t *TimeCounter) String() string {\n\tif !t.effect {\n\t\treturn \"\"\n\t}\n\n\tvar buf strings.Builder\n\tt.Summary(func(idx int, msg string, cost time.Duration, at time.Time) {\n\t\tbuf.WriteString(fmt.Sprintf(\"#%d, msg: %s, cost: %s, at %s \", idx, msg, cost, at.Format(time.RFC3339)))\n\t})\n\n\treturn buf.String()\n}\n\nfunc (t *TimeCounter) Summary(f func(idx int, msg string, cost time.Duration, at time.Time)) {\n\tif !t.effect {\n\t\treturn\n\t}\n\tif f == nil || t == nil {\n\t\treturn\n\t}\n\n\tif len(t.message) < len(t.starts) {\n\t\treturn\n\t}\n\n\tfor i := 1; i < len(t.starts); i++ {\n\t\tf(i, t.message[i], t.starts[i].Sub(t.starts[i-1]), t.starts[i])\n\t}\n}\n\nfunc (t *TimeCounter) Reset() {\n\tt.starts = nil\n\tt.message = nil\n}\n"
  },
  {
    "path": "go/time/time_counter_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n)\n\nfunc TestAll(t *testing.T) {\n\t//var tc time_.TimeCounter\n\ttc := time_.New(true)\n\tfunc(module string) {\n\t\ttime.Sleep(time.Second)\n\t}(\"module1\")\n\ttc.Tick(\"module1\")\n\n\tfunc(module string) {\n\t\ttime.Sleep(time.Second * 4)\n\t}(\"module2\")\n\ttc.Tick(\"module2\")\n\n\tfmt.Println(tc.String())\n\n}\n"
  },
  {
    "path": "go/time/time_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n)\n\nfunc TestNowString(t *testing.T) {\n\tnow := time_.NowString(\"\")\n\tt.Logf(\"now: %s\", now)\n}\n\nfunc TestBeginningOfDayString(t *testing.T) {\n\tbeginTime := time_.BeginningOfDayString(-1, \"\")\n\tt.Logf(\"beginTime: %s\", beginTime)\n}\n\nfunc TestEndOfDayString(t *testing.T) {\n\tendTime := time_.EndOfDayString(-1, \"\")\n\tt.Logf(\"endTime: %s\", endTime)\n}\n\nfunc TestTruncateToUTCString(t *testing.T) {\n\tnow := time.Now()\n\ttms := time_.TruncateToUTCString(now, time.Millisecond, time_.DefaultTimeMillFormat)\n\ttsc := time_.TruncateToUTCString(now, time.Second, time_.DefaultTimeMillFormat)\n\ttmt := time_.TruncateToUTCString(now, time.Minute, time_.DefaultTimeMillFormat)\n\tthr := time_.TruncateToUTCString(now, time.Hour, time_.DefaultTimeMillFormat)\n\tt.Logf(\"TruncateToUTC Millisecond: %v, Second: %v, Minute: %v, Hour: %v\", tms, tsc, tmt, thr)\n}\n\nfunc TestNowFormat(t *testing.T) {\n\tnow := time.Now()\n\ttm := now.Format(time_.ShortDashTimeFormat)\n\tt.Logf(\"Now: %v\", tm)\n}\n"
  },
  {
    "path": "go/time/wait.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"time\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nvar ErrTimeout = errors.New(\"timeout error\")\n\n// Until loops until context timout, running f every period.\n// Until is syntactic sugar on top of JitterUntil with zero jitter factor and\n// with sliding = true (which means the timer for period starts after the f\n// completes).\nfunc UntilWithContxt(\n\tctx context.Context,\n\tf func(ctx context.Context) error, period time.Duration) {\n\tJitterUntilWithContext(ctx, f, period)\n}\n\nfunc JitterUntilWithContext(\n\tctx context.Context,\n\tf func(ctx context.Context) error,\n\tperiod time.Duration,\n) {\n\tBackOffUntilWithContext(ctx, f,\n\t\tNewExponentialBackOff(\n\t\t\t// forever run\n\t\t\tWithExponentialBackOffOptionMaxElapsedTime(0),\n\t\t\tWithExponentialBackOffOptionInitialInterval(period),\n\t\t\t// ensure equal interval\n\t\t\tWithExponentialBackOffOptionMultiplier(1),\n\t\t\tWithExponentialBackOffOptionRandomizationFactor(0),\n\t\t), true, true)\n\n}\n\n// RetryWithContext retryTime is not include the first call\nfunc RetryWithContext(\n\tctx context.Context,\n\tf func(ctx context.Context) error,\n\tperiod time.Duration,\n\tretryTimes int,\n) error {\n\treturn BackOffUntilWithContext(ctx, f,\n\t\tNewExponentialBackOff(\n\t\t\t// forever run\n\t\t\tWithExponentialBackOffOptionMaxElapsedTime(0),\n\t\t\tWithExponentialBackOffOptionInitialInterval(period),\n\t\t\tWithExponentialBackOffOptionRandomizationFactor(0),\n\t\t\tWithExponentialBackOffOptionMaxElapsedCount(retryTimes),\n\t\t), true, false)\n}\n\n// loop true  -> BackOffUntilWithContext return  until time expired\n// loop false ->  BackOffUntilWithContext return if f return nil,  or time expired\nfunc BackOffUntilWithContext(\n\tctx context.Context,\n\tf func(ctx context.Context) error,\n\tbackoff Backoff,\n\tsliding bool,\n\tloop bool,\n) (err error) {\n\tvar (\n\t\tt       time.Duration\n\t\tremain  time.Duration\n\t\texpired bool\n\t)\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn fmt.Errorf(\"context cancelled: %v\", ctx.Err())\n\t\tdefault:\n\t\t}\n\n\t\ttc := New(true)\n\t\tif !sliding {\n\t\t\t// If it is false then period includes the runtime for f\n\t\t\tt, expired = backoff.NextBackOff()\n\t\t}\n\n\t\tfunc() {\n\t\t\tdefer runtime_.Recover()\n\t\t\terr = f(ctx)\n\t\t\tlogrus.Infof(\"finish call function, err[%v]\", err)\n\t\t}()\n\n\t\tif !loop {\n\t\t\tif err == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\tif sliding {\n\t\t\t// If sliding is true, the period is computed after f runs\n\t\t\ttc.Reset()\n\t\t\tt, expired = backoff.NextBackOff()\n\t\t}\n\t\tif !expired {\n\t\t\treturn errors_.Errore(\n\t\t\t\tfmt.Errorf(\"got max wait time or max count\"),\n\t\t\t\terr)\n\t\t}\n\n\t\tremain = t - tc.Elapse()\n\t\t//\tfmt.Printf(\"remain: %v, data: %v\\n\", remain, time.Now().String())\n\n\t\tfunc() {\n\t\t\tif remain <= 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttimer := time.NewTimer(remain)\n\t\t\tdefer timer.Stop()\n\n\t\t\t// NOTE: b/c there is no priority selection in golang\n\t\t\t// it is possible for this to race, meaning we could\n\t\t\t// trigger t.C and stopCh, and t.C select falls through.\n\t\t\t// In order to mitigate we re-check stopCh at the beginning\n\t\t\t// of every loop to prevent extra executions of f().\n\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\tcase <-timer.C:\n\t\t\t}\n\t\t}()\n\t}\n}\n\nfunc CallWithTimeout(ctx context.Context, timeout time.Duration, f func(ctx context.Context) error) error {\n\ttc := New(true)\n\t\n\t// never timeout\n\tif timeout <= 0 {\n\t\terr := f(ctx)\n\t\ttc.Tick(\"call func\")\n\t\tlogrus.WithField(\"module\", \"CallWithTimeout\").\n\t\t\tWithField(\"timeout\", timeout).\n\t\t\tInfof(\"finish call function %v, err: %v\", tc.String(), err)\n\t\treturn err\n\t}\n\n\t// 创建带超时的 context\n\ttimeoutCtx, cancel := context.WithTimeout(ctx, timeout)\n\tdefer cancel() // 确保取消，避免资源泄漏\n\n\t// 使用 channel 传递结果（避免数据竞争）\n\ttype result struct {\n\t\terr error\n\t}\n\tdone := make(chan result, 1)\n\n\tgo func() {\n\t\terr := f(timeoutCtx) // 使用带超时的 context\n\t\ttc.Tick(\"call func\")\n\t\t\n\t\t// 非阻塞发送结果，避免 goroutine 泄漏\n\t\tselect {\n\t\tcase done <- result{err: err}:\n\t\t\tlogrus.WithField(\"module\", \"CallWithTimeout\").\n\t\t\t\tWithField(\"timeout\", timeout).\n\t\t\t\tInfof(\"finish call function %v, err: %v\", tc.String(), err)\n\t\tcase <-timeoutCtx.Done():\n\t\t\t// 超时了，不发送结果\n\t\t\tlogrus.WithField(\"module\", \"CallWithTimeout\").\n\t\t\t\tWarnf(\"function completed after timeout, err: %v\", err)\n\t\t}\n\t}()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tcase res := <-done:\n\t\treturn res.err\n\tcase <-timeoutCtx.Done():\n\t\treturn ErrTimeout\n\t}\n}\n"
  },
  {
    "path": "go/time/wait_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage time_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n)\n\nfunc TestBackOffUntilWithContext(t *testing.T) {\n\ttestCases := []struct {\n\t\tname    string\n\t\tperiod  time.Duration\n\t\tsliding bool\n\t\tf       func(context.Context) error\n\t\tloop    bool\n\t}{\n\t\t{\n\t\t\tname:    \"test-sliding\",\n\t\t\tperiod:  5 * time.Second,\n\t\t\tsliding: true,\n\t\t\tf: func(context.Context) error {\n\t\t\t\ttime.Sleep(time.Second)\n\t\t\t\tfmt.Println(\"test-sliding\")\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tloop: true,\n\t\t},\n\t\t{\n\t\t\tname:    \"test-nonsliding\",\n\t\t\tsliding: false,\n\t\t\tperiod:  5 * time.Second,\n\t\t\tf: func(context.Context) error {\n\t\t\t\ttime.Sleep(time.Second)\n\t\t\t\tfmt.Println(\"test-nonsliding\")\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tloop: true,\n\t\t},\n\t\t{\n\t\t\tname:    \"test-nonsliding\",\n\t\t\tsliding: false,\n\t\t\tperiod:  5 * time.Second,\n\t\t\tf: func(context.Context) error {\n\t\t\t\ttime.Sleep(time.Second)\n\t\t\t\tfmt.Println(\"test-nonsliding\")\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tloop: false,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\t//ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)\n\t\t\t//defer cancel()\n\t\t\tctx := context.Background()\n\n\t\t\ttime_.BackOffUntilWithContext(\n\t\t\t\tctx,\n\t\t\t\ttestCase.f,\n\t\t\t\ttime_.NewExponentialBackOff(\n\t\t\t\t\t// forever run\n\t\t\t\t\t//time_.WithExponentialBackOffOptionMaxElapsedTime(0),\n\t\t\t\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(20*time.Second),\n\t\t\t\t\ttime_.WithExponentialBackOffOptionInitialInterval(testCase.period),\n\t\t\t\t\ttime_.WithExponentialBackOffOptionMultiplier(1),\n\t\t\t\t\ttime_.WithExponentialBackOffOptionRandomizationFactor(0),\n\t\t\t\t),\n\t\t\t\ttestCase.sliding,\n\t\t\t\ttrue,\n\t\t\t)\n\t\t\t/*\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"failed to write file: %v, got : %s\", testCase.name, err)\n\n\t\t\t\t}\n\t\t\t*/\n\n\t\t})\n\t}\n}\n\nfunc TestRetryWithContext(t *testing.T) {\n\ttestCases := []struct {\n\t\tname      string\n\t\tperiod    time.Duration\n\t\tretryTime int\n\t\tf         func(context.Context) error\n\t}{\n\t\t{\n\t\t\tname:      \"test-retry-nil\",\n\t\t\tperiod:    5 * time.Second,\n\t\t\tretryTime: 3,\n\t\t\tf: func(context.Context) error {\n\t\t\t\ttime.Sleep(time.Second)\n\t\t\t\tfmt.Println(\"test-sliding\")\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"test-retry-error\",\n\t\t\tperiod:    5 * time.Second,\n\t\t\tretryTime: 5,\n\t\t\tf: func(context.Context) error {\n\t\t\t\ttime.Sleep(time.Second)\n\t\t\t\tfmt.Println(\"test-retry-error-sliding\")\n\t\t\t\treturn fmt.Errorf(\"error\")\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\t//ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)\n\t\t\t//defer cancel()\n\t\t\tctx := context.Background()\n\n\t\t\terr := time_.RetryWithContext(\n\t\t\t\tctx,\n\t\t\t\ttestCase.f,\n\t\t\t\ttestCase.period,\n\t\t\t\ttestCase.retryTime,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to call RetryWithContext: %v, got : %s\", testCase.name, err)\n\t\t\t}\n\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "go/unsafe/unsafe.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage unsafe\n\nimport \"unsafe\"\n\nfunc BytesPointer(data []byte) unsafe.Pointer {\n\tif len(data) == 0 {\n\t\treturn nil\n\t}\n\treturn unsafe.Pointer(&data[0])\n}\n"
  },
  {
    "path": "go/utils/compare.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage utils\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\ntype Comparable interface {\n\tEquals(a, b interface{}) bool\n}\n\ntype Comparator interface {\n\tCompare(a, b interface{}) int\n}\n\nfunc CheckComparableTypes(objs ...interface{}) bool {\n\tfor _, obj := range objs {\n\t\tif !CheckComparableType(obj) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc CheckComparableType(a interface{}) bool {\n\tswitch reflect.ValueOf(a).Kind() {\n\tcase reflect.Array, reflect.Slice, reflect.Struct, reflect.Map:\n\t\treturn false\n\n\tdefault:\n\t\treturn true\n\t}\n}\n\n// object (a or b) that contains members that has equality defined will\n// have equality defined or die.\nfunc Equal(a, b interface{}) (bool, error) {\n\tif !CheckComparableTypes(a, b) {\n\t\t_, ok := a.(Comparable)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"not support compare type: %v\", reflect.ValueOf(a).Kind())\n\n\t\t}\n\t\t_, ok = b.(Comparable)\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"not support compare type: %v\", reflect.ValueOf(a).Kind())\n\n\t\t}\n\t}\n\tif a == nil || b == nil {\n\t\treturn a == b, nil\n\t}\n\tv1 := reflect.ValueOf(a)\n\tv2 := reflect.ValueOf(b)\n\tif v1.Type() != v2.Type() {\n\t\treturn false, nil\n\t}\n\n\treturn a == b, nil\n}\n\nfunc DeepEqual(a, b interface{}) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc Compare(a, b interface{}, compare Comparator) int {\n\n\treturn compare.Compare(a, b)\n}\n"
  },
  {
    "path": "go/utils/generics_get.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage utils\n\nfunc GetValueOrFallback[T comparable] (v, defaultValue T) T {\n  var t T\n  if v == t  {\n\treturn defaultValue\n  }\n\n  return v\n}\n\nfunc Pointer[T any](v T) *T {  \n  return &v\n}\n"
  },
  {
    "path": "go/utils/generics_get_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage utils_test\n\nimport (\n\t\"testing\"\n\n\tutils_ \"github.com/kaydxh/golang/go/utils\"\n)\n\nfunc TestGetValueOrFallback(t *testing.T) {\n\tresult := utils_.GetValueOrFallback(0, 20)\n\tt.Logf(\"result: %v\", result)\n}\n"
  },
  {
    "path": "go.mod",
    "content": "module github.com/kaydxh/golang\n\ngo 1.24.0\n\nrequire (\n\tgithub.com/go-playground/validator/v10 v10.28.0\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/stretchr/testify v1.11.1\n)\n\nrequire (\n\tgithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/kr/pretty v0.3.1 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n)\n\nreplace github.com/kaydxh/golang/go => ./go\n"
  },
  {
    "path": "go.sum",
    "content": "github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "pkg/binlog/binlog.archive.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage binlog\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\n\tqueue_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue\"\n\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\ts3_ \"github.com/kaydxh/golang/pkg/storage/s3\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst (\n\tArchiveTaskScheme = \"ArchiveTaskTask\"\n)\n\ntype ArchiveTaskArgs struct {\n\tLocalFilePath  string\n\tRemoteRootPath string\n}\n\ntype ArchiveTask struct {\n\tbucket *s3_.Storage\n}\n\nfunc (t ArchiveTask) Scheme() string {\n\treturn ArchiveTaskScheme\n}\n\nfunc (t ArchiveTask) TaskHandler(ctx context.Context, msg *queue_.Message) (*queue_.MessageResult, error) {\n\tlogger := logrus.WithField(\"message_id\", msg.Id).\n\t\tWithField(\"message_inner_id\", msg.InnerId).\n\t\tWithField(\"module\", \"TaskHandler\")\n\n\tresult := &queue_.MessageResult{\n\t\tId:      msg.Id,\n\t\tInnerId: msg.InnerId,\n\t\tName:    msg.Name,\n\t\tScheme:  msg.Scheme,\n\t}\n\n\tvar args ArchiveTaskArgs\n\terr := json.Unmarshal([]byte(msg.Args), &args)\n\tif err != nil {\n\t\tlogger.WithError(err).Errorf(\"failed to unmarshal msg: %v\", msg)\n\t\treturn result, err\n\t}\n\tdata, err := io_.ReadFile(args.LocalFilePath)\n\tif err != nil {\n\t\tlogger.WithError(err).Errorf(\"failed to read binlog[%v]\", args.LocalFilePath)\n\t\treturn result, err\n\t}\n\tif len(data) == 0 {\n\t\tlogger.Infof(\"binlog[%v] is empty, not need to archive\", args.LocalFilePath)\n\t\treturn result, nil\n\t}\n\n\ts3Path := args.RemoteRootPath\n\terr = t.bucket.WriteAll(ctx, s3Path, data, nil)\n\tif err != nil {\n\t\tlogger.WithError(err).Errorf(\"failed to upload data size[%v] to s3[%v]\", len(data), s3Path)\n\t\treturn result, err\n\t}\n\n\treturn result, nil\n}\n"
  },
  {
    "path": "pkg/binlog/binlog.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage binlog\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n\t\"github.com/kaydxh/golang/go/errors\"\n\tds_ \"github.com/kaydxh/golang/pkg/binlog/datastore\"\n\tmq_ \"github.com/kaydxh/golang/pkg/mq\"\n\ttaskq_ \"github.com/kaydxh/golang/pkg/pool/taskqueue\"\n\tqueue_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue\"\n\t\"github.com/sirupsen/logrus\"\n\t\"golang.org/x/sync/errgroup\"\n)\n\ntype MessageDecoderFunc func(ctx context.Context, data []byte) (interface{}, error)\ntype MessageKeyDecodeFunc func(ctx context.Context, data []byte) (ds_.MessageKey, error)\n\ntype BinlogOptions struct {\n\trootPath       string\n\tprefixName     string\n\tsuffixName     string\n\tflushBatchSize int\n\tflushInterval  time.Duration\n\trotateInterval time.Duration\n\trotateSize     int64\n\n\tremotePrefixPath string\n\tarchive          bool\n\n\tmsgDecodeFunc    MessageDecoderFunc\n\tmsgKeyDecodeFunc MessageKeyDecodeFunc\n}\n\ntype Channel struct {\n\tName string\n}\n\ntype BinlogService struct {\n\tconsumers []mq_.Consumer\n\n\tdataStore ds_.DataStore\n\n\ttaskq *taskq_.Pool\n\n\topts BinlogOptions\n\n\tinShutdown atomic.Bool\n\tmu         sync.Mutex\n\tcancel     func()\n}\n\nfunc defaultBinlogServiceOptions() BinlogOptions {\n\topts := BinlogOptions{\n\t\tprefixName:     \"segment\",\n\t\tsuffixName:     \"log\",\n\t\tflushBatchSize: 1024,\n\t\t//flushBatchSize: 5,\n\t\tflushInterval:  time.Second, // 1s\n\t\trotateInterval: time.Hour,\n\t\trotateSize:     100 * 1024 * 1024, //100M\n\t}\n\tpath, err := os.Getwd()\n\tif err != nil {\n\t\tpath = \"/\"\n\t}\n\topts.rootPath = path\n\treturn opts\n}\n\nfunc NewBinlogService(dataStore ds_.DataStore, taskq *taskq_.Pool, consumers []mq_.Consumer, opts ...BinlogServiceOption) (*BinlogService, error) {\n\t/*\n\t\tif taskq == nil {\n\t\t\treturn nil, fmt.Errorf(\"taskq is empty\")\n\t\t}\n\t*/\n\tif len(consumers) == 0 {\n\t\treturn nil, fmt.Errorf(\"consumers is empty\")\n\t}\n\n\tbs := &BinlogService{\n\t\tdataStore: dataStore,\n\t\ttaskq:     taskq,\n\t\tconsumers: consumers,\n\t\topts:      defaultBinlogServiceOptions(),\n\t}\n\tbs.ApplyOptions(opts...)\n\n\treturn bs, nil\n}\n\n// send archive path to topic\nfunc (srv *BinlogService) rotateCallback(ctx context.Context, path string) {\n\tlogger := srv.logger()\n\n\tif srv.taskq == nil {\n\t\treturn\n\t}\n\n\tif srv.opts.archive {\n\t\targs := &ArchiveTaskArgs{\n\t\t\tLocalFilePath:  path,\n\t\t\tRemoteRootPath: filepath.Join(srv.opts.remotePrefixPath, filepath.Base(path)),\n\t\t}\n\t\tdata, err := json.Marshal(args)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"failed to marshal args: %v\", args)\n\t\t\treturn\n\t\t}\n\n\t\tid := uuid.NewString()\n\t\tmsg := &queue_.Message{\n\t\t\tId:     id,\n\t\t\tName:   id,\n\t\t\tScheme: ArchiveTaskScheme,\n\t\t\tArgs:   string(data),\n\t\t}\n\n\t\t_, err = srv.taskq.Publish(ctx, msg)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"failed to publish msg: %v\", msg)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (srv *BinlogService) logger() logrus.FieldLogger {\n\treturn logrus.WithField(\"module\", \"BinlogService\")\n}\n\nfunc (srv *BinlogService) Run(ctx context.Context) error {\n\tlogger := srv.logger()\n\tlogger.Infoln(\"BinlogService Run\")\n\tif srv.inShutdown.Load() {\n\t\tlogger.Infoln(\"BinlogService Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\tgo func() {\n\t\terrors.HandleError(srv.Serve(ctx))\n\t}()\n\treturn nil\n}\n\nfunc (srv *BinlogService) work(ctx context.Context, msgCh <-chan *ds_.Message) {\n\tlogger := srv.logger()\n\ttimer := time.NewTimer(srv.opts.flushInterval)\n\tdefer timer.Stop()\n\n\tvar (\n\t\tflushBatchData []interface{}\n\t\tlastMsgKey     ds_.MessageKey\n\t)\n\n\toperateFunc := func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\tcase <-timer.C:\n\t\t\t\tlogger.Info(\"start to flush timer\")\n\t\t\t\tif len(flushBatchData) > 0 {\n\t\t\t\t\t_, err := srv.dataStore.WriteData(ctx, flushBatchData, lastMsgKey)\n\t\t\t\t\tif err != nil {\n\n\t\t\t\t\t}\n\t\t\t\t\tflushBatchData = nil\n\t\t\t\t\tlogger.Info(\"finished to flush timer\")\n\t\t\t\t}\n\t\t\t\ttimer.Reset(srv.opts.flushInterval)\n\t\t\tcase msg, ok := <-msgCh:\n\t\t\t\tif !ok {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tvar msgValue interface{}\n\t\t\t\tvar err error\n\t\t\t\tif srv.opts.msgDecodeFunc != nil {\n\t\t\t\t\tmsgValue, err = srv.opts.msgDecodeFunc(ctx, msg.Value)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tmsgValue = msg.Value\n\t\t\t\t}\n\n\t\t\t\tmsgKey := ds_.MessageKey{\n\t\t\t\t\tKey: string(msg.Key),\n\t\t\t\t}\n\t\t\t\tif srv.opts.msgKeyDecodeFunc != nil {\n\t\t\t\t\tmsgKey, err = srv.opts.msgKeyDecodeFunc(ctx, msg.Key)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif msgKey.MsgType != ds_.MsgType_Insert {\n\t\t\t\t\tif len(flushBatchData) > 0 {\n\t\t\t\t\t\t_, err = srv.dataStore.WriteData(ctx, flushBatchData, lastMsgKey)\n\t\t\t\t\t\tflushBatchData = nil\n\t\t\t\t\t}\n\t\t\t\t\t//todo do the msg\n\t\t\t\t\tcontinue\n\n\t\t\t\t} else {\n\t\t\t\t\t// insert type\n\t\t\t\t\tif len(flushBatchData) == 0 || msgKey.Equual(lastMsgKey) {\n\t\t\t\t\t\tflushBatchData = append(flushBatchData, msgValue)\n\t\t\t\t\t\tlastMsgKey = msgKey\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger.Infof(\"current msg key[%v] is not equal last msg key[%v]\", msgKey, lastMsgKey)\n\t\t\t\t\t\tif len(flushBatchData) > 0 {\n\t\t\t\t\t\t\t_, err = srv.dataStore.WriteData(ctx, flushBatchData, lastMsgKey)\n\t\t\t\t\t\t\tflushBatchData = nil\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//todo do the msg\n\t\t\t\t\t\tcontinue\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif len(flushBatchData) >= srv.opts.flushBatchSize {\n\t\t\t\t\tlogger.Infof(\"flush batch data size[%v] >= flush batch size[%v]\", len(flushBatchData), srv.opts.flushBatchSize)\n\t\t\t\t\t_, err = srv.dataStore.WriteData(ctx, flushBatchData[:srv.opts.flushBatchSize], lastMsgKey)\n\t\t\t\t\tflushBatchData = flushBatchData[srv.opts.flushBatchSize:]\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\t// https://github.com/golang/go/issues/27169\n\t\t\t\t\t// https://tonybai.com/2016/12/21/how-to-use-timer-reset-in-golang-correctly/\n\t\t\t\t\tif !timer.Stop() {\n\t\t\t\t\t\tselect {\n\t\t\t\t\t\tcase <-timer.C:\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttimer.Reset(srv.opts.flushInterval)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tgo operateFunc()\n\treturn\n}\n\nfunc (srv *BinlogService) flush(ctx context.Context, consumer mq_.Consumer) error {\n\tlogger := srv.logger()\n\n\tmsgCh := make(chan *ds_.Message)\n\tsrv.work(ctx, msgCh)\n\tfor msg := range consumer.ReadStream(ctx) {\n\t\tlogger.Infof(\"recv message key[%v] value[%v] from channel[%v]\", string(msg.Key()), string(msg.Value()), consumer.Topic())\n\t\tif msg.Error() != nil {\n\t\t\tlogger.WithError(msg.Error()).Errorf(\"faild to read stream %v\", consumer.Topic())\n\t\t\tcontinue\n\t\t}\n\n\t\tmsgWrap := &ds_.Message{\n\t\t\tKey:   msg.Key(),\n\t\t\tValue: msg.Value(),\n\t\t}\n\t\tmsgCh <- msgWrap\n\t}\n\n\treturn nil\n}\n\nfunc (srv *BinlogService) Serve(ctx context.Context) error {\n\tlogger := srv.logger()\n\tlogger.Infoln(\"ServiceBinlog Serve\")\n\n\tif srv.inShutdown.Load() {\n\t\terr := fmt.Errorf(\"server closed\")\n\t\tlogger.WithError(err).Errorf(\"ServiceBinlog Serve canceled\")\n\t\treturn err\n\t}\n\n\tdefer srv.inShutdown.Store(true)\n\tctx, cancel := context.WithCancel(ctx)\n\tsrv.mu.Lock()\n\tsrv.cancel = cancel\n\tsrv.mu.Unlock()\n\n\tg, gCtx := errgroup.WithContext(ctx)\n\tfor _, consumer := range srv.consumers {\n\t\tconsumer := consumer\n\t\tg.Go(func() error {\n\t\t\treturn srv.flush(gCtx, consumer)\n\t\t})\n\t}\n\terr := g.Wait()\n\tif err != nil {\n\t\tlogger.WithError(err).Errorf(\"wait flush worker\")\n\t\treturn err\n\t}\n\tlogger.Info(\"stopped binlog service\")\n\treturn nil\n}\n\nfunc (srv *BinlogService) Shutdown() {\n\tsrv.inShutdown.Store(true)\n\tsrv.mu.Lock()\n\tdefer srv.mu.Unlock()\n\n\tfor _, consumer := range srv.consumers {\n\t\tif consumer != nil {\n\t\t\tconsumer.Close()\n\t\t}\n\t}\n\tif srv.cancel != nil {\n\t\tsrv.cancel()\n\t}\n}\n"
  },
  {
    "path": "pkg/binlog/binlog.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage binlog\n\nimport \"time\"\n\nfunc WitRootPath(rootPath string) BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(c *BinlogService) {\n\t\tc.opts.rootPath = rootPath\n\t})\n}\n\nfunc WithPrefixName(prefixName string) BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(c *BinlogService) {\n\t\tc.opts.prefixName = prefixName\n\t})\n}\n\nfunc WithSufffixName(suffixName string) BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(c *BinlogService) {\n\t\tc.opts.suffixName = suffixName\n\t})\n}\n\nfunc WithFlushBatchSize(batch int) BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(c *BinlogService) {\n\t\tc.opts.flushBatchSize = batch\n\t})\n}\n\nfunc WithFlushInterval(flushInterval time.Duration) BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(c *BinlogService) {\n\t\tc.opts.flushInterval = flushInterval\n\t})\n}\n\nfunc WithRotateInterval(rotateInterval time.Duration) BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(c *BinlogService) {\n\t\tc.opts.rotateInterval = rotateInterval\n\t})\n}\n\nfunc WithRotateSize(rotateSize int64) BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(c *BinlogService) {\n\t\tc.opts.rotateSize = rotateSize\n\t})\n}\n\nfunc WithMessageDecoderFunc(f MessageDecoderFunc) BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(c *BinlogService) {\n\t\tc.opts.msgDecodeFunc = f\n\t})\n}\n\nfunc WithMessageKeyDecodeFunc(f MessageKeyDecodeFunc) BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(c *BinlogService) {\n\t\tc.opts.msgKeyDecodeFunc = f\n\t})\n}\n"
  },
  {
    "path": "pkg/binlog/binlog.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: pkg/binlog/binlog.proto\n\npackage binlog\n\nimport (\n\tduration \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype BinlogType int32\n\nconst (\n\tBinlogType_BinlogType_DB   BinlogType = 0\n\tBinlogType_BinlogType_File BinlogType = 1\n)\n\n// Enum value maps for BinlogType.\nvar (\n\tBinlogType_name = map[int32]string{\n\t\t0: \"BinlogType_DB\",\n\t\t1: \"BinlogType_File\",\n\t}\n\tBinlogType_value = map[string]int32{\n\t\t\"BinlogType_DB\":   0,\n\t\t\"BinlogType_File\": 1,\n\t}\n)\n\nfunc (x BinlogType) Enum() *BinlogType {\n\tp := new(BinlogType)\n\t*p = x\n\treturn p\n}\n\nfunc (x BinlogType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (BinlogType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_binlog_binlog_proto_enumTypes[0].Descriptor()\n}\n\nfunc (BinlogType) Type() protoreflect.EnumType {\n\treturn &file_pkg_binlog_binlog_proto_enumTypes[0]\n}\n\nfunc (x BinlogType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use BinlogType.Descriptor instead.\nfunc (BinlogType) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_binlog_binlog_proto_rawDescGZIP(), []int{0}\n}\n\ntype Binlog struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled          bool               `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tBinlogType       BinlogType         `protobuf:\"varint,2,opt,name=binlog_type,json=binlogType,proto3,enum=go.pkg.binlog.BinlogType\" json:\"binlog_type,omitempty\"`\n\tFlushBatchSize   int64              `protobuf:\"varint,3,opt,name=flush_batch_size,json=flushBatchSize,proto3\" json:\"flush_batch_size,omitempty\"`\n\tMaxFlushInterval *duration.Duration `protobuf:\"bytes,4,opt,name=max_flush_interval,json=maxFlushInterval,proto3\" json:\"max_flush_interval,omitempty\"`\n\tFlushTimeout     *duration.Duration `protobuf:\"bytes,5,opt,name=flush_timeout,json=flushTimeout,proto3\" json:\"flush_timeout,omitempty\"`\n\tDbLog            *Binlog_DBLog      `protobuf:\"bytes,20,opt,name=db_log,json=dbLog,proto3\" json:\"db_log,omitempty\"`\n\tFileLog          *Binlog_FileLog    `protobuf:\"bytes,21,opt,name=file_log,json=fileLog,proto3\" json:\"file_log,omitempty\"`\n}\n\nfunc (x *Binlog) Reset() {\n\t*x = Binlog{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_binlog_binlog_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Binlog) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Binlog) ProtoMessage() {}\n\nfunc (x *Binlog) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_binlog_binlog_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Binlog.ProtoReflect.Descriptor instead.\nfunc (*Binlog) Descriptor() ([]byte, []int) {\n\treturn file_pkg_binlog_binlog_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Binlog) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Binlog) GetBinlogType() BinlogType {\n\tif x != nil {\n\t\treturn x.BinlogType\n\t}\n\treturn BinlogType_BinlogType_DB\n}\n\nfunc (x *Binlog) GetFlushBatchSize() int64 {\n\tif x != nil {\n\t\treturn x.FlushBatchSize\n\t}\n\treturn 0\n}\n\nfunc (x *Binlog) GetMaxFlushInterval() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MaxFlushInterval\n\t}\n\treturn nil\n}\n\nfunc (x *Binlog) GetFlushTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.FlushTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Binlog) GetDbLog() *Binlog_DBLog {\n\tif x != nil {\n\t\treturn x.DbLog\n\t}\n\treturn nil\n}\n\nfunc (x *Binlog) GetFileLog() *Binlog_FileLog {\n\tif x != nil {\n\t\treturn x.FileLog\n\t}\n\treturn nil\n}\n\ntype Binlog_DBLog struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n}\n\nfunc (x *Binlog_DBLog) Reset() {\n\t*x = Binlog_DBLog{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_binlog_binlog_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Binlog_DBLog) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Binlog_DBLog) ProtoMessage() {}\n\nfunc (x *Binlog_DBLog) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_binlog_binlog_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Binlog_DBLog.ProtoReflect.Descriptor instead.\nfunc (*Binlog_DBLog) Descriptor() ([]byte, []int) {\n\treturn file_pkg_binlog_binlog_proto_rawDescGZIP(), []int{0, 0}\n}\n\ntype Binlog_FileLog struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tFilepath       string             `protobuf:\"bytes,3,opt,name=filepath,proto3\" json:\"filepath,omitempty\"`\n\tMaxAge         *duration.Duration `protobuf:\"bytes,4,opt,name=max_age,json=maxAge,proto3\" json:\"max_age,omitempty\"`\n\tMaxCount       int64              `protobuf:\"varint,5,opt,name=max_count,json=maxCount,proto3\" json:\"max_count,omitempty\"`\n\tRotateInterval *duration.Duration `protobuf:\"bytes,6,opt,name=rotate_interval,json=rotateInterval,proto3\" json:\"rotate_interval,omitempty\"`\n\tRotateSize     int64              `protobuf:\"varint,7,opt,name=rotate_size,json=rotateSize,proto3\" json:\"rotate_size,omitempty\"`\n}\n\nfunc (x *Binlog_FileLog) Reset() {\n\t*x = Binlog_FileLog{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_binlog_binlog_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Binlog_FileLog) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Binlog_FileLog) ProtoMessage() {}\n\nfunc (x *Binlog_FileLog) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_binlog_binlog_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Binlog_FileLog.ProtoReflect.Descriptor instead.\nfunc (*Binlog_FileLog) Descriptor() ([]byte, []int) {\n\treturn file_pkg_binlog_binlog_proto_rawDescGZIP(), []int{0, 1}\n}\n\nfunc (x *Binlog_FileLog) GetFilepath() string {\n\tif x != nil {\n\t\treturn x.Filepath\n\t}\n\treturn \"\"\n}\n\nfunc (x *Binlog_FileLog) GetMaxAge() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MaxAge\n\t}\n\treturn nil\n}\n\nfunc (x *Binlog_FileLog) GetMaxCount() int64 {\n\tif x != nil {\n\t\treturn x.MaxCount\n\t}\n\treturn 0\n}\n\nfunc (x *Binlog_FileLog) GetRotateInterval() *duration.Duration {\n\tif x != nil {\n\t\treturn x.RotateInterval\n\t}\n\treturn nil\n}\n\nfunc (x *Binlog_FileLog) GetRotateSize() int64 {\n\tif x != nil {\n\t\treturn x.RotateSize\n\t}\n\treturn 0\n}\n\nvar File_pkg_binlog_binlog_proto protoreflect.FileDescriptor\n\nvar file_pkg_binlog_binlog_proto_rawDesc = []byte{\n\t0x0a, 0x17, 0x70, 0x6b, 0x67, 0x2f, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x2f, 0x62, 0x69, 0x6e,\n\t0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x67, 0x6f, 0x2e, 0x70, 0x6b,\n\t0x67, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,\n\t0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe6, 0x04, 0x0a, 0x06, 0x42, 0x69, 0x6e,\n\t0x6c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01,\n\t0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a,\n\t0x0b, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,\n\t0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x69, 0x6e, 0x6c,\n\t0x6f, 0x67, 0x2e, 0x42, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x62,\n\t0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x66, 0x6c, 0x75,\n\t0x73, 0x68, 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20,\n\t0x01, 0x28, 0x03, 0x52, 0x0e, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53,\n\t0x69, 0x7a, 0x65, 0x12, 0x47, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68,\n\t0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,\n\t0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,\n\t0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x46,\n\t0x6c, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x3e, 0x0a, 0x0d,\n\t0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20,\n\t0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,\n\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c,\n\t0x66, 0x6c, 0x75, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x32, 0x0a, 0x06,\n\t0x64, 0x62, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67,\n\t0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x2e, 0x42, 0x69, 0x6e,\n\t0x6c, 0x6f, 0x67, 0x2e, 0x44, 0x42, 0x4c, 0x6f, 0x67, 0x52, 0x05, 0x64, 0x62, 0x4c, 0x6f, 0x67,\n\t0x12, 0x38, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x15, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x69, 0x6e, 0x6c,\n\t0x6f, 0x67, 0x2e, 0x42, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4c, 0x6f,\n\t0x67, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x4c, 0x6f, 0x67, 0x1a, 0x07, 0x0a, 0x05, 0x44, 0x42,\n\t0x4c, 0x6f, 0x67, 0x1a, 0xdb, 0x01, 0x0a, 0x07, 0x46, 0x69, 0x6c, 0x65, 0x4c, 0x6f, 0x67, 0x12,\n\t0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x12, 0x32, 0x0a, 0x07, 0x6d,\n\t0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,\n\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,\n\t0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, 0x12,\n\t0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01,\n\t0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0f,\n\t0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18,\n\t0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,\n\t0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t0x52, 0x0e, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,\n\t0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18,\n\t0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x53, 0x69, 0x7a,\n\t0x65, 0x2a, 0x34, 0x0a, 0x0a, 0x42, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12,\n\t0x11, 0x0a, 0x0d, 0x42, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x44, 0x42,\n\t0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65,\n\t0x5f, 0x46, 0x69, 0x6c, 0x65, 0x10, 0x01, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75,\n\t0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x2e,\n\t0x70, 0x6b, 0x67, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x3b, 0x62, 0x69, 0x6e, 0x6c, 0x6f,\n\t0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_binlog_binlog_proto_rawDescOnce sync.Once\n\tfile_pkg_binlog_binlog_proto_rawDescData = file_pkg_binlog_binlog_proto_rawDesc\n)\n\nfunc file_pkg_binlog_binlog_proto_rawDescGZIP() []byte {\n\tfile_pkg_binlog_binlog_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_binlog_binlog_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_binlog_binlog_proto_rawDescData)\n\t})\n\treturn file_pkg_binlog_binlog_proto_rawDescData\n}\n\nvar file_pkg_binlog_binlog_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_pkg_binlog_binlog_proto_msgTypes = make([]protoimpl.MessageInfo, 3)\nvar file_pkg_binlog_binlog_proto_goTypes = []interface{}{\n\t(BinlogType)(0),           // 0: go.pkg.binlog.BinlogType\n\t(*Binlog)(nil),            // 1: go.pkg.binlog.Binlog\n\t(*Binlog_DBLog)(nil),      // 2: go.pkg.binlog.Binlog.DBLog\n\t(*Binlog_FileLog)(nil),    // 3: go.pkg.binlog.Binlog.FileLog\n\t(*duration.Duration)(nil), // 4: google.protobuf.Duration\n}\nvar file_pkg_binlog_binlog_proto_depIdxs = []int32{\n\t0, // 0: go.pkg.binlog.Binlog.binlog_type:type_name -> go.pkg.binlog.BinlogType\n\t4, // 1: go.pkg.binlog.Binlog.max_flush_interval:type_name -> google.protobuf.Duration\n\t4, // 2: go.pkg.binlog.Binlog.flush_timeout:type_name -> google.protobuf.Duration\n\t2, // 3: go.pkg.binlog.Binlog.db_log:type_name -> go.pkg.binlog.Binlog.DBLog\n\t3, // 4: go.pkg.binlog.Binlog.file_log:type_name -> go.pkg.binlog.Binlog.FileLog\n\t4, // 5: go.pkg.binlog.Binlog.FileLog.max_age:type_name -> google.protobuf.Duration\n\t4, // 6: go.pkg.binlog.Binlog.FileLog.rotate_interval:type_name -> google.protobuf.Duration\n\t7, // [7:7] is the sub-list for method output_type\n\t7, // [7:7] is the sub-list for method input_type\n\t7, // [7:7] is the sub-list for extension type_name\n\t7, // [7:7] is the sub-list for extension extendee\n\t0, // [0:7] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_binlog_binlog_proto_init() }\nfunc file_pkg_binlog_binlog_proto_init() {\n\tif File_pkg_binlog_binlog_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_binlog_binlog_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Binlog); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_binlog_binlog_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Binlog_DBLog); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_binlog_binlog_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Binlog_FileLog); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_binlog_binlog_proto_rawDesc,\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   3,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_binlog_binlog_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_binlog_binlog_proto_depIdxs,\n\t\tEnumInfos:         file_pkg_binlog_binlog_proto_enumTypes,\n\t\tMessageInfos:      file_pkg_binlog_binlog_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_binlog_binlog_proto = out.File\n\tfile_pkg_binlog_binlog_proto_rawDesc = nil\n\tfile_pkg_binlog_binlog_proto_goTypes = nil\n\tfile_pkg_binlog_binlog_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/binlog/binlog.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.binlog;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.binlog;binlog\";\n\nmessage Binlog {\n  bool enabled = 1;\n\n  BinlogType binlog_type = 2;\n  int64 flush_batch_size = 3;\n  google.protobuf.Duration max_flush_interval = 4;\n  google.protobuf.Duration flush_timeout = 5;\n\n  DBLog db_log = 20;\n  FileLog file_log = 21;\n\n  message DBLog {}\n\n  message FileLog {\n    string filepath = 3;\n    google.protobuf.Duration max_age = 4;\n    int64 max_count = 5;\n    google.protobuf.Duration rotate_interval = 6;\n    int64 rotate_size = 7;\n  }\n}\n\nenum BinlogType {\n  BinlogType_DB = 0;\n  BinlogType_File = 1;\n}\n\n"
  },
  {
    "path": "pkg/binlog/binlog.yaml",
    "content": "database:\n  mysql:\n    enabled: true\n    address: \"localhost:3306\"\n    username: \"root\"\n    password: \"\"\n    db_name: \"sealet\"\n    max_connections: 100\n    max_idle_connections: 10\n    dial_timeout: 5s\n    max_wait_duration: 20s\n    fail_after_duration: 100s\n    interpolate_params: true\n\nmq:\n  kafka:\n    enabled: true\n    brokers: [\"localhost:9092\"]\n    max_wait_duration: 5s\n    fail_after_duration: 30s\n\nbinlog:\n  enabled: true\n  binlog_type: \"BinlogType_DB\"\n  flush_batch_size: 1\n  flush_timeout: 10s\n\n  file_log:\n    filepath: ./binlog\n    rotate_interval: 3600s #1h\n    rotate_size: 104857600 #100M\n"
  },
  {
    "path": "pkg/binlog/binlog_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage binlog\n\n// A BinlogServiceOption sets options.\ntype BinlogServiceOption interface {\n\tapply(*BinlogService)\n}\n\n// EmptyBinlogServiceUrlOption does not alter the BinlogServiceuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyBinlogServiceOption struct{}\n\nfunc (EmptyBinlogServiceOption) apply(*BinlogService) {}\n\n// BinlogServiceOptionFunc wraps a function that modifies BinlogService into an\n// implementation of the BinlogServiceOption interface.\ntype BinlogServiceOptionFunc func(*BinlogService)\n\nfunc (f BinlogServiceOptionFunc) apply(do *BinlogService) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _BinlogServiceOptionWithDefault() BinlogServiceOption {\n\treturn BinlogServiceOptionFunc(func(*BinlogService) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *BinlogService) ApplyOptions(options ...BinlogServiceOption) *BinlogService {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/binlog/binlog_test.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage binlog_test\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"testing\"\n\n\t\"encoding/json\"\n\n\t\"github.com/google/uuid\"\n\t\"github.com/kaydxh/golang/pkg/binlog\"\n\tbinlog_ \"github.com/kaydxh/golang/pkg/binlog\"\n\tds_ \"github.com/kaydxh/golang/pkg/binlog/datastore\"\n\tmysql_ \"github.com/kaydxh/golang/pkg/database/mysql\"\n\tmq_ \"github.com/kaydxh/golang/pkg/mq\"\n\tkafka_ \"github.com/kaydxh/golang/pkg/mq/kafka\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/segmentio/kafka-go\"\n)\n\ntype TaskTable struct {\n\t//\tId sql.NullInt64 `db:\"id\"` // primary key ID\n\n\t// NullTime represents a time.Time that may be null.\n\t// NullTime implements the Scanner interface so\n\t// it can be used as a scan destination, similar to NullString.\n\tCreateTime sql.NullTime `db:\"create_time\"`\n\tUpdateTime sql.NullTime `db:\"update_time\"`\n\n\tGroupId    string `db:\"group_id\"`\n\tPageId     string `db:\"page_id\"`\n\tFeaId      string `db:\"fea_id\"`\n\tEntityId   string `db:\"entity_id\"`\n\tFeature0   []byte `db:\"feature0\"`\n\tFeature1   []byte `db:\"feature1\"`\n\tExtendInfo []byte `db:\"extend_info\"`\n}\n\nfunc TestProducer(t *testing.T) {\n\tcfgFile := \"./binlog.yaml\"\n\tconfig := kafka_.NewConfig(kafka_.WithViper(viper_.GetViper(cfgFile, \"mq.kafka\")))\n\n\tmq, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\ttopic := \"topic-test-1\"\n\tctx := context.Background()\n\tps, err := mq.AsProducers(ctx, topic)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to as producers, err: %v\", err)\n\t}\n\tif len(ps) == 0 {\n\t\tt.Fatalf(\"producers nil\")\n\t}\n\tp := ps[0]\n\n\ttableName := \"hetu_zeus_0\"\n\tcols := []string{\"group_id\", \"page_id\", \"fea_id\", \"entity_id\", \"feature0\", \"feature1\", \"extend_info\"}\n\tmsgKey := &ds_.MessageKey{\n\t\tKey:     \"Key-A\",\n\t\tMsgType: ds_.MsgType_Insert,\n\t\tFields:  cols,\n\t\tPath:    tableName,\n\t}\n\tkeyData, _ := json.Marshal(msgKey)\n\n\tfor i := 0; i < 10; i++ {\n\t\targ := &TaskTable{\n\t\t\tGroupId:    \"groupId-1\",\n\t\t\tPageId:     \"100\",\n\t\t\tFeaId:      uuid.NewString(),\n\t\t\tFeature0:   []byte(\"Feature0\"),\n\t\t\tFeature1:   []byte(\"Feature1\"),\n\t\t\tExtendInfo: []byte(\"ExtendInfo\"),\n\t\t}\n\t\tmsgValue, _ := json.Marshal(arg)\n\t\terr = p.Send(ctx,\n\t\t\tkafka.Message{\n\t\t\t\tKey:   keyData,\n\t\t\t\tValue: msgValue,\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to send messages, err: %v\", err)\n\t\t}\n\t}\n\n}\n\nfunc TestNewBinlog(t *testing.T) {\n\t// install kafka\n\tcfgFile := \"./binlog.yaml\"\n\tconfig := kafka_.NewConfig(kafka_.WithViper(viper_.GetViper(cfgFile, \"mq.kafka\")))\n\n\tmq, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\tctx := context.Background()\n\ttopic := \"topic-test-1\"\n\t_, err = mq.AsConsumers(ctx, topic)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to as producers, err: %v\", err)\n\t}\n\tconsumer, err := mq.GetConsumer(topic)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get producer, err: %v\", err)\n\t}\n\n\tdbConfig := mysql_.NewConfig(mysql_.WithViper(viper_.GetViper(cfgFile, \"database.mysql\")))\n\n\tdb, err := dbConfig.Complete().New(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif db == nil {\n\t\tpanic(\"db is not enable\")\n\t}\n\n\tbsConfig := binlog_.NewConfig(binlog_.WithViper(viper_.GetViper(cfgFile, \"binlog\")))\n\n\tbs, err := bsConfig.Complete().New(context.Background(), nil, []mq_.Consumer{consumer},\n\t\tbinlog.WithMessageDecoderFunc(func(ctx context.Context, data []byte) (interface{}, error) {\n\n\t\t\tvar arg TaskTable\n\t\t\terr = json.Unmarshal(data, &arg)\n\t\t\tif err != nil {\n\t\t\t\treturn arg, err\n\t\t\t}\n\t\t\treturn arg, nil\n\n\t\t}),\n\n\t\tbinlog_.WithMessageKeyDecodeFunc(func(ctx context.Context, data []byte) (ds_.MessageKey, error) {\n\t\t\tvar msgKey ds_.MessageKey\n\t\t\terr := json.Unmarshal(data, &msgKey)\n\t\t\treturn msgKey, err\n\n\t\t}))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_ = bs\n\n\tselect {}\n}\n"
  },
  {
    "path": "pkg/binlog/config.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage binlog\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tds_ \"github.com/kaydxh/golang/pkg/binlog/datastore\"\n\tdbstore_ \"github.com/kaydxh/golang/pkg/binlog/datastore/dbstore\"\n\tfilestore_ \"github.com/kaydxh/golang/pkg/binlog/datastore/filestore\"\n\tmysql_ \"github.com/kaydxh/golang/pkg/database/mysql\"\n\trotate_ \"github.com/kaydxh/golang/pkg/file-rotate\"\n\tmq_ \"github.com/kaydxh/golang/pkg/mq\"\n\ttaskq_ \"github.com/kaydxh/golang/pkg/pool/taskqueue\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto Binlog\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context, taskq *taskq_.Pool, consumers []mq_.Consumer, opts ...BinlogServiceOption) (*BinlogService, error) {\n\n\tlogrus.Infof(\"Installing BinlogService\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\tlogrus.Warnf(\"BinlogService disenabled\")\n\t\treturn nil, nil\n\t}\n\n\tsqlxDB, err := c.install(ctx, taskq, consumers, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed BinlogService\")\n\n\treturn sqlxDB, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context, taskq *taskq_.Pool, consumers []mq_.Consumer, opts ...BinlogServiceOption) (*BinlogService, error) {\n\tconfig := &c.Proto\n\tvar (\n\t\tdataStore ds_.DataStore\n\t\terr       error\n\t)\n\tswitch config.GetBinlogType() {\n\tcase BinlogType_BinlogType_DB:\n\t\tdb := mysql_.GetDB()\n\t\tif db == nil {\n\t\t\treturn nil, fmt.Errorf(\"db is not installed\")\n\t\t}\n\t\tdataStore, err = dbstore_.NewDBDataStore(db)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"db is not installed\")\n\t\t}\n\tcase BinlogType_BinlogType_File:\n\t\tfilelogConfig := config.GetFileLog()\n\n\t\tdataStore, err = filestore_.NewFileDataStore(\n\t\t\tfilelogConfig.GetFilepath(),\n\t\t\trotate_.WithRotateSize(filelogConfig.GetRotateSize()),\n\t\t\trotate_.WithRotateInterval(filelogConfig.GetRotateInterval().AsDuration()),\n\t\t\t//rotate_.WithRotateCallback(bs.rotateCallback),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"binlog type %v is not support\", config.GetBinlogType())\n\t}\n\tbs, err := NewBinlogService(dataStore, taskq, consumers, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = bs.Run(ctx)\n\treturn bs, err\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/binlog/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage binlog\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/binlog/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage binlog\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/binlog/datastore/data.store.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage datastore\n\nimport (\n\t\"context\"\n)\n\ntype DataStore interface {\n\tWriteData(ctx context.Context, arg interface{}, key MessageKey) (n int64, err error)\n}\n"
  },
  {
    "path": "pkg/binlog/datastore/dbstore/db.store.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage dbstore\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/jmoiron/sqlx\"\n\tds_ \"github.com/kaydxh/golang/pkg/binlog/datastore\"\n\tmysql_ \"github.com/kaydxh/golang/pkg/database/mysql\"\n)\n\nvar _ ds_.DataStore = (*DBDataStore)(nil)\n\ntype DBDataStore struct {\n\t*sqlx.DB\n\tinsertSql string\n\tupdateSql string\n}\n\nfunc NewDBDataStore(db *sqlx.DB) (*DBDataStore, error) {\n\tif db == nil {\n\t\treturn nil, fmt.Errorf(\"db is nil\")\n\t}\n\n\ts := &DBDataStore{}\n\ts.DB = db\n\treturn s, nil\n}\n\nfunc (s *DBDataStore) WriteData(ctx context.Context, arg interface{}, key ds_.MessageKey) (n int64, err error) {\n\tcolumnsValues := mysql_.BuildNamedColumnsValuesBatch(arg)\n\tsql := mysql_.BuildNamedInsertSql(key.Path, key.Fields, len(columnsValues))\n\tn, err = mysql_.ExecContext(ctx, sql, mysql_.BuildNamedColumnsValuesBatch(arg), nil, s.DB)\n\treturn n, err\n}\n"
  },
  {
    "path": "pkg/binlog/datastore/filestore/file.store.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filestore\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"sync\"\n\n\tds_ \"github.com/kaydxh/golang/pkg/binlog/datastore\"\n\trotate_ \"github.com/kaydxh/golang/pkg/file-rotate\"\n)\n\nvar _ ds_.DataStore = (*FileDataStore)(nil)\n\ntype FileDataStore struct {\n\trotateFiler    *rotate_.RotateFiler\n\trotateFilers   map[string]*rotate_.RotateFiler //message key -> rotateFilter\n\trotateFilersMu sync.Mutex\n\trootDir        string\n\topts           []rotate_.RotateFilerOption\n}\n\nfunc NewFileDataStore(filedir string, options ...rotate_.RotateFilerOption) (*FileDataStore, error) {\n\trotate, err := rotate_.NewRotateFiler(filedir, options...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ts := &FileDataStore{\n\t\trootDir: filedir,\n\t\topts:    options,\n\t}\n\ts.rotateFiler = rotate\n\treturn s, nil\n}\n\nfunc (s *FileDataStore) WriteData(ctx context.Context, arg interface{}, key ds_.MessageKey) (n int64, err error) {\n\trotateFiler := s.getOrCreate(ctx, key.Key)\n\tp, ok := arg.([][]byte)\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"invalid data type\")\n\t}\n\t_, tn, err := rotateFiler.WriteBytesLine(p)\n\treturn int64(tn), err\n}\n\nfunc (s *FileDataStore) getOrCreate(ctx context.Context, key string) *rotate_.RotateFiler {\n\tif key == \"\" {\n\t\treturn s.rotateFiler\n\t}\n\n\ts.rotateFilersMu.Lock()\n\tdefer s.rotateFilersMu.Unlock()\n\trotateFiler, ok := s.rotateFilers[key]\n\tif !ok {\n\t\trotateFiler, _ = rotate_.NewRotateFiler(\n\t\t\tfilepath.Join(s.rootDir, key),\n\t\t\ts.opts...,\n\t\t)\n\t\ts.rotateFilers[key] = rotateFiler\n\t}\n\n\treturn rotateFiler\n}\n"
  },
  {
    "path": "pkg/binlog/datastore/message.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage datastore\n\nimport (\n\t\"reflect\"\n\t\"sort\"\n)\n\ntype MessageKey struct {\n\tKey     string\n\tMsgType MsgType\n\n\tFields []string\n\t// To db is table name\n\tPath string\n}\n\nfunc (m MessageKey) Equual(s MessageKey) bool {\n\tif m.Key != s.Key {\n\t\treturn false\n\t}\n\n\tif m.MsgType != s.MsgType {\n\t\treturn false\n\t}\n\n\tif m.Path != s.Path {\n\t\treturn false\n\t}\n\n\tsort.Strings(m.Fields)\n\tsort.Strings(s.Fields)\n\treturn reflect.DeepEqual(m.Fields, s.Fields)\n}\n\ntype Message struct {\n\tKey   []byte\n\tValue []byte\n}\n\ntype MsgType int32\n\nconst (\n\tMsgType_Insert MsgType = 0\n\tMsgType_Delete MsgType = 1\n\tMsgType_Update MsgType = 2\n\tMsgType_Get    MsgType = 3\n)\n"
  },
  {
    "path": "pkg/binlog/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/binlog\n\ngo 1.24.0\n\nrequire (\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/google/uuid v1.6.0\n\tgithub.com/jmoiron/sqlx v1.4.0\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/database v0.0.0-00010101000000-000000000000\n\tgithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228\n\tgithub.com/kaydxh/golang/pkg/mq v0.0.0-00010101000000-000000000000\n\tgithub.com/kaydxh/golang/pkg/pool v0.0.0-00010101000000-000000000000\n\tgithub.com/kaydxh/golang/pkg/storage v0.0.0-00010101000000-000000000000\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/segmentio/kafka-go v0.4.49\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgolang.org/x/sync v0.19.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tfilippo.io/edwards25519 v1.1.0 // indirect\n\tgithub.com/aws/aws-sdk-go v1.55.8 // indirect\n\tgithub.com/aws/aws-sdk-go-v2 v1.36.5 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/config v1.29.17 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/credentials v1.17.70 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.84 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/s3 v1.84.0 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/sso v1.25.5 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/sts v1.34.0 // indirect\n\tgithub.com/aws/smithy-go v1.22.4 // indirect\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-redis/redis/v8 v8.11.5 // indirect\n\tgithub.com/go-sql-driver/mysql v1.9.3 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect\n\tgithub.com/google/wire v0.6.0 // indirect\n\tgithub.com/googleapis/gax-go/v2 v2.13.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/jmespath/go-jmespath v0.4.0 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/compress v1.18.0 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pierrec/lz4/v4 v4.1.18 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.opencensus.io v0.24.0 // indirect\n\tgo.uber.org/atomic v1.11.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgocloud.dev v0.40.0 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgolang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect\n\tgoogle.golang.org/api v0.195.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/pool => ../pool\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/storage => ../storage\n\nreplace github.com/kaydxh/golang/pkg/database => ../database\n\nreplace github.com/kaydxh/golang/pkg/mq => ../mq\n\nreplace github.com/kaydxh/golang/pkg/logs => ../logs\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n"
  },
  {
    "path": "pkg/binlog/go.sum",
    "content": "cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=\ncloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ=\ncloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc=\ncloud.google.com/go/auth v0.9.1 h1:+pMtLEV2k0AXKvs/tGZojuj6QaioxfUjOpMsG5Gtx+w=\ncloud.google.com/go/auth v0.9.1/go.mod h1:Sw8ocT5mhhXxFklyhT12Eiy0ed6tTrPMCJjSI8KhYLk=\ncloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY=\ncloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc=\ncloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs=\ncloud.google.com/go/iam v1.1.13 h1:7zWBXG9ERbMLrzQBRhFliAV+kjcRToDTgQT3CTwYyv4=\ncloud.google.com/go/iam v1.1.13/go.mod h1:K8mY0uSXwEXS30KrnVb+j54LB/ntfZu1dr+4zFMNbus=\ncloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs=\ncloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0=\nfilippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=\nfilippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=\ngithub.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=\ngithub.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ=\ngithub.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk=\ngithub.com/aws/aws-sdk-go-v2 v1.36.5 h1:0OF9RiEMEdDdZEMqF9MRjevyxAQcf6gY+E7vwBILFj0=\ngithub.com/aws/aws-sdk-go-v2 v1.36.5/go.mod h1:EYrzvCCN9CMUTa5+6lf6MM4tq3Zjp8UhSGR/cBsjai0=\ngithub.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11 h1:12SpdwU8Djs+YGklkinSSlcrPyj3H4VifVsKf78KbwA=\ngithub.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11/go.mod h1:dd+Lkp6YmMryke+qxW/VnKyhMBDTYP41Q2Bb+6gNZgY=\ngithub.com/aws/aws-sdk-go-v2/config v1.29.17 h1:jSuiQ5jEe4SAMH6lLRMY9OVC+TqJLP5655pBGjmnjr0=\ngithub.com/aws/aws-sdk-go-v2/config v1.29.17/go.mod h1:9P4wwACpbeXs9Pm9w1QTh6BwWwJjwYvJ1iCt5QbCXh8=\ngithub.com/aws/aws-sdk-go-v2/credentials v1.17.70 h1:ONnH5CM16RTXRkS8Z1qg7/s2eDOhHhaXVd72mmyv4/0=\ngithub.com/aws/aws-sdk-go-v2/credentials v1.17.70/go.mod h1:M+lWhhmomVGgtuPOhO85u4pEa3SmssPTdcYpP/5J/xc=\ngithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 h1:KAXP9JSHO1vKGCr5f4O6WmlVKLFFXgWYAGoJosorxzU=\ngithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32/go.mod h1:h4Sg6FQdexC1yYG9RDnOvLbW1a/P986++/Y/a+GyEM8=\ngithub.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.84 h1:cTXRdLkpBanlDwISl+5chq5ui1d1YWg4PWMR9c3kXyw=\ngithub.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.84/go.mod h1:kwSy5X7tfIHN39uucmjQVs2LvDdXEjQucgQQEqCggEo=\ngithub.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 h1:SsytQyTMHMDPspp+spo7XwXTP44aJZZAC7fBV2C5+5s=\ngithub.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36/go.mod h1:Q1lnJArKRXkenyog6+Y+zr7WDpk4e6XlR6gs20bbeNo=\ngithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 h1:i2vNHQiXUvKhs3quBR6aqlgJaiaexz/aNvdCktW/kAM=\ngithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36/go.mod h1:UdyGa7Q91id/sdyHPwth+043HhmP6yP9MBHgbZM0xo8=\ngithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=\ngithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=\ngithub.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36 h1:GMYy2EOWfzdP3wfVAGXBNKY5vK4K8vMET4sYOYltmqs=\ngithub.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36/go.mod h1:gDhdAV6wL3PmPqBhiPbnlS447GoWs8HTTOYef9/9Inw=\ngithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 h1:CXV68E2dNqhuynZJPB80bhPQwAKqBWVer887figW6Jc=\ngithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4/go.mod h1:/xFi9KtvBXP97ppCz1TAEvU1Uf66qvid89rbem3wCzQ=\ngithub.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4 h1:nAP2GYbfh8dd2zGZqFRSMlq+/F6cMPBUuCsGAMkN074=\ngithub.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4/go.mod h1:LT10DsiGjLWh4GbjInf9LQejkYEhBgBCjLG5+lvk4EE=\ngithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 h1:t0E6FzREdtCsiLIoLCWsYliNsRBgyGD/MCK571qk4MI=\ngithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17/go.mod h1:ygpklyoaypuyDvOM5ujWGrYWpAK3h7ugnmKCU/76Ys4=\ngithub.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17 h1:qcLWgdhq45sDM9na4cvXax9dyLitn8EYBRl8Ak4XtG4=\ngithub.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17/go.mod h1:M+jkjBFZ2J6DJrjMv2+vkBbuht6kxJYtJiwoVgX4p4U=\ngithub.com/aws/aws-sdk-go-v2/service/s3 v1.84.0 h1:0reDqfEN+tB+sozj2r92Bep8MEwBZgtAXTND1Kk9OXg=\ngithub.com/aws/aws-sdk-go-v2/service/s3 v1.84.0/go.mod h1:kUklwasNoCn5YpyAqC/97r6dzTA1SRKJfKq16SXeoDU=\ngithub.com/aws/aws-sdk-go-v2/service/sso v1.25.5 h1:AIRJ3lfb2w/1/8wOOSqYb9fUKGwQbtysJ2H1MofRUPg=\ngithub.com/aws/aws-sdk-go-v2/service/sso v1.25.5/go.mod h1:b7SiVprpU+iGazDUqvRSLf5XmCdn+JtT1on7uNL6Ipc=\ngithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 h1:BpOxT3yhLwSJ77qIY3DoHAQjZsc4HEGfMCE4NGy3uFg=\ngithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3/go.mod h1:vq/GQR1gOFLquZMSrxUK/cpvKCNVYibNyJ1m7JrU88E=\ngithub.com/aws/aws-sdk-go-v2/service/sts v1.34.0 h1:NFOJ/NXEGV4Rq//71Hs1jC/NvPs1ezajK+yQmkwnPV0=\ngithub.com/aws/aws-sdk-go-v2/service/sts v1.34.0/go.mod h1:7ph2tGpfQvwzgistp2+zga9f+bCjlQJPkPUmMgDSD7w=\ngithub.com/aws/smithy-go v1.22.4 h1:uqXzVZNuNexwc/xrh6Tb56u89WDlJY6HS+KC0S4QSjw=\ngithub.com/aws/smithy-go v1.22.4/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=\ngithub.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=\ngithub.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=\ngithub.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=\ngithub.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=\ngithub.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=\ngithub.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=\ngithub.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=\ngithub.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=\ngithub.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=\ngithub.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=\ngithub.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=\ngithub.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=\ngithub.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=\ngithub.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=\ngithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=\ngithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=\ngithub.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=\ngithub.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=\ngithub.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=\ngithub.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=\ngithub.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=\ngithub.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=\ngithub.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=\ngithub.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=\ngithub.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=\ngithub.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=\ngithub.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/go-replayers/grpcreplay v1.3.0 h1:1Keyy0m1sIpqstQmgz307zhiJ1pV4uIlFds5weTmxbo=\ngithub.com/google/go-replayers/grpcreplay v1.3.0/go.mod h1:v6NgKtkijC0d3e3RW8il6Sy5sqRVUwoQa4mHOGEy8DI=\ngithub.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk=\ngithub.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc=\ngithub.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0=\ngithub.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM=\ngithub.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA=\ngithub.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=\ngithub.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI=\ngithub.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA=\ngithub.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=\ngithub.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=\ngithub.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s=\ngithub.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=\ngithub.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=\ngithub.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=\ngithub.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=\ngithub.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=\ngithub.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 h1:Q0arlJiD7BygvPMDHcvTdg1urHqADnd7P2qk3r2HlyE=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228/go.mod h1:ML4gUddcaOo55zQ9/m8SxjZYYVTJACriuUFcqs1BEd4=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 h1:7zmih7dDhXTVDxbWy4Cp0OrSqMdQaQzlRUtCzZXMVgc=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228/go.mod h1:DeGVCOtdDQNg6/hVvPwYqeH0EbGcbFiQcKNvMrD+NyY=\ngithub.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=\ngithub.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=\ngithub.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=\ngithub.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=\ngithub.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=\ngithub.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=\ngithub.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=\ngithub.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/segmentio/kafka-go v0.4.49 h1:GJiNX1d/g+kG6ljyJEoi9++PUMdXGAxb7JGPiDCuNmk=\ngithub.com/segmentio/kafka-go v0.4.49/go.mod h1:Y1gn60kzLEEaW28YshXyk2+VCUKbJ3Qr6DrnT3i4+9E=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=\ngithub.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=\ngithub.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=\ngithub.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=\ngithub.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=\ngithub.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=\ngithub.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=\ngo.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngocloud.dev v0.40.0 h1:f8LgP+4WDqOG/RXoUcyLpeIAGOcAbZrZbDQCUee10ng=\ngocloud.dev v0.40.0/go.mod h1:drz+VyYNBvrMTW0KZiBAYEdl8lbNZx+OQ7oQvdrFmSQ=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=\ngolang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=\ngolang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=\ngolang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=\ngolang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=\ngolang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=\ngolang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=\ngolang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=\ngolang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=\ngolang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=\ngolang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=\ngolang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=\ngolang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=\ngolang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=\ngolang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=\ngolang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=\ngolang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=\ngolang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=\ngolang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=\ngolang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=\ngolang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=\ngolang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=\ngolang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=\ngolang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=\ngolang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=\ngolang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=\ngolang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=\ngolang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=\ngolang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=\ngolang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=\ngolang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=\ngolang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=\ngolang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=\ngolang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=\ngolang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=\ngolang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=\ngolang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY=\ngolang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/api v0.195.0 h1:Ude4N8FvTKnnQJHU48RFI40jOBgIrL8Zqr3/QeST6yU=\ngoogle.golang.org/api v0.195.0/go.mod h1:DOGRWuv3P8TU8Lnz7uQc4hyNqrBpMtD9ppW3wBJurgc=\ngoogle.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=\ngoogle.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=\ngoogle.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=\ngoogle.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=\ngoogle.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=\ngoogle.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c h1:TYOEhrQMrNDTAd2rX9m+WgGr8Ku6YNuj1D7OX6rWSok=\ngoogle.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c/go.mod h1:2rC5OendXvZ8wGEo/cSLheztrZDZaSoHanUcd1xtZnw=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=\ngoogle.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=\ngoogle.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=\ngoogle.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=\ngoogle.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=\ngoogle.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=\ngoogle.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=\ngoogle.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=\ngoogle.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=\ngoogle.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=\ngoogle.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=\ngoogle.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=\ngoogle.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=\ngopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=\ngopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=\ngopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\nhonnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=\nhonnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=\n"
  },
  {
    "path": "pkg/config/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage config\n\nimport (\n\t\"github.com/go-playground/validator/v10\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/spf13/viper\"\n\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// proto.Message is interface\ntype Config[T proto.Message] struct {\n\tProto     T\n\tValidator *validator.Validate\n\n\topts struct {\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig[T proto.Message] struct {\n\t*Config[T]\n\tcompleteError error\n}\n\n// CompletedConfig same as Config, just to swap private object.\ntype CompletedConfig[T proto.Message] struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig[T]\n}\n\n// Validate checks Config.\nfunc (c *completedConfig[T]) Validate() error {\n\treturn c.Validator.Struct(c)\n}\n\n// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.\nfunc (c *Config[T]) Complete() CompletedConfig[T] {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig[T]{\n\t\t\t&completedConfig[T]{\n\t\t\t\tConfig:        c,\n\t\t\t\tcompleteError: err,\n\t\t\t}}\n\t}\n\n\tif c.Validator == nil {\n\t\tc.Validator = validator.New()\n\t}\n\n\treturn CompletedConfig[T]{&completedConfig[T]{Config: c}}\n}\n\nfunc (c *Config[T]) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc (c completedConfig[T]) New() (T, error) {\n\tvar zero T\n\tif c.completeError != nil {\n\t\treturn zero, c.completeError\n\t}\n\n\treturn c.Proto, nil\n}\n\nfunc NewConfig[T proto.Message](value T, options ...ConfigOption[T]) *Config[T] {\n\tvar c Config[T]\n\tc.Proto = value\n\tc.ApplyOptions(options...)\n\n\treturn &c\n}\n"
  },
  {
    "path": "pkg/config/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage config\n\nimport (\n\t\"github.com/spf13/viper\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\nfunc WithViper[T proto.Message](v *viper.Viper) ConfigOption[T] {\n\treturn ConfigOptionFunc[T](func(c *Config[T]) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/config/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage config\n\nimport \"google.golang.org/protobuf/proto\"\n\n// A ConfigOption sets options.\ntype ConfigOption[T proto.Message] interface {\n\tapply(*Config[T])\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption[T proto.Message] struct{}\n\nfunc (EmptyConfigOption[T]) apply(*Config[T]) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc[T proto.Message] func(*Config[T])\n\nfunc (f ConfigOptionFunc[T]) apply(do *Config[T]) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault[T proto.Message]() ConfigOption[T] {\n\treturn ConfigOptionFunc[T](func(*Config[T]) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config[T]) ApplyOptions(options ...ConfigOption[T]) *Config[T] {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/config/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/config\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/go-playground/validator/v10 v10.28.0\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-00010101000000-000000000000\n\tgithub.com/spf13/viper v1.21.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/golang/protobuf v1.5.4 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n"
  },
  {
    "path": "pkg/config/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "pkg/container/docker/docker.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.container.docker;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.container.docker;docker\";\n\nmessage Docker {\n  bool enabled = 1;\n  string address = 2;\n}\n"
  },
  {
    "path": "pkg/container/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/container\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n"
  },
  {
    "path": "pkg/container/go.sum",
    "content": ""
  },
  {
    "path": "pkg/crontab/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage crontab\n\nimport (\n\t\"context\"\n\n\t\"github.com/go-playground/validator/v10\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\n// Config ...\ntype Config struct {\n\tProto Crontab\n\n\tValidator *validator.Validate\n\topts      struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\n// CompletedConfig ...\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context) (*CrontabSerivce, error) {\n\n\tlogrus.Infof(\"Installing Crontab\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\treturn nil, nil\n\t}\n\n\trs, err := c.install(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed Crontab\")\n\n\treturn rs, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context) (*CrontabSerivce, error) {\n\tcheckInterval := c.Proto.GetCheckInterval().AsDuration()\n\trs := NewCrontabSerivce(checkInterval)\n\treturn rs, nil\n}\n\n// Validate checks Config.\nfunc (c *completedConfig) Validate() error {\n\treturn c.Validator.Struct(c)\n}\n\n// Complete fills in any fields not set that are required to have valid data and can be derived\n// from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\n// NewConfig returns a Config struct with the default values\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/crontab/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage crontab\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/crontab/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage crontab\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/crontab/crontab.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage crontab\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/kaydxh/golang/go/errors\"\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"github.com/sirupsen/logrus\"\n\t\"go.uber.org/atomic\"\n)\n\n// Crontab ...\n\ntype CrontabSerivce struct {\n\tcheckInterval time.Duration\n\tinShutdown    atomic.Bool // true when when server is in shutdown\n\n\tmu     sync.Mutex\n\tcancel func()\n\tfs     []func(context.Context, *logrus.Entry) error\n}\n\n// NewCrontab ...\nfunc NewCrontabSerivce(\n\tcheckInterval time.Duration,\n) *CrontabSerivce {\n\ts := &CrontabSerivce{\n\t\tcheckInterval: checkInterval,\n\t}\n\treturn s\n}\n\n// Register ...\nfunc (c *CrontabSerivce) Register(f func(context.Context, *logrus.Entry) error) {\n\tc.fs = append(c.fs, f)\n}\n\n// Run will initialize the backend. It must not block, but may run go routines in the background.\nfunc (c *CrontabSerivce) Run(ctx context.Context) error {\n\tlogger := c.getLogger()\n\tlogger.Infoln(\"Crontab Run\")\n\tif c.inShutdown.Load() {\n\t\tlogger.Infoln(\"Crontab Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\tgo func() {\n\t\terrors.HandleError(c.Serve(ctx))\n\t}()\n\treturn nil\n}\n\n// Serve ...\nfunc (c *CrontabSerivce) Serve(ctx context.Context) error {\n\tlogger := c.getLogger()\n\tlogger.Infoln(\"Crontab Serve\")\n\n\tif c.inShutdown.Load() {\n\t\tlogger.Infoln(\"Crontab Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\n\tdefer c.inShutdown.Store(true)\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\tc.mu.Lock()\n\tc.cancel = cancel\n\tc.mu.Unlock()\n\n\ttime_.UntilWithContxt(ctx, func(ctx context.Context) error {\n\t\terr := c.check(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}, c.checkInterval)\n\tif err := ctx.Err(); err != nil {\n\t\tlogger.WithError(err).Errorf(\"stopped checking\")\n\t\treturn err\n\t}\n\tlogger.Info(\"stopped checking\")\n\treturn nil\n}\n\n// Shutdown ...\nfunc (c *CrontabSerivce) Shutdown() {\n\tc.inShutdown.Store(true)\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tif c.cancel != nil {\n\t\tc.cancel()\n\t}\n}\n\nfunc (c *CrontabSerivce) getLogger() *logrus.Entry {\n\treturn logrus.WithField(\"module\", \"Crontab\")\n}\n\nfunc (c *CrontabSerivce) check(ctx context.Context) error {\n\tvar (\n\t\twg   sync.WaitGroup\n\t\terrs []error\n\t)\n\tlogger := c.getLogger()\n\tc.mu.Lock()\n\tfs := c.fs\n\tc.mu.Unlock()\n\n\tfor _, f := range fs {\n\t\twg.Add(1)\n\t\tgo func(doFunc func(context.Context, *logrus.Entry) error) {\n\t\t\tdefer wg.Done()\n\t\t\terr := doFunc(ctx, logger)\n\t\t\tif err != nil {\n\t\t\t\tc.mu.Lock()\n\t\t\t\terrs = append(errs, err)\n\t\t\t\tc.mu.Unlock()\n\t\t\t}\n\t\t}(f)\n\t}\n\twg.Wait()\n\treturn errors_.NewAggregate(errs)\n}\n\n/*\ntype CronProcessor struct {\n\tcronRunner *cron.Cron\n}\n\ntype Job interface {\n\tRun()\n}\n\nfunc NewCronProcessor(specTime string, job Job) (*CronProcessor, error) {\n\tcp := &CronProcessor{\n\t\tcronRunner: cron.New(),\n\t}\n\n\tif cp.cronRunner == nil {\n\t\treturn nil, fmt.Errorf(\"failed to init cronRunner\")\n\t}\n\n\tif specTime == \"\" {\n\t\treturn nil, fmt.Errorf(\"specTime is empty\")\n\t}\n\n\terr := cp.cronRunner.AddJob(specTime, job)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to odd job in specTime: [%v]\", specTime)\n\t}\n\n\tcp.cronRunner.Start()\n\n\treturn cp, nil\n}\n\nfunc (c *CronProcessor) Stop() {\n\tc.cronRunner.Stop()\n}\n*/\n"
  },
  {
    "path": "pkg/crontab/crontab.pb.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.27.0\n// \tprotoc        v3.13.0\n// source: pkg/crontab/crontab.proto\n\npackage crontab\n\nimport (\n\tduration \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Crontab struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled       bool               `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tCheckInterval *duration.Duration `protobuf:\"bytes,4,opt,name=check_interval,json=checkInterval,proto3\" json:\"check_interval,omitempty\"`\n}\n\nfunc (x *Crontab) Reset() {\n\t*x = Crontab{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_crontab_crontab_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Crontab) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Crontab) ProtoMessage() {}\n\nfunc (x *Crontab) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_crontab_crontab_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Crontab.ProtoReflect.Descriptor instead.\nfunc (*Crontab) Descriptor() ([]byte, []int) {\n\treturn file_pkg_crontab_crontab_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Crontab) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Crontab) GetCheckInterval() *duration.Duration {\n\tif x != nil {\n\t\treturn x.CheckInterval\n\t}\n\treturn nil\n}\n\nvar File_pkg_crontab_crontab_proto protoreflect.FileDescriptor\n\nvar file_pkg_crontab_crontab_proto_rawDesc = []byte{\n\t0x0a, 0x19, 0x70, 0x6b, 0x67, 0x2f, 0x63, 0x72, 0x6f, 0x6e, 0x74, 0x61, 0x62, 0x2f, 0x63, 0x72,\n\t0x6f, 0x6e, 0x74, 0x61, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x67, 0x6f, 0x2e,\n\t0x70, 0x6b, 0x67, 0x2e, 0x63, 0x72, 0x6f, 0x6e, 0x74, 0x61, 0x62, 0x1a, 0x1e, 0x67, 0x6f, 0x6f,\n\t0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72,\n\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x65, 0x0a, 0x07, 0x43,\n\t0x72, 0x6f, 0x6e, 0x74, 0x61, 0x62, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65,\n\t0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,\n\t0x12, 0x40, 0x0a, 0x0e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76,\n\t0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,\n\t0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74,\n\t0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76,\n\t0x61, 0x6c, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,\n\t0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x63,\n\t0x72, 0x6f, 0x6e, 0x74, 0x61, 0x62, 0x3b, 0x63, 0x72, 0x6f, 0x6e, 0x74, 0x61, 0x62, 0x62, 0x06,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_crontab_crontab_proto_rawDescOnce sync.Once\n\tfile_pkg_crontab_crontab_proto_rawDescData = file_pkg_crontab_crontab_proto_rawDesc\n)\n\nfunc file_pkg_crontab_crontab_proto_rawDescGZIP() []byte {\n\tfile_pkg_crontab_crontab_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_crontab_crontab_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_crontab_crontab_proto_rawDescData)\n\t})\n\treturn file_pkg_crontab_crontab_proto_rawDescData\n}\n\nvar file_pkg_crontab_crontab_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_pkg_crontab_crontab_proto_goTypes = []interface{}{\n\t(*Crontab)(nil),           // 0: go.pkg.crontab.Crontab\n\t(*duration.Duration)(nil), // 1: google.protobuf.Duration\n}\nvar file_pkg_crontab_crontab_proto_depIdxs = []int32{\n\t1, // 0: go.pkg.crontab.Crontab.check_interval:type_name -> google.protobuf.Duration\n\t1, // [1:1] is the sub-list for method output_type\n\t1, // [1:1] is the sub-list for method input_type\n\t1, // [1:1] is the sub-list for extension type_name\n\t1, // [1:1] is the sub-list for extension extendee\n\t0, // [0:1] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_crontab_crontab_proto_init() }\nfunc file_pkg_crontab_crontab_proto_init() {\n\tif File_pkg_crontab_crontab_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_crontab_crontab_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Crontab); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_crontab_crontab_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_crontab_crontab_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_crontab_crontab_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_crontab_crontab_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_crontab_crontab_proto = out.File\n\tfile_pkg_crontab_crontab_proto_rawDesc = nil\n\tfile_pkg_crontab_crontab_proto_goTypes = nil\n\tfile_pkg_crontab_crontab_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/crontab/crontab.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.crontab;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.crontab;crontab\";\n\nmessage Crontab {\n  bool enabled = 1;\n  google.protobuf.Duration check_interval = 4;\n}\n"
  },
  {
    "path": "pkg/crontab/crontab.yaml",
    "content": "crontab:\n  enabled: true\n  check_interval : 10s\n"
  },
  {
    "path": "pkg/crontab/crontab_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage crontab_test\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\tcrontab_ \"github.com/kaydxh/golang/pkg/crontab\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc TestCrontabSerivce(t *testing.T) {\n\tcfgFile := \"./crontab.yaml\"\n\tconfig := crontab_.NewConfig(crontab_.WithViper(viper_.GetViper(cfgFile, \"crontab\")))\n\ts, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\ts.Run(context.Background())\n\n\ts.Register(func(ctx context.Context, logger *logrus.Entry) error {\n\t\tlogger.Infof(\"doing...\")\n\t\tfilepath.Walk(\"./testdata\", func(path string, info os.FileInfo, err error) error {\n\n\t\t\tif !info.IsDir() {\n\t\t\t\tnow := time.Now()\n\t\t\t\tif now.Sub(info.ModTime()) > time.Minute {\n\t\t\t\t\tt.Logf(\"file[%v] expired 1 Minute, modify time: %v, now: %v\", path, info.ModTime(), now)\n\t\t\t\t} else {\n\t\t\t\t\tt.Logf(\"file[%v] normal, modify time: %v, now: %v\", path, info.ModTime(), now)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn nil\n\t\t})\n\n\t\treturn nil\n\t})\n\n\ttime.Sleep(1 * time.Minute)\n\n}\n"
  },
  {
    "path": "pkg/crontab/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/crontab\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/go-playground/validator/v10 v10.28.0\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgo.uber.org/atomic v1.11.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n"
  },
  {
    "path": "pkg/crontab/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\n"
  },
  {
    "path": "pkg/crontab/testdata/1.txt",
    "content": "1\n"
  },
  {
    "path": "pkg/crontab/testdata/2.txt",
    "content": "2\n"
  },
  {
    "path": "pkg/crontab/testdata/3.txt",
    "content": "3\n"
  },
  {
    "path": "pkg/database/db.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage database\n\nimport (\n\t\"time\"\n)\n\nvar (\n\tExecuteTimeout = time.Minute\n)\n"
  },
  {
    "path": "pkg/database/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/database\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/go-redis/redis/v8 v8.11.5\n\tgithub.com/go-sql-driver/mysql v1.9.3\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/google/uuid v1.6.0\n\tgithub.com/jmoiron/sqlx v1.4.0\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgithub.com/stretchr/testify v1.11.1\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tfilippo.io/edwards25519 v1.1.0 // indirect\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect\n\tgithub.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/onsi/gomega v1.35.1 // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n)\n"
  },
  {
    "path": "pkg/database/go.sum",
    "content": "filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=\nfilippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=\ngithub.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=\ngithub.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=\ngithub.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=\ngithub.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=\ngithub.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=\ngithub.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=\ngithub.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=\ngithub.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=\ngithub.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=\ngithub.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=\ngithub.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=\ngithub.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=\ngithub.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=\ngithub.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=\ngopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\n"
  },
  {
    "path": "pkg/database/mysql/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\nimport (\n\t\"context\"\n\n\t\"github.com/jmoiron/sqlx\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto Mysql\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context) (*sqlx.DB, error) {\n\n\tlogrus.Infof(\"Installing Mysql\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\tlogrus.Warnf(\"Mysql disenabled\")\n\t\treturn nil, nil\n\t}\n\n\tsqlxDB, err := c.install(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed Mysql\")\n\n\treturn sqlxDB, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context) (*sqlx.DB, error) {\n\tdb := NewDB(\n\t\tDBConfig{\n\t\t\tAddress:  c.Proto.GetAddress(),\n\t\t\tDataName: c.Proto.GetDbName(),\n\t\t\tUserName: c.Proto.GetUsername(),\n\t\t\tPassword: c.Proto.GetPassword(),\n\t\t},\n\t\tWithMaxConnections(int(c.Proto.GetMaxConnections())),\n\t\tWithMaxIdleConnections(int(c.Proto.GetMaxIdleConnections())),\n\t\tWithDialTimeout(c.Proto.GetDialTimeout().AsDuration()),\n\t\tWithReadTimeout(c.Proto.GetReadTimeout().AsDuration()),\n\t\tWithWriteTimeout(c.Proto.GetWriteTimeout().AsDuration()),\n\t\tWithConnMaxLifetime(c.Proto.GetMaxLifeTime().AsDuration()),\n\t\tWithInterpolateParams(c.Proto.GetInterpolateParams()),\n\t)\n\n\treturn db.GetDatabaseUntil(\n\t\tctx,\n\t\tc.Proto.GetMaxWaitDuration().AsDuration(),\n\t\tc.Proto.GetFailAfterDuration().AsDuration(),\n\t)\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/database/mysql/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/database/mysql/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/database/mysql/migrate/rename_db.sql",
    "content": "delimiter ;;\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ `new_db_name` /*!40100 DEFAULT CHARACTER SET utf8*/;\n\nUSE `new_db_name`;\n\nSET @queryCount = (\nSELECT COUNT(*) FROM information_schema.TABLES\nWHERE table_schema IN ('old_db_name'));\n\nDROP PROCEDURE  IF EXISTS test_move;\nCREATE PROCEDURE test_move ()\nBEGIN\n\nDECLARE i INT DEFAULT 0;\nWHILE i < @queryCount \nDO\n\tSET @queryString := (\n\tSELECT CONCAT('RENAME TABLE ',table_schema,'.',table_name, ' TO ','new_db_name.',table_name,';')\n\t\tFROM information_schema.TABLES WHERE table_schema IN ('old_db_name') ORDER BY table_name LIMIT 1 );\n\tPREPARE stmt FROM @queryString;\n\tSELECT @queryString as ``;\n\tSELECT i as ``;\n\tEXECUTE stmt;\n\tSET i=i+1;\nEND WHILE ;\ncommit;\n\nEND;;\ndelimiter ;\nCALL test_move();\n\n"
  },
  {
    "path": "pkg/database/mysql/mysql.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t_ \"github.com/go-sql-driver/mysql\"\n\n\t\"github.com/jmoiron/sqlx\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n)\n\nvar (\n\tsqlDB  SQLDB\n\tsqlDBs map[DBConfig]SQLDB\n\tmu     sync.Mutex\n)\n\n// Default values for Mysql.\nconst (\n\tDefaultMaxConns     = 100\n\tDefaultMaxIdleConns = 10\n)\n\ntype DBConfig struct {\n\tAddress  string\n\tDataName string\n\tUserName string\n\tPassword string\n}\n\ntype DB struct {\n\t//DSN        string\n\tConf DBConfig\n\tdb   *sqlx.DB\n\n\topts struct {\n\t\tmaxConns     int\n\t\tmaxIdleConns int\n\t\tdialTimeout  time.Duration\n\t\treadTimeout  time.Duration\n\t\twriteTimeout time.Duration\n\t\t// connection reused time, 0 means never expired\n\t\tconnMaxLifetime   time.Duration\n\t\tinterpolateParams bool\n\t}\n}\n\nfunc NewDB(conf DBConfig, opts ...DBOption) *DB {\n\tconn := &DB{\n\t\tConf: conf,\n\t}\n\tconn.opts.maxConns = DefaultMaxConns\n\tconn.opts.maxIdleConns = DefaultMaxIdleConns\n\n\tconn.ApplyOptions(opts...)\n\n\treturn conn\n}\n\nfunc GetDB() *sqlx.DB {\n\treturn sqlDB.Load()\n}\n\nfunc GetTheDB(conf DBConfig) (*sqlx.DB, error) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\n\tsqlDB, ok := sqlDBs[conf]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"not found the db in cache\")\n\t}\n\treturn sqlDB.Load(), nil\n}\n\nfunc CloseDB() error {\n\tif sqlDB.Load() == nil {\n\t\treturn nil\n\t}\n\n\treturn sqlDB.Load().Close()\n}\n\nfunc CloseTheDB(conf DBConfig) error {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\n\tsqlDB, ok := sqlDBs[conf]\n\tif !ok {\n\t\treturn fmt.Errorf(\"not found the db in cache\")\n\t}\n\tif sqlDB.Load() == nil {\n\t\treturn nil\n\t}\n\n\terr := sqlDB.Load().Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdelete(sqlDBs, conf)\n\treturn nil\n}\n\nfunc (d *DB) GetDatabase() (*sqlx.DB, error) {\n\tif d.db != nil {\n\t\treturn d.db, nil\n\t}\n\n\tdsn := fmt.Sprintf(\n\t\t\"%s:%s@tcp(%s)/%s?charset=utf8&loc=Local&parseTime=true\",\n\t\td.Conf.UserName,\n\t\td.Conf.Password,\n\t\td.Conf.Address,\n\t\td.Conf.DataName,\n\t)\n\n\tdsnFull := fmt.Sprintf(\"%s%s\", dsn, func() string {\n\t\tvar params string\n\t\tif d.opts.dialTimeout > 0 {\n\t\t\tparams += fmt.Sprintf(\"&timeout=%fs\", d.opts.dialTimeout.Seconds())\n\t\t}\n\n\t\tif d.opts.readTimeout > 0 {\n\t\t\tparams += fmt.Sprintf(\"&readTimeout=%fs\", d.opts.readTimeout.Seconds())\n\t\t}\n\n\t\tif d.opts.writeTimeout > 0 {\n\t\t\tparams += fmt.Sprintf(\"&writeTimeout=%fs\", d.opts.writeTimeout.Seconds())\n\t\t}\n\n\t\tif d.opts.interpolateParams {\n\t\t\tparams += \"&interpolateParams=true\"\n\t\t} else {\n\t\t\tparams += \"&interpolateParams=false\"\n\t\t}\n\n\t\treturn params\n\n\t}())\n\n\tdb, err := sqlx.Open(\"mysql\", dsnFull)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := db.Ping(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdb.SetMaxOpenConns(d.opts.maxConns)\n\tdb.SetMaxIdleConns(d.opts.maxIdleConns)\n\tdb.SetConnMaxLifetime(d.opts.connMaxLifetime)\n\n\td.db = db\n\tsqlDB.Store(db)\n\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tif sqlDBs == nil {\n\t\tsqlDBs = make(map[DBConfig]SQLDB)\n\t}\n\tsqlDBs[d.Conf] = sqlDB\n\treturn d.db, nil\n}\n\nfunc (d *DB) GetDatabaseUntil(\n\tctx context.Context,\n\tmaxWaitInterval time.Duration,\n\tfailAfter time.Duration,\n) (*sqlx.DB, error) {\n\tvar db *sqlx.DB\n\texp := time_.NewExponentialBackOff(\n\t\ttime_.WithExponentialBackOffOptionMaxInterval(maxWaitInterval),\n\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(failAfter),\n\t)\n\terr := time_.BackOffUntilWithContext(ctx, func(ctx context.Context) (err_ error) {\n\t\tdb, err_ = d.GetDatabase()\n\t\tif err_ != nil {\n\t\t\treturn err_\n\t\t}\n\t\treturn nil\n\t}, exp, true, false)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get database fail after: %v\", failAfter)\n\t}\n\n\treturn db, nil\n\n}\n\nfunc (d *DB) Close() error {\n\tif d.db == nil {\n\t\treturn fmt.Errorf(\"no database pool\")\n\t}\n\treturn d.db.Close()\n}\n"
  },
  {
    "path": "pkg/database/mysql/mysql.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\nimport (\n\t\"time\"\n)\n\nfunc WithMaxConnections(maxConns int) DBOption {\n\treturn DBOptionFunc(func(c *DB) {\n\t\tc.opts.maxConns = maxConns\n\t})\n}\n\nfunc WithMaxIdleConnections(maxIdleConns int) DBOption {\n\treturn DBOptionFunc(func(c *DB) {\n\t\tc.opts.maxIdleConns = maxIdleConns\n\t})\n}\n\nfunc WithDialTimeout(dialTimeout time.Duration) DBOption {\n\treturn DBOptionFunc(func(c *DB) {\n\t\tc.opts.dialTimeout = dialTimeout\n\t})\n}\n\nfunc WithReadTimeout(readTimeout time.Duration) DBOption {\n\treturn DBOptionFunc(func(c *DB) {\n\t\tc.opts.readTimeout = readTimeout\n\t})\n}\n\nfunc WithWriteTimeout(writeTimeout time.Duration) DBOption {\n\treturn DBOptionFunc(func(c *DB) {\n\t\tc.opts.writeTimeout = writeTimeout\n\t})\n}\n\nfunc WithConnMaxLifetime(connMaxLifetime time.Duration) DBOption {\n\treturn DBOptionFunc(func(c *DB) {\n\t\tc.opts.connMaxLifetime = connMaxLifetime\n\t})\n}\n\nfunc WithInterpolateParams(enabled bool) DBOption {\n\treturn DBOptionFunc(func(c *DB) {\n\t\tc.opts.interpolateParams = enabled\n\t})\n}\n"
  },
  {
    "path": "pkg/database/mysql/mysql.pb.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.27.0\n// \tprotoc        v3.13.0\n// source: pkg/database/mysql/mysql.proto\n\npackage mysql\n\nimport (\n\tduration \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Mysql struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled            bool               `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tAddress            string             `protobuf:\"bytes,2,opt,name=address,proto3\" json:\"address,omitempty\"`\n\tUsername           string             `protobuf:\"bytes,3,opt,name=username,proto3\" json:\"username,omitempty\"`\n\tPassword           string             `protobuf:\"bytes,4,opt,name=password,proto3\" json:\"password,omitempty\"`\n\tDbName             string             `protobuf:\"bytes,5,opt,name=db_name,json=dbName,proto3\" json:\"db_name,omitempty\"`\n\tMaxConnections     int32              `protobuf:\"varint,6,opt,name=max_connections,json=maxConnections,proto3\" json:\"max_connections,omitempty\"`\n\tMaxIdleConnections int32              `protobuf:\"varint,7,opt,name=max_idle_connections,json=maxIdleConnections,proto3\" json:\"max_idle_connections,omitempty\"`\n\tDialTimeout        *duration.Duration `protobuf:\"bytes,8,opt,name=dial_timeout,json=dialTimeout,proto3\" json:\"dial_timeout,omitempty\"`\n\tReadTimeout        *duration.Duration `protobuf:\"bytes,9,opt,name=read_timeout,json=readTimeout,proto3\" json:\"read_timeout,omitempty\"`\n\t// https://github.com/go-sql-driver/mysql#writetimeout\n\tWriteTimeout      *duration.Duration `protobuf:\"bytes,10,opt,name=write_timeout,json=writeTimeout,proto3\" json:\"write_timeout,omitempty\"`\n\tMaxLifeTime       *duration.Duration `protobuf:\"bytes,11,opt,name=max_life_time,json=maxLifeTime,proto3\" json:\"max_life_time,omitempty\"`\n\tMaxWaitDuration   *duration.Duration `protobuf:\"bytes,12,opt,name=max_wait_duration,json=maxWaitDuration,proto3\" json:\"max_wait_duration,omitempty\"`\n\tFailAfterDuration *duration.Duration `protobuf:\"bytes,13,opt,name=fail_after_duration,json=failAfterDuration,proto3\" json:\"fail_after_duration,omitempty\"`\n\tInterpolateParams bool               `protobuf:\"varint,14,opt,name=interpolate_params,json=interpolateParams,proto3\" json:\"interpolate_params,omitempty\"`\n}\n\nfunc (x *Mysql) Reset() {\n\t*x = Mysql{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_database_mysql_mysql_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Mysql) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Mysql) ProtoMessage() {}\n\nfunc (x *Mysql) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_database_mysql_mysql_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Mysql.ProtoReflect.Descriptor instead.\nfunc (*Mysql) Descriptor() ([]byte, []int) {\n\treturn file_pkg_database_mysql_mysql_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Mysql) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Mysql) GetAddress() string {\n\tif x != nil {\n\t\treturn x.Address\n\t}\n\treturn \"\"\n}\n\nfunc (x *Mysql) GetUsername() string {\n\tif x != nil {\n\t\treturn x.Username\n\t}\n\treturn \"\"\n}\n\nfunc (x *Mysql) GetPassword() string {\n\tif x != nil {\n\t\treturn x.Password\n\t}\n\treturn \"\"\n}\n\nfunc (x *Mysql) GetDbName() string {\n\tif x != nil {\n\t\treturn x.DbName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Mysql) GetMaxConnections() int32 {\n\tif x != nil {\n\t\treturn x.MaxConnections\n\t}\n\treturn 0\n}\n\nfunc (x *Mysql) GetMaxIdleConnections() int32 {\n\tif x != nil {\n\t\treturn x.MaxIdleConnections\n\t}\n\treturn 0\n}\n\nfunc (x *Mysql) GetDialTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.DialTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Mysql) GetReadTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.ReadTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Mysql) GetWriteTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.WriteTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Mysql) GetMaxLifeTime() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MaxLifeTime\n\t}\n\treturn nil\n}\n\nfunc (x *Mysql) GetMaxWaitDuration() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MaxWaitDuration\n\t}\n\treturn nil\n}\n\nfunc (x *Mysql) GetFailAfterDuration() *duration.Duration {\n\tif x != nil {\n\t\treturn x.FailAfterDuration\n\t}\n\treturn nil\n}\n\nfunc (x *Mysql) GetInterpolateParams() bool {\n\tif x != nil {\n\t\treturn x.InterpolateParams\n\t}\n\treturn false\n}\n\nvar File_pkg_database_mysql_mysql_proto protoreflect.FileDescriptor\n\nvar file_pkg_database_mysql_mysql_proto_rawDesc = []byte{\n\t0x0a, 0x1e, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6d,\n\t0x79, 0x73, 0x71, 0x6c, 0x2f, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x12, 0x15, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,\n\t0x65, 0x2e, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x05, 0x0a, 0x05, 0x4d, 0x79, 0x73, 0x71,\n\t0x6c, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01,\n\t0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61,\n\t0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64,\n\t0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d,\n\t0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d,\n\t0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20,\n\t0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x17, 0x0a,\n\t0x07, 0x64, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,\n\t0x64, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f,\n\t0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52,\n\t0x0e, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,\n\t0x30, 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e,\n\t0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6d,\n\t0x61, 0x78, 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,\n\t0x73, 0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,\n\t0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69,\n\t0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12,\n\t0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18,\n\t0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,\n\t0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a,\n\t0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0a,\n\t0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,\n\t0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3d, 0x0a,\n\t0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b,\n\t0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,\n\t0x0b, 0x6d, 0x61, 0x78, 0x4c, 0x69, 0x66, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x11,\n\t0x6d, 0x61, 0x78, 0x5f, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69,\n\t0x6f, 0x6e, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x57, 0x61, 0x69, 0x74, 0x44, 0x75, 0x72, 0x61, 0x74,\n\t0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x13, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x66, 0x74, 0x65,\n\t0x72, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b,\n\t0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x66, 0x61, 0x69,\n\t0x6c, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d,\n\t0x0a, 0x12, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x61,\n\t0x72, 0x61, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x69, 0x6e, 0x74, 0x65,\n\t0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x2f, 0x5a,\n\t0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64,\n\t0x78, 0x68, 0x2f, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,\n\t0x73, 0x65, 0x2e, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x3b, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x62, 0x06,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_database_mysql_mysql_proto_rawDescOnce sync.Once\n\tfile_pkg_database_mysql_mysql_proto_rawDescData = file_pkg_database_mysql_mysql_proto_rawDesc\n)\n\nfunc file_pkg_database_mysql_mysql_proto_rawDescGZIP() []byte {\n\tfile_pkg_database_mysql_mysql_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_database_mysql_mysql_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_database_mysql_mysql_proto_rawDescData)\n\t})\n\treturn file_pkg_database_mysql_mysql_proto_rawDescData\n}\n\nvar file_pkg_database_mysql_mysql_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_pkg_database_mysql_mysql_proto_goTypes = []interface{}{\n\t(*Mysql)(nil),             // 0: go.pkg.database.mysql.Mysql\n\t(*duration.Duration)(nil), // 1: google.protobuf.Duration\n}\nvar file_pkg_database_mysql_mysql_proto_depIdxs = []int32{\n\t1, // 0: go.pkg.database.mysql.Mysql.dial_timeout:type_name -> google.protobuf.Duration\n\t1, // 1: go.pkg.database.mysql.Mysql.read_timeout:type_name -> google.protobuf.Duration\n\t1, // 2: go.pkg.database.mysql.Mysql.write_timeout:type_name -> google.protobuf.Duration\n\t1, // 3: go.pkg.database.mysql.Mysql.max_life_time:type_name -> google.protobuf.Duration\n\t1, // 4: go.pkg.database.mysql.Mysql.max_wait_duration:type_name -> google.protobuf.Duration\n\t1, // 5: go.pkg.database.mysql.Mysql.fail_after_duration:type_name -> google.protobuf.Duration\n\t6, // [6:6] is the sub-list for method output_type\n\t6, // [6:6] is the sub-list for method input_type\n\t6, // [6:6] is the sub-list for extension type_name\n\t6, // [6:6] is the sub-list for extension extendee\n\t0, // [0:6] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_database_mysql_mysql_proto_init() }\nfunc file_pkg_database_mysql_mysql_proto_init() {\n\tif File_pkg_database_mysql_mysql_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_database_mysql_mysql_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Mysql); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_database_mysql_mysql_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_database_mysql_mysql_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_database_mysql_mysql_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_database_mysql_mysql_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_database_mysql_mysql_proto = out.File\n\tfile_pkg_database_mysql_mysql_proto_rawDesc = nil\n\tfile_pkg_database_mysql_mysql_proto_goTypes = nil\n\tfile_pkg_database_mysql_mysql_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/database/mysql/mysql.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.database.mysql;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.database.mysql;mysql\";\n\nmessage Mysql {\n  bool enabled = 1;\n  string address = 2;\n  string username = 3;\n  string password = 4;\n  string db_name = 5;\n\n  int32 max_connections = 6;\n  int32 max_idle_connections = 7;\n\n  google.protobuf.Duration dial_timeout = 8;\n  google.protobuf.Duration read_timeout = 9;\n  // https://github.com/go-sql-driver/mysql#writetimeout\n  google.protobuf.Duration write_timeout = 10;\n  google.protobuf.Duration max_life_time = 11;\n\n  google.protobuf.Duration max_wait_duration = 12;\n  google.protobuf.Duration fail_after_duration = 13;\n  bool interpolate_params = 14;\n}\n"
  },
  {
    "path": "pkg/database/mysql/mysql.yaml",
    "content": "database:\n  mysql:\n    enabled: true\n    address: \"localhost:3306\"\n    username: \"root\"\n    password: \"12345\"\n    db_name: \"sealet\"\n    max_connections: 100\n    max_idle_connections: 10\n    dial_timeout: 5s\n    max_wait_duration: 20s\n    fail_after_duration: 60s\n    interpolate_params: true\n"
  },
  {
    "path": "pkg/database/mysql/mysql_operate_test.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql_test\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/uuid\"\n\tmysql_ \"github.com/kaydxh/golang/pkg/database/mysql\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n)\n\ntype TaskTable struct {\n\t//\tId sql.NullInt64 `db:\"id\"` // primary key ID\n\n\t// NullTime represents a time.Time that may be null.\n\t// NullTime implements the Scanner interface so\n\t// it can be used as a scan destination, similar to NullString.\n\tCreateTime sql.NullTime `db:\"create_time\"`\n\tUpdateTime sql.NullTime `db:\"update_time\"`\n\n\tGroupId    string `db:\"group_id\"`\n\tPageId     string `db:\"page_id\"`\n\tFeaId      string `db:\"fea_id\"`\n\tEntityId   string `db:\"entity_id\"`\n\tFeature0   []byte `db:\"feature0\"`\n\tFeature1   []byte `db:\"feature1\"`\n\tExtendInfo []byte `db:\"extend_info\"`\n}\n\ntype Tasks []*TaskTable\n\nfunc (t Tasks) String() string {\n\ts := \"[\"\n\tfor _, task := range t {\n\t\ts += fmt.Sprintf(\"%v,\", task)\n\t}\n\tif len(t) > 0 {\n\t\ts = strings.TrimRight(s, \",\")\n\t}\n\n\treturn s + \"]\"\n}\nfunc TestInsert(t *testing.T) {\n\n\tcfgFile := \"./mysql.dev.yaml\"\n\tconfig := mysql_.NewConfig(mysql_.WithViper(viper_.GetViper(cfgFile, \"database.mysql\")))\n\n\tdb, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\tt.Logf(\"db: %#v\", db)\n\tctx := context.Background()\n\n\ttestCases := []struct {\n\t\tTableName string\n\t\tGroupId   string\n\t\tNumber    int64\n\t}{\n\t\t{\n\t\t\tTableName: \"hetu_zeus_0\",\n\t\t\tGroupId:   \"hetu_image_copyright_prod\",\n\t\t\tNumber:    100,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"table[%v]-fieldKey[%v]\", testCase.TableName, testCase.GroupId), func(t *testing.T) {\n\n\t\t\tcount := testCase.Number\n\n\t\t\tfor count > 0 {\n\t\t\t\targ := &TaskTable{\n\t\t\t\t\tGroupId:    testCase.GroupId,\n\t\t\t\t\tPageId:     \"100\",\n\t\t\t\t\tFeaId:      uuid.NewString(),\n\t\t\t\t\tFeature0:   []byte(\"Feature0\"),\n\t\t\t\t\tFeature1:   []byte(\"Feature1\"),\n\t\t\t\t\tExtendInfo: []byte(\"ExtendInfo\"),\n\t\t\t\t}\n\t\t\t\tquery := fmt.Sprintf(`INSERT INTO %s\n\t\t\t   (\n\t\t\t   group_id,\n\t\t\t   page_id,\n\t\t\t   fea_id,\n\t\t\t   entity_id,\n\t\t\t   feature0,\n\t\t\t   feature1,\n\t\t\t   extend_info\n\t\t\t   )\n\t\t\t   VALUES (\n\t\t\t         :group_id,\n\t\t\t         :page_id,\n\t\t\t\t\t :fea_id,\n\t\t\t\t\t :entity_id,\n\t\t\t\t\t :feature0,\n\t\t\t\t\t :feature1,\n\t\t\t\t\t :extend_info\n\t\t\t\t\t )\n                     `, testCase.TableName)\n\n\t\t\t\t_, err = mysql_.ExecContext(ctx, query, arg, nil, db)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"faild to insert %v, err: %v\", arg, err)\n\t\t\t\t}\n\t\t\t\tcount--\n\t\t\t}\n\n\t\t})\n\t}\n}\n\nfunc TestInsertNewBatch(t *testing.T) {\n\n\tcfgFile := \"./mysql.dev.yaml\"\n\tconfig := mysql_.NewConfig(mysql_.WithViper(viper_.GetViper(cfgFile, \"database.mysql\")))\n\n\tdb, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\tt.Logf(\"db: %#v\", db)\n\tctx := context.Background()\n\n\tbatch := 512\n\ttableName := \"hetu_zeus_0\"\n\n\tcols := []string{\"group_id\", \"page_id\", \"fea_id\", \"entity_id\", \"feature0\", \"feature1\", \"extend_info\"}\n\tquery := fmt.Sprintf(`INSERT INTO %s\n\t\t\t   (\n\t\t\t   group_id,\n\t\t\t   page_id,\n\t\t\t   fea_id,\n\t\t\t   entity_id,\n\t\t\t   feature0,\n\t\t\t   feature1,\n\t\t\t   extend_info\n\t\t\t   )\n\t\t\t   VALUES %s\n                     `, tableName,\n\t\tmysql_.JoinNamedColumnsValuesBatch(cols, batch))\n\n\ttestCases := []struct {\n\t\tTableName string\n\t\tGroupId   string\n\t\tNumber    int64\n\t}{\n\t\t{\n\t\t\tTableName: \"hetu_zeus_0\",\n\t\t\tGroupId:   \"hetu_image_copyright_prod\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"table[%v]-fieldKey[%v]\", testCase.TableName, testCase.GroupId), func(t *testing.T) {\n\n\t\t\tcount := batch\n\t\t\tvar args []*TaskTable\n\t\t\tfor count > 0 {\n\t\t\t\targ := &TaskTable{\n\t\t\t\t\tGroupId:    testCase.GroupId,\n\t\t\t\t\tPageId:     \"100\",\n\t\t\t\t\tFeaId:      uuid.NewString(),\n\t\t\t\t\tEntityId:   \"200\",\n\t\t\t\t\tFeature0:   []byte(\"Feature0\"),\n\t\t\t\t\tFeature1:   []byte(\"Feature1\"),\n\t\t\t\t\tExtendInfo: []byte(\"ExtendInfo\"),\n\t\t\t\t}\n\t\t\t\targs = append(args, arg)\n\t\t\t\tcount--\n\t\t\t}\n\t\t\t_, err = mysql_.ExecContext(ctx, query, mysql_.BuildNamedColumnsValuesBatch(args), nil, db)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"faild to insert %v, err: %v\", args, err)\n\t\t\t}\n\n\t\t})\n\t}\n}\n\nfunc TestInsertBatch(t *testing.T) {\n\n\tcfgFile := \"./mysql.dev.yaml\"\n\tconfig := mysql_.NewConfig(mysql_.WithViper(viper_.GetViper(cfgFile, \"database.mysql\")))\n\n\tdb, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\tt.Logf(\"db: %#v\", db)\n\tctx := context.Background()\n\n\ttableName := \"hetu_zeus_0\"\n\tquery := fmt.Sprintf(`INSERT INTO %s\n\t\t\t   (\n\t\t\t   group_id,\n\t\t\t   page_id,\n\t\t\t   fea_id,\n\t\t\t   entity_id,\n\t\t\t   feature0,\n\t\t\t   feature1,\n\t\t\t   extend_info\n\t\t\t   )\n\t\t\t   VALUES (\n\t\t\t         :group_id_1,\n\t\t\t         :page_id_1,\n\t\t\t\t\t :fea_id_1,\n\t\t\t\t\t :entity_id_1,\n\t\t\t\t\t :feature0_1,\n\t\t\t\t\t :feature1_1,\n\t\t\t\t\t :extend_info_1\n\t\t\t\t\t ),\n\t\t\t\t\t\t   (\n\t\t\t\t\t         :group_id_2,\n\t\t\t\t\t         :page_id_2,\n\t\t\t\t\t\t\t :fea_id_2,\n\t\t\t\t\t\t\t :entity_id_2,\n\t\t\t\t\t\t\t :feature0_2,\n\t\t\t\t\t\t\t :feature1_2,\n\t\t\t\t\t\t\t :extend_info_2\n\t\t\t\t\t\t\t )\n                     `, tableName)\n\n\ttestCases := []struct {\n\t\tTableName string\n\t\tGroupId   string\n\t\tNumber    int64\n\t}{\n\t\t{\n\t\t\tTableName: \"hetu_zeus_0\",\n\t\t\tGroupId:   \"hetu_image_copyright_prod\",\n\t\t\tNumber:    2,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"table[%v]-fieldKey[%v]\", testCase.TableName, testCase.GroupId), func(t *testing.T) {\n\n\t\t\tcount := testCase.Number\n\t\t\tvar args []TaskTable\n\n\t\t\tfor count > 0 {\n\t\t\t\targ := TaskTable{\n\t\t\t\t\tGroupId:    testCase.GroupId,\n\t\t\t\t\tPageId:     \"100\",\n\t\t\t\t\tFeaId:      uuid.NewString(),\n\t\t\t\t\tEntityId:   \"200\",\n\t\t\t\t\tFeature0:   []byte(\"Feature0\"),\n\t\t\t\t\tFeature1:   []byte(\"Feature1\"),\n\t\t\t\t\tExtendInfo: []byte(\"ExtendInfo\"),\n\t\t\t\t}\n\t\t\t\targs = append(args, arg)\n\t\t\t\tcount--\n\t\t\t}\n\n\t\t\ttagsValues := map[string]interface{}{\n\t\t\t\t\"group_id_1\":    \"group_id_1\",\n\t\t\t\t\"page_id_1\":     uuid.NewString(),\n\t\t\t\t\"fea_id_1\":      uuid.NewString(),\n\t\t\t\t\"entity_id_1\":   uuid.NewString(),\n\t\t\t\t\"feature0_1\":    \"feature0_1\",\n\t\t\t\t\"feature1_1\":    \"feature1_1\",\n\t\t\t\t\"extend_info_1\": \"extend_info_1\",\n\t\t\t\t\"group_id_2\":    \"group_id_2\",\n\t\t\t\t\"page_id_2\":     uuid.NewString(),\n\t\t\t\t\"fea_id_2\":      uuid.NewString(),\n\t\t\t\t\"entity_id_2\":   uuid.NewString(),\n\t\t\t\t\"feature0_2\":    \"feature0_2\",\n\t\t\t\t\"feature1_2\":    \"feature1_2\",\n\t\t\t\t\"extend_info_2\": \"extend_info_2\",\n\t\t\t}\n\t\t\tt.Logf(\"batch insert %v\", tagsValues)\n\n\t\t\t//_, err = mysql_.ExecContext(ctx, query, tagsValues, nil, db)\n\t\t\t//_, err = mysql_.ExecContext(ctx, query, []interface{}{tagsValues[0], tagsValues[1]}, nil, db)\n\t\t\t_, err = mysql_.ExecContext(ctx, query, tagsValues, nil, db)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"faild to insert %v, err: %v\", tagsValues, err)\n\t\t\t}\n\n\t\t})\n\t}\n}\n\nfunc TestDeleteBatch(t *testing.T) {\n\n\tcfgFile := \"./mysql.yaml\"\n\tconfig := mysql_.NewConfig(mysql_.WithViper(viper_.GetViper(cfgFile, \"database.mysql\")))\n\n\tdb, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\tt.Logf(\"db: %#v\", db)\n\tctx := context.Background()\n\n\ttestCases := []struct {\n\t\tTableName   string\n\t\tGroupId     string\n\t\tDeleteField string\n\t\tBatch       int64\n\t}{\n\t\t{\n\t\t\tTableName:   \"hetu_zeus_0\",\n\t\t\tDeleteField: \"group_id\",\n\t\t\tGroupId:     \"hetu_image_copyright_prod\",\n\t\t\tBatch:       5,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"table[%v]-fieldKey[%v]\", testCase.TableName, testCase.GroupId), func(t *testing.T) {\n\n\t\t\tvar count int64\n\t\t\targ := &TaskTable{\n\t\t\t\tGroupId: testCase.GroupId,\n\t\t\t}\n\n\t\t\tfor {\n\t\t\t\tquery := fmt.Sprintf(\n\t\t\t\t\t`DELETE FROM %s\n\t           WHERE %s limit %v`,\n\t\t\t\t\ttestCase.TableName,\n\t\t\t\t\tmysql_.ConditionWithEqualAnd(testCase.DeleteField),\n\t\t\t\t\ttestCase.Batch,\n\t\t\t\t)\n\t\t\t\trows, err := mysql_.ExecContext(ctx, query, arg, nil, db)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"failed to delete %v, current deleted total number: %v, err: %v\", arg.GroupId, count, err)\n\t\t\t\t}\n\n\t\t\t\tcount += rows\n\t\t\t\tif rows == 0 {\n\t\t\t\t\tt.Logf(\"finished to delete %v, total number: %v\", arg.GroupId, count)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tif count%testCase.Batch == 0 {\n\t\t\t\t\tt.Logf(\"delete number: %v ...\", count)\n\t\t\t\t}\n\t\t\t}\n\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "pkg/database/mysql/mysql_options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\n// A DBOption sets options.\ntype DBOption interface {\n\tapply(*DB)\n}\n\n// EmptyDBUrlOption does not alter the DBuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyDBOption struct{}\n\nfunc (EmptyDBOption) apply(*DB) {}\n\n// DBOptionFunc wraps a function that modifies DB into an\n// implementation of the DBOption interface.\ntype DBOptionFunc func(*DB)\n\nfunc (f DBOptionFunc) apply(do *DB) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _DBOptionWithDefault() DBOption {\n\treturn DBOptionFunc(func(*DB) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *DB) ApplyOptions(options ...DBOption) *DB {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/database/mysql/mysql_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\tmysql_ \"github.com/kaydxh/golang/pkg/database/mysql\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestGetDataBase(t *testing.T) {\n\ttestCases := []struct {\n\t\tAddress           string\n\t\tDataName          string\n\t\tUserName          string\n\t\tPassword          string\n\t\tInterpolateParams bool\n\t}{\n\t\t{\n\t\t\tAddress:           \"127.0.0.1:3306\",\n\t\t\tDataName:          \"sealet\",\n\t\t\tUserName:          \"root\",\n\t\t\tPassword:          \"123456\",\n\t\t\tInterpolateParams: true,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.Address+testCase.DataName, func(t *testing.T) {\n\t\t\tdb := mysql_.NewDB(mysql_.DBConfig{\n\t\t\t\tAddress:  testCase.Address,\n\t\t\t\tDataName: testCase.DataName,\n\t\t\t\tUserName: testCase.UserName,\n\t\t\t\tPassword: testCase.Password,\n\t\t\t},\n\t\t\t\tmysql_.WithInterpolateParams(testCase.InterpolateParams),\n\t\t\t)\n\t\t\tsqlDB, err := db.GetDatabase()\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to get database: %v, got : %s\", testCase.DataName, err)\n\t\t\t}\n\t\t\tassert.NotNil(t, sqlDB)\n\t\t})\n\t}\n\n}\n\nfunc TestGetDatabaseUntil(t *testing.T) {\n\ttestCases := []struct {\n\t\tAddress     string\n\t\tDataName    string\n\t\tUserName    string\n\t\tPassword    string\n\t\tDailTimeout time.Duration\n\t}{\n\t\t{\n\t\t\tAddress:     \"127.0.0.1:3306\",\n\t\t\tDataName:    \"test\",\n\t\t\tUserName:    \"root\",\n\t\t\tPassword:    \"123456\",\n\t\t\tDailTimeout: 3 * time.Second,\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.Address+testCase.DataName, func(t *testing.T) {\n\t\t\tdb := mysql_.NewDB(mysql_.DBConfig{\n\t\t\t\tAddress:  testCase.Address,\n\t\t\t\tDataName: testCase.DataName,\n\t\t\t\tUserName: testCase.UserName,\n\t\t\t\tPassword: testCase.Password,\n\t\t\t}, mysql_.WithDialTimeout(testCase.DailTimeout))\n\t\t\tsqlDB, err := db.GetDatabaseUntil(context.Background(), 5*time.Second, 20*time.Second)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to get database: %v, got : %s\", testCase.DataName, err)\n\t\t\t}\n\t\t\tassert.NotNil(t, sqlDB)\n\t\t})\n\t}\n\n}\n\nfunc TestNew(t *testing.T) {\n\n\tcfgFile := \"./mysql.yaml\"\n\tconfig := mysql_.NewConfig(mysql_.WithViper(viper_.GetViper(cfgFile, \"database.mysql\")))\n\n\tdb, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\tt.Logf(\"db: %#v\", db)\n}\n\nfunc TestGetTheDBAndClose(t *testing.T) {\n\ttestCases := []struct {\n\t\tAddress  string\n\t\tDataName string\n\t\tUserName string\n\t\tPassword string\n\t}{\n\t\t{\n\t\t\tAddress:  \"127.0.0.1:3306\",\n\t\t\tDataName: \"test\",\n\t\t\tUserName: \"root\",\n\t\t\tPassword: \"123456\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.Address+testCase.DataName, func(t *testing.T) {\n\t\t\tconf := mysql_.DBConfig{\n\t\t\t\tAddress:  testCase.Address,\n\t\t\t\tDataName: testCase.DataName,\n\t\t\t\tUserName: testCase.UserName,\n\t\t\t\tPassword: testCase.Password,\n\t\t\t}\n\t\t\tdb := mysql_.NewDB(conf)\n\t\t\tsqlDB, err := db.GetDatabaseUntil(context.Background(), 5*time.Second, 20*time.Second)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to get database: %v, got : %s\", testCase.DataName, err)\n\t\t\t}\n\t\t\tassert.NotNil(t, sqlDB)\n\n\t\t\ttheDB, err := mysql_.GetTheDB(conf)\n\t\t\tassert.Nil(t, err)\n\n\t\t\tassert.Equal(t, sqlDB, mysql_.GetDB())\n\t\t\tt.Logf(\"GetDB got sqlDB: %v, expect %v\", sqlDB, mysql_.GetDB())\n\t\t\tt.Logf(\"GetTheDB got sqlDB: %v, expect %v\", sqlDB, theDB)\n\t\t\terr = mysql_.CloseTheDB(conf)\n\t\t\tassert.Nil(t, err)\n\t\t\terr = mysql_.CloseDB()\n\t\t\tassert.Nil(t, err)\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "pkg/database/mysql/mysql_transaction.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"fmt\"\n\n\t\"github.com/jmoiron/sqlx\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype TxDao struct {\n\t*sqlx.Tx\n}\n\nfunc (d *TxDao) Begin(ctx context.Context, db *sqlx.DB, opts *sql.TxOptions) error {\n\tif db == nil {\n\t\treturn fmt.Errorf(\"unexpected err: db is nil\")\n\t}\n\n\ttx, err := db.BeginTxx(ctx, opts)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\td.Tx = tx\n\n\treturn nil\n}\n\nfunc (d *TxDao) Commit() error {\n\tif d.Tx == nil {\n\t\treturn fmt.Errorf(\"unexpected err: tx is nil\")\n\t}\n\n\terr := d.Tx.Commit()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// Rollback ...\nfunc (d *TxDao) Rollback() error {\n\tif d.Tx == nil {\n\t\treturn fmt.Errorf(\"unexpected err: tx is nil\")\n\t}\n\n\terr := d.Tx.Rollback()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc TxPipelined(ctx context.Context, db *sqlx.DB, fn func(*sqlx.Tx) error) (err error) {\n\tvar tx TxDao\n\terr = tx.Begin(ctx, db, nil)\n\tif err != nil {\n\t\tlogrus.WithError(err).Errorf(\"failed to transaction begin\")\n\t\treturn err\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tif txErr := tx.Rollback(); txErr != nil {\n\t\t\t\tlogrus.WithError(err).Errorf(\"failed to rollback, err: %v\", txErr)\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tif err = tx.Commit(); err != nil {\n\t\t\tlogrus.WithError(err).Errorf(\"failed to commit\")\n\t\t\treturn\n\t\t}\n\n\t}()\n\n\treturn fn(tx.Tx)\n}\n"
  },
  {
    "path": "pkg/database/mysql/sql.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/jmoiron/sqlx\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\tstrings_ \"github.com/kaydxh/golang/go/strings\"\n)\n\nconst dbTag = \"db\"\n\ntype SqlCompare string\n\nconst (\n\tSqlCompareEqual      SqlCompare = \"=\"\n\tSqlCompareNotEqual   SqlCompare = \"!=\"\n\tSqlCompareGreater    SqlCompare = \">\"\n\tSqlCompareLessThan   SqlCompare = \"<\"\n\tSqlCompareGreatEqual SqlCompare = \">=\"\n\tSqlCompareLessEqual  SqlCompare = \"<=\"\n\tSqlCompareLike       SqlCompare = \"LIKE\"\n\tSqlCompareIn         SqlCompare = \"IN\"\n)\n\ntype SqlOperator string\n\nconst (\n\tSqlOperatorAnd SqlOperator = \"AND\"\n\tSqlOperatorOr  SqlOperator = \"OR\"\n\tSqlOperatorNot SqlOperator = \"NOT\"\n)\n\n// \"foo=:foo AND bar=:bar\"\nfunc NonzeroCondition(cmp SqlCompare, oper SqlOperator, arg interface{}) string {\n\tcondFields := reflect_.NonzeroFieldTags(arg, dbTag)\n\treturn fmt.Sprintf(\" %s \", func() string {\n\t\tif len(condFields) == 0 {\n\t\t\treturn \"TRUE\"\n\t\t}\n\t\treturn fmt.Sprintf(\"%s\", JoinNamedColumnsValuesWithOperator(cmp, oper, condFields...))\n\t}())\n}\n\nfunc NonzeroFields(arg interface{}) []string {\n\treturn reflect_.NonzeroFieldTags(arg, dbTag)\n}\n\nfunc ConditionWithEqualAnd(condFields ...string) string {\n\treturn JoinNamedColumnsValuesWithOperator(SqlCompareEqual, SqlOperatorAnd, condFields...)\n}\n\n// \"ORDER BY create_time DESC, id DESC\"\nfunc OrderCondition(orders map[string]bool) string {\n\tif len(orders) == 0 {\n\t\treturn \"\"\n\t}\n\n\treturn fmt.Sprintf(\" ORDER BY %s\", func() string {\n\t\tvar msg string\n\t\tfor k, v := range orders {\n\t\t\tmsg += fmt.Sprintf(\"%s %s,\", k, func() string {\n\t\t\t\tif v {\n\t\t\t\t\treturn \"DESC\"\n\t\t\t\t}\n\t\t\t\treturn \"ASC\"\n\t\t\t}())\n\t\t}\n\n\t\tmsg = strings.TrimRight(msg, \",\")\n\t\treturn msg\n\t}())\n\n}\n\nfunc InCondition(cond string, values ...string) string {\n\tif cond == \"\" || len(values) == 0 {\n\t\treturn \"TRUE\"\n\t}\n\n\treturn fmt.Sprintf(`%s IN (%s)`, cond, func() string {\n\t\tvar msg string\n\t\tfor _, v := range values {\n\t\t\tmsg += fmt.Sprintf(`\"%s\",`, v)\n\t\t}\n\t\tmsg = strings.TrimRight(msg, \",\")\n\t\treturn msg\n\t}())\n}\n\nfunc NamedInCondition(oper SqlOperator, cols []string, arg interface{}) (string, error) {\n\tquery := JoinNamedColumnsValuesWithOperator(SqlCompareIn, oper, cols...)\n\tquery, args, err := sqlx.Named(query, arg)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tquery, args, err = sqlx.In(query, args...)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn strings_.ReplaceAll(query, \"?\", args, true), nil\n}\n\n// JoinNamedColumnsValues foo=:foo,bar=:bar,  for update set\nfunc JoinNamedColumnsValues(cols ...string) string {\n\treturn strings.Join(namedTableColumnsValues(SqlCompareEqual, cols...), \",\")\n}\n\n// JoinNamedColumnsValuesWithOperator \"foo=:foo AND bar=:bar\" , for where condition\nfunc JoinNamedColumnsValuesWithOperator(cmp SqlCompare, oper SqlOperator, cols ...string) string {\n\tconds := strings.Join(namedTableColumnsValues(cmp, cols...), fmt.Sprintf(\" %s \", oper))\n\tif len(cols) == 0 || conds == \"\" {\n\t\treturn \"TRUE\"\n\t}\n\n\treturn conds\n}\n\n// []string{\"foo=:foo\",  \"bar=:bar\"}\nfunc namedTableColumnsValues(cmp SqlCompare, cols ...string) []string {\n\tvar namedCols []string\n\tfor _, col := range cols {\n\t\tif col != \"\" {\n\t\t\tswitch cmp {\n\t\t\tcase SqlCompareLike:\n\t\t\t\tnamedCols = append(namedCols, fmt.Sprintf(`%[1]s %[2]s concat(\"%%\",:%[1]s,\"%%\")`, col, cmp))\n\t\t\tcase SqlCompareIn:\n\t\t\t\tnamedCols = append(namedCols, fmt.Sprintf(\"%[1]s %[2]s (:%[1]s)\", col, cmp))\n\t\t\tdefault:\n\t\t\t\tnamedCols = append(namedCols, fmt.Sprintf(\"%[1]s %[2]s :%[1]s\", col, cmp))\n\t\t\t}\n\t\t}\n\t}\n\treturn namedCols\n}\n\n/*\nused for batch insert\n(\n :group_id_1,\n :page_id_1,\n :fea_id_1,\n :entity_id_1,\n :feature0_1,\n :feature1_1,\n :extend_info_1\n ),\n(\n :group_id_2,\n :page_id_2,\n :fea_id_2,\n :entity_id_2,\n :feature0_2,\n :feature1_2,\n :extend_info_2\n )\n*/\nfunc JoinNamedColumnsValuesBatch(cols []string, batch int) string {\n\n\tvar batchNamedCols []string\n\tfor i := 0; i < batch; i++ {\n\t\tvar namedCols []string\n\t\tfor _, col := range cols {\n\t\t\tnamedCols = append(namedCols, fmt.Sprintf(\":%s_%d\", col, i))\n\t\t}\n\t\tbatchNamedCols = append(batchNamedCols, fmt.Sprintf(\"(%v)\", strings.Join(namedCols, \",\")))\n\t}\n\n\treturn strings.Join(batchNamedCols, \",\")\n}\n\nfunc BuildNamedInsertSql(table string, cols []string, batch int) string {\n\tif table == \"\" || len(cols) == 0 {\n\t\treturn \"\"\n\t}\n\tsql := fmt.Sprintf(`INSERT INTO %s \n\t\t\t\t(\n\t\t\t\t %s\n\t\t\t\t) \n\t\t\t\tVALUES %s`, table,\n\t\tstrings.Join(cols, \",\"),\n\t\tJoinNamedColumnsValuesBatch(cols, batch))\n\treturn sql\n}\n\n// used for batch insert\nfunc TransferToNamedColumnsValuesBatch(req []map[string]interface{}) map[string]interface{} {\n\n\tvaluesMap := make(map[string]interface{}, 0)\n\tfor i, values := range req {\n\t\tfor k, v := range values {\n\t\t\tvaluesMap[fmt.Sprintf(\"%s_%d\", k, i)] = v\n\t\t}\n\t}\n\n\treturn valuesMap\n}\n\n// req is slice of struct or pointer struct\nfunc BuildNamedColumnsValuesBatch(req interface{}) map[string]interface{} {\n\treturn TransferToNamedColumnsValuesBatch(reflect_.ArrayAllTagsVaules(req, dbTag))\n}\n"
  },
  {
    "path": "pkg/database/mysql/sql_exec.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"fmt\"\n\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"github.com/sirupsen/logrus\"\n\n\t\"github.com/jmoiron/sqlx\"\n)\n\n/*\nfunc ExecContext(\n\tctx context.Context,\n\ttimeout time.Duration,\n\tdb *sqlx.DB,\n\tquery string,\n\th func(ctx context.Context, db *sqlx.DB, query string) error,\n) error {\n\tif h == nil {\n\t\treturn nil\n\t}\n\tctx, cancel := context_.WithTimeout(ctx, timeout)\n\tdefer cancel()\n\n\treturn h(ctx, db, query)\n}\n*/\n\nfunc ExecContext(\n\tctx context.Context,\n\tquery string,\n\targ interface{},\n\ttx *sqlx.Tx,\n\tdb *sqlx.DB,\n) (rows int64, err error) {\n\ttc := time_.New(true)\n\tcaller := runtime_.GetShortCaller()\n\tlogger := logrus.WithField(\"caller\", caller)\n\n\tclean := func() {\n\t\ttc.Tick(caller)\n\t\tlogger.WithField(\"cost\", tc.String()).Infof(\"SQL EXECL\")\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"sql: %s\", query)\n\t\t}\n\t}\n\tdefer clean()\n\n\tresult, err := NamedExecContext(ctx, query, arg, tx, db)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\trows, err = result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tlogger.Infof(\"affected rows: %v\", rows)\n\n\treturn rows, nil\n}\n\n// pointer struct model for dest\nfunc SelectNamedContext(\n\tctx context.Context,\n\tquery string,\n\targ interface{},\n\tdest interface{},\n\tdb *sqlx.DB,\n) (err error) {\n\ttc := time_.New(true)\n\tcaller := runtime_.GetShortCaller()\n\tlogger := logrus.WithField(\"caller\", caller)\n\n\tclean := func() {\n\t\ttc.Tick(caller)\n\t\tlogger.WithField(\"cost\", tc.String()).Infof(\"SQL EXECL\")\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"sql: %s\", query)\n\t\t}\n\t}\n\tdefer clean()\n\n\t// prepare\n\tns, err := db.PrepareNamedContext(ctx, query)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer ns.Close()\n\n\t// query\n\treturn ns.SelectContext(ctx, dest, arg)\n}\n\nfunc GetCountContext(ctx context.Context, query string, arg interface{}, db *sqlx.DB) (count uint32, err error) {\n\ttc := time_.New(true)\n\tcaller := runtime_.GetShortCaller()\n\tlogger := logrus.WithField(\"caller\", caller)\n\n\tclean := func() {\n\t\ttc.Tick(caller)\n\t\tlogger.WithField(\"cost\", tc.String()).Infof(\"SQL EXECL\")\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"sql: %s\", query)\n\t\t}\n\t}\n\tdefer clean()\n\n\tns, err := db.PrepareNamedContext(ctx, query)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer ns.Close()\n\n\terr = ns.QueryRowContext(ctx, arg).Scan(&count)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn count, nil\n\n}\n\nfunc NamedExecContext(\n\tctx context.Context,\n\tquery string,\n\targ interface{},\n\ttx *sqlx.Tx,\n\tdb *sqlx.DB,\n) (sql.Result, error) {\n\n\tif tx != nil {\n\t\treturn tx.NamedExecContext(ctx, query, arg)\n\t}\n\n\tif db != nil {\n\t\treturn db.NamedExecContext(ctx, query, arg)\n\t}\n\n\treturn nil, fmt.Errorf(\"db is nil\")\n}\n\nfunc PrepareNamedContext(ctx context.Context,\n\tquery string,\n\ttx *sqlx.Tx,\n\tdb *sqlx.DB,\n) (*sqlx.NamedStmt, error) {\n\n\tif tx != nil {\n\t\treturn tx.PrepareNamedContext(ctx, query)\n\t}\n\n\tif db != nil {\n\t\treturn db.PrepareNamedContext(ctx, query)\n\t}\n\n\treturn nil, fmt.Errorf(\"db is nil\")\n}\n"
  },
  {
    "path": "pkg/database/mysql/sql_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tmysql_ \"github.com/kaydxh/golang/pkg/database/mysql\"\n)\n\nfunc TestJoinNamedColumnsValuesWithOperator(t *testing.T) {\n\ttestCases := []struct {\n\t\tcmp  mysql_.SqlCompare\n\t\toper mysql_.SqlOperator\n\t\tcols []string\n\t}{\n\t\t{\n\t\t\tcmp:  mysql_.SqlCompareLike,\n\t\t\toper: mysql_.SqlOperatorAnd,\n\t\t\tcols: []string{\"task_name\"},\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(string(testCase.cmp), func(t *testing.T) {\n\t\t\tquery := mysql_.JoinNamedColumnsValuesWithOperator(testCase.cmp, testCase.oper, testCase.cols...)\n\t\t\tt.Logf(\"sql: %v\", query)\n\t\t})\n\t}\n}\n\nfunc TestInCondition(t *testing.T) {\n\ttestCases := []struct {\n\t\tcond   string\n\t\tvalues []string\n\t}{\n\t\t{\n\t\t\tcond:   \"task_id\",\n\t\t\tvalues: []string{\"task_id_1\", \"task_id_2\"},\n\t\t},\n\t\t{\n\t\t\tcond:   \"task_id\",\n\t\t\tvalues: []string{\"\", \"\"},\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(string(testCase.cond), func(t *testing.T) {\n\t\t\tquery := mysql_.InCondition(testCase.cond, testCase.values...)\n\t\t\tt.Logf(\"sql: %v\", query)\n\t\t})\n\t}\n}\n\nfunc TestNamedInCondition(t *testing.T) {\n\n\ttestCases := []struct {\n\t\tcols []string\n\t\targ  interface{}\n\t}{\n\t\t{\n\t\t\tcols: []string{\"task_id\"},\n\t\t\targ: struct {\n\t\t\t\tTaskId []string `db:\"task_id\"`\n\t\t\t}{\n\t\t\t\tTaskId: []string{\"task_id_1\", \"task_id_2\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tcols: []string{\"task_id\"},\n\t\t\targ: struct {\n\t\t\t\tTaskId []int `db:\"task_id\"`\n\t\t\t}{\n\t\t\t\tTaskId: []int{0, 1},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%v\", i), func(t *testing.T) {\n\t\t\tquery, err := mysql_.NamedInCondition(mysql_.SqlOperatorAnd, testCase.cols, testCase.arg)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"err: %v\", err)\n\t\t\t}\n\t\t\tt.Logf(\"sql: %v\", query)\n\t\t})\n\t}\n}\n\nfunc TestOrderCondition(t *testing.T) {\n\n\ttestCases := []struct {\n\t\torders map[string]bool\n\t}{\n\n\t\t{\n\t\t\torders: map[string]bool{\n\t\t\t\t\"task_id\": true,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\torders: map[string]bool{\n\t\t\t\t\"task_id\": false,\n\t\t\t\t\"score\":   false,\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%v\", i), func(t *testing.T) {\n\t\t\tquery := mysql_.OrderCondition(testCase.orders)\n\t\t\tt.Logf(\"sql: %v\", query)\n\t\t})\n\t}\n}\n\nfunc TestJoinNamedColumnsValuesBatch(t *testing.T) {\n\ttestCases := []struct {\n\t\tcols  []string\n\t\tbatch int\n\t}{\n\t\t{\n\t\t\tcols:  []string{\"task_name\", \"task_id\", \"task_arg\"},\n\t\t\tbatch: 4,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%v\", i), func(t *testing.T) {\n\t\t\tquery := mysql_.JoinNamedColumnsValuesBatch(testCase.cols, testCase.batch)\n\t\t\tt.Logf(\"sql: %v\", query)\n\t\t})\n\t}\n}\n\n/*\nfunc TestGenerateSQL(t *testing.T) {\n\targ := struct {\n\t\tTaskId string   `db:\"task_id\"`\n\t\tName   []string `db:\"name\"`\n\t}{\n\t\tTaskId: \"task-id\",\n\t\tName:   []string{\"name1\", \"name2\"},\n\t}\n\t//sql := \"SELECT *FROM t_task where task_id=:task_id and name In(:name)\"\n\tsql := \"SELECT *FROM t_task where task_id=:task_id\"\n\tquery, args, err := sqlx.Named(sql, arg)\n\tif err != nil {\n\t\tt.Fatalf(\"falied to named, err: %v\", err)\n\t}\n\tquery, args, err = sqlx.In(query, args...)\n\tif err != nil {\n\t\tt.Fatalf(\"falied to In, err: %v\", err)\n\t}\n\n\t// ns, err := d.db.PrepareNamedContext(ctx, query)\n\tt.Logf(\"query: %v, args: %v\", query, args)\n}\n*/\n"
  },
  {
    "path": "pkg/database/mysql/sql_type.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mysql\n\nimport (\n\t\"sync/atomic\"\n\n\t\"github.com/jmoiron/sqlx\"\n)\n\ntype SQLDB atomic.Value\n\n//check type SQLDB* whether to implement interface of atomic.Value\n//var _ atomic.Value = (*SQLDB)(nil)\n\n//check type SQLDB whether to implement interface of atomic.Value\n//var _ atomic.Value = SQLDB{}\n\nfunc (m *SQLDB) Store(value *sqlx.DB) {\n\t(*atomic.Value)(m).Store(value)\n}\n\nfunc (m *SQLDB) Load() *sqlx.DB {\n\tvalue := (*atomic.Value)(m).Load()\n\tif value == nil {\n\t\treturn nil\n\t}\n\treturn value.(*sqlx.DB)\n}\n"
  },
  {
    "path": "pkg/database/redis/command.get.values.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/go-redis/redis/v8\"\n)\n\nfunc GetValue(ctx context.Context, db *redis.Client, key string) ([]string, error) {\n\n\tif db == nil {\n\t\treturn nil, fmt.Errorf(\"found unexpected nil redis client\")\n\t}\n\n\tvar values []string\n\n\ttyp, err := db.Type(ctx, key).Result()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get type of key: %v, err: %v\", key, err)\n\t}\n\n\tswitch typ {\n\tcase \"string\":\n\t\tdata, err := db.Get(ctx, key).Result()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get value of key: %v, err: %v\", key, err)\n\t\t}\n\t\tvalues = append(values, data)\n\tcase \"list\":\n\t\tllen, err := db.LLen(ctx, key).Result()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get len of key: %v, err: %v\", key, err)\n\t\t}\n\n\t\tvar i int64\n\t\tfor i = 0; i < llen; i++ {\n\t\t\tdata, err := db.LIndex(ctx, key, i).Result()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to get list data of key: %v, err: %v\", key, err)\n\t\t\t}\n\t\t\tvalues = append(values, data)\n\t\t}\n\n\tcase \"set\":\n\t\tmembers, err := db.SMembers(ctx, key).Result()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get members of key: %v, err: %v\", key, err)\n\t\t}\n\t\tvalues = append(values, members...)\n\n\tdefault:\n\n\t}\n\n\treturn values, nil\n\n}\n\nfunc GetValues(ctx context.Context, db *redis.Client, keys ...string) ([][]string, error) {\n\tif db == nil {\n\t\treturn nil, fmt.Errorf(\"found unexpected nil redis client\")\n\t}\n\n\tvar values [][]string\n\n\tfor _, key := range keys {\n\n\t\tvalue, err := GetValue(ctx, db, key)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvalues = append(values, value)\n\t}\n\n\treturn values, nil\n\n}\n"
  },
  {
    "path": "pkg/database/redis/command.hset.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/go-redis/redis/v8\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n)\n\n// only get export Fields from arg\n// set tag-values for field-value to hash\nfunc HSetStruct(ctx context.Context, db *redis.Client, key string, arg interface{}) error {\n\n\tif db == nil {\n\t\treturn fmt.Errorf(\"found unexpected nil redis client\")\n\t}\n\n\ttagsValues := reflect_.AllTagsValues(arg, \"redis\")\n\t_, err := db.HSet(ctx, key, tagsValues).Result()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to HSet key: %v, err: %v\", key, err)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/database/redis/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis\n\nimport (\n\t\"context\"\n\n\t\"github.com/go-redis/redis/v8\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto Redis\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context) (*redis.Client, error) {\n\n\tlogrus.Infof(\"Installing Redis\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\tlogrus.Warnf(\"Redis disenabled\")\n\t\treturn nil, nil\n\t}\n\n\tredisDB, err := c.install(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed Redis\")\n\n\treturn redisDB, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context) (*redis.Client, error) {\n\tdb := NewRedisClient(\n\n\t\tDBConfig{\n\t\t\tAddresses: c.Proto.GetAddresses(),\n\t\t\tUserName:  c.Proto.GetUsername(),\n\t\t\tPassword:  c.Proto.GetPassword(),\n\t\t\tDB:        int(c.Proto.GetDb()),\n\t\t},\n\t\tWithPoolSize(int(c.Proto.GetPoolSize())),\n\t\tWithMinIdleConnections(int(c.Proto.GetMinIdleConns())),\n\t\tWithDialTimeout(c.Proto.GetDialTimeout().AsDuration()),\n\t\tWithReadTimeout(c.Proto.GetReadTimeout().AsDuration()),\n\t\tWithWriteTimeout(c.Proto.GetWriteTimeout().AsDuration()),\n\t)\n\n\treturn db.GetDatabaseUntil(\n\t\tctx,\n\t\tc.Proto.GetMaxWaitDuration().AsDuration(),\n\t\tc.Proto.GetFailAfterDuration().AsDuration(),\n\t)\n\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/database/redis/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/database/redis/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/database/redis/redis.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/go-redis/redis/v8\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n)\n\nvar redisDB RedisDB\n\n// Default values for Redis.\nconst (\n\tDefaultMinIdleConns = 10\n\tDefaultPoolSize     = 10\n\tDefaultDialTimeout  = 5 * time.Second\n\tDefaultReadTimeout  = 5 * time.Second\n\tDefaultWriteTimeout = 5 * time.Second\n\tDefaultMasterName   = \"mymaster\"\n)\n\ntype DBConfig struct {\n\tAddresses []string\n\tUserName  string\n\tPassword  string\n\tDB        int\n}\n\ntype RedisClient struct {\n\tConf DBConfig\n\tdb   *redis.Client\n\n\topts struct {\n\t\tpoolSize     int\n\t\tminIdleConns int\n\t\tdialTimeout  time.Duration\n\t\treadTimeout  time.Duration\n\t\twriteTimeout time.Duration\n\t\tmasterName   string\n\t}\n}\n\nfunc NewRedisClient(conf DBConfig, opts ...RedisOption) *RedisClient {\n\tc := &RedisClient{\n\t\tConf: conf,\n\t}\n\tc.opts.poolSize = DefaultPoolSize\n\tc.opts.minIdleConns = DefaultMinIdleConns\n\tc.opts.dialTimeout = DefaultDialTimeout\n\tc.opts.readTimeout = DefaultReadTimeout\n\tc.opts.writeTimeout = DefaultWriteTimeout\n\tc.opts.masterName = DefaultMasterName\n\n\tc.ApplyOptions(opts...)\n\n\treturn c\n}\n\nfunc GetDB() *redis.Client {\n\treturn redisDB.Load()\n}\n\nfunc (r *RedisClient) GetRedis(ctx context.Context) (*redis.Client, error) {\n\tif r.db != nil {\n\t\treturn r.db, nil\n\t}\n\n\tif len(r.Conf.Addresses) == 0 {\n\t\treturn nil, fmt.Errorf(\"invalid redis address\")\n\t}\n\n\tvar db *redis.Client\n\tif len(r.Conf.Addresses) == 1 {\n\t\tdb = redis.NewClient(&redis.Options{\n\t\t\tAddr:         r.Conf.Addresses[0],\n\t\t\tPassword:     r.Conf.Password,\n\t\t\tDB:           r.Conf.DB,\n\t\t\tPoolSize:     r.opts.poolSize,\n\t\t\tMinIdleConns: r.opts.minIdleConns,\n\t\t\tDialTimeout:  r.opts.dialTimeout,\n\t\t\tReadTimeout:  r.opts.readTimeout,\n\t\t\tWriteTimeout: r.opts.writeTimeout,\n\t\t})\n\t}\n\n\tif len(r.Conf.Addresses) > 1 {\n\t\tdb = redis.NewFailoverClient(&redis.FailoverOptions{\n\t\t\tMasterName:    r.opts.masterName,\n\t\t\tSentinelAddrs: r.Conf.Addresses,\n\t\t\tPassword:      r.Conf.Password,\n\t\t\tDB:            r.Conf.DB,\n\t\t\tPoolSize:      r.opts.poolSize,\n\t\t\tMinIdleConns:  r.opts.minIdleConns,\n\t\t\tDialTimeout:   r.opts.dialTimeout,\n\t\t\tReadTimeout:   r.opts.readTimeout,\n\t\t\tWriteTimeout:  r.opts.writeTimeout,\n\t\t})\n\t}\n\t_, err := db.Ping(ctx).Result()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tr.db = db\n\tredisDB.Store(db)\n\n\treturn r.db, nil\n}\n\nfunc (r *RedisClient) GetDatabaseUntil(\n\tctx context.Context,\n\tmaxWaitInterval time.Duration, failAfter time.Duration) (*redis.Client, error) {\n\n\tvar db *redis.Client\n\texp := time_.NewExponentialBackOff(\n\t\ttime_.WithExponentialBackOffOptionMaxInterval(maxWaitInterval),\n\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(failAfter),\n\t)\n\terr := time_.BackOffUntilWithContext(ctx, func(ctx context.Context) (err_ error) {\n\t\tdb, err_ = r.GetRedis(ctx)\n\t\tif err_ != nil {\n\t\t\treturn err_\n\t\t}\n\t\treturn nil\n\t}, exp, true, false)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get database fail after: %v\", failAfter)\n\t}\n\n\treturn db, nil\n\n}\n\nfunc (r *RedisClient) Close() error {\n\tif r.db == nil {\n\t\treturn fmt.Errorf(\"no redis client\")\n\t}\n\treturn r.db.Close()\n}\n"
  },
  {
    "path": "pkg/database/redis/redis.options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis\n\nimport \"time\"\n\nfunc WithPoolSize(poolSize int) RedisOption {\n\treturn RedisOptionFunc(func(c *RedisClient) {\n\t\tc.opts.poolSize = poolSize\n\t})\n}\n\nfunc WithMinIdleConnections(minIdleConns int) RedisOption {\n\treturn RedisOptionFunc(func(c *RedisClient) {\n\t\tc.opts.minIdleConns = minIdleConns\n\t})\n}\n\nfunc WithDialTimeout(dialTimeout time.Duration) RedisOption {\n\treturn RedisOptionFunc(func(c *RedisClient) {\n\t\tc.opts.dialTimeout = dialTimeout\n\t})\n}\n\nfunc WithReadTimeout(readTimeout time.Duration) RedisOption {\n\treturn RedisOptionFunc(func(c *RedisClient) {\n\t\tc.opts.readTimeout = readTimeout\n\t})\n}\n\nfunc WithWriteTimeout(writeTimeout time.Duration) RedisOption {\n\treturn RedisOptionFunc(func(c *RedisClient) {\n\t\tc.opts.writeTimeout = writeTimeout\n\t})\n}\n\nfunc WithMasterName(masterName string) RedisOption {\n\treturn RedisOptionFunc(func(c *RedisClient) {\n\t\tc.opts.masterName = masterName\n\t})\n}\n"
  },
  {
    "path": "pkg/database/redis/redis.pb.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.27.0\n// \tprotoc        v3.13.0\n// source: pkg/database/redis/redis.proto\n\npackage redis\n\nimport (\n\tduration \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\n// https://github.com/go-redis/redis/blob/ce40cd942a72c4a93f9025047e6fd3f510700ab3/options.go\ntype Redis struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled bool `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\t// Either a single address or a seed list of host:port addresses\n\t// of cluster/sentinel nodes.\n\tAddresses []string `protobuf:\"bytes,2,rep,name=addresses,proto3\" json:\"addresses,omitempty\"`\n\t// Database to be selected after connecting to the server.\n\t// Only single-node and failover clients.\n\tDb int64 `protobuf:\"varint,3,opt,name=db,proto3\" json:\"db,omitempty\"`\n\t// Use the specified Username to authenticate the current connection\n\t// with one of the connections defined in the ACL list when connecting\n\t// to a Redis 6.0 instance, or greater, that is using the Redis ACL system.\n\tUsername string `protobuf:\"bytes,4,opt,name=username,proto3\" json:\"username,omitempty\"`\n\t// Optional password. Must match the password specified in the\n\t// requirepass server configuration option (if connecting to a Redis 5.0\n\t// instance, or lower), or the User Password when connecting to a Redis 6.0\n\t// instance, or greater, that is using the Redis ACL system.\n\tPassword string `protobuf:\"bytes,5,opt,name=password,proto3\" json:\"password,omitempty\"`\n\t// Maximumumber of retries before giving up.\n\t// Default is 3 retries.\n\tMaxRetries int64 `protobuf:\"varint,7,opt,name=max_retries,json=maxRetries,proto3\" json:\"max_retries,omitempty\"`\n\t// Minimum backoff between each retry.\n\t// Default is 8 milliseconds; -1 disables backoff.\n\tMinRetryBackoff *duration.Duration `protobuf:\"bytes,8,opt,name=min_retry_backoff,json=minRetryBackoff,proto3\" json:\"min_retry_backoff,omitempty\"`\n\t// Maximum backoff between each retry.\n\t// Default is 512 milliseconds; -1 disables backoff.\n\tMaxRetryBackoff *duration.Duration `protobuf:\"bytes,9,opt,name=max_retry_backoff,json=maxRetryBackoff,proto3\" json:\"max_retry_backoff,omitempty\"`\n\t// Dial timeout for establishing new connections.\n\t// Default is 5 seconds.\n\tDialTimeout *duration.Duration `protobuf:\"bytes,10,opt,name=dial_timeout,json=dialTimeout,proto3\" json:\"dial_timeout,omitempty\"`\n\t// Timeout for socket reads. If reached, commands will fail\n\t// with a timeout instead of blocking. Use value -1 for no timeout and 0 for\n\t// default. Default is 3 seconds.\n\tReadTimeout *duration.Duration `protobuf:\"bytes,11,opt,name=read_timeout,json=readTimeout,proto3\" json:\"read_timeout,omitempty\"`\n\t// Timeout for socket writes. If reached, commands will fail\n\t// with a timeout instead of blocking.\n\t// Default is ReadTimeout.\n\tWriteTimeout *duration.Duration `protobuf:\"bytes,12,opt,name=write_timeout,json=writeTimeout,proto3\" json:\"write_timeout,omitempty\"`\n\t// Maximum number of socket connections.\n\t// Default is 10 connections per every available CPU as reported by\n\t// runtime.GOMAXPROCS.\n\tPoolSize int64 `protobuf:\"varint,13,opt,name=pool_size,json=poolSize,proto3\" json:\"pool_size,omitempty\"`\n\t// Minimum number of idle connections which is useful when establishing\n\t// new connection is slow.\n\tMinIdleConns int64 `protobuf:\"varint,14,opt,name=min_idle_conns,json=minIdleConns,proto3\" json:\"min_idle_conns,omitempty\"`\n\t// Connection age at which client retires (closes) the connection.\n\t// Default is to not close aged connections.\n\tMaxConnAge *duration.Duration `protobuf:\"bytes,15,opt,name=max_conn_age,json=maxConnAge,proto3\" json:\"max_conn_age,omitempty\"`\n\t// Amount of time client waits for connection if all connections\n\t// are busy before returning an error.\n\t// Default is ReadTimeout + 1 second.\n\tPoolTimeout *duration.Duration `protobuf:\"bytes,16,opt,name=pool_timeout,json=poolTimeout,proto3\" json:\"pool_timeout,omitempty\"`\n\t// Amount of time after which client closes idle connections.\n\t// Should be less than server's timeout.\n\t// Default is 5 minutes. -1 disables idle timeout check.\n\tIdleTimeout *duration.Duration `protobuf:\"bytes,17,opt,name=idle_timeout,json=idleTimeout,proto3\" json:\"idle_timeout,omitempty\"`\n\t// Frequency of idle checks made by idle connections reaper.\n\t// Default is 1 minute. -1 disables idle connections reaper,\n\t// but idle connections are still discarded by the client\n\t// if IdleTimeout is set.\n\tIdleCheckFrequency *duration.Duration `protobuf:\"bytes,18,opt,name=idle_check_frequency,json=idleCheckFrequency,proto3\" json:\"idle_check_frequency,omitempty\"`\n\t// Only cluster clients.\n\tMaxRedirects int64 `protobuf:\"varint,19,opt,name=max_redirects,json=maxRedirects,proto3\" json:\"max_redirects,omitempty\"`\n\tReadOnly     bool  `protobuf:\"varint,20,opt,name=read_only,json=readOnly,proto3\" json:\"read_only,omitempty\"`\n\t// Allows routing read-only commands to the closest master or slave node.\n\t// This option only works with NewFailoverClusterClient.\n\tRouteByLatency bool `protobuf:\"varint,21,opt,name=route_by_latency,json=routeByLatency,proto3\" json:\"route_by_latency,omitempty\"`\n\t// Allows routing read-only commands to the random master or slave node.\n\t// This option only works with NewFailoverClusterClient.\n\tRouteRandomly bool `protobuf:\"varint,22,opt,name=route_randomly,json=routeRandomly,proto3\" json:\"route_randomly,omitempty\"` // Route all commands to slave read-only nodes.\n\t// The sentinel master name.\n\t// Only failover clients.\n\t// The master name.\n\tMasterName        string             `protobuf:\"bytes,23,opt,name=master_name,json=masterName,proto3\" json:\"master_name,omitempty\"`\n\tMaxWaitDuration   *duration.Duration `protobuf:\"bytes,24,opt,name=max_wait_duration,json=maxWaitDuration,proto3\" json:\"max_wait_duration,omitempty\"`\n\tFailAfterDuration *duration.Duration `protobuf:\"bytes,25,opt,name=fail_after_duration,json=failAfterDuration,proto3\" json:\"fail_after_duration,omitempty\"`\n}\n\nfunc (x *Redis) Reset() {\n\t*x = Redis{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_database_redis_redis_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Redis) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Redis) ProtoMessage() {}\n\nfunc (x *Redis) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_database_redis_redis_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Redis.ProtoReflect.Descriptor instead.\nfunc (*Redis) Descriptor() ([]byte, []int) {\n\treturn file_pkg_database_redis_redis_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Redis) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Redis) GetAddresses() []string {\n\tif x != nil {\n\t\treturn x.Addresses\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetDb() int64 {\n\tif x != nil {\n\t\treturn x.Db\n\t}\n\treturn 0\n}\n\nfunc (x *Redis) GetUsername() string {\n\tif x != nil {\n\t\treturn x.Username\n\t}\n\treturn \"\"\n}\n\nfunc (x *Redis) GetPassword() string {\n\tif x != nil {\n\t\treturn x.Password\n\t}\n\treturn \"\"\n}\n\nfunc (x *Redis) GetMaxRetries() int64 {\n\tif x != nil {\n\t\treturn x.MaxRetries\n\t}\n\treturn 0\n}\n\nfunc (x *Redis) GetMinRetryBackoff() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MinRetryBackoff\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetMaxRetryBackoff() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MaxRetryBackoff\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetDialTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.DialTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetReadTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.ReadTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetWriteTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.WriteTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetPoolSize() int64 {\n\tif x != nil {\n\t\treturn x.PoolSize\n\t}\n\treturn 0\n}\n\nfunc (x *Redis) GetMinIdleConns() int64 {\n\tif x != nil {\n\t\treturn x.MinIdleConns\n\t}\n\treturn 0\n}\n\nfunc (x *Redis) GetMaxConnAge() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MaxConnAge\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetPoolTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.PoolTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetIdleTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.IdleTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetIdleCheckFrequency() *duration.Duration {\n\tif x != nil {\n\t\treturn x.IdleCheckFrequency\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetMaxRedirects() int64 {\n\tif x != nil {\n\t\treturn x.MaxRedirects\n\t}\n\treturn 0\n}\n\nfunc (x *Redis) GetReadOnly() bool {\n\tif x != nil {\n\t\treturn x.ReadOnly\n\t}\n\treturn false\n}\n\nfunc (x *Redis) GetRouteByLatency() bool {\n\tif x != nil {\n\t\treturn x.RouteByLatency\n\t}\n\treturn false\n}\n\nfunc (x *Redis) GetRouteRandomly() bool {\n\tif x != nil {\n\t\treturn x.RouteRandomly\n\t}\n\treturn false\n}\n\nfunc (x *Redis) GetMasterName() string {\n\tif x != nil {\n\t\treturn x.MasterName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Redis) GetMaxWaitDuration() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MaxWaitDuration\n\t}\n\treturn nil\n}\n\nfunc (x *Redis) GetFailAfterDuration() *duration.Duration {\n\tif x != nil {\n\t\treturn x.FailAfterDuration\n\t}\n\treturn nil\n}\n\nvar File_pkg_database_redis_redis_proto protoreflect.FileDescriptor\n\nvar file_pkg_database_redis_redis_proto_rawDesc = []byte{\n\t0x0a, 0x1e, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x72,\n\t0x65, 0x64, 0x69, 0x73, 0x2f, 0x72, 0x65, 0x64, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x12, 0x15, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,\n\t0x65, 0x2e, 0x72, 0x65, 0x64, 0x69, 0x73, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69,\n\t0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01,\n\t0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61,\n\t0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09,\n\t0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18,\n\t0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x64, 0x62, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65,\n\t0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65,\n\t0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,\n\t0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,\n\t0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73,\n\t0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x74, 0x72, 0x69,\n\t0x65, 0x73, 0x12, 0x45, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f,\n\t0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e,\n\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,\n\t0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x74,\n\t0x72, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x12, 0x45, 0x0a, 0x11, 0x6d, 0x61, 0x78,\n\t0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x09,\n\t0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,\n\t0x0f, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x74, 0x72, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66,\n\t0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,\n\t0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c,\n\t0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0b,\n\t0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,\n\t0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d,\n\t0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0c, 0x20,\n\t0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,\n\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c,\n\t0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1b, 0x0a, 0x09,\n\t0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52,\n\t0x08, 0x70, 0x6f, 0x6f, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x69, 0x6e,\n\t0x5f, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28,\n\t0x03, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x12,\n\t0x3b, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x5f, 0x61, 0x67, 0x65, 0x18,\n\t0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,\n\t0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t0x52, 0x0a, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x6e, 0x41, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x0c,\n\t0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x10, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x70,\n\t0x6f, 0x6f, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x69, 0x64,\n\t0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b,\n\t0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x69, 0x64, 0x6c,\n\t0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x4b, 0x0a, 0x14, 0x69, 0x64, 0x6c, 0x65,\n\t0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79,\n\t0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t0x6e, 0x52, 0x12, 0x69, 0x64, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x46, 0x72, 0x65, 0x71,\n\t0x75, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x64,\n\t0x69, 0x72, 0x65, 0x63, 0x74, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x61,\n\t0x78, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65,\n\t0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72,\n\t0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x72, 0x6f, 0x75, 0x74, 0x65,\n\t0x5f, 0x62, 0x79, 0x5f, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x15, 0x20, 0x01, 0x28,\n\t0x08, 0x52, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x42, 0x79, 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63,\n\t0x79, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x6f,\n\t0x6d, 0x6c, 0x79, 0x18, 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x65,\n\t0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x6c, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x73, 0x74,\n\t0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d,\n\t0x61, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x11, 0x6d, 0x61, 0x78,\n\t0x5f, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x18,\n\t0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,\n\t0x0f, 0x6d, 0x61, 0x78, 0x57, 0x61, 0x69, 0x74, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t0x12, 0x49, 0x0a, 0x13, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x5f, 0x64,\n\t0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e,\n\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,\n\t0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x66, 0x61, 0x69, 0x6c, 0x41, 0x66,\n\t0x74, 0x65, 0x72, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x33, 0x5a, 0x31, 0x67,\n\t0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68,\n\t0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x61, 0x74, 0x61,\n\t0x62, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x64, 0x69, 0x73, 0x3b, 0x72, 0x65, 0x64, 0x69, 0x73,\n\t0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_database_redis_redis_proto_rawDescOnce sync.Once\n\tfile_pkg_database_redis_redis_proto_rawDescData = file_pkg_database_redis_redis_proto_rawDesc\n)\n\nfunc file_pkg_database_redis_redis_proto_rawDescGZIP() []byte {\n\tfile_pkg_database_redis_redis_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_database_redis_redis_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_database_redis_redis_proto_rawDescData)\n\t})\n\treturn file_pkg_database_redis_redis_proto_rawDescData\n}\n\nvar file_pkg_database_redis_redis_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_pkg_database_redis_redis_proto_goTypes = []interface{}{\n\t(*Redis)(nil),             // 0: go.pkg.database.redis.Redis\n\t(*duration.Duration)(nil), // 1: google.protobuf.Duration\n}\nvar file_pkg_database_redis_redis_proto_depIdxs = []int32{\n\t1,  // 0: go.pkg.database.redis.Redis.min_retry_backoff:type_name -> google.protobuf.Duration\n\t1,  // 1: go.pkg.database.redis.Redis.max_retry_backoff:type_name -> google.protobuf.Duration\n\t1,  // 2: go.pkg.database.redis.Redis.dial_timeout:type_name -> google.protobuf.Duration\n\t1,  // 3: go.pkg.database.redis.Redis.read_timeout:type_name -> google.protobuf.Duration\n\t1,  // 4: go.pkg.database.redis.Redis.write_timeout:type_name -> google.protobuf.Duration\n\t1,  // 5: go.pkg.database.redis.Redis.max_conn_age:type_name -> google.protobuf.Duration\n\t1,  // 6: go.pkg.database.redis.Redis.pool_timeout:type_name -> google.protobuf.Duration\n\t1,  // 7: go.pkg.database.redis.Redis.idle_timeout:type_name -> google.protobuf.Duration\n\t1,  // 8: go.pkg.database.redis.Redis.idle_check_frequency:type_name -> google.protobuf.Duration\n\t1,  // 9: go.pkg.database.redis.Redis.max_wait_duration:type_name -> google.protobuf.Duration\n\t1,  // 10: go.pkg.database.redis.Redis.fail_after_duration:type_name -> google.protobuf.Duration\n\t11, // [11:11] is the sub-list for method output_type\n\t11, // [11:11] is the sub-list for method input_type\n\t11, // [11:11] is the sub-list for extension type_name\n\t11, // [11:11] is the sub-list for extension extendee\n\t0,  // [0:11] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_database_redis_redis_proto_init() }\nfunc file_pkg_database_redis_redis_proto_init() {\n\tif File_pkg_database_redis_redis_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_database_redis_redis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Redis); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_database_redis_redis_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_database_redis_redis_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_database_redis_redis_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_database_redis_redis_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_database_redis_redis_proto = out.File\n\tfile_pkg_database_redis_redis_proto_rawDesc = nil\n\tfile_pkg_database_redis_redis_proto_goTypes = nil\n\tfile_pkg_database_redis_redis_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/database/redis/redis.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.database.redis;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/golang/pkg/database/redis;redis\";\n\n// https://github.com/go-redis/redis/blob/ce40cd942a72c4a93f9025047e6fd3f510700ab3/options.go\nmessage Redis {\n  bool enabled = 1;\n  // Either a single address or a seed list of host:port addresses\n  // of cluster/sentinel nodes.\n  repeated string addresses = 2;\n\n  // Database to be selected after connecting to the server.\n  // Only single-node and failover clients.\n  int64 db = 3;\n\n  // Use the specified Username to authenticate the current connection\n  // with one of the connections defined in the ACL list when connecting\n  // to a Redis 6.0 instance, or greater, that is using the Redis ACL system.\n  string username = 4;\n\n  // Optional password. Must match the password specified in the\n  // requirepass server configuration option (if connecting to a Redis 5.0\n  // instance, or lower), or the User Password when connecting to a Redis 6.0\n  // instance, or greater, that is using the Redis ACL system.\n  string password = 5;\n\n  // Maximumumber of retries before giving up.\n  // Default is 3 retries.\n  int64 max_retries = 7;\n\n  // Minimum backoff between each retry.\n  // Default is 8 milliseconds; -1 disables backoff.\n  google.protobuf.Duration min_retry_backoff = 8;\n  // Maximum backoff between each retry.\n  // Default is 512 milliseconds; -1 disables backoff.\n  google.protobuf.Duration max_retry_backoff = 9;\n  // Dial timeout for establishing new connections.\n  // Default is 5 seconds.\n  google.protobuf.Duration dial_timeout = 10;\n  // Timeout for socket reads. If reached, commands will fail\n  // with a timeout instead of blocking. Use value -1 for no timeout and 0 for\n  // default. Default is 3 seconds.\n  google.protobuf.Duration read_timeout = 11;\n  // Timeout for socket writes. If reached, commands will fail\n  // with a timeout instead of blocking.\n  // Default is ReadTimeout.\n  google.protobuf.Duration write_timeout = 12;\n\n  // Maximum number of socket connections.\n  // Default is 10 connections per every available CPU as reported by\n  // runtime.GOMAXPROCS.\n  int64 pool_size = 13;\n  // Minimum number of idle connections which is useful when establishing\n  // new connection is slow.\n  int64 min_idle_conns = 14;\n  // Connection age at which client retires (closes) the connection.\n  // Default is to not close aged connections.\n  google.protobuf.Duration max_conn_age = 15;\n  // Amount of time client waits for connection if all connections\n  // are busy before returning an error.\n  // Default is ReadTimeout + 1 second.\n  google.protobuf.Duration pool_timeout = 16;\n  // Amount of time after which client closes idle connections.\n  // Should be less than server's timeout.\n  // Default is 5 minutes. -1 disables idle timeout check.\n  google.protobuf.Duration idle_timeout = 17;\n  // Frequency of idle checks made by idle connections reaper.\n  // Default is 1 minute. -1 disables idle connections reaper,\n  // but idle connections are still discarded by the client\n  // if IdleTimeout is set.\n  google.protobuf.Duration idle_check_frequency = 18;\n\n  // Only cluster clients.\n  int64 max_redirects = 19;\n  bool read_only = 20;\n  // Allows routing read-only commands to the closest master or slave node.\n  // This option only works with NewFailoverClusterClient.\n  bool route_by_latency = 21;\n  // Allows routing read-only commands to the random master or slave node.\n  // This option only works with NewFailoverClusterClient.\n  bool route_randomly = 22;\n  // Route all commands to slave read-only nodes.\n\n  // The sentinel master name.\n  // Only failover clients.\n  // The master name.\n  string master_name = 23;\n\n  google.protobuf.Duration max_wait_duration = 24;\n  google.protobuf.Duration fail_after_duration = 25;\n}\n"
  },
  {
    "path": "pkg/database/redis/redis.yaml",
    "content": "database:\n  redis:\n    enabled: true\n    addresses: \n      - \"localhost:6379\"\n    password: \"123456\"\n    db: 0 \n    max_connections: 100\n    max_idle_connections: 10\n    dial_timeout: 5s\n    max_wait_duration: 20s\n    fail_after_duration: 60s\n"
  },
  {
    "path": "pkg/database/redis/redis_benchmark_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\n// -count the benchmark times, -benchtime the test execute times(用例执行次数) or execute time(用例执行时间)\n// -v detail log info , -benchmem summary of memory\n//go test -bench=\"Set\" -benchtime=5s -count=3 .\n//go test -bench=\"Set\" -benchtime=50x -count=3 .\nfunc BenchmarkSet(t *testing.B) {\n\tdb := GetDBOrDie()\n\t//\tdefer db.Close()\n\n\tkeyPrefix := \"test\"\n\n\tfor n := 0; n < t.N; n++ {\n\t\tfmt.Println(\"n: \", n)\n\n\t\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\t\tdefer cancel()\n\n\t\tkey := fmt.Sprintf(\"%s-%d\", keyPrefix, n)\n\t\tresult, err := db.Set(ctx, key, key, 0).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to set string, err: %v\", err)\n\t\t}\n\n\t\tt.Logf(\"result of %v: %v\", key, result)\n\t}\n}\n\n//go test -v -run=redis_benchmark_test.go -test.bench=\"ParallelSet\" -benchtime=5s -count=3 .\n//go test -v -run=redis_benchmark_test.go -test.bench=\"ParallelSet\" -benchtime=5s -count=3 .\nfunc BenchmarkParallelSet(t *testing.B) {\n\tdb := GetDBOrDie()\n\t//\tdefer db.Close()\n\n\tkeyPrefix := \"test\"\n\n\tt.RunParallel(func(pb *testing.PB) {\n\t\tfor pb.Next() {\n\t\t\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\t\t\tdefer cancel()\n\n\t\t\tkey := fmt.Sprintf(\"%s-%s\", keyPrefix, uuid.New().String())\n\n\t\t\tresult, err := db.Set(ctx, key, key, 0).Result()\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to set string, err: %v\", err)\n\t\t\t}\n\n\t\t\tt.Logf(\"result of %v: %v\", key, result)\n\t\t}\n\t})\n\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_hset_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\tredis_ \"github.com/kaydxh/golang/pkg/database/redis\"\n)\n\nfunc TestHSetStruct(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\t// only get export Fields from testCases\n\ttestCases := []struct {\n\t\tKey string `redis:\"reids_key\"`\n\t\tID  int64  `redis:\"redis_id\"`\n\t}{\n\t\t{\n\t\t\tKey: \"hset-test-1\",\n\t\t\tID:  1,\n\t\t},\n\t\t{\n\t\t\tKey: \"hset-test-2\",\n\t\t\tID:  2,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\terr := redis_.HSetStruct(ctx, db, testCase.Key, testCase)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to hset, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v,  value: %v\", testCase.Key, testCase)\n\t}\n}\n\n//get all fields by hash key\nfunc TestHKeys(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"hset-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey: \"hset-test-2\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tresult, err := db.HKeys(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to HKeys, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v,  result: %v\", testCase.Key, result)\n\n\t}\n}\n\n//get all field-value by hash key\nfunc TestHGetAll(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"hset-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey: \"hset-test-2\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tresult, err := db.HGetAll(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to hGetAll, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v,  result: %v\", testCase.Key, result)\n\n\t}\n}\n\n//get value by hash key and field\nfunc TestHGet(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tField string\n\t}{\n\t\t{\n\t\t\tKey:   \"hset-test-1\",\n\t\t\tField: \"redis_id\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-2\",\n\t\t\tField: \"redis_id\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tfieldValues, err := db.HGet(ctx, testCase.Key, testCase.Field).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to hGet, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, field: %v,  result: %v\", testCase.Key, testCase.Field, fieldValues)\n\n\t}\n}\n\n//exist hash key and field\nfunc TestHExists(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tField string\n\t}{\n\t\t{\n\t\t\tKey:   \"hset-test-1\",\n\t\t\tField: \"redis_id\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-2\",\n\t\t\tField: \"redis_id\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-no-exist\",\n\t\t\tField: \"redis_id\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tok, err := db.HExists(ctx, testCase.Key, testCase.Field).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to hGet, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, field: %v,  result: %v\", testCase.Key, testCase.Field, ok)\n\n\t}\n}\n\n// increment by hash key and field\nfunc TestHIncrBy(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tField string\n\t\tIncr  int64\n\t}{\n\t\t{\n\t\t\tKey:   \"hset-test-1\",\n\t\t\tField: \"redis_id\",\n\t\t\tIncr:  1,\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-2\",\n\t\t\tField: \"redis_id\",\n\t\t\tIncr:  2,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t// val is the result after incr\n\t\tval, err := db.HIncrBy(ctx, testCase.Key, testCase.Field, testCase.Incr).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to HIncrBy, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, field: %v, val: %v\", testCase.Key, testCase.Field, val)\n\n\t}\n}\n\n// get fields num by hash key\nfunc TestHLen(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"hset-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey: \"hset-test-2\",\n\t\t},\n\t\t{\n\t\t\tKey: \"hset-test-no-exist\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t// count is the number of field by hash key\n\t\tcount, err := db.HLen(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to HLen, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, field count: %v\", testCase.Key, count)\n\n\t}\n}\n\n// get values by fields and  hash key\nfunc TestHMGet(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tField string\n\t}{\n\t\t{\n\t\t\tKey:   \"hset-test-1\",\n\t\t\tField: \"redis_id\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-2\",\n\t\t\tField: \"redis_id\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-no-exist\",\n\t\t\tField: \"redis_id\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t// vals is value of field by hash key\n\t\tvals, err := db.HMGet(ctx, testCase.Key, testCase.Field).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to HMGet, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, field: %v, vals: %v\", testCase.Key, testCase.Field, vals)\n\n\t}\n}\n\n// set values by fields and  hash key\nfunc TestHMSet(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tField string\n\t\tValue interface{}\n\t}{\n\t\t{\n\t\t\tKey:   \"hset-test-1\",\n\t\t\tField: \"redis_id\",\n\t\t\tValue: 10,\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-2\",\n\t\t\tField: \"redis_id\",\n\t\t\tValue: 20,\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-2\",\n\t\t\tField: \"redis_id_new\",\n\t\t\tValue: \"new field\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-no-exist\",\n\t\t\tField: \"redis_id\",\n\t\t\tValue: 30,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t// count is the number of field by hash key\n\t\tok, err := db.HMSet(ctx, testCase.Key, testCase.Field, testCase.Value).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to HMSet, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, field: %v, ok: %v\", testCase.Key, testCase.Field, ok)\n\n\t}\n}\n\n// set values by fields and  hash key when field is not exist\nfunc TestHSetNX(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tField string\n\t\tValue interface{}\n\t}{\n\t\t{\n\t\t\tKey:   \"hset-test-1\",\n\t\t\tField: \"redis_id\",\n\t\t\tValue: 10,\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-2\",\n\t\t\tField: \"redis_id\",\n\t\t\tValue: 20,\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-2\",\n\t\t\tField: \"redis_id_new_1\",\n\t\t\tValue: \"new field_1\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-no-exist-1\",\n\t\t\tField: \"redis_id\",\n\t\t\tValue: 30,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t// count is the number of field by hash key\n\t\tok, err := db.HSetNX(ctx, testCase.Key, testCase.Field, testCase.Value).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to HSetNX, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, field: %v, ok: %v\", testCase.Key, testCase.Field, ok)\n\n\t}\n}\n\n// set values by fields and  hash key when field is not exist\n/*\n   redis_hset_test.go:397: key: hset-test-1, values: [10 hset-test-1]\n   redis_hset_test.go:397: key: hset-test-2, values: [hset-test-2 20 new field new field_1]\n   redis_hset_test.go:397: key: hset-test-no-exist-1, values: [30]\n*/\nfunc TestHVals(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"hset-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey: \"hset-test-2\",\n\t\t},\n\t\t{\n\t\t\tKey: \"hset-test-no-exist-1\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t// count is the number of field by hash key\n\t\tvals, err := db.HVals(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to HVals, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, values: %v\", testCase.Key, vals)\n\n\t}\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_key_delete_test.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis_test\n\nimport (\n\t\"context\"\n\t\"flag\"\n\t\"fmt\"\n\t\"testing\"\n)\n\nvar (\n\tkeyPrefix  = flag.String(\"keyPrefix\", \"_JOB_SERVICE\", \"key prefix\")\n\tdeleteKeys = flag.Bool(\"deleteKeys\", false, \"delete keys\")\n)\n\n// GOOS=linux  GOARCH=amd64 go test  -c redis_key_delete_test.go redis_string_test.go\n//go test -v --count=1 --test.timeout=0  -test.run  TestDeletePrefixKeys\n//go test -v --count=1 --test.timeout=0  -test.run  TestDeletePrefixKeys -keyPrefix=\"test-\" -deleteKeys=true\nfunc TestDeletePrefixKeys(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\t//\tKeyPrefix string\n\t\t// 是否有过期时间\n\t\tttl   bool\n\t\tbatch int64\n\t\t//\tdeleteKeys bool\n\t\tdump bool\n\t}{\n\t\t{\n\t\t\t//\t\tKeyPrefix:  \"_JOB_SERVICE\",\n\t\t\tttl:   false,\n\t\t\tbatch: 500,\n\t\t\t//\t\tdeleteKeys: false,\n\t\t\tdump: false,\n\t\t},\n\t}\n\tctx := context.Background()\n\t//ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\t//defer cancel()\n\n\tvar count int64\n\tvar deletedKeys []string\n\tfor _, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-keyPrefix[%v]-deleteKeys[%v]\", *keyPrefix, *deleteKeys), func(t *testing.T) {\n\t\t\titer := db.Scan(ctx, 0, fmt.Sprintf(\"%s*\", *keyPrefix), 0).Iterator()\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to scan key[%v], err: %v\", *keyPrefix, err)\n\t\t\t}\n\n\t\t\tfor iter.Next(ctx) {\n\t\t\t\tkey := iter.Val()\n\t\t\t\t/*\n\t\t\t\t\ttp, err := db.Type(ctx, key).Result()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tt.Errorf(\"failed to type key[%v], err: %v\", key, err)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch tp {\n\t\t\t\t\tcase redis_.TypeString:\n\n\t\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\t\tvalue, err := db.Get(ctx, key).Result()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tt.Fatalf(\"failed to get key[%v], err: %v\", key, err)\n\t\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tif testCase.dump {\n\t\t\t\t\tdumpVal, err := db.Dump(ctx, key).Result()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tt.Fatalf(\"failed to Dump, err: %v\", err)\n\t\t\t\t\t}\n\t\t\t\t\t//t.Logf(\"key[%v], dumpValue[%v], value[%v]\", key, dumpVal, value)\n\t\t\t\t\tt.Logf(\"key[%v], dumpValue[%v]\", key, dumpVal)\n\t\t\t\t}\n\t\t\t\t//t.Logf(\"get key[%v] value[%v]\", key, value)\n\n\t\t\t\t//todo delete\n\t\t\t\tif testCase.ttl {\n\t\t\t\t\td, err := db.TTL(ctx, key).Result()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tt.Fatalf(\"failed to get key[%v], err: %v\", key, err)\n\t\t\t\t\t}\n\t\t\t\t\tif d == -1 { // -1 means no TTL\n\t\t\t\t\t\tdeletedKeys = append(deletedKeys, key)\n\t\t\t\t\t\tcount++\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tcount++\n\t\t\t\t\tdeletedKeys = append(deletedKeys, key)\n\t\t\t\t}\n\n\t\t\t\tif count%testCase.batch == 0 {\n\t\t\t\t\tif *deleteKeys {\n\t\t\t\t\t\tif err := db.Del(ctx, deletedKeys...).Err(); err != nil {\n\t\t\t\t\t\t\tt.Fatalf(\"failed to delete keys[%v], err: %v\", key, err)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdeletedKeys = nil\n\t\t\t\t\tt.Logf(\"key number: %v ...\", count)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif err := iter.Err(); err != nil {\n\t\t\t\tt.Fatalf(\"failed to iter err: %v\", err)\n\t\t\t}\n\n\t\t\tif len(deletedKeys) > 0 {\n\t\t\t\tif *deleteKeys {\n\t\t\t\t\tif err := db.Del(ctx, deletedKeys...).Err(); err != nil {\n\t\t\t\t\t\tt.Fatalf(\"failed to delete keys[%v], err: %v\", deletedKeys, err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdeletedKeys = nil\n\t\t\t\tt.Logf(\"key number: %v ...\", count)\n\t\t\t}\n\n\t\t})\n\t}\n\tt.Logf(\"all key number: %v\", count)\n\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_key_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n)\n\n//set key expired time s, if time > 0, time must > 1s\nfunc TestExpire(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey        string\n\t\tExpiration time.Duration\n\t}{\n\t\t{\n\t\t\tKey:        \"zset-test-1\",\n\t\t\tExpiration: 30 * time.Millisecond,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tok, err := db.Expire(ctx, testCase.Key, testCase.Expiration).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to Expire, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"set: %v, val: %v\", testCase.Key, ok)\n\t}\n}\n\n//set key expired time with unix timestamp\nfunc TestExpireAt(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t\tTm  time.Time\n\t}{\n\t\t{\n\t\t\tKey: \"zset-test-1\",\n\t\t\tTm:  time.Now().Add(10 * time.Second),\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tok, err := db.ExpireAt(ctx, testCase.Key, testCase.Tm).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to ExpireAt, err: %v\", err)\n\t\t}\n\n\t\tif !ok {\n\t\t\tt.Fatalf(\"failed to ExpireAt\")\n\t\t}\n\t\tt.Logf(\"set: %v, val: %v\", testCase.Key, ok)\n\t}\n}\n\n//set key expired time, if time > 0, time must > 1ms\nfunc TestPExpire(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey        string\n\t\tExpiration time.Duration\n\t}{\n\t\t{\n\t\t\tKey:        \"zset-test-1\",\n\t\t\tExpiration: 30 * time.Second,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tok, err := db.PExpire(ctx, testCase.Key, testCase.Expiration).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to PExpire, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"set: %v, val: %v\", testCase.Key, ok)\n\t}\n}\n\n//serialize key\nfunc TestDump(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"zset-test-1\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.Dump(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to Dump, err: %v\", err)\n\t\t}\n\n\t\tt.Logf(\"set: %v, val: %v\", testCase.Key, val)\n\t}\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_list_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n)\n\n//push value to list key\nfunc TestRPush(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tValue string\n\t}{\n\t\t{\n\t\t\tKey:   \"list-test-1\",\n\t\t\tValue: \"value-list-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"list-test-2\",\n\t\t\tValue: \"value-list-test-2\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.RPush(ctx, testCase.Key, testCase.Value).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to RPush, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, val: %v\", testCase.Key, val)\n\n\t}\n\n}\n\n//push value to list key which is existed\nfunc TestRPushX(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tValue string\n\t}{\n\t\t{\n\t\t\tKey:   \"list-test-3\",\n\t\t\tValue: \"value-list-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"list-test-4\",\n\t\t\tValue: \"value-list-test-2\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.RPushX(ctx, testCase.Key, testCase.Value).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to RPushX, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, val: %v\", testCase.Key, val)\n\n\t}\n}\n\n//get length for list key\nfunc TestLLen(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"list-test-3\",\n\t\t},\n\t\t{\n\t\t\tKey: \"list-test-4\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tlength, err := db.LLen(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to LLen, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"list: %v, val: %v\", testCase.Key, length)\n\n\t}\n}\n\n//push value to list key\n//Start: 0 the first element ,End\n//End: -1 the last element, -2, next to last element\nfunc TestLRange(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tStart int64\n\t\tEnd   int64\n\t}{\n\t\t{\n\t\t\tKey:   \"list-test-1\",\n\t\t\tStart: 0,\n\t\t\tEnd:   -1,\n\t\t},\n\t\t{\n\t\t\tKey:   \"list-test-2\",\n\t\t\tStart: 0,\n\t\t\tEnd:   -1,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tvals, err := db.LRange(ctx, testCase.Key, testCase.Start, testCase.End).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to LRange, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"list: %v, vals: %v\", testCase.Key, vals)\n\n\t}\n}\n\n//can use negative indexes\n//-1 the last element, -2, next to last element\nfunc TestLIndex(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tIndex int64\n\t}{\n\t\t{\n\t\t\tKey:   \"list-test-1\",\n\t\t\tIndex: 0,\n\t\t},\n\t\t{\n\t\t\tKey:   \"list-test-2\",\n\t\t\tIndex: -1,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.LIndex(ctx, testCase.Key, testCase.Index).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to LRange, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"list: %v, index: %v, val: %v\", testCase.Key, testCase.Index, val)\n\n\t}\n}\n\n//insert value before the pivot\nfunc TestLInsertBefore(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tPivot string\n\t\tValue string\n\t}{\n\t\t{\n\t\t\tKey:   \"list-test-1\",\n\t\t\tPivot: \"value-list-test-1\",\n\t\t\tValue: \"value-list-test-2\",\n\t\t},\n\t\t{\n\t\t\tKey:   \"list-test-2\",\n\t\t\tPivot: \"value-list-test-2\",\n\t\t\tValue: \"value-list-test-3\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.LInsertBefore(ctx, testCase.Key, testCase.Pivot, testCase.Value).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to LInsertBefore, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"list: %v, val: %v\", testCase.Key, val)\n\n\t}\n}\n\n//insert value to list head\nfunc TestLPush(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey    string\n\t\tValues []string\n\t}{\n\t\t{\n\t\t\tKey:    \"list-test-1\",\n\t\t\tValues: []string{\"value-list-1-test-10\", \"value-list-1-test-20\"},\n\t\t},\n\t\t{\n\t\t\tKey:    \"list-test-2\",\n\t\t\tValues: []string{\"value-list-2-test-10\", \"value-list-2-test-20\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.LPush(ctx, testCase.Key, testCase.Values).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to LInsertBefore, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"list: %v, val: %v\", testCase.Key, val)\n\n\t}\n}\n\n//keep elements in range, the others will deleted\nfunc TestLTrim(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tStart int64\n\t\tEnd   int64\n\t}{\n\t\t{\n\t\t\tKey:   \"list-test-1\",\n\t\t\tStart: 1,\n\t\t\tEnd:   3,\n\t\t},\n\t\t{\n\t\t\tKey:   \"list-test-2\",\n\t\t\tStart: 0,\n\t\t\tEnd:   -1,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.LTrim(ctx, testCase.Key, testCase.Start, testCase.End).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to LInsertBefore, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"list: %v, val: %v\", testCase.Key, val)\n\n\t}\n}\n\n//delete element from list head, if the list is empty, will block times to find elements that can be ejected or wait timout\nfunc TestBLPop(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"list-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey: \"list-test-20\",\n\t\t},\n\t}\n\n\ttimout := 5 * time.Second\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.BLPop(ctx, timout, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to BLPop, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"list: %v, val: %v\", testCase.Key, val)\n\n\t}\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis\n\n// A RedisOption sets options.\ntype RedisOption interface {\n\tapply(*RedisClient)\n}\n\n// EmptyRedisUrlOption does not alter the Redisuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyRedisOption struct{}\n\nfunc (EmptyRedisOption) apply(*RedisClient) {}\n\n// RedisOptionFunc wraps a function that modifies Redis into an\n// implementation of the RedisOption interface.\ntype RedisOptionFunc func(*RedisClient)\n\nfunc (f RedisOptionFunc) apply(do *RedisClient) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _RedisOptionWithDefault() RedisOption {\n\treturn RedisOptionFunc(func(*RedisClient) {\n\t\t// nothing to change\n\t})\n}\n\nfunc (o *RedisClient) ApplyOptions(options ...RedisOption) *RedisClient {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_set_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestSAdd(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey    string\n\t\tValues []string\n\t}{\n\t\t{\n\t\t\tKey: \"set-test-1\",\n\t\t\tValues: []string{\n\t\t\t\t\"values-set-test-1-1\",\n\t\t\t\t\"values-set-test-1-2\",\n\t\t\t\t\"values-set-test-1-3\",\n\t\t\t\t\"values-set-test-1-4\",\n\t\t\t\t\"values-set-test-1-5\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tKey:    \"set-test-20\",\n\t\t\tValues: []string{\"values-set-test-1-1\", \"values-set-test-20-1\", \"values-set-test-20-2\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.SAdd(ctx, testCase.Key, testCase.Values).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SAdd, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"set: %v, val: %v\", testCase.Key, val)\n\t}\n}\n\nfunc TestSCard(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"set-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey: \"set-test-20\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tcount, err := db.SCard(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SCard, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"set: %v, member count: %v\", testCase.Key, count)\n\t}\n}\n\n//diff val from multi sets\n// return the first set different elements from the other sets\nfunc TestSDiff(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKeys []string\n\t}{\n\t\t{\n\t\t\tKeys: []string{\"set-test-1\", \"set-test-20\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tvals, err := db.SDiff(ctx, testCase.Keys...).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SDiff, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v, diff values: %v\", testCase.Keys, vals)\n\t}\n}\n\nfunc TestSDiffStore(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tTargetSet string\n\t\tKeys      []string\n\t}{\n\t\t{\n\t\t\tTargetSet: \"target-set\",\n\t\t\tKeys:      []string{\"set-test-1\", \"set-test-20\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t//err: CROSSSLOT Keys in request don't hash to the same slot\n\t\tvals, err := db.SDiffStore(ctx, testCase.TargetSet, testCase.Keys...).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SDiffStore, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v,  SDiffStore values: %v\", testCase.Keys, vals)\n\t}\n}\n\nfunc TestSInter(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKeys []string\n\t}{\n\t\t{\n\t\t\tKeys: []string{\"set-test-1\", \"set-test-20\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tvals, err := db.SInter(ctx, testCase.Keys...).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SDiffStore, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v, SInter values: %v\", testCase.Keys, vals)\n\t}\n}\n\nfunc TestSMembers(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"set-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey: \"set-test-20\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tvals, err := db.SMembers(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SMembers, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v,  SMembers values: %v\", testCase.Key, vals)\n\t}\n}\n\nfunc TestSInterStore(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tTargetSet string\n\t\tKeys      []string\n\t}{\n\t\t{\n\t\t\tTargetSet: \"target-inter-set\",\n\t\t\tKeys:      []string{\"set-test-1\", \"set-test-20\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t//err: CROSSSLOT Keys in request don't hash to the same slot\n\t\tvals, err := db.SInterStore(ctx, testCase.TargetSet, testCase.Keys...).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SInterStore, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v, SInterStore values: %v\", testCase.Keys, vals)\n\t}\n}\n\n//delete values from set\nfunc TestSRem(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey    string\n\t\tValues []string\n\t}{\n\t\t{\n\t\t\tKey:    \"set-test-1\",\n\t\t\tValues: []string{\"values-set-test-1-2\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t//err: CROSSSLOT Keys in request don't hash to the same slot\n\t\tvals, err := db.SRem(ctx, testCase.Key, testCase.Values).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SRem, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v, SRem values: %v\", testCase.Key, vals)\n\t}\n}\n\n// check value is in set\n//need redis server version >= 6.2.0\nfunc TestSMIsMember(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey    string\n\t\tValues []string\n\t}{\n\t\t{\n\t\t\tKey:    \"set-test-1\",\n\t\t\tValues: []string{\"values-set-test-1-2\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t//err: CROSSSLOT Keys in request don't hash to the same slot\n\t\tvals, err := db.SMIsMember(ctx, testCase.Key, testCase.Values).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SMIsMember, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v, SMIsMember values: %v\", testCase.Key, vals)\n\t}\n}\n\n//random delete elemnt from set\nfunc TestSPop(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"set-test-1\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.SPop(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SPop, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v,  SPop value: %v\", testCase.Key, val)\n\t}\n}\n\n// random get value from set\nfunc TestSRandMember(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"set-test-1\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.SRandMember(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SRandMember, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v, SRandMember value: %v\", testCase.Key, val)\n\t}\n}\n\n// random get value from set\nfunc TestSRandMemberN(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tCount int64\n\t}{\n\t\t{\n\t\t\tKey:   \"set-test-1\",\n\t\t\tCount: 2,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tvals, err := db.SRandMemberN(ctx, testCase.Key, testCase.Count).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SRandMemberN, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v, SRandMemberN values: %v\", testCase.Key, vals)\n\t}\n}\n\nfunc TestSUnion(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKeys []string\n\t}{\n\t\t{\n\t\t\tKeys: []string{\"set-test-1\", \"set-test-20\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t//err: CROSSSLOT Keys in request don't hash to the same slot\n\t\tvals, err := db.SUnion(ctx, testCase.Keys...).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SUnion, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v, SUnion values: %v\", testCase.Keys, vals)\n\t}\n}\n\nfunc TestSMove(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tSource      string\n\t\tDestination string\n\t\tValue       string\n\t}{\n\t\t{\n\t\t\tSource:      \"set-test-1\",\n\t\t\tDestination: \"set-test-20\",\n\t\t\tValue:       \"values-set-test-1-5\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t//err: CROSSSLOT Keys in request don't hash to the same slot\n\t\tok, err := db.SMove(ctx, testCase.Source, testCase.Destination, testCase.Value).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SUnion, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"move sets: %v to %v, SUnion values: %v\", testCase.Source, testCase.Destination, ok)\n\t}\n}\n\nfunc TestSUnionStore(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tTargetSet string\n\t\tKeys      []string\n\t}{\n\t\t{\n\t\t\tTargetSet: \"target-set\",\n\t\t\tKeys:      []string{\"set-test-1\", \"set-test-20\"},\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t//err: CROSSSLOT Keys in request don't hash to the same slot\n\t\tval, err := db.SUnionStore(ctx, testCase.TargetSet, testCase.Keys...).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SUnionStore, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v, SUnionStore values: %v\", testCase.Keys, val)\n\t}\n}\n\nfunc TestSScan(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey    string\n\t\tCursor uint64\n\t\tMatch  string\n\t\tCount  int64\n\t}{\n\t\t{\n\t\t\tKey:    \"set-test-1\",\n\t\t\tCursor: 0,\n\t\t\tMatch:  \"*set*\",\n\t\t\tCount:  2,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\t//err: CROSSSLOT Keys in request don't hash to the same slot\n\t\tkeys, cursor, err := db.SScan(ctx, testCase.Key, testCase.Cursor, testCase.Match, testCase.Count).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to SScan, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"sets: %v,SScan keys: %v, cursor: %v\", testCase.Key, keys, cursor)\n\t}\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_string_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis_test\n\nimport (\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\t\"context\"\n\n\t\"github.com/go-redis/redis/v8\"\n\tredis_ \"github.com/kaydxh/golang/pkg/database/redis\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestGetDataBase(t *testing.T) {\n\ttestCases := []struct {\n\t\tTestName  string\n\t\tAddresses []string\n\t\tDB        int\n\t\tUserName  string\n\t\tPassword  string\n\t}{\n\t\t{\n\t\t\tTestName:  \"test1\",\n\t\t\tAddresses: []string{\"9.135.232.102:6380\"},\n\t\t\tDB:        0,\n\t\t\tUserName:  \"root\",\n\t\t\tPassword:  \"HXufW*3569FShs\",\n\t\t},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.TestName, func(t *testing.T) {\n\t\t\tdb := redis_.NewRedisClient(redis_.DBConfig{\n\t\t\t\tAddresses: testCase.Addresses,\n\t\t\t\tUserName:  testCase.UserName,\n\t\t\t\tPassword:  testCase.Password,\n\t\t\t\tDB:        testCase.DB,\n\t\t\t})\n\t\t\tredisDB, err := db.GetRedis(context.Background())\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to get redis database: %v, got : %s\", testCase.Addresses, err)\n\t\t\t}\n\t\t\tassert.NotNil(t, redisDB)\n\t\t})\n\t}\n\n}\n\nvar (\n\tonce sync.Once\n\tdb   *redis.Client\n\terr  error\n)\n\nfunc GetDBOrDie() *redis.Client {\n\tonce.Do(func() {\n\t\tcfgFile := \"./redis.yaml\"\n\t\tconfig := redis_.NewConfig(redis_.WithViper(viper_.GetViper(cfgFile, \"database.redis\")))\n\n\t\tdb, err = config.Complete().New(context.Background())\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif db == nil {\n\t\t\tpanic(\"db is not enable\")\n\t\t}\n\t})\n\n\treturn db\n\n}\n\nfunc TestNew(t *testing.T) {\n\tdb := GetDBOrDie()\n\t//defer db.Close()\n\n\tt.Logf(\"db: %#v\", db)\n}\n\n// set string\n// Redis `SET key value [expiration]` command.\n//\n// Use expiration for `SETEX`-like behavior.\n// Zero expiration means the key has no expiration time.\nfunc TestSet(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\t//defer db.Close()\n\n\ttestCases := []struct {\n\t\tkey      string\n\t\tvalue    string\n\t\texpire   time.Duration\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tkey:      \"test1\",\n\t\t\tvalue:    \"test1-1, test1-2\",\n\t\t\texpected: \"test1\",\n\t\t},\n\t\t{\n\t\t\tkey:      \"test2\",\n\t\t\tvalue:    \"test2-1, test2-2\",\n\t\t\texpected: \"test2\",\n\t\t},\n\n\t\t{\n\t\t\tkey:      \"test3-tmp\",\n\t\t\tvalue:    \"test3-1, test3-2\",\n\t\t\texpire:   time.Minute,\n\t\t\texpected: \"test3\",\n\t\t},\n\t}\n\n\tctx := context.Background()\n\tfor _, testCase := range testCases {\n\n\t\tresult, err := db.Set(ctx, testCase.key, testCase.value, testCase.expire).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to set string, err: %v\", err)\n\t\t}\n\n\t\tt.Logf(\"result of %v: %v\", testCase.key, result)\n\t}\n\n}\n\n//get values with keys\nfunc TestGetValues(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\t//\tdefer db.Close()\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tkeys, err := db.Keys(ctx, \"*\").Result()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get all keys , err: %v\", err)\n\t}\n\n\tvalues, err := redis_.GetValues(ctx, db, keys...)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get values, err: %v\", err)\n\t}\n\tt.Logf(\"keys: %v, values: %v\", keys, values)\n}\n\n//get range of value with key\nfunc TestGetRange(t *testing.T) {\n\n\tdb := GetDBOrDie()\n\t//\tdefer db.Close()\n\n\ttestCases := []struct {\n\t\tkey      string\n\t\tstart    int64\n\t\tend      int64\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tkey:      \"test1\",\n\t\t\tstart:    0,\n\t\t\tend:      -1, // get all range\n\t\t\texpected: \"test1-1\",\n\t\t},\n\t\t{\n\t\t\tkey:      \"test2\",\n\t\t\tstart:    0,\n\t\t\tend:      int64(len(\"test1-1\")) - 1, //include end\n\t\t\texpected: \"test2-1\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tvalue, err := db.GetRange(ctx, testCase.key, testCase.start, testCase.end).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to get range, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"key: %v, range [%d:%d] value: %v\", testCase.key, testCase.start, testCase.end, value)\n\t}\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_transaction_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/go-redis/redis/v8\"\n)\n\n// transaction, but not support rollback, ensure only the client command execed\nfunc TestTxPipelined(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tField string\n\t\tIncr  int64\n\t}{\n\t\t{\n\t\t\tKey:   \"hset-test-1\",\n\t\t\tField: \"redis_id\",\n\t\t\tIncr:  1,\n\t\t},\n\t\t{\n\t\t\tKey:   \"hset-test-2\",\n\t\t\tField: \"redis_id\",\n\t\t\tIncr:  2,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\t_, err := db.TxPipelined(ctx, func(redis.Pipeliner) error {\n\t\tfor _, testCase := range testCases {\n\t\t\tval, err := db.HIncrBy(ctx, testCase.Key, testCase.Field, testCase.Incr).Result()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tt.Logf(\"set: %v, val: %v\", testCase.Key, val)\n\t\t}\n\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tt.Fatalf(\"failed to TxPipelined, err: %v\", err)\n\t}\n\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_type.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis\n\nimport (\n\t\"sync/atomic\"\n\n\t\"github.com/go-redis/redis/v8\"\n)\n\nconst (\n\tTypeString = \"string\"\n\tTypeHash   = \"hash\"\n\tTypeList   = \"list\"\n\tTypeSet    = \"set\"\n\tTypeZSet   = \"zset\"\n\tTypeOther  = \"other\"\n)\n\ntype RedisDB atomic.Value\n\n//check type RedisDB* whether to implement interface of atomic.Value\n//var _ atomic.Value = (*RedisDB)(nil)\n\n//check type  RedisDB whether to implement interface of atomic.Value\n//var _ atomic.Value = RedisDB{}\n\nfunc (m *RedisDB) Store(value *redis.Client) {\n\t(*atomic.Value)(m).Store(value)\n}\n\nfunc (m *RedisDB) Load() *redis.Client {\n\tvalue := (*atomic.Value)(m).Load()\n\tif value == nil {\n\t\treturn nil\n\t}\n\treturn value.(*redis.Client)\n}\n"
  },
  {
    "path": "pkg/database/redis/redis_zset_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage redis_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/go-redis/redis/v8\"\n)\n\nfunc TestZAdd(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tValue string\n\t\tScore float64\n\t}{\n\t\t{\n\t\t\tKey:   \"zset-test-1\",\n\t\t\tValue: \"values-zset-test-1-1\",\n\t\t\tScore: 0.5,\n\t\t},\n\t\t{\n\t\t\tKey:   \"zset-test-1\",\n\t\t\tValue: \"values-zset-test-1-2\",\n\t\t\tScore: 50,\n\t\t},\n\t\t{\n\t\t\tKey:   \"zset-test-1\",\n\t\t\tValue: \"values-zset-test-1-3\",\n\t\t\tScore: 500,\n\t\t},\n\t\t{\n\t\t\tKey:   \"zset-test-1\",\n\t\t\tValue: \"values-zset-test-1-4\",\n\t\t\tScore: 100,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tval, err := db.ZAdd(ctx, testCase.Key, &redis.Z{\n\t\t\tScore:  testCase.Score,\n\t\t\tMember: testCase.Value,\n\t\t}).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to ZAdd, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"set: %v, val: %v\", testCase.Key, val)\n\t}\n}\n\nfunc TestZCard(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t}{\n\t\t{\n\t\t\tKey: \"zset-test-1\",\n\t\t},\n\t\t{\n\t\t\tKey: \"zset-test-20\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tcount, err := db.ZCard(ctx, testCase.Key).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to ZCard, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"set: %v, member count: %v\", testCase.Key, count)\n\t}\n}\n\n// return values sorted by score\nfunc TestZRange(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey   string\n\t\tStart int64\n\t\tStop  int64\n\t}{\n\t\t{\n\t\t\tKey:   \"zset-test-1\",\n\t\t\tStart: 0,\n\t\t\tStop:  -1,\n\t\t},\n\t\t{\n\t\t\tKey:   \"zset-test-20\",\n\t\t\tStart: 0,\n\t\t\tStop:  -1,\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tvals, err := db.ZRange(ctx, testCase.Key, testCase.Start, testCase.Stop).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to ZRange, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"set: %v, members: %v\", testCase.Key, vals)\n\t}\n}\n\nfunc TestZRangeByScore(t *testing.T) {\n\tdb := GetDBOrDie()\n\n\ttestCases := []struct {\n\t\tKey string\n\t\tMin string\n\t\tMax string\n\t}{\n\t\t{\n\t\t\tKey: \"zset-test-1\",\n\t\t\tMin: \"50\",\n\t\t\tMax: \"100\",\n\t\t},\n\t\t{\n\t\t\tKey: \"zset-test-1\",\n\t\t\tMin: \"-inf\",\n\t\t\tMax: \"+inf\",\n\t\t},\n\t\t{\n\t\t\tKey: \"zset-test-1\",\n\t\t\tMin: \"-1\",\n\t\t\tMax: \"100\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor _, testCase := range testCases {\n\t\tvals, err := db.ZRangeByScore(ctx, testCase.Key, &redis.ZRangeBy{\n\t\t\tMin: testCase.Min,\n\t\t\tMax: testCase.Max,\n\t\t}).Result()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to ZRangeByScore, err: %v\", err)\n\t\t}\n\t\tt.Logf(\"set: %v, ZRangeByScore: %v\", testCase.Key, vals)\n\t}\n}\n"
  },
  {
    "path": "pkg/discovery/consul/discovery.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage consul\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/hashicorp/consul/api\"\n\t\"github.com/kaydxh/golang/go/errors\"\n\t\"github.com/sirupsen/logrus\"\n\t\"go.uber.org/atomic\"\n)\n\ntype ServiceRegistryServer struct {\n\tConsulAddress string\n\tServiceId     string\n\tServiceName   string\n\tTag           []string\n\tIp            string\n\tPort          int\n\tTTL           time.Duration\n\tCheckInterval time.Duration\n\n\tinShutdown atomic.Bool // true when when server is in shutdown\n\n\tmu sync.Mutex\n\n\tcancel func()\n}\n\nfunc NewServiceRegistry(\n\tconsulAddr string,\n\tserviceName string,\n\tserviceAddress string,\n) (*ServiceRegistryServer, error) {\n\tlogger := logrus.WithField(\"module\", \"service_registry\").\n\t\tWithField(\"service_name\", serviceName).\n\t\tWithField(\"addr\", serviceAddress)\n\n\thost, port, err := net.SplitHostPort(serviceAddress)\n\tif err != nil {\n\t\tlogger.WithError(err).Errorln(\"malformed service serviceAddress\")\n\t\treturn nil, fmt.Errorf(\"malformed service serviceAddress: %w\", err)\n\t}\n\n\tnport, err := strconv.Atoi(port)\n\tif err != nil {\n\t\tlogger.WithField(\"port\", port).\n\t\t\tWithError(err).\n\t\t\tErrorln(\"malformed service port, must be a number\")\n\t\treturn nil, fmt.Errorf(\"malformed service port: %w\", err)\n\t}\n\tserviceId := fmt.Sprintf(\"%v-%v-%v\", serviceName, host, port)\n\ts := &ServiceRegistryServer{\n\t\tConsulAddress: consulAddr,\n\t\tServiceId:     serviceId,\n\t\tServiceName:   serviceName,\n\t\tTag:           []string{},\n\t\tPort:          nport,\n\t\tIp:            host,\n\t\tTTL:           300 * time.Second,\n\t\tCheckInterval: 10 * time.Second,\n\t}\n\treturn s, nil\n}\n\n// Run will initialize the backend. It must not block, but may run go routines in the background.\nfunc (srv *ServiceRegistryServer) Run(ctx context.Context) error {\n\tlogger := srv.logger().\n\t\tWithField(\"service_name\", srv.ServiceName).\n\t\tWithField(\"service_id\", srv.ServiceId)\n\tlogger.Infoln(\"ConsulRegistry Run\")\n\tif srv.inShutdown.Load() {\n\t\tlogger.Infoln(\"ConsulRegistry Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\tgo func() {\n\t\terrors.HandleError(srv.Serve(ctx))\n\t}()\n\treturn nil\n}\n\nfunc (srv *ServiceRegistryServer) Serve(ctx context.Context) error {\n\tlogger := srv.logger().\n\t\tWithField(\"service_name\", srv.ServiceName).\n\t\tWithField(\"service_id\", srv.ServiceId)\n\tlogger.Infoln(\"ConsulRegistry Serve\")\n\n\tif srv.inShutdown.Load() {\n\t\tlogger.Infoln(\"ConsulRegistry Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\n\tdefer srv.inShutdown.Store(true)\n\tctx, cancel := context.WithCancel(ctx)\n\tsrv.mu.Lock()\n\tsrv.cancel = cancel\n\tsrv.mu.Unlock()\n\n\tt := time.NewTicker(time.Second * 30)\n\tdefer t.Stop()\n\tfor {\n\t\tselect {\n\t\tcase <-t.C:\n\t\t\tlogger.Infoln(\"registering service to consul\")\n\t\t\terr := srv.Register()\n\t\t\tif err != nil {\n\t\t\t\tlogger.WithError(err).Errorln(\"register service failed\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsrv.logger().Info(\"register service by consul\")\n\n\t\tcase <-ctx.Done():\n\t\t\tlogger.Infoln(\"unregistering service to consul\")\n\t\t\terr := srv.UnRegister()\n\t\t\tif err != nil {\n\t\t\t\tlogger.WithError(err).Errorln(\"unregister service failed\")\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tsrv.logger().Info(\"unregister service by consul\")\n\t\t\treturn nil\n\t\t}\n\t}\n}\n\nfunc (srv *ServiceRegistryServer) Shutdown() {\n\tsrv.inShutdown.Store(true)\n\tsrv.mu.Lock()\n\tdefer srv.mu.Unlock()\n\tif srv.cancel != nil {\n\t\tsrv.cancel()\n\t}\n}\n\nfunc (srv *ServiceRegistryServer) Register() error {\n\tconfig := api.DefaultConfig()\n\tconfig.Address = srv.ConsulAddress\n\tclient, err := api.NewClient(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\tagent := client.Agent()\n\n\tcheckUrl := fmt.Sprintf(\"http://%v:%v/api/%v/v1/health\", srv.Ip, srv.Port, srv.ServiceName)\n\n\treg := &api.AgentServiceRegistration{\n\t\tID:      srv.ServiceId,\n\t\tName:    srv.ServiceName,\n\t\tTags:    srv.Tag,\n\t\tPort:    srv.Port,\n\t\tAddress: srv.Ip,\n\t\tCheck: &api.AgentServiceCheck{\n\t\t\tInterval:                       srv.CheckInterval.String(),\n\t\t\tHTTP:                           checkUrl,\n\t\t\tDeregisterCriticalServiceAfter: srv.TTL.String(),\n\t\t},\n\t}\n\n\treturn agent.ServiceRegister(reg)\n}\n\nfunc (srv *ServiceRegistryServer) UnRegister() error {\n\tconfig := api.DefaultConfig()\n\tconfig.Address = srv.ConsulAddress\n\tclient, err := api.NewClient(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn client.Agent().ServiceDeregister(srv.ServiceId)\n}\n\nfunc (srv *ServiceRegistryServer) logger() logrus.FieldLogger {\n\treturn logrus.\n\t\tWithField(\"module\", \"service_registry\").\n\t\tWithField(\"consul\", srv.ConsulAddress).\n\t\tWithField(\"service_name\", srv.ServiceName).\n\t\tWithField(\"service_id\", srv.ServiceId).\n\t\tWithField(\"ip\", srv.Ip).WithField(\"port\", srv.Port)\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage etcd\n\nimport (\n\t\"context\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto Etcd\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context, createCallbackFunc, deleteCallbackFunc EventCallbackFunc) (*EtcdKV, error) {\n\n\tlogrus.Infof(\"Installing Etcd\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\tlogrus.Warnf(\"Etcd disenabled\")\n\t\treturn nil, nil\n\t}\n\n\tetcdKV, err := c.install(ctx, createCallbackFunc, deleteCallbackFunc)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed Etcd\")\n\n\treturn etcdKV, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context, createCallbackFunc, deleteCallbackFunc EventCallbackFunc) (*EtcdKV, error) {\n\tetcdKV := NewEtcdKV(\n\t\tEtcdConfig{\n\t\t\tAddresses: c.Proto.GetAddresses(),\n\t\t\tUserName:  c.Proto.GetUsername(),\n\t\t\tPassword:  c.Proto.GetPassword(),\n\t\t},\n\t\tWithDialTimeout(c.Proto.GetDialTimeout().AsDuration()),\n\t\tWithMaxCallRecvMsgSize(int(c.Proto.MaxCallRecvMsgSize)),\n\t\tWithMaxCallSendMsgSize(int(c.Proto.MaxCallSendMsgSize)),\n\t\tWithAutoSyncInterval(c.Proto.GetAutoSyncInterval().AsDuration()),\n\t\tWithWatchPaths(c.Proto.WatchPaths),\n\t\tWithWatchCreateCallbackFunc(createCallbackFunc),\n\t\tWithWatchDeleteCallbackFunc(deleteCallbackFunc),\n\t)\n\n\t_, err := etcdKV.GetKVUntil(\n\t\tctx,\n\t\tc.Proto.GetMaxWaitDuration().AsDuration(),\n\t\tc.Proto.GetFailAfterDuration().AsDuration(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tetcdKV.Watch(ctx)\n\treturn etcdKV, nil\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage etcd\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage etcd\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/etcd.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage etcd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"sync\"\n\t\"time\"\n\n\tclientv3 \"go.etcd.io/etcd/client/v3\"\n\t\"go.etcd.io/etcd/client/v3/concurrency\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype EventCallbackFunc func(ctx context.Context, key, value string)\n\nvar (\n\tetcdKV ETCDKV\n\tmu     sync.Mutex\n)\n\n// Default values for Etcd.\nconst (\n\tDefaultDialTimeout = 5 * time.Second\n\tDefaultLockTTL     = 15 * time.Second\n)\n\ntype EtcdConfig struct {\n\tAddresses []string\n\tUserName  string\n\tPassword  string\n}\n\ntype EtcdKVOptions struct {\n\tDialTimeout        time.Duration\n\tMaxCallSendMsgSize int\n\tMaxCallRecvMsgSize int\n\tAutoSyncInterval   time.Duration\n\n\tLockPrefixPath     string\n\tLockKey            string\n\tLockTTL            time.Duration\n\tWatchPaths         []string\n\tCreateCallbackFunc EventCallbackFunc\n\tDeleteCallbackFunc EventCallbackFunc\n}\n\ntype EtcdKV struct {\n\tConf EtcdConfig\n\t*clientv3.Client\n\n\tsession *concurrency.Session\n\tmutex   *concurrency.Mutex\n\n\topts EtcdKVOptions\n}\n\nfunc NewEtcdKV(conf EtcdConfig, opts ...EtcdKVOption) *EtcdKV {\n\tkv := &EtcdKV{\n\t\tConf: conf,\n\t}\n\tkv.ApplyOptions(opts...)\n\tif kv.opts.DialTimeout == 0 {\n\t\tkv.opts.DialTimeout = DefaultDialTimeout\n\t}\n\tif kv.opts.LockTTL == 0 {\n\t\tkv.opts.LockTTL = DefaultLockTTL\n\t}\n\n\treturn kv\n}\n\nfunc GetKV() *clientv3.Client {\n\treturn etcdKV.Load()\n}\n\nfunc CloseKV() error {\n\tif etcdKV.Load() == nil {\n\t\treturn nil\n\t}\n\n\treturn etcdKV.Load().Close()\n}\n\nfunc (d *EtcdKV) GetKV(ctx context.Context) (*clientv3.Client, error) {\n\tif d.Client != nil {\n\t\treturn d.Client, nil\n\t}\n\n\tif len(d.Conf.Addresses) == 0 {\n\t\treturn nil, fmt.Errorf(\"invalid etcd address\")\n\t}\n\tlogrus.Infof(\"dialTimeout: %v\", d.opts.DialTimeout)\n\n\tkv, err := clientv3.New(clientv3.Config{\n\t\tEndpoints:          d.Conf.Addresses,\n\t\tContext:            ctx,\n\t\tUsername:           d.Conf.UserName,\n\t\tPassword:           d.Conf.Password,\n\t\tMaxCallRecvMsgSize: d.opts.MaxCallRecvMsgSize,\n\t\tMaxCallSendMsgSize: d.opts.MaxCallSendMsgSize,\n\t\tAutoSyncInterval:   d.opts.AutoSyncInterval,\n\t\tDialTimeout:        d.opts.DialTimeout,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx, cancel := context.WithTimeout(ctx, d.opts.DialTimeout)\n\tdefer cancel()\n\tstatus, err := kv.Status(ctx, d.Conf.Addresses[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"kv status: %v\", status)\n\n\td.Client = kv\n\tetcdKV.Store(kv)\n\n\treturn kv, nil\n}\n\nfunc (d *EtcdKV) GetKVUntil(\n\tctx context.Context,\n\tmaxWaitInterval time.Duration,\n\tfailAfter time.Duration,\n) (*clientv3.Client, error) {\n\tvar kv *clientv3.Client\n\texp := time_.NewExponentialBackOff(\n\t\ttime_.WithExponentialBackOffOptionMaxInterval(maxWaitInterval),\n\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(failAfter),\n\t)\n\terr := time_.BackOffUntilWithContext(ctx, func(ctx context.Context) (err_ error) {\n\t\tkv, err_ = d.GetKV(ctx)\n\t\tif err_ != nil {\n\t\t\treturn err_\n\t\t}\n\t\treturn nil\n\t}, exp, true, false)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get etcd fail after: %v\", failAfter)\n\t}\n\n\treturn kv, nil\n\n}\n\nfunc (d *EtcdKV) Watch(ctx context.Context) {\n\tfor _, path := range d.opts.WatchPaths {\n\t\tfmt.Printf(\"watch path: %v\\n\", path)\n\t\tWatch(ctx, d.Client, path, d.opts.CreateCallbackFunc, d.opts.DeleteCallbackFunc)\n\t}\n}\n\nfunc (d *EtcdKV) Close() error {\n\tif d.Client == nil {\n\t\treturn fmt.Errorf(\"no etcd pool\")\n\t}\n\treturn d.Client.Close()\n}\n\nfunc (d *EtcdKV) Lock(ctx context.Context, opts ...EtcdKVOption) error {\n\td.ApplyOptions(opts...)\n\n\tlockTTL := d.opts.LockTTL\n\tsession, err := concurrency.NewSession(d.Client, concurrency.WithContext(ctx), concurrency.WithTTL(int(lockTTL.Seconds())))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tkeyPath := filepath.Join(d.opts.LockPrefixPath, d.opts.LockKey)\n\tmutex := concurrency.NewMutex(session, keyPath)\n\tif err := mutex.Lock(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tgo func() {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tlogrus.Infof(\"lock[%v]'s context is done, err: %v\", keyPath, ctx.Err())\n\t\tcase <-session.Done():\n\t\t\tlogrus.Infof(\"lock[%v]'s session is done\", keyPath)\n\t\t}\n\n\t}()\n\n\td.session = session\n\td.mutex = mutex\n\n\treturn nil\n}\n\nfunc (d *EtcdKV) Unlock(ctx context.Context) error {\n\tif d.mutex == nil {\n\t\treturn fmt.Errorf(\"lock mutx is nil\")\n\t}\n\terr := d.mutex.Unlock(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn d.session.Close()\n}\n\nfunc (d *EtcdKV) TxPipelined(ctx context.Context, cmps []clientv3.Cmp, doOps, elOps []clientv3.Op) error {\n\ttxn := d.Client.Txn(ctx)\n\tresp, err := txn.If(cmps...).Then(doOps...).Else(elOps...).Commit()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif resp.Succeeded {\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"condition not meet, run else ops in transaction\")\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/etcd.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage etcd\n\nimport (\n\t\"time\"\n)\n\nfunc WithDialTimeout(dialTimeout time.Duration) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.DialTimeout = dialTimeout\n\t})\n}\n\nfunc WithMaxCallRecvMsgSize(msgSize int) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.MaxCallRecvMsgSize = msgSize\n\t})\n}\n\nfunc WithMaxCallSendMsgSize(msgSize int) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.MaxCallSendMsgSize = msgSize\n\t})\n}\n\nfunc WithAutoSyncInterval(autoSyncInterval time.Duration) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.AutoSyncInterval = autoSyncInterval\n\t})\n}\n\nfunc WithWatchPaths(paths []string) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.WatchPaths = paths\n\t})\n}\n\nfunc WithWatchCreateCallbackFunc(f EventCallbackFunc) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.CreateCallbackFunc = f\n\t})\n}\n\nfunc WithWatchDeleteCallbackFunc(f EventCallbackFunc) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.DeleteCallbackFunc = f\n\t})\n}\n\nfunc WithLockTTL(ttl time.Duration) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.LockTTL = ttl\n\t})\n}\n\nfunc WithLockPrefixPath(prefix string) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.LockPrefixPath = prefix\n\t})\n}\n\nfunc WithLockKey(key string) EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(c *EtcdKV) {\n\t\tc.opts.LockKey = key\n\t})\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/etcd.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v4.24.2\n// source: pkg/discovery/etcd/etcd.proto\n\npackage etcd\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tdurationpb \"google.golang.org/protobuf/types/known/durationpb\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Etcd struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled            bool     `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tAddresses          []string `protobuf:\"bytes,2,rep,name=addresses,proto3\" json:\"addresses,omitempty\"`\n\tUsername           string   `protobuf:\"bytes,3,opt,name=username,proto3\" json:\"username,omitempty\"`\n\tPassword           string   `protobuf:\"bytes,4,opt,name=password,proto3\" json:\"password,omitempty\"`\n\tMaxCallSendMsgSize int32    `protobuf:\"varint,5,opt,name=max_call_send_msg_size,json=maxCallSendMsgSize,proto3\" json:\"max_call_send_msg_size,omitempty\"` //If 0, it defaults to 2.0 MiB (2 * 1024 * 1024)\n\t// MaxCallRecvMsgSize is the client-side response receive limit.\n\t// If 0, it defaults to \"math.MaxInt32\", because range response can\n\t// easily exceed request send limits.\n\t// Make sure that \"MaxCallRecvMsgSize\" >= server-side default\n\t// send/recv limit.\n\t// (\"--max-request-bytes\" flag to etcd or\n\t// \"embed.Config.MaxRequestBytes\").\n\tMaxCallRecvMsgSize int32 `protobuf:\"varint,6,opt,name=max_call_recv_msg_size,json=maxCallRecvMsgSize,proto3\" json:\"max_call_recv_msg_size,omitempty\"`\n\t// AutoSyncInterval is the interval to update endpoints with its latest members.\n\t// 0 disables auto-sync. By default auto-sync is disabled.\n\tAutoSyncInterval  *durationpb.Duration `protobuf:\"bytes,7,opt,name=auto_sync_interval,json=autoSyncInterval,proto3\" json:\"auto_sync_interval,omitempty\"`\n\tDialTimeout       *durationpb.Duration `protobuf:\"bytes,8,opt,name=dial_timeout,json=dialTimeout,proto3\" json:\"dial_timeout,omitempty\"`\n\tMaxWaitDuration   *durationpb.Duration `protobuf:\"bytes,12,opt,name=max_wait_duration,json=maxWaitDuration,proto3\" json:\"max_wait_duration,omitempty\"`\n\tFailAfterDuration *durationpb.Duration `protobuf:\"bytes,13,opt,name=fail_after_duration,json=failAfterDuration,proto3\" json:\"fail_after_duration,omitempty\"`\n\tWatchPaths        []string             `protobuf:\"bytes,14,rep,name=watch_paths,json=watchPaths,proto3\" json:\"watch_paths,omitempty\"`\n}\n\nfunc (x *Etcd) Reset() {\n\t*x = Etcd{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_discovery_etcd_etcd_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Etcd) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Etcd) ProtoMessage() {}\n\nfunc (x *Etcd) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_discovery_etcd_etcd_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Etcd.ProtoReflect.Descriptor instead.\nfunc (*Etcd) Descriptor() ([]byte, []int) {\n\treturn file_pkg_discovery_etcd_etcd_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Etcd) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Etcd) GetAddresses() []string {\n\tif x != nil {\n\t\treturn x.Addresses\n\t}\n\treturn nil\n}\n\nfunc (x *Etcd) GetUsername() string {\n\tif x != nil {\n\t\treturn x.Username\n\t}\n\treturn \"\"\n}\n\nfunc (x *Etcd) GetPassword() string {\n\tif x != nil {\n\t\treturn x.Password\n\t}\n\treturn \"\"\n}\n\nfunc (x *Etcd) GetMaxCallSendMsgSize() int32 {\n\tif x != nil {\n\t\treturn x.MaxCallSendMsgSize\n\t}\n\treturn 0\n}\n\nfunc (x *Etcd) GetMaxCallRecvMsgSize() int32 {\n\tif x != nil {\n\t\treturn x.MaxCallRecvMsgSize\n\t}\n\treturn 0\n}\n\nfunc (x *Etcd) GetAutoSyncInterval() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.AutoSyncInterval\n\t}\n\treturn nil\n}\n\nfunc (x *Etcd) GetDialTimeout() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.DialTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Etcd) GetMaxWaitDuration() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.MaxWaitDuration\n\t}\n\treturn nil\n}\n\nfunc (x *Etcd) GetFailAfterDuration() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.FailAfterDuration\n\t}\n\treturn nil\n}\n\nfunc (x *Etcd) GetWatchPaths() []string {\n\tif x != nil {\n\t\treturn x.WatchPaths\n\t}\n\treturn nil\n}\n\nvar File_pkg_discovery_etcd_etcd_proto protoreflect.FileDescriptor\n\nvar file_pkg_discovery_etcd_etcd_proto_rawDesc = []byte{\n\t0x0a, 0x1d, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f,\n\t0x65, 0x74, 0x63, 0x64, 0x2f, 0x65, 0x74, 0x63, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,\n\t0x15, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72,\n\t0x79, 0x2e, 0x65, 0x74, 0x63, 0x64, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,\n\t0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x04, 0x0a, 0x04, 0x45, 0x74, 0x63, 0x64, 0x12,\n\t0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,\n\t0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64,\n\t0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64,\n\t0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e,\n\t0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e,\n\t0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18,\n\t0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12,\n\t0x32, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x73, 0x65, 0x6e, 0x64,\n\t0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,\n\t0x12, 0x6d, 0x61, 0x78, 0x43, 0x61, 0x6c, 0x6c, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53,\n\t0x69, 0x7a, 0x65, 0x12, 0x32, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f,\n\t0x72, 0x65, 0x63, 0x76, 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20,\n\t0x01, 0x28, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x63, 0x76,\n\t0x4d, 0x73, 0x67, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x47, 0x0a, 0x12, 0x61, 0x75, 0x74, 0x6f, 0x5f,\n\t0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20,\n\t0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,\n\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10,\n\t0x61, 0x75, 0x74, 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,\n\t0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,\n\t0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t0x6e, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x45,\n\t0x0a, 0x11, 0x6d, 0x61, 0x78, 0x5f, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74,\n\t0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67,\n\t0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61,\n\t0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x57, 0x61, 0x69, 0x74, 0x44, 0x75, 0x72,\n\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x13, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x66,\n\t0x74, 0x65, 0x72, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01,\n\t0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x66,\n\t0x61, 0x69, 0x6c, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18,\n\t0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, 0x74, 0x68,\n\t0x73, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x64, 0x69,\n\t0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x74, 0x63, 0x64, 0x3b, 0x65, 0x74, 0x63,\n\t0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_discovery_etcd_etcd_proto_rawDescOnce sync.Once\n\tfile_pkg_discovery_etcd_etcd_proto_rawDescData = file_pkg_discovery_etcd_etcd_proto_rawDesc\n)\n\nfunc file_pkg_discovery_etcd_etcd_proto_rawDescGZIP() []byte {\n\tfile_pkg_discovery_etcd_etcd_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_discovery_etcd_etcd_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_discovery_etcd_etcd_proto_rawDescData)\n\t})\n\treturn file_pkg_discovery_etcd_etcd_proto_rawDescData\n}\n\nvar file_pkg_discovery_etcd_etcd_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_pkg_discovery_etcd_etcd_proto_goTypes = []interface{}{\n\t(*Etcd)(nil),                // 0: go.pkg.discovery.etcd.Etcd\n\t(*durationpb.Duration)(nil), // 1: google.protobuf.Duration\n}\nvar file_pkg_discovery_etcd_etcd_proto_depIdxs = []int32{\n\t1, // 0: go.pkg.discovery.etcd.Etcd.auto_sync_interval:type_name -> google.protobuf.Duration\n\t1, // 1: go.pkg.discovery.etcd.Etcd.dial_timeout:type_name -> google.protobuf.Duration\n\t1, // 2: go.pkg.discovery.etcd.Etcd.max_wait_duration:type_name -> google.protobuf.Duration\n\t1, // 3: go.pkg.discovery.etcd.Etcd.fail_after_duration:type_name -> google.protobuf.Duration\n\t4, // [4:4] is the sub-list for method output_type\n\t4, // [4:4] is the sub-list for method input_type\n\t4, // [4:4] is the sub-list for extension type_name\n\t4, // [4:4] is the sub-list for extension extendee\n\t0, // [0:4] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_discovery_etcd_etcd_proto_init() }\nfunc file_pkg_discovery_etcd_etcd_proto_init() {\n\tif File_pkg_discovery_etcd_etcd_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_discovery_etcd_etcd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Etcd); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_discovery_etcd_etcd_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_discovery_etcd_etcd_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_discovery_etcd_etcd_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_discovery_etcd_etcd_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_discovery_etcd_etcd_proto = out.File\n\tfile_pkg_discovery_etcd_etcd_proto_rawDesc = nil\n\tfile_pkg_discovery_etcd_etcd_proto_goTypes = nil\n\tfile_pkg_discovery_etcd_etcd_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/etcd.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.discovery.etcd;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.discovery.etcd;etcd\";\n\nmessage Etcd {\n  bool enabled = 1;\n  repeated string addresses = 2;\n  string username = 3;\n  string password = 4;\n  int32 max_call_send_msg_size = 5; //If 0, it defaults to 2.0 MiB (2 * 1024 * 1024)\n\n  // MaxCallRecvMsgSize is the client-side response receive limit.\n  // If 0, it defaults to \"math.MaxInt32\", because range response can\n  // easily exceed request send limits.\n  // Make sure that \"MaxCallRecvMsgSize\" >= server-side default\n  // send/recv limit.\n  // (\"--max-request-bytes\" flag to etcd or\n  // \"embed.Config.MaxRequestBytes\").\n  int32 max_call_recv_msg_size = 6; \n\t// AutoSyncInterval is the interval to update endpoints with its latest members.\n\t// 0 disables auto-sync. By default auto-sync is disabled.\n  google.protobuf.Duration auto_sync_interval = 7;\n\n  google.protobuf.Duration dial_timeout = 8;\n\n  google.protobuf.Duration max_wait_duration = 12;\n  google.protobuf.Duration fail_after_duration = 13;\n\n  repeated string watch_paths = 14;\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/etcd.watch.go",
    "content": "package etcd\n\nimport (\n\t\"context\"\n\n\t\"go.etcd.io/etcd/api/v3/mvccpb\"\n\tclientv3 \"go.etcd.io/etcd/client/v3\"\n)\n\nfunc Watch(ctx context.Context, kv *clientv3.Client, key string, createCallbackFunc, deleteCallbackFunc EventCallbackFunc) {\n\tch := kv.Watch(ctx, key, clientv3.WithPrefix(), clientv3.WithCreatedNotify())\n\tgo func() error {\n\t\tfor resp := range ch {\n\t\t\tfor _, event := range resp.Events {\n\t\t\t\tswitch event.Type {\n\t\t\t\tcase mvccpb.PUT:\n\t\t\t\t\tif createCallbackFunc != nil {\n\t\t\t\t\t\tcreateCallbackFunc(ctx, string(event.Kv.Key), string(event.Kv.Value))\n\t\t\t\t\t}\n\t\t\t\tcase mvccpb.DELETE:\n\t\t\t\t\tif deleteCallbackFunc != nil {\n\t\t\t\t\t\tdeleteCallbackFunc(ctx, string(event.Kv.Key), string(event.Kv.Value))\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}()\n\n\treturn\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/etcd.yaml",
    "content": "discovery:\n  etcd:\n     enabled: true\n     addresses: \n       - \"9.135.121.151:2379\"\n     username: \"\"\n     password: \"\"\n     max_call_send_msg_size: 0 \n     max_call_recv_msg_size: 0\n     auto_sync_interval: 0s\n     dial_timeout: 5s\n     max_wait_duration: 20s\n     fail_after_duration: 60s\n     watch_paths: \n       - \"foo\"\n"
  },
  {
    "path": "pkg/discovery/etcd/etcd_options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage etcd\n\n// A EtcdKVOption sets options.\ntype EtcdKVOption interface {\n\tapply(*EtcdKV)\n}\n\n// EmptyEtcdKVUrlOption does not alter the EtcdKVuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyEtcdKVOption struct{}\n\nfunc (EmptyEtcdKVOption) apply(*EtcdKV) {}\n\n// EtcdKVOptionFunc wraps a function that modifies EtcdKV into an\n// implementation of the EtcdKVOption interface.\ntype EtcdKVOptionFunc func(*EtcdKV)\n\nfunc (f EtcdKVOptionFunc) apply(do *EtcdKV) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _EtcdKVOptionWithDefault() EtcdKVOption {\n\treturn EtcdKVOptionFunc(func(*EtcdKV) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *EtcdKV) ApplyOptions(options ...EtcdKVOption) *EtcdKV {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/etcd_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage etcd_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\tetcd_ \"github.com/kaydxh/golang/pkg/discovery/etcd\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/stretchr/testify/assert\"\n\tclientv3 \"go.etcd.io/etcd/client/v3\"\n)\n\nfunc TestGetKV(t *testing.T) {\n\ttestCases := []struct {\n\t\tAddresses []string\n\t}{\n\t\t{\n\t\t\tAddresses: []string{\"9.135.121.151:2379\"},\n\t\t},\n\t}\n\n\tctx := context.Background()\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"name-%d\", i), func(t *testing.T) {\n\t\t\tkv := etcd_.NewEtcdKV(etcd_.EtcdConfig{\n\t\t\t\tAddresses: testCase.Addresses,\n\t\t\t})\n\t\t\tetcdKV, err := kv.GetKV(ctx)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to get kv: %v, got : %s\", testCase.Addresses, err)\n\t\t\t}\n\t\t\tassert.NotNil(t, etcdKV)\n\t\t})\n\t}\n\n}\n\nfunc TestGetKVUntil(t *testing.T) {\n\ttestCases := []struct {\n\t\tAddresses   []string\n\t\tDailTimeout time.Duration\n\t}{\n\t\t{\n\t\t\tAddresses:   []string{\"9.135.121.151:2379\"},\n\t\t\tDailTimeout: 3 * time.Second,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"name-%d\", i), func(t *testing.T) {\n\t\t\tdb := etcd_.NewEtcdKV(etcd_.EtcdConfig{\n\t\t\t\tAddresses: testCase.Addresses,\n\t\t\t}, etcd_.WithDialTimeout(testCase.DailTimeout))\n\t\t\tsqlDB, err := db.GetKVUntil(context.Background(), 5*time.Second, 20*time.Second)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to get kv: %v, got : %s\", testCase.Addresses, err)\n\t\t\t}\n\t\t\tassert.NotNil(t, sqlDB)\n\t\t})\n\t}\n\n}\n\nfunc CreateCallback(ctx context.Context, key, value string) {\n\tlogrus.Infof(\"create key: %v, value: %v\", key, value)\n}\n\nfunc DeleteCallback(ctx context.Context, key, value string) {\n\tlogrus.Infof(\"delete key: %v, value: %v\", key, value)\n}\n\nfunc InstallEtcd(ctx context.Context) (*etcd_.EtcdKV, error) {\n\tcfgFile := \"./etcd.yaml\"\n\tconfig := etcd_.NewConfig(etcd_.WithViper(viper_.GetViper(cfgFile, \"discovery.etcd\")))\n\n\tkv, err := config.Complete().New(ctx, CreateCallback, DeleteCallback)\n\tif err != nil {\n\t\tlogrus.Errorf(\"failed to new config err: %v\", err)\n\t\treturn nil, err\n\t}\n\n\treturn kv, nil\n\n}\n\nfunc TestNew(t *testing.T) {\n\n\tctx := context.Background()\n\tkv, err := InstallEtcd(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t\treturn\n\t}\n\t_ = kv\n\tkv.Lock(ctx, etcd_.WithLockKey(\"/kay/lock\"), etcd_.WithLockTTL(15*time.Second))\n\tkv.Lock(ctx, etcd_.WithLockKey(\"/kay/lock1\"), etcd_.WithLockTTL(15*time.Second))\n\n\ttime.Sleep(20 * time.Second)\n\n\t// only unlock the latest lock /kay/lock1\n\tkv.Unlock(ctx)\n\tkv.TxPipelined(ctx, nil, []clientv3.Op{clientv3.OpPut(\"foo\", \"foo_new_value\")}, nil)\n\t/*\n\t\tgo func() {\n\t\t\tt.Logf(\"before lock by routine 1\")\n\t\t\tkv.Lock(ctx, \"kay/lock\", 15*time.Second)\n\t\t\tt.Logf(\"after lock by routine 1\")\n\t\t}()\n\t*/\n\n\tselect {}\n}\n\nfunc TestTxPipelined(t *testing.T) {\n\tctx := context.Background()\n\tkv, err := InstallEtcd(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t\treturn\n\t}\n\tkv.TxPipelined(ctx, nil, []clientv3.Op{clientv3.OpPut(\"foo\", \"foo_new_value\")}, nil)\n}\n"
  },
  {
    "path": "pkg/discovery/etcd/etcd_type.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage etcd\n\nimport (\n\t\"sync/atomic\"\n\n\tclientv3 \"go.etcd.io/etcd/client/v3\"\n)\n\ntype ETCDKV atomic.Value\n\n//check type ETCDKV* whether to implement interface of atomic.Value\n//var _ atomic.Value = (*ETCDKV)(nil)\n\n//check type ETCDKV whether to implement interface of atomic.Value\n//var _ atomic.Value = ETCDKV{}\n\nfunc (m *ETCDKV) Store(value *clientv3.Client) {\n\t(*atomic.Value)(m).Store(value)\n}\n\nfunc (m *ETCDKV) Load() *clientv3.Client {\n\tvalue := (*atomic.Value)(m).Load()\n\tif value == nil {\n\t\treturn nil\n\t}\n\treturn value.(*clientv3.Client)\n}\n"
  },
  {
    "path": "pkg/discovery/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/discovery\n\ngo 1.25.3\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/hashicorp/consul/api v1.33.0\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgithub.com/stretchr/testify v1.11.1\n\tgo.etcd.io/etcd/api/v3 v3.6.0-alpha.0\n\tgo.etcd.io/etcd/client/v3 v3.6.0-alpha.0\n\tgo.uber.org/atomic v1.11.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/armon/go-metrics v0.4.1 // indirect\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/coreos/go-semver v0.3.1 // indirect\n\tgithub.com/coreos/go-systemd/v22 v22.5.0 // indirect\n\tgithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect\n\tgithub.com/fatih/color v1.16.0 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/gogo/protobuf v1.3.2 // indirect\n\tgithub.com/golang/protobuf v1.5.4 // indirect\n\tgithub.com/google/btree v1.1.3 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/hashicorp/errwrap v1.1.0 // indirect\n\tgithub.com/hashicorp/go-cleanhttp v0.5.2 // indirect\n\tgithub.com/hashicorp/go-hclog v1.5.0 // indirect\n\tgithub.com/hashicorp/go-immutable-radix v1.3.1 // indirect\n\tgithub.com/hashicorp/go-multierror v1.1.1 // indirect\n\tgithub.com/hashicorp/go-rootcerts v1.0.2 // indirect\n\tgithub.com/hashicorp/golang-lru v0.5.4 // indirect\n\tgithub.com/hashicorp/serf v0.10.1 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/mattn/go-colorable v0.1.13 // indirect\n\tgithub.com/mattn/go-isatty v0.0.20 // indirect\n\tgithub.com/mitchellh/go-homedir v1.1.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.etcd.io/etcd/client/pkg/v3 v3.6.6 // indirect\n\tgo.uber.org/multierr v1.11.0 // indirect\n\tgo.uber.org/zap v1.27.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n)\n"
  },
  {
    "path": "pkg/discovery/go.sum",
    "content": "github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=\ngithub.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=\ngithub.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=\ngithub.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=\ngithub.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=\ngithub.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=\ngithub.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=\ngithub.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA=\ngithub.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=\ngithub.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=\ngithub.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=\ngithub.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=\ngithub.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=\ngithub.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=\ngithub.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=\ngithub.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=\ngithub.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=\ngithub.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=\ngithub.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=\ngithub.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=\ngithub.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=\ngithub.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=\ngithub.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=\ngithub.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=\ngithub.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=\ngithub.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=\ngithub.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=\ngithub.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=\ngithub.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=\ngithub.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=\ngithub.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=\ngithub.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=\ngithub.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=\ngithub.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/hashicorp/consul/api v1.33.0 h1:MnFUzN1Bo6YDGi/EsRLbVNgA4pyCymmcswrE5j4OHBM=\ngithub.com/hashicorp/consul/api v1.33.0/go.mod h1:vLz2I/bqqCYiG0qRHGerComvbwSWKswc8rRFtnYBrIw=\ngithub.com/hashicorp/consul/sdk v0.17.0 h1:N/JigV6y1yEMfTIhXoW0DXUecM2grQnFuRpY7PcLHLI=\ngithub.com/hashicorp/consul/sdk v0.17.0/go.mod h1:8dgIhY6VlPUprRH7o7UenVuFEgq017qUn3k9wS5mCt4=\ngithub.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=\ngithub.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=\ngithub.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=\ngithub.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=\ngithub.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=\ngithub.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=\ngithub.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=\ngithub.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=\ngithub.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=\ngithub.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=\ngithub.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=\ngithub.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=\ngithub.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=\ngithub.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=\ngithub.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=\ngithub.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=\ngithub.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=\ngithub.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=\ngithub.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=\ngithub.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=\ngithub.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=\ngithub.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=\ngithub.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc=\ngithub.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=\ngithub.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=\ngithub.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=\ngithub.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=\ngithub.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=\ngithub.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=\ngithub.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI=\ngithub.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=\ngithub.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=\ngithub.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=\ngithub.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=\ngithub.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=\ngithub.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc=\ngithub.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM=\ngithub.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0=\ngithub.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY=\ngithub.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=\ngithub.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=\ngithub.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=\ngithub.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=\ngithub.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=\ngithub.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=\ngithub.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=\ngithub.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=\ngithub.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=\ngithub.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=\ngithub.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=\ngithub.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=\ngithub.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=\ngithub.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=\ngithub.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=\ngithub.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=\ngithub.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=\ngithub.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=\ngithub.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=\ngithub.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=\ngithub.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=\ngithub.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=\ngithub.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=\ngithub.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=\ngithub.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY=\ngithub.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=\ngithub.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=\ngithub.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=\ngithub.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=\ngithub.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=\ngithub.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=\ngithub.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=\ngithub.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=\ngithub.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=\ngithub.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=\ngithub.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=\ngithub.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=\ngithub.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=\ngithub.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=\ngithub.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\ngithub.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\ngithub.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=\ngithub.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=\ngithub.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=\ngithub.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=\ngithub.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=\ngithub.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=\ngithub.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=\ngithub.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=\ngithub.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=\ngithub.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngithub.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngo.etcd.io/etcd/api/v3 v3.6.0-alpha.0 h1:se+XckWlVTTfwjZSsAZJ2zGPzmIMq3j7fKBCmHoB9UA=\ngo.etcd.io/etcd/api/v3 v3.6.0-alpha.0/go.mod h1:z13pg39zewDLZeXIKeM0xELOeFKcqjLocfwl5M820+w=\ngo.etcd.io/etcd/client/pkg/v3 v3.6.6 h1:uoqgzSOv2H9KlIF5O1Lsd8sW+eMLuV6wzE3q5GJGQNs=\ngo.etcd.io/etcd/client/pkg/v3 v3.6.6/go.mod h1:YngfUVmvsvOJ2rRgStIyHsKtOt9SZI2aBJrZiWJhCbI=\ngo.etcd.io/etcd/client/v3 v3.6.0-alpha.0 h1:hHaJ8CvTPJ9iv7xPz3G0gxt3csEqJW8evgty/kYICwo=\ngo.etcd.io/etcd/client/v3 v3.6.0-alpha.0/go.mod h1:a9JuChoQBDnw7WclHYBYCtTOIC12Wwj+Fw0LX4TI/Gs=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=\ngo.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=\ngo.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=\ngo.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=\ngo.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=\ngo.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=\ngolang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=\ngolang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 h1:zfMcR1Cs4KNuomFFgGefv5N0czO2XZpUbxGUy8i8ug0=\ngolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0=\ngolang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=\ngolang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=\ngolang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=\ngolang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\n"
  },
  {
    "path": "pkg/file-cleanup/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filecleanup\n\nimport (\n\t\"context\"\n\n\t\"github.com/go-playground/validator/v10\"\n\tdisk_ \"github.com/kaydxh/golang/pkg/file-cleanup/disk\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\n// Config ...\ntype Config struct {\n\tProto disk_.DiskCleaner\n\n\tValidator *validator.Validate\n\topts      struct {\n\t\t// If set, overrides params below\n\t\tviper       *viper.Viper\n\t\tdiskOptions []disk_.DiskCleanerConfigOption\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\n// CompletedConfig ...\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context) (*disk_.DiskCleanerSerivce, error) {\n\n\tlogrus.Infof(\"Installing DiskCleanerSerivce\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\treturn nil, nil\n\t}\n\n\trs, err := c.install(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed Crontab\")\n\n\treturn rs, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context) (*disk_.DiskCleanerSerivce, error) {\n\n\topts := []disk_.DiskCleanerConfigOption{\n\t\tdisk_.WithDiskCheckInterval(c.Proto.GetCheckInterval().AsDuration()),\n\t\tdisk_.WithDiskBaseExpired(c.Proto.GetBaseExpired().AsDuration()),\n\t\tdisk_.WithDiskMinExpired(c.Proto.GetMinExpired().AsDuration()),\n\t}\n\topts = append(opts, c.opts.diskOptions...)\n\n\treturn disk_.NewDiskCleanerSerivce(\n\t\tc.Proto.GetDiskUsage(),\n\t\tc.Proto.GetPaths(),\n\t\tc.Proto.GetExts(),\n\t\topts...,\n\t)\n}\n\n// Validate checks Config.\nfunc (c *completedConfig) Validate() error {\n\treturn c.Validator.Struct(c)\n}\n\n// Complete fills in any fields not set that are required to have valid data and can be derived\n// from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.\nfunc (c *Config) Complete(options ...ConfigOption) CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\tc.ApplyOptions(options...)\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\n// NewConfig returns a Config struct with the default values\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/file-cleanup/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filecleanup\n\nimport (\n\tdisk_ \"github.com/kaydxh/golang/pkg/file-cleanup/disk\"\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n\nfunc WithDiskUsageCallBack(f func(diskPath string, diskUsage float32)) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.diskOptions = append(c.opts.diskOptions, disk_.WithDiskUsageCallBack(f))\n\t})\n}\n\nfunc WithCleanPostCallBack(f func(file string, err error)) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.diskOptions = append(c.opts.diskOptions, disk_.WithCleanPostCallBack(f))\n\t})\n}\n"
  },
  {
    "path": "pkg/file-cleanup/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filecleanup\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/file-cleanup/disk/disk_cleaner.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage disk\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/kaydxh/golang/go/errors\"\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\tfilepath_ \"github.com/kaydxh/golang/go/path/filepath\"\n\tstrings_ \"github.com/kaydxh/golang/go/strings\"\n\tsyscall_ \"github.com/kaydxh/golang/go/syscall\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"github.com/sirupsen/logrus\"\n\t\"go.uber.org/atomic\"\n)\n\nvar (\n\tworkDir string\n)\n\nfunc init() {\n\tworkDir, _ = os.Getwd()\n}\n\nconst (\n\tDefaultCheckInterval       time.Duration = time.Minute\n\tDefaultbaseExpired         time.Duration = 72 * time.Hour\n\tDefalutRandomizationFactor               = 0.1\n\tDefalutMultiplier                        = 0.8\n\tDefalutMinInterval                       = time.Minute\n)\n\ntype DiskCleanerConfig struct {\n\tcheckInterval     time.Duration\n\tbaseExpired       time.Duration\n\tminExpired        time.Duration\n\tdiskUsageCallBack func(diskPath string, diskUsage float32)\n\tcleanPostCallBack func(file string, err error)\n}\n\n// DiskCleanerSerivce ...\ntype DiskCleanerSerivce struct {\n\t// path:ExponentialBackOffMap\n\tepoByPath time_.ExponentialBackOffMap\n\texts      []string\n\t//0-100\n\tdiskUsage  float32\n\tinShutdown atomic.Bool // true when when server is in shutdown\n\n\topts DiskCleanerConfig\n\n\tmu     sync.Mutex\n\tcancel func()\n}\n\nfunc checkAndCanoicalzePaths(paths ...string) ([]string, bool) {\n\tvar canPaths []string\n\tfor _, path := range paths {\n\t\tabsPath, err := filepath_.CanonicalizePath(path)\n\t\tif err != nil {\n\n\t\t\tfmt.Printf(\"err: %v\\n\", err)\n\t\t\treturn nil, false\n\t\t}\n\n\t\tif absPath == \"\" || absPath == \"/\" || absPath == workDir {\n\t\t\treturn nil, false\n\t\t}\n\t\tcanPaths = append(canPaths, absPath)\n\t}\n\n\treturn canPaths, true\n\n}\n\n// NewDiskCleanerSerivce ...\nfunc NewDiskCleanerSerivce(\n\tdiskUsage float32,\n\tpaths []string,\n\texts []string,\n\topts ...DiskCleanerConfigOption,\n) (*DiskCleanerSerivce, error) {\n\tcanPaths, ok := checkAndCanoicalzePaths(paths...)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid paths for disk cheaner\")\n\t}\n\n\tif diskUsage < 0 {\n\t\tdiskUsage = 0\n\t}\n\tif diskUsage > 100 {\n\t\tdiskUsage = 100\n\t}\n\n\tif len(exts) == 0 {\n\t\treturn nil, fmt.Errorf(\"invalid exts for disk cleaner\")\n\t}\n\n\ts := &DiskCleanerSerivce{\n\t\tdiskUsage: diskUsage,\n\t\texts:      exts,\n\t}\n\ts.opts.ApplyOptions(opts...)\n\n\tif s.opts.checkInterval == 0 {\n\t\ts.opts.checkInterval = DefaultCheckInterval\n\t}\n\tif s.opts.minExpired == 0 {\n\t\ts.opts.minExpired = DefalutMinInterval\n\t}\n\tif s.opts.baseExpired == 0 {\n\t\ts.opts.baseExpired = DefaultbaseExpired\n\t}\n\n\tfor _, path := range canPaths {\n\t\texp := time_.NewExponentialBackOff(\n\t\t\ttime_.WithExponentialBackOffOptionInitialInterval(s.opts.baseExpired),\n\t\t\ttime_.WithExponentialBackOffOptionRandomizationFactor(DefalutRandomizationFactor),\n\t\t\ttime_.WithExponentialBackOffOptionMultiplier(DefalutMultiplier),\n\t\t\ttime_.WithExponentialBackOffOptionMaxInterval(s.opts.baseExpired),\n\t\t\ttime_.WithExponentialBackOffOptionMinInterval(s.opts.minExpired),\n\t\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(0),\n\t\t)\n\n\t\ts.epoByPath.Store(path, *exp)\n\t}\n\tfmt.Printf(\"s: %+v\\n\", s)\n\treturn s, nil\n}\n\nfunc (s *DiskCleanerSerivce) getLogger() *logrus.Entry {\n\treturn logrus.WithField(\"module\", \"DiskCleaner\")\n}\n\n// Run will initialize the backend. It must not block, but may run go routines in the background.\nfunc (s *DiskCleanerSerivce) Run(ctx context.Context) error {\n\tlogger := s.getLogger()\n\tlogger.Infoln(\"DiskCleaner Run\")\n\tif s.inShutdown.Load() {\n\t\tlogger.Infoln(\"DiskCleaner Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\tgo func() {\n\t\terrors.HandleError(s.Serve(ctx))\n\t}()\n\treturn nil\n}\n\n// Serve ...\nfunc (s *DiskCleanerSerivce) Serve(ctx context.Context) error {\n\tlogger := s.getLogger()\n\tlogger.Infoln(\"DiskCleaner Serve\")\n\n\tif s.inShutdown.Load() {\n\t\tlogger.Infoln(\"DiskCleaner Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\n\tdefer s.inShutdown.Store(true)\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\ts.mu.Lock()\n\ts.cancel = cancel\n\ts.mu.Unlock()\n\n\ttime_.UntilWithContxt(ctx, func(ctx context.Context) error {\n\t\terr := s.clean(ctx)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"failed to clean\")\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}, s.opts.checkInterval)\n\tif err := ctx.Err(); err != nil {\n\t\tlogger.WithError(err).Errorf(\"stopped checking\")\n\t\treturn err\n\t}\n\tlogger.Info(\"stopped checking\")\n\treturn nil\n}\n\nfunc (s *DiskCleanerSerivce) clean(ctx context.Context) error {\n\n\tvar (\n\t\twg   sync.WaitGroup\n\t\terrs []error\n\t)\n\n\tlogger := s.getLogger()\n\ts.epoByPath.Range(func(path string, ebo time_.ExponentialBackOff) bool {\n\t\twg.Add(1)\n\t\tgo func(diskPath string, ebo time_.ExponentialBackOff) {\n\t\t\tdefer wg.Done()\n\t\t\tdu, err := syscall_.NewDiskUsage(diskPath)\n\t\t\tif err != nil {\n\t\t\t\ts.mu.Lock()\n\t\t\t\terrs = append(errs, err)\n\t\t\t\ts.mu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif s.opts.diskUsageCallBack != nil {\n\t\t\t\ts.opts.diskUsageCallBack(diskPath, du.Usage())\n\t\t\t}\n\n\t\t\tif du.Usage() >= s.diskUsage {\n\t\t\t\t//clean\n\t\t\t\tlogger.Infof(\n\t\t\t\t\t\"disk[%v] usage over %v, file expired: %v, start to clean\",\n\t\t\t\t\tdiskPath,\n\t\t\t\t\ts.diskUsage,\n\t\t\t\t\tebo.GetCurrentInterval(),\n\t\t\t\t)\n\t\t\t\tactualExpired, _ := ebo.NextBackOff()\n\t\t\t\tfilepath.Walk(diskPath, func(filePath string, info os.FileInfo, err error) error {\n\n\t\t\t\t\tif !info.IsDir() {\n\t\t\t\t\t\tif strings_.SliceContainsCaseInSensitive(s.exts, filepath.Ext(filePath)) {\n\t\t\t\t\t\t\tnow := time.Now()\n\t\t\t\t\t\t\tif now.Sub(info.ModTime()) > actualExpired {\n\t\t\t\t\t\t\t\tlogger.Infof(\n\t\t\t\t\t\t\t\t\t\"delete file %v expired[%v], modify time: %v, now: %v\",\n\t\t\t\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\t\t\t\tactualExpired,\n\t\t\t\t\t\t\t\t\tinfo.ModTime(),\n\t\t\t\t\t\t\t\t\tnow,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\terr = os.Remove(filePath)\n\t\t\t\t\t\t\t\tif s.opts.cleanPostCallBack != nil {\n\t\t\t\t\t\t\t\t\ts.opts.cleanPostCallBack(filePath, err)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn nil\n\t\t\t\t})\n\n\t\t\t} else {\n\t\t\t\t// reset expired Time\n\t\t\t\tebo.Reset()\n\t\t\t\tlogger.Debugf(\"reset disk path: %v expired time: %v\", diskPath, ebo.GetCurrentInterval())\n\t\t\t}\n\t\t\ts.epoByPath.Store(diskPath, ebo)\n\n\t\t}(path, ebo)\n\n\t\treturn true\n\t})\n\twg.Wait()\n\treturn errors_.NewAggregate(errs)\n}\n\n// Shutdown ...\nfunc (s *DiskCleanerSerivce) Shutdown() {\n\ts.inShutdown.Store(true)\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tif s.cancel != nil {\n\t\ts.cancel()\n\t}\n}\n"
  },
  {
    "path": "pkg/file-cleanup/disk/disk_cleaner.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage disk\n\nimport (\n\t\"time\"\n)\n\nfunc WithDiskCheckInterval(interval time.Duration) DiskCleanerConfigOption {\n\treturn DiskCleanerConfigOptionFunc(func(c *DiskCleanerConfig) {\n\t\tc.checkInterval = interval\n\t})\n}\n\nfunc WithDiskBaseExpired(expired time.Duration) DiskCleanerConfigOption {\n\treturn DiskCleanerConfigOptionFunc(func(c *DiskCleanerConfig) {\n\t\tc.baseExpired = expired\n\t})\n}\n\nfunc WithDiskMinExpired(expired time.Duration) DiskCleanerConfigOption {\n\treturn DiskCleanerConfigOptionFunc(func(c *DiskCleanerConfig) {\n\t\tc.minExpired = expired\n\t})\n}\n\nfunc WithDiskUsageCallBack(f func(diskPath string, diskUsage float32)) DiskCleanerConfigOption {\n\treturn DiskCleanerConfigOptionFunc(func(c *DiskCleanerConfig) {\n\t\tc.diskUsageCallBack = f\n\t})\n}\n\nfunc WithCleanPostCallBack(f func(file string, err error)) DiskCleanerConfigOption {\n\treturn DiskCleanerConfigOptionFunc(func(c *DiskCleanerConfig) {\n\t\tc.cleanPostCallBack = f\n\t})\n}\n"
  },
  {
    "path": "pkg/file-cleanup/disk/disk_cleaner.pb.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.27.0\n// \tprotoc        v3.13.0\n// source: pkg/file-cleanup/disk/disk_cleaner.proto\n\npackage disk\n\nimport (\n\tduration \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype DiskCleaner struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled bool `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\t// disk usage >= disk_usage, start to clean file, 0 means nerver clean, range\n\t// 0-100\n\tDiskUsage float32 `protobuf:\"fixed32,2,opt,name=disk_usage,json=diskUsage,proto3\" json:\"disk_usage,omitempty\"`\n\t// clearn paths\n\tPaths []string `protobuf:\"bytes,3,rep,name=paths,proto3\" json:\"paths,omitempty\"`\n\t// ext\n\tExts          []string           `protobuf:\"bytes,4,rep,name=exts,proto3\" json:\"exts,omitempty\"`\n\tCheckInterval *duration.Duration `protobuf:\"bytes,5,opt,name=check_interval,json=checkInterval,proto3\" json:\"check_interval,omitempty\"`\n\tBaseExpired   *duration.Duration `protobuf:\"bytes,6,opt,name=base_expired,json=baseExpired,proto3\" json:\"base_expired,omitempty\"`\n\tMinExpired    *duration.Duration `protobuf:\"bytes,7,opt,name=min_expired,json=minExpired,proto3\" json:\"min_expired,omitempty\"`\n}\n\nfunc (x *DiskCleaner) Reset() {\n\t*x = DiskCleaner{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_file_cleanup_disk_disk_cleaner_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *DiskCleaner) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DiskCleaner) ProtoMessage() {}\n\nfunc (x *DiskCleaner) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_file_cleanup_disk_disk_cleaner_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use DiskCleaner.ProtoReflect.Descriptor instead.\nfunc (*DiskCleaner) Descriptor() ([]byte, []int) {\n\treturn file_pkg_file_cleanup_disk_disk_cleaner_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *DiskCleaner) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *DiskCleaner) GetDiskUsage() float32 {\n\tif x != nil {\n\t\treturn x.DiskUsage\n\t}\n\treturn 0\n}\n\nfunc (x *DiskCleaner) GetPaths() []string {\n\tif x != nil {\n\t\treturn x.Paths\n\t}\n\treturn nil\n}\n\nfunc (x *DiskCleaner) GetExts() []string {\n\tif x != nil {\n\t\treturn x.Exts\n\t}\n\treturn nil\n}\n\nfunc (x *DiskCleaner) GetCheckInterval() *duration.Duration {\n\tif x != nil {\n\t\treturn x.CheckInterval\n\t}\n\treturn nil\n}\n\nfunc (x *DiskCleaner) GetBaseExpired() *duration.Duration {\n\tif x != nil {\n\t\treturn x.BaseExpired\n\t}\n\treturn nil\n}\n\nfunc (x *DiskCleaner) GetMinExpired() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MinExpired\n\t}\n\treturn nil\n}\n\nvar File_pkg_file_cleanup_disk_disk_cleaner_proto protoreflect.FileDescriptor\n\nvar file_pkg_file_cleanup_disk_disk_cleaner_proto_rawDesc = []byte{\n\t0x0a, 0x28, 0x70, 0x6b, 0x67, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x63, 0x6c, 0x65, 0x61, 0x6e,\n\t0x75, 0x70, 0x2f, 0x64, 0x69, 0x73, 0x6b, 0x2f, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x63, 0x6c, 0x65,\n\t0x61, 0x6e, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x67, 0x6f, 0x2e, 0x70,\n\t0x6b, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x2e, 0x64,\n\t0x69, 0x73, 0x6b, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x22, 0xac, 0x02, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x6b, 0x43, 0x6c, 0x65, 0x61,\n\t0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01,\n\t0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1d, 0x0a,\n\t0x0a, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,\n\t0x02, 0x52, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05,\n\t0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x74,\n\t0x68, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x78, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09,\n\t0x52, 0x04, 0x65, 0x78, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f,\n\t0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,\n\t0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,\n\t0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x68, 0x65, 0x63, 0x6b,\n\t0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x0c, 0x62, 0x61, 0x73, 0x65,\n\t0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,\n\t0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,\n\t0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x62, 0x61, 0x73, 0x65, 0x45,\n\t0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x65, 0x78,\n\t0x70, 0x69, 0x72, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f,\n\t0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75,\n\t0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72,\n\t0x65, 0x64, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,\n\t0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x66,\n\t0x69, 0x6c, 0x65, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x2e, 0x64, 0x69, 0x73, 0x6b, 0x3b,\n\t0x64, 0x69, 0x73, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_file_cleanup_disk_disk_cleaner_proto_rawDescOnce sync.Once\n\tfile_pkg_file_cleanup_disk_disk_cleaner_proto_rawDescData = file_pkg_file_cleanup_disk_disk_cleaner_proto_rawDesc\n)\n\nfunc file_pkg_file_cleanup_disk_disk_cleaner_proto_rawDescGZIP() []byte {\n\tfile_pkg_file_cleanup_disk_disk_cleaner_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_file_cleanup_disk_disk_cleaner_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_file_cleanup_disk_disk_cleaner_proto_rawDescData)\n\t})\n\treturn file_pkg_file_cleanup_disk_disk_cleaner_proto_rawDescData\n}\n\nvar file_pkg_file_cleanup_disk_disk_cleaner_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_pkg_file_cleanup_disk_disk_cleaner_proto_goTypes = []interface{}{\n\t(*DiskCleaner)(nil),       // 0: go.pkg.filecleanup.disk.DiskCleaner\n\t(*duration.Duration)(nil), // 1: google.protobuf.Duration\n}\nvar file_pkg_file_cleanup_disk_disk_cleaner_proto_depIdxs = []int32{\n\t1, // 0: go.pkg.filecleanup.disk.DiskCleaner.check_interval:type_name -> google.protobuf.Duration\n\t1, // 1: go.pkg.filecleanup.disk.DiskCleaner.base_expired:type_name -> google.protobuf.Duration\n\t1, // 2: go.pkg.filecleanup.disk.DiskCleaner.min_expired:type_name -> google.protobuf.Duration\n\t3, // [3:3] is the sub-list for method output_type\n\t3, // [3:3] is the sub-list for method input_type\n\t3, // [3:3] is the sub-list for extension type_name\n\t3, // [3:3] is the sub-list for extension extendee\n\t0, // [0:3] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_file_cleanup_disk_disk_cleaner_proto_init() }\nfunc file_pkg_file_cleanup_disk_disk_cleaner_proto_init() {\n\tif File_pkg_file_cleanup_disk_disk_cleaner_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_file_cleanup_disk_disk_cleaner_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*DiskCleaner); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_file_cleanup_disk_disk_cleaner_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_file_cleanup_disk_disk_cleaner_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_file_cleanup_disk_disk_cleaner_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_file_cleanup_disk_disk_cleaner_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_file_cleanup_disk_disk_cleaner_proto = out.File\n\tfile_pkg_file_cleanup_disk_disk_cleaner_proto_rawDesc = nil\n\tfile_pkg_file_cleanup_disk_disk_cleaner_proto_goTypes = nil\n\tfile_pkg_file_cleanup_disk_disk_cleaner_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/file-cleanup/disk/disk_cleaner.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.filecleanup.disk;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.filecleanup.disk;disk\";\n\nmessage DiskCleaner {\n  bool enabled = 1;\n  // disk usage >= disk_usage, start to clean file, 0 means nerver clean, range\n  // 0-100\n  float disk_usage = 2;\n  // clearn paths\n  repeated string paths = 3;\n  // ext\n  repeated string exts = 4;\n  google.protobuf.Duration check_interval = 5;\n  google.protobuf.Duration base_expired = 6;\n  google.protobuf.Duration min_expired = 7;\n}\n"
  },
  {
    "path": "pkg/file-cleanup/disk/disk_cleaner_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage disk\n\n// A DiskCleanerConfigOption sets options.\ntype DiskCleanerConfigOption interface {\n\tapply(*DiskCleanerConfig)\n}\n\n// EmptyDiskCleanerConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyDiskCleanerConfigOption struct{}\n\nfunc (EmptyDiskCleanerConfigOption) apply(*DiskCleanerConfig) {}\n\n// DiskCleanerConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the DiskCleanerConfigOption interface.\ntype DiskCleanerConfigOptionFunc func(*DiskCleanerConfig)\n\nfunc (f DiskCleanerConfigOptionFunc) apply(do *DiskCleanerConfig) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _DiskCleanerConfigOptionWithDefault() DiskCleanerConfigOption {\n\treturn DiskCleanerConfigOptionFunc(func(*DiskCleanerConfig) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *DiskCleanerConfig) ApplyOptions(options ...DiskCleanerConfigOption) *DiskCleanerConfig {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/file-cleanup/disk_cleaner_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filecleanup_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\n\tfilecleanup_ \"github.com/kaydxh/golang/pkg/file-cleanup\"\n)\n\nfunc diskUsageCallBack(diskPath string, diskUsage float32) {\n\tfmt.Printf(\"diskUsageCallBack diskPath: %v, diskUsage: %v\\n\", diskPath, diskUsage)\n}\n\nfunc TestDiskCleanerSerivce(t *testing.T) {\n\tcfgFile := \"./diskcleaner.yaml\"\n\tconfig := filecleanup_.NewConfig(\n\t\tfilecleanup_.WithViper(viper_.GetViper(cfgFile, \"diskcleaner\")),\n\t\tfilecleanup_.WithDiskUsageCallBack(diskUsageCallBack),\n\t)\n\ts, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Fatalf(\"failed to new config err: %v\", err)\n\t}\n\ts.Run(context.Background())\n\n\ttime.Sleep(1 * time.Minute)\n\n}\n"
  },
  {
    "path": "pkg/file-cleanup/diskcleaner.yaml",
    "content": "diskcleaner:\n  enabled: true\n  disk_usage: 85\n  paths: [ \"/data\" ] \n  exts: [\".jpg\"]\n  check_interval: 60s\n  base_expired : 518400s # 144h\n  min_expired: 60s\n"
  },
  {
    "path": "pkg/file-cleanup/file_cleaner.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filecleanup\n\nimport (\n\t\"os\"\n\t\"sort\"\n\t\"time\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\tfilepath_ \"github.com/kaydxh/golang/go/path/filepath\"\n)\n\ntype FileCleaner struct {\n\t//filedir string\n\t//pattern string\n\t//maxAge is the maximum number of time to retain old files, 0 is unlimited\n\tmaxAge time.Duration\n\t//maxCount is the maximum number to retain old files, 0 is unlimited\n\tmaxCount int64\n}\n\nfunc FileCleanup(pattern string, options ...FileCleanerOption) error {\n\tvar cleaner FileCleaner\n\tcleaner.ApplyOptions(options...)\n\n\tmatches, err := filepath_.Glob(pattern)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnow := time.Now()\n\n\tremoveMatches := make([]string, 0, len(matches))\n\tfor _, path := range matches {\n\t\tfi, err := os.Stat(path)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// maxAge 0 is unlimited\n\t\tif cleaner.maxAge <= 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif now.Sub(fi.ModTime()) < cleaner.maxAge {\n\t\t\tcontinue\n\t\t}\n\n\t\tremoveMatches = append(removeMatches, path)\n\t}\n\n\tif cleaner.maxCount > 0 {\n\t\tif cleaner.maxCount < int64(len(matches)) {\n\n\t\t\tremoveCount := len(matches) - int(cleaner.maxCount) - len(removeMatches)\n\t\t\tif removeCount > 0 {\n\t\t\t\tsort.Sort(RotatedFiles(matches))\n\t\t\t\tremoveMatches = append(\n\t\t\t\t\tremoveMatches,\n\t\t\t\t\tmatches[len(removeMatches):len(removeMatches)+removeCount]...,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t}\n\n\t//clean\n\tvar errs []error\n\tfor _, file := range removeMatches {\n\t\terr = os.Remove(file)\n\t\tif err != nil {\n\t\t\terrs = append(errs, err)\n\t\t}\n\t}\n\n\treturn errors_.NewAggregate(errs)\n}\n\ntype RotatedFiles []string\n\nfunc (f RotatedFiles) Len() int {\n\treturn len(f)\n}\n\nfunc (f RotatedFiles) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\nfunc (f RotatedFiles) Less(i, j int) bool {\n\tfi, err := os.Stat(f[i])\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tfj, err := os.Stat(f[j])\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tif fi.ModTime().Equal(fj.ModTime()) {\n\t\tif len(f[i]) == len(f[j]) {\n\t\t\treturn f[i] < f[j]\n\t\t}\n\n\t\treturn len(f[i]) < len(f[j]) //  foo.9  < foo.10\n\t}\n\n\treturn fi.ModTime().Before(fj.ModTime())\n\n}\n"
  },
  {
    "path": "pkg/file-cleanup/file_cleaner.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filecleanup\n\nimport (\n\t\"time\"\n)\n\nfunc WithMaxAge(maxAge time.Duration) FileCleanerOption {\n\treturn FileCleanerOptionFunc(func(c *FileCleaner) {\n\t\tc.maxAge = maxAge\n\t})\n}\n\nfunc WithMaxCount(maxCount int64) FileCleanerOption {\n\treturn FileCleanerOptionFunc(func(c *FileCleaner) {\n\t\tc.maxCount = maxCount\n\t})\n}\n"
  },
  {
    "path": "pkg/file-cleanup/file_cleaner_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filecleanup\n\n// A FileCleanerOption sets options.\ntype FileCleanerOption interface {\n\tapply(*FileCleaner)\n}\n\n// EmptyFileCleanerOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyFileCleanerOption struct{}\n\nfunc (EmptyFileCleanerOption) apply(*FileCleaner) {}\n\n// FileCleanerOptionFunc wraps a function that modifies Client into an\n// implementation of the FileCleanerOption interface.\ntype FileCleanerOptionFunc func(*FileCleaner)\n\nfunc (f FileCleanerOptionFunc) apply(do *FileCleaner) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _FileCleanerOptionWithDefault() FileCleanerOption {\n\treturn FileCleanerOptionFunc(func(*FileCleaner) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *FileCleaner) ApplyOptions(options ...FileCleanerOption) *FileCleaner {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/file-cleanup/file_cleaner_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filecleanup_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\tfilecleanup_ \"github.com/kaydxh/golang/pkg/file-cleanup\"\n)\n\nfunc TestFileCleanupWithMaxAge(t *testing.T) {\n\n\terr := filecleanup_.FileCleanup(\n\t\t\"/Users/kayxhding/workspace/studyspace/git-kayxhding/github.com/kaydxh/golang/pkg/file-cleanup/log/*\",\n\t\tfilecleanup_.WithMaxAge(time.Second),\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"faild to FileCleanup, err: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "pkg/file-cleanup/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/file-cleanup\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/go-playground/validator/v10 v10.28.0\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgo.uber.org/atomic v1.11.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n"
  },
  {
    "path": "pkg/file-cleanup/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\n"
  },
  {
    "path": "pkg/file-rotate/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/file-rotate\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nreplace github.com/kaydxh/golang/pkg/file-cleanup => ../file-cleanup\n\nrequire (\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/golang/protobuf v1.5.4 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/spf13/viper v1.21.0 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.uber.org/atomic v1.11.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n\tgoogle.golang.org/protobuf v1.36.10 // indirect\n)\n"
  },
  {
    "path": "pkg/file-rotate/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\n"
  },
  {
    "path": "pkg/file-rotate/rotate_file.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rotatefile\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\tfilepath_ \"github.com/kaydxh/golang/go/path/filepath\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tcleanup_ \"github.com/kaydxh/golang/pkg/file-cleanup\"\n)\n\ntype EventCallbackFunc func(ctx context.Context, path string)\n\ntype RotateFiler struct {\n\tfile        *os.File\n\tfiledir     string\n\tcurFilepath string\n\tseq         uint64\n\tlinkpath    string\n\tmu          sync.Mutex\n\topts        struct {\n\t\tprefixName     string\n\t\tfileTimeLayout string //default \"20060102150405\" ,take effect if rotateInterval  > 0\n\n\t\tsubfixName string\n\t\t//maxAge is the maximum number of time to retain old files, 0 is unlimited\n\t\tmaxAge time.Duration\n\t\t//maxCount is the maximum number to retain old files, 0 is unlimited\n\t\tmaxCount int64\n\n\t\t//rotate file when file size larger than rotateSize\n\t\trotateSize int64\n\t\t//rotate file in rotateInterval\n\t\trotateInterval     time.Duration\n\t\tsyncInterval       time.Duration\n\t\trotateCallbackFunc EventCallbackFunc\n\t}\n}\n\nfunc NewRotateFiler(filedir string, options ...RotateFilerOption) (*RotateFiler, error) {\n\tr := &RotateFiler{\n\t\tfiledir: filedir,\n\t}\n\tr.ApplyOptions(options...)\n\n\tif r.linkpath == \"\" {\n\t\tr.linkpath = filepath.Base(os.Args[0]) + \".log\"\n\t}\n\n\t// if need rotate file with rotateInterval, set default timelayout\n\tif r.opts.rotateInterval > 0 {\n\t\tif r.opts.fileTimeLayout == \"\" {\n\t\t\tr.opts.fileTimeLayout = time_.ShortTimeFormat\n\t\t}\n\t}\n\n\tif r.opts.rotateCallbackFunc != nil {\n\t\tif r.opts.syncInterval == 0 {\n\t\t\tr.opts.syncInterval = 30 * time.Second\n\t\t}\n\t\tgo r.watch()\n\t}\n\n\treturn r, nil\n}\n\n// /data/log/1%%%AA20160304 -> /data/log/1*A20160304*\nfunc globFromFileTimeLayout(filePath string) string {\n\tregexps := []*regexp.Regexp{\n\t\tregexp.MustCompile(`%[%+A-Za-z]`),\n\t\tregexp.MustCompile(`\\*+`),\n\t}\n\n\tfor _, re := range regexps {\n\t\tfilePath = re.ReplaceAllString(filePath, \"*\")\n\t}\n\treturn filePath + \"*\"\n}\n\nfunc (f *RotateFiler) Write(p []byte) (file *os.File, n int, err error) {\n\tf.mu.Lock()\n\tdefer f.mu.Unlock()\n\n\tout, err := f.getWriterNolock(int64(len(p)))\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\tn, err = out.Write(p)\n\treturn f.file, n, err\n}\n\nfunc (f *RotateFiler) WriteBytesLine(p [][]byte) (file *os.File, n int, err error) {\n\n\tvar data []byte\n\tfor _, d := range p {\n\t\tdata = append(data, d...)\n\t\tdata = append(data, '\\n')\n\t}\n\treturn f.Write(data)\n}\n\nfunc (f *RotateFiler) generateRotateFilename() string {\n\tif f.opts.rotateInterval > 0 {\n\t\tnow := time.Now()\n\t\treturn time_.TruncateToUTCString(now, f.opts.rotateInterval, f.opts.fileTimeLayout)\n\t}\n\treturn \"\"\n}\n\nfunc (f *RotateFiler) watch() {\n\ttimer := time.NewTicker(f.opts.syncInterval)\n\tdefer timer.Stop()\n\n\tfor {\n\t\tselect {\n\t\tcase <-timer.C:\n\t\t\tfunc() {\n\t\t\t\tf.mu.Lock()\n\t\t\t\tdefer f.mu.Unlock()\n\t\t\t\tf.getWriterNolock(0)\n\t\t\t}()\n\t\t}\n\t}\n}\n\nfunc (f *RotateFiler) getWriterNolock(length int64) (io.Writer, error) {\n\tbasename := f.generateRotateFilename()\n\tfilename := f.opts.prefixName + basename + f.opts.subfixName\n\tif filename == \"\" {\n\t\tfilename = \"default.log\"\n\t}\n\n\t// first rotate log file, maybe /data/logs/logs.test20210917230000.log\n\tfilePath := filepath.Join(f.filedir, filename)\n\tglobPath := filepath.Join(filepath.Dir(filePath), f.opts.prefixName)\n\n\t// current log file, maybe /data/logs/logs.test20210917230000.log.1\n\tif f.curFilepath == \"\" {\n\t\tf.curFilepath, _ = f.getCurSeqFilename(globPath)\n\t\tf.seq = f.extractSeq(f.curFilepath)\n\t}\n\n\t// if curFilePath is different rotated time with filename, need reset curFilePath\n\tif !strings.Contains(f.curFilepath, filename) {\n\t\tf.curFilepath = filePath\n\t\tf.seq = 0\n\t}\n\n\trotated := false\n\n\tfi, err := os.Stat(f.curFilepath)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn nil, fmt.Errorf(\"failed to get file info, err: %v\", err)\n\t\t}\n\t\t//file is not exist, think just like rotating file\n\t\trotated = true\n\t}\n\n\t//rotate file by size\n\tif err == nil && f.opts.rotateSize > 0 && (fi.Size()+length) > f.opts.rotateSize {\n\n\t\tf.curFilepath, err = f.generateNextSeqFilename(filePath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to generate rotate file name by seq, err: %v\", err)\n\t\t}\n\n\t\trotated = true\n\t}\n\n\tif f.file == nil || rotated {\n\t\tfn, err := os_.OpenFile(f.curFilepath, true)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create file: %v, err: %v\", f.curFilepath, err)\n\t\t}\n\n\t\tif f.file != nil {\n\t\t\t//callback\n\t\t\tif f.opts.rotateCallbackFunc != nil {\n\t\t\t\tf.opts.rotateCallbackFunc(context.Background(), f.file.Name())\n\t\t\t}\n\t\t\tf.file.Close()\n\t\t}\n\t\tf.file = fn\n\n\t\tf.seq = f.extractSeq(f.curFilepath)\n\n\t\tos_.SymLink(f.curFilepath, f.linkpath)\n\n\t\tglobFile := globFromFileTimeLayout(globPath)\n\n\t\tgo cleanup_.FileCleanup(globFile, cleanup_.WithMaxAge(f.opts.maxAge), cleanup_.WithMaxCount(f.opts.maxCount))\n\t}\n\n\treturn f.file, nil\n}\n\n//filename like foo foo.1 foo.2 ...\nfunc (f *RotateFiler) generateNextSeqFilename(filePath string) (string, error) {\n\n\tvar newFilePath string\n\tseq := f.seq\n\n\tfor {\n\t\tif seq == 0 {\n\t\t\tnewFilePath = filePath\n\t\t} else {\n\t\t\tnewFilePath = fmt.Sprintf(\"%s.%d\", filePath, seq)\n\t\t}\n\n\t\t_, err := os.Stat(newFilePath)\n\t\tif os.IsNotExist(err) {\n\t\t\tf.seq = seq\n\t\t\treturn newFilePath, nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\t//file exist, need to get next seq filename\n\t\tseq++\n\t}\n\n}\n\n// globPath: log/logs.test\n// globFile: [log/logs.test20211008081908.log log/logs.test20211008081908.log.1 log/logs.test20211008081908.log.2]\nfunc (f *RotateFiler) getCurSeqFilename(globPath string) (string, error) {\n\n\tglobFile := globFromFileTimeLayout(globPath)\n\tmatches, err := filepath_.Glob(globFile)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(matches) == 0 {\n\t\treturn globPath, nil\n\t}\n\n\tsort.Sort(cleanup_.RotatedFiles(matches))\n\treturn matches[len(matches)-1], nil\n}\n\nfunc (f *RotateFiler) extractSeq(filePath string) uint64 {\n\tif filePath == \"\" {\n\t\treturn 0\n\t}\n\n\text := filepath.Ext(filePath)\n\tif ext == \"\" {\n\t\treturn 0\n\t}\n\n\tseq, err := strconv.ParseUint(ext[1:], 10, 64)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn seq\n\n}\n"
  },
  {
    "path": "pkg/file-rotate/rotate_file.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rotatefile\n\nimport (\n\t\"time\"\n)\n\nfunc WithPrefixName(prefixName string) RotateFilerOption {\n\treturn RotateFilerOptionFunc(func(c *RotateFiler) {\n\t\tc.opts.prefixName = prefixName\n\t})\n}\n\nfunc WithFileTimeLayout(fileTimeLayout string) RotateFilerOption {\n\treturn RotateFilerOptionFunc(func(c *RotateFiler) {\n\t\tc.opts.fileTimeLayout = fileTimeLayout\n\t})\n}\n\nfunc WithSuffixName(subfixName string) RotateFilerOption {\n\treturn RotateFilerOptionFunc(func(c *RotateFiler) {\n\t\tc.opts.subfixName = subfixName\n\t})\n}\n\nfunc WithMaxAge(maxAge time.Duration) RotateFilerOption {\n\treturn RotateFilerOptionFunc(func(c *RotateFiler) {\n\t\tc.opts.maxAge = maxAge\n\t})\n}\n\nfunc WithMaxCount(maxCount int64) RotateFilerOption {\n\treturn RotateFilerOptionFunc(func(c *RotateFiler) {\n\t\tc.opts.maxCount = maxCount\n\t})\n}\n\nfunc WithRotateSize(rotateSize int64) RotateFilerOption {\n\treturn RotateFilerOptionFunc(func(c *RotateFiler) {\n\t\tc.opts.rotateSize = rotateSize\n\t})\n}\n\nfunc WithRotateInterval(rotateInterval time.Duration) RotateFilerOption {\n\treturn RotateFilerOptionFunc(func(c *RotateFiler) {\n\t\tc.opts.rotateInterval = rotateInterval\n\t})\n}\n\nfunc WithRotateCallback(callback EventCallbackFunc) RotateFilerOption {\n\treturn RotateFilerOptionFunc(func(c *RotateFiler) {\n\t\tc.opts.rotateCallbackFunc = callback\n\t})\n}\n"
  },
  {
    "path": "pkg/file-rotate/rotate_file_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rotatefile\n\n// A RotateFilerOption sets options.\ntype RotateFilerOption interface {\n\tapply(*RotateFiler)\n}\n\n// EmptyRotateFilerOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyRotateFilerOption struct{}\n\nfunc (EmptyRotateFilerOption) apply(*RotateFiler) {}\n\n// RotateFilerOptionFunc wraps a function that modifies Client into an\n// implementation of the RotateFilerOption interface.\ntype RotateFilerOptionFunc func(*RotateFiler)\n\nfunc (f RotateFilerOptionFunc) apply(do *RotateFiler) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _RotateFilerOptionWithDefault() RotateFilerOption {\n\treturn RotateFilerOptionFunc(func(*RotateFiler) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *RotateFiler) ApplyOptions(options ...RotateFilerOption) *RotateFiler {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/file-rotate/rotate_file_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage rotatefile_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"testing\"\n\t\"time\"\n\n\trotate_ \"github.com/kaydxh/golang/pkg/file-rotate\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc getWdOrDie() string {\n\tpath, err := os.Getwd()\n\tif err != nil {\n\t\tlogrus.Fatalf(\"failed to get wd, err: %v\", err)\n\t}\n\n\treturn path\n}\n\nfunc TestRotateFileWithInterval(t *testing.T) {\n\n\trotateFiler, _ := rotate_.NewRotateFiler(\n\t\tfilepath.Join(getWdOrDie(), \"log\"),\n\t\trotate_.WithRotateInterval(time.Second),\n\t\trotate_.WithSuffixName(\".log\"),\n\t\trotate_.WithPrefixName(filepath.Base(os.Args[0])),\n\t)\n\n\tfor i := 0; i < 10; i++ {\n\t\t_, n, err := rotateFiler.Write([]byte(\"hello word\"))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"faild to write, err: %v\", err)\n\t\t}\n\t\ttime.Sleep(1 * time.Second)\n\t\tt.Logf(\"successed to write %v bytes\", n)\n\t}\n\n}\n\nfunc TestRotateFileWithIntervalAndSize(t *testing.T) {\n\n\trotateFiler, _ := rotate_.NewRotateFiler(\n\t\tfilepath.Join(getWdOrDie(), \"log\"),\n\t\trotate_.WithRotateInterval(time.Hour),\n\t\trotate_.WithRotateSize(15),\n\t\trotate_.WithSuffixName(\".log\"),\n\t\trotate_.WithPrefixName(filepath.Base(os.Args[0])),\n\t)\n\n\tfor i := 0; i < 0; i++ {\n\t\t_, n, err := rotateFiler.Write([]byte(\"hello word\"))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"faild to write, err: %v\", err)\n\t\t}\n\t\ttime.Sleep(time.Second)\n\t\tt.Logf(\"successed to write %v bytes\", n)\n\t}\n\n}\n\nfunc TestRotateFileWithSize(t *testing.T) {\n\n\trotateFiler, _ := rotate_.NewRotateFiler(\n\t\tfilepath.Join(getWdOrDie(), \"log\"),\n\t\trotate_.WithRotateSize(10),\n\t\trotate_.WithRotateInterval(15*time.Second),\n\t\trotate_.WithSuffixName(\".log\"),\n\t\trotate_.WithPrefixName(filepath.Base(os.Args[0])),\n\t\trotate_.WithRotateCallback(func(ctx context.Context, path string) {\n\t\t\tt.Logf(\"=======callback path: %v\", path)\n\t\t}),\n\t)\n\n\tfor i := 0; i < 5; i++ {\n\t\t//_, n, err := rotateFiler.Write([]byte(\"hello word\"))\n\t\t_, n, err := rotateFiler.WriteBytesLine([][]byte{[]byte(\"hello word\")})\n\t\tif err != nil {\n\t\t\tt.Errorf(\"faild to write, err: %v\", err)\n\t\t}\n\t\ttime.Sleep(time.Second)\n\t\tt.Logf(\"successed to write %v bytes\", n)\n\t}\n\n\tselect {}\n\n}\n\nfunc TestRotateMaxCount(t *testing.T) {\n\n\trotateFiler, _ := rotate_.NewRotateFiler(\n\t\tfilepath.Join(getWdOrDie(), \"log\"),\n\t\trotate_.WithRotateSize(15),\n\t\trotate_.WithMaxCount(5),\n\t\trotate_.WithSuffixName(\".log\"),\n\t\trotate_.WithPrefixName(filepath.Base(os.Args[0])),\n\t)\n\n\tfor i := 0; i < 10; i++ {\n\t\t_, n, err := rotateFiler.Write([]byte(\"hello word\"))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"faild to write, err: %v\", err)\n\t\t}\n\t\ttime.Sleep(time.Second)\n\t\tt.Logf(\"successed to write %v bytes\", n)\n\t}\n\n}\n\nfunc TestRegex(t *testing.T) {\n\tvar regexps = []*regexp.Regexp{\n\t\tregexp.MustCompile(`%[%+A-Za-z]`),\n\t\tregexp.MustCompile(`\\*+`),\n\t}\n\tglobPattern := \"1%%%AA20160304\"\n\tfor _, re := range regexps {\n\t\tglobPattern = re.ReplaceAllString(globPattern, \"*\")\n\t\tfmt.Printf(\"re: %v , globPattern: %v\\n\", re, globPattern)\n\t}\n\t//\treturn globPattern + `*`\n}\n"
  },
  {
    "path": "pkg/file-transfer/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filetransfer\n\nimport (\n\t\"context\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto Ft\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context) (*FileTransfer, error) {\n\n\tlogrus.Infof(\"Installing FileTransfer\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\treturn nil, nil\n\t}\n\n\trs, err := c.install(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed FileTransfer\")\n\n\treturn rs, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context) (*FileTransfer, error) {\n\tft := NewFileTransfer(\n\t\tWithDownloadTimeout(c.Proto.GetDownloadTimeout().AsDuration()),\n\t\tWithLoadBalanceMode(c.Proto.LoadBalanceMode),\n\t\tWithProxies(c.Proto.Proxies),\n\t\tWithRetryTimes(int(c.Proto.RetryTimes)),\n\t\tWithRetryInterval(c.Proto.RetryInterval.AsDuration()),\n\t)\n\treturn ft, nil\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/file-transfer/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filetransfer\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/file-transfer/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filetransfer\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/file-transfer/file.transfer.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filetransfer\n\nimport (\n\t\"context\"\n\t\"math/rand\"\n\t\"time\"\n\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\t\"go.opentelemetry.io/otel\"\n)\n\ntype FileTransferOptions struct {\n\t// 0 means no timeout\n\tdownloadTimeout time.Duration\n\tuploadTimeout   time.Duration\n\tloadBalanceMode Ft_LoadBalanceMode\n\tretryTimes      int\n\t// retry interval, 0 means retry immediately\n\tretryInterval time.Duration\n\n\tproxies []*Ft_Proxy\n}\n\nfunc defaultFileTransferOptions() FileTransferOptions {\n\treturn FileTransferOptions{}\n}\n\ntype FileTransfer struct {\n\topts FileTransferOptions\n}\n\nfunc NewFileTransfer(opts ...FileTransferOption) *FileTransfer {\n\tft := &FileTransfer{}\n\tft.ApplyOptions(opts...)\n\n\treturn ft\n}\n\nfunc (f *FileTransfer) getProxy() *Ft_Proxy {\n\tproxies := f.opts.proxies\n\tif len(proxies) == 0 {\n\t\treturn &Ft_Proxy{}\n\t}\n\n\tswitch f.opts.loadBalanceMode {\n\tcase Ft_load_balance_mode_random:\n\t\treturn proxies[rand.Intn(len(proxies))]\n\tdefault:\n\t\treturn proxies[0]\n\t}\n}\n\n// short connection\nfunc (f *FileTransfer) Download(ctx context.Context, downloadUrl string) (data []byte, err error) {\n\tspanName := \"Download\"\n\tctx, span := otel.Tracer(\"\").Start(ctx, spanName)\n\tdefer span.End()\n\n\tlogger := logs_.GetLogger(ctx)\n\tlogger = logger.WithField(\"trace_id\", span.SpanContext().TraceID()).WithField(\"span_id\", span.SpanContext().SpanID()).WithField(\"download_url\", downloadUrl)\n\n\tproxy := f.getProxy()\n\n\topts := []http_.ClientOption{http_.WithDisableKeepAlives(true)}\n\tif proxy.TargetHost != \"\" {\n\t\topts = append(opts, http_.WithTargetHost(proxy.TargetHost))\n\t} else {\n\n\t\tif proxy.ProxyUrl != \"\" {\n\t\t\topts = append(opts, http_.WithProxyURL(proxy.ProxyUrl))\n\t\t}\n\t\tif proxy.ProxyHost != \"\" {\n\t\t\topts = append(opts, http_.WithProxyHost(proxy.ProxyHost))\n\t\t}\n\t}\n\topts = append(opts, http_.WithTimeout(f.opts.downloadTimeout))\n\n\terr = time_.RetryWithContext(ctx, func(ctx context.Context) error {\n\t\tclient, err := http_.NewClient(opts...)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"new http client err: %v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\tdata, err = client.Get(ctx, downloadUrl)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"http client get err: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\n\t}, f.opts.retryInterval, f.opts.retryTimes)\n\n\treturn data, err\n}\n\n// short connection\nfunc (f *FileTransfer) Upload(ctx context.Context, uploadUrl string, body []byte) (data []byte, err error) {\n\tspanName := \"Upload\"\n\tctx, span := otel.Tracer(\"\").Start(ctx, spanName)\n\tdefer span.End()\n\n\tlogger := logs_.GetLogger(ctx)\n\tlogger = logger.WithField(\"trace_id\", span.SpanContext().TraceID()).WithField(\"span_id\", span.SpanContext().SpanID()).WithField(\"upload_url\", uploadUrl)\n\n\tproxy := f.getProxy()\n\n\topts := []http_.ClientOption{http_.WithDisableKeepAlives(true)}\n\tif proxy.TargetHost != \"\" {\n\t\topts = append(opts, http_.WithTargetHost(proxy.TargetHost))\n\t} else {\n\n\t\tif proxy.ProxyUrl != \"\" {\n\t\t\topts = append(opts, http_.WithProxyURL(proxy.ProxyUrl))\n\t\t}\n\t\tif proxy.ProxyHost != \"\" {\n\t\t\topts = append(opts, http_.WithProxyHost(proxy.ProxyHost))\n\t\t}\n\t}\n\topts = append(opts, http_.WithTimeout(f.opts.uploadTimeout))\n\n\terr = time_.RetryWithContext(ctx, func(ctx context.Context) error {\n\t\tclient, err := http_.NewClient(opts...)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"new http client err: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\tdata, err = client.Put(ctx, uploadUrl, \"\", nil, body)\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"http client put err: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\n\t}, f.opts.retryInterval, f.opts.retryTimes)\n\n\treturn data, err\n}\n"
  },
  {
    "path": "pkg/file-transfer/file.transfer.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filetransfer\n\nimport \"time\"\n\nfunc WithDownloadTimeout(downloadTimeout time.Duration) FileTransferOption {\n\treturn FileTransferOptionFunc(func(r *FileTransfer) {\n\t\tr.opts.downloadTimeout = downloadTimeout\n\t})\n}\n\nfunc WithLoadBalanceMode(mode Ft_LoadBalanceMode) FileTransferOption {\n\treturn FileTransferOptionFunc(func(r *FileTransfer) {\n\t\tr.opts.loadBalanceMode = mode\n\t})\n}\n\nfunc WithProxies(proxies []*Ft_Proxy) FileTransferOption {\n\treturn FileTransferOptionFunc(func(r *FileTransfer) {\n\t\tr.opts.proxies = proxies\n\t})\n}\n\nfunc WithRetryTimes(retryTimes int) FileTransferOption {\n\treturn FileTransferOptionFunc(func(r *FileTransfer) {\n\t\tr.opts.retryTimes = retryTimes\n\t})\n}\n\nfunc WithRetryInterval(retryInterval time.Duration) FileTransferOption {\n\treturn FileTransferOptionFunc(func(r *FileTransfer) {\n\t\tr.opts.retryInterval = retryInterval\n\t})\n}\n"
  },
  {
    "path": "pkg/file-transfer/file.transfer_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filetransfer\n\n// A FileTransferOption sets options.\ntype FileTransferOption interface {\n\tapply(*FileTransfer)\n}\n\n// EmptyFileTransferUrlOption does not alter the FileTransferuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyFileTransferOption struct{}\n\nfunc (EmptyFileTransferOption) apply(*FileTransfer) {}\n\n// FileTransferOptionFunc wraps a function that modifies FileTransfer into an\n// implementation of the FileTransferOption interface.\ntype FileTransferOptionFunc func(*FileTransfer)\n\nfunc (f FileTransferOptionFunc) apply(do *FileTransfer) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _FileTransferOptionWithDefault() FileTransferOption {\n\treturn FileTransferOptionFunc(func(*FileTransfer) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *FileTransfer) ApplyOptions(options ...FileTransferOption) *FileTransfer {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/file-transfer/file.transfer_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage filetransfer_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\tfiletransfer_ \"github.com/kaydxh/golang/pkg/file-transfer\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n)\n\nfunc TestDownload(t *testing.T) {\n\tcfgFile := \"./ft.yaml\"\n\tconfig := filetransfer_.NewConfig(filetransfer_.WithViper(viper_.GetViper(cfgFile, \"filetransfer\")))\n\tft, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\ttestCases := []struct {\n\t\tUrl string\n\t}{\n\t\t{\n\t\t\tUrl: \"https://ai-media-1256936300.cos.ap-guangzhou.myqcloud.com/find.sh?q-sign-algorithm=sha1&q-ak=AKIDCDyve81SJuISPkMq0IukLg7tupWyoqCg&q-sign-time=1659955959;8640000001659870000&q-key-time=1659955959;8640000001659870000&q-header-list=&q-url-param-list=&q-signature=5695f17ee30c3cd2d37197c773a445eda8a70c8c\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tdata, err := ft.Download(context.Background(), testCase.Url)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to download: %v, got : %s\", testCase.Url, err)\n\t\t\t}\n\t\t\tt.Logf(\"data len: %v\", len(data))\n\t\t\tt.Logf(\"data : %v\", string(data))\n\t\t})\n\t}\n\n}\n\nfunc TestDownloadByProxy(t *testing.T) {\n\tcfgFile := \"./ft.yaml\"\n\tconfig := filetransfer_.NewConfig(filetransfer_.WithViper(viper_.GetViper(cfgFile, \"filetransfer\")))\n\tft, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\ttestCases := []struct {\n\t\tUrl string\n\t}{\n\t\t{\n\t\t\tUrl: \"http://quyujiaofu-new-1300074211.cos.ap-guangzhou.myqcloud.com/hk_test/480p.jpg\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tdata, err := ft.Download(context.Background(), testCase.Url)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to download: %v, got : %s\", testCase.Url, err)\n\t\t\t}\n\t\t\tt.Logf(\"data len: %v\", len(data))\n\t\t\tt.Logf(\"data : %v\", string(data))\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "pkg/file-transfer/ft.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: pkg/file-transfer/ft.proto\n\npackage filetransfer\n\nimport (\n\tduration \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Ft_LoadBalanceMode int32\n\nconst (\n\tFt_load_balance_mode_first  Ft_LoadBalanceMode = 0\n\tFt_load_balance_mode_random Ft_LoadBalanceMode = 1\n)\n\n// Enum value maps for Ft_LoadBalanceMode.\nvar (\n\tFt_LoadBalanceMode_name = map[int32]string{\n\t\t0: \"load_balance_mode_first\",\n\t\t1: \"load_balance_mode_random\",\n\t}\n\tFt_LoadBalanceMode_value = map[string]int32{\n\t\t\"load_balance_mode_first\":  0,\n\t\t\"load_balance_mode_random\": 1,\n\t}\n)\n\nfunc (x Ft_LoadBalanceMode) Enum() *Ft_LoadBalanceMode {\n\tp := new(Ft_LoadBalanceMode)\n\t*p = x\n\treturn p\n}\n\nfunc (x Ft_LoadBalanceMode) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Ft_LoadBalanceMode) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_file_transfer_ft_proto_enumTypes[0].Descriptor()\n}\n\nfunc (Ft_LoadBalanceMode) Type() protoreflect.EnumType {\n\treturn &file_pkg_file_transfer_ft_proto_enumTypes[0]\n}\n\nfunc (x Ft_LoadBalanceMode) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Ft_LoadBalanceMode.Descriptor instead.\nfunc (Ft_LoadBalanceMode) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_file_transfer_ft_proto_rawDescGZIP(), []int{0, 0}\n}\n\ntype Ft struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled         bool               `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tDownloadTimeout *duration.Duration `protobuf:\"bytes,2,opt,name=download_timeout,json=downloadTimeout,proto3\" json:\"download_timeout,omitempty\"`\n\tUploadTimeout   *duration.Duration `protobuf:\"bytes,3,opt,name=upload_timeout,json=uploadTimeout,proto3\" json:\"upload_timeout,omitempty\"`\n\tRetryTimes      uint32             `protobuf:\"varint,4,opt,name=retry_times,json=retryTimes,proto3\" json:\"retry_times,omitempty\"`\n\tRetryInterval   *duration.Duration `protobuf:\"bytes,5,opt,name=retry_interval,json=retryInterval,proto3\" json:\"retry_interval,omitempty\"`\n\t// 当有多个代理地址时，代理模式, use proxy mode\n\tLoadBalanceMode Ft_LoadBalanceMode `protobuf:\"varint,10,opt,name=load_balance_mode,json=loadBalanceMode,proto3,enum=go.pkg.filetransfer.Ft_LoadBalanceMode\" json:\"load_balance_mode,omitempty\"`\n\tProxies         []*Ft_Proxy        `protobuf:\"bytes,11,rep,name=proxies,proto3\" json:\"proxies,omitempty\"`\n}\n\nfunc (x *Ft) Reset() {\n\t*x = Ft{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_file_transfer_ft_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Ft) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Ft) ProtoMessage() {}\n\nfunc (x *Ft) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_file_transfer_ft_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Ft.ProtoReflect.Descriptor instead.\nfunc (*Ft) Descriptor() ([]byte, []int) {\n\treturn file_pkg_file_transfer_ft_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Ft) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Ft) GetDownloadTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.DownloadTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Ft) GetUploadTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.UploadTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *Ft) GetRetryTimes() uint32 {\n\tif x != nil {\n\t\treturn x.RetryTimes\n\t}\n\treturn 0\n}\n\nfunc (x *Ft) GetRetryInterval() *duration.Duration {\n\tif x != nil {\n\t\treturn x.RetryInterval\n\t}\n\treturn nil\n}\n\nfunc (x *Ft) GetLoadBalanceMode() Ft_LoadBalanceMode {\n\tif x != nil {\n\t\treturn x.LoadBalanceMode\n\t}\n\treturn Ft_load_balance_mode_first\n}\n\nfunc (x *Ft) GetProxies() []*Ft_Proxy {\n\tif x != nil {\n\t\treturn x.Proxies\n\t}\n\treturn nil\n}\n\ntype Ft_Proxy struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// target_addr和target_url都设置值的情况下，优先使用target_addr\n\t// reset dns to target_addr in url,\n\tTargetHost string `protobuf:\"bytes,1,opt,name=target_host,json=targetHost,proto3\" json:\"target_host,omitempty\"`\n\t// reset url to target url\n\tProxyUrl  string `protobuf:\"bytes,2,opt,name=proxy_url,json=proxyUrl,proto3\" json:\"proxy_url,omitempty\"`\n\tProxyHost string `protobuf:\"bytes,3,opt,name=proxy_host,json=proxyHost,proto3\" json:\"proxy_host,omitempty\"`\n}\n\nfunc (x *Ft_Proxy) Reset() {\n\t*x = Ft_Proxy{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_file_transfer_ft_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Ft_Proxy) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Ft_Proxy) ProtoMessage() {}\n\nfunc (x *Ft_Proxy) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_file_transfer_ft_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Ft_Proxy.ProtoReflect.Descriptor instead.\nfunc (*Ft_Proxy) Descriptor() ([]byte, []int) {\n\treturn file_pkg_file_transfer_ft_proto_rawDescGZIP(), []int{0, 0}\n}\n\nfunc (x *Ft_Proxy) GetTargetHost() string {\n\tif x != nil {\n\t\treturn x.TargetHost\n\t}\n\treturn \"\"\n}\n\nfunc (x *Ft_Proxy) GetProxyUrl() string {\n\tif x != nil {\n\t\treturn x.ProxyUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *Ft_Proxy) GetProxyHost() string {\n\tif x != nil {\n\t\treturn x.ProxyHost\n\t}\n\treturn \"\"\n}\n\nvar File_pkg_file_transfer_ft_proto protoreflect.FileDescriptor\n\nvar file_pkg_file_transfer_ft_proto_rawDesc = []byte{\n\t0x0a, 0x1a, 0x70, 0x6b, 0x67, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73,\n\t0x66, 0x65, 0x72, 0x2f, 0x66, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f,\n\t0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65,\n\t0x72, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x22, 0xcb, 0x04, 0x0a, 0x02, 0x46, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62,\n\t0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c,\n\t0x65, 0x64, 0x12, 0x44, 0x0a, 0x10, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74,\n\t0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,\n\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,\n\t0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61,\n\t0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x40, 0x0a, 0x0e, 0x75, 0x70, 0x6c, 0x6f,\n\t0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,\n\t0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x75, 0x70, 0x6c,\n\t0x6f, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65,\n\t0x74, 0x72, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52,\n\t0x0a, 0x72, 0x65, 0x74, 0x72, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x72,\n\t0x65, 0x74, 0x72, 0x79, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x05, 0x20,\n\t0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,\n\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d,\n\t0x72, 0x65, 0x74, 0x72, 0x79, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x53, 0x0a,\n\t0x11, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6d, 0x6f,\n\t0x64, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b,\n\t0x67, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x46,\n\t0x74, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x6f, 0x64,\n\t0x65, 0x52, 0x0f, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x6f,\n\t0x64, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x65, 0x73, 0x18, 0x0b, 0x20,\n\t0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x66, 0x69, 0x6c,\n\t0x65, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2e, 0x46, 0x74, 0x2e, 0x50, 0x72, 0x6f,\n\t0x78, 0x79, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x65, 0x73, 0x1a, 0x64, 0x0a, 0x05, 0x50,\n\t0x72, 0x6f, 0x78, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68,\n\t0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65,\n\t0x74, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x75,\n\t0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x55,\n\t0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x68, 0x6f, 0x73, 0x74,\n\t0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x48, 0x6f, 0x73,\n\t0x74, 0x22, 0x4c, 0x0a, 0x0f, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65,\n\t0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c,\n\t0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x10,\n\t0x00, 0x12, 0x1c, 0x0a, 0x18, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63,\n\t0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x10, 0x01, 0x42,\n\t0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61,\n\t0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x66, 0x69, 0x6c, 0x65,\n\t0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x3b, 0x66, 0x69, 0x6c, 0x65, 0x74, 0x72, 0x61,\n\t0x6e, 0x73, 0x66, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_file_transfer_ft_proto_rawDescOnce sync.Once\n\tfile_pkg_file_transfer_ft_proto_rawDescData = file_pkg_file_transfer_ft_proto_rawDesc\n)\n\nfunc file_pkg_file_transfer_ft_proto_rawDescGZIP() []byte {\n\tfile_pkg_file_transfer_ft_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_file_transfer_ft_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_file_transfer_ft_proto_rawDescData)\n\t})\n\treturn file_pkg_file_transfer_ft_proto_rawDescData\n}\n\nvar file_pkg_file_transfer_ft_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_pkg_file_transfer_ft_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_pkg_file_transfer_ft_proto_goTypes = []interface{}{\n\t(Ft_LoadBalanceMode)(0),   // 0: go.pkg.filetransfer.Ft.LoadBalanceMode\n\t(*Ft)(nil),                // 1: go.pkg.filetransfer.Ft\n\t(*Ft_Proxy)(nil),          // 2: go.pkg.filetransfer.Ft.Proxy\n\t(*duration.Duration)(nil), // 3: google.protobuf.Duration\n}\nvar file_pkg_file_transfer_ft_proto_depIdxs = []int32{\n\t3, // 0: go.pkg.filetransfer.Ft.download_timeout:type_name -> google.protobuf.Duration\n\t3, // 1: go.pkg.filetransfer.Ft.upload_timeout:type_name -> google.protobuf.Duration\n\t3, // 2: go.pkg.filetransfer.Ft.retry_interval:type_name -> google.protobuf.Duration\n\t0, // 3: go.pkg.filetransfer.Ft.load_balance_mode:type_name -> go.pkg.filetransfer.Ft.LoadBalanceMode\n\t2, // 4: go.pkg.filetransfer.Ft.proxies:type_name -> go.pkg.filetransfer.Ft.Proxy\n\t5, // [5:5] is the sub-list for method output_type\n\t5, // [5:5] is the sub-list for method input_type\n\t5, // [5:5] is the sub-list for extension type_name\n\t5, // [5:5] is the sub-list for extension extendee\n\t0, // [0:5] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_file_transfer_ft_proto_init() }\nfunc file_pkg_file_transfer_ft_proto_init() {\n\tif File_pkg_file_transfer_ft_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_file_transfer_ft_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Ft); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_file_transfer_ft_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Ft_Proxy); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_file_transfer_ft_proto_rawDesc,\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_file_transfer_ft_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_file_transfer_ft_proto_depIdxs,\n\t\tEnumInfos:         file_pkg_file_transfer_ft_proto_enumTypes,\n\t\tMessageInfos:      file_pkg_file_transfer_ft_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_file_transfer_ft_proto = out.File\n\tfile_pkg_file_transfer_ft_proto_rawDesc = nil\n\tfile_pkg_file_transfer_ft_proto_goTypes = nil\n\tfile_pkg_file_transfer_ft_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/file-transfer/ft.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.filetransfer;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.filetransfer;filetransfer\";\n\nmessage Ft {\n  bool enabled = 1;\n  google.protobuf.Duration download_timeout = 2;\n  google.protobuf.Duration upload_timeout = 3;\n  uint32 retry_times = 4;\n  google.protobuf.Duration retry_interval = 5;\n\n  // 当有多个代理地址时，代理模式, use proxy mode\n  LoadBalanceMode load_balance_mode = 10;\n  enum LoadBalanceMode {\n    load_balance_mode_first = 0;\n    load_balance_mode_random = 1;\n  }\n\n  repeated Proxy proxies = 11;\n  message Proxy {\n    // target_host即将url中的域名地址改为target_host进行转发，\n    // proxy_url 第三方代理代理进行下载, 如socks5://127.0.0.1:8080\n    // proxy_host 为proxy_url中的host地址，如果设置了，将代替url中的host\n\n    // target_addr和target_url都设置值的情况下，优先使用target_addr\n    // reset dns to target_addr in url,\n    string target_host = 1;\n\n    // reset url to target url\n    string proxy_url = 2;\n    string proxy_host = 3;\n  }\n}\n"
  },
  {
    "path": "pkg/file-transfer/ft.yaml",
    "content": "filetransfer:\n    enabled: true\n    download_timeout : 5s\n    upload_timeout : 0s\n    retry_times: 0 # must >= 0\n    retry_interval: 1s\n    load_balance_mode: load_balance_mode_first \n    proxies:\n      - proxy_url: \"\" #\"http://127.0.0.1:80\" \n        proxy_host: \"\" #\"127.0.0.1:8080\"\n        target_host: \"\" #\"9.40.34.33:80\"\n"
  },
  {
    "path": "pkg/file-transfer/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/file-transfer\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/logs v0.0.0-20251125132602-62c26b682228\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgo.opentelemetry.io/otel v1.38.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-logr/logr v1.4.3 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.opentelemetry.io/auto/sdk v1.2.1 // indirect\n\tgo.opentelemetry.io/otel/metric v1.38.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.38.0 // indirect\n\tgo.uber.org/atomic v1.11.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n"
  },
  {
    "path": "pkg/file-transfer/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 h1:Q0arlJiD7BygvPMDHcvTdg1urHqADnd7P2qk3r2HlyE=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228/go.mod h1:ML4gUddcaOo55zQ9/m8SxjZYYVTJACriuUFcqs1BEd4=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 h1:7zmih7dDhXTVDxbWy4Cp0OrSqMdQaQzlRUtCzZXMVgc=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228/go.mod h1:DeGVCOtdDQNg6/hVvPwYqeH0EbGcbFiQcKNvMrD+NyY=\ngithub.com/kaydxh/golang/pkg/logs v0.0.0-20251125132602-62c26b682228 h1:Z9rIRFQ5Fpa5VibJaRbZeKvcbAET/Ckfwq1nvboE4SE=\ngithub.com/kaydxh/golang/pkg/logs v0.0.0-20251125132602-62c26b682228/go.mod h1:QFp3TpQ/DR3CEQpIhmPGWugfDvmvAxK6AvPxMXgHNj0=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\n"
  },
  {
    "path": "pkg/file-transfer/upload/upload.svr.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage upload\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\tmd5_ \"github.com/kaydxh/golang/go/crypto/md5\"\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\t\"github.com/kaydxh/golang/go/sync/atomic\"\n\tatomic_ \"github.com/kaydxh/golang/go/sync/atomic\"\n)\n\ntype UploadPartInput struct {\n\tPartId uint32\n\tOffset int64\n\tLength int64\n\tMd5Sum string\n}\n\nconst tmpFileSuffix = \"_.tmp\"\n\nfunc UploadFile(\n\tr io.Reader,\n\tfilePath string,\n\tmd5Sum string,\n) error {\n\tif filePath == \"\" {\n\t\treturn fmt.Errorf(\"invalid filePath\")\n\t}\n\n\t//check path\n\tabsFilePath, err := filepath.Abs(filePath)\n\tif strings.Contains(absFilePath, \"..\") {\n\t\terr = fmt.Errorf(\"invalid filePath: %v\", absFilePath)\n\t\treturn err\n\t}\n\n\tvar mu atomic_.FileLock = atomic.FileLock(filepath.Join(\"./\", absFilePath))\n\terr = mu.TryLock()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tunlockFun := func() error {\n\t\terr = mu.TryUnLock()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\tdefer unlockFun()\n\n\tif md5Sum != \"\" {\n\t\tsum, err := md5_.SumReader(r)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgotSum := strings.ToLower(sum)\n\t\texpectSum := strings.ToLower(md5Sum)\n\n\t\tif gotSum != expectSum {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"failed to check md5Sum, got: %v, expect: %v\",\n\t\t\t\tgotSum,\n\t\t\t\texpectSum,\n\t\t\t)\n\t\t}\n\n\t}\n\n\terr = io_.WriteReader(filePath, r)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc UploadMultipart(\n\tr io.Reader,\n\tpartInput *UploadPartInput,\n\tfilePath string,\n) error {\n\tif partInput == nil {\n\t\treturn fmt.Errorf(\"invalid partInput\")\n\t}\n\tif filePath == \"\" {\n\t\treturn fmt.Errorf(\"invalid filePath\")\n\t}\n\n\t//check path\n\tabsFilePath, err := filepath.Abs(filePath)\n\tif strings.Contains(absFilePath, \"..\") {\n\t\terr = fmt.Errorf(\"invalid filePath: %v\", absFilePath)\n\t\treturn err\n\t}\n\n\tvar mu atomic_.FileLock = atomic.FileLock(filepath.Join(\"./\", absFilePath))\n\terr = mu.TryLock()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tunlockFun := func() error {\n\t\terr = mu.TryUnLock()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\tdefer unlockFun()\n\n\tif partInput.Md5Sum != \"\" {\n\t\tsum, err := md5_.SumReader(r)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgotSum := strings.ToLower(sum)\n\t\texpectSum := strings.ToLower(partInput.Md5Sum)\n\n\t\tif gotSum != expectSum {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"failed to check md5Sum, got: %v, expect: %v\",\n\t\t\t\tgotSum,\n\t\t\t\texpectSum,\n\t\t\t)\n\t\t}\n\n\t}\n\n\ttmpFilePath := filePath + tmpFileSuffix\n\terr = io_.WriteReaderAt(\n\t\ttmpFilePath,\n\t\tr,\n\t\tpartInput.Offset,\n\t\tpartInput.Length,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc CompleteMultipartUpload(\n\tfilePath string,\n\tmd5Sum string) error {\n\tif filePath == \"\" {\n\t\treturn fmt.Errorf(\"invalid filePath\")\n\t}\n\n\ttmpFilePath := filePath + tmpFileSuffix\n\tif md5Sum != \"\" {\n\t\tsum, err := md5_.SumFile(tmpFilePath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tgotSum := strings.ToLower(sum)\n\t\texpectSum := strings.ToLower(md5Sum)\n\n\t\tif gotSum != expectSum {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"failed to check md5Sum, got: %v, expect: %v\",\n\t\t\t\tgotSum,\n\t\t\t\texpectSum,\n\t\t\t)\n\t\t}\n\t}\n\n\t_, err := os.Stat(tmpFilePath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"file: %v is not existed\", tmpFilePath)\n\t}\n\n\terr = os.Rename(tmpFilePath, filePath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to Rename: %v to %v\", tmpFilePath, filePath)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/file-transfer/upload/upload.svr_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage upload_test\n\nimport (\n\t\"mime/multipart\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\tupload_ \"github.com/kaydxh/golang/pkg/file-transfer/upload\"\n)\n\nfunc TestUploadMultipart(t *testing.T) {\n\tvar file multipart.FileHeader\n\tsrcFile, err := file.Open()\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer srcFile.Close()\n\n\tworkDir, _ := os_.Getwd()\n\ttestFilePath := filepath.Join(workDir, \"test-file-upload\")\n\tpartInput := &upload_.UploadPartInput{\n\t\tPartId: 1,\n\t\tOffset: 0,\n\t\tLength: 18,\n\t}\n\terr = upload_.UploadMultipart(srcFile,\n\t\tpartInput,\n\t\ttestFilePath)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\treturn\n\t}\n}\n\nfunc TestCompleteMultipartUpload(t *testing.T) {\n\tworkDir, _ := os_.Getwd()\n\ttestFilePath := filepath.Join(workDir, \"test-file-upload\")\n\terr := upload_.CompleteMultipartUpload(\n\t\ttestFilePath,\n\t\t\"\",\n\t)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t\treturn\n\t}\n}\n"
  },
  {
    "path": "pkg/fsnotify/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage fsnotify\n\nimport (\n\t\"context\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto Fsnotify\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context) (*FsnotifyService, error) {\n\n\tlogrus.Infof(\"Installing Fsnotify\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\treturn nil, nil\n\t}\n\n\trs, err := c.install(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed Fsnotify\")\n\n\treturn rs, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context) (*FsnotifyService, error) {\n\tfn, err := NewFsnotifyService(c.Proto.GetFilePaths())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfn.Run(ctx)\n\n\treturn fn, nil\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/fsnotify/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage fsnotify\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/fsnotify/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage fsnotify\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/fsnotify/fsnotify.go",
    "content": "package fsnotify\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sync\"\n\t\"sync/atomic\"\n\n\t\"github.com/fsnotify/fsnotify\"\n\t\"github.com/kaydxh/golang/go/errors\"\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype EventCallbackFunc func(ctx context.Context, path string)\n\ntype FsnotifyOptions struct {\n\tCreateCallbackFunc EventCallbackFunc\n\tWriteCallbackFunc  EventCallbackFunc\n\tRemoveCallbackFunc EventCallbackFunc\n}\n\ntype FsnotifyService struct {\n\twatcher *fsnotify.Watcher\n\tpaths   []string\n\n\topts       FsnotifyOptions\n\tinShutdown atomic.Bool\n\tmu         sync.Mutex\n\tcancel     func()\n}\n\n// paths can also be dir or file or both of them\nfunc NewFsnotifyService(paths []string, opts ...FsnotifyOption) (*FsnotifyService, error) {\n\twatcher, err := fsnotify.NewWatcher()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(paths) == 0 {\n\t\treturn nil, fmt.Errorf(\"paths is empty\")\n\t}\n\n\tfor _, path := range paths {\n\t\tok, err := os_.PathExist(path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"%s is not exist\", path)\n\t\t}\n\t}\n\n\tfs := &FsnotifyService{\n\t\twatcher: watcher,\n\t\tpaths:   paths,\n\t}\n\tfs.ApplyOptions(opts...)\n\n\treturn fs, nil\n}\n\nfunc (srv *FsnotifyService) logger() logrus.FieldLogger {\n\treturn logrus.WithField(\"module\", \"FsnotifyService\")\n}\n\nfunc (srv *FsnotifyService) Run(ctx context.Context) error {\n\tlogger := srv.logger()\n\tlogger.Infoln(\"FsnotifyService Run\")\n\tif srv.inShutdown.Load() {\n\t\tlogger.Infoln(\"FsnotifyService Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\tgo func() {\n\t\terrors.HandleError(srv.Serve(ctx))\n\t}()\n\treturn nil\n}\n\nfunc (srv *FsnotifyService) Serve(ctx context.Context) error {\n\tlogger := srv.logger()\n\tlogger.Infoln(\"FsnotifyService Serve\")\n\n\tif srv.inShutdown.Load() {\n\t\terr := fmt.Errorf(\"server closed\")\n\t\tlogger.WithError(err).Errorf(\"FsnotifyService Serve canceled\")\n\t\treturn err\n\t}\n\n\tdefer srv.inShutdown.Store(true)\n\tctx, cancel := context.WithCancel(ctx)\n\tsrv.mu.Lock()\n\tsrv.cancel = cancel\n\tsrv.mu.Unlock()\n\n\tdefer func() {\n\t\terr := srv.watcher.Close()\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"failed to close FsnotifyService watcher\")\n\t\t}\n\t}()\n\n\terr := srv.AddWatchPaths(false, srv.paths...)\n\tif err != nil {\n\t\tlogger.WithError(err).Errorf(\"failed to add watcher for path: %v\", srv.paths)\n\t\treturn err\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase ev, ok := <-srv.watcher.Events:\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif ev.Op&fsnotify.Create != 0 {\n\t\t\t\tlogger.Infof(\"%s happen create event\", ev.Name)\n\t\t\t\tsrv.AddWatchPaths(false, ev.Name)\n\t\t\t\tif srv.opts.CreateCallbackFunc != nil {\n\t\t\t\t\tsrv.opts.CreateCallbackFunc(ctx, ev.Name)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ev.Op&fsnotify.Write != 0 {\n\t\t\t\tlogger.Infof(\"%s happen write event\", ev.Name)\n\t\t\t\tsrv.AddWatchPaths(false, ev.Name)\n\t\t\t\tif srv.opts.WriteCallbackFunc != nil {\n\t\t\t\t\tsrv.opts.WriteCallbackFunc(ctx, ev.Name)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ev.Op&fsnotify.Remove != 0 {\n\t\t\t\tlogger.Infof(\"%s happen remove event\", ev.Name)\n\t\t\t\tsrv.AddWatchPaths(true, ev.Name)\n\t\t\t\tif srv.opts.RemoveCallbackFunc != nil {\n\t\t\t\t\tsrv.opts.RemoveCallbackFunc(ctx, ev.Name)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ev.Op&fsnotify.Rename != 0 {\n\t\t\t\tlogger.Infof(\"%s happen rename event\", ev.Name)\n\t\t\t}\n\t\t\tif ev.Op&fsnotify.Chmod != 0 {\n\t\t\t\tlogger.Infof(\"%s happen chmod event\", ev.Name)\n\t\t\t}\n\n\t\tcase <-ctx.Done():\n\t\t\tlogger.WithError(ctx.Err()).Errorf(\"server canceld\")\n\t\t\treturn ctx.Err()\n\t\t}\n\t}\n}\n\n// Add starts watching the named directory (support recursively).\nfunc (srv *FsnotifyService) AddWatchPath(unWatch bool, path string) error {\n\tlogger := srv.logger()\n\n\tok, err := os_.IsDir(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif ok {\n\t\treturn filepath.Walk(path, func(walkPath string, fi os.FileInfo, err error) error {\n\t\t\tif err != nil {\n\t\t\t\tlogger.WithError(err).Errorf(\"failed to walk dir: %v\", walkPath)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif fi.IsDir() {\n\t\t\t\treturn srv.Add(unWatch, walkPath)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t} else {\n\t\treturn srv.Add(unWatch, path)\n\t}\n}\n\n// Add starts watching the named directory (non-recursively).\nfunc (srv *FsnotifyService) Add(unWatch bool, path string) (err error) {\n\tlogger := srv.logger()\n\tif unWatch {\n\t\terr = srv.watcher.Remove(path)\n\t} else {\n\t\terr = srv.watcher.Add(path)\n\t}\n\tif err != nil {\n\t\tlogger.WithError(err).Errorf(\"failed to add watcher for path: %v, \", path)\n\t\treturn err\n\t}\n\tlogger.Infof(\"add watcher for path: %v\", path)\n\n\treturn nil\n}\n\nfunc (srv *FsnotifyService) AddWatchPaths(unWatch bool, paths ...string) error {\n\tfor _, path := range paths {\n\t\terr := srv.AddWatchPath(unWatch, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (srv *FsnotifyService) Shutdown() {\n\tsrv.inShutdown.Store(true)\n\tsrv.mu.Lock()\n\tdefer srv.mu.Unlock()\n\tif srv.cancel != nil {\n\t\tsrv.cancel()\n\t}\n}\n"
  },
  {
    "path": "pkg/fsnotify/fsnotify.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage fsnotify\n\nfunc WithCreateCallbackFunc(fn EventCallbackFunc) FsnotifyOption {\n\treturn FsnotifyOptionFunc(func(r *FsnotifyService) {\n\t\tr.opts.CreateCallbackFunc = fn\n\t})\n}\n\nfunc WithWriteCallbackFunc(fn EventCallbackFunc) FsnotifyOption {\n\treturn FsnotifyOptionFunc(func(r *FsnotifyService) {\n\t\tr.opts.WriteCallbackFunc = fn\n\t})\n}\n\nfunc WithRemoveCallbackFunc(fn EventCallbackFunc) FsnotifyOption {\n\treturn FsnotifyOptionFunc(func(r *FsnotifyService) {\n\t\tr.opts.RemoveCallbackFunc = fn\n\t})\n}\n"
  },
  {
    "path": "pkg/fsnotify/fsnotify.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: pkg/fsnotify/fsnotify.proto\n\npackage fsnotify\n\nimport (\n\t_ \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Fsnotify struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled   bool     `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tFilePaths []string `protobuf:\"bytes,2,rep,name=file_paths,json=filePaths,proto3\" json:\"file_paths,omitempty\"`\n}\n\nfunc (x *Fsnotify) Reset() {\n\t*x = Fsnotify{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_fsnotify_fsnotify_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Fsnotify) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Fsnotify) ProtoMessage() {}\n\nfunc (x *Fsnotify) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_fsnotify_fsnotify_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Fsnotify.ProtoReflect.Descriptor instead.\nfunc (*Fsnotify) Descriptor() ([]byte, []int) {\n\treturn file_pkg_fsnotify_fsnotify_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Fsnotify) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Fsnotify) GetFilePaths() []string {\n\tif x != nil {\n\t\treturn x.FilePaths\n\t}\n\treturn nil\n}\n\nvar File_pkg_fsnotify_fsnotify_proto protoreflect.FileDescriptor\n\nvar file_pkg_fsnotify_fsnotify_proto_rawDesc = []byte{\n\t0x0a, 0x1b, 0x70, 0x6b, 0x67, 0x2f, 0x66, 0x73, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2f, 0x66,\n\t0x73, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67,\n\t0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x66, 0x73, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x1a, 0x1e,\n\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,\n\t0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x43,\n\t0x0a, 0x08, 0x46, 0x73, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e,\n\t0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61,\n\t0x62, 0x6c, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74,\n\t0x68, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61,\n\t0x74, 0x68, 0x73, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,\n\t0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e,\n\t0x66, 0x73, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x3b, 0x66, 0x73, 0x6e, 0x6f, 0x74, 0x69, 0x66,\n\t0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_fsnotify_fsnotify_proto_rawDescOnce sync.Once\n\tfile_pkg_fsnotify_fsnotify_proto_rawDescData = file_pkg_fsnotify_fsnotify_proto_rawDesc\n)\n\nfunc file_pkg_fsnotify_fsnotify_proto_rawDescGZIP() []byte {\n\tfile_pkg_fsnotify_fsnotify_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_fsnotify_fsnotify_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_fsnotify_fsnotify_proto_rawDescData)\n\t})\n\treturn file_pkg_fsnotify_fsnotify_proto_rawDescData\n}\n\nvar file_pkg_fsnotify_fsnotify_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_pkg_fsnotify_fsnotify_proto_goTypes = []interface{}{\n\t(*Fsnotify)(nil), // 0: go.pkg.fsnotify.Fsnotify\n}\nvar file_pkg_fsnotify_fsnotify_proto_depIdxs = []int32{\n\t0, // [0:0] is the sub-list for method output_type\n\t0, // [0:0] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_fsnotify_fsnotify_proto_init() }\nfunc file_pkg_fsnotify_fsnotify_proto_init() {\n\tif File_pkg_fsnotify_fsnotify_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_fsnotify_fsnotify_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Fsnotify); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_fsnotify_fsnotify_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_fsnotify_fsnotify_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_fsnotify_fsnotify_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_fsnotify_fsnotify_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_fsnotify_fsnotify_proto = out.File\n\tfile_pkg_fsnotify_fsnotify_proto_rawDesc = nil\n\tfile_pkg_fsnotify_fsnotify_proto_goTypes = nil\n\tfile_pkg_fsnotify_fsnotify_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/fsnotify/fsnotify.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.fsnotify;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.fsnotify;fsnotify\";\n\nmessage Fsnotify {\n  bool enabled = 1;\n  repeated string file_paths = 2;\n}\n"
  },
  {
    "path": "pkg/fsnotify/fsnotify.yaml",
    "content": "fsnotify:\n    enabled: true\n    file_paths: [ \"./testdata\" ]\n"
  },
  {
    "path": "pkg/fsnotify/fsnotify_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage fsnotify\n\n// A FsnotifyOption sets options.\ntype FsnotifyOption interface {\n\tapply(*FsnotifyService)\n}\n\n// EmptyFsnotifyUrlOption does not alter the Fsnotifyuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyFsnotifyOption struct{}\n\nfunc (EmptyFsnotifyOption) apply(*FsnotifyService) {}\n\n// FsnotifyOptionFunc wraps a function that modifies FsnotifyService into an\n// implementation of the FsnotifyOption interface.\ntype FsnotifyOptionFunc func(*FsnotifyService)\n\nfunc (f FsnotifyOptionFunc) apply(do *FsnotifyService) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _FsnotifyOptionWithDefault() FsnotifyOption {\n\treturn FsnotifyOptionFunc(func(*FsnotifyService) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *FsnotifyService) ApplyOptions(options ...FsnotifyOption) *FsnotifyService {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/fsnotify/fsnotify_test.go",
    "content": "package fsnotify_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\tfsnotify_ \"github.com/kaydxh/golang/pkg/fsnotify\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n)\n\nfunc TestFsnotify(t *testing.T) {\n\n\tcfgFile := \"./fsnotify.yaml\"\n\tconfig := fsnotify_.NewConfig(fsnotify_.WithViper(viper_.GetViper(cfgFile, \"fsnotify\")))\n\n\tfn, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Fatalf(\"failed to new config err: %v\", err)\n\t}\n\tfn.ApplyOptions(fsnotify_.WithWriteCallbackFunc(func(ctx context.Context, path string) {\n\t\tt.Logf(\"%s write call back\", path)\n\t}))\n\n\tselect {}\n}\n"
  },
  {
    "path": "pkg/fsnotify/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/fsnotify\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/fsnotify/fsnotify v1.9.0\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n"
  },
  {
    "path": "pkg/fsnotify/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "pkg/gocv/cgo/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.10)\n\nproject(sdk-go VERSION 1.0 DESCRIPTION \"CGO Library\" LANGUAGES CXX C)\n\nif(NOT CMAKE_BUILD_TYPE)\n  set (CMAKE_BUILD_TYPE \"Debug\")\nendif()\n\nset(CXX_FLAGS\n -g\n -DCHECK_PTHREAD_RETURN_VALUE\n -D_FILE_OFFSET_BITS=64\n -Wall\n -Wextra\n -Werror\n # -Wconversion\n  -Wno-unused-parameter\n # -Wold-style-cast\n -Woverloaded-virtual\n -Wpointer-arith\n -Wshadow\n -Wwrite-strings\n -march=native\n -std=c++11\n -rdynamic\n )\n\nset(CMAKE_CXX_STANDARD 11)\n\nset(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)\nset(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} \"${CMAKE_SOURCE_DIR}/cmake/\")\n\nadd_subdirectory(api/openapi-spec)\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/CMakeLists.txt",
    "content": "add_custom_target(openapi-spec)\n\nfind_package(Protobuf)\n\nif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty.srv.cmake)\n   include(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty.srv.cmake)\nendif ()\n\nGET_MODEL_DIRS(${CMAKE_CURRENT_SOURCE_DIR} _module_dirs)\nFOREACH (_module_dir ${_module_dirs})\n    if (EXISTS ${_module_dir})\n      file(RELATIVE_PATH _rel_module_dir ${CMAKE_CURRENT_SOURCE_DIR} ${_module_dir})\n      message(STATUS \"add_subdirectory=${_rel_module_dir}\")\n      add_subdirectory(${_rel_module_dir})\n      # add_dependencies(openapi-spec proto-${_rel_module_dir})\n    endif()\nENDFOREACH ()\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/Makefile",
    "content": "MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))\nTARGET := $(shell basename ${MAKEFILE_DIR})\nPROJECT_ROOT_PATH := ${MAKEFILE_DIR}/../../\n$(info ${PROJECT_ROOT_PATH})\n\n.PHONY: generate \ngenerate:\n\t@echo \"  >  starting generate protocol buffers for target ${TARGET} in golang\"\n\t@bash -c \"go generate  ../api/openapi-spec/proto.gen.go\"\n\t@echo \"  >  compiling protocol buffers by cpp\"\n\t@if [[ -f \"${PROJECT_ROOT_PATH}/build\" ]]; then rm -Rv \"${PROJECT_ROOT_PATH}/build\"; fi\n\t@mkdir -p ${PROJECT_ROOT_PATH}/build; cd ${PROJECT_ROOT_PATH}/build; cmake ..\n\t@cmake --build ${PROJECT_ROOT_PATH}/build  --target ${TARGET} -- -j `nproc`;\n\t@echo \"  >  install generated protocol buffers by cpp\"\n\t@cd ${PROJECT_ROOT_PATH}/build; cmake --install .\n\t\n\n\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/gocv/CMakeLists.txt",
    "content": "find_package(Protobuf)\nlist(APPEND IMPORT_DIRS \"${PROJECT_SOURCE_DIR}\")\n\nGENERATE_PROTOBUF_LIB(\"${IMPORT_DIRS}\" \"proto-types\")\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/gocv/gocv.magick.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.17.3\n// source: gocv/gocv.magick.proto\n\npackage gocv\n\nimport (\n\tcode \"github.com/kaydxh/golang/pkg/gocv/cgo/api/openapi-spec/types/code\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype OrientationType int32\n\nconst (\n\tOrientationType_UndefinedOrientation   OrientationType = 0\n\tOrientationType_TopLeftOrientation     OrientationType = 1\n\tOrientationType_TopRightOrientation    OrientationType = 2\n\tOrientationType_BottomRightOrientation OrientationType = 3\n\tOrientationType_BottomLeftOrientation  OrientationType = 4\n\tOrientationType_LeftTopOrientation     OrientationType = 5\n\tOrientationType_RightTopOrientation    OrientationType = 6\n\tOrientationType_RightBottomOrientation OrientationType = 7\n\tOrientationType_LeftBottomOrientation  OrientationType = 8\n)\n\n// Enum value maps for OrientationType.\nvar (\n\tOrientationType_name = map[int32]string{\n\t\t0: \"UndefinedOrientation\",\n\t\t1: \"TopLeftOrientation\",\n\t\t2: \"TopRightOrientation\",\n\t\t3: \"BottomRightOrientation\",\n\t\t4: \"BottomLeftOrientation\",\n\t\t5: \"LeftTopOrientation\",\n\t\t6: \"RightTopOrientation\",\n\t\t7: \"RightBottomOrientation\",\n\t\t8: \"LeftBottomOrientation\",\n\t}\n\tOrientationType_value = map[string]int32{\n\t\t\"UndefinedOrientation\":   0,\n\t\t\"TopLeftOrientation\":     1,\n\t\t\"TopRightOrientation\":    2,\n\t\t\"BottomRightOrientation\": 3,\n\t\t\"BottomLeftOrientation\":  4,\n\t\t\"LeftTopOrientation\":     5,\n\t\t\"RightTopOrientation\":    6,\n\t\t\"RightBottomOrientation\": 7,\n\t\t\"LeftBottomOrientation\":  8,\n\t}\n)\n\nfunc (x OrientationType) Enum() *OrientationType {\n\tp := new(OrientationType)\n\t*p = x\n\treturn p\n}\n\nfunc (x OrientationType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (OrientationType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_gocv_gocv_magick_proto_enumTypes[0].Descriptor()\n}\n\nfunc (OrientationType) Type() protoreflect.EnumType {\n\treturn &file_gocv_gocv_magick_proto_enumTypes[0]\n}\n\nfunc (x OrientationType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use OrientationType.Descriptor instead.\nfunc (OrientationType) EnumDescriptor() ([]byte, []int) {\n\treturn file_gocv_gocv_magick_proto_rawDescGZIP(), []int{0}\n}\n\n// graphics-magick/include/magick/colorspace.h\ntype ColorspaceType int32\n\nconst (\n\tColorspaceType_UndefinedColorspace    ColorspaceType = 0\n\tColorspaceType_RGBColorspace          ColorspaceType = 1 // Plain old RGB colorspace\n\tColorspaceType_GRAYColorspace         ColorspaceType = 2 // Plain old full-range grayscale\n\tColorspaceType_TransparentColorspace  ColorspaceType = 3 // RGB but preserve matte channel during quantize\n\tColorspaceType_OHTAColorspace         ColorspaceType = 4\n\tColorspaceType_XYZColorspace          ColorspaceType = 5 // CIE XYZ\n\tColorspaceType_YCCColorspace          ColorspaceType = 6 // Kodak PhotoCD PhotoYCC\n\tColorspaceType_YIQColorspace          ColorspaceType = 7\n\tColorspaceType_YPbPrColorspace        ColorspaceType = 8\n\tColorspaceType_YUVColorspace          ColorspaceType = 9\n\tColorspaceType_CMYKColorspace         ColorspaceType = 10 // Cyan, magenta, yellow, black, alpha\n\tColorspaceType_sRGBColorspace         ColorspaceType = 11 // Kodak PhotoCD sRGB\n\tColorspaceType_HSLColorspace          ColorspaceType = 12 // Hue, saturation, luminosity\n\tColorspaceType_HWBColorspace          ColorspaceType = 13 // Hue, whiteness, blackness\n\tColorspaceType_LABColorspace          ColorspaceType = 14 // LAB colorspace not supported yet other than via lcms\n\tColorspaceType_CineonLogRGBColorspace ColorspaceType = 15 // RGB data with Cineon Log scaling, 2.048 density range\n\tColorspaceType_Rec601LumaColorspace   ColorspaceType = 16 // Luma (Y) according to ITU-R 601\n\tColorspaceType_Rec601YCbCrColorspace  ColorspaceType = 17 // YCbCr according to ITU-R 601\n\tColorspaceType_Rec709LumaColorspace   ColorspaceType = 18 // Luma (Y) according to ITU-R 709\n\tColorspaceType_Rec709YCbCrColorspace  ColorspaceType = 19 // YCbCr according to ITU-R 709\n)\n\n// Enum value maps for ColorspaceType.\nvar (\n\tColorspaceType_name = map[int32]string{\n\t\t0:  \"UndefinedColorspace\",\n\t\t1:  \"RGBColorspace\",\n\t\t2:  \"GRAYColorspace\",\n\t\t3:  \"TransparentColorspace\",\n\t\t4:  \"OHTAColorspace\",\n\t\t5:  \"XYZColorspace\",\n\t\t6:  \"YCCColorspace\",\n\t\t7:  \"YIQColorspace\",\n\t\t8:  \"YPbPrColorspace\",\n\t\t9:  \"YUVColorspace\",\n\t\t10: \"CMYKColorspace\",\n\t\t11: \"sRGBColorspace\",\n\t\t12: \"HSLColorspace\",\n\t\t13: \"HWBColorspace\",\n\t\t14: \"LABColorspace\",\n\t\t15: \"CineonLogRGBColorspace\",\n\t\t16: \"Rec601LumaColorspace\",\n\t\t17: \"Rec601YCbCrColorspace\",\n\t\t18: \"Rec709LumaColorspace\",\n\t\t19: \"Rec709YCbCrColorspace\",\n\t}\n\tColorspaceType_value = map[string]int32{\n\t\t\"UndefinedColorspace\":    0,\n\t\t\"RGBColorspace\":          1,\n\t\t\"GRAYColorspace\":         2,\n\t\t\"TransparentColorspace\":  3,\n\t\t\"OHTAColorspace\":         4,\n\t\t\"XYZColorspace\":          5,\n\t\t\"YCCColorspace\":          6,\n\t\t\"YIQColorspace\":          7,\n\t\t\"YPbPrColorspace\":        8,\n\t\t\"YUVColorspace\":          9,\n\t\t\"CMYKColorspace\":         10,\n\t\t\"sRGBColorspace\":         11,\n\t\t\"HSLColorspace\":          12,\n\t\t\"HWBColorspace\":          13,\n\t\t\"LABColorspace\":          14,\n\t\t\"CineonLogRGBColorspace\": 15,\n\t\t\"Rec601LumaColorspace\":   16,\n\t\t\"Rec601YCbCrColorspace\":  17,\n\t\t\"Rec709LumaColorspace\":   18,\n\t\t\"Rec709YCbCrColorspace\":  19,\n\t}\n)\n\nfunc (x ColorspaceType) Enum() *ColorspaceType {\n\tp := new(ColorspaceType)\n\t*p = x\n\treturn p\n}\n\nfunc (x ColorspaceType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (ColorspaceType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_gocv_gocv_magick_proto_enumTypes[1].Descriptor()\n}\n\nfunc (ColorspaceType) Type() protoreflect.EnumType {\n\treturn &file_gocv_gocv_magick_proto_enumTypes[1]\n}\n\nfunc (x ColorspaceType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use ColorspaceType.Descriptor instead.\nfunc (ColorspaceType) EnumDescriptor() ([]byte, []int) {\n\treturn file_gocv_gocv_magick_proto_rawDescGZIP(), []int{1}\n}\n\ntype MagickInitializeMagickRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tPath string `protobuf:\"bytes,1,opt,name=path,proto3\" json:\"path,omitempty\"`\n}\n\nfunc (x *MagickInitializeMagickRequest) Reset() {\n\t*x = MagickInitializeMagickRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_gocv_gocv_magick_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *MagickInitializeMagickRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MagickInitializeMagickRequest) ProtoMessage() {}\n\nfunc (x *MagickInitializeMagickRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_gocv_gocv_magick_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use MagickInitializeMagickRequest.ProtoReflect.Descriptor instead.\nfunc (*MagickInitializeMagickRequest) Descriptor() ([]byte, []int) {\n\treturn file_gocv_gocv_magick_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *MagickInitializeMagickRequest) GetPath() string {\n\tif x != nil {\n\t\treturn x.Path\n\t}\n\treturn \"\"\n}\n\ntype MagickInitializeMagickResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tError *code.CgoError `protobuf:\"bytes,1,opt,name=error,proto3\" json:\"error,omitempty\"`\n}\n\nfunc (x *MagickInitializeMagickResponse) Reset() {\n\t*x = MagickInitializeMagickResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_gocv_gocv_magick_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *MagickInitializeMagickResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MagickInitializeMagickResponse) ProtoMessage() {}\n\nfunc (x *MagickInitializeMagickResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_gocv_gocv_magick_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use MagickInitializeMagickResponse.ProtoReflect.Descriptor instead.\nfunc (*MagickInitializeMagickResponse) Descriptor() ([]byte, []int) {\n\treturn file_gocv_gocv_magick_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *MagickInitializeMagickResponse) GetError() *code.CgoError {\n\tif x != nil {\n\t\treturn x.Error\n\t}\n\treturn nil\n}\n\ntype MagickImageDecodeRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tImage            []byte `protobuf:\"bytes,1,opt,name=image,proto3\" json:\"image,omitempty\"`\n\tTargetColorSpace string `protobuf:\"bytes,2,opt,name=target_color_space,json=targetColorSpace,proto3\" json:\"target_color_space,omitempty\"` // support BGR BGRA GRA GRAYA, default BGRA\n}\n\nfunc (x *MagickImageDecodeRequest) Reset() {\n\t*x = MagickImageDecodeRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_gocv_gocv_magick_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *MagickImageDecodeRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MagickImageDecodeRequest) ProtoMessage() {}\n\nfunc (x *MagickImageDecodeRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_gocv_gocv_magick_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use MagickImageDecodeRequest.ProtoReflect.Descriptor instead.\nfunc (*MagickImageDecodeRequest) Descriptor() ([]byte, []int) {\n\treturn file_gocv_gocv_magick_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (x *MagickImageDecodeRequest) GetImage() []byte {\n\tif x != nil {\n\t\treturn x.Image\n\t}\n\treturn nil\n}\n\nfunc (x *MagickImageDecodeRequest) GetTargetColorSpace() string {\n\tif x != nil {\n\t\treturn x.TargetColorSpace\n\t}\n\treturn \"\"\n}\n\ntype MagickImageDecodeResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tError           *code.CgoError  `protobuf:\"bytes,1,opt,name=error,proto3\" json:\"error,omitempty\"`\n\tCvMatPointer    int64           `protobuf:\"varint,2,opt,name=cv_mat_pointer,json=cvMatPointer,proto3\" json:\"cv_mat_pointer,omitempty\"` // pointer of cv::Mat\n\tRows            int64           `protobuf:\"varint,3,opt,name=rows,proto3\" json:\"rows,omitempty\"`                                       //  Image height\n\tColumns         int64           `protobuf:\"varint,4,opt,name=columns,proto3\" json:\"columns,omitempty\"`                                 //  Image width\n\tMagick          string          `protobuf:\"bytes,5,opt,name=magick,proto3\" json:\"magick,omitempty\"`                                    // File type magick identifier (.e.g \"GIF\")\n\tOrientationType OrientationType `protobuf:\"varint,6,opt,name=orientation_type,json=orientationType,proto3,enum=sdk.api.gocv.OrientationType\" json:\"orientation_type,omitempty\"`\n\tColorspaceType  ColorspaceType  `protobuf:\"varint,7,opt,name=colorspace_type,json=colorspaceType,proto3,enum=sdk.api.gocv.ColorspaceType\" json:\"colorspace_type,omitempty\"`\n}\n\nfunc (x *MagickImageDecodeResponse) Reset() {\n\t*x = MagickImageDecodeResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_gocv_gocv_magick_proto_msgTypes[3]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *MagickImageDecodeResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MagickImageDecodeResponse) ProtoMessage() {}\n\nfunc (x *MagickImageDecodeResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_gocv_gocv_magick_proto_msgTypes[3]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use MagickImageDecodeResponse.ProtoReflect.Descriptor instead.\nfunc (*MagickImageDecodeResponse) Descriptor() ([]byte, []int) {\n\treturn file_gocv_gocv_magick_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *MagickImageDecodeResponse) GetError() *code.CgoError {\n\tif x != nil {\n\t\treturn x.Error\n\t}\n\treturn nil\n}\n\nfunc (x *MagickImageDecodeResponse) GetCvMatPointer() int64 {\n\tif x != nil {\n\t\treturn x.CvMatPointer\n\t}\n\treturn 0\n}\n\nfunc (x *MagickImageDecodeResponse) GetRows() int64 {\n\tif x != nil {\n\t\treturn x.Rows\n\t}\n\treturn 0\n}\n\nfunc (x *MagickImageDecodeResponse) GetColumns() int64 {\n\tif x != nil {\n\t\treturn x.Columns\n\t}\n\treturn 0\n}\n\nfunc (x *MagickImageDecodeResponse) GetMagick() string {\n\tif x != nil {\n\t\treturn x.Magick\n\t}\n\treturn \"\"\n}\n\nfunc (x *MagickImageDecodeResponse) GetOrientationType() OrientationType {\n\tif x != nil {\n\t\treturn x.OrientationType\n\t}\n\treturn OrientationType_UndefinedOrientation\n}\n\nfunc (x *MagickImageDecodeResponse) GetColorspaceType() ColorspaceType {\n\tif x != nil {\n\t\treturn x.ColorspaceType\n\t}\n\treturn ColorspaceType_UndefinedColorspace\n}\n\nvar File_gocv_gocv_magick_proto protoreflect.FileDescriptor\n\nvar file_gocv_gocv_magick_proto_rawDesc = []byte{\n\t0x0a, 0x16, 0x67, 0x6f, 0x63, 0x76, 0x2f, 0x67, 0x6f, 0x63, 0x76, 0x2e, 0x6d, 0x61, 0x67, 0x69,\n\t0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x70,\n\t0x69, 0x2e, 0x67, 0x6f, 0x63, 0x76, 0x1a, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x70, 0x65, 0x6e,\n\t0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63,\n\t0x6f, 0x64, 0x65, 0x2f, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x1d, 0x4d, 0x61, 0x67, 0x69, 0x63, 0x6b, 0x49,\n\t0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x4d, 0x61, 0x67, 0x69, 0x63, 0x6b, 0x52,\n\t0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01,\n\t0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x50, 0x0a, 0x1e, 0x4d, 0x61,\n\t0x67, 0x69, 0x63, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x4d, 0x61,\n\t0x67, 0x69, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05,\n\t0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x64,\n\t0x6b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x43, 0x67, 0x6f,\n\t0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x5e, 0x0a, 0x18,\n\t0x4d, 0x61, 0x67, 0x69, 0x63, 0x6b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64,\n\t0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67,\n\t0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2c,\n\t0x0a, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x73,\n\t0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x61, 0x72, 0x67,\n\t0x65, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x70, 0x61, 0x63, 0x65, 0x22, 0xc8, 0x02, 0x0a,\n\t0x19, 0x4d, 0x61, 0x67, 0x69, 0x63, 0x6b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x65, 0x63, 0x6f,\n\t0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x65, 0x72,\n\t0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x64, 0x6b, 0x2e,\n\t0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x43, 0x67, 0x6f, 0x45, 0x72,\n\t0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x76,\n\t0x5f, 0x6d, 0x61, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01,\n\t0x28, 0x03, 0x52, 0x0c, 0x63, 0x76, 0x4d, 0x61, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72,\n\t0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04,\n\t0x72, 0x6f, 0x77, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18,\n\t0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x16,\n\t0x0a, 0x06, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,\n\t0x6d, 0x61, 0x67, 0x69, 0x63, 0x6b, 0x12, 0x48, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74,\n\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e,\n\t0x32, 0x1d, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x6f, 0x63, 0x76, 0x2e,\n\t0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52,\n\t0x0f, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65,\n\t0x12, 0x45, 0x0a, 0x0f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74,\n\t0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x73, 0x64, 0x6b, 0x2e,\n\t0x61, 0x70, 0x69, 0x2e, 0x67, 0x6f, 0x63, 0x76, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70,\n\t0x61, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70,\n\t0x61, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x2a, 0xfb, 0x01, 0x0a, 0x0f, 0x4f, 0x72, 0x69, 0x65,\n\t0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x55,\n\t0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74,\n\t0x69, 0x6f, 0x6e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x6f, 0x70, 0x4c, 0x65, 0x66, 0x74,\n\t0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x17, 0x0a,\n\t0x13, 0x54, 0x6f, 0x70, 0x52, 0x69, 0x67, 0x68, 0x74, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61,\n\t0x74, 0x69, 0x6f, 0x6e, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x42, 0x6f, 0x74, 0x74, 0x6f, 0x6d,\n\t0x52, 0x69, 0x67, 0x68, 0x74, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x42, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x4c, 0x65, 0x66, 0x74,\n\t0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x04, 0x12, 0x16, 0x0a,\n\t0x12, 0x4c, 0x65, 0x66, 0x74, 0x54, 0x6f, 0x70, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74,\n\t0x69, 0x6f, 0x6e, 0x10, 0x05, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x69, 0x67, 0x68, 0x74, 0x54, 0x6f,\n\t0x70, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x06, 0x12, 0x1a,\n\t0x0a, 0x16, 0x52, 0x69, 0x67, 0x68, 0x74, 0x42, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x4f, 0x72, 0x69,\n\t0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x07, 0x12, 0x19, 0x0a, 0x15, 0x4c, 0x65,\n\t0x66, 0x74, 0x42, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74,\n\t0x69, 0x6f, 0x6e, 0x10, 0x08, 0x2a, 0xc7, 0x03, 0x0a, 0x0e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73,\n\t0x70, 0x61, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x6e, 0x64, 0x65,\n\t0x66, 0x69, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10,\n\t0x00, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x47, 0x42, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61,\n\t0x63, 0x65, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x47, 0x52, 0x41, 0x59, 0x43, 0x6f, 0x6c, 0x6f,\n\t0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x72, 0x61, 0x6e,\n\t0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63,\n\t0x65, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x48, 0x54, 0x41, 0x43, 0x6f, 0x6c, 0x6f, 0x72,\n\t0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x58, 0x59, 0x5a, 0x43, 0x6f,\n\t0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x59, 0x43,\n\t0x43, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x06, 0x12, 0x11, 0x0a,\n\t0x0d, 0x59, 0x49, 0x51, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x07,\n\t0x12, 0x13, 0x0a, 0x0f, 0x59, 0x50, 0x62, 0x50, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70,\n\t0x61, 0x63, 0x65, 0x10, 0x08, 0x12, 0x11, 0x0a, 0x0d, 0x59, 0x55, 0x56, 0x43, 0x6f, 0x6c, 0x6f,\n\t0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x09, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x4d, 0x59, 0x4b,\n\t0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x12, 0x0a, 0x0e,\n\t0x73, 0x52, 0x47, 0x42, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x0b,\n\t0x12, 0x11, 0x0a, 0x0d, 0x48, 0x53, 0x4c, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63,\n\t0x65, 0x10, 0x0c, 0x12, 0x11, 0x0a, 0x0d, 0x48, 0x57, 0x42, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73,\n\t0x70, 0x61, 0x63, 0x65, 0x10, 0x0d, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x41, 0x42, 0x43, 0x6f, 0x6c,\n\t0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x0e, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x69, 0x6e,\n\t0x65, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x47, 0x42, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70,\n\t0x61, 0x63, 0x65, 0x10, 0x0f, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x65, 0x63, 0x36, 0x30, 0x31, 0x4c,\n\t0x75, 0x6d, 0x61, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x10, 0x12,\n\t0x19, 0x0a, 0x15, 0x52, 0x65, 0x63, 0x36, 0x30, 0x31, 0x59, 0x43, 0x62, 0x43, 0x72, 0x43, 0x6f,\n\t0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x11, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x65,\n\t0x63, 0x37, 0x30, 0x39, 0x4c, 0x75, 0x6d, 0x61, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61,\n\t0x63, 0x65, 0x10, 0x12, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x65, 0x63, 0x37, 0x30, 0x39, 0x59, 0x43,\n\t0x62, 0x43, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x13, 0x42,\n\t0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61,\n\t0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f,\n\t0x67, 0x6f, 0x63, 0x76, 0x2f, 0x63, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x70, 0x65,\n\t0x6e, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x67, 0x6f, 0x63, 0x76, 0x3b, 0x67,\n\t0x6f, 0x63, 0x76, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_gocv_gocv_magick_proto_rawDescOnce sync.Once\n\tfile_gocv_gocv_magick_proto_rawDescData = file_gocv_gocv_magick_proto_rawDesc\n)\n\nfunc file_gocv_gocv_magick_proto_rawDescGZIP() []byte {\n\tfile_gocv_gocv_magick_proto_rawDescOnce.Do(func() {\n\t\tfile_gocv_gocv_magick_proto_rawDescData = protoimpl.X.CompressGZIP(file_gocv_gocv_magick_proto_rawDescData)\n\t})\n\treturn file_gocv_gocv_magick_proto_rawDescData\n}\n\nvar file_gocv_gocv_magick_proto_enumTypes = make([]protoimpl.EnumInfo, 2)\nvar file_gocv_gocv_magick_proto_msgTypes = make([]protoimpl.MessageInfo, 4)\nvar file_gocv_gocv_magick_proto_goTypes = []interface{}{\n\t(OrientationType)(0),                   // 0: sdk.api.gocv.OrientationType\n\t(ColorspaceType)(0),                    // 1: sdk.api.gocv.ColorspaceType\n\t(*MagickInitializeMagickRequest)(nil),  // 2: sdk.api.gocv.MagickInitializeMagickRequest\n\t(*MagickInitializeMagickResponse)(nil), // 3: sdk.api.gocv.MagickInitializeMagickResponse\n\t(*MagickImageDecodeRequest)(nil),       // 4: sdk.api.gocv.MagickImageDecodeRequest\n\t(*MagickImageDecodeResponse)(nil),      // 5: sdk.api.gocv.MagickImageDecodeResponse\n\t(*code.CgoError)(nil),                  // 6: sdk.types.code.CgoError\n}\nvar file_gocv_gocv_magick_proto_depIdxs = []int32{\n\t6, // 0: sdk.api.gocv.MagickInitializeMagickResponse.error:type_name -> sdk.types.code.CgoError\n\t6, // 1: sdk.api.gocv.MagickImageDecodeResponse.error:type_name -> sdk.types.code.CgoError\n\t0, // 2: sdk.api.gocv.MagickImageDecodeResponse.orientation_type:type_name -> sdk.api.gocv.OrientationType\n\t1, // 3: sdk.api.gocv.MagickImageDecodeResponse.colorspace_type:type_name -> sdk.api.gocv.ColorspaceType\n\t4, // [4:4] is the sub-list for method output_type\n\t4, // [4:4] is the sub-list for method input_type\n\t4, // [4:4] is the sub-list for extension type_name\n\t4, // [4:4] is the sub-list for extension extendee\n\t0, // [0:4] is the sub-list for field type_name\n}\n\nfunc init() { file_gocv_gocv_magick_proto_init() }\nfunc file_gocv_gocv_magick_proto_init() {\n\tif File_gocv_gocv_magick_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_gocv_gocv_magick_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*MagickInitializeMagickRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_gocv_gocv_magick_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*MagickInitializeMagickResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_gocv_gocv_magick_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*MagickImageDecodeRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_gocv_gocv_magick_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*MagickImageDecodeResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_gocv_gocv_magick_proto_rawDesc,\n\t\t\tNumEnums:      2,\n\t\t\tNumMessages:   4,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_gocv_gocv_magick_proto_goTypes,\n\t\tDependencyIndexes: file_gocv_gocv_magick_proto_depIdxs,\n\t\tEnumInfos:         file_gocv_gocv_magick_proto_enumTypes,\n\t\tMessageInfos:      file_gocv_gocv_magick_proto_msgTypes,\n\t}.Build()\n\tFile_gocv_gocv_magick_proto = out.File\n\tfile_gocv_gocv_magick_proto_rawDesc = nil\n\tfile_gocv_gocv_magick_proto_goTypes = nil\n\tfile_gocv_gocv_magick_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/gocv/gocv.magick.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: api/openapi-spec/gocv/gocv.magick.proto\n\n#ifndef PROTOBUF_INCLUDED_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto\n#define PROTOBUF_INCLUDED_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/generated_enum_reflection.h>\n#include <google/protobuf/unknown_field_set.h>\n#include \"api/openapi-spec/types/code/sdk-go.code.pb.h\"\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto \n\nnamespace protobuf_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[4];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid AddDescriptors();\n}  // namespace protobuf_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto\nnamespace sdk {\nnamespace api {\nnamespace gocv {\nclass MagickImageDecodeRequest;\nclass MagickImageDecodeRequestDefaultTypeInternal;\nextern MagickImageDecodeRequestDefaultTypeInternal _MagickImageDecodeRequest_default_instance_;\nclass MagickImageDecodeResponse;\nclass MagickImageDecodeResponseDefaultTypeInternal;\nextern MagickImageDecodeResponseDefaultTypeInternal _MagickImageDecodeResponse_default_instance_;\nclass MagickInitializeMagickRequest;\nclass MagickInitializeMagickRequestDefaultTypeInternal;\nextern MagickInitializeMagickRequestDefaultTypeInternal _MagickInitializeMagickRequest_default_instance_;\nclass MagickInitializeMagickResponse;\nclass MagickInitializeMagickResponseDefaultTypeInternal;\nextern MagickInitializeMagickResponseDefaultTypeInternal _MagickInitializeMagickResponse_default_instance_;\n}  // namespace gocv\n}  // namespace api\n}  // namespace sdk\nnamespace google {\nnamespace protobuf {\ntemplate<> ::sdk::api::gocv::MagickImageDecodeRequest* Arena::CreateMaybeMessage<::sdk::api::gocv::MagickImageDecodeRequest>(Arena*);\ntemplate<> ::sdk::api::gocv::MagickImageDecodeResponse* Arena::CreateMaybeMessage<::sdk::api::gocv::MagickImageDecodeResponse>(Arena*);\ntemplate<> ::sdk::api::gocv::MagickInitializeMagickRequest* Arena::CreateMaybeMessage<::sdk::api::gocv::MagickInitializeMagickRequest>(Arena*);\ntemplate<> ::sdk::api::gocv::MagickInitializeMagickResponse* Arena::CreateMaybeMessage<::sdk::api::gocv::MagickInitializeMagickResponse>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace sdk {\nnamespace api {\nnamespace gocv {\n\nenum OrientationType {\n  UndefinedOrientation = 0,\n  TopLeftOrientation = 1,\n  TopRightOrientation = 2,\n  BottomRightOrientation = 3,\n  BottomLeftOrientation = 4,\n  LeftTopOrientation = 5,\n  RightTopOrientation = 6,\n  RightBottomOrientation = 7,\n  LeftBottomOrientation = 8,\n  OrientationType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,\n  OrientationType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max\n};\nbool OrientationType_IsValid(int value);\nconst OrientationType OrientationType_MIN = UndefinedOrientation;\nconst OrientationType OrientationType_MAX = LeftBottomOrientation;\nconst int OrientationType_ARRAYSIZE = OrientationType_MAX + 1;\n\nconst ::google::protobuf::EnumDescriptor* OrientationType_descriptor();\ninline const ::std::string& OrientationType_Name(OrientationType value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    OrientationType_descriptor(), value);\n}\ninline bool OrientationType_Parse(\n    const ::std::string& name, OrientationType* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<OrientationType>(\n    OrientationType_descriptor(), name, value);\n}\nenum ColorspaceType {\n  UndefinedColorspace = 0,\n  RGBColorspace = 1,\n  GRAYColorspace = 2,\n  TransparentColorspace = 3,\n  OHTAColorspace = 4,\n  XYZColorspace = 5,\n  YCCColorspace = 6,\n  YIQColorspace = 7,\n  YPbPrColorspace = 8,\n  YUVColorspace = 9,\n  CMYKColorspace = 10,\n  sRGBColorspace = 11,\n  HSLColorspace = 12,\n  HWBColorspace = 13,\n  LABColorspace = 14,\n  CineonLogRGBColorspace = 15,\n  Rec601LumaColorspace = 16,\n  Rec601YCbCrColorspace = 17,\n  Rec709LumaColorspace = 18,\n  Rec709YCbCrColorspace = 19,\n  ColorspaceType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,\n  ColorspaceType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max\n};\nbool ColorspaceType_IsValid(int value);\nconst ColorspaceType ColorspaceType_MIN = UndefinedColorspace;\nconst ColorspaceType ColorspaceType_MAX = Rec709YCbCrColorspace;\nconst int ColorspaceType_ARRAYSIZE = ColorspaceType_MAX + 1;\n\nconst ::google::protobuf::EnumDescriptor* ColorspaceType_descriptor();\ninline const ::std::string& ColorspaceType_Name(ColorspaceType value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    ColorspaceType_descriptor(), value);\n}\ninline bool ColorspaceType_Parse(\n    const ::std::string& name, ColorspaceType* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<ColorspaceType>(\n    ColorspaceType_descriptor(), name, value);\n}\n// ===================================================================\n\nclass MagickInitializeMagickRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:sdk.api.gocv.MagickInitializeMagickRequest) */ {\n public:\n  MagickInitializeMagickRequest();\n  virtual ~MagickInitializeMagickRequest();\n\n  MagickInitializeMagickRequest(const MagickInitializeMagickRequest& from);\n\n  inline MagickInitializeMagickRequest& operator=(const MagickInitializeMagickRequest& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  MagickInitializeMagickRequest(MagickInitializeMagickRequest&& from) noexcept\n    : MagickInitializeMagickRequest() {\n    *this = ::std::move(from);\n  }\n\n  inline MagickInitializeMagickRequest& operator=(MagickInitializeMagickRequest&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const MagickInitializeMagickRequest& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const MagickInitializeMagickRequest* internal_default_instance() {\n    return reinterpret_cast<const MagickInitializeMagickRequest*>(\n               &_MagickInitializeMagickRequest_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void Swap(MagickInitializeMagickRequest* other);\n  friend void swap(MagickInitializeMagickRequest& a, MagickInitializeMagickRequest& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline MagickInitializeMagickRequest* New() const final {\n    return CreateMaybeMessage<MagickInitializeMagickRequest>(NULL);\n  }\n\n  MagickInitializeMagickRequest* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<MagickInitializeMagickRequest>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const MagickInitializeMagickRequest& from);\n  void MergeFrom(const MagickInitializeMagickRequest& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(MagickInitializeMagickRequest* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // string path = 1;\n  void clear_path();\n  static const int kPathFieldNumber = 1;\n  const ::std::string& path() const;\n  void set_path(const ::std::string& value);\n  #if LANG_CXX11\n  void set_path(::std::string&& value);\n  #endif\n  void set_path(const char* value);\n  void set_path(const char* value, size_t size);\n  ::std::string* mutable_path();\n  ::std::string* release_path();\n  void set_allocated_path(::std::string* path);\n\n  // @@protoc_insertion_point(class_scope:sdk.api.gocv.MagickInitializeMagickRequest)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::ArenaStringPtr path_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass MagickInitializeMagickResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:sdk.api.gocv.MagickInitializeMagickResponse) */ {\n public:\n  MagickInitializeMagickResponse();\n  virtual ~MagickInitializeMagickResponse();\n\n  MagickInitializeMagickResponse(const MagickInitializeMagickResponse& from);\n\n  inline MagickInitializeMagickResponse& operator=(const MagickInitializeMagickResponse& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  MagickInitializeMagickResponse(MagickInitializeMagickResponse&& from) noexcept\n    : MagickInitializeMagickResponse() {\n    *this = ::std::move(from);\n  }\n\n  inline MagickInitializeMagickResponse& operator=(MagickInitializeMagickResponse&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const MagickInitializeMagickResponse& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const MagickInitializeMagickResponse* internal_default_instance() {\n    return reinterpret_cast<const MagickInitializeMagickResponse*>(\n               &_MagickInitializeMagickResponse_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    1;\n\n  void Swap(MagickInitializeMagickResponse* other);\n  friend void swap(MagickInitializeMagickResponse& a, MagickInitializeMagickResponse& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline MagickInitializeMagickResponse* New() const final {\n    return CreateMaybeMessage<MagickInitializeMagickResponse>(NULL);\n  }\n\n  MagickInitializeMagickResponse* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<MagickInitializeMagickResponse>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const MagickInitializeMagickResponse& from);\n  void MergeFrom(const MagickInitializeMagickResponse& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(MagickInitializeMagickResponse* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // .sdk.types.code.CgoError error = 1;\n  bool has_error() const;\n  void clear_error();\n  static const int kErrorFieldNumber = 1;\n  private:\n  const ::sdk::types::code::CgoError& _internal_error() const;\n  public:\n  const ::sdk::types::code::CgoError& error() const;\n  ::sdk::types::code::CgoError* release_error();\n  ::sdk::types::code::CgoError* mutable_error();\n  void set_allocated_error(::sdk::types::code::CgoError* error);\n\n  // @@protoc_insertion_point(class_scope:sdk.api.gocv.MagickInitializeMagickResponse)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::sdk::types::code::CgoError* error_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass MagickImageDecodeRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:sdk.api.gocv.MagickImageDecodeRequest) */ {\n public:\n  MagickImageDecodeRequest();\n  virtual ~MagickImageDecodeRequest();\n\n  MagickImageDecodeRequest(const MagickImageDecodeRequest& from);\n\n  inline MagickImageDecodeRequest& operator=(const MagickImageDecodeRequest& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  MagickImageDecodeRequest(MagickImageDecodeRequest&& from) noexcept\n    : MagickImageDecodeRequest() {\n    *this = ::std::move(from);\n  }\n\n  inline MagickImageDecodeRequest& operator=(MagickImageDecodeRequest&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const MagickImageDecodeRequest& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const MagickImageDecodeRequest* internal_default_instance() {\n    return reinterpret_cast<const MagickImageDecodeRequest*>(\n               &_MagickImageDecodeRequest_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    2;\n\n  void Swap(MagickImageDecodeRequest* other);\n  friend void swap(MagickImageDecodeRequest& a, MagickImageDecodeRequest& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline MagickImageDecodeRequest* New() const final {\n    return CreateMaybeMessage<MagickImageDecodeRequest>(NULL);\n  }\n\n  MagickImageDecodeRequest* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<MagickImageDecodeRequest>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const MagickImageDecodeRequest& from);\n  void MergeFrom(const MagickImageDecodeRequest& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(MagickImageDecodeRequest* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // bytes image = 1;\n  void clear_image();\n  static const int kImageFieldNumber = 1;\n  const ::std::string& image() const;\n  void set_image(const ::std::string& value);\n  #if LANG_CXX11\n  void set_image(::std::string&& value);\n  #endif\n  void set_image(const char* value);\n  void set_image(const void* value, size_t size);\n  ::std::string* mutable_image();\n  ::std::string* release_image();\n  void set_allocated_image(::std::string* image);\n\n  // string target_color_space = 2;\n  void clear_target_color_space();\n  static const int kTargetColorSpaceFieldNumber = 2;\n  const ::std::string& target_color_space() const;\n  void set_target_color_space(const ::std::string& value);\n  #if LANG_CXX11\n  void set_target_color_space(::std::string&& value);\n  #endif\n  void set_target_color_space(const char* value);\n  void set_target_color_space(const char* value, size_t size);\n  ::std::string* mutable_target_color_space();\n  ::std::string* release_target_color_space();\n  void set_allocated_target_color_space(::std::string* target_color_space);\n\n  // @@protoc_insertion_point(class_scope:sdk.api.gocv.MagickImageDecodeRequest)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::ArenaStringPtr image_;\n  ::google::protobuf::internal::ArenaStringPtr target_color_space_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass MagickImageDecodeResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:sdk.api.gocv.MagickImageDecodeResponse) */ {\n public:\n  MagickImageDecodeResponse();\n  virtual ~MagickImageDecodeResponse();\n\n  MagickImageDecodeResponse(const MagickImageDecodeResponse& from);\n\n  inline MagickImageDecodeResponse& operator=(const MagickImageDecodeResponse& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  MagickImageDecodeResponse(MagickImageDecodeResponse&& from) noexcept\n    : MagickImageDecodeResponse() {\n    *this = ::std::move(from);\n  }\n\n  inline MagickImageDecodeResponse& operator=(MagickImageDecodeResponse&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const MagickImageDecodeResponse& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const MagickImageDecodeResponse* internal_default_instance() {\n    return reinterpret_cast<const MagickImageDecodeResponse*>(\n               &_MagickImageDecodeResponse_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    3;\n\n  void Swap(MagickImageDecodeResponse* other);\n  friend void swap(MagickImageDecodeResponse& a, MagickImageDecodeResponse& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline MagickImageDecodeResponse* New() const final {\n    return CreateMaybeMessage<MagickImageDecodeResponse>(NULL);\n  }\n\n  MagickImageDecodeResponse* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<MagickImageDecodeResponse>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const MagickImageDecodeResponse& from);\n  void MergeFrom(const MagickImageDecodeResponse& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(MagickImageDecodeResponse* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // string magick = 5;\n  void clear_magick();\n  static const int kMagickFieldNumber = 5;\n  const ::std::string& magick() const;\n  void set_magick(const ::std::string& value);\n  #if LANG_CXX11\n  void set_magick(::std::string&& value);\n  #endif\n  void set_magick(const char* value);\n  void set_magick(const char* value, size_t size);\n  ::std::string* mutable_magick();\n  ::std::string* release_magick();\n  void set_allocated_magick(::std::string* magick);\n\n  // .sdk.types.code.CgoError error = 1;\n  bool has_error() const;\n  void clear_error();\n  static const int kErrorFieldNumber = 1;\n  private:\n  const ::sdk::types::code::CgoError& _internal_error() const;\n  public:\n  const ::sdk::types::code::CgoError& error() const;\n  ::sdk::types::code::CgoError* release_error();\n  ::sdk::types::code::CgoError* mutable_error();\n  void set_allocated_error(::sdk::types::code::CgoError* error);\n\n  // int64 cv_mat_pointer = 2;\n  void clear_cv_mat_pointer();\n  static const int kCvMatPointerFieldNumber = 2;\n  ::google::protobuf::int64 cv_mat_pointer() const;\n  void set_cv_mat_pointer(::google::protobuf::int64 value);\n\n  // int64 rows = 3;\n  void clear_rows();\n  static const int kRowsFieldNumber = 3;\n  ::google::protobuf::int64 rows() const;\n  void set_rows(::google::protobuf::int64 value);\n\n  // int64 columns = 4;\n  void clear_columns();\n  static const int kColumnsFieldNumber = 4;\n  ::google::protobuf::int64 columns() const;\n  void set_columns(::google::protobuf::int64 value);\n\n  // .sdk.api.gocv.OrientationType orientation_type = 6;\n  void clear_orientation_type();\n  static const int kOrientationTypeFieldNumber = 6;\n  ::sdk::api::gocv::OrientationType orientation_type() const;\n  void set_orientation_type(::sdk::api::gocv::OrientationType value);\n\n  // .sdk.api.gocv.ColorspaceType colorspace_type = 7;\n  void clear_colorspace_type();\n  static const int kColorspaceTypeFieldNumber = 7;\n  ::sdk::api::gocv::ColorspaceType colorspace_type() const;\n  void set_colorspace_type(::sdk::api::gocv::ColorspaceType value);\n\n  // @@protoc_insertion_point(class_scope:sdk.api.gocv.MagickImageDecodeResponse)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::ArenaStringPtr magick_;\n  ::sdk::types::code::CgoError* error_;\n  ::google::protobuf::int64 cv_mat_pointer_;\n  ::google::protobuf::int64 rows_;\n  ::google::protobuf::int64 columns_;\n  int orientation_type_;\n  int colorspace_type_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// MagickInitializeMagickRequest\n\n// string path = 1;\ninline void MagickInitializeMagickRequest::clear_path() {\n  path_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& MagickInitializeMagickRequest::path() const {\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickInitializeMagickRequest.path)\n  return path_.GetNoArena();\n}\ninline void MagickInitializeMagickRequest::set_path(const ::std::string& value) {\n  \n  path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:sdk.api.gocv.MagickInitializeMagickRequest.path)\n}\n#if LANG_CXX11\ninline void MagickInitializeMagickRequest::set_path(::std::string&& value) {\n  \n  path_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:sdk.api.gocv.MagickInitializeMagickRequest.path)\n}\n#endif\ninline void MagickInitializeMagickRequest::set_path(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:sdk.api.gocv.MagickInitializeMagickRequest.path)\n}\ninline void MagickInitializeMagickRequest::set_path(const char* value, size_t size) {\n  \n  path_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:sdk.api.gocv.MagickInitializeMagickRequest.path)\n}\ninline ::std::string* MagickInitializeMagickRequest::mutable_path() {\n  \n  // @@protoc_insertion_point(field_mutable:sdk.api.gocv.MagickInitializeMagickRequest.path)\n  return path_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* MagickInitializeMagickRequest::release_path() {\n  // @@protoc_insertion_point(field_release:sdk.api.gocv.MagickInitializeMagickRequest.path)\n  \n  return path_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void MagickInitializeMagickRequest::set_allocated_path(::std::string* path) {\n  if (path != NULL) {\n    \n  } else {\n    \n  }\n  path_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), path);\n  // @@protoc_insertion_point(field_set_allocated:sdk.api.gocv.MagickInitializeMagickRequest.path)\n}\n\n// -------------------------------------------------------------------\n\n// MagickInitializeMagickResponse\n\n// .sdk.types.code.CgoError error = 1;\ninline bool MagickInitializeMagickResponse::has_error() const {\n  return this != internal_default_instance() && error_ != NULL;\n}\ninline const ::sdk::types::code::CgoError& MagickInitializeMagickResponse::_internal_error() const {\n  return *error_;\n}\ninline const ::sdk::types::code::CgoError& MagickInitializeMagickResponse::error() const {\n  const ::sdk::types::code::CgoError* p = error_;\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickInitializeMagickResponse.error)\n  return p != NULL ? *p : *reinterpret_cast<const ::sdk::types::code::CgoError*>(\n      &::sdk::types::code::_CgoError_default_instance_);\n}\ninline ::sdk::types::code::CgoError* MagickInitializeMagickResponse::release_error() {\n  // @@protoc_insertion_point(field_release:sdk.api.gocv.MagickInitializeMagickResponse.error)\n  \n  ::sdk::types::code::CgoError* temp = error_;\n  error_ = NULL;\n  return temp;\n}\ninline ::sdk::types::code::CgoError* MagickInitializeMagickResponse::mutable_error() {\n  \n  if (error_ == NULL) {\n    auto* p = CreateMaybeMessage<::sdk::types::code::CgoError>(GetArenaNoVirtual());\n    error_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:sdk.api.gocv.MagickInitializeMagickResponse.error)\n  return error_;\n}\ninline void MagickInitializeMagickResponse::set_allocated_error(::sdk::types::code::CgoError* error) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete reinterpret_cast< ::google::protobuf::MessageLite*>(error_);\n  }\n  if (error) {\n    ::google::protobuf::Arena* submessage_arena = NULL;\n    if (message_arena != submessage_arena) {\n      error = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, error, submessage_arena);\n    }\n    \n  } else {\n    \n  }\n  error_ = error;\n  // @@protoc_insertion_point(field_set_allocated:sdk.api.gocv.MagickInitializeMagickResponse.error)\n}\n\n// -------------------------------------------------------------------\n\n// MagickImageDecodeRequest\n\n// bytes image = 1;\ninline void MagickImageDecodeRequest::clear_image() {\n  image_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& MagickImageDecodeRequest::image() const {\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickImageDecodeRequest.image)\n  return image_.GetNoArena();\n}\ninline void MagickImageDecodeRequest::set_image(const ::std::string& value) {\n  \n  image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:sdk.api.gocv.MagickImageDecodeRequest.image)\n}\n#if LANG_CXX11\ninline void MagickImageDecodeRequest::set_image(::std::string&& value) {\n  \n  image_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:sdk.api.gocv.MagickImageDecodeRequest.image)\n}\n#endif\ninline void MagickImageDecodeRequest::set_image(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:sdk.api.gocv.MagickImageDecodeRequest.image)\n}\ninline void MagickImageDecodeRequest::set_image(const void* value, size_t size) {\n  \n  image_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:sdk.api.gocv.MagickImageDecodeRequest.image)\n}\ninline ::std::string* MagickImageDecodeRequest::mutable_image() {\n  \n  // @@protoc_insertion_point(field_mutable:sdk.api.gocv.MagickImageDecodeRequest.image)\n  return image_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* MagickImageDecodeRequest::release_image() {\n  // @@protoc_insertion_point(field_release:sdk.api.gocv.MagickImageDecodeRequest.image)\n  \n  return image_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void MagickImageDecodeRequest::set_allocated_image(::std::string* image) {\n  if (image != NULL) {\n    \n  } else {\n    \n  }\n  image_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), image);\n  // @@protoc_insertion_point(field_set_allocated:sdk.api.gocv.MagickImageDecodeRequest.image)\n}\n\n// string target_color_space = 2;\ninline void MagickImageDecodeRequest::clear_target_color_space() {\n  target_color_space_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& MagickImageDecodeRequest::target_color_space() const {\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickImageDecodeRequest.target_color_space)\n  return target_color_space_.GetNoArena();\n}\ninline void MagickImageDecodeRequest::set_target_color_space(const ::std::string& value) {\n  \n  target_color_space_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:sdk.api.gocv.MagickImageDecodeRequest.target_color_space)\n}\n#if LANG_CXX11\ninline void MagickImageDecodeRequest::set_target_color_space(::std::string&& value) {\n  \n  target_color_space_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:sdk.api.gocv.MagickImageDecodeRequest.target_color_space)\n}\n#endif\ninline void MagickImageDecodeRequest::set_target_color_space(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  target_color_space_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:sdk.api.gocv.MagickImageDecodeRequest.target_color_space)\n}\ninline void MagickImageDecodeRequest::set_target_color_space(const char* value, size_t size) {\n  \n  target_color_space_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:sdk.api.gocv.MagickImageDecodeRequest.target_color_space)\n}\ninline ::std::string* MagickImageDecodeRequest::mutable_target_color_space() {\n  \n  // @@protoc_insertion_point(field_mutable:sdk.api.gocv.MagickImageDecodeRequest.target_color_space)\n  return target_color_space_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* MagickImageDecodeRequest::release_target_color_space() {\n  // @@protoc_insertion_point(field_release:sdk.api.gocv.MagickImageDecodeRequest.target_color_space)\n  \n  return target_color_space_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void MagickImageDecodeRequest::set_allocated_target_color_space(::std::string* target_color_space) {\n  if (target_color_space != NULL) {\n    \n  } else {\n    \n  }\n  target_color_space_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), target_color_space);\n  // @@protoc_insertion_point(field_set_allocated:sdk.api.gocv.MagickImageDecodeRequest.target_color_space)\n}\n\n// -------------------------------------------------------------------\n\n// MagickImageDecodeResponse\n\n// .sdk.types.code.CgoError error = 1;\ninline bool MagickImageDecodeResponse::has_error() const {\n  return this != internal_default_instance() && error_ != NULL;\n}\ninline const ::sdk::types::code::CgoError& MagickImageDecodeResponse::_internal_error() const {\n  return *error_;\n}\ninline const ::sdk::types::code::CgoError& MagickImageDecodeResponse::error() const {\n  const ::sdk::types::code::CgoError* p = error_;\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickImageDecodeResponse.error)\n  return p != NULL ? *p : *reinterpret_cast<const ::sdk::types::code::CgoError*>(\n      &::sdk::types::code::_CgoError_default_instance_);\n}\ninline ::sdk::types::code::CgoError* MagickImageDecodeResponse::release_error() {\n  // @@protoc_insertion_point(field_release:sdk.api.gocv.MagickImageDecodeResponse.error)\n  \n  ::sdk::types::code::CgoError* temp = error_;\n  error_ = NULL;\n  return temp;\n}\ninline ::sdk::types::code::CgoError* MagickImageDecodeResponse::mutable_error() {\n  \n  if (error_ == NULL) {\n    auto* p = CreateMaybeMessage<::sdk::types::code::CgoError>(GetArenaNoVirtual());\n    error_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:sdk.api.gocv.MagickImageDecodeResponse.error)\n  return error_;\n}\ninline void MagickImageDecodeResponse::set_allocated_error(::sdk::types::code::CgoError* error) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete reinterpret_cast< ::google::protobuf::MessageLite*>(error_);\n  }\n  if (error) {\n    ::google::protobuf::Arena* submessage_arena = NULL;\n    if (message_arena != submessage_arena) {\n      error = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, error, submessage_arena);\n    }\n    \n  } else {\n    \n  }\n  error_ = error;\n  // @@protoc_insertion_point(field_set_allocated:sdk.api.gocv.MagickImageDecodeResponse.error)\n}\n\n// int64 cv_mat_pointer = 2;\ninline void MagickImageDecodeResponse::clear_cv_mat_pointer() {\n  cv_mat_pointer_ = GOOGLE_LONGLONG(0);\n}\ninline ::google::protobuf::int64 MagickImageDecodeResponse::cv_mat_pointer() const {\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickImageDecodeResponse.cv_mat_pointer)\n  return cv_mat_pointer_;\n}\ninline void MagickImageDecodeResponse::set_cv_mat_pointer(::google::protobuf::int64 value) {\n  \n  cv_mat_pointer_ = value;\n  // @@protoc_insertion_point(field_set:sdk.api.gocv.MagickImageDecodeResponse.cv_mat_pointer)\n}\n\n// int64 rows = 3;\ninline void MagickImageDecodeResponse::clear_rows() {\n  rows_ = GOOGLE_LONGLONG(0);\n}\ninline ::google::protobuf::int64 MagickImageDecodeResponse::rows() const {\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickImageDecodeResponse.rows)\n  return rows_;\n}\ninline void MagickImageDecodeResponse::set_rows(::google::protobuf::int64 value) {\n  \n  rows_ = value;\n  // @@protoc_insertion_point(field_set:sdk.api.gocv.MagickImageDecodeResponse.rows)\n}\n\n// int64 columns = 4;\ninline void MagickImageDecodeResponse::clear_columns() {\n  columns_ = GOOGLE_LONGLONG(0);\n}\ninline ::google::protobuf::int64 MagickImageDecodeResponse::columns() const {\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickImageDecodeResponse.columns)\n  return columns_;\n}\ninline void MagickImageDecodeResponse::set_columns(::google::protobuf::int64 value) {\n  \n  columns_ = value;\n  // @@protoc_insertion_point(field_set:sdk.api.gocv.MagickImageDecodeResponse.columns)\n}\n\n// string magick = 5;\ninline void MagickImageDecodeResponse::clear_magick() {\n  magick_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& MagickImageDecodeResponse::magick() const {\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickImageDecodeResponse.magick)\n  return magick_.GetNoArena();\n}\ninline void MagickImageDecodeResponse::set_magick(const ::std::string& value) {\n  \n  magick_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:sdk.api.gocv.MagickImageDecodeResponse.magick)\n}\n#if LANG_CXX11\ninline void MagickImageDecodeResponse::set_magick(::std::string&& value) {\n  \n  magick_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:sdk.api.gocv.MagickImageDecodeResponse.magick)\n}\n#endif\ninline void MagickImageDecodeResponse::set_magick(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  magick_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:sdk.api.gocv.MagickImageDecodeResponse.magick)\n}\ninline void MagickImageDecodeResponse::set_magick(const char* value, size_t size) {\n  \n  magick_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:sdk.api.gocv.MagickImageDecodeResponse.magick)\n}\ninline ::std::string* MagickImageDecodeResponse::mutable_magick() {\n  \n  // @@protoc_insertion_point(field_mutable:sdk.api.gocv.MagickImageDecodeResponse.magick)\n  return magick_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* MagickImageDecodeResponse::release_magick() {\n  // @@protoc_insertion_point(field_release:sdk.api.gocv.MagickImageDecodeResponse.magick)\n  \n  return magick_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void MagickImageDecodeResponse::set_allocated_magick(::std::string* magick) {\n  if (magick != NULL) {\n    \n  } else {\n    \n  }\n  magick_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), magick);\n  // @@protoc_insertion_point(field_set_allocated:sdk.api.gocv.MagickImageDecodeResponse.magick)\n}\n\n// .sdk.api.gocv.OrientationType orientation_type = 6;\ninline void MagickImageDecodeResponse::clear_orientation_type() {\n  orientation_type_ = 0;\n}\ninline ::sdk::api::gocv::OrientationType MagickImageDecodeResponse::orientation_type() const {\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickImageDecodeResponse.orientation_type)\n  return static_cast< ::sdk::api::gocv::OrientationType >(orientation_type_);\n}\ninline void MagickImageDecodeResponse::set_orientation_type(::sdk::api::gocv::OrientationType value) {\n  \n  orientation_type_ = value;\n  // @@protoc_insertion_point(field_set:sdk.api.gocv.MagickImageDecodeResponse.orientation_type)\n}\n\n// .sdk.api.gocv.ColorspaceType colorspace_type = 7;\ninline void MagickImageDecodeResponse::clear_colorspace_type() {\n  colorspace_type_ = 0;\n}\ninline ::sdk::api::gocv::ColorspaceType MagickImageDecodeResponse::colorspace_type() const {\n  // @@protoc_insertion_point(field_get:sdk.api.gocv.MagickImageDecodeResponse.colorspace_type)\n  return static_cast< ::sdk::api::gocv::ColorspaceType >(colorspace_type_);\n}\ninline void MagickImageDecodeResponse::set_colorspace_type(::sdk::api::gocv::ColorspaceType value) {\n  \n  colorspace_type_ = value;\n  // @@protoc_insertion_point(field_set:sdk.api.gocv.MagickImageDecodeResponse.colorspace_type)\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace gocv\n}  // namespace api\n}  // namespace sdk\n\nnamespace google {\nnamespace protobuf {\n\ntemplate <> struct is_proto_enum< ::sdk::api::gocv::OrientationType> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::sdk::api::gocv::OrientationType>() {\n  return ::sdk::api::gocv::OrientationType_descriptor();\n}\ntemplate <> struct is_proto_enum< ::sdk::api::gocv::ColorspaceType> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::sdk::api::gocv::ColorspaceType>() {\n  return ::sdk::api::gocv::ColorspaceType_descriptor();\n}\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_api_2fopenapi_2dspec_2fgocv_2fgocv_2emagick_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/gocv/gocv.magick.proto",
    "content": "syntax = \"proto3\";\npackage sdk.api.gocv;\n\nimport \"api/openapi-spec/types/code/sdk-go.code.proto\";\n\noption go_package = \"github.com/kaydxh/golang/pkg/gocv/cgo/api/openapi-spec/gocv;gocv\";\n\nmessage MagickInitializeMagickRequest {\n  string path = 1;\n}\n\nmessage MagickInitializeMagickResponse {\n  sdk.types.code.CgoError error = 1;\n}\n\nmessage MagickImageDecodeRequest {\n  bytes image = 1;\n  string target_color_space = 2;  // support BGR BGRA GRA GRAYA, default BGRA\n}\n\nmessage MagickImageDecodeResponse {\n  sdk.types.code.CgoError error = 1;\n  int64 cv_mat_pointer = 2;  // pointer of cv::Mat\n  int64 rows = 3;            //  Image height\n  int64 columns = 4;         //  Image width\n  string magick = 5;         // File type magick identifier (.e.g \"GIF\")\n  OrientationType orientation_type = 6;\n  ColorspaceType colorspace_type = 7;\n}\n\nenum OrientationType {\n  UndefinedOrientation = 0;\n  TopLeftOrientation = 1;\n  TopRightOrientation = 2;\n  BottomRightOrientation = 3;\n  BottomLeftOrientation = 4;\n  LeftTopOrientation = 5;\n  RightTopOrientation = 6;\n  RightBottomOrientation = 7;\n  LeftBottomOrientation = 8;\n}\n\n// graphics-magick/include/magick/colorspace.h\nenum ColorspaceType {\n  UndefinedColorspace = 0;\n  RGBColorspace = 1;  /* Plain old RGB colorspace */\n  GRAYColorspace = 2; /* Plain old full-range grayscale */\n  TransparentColorspace =\n      3; /* RGB but preserve matte channel during quantize */\n  OHTAColorspace = 4;\n  XYZColorspace = 5; /* CIE XYZ */\n  YCCColorspace = 6; /* Kodak PhotoCD PhotoYCC */\n  YIQColorspace = 7;\n  YPbPrColorspace = 8;\n  YUVColorspace = 9;\n  CMYKColorspace = 10; /* Cyan, magenta, yellow, black, alpha */\n  sRGBColorspace = 11; /* Kodak PhotoCD sRGB */\n  HSLColorspace = 12;  /* Hue, saturation, luminosity */\n  HWBColorspace = 13;  /* Hue, whiteness, blackness */\n  LABColorspace = 14; /* LAB colorspace not supported yet other than via lcms */\n  CineonLogRGBColorspace =\n      15; /* RGB data with Cineon Log scaling, 2.048 density range */\n  Rec601LumaColorspace = 16;  /* Luma (Y) according to ITU-R 601 */\n  Rec601YCbCrColorspace = 17; /* YCbCr according to ITU-R 601 */\n  Rec709LumaColorspace = 18;  /* Luma (Y) according to ITU-R 709 */\n  Rec709YCbCrColorspace = 19; /* YCbCr according to ITU-R 709 */\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/proto.gen.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage openapispec\n\n//go:generate mkdir -p ./scripts\n//go:generate bash -c \"curl -s -L -o ./scripts/proto-gen.sh https://raw.githubusercontent.com/kaydxh/golang/main/script/go_proto_gen.sh\"\n//go:generate bash scripts/proto-gen.sh --proto_file_path . -I . -I ../../  --third_party_path ../../../../../third_party --with-go\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/scripts/proto-gen.sh",
    "content": "# Created by kayxhding on 2020-10-11 12:40:37\n#!/usr/bin/env bash\n\n# exit by command return non-zero exit code\nset -o errexit\n# Indicate an error when it encounters an undefined variable\nset -o nounset\n# Fail on any error.\nset -o pipefail\n#set -o xtrace\n\n# example, generate golang proto files\n# bash go_proto_gen.sh -I . --proto_file_path pkg/webserver/webserver.proto --with-go\n\n# if script called by source, $0 is the name of father script, not the name of source run script\nSCRIPT_PATH=$(cd `dirname \"${BASH_SOURCE[0]}\"`;pwd)\n\n<<'COMMENT'\nSCRIPT=$(readlink -f \"${BASH_SOURCE[0]}\")\nSCRIPT_PATH=$(dirname \"$SCRIPT\")\necho ${SCRIPT_PATH}\nCOMMENT\n\nPROTOC_FILE_DIR=\nPROTO_HEADERS=\n# THIRD_PARTY_DIR=$(realpath \"${2:-${SCRIPT_PATH}/../../third_party}\")\nTHIRD_PARTY_DIR=\"${SCRIPT_PATH}/third_party\"\nWITH_DOC=\nWITH_CPP=\nWITH_GO=\n\nfunction die() {\n  echo 1>&2 \"$*\"\n  exit 1\n}\n\nfunction getopts() {\n  local -a protodirs\n  while test $# -ne 0\n  do\n    case \"$1\" in\n       -I|--proto_path)\n             protodirs+=(\n             \"-I $(realpath \"$2\")\"\n            )\n            shift\n            ;;\n       --third_party_path)\n           THIRD_PARTY_DIR=$(realpath \"$2\")\n            shift\n            ;;\n       --with-doc)\n            WITH_DOC=1\n            ;;\n       --proto_file_path)\n            PROTOC_FILE_DIR=$(realpath \"$2\")\n            shift\n            ;;\n       --with-cpp)\n           WITH_CPP=1\n           ;;\n       --with-go)\n           WITH_GO=1\n           ;;\n     esac\n     shift\n done\n\n PROTO_HEADERS=\"${protodirs[*]}\"\n # echo \"${protodirs[*]}\"\n}\n\n<<'COMMENT'\n# This will place three binaries in your $GOBIN\n# Make sure that your $GOBIN is in your $PATH\n# install protoc-gen-doc on mac=> https:\n# github.com/pseudomuto/protoc-gen-doc/issues/20  (make build, cp bin/protoc-gen-doc ${GOBIN})\n go install \\\n    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \\\n    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \\\n    google.golang.org/protobuf/cmd/protoc-gen-go \\\n    google.golang.org/grpc/cmd/protoc-gen-go-grpc \\\n    github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc \\\n    github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \nCOMMENT\n\necho `pwd`\n\ngetopts $@\n\necho \"==> Checking tools...\"\n#GEN_PROTO_TOOLS=(protoc protoc-gen-go protoc-gen-grpc-gateway protoc-gen-govalidators)\nGEN_PROTO_TOOLS=(protoc protoc-gen-go protoc-gen-grpc-gateway)\nfor tool in ${GEN_PROTO_TOOLS[@]}; do\n   q=$(command -v ${tool}) || die \"didn't find ${tool}\"\n   echo 1>&2 \"${tool}: ${q}\"\ndone\n\n\necho \"==> Generating proto...\"\n#proto_headers=\"-I ${SCRIPT_PATH}/../../third_party\"\n#proto_headers=\"-I .. -I ${THIRD_PARTY_DIR}\"\n# \"-I .\" need behind PROTO_HEADERS, or remove it\nproto_headers=\"${PROTO_HEADERS} -I `pwd`\"\nproto_headers=\"${proto_headers} -I ${THIRD_PARTY_DIR}/github.com/grpc-ecosystem/grpc-gateway\"\nsource_relative_option=\"paths=source_relative:.\"\ngo_opt_option=\"\"\ngo_out_option=\"\"\ngo_tag_option=\"\"\ngo_grpc_option=\"\"\ndoc_option=\"\"\ndoc_out_option=\"\"\ncpp_option=\"\"\ncpp_out_option=\"\"\ncpp_grpc_option=\"\"\ngrpc_gateway_option=\"\"\ngrpc_gateway_out_option=\"--grpc-gateway_out=logtostderr=true\"\ngrpc_gateway_delete_option=\"--grpc-gateway_opt=allow_delete_body=true\"\n\nfor proto in $(find ${PROTOC_FILE_DIR} -type f -name '*.proto' -print0 | xargs -0); do\n  echo \"Generating ${proto}\"\n  proto_base_name=\"$(basename ${proto} .proto)\"\n  api_conf_yaml_base_name=\"${proto_base_name}.yaml\"\n  api_conf_yaml_dir=\"$(dirname ${proto})\"\n  api_conf_yaml=\"${api_conf_yaml_dir}/$api_conf_yaml_base_name\"\n  grpc_api_yaml_option=\"\"\n  grpc_gateway_option=\"\"\n\n  if [[ -f \"${api_conf_yaml}\" ]];then\n    grpc_api_yaml_option=\"grpc_api_configuration=${api_conf_yaml},${source_relative_option}\"\n    grpc_gateway_option=\"${grpc_gateway_out_option},${grpc_api_yaml_option} ${grpc_gateway_delete_option}\"\n  fi\n\n  if [[ \"${WITH_DOC}\" -eq 1 ]]; then\n    # output file name\n    doc_option=\"--doc_opt=markdown,${proto_base_name}.md\"\n    doc_out_option=\"--doc_out=${SCRIPT_PATH}/../doc\"\n  fi\n\n  if [[ \"${WITH_CPP}\" -eq 1 ]]; then\n    cpp_option=\"--cpp_out=.\"\n    cpp_out_option=\"--grpc_out=.\"\n    cpp_grpc_option=\"--plugin=protoc-gen-grpc=`which grpc_cpp_plugin`\"\n  fi\n\n  if [[ \"${WITH_GO}\" -eq 1 ]]; then\n    # go_tag_option=\"--go-tag_out=${source_relative_option}\"\n    go_out_option=\"--go_out=.\"\n    go_opt_option=\"--go_opt=paths=source_relative\"\n    go_grpc_option=\"--go-grpc_out=${source_relative_option}\"\n  fi\n\n  protoc ${proto_headers} ${go_out_option} ${go_tag_option} ${go_opt_option} ${go_grpc_option} ${grpc_gateway_option} ${cpp_out_option} ${cpp_option} ${doc_option} ${doc_out_option} ${cpp_grpc_option} \"${proto}\"\n  #protoc -I . ${proto_headers} --go-tag_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. --grpc-gateway_out=logtostderr=true,grpc_api_configuration=${api_conf_yaml},paths=source_relative:. --grpc-gateway_opt=allow_delete_body=true ${f}\ndone\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/thirdparty.cmake",
    "content": "cmake_minimum_required(VERSION 2.8)\n\nmacro(log_debug msg)\n    get_filename_component(name ${CMAKE_CURRENT_LIST_FILE} NAME)\n    string(TIMESTAMP TIME_NOW \"%Y-%m-%d %H:%M:%S\")\n    message(\"${TIME_NOW} - ${name}:${CMAKE_CURRENT_LIST_LINE} - ${msg}\")\nendmacro(log_debug)\n\nmacro(log_warn msg)\n    get_filename_component(name ${CMAKE_CURRENT_LIST_FILE} NAME)\n    string(TIMESTAMP TIME_NOW \"%Y-%m-%d %H:%M:%S\")\n    message(WARNING \"${TIME_NOW} - ${name}:${CMAKE_CURRENT_LIST_LINE} - ${msg}\")\nendmacro(log_warn)\n\nmacro(log_error msg)\n    get_filename_component(name ${CMAKE_CURRENT_LIST_FILE} NAME)\n    string(TIMESTAMP TIME_NOW \"%Y-%m-%d %H:%M:%S\")\n    message(SEND_ERROR  \"${TIME_NOW} - ${name}:${CMAKE_CURRENT_LIST_LINE} - ${msg}\")\nendmacro(log_error)\n\nmacro(debug_vars)\n    FOREACH(A ${ARGN})\n      log_debug(\"${A}:${${A}}\")\n    ENDFOREACH(A)\nendmacro(debug_vars)\n\nmacro(log_execute_process)\n    set(options \"\" )\n    set(oneValueArgs WORKING_DIRECTORY )\n    set(multiValueArgs COMMAND)\n    cmake_parse_arguments(log_execute_process \"${options}\" \"${oneValueArgs}\" \"${multiValueArgs}\" ${ARGN})\n    string(REPLACE \";\" \" \" CMD \"${log_execute_process_COMMAND}\")\n\n    if(NOT log_execute_process_WORKING_DIRECTORY)\n         log_error(\"bad cmd:cd ${log_execute_process_WORKING_DIRECTORY} && ${CMD}\")\n    endif()\n\n    if(NOT EXISTS ${log_execute_process_WORKING_DIRECTORY})\n         log_error(\"bad cmd:cd ${log_execute_process_WORKING_DIRECTORY} && ${CMD}\")\n    endif()\n\n    log_debug(\"cd ${log_execute_process_WORKING_DIRECTORY} && ${CMD}\")\n    execute_process(COMMAND ${log_execute_process_COMMAND}\n                    WORKING_DIRECTORY ${log_execute_process_WORKING_DIRECTORY}\n                    RESULT_VARIABLE rv ERROR_VARIABLE er\n                    OUTPUT_FILE ${log_execute_process_WORKING_DIRECTORY}/out.log\n                    ERROR_FILE ${log_execute_process_WORKING_DIRECTORY}/error.log)\n    if(rv)\n       log_debug(\"RESULT:${rv}, ERROR:${er}\")\n    endif()\nendmacro(log_execute_process)\n\nmacro(add_files_to_qtcreator DIR)\n    get_filename_component(dir_name ${DIR} NAME)\n    string(REGEX REPLACE \"/\" \"_\" source_target ${DIR})\n    set(source_target \"${dir_name}_${source_target}\")\n\n    log_debug(\"add_files_to_qtcreator: ${source_target}\")\n    set(files_sources \"\")\n    foreach(fileprex ${ARGN})\n       file(GLOB_RECURSE _src_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${DIR}/*${fileprex})\n       foreach(src_file ${_src_files})\n           if(NOT (src_file MATCHES \".*\\\\.git.*\"))\n                list(APPEND files_sources ${src_file})\n           endif()\n       endforeach()\n     endforeach()\n\n     add_custom_target(${source_target}\n         SOURCES ${files_sources}\n         WORKING_DIRECTORY ${DIR})\n\nendmacro(add_files_to_qtcreator)\n\nmacro(add_shared_library DIR)\n    set_property(GLOBAL APPEND PROPERTY GLOBAL_INCLUDE_DIRS \"${DIR}/include\")\n    SET(LIB_DIR ${DIR}/lib)\n    if(NOT EXISTS ${LIB_DIR})\n        SET(LIB_DIR ${DIR}/lib64)\n    endif()\n    set_property(GLOBAL APPEND PROPERTY GLOBAL_LINK_DIRS ${LIB_DIR})\n    INCLUDE_DIRECTORIES(${DIR}/include)\n    add_files_to_qtcreator(${DIR}/include .h .hpp)\n\n    foreach(libname ${ARGN})\n            add_library(${libname} SHARED IMPORTED)\n            set_property(TARGET ${libname} PROPERTY IMPORTED_LOCATION ${DIR}/lib/lib${libname}.so)\n            set(SHARED_SO_PATH  ${SHARED_SO_PATH}:${DIR}/lib)\n    endforeach()\n    log_debug(\"add_shared_library: ${ARGN} in: ${DIR}\")\nendmacro(add_shared_library)\n\nmacro(add_static_library DIR)\n    set_property(GLOBAL APPEND PROPERTY GLOBAL_INCLUDE_DIRS \"${DIR}/include\")\n    SET(LIB_DIR ${DIR}/lib)\n    if(NOT EXISTS ${LIB_DIR})\n        SET(LIB_DIR ${DIR}/lib64)\n    endif()\n    set_property(GLOBAL APPEND PROPERTY GLOBAL_LINK_DIRS ${LIB_DIR})\n    INCLUDE_DIRECTORIES(${DIR}/include)\n    add_files_to_qtcreator(${DIR}/include .h .hpp)\n    foreach(libname ${ARGN})\n      add_library(${libname} STATIC IMPORTED)\n      set_property(TARGET ${libname} PROPERTY IMPORTED_LOCATION ${DIR}/lib/lib${libname}.a)\n    endforeach()\n    log_debug(\"add_static_library: ${ARGN} in: ${DIR}\")\nendmacro(add_static_library)\n\nMACRO(SUBDIRLIST result curdir)\n    FILE(GLOB children RELATIVE ${curdir} ${curdir}/[a-zA-Z0-9]*)\n  SET(dirlist \"\")\n  FOREACH(child ${children})\n    IF(IS_DIRECTORY ${curdir}/${child})\n      LIST(APPEND dirlist ${child})\n    ENDIF()\n  ENDFOREACH()\n  SET(${result} ${dirlist})\nENDMACRO()\n\nMACRO(SUBLIBLIST shared_result static_result curdir)\n  FILE(GLOB children RELATIVE ${curdir} ${curdir}/lib*.so)\n  SET(filelist \"\")\n  FOREACH(child ${children})\n    IF(IS_DIRECTORY ${curdir}/${child})\n    ELSE(IS_DIRECTORY ${curdir}/${child})\n      LIST(APPEND filelist ${child})\n    ENDIF()\n  ENDFOREACH()\n  SET(${shared_result} ${filelist})\n\n  FILE(GLOB children RELATIVE ${curdir} ${curdir}/lib*.a)\n  SET(filelist \"\")\n  FOREACH(child ${children})\n    IF(IS_DIRECTORY ${curdir}/${child})\n    ELSE(IS_DIRECTORY ${curdir}/${child})\n      LIST(APPEND filelist ${child})\n    ENDIF()\n  ENDFOREACH()\n  SET(${static_result} ${filelist})\nENDMACRO()\n\nMACRO(IMPORT_ONE_LIB DEP_DIR)\n  SET(DEP_LIBDIR ${DEP_DIR}/lib)\n  if(NOT EXISTS ${DEP_LIBDIR})\n    SET(DEP_LIBDIR ${DEP_DIR}/lib64)\n  endif()\n  SUBLIBLIST(SHARED_LIBS STATIC_LIBS ${DEP_LIBDIR})\n  list(LENGTH SHARED_LIBS shared_count)\n  list(LENGTH STATIC_LIBS static_count)\n  message(STATUS \"${dep} shared_count : ${shared_count}\")\n  message(STATUS \"${dep} static_count : ${static_count}\")\n  INCLUDE_DIRECTORIES(${DEP_DIR}/include)\n\n  set_property(GLOBAL APPEND PROPERTY GLOBAL_INCLUDE_DIRS \"${DEP_DIR}/include\")\n  set_property(GLOBAL APPEND PROPERTY GLOBAL_LINK_DIRS ${DEP_LIBDIR})\n\n  set(mkl_regex \".*mkl.*\")\n  \n  if (${shared_count} STREQUAL \"0\")\n    if (${static_count} STREQUAL \"0\")\n      message(STATUS \"${DEP_DIR} has no lib to import\")\n    else (${static_count} STREQUAL \"0\")\n      FILE(GLOB children RELATIVE ${DEP_LIBDIR} ${DEP_LIBDIR}/lib*.a)\n      foreach(libs ${children})\n          string(REGEX REPLACE \"^lib\" \"\" _lib_name ${libs})\n          string(REGEX REPLACE \"\\\\.a\" \"\" _lib_name ${_lib_name})\n\n          if(TARGET ${_lib_name})\n              get_property(_lib_name_dir TARGET ${_lib_name}  PROPERTY IMPORTED_LOCATION)\n              log_warn(\"${_lib_name} already add at:${_lib_name_dir} skip ${DEP_LIBDIR}/${libs}\")\n              continue()\n          endif()\n\n          add_library(${_lib_name} STATIC IMPORTED)\n          set_property(TARGET ${_lib_name}  PROPERTY IMPORTED_LOCATION ${DEP_LIBDIR}/${libs})\n          log_debug(\"SET ${_lib_name}: ${DEP_LIBDIR}/${libs}\")\n      endforeach()\n    endif()\n  else (${shared_count} STREQUAL \"0\")\n    FILE(GLOB children RELATIVE ${DEP_LIBDIR} ${DEP_LIBDIR}/lib*.so)\n    foreach(libs ${children})\n        string(REGEX REPLACE \"^lib\" \"\" _lib_name ${libs})\n        string(REGEX REPLACE \"\\\\.so\" \"\" _lib_name ${_lib_name})\n\n        if(TARGET ${_lib_name})\n            get_property(_lib_name_dir TARGET ${_lib_name}  PROPERTY IMPORTED_LOCATION)\n            log_warn(\"${_lib_name} already add at:${_lib_name_dir} skip ${DEP_LIBDIR}/${libs}\")\n            continue()\n        endif()\n\n        add_library(${_lib_name} SHARED IMPORTED)\n        set_property(TARGET ${_lib_name}  PROPERTY IMPORTED_LOCATION ${DEP_LIBDIR}/${libs})\n        log_debug(\"SET ${_lib_name}: ${DEP_LIBDIR}/${libs}\")\n\n        if (\"${_lib_name}\" MATCHES \"${mkl_regex}\")\n            log_debug(\"${_lib_name}: IMPORTED_NO_SONAME\")\n            set_property(TARGET ${_lib_name}  PROPERTY IMPORTED_NO_SONAME 1)\n        endif()\n\n    endforeach()\n  endif()\nENDMACRO()\n\nMACRO(ADD_THIRD_LIB THIRD_PATH)\n  SUBDIRLIST(SUB_THIRD_DIRS ${THIRD_PATH})\n  message(STATUS \"SUB_THIRD_LIBS: ${SUB_THIRD_DIRS}\")\n  set(cuda8_regex \".*cuda8.*\")\n  set(cuda9_regex \".*cuda9.*\")\n  set(cuda10_regex \".*cuda10.*\")\n\n  foreach(dep ${SUB_THIRD_DIRS})\n      message(STATUS \"dep: ${dep}\")\n      if(\"${dep}\" MATCHES \"${cuda8_regex}\")\n          if(${CUDA8_0})\n            message(STATUS \"add ${THIRD_PATH}/${deps}\")\n            IMPORT_ONE_LIB(${THIRD_PATH}/${dep})\n            set(CUDA_NVCC_FLAGS \"${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -O3 --compiler-options -fno-strict-aliasing -lineinfo -Xptxas -dlcm=cg -use_fast_math -gencode arch=compute_61,code=sm_61 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_52,code=sm_52\" CACHE STRING \"cuda flags\")\n            message(STATUS \"CUDA_NVCC_FLAGS:${CUDA_NVCC_FLAGS}\")\n          endif(${CUDA8_0})\n      elseif(\"${dep}\" MATCHES \"${cuda9_regex}\")\n          if(${CUDA9_0})\n            message(STATUS \"add ${THIRD_PATH}/${deps}\")\n            IMPORT_ONE_LIB(${THIRD_PATH}/${dep})\n            set(CUDA_NVCC_FLAGS \"${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -O3 --compiler-options -fno-strict-aliasing -lineinfo -Xptxas -dlcm=cg -use_fast_math -gencode arch=compute_70,code=sm_70 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_52,code=sm_52\" CACHE STRING \"cuda flags\")\n            message(STATUS \"CUDA_NVCC_FLAGS:${CUDA_NVCC_FLAGS}\")\n          endif(${CUDA9_0})\n      elseif(\"${dep}\" MATCHES \"${cuda10_regex}\")\n          if(${CUDA10_0})\n            message(STATUS \"add ${THIRD_PATH}/${deps}\")\n            IMPORT_ONE_LIB(${THIRD_PATH}/${dep})\n            set(CUDA_NVCC_FLAGS \"${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -O3 --compiler-options -fno-strict-aliasing -lineinfo -Xptxas -dlcm=cg -use_fast_math -gencode arch=compute_75,code=sm_75 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_52,code=sm_52\" CACHE STRING \"cuda flags\")\n            message(STATUS \"CUDA_NVCC_FLAGS:${CUDA_NVCC_FLAGS}\")\n          endif(${CUDA10_0})\n      else(\"${dep}\" MATCHES \"${cuda8_regex}\")\n        message(STATUS \"not cuda8 or cuda9 lib. normal import\")\n        IMPORT_ONE_LIB(${THIRD_PATH}/${dep})\n      endif(\"${dep}\" MATCHES \"${cuda8_regex}\")\n  endforeach()\nENDMACRO()\n\n# Usage in your CMakeLists:\n# Describe property\ndefine_property(GLOBAL PROPERTY GLOBAL_INCLUDE_DIRS\n\t        BRIEF_DOCS \"GLOBAL_INCLUDE_DIRS\"\n\t        FULL_DOCS \"GLOBAL_INCLUDE_DIRS\")\ndefine_property(GLOBAL PROPERTY GLOBAL_LINK_DIRS\n\t\tBRIEF_DOCS \"GLOBAL_LINK_DIRS\"\n\t\tFULL_DOCS \"GLOBAL_LINK_DIRS\")\n# Initialize property\nset_property(GLOBAL PROPERTY GLOBAL_INCLUDE_DIRS \"\")\nset_property(GLOBAL PROPERTY GLOBAL_LINK_DIRS \"\")\n\n\n#build type\n#flag to import CUDA8.0/9.0/10.0\noption(BUILD_CUDA8_0 \"BUILD_CUDA8_0\" OFF)\nset(CUDA8_0 FALSE)\nif(BUILD_CUDA8_0)\n    set(CUDA8_0 TRUE)\nendif(BUILD_CUDA8_0)\n\noption(BUILD_CUDA9_0 \"BUILD_CUDA9_0\" OFF)\nset(CUDA9_0 FALSE)\nif(BUILD_CUDA9_0)\n    set(CUDA9_0 TRUE)\nendif(BUILD_CUDA9_0)\n\noption(BUILD_CUDA10_0 \"BUILD_CUDA10_0\" OFF)\nset(CUDA10_0 FALSE)\nif(BUILD_CUDA10_0)\n    set(CUDA10_0 TRUE)\nendif(BUILD_CUDA10_0)\n\nset(THIRD_PATH  ${CMAKE_SOURCE_DIR}/third_path)\nif(NOT EXISTS ${THIRD_PATH}) \n    set(THIRD_PATH ${CMAKE_SOURCE_DIR}/../third_path)\nendif()\nmessage(STATUS \"THIRD_PATH;${THIRD_PATH}\")\nADD_THIRD_LIB(${THIRD_PATH})\n\nIF(CUDA8_0)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda8_0)\n    include(FindCUDA)\n    message(STATUS \"FindCUDA - CUDA_TOOLKIT_ROOT_DIR: ${THIRD_PATH}/cuda8_0; \")\nELSE(CUDA8_0)\n    IF(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda)\n    include(FindCUDA)\n    ELSE(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    ENDIF()\nENDIF()\n\nIF(CUDA9_0)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda9_0)\n    include(FindCUDA)\n    message(STATUS \"FindCUDA - CUDA_TOOLKIT_ROOT_DIR: ${THIRD_PATH}/cuda9_0; \")\nELSE(CUDA9_0)\n    IF(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda)\n    include(FindCUDA)\n    ELSE(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    ENDIF()\nENDIF()\n\nIF(CUDA10_0)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda10_0)\n    include(FindCUDA)\n    message(STATUS \"FindCUDA - CUDA_TOOLKIT_ROOT_DIR: ${THIRD_PATH}/cuda10_0; \")\nELSE(CUDA10_0)\n    IF(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda)\n    include(FindCUDA)\n    ELSE(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    ENDIF()\nENDIF()\n\n# Get property\nget_property(GLOBAL_INCLUDE_DIRS_LIST GLOBAL PROPERTY GLOBAL_INCLUDE_DIRS)\nget_property(GLOBAL_LINK_DIRS_LIST GLOBAL PROPERTY GLOBAL_LINK_DIRS)\n\nINCLUDE_DIRECTORIES(${GLOBAL_INCLUDE_DIRS_LIST})\nLINK_DIRECTORIES(${GLOBAL_LINK_DIRS_LIST})\n\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/thirdparty.srv.cmake",
    "content": "include(CMakeParseArguments)\n#\n# log_execute_process is same to execute_process but message cmd to log\n#\n\nmacro(log_debug msg)\n    get_filename_component(name ${CMAKE_CURRENT_LIST_FILE} NAME)\n    string(TIMESTAMP TIME_NOW \"%Y-%m-%d %H:%M:%S\")\n    message(\"${TIME_NOW} - ${name}:${CMAKE_CURRENT_LIST_LINE} - ${msg}\")\nendmacro(log_debug)\n\nmacro(log_warn msg)\n    get_filename_component(name ${CMAKE_CURRENT_LIST_FILE} NAME)\n    string(TIMESTAMP TIME_NOW \"%Y-%m-%d %H:%M:%S\")\n    message(WARNING \"${TIME_NOW} - ${name}:${CMAKE_CURRENT_LIST_LINE} - ${msg}\")\nendmacro(log_warn)\n#\nmacro(log_error msg)\n    get_filename_component(name ${CMAKE_CURRENT_LIST_FILE} NAME)\n    string(TIMESTAMP TIME_NOW \"%Y-%m-%d %H:%M:%S\")\n    message(FATAL_ERROR \"${TIME_NOW} - ${name}:${CMAKE_CURRENT_LIST_LINE} - ${msg}\")\nendmacro(log_error)\n\n# debug(K1 K2 K3)\n#\nmacro(debug)\n    FOREACH(A ${ARGN})\n      log_debug(\"${A}:${${A}}\")\n    ENDFOREACH(A)\nendmacro(debug)\n\n###################\n#no Special symbol in cmd\nmacro(log_execute_process)\n    set(options \"\" )\n    set(oneValueArgs WORKING_DIRECTORY )\n    set(multiValueArgs COMMAND)\n    cmake_parse_arguments(log_execute_process \"${options}\" \"${oneValueArgs}\" \"${multiValueArgs}\" ${ARGN})\n    string(REPLACE \";\" \" \" CMD \"${log_execute_process_COMMAND}\")\n\n    if(NOT log_execute_process_WORKING_DIRECTORY)\n         log_error(\"bad cmd:cd ${log_execute_process_WORKING_DIRECTORY} && ${CMD}\")\n    endif()\n\n    if(NOT EXISTS ${log_execute_process_WORKING_DIRECTORY})\n         log_error(\"bad cmd:cd ${log_execute_process_WORKING_DIRECTORY} && ${CMD}\")\n    endif()\n\n    log_debug(\"cd ${log_execute_process_WORKING_DIRECTORY} && ${CMD}\")\n    execute_process(COMMAND ${log_execute_process_COMMAND}\n                    WORKING_DIRECTORY ${log_execute_process_WORKING_DIRECTORY}\n                    RESULT_VARIABLE rv ERROR_VARIABLE er\n                    OUTPUT_FILE ${CMAKE_BINARY_DIR}/cmake_cmd_out.log\n                    ERROR_FILE ${CMAKE_BINARY_DIR}/cmake_error.log)\n    if(rv)\n       log_debug(\"RESULT:${rv}, CMD:${log_execute_process_COMMAND}\")\n       execute_process(COMMAND cat ${CMAKE_BINARY_DIR}/cmake_error.log WORKING_DIRECTORY ${log_execute_process_WORKING_DIRECTORY})\n       log_error(\"fatal error exit!\")\n    endif()\n\nendmacro(log_execute_process)\n\nmacro(backup_and_mv_file)\n    file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/.backup)\n    FOREACH(C ${ARGN})\n        if(EXISTS ${C})\n             log_execute_process(COMMAND mv -f --backup=t ${C} -t ${CMAKE_SOURCE_DIR}/.backup WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})\n        endif()\n    ENDFOREACH(C)\nendmacro(backup_and_mv_file)\n\n\n\nmacro(uncompress_package package output_dirname)\n    get_filename_component(package_name ${package} NAME)\n    get_filename_component(package_path ${package} PATH)\n\n    if(${package_name} MATCHES \".zip$\")\n           string(FIND ${package_name} \".zip\" LAST_POS REVERSE)\n           set(UMCOMPRESS_CMD unzip -o)\n    elseif(${package_name} MATCHES \".tar.gz$\")\n           string(FIND ${package_name} \".tar.gz\" LAST_POS REVERSE)\n           set(UMCOMPRESS_CMD tar zxvf)\n    elseif(${package_name} MATCHES \".tar$\")\n           string(FIND ${package_name} \".tar\" LAST_POS REVERSE)\n           set(UMCOMPRESS_CMD tar xvf)\n    endif()\n\n    string(SUBSTRING ${package_name} 0 ${LAST_POS} dirname)\n    set(package_dirname ${dirname} PARENT_SCOPE)\n\n    if(NOT EXISTS ${output_dirname})\n           file(MAKE_DIRECTORY ${output_dirname})\n    endif()\n\n    if(NOT EXISTS ${output_dirname}/${dirname})\n           log_execute_process(COMMAND ${UMCOMPRESS_CMD} ${package} WORKING_DIRECTORY ${output_dirname})\n    elseif(${package} IS_NEWER_THAN ${output_dirname}/${dirname})\n           #backup_and_mv_file(${output_dirname}/${dirname})\n           log_execute_process(COMMAND rm -fr ${output_dirname}/${dirname} WORKING_DIRECTORY ${output_dirname})\n           log_execute_process(COMMAND ${UMCOMPRESS_CMD} ${package} WORKING_DIRECTORY ${output_dirname})\n    endif()\n    \nendmacro(uncompress_package)\n\n\n#\n# check_and_install(PACKAGE TARGET)\n#\nfunction(check_and_install)\n\n    get_filename_component(install_dir_path ${CMAKE_CURRENT_LIST_FILE} PATH)\n    get_filename_component(install_dir_name ${install_dir_path} NAME)\n\n    set(options \"\" )\n    set(oneValueArgs \"\")\n    set(multiValueArgs PACKAGE TARGET)\n    cmake_parse_arguments(C \"${options}\" \"${oneValueArgs}\" \"${multiValueArgs}\" ${ARGN})\n\n    #0 parse args\n    if(NOT C_PACKAGE OR NOT C_TARGET)\n         log_error(\"check_and_install PACKAGE xx\\n      TARGET xx\\n INSTALL xx\\n  CLEAR xx\\n\")\n    endif()\n    #debug(C_PACKAGE C_TARGET)\n\n    # #1 check is package\n    FOREACH(P ${C_PACKAGE})\n         if(NOT EXISTS ${P})\n              log_error(\"check_and_install: ${P} NOT FOUND\")\n         endif()\n    ENDFOREACH(P)\n\n    #1 check is need rebuild\n    SET(${install_dir_name}_NEED_INSTALL FALSE)\n    FOREACH(P ${C_PACKAGE})\n        FOREACH(T ${C_TARGET})\n             #1.1 target not exists\n             if(NOT EXISTS ${T})\n               SET(${install_dir_name}_NEED_INSTALL TRUE)\n               log_debug(\"check_and_install: ${T} NOT FOUND, INSTALL ${C_PACKAGE} to ${install_dir_path}, ${install_dir_name}_NEED_INSTALL:${${install_dir_name}_NEED_INSTALL}\")\n               \n               break()\n            endif()\n\n            #1.2 target has been changed\n            if(${P} IS_NEWER_THAN ${T})\n               log_debug(\"check_and_install: ${P} newer than ${T}, INSTALL ${C_PACKAGE} to ${install_dir_path}, ${install_dir_name}_NEED_INSTALL:${${install_dir_name}_NEED_INSTALL}\")\n               SET(${install_dir_name}_NEED_INSTALL TRUE)\n               break()\n            endif()\n         ENDFOREACH(T)\n    ENDFOREACH(P)\n\n    #return\n    SET(${install_dir_name}_NEED_INSTALL ${${install_dir_name}_NEED_INSTALL} PARENT_SCOPE)\nendfunction(check_and_install)\n\nfunction(find_and_set_package install_dir_path)\n\n    set(options \"\" )\n    set(oneValueArgs INCLUDE LIB BIN)\n    set(multiValueArgs \"\")\n    cmake_parse_arguments(find_and_set_package \"${options}\" \"${oneValueArgs}\" \"${multiValueArgs}\" ${ARGN})\n\n    if(NOT  find_and_set_package_INCLUDE)\n        SET(find_and_set_package_INCLUDE include)\n    endif()\n    if(NOT find_and_set_package_LIB)\n        SET(find_and_set_package_LIB lib)\n    endif()\n    if(NOT  find_and_set_package_BIN)\n        SET(find_and_set_package_BIN bin)\n    endif()\n\n    get_filename_component(install_dir_name ${install_dir_path} NAME)\n    set(PRE ${install_dir_name})\n    set(${PRE}_INSTALL_DIR ${install_dir_path})\n    SET(${PRE}_INCLUDE ${${PRE}_INSTALL_DIR}/${find_and_set_package_INCLUDE})\n    SET(${PRE}_LIB ${${PRE}_INSTALL_DIR}/${find_and_set_package_LIB})\n    SET(${PRE}_BIN ${${PRE}_INSTALL_DIR}/${find_and_set_package_BIN})\n    \n\n    # include\n    if(NOT EXISTS ${${PRE}_INCLUDE} )\n         log_error(\"${PRE}_INCLUDE:${${PRE}_INCLUDE} NOT FOUND, Please check_and_install first!\")\n    endif()\n    file(GLOB_RECURSE ${PRE}_INCLUDES  ${${PRE}_INCLUDE}/*.h)\n    #if(NOT ${PRE}_INCLUDES)\n    #    log_warn(\"${${PRE}_INCLUDE} NOT FOUND HEADES, Please check_and_install first!\")\n    #endif()\n\n    # use lib64 instead \n    if(NOT EXISTS ${${PRE}_LIB})\n        SET(${PRE}_LIB  ${${PRE}_INSTALL_DIR}/lib64)\n    endif()    \n    # libs\n    if(NOT EXISTS ${${PRE}_LIB} )\n         log_error(\"${${PRE}_LIB} NOT FOUND, Please check_and_install first!\")\n    endif()   \n\n\n    #static lib\n    file(GLOB ${PRE}_STATIC_LIBS ${${PRE}_LIB}/lib*.a)\n    FOREACH(A ${${PRE}_STATIC_LIBS})\n         get_filename_component(_lib_file_name ${A} NAME_WE)\n         string(SUBSTRING  ${_lib_file_name} 3 -1  _lib_name)\n         if(NOT _lib_name)\n              log_error(\"Bad lib name: ${A} in ${${PRE}_LIB}\")\n         endif()\n\n        SET(${_lib_name}_A ${A} PARENT_SCOPE)\n        add_library(${_lib_name}-static STATIC IMPORTED)\n        set_property(TARGET ${_lib_name}-static PROPERTY IMPORTED_LOCATION ${A})\n        log_debug(\"SET ${_lib_name}-static: ${A}\")\n    ENDFOREACH(A)\n\n    #sharelib\n    file(GLOB ${PRE}_SHARED_LIBS ${${PRE}_LIB}/lib*.so)\n    FOREACH(A ${${PRE}_SHARED_LIBS})\n         get_filename_component(_lib_file_name ${A} NAME_WE)\n         string(SUBSTRING  ${_lib_file_name} 3 -1  _lib_name)\n         if(NOT _lib_name)\n              log_error(\"Bad lib name: ${A} in ${${PRE}_LIB}\")\n         endif()\n\n        SET(${_lib_name}_SO ${A})\n        add_library(${_lib_name}-shared SHARED IMPORTED)\n        set_property(TARGET ${_lib_name}-shared PROPERTY IMPORTED_LOCATION ${A})\n        log_debug(\"SET ${_lib_name}-shared: ${A}\")\n    ENDFOREACH(A)\n\n    # cmds\n    file(GLOB ${PRE}_BINS ${${PRE}_BIN}/*)\n    FOREACH(A ${${PRE}_BINS})\n        get_filename_component(P ${A} NAME)\n        SET(${P}_BIN ${A})\n        log_debug(\"SET ${P}_BIN: ${${P}_BIN}\")\n        SET(${P}_BIN ${A} PARENT_SCOPE)\n    ENDFOREACH(A)\n\n    # FILES for ide\n    #file(GLOB_RECURSE ${PRE}_FILES ${install_dir_path}/*)\n\n    #source_group(${PRE}_IDE_VS FILES ${${PRE}_FILES})\n    #add_custom_target(${PRE}_IDE_QT SOURCES  ${${PRE}_FILES})\n\n    #export to parent\n    #set(PRE ${PRE} PARENT_SCOPE)\n    #set(${PRE}_INSTALL_DIR ${${PRE}_INSTALL_DIR}  PARENT_SCOPE)\n    SET(${PRE}_INCLUDE ${${PRE}_INCLUDE} PARENT_SCOPE)\n    SET(${PRE}_LIB ${${PRE}_LIB} PARENT_SCOPE)\n    SET(${PRE}_BIN ${${PRE}_BIN} PARENT_SCOPE)\n\n    #set(${PRE}_INCLUDES ${${PRE}_INCLUDES} PARENT_SCOPE)\n    #set(${PRE}_STATIC_LIBS ${${PRE}_STATIC_LIBS} PARENT_SCOPE)\n    #set(${PRE}_SHARED_LIBS ${${PRE}_SHARED_LIBS} PARENT_SCOPE)\n    #set(${PRE}_BINS ${${PRE}_BINS} PARENT_SCOPE)\n\n    #set(${PRE}_FILES ${${PRE}_FILES} PARENT_SCOPE)\n    set(${PRE}_FOUND TRUE PARENT_SCOPE)\n\nendfunction(find_and_set_package)\n\n# include all subdirs\nfunction(recurse_include_directories DIR)\n\n    file(GLOB_RECURSE _header_files FOLLOW_SYMLINKS ${DIR}/*.h)\n    \n    set(files_dirs \"\")\n    foreach(src_file ${_header_files})        \n             GET_FILENAME_COMPONENT(dir_path ${src_file} PATH)\n             list(APPEND files_dirs ${dir_path})\n    endforeach()\n    LIST(REMOVE_DUPLICATES files_dirs)\n    \n    include_directories(${DIR})\n    foreach(H ${files_dirs})\n         include_directories(${H})\n    endforeach(H)\n    \n    set(DIR_HEADERS ${_header_files} PARENT_SCOPE)\nendfunction(recurse_include_directories)\n\n\nfunction(add_source_to_qtcreator DIR)\n    get_filename_component(dir_name ${DIR} NAME)\n    string(REGEX REPLACE \"/\" \"_\" source_target ${DIR})\n    set(source_target \"${dir_name}_${source_target}\")\n\n    log_debug(\"add_files_to_qtcreator: ${source_target}\")\n    \n    # all header store in HEADERS_${DIR}\n    #recurse_include_directories(${DIR}) \n    \n    # all c files .c / .cc / .cpp to c_src_files\n    file(GLOB_RECURSE c_src_files FOLLOW_SYMLINKS ${DIR}/*[c|p|e])\n    \n    set(other_files \"\")\n    foreach(suffix ${ARGN})\n          file(GLOB_RECURSE other_src_files FOLLOW_SYMLINKS ${DIR}/*.${suffix})\n          list(APPEND other_files ${other_src_files})\n    endforeach()\n    LIST(REMOVE_DUPLICATES other_files)\n    \n    add_custom_target(${source_target}\n         SOURCES ${DIR_HEADERS} ${c_src_files} ${other_files}\n         WORKING_DIRECTORY ${DIR})\n    \n    set(DIR_ALLS  ${DIR_HEADERS} ${c_src_files} ${other_files} PARENT_SCOPE)\nendfunction(add_source_to_qtcreator)\n\n\nmacro(add_test_item)\n\n    set(options \"\" )\n    set(oneValueArgs \"\")\n    set(multiValueArgs SOURCES INCLUDES LIBS)\n    cmake_parse_arguments(C \"${options}\" \"${oneValueArgs}\" \"${multiValueArgs}\" ${ARGN})\n    \n    SET(TARGET \"\")\n    FOREACH(P ${C_SOURCES})\n         get_filename_component(FILE_NAME ${P} NAME_WE)\n         SET(TARGET \"${FILE_NAME}\")\n         \n         if(${TARGET} MATCHES \"test_*\")\n             break()\n         endif()\n    ENDFOREACH(P)\n    \n    add_executable(${TARGET} ${C_SOURCES})\n\n    if(C_INCLUDES)\n        target_include_directories(${TARGET} PUBLIC ${C_INCLUDES})\n    endif()\n\n    if(C_LIBS)\n       target_link_libraries(${TARGET} ${C_LIBS})\n    endif()  \n    \n    add_test(NAME ${TARGET} COMMAND ${TARGET} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})\n    log_debug(\"add_test:${TARGET}, srcs: ${C_SOURCES}\")\n    \nendmacro(add_test_item)\n\n\n# ngx_add_dynamic_module(DIR xxx SOURCES XXXX LIBS XXXX)\nmacro(ngx_add_dynamic_module)\n\n    set(options \"\" )\n    set(oneValueArgs \"DIR\")\n    set(multiValueArgs SOURCES INCLUDES LIBS)\n    cmake_parse_arguments(C \"${options}\" \"${oneValueArgs}\" \"${multiValueArgs}\" ${ARGN})\n    \n    if(NOT C_SOURCES)\n       file(GLOB C_SRCS \"${C_DIR}/*.c\")\n       file(GLOB C_HEADERS \"${C_DIR}/*.h\")\n       file(GLOB CC_SRCS \"${C_DIR}/*.cc\")\n       file(GLOB CPP_SRCS \"${C_DIR}/*.cpp\")\n       file(GLOB HPP_SRCS \"${C_DIR}/*.hpp\")       \n       SET(C_SOURCES ${C_SRCS} ${C_HEADERS} ${CC_SRCS} ${CPP_SRCS} ${HPP_SRCS})\n       #debug(C_SOURCES C_SRCS CMAKE_CURRENT_SOURCE_DIR)\n    endif()\n    \n    get_filename_component(module_name ${C_DIR} NAME)\n    \n    log_debug(\"add_dynamic_module:${module_name}, srcs: ${C_SOURCES}\")\n    add_library(${module_name} SHARED ${C_SOURCES})\n\n    if(C_INCLUDES)\n       target_include_directories(${module_name} PUBLIC ${C_INCLUDES})\n    endif()\n    \n    if(C_LIBS)\n       target_link_libraries(${module_name} PUBLIC ${C_LIBS})\n    endif()\n\n    INSTALL(TARGETS ${C_DIR} DESTINATION shared)\n\nendmacro(ngx_add_dynamic_module)\n\n# ngx_add_static_module(DIR xxx SOURCES XXXX INCLUDES XXXLIBS XXXX)\nmacro(ngx_add_static_module)\n\n    set(options \"\" )\n    set(oneValueArgs \"DIR\")\n    set(multiValueArgs SOURCES INCLUDES LIBS)\n    cmake_parse_arguments(C \"${options}\" \"${oneValueArgs}\" \"${multiValueArgs}\" ${ARGN})\n    \n    if(NOT C_SOURCES)\n       file(GLOB C_SRCS \"${C_DIR}/*.c\")\n       file(GLOB C_HEADERS \"${C_DIR}/*.h\")\n       file(GLOB CC_SRCS \"${C_DIR}/*.cc\")\n       file(GLOB CPP_SRCS \"${C_DIR}/*.cpp\")\n       file(GLOB HPP_SRCS \"${C_DIR}/*.hpp\")       \n       SET(C_SOURCES ${C_SRCS} ${C_HEADERS} ${CC_SRCS} ${CPP_SRCS} ${HPP_SRCS})\n       #debug(C_SOURCES C_SRCS CMAKE_CURRENT_SOURCE_DIR)\n    endif()\n    \n    get_filename_component(module_name ${C_DIR} NAME)\n\n\n\n    log_debug(\"add_static_module:${module_name}, srcs: ${C_SOURCES}\")\n    add_library(${module_name} STATIC ${C_SOURCES})\n\n    if(C_INCLUDES)\n       target_include_directories(${module_name} PUBLIC ${C_INCLUDES})\n    endif()\n    \n    if(C_LIBS)\n       # target is nginx static link\n       target_link_libraries(nginx PUBLIC ${module_name} ${C_LIBS})\n    else()\n       target_link_libraries(nginx PUBLIC ${module_name})\n    endif()\n\n    #INSTALL(TARGETS ${C_DIR} DESTINATION shared)\nendmacro(ngx_add_static_module)\n\n\nfunction(grpc_gen_code SRCS HDRS)\n  if(NOT ARGN)\n    message(SEND_ERROR \"Error: grpc_gen_code() called without any proto files\")\n    return()\n  endif()\n\n  set(PROTOBUF_GENERATE_CPP_APPEND_PATH TRUE)\n  if(PROTOBUF_GENERATE_CPP_APPEND_PATH)\n    # Create an include path for each file specified\n    foreach(FIL ${ARGN})\n      get_filename_component(ABS_FIL ${FIL} ABSOLUTE)\n      get_filename_component(ABS_PATH ${ABS_FIL} PATH)\n      list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)\n      if(${_contains_already} EQUAL -1)\n          list(APPEND _protobuf_include_path -I ${ABS_PATH})\n      endif()\n    endforeach()\n  else()\n    set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})\n  endif()\n\n  if(DEFINED PROTOBUF_IMPORT_DIRS)\n    foreach(DIR ${PROTOBUF_IMPORT_DIRS})\n      get_filename_component(ABS_PATH ${DIR} ABSOLUTE)\n      list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)\n      if(${_contains_already} EQUAL -1)\n          list(APPEND _protobuf_include_path -I ${ABS_PATH})\n      endif()\n    endforeach()\n  endif()\n\n  set(${SRCS})\n  set(${HDRS})\n  \n  foreach(FIL ${ARGN})\n    get_filename_component(ABS_FIL ${FIL} ABSOLUTE)\n    get_filename_component(FIL_WE ${FIL} NAME_WE)\n\n    list(APPEND ${SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.grpc.pb.cc)\n    list(APPEND ${HDRS} ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.grpc.pb.h)\n    \n    add_custom_command(\n      OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.grpc.pb.cc\n             ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.grpc.pb.h\n             ${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_mock.grpc.pb.h\n      COMMAND ${protoc_BIN}\n      ARGS --grpc_out=generate_mock_code=true:${CMAKE_CURRENT_BINARY_DIR}\n           --cpp_out=${CMAKE_CURRENT_BINARY_DIR}\n           --plugin=protoc-gen-grpc=${grpc_cpp_plugin_BIN}\n           ${_protobuf_include_path}\n           ${ABS_FIL}\n      DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}\n      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}\n      COMMENT \"Running gRPC C++ protocol buffer compiler on ${FIL}\"\n      VERBATIM)\n\n  endforeach()\n\n  set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)\n  \n  set(${SRCS} ${${SRCS}} PARENT_SCOPE)\n  set(${HDRS} ${${HDRS}} PARENT_SCOPE)\nendfunction()\n\nmacro(add_shared_library DIR)\n\n    SET(LIB_DIR ${DIR}/lib)\n    if(NOT EXISTS ${LIB_DIR})\n        SET(LIB_DIR ${DIR}/lib64)\n    endif()\n\n    INCLUDE_DIRECTORIES(${DIR}/include)\n\n\n    foreach(libname ${ARGN})\n            add_library(${libname} SHARED IMPORTED)\n            set_property(TARGET ${libname} PROPERTY IMPORTED_LOCATION ${LIB_DIR}/lib${libname}.so)            \n    endforeach()\n    log_debug(\"add_shared_library: ${ARGN} in: ${DIR}\")\nendmacro(add_shared_library)\n\nmacro(add_static_library DIR)\n    set_property(GLOBAL APPEND PROPERTY GLOBAL_INCLUDE_DIRS \"${DIR}/include\")\n    SET(LIB_DIR ${DIR}/lib)\n    if(NOT EXISTS ${LIB_DIR})\n        SET(LIB_DIR ${DIR}/lib64)\n    endif()\n    set_property(GLOBAL APPEND PROPERTY GLOBAL_LINK_DIRS ${LIB_DIR})\n    INCLUDE_DIRECTORIES(${DIR}/include)\n    #add_files_to_qtcreator(${DIR}/include .h .hpp)\n    foreach(libname ${ARGN})\n      add_library(${libname} STATIC IMPORTED)\n      set_property(TARGET ${libname} PROPERTY IMPORTED_LOCATION ${DIR}/lib/lib${libname}.a)\n    endforeach()\n    log_debug(\"add_static_library: ${ARGN} in: ${DIR}\")\nendmacro(add_static_library)\n\n\nfunction(protoc_gen_code SRCS HDRS)\n  if(NOT ARGN)\n    message(SEND_ERROR \"Error: protoc_gen_code() called without any proto files\")\n    return()\n  endif()\n\n  set(PROTOBUF_GENERATE_CPP_APPEND_PATH TRUE)\n  if(PROTOBUF_GENERATE_CPP_APPEND_PATH)\n    # Create an include path for each file specified\n    foreach(FIL ${ARGN})\n      get_filename_component(ABS_FIL ${FIL} ABSOLUTE)\n      get_filename_component(ABS_PATH ${ABS_FIL} PATH)\n      list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)\n      if(${_contains_already} EQUAL -1)\n          list(APPEND _protobuf_include_path -I ${ABS_PATH})\n      endif()\n    endforeach()\n  else()\n    set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})\n  endif()\n\n  if(DEFINED PROTOBUF_IMPORT_DIRS)\n    foreach(DIR ${PROTOBUF_IMPORT_DIRS})\n      get_filename_component(ABS_PATH ${DIR} ABSOLUTE)\n      list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)\n      if(${_contains_already} EQUAL -1)\n          list(APPEND _protobuf_include_path -I ${ABS_PATH})\n      endif()\n    endforeach()\n  endif()\n\n  set(${SRCS})\n  set(${HDRS})\n  \n  foreach(FIL ${ARGN})\n    get_filename_component(ABS_FIL ${FIL} ABSOLUTE)\n    get_filename_component(FIL_WE ${FIL} NAME_WE)\n    get_filename_component(FIL_PATH ${FIL} DIRECTORY)\n\n    list(APPEND ${SRCS} ${FIL_PATH}/${FIL_WE}.pb.cc)\n    list(APPEND ${HDRS} ${FIL_PATH}/${FIL_WE}.pb.h)\n    \n    #message(\"${${SRCS}} ${${HDRS}}\")\n    add_custom_command(\n      OUTPUT ${FIL_PATH}/${FIL_WE}.pb.cc\n             ${FIL_PATH}/${FIL_WE}.pb.h\n             #${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_mock.grpc.pb.h\n      COMMAND ${protoc_BIN}\n      ARGS --cpp_out=${FIL_PATH}\n           ${_protobuf_include_path}\n           ${ABS_FIL}\n      DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}\n      WORKING_DIRECTORY ${FIL_PATH}\n      COMMENT \"Running C++ protocol buffer compiler on ${FIL}\"\n      VERBATIM)\n\n  endforeach()\n\n  set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)\n  \n  set(${SRCS} ${${SRCS}} PARENT_SCOPE)\n  set(${HDRS} ${${HDRS}} PARENT_SCOPE)\nendfunction()\n\n\nMACRO(SUBDIRLIST result curdir)\n    FILE(GLOB children RELATIVE ${curdir} ${curdir}/[a-zA-Z0-9]*)\n  SET(dirlist \"\")\n  FOREACH(child ${children})\n    IF(IS_DIRECTORY ${curdir}/${child})\n      LIST(APPEND dirlist ${child})\n    ENDIF()\n  ENDFOREACH()\n  SET(${result} ${dirlist})\nENDMACRO()\n\nMACRO(IMPORT_ONE_LIB dep)\n    # include every include\n    SET(CURRENT_DIR ${dep}/include)\n    if(IS_DIRECTORY ${CURRENT_DIR})\n        INCLUDE_DIRECTORIES(${CURRENT_DIR})\n    endif()\n\n    set(mkl_regex \".*mkl.*\")\n    # #for bin file\n    # FILE(GLOB children RELATIVE ${dep}/bin ${dep}/bin/*)\n    # foreach(_bin_name ${children})\n    #     if(TARGET ${_bin_name})\n    #         get_property(_bin_dir TARGET ${_bin_name}  PROPERTY IMPORTED_LOCATION)\n    #         log_warn(\"${_bin_name} already add at:${_bin_dir} skip ${dep}/bin/${_bin_name}\")\n    #         continue()\n    #     endif()\n\n    #     add_executable(${_bin_name} IMPORTED)\n    #     set_property(TARGET ${_bin_name} PROPERTY IMPORTED_LOCATION ${dep}/bin/${_bin_name})\n    #     log_debug(\"SET ${_bin_name}: ${dep}/bin/${_bin_name}\")\n    # endforeach()\n\n    #for lib file\n    foreach(CURRENT_DIR ${dep}/lib64 ${dep}/lib)\n\n        FILE(GLOB children RELATIVE ${CURRENT_DIR} ${CURRENT_DIR}/lib*.a)\n        foreach(libs ${children})\n            string(REGEX REPLACE \"^lib\" \"\" _lib_name ${libs})\n            string(REGEX REPLACE \"\\\\.a\" \"\" _lib_name ${_lib_name})\n            #set(_lib_name ${_lib_name})\n\n            if(TARGET ${_lib_name})\n                get_property(_lib_name_dir TARGET ${_lib_name}  PROPERTY IMPORTED_LOCATION)\n                log_warn(\"${_lib_name} already add at:${_lib_name_dir} skip ${CURRENT_DIR}/${libs}\")\n                continue()\n            endif()\n\n            add_library(${_lib_name} STATIC IMPORTED)\n            set_property(TARGET ${_lib_name}  PROPERTY IMPORTED_LOCATION ${CURRENT_DIR}/${libs})\n            log_debug(\"SET ${_lib_name}: ${CURRENT_DIR}/${libs}\")\n        endforeach()\n\n        #for lib file\n        FILE(GLOB children RELATIVE ${CURRENT_DIR} ${CURRENT_DIR}/lib*.so)\n        foreach(libs ${children})\n            string(REGEX REPLACE \"^lib\" \"\" _lib_name ${libs})\n            string(REGEX REPLACE \"\\\\.so\" \"\" _lib_name ${_lib_name})\n            set(_lib_name ${_lib_name}-so)\n\n            if(TARGET ${_lib_name})\n                get_property(_lib_name_dir TARGET ${_lib_name}  PROPERTY IMPORTED_LOCATION)\n                log_warn(\"${_lib_name} already add at:${_lib_name_dir} skip ${CURRENT_DIR}/${libs}\")\n                continue()\n            endif()\n\n            add_library(${_lib_name} SHARED IMPORTED)\n            set_property(TARGET ${_lib_name}  PROPERTY IMPORTED_LOCATION ${CURRENT_DIR}/${libs})\n            log_debug(\"SET ${_lib_name}: ${CURRENT_DIR}/${libs}\")\n\n            if (\"${_lib_name}\" MATCHES \"${mkl_regex}\")\n                log_debug(\"${_lib_name}: IMPORTED_NO_SONAME\")\n                set_property(TARGET ${_lib_name}  PROPERTY IMPORTED_NO_SONAME 1)\n            endif()\n\n        endforeach()\n    endforeach()\nENDMACRO()\n\n\nMACRO(ADD_THIRD_LIB THIRD_PATH)\n  SUBDIRLIST(SUB_THIRD_DIRS ${THIRD_PATH})\n  message(STATUS \"SUB_THIRD_LIBS: ${SUB_THIRD_DIRS}\")\n\n  set(cuda8_regex \".*cuda8.*\")\n  set(cuda9_regex \".*cuda9.*\")\n  set(cuda10_regex \".*cuda10.*\")\n\n  foreach(dep ${SUB_THIRD_DIRS})\n      message(STATUS \"dep: ${dep}\")\n      if(\"${dep}\" MATCHES \"${cuda8_regex}\")\n          if(${CUDA8_0})\n            message(STATUS \"add ${THIRD_PATH}/${deps}\")\n            IMPORT_ONE_LIB(${THIRD_PATH}/${dep})\n            set(CUDA_NVCC_FLAGS \"${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -O3 --compiler-options -fno-strict-aliasing -lineinfo -Xptxas -dlcm=cg -use_fast_math -gencode arch=compute_61,code=sm_61 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_52,code=sm_52\" CACHE STRING \"cuda flags\")\n            message(STATUS \"CUDA_NVCC_FLAGS:${CUDA_NVCC_FLAGS}\")\n          endif(${CUDA8_0})\n      elseif(\"${dep}\" MATCHES \"${cuda9_regex}\")\n          if(${CUDA9_0})\n            message(STATUS \"add ${THIRD_PATH}/${deps}\")\n            IMPORT_ONE_LIB(${THIRD_PATH}/${dep})\n            set(CUDA_NVCC_FLAGS \"${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -O3 --compiler-options -fno-strict-aliasing -lineinfo -Xptxas -dlcm=cg -use_fast_math -gencode arch=compute_70,code=sm_70 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_52,code=sm_52\" CACHE STRING \"cuda flags\")\n            message(STATUS \"CUDA_NVCC_FLAGS:${CUDA_NVCC_FLAGS}\")\n          endif(${CUDA9_0})\n      elseif(\"${dep}\" MATCHES \"${cuda10_regex}\")\n          if(${CUDA10_0})\n            message(STATUS \"add ${THIRD_PATH}/${deps}\")\n            IMPORT_ONE_LIB(${THIRD_PATH}/${dep})\n            set(CUDA_NVCC_FLAGS \"${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -O3 --compiler-options -fno-strict-aliasing -lineinfo -Xptxas -dlcm=cg -use_fast_math -gencode arch=compute_75,code=sm_75 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_52,code=sm_52\" CACHE STRING \"cuda flags\")\n            message(STATUS \"CUDA_NVCC_FLAGS:${CUDA_NVCC_FLAGS}\")\n          endif(${CUDA10_0})\n      else(\"${dep}\" MATCHES \"${cuda8_regex}\")\n        message(STATUS \"not cuda8 or cuda9 lib. normal import\")\n        IMPORT_ONE_LIB(${THIRD_PATH}/${dep})\n      endif(\"${dep}\" MATCHES \"${cuda8_regex}\")\n  endforeach()\nENDMACRO()\n\n\nMACRO(INSTALL_SO LIB_DIR)\n# todo copy by bin\n    foreach(so_target ${ARGN})\n       get_property(SO_FILE TARGET ${so_target} PROPERTY IMPORTED_LOCATION)\n\n       if(SO_FILE MATCHES \".so$\")\n           log_debug(\"INSTALL LIBRARY ${SO_FILE}\")\n           file(GLOB ALL_SOS \"${SO_FILE}*\")\n           INSTALL(FILES ${ALL_SOS} DESTINATION ${LIB_DIR})\n       endif()\n    endforeach()\n\nENDMACRO()\n\nMACRO(INSTALL_BIN BIN_DIR)\n    foreach(bin_target ${ARGN})\n        get_property(BIN_FILE TARGET ${bin_target} PROPERTY IMPORTED_LOCATION)\n        log_debug(\"INSTALL BINARY ${BIN_FILE}\")\n        INSTALL(FILES ${BIN_FILE} DESTINATION ${BIN_DIR})\n    endforeach()\nENDMACRO()\n\n#build type\n#flag to import CUDA8.0/9.0/10.0\noption(BUILD_CUDA8_0 \"BUILD_CUDA8_0\" OFF)\nset(CUDA8_0 FALSE)\nif(BUILD_CUDA8_0)\n    set(CUDA8_0 TRUE)\nendif(BUILD_CUDA8_0)\n\noption(BUILD_CUDA9_0 \"BUILD_CUDA9_0\" OFF)\nset(CUDA9_0 FALSE)\nif(BUILD_CUDA9_0)\n    set(CUDA9_0 TRUE)\nendif(BUILD_CUDA9_0)\n\noption(BUILD_CUDA10_0 \"BUILD_CUDA10_0\" OFF)\nset(CUDA10_0 FALSE)\nif(BUILD_CUDA10_0)\n    set(CUDA10_0 TRUE)\nendif(BUILD_CUDA10_0)\n\nset(THIRD_PATH  ${CMAKE_SOURCE_DIR}/third_path)\nif(NOT EXISTS ${THIRD_PATH}) \n    set(THIRD_PATH ${CMAKE_SOURCE_DIR}/../third_path)\nendif()\nmessage(STATUS \"THIRD_PATH;${THIRD_PATH}\")\n\nADD_THIRD_LIB(${THIRD_PATH})\n\n\nIF(CUDA8_0)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda8_0)\n    include(FindCUDA)\n    message(STATUS \"FindCUDA - CUDA_TOOLKIT_ROOT_DIR: ${THIRD_PATH}/cuda8_0; \")\nELSE(CUDA8_0)\n    IF(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda)\n    include(FindCUDA)\n    ELSE(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    ENDIF()\nENDIF()\n\nIF(CUDA9_0)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda9_0)\n    include(FindCUDA)\n    message(STATUS \"FindCUDA - CUDA_TOOLKIT_ROOT_DIR: ${THIRD_PATH}/cuda9_0; \")\nELSE(CUDA9_0)\n    IF(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda)\n    include(FindCUDA)\n    ELSE(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    ENDIF()\nENDIF()\n\nIF(CUDA10_0)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda10_0)\n    include(FindCUDA)\n    message(STATUS \"FindCUDA - CUDA_TOOLKIT_ROOT_DIR: ${THIRD_PATH}/cuda10_0; \")\nELSE(CUDA10_0)\n    IF(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    set(CUDA_TOOLKIT_ROOT_DIR ${THIRD_PATH}/cuda)\n    include(FindCUDA)\n    ELSE(IS_DIRECTORY ${THIRD_PATH}/cuda)\n    ENDIF()\nENDIF()\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/types/CMakeLists.txt",
    "content": "find_package(Protobuf REQUIRED)\n\nlist(APPEND IMPORT_DIRS \"${PROJECT_SOURCE_DIR}\")\nGENERATE_PROTOBUF_LIB(\"${IMPORT_DIRS}\" \"\")\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/types/code/code.error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage code\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc (x *CgoError) Error() string {\n\tvar msg strings.Builder\n\tmsg.WriteString(fmt.Sprintf(\"cgo (%d)\", x.GetErrorCode()))\n\tif x.GetErrorMessage() != \"\" {\n\t\tmsg.WriteString(fmt.Sprintf(\", %s\", x.GetErrorMessage()))\n\t}\n\tif x.GetSdkErrorCode() != 0 {\n\t\tmsg.WriteString(fmt.Sprintf(\": sdk(%d)\", x.GetSdkErrorCode()))\n\t\tif x.GetSdkErrorMessage() != \"\" {\n\t\t\tmsg.WriteString(fmt.Sprintf(\", %s\", x.GetSdkErrorMessage()))\n\t\t}\n\t}\n\treturn msg.String()\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/types/code/sdk-go.code.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.17.3\n// source: types/code/sdk-go.code.proto\n\npackage code\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Code int32\n\nconst (\n\t// OK is returned on success.\n\tCode_OK Code = 0\n\t// Canceled indicates the operation was canceled (typically by the\n\t// caller).\n\t//\n\t// The gRPC framework will generate this error code when cancellation\n\t// is requested.\n\tCode_Canceled Code = 1\n\t// Unknown error. An example of where this error may be returned is\n\t// if a Status value received from another address space belongs to\n\t// an error-space that is not known in this address space. Also\n\t// errors raised by APIs that do not return enough error information\n\t// may be converted to this error.\n\t//\n\t// The gRPC framework will generate this error code in the above two\n\t// mentioned cases.\n\tCode_Unknown Code = 2\n\t// InvalidArgument indicates client specified an invalid argument.\n\t// Note that this differs from FailedPrecondition. It indicates arguments\n\t// that are problematic regardless of the state of the system\n\t// (e.g., a malformed file name).\n\t//\n\t// This error code will not be generated by the gRPC framework.\n\tCode_InvalidArgument Code = 3\n\t// DeadlineExceeded means operation expired before completion.\n\t// For operations that change the state of the system, this error may be\n\t// returned even if the operation has completed successfully. For\n\t// example, a successful response from a server could have been delayed\n\t// long enough for the deadline to expire.\n\t//\n\t// The gRPC framework will generate this error code when the deadline is\n\t// exceeded.\n\tCode_DeadlineExceeded Code = 4\n\t// NotFound means some requested entity (e.g., file or directory) was\n\t// not found.\n\t//\n\t// This error code will not be generated by the gRPC framework.\n\tCode_NotFound Code = 5\n\t// AlreadyExists means an attempt to create an entity failed because one\n\t// already exists.\n\t//\n\t// This error code will not be generated by the gRPC framework.\n\tCode_AlreadyExists Code = 6\n\t// PermissionDenied indicates the caller does not have permission to\n\t// execute the specified operation. It must not be used for rejections\n\t// caused by exhausting some resource (use ResourceExhausted\n\t// instead for those errors). It must not be\n\t// used if the caller cannot be identified (use Unauthenticated\n\t// instead for those errors).\n\t//\n\t// This error code will not be generated by the gRPC core framework,\n\t// but expect authentication middleware to use it.\n\tCode_PermissionDenied Code = 7\n\t// ResourceExhausted indicates some resource has been exhausted, perhaps\n\t// a per-user quota, or perhaps the entire file system is out of space.\n\t//\n\t// This error code will be generated by the gRPC framework in\n\t// out-of-memory and server overload situations, or when a message is\n\t// larger than the configured maximum size.\n\tCode_ResourceExhausted Code = 8\n\t// FailedPrecondition indicates operation was rejected because the\n\t// system is not in a state required for the operation's execution.\n\t// For example, directory to be deleted may be non-empty, an rmdir\n\t// operation is applied to a non-directory, etc.\n\t//\n\t// A litmus test that may help a service implementor in deciding\n\t// between FailedPrecondition, Aborted, and Unavailable:\n\t//  (a) Use Unavailable if the client can retry just the failing call.\n\t//  (b) Use Aborted if the client should retry at a higher-level\n\t//      (e.g., restarting a read-modify-write sequence).\n\t//  (c) Use FailedPrecondition if the client should not retry until\n\t//      the system state has been explicitly fixed. E.g., if an \"rmdir\"\n\t//      fails because the directory is non-empty, FailedPrecondition\n\t//      should be returned since the client should not retry unless\n\t//      they have first fixed up the directory by deleting files from it.\n\t//  (d) Use FailedPrecondition if the client performs conditional\n\t//      REST Get/Update/Delete on a resource and the resource on the\n\t//      server does not match the condition. E.g., conflicting\n\t//      read-modify-write on the same resource.\n\t//\n\t// This error code will not be generated by the gRPC framework.\n\tCode_FailedPrecondition Code = 9\n\t// Aborted indicates the operation was aborted, typically due to a\n\t// concurrency issue like sequencer check failures, transaction aborts,\n\t// etc.\n\t//\n\t// See litmus test above for deciding between FailedPrecondition,\n\t// Aborted, and Unavailable.\n\t//\n\t// This error code will not be generated by the gRPC framework.\n\tCode_Aborted Code = 10\n\t// OutOfRange means operation was attempted past the valid range.\n\t// E.g., seeking or reading past end of file.\n\t//\n\t// Unlike InvalidArgument, this error indicates a problem that may\n\t// be fixed if the system state changes. For example, a 32-bit file\n\t// system will generate InvalidArgument if asked to read at an\n\t// offset that is not in the range [0,2^32-1], but it will generate\n\t// OutOfRange if asked to read from an offset past the current\n\t// file size.\n\t//\n\t// There is a fair bit of overlap between FailedPrecondition and\n\t// OutOfRange. We recommend using OutOfRange (the more specific\n\t// error) when it applies so that callers who are iterating through\n\t// a space can easily look for an OutOfRange error to detect when\n\t// they are done.\n\t//\n\t// This error code will not be generated by the gRPC framework.\n\tCode_OutOfRange Code = 11\n\t// Unimplemented indicates operation is not implemented or not\n\t// supported/enabled in this service.\n\t//\n\t// This error code will be generated by the gRPC framework. Most\n\t// commonly, you will see this error code when a method implementation\n\t// is missing on the server. It can also be generated for unknown\n\t// compression algorithms or a disagreement as to whether an RPC should\n\t// be streaming.\n\tCode_Unimplemented Code = 12\n\t// Internal errors. Means some invariants expected by underlying\n\t// system has been broken. If you see one of these errors,\n\t// something is very broken.\n\t//\n\t// This error code will be generated by the gRPC framework in several\n\t// internal error conditions.\n\tCode_Internal Code = 13\n\t// Unavailable indicates the service is currently unavailable.\n\t// This is a most likely a transient condition and may be corrected\n\t// by retrying with a backoff. Note that it is not always safe to retry\n\t// non-idempotent operations.\n\t//\n\t// See litmus test above for deciding between FailedPrecondition,\n\t// Aborted, and Unavailable.\n\t//\n\t// This error code will be generated by the gRPC framework during\n\t// abrupt shutdown of a server process or network connection.\n\tCode_Unavailable Code = 14\n\t// DataLoss indicates unrecoverable data loss or corruption.\n\t//\n\t// This error code will not be generated by the gRPC framework.\n\tCode_DataLoss Code = 15\n\t// Unauthenticated indicates the request does not have valid\n\t// authentication credentials for the operation.\n\t//\n\t// The gRPC framework will generate this error code when the\n\t// authentication metadata is invalid or a Credentials callback fails,\n\t// but also expect authentication middleware to generate it.\n\tCode_Unauthenticated Code = 16\n)\n\n// Enum value maps for Code.\nvar (\n\tCode_name = map[int32]string{\n\t\t0:  \"OK\",\n\t\t1:  \"Canceled\",\n\t\t2:  \"Unknown\",\n\t\t3:  \"InvalidArgument\",\n\t\t4:  \"DeadlineExceeded\",\n\t\t5:  \"NotFound\",\n\t\t6:  \"AlreadyExists\",\n\t\t7:  \"PermissionDenied\",\n\t\t8:  \"ResourceExhausted\",\n\t\t9:  \"FailedPrecondition\",\n\t\t10: \"Aborted\",\n\t\t11: \"OutOfRange\",\n\t\t12: \"Unimplemented\",\n\t\t13: \"Internal\",\n\t\t14: \"Unavailable\",\n\t\t15: \"DataLoss\",\n\t\t16: \"Unauthenticated\",\n\t}\n\tCode_value = map[string]int32{\n\t\t\"OK\":                 0,\n\t\t\"Canceled\":           1,\n\t\t\"Unknown\":            2,\n\t\t\"InvalidArgument\":    3,\n\t\t\"DeadlineExceeded\":   4,\n\t\t\"NotFound\":           5,\n\t\t\"AlreadyExists\":      6,\n\t\t\"PermissionDenied\":   7,\n\t\t\"ResourceExhausted\":  8,\n\t\t\"FailedPrecondition\": 9,\n\t\t\"Aborted\":            10,\n\t\t\"OutOfRange\":         11,\n\t\t\"Unimplemented\":      12,\n\t\t\"Internal\":           13,\n\t\t\"Unavailable\":        14,\n\t\t\"DataLoss\":           15,\n\t\t\"Unauthenticated\":    16,\n\t}\n)\n\nfunc (x Code) Enum() *Code {\n\tp := new(Code)\n\t*p = x\n\treturn p\n}\n\nfunc (x Code) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Code) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_types_code_sdk_go_code_proto_enumTypes[0].Descriptor()\n}\n\nfunc (Code) Type() protoreflect.EnumType {\n\treturn &file_types_code_sdk_go_code_proto_enumTypes[0]\n}\n\nfunc (x Code) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Code.Descriptor instead.\nfunc (Code) EnumDescriptor() ([]byte, []int) {\n\treturn file_types_code_sdk_go_code_proto_rawDescGZIP(), []int{0}\n}\n\ntype CgoError struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tErrorCode       Code   `protobuf:\"varint,1,opt,name=error_code,json=errorCode,proto3,enum=sdk.types.code.Code\" json:\"error_code,omitempty\"`\n\tErrorMessage    string `protobuf:\"bytes,2,opt,name=error_message,json=errorMessage,proto3\" json:\"error_message,omitempty\"`\n\tSdkErrorCode    int32  `protobuf:\"varint,3,opt,name=sdk_error_code,json=sdkErrorCode,proto3\" json:\"sdk_error_code,omitempty\"`\n\tSdkErrorMessage string `protobuf:\"bytes,4,opt,name=sdk_error_message,json=sdkErrorMessage,proto3\" json:\"sdk_error_message,omitempty\"`\n}\n\nfunc (x *CgoError) Reset() {\n\t*x = CgoError{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_types_code_sdk_go_code_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *CgoError) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CgoError) ProtoMessage() {}\n\nfunc (x *CgoError) ProtoReflect() protoreflect.Message {\n\tmi := &file_types_code_sdk_go_code_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use CgoError.ProtoReflect.Descriptor instead.\nfunc (*CgoError) Descriptor() ([]byte, []int) {\n\treturn file_types_code_sdk_go_code_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *CgoError) GetErrorCode() Code {\n\tif x != nil {\n\t\treturn x.ErrorCode\n\t}\n\treturn Code_OK\n}\n\nfunc (x *CgoError) GetErrorMessage() string {\n\tif x != nil {\n\t\treturn x.ErrorMessage\n\t}\n\treturn \"\"\n}\n\nfunc (x *CgoError) GetSdkErrorCode() int32 {\n\tif x != nil {\n\t\treturn x.SdkErrorCode\n\t}\n\treturn 0\n}\n\nfunc (x *CgoError) GetSdkErrorMessage() string {\n\tif x != nil {\n\t\treturn x.SdkErrorMessage\n\t}\n\treturn \"\"\n}\n\nvar File_types_code_sdk_go_code_proto protoreflect.FileDescriptor\n\nvar file_types_code_sdk_go_code_proto_rawDesc = []byte{\n\t0x0a, 0x1c, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x73, 0x64, 0x6b,\n\t0x2d, 0x67, 0x6f, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e,\n\t0x73, 0x64, 0x6b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xb6,\n\t0x01, 0x0a, 0x08, 0x43, 0x67, 0x6f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x0a, 0x65,\n\t0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,\n\t0x14, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x64, 0x65,\n\t0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65,\n\t0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65,\n\t0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x64, 0x6b, 0x5f, 0x65, 0x72, 0x72,\n\t0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x73,\n\t0x64, 0x6b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x73,\n\t0x64, 0x6b, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x64, 0x6b, 0x45, 0x72, 0x72, 0x6f, 0x72,\n\t0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0xac, 0x02, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65,\n\t0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63,\n\t0x65, 0x6c, 0x65, 0x64, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77,\n\t0x6e, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x41, 0x72,\n\t0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x65, 0x61, 0x64,\n\t0x6c, 0x69, 0x6e, 0x65, 0x45, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x04, 0x12, 0x0c,\n\t0x0a, 0x08, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d,\n\t0x41, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x10, 0x06, 0x12,\n\t0x14, 0x0a, 0x10, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6e,\n\t0x69, 0x65, 0x64, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,\n\t0x65, 0x45, 0x78, 0x68, 0x61, 0x75, 0x73, 0x74, 0x65, 0x64, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12,\n\t0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,\n\t0x6f, 0x6e, 0x10, 0x09, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x10,\n\t0x0a, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x75, 0x74, 0x4f, 0x66, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x10,\n\t0x0b, 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x6e, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,\n\t0x65, 0x64, 0x10, 0x0c, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,\n\t0x10, 0x0d, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c,\n\t0x65, 0x10, 0x0e, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x6f, 0x73, 0x73, 0x10,\n\t0x0f, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63,\n\t0x61, 0x74, 0x65, 0x64, 0x10, 0x10, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,\n\t0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x6c, 0x61,\n\t0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x6f, 0x63, 0x76, 0x2f, 0x63, 0x67, 0x6f, 0x2f,\n\t0x61, 0x70, 0x69, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63,\n\t0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x3b, 0x63, 0x6f, 0x64, 0x65,\n\t0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_types_code_sdk_go_code_proto_rawDescOnce sync.Once\n\tfile_types_code_sdk_go_code_proto_rawDescData = file_types_code_sdk_go_code_proto_rawDesc\n)\n\nfunc file_types_code_sdk_go_code_proto_rawDescGZIP() []byte {\n\tfile_types_code_sdk_go_code_proto_rawDescOnce.Do(func() {\n\t\tfile_types_code_sdk_go_code_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_code_sdk_go_code_proto_rawDescData)\n\t})\n\treturn file_types_code_sdk_go_code_proto_rawDescData\n}\n\nvar file_types_code_sdk_go_code_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_types_code_sdk_go_code_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_types_code_sdk_go_code_proto_goTypes = []interface{}{\n\t(Code)(0),        // 0: sdk.types.code.Code\n\t(*CgoError)(nil), // 1: sdk.types.code.CgoError\n}\nvar file_types_code_sdk_go_code_proto_depIdxs = []int32{\n\t0, // 0: sdk.types.code.CgoError.error_code:type_name -> sdk.types.code.Code\n\t1, // [1:1] is the sub-list for method output_type\n\t1, // [1:1] is the sub-list for method input_type\n\t1, // [1:1] is the sub-list for extension type_name\n\t1, // [1:1] is the sub-list for extension extendee\n\t0, // [0:1] is the sub-list for field type_name\n}\n\nfunc init() { file_types_code_sdk_go_code_proto_init() }\nfunc file_types_code_sdk_go_code_proto_init() {\n\tif File_types_code_sdk_go_code_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_types_code_sdk_go_code_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*CgoError); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_types_code_sdk_go_code_proto_rawDesc,\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_types_code_sdk_go_code_proto_goTypes,\n\t\tDependencyIndexes: file_types_code_sdk_go_code_proto_depIdxs,\n\t\tEnumInfos:         file_types_code_sdk_go_code_proto_enumTypes,\n\t\tMessageInfos:      file_types_code_sdk_go_code_proto_msgTypes,\n\t}.Build()\n\tFile_types_code_sdk_go_code_proto = out.File\n\tfile_types_code_sdk_go_code_proto_rawDesc = nil\n\tfile_types_code_sdk_go_code_proto_goTypes = nil\n\tfile_types_code_sdk_go_code_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/types/code/sdk-go.code.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: api/openapi-spec/types/code/sdk-go.code.proto\n\n#ifndef PROTOBUF_INCLUDED_api_2fopenapi_2dspec_2ftypes_2fcode_2fsdk_2dgo_2ecode_2eproto\n#define PROTOBUF_INCLUDED_api_2fopenapi_2dspec_2ftypes_2fcode_2fsdk_2dgo_2ecode_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/generated_enum_reflection.h>\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_api_2fopenapi_2dspec_2ftypes_2fcode_2fsdk_2dgo_2ecode_2eproto \n\nnamespace protobuf_api_2fopenapi_2dspec_2ftypes_2fcode_2fsdk_2dgo_2ecode_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[1];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid AddDescriptors();\n}  // namespace protobuf_api_2fopenapi_2dspec_2ftypes_2fcode_2fsdk_2dgo_2ecode_2eproto\nnamespace sdk {\nnamespace types {\nnamespace code {\nclass CgoError;\nclass CgoErrorDefaultTypeInternal;\nextern CgoErrorDefaultTypeInternal _CgoError_default_instance_;\n}  // namespace code\n}  // namespace types\n}  // namespace sdk\nnamespace google {\nnamespace protobuf {\ntemplate<> ::sdk::types::code::CgoError* Arena::CreateMaybeMessage<::sdk::types::code::CgoError>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace sdk {\nnamespace types {\nnamespace code {\n\nenum Code {\n  OK = 0,\n  Canceled = 1,\n  Unknown = 2,\n  InvalidArgument = 3,\n  DeadlineExceeded = 4,\n  NotFound = 5,\n  AlreadyExists = 6,\n  PermissionDenied = 7,\n  ResourceExhausted = 8,\n  FailedPrecondition = 9,\n  Aborted = 10,\n  OutOfRange = 11,\n  Unimplemented = 12,\n  Internal = 13,\n  Unavailable = 14,\n  DataLoss = 15,\n  Unauthenticated = 16,\n  Code_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,\n  Code_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max\n};\nbool Code_IsValid(int value);\nconst Code Code_MIN = OK;\nconst Code Code_MAX = Unauthenticated;\nconst int Code_ARRAYSIZE = Code_MAX + 1;\n\nconst ::google::protobuf::EnumDescriptor* Code_descriptor();\ninline const ::std::string& Code_Name(Code value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    Code_descriptor(), value);\n}\ninline bool Code_Parse(\n    const ::std::string& name, Code* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<Code>(\n    Code_descriptor(), name, value);\n}\n// ===================================================================\n\nclass CgoError : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:sdk.types.code.CgoError) */ {\n public:\n  CgoError();\n  virtual ~CgoError();\n\n  CgoError(const CgoError& from);\n\n  inline CgoError& operator=(const CgoError& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  CgoError(CgoError&& from) noexcept\n    : CgoError() {\n    *this = ::std::move(from);\n  }\n\n  inline CgoError& operator=(CgoError&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const CgoError& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const CgoError* internal_default_instance() {\n    return reinterpret_cast<const CgoError*>(\n               &_CgoError_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void Swap(CgoError* other);\n  friend void swap(CgoError& a, CgoError& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline CgoError* New() const final {\n    return CreateMaybeMessage<CgoError>(NULL);\n  }\n\n  CgoError* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<CgoError>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const CgoError& from);\n  void MergeFrom(const CgoError& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(CgoError* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // string error_message = 2;\n  void clear_error_message();\n  static const int kErrorMessageFieldNumber = 2;\n  const ::std::string& error_message() const;\n  void set_error_message(const ::std::string& value);\n  #if LANG_CXX11\n  void set_error_message(::std::string&& value);\n  #endif\n  void set_error_message(const char* value);\n  void set_error_message(const char* value, size_t size);\n  ::std::string* mutable_error_message();\n  ::std::string* release_error_message();\n  void set_allocated_error_message(::std::string* error_message);\n\n  // string sdk_error_message = 4;\n  void clear_sdk_error_message();\n  static const int kSdkErrorMessageFieldNumber = 4;\n  const ::std::string& sdk_error_message() const;\n  void set_sdk_error_message(const ::std::string& value);\n  #if LANG_CXX11\n  void set_sdk_error_message(::std::string&& value);\n  #endif\n  void set_sdk_error_message(const char* value);\n  void set_sdk_error_message(const char* value, size_t size);\n  ::std::string* mutable_sdk_error_message();\n  ::std::string* release_sdk_error_message();\n  void set_allocated_sdk_error_message(::std::string* sdk_error_message);\n\n  // .sdk.types.code.Code error_code = 1;\n  void clear_error_code();\n  static const int kErrorCodeFieldNumber = 1;\n  ::sdk::types::code::Code error_code() const;\n  void set_error_code(::sdk::types::code::Code value);\n\n  // int32 sdk_error_code = 3;\n  void clear_sdk_error_code();\n  static const int kSdkErrorCodeFieldNumber = 3;\n  ::google::protobuf::int32 sdk_error_code() const;\n  void set_sdk_error_code(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:sdk.types.code.CgoError)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::ArenaStringPtr error_message_;\n  ::google::protobuf::internal::ArenaStringPtr sdk_error_message_;\n  int error_code_;\n  ::google::protobuf::int32 sdk_error_code_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_api_2fopenapi_2dspec_2ftypes_2fcode_2fsdk_2dgo_2ecode_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// CgoError\n\n// .sdk.types.code.Code error_code = 1;\ninline void CgoError::clear_error_code() {\n  error_code_ = 0;\n}\ninline ::sdk::types::code::Code CgoError::error_code() const {\n  // @@protoc_insertion_point(field_get:sdk.types.code.CgoError.error_code)\n  return static_cast< ::sdk::types::code::Code >(error_code_);\n}\ninline void CgoError::set_error_code(::sdk::types::code::Code value) {\n  \n  error_code_ = value;\n  // @@protoc_insertion_point(field_set:sdk.types.code.CgoError.error_code)\n}\n\n// string error_message = 2;\ninline void CgoError::clear_error_message() {\n  error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& CgoError::error_message() const {\n  // @@protoc_insertion_point(field_get:sdk.types.code.CgoError.error_message)\n  return error_message_.GetNoArena();\n}\ninline void CgoError::set_error_message(const ::std::string& value) {\n  \n  error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:sdk.types.code.CgoError.error_message)\n}\n#if LANG_CXX11\ninline void CgoError::set_error_message(::std::string&& value) {\n  \n  error_message_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:sdk.types.code.CgoError.error_message)\n}\n#endif\ninline void CgoError::set_error_message(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:sdk.types.code.CgoError.error_message)\n}\ninline void CgoError::set_error_message(const char* value, size_t size) {\n  \n  error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:sdk.types.code.CgoError.error_message)\n}\ninline ::std::string* CgoError::mutable_error_message() {\n  \n  // @@protoc_insertion_point(field_mutable:sdk.types.code.CgoError.error_message)\n  return error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* CgoError::release_error_message() {\n  // @@protoc_insertion_point(field_release:sdk.types.code.CgoError.error_message)\n  \n  return error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void CgoError::set_allocated_error_message(::std::string* error_message) {\n  if (error_message != NULL) {\n    \n  } else {\n    \n  }\n  error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_message);\n  // @@protoc_insertion_point(field_set_allocated:sdk.types.code.CgoError.error_message)\n}\n\n// int32 sdk_error_code = 3;\ninline void CgoError::clear_sdk_error_code() {\n  sdk_error_code_ = 0;\n}\ninline ::google::protobuf::int32 CgoError::sdk_error_code() const {\n  // @@protoc_insertion_point(field_get:sdk.types.code.CgoError.sdk_error_code)\n  return sdk_error_code_;\n}\ninline void CgoError::set_sdk_error_code(::google::protobuf::int32 value) {\n  \n  sdk_error_code_ = value;\n  // @@protoc_insertion_point(field_set:sdk.types.code.CgoError.sdk_error_code)\n}\n\n// string sdk_error_message = 4;\ninline void CgoError::clear_sdk_error_message() {\n  sdk_error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& CgoError::sdk_error_message() const {\n  // @@protoc_insertion_point(field_get:sdk.types.code.CgoError.sdk_error_message)\n  return sdk_error_message_.GetNoArena();\n}\ninline void CgoError::set_sdk_error_message(const ::std::string& value) {\n  \n  sdk_error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:sdk.types.code.CgoError.sdk_error_message)\n}\n#if LANG_CXX11\ninline void CgoError::set_sdk_error_message(::std::string&& value) {\n  \n  sdk_error_message_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:sdk.types.code.CgoError.sdk_error_message)\n}\n#endif\ninline void CgoError::set_sdk_error_message(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  sdk_error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:sdk.types.code.CgoError.sdk_error_message)\n}\ninline void CgoError::set_sdk_error_message(const char* value, size_t size) {\n  \n  sdk_error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:sdk.types.code.CgoError.sdk_error_message)\n}\ninline ::std::string* CgoError::mutable_sdk_error_message() {\n  \n  // @@protoc_insertion_point(field_mutable:sdk.types.code.CgoError.sdk_error_message)\n  return sdk_error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* CgoError::release_sdk_error_message() {\n  // @@protoc_insertion_point(field_release:sdk.types.code.CgoError.sdk_error_message)\n  \n  return sdk_error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void CgoError::set_allocated_sdk_error_message(::std::string* sdk_error_message) {\n  if (sdk_error_message != NULL) {\n    \n  } else {\n    \n  }\n  sdk_error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), sdk_error_message);\n  // @@protoc_insertion_point(field_set_allocated:sdk.types.code.CgoError.sdk_error_message)\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace code\n}  // namespace types\n}  // namespace sdk\n\nnamespace google {\nnamespace protobuf {\n\ntemplate <> struct is_proto_enum< ::sdk::types::code::Code> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::sdk::types::code::Code>() {\n  return ::sdk::types::code::Code_descriptor();\n}\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_api_2fopenapi_2dspec_2ftypes_2fcode_2fsdk_2dgo_2ecode_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/types/code/sdk-go.code.proto",
    "content": "syntax = \"proto3\";\npackage sdk.types.code;\n\noption go_package =\n    \"github.com/kaydxh/golang/pkg/gocv/cgo/api/openapi-spec/types/code;code\";\n\nmessage CgoError {\n  Code error_code = 1;\n  string error_message = 2;\n  int32 sdk_error_code = 3;\n  string sdk_error_message = 4;\n}\n\nenum Code {\n  // OK is returned on success.\n  OK = 0;\n\n  // Canceled indicates the operation was canceled (typically by the\n  // caller).\n  //\n  // The gRPC framework will generate this error code when cancellation\n  // is requested.\n  Canceled = 1;\n\n  // Unknown error. An example of where this error may be returned is\n  // if a Status value received from another address space belongs to\n  // an error-space that is not known in this address space. Also\n  // errors raised by APIs that do not return enough error information\n  // may be converted to this error.\n  //\n  // The gRPC framework will generate this error code in the above two\n  // mentioned cases.\n  Unknown = 2;\n\n  // InvalidArgument indicates client specified an invalid argument.\n  // Note that this differs from FailedPrecondition. It indicates arguments\n  // that are problematic regardless of the state of the system\n  // (e.g., a malformed file name).\n  //\n  // This error code will not be generated by the gRPC framework.\n  InvalidArgument = 3;\n\n  // DeadlineExceeded means operation expired before completion.\n  // For operations that change the state of the system, this error may be\n  // returned even if the operation has completed successfully. For\n  // example, a successful response from a server could have been delayed\n  // long enough for the deadline to expire.\n  //\n  // The gRPC framework will generate this error code when the deadline is\n  // exceeded.\n  DeadlineExceeded = 4;\n\n  // NotFound means some requested entity (e.g., file or directory) was\n  // not found.\n  //\n  // This error code will not be generated by the gRPC framework.\n  NotFound = 5;\n\n  // AlreadyExists means an attempt to create an entity failed because one\n  // already exists.\n  //\n  // This error code will not be generated by the gRPC framework.\n  AlreadyExists = 6;\n\n  // PermissionDenied indicates the caller does not have permission to\n  // execute the specified operation. It must not be used for rejections\n  // caused by exhausting some resource (use ResourceExhausted\n  // instead for those errors). It must not be\n  // used if the caller cannot be identified (use Unauthenticated\n  // instead for those errors).\n  //\n  // This error code will not be generated by the gRPC core framework,\n  // but expect authentication middleware to use it.\n  PermissionDenied = 7;\n\n  // ResourceExhausted indicates some resource has been exhausted, perhaps\n  // a per-user quota, or perhaps the entire file system is out of space.\n  //\n  // This error code will be generated by the gRPC framework in\n  // out-of-memory and server overload situations, or when a message is\n  // larger than the configured maximum size.\n  ResourceExhausted = 8;\n\n  // FailedPrecondition indicates operation was rejected because the\n  // system is not in a state required for the operation's execution.\n  // For example, directory to be deleted may be non-empty, an rmdir\n  // operation is applied to a non-directory, etc.\n  //\n  // A litmus test that may help a service implementor in deciding\n  // between FailedPrecondition, Aborted, and Unavailable:\n  //  (a) Use Unavailable if the client can retry just the failing call.\n  //  (b) Use Aborted if the client should retry at a higher-level\n  //      (e.g., restarting a read-modify-write sequence).\n  //  (c) Use FailedPrecondition if the client should not retry until\n  //      the system state has been explicitly fixed. E.g., if an \"rmdir\"\n  //      fails because the directory is non-empty, FailedPrecondition\n  //      should be returned since the client should not retry unless\n  //      they have first fixed up the directory by deleting files from it.\n  //  (d) Use FailedPrecondition if the client performs conditional\n  //      REST Get/Update/Delete on a resource and the resource on the\n  //      server does not match the condition. E.g., conflicting\n  //      read-modify-write on the same resource.\n  //\n  // This error code will not be generated by the gRPC framework.\n  FailedPrecondition = 9;\n\n  // Aborted indicates the operation was aborted, typically due to a\n  // concurrency issue like sequencer check failures, transaction aborts,\n  // etc.\n  //\n  // See litmus test above for deciding between FailedPrecondition,\n  // Aborted, and Unavailable.\n  //\n  // This error code will not be generated by the gRPC framework.\n  Aborted = 10;\n\n  // OutOfRange means operation was attempted past the valid range.\n  // E.g., seeking or reading past end of file.\n  //\n  // Unlike InvalidArgument, this error indicates a problem that may\n  // be fixed if the system state changes. For example, a 32-bit file\n  // system will generate InvalidArgument if asked to read at an\n  // offset that is not in the range [0,2^32-1], but it will generate\n  // OutOfRange if asked to read from an offset past the current\n  // file size.\n  //\n  // There is a fair bit of overlap between FailedPrecondition and\n  // OutOfRange. We recommend using OutOfRange (the more specific\n  // error) when it applies so that callers who are iterating through\n  // a space can easily look for an OutOfRange error to detect when\n  // they are done.\n  //\n  // This error code will not be generated by the gRPC framework.\n  OutOfRange = 11;\n\n  // Unimplemented indicates operation is not implemented or not\n  // supported/enabled in this service.\n  //\n  // This error code will be generated by the gRPC framework. Most\n  // commonly, you will see this error code when a method implementation\n  // is missing on the server. It can also be generated for unknown\n  // compression algorithms or a disagreement as to whether an RPC should\n  // be streaming.\n  Unimplemented = 12;\n\n  // Internal errors. Means some invariants expected by underlying\n  // system has been broken. If you see one of these errors,\n  // something is very broken.\n  //\n  // This error code will be generated by the gRPC framework in several\n  // internal error conditions.\n  Internal = 13;\n\n  // Unavailable indicates the service is currently unavailable.\n  // This is a most likely a transient condition and may be corrected\n  // by retrying with a backoff. Note that it is not always safe to retry\n  // non-idempotent operations.\n  //\n  // See litmus test above for deciding between FailedPrecondition,\n  // Aborted, and Unavailable.\n  //\n  // This error code will be generated by the gRPC framework during\n  // abrupt shutdown of a server process or network connection.\n  Unavailable = 14;\n\n  // DataLoss indicates unrecoverable data loss or corruption.\n  //\n  // This error code will not be generated by the gRPC framework.\n  DataLoss = 15;\n\n  // Unauthenticated indicates the request does not have valid\n  // authentication credentials for the operation.\n  //\n  // The gRPC framework will generate this error code when the\n  // authentication metadata is invalid or a Credentials callback fails,\n  // but also expect authentication middleware to generate it.\n  Unauthenticated = 16;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/types/sdk-go.types.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.17.3\n// source: types/sdk-go.types.proto\n\npackage types\n\nimport (\n\tcode \"github.com/kaydxh/golang/pkg/gocv/cgo/api/openapi-spec/types/code\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\n// Symbols defined in public import of api/openapi-spec/types/code/sdk-go.code.proto.\n\ntype Code = code.Code\n\nconst Code_OK = code.Code_OK\nconst Code_Canceled = code.Code_Canceled\nconst Code_Unknown = code.Code_Unknown\nconst Code_InvalidArgument = code.Code_InvalidArgument\nconst Code_DeadlineExceeded = code.Code_DeadlineExceeded\nconst Code_NotFound = code.Code_NotFound\nconst Code_AlreadyExists = code.Code_AlreadyExists\nconst Code_PermissionDenied = code.Code_PermissionDenied\nconst Code_ResourceExhausted = code.Code_ResourceExhausted\nconst Code_FailedPrecondition = code.Code_FailedPrecondition\nconst Code_Aborted = code.Code_Aborted\nconst Code_OutOfRange = code.Code_OutOfRange\nconst Code_Unimplemented = code.Code_Unimplemented\nconst Code_Internal = code.Code_Internal\nconst Code_Unavailable = code.Code_Unavailable\nconst Code_DataLoss = code.Code_DataLoss\nconst Code_Unauthenticated = code.Code_Unauthenticated\n\nvar Code_name = code.Code_name\nvar Code_value = code.Code_value\n\ntype CgoError = code.CgoError\n\nvar File_types_sdk_go_types_proto protoreflect.FileDescriptor\n\nvar file_types_sdk_go_types_proto_rawDesc = []byte{\n\t0x0a, 0x18, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2e, 0x74,\n\t0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x64, 0x6b, 0x2e,\n\t0x61, 0x70, 0x69, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x6f,\n\t0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65,\n\t0x73, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2e, 0x63, 0x6f,\n\t0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x44, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68,\n\t0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f,\n\t0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x6f, 0x63, 0x76, 0x2f, 0x63, 0x67,\n\t0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70,\n\t0x65, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x50, 0x00,\n\t0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar file_types_sdk_go_types_proto_goTypes = []interface{}{}\nvar file_types_sdk_go_types_proto_depIdxs = []int32{\n\t0, // [0:0] is the sub-list for method output_type\n\t0, // [0:0] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_types_sdk_go_types_proto_init() }\nfunc file_types_sdk_go_types_proto_init() {\n\tif File_types_sdk_go_types_proto != nil {\n\t\treturn\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_types_sdk_go_types_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   0,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_types_sdk_go_types_proto_goTypes,\n\t\tDependencyIndexes: file_types_sdk_go_types_proto_depIdxs,\n\t}.Build()\n\tFile_types_sdk_go_types_proto = out.File\n\tfile_types_sdk_go_types_proto_rawDesc = nil\n\tfile_types_sdk_go_types_proto_goTypes = nil\n\tfile_types_sdk_go_types_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/types/sdk-go.types.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: api/openapi-spec/types/sdk-go.types.proto\n\n#ifndef PROTOBUF_INCLUDED_api_2fopenapi_2dspec_2ftypes_2fsdk_2dgo_2etypes_2eproto\n#define PROTOBUF_INCLUDED_api_2fopenapi_2dspec_2ftypes_2fsdk_2dgo_2etypes_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include \"api/openapi-spec/types/code/sdk-go.code.pb.h\"  // IWYU pragma: export\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_api_2fopenapi_2dspec_2ftypes_2fsdk_2dgo_2etypes_2eproto \n\nnamespace protobuf_api_2fopenapi_2dspec_2ftypes_2fsdk_2dgo_2etypes_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[1];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid AddDescriptors();\n}  // namespace protobuf_api_2fopenapi_2dspec_2ftypes_2fsdk_2dgo_2etypes_2eproto\nnamespace sdk {\nnamespace api {\nnamespace types {\n}  // namespace types\n}  // namespace api\n}  // namespace sdk\nnamespace sdk {\nnamespace api {\nnamespace types {\n\n// ===================================================================\n\n\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace types\n}  // namespace api\n}  // namespace sdk\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_api_2fopenapi_2dspec_2ftypes_2fsdk_2dgo_2etypes_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/api/openapi-spec/types/sdk-go.types.proto",
    "content": "syntax = \"proto3\";\n\npackage sdk.api.types;\nimport public \"api/openapi-spec/types/code/sdk-go.code.proto\";\n\noption go_package =\n    \"github.com/kaydxh/golang/pkg/gocv/cgo/api/openapi-spec/types;types\";\n"
  },
  {
    "path": "pkg/gocv/cgo/cmake/FindProtobuf.cmake",
    "content": "macro(GENERATE_PROTOBUF_LIB IMPORT_DIRS DEPEND_TARGETS) \n   if (IMPORT_DIRS)\n        list(APPEND Protobuf_IMPORT_DIRS \"${IMPORT_DIRS}\")\n   endif ()\n\n  get_filename_component(CURRENT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR} NAME)\n  set(target ${CURRENT_FOLDER})\n\n  if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_path/protobuf/bin/protoc)\n    set(Protobuf_PROTOC_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/third_path/protobuf/bin/protoc)\n  elseif (EXISTS ${PROJECT_SOURCE_DIR}/third_path/protobuf/bin/protoc)\n    set(Protobuf_PROTOC_EXECUTABLE ${PROJECT_SOURCE_DIR}/third_path/protobuf/bin/protoc)\n  elseif (EXISTS ${PROJECT_SOURCE_DIR}/third_party/protobuf/bin/protoc)\n    set(Protobuf_PROTOC_EXECUTABLE ${PROJECT_SOURCE_DIR}/third_party/protobuf/bin/protoc)\n  elseif (EXISTS ${PROJECT_SOURCE_DIR}/api/openapi-spec/third_path/protobuf/bin/protoc)\n    set(Protobuf_PROTOC_EXECUTABLE ${PROJECT_SOURCE_DIR}/api/openapi-spec/third_path/protobuf/bin/protoc)\n  else ()\n    message(SEND_ERROR \"Error: protoc not found\")\n    return()\n  endif ()\n\n  message(STATUS Protobuf_PROTOC_EXECUTABLE=${Protobuf_PROTOC_EXECUTABLE})\n  if (NOT TARGET protobuf::protoc)\n     add_executable(protobuf::protoc IMPORTED)\n     if (EXISTS \"${Protobuf_PROTOC_EXECUTABLE}\")\n         set_target_properties(protobuf::protoc PROPERTIES\n         IMPORTED_LOCATION \"${Protobuf_PROTOC_EXECUTABLE}\")\n     endif ()\n  endif ()\n\n  set(protobuf_generate_LANGUAGE cpp)\n  set(protobuf_generate_PROTOC_OUT_DIR \"${CMAKE_CURRENT_BINARY_DIR}\")\n  set(Protobuf_USE_STATIC_LIBS ON)\n  file(GLOB_RECURSE protofiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} \"*.proto\") \n\n  # PROTO_SRCS 存储.pb.cc文件的变量名称\n  # PROTO_HDRS 存储.pb.h文件的变量名称\n  # PROTOBUF_GENERATE_CPP generate *.h *.cxx files\n  # https://github.com/protocolbuffers/protobuf/blob/main/cmake/protobuf-module.cmake.in\n  PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${protofiles})\n\n  add_library(proto-${target} STATIC ${PROTO_SRCS} ${PROTO_HDRS})\n  target_include_directories(proto-${target} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})\n  target_link_libraries(proto-${target} PUBLIC protobuf ${DEPEND_TARGETS})\n\n  install(TARGETS proto-${target}\n        OPTIONAL\n        LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/\n        ARCHIVE DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/\n        RUNTIME DESTINATION DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/\n        )\n   \n  foreach (_abs_file ${PROTO_HDRS})\n          file(RELATIVE_PATH _rel_file ${CMAKE_CURRENT_BINARY_DIR} ${_abs_file})\n          get_filename_component(_rel_dir ${_rel_file} DIRECTORY)\n          install(FILES ${_abs_file} DESTINATION ${PROJECT_SOURCE_DIR}/${_rel_dir} OPTIONAL)\n  endforeach ()\nendmacro()\n\nmacro(GET_MODEL_DIRS direction list_return)\n  FILE(GLOB_RECURSE dirs LIST_DIRECTORIES true RELATIVE ${direction} ${direction}/*)\n  SET(submodules_dirs)\n  FOREACH (dir ${dirs}) \n    IF(EXISTS ${direction}/${dir}/CMakeLists.txt)\n      LIST(APPEND submodules_dirs ${direction}/${dir})\n    endif()\n  ENDFOREACH()\n  SET(${list_return} ${submodules_dirs})\nendmacro()\n\n\n# This file contains backwards compatibility patches for various legacy functions and variables\n# Functions\nfunction(PROTOBUF_GENERATE_CPP SRCS HDRS)\n  cmake_parse_arguments(protobuf_generate_cpp \"\" \"EXPORT_MACRO\" \"\" ${ARGN})\n\n  set(_proto_files \"${protobuf_generate_cpp_UNPARSED_ARGUMENTS}\")\n  if(NOT _proto_files)\n    message(SEND_ERROR \"Error: PROTOBUF_GENERATE_CPP() called without any proto files\")\n    return()\n  endif()\n\n  if(PROTOBUF_GENERATE_CPP_APPEND_PATH)\n    set(_append_arg APPEND_PATH)\n  endif()\n\n  if(DEFINED Protobuf_IMPORT_DIRS)\n    set(_import_arg IMPORT_DIRS ${Protobuf_IMPORT_DIRS})\n  endif()\n\n  set(_outvar)\n  protobuf_generate(${_append_arg} LANGUAGE cpp EXPORT_MACRO ${protobuf_generate_cpp_EXPORT_MACRO} OUT_VAR _outvar ${_import_arg} PROTOS ${_proto_files})\n\n  set(${SRCS})\n  set(${HDRS})\n  foreach(_file ${_outvar})\n    if(_file MATCHES \"cc$\")\n      list(APPEND ${SRCS} ${_file})\n    else()\n      list(APPEND ${HDRS} ${_file})\n    endif()\n  endforeach()\n  set(${SRCS} ${${SRCS}} PARENT_SCOPE)\n  set(${HDRS} ${${HDRS}} PARENT_SCOPE)\nendfunction()\n\n\nfunction(protobuf_generate)\n    set(_options APPEND_PATH DESCRIPTORS)\n    set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN)\n    if (COMMAND target_sources)\n        list(APPEND _singleargs TARGET)\n    endif ()\n    set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS)\n\n    cmake_parse_arguments(protobuf_generate \"${_options}\" \"${_singleargs}\" \"${_multiargs}\" \"${ARGN}\")\n\n    if (NOT protobuf_generate_PROTOS AND NOT protobuf_generate_TARGET)\n        message(SEND_ERROR \"Error: protobuf_generate called without any targets or source files\")\n        return()\n    endif ()\n\n    if (NOT protobuf_generate_OUT_VAR AND NOT protobuf_generate_TARGET)\n        message(SEND_ERROR \"Error: protobuf_generate called without a target or output variable\")\n        return()\n    endif ()\n\n    if (NOT protobuf_generate_LANGUAGE)\n        set(protobuf_generate_LANGUAGE cpp)\n    endif ()\n    string(TOLOWER ${protobuf_generate_LANGUAGE} protobuf_generate_LANGUAGE)\n\n    if (NOT protobuf_generate_PROTOC_OUT_DIR)\n        set(protobuf_generate_PROTOC_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR})\n    endif ()\n\n    if (protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp)\n        set(_dll_export_decl \"dllexport_decl=${protobuf_generate_EXPORT_MACRO}:\")\n    endif ()\n\n    if (protobuf_generate_PLUGIN)\n        set(_plugin \"--plugin=${protobuf_generate_PLUGIN}\")\n    endif ()\n\n    if (NOT protobuf_generate_GENERATE_EXTENSIONS)\n        if (protobuf_generate_LANGUAGE STREQUAL cpp)\n            set(protobuf_generate_GENERATE_EXTENSIONS .pb.h .pb.cc)\n        elseif (protobuf_generate_LANGUAGE STREQUAL python)\n            set(protobuf_generate_GENERATE_EXTENSIONS _pb2.py)\n        else ()\n            message(SEND_ERROR \"Error: protobuf_generate given unknown Language ${LANGUAGE}, please provide a value for GENERATE_EXTENSIONS\")\n            return()\n        endif ()\n    endif ()\n\n    if (protobuf_generate_TARGET)\n        get_target_property(_source_list ${protobuf_generate_TARGET} SOURCES)\n        foreach (_file ${_source_list})\n            if (_file MATCHES \"proto$\")\n                list(APPEND protobuf_generate_PROTOS ${_file})\n            endif ()\n        endforeach ()\n    endif ()\n\n    if (NOT protobuf_generate_PROTOS)\n        message(SEND_ERROR \"Error: protobuf_generate could not find any .proto files\")\n        return()\n    endif ()\n\n    if (protobuf_generate_APPEND_PATH)\n        # Create an include path for each file specified\n        foreach (_file ${protobuf_generate_PROTOS})\n            get_filename_component(_abs_file ${_file} ABSOLUTE)\n            get_filename_component(_abs_path ${_abs_file} PATH)\n            list(FIND _protobuf_include_path ${_abs_path} _contains_already)\n            if (${_contains_already} EQUAL -1)\n                list(APPEND _protobuf_include_path -I ${_abs_path})\n            endif ()\n        endforeach ()\n    else ()\n        set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})\n    endif ()\n\n    foreach (DIR ${protobuf_generate_IMPORT_DIRS})\n        get_filename_component(ABS_PATH ${DIR} ABSOLUTE)\n        list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)\n        if (${_contains_already} EQUAL -1)\n            list(APPEND _protobuf_include_path -I ${ABS_PATH})\n        endif ()\n    endforeach ()\n\n    set(_generated_srcs_all)\n    foreach (_proto ${protobuf_generate_PROTOS})\n        get_filename_component(_abs_file ${_proto} ABSOLUTE)\n        get_filename_component(_abs_dir ${_abs_file} DIRECTORY)\n        get_filename_component(_basename ${_proto} NAME_WLE)\n        file(RELATIVE_PATH _rel_dir ${PROJECT_SOURCE_DIR} ${_abs_dir})\n\n        set(_possible_rel_dir)\n        if (NOT protobuf_generate_APPEND_PATH)\n            set(_possible_rel_dir ${_rel_dir}/)\n        endif ()\n\n        set(_generated_srcs)\n        foreach (_ext ${protobuf_generate_GENERATE_EXTENSIONS})\n            list(APPEND _generated_srcs \"${protobuf_generate_PROTOC_OUT_DIR}/${_possible_rel_dir}${_basename}${_ext}\")\n        endforeach ()\n\n        if (protobuf_generate_DESCRIPTORS AND protobuf_generate_LANGUAGE STREQUAL cpp)\n            set(_descriptor_file \"${CMAKE_CURRENT_BINARY_DIR}/${_basename}.desc\")\n            set(_dll_desc_out \"--descriptor_set_out=${_descriptor_file}\")\n            list(APPEND _generated_srcs ${_descriptor_file})\n        endif ()\n        list(APPEND _generated_srcs_all ${_generated_srcs})\n\n        file(RELATIVE_PATH _rel_proto_file ${PROJECT_SOURCE_DIR} ${_abs_file})\n        add_custom_command(\n                OUTPUT ${_generated_srcs}\n                COMMAND protobuf::protoc\n                ARGS --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_dll_desc_out} ${_protobuf_include_path} ${_rel_proto_file}\n                WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}\n                DEPENDS ${_abs_file} protobuf::protoc\n                COMMENT \"Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}\"\n                VERBATIM)\n    endforeach ()\n\n    set_source_files_properties(${_generated_srcs_all} PROPERTIES GENERATED TRUE)\n    if (protobuf_generate_OUT_VAR)\n        set(${protobuf_generate_OUT_VAR} ${_generated_srcs_all} PARENT_SCOPE)\n    endif ()\n    if (protobuf_generate_TARGET)\n        target_sources(${protobuf_generate_TARGET} PRIVATE ${_generated_srcs_all})\n    endif ()\nendfunction()\n"
  },
  {
    "path": "pkg/gocv/cgo/gocv/Makefile",
    "content": "MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))\nPROJECT_ROOT_DIR := $(realpath ${MAKEFILE_DIR}/..)\nPKG_CONFIG_PATH := ${PROJECT_ROOT_DIR}/pkgconfig\nSCRIPT_PATH := ${MAKEFILE_DIR}/../script\nTARGET := $(shell basename ${MAKEFILE_DIR})\n\n# https://web.mit.edu/gnu/doc/html/make_8.html\n_empty:=\n# define space with $(_empty)\n_space:= $(_empty) $(_empty)\ndefine joinwith\n  $(subst $(_space),$1,$(strip $2))\nendef\n\n.PHONY: all\nall: deps generate  test\n\t@echo \"${MAKEFILE_DIR}\"\n\t@echo \"${PROJECT_ROOT_DIR}\"\n\t@echo \"${TARGET}\"\n\n.PHONY: deps\ndeps:\n\t@echo \"  >  downloading deps library\"\n\n.PHONY: version\nversion:\n\t@bash -c \"bash ${SCRIPT_PATH}/version.sh gitinfos\"\n\n.PHONY: test\ntest: version\n\t@$(eval THIRD_LIB_PATHS := $(shell find -L ${PROJECT_ROOT_DIR}/third_path/ -type d -iname \"lib*\" -print0 |xargs -0 -I {} bash -c 'echo {}'|grep -v \"stubs\"))\n\t@echo ${THIRD_LIB_PATHS}\n\t@$(eval JOINED_THIRD_LIB_PATHS := $(call joinwith,:,$(THIRD_LIB_PATHS)))\n\t PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}\" LD_LIBRARY_PATH=\"$(JOINED_THIRD_LIB_PATHS):${LD_LIBRARY_PATH}\" LIBRARY_PATH=\"$(JOINED_THIRD_LIB_PATHS):${LIBRARY_PATH}\" go test -a -v .\n\n.PHONY: generate \ngenerate:\n\t@echo \"  >  start to generate protocol buffers for target ${TARGET} in golang\"\n\t@bash -c \"go generate  ../api/openapi-spec/proto.gen.go\"\n\t@echo \"  >  start to generate protocol buffers by cpp\"\n\t@mkdir -p ${PROJECT_ROOT_DIR}/build; cd ${PROJECT_ROOT_DIR}/build; cmake .. --log-level \"ERROR\"\n\t@cmake --build ${PROJECT_ROOT_DIR}/build  --target proto-${TARGET} -- -j `nproc`;\n\t@echo \"  >  install generated protocol buffers by cpp\"\n\t@cd ${PROJECT_ROOT_DIR}/build; cmake --install .\n\t\n"
  },
  {
    "path": "pkg/gocv/cgo/gocv/gocv.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage gocv\n\nimport (\n\t\"os\"\n\n\t\"github.com/kaydxh/golang/pkg/gocv/cgo/api/openapi-spec/gocv\"\n)\n\nfunc NewMagickInitializeMagickRequest() *gocv.MagickInitializeMagickRequest {\n\treturn &gocv.MagickInitializeMagickRequest{\n\t\tPath: os.Args[0],\n\t}\n}\n\nfunc NewMagickImageDecodeRequest() *gocv.MagickImageDecodeRequest {\n\treturn &gocv.MagickImageDecodeRequest{}\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/gocv/gocv_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage gocv_test\n\nimport (\n\t\"testing\"\n\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\tgocv_ \"github.com/kaydxh/golang/pkg/gocv/cgo/gocv\"\n)\n\nfunc TestMagickInitializeMagick(t *testing.T) {\n}\n\nfunc TestMagickImageDecode(t *testing.T) {\n\tfilename := \"testdata/test.jpg\"\n\tdata, err := io_.ReadFile(filename)\n\tif err != nil {\n\t\tt.Error(\"Invalid ReadFile in TestMagickImageDecode\")\n\t\treturn\n\t}\n\tt.Logf(\"data size: %v\", len(data))\n\treq := gocv_.NewMagickImageDecodeRequest()\n\treq.Image = data\n\tresp, err := gocv_.MagickImageDecode(req)\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t\treturn\n\t}\n\n\tt.Logf(\"resp: %v\", resp)\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/gocv/magick.h",
    "content": "#ifndef GOCV_MAGICK_H\n#define GOCV_MAGICK_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid sdk_gocv_magick_initialize_magick(void* req_data, int req_data_len,\n                                       char** resp_data, int* resp_data_len);\n\nvoid sdk_gocv_magick_image_decode(void* req_data, int req_data_len,\n                                  char** resp_data, int* resp_data_len);\n#ifdef __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/gocv/magick_linux_amd64.cpp",
    "content": "#include <Magick++.h>\n\n#include <opencv2/opencv.hpp>\n\n#include \"api/openapi-spec/gocv/gocv.magick.pb.h\"\n#include \"magick.h\"\n\nvoid sdk_gocv_magick_initialize_magick(void* req_data, int req_data_len,\n                                       char** resp_data, int* resp_data_len) {\n    sdk::api::gocv::MagickInitializeMagickResponse resp;\n\n    try {\n        do {\n            if (!resp_data) {\n                resp.mutable_error()->set_error_code(\n                    sdk::types::code::Code::InvalidArgument);\n                resp.mutable_error()->set_error_message(\"resp_data is nullptr\");\n                break;\n            }\n            if (!resp_data_len) {\n                resp.mutable_error()->set_error_code(\n                    sdk::types::code::Code::InvalidArgument);\n                resp.mutable_error()->set_error_message(\n                    \"pointer of resp_data_len is nullptr\");\n                break;\n            }\n\n            sdk::api::gocv::MagickInitializeMagickRequest req;\n            if (!req.ParseFromArray((char*)req_data, req_data_len)) {\n                resp.mutable_error()->set_error_code(\n                    sdk::types::code::Code::InvalidArgument);\n                resp.mutable_error()->set_error_message(\"ParseFromArray\");\n                break;\n            }\n            if (req.path().empty()) {\n                Magick::InitializeMagick(nullptr);\n            } else {\n                Magick::InitializeMagick(req.path().c_str());\n            }\n        } while (0);\n    } catch (const std::exception& e) {\n        resp.mutable_error()->set_error_code(sdk::types::code::Code::Internal);\n        resp.mutable_error()->set_error_message(\n            \"Magick::InitializeMagick exception:\" + std::string(e.what()));\n    }\n\n    *resp_data_len = resp.ByteSize();\n    *resp_data = new char[*resp_data_len];\n    resp.SerializeToArray(*resp_data, *resp_data_len);\n}\n\nvoid sdk_gocv_magick_image_decode(void* req_data, int req_data_len,\n                                  char** resp_data, int* resp_data_len) {\n    sdk::api::gocv::MagickImageDecodeResponse resp;\n\n    try {\n        do {\n            if (!resp_data) {\n                resp.mutable_error()->set_error_code(\n                    sdk::types::code::Code::InvalidArgument);\n                resp.mutable_error()->set_error_message(\"resp_data is nullptr\");\n                break;\n            }\n            if (!resp_data_len) {\n                resp.mutable_error()->set_error_code(\n                    sdk::types::code::Code::InvalidArgument);\n                resp.mutable_error()->set_error_message(\n                    \"pointer of resp_data_len is nullptr\");\n                break;\n            }\n\n            sdk::api::gocv::MagickImageDecodeRequest req;\n            if (!req.ParseFromArray((char*)req_data, req_data_len)) {\n                resp.mutable_error()->set_error_code(\n                    sdk::types::code::Code::InvalidArgument);\n                resp.mutable_error()->set_error_message(\"ParseFromArray\");\n                break;\n            }\n\n            Magick::Image image;\n            try {\n                Magick::Blob blob((void*)(req.image().data()),\n                                  req.image().length());\n                image.read(blob);\n            } catch (Magick::Warning& w) {\n                std::cout << \"warn: \" << w.what() << std::endl;\n                // ignore warn\n            } catch (Magick::Error& e) {\n                std::cout << \"a Magick++ error occurred: \" << e.what()\n                          << std::endl;\n                resp.mutable_error()->set_error_code(\n                    sdk::types::code::Code::Internal);\n                resp.mutable_error()->set_error_message(\n                    \"Magick::Blob read exception:\" + std::string(e.what()));\n                break;\n            } catch (...) {\n                std::cout << \"an unhandled error has occurred\" << std::endl;\n                resp.mutable_error()->set_error_code(\n                    sdk::types::code::Code::Internal);\n                resp.mutable_error()->set_error_message(\n                    \"Magick::Blob read exception: an unhandled error has \"\n                    \"occurred\");\n                break;\n            }\n\n            int rows = image.rows();\n            int columns = image.columns();\n            if (rows <= 0 || columns <= 0) {\n                resp.mutable_error()->set_error_code(\n                    sdk::types::code::Code::InvalidArgument);\n                resp.mutable_error()->set_error_message(\n                    std::string(\"invalid image resolution [\") +\n                    std::to_string(columns) + std::string(\" x \") +\n                    std::to_string(rows) + std::string(\"]\"));\n                break;\n            }\n\n            // https://www.imagemagick.org/Magick++/Image++.html\n            cv::Mat mat;\n            std::string map = req.target_color_space();\n            do {\n                image.colorSpace(Magick::RGBColorspace);\n                if (map == \"BGR\") {\n                    mat = ::cv::Mat(rows, columns, CV_8UC3);\n                    image.write(0, 0, columns, rows, \"BGR\", Magick::CharPixel,\n                                mat.data);\n                    break;\n                }\n                if (map == \"BGRA\") {\n                    mat = ::cv::Mat(rows, columns, CV_8UC4);\n                    image.write(0, 0, columns, rows, \"BGRA\", Magick::CharPixel,\n                                mat.data);\n                    break;\n                }\n                if (map == \"GRAY\") {\n                    image.type(Magick::GrayscaleType);\n                    mat = ::cv::Mat(rows, columns, CV_8UC3);\n                    image.write(0, 0, columns, rows, \"BGR\", Magick::CharPixel,\n                                mat.data);\n                    break;\n                }\n                if (map == \"GRAYA\") {\n                    image.type(Magick::GrayscaleMatteType);\n                    mat = ::cv::Mat(rows, columns, CV_8UC4);\n                    image.write(0, 0, columns, rows, \"BGRA\", Magick::CharPixel,\n                                mat.data);\n                    break;\n                }\n                mat = ::cv::Mat(rows, columns, CV_8UC4);\n                image.write(0, 0, columns, rows, map, Magick::CharPixel,\n                            mat.data);\n\n            } while (false);\n\n            // set response\n            resp.set_cv_mat_pointer(reinterpret_cast<int64>(new cv::Mat(mat)));\n            resp.set_rows(image.rows());\n            resp.set_columns(image.columns());\n            resp.set_magick(image.magick());\n            resp.set_orientation_type(\n                static_cast<sdk::api::gocv::OrientationType>(\n                    image.orientation()));\n            resp.set_colorspace_type(\n                static_cast<sdk::api::gocv::ColorspaceType>(\n                    image.colorSpace()));\n\n        } while (0);\n    } catch (const std::exception& e) {\n        resp.mutable_error()->set_error_code(sdk::types::code::Code::Internal);\n        resp.mutable_error()->set_error_message(\"Magick::Blob read exception:\" +\n                                                std::string(e.what()));\n    }\n\n    *resp_data_len = resp.ByteSize();\n    *resp_data = new char[*resp_data_len];\n    resp.SerializeToArray(*resp_data, *resp_data_len);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/gocv/magick_linux_amd64.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage gocv\n\n/*\n#cgo pkg-config: protobuf opencv4 graphics-magick\n#cgo CXXFLAGS: -std=c++11 -I${SRCDIR}/..\n#cgo LDFLAGS: -L${SRCDIR}/../api/openapi-spec/gocv/ -lproto-gocv\n#cgo LDFLAGS: -L${SRCDIR}/../api/openapi-spec/types/ -lproto-types\n#include <stdlib.h>\n#include \"magick.h\"\n*/\nimport \"C\"\n\nimport (\n\t\"sync\"\n\t\"unsafe\"\n\n\tunsafe_ \"github.com/kaydxh/golang/go/unsafe\"\n\tgocvpb \"github.com/kaydxh/golang/pkg/gocv/cgo/api/openapi-spec/gocv\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\nvar once sync.Once\n\nfunc init() {\n\terr := MagickInitializeMagick(nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc MagickInitializeMagick(req *gocvpb.MagickInitializeMagickRequest) error {\n\tvar errOnce error\n\tonce.Do(func() {\n\t\treqData, err := proto.Marshal(req)\n\t\tif err != nil {\n\t\t\terrOnce = err\n\t\t\treturn\n\t\t}\n\n\t\tvar respData *C.char\n\t\tvar respDataLen C.int\n\t\tdefer func() {\n\t\t\tC.free(unsafe.Pointer(respData))\n\t\t\trespData = nil\n\t\t}()\n\n\t\tC.sdk_gocv_magick_initialize_magick(\n\t\t\tunsafe_.BytesPointer(reqData),\n\t\t\tC.int(len(reqData)),\n\t\t\t&respData,\n\t\t\t&respDataLen,\n\t\t)\n\n\t\tvar resp gocvpb.MagickInitializeMagickResponse\n\t\terr = proto.Unmarshal(C.GoBytes(unsafe.Pointer(respData), C.int(respDataLen)), &resp)\n\t\tif err != nil {\n\t\t\terrOnce = err\n\t\t\treturn\n\t\t}\n\t\tif resp.GetError() != nil {\n\t\t\terrOnce = resp.GetError()\n\t\t\treturn\n\t\t}\n\t\terrOnce = nil\n\t\treturn\n\t})\n\n\treturn errOnce\n}\n\nfunc MagickImageDecode(req *gocvpb.MagickImageDecodeRequest) (*gocvpb.MagickImageDecodeResponse, error) {\n\n\treqData, err := proto.Marshal(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar respData *C.char\n\tvar respDataLen C.int\n\tdefer func() {\n\t\tC.free(unsafe.Pointer(respData))\n\t\trespData = nil\n\t}()\n\n\tC.sdk_gocv_magick_image_decode(unsafe_.BytesPointer(reqData), C.int(len(reqData)), &respData, &respDataLen)\n\n\tvar resp gocvpb.MagickImageDecodeResponse\n\terr = proto.Unmarshal(C.GoBytes(unsafe.Pointer(respData), C.int(respDataLen)), &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.GetError() != nil {\n\t\treturn nil, resp.GetError()\n\t}\n\treturn &resp, nil\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/pkgconfig/graphics-magick.pc",
    "content": "prefix=${pcfiledir}/../third_path/graphics-magick\nlibdir=${prefix}/lib\nincludedir=${prefix}/include\n\nName: GraphicsMagick\nDescription: GraphicsMagick Image Processing Library\nVersion: 1.3.35\nLibs: -L${libdir} -lGraphicsMagick++ -lGraphicsMagick\nCflags: -I${includedir}\n"
  },
  {
    "path": "pkg/gocv/cgo/pkgconfig/opencv2.pc",
    "content": "prefix=${pcfiledir}/../third_path/opencv2/\nexec_prefix=${prefix}\n\nName: OpenCV\nDescription: Open Source Computer Vision Library\nVersion: 2.4.12\nLibs: -L${exec_prefix}/lib -L${exec_prefix}/lib64 -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lrt -lpthread -lm -ldl\nCflags: -I${prefix}/include/opencv -I${prefix}/include \n"
  },
  {
    "path": "pkg/gocv/cgo/pkgconfig/opencv4.pc",
    "content": "prefix=${pcfiledir}/../third_path/opencv4/\nexec_prefix=${prefix}\n\nName: OpenCV\nDescription: Open Source Computer Vision Library\nVersion: 4.3.0\nLibs: -L${exec_prefix}/lib64 -lopencv_calib3d -lopencv_core -lopencv_dnn -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_videoio -lopencv_video -lrt -lpthread -lm -ldl\nCflags: -I${prefix}/include/opencv -I${prefix}/include\n"
  },
  {
    "path": "pkg/gocv/cgo/pkgconfig/protobuf.pc",
    "content": "prefix=${pcfiledir}/../third_path/protobuf\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include\n\nName: Protocol Buffers\nDescription: Google's Data Interchange Format\nVersion: 3.6.1\nLibs: -L${libdir} -lprotobuf -pthread\nLibs.private: -lz\nCflags: -I${includedir} -pthread\nConflicts: protobuf-lite\n"
  },
  {
    "path": "pkg/gocv/cgo/pkgconfig/pybind11.pc",
    "content": "prefix=${pcfiledir}/../third_path/pybind11\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include\n\nName: pybind11\nDescription: Seamless operability between C++11 and Python\nVersion: 2.10.4\nLibs: #-L${libdir} -lprotobuf -pthread\nLibs.private: -lz\nCflags: -I${includedir} #-pthread\nRequires: python3-embed\n"
  },
  {
    "path": "pkg/gocv/cgo/pkgconfig/python3-embed.pc",
    "content": "# See: man pkg-config\nprefix=/usr\nexec_prefix=/usr\nlibdir=/usr/lib64\nincludedir=/usr/include\n\nName: Python\nDescription: Embed Python into an application\nRequires:\nVersion: 3.8\nLibs.private: -lcrypt -lpthread -ldl  -lutil -lm\nLibs: -L${libdir} -lpython3.8\nCflags: -I${includedir}/python3.8\n"
  },
  {
    "path": "pkg/gocv/cgo/script/version.sh",
    "content": "#!/usr/bin/env bash\n\n# exit by command return non-zero exit code\nset -o errexit\n# Indicate an error when it encounters an undefined variable\nset -o nounset\n# Fail on any error.\nset -o pipefail\n# set -o xtrace\n\n\nfunction get_version_from_git() {\n  GIT=\"git\"\n  GIT_COMMIT=$(\"${GIT}\" rev-parse \"HEAD^{commit}\")\n  GIT_TAG=$(git describe --long --tags --dirty --tags --always)\n  GIT_BUILD_TIME=$(TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ')\n\n\n  GIT_DIRTY=$(test -n \"`git status --porcelain`\" && echo \"+CHANGES\" || true)\n\n  GIT_TREE_STATE=${GIT_TREE_STATE-}\n  if git_status=$(\"${GIT}\" status --porcelain) && [[ -z ${git_status} ]]; then\n     GIT_TREE_STATE=\"clean\"\n  else\n     GIT_TREE_STATE=\"dirty\"\n  fi\n}\n\nfunction gitinfos() {\n  get_version_from_git\n\n  local -a gitinfos\n  function add_gitinfo() {\n    local key=${1}\n    local val=${2}\n\n    # update the list github.com/kaydxh/golang/pkg/app.\n     gitinfos+=(\n      \"${key}=${val}\"\n    )\n  }\n\n  add_gitinfo \"buildDate\" \"${GIT_BUILD_TIME}\"\n  add_gitinfo \"gitVersion\" \"${GIT_TAG}\"\n  add_gitinfo \"gitCommit\" \"${GIT_COMMIT}\"\n  add_gitinfo \"gitTreeState\" \"${GIT_TREE_STATE}\"\n\n # \"$*\" => get arg1 arg2 arg3 as a single argument \"a1 a2 a3\"\n # \"$@\" => gets arg1, arg2 and arg3 as a separate arguments \"a1\" \"a2\" \"a3\"\n # if no quotes, $* is the same to $@, as a separate arguments \"a1\" \"a2\" \"a3\"\n for gitinfo in \"${gitinfos[@]}\"\n do\n   echo ${gitinfo}\n done\n}\n\n# Allows to call a function based on arguments passed to the script\n$*\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/Makefile",
    "content": "MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))\nPROJECT_ROOT_DIR := $(realpath ${MAKEFILE_DIR}/../..)\nPKG_CONFIG_PATH := ${PROJECT_ROOT_DIR}/pkgconfig\nSCRIPT_PATH := ${MAKEFILE_DIR}/../../script\nTARGET := $(shell basename ${MAKEFILE_DIR})\n\n# https://web.mit.edu/gnu/doc/html/make_8.html\n_empty:=\n# define space with $(_empty)\n_space:= $(_empty) $(_empty)\ndefine joinwith\n  $(subst $(_space),$1,$(strip $2))\nendef\n\n.PHONY: all\nall: deps generate test\n\t@echo \"${MAKEFILE_DIR}\"\n\t@echo \"${PROJECT_ROOT_DIR}\"\n\t@echo \"${TARGET}\"\n\n.PHONY: deps\ndeps:\n\t@echo \"  >  downloading deps library\"\n\n.PHONY: version\nversion:\n\t@bash -c \"bash ${SCRIPT_PATH}/version.sh gitinfos\"\n\n.PHONY: test\ntest: version\n\t@$(eval THIRD_LIB_PATHS := $(shell find -L ${PROJECT_ROOT_DIR}/third_path/ -type d -iname \"lib*\" -print0 |xargs -0 -I {} bash -c 'echo {}'|grep -v \"stubs\"))\n\t@echo ${THIRD_LIB_PATHS}\n\t@$(eval JOINED_THIRD_LIB_PATHS := $(call joinwith,:,$(THIRD_LIB_PATHS)))\n\t PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}\" LD_LIBRARY_PATH=\"$(JOINED_THIRD_LIB_PATHS):${LD_LIBRARY_PATH}\" LIBRARY_PATH=\"$(JOINED_THIRD_LIB_PATHS):${LIBRARY_PATH}\" go test -a -v .\n\n.PHONY: generate \ngenerate:\n\t\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/cgo.go",
    "content": "package gocv\n\n/*\n#cgo linux,amd64 pkg-config: opencv4 graphics-magick\n#cgo !linux !amd64 CXXFLAGS: -D__CGO_UNKNOWN_PLATFORM__\n#cgo CXXFLAGS: -std=c++11\n#include <stdlib.h>\n*/\nimport \"C\"\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/gocv.go",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (https://www.swig.org).\n * Version 4.1.1\n *\n * Do not make changes to this file unless you know what you are doing - modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n// source: gocv.swigcxx\n\npackage gocv\n\n/*\n#define intgo swig_intgo\ntypedef void *swig_voidp;\n\n#include <stddef.h>\n#include <stdint.h>\n\n\ntypedef long long intgo;\ntypedef unsigned long long uintgo;\n\n\n\ntypedef struct { char *p; intgo n; } _gostring_;\ntypedef struct { void* array; intgo len; intgo cap; } _goslice_;\n\n\ntypedef _gostring_ swig_type_1;\ntypedef _gostring_ swig_type_2;\ntypedef _gostring_ swig_type_3;\ntypedef _gostring_ swig_type_4;\ntypedef _gostring_ swig_type_5;\ntypedef _gostring_ swig_type_6;\ntypedef _gostring_ swig_type_7;\ntypedef _gostring_ swig_type_8;\nextern void _wrap_Swig_free_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern uintptr_t _wrap_Swig_malloc_gocv_ba346308b44e7b91(swig_intgo arg1);\nextern void _wrap_MagickInitializeMagickRequest_path_set_gocv_ba346308b44e7b91(uintptr_t arg1, swig_type_1 arg2);\nextern swig_type_2 _wrap_MagickInitializeMagickRequest_path_get_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern uintptr_t _wrap_new_MagickInitializeMagickRequest_gocv_ba346308b44e7b91(void);\nextern void _wrap_delete_MagickInitializeMagickRequest_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern uintptr_t _wrap_new_MagickInitializeMagickResponse_gocv_ba346308b44e7b91(void);\nextern void _wrap_delete_MagickInitializeMagickResponse_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern void _wrap_MagickImageDecodeRequest_image_set_gocv_ba346308b44e7b91(uintptr_t arg1, swig_type_3 arg2);\nextern swig_type_4 _wrap_MagickImageDecodeRequest_image_get_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern void _wrap_MagickImageDecodeRequest_target_color_space_set_gocv_ba346308b44e7b91(uintptr_t arg1, swig_type_5 arg2);\nextern swig_type_6 _wrap_MagickImageDecodeRequest_target_color_space_get_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern uintptr_t _wrap_new_MagickImageDecodeRequest_gocv_ba346308b44e7b91(void);\nextern void _wrap_delete_MagickImageDecodeRequest_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern swig_intgo _wrap_UndefinedOrientation_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_TopLeftOrientation_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_TopRightOrientation_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_BottomRightOrientation_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_BottomLeftOrientation_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_LeftTopOrientation_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_RightTopOrientation_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_RightBottomOrientation_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_LeftBottomOrientation_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_UndefinedColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_RGBColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_GRAYColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_TransparentColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_OHTAColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_XYZColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_YCCColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_YIQColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_YPbPrColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_YUVColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_CMYKColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_sRGBColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_HSLColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_HWBColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_LABColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_CineonLogRGBColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_Rec601LumaColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_Rec601YCbCrColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_Rec709LumaColorspace_gocv_ba346308b44e7b91(void);\nextern swig_intgo _wrap_Rec709YCbCrColorspace_gocv_ba346308b44e7b91(void);\nextern void _wrap_MagickImageDecodeResponse_mat_set_gocv_ba346308b44e7b91(uintptr_t arg1, uintptr_t arg2);\nextern uintptr_t _wrap_MagickImageDecodeResponse_mat_get_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern void _wrap_MagickImageDecodeResponse_rows_set_gocv_ba346308b44e7b91(uintptr_t arg1, swig_intgo arg2);\nextern swig_intgo _wrap_MagickImageDecodeResponse_rows_get_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern void _wrap_MagickImageDecodeResponse_columns_set_gocv_ba346308b44e7b91(uintptr_t arg1, swig_intgo arg2);\nextern swig_intgo _wrap_MagickImageDecodeResponse_columns_get_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern void _wrap_MagickImageDecodeResponse_magick_set_gocv_ba346308b44e7b91(uintptr_t arg1, swig_type_7 arg2);\nextern swig_type_8 _wrap_MagickImageDecodeResponse_magick_get_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern void _wrap_MagickImageDecodeResponse_orientation_type_set_gocv_ba346308b44e7b91(uintptr_t arg1, swig_intgo arg2);\nextern swig_intgo _wrap_MagickImageDecodeResponse_orientation_type_get_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern void _wrap_MagickImageDecodeResponse_colorspace_type_set_gocv_ba346308b44e7b91(uintptr_t arg1, swig_intgo arg2);\nextern swig_intgo _wrap_MagickImageDecodeResponse_colorspace_type_get_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern uintptr_t _wrap_new_MagickImageDecodeResponse_gocv_ba346308b44e7b91(void);\nextern void _wrap_delete_MagickImageDecodeResponse_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern uintptr_t _wrap_new_Wrapped_MagicImage_gocv_ba346308b44e7b91(void);\nextern void _wrap_delete_Wrapped_MagicImage_gocv_ba346308b44e7b91(uintptr_t arg1);\nextern void _wrap_Wrapped_MagicImage_MagickInitializeMagick_gocv_ba346308b44e7b91(uintptr_t arg1, uintptr_t arg2);\nextern void _wrap_Wrapped_MagicImage_Wrapped_MagickImageDecode_gocv_ba346308b44e7b91(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3);\n#undef intgo\n*/\nimport \"C\"\n\nimport \"unsafe\"\nimport _ \"runtime/cgo\"\nimport \"sync\"\nimport \"fmt\"\n\n\ntype _ unsafe.Pointer\n\n\n\nvar Swig_escape_always_false bool\nvar Swig_escape_val interface{}\n\n\ntype _swig_fnptr *byte\ntype _swig_memberptr *byte\n\n\nfunc getSwigcptr(v interface { Swigcptr() uintptr }) uintptr {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn v.Swigcptr()\n}\n\n\ntype _ sync.Mutex\n\n//export cgo_panic__gocv_ba346308b44e7b91\nfunc cgo_panic__gocv_ba346308b44e7b91(p *byte) {\n\ts := (*[1024]byte)(unsafe.Pointer(p))[:]\n\tfor i, b := range s {\n\t\tif b == 0 {\n\t\t\tpanic(string(s[:i]))\n\t\t}\n\t}\n\tpanic(string(s))\n}\n\n\ntype swig_gostring struct { p uintptr; n int }\nfunc swigCopyString(s string) string {\n  p := *(*swig_gostring)(unsafe.Pointer(&s))\n  r := string((*[0x7fffffff]byte)(unsafe.Pointer(p.p))[:p.n])\n  Swig_free(p.p)\n  return r\n}\n\nfunc Swig_free(arg1 uintptr) {\n\t_swig_i_0 := arg1\n\tC._wrap_Swig_free_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n}\n\nfunc Swig_malloc(arg1 int) (_swig_ret uintptr) {\n\tvar swig_r uintptr\n\t_swig_i_0 := arg1\n\tswig_r = (uintptr)(C._wrap_Swig_malloc_gocv_ba346308b44e7b91(C.swig_intgo(_swig_i_0)))\n\treturn swig_r\n}\n\ntype SwigcptrMagickInitializeMagickRequest uintptr\n\nfunc (p SwigcptrMagickInitializeMagickRequest) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrMagickInitializeMagickRequest) SwigIsMagickInitializeMagickRequest() {\n}\n\nfunc (arg1 SwigcptrMagickInitializeMagickRequest) SetPath(arg2 string) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_MagickInitializeMagickRequest_path_set_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), *(*C.swig_type_1)(unsafe.Pointer(&_swig_i_1)))\n\tif Swig_escape_always_false {\n\t\tSwig_escape_val = arg2\n\t}\n}\n\nfunc (arg1 SwigcptrMagickInitializeMagickRequest) GetPath() (_swig_ret string) {\n\tvar swig_r string\n\t_swig_i_0 := arg1\n\tswig_r_p := C._wrap_MagickInitializeMagickRequest_path_get_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n\tswig_r = *(*string)(unsafe.Pointer(&swig_r_p))\n\tvar swig_r_1 string\n swig_r_1 = swigCopyString(swig_r) \n\treturn swig_r_1\n}\n\nfunc NewMagickInitializeMagickRequest() (_swig_ret MagickInitializeMagickRequest) {\n\tvar swig_r MagickInitializeMagickRequest\n\tswig_r = (MagickInitializeMagickRequest)(SwigcptrMagickInitializeMagickRequest(C._wrap_new_MagickInitializeMagickRequest_gocv_ba346308b44e7b91()))\n\treturn swig_r\n}\n\nfunc DeleteMagickInitializeMagickRequest(arg1 MagickInitializeMagickRequest) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_MagickInitializeMagickRequest_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n}\n\ntype MagickInitializeMagickRequest interface {\n\tSwigcptr() uintptr\n\tSwigIsMagickInitializeMagickRequest()\n\tSetPath(arg2 string)\n\tGetPath() (_swig_ret string)\n}\n\ntype SwigcptrMagickInitializeMagickResponse uintptr\n\nfunc (p SwigcptrMagickInitializeMagickResponse) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrMagickInitializeMagickResponse) SwigIsMagickInitializeMagickResponse() {\n}\n\nfunc NewMagickInitializeMagickResponse() (_swig_ret MagickInitializeMagickResponse) {\n\tvar swig_r MagickInitializeMagickResponse\n\tswig_r = (MagickInitializeMagickResponse)(SwigcptrMagickInitializeMagickResponse(C._wrap_new_MagickInitializeMagickResponse_gocv_ba346308b44e7b91()))\n\treturn swig_r\n}\n\nfunc DeleteMagickInitializeMagickResponse(arg1 MagickInitializeMagickResponse) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_MagickInitializeMagickResponse_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n}\n\ntype MagickInitializeMagickResponse interface {\n\tSwigcptr() uintptr\n\tSwigIsMagickInitializeMagickResponse()\n}\n\ntype SwigcptrMagickImageDecodeRequest uintptr\n\nfunc (p SwigcptrMagickImageDecodeRequest) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrMagickImageDecodeRequest) SwigIsMagickImageDecodeRequest() {\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeRequest) SetImage(arg2 string) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_MagickImageDecodeRequest_image_set_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), *(*C.swig_type_3)(unsafe.Pointer(&_swig_i_1)))\n\tif Swig_escape_always_false {\n\t\tSwig_escape_val = arg2\n\t}\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeRequest) GetImage() (_swig_ret string) {\n\tvar swig_r string\n\t_swig_i_0 := arg1\n\tswig_r_p := C._wrap_MagickImageDecodeRequest_image_get_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n\tswig_r = *(*string)(unsafe.Pointer(&swig_r_p))\n\tvar swig_r_1 string\n swig_r_1 = swigCopyString(swig_r) \n\treturn swig_r_1\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeRequest) SetTarget_color_space(arg2 string) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_MagickImageDecodeRequest_target_color_space_set_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), *(*C.swig_type_5)(unsafe.Pointer(&_swig_i_1)))\n\tif Swig_escape_always_false {\n\t\tSwig_escape_val = arg2\n\t}\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeRequest) GetTarget_color_space() (_swig_ret string) {\n\tvar swig_r string\n\t_swig_i_0 := arg1\n\tswig_r_p := C._wrap_MagickImageDecodeRequest_target_color_space_get_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n\tswig_r = *(*string)(unsafe.Pointer(&swig_r_p))\n\tvar swig_r_1 string\n swig_r_1 = swigCopyString(swig_r) \n\treturn swig_r_1\n}\n\nfunc NewMagickImageDecodeRequest() (_swig_ret MagickImageDecodeRequest) {\n\tvar swig_r MagickImageDecodeRequest\n\tswig_r = (MagickImageDecodeRequest)(SwigcptrMagickImageDecodeRequest(C._wrap_new_MagickImageDecodeRequest_gocv_ba346308b44e7b91()))\n\treturn swig_r\n}\n\nfunc DeleteMagickImageDecodeRequest(arg1 MagickImageDecodeRequest) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_MagickImageDecodeRequest_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n}\n\ntype MagickImageDecodeRequest interface {\n\tSwigcptr() uintptr\n\tSwigIsMagickImageDecodeRequest()\n\tSetImage(arg2 string)\n\tGetImage() (_swig_ret string)\n\tSetTarget_color_space(arg2 string)\n\tGetTarget_color_space() (_swig_ret string)\n}\n\ntype GocvOrientationType int\nfunc _swig_getUndefinedOrientation() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\tswig_r = (GocvOrientationType)(C._wrap_UndefinedOrientation_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar UndefinedOrientation GocvOrientationType = _swig_getUndefinedOrientation()\nfunc _swig_getTopLeftOrientation() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\tswig_r = (GocvOrientationType)(C._wrap_TopLeftOrientation_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar TopLeftOrientation GocvOrientationType = _swig_getTopLeftOrientation()\nfunc _swig_getTopRightOrientation() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\tswig_r = (GocvOrientationType)(C._wrap_TopRightOrientation_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar TopRightOrientation GocvOrientationType = _swig_getTopRightOrientation()\nfunc _swig_getBottomRightOrientation() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\tswig_r = (GocvOrientationType)(C._wrap_BottomRightOrientation_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar BottomRightOrientation GocvOrientationType = _swig_getBottomRightOrientation()\nfunc _swig_getBottomLeftOrientation() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\tswig_r = (GocvOrientationType)(C._wrap_BottomLeftOrientation_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar BottomLeftOrientation GocvOrientationType = _swig_getBottomLeftOrientation()\nfunc _swig_getLeftTopOrientation() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\tswig_r = (GocvOrientationType)(C._wrap_LeftTopOrientation_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar LeftTopOrientation GocvOrientationType = _swig_getLeftTopOrientation()\nfunc _swig_getRightTopOrientation() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\tswig_r = (GocvOrientationType)(C._wrap_RightTopOrientation_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar RightTopOrientation GocvOrientationType = _swig_getRightTopOrientation()\nfunc _swig_getRightBottomOrientation() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\tswig_r = (GocvOrientationType)(C._wrap_RightBottomOrientation_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar RightBottomOrientation GocvOrientationType = _swig_getRightBottomOrientation()\nfunc _swig_getLeftBottomOrientation() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\tswig_r = (GocvOrientationType)(C._wrap_LeftBottomOrientation_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar LeftBottomOrientation GocvOrientationType = _swig_getLeftBottomOrientation()\ntype GocvColorspaceType int\nfunc _swig_getUndefinedColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_UndefinedColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar UndefinedColorspace GocvColorspaceType = _swig_getUndefinedColorspace()\nfunc _swig_getRGBColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_RGBColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar RGBColorspace GocvColorspaceType = _swig_getRGBColorspace()\nfunc _swig_getGRAYColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_GRAYColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar GRAYColorspace GocvColorspaceType = _swig_getGRAYColorspace()\nfunc _swig_getTransparentColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_TransparentColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar TransparentColorspace GocvColorspaceType = _swig_getTransparentColorspace()\nfunc _swig_getOHTAColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_OHTAColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar OHTAColorspace GocvColorspaceType = _swig_getOHTAColorspace()\nfunc _swig_getXYZColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_XYZColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar XYZColorspace GocvColorspaceType = _swig_getXYZColorspace()\nfunc _swig_getYCCColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_YCCColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar YCCColorspace GocvColorspaceType = _swig_getYCCColorspace()\nfunc _swig_getYIQColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_YIQColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar YIQColorspace GocvColorspaceType = _swig_getYIQColorspace()\nfunc _swig_getYPbPrColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_YPbPrColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar YPbPrColorspace GocvColorspaceType = _swig_getYPbPrColorspace()\nfunc _swig_getYUVColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_YUVColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar YUVColorspace GocvColorspaceType = _swig_getYUVColorspace()\nfunc _swig_getCMYKColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_CMYKColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar CMYKColorspace GocvColorspaceType = _swig_getCMYKColorspace()\nfunc _swig_getsRGBColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_sRGBColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar SRGBColorspace GocvColorspaceType = _swig_getsRGBColorspace()\nfunc _swig_getHSLColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_HSLColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar HSLColorspace GocvColorspaceType = _swig_getHSLColorspace()\nfunc _swig_getHWBColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_HWBColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar HWBColorspace GocvColorspaceType = _swig_getHWBColorspace()\nfunc _swig_getLABColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_LABColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar LABColorspace GocvColorspaceType = _swig_getLABColorspace()\nfunc _swig_getCineonLogRGBColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_CineonLogRGBColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar CineonLogRGBColorspace GocvColorspaceType = _swig_getCineonLogRGBColorspace()\nfunc _swig_getRec601LumaColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_Rec601LumaColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar Rec601LumaColorspace GocvColorspaceType = _swig_getRec601LumaColorspace()\nfunc _swig_getRec601YCbCrColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_Rec601YCbCrColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar Rec601YCbCrColorspace GocvColorspaceType = _swig_getRec601YCbCrColorspace()\nfunc _swig_getRec709LumaColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_Rec709LumaColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar Rec709LumaColorspace GocvColorspaceType = _swig_getRec709LumaColorspace()\nfunc _swig_getRec709YCbCrColorspace() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\tswig_r = (GocvColorspaceType)(C._wrap_Rec709YCbCrColorspace_gocv_ba346308b44e7b91())\n\treturn swig_r\n}\n\nvar Rec709YCbCrColorspace GocvColorspaceType = _swig_getRec709YCbCrColorspace()\ntype SwigcptrMagickImageDecodeResponse uintptr\n\nfunc (p SwigcptrMagickImageDecodeResponse) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrMagickImageDecodeResponse) SwigIsMagickImageDecodeResponse() {\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) SetMat(arg2 Cv_Mat) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := getSwigcptr(arg2)\n\tC._wrap_MagickImageDecodeResponse_mat_set_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1))\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) GetMat() (_swig_ret Cv_Mat) {\n\tvar swig_r Cv_Mat\n\t_swig_i_0 := arg1\n\tswig_r = (Cv_Mat)(SwigcptrCv_Mat(C._wrap_MagickImageDecodeResponse_mat_get_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))))\n\treturn swig_r\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) SetRows(arg2 int) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_MagickImageDecodeResponse_rows_set_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1))\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) GetRows() (_swig_ret int) {\n\tvar swig_r int\n\t_swig_i_0 := arg1\n\tswig_r = (int)(C._wrap_MagickImageDecodeResponse_rows_get_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0)))\n\treturn swig_r\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) SetColumns(arg2 int) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_MagickImageDecodeResponse_columns_set_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1))\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) GetColumns() (_swig_ret int) {\n\tvar swig_r int\n\t_swig_i_0 := arg1\n\tswig_r = (int)(C._wrap_MagickImageDecodeResponse_columns_get_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0)))\n\treturn swig_r\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) SetMagick(arg2 string) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_MagickImageDecodeResponse_magick_set_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), *(*C.swig_type_7)(unsafe.Pointer(&_swig_i_1)))\n\tif Swig_escape_always_false {\n\t\tSwig_escape_val = arg2\n\t}\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) GetMagick() (_swig_ret string) {\n\tvar swig_r string\n\t_swig_i_0 := arg1\n\tswig_r_p := C._wrap_MagickImageDecodeResponse_magick_get_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n\tswig_r = *(*string)(unsafe.Pointer(&swig_r_p))\n\tvar swig_r_1 string\n swig_r_1 = swigCopyString(swig_r) \n\treturn swig_r_1\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) SetOrientation_type(arg2 GocvOrientationType) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_MagickImageDecodeResponse_orientation_type_set_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1))\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) GetOrientation_type() (_swig_ret GocvOrientationType) {\n\tvar swig_r GocvOrientationType\n\t_swig_i_0 := arg1\n\tswig_r = (GocvOrientationType)(C._wrap_MagickImageDecodeResponse_orientation_type_get_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0)))\n\treturn swig_r\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) SetColorspace_type(arg2 GocvColorspaceType) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_MagickImageDecodeResponse_colorspace_type_set_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1))\n}\n\nfunc (arg1 SwigcptrMagickImageDecodeResponse) GetColorspace_type() (_swig_ret GocvColorspaceType) {\n\tvar swig_r GocvColorspaceType\n\t_swig_i_0 := arg1\n\tswig_r = (GocvColorspaceType)(C._wrap_MagickImageDecodeResponse_colorspace_type_get_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0)))\n\treturn swig_r\n}\n\nfunc NewMagickImageDecodeResponse() (_swig_ret MagickImageDecodeResponse) {\n\tvar swig_r MagickImageDecodeResponse\n\tswig_r = (MagickImageDecodeResponse)(SwigcptrMagickImageDecodeResponse(C._wrap_new_MagickImageDecodeResponse_gocv_ba346308b44e7b91()))\n\treturn swig_r\n}\n\nfunc DeleteMagickImageDecodeResponse(arg1 MagickImageDecodeResponse) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_MagickImageDecodeResponse_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n}\n\ntype MagickImageDecodeResponse interface {\n\tSwigcptr() uintptr\n\tSwigIsMagickImageDecodeResponse()\n\tSetMat(arg2 Cv_Mat)\n\tGetMat() (_swig_ret Cv_Mat)\n\tSetRows(arg2 int)\n\tGetRows() (_swig_ret int)\n\tSetColumns(arg2 int)\n\tGetColumns() (_swig_ret int)\n\tSetMagick(arg2 string)\n\tGetMagick() (_swig_ret string)\n\tSetOrientation_type(arg2 GocvOrientationType)\n\tGetOrientation_type() (_swig_ret GocvOrientationType)\n\tSetColorspace_type(arg2 GocvColorspaceType)\n\tGetColorspace_type() (_swig_ret GocvColorspaceType)\n}\n\ntype SwigcptrWrapped_MagicImage uintptr\n\nfunc (p SwigcptrWrapped_MagicImage) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrWrapped_MagicImage) SwigIsWrapped_MagicImage() {\n}\n\nfunc NewWrapped_MagicImage() (_swig_ret Wrapped_MagicImage) {\n\tvar swig_r Wrapped_MagicImage\n\tswig_r = (Wrapped_MagicImage)(SwigcptrWrapped_MagicImage(C._wrap_new_Wrapped_MagicImage_gocv_ba346308b44e7b91()))\n\treturn swig_r\n}\n\nfunc DeleteWrapped_MagicImage(arg1 Wrapped_MagicImage) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_Wrapped_MagicImage_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0))\n}\n\nfunc Wrapped_MagicImageMagickInitializeMagick(arg1 MagickInitializeMagickRequest, arg2 MagickInitializeMagickResponse) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\t_swig_i_1 := getSwigcptr(arg2)\n\tC._wrap_Wrapped_MagicImage_MagickInitializeMagick_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1))\n}\n\nfunc (arg1 SwigcptrWrapped_MagicImage) Wrapped_MagickImageDecode(arg2 MagickImageDecodeRequest, arg3 MagickImageDecodeResponse) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := getSwigcptr(arg2)\n\t_swig_i_2 := getSwigcptr(arg3)\n\tC._wrap_Wrapped_MagicImage_Wrapped_MagickImageDecode_gocv_ba346308b44e7b91(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1), C.uintptr_t(_swig_i_2))\n}\n\ntype Wrapped_MagicImage interface {\n\tSwigcptr() uintptr\n\tSwigIsWrapped_MagicImage()\n\tWrapped_MagickImageDecode(arg2 MagickImageDecodeRequest, arg3 MagickImageDecodeResponse)\n}\n\n\n\ntype MagicImage interface {\n   Wrapped_MagicImage \n   MagickImageDecode(MagickImageDecodeRequest) (MagickImageDecodeResponse, error)\n}\n\nfunc NewMagicImage() MagicImage {\n     mi := NewWrapped_MagicImage()\n     return mi.(MagicImage)\n}\n\n// catch will recover from a panic and store the recover message to the error \n// parameter. The error must be passed by reference in order to be returned to the\n// calling function.\nfunc catch(err *error) {\n    if r := recover(); r != nil {\n        *err = fmt.Errorf(\"%v\", r)\n    }\n}\n\nfunc MagickInitializeMagick(req MagickInitializeMagickRequest) (resp MagickInitializeMagickResponse, err error) {\n   defer catch(&err)\n   resp = NewMagickInitializeMagickResponse()\n   Wrapped_MagicImageMagickInitializeMagick(req, resp)\n   return\n}\n\nfunc (arg SwigcptrWrapped_MagicImage) MagickImageDecode(req MagickImageDecodeRequest) (resp MagickImageDecodeResponse, err error) {\n\tdefer catch(&err)\n    resp = NewMagickImageDecodeResponse()\n\targ.Wrapped_MagickImageDecode(req, resp)\n\treturn\n}\n\n\n\ntype SwigcptrCv_Mat uintptr\ntype Cv_Mat interface {\n\tSwigcptr() uintptr;\n}\nfunc (p SwigcptrCv_Mat) Swigcptr() uintptr {\n\treturn uintptr(p)\n}\n\n\n\nvar swigDirectorTrack struct {\n\tsync.Mutex\n\tm map[int]interface{}\n\tc int\n}\n\nfunc swigDirectorAdd(v interface{}) int {\n\tswigDirectorTrack.Lock()\n\tdefer swigDirectorTrack.Unlock()\n\tif swigDirectorTrack.m == nil {\n\t\tswigDirectorTrack.m = make(map[int]interface{})\n\t}\n\tswigDirectorTrack.c++\n\tret := swigDirectorTrack.c\n\tswigDirectorTrack.m[ret] = v\n\treturn ret\n}\n\nfunc swigDirectorLookup(c int) interface{} {\n\tswigDirectorTrack.Lock()\n\tdefer swigDirectorTrack.Unlock()\n\tret := swigDirectorTrack.m[c]\n\tif ret == nil {\n\t\tpanic(\"C++ director pointer not found (possible\tuse-after-free)\")\n\t}\n\treturn ret\n}\n\nfunc swigDirectorDelete(c int) {\n\tswigDirectorTrack.Lock()\n\tdefer swigDirectorTrack.Unlock()\n\tif swigDirectorTrack.m[c] == nil {\n\t\tif c > swigDirectorTrack.c {\n\t\t\tpanic(\"C++ director pointer invalid (possible memory corruption\")\n\t\t} else {\n\t\t\tpanic(\"C++ director pointer not found (possible use-after-free)\")\n\t\t}\n\t}\n\tdelete(swigDirectorTrack.m, c)\n}\n\n\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/gocv.h",
    "content": "#ifndef GOCV_CGO_SWIG_GOCV_GOCV_H_\n#define GOCV_CGO_SWIG_GOCV_GOCV_H_\n\n#include <opencv2/opencv.hpp>\n#include <stdexcept>\n#include <string>\n\nnamespace gocv {\nstruct MagickInitializeMagickRequest {\n    std::string path;\n};\n\nstruct MagickInitializeMagickResponse {};\n\nstruct MagickImageDecodeRequest {\n    std::string image;\n    std::string target_color_space;\n};\n\nenum OrientationType {\n    UndefinedOrientation = 0,\n    TopLeftOrientation = 1,\n    TopRightOrientation = 2,\n    BottomRightOrientation = 3,\n    BottomLeftOrientation = 4,\n    LeftTopOrientation = 5,\n    RightTopOrientation = 6,\n    RightBottomOrientation = 7,\n    LeftBottomOrientation = 8\n};\n\n// graphics-magick/include/magick/colorspace.h\nenum ColorspaceType {\n    UndefinedColorspace = 0,\n    RGBColorspace = 1,  /* Plain old RGB colorspace */\n    GRAYColorspace = 2, /* Plain old full-range grayscale */\n    TransparentColorspace =\n        3, /* RGB but preserve matte channel during quantize */\n    OHTAColorspace = 4,\n    XYZColorspace = 5, /* CIE XYZ */\n    YCCColorspace = 6, /* Kodak PhotoCD PhotoYCC */\n    YIQColorspace = 7,\n    YPbPrColorspace = 8,\n    YUVColorspace = 9,\n    CMYKColorspace = 10, /* Cyan, magenta, yellow, black, alpha */\n    sRGBColorspace = 11, /* Kodak PhotoCD sRGB */\n    HSLColorspace = 12,  /* Hue, saturation, luminosity */\n    HWBColorspace = 13,  /* Hue, whiteness, blackness */\n    LABColorspace =\n        14, /* LAB colorspace not supported yet other than via lcms */\n    CineonLogRGBColorspace =\n        15, /* RGB data with Cineon Log scaling, 2.048 density range */\n    Rec601LumaColorspace = 16,  /* Luma (Y) according to ITU-R 601 */\n    Rec601YCbCrColorspace = 17, /* YCbCr according to ITU-R 601 */\n    Rec709LumaColorspace = 18,  /* Luma (Y) according to ITU-R 709 */\n    Rec709YCbCrColorspace = 19  /* YCbCr according to ITU-R 709 */\n};\n\nstruct MagickImageDecodeResponse {\n    cv::Mat mat;\n    int rows;            // height\n    int columns;         // width\n    std::string magick;  // File type magick identifier (.e.g \"GIF\")\n    OrientationType orientation_type;\n    ColorspaceType colorspace_type;\n};\n\n#ifdef SWIG\nclass MagicImage {\n#else\nclass __attribute__((visibility(\"hidden\"))) MagicImage {\n#endif\npublic:\nMagicImage() = default;\n~MagicImage();\n\nstatic void MagickInitializeMagick(const MagickInitializeMagickRequest& req,\n                                   MagickInitializeMagickResponse& resp);\n\nvoid MagickImageDecode(const MagickImageDecodeRequest& req,\n                       MagickImageDecodeResponse& resp);\n\n};\n\n}  // namespace gocv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/gocv.swigcxx",
    "content": "//go:build ignore\n/* swig -go -cgo -c++ -intgosize 64 gocv.swigcxx */\n\n%module(directors=\"1\") gocv\n%include <typemaps.i>\n%include <std_map.i>\n%include <std_string.i>\n%include <std_vector.i>\n%include <exception.i>\n%{\n#include \"gocv.h\"\n%}\n\n%exception {\n    try {\n        $action;\n    } catch (const std::exception& e) {\n        _swig_gopanic(e.what());\n    }\n}\n\n%rename(Wrapped_MagicImage) MagicImage;\n%rename(Wrapped_MagickImageDecode)  MagickImageDecode;\n%rename(Wrapped_Divide) Divide;\n\n/*\n%typemap(gotype) int \"int32\"\n%typemap(gotype) int64 \"int64\"\n%typemap(gotype) int64* \"*int64\"\n*/\n\n%header %{\n\n%}\n%include \"gocv.h\"\n\n%go_import(\"fmt\")\n%insert(go_wrapper) %{\n\ntype MagicImage interface {\n   Wrapped_MagicImage \n   MagickImageDecode(MagickImageDecodeRequest) (MagickImageDecodeResponse, error)\n}\n\nfunc NewMagicImage() MagicImage {\n     mi := NewWrapped_MagicImage()\n     return mi.(MagicImage)\n}\n\n// catch will recover from a panic and store the recover message to the error \n// parameter. The error must be passed by reference in order to be returned to the\n// calling function.\nfunc catch(err *error) {\n    if r := recover(); r != nil {\n        *err = fmt.Errorf(\"%v\", r)\n    }\n}\n\nfunc MagickInitializeMagick(req MagickInitializeMagickRequest) (resp MagickInitializeMagickResponse, err error) {\n   defer catch(&err)\n   resp = NewMagickInitializeMagickResponse()\n   Wrapped_MagicImageMagickInitializeMagick(req, resp)\n   return\n}\n\nfunc (arg SwigcptrWrapped_MagicImage) MagickImageDecode(req MagickImageDecodeRequest) (resp MagickImageDecodeResponse, err error) {\n\tdefer catch(&err)\n    resp = NewMagickImageDecodeResponse()\n\targ.Wrapped_MagickImageDecode(req, resp)\n\treturn\n}\n\n%}\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/gocv_linux_amd64.cpp",
    "content": "#include <Magick++.h>\n\n#include <stdexcept>\n\n#include \"gocv.h\"\n\nnamespace gocv {\n\nMagicImage::~MagicImage() {}\n\nvoid MagicImage::MagickInitializeMagick(\n    const MagickInitializeMagickRequest& req,\n    MagickInitializeMagickResponse& resp) {\n    if (req.path.empty()) {\n        Magick::InitializeMagick(nullptr);\n        return;\n    }\n    Magick::InitializeMagick(req.path.c_str());\n}\n\nvoid MagicImage::MagickImageDecode(const MagickImageDecodeRequest& req,\n                                   MagickImageDecodeResponse& resp) {\n    if (req.image.empty()) {\n        throw std::invalid_argument(\"image is empty\");\n    }\n\n    Magick::Image image;\n    try {\n        Magick::Blob blob((void*)(req.image.data()), req.image.length());\n        image.read(blob);\n    } catch (Magick::Warning& w) {\n        std::cout << \"warn: \" << w.what() << std::endl;\n        // ignore warn\n    } catch (Magick::Error& e) {\n        std::cout << \"a Magick++ error occurred: \" << e.what() << std::endl;\n        throw;\n    } catch (...) {\n        std::cout << \"an unhandled error has occurred\" << std::endl;\n        throw;\n    }\n\n    int rows = image.rows();\n    int columns = image.columns();\n    if (rows <= 0 || columns <= 0) {\n        throw std::invalid_argument(std::string(\"invalid image resolution [\") +\n                                    std::to_string(columns) +\n                                    std::string(\" x \") + std::to_string(rows) +\n                                    std::string(\"]\"));\n    }\n\n    cv::Mat mat;\n    std::string map = req.target_color_space;\n    do {\n        image.colorSpace(Magick::RGBColorspace);\n        if (map == \"BGR\") {\n            mat = ::cv::Mat(rows, columns, CV_8UC3);\n            image.write(0, 0, columns, rows, \"BGR\", Magick::CharPixel,\n                        mat.data);\n            break;\n        }\n        if (map == \"BGRA\") {\n            mat = ::cv::Mat(rows, columns, CV_8UC4);\n            image.write(0, 0, columns, rows, \"BGRA\", Magick::CharPixel,\n                        mat.data);\n            break;\n        }\n        if (map == \"GRAY\") {\n            image.type(Magick::GrayscaleType);\n            mat = ::cv::Mat(rows, columns, CV_8UC3);\n            image.write(0, 0, columns, rows, \"BGR\", Magick::CharPixel,\n                        mat.data);\n            break;\n        }\n        if (map == \"GRAYA\") {\n            image.type(Magick::GrayscaleMatteType);\n            mat = ::cv::Mat(rows, columns, CV_8UC4);\n            image.write(0, 0, columns, rows, \"BGRA\", Magick::CharPixel,\n                        mat.data);\n            break;\n        }\n        mat = ::cv::Mat(rows, columns, CV_8UC4);\n        image.write(0, 0, columns, rows, map, Magick::CharPixel, mat.data);\n    } while (false);\n\n    resp.mat = mat.clone();\n    resp.magick = image.magick();\n    resp.orientation_type =\n        static_cast<gocv::OrientationType>(image.orientation());\n    resp.colorspace_type =\n        static_cast<gocv::ColorspaceType>(image.colorSpace());\n\n    resp.rows = rows;\n    resp.columns = columns;\n    return;\n}\n\n}  // namespace gocv\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/gocv_linux_amd64.go",
    "content": "package gocv\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/gocv_test.go",
    "content": "package gocv_test\n\nimport (\n\t\"testing\"\n\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\tgocv_ \"github.com/kaydxh/golang/pkg/gocv/cgo/swig/gocv\"\n)\n\nfunc TestMagickInitializeMagick(t *testing.T) {\n}\n\nfunc TestMagickImageDecode(t *testing.T) {\n\tfilename := \"testdata/test.jpg\"\n\tdata, err := io_.ReadFile(filename)\n\tif err != nil {\n\t\tt.Error(\"Invalid ReadFile in TestMagickImageDecode\")\n\t\treturn\n\t}\n\tt.Logf(\"data size: %v\", len(data))\n\n\tsdk := gocv_.NewMagicImage()\n\tinitReq := gocv_.NewMagickInitializeMagickRequest()\n\t_, err = gocv_.MagickInitializeMagick(initReq)\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t\treturn\n\t}\n\n\treq := gocv_.NewMagickImageDecodeRequest()\n\treq.SetImage(string(data))\n\tresp, err := sdk.MagickImageDecode(req)\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t\treturn\n\t}\n\tt.Logf(\"resp row: %d, colunms: %v, magick: %v\", resp.GetRows(), resp.GetColumns(), resp.GetMagick())\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/gocv_wrap.cxx",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (https://www.swig.org).\n * Version 4.1.1\n *\n * Do not make changes to this file unless you know what you are doing - modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n// source: gocv.swigcxx\n\n\nextern\n#ifdef __cplusplus\n  \"C\"\n#endif\n  void cgo_panic__gocv_ba346308b44e7b91(const char*);\nstatic void _swig_gopanic(const char *p) {\n  cgo_panic__gocv_ba346308b44e7b91(p);\n}\n\n\n\n#define SWIG_VERSION 0x040101\n#define SWIGGO\n#define SWIGMODULE gocv\n#define SWIG_DIRECTORS\n/* -----------------------------------------------------------------------------\n *  This section contains generic SWIG labels for method/variable\n *  declarations/attributes, and other compiler dependent labels.\n * ----------------------------------------------------------------------------- */\n\n/* template workaround for compilers that cannot correctly implement the C++ standard */\n#ifndef SWIGTEMPLATEDISAMBIGUATOR\n# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)\n#  define SWIGTEMPLATEDISAMBIGUATOR template\n# elif defined(__HP_aCC)\n/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */\n/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */\n#  define SWIGTEMPLATEDISAMBIGUATOR template\n# else\n#  define SWIGTEMPLATEDISAMBIGUATOR\n# endif\n#endif\n\n/* inline attribute */\n#ifndef SWIGINLINE\n# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))\n#   define SWIGINLINE inline\n# else\n#   define SWIGINLINE\n# endif\n#endif\n\n/* attribute recognised by some compilers to avoid 'unused' warnings */\n#ifndef SWIGUNUSED\n# if defined(__GNUC__)\n#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))\n#     define SWIGUNUSED __attribute__ ((__unused__))\n#   else\n#     define SWIGUNUSED\n#   endif\n# elif defined(__ICC)\n#   define SWIGUNUSED __attribute__ ((__unused__))\n# else\n#   define SWIGUNUSED\n# endif\n#endif\n\n#ifndef SWIG_MSC_UNSUPPRESS_4505\n# if defined(_MSC_VER)\n#   pragma warning(disable : 4505) /* unreferenced local function has been removed */\n# endif\n#endif\n\n#ifndef SWIGUNUSEDPARM\n# ifdef __cplusplus\n#   define SWIGUNUSEDPARM(p)\n# else\n#   define SWIGUNUSEDPARM(p) p SWIGUNUSED\n# endif\n#endif\n\n/* internal SWIG method */\n#ifndef SWIGINTERN\n# define SWIGINTERN static SWIGUNUSED\n#endif\n\n/* internal inline SWIG method */\n#ifndef SWIGINTERNINLINE\n# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE\n#endif\n\n/* exporting methods */\n#if defined(__GNUC__)\n#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)\n#    ifndef GCC_HASCLASSVISIBILITY\n#      define GCC_HASCLASSVISIBILITY\n#    endif\n#  endif\n#endif\n\n#ifndef SWIGEXPORT\n# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n#   if defined(STATIC_LINKED)\n#     define SWIGEXPORT\n#   else\n#     define SWIGEXPORT __declspec(dllexport)\n#   endif\n# else\n#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)\n#     define SWIGEXPORT __attribute__ ((visibility(\"default\")))\n#   else\n#     define SWIGEXPORT\n#   endif\n# endif\n#endif\n\n/* calling conventions for Windows */\n#ifndef SWIGSTDCALL\n# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n#   define SWIGSTDCALL __stdcall\n# else\n#   define SWIGSTDCALL\n# endif\n#endif\n\n/* Deal with Microsoft's attempt at deprecating C standard runtime functions */\n#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)\n# define _CRT_SECURE_NO_DEPRECATE\n#endif\n\n/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */\n#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)\n# define _SCL_SECURE_NO_DEPRECATE\n#endif\n\n/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */\n#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)\n# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0\n#endif\n\n/* Intel's compiler complains if a variable which was never initialised is\n * cast to void, which is a common idiom which we use to indicate that we\n * are aware a variable isn't used.  So we just silence that warning.\n * See: https://github.com/swig/swig/issues/192 for more discussion.\n */\n#ifdef __INTEL_COMPILER\n# pragma warning disable 592\n#endif\n\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n\n\n\ntypedef long long intgo;\ntypedef unsigned long long uintgo;\n\n\n# if !defined(__clang__) && (defined(__i386__) || defined(__x86_64__))\n#   define SWIGSTRUCTPACKED __attribute__((__packed__, __gcc_struct__))\n# else\n#   define SWIGSTRUCTPACKED __attribute__((__packed__))\n# endif\n\n\n\ntypedef struct { char *p; intgo n; } _gostring_;\ntypedef struct { void* array; intgo len; intgo cap; } _goslice_;\n\n\n\n#define SWIG_exception(code, msg) _swig_gopanic(msg)\n\n\nstatic _gostring_ Swig_AllocateString(const char *p, size_t l) {\n  _gostring_ ret;\n  ret.p = (char*)malloc(l);\n  memcpy(ret.p, p, l);\n  ret.n = l;\n  return ret;\n}\n\n/* -----------------------------------------------------------------------------\n * director_common.swg\n *\n * This file contains support for director classes which is common between\n * languages.\n * ----------------------------------------------------------------------------- */\n\n/*\n  Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the\n  'Swig' namespace. This could be useful for multi-modules projects.\n*/\n#ifdef SWIG_DIRECTOR_STATIC\n/* Force anonymous (static) namespace */\n#define Swig\n#endif\n/* -----------------------------------------------------------------------------\n * director.swg\n *\n * This file contains support for director classes so that Go proxy\n * methods can be called from C++.\n * ----------------------------------------------------------------------------- */\n\n#include <exception>\n#include <map>\n\nnamespace Swig {\n\n  class DirectorException : public std::exception {\n  };\n}\n\n/* Handle memory management for directors.  */\n\nnamespace {\n  struct GCItem {\n    virtual ~GCItem() {}\n  };\n\n  struct GCItem_var {\n    GCItem_var(GCItem *item = 0) : _item(item) {\n    }\n\n    GCItem_var& operator=(GCItem *item) {\n      GCItem *tmp = _item;\n      _item = item;\n      delete tmp;\n      return *this;\n    }\n\n    ~GCItem_var() {\n      delete _item;\n    }\n\n    GCItem* operator->() {\n      return _item;\n    }\n\n    private:\n      GCItem *_item;\n  };\n\n  template <typename Type>\n  struct GCItem_T : GCItem {\n    GCItem_T(Type *ptr) : _ptr(ptr) {\n    }\n\n    virtual ~GCItem_T() {\n      delete _ptr;\n    }\n\n  private:\n    Type *_ptr;\n  };\n}\n\nclass Swig_memory {\npublic:\n  template <typename Type>\n  void swig_acquire_pointer(Type* vptr) {\n    if (vptr) {\n      swig_owner[vptr] = new GCItem_T<Type>(vptr);\n    }\n  }\nprivate:\n  typedef std::map<void *, GCItem_var> swig_ownership_map;\n  swig_ownership_map swig_owner;\n};\n\ntemplate <typename Type>\nstatic void swig_acquire_pointer(Swig_memory** pmem, Type* ptr) {\n  if (!pmem) {\n    *pmem = new Swig_memory;\n  }\n  (*pmem)->swig_acquire_pointer(ptr);\n}\n\n#ifdef __cplusplus\n#include <utility>\n/* SwigValueWrapper is described in swig.swg */\ntemplate<typename T> class SwigValueWrapper {\n  struct SwigSmartPointer {\n    T *ptr;\n    SwigSmartPointer(T *p) : ptr(p) { }\n    ~SwigSmartPointer() { delete ptr; }\n    SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }\n    void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; }\n  } pointer;\n  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);\n  SwigValueWrapper(const SwigValueWrapper<T>& rhs);\npublic:\n  SwigValueWrapper() : pointer(0) { }\n  SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; }\n#if __cplusplus >=201103L\n  SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; }\n  operator T&&() const { return std::move(*pointer.ptr); }\n#else\n  operator T&() const { return *pointer.ptr; }\n#endif\n  T *operator&() const { return pointer.ptr; }\n  static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); }\n};\n\n/*\n * SwigValueInit() is a generic initialisation solution as the following approach:\n * \n *       T c_result = T();\n * \n * doesn't compile for all types for example:\n * \n *       unsigned int c_result = unsigned int();\n */\ntemplate <typename T> T SwigValueInit() {\n  return T();\n}\n\n#if __cplusplus >=201103L\n# define SWIG_STD_MOVE(OBJ) std::move(OBJ)\n#else\n# define SWIG_STD_MOVE(OBJ) OBJ\n#endif\n\n#endif\n\n\nstatic void Swig_free(void* p) {\n  free(p);\n}\n\nstatic void* Swig_malloc(int c) {\n  return malloc(c);\n}\n\n\n#include <typeinfo>\n#include <stdexcept>\n\n\n#include <map>\n#include <algorithm>\n#include <stdexcept>\n\n\n#include <string>\n\n\n#include <vector>\n#include <stdexcept>\n\n\n#include \"gocv.h\"\n\n\n\n\n\n// C++ director class methods.\n#include \"gocv_wrap.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid _wrap_Swig_free_gocv_ba346308b44e7b91(void *_swig_go_0) {\n  void *arg1 = (void *) 0 ;\n  \n  arg1 = *(void **)&_swig_go_0; \n  \n  Swig_free(arg1);\n  \n}\n\n\nvoid *_wrap_Swig_malloc_gocv_ba346308b44e7b91(intgo _swig_go_0) {\n  int arg1 ;\n  void *result = 0 ;\n  void *_swig_go_result;\n  \n  arg1 = (int)_swig_go_0; \n  \n  result = (void *)Swig_malloc(arg1);\n  *(void **)&_swig_go_result = (void *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_MagickInitializeMagickRequest_path_set_gocv_ba346308b44e7b91(gocv::MagickInitializeMagickRequest *_swig_go_0, _gostring_ _swig_go_1) {\n  gocv::MagickInitializeMagickRequest *arg1 = (gocv::MagickInitializeMagickRequest *) 0 ;\n  std::string *arg2 = 0 ;\n  \n  arg1 = *(gocv::MagickInitializeMagickRequest **)&_swig_go_0; \n  \n  std::string arg2_str(_swig_go_1.p, _swig_go_1.n);\n  arg2 = &arg2_str;\n  \n  \n  if (arg1) (arg1)->path = *arg2;\n  \n}\n\n\n_gostring_ _wrap_MagickInitializeMagickRequest_path_get_gocv_ba346308b44e7b91(gocv::MagickInitializeMagickRequest *_swig_go_0) {\n  gocv::MagickInitializeMagickRequest *arg1 = (gocv::MagickInitializeMagickRequest *) 0 ;\n  std::string *result = 0 ;\n  _gostring_ _swig_go_result;\n  \n  arg1 = *(gocv::MagickInitializeMagickRequest **)&_swig_go_0; \n  \n  result = (std::string *) & ((arg1)->path);\n  _swig_go_result = Swig_AllocateString((*result).data(), (*result).length()); \n  return _swig_go_result;\n}\n\n\ngocv::MagickInitializeMagickRequest *_wrap_new_MagickInitializeMagickRequest_gocv_ba346308b44e7b91() {\n  gocv::MagickInitializeMagickRequest *result = 0 ;\n  gocv::MagickInitializeMagickRequest *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (gocv::MagickInitializeMagickRequest *)new gocv::MagickInitializeMagickRequest();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(gocv::MagickInitializeMagickRequest **)&_swig_go_result = (gocv::MagickInitializeMagickRequest *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_MagickInitializeMagickRequest_gocv_ba346308b44e7b91(gocv::MagickInitializeMagickRequest *_swig_go_0) {\n  gocv::MagickInitializeMagickRequest *arg1 = (gocv::MagickInitializeMagickRequest *) 0 ;\n  \n  arg1 = *(gocv::MagickInitializeMagickRequest **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\ngocv::MagickInitializeMagickResponse *_wrap_new_MagickInitializeMagickResponse_gocv_ba346308b44e7b91() {\n  gocv::MagickInitializeMagickResponse *result = 0 ;\n  gocv::MagickInitializeMagickResponse *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (gocv::MagickInitializeMagickResponse *)new gocv::MagickInitializeMagickResponse();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(gocv::MagickInitializeMagickResponse **)&_swig_go_result = (gocv::MagickInitializeMagickResponse *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_MagickInitializeMagickResponse_gocv_ba346308b44e7b91(gocv::MagickInitializeMagickResponse *_swig_go_0) {\n  gocv::MagickInitializeMagickResponse *arg1 = (gocv::MagickInitializeMagickResponse *) 0 ;\n  \n  arg1 = *(gocv::MagickInitializeMagickResponse **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\nvoid _wrap_MagickImageDecodeRequest_image_set_gocv_ba346308b44e7b91(gocv::MagickImageDecodeRequest *_swig_go_0, _gostring_ _swig_go_1) {\n  gocv::MagickImageDecodeRequest *arg1 = (gocv::MagickImageDecodeRequest *) 0 ;\n  std::string *arg2 = 0 ;\n  \n  arg1 = *(gocv::MagickImageDecodeRequest **)&_swig_go_0; \n  \n  std::string arg2_str(_swig_go_1.p, _swig_go_1.n);\n  arg2 = &arg2_str;\n  \n  \n  if (arg1) (arg1)->image = *arg2;\n  \n}\n\n\n_gostring_ _wrap_MagickImageDecodeRequest_image_get_gocv_ba346308b44e7b91(gocv::MagickImageDecodeRequest *_swig_go_0) {\n  gocv::MagickImageDecodeRequest *arg1 = (gocv::MagickImageDecodeRequest *) 0 ;\n  std::string *result = 0 ;\n  _gostring_ _swig_go_result;\n  \n  arg1 = *(gocv::MagickImageDecodeRequest **)&_swig_go_0; \n  \n  result = (std::string *) & ((arg1)->image);\n  _swig_go_result = Swig_AllocateString((*result).data(), (*result).length()); \n  return _swig_go_result;\n}\n\n\nvoid _wrap_MagickImageDecodeRequest_target_color_space_set_gocv_ba346308b44e7b91(gocv::MagickImageDecodeRequest *_swig_go_0, _gostring_ _swig_go_1) {\n  gocv::MagickImageDecodeRequest *arg1 = (gocv::MagickImageDecodeRequest *) 0 ;\n  std::string *arg2 = 0 ;\n  \n  arg1 = *(gocv::MagickImageDecodeRequest **)&_swig_go_0; \n  \n  std::string arg2_str(_swig_go_1.p, _swig_go_1.n);\n  arg2 = &arg2_str;\n  \n  \n  if (arg1) (arg1)->target_color_space = *arg2;\n  \n}\n\n\n_gostring_ _wrap_MagickImageDecodeRequest_target_color_space_get_gocv_ba346308b44e7b91(gocv::MagickImageDecodeRequest *_swig_go_0) {\n  gocv::MagickImageDecodeRequest *arg1 = (gocv::MagickImageDecodeRequest *) 0 ;\n  std::string *result = 0 ;\n  _gostring_ _swig_go_result;\n  \n  arg1 = *(gocv::MagickImageDecodeRequest **)&_swig_go_0; \n  \n  result = (std::string *) & ((arg1)->target_color_space);\n  _swig_go_result = Swig_AllocateString((*result).data(), (*result).length()); \n  return _swig_go_result;\n}\n\n\ngocv::MagickImageDecodeRequest *_wrap_new_MagickImageDecodeRequest_gocv_ba346308b44e7b91() {\n  gocv::MagickImageDecodeRequest *result = 0 ;\n  gocv::MagickImageDecodeRequest *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (gocv::MagickImageDecodeRequest *)new gocv::MagickImageDecodeRequest();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(gocv::MagickImageDecodeRequest **)&_swig_go_result = (gocv::MagickImageDecodeRequest *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_MagickImageDecodeRequest_gocv_ba346308b44e7b91(gocv::MagickImageDecodeRequest *_swig_go_0) {\n  gocv::MagickImageDecodeRequest *arg1 = (gocv::MagickImageDecodeRequest *) 0 ;\n  \n  arg1 = *(gocv::MagickImageDecodeRequest **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\nintgo _wrap_UndefinedOrientation_gocv_ba346308b44e7b91() {\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::UndefinedOrientation;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_TopLeftOrientation_gocv_ba346308b44e7b91() {\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::TopLeftOrientation;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_TopRightOrientation_gocv_ba346308b44e7b91() {\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::TopRightOrientation;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_BottomRightOrientation_gocv_ba346308b44e7b91() {\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::BottomRightOrientation;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_BottomLeftOrientation_gocv_ba346308b44e7b91() {\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::BottomLeftOrientation;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_LeftTopOrientation_gocv_ba346308b44e7b91() {\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::LeftTopOrientation;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_RightTopOrientation_gocv_ba346308b44e7b91() {\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::RightTopOrientation;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_RightBottomOrientation_gocv_ba346308b44e7b91() {\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::RightBottomOrientation;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_LeftBottomOrientation_gocv_ba346308b44e7b91() {\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::LeftBottomOrientation;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_UndefinedColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::UndefinedColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_RGBColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::RGBColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_GRAYColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::GRAYColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_TransparentColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::TransparentColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_OHTAColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::OHTAColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_XYZColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::XYZColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_YCCColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::YCCColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_YIQColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::YIQColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_YPbPrColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::YPbPrColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_YUVColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::YUVColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_CMYKColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::CMYKColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_sRGBColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::sRGBColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_HSLColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::HSLColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_HWBColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::HWBColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_LABColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::LABColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_CineonLogRGBColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::CineonLogRGBColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_Rec601LumaColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::Rec601LumaColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_Rec601YCbCrColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::Rec601YCbCrColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_Rec709LumaColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::Rec709LumaColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nintgo _wrap_Rec709YCbCrColorspace_gocv_ba346308b44e7b91() {\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  \n  {\n    try {\n      result = gocv::Rec709YCbCrColorspace;\n      ;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_MagickImageDecodeResponse_mat_set_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0, cv::Mat *_swig_go_1) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  cv::Mat arg2 ;\n  cv::Mat *argp2 ;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  \n  argp2 = (cv::Mat *)_swig_go_1;\n  if (argp2 == NULL) {\n    _swig_gopanic(\"Attempt to dereference null cv::Mat\");\n  }\n  arg2 = (cv::Mat)*argp2;\n  \n  \n  if (arg1) (arg1)->mat = arg2;\n  \n}\n\n\ncv::Mat *_wrap_MagickImageDecodeResponse_mat_get_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  cv::Mat result;\n  cv::Mat *_swig_go_result;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  \n  result =  ((arg1)->mat);\n  *(cv::Mat **)&_swig_go_result = new cv::Mat(result); \n  return _swig_go_result;\n}\n\n\nvoid _wrap_MagickImageDecodeResponse_rows_set_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0, intgo _swig_go_1) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  int arg2 ;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  arg2 = (int)_swig_go_1; \n  \n  if (arg1) (arg1)->rows = arg2;\n  \n}\n\n\nintgo _wrap_MagickImageDecodeResponse_rows_get_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  int result;\n  intgo _swig_go_result;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  \n  result = (int) ((arg1)->rows);\n  _swig_go_result = result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_MagickImageDecodeResponse_columns_set_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0, intgo _swig_go_1) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  int arg2 ;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  arg2 = (int)_swig_go_1; \n  \n  if (arg1) (arg1)->columns = arg2;\n  \n}\n\n\nintgo _wrap_MagickImageDecodeResponse_columns_get_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  int result;\n  intgo _swig_go_result;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  \n  result = (int) ((arg1)->columns);\n  _swig_go_result = result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_MagickImageDecodeResponse_magick_set_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0, _gostring_ _swig_go_1) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  std::string *arg2 = 0 ;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  \n  std::string arg2_str(_swig_go_1.p, _swig_go_1.n);\n  arg2 = &arg2_str;\n  \n  \n  if (arg1) (arg1)->magick = *arg2;\n  \n}\n\n\n_gostring_ _wrap_MagickImageDecodeResponse_magick_get_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  std::string *result = 0 ;\n  _gostring_ _swig_go_result;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  \n  result = (std::string *) & ((arg1)->magick);\n  _swig_go_result = Swig_AllocateString((*result).data(), (*result).length()); \n  return _swig_go_result;\n}\n\n\nvoid _wrap_MagickImageDecodeResponse_orientation_type_set_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0, intgo _swig_go_1) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  gocv::OrientationType arg2 ;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  arg2 = (gocv::OrientationType)_swig_go_1; \n  \n  if (arg1) (arg1)->orientation_type = arg2;\n  \n}\n\n\nintgo _wrap_MagickImageDecodeResponse_orientation_type_get_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  gocv::OrientationType result;\n  intgo _swig_go_result;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  \n  result = (gocv::OrientationType) ((arg1)->orientation_type);\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_MagickImageDecodeResponse_colorspace_type_set_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0, intgo _swig_go_1) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  gocv::ColorspaceType arg2 ;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  arg2 = (gocv::ColorspaceType)_swig_go_1; \n  \n  if (arg1) (arg1)->colorspace_type = arg2;\n  \n}\n\n\nintgo _wrap_MagickImageDecodeResponse_colorspace_type_get_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  gocv::ColorspaceType result;\n  intgo _swig_go_result;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  \n  result = (gocv::ColorspaceType) ((arg1)->colorspace_type);\n  _swig_go_result = (intgo)result; \n  return _swig_go_result;\n}\n\n\ngocv::MagickImageDecodeResponse *_wrap_new_MagickImageDecodeResponse_gocv_ba346308b44e7b91() {\n  gocv::MagickImageDecodeResponse *result = 0 ;\n  gocv::MagickImageDecodeResponse *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (gocv::MagickImageDecodeResponse *)new gocv::MagickImageDecodeResponse();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(gocv::MagickImageDecodeResponse **)&_swig_go_result = (gocv::MagickImageDecodeResponse *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_MagickImageDecodeResponse_gocv_ba346308b44e7b91(gocv::MagickImageDecodeResponse *_swig_go_0) {\n  gocv::MagickImageDecodeResponse *arg1 = (gocv::MagickImageDecodeResponse *) 0 ;\n  \n  arg1 = *(gocv::MagickImageDecodeResponse **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\ngocv::MagicImage *_wrap_new_Wrapped_MagicImage_gocv_ba346308b44e7b91() {\n  gocv::MagicImage *result = 0 ;\n  gocv::MagicImage *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (gocv::MagicImage *)new gocv::MagicImage();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(gocv::MagicImage **)&_swig_go_result = (gocv::MagicImage *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_Wrapped_MagicImage_gocv_ba346308b44e7b91(gocv::MagicImage *_swig_go_0) {\n  gocv::MagicImage *arg1 = (gocv::MagicImage *) 0 ;\n  \n  arg1 = *(gocv::MagicImage **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\nvoid _wrap_Wrapped_MagicImage_MagickInitializeMagick_gocv_ba346308b44e7b91(gocv::MagickInitializeMagickRequest *_swig_go_0, gocv::MagickInitializeMagickResponse *_swig_go_1) {\n  gocv::MagickInitializeMagickRequest *arg1 = 0 ;\n  gocv::MagickInitializeMagickResponse *arg2 = 0 ;\n  \n  arg1 = *(gocv::MagickInitializeMagickRequest **)&_swig_go_0; \n  arg2 = *(gocv::MagickInitializeMagickResponse **)&_swig_go_1; \n  \n  {\n    try {\n      gocv::MagicImage::MagickInitializeMagick((gocv::MagickInitializeMagickRequest const &)*arg1,*arg2);;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\nvoid _wrap_Wrapped_MagicImage_Wrapped_MagickImageDecode_gocv_ba346308b44e7b91(gocv::MagicImage *_swig_go_0, gocv::MagickImageDecodeRequest *_swig_go_1, gocv::MagickImageDecodeResponse *_swig_go_2) {\n  gocv::MagicImage *arg1 = (gocv::MagicImage *) 0 ;\n  gocv::MagickImageDecodeRequest *arg2 = 0 ;\n  gocv::MagickImageDecodeResponse *arg3 = 0 ;\n  \n  arg1 = *(gocv::MagicImage **)&_swig_go_0; \n  arg2 = *(gocv::MagickImageDecodeRequest **)&_swig_go_1; \n  arg3 = *(gocv::MagickImageDecodeResponse **)&_swig_go_2; \n  \n  {\n    try {\n      (arg1)->MagickImageDecode((gocv::MagickImageDecodeRequest const &)*arg2,*arg3);;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\n#ifdef __cplusplus\n}\n#endif\n\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/gocv/gocv_wrap.h",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (https://www.swig.org).\n * Version 4.1.1\n *\n * Do not make changes to this file unless you know what you are doing - modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n// source: gocv.swigcxx\n\n#ifndef SWIG_gocv_WRAP_H_\n#define SWIG_gocv_WRAP_H_\n\nclass Swig_memory;\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/Makefile",
    "content": "MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))\nPROJECT_ROOT_DIR := $(realpath ${MAKEFILE_DIR}/../..)\nPKG_CONFIG_PATH := ${PROJECT_ROOT_DIR}/pkgconfig\nSCRIPT_PATH := ${MAKEFILE_DIR}/../../script\nTARGET := $(shell basename ${MAKEFILE_DIR})\n\n# https://web.mit.edu/gnu/doc/html/make_8.html\n_empty:=\n# define space with $(_empty)\n_space:= $(_empty) $(_empty)\ndefine joinwith\n  $(subst $(_space),$1,$(strip $2))\nendef\n\n.PHONY: all\nall: deps generate test\n\t@echo \"${MAKEFILE_DIR}\"\n\t@echo \"${PROJECT_ROOT_DIR}\"\n\t@echo \"${TARGET}\"\n\n.PHONY: deps\ndeps:\n\t@echo \"  >  downloading deps library\"\n\n.PHONY: version\nversion:\n\t@bash -c \"bash ${SCRIPT_PATH}/version.sh gitinfos\"\n\n.PHONY: test\ntest: version\n\t@$(eval THIRD_LIB_PATHS := $(shell find -L ${PROJECT_ROOT_DIR}/third_path/ -type d -iname \"lib*\" -print0 |xargs -0 -I {} bash -c 'echo {}'|grep -v \"stubs\"))\n\t@echo ${THIRD_LIB_PATHS}\n\t@$(eval JOINED_THIRD_LIB_PATHS := $(call joinwith,:,$(THIRD_LIB_PATHS)))\n\t PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}\" LD_LIBRARY_PATH=\"$(JOINED_THIRD_LIB_PATHS):${LD_LIBRARY_PATH}\" LIBRARY_PATH=\"$(JOINED_THIRD_LIB_PATHS):${LIBRARY_PATH}\" go test -a -v .\n\n.PHONY: generate \ngenerate:\n\t\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/__init__.py",
    "content": ""
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/cgo.go",
    "content": "package pycv\n\n/*\n#cgo linux,amd64 pkg-config: pybind11\n#cgo !linux !amd64 CXXFLAGS: -D__CGO_UNKNOWN_PLATFORM__\n#cgo CXXFLAGS: -std=c++11\n#include <stdlib.h>\n*/\nimport \"C\"\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/pycv.go",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (https://www.swig.org).\n * Version 4.1.1\n *\n * Do not make changes to this file unless you know what you are doing - modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n// source: pycv.swigcxx\n\npackage pycv\n\n/*\n#define intgo swig_intgo\ntypedef void *swig_voidp;\n\n#include <stddef.h>\n#include <stdint.h>\n\n\ntypedef long long intgo;\ntypedef unsigned long long uintgo;\n\n\n\ntypedef struct { char *p; intgo n; } _gostring_;\ntypedef struct { void* array; intgo len; intgo cap; } _goslice_;\n\n\ntypedef _gostring_ swig_type_1;\ntypedef _gostring_ swig_type_2;\ntypedef _gostring_ swig_type_3;\ntypedef _gostring_ swig_type_4;\ntypedef _gostring_ swig_type_5;\ntypedef _gostring_ swig_type_6;\ntypedef _gostring_ swig_type_7;\ntypedef _gostring_ swig_type_8;\ntypedef _gostring_ swig_type_9;\nextern void _wrap_Swig_free_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern uintptr_t _wrap_Swig_malloc_pycv_ffa8ea6aa3be9035(swig_intgo arg1);\nextern void _wrap_LocalInitRequest_gpu_id_set_pycv_ffa8ea6aa3be9035(uintptr_t arg1, swig_intgo arg2);\nextern swig_intgo _wrap_LocalInitRequest_gpu_id_get_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern void _wrap_LocalInitRequest_sdk_dir_set_pycv_ffa8ea6aa3be9035(uintptr_t arg1, swig_type_1 arg2);\nextern swig_type_2 _wrap_LocalInitRequest_sdk_dir_get_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern void _wrap_LocalInitRequest_model_dir_set_pycv_ffa8ea6aa3be9035(uintptr_t arg1, swig_type_3 arg2);\nextern swig_type_4 _wrap_LocalInitRequest_model_dir_get_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern uintptr_t _wrap_new_LocalInitRequest_pycv_ffa8ea6aa3be9035(void);\nextern void _wrap_delete_LocalInitRequest_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern uintptr_t _wrap_new_LocalInitResponse_pycv_ffa8ea6aa3be9035(void);\nextern void _wrap_delete_LocalInitResponse_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern void _wrap_DoRequest_arg1_set_pycv_ffa8ea6aa3be9035(uintptr_t arg1, swig_type_5 arg2);\nextern swig_type_6 _wrap_DoRequest_arg1_get_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern void _wrap_DoRequest_arg2_set_pycv_ffa8ea6aa3be9035(uintptr_t arg1, swig_type_7 arg2);\nextern swig_type_8 _wrap_DoRequest_arg2_get_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern uintptr_t _wrap_new_DoRequest_pycv_ffa8ea6aa3be9035(void);\nextern void _wrap_delete_DoRequest_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern uintptr_t _wrap_new_DoResponse_pycv_ffa8ea6aa3be9035(void);\nextern void _wrap_delete_DoResponse_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern uintptr_t _wrap_new_Wrapped_PyImage_pycv_ffa8ea6aa3be9035(void);\nextern void _wrap_delete_Wrapped_PyImage_pycv_ffa8ea6aa3be9035(uintptr_t arg1);\nextern void _wrap_Wrapped_PyImage_GlobalInit_pycv_ffa8ea6aa3be9035(swig_type_9 arg1, swig_intgo arg2);\nextern void _wrap_Wrapped_PyImage_GlobalRelease_pycv_ffa8ea6aa3be9035(void);\nextern void _wrap_Wrapped_PyImage_Wrapped_PyImage_LocalInit_pycv_ffa8ea6aa3be9035(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3);\nextern void _wrap_Wrapped_PyImage_Wrapped_PyImage_Do_pycv_ffa8ea6aa3be9035(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3);\n#undef intgo\n*/\nimport \"C\"\n\nimport \"unsafe\"\nimport _ \"runtime/cgo\"\nimport \"sync\"\nimport \"fmt\"\n\n\ntype _ unsafe.Pointer\n\n\n\nvar Swig_escape_always_false bool\nvar Swig_escape_val interface{}\n\n\ntype _swig_fnptr *byte\ntype _swig_memberptr *byte\n\n\nfunc getSwigcptr(v interface { Swigcptr() uintptr }) uintptr {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn v.Swigcptr()\n}\n\n\ntype _ sync.Mutex\n\n//export cgo_panic__pycv_ffa8ea6aa3be9035\nfunc cgo_panic__pycv_ffa8ea6aa3be9035(p *byte) {\n\ts := (*[1024]byte)(unsafe.Pointer(p))[:]\n\tfor i, b := range s {\n\t\tif b == 0 {\n\t\t\tpanic(string(s[:i]))\n\t\t}\n\t}\n\tpanic(string(s))\n}\n\n\ntype swig_gostring struct { p uintptr; n int }\nfunc swigCopyString(s string) string {\n  p := *(*swig_gostring)(unsafe.Pointer(&s))\n  r := string((*[0x7fffffff]byte)(unsafe.Pointer(p.p))[:p.n])\n  Swig_free(p.p)\n  return r\n}\n\nfunc Swig_free(arg1 uintptr) {\n\t_swig_i_0 := arg1\n\tC._wrap_Swig_free_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n}\n\nfunc Swig_malloc(arg1 int) (_swig_ret uintptr) {\n\tvar swig_r uintptr\n\t_swig_i_0 := arg1\n\tswig_r = (uintptr)(C._wrap_Swig_malloc_pycv_ffa8ea6aa3be9035(C.swig_intgo(_swig_i_0)))\n\treturn swig_r\n}\n\ntype SwigcptrLocalInitRequest uintptr\n\nfunc (p SwigcptrLocalInitRequest) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrLocalInitRequest) SwigIsLocalInitRequest() {\n}\n\nfunc (arg1 SwigcptrLocalInitRequest) SetGpu_id(arg2 int) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_LocalInitRequest_gpu_id_set_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1))\n}\n\nfunc (arg1 SwigcptrLocalInitRequest) GetGpu_id() (_swig_ret int) {\n\tvar swig_r int\n\t_swig_i_0 := arg1\n\tswig_r = (int)(C._wrap_LocalInitRequest_gpu_id_get_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0)))\n\treturn swig_r\n}\n\nfunc (arg1 SwigcptrLocalInitRequest) SetSdk_dir(arg2 string) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_LocalInitRequest_sdk_dir_set_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0), *(*C.swig_type_1)(unsafe.Pointer(&_swig_i_1)))\n\tif Swig_escape_always_false {\n\t\tSwig_escape_val = arg2\n\t}\n}\n\nfunc (arg1 SwigcptrLocalInitRequest) GetSdk_dir() (_swig_ret string) {\n\tvar swig_r string\n\t_swig_i_0 := arg1\n\tswig_r_p := C._wrap_LocalInitRequest_sdk_dir_get_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n\tswig_r = *(*string)(unsafe.Pointer(&swig_r_p))\n\tvar swig_r_1 string\n swig_r_1 = swigCopyString(swig_r) \n\treturn swig_r_1\n}\n\nfunc (arg1 SwigcptrLocalInitRequest) SetModel_dir(arg2 string) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_LocalInitRequest_model_dir_set_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0), *(*C.swig_type_3)(unsafe.Pointer(&_swig_i_1)))\n\tif Swig_escape_always_false {\n\t\tSwig_escape_val = arg2\n\t}\n}\n\nfunc (arg1 SwigcptrLocalInitRequest) GetModel_dir() (_swig_ret string) {\n\tvar swig_r string\n\t_swig_i_0 := arg1\n\tswig_r_p := C._wrap_LocalInitRequest_model_dir_get_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n\tswig_r = *(*string)(unsafe.Pointer(&swig_r_p))\n\tvar swig_r_1 string\n swig_r_1 = swigCopyString(swig_r) \n\treturn swig_r_1\n}\n\nfunc NewLocalInitRequest() (_swig_ret LocalInitRequest) {\n\tvar swig_r LocalInitRequest\n\tswig_r = (LocalInitRequest)(SwigcptrLocalInitRequest(C._wrap_new_LocalInitRequest_pycv_ffa8ea6aa3be9035()))\n\treturn swig_r\n}\n\nfunc DeleteLocalInitRequest(arg1 LocalInitRequest) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_LocalInitRequest_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n}\n\ntype LocalInitRequest interface {\n\tSwigcptr() uintptr\n\tSwigIsLocalInitRequest()\n\tSetGpu_id(arg2 int)\n\tGetGpu_id() (_swig_ret int)\n\tSetSdk_dir(arg2 string)\n\tGetSdk_dir() (_swig_ret string)\n\tSetModel_dir(arg2 string)\n\tGetModel_dir() (_swig_ret string)\n}\n\ntype SwigcptrLocalInitResponse uintptr\n\nfunc (p SwigcptrLocalInitResponse) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrLocalInitResponse) SwigIsLocalInitResponse() {\n}\n\nfunc NewLocalInitResponse() (_swig_ret LocalInitResponse) {\n\tvar swig_r LocalInitResponse\n\tswig_r = (LocalInitResponse)(SwigcptrLocalInitResponse(C._wrap_new_LocalInitResponse_pycv_ffa8ea6aa3be9035()))\n\treturn swig_r\n}\n\nfunc DeleteLocalInitResponse(arg1 LocalInitResponse) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_LocalInitResponse_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n}\n\ntype LocalInitResponse interface {\n\tSwigcptr() uintptr\n\tSwigIsLocalInitResponse()\n}\n\ntype SwigcptrDoRequest uintptr\n\nfunc (p SwigcptrDoRequest) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrDoRequest) SwigIsDoRequest() {\n}\n\nfunc (arg1 SwigcptrDoRequest) SetArg1(arg2 string) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_DoRequest_arg1_set_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0), *(*C.swig_type_5)(unsafe.Pointer(&_swig_i_1)))\n\tif Swig_escape_always_false {\n\t\tSwig_escape_val = arg2\n\t}\n}\n\nfunc (arg1 SwigcptrDoRequest) GetArg1() (_swig_ret string) {\n\tvar swig_r string\n\t_swig_i_0 := arg1\n\tswig_r_p := C._wrap_DoRequest_arg1_get_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n\tswig_r = *(*string)(unsafe.Pointer(&swig_r_p))\n\tvar swig_r_1 string\n swig_r_1 = swigCopyString(swig_r) \n\treturn swig_r_1\n}\n\nfunc (arg1 SwigcptrDoRequest) SetArg2(arg2 string) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_DoRequest_arg2_set_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0), *(*C.swig_type_7)(unsafe.Pointer(&_swig_i_1)))\n\tif Swig_escape_always_false {\n\t\tSwig_escape_val = arg2\n\t}\n}\n\nfunc (arg1 SwigcptrDoRequest) GetArg2() (_swig_ret string) {\n\tvar swig_r string\n\t_swig_i_0 := arg1\n\tswig_r_p := C._wrap_DoRequest_arg2_get_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n\tswig_r = *(*string)(unsafe.Pointer(&swig_r_p))\n\tvar swig_r_1 string\n swig_r_1 = swigCopyString(swig_r) \n\treturn swig_r_1\n}\n\nfunc NewDoRequest() (_swig_ret DoRequest) {\n\tvar swig_r DoRequest\n\tswig_r = (DoRequest)(SwigcptrDoRequest(C._wrap_new_DoRequest_pycv_ffa8ea6aa3be9035()))\n\treturn swig_r\n}\n\nfunc DeleteDoRequest(arg1 DoRequest) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_DoRequest_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n}\n\ntype DoRequest interface {\n\tSwigcptr() uintptr\n\tSwigIsDoRequest()\n\tSetArg1(arg2 string)\n\tGetArg1() (_swig_ret string)\n\tSetArg2(arg2 string)\n\tGetArg2() (_swig_ret string)\n}\n\ntype SwigcptrDoResponse uintptr\n\nfunc (p SwigcptrDoResponse) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrDoResponse) SwigIsDoResponse() {\n}\n\nfunc NewDoResponse() (_swig_ret DoResponse) {\n\tvar swig_r DoResponse\n\tswig_r = (DoResponse)(SwigcptrDoResponse(C._wrap_new_DoResponse_pycv_ffa8ea6aa3be9035()))\n\treturn swig_r\n}\n\nfunc DeleteDoResponse(arg1 DoResponse) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_DoResponse_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n}\n\ntype DoResponse interface {\n\tSwigcptr() uintptr\n\tSwigIsDoResponse()\n}\n\ntype SwigcptrWrapped_PyImage uintptr\n\nfunc (p SwigcptrWrapped_PyImage) Swigcptr() uintptr {\n\treturn (uintptr)(p)\n}\n\nfunc (p SwigcptrWrapped_PyImage) SwigIsWrapped_PyImage() {\n}\n\nfunc NewWrapped_PyImage() (_swig_ret Wrapped_PyImage) {\n\tvar swig_r Wrapped_PyImage\n\tswig_r = (Wrapped_PyImage)(SwigcptrWrapped_PyImage(C._wrap_new_Wrapped_PyImage_pycv_ffa8ea6aa3be9035()))\n\treturn swig_r\n}\n\nfunc DeleteWrapped_PyImage(arg1 Wrapped_PyImage) {\n\t_swig_i_0 := getSwigcptr(arg1)\n\tC._wrap_delete_Wrapped_PyImage_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0))\n}\n\nfunc Wrapped_PyImageGlobalInit(arg1 string, arg2 int) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := arg2\n\tC._wrap_Wrapped_PyImage_GlobalInit_pycv_ffa8ea6aa3be9035(*(*C.swig_type_9)(unsafe.Pointer(&_swig_i_0)), C.swig_intgo(_swig_i_1))\n\tif Swig_escape_always_false {\n\t\tSwig_escape_val = arg1\n\t}\n}\n\nfunc Wrapped_PyImageGlobalRelease() {\n\tC._wrap_Wrapped_PyImage_GlobalRelease_pycv_ffa8ea6aa3be9035()\n}\n\nfunc (arg1 SwigcptrWrapped_PyImage) Wrapped_PyImage_LocalInit(arg2 LocalInitRequest, arg3 LocalInitResponse) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := getSwigcptr(arg2)\n\t_swig_i_2 := getSwigcptr(arg3)\n\tC._wrap_Wrapped_PyImage_Wrapped_PyImage_LocalInit_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1), C.uintptr_t(_swig_i_2))\n}\n\nfunc (arg1 SwigcptrWrapped_PyImage) Wrapped_PyImage_Do(arg2 DoRequest, arg3 DoResponse) {\n\t_swig_i_0 := arg1\n\t_swig_i_1 := getSwigcptr(arg2)\n\t_swig_i_2 := getSwigcptr(arg3)\n\tC._wrap_Wrapped_PyImage_Wrapped_PyImage_Do_pycv_ffa8ea6aa3be9035(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1), C.uintptr_t(_swig_i_2))\n}\n\ntype Wrapped_PyImage interface {\n\tSwigcptr() uintptr\n\tSwigIsWrapped_PyImage()\n\tWrapped_PyImage_LocalInit(arg2 LocalInitRequest, arg3 LocalInitResponse)\n\tWrapped_PyImage_Do(arg2 DoRequest, arg3 DoResponse)\n}\n\n\n\ntype PyImage interface {\n   Wrapped_PyImage  \n   LocalInit(LocalInitRequest) (LocalInitResponse, error);\n   Do(DoRequest) (DoResponse, error);\n}\n\nfunc NewPyImage() PyImage {\n     e := NewWrapped_PyImage()\n     return e.(PyImage)\n}\n\n// catch will recover from a panic and store the recover message to the error \n// parameter. The error must be passed by reference in order to be returned to the\n// calling function.\nfunc catch(err *error) {\n    if r := recover(); r != nil {\n        *err = fmt.Errorf(\"%v\", r)\n    }\n}\n\nfunc GlobalInit(model_dir string, gpu_id int) (err error) {\n   defer catch(&err)\n   Wrapped_PyImageGlobalInit(model_dir, gpu_id)\n   return\n}\n\nfunc GlobalRelease() (err error){\n   defer catch(&err)\n   Wrapped_PyImageGlobalRelease()\n   return\n}\n\nfunc (arg SwigcptrWrapped_PyImage) LocalInit(req LocalInitRequest) (resp LocalInitResponse, err error) {\n   defer catch(&err)\n   resp = NewLocalInitResponse()\n   arg.Wrapped_PyImage_LocalInit(req, resp)\n   return\n}\n\nfunc (arg SwigcptrWrapped_PyImage) Do(req DoRequest) (resp DoResponse, err error) {\n   defer catch(&err)\n   resp = NewDoResponse()\n   arg.Wrapped_PyImage_Do(req, resp)\n   return\n}\n\n\n\n\n\nvar swigDirectorTrack struct {\n\tsync.Mutex\n\tm map[int]interface{}\n\tc int\n}\n\nfunc swigDirectorAdd(v interface{}) int {\n\tswigDirectorTrack.Lock()\n\tdefer swigDirectorTrack.Unlock()\n\tif swigDirectorTrack.m == nil {\n\t\tswigDirectorTrack.m = make(map[int]interface{})\n\t}\n\tswigDirectorTrack.c++\n\tret := swigDirectorTrack.c\n\tswigDirectorTrack.m[ret] = v\n\treturn ret\n}\n\nfunc swigDirectorLookup(c int) interface{} {\n\tswigDirectorTrack.Lock()\n\tdefer swigDirectorTrack.Unlock()\n\tret := swigDirectorTrack.m[c]\n\tif ret == nil {\n\t\tpanic(\"C++ director pointer not found (possible\tuse-after-free)\")\n\t}\n\treturn ret\n}\n\nfunc swigDirectorDelete(c int) {\n\tswigDirectorTrack.Lock()\n\tdefer swigDirectorTrack.Unlock()\n\tif swigDirectorTrack.m[c] == nil {\n\t\tif c > swigDirectorTrack.c {\n\t\t\tpanic(\"C++ director pointer invalid (possible memory corruption\")\n\t\t} else {\n\t\t\tpanic(\"C++ director pointer not found (possible use-after-free)\")\n\t\t}\n\t}\n\tdelete(swigDirectorTrack.m, c)\n}\n\n\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/pycv.h",
    "content": "#ifndef GOCV_CGO_SWIG_PYCV_PYCV_H_\n#define GOCV_CGO_SWIG_PYCV_PYCV_H_\n\n#include <pybind11/embed.h>\n\n#include <stdexcept>\n#include <string>\n\nnamespace pybind11 {\nclass object;\n}\n\nnamespace pycv {\n\nstruct LocalInitRequest {\n    int gpu_id = -1;\n    std::string sdk_dir;\n\n    std::string model_dir;\n};\nstruct LocalInitResponse {};\n\nstruct DoRequest {\n    std::string arg1;\n    std::string arg2;\n};\n\nstruct DoResponse {};\n\n#ifdef SWIG\nclass PyImage {\n#else\nclass __attribute__((visibility(\"hidden\"))) PyImage {\n#endif\npybind11::object sdk_py;\n\npublic:\nPyImage() = default;\n~PyImage();\n\nstatic void GlobalInit(const std::string& model_dir, int gpu_id);\n\nstatic void GlobalRelease();\n\nvoid LocalInit(const LocalInitRequest& req, LocalInitResponse& resp);\n\nvoid Do(const DoRequest& req, DoResponse& resp);\n\n};\n\n}  // namespace pycv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/pycv.py",
    "content": "import base64 \nimport sys\nimport traceback\nimport copy\nfrom PIL import Image\n\ndef read_image(image_file_path, base64_format=True):\n    with open(image_file_path, \"rb\") as file:\n        data = file.read()\n        if not base64_format:\n            return data\n\n        base64_data = base64.b64encode(data)\n        return base64_data \n\ndef write_image(image_data, image_file_path, base64_format=True):\n    if base64_format:\n        data = base64.b64decode(image_data)\n    else:\n        data = image_data\n    f = io.BytesIO(data)\n    Image.open(f)\n    os.makedirs(os.path.dirname(image_file), exist_ok=True)\n    image.save(image_file_path)\n\n\nclass CVSDK:\n    def __init__(self, gpu_id: int = -1, **kwargs):\n        self.gpu_id = -1\n        self.init_kwargs = {}\n        self.sdk = None\n\n    def init(self, model_dir: str, gpu_id: int = -1, **kwargs):\n        try:\n            if not self.sdk:\n               del self.sdk\n            self.sdk = None\n            self.gpu_id = gpu_id\n            self.init_kwargs = copy.copy(kwargs)\n\n            if \"sdk_dir\" in kwargs:\n                sdk_dir = kwargs.get(\"sdk_dir\")\n                del kwargs[\"sdk_dir\"]\n                if sdk_dir not in sys.path:\n                    sys.path.append(sdk_dir)\n\n            # init sdk isinstance\n            # self.sdk = None\n\n        except ValueError as err:\n            return {\n                    \"err\" : f\"CVSDK::__init__: Unexpected ValueError {err=}, {type(err)=}, {traceback.format_exc()}\",\n                    }\n        except Exception as err:\n            return {\n                    \"err\" : f\"CVSDK::__init__: Unexpected Exception {err=}, {type(err)=}, {traceback.format_exc()}\",\n                    }\n        except:\n            err = sys.exc_info()[0]\n            return {\n                    \"err\" : f\"CVSDK::__init__: Unexpected Exception {err=}, {type(err)=}, {traceback.format_exc()}\",\n                    }\n        return {}\n\n    \n    def do(self, **kwargs):\n        try:\n            arg1 = kwargs.get(\"arg1\", \"\")\n            arg2 = kwargs.get(\"arg2\", \"\")\n            #todo sdk call\n            return {\n                    \"result\": \"ok\"\n                    }\n        except ValueError as err:\n            return {\n                    \"err\" : f\"CVSDK::Do: Unexpected ValueError {err=}, {type(err)=}, {traceback.format_exc()}\",\n                    }\n        except Exception as err:\n            return {\n                    \"err\" : f\"CVSDK::Do: Unexpected Exception {err=}, {type(err)=}, {traceback.format_exc()}\",\n                    }\n        except:\n            err = sys.exc_info()[0]\n            return {\n                    \"err\" : f\"CVSDK::Do: Unexpected Exception {err=}, {type(err)=}, {traceback.format_exc()}\",\n                    }\n\nif __name__ == \"__main__\":\n    print('sys.path %s' % sys.path)\n    sdk = CVSDK()\n    sdk.init(\"\")\n    resp = sdk.do()\n    if 'err' in resp:\n        err = resp['err']\n        print(f'do err: {err}')\n    print(f'{resp[\"result\"]}')\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/pycv.swigcxx",
    "content": "//go:build ignore\n/* swig -go -cgo -c++ -intgosize 64 pycv.swigcxx */\n\n%module(directors=\"1\") pycv\n%include <typemaps.i>\n%include <std_map.i>\n%include <std_string.i>\n%include <std_vector.i>\n%include <exception.i>\n%{\n#include \"pycv.h\"\n%}\n\n%exception {\n    try {\n        $action;\n    } catch (const std::exception& e) {\n        _swig_gopanic(e.what());\n    }\n}\n\n%rename(Wrapped_PyImage) PyImage;\n%rename(Wrapped_PyImage_LocalInit) LocalInit;\n%rename(Wrapped_PyImage_Do) Do;\n\n%header %{\n\n%}\n%include \"pycv.h\"\n\n%go_import(\"fmt\")\n%insert(go_wrapper) %{\n\ntype PyImage interface {\n   Wrapped_PyImage  \n   LocalInit(LocalInitRequest) (LocalInitResponse, error);\n   Do(DoRequest) (DoResponse, error);\n}\n\nfunc NewPyImage() PyImage {\n     e := NewWrapped_PyImage()\n     return e.(PyImage)\n}\n\n// catch will recover from a panic and store the recover message to the error \n// parameter. The error must be passed by reference in order to be returned to the\n// calling function.\nfunc catch(err *error) {\n    if r := recover(); r != nil {\n        *err = fmt.Errorf(\"%v\", r)\n    }\n}\n\nfunc GlobalInit(model_dir string, gpu_id int) (err error) {\n   defer catch(&err)\n   Wrapped_PyImageGlobalInit(model_dir, gpu_id)\n   return\n}\n\nfunc GlobalRelease() (err error){\n   defer catch(&err)\n   Wrapped_PyImageGlobalRelease()\n   return\n}\n\nfunc (arg SwigcptrWrapped_PyImage) LocalInit(req LocalInitRequest) (resp LocalInitResponse, err error) {\n   defer catch(&err)\n   resp = NewLocalInitResponse()\n   arg.Wrapped_PyImage_LocalInit(req, resp)\n   return\n}\n\nfunc (arg SwigcptrWrapped_PyImage) Do(req DoRequest) (resp DoResponse, err error) {\n   defer catch(&err)\n   resp = NewDoResponse()\n   arg.Wrapped_PyImage_Do(req, resp)\n   return\n}\n\n%}\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/pycv_linux_amd64.cpp",
    "content": "#include <pybind11/embed.h>\n\n#include <memory>\n#include <mutex>\n#include <sstream>\n#include <stdexcept>\n\n#include \"pycv.h\"\n\nnamespace py = pybind11;\nusing namespace pybind11::literals;  // to bring in the `_a` literal\n#ifdef __cplusplus\n#define UIKIT_EXTERN extern \"C\" __attribute__((visibility(\"default\")))\n#else\n#define UIKIT_EXTERN extern __attribute__((visibility(\"default\")))\n#endif\nstatic std::once_flag python_once;\nstatic std::unique_ptr<py::scoped_interpreter> python_interpreter_guard;\nstatic std::unique_ptr<py::gil_scoped_release>\n    python_interpreter_gil_scoped_release;\n\npycv::PyImage::~PyImage() {\n    py::gil_scoped_acquire acquire;\n    sdk_py.dec_ref();\n}\n\nvoid pycv::PyImage::GlobalInit(const std::string& model_dir, int gpu_id) {\n    std::call_once(python_once, [] {\n        python_interpreter_guard = std::unique_ptr<py::scoped_interpreter>(\n            new py::scoped_interpreter());\n        { pybind11::gil_scoped_acquire acquire; }\n        python_interpreter_gil_scoped_release =\n            std::unique_ptr<py::gil_scoped_release>(\n                new py::gil_scoped_release());\n    });\n}\n\nvoid pycv::PyImage::GlobalRelease() {}\n\nvoid pycv::PyImage::LocalInit(const LocalInitRequest& req,\n                              LocalInitResponse& resp) {\n    // acquiring GIL as toPyObject creates new py::object\n    // without grabbing the GIL.\n    py::gil_scoped_acquire acquire;\n\n    // https://pybind11.readthedocs.io/en/stable/advanced/pycpp/object.html#calling-python-methods\n    // https://github.com/pybind/pybind11/issues/1201\n    auto py_cv = py::module::import(\"pycv\");\n    if (py_cv.is_none()) {\n        throw std::runtime_error(\"module pycv not found\");\n    }\n\n    if (!py::hasattr(py_cv, \"CVSDK\")) {\n        throw std::runtime_error(\"python class pycv.CVSD not found\");\n    }\n\n    auto CVSDK = py_cv.attr(\"CVSDK\");\n    sdk_py = CVSDK();\n    if (!py::hasattr(sdk_py, \"init\")) {\n        throw std::runtime_error(\"python method py.CVSDK::init not found\");\n    }\n    if (!py::hasattr(sdk_py, \"do\")) {\n        throw std::runtime_error(\"python method py.CVSDK::do not found\");\n    }\n    {  // 模型初始化\n        py::dict dict(\"model_dir\"_a = req.model_dir, \"gpu_id\"_a = req.gpu_id);\n        dict[\"sdk_dir\"] = req.sdk_dir;\n        auto init_resp_py = sdk_py.attr(\"init\")(**dict);\n        auto init_resp = py::dict(init_resp_py);\n        if (init_resp.contains(\"err\")) {\n            std::stringstream ss;\n            ss << \"py.CVSDK::init returns (\";\n            ss << init_resp[\"err\"].cast<std::string>();\n            ss << \")\";\n            throw std::runtime_error(ss.str());\n        }\n    }\n}\n\nvoid pycv::PyImage::Do(const DoRequest& req, DoResponse& resp) {\n    py::gil_scoped_acquire acquire;\n\n    if (sdk_py.is_none()) {\n        throw std::runtime_error(\n            \"method py.CVSDK not initialized, call init at first\");\n    }\n    if (!py::hasattr(sdk_py, \"do\")) {\n        throw std::runtime_error(\"method py.do not found\");\n    }\n    {\n        py::dict dict(\"arg1\"_a = py::bytes(req.arg1));\n        dict[\"arg2\"] = req.arg2;\n        auto do_resp_py = sdk_py.attr(\"do\")(**dict);\n        auto do_resp = py::dict(do_resp_py);\n        if (do_resp.contains(\"err\")) {\n            std::stringstream ss;\n            ss << \"py.CVSDK::do do_resp returns (\";\n            ss << do_resp[\"err\"].cast<std::string>();\n            ss << \")\";\n            throw std::runtime_error(ss.str());\n        }\n    }\n}\n\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/pycv_test.go",
    "content": "package pycv_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/kaydxh/golang/pkg/gocv/cgo/swig/pycv\"\n\tpycv_ \"github.com/kaydxh/golang/pkg/gocv/cgo/swig/pycv\"\n)\n\nfunc TestDo(t *testing.T) {\n\terr := pycv_.GlobalInit(\"model_dir\", -1)\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t\treturn\n\t}\n\n\tdefer pycv.GlobalRelease()\n\n\tsdk := pycv_.NewPyImage()\n\tinitReq := pycv_.NewLocalInitRequest()\n\t_, err = sdk.LocalInit(initReq)\n\tif err != nil {\n\t\tt.Errorf(\"failed to local init, err: %v\", err)\n\t}\n\treq := pycv_.NewDoRequest()\n\treq.SetArg1(\"arg1\")\n\treq.SetArg2(\"arg2\")\n\t_, err = sdk.Do(req)\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t\treturn\n\t}\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/pycv_wrap.cxx",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (https://www.swig.org).\n * Version 4.1.1\n *\n * Do not make changes to this file unless you know what you are doing - modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n// source: pycv.swigcxx\n\n\nextern\n#ifdef __cplusplus\n  \"C\"\n#endif\n  void cgo_panic__pycv_ffa8ea6aa3be9035(const char*);\nstatic void _swig_gopanic(const char *p) {\n  cgo_panic__pycv_ffa8ea6aa3be9035(p);\n}\n\n\n\n#define SWIG_VERSION 0x040101\n#define SWIGGO\n#define SWIGMODULE pycv\n#define SWIG_DIRECTORS\n/* -----------------------------------------------------------------------------\n *  This section contains generic SWIG labels for method/variable\n *  declarations/attributes, and other compiler dependent labels.\n * ----------------------------------------------------------------------------- */\n\n/* template workaround for compilers that cannot correctly implement the C++ standard */\n#ifndef SWIGTEMPLATEDISAMBIGUATOR\n# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)\n#  define SWIGTEMPLATEDISAMBIGUATOR template\n# elif defined(__HP_aCC)\n/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */\n/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */\n#  define SWIGTEMPLATEDISAMBIGUATOR template\n# else\n#  define SWIGTEMPLATEDISAMBIGUATOR\n# endif\n#endif\n\n/* inline attribute */\n#ifndef SWIGINLINE\n# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))\n#   define SWIGINLINE inline\n# else\n#   define SWIGINLINE\n# endif\n#endif\n\n/* attribute recognised by some compilers to avoid 'unused' warnings */\n#ifndef SWIGUNUSED\n# if defined(__GNUC__)\n#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))\n#     define SWIGUNUSED __attribute__ ((__unused__))\n#   else\n#     define SWIGUNUSED\n#   endif\n# elif defined(__ICC)\n#   define SWIGUNUSED __attribute__ ((__unused__))\n# else\n#   define SWIGUNUSED\n# endif\n#endif\n\n#ifndef SWIG_MSC_UNSUPPRESS_4505\n# if defined(_MSC_VER)\n#   pragma warning(disable : 4505) /* unreferenced local function has been removed */\n# endif\n#endif\n\n#ifndef SWIGUNUSEDPARM\n# ifdef __cplusplus\n#   define SWIGUNUSEDPARM(p)\n# else\n#   define SWIGUNUSEDPARM(p) p SWIGUNUSED\n# endif\n#endif\n\n/* internal SWIG method */\n#ifndef SWIGINTERN\n# define SWIGINTERN static SWIGUNUSED\n#endif\n\n/* internal inline SWIG method */\n#ifndef SWIGINTERNINLINE\n# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE\n#endif\n\n/* exporting methods */\n#if defined(__GNUC__)\n#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)\n#    ifndef GCC_HASCLASSVISIBILITY\n#      define GCC_HASCLASSVISIBILITY\n#    endif\n#  endif\n#endif\n\n#ifndef SWIGEXPORT\n# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n#   if defined(STATIC_LINKED)\n#     define SWIGEXPORT\n#   else\n#     define SWIGEXPORT __declspec(dllexport)\n#   endif\n# else\n#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)\n#     define SWIGEXPORT __attribute__ ((visibility(\"default\")))\n#   else\n#     define SWIGEXPORT\n#   endif\n# endif\n#endif\n\n/* calling conventions for Windows */\n#ifndef SWIGSTDCALL\n# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n#   define SWIGSTDCALL __stdcall\n# else\n#   define SWIGSTDCALL\n# endif\n#endif\n\n/* Deal with Microsoft's attempt at deprecating C standard runtime functions */\n#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)\n# define _CRT_SECURE_NO_DEPRECATE\n#endif\n\n/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */\n#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)\n# define _SCL_SECURE_NO_DEPRECATE\n#endif\n\n/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */\n#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)\n# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0\n#endif\n\n/* Intel's compiler complains if a variable which was never initialised is\n * cast to void, which is a common idiom which we use to indicate that we\n * are aware a variable isn't used.  So we just silence that warning.\n * See: https://github.com/swig/swig/issues/192 for more discussion.\n */\n#ifdef __INTEL_COMPILER\n# pragma warning disable 592\n#endif\n\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n\n\n\ntypedef long long intgo;\ntypedef unsigned long long uintgo;\n\n\n# if !defined(__clang__) && (defined(__i386__) || defined(__x86_64__))\n#   define SWIGSTRUCTPACKED __attribute__((__packed__, __gcc_struct__))\n# else\n#   define SWIGSTRUCTPACKED __attribute__((__packed__))\n# endif\n\n\n\ntypedef struct { char *p; intgo n; } _gostring_;\ntypedef struct { void* array; intgo len; intgo cap; } _goslice_;\n\n\n\n#define SWIG_exception(code, msg) _swig_gopanic(msg)\n\n\nstatic _gostring_ Swig_AllocateString(const char *p, size_t l) {\n  _gostring_ ret;\n  ret.p = (char*)malloc(l);\n  memcpy(ret.p, p, l);\n  ret.n = l;\n  return ret;\n}\n\n/* -----------------------------------------------------------------------------\n * director_common.swg\n *\n * This file contains support for director classes which is common between\n * languages.\n * ----------------------------------------------------------------------------- */\n\n/*\n  Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the\n  'Swig' namespace. This could be useful for multi-modules projects.\n*/\n#ifdef SWIG_DIRECTOR_STATIC\n/* Force anonymous (static) namespace */\n#define Swig\n#endif\n/* -----------------------------------------------------------------------------\n * director.swg\n *\n * This file contains support for director classes so that Go proxy\n * methods can be called from C++.\n * ----------------------------------------------------------------------------- */\n\n#include <exception>\n#include <map>\n\nnamespace Swig {\n\n  class DirectorException : public std::exception {\n  };\n}\n\n/* Handle memory management for directors.  */\n\nnamespace {\n  struct GCItem {\n    virtual ~GCItem() {}\n  };\n\n  struct GCItem_var {\n    GCItem_var(GCItem *item = 0) : _item(item) {\n    }\n\n    GCItem_var& operator=(GCItem *item) {\n      GCItem *tmp = _item;\n      _item = item;\n      delete tmp;\n      return *this;\n    }\n\n    ~GCItem_var() {\n      delete _item;\n    }\n\n    GCItem* operator->() {\n      return _item;\n    }\n\n    private:\n      GCItem *_item;\n  };\n\n  template <typename Type>\n  struct GCItem_T : GCItem {\n    GCItem_T(Type *ptr) : _ptr(ptr) {\n    }\n\n    virtual ~GCItem_T() {\n      delete _ptr;\n    }\n\n  private:\n    Type *_ptr;\n  };\n}\n\nclass Swig_memory {\npublic:\n  template <typename Type>\n  void swig_acquire_pointer(Type* vptr) {\n    if (vptr) {\n      swig_owner[vptr] = new GCItem_T<Type>(vptr);\n    }\n  }\nprivate:\n  typedef std::map<void *, GCItem_var> swig_ownership_map;\n  swig_ownership_map swig_owner;\n};\n\ntemplate <typename Type>\nstatic void swig_acquire_pointer(Swig_memory** pmem, Type* ptr) {\n  if (!pmem) {\n    *pmem = new Swig_memory;\n  }\n  (*pmem)->swig_acquire_pointer(ptr);\n}\n\n#ifdef __cplusplus\n#include <utility>\n/* SwigValueWrapper is described in swig.swg */\ntemplate<typename T> class SwigValueWrapper {\n  struct SwigSmartPointer {\n    T *ptr;\n    SwigSmartPointer(T *p) : ptr(p) { }\n    ~SwigSmartPointer() { delete ptr; }\n    SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }\n    void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; }\n  } pointer;\n  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);\n  SwigValueWrapper(const SwigValueWrapper<T>& rhs);\npublic:\n  SwigValueWrapper() : pointer(0) { }\n  SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; }\n#if __cplusplus >=201103L\n  SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; }\n  operator T&&() const { return std::move(*pointer.ptr); }\n#else\n  operator T&() const { return *pointer.ptr; }\n#endif\n  T *operator&() const { return pointer.ptr; }\n  static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); }\n};\n\n/*\n * SwigValueInit() is a generic initialisation solution as the following approach:\n * \n *       T c_result = T();\n * \n * doesn't compile for all types for example:\n * \n *       unsigned int c_result = unsigned int();\n */\ntemplate <typename T> T SwigValueInit() {\n  return T();\n}\n\n#if __cplusplus >=201103L\n# define SWIG_STD_MOVE(OBJ) std::move(OBJ)\n#else\n# define SWIG_STD_MOVE(OBJ) OBJ\n#endif\n\n#endif\n\n\nstatic void Swig_free(void* p) {\n  free(p);\n}\n\nstatic void* Swig_malloc(int c) {\n  return malloc(c);\n}\n\n\n#include <typeinfo>\n#include <stdexcept>\n\n\n#include <map>\n#include <algorithm>\n#include <stdexcept>\n\n\n#include <string>\n\n\n#include <vector>\n#include <stdexcept>\n\n\n#include \"pycv.h\"\n\n\n\n\n\n// C++ director class methods.\n#include \"pycv_wrap.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid _wrap_Swig_free_pycv_ffa8ea6aa3be9035(void *_swig_go_0) {\n  void *arg1 = (void *) 0 ;\n  \n  arg1 = *(void **)&_swig_go_0; \n  \n  Swig_free(arg1);\n  \n}\n\n\nvoid *_wrap_Swig_malloc_pycv_ffa8ea6aa3be9035(intgo _swig_go_0) {\n  int arg1 ;\n  void *result = 0 ;\n  void *_swig_go_result;\n  \n  arg1 = (int)_swig_go_0; \n  \n  result = (void *)Swig_malloc(arg1);\n  *(void **)&_swig_go_result = (void *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_LocalInitRequest_gpu_id_set_pycv_ffa8ea6aa3be9035(pycv::LocalInitRequest *_swig_go_0, intgo _swig_go_1) {\n  pycv::LocalInitRequest *arg1 = (pycv::LocalInitRequest *) 0 ;\n  int arg2 ;\n  \n  arg1 = *(pycv::LocalInitRequest **)&_swig_go_0; \n  arg2 = (int)_swig_go_1; \n  \n  if (arg1) (arg1)->gpu_id = arg2;\n  \n}\n\n\nintgo _wrap_LocalInitRequest_gpu_id_get_pycv_ffa8ea6aa3be9035(pycv::LocalInitRequest *_swig_go_0) {\n  pycv::LocalInitRequest *arg1 = (pycv::LocalInitRequest *) 0 ;\n  int result;\n  intgo _swig_go_result;\n  \n  arg1 = *(pycv::LocalInitRequest **)&_swig_go_0; \n  \n  result = (int) ((arg1)->gpu_id);\n  _swig_go_result = result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_LocalInitRequest_sdk_dir_set_pycv_ffa8ea6aa3be9035(pycv::LocalInitRequest *_swig_go_0, _gostring_ _swig_go_1) {\n  pycv::LocalInitRequest *arg1 = (pycv::LocalInitRequest *) 0 ;\n  std::string *arg2 = 0 ;\n  \n  arg1 = *(pycv::LocalInitRequest **)&_swig_go_0; \n  \n  std::string arg2_str(_swig_go_1.p, _swig_go_1.n);\n  arg2 = &arg2_str;\n  \n  \n  if (arg1) (arg1)->sdk_dir = *arg2;\n  \n}\n\n\n_gostring_ _wrap_LocalInitRequest_sdk_dir_get_pycv_ffa8ea6aa3be9035(pycv::LocalInitRequest *_swig_go_0) {\n  pycv::LocalInitRequest *arg1 = (pycv::LocalInitRequest *) 0 ;\n  std::string *result = 0 ;\n  _gostring_ _swig_go_result;\n  \n  arg1 = *(pycv::LocalInitRequest **)&_swig_go_0; \n  \n  result = (std::string *) & ((arg1)->sdk_dir);\n  _swig_go_result = Swig_AllocateString((*result).data(), (*result).length()); \n  return _swig_go_result;\n}\n\n\nvoid _wrap_LocalInitRequest_model_dir_set_pycv_ffa8ea6aa3be9035(pycv::LocalInitRequest *_swig_go_0, _gostring_ _swig_go_1) {\n  pycv::LocalInitRequest *arg1 = (pycv::LocalInitRequest *) 0 ;\n  std::string *arg2 = 0 ;\n  \n  arg1 = *(pycv::LocalInitRequest **)&_swig_go_0; \n  \n  std::string arg2_str(_swig_go_1.p, _swig_go_1.n);\n  arg2 = &arg2_str;\n  \n  \n  if (arg1) (arg1)->model_dir = *arg2;\n  \n}\n\n\n_gostring_ _wrap_LocalInitRequest_model_dir_get_pycv_ffa8ea6aa3be9035(pycv::LocalInitRequest *_swig_go_0) {\n  pycv::LocalInitRequest *arg1 = (pycv::LocalInitRequest *) 0 ;\n  std::string *result = 0 ;\n  _gostring_ _swig_go_result;\n  \n  arg1 = *(pycv::LocalInitRequest **)&_swig_go_0; \n  \n  result = (std::string *) & ((arg1)->model_dir);\n  _swig_go_result = Swig_AllocateString((*result).data(), (*result).length()); \n  return _swig_go_result;\n}\n\n\npycv::LocalInitRequest *_wrap_new_LocalInitRequest_pycv_ffa8ea6aa3be9035() {\n  pycv::LocalInitRequest *result = 0 ;\n  pycv::LocalInitRequest *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (pycv::LocalInitRequest *)new pycv::LocalInitRequest();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(pycv::LocalInitRequest **)&_swig_go_result = (pycv::LocalInitRequest *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_LocalInitRequest_pycv_ffa8ea6aa3be9035(pycv::LocalInitRequest *_swig_go_0) {\n  pycv::LocalInitRequest *arg1 = (pycv::LocalInitRequest *) 0 ;\n  \n  arg1 = *(pycv::LocalInitRequest **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\npycv::LocalInitResponse *_wrap_new_LocalInitResponse_pycv_ffa8ea6aa3be9035() {\n  pycv::LocalInitResponse *result = 0 ;\n  pycv::LocalInitResponse *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (pycv::LocalInitResponse *)new pycv::LocalInitResponse();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(pycv::LocalInitResponse **)&_swig_go_result = (pycv::LocalInitResponse *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_LocalInitResponse_pycv_ffa8ea6aa3be9035(pycv::LocalInitResponse *_swig_go_0) {\n  pycv::LocalInitResponse *arg1 = (pycv::LocalInitResponse *) 0 ;\n  \n  arg1 = *(pycv::LocalInitResponse **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\nvoid _wrap_DoRequest_arg1_set_pycv_ffa8ea6aa3be9035(pycv::DoRequest *_swig_go_0, _gostring_ _swig_go_1) {\n  pycv::DoRequest *arg1 = (pycv::DoRequest *) 0 ;\n  std::string *arg2 = 0 ;\n  \n  arg1 = *(pycv::DoRequest **)&_swig_go_0; \n  \n  std::string arg2_str(_swig_go_1.p, _swig_go_1.n);\n  arg2 = &arg2_str;\n  \n  \n  if (arg1) (arg1)->arg1 = *arg2;\n  \n}\n\n\n_gostring_ _wrap_DoRequest_arg1_get_pycv_ffa8ea6aa3be9035(pycv::DoRequest *_swig_go_0) {\n  pycv::DoRequest *arg1 = (pycv::DoRequest *) 0 ;\n  std::string *result = 0 ;\n  _gostring_ _swig_go_result;\n  \n  arg1 = *(pycv::DoRequest **)&_swig_go_0; \n  \n  result = (std::string *) & ((arg1)->arg1);\n  _swig_go_result = Swig_AllocateString((*result).data(), (*result).length()); \n  return _swig_go_result;\n}\n\n\nvoid _wrap_DoRequest_arg2_set_pycv_ffa8ea6aa3be9035(pycv::DoRequest *_swig_go_0, _gostring_ _swig_go_1) {\n  pycv::DoRequest *arg1 = (pycv::DoRequest *) 0 ;\n  std::string *arg2 = 0 ;\n  \n  arg1 = *(pycv::DoRequest **)&_swig_go_0; \n  \n  std::string arg2_str(_swig_go_1.p, _swig_go_1.n);\n  arg2 = &arg2_str;\n  \n  \n  if (arg1) (arg1)->arg2 = *arg2;\n  \n}\n\n\n_gostring_ _wrap_DoRequest_arg2_get_pycv_ffa8ea6aa3be9035(pycv::DoRequest *_swig_go_0) {\n  pycv::DoRequest *arg1 = (pycv::DoRequest *) 0 ;\n  std::string *result = 0 ;\n  _gostring_ _swig_go_result;\n  \n  arg1 = *(pycv::DoRequest **)&_swig_go_0; \n  \n  result = (std::string *) & ((arg1)->arg2);\n  _swig_go_result = Swig_AllocateString((*result).data(), (*result).length()); \n  return _swig_go_result;\n}\n\n\npycv::DoRequest *_wrap_new_DoRequest_pycv_ffa8ea6aa3be9035() {\n  pycv::DoRequest *result = 0 ;\n  pycv::DoRequest *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (pycv::DoRequest *)new pycv::DoRequest();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(pycv::DoRequest **)&_swig_go_result = (pycv::DoRequest *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_DoRequest_pycv_ffa8ea6aa3be9035(pycv::DoRequest *_swig_go_0) {\n  pycv::DoRequest *arg1 = (pycv::DoRequest *) 0 ;\n  \n  arg1 = *(pycv::DoRequest **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\npycv::DoResponse *_wrap_new_DoResponse_pycv_ffa8ea6aa3be9035() {\n  pycv::DoResponse *result = 0 ;\n  pycv::DoResponse *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (pycv::DoResponse *)new pycv::DoResponse();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(pycv::DoResponse **)&_swig_go_result = (pycv::DoResponse *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_DoResponse_pycv_ffa8ea6aa3be9035(pycv::DoResponse *_swig_go_0) {\n  pycv::DoResponse *arg1 = (pycv::DoResponse *) 0 ;\n  \n  arg1 = *(pycv::DoResponse **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\npycv::PyImage *_wrap_new_Wrapped_PyImage_pycv_ffa8ea6aa3be9035() {\n  pycv::PyImage *result = 0 ;\n  pycv::PyImage *_swig_go_result;\n  \n  \n  {\n    try {\n      result = (pycv::PyImage *)new pycv::PyImage();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  *(pycv::PyImage **)&_swig_go_result = (pycv::PyImage *)result; \n  return _swig_go_result;\n}\n\n\nvoid _wrap_delete_Wrapped_PyImage_pycv_ffa8ea6aa3be9035(pycv::PyImage *_swig_go_0) {\n  pycv::PyImage *arg1 = (pycv::PyImage *) 0 ;\n  \n  arg1 = *(pycv::PyImage **)&_swig_go_0; \n  \n  {\n    try {\n      delete arg1;;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\nvoid _wrap_Wrapped_PyImage_GlobalInit_pycv_ffa8ea6aa3be9035(_gostring_ _swig_go_0, intgo _swig_go_1) {\n  std::string *arg1 = 0 ;\n  int arg2 ;\n  \n  \n  std::string arg1_str(_swig_go_0.p, _swig_go_0.n);\n  arg1 = &arg1_str;\n  \n  arg2 = (int)_swig_go_1; \n  \n  {\n    try {\n      pycv::PyImage::GlobalInit((std::string const &)*arg1,arg2);;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\nvoid _wrap_Wrapped_PyImage_GlobalRelease_pycv_ffa8ea6aa3be9035() {\n  {\n    try {\n      pycv::PyImage::GlobalRelease();;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\nvoid _wrap_Wrapped_PyImage_Wrapped_PyImage_LocalInit_pycv_ffa8ea6aa3be9035(pycv::PyImage *_swig_go_0, pycv::LocalInitRequest *_swig_go_1, pycv::LocalInitResponse *_swig_go_2) {\n  pycv::PyImage *arg1 = (pycv::PyImage *) 0 ;\n  pycv::LocalInitRequest *arg2 = 0 ;\n  pycv::LocalInitResponse *arg3 = 0 ;\n  \n  arg1 = *(pycv::PyImage **)&_swig_go_0; \n  arg2 = *(pycv::LocalInitRequest **)&_swig_go_1; \n  arg3 = *(pycv::LocalInitResponse **)&_swig_go_2; \n  \n  {\n    try {\n      (arg1)->LocalInit((pycv::LocalInitRequest const &)*arg2,*arg3);;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\nvoid _wrap_Wrapped_PyImage_Wrapped_PyImage_Do_pycv_ffa8ea6aa3be9035(pycv::PyImage *_swig_go_0, pycv::DoRequest *_swig_go_1, pycv::DoResponse *_swig_go_2) {\n  pycv::PyImage *arg1 = (pycv::PyImage *) 0 ;\n  pycv::DoRequest *arg2 = 0 ;\n  pycv::DoResponse *arg3 = 0 ;\n  \n  arg1 = *(pycv::PyImage **)&_swig_go_0; \n  arg2 = *(pycv::DoRequest **)&_swig_go_1; \n  arg3 = *(pycv::DoResponse **)&_swig_go_2; \n  \n  {\n    try {\n      (arg1)->Do((pycv::DoRequest const &)*arg2,*arg3);;\n    } catch (const std::exception& e) {\n      _swig_gopanic(e.what());\n    }\n  }\n  \n}\n\n\n#ifdef __cplusplus\n}\n#endif\n\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/pycv/pycv_wrap.h",
    "content": "/* ----------------------------------------------------------------------------\n * This file was automatically generated by SWIG (https://www.swig.org).\n * Version 4.1.1\n *\n * Do not make changes to this file unless you know what you are doing - modify\n * the SWIG interface file instead.\n * ----------------------------------------------------------------------------- */\n\n// source: pycv.swigcxx\n\n#ifndef SWIG_pycv_WRAP_H_\n#define SWIG_pycv_WRAP_H_\n\nclass Swig_memory;\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/types/pybind11/pybind11.swigcxx",
    "content": "//go:build ignore\n\n%header\n%{\n    #ifndef __SDK_CGO_UNKNOWN_PLATFORM__\n    #include <pybind11/embed.h>\n    #endif\n%}\nnamespace pybind11 {\nclass object {};\n}  // namespace pybind11\n\n"
  },
  {
    "path": "pkg/gocv/cgo/swig/types/pybind11/pybind11_mock.h",
    "content": "#ifndef SDK_GO_PYBIND11_MOCK_H\n#define SDK_GO_PYBIND11_MOCK_H\n#include <ostream>\nnamespace pybind11 {\nclass object {};\n}  // namespace pybind11\n#endif  // YT_SDK_GO_PYBIND11_MOCK_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/bin/GraphicsMagick++-config",
    "content": "#!/bin/sh\n#\n# Configure options script for re-calling compilation\n# options required to use the Magick++ library.\n#\n# Concept derived from gtk-config in the Gtk package except that Autoconf-style\n# configuration information is presented instead so that it may be used more\n# effictively in configure scripts.\n#\nusage='Usage: GraphicsMagick++-config [--cppflags] [--cxxflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]\n\n For example, \"example.cpp\" may be compiled to produce \"example\" as follows:\n\n  \"c++ -o example example.cpp `GraphicsMagick++-config --cppflags --cxxflags --ldflags --libs`\"'\n\nif test $# -eq 0; then\n      echo \"${usage}\" 1>&2\n      exit 1\nfi\n\nwhile test $# -gt 0; do\n  case $1 in\n    --prefix)\n      echo /root/pinwoodxu/GraphicsMagick-source/release\n      ;;\n    --exec-prefix)\n      echo /root/pinwoodxu/GraphicsMagick-source/release\n      ;;\n    --version)\n      echo 1.3.35\n      ;;\n    --cppflags)\n      echo '-I/root/pinwoodxu/GraphicsMagick-source/release/include/GraphicsMagick'\n      ;;\n    --cxxflags)\n      echo '-pthread'\n      ;;\n    --ldflags)\n      echo '-L/root/pinwoodxu/GraphicsMagick-source/release/lib '\n      ;;\n    --libs)\n      echo '-lGraphicsMagick++ -lGraphicsMagick -lwebp -lwebpmux -ltiff -ljpeg -lpng15 -lbz2 -lz -lm -lpthread -lgomp'\n      ;;\n    *)\n      echo \"${usage}\" 1>&2\n      exit 1\n      ;;\n  esac\n  shift\ndone\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/bin/GraphicsMagick-config",
    "content": "#!/bin/sh\n#\n# Configure options script for re-calling GraphicsMagick compilation\n# options required to use the GraphicsMagick library.\n#\n# Concept derived from gtk-config in the Gtk package except that Autoconf-style\n# configuration information is presented instead so that it may be used more\n# effectively in configure scripts.\n#\nusage='Usage: GraphicsMagick-config [--cflags] [--cppflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]\n\n For example, \"example.c\" may be compiled to produce \"example\" as follows:\n\n  \"gcc -o example example.c `GraphicsMagick-config --cppflags --cflags --ldflags --libs`\"'\n\nif test $# -eq 0; then\n      echo \"${usage}\" 1>&2\n      exit 1\nfi\n\nwhile test $# -gt 0; do\n  case $1 in\n    --prefix)\n      echo /root/pinwoodxu/GraphicsMagick-source/release\n      ;;\n    --exec-prefix)\n      echo /root/pinwoodxu/GraphicsMagick-source/release\n      ;;\n    --version)\n      echo 1.3.35\n      ;;\n    --cflags)\n      echo '-fopenmp -g -O2 -Wall -pthread'\n      ;;\n    --cppflags)\n      echo '-I/root/pinwoodxu/GraphicsMagick-source/release/include/GraphicsMagick'\n      ;;\n    --ldflags)\n      echo '-L/root/pinwoodxu/GraphicsMagick-source/release/lib '\n      ;;\n    --libs)\n      echo '-lGraphicsMagick -lwebp -lwebpmux -ltiff -ljpeg -lpng15 -lbz2 -lz -lm -lpthread -lgomp'\n      ;;\n    *)\n      echo \"${usage}\" 1>&2\n      exit 1\n      ;;\n  esac\n  shift\ndone\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/bin/GraphicsMagickWand-config",
    "content": "#!/bin/sh\n#\n# Configure options script for re-calling GraphicsMagick compilation\n# options required to use the GraphicsMagick Wand library.\n#\n# Concept derived from gtk-config in the Gtk package except that Autoconf-style\n# configuration information is presented instead so that it may be used more\n# effectively in configure scripts.\n#\nusage='Usage: GraphicsMagickWand-config [--cflags] [--cppflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]\n\n For example, \"example.c\" may be compiled to produce \"example\" as follows:\n\n  \"gcc -o example example.c `GraphicsMagickWand-config --cppflags --cflags --ldflags --libs`\"'\n\nif test $# -eq 0; then\n      echo \"${usage}\" 1>&2\n      exit 1\nfi\n\nwhile test $# -gt 0; do\n  case $1 in\n    --prefix)\n      echo /root/pinwoodxu/GraphicsMagick-source/release\n      ;;\n    --exec-prefix)\n      echo /root/pinwoodxu/GraphicsMagick-source/release\n      ;;\n    --version)\n      echo 1.3.35\n      ;;\n    --cflags)\n      echo \"`GraphicsMagick-config --cflags`\"\n      ;;\n    --cppflags)\n      echo \"`GraphicsMagick-config --cppflags`\"\n      ;;\n    --ldflags)\n      echo \"`GraphicsMagick-config --ldflags`\"\n      ;;\n    --libs)\n      echo \"-lGraphicsMagickWand `GraphicsMagick-config --libs`\"\n      ;;\n    *)\n      echo \"${usage}\" 1>&2\n      exit 1\n      ;;\n  esac\n  shift\ndone\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/Blob.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002\n//\n// Reference counted container class for Binary Large Objects (BLOBs)\n//\n\n#if !defined(Magick_BlobRef_header)\n#define Magick_BlobRef_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n\nnamespace Magick\n{\n  // Forward decl\n  class BlobRef;\n\n  class MagickDLLDecl Blob\n  {\n\n  public:\n\n    enum Allocator\n    {\n      MallocAllocator,\n      NewAllocator\n    };\n\n    // Default constructor\n    Blob ( void );\n\n    // Construct object with data, making a copy of the supplied data.\n    Blob ( const void* data_, size_t length_ );\n\n    // Copy constructor (reference counted)\n    Blob ( const Blob& blob_ );\n\n    // Destructor (reference counted)\n    virtual       ~Blob ();\n\n    // Assignment operator (reference counted)\n    Blob&         operator= ( const Blob& blob_ );\n\n    // Update object contents from Base64-encoded string representation.\n    void          base64 ( const std::string base64_ );\n    // Return Base64-encoded string representation.\n    std::string   base64 ( void );\n\n    // Update object contents, making a copy of the supplied data.\n    // Any existing data in the object is deallocated.\n    void          update ( const void* data_, size_t length_ );\n\n    // Update object contents, using supplied pointer directly (no\n    // copy). Any existing data in the object is deallocated.  The user\n    // must ensure that the pointer supplied is not deleted or\n    // otherwise modified after it has been supplied to this method.\n    // Specify allocator_ as \"MallocAllocator\" if memory is allocated\n    // via the C language malloc() function, or \"NewAllocator\" if\n    // memory is allocated via C++ 'new'.\n    void          updateNoCopy ( void* data_, size_t length_,\n                                 Allocator allocator_ = NewAllocator );\n\n    // Obtain pointer to data. The user should never try to modify or\n    // free this data since the Blob class manages its own data. The\n    // user must be finished with the data before allowing the Blob to\n    // be destroyed since the pointer is invalid once the Blob is\n    // destroyed.\n    const void*   data ( void ) const;\n\n    // Obtain data length\n    size_t length ( void ) const;\n\n  protected:\n\n  private:\n    BlobRef * _blobRef;\n  };\n\n} // namespace Magick\n\n#endif // Magick_BlobRef_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/CoderInfo.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 2001-2010\n//\n// CoderInfo Definition\n//\n// Container for image format support information.\n//\n\n#if !defined (Magick_CoderInfo_header)\n#define Magick_CoderInfo_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n\nnamespace Magick\n{\n  class MagickDLLDecl CoderInfo\n  {\n  public:\n\n    enum MatchType {\n      AnyMatch,         // match any coder\n      TrueMatch,        // match coder if true\n      FalseMatch        // match coder if false\n    };\n\n    // Default constructor\n    CoderInfo ( void );\n\n    // Copy constructor\n    CoderInfo ( const CoderInfo &coder_ );\n\n    // Construct with coder name\n    CoderInfo ( const std::string &name_ );\n\n    // Destructor\n    ~CoderInfo ( void );\n\n    // Format name\n    std::string name( void ) const;\n\n    // Format description\n    std::string description( void ) const;\n\n    // Format is readable\n    bool isReadable( void ) const;\n\n    // Format is writeable\n    bool isWritable( void ) const;\n\n    // Format supports multiple frames\n    bool isMultiFrame( void ) const;\n\n    // Assignment operator\n    CoderInfo& operator= (const CoderInfo &coder_ );\n\n    //\n    // Implemementation methods\n    //\n    CoderInfo ( const MagickLib::MagickInfo *magickInfo_ );\n\n  private:\n\n    std::string         _name;\n    std::string         _description;\n    bool                _isReadable;\n    bool                _isWritable;\n    bool                _isMultiFrame;\n\n  };\n} // namespace Magick\n\n//\n// Inlines\n//\n\n\n#endif // Magick_CoderInfo_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/Color.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003, 2008\n//\n// Color Implementation\n//\n#if !defined (Magick_Color_header)\n#define Magick_Color_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n\nnamespace Magick\n{\n\n  class MagickDLLDecl Color;\n\n  // Compare two Color objects regardless of LHS/RHS\n  int MagickDLLDecl operator == ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator != ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator >  ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator <  ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator >= ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator <= ( const Magick::Color& left_, const Magick::Color& right_ );\n\n  // Base color class stores RGB components scaled to fit Quantum\n  class MagickDLLDecl Color\n  {\n  public:\n    Color ( Quantum red_,\n            Quantum green_,\n            Quantum blue_ );\n    Color ( Quantum red_,\n            Quantum green_,\n            Quantum blue_,\n            Quantum alpha_ );\n    Color ( const std::string &x11color_ );\n    Color ( const char * x11color_ );\n    Color ( void );\n    virtual        ~Color ( void );\n    Color ( const Color & color_ );\n\n    // Red color (range 0 to MaxRGB)\n    void           redQuantum ( Quantum red_ );\n    Quantum        redQuantum ( void ) const;\n\n    // Green color (range 0 to MaxRGB)\n    void           greenQuantum ( Quantum green_ );\n    Quantum        greenQuantum ( void ) const;\n\n    // Blue color (range 0 to MaxRGB)\n    void           blueQuantum ( Quantum blue_ );\n    Quantum        blueQuantum ( void ) const;\n\n    // Alpha level (range OpaqueOpacity=0 to TransparentOpacity=MaxRGB)\n    void           alphaQuantum ( Quantum alpha_ );\n    Quantum        alphaQuantum ( void ) const;\n\n    // Scaled (to 1.0) version of alpha for use in sub-classes\n    // (range opaque=0 to transparent=1.0)\n    void           alpha ( double alpha_ );\n    double         alpha ( void ) const;\n\n    // Does object contain valid color?\n    void           isValid ( bool valid_ );\n    bool           isValid ( void ) const;\n\n    // Set color via X11 color specification string\n    const Color& operator= ( const std::string &x11color_ );\n    const Color& operator= ( const char * x11color_ );\n\n    // Assignment operator\n    Color& operator= ( const Color& color_ );\n\n    // Return X11 color specification string\n    /* virtual */ operator std::string() const;\n\n    // Return ImageMagick PixelPacket\n    operator PixelPacket() const;\n\n    // Construct color via ImageMagick PixelPacket\n    Color ( const PixelPacket &color_ );\n\n    // Set color via ImageMagick PixelPacket\n    const Color& operator= ( const PixelPacket &color_ );\n\n    //\n    // Public methods beyond this point are for Magick++ use only.\n    //\n\n    // Obtain pixel intensity as a double\n    double intensity ( void ) const\n      {\n        return (0.299*(_pixel->red)+0.587*(_pixel->green)+0.114*(_pixel->blue));\n      }\n\n    // Scale a value expressed as a double (0-1) to Quantum range (0-MaxRGB)\n    static Quantum scaleDoubleToQuantum( const double double_ )\n      {\n        return (static_cast<Magick::Quantum>(double_*MaxRGB));\n      }\n\n    // Scale a value expressed as a Quantum (0-MaxRGB) to double range (0-1)\n    static double scaleQuantumToDouble( const Quantum quantum_ )\n      {\n        return (static_cast<double>(quantum_)/MaxRGB);\n      }\n    static double scaleQuantumToDouble( const double quantum_ )\n      {\n        return (quantum_/MaxRGB);\n      }\n\n\n  protected:\n\n    // PixelType specifies the interpretation of PixelPacket members\n    // RGBPixel:\n    //   Red      = red;\n    //   Green    = green;\n    //   Blue     = blue;\n    // RGBAPixel:\n    //   Red      = red;\n    //   Green    = green;\n    //   Blue     = blue;\n    //   Alpha    = opacity;\n    // CYMKPixel:\n    //   Cyan     = red\n    //   Yellow   = green\n    //   Magenta  = blue\n    //   Black(K) = opacity\n    enum PixelType\n    {\n      RGBPixel,\n      RGBAPixel,\n      CYMKPixel\n    };\n\n    // Constructor to construct with PixelPacket*\n    // Used to point Color at a pixel in an image\n    Color ( PixelPacket* rep_, PixelType pixelType_ );\n\n    // Set pixel\n    // Used to point Color at a pixel in an image\n    void pixel ( PixelPacket* rep_, PixelType pixelType_ );\n\n    // PixelPacket represents a color pixel:\n    //  red     = red   (range 0 to MaxRGB)\n    //  green   = green (range 0 to MaxRGB)\n    //  blue    = blue  (range 0 to MaxRGB)\n    //  opacity = alpha (range OpaqueOpacity=0 to TransparentOpacity=MaxRGB)\n    //  index   = PseudoColor colormap index\n    PixelPacket*     _pixel;\n\n  private:\n\n    // Common initializer for PixelPacket representation\n    void initPixel();\n\n    // Set true if we allocated pixel\n    bool                        _pixelOwn;\n\n    // Set true if pixel is \"valid\"\n    bool                       _isValid;\n\n    // Color type supported by _pixel\n    PixelType                   _pixelType;\n\n  };\n\n  //\n  // HSL Colorspace colors\n  //\n  class MagickDLLDecl ColorHSL : public Color\n  {\n  public:\n    ColorHSL ( double hue_, double saturation_, double luminosity_ );\n    ColorHSL ( void );\n    ColorHSL ( const Color & color_ );\n    /* virtual */  ~ColorHSL ( );\n\n    void           hue ( double hue_ );\n    double         hue ( void ) const;\n\n    void           saturation ( double saturation_ );\n    double         saturation ( void ) const;\n\n    void           luminosity ( double luminosity_ );\n    double         luminosity ( void ) const;\n\n    // Assignment operator from base class\n    ColorHSL& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorHSL ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n\n  //\n  // Grayscale RGB color\n  //\n  // Grayscale is simply RGB with equal parts of red, green, and blue\n  // All double arguments have a valid range of 0.0 - 1.0.\n  class MagickDLLDecl ColorGray : public Color\n  {\n  public:\n    ColorGray ( double shade_ );\n    ColorGray ( void );\n    ColorGray ( const Color & color_ );\n    /* virtual */ ~ColorGray ();\n\n    void           shade ( double shade_ );\n    double         shade ( void ) const;\n\n    // Assignment operator from base class\n    ColorGray& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorGray ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n\n  //\n  // Monochrome color\n  //\n  // Color arguments are constrained to 'false' (black pixel) and 'true'\n  // (white pixel)\n  class MagickDLLDecl ColorMono : public Color\n  {\n  public:\n    ColorMono ( bool mono_ );\n    ColorMono ( void );\n    ColorMono ( const Color & color_ );\n    /* virtual */ ~ColorMono ();\n\n    void           mono ( bool mono_ );\n    bool           mono ( void ) const;\n\n    // Assignment operator from base class\n    ColorMono& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorMono ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n\n  //\n  // RGB color\n  //\n  // All color arguments have a valid range of 0.0 - 1.0.\n  class MagickDLLDecl ColorRGB : public Color\n  {\n  public:\n    ColorRGB ( double red_, double green_, double blue_ );\n    ColorRGB ( void );\n    ColorRGB ( const Color & color_ );\n    /* virtual */  ~ColorRGB ( void );\n\n    void           red ( double red_ );\n    double         red ( void ) const;\n\n    void           green ( double green_ );\n    double         green ( void ) const;\n\n    void           blue ( double blue_ );\n    double         blue ( void ) const;\n\n    // Assignment operator from base class\n    ColorRGB& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorRGB ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n\n  //\n  // YUV Colorspace color\n  //\n  // Argument ranges:\n  //        Y:  0.0 through 1.0\n  //        U: -0.5 through 0.5\n  //        V: -0.5 through 0.5\n  class MagickDLLDecl ColorYUV : public Color\n  {\n  public:\n    ColorYUV ( double y_, double u_, double v_ );\n    ColorYUV ( void );\n    ColorYUV ( const Color & color_ );\n    /* virtual */ ~ColorYUV ( void );\n\n    void           u ( double u_ );\n    double         u ( void ) const;\n\n    void           v ( double v_ );\n    double         v ( void ) const;\n\n    void           y ( double y_ );\n    double         y ( void ) const;\n\n    // Assignment operator from base class\n    ColorYUV& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorYUV ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n} // namespace Magick\n\n//\n// Inlines\n//\n\n//\n// Color\n//\n\n// Common initializer for PixelPacket representation\n// Initialized transparent black\ninline void Magick::Color::initPixel()\n{\n  _pixel->red     = 0;\n  _pixel->green   = 0;\n  _pixel->blue    = 0;\n  _pixel->opacity = TransparentOpacity;\n}\n\ninline void Magick::Color::redQuantum ( Magick::Quantum red_ )\n{\n  _pixel->red = red_;\n  _isValid = true;\n}\n\ninline Magick::Quantum Magick::Color::redQuantum ( void ) const\n{\n  return _pixel->red;\n}\n\ninline void Magick::Color::greenQuantum ( Magick::Quantum green_ )\n{\n  _pixel->green = green_;\n  _isValid = true;\n}\n\ninline Magick::Quantum  Magick::Color::greenQuantum ( void ) const\n{\n  return _pixel->green;\n}\n\ninline void  Magick::Color::blueQuantum ( Magick::Quantum blue_ )\n{\n  _pixel->blue = blue_;\n  _isValid = true;\n}\n\ninline Magick::Quantum Magick::Color::blueQuantum ( void ) const\n{\n  return _pixel->blue;\n}\n\ninline void  Magick::Color::alphaQuantum ( Magick::Quantum alpha_ )\n{\n  _pixel->opacity = alpha_;\n  _isValid = true ;\n}\n\ninline Magick::Quantum Magick::Color::alphaQuantum ( void ) const\n{\n  return _pixel->opacity;\n}\n\n// Return ImageMagick PixelPacket struct based on color.\ninline Magick::Color::operator MagickLib::PixelPacket () const\n{\n  return *_pixel;\n}\n\n// Scaled version of alpha for use in sub-classes\ninline void  Magick::Color::alpha ( double alpha_ )\n{\n  alphaQuantum( scaleDoubleToQuantum(alpha_) );\n}\ninline double Magick::Color::alpha ( void ) const\n{\n  return scaleQuantumToDouble( alphaQuantum() );\n}\n\n//\n// ColorHSL\n//\ninline Magick::ColorHSL::ColorHSL ( Magick::PixelPacket* rep_,\n                                    Magick::Color::PixelType pixelType_ )\n: Color( rep_, pixelType_ )\n{\n}\n\n//\n// ColorGray\n//\ninline Magick::ColorGray::ColorGray ( Magick::PixelPacket* rep_,\n                                      Magick::Color::PixelType pixelType_ )\n: Color( rep_, pixelType_ )\n{\n}\n\n//\n// ColorMono\n//\ninline Magick::ColorMono::ColorMono ( Magick::PixelPacket* rep_,\n                                      Magick::Color::PixelType pixelType_ )\n  : Color( rep_, pixelType_ )\n{\n}\n\n//\n// ColorRGB\n//\ninline Magick::ColorRGB::ColorRGB ( Magick::PixelPacket* rep_,\n                                    Magick::Color::PixelType pixelType_ )\n  : Color( rep_, pixelType_ )\n{\n}\n\ninline void Magick::ColorRGB::red ( double red_ )\n{\n  redQuantum( scaleDoubleToQuantum(red_) );\n}\n\ninline double Magick::ColorRGB::red ( void ) const\n{\n  return scaleQuantumToDouble( redQuantum() );\n}\n\ninline void Magick::ColorRGB::green ( double green_ )\n{\n  greenQuantum( scaleDoubleToQuantum(green_) );\n}\n\ninline double Magick::ColorRGB::green ( void ) const\n{\n  return scaleQuantumToDouble( greenQuantum() );\n}\n\ninline void Magick::ColorRGB::blue ( double blue_ )\n{\n  blueQuantum( scaleDoubleToQuantum(blue_) );\n}\n\ninline double Magick::ColorRGB::blue ( void ) const\n{\n  return scaleQuantumToDouble( blueQuantum() );\n}\n\n//\n// ColorYUV\n//\n\ninline Magick::ColorYUV::ColorYUV ( Magick::PixelPacket* rep_,\n                                    Magick::Color::PixelType pixelType_ )\n  : Color( rep_, pixelType_ )\n{\n}\n\n#endif // Magick_Color_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/Drawable.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2018\n//\n// Definition of Drawable (Graphic objects)\n//\n// The technique used for instantiating classes which derive from STL\n// templates is described in Microsoft MSDN Article ID: Q168958\n// \"HOWTO: Exporting STL Components Inside & Outside of a Class\".\n// \"http://support.microsoft.com/kb/168958\"\n//\n// Note that version 3.0 of this article says that that only STL\n// container template which supports DLL export is <vector> and we are\n// not using <vector> as part of the Drawable implementation.\n//\n\n#if !defined(Magick_Drawable_header)\n#define Magick_Drawable_header\n\n#include \"Magick++/Include.h\"\n\n#include <functional>\n#include <string>\n#include <list>\n#include <utility>\n#include \"Magick++/Color.h\"\n#include \"Magick++/Geometry.h\"\n\n#if defined(MagickDLLExplicitTemplate)\n#  if defined(MAGICK_PLUSPLUS_IMPLEMENTATION)\n#    define MagickDrawableExtern\n#  else\n#   pragma warning( disable: 4231 ) // Disable warning regarding using extern\n#    define MagickDrawableExtern extern\n#  endif // MAGICK_PLUSPLUS_IMPLEMENTATION\n#else\n#  define MagickDrawableExtern\n#endif // MagickDLLExplicitTemplate\n\nnamespace Magick\n{\n\n#if defined(__clang__)\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wunknown-warning-option\"\n#pragma clang diagnostic ignored \"-Wunused-private-field\"\n#endif /* if defined(__clang__) */\n\n  //\n  // Representation of an x,y coordinate\n  //\n  class MagickDLLDecl Coordinate\n  {\n  public:\n\n    // Default Constructor\n    Coordinate ( void )\n      : _x(0),\n        _y(0)\n      { }\n\n    // Constructor, setting first & second\n    Coordinate ( double x_, double y_ )\n      : _x(x_),\n        _y(y_)\n      { }\n\n    // Destructor\n    virtual ~Coordinate ()\n      { }\n\n    // x coordinate member\n    void   x ( double x_ )\n      {\n        _x = x_;\n      }\n    double x ( void ) const\n      {\n        return _x;\n      }\n\n    // y coordinate member\n    void   y ( double y_ )\n      {\n        _y = y_;\n      }\n    double y ( void ) const\n      {\n        return _y;\n      }\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  typedef std::list<Magick::Coordinate> CoordinateList;\n\n#if defined(MagickDLLExplicitTemplate)\n\n  MagickDrawableExtern template class MagickDLLDecl\n  std::allocator<Magick::Coordinate>;\n\n//   MagickDrawableExtern template class MagickDLLDecl\n//   std::list<Magick::Coordinate, std::allocator<Magick::Coordinate> >;\n\n#endif // MagickDLLExplicitTemplate\n\n  // Compare two Coordinate objects regardless of LHS/RHS\n  MagickDLLDeclExtern int operator == ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator != ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator >  ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator <  ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator >= ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator <= ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n\n  //\n  // Base class for all drawable objects\n  //\n  //struct MagickDLLDecl std::unary_function<MagickLib::DrawContext,void>;\n  class MagickDLLDecl DrawableBase:\n    public std::unary_function<MagickLib::DrawContext,void>\n  {\n  public:\n    // Constructor\n    DrawableBase ( void )\n      { }\n\n    // Destructor\n    virtual ~DrawableBase ( void );\n\n    // Operator to invoke equivalent draw API call\n    virtual void operator()( MagickLib::DrawContext ) const = 0;\n\n    // Return polymorphic copy of object\n    virtual DrawableBase* copy() const = 0;\n\n  private:\n  };\n\n  //\n  // Representation of a drawable surrogate object to manage drawable objects\n  //\n#undef Drawable  // Conflict with <X11/Xproto.h>\n  class MagickDLLDecl Drawable\n  {\n  public:\n\n    // Constructor\n    Drawable ( void );\n\n    // Construct from DrawableBase\n    Drawable ( const DrawableBase& original_ );\n\n    // Destructor\n    ~Drawable ( void );\n\n    // Copy constructor\n    Drawable ( const Drawable& original_ );\n\n    // Assignment operator\n    Drawable& operator= (const Drawable& original_ );\n\n    // Operator to invoke contained object\n    void operator()( MagickLib::DrawContext context_ ) const;\n\n  private:\n    DrawableBase* dp;\n  };\n\n  // Compare two Drawable objects regardless of LHS/RHS\n  MagickDLLDeclExtern int operator == ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator != ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator >  ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator <  ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator >= ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator <= ( const Drawable& left_,\n                                        const Drawable& right_ );\n\n  typedef std::list<Magick::Drawable> DrawableList;\n\n#if defined(MagickDLLExplicitTemplate)\n\n  MagickDrawableExtern template class MagickDLLDecl\n  std::allocator<Magick::Drawable>;\n\n//   MagickDrawableExtern template class MagickDLLDecl\n//   std::list<Magick::Drawable, std::allocator<Magick::Drawable> >;\n\n#endif // MagickDLLExplicitTemplate\n\n//\n// Base class for all drawable path elements for use with\n// DrawablePath\n//\nclass MagickDLLDecl VPathBase\n{\npublic:\n  // Constructor\n  VPathBase ( void )\n    { }\n\n  // Destructor\n  virtual ~VPathBase ( void );\n\n  // Assignment operator\n  //    const VPathBase& operator= (const VPathBase& original_ );\n\n  // Operator to invoke equivalent draw API call\n  virtual void operator()( MagickLib::DrawContext context_ ) const = 0;\n\n  // Return polymorphic copy of object\n  virtual VPathBase* copy() const = 0;\n};\n\n//\n// Representation of a drawable path element surrogate object to\n// manage drawable path elements so they may be passed as a list to\n// DrawablePath.\n//\nclass MagickDLLDecl VPath\n{\npublic:\n  // Constructor\n  VPath ( void );\n\n  // Construct from VPathBase\n  VPath ( const VPathBase& original_ );\n\n  // Destructor\n  virtual ~VPath ( void );\n\n  // Copy constructor\n  VPath ( const VPath& original_ );\n\n  // Assignment operator\n  VPath& operator= (const VPath& original_ );\n\n  // Operator to invoke contained object\n  void operator()( MagickLib::DrawContext context_ ) const;\n\nprivate:\n  VPathBase* dp;\n};\n\n// Compare two VPath objects regardless of LHS/RHS\nMagickDLLDeclExtern int operator == ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator != ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator >  ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator <  ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator >= ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator <= ( const VPath& left_,\n                                      const VPath& right_ );\n\ntypedef std::list<Magick::VPath> VPathList;\n\n#if defined(MagickDLLExplicitTemplate)\n\nMagickDrawableExtern template class MagickDLLDecl\nstd::allocator<Magick::VPath>;\n\n// MagickDrawableExtern template class MagickDLLDecl\n// std::list<Magick::VPath, std::allocator<Magick::VPath> >;\n\n#endif // MagickDLLExplicitTemplate\n\n//\n// Drawable Objects\n//\n\n// Affine (scaling, rotation, and translation)\nclass MagickDLLDecl DrawableAffine  : public DrawableBase\n{\npublic:\n  DrawableAffine ( double sx_, double sy_,\n                   double rx_, double ry_,\n                   double tx_, double ty_ );\n\n  DrawableAffine ( void );\n\n  /*virtual*/ ~DrawableAffine( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/\n  DrawableBase* copy() const;\n\n  void sx( const double sx_ )\n    {\n      _affine.sx = sx_;\n    }\n  double sx( void ) const\n    {\n      return _affine.sx;\n    }\n\n  void sy( const double sy_ )\n    {\n      _affine.sy = sy_;\n    }\n  double sy( void ) const\n    {\n      return _affine.sy;\n    }\n\n  void rx( const double rx_ )\n    {\n      _affine.rx = rx_;\n    }\n  double rx( void ) const\n    {\n      return _affine.rx;\n    }\n\n  void ry( const double ry_ )\n    {\n      _affine.ry = ry_;\n    }\n  double ry( void ) const\n    {\n      return _affine.ry;\n    }\n\n  void tx( const double tx_ )\n    {\n      _affine.tx = tx_;\n    }\n  double tx( void ) const\n    {\n      return _affine.tx;\n    }\n\n  void ty( const double ty_ )\n    {\n      _affine.ty = ty_;\n    }\n  double ty( void ) const\n    {\n      return _affine.ty;\n    }\n\nprivate:\n  MagickLib::AffineMatrix  _affine;\n};\n\n// Arc\nclass MagickDLLDecl DrawableArc : public DrawableBase\n{\npublic:\n  DrawableArc ( double startX_, double startY_,\n                double endX_, double endY_,\n                double startDegrees_, double endDegrees_ )\n    : _startX(startX_),\n      _startY(startY_),\n      _endX(endX_),\n      _endY(endY_),\n      _startDegrees(startDegrees_),\n      _endDegrees(endDegrees_)\n    { }\n\n  /*virtual*/ ~DrawableArc( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void startX( double startX_ )\n    {\n      _startX = startX_;\n    }\n  double startX( void ) const\n    {\n      return _startX;\n    }\n\n  void startY( double startY_ )\n    {\n      _startY = startY_;\n    }\n  double startY( void ) const\n    {\n      return _startY;\n    }\n\n  void endX( double endX_ )\n    {\n      _endX = endX_;\n    }\n  double endX( void ) const\n    {\n      return _endX;\n    }\n\n  void endY( double endY_ )\n    {\n      _endY = endY_;\n    }\n  double endY( void ) const\n    {\n      return _endY;\n    }\n\n  void startDegrees( double startDegrees_ )\n    {\n      _startDegrees = startDegrees_;\n    }\n  double startDegrees( void ) const\n    {\n      return _startDegrees;\n    }\n\n  void endDegrees( double endDegrees_ )\n    {\n      _endDegrees = endDegrees_;\n    }\n  double endDegrees( void ) const\n    {\n      return _endDegrees;\n    }\n\nprivate:\n  double _startX;\n  double _startY;\n  double _endX;\n  double _endY;\n  double _startDegrees;\n  double _endDegrees;\n};\n\n// Bezier curve (Coordinate list must contain at least three members)\nclass MagickDLLDecl DrawableBezier : public DrawableBase\n{\npublic:\n  // Construct from coordinates\n  DrawableBezier ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  DrawableBezier ( const DrawableBezier& original_ );\n\n  // Destructor\n  /*virtual*/ ~DrawableBezier ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n\n// Pop (terminate) clip path definition\nclass MagickDLLDecl DrawablePopClipPath : public DrawableBase\n{\npublic:\n  DrawablePopClipPath ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~DrawablePopClipPath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n// Push (create) Clip path definition\nclass MagickDLLDecl DrawablePushClipPath : public DrawableBase\n{\npublic:\n  DrawablePushClipPath ( const std::string &id_);\n\n  DrawablePushClipPath ( const DrawablePushClipPath& original_ );\n\n  /*virtual*/ ~DrawablePushClipPath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  std::string _id;\n};\n\n// Named Clip Path\nclass MagickDLLDecl DrawableClipPath : public DrawableBase\n{\npublic:\n  DrawableClipPath ( const std::string &id_ );\n  DrawableClipPath ( const DrawableClipPath& original_ );\n\n  /*virtual*/ ~DrawableClipPath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void clip_path( const std::string &id_ )\n    {\n      _id = id_.c_str(); //multithread safe\n    }\n  std::string clip_path( void ) const\n    {\n      return _id;\n    }\n\nprivate:\n  std::string   _id;\n};\n\n// Circle\nclass MagickDLLDecl DrawableCircle : public DrawableBase\n{\npublic:\n  DrawableCircle ( double originX_, double originY_,\n                   double perimX_, double perimY_ )\n    : _originX(originX_),\n      _originY(originY_),\n      _perimX(perimX_),\n      _perimY(perimY_)\n    {\n    }\n\n  /*virtual*/ ~DrawableCircle ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void originX( double originX_ )\n    {\n      _originX = originX_;\n    }\n  double originX( void ) const\n    {\n      return _originX;\n    }\n\n  void originY( double originY_ )\n    {\n      _originY = originY_;\n    }\n  double originY( void ) const\n    {\n      return _originY;\n    }\n\n  void perimX( double perimX_ )\n    {\n      _perimX = perimX_;\n    }\n  double perimX( void ) const\n    {\n      return _perimX;\n    }\n\n  void perimY( double perimY_ )\n    {\n      _perimY = perimY_;\n    }\n  double perimY( void ) const\n    {\n      return _perimY;\n    }\n\nprivate:\n  double _originX;\n  double _originY;\n  double _perimX;\n  double _perimY;\n};\n\n// Colorize at point using PaintMethod\nclass MagickDLLDecl DrawableColor : public DrawableBase\n{\npublic:\n  DrawableColor ( double x_, double y_,\n                  PaintMethod paintMethod_ )\n    : _x(x_),\n      _y(y_),\n      _paintMethod(paintMethod_)\n    { }\n\n  /*virtual*/ ~DrawableColor ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\n  void paintMethod( PaintMethod paintMethod_ )\n    {\n      _paintMethod = paintMethod_;\n    }\n  PaintMethod paintMethod( void ) const\n    {\n      return _paintMethod;\n    }\n\nprivate:\n  double _x;\n  double _y;\n  PaintMethod _paintMethod;\n};\n\n// Draw image at point, scaled to size specified by width and height\nclass MagickDLLDecl Image;\nclass MagickDLLDecl DrawableCompositeImage : public DrawableBase\n{\npublic:\n  DrawableCompositeImage ( double x_, double y_,\n                           const std::string &filename_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           const Image &image_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           double width_, double height_,\n                           const std::string &filename_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           double width_, double height_,\n                           const Image &image_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           double width_, double height_,\n                           const std::string &filename_,\n                           CompositeOperator composition_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           double width_, double height_,\n                           const Image &image_,\n                           CompositeOperator composition_ );\n\n  // Copy constructor\n  DrawableCompositeImage ( const DrawableCompositeImage& original_ );\n\n  // Destructor\n  /*virtual*/ ~DrawableCompositeImage( void );\n\n  // Assignment operator\n  DrawableCompositeImage& operator=\n  (const DrawableCompositeImage& original_ );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void composition( CompositeOperator composition_ )\n    {\n      _composition = composition_;\n    }\n  CompositeOperator composition( void ) const\n    {\n      return _composition;\n    }\n\n  void filename( const std::string &image_ );\n  std::string filename( void ) const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\n  void width( double width_ )\n    {\n      _width = width_;\n    }\n  double width( void ) const\n    {\n      return _width;\n    }\n\n  void height( double height_ )\n    {\n      _height = height_;\n    }\n  double height( void ) const\n    {\n      return _height;\n    }\n\n  void image( const Image &image_ );\n  Magick::Image image( void ) const;\n\n  // Specify image format used to output Base64 inlined image data.\n  void magick( std::string magick_ );\n  std::string magick( void );\n\nprivate:\n  CompositeOperator  _composition;\n  double             _x;\n  double             _y;\n  double             _width;\n  double             _height;\n  Image*             _image;\n};\n\n// Ellipse\nclass MagickDLLDecl DrawableEllipse : public DrawableBase\n{\npublic:\n  DrawableEllipse ( double originX_, double originY_,\n                    double radiusX_, double radiusY_,\n                    double arcStart_, double arcEnd_ )\n    : _originX(originX_),\n      _originY(originY_),\n      _radiusX(radiusX_),\n      _radiusY(radiusY_),\n      _arcStart(arcStart_),\n      _arcEnd(arcEnd_)\n    { }\n\n  /*virtual*/ ~DrawableEllipse( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void originX( double originX_ )\n    {\n      _originX = originX_;\n    }\n  double originX( void ) const\n    {\n      return _originX;\n    }\n\n  void originY( double originY_ )\n    {\n      _originY = originY_;\n    }\n  double originY( void ) const\n    {\n      return _originY;\n    }\n\n  void radiusX( double radiusX_ )\n    {\n      _radiusX = radiusX_;\n    }\n  double radiusX( void ) const\n    {\n      return _radiusX;\n    }\n\n  void radiusY( double radiusY_ )\n    {\n      _radiusY = radiusY_;\n    }\n  double radiusY( void ) const\n    {\n      return _radiusY;\n    }\n\n  void arcStart( double arcStart_ )\n    {\n      _arcStart = arcStart_;\n    }\n  double arcStart( void ) const\n    {\n      return _arcStart;\n    }\n\n  void arcEnd( double arcEnd_ )\n    {\n      _arcEnd = arcEnd_;\n    }\n  double arcEnd( void ) const\n    {\n      return _arcEnd;\n    }\n\nprivate:\n  double _originX;\n  double _originY;\n  double _radiusX;\n  double _radiusY;\n  double _arcStart;\n  double _arcEnd;\n};\n\n// Specify drawing fill color\nclass MagickDLLDecl DrawableFillColor : public DrawableBase\n{\npublic:\n  DrawableFillColor ( const Color &color_ );\n\n  DrawableFillColor ( const DrawableFillColor& original_ );\n\n  /*virtual*/ ~DrawableFillColor( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void color( const Color &color_ )\n    {\n      _color = color_;\n    }\n  Color color( void ) const\n    {\n      return _color;\n    }\n\nprivate:\n  Color _color;\n};\n\n// Specify fill rule (fill-rule)\nclass MagickDLLDecl DrawableFillRule : public DrawableBase\n{\npublic:\n  DrawableFillRule ( const FillRule fillRule_ )\n    : _fillRule(fillRule_)\n    {\n    }\n\n  /*virtual*/ ~DrawableFillRule ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void fillRule( const FillRule fillRule_ )\n    {\n      _fillRule = fillRule_;\n    }\n  FillRule fillRule( void ) const\n    {\n      return _fillRule;\n    }\n\nprivate:\n  FillRule _fillRule;\n};\n\n// Specify drawing fill opacity\nclass MagickDLLDecl DrawableFillOpacity : public DrawableBase\n{\npublic:\n  DrawableFillOpacity ( double opacity_ )\n    : _opacity(opacity_)\n    {\n    }\n\n  /*virtual*/ ~DrawableFillOpacity ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void opacity( double opacity_ )\n    {\n      _opacity = opacity_;\n    }\n  double opacity( void ) const\n    {\n      return _opacity;\n    }\n\nprivate:\n  double _opacity;\n};\n\n// Specify text font\nclass MagickDLLDecl DrawableFont : public DrawableBase\n{\npublic:\n  DrawableFont ( const std::string &font_ );\n\n  DrawableFont ( const std::string &family_,\n                 StyleType style_,\n                 const unsigned long weight_,\n                 StretchType stretch_ );\n  DrawableFont ( const DrawableFont& original_ );\n\n  /*virtual*/ ~DrawableFont ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void font( const std::string &font_ )\n    {\n      _font = font_;\n    }\n  std::string font( void ) const\n    {\n      return _font;\n    }\n\nprivate:\n  std::string   _font;\n  std::string   _family;\n  StyleType     _style;\n  unsigned long _weight;\n  StretchType   _stretch;\n};\n\n// Specify text positioning gravity\nclass MagickDLLDecl DrawableGravity : public DrawableBase\n{\npublic:\n  DrawableGravity ( GravityType gravity_ )\n    : _gravity(gravity_)\n    {\n    }\n\n  /*virtual*/ ~DrawableGravity ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void gravity( GravityType gravity_ )\n    {\n      _gravity = gravity_;\n    }\n  GravityType gravity( void ) const\n    {\n      return _gravity;\n    }\n\nprivate:\n  GravityType _gravity;\n};\n\n// Line\nclass MagickDLLDecl DrawableLine : public DrawableBase\n{\npublic:\n  DrawableLine ( double startX_, double startY_,\n                 double endX_, double endY_ )\n    : _startX(startX_),\n      _startY(startY_),\n      _endX(endX_),\n      _endY(endY_)\n    { }\n\n  /*virtual*/ ~DrawableLine ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void startX( double startX_ )\n    {\n      _startX = startX_;\n    }\n  double startX( void ) const\n    {\n      return _startX;\n    }\n\n  void startY( double startY_ )\n    {\n      _startY = startY_;\n    }\n  double startY( void ) const\n    {\n      return _startY;\n    }\n\n  void endX( double endX_ )\n    {\n      _endX = endX_;\n    }\n  double endX( void ) const\n    {\n      return _endX;\n    }\n\n  void endY( double endY_ )\n    {\n      _endY = endY_;\n    }\n  double endY( void ) const\n    {\n      return _endY;\n    }\n\nprivate:\n  double _startX;\n  double _startY;\n  double _endX;\n  double _endY;\n};\n\n// Change pixel matte value to transparent using PaintMethod\nclass MagickDLLDecl DrawableMatte : public DrawableBase\n{\npublic:\n  DrawableMatte ( double x_, double y_,\n                  PaintMethod paintMethod_ )\n    : _x(x_),\n      _y(y_),\n      _paintMethod(paintMethod_)\n    { }\n\n  /*virtual*/ ~DrawableMatte ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\n  void paintMethod( PaintMethod paintMethod_ )\n    {\n      _paintMethod = paintMethod_;\n    }\n  PaintMethod paintMethod( void ) const\n    {\n      return _paintMethod;\n    }\n\nprivate:\n  double _x;\n  double _y;\n  PaintMethod _paintMethod;\n};\n\n// Drawable Path\nclass MagickDLLDecl DrawablePath : public DrawableBase\n{\npublic:\n  DrawablePath ( const VPathList &path_ );\n\n  DrawablePath ( const DrawablePath& original_ );\n\n  /*virtual*/ ~DrawablePath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  VPathList _path;\n};\n\n// Point\nclass MagickDLLDecl DrawablePoint : public DrawableBase\n{\npublic:\n  DrawablePoint ( double x_, double y_ )\n    : _x(x_),\n      _y(y_)\n    { }\n\n  /*virtual*/ ~DrawablePoint ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _x;\n  double _y;\n};\n\n// Text pointsize\nclass MagickDLLDecl DrawablePointSize : public DrawableBase\n{\npublic:\n  DrawablePointSize ( double pointSize_ )\n    : _pointSize(pointSize_)\n    { }\n\n  /*virtual*/ ~DrawablePointSize ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void pointSize( double pointSize_ )\n    {\n      _pointSize = pointSize_;\n    }\n  double pointSize( void ) const\n    {\n      return _pointSize;\n    }\n\nprivate:\n  double _pointSize;\n};\n\n// Polygon (Coordinate list must contain at least three members)\nclass MagickDLLDecl DrawablePolygon : public DrawableBase\n{\npublic:\n  DrawablePolygon ( const CoordinateList &coordinates_ );\n\n  DrawablePolygon ( const DrawablePolygon& original_ );\n\n  /*virtual*/ ~DrawablePolygon ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n// Polyline (Coordinate list must contain at least three members)\nclass MagickDLLDecl DrawablePolyline : public DrawableBase\n{\npublic:\n  DrawablePolyline ( const CoordinateList &coordinates_ );\n\n  DrawablePolyline ( const DrawablePolyline& original_ );\n\n  /*virtual*/ ~DrawablePolyline ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n// Pop Graphic Context\nclass MagickDLLDecl DrawablePopGraphicContext : public DrawableBase\n{\npublic:\n  DrawablePopGraphicContext ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~DrawablePopGraphicContext ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n// Push Graphic Context\nclass MagickDLLDecl DrawablePushGraphicContext : public DrawableBase\n{\npublic:\n  DrawablePushGraphicContext ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~DrawablePushGraphicContext ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n// Pop (terminate) Pattern definition\nclass MagickDLLDecl DrawablePopPattern : public DrawableBase\n{\npublic:\n  DrawablePopPattern ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~DrawablePopPattern ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n// Push (create) Pattern definition\nclass MagickDLLDecl DrawablePushPattern : public DrawableBase\n{\npublic:\n  DrawablePushPattern ( const std::string &id_, long x_, long y_,\n                        long width_, long height_ );\n\n  DrawablePushPattern ( const DrawablePushPattern& original_ );\n\n  /*virtual*/ ~DrawablePushPattern ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  std::string         _id;\n  long          _x;\n  long          _y;\n  long          _width;\n  long          _height;\n};\n\n// Rectangle\nclass MagickDLLDecl DrawableRectangle : public DrawableBase\n{\npublic:\n  DrawableRectangle ( double upperLeftX_, double upperLeftY_,\n                      double lowerRightX_, double lowerRightY_ )\n    : _upperLeftX(upperLeftX_),\n      _upperLeftY(upperLeftY_),\n      _lowerRightX(lowerRightX_),\n      _lowerRightY(lowerRightY_)\n    { }\n\n  /*virtual*/ ~DrawableRectangle ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void upperLeftX( double upperLeftX_ )\n    {\n      _upperLeftX = upperLeftX_;\n    }\n  double upperLeftX( void ) const\n    {\n      return _upperLeftX;\n    }\n\n  void upperLeftY( double upperLeftY_ )\n    {\n      _upperLeftY = upperLeftY_;\n    }\n  double upperLeftY( void ) const\n    {\n      return _upperLeftY;\n    }\n\n  void lowerRightX( double lowerRightX_ )\n    {\n      _lowerRightX = lowerRightX_;\n    }\n  double lowerRightX( void ) const\n    {\n      return _lowerRightX;\n    }\n\n  void lowerRightY( double lowerRightY_ )\n    {\n      _lowerRightY = lowerRightY_;\n    }\n  double lowerRightY( void ) const\n    {\n      return _lowerRightY;\n    }\n\nprivate:\n  double _upperLeftX;\n  double _upperLeftY;\n  double _lowerRightX;\n  double _lowerRightY;\n};\n\n// Apply Rotation\nclass MagickDLLDecl DrawableRotation : public DrawableBase\n{\npublic:\n  DrawableRotation ( double angle_ )\n    : _angle( angle_ )\n    { }\n\n  /*virtual*/ ~DrawableRotation ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void angle( double angle_ )\n    {\n      _angle = angle_;\n    }\n  double angle( void ) const\n    {\n      return _angle;\n    }\n\nprivate:\n  double _angle;\n};\n\n// Round Rectangle\nclass MagickDLLDecl DrawableRoundRectangle : public DrawableBase\n{\npublic:\n  DrawableRoundRectangle ( double centerX_, double centerY_,\n                           double width_, double hight_,\n                           double cornerWidth_, double cornerHeight_ )\n    : _centerX(centerX_),\n      _centerY(centerY_),\n      _width(width_),\n      _hight(hight_),\n      _cornerWidth(cornerWidth_),\n      _cornerHeight(cornerHeight_)\n    { }\n\n  /*virtual*/ ~DrawableRoundRectangle ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void centerX( double centerX_ )\n    {\n      _centerX = centerX_;\n    }\n  double centerX( void ) const\n    {\n      return _centerX;\n    }\n\n  void centerY( double centerY_ )\n    {\n      _centerY = centerY_;\n    }\n  double centerY( void ) const\n    {\n      return _centerY;\n    }\n\n  void width( double width_ )\n    {\n      _width = width_;\n    }\n  double width( void ) const\n    {\n      return _width;\n    }\n\n  void hight( double hight_ )\n    {\n      _hight = hight_;\n    }\n  double hight( void ) const\n    {\n      return _hight;\n    }\n\n  void cornerWidth( double cornerWidth_ )\n    {\n      _cornerWidth = cornerWidth_;\n    }\n  double cornerWidth( void ) const\n    {\n      return _cornerWidth;\n    }\n\n  void cornerHeight( double cornerHeight_ )\n    {\n      _cornerHeight = cornerHeight_;\n    }\n  double cornerHeight( void ) const\n    {\n      return _cornerHeight;\n    }\n\nprivate:\n  double _centerX;\n  double _centerY;\n  double _width;\n  double _hight;\n  double _cornerWidth;\n  double _cornerHeight;\n};\n\n// Apply Scaling\nclass MagickDLLDecl DrawableScaling : public DrawableBase\n{\npublic:\n  DrawableScaling ( double x_, double y_ )\n    : _x(x_),\n      _y(y_)\n    { }\n\n  /*virtual*/ ~DrawableScaling ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _x;\n  double _y;\n};\n\n// Apply Skew in X direction\nclass MagickDLLDecl DrawableSkewX : public DrawableBase\n{\npublic:\n  DrawableSkewX ( double angle_ )\n    : _angle(angle_)\n    { }\n\n  /*virtual*/ ~DrawableSkewX ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void angle( double angle_ )\n    {\n      _angle = angle_;\n    }\n  double angle( void ) const\n    {\n      return _angle;\n    }\n\nprivate:\n  double _angle;\n};\n\n// Apply Skew in Y direction\nclass MagickDLLDecl DrawableSkewY : public DrawableBase\n{\npublic:\n  DrawableSkewY ( double angle_ )\n    : _angle(angle_)\n    { }\n\n  /*virtual*/ ~DrawableSkewY ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void angle( double angle_ )\n    {\n      _angle = angle_;\n    }\n  double angle( void ) const\n    {\n      return _angle;\n    }\n\nprivate:\n  double _angle;\n};\n\n// Stroke dasharray\n//\n// dasharray_ is an allocated array terminated by value 0.0 or 0.\n// The array is copied so the original does not need to be preserved.\n// Pass a null pointer to clear an existing dash array setting.\nclass MagickDLLDecl DrawableDashArray : public DrawableBase\n{\npublic:\n  DrawableDashArray( const double* dasharray_ );\n  DrawableDashArray( const unsigned int* dasharray_ ); // Deprecated\n  DrawableDashArray( const Magick::DrawableDashArray &original_ );\n\n  /*virtual*/ ~DrawableDashArray( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void dasharray( const double* dasharray_ );\n  void dasharray( const unsigned int* dasharray_ ); // Deprecated\n\n  const double* dasharray( void ) const\n    {\n      return _dasharray;\n    }\n\n  DrawableDashArray& operator=(const Magick::DrawableDashArray &original_);\n\nprivate:\n  size_t        _size;\n  double       *_dasharray;\n};\n\n// Stroke dashoffset\nclass MagickDLLDecl DrawableDashOffset : public DrawableBase\n{\npublic:\n  DrawableDashOffset ( const double offset_ )\n    : _offset(offset_)\n    { }\n\n  /*virtual*/ ~DrawableDashOffset ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void offset( const double offset_ )\n    {\n      _offset = offset_;\n    }\n  double offset( void ) const\n    {\n      return _offset;\n    }\n\nprivate:\n  double _offset;\n};\n\n// Stroke linecap\nclass MagickDLLDecl DrawableStrokeLineCap : public DrawableBase\n{\npublic:\n  DrawableStrokeLineCap ( LineCap linecap_ )\n    : _linecap(linecap_)\n    { }\n\n  /*virtual*/ ~DrawableStrokeLineCap ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void linecap( LineCap linecap_ )\n    {\n      _linecap = linecap_;\n    }\n  LineCap linecap( void ) const\n    {\n      return _linecap;\n    }\n\nprivate:\n  LineCap _linecap;\n};\n\n// Stroke linejoin\nclass MagickDLLDecl DrawableStrokeLineJoin : public DrawableBase\n{\npublic:\n  DrawableStrokeLineJoin ( LineJoin linejoin_ )\n    : _linejoin(linejoin_)\n    { }\n\n  /*virtual*/ ~DrawableStrokeLineJoin ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void linejoin( LineJoin linejoin_ )\n    {\n      _linejoin = linejoin_;\n    }\n  LineJoin linejoin( void ) const\n    {\n      return _linejoin;\n    }\n\nprivate:\n  LineJoin _linejoin;\n};\n\n// Stroke miterlimit\nclass MagickDLLDecl DrawableMiterLimit : public DrawableBase\n{\npublic:\n  DrawableMiterLimit ( unsigned int miterlimit_ )\n    : _miterlimit(miterlimit_)\n    { }\n\n  /*virtual*/ ~DrawableMiterLimit ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void miterlimit( unsigned int miterlimit_ )\n    {\n      _miterlimit = miterlimit_;\n    }\n  unsigned int miterlimit( void ) const\n    {\n      return _miterlimit;\n    }\n\nprivate:\n  unsigned int _miterlimit;\n};\n\n\n// Stroke antialias\nclass MagickDLLDecl DrawableStrokeAntialias : public DrawableBase\n{\npublic:\n  DrawableStrokeAntialias ( bool flag_ )\n    : _flag(flag_)\n    { }\n\n  /*virtual*/ ~DrawableStrokeAntialias ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void flag( bool flag_ )\n    {\n      _flag = flag_;\n    }\n  bool flag( void ) const\n    {\n      return _flag;\n    }\n\nprivate:\n  bool _flag;\n};\n\n// Stroke color\nclass MagickDLLDecl DrawableStrokeColor : public DrawableBase\n{\npublic:\n  DrawableStrokeColor ( const Color &color_ );\n\n  DrawableStrokeColor ( const DrawableStrokeColor& original_ );\n\n  /*virtual*/ ~DrawableStrokeColor ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void color( const Color& color_ )\n    {\n      _color = color_;\n    }\n  Color color( void ) const\n    {\n      return _color;\n    }\n\nprivate:\n  Color _color;\n};\n\n// Stroke opacity\nclass MagickDLLDecl DrawableStrokeOpacity : public DrawableBase\n{\npublic:\n  DrawableStrokeOpacity ( double opacity_ )\n    : _opacity(opacity_)\n    {\n    }\n\n  /*virtual*/ ~DrawableStrokeOpacity ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void opacity( double opacity_ )\n    {\n      _opacity = opacity_;\n    }\n  double opacity( void ) const\n    {\n      return _opacity;\n    }\n\nprivate:\n  double _opacity;\n};\n\n// Stroke width\nclass MagickDLLDecl DrawableStrokeWidth : public DrawableBase\n{\npublic:\n  DrawableStrokeWidth ( double width_ )\n    : _width(width_)\n    { }\n\n  /*virtual*/ ~DrawableStrokeWidth ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void width( double width_ )\n    {\n      _width = width_;\n    }\n  double width( void ) const\n    {\n      return _width;\n    }\n\nprivate:\n  double _width;\n};\n\n// Draw text at point\nclass MagickDLLDecl DrawableText : public DrawableBase\n{\npublic:\n  DrawableText ( const double x_, const double y_,\n                 const std::string &text_ );\n  DrawableText ( const double x_, const double y_,\n                 const std::string &text_, const std::string &encoding_);\n\n  DrawableText ( const DrawableText& original_ );\n\n  /*virtual*/ ~DrawableText ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void encoding(const std::string &encoding_)\n    {\n      _encoding = encoding_;\n    }\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\n  void text( const std::string &text_ )\n    {\n      _text = text_;\n    }\n  std::string text( void ) const\n    {\n      return _text;\n    }\n\nprivate:\n  double      _x;\n  double      _y;\n  std::string _text;\n  std::string _encoding;\n};\n\n// Text antialias\nclass MagickDLLDecl DrawableTextAntialias : public DrawableBase\n{\npublic:\n  DrawableTextAntialias ( bool flag_ );\n\n  DrawableTextAntialias( const DrawableTextAntialias &original_ );\n\n  /*virtual*/ ~DrawableTextAntialias ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void flag( bool flag_ )\n    {\n      _flag = flag_;\n    }\n  bool flag( void ) const\n    {\n      return _flag;\n    }\n\nprivate:\n  bool _flag;\n};\n\n// Decoration (text decoration)\nclass MagickDLLDecl DrawableTextDecoration : public DrawableBase\n{\npublic:\n  DrawableTextDecoration ( DecorationType decoration_ );\n\n  DrawableTextDecoration ( const DrawableTextDecoration& original_ );\n\n  /*virtual*/ ~DrawableTextDecoration( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/  void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void decoration( DecorationType decoration_ )\n    {\n      _decoration = decoration_;\n    }\n  DecorationType decoration( void ) const\n    {\n      return _decoration;\n    }\n\nprivate:\n  DecorationType _decoration;\n};\n\n// Text undercolor box\nclass MagickDLLDecl DrawableTextUnderColor : public DrawableBase\n{\npublic:\n  DrawableTextUnderColor ( const Color &color_ );\n\n  DrawableTextUnderColor ( const DrawableTextUnderColor& original_ );\n\n  /*virtual*/ ~DrawableTextUnderColor ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void color( const Color& color_ )\n    {\n      _color = color_;\n    }\n  Color color( void ) const\n    {\n      return _color;\n    }\n\nprivate:\n  Color _color;\n};\n\n// Apply Translation\nclass MagickDLLDecl DrawableTranslation : public DrawableBase\n{\npublic:\n  DrawableTranslation ( double x_, double y_ )\n    : _x(x_),\n      _y(y_)\n    { }\n\n  /*virtual*/ ~DrawableTranslation ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _x;\n  double _y;\n};\n\n// Set the size of the viewbox\nclass MagickDLLDecl DrawableViewbox : public DrawableBase\n{\npublic:\n  DrawableViewbox(unsigned long x1_, unsigned long y1_,\n                  unsigned long x2_, unsigned long y2_)\n    : _x1(x1_),\n      _y1(y1_),\n      _x2(x2_),\n      _y2(y2_) { }\n\n  /*virtual*/ ~DrawableViewbox ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/\n  DrawableBase* copy() const;\n\n  void x1( unsigned long x1_ )\n    {\n      _x1 = x1_;\n    }\n  unsigned long x1( void ) const\n    {\n      return _x1;\n    }\n\n  void y1( unsigned long y1_ )\n    {\n      _y1 = y1_;\n    }\n  unsigned long y1( void ) const\n    {\n      return _y1;\n    }\n\n  void x2( unsigned long x2_ )\n    {\n      _x2 = x2_;\n    }\n  unsigned long x2( void ) const\n    {\n      return _x2;\n    }\n\n  void y2( unsigned long y2_ )\n    {\n      _y2 = y2_;\n    }\n  unsigned long y2( void ) const\n    {\n      return _y2;\n    }\n\nprivate:\n  unsigned long _x1;\n  unsigned long _y1;\n  unsigned long _x2;\n  unsigned long _y2;\n};\n\n//\n// Path Element Classes To Support DrawablePath\n//\nclass MagickDLLDecl PathArcArgs\n{\npublic:\n  // Default constructor\n  PathArcArgs( void );\n\n  // Path arc argument\n  PathArcArgs( double radiusX_, double radiusY_,\n               double xAxisRotation_, bool largeArcFlag_,\n               bool sweepFlag_, double x_, double y_ );\n\n  PathArcArgs( const PathArcArgs &original_ );\n\n  ~PathArcArgs ( void );\n\n  void radiusX( double radiusX_ )\n    {\n      _radiusX = radiusX_;\n    }\n  double radiusX( void ) const\n    {\n      return _radiusX;\n    }\n\n  void radiusY( double radiusY_ )\n    {\n      _radiusY = radiusY_;\n    }\n  double radiusY( void ) const\n    {\n      return _radiusY;\n    }\n\n  void xAxisRotation( double xAxisRotation_ )\n    {\n      _xAxisRotation = xAxisRotation_;\n    }\n  double xAxisRotation( void ) const\n    {\n      return _xAxisRotation;\n    }\n\n  void largeArcFlag( bool largeArcFlag_ )\n    {\n      _largeArcFlag = largeArcFlag_;\n    }\n  bool largeArcFlag( void ) const\n    {\n      return _largeArcFlag;\n    }\n\n  void sweepFlag( bool sweepFlag_ )\n    {\n      _sweepFlag = sweepFlag_;\n    }\n  bool sweepFlag( void ) const\n    {\n      return _sweepFlag;\n    }\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double        _radiusX;       // X radius\n  double        _radiusY;       // Y radius\n  double        _xAxisRotation; // Rotation relative to X axis\n  bool        _largeArcFlag;    // Draw longer of the two matching arcs\n  bool        _sweepFlag;       // Draw arc matching clock-wise rotation\n  double        _x;             // End-point X\n  double        _y;             // End-point Y\n};\n\n// Compare two PathArcArgs objects regardless of LHS/RHS\nMagickDLLDeclExtern int operator == ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator != ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator >  ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator <  ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator >= ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator <= ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\n\ntypedef std::list<Magick::PathArcArgs> PathArcArgsList;\n\n#if defined(MagickDLLExplicitTemplate)\n\nMagickDrawableExtern template class MagickDLLDecl\nstd::allocator<Magick::PathArcArgs>;\n\n// MagickDrawableExtern template class MagickDLLDecl\n// std::list<Magick::PathArcArgs, std::allocator<Magick::PathArcArgs> >;\n\n#endif // MagickDLLExplicitTemplate\n\n// Path Arc (Elliptical Arc)\nclass MagickDLLDecl PathArcAbs : public VPathBase\n{\npublic:\n  // Draw a single arc segment\n  PathArcAbs ( const PathArcArgs &coordinates_ );\n\n  // Draw multiple arc segments\n  PathArcAbs ( const PathArcArgsList &coordinates_ );\n\n  // Copy constructor\n  PathArcAbs ( const PathArcAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathArcAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathArcArgsList _coordinates;\n};\nclass MagickDLLDecl PathArcRel : public VPathBase\n{\npublic:\n  // Draw a single arc segment\n  PathArcRel ( const PathArcArgs &coordinates_ );\n\n  // Draw multiple arc segments\n  PathArcRel ( const PathArcArgsList &coordinates_ );\n\n  PathArcRel ( const PathArcRel& original_ );\n\n  /*virtual*/ ~PathArcRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathArcArgsList _coordinates;\n};\n\n// Path Closepath\nclass MagickDLLDecl PathClosePath : public VPathBase\n{\npublic:\n  PathClosePath ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~PathClosePath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n//\n// Curveto (Cubic Bezier)\n//\nclass MagickDLLDecl PathCurvetoArgs\n{\npublic:\n  PathCurvetoArgs( void );\n\n  PathCurvetoArgs( double x1_, double y1_,\n                   double x2_, double y2_,\n                   double x_, double y_ );\n\n  PathCurvetoArgs( const PathCurvetoArgs &original_ );\n\n  ~PathCurvetoArgs ( void );\n\n  void x1( double x1_ )\n    {\n      _x1 = x1_;\n    }\ndouble x1( void ) const\n{\n  return _x1;\n}\n\nvoid y1( double y1_ )\n{\n  _y1 = y1_;\n}\ndouble y1( void ) const\n{\n  return _y1;\n}\n\nvoid x2( double x2_ )\n{\n  _x2 = x2_;\n}\ndouble x2( void ) const\n{\n  return _x2;\n}\n\nvoid y2( double y2_ )\n{\n  _y2 = y2_;\n}\ndouble y2( void ) const\n{\n  return _y2;\n}\n\nvoid x( double x_ )\n{\n  _x = x_;\n}\ndouble x( void ) const\n{\n  return _x;\n}\n\nvoid y( double y_ )\n{\n  _y = y_;\n}\ndouble y( void ) const\n{\n  return _y;\n}\n\nprivate:\ndouble _x1;\ndouble _y1;\ndouble _x2;\ndouble _y2;\ndouble _x;\ndouble _y;\n};\n\n// Compare two PathCurvetoArgs objects regardless of LHS/RHS\nMagickDLLDeclExtern int operator == ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator != ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator >  ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator <  ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator >= ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator <= ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\n\ntypedef std::list<Magick::PathCurvetoArgs> PathCurveToArgsList;\n\n#if defined(MagickDLLExplicitTemplate)\n\nMagickDrawableExtern template class MagickDLLDecl\nstd::allocator<Magick::PathCurvetoArgs>;\n\n// MagickDrawableExtern template class MagickDLLDecl\n// std::list<Magick::PathCurvetoArgs, std::allocator<Magick::PathCurvetoArgs> >;\n\n#endif // MagickDLLExplicitTemplate\n\nclass MagickDLLDecl PathCurvetoAbs : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathCurvetoAbs ( const PathCurvetoArgs &args_ );\n\n  // Draw multiple curves\n  PathCurvetoAbs ( const PathCurveToArgsList &args_ );\n\n  // Copy constructor\n  PathCurvetoAbs ( const PathCurvetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathCurvetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathCurveToArgsList _args;\n};\nclass MagickDLLDecl PathCurvetoRel : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathCurvetoRel ( const PathCurvetoArgs &args_ );\n\n  // Draw multiple curves\n  PathCurvetoRel ( const PathCurveToArgsList &args_ );\n\n  // Copy constructor\n  PathCurvetoRel ( const PathCurvetoRel& original_ );\n\n  /*virtual*/ ~PathCurvetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathCurveToArgsList _args;\n};\nclass MagickDLLDecl PathSmoothCurvetoAbs : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathSmoothCurvetoAbs ( const Magick::Coordinate &coordinates_ );\n\n  // Draw multiple curves\n  PathSmoothCurvetoAbs ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathSmoothCurvetoAbs ( const PathSmoothCurvetoAbs& original_ );\n\n  /*virtual*/ ~PathSmoothCurvetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/\n  VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\nclass MagickDLLDecl PathSmoothCurvetoRel : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathSmoothCurvetoRel ( const Coordinate &coordinates_ );\n\n  // Draw multiple curves\n  PathSmoothCurvetoRel ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathSmoothCurvetoRel ( const PathSmoothCurvetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathSmoothCurvetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/\n  VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n//\n// Quadratic Curveto (Quadratic Bezier)\n//\nclass MagickDLLDecl PathQuadraticCurvetoArgs\n{\npublic:\n  // Default constructor\n  PathQuadraticCurvetoArgs( void );\n\n  // Parameterized constructor\n  PathQuadraticCurvetoArgs( double x1_, double y1_,\n                            double x_, double y_ );\n\n  // Copy constructor\n  PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ );\n\n  ~PathQuadraticCurvetoArgs ( void );\n\n  void x1( double x1_ )\n    {\n      _x1 = x1_;\n    }\n  double x1( void ) const\n    {\n      return _x1;\n    }\n\n  void y1( double y1_ )\n    {\n      _y1 = y1_;\n    }\n  double y1( void ) const\n    {\n      return _y1;\n    }\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _x1;\n  double _y1;\n  double _x;\n  double _y;\n};\n\n// Compare two PathQuadraticCurvetoArgs objects regardless of LHS/RHS\nMagickDLLDeclExtern int operator == ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator != ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_);\nMagickDLLDeclExtern int operator >  ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_);\nMagickDLLDeclExtern int operator <  ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_);\nMagickDLLDeclExtern int operator >= ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator <= ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_ );\n\ntypedef std::list<Magick::PathQuadraticCurvetoArgs> PathQuadraticCurvetoArgsList;\n\n#if defined(MagickDLLExplicitTemplate)\n\nMagickDrawableExtern template class MagickDLLDecl\nstd::allocator<Magick::PathQuadraticCurvetoArgs>;\n\n// MagickDrawableExtern template class MagickDLLDecl\n// std::list<Magick::PathQuadraticCurvetoArgs, std::allocator<Magick::PathQuadraticCurvetoArgs> >;\n\n#endif // MagickDLLExplicitTemplate\n\nclass MagickDLLDecl PathQuadraticCurvetoAbs : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathQuadraticCurvetoAbs ( const Magick::PathQuadraticCurvetoArgs &args_ );\n\n  // Draw multiple curves\n  PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoArgsList &args_ );\n\n  // Copy constructor\n  PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathQuadraticCurvetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathQuadraticCurvetoArgsList _args;\n};\nclass MagickDLLDecl PathQuadraticCurvetoRel : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathQuadraticCurvetoRel ( const Magick::PathQuadraticCurvetoArgs &args_ );\n\n  // Draw multiple curves\n  PathQuadraticCurvetoRel ( const PathQuadraticCurvetoArgsList &args_ );\n\n  // Copy constructor\n  PathQuadraticCurvetoRel ( const PathQuadraticCurvetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathQuadraticCurvetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathQuadraticCurvetoArgsList _args;\n};\nclass MagickDLLDecl PathSmoothQuadraticCurvetoAbs : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathSmoothQuadraticCurvetoAbs ( const Magick::Coordinate &coordinate_ );\n\n  // Draw multiple curves\n  PathSmoothQuadraticCurvetoAbs ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathSmoothQuadraticCurvetoAbs ( const PathSmoothQuadraticCurvetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathSmoothQuadraticCurvetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\nclass MagickDLLDecl PathSmoothQuadraticCurvetoRel : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathSmoothQuadraticCurvetoRel ( const Magick::Coordinate &coordinate_ );\n\n  // Draw multiple curves\n  PathSmoothQuadraticCurvetoRel ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathSmoothQuadraticCurvetoRel ( const PathSmoothQuadraticCurvetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathSmoothQuadraticCurvetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n//\n// Path Lineto\n//\nclass MagickDLLDecl PathLinetoAbs : public VPathBase\n{\npublic:\n  // Draw to a single point\n  PathLinetoAbs ( const Magick::Coordinate& coordinate_  );\n\n  // Draw to multiple points\n  PathLinetoAbs ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathLinetoAbs ( const PathLinetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathLinetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\nclass MagickDLLDecl PathLinetoRel : public VPathBase\n{\npublic:\n  // Draw to a single point\n  PathLinetoRel ( const Magick::Coordinate& coordinate_ );\n\n  // Draw to multiple points\n  PathLinetoRel ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathLinetoRel ( const PathLinetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathLinetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n// Path Horizontal Lineto\nclass MagickDLLDecl PathLinetoHorizontalAbs : public VPathBase\n{\npublic:\n  PathLinetoHorizontalAbs ( double x_ )\n    : _x(x_)\n    {\n    }\n\n  /*virtual*/ ~PathLinetoHorizontalAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\nprivate:\n  double _x;\n};\nclass MagickDLLDecl PathLinetoHorizontalRel : public VPathBase\n{\npublic:\n  PathLinetoHorizontalRel ( double x_ )\n    : _x(x_)\n    {\n    }\n\n  /*virtual*/ ~PathLinetoHorizontalRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\nprivate:\n  double _x;\n};\n\n// Path Vertical Lineto\nclass MagickDLLDecl PathLinetoVerticalAbs : public VPathBase\n{\npublic:\n  PathLinetoVerticalAbs ( double y_ )\n    : _y(y_)\n    {\n    }\n\n  /*virtual*/ ~PathLinetoVerticalAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _y;\n};\nclass MagickDLLDecl PathLinetoVerticalRel : public VPathBase\n{\npublic:\n  PathLinetoVerticalRel ( double y_ )\n    : _y(y_)\n    {\n    }\n\n  /*virtual*/ ~PathLinetoVerticalRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _y;\n};\n\n// Path Moveto\nclass MagickDLLDecl PathMovetoAbs : public VPathBase\n{\npublic:\n  // Simple moveto\n  PathMovetoAbs ( const Magick::Coordinate &coordinate_ );\n\n  // Moveto followed by implicit linetos\n  PathMovetoAbs ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathMovetoAbs ( const PathMovetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathMovetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\nclass MagickDLLDecl PathMovetoRel : public VPathBase\n{\npublic:\n  // Simple moveto\n  PathMovetoRel ( const Magick::Coordinate &coordinate_ );\n\n  // Moveto followed by implicit linetos\n  PathMovetoRel ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathMovetoRel ( const PathMovetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathMovetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n#if defined(__clang__)\n#pragma clang diagnostic pop\n#endif /* if defined(__clang__) */\n\n} // namespace Magick\n\n#endif // Magick_Drawable_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/Exception.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003\n//\n// Definition of Magick::Exception and derived classes\n// Magick::Warning* and Magick::Error*.  Derived from C++ STD\n// 'exception' class for convenience.\n//\n// These classes form part of the Magick++ user interface.\n//\n\n#if !defined(Magick_Exception_header)\n#define Magick_Exception_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n#include <exception>\n\nnamespace Magick\n{\n  class MagickDLLDecl Exception : public std::exception\n  {\n  public:\n    Exception( const std::string& what_ );\n    Exception( const Exception& original_ );\n    Exception& operator= (const Exception& original_ );\n    virtual const char* what () const throw();\n    virtual ~Exception ( ) throw ();\n\n  private:\n    std::string _what;\n  };\n\n  //\n  // Warnings\n  //\n\n  class MagickDLLDecl Warning : public Exception\n  {\n  public:\n    explicit Warning ( const std::string& what_ );\n    ~Warning() throw ();\n  };\n\n  class MagickDLLDecl WarningUndefined : public Warning\n  {\n  public:\n    explicit WarningUndefined ( const std::string& what_ );\n    ~WarningUndefined() throw ();\n  };\n\n  class MagickDLLDecl WarningBlob: public Warning\n  {\n  public:\n    explicit WarningBlob ( const std::string& what_ );\n    ~WarningBlob() throw ();\n  };\n\n  class MagickDLLDecl WarningCache: public Warning\n  {\n  public:\n    explicit WarningCache ( const std::string& what_ );\n    ~WarningCache() throw ();\n  };\n\n  class MagickDLLDecl WarningCoder: public Warning\n  {\n  public:\n    explicit WarningCoder ( const std::string& what_ );\n    ~WarningCoder() throw ();\n  };\n\n  class MagickDLLDecl WarningConfigure: public Warning\n  {\n  public:\n    explicit WarningConfigure ( const std::string& what_ );\n    ~WarningConfigure() throw ();\n  };\n\n  class MagickDLLDecl WarningCorruptImage: public Warning\n  {\n  public:\n    explicit WarningCorruptImage ( const std::string& what_ );\n    ~WarningCorruptImage() throw ();\n  };\n\n  class MagickDLLDecl WarningDelegate : public Warning\n  {\n  public:\n    explicit WarningDelegate ( const std::string& what_ );\n    ~WarningDelegate() throw ();\n  };\n\n  class MagickDLLDecl WarningDraw : public Warning\n  {\n  public:\n    explicit WarningDraw ( const std::string& what_ );\n    ~WarningDraw() throw ();\n  };\n\n  class MagickDLLDecl WarningFileOpen: public Warning\n  {\n  public:\n    explicit WarningFileOpen ( const std::string& what_ );\n    ~WarningFileOpen() throw ();\n  };\n\n  class MagickDLLDecl WarningImage: public Warning\n  {\n  public:\n    explicit WarningImage ( const std::string& what_ );\n    ~WarningImage() throw ();\n  };\n\n  class MagickDLLDecl WarningMissingDelegate : public Warning\n  {\n  public:\n    explicit WarningMissingDelegate ( const std::string& what_ );\n    ~WarningMissingDelegate() throw ();\n  };\n\n  class MagickDLLDecl WarningModule : public Warning\n  {\n  public:\n    explicit WarningModule ( const std::string& what_ );\n    ~WarningModule() throw ();\n  };\n\n  class MagickDLLDecl WarningMonitor : public Warning\n  {\n  public:\n    explicit WarningMonitor ( const std::string& what_ );\n    ~WarningMonitor() throw ();\n  };\n\n  class MagickDLLDecl WarningOption : public Warning\n  {\n  public:\n    explicit WarningOption ( const std::string& what_ );\n    ~WarningOption() throw ();\n  };\n\n  class MagickDLLDecl WarningRegistry : public Warning\n  {\n  public:\n    explicit WarningRegistry ( const std::string& what_ );\n    ~WarningRegistry() throw ();\n  };\n\n  class MagickDLLDecl WarningResourceLimit : public Warning\n  {\n  public:\n    explicit WarningResourceLimit ( const std::string& what_ );\n    ~WarningResourceLimit() throw ();\n  };\n\n  class MagickDLLDecl WarningStream : public Warning\n  {\n  public:\n    explicit WarningStream ( const std::string& what_ );\n    ~WarningStream() throw ();\n  };\n\n  class MagickDLLDecl WarningType : public Warning\n  {\n  public:\n    explicit WarningType ( const std::string& what_ );\n    ~WarningType() throw ();\n  };\n\n  class MagickDLLDecl WarningXServer : public Warning\n  {\n  public:\n    explicit WarningXServer ( const std::string& what_ );\n    ~WarningXServer() throw ();\n  };\n\n  //\n  // Error exceptions\n  //\n\n  class MagickDLLDecl Error : public Exception\n  {\n  public:\n    explicit Error ( const std::string& what_ );\n    ~Error() throw ();\n  };\n\n  class MagickDLLDecl ErrorUndefined : public Error\n  {\n  public:\n    explicit ErrorUndefined ( const std::string& what_ );\n    ~ErrorUndefined() throw ();\n  };\n\n  class MagickDLLDecl ErrorBlob: public Error\n  {\n  public:\n    explicit ErrorBlob ( const std::string& what_ );\n    ~ErrorBlob() throw ();\n  };\n\n  class MagickDLLDecl ErrorCache: public Error\n  {\n  public:\n    explicit ErrorCache ( const std::string& what_ );\n    ~ErrorCache() throw ();\n  };\n\n  class MagickDLLDecl ErrorCoder: public Error\n  {\n  public:\n    explicit ErrorCoder ( const std::string& what_ );\n    ~ErrorCoder() throw ();\n  };\n\n  class MagickDLLDecl ErrorConfigure: public Error\n  {\n  public:\n    explicit ErrorConfigure ( const std::string& what_ );\n    ~ErrorConfigure() throw ();\n  };\n\n  class MagickDLLDecl ErrorCorruptImage: public Error\n  {\n  public:\n    explicit ErrorCorruptImage ( const std::string& what_ );\n    ~ErrorCorruptImage() throw ();\n  };\n\n  class MagickDLLDecl ErrorDelegate : public Error\n  {\n  public:\n    explicit ErrorDelegate ( const std::string& what_ );\n    ~ErrorDelegate() throw ();\n  };\n\n  class MagickDLLDecl ErrorDraw : public Error\n  {\n  public:\n    explicit ErrorDraw ( const std::string& what_ );\n    ~ErrorDraw() throw ();\n  };\n\n  class MagickDLLDecl ErrorFileOpen: public Error\n  {\n  public:\n    explicit ErrorFileOpen ( const std::string& what_ );\n    ~ErrorFileOpen() throw ();\n  };\n\n  class MagickDLLDecl ErrorImage: public Error\n  {\n  public:\n    explicit ErrorImage ( const std::string& what_ );\n    ~ErrorImage() throw ();\n  };\n\n  class MagickDLLDecl ErrorMissingDelegate : public Error\n  {\n  public:\n    explicit ErrorMissingDelegate ( const std::string& what_ );\n    ~ErrorMissingDelegate() throw ();\n  };\n\n  class MagickDLLDecl ErrorModule : public Error\n  {\n  public:\n    explicit ErrorModule ( const std::string& what_ );\n    ~ErrorModule() throw ();\n  };\n\n  class MagickDLLDecl ErrorMonitor : public Error\n  {\n  public:\n    explicit ErrorMonitor ( const std::string& what_ );\n    ~ErrorMonitor() throw ();\n  };\n\n  class MagickDLLDecl ErrorOption : public Error\n  {\n  public:\n    explicit ErrorOption ( const std::string& what_ );\n    ~ErrorOption() throw ();\n  };\n\n  class MagickDLLDecl ErrorRegistry : public Error\n  {\n  public:\n    explicit ErrorRegistry ( const std::string& what_ );\n    ~ErrorRegistry() throw ();\n  };\n\n  class MagickDLLDecl ErrorResourceLimit : public Error\n  {\n  public:\n    explicit ErrorResourceLimit ( const std::string& what_ );\n    ~ErrorResourceLimit() throw ();\n  };\n\n  class MagickDLLDecl ErrorStream : public Error\n  {\n  public:\n    explicit ErrorStream ( const std::string& what_ );\n    ~ErrorStream() throw ();\n  };\n\n  class MagickDLLDecl ErrorType : public Error\n  {\n  public:\n    explicit ErrorType ( const std::string& what_ );\n    ~ErrorType() throw ();\n  };\n\n  class MagickDLLDecl ErrorXServer : public Error\n  {\n  public:\n    explicit ErrorXServer ( const std::string& what_ );\n    ~ErrorXServer() throw ();\n  };\n\n  //\n  // No user-serviceable components beyond this point.\n  //\n\n  // Throw exception based on raw data\n  MagickDLLDeclExtern void throwExceptionExplicit( const MagickLib::ExceptionType severity_,\n                                                   const char* reason_,\n                                                   const char* description_ = 0 );\n\n  // Thow exception based on ImageMagick's ExceptionInfo\n  MagickDLLDeclExtern void throwException( MagickLib::ExceptionInfo &exception_,\n                                           const bool quiet_ = false );\n\n} // namespace Magick\n\n#endif // Magick_Exception_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/Geometry.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2014\n//\n// Geometry Definition\n//\n// Representation of an ImageMagick geometry specification\n// X11 geometry specification plus hints\n\n#if !defined (Magick_Geometry_header)\n#define Magick_Geometry_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n\nnamespace Magick\n{\n\n  class MagickDLLDecl Geometry;\n\n  // Compare two Geometry objects regardless of LHS/RHS\n  int MagickDLLDecl operator == ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator != ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator >  ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator <  ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator >= ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator <= ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n\n  class MagickDLLDecl Geometry\n  {\n  public:\n\n    Geometry ( unsigned int width_,\n               unsigned int height_,\n               unsigned int xOff_ = 0,\n               unsigned int yOff_ = 0,\n               bool xNegative_ = false,\n               bool yNegative_ = false );\n    Geometry ( const std::string &geometry_ );\n    Geometry ( const char * geometry_ );\n    Geometry ( const Geometry &geometry_ );\n    Geometry ( );\n    ~Geometry ( void );\n\n    // Width\n    void          width ( unsigned int width_ );\n    unsigned int  width ( void ) const;\n\n    // Height\n    void          height ( unsigned int height_ );\n    unsigned int  height ( void ) const;\n\n    // X offset from origin\n    void          xOff ( unsigned int xOff_ );\n    unsigned int  xOff ( void ) const;\n\n    // Y offset from origin\n    void          yOff ( unsigned int yOff_ );\n    unsigned int  yOff ( void ) const;\n\n    // Sign of X offset negative? (X origin at right)\n    void          xNegative ( bool xNegative_ );\n    bool          xNegative ( void ) const;\n\n    // Sign of Y offset negative? (Y origin at bottom)\n    void          yNegative ( bool yNegative_ );\n    bool          yNegative ( void ) const;\n\n    // Width and height are expressed as percentages\n    void          percent ( bool percent_ );\n    bool          percent ( void ) const;\n\n    // Resize without preserving aspect ratio (!)\n    void          aspect ( bool aspect_ );\n    bool          aspect ( void ) const;\n\n    // Resize if image is greater than size (>)\n    void          greater ( bool greater_ );\n    bool          greater ( void ) const;\n\n    // Resize if image is less than size (<)\n    void          less ( bool less_ );\n    bool          less ( void ) const;\n\n    // Resize image to fit total pixel area specified by dimensions (@).\n    void          limitPixels ( bool limitPixels_ );\n    bool          limitPixels ( void ) const;\n\n    // Dimensions are treated as minimum rather than maximum values (^)\n    void          fillArea ( bool fillArea_ );\n    bool          fillArea ( void ) const;\n\n    // Does object contain valid geometry?\n    void          isValid ( bool isValid_ );\n    bool          isValid ( void ) const;\n\n    // Set via geometry string\n    const Geometry& operator = ( const std::string &geometry_ );\n    const Geometry& operator = ( const char * geometry_ );\n\n    // Assignment operator\n    Geometry& operator= ( const Geometry& Geometry_ );\n\n    // Return geometry string\n    operator std::string() const;\n\n    //\n    // Public methods below this point are for Magick++ use only.\n    //\n\n    // Construct from RectangleInfo\n    Geometry ( const MagickLib::RectangleInfo &rectangle_ );\n\n    // Return an ImageMagick RectangleInfo struct\n    operator MagickLib::RectangleInfo() const;\n\n  private:\n    unsigned int  _width;\n    unsigned int  _height;\n    unsigned int  _xOff;\n    unsigned int  _yOff;\n    union\n    {\n      struct\n      {\n        // Bit-field for compact boolean storage\n        bool          _xNegative : 1;\n        bool          _yNegative : 1;\n        bool          _isValid : 1;\n        bool          _percent : 1;    // Interpret width & height as percentages (%)\n        bool          _aspect : 1;     // Force exact size (!)\n        bool          _greater : 1;    // Re-size only if larger than geometry (>)\n        bool          _less : 1;       // Re-size only if smaller than geometry (<)\n        bool          _limitPixels : 1;// Resize image to fit total pixel area (@).\n        bool          _fillArea : 1;   // Dimensions are treated as\n                                       // minimum rather than maximum\n                                       // values (^)\n      } _b;\n      struct\n      {\n        // Padding for future use.\n        unsigned int pad[2];\n      } _padding;\n    } _flags; // union\n  }; // class Geometry;\n} // namespace Magick\n\n//\n// Inlines\n//\n\n\n#endif // Magick_Geometry_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/Image.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2017\n//\n// Definition of Image, the representation of a single image in Magick++\n//\n\n#if !defined(Magick_Image_header)\n#define Magick_Image_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n#include <list>\n#include \"Magick++/Blob.h\"\n#include \"Magick++/Color.h\"\n#include \"Magick++/Drawable.h\"\n#include \"Magick++/Exception.h\"\n#include \"Magick++/Geometry.h\"\n#include \"Magick++/TypeMetric.h\"\n\nnamespace Magick\n{\n  // Forward declarations\n  class Options;\n  class ImageRef;\n\n//   extern MagickDLLDecl const std::string borderGeometryDefault;\n//   extern MagickDLLDecl const std::string frameGeometryDefault;\n//   extern MagickDLLDecl const std::string raiseGeometryDefault;\n  extern MagickDLLDecl const char *borderGeometryDefault;\n  extern MagickDLLDecl const char *frameGeometryDefault;\n  extern MagickDLLDecl const char *raiseGeometryDefault;\n\n  // Compare two Image objects regardless of LHS/RHS\n  // Image sizes and signatures are used as basis of comparison\n  int MagickDLLDecl operator == ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator != ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator >  ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator <  ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator >= ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator <= ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n\n  // C library initialization routine\n  void MagickDLLDecl InitializeMagick(const char *path_);\n\n  //\n  // Image is the representation of an image.  In reality, it actually\n  // a handle object which contains a pointer to a shared reference\n  // object (ImageRef). As such, this object is extremely space efficient.\n  //\n  class MagickDLLDecl Image\n  {\n  public:\n    // Construct from image file or image specification\n    Image( const std::string &imageSpec_ );\n\n    // Construct a blank image canvas of specified size and color\n    Image( const Geometry &size_, const Color &color_ );\n\n    // Construct Image from in-memory BLOB\n    Image ( const Blob &blob_ );\n\n    // Construct Image of specified size from in-memory BLOB\n    Image ( const Blob &blob_, const Geometry &size_ );\n\n    // Construct Image of specified size and depth from in-memory BLOB\n    Image ( const Blob &blob_, const Geometry &size,\n            const unsigned int depth );\n\n    // Construct Image of specified size, depth, and format from\n    // in-memory BLOB\n    Image ( const Blob &blob_, const Geometry &size,\n            const unsigned int depth_,\n            const std::string &magick_ );\n    // Construct Image of specified size, and format from in-memory\n    // BLOB\n    Image ( const Blob &blob_, const Geometry &size,\n            const std::string &magick_ );\n\n    // Construct an image based on an array of raw pixels, of\n    // specified type and mapping, in memory\n    Image ( const unsigned int width_,\n            const unsigned int height_,\n            const std::string &map_,\n            const StorageType type_,\n            const void *pixels_ );\n\n    // Default constructor\n    Image( void );\n\n    // Destructor\n    virtual ~Image();\n\n    /// Copy constructor\n    Image ( const Image & image_ );\n\n    // Assignment operator\n    Image& operator= ( const Image &image_ );\n\n    //////////////////////////////////////////////////////////////////////\n    //\n    // Image operations\n    //\n    //////////////////////////////////////////////////////////////////////\n\n    // Local adaptive threshold image\n    // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm\n    // Width x height define the size of the pixel neighborhood\n    // offset = constant to subtract from pixel neighborhood mean\n    void            adaptiveThreshold ( const unsigned int width,\n                                        const unsigned int height,\n                                        const double offset = 0.0 );\n    void            adaptiveThreshold ( const unsigned int width,\n                                        const unsigned int height,\n                                        const unsigned int offset) MAGICK_FUNC_DEPRECATED;\n\n    // Add noise to image with specified noise type\n    void            addNoise ( const NoiseType noiseType_ );\n    void            addNoiseChannel ( const ChannelType channel_,\n                                      const NoiseType noiseType_);\n\n    // Transform image by specified affine (or free transform) matrix.\n    void            affineTransform ( const DrawableAffine &affine );\n\n    //\n    // Annotate image (draw text on image)\n    //\n\n    // Gravity effects text placement in bounding area according to rules:\n    //  NorthWestGravity  text bottom-left corner placed at top-left\n    //  NorthGravity      text bottom-center placed at top-center\n    //  NorthEastGravity  text bottom-right corner placed at top-right\n    //  WestGravity       text left-center placed at left-center\n    //  CenterGravity     text center placed at center\n    //  EastGravity       text right-center placed at right-center\n    //  SouthWestGravity  text top-left placed at bottom-left\n    //  SouthGravity      text top-center placed at bottom-center\n    //  SouthEastGravity  text top-right placed at bottom-right\n\n    // Annotate using specified text, and placement location\n    void            annotate ( const std::string &text_,\n                               const Geometry &location_ );\n    // Annotate using specified text, bounding area, and placement\n    // gravity\n    void            annotate ( const std::string &text_,\n                               const Geometry &boundingArea_,\n                               const GravityType gravity_ );\n    // Annotate with text using specified text, bounding area,\n    // placement gravity, and rotation.\n    void            annotate ( const std::string &text_,\n                               const Geometry &boundingArea_,\n                               const GravityType gravity_,\n                               const double degrees_ );\n    // Annotate with text (bounding area is entire image) and placement\n    // gravity.\n    void            annotate ( const std::string &text_,\n                               const GravityType gravity_ );\n\n    // Orient image to be right-side up based on its current\n    // orientation attribute.  This allows the image to be viewed\n    // correctly when the orientation attribute is not available, or\n    // is not respected.\n    void            autoOrient( void );\n\n    // Blur image with specified blur factor\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    void            blur ( const double radius_ = 0.0,\n                           const double sigma_ = 1.0  );\n    void            blurChannel ( const ChannelType channel_,\n                                  const double radius_ = 0.0,\n                                  const double sigma_ = 1.0  );\n\n    // Border image (add border to image)\n    void            border ( const Geometry &geometry_\n                             = borderGeometryDefault );\n\n    // Bake in the ASC-CDL, which is a convention for the for the\n    // exchange of basic primary color grading information between for\n    // the exchange of basic primary color grading information between\n    // equipment and software from different manufacturers.  It is a\n    // useful transform for other purposes as well.\n    void            cdl ( const std::string &cdl_ );\n\n    // Extract channel from image\n    void            channel ( const ChannelType channel_ );\n\n    // Set or obtain modulus channel depth\n    void            channelDepth ( const ChannelType channel_,\n                                   const unsigned int depth_ );\n    unsigned int    channelDepth ( const ChannelType channel_ );\n\n    // Charcoal effect image (looks like charcoal sketch)\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    void            charcoal ( const double radius_ = 0.0,\n                               const double sigma_ = 1.0 );\n\n    // Chop image (remove vertical or horizontal subregion of image)\n    // FIXME: describe how geometry argument is used to select either\n    // horizontal or vertical subregion of image.\n\n    void            chop ( const Geometry &geometry_ );\n\n    // Colorize image with pen color, using specified percent opacity\n    // for red, green, and blue quantums\n    void            colorize ( const unsigned int opacityRed_,\n                               const unsigned int opacityGreen_,\n                               const unsigned int opacityBlue_,\n                               const Color &penColor_ );\n    // Colorize image with pen color, using specified percent opacity.\n    void            colorize ( const unsigned int opacity_,\n                               const Color &penColor_ );\n\n    // Apply a color matrix to the image channels.  The user supplied\n    // matrix may be of order 1 to 5 (1x1 through 5x5).\n    void            colorMatrix (const unsigned int order_,\n                                 const double *color_matrix_);\n\n    // Comment image (add comment string to image)\n    void            comment ( const std::string &comment_ );\n\n    // Compare current image with another image\n    // Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError\n    // in the current image. False is returned if the images are identical.\n    bool            compare ( const Image &reference_ );\n\n    // Compose an image onto another at specified offset and using\n    // specified algorithm\n    void            composite ( const Image &compositeImage_,\n                                const int xOffset_,\n                                const int yOffset_,\n                                const CompositeOperator compose_\n                                = InCompositeOp );\n    void            composite ( const Image &compositeImage_,\n                                const Geometry &offset_,\n                                const CompositeOperator compose_\n                                = InCompositeOp );\n    void            composite ( const Image &compositeImage_,\n                                const GravityType gravity_,\n                                const CompositeOperator compose_\n                                = InCompositeOp );\n\n    // Contrast image (enhance intensity differences in image)\n    void            contrast ( const unsigned int sharpen_ );\n\n    // Convolve image.  Applies a user-specified convolution to the image.\n    //  order_ represents the number of columns and rows in the filter kernel.\n    //  kernel_ is an array of doubles representing the convolution kernel.\n    void            convolve ( const unsigned int order_,\n                               const double *kernel_ );\n\n    // Crop image (subregion of original image)\n    void            crop ( const Geometry &geometry_ );\n\n    // Cycle image colormap\n    void            cycleColormap ( const int amount_ );\n\n    // Despeckle image (reduce speckle noise)\n    void            despeckle ( void );\n\n    // Display image on screen\n    void            display ( void );\n\n    // Draw on image using a single drawable\n    void            draw ( const Drawable &drawable_ );\n\n    // Draw on image using a drawable list\n    void            draw ( const std::list<Magick::Drawable> &drawable_ );\n\n    // Edge image (hilight edges in image)\n    void            edge ( const double radius_ = 0.0 );\n\n    // Emboss image (hilight edges with 3D effect)\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    void            emboss ( const double radius_ = 0.0,\n                             const double sigma_ = 1.0);\n\n    // Enhance image (minimize noise)\n    void            enhance ( void );\n\n    // Equalize image (histogram equalization)\n    void            equalize ( void );\n\n    // Erase image to current \"background color\"\n    void            erase ( void );\n\n    // Create an image canvas using background color sized according\n    // to geometry and composite existing image on it, with image\n    // placement controlled by gravity.  Parameters are obtained from\n    // existing image properties if they are not specified via a\n    // method parameter.  Parameters which are supported by image\n    // properties (gravity and backgroundColor) update those image\n    // properties as a side-effect.\n    void            extent ( const Geometry &geometry_ );\n\n    void            extent ( const Geometry &geometry_,\n                             const GravityType &gravity_ );\n\n    void            extent ( const Geometry &geometry_,\n                             const Color &backgroundColor_ );\n\n    void            extent ( const Geometry &geometry_,\n                             const Color &backgroundColor_,\n                             const GravityType &gravity_ );\n\n    // Flip image (reflect each scanline in the vertical direction)\n    void            flip ( void );\n\n    // Flood-fill color across pixels that match the color of the\n    // target pixel and are neighbors of the target pixel.\n    // Uses current fuzz setting when determining color match.\n    void            floodFillColor( const unsigned int x_,\n                                    const unsigned int y_,\n                                    const Color &fillColor_ );\n    void            floodFillColor( const Geometry &point_,\n                                    const Color &fillColor_ );\n\n    // Flood-fill color across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    void            floodFillColor( const unsigned int x_,\n                                    const unsigned int y_,\n                                    const Color &fillColor_,\n                                    const Color &borderColor_ );\n    void            floodFillColor( const Geometry &point_,\n                                    const Color &fillColor_,\n                                    const Color &borderColor_ );\n\n    // Floodfill pixels matching color (within fuzz factor) of target\n    // pixel(x,y) with replacement opacity value using method.\n    void            floodFillOpacity ( const unsigned int x_,\n                                       const unsigned int y_,\n                                       const unsigned int opacity_,\n                                       const PaintMethod method_ );\n\n    // Flood-fill texture across pixels that match the color of the\n    // target pixel and are neighbors of the target pixel.\n    // Uses current fuzz setting when determining color match.\n    void            floodFillTexture( const unsigned int x_,\n                                      const unsigned int y_,\n                                      const Image &texture_ );\n    void            floodFillTexture( const Geometry &point_,\n                                      const Image &texture_ );\n\n    // Flood-fill texture across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    void            floodFillTexture( const unsigned int x_,\n                                      const unsigned int y_,\n                                      const Image &texture_,\n                                      const Color &borderColor_ );\n    void            floodFillTexture( const Geometry &point_,\n                                      const Image &texture_,\n                                      const Color &borderColor_ );\n\n    // Flop image (reflect each scanline in the horizontal direction)\n    void            flop ( void );\n\n    // Frame image\n    void            frame ( const Geometry &geometry_ = frameGeometryDefault );\n    void            frame ( const unsigned int width_,\n                            const unsigned int height_,\n                            const int innerBevel_ = 6,\n                            const int outerBevel_ = 6 );\n\n    // Gamma correct image\n    void            gamma ( const double gamma_ );\n    void            gamma ( const double gammaRed_,\n                            const double gammaGreen_,\n                            const double gammaBlue_ );\n\n    // Gaussian blur image\n    // The number of neighbor pixels to be included in the convolution\n    // mask is specified by 'width_'. The standard deviation of the\n    // gaussian bell curve is specified by 'sigma_'.\n    void            gaussianBlur ( const double width_, const double sigma_ );\n    void            gaussianBlurChannel ( const ChannelType channel_,\n                                          const double width_, const double sigma_ );\n\n    // Implode image (special effect)\n    void            implode ( const double factor_ );\n\n    // Apply a color lookup table (Hald CLUT) to the image.\n    void            haldClut ( const Image &clutImage_ );\n\n    // Label image\n    void            label ( const std::string &label_ );\n\n    // Level image. Adjust the levels of the image by scaling the\n    // colors falling between specified white and black points to the\n    // full available quantum range. The parameters provided represent\n    // the black, mid (gamma), and white points.  The black point\n    // specifies the darkest color in the image. Colors darker than\n    // the black point are set to zero. Mid point (gamma) specifies a\n    // gamma correction to apply to the image. White point specifies\n    // the lightest color in the image.  Colors brighter than the\n    // white point are set to the maximum quantum value. The black and\n    // white point have the valid range 0 to MaxRGB while mid (gamma)\n    // has a useful range of 0 to ten.\n    void            level ( const double black_point,\n                            const double white_point,\n                            const double mid_point=1.0 );\n\n    // Level image channel. Adjust the levels of the image channel by\n    // scaling the values falling between specified white and black\n    // points to the full available quantum range. The parameters\n    // provided represent the black, mid (gamma), and white points.\n    // The black point specifies the darkest color in the\n    // image. Colors darker than the black point are set to zero. Mid\n    // point (gamma) specifies a gamma correction to apply to the\n    // image. White point specifies the lightest color in the image.\n    // Colors brighter than the white point are set to the maximum\n    // quantum value. The black and white point have the valid range 0\n    // to MaxRGB while mid (gamma) has a useful range of 0 to ten.\n    void            levelChannel ( const ChannelType channel,\n                                   const double black_point,\n                                   const double white_point,\n                                   const double mid_point=1.0 );\n\n    // Magnify image by integral size\n    void            magnify ( void );\n\n    // Remap image colors with closest color from reference image\n    void            map ( const Image &mapImage_ ,\n                          const bool dither_ = false );\n\n    // Floodfill designated area with replacement opacity value\n    void            matteFloodfill ( const Color &target_ ,\n                                     const unsigned int opacity_,\n                                     const int x_, const int y_,\n                                     const PaintMethod method_ );\n\n    // Filter image by replacing each pixel component with the median\n    // color in a circular neighborhood\n    void            medianFilter ( const double radius_ = 0.0 );\n\n    // Reduce image by integral size\n    void            minify ( void );\n\n    // Modulate percent hue, saturation, and brightness of an image.\n    // Modulation of saturation and brightness is as a ratio of the\n    // current value (1.0 for no change). Modulation of hue is an\n    // absolute rotation of -180 degrees to +180 degrees from the\n    // current position corresponding to an argument range of 0 to 2.0\n    // (1.0 for no change).\n    void            modulate ( const double brightness_,\n                               const double saturation_,\n                               const double hue_ );\n\n    // Motion blur image with specified blur factor\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    // The angle_ parameter specifies the angle the object appears\n    // to be comming from (zero degrees is from the right).\n    void            motionBlur ( const double radius_,\n                                 const double sigma_,\n                                 const double angle_ );\n\n    // Negate colors in image.  Set grayscale to only negate grayscale\n    // values in image.\n    void            negate ( const bool grayscale_ = false );\n\n    // Normalize image (increase contrast by normalizing the pixel\n    // values to span the full range of color values)\n    void            normalize ( void );\n\n    // Oilpaint image (image looks like oil painting)\n    void            oilPaint ( const double radius_ = 3.0 );\n\n    // Set or attenuate the opacity channel in the image. If the image\n    // pixels are opaque then they are set to the specified opacity\n    // value, otherwise they are blended with the supplied opacity\n    // value.  The value of opacity_ ranges from 0 (completely opaque)\n    // to MaxRGB. The defines OpaqueOpacity and TransparentOpacity are\n    // available to specify completely opaque or completely\n    // transparent, respectively.\n    void            opacity ( const unsigned int opacity_ );\n\n    // Change color of opaque pixel to specified pen color.\n    void            opaque ( const Color &opaqueColor_,\n                             const Color &penColor_ );\n\n    // Ping is similar to read except only enough of the image is read\n    // to determine the image columns, rows, and filesize.  Access the\n    // columns(), rows(), and fileSize() attributes after invoking\n    // ping.  The image data is not valid after calling ping.\n    void            ping ( const std::string &imageSpec_ );\n\n    // Ping is similar to read except only enough of the image is read\n    // to determine the image columns, rows, and filesize.  Access the\n    // columns(), rows(), and fileSize() attributes after invoking\n    // ping.  The image data is not valid after calling ping.\n    void            ping ( const Blob &blob_ );\n\n    // Quantize image (reduce number of colors)\n    void            quantize ( const bool measureError_ = false );\n\n    // Apply an arithmetic or bitwise operator to the image pixel quantums.\n    void            quantumOperator ( const ChannelType channel_,\n                                      const QuantumOperator operator_,\n                                      Quantum rvalue_) MAGICK_FUNC_DEPRECATED;\n    void            quantumOperator ( const ChannelType channel_,\n                                      const QuantumOperator operator_,\n                                      double rvalue_);\n    void            quantumOperator ( const int x_,const int y_,\n                                      const unsigned int columns_,\n                                      const unsigned int rows_,\n                                      const ChannelType channel_,\n                                      const QuantumOperator operator_,\n                                      const Quantum rvalue_) MAGICK_FUNC_DEPRECATED;\n    void            quantumOperator ( const int x_,const int y_,\n                                      const unsigned int columns_,\n                                      const unsigned int rows_,\n                                      const ChannelType channel_,\n                                      const QuantumOperator operator_,\n                                      const double rvalue_);\n\n    // Execute a named process module using an argc/argv syntax similar to\n    // that accepted by a C 'main' routine. An exception is thrown if the\n    // requested process module doesn't exist, fails to load, or fails during\n    // execution.\n    void            process ( std::string name_,\n                              const int argc_,\n                              char **argv_ );\n\n    // Raise image (lighten or darken the edges of an image to give a\n    // 3-D raised or lowered effect)\n    void            raise ( const Geometry &geometry_ = raiseGeometryDefault,\n                            const bool raisedFlag_ = false );\n\n    // Random threshold image.\n    //\n    // Changes the value of individual pixels based on the intensity\n    // of each pixel compared to a random threshold.  The result is a\n    // low-contrast, two color image.  The thresholds_ argument is a\n    // geometry containing LOWxHIGH thresholds.  If the string\n    // contains 2x2, 3x3, or 4x4, then an ordered dither of order 2,\n    // 3, or 4 will be performed instead.  If a channel_ argument is\n    // specified then only the specified channel is altered.  This is\n    // a very fast alternative to 'quantize' based dithering.\n    void            randomThreshold( const Geometry &thresholds_ );\n    void            randomThresholdChannel( const Geometry &thresholds_,\n                                            const ChannelType channel_ );\n\n    // Read single image frame into current object\n    void            read ( const std::string &imageSpec_ );\n\n    // Read single image frame of specified size into current object\n    void            read ( const Geometry &size_,\n                           const std::string &imageSpec_ );\n\n    // Read single image frame from in-memory BLOB\n    void            read ( const Blob        &blob_ );\n\n    // Read single image frame of specified size from in-memory BLOB\n    void            read ( const Blob        &blob_,\n                           const Geometry    &size_ );\n\n    // Read single image frame of specified size and depth from\n    // in-memory BLOB\n    void            read ( const Blob         &blob_,\n                           const Geometry     &size_,\n                           const unsigned int depth_ );\n\n    // Read single image frame of specified size, depth, and format\n    // from in-memory BLOB\n    void            read ( const Blob         &blob_,\n                           const Geometry     &size_,\n                           const unsigned int depth_,\n                           const std::string  &magick_ );\n\n    // Read single image frame of specified size, and format from\n    // in-memory BLOB\n    void            read ( const Blob         &blob_,\n                           const Geometry     &size_,\n                           const std::string  &magick_ );\n\n    // Read single image frame from an array of raw pixels, with\n    // specified storage type (ConstituteImage), e.g.\n    //    image.read( 640, 480, \"RGB\", 0, pixels );\n    void            read ( const unsigned int width_,\n                           const unsigned int height_,\n                           const std::string &map_,\n                           const StorageType  type_,\n                           const void        *pixels_ );\n\n    // Reduce noise in image using a noise peak elimination filter\n    void            reduceNoise ( void );\n    void            reduceNoise ( const double order_ );\n\n    // Resets the image page canvas and position.\n    void            repage();\n\n    // Resize image, specifying geometry, filter, and blur\n    void            resize ( const Geometry &geometry_,\n                             const FilterTypes filterType_,\n                             const double blur_ );\n\n    // Resize image, specifying geometry and filter, with blur using\n    // Image default.\n    void            resize ( const Geometry &geometry_,\n                             const FilterTypes filterType_ );\n\n    // Resize image, specifying only geometry, with filter and blur\n    // obtained from Image default.  Same result as 'zoom' method.\n    void            resize ( const Geometry &geometry_ );\n\n    // Roll image (rolls image vertically and horizontally) by specified\n    // number of columnms and rows)\n    void            roll ( const Geometry &roll_ );\n    void            roll ( const unsigned int columns_,\n                           const unsigned int rows_ );\n\n    // Rotate image counter-clockwise by specified number of degrees.\n    void            rotate ( const double degrees_ );\n\n    // Resize image by using pixel sampling algorithm\n    void            sample ( const Geometry &geometry_ );\n\n    // Resize image by using simple ratio algorithm\n    void            scale ( const Geometry &geometry_ );\n\n    // Resize image using several algorithms to make smaller images\n    // very quickly.\n    void            thumbnail ( const Geometry &geometry_ );\n\n    // Segment (coalesce similar image components) by analyzing the\n    // histograms of the color components and identifying units that\n    // are homogeneous with the fuzzy c-means technique.  Also uses\n    // QuantizeColorSpace and Verbose image attributes\n    void            segment ( const double clusterThreshold_ = 1.0,\n                              const double smoothingThreshold_ = 1.5 );\n\n    // Shade image using distant light source\n    void            shade ( const double azimuth_ = 30,\n                            const double elevation_ = 30,\n                            const bool   colorShading_ = false );\n\n    // Sharpen pixels in image\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    void            sharpen ( const double radius_ = 0.0,\n                              const double sigma_ = 1.0 );\n    void            sharpenChannel ( const ChannelType channel_,\n                                     const double radius_ = 0.0,\n                                     const double sigma_ = 1.0 );\n\n    // Shave pixels from image edges.\n    void            shave ( const Geometry &geometry_ );\n\n    // Shear image (create parallelogram by sliding image by X or Y axis)\n    void            shear ( const double xShearAngle_,\n                            const double yShearAngle_ );\n\n    // Solarize image (similar to effect seen when exposing a\n    // photographic film to light during the development process)\n    void            solarize ( const double factor_ = 50.0 );\n\n    // Spread pixels randomly within image by specified ammount\n    void            spread ( const unsigned int amount_ = 3 );\n\n    // Add a digital watermark to the image (based on second image)\n    void            stegano ( const Image &watermark_ );\n\n    // Create an image which appears in stereo when viewed with\n    // red-blue glasses (Red image on left, blue on right)\n    void            stereo ( const Image &rightImage_ );\n\n    // Remove all profiles and text attributes from the image.\n    void            strip ( void );\n\n    // Swirl image (image pixels are rotated by degrees)\n    void            swirl ( const double degrees_ );\n\n    // Channel a texture on image background\n    void            texture ( const Image &texture_ );\n\n    // Threshold image channels (below threshold becomes black, above\n    // threshold becomes white).\n    // The range of the threshold parameter is 0 to MaxRGB.\n    void            threshold ( const double threshold_ );\n\n    // Transform image based on image and crop geometries\n    // Crop geometry is optional\n    void            transform ( const Geometry &imageGeometry_ );\n    void            transform ( const Geometry &imageGeometry_,\n                                const Geometry &cropGeometry_  );\n\n    // Add matte image to image, setting pixels matching color to\n    // transparent\n    void            transparent ( const Color &color_ );\n\n    // Trim edges that are the background color from the image\n    void            trim ( void );\n\n    // Image representation type (also see type attribute)\n    //   Available types:\n    //    Bilevel        Grayscale       GrayscaleMatte\n    //    Palette        PaletteMatte    TrueColor\n    //    TrueColorMatte ColorSeparation ColorSeparationMatte\n    void            type ( const ImageType type_ );\n\n    // Replace image with a sharpened version of the original image\n    // using the unsharp mask algorithm.\n    //  radius_\n    //    the radius of the Gaussian, in pixels, not counting the\n    //    center pixel.\n    //  sigma_\n    //    the standard deviation of the Gaussian, in pixels.\n    //  amount_\n    //    the percentage of the difference between the original and\n    //    the blur image that is added back into the original.\n    // threshold_\n    //   the threshold in pixels needed to apply the diffence amount.\n    void            unsharpmask ( const double radius_,\n                                  const double sigma_,\n                                  const double amount_,\n                                  const double threshold_ );\n    void            unsharpmaskChannel ( const ChannelType channel_,\n                                         const double radius_,\n                                         const double sigma_,\n                                         const double amount_,\n                                         const double threshold_ );\n\n    // Map image pixels to a sine wave\n    void            wave ( const double amplitude_ = 25.0,\n                           const double wavelength_ = 150.0 );\n\n    // Write single image frame to a file\n    void            write ( const std::string &imageSpec_ );\n\n    // Write single image frame to in-memory BLOB, with optional\n    // format and adjoin parameters.\n    void            write ( Blob *blob_ );\n    void            write ( Blob *blob_,\n                            const std::string &magick_ );\n    void            write ( Blob *blob_,\n                            const std::string &magick_,\n                            const unsigned int depth_ );\n\n    // Write single image frame to an array of pixels with storage\n    // type specified by user (DispatchImage), e.g.\n    //   image.write( 0, 0, 640, 1, \"RGB\", 0, pixels );\n    void            write ( const int x_,\n                            const int y_,\n                            const unsigned int columns_,\n                            const unsigned int rows_,\n                            const std::string& map_,\n                            const StorageType type_,\n                            void *pixels_ );\n\n    // Zoom image to specified size.\n    void            zoom ( const Geometry &geometry_ );\n\n    //////////////////////////////////////////////////////////////////////\n    //\n    // Image Attributes and Options\n    //\n    //////////////////////////////////////////////////////////////////////\n\n    // Join images into a single multi-image file\n    void            adjoin ( const bool flag_ );\n    bool            adjoin ( void ) const;\n\n    // Anti-alias Postscript and TrueType fonts (default true)\n    void            antiAlias( const bool flag_ );\n    bool            antiAlias( void );\n\n    // Time in 1/100ths of a second which must expire before\n    // displaying the next image in an animated sequence.\n    void            animationDelay ( const unsigned int delay_ );\n    unsigned int    animationDelay ( void ) const;\n\n    // Number of iterations to loop an animation (e.g. Netscape loop\n    // extension) for.\n    void            animationIterations ( const unsigned int iterations_ );\n    unsigned int    animationIterations ( void ) const;\n\n    // Access/Update a named image text attribute.  Updates append the\n    // provided to any existing attribute text.  Pass NULL as the\n    // value to remove an existing value or before a subsequent call\n    // to add new text.\n    void            attribute ( const std::string name_,\n                                const char * value_ );\n    void            attribute ( const std::string name_,\n                                const std::string value_ );\n    std::string     attribute ( const std::string name_ );\n\n    // Image background color\n    void            backgroundColor ( const Color &color_ );\n    Color           backgroundColor ( void ) const;\n\n    // Name of texture image to tile onto the image background\n    void            backgroundTexture (const std::string &backgroundTexture_ );\n    std::string     backgroundTexture ( void ) const;\n\n    // Base image width (before transformations)\n    unsigned int    baseColumns ( void ) const;\n\n    // Base image filename (before transformations)\n    std::string     baseFilename ( void ) const;\n\n    // Base image height (before transformations)\n    unsigned int    baseRows ( void ) const;\n\n    // Image border color\n    void            borderColor ( const Color &color_ );\n    Color           borderColor ( void ) const;\n\n    // Return smallest bounding box enclosing non-border pixels. The\n    // current fuzz value is used when discriminating between pixels.\n    // This is the crop bounding box used by crop(Geometry(0,0));\n    Geometry        boundingBox ( void ) const;\n\n    // Text bounding-box base color (default none)\n    void            boxColor ( const Color &boxColor_ );\n    Color           boxColor ( void ) const;\n\n    // Pixel cache threshold in megabytes.  Once this memory threshold\n    // is exceeded, all subsequent pixels cache operations are to/from\n    // disk.  This setting is shared by all Image objects.\n    static void     cacheThreshold ( const unsigned int threshold_ );\n\n    // Chromaticity blue primary point (e.g. x=0.15, y=0.06)\n    void            chromaBluePrimary ( const double x_, const double y_ );\n    void            chromaBluePrimary ( double *x_, double *y_ ) const;\n\n    // Chromaticity green primary point (e.g. x=0.3, y=0.6)\n    void            chromaGreenPrimary ( const double x_, const double y_ );\n    void            chromaGreenPrimary ( double *x_, double *y_ ) const;\n\n    // Chromaticity red primary point (e.g. x=0.64, y=0.33)\n    void            chromaRedPrimary ( const double x_, const double y_ );\n    void            chromaRedPrimary ( double *x_, double *y_ ) const;\n\n    // Chromaticity white point (e.g. x=0.3127, y=0.329)\n    void            chromaWhitePoint ( const double x_, const double y_ );\n    void            chromaWhitePoint ( double *x_, double *y_ ) const;\n\n    // Image class (DirectClass or PseudoClass)\n    // NOTE: setting a DirectClass image to PseudoClass will result in\n    // the loss of color information if the number of colors in the\n    // image is greater than the maximum palette size (either 256 or\n    // 65536 entries depending on the value of QuantumDepth when\n    // ImageMagick was built).\n    void            classType ( const ClassType class_ );\n    ClassType       classType ( void ) const;\n\n    // Associate a clip mask with the image. The clip mask must be the\n    // same dimensions as the image. Pass an invalid image to unset an\n    // existing clip mask.\n    void            clipMask ( const Image & clipMask_ );\n    Image           clipMask ( void  ) const;\n\n    // Colors within this distance are considered equal\n    void            colorFuzz ( const double fuzz_ );\n    double          colorFuzz ( void ) const;\n\n    // Color at colormap position index_\n    void            colorMap ( const unsigned int index_,\n                               const Color &color_ );\n    Color           colorMap ( const unsigned int index_ ) const;\n\n    // Colormap size (number of colormap entries)\n    void            colorMapSize ( const unsigned int entries_ );\n    unsigned int    colorMapSize ( void );\n\n    // Image Color Space\n    void            colorSpace( const ColorspaceType colorSpace_ );\n    ColorspaceType  colorSpace ( void ) const;\n\n    // Image width\n    unsigned int    columns ( void ) const;\n\n    // Image comment\n    std::string     comment ( void ) const;\n\n    // Composition operator to be used when composition is implicitly\n    // used (such as for image flattening).\n    void            compose (const CompositeOperator compose_);\n    CompositeOperator compose ( void ) const;\n\n    // Compression type\n    void            compressType ( const CompressionType compressType_ );\n    CompressionType compressType ( void ) const;\n\n    // Enable printing of debug messages from ImageMagick\n    void            debug ( const bool flag_ );\n    bool            debug ( void ) const;\n\n    // Tagged image format define (set/access coder-specific option) The\n    // magick_ option specifies the coder the define applies to.  The key_\n    // option provides the key specific to that coder.  The value_ option\n    // provides the value to set (if any). See the defineSet() method if the\n    // key must be removed entirely.\n    void            defineValue ( const std::string &magick_,\n                                  const std::string &key_,\n                                  const std::string &value_ );\n    std::string     defineValue ( const std::string &magick_,\n                                  const std::string &key_ ) const;\n\n    // Tagged image format define. Similar to the defineValue() method\n    // except that passing the flag_ value 'true' creates a value-less\n    // define with that format and key. Passing the flag_ value 'false'\n    // removes any existing matching definition. The method returns 'true'\n    // if a matching key exists, and 'false' if no matching key exists.\n    void            defineSet ( const std::string &magick_,\n                                const std::string &key_,\n                                bool flag_ );\n    bool            defineSet ( const std::string &magick_,\n                                const std::string &key_ ) const;\n\n    // Vertical and horizontal resolution in pixels of the image\n    //\n    // The resolution is expressed in resolution units as supported by\n    // the resolutionUnits() method.\n    //\n    // Please note that the underlying resolution is floating point\n    // and use of this method will result in rounding floating point\n    // value to integer vaues.  Use the xResolution() and\n    // yResolution() methods when full accuracy is required.\n    void            density ( const Geometry &geomery_ );\n    Geometry        density ( void ) const;\n\n    // Image depth (bits allocated to red/green/blue components)\n    void            depth ( const unsigned int depth_ );\n    unsigned int    depth ( void ) const;\n\n    // Tile names from within an image montage\n    std::string     directory ( void ) const;\n\n    // Endianness (little like Intel or big like SPARC) for image\n    // formats which support endian-specific options.\n    void            endian ( const EndianType endian_ );\n    EndianType      endian ( void ) const;\n\n    // Image file name\n    void            fileName ( const std::string &fileName_ );\n    std::string     fileName ( void ) const;\n\n    // Number of bytes of the image on disk\n    off_t          fileSize ( void ) const;\n\n    // Color to use when filling drawn objects\n    void            fillColor ( const Color &fillColor_ );\n    Color           fillColor ( void ) const;\n\n    // Rule to use when filling drawn objects\n    void            fillRule ( const FillRule &fillRule_ );\n    FillRule        fillRule ( void ) const;\n\n    // Pattern to use while filling drawn objects.\n    void            fillPattern ( const Image &fillPattern_ );\n    Image           fillPattern ( void  ) const;\n\n    // Filter to use when resizing image using 'zoom' or 'resize'.\n    void            filterType ( const FilterTypes filterType_ );\n    FilterTypes     filterType ( void ) const;\n\n    // Text rendering font\n    void            font ( const std::string &font_ );\n    std::string     font ( void ) const;\n\n    // Font point size\n    void            fontPointsize ( const double pointSize_ );\n    double          fontPointsize ( void ) const;\n\n    // Obtain font metrics for text string given current font,\n    // pointsize, and density settings.\n    void            fontTypeMetrics( const std::string &text_,\n                                     TypeMetric *metrics );\n\n    // Long image format description\n    std::string     format ( void ) const;\n\n    // Format the specified expression similar to command line '-format'.\n    // For example \"%wx%h\" is converted to a string containing image\n    // WIDTHxHEIGHT like \"640x480\".\n    std::string     formatExpression( const std::string expression );\n\n    // Gamma level of the image\n    double          gamma ( void ) const;\n\n    // Preferred size of the image when encoding\n    Geometry        geometry ( void ) const;\n\n    // GIF disposal method\n    void            gifDisposeMethod ( const unsigned int disposeMethod_ );\n    unsigned int    gifDisposeMethod ( void ) const;\n\n    // ICC color profile (BLOB)\n    void            iccColorProfile( const Blob &colorProfile_ );\n    Blob            iccColorProfile( void ) const;\n\n    // Type of interlacing to use\n    void            interlaceType ( const InterlaceType interlace_ );\n    InterlaceType   interlaceType ( void ) const;\n\n    // IPTC profile (BLOB)\n    void            iptcProfile( const Blob& iptcProfile_ );\n    Blob            iptcProfile( void ) const;\n\n    // Does object contain valid image?\n    void            isValid ( const bool isValid_ );\n    bool            isValid ( void ) const;\n\n    // Image label\n    std::string     label ( void ) const;\n\n    // Stroke width for drawing vector objects (default one)\n    // This method is now deprecated. Please use strokeWidth instead.\n    void            lineWidth ( const double lineWidth_ );\n    double          lineWidth ( void ) const;\n\n    // File type magick identifier (.e.g \"GIF\")\n    void            magick ( const std::string &magick_ );\n    std::string     magick ( void ) const;\n\n    // Image supports transparency (matte channel)\n    void            matte ( const bool matteFlag_ );\n    bool            matte ( void ) const;\n\n    // Transparent color\n    void            matteColor ( const Color &matteColor_ );\n    Color           matteColor ( void ) const;\n\n    // The mean error per pixel computed when an image is color reduced\n    double          meanErrorPerPixel ( void ) const;\n\n    // Image modulus depth (minimum number of bits required to support\n    // red/green/blue components without loss of accuracy)\n    void            modulusDepth ( const unsigned int modulusDepth_ );\n    unsigned int    modulusDepth ( void ) const;\n\n    // Tile size and offset within an image montage\n    Geometry        montageGeometry ( void ) const;\n\n    // Transform image to black and white\n    void            monochrome ( const bool monochromeFlag_ );\n    bool            monochrome ( void ) const;\n\n    // The normalized max error per pixel computed when an image is\n    // color reduced.\n    double          normalizedMaxError ( void ) const;\n\n    // The normalized mean error per pixel computed when an image is\n    // color reduced.\n    double          normalizedMeanError ( void ) const;\n\n    // Image orientation\n    void            orientation ( const OrientationType orientation_ );\n    OrientationType orientation ( void ) const;\n\n    // Preferred size and location of an image canvas.\n    void            page ( const Geometry &pageSize_ );\n    Geometry        page ( void ) const;\n\n    // Pen color (deprecated, don't use any more)\n    void            penColor ( const Color &penColor_ );\n    Color           penColor ( void  ) const;\n\n    // Pen texture image (deprecated, don't use any more)\n    void            penTexture ( const Image &penTexture_ );\n    Image           penTexture ( void  ) const;\n\n    // Get/set pixel color at location x & y.\n    void            pixelColor ( const unsigned int x_,\n                                 const unsigned int y_,\n                                 const Color &color_ );\n    Color           pixelColor ( const unsigned int x_,\n                                 const unsigned int y_ ) const;\n\n    // Add or remove a named profile to/from the image. Remove the\n    // profile by passing an empty Blob (e.g. Blob()). Valid names are\n    // \"*\", \"8BIM\", \"ICM\", \"IPTC\", or a user/format-defined profile name.\n    void            profile( const std::string name_,\n                             const Blob &colorProfile_ );\n\n    // Retrieve a named profile from the image. Valid names are:\n    // \"8BIM\", \"8BIMTEXT\", \"APP1\", \"APP1JPEG\", \"ICC\", \"ICM\", & \"IPTC\"\n    // or an existing user/format-defined profile name.\n    Blob            profile( const std::string name_ ) const;\n\n    // JPEG/MIFF/PNG compression level (default 75).\n    void            quality ( const unsigned int quality_ );\n    unsigned int    quality ( void ) const;\n\n    // Maximum number of colors to quantize to\n    void            quantizeColors ( const unsigned int colors_ );\n    unsigned int    quantizeColors ( void ) const;\n\n    // Colorspace to quantize in.\n    void            quantizeColorSpace ( const ColorspaceType colorSpace_ );\n    ColorspaceType  quantizeColorSpace ( void ) const;\n\n    // Dither image during quantization (default true).\n    void            quantizeDither ( const bool ditherFlag_ );\n    bool            quantizeDither ( void ) const;\n\n    // Quantization tree-depth\n    void            quantizeTreeDepth ( const unsigned int treeDepth_ );\n    unsigned int    quantizeTreeDepth ( void ) const;\n\n    // Suppress all warning messages. Error messages are still reported.\n    void            quiet ( const bool quiet_ );\n    bool            quiet ( void ) const;\n\n    // The type of rendering intent\n    void            renderingIntent ( const RenderingIntent renderingIntent_ );\n    RenderingIntent renderingIntent ( void ) const;\n\n    // Units of image resolution\n    void            resolutionUnits ( const ResolutionType resolutionUnits_ );\n    ResolutionType  resolutionUnits ( void ) const;\n\n    // The number of pixel rows in the image\n    unsigned int    rows ( void ) const;\n\n    // Image scene number\n    void            scene ( const unsigned int scene_ );\n    unsigned int    scene ( void ) const;\n\n    // Image signature.  Set force_ to true in order to re-calculate\n    // the signature regardless of whether the image data has been\n    // modified.\n    std::string     signature ( const bool force_ = false ) const;\n\n    // Width and height of a raw image\n    void            size ( const Geometry &geometry_ );\n    Geometry        size ( void ) const;\n\n    // Obtain image statistics. Statistics are normalized to the range\n    // of 0.0 to 1.0 and are output to the specified ImageStatistics\n    // structure.\n    void            statistics ( ImageStatistics *statistics ) const;\n\n    // enabled/disable stroke anti-aliasing\n    void            strokeAntiAlias( const bool flag_ );\n    bool            strokeAntiAlias( void ) const;\n\n    // Color to use when drawing object outlines\n    void            strokeColor ( const Color &strokeColor_ );\n    Color           strokeColor ( void ) const;\n\n    // Specify the pattern of dashes and gaps used to stroke\n    // paths. The strokeDashArray represents a zero-terminated array\n    // of numbers that specify the lengths of alternating dashes and\n    // gaps in pixels. If an odd number of values is provided, then\n    // the list of values is repeated to yield an even number of\n    // values.  A typical strokeDashArray_ array might contain the\n    // members 5 3 2 0, where the zero value indicates the end of the\n    // pattern array.\n    void            strokeDashArray ( const double* strokeDashArray_ );\n    const double*   strokeDashArray ( void ) const;\n\n    // While drawing using a dash pattern, specify distance into the\n    // dash pattern to start the dash (default 0).\n    void            strokeDashOffset ( const double strokeDashOffset_ );\n    double          strokeDashOffset ( void ) const;\n\n    // Specify the shape to be used at the end of open subpaths when\n    // they are stroked. Values of LineCap are UndefinedCap, ButtCap,\n    // RoundCap, and SquareCap.\n    void            strokeLineCap ( const LineCap lineCap_ );\n    LineCap         strokeLineCap ( void ) const;\n\n    // Specify the shape to be used at the corners of paths (or other\n    // vector shapes) when they are stroked. Values of LineJoin are\n    // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.\n    void            strokeLineJoin ( const LineJoin lineJoin_ );\n    LineJoin        strokeLineJoin ( void ) const;\n\n    // Specify miter limit. When two line segments meet at a sharp\n    // angle and miter joins have been specified for 'lineJoin', it is\n    // possible for the miter to extend far beyond the thickness of\n    // the line stroking the path. The miterLimit' imposes a limit on\n    // the ratio of the miter length to the 'lineWidth'. The default\n    // value of this parameter is 4.\n    void            strokeMiterLimit ( const unsigned int miterLimit_ );\n    unsigned int    strokeMiterLimit ( void ) const;\n\n    // Pattern image to use while stroking object outlines.\n    void            strokePattern ( const Image &strokePattern_ );\n    Image           strokePattern ( void  ) const;\n\n    // Stroke width for drawing vector objects (default one)\n    void            strokeWidth ( const double strokeWidth_ );\n    double          strokeWidth ( void ) const;\n\n    // Subimage of an image sequence\n    void            subImage ( const unsigned int subImage_ );\n    unsigned int    subImage ( void ) const;\n\n    // Number of images relative to the base image\n    void            subRange ( const unsigned int subRange_ );\n    unsigned int    subRange ( void ) const;\n\n    // Annotation text encoding (e.g. \"UTF-16\")\n    void            textEncoding ( const std::string &encoding_ );\n    std::string     textEncoding ( void ) const;\n\n    // Tile name\n    void            tileName ( const std::string &tileName_ );\n    std::string     tileName ( void ) const;\n\n    // Number of colors in the image\n    unsigned long   totalColors ( void );\n\n    // Origin of coordinate system to use when annotating with text or drawing\n    void            transformOrigin ( const double x_,const  double y_ );\n\n    // Rotation to use when annotating with text or drawing\n    void            transformRotation ( const double angle_ );\n\n    // Reset transformation parameters to default\n    void            transformReset ( void );\n\n    // Scale to use when annotating with text or drawing\n    void            transformScale ( const double sx_, const double sy_ );\n\n    // Skew to use in X axis when annotating with text or drawing\n    void            transformSkewX ( const double skewx_ );\n\n    // Skew to use in Y axis when annotating with text or drawing\n    void            transformSkewY ( const double skewy_ );\n\n    // Image representation type (also see type operation)\n    //   Available types:\n    //    Bilevel        Grayscale       GrayscaleMatte\n    //    Palette        PaletteMatte    TrueColor\n    //    TrueColorMatte ColorSeparation ColorSeparationMatte\n    ImageType       type ( void ) const;\n\n    // Print detailed information about the image\n    void            verbose ( const bool verboseFlag_ );\n    bool            verbose ( void ) const;\n\n    // FlashPix viewing parameters\n    void            view ( const std::string &view_ );\n    std::string     view ( void ) const;\n\n    // X11 display to display to, obtain fonts from, or to capture\n    // image from\n    void            x11Display ( const std::string &display_ );\n    std::string     x11Display ( void ) const;\n\n    // x resolution of the image\n    void            xResolution ( const double x_resolution );\n    double          xResolution ( void ) const;\n\n    // y resolution of the image\n    void            yResolution ( const double y_resolution );\n    double          yResolution ( void ) const;\n\n    //////////////////////////////////////////////////////////////////////\n    //\n    // Low-level Pixel Access Routines\n    //\n    // Also see the Pixels class, which provides support for multiple\n    // cache views.\n    //\n    //////////////////////////////////////////////////////////////////////\n\n\n    // Transfers read-only pixels from the image to the pixel cache as\n    // defined by the specified region\n    const PixelPacket* getConstPixels ( const int x_, const int y_,\n                                        const unsigned int columns_,\n                                        const unsigned int rows_ ) const;\n\n    // Obtain mutable image pixel indexes (valid for PseudoClass images)\n    IndexPacket* getIndexes ( void );\n\n    // Obtain immutable image pixel indexes (valid for PseudoClass images)\n    const IndexPacket* getConstIndexes ( void ) const;\n\n    // Transfers pixels from the image to the pixel cache as defined\n    // by the specified region. Modified pixels may be subsequently\n    // transferred back to the image via syncPixels.  This method is\n    // valid for DirectClass images.\n    PixelPacket* getPixels ( const int x_, const int y_,\n                             const unsigned int columns_,\n                             const unsigned int rows_ );\n\n    // Allocates a pixel cache region to store image pixels as defined\n    // by the region rectangle.  This area is subsequently transferred\n    // from the pixel cache to the image via syncPixels.\n    PixelPacket* setPixels ( const int x_, const int y_,\n                             const unsigned int columns_,\n                             const unsigned int rows_ );\n\n    // Transfers the image cache pixels to the image.\n    void syncPixels ( void );\n\n    // Transfers one or more pixel components from a buffer or file\n    // into the image pixel cache of an image.\n    // Used to support image decoders.\n    void readPixels ( const QuantumType quantum_,\n                      const unsigned char *source_ );\n\n    // Transfers one or more pixel components from the image pixel\n    // cache to a buffer or file.\n    // Used to support image encoders.\n    void writePixels ( const QuantumType quantum_,\n                       unsigned char *destination_ );\n\n    //////////////////////////////////////////////////////////////////////\n    //\n    // No user-serviceable parts beyond this point\n    //\n    //////////////////////////////////////////////////////////////////////\n\n\n    // Construct with MagickLib::Image and default options\n    Image ( MagickLib::Image* image_ );\n\n    // Retrieve Image*\n    MagickLib::Image*& image( void );\n    const MagickLib::Image* constImage( void ) const;\n\n    // Retrieve Options*\n    Options* options( void );\n    const Options*  constOptions( void ) const;\n\n    // Retrieve ImageInfo*\n    MagickLib::ImageInfo * imageInfo( void );\n    const MagickLib::ImageInfo * constImageInfo( void ) const;\n\n    // Retrieve QuantizeInfo*\n    MagickLib::QuantizeInfo * quantizeInfo( void );\n    const MagickLib::QuantizeInfo * constQuantizeInfo( void ) const;\n\n    // Replace current image (reference counted)\n    MagickLib::Image* replaceImage ( MagickLib::Image* replacement_ );\n\n    // Prepare to update image (copy if reference > 1)\n    void            modifyImage ( void );\n\n    // Test for ImageMagick error and throw exception if error\n    void            throwImageException( void ) const;\n\n    // Register image with image registry or obtain registration id\n    long            registerId( void );\n\n    // Unregister image from image registry\n    void            unregisterId( void) ;\n\n  private:\n\n    void            throwImageException( MagickLib::ExceptionInfo &exception_ ) const;\n\n    ImageRef *      _imgRef;\n  };\n\n} // end of namespace Magick\n\n//\n// Inlines\n//\n\n\n//\n// Image\n//\n\n\n// Reduce noise in image using a noise peak elimination filter\ninline void Magick::Image::reduceNoise ( void )\n{\n  reduceNoise( 3.0 );\n}\n\n// Stroke width for drawing vector objects (default one)\ninline void Magick::Image::lineWidth ( const double lineWidth_ )\n{\n  strokeWidth( lineWidth_ );\n}\ninline double Magick::Image::lineWidth ( void ) const\n{\n  return strokeWidth( );\n}\n\n// Get image storage class\ninline Magick::ClassType Magick::Image::classType ( void ) const\n{\n  return static_cast<Magick::ClassType>(constImage()->storage_class);\n}\n\n// Get number of image columns\ninline unsigned int Magick::Image::columns ( void ) const\n{\n  return constImage()->columns;\n}\n\n// Get number of image rows\ninline unsigned int Magick::Image::rows ( void ) const\n{\n  return constImage()->rows;\n}\n\n#endif // Magick_Image_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/Include.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2018\n//\n// Inclusion of GraphicsMagick headers (with namespace magic)\n\n#ifndef Magick_Include_header\n#define Magick_Include_header\n\n#if !defined(_MAGICK_CONFIG_H)\n# define _MAGICK_CONFIG_H\n# if !defined(vms) && !defined(macintosh)\n#  include \"magick/magick_config.h\"\n# else\n#  include \"magick_config.h\"\n# endif\n# undef inline // Remove possible definition from config.h\n# undef class\n#endif\n\n#include <stdio.h>\n#include <stdarg.h>\n#include <stdlib.h>\n#include <time.h>\n#include <sys/types.h> /* POSIX 1990 header and declares size_t and ssize_t */\n\n#if defined(__BORLANDC__)\n# include <vcl.h> /* Borland C++ Builder 4.0 requirement */\n#endif // defined(__BORLANDC__)\n\n//\n// Include GraphicsMagick headers into namespace \"MagickLib\". If\n// MAGICK_IMPLEMENTATION is defined, include GraphicsMagick development\n// headers.  This scheme minimizes the possibility of conflict with\n// user code.\n//\nnamespace MagickLib\n{\n#include <magick/api.h>\n#undef inline // Remove possible definition from config.h\n\n#undef class\n}\n\n//\n// Provide appropriate DLL imports/exports for Visual C++,\n// Borland C++Builder and MinGW builds.\n//\n#if (defined(WIN32) || defined(WIN64)) && !defined (__CYGWIN__) //&& !defined(__MINGW32__)\n# define MagickCplusPlusDLLSupported\n#endif\n#if defined(MagickCplusPlusDLLSupported)\n#  if defined(_MT) && defined(_DLL) && !defined(_LIB) && !defined(STATIC_MAGICK)\n//\n// In a native Windows build, the following defines are used:\n//\n//   _MT         = Multithreaded\n//   _DLL        = Using code is part of a DLL\n//   _LIB        = Using code is being built as a library.\n//   _MAGICKMOD_ = Build uses loadable modules (Magick++ does not care about this)\n//\n// In the case where GraphicsMagick is built as a static library but the\n// using code is dynamic, STATIC_MAGICK may be defined in the project to\n// override triggering dynamic library behavior.\n//\n#    if defined(_VISUALC_)\n#      define MagickDLLExplicitTemplate     /* Explicit template instantiation in DLLs */\n#      pragma warning( disable: 4273 )      /* Disable the stupid dll linkage warnings */\n#      pragma warning( disable: 4251 )\n#    endif\n#    if !defined(MAGICK_IMPLEMENTATION)\n#      define MagickDLLDecl __declspec(dllimport)\n#      define MagickDLLDeclExtern extern __declspec(dllimport)\n#      if defined(_VISUALC_)\n#        pragma message( \"Magick++ lib DLL import\" )\n#      endif\n#    else\n#      if defined(__BORLANDC__) || defined(__MINGW32__)\n#        define MagickDLLDecl __declspec(dllexport)\n#        define MagickDLLDeclExtern __declspec(dllexport)\n#        if defined(__BORLANDC__)\n#          pragma message( \"BCBMagick++ lib DLL export\" )\n#        endif\n#      else\n#        define MagickDLLDecl __declspec(dllexport)\n#        define MagickDLLDeclExtern extern __declspec(dllexport)\n#      endif\n#      if defined(_VISUALC_)\n#        pragma message( \"Magick++ lib DLL export\" )\n#      endif\n#    endif\n#  else\n#    define MagickDLLDecl\n#    define MagickDLLDeclExtern\n#    if defined(_VISUALC_)\n#      pragma message( \"Magick++ lib static interface\" )\n#    endif\n#    if defined(_MSC_VER) && defined(STATIC_MAGICK) && !defined(NOAUTOLINK_MAGICK)\n#      if defined(_DEBUG)\n#        if defined(HasBZLIB)\n#          pragma comment(lib, \"CORE_DB_bzlib_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_DB_coders_.lib\")\n#        pragma comment(lib, \"CORE_DB_filters_.lib\")\n#        if defined(HasJBIG)\n#          pragma comment(lib, \"CORE_DB_jbig_.lib\")\n#        endif\n#        if defined(HasJP2)\n#          pragma comment(lib, \"CORE_DB_jp2_.lib\")\n#        endif\n#        if defined(HasJPEG)\n#          pragma comment(lib, \"CORE_DB_jpeg_.lib\")\n#        endif\n#        if defined(HasLCMS)\n#          pragma comment(lib, \"CORE_DB_lcms_.lib\")\n#        endif\n#        if defined(HasXML)\n#          pragma comment(lib, \"CORE_DB_libxml_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_DB_magick_.lib\")\n#        pragma comment(lib, \"CORE_DB_Magick++_.lib\")\n#        if defined(HasPNG)\n#          pragma comment(lib, \"CORE_DB_png_.lib\")\n#        endif\n#        if defined(HasTIFF)\n#          pragma comment(lib, \"CORE_DB_tiff_.lib\")\n#        endif\n#        if defined(HasTTF)\n#          pragma comment(lib, \"CORE_DB_ttf_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_DB_wand_.lib\")\n#        if defined(HasWEBP)\n#          pragma comment(lib, \"CORE_DB_webp_.lib\")\n#        endif\n#        if defined(HasWMFlite)\n#          pragma comment(lib, \"CORE_DB_wmf_.lib\")\n#        endif\n#        if defined(HasX11)\n#          pragma comment(lib, \"CORE_DB_xlib_.lib\")\n#        endif\n#        if defined(HasZLIB)\n#          pragma comment(lib, \"CORE_DB_zlib_.lib\")\n#        endif\n#      else\n#        if defined(HasBZLIB)\n#          pragma comment(lib, \"CORE_RL_bzlib_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_RL_coders_.lib\")\n#        pragma comment(lib, \"CORE_RL_filters_.lib\")\n#        if defined(HasJBIG)\n#          pragma comment(lib, \"CORE_RL_jbig_.lib\")\n#        endif\n#        if defined(HasJP2)\n#          pragma comment(lib, \"CORE_RL_jp2_.lib\")\n#        endif\n#        if defined(HasJPEG)\n#          pragma comment(lib, \"CORE_RL_jpeg_.lib\")\n#        endif\n#        if defined(HasLCMS)\n#          pragma comment(lib, \"CORE_RL_lcms_.lib\")\n#        endif\n#        if defined(HasXML)\n#          pragma comment(lib, \"CORE_RL_libxml_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_RL_magick_.lib\")\n#        pragma comment(lib, \"CORE_RL_Magick++_.lib\")\n#        if defined(HasPNG)\n#          pragma comment(lib, \"CORE_RL_png_.lib\")\n#        endif\n#        if defined(HasTIFF)\n#          pragma comment(lib, \"CORE_RL_tiff_.lib\")\n#        endif\n#        if defined(HasTTF)\n#          pragma comment(lib, \"CORE_RL_ttf_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_RL_wand_.lib\")\n#        if defined(HasWEBP)\n#          pragma comment(lib, \"CORE_RL_webp_.lib\")\n#        endif\n#        if defined(HasWMFlite)\n#          pragma comment(lib, \"CORE_RL_wmf_.lib\")\n#        endif\n#        if defined(HasX11)\n#          pragma comment(lib, \"CORE_RL_xlib_.lib\")\n#        endif\n#        if defined(HasZLIB)\n#          pragma comment(lib, \"CORE_RL_zlib_.lib\")\n#        endif\n#      endif\n#      if defined(_WIN32_WCE)\n#        pragma comment(lib, \"wsock32.lib\")\n#      else\n#        pragma comment(lib, \"ws2_32.lib\")\n#      endif\n#    endif\n#  endif\n#else\n#  define MagickDLLDecl\n#  define MagickDLLDeclExtern\n#endif\n\n#if (defined(WIN32) || defined(WIN64)) && defined(_VISUALC_)\n#  pragma warning(disable : 4996) /* function deprecation warnings */\n#endif\n\n#if defined(MAGICK_IMPLEMENTATION)\nnamespace MagickLib\n{\n#  include \"magick/enum_strings.h\"\n}\n#endif\n\n//\n// Import GraphicsMagick symbols and types which are used as part of the\n// Magick++ API definition into namespace \"Magick\".\n//\nnamespace Magick\n{\n  // The datatype for an RGB component\n  using MagickLib::Quantum;\n\n  // Image class types\n  using MagickLib::ClassType;\n  using MagickLib::UndefinedClass;\n  using MagickLib::DirectClass;\n  using MagickLib::PseudoClass;\n\n  // Channel types\n  using MagickLib::ChannelType;\n  using MagickLib::UndefinedChannel;\n  using MagickLib::RedChannel;\n  using MagickLib::CyanChannel;\n  using MagickLib::GreenChannel;\n  using MagickLib::MagentaChannel;\n  using MagickLib::BlueChannel;\n  using MagickLib::YellowChannel;\n  using MagickLib::OpacityChannel;\n  using MagickLib::BlackChannel;\n  using MagickLib::MatteChannel;\n  using MagickLib::AllChannels;\n  using MagickLib::GrayChannel;\n\n  // Color-space types\n  using MagickLib::ColorspaceType;\n  using MagickLib::UndefinedColorspace;\n  using MagickLib::RGBColorspace;\n  using MagickLib::GRAYColorspace;\n  using MagickLib::TransparentColorspace;\n  using MagickLib::OHTAColorspace;\n  using MagickLib::XYZColorspace;\n  using MagickLib::YCbCrColorspace;\n  using MagickLib::YCCColorspace;\n  using MagickLib::YIQColorspace;\n  using MagickLib::YPbPrColorspace;\n  using MagickLib::YUVColorspace;\n  using MagickLib::CMYKColorspace;\n  using MagickLib::sRGBColorspace;\n  using MagickLib::HSLColorspace;\n  using MagickLib::HWBColorspace;\n  using MagickLib::LABColorspace;\n  using MagickLib::CineonLogRGBColorspace;\n  using MagickLib::Rec601LumaColorspace;\n  using MagickLib::Rec709LumaColorspace;\n  using MagickLib::Rec709YCbCrColorspace;\n\n  // Composition operations\n  using MagickLib::AddCompositeOp;\n  using MagickLib::AtopCompositeOp;\n  using MagickLib::BumpmapCompositeOp;\n  using MagickLib::ClearCompositeOp;\n  using MagickLib::ColorizeCompositeOp;\n  using MagickLib::CompositeOperator;\n  using MagickLib::CopyBlueCompositeOp;\n  using MagickLib::CopyCompositeOp;\n  using MagickLib::CopyGreenCompositeOp;\n  using MagickLib::CopyOpacityCompositeOp;\n  using MagickLib::CopyRedCompositeOp;\n  using MagickLib::DarkenCompositeOp;\n  using MagickLib::DifferenceCompositeOp;\n  using MagickLib::DisplaceCompositeOp;\n  using MagickLib::DissolveCompositeOp;\n  using MagickLib::HueCompositeOp;\n  using MagickLib::InCompositeOp;\n  using MagickLib::LightenCompositeOp;\n  using MagickLib::LuminizeCompositeOp;\n  using MagickLib::MinusCompositeOp;\n  using MagickLib::ModulateCompositeOp;\n  using MagickLib::MultiplyCompositeOp;\n  using MagickLib::NoCompositeOp;\n  using MagickLib::OutCompositeOp;\n  using MagickLib::OverCompositeOp;\n  using MagickLib::OverlayCompositeOp;\n  using MagickLib::PlusCompositeOp;\n  using MagickLib::SaturateCompositeOp;\n  using MagickLib::ScreenCompositeOp;\n  using MagickLib::SubtractCompositeOp;\n  using MagickLib::ThresholdCompositeOp;\n  using MagickLib::UndefinedCompositeOp;\n  using MagickLib::XorCompositeOp;\n  using MagickLib::CopyCyanCompositeOp;\n  using MagickLib::CopyMagentaCompositeOp;\n  using MagickLib::CopyYellowCompositeOp;\n  using MagickLib::CopyBlackCompositeOp;\n  using MagickLib::DivideCompositeOp;\n  using MagickLib::HardLightCompositeOp;\n  using MagickLib::ExclusionCompositeOp;\n  using MagickLib::ColorDodgeCompositeOp;\n  using MagickLib::ColorBurnCompositeOp;\n  using MagickLib::SoftLightCompositeOp;\n  using MagickLib::LinearBurnCompositeOp;\n  using MagickLib::LinearDodgeCompositeOp;\n  using MagickLib::LinearLightCompositeOp;\n  using MagickLib::VividLightCompositeOp;\n  using MagickLib::PinLightCompositeOp;\n  using MagickLib::HardMixCompositeOp;\n\n  // Compression algorithms\n  using MagickLib::CompressionType;\n  using MagickLib::UndefinedCompression;\n  using MagickLib::NoCompression;\n  using MagickLib::BZipCompression;\n  using MagickLib::FaxCompression;\n  using MagickLib::Group3Compression;\n  using MagickLib::Group4Compression;\n  using MagickLib::JPEGCompression;\n  using MagickLib::LZWCompression;\n  using MagickLib::RLECompression;\n  using MagickLib::ZipCompression;\n  using MagickLib::LZMACompression;\n  using MagickLib::JPEG2000Compression;\n  using MagickLib::JBIG1Compression;\n  using MagickLib::JBIG2Compression;\n  using MagickLib::ZSTDCompression;\n  using MagickLib::WebPCompression;\n\n  using MagickLib::DisposeType;\n  using MagickLib::UndefinedDispose;\n  using MagickLib::NoneDispose;\n  using MagickLib::BackgroundDispose;\n  using MagickLib::PreviousDispose;\n\n  // Endian options\n  using MagickLib::EndianType;\n  using MagickLib::UndefinedEndian;\n  using MagickLib::LSBEndian;\n  using MagickLib::MSBEndian;\n  using MagickLib::NativeEndian;\n\n  // Exception types\n  using MagickLib::ExceptionType;\n  using MagickLib::UndefinedException;\n  using MagickLib::EventException;\n  using MagickLib::ExceptionEvent;\n  using MagickLib::ResourceEvent;\n  using MagickLib::ResourceLimitEvent;\n  using MagickLib::TypeEvent;\n  using MagickLib::AnnotateEvent;\n  using MagickLib::OptionEvent;\n  using MagickLib::DelegateEvent;\n  using MagickLib::MissingDelegateEvent;\n  using MagickLib::CorruptImageEvent;\n  using MagickLib::FileOpenEvent;\n  using MagickLib::BlobEvent;\n  using MagickLib::StreamEvent;\n  using MagickLib::CacheEvent;\n  using MagickLib::CoderEvent;\n  using MagickLib::ModuleEvent;\n  using MagickLib::DrawEvent;\n  using MagickLib::RenderEvent;\n  using MagickLib::ImageEvent;\n  using MagickLib::WandEvent;\n  using MagickLib::TemporaryFileEvent;\n  using MagickLib::TransformEvent;\n  using MagickLib::XServerEvent;\n  using MagickLib::X11Event;\n  using MagickLib::UserEvent;\n  using MagickLib::MonitorEvent;\n  using MagickLib::LocaleEvent;\n  using MagickLib::DeprecateEvent;\n  using MagickLib::RegistryEvent;\n  using MagickLib::ConfigureEvent;\n  using MagickLib::WarningException;\n  using MagickLib::ExceptionWarning;\n  using MagickLib::ResourceWarning;\n  using MagickLib::ResourceLimitWarning;\n  using MagickLib::TypeWarning;\n  using MagickLib::AnnotateWarning;\n  using MagickLib::OptionWarning;\n  using MagickLib::DelegateWarning;\n  using MagickLib::MissingDelegateWarning;\n  using MagickLib::CorruptImageWarning;\n  using MagickLib::FileOpenWarning;\n  using MagickLib::BlobWarning;\n  using MagickLib::StreamWarning;\n  using MagickLib::CacheWarning;\n  using MagickLib::CoderWarning;\n  using MagickLib::ModuleWarning;\n  using MagickLib::DrawWarning;\n  using MagickLib::RenderWarning;\n  using MagickLib::ImageWarning;\n  using MagickLib::WandWarning;\n  using MagickLib::TemporaryFileWarning;\n  using MagickLib::TransformWarning;\n  using MagickLib::XServerWarning;\n  using MagickLib::X11Warning;\n  using MagickLib::UserWarning;\n  using MagickLib::MonitorWarning;\n  using MagickLib::LocaleWarning;\n  using MagickLib::DeprecateWarning;\n  using MagickLib::RegistryWarning;\n  using MagickLib::ConfigureWarning;\n  using MagickLib::ErrorException;\n  using MagickLib::ExceptionError;\n  using MagickLib::ResourceError;\n  using MagickLib::ResourceLimitError;\n  using MagickLib::TypeError;\n  using MagickLib::AnnotateError;\n  using MagickLib::OptionError;\n  using MagickLib::DelegateError;\n  using MagickLib::MissingDelegateError;\n  using MagickLib::CorruptImageError;\n  using MagickLib::FileOpenError;\n  using MagickLib::BlobError;\n  using MagickLib::StreamError;\n  using MagickLib::CacheError;\n  using MagickLib::CoderError;\n  using MagickLib::ModuleError;\n  using MagickLib::DrawError;\n  using MagickLib::RenderError;\n  using MagickLib::ImageError;\n  using MagickLib::WandError;\n  using MagickLib::TemporaryFileError;\n  using MagickLib::TransformError;\n  using MagickLib::XServerError;\n  using MagickLib::X11Error;\n  using MagickLib::UserError;\n  using MagickLib::MonitorError;\n  using MagickLib::LocaleError;\n  using MagickLib::DeprecateError;\n  using MagickLib::RegistryError;\n  using MagickLib::ConfigureError;\n  using MagickLib::FatalErrorException;\n  using MagickLib::ExceptionFatalError;\n  using MagickLib::ResourceFatalError;\n  using MagickLib::ResourceLimitFatalError;\n  using MagickLib::TypeFatalError;\n  using MagickLib::AnnotateFatalError;\n  using MagickLib::OptionFatalError;\n  using MagickLib::DelegateFatalError;\n  using MagickLib::MissingDelegateFatalError;\n  using MagickLib::CorruptImageFatalError;\n  using MagickLib::FileOpenFatalError;\n  using MagickLib::BlobFatalError;\n  using MagickLib::StreamFatalError;\n  using MagickLib::CacheFatalError;\n  using MagickLib::CoderFatalError;\n  using MagickLib::ModuleFatalError;\n  using MagickLib::DrawFatalError;\n  using MagickLib::RenderFatalError;\n  using MagickLib::ImageFatalError;\n  using MagickLib::WandFatalError;\n  using MagickLib::TemporaryFileFatalError;\n  using MagickLib::TransformFatalError;\n  using MagickLib::XServerFatalError;\n  using MagickLib::X11FatalError;\n  using MagickLib::UserFatalError;\n  using MagickLib::MonitorFatalError;\n  using MagickLib::LocaleFatalError;\n  using MagickLib::DeprecateFatalError;\n  using MagickLib::RegistryFatalError;\n  using MagickLib::ConfigureFatalError;\n\n  // Fill rules\n  using MagickLib::FillRule;\n  using MagickLib::UndefinedRule;\n  using MagickLib::EvenOddRule;\n  using MagickLib::NonZeroRule;\n\n  // Filter types\n  using MagickLib::FilterTypes;\n  using MagickLib::UndefinedFilter;\n  using MagickLib::PointFilter;\n  using MagickLib::BoxFilter;\n  using MagickLib::TriangleFilter;\n  using MagickLib::HermiteFilter;\n  using MagickLib::HanningFilter;\n  using MagickLib::HammingFilter;\n  using MagickLib::BlackmanFilter;\n  using MagickLib::GaussianFilter;\n  using MagickLib::QuadraticFilter;\n  using MagickLib::CubicFilter;\n  using MagickLib::CatromFilter;\n  using MagickLib::MitchellFilter;\n  using MagickLib::LanczosFilter;\n  using MagickLib::BesselFilter;\n  using MagickLib::SincFilter;\n\n  // Bit gravity\n  using MagickLib::GravityType;\n  using MagickLib::ForgetGravity;\n  using MagickLib::NorthWestGravity;\n  using MagickLib::NorthGravity;\n  using MagickLib::NorthEastGravity;\n  using MagickLib::WestGravity;\n  using MagickLib::CenterGravity;\n  using MagickLib::EastGravity;\n  using MagickLib::SouthWestGravity;\n  using MagickLib::SouthGravity;\n  using MagickLib::SouthEastGravity;\n  using MagickLib::StaticGravity;\n\n  // Image types\n  using MagickLib::ImageType;\n  using MagickLib::UndefinedType;\n  using MagickLib::BilevelType;\n  using MagickLib::GrayscaleType;\n  using MagickLib::GrayscaleMatteType;\n  using MagickLib::PaletteType;\n  using MagickLib::PaletteMatteType;\n  using MagickLib::TrueColorType;\n  using MagickLib::TrueColorMatteType;\n  using MagickLib::ColorSeparationType;\n  using MagickLib::ColorSeparationMatteType;\n  using MagickLib::OptimizeType;\n\n  // Interlace types\n  using MagickLib::InterlaceType;\n  using MagickLib::UndefinedInterlace;\n  using MagickLib::NoInterlace;\n  using MagickLib::LineInterlace;\n  using MagickLib::PlaneInterlace;\n  using MagickLib::PartitionInterlace;\n\n  // Line cap types\n  using MagickLib::LineCap;\n  using MagickLib::UndefinedCap;\n  using MagickLib::ButtCap;\n  using MagickLib::RoundCap;\n  using MagickLib::SquareCap;\n\n  // Line join types\n  using MagickLib::LineJoin;\n  using MagickLib::UndefinedJoin;\n  using MagickLib::MiterJoin;\n  using MagickLib::RoundJoin;\n  using MagickLib::BevelJoin;\n\n  // Noise types\n  using MagickLib::NoiseType;\n  using MagickLib::UniformNoise;\n  using MagickLib::GaussianNoise;\n  using MagickLib::MultiplicativeGaussianNoise;\n  using MagickLib::ImpulseNoise;\n  using MagickLib::LaplacianNoise;\n  using MagickLib::PoissonNoise;\n  using MagickLib::RandomNoise;\n\n  // Orientation types\n  using MagickLib::OrientationType;\n  using MagickLib::UndefinedOrientation;\n  using MagickLib::TopLeftOrientation;\n  using MagickLib::TopRightOrientation;\n  using MagickLib::BottomRightOrientation;\n  using MagickLib::BottomLeftOrientation;\n  using MagickLib::LeftTopOrientation;\n  using MagickLib::RightTopOrientation;\n  using MagickLib::RightBottomOrientation;\n  using MagickLib::LeftBottomOrientation;\n\n  // Paint methods\n  using MagickLib::PaintMethod;\n  using MagickLib::PointMethod;\n  using MagickLib::ReplaceMethod;\n  using MagickLib::FloodfillMethod;\n  using MagickLib::FillToBorderMethod;\n  using MagickLib::ResetMethod;\n\n  // Arithmetic and bitwise operators\n  using MagickLib::UndefinedQuantumOp;\n  using MagickLib::AddQuantumOp;\n  using MagickLib::AndQuantumOp;\n  using MagickLib::AssignQuantumOp;\n  using MagickLib::DivideQuantumOp;\n  using MagickLib::LShiftQuantumOp;\n  using MagickLib::MultiplyQuantumOp;\n  using MagickLib::OrQuantumOp;\n  using MagickLib::RShiftQuantumOp;\n  using MagickLib::SubtractQuantumOp;\n  using MagickLib::ThresholdQuantumOp;\n  using MagickLib::ThresholdBlackQuantumOp;\n  using MagickLib::ThresholdWhiteQuantumOp;\n  using MagickLib::ThresholdBlackNegateQuantumOp;\n  using MagickLib::ThresholdWhiteNegateQuantumOp;\n  using MagickLib::XorQuantumOp;\n  using MagickLib::NoiseGaussianQuantumOp;\n  using MagickLib::NoiseImpulseQuantumOp;\n  using MagickLib::NoiseLaplacianQuantumOp;\n  using MagickLib::NoiseMultiplicativeQuantumOp;\n  using MagickLib::NoisePoissonQuantumOp;\n  using MagickLib::NoiseUniformQuantumOp;\n  using MagickLib::NegateQuantumOp;\n  using MagickLib::GammaQuantumOp;\n  using MagickLib::DepthQuantumOp;\n  using MagickLib::LogQuantumOp;\n  using MagickLib::MaxQuantumOp;\n  using MagickLib::MinQuantumOp;\n  using MagickLib::PowQuantumOp;\n  using MagickLib::QuantumOperator;\n\n  // Preview types.  Not currently used by Magick++\n  using MagickLib::PreviewType;\n  using MagickLib::UndefinedPreview;\n  using MagickLib::RotatePreview;\n  using MagickLib::ShearPreview;\n  using MagickLib::RollPreview;\n  using MagickLib::HuePreview;\n  using MagickLib::SaturationPreview;\n  using MagickLib::BrightnessPreview;\n  using MagickLib::GammaPreview;\n  using MagickLib::SpiffPreview;\n  using MagickLib::DullPreview;\n  using MagickLib::GrayscalePreview;\n  using MagickLib::QuantizePreview;\n  using MagickLib::DespecklePreview;\n  using MagickLib::ReduceNoisePreview;\n  using MagickLib::AddNoisePreview;\n  using MagickLib::SharpenPreview;\n  using MagickLib::BlurPreview;\n  using MagickLib::ThresholdPreview;\n  using MagickLib::EdgeDetectPreview;\n  using MagickLib::SpreadPreview;\n  using MagickLib::SolarizePreview;\n  using MagickLib::ShadePreview;\n  using MagickLib::RaisePreview;\n  using MagickLib::SegmentPreview;\n  using MagickLib::SwirlPreview;\n  using MagickLib::ImplodePreview;\n  using MagickLib::WavePreview;\n  using MagickLib::OilPaintPreview;\n  using MagickLib::CharcoalDrawingPreview;\n  using MagickLib::JPEGPreview;\n\n  // Quantum types\n  using MagickLib::QuantumType;\n  using MagickLib::IndexQuantum;\n  using MagickLib::GrayQuantum;\n  using MagickLib::IndexAlphaQuantum;\n  using MagickLib::GrayAlphaQuantum;\n  using MagickLib::RedQuantum;\n  using MagickLib::CyanQuantum;\n  using MagickLib::GreenQuantum;\n  using MagickLib::YellowQuantum;\n  using MagickLib::BlueQuantum;\n  using MagickLib::MagentaQuantum;\n  using MagickLib::AlphaQuantum;\n  using MagickLib::BlackQuantum;\n  using MagickLib::RGBQuantum;\n  using MagickLib::RGBAQuantum;\n  using MagickLib::CMYKQuantum;\n  using MagickLib::CIEYQuantum;\n  using MagickLib::CIEXYZQuantum;\n\n  // Quantum sample types\n  using MagickLib::QuantumSampleType;\n  using MagickLib::UndefinedQuantumSampleType;\n  using MagickLib::UnsignedQuantumSampleType;\n  using MagickLib::FloatQuantumSampleType;\n\n  // Rendering intents\n  using MagickLib::RenderingIntent;\n  using MagickLib::UndefinedIntent;\n  using MagickLib::SaturationIntent;\n  using MagickLib::PerceptualIntent;\n  using MagickLib::AbsoluteIntent;\n  using MagickLib::RelativeIntent;\n\n  // Resolution units\n  using MagickLib::ResolutionType;\n  using MagickLib::UndefinedResolution;\n  using MagickLib::PixelsPerInchResolution;\n  using MagickLib::PixelsPerCentimeterResolution;\n\n  // PixelPacket structure\n  using MagickLib::PixelPacket;\n\n  // IndexPacket type\n  using MagickLib::IndexPacket;\n\n  // ImageStatistics type\n  using MagickLib::ImageStatistics;\n\n  // StorageType type\n  using MagickLib::StorageType;\n  using MagickLib::CharPixel;\n  using MagickLib::ShortPixel;\n  using MagickLib::IntegerPixel;\n  using MagickLib::LongPixel;\n  using MagickLib::FloatPixel;\n  using MagickLib::DoublePixel;\n\n  // StretchType type\n  using MagickLib::StretchType;\n  using MagickLib::NormalStretch;\n  using MagickLib::UltraCondensedStretch;\n  using MagickLib::ExtraCondensedStretch;\n  using MagickLib::CondensedStretch;\n  using MagickLib::SemiCondensedStretch;\n  using MagickLib::SemiExpandedStretch;\n  using MagickLib::ExpandedStretch;\n  using MagickLib::ExtraExpandedStretch;\n  using MagickLib::UltraExpandedStretch;\n  using MagickLib::AnyStretch;\n\n  // StyleType type\n  using MagickLib::StyleType;\n  using MagickLib::NormalStyle;\n  using MagickLib::ItalicStyle;\n  using MagickLib::ObliqueStyle;\n  using MagickLib::AnyStyle;\n\n  // Decoration types\n  using MagickLib::DecorationType;\n  using MagickLib::NoDecoration;\n  using MagickLib::UnderlineDecoration;\n  using MagickLib::OverlineDecoration;\n  using MagickLib::LineThroughDecoration;\n\n  // Resource types\n  using MagickLib::ResourceType;\n  using MagickLib::DiskResource;\n  using MagickLib::FileResource;\n  using MagickLib::MapResource;\n  using MagickLib::MemoryResource;\n  using MagickLib::PixelsResource;\n  using MagickLib::ThreadsResource;\n  using MagickLib::WidthResource;\n  using MagickLib::HeightResource;\n\n  // Virtual pixel methods\n  using MagickLib::VirtualPixelMethod;\n  using MagickLib::UndefinedVirtualPixelMethod;\n  using MagickLib::ConstantVirtualPixelMethod;\n  using MagickLib::EdgeVirtualPixelMethod;\n  using MagickLib::MirrorVirtualPixelMethod;\n  using MagickLib::TileVirtualPixelMethod;\n\n#if defined(MAGICK_IMPLEMENTATION)\n  //\n  // GraphicsMagick symbols used in implementation code\n  //\n  using MagickLib::AccessDefinition;\n  using MagickLib::AccessImmutableIndexes;\n  using MagickLib::AccessMutableIndexes;\n  using MagickLib::AcquireCacheViewPixels;\n  using MagickLib::AcquireImagePixels;\n  using MagickLib::AdaptiveThresholdImage;\n  using MagickLib::AddDefinition;\n  using MagickLib::AddDefinitions;\n  using MagickLib::AddNoiseImage;\n  using MagickLib::AddNoiseImageChannel;\n  using MagickLib::AffineMatrix;\n  using MagickLib::AffineTransformImage;\n  using MagickLib::AllocateImage;\n  using MagickLib::AnnotateImage;\n  using MagickLib::AreaValue;\n  using MagickLib::AspectValue;\n  using MagickLib::Base64Decode;\n  using MagickLib::Base64Encode;\n  using MagickLib::BlobError;\n  using MagickLib::BlobFatalError;\n  using MagickLib::BlobToImage;\n  using MagickLib::BlobWarning;\n  using MagickLib::BlurImage;\n  using MagickLib::BlurImageChannel;\n  using MagickLib::BorderImage;\n  using MagickLib::CacheError;\n  using MagickLib::CacheFatalError;\n  using MagickLib::CacheWarning;\n  using MagickLib::CdlImage;\n  using MagickLib::ChannelImage;\n  using MagickLib::CharcoalImage;\n  using MagickLib::ChopImage;\n  using MagickLib::CloneDrawInfo;\n  using MagickLib::CloneImage;\n  using MagickLib::CloneImageInfo;\n  using MagickLib::CloneQuantizeInfo;\n  using MagickLib::CloseCacheView;\n  using MagickLib::CoderError;\n  using MagickLib::CoderFatalError;\n  using MagickLib::CoderWarning;\n  using MagickLib::ColorFloodfillImage;\n  using MagickLib::ColorizeImage;\n  using MagickLib::ColorMatrixImage;\n  using MagickLib::CompositeImage;\n  using MagickLib::ConfigureError;\n  using MagickLib::ConfigureFatalError;\n  using MagickLib::ConfigureWarning;\n  using MagickLib::ConstituteImage;\n  using MagickLib::ContrastImage;\n  using MagickLib::ConvolveImage;\n  using MagickLib::CopyException;\n  using MagickLib::CorruptImageError;\n  using MagickLib::CorruptImageFatalError;\n  using MagickLib::CorruptImageWarning;\n  using MagickLib::CropImage;\n  using MagickLib::CycleColormapImage;\n  using MagickLib::DelegateError;\n  using MagickLib::DelegateFatalError;\n  using MagickLib::DelegateWarning;\n  using MagickLib::DeleteMagickRegistry;\n  using MagickLib::DespeckleImage;\n  using MagickLib::DestroyDrawInfo;\n  using MagickLib::DestroyExceptionInfo;\n  using MagickLib::DestroyImageInfo;\n  using MagickLib::DestroyImageList;\n  using MagickLib::DestroyMagick;\n  using MagickLib::DestroyQuantizeInfo;\n  using MagickLib::DispatchImage;\n  using MagickLib::DisplayImages;\n  using MagickLib::DrawAffine;\n  using MagickLib::DrawAllocateContext;\n  using MagickLib::DrawAnnotation;\n  using MagickLib::DrawArc;\n  using MagickLib::DrawBezier;\n  using MagickLib::DrawCircle;\n  using MagickLib::DrawColor;\n  using MagickLib::DrawComment;\n  using MagickLib::DrawComposite;\n  using MagickLib::DrawContext;\n  using MagickLib::DrawDestroyContext;\n  using MagickLib::DrawEllipse;\n  using MagickLib::DrawError;\n  using MagickLib::DrawFatalError;\n  using MagickLib::DrawImage;\n  using MagickLib::DrawInfo;\n  using MagickLib::DrawLine;\n  using MagickLib::DrawMatte;\n  using MagickLib::DrawPathClose;\n  using MagickLib::DrawPathCurveToAbsolute;\n  using MagickLib::DrawPathCurveToQuadraticBezierAbsolute;\n  using MagickLib::DrawPathCurveToQuadraticBezierRelative;\n  using MagickLib::DrawPathCurveToQuadraticBezierSmoothAbsolute;\n  using MagickLib::DrawPathCurveToQuadraticBezierSmoothRelative;\n  using MagickLib::DrawPathCurveToRelative;\n  using MagickLib::DrawPathCurveToSmoothAbsolute;\n  using MagickLib::DrawPathCurveToSmoothRelative;\n  using MagickLib::DrawPathEllipticArcAbsolute;\n  using MagickLib::DrawPathEllipticArcRelative;\n  using MagickLib::DrawPathFinish;\n  using MagickLib::DrawPathLineToAbsolute;\n  using MagickLib::DrawPathLineToHorizontalAbsolute;\n  using MagickLib::DrawPathLineToHorizontalRelative;\n  using MagickLib::DrawPathLineToRelative;\n  using MagickLib::DrawPathLineToVerticalAbsolute;\n  using MagickLib::DrawPathLineToVerticalRelative;\n  using MagickLib::DrawPathMoveToAbsolute;\n  using MagickLib::DrawPathMoveToRelative;\n  using MagickLib::DrawPathStart;\n  using MagickLib::DrawPoint;\n  using MagickLib::DrawPolygon;\n  using MagickLib::DrawPolyline;\n  using MagickLib::DrawPopClipPath;\n  using MagickLib::DrawPopDefs;\n  using MagickLib::DrawPopGraphicContext;\n  using MagickLib::DrawPopPattern;\n  using MagickLib::DrawPushClipPath;\n  using MagickLib::DrawPushDefs;\n  using MagickLib::DrawPushGraphicContext;\n  using MagickLib::DrawPushPattern;\n  using MagickLib::DrawRectangle;\n  using MagickLib::DrawRender;\n  using MagickLib::DrawRotate;\n  using MagickLib::DrawRoundRectangle;\n  using MagickLib::DrawScale;\n  using MagickLib::DrawSetClipPath;\n  using MagickLib::DrawSetClipRule;\n  using MagickLib::DrawSetClipUnits;\n  using MagickLib::DrawSetFillColor;\n  using MagickLib::DrawSetFillColorString;\n  using MagickLib::DrawSetFillOpacity;\n  using MagickLib::DrawSetFillPatternURL;\n  using MagickLib::DrawSetFillRule;\n  using MagickLib::DrawSetFont;\n  using MagickLib::DrawSetFontFamily;\n  using MagickLib::DrawSetFontSize;\n  using MagickLib::DrawSetFontStretch;\n  using MagickLib::DrawSetFontStyle;\n  using MagickLib::DrawSetFontWeight;\n  using MagickLib::DrawSetGravity;\n  using MagickLib::DrawSetStrokeAntialias;\n  using MagickLib::DrawSetStrokeColor;\n  using MagickLib::DrawSetStrokeColorString;\n  using MagickLib::DrawSetStrokeDashArray;\n  using MagickLib::DrawSetStrokeDashOffset;\n  using MagickLib::DrawSetStrokeLineCap;\n  using MagickLib::DrawSetStrokeLineJoin;\n  using MagickLib::DrawSetStrokeMiterLimit;\n  using MagickLib::DrawSetStrokeOpacity;\n  using MagickLib::DrawSetStrokePatternURL;\n  using MagickLib::DrawSetStrokeWidth;\n  using MagickLib::DrawSetTextAntialias;\n  using MagickLib::DrawSetTextDecoration;\n  using MagickLib::DrawSetTextEncoding;\n  using MagickLib::DrawSetTextUnderColor;\n  using MagickLib::DrawSetTextUnderColorString;\n  using MagickLib::DrawSetViewbox;\n  using MagickLib::DrawSkewX;\n  using MagickLib::DrawSkewY;\n  using MagickLib::DrawTranslate;\n  using MagickLib::DrawWarning;\n  using MagickLib::EdgeImage;\n  using MagickLib::EmbossImage;\n  using MagickLib::EnhanceImage;\n  using MagickLib::EqualizeImage;\n  using MagickLib::ExceptionInfo;\n  using MagickLib::ExecuteModuleProcess;\n  using MagickLib::ExportImagePixelArea;\n  using MagickLib::ExtentImage;\n  using MagickLib::FileOpenError;\n  using MagickLib::FileOpenFatalError;\n  using MagickLib::FileOpenWarning;\n  using MagickLib::FlattenImages;\n  using MagickLib::FlipImage;\n  using MagickLib::FlopImage;\n  using MagickLib::FormatString;\n  using MagickLib::FrameImage;\n  using MagickLib::FrameInfo;\n  using MagickLib::GammaImage;\n  using MagickLib::GammaImage;\n  using MagickLib::GaussianBlurImage;\n  using MagickLib::GaussianBlurImageChannel;\n  using MagickLib::GetBlobSize;\n  using MagickLib::GetCacheViewIndexes;\n  using MagickLib::GetCacheViewPixels;\n  using MagickLib::GetColorTuple;\n  using MagickLib::GetDrawInfo;\n  using MagickLib::GetExceptionInfo;\n  using MagickLib::GetGeometry;\n  using MagickLib::GetImageAttribute;\n  using MagickLib::GetImageBoundingBox;\n  using MagickLib::GetImageChannelDepth;\n  using MagickLib::GetImageClipMask;\n  using MagickLib::GetImageDepth;\n  using MagickLib::GetImageGeometry;\n  using MagickLib::GetImageInfo;\n  using MagickLib::GetImagePixels;\n  using MagickLib::GetImageProfile;\n  using MagickLib::GetImageQuantizeError;\n  using MagickLib::GetImageStatistics;\n  using MagickLib::GetImageType;\n  using MagickLib::GetMagickGeometry;\n  using MagickLib::GetMagickInfo;\n  using MagickLib::GetMagickInfoArray;\n  using MagickLib::GetMagickRegistry;\n  using MagickLib::GetNumberColors;\n  using MagickLib::GetPageGeometry;\n  using MagickLib::GetQuantizeInfo;\n  using MagickLib::GetTypeMetrics;\n  using MagickLib::GlobExpression;\n  using MagickLib::GreaterValue;\n  using MagickLib::HaldClutImage;\n  using MagickLib::HSLTransform;\n  using MagickLib::HeightValue;\n  using MagickLib::IdentityAffine;\n  using MagickLib::ImageAttribute;\n  using MagickLib::ImageError;\n  using MagickLib::ImageFatalError;\n  using MagickLib::ImageInfo;\n  using MagickLib::ImageInfoRegistryType;\n  using MagickLib::ImageRegistryType;\n  using MagickLib::ImageToBlob;\n  using MagickLib::ImageWarning;\n  using MagickLib::ImplodeImage;\n  using MagickLib::ImportImagePixelArea;\n  using MagickLib::IsEventLogging;\n  using MagickLib::IsGeometry;\n  using MagickLib::IsImagesEqual;\n  using MagickLib::IsSubimage;\n  using MagickLib::LessValue;\n  using MagickLib::LevelImage;\n  using MagickLib::LevelImageChannel;\n  using MagickLib::LocaleCompare;\n  using MagickLib::LogMagickEvent;\n  using MagickLib::MagickFree;\n  using MagickLib::MagickInfo;\n  using MagickLib::MagickMalloc;\n  using MagickLib::MagickRealloc;\n  using MagickLib::MagickStrlCpy;\n  using MagickLib::MagickToMime;\n  using MagickLib::MagnifyImage;\n  using MagickLib::MapImage;\n  using MagickLib::MatteFloodfillImage;\n  using MagickLib::MedianFilterImage;\n  using MagickLib::MinifyImage;\n  using MagickLib::MinimumValue;\n  using MagickLib::MissingDelegateError;\n  using MagickLib::MissingDelegateFatalError;\n  using MagickLib::MissingDelegateWarning;\n  using MagickLib::ModulateImage;\n  using MagickLib::ModuleError;\n  using MagickLib::ModuleFatalError;\n  using MagickLib::ModuleWarning;\n  using MagickLib::MonitorError;\n  using MagickLib::MonitorFatalError;\n  using MagickLib::MonitorWarning;\n  using MagickLib::MontageInfo;\n  using MagickLib::MotionBlurImage;\n  using MagickLib::NegateImage;\n  using MagickLib::NoValue;\n  using MagickLib::NoiseType;\n  using MagickLib::NormalizeImage;\n  using MagickLib::OilPaintImage;\n  using MagickLib::OpaqueImage;\n  using MagickLib::OpenCacheView;\n  using MagickLib::OptionError;\n  using MagickLib::OptionFatalError;\n  using MagickLib::OptionWarning;\n  using MagickLib::PercentValue;\n  using MagickLib::PingBlob;\n  using MagickLib::PingImage;\n  using MagickLib::PointInfo;\n  using MagickLib::PopImagePixels;\n  using MagickLib::ProfileImage;\n  using MagickLib::ProfileInfo;\n  using MagickLib::PushImagePixels;\n  using MagickLib::QuantizeImage;\n  using MagickLib::QuantizeInfo;\n  using MagickLib::QuantumOperatorImage;\n  using MagickLib::QuantumOperatorRegionImage;\n  using MagickLib::QueryColorDatabase;\n  using MagickLib::RGBTransformImage;\n  using MagickLib::RaiseImage;\n  using MagickLib::RandomChannelThresholdImage;\n  using MagickLib::ReadImage;\n  using MagickLib::RectangleInfo;\n  using MagickLib::RectangleInfo;\n  using MagickLib::ReduceNoiseImage;\n  using MagickLib::RegisterMagickInfo;\n  using MagickLib::RegistryError;\n  using MagickLib::RegistryFatalError;\n  using MagickLib::RegistryType;\n  using MagickLib::RegistryWarning;\n  using MagickLib::RemoveDefinitions;\n  using MagickLib::ResizeImage;\n  using MagickLib::ResourceLimitError;\n  using MagickLib::ResourceLimitFatalError;\n  using MagickLib::ResourceLimitWarning;\n  using MagickLib::RollImage;\n  using MagickLib::RotateImage;\n  using MagickLib::SampleImage;\n  using MagickLib::ScaleImage;\n  using MagickLib::SegmentImage;\n  using MagickLib::SetCacheViewPixels;\n  using MagickLib::SetClientName;\n  using MagickLib::SetImage;\n  using MagickLib::SetImageAttribute;\n  using MagickLib::SetImageChannelDepth;\n  using MagickLib::SetImageClipMask;\n  using MagickLib::SetImageDepth;\n  using MagickLib::SetImageInfo;\n  using MagickLib::SetImageOpacity;\n  using MagickLib::SetImagePixels;\n  using MagickLib::SetImageProfile;\n  using MagickLib::SetImageType;\n  using MagickLib::SetLogEventMask;\n  using MagickLib::SetMagickInfo;\n  using MagickLib::SetMagickRegistry;\n  using MagickLib::SetMagickResourceLimit;\n  using MagickLib::SetMagickResourceLimit;\n  using MagickLib::ShadeImage;\n  using MagickLib::SharpenImage;\n  using MagickLib::SharpenImageChannel;\n  using MagickLib::ShaveImage;\n  using MagickLib::ShearImage;\n  using MagickLib::SignatureImage;\n  using MagickLib::SolarizeImage;\n  using MagickLib::SpreadImage;\n  using MagickLib::SteganoImage;\n  using MagickLib::StereoImage;\n  using MagickLib::StreamError;\n  using MagickLib::StreamFatalError;\n  using MagickLib::StreamWarning;\n  using MagickLib::SwirlImage;\n  using MagickLib::SyncCacheViewPixels;\n  using MagickLib::SyncImage;\n  using MagickLib::SyncImagePixels;\n  using MagickLib::TextureImage;\n  using MagickLib::ThresholdImage;\n  using MagickLib::ThrowException;\n  using MagickLib::ThrowLoggedException;\n  using MagickLib::ThumbnailImage;\n  using MagickLib::TransformHSL;\n  using MagickLib::TransformImage;\n  using MagickLib::TransformRGBImage;\n  using MagickLib::TransparentImage;\n  using MagickLib::TypeError;\n  using MagickLib::TypeFatalError;\n  using MagickLib::TypeWarning;\n  using MagickLib::UndefinedException;\n  using MagickLib::UndefinedRegistryType;\n  using MagickLib::UnregisterMagickInfo;\n  using MagickLib::UnsharpMaskImage;\n  using MagickLib::UnsharpMaskImageChannel;\n  using MagickLib::ViewInfo;\n  using MagickLib::WaveImage;\n  using MagickLib::WidthValue;\n  using MagickLib::WriteImage;\n  using MagickLib::XNegative;\n  using MagickLib::XServerError;\n  using MagickLib::XServerFatalError;\n  using MagickLib::XServerWarning;\n  using MagickLib::XValue;\n  using MagickLib::YNegative;\n  using MagickLib::YValue;\n  using MagickLib::ZoomImage;\n\n\n#endif // MAGICK_IMPLEMENTATION\n\n}\n\n#endif // Magick_Include_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/Montage.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003\n//\n// Definition of Montage class used to specify montage options.\n//\n\n#if !defined(Magick_Montage_header)\n#define Magick_Montage_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n#include \"Magick++/Color.h\"\n#include \"Magick++/Geometry.h\"\n\n//\n// Basic (Un-framed) Montage\n//\nnamespace Magick\n{\n  class MagickDLLDecl Montage\n  {\n  public:\n    Montage( void );\n    virtual ~Montage( void );\n\n    // Specifies the background color that thumbnails are imaged upon.\n    void              backgroundColor ( const Color &backgroundColor_ );\n    Color             backgroundColor ( void ) const;\n\n    // Specifies the image composition algorithm for thumbnails. This\n    // controls the algorithm by which the thumbnail image is placed\n    // on the background. Use of OverCompositeOp is recommended for\n    // use with images that have transparency. This option may have\n    // negative side-effects for images without transparency.\n    void              compose ( CompositeOperator compose_ );\n    CompositeOperator compose ( void ) const;\n\n    // Specifies the image filename to be used for the generated\n    // montage images. To handle the case were multiple montage images\n    // are generated, a printf-style format may be embedded within the\n    // filename. For example, a filename specification of\n    // image%02d.miff names the montage images as image00.miff,\n    // image01.miff, etc.\n    void              fileName( const std::string &fileName_ );\n    std::string       fileName( void ) const;\n\n    // Specifies the fill color to use for the label text.\n    void              fillColor ( const Color &fill_ );\n    Color             fillColor ( void ) const;\n\n    // Specifies the thumbnail label font.\n    void              font ( const std::string &font_ );\n    std::string       font ( void ) const;\n\n    // Specifies the size of the generated thumbnail.\n    void              geometry ( const Geometry &geometry_ );\n    Geometry          geometry ( void ) const;\n\n    // Specifies the thumbnail positioning within the specified\n    // geometry area. If the thumbnail is smaller in any dimension\n    // than the geometry, then it is placed according to this\n    // specification\n    void              gravity ( GravityType gravity_ );\n    GravityType       gravity ( void ) const;\n\n    // Specifies the format used for the image label. Special format\n    // characters may be embedded in the format string to include\n    // information about the image.\n    void              label( const std::string &label_ );\n    std::string       label( void ) const;\n\n    // Specifies the pen color to use for the label text (same as fill).\n    void              penColor ( const Color &pen_ );\n    Color             penColor ( void ) const;\n\n    // Specifies the thumbnail label font size.\n    void              pointSize ( unsigned int pointSize_ );\n    unsigned int      pointSize ( void ) const;\n\n    // Enable/disable drop-shadow on thumbnails.\n    void              shadow ( bool shadow_ );\n    bool              shadow ( void ) const;\n\n    // Specifies the stroke color to use for the label text .\n    void              strokeColor ( const Color &stroke_ );\n    Color             strokeColor ( void ) const;\n\n    // Specifies a texture image to use as montage background. The\n    // built-in textures \"granite:\" and \"plasma:\" are available. A\n    // texture is the same as a background image.\n    void              texture ( const std::string &texture_ );\n    std::string       texture ( void ) const;\n\n    // Specifies the maximum number of montage columns and rows in the\n    // montage. The montage is built by filling out all cells in a row\n    // before advancing to the next row. Once the montage has reached\n    // the maximum number of columns and rows, a new montage image is\n    // started.\n    void              tile ( const Geometry &tile_ );\n    Geometry          tile ( void ) const;\n\n    // Specifies the montage title\n    void              title ( const std::string &title_ );\n    std::string       title ( void ) const;\n\n    // Specifies a montage color to set transparent. This option can\n    // be set the same as the background color in order for the\n    // thumbnails to appear without a background when rendered on an\n    // HTML page. For best effect, ensure that the transparent color\n    // selected does not occur in the rendered thumbnail colors.\n    void              transparentColor ( const Color &transparentColor_ );\n    Color             transparentColor ( void ) const;\n\n    //\n    // Implementation methods/members\n    //\n\n    // Update elements in existing MontageInfo structure\n    virtual void      updateMontageInfo ( MagickLib::MontageInfo &montageInfo_ ) const;\n\n  protected:\n\n  private:\n    Color             _backgroundColor;   // Color that thumbnails are composed on\n    CompositeOperator _compose;           // Composition algorithm to use (e.g. ReplaceCompositeOp)\n    std::string       _fileName;          // Filename to save montages to\n    Color             _fill;              // Fill color\n    std::string       _font;              // Label font\n    Geometry          _geometry;          // Thumbnail width & height plus border width & height\n    GravityType       _gravity;           // Thumbnail position (e.g. SouthWestGravity)\n    std::string       _label;             // Thumbnail label (applied to image prior to montage)\n    unsigned int      _pointSize;         // Font point size\n    bool              _shadow;            // Enable drop-shadows on thumbnails\n    Color             _stroke;            // Outline color\n    std::string       _texture;           // Background texture image\n    Geometry          _tile;              // Thumbnail rows and colmns\n    std::string       _title;             // Montage title\n    Color             _transparentColor;  // Transparent color\n  };\n\n  //\n  // Montage With Frames (Extends Basic Montage)\n  //\n  class MagickDLLDecl MontageFramed : public Montage\n  {\n  public:\n    MontageFramed ( void );\n    /* virtual */ ~MontageFramed ( void );\n\n    // Specifies the background color within the thumbnail frame.\n    void           borderColor ( const Color &borderColor_ );\n    Color          borderColor ( void ) const;\n\n    // Specifies the border (in pixels) to place between a thumbnail\n    // and its surrounding frame. This option only takes effect if\n    // thumbnail frames are enabled (via frameGeometry) and the\n    // thumbnail geometry specification doesn't also specify the\n    // thumbnail border width.\n    void           borderWidth ( unsigned int borderWidth_ );\n    unsigned int   borderWidth ( void ) const;\n\n    // Specifies the geometry specification for frame to place around\n    // thumbnail. If this parameter is not specified, then the montage\n    // is unframed.\n    void           frameGeometry ( const Geometry &frame_ );\n    Geometry       frameGeometry ( void ) const;\n\n    // Specifies the thumbnail frame color.\n    void           matteColor ( const Color &matteColor_ );\n    Color          matteColor ( void ) const;\n\n    //\n    // Implementation methods/members\n    //\n\n    // Update elements in existing MontageInfo structure\n    /* virtual */ void updateMontageInfo ( MagickLib::MontageInfo &montageInfo_ ) const;\n\n  protected:\n\n  private:\n\n    Color          _borderColor;        // Frame border color\n    unsigned int   _borderWidth;        // Pixels between thumbnail and surrounding frame\n    Geometry       _frame;              // Frame geometry (width & height frame thickness)\n    Color          _matteColor;         // Frame foreground color\n  };\n} // namespace Magick\n\n//\n// Inlines\n//\n\n//\n// Implementation of Montage\n//\n\ninline void Magick::Montage::backgroundColor ( const Magick::Color &backgroundColor_ )\n{\n  _backgroundColor = backgroundColor_;\n}\ninline Magick::Color Magick::Montage::backgroundColor ( void ) const\n{\n  return _backgroundColor;\n}\n\ninline void Magick::Montage::compose ( Magick::CompositeOperator compose_ )\n{\n  _compose = compose_;\n}\ninline Magick::CompositeOperator Magick::Montage::compose ( void ) const\n{\n  return _compose;\n}\n\ninline void Magick::Montage::fileName( const std::string &fileName_ )\n{\n  _fileName = fileName_;\n}\ninline std::string Magick::Montage::fileName( void ) const\n{\n  return _fileName;\n}\n\ninline void Magick::Montage::fillColor ( const Color &fill_ )\n{\n  _fill=fill_;\n}\ninline Magick::Color Magick::Montage::fillColor ( void ) const\n{\n  return _fill;\n}\n\ninline void Magick::Montage::font ( const std::string &font_ )\n{\n  _font = font_;\n}\ninline std::string Magick::Montage::font ( void ) const\n{\n  return _font;\n}\n\ninline void Magick::Montage::geometry ( const Magick::Geometry &geometry_ )\n{\n  _geometry = geometry_;\n}\ninline Magick::Geometry Magick::Montage::geometry ( void ) const\n{\n  return _geometry;\n}\n\ninline void Magick::Montage::gravity ( Magick::GravityType gravity_ )\n{\n  _gravity = gravity_;\n}\ninline Magick::GravityType Magick::Montage::gravity ( void ) const\n{\n  return _gravity;\n}\n\n// Apply as attribute to all images before doing montage\ninline void Magick::Montage::label( const std::string &label_ )\n{\n  _label = label_;\n}\ninline std::string Magick::Montage::label( void ) const\n{\n  return _label;\n}\n\ninline void Magick::Montage::penColor ( const Color &pen_ )\n{\n  _fill=pen_;\n  _stroke=Color(\"none\");\n}\ninline Magick::Color Magick::Montage::penColor ( void ) const\n{\n  return _fill;\n}\n\ninline void Magick::Montage::pointSize ( unsigned int pointSize_ )\n{\n  _pointSize = pointSize_;\n}\ninline unsigned int Magick::Montage::pointSize ( void ) const\n{\n  return _pointSize;\n}\n\ninline void Magick::Montage::shadow ( bool shadow_ )\n{\n  _shadow = shadow_;\n}\ninline bool Magick::Montage::shadow ( void ) const\n{\n  return _shadow;\n}\n\ninline void Magick::Montage::strokeColor ( const Color &stroke_ )\n{\n  _stroke=stroke_;\n}\ninline Magick::Color Magick::Montage::strokeColor ( void ) const\n{\n  return _stroke;\n}\n\ninline void Magick::Montage::texture ( const std::string &texture_ )\n{\n  _texture = texture_;\n}\ninline std::string Magick::Montage::texture ( void ) const\n{\n  return _texture;\n}\n\ninline void Magick::Montage::tile ( const Geometry &tile_ )\n{\n  _tile = tile_;\n}\ninline Magick::Geometry Magick::Montage::tile ( void ) const\n{\n  return _tile;\n}\n\ninline void Magick::Montage::title ( const std::string &title_ )\n{\n  _title = title_;\n}\ninline std::string Magick::Montage::title ( void ) const\n{\n  return _title;\n}\n\n// Applied after the fact to montage with TransparentImage()\ninline void Magick::Montage::transparentColor ( const Magick::Color &transparentColor_ )\n{\n  _transparentColor = transparentColor_;\n}\ninline Magick::Color Magick::Montage::transparentColor ( void ) const\n{\n  return _transparentColor;\n}\n\n//\n// Implementation of MontageFramed\n//\n\ninline void Magick::MontageFramed::borderColor ( const Magick::Color &borderColor_ )\n{\n  _borderColor = borderColor_;\n}\ninline Magick::Color Magick::MontageFramed::borderColor ( void ) const\n{\n  return _borderColor;\n}\n\ninline void Magick::MontageFramed::borderWidth ( unsigned int borderWidth_ )\n{\n  _borderWidth = borderWidth_;\n}\ninline unsigned int Magick::MontageFramed::borderWidth ( void ) const\n{\n  return _borderWidth;\n}\n\ninline void Magick::MontageFramed::frameGeometry ( const Magick::Geometry &frame_ )\n{\n  _frame = frame_;\n}\ninline Magick::Geometry Magick::MontageFramed::frameGeometry ( void ) const\n{\n  return _frame;\n}\n\ninline void Magick::MontageFramed::matteColor ( const Magick::Color &matteColor_ )\n{\n  _matteColor = matteColor_;\n}\ninline Magick::Color Magick::MontageFramed::matteColor ( void ) const\n{\n  return _matteColor;\n}\n\n#endif // Magick_Montage_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/Pixels.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002\n//\n// Representation of a pixel view.\n//\n\n#if !defined(Magick_Pixels_header)\n#define Magick_Pixels_header\n\n#include \"Magick++/Include.h\"\n#include \"Magick++/Color.h\"\n#include \"Magick++/Image.h\"\n\nnamespace Magick\n{\n  class MagickDLLDecl Pixels\n  {\n  public:\n\n    // Construct pixel view using specified image.\n    Pixels( Magick::Image &image_ );\n\n    // Destroy pixel view\n    ~Pixels( void );\n\n    // Transfer pixels from the image to the pixel view as defined by\n    // the specified region. Modified pixels may be subsequently\n    // transferred back to the image via sync.\n    PixelPacket* get ( const int x_, const int y_,\n                       const unsigned int columns_,const  unsigned int rows_ );\n\n    // Transfer read-only pixels from the image to the pixel view as\n    // defined by the specified region.\n    const PixelPacket* getConst ( const int x_, const int y_,\n                                  const unsigned int columns_,\n                                  const unsigned int rows_ );\n\n    // Transfers the image view pixels to the image.\n    void sync ( void );\n\n    // Allocate a pixel view region to store image pixels as defined\n    // by the region rectangle.  This area is subsequently transferred\n    // from the pixel view to the image via sync.\n    PixelPacket* set ( const int x_, const int y_,\n                       const unsigned int columns_, const unsigned int rows_ );\n\n    // Return pixel colormap index array\n    IndexPacket* indexes ( void );\n\n    // Left ordinate of view\n    int x ( void ) const;\n\n    // Top ordinate of view\n    int y ( void ) const;\n\n    // Width of view\n    unsigned int columns ( void ) const;\n\n    // Height of view\n    unsigned int rows ( void ) const;\n\n#if 0\n    // Transfer one or more pixel components from a buffer or file\n    // into the image pixel view of an image.  Used to support image\n    // decoders.\n    void decode ( const QuantumType quantum_,\n                  const unsigned char *source_ )\n      {\n        MagickLib::ReadPixelCache( _image.image(), quantum_, source_ );\n      }\n\n    // Transfer one or more pixel components from the image pixel\n    // view to a buffer or file.  Used to support image encoders.\n    void encode ( const QuantumType quantum_,\n                  const unsigned char *destination_ )\n      {\n        MagickLib::WritePixelCache( _image.image(), quantum_, destination_ );\n      }\n#endif\n  private:\n\n    // Copying and assigning Pixels is not supported.\n    Pixels( const Pixels& pixels_ );\n    const Pixels& operator=( const Pixels& pixels_ );\n\n    Magick::Image             _image;     // Image reference\n    MagickLib::ViewInfo*      _view;      // Image view handle\n    int                       _x;         // Left ordinate of view\n    int                       _y;         // Top ordinate of view\n    unsigned int              _columns;   // Width of view\n    unsigned int              _rows;      // Height of view\n    MagickLib:: ExceptionInfo _exception; // Any thrown exception\n\n  }; // class Pixels\n\n} // Magick namespace\n\n//\n// Inline methods\n//\n\n// Left ordinate of view\ninline int Magick::Pixels::x ( void ) const\n{\n  return _x;\n}\n\n// Top ordinate of view\ninline int Magick::Pixels::y ( void ) const\n{\n  return _y;\n}\n\n// Width of view\ninline unsigned int Magick::Pixels::columns ( void ) const\n{\n  return _columns;\n}\n\n// Height of view\ninline unsigned int Magick::Pixels::rows ( void ) const\n{\n  return _rows;\n}\n\n#endif // Magick_Pixels_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/STL.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2018\n//\n// Definition and implementation of template functions for using\n// Magick::Image with STL containers.\n//\n\n#ifndef Magick_STL_header\n#define Magick_STL_header\n\n#include \"Magick++/Include.h\"\n#include <algorithm>\n#include <functional>\n#include <iterator>\n#include <map>\n#include <utility>\n\n#include \"Magick++/CoderInfo.h\"\n#include \"Magick++/Drawable.h\"\n#include \"Magick++/Exception.h\"\n#include \"Magick++/Montage.h\"\n\nnamespace Magick\n{\n  //\n  // STL function object declarations/definitions\n  //\n\n  // Function objects provide the means to invoke an operation on one\n  // or more image objects in an STL-compatable container.  The\n  // arguments to the function object constructor(s) are compatible\n  // with the arguments to the equivalent Image class method and\n  // provide the means to supply these options when the function\n  // object is invoked.\n\n  // For example, to read a GIF animation, set the color red to\n  // transparent for all frames, and write back out:\n  //\n  // list<image> images;\n  // readImages( &images, \"animation.gif\" );\n  // for_each( images.begin(), images.end(), transparentImage( \"red\" ) );\n  // writeImages( images.begin(), images.end(), \"animation.gif\" );\n\n  // Local adaptive threshold image\n  // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm\n  // Width x height define the size of the pixel neighborhood\n  // offset = constant to subtract from pixel neighborhood mean\n  class MagickDLLDecl adaptiveThresholdImage : public std::unary_function<Image&,void>\n  {\n  public:\n    adaptiveThresholdImage( const unsigned int width_,\n                            const unsigned int height_,\n                            const double offset_ = 0.0  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _width;\n    unsigned int _height;\n    double       _offset;\n  };\n\n  // Add noise to image with specified noise type\n  class MagickDLLDecl addNoiseImage : public std::unary_function<Image&,void>\n  {\n  public:\n    addNoiseImage ( NoiseType noiseType_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    NoiseType _noiseType;\n  };\n\n  // Transform image by specified affine (or free transform) matrix.\n  class MagickDLLDecl affineTransformImage : public std::unary_function<Image&,void>\n  {\n  public:\n    affineTransformImage( const DrawableAffine &affine_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    DrawableAffine _affine;\n  };\n\n  // Annotate image (draw text on image)\n  class MagickDLLDecl annotateImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Annotate using specified text, and placement location\n    annotateImage ( const std::string &text_,\n                    const Geometry &geometry_ );\n\n    // Annotate using specified text, bounding area, and placement\n    // gravity\n    annotateImage ( const std::string &text_,\n                    const Geometry &geometry_,\n                    const GravityType gravity_ );\n\n    // Annotate with text using specified text, bounding area,\n    // placement gravity, and rotation.\n    annotateImage ( const std::string &text_,\n                    const Geometry &geometry_,\n                    const GravityType gravity_,\n                    const double degrees_ );\n\n    // Annotate with text (bounding area is entire image) and\n    // placement gravity.\n    annotateImage ( const std::string &text_,\n                    const GravityType gravity_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    // Copy constructor and assignment are not supported\n    annotateImage(const annotateImage&);\n    annotateImage& operator=(const annotateImage&);\n\n    const std::string   _text;\n    const Geometry      _geometry;\n    const GravityType   _gravity;\n    const double        _degrees;\n  };\n\n  // Blur image with specified blur factor\n  class MagickDLLDecl blurImage : public std::unary_function<Image&,void>\n  {\n  public:\n    blurImage( const double radius_ = 1, const double sigma_ = 0.5 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n    double _sigma;\n  };\n\n  // Border image (add border to image)\n  class MagickDLLDecl borderImage : public std::unary_function<Image&,void>\n  {\n  public:\n    borderImage( const Geometry &geometry_ = borderGeometryDefault  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  // Extract channel from image\n  class MagickDLLDecl channelImage : public std::unary_function<Image&,void>\n  {\n  public:\n    channelImage( const ChannelType channel_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    ChannelType _channel;\n  };\n\n  // Charcoal effect image (looks like charcoal sketch)\n  class MagickDLLDecl charcoalImage : public std::unary_function<Image&,void>\n  {\n  public:\n    charcoalImage( const double radius_ = 1, const double sigma_ = 0.5  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n    double _sigma;\n  };\n\n  // Chop image (remove vertical or horizontal subregion of image)\n  class MagickDLLDecl chopImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chopImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  // Colorize image using pen color at specified percent opacity\n  class MagickDLLDecl colorizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorizeImage( const unsigned int opacityRed_,\n                   const unsigned int opacityGreen_,\n                   const unsigned int opacityBlue_,\n                   const Color &penColor_ );\n\n    colorizeImage( const unsigned int opacity_,\n                   const Color &penColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _opacityRed;\n    unsigned int _opacityGreen;\n    unsigned int _opacityBlue;\n    Color _penColor;\n  };\n\n  // Bake in the ASC-CDL, which is a convention for the for the\n  // exchange of basic primary color grading information between for\n  // the exchange of basic primary color grading information between\n  // equipment and software from different manufacturers.  It is a\n  // useful transform for other purposes as well.\n  class MagickDLLDecl cdlImage : public std::unary_function<Image&,void>\n  {\n  public:\n    cdlImage( const std::string &cdl_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string   _cdl;\n  };\n\n  // Apply a color matrix to the image channels.  The user supplied\n  // matrix may be of order 1 to 5 (1x1 through 5x5).\n  class MagickDLLDecl colorMatrixImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorMatrixImage( const unsigned int order_,\n                      const double *color_matrix_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int  _order;\n    const double *_color_matrix;\n  };\n\n  // Convert the image colorspace representation\n  class MagickDLLDecl colorSpaceImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorSpaceImage( ColorspaceType colorSpace_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    ColorspaceType _colorSpace;\n  };\n\n  // Comment image (add comment string to image)\n  class MagickDLLDecl commentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    commentImage( const std::string &comment_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _comment;\n  };\n\n  // Compose an image onto another at specified offset and using\n  // specified algorithm\n  class MagickDLLDecl compositeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    compositeImage( const Image &compositeImage_,\n                    int xOffset_,\n                    int yOffset_,\n                    CompositeOperator compose_ = InCompositeOp );\n\n    compositeImage( const Image &compositeImage_,\n                    const Geometry &offset_,\n                    CompositeOperator compose_ = InCompositeOp );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image             _compositeImage;\n    int               _xOffset;\n    int               _yOffset;\n    CompositeOperator _compose;\n  };\n\n  // Contrast image (enhance intensity differences in image)\n  class MagickDLLDecl contrastImage : public std::unary_function<Image&,void>\n  {\n  public:\n    contrastImage( const unsigned int sharpen_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _sharpen;\n  };\n\n  // Crop image (subregion of original image)\n  class MagickDLLDecl cropImage : public std::unary_function<Image&,void>\n  {\n  public:\n    cropImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  // Cycle image colormap\n  class MagickDLLDecl cycleColormapImage : public std::unary_function<Image&,void>\n  {\n  public:\n    cycleColormapImage( const int amount_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    int _amount;\n  };\n\n  // Despeckle image (reduce speckle noise)\n  class MagickDLLDecl despeckleImage : public std::unary_function<Image&,void>\n  {\n  public:\n    despeckleImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Draw on image\n  class MagickDLLDecl drawImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Draw on image using a single drawable\n    // Store in list to make implementation easier\n    drawImage( const Drawable &drawable_ );\n\n    // Draw on image using a drawable list\n    drawImage( const DrawableList &drawable_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    DrawableList _drawableList;\n  };\n\n  // Edge image (hilight edges in image)\n  class MagickDLLDecl edgeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    edgeImage( const double radius_ = 0.0  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n  };\n\n  // Emboss image (hilight edges with 3D effect)\n  class MagickDLLDecl embossImage : public std::unary_function<Image&,void>\n  {\n  public:\n    embossImage( void );\n    embossImage( const double radius_, const double sigma_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n    double _sigma;\n  };\n\n  // Enhance image (minimize noise)\n  class MagickDLLDecl enhanceImage : public std::unary_function<Image&,void>\n  {\n  public:\n    enhanceImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Equalize image (histogram equalization)\n  class MagickDLLDecl equalizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    equalizeImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Create an image canvas using background color sized according to\n  // geometry and composite existing image on it, with image placement\n  // controlled by gravity.  Parameters are obtained from existing\n  // image properties if they are not specified via a method\n  // parameter.  Parameters which are supported by image properties\n  // (gravity and backgroundColor) update those image properties as a\n  // side-effect.\n  class MagickDLLDecl extentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Extent image using a geometry\n    extentImage ( const Geometry &geometry_ );\n\n    // Extent image using a geometry & gravity\n    extentImage ( const Geometry &geometry_,\n                  const GravityType &gravity_ );\n\n    // Extent image using a geometry & background color\n    extentImage ( const Geometry &geometry_,\n                  const Color &backgroundColor_ );\n\n    // Extent image using a geometry, background color & gravity\n    extentImage ( const Geometry &geometry_,\n                  const Color &backgroundColor_,\n                  const GravityType &gravity_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    // Copy constructor and assignment are not supported\n    extentImage(const extentImage&);\n    extentImage& operator=(const extentImage&);\n\n    const Geometry      _geometry;\n    const Color         _backgroundColor;\n    const GravityType   _gravity;\n  };\n\n  // Color to use when filling drawn objects\n  class MagickDLLDecl fillColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    fillColorImage( const Color &fillColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _fillColor;\n  };\n\n  // Flip image (reflect each scanline in the vertical direction)\n  class MagickDLLDecl flipImage : public std::unary_function<Image&,void>\n  {\n  public:\n    flipImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Flood-fill image with color\n  class MagickDLLDecl floodFillColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Flood-fill color across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    floodFillColorImage( const unsigned int x_,\n                         const unsigned int y_,\n                         const Color &fillColor_ );\n\n    floodFillColorImage( const Geometry &point_,\n                         const Color &fillColor_ );\n\n    // Flood-fill color across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    floodFillColorImage( const unsigned int x_,\n                         const unsigned int y_,\n                         const Color &fillColor_,\n                         const Color &borderColor_ );\n\n    floodFillColorImage( const Geometry &point_,\n                         const Color &fillColor_,\n                         const Color &borderColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int   _x;\n    unsigned int   _y;\n    Color          _fillColor;\n    Color          _borderColor;\n  };\n\n  // Flood-fill image with texture\n  class MagickDLLDecl floodFillTextureImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Flood-fill texture across pixels that match the color of the\n    // target pixel and are neighbors of the target pixel.\n    // Uses current fuzz setting when determining color match.\n    floodFillTextureImage( const unsigned int x_,\n                           const unsigned int y_,\n                           const Image &texture_ );\n\n    floodFillTextureImage( const Geometry &point_,\n                           const Image &texture_ );\n\n    // Flood-fill texture across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    floodFillTextureImage( const unsigned int x_,\n                           const unsigned int y_,\n                           const Image &texture_,\n                           const Color &borderColor_ );\n\n    floodFillTextureImage( const Geometry &point_,\n                           const Image &texture_,\n                           const Color &borderColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int  _x;\n    unsigned int  _y;\n    Image         _texture;\n    Color         _borderColor;\n  };\n\n  // Flop image (reflect each scanline in the horizontal direction)\n  class MagickDLLDecl flopImage : public std::unary_function<Image&,void>\n  {\n  public:\n    flopImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Frame image\n  class MagickDLLDecl frameImage : public std::unary_function<Image&,void>\n  {\n  public:\n    frameImage( const Geometry &geometry_ = frameGeometryDefault );\n\n    frameImage( const unsigned int width_, const unsigned int height_,\n                const int innerBevel_ = 6, const int outerBevel_ = 6 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _width;\n    unsigned int _height;\n    int          _outerBevel;\n    int          _innerBevel;\n  };\n\n  // Gamma correct image\n  class MagickDLLDecl gammaImage : public std::unary_function<Image&,void>\n  {\n  public:\n    gammaImage( const double gamma_ );\n\n    gammaImage ( const double gammaRed_,\n                 const double gammaGreen_,\n                 const double gammaBlue_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _gammaRed;\n    double _gammaGreen;\n    double _gammaBlue;\n  };\n\n  // Gaussian blur image\n  // The number of neighbor pixels to be included in the convolution\n  // mask is specified by 'width_'. The standard deviation of the\n  // gaussian bell curve is specified by 'sigma_'.\n  class MagickDLLDecl gaussianBlurImage : public std::unary_function<Image&,void>\n  {\n  public:\n    gaussianBlurImage( const double width_, const double sigma_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _width;\n    double _sigma;\n  };\n\n  // Implode image (special effect)\n  class MagickDLLDecl implodeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    implodeImage( const double factor_ = 50 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _factor;\n  };\n\n  // Apply a color lookup table (Hald CLUT) to the image.\n  class MagickDLLDecl haldClutImage : public std::unary_function<Image&,void>\n  {\n  public:\n    haldClutImage( const Image &haldClutImage_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image             _haldClutImage;\n  };\n\n  // Set image validity. Valid images become empty (inValid) if\n  // argument is false.\n  class MagickDLLDecl isValidImage : public std::unary_function<Image&,void>\n  {\n  public:\n    isValidImage( const bool isValid_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _isValid;\n  };\n\n  // Label image\n  class MagickDLLDecl labelImage : public std::unary_function<Image&,void>\n  {\n  public:\n    labelImage( const std::string &label_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _label;\n  };\n\n  // Level image\n  class MagickDLLDecl levelImage : public std::unary_function<Image&,void>\n  {\n  public:\n    levelImage( const double black_point,\n                const double white_point,\n                const double mid_point=1.0 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _black_point;\n    double _white_point;\n    double _mid_point;\n  };\n\n  // Level image channel\n  class MagickDLLDecl levelChannelImage : public std::unary_function<Image&,void>\n  {\n  public:\n    levelChannelImage( const Magick::ChannelType channel,\n                       const double black_point,\n                       const double white_point,\n                       const double mid_point=1.0 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Magick::ChannelType _channel;\n    double _black_point;\n    double _white_point;\n    double _mid_point;\n  };\n\n  // Magnify image by integral size\n  class MagickDLLDecl magnifyImage : public std::unary_function<Image&,void>\n  {\n  public:\n    magnifyImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Remap image colors with closest color from reference image\n  class MagickDLLDecl mapImage : public std::unary_function<Image&,void>\n  {\n  public:\n    mapImage( const Image &mapImage_ ,\n              const bool dither_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image   _mapImage;\n    bool    _dither;\n  };\n\n  // Floodfill designated area with a matte value\n  class MagickDLLDecl matteFloodfillImage : public std::unary_function<Image&,void>\n  {\n  public:\n    matteFloodfillImage( const Color &target_ ,\n                         const unsigned int matte_,\n                         const int x_, const int y_,\n                         const PaintMethod method_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color         _target;\n    unsigned int  _matte;\n    int           _x;\n    int           _y;\n    PaintMethod   _method;\n  };\n\n  // Filter image by replacing each pixel component with the median\n  // color in a circular neighborhood\n  class MagickDLLDecl medianFilterImage : public std::unary_function<Image&,void>\n  {\n  public:\n    medianFilterImage( const double radius_ = 0.0 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n  };\n\n  // Reduce image by integral size\n  class MagickDLLDecl minifyImage : public std::unary_function<Image&,void>\n  {\n  public:\n    minifyImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Modulate percent hue, saturation, and brightness of an image.\n  // Modulation of saturation and brightness is as a ratio of the\n  // current value (1.0 for no change). Modulation of hue is an\n  // absolute rotation of -180 degrees to +180 degrees from the\n  // current position corresponding to an argument range of 0 to 2.0\n  // (1.0 for no change).\n  class MagickDLLDecl modulateImage : public std::unary_function<Image&,void>\n  {\n  public:\n    modulateImage( const double brightness_,\n                   const double saturation_,\n                   const double hue_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _brightness;\n    double _saturation;\n    double _hue;\n  };\n\n  // Negate colors in image.  Set grayscale to only negate grayscale\n  // values in image.\n  class MagickDLLDecl negateImage : public std::unary_function<Image&,void>\n  {\n  public:\n    negateImage( const bool grayscale_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _grayscale;\n  };\n\n  // Normalize image (increase contrast by normalizing the pixel\n  // values to span the full range of color values)\n  class MagickDLLDecl normalizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    normalizeImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Oilpaint image (image looks like oil painting)\n  class MagickDLLDecl oilPaintImage : public std::unary_function<Image&,void>\n  {\n  public:\n    oilPaintImage( const double radius_ = 3 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n  };\n\n  // Set or attenuate the image opacity channel. If the image pixels\n  // are opaque then they are set to the specified opacity value,\n  // otherwise they are blended with the supplied opacity value.  The\n  // value of opacity_ ranges from 0 (completely opaque) to\n  // MaxRGB. The defines OpaqueOpacity and TransparentOpacity are\n  // available to specify completely opaque or completely transparent,\n  // respectively.\n  class MagickDLLDecl opacityImage : public std::unary_function<Image&,void>\n  {\n  public:\n    opacityImage( const unsigned int opacity_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _opacity;\n  };\n\n  // Change color of opaque pixel to specified pen color.\n  class MagickDLLDecl opaqueImage : public std::unary_function<Image&,void>\n  {\n  public:\n    opaqueImage( const Color &opaqueColor_,\n                 const Color &penColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color  _opaqueColor;\n    Color  _penColor;\n  };\n\n  // Quantize image (reduce number of colors)\n  class MagickDLLDecl quantizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeImage( const bool measureError_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _measureError;\n  };\n\n  // Raise image (lighten or darken the edges of an image to give a\n  // 3-D raised or lowered effect)\n  class MagickDLLDecl raiseImage : public std::unary_function<Image&,void>\n  {\n  public:\n    raiseImage( const Geometry &geometry_ = raiseGeometryDefault,\n                const bool raisedFlag_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry   _geometry;\n    bool       _raisedFlag;\n  };\n\n  // Reduce noise in image using a noise peak elimination filter\n  class MagickDLLDecl reduceNoiseImage : public std::unary_function<Image&,void>\n  {\n  public:\n    reduceNoiseImage( void );\n\n    reduceNoiseImage (const  unsigned int order_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _order;\n  };\n\n  // Resize image to a certain geomtry\n  class MagickDLLDecl resizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    resizeImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry  _geometry;\n  };\n\n  // Roll image (rolls image vertically and horizontally) by specified\n  // number of columnms and rows)\n  class MagickDLLDecl rollImage : public std::unary_function<Image&,void>\n  {\n  public:\n    rollImage( const Geometry &roll_ );\n\n    rollImage( const int columns_, const int rows_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    int _columns;\n    int _rows;\n  };\n\n  // Rotate image counter-clockwise by specified number of degrees.\n  class MagickDLLDecl rotateImage : public std::unary_function<Image&,void>\n  {\n  public:\n    rotateImage( const double degrees_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double       _degrees;\n  };\n\n  // Resize image by using pixel sampling algorithm\n  class MagickDLLDecl sampleImage : public std::unary_function<Image&,void>\n  {\n  public:\n    sampleImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry  _geometry;\n  };\n\n  // Resize image by using simple ratio algorithm\n  class MagickDLLDecl scaleImage : public std::unary_function<Image&,void>\n  {\n  public:\n    scaleImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry  _geometry;\n  };\n\n  // Segment (coalesce similar image components) by analyzing the\n  // histograms of the color components and identifying units that are\n  // homogeneous with the fuzzy c-means technique.\n  // Also uses QuantizeColorSpace and Verbose image attributes\n  class MagickDLLDecl segmentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    segmentImage( const double clusterThreshold_ = 1.0,\n                  const double smoothingThreshold_ = 1.5 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double  _clusterThreshold;\n    double  _smoothingThreshold;\n  };\n\n  // Shade image using distant light source\n  class MagickDLLDecl shadeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    shadeImage( const double azimuth_ = 30,\n                const double elevation_ = 30,\n                const bool   colorShading_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double  _azimuth;\n    double  _elevation;\n    bool    _colorShading;\n  };\n\n  // Sharpen pixels in image\n  class MagickDLLDecl sharpenImage : public std::unary_function<Image&,void>\n  {\n  public:\n    sharpenImage( const double radius_ = 1, const double sigma_ = 0.5 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n    double _sigma;\n  };\n\n  // Shave pixels from image edges.\n  class MagickDLLDecl shaveImage : public std::unary_function<Image&,void>\n  {\n  public:\n    shaveImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n\n  // Shear image (create parallelogram by sliding image by X or Y axis)\n  class MagickDLLDecl shearImage : public std::unary_function<Image&,void>\n  {\n  public:\n    shearImage( const double xShearAngle_,\n                const double yShearAngle_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _xShearAngle;\n    double _yShearAngle;\n  };\n\n  // Solarize image (similar to effect seen when exposing a\n  // photographic film to light during the development process)\n  class MagickDLLDecl solarizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    solarizeImage( const double factor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _factor;\n  };\n\n  // Spread pixels randomly within image by specified ammount\n  class MagickDLLDecl spreadImage : public std::unary_function<Image&,void>\n  {\n  public:\n    spreadImage( const unsigned int amount_ = 3 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _amount;\n  };\n\n  // Add a digital watermark to the image (based on second image)\n  class MagickDLLDecl steganoImage : public std::unary_function<Image&,void>\n  {\n  public:\n    steganoImage( const Image &waterMark_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image _waterMark;\n  };\n\n  // Create an image which appears in stereo when viewed with red-blue glasses\n  // (Red image on left, blue on right)\n  class MagickDLLDecl stereoImage : public std::unary_function<Image&,void>\n  {\n  public:\n    stereoImage( const Image &rightImage_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image _rightImage;\n  };\n\n  // Color to use when drawing object outlines\n  class MagickDLLDecl strokeColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    strokeColorImage( const Color &strokeColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _strokeColor;\n  };\n\n  // Swirl image (image pixels are rotated by degrees)\n  class MagickDLLDecl swirlImage : public std::unary_function<Image&,void>\n  {\n  public:\n    swirlImage( const double degrees_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _degrees;\n  };\n\n  // Remove all profiles and text attributes from the image.\n  class MagickDLLDecl stripImage : public std::unary_function<Image&,void>\n  {\n  public:\n    stripImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Channel a texture on image background\n  class MagickDLLDecl textureImage : public std::unary_function<Image&,void>\n  {\n  public:\n    textureImage( const Image &texture_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image _texture;\n  };\n\n  // Threshold image\n  class MagickDLLDecl thresholdImage : public std::unary_function<Image&,void>\n  {\n  public:\n    thresholdImage( const double threshold_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _threshold;\n  };\n\n  // Transform image based on image and crop geometries\n  class MagickDLLDecl transformImage : public std::unary_function<Image&,void>\n  {\n  public:\n    transformImage( const Geometry &imageGeometry_ );\n\n    transformImage( const Geometry &imageGeometry_,\n                    const Geometry &cropGeometry_  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _imageGeometry;\n    Geometry _cropGeometry;\n  };\n\n  // Set image color to transparent\n  class MagickDLLDecl transparentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    transparentImage( const Color& color_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _color;\n  };\n\n  // Trim edges that are the background color from the image\n  class MagickDLLDecl trimImage : public std::unary_function<Image&,void>\n  {\n  public:\n    trimImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Map image pixels to a sine wave\n  class MagickDLLDecl waveImage : public std::unary_function<Image&,void>\n  {\n  public:\n    waveImage( const double amplitude_ = 25.0,\n               const double wavelength_ = 150.0 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _amplitude;\n    double _wavelength;\n  };\n\n  // Zoom image to specified size.\n  class MagickDLLDecl zoomImage : public std::unary_function<Image&,void>\n  {\n  public:\n    zoomImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  //\n  // Function object image attribute accessors\n  //\n\n  // Anti-alias Postscript and TrueType fonts (default true)\n  class MagickDLLDecl antiAliasImage : public std::unary_function<Image&,void>\n  {\n  public:\n    antiAliasImage( const bool flag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _flag;\n  };\n\n  // Join images into a single multi-image file\n  class MagickDLLDecl adjoinImage : public std::unary_function<Image&,void>\n  {\n  public:\n    adjoinImage( const bool flag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _flag;\n  };\n\n  // Time in 1/100ths of a second which must expire before displaying\n  // the next image in an animated sequence.\n  class MagickDLLDecl animationDelayImage : public std::unary_function<Image&,void>\n  {\n  public:\n    animationDelayImage( const unsigned int delay_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _delay;\n  };\n\n  // Number of iterations to loop an animation (e.g. Netscape loop\n  // extension) for.\n  class MagickDLLDecl animationIterationsImage : public std::unary_function<Image&,void>\n  {\n  public:\n    animationIterationsImage( const unsigned int iterations_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _iterations;\n  };\n\n  // Image background color\n  class MagickDLLDecl backgroundColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    backgroundColorImage( const Color &color_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _color;\n  };\n\n  // Name of texture image to tile onto the image background\n  class MagickDLLDecl backgroundTextureImage : public std::unary_function<Image&,void>\n  {\n  public:\n    backgroundTextureImage( const std::string &backgroundTexture_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _backgroundTexture;\n  };\n\n  // Image border color\n  class MagickDLLDecl borderColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    borderColorImage( const Color &color_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _color;\n  };\n\n  // Text bounding-box base color (default none)\n  class MagickDLLDecl boxColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    boxColorImage( const Color &boxColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _boxColor;\n  };\n\n  // Chromaticity blue primary point (e.g. x=0.15, y=0.06)\n  class MagickDLLDecl chromaBluePrimaryImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chromaBluePrimaryImage( const double x_, const double y_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  // Chromaticity green primary point (e.g. x=0.3, y=0.6)\n  class MagickDLLDecl chromaGreenPrimaryImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chromaGreenPrimaryImage( const double x_, const double y_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  // Chromaticity red primary point (e.g. x=0.64, y=0.33)\n  class MagickDLLDecl chromaRedPrimaryImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chromaRedPrimaryImage( const double x_, const double y_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  // Chromaticity white point (e.g. x=0.3127, y=0.329)\n  class MagickDLLDecl chromaWhitePointImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chromaWhitePointImage( const double x_, const double y_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  // Colors within this distance are considered equal\n  class MagickDLLDecl colorFuzzImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorFuzzImage( const double fuzz_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _fuzz;\n  };\n\n  // Color at colormap position index_\n  class MagickDLLDecl colorMapImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorMapImage( const unsigned int index_, const Color &color_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _index;\n    Color        _color;\n  };\n\n  // Composition operator to be used when composition is implicitly used\n  // (such as for image flattening).\n  class MagickDLLDecl composeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    composeImage( const CompositeOperator compose_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    CompositeOperator _compose;\n  };\n\n  // Compression type\n  class MagickDLLDecl compressTypeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    compressTypeImage( const CompressionType compressType_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    CompressionType _compressType;\n  };\n\n  // Vertical and horizontal resolution in pixels of the image\n  class MagickDLLDecl densityImage : public std::unary_function<Image&,void>\n  {\n  public:\n    densityImage( const Geometry &geomery_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geomery;\n  };\n\n  // Image depth (bits allocated to red/green/blue components)\n  class MagickDLLDecl depthImage : public std::unary_function<Image&,void>\n  {\n  public:\n    depthImage( const unsigned int depth_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _depth;\n  };\n\n  // Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image\n  // formats which support endian-specific options.\n  class MagickDLLDecl endianImage : public std::unary_function<Image&,void>\n  {\n  public:\n    endianImage( const EndianType endian_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    EndianType  _endian;\n  };\n\n  // Image file name\n  class MagickDLLDecl fileNameImage : public std::unary_function<Image&,void>\n  {\n  public:\n    fileNameImage( const std::string &fileName_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _fileName;\n  };\n\n  // Filter to use when resizing image\n  class MagickDLLDecl filterTypeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    filterTypeImage( const FilterTypes filterType_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    FilterTypes _filterType;\n  };\n\n  // Text rendering font\n  class MagickDLLDecl fontImage : public std::unary_function<Image&,void>\n  {\n  public:\n    fontImage( const std::string &font_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _font;\n  };\n\n  // Font point size\n  class MagickDLLDecl fontPointsizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    fontPointsizeImage( const unsigned int pointsize_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _pointsize;\n  };\n\n  // GIF disposal method\n  class MagickDLLDecl gifDisposeMethodImage : public std::unary_function<Image&,void>\n  {\n  public:\n    gifDisposeMethodImage( const unsigned int disposeMethod_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _disposeMethod;\n  };\n\n  // Type of interlacing to use\n  class MagickDLLDecl interlaceTypeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    interlaceTypeImage( const InterlaceType interlace_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    InterlaceType _interlace;\n  };\n\n  // Linewidth for drawing vector objects (default one)\n  class MagickDLLDecl lineWidthImage : public std::unary_function<Image&,void>\n  {\n  public:\n    lineWidthImage( const double lineWidth_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _lineWidth;\n  };\n\n  // File type magick identifier (.e.g \"GIF\")\n  class MagickDLLDecl magickImage : public std::unary_function<Image&,void>\n  {\n  public:\n    magickImage( const std::string &magick_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _magick;\n  };\n\n  // Image supports transparent color\n  class MagickDLLDecl matteImage : public std::unary_function<Image&,void>\n  {\n  public:\n    matteImage( const bool matteFlag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _matteFlag;\n  };\n\n  // Transparent color\n  class MagickDLLDecl matteColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    matteColorImage( const Color &matteColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _matteColor;\n  };\n\n  // Indicate that image is black and white\n  class MagickDLLDecl monochromeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    monochromeImage( const bool monochromeFlag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _monochromeFlag;\n  };\n\n  // Pen color\n  class MagickDLLDecl penColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    penColorImage( const Color &penColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _penColor;\n  };\n\n  // Pen texture image.\n  class MagickDLLDecl penTextureImage : public std::unary_function<Image&,void>\n  {\n  public:\n    penTextureImage( const Image &penTexture_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image _penTexture;\n  };\n\n  // Set pixel color at location x & y.\n  class MagickDLLDecl pixelColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    pixelColorImage( const unsigned int x_,\n                     const unsigned int y_,\n                     const Color &color_);\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _x;\n    unsigned int _y;\n    Color        _color;\n  };\n\n  // Postscript page size.\n  class MagickDLLDecl pageImage : public std::unary_function<Image&,void>\n  {\n  public:\n    pageImage( const Geometry &pageSize_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _pageSize;\n  };\n\n  // JPEG/MIFF/PNG compression level (default 75).\n  class MagickDLLDecl qualityImage : public std::unary_function<Image&,void>\n  {\n  public:\n    qualityImage( const unsigned int quality_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _quality;\n  };\n\n  // Maximum number of colors to quantize to\n  class MagickDLLDecl quantizeColorsImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeColorsImage( const unsigned int colors_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _colors;\n  };\n\n  // Colorspace to quantize in.\n  class MagickDLLDecl quantizeColorSpaceImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeColorSpaceImage( const ColorspaceType colorSpace_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    ColorspaceType _colorSpace;\n  };\n\n  // Dither image during quantization (default true).\n  class MagickDLLDecl quantizeDitherImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeDitherImage( const bool ditherFlag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _ditherFlag;\n  };\n\n  // Quantization tree-depth\n  class MagickDLLDecl quantizeTreeDepthImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeTreeDepthImage( const unsigned int treeDepth_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _treeDepth;\n  };\n\n  // The type of rendering intent\n  class MagickDLLDecl renderingIntentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    renderingIntentImage( const RenderingIntent renderingIntent_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    RenderingIntent _renderingIntent;\n  };\n\n  // Units of image resolution\n  class MagickDLLDecl resolutionUnitsImage : public std::unary_function<Image&,void>\n  {\n  public:\n    resolutionUnitsImage( const ResolutionType resolutionUnits_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    ResolutionType _resolutionUnits;\n  };\n\n  // Image scene number\n  class MagickDLLDecl sceneImage : public std::unary_function<Image&,void>\n  {\n  public:\n    sceneImage( const unsigned int scene_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _scene;\n  };\n\n  // Width and height of a raw image\n  class MagickDLLDecl sizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    sizeImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  // Subimage of an image sequence\n  class MagickDLLDecl subImageImage : public std::unary_function<Image&,void>\n  {\n  public:\n    subImageImage( const unsigned int subImage_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _subImage;\n  };\n\n  // Number of images relative to the base image\n  class MagickDLLDecl subRangeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    subRangeImage( const unsigned int subRange_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _subRange;\n  };\n\n  // Tile name\n  class MagickDLLDecl tileNameImage : public std::unary_function<Image&,void>\n  {\n  public:\n    tileNameImage( const std::string &tileName_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _tileName;\n  };\n\n  // Image storage type\n  class MagickDLLDecl typeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    typeImage( const ImageType type_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Magick::ImageType _type;\n  };\n\n\n  // Print detailed information about the image\n  class MagickDLLDecl verboseImage : public std::unary_function<Image&,void>\n  {\n  public:\n    verboseImage( const bool verbose_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _verbose;\n  };\n\n  // FlashPix viewing parameters\n  class MagickDLLDecl viewImage : public std::unary_function<Image&,void>\n  {\n  public:\n    viewImage( const std::string &view_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _view;\n  };\n\n  // X11 display to display to, obtain fonts from, or to capture\n  // image from\n  class MagickDLLDecl x11DisplayImage : public std::unary_function<Image&,void>\n  {\n  public:\n    x11DisplayImage( const std::string &display_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _display;\n  };\n\n  //////////////////////////////////////////////////////////\n  //\n  // Implementation template definitions. Not for end-use.\n  //\n  //////////////////////////////////////////////////////////\n\n  // Link images together into an image list based on the ordering of\n  // the container implied by the iterator. This step is done in\n  // preparation for use with ImageMagick functions which operate on\n  // lists of images.\n  // Images are selected by range, first_ to last_ so that a subset of\n  // the container may be selected.  Specify first_ via the\n  // container's begin() method and last_ via the container's end()\n  // method in order to specify the entire container.\n  template <class InputIterator>\n  void linkImages( InputIterator first_,\n                   InputIterator last_ ) {\n\n    MagickLib::Image* previous = 0;\n    int scene = 0;\n    for ( InputIterator iter = first_; iter != last_; ++iter )\n      {\n        // Unless we reduce the reference count to one, the same image\n        // structure may occur more than once in the container, causing\n        // the linked list to fail.\n        iter->modifyImage();\n\n        MagickLib::Image* current = iter->image();\n\n        current->previous = previous;\n        current->next     = 0;\n        current->scene    = scene++;\n\n        if ( previous != 0)\n          previous->next = current;\n\n        previous = current;\n      }\n  }\n\n  // Remove links added by linkImages. This should be called after the\n  // ImageMagick function call has completed to reset the image list\n  // back to its pristine un-linked state.\n  template <class InputIterator>\n  void unlinkImages( InputIterator first_,\n                     InputIterator last_ ) {\n    for( InputIterator iter = first_; iter != last_; ++iter )\n      {\n        MagickLib::Image* image = iter->image();\n        image->previous = 0;\n        image->next = 0;\n      }\n  }\n\n  // Insert images in image list into existing container (appending to container)\n  // The images should not be deleted since only the image ownership is passed.\n  // The options are copied into the object.\n  template <class Container>\n  void insertImages( Container *sequence_,\n                     MagickLib::Image* images_ ) {\n    MagickLib::Image *image = images_;\n    if ( image )\n      {\n        do\n          {\n            MagickLib::Image* next_image = image->next;\n            image->next = 0;\n\n            if (next_image != 0)\n              next_image->previous=0;\n\n            sequence_->push_back( Magick::Image( image ) );\n\n            image=next_image;\n          } while( image );\n\n        return;\n      }\n  }\n\n  ///////////////////////////////////////////////////////////////////\n  //\n  // Template definitions for documented API\n  //\n  ///////////////////////////////////////////////////////////////////\n\n  template <class InputIterator>\n  void animateImages( InputIterator first_,\n                      InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::AnimateImages( first_->imageInfo(), first_->image() );\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    unlinkImages( first_, last_ );\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Append images from list into single image in either horizontal or\n  // vertical direction.\n  template <class InputIterator>\n  void appendImages( Image *appendedImage_,\n                     InputIterator first_,\n                     InputIterator last_,\n                     bool stack_ = false) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::Image* image = MagickLib::AppendImages( first_->image(),\n                                                       stack_,\n                                                       &exceptionInfo );\n    unlinkImages( first_, last_ );\n    appendedImage_->replaceImage( image );\n    throwException( exceptionInfo, appendedImage_->quiet() );\n  }\n\n  // Average a set of images.\n  // All the input images must be the same size in pixels.\n  template <class InputIterator>\n  void averageImages( Image *averagedImage_,\n                      InputIterator first_,\n                      InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::Image* image = MagickLib::AverageImages( first_->image(),\n                                                        &exceptionInfo );\n    unlinkImages( first_, last_ );\n    averagedImage_->replaceImage( image );\n    throwException( exceptionInfo, averagedImage_->quiet() );\n  }\n\n  // Merge a sequence of images.\n  // This is useful for GIF animation sequences that have page\n  // offsets and disposal methods. A container to contain\n  // the updated image sequence is passed via the coalescedImages_\n  // option.\n  template <class InputIterator, class Container >\n  void coalesceImages( Container *coalescedImages_,\n                       InputIterator first_,\n                       InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    // Build image list\n    linkImages( first_, last_ );\n    MagickLib::Image* images = MagickLib::CoalesceImages( first_->image(),\n                                                          &exceptionInfo);\n    // Unlink image list\n    unlinkImages( first_, last_ );\n\n    // Ensure container is empty\n    coalescedImages_->clear();\n\n    // Move images to container\n    insertImages( coalescedImages_, images );\n\n    // Report any error\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Return format coders matching specified conditions.\n  //\n  // The default (if no match terms are supplied) is to return all\n  // available format coders.\n  //\n  // For example, to return all readable formats:\n  //  list<CoderInfo> coderList;\n  //  coderInfoList( &coderList, CoderInfo::TrueMatch, CoderInfo::AnyMatch, CoderInfo::AnyMatch)\n  //\n  template <class Container >\n  void coderInfoList( Container *container_,\n                      CoderInfo::MatchType isReadable_ = CoderInfo::AnyMatch,\n                      CoderInfo::MatchType isWritable_ = CoderInfo::AnyMatch,\n                      CoderInfo::MatchType isMultiFrame_ = CoderInfo::AnyMatch\n                      ) {\n    // Obtain first entry in MagickInfo list\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    MagickLib::MagickInfo **coder_list =\n      MagickLib::GetMagickInfoArray( &exceptionInfo );\n    if( !coder_list )\n      {\n        throwException( exceptionInfo );\n        throwExceptionExplicit(MagickLib::MissingDelegateError,\n                               \"Coder array not returned!\", 0 );\n      }\n\n    // Clear out container\n    container_->clear();\n\n    for ( int i=0; coder_list[i] != 0; i++)\n      {\n        // Skip stealth coders\n        if ( coder_list[i]->stealth )\n          continue;\n\n        try {\n          CoderInfo coderInfo( coder_list[i]->name );\n\n          // Test isReadable_\n          if ( isReadable_ != CoderInfo::AnyMatch &&\n               (( coderInfo.isReadable() && isReadable_ != CoderInfo::TrueMatch ) ||\n                ( !coderInfo.isReadable() && isReadable_ != CoderInfo::FalseMatch )) )\n            continue;\n\n          // Test isWritable_\n          if ( isWritable_ != CoderInfo::AnyMatch &&\n               (( coderInfo.isWritable() && isWritable_ != CoderInfo::TrueMatch ) ||\n                ( !coderInfo.isWritable() && isWritable_ != CoderInfo::FalseMatch )) )\n            continue;\n\n          // Test isMultiFrame_\n          if ( isMultiFrame_ != CoderInfo::AnyMatch &&\n               (( coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::TrueMatch ) ||\n                ( !coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::FalseMatch )) )\n            continue;\n\n          // Append matches to container\n          container_->push_back( coderInfo );\n        }\n        // Intentionally ignore missing module errors\n        catch ( Magick::ErrorModule & )\n          {\n            continue;\n          }\n      }\n    MagickLib::MagickFree(coder_list);\n    coder_list=0;\n    MagickLib::DestroyExceptionInfo( &exceptionInfo );\n  }\n\n  //\n  // Fill container with color histogram.\n  // Entries are of type \"std::pair<Color,unsigned long>\".  Use the pair\n  // \"first\" member to access the Color and the \"second\" member to access\n  // the number of times the color occurs in the image.\n  //\n  // For example:\n  //\n  //  Using <map>:\n  //\n  //  Image image(\"image.miff\");\n  //  map<Color,unsigned long> histogram;\n  //  colorHistogram( &histogram, image );\n  //  std::map<Color,unsigned long>::const_iterator p=histogram.begin();\n  //  while (p != histogram.end())\n  //    {\n  //      cout << setw(10) << (int)p->second << \": (\"\n  //           << setw(quantum_width) << (int)p->first.redQuantum() << \",\"\n  //           << setw(quantum_width) << (int)p->first.greenQuantum() << \",\"\n  //           << setw(quantum_width) << (int)p->first.blueQuantum() << \")\"\n  //           << endl;\n  //      p++;\n  //    }\n  //\n  //  Using <vector>:\n  //\n  //  Image image(\"image.miff\");\n  //  std::vector<std::pair<Color,unsigned long> > histogram;\n  //  colorHistogram( &histogram, image );\n  //  std::vector<std::pair<Color,unsigned long> >::const_iterator p=histogram.begin();\n  //  while (p != histogram.end())\n  //    {\n  //      cout << setw(10) << (int)p->second << \": (\"\n  //           << setw(quantum_width) << (int)p->first.redQuantum() << \",\"\n  //           << setw(quantum_width) << (int)p->first.greenQuantum() << \",\"\n  //           << setw(quantum_width) << (int)p->first.blueQuantum() << \")\"\n  //           << endl;\n  //      p++;\n  //    }\n\n  template <class Container >\n  void colorHistogram( Container *histogram_, const Image image)\n  {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    // Obtain histogram array\n    unsigned long colors;\n    MagickLib::HistogramColorPacket *histogram_array =\n      MagickLib::GetColorHistogram( image.constImage(), &colors, &exceptionInfo );\n    throwException( exceptionInfo, image.quiet() );\n\n    // Clear out container\n    histogram_->clear();\n\n    // Transfer histogram array to container\n    for ( unsigned long i=0; i < colors; i++)\n      {\n        histogram_->insert(histogram_->end(),std::pair<const Color,unsigned long>\n                           ( Color(histogram_array[i].pixel.red,\n                                   histogram_array[i].pixel.green,\n                                   histogram_array[i].pixel.blue),\n                                   histogram_array[i].count) );\n      }\n\n    // Deallocate histogram array\n    MagickLib::MagickFree(histogram_array);\n    histogram_array = 0;\n  }\n\n  // Break down an image sequence into constituent parts.  This is\n  // useful for creating GIF or MNG animation sequences.\n  template <class InputIterator, class Container >\n  void deconstructImages( Container *deconstructedImages_,\n                          InputIterator first_,\n                          InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    // Build image list\n    linkImages( first_, last_ );\n    MagickLib::Image* images = MagickLib::DeconstructImages( first_->image(),\n                                                             &exceptionInfo);\n    // Unlink image list\n    unlinkImages( first_, last_ );\n\n    // Ensure container is empty\n    deconstructedImages_->clear();\n\n    // Move images to container\n    insertImages( deconstructedImages_, images );\n\n    // Report any error\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  //\n  // Display an image sequence\n  //\n  template <class InputIterator>\n  void displayImages( InputIterator first_,\n                      InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::DisplayImages( first_->imageInfo(), first_->image() );\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    unlinkImages( first_, last_ );\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Merge a sequence of image frames which represent image layers.\n  // This is useful for combining Photoshop layers into a single image.\n  template <class InputIterator>\n  void flattenImages( Image *flattendImage_,\n                      InputIterator first_,\n                      InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::Image* image = MagickLib::FlattenImages( first_->image(),\n                                                        &exceptionInfo );\n    unlinkImages( first_, last_ );\n    flattendImage_->replaceImage( image );\n    throwException( exceptionInfo, flattendImage_->quiet() );\n  }\n\n  // Replace the colors of a sequence of images with the closest color\n  // from a reference image.\n  // Set dither_ to true to enable dithering.  Set measureError_ to\n  // true in order to evaluate quantization error.\n  template <class InputIterator>\n  void mapImages( InputIterator first_,\n                  InputIterator last_,\n                  const Image& mapImage_,\n                  bool dither_ = false,\n                  bool measureError_ = false ) {\n\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::MapImages( first_->image(),\n                          mapImage_.constImage(),\n                          dither_ );\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    if ( exceptionInfo.severity != MagickLib::UndefinedException )\n      {\n        unlinkImages( first_, last_ );\n        throwException( exceptionInfo, first_->quiet() );\n      }\n\n    MagickLib::Image* image = first_->image();\n    while( image )\n      {\n        // Calculate quantization error\n        if ( measureError_ )\n          {\n            MagickLib::GetImageQuantizeError( image );\n            if ( image->exception.severity > MagickLib::UndefinedException )\n              {\n                unlinkImages( first_, last_ );\n                throwException( exceptionInfo, first_->quiet() );\n              }\n          }\n\n        // Udate DirectClass representation of pixels\n        MagickLib::SyncImage( image );\n        if ( image->exception.severity > MagickLib::UndefinedException )\n          {\n            unlinkImages( first_, last_ );\n            throwException( exceptionInfo, first_->quiet() );\n          }\n\n        // Next image\n        image=image->next;\n      }\n\n    unlinkImages( first_, last_ );\n  }\n\n  // Create a composite image by combining several separate images.\n  template <class Container, class InputIterator>\n  void montageImages( Container *montageImages_,\n                      InputIterator first_,\n                      InputIterator last_,\n                      const Montage &montageOpts_ ) {\n\n    MagickLib::MontageInfo* montageInfo =\n      static_cast<MagickLib::MontageInfo*>(MagickLib::MagickMalloc(sizeof(MagickLib::MontageInfo)));\n\n    // Update montage options with those set in montageOpts_\n    montageOpts_.updateMontageInfo( *montageInfo );\n\n    // Update options which must transfer to image options\n    if ( montageOpts_.label().length() != 0 )\n      first_->label( montageOpts_.label() );\n\n    // Create linked image list\n    linkImages( first_, last_ );\n\n    // Reset output container to pristine state\n    montageImages_->clear();\n\n    // Do montage\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    MagickLib::Image *images = MagickLib::MontageImages( first_->image(),\n                                                         montageInfo,\n                                                         &exceptionInfo );\n    if ( images != 0 )\n      {\n        insertImages( montageImages_, images );\n      }\n\n    // Clean up any allocated data in montageInfo\n    MagickLib::DestroyMontageInfo( montageInfo );\n\n    // Unlink linked image list\n    unlinkImages( first_, last_ );\n\n    // Report any montage error\n    throwException( exceptionInfo, first_->quiet() );\n\n    // Apply transparency to montage images\n    if ( montageImages_->size() > 0 && montageOpts_.transparentColor().isValid() )\n      {\n        for_each( first_, last_, transparentImage( montageOpts_.transparentColor() ) );\n      }\n\n    // Report any transparentImage() error\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Morph a set of images\n  template <class InputIterator, class Container >\n  void morphImages( Container *morphedImages_,\n                    InputIterator first_,\n                    InputIterator last_,\n                    unsigned int frames_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    // Build image list\n    linkImages( first_, last_ );\n    MagickLib::Image* images = MagickLib::MorphImages( first_->image(), frames_,\n                                                       &exceptionInfo);\n    // Unlink image list\n    unlinkImages( first_, last_ );\n\n    // Ensure container is empty\n    morphedImages_->clear();\n\n    // Move images to container\n    insertImages( morphedImages_, images );\n\n    // Report any error\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Inlay a number of images to form a single coherent picture.\n  template <class InputIterator>\n  void mosaicImages( Image *mosaicImage_,\n                     InputIterator first_,\n                     InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::Image* image = MagickLib::MosaicImages( first_->image(),\n                                                       &exceptionInfo );\n    unlinkImages( first_, last_ );\n    mosaicImage_->replaceImage( image );\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Quantize colors in images using current quantization settings\n  // Set measureError_ to true in order to measure quantization error\n  template <class InputIterator>\n  void quantizeImages( InputIterator first_,\n                       InputIterator last_,\n                       bool measureError_ = false ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    linkImages( first_, last_ );\n\n    MagickLib::QuantizeImages( first_->quantizeInfo(),\n                               first_->image() );\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    if ( exceptionInfo.severity > MagickLib::UndefinedException )\n      {\n        unlinkImages( first_, last_ );\n        throwException( exceptionInfo, first_->quiet() );\n      }\n\n    MagickLib::Image* image = first_->image();\n    while( image != 0 )\n      {\n        // Calculate quantization error\n        if ( measureError_ )\n          MagickLib::GetImageQuantizeError( image );\n\n        // Update DirectClass representation of pixels\n        MagickLib::SyncImage( image );\n\n        // Next image\n        image=image->next;\n      }\n\n    unlinkImages( first_, last_ );\n  }\n\n  // Read images into existing container (appending to container)\n  // FIXME: need a way to specify options like size, depth, and density.\n  template <class Container>\n  void readImages( Container *sequence_,\n                   const std::string &imageSpec_ ) {\n    MagickLib::ImageInfo *imageInfo = MagickLib::CloneImageInfo(0);\n    imageSpec_.copy( imageInfo->filename, MaxTextExtent-1 );\n    imageInfo->filename[ imageSpec_.length() ] = 0;\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    MagickLib::Image* images =  MagickLib::ReadImage( imageInfo, &exceptionInfo );\n    MagickLib::DestroyImageInfo(imageInfo);\n    insertImages( sequence_, images);\n    throwException( exceptionInfo );\n  }\n  template <class Container>\n  void readImages( Container *sequence_,\n                   const Blob &blob_ ) {\n    MagickLib::ImageInfo *imageInfo = MagickLib::CloneImageInfo(0);\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    MagickLib::Image *images = MagickLib::BlobToImage( imageInfo,\n                                                       blob_.data(),\n                                                       blob_.length(), &exceptionInfo );\n    MagickLib::DestroyImageInfo(imageInfo);\n    insertImages( sequence_, images );\n    throwException( exceptionInfo );\n  }\n\n  // Write Images\n  //\n  // If an attribute is not supported as an explicit argument\n  // (e.g. 'magick'), then the attribute must be set on the involved\n  // images in the container prior to invoking writeImages() since\n  // attributes from the individual images are the ones which are\n  // used.\n  template <class InputIterator>\n  void writeImages( InputIterator first_,\n                    InputIterator last_,\n                    const std::string &imageSpec_,\n                    bool adjoin_ = true ) {\n\n    first_->adjoin( adjoin_ );\n\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    linkImages( first_, last_ );\n    int errorStat = MagickLib::WriteImages( first_->constImageInfo(),\n                                            first_->image(),\n                                            imageSpec_.c_str(),\n                                            &exceptionInfo );\n    unlinkImages( first_, last_ );\n\n    if ( errorStat != false )\n      {\n        MagickLib::DestroyExceptionInfo( &exceptionInfo );\n        return;\n      }\n\n    throwException( exceptionInfo, first_->quiet() );\n  }\n  // Write images to BLOB\n  //\n  // If an attribute is not supported as an explicit argument\n  // (e.g. 'magick'), then the attribute must be set on the involved\n  // images in the container prior to invoking writeImages() since\n  // attributes from the individual images are the ones which are\n  // used.\n  template <class InputIterator>\n  void writeImages( InputIterator first_,\n                    InputIterator last_,\n                    Blob *blob_,\n                    bool adjoin_ = true) {\n\n    first_->adjoin( adjoin_ );\n\n    linkImages( first_, last_ );\n\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    size_t length = 2048; // Efficient size for small images\n    void* data = MagickLib::ImageToBlob( first_->imageInfo(),\n                                         first_->image(),\n                                         &length,\n                                         &exceptionInfo);\n    blob_->updateNoCopy( data, length, Magick::Blob::MallocAllocator );\n\n    unlinkImages( first_, last_ );\n\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n} // namespace Magick\n\n#endif // Magick_STL_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++/TypeMetric.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 2001, 2002\n//\n// TypeMetric Definition\n//\n// Container for font type metrics\n//\n\n#if !defined (Magick_TypeMetric_header)\n#define Magick_TypeMetric_header\n\n#include \"Magick++/Include.h\"\n\nnamespace Magick\n{\n  class MagickDLLDecl TypeMetric\n  {\n    friend class Image;\n  public:\n\n    TypeMetric ( void );\n    ~TypeMetric ( void );\n\n    // Ascent, the distance in pixels from the text baseline to the\n    // highest/upper grid coordinate used to place an outline point.\n    double         ascent ( void ) const;\n\n    // Descent, the distance in pixels from the baseline to the lowest\n    // grid coordinate used to place an outline point. Always a\n    // negative value.\n    double         descent ( void ) const;\n\n    // Text width in pixels.\n    double         textWidth ( void ) const;\n\n    // Text height in pixels.\n    double         textHeight ( void ) const;\n\n    // Maximum horizontal advance in pixels.\n    double         maxHorizontalAdvance ( void ) const;\n\n    //\n    // Public methods below this point are for Magick++ use only.\n    //\n\n  private:\n    MagickLib::TypeMetric  _typeMetric;\n  };\n} // namespace Magick\n\n//\n// Inlines\n//\n\n\n#endif // Magick_TypeMetric_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/Magick++.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000\n//\n// Simplified includes for Magick++.\n// Inclusion of this header is sufficient to use all Magick++ APIs.\n//\n#ifndef MagickPlusPlus_Header\n#include <Magick++/Include.h>\n#include <Magick++/Image.h>\n#include <Magick++/Pixels.h>\n#include <Magick++/STL.h>\n#define MagickPlusPlus_Header\n#endif // MagickPlusPlus_Header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/analyze.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Analysis Methods.\n*/\n#ifndef _MAGICK_ANALYZE_H\n#define _MAGICK_ANALYZE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#include \"magick/image.h\"\n\ntypedef struct _ImageCharacteristics\n{\n  MagickBool\n    cmyk,               /* CMYK(A) image */\n    grayscale,          /* Grayscale image */\n    monochrome,         /* Black/white image */\n    opaque,             /* Opaque image */\n    palette;            /* Colormapped image */\n} ImageCharacteristics;\n\n/* Functions which return unsigned int to indicate operation pass/fail */\nextern MagickExport MagickPassFail\n  GetImageCharacteristics(const Image *image,ImageCharacteristics *characteristics,\n                          const MagickBool optimize,ExceptionInfo *exception);\n\nextern MagickExport unsigned long\n  GetImageDepth(const Image *,ExceptionInfo *);\n\nextern MagickExport MagickBool\n  IsGrayImage(const Image *image,ExceptionInfo *exception),\n  IsMonochromeImage(const Image *image,ExceptionInfo *exception),\n  IsOpaqueImage(const Image *image,ExceptionInfo *exception);\n\nextern MagickExport ImageType\n  GetImageType(const Image *,ExceptionInfo *);\n\nextern MagickExport RectangleInfo\n  GetImageBoundingBox(const Image *,ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_ANALYZE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/api.h",
    "content": "/*\n  Copyright (C) 2003 - 2012 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Application Programming Interface declarations.\n\n*/\n\n#if !defined(_MAGICK_API_H)\n#define _MAGICK_API_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/magick_config.h\"\n#if defined(__cplusplus) || defined(c_plusplus)\n#  undef inline\n#endif\n\n#include <stdio.h>\n#include <stdarg.h>\n#include <stdlib.h>\n#include <sys/types.h> /* POSIX 1990 header and declares size_t and ssize_t */\n\n/*\n  Note that the WIN32 and WIN64 definitions are provided by the build\n  configuration rather than the compiler.  Definitions available from\n  the Windows compiler are _WIN32 and _WIN64.\n*/\n#if defined(WIN32) || defined(WIN64)\n#  define MSWINDOWS\n#endif /* defined(WIN32) || defined(WIN64) */\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  if defined(MSWINDOWS)\n  /* Use Visual C++ C inline method extension to improve performance */\n#    if !defined(inline) && !defined(__cplusplus) && !defined(c_plusplus)\n#      define inline __inline\n#    endif\n#  endif\n#endif\n\n#if defined(PREFIX_MAGICK_SYMBOLS)\n#  include \"magick/symbols.h\"\n#endif /* defined(PREFIX_MAGICK_SYMBOLS) */\n\n#include \"magick/common.h\"\n#include \"magick/magick_types.h\"\n#include \"magick/analyze.h\"\n#include \"magick/attribute.h\"\n#include \"magick/average.h\"\n#include \"magick/blob.h\"\n#include \"magick/cdl.h\"\n#include \"magick/channel.h\"\n#include \"magick/color.h\"\n#include \"magick/color_lookup.h\"\n#include \"magick/colormap.h\"\n#include \"magick/command.h\"\n#include \"magick/compare.h\"\n#include \"magick/composite.h\"\n#include \"magick/compress.h\"\n#include \"magick/confirm_access.h\"\n#include \"magick/constitute.h\"\n#include \"magick/decorate.h\"\n#include \"magick/delegate.h\"\n#include \"magick/deprecate.h\"\n#include \"magick/describe.h\"\n#include \"magick/draw.h\"\n#include \"magick/effect.h\"\n#include \"magick/enhance.h\"\n#include \"magick/error.h\"\n#include \"magick/fx.h\"\n#include \"magick/gem.h\"\n#include \"magick/gradient.h\"\n#include \"magick/hclut.h\"\n#include \"magick/image.h\"\n#include \"magick/list.h\"\n#include \"magick/log.h\"\n#include \"magick/magic.h\"\n#include \"magick/magick.h\"\n#include \"magick/memory.h\"\n#include \"magick/module.h\"\n#include \"magick/monitor.h\"\n#include \"magick/montage.h\"\n#include \"magick/operator.h\"\n#include \"magick/paint.h\"\n#include \"magick/pixel_cache.h\"\n#include \"magick/pixel_iterator.h\"\n#include \"magick/plasma.h\"\n#include \"magick/profile.h\"\n#include \"magick/quantize.h\"\n  /*#include \"magick/random.h\"*/\n#include \"magick/registry.h\"\n#include \"magick/render.h\"\n#include \"magick/resize.h\"\n#include \"magick/resource.h\"\n#include \"magick/shear.h\"\n#include \"magick/signature.h\"\n#include \"magick/statistics.h\"\n#include \"magick/texture.h\"\n#include \"magick/timer.h\"\n#include \"magick/transform.h\"\n#include \"magick/type.h\"\n#include \"magick/utility.h\"\n#include \"magick/version.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_API_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/attribute.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Methods to Get/Set/Destroy Image Text Attributes.\n*/\n#ifndef _MAGICK_ATTRIBUTE_H\n#define _MAGICK_ATTRIBUTE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/image.h\"\n\ntypedef struct _ImageAttribute\n{\n  char\n    *key,           /* identifying key */\n    *value;         /* value string */\n\n  size_t\n    length;         /* value string length */\n\n  struct _ImageAttribute\n    *previous,\n    *next;\n} ImageAttribute;\n\f\n/*\n  MagickExported text attribute methods.\n*/\nextern MagickExport const ImageAttribute\n  *GetImageAttribute(const Image *image,const char *key),\n  *GetImageClippingPathAttribute(const Image *image),\n  *GetImageInfoAttribute(const ImageInfo *image_info,const Image *image,const char *key);\n\nextern MagickExport MagickPassFail\n  CloneImageAttributes(Image* clone_image, const Image* original_image),\n  SetImageAttribute(Image *image,const char *key,const char *value);\n\nextern MagickExport void\n  DestroyImageAttributes(Image *image);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/attribute-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/average.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Averaging Methods.\n*/\n#ifndef _MAGICK_AVERAGE_H\n#define _MAGICK_AVERAGE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\nextern MagickExport Image\n  *AverageImages(const Image *,ExceptionInfo *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_AVERAGE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/blob.h",
    "content": "/*\n  Copyright (C) 2003-2018 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Image Compression/Decompression Methods.\n*/\n#ifndef _MAGICK_BLOB_H\n#define _MAGICK_BLOB_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/image.h\"\n\n  /*\n    Minimum input file size before considering for memory map.\n  */\n#define MinBlobExtent  32768L\n\n  /*\n    Forward declarations.\n  */\n  typedef struct _BlobInfo BlobInfo;\n  \f\n  /*\n   *\n   * BlobInfo methods\n   *\n   */\n\n  /*\n    Makes a duplicate of the given blob info structure, or if blob info\n    is NULL, a new one.\n  */\n  extern MagickExport BlobInfo* CloneBlobInfo(const BlobInfo *blob_info);\n\n  /*\n    Increments the reference count associated with the pixel blob,\n    returning a pointer to the blob.\n  */\n  extern MagickExport BlobInfo* ReferenceBlob(BlobInfo *blob);\n\n  /*\n    Deallocate memory associated with the BlobInfo structure.\n  */\n  extern MagickExport void DestroyBlobInfo(BlobInfo *blob) MAGICK_FUNC_DEPRECATED;\n\n  /*\n    If BLOB is a memory mapping then unmap it. Reset BlobInfo structure\n    to its default state.\n  */\n  extern MagickExport void DetachBlob(BlobInfo *blob);\n\n  /*\n    Initialize a BlobInfo structure.\n  */\n  extern MagickExport void GetBlobInfo(BlobInfo *blob);\n\n  /*\n    Attach memory buffer to a BlobInfo structure.\n  */\n  extern MagickExport void AttachBlob(BlobInfo *blob_info,\n                                      const void *blob,\n                                      const size_t length);\n\n  /*\n   *\n   * Functions for managing a BLOB (type BlobInfo) attached to an Image.\n   *\n   */\n\n  /*\n    Deallocate all memory associated with an Image blob (reference counted).\n  */\n  extern MagickExport void DestroyBlob(Image *image);\n\n\n  /*\n   *\n   * Formatted image I/O functions\n   *\n   */\n\n  /*\n    Read an Image from a formatted in-memory \"file\" image  (\"BLOB\").\n  */\n  extern MagickExport Image* BlobToImage(const ImageInfo *image_info,\n                                         const void *blob,\n                                         const size_t length,\n                                         ExceptionInfo *exception);\n\n  /*\n    Return an Image populated with salient information regarding a\n    formatted in-memory \"file\" image (\"BLOB\") but without reading the\n    image pixels.\n  */\n  extern MagickExport Image* PingBlob(const ImageInfo *image_info,\n                                      const void *blob,\n                                      const size_t length,\n                                      ExceptionInfo *exception);\n\n  /*\n    Writes an Image to a formatted (like a file) in-memory\n    representation.\n  */\n  extern MagickExport void *ImageToBlob(const ImageInfo *image_info,\n                                        Image *image,\n                                        size_t *length,\n                                        ExceptionInfo *exception);\n\n  /*\n   *\n   * Core File or BLOB I/O functions.\n   *\n   */\n\n  /*\n    Blob open modes.\n  */\n  typedef enum\n    {\n      UndefinedBlobMode,    /* Undefined */\n      ReadBlobMode,         /* Open for reading (text) */ /* only locale.c */\n      ReadBinaryBlobMode,   /* Open for reading (binary) */\n      WriteBlobMode,        /* Open for writing (text) */ /* only mvg.c txt.c */\n      WriteBinaryBlobMode   /* Open for writing (binary) */\n    } BlobMode;\n\n  /*\n    Open an input or output stream for access.  May also use a stream\n    provided via image_info->stream.\n  */\n  extern MagickExport MagickPassFail OpenBlob(const ImageInfo *image_info,\n                                              Image *image,\n                                              const BlobMode mode,\n                                              ExceptionInfo *exception);\n\n  /*\n    Close I/O to the file or BLOB.\n  */\n  extern MagickExport MagickPassFail CloseBlob(Image *image);\n\n\n  /*\n    Read data from the file or BLOB into a buffer.\n  */\n  extern MagickExport size_t ReadBlob(Image *image,\n                                      const size_t length,\n                                      void *data);\n\n  /*\n    Read data from the file or BLOB into a buffer, but support zero-copy\n    if possible.\n  */\n  extern MagickExport size_t ReadBlobZC(Image *image,\n                                        const size_t length,\n                                        void **data);\n\n  /*\n    Write data from a buffer to the file or BLOB.\n  */\n  extern MagickExport size_t WriteBlob(Image *image,\n                                       const size_t length,\n                                       const void *data);\n\n  /*\n    Move the current read or write offset position in the file or BLOB.\n  */\n  extern MagickExport magick_off_t SeekBlob(Image *image,\n                                            const magick_off_t offset,\n                                            const int whence);\n\n  /*\n    Obtain the current read or write offset position in the file or\n    BLOB.\n  */\n  extern MagickExport magick_off_t TellBlob(const Image *image);\n\n  /*\n    Test to see if EOF has been detected while reading the file or BLOB.\n  */\n  extern MagickExport int EOFBlob(const Image *image);\n\n  /*\n    Test to see if an error has been encountered while doing I/O to the file\n    or BLOB.  Non-zero is returned if an error occured.\n  */\n  extern MagickExport int GetBlobStatus(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Return the first errno present when an error has been encountered while\n    doing I/O to the file or BLOB.  This is only useful if GetBlobStatus() has\n    already reported that an error occured.\n  */\n  extern MagickExport int GetBlobFirstErrno(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Test to see if blob is currently open.\n  */\n  extern MagickExport MagickBool GetBlobIsOpen(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Obtain the current size of the file or BLOB.  Zero is returned if\n    the size can not be determined.  If BLOB is no longer open, then\n    return the size when the BLOB was closed.\n  */\n  extern MagickExport magick_off_t GetBlobSize(const Image *image);\n\n\n  /*\n    Obtain the underlying stdio FILE* for the file (if any).\n  */\n  extern MagickExport FILE *GetBlobFileHandle(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Obtain a pointer to the base of where BLOB data is stored.  The data\n    is only available if the data is stored on the heap, or is memory\n    mapped.  Otherwise NULL is returned.\n  */\n  extern MagickExport unsigned char *GetBlobStreamData(const Image *image) MAGICK_FUNC_PURE;\n\n\n  /*\n   *\n   * Formatted File or BLOB I/O functions.\n   *\n   */\n\n  /*\n    Read a single byte from the file or BLOB.  Returns an EOF character if EOF\n    has been detected.\n  */\n  extern MagickExport int ReadBlobByte(Image *image);\n\n  /*\n    Read a 16-bit little-endian unsigned \"short\" value from the file or BLOB.\n  */\n  extern MagickExport magick_uint16_t ReadBlobLSBShort(Image *image);\n\n  /*\n    Read a 16-bit little-endian signed \"short\" value from the file or BLOB.\n  */\n  extern MagickExport magick_int16_t ReadBlobLSBSignedShort(Image *image);\n\n  /*\n    Read an array of little-endian unsigned 16-bit \"short\" values from the\n    file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobLSBShorts(Image *image, size_t octets,\n                                               magick_uint16_t *data);\n\n  /*\n    Read a 16-bit big-endian unsigned \"short\" value from the file or\n    BLOB.\n  */\n  extern MagickExport magick_uint16_t ReadBlobMSBShort(Image *image);\n\n  /*\n    Read a 16-bit big-endian signed \"short\" value from the file or BLOB.\n  */\n  extern MagickExport magick_int16_t ReadBlobMSBSignedShort(Image *image);\n\n  /*\n    Read an array of big-endian 16-bit \"short\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobMSBShorts(Image *image, size_t octets,\n                                               magick_uint16_t *data);\n\n  /*\n    Read a 32-bit little-endian unsigned \"long\" value from the file or BLOB.\n  */\n  extern MagickExport magick_uint32_t ReadBlobLSBLong(Image *image);\n\n  /*\n    Read a 32-bit little-endian signed \"long\" value from the file or BLOB.\n  */\n  extern MagickExport magick_int32_t ReadBlobLSBSignedLong(Image *image);\n\n  /*\n    Read an array of little-endian 32-bit \"long\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobLSBLongs(Image *image, size_t octets,\n                                              magick_uint32_t *data);\n\n  /*\n    Read a 32-bit big-endian unsigned \"long\" value from the file or BLOB.\n  */\n  extern MagickExport magick_uint32_t ReadBlobMSBLong(Image *image);\n\n  /*\n    Read a 32-bit big-endian signed \"long\" value from the file or BLOB.\n  */\n  extern MagickExport magick_int32_t ReadBlobMSBSignedLong(Image *image);\n\n  /*\n    Read an array of big-endian 32-bit \"long\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobMSBLongs(Image *image, size_t octets,\n                                              magick_uint32_t *data);\n\n  /*\n    Read a little-endian 32-bit \"float\" value from the file or BLOB.\n  */\n  extern MagickExport float ReadBlobLSBFloat(Image *image);\n\n  /*\n    Read an array of little-endian 32-bit \"float\" values from the file or\n    BLOB.\n  */\n  extern MagickExport size_t ReadBlobLSBFloats(Image *image, size_t octets,\n                                               float *data);\n\n  /*\n    Read a big-endian 32-bit \"float\" value from the file or BLOB.\n  */\n  extern MagickExport float ReadBlobMSBFloat(Image *image);\n\n  /*\n    Read an array of big-endian 32-bit \"float\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobMSBFloats(Image *image, size_t octets,\n                                               float *data);\n\n  /*\n    Read a little-endian 64-bit \"double\" value from the file or BLOB.\n  */\n  extern MagickExport double ReadBlobLSBDouble(Image *image);\n\n  /*\n    Read an array of little-endian 64-bit \"double\" values from the file or\n    BLOB.\n  */\n  extern MagickExport size_t ReadBlobLSBDoubles(Image *image, size_t octets,\n                                                double *data);\n\n  /*\n    Read a big-endian 64-bit \"double\" value from the file or BLOB.\n  */\n  extern MagickExport double ReadBlobMSBDouble(Image *image);\n\n  /*\n    Read an array of big-endian 64-bit \"double\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobMSBDoubles(Image *image, size_t octets,\n                                                double *data);\n\n  /*\n    Read a string from the file or blob until a newline character is read or\n    an end-of-file condition is encountered.\n  */\n  extern MagickExport char *ReadBlobString(Image *image,\n                                           char *string);\n\n  /*\n    Write a single byte to the file or BLOB.\n  */\n  extern MagickExport size_t WriteBlobByte(Image *image,\n                                           const magick_uint8_t value);\n\n  /*\n    Write the content of an entire disk file to the file or BLOB.\n  */\n  extern MagickExport MagickPassFail WriteBlobFile(Image *image,\n                                                   const char *filename);\n\n  /*\n    Write a 16-bit signed \"short\" value to the file or BLOB in little-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobLSBShort(Image *image,\n                                               const magick_uint16_t value);\n\n  /*\n    Write a 16-bit signed \"short\" value to the file or BLOB in little-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobLSBSignedShort(Image *image,\n                                                     const magick_int16_t value);\n\n  /*\n    Write a 32-bit unsigned \"long\" value to the file or BLOB in little-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobLSBLong(Image *image,\n                                              const magick_uint32_t value);\n\n  /*\n    Write a 32-bit signed \"long\" value to the file or BLOB in little-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobLSBSignedLong(Image *image,\n                                                    const magick_int32_t value);\n\n\n\n  /*\n    Write a 32-bit unsigned \"long\" value to the file or BLOB in big-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobMSBLong(Image *image,\n                                              const magick_uint32_t value);\n\n  /*\n    Write a 32-bit signed \"long\" value to the file or BLOB in big-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobMSBSignedLong(Image *image,\n                                                    const magick_int32_t value);\n\n  /*\n    Write a 16-bit unsigned \"short\" value to the file or BLOB in big-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobMSBShort(Image *image,\n                                               const magick_uint16_t value);\n\n  /*\n    Write a 16-bit signed \"short\" value to the file or BLOB in big-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobMSBSignedShort(Image *image,\n                                                     const magick_int16_t value);\n\n  /*\n    Write a C string to the file or BLOB, without the terminating NULL byte.\n  */\n  extern MagickExport size_t WriteBlobString(Image *image,\n                                             const char *string);\n\n  /*\n   *\n   * BLOB attribute access.\n   *\n   */\n\n  /*\n    Blob supports seek operations.  BlobSeek() and BlobTell() may safely be\n    used.\n  */\n  extern MagickExport MagickBool BlobIsSeekable(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Allow file descriptor to be closed (if True).\n  */\n  extern MagickExport void SetBlobClosable(Image *image,\n                                           MagickBool closable);\n\n  /*\n    Blob is for a temporary file which should be deleted (if True).\n  */\n  extern MagickExport void SetBlobTemporary(Image *image,\n                                            MagickBool isTemporary);\n\n  /*\n    Returns MagickTrue if the file associated with the blob is a temporary\n    file and should be removed when the associated image is destroyed.\n  */\n  extern MagickExport MagickBool GetBlobTemporary(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n   *\n   * Memory mapped file support.\n   *\n   */\n\n  /*\n    Memory mapping modes.\n  */\n  typedef enum\n    {\n      ReadMode,             /* Map for read-only access */\n      WriteMode,            /* Map for write-only access (useless) */\n      IOMode                /* Map for read/write access */\n    } MapMode;\n\n  /*\n    Release memory mapping for a region.\n  */\n  extern MagickExport MagickPassFail UnmapBlob(void *map,\n                                               const size_t length);\n\n  /*\n    Perform a requested memory mapping of a file descriptor.\n  */\n  extern MagickExport void *MapBlob(int file,\n                                    const MapMode mode,\n                                    magick_off_t offset,\n                                    size_t length);\n\n  /*\n   *\n   * Buffer to File / File to Buffer functions.\n   *\n   */\n\n  /*\n    Writes a buffer to a named file.\n  */\n  extern MagickExport MagickPassFail BlobToFile(const char *filename,\n                                                const void *blob,\n                                                const size_t length,\n                                                ExceptionInfo *exception);\n\n  /*\n    Read the contents of a file into memory.\n  */\n  extern MagickExport void *FileToBlob(const char *filename,\n                                       size_t *length,\n                                       ExceptionInfo *exception);\n\n  /*\n   *\n   * Junk yet to be categorized.\n   *\n   */\n\n  /*\n    Reserve space for a specified output size.\n  */\n  extern MagickExport MagickPassFail BlobReserveSize(Image *image, magick_off_t size);\n\n  /*\n    Copies data from the input stream to a file.  Useful in case it is\n    necessary to perform seek operations on the input data.\n  */\n  extern MagickExport MagickPassFail ImageToFile(Image *image,\n                                                 const char *filename,\n                                                 ExceptionInfo *exception);\n\n  /*\n    Search for a configuration file (\".mgk\" file) using appropriate\n    rules and return as an in-memory buffer.\n  */\n  extern MagickExport void *GetConfigureBlob(const char *filename,\n                                             char *path,\n                                             size_t *length,\n                                             ExceptionInfo *exception);\n\n  /*\n    Converts a least-significant byte first buffer of integers to\n    most-significant byte first.\n  */\n  extern MagickExport void MSBOrderLong(unsigned char *buffer,\n                                        const size_t length);\n\n  /*\n    Converts a least-significant byte first buffer of integers to\n    most-significant byte first.\n  */\n  extern MagickExport void MSBOrderShort(unsigned char *p,\n                                         const size_t length);\n\n  /*\n    Checks if the blob of the specified image is referenced by other images. If\n    the reference count is higher then 1 a new blob is assigned to the image.\n  */\n  extern MagickExport void DisassociateBlob(Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/cdl.h",
    "content": "/*\n * Copyright (C) 2009 GraphicsMagick Group\n *\n * American Society of Cinematographers Color Decision List (ASC-CDL)\n * implementation.\n *\n * Original implementation by Clment Follet.\n */\n\n#ifndef _MAGICK_CDL_H\n#define _MAGICK_CDL_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif  /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport MagickPassFail\n  CdlImage(Image *image,const char *cdl);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_CDL_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/channel.h",
    "content": "/*\n  Copyright (C) 2004 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n*/\n#ifndef _MAGICK_CHANNEL_H\n#define _MAGICK_CHANNEL_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n\nextern MagickExport Image\n  *ExportImageChannel(const Image *image,\n                      const ChannelType channel,\n                      ExceptionInfo *exception);\n\nextern MagickExport unsigned int\n  GetImageChannelDepth(const Image *image,\n                       const ChannelType channel,\n                       ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  ChannelImage(Image *image,const ChannelType channel),\n  ImportImageChannel(const Image *src_image,\n                     Image *dst_image,\n                     const ChannelType channel),\n  ImportImageChannelsMasked(const Image *source_image,\n                            Image *update_image,\n                            const ChannelType channels),\n  SetImageChannelDepth(Image *image,\n                       const ChannelType channel,\n                       const unsigned int depth);\n\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_CHANNEL_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/color.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Color Utility Methods.\n*/\n#ifndef _MAGICK_COLOR_H\n#define _MAGICK_COLOR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  PixelPacket with usage count, used to support color histograms.\n*/\ntypedef struct _HistogramColorPacket\n{\n  PixelPacket\n    pixel;\n\n  unsigned long\n    count;\n} HistogramColorPacket;\n\nextern MagickExport HistogramColorPacket\n  *GetColorHistogram(const Image *image,unsigned long *colors,\n     ExceptionInfo *exception);\n\nextern MagickExport unsigned long\n  GetNumberColors(const Image *image,FILE *file,ExceptionInfo *exception);\n\nextern MagickExport void\n  GetColorTuple(const PixelPacket *color,const unsigned int depth,\n    const unsigned int matte,const unsigned int hex,char *tuple);\n\nextern MagickExport MagickBool\n  IsPaletteImage(const Image *image,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/color-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_COLOR_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/color_lookup.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Color Lookup Methods.\n*/\n#ifndef _MAGICK_COLOR_LOOKUP_H\n#define _MAGICK_COLOR_LOOKUP_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Specifications that color is compliant with.\n*/\ntypedef enum\n{\n  UndefinedCompliance = 0x0000,\n  NoCompliance = 0x0000,\n  SVGCompliance = 0x0001,\n  X11Compliance = 0x0002,\n  XPMCompliance = 0x0004,\n  AllCompliance = 0xffff\n} ComplianceType;\n\nextern MagickExport char\n  **GetColorList(const char *pattern,unsigned long *number_colors);\n\nextern MagickExport unsigned int\n  QueryColorDatabase(const char *name,PixelPacket *color,ExceptionInfo *exception),\n  QueryColorname(const Image *image,const PixelPacket *color,\n    const ComplianceType compliance,char *name,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/color_lookup-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_COLOR_LOOKUP_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/colormap.h",
    "content": "/*\n  Copyright (C) 2003 - 2019 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Colormap Methods\n*/\n#ifndef _MAGICK_COLORMAP_H\n#define _MAGICK_COLORMAP_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\nextern MagickExport MagickPassFail\n  AllocateImageColormap(Image *,const unsigned long colors),\n  CycleColormapImage(Image *image,const int amount),\n  ReallocateImageColormap(Image *,const unsigned int colors),\n  ReplaceImageColormap(Image *image,const PixelPacket *colormap,\n    const unsigned int colors),\n  SortColormapByIntensity(Image *image);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/colormap-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_COLORMAP_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/colorspace.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Colorspace Methods.\n*/\n#ifndef _MAGICK_COLORSPACE_H\n#define _MAGICK_COLORSPACE_H\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n\n#if (QuantumDepth == 8) || (QuantumDepth == 16)\n  /*\n    intensity=0.299*red+0.587*green+0.114*blue.\n    Premultiply by 1024 to obtain integral values, and then divide\n    result by 1024 by shifting to the right by 10 bits.\n  */\n#define PixelIntensityRec601(pixel) \\\n  ((unsigned int) \\\n   (((unsigned int) (pixel)->red*306U+ \\\n     (unsigned int) (pixel)->green*601U+ \\\n     (unsigned int) (pixel)->blue*117U) \\\n    >> 10U))\n#elif (QuantumDepth == 32)\n  /*\n    intensity=0.299*red+0.587*green+0.114*blue.\n  */\n#define PixelIntensityRec601(pixel) \\\n  ((unsigned int) \\\n   (((double)306.0*(pixel)->red+ \\\n     (double)601.0*(pixel)->green+ \\\n     (double)117.0*(pixel)->blue) \\\n    / 1024.0))\n#endif\n\n  /*\n    intensity=0.2126*red+0.7152*green+0.0722*blue\n  */\n#define PixelIntensityRec709(pixel) \\\n  ((unsigned int) \\\n   (0.2126*(pixel)->red+ \\\n    0.7152*(pixel)->green+ \\\n    0.0722*(pixel)->blue))\n\n#define PixelIntensity(pixel) PixelIntensityRec601(pixel)\n#define PixelIntensityToDouble(pixel) ((double)PixelIntensity(pixel))\n#define PixelIntensityToQuantum(pixel) ((Quantum)PixelIntensity(pixel))\n#define IsCMYKColorspace(colorspace) \\\n  ( \\\n    (colorspace == CMYKColorspace) \\\n  )\n#define IsGrayColorspace(colorspace) \\\n  ( \\\n    (colorspace == GRAYColorspace) || \\\n    (colorspace == Rec601LumaColorspace) || \\\n    (colorspace == Rec709LumaColorspace) \\\n  )\n#define IsRGBColorspace(colorspace) \\\n  ( \\\n    (IsGrayColorspace(colorspace)) || \\\n    (colorspace == RGBColorspace) || \\\n    (colorspace == TransparentColorspace) \\\n  )\n#define IsLABColorspace(colorspace) \\\n  ( \\\n    (colorspace == LABColorspace) \\\n  )\n#define IsRGBCompatibleColorspace(colorspace) \\\n  ( \\\n   (IsRGBColorspace(colorspace)) || \\\n   (colorspace == CineonLogRGBColorspace ) \\\n  )\n#define IsYCbCrColorspace(colorspace) \\\n  ( \\\n    (colorspace == YCbCrColorspace) || \\\n    (colorspace == Rec601YCbCrColorspace) || \\\n    (colorspace == Rec709YCbCrColorspace) \\\n  )\n\n#define YCbCrColorspace Rec601YCbCrColorspace\ntypedef enum\n{\n  UndefinedColorspace,\n  RGBColorspace,         /* Plain old RGB colorspace */\n  GRAYColorspace,        /* Plain old full-range grayscale */\n  TransparentColorspace, /* RGB but preserve matte channel during quantize */\n  OHTAColorspace,\n  XYZColorspace,         /* CIE XYZ */\n  YCCColorspace,         /* Kodak PhotoCD PhotoYCC */\n  YIQColorspace,\n  YPbPrColorspace,\n  YUVColorspace,\n  CMYKColorspace,        /* Cyan, magenta, yellow, black, alpha */\n  sRGBColorspace,        /* Kodak PhotoCD sRGB */\n  HSLColorspace,         /* Hue, saturation, luminosity */\n  HWBColorspace,         /* Hue, whiteness, blackness */\n  LABColorspace,         /* LAB colorspace not supported yet other than via lcms */\n  CineonLogRGBColorspace,/* RGB data with Cineon Log scaling, 2.048 density range */\n  Rec601LumaColorspace,  /* Luma (Y) according to ITU-R 601 */\n  Rec601YCbCrColorspace, /* YCbCr according to ITU-R 601 */\n  Rec709LumaColorspace,  /* Luma (Y) according to ITU-R 709 */\n  Rec709YCbCrColorspace  /* YCbCr according to ITU-R 709 */\n} ColorspaceType;\n\nextern MagickExport MagickPassFail\n  RGBTransformImage(ImagePtr,const ColorspaceType),\n  TransformColorspace(ImagePtr,const ColorspaceType),\n  TransformRGBImage(ImagePtr,const ColorspaceType);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_COLORSPACE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/command.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Image Command Methods.\n*/\n#ifndef _MAGICK_COMMAND_H\n#define _MAGICK_COMMAND_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\nextern MagickExport MagickPassFail\n  AnimateImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  BenchmarkImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  CompareImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  CompositeImageCommand(ImageInfo *image_info,int argc,char **argv,\n                        char **metadata,ExceptionInfo *exception),\n  ConjureImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  ConvertImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  DisplayImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  IdentifyImageCommand(ImageInfo *image_info,int argc,char **argv,\n                       char **metadata,ExceptionInfo *exception),\n  ImportImageCommand(ImageInfo *image_info,int argc,char **argv,\n                     char **metadata,ExceptionInfo *exception),\n  MagickCommand(ImageInfo *image_info,int argc,char **argv,\n                char **metadata,ExceptionInfo *exception),\n  MogrifyImage(const ImageInfo *,int,char **,Image **),\n  MogrifyImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  MogrifyImages(const ImageInfo *,int,char **,Image **),\n  MontageImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  TimeImageCommand(ImageInfo *image_info,int argc,char **argv,\n                   char **metadata,ExceptionInfo *exception);\n\nextern MagickExport int\n  GMCommand(int argc,char **argv);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/command-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/common.h",
    "content": "/*\n  Copyright (C) 2009-2016 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Magick API common definitions support.\n*/\n#ifndef _MAGICK_COMMON_H\n#define _MAGICK_COMMON_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n * Borland C++ Builder DLL compilation defines\n */\n#if defined(__BORLANDC__) && defined(_DLL)\n#  pragma message(\"BCBMagick lib DLL export interface\")\n#  define _MAGICKDLL_\n#  define _MAGICKLIB_\n#  undef BuildMagickModules\n#  define SupportMagickModules\n#endif\n\n#if defined(MSWINDOWS) && !defined(__CYGWIN__)\n#  if defined(_MT) && defined(_DLL) && !defined(_MAGICKDLL_) && !defined(_LIB)\n#    define _MAGICKDLL_\n#  endif\n#  if defined(_MAGICKDLL_)\n#    if defined(_VISUALC_)\n#      pragma warning( disable: 4273 )  /* Disable the dll linkage warnings */\n#    endif\n#    if !defined(_MAGICKLIB_)\n#      define MagickExport  __declspec(dllimport)\n#      if defined(_VISUALC_)\n#        pragma message( \"Magick lib DLL import interface\" )\n#      endif\n#    else\n#      define MagickExport  __declspec(dllexport)\n#      if defined(_VISUALC_)\n#         pragma message( \"Magick lib DLL export interface\" )\n#      endif\n#    endif\n#  else\n#    define MagickExport\n#    if defined(_VISUALC_)\n#      pragma message( \"Magick lib static interface\" )\n#    endif\n#  endif\n#  if defined(_DLL) && !defined(_LIB)\n#    define ModuleExport  __declspec(dllexport)\n#    if defined(_VISUALC_)\n#      pragma message( \"Magick module DLL export interface\" )\n#    endif\n#  else\n#    define ModuleExport\n#    if defined(_VISUALC_)\n#      pragma message( \"Magick module static interface\" )\n#    endif\n#  endif\n#  define MagickGlobal __declspec(thread)\n#  if defined(_VISUALC_)\n#    pragma warning(disable : 4018)\n#    pragma warning(disable : 4244)\n#    pragma warning(disable : 4244)\n#    pragma warning(disable : 4275) /* non dll-interface class 'foo' used as base for dll-interface class 'bar' */\n#    pragma warning(disable : 4800)\n#    pragma warning(disable : 4786)\n#    pragma warning(disable : 4996) /* function deprecation warnings */\n#  endif\n#else\n#  define MagickExport\n#  define ModuleExport\n#  define MagickGlobal\n#endif\n\n/*\n  This size is the default minimum string allocation size (heap or\n  stack) for a C string in GraphicsMagick.  The weird size is claimed\n  to be based on 2*FILENAME_MAX (not including terminating NULL) on\n  some antique system.  Linux has a FILENAME_MAX definition, but it is\n  4096 bytes.  Many OSs have path limits of 1024 bytes.\n\n  The FormatString() function assumes that the buffer it is writing to\n  has at least this many bytes remaining.\n*/\n#if !defined(MaxTextExtent)\n#  define MaxTextExtent  2053\n#endif\n\n#define MagickSignature  0xabacadabUL\n\n#define MagickPassFail unsigned int\n#define MagickPass     1\n#define MagickFail     0\n\n#define MagickBool     unsigned int\n#define MagickTrue     1\n#define MagickFalse    0\n\n/*\n  Support for __attribute__ was added in GCC 2.0.  It is not supported\n  in strict ANSI mode which is indicated by __STRICT_ANSI__ being\n  defined.\n\n  http://www.ohse.de/uwe/articles/gcc-attributes.html\n\n  Note that GCC 3.2 on MinGW does not define __GNUC__ or __GNUC_MINOR__.\n\n  Clang/llvm and GCC 5.0 support __has_attribute(attribute) to test if an\n  attribute is supported.  Clang/llvm supports __has_builtin(builtin) to test\n  if a builtin is supported.  Clang/llvm attempts to support most GCC\n  features.\n\n   __SANITIZE_ADDRESS__ is defined by GCC and Clang if -fsanitize=address is\n   supplied.\n\n   After incuding valgrind/memcheck.h or valgrind/valgrind.h, the macro\n   RUNNING_ON_VALGRIND can be used to test if the program is run under valgrind.\n   See http://valgrind.org/docs/manual/manual-core-adv.html.\n\n*/\n#if !defined(MAGICK_ATTRIBUTE)\n#  if ((!defined(__clang__)) && (!defined(__GNUC__) || (__GNUC__ < 2 || __STRICT_ANSI__)))\n#    define MAGICK_ATTRIBUTE(x) /*nothing*/\n#  else\n#    define MAGICK_ATTRIBUTE(x) __attribute__(x)\n#    if ((defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 5)) && !defined(__COVERITY__))\n#      define MAGICK_HAS_ATTRIBUTE(attribute) __has_attribute(attribute)\n#    else\n#      define MAGICK_HAS_ATTRIBUTE(attribute) (0)\n#    endif\n#    if (defined(__clang__) && !defined(__COVERITY__))\n#      define MAGICK_CLANG_HAS_BUILTIN(builtin) __has_builtin(builtin)\n#    else\n#      define MAGICK_CLANG_HAS_BUILTIN(builtin) (0)\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__deprecated__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))) /* 3.1+ */\n#      define MAGICK_FUNC_DEPRECATED MAGICK_ATTRIBUTE((__deprecated__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__malloc__)) || \\\n         (__GNUC__ >= 3))  /* 3.0+ */\n#      define MAGICK_FUNC_MALLOC MAGICK_ATTRIBUTE((__malloc__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__nonnull__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))))  /* 3.3+ */\n  /* Supports argument syntax like MAGICK_ATTRIBUTE((nonnull (1, 2))) but\n     don't know how to support non-GCC fallback. */\n#      define MAGICK_FUNC_NONNULL MAGICK_ATTRIBUTE((__nonnull__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__noreturn__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))) /* 2.5+ */\n#      define MAGICK_FUNC_NORETURN MAGICK_ATTRIBUTE((__noreturn__))\n#    endif\n  /* clang 3.0 seems to have difficulties with __has_attribute(__const__) but\n     clang 3.3 does not.  Just assume that it is supported for clang since\n     Linux headers are riddled with it. */\n#    if (defined(__clang__) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))) /* 2.5+ */\n#      define MAGICK_FUNC_CONST MAGICK_ATTRIBUTE((__const__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__pure__)) || \\\n         ((__GNUC__) >= 3)) /* 2.96+ */\n#      define MAGICK_FUNC_PURE MAGICK_ATTRIBUTE((__pure__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__unused__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))) /* 2.7+ */\n#      define MAGICK_FUNC_UNUSED MAGICK_ATTRIBUTE((__unused__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__warn_unused_result__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))))  /* 3.3+ */\n#      define MAGICK_FUNC_WARN_UNUSED_RESULT MAGICK_ATTRIBUTE((__warn_unused_result__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__noinline__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))  /* 3.4+ */\n#      define MAGICK_FUNC_NOINLINE MAGICK_ATTRIBUTE((__noinline__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__always_inline__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))  /* 3.4+ */\n#      define MAGICK_FUNC_ALWAYSINLINE MAGICK_ATTRIBUTE((__always_inline__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__alloc_size__)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))  /* 4.3+ */\n#      define MAGICK_FUNC_ALLOC_SIZE_1ARG(arg_num) MAGICK_ATTRIBUTE((__alloc_size__(arg_num)))\n#      define MAGICK_FUNC_ALLOC_SIZE_2ARG(arg_num1,arg_num2) MAGICK_ATTRIBUTE((__alloc_size__(arg_num1,arg_num2)))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__hot__)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))  /* 4.3+ */\n#      define MAGICK_FUNC_HOT MAGICK_ATTRIBUTE((__hot__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__cold__)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))  /* 4.3+ */\n#      define MAGICK_FUNC_COLD MAGICK_ATTRIBUTE((__cold__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__optimize__)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))  /* 4.3+ */\n#      define MAGICK_OPTIMIZE_FUNC(opt) MAGICK_ATTRIBUTE((__optimize__ (opt)))\n#    endif\n  /*\n    GCC 7 and later support a fallthrough attribute to mark switch statement\n    cases which are intended to fall through.  Clang 3.5.0 supports a\n    clang::fallthrough statement attribute while Clang 10 supports the same\n    attribute as GCC 7.  Some compilers support a FALLTHROUGH (or FALLTHRU)\n    pre-processor comment.  C++ 17 supports a standard fallthrough attribute\n    of the form \"[[fallthrough]]\".  See\n    https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/,\n    https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html,\n    https://clang.llvm.org/docs/AttributeReference.html#fallthrough, and\n    https://releases.llvm.org/3.7.0/tools/clang/docs/AttributeReference.html#fallthrough-clang-fallthrough\n\n    Usage is to put \"MAGICK_FALLTHROUGH;\" where a \"break;\" would go.\n  */\n#    if ((MAGICK_HAS_ATTRIBUTE(__fallthrough__)) || \\\n         ((__GNUC__) >= 7))  /* 7+ */\n#      define MAGICK_FALLTHROUGH MAGICK_ATTRIBUTE((__fallthrough__))\n#    endif\n  /*\n    https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer#Introduction\n\n    To ignore certain functions, one can use the no_sanitize_address attribute\n    supported by Clang (3.3+) and GCC (4.8+).\n  */\n#    if ((MAGICK_HAS_ATTRIBUTE(__no_sanitize_address__)) ||       \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 0))))  /* 4.8+ */\n#      define MAGICK_NO_SANITIZE_ADDRESS MAGICK_ATTRIBUTE((__no_sanitize_address__))\n#    endif\n#    if ((MAGICK_CLANG_HAS_BUILTIN(__builtin_assume_aligned)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))))  /* 4.7+ */\n#      define MAGICK_ASSUME_ALIGNED(exp,align) __builtin_assume_aligned(exp,align)\n#    endif\n#    if ((MAGICK_CLANG_HAS_BUILTIN(__builtin_assume_aligned)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))))  /* 4.7+ */\n#      define MAGICK_ASSUME_ALIGNED_OFFSET(exp,align,offset) __builtin_assume_aligned(exp,align,offset)\n#    endif\n#  endif\n#endif\n#if !defined(MAGICK_FUNC_DEPRECATED)\n#  define MAGICK_FUNC_DEPRECATED /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_MALLOC)\n#  define MAGICK_FUNC_MALLOC /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_NONNULL)\n#  define MAGICK_FUNC_NONNULL /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_NORETURN)\n#  define MAGICK_FUNC_NORETURN /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_CONST)\n#  define MAGICK_FUNC_CONST /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_PURE)\n#  define MAGICK_FUNC_PURE /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_UNUSED)\n#  define MAGICK_FUNC_UNUSED /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_WARN_UNUSED_RESULT)\n#  define MAGICK_FUNC_WARN_UNUSED_RESULT /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_NOINLINE)\n#  define MAGICK_FUNC_NOINLINE /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_ALWAYSINLINE)\n#  define MAGICK_FUNC_ALWAYSINLINE /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_ALLOC_SIZE_1ARG)\n#  define MAGICK_FUNC_ALLOC_SIZE_1ARG(arg_num) /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_ALLOC_SIZE_2ARG)\n#  define MAGICK_FUNC_ALLOC_SIZE_2ARG(arg_num1,arg_num2) /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_HOT)\n#  define MAGICK_FUNC_HOT  /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_COLD)\n#  define MAGICK_FUNC_COLD  /*nothing*/\n#endif\n#if !defined(MAGICK_OPTIMIZE_FUNC)\n#  define MAGICK_OPTIMIZE_FUNC(opt) /*nothing*/\n#endif\n#if !defined(MAGICK_FALLTHROUGH)\n#  define MAGICK_FALLTHROUGH /*nothing*/\n#endif\n#if !defined(MAGICK_ASSUME_ALIGNED)\n#  define MAGICK_ASSUME_ALIGNED(exp,align) (exp)\n#endif\n#if !defined(MAGICK_ASSUME_ALIGNED_OFFSET)\n#  define MAGICK_ASSUME_ALIGNED_OFFSET(exp,align,offset) (exp)\n#endif\n\n  /*\n    The isnan and isinf macros are defined by c99 but might not always be\n    available.  If they (or a substitute) are not available, then define them\n    to a false value.\n  */\n#if defined(isnan)\n#define MAGICK_ISNAN(d) isnan(d)\n#else\n#define MAGICK_ISNAN(d) (0)\n#endif\n#if defined(isinf)\n#define MAGICK_ISINF(d) isinf(d)\n#else\n#define MAGICK_ISINF(d) (0)\n#endif\n#if defined(isnormal)\n#define MAGICK_ISNORMAL(d) isnormal(d)\n#else\n#define MAGICK_ISNORMAL(d) (1)\n#endif\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_COMMON_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/compare.h",
    "content": "/*\n  Copyright (C) 2008 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Comparison Methods.\n*/\n#ifndef _MAGICK_COMPARE_H\n#define _MAGICK_COMPARE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Pixel differencing algorithms.\n*/\ntypedef enum\n{\n  UndefinedHighlightStyle,\n  AssignHighlightStyle,\n  ThresholdHighlightStyle,\n  TintHighlightStyle,\n  XorHighlightStyle\n} HighlightStyle;\n\ntypedef struct _DifferenceImageOptions\n{\n  ChannelType              channel; /* Channel(s) to difference */\n  HighlightStyle           highlight_style; /* Pixel annotation style */\n  PixelPacket              highlight_color; /* Changed pixel highlight color */\n} DifferenceImageOptions;\n\nextern MagickExport void\n  InitializeDifferenceImageOptions(DifferenceImageOptions *options,\n                                   ExceptionInfo *exception);\n\nextern MagickExport Image\n  *DifferenceImage(const Image *reference_image,const Image *compare_image,\n                   const DifferenceImageOptions *difference_options,\n                   ExceptionInfo *exception);\n\n/*\n  Pixel error metrics.\n*/\ntypedef enum\n{\n  UndefinedMetric,\n  MeanAbsoluteErrorMetric,\n  MeanSquaredErrorMetric,\n  PeakAbsoluteErrorMetric,\n  PeakSignalToNoiseRatioMetric,\n  RootMeanSquaredErrorMetric\n} MetricType;\n\n/*\n  Pixel difference statistics.\n*/\ntypedef struct _DifferenceStatistics\n{\n  double\n    red,\n    green,\n    blue,\n    opacity,\n    combined;\n} DifferenceStatistics;\n\nextern MagickExport void\n  InitializeDifferenceStatistics(DifferenceStatistics *difference_statistics,\n                                 ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  GetImageChannelDifference(const Image *reference_image,\n                            const Image *compare_image,\n                            const MetricType metric,\n                            DifferenceStatistics *statistics,\n                            ExceptionInfo *exception),\n  GetImageChannelDistortion(const Image *reference_image,\n                            const Image *compare_image,\n                            const ChannelType channel,\n                            const MetricType metric,\n                            double *distortion,\n                            ExceptionInfo *exception),\n  GetImageDistortion(const Image *reference_image,\n                     const Image *compare_image,\n                     const MetricType metric,\n                     double *distortion,\n                     ExceptionInfo *exception);\n\nextern MagickExport MagickBool\n  IsImagesEqual(Image *,const Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_COMPARE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/composite.h",
    "content": "/*\n  Copyright (C) 2003 - 2010 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Composite Methods.\n*/\n#ifndef _MAGICK_COMPOSITE_H\n#define _MAGICK_COMPOSITE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Special options required by some composition operators.\n*/\ntypedef struct _CompositeOptions_t\n{\n  /* ModulateComposite */\n  double            percent_brightness;\n\n  /* ThresholdComposite */\n  double            amount;\n  double            threshold;\n} CompositeOptions_t;\n\nextern MagickExport MagickPassFail\n  CompositeImage(Image *canvas_image,const CompositeOperator compose,\n                 const Image *update_image,\n                 const long x_offset,const long y_offset),\n  CompositeImageRegion(const CompositeOperator compose,\n                       const CompositeOptions_t *options,\n                       const unsigned long columns,\n                       const unsigned long rows,\n                       const Image *update_image,\n                       const long update_x,\n                       const long update_y,\n                       Image *canvas_image,\n                       const long canvas_x,\n                       const long canvas_y,\n                       ExceptionInfo *exception),\n  MagickCompositeImageUnderColor(Image *image,const PixelPacket *undercolor,\n                                 ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_COMPOSITE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/compress.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Image Compression/Decompression Methods.\n*/\n#ifndef _MAGICK_COMPRESS_H\n#define _MAGICK_COMPRESS_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Typedef declaration.\n*/\ntypedef struct _Ascii85Info\n{\n  long\n    offset,\n    line_break;\n\n  magick_uint8_t\n    buffer[10];\n} Ascii85Info;\n\n/*\n  TODO: Clean up the interface between BLOB write functions,\n  compression functions, and encoding functions so they\n  may be hooked into/stacked on top of each other. Most are\n  (or can be changed to be) stream based.\n*/\ntypedef unsigned int\n  (*WriteByteHook)(Image *, const magick_uint8_t, void *info);\n\n/*\n  Commonly used byte writer hooks.\n*/\nextern MagickExport unsigned int\n  Ascii85WriteByteHook(Image *image, const magick_uint8_t code, void *info),\n  BlobWriteByteHook(Image *image, const magick_uint8_t code, void *info);\n\n/*\n  Compress methods.\n*/\nextern MagickExport MagickPassFail\n  HuffmanDecodeImage(Image *image),\n  HuffmanEncodeImage(const ImageInfo *image_info,Image *image),\n  HuffmanEncode2Image(const ImageInfo *image_info,Image *image,WriteByteHook write_byte,void *info),\n  LZWEncodeImage(Image *image,const size_t length,magick_uint8_t *pixels),\n  LZWEncode2Image(Image *image,const size_t length,magick_uint8_t *pixels,WriteByteHook write_byte,void *info),\n  PackbitsEncodeImage(Image *image,const size_t length,magick_uint8_t *pixels),\n  PackbitsEncode2Image(Image *image,const size_t length,magick_uint8_t *pixels,WriteByteHook write_byte,void *info);\n\nextern MagickExport unsigned char\n  *ImageToHuffman2DBlob(const Image *image,const ImageInfo *image_info,\n     size_t *length,ExceptionInfo *exception),\n  *ImageToJPEGBlob(const Image *image,const ImageInfo *image_info,\n     size_t *length,ExceptionInfo *exception);\n\nextern MagickExport void\n  Ascii85Encode(Image *image,const magick_uint8_t code),\n  Ascii85Flush(Image *image),\n  Ascii85Initialize(Image *image);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/confirm_access.h",
    "content": "/*\n  Copyright (C) 2009 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Access Confirmation Methods.\n*/\n#ifndef _MAGICK_CONFIRM_ACCESS_H\n#define _MAGICK_CONFIRM_ACCESS_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  typedef enum\n    {\n      UndefinedConfirmAccessMode,\n      FileExecuteConfirmAccessMode, /* Path is to be opened for execution */\n      FileReadConfirmAccessMode,    /* Path is to be opened for read */\n      FileWriteConfirmAccessMode,   /* Path is to be opened for write */\n      URLGetFTPConfirmAccessMode,   /* ftp:// URL get */\n      URLGetFileConfirmAccessMode,  /* file:// URL get */\n      URLGetHTTPConfirmAccessMode   /* http:// URL get */\n    } ConfirmAccessMode;\n\n  typedef MagickPassFail\n  (*ConfirmAccessHandler)(const ConfirmAccessMode mode,\n                          const char *path,\n                          ExceptionInfo *exception);\n\n  extern MagickExport MagickPassFail\n  MagickConfirmAccess(const ConfirmAccessMode mode,\n                      const char *path,\n                      ExceptionInfo *exception);\n\n  extern MagickExport ConfirmAccessHandler\n  MagickSetConfirmAccessHandler(ConfirmAccessHandler handler);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_CONFIRM_ACCESS_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/constitute.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Constitute Methods.\n*/\n#ifndef _MAGICK_CONSTITUTE_H\n#define _MAGICK_CONSTITUTE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Quantum import/export types as used by ImportImagePixelArea() and\n  ExportImagePixelArea(). Values are imported or exported in network\n  byte order (\"big endian\") by default, but little endian may be\n  selected via the 'endian' option in ExportPixelAreaOptions and\n  ImportPixelAreaOptions.\n*/\ntypedef enum\n{\n  UndefinedQuantum,  /* Not specified */\n  IndexQuantum,      /* Colormap indexes */\n  GrayQuantum,       /* Grayscale values (minimum value is black) */\n  IndexAlphaQuantum, /* Colormap indexes with transparency */\n  GrayAlphaQuantum,  /* Grayscale values with transparency */\n  RedQuantum,        /* Red values only (RGBA) */\n  CyanQuantum,       /* Cyan values only (CMYKA) */\n  GreenQuantum,      /* Green values only (RGBA) */\n  YellowQuantum,     /* Yellow values only (CMYKA) */\n  BlueQuantum,       /* Blue values only (RGBA) */\n  MagentaQuantum,    /* Magenta values only (CMYKA) */\n  AlphaQuantum,      /* Transparency values (RGBA or CMYKA) */\n  BlackQuantum,      /* Black values only (CMYKA) */\n  RGBQuantum,        /* Red, green, and blue values */\n  RGBAQuantum,       /* Red, green, blue, and transparency values */\n  CMYKQuantum,       /* Cyan, magenta, yellow, and black values */\n  CMYKAQuantum,      /* Cyan, magenta, yellow, black, and transparency values */\n  CIEYQuantum,       /* CIE Y values, based on CCIR-709 primaries */\n  CIEXYZQuantum      /* CIE XYZ values, based on CCIR-709 primaries */\n} QuantumType;\n\n/*\n  Quantum sample type for when exporting/importing a pixel area.\n*/\ntypedef enum\n{\n  UndefinedQuantumSampleType, /* Not specified */\n  UnsignedQuantumSampleType,  /* Unsigned integral type (1-32 or 64 bits) */\n  FloatQuantumSampleType      /* Floating point type (16, 24, 32, or 64 bit) */\n} QuantumSampleType;\n\n/*\n  Quantum size types as used by ConstituteImage() and DispatchImage()/\n*/\ntypedef enum\n{\n  CharPixel,         /* Unsigned 8 bit 'unsigned char' */\n  ShortPixel,        /* Unsigned 16 bit 'unsigned short int' */\n  IntegerPixel,      /* Unsigned 32 bit 'unsigned int' */\n  LongPixel,         /* Unsigned 32 or 64 bit (CPU dependent) 'unsigned long' */\n  FloatPixel,        /* Floating point 32-bit 'float' */\n  DoublePixel        /* Floating point 64-bit 'double' */\n} StorageType;\n\n/*\n  Additional options for ExportImagePixelArea()\n*/\ntypedef struct _ExportPixelAreaOptions\n{\n  QuantumSampleType\n    sample_type;          /* Quantum sample type */\n\n  double\n    double_minvalue,      /* Minimum value (default 0.0) for linear floating point samples */\n    double_maxvalue;      /* Maximum value (default 1.0) for linear floating point samples */\n\n  MagickBool\n    grayscale_miniswhite; /* Grayscale minimum value is white rather than black */\n\n  unsigned long\n    pad_bytes;            /* Number of pad bytes to output after pixel data */\n\n  unsigned char\n    pad_value;            /* Value to use when padding end of pixel data */\n\n  EndianType\n    endian;               /* Endian orientation for 16/32/64 bit types (default MSBEndian) */\n\n  unsigned long\n    signature;\n} ExportPixelAreaOptions;\n\n/*\n  Optional results info for ExportImagePixelArea()\n*/\ntypedef struct _ExportPixelAreaInfo\n{\n  size_t\n    bytes_exported;       /* Number of bytes which were exported */\n\n} ExportPixelAreaInfo;\n\n/*\n  Additional options for ImportImagePixelArea()\n*/\ntypedef struct _ImportPixelAreaOptions\n{\n  QuantumSampleType\n    sample_type;          /* Quantum sample type */\n\n  double\n    double_minvalue,      /* Minimum value (default 0.0) for linear floating point samples */\n    double_maxvalue;      /* Maximum value (default 1.0) for linear floating point samples */\n\n  MagickBool\n    grayscale_miniswhite; /* Grayscale minimum value is white rather than black */\n\n  EndianType\n    endian;               /* Endian orientation for 16/32/64 bit types (default MSBEndian) */\n\n  unsigned long\n    signature;\n} ImportPixelAreaOptions;\n\n/*\n  Optional results info for ImportImagePixelArea()\n*/\ntypedef struct _ImportPixelAreaInfo\n{\n  size_t\n    bytes_imported;       /* Number of bytes which were imported */\n\n} ImportPixelAreaInfo;\n\nextern MagickExport const char\n  *StorageTypeToString(const StorageType storage_type),\n  *QuantumSampleTypeToString(const QuantumSampleType sample_type),\n  *QuantumTypeToString(const QuantumType quantum_type);\n\nextern MagickExport Image\n  *ConstituteImage(const unsigned long width,const unsigned long height,\n     const char *map,const StorageType type,const void *pixels,\n     ExceptionInfo *exception),\n  *ConstituteTextureImage(const unsigned long columns,const unsigned long rows,\n     const Image *texture,ExceptionInfo *exception),\n  *PingImage(const ImageInfo *image_info,ExceptionInfo *exception),\n  *ReadImage(const ImageInfo *image_info,ExceptionInfo *exception),\n  *ReadInlineImage(const ImageInfo *image_info,const char *content,\n     ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  DispatchImage(const Image *image,const long x_offset,const long y_offset,\n    const unsigned long columns,const unsigned long rows,const char *map,\n    const StorageType type,void *pixels,ExceptionInfo *exception),\n  ExportImagePixelArea(const Image *image,const QuantumType quantum_type,\n    const unsigned int quantum_size,unsigned char *destination,\n    const ExportPixelAreaOptions *options,ExportPixelAreaInfo *export_info),\n  ExportViewPixelArea(const ViewInfo *view,const QuantumType quantum_type,\n    const unsigned int quantum_size,unsigned char *destination,\n    const ExportPixelAreaOptions *options,ExportPixelAreaInfo *export_info);\n\nextern MagickExport MagickPassFail\n  ImportImagePixelArea(Image *image,const QuantumType quantum_type,\n    const unsigned int quantum_size,const unsigned char *source,\n    const ImportPixelAreaOptions *options,ImportPixelAreaInfo *import_info),\n  ImportViewPixelArea(ViewInfo *view,const QuantumType quantum_type,\n    const unsigned int quantum_size,const unsigned char *source,\n    const ImportPixelAreaOptions *options,ImportPixelAreaInfo *import_info),\n  WriteImage(const ImageInfo *image_info,Image *image),\n  WriteImages(const ImageInfo *image_info,Image *image,const char *filename,\n    ExceptionInfo *exception),\n  WriteImagesFile(const ImageInfo *image_info,Image *image,FILE * file,\n    ExceptionInfo *exception);\n\nextern MagickExport void\n  ExportPixelAreaOptionsInit(ExportPixelAreaOptions *options),\n  ImportPixelAreaOptionsInit(ImportPixelAreaOptions *options);\n\nextern MagickExport MagickPassFail\n  MagickFindRawImageMinMax(Image *image, EndianType endian,\n    unsigned long width, unsigned long height,StorageType type,\n    unsigned scanline_octets, void *scanline_buffer,\n    double *min, double *max);\n\nextern MagickExport unsigned int\n  MagickGetQuantumSamplesPerPixel(const QuantumType quantum_type) MAGICK_FUNC_CONST;\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/constitute-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_CONSTITUTE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/decorate.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Decorate Methods.\n*/\n#ifndef _MAGICK_DECORATE_H\n#define _MAGICK_DECORATE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *BorderImage(const Image *,const RectangleInfo *,ExceptionInfo *),\n  *FrameImage(const Image *,const FrameInfo *,ExceptionInfo *);\n\nMagickExport unsigned int\n  RaiseImage(Image *,const RectangleInfo *,const int);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_DECORATE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/delegate.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Methods to Read/Write/Invoke Delegates.\n*/\n#ifndef _MAGICK_DELEGATE_H\n#define _MAGICK_DELEGATE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Delegate structure definitions.\n*/\ntypedef struct _DelegateInfo\n{\n  char\n    *path,    /* Path to delegate configuation file */\n    *decode,  /* Decode from format */\n    *encode;  /* Transcode to format */\n\n  char\n    *commands; /* Commands to execute */\n\n  int mode;    /* <0 = encoder, >0 = decoder */\n\n  MagickBool\n    stealth;   /* Don't list this delegate */\n\n  unsigned long\n    signature;\n\n  struct _DelegateInfo\n    *previous,\n    *next;\n} DelegateInfo;\n\n/*\n  Magick delegate methods.\n*/\nextern MagickExport char\n  *GetDelegateCommand(const ImageInfo *image_info,Image *image,\n                      const char *decode,const char *encode,\n                      ExceptionInfo *exception);\n\nextern MagickExport const DelegateInfo\n  *GetDelegateInfo(const char *decode,const char *encode,\n                   ExceptionInfo *exception),\n  *GetPostscriptDelegateInfo(const ImageInfo *image_info,\n                   unsigned int *antialias, ExceptionInfo *exception);\n\nextern MagickExport DelegateInfo\n  *SetDelegateInfo(DelegateInfo *);\n\nextern MagickExport MagickPassFail\n  InvokePostscriptDelegate(const unsigned int verbose,const char *command,\n                           ExceptionInfo *exception),\n  InvokeDelegate(ImageInfo *image_info,Image *image,const char *decode,\n                 const char *encode,ExceptionInfo *exception),\n  ListDelegateInfo(FILE *file,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n\n#if defined(HasGS)\n#include \"ghostscript/iapi.h\"\n#endif\n\n#ifndef gs_main_instance_DEFINED\n# define gs_main_instance_DEFINED\ntypedef struct gs_main_instance_s gs_main_instance;\n#endif\n\n#if !defined(MagickDLLCall)\n#  if defined(MSWINDOWS)\n#    define MagickDLLCall __stdcall\n#  else\n#    define MagickDLLCall\n#  endif\n#endif\n\n/*\n  Define a vector of Ghostscript library callback functions so that\n  DLL/shared and static Ghostscript libbraries may be handled identically.\n  These definitions must be compatible with those in the Ghostscript API\n  headers (which we don't require).\n\n  http://pages.cs.wisc.edu/~ghost/doc/cvs/API.htm\n  */\ntypedef struct _GhostscriptVectors\n{\n  /* Exit the interpreter (gsapi_exit)*/\n  int  (MagickDLLCall *exit)(gs_main_instance *instance);\n\n  /* Destroy instance of Ghostscript.  Call exit first! (gsapi_delete_instance) */\n  void (MagickDLLCall *delete_instance)(gs_main_instance *instance);\n\n  /* Initialize the Ghostscript interpreter (gsapi_init_with_args) */\n  int  (MagickDLLCall *init_with_args)(gs_main_instance *instance,int argc,\n                                       char **argv);\n\n  /* Create a new instance of the Ghostscript interpreter (gsapi_new_instance) */\n  int  (MagickDLLCall *new_instance)(gs_main_instance **pinstance,\n                                     void *caller_handle);\n\n  /* Execute string command in Ghostscript interpreter (gsapi_run_string) */\n  int  (MagickDLLCall *run_string)(gs_main_instance *instance,const char *str,\n                                   int user_errors,int *pexit_code);\n} GhostscriptVectors;\n\nextern MagickExport void\n  DestroyDelegateInfo(void);\n\nextern MagickPassFail\n  InitializeDelegateInfo(void);\n\n#endif /* MAGICK_IMPLEMENTATION */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_DELEGATE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/deprecate.h",
    "content": "/*\n  Copyright (C) 2003, 2008 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Log methods.\n*/\n#ifndef _MAGICK_DEPRECATE_H\n#define _MAGICK_DEPRECATE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Legacy names for (possibly) large integral types\n  */\n\n#if !defined(ExtendedSignedIntegralType)\n#  define ExtendedSignedIntegralType magick_int64_t\n#endif\n#if !defined(ExtendedUnsignedIntegralType)\n#  define ExtendedUnsignedIntegralType magick_uint64_t\n#endif\n\n  /*\n    Compatibility definitions to handle the renaming of\n    ExtendedSignedIntegralType and ExtendedUnsignedIntegralType to\n    MagickSignedType and MagickUnsignedType which occured in ImageMagick\n    5.5.8.  ImageMagick 5.5.8 also introduced MagickRationalType.\n  */\n#if !defined(MagickSignedType)\n#  define MagickSignedType magick_int64_t\n#endif\n#if !defined(MagickUnsignedType)\n#  define MagickUnsignedType magick_uint64_t\n#endif\n#if !defined(MagickRationalType)\n#  if defined(HAVE_LONG_DOUBLE)\n#    define MagickRationalType long double\n#  else\n#    define MagickRationalType double\n#  endif\n#endif\n\n  extern MagickExport unsigned int\n  PopImagePixels(const Image *,const QuantumType,unsigned char *) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport unsigned int\n  PushImagePixels(Image *,const QuantumType,const unsigned char *) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport void\n  *AcquireMemory(const size_t) MAGICK_FUNC_DEPRECATED MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(1);\n\n  extern MagickExport void\n  *CloneMemory(void *,const void *,const size_t) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport void\n  LiberateMemory(void **) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport void\n  ReacquireMemory(void **,const size_t) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport const PixelPacket\n  *AcquireCacheView(ViewInfo *view,\n                    const long x,const long y,const unsigned long columns,\n                    const unsigned long rows,ExceptionInfo *exception) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport PixelPacket\n  *GetCacheView(ViewInfo *view,const long x,const long y,\n                const unsigned long columns,const unsigned long rows)  MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport PixelPacket\n  *SetCacheView(ViewInfo *view,const long x,const long y,\n                const unsigned long columns,const unsigned long rows) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport MagickPassFail\n  SyncCacheView(ViewInfo *view) MAGICK_FUNC_DEPRECATED;\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/describe.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Describe Methods.\n*/\n#ifndef _MAGICK_DESCRIBE_H\n#define _MAGICK_DESCRIBE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\nextern MagickExport MagickPassFail\n  DescribeImage(Image *image,FILE *file,const MagickBool verbose);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_DESCRIBE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/draw.h",
    "content": "/*\n  Copyright (C) 2003-2018 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Drawing API.\n\n  Usage synopsis:\n\n  DrawContext context;\n  context = DrawAllocateContext((DrawInfo*)NULL, image);\n    [ any number of drawing commands ]\n    DrawSetStrokeColorString(context,\"black\");\n    DrawSetFillColorString(context,\"#ff00ff\");\n    DrawSetStrokeWidth(context,4);\n    DrawRectangle(context,72,72,144,144);\n  DrawRender(context);\n  DrawDestroyContext(context);\n\n*/\n#ifndef _MAGICK_DRAW_H\n#define _MAGICK_DRAW_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/render.h\"\n\n\ntypedef struct _DrawContext *DrawContext;\n\nextern MagickExport ClipPathUnits\n  DrawGetClipUnits(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport DrawInfo\n  *DrawPeekGraphicContext(const DrawContext context);\n\nextern MagickExport DecorationType\n  DrawGetTextDecoration(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport DrawContext\n  DrawAllocateContext(const DrawInfo *draw_info, Image *image);\n\nextern MagickExport FillRule\n  DrawGetClipRule(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetFillRule(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport GravityType\n  DrawGetGravity(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport LineCap\n  DrawGetStrokeLineCap(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport LineJoin\n  DrawGetStrokeLineJoin(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport PixelPacket\n  DrawGetFillColor(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetStrokeColor(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetTextUnderColor(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport StretchType\n  DrawGetFontStretch(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport StyleType\n  DrawGetFontStyle(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport char\n  *DrawGetClipPath(DrawContext context),\n  *DrawGetFont(DrawContext context),\n  *DrawGetFontFamily(DrawContext context),\n  *DrawGetTextEncoding(DrawContext context);\n\nextern MagickExport int\n  DrawRender(const DrawContext context);\n\nextern MagickExport unsigned int\n  DrawGetStrokeAntialias(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetTextAntialias(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport unsigned long\n  DrawGetFontWeight(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetStrokeMiterLimit(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport double\n  DrawGetFillOpacity(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetFontSize(DrawContext context) MAGICK_FUNC_PURE,\n  *DrawGetStrokeDashArray(DrawContext context, unsigned long *num_elems),\n  DrawGetStrokeDashOffset(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetStrokeOpacity(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetStrokeWidth(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport void\n  DrawAffine(DrawContext context, const AffineMatrix *affine),\n  DrawAnnotation(DrawContext context,\n    const double x, const double y,\n    const unsigned char *text),\n  DrawArc(DrawContext context,\n          const double sx, const double sy,\n          const double ex, const double ey,\n          const double sd, const double ed),\n  DrawBezier(DrawContext context,\n             const unsigned long num_coords, const PointInfo * coordinates),\n  DrawCircle(DrawContext context,\n             const double ox, const double oy,\n             const double px, const double py),\n  DrawColor(DrawContext context,\n            const double x, const double y,\n            const PaintMethod paintMethod),\n  DrawComment(DrawContext context,const char* comment),\n  DrawDestroyContext(DrawContext context),\n  DrawEllipse(DrawContext context,\n              const double ox, const double oy,\n              const double rx, const double ry,\n              const double start, const double end),\n  DrawComposite(DrawContext context,\n                const CompositeOperator composite_operator,\n                const double x, const double y,\n                const double width, const double height,\n                const Image * image ),\n  DrawLine(DrawContext context,\n           const double sx, const double sy,\n           const double ex, const double ey),\n  DrawMatte(DrawContext context,\n            const double x, const double y,\n            const PaintMethod paint_method),\n  DrawPathClose(DrawContext context),\n  DrawPathCurveToAbsolute(DrawContext context,\n                          const double x1, const double y1,\n                          const double x2, const double y2,\n                          const double x, const double y),\n  DrawPathCurveToRelative(DrawContext context,\n                          const double x1, const double y1,\n                          const double x2, const double y2,\n                          const double x, const double y),\n  DrawPathCurveToQuadraticBezierAbsolute(DrawContext context,\n                                         const double x1, const double y1,\n                                         const double x, const double y),\n  DrawPathCurveToQuadraticBezierRelative(DrawContext context,\n                                         const double x1, const double y1,\n                                         const double x, const double y),\n  DrawPathCurveToQuadraticBezierSmoothAbsolute(DrawContext context,\n                                               const double x, const double y),\n  DrawPathCurveToQuadraticBezierSmoothRelative(DrawContext context,\n                                               const double x, const double y),\n  DrawPathCurveToSmoothAbsolute(DrawContext context,\n                                const double x2, const double y2,\n                                const double x, const double y),\n  DrawPathCurveToSmoothRelative(DrawContext context,\n                                const double x2, const double y2,\n                                const double x, const double y),\n  DrawPathEllipticArcAbsolute(DrawContext context,\n                              const double rx, const double ry,\n                              const double x_axis_rotation,\n                              unsigned int large_arc_flag,\n                              unsigned int sweep_flag,\n                              const double x, const double y),\n  DrawPathEllipticArcRelative(DrawContext context,\n                              const double rx, const double ry,\n                              const double x_axis_rotation,\n                              unsigned int large_arc_flag,\n                              unsigned int sweep_flag,\n                              const double x, const double y),\n  DrawPathFinish(DrawContext context),\n  DrawPathLineToAbsolute(DrawContext context,\n                         const double x, const double y),\n  DrawPathLineToRelative(DrawContext context,\n                         const double x, const double y),\n  DrawPathLineToHorizontalAbsolute(DrawContext context, const double x),\n  DrawPathLineToHorizontalRelative(DrawContext context, const double x),\n  DrawPathLineToVerticalAbsolute(DrawContext context, const double y),\n  DrawPathLineToVerticalRelative(DrawContext context, const double y),\n  DrawPathMoveToAbsolute(DrawContext context,\n                         const double x, const double y),\n  DrawPathMoveToRelative(DrawContext context,\n                         const double x, const double y),\n  DrawPathStart(DrawContext context),\n  DrawPoint(DrawContext context, const double x, const double y),\n  DrawPolygon(DrawContext context,\n              const unsigned long num_coords, const PointInfo * coordinates),\n  DrawPolyline(DrawContext context,\n               const unsigned long num_coords, const PointInfo * coordinates),\n  DrawPopClipPath(DrawContext context),\n  DrawPopDefs(DrawContext context),\n  DrawPopGraphicContext(DrawContext context),\n  DrawPopPattern(DrawContext context),\n  DrawPushClipPath(DrawContext context, const char *clip_path_id),\n  DrawPushDefs(DrawContext context),\n  DrawPushGraphicContext(DrawContext context),\n  DrawPushPattern(DrawContext context,\n                  const char *pattern_id,\n                  const double x, const double y,\n                  const double width, const double height),\n  DrawRectangle(DrawContext context,\n                const double x1, const double y1,\n                const double x2, const double y2),\n  DrawRoundRectangle(DrawContext context,\n                     double x1, double y1,\n                     double x2, double y2,\n                     double rx, double ry),\n  DrawScale(DrawContext context, const double x, const double y),\n  DrawSetClipPath(DrawContext context, const char *clip_path),\n  DrawSetClipRule(DrawContext context, const FillRule fill_rule),\n  DrawSetClipUnits(DrawContext context, const ClipPathUnits clip_units),\n  DrawSetFillColor(DrawContext context, const PixelPacket *fill_color),\n  DrawSetFillColorString(DrawContext context, const char *fill_color),\n  DrawSetFillOpacity(DrawContext context, const double fill_opacity),\n  DrawSetFillRule(DrawContext context, const FillRule fill_rule),\n  DrawSetFillPatternURL(DrawContext context, const char *fill_url),\n  DrawSetFont(DrawContext context, const char *font_name),\n  DrawSetFontFamily(DrawContext context, const char *font_family),\n  DrawSetFontSize(DrawContext context, const double font_pointsize),\n  DrawSetFontStretch(DrawContext context, const StretchType font_stretch),\n  DrawSetFontStyle(DrawContext context, const StyleType font_style),\n  DrawSetFontWeight(DrawContext context, const unsigned long font_weight),\n  DrawSetGravity(DrawContext context, const GravityType gravity),\n  DrawRotate(DrawContext context, const double degrees),\n  DrawSkewX(DrawContext context, const double degrees),\n  DrawSkewY(DrawContext context, const double degrees),\n  /*\n   DrawSetStopColor(DrawContext context, const PixelPacket * color,\n                    const double offset),\n  */\n  DrawSetStrokeAntialias(DrawContext context, const unsigned int true_false),\n  DrawSetStrokeColor(DrawContext context, const PixelPacket *stroke_color),\n  DrawSetStrokeColorString(DrawContext context, const char *stroke_color),\n  DrawSetStrokeDashArray(DrawContext context, const unsigned long num_elems,\n                         const double *dasharray),\n  DrawSetStrokeDashOffset(DrawContext context,const double dashoffset),\n  DrawSetStrokeLineCap(DrawContext context, const LineCap linecap),\n  DrawSetStrokeLineJoin(DrawContext context, const LineJoin linejoin),\n  DrawSetStrokeMiterLimit(DrawContext context,const unsigned long miterlimit),\n  DrawSetStrokeOpacity(DrawContext context, const double opacity),\n  DrawSetStrokePatternURL(DrawContext context, const char* stroke_url),\n  DrawSetStrokeWidth(DrawContext context, const double width),\n  DrawSetTextAntialias(DrawContext context, const unsigned int true_false),\n  DrawSetTextDecoration(DrawContext context, const DecorationType decoration),\n  DrawSetTextEncoding(DrawContext context, const char *encoding),\n  DrawSetTextUnderColor(DrawContext context, const PixelPacket *color),\n  DrawSetTextUnderColorString(DrawContext context, const char *under_color),\n  DrawSetViewbox(DrawContext context,\n                 unsigned long x1, unsigned long y1,\n                 unsigned long x2, unsigned long y2),\n  DrawTranslate(DrawContext context, const double x, const double y);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/effect.h",
    "content": "/*\n  Copyright (C) 2003-2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Effect Methods.\n*/\n#ifndef _MAGICK_EFFECT_H\n#define _MAGICK_EFFECT_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *AdaptiveThresholdImage(const Image *,const unsigned long,const unsigned long,\n     const double,ExceptionInfo *),\n  *AddNoiseImage(const Image *,const NoiseType,ExceptionInfo *),\n  *AddNoiseImageChannel(const Image *image,const ChannelType channel,\n     const NoiseType noise_type,ExceptionInfo *exception),\n  *BlurImage(const Image *,const double,const double,ExceptionInfo *),\n  *BlurImageChannel(const Image *image,const ChannelType channel,\n     const double radius,const double sigma,ExceptionInfo *exception),\n  *ConvolveImage(const Image *,const unsigned int,const double *,\n     ExceptionInfo *),\n  *DespeckleImage(const Image *,ExceptionInfo *),\n  *EdgeImage(const Image *,const double,ExceptionInfo *),\n  *EmbossImage(const Image *,const double,const double,ExceptionInfo *),\n  *EnhanceImage(const Image *,ExceptionInfo *),\n  *GaussianBlurImage(const Image *,const double,const double,ExceptionInfo *),\n  *GaussianBlurImageChannel(const Image *image,\n     const ChannelType channel,const double radius,const double sigma,\n   ExceptionInfo *exception),\n  *MedianFilterImage(const Image *,const double,ExceptionInfo *),\n  *MotionBlurImage(const Image *,const double,const double,const double,\n     ExceptionInfo *),\n  *ReduceNoiseImage(const Image *,const double,ExceptionInfo *),\n  *ShadeImage(const Image *,const unsigned int,double,double,ExceptionInfo *),\n  *SharpenImage(const Image *,const double,const double,ExceptionInfo *),\n  *SharpenImageChannel(const Image *image,const ChannelType channel,\n     const double radius,const double sigma,ExceptionInfo *exception),\n  *SpreadImage(const Image *,const unsigned int,ExceptionInfo *),\n  *UnsharpMaskImage(const Image *,const double,const double,const double,\n                    const double,ExceptionInfo *),\n  *UnsharpMaskImageChannel(const Image *image,\n     const ChannelType channel,const double radius,const double sigma,\n     const double amount,const double threshold,\n     ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  BlackThresholdImage(Image *image,const char *thresholds),\n  ChannelThresholdImage(Image *,const char *),\n  RandomChannelThresholdImage(Image *,const char *,const char *,\n      ExceptionInfo *exception),\n  ThresholdImage(Image *,const double),\n  WhiteThresholdImage(Image *image,const char *thresholds);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_EFFECT_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/enhance.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Enhancement Methods.\n*/\n#ifndef _MAGICK_ENHANCE_H\n#define _MAGICK_ENHANCE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif  /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport MagickPassFail\n  ContrastImage(Image *,const unsigned int),\n  EqualizeImage(Image *),\n  GammaImage(Image *,const char *),\n  LevelImage(Image *,const char *),\n  LevelImageChannel(Image *,const ChannelType,const double,const double,\n    const double),\n  ModulateImage(Image *,const char *),\n  NegateImage(Image *,const unsigned int),\n  NormalizeImage(Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_ENHANCE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/error.h",
    "content": "/*\n  Copyright (C) 2003-2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Exception Methods.\n*/\n#ifndef _MAGICK_ERROR_H\n#define _MAGICK_ERROR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UndefinedExceptionBase = 0,\n  ExceptionBase = 1,\n  ResourceBase = 2,\n  ResourceLimitBase = 2,\n  TypeBase = 5,\n  AnnotateBase = 5,\n  OptionBase = 10,\n  DelegateBase = 15,\n  MissingDelegateBase = 20,\n  CorruptImageBase = 25,\n  FileOpenBase = 30,\n  BlobBase = 35,\n  StreamBase = 40,\n  CacheBase = 45,\n  CoderBase = 50,\n  ModuleBase = 55,\n  DrawBase = 60,\n  RenderBase = 60,\n  ImageBase = 65,\n  WandBase = 67,\n  TemporaryFileBase = 70,\n  TransformBase = 75,\n  XServerBase = 80,\n  X11Base = 81,\n  UserBase = 82,\n  MonitorBase = 85,\n  LocaleBase = 86,\n  DeprecateBase = 87,\n  RegistryBase = 90,\n  ConfigureBase = 95\n} ExceptionBaseType;\n\ntypedef enum\n{\n  UndefinedException = 0,\n  EventException = 100,\n  ExceptionEvent = EventException + ExceptionBase,\n  ResourceEvent = EventException + ResourceBase,\n  ResourceLimitEvent = EventException + ResourceLimitBase,\n  TypeEvent = EventException + TypeBase,\n  AnnotateEvent = EventException + AnnotateBase,\n  OptionEvent = EventException + OptionBase,\n  DelegateEvent = EventException + DelegateBase,\n  MissingDelegateEvent = EventException + MissingDelegateBase,\n  CorruptImageEvent = EventException + CorruptImageBase,\n  FileOpenEvent = EventException + FileOpenBase,\n  BlobEvent = EventException + BlobBase,\n  StreamEvent = EventException + StreamBase,\n  CacheEvent = EventException + CacheBase,\n  CoderEvent = EventException + CoderBase,\n  ModuleEvent = EventException + ModuleBase,\n  DrawEvent = EventException + DrawBase,\n  RenderEvent = EventException + RenderBase,\n  ImageEvent = EventException + ImageBase,\n  WandEvent = EventException + WandBase,\n  TemporaryFileEvent = EventException + TemporaryFileBase,\n  TransformEvent = EventException + TransformBase,\n  XServerEvent = EventException + XServerBase,\n  X11Event = EventException + X11Base,\n  UserEvent = EventException + UserBase,\n  MonitorEvent = EventException + MonitorBase,\n  LocaleEvent = EventException + LocaleBase,\n  DeprecateEvent = EventException + DeprecateBase,\n  RegistryEvent = EventException + RegistryBase,\n  ConfigureEvent = EventException + ConfigureBase,\n\n  WarningException = 300,\n  ExceptionWarning = WarningException + ExceptionBase,\n  ResourceWarning = WarningException + ResourceBase,\n  ResourceLimitWarning = WarningException + ResourceLimitBase,\n  TypeWarning = WarningException + TypeBase,\n  AnnotateWarning = WarningException + AnnotateBase,\n  OptionWarning = WarningException + OptionBase,\n  DelegateWarning = WarningException + DelegateBase,\n  MissingDelegateWarning = WarningException + MissingDelegateBase,\n  CorruptImageWarning = WarningException + CorruptImageBase,\n  FileOpenWarning = WarningException + FileOpenBase,\n  BlobWarning = WarningException + BlobBase,\n  StreamWarning = WarningException + StreamBase,\n  CacheWarning = WarningException + CacheBase,\n  CoderWarning = WarningException + CoderBase,\n  ModuleWarning = WarningException + ModuleBase,\n  DrawWarning = WarningException + DrawBase,\n  RenderWarning = WarningException + RenderBase,\n  ImageWarning = WarningException + ImageBase,\n  WandWarning = WarningException + WandBase,\n  TemporaryFileWarning = WarningException + TemporaryFileBase,\n  TransformWarning = WarningException + TransformBase,\n  XServerWarning = WarningException + XServerBase,\n  X11Warning = WarningException + X11Base,\n  UserWarning = WarningException + UserBase,\n  MonitorWarning = WarningException + MonitorBase,\n  LocaleWarning = WarningException + LocaleBase,\n  DeprecateWarning = WarningException + DeprecateBase,\n  RegistryWarning = WarningException + RegistryBase,\n  ConfigureWarning = WarningException + ConfigureBase,\n\n  ErrorException = 400,\n  ExceptionError = ErrorException + ExceptionBase,\n  ResourceError = ErrorException + ResourceBase,\n  ResourceLimitError = ErrorException + ResourceLimitBase,\n  TypeError = ErrorException + TypeBase,\n  AnnotateError = ErrorException + AnnotateBase,\n  OptionError = ErrorException + OptionBase,\n  DelegateError = ErrorException + DelegateBase,\n  MissingDelegateError = ErrorException + MissingDelegateBase,\n  CorruptImageError = ErrorException + CorruptImageBase,\n  FileOpenError = ErrorException + FileOpenBase,\n  BlobError = ErrorException + BlobBase,\n  StreamError = ErrorException + StreamBase,\n  CacheError = ErrorException + CacheBase,\n  CoderError = ErrorException + CoderBase,\n  ModuleError = ErrorException + ModuleBase,\n  DrawError = ErrorException + DrawBase,\n  RenderError = ErrorException + RenderBase,\n  ImageError = ErrorException + ImageBase,\n  WandError = ErrorException + WandBase,\n  TemporaryFileError = ErrorException + TemporaryFileBase,\n  TransformError = ErrorException + TransformBase,\n  XServerError = ErrorException + XServerBase,\n  X11Error = ErrorException + X11Base,\n  UserError = ErrorException + UserBase,\n  MonitorError = ErrorException + MonitorBase,\n  LocaleError = ErrorException + LocaleBase,\n  DeprecateError = ErrorException + DeprecateBase,\n  RegistryError = ErrorException + RegistryBase,\n  ConfigureError = ErrorException + ConfigureBase,\n\n  FatalErrorException = 700,\n  ExceptionFatalError = FatalErrorException + ExceptionBase,\n  ResourceFatalError = FatalErrorException + ResourceBase,\n  ResourceLimitFatalError = FatalErrorException + ResourceLimitBase,\n  TypeFatalError = FatalErrorException + TypeBase,\n  AnnotateFatalError = FatalErrorException + AnnotateBase,\n  OptionFatalError = FatalErrorException + OptionBase,\n  DelegateFatalError = FatalErrorException + DelegateBase,\n  MissingDelegateFatalError = FatalErrorException + MissingDelegateBase,\n  CorruptImageFatalError = FatalErrorException + CorruptImageBase,\n  FileOpenFatalError = FatalErrorException + FileOpenBase,\n  BlobFatalError = FatalErrorException + BlobBase,\n  StreamFatalError = FatalErrorException + StreamBase,\n  CacheFatalError = FatalErrorException + CacheBase,\n  CoderFatalError = FatalErrorException + CoderBase,\n  ModuleFatalError = FatalErrorException + ModuleBase,\n  DrawFatalError = FatalErrorException + DrawBase,\n  RenderFatalError = FatalErrorException + RenderBase,\n  ImageFatalError = FatalErrorException + ImageBase,\n  WandFatalError = FatalErrorException + WandBase,\n  TemporaryFileFatalError = FatalErrorException + TemporaryFileBase,\n  TransformFatalError = FatalErrorException + TransformBase,\n  XServerFatalError = FatalErrorException + XServerBase,\n  X11FatalError = FatalErrorException + X11Base,\n  UserFatalError = FatalErrorException + UserBase,\n  MonitorFatalError = FatalErrorException + MonitorBase,\n  LocaleFatalError = FatalErrorException + LocaleBase,\n  DeprecateFatalError = FatalErrorException + DeprecateBase,\n  RegistryFatalError = FatalErrorException + RegistryBase,\n  ConfigureFatalError = FatalErrorException + ConfigureBase\n} ExceptionType;\n\n/*\n  Typedef declarations.\n*/\n\n/*\n  ExceptionInfo is used to report exceptions to higher level routines,\n  and to the user.\n*/\ntypedef struct _ExceptionInfo\n{\n  /*\n    Exception severity, reason, and description\n  */\n  ExceptionType\n    severity;\n\n  char\n    *reason,\n    *description;\n\n  /*\n    Value of errno (or equivalent) when exception was thrown.\n  */\n  int\n    error_number;\n\n  /*\n    Reporting source module, function (if available), and source\n    module line.\n  */\n  char\n    *module,\n    *function;\n\n  unsigned long\n    line;\n\n  /*\n    Structure sanity check\n  */\n  unsigned long\n    signature;\n} ExceptionInfo;\n\n/*\n  Exception typedef declarations.\n*/\ntypedef void\n  (*ErrorHandler)(const ExceptionType,const char *,const char *);\n\ntypedef void\n  (*FatalErrorHandler)(const ExceptionType,const char *,const char *) MAGICK_FUNC_NORETURN;\n\ntypedef void\n  (*WarningHandler)(const ExceptionType,const char *,const char *);\n\n/*\n  Exception declarations.\n*/\nextern MagickExport const char\n  *GetLocaleExceptionMessage(const ExceptionType,const char *),\n  *GetLocaleMessage(const char *);\n\nextern MagickExport ErrorHandler\n  SetErrorHandler(ErrorHandler);\n\nextern MagickExport FatalErrorHandler\n  SetFatalErrorHandler(FatalErrorHandler);\n\nextern MagickExport void\n  CatchException(const ExceptionInfo *),\n  CopyException(ExceptionInfo *copy, const ExceptionInfo *original),\n  DestroyExceptionInfo(ExceptionInfo *),\n  GetExceptionInfo(ExceptionInfo *),\n  MagickError(const ExceptionType,const char *,const char *),\n  MagickFatalError(const ExceptionType,const char *,const char *) MAGICK_FUNC_NORETURN,\n  MagickWarning(const ExceptionType,const char *,const char *),\n  _MagickError(const ExceptionType,const char *,const char *),\n  _MagickFatalError(const ExceptionType,const char *,const char *) MAGICK_FUNC_NORETURN,\n  _MagickWarning(const ExceptionType,const char *,const char *),\n  SetExceptionInfo(ExceptionInfo *,ExceptionType),\n  ThrowException(ExceptionInfo *,const ExceptionType,const char *,const char *),\n  ThrowLoggedException(ExceptionInfo *exception, const ExceptionType severity,\n    const char *reason,const char *description,const char *module,\n    const char *function,const unsigned long line);\n\nextern MagickExport WarningHandler\n  SetWarningHandler(WarningHandler);\n\n/*\n  Exception define definitions.\n*/\n\n#include <magick/log.h>\n\n#if defined(MAGICK_IMPLEMENTATION)\n\n#  include \"magick/error-private.h\"\n\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* !defined(_MAGICK_ERROR_H) */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/forward.h",
    "content": "/*\n  Copyright (C) 2007 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Forward declarations for types used in public structures.\n\n*/\n#ifndef _MAGICK_FORWARD_H\n#define _MAGICK_FORWARD_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\ntypedef struct _Image *ImagePtr;\n\ntypedef struct _Ascii85Info* _Ascii85InfoPtr_;\n\ntypedef struct _BlobInfo* _BlobInfoPtr_;\n\ntypedef struct _CacheInfo* _CacheInfoPtr_;\n\ntypedef struct _ImageAttribute* _ImageAttributePtr_;\n\ntypedef struct _SemaphoreInfo* _SemaphoreInfoPtr_;\n\ntypedef struct _ThreadViewSet* _ThreadViewSetPtr_;\n\ntypedef void *ViewInfo;\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_FORWARD_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/fx.h",
    "content": "/*\n  Copyright (C) 2003-2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image FX Methods.\n*/\n#ifndef _MAGICK_FX_H\n#define _MAGICK_FX_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif  /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *CharcoalImage(const Image *,const double,const double,ExceptionInfo *),\n  *ColorizeImage(const Image *,const char *,const PixelPacket,ExceptionInfo *),\n  *ImplodeImage(const Image *,const double,ExceptionInfo *),\n  *MorphImages(const Image *,const unsigned long,ExceptionInfo *),\n  *OilPaintImage(const Image *,const double,ExceptionInfo *),\n  *SteganoImage(const Image *,const Image *,ExceptionInfo *),\n  *StereoImage(const Image *,const Image *,ExceptionInfo *),\n  *SwirlImage(const Image *,double,ExceptionInfo *),\n  *WaveImage(const Image *,const double,const double,ExceptionInfo *);\n\nextern MagickExport MagickPassFail\n  ColorMatrixImage(Image *image,const unsigned int order,const double *matrix),\n  SolarizeImage(Image *,const double);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_FX_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/gem.h",
    "content": "/*\n  Copyright (C) 2003-2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Graphic Gems - Graphic Support Methods.\n*/\n#ifndef _MAGICK_GEM_H\n#define _MAGICK_GEM_H\n\n#include \"magick/random.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Graphic gems define declarations.\n*/\nextern MagickExport double\n  ExpandAffine(const AffineMatrix *),\n  GenerateDifferentialNoise(const Quantum pixel,const NoiseType noise_type,\n    MagickRandomKernel *kernel);\n\nextern MagickExport int\n  GetOptimalKernelWidth(const double,const double),\n  GetOptimalKernelWidth1D(const double,const double),\n  GetOptimalKernelWidth2D(const double,const double);\n\n\nextern MagickExport Quantum\n  GenerateNoise(const Quantum,const NoiseType);\n\nextern MagickExport void\n  Contrast(const int,Quantum *,Quantum *,Quantum *),\n  HSLTransform(const double,const double,const double,Quantum *,Quantum *,\n    Quantum *),\n  HWBTransform(const double,const double,const double,Quantum *,Quantum *,\n    Quantum *),\n  Hull(const long,const long,const unsigned long,const unsigned long,Quantum *,\n    Quantum *,const int),\n  IdentityAffine(AffineMatrix *),\n  Modulate(const double,const double,const double,Quantum *,Quantum *,\n    Quantum *),\n  TransformHSL(const Quantum,const Quantum,const Quantum,double *,double *,\n    double *),\n  TransformHWB(const Quantum,const Quantum,const Quantum,double *,double *,\n    double *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/gradient.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Gradient Image Methods.\n*/\n#ifndef _MAGICK_GRADIENT_H\n#define _MAGICK_GRADIENT_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n\f\nextern MagickExport MagickPassFail\n  GradientImage(Image *,const PixelPacket *,const PixelPacket *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_GRADIENT_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/hclut.h",
    "content": "/*\n  Copyright (C) 2009 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Hald CLUT implementation\n\n*/\n#ifndef _MAGICK_HCLUT_H\n#define _MAGICK_HCLUT_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif  /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport MagickPassFail\n  HaldClutImage(Image *,const Image * clut);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_HCLUT_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/image.h",
    "content": "/*\n  Copyright (C) 2003 - 2019 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Methods.\n*/\n#ifndef _MAGICK_IMAGE_H\n#define _MAGICK_IMAGE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/forward.h\"\n#include \"magick/colorspace.h\"\n#include \"magick/error.h\"\n#include \"magick/timer.h\"\n\f\n/*\n  Define declarations.\n*/\n#if !defined(QuantumDepth)\n#  define QuantumDepth  16\n#endif\n\n/*\n  Maximum unsigned RGB value which fits in the specified bits\n\n  If bits <= 0, then zero is returned.  If bits exceeds bits in unsigned long,\n  then max value of unsigned long is returned.\n*/\n#define MaxValueGivenBits(bits) ((unsigned long) \\\n                                 (((int) bits <= 0) ? 0 :               \\\n                                   ((0x01UL << (Min(sizeof(unsigned long)*8U,(size_t)bits)-1)) + \\\n                                    ((0x01UL << (Min(sizeof(unsigned long)*8U,(size_t)bits)-1))-1))))\n\n#if (QuantumDepth == 8)\n#  define MaxColormapSize  256U\n#  define MaxMap  255U\n#  define MaxMapDepth 8\n#  define MaxMapFloat 255.0f\n#  define MaxMapDouble 255.0\n#  define MaxRGB  255U\n#  define MaxRGBFloat 255.0f\n#  define MaxRGBDouble 255.0\n#  define ScaleCharToMap(value)        ((unsigned char) (value))\n#  define ScaleCharToQuantum(value)    ((Quantum) (value))\n#  define ScaleLongToQuantum(value)    ((Quantum) ((value)/16843009UL))\n#  define ScaleMapToChar(value)        ((unsigned int) (value))\n#  define ScaleMapToQuantum(value)     ((Quantum) (value))\n#  define ScaleQuantum(quantum)        ((unsigned long) (quantum))\n#  define ScaleQuantumToChar(quantum)  ((unsigned char) (quantum))\n#  define ScaleQuantumToLong(quantum)  ((unsigned long) (16843009UL*(quantum)))\n#  define ScaleQuantumToMap(quantum)   ((unsigned char) (quantum))\n#  define ScaleQuantumToShort(quantum) ((unsigned short) (257U*(quantum)))\n#  define ScaleShortToQuantum(value)   ((Quantum) ((value)/257U))\n#  define ScaleToQuantum(value)        ((unsigned long) (value))\n#  define ScaleQuantumToIndex(value)   ((unsigned char) (value))\n   typedef unsigned char Quantum;\n#elif (QuantumDepth == 16)\n#  define MaxColormapSize  65536U\n#  define MaxMap 65535U\n#  define MaxMapDepth 16\n#  define MaxMapFloat 65535.0f\n#  define MaxMapDouble 65535.0\n#  define MaxRGB  65535U\n#  define MaxRGBFloat 65535.0f\n#  define MaxRGBDouble 65535.0\n#  define ScaleCharToMap(value)        ((unsigned short) (257U*(value)))\n#  define ScaleCharToQuantum(value)    ((Quantum) (257U*(value)))\n#  define ScaleLongToQuantum(value)    ((Quantum) ((value)/65537UL))\n#  define ScaleMapToChar(value)        ((unsigned int) ((value)/257U))\n#  define ScaleMapToQuantum(value)     ((Quantum) (value))\n#  define ScaleQuantum(quantum)        ((unsigned long) ((quantum)/257UL))\n#  define ScaleQuantumToChar(quantum)  ((unsigned char) ((quantum)/257U))\n#  define ScaleQuantumToLong(quantum)  ((unsigned long) (65537UL*(quantum)))\n#  define ScaleQuantumToMap(quantum)   ((unsigned short) (quantum))\n#  define ScaleQuantumToShort(quantum) ((unsigned short) (quantum))\n#  define ScaleShortToQuantum(value)   ((Quantum) (value))\n#  define ScaleToQuantum(value)        ((unsigned long) (257UL*(value)))\n#  define ScaleQuantumToIndex(value)   ((unsigned short) (value))\n   typedef unsigned short Quantum;\n#elif (QuantumDepth == 32)\n#  define MaxColormapSize  65536U\n#  define MaxRGB  4294967295U\n#  define MaxRGBFloat 4294967295.0f\n#  define MaxRGBDouble 4294967295.0\n#  define ScaleCharToQuantum(value)    ((Quantum) (16843009U*(value)))\n#  define ScaleLongToQuantum(value)    ((Quantum) ((value)))\n#  define ScaleQuantum(quantum)        ((unsigned long) ((quantum)/16843009UL))\n#  define ScaleQuantumToChar(quantum)  ((unsigned char) ((quantum)/16843009U))\n#  define ScaleQuantumToLong(quantum)  ((unsigned long) (quantum))\n#  define ScaleQuantumToShort(quantum) ((unsigned short) ((quantum)/65537U))\n#  define ScaleShortToQuantum(value)   ((Quantum) (65537U*(value)))\n#  define ScaleToQuantum(value)        ((unsigned long) (16843009UL*(value)))\n#  define ScaleQuantumToIndex(value)   ((unsigned short) ((value)/65537U))\n\n/*\n  MaxMap defines the maximum index value for algorithms which depend\n  on lookup tables (e.g. colorspace transformations and\n  normalization). When MaxMap is less than MaxRGB it is necessary to\n  downscale samples to fit the range of MaxMap. The number of bits\n  which are effectively preserved depends on the size of MaxMap.\n  MaxMap should be a multiple of 255 and no larger than MaxRGB.  Note\n  that tables can become quite large and as the tables grow larger it\n  may take more time to compute the table than to process the image.\n*/\n#define MaxMap 65535U\n#define MaxMapDepth 16\n#define MaxMapFloat 65535.0f\n#define MaxMapDouble 65535.0\n#if MaxMap == 65535U\n#  define ScaleCharToMap(value)        ((unsigned short) (257U*(value)))\n#  define ScaleMapToChar(value)        ((unsigned int) ((value)/257U))\n#  define ScaleMapToQuantum(value)     ((Quantum) (65537U*(value)))\n#  define ScaleQuantumToMap(quantum)   ((unsigned short) ((quantum)/65537U))\n#else\n#  define ScaleCharToMap(value)        ((unsigned short) ((MaxMap/255U)*(value)))\n#  define ScaleMapToChar(value)        ((unsigned int) ((value)/(MaxMap/255U)))\n#  define ScaleMapToQuantum(value)     ((Quantum) ((MaxRGB/MaxMap)*(value)))\n#  define ScaleQuantumToMap(quantum)   ((unsigned short) ((quantum)/(MaxRGB/MaxMap)))\n#endif\ntypedef unsigned int Quantum;\n#else\n#  error \"Specified value of QuantumDepth is not supported\"\n#endif\n\n#define OpaqueOpacity  0UL\n#define TransparentOpacity  MaxRGB\n#define RoundDoubleToQuantum(value) ((Quantum) (value < 0.0 ? 0U : \\\n  (value > MaxRGBDouble) ? MaxRGB : value + 0.5))\n#define RoundFloatToQuantum(value) ((Quantum) (value < 0.0f ? 0U : \\\n  (value > MaxRGBFloat) ? MaxRGB : value + 0.5f))\n#define ConstrainToRange(min,max,value) (value < min ? min :    \\\n  (value > max) ? max : value)\n#define ConstrainToQuantum(value) ConstrainToRange(0,MaxRGB,value)\n#define ScaleAnyToQuantum(x,max_value) \\\n  ((Quantum) (((double) MaxRGBDouble*x)/max_value+0.5))\n#define MagickBoolToString(value) (value != MagickFalse ? \"True\" : \"False\")\n\n/*\n  Return MagickTrue if channel is enabled in channels.  Allows using\n  code to adapt if ChannelType enumeration is changed to bit masks.\n*/\n#define MagickChannelEnabled(channels,channel) ((channels == AllChannels) || (channels == channel))\n\n/*\n  Deprecated defines.\n*/\n#define RunlengthEncodedCompression RLECompression\n#define RoundSignedToQuantum(value) RoundDoubleToQuantum(value)\n#define RoundToQuantum(value) RoundDoubleToQuantum(value)\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UnspecifiedAlpha,\n  AssociatedAlpha,\n  UnassociatedAlpha\n} AlphaType;\n\ntypedef enum\n{\n  UndefinedChannel,\n  RedChannel,     /* RGB Red channel */\n  CyanChannel,    /* CMYK Cyan channel */\n  GreenChannel,   /* RGB Green channel */\n  MagentaChannel, /* CMYK Magenta channel */\n  BlueChannel,    /* RGB Blue channel */\n  YellowChannel,  /* CMYK Yellow channel */\n  OpacityChannel, /* Opacity channel */\n  BlackChannel,   /* CMYK Black (K) channel */\n  MatteChannel,   /* Same as Opacity channel (deprecated) */\n  AllChannels,    /* Color channels */\n  GrayChannel     /* Color channels represent an intensity. */\n} ChannelType;\n\ntypedef enum\n{\n  UndefinedClass,\n  DirectClass,\n  PseudoClass\n} ClassType;\n\ntypedef enum\n{\n  UndefinedCompositeOp = 0,\n  OverCompositeOp,\n  InCompositeOp,\n  OutCompositeOp,\n  AtopCompositeOp,\n  XorCompositeOp,\n  PlusCompositeOp,\n  MinusCompositeOp,\n  AddCompositeOp,\n  SubtractCompositeOp,\n  DifferenceCompositeOp,\n  MultiplyCompositeOp,\n  BumpmapCompositeOp,\n  CopyCompositeOp,\n  CopyRedCompositeOp,\n  CopyGreenCompositeOp,\n  CopyBlueCompositeOp,\n  CopyOpacityCompositeOp,\n  ClearCompositeOp,\n  DissolveCompositeOp,\n  DisplaceCompositeOp,\n  ModulateCompositeOp,\n  ThresholdCompositeOp,\n  NoCompositeOp,\n  DarkenCompositeOp,\n  LightenCompositeOp,\n  HueCompositeOp,\n  SaturateCompositeOp,\n  ColorizeCompositeOp,\n  LuminizeCompositeOp,\n  ScreenCompositeOp,\n  OverlayCompositeOp,\n  CopyCyanCompositeOp,\n  CopyMagentaCompositeOp,\n  CopyYellowCompositeOp,\n  CopyBlackCompositeOp,\n  DivideCompositeOp,\n  HardLightCompositeOp,\n  ExclusionCompositeOp,\n  ColorDodgeCompositeOp,\n  ColorBurnCompositeOp,\n  SoftLightCompositeOp,\n  LinearBurnCompositeOp,\n  LinearDodgeCompositeOp,\n  LinearLightCompositeOp,\n  VividLightCompositeOp,\n  PinLightCompositeOp,\n  HardMixCompositeOp\n} CompositeOperator;\n\ntypedef enum\n{\n  UndefinedCompression,\n  NoCompression,\n  BZipCompression,\n  FaxCompression,\n  Group3Compression = FaxCompression,\n  Group4Compression,\n  JPEGCompression,\n  LosslessJPEGCompression,\n  LZWCompression,\n  RLECompression,\n  ZipCompression,\n  LZMACompression,              /* Lempel-Ziv-Markov chain algorithm */\n  JPEG2000Compression,          /* ISO/IEC std 15444-1 */\n  JBIG1Compression,             /* ISO/IEC std 11544 / ITU-T rec T.82 */\n  JBIG2Compression,             /* ISO/IEC std 14492 / ITU-T rec T.88 */\n  ZSTDCompression,              /* Facebook's Zstandard compression */\n  WebPCompression               /* Google's WebP compression */\n} CompressionType;\n\ntypedef enum\n{\n  UndefinedDispose,\n  NoneDispose,\n  BackgroundDispose,\n  PreviousDispose\n} DisposeType;\n\ntypedef enum\n{\n  UndefinedEndian,\n  LSBEndian,            /* \"little\" endian */\n  MSBEndian,            /* \"big\" endian */\n  NativeEndian          /* native endian */\n} EndianType;\n\ntypedef enum\n{\n  UndefinedFilter,\n  PointFilter,\n  BoxFilter,\n  TriangleFilter,\n  HermiteFilter,\n  HanningFilter,\n  HammingFilter,\n  BlackmanFilter,\n  GaussianFilter,\n  QuadraticFilter,\n  CubicFilter,\n  CatromFilter,\n  MitchellFilter,\n  LanczosFilter,\n  BesselFilter,\n  SincFilter\n} FilterTypes;\n\ntypedef enum\n{\n#undef NoValue\n  NoValue      = 0x00000,\n#undef XValue\n  XValue       = 0x00001,\n#undef YValue\n  YValue       = 0x00002,\n#undef WidthValue\n  WidthValue   = 0x00004,\n#undef HeightValue\n  HeightValue  = 0x00008,\n#undef AllValues\n  AllValues    = 0x0000F,\n#undef XNegative\n  XNegative    = 0x00010,\n#undef YNegative\n  YNegative    = 0x00020,\n  PercentValue = 0x01000, /* % */\n  AspectValue  = 0x02000, /* ! */\n  LessValue    = 0x04000, /* < */\n  GreaterValue = 0x08000, /* > */\n  AreaValue    = 0x10000, /* @  */\n  MinimumValue = 0x20000  /* ^ */\n} GeometryFlags;\n\ntypedef enum\n{\n#undef ForgetGravity\n  ForgetGravity,\n#undef NorthWestGravity\n  NorthWestGravity,\n#undef NorthGravity\n  NorthGravity,\n#undef NorthEastGravity\n  NorthEastGravity,\n#undef WestGravity\n  WestGravity,\n#undef CenterGravity\n  CenterGravity,\n#undef EastGravity\n  EastGravity,\n#undef SouthWestGravity\n  SouthWestGravity,\n#undef SouthGravity\n  SouthGravity,\n#undef SouthEastGravity\n  SouthEastGravity,\n#undef StaticGravity\n  StaticGravity\n} GravityType;\n\ntypedef enum\n{\n  UndefinedType,\n  BilevelType,\n  GrayscaleType,\n  GrayscaleMatteType,\n  PaletteType,\n  PaletteMatteType,\n  TrueColorType,\n  TrueColorMatteType,\n  ColorSeparationType,\n  ColorSeparationMatteType,\n  OptimizeType\n} ImageType;\n\ntypedef enum\n{\n  UndefinedInterlace,\n  NoInterlace,\n  LineInterlace,\n  PlaneInterlace,\n  PartitionInterlace\n} InterlaceType;\n\ntypedef enum\n{\n  UndefinedMode,\n  FrameMode,\n  UnframeMode,\n  ConcatenateMode\n} MontageMode;\n\ntypedef enum\n{\n  UniformNoise,\n  GaussianNoise,\n  MultiplicativeGaussianNoise,\n  ImpulseNoise,\n  LaplacianNoise,\n  PoissonNoise,\n  /* Below added on 2012-03-17 */\n  RandomNoise,\n  UndefinedNoise\n} NoiseType;\n\n/*\n  Image orientation.  Based on TIFF standard values (also EXIF).\n*/\ntypedef enum               /*    Exif     /  Row 0   / Column 0 */\n                           /* Orientation /  edge    /   edge   */\n{                          /* ----------- / -------- / -------- */\n  UndefinedOrientation,    /*      0      / Unknown  / Unknown  */\n  TopLeftOrientation,      /*      1      / Left     / Top      */\n  TopRightOrientation,     /*      2      / Right    / Top      */\n  BottomRightOrientation,  /*      3      / Right    / Bottom   */\n  BottomLeftOrientation,   /*      4      / Left     / Bottom   */\n  LeftTopOrientation,      /*      5      / Top      / Left     */\n  RightTopOrientation,     /*      6      / Top      / Right    */\n  RightBottomOrientation,  /*      7      / Bottom   / Right    */\n  LeftBottomOrientation    /*      8      / Bottom   / Left     */\n} OrientationType;\n\ntypedef enum\n{\n  UndefinedPreview = 0,\n  RotatePreview,\n  ShearPreview,\n  RollPreview,\n  HuePreview,\n  SaturationPreview,\n  BrightnessPreview,\n  GammaPreview,\n  SpiffPreview,\n  DullPreview,\n  GrayscalePreview,\n  QuantizePreview,\n  DespecklePreview,\n  ReduceNoisePreview,\n  AddNoisePreview,\n  SharpenPreview,\n  BlurPreview,\n  ThresholdPreview,\n  EdgeDetectPreview,\n  SpreadPreview,\n  SolarizePreview,\n  ShadePreview,\n  RaisePreview,\n  SegmentPreview,\n  SwirlPreview,\n  ImplodePreview,\n  WavePreview,\n  OilPaintPreview,\n  CharcoalDrawingPreview,\n  JPEGPreview\n} PreviewType;\n\ntypedef enum\n{\n  UndefinedIntent,\n  SaturationIntent,\n  PerceptualIntent,\n  AbsoluteIntent,\n  RelativeIntent\n} RenderingIntent;\n\ntypedef enum\n{\n  UndefinedResolution,\n  PixelsPerInchResolution,\n  PixelsPerCentimeterResolution\n} ResolutionType;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _AffineMatrix\n{\n  double\n    sx,\n    rx,\n    ry,\n    sy,\n    tx,\n    ty;\n} AffineMatrix;\n\ntypedef struct _PrimaryInfo\n{\n  double\n    x,\n    y,\n    z;\n} PrimaryInfo;\n\ntypedef struct _ChromaticityInfo\n{\n  PrimaryInfo\n    red_primary,\n    green_primary,\n    blue_primary,\n    white_point;\n} ChromaticityInfo;\n\n#if defined(MAGICK_IMPLEMENTATION)\n/*\n  Useful macros for accessing PixelPacket members in a generic way.\n*/\n# define GetRedSample(p) ((p)->red)\n# define GetGreenSample(p) ((p)->green)\n# define GetBlueSample(p) ((p)->blue)\n# define GetOpacitySample(p) ((p)->opacity)\n\n# define SetRedSample(q,value) ((q)->red=(value))\n# define SetGreenSample(q,value) ((q)->green=(value))\n# define SetBlueSample(q,value) ((q)->blue=(value))\n# define SetOpacitySample(q,value) ((q)->opacity=(value))\n\n# define GetGraySample(p) ((p)->red)\n# define SetGraySample(q,value) ((q)->red=(q)->green=(q)->blue=(value))\n\n# define GetYSample(p) ((p)->red)\n# define GetCbSample(p) ((p)->green)\n# define GetCrSample(p) ((p)->blue)\n\n# define SetYSample(q,value) ((q)->red=(value))\n# define SetCbSample(q,value) ((q)->green=(value))\n# define SetCrSample(q,value) ((q)->blue=(value))\n\n# define GetCyanSample(p) ((p)->red)\n# define GetMagentaSample(p) ((p)->green)\n# define GetYellowSample(p) ((p)->blue)\n# define GetBlackSample(p) ((p)->opacity)\n\n# define SetCyanSample(q,value) ((q)->red=(value))\n# define SetMagentaSample(q,value) ((q)->green=(value))\n# define SetYellowSample(q,value) ((q)->blue=(value))\n# define SetBlackSample(q,value) ((q)->opacity=(value))\n\n# define ClearPixelPacket(q) ((q)->red=(q)->green=(q)->blue=(q)->opacity=0)\n\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\ntypedef struct _PixelPacket\n{\n#if defined(WORDS_BIGENDIAN)\n  /* RGBA */\n#define MAGICK_PIXELS_RGBA 1\n  Quantum\n    red,\n    green,\n    blue,\n    opacity;\n#else\n  /* BGRA (as used by Microsoft Windows DIB) */\n#define MAGICK_PIXELS_BGRA 1\n  Quantum\n    blue,\n    green,\n    red,\n    opacity;\n#endif\n} PixelPacket;\n\ntypedef struct _DoublePixelPacket\n{\n  double\n    red,\n    green,\n    blue,\n    opacity;\n} DoublePixelPacket;\n\ntypedef struct _FloatPixelPacket\n{\n  float\n    red,\n    green,\n    blue,\n    opacity;\n} FloatPixelPacket;\n\n/*\n  ErrorInfo is used to record statistical difference (error)\n  information based on computed Euclidean distance in RGB space.\n*/\ntypedef struct _ErrorInfo\n{\n  double\n    mean_error_per_pixel,     /* Average error per pixel (absolute range) */\n    normalized_mean_error,    /* Average error per pixel (normalized to 1.0) */\n    normalized_maximum_error; /* Maximum error encountered (normalized to 1.0) */\n} ErrorInfo;\n\ntypedef struct _FrameInfo\n{\n  unsigned long\n    width,\n    height;\n\n  long\n    x,\n    y,\n    inner_bevel,\n    outer_bevel;\n} FrameInfo;\n\ntypedef Quantum IndexPacket;\n\ntypedef struct _LongPixelPacket\n{\n  unsigned long\n    red,\n    green,\n    blue,\n    opacity;\n} LongPixelPacket;\n\ntypedef struct _MontageInfo\n{\n  char\n    *geometry,\n    *tile,\n    *title,\n    *frame,\n    *texture,\n    *font;\n\n  double\n    pointsize;\n\n  unsigned long\n    border_width;\n\n  unsigned int\n    shadow;\n\n  PixelPacket\n    fill,\n    stroke,\n    background_color,\n    border_color,\n    matte_color;\n\n  GravityType\n    gravity;\n\n  char\n    filename[MaxTextExtent];\n\n  unsigned long\n    signature;\n} MontageInfo;\n\ntypedef struct _ProfileInfo\n{\n  size_t\n    length;\n\n  char\n    *name;\n\n  unsigned char\n    *info;\n} ProfileInfo;\n\ntypedef struct _RectangleInfo\n{\n  unsigned long\n    width,\n    height;\n\n  long\n    x,\n    y;\n} RectangleInfo;\n\ntypedef struct _SegmentInfo\n{\n  double\n    x1,\n    y1,\n    x2,\n    y2;\n} SegmentInfo;\n\nstruct _ImageExtra;  /* forward decl.; see member \"extra\" below */\n\ntypedef struct _Image\n{\n  ClassType\n    storage_class;      /* DirectClass (TrueColor) or PseudoClass (colormapped) */\n\n  ColorspaceType\n    colorspace;         /* Current image colorspace/model */\n\n  CompressionType\n    compression;        /* Compression algorithm to use when encoding image */\n\n  MagickBool\n    dither,             /* True if image is to be dithered */\n    matte;              /* True if image has an opacity (alpha) channel */\n\n  unsigned long\n    columns,            /* Number of image columns */\n    rows;               /* Number of image rows */\n\n  unsigned int\n    colors,             /* Current number of colors in PseudoClass colormap */\n    depth;              /* Bits of precision to preserve in color quantum */\n\n  PixelPacket\n    *colormap;          /* Pseudoclass colormap array */\n\n  PixelPacket\n    background_color,   /* Background color */\n    border_color,       /* Border color */\n    matte_color;        /* Matte (transparent) color */\n\n  double\n    gamma;              /* Image gamma (e.g. 0.45) */\n\n  ChromaticityInfo\n    chromaticity;       /* Red, green, blue, and white chromaticity values */\n\n  OrientationType\n    orientation;        /* Image orientation */\n\n  RenderingIntent\n    rendering_intent;   /* Rendering intent */\n\n  ResolutionType\n    units;              /* Units of image resolution (density) */\n\n  char\n    *montage,           /* Tile size and offset within an image montage */\n    *directory,         /* Tile names from within an image montage */\n    *geometry;          /* Composite/Crop options */\n\n  long\n    offset;             /* Offset to start of image data */\n\n  double\n    x_resolution,       /* Horizontal resolution (also see units) */\n    y_resolution;       /* Vertical resolution (also see units) */\n\n  RectangleInfo\n    page,               /* Offset to apply when placing image */\n    tile_info;          /* Subregion tile dimensions and offset */\n\n  double\n    blur,               /* Amount of blur to apply when zooming image */\n    fuzz;               /* Colors within this distance match target color */\n\n  FilterTypes\n    filter;             /* Filter to use when zooming image */\n\n  InterlaceType\n    interlace;          /* Interlace pattern to use when writing image */\n\n  EndianType\n    endian;             /* Byte order to use when writing image */\n\n  GravityType\n    gravity;            /* Image placement gravity */\n\n  CompositeOperator\n    compose;            /* Image placement composition (default OverCompositeOp) */\n\n  DisposeType\n    dispose;            /* GIF disposal option */\n\n  unsigned long\n    scene,              /* Animation frame scene number */\n    delay,              /* Animation frame scene delay */\n    iterations,         /* Animation iterations */\n    total_colors;       /* Number of unique colors. See GetNumberColors() */\n\n  long\n    start_loop;         /* Animation frame number to start looping at */\n\n  ErrorInfo\n    error;              /* Computed image comparison or quantization error */\n\n  TimerInfo\n    timer;              /* Operation micro-timer */\n\n  void\n    *client_data;       /* User specified opaque data pointer */\n\n  /*\n    Output file name.\n\n    A colon delimited format identifier may be prepended to the file\n    name in order to force a particular output format. Otherwise the\n    file extension is used. If no format prefix or file extension is\n    present, then the output format is determined by the 'magick'\n    field.\n  */\n  char\n    filename[MaxTextExtent];\n\n  /*\n    Original file name (name of input image file)\n  */\n  char\n    magick_filename[MaxTextExtent];\n\n  /*\n    File format of the input file, and the default output format.\n\n    The precedence when selecting the output format is:\n      1) magick prefix to file name (e.g. \"jpeg:foo).\n      2) file name extension. (e.g. \"foo.jpg\")\n      3) content of this magick field.\n\n  */\n  char\n    magick[MaxTextExtent];\n\n  /*\n    Original image width (before transformations)\n  */\n  unsigned long\n    magick_columns;\n\n  /*\n    Original image height (before transformations)\n  */\n  unsigned long\n    magick_rows;\n\n  ExceptionInfo\n    exception;          /* Any error associated with this image frame */\n\n  struct _Image\n    *previous,          /* Pointer to previous frame */\n    *next;              /* Pointer to next frame */\n\n  /*\n    To be added here for a later release:\n\n    quality?\n    subsampling\n    video black/white setup levels (ReferenceBlack/ReferenceWhite)\n    sample format (integer/float)\n   */\n\n  /*\n    Only private members appear past this point\n  */\n\n  void                  /* Private, Embedded profiles */\n    *profiles;\n\n  unsigned int\n    is_monochrome,      /* Private, True if image is known to be monochrome */\n    is_grayscale,       /* Private, True if image is known to be grayscale */\n    taint;              /* Private, True if image has not been modifed */\n\n  /*\n    Allow for expansion of Image without increasing its size.  The\n    internals are defined only in image.c.  Clients outside of image.c\n    can access the internals via the provided access functions (see below).\n\n    This location in Image used to be occupied by Image *clip_mask. The\n    clip_mask member now lives in _ImageExtra.\n  */\n  struct _ImageExtra\n    *extra;\n\n  MagickBool\n    ping;               /* Private, if true, pixels are undefined */\n\n  _CacheInfoPtr_\n    cache;              /* Private, image pixel cache */\n\n  _ThreadViewSetPtr_\n    default_views;      /* Private, default cache views */\n\n  _ImageAttributePtr_\n    attributes;         /* Private, Image attribute list */\n\n  _Ascii85InfoPtr_\n    ascii85;            /* Private, supports huffman encoding */\n\n  _BlobInfoPtr_\n    blob;               /* Private, file I/O object */\n\n  long\n    reference_count;    /* Private, Image reference count */\n\n  _SemaphoreInfoPtr_\n    semaphore;          /* Private, Per image lock (for reference count) */\n\n  unsigned int\n    logging;            /* Private, True if logging is enabled */\n\n  struct _Image\n    *list;              /* Private, used only by display */\n\n  unsigned long\n    signature;          /* Private, Unique code to validate structure */\n} Image;\n\ntypedef struct _ImageInfo\n{\n  CompressionType\n    compression;             /* Image compression to use while decoding */\n\n  MagickBool\n    temporary,               /* Remove file \"filename\" once it has been read. */\n    adjoin,                  /* If True, join multiple frames into one file */\n    antialias;               /* If True, antialias while rendering */\n\n  unsigned long\n    subimage,                /* Starting image scene ID to select */\n    subrange,                /* Span of image scene IDs (from starting scene) to select */\n    depth;                   /* Number of quantum bits to preserve while encoding */\n\n  char\n    *size,                   /* Desired/known dimensions to use when decoding image */\n    *tile,                   /* Deprecated, name of image to tile on background */\n    *page;                   /* Output page size & offset */\n\n  InterlaceType\n    interlace;               /* Interlace scheme to use when decoding image */\n\n  EndianType\n    endian;                  /* Select MSB/LSB endian output for TIFF format */\n\n  ResolutionType\n    units;                   /* Units to apply when evaluating the density option */\n\n  unsigned long\n    quality;                 /* Compression quality factor (format specific) */\n\n  char\n    *sampling_factor,        /* JPEG, MPEG, and YUV chroma downsample factor */\n    *server_name,            /* X11 server display specification */\n    *font,                   /* Font name to use for text annotations */\n    *texture,                /* Name of texture image to use for background fills */\n    *density;                /* Image resolution (also see units) */\n\n  double\n    pointsize;               /* Font pointsize */\n\n  double\n    fuzz;                    /* Colors within this distance are a match */\n\n  PixelPacket\n    pen,                     /* Stroke or fill color while drawing */\n    background_color,        /* Background color */\n    border_color,            /* Border color (color surrounding frame) */\n    matte_color;             /* Matte color (frame color) */\n\n  MagickBool\n    dither,                  /* If true, dither image while writing */\n    monochrome,              /* If true, use monochrome format */\n    progress;                /* If true, show progress indication */\n\n  ColorspaceType\n    colorspace;              /* Colorspace representations of image pixels */\n\n  ImageType\n    type;                    /* Desired image type (used while reading or writing) */\n\n  long\n    group;                   /* X11 window group ID */\n\n  unsigned int\n    verbose;                 /* If non-zero, display high-level processing */\n\n  char\n    *view,                   /* FlashPIX view specification */\n    *authenticate;           /* Password used to decrypt file */\n\n  void\n    *client_data;            /* User-specified data to pass to coder */\n\n  FILE\n    *file;                   /* If not null, stdio FILE * to read image from\n                                (fopen mode \"rb\") or write image to (fopen\n                                mode \"rb+\"). */\n\n  char\n    magick[MaxTextExtent],   /* File format to read. Overrides file extension */\n    filename[MaxTextExtent]; /* File name to read */\n\n  /*\n    Only private members appear past this point\n  */\n\n  _CacheInfoPtr_\n     cache;                  /* Private. Used to pass image via open cache */\n\n  void\n    *definitions;            /* Private. Map of coder specific options passed by user.\n                                Use AddDefinitions, RemoveDefinitions, & AccessDefinition\n                                to access and manipulate this data. */\n\n  Image\n    *attributes;             /* Private. Image attribute list */\n\n  MagickBool\n    ping;                    /* Private, if true, read file header only */\n\n  PreviewType\n    preview_type;            /* Private, used by PreviewImage */\n\n  MagickBool\n    affirm;                  /* Private, when true do not intuit image format */\n\n  _BlobInfoPtr_\n    blob;                    /* Private, used to pass in open blob */\n\n  size_t\n    length;                  /* Private, used to pass in open blob length */\n\n  char\n    unique[MaxTextExtent],   /* Private, passes temporary filename to TranslateText */\n    zero[MaxTextExtent];     /* Private, passes temporary filename to TranslateText */\n\n  unsigned long\n    signature;               /* Private, used to validate structure */\n} ImageInfo;\n\f\n/*\n  Image utilities methods.\n*/\n\nextern MagickExport ExceptionType\n  CatchImageException(Image *);\n\nextern MagickExport Image\n  *AllocateImage(const ImageInfo *),\n  *AppendImages(const Image *,const unsigned int,ExceptionInfo *),\n  *CloneImage(const Image *,const unsigned long,const unsigned long,\n   const unsigned int,ExceptionInfo *),\n  *GetImageClipMask(const Image *,ExceptionInfo *),\n  *GetImageCompositeMask(const Image *,ExceptionInfo *),  /*to support SVG masks*/\n  *ReferenceImage(Image *);\n\nextern MagickExport ImageInfo\n  *CloneImageInfo(const ImageInfo *);\n\nextern MagickExport const char\n  *AccessDefinition(const ImageInfo *image_info,const char *magick,\n     const char *key);\n\nextern MagickExport int\n  GetImageGeometry(const Image *,const char *,const unsigned int,\n  RectangleInfo *);\n\n/* Functions which return unsigned int as a True/False boolean value */\nextern MagickExport MagickBool\n  IsTaintImage(const Image *),\n  IsSubimage(const char *,const MagickBool);\n\n/* Functions which return unsigned int to indicate operation pass/fail */\nextern MagickExport MagickPassFail\n  AddDefinition(ImageInfo *image_info,const char *magick, const char *key,\n    const char *value, ExceptionInfo *exception),\n  AddDefinitions(ImageInfo *image_info,const char *options,\n    ExceptionInfo *exception),\n  AnimateImages(const ImageInfo *image_info,Image *image),\n  ClipImage(Image *image),\n  ClipPathImage(Image *image,const char *pathname,const MagickBool inside),\n  CompositeMaskImage(Image *image),   /*to support SVG masks*/\n  CompositePathImage(Image *image,const char *pathname,const MagickBool inside),  /*to support SVG masks*/\n  DisplayImages(const ImageInfo *image_info,Image *image),\n  RemoveDefinitions(const ImageInfo *image_info,const char *options),\n  ResetImagePage(Image *image,const char *page),\n  SetImage(Image *image,const Quantum),\n  SetImageEx(Image *image,const Quantum opacity,ExceptionInfo *exception),\n  SetImageColor(Image *image,const PixelPacket *pixel),\n  SetImageColorRegion(Image *image,long x,long y,unsigned long width,\n                      unsigned long height,const PixelPacket *pixel),\n  SetImageClipMask(Image *image,const Image *clip_mask),\n  SetImageCompositeMask(Image *image,const Image *composite_mask),  /*to support SVG masks*/\n  SetImageDepth(Image *image,const unsigned long),\n  SetImageInfo(ImageInfo *image_info,const unsigned int flags,ExceptionInfo *exception),\n  SetImageType(Image *image,const ImageType),\n  StripImage(Image *image),\n  SyncImage(Image *image);\n\nextern MagickExport void\n  AllocateNextImage(const ImageInfo *,Image *),\n  DestroyImage(Image *),\n  DestroyImageInfo(ImageInfo *),\n  GetImageException(Image *,ExceptionInfo *),\n  GetImageInfo(ImageInfo *),\n  ModifyImage(Image **,ExceptionInfo *),\n  SetImageOpacity(Image *,const unsigned int);\n\n/* provide public access to the clip_mask member of Image */\nextern MagickExport Image\n  **ImageGetClipMask(const Image *) MAGICK_FUNC_PURE;\n\n/* provide public access to the composite_mask member of Image */\nextern MagickExport Image\n  **ImageGetCompositeMask(const Image *) MAGICK_FUNC_PURE;\n\n#if defined(MAGICK_IMPLEMENTATION)\n  /*\n    SetImageInfo flags specification.\n  */\n#  define SETMAGICK_FALSE    0x00000 /* MagickFalse (\"read\") */\n#  define SETMAGICK_TRUE     0x00001 /* MagickTrue (\"write+rectify\") */\n#  define SETMAGICK_READ     0x00002 /* Filespec will be read */\n#  define SETMAGICK_WRITE    0x00004 /* Filespec will be written */\n#  define SETMAGICK_RECTIFY  0x00008 /* Look for adjoin in filespec */\n\n#include \"magick/image-private.h\"\n\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_IMAGE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/list.h",
    "content": "/*\n  Copyright (C) 2003-2018 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image List Methods.\n*/\n#ifndef _MAGICK_LIST_H\n#define _MAGICK_LIST_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\nextern MagickExport Image\n  *CloneImageList(const Image *,ExceptionInfo *),\n  *GetFirstImageInList(const Image *) MAGICK_FUNC_PURE,\n  *GetImageFromList(const Image *,const long) MAGICK_FUNC_PURE,\n  *GetLastImageInList(const Image *) MAGICK_FUNC_PURE,\n  *GetNextImageInList(const Image *) MAGICK_FUNC_PURE,\n  *GetPreviousImageInList(const Image *) MAGICK_FUNC_PURE,\n  **ImageListToArray(const Image *,ExceptionInfo *),\n  *NewImageList(void) MAGICK_FUNC_CONST,\n  *RemoveLastImageFromList(Image **),\n  *RemoveFirstImageFromList(Image **),\n  *SplitImageList(Image *),\n  *SyncNextImageInList(const Image *);\n\nextern MagickExport long\n  GetImageIndexInList(const Image *) MAGICK_FUNC_PURE;\n\nextern MagickExport unsigned long\n  GetImageListLength(const Image *) MAGICK_FUNC_PURE;\n\nextern MagickExport void\n  AppendImageToList(Image **,Image *),\n  DeleteImageFromList(Image **),\n  DestroyImageList(Image *),\n  InsertImageInList(Image **,Image *),\n  PrependImageToList(Image **,Image *),\n  ReplaceImageInList(Image **images,Image *image),\n  ReverseImageList(Image **),\n  SpliceImageIntoList(Image **,const unsigned long,Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/log.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Log methods.\n*/\n#ifndef _MAGICK_LOG_H\n#define _MAGICK_LOG_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Define declarations.\n  */\n#define MagickLogFilename  \"log.mgk\"\n\n  /*\n    Obtain the current C function name (if possible)\n  */\n#  if !defined(GetCurrentFunction)\n#    if (((defined(__cplusplus) || defined(c_plusplus)) && defined(HAS_CPP__func__)) || \\\n        (!(defined(__cplusplus) || defined(c_plusplus)) && defined(HAS_C__func__)))\n#      define GetCurrentFunction() (__func__)\n#    elif defined(_VISUALC_) && defined(__FUNCTION__)\n#      define GetCurrentFunction() (__FUNCTION__)\n#    else\n#      define GetCurrentFunction() (\"unknown\")\n#    endif\n#  endif\n\n  /*\n    Obtain current source file, function name, and source file line,\n    in a form acceptable for use with LogMagickEvent.\n  */\n#  if !defined(GetMagickModule)\n#    define GetMagickModule()  __FILE__,GetCurrentFunction(),__LINE__\n#  endif\n\n\n/* NOTE: any changes to this effect PerlMagick */\ntypedef enum\n{\n  UndefinedEventMask     = 0x00000000,\n  NoEventsMask           = 0x00000000,\n  ConfigureEventMask     = 0x00000001,\n  AnnotateEventMask      = 0x00000002,\n  RenderEventMask        = 0x00000004,\n  TransformEventMask     = 0x00000008,\n  LocaleEventMask        = 0x00000010,\n  CoderEventMask         = 0x00000020,\n  X11EventMask           = 0x00000040,\n  CacheEventMask         = 0x00000080,\n  BlobEventMask          = 0x00000100,\n  DeprecateEventMask     = 0x00000200,\n  UserEventMask          = 0x00000400,\n  ResourceEventMask      = 0x00000800,\n  TemporaryFileEventMask = 0x00001000,\n  /* ExceptionEventMask = WarningEventMask | ErrorEventMask |  FatalErrorEventMask */\n  ExceptionEventMask     = 0x00070000,\n  OptionEventMask        = 0x00004000,\n  InformationEventMask   = 0x00008000,\n  WarningEventMask       = 0x00010000,\n  ErrorEventMask         = 0x00020000,\n  FatalErrorEventMask    = 0x00040000,\n  AllEventsMask          = 0x7FFFFFFF\n} LogEventType;\n\ntypedef void\n  (*LogMethod)(const ExceptionType,const char *);\n\n/*\n  Method declarations.\n*/\nextern MagickExport MagickBool\n  IsEventLogging(void) MAGICK_FUNC_PURE,\n  LogMagickEvent(const ExceptionType type,\n    const char *module,const char *function,const unsigned long line,\n    const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,5,6))),\n  LogMagickEventList(const ExceptionType type,\n    const char *module,const char *function,const unsigned long line,\n    const char *format,va_list operands) MAGICK_ATTRIBUTE((__format__ (__printf__,5,0)));\n\nextern MagickExport unsigned long\n  SetLogEventMask(const char *events);\n\nextern MagickExport void\n  SetLogFormat(const char *format),\n  SetLogMethod(LogMethod);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/log-private.h\"\n#endif /* MAGICK_IMPLEMENTATION */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_LOG_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/magic.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Magic methods.\n*/\n#ifndef _MAGICK_MAGIC_H\n#define _MAGICK_MAGIC_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Method declarations.\n*/\nextern MagickExport MagickPassFail\n  GetMagickFileFormat(const unsigned char *header,const size_t header_length,\n     char *format,const size_t format_length,ExceptionInfo *exception),\n  ListMagicInfo(FILE *file,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/magic-private.h\"\n#endif /* MAGICK_IMPLEMENTATION */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_MAGIC_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/magick.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Application Programming Interface declarations.\n*/\n#ifndef _MAGICK_MAGICK_H\n#define _MAGICK_MAGICK_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Flags to form options passed to InitializeMagickEx\n*/\n#define MAGICK_OPT_NO_SIGNAL_HANDER 0x0001 /* Don't register ANSI/POSIX signal handlers */\n\ntypedef Image\n  *(*DecoderHandler)(const ImageInfo *,ExceptionInfo *);\n\ntypedef unsigned int\n  (*EncoderHandler)(const ImageInfo *,Image *),\n  (*MagickHandler)(const unsigned char *,const size_t);\n\n/*\n  Stability and usefulness of the coder.\n*/\ntypedef enum\n{\n  BrokenCoderClass = -1,   /* Known to sometimes/often not work properly or\n                              might not be useful at all */\n  UnstableCoderClass = 0,  /* Weak implementation, poorly designed file\n                              format, and/or hardly ever used */\n  StableCoderClass,        /* Well maintained, but not often used */\n  PrimaryCoderClass        /* Well maintained and commonly used */\n} CoderClass;\n\n/*\n  How the file extension should be treated (e.g. in SetImageInfo()).\n*/\ntypedef enum\n{\n  HintExtensionTreatment = 0, /* Extension is a useful hint to indicate format */\n  ObeyExtensionTreatment,     /* Extension must be obeyed as format indicator */\n  IgnoreExtensionTreatment    /* Format has no associated extension */\n} ExtensionTreatment;\n\ntypedef struct _MagickInfo\n{\n  struct _MagickInfo\n    *next,              /* private, next member in list */\n    *previous;          /* private, previous member in list */\n\n  const char\n    *name;              /* format ID (\"magick\") */\n\n  const char\n    *description,       /* format description */\n    *note,              /* usage note for user */\n    *version,           /* support library version */\n    *module;            /* name of loadable module */\n\n  DecoderHandler\n    decoder;            /* function vector to decoding routine */\n\n  EncoderHandler\n    encoder;            /* function vector to encoding routine */\n\n  MagickHandler\n    magick;             /* function vector to format test routine */\n\n  void\n    *client_data;       /* arbitrary user supplied data */\n\n  MagickBool\n    adjoin,             /* coder may read/write multiple frames (default True) */\n    raw,                /* coder requires that size be set (default False) */\n    stealth,            /* coder should not appear in formats listing (default MagickFalse) */\n    seekable_stream,    /* coder requires BLOB \"seek\" and \"tell\" APIs (default MagickFalse)\n                         *   Note that SetImageInfo() currently always copies input\n                         *   from a pipe, .gz, or .bz2 file, to a temporary file so\n                         *   that it can retrieve a bit of the file header in order to\n                         *   support the file header magic logic.\n                         */\n    blob_support,       /* coder uses BLOB APIs (default True) */\n    thread_support;     /* coder is thread safe (default True) */\n\n  CoderClass\n    coder_class;        /* Coder usefulness/stability level */\n\n  ExtensionTreatment\n    extension_treatment; /* How much faith should be placed on file extension? */\n\n  unsigned long\n    signature;          /* private, structure validator */\n\n} MagickInfo;\n\f\n/*\n  Magick method declaractions.\n*/\nextern MagickExport char\n  *MagickToMime(const char *magick);\n\nextern MagickExport const char\n  *GetImageMagick(const unsigned char *magick,const size_t length);\n\nextern MagickExport MagickBool\n  IsMagickConflict(const char *magick) MAGICK_FUNC_PURE;\n\nextern MagickExport MagickPassFail\n  ListModuleMap(FILE *file,ExceptionInfo *exception),\n  ListMagickInfo(FILE *file,ExceptionInfo *exception),\n  InitializeMagickEx(const char *path, unsigned int options,\n                     ExceptionInfo *exception),\n  UnregisterMagickInfo(const char *name);\n\nextern MagickExport void\n  DestroyMagick(void),\n  InitializeMagick(const char *path),\n  PanicDestroyMagick(void);\n\nextern MagickExport const MagickInfo\n  *GetMagickInfo(const char *name,ExceptionInfo *exception);\n\nextern MagickExport MagickInfo\n  **GetMagickInfoArray(ExceptionInfo *exception);\n\nextern MagickExport MagickInfo\n  *RegisterMagickInfo(MagickInfo *magick_info),\n  *SetMagickInfo(const char *name);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/magick-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_MAGICK_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/magick_config.h",
    "content": "/* magick/magick_config_api.h.  Generated from magick_config_api.h.in by configure.  */\n/* Defines required by <magick/api.h> */\n\n/* Define if you have X11 library */\n/* #undef HasX11 */\n\n/* Number of bits in a pixel Quantum (8/16/32) */\n#define QuantumDepth 8\n\n/* Define to 1 if your processor stores words with the most significant byte\n   first (like Motorola and SPARC, unlike Intel and VAX). */\n/* #undef WORDS_BIGENDIAN */\n\n/* Prefix Magick library symbols with a common string. */\n/* #undef PREFIX_MAGICK_SYMBOLS */\n\n/* Define to `unsigned int' if <sys/types.h> does not define. */\n/* #undef size_t */\n\n/* Define to `int' if <sys/types.h> does not define. */\n/* #undef ssize_t */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/magick_types.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick types typedefs.\n\n  GraphicsMagick is expected to compile with any C '89 ANSI C compiler\n  supporting at least 16-bit 'short', 32-bit 'int', and 32-bit 'long'.\n  It is also expected to take advantage of 64-bit LP64 and Windows\n  WIN64 LLP64.  We use C '99 style types but declare our own types so\n  as to not depend on C '99 header files, and take care to depend only\n  on C '89 library functions, POSIX, or well-known extensions.  Any C\n  '99 syntax used is removed if the compiler does not support it.\n*/\n\n#ifndef _MAGICK_TYPES_H\n#define _MAGICK_TYPES_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Assign ANSI C'99 stdint.h-like typedefs based on the sizes of native types\n  magick_int8_t   --                       -128 to 127\n  magick_uint8_t  --                          0 to 255\n  magick_int16_t  --                    -32,768 to 32,767\n  magick_uint16_t --                          0 to 65,535\n  magick_int32_t  --             -2,147,483,648 to 2,147,483,647\n  magick_uint32_t --                          0 to 4,294,967,295\n  magick_int64_t  -- -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807\n  magick_uint64_t --                          0 to 18,446,744,073,709,551,615\n\n  magick_uintmax_t -- largest native unsigned integer type (\"%ju\")\n                                              0 to UINTMAX_MAX\n                      UINTMAX_C(value) declares constant value\n  magick_uintptr_t -- unsigned type for storing a pointer value (\"%tu\")\n                                              0 to UINTPTR_MAX\n\n  ANSI C '89 stddef.h-like types\n  size_t           -- unsigned type representing sizes of objects (\"%zu\")\n                                              0 to SIZE_MAX\n  ptrdiff_t -- signed type for subtracting two pointers (\"%td\")\n                                    PTRDIFF_MIN to PTRDIFF_MAX\n\n  IEEE Std 1003.1 (1990), 2004 types.  Not part of ANSI C!\n  ssize_t          -- signed type for a count of bytes or an error indication (\"%zd\")\n                                              ? to SSIZE_MAX\n*/\n\n#if (defined(WIN32) || defined(WIN64)) && \\\n  !defined(__MINGW32__) && !defined(__MINGW64__)\n\n  /* The following typedefs are used for WIN32 & WIN64 (without\n     configure) */\n  typedef signed char   magick_int8_t;\n  typedef unsigned char  magick_uint8_t;\n\n  typedef signed short  magick_int16_t;\n  typedef unsigned short magick_uint16_t;\n\n  typedef signed int  magick_int32_t;\n#  define MAGICK_INT32_F \"\"\n  typedef unsigned int magick_uint32_t;\n#  define MAGICK_UINT32_F \"\"\n\n  typedef signed __int64  magick_int64_t;\n# define MAGICK_INT64_F \"I64\"\n  typedef unsigned __int64 magick_uint64_t;\n# define MAGICK_UINT64_F \"I64\"\n\n  typedef magick_uint64_t magick_uintmax_t;\n\n#  if defined(WIN64)\n  /* WIN64 uses the LLP64 model */\n  typedef unsigned long long magick_uintptr_t;\n#  define MAGICK_SIZE_T_F \"I64\"\n#  define MAGICK_SIZE_T unsigned __int64\n#  define MAGICK_SSIZE_T_F \"I64\"\n#  define MAGICK_SSIZE_T signed __int64\n#  else\n  typedef unsigned long magick_uintptr_t;\n#  define MAGICK_SIZE_T_F \"l\"\n#  define MAGICK_SIZE_T unsigned long\n#  define MAGICK_SSIZE_T_F \"l\"\n#  define MAGICK_SSIZE_T long\n#  endif // defined(WIN64)\n\n#else\n\n  /* The following typedefs are subtituted when using Unixish configure */\n  typedef signed char   magick_int8_t;\n  typedef unsigned char  magick_uint8_t;\n\n  typedef signed short  magick_int16_t;\n  typedef unsigned short magick_uint16_t;\n\n  typedef signed int  magick_int32_t;\n#  define MAGICK_INT32_F \"\"\n  typedef unsigned int magick_uint32_t;\n#  define MAGICK_UINT32_F \"\"\n\n  typedef signed long  magick_int64_t;\n#  define MAGICK_INT64_F \"l\"\n  typedef unsigned long magick_uint64_t;\n#  define MAGICK_UINT64_F \"l\"\n\n  typedef unsigned long magick_uintmax_t;\n#  define MAGICK_UINTMAX_F \"l\"\n\n  typedef unsigned long magick_uintptr_t;\n#  define MAGICK_UINTPTR_F \"l\"\n\n#  define MAGICK_SIZE_T_F \"l\"\n#  define MAGICK_SIZE_T unsigned long\n\n#  define MAGICK_SSIZE_T_F \"l\"\n#  define MAGICK_SSIZE_T signed long\n\n#endif\n\n  /* 64-bit file and blob offset type */\n  typedef magick_int64_t magick_off_t;\n#define MAGICK_OFF_F MAGICK_INT64_F\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_TYPES_H */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/memory.h",
    "content": "/*\n  Copyright (C) 2003-2020 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Memory Allocation Methods.\n*/\n#ifndef _MAGICK_MEMORY_H\n#define _MAGICK_MEMORY_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\ntypedef void *(*MagickMallocFunc)(size_t size);\ntypedef void (*MagickFreeFunc)(void *ptr);\ntypedef void *(*MagickReallocFunc)(void *ptr, size_t size);\n\nextern MagickExport void\n   MagickAllocFunctions(MagickFreeFunc free_func,MagickMallocFunc malloc_func,\n                        MagickReallocFunc realloc_func),\n  *MagickMalloc(const size_t size) MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(1),\n  *MagickMallocAligned(const size_t alignment, const size_t size) MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(2),\n  *MagickMallocCleared(const size_t size) MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(1),\n  *MagickCloneMemory(void *destination,const void *source,const size_t size) MAGICK_FUNC_NONNULL,\n  *MagickRealloc(void *memory,const size_t size) MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(2),\n   MagickFree(void *memory),\n   MagickFreeAligned(void *memory);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#include \"magick/memory-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/module.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Modules Methods.\n*/\n#ifndef _MAGICK_MODULE_H\n#define _MAGICK_MODULE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Modules declarations.\n*/\n\nextern MagickExport MagickPassFail\n  ExecuteModuleProcess(const char *tag,Image **image,\n                       const int argc,char **argv);\n\n\n#if defined(MAGICK_IMPLEMENTATION)\n#include \"magick/module-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/monitor.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Progress Monitor Methods.\n*/\n#ifndef _MAGICK_MONITOR_H\n#define _MAGICK_MONITOR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Monitor typedef declarations.\n  */\n  typedef MagickPassFail\n  (*MonitorHandler)(const char *text,const magick_int64_t quantum,\n                    const magick_uint64_t span,ExceptionInfo *exception);\n\f\n  /*\n    Monitor declarations.\n  */\n  extern MagickExport MonitorHandler\n  SetMonitorHandler(MonitorHandler handler);\n\n  extern MagickExport MagickPassFail\n  MagickMonitor(const char *text,\n                const magick_int64_t quantum,const magick_uint64_t span,\n                ExceptionInfo *exception) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport MagickPassFail\n  MagickMonitorFormatted(const magick_int64_t quantum,\n                         const magick_uint64_t span,\n                         ExceptionInfo *exception,\n                         const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,4,5)));\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/monitor-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/montage.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Montage Methods.\n*/\n#ifndef _MAGICK_MONTAGE_H\n#define _MAGICK_MONTAGE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *MontageImages(const Image *,const MontageInfo *,ExceptionInfo *);\n\nextern MagickExport MontageInfo\n  *CloneMontageInfo(const ImageInfo *,const MontageInfo *);\n\nextern MagickExport void\n  DestroyMontageInfo(MontageInfo *),\n  GetMontageInfo(const ImageInfo *,MontageInfo *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_MONTAGE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/operator.h",
    "content": "/*\n% Copyright (C) 2004 - 2012 GraphicsMagick Group\n%\n% This program is covered by multiple licenses, which are described in\n% Copyright.txt. You should have received a copy of Copyright.txt with this\n% package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n%\n% Interfaces to support quantum operators.\n% Written by Bob Friesenhahn, March 2004.\n%\n*/\n#ifndef _MAGICK_OPERATOR_H\n#define _MAGICK_OPERATOR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\ntypedef enum\n{\n  UndefinedQuantumOp = 0,\n  AddQuantumOp,                   /* Add value */\n  AndQuantumOp,                   /* Bitwise AND value */\n  AssignQuantumOp,                /* Direct value assignment */\n  DivideQuantumOp,                /* Divide by value */\n  LShiftQuantumOp,                /* Bitwise left-shift value N bits */\n  MultiplyQuantumOp,              /* Multiply by value */\n  OrQuantumOp,                    /* Bitwise OR value */\n  RShiftQuantumOp,                /* Bitwise right shift value */\n  SubtractQuantumOp,              /* Subtract value */\n  ThresholdQuantumOp,             /* Above threshold white, otherwise black */\n  ThresholdBlackQuantumOp,        /* Below threshold is black */\n  ThresholdWhiteQuantumOp,        /* Above threshold is white */\n  XorQuantumOp,                   /* Bitwise XOR value */\n  NoiseGaussianQuantumOp,         /* Gaussian noise */\n  NoiseImpulseQuantumOp,          /* Impulse noise */\n  NoiseLaplacianQuantumOp,        /* Laplacian noise */\n  NoiseMultiplicativeQuantumOp,   /* Multiplicative gaussian noise */\n  NoisePoissonQuantumOp,          /* Poisson noise */\n  NoiseUniformQuantumOp,          /* Uniform noise */\n  NegateQuantumOp,                /* Negate (invert) channel, ignore value */\n  GammaQuantumOp,                 /* Adjust image gamma */\n  DepthQuantumOp,                 /* Adjust image depth */\n  /* Below added on 2008-12-13 */\n  LogQuantumOp,                   /* log(quantum*value+1)/log(value+1) */\n  MaxQuantumOp,                   /* Assign value if > quantum */\n  MinQuantumOp,                   /* Assign value if < quantum */\n  PowQuantumOp,                   /* Power function: pow(quantum,value) */\n  /* Below added on 2012-03-17 */\n  NoiseRandomQuantumOp,           /* Random noise */\n  /* Below added on 2014-05-17 */\n  ThresholdBlackNegateQuantumOp,  /* Below threshold is set to white */\n  ThresholdWhiteNegateQuantumOp   /* Above threshold is set to black */\n\n } QuantumOperator;\n\nextern MagickExport MagickPassFail\n  QuantumOperatorImage(Image *image,const ChannelType channel,\n    const QuantumOperator quantum_operator,const double rvalue,\n    ExceptionInfo *exception),\n  QuantumOperatorImageMultivalue(Image *image,\n                                 const QuantumOperator quantum_operator,\n                                 const char *values),\n  QuantumOperatorRegionImage(Image *image,const long x,const long y,\n    const unsigned long columns,const unsigned long rows,\n    const ChannelType channel,const QuantumOperator quantum_operator,\n    const double rvalue,ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/paint.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Paint Methods.\n*/\n#ifndef _MAGICK_PAINT_H\n#define _MAGICK_PAINT_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/render.h\"\n\nextern MagickExport unsigned int\n  ColorFloodfillImage(Image *,const DrawInfo *,const PixelPacket,const long,\n    const long,const PaintMethod),\n  MatteFloodfillImage(Image *,const PixelPacket,const unsigned int,const long,\n    const long,const PaintMethod);\n\nextern MagickExport unsigned int\n  OpaqueImage(Image *,const PixelPacket,const PixelPacket),\n  TransparentImage(Image *,const PixelPacket,const unsigned int);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/pixel_cache.h",
    "content": "/*\n  Copyright (C) 2003 - 2018 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Pixel Cache Methods.\n*/\n#ifndef _MAGICK_CACHE_H\n#define _MAGICK_CACHE_H\n\n#include \"magick/forward.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Enum declaractions.\n  */\n\n  typedef enum\n    {\n      UndefinedVirtualPixelMethod,\n      ConstantVirtualPixelMethod,\n      EdgeVirtualPixelMethod,\n      MirrorVirtualPixelMethod,\n      TileVirtualPixelMethod\n    } VirtualPixelMethod;\n\n  /*\n    Typedef declaractions.\n  */\n  typedef _CacheInfoPtr_ Cache;\n\n  /*****\n   *\n   * Default View interfaces\n   *\n   *****/\n\n  /*\n    Read only access to a rectangular pixel region.\n  */\n  MagickExport const PixelPacket\n  *AcquireImagePixels(const Image *image,const long x,const long y,\n                      const unsigned long columns,\n                      const unsigned long rows,ExceptionInfo *exception);\n\n  /*\n    AccessImmutableIndexes() returns the read-only indexes\n    associated with a rectangular pixel region already selected via\n    AcquireImagePixels().\n  */\n  extern MagickExport const IndexPacket\n  *AccessImmutableIndexes(const Image *image);\n\n  /*\n    Return one DirectClass pixel at the the specified (x,y) location.\n    Similar function as GetOnePixel().  Note that the value returned\n    by GetIndexes() may or may not be influenced by this function.\n  */\n  extern MagickExport PixelPacket\n  AcquireOnePixel(const Image *image,const long x,const long y,\n                  ExceptionInfo *exception);\n\n\n  /*\n    GetImagePixels() and GetImagePixelsEx() obtains a pixel region for\n    read/write access.\n  */\n  extern MagickExport PixelPacket\n  *GetImagePixels(Image *image,const long x,const long y,\n                  const unsigned long columns,const unsigned long rows);\n  extern MagickExport PixelPacket\n  *GetImagePixelsEx(Image *image,const long x,const long y,\n                    const unsigned long columns,const unsigned long rows,\n                    ExceptionInfo *exception);\n\n  /*\n    GetImageVirtualPixelMethod() gets the \"virtual pixels\" method for\n    the image.\n  */\n  extern MagickExport VirtualPixelMethod\n  GetImageVirtualPixelMethod(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    GetPixels() and AccessMutablePixels() return the pixels associated\n    with the last call to SetImagePixels() or GetImagePixels().\n  */\n  extern MagickExport PixelPacket\n  *GetPixels(const Image *image)\n    MAGICK_FUNC_DEPRECATED; /* Prefer AccessMutablePixels instead */\n  extern MagickExport PixelPacket\n  *AccessMutablePixels(Image *image);\n\n  /*\n    GetIndexes() and AccessMutableIndexes() return the colormap\n    indexes associated with the last call to SetImagePixels() or\n    GetImagePixels().\n  */\n  extern MagickExport IndexPacket\n  *GetIndexes(const Image *image)\n    MAGICK_FUNC_DEPRECATED; /* Prefer AccessMutableIndexes() instead */\n  extern MagickExport IndexPacket\n  *AccessMutableIndexes(Image *image);\n\n  /*\n    GetOnePixel() returns a single DirectClass pixel at the specified\n    (x,y) location.  Similar to AcquireOnePixel().  It is preferred to\n    use AcquireOnePixel() since it allows reporting to a specified\n    exception structure. Note that the value returned by GetIndexes()\n    is not reliably influenced by this function.\n  */\n  extern MagickExport PixelPacket\n  GetOnePixel(Image *image,const long x,const long y)\n    MAGICK_FUNC_DEPRECATED; /* Prefer AcquireOnePixel() instead */\n\n  /*\n    GetPixelCacheArea() returns the area (width * height in pixels)\n    consumed by the current pixel cache.\n  */\n  extern MagickExport magick_off_t\n  GetPixelCacheArea(const Image *image);\n\n  /*\n    SetImagePixels() and SetImagePixelsEx() initialize a pixel region\n    for write-only access.\n  */\n  extern MagickExport PixelPacket\n  *SetImagePixels(Image *image,const long x,const long y,\n                  const unsigned long columns,const unsigned long rows);\n  extern MagickExport PixelPacket\n  *SetImagePixelsEx(Image *image,const long x,const long y,\n                    const unsigned long columns,const unsigned long rows,\n                    ExceptionInfo *exception);\n\n  /*\n    SetImageVirtualPixelMethod() sets the \"virtual pixels\" method for\n    the image.\n  */\n  extern MagickExport MagickPassFail\n  SetImageVirtualPixelMethod(const Image *image,\n                             const VirtualPixelMethod method);\n\n  /*\n    SyncImagePixels() and SyncImagePixelsEx() save the image pixels to\n    the in-memory or disk cache.\n  */\n  extern MagickExport MagickPassFail\n  SyncImagePixels(Image *image);\n  extern MagickExport MagickPassFail\n  SyncImagePixelsEx(Image *image,ExceptionInfo *exception);\n\n  /****\n   *\n   * Cache view interfaces\n   *\n   ****/\n\n  /*\n    OpenCacheView() opens a cache view.\n  */\n  extern MagickExport ViewInfo\n  *OpenCacheView(Image *image);\n\n  /*\n    CloseCacheView() closes a cache view.\n  */\n  extern MagickExport void\n  CloseCacheView(ViewInfo *view);\n\n\n  /*\n    AccessCacheViewPixels() returns the pixels associated with the\n    last request to select a view pixel region\n    (i.e. AcquireCacheViewPixels() or GetCacheViewPixels()).\n  */\n  extern MagickExport PixelPacket\n  *AccessCacheViewPixels(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    AcquireCacheViewIndexes() returns read-only indexes associated\n    with a cache view.\n  */\n  extern MagickExport const IndexPacket\n  *AcquireCacheViewIndexes(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    AcquireCacheViewPixels() obtains a pixel region from a cache view\n    for read-only access.\n  */\n  extern MagickExport const PixelPacket\n  *AcquireCacheViewPixels(ViewInfo *view,\n                          const long x,const long y,\n                          const unsigned long columns,\n                          const unsigned long rows,\n                          ExceptionInfo *exception);\n\n  /*\n    AcquireOneCacheViewPixel() returns one DirectClass pixel from a\n    cache view. Note that the value returned by GetCacheViewIndexes()\n    is not reliably influenced by this function.\n  */\n  extern MagickExport MagickPassFail\n  AcquireOneCacheViewPixel(ViewInfo *view,PixelPacket *pixel,\n                           const long x,const long y,ExceptionInfo *exception);\n\n  /*\n    GetCacheViewArea() returns the area (width * height in pixels)\n    currently consumed by the pixel cache view.\n  */\n  extern MagickExport magick_off_t\n  GetCacheViewArea(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    GetCacheViewImage() obtains the image used to allocate the cache view.\n  */\n  extern Image *\n  GetCacheViewImage(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    GetCacheViewIndexes() returns the indexes associated with a cache view.\n  */\n  extern MagickExport IndexPacket\n  *GetCacheViewIndexes(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    GetCacheViewPixels() obtains a pixel region from a cache view for\n    read/write access.\n  */\n  extern MagickExport PixelPacket\n  *GetCacheViewPixels(ViewInfo *view,const long x,const long y,\n                      const unsigned long columns,const unsigned long rows,\n                      ExceptionInfo *exception);\n\n  /*\n    Obtain the offset and size of the selected region.\n  */\n  extern MagickExport RectangleInfo\n  GetCacheViewRegion(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n\n  /*\n    SetCacheViewPixels() gets blank writeable pixels from the pixel\n    cache view.\n  */\n  extern MagickExport PixelPacket\n  *SetCacheViewPixels(ViewInfo *view,const long x,const long y,\n                      const unsigned long columns,const unsigned long rows,\n                      ExceptionInfo *exception);\n\n  /*\n    SyncCacheViewPixels() saves any changes to the pixel cache view.\n  */\n  extern MagickExport MagickPassFail\n  SyncCacheViewPixels(const ViewInfo *view,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n\n#include \"magick/pixel_cache-private.h\"\n\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_CACHE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/pixel_iterator.h",
    "content": "/*\n  Copyright (C) 2004-2016 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Interfaces to support simple iterative pixel read/update access within an\n  image or between two images.  These interfaces exist in order to eliminate\n  large amounts of redundant code and to allow changing the underlying\n  implementation without changing the using code. These interfaces\n  intentionally omit any pixel position information in order to not constrain\n  the implementation and to improve performance.\n\n  User-provided callbacks must be thread-safe (preferably re-entrant) since\n  they may be invoked by multiple threads.\n\n  These interfaces have proven to be future safe (since implemented) and may\n  be safely used by other applications/libraries.\n\n  Written by Bob Friesenhahn, March 2004, Updated for regions 2008.\n\n*/\n#ifndef _PIXEL_ROW_ITERATOR_H\n#define _PIXEL_ROW_ITERATOR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Pixel iterator options.\n  */\n  typedef struct _PixelIteratorOptions\n  {\n    int           max_threads; /* Desired number of threads */\n    unsigned long signature;\n  } PixelIteratorOptions;\n\n\n  /*\n    Initialize pixel iterator options with defaults.\n  */\n  extern MagickExport void\n  InitializePixelIteratorOptions(PixelIteratorOptions *options,\n                                 ExceptionInfo *exception);\n\n  /*\n    Read-only access across pixel region.\n  */\n\n  typedef MagickPassFail (*PixelIteratorMonoReadCallback)\n    (\n     void *mutable_data,                   /* User provided mutable data */\n     const void *immutable_data,       /* User provided immutable data */\n     const Image *const_image,          /* Input image */\n     const PixelPacket *pixels,         /* Pixel row */\n     const IndexPacket *indexes,        /* Pixel indexes */\n     const long npixels,                /* Number of pixels in row */\n     ExceptionInfo *exception           /* Exception report */\n     );\n\n  extern MagickExport MagickPassFail\n  PixelIterateMonoRead(PixelIteratorMonoReadCallback call_back,\n                       const PixelIteratorOptions *options,\n                       const char *description,\n                       void *mutable_data,\n                       const void *immutable_data,\n                       const long x,\n                       const long y,\n                       const unsigned long columns,\n                       const unsigned long rows,\n                       const Image *image,\n                       ExceptionInfo *exception);\n\n\n  typedef MagickPassFail (*PixelIteratorMonoModifyCallback)\n    (\n     void *mutable_data,                /* User provided mutable data */\n     const void *immutable_data,        /* User provided immutable data */\n     Image *image,                      /* Modify image */\n     PixelPacket *pixels,               /* Pixel row */\n     IndexPacket *indexes,              /* Pixel row indexes */\n     const long npixels,                /* Number of pixels in row */\n     ExceptionInfo *exception           /* Exception report */\n     );\n\n  /*\n    Write access across pixel region.\n  */\n  extern MagickExport MagickPassFail\n  PixelIterateMonoSet(PixelIteratorMonoModifyCallback call_back,\n                      const PixelIteratorOptions *options,\n                      const char *description,\n                      void *mutable_data,\n                      const void *immutable_data,\n                      const long x,\n                      const long y,\n                      const unsigned long columns,\n                      const unsigned long rows,\n                      Image *image,\n                      ExceptionInfo *exception);\n\n  /*\n    Read-write access across pixel region.\n  */\n  extern MagickExport MagickPassFail\n  PixelIterateMonoModify(PixelIteratorMonoModifyCallback call_back,\n                         const PixelIteratorOptions *options,\n                         const char *description,\n                         void *mutable_data,\n                         const void *immutable_data,\n                         const long x,\n                         const long y,\n                         const unsigned long columns,\n                         const unsigned long rows,\n                         Image *image,\n                         ExceptionInfo *exception);\n\n  /*\n    Read-only access across pixel regions of two images.\n  */\n\n  typedef MagickPassFail (*PixelIteratorDualReadCallback)\n    (\n     void *mutable_data,                /* User provided mutable data */\n     const void *immutable_data,        /* User provided immutable data */\n     const Image *first_image,          /* First Input image */\n     const PixelPacket *first_pixels,   /* Pixel row in first image */\n     const IndexPacket *first_indexes,  /* Pixel row indexes in first image */\n     const Image *second_image,         /* Second Input image */\n     const PixelPacket *second_pixels,  /* Pixel row in second image */\n     const IndexPacket *second_indexes, /* Pixel row indexes in second image */\n     const long npixels,                /* Number of pixels in row */\n     ExceptionInfo *exception           /* Exception report */\n     );\n\n  extern MagickExport MagickPassFail\n  PixelIterateDualRead(PixelIteratorDualReadCallback call_back,\n                       const PixelIteratorOptions *options,\n                       const char *description,\n                       void *mutable_data,\n                       const void *immutable_data,\n                       const unsigned long columns,\n                       const unsigned long rows,\n                       const Image *first_image,\n                       const long first_x,\n                       const long first_y,\n                       const Image *second_image,\n                       const long second_x,\n                       const long second_y,\n                       ExceptionInfo *exception);\n\n  /*\n    Read-write access across pixel regions of two images. The first\n    (source) image is accessed read-only while the second (update)\n    image is accessed as read-write.\n  */\n\n  typedef MagickPassFail (*PixelIteratorDualModifyCallback)\n    (\n     void *mutable_data,                /* User provided mutable data */\n     const void *immutable_data,        /* User provided immutable data */\n     const Image *source_image,         /* Source image */\n     const PixelPacket *source_pixels,  /* Pixel row in source image */\n     const IndexPacket *source_indexes, /* Pixel row indexes in source image */\n     Image *update_image,               /* Update image */\n     PixelPacket *update_pixels,        /* Pixel row in update image */\n     IndexPacket *update_indexes,       /* Pixel row indexes in update image */\n     const long npixels,                /* Number of pixels in row */\n     ExceptionInfo *exception           /* Exception report */\n     );\n\n  extern MagickExport MagickPassFail\n  PixelIterateDualModify(PixelIteratorDualModifyCallback call_back,\n                         const PixelIteratorOptions *options,\n                         const char *description,\n                         void *mutable_data,\n                         const void *immutable_data,\n                         const unsigned long columns,\n                         const unsigned long rows,\n                         const Image *source_image,\n                         const long source_x,\n                         const long source_y,\n                         Image *update_image,\n                         const long update_x,\n                         const long update_y,\n                         ExceptionInfo *exception);\n\n  /*\n    Read-write access across pixel regions of two images. The first\n    (source) image is accessed read-only while the second (new)\n    image is accessed for write (uninitialized pixels).\n  */\n  typedef PixelIteratorDualModifyCallback PixelIteratorDualNewCallback;\n\n  extern MagickExport MagickPassFail\n  PixelIterateDualNew(PixelIteratorDualNewCallback call_back,\n                      const PixelIteratorOptions *options,\n                      const char *description,\n                      void *mutable_data,\n                      const void *immutable_data,\n                      const unsigned long columns,\n                      const unsigned long rows,\n                      const Image *source_image,\n                      const long source_x,\n                      const long source_y,\n                      Image *new_image,\n                      const long new_x,\n                      const long new_y,\n                      ExceptionInfo *exception);\n\n  /*\n    Read-read-write access across pixel regions of three images. The\n    first two images are accessed read-only while the third is\n    accessed as read-write.\n  */\n\n  typedef MagickPassFail (*PixelIteratorTripleModifyCallback)\n    (\n     void *mutable_data,                 /* User provided mutable data */\n     const void *immutable_data,         /* User provided immutable data */\n     const Image *source1_image,         /* Source 1 image */\n     const PixelPacket *source1_pixels,  /* Pixel row in source 1 image */\n     const IndexPacket *source1_indexes, /* Pixel row indexes in source 1 image */\n     const Image *source2_image,         /* Source 2 image */\n     const PixelPacket *source2_pixels,  /* Pixel row in source 2 image */\n     const IndexPacket *source2_indexes, /* Pixel row indexes in source 2 image */\n     Image *update_image,                /* Update image */\n     PixelPacket *update_pixels,         /* Pixel row in update image */\n     IndexPacket *update_indexes,        /* Pixel row indexes in update image */\n     const long npixels,                 /* Number of pixels in row */\n     ExceptionInfo *exception            /* Exception report */\n     );\n\n  extern MagickExport MagickPassFail\n  PixelIterateTripleModify(PixelIteratorTripleModifyCallback call_back,\n                           const PixelIteratorOptions *options,\n                           const char *description,\n                           void *mutable_data,\n                           const void *immutable_data,\n                           const unsigned long columns,\n                           const unsigned long rows,\n                           const Image *source1_image,\n                           const Image *source2_image,\n                           const long source_x,\n                           const long source_y,\n                           Image *update_image,\n                           const long update_x,\n                           const long update_y,\n                           ExceptionInfo *exception);\n\n  /*\n    Read-write access across pixel regions of two images. The first\n    (source) image is accessed read-only while the second (new)\n    image is accessed for write (uninitialized pixels).\n  */\n  typedef PixelIteratorTripleModifyCallback PixelIteratorTripleNewCallback;\n\n  extern MagickExport MagickPassFail\n  PixelIterateTripleNew(PixelIteratorTripleNewCallback call_back,\n                        const PixelIteratorOptions *options,\n                        const char *description,\n                        void *mutable_data,\n                        const void *immutable_data,\n                        const unsigned long columns,\n                        const unsigned long rows,\n                        const Image *source1_image,\n                        const Image *source2_image,\n                        const long source_x,\n                        const long source_y,\n                        Image *new_image,\n                        const long new_x,\n                        const long new_y,\n                        ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _PIXEL_ROW_ITERATOR_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/plasma.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Plasma Methods.\n*/\n#ifndef _MAGICK_PLASMA_H\n#define _MAGICK_PLASMA_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n\f\nextern MagickExport MagickPassFail\nPlasmaImage(Image *image,const SegmentInfo *segment,\n            unsigned long attenuate,unsigned long depth);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_PLASMA_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/profile.h",
    "content": "/*\n  Copyright (C) 2004 - 2009 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Methods For Manipulating Embedded Image Profiles.\n*/\n#ifndef _MAGICK_PROFILE_H\n#define _MAGICK_PROFILE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Retrieve a profile from the image by name.\n*/\nextern MagickExport const unsigned char\n  *GetImageProfile(const Image* image, const char *name, size_t *length);\n\n/*\n  Remove a profile from the image by name.\n*/\nextern MagickExport MagickPassFail\n  DeleteImageProfile(Image *image,const char *name);\n\n/*\n  Apply (or add) a profile to the image.\n*/\nextern MagickExport MagickPassFail\n  ProfileImage(Image *image,const char *name,unsigned char *profile,\n               const size_t length,MagickBool clone);\n\n/*\n  Add (or replace) profile to the image by name.\n*/\nextern MagickExport MagickPassFail\n  SetImageProfile(Image *image,const char *name,const unsigned char *profile,\n                  const size_t length);\n\n/*\n  Add (or append) profile to the image by name.\n */\n  extern MagickExport MagickPassFail\n  AppendImageProfile(Image *image,const char *name,\n                     const unsigned char *profile_chunk,\n                     const size_t chunk_length);\n\n/*\n  Generic iterator for traversing profiles.\n*/\ntypedef void *ImageProfileIterator;\n\n/*\n  Allocate an image profile iterator which points to one before the\n  list so NextImageProfile() must be used to advance to first entry.\n*/\nextern MagickExport ImageProfileIterator\n  AllocateImageProfileIterator(const Image *image);\n\n/*\n  Advance to next image profile.  Name, profile, and length are\n  updated with information on current profile. MagickFail is returned\n  when there are no more entries.\n*/\nextern MagickExport MagickPassFail\n  NextImageProfile(ImageProfileIterator profile_iterator,const char **name,\n                   const unsigned char **profile,size_t *length);\n\n/*\n  Deallocate profile iterator.\n*/\nextern MagickExport void\n  DeallocateImageProfileIterator(ImageProfileIterator profile_iterator);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_PROFILE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/quantize.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Methods to Reduce the Number of Unique Colors in an Image.\n*/\n#ifndef _MAGICK_QUANTIZE_H\n#define _MAGICK_QUANTIZE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Define declarations.\n*/\n#define MaxTreeDepth  8\n#define NodesInAList  1536\n\f\n/*\n  Typedef declarations.\n*/\ntypedef struct _QuantizeInfo\n{\n  unsigned long\n    number_colors;\n\n  unsigned int\n    tree_depth,\n    dither;\n\n  ColorspaceType\n    colorspace;\n\n  unsigned int\n    measure_error;\n\n  unsigned long\n    signature;\n} QuantizeInfo;\n\f\n/*\n  Quantization utilities methods.\n*/\nextern MagickExport QuantizeInfo\n  *CloneQuantizeInfo(const QuantizeInfo *);\n\nextern MagickExport unsigned int\n  GetImageQuantizeError(Image *),\n  MapImage(Image *,const Image *,const unsigned int),\n  MapImages(Image *,const Image *,const unsigned int),\n  OrderedDitherImage(Image *),\n  QuantizeImage(const QuantizeInfo *,Image *),\n  QuantizeImages(const QuantizeInfo *,Image *),\n  SegmentImage(Image *,const ColorspaceType,const unsigned int,const double,\n    const double);\n\nextern MagickExport void\n  CompressImageColormap(Image *),\n  DestroyQuantizeInfo(QuantizeInfo *),\n  GetQuantizeInfo(QuantizeInfo *),\n  GrayscalePseudoClassImage(Image *,unsigned int);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/random.h",
    "content": "/*\n  Copyright (C) 2009, 2014 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Random number generator (semi-public interfaces).\n\n  Currently based on George Marsaglia's multiply-with-carry generator.\n  This is a k=2 generator with a period >2^60.\n*/\n\n#ifndef _MAGICK_RANDOM_H\n#define _MAGICK_RANDOM_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\ntypedef struct _MagickRandomKernel\n{\n  magick_uint32_t z;\n  magick_uint32_t w;\n} MagickRandomKernel;\n\n#define MAGICK_RANDOM_MAX 4294967295\n\n  /*\n    Generate a random integer value (0 - MAGICK_RANDOM_MAX)\n  */\n  MagickExport magick_uint32_t MagickRandomInteger(void);\n\n  /*\n    Generate a random double value (0.0 - 1.0)\n  */\n  MagickExport double MagickRandomReal(void);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#include \"magick/random-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* ifndef _MAGICK_RANDOM_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/registry.h",
    "content": "/*\n  Copyright (C) 2003-2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Magick registry methods.\n*/\n#ifndef _MAGICK_REGISTRY_H\n#define _MAGICK_REGISTRY_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UndefinedRegistryType,\n  ImageRegistryType,\n  ImageInfoRegistryType\n} RegistryType;\n\f\n/*\n  Magick registry methods.\n*/\nextern MagickExport Image\n  *GetImageFromMagickRegistry(const char *name,long *id,\n     ExceptionInfo *exception);\n\nextern MagickExport long\n  SetMagickRegistry(const RegistryType type,const void *blob,\n    const size_t length,ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  DeleteMagickRegistry(const long id);\n\nextern MagickExport void\n  *GetMagickRegistry(const long id,RegistryType *type,size_t *length,\n     ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/registry-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/render.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Drawing methods.\n*/\n#ifndef _MAGICK_RENDER_H\n#define _MAGICK_RENDER_H\n\n#include \"magick/type.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UndefinedAlign,\n  LeftAlign,\n  CenterAlign,\n  RightAlign\n} AlignType;\n\ntypedef enum\n{\n  UserSpace,\n  UserSpaceOnUse,\n  ObjectBoundingBox\n} ClipPathUnits;\n\ntypedef enum\n{\n  NoDecoration,\n  UnderlineDecoration,\n  OverlineDecoration,\n  LineThroughDecoration\n} DecorationType;\n\ntypedef enum\n{\n  UndefinedRule,\n#undef EvenOddRule\n  EvenOddRule,\n  NonZeroRule\n} FillRule;\n\ntypedef enum\n{\n  UndefinedGradient,\n  LinearGradient,\n  RadialGradient\n} GradientType;\n\ntypedef enum\n{\n  UndefinedCap,\n  ButtCap,\n  RoundCap,\n  SquareCap\n} LineCap;\n\ntypedef enum\n{\n  UndefinedJoin,\n  MiterJoin,\n  RoundJoin,\n  BevelJoin\n} LineJoin;\n\ntypedef enum\n{\n  PointMethod = 0,\n  ReplaceMethod,\n  FloodfillMethod,\n  FillToBorderMethod,\n  ResetMethod\n} PaintMethod;\n\ntypedef enum\n{\n  UndefinedPrimitive = 0,\n  PointPrimitive,\n  LinePrimitive,\n  RectanglePrimitive,\n  RoundRectanglePrimitive,\n  ArcPrimitive,\n  EllipsePrimitive,\n  CirclePrimitive,\n  PolylinePrimitive,\n  PolygonPrimitive,\n  BezierPrimitive,\n  ColorPrimitive,\n  MattePrimitive,\n  TextPrimitive,\n  ImagePrimitive,\n  PathPrimitive\n} PrimitiveType;\n\ntypedef enum\n{\n  UndefinedReference,\n  GradientReference\n} ReferenceType;\n\ntypedef enum\n{\n  UndefinedSpread,\n  PadSpread,\n  ReflectSpead,\n  RepeatSpread\n} SpreadMethod;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _GradientInfo\n{\n  GradientType\n    type;\n\n  PixelPacket\n    color;\n\n  SegmentInfo\n    stop;\n\n  unsigned long\n    length;\n\n  SpreadMethod\n    spread;\n\n  unsigned long\n    signature;\n\n  struct _GradientInfo\n    *previous,\n    *next;\n} GradientInfo;\n\ntypedef struct _ElementReference\n{\n  char\n    *id;\n\n  ReferenceType\n    type;\n\n  GradientInfo\n    gradient;\n\n  unsigned long\n    signature;\n\n  struct _ElementReference\n    *previous,\n    *next;\n} ElementReference;\n\nstruct _DrawInfoExtra;  /* forward decl.; see member \"extra\" below */\n\ntypedef struct _DrawInfo\n{\n  char\n    *primitive,\n    *geometry;\n\n  AffineMatrix\n    affine;\n\n  GravityType\n    gravity;\n\n  PixelPacket\n    fill,\n    stroke;\n\n  double\n    stroke_width;\n\n  GradientInfo\n    gradient;\n\n  Image\n    *fill_pattern,\n    *tile,\n    *stroke_pattern;\n\n  unsigned int\n    stroke_antialias,\n    text_antialias;\n\n  FillRule\n    fill_rule;\n\n  LineCap\n    linecap;\n\n  LineJoin\n    linejoin;\n\n  unsigned long\n    miterlimit;\n\n  double\n    dash_offset;\n\n  DecorationType\n    decorate;\n\n  CompositeOperator\n    compose;\n\n  char\n    *text,\n    *font,\n    *family;\n\n  StyleType\n    style;\n\n  StretchType\n    stretch;\n\n  unsigned long\n    weight;\n\n  char\n    *encoding;\n\n  double\n    pointsize;\n\n  char\n    *density;\n\n  AlignType\n    align;\n\n  PixelPacket\n    undercolor,\n    border_color;\n\n  char\n    *server_name;\n\n  double\n    *dash_pattern; /* Terminated by value 0.0 (i.e. < MagickEpsilon)*/\n\n#if 0\n  char\n    *clip_path;\n#endif\n  /*\n    Allow for expansion of DrawInfo without increasing its size.  The\n    internals are defined only in render.c.  Clients outside of render.c\n    can access the internals via the provided access functions (see below).\n\n    This location in DrawInfo used to be occupied by char *clip_path. The\n    clip_path member now lives in _DrawInfoExtra.\n  */\n  struct _DrawInfoExtra\n    *extra;\n\n  SegmentInfo\n    bounds;\n\n  ClipPathUnits\n    clip_units;\n\n  Quantum\n    opacity;\n\n  unsigned int\n    render,\n    /*\n      Bit fields in flags:\n\n        Bit 0: should this DrawInfo should be drawn as:\n          0:  normal (original behavior)\n          1:  SVG compliant\n        Bit 1: is the DrawInfo a clipping path:\n          0:  is not a clipping path\n          1:  is a clipping path\n\n      Access to these bits should be through functions (defined in render.c):\n        IsDrawInfoClippingPath()\n        IsDrawInfoSVGCompliant()\n        IsDrawInfoSVGCompliantClippingPath()\n        SetDrawInfoClippingPath()\n        SetDrawInfoSVGCompliant()\n\n      At the present time the SVG compliance bit only affects how clipping paths are drawn.\n    */\n    flags;  /* previously \"unused1\" */\n\n  ElementReference\n    element_reference;\n\n  unsigned long\n    signature;\n} DrawInfo;\n\ntypedef struct _PointInfo\n{\n  double\n    x,\n    y;\n} PointInfo;\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/render-private.h\"\n#endif /* if defined(MAGICK_IMPLEMENTATION) */\n\ntypedef struct _TypeMetric\n{\n  PointInfo\n    pixels_per_em;\n\n  double\n    ascent,\n    descent,\n    width,\n    height,\n    max_advance;\n\n  SegmentInfo\n    bounds;\n\n  double\n    underline_position,\n    underline_thickness;\n} TypeMetric;\n\f\n/*\n  Method declarations.\n*/\nextern MagickExport DrawInfo\n  *CloneDrawInfo(const ImageInfo *,const DrawInfo *);\n\nextern MagickExport MagickPassFail\n  AnnotateImage(Image *,const DrawInfo *),\n  DrawAffineImage(Image *,const Image *,const AffineMatrix *),\n  DrawClipPath(Image *,const DrawInfo *,const char *),\n  DrawImage(Image *,const DrawInfo *),\n  DrawPatternPath(Image *,const DrawInfo *,const char *,Image **),\n  GetTypeMetrics(Image *,const DrawInfo *,TypeMetric *);\n\nextern MagickExport void\n  DestroyDrawInfo(DrawInfo *),\n  GetDrawInfo(const ImageInfo *,DrawInfo *);\n\n/* provide public access to the clip_path member of DrawInfo */\nextern MagickExport char\n  **DrawInfoGetClipPath(const DrawInfo *) MAGICK_FUNC_PURE;\n\n/* provide public access to the composite_path member of DrawInfo */\nextern MagickExport char\n  **DrawInfoGetCompositePath(const DrawInfo *) MAGICK_FUNC_PURE;\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_RENDER_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/resize.h",
    "content": "/*\n  Copyright (C) 2003 - 2012 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Resize Methods.\n*/\n#ifndef _MAGICK_RESIZE_H\n#define _MAGICK_RESIZE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#define DefaultResizeFilter LanczosFilter\n#define DefaultThumbnailFilter BoxFilter\n\nextern MagickExport Image\n  *MagnifyImage(const Image *,ExceptionInfo *),\n  *MinifyImage(const Image *,ExceptionInfo *),\n  *ResizeImage(const Image *,const unsigned long,const unsigned long,\n     const FilterTypes,const double,ExceptionInfo *),\n  *SampleImage(const Image *,const unsigned long,const unsigned long,\n   ExceptionInfo *),\n  *ScaleImage(const Image *,const unsigned long,const unsigned long,\n     ExceptionInfo *),\n  *ThumbnailImage(const Image *,const unsigned long,const unsigned long,\n   ExceptionInfo *),\n  *ZoomImage(const Image *,const unsigned long,const unsigned long,\n     ExceptionInfo *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_RESIZE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/resource.h",
    "content": "/*\n  Copyright (C) 2003 - 2015 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Resource methods.\n*/\n#ifndef _MAGICK_RESOURCE_H\n#define _MAGICK_RESOURCE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Typedef declarations.\n*/\ntypedef enum\n{\n  UndefinedResource=0, /* Undefined value */\n  DiskResource,        /* Pixel cache total disk space (Gigabytes) */\n  FileResource,        /* Pixel cache number of open files (Files) */\n  MapResource,         /* Pixel cache total file memory-mapping (Megabytes) */\n  MemoryResource,      /* Maximum pixel cache heap memory allocations (Megabytes) */\n  PixelsResource,      /* Maximum number of pixels in single image (Pixels) */\n  ThreadsResource,     /* Maximum number of worker threads */\n  WidthResource,       /* Maximum pixel width of an image (Pixels) */\n  HeightResource       /* Maximum pixel height of an image (Pixels) */\n} ResourceType;\n\n/*\n  Method declarations.\n*/\nextern MagickExport MagickPassFail\n  AcquireMagickResource(const ResourceType type,const magick_uint64_t size),\n  ListMagickResourceInfo(FILE *file,ExceptionInfo *exception),\n  SetMagickResourceLimit(const ResourceType type,const magick_int64_t limit);\n\nextern MagickExport magick_int64_t\n  GetMagickResource(const ResourceType type),\n  GetMagickResourceLimit(const ResourceType type);\n\nextern MagickExport void\n  DestroyMagickResources(void),\n  InitializeMagickResources(void),\n  LiberateMagickResource(const ResourceType type,const magick_uint64_t size);\n\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/shear.h",
    "content": "/*\n  Copyright (C) 2003-2012 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Shear Methods.\n*/\n#ifndef _MAGICK_SHEAR_H\n#define _MAGICK_SHEAR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *AffineTransformImage(const Image *,const AffineMatrix *,ExceptionInfo *),\n  *AutoOrientImage(const Image *image,const OrientationType current_orientation,\n                   ExceptionInfo *exception),\n  *RotateImage(const Image *,const double,ExceptionInfo *),\n  *ShearImage(const Image *,const double,const double,ExceptionInfo *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_SHEAR_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/signature.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Digital signature methods.\n*/\n#ifndef _MAGICK_SIGNATURE_H\n#define _MAGICK_SIGNATURE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Define declarations.\n*/\n#define SignatureSize  64\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _SignatureInfo\n{\n  unsigned long\n    digest[8],\n    low_order,\n    high_order;\n\n  long\n    offset;\n\n  unsigned char\n    message[SignatureSize];\n} SignatureInfo;\n\n/*\n  Method declarations.\n*/\nextern MagickExport unsigned int\n  SignatureImage(Image *);\n\nextern MagickExport void\n  FinalizeSignature(SignatureInfo *),\n  GetSignatureInfo(SignatureInfo *),\n  TransformSignature(SignatureInfo *),\n  UpdateSignature(SignatureInfo *,const unsigned char *,const size_t);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/statistics.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Statistics Methods.\n*/\n#ifndef _MAGICK_STATISTICS_H\n#define _MAGICK_STATISTICS_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\ntypedef struct _ImageChannelStatistics\n {\n   /* Minimum value observed */\n   double maximum;\n   /* Maximum value observed */\n   double minimum;\n   /* Average (mean) value observed */\n   double mean;\n   /* Standard deviation, sqrt(variance) */\n   double standard_deviation;\n   /* Variance */\n   double variance;\n } ImageChannelStatistics;\n\ntypedef struct _ImageStatistics\n {\n   ImageChannelStatistics red;\n   ImageChannelStatistics green;\n   ImageChannelStatistics blue;\n   ImageChannelStatistics opacity;\n } ImageStatistics;\n\nextern MagickExport MagickPassFail\n  GetImageStatistics(const Image *image,ImageStatistics *statistics,\n                     ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_STATISTICS_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/symbols.h",
    "content": "/*\n  Copyright (C) 2012-2018 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Library symbol name-scoping support.\n*/\n\n#if !defined(_MAGICK_SYMBOLS_H)\n#define _MAGICK_SYMBOLS_H\n\n#if defined(PREFIX_MAGICK_SYMBOLS)\n\n#define AccessCacheViewPixels GmAccessCacheViewPixels\n#define AccessDefaultCacheView GmAccessDefaultCacheView\n#define AccessDefinition GmAccessDefinition\n#define AccessImmutableIndexes GmAccessImmutableIndexes\n#define AccessMutableIndexes GmAccessMutableIndexes\n#define AccessMutablePixels GmAccessMutablePixels\n#define AccessThreadViewData GmAccessThreadViewData\n#define AccessThreadViewDataById GmAccessThreadViewDataById\n#define AcquireCacheView GmAcquireCacheView\n#define AcquireCacheViewIndexes GmAcquireCacheViewIndexes\n#define AcquireCacheViewPixels GmAcquireCacheViewPixels\n#define AcquireImagePixels GmAcquireImagePixels\n#define AcquireMagickRandomKernel GmAcquireMagickRandomKernel\n#define AcquireMagickResource GmAcquireMagickResource\n#define AcquireMemory GmAcquireMemory\n#define AcquireOneCacheViewPixel GmAcquireOneCacheViewPixel\n#define AcquireOnePixel GmAcquireOnePixel\n#define AcquireOnePixelByReference GmAcquireOnePixelByReference\n#define AcquireSemaphoreInfo GmAcquireSemaphoreInfo\n#define AcquireString GmAcquireString\n#define AcquireTemporaryFileDescriptor GmAcquireTemporaryFileDescriptor\n#define AcquireTemporaryFileName GmAcquireTemporaryFileName\n#define AcquireTemporaryFileStream GmAcquireTemporaryFileStream\n#define AdaptiveThresholdImage GmAdaptiveThresholdImage\n#define AddDefinition GmAddDefinition\n#define AddDefinitions GmAddDefinitions\n#define AddNoiseImage GmAddNoiseImage\n#define AddNoiseImageChannel GmAddNoiseImageChannel\n#define AffineTransformImage GmAffineTransformImage\n#define AllocateImage GmAllocateImage\n#define AllocateImageColormap GmAllocateImageColormap\n#define AllocateImageProfileIterator GmAllocateImageProfileIterator\n#define AllocateNextImage GmAllocateNextImage\n#define AllocateSemaphoreInfo GmAllocateSemaphoreInfo\n#define AllocateString GmAllocateString\n#define AllocateThreadViewDataArray GmAllocateThreadViewDataArray\n#define AllocateThreadViewDataSet GmAllocateThreadViewDataSet\n#define AllocateThreadViewSet GmAllocateThreadViewSet\n#define AnalyzeImage GmAnalyzeImage\n#define AnimateImageCommand GmAnimateImageCommand\n#define AnimateImages GmAnimateImages\n#define AnnotateImage GmAnnotateImage\n#define AppendImageFormat GmAppendImageFormat\n#define AppendImageProfile GmAppendImageProfile\n#define AppendImageToList GmAppendImageToList\n#define AppendImages GmAppendImages\n#define Ascii85Encode GmAscii85Encode\n#define Ascii85Flush GmAscii85Flush\n#define Ascii85Initialize GmAscii85Initialize\n#define Ascii85WriteByteHook GmAscii85WriteByteHook\n#define AssignThreadViewData GmAssignThreadViewData\n#define AttachBlob GmAttachBlob\n#define AutoOrientImage GmAutoOrientImage\n#define AverageImages GmAverageImages\n#define Base64Decode GmBase64Decode\n#define Base64Encode GmBase64Encode\n#define BenchmarkImageCommand GmBenchmarkImageCommand\n#define BlackThresholdImage GmBlackThresholdImage\n#define BlobIsSeekable GmBlobIsSeekable\n#define BlobModeToString GmBlobModeToString\n#define BlobReserveSize GmBlobReserveSize\n#define BlobToFile GmBlobToFile\n#define BlobToImage GmBlobToImage\n#define BlobWriteByteHook GmBlobWriteByteHook\n#define BlurImage GmBlurImage\n#define BlurImageChannel GmBlurImageChannel\n#define BorderImage GmBorderImage\n#define CatchException GmCatchException\n#define CatchImageException GmCatchImageException\n#define CdlImage GmCdlImage\n#define ChannelImage GmChannelImage\n#define ChannelThresholdImage GmChannelThresholdImage\n#define ChannelTypeToString GmChannelTypeToString\n#define CharcoalImage GmCharcoalImage\n#define CheckImagePixelLimits GmCheckImagePixelLimits\n#define ChopImage GmChopImage\n#define ClassTypeToString GmClassTypeToString\n#define ClipImage GmClipImage\n#define ClipPathImage GmClipPathImage\n#define CloneBlobInfo GmCloneBlobInfo\n#define CloneDrawInfo GmCloneDrawInfo\n#define CloneImage GmCloneImage\n#define CloneImageAttributes GmCloneImageAttributes\n#define CloneImageInfo GmCloneImageInfo\n#define CloneImageList GmCloneImageList\n#define CloneMemory GmCloneMemory\n#define CloneMontageInfo GmCloneMontageInfo\n#define CloneQuantizeInfo GmCloneQuantizeInfo\n#define CloneString GmCloneString\n#define CloseBlob GmCloseBlob\n#define CloseCacheView GmCloseCacheView\n#define CoalesceImages GmCoalesceImages\n#define ColorFloodfillImage GmColorFloodfillImage\n#define ColorMatrixImage GmColorMatrixImage\n#define ColorizeImage GmColorizeImage\n#define ColorspaceTypeToString GmColorspaceTypeToString\n#define CompareImageCommand GmCompareImageCommand\n#define CompositeImage GmCompositeImage\n#define CompositeImageCommand GmCompositeImageCommand\n#define CompositeImageRegion GmCompositeImageRegion\n#define CompositeMaskImage GmCompositeMaskImage\n#define CompositeOperatorToString GmCompositeOperatorToString\n#define CompositePathImage GmCompositePathImage\n#define CompressImageColormap GmCompressImageColormap\n#define CompressionTypeToString GmCompressionTypeToString\n#define ConcatenateString GmConcatenateString\n#define ConfirmAccessModeToString GmConfirmAccessModeToString\n#define ConjureImageCommand GmConjureImageCommand\n#define ConstituteImage GmConstituteImage\n#define ConstituteTextureImage GmConstituteTextureImage\n#define ContinueTimer GmContinueTimer\n#define Contrast GmContrast\n#define ContrastImage GmContrastImage\n#define ConvertImageCommand GmConvertImageCommand\n#define ConvolveImage GmConvolveImage\n#define CopyException GmCopyException\n#define CropImage GmCropImage\n#define CycleColormapImage GmCycleColormapImage\n#define DeallocateImageProfileIterator GmDeallocateImageProfileIterator\n#define DeconstructImages GmDeconstructImages\n#define DefineClientName GmDefineClientName\n#define DefineClientPathAndName GmDefineClientPathAndName\n#define DeleteImageFromList GmDeleteImageFromList\n#define DeleteImageProfile GmDeleteImageProfile\n#define DeleteMagickRegistry GmDeleteMagickRegistry\n#define DescribeImage GmDescribeImage\n#define DespeckleImage GmDespeckleImage\n#define DestroyBlob GmDestroyBlob\n#define DestroyBlobInfo GmDestroyBlobInfo\n#define DestroyCacheInfo GmDestroyCacheInfo\n#define DestroyColorInfo GmDestroyColorInfo\n#define DestroyConstitute GmDestroyConstitute\n#define DestroyDelegateInfo GmDestroyDelegateInfo\n#define DestroyDrawInfo GmDestroyDrawInfo\n#define DestroyExceptionInfo GmDestroyExceptionInfo\n#define DestroyImage GmDestroyImage\n#define DestroyImageAttributes GmDestroyImageAttributes\n#define DestroyImageInfo GmDestroyImageInfo\n#define DestroyImageList GmDestroyImageList\n#define DestroyImagePixels GmDestroyImagePixels\n#define DestroyLogInfo GmDestroyLogInfo\n#define DestroyMagicInfo GmDestroyMagicInfo\n#define DestroyMagick GmDestroyMagick\n#define DestroyMagickExceptionHandling GmDestroyMagickExceptionHandling\n#define DestroyMagickModules GmDestroyMagickModules\n#define DestroyMagickMonitor GmDestroyMagickMonitor\n#define DestroyMagickRandomGenerator GmDestroyMagickRandomGenerator\n#define DestroyMagickRegistry GmDestroyMagickRegistry\n#define DestroyMagickResources GmDestroyMagickResources\n#define DestroyMontageInfo GmDestroyMontageInfo\n#define DestroyQuantizeInfo GmDestroyQuantizeInfo\n#define DestroySemaphore GmDestroySemaphore\n#define DestroySemaphoreInfo GmDestroySemaphoreInfo\n#define DestroyTemporaryFiles GmDestroyTemporaryFiles\n#define DestroyThreadViewDataSet GmDestroyThreadViewDataSet\n#define DestroyThreadViewSet GmDestroyThreadViewSet\n#define DestroyTypeInfo GmDestroyTypeInfo\n#define DetachBlob GmDetachBlob\n#define DifferenceImage GmDifferenceImage\n#define DisassociateBlob GmDisassociateBlob\n#define DispatchImage GmDispatchImage\n#define DisplayImageCommand GmDisplayImageCommand\n#define DisplayImages GmDisplayImages\n#define DrawAffine GmDrawAffine\n#define DrawAffineImage GmDrawAffineImage\n#define DrawAllocateContext GmDrawAllocateContext\n#define DrawAnnotation GmDrawAnnotation\n#define DrawArc GmDrawArc\n#define DrawBezier GmDrawBezier\n#define DrawCircle GmDrawCircle\n#define DrawClipPath GmDrawClipPath\n#define DrawColor GmDrawColor\n#define DrawComment GmDrawComment\n#define DrawComposite GmDrawComposite\n#define DrawCompositeMask GmDrawCompositeMask\n#define DrawDestroyContext GmDrawDestroyContext\n#define DrawEllipse GmDrawEllipse\n#define DrawGetClipPath GmDrawGetClipPath\n#define DrawGetClipRule GmDrawGetClipRule\n#define DrawGetClipUnits GmDrawGetClipUnits\n#define DrawGetFillColor GmDrawGetFillColor\n#define DrawGetFillOpacity GmDrawGetFillOpacity\n#define DrawGetFillRule GmDrawGetFillRule\n#define DrawGetFont GmDrawGetFont\n#define DrawGetFontFamily GmDrawGetFontFamily\n#define DrawGetFontSize GmDrawGetFontSize\n#define DrawGetFontStretch GmDrawGetFontStretch\n#define DrawGetFontStyle GmDrawGetFontStyle\n#define DrawGetFontWeight GmDrawGetFontWeight\n#define DrawGetGravity GmDrawGetGravity\n#define DrawGetStrokeAntialias GmDrawGetStrokeAntialias\n#define DrawGetStrokeColor GmDrawGetStrokeColor\n#define DrawGetStrokeDashArray GmDrawGetStrokeDashArray\n#define DrawGetStrokeDashOffset GmDrawGetStrokeDashOffset\n#define DrawGetStrokeLineCap GmDrawGetStrokeLineCap\n#define DrawGetStrokeLineJoin GmDrawGetStrokeLineJoin\n#define DrawGetStrokeMiterLimit GmDrawGetStrokeMiterLimit\n#define DrawGetStrokeOpacity GmDrawGetStrokeOpacity\n#define DrawGetStrokeWidth GmDrawGetStrokeWidth\n#define DrawGetTextAntialias GmDrawGetTextAntialias\n#define DrawGetTextDecoration GmDrawGetTextDecoration\n#define DrawGetTextEncoding GmDrawGetTextEncoding\n#define DrawGetTextUnderColor GmDrawGetTextUnderColor\n#define DrawImage GmDrawImage\n#define DrawInfoGetClipPath GmDrawInfoGetClipPath\n#define DrawInfoGetCompositePath GmDrawInfoGetCompositePath\n#define DrawLine GmDrawLine\n#define DrawMatte GmDrawMatte\n#define DrawPathClose GmDrawPathClose\n#define DrawPathCurveToAbsolute GmDrawPathCurveToAbsolute\n#define DrawPathCurveToQuadraticBezierAbsolute GmDrawPathCurveToQuadraticBezierAbsolute\n#define DrawPathCurveToQuadraticBezierRelative GmDrawPathCurveToQuadraticBezierRelative\n#define DrawPathCurveToQuadraticBezierSmoothAbsolute GmDrawPathCurveToQuadraticBezierSmoothAbsolute\n#define DrawPathCurveToQuadraticBezierSmoothRelative GmDrawPathCurveToQuadraticBezierSmoothRelative\n#define DrawPathCurveToRelative GmDrawPathCurveToRelative\n#define DrawPathCurveToSmoothAbsolute GmDrawPathCurveToSmoothAbsolute\n#define DrawPathCurveToSmoothRelative GmDrawPathCurveToSmoothRelative\n#define DrawPathEllipticArcAbsolute GmDrawPathEllipticArcAbsolute\n#define DrawPathEllipticArcRelative GmDrawPathEllipticArcRelative\n#define DrawPathFinish GmDrawPathFinish\n#define DrawPathLineToAbsolute GmDrawPathLineToAbsolute\n#define DrawPathLineToHorizontalAbsolute GmDrawPathLineToHorizontalAbsolute\n#define DrawPathLineToHorizontalRelative GmDrawPathLineToHorizontalRelative\n#define DrawPathLineToRelative GmDrawPathLineToRelative\n#define DrawPathLineToVerticalAbsolute GmDrawPathLineToVerticalAbsolute\n#define DrawPathLineToVerticalRelative GmDrawPathLineToVerticalRelative\n#define DrawPathMoveToAbsolute GmDrawPathMoveToAbsolute\n#define DrawPathMoveToRelative GmDrawPathMoveToRelative\n#define DrawPathStart GmDrawPathStart\n#define DrawPatternPath GmDrawPatternPath\n#define DrawPeekGraphicContext GmDrawPeekGraphicContext\n#define DrawPoint GmDrawPoint\n#define DrawPolygon GmDrawPolygon\n#define DrawPolyline GmDrawPolyline\n#define DrawPopClipPath GmDrawPopClipPath\n#define DrawPopDefs GmDrawPopDefs\n#define DrawPopGraphicContext GmDrawPopGraphicContext\n#define DrawPopPattern GmDrawPopPattern\n#define DrawPushClipPath GmDrawPushClipPath\n#define DrawPushDefs GmDrawPushDefs\n#define DrawPushGraphicContext GmDrawPushGraphicContext\n#define DrawPushPattern GmDrawPushPattern\n#define DrawRectangle GmDrawRectangle\n#define DrawRender GmDrawRender\n#define DrawRotate GmDrawRotate\n#define DrawRoundRectangle GmDrawRoundRectangle\n#define DrawScale GmDrawScale\n#define DrawSetClipPath GmDrawSetClipPath\n#define DrawSetClipRule GmDrawSetClipRule\n#define DrawSetClipUnits GmDrawSetClipUnits\n#define DrawSetFillColor GmDrawSetFillColor\n#define DrawSetFillColorString GmDrawSetFillColorString\n#define DrawSetFillOpacity GmDrawSetFillOpacity\n#define DrawSetFillPatternURL GmDrawSetFillPatternURL\n#define DrawSetFillRule GmDrawSetFillRule\n#define DrawSetFont GmDrawSetFont\n#define DrawSetFontFamily GmDrawSetFontFamily\n#define DrawSetFontSize GmDrawSetFontSize\n#define DrawSetFontStretch GmDrawSetFontStretch\n#define DrawSetFontStyle GmDrawSetFontStyle\n#define DrawSetFontWeight GmDrawSetFontWeight\n#define DrawSetGravity GmDrawSetGravity\n#define DrawSetStrokeAntialias GmDrawSetStrokeAntialias\n#define DrawSetStrokeColor GmDrawSetStrokeColor\n#define DrawSetStrokeColorString GmDrawSetStrokeColorString\n#define DrawSetStrokeDashArray GmDrawSetStrokeDashArray\n#define DrawSetStrokeDashOffset GmDrawSetStrokeDashOffset\n#define DrawSetStrokeLineCap GmDrawSetStrokeLineCap\n#define DrawSetStrokeLineJoin GmDrawSetStrokeLineJoin\n#define DrawSetStrokeMiterLimit GmDrawSetStrokeMiterLimit\n#define DrawSetStrokeOpacity GmDrawSetStrokeOpacity\n#define DrawSetStrokePatternURL GmDrawSetStrokePatternURL\n#define DrawSetStrokeWidth GmDrawSetStrokeWidth\n#define DrawSetTextAntialias GmDrawSetTextAntialias\n#define DrawSetTextDecoration GmDrawSetTextDecoration\n#define DrawSetTextEncoding GmDrawSetTextEncoding\n#define DrawSetTextUnderColor GmDrawSetTextUnderColor\n#define DrawSetTextUnderColorString GmDrawSetTextUnderColorString\n#define DrawSetViewbox GmDrawSetViewbox\n#define DrawSkewX GmDrawSkewX\n#define DrawSkewY GmDrawSkewY\n#define DrawTranslate GmDrawTranslate\n#define EOFBlob GmEOFBlob\n#define EdgeImage GmEdgeImage\n#define EmbossImage GmEmbossImage\n#define EndianTypeToString GmEndianTypeToString\n#define EnhanceImage GmEnhanceImage\n#define EqualizeImage GmEqualizeImage\n#define EscapeString GmEscapeString\n#define ExecuteModuleProcess GmExecuteModuleProcess\n#define ExpandAffine GmExpandAffine\n#define ExpandFilename GmExpandFilename\n#define ExpandFilenames GmExpandFilenames\n#define ExportImageChannel GmExportImageChannel\n#define ExportImagePixelArea GmExportImagePixelArea\n#define ExportPixelAreaOptionsInit GmExportPixelAreaOptionsInit\n#define ExportViewPixelArea GmExportViewPixelArea\n#define ExtentImage GmExtentImage\n#define FileToBlob GmFileToBlob\n#define FinalizeSignature GmFinalizeSignature\n#define FlattenImages GmFlattenImages\n#define FlipImage GmFlipImage\n#define FlopImage GmFlopImage\n#define FormatSize GmFormatSize\n#define FormatString GmFormatString\n#define FormatStringList GmFormatStringList\n#define FrameImage GmFrameImage\n#define FuzzyColorMatch GmFuzzyColorMatch\n#define GammaImage GmGammaImage\n#define GaussianBlurImage GmGaussianBlurImage\n#define GaussianBlurImageChannel GmGaussianBlurImageChannel\n#define GenerateDifferentialNoise GmGenerateDifferentialNoise\n#define GenerateNoise GmGenerateNoise\n#define GetBlobFileHandle GmGetBlobFileHandle\n#define GetBlobFirstErrno GmGetBlobFirstErrno\n#define GetBlobInfo GmGetBlobInfo\n#define GetBlobIsOpen GmGetBlobIsOpen\n#define GetBlobSize GmGetBlobSize\n#define GetBlobStatus GmGetBlobStatus\n#define GetBlobStreamData GmGetBlobStreamData\n#define GetBlobTemporary GmGetBlobTemporary\n#define GetCacheInfo GmGetCacheInfo\n#define GetCacheView GmGetCacheView\n#define GetCacheViewArea GmGetCacheViewArea\n#define GetCacheViewImage GmGetCacheViewImage\n#define GetCacheViewIndexes GmGetCacheViewIndexes\n#define GetCacheViewPixels GmGetCacheViewPixels\n#define GetCacheViewRegion GmGetCacheViewRegion\n#define GetClientFilename GmGetClientFilename\n#define GetClientName GmGetClientName\n#define GetClientPath GmGetClientPath\n#define GetColorHistogram GmGetColorHistogram\n#define GetColorInfo GmGetColorInfo\n#define GetColorInfoArray GmGetColorInfoArray\n#define GetColorList GmGetColorList\n#define GetColorTuple GmGetColorTuple\n#define GetConfigureBlob GmGetConfigureBlob\n#define GetDelegateCommand GmGetDelegateCommand\n#define GetDelegateInfo GmGetDelegateInfo\n#define GetDrawInfo GmGetDrawInfo\n#define GetElapsedTime GmGetElapsedTime\n#define GetExceptionInfo GmGetExceptionInfo\n#define GetExecutionPath GmGetExecutionPath\n#define GetExecutionPathUsingName GmGetExecutionPathUsingName\n#define GetFirstImageInList GmGetFirstImageInList\n#define GetGeometry GmGetGeometry\n#define GetImageAttribute GmGetImageAttribute\n#define GetImageBoundingBox GmGetImageBoundingBox\n#define GetImageChannelDepth GmGetImageChannelDepth\n#define GetImageChannelDifference GmGetImageChannelDifference\n#define GetImageChannelDistortion GmGetImageChannelDistortion\n#define GetImageCharacteristics GmGetImageCharacteristics\n#define GetImageClipMask GmGetImageClipMask\n#define GetImageClippingPathAttribute GmGetImageClippingPathAttribute\n#define GetImageCompositeMask GmGetImageCompositeMask\n#define GetImageDepth GmGetImageDepth\n#define GetImageDistortion GmGetImageDistortion\n#define GetImageException GmGetImageException\n#define GetImageFromList GmGetImageFromList\n#define GetImageFromMagickRegistry GmGetImageFromMagickRegistry\n#define GetImageGeometry GmGetImageGeometry\n#define GetImageIndexInList GmGetImageIndexInList\n#define GetImageInfo GmGetImageInfo\n#define GetImageInfoAttribute GmGetImageInfoAttribute\n#define GetImageListLength GmGetImageListLength\n#define GetImageMagick GmGetImageMagick\n#define GetImagePixels GmGetImagePixels\n#define GetImagePixelsEx GmGetImagePixelsEx\n#define GetImageProfile GmGetImageProfile\n#define GetImageQuantizeError GmGetImageQuantizeError\n#define GetImageStatistics GmGetImageStatistics\n#define GetImageType GmGetImageType\n#define GetImageVirtualPixelMethod GmGetImageVirtualPixelMethod\n#define GetIndexes GmGetIndexes\n#define GetLastImageInList GmGetLastImageInList\n#define GetLocaleExceptionMessage GmGetLocaleExceptionMessage\n#define GetLocaleMessage GmGetLocaleMessage\n#define GetLocaleMessageFromID GmGetLocaleMessageFromID\n#define GetMagickCopyright GmGetMagickCopyright\n#define GetMagickDimension GmGetMagickDimension\n#define GetMagickFileFormat GmGetMagickFileFormat\n#define GetMagickGeometry GmGetMagickGeometry\n#define GetMagickInfo GmGetMagickInfo\n#define GetMagickInfoArray GmGetMagickInfoArray\n#define GetMagickRegistry GmGetMagickRegistry\n#define GetMagickResource GmGetMagickResource\n#define GetMagickResourceLimit GmGetMagickResourceLimit\n#define GetMagickVersion GmGetMagickVersion\n#define GetMagickWebSite GmGetMagickWebSite\n#define GetMontageInfo GmGetMontageInfo\n#define GetNextImageInList GmGetNextImageInList\n#define GetNumberColors GmGetNumberColors\n#define GetOnePixel GmGetOnePixel\n#define GetOptimalKernelWidth GmGetOptimalKernelWidth\n#define GetOptimalKernelWidth1D GmGetOptimalKernelWidth1D\n#define GetOptimalKernelWidth2D GmGetOptimalKernelWidth2D\n#define GetPageGeometry GmGetPageGeometry\n#define GetPathComponent GmGetPathComponent\n#define GetPixelCacheArea GmGetPixelCacheArea\n#define GetPixelCacheInCore GmGetPixelCacheInCore\n#define GetPixelCachePresent GmGetPixelCachePresent\n#define GetPixels GmGetPixels\n#define GetPostscriptDelegateInfo GmGetPostscriptDelegateInfo\n#define GetPreviousImageInList GmGetPreviousImageInList\n#define GetQuantizeInfo GmGetQuantizeInfo\n#define GetSignatureInfo GmGetSignatureInfo\n#define GetThreadViewDataSetAllocatedViews GmGetThreadViewDataSetAllocatedViews\n#define GetTimerInfo GmGetTimerInfo\n#define GetTimerResolution GmGetTimerResolution\n#define GetToken GmGetToken\n#define GetTypeInfo GmGetTypeInfo\n#define GetTypeInfoByFamily GmGetTypeInfoByFamily\n#define GetTypeList GmGetTypeList\n#define GetTypeMetrics GmGetTypeMetrics\n#define GetUserTime GmGetUserTime\n#define GlobExpression GmGlobExpression\n#define GradientImage GmGradientImage\n#define GravityTypeToString GmGravityTypeToString\n#define GrayscalePseudoClassImage GmGrayscalePseudoClassImage\n#define HSLTransform GmHSLTransform\n#define HWBTransform GmHWBTransform\n#define HaldClutImage GmHaldClutImage\n#define HighlightStyleToString GmHighlightStyleToString\n#define HuffmanDecodeImage GmHuffmanDecodeImage\n#define HuffmanEncode2Image GmHuffmanEncode2Image\n#define HuffmanEncodeImage GmHuffmanEncodeImage\n#define Hull GmHull\n#define IdentifyImageCommand GmIdentifyImageCommand\n#define IdentityAffine GmIdentityAffine\n#define ImageGetClipMask GmImageGetClipMask\n#define ImageGetCompositeMask GmImageGetCompositeMask\n#define ImageListToArray GmImageListToArray\n#define ImageToBlob GmImageToBlob\n#define ImageToFile GmImageToFile\n#define ImageToHuffman2DBlob GmImageToHuffman2DBlob\n#define ImageToJPEGBlob GmImageToJPEGBlob\n#define ImageTypeToString GmImageTypeToString\n#define ImplodeImage GmImplodeImage\n#define ImportImageChannel GmImportImageChannel\n#define ImportImageChannelsMasked GmImportImageChannelsMasked\n#define ImportImageCommand GmImportImageCommand\n#define ImportImagePixelArea GmImportImagePixelArea\n#define ImportPixelAreaOptionsInit GmImportPixelAreaOptionsInit\n#define ImportViewPixelArea GmImportViewPixelArea\n#define InitializeColorInfo GmInitializeColorInfo\n#define InitializeConstitute GmInitializeConstitute\n#define InitializeDelegateInfo GmInitializeDelegateInfo\n#define InitializeDifferenceImageOptions GmInitializeDifferenceImageOptions\n#define InitializeDifferenceStatistics GmInitializeDifferenceStatistics\n#define InitializeLogInfo GmInitializeLogInfo\n#define InitializeLogInfoPost GmInitializeLogInfoPost\n#define InitializeMagicInfo GmInitializeMagicInfo\n#define InitializeMagick GmInitializeMagick\n#define InitializeMagickEx GmInitializeMagickEx\n#define InitializeMagickExceptionHandling GmInitializeMagickExceptionHandling\n#define InitializeMagickModules GmInitializeMagickModules\n#define InitializeMagickMonitor GmInitializeMagickMonitor\n#define InitializeMagickRandomGenerator GmInitializeMagickRandomGenerator\n#define InitializeMagickRandomKernel GmInitializeMagickRandomKernel\n#define InitializeMagickRegistry GmInitializeMagickRegistry\n#define InitializeMagickResources GmInitializeMagickResources\n#define InitializePixelIteratorOptions GmInitializePixelIteratorOptions\n#define InitializeSemaphore GmInitializeSemaphore\n#define InitializeTemporaryFiles GmInitializeTemporaryFiles\n#define InitializeTypeInfo GmInitializeTypeInfo\n#define InsertImageInList GmInsertImageInList\n#define InsertRowHDU GmInsertRowHDU\n#define InterlaceTypeToString GmInterlaceTypeToString\n#define InterpolateColor GmInterpolateColor\n#define InterpolateViewColor GmInterpolateViewColor\n#define InvokeDelegate GmInvokeDelegate\n#define InvokePostscriptDelegate GmInvokePostscriptDelegate\n#define IsAccessible GmIsAccessible\n#define IsAccessibleAndNotEmpty GmIsAccessibleAndNotEmpty\n#define IsAccessibleNoLogging GmIsAccessibleNoLogging\n#define IsEventLogging GmIsEventLogging\n#define IsGeometry GmIsGeometry\n#define IsGlob GmIsGlob\n#define IsGrayImage GmIsGrayImage\n#define IsImagesEqual GmIsImagesEqual\n#define IsMagickConflict GmIsMagickConflict\n#define IsMonochromeImage GmIsMonochromeImage\n#define IsOpaqueImage GmIsOpaqueImage\n#define IsPaletteImage GmIsPaletteImage\n#define IsSubimage GmIsSubimage\n#define IsTaintImage GmIsTaintImage\n#define IsWriteable GmIsWriteable\n#define LZWEncode2Image GmLZWEncode2Image\n#define LZWEncodeImage GmLZWEncodeImage\n#define LevelImage GmLevelImage\n#define LevelImageChannel GmLevelImageChannel\n#define LiberateMagickResource GmLiberateMagickResource\n#define LiberateMemory GmLiberateMemory\n#define LiberateSemaphoreInfo GmLiberateSemaphoreInfo\n#define LiberateTemporaryFile GmLiberateTemporaryFile\n#define ListColorInfo GmListColorInfo\n#define ListDelegateInfo GmListDelegateInfo\n#define ListFiles GmListFiles\n#define ListMagicInfo GmListMagicInfo\n#define ListMagickInfo GmListMagickInfo\n#define ListMagickResourceInfo GmListMagickResourceInfo\n#define ListModuleMap GmListModuleMap\n#define ListTypeInfo GmListTypeInfo\n#define LocaleCompare GmLocaleCompare\n#define LocaleLower GmLocaleLower\n#define LocaleNCompare GmLocaleNCompare\n#define LocaleUpper GmLocaleUpper\n#define LockSemaphoreInfo GmLockSemaphoreInfo\n#define MSBOrderLong GmMSBOrderLong\n#define MSBOrderShort GmMSBOrderShort\n#define MagickAllocFunctions GmMagickAllocFunctions\n#define MagickArraySize GmMagickArraySize\n#define MagickAtoFChk GmMagickAtoFChk\n#define MagickAtoIChk GmMagickAtoIChk\n#define MagickAtoLChk GmMagickAtoLChk\n#define MagickAtoUIChk GmMagickAtoUIChk\n#define MagickAtoULChk GmMagickAtoULChk\n#define MagickBitStreamInitializeRead GmMagickBitStreamInitializeRead\n#define MagickBitStreamInitializeWrite GmMagickBitStreamInitializeWrite\n#define MagickBitStreamMSBRead GmMagickBitStreamMSBRead\n#define MagickBitStreamMSBWrite GmMagickBitStreamMSBWrite\n#define MagickCloneMemory GmMagickCloneMemory\n#define MagickCommand GmMagickCommand\n#define MagickCompositeImageUnderColor GmMagickCompositeImageUnderColor\n#define MagickConfirmAccess GmMagickConfirmAccess\n#define MagickConstrainColormapIndex GmMagickConstrainColormapIndex\n#define MagickCreateDirectoryPath GmMagickCreateDirectoryPath\n#define MagickDestroyCommandInfo GmMagickDestroyCommandInfo\n#define MagickFindRawImageMinMax GmMagickFindRawImageMinMax\n#define MagickFmax GmMagickFmax\n#define MagickFmin GmMagickFmin\n#define MagickFormatString GmMagickFormatString\n#define MagickFormatStringList GmMagickFormatStringList\n#define MagickFree GmMagickFree\n#define MagickFreeAligned GmMagickFreeAligned\n#define MagickGetBitRevTable GmMagickGetBitRevTable\n#define MagickGetFileAttributes GmMagickGetFileAttributes\n#define MagickGetFileSystemBlockSize GmMagickGetFileSystemBlockSize\n#define MagickGetMMUPageSize GmMagickGetMMUPageSize\n#define MagickGetQuantumSamplesPerPixel GmMagickGetQuantumSamplesPerPixel\n#define MagickGetToken GmMagickGetToken\n#define MagickInitializeCommandInfo GmMagickInitializeCommandInfo\n#define MagickIsTrue GmMagickIsTrue\n#define MagickMalloc GmMagickMalloc\n#define MagickMallocAligned GmMagickMallocAligned\n#define MagickMallocAlignedArray GmMagickMallocAlignedArray\n#define MagickMallocArray GmMagickMallocArray\n#define MagickMallocCleared GmMagickMallocCleared\n#define MagickMapAccessEntry GmMagickMapAccessEntry\n#define MagickMapAddEntry GmMagickMapAddEntry\n#define MagickMapAllocateIterator GmMagickMapAllocateIterator\n#define MagickMapAllocateMap GmMagickMapAllocateMap\n#define MagickMapClearMap GmMagickMapClearMap\n#define MagickMapCloneMap GmMagickMapCloneMap\n#define MagickMapCopyBlob GmMagickMapCopyBlob\n#define MagickMapCopyString GmMagickMapCopyString\n#define MagickMapDeallocateBlob GmMagickMapDeallocateBlob\n#define MagickMapDeallocateIterator GmMagickMapDeallocateIterator\n#define MagickMapDeallocateMap GmMagickMapDeallocateMap\n#define MagickMapDeallocateString GmMagickMapDeallocateString\n#define MagickMapDereferenceIterator GmMagickMapDereferenceIterator\n#define MagickMapIterateNext GmMagickMapIterateNext\n#define MagickMapIteratePrevious GmMagickMapIteratePrevious\n#define MagickMapIterateToBack GmMagickMapIterateToBack\n#define MagickMapIterateToFront GmMagickMapIterateToFront\n#define MagickMapRemoveEntry GmMagickMapRemoveEntry\n#define MagickMonitor GmMagickMonitor\n#define MagickMonitorActive GmMagickMonitorActive\n#define MagickMonitorFormatted GmMagickMonitorFormatted\n#define MagickRandNewSeed GmMagickRandNewSeed\n#define MagickRandReentrant GmMagickRandReentrant\n#define MagickRandomInteger GmMagickRandomInteger\n#define MagickRandomReal GmMagickRandomReal\n#define MagickRealloc GmMagickRealloc\n#define MagickReverseBits GmMagickReverseBits\n#define MagickSceneFileName GmMagickSceneFileName\n#define MagickSetConfirmAccessHandler GmMagickSetConfirmAccessHandler\n#define MagickSetFileAttributes GmMagickSetFileAttributes\n#define MagickSetFileSystemBlockSize GmMagickSetFileSystemBlockSize\n#define MagickSizeStrToInt64 GmMagickSizeStrToInt64\n#define MagickSpawnVP GmMagickSpawnVP\n#define MagickStripSpacesFromString GmMagickStripSpacesFromString\n#define MagickStrlCat GmMagickStrlCat\n#define MagickStrlCpy GmMagickStrlCpy\n#define MagickStrlCpyTrunc GmMagickStrlCpyTrunc\n#define MagickSwabArrayOfDouble GmMagickSwabArrayOfDouble\n#define MagickSwabArrayOfFloat GmMagickSwabArrayOfFloat\n#define MagickSwabArrayOfUInt16 GmMagickSwabArrayOfUInt16\n#define MagickSwabArrayOfUInt32 GmMagickSwabArrayOfUInt32\n#define MagickSwabDouble GmMagickSwabDouble\n#define MagickSwabFloat GmMagickSwabFloat\n#define MagickSwabUInt16 GmMagickSwabUInt16\n#define MagickSwabUInt32 GmMagickSwabUInt32\n#define MagickToMime GmMagickToMime\n#define MagickTsdGetSpecific GmMagickTsdGetSpecific\n#define MagickTsdKeyCreate GmMagickTsdKeyCreate\n#define MagickTsdKeyCreate2 GmMagickTsdKeyCreate2\n#define MagickTsdKeyDelete GmMagickTsdKeyDelete\n#define MagickTsdSetSpecific GmMagickTsdSetSpecific\n#define MagickWordStreamInitializeRead GmMagickWordStreamInitializeRead\n#define MagickWordStreamInitializeWrite GmMagickWordStreamInitializeWrite\n#define MagickWordStreamLSBRead GmMagickWordStreamLSBRead\n#define MagickWordStreamLSBWrite GmMagickWordStreamLSBWrite\n#define MagickWordStreamLSBWriteFlush GmMagickWordStreamLSBWriteFlush\n#define MagickXAnimateBackgroundImage GmMagickXAnimateBackgroundImage\n#define MagickXAnimateImages GmMagickXAnimateImages\n#define MagickXAnnotateImage GmMagickXAnnotateImage\n#define MagickXBestFont GmMagickXBestFont\n#define MagickXBestIconSize GmMagickXBestIconSize\n#define MagickXBestPixel GmMagickXBestPixel\n#define MagickXBestVisualInfo GmMagickXBestVisualInfo\n#define MagickXCheckRefreshWindows GmMagickXCheckRefreshWindows\n#define MagickXClientMessage GmMagickXClientMessage\n#define MagickXColorBrowserWidget GmMagickXColorBrowserWidget\n#define MagickXCommandWidget GmMagickXCommandWidget\n#define MagickXConfigureImageColormap GmMagickXConfigureImageColormap\n#define MagickXConfirmWidget GmMagickXConfirmWidget\n#define MagickXConstrainWindowPosition GmMagickXConstrainWindowPosition\n#define MagickXDelay GmMagickXDelay\n#define MagickXDestroyResourceInfo GmMagickXDestroyResourceInfo\n#define MagickXDestroyWindowColors GmMagickXDestroyWindowColors\n#define MagickXDestroyX11Resources GmMagickXDestroyX11Resources\n#define MagickXDestroyXWindowInfo GmMagickXDestroyXWindowInfo\n#define MagickXDestroyXWindows GmMagickXDestroyXWindows\n#define MagickXDialogWidget GmMagickXDialogWidget\n#define MagickXDisplayBackgroundImage GmMagickXDisplayBackgroundImage\n#define MagickXDisplayImage GmMagickXDisplayImage\n#define MagickXDisplayImageInfo GmMagickXDisplayImageInfo\n#define MagickXDrawImage GmMagickXDrawImage\n#define MagickXError GmMagickXError\n#define MagickXFileBrowserWidget GmMagickXFileBrowserWidget\n#define MagickXFontBrowserWidget GmMagickXFontBrowserWidget\n#define MagickXFreeResources GmMagickXFreeResources\n#define MagickXFreeStandardColormap GmMagickXFreeStandardColormap\n#define MagickXGetAnnotateInfo GmMagickXGetAnnotateInfo\n#define MagickXGetImportInfo GmMagickXGetImportInfo\n#define MagickXGetMapInfo GmMagickXGetMapInfo\n#define MagickXGetPixelPacket GmMagickXGetPixelPacket\n#define MagickXGetResourceClass GmMagickXGetResourceClass\n#define MagickXGetResourceDatabase GmMagickXGetResourceDatabase\n#define MagickXGetResourceInfo GmMagickXGetResourceInfo\n#define MagickXGetResourceInstance GmMagickXGetResourceInstance\n#define MagickXGetScreenDensity GmMagickXGetScreenDensity\n#define MagickXGetWindowColor GmMagickXGetWindowColor\n#define MagickXGetWindowInfo GmMagickXGetWindowInfo\n#define MagickXHighlightEllipse GmMagickXHighlightEllipse\n#define MagickXHighlightLine GmMagickXHighlightLine\n#define MagickXHighlightRectangle GmMagickXHighlightRectangle\n#define MagickXImportImage GmMagickXImportImage\n#define MagickXInfoWidget GmMagickXInfoWidget\n#define MagickXInitializeWindows GmMagickXInitializeWindows\n#define MagickXListBrowserWidget GmMagickXListBrowserWidget\n#define MagickXMagickMonitor GmMagickXMagickMonitor\n#define MagickXMakeCursor GmMagickXMakeCursor\n#define MagickXMakeImage GmMagickXMakeImage\n#define MagickXMakeMagnifyImage GmMagickXMakeMagnifyImage\n#define MagickXMakeStandardColormap GmMagickXMakeStandardColormap\n#define MagickXMakeWindow GmMagickXMakeWindow\n#define MagickXMenuWidget GmMagickXMenuWidget\n#define MagickXMonitorWidget GmMagickXMonitorWidget\n#define MagickXNoticeWidget GmMagickXNoticeWidget\n#define MagickXPreferencesWidget GmMagickXPreferencesWidget\n#define MagickXQueryColorDatabase GmMagickXQueryColorDatabase\n#define MagickXQueryPosition GmMagickXQueryPosition\n#define MagickXRefreshWindow GmMagickXRefreshWindow\n#define MagickXRemoteCommand GmMagickXRemoteCommand\n#define MagickXRetainWindowColors GmMagickXRetainWindowColors\n#define MagickXSetCursorState GmMagickXSetCursorState\n#define MagickXSetWindows GmMagickXSetWindows\n#define MagickXSignalHandler GmMagickXSignalHandler\n#define MagickXTextViewWidget GmMagickXTextViewWidget\n#define MagickXTextViewWidgetNDL GmMagickXTextViewWidgetNDL\n#define MagickXUserPreferences GmMagickXUserPreferences\n#define MagickXWarning GmMagickXWarning\n#define MagickXWindowByID GmMagickXWindowByID\n#define MagickXWindowByName GmMagickXWindowByName\n#define MagickXWindowByProperty GmMagickXWindowByProperty\n#define MagnifyImage GmMagnifyImage\n#define MapBlob GmMapBlob\n#define MapImage GmMapImage\n#define MapImages GmMapImages\n#define MapModeToString GmMapModeToString\n#define MatteFloodfillImage GmMatteFloodfillImage\n#define MedianFilterImage GmMedianFilterImage\n#define MetricTypeToString GmMetricTypeToString\n#define MinifyImage GmMinifyImage\n#define ModifyCache GmModifyCache\n#define ModifyImage GmModifyImage\n#define Modulate GmModulate\n#define ModulateImage GmModulateImage\n#define MogrifyImage GmMogrifyImage\n#define MogrifyImageCommand GmMogrifyImageCommand\n#define MogrifyImages GmMogrifyImages\n#define MontageImageCommand GmMontageImageCommand\n#define MontageImages GmMontageImages\n#define MorphImages GmMorphImages\n#define MosaicImages GmMosaicImages\n#define MotionBlurImage GmMotionBlurImage\n#define MultilineCensus GmMultilineCensus\n#define NegateImage GmNegateImage\n#define NewImageList GmNewImageList\n#define NextImageProfile GmNextImageProfile\n#define NoiseTypeToString GmNoiseTypeToString\n#define NormalizeImage GmNormalizeImage\n#define OilPaintImage GmOilPaintImage\n#define OpaqueImage GmOpaqueImage\n#define OpenBlob GmOpenBlob\n#define OpenCacheView GmOpenCacheView\n#define OpenModule GmOpenModule\n#define OpenModules GmOpenModules\n#define OrderedDitherImage GmOrderedDitherImage\n#define OrientationTypeToString GmOrientationTypeToString\n#define PackbitsEncode2Image GmPackbitsEncode2Image\n#define PackbitsEncodeImage GmPackbitsEncodeImage\n#define PanicDestroyMagick GmPanicDestroyMagick\n#define PersistCache GmPersistCache\n#define PingBlob GmPingBlob\n#define PingImage GmPingImage\n#define PixelIterateDualModify GmPixelIterateDualModify\n#define PixelIterateDualNew GmPixelIterateDualNew\n#define PixelIterateDualRead GmPixelIterateDualRead\n#define PixelIterateMonoModify GmPixelIterateMonoModify\n#define PixelIterateMonoRead GmPixelIterateMonoRead\n#define PixelIterateMonoSet GmPixelIterateMonoSet\n#define PixelIterateTripleModify GmPixelIterateTripleModify\n#define PixelIterateTripleNew GmPixelIterateTripleNew\n#define PlasmaImage GmPlasmaImage\n#define PopImagePixels GmPopImagePixels\n#define PrependImageToList GmPrependImageToList\n#define ProfileImage GmProfileImage\n#define PurgeTemporaryFiles GmPurgeTemporaryFiles\n#define PurgeTemporaryFilesAsyncSafe GmPurgeTemporaryFilesAsyncSafe\n#define PushImagePixels GmPushImagePixels\n#define QuantizeImage GmQuantizeImage\n#define QuantizeImages GmQuantizeImages\n#define QuantumOperatorImage GmQuantumOperatorImage\n#define QuantumOperatorImageMultivalue GmQuantumOperatorImageMultivalue\n#define QuantumOperatorRegionImage GmQuantumOperatorRegionImage\n#define QuantumOperatorToString GmQuantumOperatorToString\n#define QuantumSampleTypeToString GmQuantumSampleTypeToString\n#define QuantumTypeToString GmQuantumTypeToString\n#define QueryColorDatabase GmQueryColorDatabase\n#define QueryColorname GmQueryColorname\n#define RGBTransformImage GmRGBTransformImage\n#define RaiseImage GmRaiseImage\n#define RandomChannelThresholdImage GmRandomChannelThresholdImage\n#define ReacquireMemory GmReacquireMemory\n#define ReadBlob GmReadBlob\n#define ReadBlobByte GmReadBlobByte\n#define ReadBlobLSBDouble GmReadBlobLSBDouble\n#define ReadBlobLSBDoubles GmReadBlobLSBDoubles\n#define ReadBlobLSBFloat GmReadBlobLSBFloat\n#define ReadBlobLSBFloats GmReadBlobLSBFloats\n#define ReadBlobLSBLong GmReadBlobLSBLong\n#define ReadBlobLSBLongs GmReadBlobLSBLongs\n#define ReadBlobLSBShort GmReadBlobLSBShort\n#define ReadBlobLSBShorts GmReadBlobLSBShorts\n#define ReadBlobLSBSignedLong GmReadBlobLSBSignedLong\n#define ReadBlobLSBSignedShort GmReadBlobLSBSignedShort\n#define ReadBlobMSBDouble GmReadBlobMSBDouble\n#define ReadBlobMSBDoubles GmReadBlobMSBDoubles\n#define ReadBlobMSBFloat GmReadBlobMSBFloat\n#define ReadBlobMSBFloats GmReadBlobMSBFloats\n#define ReadBlobMSBLong GmReadBlobMSBLong\n#define ReadBlobMSBLongs GmReadBlobMSBLongs\n#define ReadBlobMSBShort GmReadBlobMSBShort\n#define ReadBlobMSBShorts GmReadBlobMSBShorts\n#define ReadBlobMSBSignedLong GmReadBlobMSBSignedLong\n#define ReadBlobMSBSignedShort GmReadBlobMSBSignedShort\n#define ReadBlobString GmReadBlobString\n#define ReadBlobZC GmReadBlobZC\n#define ReadImage GmReadImage\n#define ReadInlineImage GmReadInlineImage\n#define ReallocateImageColormap GmReallocateImageColormap\n#define ReduceNoiseImage GmReduceNoiseImage\n#define ReferenceBlob GmReferenceBlob\n#define ReferenceCache GmReferenceCache\n#define ReferenceImage GmReferenceImage\n#define RegisterARTImage GmRegisterARTImage\n#define RegisterAVSImage GmRegisterAVSImage\n#define RegisterBMPImage GmRegisterBMPImage\n#define RegisterBRAILLEImage GmRegisterBRAILLEImage\n#define RegisterCALSImage GmRegisterCALSImage\n#define RegisterCAPTIONImage GmRegisterCAPTIONImage\n#define RegisterCINEONImage GmRegisterCINEONImage\n#define RegisterCMYKImage GmRegisterCMYKImage\n#define RegisterCUTImage GmRegisterCUTImage\n#define RegisterDCMImage GmRegisterDCMImage\n#define RegisterDCRAWImage GmRegisterDCRAWImage\n#define RegisterDIBImage GmRegisterDIBImage\n#define RegisterDPXImage GmRegisterDPXImage\n#define RegisterEPTImage GmRegisterEPTImage\n#define RegisterFAXImage GmRegisterFAXImage\n#define RegisterFITSImage GmRegisterFITSImage\n#define RegisterGIFImage GmRegisterGIFImage\n#define RegisterGRADIENTImage GmRegisterGRADIENTImage\n#define RegisterGRAYImage GmRegisterGRAYImage\n#define RegisterHISTOGRAMImage GmRegisterHISTOGRAMImage\n#define RegisterHRZImage GmRegisterHRZImage\n#define RegisterHTMLImage GmRegisterHTMLImage\n#define RegisterICONImage GmRegisterICONImage\n#define RegisterIDENTITYImage GmRegisterIDENTITYImage\n#define RegisterINFOImage GmRegisterINFOImage\n#define RegisterJNXImage GmRegisterJNXImage\n#define RegisterJP2Image GmRegisterJP2Image\n#define RegisterJPEGImage GmRegisterJPEGImage\n#define RegisterLABELImage GmRegisterLABELImage\n#define RegisterLOCALEImage GmRegisterLOCALEImage\n#define RegisterLOGOImage GmRegisterLOGOImage\n#define RegisterMACImage GmRegisterMACImage\n#define RegisterMAPImage GmRegisterMAPImage\n#define RegisterMATImage GmRegisterMATImage\n#define RegisterMATTEImage GmRegisterMATTEImage\n#define RegisterMETAImage GmRegisterMETAImage\n#define RegisterMIFFImage GmRegisterMIFFImage\n#define RegisterMONOImage GmRegisterMONOImage\n#define RegisterMPCImage GmRegisterMPCImage\n#define RegisterMPEGImage GmRegisterMPEGImage\n#define RegisterMPRImage GmRegisterMPRImage\n#define RegisterMSLImage GmRegisterMSLImage\n#define RegisterMTVImage GmRegisterMTVImage\n#define RegisterMVGImage GmRegisterMVGImage\n#define RegisterMagickInfo GmRegisterMagickInfo\n#define RegisterNULLImage GmRegisterNULLImage\n#define RegisterOTBImage GmRegisterOTBImage\n#define RegisterPALMImage GmRegisterPALMImage\n#define RegisterPCDImage GmRegisterPCDImage\n#define RegisterPCLImage GmRegisterPCLImage\n#define RegisterPCXImage GmRegisterPCXImage\n#define RegisterPDBImage GmRegisterPDBImage\n#define RegisterPDFImage GmRegisterPDFImage\n#define RegisterPICTImage GmRegisterPICTImage\n#define RegisterPIXImage GmRegisterPIXImage\n#define RegisterPLASMAImage GmRegisterPLASMAImage\n#define RegisterPNGImage GmRegisterPNGImage\n#define RegisterPNMImage GmRegisterPNMImage\n#define RegisterPREVIEWImage GmRegisterPREVIEWImage\n#define RegisterPS2Image GmRegisterPS2Image\n#define RegisterPS3Image GmRegisterPS3Image\n#define RegisterPSDImage GmRegisterPSDImage\n#define RegisterPSImage GmRegisterPSImage\n#define RegisterPWPImage GmRegisterPWPImage\n#define RegisterRGBImage GmRegisterRGBImage\n#define RegisterRLAImage GmRegisterRLAImage\n#define RegisterRLEImage GmRegisterRLEImage\n#define RegisterSCTImage GmRegisterSCTImage\n#define RegisterSFWImage GmRegisterSFWImage\n#define RegisterSGIImage GmRegisterSGIImage\n#define RegisterSTEGANOImage GmRegisterSTEGANOImage\n#define RegisterSUNImage GmRegisterSUNImage\n#define RegisterSVGImage GmRegisterSVGImage\n#define RegisterStaticModules GmRegisterStaticModules\n#define RegisterTGAImage GmRegisterTGAImage\n#define RegisterTIFFImage GmRegisterTIFFImage\n#define RegisterTILEImage GmRegisterTILEImage\n#define RegisterTIMImage GmRegisterTIMImage\n#define RegisterTOPOLImage GmRegisterTOPOLImage\n#define RegisterTTFImage GmRegisterTTFImage\n#define RegisterTXTImage GmRegisterTXTImage\n#define RegisterUILImage GmRegisterUILImage\n#define RegisterURLImage GmRegisterURLImage\n#define RegisterUYVYImage GmRegisterUYVYImage\n#define RegisterVICARImage GmRegisterVICARImage\n#define RegisterVIDImage GmRegisterVIDImage\n#define RegisterVIFFImage GmRegisterVIFFImage\n#define RegisterWBMPImage GmRegisterWBMPImage\n#define RegisterWEBPImage GmRegisterWEBPImage\n#define RegisterWMFImage GmRegisterWMFImage\n#define RegisterWPGImage GmRegisterWPGImage\n#define RegisterXBMImage GmRegisterXBMImage\n#define RegisterXCFImage GmRegisterXCFImage\n#define RegisterXCImage GmRegisterXCImage\n#define RegisterXImage GmRegisterXImage\n#define RegisterXPMImage GmRegisterXPMImage\n#define RegisterXWDImage GmRegisterXWDImage\n#define RegisterYUVImage GmRegisterYUVImage\n#define RemoveDefinitions GmRemoveDefinitions\n#define RemoveFirstImageFromList GmRemoveFirstImageFromList\n#define RemoveLastImageFromList GmRemoveLastImageFromList\n#define ReplaceImageColormap GmReplaceImageColormap\n#define ReplaceImageInList GmReplaceImageInList\n#define ResetImagePage GmResetImagePage\n#define ResetTimer GmResetTimer\n#define ResizeFilterToString GmResizeFilterToString\n#define ResizeImage GmResizeImage\n#define ResolutionTypeToString GmResolutionTypeToString\n#define ReverseImageList GmReverseImageList\n#define RollImage GmRollImage\n#define RotateImage GmRotateImage\n#define SampleImage GmSampleImage\n#define ScaleImage GmScaleImage\n#define SeekBlob GmSeekBlob\n#define SetBlobClosable GmSetBlobClosable\n#define SetBlobTemporary GmSetBlobTemporary\n#define SetCacheView GmSetCacheView\n#define SetCacheViewPixels GmSetCacheViewPixels\n#define SetClientFilename GmSetClientFilename\n#define SetClientName GmSetClientName\n#define SetClientPath GmSetClientPath\n#define SetDelegateInfo GmSetDelegateInfo\n#define SetErrorHandler GmSetErrorHandler\n#define SetExceptionInfo GmSetExceptionInfo\n#define SetFatalErrorHandler GmSetFatalErrorHandler\n#define SetGeometry GmSetGeometry\n#define SetImage GmSetImage\n#define SetImageAttribute GmSetImageAttribute\n#define SetImageChannelDepth GmSetImageChannelDepth\n#define SetImageClipMask GmSetImageClipMask\n#define SetImageColor GmSetImageColor\n#define SetImageColorRegion GmSetImageColorRegion\n#define SetImageCompositeMask GmSetImageCompositeMask\n#define SetImageDepth GmSetImageDepth\n#define SetImageEx GmSetImageEx\n#define SetImageInfo GmSetImageInfo\n#define SetImageOpacity GmSetImageOpacity\n#define SetImagePixels GmSetImagePixels\n#define SetImagePixelsEx GmSetImagePixelsEx\n#define SetImageProfile GmSetImageProfile\n#define SetImageType GmSetImageType\n#define SetImageVirtualPixelMethod GmSetImageVirtualPixelMethod\n#define SetLogEventMask GmSetLogEventMask\n#define SetLogFormat GmSetLogFormat\n#define SetMagickInfo GmSetMagickInfo\n#define SetMagickRegistry GmSetMagickRegistry\n#define SetMagickResourceLimit GmSetMagickResourceLimit\n#define SetMonitorHandler GmSetMonitorHandler\n#define SetWarningHandler GmSetWarningHandler\n#define ShadeImage GmShadeImage\n#define SharpenImage GmSharpenImage\n#define SharpenImageChannel GmSharpenImageChannel\n#define ShaveImage GmShaveImage\n#define ShearImage GmShearImage\n#define SignatureImage GmSignatureImage\n#define SolarizeImage GmSolarizeImage\n#define SortColormapByIntensity GmSortColormapByIntensity\n#define SpliceImageIntoList GmSpliceImageIntoList\n#define SplitImageList GmSplitImageList\n#define SpreadImage GmSpreadImage\n#define StartTimer GmStartTimer\n#define SteganoImage GmSteganoImage\n#define StereoImage GmStereoImage\n#define StopTimer GmStopTimer\n#define StorageTypeToString GmStorageTypeToString\n#define StretchTypeToString GmStretchTypeToString\n#define StringToArgv GmStringToArgv\n#define StringToChannelType GmStringToChannelType\n#define StringToColorspaceType GmStringToColorspaceType\n#define StringToCompositeOperator GmStringToCompositeOperator\n#define StringToCompressionType GmStringToCompressionType\n#define StringToDouble GmStringToDouble\n#define StringToEndianType GmStringToEndianType\n#define StringToFilterTypes GmStringToFilterTypes\n#define StringToGravityType GmStringToGravityType\n#define StringToHighlightStyle GmStringToHighlightStyle\n#define StringToImageType GmStringToImageType\n#define StringToInterlaceType GmStringToInterlaceType\n#define StringToList GmStringToList\n#define StringToMetricType GmStringToMetricType\n#define StringToNoiseType GmStringToNoiseType\n#define StringToOrientationType GmStringToOrientationType\n#define StringToPreviewType GmStringToPreviewType\n#define StringToQuantumOperator GmStringToQuantumOperator\n#define StringToResolutionType GmStringToResolutionType\n#define StringToResourceType GmStringToResourceType\n#define StringToVirtualPixelMethod GmStringToVirtualPixelMethod\n#define Strip GmStrip\n#define StripImage GmStripImage\n#define StyleTypeToString GmStyleTypeToString\n#define SubstituteString GmSubstituteString\n#define SwirlImage GmSwirlImage\n#define SyncCacheView GmSyncCacheView\n#define SyncCacheViewPixels GmSyncCacheViewPixels\n#define SyncImage GmSyncImage\n#define SyncImagePixels GmSyncImagePixels\n#define SyncImagePixelsEx GmSyncImagePixelsEx\n#define SyncNextImageInList GmSyncNextImageInList\n#define SystemCommand GmSystemCommand\n#define TellBlob GmTellBlob\n#define TextureImage GmTextureImage\n#define ThresholdImage GmThresholdImage\n#define ThrowLoggedException GmThrowLoggedException\n#define ThumbnailImage GmThumbnailImage\n#define TimeImageCommand GmTimeImageCommand\n#define Tokenizer GmTokenizer\n#define TransformColorspace GmTransformColorspace\n#define TransformHSL GmTransformHSL\n#define TransformHWB GmTransformHWB\n#define TransformImage GmTransformImage\n#define TransformRGBImage GmTransformRGBImage\n#define TransformSignature GmTransformSignature\n#define TranslateText GmTranslateText\n#define TranslateTextEx GmTranslateTextEx\n#define TransparentImage GmTransparentImage\n#define UnlockSemaphoreInfo GmUnlockSemaphoreInfo\n#define UnmapBlob GmUnmapBlob\n#define UnregisterARTImage GmUnregisterARTImage\n#define UnregisterAVSImage GmUnregisterAVSImage\n#define UnregisterBMPImage GmUnregisterBMPImage\n#define UnregisterBRAILLEImage GmUnregisterBRAILLEImage\n#define UnregisterCALSImage GmUnregisterCALSImage\n#define UnregisterCAPTIONImage GmUnregisterCAPTIONImage\n#define UnregisterCINEONImage GmUnregisterCINEONImage\n#define UnregisterCMYKImage GmUnregisterCMYKImage\n#define UnregisterCUTImage GmUnregisterCUTImage\n#define UnregisterDCMImage GmUnregisterDCMImage\n#define UnregisterDCRAWImage GmUnregisterDCRAWImage\n#define UnregisterDIBImage GmUnregisterDIBImage\n#define UnregisterDPXImage GmUnregisterDPXImage\n#define UnregisterEPTImage GmUnregisterEPTImage\n#define UnregisterFAXImage GmUnregisterFAXImage\n#define UnregisterFITSImage GmUnregisterFITSImage\n#define UnregisterGIFImage GmUnregisterGIFImage\n#define UnregisterGRADIENTImage GmUnregisterGRADIENTImage\n#define UnregisterGRAYImage GmUnregisterGRAYImage\n#define UnregisterHISTOGRAMImage GmUnregisterHISTOGRAMImage\n#define UnregisterHRZImage GmUnregisterHRZImage\n#define UnregisterHTMLImage GmUnregisterHTMLImage\n#define UnregisterICONImage GmUnregisterICONImage\n#define UnregisterIDENTITYImage GmUnregisterIDENTITYImage\n#define UnregisterINFOImage GmUnregisterINFOImage\n#define UnregisterJNXImage GmUnregisterJNXImage\n#define UnregisterJP2Image GmUnregisterJP2Image\n#define UnregisterJPEGImage GmUnregisterJPEGImage\n#define UnregisterLABELImage GmUnregisterLABELImage\n#define UnregisterLOCALEImage GmUnregisterLOCALEImage\n#define UnregisterLOGOImage GmUnregisterLOGOImage\n#define UnregisterMACImage GmUnregisterMACImage\n#define UnregisterMAPImage GmUnregisterMAPImage\n#define UnregisterMATImage GmUnregisterMATImage\n#define UnregisterMATTEImage GmUnregisterMATTEImage\n#define UnregisterMETAImage GmUnregisterMETAImage\n#define UnregisterMIFFImage GmUnregisterMIFFImage\n#define UnregisterMONOImage GmUnregisterMONOImage\n#define UnregisterMPCImage GmUnregisterMPCImage\n#define UnregisterMPEGImage GmUnregisterMPEGImage\n#define UnregisterMPRImage GmUnregisterMPRImage\n#define UnregisterMSLImage GmUnregisterMSLImage\n#define UnregisterMTVImage GmUnregisterMTVImage\n#define UnregisterMVGImage GmUnregisterMVGImage\n#define UnregisterMagickInfo GmUnregisterMagickInfo\n#define UnregisterNULLImage GmUnregisterNULLImage\n#define UnregisterOTBImage GmUnregisterOTBImage\n#define UnregisterPALMImage GmUnregisterPALMImage\n#define UnregisterPCDImage GmUnregisterPCDImage\n#define UnregisterPCLImage GmUnregisterPCLImage\n#define UnregisterPCXImage GmUnregisterPCXImage\n#define UnregisterPDBImage GmUnregisterPDBImage\n#define UnregisterPDFImage GmUnregisterPDFImage\n#define UnregisterPICTImage GmUnregisterPICTImage\n#define UnregisterPIXImage GmUnregisterPIXImage\n#define UnregisterPLASMAImage GmUnregisterPLASMAImage\n#define UnregisterPNGImage GmUnregisterPNGImage\n#define UnregisterPNMImage GmUnregisterPNMImage\n#define UnregisterPREVIEWImage GmUnregisterPREVIEWImage\n#define UnregisterPS2Image GmUnregisterPS2Image\n#define UnregisterPS3Image GmUnregisterPS3Image\n#define UnregisterPSDImage GmUnregisterPSDImage\n#define UnregisterPSImage GmUnregisterPSImage\n#define UnregisterPWPImage GmUnregisterPWPImage\n#define UnregisterRGBImage GmUnregisterRGBImage\n#define UnregisterRLAImage GmUnregisterRLAImage\n#define UnregisterRLEImage GmUnregisterRLEImage\n#define UnregisterSCTImage GmUnregisterSCTImage\n#define UnregisterSFWImage GmUnregisterSFWImage\n#define UnregisterSGIImage GmUnregisterSGIImage\n#define UnregisterSTEGANOImage GmUnregisterSTEGANOImage\n#define UnregisterSUNImage GmUnregisterSUNImage\n#define UnregisterSVGImage GmUnregisterSVGImage\n#define UnregisterStaticModules GmUnregisterStaticModules\n#define UnregisterTGAImage GmUnregisterTGAImage\n#define UnregisterTIFFImage GmUnregisterTIFFImage\n#define UnregisterTILEImage GmUnregisterTILEImage\n#define UnregisterTIMImage GmUnregisterTIMImage\n#define UnregisterTOPOLImage GmUnregisterTOPOLImage\n#define UnregisterTTFImage GmUnregisterTTFImage\n#define UnregisterTXTImage GmUnregisterTXTImage\n#define UnregisterUILImage GmUnregisterUILImage\n#define UnregisterURLImage GmUnregisterURLImage\n#define UnregisterUYVYImage GmUnregisterUYVYImage\n#define UnregisterVICARImage GmUnregisterVICARImage\n#define UnregisterVIDImage GmUnregisterVIDImage\n#define UnregisterVIFFImage GmUnregisterVIFFImage\n#define UnregisterWBMPImage GmUnregisterWBMPImage\n#define UnregisterWEBPImage GmUnregisterWEBPImage\n#define UnregisterWMFImage GmUnregisterWMFImage\n#define UnregisterWPGImage GmUnregisterWPGImage\n#define UnregisterXBMImage GmUnregisterXBMImage\n#define UnregisterXCFImage GmUnregisterXCFImage\n#define UnregisterXCImage GmUnregisterXCImage\n#define UnregisterXImage GmUnregisterXImage\n#define UnregisterXPMImage GmUnregisterXPMImage\n#define UnregisterXWDImage GmUnregisterXWDImage\n#define UnregisterYUVImage GmUnregisterYUVImage\n#define UnsharpMaskImage GmUnsharpMaskImage\n#define UnsharpMaskImageChannel GmUnsharpMaskImageChannel\n#define UpdateSignature GmUpdateSignature\n#define WaveImage GmWaveImage\n#define WhiteThresholdImage GmWhiteThresholdImage\n#define WriteBlob GmWriteBlob\n#define WriteBlobByte GmWriteBlobByte\n#define WriteBlobFile GmWriteBlobFile\n#define WriteBlobLSBLong GmWriteBlobLSBLong\n#define WriteBlobLSBShort GmWriteBlobLSBShort\n#define WriteBlobLSBSignedLong GmWriteBlobLSBSignedLong\n#define WriteBlobLSBSignedShort GmWriteBlobLSBSignedShort\n#define WriteBlobMSBLong GmWriteBlobMSBLong\n#define WriteBlobMSBShort GmWriteBlobMSBShort\n#define WriteBlobMSBSignedLong GmWriteBlobMSBSignedLong\n#define WriteBlobMSBSignedShort GmWriteBlobMSBSignedShort\n#define WriteBlobString GmWriteBlobString\n#define WriteBlobStringEOL GmWriteBlobStringEOL\n#define WriteBlobStringWithEOL GmWriteBlobStringWithEOL\n#define WriteImage GmWriteImage\n#define WriteImages GmWriteImages\n#define WriteImagesFile GmWriteImagesFile\n#define ZoomImage GmZoomImage\n\n#endif /* defined(PREFIX_MAGICK_SYMBOLS) */\n#endif /* defined(_MAGICK_SYMBOLS_H) */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/texture.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Texture Methods.\n*/\n#ifndef _MAGICK_TEXTURE_H\n#define _MAGICK_TEXTURE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\nextern MagickExport Image\n  *ConstituteTextureImage(const unsigned long columns,const unsigned long rows,\n                          const Image *texture,ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  TextureImage(Image *,const Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_TEXTURE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/timer.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Timer Methods.\n*/\n#ifndef _MAGICK_TIMER_H\n#define _MAGICK_TIMER_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UndefinedTimerState,\n  StoppedTimerState,\n  RunningTimerState\n} TimerState;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _Timer\n{\n  double\n    start,\n    stop,\n    total;\n} Timer;\n\ntypedef struct _TimerInfo\n{\n  Timer\n    user,\n    elapsed;\n\n  TimerState\n    state;\n\n  unsigned long\n    signature;\n} TimerInfo;\n\f\n/*\n  Timer methods.\n*/\nextern MagickExport double\n  GetElapsedTime(TimerInfo *),\n  GetUserTime(TimerInfo *),\n  GetTimerResolution(void);\n\nextern MagickExport unsigned int\n  ContinueTimer(TimerInfo *);\n\nextern MagickExport void\n  GetTimerInfo(TimerInfo *),\n  ResetTimer(TimerInfo *),\n  StartTimer(TimerInfo *time_info,const unsigned int reset),\n  StopTimer(TimerInfo *time_info);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/transform.h",
    "content": "/*\n  Copyright (C) 2003 - 2010 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Transform Methods.\n*/\n#ifndef _MAGICK_TRANSFORM_H\n#define _MAGICK_TRANSFORM_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *ChopImage(const Image *image,const RectangleInfo *chop_info,ExceptionInfo *exception),\n  *CoalesceImages(const Image *image,ExceptionInfo *exception),\n  *CropImage(const Image *image,const RectangleInfo *geometry,ExceptionInfo *exception),\n  *DeconstructImages(const Image *image,ExceptionInfo *exception),\n  *ExtentImage(const Image *image,const RectangleInfo *geometry,ExceptionInfo *exception),\n  *FlattenImages(const Image *image,ExceptionInfo *exception),\n  *FlipImage(const Image *image,ExceptionInfo *exception),\n  *FlopImage(const Image *image,ExceptionInfo *exception),\n  *MosaicImages(const Image *image,ExceptionInfo *exception),\n  *RollImage(const Image *image,const long x_offset,const long y_offset,ExceptionInfo *exception),\n  *ShaveImage(const Image *image,const RectangleInfo *shave_info,ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  TransformImage(Image **,const char *,const char *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_TRANSFORM_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/type.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Drawing methods.\n*/\n#ifndef _MAGICK_TYPE_H\n#define _MAGICK_TYPE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  NormalStretch,\n  UltraCondensedStretch,\n  ExtraCondensedStretch,\n  CondensedStretch,\n  SemiCondensedStretch,\n  SemiExpandedStretch,\n  ExpandedStretch,\n  ExtraExpandedStretch,\n  UltraExpandedStretch,\n  AnyStretch\n} StretchType;\n\ntypedef enum\n{\n  NormalStyle,\n  ItalicStyle,\n  ObliqueStyle,\n  AnyStyle\n} StyleType;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _TypeInfo\n{\n  char\n    *path,\n    *name,\n    *description,\n    *family;\n\n  StyleType\n    style;\n\n  StretchType\n    stretch;\n\n  unsigned long\n    weight;\n\n  char\n    *encoding,\n    *foundry,\n    *format,\n    *metrics,\n    *glyphs;\n\n  unsigned int\n    stealth;\n\n  unsigned long\n    signature;\n\n  struct _TypeInfo\n    *previous,\n    *next;\n} TypeInfo;\n\f\n/*\n  Method declarations.\n*/\nextern MagickExport char\n  **GetTypeList(const char *,unsigned long *);\n\nextern MagickExport MagickPassFail\n  ListTypeInfo(FILE *,ExceptionInfo *);\n\nextern MagickExport const TypeInfo\n  *GetTypeInfo(const char *,ExceptionInfo *),\n  *GetTypeInfoByFamily(const char *,const StyleType,const StretchType,\n    const unsigned long,ExceptionInfo *);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/type-private.h\"\n#endif /* MAGICK_IMPLEMENTATION */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_TYPE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/utility.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Utility Methods.\n*/\n#ifndef _MAGICK_UTILITY_H\n#define _MAGICK_UTILITY_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  RootPath,\n  HeadPath,\n  TailPath,\n  BasePath,\n  ExtensionPath,\n  MagickPath,\n  SubImagePath,\n  FullPath\n} PathType;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _TokenInfo\n{\n  int\n    state;\n\n  unsigned int\n    flag;\n\n  long\n    offset;\n\n  char\n    quote;\n} TokenInfo;\n\f\n/*\n  Utilities methods.\n*/\n\n#undef ARG_NOT_USED\n#define ARG_NOT_USED(arg) (void) arg\n\n/*\n  A callback function which behaves similar to strlcpy() except which\n  optionally translates text while it is copied and always returns\n  the number of characters which were actually copied rather than\n  the number of characters which were available to copy.\n*/\ntypedef size_t\n  (*MagickTextTranslate)(char *dst, const char *src, const size_t size);\n\nextern MagickExport char\n  *AcquireString(const char *),\n  *AllocateString(const char *),\n  *Base64Encode(const unsigned char *,const size_t,size_t *),\n  *EscapeString(const char *,const char),\n  *GetPageGeometry(const char *),\n  **ListFiles(const char *,const char *,long *),\n  **StringToArgv(const char *,int *),\n  **StringToList(const char *),\n  *TranslateText(const ImageInfo *,Image *,const char *),\n  *TranslateTextEx(const ImageInfo *,Image *,const char *,MagickTextTranslate);\n\nextern MagickExport const char\n  *GetClientFilename(void) MAGICK_FUNC_CONST,\n  *GetClientName(void) MAGICK_FUNC_CONST,\n  *GetClientPath(void) MAGICK_FUNC_CONST,\n  *SetClientFilename(const char *),\n  *SetClientName(const char *),\n  *SetClientPath(const char *);\n\nextern MagickExport double\n  StringToDouble(const char *,const double);\n\nextern MagickExport int\n  GetGeometry(const char *,long *,long *,unsigned long *,unsigned long *),\n  GlobExpression(const char *,const char *) MAGICK_FUNC_PURE,\n  LocaleNCompare(const char *,const char *,const size_t) MAGICK_FUNC_PURE,\n  LocaleCompare(const char *,const char *) MAGICK_FUNC_PURE,\n  GetMagickDimension(const char *str,double *width,double *height,double *xoff,double *yoff),\n  GetMagickGeometry(const char *geometry,long *x,long *y,unsigned long *width,\n    unsigned long *height),\n  MagickRandReentrant(unsigned int *seed) MAGICK_FUNC_DEPRECATED,\n  MagickSpawnVP(const unsigned int verbose, const char *file, char *const argv[]),\n  SystemCommand(const unsigned int,const char *),\n  Tokenizer(TokenInfo *,unsigned,char *,size_t,char *,char *,char *,char *,\n    char,char *,int *,char *);\n\nextern MagickExport unsigned int\n  MagickRandNewSeed(void) MAGICK_FUNC_DEPRECATED;\n\nextern MagickExport unsigned char\n  *Base64Decode(const char *, size_t *);\n\nextern MagickExport MagickPassFail\n  CloneString(char **,const char *),\n  ConcatenateString(char **,const char *),\n  ExpandFilenames(int *,char ***),\n  GetExecutionPath(char *),\n  GetExecutionPathUsingName(char *),\n  MagickCreateDirectoryPath(const char *dir,ExceptionInfo *exception);\n\nextern MagickExport MagickBool\n  IsAccessible(const char *),\n  IsAccessibleNoLogging(const char *),\n  IsAccessibleAndNotEmpty(const char *),\n  IsGeometry(const char *),\n  IsGlob(const char *) MAGICK_FUNC_PURE,\n  IsWriteable(const char *),\n  MagickSceneFileName(char *filename,const char* filename_template,\n    const char* scene_template,const MagickBool force,unsigned long scene),\n  SubstituteString(char **buffer,const char *search,const char *replace);\n\nextern MagickExport unsigned long\n  MultilineCensus(const char *) MAGICK_FUNC_PURE;\n\nextern MagickExport void\n  AppendImageFormat(const char *,char *),\n  DefineClientName(const char *),\n  DefineClientPathAndName(const char *),\n  ExpandFilename(char *),\n  FormatSize(const magick_int64_t size,char *format),\n  GetPathComponent(const char *,PathType,char *),\n  GetToken(const char *,char **,char *) MAGICK_FUNC_DEPRECATED,\n  LocaleLower(char *),\n  LocaleUpper(char *),\n  Strip(char *),\n  SetGeometry(const Image *,RectangleInfo *);\n\nextern MagickExport void\n  FormatString(char *string,const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,2,3))),\n  FormatStringList(char *string,const char *format,va_list operands) MAGICK_ATTRIBUTE((__format__ (__printf__,2,0))),\n  MagickFormatString(char *string,const size_t length,const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,3,4))),\n  MagickFormatStringList(char *string,const size_t length,const char *format,va_list operands) MAGICK_ATTRIBUTE((__format__ (__printf__,3,0)));\n\nextern MagickExport magick_int64_t\n  MagickSizeStrToInt64(const char *str,const unsigned int kilo);\n\nextern MagickExport size_t\n  MagickGetToken(const char *start,char **end,char *token,\n                 const size_t buffer_length),\n  MagickStripSpacesFromString(char *string),\n  MagickStrlCat(char *dst, const char *src, const size_t size) MAGICK_FUNC_NONNULL,\n  MagickStrlCpy(char *dst, const char *src, const size_t size) MAGICK_FUNC_NONNULL,\n  MagickStrlCpyTrunc(char *dst, const char *src, const size_t size) MAGICK_FUNC_NONNULL;\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/utility-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/version.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick version and copyright.\n*/\n#ifndef _MAGICK_VERSION_H\n#define _MAGICK_VERSION_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Define declarations.\n\n  MagickLibVersion and MagickLibVersionNumber are defined differently\n  than they are in ImageMagick. The three fields are based on library\n  interface versioning.  Each field in MagickLibVersion is one byte.\n  The most significant field (third byte from the right) defines the\n  library major interface, which is incremented whenever the library\n  ABI changes incompatibly with preceding versions. The second field\n  identifies an interface (a span) in a series of upward-compatible\n  interfaces with the same major interface (such as when only new\n  functions have) been added. The least significant field specifies\n  the revision across 100% compatible interfaces.\n\n  MagickLibVersionText provides a simple human-readable string for\n  identifying the release.\n*/\n#define MagickPackageName \"GraphicsMagick\"\n#define MagickCopyright  \"Copyright (C) 2002-2020 GraphicsMagick Group.\\nAdditional copyrights and licenses apply to this software.\\nSee http://www.GraphicsMagick.org/www/Copyright.html for details.\"\n#define MagickLibVersion  0x242100\n#define MagickLibVersionText  \"1.3.35\"\n#define MagickLibVersionNumber 24,21,0\n#define MagickChangeDate   \"20200223\"\n#define MagickReleaseDate  \"2020-02-23\"\n\n/*\n  The MagickLibInterfaceNewest and MagickLibInterfaceOldest defines\n  provide both the newest and oldest interfaces supported by the\n  library.  The 'newest' interface is incremented if new interfaces\n  are added to the library.  The 'oldest' interface is reset to the\n  value of 'newest' if an existing interface is changed incompatibly,\n  or an interface is removed.  This scheme is similar to that used by\n  ELF libraries.\n\n  Note that the values used are related to those in\n  MagickLibVersionNumber, but these are broken out and simplified so\n  that they can be easily used in C pre-processor logic.\n*/\n#define MagickLibInterfaceNewest 24\n#define MagickLibInterfaceOldest 3\n\n#if (QuantumDepth == 8)\n#define MagickQuantumDepth  \"Q8\"\n#elif (QuantumDepth == 16)\n#define MagickQuantumDepth  \"Q16\"\n#elif (QuantumDepth == 32)\n#define MagickQuantumDepth  \"Q32\"\n#else\n# error Unsupported quantum depth.\n#endif\n\n#define MagickVersion MagickPackageName \" \" MagickLibVersionText \" \" \\\n  MagickReleaseDate \" \" MagickQuantumDepth \" \" MagickWebSite\n#define MagickWebSite  \"http://www.\" MagickPackageName \".org/\"\n\n/*\n  Method declarations.\n*/\nextern MagickExport const char\n  *GetMagickCopyright(void) MAGICK_FUNC_CONST,\n  *GetMagickVersion(unsigned long *) MAGICK_FUNC_CONST,\n  *GetMagickWebSite(void) MAGICK_FUNC_CONST;\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/wand/drawing_wand.h",
    "content": "/* Copyright (C) 2003-2009 GraphicsMagick Group */\n/*\n  ImageMagick Drawing Wand API.\n*/\n#ifndef _MAGICK_DRAWING_WAND_H\n#define _MAGICK_DRAWING_WAND_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"wand/wand_symbols.h\"\n#include \"wand/pixel_wand.h\"\n\n#undef CloneDrawingWand\n#define CloneDrawingWand MagickCloneDrawingWand\n#undef DestroyDrawingWand\n#define DestroyDrawingWand MagickDestroyDrawingWand\n#undef DrawAffine\n#define DrawAffine MagickDrawAffine\n#undef DrawAllocateWand\n#define DrawAllocateWand MagickDrawAllocateWand\n#undef DrawAnnotation\n#define DrawAnnotation MagickDrawAnnotation\n#undef DrawArc\n#define DrawArc MagickDrawArc\n#undef DrawBezier\n#define DrawBezier MagickDrawBezier\n#undef DrawClearException\n#define DrawClearException MagickDrawClearException\n#undef DrawCircle\n#define DrawCircle MagickDrawCircle\n#undef DrawColor\n#define DrawColor MagickDrawColor\n#undef DrawComment\n#define DrawComment MagickDrawComment\n#undef DrawComposite\n#define DrawComposite MagickDrawComposite\n#undef DrawEllipse\n#define DrawEllipse MagickDrawEllipse\n#undef DrawGetClipPath\n#define DrawGetClipPath MagickDrawGetClipPath\n#undef DrawGetClipRule\n#define DrawGetClipRule MagickDrawGetClipRule\n#undef DrawGetClipUnits\n#define DrawGetClipUnits MagickDrawGetClipUnits\n#undef DrawGetException\n#define DrawGetException MagickDrawGetException\n#undef DrawGetFillColor\n#define DrawGetFillColor MagickDrawGetFillColor\n#undef DrawGetFillOpacity\n#define DrawGetFillOpacity MagickDrawGetFillOpacity\n#undef DrawGetFillRule\n#define DrawGetFillRule MagickDrawGetFillRule\n#undef DrawGetFont\n#define DrawGetFont MagickDrawGetFont\n#undef DrawGetFontFamily\n#define DrawGetFontFamily MagickDrawGetFontFamily\n#undef DrawGetFontSize\n#define DrawGetFontSize MagickDrawGetFontSize\n#undef DrawGetFontStretch\n#define DrawGetFontStretch MagickDrawGetFontStretch\n#undef DrawGetFontStyle\n#define DrawGetFontStyle MagickDrawGetFontStyle\n#undef DrawGetFontWeight\n#define DrawGetFontWeight MagickDrawGetFontWeight\n#undef DrawGetGravity\n#define DrawGetGravity MagickDrawGetGravity\n#undef DrawGetStrokeAntialias\n#define DrawGetStrokeAntialias MagickDrawGetStrokeAntialias\n#undef DrawGetStrokeColor\n#define DrawGetStrokeColor MagickDrawGetStrokeColor\n#undef DrawGetStrokeDashArray\n#define DrawGetStrokeDashArray MagickDrawGetStrokeDashArray\n#undef DrawGetStrokeDashOffset\n#define DrawGetStrokeDashOffset MagickDrawGetStrokeDashOffset\n#undef DrawGetStrokeLineCap\n#define DrawGetStrokeLineCap MagickDrawGetStrokeLineCap\n#undef DrawGetStrokeLineJoin\n#define DrawGetStrokeLineJoin MagickDrawGetStrokeLineJoin\n#undef DrawGetStrokeMiterLimit\n#define DrawGetStrokeMiterLimit MagickDrawGetStrokeMiterLimit\n#undef DrawGetStrokeOpacity\n#define DrawGetStrokeOpacity MagickDrawGetStrokeOpacity\n#undef DrawGetStrokeWidth\n#define DrawGetStrokeWidth MagickDrawGetStrokeWidth\n#undef DrawGetTextAntialias\n#define DrawGetTextAntialias MagickDrawGetTextAntialias\n#undef DrawGetTextDecoration\n#define DrawGetTextDecoration MagickDrawGetTextDecoration\n#undef DrawGetTextEncoding\n#define DrawGetTextEncoding MagickDrawGetTextEncoding\n#undef DrawGetTextUnderColor\n#define DrawGetTextUnderColor MagickDrawGetTextUnderColor\n#undef DrawLine\n#define DrawLine MagickDrawLine\n#undef DrawMatte\n#define DrawMatte MagickDrawMatte\n#undef DrawPathClose\n#define DrawPathClose MagickDrawPathClose\n#undef DrawPathCurveToAbsolute\n#define DrawPathCurveToAbsolute MagickDrawPathCurveToAbsolute\n#undef DrawPathCurveToQuadraticBezierAbsolute\n#define DrawPathCurveToQuadraticBezierAbsolute MagickDrawPathCurveToQuadraticBezierAbsolute\n#undef DrawPathCurveToQuadraticBezierRelative\n#define DrawPathCurveToQuadraticBezierRelative MagickDrawPathCurveToQuadraticBezierRelative\n#undef DrawPathCurveToQuadraticBezierSmoothAbsolute\n#define DrawPathCurveToQuadraticBezierSmoothAbsolute MagickDrawPathCurveToQuadraticBezierSmoothAbsolute\n#undef DrawPathCurveToQuadraticBezierSmoothRelative\n#define DrawPathCurveToQuadraticBezierSmoothRelative MagickDrawPathCurveToQuadraticBezierSmoothRelative\n#undef DrawPathCurveToRelative\n#define DrawPathCurveToRelative MagickDrawPathCurveToRelative\n#undef DrawPathCurveToSmoothAbsolute\n#define DrawPathCurveToSmoothAbsolute MagickDrawPathCurveToSmoothAbsolute\n#undef DrawPathCurveToSmoothRelative\n#define DrawPathCurveToSmoothRelative MagickDrawPathCurveToSmoothRelative\n#undef DrawPathEllipticArcAbsolute\n#define DrawPathEllipticArcAbsolute MagickDrawPathEllipticArcAbsolute\n#undef DrawPathEllipticArcRelative\n#define DrawPathEllipticArcRelative MagickDrawPathEllipticArcRelative\n#undef DrawPathFinish\n#define DrawPathFinish MagickDrawPathFinish\n#undef DrawPathLineToAbsolute\n#define DrawPathLineToAbsolute MagickDrawPathLineToAbsolute\n#undef DrawPathLineToHorizontalAbsolute\n#define DrawPathLineToHorizontalAbsolute MagickDrawPathLineToHorizontalAbsolute\n#undef DrawPathLineToHorizontalRelative\n#define DrawPathLineToHorizontalRelative MagickDrawPathLineToHorizontalRelative\n#undef DrawPathLineToRelative\n#define DrawPathLineToRelative MagickDrawPathLineToRelative\n#undef DrawPathLineToVerticalAbsolute\n#define DrawPathLineToVerticalAbsolute MagickDrawPathLineToVerticalAbsolute\n#undef DrawPathLineToVerticalRelative\n#define DrawPathLineToVerticalRelative MagickDrawPathLineToVerticalRelative\n#undef DrawPathMoveToAbsolute\n#define DrawPathMoveToAbsolute MagickDrawPathMoveToAbsolute\n#undef DrawPathMoveToRelative\n#define DrawPathMoveToRelative MagickDrawPathMoveToRelative\n#undef DrawPathStart\n#define DrawPathStart MagickDrawPathStart\n#undef DrawPeekGraphicContext\n#define DrawPeekGraphicContext MagickDrawPeekGraphicContext\n#undef DrawPoint\n#define DrawPoint MagickDrawPoint\n#undef DrawPolygon\n#define DrawPolygon MagickDrawPolygon\n#undef DrawPolyline\n#define DrawPolyline MagickDrawPolyline\n#undef DrawPopClipPath\n#define DrawPopClipPath MagickDrawPopClipPath\n#undef DrawPopDefs\n#define DrawPopDefs MagickDrawPopDefs\n#undef DrawPopGraphicContext\n#define DrawPopGraphicContext MagickDrawPopGraphicContext\n#undef DrawPopPattern\n#define DrawPopPattern MagickDrawPopPattern\n#undef DrawPushClipPath\n#define DrawPushClipPath MagickDrawPushClipPath\n#undef DrawPushDefs\n#define DrawPushDefs MagickDrawPushDefs\n#undef DrawPushGraphicContext\n#define DrawPushGraphicContext MagickDrawPushGraphicContext\n#undef DrawPushPattern\n#define DrawPushPattern MagickDrawPushPattern\n#undef DrawRectangle\n#define DrawRectangle MagickDrawRectangle\n#undef DrawRender\n#define DrawRender MagickDrawRender\n#undef DrawRotate\n#define DrawRotate MagickDrawRotate\n#undef DrawRoundRectangle\n#define DrawRoundRectangle MagickDrawRoundRectangle\n#undef DrawScale\n#define DrawScale MagickDrawScale\n#undef DrawSetClipPath\n#define DrawSetClipPath MagickDrawSetClipPath\n#undef DrawSetClipRule\n#define DrawSetClipRule MagickDrawSetClipRule\n#undef DrawSetClipUnits\n#define DrawSetClipUnits MagickDrawSetClipUnits\n#undef DrawSetFillColor\n#define DrawSetFillColor MagickDrawSetFillColor\n#undef DrawSetFillOpacity\n#define DrawSetFillOpacity MagickDrawSetFillOpacity\n#undef DrawSetFillPatternURL\n#define DrawSetFillPatternURL MagickDrawSetFillPatternURL\n#undef DrawSetFillRule\n#define DrawSetFillRule MagickDrawSetFillRule\n#undef DrawSetFont\n#define DrawSetFont MagickDrawSetFont\n#undef DrawSetFontFamily\n#define DrawSetFontFamily MagickDrawSetFontFamily\n#undef DrawSetFontSize\n#define DrawSetFontSize MagickDrawSetFontSize\n#undef DrawSetFontStretch\n#define DrawSetFontStretch MagickDrawSetFontStretch\n#undef DrawSetFontStyle\n#define DrawSetFontStyle MagickDrawSetFontStyle\n#undef DrawSetFontWeight\n#define DrawSetFontWeight MagickDrawSetFontWeight\n#undef DrawSetGravity\n#define DrawSetGravity MagickDrawSetGravity\n#undef DrawSetStrokeAntialias\n#define DrawSetStrokeAntialias MagickDrawSetStrokeAntialias\n#undef DrawSetStrokeColor\n#define DrawSetStrokeColor MagickDrawSetStrokeColor\n#undef DrawSetStrokeDashArray\n#define DrawSetStrokeDashArray MagickDrawSetStrokeDashArray\n#undef DrawSetStrokeDashOffset\n#define DrawSetStrokeDashOffset MagickDrawSetStrokeDashOffset\n#undef DrawSetStrokeLineCap\n#define DrawSetStrokeLineCap MagickDrawSetStrokeLineCap\n#undef DrawSetStrokeLineJoin\n#define DrawSetStrokeLineJoin MagickDrawSetStrokeLineJoin\n#undef DrawSetStrokeMiterLimit\n#define DrawSetStrokeMiterLimit MagickDrawSetStrokeMiterLimit\n#undef DrawSetStrokeOpacity\n#define DrawSetStrokeOpacity MagickDrawSetStrokeOpacity\n#undef DrawSetStrokePatternURL\n#define DrawSetStrokePatternURL MagickDrawSetStrokePatternURL\n#undef DrawSetStrokeWidth\n#define DrawSetStrokeWidth MagickDrawSetStrokeWidth\n#undef DrawSetTextAntialias\n#define DrawSetTextAntialias MagickDrawSetTextAntialias\n#undef DrawSetTextDecoration\n#define DrawSetTextDecoration MagickDrawSetTextDecoration\n#undef DrawSetTextEncoding\n#define DrawSetTextEncoding MagickDrawSetTextEncoding\n#undef DrawSetTextUnderColor\n#define DrawSetTextUnderColor MagickDrawSetTextUnderColor\n#undef DrawSetViewbox\n#define DrawSetViewbox MagickDrawSetViewbox\n#undef DrawSkewX\n#define DrawSkewX MagickDrawSkewX\n#undef DrawSkewY\n#define DrawSkewY MagickDrawSkewY\n#undef DrawTranslate\n#define DrawTranslate MagickDrawTranslate\n#undef NewDrawingWand\n#define NewDrawingWand MagickNewDrawingWand\n\ntypedef struct _DrawingWand\n  DrawingWand;\n\nextern WandExport char\n  *DrawGetClipPath(const DrawingWand *),\n  *DrawGetException(const DrawingWand *,ExceptionType *),\n  *DrawGetFont(const DrawingWand *),\n  *DrawGetFontFamily(const DrawingWand *),\n  *DrawGetTextEncoding(const DrawingWand *);\n\nextern WandExport ClipPathUnits\n  DrawGetClipUnits(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport DecorationType\n  DrawGetTextDecoration(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport double\n  DrawGetFillOpacity(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetFontSize(const DrawingWand *) MAGICK_FUNC_PURE,\n  *DrawGetStrokeDashArray(const DrawingWand *,unsigned long *),\n  DrawGetStrokeDashOffset(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetStrokeOpacity(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetStrokeWidth(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport DrawInfo\n  *DrawPeekGraphicContext(const DrawingWand *);\n\nextern WandExport DrawingWand\n  *CloneDrawingWand(const DrawingWand *drawing_wand),\n  *DrawAllocateWand(const DrawInfo *,Image *) MAGICK_ATTRIBUTE ((deprecated)),\n  *NewDrawingWand(void);\n\nextern WandExport FillRule\n  DrawGetClipRule(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetFillRule(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport GravityType\n  DrawGetGravity(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport LineCap\n  DrawGetStrokeLineCap(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport LineJoin\n  DrawGetStrokeLineJoin(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport StretchType\n  DrawGetFontStretch(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport StyleType\n  DrawGetFontStyle(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport unsigned int\n  DrawClearException(DrawingWand *),\n  DrawGetStrokeAntialias(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetTextAntialias(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawRender(const DrawingWand *) MAGICK_ATTRIBUTE ((deprecated)); /* Use MagickDrawImage() instead */\n\nextern WandExport unsigned long\n  DrawGetFontWeight(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetStrokeMiterLimit(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport void\n  DrawAffine(DrawingWand *,const AffineMatrix *),\n  DrawAnnotation(DrawingWand *,const double,const double,const unsigned char *),\n  DrawArc(DrawingWand *,const double,const double,const double,const double,\n    const double,const double),\n  DrawBezier(DrawingWand *,const unsigned long,const PointInfo *),\n  DrawCircle(DrawingWand *,const double,const double,const double,const double),\n  DrawColor(DrawingWand *,const double,const double,const PaintMethod),\n  DrawComment(DrawingWand *,const char *),\n  DestroyDrawingWand(DrawingWand *),\n  DrawEllipse(DrawingWand *,const double,const double,const double,const double,\n    const double,const double),\n  DrawComposite(DrawingWand *,const CompositeOperator,const double,const double,\n    const double,const double,const Image *),\n  DrawGetFillColor(const DrawingWand *,PixelWand *),\n  DrawGetStrokeColor(const DrawingWand *,PixelWand *),\n  DrawGetTextUnderColor(const DrawingWand *,PixelWand *),\n  DrawLine(DrawingWand *,const double, const double,const double,const double),\n  DrawMatte(DrawingWand *,const double,const double,const PaintMethod),\n  DrawPathClose(DrawingWand *),\n  DrawPathCurveToAbsolute(DrawingWand *,const double,const double,const double,\n    const double,const double,const double),\n  DrawPathCurveToRelative(DrawingWand *,const double,const double,const double,\n    const double,const double, const double),\n  DrawPathCurveToQuadraticBezierAbsolute(DrawingWand *,const double,\n    const double,const double,const double),\n  DrawPathCurveToQuadraticBezierRelative(DrawingWand *,const double,\n    const double,const double,const double),\n  DrawPathCurveToQuadraticBezierSmoothAbsolute(DrawingWand *,const double,\n    const double),\n  DrawPathCurveToQuadraticBezierSmoothRelative(DrawingWand *,const double,\n    const double),\n  DrawPathCurveToSmoothAbsolute(DrawingWand *,const double,const double,\n    const double,const double),\n  DrawPathCurveToSmoothRelative(DrawingWand *,const double,const double,\n    const double,const double),\n  DrawPathEllipticArcAbsolute(DrawingWand *,const double,const double,\n    const double,unsigned int,unsigned int,const double,const double),\n  DrawPathEllipticArcRelative(DrawingWand *,const double,const double,\n    const double,unsigned int,unsigned int,const double,const double),\n  DrawPathFinish(DrawingWand *),\n  DrawPathLineToAbsolute(DrawingWand *,const double,const double),\n  DrawPathLineToRelative(DrawingWand *,const double,const double),\n  DrawPathLineToHorizontalAbsolute(DrawingWand *,const double),\n  DrawPathLineToHorizontalRelative(DrawingWand *,const double),\n  DrawPathLineToVerticalAbsolute(DrawingWand *,const double),\n  DrawPathLineToVerticalRelative(DrawingWand *,const double),\n  DrawPathMoveToAbsolute(DrawingWand *,const double,const double),\n  DrawPathMoveToRelative(DrawingWand *,const double,const double),\n  DrawPathStart(DrawingWand *),\n  DrawPoint(DrawingWand *,const double,const double),\n  DrawPolygon(DrawingWand *,const unsigned long,const PointInfo *),\n  DrawPolyline(DrawingWand *,const unsigned long,const PointInfo *),\n  DrawPopClipPath(DrawingWand *),\n  DrawPopDefs(DrawingWand *),\n  DrawPopGraphicContext(DrawingWand *),\n  DrawPopPattern(DrawingWand *),\n  DrawPushClipPath(DrawingWand *,const char *),\n  DrawPushDefs(DrawingWand *),\n  DrawPushGraphicContext(DrawingWand *),\n  DrawPushPattern(DrawingWand *,const char *,const double,const double,\n    const double,const double),\n  DrawRectangle(DrawingWand *,const double,const double,const double,\n    const double),\n  DrawRotate(DrawingWand *,const double),\n  DrawRoundRectangle(DrawingWand *,double,double,double,double,double,double),\n  DrawScale(DrawingWand *,const double,const double),\n  DrawSetClipPath(DrawingWand *,const char *),\n  DrawSetClipRule(DrawingWand *,const FillRule),\n  DrawSetClipUnits(DrawingWand *,const ClipPathUnits),\n  DrawSetFillColor(DrawingWand *,const PixelWand *),\n  DrawSetFillOpacity(DrawingWand *,const double),\n  DrawSetFillRule(DrawingWand *,const FillRule),\n  DrawSetFillPatternURL(DrawingWand *,const char *),\n  DrawSetFont(DrawingWand *,const char *),\n  DrawSetFontFamily(DrawingWand *,const char *),\n  DrawSetFontSize(DrawingWand *,const double),\n  DrawSetFontStretch(DrawingWand *,const StretchType),\n  DrawSetFontStyle(DrawingWand *,const StyleType),\n  DrawSetFontWeight(DrawingWand *,const unsigned long),\n  DrawSetGravity(DrawingWand *,const GravityType),\n  DrawSkewX(DrawingWand *,const double),\n  DrawSkewY(DrawingWand *,const double),\n  DrawSetStrokeAntialias(DrawingWand *,const unsigned int),\n  DrawSetStrokeColor(DrawingWand *,const PixelWand *),\n  DrawSetStrokeDashArray(DrawingWand *,const unsigned long,const double *),\n  DrawSetStrokeDashOffset(DrawingWand *,const double dashoffset),\n  DrawSetStrokeLineCap(DrawingWand *,const LineCap),\n  DrawSetStrokeLineJoin(DrawingWand *,const LineJoin),\n  DrawSetStrokeMiterLimit(DrawingWand *,const unsigned long),\n  DrawSetStrokeOpacity(DrawingWand *, const double),\n  DrawSetStrokePatternURL(DrawingWand *,const char *),\n  DrawSetStrokeWidth(DrawingWand *,const double),\n  DrawSetTextAntialias(DrawingWand *,const unsigned int),\n  DrawSetTextDecoration(DrawingWand *,const DecorationType),\n  DrawSetTextEncoding(DrawingWand *,const char *),\n  DrawSetTextUnderColor(DrawingWand *,const PixelWand *),\n  DrawSetViewbox(DrawingWand *,unsigned long,unsigned long,unsigned long,\n    unsigned long),\n  DrawTranslate(DrawingWand *,const double,const double);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/wand/magick_wand.h",
    "content": "/* Copyright (C) 2003-2019 GraphicsMagick Group */\n\n/*\n  ImageMagick MagickWand interface.\n*/\n\n#ifndef _MAGICK_WAND_H\n#define _MAGICK_WAND_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#if defined(_VISUALC_)\n#  if defined(_MT) && defined(_DLL) && !defined(_LIB)\n#    pragma warning( disable: 4273 )\n#    if !defined(_WANDLIB_)\n#      define WandExport __declspec(dllimport)\n#    else\n#     define WandExport __declspec(dllexport)\n#    endif\n#  else\n#    define WandExport\n#  endif\n\n#  pragma warning(disable : 4018)\n#  pragma warning(disable : 4244)\n#  pragma warning(disable : 4142)\n#else\n#  define WandExport\n#endif\n\n#include \"magick/api.h\"\n#include \"wand/wand_symbols.h\"\n#include \"wand/drawing_wand.h\"\n#include \"wand/pixel_wand.h\"\n\n  /*\n    ImageMagick compatibility definitions\n  */\n#define MagickSizeType magick_int64_t\n#define ReplaceCompositeOp CopyCompositeOp\n#define IndexChannel BlackChannel\n#define AreaResource UndefinedResource /* not supported */\n\nextern WandExport int\n  FormatMagickString(char *,const size_t,const char *,...)\n    MAGICK_ATTRIBUTE((format (printf,3,4)));\nextern WandExport size_t\n  CopyMagickString(char *,const char *,const size_t);\n\ntypedef struct _MagickWand\n  MagickWand;\n\nextern WandExport char\n  *MagickDescribeImage(MagickWand *),\n  *MagickGetConfigureInfo(MagickWand *,const char *) MAGICK_FUNC_CONST,\n  *MagickGetException(const MagickWand *,ExceptionType *),\n  *MagickGetFilename(const MagickWand *),\n  *MagickGetImageAttribute(MagickWand *, const char *),\n  *MagickGetImageFilename(MagickWand *),\n  *MagickGetImageFormat(MagickWand *),\n  *MagickGetImageSignature(MagickWand *),\n  **MagickQueryFonts(const char *,unsigned long *),\n  **MagickQueryFormats(const char *,unsigned long *);\n\nextern WandExport CompositeOperator\n  MagickGetImageCompose(MagickWand *);\n\nextern WandExport ColorspaceType\n  MagickGetImageColorspace(MagickWand *);\n\nextern WandExport CompressionType\n  MagickGetImageCompression(MagickWand *);\n\nextern WandExport const char\n  *MagickGetCopyright(void) MAGICK_FUNC_CONST,\n  *MagickGetHomeURL(void) MAGICK_FUNC_CONST,\n  *MagickGetImageGeometry(MagickWand *),\n  *MagickGetPackageName(void) MAGICK_FUNC_CONST,\n  *MagickGetQuantumDepth(unsigned long *),\n  *MagickGetReleaseDate(void) MAGICK_FUNC_CONST,\n  *MagickGetVersion(unsigned long *) MAGICK_FUNC_CONST;\n\nextern WandExport DisposeType\n  MagickGetImageDispose(MagickWand *);\n\nextern WandExport double\n  MagickGetImageGamma(MagickWand *),\n  MagickGetImageFuzz(MagickWand *),\n  *MagickGetSamplingFactors(MagickWand *,unsigned long *),\n  *MagickQueryFontMetrics(MagickWand *,const DrawingWand *,const char *);\n\nextern WandExport GravityType\n  MagickGetImageGravity(MagickWand *wand);\n\nextern WandExport ImageType\n  MagickGetImageType(MagickWand *);\n\nextern WandExport ImageType\n  MagickGetImageSavedType(MagickWand *) MAGICK_FUNC_CONST;\n\nextern WandExport InterlaceType\n  MagickGetImageInterlaceScheme(MagickWand *);\n\nextern WandExport long\n  MagickGetImageIndex(MagickWand *);\n\nextern WandExport MagickSizeType\n  MagickGetImageSize(MagickWand *);\n\nextern WandExport MagickWand\n  *CloneMagickWand(const MagickWand *),\n  *MagickAppendImages(MagickWand *,const unsigned int),\n  *MagickAverageImages(MagickWand *),\n  *MagickCoalesceImages(MagickWand *),\n  *MagickCompareImageChannels(MagickWand *,const MagickWand *,const ChannelType,\n    const MetricType,double *),\n  *MagickCompareImages(MagickWand *,const MagickWand *,const MetricType,\n    double *),\n  *MagickDeconstructImages(MagickWand *),\n  *MagickFlattenImages(MagickWand *),\n  *MagickFxImage(MagickWand *,const char *),\n  *MagickFxImageChannel(MagickWand *,const ChannelType,const char *),\n  *MagickGetImage(MagickWand *),\n  *MagickMorphImages(MagickWand *,const unsigned long),\n  *MagickMosaicImages(MagickWand *),\n  *MagickMontageImage(MagickWand *,const DrawingWand *,const char *,\n    const char *,const MontageMode,const char *),\n  *MagickPreviewImages(MagickWand *wand,const PreviewType),\n  *MagickSteganoImage(MagickWand *,const MagickWand *,const long),\n  *MagickStereoImage(MagickWand *,const MagickWand *),\n  *MagickTextureImage(MagickWand *,const MagickWand *),\n  *MagickTransformImage(MagickWand *,const char *,const char *),\n  *NewMagickWand(void);\n\nextern WandExport OrientationType\n  MagickGetImageOrientation(MagickWand *);\n\nextern WandExport PixelWand\n  **MagickGetImageHistogram(MagickWand *,unsigned long *);\n\nextern WandExport RenderingIntent\n  MagickGetImageRenderingIntent(MagickWand *);\n\nextern WandExport ResolutionType\n  MagickGetImageUnits(MagickWand *);\n\nextern WandExport unsigned int\n  DestroyMagickWand(MagickWand *),\n  MagickAdaptiveThresholdImage(MagickWand *,const unsigned long,\n    const unsigned long,const long),\n  MagickAddImage(MagickWand *,const MagickWand *),\n  MagickAddNoiseImage(MagickWand *,const NoiseType),\n  MagickAffineTransformImage(MagickWand *,const DrawingWand *),\n  MagickAnnotateImage(MagickWand *,const DrawingWand *,const double,\n    const double,const double,const char *),\n  MagickAnimateImages(MagickWand *,const char *),\n  MagickAutoOrientImage(MagickWand *wand,const OrientationType),\n  MagickBlackThresholdImage(MagickWand *,const PixelWand *),\n  MagickBlurImage(MagickWand *,const double,const double),\n  MagickBorderImage(MagickWand *,const PixelWand *,const unsigned long,\n    const unsigned long),\n  MagickCdlImage(MagickWand *wand,const char *cdl),\n  MagickCharcoalImage(MagickWand *,const double,const double),\n  MagickChopImage(MagickWand *,const unsigned long,const unsigned long,\n    const long,const long),\n  MagickClipImage(MagickWand *),\n  MagickClipPathImage(MagickWand *,const char *,const unsigned int),\n  MagickColorFloodfillImage(MagickWand *,const PixelWand *,const double,\n    const PixelWand *,const long,const long),\n  MagickColorizeImage(MagickWand *,const PixelWand *,const PixelWand *),\n  MagickCommentImage(MagickWand *,const char *),\n  MagickCompositeImage(MagickWand *,const MagickWand *,const CompositeOperator,\n    const long,const long),\n  MagickContrastImage(MagickWand *,const unsigned int),\n  MagickConvolveImage(MagickWand *,const unsigned long,const double *),\n  MagickCropImage(MagickWand *,const unsigned long,const unsigned long,\n    const long,const long),\n  MagickCycleColormapImage(MagickWand *,const long),\n  MagickDespeckleImage(MagickWand *),\n  MagickDisplayImage(MagickWand *,const char *),\n  MagickDisplayImages(MagickWand *,const char *),\n  MagickDrawImage(MagickWand *,const DrawingWand *),\n  MagickEdgeImage(MagickWand *,const double),\n  MagickEmbossImage(MagickWand *,const double,const double),\n  MagickEnhanceImage(MagickWand *),\n  MagickEqualizeImage(MagickWand *),\n  MagickExtentImage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t),\n  MagickFlipImage(MagickWand *),\n  MagickFlopImage(MagickWand *),\n  MagickFrameImage(MagickWand *,const PixelWand *,const unsigned long,\n    const unsigned long,const long,const long),\n  MagickGammaImage(MagickWand *,const double),\n  MagickGammaImageChannel(MagickWand *,const ChannelType,const double),\n  MagickGetImageBackgroundColor(MagickWand *,PixelWand *),\n  MagickGetImageBluePrimary(MagickWand *,double *,double *),\n  MagickGetImageBorderColor(MagickWand *,PixelWand *),\n  MagickGetImageBoundingBox(MagickWand *wand,const double fuzz,\n    unsigned long *width,unsigned long *height,long *x, long *y),\n  MagickGetImageChannelExtrema(MagickWand *,const ChannelType,unsigned long *,\n    unsigned long *),\n  MagickGetImageChannelMean(MagickWand *,const ChannelType,double *,double *),\n  MagickGetImageColormapColor(MagickWand *,const unsigned long,PixelWand *),\n  MagickGetImageExtrema(MagickWand *,unsigned long *,unsigned long *),\n  MagickGetImageGreenPrimary(MagickWand *,double *,double *),\n  MagickGetImageMatte(MagickWand *),\n  MagickGetImageMatteColor(MagickWand *,PixelWand *),\n  MagickGetImagePage(MagickWand *wand,\n    unsigned long *width,unsigned long *height,long *x,long *y),\n  MagickGetImagePixels(MagickWand *,const long,const long,const unsigned long,\n    const unsigned long,const char *,const StorageType,unsigned char *),\n  MagickGetImageRedPrimary(MagickWand *,double *,double *),\n  MagickGetImageResolution(MagickWand *,double *,double *),\n  MagickGetImageWhitePoint(MagickWand *,double *,double *),\n  MagickGetSize(const MagickWand *,unsigned long *,unsigned long *),\n  MagickHaldClutImage(MagickWand *wand,const MagickWand *clut_wand),\n  MagickHasColormap(MagickWand *,unsigned int *),\n  MagickHasNextImage(MagickWand *),\n  MagickHasPreviousImage(MagickWand *),\n  MagickImplodeImage(MagickWand *,const double),\n  MagickIsGrayImage(MagickWand *,unsigned int *),\n  MagickIsMonochromeImage(MagickWand *,unsigned int *),\n  MagickIsOpaqueImage(MagickWand *,unsigned int *),\n  MagickIsPaletteImage(MagickWand *,unsigned int *),\n  MagickLabelImage(MagickWand *,const char *),\n  MagickLevelImage(MagickWand *,const double,const double,const double),\n  MagickLevelImageChannel(MagickWand *,const ChannelType,const double,\n    const double,const double),\n  MagickMagnifyImage(MagickWand *),\n  MagickMapImage(MagickWand *,const MagickWand *,const unsigned int),\n  MagickMatteFloodfillImage(MagickWand *,const Quantum,const double,\n    const PixelWand *,const long,const long),\n  MagickMedianFilterImage(MagickWand *,const double),\n  MagickMinifyImage(MagickWand *),\n  MagickModulateImage(MagickWand *,const double,const double,const double),\n  MagickMotionBlurImage(MagickWand *,const double,const double,const double),\n  MagickNegateImage(MagickWand *,const unsigned int),\n  MagickNegateImageChannel(MagickWand *,const ChannelType,const unsigned int),\n  MagickNextImage(MagickWand *),\n  MagickNormalizeImage(MagickWand *),\n  MagickOilPaintImage(MagickWand *,const double),\n  MagickOpaqueImage(MagickWand *,const PixelWand *,const PixelWand *,\n    const double),\n  MagickOperatorImageChannel(MagickWand *,const ChannelType,const QuantumOperator,\n    const double),\n  MagickPingImage(MagickWand *,const char *),\n  MagickPreviousImage(MagickWand *),\n  MagickProfileImage(MagickWand *,const char *,const unsigned char *,\n    const unsigned long),\n  MagickQuantizeImage(MagickWand *,const unsigned long,const ColorspaceType,\n    const unsigned long,const unsigned int,const unsigned int),\n  MagickQuantizeImages(MagickWand *,const unsigned long,const ColorspaceType,\n    const unsigned long,const unsigned int,const unsigned int),\n  MagickRadialBlurImage(MagickWand *,const double),\n  MagickRaiseImage(MagickWand *,const unsigned long,const unsigned long,\n    const long,const long,const unsigned int),\n  MagickReadImage(MagickWand *,const char *),\n  MagickReadImageBlob(MagickWand *,const unsigned char *,const size_t length),\n  MagickReadImageFile(MagickWand *,FILE *),\n  MagickReduceNoiseImage(MagickWand *,const double),\n  MagickRelinquishMemory(void *),\n  MagickRemoveImage(MagickWand *),\n  MagickRemoveImageOption(MagickWand *wand,const char *,const char *),\n  MagickResampleImage(MagickWand *,const double,const double,const FilterTypes,\n    const double),\n  MagickResizeImage(MagickWand *,const unsigned long,const unsigned long,\n    const FilterTypes,const double),\n  MagickRollImage(MagickWand *,const long,const long),\n  MagickRotateImage(MagickWand *,const PixelWand *,const double),\n  MagickSampleImage(MagickWand *,const unsigned long,const unsigned long),\n  MagickScaleImage(MagickWand *,const unsigned long,const unsigned long),\n  MagickSeparateImageChannel(MagickWand *,const ChannelType),\n  MagickSetCompressionQuality(MagickWand *wand,const unsigned long quality),\n  MagickSetFilename(MagickWand *,const char *),\n  MagickSetFormat(MagickWand *,const char *),\n  MagickSetImage(MagickWand *,const MagickWand *),\n  MagickSetImageAttribute(MagickWand *,const char *, const char *),\n  MagickSetImageBackgroundColor(MagickWand *,const PixelWand *),\n  MagickSetImageBluePrimary(MagickWand *,const double,const double),\n  MagickSetImageBorderColor(MagickWand *,const PixelWand *),\n  MagickSetImageChannelDepth(MagickWand *,const ChannelType,\n    const unsigned long),\n  MagickSetImageColormapColor(MagickWand *,const unsigned long,\n    const PixelWand *),\n  MagickSetImageCompose(MagickWand *,const CompositeOperator),\n  MagickSetImageCompression(MagickWand *,const CompressionType),\n  MagickSetImageDelay(MagickWand *,const unsigned long),\n  MagickSetImageDepth(MagickWand *,const unsigned long),\n  MagickSetImageDispose(MagickWand *,const DisposeType),\n  MagickSetImageColorspace(MagickWand *,const ColorspaceType),\n  MagickSetImageGreenPrimary(MagickWand *,const double,const double),\n  MagickSetImageGamma(MagickWand *,const double),\n  MagickSetImageGeometry(MagickWand *,const char *),\n  MagickSetImageGravity(MagickWand *,const GravityType),\n  MagickSetImageFilename(MagickWand *,const char *),\n  MagickSetImageFormat(MagickWand *wand,const char *format),\n  MagickSetImageFuzz(MagickWand *,const double),\n  MagickSetImageIndex(MagickWand *,const long),\n  MagickSetImageInterlaceScheme(MagickWand *,const InterlaceType),\n  MagickSetImageIterations(MagickWand *,const unsigned long),\n  MagickSetImageMatte(MagickWand *,const unsigned int),\n  MagickSetImageMatteColor(MagickWand *,const PixelWand *),\n  MagickSetImageOption(MagickWand *,const char *,const char *,const char *),\n  MagickSetImageOrientation(MagickWand *,const OrientationType),\n  MagickSetImagePage(MagickWand *wand,\n    const unsigned long width,const unsigned long height,const long x,\n    const long y),\n  MagickSetImagePixels(MagickWand *,const long,const long,const unsigned long,\n    const unsigned long,const char *,const StorageType,unsigned char *),\n  MagickSetImageRedPrimary(MagickWand *,const double,const double),\n  MagickSetImageRenderingIntent(MagickWand *,const RenderingIntent),\n  MagickSetImageResolution(MagickWand *,const double,const double),\n  MagickSetImageScene(MagickWand *,const unsigned long),\n  MagickSetImageType(MagickWand *,const ImageType),\n  MagickSetImageSavedType(MagickWand *,const ImageType),\n  MagickSetImageUnits(MagickWand *,const ResolutionType),\n  MagickSetImageVirtualPixelMethod(MagickWand *,const VirtualPixelMethod),\n  MagickSetPassphrase(MagickWand *,const char *),\n  MagickSetImageProfile(MagickWand *,const char *,const unsigned char *,\n    const unsigned long),\n  MagickSetResolution(MagickWand *wand,\n    const double x_resolution,const double y_resolution),\n  MagickSetResolutionUnits(MagickWand *wand,const ResolutionType units),\n  MagickSetResourceLimit(const ResourceType type,const unsigned long limit),\n  MagickSetSamplingFactors(MagickWand *,const unsigned long,const double *),\n  MagickSetSize(MagickWand *,const unsigned long,const unsigned long),\n  MagickSetImageWhitePoint(MagickWand *,const double,const double),\n  MagickSetInterlaceScheme(MagickWand *,const InterlaceType),\n  MagickSharpenImage(MagickWand *,const double,const double),\n  MagickShaveImage(MagickWand *,const unsigned long,const unsigned long),\n  MagickShearImage(MagickWand *,const PixelWand *,const double,const double),\n  MagickSolarizeImage(MagickWand *,const double),\n  MagickSpreadImage(MagickWand *,const double),\n  MagickStripImage(MagickWand *),\n  MagickSwirlImage(MagickWand *,const double),\n  MagickTintImage(MagickWand *,const PixelWand *,const PixelWand *),\n  MagickThresholdImage(MagickWand *,const double),\n  MagickThresholdImageChannel(MagickWand *,const ChannelType,const double),\n  MagickTransparentImage(MagickWand *,const PixelWand *,const Quantum,\n    const double),\n  MagickTrimImage(MagickWand *,const double),\n  MagickUnsharpMaskImage(MagickWand *,const double,const double,const double,\n    const double),\n  MagickWaveImage(MagickWand *,const double,const double),\n  MagickWhiteThresholdImage(MagickWand *,const PixelWand *),\n  MagickWriteImage(MagickWand *,const char *),\n  MagickWriteImageFile(MagickWand *,FILE *),\n  MagickWriteImagesFile(MagickWand *,FILE *,const unsigned int),\n  MagickWriteImages(MagickWand *,const char *,const unsigned int);\n\nextern WandExport unsigned long\n  MagickGetImageColors(MagickWand *),\n  MagickGetImageDelay(MagickWand *),\n  MagickGetImageChannelDepth(MagickWand *,const ChannelType),\n  MagickGetImageDepth(MagickWand *),\n  MagickGetImageHeight(MagickWand *),\n  MagickGetImageIterations(MagickWand *),\n  MagickGetImageScene(MagickWand *),\n  MagickGetImageWidth(MagickWand *),\n  MagickGetNumberImages(MagickWand *),\n  MagickGetResourceLimit(const ResourceType);\n\nextern WandExport VirtualPixelMethod\n  MagickGetImageVirtualPixelMethod(MagickWand *);\n\nextern WandExport unsigned char\n  *MagickGetImageProfile(MagickWand *,const char *,unsigned long *),\n  *MagickRemoveImageProfile(MagickWand *,const char *,unsigned long *),\n  *MagickWriteImageBlob(MagickWand *,size_t *);\n\nextern WandExport void\n  MagickClearException(MagickWand *),\n  MagickResetIterator(MagickWand *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/wand/pixel_wand.h",
    "content": "/*\n  Copyright (C) 2003-2009 GraphicsMagick Group\n  Copyright (C) 2003 ImageMagick Studio\n \n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n \n  GraphicsMagick Pixel Wand Methods.\n*/\n#ifndef _MAGICK_PIXEL_WAND_H\n#define _MAGICK_PIXEL_WAND_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"wand/wand_symbols.h\"\n\ntypedef struct _PixelWand PixelWand;\n\nextern WandExport char\n  *PixelGetColorAsString(const PixelWand *);\n\nextern WandExport double\n  PixelGetBlack(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetBlue(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetCyan(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetGreen(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetMagenta(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetOpacity(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetRed(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetYellow(const PixelWand *) MAGICK_FUNC_PURE;\n\nextern WandExport PixelWand\n  *ClonePixelWand(const PixelWand *),\n  **ClonePixelWands(const PixelWand **,const unsigned long),\n  *NewPixelWand(void),\n  **NewPixelWands(const unsigned long);\n\nextern WandExport Quantum\n  PixelGetBlackQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetBlueQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetCyanQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetGreenQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetMagentaQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetOpacityQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetRedQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetYellowQuantum(const PixelWand *) MAGICK_FUNC_PURE;\n\nextern WandExport unsigned int\n  PixelSetColor(PixelWand *,const char *);\n\nextern WandExport unsigned long\n  PixelGetColorCount(const PixelWand *) MAGICK_FUNC_PURE;\n\nextern WandExport void\n  DestroyPixelWand(PixelWand *),\n  PixelGetQuantumColor(const PixelWand *,PixelPacket *),\n  PixelSetBlack(PixelWand *,const double),\n  PixelSetBlackQuantum(PixelWand *,const Quantum),\n  PixelSetBlue(PixelWand *,const double),\n  PixelSetBlueQuantum(PixelWand *,const Quantum),\n  PixelSetColorCount(PixelWand *,const unsigned long),\n  PixelSetCyan(PixelWand *,const double),\n  PixelSetCyanQuantum(PixelWand *,const Quantum),\n  PixelSetGreen(PixelWand *,const double),\n  PixelSetGreenQuantum(PixelWand *,const Quantum),\n  PixelSetMagenta(PixelWand *,const double),\n  PixelSetMagentaQuantum(PixelWand *,const Quantum),\n  PixelSetOpacity(PixelWand *,const double),\n  PixelSetOpacityQuantum(PixelWand *,const Quantum),\n  PixelSetQuantumColor(PixelWand *,PixelPacket *),\n  PixelSetRed(PixelWand *,const double),\n  PixelSetRedQuantum(PixelWand *,const Quantum),\n  PixelSetYellow(PixelWand *,const double),\n  PixelSetYellowQuantum(PixelWand *,const Quantum);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/wand/wand_api.h",
    "content": "/*\n  Copyright (C) 2003-2018 GraphicsMagick Group\n\n  GraphicsMagick Wand API Methods\n*/\n#ifndef _MAGICK_WAND_API_H\n#define _MAGICK_WAND_API_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include <magick/api.h>\n#include <wand/wand_symbols.h>\n\n#if defined(_VISUALC_)\n\n/**\n * Under VISUALC we have single threaded static libraries, or\n * mutli-threaded DLLs using the multithreaded runtime DLLs.\n **/\n#  if defined(_MT) && defined(_DLL) && !defined(_LIB)\n#    pragma warning( disable: 4273 )    /* Disable the stupid dll linkage warnings */\n#    if !defined(_WANDLIB_)\n#      define WandExport __declspec(dllimport)\n#    else\n#     define WandExport __declspec(dllexport)\n#    endif\n#  else\n#    define WandExport\n#  endif\n\n#  pragma warning(disable : 4018)\n#  pragma warning(disable : 4244)\n#  pragma warning(disable : 4142)\n#else\n#  define WandExport\n#endif\n\n#include <wand/drawing_wand.h>\n#include <wand/magick_wand.h>\n#include <wand/pixel_wand.h>\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_WAND_API_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/wand/wand_symbols.h",
    "content": "/*\n  Copyright (C) 2012-2018 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Library symbol name-scoping support.\n*/\n\n#if !defined(_MAGICK_WAND_SYMBOLS_H)\n#define _MAGICK_WAND_SYMBOLS_H\n\n#if defined(PREFIX_MAGICK_SYMBOLS)\n\n#define CloneMagickWand GmCloneMagickWand\n#define ClonePixelWand GmClonePixelWand\n#define ClonePixelWands GmClonePixelWands\n#define CopyMagickString GmCopyMagickString\n#define DestroyMagickWand GmDestroyMagickWand\n#define DestroyPixelWand GmDestroyPixelWand\n#define FormatMagickString GmFormatMagickString\n#define FormatMagickStringList GmFormatMagickStringList\n#define MagickAdaptiveThresholdImage GmMagickAdaptiveThresholdImage\n#define MagickAddImage GmMagickAddImage\n#define MagickAddNoiseImage GmMagickAddNoiseImage\n#define MagickAffineTransformImage GmMagickAffineTransformImage\n#define MagickAnimateImages GmMagickAnimateImages\n#define MagickAnnotateImage GmMagickAnnotateImage\n#define MagickAppendImages GmMagickAppendImages\n#define MagickAutoOrientImage GmMagickAutoOrientImage\n#define MagickAverageImages GmMagickAverageImages\n#define MagickBlackThresholdImage GmMagickBlackThresholdImage\n#define MagickBlurImage GmMagickBlurImage\n#define MagickBorderImage GmMagickBorderImage\n#define MagickCdlImage GmMagickCdlImage\n#define MagickCharcoalImage GmMagickCharcoalImage\n#define MagickChopImage GmMagickChopImage\n#define MagickClearException GmMagickClearException\n#define MagickClipImage GmMagickClipImage\n#define MagickClipPathImage GmMagickClipPathImage\n#define MagickCloneDrawingWand GmMagickCloneDrawingWand\n#define MagickCoalesceImages GmMagickCoalesceImages\n#define MagickColorFloodfillImage GmMagickColorFloodfillImage\n#define MagickColorizeImage GmMagickColorizeImage\n#define MagickCommentImage GmMagickCommentImage\n#define MagickCompareImageChannels GmMagickCompareImageChannels\n#define MagickCompareImages GmMagickCompareImages\n#define MagickCompositeImage GmMagickCompositeImage\n#define MagickContrastImage GmMagickContrastImage\n#define MagickConvolveImage GmMagickConvolveImage\n#define MagickCropImage GmMagickCropImage\n#define MagickCycleColormapImage GmMagickCycleColormapImage\n#define MagickDeconstructImages GmMagickDeconstructImages\n#define MagickDescribeImage GmMagickDescribeImage\n#define MagickDespeckleImage GmMagickDespeckleImage\n#define MagickDestroyDrawingWand GmMagickDestroyDrawingWand\n#define MagickDisplayImage GmMagickDisplayImage\n#define MagickDisplayImages GmMagickDisplayImages\n#define MagickDrawAffine GmMagickDrawAffine\n#define MagickDrawAllocateWand GmMagickDrawAllocateWand\n#define MagickDrawAnnotation GmMagickDrawAnnotation\n#define MagickDrawArc GmMagickDrawArc\n#define MagickDrawBezier GmMagickDrawBezier\n#define MagickDrawCircle GmMagickDrawCircle\n#define MagickDrawClearException GmMagickDrawClearException\n#define MagickDrawColor GmMagickDrawColor\n#define MagickDrawComment GmMagickDrawComment\n#define MagickDrawComposite GmMagickDrawComposite\n#define MagickDrawEllipse GmMagickDrawEllipse\n#define MagickDrawGetClipPath GmMagickDrawGetClipPath\n#define MagickDrawGetClipRule GmMagickDrawGetClipRule\n#define MagickDrawGetClipUnits GmMagickDrawGetClipUnits\n#define MagickDrawGetException GmMagickDrawGetException\n#define MagickDrawGetFillColor GmMagickDrawGetFillColor\n#define MagickDrawGetFillOpacity GmMagickDrawGetFillOpacity\n#define MagickDrawGetFillRule GmMagickDrawGetFillRule\n#define MagickDrawGetFont GmMagickDrawGetFont\n#define MagickDrawGetFontFamily GmMagickDrawGetFontFamily\n#define MagickDrawGetFontSize GmMagickDrawGetFontSize\n#define MagickDrawGetFontStretch GmMagickDrawGetFontStretch\n#define MagickDrawGetFontStyle GmMagickDrawGetFontStyle\n#define MagickDrawGetFontWeight GmMagickDrawGetFontWeight\n#define MagickDrawGetGravity GmMagickDrawGetGravity\n#define MagickDrawGetStrokeAntialias GmMagickDrawGetStrokeAntialias\n#define MagickDrawGetStrokeColor GmMagickDrawGetStrokeColor\n#define MagickDrawGetStrokeDashArray GmMagickDrawGetStrokeDashArray\n#define MagickDrawGetStrokeDashOffset GmMagickDrawGetStrokeDashOffset\n#define MagickDrawGetStrokeLineCap GmMagickDrawGetStrokeLineCap\n#define MagickDrawGetStrokeLineJoin GmMagickDrawGetStrokeLineJoin\n#define MagickDrawGetStrokeMiterLimit GmMagickDrawGetStrokeMiterLimit\n#define MagickDrawGetStrokeOpacity GmMagickDrawGetStrokeOpacity\n#define MagickDrawGetStrokeWidth GmMagickDrawGetStrokeWidth\n#define MagickDrawGetTextAntialias GmMagickDrawGetTextAntialias\n#define MagickDrawGetTextDecoration GmMagickDrawGetTextDecoration\n#define MagickDrawGetTextEncoding GmMagickDrawGetTextEncoding\n#define MagickDrawGetTextUnderColor GmMagickDrawGetTextUnderColor\n#define MagickDrawImage GmMagickDrawImage\n#define MagickDrawLine GmMagickDrawLine\n#define MagickDrawMatte GmMagickDrawMatte\n#define MagickDrawPathClose GmMagickDrawPathClose\n#define MagickDrawPathCurveToAbsolute GmMagickDrawPathCurveToAbsolute\n#define MagickDrawPathCurveToQuadraticBezierAbsolute GmMagickDrawPathCurveToQuadraticBezierAbsolute\n#define MagickDrawPathCurveToQuadraticBezierRelative GmMagickDrawPathCurveToQuadraticBezierRelative\n#define MagickDrawPathCurveToQuadraticBezierSmoothAbsolute GmMagickDrawPathCurveToQuadraticBezierSmoothAbsolute\n#define MagickDrawPathCurveToQuadraticBezierSmoothRelative GmMagickDrawPathCurveToQuadraticBezierSmoothRelative\n#define MagickDrawPathCurveToRelative GmMagickDrawPathCurveToRelative\n#define MagickDrawPathCurveToSmoothAbsolute GmMagickDrawPathCurveToSmoothAbsolute\n#define MagickDrawPathCurveToSmoothRelative GmMagickDrawPathCurveToSmoothRelative\n#define MagickDrawPathEllipticArcAbsolute GmMagickDrawPathEllipticArcAbsolute\n#define MagickDrawPathEllipticArcRelative GmMagickDrawPathEllipticArcRelative\n#define MagickDrawPathFinish GmMagickDrawPathFinish\n#define MagickDrawPathLineToAbsolute GmMagickDrawPathLineToAbsolute\n#define MagickDrawPathLineToHorizontalAbsolute GmMagickDrawPathLineToHorizontalAbsolute\n#define MagickDrawPathLineToHorizontalRelative GmMagickDrawPathLineToHorizontalRelative\n#define MagickDrawPathLineToRelative GmMagickDrawPathLineToRelative\n#define MagickDrawPathLineToVerticalAbsolute GmMagickDrawPathLineToVerticalAbsolute\n#define MagickDrawPathLineToVerticalRelative GmMagickDrawPathLineToVerticalRelative\n#define MagickDrawPathMoveToAbsolute GmMagickDrawPathMoveToAbsolute\n#define MagickDrawPathMoveToRelative GmMagickDrawPathMoveToRelative\n#define MagickDrawPathStart GmMagickDrawPathStart\n#define MagickDrawPeekGraphicContext GmMagickDrawPeekGraphicContext\n#define MagickDrawPoint GmMagickDrawPoint\n#define MagickDrawPolygon GmMagickDrawPolygon\n#define MagickDrawPolyline GmMagickDrawPolyline\n#define MagickDrawPopClipPath GmMagickDrawPopClipPath\n#define MagickDrawPopDefs GmMagickDrawPopDefs\n#define MagickDrawPopGraphicContext GmMagickDrawPopGraphicContext\n#define MagickDrawPopPattern GmMagickDrawPopPattern\n#define MagickDrawPushClipPath GmMagickDrawPushClipPath\n#define MagickDrawPushDefs GmMagickDrawPushDefs\n#define MagickDrawPushGraphicContext GmMagickDrawPushGraphicContext\n#define MagickDrawPushPattern GmMagickDrawPushPattern\n#define MagickDrawRectangle GmMagickDrawRectangle\n#define MagickDrawRender GmMagickDrawRender\n#define MagickDrawRotate GmMagickDrawRotate\n#define MagickDrawRoundRectangle GmMagickDrawRoundRectangle\n#define MagickDrawScale GmMagickDrawScale\n#define MagickDrawSetClipPath GmMagickDrawSetClipPath\n#define MagickDrawSetClipRule GmMagickDrawSetClipRule\n#define MagickDrawSetClipUnits GmMagickDrawSetClipUnits\n#define MagickDrawSetFillColor GmMagickDrawSetFillColor\n#define MagickDrawSetFillOpacity GmMagickDrawSetFillOpacity\n#define MagickDrawSetFillPatternURL GmMagickDrawSetFillPatternURL\n#define MagickDrawSetFillRule GmMagickDrawSetFillRule\n#define MagickDrawSetFont GmMagickDrawSetFont\n#define MagickDrawSetFontFamily GmMagickDrawSetFontFamily\n#define MagickDrawSetFontSize GmMagickDrawSetFontSize\n#define MagickDrawSetFontStretch GmMagickDrawSetFontStretch\n#define MagickDrawSetFontStyle GmMagickDrawSetFontStyle\n#define MagickDrawSetFontWeight GmMagickDrawSetFontWeight\n#define MagickDrawSetGravity GmMagickDrawSetGravity\n#define MagickDrawSetStrokeAntialias GmMagickDrawSetStrokeAntialias\n#define MagickDrawSetStrokeColor GmMagickDrawSetStrokeColor\n#define MagickDrawSetStrokeDashArray GmMagickDrawSetStrokeDashArray\n#define MagickDrawSetStrokeDashOffset GmMagickDrawSetStrokeDashOffset\n#define MagickDrawSetStrokeLineCap GmMagickDrawSetStrokeLineCap\n#define MagickDrawSetStrokeLineJoin GmMagickDrawSetStrokeLineJoin\n#define MagickDrawSetStrokeMiterLimit GmMagickDrawSetStrokeMiterLimit\n#define MagickDrawSetStrokeOpacity GmMagickDrawSetStrokeOpacity\n#define MagickDrawSetStrokePatternURL GmMagickDrawSetStrokePatternURL\n#define MagickDrawSetStrokeWidth GmMagickDrawSetStrokeWidth\n#define MagickDrawSetTextAntialias GmMagickDrawSetTextAntialias\n#define MagickDrawSetTextDecoration GmMagickDrawSetTextDecoration\n#define MagickDrawSetTextEncoding GmMagickDrawSetTextEncoding\n#define MagickDrawSetTextUnderColor GmMagickDrawSetTextUnderColor\n#define MagickDrawSetViewbox GmMagickDrawSetViewbox\n#define MagickDrawSkewX GmMagickDrawSkewX\n#define MagickDrawSkewY GmMagickDrawSkewY\n#define MagickDrawTranslate GmMagickDrawTranslate\n#define MagickEdgeImage GmMagickEdgeImage\n#define MagickEmbossImage GmMagickEmbossImage\n#define MagickEnhanceImage GmMagickEnhanceImage\n#define MagickEqualizeImage GmMagickEqualizeImage\n#define MagickExtentImage GmMagickExtentImage\n#define MagickFlattenImages GmMagickFlattenImages\n#define MagickFlipImage GmMagickFlipImage\n#define MagickFlopImage GmMagickFlopImage\n#define MagickFrameImage GmMagickFrameImage\n#define MagickFxImage GmMagickFxImage\n#define MagickFxImageChannel GmMagickFxImageChannel\n#define MagickGammaImage GmMagickGammaImage\n#define MagickGammaImageChannel GmMagickGammaImageChannel\n#define MagickGetConfigureInfo GmMagickGetConfigureInfo\n#define MagickGetCopyright GmMagickGetCopyright\n#define MagickGetException GmMagickGetException\n#define MagickGetFilename GmMagickGetFilename\n#define MagickGetHomeURL GmMagickGetHomeURL\n#define MagickGetImage GmMagickGetImage\n#define MagickGetImageAttribute GmMagickGetImageAttribute\n#define MagickGetImageBackgroundColor GmMagickGetImageBackgroundColor\n#define MagickGetImageBluePrimary GmMagickGetImageBluePrimary\n#define MagickGetImageBorderColor GmMagickGetImageBorderColor\n#define MagickGetImageBoundingBox GmMagickGetImageBoundingBox\n#define MagickGetImageChannelDepth GmMagickGetImageChannelDepth\n#define MagickGetImageChannelExtrema GmMagickGetImageChannelExtrema\n#define MagickGetImageChannelMean GmMagickGetImageChannelMean\n#define MagickGetImageColormapColor GmMagickGetImageColormapColor\n#define MagickGetImageColors GmMagickGetImageColors\n#define MagickGetImageColorspace GmMagickGetImageColorspace\n#define MagickGetImageCompose GmMagickGetImageCompose\n#define MagickGetImageCompression GmMagickGetImageCompression\n#define MagickGetImageDelay GmMagickGetImageDelay\n#define MagickGetImageDepth GmMagickGetImageDepth\n#define MagickGetImageDispose GmMagickGetImageDispose\n#define MagickGetImageExtrema GmMagickGetImageExtrema\n#define MagickGetImageFilename GmMagickGetImageFilename\n#define MagickGetImageFormat GmMagickGetImageFormat\n#define MagickGetImageFuzz GmMagickGetImageFuzz\n#define MagickGetImageGamma GmMagickGetImageGamma\n#define MagickGetImageGeometry GmMagickGetImageGeometry\n#define MagickGetImageGravity GmMagickGetImageGravity\n#define MagickGetImageGreenPrimary GmMagickGetImageGreenPrimary\n#define MagickGetImageHeight GmMagickGetImageHeight\n#define MagickGetImageHistogram GmMagickGetImageHistogram\n#define MagickGetImageIndex GmMagickGetImageIndex\n#define MagickGetImageInterlaceScheme GmMagickGetImageInterlaceScheme\n#define MagickGetImageIterations GmMagickGetImageIterations\n#define MagickGetImageMatte GmMagickGetImageMatte\n#define MagickGetImageMatteColor GmMagickGetImageMatteColor\n#define MagickGetImageOrientation GmMagickGetImageOrientation\n#define MagickGetImagePage GmMagickGetImagePage\n#define MagickGetImagePixels GmMagickGetImagePixels\n#define MagickGetImageProfile GmMagickGetImageProfile\n#define MagickGetImageRedPrimary GmMagickGetImageRedPrimary\n#define MagickGetImageRenderingIntent GmMagickGetImageRenderingIntent\n#define MagickGetImageResolution GmMagickGetImageResolution\n#define MagickGetImageSavedType GmMagickGetImageSavedType\n#define MagickGetImageScene GmMagickGetImageScene\n#define MagickGetImageSignature GmMagickGetImageSignature\n#define MagickGetImageSize GmMagickGetImageSize\n#define MagickGetImageType GmMagickGetImageType\n#define MagickGetImageUnits GmMagickGetImageUnits\n#define MagickGetImageVirtualPixelMethod GmMagickGetImageVirtualPixelMethod\n#define MagickGetImageWhitePoint GmMagickGetImageWhitePoint\n#define MagickGetImageWidth GmMagickGetImageWidth\n#define MagickGetNumberImages GmMagickGetNumberImages\n#define MagickGetPackageName GmMagickGetPackageName\n#define MagickGetQuantumDepth GmMagickGetQuantumDepth\n#define MagickGetReleaseDate GmMagickGetReleaseDate\n#define MagickGetResourceLimit GmMagickGetResourceLimit\n#define MagickGetSamplingFactors GmMagickGetSamplingFactors\n#define MagickGetSize GmMagickGetSize\n#define MagickGetVersion GmMagickGetVersion\n#define MagickHaldClutImage GmMagickHaldClutImage\n#define MagickHasColormap GmMagickHasColormap\n#define MagickHasNextImage GmMagickHasNextImage\n#define MagickHasPreviousImage GmMagickHasPreviousImage\n#define MagickImplodeImage GmMagickImplodeImage\n#define MagickIsGrayImage GmMagickIsGrayImage\n#define MagickIsMonochromeImage GmMagickIsMonochromeImage\n#define MagickIsOpaqueImage GmMagickIsOpaqueImage\n#define MagickIsPaletteImage GmMagickIsPaletteImage\n#define MagickLabelImage GmMagickLabelImage\n#define MagickLevelImage GmMagickLevelImage\n#define MagickLevelImageChannel GmMagickLevelImageChannel\n#define MagickMagnifyImage GmMagickMagnifyImage\n#define MagickMapImage GmMagickMapImage\n#define MagickMatteFloodfillImage GmMagickMatteFloodfillImage\n#define MagickMedianFilterImage GmMagickMedianFilterImage\n#define MagickMinifyImage GmMagickMinifyImage\n#define MagickModulateImage GmMagickModulateImage\n#define MagickMontageImage GmMagickMontageImage\n#define MagickMorphImages GmMagickMorphImages\n#define MagickMosaicImages GmMagickMosaicImages\n#define MagickMotionBlurImage GmMagickMotionBlurImage\n#define MagickNegateImage GmMagickNegateImage\n#define MagickNegateImageChannel GmMagickNegateImageChannel\n#define MagickNewDrawingWand GmMagickNewDrawingWand\n#define MagickNextImage GmMagickNextImage\n#define MagickNormalizeImage GmMagickNormalizeImage\n#define MagickOilPaintImage GmMagickOilPaintImage\n#define MagickOpaqueImage GmMagickOpaqueImage\n#define MagickOperatorImageChannel GmMagickOperatorImageChannel\n#define MagickPingImage GmMagickPingImage\n#define MagickPreviewImages GmMagickPreviewImages\n#define MagickPreviousImage GmMagickPreviousImage\n#define MagickProfileImage GmMagickProfileImage\n#define MagickQuantizeImage GmMagickQuantizeImage\n#define MagickQuantizeImages GmMagickQuantizeImages\n#define MagickQueryFontMetrics GmMagickQueryFontMetrics\n#define MagickQueryFonts GmMagickQueryFonts\n#define MagickQueryFormats GmMagickQueryFormats\n#define MagickRadialBlurImage GmMagickRadialBlurImage\n#define MagickRaiseImage GmMagickRaiseImage\n#define MagickReadImage GmMagickReadImage\n#define MagickReadImageBlob GmMagickReadImageBlob\n#define MagickReadImageFile GmMagickReadImageFile\n#define MagickReduceNoiseImage GmMagickReduceNoiseImage\n#define MagickRelinquishMemory GmMagickRelinquishMemory\n#define MagickRemoveImage GmMagickRemoveImage\n#define MagickRemoveImageOption GmMagickRemoveImageOption\n#define MagickRemoveImageProfile GmMagickRemoveImageProfile\n#define MagickResampleImage GmMagickResampleImage\n#define MagickResetIterator GmMagickResetIterator\n#define MagickResizeImage GmMagickResizeImage\n#define MagickRollImage GmMagickRollImage\n#define MagickRotateImage GmMagickRotateImage\n#define MagickSampleImage GmMagickSampleImage\n#define MagickScaleImage GmMagickScaleImage\n#define MagickSeparateImageChannel GmMagickSeparateImageChannel\n#define MagickSetCompressionQuality GmMagickSetCompressionQuality\n#define MagickSetDepth GmMagickSetDepth\n#define MagickSetFilename GmMagickSetFilename\n#define MagickSetFormat GmMagickSetFormat\n#define MagickSetImage GmMagickSetImage\n#define MagickSetImageAttribute GmMagickSetImageAttribute\n#define MagickSetImageBackgroundColor GmMagickSetImageBackgroundColor\n#define MagickSetImageBluePrimary GmMagickSetImageBluePrimary\n#define MagickSetImageBorderColor GmMagickSetImageBorderColor\n#define MagickSetImageChannelDepth GmMagickSetImageChannelDepth\n#define MagickSetImageColormapColor GmMagickSetImageColormapColor\n#define MagickSetImageColorspace GmMagickSetImageColorspace\n#define MagickSetImageCompose GmMagickSetImageCompose\n#define MagickSetImageCompression GmMagickSetImageCompression\n#define MagickSetImageDelay GmMagickSetImageDelay\n#define MagickSetImageDepth GmMagickSetImageDepth\n#define MagickSetImageDispose GmMagickSetImageDispose\n#define MagickSetImageFilename GmMagickSetImageFilename\n#define MagickSetImageFormat GmMagickSetImageFormat\n#define MagickSetImageFuzz GmMagickSetImageFuzz\n#define MagickSetImageGamma GmMagickSetImageGamma\n#define MagickSetImageGeometry GmMagickSetImageGeometry\n#define MagickSetImageGravity GmMagickSetImageGravity\n#define MagickSetImageGreenPrimary GmMagickSetImageGreenPrimary\n#define MagickSetImageIndex GmMagickSetImageIndex\n#define MagickSetImageInterlaceScheme GmMagickSetImageInterlaceScheme\n#define MagickSetImageIterations GmMagickSetImageIterations\n#define MagickSetImageMatte GmMagickSetImageMatte\n#define MagickSetImageMatteColor GmMagickSetImageMatteColor\n#define MagickSetImageOption GmMagickSetImageOption\n#define MagickSetImageOrientation GmMagickSetImageOrientation\n#define MagickSetImagePage GmMagickSetImagePage\n#define MagickSetImagePixels GmMagickSetImagePixels\n#define MagickSetImageProfile GmMagickSetImageProfile\n#define MagickSetImageRedPrimary GmMagickSetImageRedPrimary\n#define MagickSetImageRenderingIntent GmMagickSetImageRenderingIntent\n#define MagickSetImageResolution GmMagickSetImageResolution\n#define MagickSetImageSavedType GmMagickSetImageSavedType\n#define MagickSetImageScene GmMagickSetImageScene\n#define MagickSetImageType GmMagickSetImageType\n#define MagickSetImageUnits GmMagickSetImageUnits\n#define MagickSetImageVirtualPixelMethod GmMagickSetImageVirtualPixelMethod\n#define MagickSetImageWhitePoint GmMagickSetImageWhitePoint\n#define MagickSetInterlaceScheme GmMagickSetInterlaceScheme\n#define MagickSetPassphrase GmMagickSetPassphrase\n#define MagickSetResolution GmMagickSetResolution\n#define MagickSetResolutionUnits GmMagickSetResolutionUnits\n#define MagickSetResourceLimit GmMagickSetResourceLimit\n#define MagickSetSamplingFactors GmMagickSetSamplingFactors\n#define MagickSetSize GmMagickSetSize\n#define MagickSharpenImage GmMagickSharpenImage\n#define MagickShaveImage GmMagickShaveImage\n#define MagickShearImage GmMagickShearImage\n#define MagickSolarizeImage GmMagickSolarizeImage\n#define MagickSpreadImage GmMagickSpreadImage\n#define MagickSteganoImage GmMagickSteganoImage\n#define MagickStereoImage GmMagickStereoImage\n#define MagickStripImage GmMagickStripImage\n#define MagickSwirlImage GmMagickSwirlImage\n#define MagickTextureImage GmMagickTextureImage\n#define MagickThresholdImage GmMagickThresholdImage\n#define MagickThresholdImageChannel GmMagickThresholdImageChannel\n#define MagickTintImage GmMagickTintImage\n#define MagickTransformImage GmMagickTransformImage\n#define MagickTransparentImage GmMagickTransparentImage\n#define MagickTrimImage GmMagickTrimImage\n#define MagickUnsharpMaskImage GmMagickUnsharpMaskImage\n#define MagickWaveImage GmMagickWaveImage\n#define MagickWhiteThresholdImage GmMagickWhiteThresholdImage\n#define MagickWriteImage GmMagickWriteImage\n#define MagickWriteImageBlob GmMagickWriteImageBlob\n#define MagickWriteImageFile GmMagickWriteImageFile\n#define MagickWriteImages GmMagickWriteImages\n#define MagickWriteImagesFile GmMagickWriteImagesFile\n#define NewMagickWand GmNewMagickWand\n#define NewPixelWand GmNewPixelWand\n#define NewPixelWands GmNewPixelWands\n#define PixelGetBlack GmPixelGetBlack\n#define PixelGetBlackQuantum GmPixelGetBlackQuantum\n#define PixelGetBlue GmPixelGetBlue\n#define PixelGetBlueQuantum GmPixelGetBlueQuantum\n#define PixelGetColorAsString GmPixelGetColorAsString\n#define PixelGetColorCount GmPixelGetColorCount\n#define PixelGetCyan GmPixelGetCyan\n#define PixelGetCyanQuantum GmPixelGetCyanQuantum\n#define PixelGetException GmPixelGetException\n#define PixelGetGreen GmPixelGetGreen\n#define PixelGetGreenQuantum GmPixelGetGreenQuantum\n#define PixelGetMagenta GmPixelGetMagenta\n#define PixelGetMagentaQuantum GmPixelGetMagentaQuantum\n#define PixelGetOpacity GmPixelGetOpacity\n#define PixelGetOpacityQuantum GmPixelGetOpacityQuantum\n#define PixelGetQuantumColor GmPixelGetQuantumColor\n#define PixelGetRed GmPixelGetRed\n#define PixelGetRedQuantum GmPixelGetRedQuantum\n#define PixelGetYellow GmPixelGetYellow\n#define PixelGetYellowQuantum GmPixelGetYellowQuantum\n#define PixelSetBlack GmPixelSetBlack\n#define PixelSetBlackQuantum GmPixelSetBlackQuantum\n#define PixelSetBlue GmPixelSetBlue\n#define PixelSetBlueQuantum GmPixelSetBlueQuantum\n#define PixelSetColor GmPixelSetColor\n#define PixelSetColorCount GmPixelSetColorCount\n#define PixelSetCyan GmPixelSetCyan\n#define PixelSetCyanQuantum GmPixelSetCyanQuantum\n#define PixelSetGreen GmPixelSetGreen\n#define PixelSetGreenQuantum GmPixelSetGreenQuantum\n#define PixelSetMagenta GmPixelSetMagenta\n#define PixelSetMagentaQuantum GmPixelSetMagentaQuantum\n#define PixelSetOpacity GmPixelSetOpacity\n#define PixelSetOpacityQuantum GmPixelSetOpacityQuantum\n#define PixelSetQuantumColor GmPixelSetQuantumColor\n#define PixelSetRed GmPixelSetRed\n#define PixelSetRedQuantum GmPixelSetRedQuantum\n#define PixelSetYellow GmPixelSetYellow\n#define PixelSetYellowQuantum GmPixelSetYellowQuantum\n#define QueryMagickColor GmQueryMagickColor\n\n#endif /* defined(PREFIX_MAGICK_SYMBOLS) */\n#endif /* defined(_MAGICK_WAND_SYMBOLS_H) */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/Blob.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002\n//\n// Reference counted container class for Binary Large Objects (BLOBs)\n//\n\n#if !defined(Magick_BlobRef_header)\n#define Magick_BlobRef_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n\nnamespace Magick\n{\n  // Forward decl\n  class BlobRef;\n\n  class MagickDLLDecl Blob\n  {\n\n  public:\n\n    enum Allocator\n    {\n      MallocAllocator,\n      NewAllocator\n    };\n\n    // Default constructor\n    Blob ( void );\n\n    // Construct object with data, making a copy of the supplied data.\n    Blob ( const void* data_, size_t length_ );\n\n    // Copy constructor (reference counted)\n    Blob ( const Blob& blob_ );\n\n    // Destructor (reference counted)\n    virtual       ~Blob ();\n\n    // Assignment operator (reference counted)\n    Blob&         operator= ( const Blob& blob_ );\n\n    // Update object contents from Base64-encoded string representation.\n    void          base64 ( const std::string base64_ );\n    // Return Base64-encoded string representation.\n    std::string   base64 ( void );\n\n    // Update object contents, making a copy of the supplied data.\n    // Any existing data in the object is deallocated.\n    void          update ( const void* data_, size_t length_ );\n\n    // Update object contents, using supplied pointer directly (no\n    // copy). Any existing data in the object is deallocated.  The user\n    // must ensure that the pointer supplied is not deleted or\n    // otherwise modified after it has been supplied to this method.\n    // Specify allocator_ as \"MallocAllocator\" if memory is allocated\n    // via the C language malloc() function, or \"NewAllocator\" if\n    // memory is allocated via C++ 'new'.\n    void          updateNoCopy ( void* data_, size_t length_,\n                                 Allocator allocator_ = NewAllocator );\n\n    // Obtain pointer to data. The user should never try to modify or\n    // free this data since the Blob class manages its own data. The\n    // user must be finished with the data before allowing the Blob to\n    // be destroyed since the pointer is invalid once the Blob is\n    // destroyed.\n    const void*   data ( void ) const;\n\n    // Obtain data length\n    size_t length ( void ) const;\n\n  protected:\n\n  private:\n    BlobRef * _blobRef;\n  };\n\n} // namespace Magick\n\n#endif // Magick_BlobRef_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/CoderInfo.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 2001-2010\n//\n// CoderInfo Definition\n//\n// Container for image format support information.\n//\n\n#if !defined (Magick_CoderInfo_header)\n#define Magick_CoderInfo_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n\nnamespace Magick\n{\n  class MagickDLLDecl CoderInfo\n  {\n  public:\n\n    enum MatchType {\n      AnyMatch,         // match any coder\n      TrueMatch,        // match coder if true\n      FalseMatch        // match coder if false\n    };\n\n    // Default constructor\n    CoderInfo ( void );\n\n    // Copy constructor\n    CoderInfo ( const CoderInfo &coder_ );\n\n    // Construct with coder name\n    CoderInfo ( const std::string &name_ );\n\n    // Destructor\n    ~CoderInfo ( void );\n\n    // Format name\n    std::string name( void ) const;\n\n    // Format description\n    std::string description( void ) const;\n\n    // Format is readable\n    bool isReadable( void ) const;\n\n    // Format is writeable\n    bool isWritable( void ) const;\n\n    // Format supports multiple frames\n    bool isMultiFrame( void ) const;\n\n    // Assignment operator\n    CoderInfo& operator= (const CoderInfo &coder_ );\n\n    //\n    // Implemementation methods\n    //\n    CoderInfo ( const MagickLib::MagickInfo *magickInfo_ );\n\n  private:\n\n    std::string         _name;\n    std::string         _description;\n    bool                _isReadable;\n    bool                _isWritable;\n    bool                _isMultiFrame;\n\n  };\n} // namespace Magick\n\n//\n// Inlines\n//\n\n\n#endif // Magick_CoderInfo_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/Color.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003, 2008\n//\n// Color Implementation\n//\n#if !defined (Magick_Color_header)\n#define Magick_Color_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n\nnamespace Magick\n{\n\n  class MagickDLLDecl Color;\n\n  // Compare two Color objects regardless of LHS/RHS\n  int MagickDLLDecl operator == ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator != ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator >  ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator <  ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator >= ( const Magick::Color& left_, const Magick::Color& right_ );\n  int MagickDLLDecl operator <= ( const Magick::Color& left_, const Magick::Color& right_ );\n\n  // Base color class stores RGB components scaled to fit Quantum\n  class MagickDLLDecl Color\n  {\n  public:\n    Color ( Quantum red_,\n            Quantum green_,\n            Quantum blue_ );\n    Color ( Quantum red_,\n            Quantum green_,\n            Quantum blue_,\n            Quantum alpha_ );\n    Color ( const std::string &x11color_ );\n    Color ( const char * x11color_ );\n    Color ( void );\n    virtual        ~Color ( void );\n    Color ( const Color & color_ );\n\n    // Red color (range 0 to MaxRGB)\n    void           redQuantum ( Quantum red_ );\n    Quantum        redQuantum ( void ) const;\n\n    // Green color (range 0 to MaxRGB)\n    void           greenQuantum ( Quantum green_ );\n    Quantum        greenQuantum ( void ) const;\n\n    // Blue color (range 0 to MaxRGB)\n    void           blueQuantum ( Quantum blue_ );\n    Quantum        blueQuantum ( void ) const;\n\n    // Alpha level (range OpaqueOpacity=0 to TransparentOpacity=MaxRGB)\n    void           alphaQuantum ( Quantum alpha_ );\n    Quantum        alphaQuantum ( void ) const;\n\n    // Scaled (to 1.0) version of alpha for use in sub-classes\n    // (range opaque=0 to transparent=1.0)\n    void           alpha ( double alpha_ );\n    double         alpha ( void ) const;\n\n    // Does object contain valid color?\n    void           isValid ( bool valid_ );\n    bool           isValid ( void ) const;\n\n    // Set color via X11 color specification string\n    const Color& operator= ( const std::string &x11color_ );\n    const Color& operator= ( const char * x11color_ );\n\n    // Assignment operator\n    Color& operator= ( const Color& color_ );\n\n    // Return X11 color specification string\n    /* virtual */ operator std::string() const;\n\n    // Return ImageMagick PixelPacket\n    operator PixelPacket() const;\n\n    // Construct color via ImageMagick PixelPacket\n    Color ( const PixelPacket &color_ );\n\n    // Set color via ImageMagick PixelPacket\n    const Color& operator= ( const PixelPacket &color_ );\n\n    //\n    // Public methods beyond this point are for Magick++ use only.\n    //\n\n    // Obtain pixel intensity as a double\n    double intensity ( void ) const\n      {\n        return (0.299*(_pixel->red)+0.587*(_pixel->green)+0.114*(_pixel->blue));\n      }\n\n    // Scale a value expressed as a double (0-1) to Quantum range (0-MaxRGB)\n    static Quantum scaleDoubleToQuantum( const double double_ )\n      {\n        return (static_cast<Magick::Quantum>(double_*MaxRGB));\n      }\n\n    // Scale a value expressed as a Quantum (0-MaxRGB) to double range (0-1)\n    static double scaleQuantumToDouble( const Quantum quantum_ )\n      {\n        return (static_cast<double>(quantum_)/MaxRGB);\n      }\n    static double scaleQuantumToDouble( const double quantum_ )\n      {\n        return (quantum_/MaxRGB);\n      }\n\n\n  protected:\n\n    // PixelType specifies the interpretation of PixelPacket members\n    // RGBPixel:\n    //   Red      = red;\n    //   Green    = green;\n    //   Blue     = blue;\n    // RGBAPixel:\n    //   Red      = red;\n    //   Green    = green;\n    //   Blue     = blue;\n    //   Alpha    = opacity;\n    // CYMKPixel:\n    //   Cyan     = red\n    //   Yellow   = green\n    //   Magenta  = blue\n    //   Black(K) = opacity\n    enum PixelType\n    {\n      RGBPixel,\n      RGBAPixel,\n      CYMKPixel\n    };\n\n    // Constructor to construct with PixelPacket*\n    // Used to point Color at a pixel in an image\n    Color ( PixelPacket* rep_, PixelType pixelType_ );\n\n    // Set pixel\n    // Used to point Color at a pixel in an image\n    void pixel ( PixelPacket* rep_, PixelType pixelType_ );\n\n    // PixelPacket represents a color pixel:\n    //  red     = red   (range 0 to MaxRGB)\n    //  green   = green (range 0 to MaxRGB)\n    //  blue    = blue  (range 0 to MaxRGB)\n    //  opacity = alpha (range OpaqueOpacity=0 to TransparentOpacity=MaxRGB)\n    //  index   = PseudoColor colormap index\n    PixelPacket*     _pixel;\n\n  private:\n\n    // Common initializer for PixelPacket representation\n    void initPixel();\n\n    // Set true if we allocated pixel\n    bool                        _pixelOwn;\n\n    // Set true if pixel is \"valid\"\n    bool                       _isValid;\n\n    // Color type supported by _pixel\n    PixelType                   _pixelType;\n\n  };\n\n  //\n  // HSL Colorspace colors\n  //\n  class MagickDLLDecl ColorHSL : public Color\n  {\n  public:\n    ColorHSL ( double hue_, double saturation_, double luminosity_ );\n    ColorHSL ( void );\n    ColorHSL ( const Color & color_ );\n    /* virtual */  ~ColorHSL ( );\n\n    void           hue ( double hue_ );\n    double         hue ( void ) const;\n\n    void           saturation ( double saturation_ );\n    double         saturation ( void ) const;\n\n    void           luminosity ( double luminosity_ );\n    double         luminosity ( void ) const;\n\n    // Assignment operator from base class\n    ColorHSL& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorHSL ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n\n  //\n  // Grayscale RGB color\n  //\n  // Grayscale is simply RGB with equal parts of red, green, and blue\n  // All double arguments have a valid range of 0.0 - 1.0.\n  class MagickDLLDecl ColorGray : public Color\n  {\n  public:\n    ColorGray ( double shade_ );\n    ColorGray ( void );\n    ColorGray ( const Color & color_ );\n    /* virtual */ ~ColorGray ();\n\n    void           shade ( double shade_ );\n    double         shade ( void ) const;\n\n    // Assignment operator from base class\n    ColorGray& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorGray ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n\n  //\n  // Monochrome color\n  //\n  // Color arguments are constrained to 'false' (black pixel) and 'true'\n  // (white pixel)\n  class MagickDLLDecl ColorMono : public Color\n  {\n  public:\n    ColorMono ( bool mono_ );\n    ColorMono ( void );\n    ColorMono ( const Color & color_ );\n    /* virtual */ ~ColorMono ();\n\n    void           mono ( bool mono_ );\n    bool           mono ( void ) const;\n\n    // Assignment operator from base class\n    ColorMono& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorMono ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n\n  //\n  // RGB color\n  //\n  // All color arguments have a valid range of 0.0 - 1.0.\n  class MagickDLLDecl ColorRGB : public Color\n  {\n  public:\n    ColorRGB ( double red_, double green_, double blue_ );\n    ColorRGB ( void );\n    ColorRGB ( const Color & color_ );\n    /* virtual */  ~ColorRGB ( void );\n\n    void           red ( double red_ );\n    double         red ( void ) const;\n\n    void           green ( double green_ );\n    double         green ( void ) const;\n\n    void           blue ( double blue_ );\n    double         blue ( void ) const;\n\n    // Assignment operator from base class\n    ColorRGB& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorRGB ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n\n  //\n  // YUV Colorspace color\n  //\n  // Argument ranges:\n  //        Y:  0.0 through 1.0\n  //        U: -0.5 through 0.5\n  //        V: -0.5 through 0.5\n  class MagickDLLDecl ColorYUV : public Color\n  {\n  public:\n    ColorYUV ( double y_, double u_, double v_ );\n    ColorYUV ( void );\n    ColorYUV ( const Color & color_ );\n    /* virtual */ ~ColorYUV ( void );\n\n    void           u ( double u_ );\n    double         u ( void ) const;\n\n    void           v ( double v_ );\n    double         v ( void ) const;\n\n    void           y ( double y_ );\n    double         y ( void ) const;\n\n    // Assignment operator from base class\n    ColorYUV& operator= ( const Color& color_ );\n\n  protected:\n    // Constructor to construct with PixelPacket*\n    ColorYUV ( PixelPacket* rep_, PixelType pixelType_ );\n  };\n} // namespace Magick\n\n//\n// Inlines\n//\n\n//\n// Color\n//\n\n// Common initializer for PixelPacket representation\n// Initialized transparent black\ninline void Magick::Color::initPixel()\n{\n  _pixel->red     = 0;\n  _pixel->green   = 0;\n  _pixel->blue    = 0;\n  _pixel->opacity = TransparentOpacity;\n}\n\ninline void Magick::Color::redQuantum ( Magick::Quantum red_ )\n{\n  _pixel->red = red_;\n  _isValid = true;\n}\n\ninline Magick::Quantum Magick::Color::redQuantum ( void ) const\n{\n  return _pixel->red;\n}\n\ninline void Magick::Color::greenQuantum ( Magick::Quantum green_ )\n{\n  _pixel->green = green_;\n  _isValid = true;\n}\n\ninline Magick::Quantum  Magick::Color::greenQuantum ( void ) const\n{\n  return _pixel->green;\n}\n\ninline void  Magick::Color::blueQuantum ( Magick::Quantum blue_ )\n{\n  _pixel->blue = blue_;\n  _isValid = true;\n}\n\ninline Magick::Quantum Magick::Color::blueQuantum ( void ) const\n{\n  return _pixel->blue;\n}\n\ninline void  Magick::Color::alphaQuantum ( Magick::Quantum alpha_ )\n{\n  _pixel->opacity = alpha_;\n  _isValid = true ;\n}\n\ninline Magick::Quantum Magick::Color::alphaQuantum ( void ) const\n{\n  return _pixel->opacity;\n}\n\n// Return ImageMagick PixelPacket struct based on color.\ninline Magick::Color::operator MagickLib::PixelPacket () const\n{\n  return *_pixel;\n}\n\n// Scaled version of alpha for use in sub-classes\ninline void  Magick::Color::alpha ( double alpha_ )\n{\n  alphaQuantum( scaleDoubleToQuantum(alpha_) );\n}\ninline double Magick::Color::alpha ( void ) const\n{\n  return scaleQuantumToDouble( alphaQuantum() );\n}\n\n//\n// ColorHSL\n//\ninline Magick::ColorHSL::ColorHSL ( Magick::PixelPacket* rep_,\n                                    Magick::Color::PixelType pixelType_ )\n: Color( rep_, pixelType_ )\n{\n}\n\n//\n// ColorGray\n//\ninline Magick::ColorGray::ColorGray ( Magick::PixelPacket* rep_,\n                                      Magick::Color::PixelType pixelType_ )\n: Color( rep_, pixelType_ )\n{\n}\n\n//\n// ColorMono\n//\ninline Magick::ColorMono::ColorMono ( Magick::PixelPacket* rep_,\n                                      Magick::Color::PixelType pixelType_ )\n  : Color( rep_, pixelType_ )\n{\n}\n\n//\n// ColorRGB\n//\ninline Magick::ColorRGB::ColorRGB ( Magick::PixelPacket* rep_,\n                                    Magick::Color::PixelType pixelType_ )\n  : Color( rep_, pixelType_ )\n{\n}\n\ninline void Magick::ColorRGB::red ( double red_ )\n{\n  redQuantum( scaleDoubleToQuantum(red_) );\n}\n\ninline double Magick::ColorRGB::red ( void ) const\n{\n  return scaleQuantumToDouble( redQuantum() );\n}\n\ninline void Magick::ColorRGB::green ( double green_ )\n{\n  greenQuantum( scaleDoubleToQuantum(green_) );\n}\n\ninline double Magick::ColorRGB::green ( void ) const\n{\n  return scaleQuantumToDouble( greenQuantum() );\n}\n\ninline void Magick::ColorRGB::blue ( double blue_ )\n{\n  blueQuantum( scaleDoubleToQuantum(blue_) );\n}\n\ninline double Magick::ColorRGB::blue ( void ) const\n{\n  return scaleQuantumToDouble( blueQuantum() );\n}\n\n//\n// ColorYUV\n//\n\ninline Magick::ColorYUV::ColorYUV ( Magick::PixelPacket* rep_,\n                                    Magick::Color::PixelType pixelType_ )\n  : Color( rep_, pixelType_ )\n{\n}\n\n#endif // Magick_Color_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/Drawable.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2018\n//\n// Definition of Drawable (Graphic objects)\n//\n// The technique used for instantiating classes which derive from STL\n// templates is described in Microsoft MSDN Article ID: Q168958\n// \"HOWTO: Exporting STL Components Inside & Outside of a Class\".\n// \"http://support.microsoft.com/kb/168958\"\n//\n// Note that version 3.0 of this article says that that only STL\n// container template which supports DLL export is <vector> and we are\n// not using <vector> as part of the Drawable implementation.\n//\n\n#if !defined(Magick_Drawable_header)\n#define Magick_Drawable_header\n\n#include \"Magick++/Include.h\"\n\n#include <functional>\n#include <string>\n#include <list>\n#include <utility>\n#include \"Magick++/Color.h\"\n#include \"Magick++/Geometry.h\"\n\n#if defined(MagickDLLExplicitTemplate)\n#  if defined(MAGICK_PLUSPLUS_IMPLEMENTATION)\n#    define MagickDrawableExtern\n#  else\n#   pragma warning( disable: 4231 ) // Disable warning regarding using extern\n#    define MagickDrawableExtern extern\n#  endif // MAGICK_PLUSPLUS_IMPLEMENTATION\n#else\n#  define MagickDrawableExtern\n#endif // MagickDLLExplicitTemplate\n\nnamespace Magick\n{\n\n#if defined(__clang__)\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wunknown-warning-option\"\n#pragma clang diagnostic ignored \"-Wunused-private-field\"\n#endif /* if defined(__clang__) */\n\n  //\n  // Representation of an x,y coordinate\n  //\n  class MagickDLLDecl Coordinate\n  {\n  public:\n\n    // Default Constructor\n    Coordinate ( void )\n      : _x(0),\n        _y(0)\n      { }\n\n    // Constructor, setting first & second\n    Coordinate ( double x_, double y_ )\n      : _x(x_),\n        _y(y_)\n      { }\n\n    // Destructor\n    virtual ~Coordinate ()\n      { }\n\n    // x coordinate member\n    void   x ( double x_ )\n      {\n        _x = x_;\n      }\n    double x ( void ) const\n      {\n        return _x;\n      }\n\n    // y coordinate member\n    void   y ( double y_ )\n      {\n        _y = y_;\n      }\n    double y ( void ) const\n      {\n        return _y;\n      }\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  typedef std::list<Magick::Coordinate> CoordinateList;\n\n#if defined(MagickDLLExplicitTemplate)\n\n  MagickDrawableExtern template class MagickDLLDecl\n  std::allocator<Magick::Coordinate>;\n\n//   MagickDrawableExtern template class MagickDLLDecl\n//   std::list<Magick::Coordinate, std::allocator<Magick::Coordinate> >;\n\n#endif // MagickDLLExplicitTemplate\n\n  // Compare two Coordinate objects regardless of LHS/RHS\n  MagickDLLDeclExtern int operator == ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator != ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator >  ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator <  ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator >= ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n  MagickDLLDeclExtern int operator <= ( const Coordinate& left_,\n                                        const Coordinate& right_ );\n\n  //\n  // Base class for all drawable objects\n  //\n  //struct MagickDLLDecl std::unary_function<MagickLib::DrawContext,void>;\n  class MagickDLLDecl DrawableBase:\n    public std::unary_function<MagickLib::DrawContext,void>\n  {\n  public:\n    // Constructor\n    DrawableBase ( void )\n      { }\n\n    // Destructor\n    virtual ~DrawableBase ( void );\n\n    // Operator to invoke equivalent draw API call\n    virtual void operator()( MagickLib::DrawContext ) const = 0;\n\n    // Return polymorphic copy of object\n    virtual DrawableBase* copy() const = 0;\n\n  private:\n  };\n\n  //\n  // Representation of a drawable surrogate object to manage drawable objects\n  //\n#undef Drawable  // Conflict with <X11/Xproto.h>\n  class MagickDLLDecl Drawable\n  {\n  public:\n\n    // Constructor\n    Drawable ( void );\n\n    // Construct from DrawableBase\n    Drawable ( const DrawableBase& original_ );\n\n    // Destructor\n    ~Drawable ( void );\n\n    // Copy constructor\n    Drawable ( const Drawable& original_ );\n\n    // Assignment operator\n    Drawable& operator= (const Drawable& original_ );\n\n    // Operator to invoke contained object\n    void operator()( MagickLib::DrawContext context_ ) const;\n\n  private:\n    DrawableBase* dp;\n  };\n\n  // Compare two Drawable objects regardless of LHS/RHS\n  MagickDLLDeclExtern int operator == ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator != ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator >  ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator <  ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator >= ( const Drawable& left_,\n                                        const Drawable& right_ );\n  MagickDLLDeclExtern int operator <= ( const Drawable& left_,\n                                        const Drawable& right_ );\n\n  typedef std::list<Magick::Drawable> DrawableList;\n\n#if defined(MagickDLLExplicitTemplate)\n\n  MagickDrawableExtern template class MagickDLLDecl\n  std::allocator<Magick::Drawable>;\n\n//   MagickDrawableExtern template class MagickDLLDecl\n//   std::list<Magick::Drawable, std::allocator<Magick::Drawable> >;\n\n#endif // MagickDLLExplicitTemplate\n\n//\n// Base class for all drawable path elements for use with\n// DrawablePath\n//\nclass MagickDLLDecl VPathBase\n{\npublic:\n  // Constructor\n  VPathBase ( void )\n    { }\n\n  // Destructor\n  virtual ~VPathBase ( void );\n\n  // Assignment operator\n  //    const VPathBase& operator= (const VPathBase& original_ );\n\n  // Operator to invoke equivalent draw API call\n  virtual void operator()( MagickLib::DrawContext context_ ) const = 0;\n\n  // Return polymorphic copy of object\n  virtual VPathBase* copy() const = 0;\n};\n\n//\n// Representation of a drawable path element surrogate object to\n// manage drawable path elements so they may be passed as a list to\n// DrawablePath.\n//\nclass MagickDLLDecl VPath\n{\npublic:\n  // Constructor\n  VPath ( void );\n\n  // Construct from VPathBase\n  VPath ( const VPathBase& original_ );\n\n  // Destructor\n  virtual ~VPath ( void );\n\n  // Copy constructor\n  VPath ( const VPath& original_ );\n\n  // Assignment operator\n  VPath& operator= (const VPath& original_ );\n\n  // Operator to invoke contained object\n  void operator()( MagickLib::DrawContext context_ ) const;\n\nprivate:\n  VPathBase* dp;\n};\n\n// Compare two VPath objects regardless of LHS/RHS\nMagickDLLDeclExtern int operator == ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator != ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator >  ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator <  ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator >= ( const VPath& left_,\n                                      const VPath& right_ );\nMagickDLLDeclExtern int operator <= ( const VPath& left_,\n                                      const VPath& right_ );\n\ntypedef std::list<Magick::VPath> VPathList;\n\n#if defined(MagickDLLExplicitTemplate)\n\nMagickDrawableExtern template class MagickDLLDecl\nstd::allocator<Magick::VPath>;\n\n// MagickDrawableExtern template class MagickDLLDecl\n// std::list<Magick::VPath, std::allocator<Magick::VPath> >;\n\n#endif // MagickDLLExplicitTemplate\n\n//\n// Drawable Objects\n//\n\n// Affine (scaling, rotation, and translation)\nclass MagickDLLDecl DrawableAffine  : public DrawableBase\n{\npublic:\n  DrawableAffine ( double sx_, double sy_,\n                   double rx_, double ry_,\n                   double tx_, double ty_ );\n\n  DrawableAffine ( void );\n\n  /*virtual*/ ~DrawableAffine( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/\n  DrawableBase* copy() const;\n\n  void sx( const double sx_ )\n    {\n      _affine.sx = sx_;\n    }\n  double sx( void ) const\n    {\n      return _affine.sx;\n    }\n\n  void sy( const double sy_ )\n    {\n      _affine.sy = sy_;\n    }\n  double sy( void ) const\n    {\n      return _affine.sy;\n    }\n\n  void rx( const double rx_ )\n    {\n      _affine.rx = rx_;\n    }\n  double rx( void ) const\n    {\n      return _affine.rx;\n    }\n\n  void ry( const double ry_ )\n    {\n      _affine.ry = ry_;\n    }\n  double ry( void ) const\n    {\n      return _affine.ry;\n    }\n\n  void tx( const double tx_ )\n    {\n      _affine.tx = tx_;\n    }\n  double tx( void ) const\n    {\n      return _affine.tx;\n    }\n\n  void ty( const double ty_ )\n    {\n      _affine.ty = ty_;\n    }\n  double ty( void ) const\n    {\n      return _affine.ty;\n    }\n\nprivate:\n  MagickLib::AffineMatrix  _affine;\n};\n\n// Arc\nclass MagickDLLDecl DrawableArc : public DrawableBase\n{\npublic:\n  DrawableArc ( double startX_, double startY_,\n                double endX_, double endY_,\n                double startDegrees_, double endDegrees_ )\n    : _startX(startX_),\n      _startY(startY_),\n      _endX(endX_),\n      _endY(endY_),\n      _startDegrees(startDegrees_),\n      _endDegrees(endDegrees_)\n    { }\n\n  /*virtual*/ ~DrawableArc( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void startX( double startX_ )\n    {\n      _startX = startX_;\n    }\n  double startX( void ) const\n    {\n      return _startX;\n    }\n\n  void startY( double startY_ )\n    {\n      _startY = startY_;\n    }\n  double startY( void ) const\n    {\n      return _startY;\n    }\n\n  void endX( double endX_ )\n    {\n      _endX = endX_;\n    }\n  double endX( void ) const\n    {\n      return _endX;\n    }\n\n  void endY( double endY_ )\n    {\n      _endY = endY_;\n    }\n  double endY( void ) const\n    {\n      return _endY;\n    }\n\n  void startDegrees( double startDegrees_ )\n    {\n      _startDegrees = startDegrees_;\n    }\n  double startDegrees( void ) const\n    {\n      return _startDegrees;\n    }\n\n  void endDegrees( double endDegrees_ )\n    {\n      _endDegrees = endDegrees_;\n    }\n  double endDegrees( void ) const\n    {\n      return _endDegrees;\n    }\n\nprivate:\n  double _startX;\n  double _startY;\n  double _endX;\n  double _endY;\n  double _startDegrees;\n  double _endDegrees;\n};\n\n// Bezier curve (Coordinate list must contain at least three members)\nclass MagickDLLDecl DrawableBezier : public DrawableBase\n{\npublic:\n  // Construct from coordinates\n  DrawableBezier ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  DrawableBezier ( const DrawableBezier& original_ );\n\n  // Destructor\n  /*virtual*/ ~DrawableBezier ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n\n// Pop (terminate) clip path definition\nclass MagickDLLDecl DrawablePopClipPath : public DrawableBase\n{\npublic:\n  DrawablePopClipPath ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~DrawablePopClipPath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n// Push (create) Clip path definition\nclass MagickDLLDecl DrawablePushClipPath : public DrawableBase\n{\npublic:\n  DrawablePushClipPath ( const std::string &id_);\n\n  DrawablePushClipPath ( const DrawablePushClipPath& original_ );\n\n  /*virtual*/ ~DrawablePushClipPath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  std::string _id;\n};\n\n// Named Clip Path\nclass MagickDLLDecl DrawableClipPath : public DrawableBase\n{\npublic:\n  DrawableClipPath ( const std::string &id_ );\n  DrawableClipPath ( const DrawableClipPath& original_ );\n\n  /*virtual*/ ~DrawableClipPath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void clip_path( const std::string &id_ )\n    {\n      _id = id_.c_str(); //multithread safe\n    }\n  std::string clip_path( void ) const\n    {\n      return _id;\n    }\n\nprivate:\n  std::string   _id;\n};\n\n// Circle\nclass MagickDLLDecl DrawableCircle : public DrawableBase\n{\npublic:\n  DrawableCircle ( double originX_, double originY_,\n                   double perimX_, double perimY_ )\n    : _originX(originX_),\n      _originY(originY_),\n      _perimX(perimX_),\n      _perimY(perimY_)\n    {\n    }\n\n  /*virtual*/ ~DrawableCircle ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void originX( double originX_ )\n    {\n      _originX = originX_;\n    }\n  double originX( void ) const\n    {\n      return _originX;\n    }\n\n  void originY( double originY_ )\n    {\n      _originY = originY_;\n    }\n  double originY( void ) const\n    {\n      return _originY;\n    }\n\n  void perimX( double perimX_ )\n    {\n      _perimX = perimX_;\n    }\n  double perimX( void ) const\n    {\n      return _perimX;\n    }\n\n  void perimY( double perimY_ )\n    {\n      _perimY = perimY_;\n    }\n  double perimY( void ) const\n    {\n      return _perimY;\n    }\n\nprivate:\n  double _originX;\n  double _originY;\n  double _perimX;\n  double _perimY;\n};\n\n// Colorize at point using PaintMethod\nclass MagickDLLDecl DrawableColor : public DrawableBase\n{\npublic:\n  DrawableColor ( double x_, double y_,\n                  PaintMethod paintMethod_ )\n    : _x(x_),\n      _y(y_),\n      _paintMethod(paintMethod_)\n    { }\n\n  /*virtual*/ ~DrawableColor ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\n  void paintMethod( PaintMethod paintMethod_ )\n    {\n      _paintMethod = paintMethod_;\n    }\n  PaintMethod paintMethod( void ) const\n    {\n      return _paintMethod;\n    }\n\nprivate:\n  double _x;\n  double _y;\n  PaintMethod _paintMethod;\n};\n\n// Draw image at point, scaled to size specified by width and height\nclass MagickDLLDecl Image;\nclass MagickDLLDecl DrawableCompositeImage : public DrawableBase\n{\npublic:\n  DrawableCompositeImage ( double x_, double y_,\n                           const std::string &filename_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           const Image &image_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           double width_, double height_,\n                           const std::string &filename_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           double width_, double height_,\n                           const Image &image_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           double width_, double height_,\n                           const std::string &filename_,\n                           CompositeOperator composition_ );\n\n  DrawableCompositeImage ( double x_, double y_,\n                           double width_, double height_,\n                           const Image &image_,\n                           CompositeOperator composition_ );\n\n  // Copy constructor\n  DrawableCompositeImage ( const DrawableCompositeImage& original_ );\n\n  // Destructor\n  /*virtual*/ ~DrawableCompositeImage( void );\n\n  // Assignment operator\n  DrawableCompositeImage& operator=\n  (const DrawableCompositeImage& original_ );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void composition( CompositeOperator composition_ )\n    {\n      _composition = composition_;\n    }\n  CompositeOperator composition( void ) const\n    {\n      return _composition;\n    }\n\n  void filename( const std::string &image_ );\n  std::string filename( void ) const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\n  void width( double width_ )\n    {\n      _width = width_;\n    }\n  double width( void ) const\n    {\n      return _width;\n    }\n\n  void height( double height_ )\n    {\n      _height = height_;\n    }\n  double height( void ) const\n    {\n      return _height;\n    }\n\n  void image( const Image &image_ );\n  Magick::Image image( void ) const;\n\n  // Specify image format used to output Base64 inlined image data.\n  void magick( std::string magick_ );\n  std::string magick( void );\n\nprivate:\n  CompositeOperator  _composition;\n  double             _x;\n  double             _y;\n  double             _width;\n  double             _height;\n  Image*             _image;\n};\n\n// Ellipse\nclass MagickDLLDecl DrawableEllipse : public DrawableBase\n{\npublic:\n  DrawableEllipse ( double originX_, double originY_,\n                    double radiusX_, double radiusY_,\n                    double arcStart_, double arcEnd_ )\n    : _originX(originX_),\n      _originY(originY_),\n      _radiusX(radiusX_),\n      _radiusY(radiusY_),\n      _arcStart(arcStart_),\n      _arcEnd(arcEnd_)\n    { }\n\n  /*virtual*/ ~DrawableEllipse( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void originX( double originX_ )\n    {\n      _originX = originX_;\n    }\n  double originX( void ) const\n    {\n      return _originX;\n    }\n\n  void originY( double originY_ )\n    {\n      _originY = originY_;\n    }\n  double originY( void ) const\n    {\n      return _originY;\n    }\n\n  void radiusX( double radiusX_ )\n    {\n      _radiusX = radiusX_;\n    }\n  double radiusX( void ) const\n    {\n      return _radiusX;\n    }\n\n  void radiusY( double radiusY_ )\n    {\n      _radiusY = radiusY_;\n    }\n  double radiusY( void ) const\n    {\n      return _radiusY;\n    }\n\n  void arcStart( double arcStart_ )\n    {\n      _arcStart = arcStart_;\n    }\n  double arcStart( void ) const\n    {\n      return _arcStart;\n    }\n\n  void arcEnd( double arcEnd_ )\n    {\n      _arcEnd = arcEnd_;\n    }\n  double arcEnd( void ) const\n    {\n      return _arcEnd;\n    }\n\nprivate:\n  double _originX;\n  double _originY;\n  double _radiusX;\n  double _radiusY;\n  double _arcStart;\n  double _arcEnd;\n};\n\n// Specify drawing fill color\nclass MagickDLLDecl DrawableFillColor : public DrawableBase\n{\npublic:\n  DrawableFillColor ( const Color &color_ );\n\n  DrawableFillColor ( const DrawableFillColor& original_ );\n\n  /*virtual*/ ~DrawableFillColor( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void color( const Color &color_ )\n    {\n      _color = color_;\n    }\n  Color color( void ) const\n    {\n      return _color;\n    }\n\nprivate:\n  Color _color;\n};\n\n// Specify fill rule (fill-rule)\nclass MagickDLLDecl DrawableFillRule : public DrawableBase\n{\npublic:\n  DrawableFillRule ( const FillRule fillRule_ )\n    : _fillRule(fillRule_)\n    {\n    }\n\n  /*virtual*/ ~DrawableFillRule ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void fillRule( const FillRule fillRule_ )\n    {\n      _fillRule = fillRule_;\n    }\n  FillRule fillRule( void ) const\n    {\n      return _fillRule;\n    }\n\nprivate:\n  FillRule _fillRule;\n};\n\n// Specify drawing fill opacity\nclass MagickDLLDecl DrawableFillOpacity : public DrawableBase\n{\npublic:\n  DrawableFillOpacity ( double opacity_ )\n    : _opacity(opacity_)\n    {\n    }\n\n  /*virtual*/ ~DrawableFillOpacity ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void opacity( double opacity_ )\n    {\n      _opacity = opacity_;\n    }\n  double opacity( void ) const\n    {\n      return _opacity;\n    }\n\nprivate:\n  double _opacity;\n};\n\n// Specify text font\nclass MagickDLLDecl DrawableFont : public DrawableBase\n{\npublic:\n  DrawableFont ( const std::string &font_ );\n\n  DrawableFont ( const std::string &family_,\n                 StyleType style_,\n                 const unsigned long weight_,\n                 StretchType stretch_ );\n  DrawableFont ( const DrawableFont& original_ );\n\n  /*virtual*/ ~DrawableFont ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void font( const std::string &font_ )\n    {\n      _font = font_;\n    }\n  std::string font( void ) const\n    {\n      return _font;\n    }\n\nprivate:\n  std::string   _font;\n  std::string   _family;\n  StyleType     _style;\n  unsigned long _weight;\n  StretchType   _stretch;\n};\n\n// Specify text positioning gravity\nclass MagickDLLDecl DrawableGravity : public DrawableBase\n{\npublic:\n  DrawableGravity ( GravityType gravity_ )\n    : _gravity(gravity_)\n    {\n    }\n\n  /*virtual*/ ~DrawableGravity ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void gravity( GravityType gravity_ )\n    {\n      _gravity = gravity_;\n    }\n  GravityType gravity( void ) const\n    {\n      return _gravity;\n    }\n\nprivate:\n  GravityType _gravity;\n};\n\n// Line\nclass MagickDLLDecl DrawableLine : public DrawableBase\n{\npublic:\n  DrawableLine ( double startX_, double startY_,\n                 double endX_, double endY_ )\n    : _startX(startX_),\n      _startY(startY_),\n      _endX(endX_),\n      _endY(endY_)\n    { }\n\n  /*virtual*/ ~DrawableLine ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void startX( double startX_ )\n    {\n      _startX = startX_;\n    }\n  double startX( void ) const\n    {\n      return _startX;\n    }\n\n  void startY( double startY_ )\n    {\n      _startY = startY_;\n    }\n  double startY( void ) const\n    {\n      return _startY;\n    }\n\n  void endX( double endX_ )\n    {\n      _endX = endX_;\n    }\n  double endX( void ) const\n    {\n      return _endX;\n    }\n\n  void endY( double endY_ )\n    {\n      _endY = endY_;\n    }\n  double endY( void ) const\n    {\n      return _endY;\n    }\n\nprivate:\n  double _startX;\n  double _startY;\n  double _endX;\n  double _endY;\n};\n\n// Change pixel matte value to transparent using PaintMethod\nclass MagickDLLDecl DrawableMatte : public DrawableBase\n{\npublic:\n  DrawableMatte ( double x_, double y_,\n                  PaintMethod paintMethod_ )\n    : _x(x_),\n      _y(y_),\n      _paintMethod(paintMethod_)\n    { }\n\n  /*virtual*/ ~DrawableMatte ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\n  void paintMethod( PaintMethod paintMethod_ )\n    {\n      _paintMethod = paintMethod_;\n    }\n  PaintMethod paintMethod( void ) const\n    {\n      return _paintMethod;\n    }\n\nprivate:\n  double _x;\n  double _y;\n  PaintMethod _paintMethod;\n};\n\n// Drawable Path\nclass MagickDLLDecl DrawablePath : public DrawableBase\n{\npublic:\n  DrawablePath ( const VPathList &path_ );\n\n  DrawablePath ( const DrawablePath& original_ );\n\n  /*virtual*/ ~DrawablePath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  VPathList _path;\n};\n\n// Point\nclass MagickDLLDecl DrawablePoint : public DrawableBase\n{\npublic:\n  DrawablePoint ( double x_, double y_ )\n    : _x(x_),\n      _y(y_)\n    { }\n\n  /*virtual*/ ~DrawablePoint ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _x;\n  double _y;\n};\n\n// Text pointsize\nclass MagickDLLDecl DrawablePointSize : public DrawableBase\n{\npublic:\n  DrawablePointSize ( double pointSize_ )\n    : _pointSize(pointSize_)\n    { }\n\n  /*virtual*/ ~DrawablePointSize ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void pointSize( double pointSize_ )\n    {\n      _pointSize = pointSize_;\n    }\n  double pointSize( void ) const\n    {\n      return _pointSize;\n    }\n\nprivate:\n  double _pointSize;\n};\n\n// Polygon (Coordinate list must contain at least three members)\nclass MagickDLLDecl DrawablePolygon : public DrawableBase\n{\npublic:\n  DrawablePolygon ( const CoordinateList &coordinates_ );\n\n  DrawablePolygon ( const DrawablePolygon& original_ );\n\n  /*virtual*/ ~DrawablePolygon ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n// Polyline (Coordinate list must contain at least three members)\nclass MagickDLLDecl DrawablePolyline : public DrawableBase\n{\npublic:\n  DrawablePolyline ( const CoordinateList &coordinates_ );\n\n  DrawablePolyline ( const DrawablePolyline& original_ );\n\n  /*virtual*/ ~DrawablePolyline ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n// Pop Graphic Context\nclass MagickDLLDecl DrawablePopGraphicContext : public DrawableBase\n{\npublic:\n  DrawablePopGraphicContext ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~DrawablePopGraphicContext ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n// Push Graphic Context\nclass MagickDLLDecl DrawablePushGraphicContext : public DrawableBase\n{\npublic:\n  DrawablePushGraphicContext ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~DrawablePushGraphicContext ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n// Pop (terminate) Pattern definition\nclass MagickDLLDecl DrawablePopPattern : public DrawableBase\n{\npublic:\n  DrawablePopPattern ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~DrawablePopPattern ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n// Push (create) Pattern definition\nclass MagickDLLDecl DrawablePushPattern : public DrawableBase\n{\npublic:\n  DrawablePushPattern ( const std::string &id_, long x_, long y_,\n                        long width_, long height_ );\n\n  DrawablePushPattern ( const DrawablePushPattern& original_ );\n\n  /*virtual*/ ~DrawablePushPattern ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\nprivate:\n  std::string         _id;\n  long          _x;\n  long          _y;\n  long          _width;\n  long          _height;\n};\n\n// Rectangle\nclass MagickDLLDecl DrawableRectangle : public DrawableBase\n{\npublic:\n  DrawableRectangle ( double upperLeftX_, double upperLeftY_,\n                      double lowerRightX_, double lowerRightY_ )\n    : _upperLeftX(upperLeftX_),\n      _upperLeftY(upperLeftY_),\n      _lowerRightX(lowerRightX_),\n      _lowerRightY(lowerRightY_)\n    { }\n\n  /*virtual*/ ~DrawableRectangle ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void upperLeftX( double upperLeftX_ )\n    {\n      _upperLeftX = upperLeftX_;\n    }\n  double upperLeftX( void ) const\n    {\n      return _upperLeftX;\n    }\n\n  void upperLeftY( double upperLeftY_ )\n    {\n      _upperLeftY = upperLeftY_;\n    }\n  double upperLeftY( void ) const\n    {\n      return _upperLeftY;\n    }\n\n  void lowerRightX( double lowerRightX_ )\n    {\n      _lowerRightX = lowerRightX_;\n    }\n  double lowerRightX( void ) const\n    {\n      return _lowerRightX;\n    }\n\n  void lowerRightY( double lowerRightY_ )\n    {\n      _lowerRightY = lowerRightY_;\n    }\n  double lowerRightY( void ) const\n    {\n      return _lowerRightY;\n    }\n\nprivate:\n  double _upperLeftX;\n  double _upperLeftY;\n  double _lowerRightX;\n  double _lowerRightY;\n};\n\n// Apply Rotation\nclass MagickDLLDecl DrawableRotation : public DrawableBase\n{\npublic:\n  DrawableRotation ( double angle_ )\n    : _angle( angle_ )\n    { }\n\n  /*virtual*/ ~DrawableRotation ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void angle( double angle_ )\n    {\n      _angle = angle_;\n    }\n  double angle( void ) const\n    {\n      return _angle;\n    }\n\nprivate:\n  double _angle;\n};\n\n// Round Rectangle\nclass MagickDLLDecl DrawableRoundRectangle : public DrawableBase\n{\npublic:\n  DrawableRoundRectangle ( double centerX_, double centerY_,\n                           double width_, double hight_,\n                           double cornerWidth_, double cornerHeight_ )\n    : _centerX(centerX_),\n      _centerY(centerY_),\n      _width(width_),\n      _hight(hight_),\n      _cornerWidth(cornerWidth_),\n      _cornerHeight(cornerHeight_)\n    { }\n\n  /*virtual*/ ~DrawableRoundRectangle ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void centerX( double centerX_ )\n    {\n      _centerX = centerX_;\n    }\n  double centerX( void ) const\n    {\n      return _centerX;\n    }\n\n  void centerY( double centerY_ )\n    {\n      _centerY = centerY_;\n    }\n  double centerY( void ) const\n    {\n      return _centerY;\n    }\n\n  void width( double width_ )\n    {\n      _width = width_;\n    }\n  double width( void ) const\n    {\n      return _width;\n    }\n\n  void hight( double hight_ )\n    {\n      _hight = hight_;\n    }\n  double hight( void ) const\n    {\n      return _hight;\n    }\n\n  void cornerWidth( double cornerWidth_ )\n    {\n      _cornerWidth = cornerWidth_;\n    }\n  double cornerWidth( void ) const\n    {\n      return _cornerWidth;\n    }\n\n  void cornerHeight( double cornerHeight_ )\n    {\n      _cornerHeight = cornerHeight_;\n    }\n  double cornerHeight( void ) const\n    {\n      return _cornerHeight;\n    }\n\nprivate:\n  double _centerX;\n  double _centerY;\n  double _width;\n  double _hight;\n  double _cornerWidth;\n  double _cornerHeight;\n};\n\n// Apply Scaling\nclass MagickDLLDecl DrawableScaling : public DrawableBase\n{\npublic:\n  DrawableScaling ( double x_, double y_ )\n    : _x(x_),\n      _y(y_)\n    { }\n\n  /*virtual*/ ~DrawableScaling ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _x;\n  double _y;\n};\n\n// Apply Skew in X direction\nclass MagickDLLDecl DrawableSkewX : public DrawableBase\n{\npublic:\n  DrawableSkewX ( double angle_ )\n    : _angle(angle_)\n    { }\n\n  /*virtual*/ ~DrawableSkewX ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void angle( double angle_ )\n    {\n      _angle = angle_;\n    }\n  double angle( void ) const\n    {\n      return _angle;\n    }\n\nprivate:\n  double _angle;\n};\n\n// Apply Skew in Y direction\nclass MagickDLLDecl DrawableSkewY : public DrawableBase\n{\npublic:\n  DrawableSkewY ( double angle_ )\n    : _angle(angle_)\n    { }\n\n  /*virtual*/ ~DrawableSkewY ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void angle( double angle_ )\n    {\n      _angle = angle_;\n    }\n  double angle( void ) const\n    {\n      return _angle;\n    }\n\nprivate:\n  double _angle;\n};\n\n// Stroke dasharray\n//\n// dasharray_ is an allocated array terminated by value 0.0 or 0.\n// The array is copied so the original does not need to be preserved.\n// Pass a null pointer to clear an existing dash array setting.\nclass MagickDLLDecl DrawableDashArray : public DrawableBase\n{\npublic:\n  DrawableDashArray( const double* dasharray_ );\n  DrawableDashArray( const unsigned int* dasharray_ ); // Deprecated\n  DrawableDashArray( const Magick::DrawableDashArray &original_ );\n\n  /*virtual*/ ~DrawableDashArray( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void dasharray( const double* dasharray_ );\n  void dasharray( const unsigned int* dasharray_ ); // Deprecated\n\n  const double* dasharray( void ) const\n    {\n      return _dasharray;\n    }\n\n  DrawableDashArray& operator=(const Magick::DrawableDashArray &original_);\n\nprivate:\n  size_t        _size;\n  double       *_dasharray;\n};\n\n// Stroke dashoffset\nclass MagickDLLDecl DrawableDashOffset : public DrawableBase\n{\npublic:\n  DrawableDashOffset ( const double offset_ )\n    : _offset(offset_)\n    { }\n\n  /*virtual*/ ~DrawableDashOffset ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void offset( const double offset_ )\n    {\n      _offset = offset_;\n    }\n  double offset( void ) const\n    {\n      return _offset;\n    }\n\nprivate:\n  double _offset;\n};\n\n// Stroke linecap\nclass MagickDLLDecl DrawableStrokeLineCap : public DrawableBase\n{\npublic:\n  DrawableStrokeLineCap ( LineCap linecap_ )\n    : _linecap(linecap_)\n    { }\n\n  /*virtual*/ ~DrawableStrokeLineCap ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void linecap( LineCap linecap_ )\n    {\n      _linecap = linecap_;\n    }\n  LineCap linecap( void ) const\n    {\n      return _linecap;\n    }\n\nprivate:\n  LineCap _linecap;\n};\n\n// Stroke linejoin\nclass MagickDLLDecl DrawableStrokeLineJoin : public DrawableBase\n{\npublic:\n  DrawableStrokeLineJoin ( LineJoin linejoin_ )\n    : _linejoin(linejoin_)\n    { }\n\n  /*virtual*/ ~DrawableStrokeLineJoin ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void linejoin( LineJoin linejoin_ )\n    {\n      _linejoin = linejoin_;\n    }\n  LineJoin linejoin( void ) const\n    {\n      return _linejoin;\n    }\n\nprivate:\n  LineJoin _linejoin;\n};\n\n// Stroke miterlimit\nclass MagickDLLDecl DrawableMiterLimit : public DrawableBase\n{\npublic:\n  DrawableMiterLimit ( unsigned int miterlimit_ )\n    : _miterlimit(miterlimit_)\n    { }\n\n  /*virtual*/ ~DrawableMiterLimit ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void miterlimit( unsigned int miterlimit_ )\n    {\n      _miterlimit = miterlimit_;\n    }\n  unsigned int miterlimit( void ) const\n    {\n      return _miterlimit;\n    }\n\nprivate:\n  unsigned int _miterlimit;\n};\n\n\n// Stroke antialias\nclass MagickDLLDecl DrawableStrokeAntialias : public DrawableBase\n{\npublic:\n  DrawableStrokeAntialias ( bool flag_ )\n    : _flag(flag_)\n    { }\n\n  /*virtual*/ ~DrawableStrokeAntialias ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void flag( bool flag_ )\n    {\n      _flag = flag_;\n    }\n  bool flag( void ) const\n    {\n      return _flag;\n    }\n\nprivate:\n  bool _flag;\n};\n\n// Stroke color\nclass MagickDLLDecl DrawableStrokeColor : public DrawableBase\n{\npublic:\n  DrawableStrokeColor ( const Color &color_ );\n\n  DrawableStrokeColor ( const DrawableStrokeColor& original_ );\n\n  /*virtual*/ ~DrawableStrokeColor ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void color( const Color& color_ )\n    {\n      _color = color_;\n    }\n  Color color( void ) const\n    {\n      return _color;\n    }\n\nprivate:\n  Color _color;\n};\n\n// Stroke opacity\nclass MagickDLLDecl DrawableStrokeOpacity : public DrawableBase\n{\npublic:\n  DrawableStrokeOpacity ( double opacity_ )\n    : _opacity(opacity_)\n    {\n    }\n\n  /*virtual*/ ~DrawableStrokeOpacity ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void opacity( double opacity_ )\n    {\n      _opacity = opacity_;\n    }\n  double opacity( void ) const\n    {\n      return _opacity;\n    }\n\nprivate:\n  double _opacity;\n};\n\n// Stroke width\nclass MagickDLLDecl DrawableStrokeWidth : public DrawableBase\n{\npublic:\n  DrawableStrokeWidth ( double width_ )\n    : _width(width_)\n    { }\n\n  /*virtual*/ ~DrawableStrokeWidth ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void width( double width_ )\n    {\n      _width = width_;\n    }\n  double width( void ) const\n    {\n      return _width;\n    }\n\nprivate:\n  double _width;\n};\n\n// Draw text at point\nclass MagickDLLDecl DrawableText : public DrawableBase\n{\npublic:\n  DrawableText ( const double x_, const double y_,\n                 const std::string &text_ );\n  DrawableText ( const double x_, const double y_,\n                 const std::string &text_, const std::string &encoding_);\n\n  DrawableText ( const DrawableText& original_ );\n\n  /*virtual*/ ~DrawableText ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void encoding(const std::string &encoding_)\n    {\n      _encoding = encoding_;\n    }\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\n  void text( const std::string &text_ )\n    {\n      _text = text_;\n    }\n  std::string text( void ) const\n    {\n      return _text;\n    }\n\nprivate:\n  double      _x;\n  double      _y;\n  std::string _text;\n  std::string _encoding;\n};\n\n// Text antialias\nclass MagickDLLDecl DrawableTextAntialias : public DrawableBase\n{\npublic:\n  DrawableTextAntialias ( bool flag_ );\n\n  DrawableTextAntialias( const DrawableTextAntialias &original_ );\n\n  /*virtual*/ ~DrawableTextAntialias ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void flag( bool flag_ )\n    {\n      _flag = flag_;\n    }\n  bool flag( void ) const\n    {\n      return _flag;\n    }\n\nprivate:\n  bool _flag;\n};\n\n// Decoration (text decoration)\nclass MagickDLLDecl DrawableTextDecoration : public DrawableBase\n{\npublic:\n  DrawableTextDecoration ( DecorationType decoration_ );\n\n  DrawableTextDecoration ( const DrawableTextDecoration& original_ );\n\n  /*virtual*/ ~DrawableTextDecoration( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/  void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void decoration( DecorationType decoration_ )\n    {\n      _decoration = decoration_;\n    }\n  DecorationType decoration( void ) const\n    {\n      return _decoration;\n    }\n\nprivate:\n  DecorationType _decoration;\n};\n\n// Text undercolor box\nclass MagickDLLDecl DrawableTextUnderColor : public DrawableBase\n{\npublic:\n  DrawableTextUnderColor ( const Color &color_ );\n\n  DrawableTextUnderColor ( const DrawableTextUnderColor& original_ );\n\n  /*virtual*/ ~DrawableTextUnderColor ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void color( const Color& color_ )\n    {\n      _color = color_;\n    }\n  Color color( void ) const\n    {\n      return _color;\n    }\n\nprivate:\n  Color _color;\n};\n\n// Apply Translation\nclass MagickDLLDecl DrawableTranslation : public DrawableBase\n{\npublic:\n  DrawableTranslation ( double x_, double y_ )\n    : _x(x_),\n      _y(y_)\n    { }\n\n  /*virtual*/ ~DrawableTranslation ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ DrawableBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _x;\n  double _y;\n};\n\n// Set the size of the viewbox\nclass MagickDLLDecl DrawableViewbox : public DrawableBase\n{\npublic:\n  DrawableViewbox(unsigned long x1_, unsigned long y1_,\n                  unsigned long x2_, unsigned long y2_)\n    : _x1(x1_),\n      _y1(y1_),\n      _x2(x2_),\n      _y2(y2_) { }\n\n  /*virtual*/ ~DrawableViewbox ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/\n  DrawableBase* copy() const;\n\n  void x1( unsigned long x1_ )\n    {\n      _x1 = x1_;\n    }\n  unsigned long x1( void ) const\n    {\n      return _x1;\n    }\n\n  void y1( unsigned long y1_ )\n    {\n      _y1 = y1_;\n    }\n  unsigned long y1( void ) const\n    {\n      return _y1;\n    }\n\n  void x2( unsigned long x2_ )\n    {\n      _x2 = x2_;\n    }\n  unsigned long x2( void ) const\n    {\n      return _x2;\n    }\n\n  void y2( unsigned long y2_ )\n    {\n      _y2 = y2_;\n    }\n  unsigned long y2( void ) const\n    {\n      return _y2;\n    }\n\nprivate:\n  unsigned long _x1;\n  unsigned long _y1;\n  unsigned long _x2;\n  unsigned long _y2;\n};\n\n//\n// Path Element Classes To Support DrawablePath\n//\nclass MagickDLLDecl PathArcArgs\n{\npublic:\n  // Default constructor\n  PathArcArgs( void );\n\n  // Path arc argument\n  PathArcArgs( double radiusX_, double radiusY_,\n               double xAxisRotation_, bool largeArcFlag_,\n               bool sweepFlag_, double x_, double y_ );\n\n  PathArcArgs( const PathArcArgs &original_ );\n\n  ~PathArcArgs ( void );\n\n  void radiusX( double radiusX_ )\n    {\n      _radiusX = radiusX_;\n    }\n  double radiusX( void ) const\n    {\n      return _radiusX;\n    }\n\n  void radiusY( double radiusY_ )\n    {\n      _radiusY = radiusY_;\n    }\n  double radiusY( void ) const\n    {\n      return _radiusY;\n    }\n\n  void xAxisRotation( double xAxisRotation_ )\n    {\n      _xAxisRotation = xAxisRotation_;\n    }\n  double xAxisRotation( void ) const\n    {\n      return _xAxisRotation;\n    }\n\n  void largeArcFlag( bool largeArcFlag_ )\n    {\n      _largeArcFlag = largeArcFlag_;\n    }\n  bool largeArcFlag( void ) const\n    {\n      return _largeArcFlag;\n    }\n\n  void sweepFlag( bool sweepFlag_ )\n    {\n      _sweepFlag = sweepFlag_;\n    }\n  bool sweepFlag( void ) const\n    {\n      return _sweepFlag;\n    }\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double        _radiusX;       // X radius\n  double        _radiusY;       // Y radius\n  double        _xAxisRotation; // Rotation relative to X axis\n  bool        _largeArcFlag;    // Draw longer of the two matching arcs\n  bool        _sweepFlag;       // Draw arc matching clock-wise rotation\n  double        _x;             // End-point X\n  double        _y;             // End-point Y\n};\n\n// Compare two PathArcArgs objects regardless of LHS/RHS\nMagickDLLDeclExtern int operator == ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator != ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator >  ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator <  ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator >= ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\nMagickDLLDeclExtern int operator <= ( const PathArcArgs& left_,\n                                      const PathArcArgs& right_ );\n\ntypedef std::list<Magick::PathArcArgs> PathArcArgsList;\n\n#if defined(MagickDLLExplicitTemplate)\n\nMagickDrawableExtern template class MagickDLLDecl\nstd::allocator<Magick::PathArcArgs>;\n\n// MagickDrawableExtern template class MagickDLLDecl\n// std::list<Magick::PathArcArgs, std::allocator<Magick::PathArcArgs> >;\n\n#endif // MagickDLLExplicitTemplate\n\n// Path Arc (Elliptical Arc)\nclass MagickDLLDecl PathArcAbs : public VPathBase\n{\npublic:\n  // Draw a single arc segment\n  PathArcAbs ( const PathArcArgs &coordinates_ );\n\n  // Draw multiple arc segments\n  PathArcAbs ( const PathArcArgsList &coordinates_ );\n\n  // Copy constructor\n  PathArcAbs ( const PathArcAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathArcAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathArcArgsList _coordinates;\n};\nclass MagickDLLDecl PathArcRel : public VPathBase\n{\npublic:\n  // Draw a single arc segment\n  PathArcRel ( const PathArcArgs &coordinates_ );\n\n  // Draw multiple arc segments\n  PathArcRel ( const PathArcArgsList &coordinates_ );\n\n  PathArcRel ( const PathArcRel& original_ );\n\n  /*virtual*/ ~PathArcRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathArcArgsList _coordinates;\n};\n\n// Path Closepath\nclass MagickDLLDecl PathClosePath : public VPathBase\n{\npublic:\n  PathClosePath ( void )\n    : _dummy(0)\n    {\n    }\n\n  /*virtual*/ ~PathClosePath ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  int   _dummy;\n};\n\n//\n// Curveto (Cubic Bezier)\n//\nclass MagickDLLDecl PathCurvetoArgs\n{\npublic:\n  PathCurvetoArgs( void );\n\n  PathCurvetoArgs( double x1_, double y1_,\n                   double x2_, double y2_,\n                   double x_, double y_ );\n\n  PathCurvetoArgs( const PathCurvetoArgs &original_ );\n\n  ~PathCurvetoArgs ( void );\n\n  void x1( double x1_ )\n    {\n      _x1 = x1_;\n    }\ndouble x1( void ) const\n{\n  return _x1;\n}\n\nvoid y1( double y1_ )\n{\n  _y1 = y1_;\n}\ndouble y1( void ) const\n{\n  return _y1;\n}\n\nvoid x2( double x2_ )\n{\n  _x2 = x2_;\n}\ndouble x2( void ) const\n{\n  return _x2;\n}\n\nvoid y2( double y2_ )\n{\n  _y2 = y2_;\n}\ndouble y2( void ) const\n{\n  return _y2;\n}\n\nvoid x( double x_ )\n{\n  _x = x_;\n}\ndouble x( void ) const\n{\n  return _x;\n}\n\nvoid y( double y_ )\n{\n  _y = y_;\n}\ndouble y( void ) const\n{\n  return _y;\n}\n\nprivate:\ndouble _x1;\ndouble _y1;\ndouble _x2;\ndouble _y2;\ndouble _x;\ndouble _y;\n};\n\n// Compare two PathCurvetoArgs objects regardless of LHS/RHS\nMagickDLLDeclExtern int operator == ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator != ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator >  ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator <  ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator >= ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator <= ( const PathCurvetoArgs& left_,\n                                      const PathCurvetoArgs& right_ );\n\ntypedef std::list<Magick::PathCurvetoArgs> PathCurveToArgsList;\n\n#if defined(MagickDLLExplicitTemplate)\n\nMagickDrawableExtern template class MagickDLLDecl\nstd::allocator<Magick::PathCurvetoArgs>;\n\n// MagickDrawableExtern template class MagickDLLDecl\n// std::list<Magick::PathCurvetoArgs, std::allocator<Magick::PathCurvetoArgs> >;\n\n#endif // MagickDLLExplicitTemplate\n\nclass MagickDLLDecl PathCurvetoAbs : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathCurvetoAbs ( const PathCurvetoArgs &args_ );\n\n  // Draw multiple curves\n  PathCurvetoAbs ( const PathCurveToArgsList &args_ );\n\n  // Copy constructor\n  PathCurvetoAbs ( const PathCurvetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathCurvetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathCurveToArgsList _args;\n};\nclass MagickDLLDecl PathCurvetoRel : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathCurvetoRel ( const PathCurvetoArgs &args_ );\n\n  // Draw multiple curves\n  PathCurvetoRel ( const PathCurveToArgsList &args_ );\n\n  // Copy constructor\n  PathCurvetoRel ( const PathCurvetoRel& original_ );\n\n  /*virtual*/ ~PathCurvetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathCurveToArgsList _args;\n};\nclass MagickDLLDecl PathSmoothCurvetoAbs : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathSmoothCurvetoAbs ( const Magick::Coordinate &coordinates_ );\n\n  // Draw multiple curves\n  PathSmoothCurvetoAbs ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathSmoothCurvetoAbs ( const PathSmoothCurvetoAbs& original_ );\n\n  /*virtual*/ ~PathSmoothCurvetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/\n  VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\nclass MagickDLLDecl PathSmoothCurvetoRel : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathSmoothCurvetoRel ( const Coordinate &coordinates_ );\n\n  // Draw multiple curves\n  PathSmoothCurvetoRel ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathSmoothCurvetoRel ( const PathSmoothCurvetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathSmoothCurvetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/\n  VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n//\n// Quadratic Curveto (Quadratic Bezier)\n//\nclass MagickDLLDecl PathQuadraticCurvetoArgs\n{\npublic:\n  // Default constructor\n  PathQuadraticCurvetoArgs( void );\n\n  // Parameterized constructor\n  PathQuadraticCurvetoArgs( double x1_, double y1_,\n                            double x_, double y_ );\n\n  // Copy constructor\n  PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ );\n\n  ~PathQuadraticCurvetoArgs ( void );\n\n  void x1( double x1_ )\n    {\n      _x1 = x1_;\n    }\n  double x1( void ) const\n    {\n      return _x1;\n    }\n\n  void y1( double y1_ )\n    {\n      _y1 = y1_;\n    }\n  double y1( void ) const\n    {\n      return _y1;\n    }\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _x1;\n  double _y1;\n  double _x;\n  double _y;\n};\n\n// Compare two PathQuadraticCurvetoArgs objects regardless of LHS/RHS\nMagickDLLDeclExtern int operator == ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator != ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_);\nMagickDLLDeclExtern int operator >  ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_);\nMagickDLLDeclExtern int operator <  ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_);\nMagickDLLDeclExtern int operator >= ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_ );\nMagickDLLDeclExtern int operator <= ( const PathQuadraticCurvetoArgs& left_,\n                                      const PathQuadraticCurvetoArgs& right_ );\n\ntypedef std::list<Magick::PathQuadraticCurvetoArgs> PathQuadraticCurvetoArgsList;\n\n#if defined(MagickDLLExplicitTemplate)\n\nMagickDrawableExtern template class MagickDLLDecl\nstd::allocator<Magick::PathQuadraticCurvetoArgs>;\n\n// MagickDrawableExtern template class MagickDLLDecl\n// std::list<Magick::PathQuadraticCurvetoArgs, std::allocator<Magick::PathQuadraticCurvetoArgs> >;\n\n#endif // MagickDLLExplicitTemplate\n\nclass MagickDLLDecl PathQuadraticCurvetoAbs : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathQuadraticCurvetoAbs ( const Magick::PathQuadraticCurvetoArgs &args_ );\n\n  // Draw multiple curves\n  PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoArgsList &args_ );\n\n  // Copy constructor\n  PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathQuadraticCurvetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathQuadraticCurvetoArgsList _args;\n};\nclass MagickDLLDecl PathQuadraticCurvetoRel : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathQuadraticCurvetoRel ( const Magick::PathQuadraticCurvetoArgs &args_ );\n\n  // Draw multiple curves\n  PathQuadraticCurvetoRel ( const PathQuadraticCurvetoArgsList &args_ );\n\n  // Copy constructor\n  PathQuadraticCurvetoRel ( const PathQuadraticCurvetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathQuadraticCurvetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  PathQuadraticCurvetoArgsList _args;\n};\nclass MagickDLLDecl PathSmoothQuadraticCurvetoAbs : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathSmoothQuadraticCurvetoAbs ( const Magick::Coordinate &coordinate_ );\n\n  // Draw multiple curves\n  PathSmoothQuadraticCurvetoAbs ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathSmoothQuadraticCurvetoAbs ( const PathSmoothQuadraticCurvetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathSmoothQuadraticCurvetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\nclass MagickDLLDecl PathSmoothQuadraticCurvetoRel : public VPathBase\n{\npublic:\n  // Draw a single curve\n  PathSmoothQuadraticCurvetoRel ( const Magick::Coordinate &coordinate_ );\n\n  // Draw multiple curves\n  PathSmoothQuadraticCurvetoRel ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathSmoothQuadraticCurvetoRel ( const PathSmoothQuadraticCurvetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathSmoothQuadraticCurvetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n//\n// Path Lineto\n//\nclass MagickDLLDecl PathLinetoAbs : public VPathBase\n{\npublic:\n  // Draw to a single point\n  PathLinetoAbs ( const Magick::Coordinate& coordinate_  );\n\n  // Draw to multiple points\n  PathLinetoAbs ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathLinetoAbs ( const PathLinetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathLinetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\nclass MagickDLLDecl PathLinetoRel : public VPathBase\n{\npublic:\n  // Draw to a single point\n  PathLinetoRel ( const Magick::Coordinate& coordinate_ );\n\n  // Draw to multiple points\n  PathLinetoRel ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathLinetoRel ( const PathLinetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathLinetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n// Path Horizontal Lineto\nclass MagickDLLDecl PathLinetoHorizontalAbs : public VPathBase\n{\npublic:\n  PathLinetoHorizontalAbs ( double x_ )\n    : _x(x_)\n    {\n    }\n\n  /*virtual*/ ~PathLinetoHorizontalAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\nprivate:\n  double _x;\n};\nclass MagickDLLDecl PathLinetoHorizontalRel : public VPathBase\n{\npublic:\n  PathLinetoHorizontalRel ( double x_ )\n    : _x(x_)\n    {\n    }\n\n  /*virtual*/ ~PathLinetoHorizontalRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\n  void x( double x_ )\n    {\n      _x = x_;\n    }\n  double x( void ) const\n    {\n      return _x;\n    }\n\nprivate:\n  double _x;\n};\n\n// Path Vertical Lineto\nclass MagickDLLDecl PathLinetoVerticalAbs : public VPathBase\n{\npublic:\n  PathLinetoVerticalAbs ( double y_ )\n    : _y(y_)\n    {\n    }\n\n  /*virtual*/ ~PathLinetoVerticalAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _y;\n};\nclass MagickDLLDecl PathLinetoVerticalRel : public VPathBase\n{\npublic:\n  PathLinetoVerticalRel ( double y_ )\n    : _y(y_)\n    {\n    }\n\n  /*virtual*/ ~PathLinetoVerticalRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\n  void y( double y_ )\n    {\n      _y = y_;\n    }\n  double y( void ) const\n    {\n      return _y;\n    }\n\nprivate:\n  double _y;\n};\n\n// Path Moveto\nclass MagickDLLDecl PathMovetoAbs : public VPathBase\n{\npublic:\n  // Simple moveto\n  PathMovetoAbs ( const Magick::Coordinate &coordinate_ );\n\n  // Moveto followed by implicit linetos\n  PathMovetoAbs ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathMovetoAbs ( const PathMovetoAbs& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathMovetoAbs ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\nclass MagickDLLDecl PathMovetoRel : public VPathBase\n{\npublic:\n  // Simple moveto\n  PathMovetoRel ( const Magick::Coordinate &coordinate_ );\n\n  // Moveto followed by implicit linetos\n  PathMovetoRel ( const CoordinateList &coordinates_ );\n\n  // Copy constructor\n  PathMovetoRel ( const PathMovetoRel& original_ );\n\n  // Destructor\n  /*virtual*/ ~PathMovetoRel ( void );\n\n  // Operator to invoke equivalent draw API call\n  /*virtual*/ void operator()( MagickLib::DrawContext context_ ) const;\n\n  // Return polymorphic copy of object\n  /*virtual*/ VPathBase* copy() const;\n\nprivate:\n  CoordinateList _coordinates;\n};\n\n#if defined(__clang__)\n#pragma clang diagnostic pop\n#endif /* if defined(__clang__) */\n\n} // namespace Magick\n\n#endif // Magick_Drawable_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/Exception.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003\n//\n// Definition of Magick::Exception and derived classes\n// Magick::Warning* and Magick::Error*.  Derived from C++ STD\n// 'exception' class for convenience.\n//\n// These classes form part of the Magick++ user interface.\n//\n\n#if !defined(Magick_Exception_header)\n#define Magick_Exception_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n#include <exception>\n\nnamespace Magick\n{\n  class MagickDLLDecl Exception : public std::exception\n  {\n  public:\n    Exception( const std::string& what_ );\n    Exception( const Exception& original_ );\n    Exception& operator= (const Exception& original_ );\n    virtual const char* what () const throw();\n    virtual ~Exception ( ) throw ();\n\n  private:\n    std::string _what;\n  };\n\n  //\n  // Warnings\n  //\n\n  class MagickDLLDecl Warning : public Exception\n  {\n  public:\n    explicit Warning ( const std::string& what_ );\n    ~Warning() throw ();\n  };\n\n  class MagickDLLDecl WarningUndefined : public Warning\n  {\n  public:\n    explicit WarningUndefined ( const std::string& what_ );\n    ~WarningUndefined() throw ();\n  };\n\n  class MagickDLLDecl WarningBlob: public Warning\n  {\n  public:\n    explicit WarningBlob ( const std::string& what_ );\n    ~WarningBlob() throw ();\n  };\n\n  class MagickDLLDecl WarningCache: public Warning\n  {\n  public:\n    explicit WarningCache ( const std::string& what_ );\n    ~WarningCache() throw ();\n  };\n\n  class MagickDLLDecl WarningCoder: public Warning\n  {\n  public:\n    explicit WarningCoder ( const std::string& what_ );\n    ~WarningCoder() throw ();\n  };\n\n  class MagickDLLDecl WarningConfigure: public Warning\n  {\n  public:\n    explicit WarningConfigure ( const std::string& what_ );\n    ~WarningConfigure() throw ();\n  };\n\n  class MagickDLLDecl WarningCorruptImage: public Warning\n  {\n  public:\n    explicit WarningCorruptImage ( const std::string& what_ );\n    ~WarningCorruptImage() throw ();\n  };\n\n  class MagickDLLDecl WarningDelegate : public Warning\n  {\n  public:\n    explicit WarningDelegate ( const std::string& what_ );\n    ~WarningDelegate() throw ();\n  };\n\n  class MagickDLLDecl WarningDraw : public Warning\n  {\n  public:\n    explicit WarningDraw ( const std::string& what_ );\n    ~WarningDraw() throw ();\n  };\n\n  class MagickDLLDecl WarningFileOpen: public Warning\n  {\n  public:\n    explicit WarningFileOpen ( const std::string& what_ );\n    ~WarningFileOpen() throw ();\n  };\n\n  class MagickDLLDecl WarningImage: public Warning\n  {\n  public:\n    explicit WarningImage ( const std::string& what_ );\n    ~WarningImage() throw ();\n  };\n\n  class MagickDLLDecl WarningMissingDelegate : public Warning\n  {\n  public:\n    explicit WarningMissingDelegate ( const std::string& what_ );\n    ~WarningMissingDelegate() throw ();\n  };\n\n  class MagickDLLDecl WarningModule : public Warning\n  {\n  public:\n    explicit WarningModule ( const std::string& what_ );\n    ~WarningModule() throw ();\n  };\n\n  class MagickDLLDecl WarningMonitor : public Warning\n  {\n  public:\n    explicit WarningMonitor ( const std::string& what_ );\n    ~WarningMonitor() throw ();\n  };\n\n  class MagickDLLDecl WarningOption : public Warning\n  {\n  public:\n    explicit WarningOption ( const std::string& what_ );\n    ~WarningOption() throw ();\n  };\n\n  class MagickDLLDecl WarningRegistry : public Warning\n  {\n  public:\n    explicit WarningRegistry ( const std::string& what_ );\n    ~WarningRegistry() throw ();\n  };\n\n  class MagickDLLDecl WarningResourceLimit : public Warning\n  {\n  public:\n    explicit WarningResourceLimit ( const std::string& what_ );\n    ~WarningResourceLimit() throw ();\n  };\n\n  class MagickDLLDecl WarningStream : public Warning\n  {\n  public:\n    explicit WarningStream ( const std::string& what_ );\n    ~WarningStream() throw ();\n  };\n\n  class MagickDLLDecl WarningType : public Warning\n  {\n  public:\n    explicit WarningType ( const std::string& what_ );\n    ~WarningType() throw ();\n  };\n\n  class MagickDLLDecl WarningXServer : public Warning\n  {\n  public:\n    explicit WarningXServer ( const std::string& what_ );\n    ~WarningXServer() throw ();\n  };\n\n  //\n  // Error exceptions\n  //\n\n  class MagickDLLDecl Error : public Exception\n  {\n  public:\n    explicit Error ( const std::string& what_ );\n    ~Error() throw ();\n  };\n\n  class MagickDLLDecl ErrorUndefined : public Error\n  {\n  public:\n    explicit ErrorUndefined ( const std::string& what_ );\n    ~ErrorUndefined() throw ();\n  };\n\n  class MagickDLLDecl ErrorBlob: public Error\n  {\n  public:\n    explicit ErrorBlob ( const std::string& what_ );\n    ~ErrorBlob() throw ();\n  };\n\n  class MagickDLLDecl ErrorCache: public Error\n  {\n  public:\n    explicit ErrorCache ( const std::string& what_ );\n    ~ErrorCache() throw ();\n  };\n\n  class MagickDLLDecl ErrorCoder: public Error\n  {\n  public:\n    explicit ErrorCoder ( const std::string& what_ );\n    ~ErrorCoder() throw ();\n  };\n\n  class MagickDLLDecl ErrorConfigure: public Error\n  {\n  public:\n    explicit ErrorConfigure ( const std::string& what_ );\n    ~ErrorConfigure() throw ();\n  };\n\n  class MagickDLLDecl ErrorCorruptImage: public Error\n  {\n  public:\n    explicit ErrorCorruptImage ( const std::string& what_ );\n    ~ErrorCorruptImage() throw ();\n  };\n\n  class MagickDLLDecl ErrorDelegate : public Error\n  {\n  public:\n    explicit ErrorDelegate ( const std::string& what_ );\n    ~ErrorDelegate() throw ();\n  };\n\n  class MagickDLLDecl ErrorDraw : public Error\n  {\n  public:\n    explicit ErrorDraw ( const std::string& what_ );\n    ~ErrorDraw() throw ();\n  };\n\n  class MagickDLLDecl ErrorFileOpen: public Error\n  {\n  public:\n    explicit ErrorFileOpen ( const std::string& what_ );\n    ~ErrorFileOpen() throw ();\n  };\n\n  class MagickDLLDecl ErrorImage: public Error\n  {\n  public:\n    explicit ErrorImage ( const std::string& what_ );\n    ~ErrorImage() throw ();\n  };\n\n  class MagickDLLDecl ErrorMissingDelegate : public Error\n  {\n  public:\n    explicit ErrorMissingDelegate ( const std::string& what_ );\n    ~ErrorMissingDelegate() throw ();\n  };\n\n  class MagickDLLDecl ErrorModule : public Error\n  {\n  public:\n    explicit ErrorModule ( const std::string& what_ );\n    ~ErrorModule() throw ();\n  };\n\n  class MagickDLLDecl ErrorMonitor : public Error\n  {\n  public:\n    explicit ErrorMonitor ( const std::string& what_ );\n    ~ErrorMonitor() throw ();\n  };\n\n  class MagickDLLDecl ErrorOption : public Error\n  {\n  public:\n    explicit ErrorOption ( const std::string& what_ );\n    ~ErrorOption() throw ();\n  };\n\n  class MagickDLLDecl ErrorRegistry : public Error\n  {\n  public:\n    explicit ErrorRegistry ( const std::string& what_ );\n    ~ErrorRegistry() throw ();\n  };\n\n  class MagickDLLDecl ErrorResourceLimit : public Error\n  {\n  public:\n    explicit ErrorResourceLimit ( const std::string& what_ );\n    ~ErrorResourceLimit() throw ();\n  };\n\n  class MagickDLLDecl ErrorStream : public Error\n  {\n  public:\n    explicit ErrorStream ( const std::string& what_ );\n    ~ErrorStream() throw ();\n  };\n\n  class MagickDLLDecl ErrorType : public Error\n  {\n  public:\n    explicit ErrorType ( const std::string& what_ );\n    ~ErrorType() throw ();\n  };\n\n  class MagickDLLDecl ErrorXServer : public Error\n  {\n  public:\n    explicit ErrorXServer ( const std::string& what_ );\n    ~ErrorXServer() throw ();\n  };\n\n  //\n  // No user-serviceable components beyond this point.\n  //\n\n  // Throw exception based on raw data\n  MagickDLLDeclExtern void throwExceptionExplicit( const MagickLib::ExceptionType severity_,\n                                                   const char* reason_,\n                                                   const char* description_ = 0 );\n\n  // Thow exception based on ImageMagick's ExceptionInfo\n  MagickDLLDeclExtern void throwException( MagickLib::ExceptionInfo &exception_,\n                                           const bool quiet_ = false );\n\n} // namespace Magick\n\n#endif // Magick_Exception_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/Geometry.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2014\n//\n// Geometry Definition\n//\n// Representation of an ImageMagick geometry specification\n// X11 geometry specification plus hints\n\n#if !defined (Magick_Geometry_header)\n#define Magick_Geometry_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n\nnamespace Magick\n{\n\n  class MagickDLLDecl Geometry;\n\n  // Compare two Geometry objects regardless of LHS/RHS\n  int MagickDLLDecl operator == ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator != ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator >  ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator <  ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator >= ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n  int MagickDLLDecl operator <= ( const Magick::Geometry& left_, const Magick::Geometry& right_ );\n\n  class MagickDLLDecl Geometry\n  {\n  public:\n\n    Geometry ( unsigned int width_,\n               unsigned int height_,\n               unsigned int xOff_ = 0,\n               unsigned int yOff_ = 0,\n               bool xNegative_ = false,\n               bool yNegative_ = false );\n    Geometry ( const std::string &geometry_ );\n    Geometry ( const char * geometry_ );\n    Geometry ( const Geometry &geometry_ );\n    Geometry ( );\n    ~Geometry ( void );\n\n    // Width\n    void          width ( unsigned int width_ );\n    unsigned int  width ( void ) const;\n\n    // Height\n    void          height ( unsigned int height_ );\n    unsigned int  height ( void ) const;\n\n    // X offset from origin\n    void          xOff ( unsigned int xOff_ );\n    unsigned int  xOff ( void ) const;\n\n    // Y offset from origin\n    void          yOff ( unsigned int yOff_ );\n    unsigned int  yOff ( void ) const;\n\n    // Sign of X offset negative? (X origin at right)\n    void          xNegative ( bool xNegative_ );\n    bool          xNegative ( void ) const;\n\n    // Sign of Y offset negative? (Y origin at bottom)\n    void          yNegative ( bool yNegative_ );\n    bool          yNegative ( void ) const;\n\n    // Width and height are expressed as percentages\n    void          percent ( bool percent_ );\n    bool          percent ( void ) const;\n\n    // Resize without preserving aspect ratio (!)\n    void          aspect ( bool aspect_ );\n    bool          aspect ( void ) const;\n\n    // Resize if image is greater than size (>)\n    void          greater ( bool greater_ );\n    bool          greater ( void ) const;\n\n    // Resize if image is less than size (<)\n    void          less ( bool less_ );\n    bool          less ( void ) const;\n\n    // Resize image to fit total pixel area specified by dimensions (@).\n    void          limitPixels ( bool limitPixels_ );\n    bool          limitPixels ( void ) const;\n\n    // Dimensions are treated as minimum rather than maximum values (^)\n    void          fillArea ( bool fillArea_ );\n    bool          fillArea ( void ) const;\n\n    // Does object contain valid geometry?\n    void          isValid ( bool isValid_ );\n    bool          isValid ( void ) const;\n\n    // Set via geometry string\n    const Geometry& operator = ( const std::string &geometry_ );\n    const Geometry& operator = ( const char * geometry_ );\n\n    // Assignment operator\n    Geometry& operator= ( const Geometry& Geometry_ );\n\n    // Return geometry string\n    operator std::string() const;\n\n    //\n    // Public methods below this point are for Magick++ use only.\n    //\n\n    // Construct from RectangleInfo\n    Geometry ( const MagickLib::RectangleInfo &rectangle_ );\n\n    // Return an ImageMagick RectangleInfo struct\n    operator MagickLib::RectangleInfo() const;\n\n  private:\n    unsigned int  _width;\n    unsigned int  _height;\n    unsigned int  _xOff;\n    unsigned int  _yOff;\n    union\n    {\n      struct\n      {\n        // Bit-field for compact boolean storage\n        bool          _xNegative : 1;\n        bool          _yNegative : 1;\n        bool          _isValid : 1;\n        bool          _percent : 1;    // Interpret width & height as percentages (%)\n        bool          _aspect : 1;     // Force exact size (!)\n        bool          _greater : 1;    // Re-size only if larger than geometry (>)\n        bool          _less : 1;       // Re-size only if smaller than geometry (<)\n        bool          _limitPixels : 1;// Resize image to fit total pixel area (@).\n        bool          _fillArea : 1;   // Dimensions are treated as\n                                       // minimum rather than maximum\n                                       // values (^)\n      } _b;\n      struct\n      {\n        // Padding for future use.\n        unsigned int pad[2];\n      } _padding;\n    } _flags; // union\n  }; // class Geometry;\n} // namespace Magick\n\n//\n// Inlines\n//\n\n\n#endif // Magick_Geometry_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/Image.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2017\n//\n// Definition of Image, the representation of a single image in Magick++\n//\n\n#if !defined(Magick_Image_header)\n#define Magick_Image_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n#include <list>\n#include \"Magick++/Blob.h\"\n#include \"Magick++/Color.h\"\n#include \"Magick++/Drawable.h\"\n#include \"Magick++/Exception.h\"\n#include \"Magick++/Geometry.h\"\n#include \"Magick++/TypeMetric.h\"\n\nnamespace Magick\n{\n  // Forward declarations\n  class Options;\n  class ImageRef;\n\n//   extern MagickDLLDecl const std::string borderGeometryDefault;\n//   extern MagickDLLDecl const std::string frameGeometryDefault;\n//   extern MagickDLLDecl const std::string raiseGeometryDefault;\n  extern MagickDLLDecl const char *borderGeometryDefault;\n  extern MagickDLLDecl const char *frameGeometryDefault;\n  extern MagickDLLDecl const char *raiseGeometryDefault;\n\n  // Compare two Image objects regardless of LHS/RHS\n  // Image sizes and signatures are used as basis of comparison\n  int MagickDLLDecl operator == ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator != ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator >  ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator <  ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator >= ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n  int MagickDLLDecl operator <= ( const Magick::Image& left_,\n                                  const Magick::Image& right_ );\n\n  // C library initialization routine\n  void MagickDLLDecl InitializeMagick(const char *path_);\n\n  //\n  // Image is the representation of an image.  In reality, it actually\n  // a handle object which contains a pointer to a shared reference\n  // object (ImageRef). As such, this object is extremely space efficient.\n  //\n  class MagickDLLDecl Image\n  {\n  public:\n    // Construct from image file or image specification\n    Image( const std::string &imageSpec_ );\n\n    // Construct a blank image canvas of specified size and color\n    Image( const Geometry &size_, const Color &color_ );\n\n    // Construct Image from in-memory BLOB\n    Image ( const Blob &blob_ );\n\n    // Construct Image of specified size from in-memory BLOB\n    Image ( const Blob &blob_, const Geometry &size_ );\n\n    // Construct Image of specified size and depth from in-memory BLOB\n    Image ( const Blob &blob_, const Geometry &size,\n            const unsigned int depth );\n\n    // Construct Image of specified size, depth, and format from\n    // in-memory BLOB\n    Image ( const Blob &blob_, const Geometry &size,\n            const unsigned int depth_,\n            const std::string &magick_ );\n    // Construct Image of specified size, and format from in-memory\n    // BLOB\n    Image ( const Blob &blob_, const Geometry &size,\n            const std::string &magick_ );\n\n    // Construct an image based on an array of raw pixels, of\n    // specified type and mapping, in memory\n    Image ( const unsigned int width_,\n            const unsigned int height_,\n            const std::string &map_,\n            const StorageType type_,\n            const void *pixels_ );\n\n    // Default constructor\n    Image( void );\n\n    // Destructor\n    virtual ~Image();\n\n    /// Copy constructor\n    Image ( const Image & image_ );\n\n    // Assignment operator\n    Image& operator= ( const Image &image_ );\n\n    //////////////////////////////////////////////////////////////////////\n    //\n    // Image operations\n    //\n    //////////////////////////////////////////////////////////////////////\n\n    // Local adaptive threshold image\n    // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm\n    // Width x height define the size of the pixel neighborhood\n    // offset = constant to subtract from pixel neighborhood mean\n    void            adaptiveThreshold ( const unsigned int width,\n                                        const unsigned int height,\n                                        const double offset = 0.0 );\n    void            adaptiveThreshold ( const unsigned int width,\n                                        const unsigned int height,\n                                        const unsigned int offset) MAGICK_FUNC_DEPRECATED;\n\n    // Add noise to image with specified noise type\n    void            addNoise ( const NoiseType noiseType_ );\n    void            addNoiseChannel ( const ChannelType channel_,\n                                      const NoiseType noiseType_);\n\n    // Transform image by specified affine (or free transform) matrix.\n    void            affineTransform ( const DrawableAffine &affine );\n\n    //\n    // Annotate image (draw text on image)\n    //\n\n    // Gravity effects text placement in bounding area according to rules:\n    //  NorthWestGravity  text bottom-left corner placed at top-left\n    //  NorthGravity      text bottom-center placed at top-center\n    //  NorthEastGravity  text bottom-right corner placed at top-right\n    //  WestGravity       text left-center placed at left-center\n    //  CenterGravity     text center placed at center\n    //  EastGravity       text right-center placed at right-center\n    //  SouthWestGravity  text top-left placed at bottom-left\n    //  SouthGravity      text top-center placed at bottom-center\n    //  SouthEastGravity  text top-right placed at bottom-right\n\n    // Annotate using specified text, and placement location\n    void            annotate ( const std::string &text_,\n                               const Geometry &location_ );\n    // Annotate using specified text, bounding area, and placement\n    // gravity\n    void            annotate ( const std::string &text_,\n                               const Geometry &boundingArea_,\n                               const GravityType gravity_ );\n    // Annotate with text using specified text, bounding area,\n    // placement gravity, and rotation.\n    void            annotate ( const std::string &text_,\n                               const Geometry &boundingArea_,\n                               const GravityType gravity_,\n                               const double degrees_ );\n    // Annotate with text (bounding area is entire image) and placement\n    // gravity.\n    void            annotate ( const std::string &text_,\n                               const GravityType gravity_ );\n\n    // Orient image to be right-side up based on its current\n    // orientation attribute.  This allows the image to be viewed\n    // correctly when the orientation attribute is not available, or\n    // is not respected.\n    void            autoOrient( void );\n\n    // Blur image with specified blur factor\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    void            blur ( const double radius_ = 0.0,\n                           const double sigma_ = 1.0  );\n    void            blurChannel ( const ChannelType channel_,\n                                  const double radius_ = 0.0,\n                                  const double sigma_ = 1.0  );\n\n    // Border image (add border to image)\n    void            border ( const Geometry &geometry_\n                             = borderGeometryDefault );\n\n    // Bake in the ASC-CDL, which is a convention for the for the\n    // exchange of basic primary color grading information between for\n    // the exchange of basic primary color grading information between\n    // equipment and software from different manufacturers.  It is a\n    // useful transform for other purposes as well.\n    void            cdl ( const std::string &cdl_ );\n\n    // Extract channel from image\n    void            channel ( const ChannelType channel_ );\n\n    // Set or obtain modulus channel depth\n    void            channelDepth ( const ChannelType channel_,\n                                   const unsigned int depth_ );\n    unsigned int    channelDepth ( const ChannelType channel_ );\n\n    // Charcoal effect image (looks like charcoal sketch)\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    void            charcoal ( const double radius_ = 0.0,\n                               const double sigma_ = 1.0 );\n\n    // Chop image (remove vertical or horizontal subregion of image)\n    // FIXME: describe how geometry argument is used to select either\n    // horizontal or vertical subregion of image.\n\n    void            chop ( const Geometry &geometry_ );\n\n    // Colorize image with pen color, using specified percent opacity\n    // for red, green, and blue quantums\n    void            colorize ( const unsigned int opacityRed_,\n                               const unsigned int opacityGreen_,\n                               const unsigned int opacityBlue_,\n                               const Color &penColor_ );\n    // Colorize image with pen color, using specified percent opacity.\n    void            colorize ( const unsigned int opacity_,\n                               const Color &penColor_ );\n\n    // Apply a color matrix to the image channels.  The user supplied\n    // matrix may be of order 1 to 5 (1x1 through 5x5).\n    void            colorMatrix (const unsigned int order_,\n                                 const double *color_matrix_);\n\n    // Comment image (add comment string to image)\n    void            comment ( const std::string &comment_ );\n\n    // Compare current image with another image\n    // Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError\n    // in the current image. False is returned if the images are identical.\n    bool            compare ( const Image &reference_ );\n\n    // Compose an image onto another at specified offset and using\n    // specified algorithm\n    void            composite ( const Image &compositeImage_,\n                                const int xOffset_,\n                                const int yOffset_,\n                                const CompositeOperator compose_\n                                = InCompositeOp );\n    void            composite ( const Image &compositeImage_,\n                                const Geometry &offset_,\n                                const CompositeOperator compose_\n                                = InCompositeOp );\n    void            composite ( const Image &compositeImage_,\n                                const GravityType gravity_,\n                                const CompositeOperator compose_\n                                = InCompositeOp );\n\n    // Contrast image (enhance intensity differences in image)\n    void            contrast ( const unsigned int sharpen_ );\n\n    // Convolve image.  Applies a user-specified convolution to the image.\n    //  order_ represents the number of columns and rows in the filter kernel.\n    //  kernel_ is an array of doubles representing the convolution kernel.\n    void            convolve ( const unsigned int order_,\n                               const double *kernel_ );\n\n    // Crop image (subregion of original image)\n    void            crop ( const Geometry &geometry_ );\n\n    // Cycle image colormap\n    void            cycleColormap ( const int amount_ );\n\n    // Despeckle image (reduce speckle noise)\n    void            despeckle ( void );\n\n    // Display image on screen\n    void            display ( void );\n\n    // Draw on image using a single drawable\n    void            draw ( const Drawable &drawable_ );\n\n    // Draw on image using a drawable list\n    void            draw ( const std::list<Magick::Drawable> &drawable_ );\n\n    // Edge image (hilight edges in image)\n    void            edge ( const double radius_ = 0.0 );\n\n    // Emboss image (hilight edges with 3D effect)\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    void            emboss ( const double radius_ = 0.0,\n                             const double sigma_ = 1.0);\n\n    // Enhance image (minimize noise)\n    void            enhance ( void );\n\n    // Equalize image (histogram equalization)\n    void            equalize ( void );\n\n    // Erase image to current \"background color\"\n    void            erase ( void );\n\n    // Create an image canvas using background color sized according\n    // to geometry and composite existing image on it, with image\n    // placement controlled by gravity.  Parameters are obtained from\n    // existing image properties if they are not specified via a\n    // method parameter.  Parameters which are supported by image\n    // properties (gravity and backgroundColor) update those image\n    // properties as a side-effect.\n    void            extent ( const Geometry &geometry_ );\n\n    void            extent ( const Geometry &geometry_,\n                             const GravityType &gravity_ );\n\n    void            extent ( const Geometry &geometry_,\n                             const Color &backgroundColor_ );\n\n    void            extent ( const Geometry &geometry_,\n                             const Color &backgroundColor_,\n                             const GravityType &gravity_ );\n\n    // Flip image (reflect each scanline in the vertical direction)\n    void            flip ( void );\n\n    // Flood-fill color across pixels that match the color of the\n    // target pixel and are neighbors of the target pixel.\n    // Uses current fuzz setting when determining color match.\n    void            floodFillColor( const unsigned int x_,\n                                    const unsigned int y_,\n                                    const Color &fillColor_ );\n    void            floodFillColor( const Geometry &point_,\n                                    const Color &fillColor_ );\n\n    // Flood-fill color across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    void            floodFillColor( const unsigned int x_,\n                                    const unsigned int y_,\n                                    const Color &fillColor_,\n                                    const Color &borderColor_ );\n    void            floodFillColor( const Geometry &point_,\n                                    const Color &fillColor_,\n                                    const Color &borderColor_ );\n\n    // Floodfill pixels matching color (within fuzz factor) of target\n    // pixel(x,y) with replacement opacity value using method.\n    void            floodFillOpacity ( const unsigned int x_,\n                                       const unsigned int y_,\n                                       const unsigned int opacity_,\n                                       const PaintMethod method_ );\n\n    // Flood-fill texture across pixels that match the color of the\n    // target pixel and are neighbors of the target pixel.\n    // Uses current fuzz setting when determining color match.\n    void            floodFillTexture( const unsigned int x_,\n                                      const unsigned int y_,\n                                      const Image &texture_ );\n    void            floodFillTexture( const Geometry &point_,\n                                      const Image &texture_ );\n\n    // Flood-fill texture across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    void            floodFillTexture( const unsigned int x_,\n                                      const unsigned int y_,\n                                      const Image &texture_,\n                                      const Color &borderColor_ );\n    void            floodFillTexture( const Geometry &point_,\n                                      const Image &texture_,\n                                      const Color &borderColor_ );\n\n    // Flop image (reflect each scanline in the horizontal direction)\n    void            flop ( void );\n\n    // Frame image\n    void            frame ( const Geometry &geometry_ = frameGeometryDefault );\n    void            frame ( const unsigned int width_,\n                            const unsigned int height_,\n                            const int innerBevel_ = 6,\n                            const int outerBevel_ = 6 );\n\n    // Gamma correct image\n    void            gamma ( const double gamma_ );\n    void            gamma ( const double gammaRed_,\n                            const double gammaGreen_,\n                            const double gammaBlue_ );\n\n    // Gaussian blur image\n    // The number of neighbor pixels to be included in the convolution\n    // mask is specified by 'width_'. The standard deviation of the\n    // gaussian bell curve is specified by 'sigma_'.\n    void            gaussianBlur ( const double width_, const double sigma_ );\n    void            gaussianBlurChannel ( const ChannelType channel_,\n                                          const double width_, const double sigma_ );\n\n    // Implode image (special effect)\n    void            implode ( const double factor_ );\n\n    // Apply a color lookup table (Hald CLUT) to the image.\n    void            haldClut ( const Image &clutImage_ );\n\n    // Label image\n    void            label ( const std::string &label_ );\n\n    // Level image. Adjust the levels of the image by scaling the\n    // colors falling between specified white and black points to the\n    // full available quantum range. The parameters provided represent\n    // the black, mid (gamma), and white points.  The black point\n    // specifies the darkest color in the image. Colors darker than\n    // the black point are set to zero. Mid point (gamma) specifies a\n    // gamma correction to apply to the image. White point specifies\n    // the lightest color in the image.  Colors brighter than the\n    // white point are set to the maximum quantum value. The black and\n    // white point have the valid range 0 to MaxRGB while mid (gamma)\n    // has a useful range of 0 to ten.\n    void            level ( const double black_point,\n                            const double white_point,\n                            const double mid_point=1.0 );\n\n    // Level image channel. Adjust the levels of the image channel by\n    // scaling the values falling between specified white and black\n    // points to the full available quantum range. The parameters\n    // provided represent the black, mid (gamma), and white points.\n    // The black point specifies the darkest color in the\n    // image. Colors darker than the black point are set to zero. Mid\n    // point (gamma) specifies a gamma correction to apply to the\n    // image. White point specifies the lightest color in the image.\n    // Colors brighter than the white point are set to the maximum\n    // quantum value. The black and white point have the valid range 0\n    // to MaxRGB while mid (gamma) has a useful range of 0 to ten.\n    void            levelChannel ( const ChannelType channel,\n                                   const double black_point,\n                                   const double white_point,\n                                   const double mid_point=1.0 );\n\n    // Magnify image by integral size\n    void            magnify ( void );\n\n    // Remap image colors with closest color from reference image\n    void            map ( const Image &mapImage_ ,\n                          const bool dither_ = false );\n\n    // Floodfill designated area with replacement opacity value\n    void            matteFloodfill ( const Color &target_ ,\n                                     const unsigned int opacity_,\n                                     const int x_, const int y_,\n                                     const PaintMethod method_ );\n\n    // Filter image by replacing each pixel component with the median\n    // color in a circular neighborhood\n    void            medianFilter ( const double radius_ = 0.0 );\n\n    // Reduce image by integral size\n    void            minify ( void );\n\n    // Modulate percent hue, saturation, and brightness of an image.\n    // Modulation of saturation and brightness is as a ratio of the\n    // current value (1.0 for no change). Modulation of hue is an\n    // absolute rotation of -180 degrees to +180 degrees from the\n    // current position corresponding to an argument range of 0 to 2.0\n    // (1.0 for no change).\n    void            modulate ( const double brightness_,\n                               const double saturation_,\n                               const double hue_ );\n\n    // Motion blur image with specified blur factor\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    // The angle_ parameter specifies the angle the object appears\n    // to be comming from (zero degrees is from the right).\n    void            motionBlur ( const double radius_,\n                                 const double sigma_,\n                                 const double angle_ );\n\n    // Negate colors in image.  Set grayscale to only negate grayscale\n    // values in image.\n    void            negate ( const bool grayscale_ = false );\n\n    // Normalize image (increase contrast by normalizing the pixel\n    // values to span the full range of color values)\n    void            normalize ( void );\n\n    // Oilpaint image (image looks like oil painting)\n    void            oilPaint ( const double radius_ = 3.0 );\n\n    // Set or attenuate the opacity channel in the image. If the image\n    // pixels are opaque then they are set to the specified opacity\n    // value, otherwise they are blended with the supplied opacity\n    // value.  The value of opacity_ ranges from 0 (completely opaque)\n    // to MaxRGB. The defines OpaqueOpacity and TransparentOpacity are\n    // available to specify completely opaque or completely\n    // transparent, respectively.\n    void            opacity ( const unsigned int opacity_ );\n\n    // Change color of opaque pixel to specified pen color.\n    void            opaque ( const Color &opaqueColor_,\n                             const Color &penColor_ );\n\n    // Ping is similar to read except only enough of the image is read\n    // to determine the image columns, rows, and filesize.  Access the\n    // columns(), rows(), and fileSize() attributes after invoking\n    // ping.  The image data is not valid after calling ping.\n    void            ping ( const std::string &imageSpec_ );\n\n    // Ping is similar to read except only enough of the image is read\n    // to determine the image columns, rows, and filesize.  Access the\n    // columns(), rows(), and fileSize() attributes after invoking\n    // ping.  The image data is not valid after calling ping.\n    void            ping ( const Blob &blob_ );\n\n    // Quantize image (reduce number of colors)\n    void            quantize ( const bool measureError_ = false );\n\n    // Apply an arithmetic or bitwise operator to the image pixel quantums.\n    void            quantumOperator ( const ChannelType channel_,\n                                      const QuantumOperator operator_,\n                                      Quantum rvalue_) MAGICK_FUNC_DEPRECATED;\n    void            quantumOperator ( const ChannelType channel_,\n                                      const QuantumOperator operator_,\n                                      double rvalue_);\n    void            quantumOperator ( const int x_,const int y_,\n                                      const unsigned int columns_,\n                                      const unsigned int rows_,\n                                      const ChannelType channel_,\n                                      const QuantumOperator operator_,\n                                      const Quantum rvalue_) MAGICK_FUNC_DEPRECATED;\n    void            quantumOperator ( const int x_,const int y_,\n                                      const unsigned int columns_,\n                                      const unsigned int rows_,\n                                      const ChannelType channel_,\n                                      const QuantumOperator operator_,\n                                      const double rvalue_);\n\n    // Execute a named process module using an argc/argv syntax similar to\n    // that accepted by a C 'main' routine. An exception is thrown if the\n    // requested process module doesn't exist, fails to load, or fails during\n    // execution.\n    void            process ( std::string name_,\n                              const int argc_,\n                              char **argv_ );\n\n    // Raise image (lighten or darken the edges of an image to give a\n    // 3-D raised or lowered effect)\n    void            raise ( const Geometry &geometry_ = raiseGeometryDefault,\n                            const bool raisedFlag_ = false );\n\n    // Random threshold image.\n    //\n    // Changes the value of individual pixels based on the intensity\n    // of each pixel compared to a random threshold.  The result is a\n    // low-contrast, two color image.  The thresholds_ argument is a\n    // geometry containing LOWxHIGH thresholds.  If the string\n    // contains 2x2, 3x3, or 4x4, then an ordered dither of order 2,\n    // 3, or 4 will be performed instead.  If a channel_ argument is\n    // specified then only the specified channel is altered.  This is\n    // a very fast alternative to 'quantize' based dithering.\n    void            randomThreshold( const Geometry &thresholds_ );\n    void            randomThresholdChannel( const Geometry &thresholds_,\n                                            const ChannelType channel_ );\n\n    // Read single image frame into current object\n    void            read ( const std::string &imageSpec_ );\n\n    // Read single image frame of specified size into current object\n    void            read ( const Geometry &size_,\n                           const std::string &imageSpec_ );\n\n    // Read single image frame from in-memory BLOB\n    void            read ( const Blob        &blob_ );\n\n    // Read single image frame of specified size from in-memory BLOB\n    void            read ( const Blob        &blob_,\n                           const Geometry    &size_ );\n\n    // Read single image frame of specified size and depth from\n    // in-memory BLOB\n    void            read ( const Blob         &blob_,\n                           const Geometry     &size_,\n                           const unsigned int depth_ );\n\n    // Read single image frame of specified size, depth, and format\n    // from in-memory BLOB\n    void            read ( const Blob         &blob_,\n                           const Geometry     &size_,\n                           const unsigned int depth_,\n                           const std::string  &magick_ );\n\n    // Read single image frame of specified size, and format from\n    // in-memory BLOB\n    void            read ( const Blob         &blob_,\n                           const Geometry     &size_,\n                           const std::string  &magick_ );\n\n    // Read single image frame from an array of raw pixels, with\n    // specified storage type (ConstituteImage), e.g.\n    //    image.read( 640, 480, \"RGB\", 0, pixels );\n    void            read ( const unsigned int width_,\n                           const unsigned int height_,\n                           const std::string &map_,\n                           const StorageType  type_,\n                           const void        *pixels_ );\n\n    // Reduce noise in image using a noise peak elimination filter\n    void            reduceNoise ( void );\n    void            reduceNoise ( const double order_ );\n\n    // Resets the image page canvas and position.\n    void            repage();\n\n    // Resize image, specifying geometry, filter, and blur\n    void            resize ( const Geometry &geometry_,\n                             const FilterTypes filterType_,\n                             const double blur_ );\n\n    // Resize image, specifying geometry and filter, with blur using\n    // Image default.\n    void            resize ( const Geometry &geometry_,\n                             const FilterTypes filterType_ );\n\n    // Resize image, specifying only geometry, with filter and blur\n    // obtained from Image default.  Same result as 'zoom' method.\n    void            resize ( const Geometry &geometry_ );\n\n    // Roll image (rolls image vertically and horizontally) by specified\n    // number of columnms and rows)\n    void            roll ( const Geometry &roll_ );\n    void            roll ( const unsigned int columns_,\n                           const unsigned int rows_ );\n\n    // Rotate image counter-clockwise by specified number of degrees.\n    void            rotate ( const double degrees_ );\n\n    // Resize image by using pixel sampling algorithm\n    void            sample ( const Geometry &geometry_ );\n\n    // Resize image by using simple ratio algorithm\n    void            scale ( const Geometry &geometry_ );\n\n    // Resize image using several algorithms to make smaller images\n    // very quickly.\n    void            thumbnail ( const Geometry &geometry_ );\n\n    // Segment (coalesce similar image components) by analyzing the\n    // histograms of the color components and identifying units that\n    // are homogeneous with the fuzzy c-means technique.  Also uses\n    // QuantizeColorSpace and Verbose image attributes\n    void            segment ( const double clusterThreshold_ = 1.0,\n                              const double smoothingThreshold_ = 1.5 );\n\n    // Shade image using distant light source\n    void            shade ( const double azimuth_ = 30,\n                            const double elevation_ = 30,\n                            const bool   colorShading_ = false );\n\n    // Sharpen pixels in image\n    // The radius_ parameter specifies the radius of the Gaussian, in\n    // pixels, not counting the center pixel.  The sigma_ parameter\n    // specifies the standard deviation of the Laplacian, in pixels.\n    void            sharpen ( const double radius_ = 0.0,\n                              const double sigma_ = 1.0 );\n    void            sharpenChannel ( const ChannelType channel_,\n                                     const double radius_ = 0.0,\n                                     const double sigma_ = 1.0 );\n\n    // Shave pixels from image edges.\n    void            shave ( const Geometry &geometry_ );\n\n    // Shear image (create parallelogram by sliding image by X or Y axis)\n    void            shear ( const double xShearAngle_,\n                            const double yShearAngle_ );\n\n    // Solarize image (similar to effect seen when exposing a\n    // photographic film to light during the development process)\n    void            solarize ( const double factor_ = 50.0 );\n\n    // Spread pixels randomly within image by specified ammount\n    void            spread ( const unsigned int amount_ = 3 );\n\n    // Add a digital watermark to the image (based on second image)\n    void            stegano ( const Image &watermark_ );\n\n    // Create an image which appears in stereo when viewed with\n    // red-blue glasses (Red image on left, blue on right)\n    void            stereo ( const Image &rightImage_ );\n\n    // Remove all profiles and text attributes from the image.\n    void            strip ( void );\n\n    // Swirl image (image pixels are rotated by degrees)\n    void            swirl ( const double degrees_ );\n\n    // Channel a texture on image background\n    void            texture ( const Image &texture_ );\n\n    // Threshold image channels (below threshold becomes black, above\n    // threshold becomes white).\n    // The range of the threshold parameter is 0 to MaxRGB.\n    void            threshold ( const double threshold_ );\n\n    // Transform image based on image and crop geometries\n    // Crop geometry is optional\n    void            transform ( const Geometry &imageGeometry_ );\n    void            transform ( const Geometry &imageGeometry_,\n                                const Geometry &cropGeometry_  );\n\n    // Add matte image to image, setting pixels matching color to\n    // transparent\n    void            transparent ( const Color &color_ );\n\n    // Trim edges that are the background color from the image\n    void            trim ( void );\n\n    // Image representation type (also see type attribute)\n    //   Available types:\n    //    Bilevel        Grayscale       GrayscaleMatte\n    //    Palette        PaletteMatte    TrueColor\n    //    TrueColorMatte ColorSeparation ColorSeparationMatte\n    void            type ( const ImageType type_ );\n\n    // Replace image with a sharpened version of the original image\n    // using the unsharp mask algorithm.\n    //  radius_\n    //    the radius of the Gaussian, in pixels, not counting the\n    //    center pixel.\n    //  sigma_\n    //    the standard deviation of the Gaussian, in pixels.\n    //  amount_\n    //    the percentage of the difference between the original and\n    //    the blur image that is added back into the original.\n    // threshold_\n    //   the threshold in pixels needed to apply the diffence amount.\n    void            unsharpmask ( const double radius_,\n                                  const double sigma_,\n                                  const double amount_,\n                                  const double threshold_ );\n    void            unsharpmaskChannel ( const ChannelType channel_,\n                                         const double radius_,\n                                         const double sigma_,\n                                         const double amount_,\n                                         const double threshold_ );\n\n    // Map image pixels to a sine wave\n    void            wave ( const double amplitude_ = 25.0,\n                           const double wavelength_ = 150.0 );\n\n    // Write single image frame to a file\n    void            write ( const std::string &imageSpec_ );\n\n    // Write single image frame to in-memory BLOB, with optional\n    // format and adjoin parameters.\n    void            write ( Blob *blob_ );\n    void            write ( Blob *blob_,\n                            const std::string &magick_ );\n    void            write ( Blob *blob_,\n                            const std::string &magick_,\n                            const unsigned int depth_ );\n\n    // Write single image frame to an array of pixels with storage\n    // type specified by user (DispatchImage), e.g.\n    //   image.write( 0, 0, 640, 1, \"RGB\", 0, pixels );\n    void            write ( const int x_,\n                            const int y_,\n                            const unsigned int columns_,\n                            const unsigned int rows_,\n                            const std::string& map_,\n                            const StorageType type_,\n                            void *pixels_ );\n\n    // Zoom image to specified size.\n    void            zoom ( const Geometry &geometry_ );\n\n    //////////////////////////////////////////////////////////////////////\n    //\n    // Image Attributes and Options\n    //\n    //////////////////////////////////////////////////////////////////////\n\n    // Join images into a single multi-image file\n    void            adjoin ( const bool flag_ );\n    bool            adjoin ( void ) const;\n\n    // Anti-alias Postscript and TrueType fonts (default true)\n    void            antiAlias( const bool flag_ );\n    bool            antiAlias( void );\n\n    // Time in 1/100ths of a second which must expire before\n    // displaying the next image in an animated sequence.\n    void            animationDelay ( const unsigned int delay_ );\n    unsigned int    animationDelay ( void ) const;\n\n    // Number of iterations to loop an animation (e.g. Netscape loop\n    // extension) for.\n    void            animationIterations ( const unsigned int iterations_ );\n    unsigned int    animationIterations ( void ) const;\n\n    // Access/Update a named image text attribute.  Updates append the\n    // provided to any existing attribute text.  Pass NULL as the\n    // value to remove an existing value or before a subsequent call\n    // to add new text.\n    void            attribute ( const std::string name_,\n                                const char * value_ );\n    void            attribute ( const std::string name_,\n                                const std::string value_ );\n    std::string     attribute ( const std::string name_ );\n\n    // Image background color\n    void            backgroundColor ( const Color &color_ );\n    Color           backgroundColor ( void ) const;\n\n    // Name of texture image to tile onto the image background\n    void            backgroundTexture (const std::string &backgroundTexture_ );\n    std::string     backgroundTexture ( void ) const;\n\n    // Base image width (before transformations)\n    unsigned int    baseColumns ( void ) const;\n\n    // Base image filename (before transformations)\n    std::string     baseFilename ( void ) const;\n\n    // Base image height (before transformations)\n    unsigned int    baseRows ( void ) const;\n\n    // Image border color\n    void            borderColor ( const Color &color_ );\n    Color           borderColor ( void ) const;\n\n    // Return smallest bounding box enclosing non-border pixels. The\n    // current fuzz value is used when discriminating between pixels.\n    // This is the crop bounding box used by crop(Geometry(0,0));\n    Geometry        boundingBox ( void ) const;\n\n    // Text bounding-box base color (default none)\n    void            boxColor ( const Color &boxColor_ );\n    Color           boxColor ( void ) const;\n\n    // Pixel cache threshold in megabytes.  Once this memory threshold\n    // is exceeded, all subsequent pixels cache operations are to/from\n    // disk.  This setting is shared by all Image objects.\n    static void     cacheThreshold ( const unsigned int threshold_ );\n\n    // Chromaticity blue primary point (e.g. x=0.15, y=0.06)\n    void            chromaBluePrimary ( const double x_, const double y_ );\n    void            chromaBluePrimary ( double *x_, double *y_ ) const;\n\n    // Chromaticity green primary point (e.g. x=0.3, y=0.6)\n    void            chromaGreenPrimary ( const double x_, const double y_ );\n    void            chromaGreenPrimary ( double *x_, double *y_ ) const;\n\n    // Chromaticity red primary point (e.g. x=0.64, y=0.33)\n    void            chromaRedPrimary ( const double x_, const double y_ );\n    void            chromaRedPrimary ( double *x_, double *y_ ) const;\n\n    // Chromaticity white point (e.g. x=0.3127, y=0.329)\n    void            chromaWhitePoint ( const double x_, const double y_ );\n    void            chromaWhitePoint ( double *x_, double *y_ ) const;\n\n    // Image class (DirectClass or PseudoClass)\n    // NOTE: setting a DirectClass image to PseudoClass will result in\n    // the loss of color information if the number of colors in the\n    // image is greater than the maximum palette size (either 256 or\n    // 65536 entries depending on the value of QuantumDepth when\n    // ImageMagick was built).\n    void            classType ( const ClassType class_ );\n    ClassType       classType ( void ) const;\n\n    // Associate a clip mask with the image. The clip mask must be the\n    // same dimensions as the image. Pass an invalid image to unset an\n    // existing clip mask.\n    void            clipMask ( const Image & clipMask_ );\n    Image           clipMask ( void  ) const;\n\n    // Colors within this distance are considered equal\n    void            colorFuzz ( const double fuzz_ );\n    double          colorFuzz ( void ) const;\n\n    // Color at colormap position index_\n    void            colorMap ( const unsigned int index_,\n                               const Color &color_ );\n    Color           colorMap ( const unsigned int index_ ) const;\n\n    // Colormap size (number of colormap entries)\n    void            colorMapSize ( const unsigned int entries_ );\n    unsigned int    colorMapSize ( void );\n\n    // Image Color Space\n    void            colorSpace( const ColorspaceType colorSpace_ );\n    ColorspaceType  colorSpace ( void ) const;\n\n    // Image width\n    unsigned int    columns ( void ) const;\n\n    // Image comment\n    std::string     comment ( void ) const;\n\n    // Composition operator to be used when composition is implicitly\n    // used (such as for image flattening).\n    void            compose (const CompositeOperator compose_);\n    CompositeOperator compose ( void ) const;\n\n    // Compression type\n    void            compressType ( const CompressionType compressType_ );\n    CompressionType compressType ( void ) const;\n\n    // Enable printing of debug messages from ImageMagick\n    void            debug ( const bool flag_ );\n    bool            debug ( void ) const;\n\n    // Tagged image format define (set/access coder-specific option) The\n    // magick_ option specifies the coder the define applies to.  The key_\n    // option provides the key specific to that coder.  The value_ option\n    // provides the value to set (if any). See the defineSet() method if the\n    // key must be removed entirely.\n    void            defineValue ( const std::string &magick_,\n                                  const std::string &key_,\n                                  const std::string &value_ );\n    std::string     defineValue ( const std::string &magick_,\n                                  const std::string &key_ ) const;\n\n    // Tagged image format define. Similar to the defineValue() method\n    // except that passing the flag_ value 'true' creates a value-less\n    // define with that format and key. Passing the flag_ value 'false'\n    // removes any existing matching definition. The method returns 'true'\n    // if a matching key exists, and 'false' if no matching key exists.\n    void            defineSet ( const std::string &magick_,\n                                const std::string &key_,\n                                bool flag_ );\n    bool            defineSet ( const std::string &magick_,\n                                const std::string &key_ ) const;\n\n    // Vertical and horizontal resolution in pixels of the image\n    //\n    // The resolution is expressed in resolution units as supported by\n    // the resolutionUnits() method.\n    //\n    // Please note that the underlying resolution is floating point\n    // and use of this method will result in rounding floating point\n    // value to integer vaues.  Use the xResolution() and\n    // yResolution() methods when full accuracy is required.\n    void            density ( const Geometry &geomery_ );\n    Geometry        density ( void ) const;\n\n    // Image depth (bits allocated to red/green/blue components)\n    void            depth ( const unsigned int depth_ );\n    unsigned int    depth ( void ) const;\n\n    // Tile names from within an image montage\n    std::string     directory ( void ) const;\n\n    // Endianness (little like Intel or big like SPARC) for image\n    // formats which support endian-specific options.\n    void            endian ( const EndianType endian_ );\n    EndianType      endian ( void ) const;\n\n    // Image file name\n    void            fileName ( const std::string &fileName_ );\n    std::string     fileName ( void ) const;\n\n    // Number of bytes of the image on disk\n    off_t          fileSize ( void ) const;\n\n    // Color to use when filling drawn objects\n    void            fillColor ( const Color &fillColor_ );\n    Color           fillColor ( void ) const;\n\n    // Rule to use when filling drawn objects\n    void            fillRule ( const FillRule &fillRule_ );\n    FillRule        fillRule ( void ) const;\n\n    // Pattern to use while filling drawn objects.\n    void            fillPattern ( const Image &fillPattern_ );\n    Image           fillPattern ( void  ) const;\n\n    // Filter to use when resizing image using 'zoom' or 'resize'.\n    void            filterType ( const FilterTypes filterType_ );\n    FilterTypes     filterType ( void ) const;\n\n    // Text rendering font\n    void            font ( const std::string &font_ );\n    std::string     font ( void ) const;\n\n    // Font point size\n    void            fontPointsize ( const double pointSize_ );\n    double          fontPointsize ( void ) const;\n\n    // Obtain font metrics for text string given current font,\n    // pointsize, and density settings.\n    void            fontTypeMetrics( const std::string &text_,\n                                     TypeMetric *metrics );\n\n    // Long image format description\n    std::string     format ( void ) const;\n\n    // Format the specified expression similar to command line '-format'.\n    // For example \"%wx%h\" is converted to a string containing image\n    // WIDTHxHEIGHT like \"640x480\".\n    std::string     formatExpression( const std::string expression );\n\n    // Gamma level of the image\n    double          gamma ( void ) const;\n\n    // Preferred size of the image when encoding\n    Geometry        geometry ( void ) const;\n\n    // GIF disposal method\n    void            gifDisposeMethod ( const unsigned int disposeMethod_ );\n    unsigned int    gifDisposeMethod ( void ) const;\n\n    // ICC color profile (BLOB)\n    void            iccColorProfile( const Blob &colorProfile_ );\n    Blob            iccColorProfile( void ) const;\n\n    // Type of interlacing to use\n    void            interlaceType ( const InterlaceType interlace_ );\n    InterlaceType   interlaceType ( void ) const;\n\n    // IPTC profile (BLOB)\n    void            iptcProfile( const Blob& iptcProfile_ );\n    Blob            iptcProfile( void ) const;\n\n    // Does object contain valid image?\n    void            isValid ( const bool isValid_ );\n    bool            isValid ( void ) const;\n\n    // Image label\n    std::string     label ( void ) const;\n\n    // Stroke width for drawing vector objects (default one)\n    // This method is now deprecated. Please use strokeWidth instead.\n    void            lineWidth ( const double lineWidth_ );\n    double          lineWidth ( void ) const;\n\n    // File type magick identifier (.e.g \"GIF\")\n    void            magick ( const std::string &magick_ );\n    std::string     magick ( void ) const;\n\n    // Image supports transparency (matte channel)\n    void            matte ( const bool matteFlag_ );\n    bool            matte ( void ) const;\n\n    // Transparent color\n    void            matteColor ( const Color &matteColor_ );\n    Color           matteColor ( void ) const;\n\n    // The mean error per pixel computed when an image is color reduced\n    double          meanErrorPerPixel ( void ) const;\n\n    // Image modulus depth (minimum number of bits required to support\n    // red/green/blue components without loss of accuracy)\n    void            modulusDepth ( const unsigned int modulusDepth_ );\n    unsigned int    modulusDepth ( void ) const;\n\n    // Tile size and offset within an image montage\n    Geometry        montageGeometry ( void ) const;\n\n    // Transform image to black and white\n    void            monochrome ( const bool monochromeFlag_ );\n    bool            monochrome ( void ) const;\n\n    // The normalized max error per pixel computed when an image is\n    // color reduced.\n    double          normalizedMaxError ( void ) const;\n\n    // The normalized mean error per pixel computed when an image is\n    // color reduced.\n    double          normalizedMeanError ( void ) const;\n\n    // Image orientation\n    void            orientation ( const OrientationType orientation_ );\n    OrientationType orientation ( void ) const;\n\n    // Preferred size and location of an image canvas.\n    void            page ( const Geometry &pageSize_ );\n    Geometry        page ( void ) const;\n\n    // Pen color (deprecated, don't use any more)\n    void            penColor ( const Color &penColor_ );\n    Color           penColor ( void  ) const;\n\n    // Pen texture image (deprecated, don't use any more)\n    void            penTexture ( const Image &penTexture_ );\n    Image           penTexture ( void  ) const;\n\n    // Get/set pixel color at location x & y.\n    void            pixelColor ( const unsigned int x_,\n                                 const unsigned int y_,\n                                 const Color &color_ );\n    Color           pixelColor ( const unsigned int x_,\n                                 const unsigned int y_ ) const;\n\n    // Add or remove a named profile to/from the image. Remove the\n    // profile by passing an empty Blob (e.g. Blob()). Valid names are\n    // \"*\", \"8BIM\", \"ICM\", \"IPTC\", or a user/format-defined profile name.\n    void            profile( const std::string name_,\n                             const Blob &colorProfile_ );\n\n    // Retrieve a named profile from the image. Valid names are:\n    // \"8BIM\", \"8BIMTEXT\", \"APP1\", \"APP1JPEG\", \"ICC\", \"ICM\", & \"IPTC\"\n    // or an existing user/format-defined profile name.\n    Blob            profile( const std::string name_ ) const;\n\n    // JPEG/MIFF/PNG compression level (default 75).\n    void            quality ( const unsigned int quality_ );\n    unsigned int    quality ( void ) const;\n\n    // Maximum number of colors to quantize to\n    void            quantizeColors ( const unsigned int colors_ );\n    unsigned int    quantizeColors ( void ) const;\n\n    // Colorspace to quantize in.\n    void            quantizeColorSpace ( const ColorspaceType colorSpace_ );\n    ColorspaceType  quantizeColorSpace ( void ) const;\n\n    // Dither image during quantization (default true).\n    void            quantizeDither ( const bool ditherFlag_ );\n    bool            quantizeDither ( void ) const;\n\n    // Quantization tree-depth\n    void            quantizeTreeDepth ( const unsigned int treeDepth_ );\n    unsigned int    quantizeTreeDepth ( void ) const;\n\n    // Suppress all warning messages. Error messages are still reported.\n    void            quiet ( const bool quiet_ );\n    bool            quiet ( void ) const;\n\n    // The type of rendering intent\n    void            renderingIntent ( const RenderingIntent renderingIntent_ );\n    RenderingIntent renderingIntent ( void ) const;\n\n    // Units of image resolution\n    void            resolutionUnits ( const ResolutionType resolutionUnits_ );\n    ResolutionType  resolutionUnits ( void ) const;\n\n    // The number of pixel rows in the image\n    unsigned int    rows ( void ) const;\n\n    // Image scene number\n    void            scene ( const unsigned int scene_ );\n    unsigned int    scene ( void ) const;\n\n    // Image signature.  Set force_ to true in order to re-calculate\n    // the signature regardless of whether the image data has been\n    // modified.\n    std::string     signature ( const bool force_ = false ) const;\n\n    // Width and height of a raw image\n    void            size ( const Geometry &geometry_ );\n    Geometry        size ( void ) const;\n\n    // Obtain image statistics. Statistics are normalized to the range\n    // of 0.0 to 1.0 and are output to the specified ImageStatistics\n    // structure.\n    void            statistics ( ImageStatistics *statistics ) const;\n\n    // enabled/disable stroke anti-aliasing\n    void            strokeAntiAlias( const bool flag_ );\n    bool            strokeAntiAlias( void ) const;\n\n    // Color to use when drawing object outlines\n    void            strokeColor ( const Color &strokeColor_ );\n    Color           strokeColor ( void ) const;\n\n    // Specify the pattern of dashes and gaps used to stroke\n    // paths. The strokeDashArray represents a zero-terminated array\n    // of numbers that specify the lengths of alternating dashes and\n    // gaps in pixels. If an odd number of values is provided, then\n    // the list of values is repeated to yield an even number of\n    // values.  A typical strokeDashArray_ array might contain the\n    // members 5 3 2 0, where the zero value indicates the end of the\n    // pattern array.\n    void            strokeDashArray ( const double* strokeDashArray_ );\n    const double*   strokeDashArray ( void ) const;\n\n    // While drawing using a dash pattern, specify distance into the\n    // dash pattern to start the dash (default 0).\n    void            strokeDashOffset ( const double strokeDashOffset_ );\n    double          strokeDashOffset ( void ) const;\n\n    // Specify the shape to be used at the end of open subpaths when\n    // they are stroked. Values of LineCap are UndefinedCap, ButtCap,\n    // RoundCap, and SquareCap.\n    void            strokeLineCap ( const LineCap lineCap_ );\n    LineCap         strokeLineCap ( void ) const;\n\n    // Specify the shape to be used at the corners of paths (or other\n    // vector shapes) when they are stroked. Values of LineJoin are\n    // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.\n    void            strokeLineJoin ( const LineJoin lineJoin_ );\n    LineJoin        strokeLineJoin ( void ) const;\n\n    // Specify miter limit. When two line segments meet at a sharp\n    // angle and miter joins have been specified for 'lineJoin', it is\n    // possible for the miter to extend far beyond the thickness of\n    // the line stroking the path. The miterLimit' imposes a limit on\n    // the ratio of the miter length to the 'lineWidth'. The default\n    // value of this parameter is 4.\n    void            strokeMiterLimit ( const unsigned int miterLimit_ );\n    unsigned int    strokeMiterLimit ( void ) const;\n\n    // Pattern image to use while stroking object outlines.\n    void            strokePattern ( const Image &strokePattern_ );\n    Image           strokePattern ( void  ) const;\n\n    // Stroke width for drawing vector objects (default one)\n    void            strokeWidth ( const double strokeWidth_ );\n    double          strokeWidth ( void ) const;\n\n    // Subimage of an image sequence\n    void            subImage ( const unsigned int subImage_ );\n    unsigned int    subImage ( void ) const;\n\n    // Number of images relative to the base image\n    void            subRange ( const unsigned int subRange_ );\n    unsigned int    subRange ( void ) const;\n\n    // Annotation text encoding (e.g. \"UTF-16\")\n    void            textEncoding ( const std::string &encoding_ );\n    std::string     textEncoding ( void ) const;\n\n    // Tile name\n    void            tileName ( const std::string &tileName_ );\n    std::string     tileName ( void ) const;\n\n    // Number of colors in the image\n    unsigned long   totalColors ( void );\n\n    // Origin of coordinate system to use when annotating with text or drawing\n    void            transformOrigin ( const double x_,const  double y_ );\n\n    // Rotation to use when annotating with text or drawing\n    void            transformRotation ( const double angle_ );\n\n    // Reset transformation parameters to default\n    void            transformReset ( void );\n\n    // Scale to use when annotating with text or drawing\n    void            transformScale ( const double sx_, const double sy_ );\n\n    // Skew to use in X axis when annotating with text or drawing\n    void            transformSkewX ( const double skewx_ );\n\n    // Skew to use in Y axis when annotating with text or drawing\n    void            transformSkewY ( const double skewy_ );\n\n    // Image representation type (also see type operation)\n    //   Available types:\n    //    Bilevel        Grayscale       GrayscaleMatte\n    //    Palette        PaletteMatte    TrueColor\n    //    TrueColorMatte ColorSeparation ColorSeparationMatte\n    ImageType       type ( void ) const;\n\n    // Print detailed information about the image\n    void            verbose ( const bool verboseFlag_ );\n    bool            verbose ( void ) const;\n\n    // FlashPix viewing parameters\n    void            view ( const std::string &view_ );\n    std::string     view ( void ) const;\n\n    // X11 display to display to, obtain fonts from, or to capture\n    // image from\n    void            x11Display ( const std::string &display_ );\n    std::string     x11Display ( void ) const;\n\n    // x resolution of the image\n    void            xResolution ( const double x_resolution );\n    double          xResolution ( void ) const;\n\n    // y resolution of the image\n    void            yResolution ( const double y_resolution );\n    double          yResolution ( void ) const;\n\n    //////////////////////////////////////////////////////////////////////\n    //\n    // Low-level Pixel Access Routines\n    //\n    // Also see the Pixels class, which provides support for multiple\n    // cache views.\n    //\n    //////////////////////////////////////////////////////////////////////\n\n\n    // Transfers read-only pixels from the image to the pixel cache as\n    // defined by the specified region\n    const PixelPacket* getConstPixels ( const int x_, const int y_,\n                                        const unsigned int columns_,\n                                        const unsigned int rows_ ) const;\n\n    // Obtain mutable image pixel indexes (valid for PseudoClass images)\n    IndexPacket* getIndexes ( void );\n\n    // Obtain immutable image pixel indexes (valid for PseudoClass images)\n    const IndexPacket* getConstIndexes ( void ) const;\n\n    // Transfers pixels from the image to the pixel cache as defined\n    // by the specified region. Modified pixels may be subsequently\n    // transferred back to the image via syncPixels.  This method is\n    // valid for DirectClass images.\n    PixelPacket* getPixels ( const int x_, const int y_,\n                             const unsigned int columns_,\n                             const unsigned int rows_ );\n\n    // Allocates a pixel cache region to store image pixels as defined\n    // by the region rectangle.  This area is subsequently transferred\n    // from the pixel cache to the image via syncPixels.\n    PixelPacket* setPixels ( const int x_, const int y_,\n                             const unsigned int columns_,\n                             const unsigned int rows_ );\n\n    // Transfers the image cache pixels to the image.\n    void syncPixels ( void );\n\n    // Transfers one or more pixel components from a buffer or file\n    // into the image pixel cache of an image.\n    // Used to support image decoders.\n    void readPixels ( const QuantumType quantum_,\n                      const unsigned char *source_ );\n\n    // Transfers one or more pixel components from the image pixel\n    // cache to a buffer or file.\n    // Used to support image encoders.\n    void writePixels ( const QuantumType quantum_,\n                       unsigned char *destination_ );\n\n    //////////////////////////////////////////////////////////////////////\n    //\n    // No user-serviceable parts beyond this point\n    //\n    //////////////////////////////////////////////////////////////////////\n\n\n    // Construct with MagickLib::Image and default options\n    Image ( MagickLib::Image* image_ );\n\n    // Retrieve Image*\n    MagickLib::Image*& image( void );\n    const MagickLib::Image* constImage( void ) const;\n\n    // Retrieve Options*\n    Options* options( void );\n    const Options*  constOptions( void ) const;\n\n    // Retrieve ImageInfo*\n    MagickLib::ImageInfo * imageInfo( void );\n    const MagickLib::ImageInfo * constImageInfo( void ) const;\n\n    // Retrieve QuantizeInfo*\n    MagickLib::QuantizeInfo * quantizeInfo( void );\n    const MagickLib::QuantizeInfo * constQuantizeInfo( void ) const;\n\n    // Replace current image (reference counted)\n    MagickLib::Image* replaceImage ( MagickLib::Image* replacement_ );\n\n    // Prepare to update image (copy if reference > 1)\n    void            modifyImage ( void );\n\n    // Test for ImageMagick error and throw exception if error\n    void            throwImageException( void ) const;\n\n    // Register image with image registry or obtain registration id\n    long            registerId( void );\n\n    // Unregister image from image registry\n    void            unregisterId( void) ;\n\n  private:\n\n    void            throwImageException( MagickLib::ExceptionInfo &exception_ ) const;\n\n    ImageRef *      _imgRef;\n  };\n\n} // end of namespace Magick\n\n//\n// Inlines\n//\n\n\n//\n// Image\n//\n\n\n// Reduce noise in image using a noise peak elimination filter\ninline void Magick::Image::reduceNoise ( void )\n{\n  reduceNoise( 3.0 );\n}\n\n// Stroke width for drawing vector objects (default one)\ninline void Magick::Image::lineWidth ( const double lineWidth_ )\n{\n  strokeWidth( lineWidth_ );\n}\ninline double Magick::Image::lineWidth ( void ) const\n{\n  return strokeWidth( );\n}\n\n// Get image storage class\ninline Magick::ClassType Magick::Image::classType ( void ) const\n{\n  return static_cast<Magick::ClassType>(constImage()->storage_class);\n}\n\n// Get number of image columns\ninline unsigned int Magick::Image::columns ( void ) const\n{\n  return constImage()->columns;\n}\n\n// Get number of image rows\ninline unsigned int Magick::Image::rows ( void ) const\n{\n  return constImage()->rows;\n}\n\n#endif // Magick_Image_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/Include.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2018\n//\n// Inclusion of GraphicsMagick headers (with namespace magic)\n\n#ifndef Magick_Include_header\n#define Magick_Include_header\n\n#if !defined(_MAGICK_CONFIG_H)\n# define _MAGICK_CONFIG_H\n# if !defined(vms) && !defined(macintosh)\n#  include \"magick/magick_config.h\"\n# else\n#  include \"magick_config.h\"\n# endif\n# undef inline // Remove possible definition from config.h\n# undef class\n#endif\n\n#include <stdio.h>\n#include <stdarg.h>\n#include <stdlib.h>\n#include <time.h>\n#include <sys/types.h> /* POSIX 1990 header and declares size_t and ssize_t */\n\n#if defined(__BORLANDC__)\n# include <vcl.h> /* Borland C++ Builder 4.0 requirement */\n#endif // defined(__BORLANDC__)\n\n//\n// Include GraphicsMagick headers into namespace \"MagickLib\". If\n// MAGICK_IMPLEMENTATION is defined, include GraphicsMagick development\n// headers.  This scheme minimizes the possibility of conflict with\n// user code.\n//\nnamespace MagickLib\n{\n#include <magick/api.h>\n#undef inline // Remove possible definition from config.h\n\n#undef class\n}\n\n//\n// Provide appropriate DLL imports/exports for Visual C++,\n// Borland C++Builder and MinGW builds.\n//\n#if (defined(WIN32) || defined(WIN64)) && !defined (__CYGWIN__) //&& !defined(__MINGW32__)\n# define MagickCplusPlusDLLSupported\n#endif\n#if defined(MagickCplusPlusDLLSupported)\n#  if defined(_MT) && defined(_DLL) && !defined(_LIB) && !defined(STATIC_MAGICK)\n//\n// In a native Windows build, the following defines are used:\n//\n//   _MT         = Multithreaded\n//   _DLL        = Using code is part of a DLL\n//   _LIB        = Using code is being built as a library.\n//   _MAGICKMOD_ = Build uses loadable modules (Magick++ does not care about this)\n//\n// In the case where GraphicsMagick is built as a static library but the\n// using code is dynamic, STATIC_MAGICK may be defined in the project to\n// override triggering dynamic library behavior.\n//\n#    if defined(_VISUALC_)\n#      define MagickDLLExplicitTemplate     /* Explicit template instantiation in DLLs */\n#      pragma warning( disable: 4273 )      /* Disable the stupid dll linkage warnings */\n#      pragma warning( disable: 4251 )\n#    endif\n#    if !defined(MAGICK_IMPLEMENTATION)\n#      define MagickDLLDecl __declspec(dllimport)\n#      define MagickDLLDeclExtern extern __declspec(dllimport)\n#      if defined(_VISUALC_)\n#        pragma message( \"Magick++ lib DLL import\" )\n#      endif\n#    else\n#      if defined(__BORLANDC__) || defined(__MINGW32__)\n#        define MagickDLLDecl __declspec(dllexport)\n#        define MagickDLLDeclExtern __declspec(dllexport)\n#        if defined(__BORLANDC__)\n#          pragma message( \"BCBMagick++ lib DLL export\" )\n#        endif\n#      else\n#        define MagickDLLDecl __declspec(dllexport)\n#        define MagickDLLDeclExtern extern __declspec(dllexport)\n#      endif\n#      if defined(_VISUALC_)\n#        pragma message( \"Magick++ lib DLL export\" )\n#      endif\n#    endif\n#  else\n#    define MagickDLLDecl\n#    define MagickDLLDeclExtern\n#    if defined(_VISUALC_)\n#      pragma message( \"Magick++ lib static interface\" )\n#    endif\n#    if defined(_MSC_VER) && defined(STATIC_MAGICK) && !defined(NOAUTOLINK_MAGICK)\n#      if defined(_DEBUG)\n#        if defined(HasBZLIB)\n#          pragma comment(lib, \"CORE_DB_bzlib_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_DB_coders_.lib\")\n#        pragma comment(lib, \"CORE_DB_filters_.lib\")\n#        if defined(HasJBIG)\n#          pragma comment(lib, \"CORE_DB_jbig_.lib\")\n#        endif\n#        if defined(HasJP2)\n#          pragma comment(lib, \"CORE_DB_jp2_.lib\")\n#        endif\n#        if defined(HasJPEG)\n#          pragma comment(lib, \"CORE_DB_jpeg_.lib\")\n#        endif\n#        if defined(HasLCMS)\n#          pragma comment(lib, \"CORE_DB_lcms_.lib\")\n#        endif\n#        if defined(HasXML)\n#          pragma comment(lib, \"CORE_DB_libxml_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_DB_magick_.lib\")\n#        pragma comment(lib, \"CORE_DB_Magick++_.lib\")\n#        if defined(HasPNG)\n#          pragma comment(lib, \"CORE_DB_png_.lib\")\n#        endif\n#        if defined(HasTIFF)\n#          pragma comment(lib, \"CORE_DB_tiff_.lib\")\n#        endif\n#        if defined(HasTTF)\n#          pragma comment(lib, \"CORE_DB_ttf_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_DB_wand_.lib\")\n#        if defined(HasWEBP)\n#          pragma comment(lib, \"CORE_DB_webp_.lib\")\n#        endif\n#        if defined(HasWMFlite)\n#          pragma comment(lib, \"CORE_DB_wmf_.lib\")\n#        endif\n#        if defined(HasX11)\n#          pragma comment(lib, \"CORE_DB_xlib_.lib\")\n#        endif\n#        if defined(HasZLIB)\n#          pragma comment(lib, \"CORE_DB_zlib_.lib\")\n#        endif\n#      else\n#        if defined(HasBZLIB)\n#          pragma comment(lib, \"CORE_RL_bzlib_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_RL_coders_.lib\")\n#        pragma comment(lib, \"CORE_RL_filters_.lib\")\n#        if defined(HasJBIG)\n#          pragma comment(lib, \"CORE_RL_jbig_.lib\")\n#        endif\n#        if defined(HasJP2)\n#          pragma comment(lib, \"CORE_RL_jp2_.lib\")\n#        endif\n#        if defined(HasJPEG)\n#          pragma comment(lib, \"CORE_RL_jpeg_.lib\")\n#        endif\n#        if defined(HasLCMS)\n#          pragma comment(lib, \"CORE_RL_lcms_.lib\")\n#        endif\n#        if defined(HasXML)\n#          pragma comment(lib, \"CORE_RL_libxml_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_RL_magick_.lib\")\n#        pragma comment(lib, \"CORE_RL_Magick++_.lib\")\n#        if defined(HasPNG)\n#          pragma comment(lib, \"CORE_RL_png_.lib\")\n#        endif\n#        if defined(HasTIFF)\n#          pragma comment(lib, \"CORE_RL_tiff_.lib\")\n#        endif\n#        if defined(HasTTF)\n#          pragma comment(lib, \"CORE_RL_ttf_.lib\")\n#        endif\n#        pragma comment(lib, \"CORE_RL_wand_.lib\")\n#        if defined(HasWEBP)\n#          pragma comment(lib, \"CORE_RL_webp_.lib\")\n#        endif\n#        if defined(HasWMFlite)\n#          pragma comment(lib, \"CORE_RL_wmf_.lib\")\n#        endif\n#        if defined(HasX11)\n#          pragma comment(lib, \"CORE_RL_xlib_.lib\")\n#        endif\n#        if defined(HasZLIB)\n#          pragma comment(lib, \"CORE_RL_zlib_.lib\")\n#        endif\n#      endif\n#      if defined(_WIN32_WCE)\n#        pragma comment(lib, \"wsock32.lib\")\n#      else\n#        pragma comment(lib, \"ws2_32.lib\")\n#      endif\n#    endif\n#  endif\n#else\n#  define MagickDLLDecl\n#  define MagickDLLDeclExtern\n#endif\n\n#if (defined(WIN32) || defined(WIN64)) && defined(_VISUALC_)\n#  pragma warning(disable : 4996) /* function deprecation warnings */\n#endif\n\n#if defined(MAGICK_IMPLEMENTATION)\nnamespace MagickLib\n{\n#  include \"magick/enum_strings.h\"\n}\n#endif\n\n//\n// Import GraphicsMagick symbols and types which are used as part of the\n// Magick++ API definition into namespace \"Magick\".\n//\nnamespace Magick\n{\n  // The datatype for an RGB component\n  using MagickLib::Quantum;\n\n  // Image class types\n  using MagickLib::ClassType;\n  using MagickLib::UndefinedClass;\n  using MagickLib::DirectClass;\n  using MagickLib::PseudoClass;\n\n  // Channel types\n  using MagickLib::ChannelType;\n  using MagickLib::UndefinedChannel;\n  using MagickLib::RedChannel;\n  using MagickLib::CyanChannel;\n  using MagickLib::GreenChannel;\n  using MagickLib::MagentaChannel;\n  using MagickLib::BlueChannel;\n  using MagickLib::YellowChannel;\n  using MagickLib::OpacityChannel;\n  using MagickLib::BlackChannel;\n  using MagickLib::MatteChannel;\n  using MagickLib::AllChannels;\n  using MagickLib::GrayChannel;\n\n  // Color-space types\n  using MagickLib::ColorspaceType;\n  using MagickLib::UndefinedColorspace;\n  using MagickLib::RGBColorspace;\n  using MagickLib::GRAYColorspace;\n  using MagickLib::TransparentColorspace;\n  using MagickLib::OHTAColorspace;\n  using MagickLib::XYZColorspace;\n  using MagickLib::YCbCrColorspace;\n  using MagickLib::YCCColorspace;\n  using MagickLib::YIQColorspace;\n  using MagickLib::YPbPrColorspace;\n  using MagickLib::YUVColorspace;\n  using MagickLib::CMYKColorspace;\n  using MagickLib::sRGBColorspace;\n  using MagickLib::HSLColorspace;\n  using MagickLib::HWBColorspace;\n  using MagickLib::LABColorspace;\n  using MagickLib::CineonLogRGBColorspace;\n  using MagickLib::Rec601LumaColorspace;\n  using MagickLib::Rec709LumaColorspace;\n  using MagickLib::Rec709YCbCrColorspace;\n\n  // Composition operations\n  using MagickLib::AddCompositeOp;\n  using MagickLib::AtopCompositeOp;\n  using MagickLib::BumpmapCompositeOp;\n  using MagickLib::ClearCompositeOp;\n  using MagickLib::ColorizeCompositeOp;\n  using MagickLib::CompositeOperator;\n  using MagickLib::CopyBlueCompositeOp;\n  using MagickLib::CopyCompositeOp;\n  using MagickLib::CopyGreenCompositeOp;\n  using MagickLib::CopyOpacityCompositeOp;\n  using MagickLib::CopyRedCompositeOp;\n  using MagickLib::DarkenCompositeOp;\n  using MagickLib::DifferenceCompositeOp;\n  using MagickLib::DisplaceCompositeOp;\n  using MagickLib::DissolveCompositeOp;\n  using MagickLib::HueCompositeOp;\n  using MagickLib::InCompositeOp;\n  using MagickLib::LightenCompositeOp;\n  using MagickLib::LuminizeCompositeOp;\n  using MagickLib::MinusCompositeOp;\n  using MagickLib::ModulateCompositeOp;\n  using MagickLib::MultiplyCompositeOp;\n  using MagickLib::NoCompositeOp;\n  using MagickLib::OutCompositeOp;\n  using MagickLib::OverCompositeOp;\n  using MagickLib::OverlayCompositeOp;\n  using MagickLib::PlusCompositeOp;\n  using MagickLib::SaturateCompositeOp;\n  using MagickLib::ScreenCompositeOp;\n  using MagickLib::SubtractCompositeOp;\n  using MagickLib::ThresholdCompositeOp;\n  using MagickLib::UndefinedCompositeOp;\n  using MagickLib::XorCompositeOp;\n  using MagickLib::CopyCyanCompositeOp;\n  using MagickLib::CopyMagentaCompositeOp;\n  using MagickLib::CopyYellowCompositeOp;\n  using MagickLib::CopyBlackCompositeOp;\n  using MagickLib::DivideCompositeOp;\n  using MagickLib::HardLightCompositeOp;\n  using MagickLib::ExclusionCompositeOp;\n  using MagickLib::ColorDodgeCompositeOp;\n  using MagickLib::ColorBurnCompositeOp;\n  using MagickLib::SoftLightCompositeOp;\n  using MagickLib::LinearBurnCompositeOp;\n  using MagickLib::LinearDodgeCompositeOp;\n  using MagickLib::LinearLightCompositeOp;\n  using MagickLib::VividLightCompositeOp;\n  using MagickLib::PinLightCompositeOp;\n  using MagickLib::HardMixCompositeOp;\n\n  // Compression algorithms\n  using MagickLib::CompressionType;\n  using MagickLib::UndefinedCompression;\n  using MagickLib::NoCompression;\n  using MagickLib::BZipCompression;\n  using MagickLib::FaxCompression;\n  using MagickLib::Group3Compression;\n  using MagickLib::Group4Compression;\n  using MagickLib::JPEGCompression;\n  using MagickLib::LZWCompression;\n  using MagickLib::RLECompression;\n  using MagickLib::ZipCompression;\n  using MagickLib::LZMACompression;\n  using MagickLib::JPEG2000Compression;\n  using MagickLib::JBIG1Compression;\n  using MagickLib::JBIG2Compression;\n  using MagickLib::ZSTDCompression;\n  using MagickLib::WebPCompression;\n\n  using MagickLib::DisposeType;\n  using MagickLib::UndefinedDispose;\n  using MagickLib::NoneDispose;\n  using MagickLib::BackgroundDispose;\n  using MagickLib::PreviousDispose;\n\n  // Endian options\n  using MagickLib::EndianType;\n  using MagickLib::UndefinedEndian;\n  using MagickLib::LSBEndian;\n  using MagickLib::MSBEndian;\n  using MagickLib::NativeEndian;\n\n  // Exception types\n  using MagickLib::ExceptionType;\n  using MagickLib::UndefinedException;\n  using MagickLib::EventException;\n  using MagickLib::ExceptionEvent;\n  using MagickLib::ResourceEvent;\n  using MagickLib::ResourceLimitEvent;\n  using MagickLib::TypeEvent;\n  using MagickLib::AnnotateEvent;\n  using MagickLib::OptionEvent;\n  using MagickLib::DelegateEvent;\n  using MagickLib::MissingDelegateEvent;\n  using MagickLib::CorruptImageEvent;\n  using MagickLib::FileOpenEvent;\n  using MagickLib::BlobEvent;\n  using MagickLib::StreamEvent;\n  using MagickLib::CacheEvent;\n  using MagickLib::CoderEvent;\n  using MagickLib::ModuleEvent;\n  using MagickLib::DrawEvent;\n  using MagickLib::RenderEvent;\n  using MagickLib::ImageEvent;\n  using MagickLib::WandEvent;\n  using MagickLib::TemporaryFileEvent;\n  using MagickLib::TransformEvent;\n  using MagickLib::XServerEvent;\n  using MagickLib::X11Event;\n  using MagickLib::UserEvent;\n  using MagickLib::MonitorEvent;\n  using MagickLib::LocaleEvent;\n  using MagickLib::DeprecateEvent;\n  using MagickLib::RegistryEvent;\n  using MagickLib::ConfigureEvent;\n  using MagickLib::WarningException;\n  using MagickLib::ExceptionWarning;\n  using MagickLib::ResourceWarning;\n  using MagickLib::ResourceLimitWarning;\n  using MagickLib::TypeWarning;\n  using MagickLib::AnnotateWarning;\n  using MagickLib::OptionWarning;\n  using MagickLib::DelegateWarning;\n  using MagickLib::MissingDelegateWarning;\n  using MagickLib::CorruptImageWarning;\n  using MagickLib::FileOpenWarning;\n  using MagickLib::BlobWarning;\n  using MagickLib::StreamWarning;\n  using MagickLib::CacheWarning;\n  using MagickLib::CoderWarning;\n  using MagickLib::ModuleWarning;\n  using MagickLib::DrawWarning;\n  using MagickLib::RenderWarning;\n  using MagickLib::ImageWarning;\n  using MagickLib::WandWarning;\n  using MagickLib::TemporaryFileWarning;\n  using MagickLib::TransformWarning;\n  using MagickLib::XServerWarning;\n  using MagickLib::X11Warning;\n  using MagickLib::UserWarning;\n  using MagickLib::MonitorWarning;\n  using MagickLib::LocaleWarning;\n  using MagickLib::DeprecateWarning;\n  using MagickLib::RegistryWarning;\n  using MagickLib::ConfigureWarning;\n  using MagickLib::ErrorException;\n  using MagickLib::ExceptionError;\n  using MagickLib::ResourceError;\n  using MagickLib::ResourceLimitError;\n  using MagickLib::TypeError;\n  using MagickLib::AnnotateError;\n  using MagickLib::OptionError;\n  using MagickLib::DelegateError;\n  using MagickLib::MissingDelegateError;\n  using MagickLib::CorruptImageError;\n  using MagickLib::FileOpenError;\n  using MagickLib::BlobError;\n  using MagickLib::StreamError;\n  using MagickLib::CacheError;\n  using MagickLib::CoderError;\n  using MagickLib::ModuleError;\n  using MagickLib::DrawError;\n  using MagickLib::RenderError;\n  using MagickLib::ImageError;\n  using MagickLib::WandError;\n  using MagickLib::TemporaryFileError;\n  using MagickLib::TransformError;\n  using MagickLib::XServerError;\n  using MagickLib::X11Error;\n  using MagickLib::UserError;\n  using MagickLib::MonitorError;\n  using MagickLib::LocaleError;\n  using MagickLib::DeprecateError;\n  using MagickLib::RegistryError;\n  using MagickLib::ConfigureError;\n  using MagickLib::FatalErrorException;\n  using MagickLib::ExceptionFatalError;\n  using MagickLib::ResourceFatalError;\n  using MagickLib::ResourceLimitFatalError;\n  using MagickLib::TypeFatalError;\n  using MagickLib::AnnotateFatalError;\n  using MagickLib::OptionFatalError;\n  using MagickLib::DelegateFatalError;\n  using MagickLib::MissingDelegateFatalError;\n  using MagickLib::CorruptImageFatalError;\n  using MagickLib::FileOpenFatalError;\n  using MagickLib::BlobFatalError;\n  using MagickLib::StreamFatalError;\n  using MagickLib::CacheFatalError;\n  using MagickLib::CoderFatalError;\n  using MagickLib::ModuleFatalError;\n  using MagickLib::DrawFatalError;\n  using MagickLib::RenderFatalError;\n  using MagickLib::ImageFatalError;\n  using MagickLib::WandFatalError;\n  using MagickLib::TemporaryFileFatalError;\n  using MagickLib::TransformFatalError;\n  using MagickLib::XServerFatalError;\n  using MagickLib::X11FatalError;\n  using MagickLib::UserFatalError;\n  using MagickLib::MonitorFatalError;\n  using MagickLib::LocaleFatalError;\n  using MagickLib::DeprecateFatalError;\n  using MagickLib::RegistryFatalError;\n  using MagickLib::ConfigureFatalError;\n\n  // Fill rules\n  using MagickLib::FillRule;\n  using MagickLib::UndefinedRule;\n  using MagickLib::EvenOddRule;\n  using MagickLib::NonZeroRule;\n\n  // Filter types\n  using MagickLib::FilterTypes;\n  using MagickLib::UndefinedFilter;\n  using MagickLib::PointFilter;\n  using MagickLib::BoxFilter;\n  using MagickLib::TriangleFilter;\n  using MagickLib::HermiteFilter;\n  using MagickLib::HanningFilter;\n  using MagickLib::HammingFilter;\n  using MagickLib::BlackmanFilter;\n  using MagickLib::GaussianFilter;\n  using MagickLib::QuadraticFilter;\n  using MagickLib::CubicFilter;\n  using MagickLib::CatromFilter;\n  using MagickLib::MitchellFilter;\n  using MagickLib::LanczosFilter;\n  using MagickLib::BesselFilter;\n  using MagickLib::SincFilter;\n\n  // Bit gravity\n  using MagickLib::GravityType;\n  using MagickLib::ForgetGravity;\n  using MagickLib::NorthWestGravity;\n  using MagickLib::NorthGravity;\n  using MagickLib::NorthEastGravity;\n  using MagickLib::WestGravity;\n  using MagickLib::CenterGravity;\n  using MagickLib::EastGravity;\n  using MagickLib::SouthWestGravity;\n  using MagickLib::SouthGravity;\n  using MagickLib::SouthEastGravity;\n  using MagickLib::StaticGravity;\n\n  // Image types\n  using MagickLib::ImageType;\n  using MagickLib::UndefinedType;\n  using MagickLib::BilevelType;\n  using MagickLib::GrayscaleType;\n  using MagickLib::GrayscaleMatteType;\n  using MagickLib::PaletteType;\n  using MagickLib::PaletteMatteType;\n  using MagickLib::TrueColorType;\n  using MagickLib::TrueColorMatteType;\n  using MagickLib::ColorSeparationType;\n  using MagickLib::ColorSeparationMatteType;\n  using MagickLib::OptimizeType;\n\n  // Interlace types\n  using MagickLib::InterlaceType;\n  using MagickLib::UndefinedInterlace;\n  using MagickLib::NoInterlace;\n  using MagickLib::LineInterlace;\n  using MagickLib::PlaneInterlace;\n  using MagickLib::PartitionInterlace;\n\n  // Line cap types\n  using MagickLib::LineCap;\n  using MagickLib::UndefinedCap;\n  using MagickLib::ButtCap;\n  using MagickLib::RoundCap;\n  using MagickLib::SquareCap;\n\n  // Line join types\n  using MagickLib::LineJoin;\n  using MagickLib::UndefinedJoin;\n  using MagickLib::MiterJoin;\n  using MagickLib::RoundJoin;\n  using MagickLib::BevelJoin;\n\n  // Noise types\n  using MagickLib::NoiseType;\n  using MagickLib::UniformNoise;\n  using MagickLib::GaussianNoise;\n  using MagickLib::MultiplicativeGaussianNoise;\n  using MagickLib::ImpulseNoise;\n  using MagickLib::LaplacianNoise;\n  using MagickLib::PoissonNoise;\n  using MagickLib::RandomNoise;\n\n  // Orientation types\n  using MagickLib::OrientationType;\n  using MagickLib::UndefinedOrientation;\n  using MagickLib::TopLeftOrientation;\n  using MagickLib::TopRightOrientation;\n  using MagickLib::BottomRightOrientation;\n  using MagickLib::BottomLeftOrientation;\n  using MagickLib::LeftTopOrientation;\n  using MagickLib::RightTopOrientation;\n  using MagickLib::RightBottomOrientation;\n  using MagickLib::LeftBottomOrientation;\n\n  // Paint methods\n  using MagickLib::PaintMethod;\n  using MagickLib::PointMethod;\n  using MagickLib::ReplaceMethod;\n  using MagickLib::FloodfillMethod;\n  using MagickLib::FillToBorderMethod;\n  using MagickLib::ResetMethod;\n\n  // Arithmetic and bitwise operators\n  using MagickLib::UndefinedQuantumOp;\n  using MagickLib::AddQuantumOp;\n  using MagickLib::AndQuantumOp;\n  using MagickLib::AssignQuantumOp;\n  using MagickLib::DivideQuantumOp;\n  using MagickLib::LShiftQuantumOp;\n  using MagickLib::MultiplyQuantumOp;\n  using MagickLib::OrQuantumOp;\n  using MagickLib::RShiftQuantumOp;\n  using MagickLib::SubtractQuantumOp;\n  using MagickLib::ThresholdQuantumOp;\n  using MagickLib::ThresholdBlackQuantumOp;\n  using MagickLib::ThresholdWhiteQuantumOp;\n  using MagickLib::ThresholdBlackNegateQuantumOp;\n  using MagickLib::ThresholdWhiteNegateQuantumOp;\n  using MagickLib::XorQuantumOp;\n  using MagickLib::NoiseGaussianQuantumOp;\n  using MagickLib::NoiseImpulseQuantumOp;\n  using MagickLib::NoiseLaplacianQuantumOp;\n  using MagickLib::NoiseMultiplicativeQuantumOp;\n  using MagickLib::NoisePoissonQuantumOp;\n  using MagickLib::NoiseUniformQuantumOp;\n  using MagickLib::NegateQuantumOp;\n  using MagickLib::GammaQuantumOp;\n  using MagickLib::DepthQuantumOp;\n  using MagickLib::LogQuantumOp;\n  using MagickLib::MaxQuantumOp;\n  using MagickLib::MinQuantumOp;\n  using MagickLib::PowQuantumOp;\n  using MagickLib::QuantumOperator;\n\n  // Preview types.  Not currently used by Magick++\n  using MagickLib::PreviewType;\n  using MagickLib::UndefinedPreview;\n  using MagickLib::RotatePreview;\n  using MagickLib::ShearPreview;\n  using MagickLib::RollPreview;\n  using MagickLib::HuePreview;\n  using MagickLib::SaturationPreview;\n  using MagickLib::BrightnessPreview;\n  using MagickLib::GammaPreview;\n  using MagickLib::SpiffPreview;\n  using MagickLib::DullPreview;\n  using MagickLib::GrayscalePreview;\n  using MagickLib::QuantizePreview;\n  using MagickLib::DespecklePreview;\n  using MagickLib::ReduceNoisePreview;\n  using MagickLib::AddNoisePreview;\n  using MagickLib::SharpenPreview;\n  using MagickLib::BlurPreview;\n  using MagickLib::ThresholdPreview;\n  using MagickLib::EdgeDetectPreview;\n  using MagickLib::SpreadPreview;\n  using MagickLib::SolarizePreview;\n  using MagickLib::ShadePreview;\n  using MagickLib::RaisePreview;\n  using MagickLib::SegmentPreview;\n  using MagickLib::SwirlPreview;\n  using MagickLib::ImplodePreview;\n  using MagickLib::WavePreview;\n  using MagickLib::OilPaintPreview;\n  using MagickLib::CharcoalDrawingPreview;\n  using MagickLib::JPEGPreview;\n\n  // Quantum types\n  using MagickLib::QuantumType;\n  using MagickLib::IndexQuantum;\n  using MagickLib::GrayQuantum;\n  using MagickLib::IndexAlphaQuantum;\n  using MagickLib::GrayAlphaQuantum;\n  using MagickLib::RedQuantum;\n  using MagickLib::CyanQuantum;\n  using MagickLib::GreenQuantum;\n  using MagickLib::YellowQuantum;\n  using MagickLib::BlueQuantum;\n  using MagickLib::MagentaQuantum;\n  using MagickLib::AlphaQuantum;\n  using MagickLib::BlackQuantum;\n  using MagickLib::RGBQuantum;\n  using MagickLib::RGBAQuantum;\n  using MagickLib::CMYKQuantum;\n  using MagickLib::CIEYQuantum;\n  using MagickLib::CIEXYZQuantum;\n\n  // Quantum sample types\n  using MagickLib::QuantumSampleType;\n  using MagickLib::UndefinedQuantumSampleType;\n  using MagickLib::UnsignedQuantumSampleType;\n  using MagickLib::FloatQuantumSampleType;\n\n  // Rendering intents\n  using MagickLib::RenderingIntent;\n  using MagickLib::UndefinedIntent;\n  using MagickLib::SaturationIntent;\n  using MagickLib::PerceptualIntent;\n  using MagickLib::AbsoluteIntent;\n  using MagickLib::RelativeIntent;\n\n  // Resolution units\n  using MagickLib::ResolutionType;\n  using MagickLib::UndefinedResolution;\n  using MagickLib::PixelsPerInchResolution;\n  using MagickLib::PixelsPerCentimeterResolution;\n\n  // PixelPacket structure\n  using MagickLib::PixelPacket;\n\n  // IndexPacket type\n  using MagickLib::IndexPacket;\n\n  // ImageStatistics type\n  using MagickLib::ImageStatistics;\n\n  // StorageType type\n  using MagickLib::StorageType;\n  using MagickLib::CharPixel;\n  using MagickLib::ShortPixel;\n  using MagickLib::IntegerPixel;\n  using MagickLib::LongPixel;\n  using MagickLib::FloatPixel;\n  using MagickLib::DoublePixel;\n\n  // StretchType type\n  using MagickLib::StretchType;\n  using MagickLib::NormalStretch;\n  using MagickLib::UltraCondensedStretch;\n  using MagickLib::ExtraCondensedStretch;\n  using MagickLib::CondensedStretch;\n  using MagickLib::SemiCondensedStretch;\n  using MagickLib::SemiExpandedStretch;\n  using MagickLib::ExpandedStretch;\n  using MagickLib::ExtraExpandedStretch;\n  using MagickLib::UltraExpandedStretch;\n  using MagickLib::AnyStretch;\n\n  // StyleType type\n  using MagickLib::StyleType;\n  using MagickLib::NormalStyle;\n  using MagickLib::ItalicStyle;\n  using MagickLib::ObliqueStyle;\n  using MagickLib::AnyStyle;\n\n  // Decoration types\n  using MagickLib::DecorationType;\n  using MagickLib::NoDecoration;\n  using MagickLib::UnderlineDecoration;\n  using MagickLib::OverlineDecoration;\n  using MagickLib::LineThroughDecoration;\n\n  // Resource types\n  using MagickLib::ResourceType;\n  using MagickLib::DiskResource;\n  using MagickLib::FileResource;\n  using MagickLib::MapResource;\n  using MagickLib::MemoryResource;\n  using MagickLib::PixelsResource;\n  using MagickLib::ThreadsResource;\n  using MagickLib::WidthResource;\n  using MagickLib::HeightResource;\n\n  // Virtual pixel methods\n  using MagickLib::VirtualPixelMethod;\n  using MagickLib::UndefinedVirtualPixelMethod;\n  using MagickLib::ConstantVirtualPixelMethod;\n  using MagickLib::EdgeVirtualPixelMethod;\n  using MagickLib::MirrorVirtualPixelMethod;\n  using MagickLib::TileVirtualPixelMethod;\n\n#if defined(MAGICK_IMPLEMENTATION)\n  //\n  // GraphicsMagick symbols used in implementation code\n  //\n  using MagickLib::AccessDefinition;\n  using MagickLib::AccessImmutableIndexes;\n  using MagickLib::AccessMutableIndexes;\n  using MagickLib::AcquireCacheViewPixels;\n  using MagickLib::AcquireImagePixels;\n  using MagickLib::AdaptiveThresholdImage;\n  using MagickLib::AddDefinition;\n  using MagickLib::AddDefinitions;\n  using MagickLib::AddNoiseImage;\n  using MagickLib::AddNoiseImageChannel;\n  using MagickLib::AffineMatrix;\n  using MagickLib::AffineTransformImage;\n  using MagickLib::AllocateImage;\n  using MagickLib::AnnotateImage;\n  using MagickLib::AreaValue;\n  using MagickLib::AspectValue;\n  using MagickLib::Base64Decode;\n  using MagickLib::Base64Encode;\n  using MagickLib::BlobError;\n  using MagickLib::BlobFatalError;\n  using MagickLib::BlobToImage;\n  using MagickLib::BlobWarning;\n  using MagickLib::BlurImage;\n  using MagickLib::BlurImageChannel;\n  using MagickLib::BorderImage;\n  using MagickLib::CacheError;\n  using MagickLib::CacheFatalError;\n  using MagickLib::CacheWarning;\n  using MagickLib::CdlImage;\n  using MagickLib::ChannelImage;\n  using MagickLib::CharcoalImage;\n  using MagickLib::ChopImage;\n  using MagickLib::CloneDrawInfo;\n  using MagickLib::CloneImage;\n  using MagickLib::CloneImageInfo;\n  using MagickLib::CloneQuantizeInfo;\n  using MagickLib::CloseCacheView;\n  using MagickLib::CoderError;\n  using MagickLib::CoderFatalError;\n  using MagickLib::CoderWarning;\n  using MagickLib::ColorFloodfillImage;\n  using MagickLib::ColorizeImage;\n  using MagickLib::ColorMatrixImage;\n  using MagickLib::CompositeImage;\n  using MagickLib::ConfigureError;\n  using MagickLib::ConfigureFatalError;\n  using MagickLib::ConfigureWarning;\n  using MagickLib::ConstituteImage;\n  using MagickLib::ContrastImage;\n  using MagickLib::ConvolveImage;\n  using MagickLib::CopyException;\n  using MagickLib::CorruptImageError;\n  using MagickLib::CorruptImageFatalError;\n  using MagickLib::CorruptImageWarning;\n  using MagickLib::CropImage;\n  using MagickLib::CycleColormapImage;\n  using MagickLib::DelegateError;\n  using MagickLib::DelegateFatalError;\n  using MagickLib::DelegateWarning;\n  using MagickLib::DeleteMagickRegistry;\n  using MagickLib::DespeckleImage;\n  using MagickLib::DestroyDrawInfo;\n  using MagickLib::DestroyExceptionInfo;\n  using MagickLib::DestroyImageInfo;\n  using MagickLib::DestroyImageList;\n  using MagickLib::DestroyMagick;\n  using MagickLib::DestroyQuantizeInfo;\n  using MagickLib::DispatchImage;\n  using MagickLib::DisplayImages;\n  using MagickLib::DrawAffine;\n  using MagickLib::DrawAllocateContext;\n  using MagickLib::DrawAnnotation;\n  using MagickLib::DrawArc;\n  using MagickLib::DrawBezier;\n  using MagickLib::DrawCircle;\n  using MagickLib::DrawColor;\n  using MagickLib::DrawComment;\n  using MagickLib::DrawComposite;\n  using MagickLib::DrawContext;\n  using MagickLib::DrawDestroyContext;\n  using MagickLib::DrawEllipse;\n  using MagickLib::DrawError;\n  using MagickLib::DrawFatalError;\n  using MagickLib::DrawImage;\n  using MagickLib::DrawInfo;\n  using MagickLib::DrawLine;\n  using MagickLib::DrawMatte;\n  using MagickLib::DrawPathClose;\n  using MagickLib::DrawPathCurveToAbsolute;\n  using MagickLib::DrawPathCurveToQuadraticBezierAbsolute;\n  using MagickLib::DrawPathCurveToQuadraticBezierRelative;\n  using MagickLib::DrawPathCurveToQuadraticBezierSmoothAbsolute;\n  using MagickLib::DrawPathCurveToQuadraticBezierSmoothRelative;\n  using MagickLib::DrawPathCurveToRelative;\n  using MagickLib::DrawPathCurveToSmoothAbsolute;\n  using MagickLib::DrawPathCurveToSmoothRelative;\n  using MagickLib::DrawPathEllipticArcAbsolute;\n  using MagickLib::DrawPathEllipticArcRelative;\n  using MagickLib::DrawPathFinish;\n  using MagickLib::DrawPathLineToAbsolute;\n  using MagickLib::DrawPathLineToHorizontalAbsolute;\n  using MagickLib::DrawPathLineToHorizontalRelative;\n  using MagickLib::DrawPathLineToRelative;\n  using MagickLib::DrawPathLineToVerticalAbsolute;\n  using MagickLib::DrawPathLineToVerticalRelative;\n  using MagickLib::DrawPathMoveToAbsolute;\n  using MagickLib::DrawPathMoveToRelative;\n  using MagickLib::DrawPathStart;\n  using MagickLib::DrawPoint;\n  using MagickLib::DrawPolygon;\n  using MagickLib::DrawPolyline;\n  using MagickLib::DrawPopClipPath;\n  using MagickLib::DrawPopDefs;\n  using MagickLib::DrawPopGraphicContext;\n  using MagickLib::DrawPopPattern;\n  using MagickLib::DrawPushClipPath;\n  using MagickLib::DrawPushDefs;\n  using MagickLib::DrawPushGraphicContext;\n  using MagickLib::DrawPushPattern;\n  using MagickLib::DrawRectangle;\n  using MagickLib::DrawRender;\n  using MagickLib::DrawRotate;\n  using MagickLib::DrawRoundRectangle;\n  using MagickLib::DrawScale;\n  using MagickLib::DrawSetClipPath;\n  using MagickLib::DrawSetClipRule;\n  using MagickLib::DrawSetClipUnits;\n  using MagickLib::DrawSetFillColor;\n  using MagickLib::DrawSetFillColorString;\n  using MagickLib::DrawSetFillOpacity;\n  using MagickLib::DrawSetFillPatternURL;\n  using MagickLib::DrawSetFillRule;\n  using MagickLib::DrawSetFont;\n  using MagickLib::DrawSetFontFamily;\n  using MagickLib::DrawSetFontSize;\n  using MagickLib::DrawSetFontStretch;\n  using MagickLib::DrawSetFontStyle;\n  using MagickLib::DrawSetFontWeight;\n  using MagickLib::DrawSetGravity;\n  using MagickLib::DrawSetStrokeAntialias;\n  using MagickLib::DrawSetStrokeColor;\n  using MagickLib::DrawSetStrokeColorString;\n  using MagickLib::DrawSetStrokeDashArray;\n  using MagickLib::DrawSetStrokeDashOffset;\n  using MagickLib::DrawSetStrokeLineCap;\n  using MagickLib::DrawSetStrokeLineJoin;\n  using MagickLib::DrawSetStrokeMiterLimit;\n  using MagickLib::DrawSetStrokeOpacity;\n  using MagickLib::DrawSetStrokePatternURL;\n  using MagickLib::DrawSetStrokeWidth;\n  using MagickLib::DrawSetTextAntialias;\n  using MagickLib::DrawSetTextDecoration;\n  using MagickLib::DrawSetTextEncoding;\n  using MagickLib::DrawSetTextUnderColor;\n  using MagickLib::DrawSetTextUnderColorString;\n  using MagickLib::DrawSetViewbox;\n  using MagickLib::DrawSkewX;\n  using MagickLib::DrawSkewY;\n  using MagickLib::DrawTranslate;\n  using MagickLib::DrawWarning;\n  using MagickLib::EdgeImage;\n  using MagickLib::EmbossImage;\n  using MagickLib::EnhanceImage;\n  using MagickLib::EqualizeImage;\n  using MagickLib::ExceptionInfo;\n  using MagickLib::ExecuteModuleProcess;\n  using MagickLib::ExportImagePixelArea;\n  using MagickLib::ExtentImage;\n  using MagickLib::FileOpenError;\n  using MagickLib::FileOpenFatalError;\n  using MagickLib::FileOpenWarning;\n  using MagickLib::FlattenImages;\n  using MagickLib::FlipImage;\n  using MagickLib::FlopImage;\n  using MagickLib::FormatString;\n  using MagickLib::FrameImage;\n  using MagickLib::FrameInfo;\n  using MagickLib::GammaImage;\n  using MagickLib::GammaImage;\n  using MagickLib::GaussianBlurImage;\n  using MagickLib::GaussianBlurImageChannel;\n  using MagickLib::GetBlobSize;\n  using MagickLib::GetCacheViewIndexes;\n  using MagickLib::GetCacheViewPixels;\n  using MagickLib::GetColorTuple;\n  using MagickLib::GetDrawInfo;\n  using MagickLib::GetExceptionInfo;\n  using MagickLib::GetGeometry;\n  using MagickLib::GetImageAttribute;\n  using MagickLib::GetImageBoundingBox;\n  using MagickLib::GetImageChannelDepth;\n  using MagickLib::GetImageClipMask;\n  using MagickLib::GetImageDepth;\n  using MagickLib::GetImageGeometry;\n  using MagickLib::GetImageInfo;\n  using MagickLib::GetImagePixels;\n  using MagickLib::GetImageProfile;\n  using MagickLib::GetImageQuantizeError;\n  using MagickLib::GetImageStatistics;\n  using MagickLib::GetImageType;\n  using MagickLib::GetMagickGeometry;\n  using MagickLib::GetMagickInfo;\n  using MagickLib::GetMagickInfoArray;\n  using MagickLib::GetMagickRegistry;\n  using MagickLib::GetNumberColors;\n  using MagickLib::GetPageGeometry;\n  using MagickLib::GetQuantizeInfo;\n  using MagickLib::GetTypeMetrics;\n  using MagickLib::GlobExpression;\n  using MagickLib::GreaterValue;\n  using MagickLib::HaldClutImage;\n  using MagickLib::HSLTransform;\n  using MagickLib::HeightValue;\n  using MagickLib::IdentityAffine;\n  using MagickLib::ImageAttribute;\n  using MagickLib::ImageError;\n  using MagickLib::ImageFatalError;\n  using MagickLib::ImageInfo;\n  using MagickLib::ImageInfoRegistryType;\n  using MagickLib::ImageRegistryType;\n  using MagickLib::ImageToBlob;\n  using MagickLib::ImageWarning;\n  using MagickLib::ImplodeImage;\n  using MagickLib::ImportImagePixelArea;\n  using MagickLib::IsEventLogging;\n  using MagickLib::IsGeometry;\n  using MagickLib::IsImagesEqual;\n  using MagickLib::IsSubimage;\n  using MagickLib::LessValue;\n  using MagickLib::LevelImage;\n  using MagickLib::LevelImageChannel;\n  using MagickLib::LocaleCompare;\n  using MagickLib::LogMagickEvent;\n  using MagickLib::MagickFree;\n  using MagickLib::MagickInfo;\n  using MagickLib::MagickMalloc;\n  using MagickLib::MagickRealloc;\n  using MagickLib::MagickStrlCpy;\n  using MagickLib::MagickToMime;\n  using MagickLib::MagnifyImage;\n  using MagickLib::MapImage;\n  using MagickLib::MatteFloodfillImage;\n  using MagickLib::MedianFilterImage;\n  using MagickLib::MinifyImage;\n  using MagickLib::MinimumValue;\n  using MagickLib::MissingDelegateError;\n  using MagickLib::MissingDelegateFatalError;\n  using MagickLib::MissingDelegateWarning;\n  using MagickLib::ModulateImage;\n  using MagickLib::ModuleError;\n  using MagickLib::ModuleFatalError;\n  using MagickLib::ModuleWarning;\n  using MagickLib::MonitorError;\n  using MagickLib::MonitorFatalError;\n  using MagickLib::MonitorWarning;\n  using MagickLib::MontageInfo;\n  using MagickLib::MotionBlurImage;\n  using MagickLib::NegateImage;\n  using MagickLib::NoValue;\n  using MagickLib::NoiseType;\n  using MagickLib::NormalizeImage;\n  using MagickLib::OilPaintImage;\n  using MagickLib::OpaqueImage;\n  using MagickLib::OpenCacheView;\n  using MagickLib::OptionError;\n  using MagickLib::OptionFatalError;\n  using MagickLib::OptionWarning;\n  using MagickLib::PercentValue;\n  using MagickLib::PingBlob;\n  using MagickLib::PingImage;\n  using MagickLib::PointInfo;\n  using MagickLib::PopImagePixels;\n  using MagickLib::ProfileImage;\n  using MagickLib::ProfileInfo;\n  using MagickLib::PushImagePixels;\n  using MagickLib::QuantizeImage;\n  using MagickLib::QuantizeInfo;\n  using MagickLib::QuantumOperatorImage;\n  using MagickLib::QuantumOperatorRegionImage;\n  using MagickLib::QueryColorDatabase;\n  using MagickLib::RGBTransformImage;\n  using MagickLib::RaiseImage;\n  using MagickLib::RandomChannelThresholdImage;\n  using MagickLib::ReadImage;\n  using MagickLib::RectangleInfo;\n  using MagickLib::RectangleInfo;\n  using MagickLib::ReduceNoiseImage;\n  using MagickLib::RegisterMagickInfo;\n  using MagickLib::RegistryError;\n  using MagickLib::RegistryFatalError;\n  using MagickLib::RegistryType;\n  using MagickLib::RegistryWarning;\n  using MagickLib::RemoveDefinitions;\n  using MagickLib::ResizeImage;\n  using MagickLib::ResourceLimitError;\n  using MagickLib::ResourceLimitFatalError;\n  using MagickLib::ResourceLimitWarning;\n  using MagickLib::RollImage;\n  using MagickLib::RotateImage;\n  using MagickLib::SampleImage;\n  using MagickLib::ScaleImage;\n  using MagickLib::SegmentImage;\n  using MagickLib::SetCacheViewPixels;\n  using MagickLib::SetClientName;\n  using MagickLib::SetImage;\n  using MagickLib::SetImageAttribute;\n  using MagickLib::SetImageChannelDepth;\n  using MagickLib::SetImageClipMask;\n  using MagickLib::SetImageDepth;\n  using MagickLib::SetImageInfo;\n  using MagickLib::SetImageOpacity;\n  using MagickLib::SetImagePixels;\n  using MagickLib::SetImageProfile;\n  using MagickLib::SetImageType;\n  using MagickLib::SetLogEventMask;\n  using MagickLib::SetMagickInfo;\n  using MagickLib::SetMagickRegistry;\n  using MagickLib::SetMagickResourceLimit;\n  using MagickLib::SetMagickResourceLimit;\n  using MagickLib::ShadeImage;\n  using MagickLib::SharpenImage;\n  using MagickLib::SharpenImageChannel;\n  using MagickLib::ShaveImage;\n  using MagickLib::ShearImage;\n  using MagickLib::SignatureImage;\n  using MagickLib::SolarizeImage;\n  using MagickLib::SpreadImage;\n  using MagickLib::SteganoImage;\n  using MagickLib::StereoImage;\n  using MagickLib::StreamError;\n  using MagickLib::StreamFatalError;\n  using MagickLib::StreamWarning;\n  using MagickLib::SwirlImage;\n  using MagickLib::SyncCacheViewPixels;\n  using MagickLib::SyncImage;\n  using MagickLib::SyncImagePixels;\n  using MagickLib::TextureImage;\n  using MagickLib::ThresholdImage;\n  using MagickLib::ThrowException;\n  using MagickLib::ThrowLoggedException;\n  using MagickLib::ThumbnailImage;\n  using MagickLib::TransformHSL;\n  using MagickLib::TransformImage;\n  using MagickLib::TransformRGBImage;\n  using MagickLib::TransparentImage;\n  using MagickLib::TypeError;\n  using MagickLib::TypeFatalError;\n  using MagickLib::TypeWarning;\n  using MagickLib::UndefinedException;\n  using MagickLib::UndefinedRegistryType;\n  using MagickLib::UnregisterMagickInfo;\n  using MagickLib::UnsharpMaskImage;\n  using MagickLib::UnsharpMaskImageChannel;\n  using MagickLib::ViewInfo;\n  using MagickLib::WaveImage;\n  using MagickLib::WidthValue;\n  using MagickLib::WriteImage;\n  using MagickLib::XNegative;\n  using MagickLib::XServerError;\n  using MagickLib::XServerFatalError;\n  using MagickLib::XServerWarning;\n  using MagickLib::XValue;\n  using MagickLib::YNegative;\n  using MagickLib::YValue;\n  using MagickLib::ZoomImage;\n\n\n#endif // MAGICK_IMPLEMENTATION\n\n}\n\n#endif // Magick_Include_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/Montage.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003\n//\n// Definition of Montage class used to specify montage options.\n//\n\n#if !defined(Magick_Montage_header)\n#define Magick_Montage_header\n\n#include \"Magick++/Include.h\"\n#include <string>\n#include \"Magick++/Color.h\"\n#include \"Magick++/Geometry.h\"\n\n//\n// Basic (Un-framed) Montage\n//\nnamespace Magick\n{\n  class MagickDLLDecl Montage\n  {\n  public:\n    Montage( void );\n    virtual ~Montage( void );\n\n    // Specifies the background color that thumbnails are imaged upon.\n    void              backgroundColor ( const Color &backgroundColor_ );\n    Color             backgroundColor ( void ) const;\n\n    // Specifies the image composition algorithm for thumbnails. This\n    // controls the algorithm by which the thumbnail image is placed\n    // on the background. Use of OverCompositeOp is recommended for\n    // use with images that have transparency. This option may have\n    // negative side-effects for images without transparency.\n    void              compose ( CompositeOperator compose_ );\n    CompositeOperator compose ( void ) const;\n\n    // Specifies the image filename to be used for the generated\n    // montage images. To handle the case were multiple montage images\n    // are generated, a printf-style format may be embedded within the\n    // filename. For example, a filename specification of\n    // image%02d.miff names the montage images as image00.miff,\n    // image01.miff, etc.\n    void              fileName( const std::string &fileName_ );\n    std::string       fileName( void ) const;\n\n    // Specifies the fill color to use for the label text.\n    void              fillColor ( const Color &fill_ );\n    Color             fillColor ( void ) const;\n\n    // Specifies the thumbnail label font.\n    void              font ( const std::string &font_ );\n    std::string       font ( void ) const;\n\n    // Specifies the size of the generated thumbnail.\n    void              geometry ( const Geometry &geometry_ );\n    Geometry          geometry ( void ) const;\n\n    // Specifies the thumbnail positioning within the specified\n    // geometry area. If the thumbnail is smaller in any dimension\n    // than the geometry, then it is placed according to this\n    // specification\n    void              gravity ( GravityType gravity_ );\n    GravityType       gravity ( void ) const;\n\n    // Specifies the format used for the image label. Special format\n    // characters may be embedded in the format string to include\n    // information about the image.\n    void              label( const std::string &label_ );\n    std::string       label( void ) const;\n\n    // Specifies the pen color to use for the label text (same as fill).\n    void              penColor ( const Color &pen_ );\n    Color             penColor ( void ) const;\n\n    // Specifies the thumbnail label font size.\n    void              pointSize ( unsigned int pointSize_ );\n    unsigned int      pointSize ( void ) const;\n\n    // Enable/disable drop-shadow on thumbnails.\n    void              shadow ( bool shadow_ );\n    bool              shadow ( void ) const;\n\n    // Specifies the stroke color to use for the label text .\n    void              strokeColor ( const Color &stroke_ );\n    Color             strokeColor ( void ) const;\n\n    // Specifies a texture image to use as montage background. The\n    // built-in textures \"granite:\" and \"plasma:\" are available. A\n    // texture is the same as a background image.\n    void              texture ( const std::string &texture_ );\n    std::string       texture ( void ) const;\n\n    // Specifies the maximum number of montage columns and rows in the\n    // montage. The montage is built by filling out all cells in a row\n    // before advancing to the next row. Once the montage has reached\n    // the maximum number of columns and rows, a new montage image is\n    // started.\n    void              tile ( const Geometry &tile_ );\n    Geometry          tile ( void ) const;\n\n    // Specifies the montage title\n    void              title ( const std::string &title_ );\n    std::string       title ( void ) const;\n\n    // Specifies a montage color to set transparent. This option can\n    // be set the same as the background color in order for the\n    // thumbnails to appear without a background when rendered on an\n    // HTML page. For best effect, ensure that the transparent color\n    // selected does not occur in the rendered thumbnail colors.\n    void              transparentColor ( const Color &transparentColor_ );\n    Color             transparentColor ( void ) const;\n\n    //\n    // Implementation methods/members\n    //\n\n    // Update elements in existing MontageInfo structure\n    virtual void      updateMontageInfo ( MagickLib::MontageInfo &montageInfo_ ) const;\n\n  protected:\n\n  private:\n    Color             _backgroundColor;   // Color that thumbnails are composed on\n    CompositeOperator _compose;           // Composition algorithm to use (e.g. ReplaceCompositeOp)\n    std::string       _fileName;          // Filename to save montages to\n    Color             _fill;              // Fill color\n    std::string       _font;              // Label font\n    Geometry          _geometry;          // Thumbnail width & height plus border width & height\n    GravityType       _gravity;           // Thumbnail position (e.g. SouthWestGravity)\n    std::string       _label;             // Thumbnail label (applied to image prior to montage)\n    unsigned int      _pointSize;         // Font point size\n    bool              _shadow;            // Enable drop-shadows on thumbnails\n    Color             _stroke;            // Outline color\n    std::string       _texture;           // Background texture image\n    Geometry          _tile;              // Thumbnail rows and colmns\n    std::string       _title;             // Montage title\n    Color             _transparentColor;  // Transparent color\n  };\n\n  //\n  // Montage With Frames (Extends Basic Montage)\n  //\n  class MagickDLLDecl MontageFramed : public Montage\n  {\n  public:\n    MontageFramed ( void );\n    /* virtual */ ~MontageFramed ( void );\n\n    // Specifies the background color within the thumbnail frame.\n    void           borderColor ( const Color &borderColor_ );\n    Color          borderColor ( void ) const;\n\n    // Specifies the border (in pixels) to place between a thumbnail\n    // and its surrounding frame. This option only takes effect if\n    // thumbnail frames are enabled (via frameGeometry) and the\n    // thumbnail geometry specification doesn't also specify the\n    // thumbnail border width.\n    void           borderWidth ( unsigned int borderWidth_ );\n    unsigned int   borderWidth ( void ) const;\n\n    // Specifies the geometry specification for frame to place around\n    // thumbnail. If this parameter is not specified, then the montage\n    // is unframed.\n    void           frameGeometry ( const Geometry &frame_ );\n    Geometry       frameGeometry ( void ) const;\n\n    // Specifies the thumbnail frame color.\n    void           matteColor ( const Color &matteColor_ );\n    Color          matteColor ( void ) const;\n\n    //\n    // Implementation methods/members\n    //\n\n    // Update elements in existing MontageInfo structure\n    /* virtual */ void updateMontageInfo ( MagickLib::MontageInfo &montageInfo_ ) const;\n\n  protected:\n\n  private:\n\n    Color          _borderColor;        // Frame border color\n    unsigned int   _borderWidth;        // Pixels between thumbnail and surrounding frame\n    Geometry       _frame;              // Frame geometry (width & height frame thickness)\n    Color          _matteColor;         // Frame foreground color\n  };\n} // namespace Magick\n\n//\n// Inlines\n//\n\n//\n// Implementation of Montage\n//\n\ninline void Magick::Montage::backgroundColor ( const Magick::Color &backgroundColor_ )\n{\n  _backgroundColor = backgroundColor_;\n}\ninline Magick::Color Magick::Montage::backgroundColor ( void ) const\n{\n  return _backgroundColor;\n}\n\ninline void Magick::Montage::compose ( Magick::CompositeOperator compose_ )\n{\n  _compose = compose_;\n}\ninline Magick::CompositeOperator Magick::Montage::compose ( void ) const\n{\n  return _compose;\n}\n\ninline void Magick::Montage::fileName( const std::string &fileName_ )\n{\n  _fileName = fileName_;\n}\ninline std::string Magick::Montage::fileName( void ) const\n{\n  return _fileName;\n}\n\ninline void Magick::Montage::fillColor ( const Color &fill_ )\n{\n  _fill=fill_;\n}\ninline Magick::Color Magick::Montage::fillColor ( void ) const\n{\n  return _fill;\n}\n\ninline void Magick::Montage::font ( const std::string &font_ )\n{\n  _font = font_;\n}\ninline std::string Magick::Montage::font ( void ) const\n{\n  return _font;\n}\n\ninline void Magick::Montage::geometry ( const Magick::Geometry &geometry_ )\n{\n  _geometry = geometry_;\n}\ninline Magick::Geometry Magick::Montage::geometry ( void ) const\n{\n  return _geometry;\n}\n\ninline void Magick::Montage::gravity ( Magick::GravityType gravity_ )\n{\n  _gravity = gravity_;\n}\ninline Magick::GravityType Magick::Montage::gravity ( void ) const\n{\n  return _gravity;\n}\n\n// Apply as attribute to all images before doing montage\ninline void Magick::Montage::label( const std::string &label_ )\n{\n  _label = label_;\n}\ninline std::string Magick::Montage::label( void ) const\n{\n  return _label;\n}\n\ninline void Magick::Montage::penColor ( const Color &pen_ )\n{\n  _fill=pen_;\n  _stroke=Color(\"none\");\n}\ninline Magick::Color Magick::Montage::penColor ( void ) const\n{\n  return _fill;\n}\n\ninline void Magick::Montage::pointSize ( unsigned int pointSize_ )\n{\n  _pointSize = pointSize_;\n}\ninline unsigned int Magick::Montage::pointSize ( void ) const\n{\n  return _pointSize;\n}\n\ninline void Magick::Montage::shadow ( bool shadow_ )\n{\n  _shadow = shadow_;\n}\ninline bool Magick::Montage::shadow ( void ) const\n{\n  return _shadow;\n}\n\ninline void Magick::Montage::strokeColor ( const Color &stroke_ )\n{\n  _stroke=stroke_;\n}\ninline Magick::Color Magick::Montage::strokeColor ( void ) const\n{\n  return _stroke;\n}\n\ninline void Magick::Montage::texture ( const std::string &texture_ )\n{\n  _texture = texture_;\n}\ninline std::string Magick::Montage::texture ( void ) const\n{\n  return _texture;\n}\n\ninline void Magick::Montage::tile ( const Geometry &tile_ )\n{\n  _tile = tile_;\n}\ninline Magick::Geometry Magick::Montage::tile ( void ) const\n{\n  return _tile;\n}\n\ninline void Magick::Montage::title ( const std::string &title_ )\n{\n  _title = title_;\n}\ninline std::string Magick::Montage::title ( void ) const\n{\n  return _title;\n}\n\n// Applied after the fact to montage with TransparentImage()\ninline void Magick::Montage::transparentColor ( const Magick::Color &transparentColor_ )\n{\n  _transparentColor = transparentColor_;\n}\ninline Magick::Color Magick::Montage::transparentColor ( void ) const\n{\n  return _transparentColor;\n}\n\n//\n// Implementation of MontageFramed\n//\n\ninline void Magick::MontageFramed::borderColor ( const Magick::Color &borderColor_ )\n{\n  _borderColor = borderColor_;\n}\ninline Magick::Color Magick::MontageFramed::borderColor ( void ) const\n{\n  return _borderColor;\n}\n\ninline void Magick::MontageFramed::borderWidth ( unsigned int borderWidth_ )\n{\n  _borderWidth = borderWidth_;\n}\ninline unsigned int Magick::MontageFramed::borderWidth ( void ) const\n{\n  return _borderWidth;\n}\n\ninline void Magick::MontageFramed::frameGeometry ( const Magick::Geometry &frame_ )\n{\n  _frame = frame_;\n}\ninline Magick::Geometry Magick::MontageFramed::frameGeometry ( void ) const\n{\n  return _frame;\n}\n\ninline void Magick::MontageFramed::matteColor ( const Magick::Color &matteColor_ )\n{\n  _matteColor = matteColor_;\n}\ninline Magick::Color Magick::MontageFramed::matteColor ( void ) const\n{\n  return _matteColor;\n}\n\n#endif // Magick_Montage_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/Pixels.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002\n//\n// Representation of a pixel view.\n//\n\n#if !defined(Magick_Pixels_header)\n#define Magick_Pixels_header\n\n#include \"Magick++/Include.h\"\n#include \"Magick++/Color.h\"\n#include \"Magick++/Image.h\"\n\nnamespace Magick\n{\n  class MagickDLLDecl Pixels\n  {\n  public:\n\n    // Construct pixel view using specified image.\n    Pixels( Magick::Image &image_ );\n\n    // Destroy pixel view\n    ~Pixels( void );\n\n    // Transfer pixels from the image to the pixel view as defined by\n    // the specified region. Modified pixels may be subsequently\n    // transferred back to the image via sync.\n    PixelPacket* get ( const int x_, const int y_,\n                       const unsigned int columns_,const  unsigned int rows_ );\n\n    // Transfer read-only pixels from the image to the pixel view as\n    // defined by the specified region.\n    const PixelPacket* getConst ( const int x_, const int y_,\n                                  const unsigned int columns_,\n                                  const unsigned int rows_ );\n\n    // Transfers the image view pixels to the image.\n    void sync ( void );\n\n    // Allocate a pixel view region to store image pixels as defined\n    // by the region rectangle.  This area is subsequently transferred\n    // from the pixel view to the image via sync.\n    PixelPacket* set ( const int x_, const int y_,\n                       const unsigned int columns_, const unsigned int rows_ );\n\n    // Return pixel colormap index array\n    IndexPacket* indexes ( void );\n\n    // Left ordinate of view\n    int x ( void ) const;\n\n    // Top ordinate of view\n    int y ( void ) const;\n\n    // Width of view\n    unsigned int columns ( void ) const;\n\n    // Height of view\n    unsigned int rows ( void ) const;\n\n#if 0\n    // Transfer one or more pixel components from a buffer or file\n    // into the image pixel view of an image.  Used to support image\n    // decoders.\n    void decode ( const QuantumType quantum_,\n                  const unsigned char *source_ )\n      {\n        MagickLib::ReadPixelCache( _image.image(), quantum_, source_ );\n      }\n\n    // Transfer one or more pixel components from the image pixel\n    // view to a buffer or file.  Used to support image encoders.\n    void encode ( const QuantumType quantum_,\n                  const unsigned char *destination_ )\n      {\n        MagickLib::WritePixelCache( _image.image(), quantum_, destination_ );\n      }\n#endif\n  private:\n\n    // Copying and assigning Pixels is not supported.\n    Pixels( const Pixels& pixels_ );\n    const Pixels& operator=( const Pixels& pixels_ );\n\n    Magick::Image             _image;     // Image reference\n    MagickLib::ViewInfo*      _view;      // Image view handle\n    int                       _x;         // Left ordinate of view\n    int                       _y;         // Top ordinate of view\n    unsigned int              _columns;   // Width of view\n    unsigned int              _rows;      // Height of view\n    MagickLib:: ExceptionInfo _exception; // Any thrown exception\n\n  }; // class Pixels\n\n} // Magick namespace\n\n//\n// Inline methods\n//\n\n// Left ordinate of view\ninline int Magick::Pixels::x ( void ) const\n{\n  return _x;\n}\n\n// Top ordinate of view\ninline int Magick::Pixels::y ( void ) const\n{\n  return _y;\n}\n\n// Width of view\ninline unsigned int Magick::Pixels::columns ( void ) const\n{\n  return _columns;\n}\n\n// Height of view\ninline unsigned int Magick::Pixels::rows ( void ) const\n{\n  return _rows;\n}\n\n#endif // Magick_Pixels_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/STL.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999 - 2018\n//\n// Definition and implementation of template functions for using\n// Magick::Image with STL containers.\n//\n\n#ifndef Magick_STL_header\n#define Magick_STL_header\n\n#include \"Magick++/Include.h\"\n#include <algorithm>\n#include <functional>\n#include <iterator>\n#include <map>\n#include <utility>\n\n#include \"Magick++/CoderInfo.h\"\n#include \"Magick++/Drawable.h\"\n#include \"Magick++/Exception.h\"\n#include \"Magick++/Montage.h\"\n\nnamespace Magick\n{\n  //\n  // STL function object declarations/definitions\n  //\n\n  // Function objects provide the means to invoke an operation on one\n  // or more image objects in an STL-compatable container.  The\n  // arguments to the function object constructor(s) are compatible\n  // with the arguments to the equivalent Image class method and\n  // provide the means to supply these options when the function\n  // object is invoked.\n\n  // For example, to read a GIF animation, set the color red to\n  // transparent for all frames, and write back out:\n  //\n  // list<image> images;\n  // readImages( &images, \"animation.gif\" );\n  // for_each( images.begin(), images.end(), transparentImage( \"red\" ) );\n  // writeImages( images.begin(), images.end(), \"animation.gif\" );\n\n  // Local adaptive threshold image\n  // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm\n  // Width x height define the size of the pixel neighborhood\n  // offset = constant to subtract from pixel neighborhood mean\n  class MagickDLLDecl adaptiveThresholdImage : public std::unary_function<Image&,void>\n  {\n  public:\n    adaptiveThresholdImage( const unsigned int width_,\n                            const unsigned int height_,\n                            const double offset_ = 0.0  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _width;\n    unsigned int _height;\n    double       _offset;\n  };\n\n  // Add noise to image with specified noise type\n  class MagickDLLDecl addNoiseImage : public std::unary_function<Image&,void>\n  {\n  public:\n    addNoiseImage ( NoiseType noiseType_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    NoiseType _noiseType;\n  };\n\n  // Transform image by specified affine (or free transform) matrix.\n  class MagickDLLDecl affineTransformImage : public std::unary_function<Image&,void>\n  {\n  public:\n    affineTransformImage( const DrawableAffine &affine_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    DrawableAffine _affine;\n  };\n\n  // Annotate image (draw text on image)\n  class MagickDLLDecl annotateImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Annotate using specified text, and placement location\n    annotateImage ( const std::string &text_,\n                    const Geometry &geometry_ );\n\n    // Annotate using specified text, bounding area, and placement\n    // gravity\n    annotateImage ( const std::string &text_,\n                    const Geometry &geometry_,\n                    const GravityType gravity_ );\n\n    // Annotate with text using specified text, bounding area,\n    // placement gravity, and rotation.\n    annotateImage ( const std::string &text_,\n                    const Geometry &geometry_,\n                    const GravityType gravity_,\n                    const double degrees_ );\n\n    // Annotate with text (bounding area is entire image) and\n    // placement gravity.\n    annotateImage ( const std::string &text_,\n                    const GravityType gravity_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    // Copy constructor and assignment are not supported\n    annotateImage(const annotateImage&);\n    annotateImage& operator=(const annotateImage&);\n\n    const std::string   _text;\n    const Geometry      _geometry;\n    const GravityType   _gravity;\n    const double        _degrees;\n  };\n\n  // Blur image with specified blur factor\n  class MagickDLLDecl blurImage : public std::unary_function<Image&,void>\n  {\n  public:\n    blurImage( const double radius_ = 1, const double sigma_ = 0.5 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n    double _sigma;\n  };\n\n  // Border image (add border to image)\n  class MagickDLLDecl borderImage : public std::unary_function<Image&,void>\n  {\n  public:\n    borderImage( const Geometry &geometry_ = borderGeometryDefault  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  // Extract channel from image\n  class MagickDLLDecl channelImage : public std::unary_function<Image&,void>\n  {\n  public:\n    channelImage( const ChannelType channel_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    ChannelType _channel;\n  };\n\n  // Charcoal effect image (looks like charcoal sketch)\n  class MagickDLLDecl charcoalImage : public std::unary_function<Image&,void>\n  {\n  public:\n    charcoalImage( const double radius_ = 1, const double sigma_ = 0.5  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n    double _sigma;\n  };\n\n  // Chop image (remove vertical or horizontal subregion of image)\n  class MagickDLLDecl chopImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chopImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  // Colorize image using pen color at specified percent opacity\n  class MagickDLLDecl colorizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorizeImage( const unsigned int opacityRed_,\n                   const unsigned int opacityGreen_,\n                   const unsigned int opacityBlue_,\n                   const Color &penColor_ );\n\n    colorizeImage( const unsigned int opacity_,\n                   const Color &penColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _opacityRed;\n    unsigned int _opacityGreen;\n    unsigned int _opacityBlue;\n    Color _penColor;\n  };\n\n  // Bake in the ASC-CDL, which is a convention for the for the\n  // exchange of basic primary color grading information between for\n  // the exchange of basic primary color grading information between\n  // equipment and software from different manufacturers.  It is a\n  // useful transform for other purposes as well.\n  class MagickDLLDecl cdlImage : public std::unary_function<Image&,void>\n  {\n  public:\n    cdlImage( const std::string &cdl_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string   _cdl;\n  };\n\n  // Apply a color matrix to the image channels.  The user supplied\n  // matrix may be of order 1 to 5 (1x1 through 5x5).\n  class MagickDLLDecl colorMatrixImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorMatrixImage( const unsigned int order_,\n                      const double *color_matrix_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int  _order;\n    const double *_color_matrix;\n  };\n\n  // Convert the image colorspace representation\n  class MagickDLLDecl colorSpaceImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorSpaceImage( ColorspaceType colorSpace_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    ColorspaceType _colorSpace;\n  };\n\n  // Comment image (add comment string to image)\n  class MagickDLLDecl commentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    commentImage( const std::string &comment_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _comment;\n  };\n\n  // Compose an image onto another at specified offset and using\n  // specified algorithm\n  class MagickDLLDecl compositeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    compositeImage( const Image &compositeImage_,\n                    int xOffset_,\n                    int yOffset_,\n                    CompositeOperator compose_ = InCompositeOp );\n\n    compositeImage( const Image &compositeImage_,\n                    const Geometry &offset_,\n                    CompositeOperator compose_ = InCompositeOp );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image             _compositeImage;\n    int               _xOffset;\n    int               _yOffset;\n    CompositeOperator _compose;\n  };\n\n  // Contrast image (enhance intensity differences in image)\n  class MagickDLLDecl contrastImage : public std::unary_function<Image&,void>\n  {\n  public:\n    contrastImage( const unsigned int sharpen_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _sharpen;\n  };\n\n  // Crop image (subregion of original image)\n  class MagickDLLDecl cropImage : public std::unary_function<Image&,void>\n  {\n  public:\n    cropImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  // Cycle image colormap\n  class MagickDLLDecl cycleColormapImage : public std::unary_function<Image&,void>\n  {\n  public:\n    cycleColormapImage( const int amount_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    int _amount;\n  };\n\n  // Despeckle image (reduce speckle noise)\n  class MagickDLLDecl despeckleImage : public std::unary_function<Image&,void>\n  {\n  public:\n    despeckleImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Draw on image\n  class MagickDLLDecl drawImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Draw on image using a single drawable\n    // Store in list to make implementation easier\n    drawImage( const Drawable &drawable_ );\n\n    // Draw on image using a drawable list\n    drawImage( const DrawableList &drawable_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    DrawableList _drawableList;\n  };\n\n  // Edge image (hilight edges in image)\n  class MagickDLLDecl edgeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    edgeImage( const double radius_ = 0.0  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n  };\n\n  // Emboss image (hilight edges with 3D effect)\n  class MagickDLLDecl embossImage : public std::unary_function<Image&,void>\n  {\n  public:\n    embossImage( void );\n    embossImage( const double radius_, const double sigma_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n    double _sigma;\n  };\n\n  // Enhance image (minimize noise)\n  class MagickDLLDecl enhanceImage : public std::unary_function<Image&,void>\n  {\n  public:\n    enhanceImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Equalize image (histogram equalization)\n  class MagickDLLDecl equalizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    equalizeImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Create an image canvas using background color sized according to\n  // geometry and composite existing image on it, with image placement\n  // controlled by gravity.  Parameters are obtained from existing\n  // image properties if they are not specified via a method\n  // parameter.  Parameters which are supported by image properties\n  // (gravity and backgroundColor) update those image properties as a\n  // side-effect.\n  class MagickDLLDecl extentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Extent image using a geometry\n    extentImage ( const Geometry &geometry_ );\n\n    // Extent image using a geometry & gravity\n    extentImage ( const Geometry &geometry_,\n                  const GravityType &gravity_ );\n\n    // Extent image using a geometry & background color\n    extentImage ( const Geometry &geometry_,\n                  const Color &backgroundColor_ );\n\n    // Extent image using a geometry, background color & gravity\n    extentImage ( const Geometry &geometry_,\n                  const Color &backgroundColor_,\n                  const GravityType &gravity_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    // Copy constructor and assignment are not supported\n    extentImage(const extentImage&);\n    extentImage& operator=(const extentImage&);\n\n    const Geometry      _geometry;\n    const Color         _backgroundColor;\n    const GravityType   _gravity;\n  };\n\n  // Color to use when filling drawn objects\n  class MagickDLLDecl fillColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    fillColorImage( const Color &fillColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _fillColor;\n  };\n\n  // Flip image (reflect each scanline in the vertical direction)\n  class MagickDLLDecl flipImage : public std::unary_function<Image&,void>\n  {\n  public:\n    flipImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Flood-fill image with color\n  class MagickDLLDecl floodFillColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Flood-fill color across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    floodFillColorImage( const unsigned int x_,\n                         const unsigned int y_,\n                         const Color &fillColor_ );\n\n    floodFillColorImage( const Geometry &point_,\n                         const Color &fillColor_ );\n\n    // Flood-fill color across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    floodFillColorImage( const unsigned int x_,\n                         const unsigned int y_,\n                         const Color &fillColor_,\n                         const Color &borderColor_ );\n\n    floodFillColorImage( const Geometry &point_,\n                         const Color &fillColor_,\n                         const Color &borderColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int   _x;\n    unsigned int   _y;\n    Color          _fillColor;\n    Color          _borderColor;\n  };\n\n  // Flood-fill image with texture\n  class MagickDLLDecl floodFillTextureImage : public std::unary_function<Image&,void>\n  {\n  public:\n    // Flood-fill texture across pixels that match the color of the\n    // target pixel and are neighbors of the target pixel.\n    // Uses current fuzz setting when determining color match.\n    floodFillTextureImage( const unsigned int x_,\n                           const unsigned int y_,\n                           const Image &texture_ );\n\n    floodFillTextureImage( const Geometry &point_,\n                           const Image &texture_ );\n\n    // Flood-fill texture across pixels starting at target-pixel and\n    // stopping at pixels matching specified border color.\n    // Uses current fuzz setting when determining color match.\n    floodFillTextureImage( const unsigned int x_,\n                           const unsigned int y_,\n                           const Image &texture_,\n                           const Color &borderColor_ );\n\n    floodFillTextureImage( const Geometry &point_,\n                           const Image &texture_,\n                           const Color &borderColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int  _x;\n    unsigned int  _y;\n    Image         _texture;\n    Color         _borderColor;\n  };\n\n  // Flop image (reflect each scanline in the horizontal direction)\n  class MagickDLLDecl flopImage : public std::unary_function<Image&,void>\n  {\n  public:\n    flopImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Frame image\n  class MagickDLLDecl frameImage : public std::unary_function<Image&,void>\n  {\n  public:\n    frameImage( const Geometry &geometry_ = frameGeometryDefault );\n\n    frameImage( const unsigned int width_, const unsigned int height_,\n                const int innerBevel_ = 6, const int outerBevel_ = 6 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _width;\n    unsigned int _height;\n    int          _outerBevel;\n    int          _innerBevel;\n  };\n\n  // Gamma correct image\n  class MagickDLLDecl gammaImage : public std::unary_function<Image&,void>\n  {\n  public:\n    gammaImage( const double gamma_ );\n\n    gammaImage ( const double gammaRed_,\n                 const double gammaGreen_,\n                 const double gammaBlue_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _gammaRed;\n    double _gammaGreen;\n    double _gammaBlue;\n  };\n\n  // Gaussian blur image\n  // The number of neighbor pixels to be included in the convolution\n  // mask is specified by 'width_'. The standard deviation of the\n  // gaussian bell curve is specified by 'sigma_'.\n  class MagickDLLDecl gaussianBlurImage : public std::unary_function<Image&,void>\n  {\n  public:\n    gaussianBlurImage( const double width_, const double sigma_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _width;\n    double _sigma;\n  };\n\n  // Implode image (special effect)\n  class MagickDLLDecl implodeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    implodeImage( const double factor_ = 50 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _factor;\n  };\n\n  // Apply a color lookup table (Hald CLUT) to the image.\n  class MagickDLLDecl haldClutImage : public std::unary_function<Image&,void>\n  {\n  public:\n    haldClutImage( const Image &haldClutImage_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image             _haldClutImage;\n  };\n\n  // Set image validity. Valid images become empty (inValid) if\n  // argument is false.\n  class MagickDLLDecl isValidImage : public std::unary_function<Image&,void>\n  {\n  public:\n    isValidImage( const bool isValid_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _isValid;\n  };\n\n  // Label image\n  class MagickDLLDecl labelImage : public std::unary_function<Image&,void>\n  {\n  public:\n    labelImage( const std::string &label_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _label;\n  };\n\n  // Level image\n  class MagickDLLDecl levelImage : public std::unary_function<Image&,void>\n  {\n  public:\n    levelImage( const double black_point,\n                const double white_point,\n                const double mid_point=1.0 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _black_point;\n    double _white_point;\n    double _mid_point;\n  };\n\n  // Level image channel\n  class MagickDLLDecl levelChannelImage : public std::unary_function<Image&,void>\n  {\n  public:\n    levelChannelImage( const Magick::ChannelType channel,\n                       const double black_point,\n                       const double white_point,\n                       const double mid_point=1.0 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Magick::ChannelType _channel;\n    double _black_point;\n    double _white_point;\n    double _mid_point;\n  };\n\n  // Magnify image by integral size\n  class MagickDLLDecl magnifyImage : public std::unary_function<Image&,void>\n  {\n  public:\n    magnifyImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Remap image colors with closest color from reference image\n  class MagickDLLDecl mapImage : public std::unary_function<Image&,void>\n  {\n  public:\n    mapImage( const Image &mapImage_ ,\n              const bool dither_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image   _mapImage;\n    bool    _dither;\n  };\n\n  // Floodfill designated area with a matte value\n  class MagickDLLDecl matteFloodfillImage : public std::unary_function<Image&,void>\n  {\n  public:\n    matteFloodfillImage( const Color &target_ ,\n                         const unsigned int matte_,\n                         const int x_, const int y_,\n                         const PaintMethod method_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color         _target;\n    unsigned int  _matte;\n    int           _x;\n    int           _y;\n    PaintMethod   _method;\n  };\n\n  // Filter image by replacing each pixel component with the median\n  // color in a circular neighborhood\n  class MagickDLLDecl medianFilterImage : public std::unary_function<Image&,void>\n  {\n  public:\n    medianFilterImage( const double radius_ = 0.0 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n  };\n\n  // Reduce image by integral size\n  class MagickDLLDecl minifyImage : public std::unary_function<Image&,void>\n  {\n  public:\n    minifyImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Modulate percent hue, saturation, and brightness of an image.\n  // Modulation of saturation and brightness is as a ratio of the\n  // current value (1.0 for no change). Modulation of hue is an\n  // absolute rotation of -180 degrees to +180 degrees from the\n  // current position corresponding to an argument range of 0 to 2.0\n  // (1.0 for no change).\n  class MagickDLLDecl modulateImage : public std::unary_function<Image&,void>\n  {\n  public:\n    modulateImage( const double brightness_,\n                   const double saturation_,\n                   const double hue_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _brightness;\n    double _saturation;\n    double _hue;\n  };\n\n  // Negate colors in image.  Set grayscale to only negate grayscale\n  // values in image.\n  class MagickDLLDecl negateImage : public std::unary_function<Image&,void>\n  {\n  public:\n    negateImage( const bool grayscale_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _grayscale;\n  };\n\n  // Normalize image (increase contrast by normalizing the pixel\n  // values to span the full range of color values)\n  class MagickDLLDecl normalizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    normalizeImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Oilpaint image (image looks like oil painting)\n  class MagickDLLDecl oilPaintImage : public std::unary_function<Image&,void>\n  {\n  public:\n    oilPaintImage( const double radius_ = 3 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n  };\n\n  // Set or attenuate the image opacity channel. If the image pixels\n  // are opaque then they are set to the specified opacity value,\n  // otherwise they are blended with the supplied opacity value.  The\n  // value of opacity_ ranges from 0 (completely opaque) to\n  // MaxRGB. The defines OpaqueOpacity and TransparentOpacity are\n  // available to specify completely opaque or completely transparent,\n  // respectively.\n  class MagickDLLDecl opacityImage : public std::unary_function<Image&,void>\n  {\n  public:\n    opacityImage( const unsigned int opacity_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _opacity;\n  };\n\n  // Change color of opaque pixel to specified pen color.\n  class MagickDLLDecl opaqueImage : public std::unary_function<Image&,void>\n  {\n  public:\n    opaqueImage( const Color &opaqueColor_,\n                 const Color &penColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color  _opaqueColor;\n    Color  _penColor;\n  };\n\n  // Quantize image (reduce number of colors)\n  class MagickDLLDecl quantizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeImage( const bool measureError_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _measureError;\n  };\n\n  // Raise image (lighten or darken the edges of an image to give a\n  // 3-D raised or lowered effect)\n  class MagickDLLDecl raiseImage : public std::unary_function<Image&,void>\n  {\n  public:\n    raiseImage( const Geometry &geometry_ = raiseGeometryDefault,\n                const bool raisedFlag_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry   _geometry;\n    bool       _raisedFlag;\n  };\n\n  // Reduce noise in image using a noise peak elimination filter\n  class MagickDLLDecl reduceNoiseImage : public std::unary_function<Image&,void>\n  {\n  public:\n    reduceNoiseImage( void );\n\n    reduceNoiseImage (const  unsigned int order_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _order;\n  };\n\n  // Resize image to a certain geomtry\n  class MagickDLLDecl resizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    resizeImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry  _geometry;\n  };\n\n  // Roll image (rolls image vertically and horizontally) by specified\n  // number of columnms and rows)\n  class MagickDLLDecl rollImage : public std::unary_function<Image&,void>\n  {\n  public:\n    rollImage( const Geometry &roll_ );\n\n    rollImage( const int columns_, const int rows_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    int _columns;\n    int _rows;\n  };\n\n  // Rotate image counter-clockwise by specified number of degrees.\n  class MagickDLLDecl rotateImage : public std::unary_function<Image&,void>\n  {\n  public:\n    rotateImage( const double degrees_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double       _degrees;\n  };\n\n  // Resize image by using pixel sampling algorithm\n  class MagickDLLDecl sampleImage : public std::unary_function<Image&,void>\n  {\n  public:\n    sampleImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry  _geometry;\n  };\n\n  // Resize image by using simple ratio algorithm\n  class MagickDLLDecl scaleImage : public std::unary_function<Image&,void>\n  {\n  public:\n    scaleImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry  _geometry;\n  };\n\n  // Segment (coalesce similar image components) by analyzing the\n  // histograms of the color components and identifying units that are\n  // homogeneous with the fuzzy c-means technique.\n  // Also uses QuantizeColorSpace and Verbose image attributes\n  class MagickDLLDecl segmentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    segmentImage( const double clusterThreshold_ = 1.0,\n                  const double smoothingThreshold_ = 1.5 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double  _clusterThreshold;\n    double  _smoothingThreshold;\n  };\n\n  // Shade image using distant light source\n  class MagickDLLDecl shadeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    shadeImage( const double azimuth_ = 30,\n                const double elevation_ = 30,\n                const bool   colorShading_ = false );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double  _azimuth;\n    double  _elevation;\n    bool    _colorShading;\n  };\n\n  // Sharpen pixels in image\n  class MagickDLLDecl sharpenImage : public std::unary_function<Image&,void>\n  {\n  public:\n    sharpenImage( const double radius_ = 1, const double sigma_ = 0.5 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _radius;\n    double _sigma;\n  };\n\n  // Shave pixels from image edges.\n  class MagickDLLDecl shaveImage : public std::unary_function<Image&,void>\n  {\n  public:\n    shaveImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n\n  // Shear image (create parallelogram by sliding image by X or Y axis)\n  class MagickDLLDecl shearImage : public std::unary_function<Image&,void>\n  {\n  public:\n    shearImage( const double xShearAngle_,\n                const double yShearAngle_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _xShearAngle;\n    double _yShearAngle;\n  };\n\n  // Solarize image (similar to effect seen when exposing a\n  // photographic film to light during the development process)\n  class MagickDLLDecl solarizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    solarizeImage( const double factor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _factor;\n  };\n\n  // Spread pixels randomly within image by specified ammount\n  class MagickDLLDecl spreadImage : public std::unary_function<Image&,void>\n  {\n  public:\n    spreadImage( const unsigned int amount_ = 3 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _amount;\n  };\n\n  // Add a digital watermark to the image (based on second image)\n  class MagickDLLDecl steganoImage : public std::unary_function<Image&,void>\n  {\n  public:\n    steganoImage( const Image &waterMark_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image _waterMark;\n  };\n\n  // Create an image which appears in stereo when viewed with red-blue glasses\n  // (Red image on left, blue on right)\n  class MagickDLLDecl stereoImage : public std::unary_function<Image&,void>\n  {\n  public:\n    stereoImage( const Image &rightImage_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image _rightImage;\n  };\n\n  // Color to use when drawing object outlines\n  class MagickDLLDecl strokeColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    strokeColorImage( const Color &strokeColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _strokeColor;\n  };\n\n  // Swirl image (image pixels are rotated by degrees)\n  class MagickDLLDecl swirlImage : public std::unary_function<Image&,void>\n  {\n  public:\n    swirlImage( const double degrees_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _degrees;\n  };\n\n  // Remove all profiles and text attributes from the image.\n  class MagickDLLDecl stripImage : public std::unary_function<Image&,void>\n  {\n  public:\n    stripImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Channel a texture on image background\n  class MagickDLLDecl textureImage : public std::unary_function<Image&,void>\n  {\n  public:\n    textureImage( const Image &texture_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image _texture;\n  };\n\n  // Threshold image\n  class MagickDLLDecl thresholdImage : public std::unary_function<Image&,void>\n  {\n  public:\n    thresholdImage( const double threshold_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _threshold;\n  };\n\n  // Transform image based on image and crop geometries\n  class MagickDLLDecl transformImage : public std::unary_function<Image&,void>\n  {\n  public:\n    transformImage( const Geometry &imageGeometry_ );\n\n    transformImage( const Geometry &imageGeometry_,\n                    const Geometry &cropGeometry_  );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _imageGeometry;\n    Geometry _cropGeometry;\n  };\n\n  // Set image color to transparent\n  class MagickDLLDecl transparentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    transparentImage( const Color& color_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _color;\n  };\n\n  // Trim edges that are the background color from the image\n  class MagickDLLDecl trimImage : public std::unary_function<Image&,void>\n  {\n  public:\n    trimImage( void );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n  };\n\n  // Map image pixels to a sine wave\n  class MagickDLLDecl waveImage : public std::unary_function<Image&,void>\n  {\n  public:\n    waveImage( const double amplitude_ = 25.0,\n               const double wavelength_ = 150.0 );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _amplitude;\n    double _wavelength;\n  };\n\n  // Zoom image to specified size.\n  class MagickDLLDecl zoomImage : public std::unary_function<Image&,void>\n  {\n  public:\n    zoomImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  //\n  // Function object image attribute accessors\n  //\n\n  // Anti-alias Postscript and TrueType fonts (default true)\n  class MagickDLLDecl antiAliasImage : public std::unary_function<Image&,void>\n  {\n  public:\n    antiAliasImage( const bool flag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _flag;\n  };\n\n  // Join images into a single multi-image file\n  class MagickDLLDecl adjoinImage : public std::unary_function<Image&,void>\n  {\n  public:\n    adjoinImage( const bool flag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _flag;\n  };\n\n  // Time in 1/100ths of a second which must expire before displaying\n  // the next image in an animated sequence.\n  class MagickDLLDecl animationDelayImage : public std::unary_function<Image&,void>\n  {\n  public:\n    animationDelayImage( const unsigned int delay_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _delay;\n  };\n\n  // Number of iterations to loop an animation (e.g. Netscape loop\n  // extension) for.\n  class MagickDLLDecl animationIterationsImage : public std::unary_function<Image&,void>\n  {\n  public:\n    animationIterationsImage( const unsigned int iterations_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _iterations;\n  };\n\n  // Image background color\n  class MagickDLLDecl backgroundColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    backgroundColorImage( const Color &color_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _color;\n  };\n\n  // Name of texture image to tile onto the image background\n  class MagickDLLDecl backgroundTextureImage : public std::unary_function<Image&,void>\n  {\n  public:\n    backgroundTextureImage( const std::string &backgroundTexture_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _backgroundTexture;\n  };\n\n  // Image border color\n  class MagickDLLDecl borderColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    borderColorImage( const Color &color_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _color;\n  };\n\n  // Text bounding-box base color (default none)\n  class MagickDLLDecl boxColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    boxColorImage( const Color &boxColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _boxColor;\n  };\n\n  // Chromaticity blue primary point (e.g. x=0.15, y=0.06)\n  class MagickDLLDecl chromaBluePrimaryImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chromaBluePrimaryImage( const double x_, const double y_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  // Chromaticity green primary point (e.g. x=0.3, y=0.6)\n  class MagickDLLDecl chromaGreenPrimaryImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chromaGreenPrimaryImage( const double x_, const double y_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  // Chromaticity red primary point (e.g. x=0.64, y=0.33)\n  class MagickDLLDecl chromaRedPrimaryImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chromaRedPrimaryImage( const double x_, const double y_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  // Chromaticity white point (e.g. x=0.3127, y=0.329)\n  class MagickDLLDecl chromaWhitePointImage : public std::unary_function<Image&,void>\n  {\n  public:\n    chromaWhitePointImage( const double x_, const double y_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _x;\n    double _y;\n  };\n\n  // Colors within this distance are considered equal\n  class MagickDLLDecl colorFuzzImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorFuzzImage( const double fuzz_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _fuzz;\n  };\n\n  // Color at colormap position index_\n  class MagickDLLDecl colorMapImage : public std::unary_function<Image&,void>\n  {\n  public:\n    colorMapImage( const unsigned int index_, const Color &color_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _index;\n    Color        _color;\n  };\n\n  // Composition operator to be used when composition is implicitly used\n  // (such as for image flattening).\n  class MagickDLLDecl composeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    composeImage( const CompositeOperator compose_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    CompositeOperator _compose;\n  };\n\n  // Compression type\n  class MagickDLLDecl compressTypeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    compressTypeImage( const CompressionType compressType_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    CompressionType _compressType;\n  };\n\n  // Vertical and horizontal resolution in pixels of the image\n  class MagickDLLDecl densityImage : public std::unary_function<Image&,void>\n  {\n  public:\n    densityImage( const Geometry &geomery_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geomery;\n  };\n\n  // Image depth (bits allocated to red/green/blue components)\n  class MagickDLLDecl depthImage : public std::unary_function<Image&,void>\n  {\n  public:\n    depthImage( const unsigned int depth_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _depth;\n  };\n\n  // Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image\n  // formats which support endian-specific options.\n  class MagickDLLDecl endianImage : public std::unary_function<Image&,void>\n  {\n  public:\n    endianImage( const EndianType endian_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    EndianType  _endian;\n  };\n\n  // Image file name\n  class MagickDLLDecl fileNameImage : public std::unary_function<Image&,void>\n  {\n  public:\n    fileNameImage( const std::string &fileName_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _fileName;\n  };\n\n  // Filter to use when resizing image\n  class MagickDLLDecl filterTypeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    filterTypeImage( const FilterTypes filterType_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    FilterTypes _filterType;\n  };\n\n  // Text rendering font\n  class MagickDLLDecl fontImage : public std::unary_function<Image&,void>\n  {\n  public:\n    fontImage( const std::string &font_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _font;\n  };\n\n  // Font point size\n  class MagickDLLDecl fontPointsizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    fontPointsizeImage( const unsigned int pointsize_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _pointsize;\n  };\n\n  // GIF disposal method\n  class MagickDLLDecl gifDisposeMethodImage : public std::unary_function<Image&,void>\n  {\n  public:\n    gifDisposeMethodImage( const unsigned int disposeMethod_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _disposeMethod;\n  };\n\n  // Type of interlacing to use\n  class MagickDLLDecl interlaceTypeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    interlaceTypeImage( const InterlaceType interlace_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    InterlaceType _interlace;\n  };\n\n  // Linewidth for drawing vector objects (default one)\n  class MagickDLLDecl lineWidthImage : public std::unary_function<Image&,void>\n  {\n  public:\n    lineWidthImage( const double lineWidth_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    double _lineWidth;\n  };\n\n  // File type magick identifier (.e.g \"GIF\")\n  class MagickDLLDecl magickImage : public std::unary_function<Image&,void>\n  {\n  public:\n    magickImage( const std::string &magick_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _magick;\n  };\n\n  // Image supports transparent color\n  class MagickDLLDecl matteImage : public std::unary_function<Image&,void>\n  {\n  public:\n    matteImage( const bool matteFlag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _matteFlag;\n  };\n\n  // Transparent color\n  class MagickDLLDecl matteColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    matteColorImage( const Color &matteColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _matteColor;\n  };\n\n  // Indicate that image is black and white\n  class MagickDLLDecl monochromeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    monochromeImage( const bool monochromeFlag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _monochromeFlag;\n  };\n\n  // Pen color\n  class MagickDLLDecl penColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    penColorImage( const Color &penColor_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Color _penColor;\n  };\n\n  // Pen texture image.\n  class MagickDLLDecl penTextureImage : public std::unary_function<Image&,void>\n  {\n  public:\n    penTextureImage( const Image &penTexture_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Image _penTexture;\n  };\n\n  // Set pixel color at location x & y.\n  class MagickDLLDecl pixelColorImage : public std::unary_function<Image&,void>\n  {\n  public:\n    pixelColorImage( const unsigned int x_,\n                     const unsigned int y_,\n                     const Color &color_);\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _x;\n    unsigned int _y;\n    Color        _color;\n  };\n\n  // Postscript page size.\n  class MagickDLLDecl pageImage : public std::unary_function<Image&,void>\n  {\n  public:\n    pageImage( const Geometry &pageSize_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _pageSize;\n  };\n\n  // JPEG/MIFF/PNG compression level (default 75).\n  class MagickDLLDecl qualityImage : public std::unary_function<Image&,void>\n  {\n  public:\n    qualityImage( const unsigned int quality_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _quality;\n  };\n\n  // Maximum number of colors to quantize to\n  class MagickDLLDecl quantizeColorsImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeColorsImage( const unsigned int colors_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _colors;\n  };\n\n  // Colorspace to quantize in.\n  class MagickDLLDecl quantizeColorSpaceImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeColorSpaceImage( const ColorspaceType colorSpace_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    ColorspaceType _colorSpace;\n  };\n\n  // Dither image during quantization (default true).\n  class MagickDLLDecl quantizeDitherImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeDitherImage( const bool ditherFlag_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _ditherFlag;\n  };\n\n  // Quantization tree-depth\n  class MagickDLLDecl quantizeTreeDepthImage : public std::unary_function<Image&,void>\n  {\n  public:\n    quantizeTreeDepthImage( const unsigned int treeDepth_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _treeDepth;\n  };\n\n  // The type of rendering intent\n  class MagickDLLDecl renderingIntentImage : public std::unary_function<Image&,void>\n  {\n  public:\n    renderingIntentImage( const RenderingIntent renderingIntent_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    RenderingIntent _renderingIntent;\n  };\n\n  // Units of image resolution\n  class MagickDLLDecl resolutionUnitsImage : public std::unary_function<Image&,void>\n  {\n  public:\n    resolutionUnitsImage( const ResolutionType resolutionUnits_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    ResolutionType _resolutionUnits;\n  };\n\n  // Image scene number\n  class MagickDLLDecl sceneImage : public std::unary_function<Image&,void>\n  {\n  public:\n    sceneImage( const unsigned int scene_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _scene;\n  };\n\n  // Width and height of a raw image\n  class MagickDLLDecl sizeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    sizeImage( const Geometry &geometry_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Geometry _geometry;\n  };\n\n  // Subimage of an image sequence\n  class MagickDLLDecl subImageImage : public std::unary_function<Image&,void>\n  {\n  public:\n    subImageImage( const unsigned int subImage_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _subImage;\n  };\n\n  // Number of images relative to the base image\n  class MagickDLLDecl subRangeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    subRangeImage( const unsigned int subRange_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    unsigned int _subRange;\n  };\n\n  // Tile name\n  class MagickDLLDecl tileNameImage : public std::unary_function<Image&,void>\n  {\n  public:\n    tileNameImage( const std::string &tileName_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _tileName;\n  };\n\n  // Image storage type\n  class MagickDLLDecl typeImage : public std::unary_function<Image&,void>\n  {\n  public:\n    typeImage( const ImageType type_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    Magick::ImageType _type;\n  };\n\n\n  // Print detailed information about the image\n  class MagickDLLDecl verboseImage : public std::unary_function<Image&,void>\n  {\n  public:\n    verboseImage( const bool verbose_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    bool _verbose;\n  };\n\n  // FlashPix viewing parameters\n  class MagickDLLDecl viewImage : public std::unary_function<Image&,void>\n  {\n  public:\n    viewImage( const std::string &view_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _view;\n  };\n\n  // X11 display to display to, obtain fonts from, or to capture\n  // image from\n  class MagickDLLDecl x11DisplayImage : public std::unary_function<Image&,void>\n  {\n  public:\n    x11DisplayImage( const std::string &display_ );\n\n    void operator()( Image &image_ ) const;\n\n  private:\n    std::string _display;\n  };\n\n  //////////////////////////////////////////////////////////\n  //\n  // Implementation template definitions. Not for end-use.\n  //\n  //////////////////////////////////////////////////////////\n\n  // Link images together into an image list based on the ordering of\n  // the container implied by the iterator. This step is done in\n  // preparation for use with ImageMagick functions which operate on\n  // lists of images.\n  // Images are selected by range, first_ to last_ so that a subset of\n  // the container may be selected.  Specify first_ via the\n  // container's begin() method and last_ via the container's end()\n  // method in order to specify the entire container.\n  template <class InputIterator>\n  void linkImages( InputIterator first_,\n                   InputIterator last_ ) {\n\n    MagickLib::Image* previous = 0;\n    int scene = 0;\n    for ( InputIterator iter = first_; iter != last_; ++iter )\n      {\n        // Unless we reduce the reference count to one, the same image\n        // structure may occur more than once in the container, causing\n        // the linked list to fail.\n        iter->modifyImage();\n\n        MagickLib::Image* current = iter->image();\n\n        current->previous = previous;\n        current->next     = 0;\n        current->scene    = scene++;\n\n        if ( previous != 0)\n          previous->next = current;\n\n        previous = current;\n      }\n  }\n\n  // Remove links added by linkImages. This should be called after the\n  // ImageMagick function call has completed to reset the image list\n  // back to its pristine un-linked state.\n  template <class InputIterator>\n  void unlinkImages( InputIterator first_,\n                     InputIterator last_ ) {\n    for( InputIterator iter = first_; iter != last_; ++iter )\n      {\n        MagickLib::Image* image = iter->image();\n        image->previous = 0;\n        image->next = 0;\n      }\n  }\n\n  // Insert images in image list into existing container (appending to container)\n  // The images should not be deleted since only the image ownership is passed.\n  // The options are copied into the object.\n  template <class Container>\n  void insertImages( Container *sequence_,\n                     MagickLib::Image* images_ ) {\n    MagickLib::Image *image = images_;\n    if ( image )\n      {\n        do\n          {\n            MagickLib::Image* next_image = image->next;\n            image->next = 0;\n\n            if (next_image != 0)\n              next_image->previous=0;\n\n            sequence_->push_back( Magick::Image( image ) );\n\n            image=next_image;\n          } while( image );\n\n        return;\n      }\n  }\n\n  ///////////////////////////////////////////////////////////////////\n  //\n  // Template definitions for documented API\n  //\n  ///////////////////////////////////////////////////////////////////\n\n  template <class InputIterator>\n  void animateImages( InputIterator first_,\n                      InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::AnimateImages( first_->imageInfo(), first_->image() );\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    unlinkImages( first_, last_ );\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Append images from list into single image in either horizontal or\n  // vertical direction.\n  template <class InputIterator>\n  void appendImages( Image *appendedImage_,\n                     InputIterator first_,\n                     InputIterator last_,\n                     bool stack_ = false) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::Image* image = MagickLib::AppendImages( first_->image(),\n                                                       stack_,\n                                                       &exceptionInfo );\n    unlinkImages( first_, last_ );\n    appendedImage_->replaceImage( image );\n    throwException( exceptionInfo, appendedImage_->quiet() );\n  }\n\n  // Average a set of images.\n  // All the input images must be the same size in pixels.\n  template <class InputIterator>\n  void averageImages( Image *averagedImage_,\n                      InputIterator first_,\n                      InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::Image* image = MagickLib::AverageImages( first_->image(),\n                                                        &exceptionInfo );\n    unlinkImages( first_, last_ );\n    averagedImage_->replaceImage( image );\n    throwException( exceptionInfo, averagedImage_->quiet() );\n  }\n\n  // Merge a sequence of images.\n  // This is useful for GIF animation sequences that have page\n  // offsets and disposal methods. A container to contain\n  // the updated image sequence is passed via the coalescedImages_\n  // option.\n  template <class InputIterator, class Container >\n  void coalesceImages( Container *coalescedImages_,\n                       InputIterator first_,\n                       InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    // Build image list\n    linkImages( first_, last_ );\n    MagickLib::Image* images = MagickLib::CoalesceImages( first_->image(),\n                                                          &exceptionInfo);\n    // Unlink image list\n    unlinkImages( first_, last_ );\n\n    // Ensure container is empty\n    coalescedImages_->clear();\n\n    // Move images to container\n    insertImages( coalescedImages_, images );\n\n    // Report any error\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Return format coders matching specified conditions.\n  //\n  // The default (if no match terms are supplied) is to return all\n  // available format coders.\n  //\n  // For example, to return all readable formats:\n  //  list<CoderInfo> coderList;\n  //  coderInfoList( &coderList, CoderInfo::TrueMatch, CoderInfo::AnyMatch, CoderInfo::AnyMatch)\n  //\n  template <class Container >\n  void coderInfoList( Container *container_,\n                      CoderInfo::MatchType isReadable_ = CoderInfo::AnyMatch,\n                      CoderInfo::MatchType isWritable_ = CoderInfo::AnyMatch,\n                      CoderInfo::MatchType isMultiFrame_ = CoderInfo::AnyMatch\n                      ) {\n    // Obtain first entry in MagickInfo list\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    MagickLib::MagickInfo **coder_list =\n      MagickLib::GetMagickInfoArray( &exceptionInfo );\n    if( !coder_list )\n      {\n        throwException( exceptionInfo );\n        throwExceptionExplicit(MagickLib::MissingDelegateError,\n                               \"Coder array not returned!\", 0 );\n      }\n\n    // Clear out container\n    container_->clear();\n\n    for ( int i=0; coder_list[i] != 0; i++)\n      {\n        // Skip stealth coders\n        if ( coder_list[i]->stealth )\n          continue;\n\n        try {\n          CoderInfo coderInfo( coder_list[i]->name );\n\n          // Test isReadable_\n          if ( isReadable_ != CoderInfo::AnyMatch &&\n               (( coderInfo.isReadable() && isReadable_ != CoderInfo::TrueMatch ) ||\n                ( !coderInfo.isReadable() && isReadable_ != CoderInfo::FalseMatch )) )\n            continue;\n\n          // Test isWritable_\n          if ( isWritable_ != CoderInfo::AnyMatch &&\n               (( coderInfo.isWritable() && isWritable_ != CoderInfo::TrueMatch ) ||\n                ( !coderInfo.isWritable() && isWritable_ != CoderInfo::FalseMatch )) )\n            continue;\n\n          // Test isMultiFrame_\n          if ( isMultiFrame_ != CoderInfo::AnyMatch &&\n               (( coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::TrueMatch ) ||\n                ( !coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::FalseMatch )) )\n            continue;\n\n          // Append matches to container\n          container_->push_back( coderInfo );\n        }\n        // Intentionally ignore missing module errors\n        catch ( Magick::ErrorModule & )\n          {\n            continue;\n          }\n      }\n    MagickLib::MagickFree(coder_list);\n    coder_list=0;\n    MagickLib::DestroyExceptionInfo( &exceptionInfo );\n  }\n\n  //\n  // Fill container with color histogram.\n  // Entries are of type \"std::pair<Color,unsigned long>\".  Use the pair\n  // \"first\" member to access the Color and the \"second\" member to access\n  // the number of times the color occurs in the image.\n  //\n  // For example:\n  //\n  //  Using <map>:\n  //\n  //  Image image(\"image.miff\");\n  //  map<Color,unsigned long> histogram;\n  //  colorHistogram( &histogram, image );\n  //  std::map<Color,unsigned long>::const_iterator p=histogram.begin();\n  //  while (p != histogram.end())\n  //    {\n  //      cout << setw(10) << (int)p->second << \": (\"\n  //           << setw(quantum_width) << (int)p->first.redQuantum() << \",\"\n  //           << setw(quantum_width) << (int)p->first.greenQuantum() << \",\"\n  //           << setw(quantum_width) << (int)p->first.blueQuantum() << \")\"\n  //           << endl;\n  //      p++;\n  //    }\n  //\n  //  Using <vector>:\n  //\n  //  Image image(\"image.miff\");\n  //  std::vector<std::pair<Color,unsigned long> > histogram;\n  //  colorHistogram( &histogram, image );\n  //  std::vector<std::pair<Color,unsigned long> >::const_iterator p=histogram.begin();\n  //  while (p != histogram.end())\n  //    {\n  //      cout << setw(10) << (int)p->second << \": (\"\n  //           << setw(quantum_width) << (int)p->first.redQuantum() << \",\"\n  //           << setw(quantum_width) << (int)p->first.greenQuantum() << \",\"\n  //           << setw(quantum_width) << (int)p->first.blueQuantum() << \")\"\n  //           << endl;\n  //      p++;\n  //    }\n\n  template <class Container >\n  void colorHistogram( Container *histogram_, const Image image)\n  {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    // Obtain histogram array\n    unsigned long colors;\n    MagickLib::HistogramColorPacket *histogram_array =\n      MagickLib::GetColorHistogram( image.constImage(), &colors, &exceptionInfo );\n    throwException( exceptionInfo, image.quiet() );\n\n    // Clear out container\n    histogram_->clear();\n\n    // Transfer histogram array to container\n    for ( unsigned long i=0; i < colors; i++)\n      {\n        histogram_->insert(histogram_->end(),std::pair<const Color,unsigned long>\n                           ( Color(histogram_array[i].pixel.red,\n                                   histogram_array[i].pixel.green,\n                                   histogram_array[i].pixel.blue),\n                                   histogram_array[i].count) );\n      }\n\n    // Deallocate histogram array\n    MagickLib::MagickFree(histogram_array);\n    histogram_array = 0;\n  }\n\n  // Break down an image sequence into constituent parts.  This is\n  // useful for creating GIF or MNG animation sequences.\n  template <class InputIterator, class Container >\n  void deconstructImages( Container *deconstructedImages_,\n                          InputIterator first_,\n                          InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    // Build image list\n    linkImages( first_, last_ );\n    MagickLib::Image* images = MagickLib::DeconstructImages( first_->image(),\n                                                             &exceptionInfo);\n    // Unlink image list\n    unlinkImages( first_, last_ );\n\n    // Ensure container is empty\n    deconstructedImages_->clear();\n\n    // Move images to container\n    insertImages( deconstructedImages_, images );\n\n    // Report any error\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  //\n  // Display an image sequence\n  //\n  template <class InputIterator>\n  void displayImages( InputIterator first_,\n                      InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::DisplayImages( first_->imageInfo(), first_->image() );\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    unlinkImages( first_, last_ );\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Merge a sequence of image frames which represent image layers.\n  // This is useful for combining Photoshop layers into a single image.\n  template <class InputIterator>\n  void flattenImages( Image *flattendImage_,\n                      InputIterator first_,\n                      InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::Image* image = MagickLib::FlattenImages( first_->image(),\n                                                        &exceptionInfo );\n    unlinkImages( first_, last_ );\n    flattendImage_->replaceImage( image );\n    throwException( exceptionInfo, flattendImage_->quiet() );\n  }\n\n  // Replace the colors of a sequence of images with the closest color\n  // from a reference image.\n  // Set dither_ to true to enable dithering.  Set measureError_ to\n  // true in order to evaluate quantization error.\n  template <class InputIterator>\n  void mapImages( InputIterator first_,\n                  InputIterator last_,\n                  const Image& mapImage_,\n                  bool dither_ = false,\n                  bool measureError_ = false ) {\n\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::MapImages( first_->image(),\n                          mapImage_.constImage(),\n                          dither_ );\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    if ( exceptionInfo.severity != MagickLib::UndefinedException )\n      {\n        unlinkImages( first_, last_ );\n        throwException( exceptionInfo, first_->quiet() );\n      }\n\n    MagickLib::Image* image = first_->image();\n    while( image )\n      {\n        // Calculate quantization error\n        if ( measureError_ )\n          {\n            MagickLib::GetImageQuantizeError( image );\n            if ( image->exception.severity > MagickLib::UndefinedException )\n              {\n                unlinkImages( first_, last_ );\n                throwException( exceptionInfo, first_->quiet() );\n              }\n          }\n\n        // Udate DirectClass representation of pixels\n        MagickLib::SyncImage( image );\n        if ( image->exception.severity > MagickLib::UndefinedException )\n          {\n            unlinkImages( first_, last_ );\n            throwException( exceptionInfo, first_->quiet() );\n          }\n\n        // Next image\n        image=image->next;\n      }\n\n    unlinkImages( first_, last_ );\n  }\n\n  // Create a composite image by combining several separate images.\n  template <class Container, class InputIterator>\n  void montageImages( Container *montageImages_,\n                      InputIterator first_,\n                      InputIterator last_,\n                      const Montage &montageOpts_ ) {\n\n    MagickLib::MontageInfo* montageInfo =\n      static_cast<MagickLib::MontageInfo*>(MagickLib::MagickMalloc(sizeof(MagickLib::MontageInfo)));\n\n    // Update montage options with those set in montageOpts_\n    montageOpts_.updateMontageInfo( *montageInfo );\n\n    // Update options which must transfer to image options\n    if ( montageOpts_.label().length() != 0 )\n      first_->label( montageOpts_.label() );\n\n    // Create linked image list\n    linkImages( first_, last_ );\n\n    // Reset output container to pristine state\n    montageImages_->clear();\n\n    // Do montage\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    MagickLib::Image *images = MagickLib::MontageImages( first_->image(),\n                                                         montageInfo,\n                                                         &exceptionInfo );\n    if ( images != 0 )\n      {\n        insertImages( montageImages_, images );\n      }\n\n    // Clean up any allocated data in montageInfo\n    MagickLib::DestroyMontageInfo( montageInfo );\n\n    // Unlink linked image list\n    unlinkImages( first_, last_ );\n\n    // Report any montage error\n    throwException( exceptionInfo, first_->quiet() );\n\n    // Apply transparency to montage images\n    if ( montageImages_->size() > 0 && montageOpts_.transparentColor().isValid() )\n      {\n        for_each( first_, last_, transparentImage( montageOpts_.transparentColor() ) );\n      }\n\n    // Report any transparentImage() error\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Morph a set of images\n  template <class InputIterator, class Container >\n  void morphImages( Container *morphedImages_,\n                    InputIterator first_,\n                    InputIterator last_,\n                    unsigned int frames_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    // Build image list\n    linkImages( first_, last_ );\n    MagickLib::Image* images = MagickLib::MorphImages( first_->image(), frames_,\n                                                       &exceptionInfo);\n    // Unlink image list\n    unlinkImages( first_, last_ );\n\n    // Ensure container is empty\n    morphedImages_->clear();\n\n    // Move images to container\n    insertImages( morphedImages_, images );\n\n    // Report any error\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Inlay a number of images to form a single coherent picture.\n  template <class InputIterator>\n  void mosaicImages( Image *mosaicImage_,\n                     InputIterator first_,\n                     InputIterator last_ ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    linkImages( first_, last_ );\n    MagickLib::Image* image = MagickLib::MosaicImages( first_->image(),\n                                                       &exceptionInfo );\n    unlinkImages( first_, last_ );\n    mosaicImage_->replaceImage( image );\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n  // Quantize colors in images using current quantization settings\n  // Set measureError_ to true in order to measure quantization error\n  template <class InputIterator>\n  void quantizeImages( InputIterator first_,\n                       InputIterator last_,\n                       bool measureError_ = false ) {\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    linkImages( first_, last_ );\n\n    MagickLib::QuantizeImages( first_->quantizeInfo(),\n                               first_->image() );\n    MagickLib::GetImageException( first_->image(), &exceptionInfo );\n    if ( exceptionInfo.severity > MagickLib::UndefinedException )\n      {\n        unlinkImages( first_, last_ );\n        throwException( exceptionInfo, first_->quiet() );\n      }\n\n    MagickLib::Image* image = first_->image();\n    while( image != 0 )\n      {\n        // Calculate quantization error\n        if ( measureError_ )\n          MagickLib::GetImageQuantizeError( image );\n\n        // Update DirectClass representation of pixels\n        MagickLib::SyncImage( image );\n\n        // Next image\n        image=image->next;\n      }\n\n    unlinkImages( first_, last_ );\n  }\n\n  // Read images into existing container (appending to container)\n  // FIXME: need a way to specify options like size, depth, and density.\n  template <class Container>\n  void readImages( Container *sequence_,\n                   const std::string &imageSpec_ ) {\n    MagickLib::ImageInfo *imageInfo = MagickLib::CloneImageInfo(0);\n    imageSpec_.copy( imageInfo->filename, MaxTextExtent-1 );\n    imageInfo->filename[ imageSpec_.length() ] = 0;\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    MagickLib::Image* images =  MagickLib::ReadImage( imageInfo, &exceptionInfo );\n    MagickLib::DestroyImageInfo(imageInfo);\n    insertImages( sequence_, images);\n    throwException( exceptionInfo );\n  }\n  template <class Container>\n  void readImages( Container *sequence_,\n                   const Blob &blob_ ) {\n    MagickLib::ImageInfo *imageInfo = MagickLib::CloneImageInfo(0);\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    MagickLib::Image *images = MagickLib::BlobToImage( imageInfo,\n                                                       blob_.data(),\n                                                       blob_.length(), &exceptionInfo );\n    MagickLib::DestroyImageInfo(imageInfo);\n    insertImages( sequence_, images );\n    throwException( exceptionInfo );\n  }\n\n  // Write Images\n  //\n  // If an attribute is not supported as an explicit argument\n  // (e.g. 'magick'), then the attribute must be set on the involved\n  // images in the container prior to invoking writeImages() since\n  // attributes from the individual images are the ones which are\n  // used.\n  template <class InputIterator>\n  void writeImages( InputIterator first_,\n                    InputIterator last_,\n                    const std::string &imageSpec_,\n                    bool adjoin_ = true ) {\n\n    first_->adjoin( adjoin_ );\n\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n\n    linkImages( first_, last_ );\n    int errorStat = MagickLib::WriteImages( first_->constImageInfo(),\n                                            first_->image(),\n                                            imageSpec_.c_str(),\n                                            &exceptionInfo );\n    unlinkImages( first_, last_ );\n\n    if ( errorStat != false )\n      {\n        MagickLib::DestroyExceptionInfo( &exceptionInfo );\n        return;\n      }\n\n    throwException( exceptionInfo, first_->quiet() );\n  }\n  // Write images to BLOB\n  //\n  // If an attribute is not supported as an explicit argument\n  // (e.g. 'magick'), then the attribute must be set on the involved\n  // images in the container prior to invoking writeImages() since\n  // attributes from the individual images are the ones which are\n  // used.\n  template <class InputIterator>\n  void writeImages( InputIterator first_,\n                    InputIterator last_,\n                    Blob *blob_,\n                    bool adjoin_ = true) {\n\n    first_->adjoin( adjoin_ );\n\n    linkImages( first_, last_ );\n\n    MagickLib::ExceptionInfo exceptionInfo;\n    MagickLib::GetExceptionInfo( &exceptionInfo );\n    size_t length = 2048; // Efficient size for small images\n    void* data = MagickLib::ImageToBlob( first_->imageInfo(),\n                                         first_->image(),\n                                         &length,\n                                         &exceptionInfo);\n    blob_->updateNoCopy( data, length, Magick::Blob::MallocAllocator );\n\n    unlinkImages( first_, last_ );\n\n    throwException( exceptionInfo, first_->quiet() );\n  }\n\n} // namespace Magick\n\n#endif // Magick_STL_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++/TypeMetric.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 2001, 2002\n//\n// TypeMetric Definition\n//\n// Container for font type metrics\n//\n\n#if !defined (Magick_TypeMetric_header)\n#define Magick_TypeMetric_header\n\n#include \"Magick++/Include.h\"\n\nnamespace Magick\n{\n  class MagickDLLDecl TypeMetric\n  {\n    friend class Image;\n  public:\n\n    TypeMetric ( void );\n    ~TypeMetric ( void );\n\n    // Ascent, the distance in pixels from the text baseline to the\n    // highest/upper grid coordinate used to place an outline point.\n    double         ascent ( void ) const;\n\n    // Descent, the distance in pixels from the baseline to the lowest\n    // grid coordinate used to place an outline point. Always a\n    // negative value.\n    double         descent ( void ) const;\n\n    // Text width in pixels.\n    double         textWidth ( void ) const;\n\n    // Text height in pixels.\n    double         textHeight ( void ) const;\n\n    // Maximum horizontal advance in pixels.\n    double         maxHorizontalAdvance ( void ) const;\n\n    //\n    // Public methods below this point are for Magick++ use only.\n    //\n\n  private:\n    MagickLib::TypeMetric  _typeMetric;\n  };\n} // namespace Magick\n\n//\n// Inlines\n//\n\n\n#endif // Magick_TypeMetric_header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/Magick++.h",
    "content": "// This may look like C code, but it is really -*- C++ -*-\n//\n// Copyright Bob Friesenhahn, 1999, 2000\n//\n// Simplified includes for Magick++.\n// Inclusion of this header is sufficient to use all Magick++ APIs.\n//\n#ifndef MagickPlusPlus_Header\n#include <Magick++/Include.h>\n#include <Magick++/Image.h>\n#include <Magick++/Pixels.h>\n#include <Magick++/STL.h>\n#define MagickPlusPlus_Header\n#endif // MagickPlusPlus_Header\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/analyze.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Analysis Methods.\n*/\n#ifndef _MAGICK_ANALYZE_H\n#define _MAGICK_ANALYZE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#include \"magick/image.h\"\n\ntypedef struct _ImageCharacteristics\n{\n  MagickBool\n    cmyk,               /* CMYK(A) image */\n    grayscale,          /* Grayscale image */\n    monochrome,         /* Black/white image */\n    opaque,             /* Opaque image */\n    palette;            /* Colormapped image */\n} ImageCharacteristics;\n\n/* Functions which return unsigned int to indicate operation pass/fail */\nextern MagickExport MagickPassFail\n  GetImageCharacteristics(const Image *image,ImageCharacteristics *characteristics,\n                          const MagickBool optimize,ExceptionInfo *exception);\n\nextern MagickExport unsigned long\n  GetImageDepth(const Image *,ExceptionInfo *);\n\nextern MagickExport MagickBool\n  IsGrayImage(const Image *image,ExceptionInfo *exception),\n  IsMonochromeImage(const Image *image,ExceptionInfo *exception),\n  IsOpaqueImage(const Image *image,ExceptionInfo *exception);\n\nextern MagickExport ImageType\n  GetImageType(const Image *,ExceptionInfo *);\n\nextern MagickExport RectangleInfo\n  GetImageBoundingBox(const Image *,ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_ANALYZE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/api.h",
    "content": "/*\n  Copyright (C) 2003 - 2012 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Application Programming Interface declarations.\n\n*/\n\n#if !defined(_MAGICK_API_H)\n#define _MAGICK_API_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/magick_config.h\"\n#if defined(__cplusplus) || defined(c_plusplus)\n#  undef inline\n#endif\n\n#include <stdio.h>\n#include <stdarg.h>\n#include <stdlib.h>\n#include <sys/types.h> /* POSIX 1990 header and declares size_t and ssize_t */\n\n/*\n  Note that the WIN32 and WIN64 definitions are provided by the build\n  configuration rather than the compiler.  Definitions available from\n  the Windows compiler are _WIN32 and _WIN64.\n*/\n#if defined(WIN32) || defined(WIN64)\n#  define MSWINDOWS\n#endif /* defined(WIN32) || defined(WIN64) */\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  if defined(MSWINDOWS)\n  /* Use Visual C++ C inline method extension to improve performance */\n#    if !defined(inline) && !defined(__cplusplus) && !defined(c_plusplus)\n#      define inline __inline\n#    endif\n#  endif\n#endif\n\n#if defined(PREFIX_MAGICK_SYMBOLS)\n#  include \"magick/symbols.h\"\n#endif /* defined(PREFIX_MAGICK_SYMBOLS) */\n\n#include \"magick/common.h\"\n#include \"magick/magick_types.h\"\n#include \"magick/analyze.h\"\n#include \"magick/attribute.h\"\n#include \"magick/average.h\"\n#include \"magick/blob.h\"\n#include \"magick/cdl.h\"\n#include \"magick/channel.h\"\n#include \"magick/color.h\"\n#include \"magick/color_lookup.h\"\n#include \"magick/colormap.h\"\n#include \"magick/command.h\"\n#include \"magick/compare.h\"\n#include \"magick/composite.h\"\n#include \"magick/compress.h\"\n#include \"magick/confirm_access.h\"\n#include \"magick/constitute.h\"\n#include \"magick/decorate.h\"\n#include \"magick/delegate.h\"\n#include \"magick/deprecate.h\"\n#include \"magick/describe.h\"\n#include \"magick/draw.h\"\n#include \"magick/effect.h\"\n#include \"magick/enhance.h\"\n#include \"magick/error.h\"\n#include \"magick/fx.h\"\n#include \"magick/gem.h\"\n#include \"magick/gradient.h\"\n#include \"magick/hclut.h\"\n#include \"magick/image.h\"\n#include \"magick/list.h\"\n#include \"magick/log.h\"\n#include \"magick/magic.h\"\n#include \"magick/magick.h\"\n#include \"magick/memory.h\"\n#include \"magick/module.h\"\n#include \"magick/monitor.h\"\n#include \"magick/montage.h\"\n#include \"magick/operator.h\"\n#include \"magick/paint.h\"\n#include \"magick/pixel_cache.h\"\n#include \"magick/pixel_iterator.h\"\n#include \"magick/plasma.h\"\n#include \"magick/profile.h\"\n#include \"magick/quantize.h\"\n  /*#include \"magick/random.h\"*/\n#include \"magick/registry.h\"\n#include \"magick/render.h\"\n#include \"magick/resize.h\"\n#include \"magick/resource.h\"\n#include \"magick/shear.h\"\n#include \"magick/signature.h\"\n#include \"magick/statistics.h\"\n#include \"magick/texture.h\"\n#include \"magick/timer.h\"\n#include \"magick/transform.h\"\n#include \"magick/type.h\"\n#include \"magick/utility.h\"\n#include \"magick/version.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_API_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/attribute.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Methods to Get/Set/Destroy Image Text Attributes.\n*/\n#ifndef _MAGICK_ATTRIBUTE_H\n#define _MAGICK_ATTRIBUTE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/image.h\"\n\ntypedef struct _ImageAttribute\n{\n  char\n    *key,           /* identifying key */\n    *value;         /* value string */\n\n  size_t\n    length;         /* value string length */\n\n  struct _ImageAttribute\n    *previous,\n    *next;\n} ImageAttribute;\n\f\n/*\n  MagickExported text attribute methods.\n*/\nextern MagickExport const ImageAttribute\n  *GetImageAttribute(const Image *image,const char *key),\n  *GetImageClippingPathAttribute(const Image *image),\n  *GetImageInfoAttribute(const ImageInfo *image_info,const Image *image,const char *key);\n\nextern MagickExport MagickPassFail\n  CloneImageAttributes(Image* clone_image, const Image* original_image),\n  SetImageAttribute(Image *image,const char *key,const char *value);\n\nextern MagickExport void\n  DestroyImageAttributes(Image *image);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/attribute-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/average.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Averaging Methods.\n*/\n#ifndef _MAGICK_AVERAGE_H\n#define _MAGICK_AVERAGE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\nextern MagickExport Image\n  *AverageImages(const Image *,ExceptionInfo *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_AVERAGE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/blob.h",
    "content": "/*\n  Copyright (C) 2003-2018 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Image Compression/Decompression Methods.\n*/\n#ifndef _MAGICK_BLOB_H\n#define _MAGICK_BLOB_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/image.h\"\n\n  /*\n    Minimum input file size before considering for memory map.\n  */\n#define MinBlobExtent  32768L\n\n  /*\n    Forward declarations.\n  */\n  typedef struct _BlobInfo BlobInfo;\n  \f\n  /*\n   *\n   * BlobInfo methods\n   *\n   */\n\n  /*\n    Makes a duplicate of the given blob info structure, or if blob info\n    is NULL, a new one.\n  */\n  extern MagickExport BlobInfo* CloneBlobInfo(const BlobInfo *blob_info);\n\n  /*\n    Increments the reference count associated with the pixel blob,\n    returning a pointer to the blob.\n  */\n  extern MagickExport BlobInfo* ReferenceBlob(BlobInfo *blob);\n\n  /*\n    Deallocate memory associated with the BlobInfo structure.\n  */\n  extern MagickExport void DestroyBlobInfo(BlobInfo *blob) MAGICK_FUNC_DEPRECATED;\n\n  /*\n    If BLOB is a memory mapping then unmap it. Reset BlobInfo structure\n    to its default state.\n  */\n  extern MagickExport void DetachBlob(BlobInfo *blob);\n\n  /*\n    Initialize a BlobInfo structure.\n  */\n  extern MagickExport void GetBlobInfo(BlobInfo *blob);\n\n  /*\n    Attach memory buffer to a BlobInfo structure.\n  */\n  extern MagickExport void AttachBlob(BlobInfo *blob_info,\n                                      const void *blob,\n                                      const size_t length);\n\n  /*\n   *\n   * Functions for managing a BLOB (type BlobInfo) attached to an Image.\n   *\n   */\n\n  /*\n    Deallocate all memory associated with an Image blob (reference counted).\n  */\n  extern MagickExport void DestroyBlob(Image *image);\n\n\n  /*\n   *\n   * Formatted image I/O functions\n   *\n   */\n\n  /*\n    Read an Image from a formatted in-memory \"file\" image  (\"BLOB\").\n  */\n  extern MagickExport Image* BlobToImage(const ImageInfo *image_info,\n                                         const void *blob,\n                                         const size_t length,\n                                         ExceptionInfo *exception);\n\n  /*\n    Return an Image populated with salient information regarding a\n    formatted in-memory \"file\" image (\"BLOB\") but without reading the\n    image pixels.\n  */\n  extern MagickExport Image* PingBlob(const ImageInfo *image_info,\n                                      const void *blob,\n                                      const size_t length,\n                                      ExceptionInfo *exception);\n\n  /*\n    Writes an Image to a formatted (like a file) in-memory\n    representation.\n  */\n  extern MagickExport void *ImageToBlob(const ImageInfo *image_info,\n                                        Image *image,\n                                        size_t *length,\n                                        ExceptionInfo *exception);\n\n  /*\n   *\n   * Core File or BLOB I/O functions.\n   *\n   */\n\n  /*\n    Blob open modes.\n  */\n  typedef enum\n    {\n      UndefinedBlobMode,    /* Undefined */\n      ReadBlobMode,         /* Open for reading (text) */ /* only locale.c */\n      ReadBinaryBlobMode,   /* Open for reading (binary) */\n      WriteBlobMode,        /* Open for writing (text) */ /* only mvg.c txt.c */\n      WriteBinaryBlobMode   /* Open for writing (binary) */\n    } BlobMode;\n\n  /*\n    Open an input or output stream for access.  May also use a stream\n    provided via image_info->stream.\n  */\n  extern MagickExport MagickPassFail OpenBlob(const ImageInfo *image_info,\n                                              Image *image,\n                                              const BlobMode mode,\n                                              ExceptionInfo *exception);\n\n  /*\n    Close I/O to the file or BLOB.\n  */\n  extern MagickExport MagickPassFail CloseBlob(Image *image);\n\n\n  /*\n    Read data from the file or BLOB into a buffer.\n  */\n  extern MagickExport size_t ReadBlob(Image *image,\n                                      const size_t length,\n                                      void *data);\n\n  /*\n    Read data from the file or BLOB into a buffer, but support zero-copy\n    if possible.\n  */\n  extern MagickExport size_t ReadBlobZC(Image *image,\n                                        const size_t length,\n                                        void **data);\n\n  /*\n    Write data from a buffer to the file or BLOB.\n  */\n  extern MagickExport size_t WriteBlob(Image *image,\n                                       const size_t length,\n                                       const void *data);\n\n  /*\n    Move the current read or write offset position in the file or BLOB.\n  */\n  extern MagickExport magick_off_t SeekBlob(Image *image,\n                                            const magick_off_t offset,\n                                            const int whence);\n\n  /*\n    Obtain the current read or write offset position in the file or\n    BLOB.\n  */\n  extern MagickExport magick_off_t TellBlob(const Image *image);\n\n  /*\n    Test to see if EOF has been detected while reading the file or BLOB.\n  */\n  extern MagickExport int EOFBlob(const Image *image);\n\n  /*\n    Test to see if an error has been encountered while doing I/O to the file\n    or BLOB.  Non-zero is returned if an error occured.\n  */\n  extern MagickExport int GetBlobStatus(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Return the first errno present when an error has been encountered while\n    doing I/O to the file or BLOB.  This is only useful if GetBlobStatus() has\n    already reported that an error occured.\n  */\n  extern MagickExport int GetBlobFirstErrno(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Test to see if blob is currently open.\n  */\n  extern MagickExport MagickBool GetBlobIsOpen(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Obtain the current size of the file or BLOB.  Zero is returned if\n    the size can not be determined.  If BLOB is no longer open, then\n    return the size when the BLOB was closed.\n  */\n  extern MagickExport magick_off_t GetBlobSize(const Image *image);\n\n\n  /*\n    Obtain the underlying stdio FILE* for the file (if any).\n  */\n  extern MagickExport FILE *GetBlobFileHandle(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Obtain a pointer to the base of where BLOB data is stored.  The data\n    is only available if the data is stored on the heap, or is memory\n    mapped.  Otherwise NULL is returned.\n  */\n  extern MagickExport unsigned char *GetBlobStreamData(const Image *image) MAGICK_FUNC_PURE;\n\n\n  /*\n   *\n   * Formatted File or BLOB I/O functions.\n   *\n   */\n\n  /*\n    Read a single byte from the file or BLOB.  Returns an EOF character if EOF\n    has been detected.\n  */\n  extern MagickExport int ReadBlobByte(Image *image);\n\n  /*\n    Read a 16-bit little-endian unsigned \"short\" value from the file or BLOB.\n  */\n  extern MagickExport magick_uint16_t ReadBlobLSBShort(Image *image);\n\n  /*\n    Read a 16-bit little-endian signed \"short\" value from the file or BLOB.\n  */\n  extern MagickExport magick_int16_t ReadBlobLSBSignedShort(Image *image);\n\n  /*\n    Read an array of little-endian unsigned 16-bit \"short\" values from the\n    file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobLSBShorts(Image *image, size_t octets,\n                                               magick_uint16_t *data);\n\n  /*\n    Read a 16-bit big-endian unsigned \"short\" value from the file or\n    BLOB.\n  */\n  extern MagickExport magick_uint16_t ReadBlobMSBShort(Image *image);\n\n  /*\n    Read a 16-bit big-endian signed \"short\" value from the file or BLOB.\n  */\n  extern MagickExport magick_int16_t ReadBlobMSBSignedShort(Image *image);\n\n  /*\n    Read an array of big-endian 16-bit \"short\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobMSBShorts(Image *image, size_t octets,\n                                               magick_uint16_t *data);\n\n  /*\n    Read a 32-bit little-endian unsigned \"long\" value from the file or BLOB.\n  */\n  extern MagickExport magick_uint32_t ReadBlobLSBLong(Image *image);\n\n  /*\n    Read a 32-bit little-endian signed \"long\" value from the file or BLOB.\n  */\n  extern MagickExport magick_int32_t ReadBlobLSBSignedLong(Image *image);\n\n  /*\n    Read an array of little-endian 32-bit \"long\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobLSBLongs(Image *image, size_t octets,\n                                              magick_uint32_t *data);\n\n  /*\n    Read a 32-bit big-endian unsigned \"long\" value from the file or BLOB.\n  */\n  extern MagickExport magick_uint32_t ReadBlobMSBLong(Image *image);\n\n  /*\n    Read a 32-bit big-endian signed \"long\" value from the file or BLOB.\n  */\n  extern MagickExport magick_int32_t ReadBlobMSBSignedLong(Image *image);\n\n  /*\n    Read an array of big-endian 32-bit \"long\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobMSBLongs(Image *image, size_t octets,\n                                              magick_uint32_t *data);\n\n  /*\n    Read a little-endian 32-bit \"float\" value from the file or BLOB.\n  */\n  extern MagickExport float ReadBlobLSBFloat(Image *image);\n\n  /*\n    Read an array of little-endian 32-bit \"float\" values from the file or\n    BLOB.\n  */\n  extern MagickExport size_t ReadBlobLSBFloats(Image *image, size_t octets,\n                                               float *data);\n\n  /*\n    Read a big-endian 32-bit \"float\" value from the file or BLOB.\n  */\n  extern MagickExport float ReadBlobMSBFloat(Image *image);\n\n  /*\n    Read an array of big-endian 32-bit \"float\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobMSBFloats(Image *image, size_t octets,\n                                               float *data);\n\n  /*\n    Read a little-endian 64-bit \"double\" value from the file or BLOB.\n  */\n  extern MagickExport double ReadBlobLSBDouble(Image *image);\n\n  /*\n    Read an array of little-endian 64-bit \"double\" values from the file or\n    BLOB.\n  */\n  extern MagickExport size_t ReadBlobLSBDoubles(Image *image, size_t octets,\n                                                double *data);\n\n  /*\n    Read a big-endian 64-bit \"double\" value from the file or BLOB.\n  */\n  extern MagickExport double ReadBlobMSBDouble(Image *image);\n\n  /*\n    Read an array of big-endian 64-bit \"double\" values from the file or BLOB.\n  */\n  extern MagickExport size_t ReadBlobMSBDoubles(Image *image, size_t octets,\n                                                double *data);\n\n  /*\n    Read a string from the file or blob until a newline character is read or\n    an end-of-file condition is encountered.\n  */\n  extern MagickExport char *ReadBlobString(Image *image,\n                                           char *string);\n\n  /*\n    Write a single byte to the file or BLOB.\n  */\n  extern MagickExport size_t WriteBlobByte(Image *image,\n                                           const magick_uint8_t value);\n\n  /*\n    Write the content of an entire disk file to the file or BLOB.\n  */\n  extern MagickExport MagickPassFail WriteBlobFile(Image *image,\n                                                   const char *filename);\n\n  /*\n    Write a 16-bit signed \"short\" value to the file or BLOB in little-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobLSBShort(Image *image,\n                                               const magick_uint16_t value);\n\n  /*\n    Write a 16-bit signed \"short\" value to the file or BLOB in little-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobLSBSignedShort(Image *image,\n                                                     const magick_int16_t value);\n\n  /*\n    Write a 32-bit unsigned \"long\" value to the file or BLOB in little-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobLSBLong(Image *image,\n                                              const magick_uint32_t value);\n\n  /*\n    Write a 32-bit signed \"long\" value to the file or BLOB in little-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobLSBSignedLong(Image *image,\n                                                    const magick_int32_t value);\n\n\n\n  /*\n    Write a 32-bit unsigned \"long\" value to the file or BLOB in big-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobMSBLong(Image *image,\n                                              const magick_uint32_t value);\n\n  /*\n    Write a 32-bit signed \"long\" value to the file or BLOB in big-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobMSBSignedLong(Image *image,\n                                                    const magick_int32_t value);\n\n  /*\n    Write a 16-bit unsigned \"short\" value to the file or BLOB in big-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobMSBShort(Image *image,\n                                               const magick_uint16_t value);\n\n  /*\n    Write a 16-bit signed \"short\" value to the file or BLOB in big-endian\n    order.\n  */\n  extern MagickExport size_t WriteBlobMSBSignedShort(Image *image,\n                                                     const magick_int16_t value);\n\n  /*\n    Write a C string to the file or BLOB, without the terminating NULL byte.\n  */\n  extern MagickExport size_t WriteBlobString(Image *image,\n                                             const char *string);\n\n  /*\n   *\n   * BLOB attribute access.\n   *\n   */\n\n  /*\n    Blob supports seek operations.  BlobSeek() and BlobTell() may safely be\n    used.\n  */\n  extern MagickExport MagickBool BlobIsSeekable(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    Allow file descriptor to be closed (if True).\n  */\n  extern MagickExport void SetBlobClosable(Image *image,\n                                           MagickBool closable);\n\n  /*\n    Blob is for a temporary file which should be deleted (if True).\n  */\n  extern MagickExport void SetBlobTemporary(Image *image,\n                                            MagickBool isTemporary);\n\n  /*\n    Returns MagickTrue if the file associated with the blob is a temporary\n    file and should be removed when the associated image is destroyed.\n  */\n  extern MagickExport MagickBool GetBlobTemporary(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n   *\n   * Memory mapped file support.\n   *\n   */\n\n  /*\n    Memory mapping modes.\n  */\n  typedef enum\n    {\n      ReadMode,             /* Map for read-only access */\n      WriteMode,            /* Map for write-only access (useless) */\n      IOMode                /* Map for read/write access */\n    } MapMode;\n\n  /*\n    Release memory mapping for a region.\n  */\n  extern MagickExport MagickPassFail UnmapBlob(void *map,\n                                               const size_t length);\n\n  /*\n    Perform a requested memory mapping of a file descriptor.\n  */\n  extern MagickExport void *MapBlob(int file,\n                                    const MapMode mode,\n                                    magick_off_t offset,\n                                    size_t length);\n\n  /*\n   *\n   * Buffer to File / File to Buffer functions.\n   *\n   */\n\n  /*\n    Writes a buffer to a named file.\n  */\n  extern MagickExport MagickPassFail BlobToFile(const char *filename,\n                                                const void *blob,\n                                                const size_t length,\n                                                ExceptionInfo *exception);\n\n  /*\n    Read the contents of a file into memory.\n  */\n  extern MagickExport void *FileToBlob(const char *filename,\n                                       size_t *length,\n                                       ExceptionInfo *exception);\n\n  /*\n   *\n   * Junk yet to be categorized.\n   *\n   */\n\n  /*\n    Reserve space for a specified output size.\n  */\n  extern MagickExport MagickPassFail BlobReserveSize(Image *image, magick_off_t size);\n\n  /*\n    Copies data from the input stream to a file.  Useful in case it is\n    necessary to perform seek operations on the input data.\n  */\n  extern MagickExport MagickPassFail ImageToFile(Image *image,\n                                                 const char *filename,\n                                                 ExceptionInfo *exception);\n\n  /*\n    Search for a configuration file (\".mgk\" file) using appropriate\n    rules and return as an in-memory buffer.\n  */\n  extern MagickExport void *GetConfigureBlob(const char *filename,\n                                             char *path,\n                                             size_t *length,\n                                             ExceptionInfo *exception);\n\n  /*\n    Converts a least-significant byte first buffer of integers to\n    most-significant byte first.\n  */\n  extern MagickExport void MSBOrderLong(unsigned char *buffer,\n                                        const size_t length);\n\n  /*\n    Converts a least-significant byte first buffer of integers to\n    most-significant byte first.\n  */\n  extern MagickExport void MSBOrderShort(unsigned char *p,\n                                         const size_t length);\n\n  /*\n    Checks if the blob of the specified image is referenced by other images. If\n    the reference count is higher then 1 a new blob is assigned to the image.\n  */\n  extern MagickExport void DisassociateBlob(Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/cdl.h",
    "content": "/*\n * Copyright (C) 2009 GraphicsMagick Group\n *\n * American Society of Cinematographers Color Decision List (ASC-CDL)\n * implementation.\n *\n * Original implementation by Clment Follet.\n */\n\n#ifndef _MAGICK_CDL_H\n#define _MAGICK_CDL_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif  /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport MagickPassFail\n  CdlImage(Image *image,const char *cdl);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_CDL_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/channel.h",
    "content": "/*\n  Copyright (C) 2004 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n*/\n#ifndef _MAGICK_CHANNEL_H\n#define _MAGICK_CHANNEL_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n\nextern MagickExport Image\n  *ExportImageChannel(const Image *image,\n                      const ChannelType channel,\n                      ExceptionInfo *exception);\n\nextern MagickExport unsigned int\n  GetImageChannelDepth(const Image *image,\n                       const ChannelType channel,\n                       ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  ChannelImage(Image *image,const ChannelType channel),\n  ImportImageChannel(const Image *src_image,\n                     Image *dst_image,\n                     const ChannelType channel),\n  ImportImageChannelsMasked(const Image *source_image,\n                            Image *update_image,\n                            const ChannelType channels),\n  SetImageChannelDepth(Image *image,\n                       const ChannelType channel,\n                       const unsigned int depth);\n\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_CHANNEL_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/color.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Color Utility Methods.\n*/\n#ifndef _MAGICK_COLOR_H\n#define _MAGICK_COLOR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  PixelPacket with usage count, used to support color histograms.\n*/\ntypedef struct _HistogramColorPacket\n{\n  PixelPacket\n    pixel;\n\n  unsigned long\n    count;\n} HistogramColorPacket;\n\nextern MagickExport HistogramColorPacket\n  *GetColorHistogram(const Image *image,unsigned long *colors,\n     ExceptionInfo *exception);\n\nextern MagickExport unsigned long\n  GetNumberColors(const Image *image,FILE *file,ExceptionInfo *exception);\n\nextern MagickExport void\n  GetColorTuple(const PixelPacket *color,const unsigned int depth,\n    const unsigned int matte,const unsigned int hex,char *tuple);\n\nextern MagickExport MagickBool\n  IsPaletteImage(const Image *image,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/color-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_COLOR_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/color_lookup.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Color Lookup Methods.\n*/\n#ifndef _MAGICK_COLOR_LOOKUP_H\n#define _MAGICK_COLOR_LOOKUP_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Specifications that color is compliant with.\n*/\ntypedef enum\n{\n  UndefinedCompliance = 0x0000,\n  NoCompliance = 0x0000,\n  SVGCompliance = 0x0001,\n  X11Compliance = 0x0002,\n  XPMCompliance = 0x0004,\n  AllCompliance = 0xffff\n} ComplianceType;\n\nextern MagickExport char\n  **GetColorList(const char *pattern,unsigned long *number_colors);\n\nextern MagickExport unsigned int\n  QueryColorDatabase(const char *name,PixelPacket *color,ExceptionInfo *exception),\n  QueryColorname(const Image *image,const PixelPacket *color,\n    const ComplianceType compliance,char *name,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/color_lookup-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_COLOR_LOOKUP_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/colormap.h",
    "content": "/*\n  Copyright (C) 2003 - 2019 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Colormap Methods\n*/\n#ifndef _MAGICK_COLORMAP_H\n#define _MAGICK_COLORMAP_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\nextern MagickExport MagickPassFail\n  AllocateImageColormap(Image *,const unsigned long colors),\n  CycleColormapImage(Image *image,const int amount),\n  ReallocateImageColormap(Image *,const unsigned int colors),\n  ReplaceImageColormap(Image *image,const PixelPacket *colormap,\n    const unsigned int colors),\n  SortColormapByIntensity(Image *image);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/colormap-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_COLORMAP_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/colorspace.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Colorspace Methods.\n*/\n#ifndef _MAGICK_COLORSPACE_H\n#define _MAGICK_COLORSPACE_H\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n\n#if (QuantumDepth == 8) || (QuantumDepth == 16)\n  /*\n    intensity=0.299*red+0.587*green+0.114*blue.\n    Premultiply by 1024 to obtain integral values, and then divide\n    result by 1024 by shifting to the right by 10 bits.\n  */\n#define PixelIntensityRec601(pixel) \\\n  ((unsigned int) \\\n   (((unsigned int) (pixel)->red*306U+ \\\n     (unsigned int) (pixel)->green*601U+ \\\n     (unsigned int) (pixel)->blue*117U) \\\n    >> 10U))\n#elif (QuantumDepth == 32)\n  /*\n    intensity=0.299*red+0.587*green+0.114*blue.\n  */\n#define PixelIntensityRec601(pixel) \\\n  ((unsigned int) \\\n   (((double)306.0*(pixel)->red+ \\\n     (double)601.0*(pixel)->green+ \\\n     (double)117.0*(pixel)->blue) \\\n    / 1024.0))\n#endif\n\n  /*\n    intensity=0.2126*red+0.7152*green+0.0722*blue\n  */\n#define PixelIntensityRec709(pixel) \\\n  ((unsigned int) \\\n   (0.2126*(pixel)->red+ \\\n    0.7152*(pixel)->green+ \\\n    0.0722*(pixel)->blue))\n\n#define PixelIntensity(pixel) PixelIntensityRec601(pixel)\n#define PixelIntensityToDouble(pixel) ((double)PixelIntensity(pixel))\n#define PixelIntensityToQuantum(pixel) ((Quantum)PixelIntensity(pixel))\n#define IsCMYKColorspace(colorspace) \\\n  ( \\\n    (colorspace == CMYKColorspace) \\\n  )\n#define IsGrayColorspace(colorspace) \\\n  ( \\\n    (colorspace == GRAYColorspace) || \\\n    (colorspace == Rec601LumaColorspace) || \\\n    (colorspace == Rec709LumaColorspace) \\\n  )\n#define IsRGBColorspace(colorspace) \\\n  ( \\\n    (IsGrayColorspace(colorspace)) || \\\n    (colorspace == RGBColorspace) || \\\n    (colorspace == TransparentColorspace) \\\n  )\n#define IsLABColorspace(colorspace) \\\n  ( \\\n    (colorspace == LABColorspace) \\\n  )\n#define IsRGBCompatibleColorspace(colorspace) \\\n  ( \\\n   (IsRGBColorspace(colorspace)) || \\\n   (colorspace == CineonLogRGBColorspace ) \\\n  )\n#define IsYCbCrColorspace(colorspace) \\\n  ( \\\n    (colorspace == YCbCrColorspace) || \\\n    (colorspace == Rec601YCbCrColorspace) || \\\n    (colorspace == Rec709YCbCrColorspace) \\\n  )\n\n#define YCbCrColorspace Rec601YCbCrColorspace\ntypedef enum\n{\n  UndefinedColorspace,\n  RGBColorspace,         /* Plain old RGB colorspace */\n  GRAYColorspace,        /* Plain old full-range grayscale */\n  TransparentColorspace, /* RGB but preserve matte channel during quantize */\n  OHTAColorspace,\n  XYZColorspace,         /* CIE XYZ */\n  YCCColorspace,         /* Kodak PhotoCD PhotoYCC */\n  YIQColorspace,\n  YPbPrColorspace,\n  YUVColorspace,\n  CMYKColorspace,        /* Cyan, magenta, yellow, black, alpha */\n  sRGBColorspace,        /* Kodak PhotoCD sRGB */\n  HSLColorspace,         /* Hue, saturation, luminosity */\n  HWBColorspace,         /* Hue, whiteness, blackness */\n  LABColorspace,         /* LAB colorspace not supported yet other than via lcms */\n  CineonLogRGBColorspace,/* RGB data with Cineon Log scaling, 2.048 density range */\n  Rec601LumaColorspace,  /* Luma (Y) according to ITU-R 601 */\n  Rec601YCbCrColorspace, /* YCbCr according to ITU-R 601 */\n  Rec709LumaColorspace,  /* Luma (Y) according to ITU-R 709 */\n  Rec709YCbCrColorspace  /* YCbCr according to ITU-R 709 */\n} ColorspaceType;\n\nextern MagickExport MagickPassFail\n  RGBTransformImage(ImagePtr,const ColorspaceType),\n  TransformColorspace(ImagePtr,const ColorspaceType),\n  TransformRGBImage(ImagePtr,const ColorspaceType);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_COLORSPACE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/command.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Image Command Methods.\n*/\n#ifndef _MAGICK_COMMAND_H\n#define _MAGICK_COMMAND_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\nextern MagickExport MagickPassFail\n  AnimateImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  BenchmarkImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  CompareImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  CompositeImageCommand(ImageInfo *image_info,int argc,char **argv,\n                        char **metadata,ExceptionInfo *exception),\n  ConjureImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  ConvertImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  DisplayImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  IdentifyImageCommand(ImageInfo *image_info,int argc,char **argv,\n                       char **metadata,ExceptionInfo *exception),\n  ImportImageCommand(ImageInfo *image_info,int argc,char **argv,\n                     char **metadata,ExceptionInfo *exception),\n  MagickCommand(ImageInfo *image_info,int argc,char **argv,\n                char **metadata,ExceptionInfo *exception),\n  MogrifyImage(const ImageInfo *,int,char **,Image **),\n  MogrifyImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  MogrifyImages(const ImageInfo *,int,char **,Image **),\n  MontageImageCommand(ImageInfo *image_info,int argc,char **argv,\n                      char **metadata,ExceptionInfo *exception),\n  TimeImageCommand(ImageInfo *image_info,int argc,char **argv,\n                   char **metadata,ExceptionInfo *exception);\n\nextern MagickExport int\n  GMCommand(int argc,char **argv);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/command-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/common.h",
    "content": "/*\n  Copyright (C) 2009-2016 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Magick API common definitions support.\n*/\n#ifndef _MAGICK_COMMON_H\n#define _MAGICK_COMMON_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n * Borland C++ Builder DLL compilation defines\n */\n#if defined(__BORLANDC__) && defined(_DLL)\n#  pragma message(\"BCBMagick lib DLL export interface\")\n#  define _MAGICKDLL_\n#  define _MAGICKLIB_\n#  undef BuildMagickModules\n#  define SupportMagickModules\n#endif\n\n#if defined(MSWINDOWS) && !defined(__CYGWIN__)\n#  if defined(_MT) && defined(_DLL) && !defined(_MAGICKDLL_) && !defined(_LIB)\n#    define _MAGICKDLL_\n#  endif\n#  if defined(_MAGICKDLL_)\n#    if defined(_VISUALC_)\n#      pragma warning( disable: 4273 )  /* Disable the dll linkage warnings */\n#    endif\n#    if !defined(_MAGICKLIB_)\n#      define MagickExport  __declspec(dllimport)\n#      if defined(_VISUALC_)\n#        pragma message( \"Magick lib DLL import interface\" )\n#      endif\n#    else\n#      define MagickExport  __declspec(dllexport)\n#      if defined(_VISUALC_)\n#         pragma message( \"Magick lib DLL export interface\" )\n#      endif\n#    endif\n#  else\n#    define MagickExport\n#    if defined(_VISUALC_)\n#      pragma message( \"Magick lib static interface\" )\n#    endif\n#  endif\n#  if defined(_DLL) && !defined(_LIB)\n#    define ModuleExport  __declspec(dllexport)\n#    if defined(_VISUALC_)\n#      pragma message( \"Magick module DLL export interface\" )\n#    endif\n#  else\n#    define ModuleExport\n#    if defined(_VISUALC_)\n#      pragma message( \"Magick module static interface\" )\n#    endif\n#  endif\n#  define MagickGlobal __declspec(thread)\n#  if defined(_VISUALC_)\n#    pragma warning(disable : 4018)\n#    pragma warning(disable : 4244)\n#    pragma warning(disable : 4244)\n#    pragma warning(disable : 4275) /* non dll-interface class 'foo' used as base for dll-interface class 'bar' */\n#    pragma warning(disable : 4800)\n#    pragma warning(disable : 4786)\n#    pragma warning(disable : 4996) /* function deprecation warnings */\n#  endif\n#else\n#  define MagickExport\n#  define ModuleExport\n#  define MagickGlobal\n#endif\n\n/*\n  This size is the default minimum string allocation size (heap or\n  stack) for a C string in GraphicsMagick.  The weird size is claimed\n  to be based on 2*FILENAME_MAX (not including terminating NULL) on\n  some antique system.  Linux has a FILENAME_MAX definition, but it is\n  4096 bytes.  Many OSs have path limits of 1024 bytes.\n\n  The FormatString() function assumes that the buffer it is writing to\n  has at least this many bytes remaining.\n*/\n#if !defined(MaxTextExtent)\n#  define MaxTextExtent  2053\n#endif\n\n#define MagickSignature  0xabacadabUL\n\n#define MagickPassFail unsigned int\n#define MagickPass     1\n#define MagickFail     0\n\n#define MagickBool     unsigned int\n#define MagickTrue     1\n#define MagickFalse    0\n\n/*\n  Support for __attribute__ was added in GCC 2.0.  It is not supported\n  in strict ANSI mode which is indicated by __STRICT_ANSI__ being\n  defined.\n\n  http://www.ohse.de/uwe/articles/gcc-attributes.html\n\n  Note that GCC 3.2 on MinGW does not define __GNUC__ or __GNUC_MINOR__.\n\n  Clang/llvm and GCC 5.0 support __has_attribute(attribute) to test if an\n  attribute is supported.  Clang/llvm supports __has_builtin(builtin) to test\n  if a builtin is supported.  Clang/llvm attempts to support most GCC\n  features.\n\n   __SANITIZE_ADDRESS__ is defined by GCC and Clang if -fsanitize=address is\n   supplied.\n\n   After incuding valgrind/memcheck.h or valgrind/valgrind.h, the macro\n   RUNNING_ON_VALGRIND can be used to test if the program is run under valgrind.\n   See http://valgrind.org/docs/manual/manual-core-adv.html.\n\n*/\n#if !defined(MAGICK_ATTRIBUTE)\n#  if ((!defined(__clang__)) && (!defined(__GNUC__) || (__GNUC__ < 2 || __STRICT_ANSI__)))\n#    define MAGICK_ATTRIBUTE(x) /*nothing*/\n#  else\n#    define MAGICK_ATTRIBUTE(x) __attribute__(x)\n#    if ((defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 5)) && !defined(__COVERITY__))\n#      define MAGICK_HAS_ATTRIBUTE(attribute) __has_attribute(attribute)\n#    else\n#      define MAGICK_HAS_ATTRIBUTE(attribute) (0)\n#    endif\n#    if (defined(__clang__) && !defined(__COVERITY__))\n#      define MAGICK_CLANG_HAS_BUILTIN(builtin) __has_builtin(builtin)\n#    else\n#      define MAGICK_CLANG_HAS_BUILTIN(builtin) (0)\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__deprecated__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))) /* 3.1+ */\n#      define MAGICK_FUNC_DEPRECATED MAGICK_ATTRIBUTE((__deprecated__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__malloc__)) || \\\n         (__GNUC__ >= 3))  /* 3.0+ */\n#      define MAGICK_FUNC_MALLOC MAGICK_ATTRIBUTE((__malloc__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__nonnull__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))))  /* 3.3+ */\n  /* Supports argument syntax like MAGICK_ATTRIBUTE((nonnull (1, 2))) but\n     don't know how to support non-GCC fallback. */\n#      define MAGICK_FUNC_NONNULL MAGICK_ATTRIBUTE((__nonnull__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__noreturn__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))) /* 2.5+ */\n#      define MAGICK_FUNC_NORETURN MAGICK_ATTRIBUTE((__noreturn__))\n#    endif\n  /* clang 3.0 seems to have difficulties with __has_attribute(__const__) but\n     clang 3.3 does not.  Just assume that it is supported for clang since\n     Linux headers are riddled with it. */\n#    if (defined(__clang__) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))) /* 2.5+ */\n#      define MAGICK_FUNC_CONST MAGICK_ATTRIBUTE((__const__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__pure__)) || \\\n         ((__GNUC__) >= 3)) /* 2.96+ */\n#      define MAGICK_FUNC_PURE MAGICK_ATTRIBUTE((__pure__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__unused__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))) /* 2.7+ */\n#      define MAGICK_FUNC_UNUSED MAGICK_ATTRIBUTE((__unused__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__warn_unused_result__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))))  /* 3.3+ */\n#      define MAGICK_FUNC_WARN_UNUSED_RESULT MAGICK_ATTRIBUTE((__warn_unused_result__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__noinline__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))  /* 3.4+ */\n#      define MAGICK_FUNC_NOINLINE MAGICK_ATTRIBUTE((__noinline__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__always_inline__)) || \\\n         (((__GNUC__) > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))  /* 3.4+ */\n#      define MAGICK_FUNC_ALWAYSINLINE MAGICK_ATTRIBUTE((__always_inline__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__alloc_size__)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))  /* 4.3+ */\n#      define MAGICK_FUNC_ALLOC_SIZE_1ARG(arg_num) MAGICK_ATTRIBUTE((__alloc_size__(arg_num)))\n#      define MAGICK_FUNC_ALLOC_SIZE_2ARG(arg_num1,arg_num2) MAGICK_ATTRIBUTE((__alloc_size__(arg_num1,arg_num2)))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__hot__)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))  /* 4.3+ */\n#      define MAGICK_FUNC_HOT MAGICK_ATTRIBUTE((__hot__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__cold__)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))  /* 4.3+ */\n#      define MAGICK_FUNC_COLD MAGICK_ATTRIBUTE((__cold__))\n#    endif\n#    if ((MAGICK_HAS_ATTRIBUTE(__optimize__)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))  /* 4.3+ */\n#      define MAGICK_OPTIMIZE_FUNC(opt) MAGICK_ATTRIBUTE((__optimize__ (opt)))\n#    endif\n  /*\n    GCC 7 and later support a fallthrough attribute to mark switch statement\n    cases which are intended to fall through.  Clang 3.5.0 supports a\n    clang::fallthrough statement attribute while Clang 10 supports the same\n    attribute as GCC 7.  Some compilers support a FALLTHROUGH (or FALLTHRU)\n    pre-processor comment.  C++ 17 supports a standard fallthrough attribute\n    of the form \"[[fallthrough]]\".  See\n    https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/,\n    https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html,\n    https://clang.llvm.org/docs/AttributeReference.html#fallthrough, and\n    https://releases.llvm.org/3.7.0/tools/clang/docs/AttributeReference.html#fallthrough-clang-fallthrough\n\n    Usage is to put \"MAGICK_FALLTHROUGH;\" where a \"break;\" would go.\n  */\n#    if ((MAGICK_HAS_ATTRIBUTE(__fallthrough__)) || \\\n         ((__GNUC__) >= 7))  /* 7+ */\n#      define MAGICK_FALLTHROUGH MAGICK_ATTRIBUTE((__fallthrough__))\n#    endif\n  /*\n    https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer#Introduction\n\n    To ignore certain functions, one can use the no_sanitize_address attribute\n    supported by Clang (3.3+) and GCC (4.8+).\n  */\n#    if ((MAGICK_HAS_ATTRIBUTE(__no_sanitize_address__)) ||       \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 8) && (__GNUC_MINOR__ >= 0))))  /* 4.8+ */\n#      define MAGICK_NO_SANITIZE_ADDRESS MAGICK_ATTRIBUTE((__no_sanitize_address__))\n#    endif\n#    if ((MAGICK_CLANG_HAS_BUILTIN(__builtin_assume_aligned)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))))  /* 4.7+ */\n#      define MAGICK_ASSUME_ALIGNED(exp,align) __builtin_assume_aligned(exp,align)\n#    endif\n#    if ((MAGICK_CLANG_HAS_BUILTIN(__builtin_assume_aligned)) || \\\n         (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))))  /* 4.7+ */\n#      define MAGICK_ASSUME_ALIGNED_OFFSET(exp,align,offset) __builtin_assume_aligned(exp,align,offset)\n#    endif\n#  endif\n#endif\n#if !defined(MAGICK_FUNC_DEPRECATED)\n#  define MAGICK_FUNC_DEPRECATED /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_MALLOC)\n#  define MAGICK_FUNC_MALLOC /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_NONNULL)\n#  define MAGICK_FUNC_NONNULL /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_NORETURN)\n#  define MAGICK_FUNC_NORETURN /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_CONST)\n#  define MAGICK_FUNC_CONST /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_PURE)\n#  define MAGICK_FUNC_PURE /*nothing*/\n#endif\n#if !defined (MAGICK_FUNC_UNUSED)\n#  define MAGICK_FUNC_UNUSED /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_WARN_UNUSED_RESULT)\n#  define MAGICK_FUNC_WARN_UNUSED_RESULT /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_NOINLINE)\n#  define MAGICK_FUNC_NOINLINE /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_ALWAYSINLINE)\n#  define MAGICK_FUNC_ALWAYSINLINE /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_ALLOC_SIZE_1ARG)\n#  define MAGICK_FUNC_ALLOC_SIZE_1ARG(arg_num) /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_ALLOC_SIZE_2ARG)\n#  define MAGICK_FUNC_ALLOC_SIZE_2ARG(arg_num1,arg_num2) /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_HOT)\n#  define MAGICK_FUNC_HOT  /*nothing*/\n#endif\n#if !defined(MAGICK_FUNC_COLD)\n#  define MAGICK_FUNC_COLD  /*nothing*/\n#endif\n#if !defined(MAGICK_OPTIMIZE_FUNC)\n#  define MAGICK_OPTIMIZE_FUNC(opt) /*nothing*/\n#endif\n#if !defined(MAGICK_FALLTHROUGH)\n#  define MAGICK_FALLTHROUGH /*nothing*/\n#endif\n#if !defined(MAGICK_ASSUME_ALIGNED)\n#  define MAGICK_ASSUME_ALIGNED(exp,align) (exp)\n#endif\n#if !defined(MAGICK_ASSUME_ALIGNED_OFFSET)\n#  define MAGICK_ASSUME_ALIGNED_OFFSET(exp,align,offset) (exp)\n#endif\n\n  /*\n    The isnan and isinf macros are defined by c99 but might not always be\n    available.  If they (or a substitute) are not available, then define them\n    to a false value.\n  */\n#if defined(isnan)\n#define MAGICK_ISNAN(d) isnan(d)\n#else\n#define MAGICK_ISNAN(d) (0)\n#endif\n#if defined(isinf)\n#define MAGICK_ISINF(d) isinf(d)\n#else\n#define MAGICK_ISINF(d) (0)\n#endif\n#if defined(isnormal)\n#define MAGICK_ISNORMAL(d) isnormal(d)\n#else\n#define MAGICK_ISNORMAL(d) (1)\n#endif\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_COMMON_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/compare.h",
    "content": "/*\n  Copyright (C) 2008 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Comparison Methods.\n*/\n#ifndef _MAGICK_COMPARE_H\n#define _MAGICK_COMPARE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Pixel differencing algorithms.\n*/\ntypedef enum\n{\n  UndefinedHighlightStyle,\n  AssignHighlightStyle,\n  ThresholdHighlightStyle,\n  TintHighlightStyle,\n  XorHighlightStyle\n} HighlightStyle;\n\ntypedef struct _DifferenceImageOptions\n{\n  ChannelType              channel; /* Channel(s) to difference */\n  HighlightStyle           highlight_style; /* Pixel annotation style */\n  PixelPacket              highlight_color; /* Changed pixel highlight color */\n} DifferenceImageOptions;\n\nextern MagickExport void\n  InitializeDifferenceImageOptions(DifferenceImageOptions *options,\n                                   ExceptionInfo *exception);\n\nextern MagickExport Image\n  *DifferenceImage(const Image *reference_image,const Image *compare_image,\n                   const DifferenceImageOptions *difference_options,\n                   ExceptionInfo *exception);\n\n/*\n  Pixel error metrics.\n*/\ntypedef enum\n{\n  UndefinedMetric,\n  MeanAbsoluteErrorMetric,\n  MeanSquaredErrorMetric,\n  PeakAbsoluteErrorMetric,\n  PeakSignalToNoiseRatioMetric,\n  RootMeanSquaredErrorMetric\n} MetricType;\n\n/*\n  Pixel difference statistics.\n*/\ntypedef struct _DifferenceStatistics\n{\n  double\n    red,\n    green,\n    blue,\n    opacity,\n    combined;\n} DifferenceStatistics;\n\nextern MagickExport void\n  InitializeDifferenceStatistics(DifferenceStatistics *difference_statistics,\n                                 ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  GetImageChannelDifference(const Image *reference_image,\n                            const Image *compare_image,\n                            const MetricType metric,\n                            DifferenceStatistics *statistics,\n                            ExceptionInfo *exception),\n  GetImageChannelDistortion(const Image *reference_image,\n                            const Image *compare_image,\n                            const ChannelType channel,\n                            const MetricType metric,\n                            double *distortion,\n                            ExceptionInfo *exception),\n  GetImageDistortion(const Image *reference_image,\n                     const Image *compare_image,\n                     const MetricType metric,\n                     double *distortion,\n                     ExceptionInfo *exception);\n\nextern MagickExport MagickBool\n  IsImagesEqual(Image *,const Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_COMPARE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/composite.h",
    "content": "/*\n  Copyright (C) 2003 - 2010 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Composite Methods.\n*/\n#ifndef _MAGICK_COMPOSITE_H\n#define _MAGICK_COMPOSITE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Special options required by some composition operators.\n*/\ntypedef struct _CompositeOptions_t\n{\n  /* ModulateComposite */\n  double            percent_brightness;\n\n  /* ThresholdComposite */\n  double            amount;\n  double            threshold;\n} CompositeOptions_t;\n\nextern MagickExport MagickPassFail\n  CompositeImage(Image *canvas_image,const CompositeOperator compose,\n                 const Image *update_image,\n                 const long x_offset,const long y_offset),\n  CompositeImageRegion(const CompositeOperator compose,\n                       const CompositeOptions_t *options,\n                       const unsigned long columns,\n                       const unsigned long rows,\n                       const Image *update_image,\n                       const long update_x,\n                       const long update_y,\n                       Image *canvas_image,\n                       const long canvas_x,\n                       const long canvas_y,\n                       ExceptionInfo *exception),\n  MagickCompositeImageUnderColor(Image *image,const PixelPacket *undercolor,\n                                 ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_COMPOSITE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/compress.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Image Compression/Decompression Methods.\n*/\n#ifndef _MAGICK_COMPRESS_H\n#define _MAGICK_COMPRESS_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Typedef declaration.\n*/\ntypedef struct _Ascii85Info\n{\n  long\n    offset,\n    line_break;\n\n  magick_uint8_t\n    buffer[10];\n} Ascii85Info;\n\n/*\n  TODO: Clean up the interface between BLOB write functions,\n  compression functions, and encoding functions so they\n  may be hooked into/stacked on top of each other. Most are\n  (or can be changed to be) stream based.\n*/\ntypedef unsigned int\n  (*WriteByteHook)(Image *, const magick_uint8_t, void *info);\n\n/*\n  Commonly used byte writer hooks.\n*/\nextern MagickExport unsigned int\n  Ascii85WriteByteHook(Image *image, const magick_uint8_t code, void *info),\n  BlobWriteByteHook(Image *image, const magick_uint8_t code, void *info);\n\n/*\n  Compress methods.\n*/\nextern MagickExport MagickPassFail\n  HuffmanDecodeImage(Image *image),\n  HuffmanEncodeImage(const ImageInfo *image_info,Image *image),\n  HuffmanEncode2Image(const ImageInfo *image_info,Image *image,WriteByteHook write_byte,void *info),\n  LZWEncodeImage(Image *image,const size_t length,magick_uint8_t *pixels),\n  LZWEncode2Image(Image *image,const size_t length,magick_uint8_t *pixels,WriteByteHook write_byte,void *info),\n  PackbitsEncodeImage(Image *image,const size_t length,magick_uint8_t *pixels),\n  PackbitsEncode2Image(Image *image,const size_t length,magick_uint8_t *pixels,WriteByteHook write_byte,void *info);\n\nextern MagickExport unsigned char\n  *ImageToHuffman2DBlob(const Image *image,const ImageInfo *image_info,\n     size_t *length,ExceptionInfo *exception),\n  *ImageToJPEGBlob(const Image *image,const ImageInfo *image_info,\n     size_t *length,ExceptionInfo *exception);\n\nextern MagickExport void\n  Ascii85Encode(Image *image,const magick_uint8_t code),\n  Ascii85Flush(Image *image),\n  Ascii85Initialize(Image *image);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/confirm_access.h",
    "content": "/*\n  Copyright (C) 2009 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Access Confirmation Methods.\n*/\n#ifndef _MAGICK_CONFIRM_ACCESS_H\n#define _MAGICK_CONFIRM_ACCESS_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  typedef enum\n    {\n      UndefinedConfirmAccessMode,\n      FileExecuteConfirmAccessMode, /* Path is to be opened for execution */\n      FileReadConfirmAccessMode,    /* Path is to be opened for read */\n      FileWriteConfirmAccessMode,   /* Path is to be opened for write */\n      URLGetFTPConfirmAccessMode,   /* ftp:// URL get */\n      URLGetFileConfirmAccessMode,  /* file:// URL get */\n      URLGetHTTPConfirmAccessMode   /* http:// URL get */\n    } ConfirmAccessMode;\n\n  typedef MagickPassFail\n  (*ConfirmAccessHandler)(const ConfirmAccessMode mode,\n                          const char *path,\n                          ExceptionInfo *exception);\n\n  extern MagickExport MagickPassFail\n  MagickConfirmAccess(const ConfirmAccessMode mode,\n                      const char *path,\n                      ExceptionInfo *exception);\n\n  extern MagickExport ConfirmAccessHandler\n  MagickSetConfirmAccessHandler(ConfirmAccessHandler handler);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_CONFIRM_ACCESS_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/constitute.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Constitute Methods.\n*/\n#ifndef _MAGICK_CONSTITUTE_H\n#define _MAGICK_CONSTITUTE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Quantum import/export types as used by ImportImagePixelArea() and\n  ExportImagePixelArea(). Values are imported or exported in network\n  byte order (\"big endian\") by default, but little endian may be\n  selected via the 'endian' option in ExportPixelAreaOptions and\n  ImportPixelAreaOptions.\n*/\ntypedef enum\n{\n  UndefinedQuantum,  /* Not specified */\n  IndexQuantum,      /* Colormap indexes */\n  GrayQuantum,       /* Grayscale values (minimum value is black) */\n  IndexAlphaQuantum, /* Colormap indexes with transparency */\n  GrayAlphaQuantum,  /* Grayscale values with transparency */\n  RedQuantum,        /* Red values only (RGBA) */\n  CyanQuantum,       /* Cyan values only (CMYKA) */\n  GreenQuantum,      /* Green values only (RGBA) */\n  YellowQuantum,     /* Yellow values only (CMYKA) */\n  BlueQuantum,       /* Blue values only (RGBA) */\n  MagentaQuantum,    /* Magenta values only (CMYKA) */\n  AlphaQuantum,      /* Transparency values (RGBA or CMYKA) */\n  BlackQuantum,      /* Black values only (CMYKA) */\n  RGBQuantum,        /* Red, green, and blue values */\n  RGBAQuantum,       /* Red, green, blue, and transparency values */\n  CMYKQuantum,       /* Cyan, magenta, yellow, and black values */\n  CMYKAQuantum,      /* Cyan, magenta, yellow, black, and transparency values */\n  CIEYQuantum,       /* CIE Y values, based on CCIR-709 primaries */\n  CIEXYZQuantum      /* CIE XYZ values, based on CCIR-709 primaries */\n} QuantumType;\n\n/*\n  Quantum sample type for when exporting/importing a pixel area.\n*/\ntypedef enum\n{\n  UndefinedQuantumSampleType, /* Not specified */\n  UnsignedQuantumSampleType,  /* Unsigned integral type (1-32 or 64 bits) */\n  FloatQuantumSampleType      /* Floating point type (16, 24, 32, or 64 bit) */\n} QuantumSampleType;\n\n/*\n  Quantum size types as used by ConstituteImage() and DispatchImage()/\n*/\ntypedef enum\n{\n  CharPixel,         /* Unsigned 8 bit 'unsigned char' */\n  ShortPixel,        /* Unsigned 16 bit 'unsigned short int' */\n  IntegerPixel,      /* Unsigned 32 bit 'unsigned int' */\n  LongPixel,         /* Unsigned 32 or 64 bit (CPU dependent) 'unsigned long' */\n  FloatPixel,        /* Floating point 32-bit 'float' */\n  DoublePixel        /* Floating point 64-bit 'double' */\n} StorageType;\n\n/*\n  Additional options for ExportImagePixelArea()\n*/\ntypedef struct _ExportPixelAreaOptions\n{\n  QuantumSampleType\n    sample_type;          /* Quantum sample type */\n\n  double\n    double_minvalue,      /* Minimum value (default 0.0) for linear floating point samples */\n    double_maxvalue;      /* Maximum value (default 1.0) for linear floating point samples */\n\n  MagickBool\n    grayscale_miniswhite; /* Grayscale minimum value is white rather than black */\n\n  unsigned long\n    pad_bytes;            /* Number of pad bytes to output after pixel data */\n\n  unsigned char\n    pad_value;            /* Value to use when padding end of pixel data */\n\n  EndianType\n    endian;               /* Endian orientation for 16/32/64 bit types (default MSBEndian) */\n\n  unsigned long\n    signature;\n} ExportPixelAreaOptions;\n\n/*\n  Optional results info for ExportImagePixelArea()\n*/\ntypedef struct _ExportPixelAreaInfo\n{\n  size_t\n    bytes_exported;       /* Number of bytes which were exported */\n\n} ExportPixelAreaInfo;\n\n/*\n  Additional options for ImportImagePixelArea()\n*/\ntypedef struct _ImportPixelAreaOptions\n{\n  QuantumSampleType\n    sample_type;          /* Quantum sample type */\n\n  double\n    double_minvalue,      /* Minimum value (default 0.0) for linear floating point samples */\n    double_maxvalue;      /* Maximum value (default 1.0) for linear floating point samples */\n\n  MagickBool\n    grayscale_miniswhite; /* Grayscale minimum value is white rather than black */\n\n  EndianType\n    endian;               /* Endian orientation for 16/32/64 bit types (default MSBEndian) */\n\n  unsigned long\n    signature;\n} ImportPixelAreaOptions;\n\n/*\n  Optional results info for ImportImagePixelArea()\n*/\ntypedef struct _ImportPixelAreaInfo\n{\n  size_t\n    bytes_imported;       /* Number of bytes which were imported */\n\n} ImportPixelAreaInfo;\n\nextern MagickExport const char\n  *StorageTypeToString(const StorageType storage_type),\n  *QuantumSampleTypeToString(const QuantumSampleType sample_type),\n  *QuantumTypeToString(const QuantumType quantum_type);\n\nextern MagickExport Image\n  *ConstituteImage(const unsigned long width,const unsigned long height,\n     const char *map,const StorageType type,const void *pixels,\n     ExceptionInfo *exception),\n  *ConstituteTextureImage(const unsigned long columns,const unsigned long rows,\n     const Image *texture,ExceptionInfo *exception),\n  *PingImage(const ImageInfo *image_info,ExceptionInfo *exception),\n  *ReadImage(const ImageInfo *image_info,ExceptionInfo *exception),\n  *ReadInlineImage(const ImageInfo *image_info,const char *content,\n     ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  DispatchImage(const Image *image,const long x_offset,const long y_offset,\n    const unsigned long columns,const unsigned long rows,const char *map,\n    const StorageType type,void *pixels,ExceptionInfo *exception),\n  ExportImagePixelArea(const Image *image,const QuantumType quantum_type,\n    const unsigned int quantum_size,unsigned char *destination,\n    const ExportPixelAreaOptions *options,ExportPixelAreaInfo *export_info),\n  ExportViewPixelArea(const ViewInfo *view,const QuantumType quantum_type,\n    const unsigned int quantum_size,unsigned char *destination,\n    const ExportPixelAreaOptions *options,ExportPixelAreaInfo *export_info);\n\nextern MagickExport MagickPassFail\n  ImportImagePixelArea(Image *image,const QuantumType quantum_type,\n    const unsigned int quantum_size,const unsigned char *source,\n    const ImportPixelAreaOptions *options,ImportPixelAreaInfo *import_info),\n  ImportViewPixelArea(ViewInfo *view,const QuantumType quantum_type,\n    const unsigned int quantum_size,const unsigned char *source,\n    const ImportPixelAreaOptions *options,ImportPixelAreaInfo *import_info),\n  WriteImage(const ImageInfo *image_info,Image *image),\n  WriteImages(const ImageInfo *image_info,Image *image,const char *filename,\n    ExceptionInfo *exception),\n  WriteImagesFile(const ImageInfo *image_info,Image *image,FILE * file,\n    ExceptionInfo *exception);\n\nextern MagickExport void\n  ExportPixelAreaOptionsInit(ExportPixelAreaOptions *options),\n  ImportPixelAreaOptionsInit(ImportPixelAreaOptions *options);\n\nextern MagickExport MagickPassFail\n  MagickFindRawImageMinMax(Image *image, EndianType endian,\n    unsigned long width, unsigned long height,StorageType type,\n    unsigned scanline_octets, void *scanline_buffer,\n    double *min, double *max);\n\nextern MagickExport unsigned int\n  MagickGetQuantumSamplesPerPixel(const QuantumType quantum_type) MAGICK_FUNC_CONST;\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/constitute-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_CONSTITUTE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/decorate.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Decorate Methods.\n*/\n#ifndef _MAGICK_DECORATE_H\n#define _MAGICK_DECORATE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *BorderImage(const Image *,const RectangleInfo *,ExceptionInfo *),\n  *FrameImage(const Image *,const FrameInfo *,ExceptionInfo *);\n\nMagickExport unsigned int\n  RaiseImage(Image *,const RectangleInfo *,const int);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_DECORATE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/delegate.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Methods to Read/Write/Invoke Delegates.\n*/\n#ifndef _MAGICK_DELEGATE_H\n#define _MAGICK_DELEGATE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Delegate structure definitions.\n*/\ntypedef struct _DelegateInfo\n{\n  char\n    *path,    /* Path to delegate configuation file */\n    *decode,  /* Decode from format */\n    *encode;  /* Transcode to format */\n\n  char\n    *commands; /* Commands to execute */\n\n  int mode;    /* <0 = encoder, >0 = decoder */\n\n  MagickBool\n    stealth;   /* Don't list this delegate */\n\n  unsigned long\n    signature;\n\n  struct _DelegateInfo\n    *previous,\n    *next;\n} DelegateInfo;\n\n/*\n  Magick delegate methods.\n*/\nextern MagickExport char\n  *GetDelegateCommand(const ImageInfo *image_info,Image *image,\n                      const char *decode,const char *encode,\n                      ExceptionInfo *exception);\n\nextern MagickExport const DelegateInfo\n  *GetDelegateInfo(const char *decode,const char *encode,\n                   ExceptionInfo *exception),\n  *GetPostscriptDelegateInfo(const ImageInfo *image_info,\n                   unsigned int *antialias, ExceptionInfo *exception);\n\nextern MagickExport DelegateInfo\n  *SetDelegateInfo(DelegateInfo *);\n\nextern MagickExport MagickPassFail\n  InvokePostscriptDelegate(const unsigned int verbose,const char *command,\n                           ExceptionInfo *exception),\n  InvokeDelegate(ImageInfo *image_info,Image *image,const char *decode,\n                 const char *encode,ExceptionInfo *exception),\n  ListDelegateInfo(FILE *file,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n\n#if defined(HasGS)\n#include \"ghostscript/iapi.h\"\n#endif\n\n#ifndef gs_main_instance_DEFINED\n# define gs_main_instance_DEFINED\ntypedef struct gs_main_instance_s gs_main_instance;\n#endif\n\n#if !defined(MagickDLLCall)\n#  if defined(MSWINDOWS)\n#    define MagickDLLCall __stdcall\n#  else\n#    define MagickDLLCall\n#  endif\n#endif\n\n/*\n  Define a vector of Ghostscript library callback functions so that\n  DLL/shared and static Ghostscript libbraries may be handled identically.\n  These definitions must be compatible with those in the Ghostscript API\n  headers (which we don't require).\n\n  http://pages.cs.wisc.edu/~ghost/doc/cvs/API.htm\n  */\ntypedef struct _GhostscriptVectors\n{\n  /* Exit the interpreter (gsapi_exit)*/\n  int  (MagickDLLCall *exit)(gs_main_instance *instance);\n\n  /* Destroy instance of Ghostscript.  Call exit first! (gsapi_delete_instance) */\n  void (MagickDLLCall *delete_instance)(gs_main_instance *instance);\n\n  /* Initialize the Ghostscript interpreter (gsapi_init_with_args) */\n  int  (MagickDLLCall *init_with_args)(gs_main_instance *instance,int argc,\n                                       char **argv);\n\n  /* Create a new instance of the Ghostscript interpreter (gsapi_new_instance) */\n  int  (MagickDLLCall *new_instance)(gs_main_instance **pinstance,\n                                     void *caller_handle);\n\n  /* Execute string command in Ghostscript interpreter (gsapi_run_string) */\n  int  (MagickDLLCall *run_string)(gs_main_instance *instance,const char *str,\n                                   int user_errors,int *pexit_code);\n} GhostscriptVectors;\n\nextern MagickExport void\n  DestroyDelegateInfo(void);\n\nextern MagickPassFail\n  InitializeDelegateInfo(void);\n\n#endif /* MAGICK_IMPLEMENTATION */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_DELEGATE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/deprecate.h",
    "content": "/*\n  Copyright (C) 2003, 2008 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Log methods.\n*/\n#ifndef _MAGICK_DEPRECATE_H\n#define _MAGICK_DEPRECATE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Legacy names for (possibly) large integral types\n  */\n\n#if !defined(ExtendedSignedIntegralType)\n#  define ExtendedSignedIntegralType magick_int64_t\n#endif\n#if !defined(ExtendedUnsignedIntegralType)\n#  define ExtendedUnsignedIntegralType magick_uint64_t\n#endif\n\n  /*\n    Compatibility definitions to handle the renaming of\n    ExtendedSignedIntegralType and ExtendedUnsignedIntegralType to\n    MagickSignedType and MagickUnsignedType which occured in ImageMagick\n    5.5.8.  ImageMagick 5.5.8 also introduced MagickRationalType.\n  */\n#if !defined(MagickSignedType)\n#  define MagickSignedType magick_int64_t\n#endif\n#if !defined(MagickUnsignedType)\n#  define MagickUnsignedType magick_uint64_t\n#endif\n#if !defined(MagickRationalType)\n#  if defined(HAVE_LONG_DOUBLE)\n#    define MagickRationalType long double\n#  else\n#    define MagickRationalType double\n#  endif\n#endif\n\n  extern MagickExport unsigned int\n  PopImagePixels(const Image *,const QuantumType,unsigned char *) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport unsigned int\n  PushImagePixels(Image *,const QuantumType,const unsigned char *) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport void\n  *AcquireMemory(const size_t) MAGICK_FUNC_DEPRECATED MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(1);\n\n  extern MagickExport void\n  *CloneMemory(void *,const void *,const size_t) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport void\n  LiberateMemory(void **) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport void\n  ReacquireMemory(void **,const size_t) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport const PixelPacket\n  *AcquireCacheView(ViewInfo *view,\n                    const long x,const long y,const unsigned long columns,\n                    const unsigned long rows,ExceptionInfo *exception) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport PixelPacket\n  *GetCacheView(ViewInfo *view,const long x,const long y,\n                const unsigned long columns,const unsigned long rows)  MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport PixelPacket\n  *SetCacheView(ViewInfo *view,const long x,const long y,\n                const unsigned long columns,const unsigned long rows) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport MagickPassFail\n  SyncCacheView(ViewInfo *view) MAGICK_FUNC_DEPRECATED;\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/describe.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Describe Methods.\n*/\n#ifndef _MAGICK_DESCRIBE_H\n#define _MAGICK_DESCRIBE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\nextern MagickExport MagickPassFail\n  DescribeImage(Image *image,FILE *file,const MagickBool verbose);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_DESCRIBE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/draw.h",
    "content": "/*\n  Copyright (C) 2003-2018 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Drawing API.\n\n  Usage synopsis:\n\n  DrawContext context;\n  context = DrawAllocateContext((DrawInfo*)NULL, image);\n    [ any number of drawing commands ]\n    DrawSetStrokeColorString(context,\"black\");\n    DrawSetFillColorString(context,\"#ff00ff\");\n    DrawSetStrokeWidth(context,4);\n    DrawRectangle(context,72,72,144,144);\n  DrawRender(context);\n  DrawDestroyContext(context);\n\n*/\n#ifndef _MAGICK_DRAW_H\n#define _MAGICK_DRAW_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/render.h\"\n\n\ntypedef struct _DrawContext *DrawContext;\n\nextern MagickExport ClipPathUnits\n  DrawGetClipUnits(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport DrawInfo\n  *DrawPeekGraphicContext(const DrawContext context);\n\nextern MagickExport DecorationType\n  DrawGetTextDecoration(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport DrawContext\n  DrawAllocateContext(const DrawInfo *draw_info, Image *image);\n\nextern MagickExport FillRule\n  DrawGetClipRule(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetFillRule(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport GravityType\n  DrawGetGravity(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport LineCap\n  DrawGetStrokeLineCap(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport LineJoin\n  DrawGetStrokeLineJoin(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport PixelPacket\n  DrawGetFillColor(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetStrokeColor(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetTextUnderColor(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport StretchType\n  DrawGetFontStretch(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport StyleType\n  DrawGetFontStyle(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport char\n  *DrawGetClipPath(DrawContext context),\n  *DrawGetFont(DrawContext context),\n  *DrawGetFontFamily(DrawContext context),\n  *DrawGetTextEncoding(DrawContext context);\n\nextern MagickExport int\n  DrawRender(const DrawContext context);\n\nextern MagickExport unsigned int\n  DrawGetStrokeAntialias(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetTextAntialias(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport unsigned long\n  DrawGetFontWeight(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetStrokeMiterLimit(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport double\n  DrawGetFillOpacity(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetFontSize(DrawContext context) MAGICK_FUNC_PURE,\n  *DrawGetStrokeDashArray(DrawContext context, unsigned long *num_elems),\n  DrawGetStrokeDashOffset(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetStrokeOpacity(DrawContext context) MAGICK_FUNC_PURE,\n  DrawGetStrokeWidth(DrawContext context) MAGICK_FUNC_PURE;\n\nextern MagickExport void\n  DrawAffine(DrawContext context, const AffineMatrix *affine),\n  DrawAnnotation(DrawContext context,\n    const double x, const double y,\n    const unsigned char *text),\n  DrawArc(DrawContext context,\n          const double sx, const double sy,\n          const double ex, const double ey,\n          const double sd, const double ed),\n  DrawBezier(DrawContext context,\n             const unsigned long num_coords, const PointInfo * coordinates),\n  DrawCircle(DrawContext context,\n             const double ox, const double oy,\n             const double px, const double py),\n  DrawColor(DrawContext context,\n            const double x, const double y,\n            const PaintMethod paintMethod),\n  DrawComment(DrawContext context,const char* comment),\n  DrawDestroyContext(DrawContext context),\n  DrawEllipse(DrawContext context,\n              const double ox, const double oy,\n              const double rx, const double ry,\n              const double start, const double end),\n  DrawComposite(DrawContext context,\n                const CompositeOperator composite_operator,\n                const double x, const double y,\n                const double width, const double height,\n                const Image * image ),\n  DrawLine(DrawContext context,\n           const double sx, const double sy,\n           const double ex, const double ey),\n  DrawMatte(DrawContext context,\n            const double x, const double y,\n            const PaintMethod paint_method),\n  DrawPathClose(DrawContext context),\n  DrawPathCurveToAbsolute(DrawContext context,\n                          const double x1, const double y1,\n                          const double x2, const double y2,\n                          const double x, const double y),\n  DrawPathCurveToRelative(DrawContext context,\n                          const double x1, const double y1,\n                          const double x2, const double y2,\n                          const double x, const double y),\n  DrawPathCurveToQuadraticBezierAbsolute(DrawContext context,\n                                         const double x1, const double y1,\n                                         const double x, const double y),\n  DrawPathCurveToQuadraticBezierRelative(DrawContext context,\n                                         const double x1, const double y1,\n                                         const double x, const double y),\n  DrawPathCurveToQuadraticBezierSmoothAbsolute(DrawContext context,\n                                               const double x, const double y),\n  DrawPathCurveToQuadraticBezierSmoothRelative(DrawContext context,\n                                               const double x, const double y),\n  DrawPathCurveToSmoothAbsolute(DrawContext context,\n                                const double x2, const double y2,\n                                const double x, const double y),\n  DrawPathCurveToSmoothRelative(DrawContext context,\n                                const double x2, const double y2,\n                                const double x, const double y),\n  DrawPathEllipticArcAbsolute(DrawContext context,\n                              const double rx, const double ry,\n                              const double x_axis_rotation,\n                              unsigned int large_arc_flag,\n                              unsigned int sweep_flag,\n                              const double x, const double y),\n  DrawPathEllipticArcRelative(DrawContext context,\n                              const double rx, const double ry,\n                              const double x_axis_rotation,\n                              unsigned int large_arc_flag,\n                              unsigned int sweep_flag,\n                              const double x, const double y),\n  DrawPathFinish(DrawContext context),\n  DrawPathLineToAbsolute(DrawContext context,\n                         const double x, const double y),\n  DrawPathLineToRelative(DrawContext context,\n                         const double x, const double y),\n  DrawPathLineToHorizontalAbsolute(DrawContext context, const double x),\n  DrawPathLineToHorizontalRelative(DrawContext context, const double x),\n  DrawPathLineToVerticalAbsolute(DrawContext context, const double y),\n  DrawPathLineToVerticalRelative(DrawContext context, const double y),\n  DrawPathMoveToAbsolute(DrawContext context,\n                         const double x, const double y),\n  DrawPathMoveToRelative(DrawContext context,\n                         const double x, const double y),\n  DrawPathStart(DrawContext context),\n  DrawPoint(DrawContext context, const double x, const double y),\n  DrawPolygon(DrawContext context,\n              const unsigned long num_coords, const PointInfo * coordinates),\n  DrawPolyline(DrawContext context,\n               const unsigned long num_coords, const PointInfo * coordinates),\n  DrawPopClipPath(DrawContext context),\n  DrawPopDefs(DrawContext context),\n  DrawPopGraphicContext(DrawContext context),\n  DrawPopPattern(DrawContext context),\n  DrawPushClipPath(DrawContext context, const char *clip_path_id),\n  DrawPushDefs(DrawContext context),\n  DrawPushGraphicContext(DrawContext context),\n  DrawPushPattern(DrawContext context,\n                  const char *pattern_id,\n                  const double x, const double y,\n                  const double width, const double height),\n  DrawRectangle(DrawContext context,\n                const double x1, const double y1,\n                const double x2, const double y2),\n  DrawRoundRectangle(DrawContext context,\n                     double x1, double y1,\n                     double x2, double y2,\n                     double rx, double ry),\n  DrawScale(DrawContext context, const double x, const double y),\n  DrawSetClipPath(DrawContext context, const char *clip_path),\n  DrawSetClipRule(DrawContext context, const FillRule fill_rule),\n  DrawSetClipUnits(DrawContext context, const ClipPathUnits clip_units),\n  DrawSetFillColor(DrawContext context, const PixelPacket *fill_color),\n  DrawSetFillColorString(DrawContext context, const char *fill_color),\n  DrawSetFillOpacity(DrawContext context, const double fill_opacity),\n  DrawSetFillRule(DrawContext context, const FillRule fill_rule),\n  DrawSetFillPatternURL(DrawContext context, const char *fill_url),\n  DrawSetFont(DrawContext context, const char *font_name),\n  DrawSetFontFamily(DrawContext context, const char *font_family),\n  DrawSetFontSize(DrawContext context, const double font_pointsize),\n  DrawSetFontStretch(DrawContext context, const StretchType font_stretch),\n  DrawSetFontStyle(DrawContext context, const StyleType font_style),\n  DrawSetFontWeight(DrawContext context, const unsigned long font_weight),\n  DrawSetGravity(DrawContext context, const GravityType gravity),\n  DrawRotate(DrawContext context, const double degrees),\n  DrawSkewX(DrawContext context, const double degrees),\n  DrawSkewY(DrawContext context, const double degrees),\n  /*\n   DrawSetStopColor(DrawContext context, const PixelPacket * color,\n                    const double offset),\n  */\n  DrawSetStrokeAntialias(DrawContext context, const unsigned int true_false),\n  DrawSetStrokeColor(DrawContext context, const PixelPacket *stroke_color),\n  DrawSetStrokeColorString(DrawContext context, const char *stroke_color),\n  DrawSetStrokeDashArray(DrawContext context, const unsigned long num_elems,\n                         const double *dasharray),\n  DrawSetStrokeDashOffset(DrawContext context,const double dashoffset),\n  DrawSetStrokeLineCap(DrawContext context, const LineCap linecap),\n  DrawSetStrokeLineJoin(DrawContext context, const LineJoin linejoin),\n  DrawSetStrokeMiterLimit(DrawContext context,const unsigned long miterlimit),\n  DrawSetStrokeOpacity(DrawContext context, const double opacity),\n  DrawSetStrokePatternURL(DrawContext context, const char* stroke_url),\n  DrawSetStrokeWidth(DrawContext context, const double width),\n  DrawSetTextAntialias(DrawContext context, const unsigned int true_false),\n  DrawSetTextDecoration(DrawContext context, const DecorationType decoration),\n  DrawSetTextEncoding(DrawContext context, const char *encoding),\n  DrawSetTextUnderColor(DrawContext context, const PixelPacket *color),\n  DrawSetTextUnderColorString(DrawContext context, const char *under_color),\n  DrawSetViewbox(DrawContext context,\n                 unsigned long x1, unsigned long y1,\n                 unsigned long x2, unsigned long y2),\n  DrawTranslate(DrawContext context, const double x, const double y);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/effect.h",
    "content": "/*\n  Copyright (C) 2003-2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Effect Methods.\n*/\n#ifndef _MAGICK_EFFECT_H\n#define _MAGICK_EFFECT_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *AdaptiveThresholdImage(const Image *,const unsigned long,const unsigned long,\n     const double,ExceptionInfo *),\n  *AddNoiseImage(const Image *,const NoiseType,ExceptionInfo *),\n  *AddNoiseImageChannel(const Image *image,const ChannelType channel,\n     const NoiseType noise_type,ExceptionInfo *exception),\n  *BlurImage(const Image *,const double,const double,ExceptionInfo *),\n  *BlurImageChannel(const Image *image,const ChannelType channel,\n     const double radius,const double sigma,ExceptionInfo *exception),\n  *ConvolveImage(const Image *,const unsigned int,const double *,\n     ExceptionInfo *),\n  *DespeckleImage(const Image *,ExceptionInfo *),\n  *EdgeImage(const Image *,const double,ExceptionInfo *),\n  *EmbossImage(const Image *,const double,const double,ExceptionInfo *),\n  *EnhanceImage(const Image *,ExceptionInfo *),\n  *GaussianBlurImage(const Image *,const double,const double,ExceptionInfo *),\n  *GaussianBlurImageChannel(const Image *image,\n     const ChannelType channel,const double radius,const double sigma,\n   ExceptionInfo *exception),\n  *MedianFilterImage(const Image *,const double,ExceptionInfo *),\n  *MotionBlurImage(const Image *,const double,const double,const double,\n     ExceptionInfo *),\n  *ReduceNoiseImage(const Image *,const double,ExceptionInfo *),\n  *ShadeImage(const Image *,const unsigned int,double,double,ExceptionInfo *),\n  *SharpenImage(const Image *,const double,const double,ExceptionInfo *),\n  *SharpenImageChannel(const Image *image,const ChannelType channel,\n     const double radius,const double sigma,ExceptionInfo *exception),\n  *SpreadImage(const Image *,const unsigned int,ExceptionInfo *),\n  *UnsharpMaskImage(const Image *,const double,const double,const double,\n                    const double,ExceptionInfo *),\n  *UnsharpMaskImageChannel(const Image *image,\n     const ChannelType channel,const double radius,const double sigma,\n     const double amount,const double threshold,\n     ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  BlackThresholdImage(Image *image,const char *thresholds),\n  ChannelThresholdImage(Image *,const char *),\n  RandomChannelThresholdImage(Image *,const char *,const char *,\n      ExceptionInfo *exception),\n  ThresholdImage(Image *,const double),\n  WhiteThresholdImage(Image *image,const char *thresholds);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_EFFECT_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/enhance.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Enhancement Methods.\n*/\n#ifndef _MAGICK_ENHANCE_H\n#define _MAGICK_ENHANCE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif  /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport MagickPassFail\n  ContrastImage(Image *,const unsigned int),\n  EqualizeImage(Image *),\n  GammaImage(Image *,const char *),\n  LevelImage(Image *,const char *),\n  LevelImageChannel(Image *,const ChannelType,const double,const double,\n    const double),\n  ModulateImage(Image *,const char *),\n  NegateImage(Image *,const unsigned int),\n  NormalizeImage(Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_ENHANCE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/error.h",
    "content": "/*\n  Copyright (C) 2003-2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Exception Methods.\n*/\n#ifndef _MAGICK_ERROR_H\n#define _MAGICK_ERROR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UndefinedExceptionBase = 0,\n  ExceptionBase = 1,\n  ResourceBase = 2,\n  ResourceLimitBase = 2,\n  TypeBase = 5,\n  AnnotateBase = 5,\n  OptionBase = 10,\n  DelegateBase = 15,\n  MissingDelegateBase = 20,\n  CorruptImageBase = 25,\n  FileOpenBase = 30,\n  BlobBase = 35,\n  StreamBase = 40,\n  CacheBase = 45,\n  CoderBase = 50,\n  ModuleBase = 55,\n  DrawBase = 60,\n  RenderBase = 60,\n  ImageBase = 65,\n  WandBase = 67,\n  TemporaryFileBase = 70,\n  TransformBase = 75,\n  XServerBase = 80,\n  X11Base = 81,\n  UserBase = 82,\n  MonitorBase = 85,\n  LocaleBase = 86,\n  DeprecateBase = 87,\n  RegistryBase = 90,\n  ConfigureBase = 95\n} ExceptionBaseType;\n\ntypedef enum\n{\n  UndefinedException = 0,\n  EventException = 100,\n  ExceptionEvent = EventException + ExceptionBase,\n  ResourceEvent = EventException + ResourceBase,\n  ResourceLimitEvent = EventException + ResourceLimitBase,\n  TypeEvent = EventException + TypeBase,\n  AnnotateEvent = EventException + AnnotateBase,\n  OptionEvent = EventException + OptionBase,\n  DelegateEvent = EventException + DelegateBase,\n  MissingDelegateEvent = EventException + MissingDelegateBase,\n  CorruptImageEvent = EventException + CorruptImageBase,\n  FileOpenEvent = EventException + FileOpenBase,\n  BlobEvent = EventException + BlobBase,\n  StreamEvent = EventException + StreamBase,\n  CacheEvent = EventException + CacheBase,\n  CoderEvent = EventException + CoderBase,\n  ModuleEvent = EventException + ModuleBase,\n  DrawEvent = EventException + DrawBase,\n  RenderEvent = EventException + RenderBase,\n  ImageEvent = EventException + ImageBase,\n  WandEvent = EventException + WandBase,\n  TemporaryFileEvent = EventException + TemporaryFileBase,\n  TransformEvent = EventException + TransformBase,\n  XServerEvent = EventException + XServerBase,\n  X11Event = EventException + X11Base,\n  UserEvent = EventException + UserBase,\n  MonitorEvent = EventException + MonitorBase,\n  LocaleEvent = EventException + LocaleBase,\n  DeprecateEvent = EventException + DeprecateBase,\n  RegistryEvent = EventException + RegistryBase,\n  ConfigureEvent = EventException + ConfigureBase,\n\n  WarningException = 300,\n  ExceptionWarning = WarningException + ExceptionBase,\n  ResourceWarning = WarningException + ResourceBase,\n  ResourceLimitWarning = WarningException + ResourceLimitBase,\n  TypeWarning = WarningException + TypeBase,\n  AnnotateWarning = WarningException + AnnotateBase,\n  OptionWarning = WarningException + OptionBase,\n  DelegateWarning = WarningException + DelegateBase,\n  MissingDelegateWarning = WarningException + MissingDelegateBase,\n  CorruptImageWarning = WarningException + CorruptImageBase,\n  FileOpenWarning = WarningException + FileOpenBase,\n  BlobWarning = WarningException + BlobBase,\n  StreamWarning = WarningException + StreamBase,\n  CacheWarning = WarningException + CacheBase,\n  CoderWarning = WarningException + CoderBase,\n  ModuleWarning = WarningException + ModuleBase,\n  DrawWarning = WarningException + DrawBase,\n  RenderWarning = WarningException + RenderBase,\n  ImageWarning = WarningException + ImageBase,\n  WandWarning = WarningException + WandBase,\n  TemporaryFileWarning = WarningException + TemporaryFileBase,\n  TransformWarning = WarningException + TransformBase,\n  XServerWarning = WarningException + XServerBase,\n  X11Warning = WarningException + X11Base,\n  UserWarning = WarningException + UserBase,\n  MonitorWarning = WarningException + MonitorBase,\n  LocaleWarning = WarningException + LocaleBase,\n  DeprecateWarning = WarningException + DeprecateBase,\n  RegistryWarning = WarningException + RegistryBase,\n  ConfigureWarning = WarningException + ConfigureBase,\n\n  ErrorException = 400,\n  ExceptionError = ErrorException + ExceptionBase,\n  ResourceError = ErrorException + ResourceBase,\n  ResourceLimitError = ErrorException + ResourceLimitBase,\n  TypeError = ErrorException + TypeBase,\n  AnnotateError = ErrorException + AnnotateBase,\n  OptionError = ErrorException + OptionBase,\n  DelegateError = ErrorException + DelegateBase,\n  MissingDelegateError = ErrorException + MissingDelegateBase,\n  CorruptImageError = ErrorException + CorruptImageBase,\n  FileOpenError = ErrorException + FileOpenBase,\n  BlobError = ErrorException + BlobBase,\n  StreamError = ErrorException + StreamBase,\n  CacheError = ErrorException + CacheBase,\n  CoderError = ErrorException + CoderBase,\n  ModuleError = ErrorException + ModuleBase,\n  DrawError = ErrorException + DrawBase,\n  RenderError = ErrorException + RenderBase,\n  ImageError = ErrorException + ImageBase,\n  WandError = ErrorException + WandBase,\n  TemporaryFileError = ErrorException + TemporaryFileBase,\n  TransformError = ErrorException + TransformBase,\n  XServerError = ErrorException + XServerBase,\n  X11Error = ErrorException + X11Base,\n  UserError = ErrorException + UserBase,\n  MonitorError = ErrorException + MonitorBase,\n  LocaleError = ErrorException + LocaleBase,\n  DeprecateError = ErrorException + DeprecateBase,\n  RegistryError = ErrorException + RegistryBase,\n  ConfigureError = ErrorException + ConfigureBase,\n\n  FatalErrorException = 700,\n  ExceptionFatalError = FatalErrorException + ExceptionBase,\n  ResourceFatalError = FatalErrorException + ResourceBase,\n  ResourceLimitFatalError = FatalErrorException + ResourceLimitBase,\n  TypeFatalError = FatalErrorException + TypeBase,\n  AnnotateFatalError = FatalErrorException + AnnotateBase,\n  OptionFatalError = FatalErrorException + OptionBase,\n  DelegateFatalError = FatalErrorException + DelegateBase,\n  MissingDelegateFatalError = FatalErrorException + MissingDelegateBase,\n  CorruptImageFatalError = FatalErrorException + CorruptImageBase,\n  FileOpenFatalError = FatalErrorException + FileOpenBase,\n  BlobFatalError = FatalErrorException + BlobBase,\n  StreamFatalError = FatalErrorException + StreamBase,\n  CacheFatalError = FatalErrorException + CacheBase,\n  CoderFatalError = FatalErrorException + CoderBase,\n  ModuleFatalError = FatalErrorException + ModuleBase,\n  DrawFatalError = FatalErrorException + DrawBase,\n  RenderFatalError = FatalErrorException + RenderBase,\n  ImageFatalError = FatalErrorException + ImageBase,\n  WandFatalError = FatalErrorException + WandBase,\n  TemporaryFileFatalError = FatalErrorException + TemporaryFileBase,\n  TransformFatalError = FatalErrorException + TransformBase,\n  XServerFatalError = FatalErrorException + XServerBase,\n  X11FatalError = FatalErrorException + X11Base,\n  UserFatalError = FatalErrorException + UserBase,\n  MonitorFatalError = FatalErrorException + MonitorBase,\n  LocaleFatalError = FatalErrorException + LocaleBase,\n  DeprecateFatalError = FatalErrorException + DeprecateBase,\n  RegistryFatalError = FatalErrorException + RegistryBase,\n  ConfigureFatalError = FatalErrorException + ConfigureBase\n} ExceptionType;\n\n/*\n  Typedef declarations.\n*/\n\n/*\n  ExceptionInfo is used to report exceptions to higher level routines,\n  and to the user.\n*/\ntypedef struct _ExceptionInfo\n{\n  /*\n    Exception severity, reason, and description\n  */\n  ExceptionType\n    severity;\n\n  char\n    *reason,\n    *description;\n\n  /*\n    Value of errno (or equivalent) when exception was thrown.\n  */\n  int\n    error_number;\n\n  /*\n    Reporting source module, function (if available), and source\n    module line.\n  */\n  char\n    *module,\n    *function;\n\n  unsigned long\n    line;\n\n  /*\n    Structure sanity check\n  */\n  unsigned long\n    signature;\n} ExceptionInfo;\n\n/*\n  Exception typedef declarations.\n*/\ntypedef void\n  (*ErrorHandler)(const ExceptionType,const char *,const char *);\n\ntypedef void\n  (*FatalErrorHandler)(const ExceptionType,const char *,const char *) MAGICK_FUNC_NORETURN;\n\ntypedef void\n  (*WarningHandler)(const ExceptionType,const char *,const char *);\n\n/*\n  Exception declarations.\n*/\nextern MagickExport const char\n  *GetLocaleExceptionMessage(const ExceptionType,const char *),\n  *GetLocaleMessage(const char *);\n\nextern MagickExport ErrorHandler\n  SetErrorHandler(ErrorHandler);\n\nextern MagickExport FatalErrorHandler\n  SetFatalErrorHandler(FatalErrorHandler);\n\nextern MagickExport void\n  CatchException(const ExceptionInfo *),\n  CopyException(ExceptionInfo *copy, const ExceptionInfo *original),\n  DestroyExceptionInfo(ExceptionInfo *),\n  GetExceptionInfo(ExceptionInfo *),\n  MagickError(const ExceptionType,const char *,const char *),\n  MagickFatalError(const ExceptionType,const char *,const char *) MAGICK_FUNC_NORETURN,\n  MagickWarning(const ExceptionType,const char *,const char *),\n  _MagickError(const ExceptionType,const char *,const char *),\n  _MagickFatalError(const ExceptionType,const char *,const char *) MAGICK_FUNC_NORETURN,\n  _MagickWarning(const ExceptionType,const char *,const char *),\n  SetExceptionInfo(ExceptionInfo *,ExceptionType),\n  ThrowException(ExceptionInfo *,const ExceptionType,const char *,const char *),\n  ThrowLoggedException(ExceptionInfo *exception, const ExceptionType severity,\n    const char *reason,const char *description,const char *module,\n    const char *function,const unsigned long line);\n\nextern MagickExport WarningHandler\n  SetWarningHandler(WarningHandler);\n\n/*\n  Exception define definitions.\n*/\n\n#include <magick/log.h>\n\n#if defined(MAGICK_IMPLEMENTATION)\n\n#  include \"magick/error-private.h\"\n\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* !defined(_MAGICK_ERROR_H) */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/forward.h",
    "content": "/*\n  Copyright (C) 2007 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Forward declarations for types used in public structures.\n\n*/\n#ifndef _MAGICK_FORWARD_H\n#define _MAGICK_FORWARD_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\ntypedef struct _Image *ImagePtr;\n\ntypedef struct _Ascii85Info* _Ascii85InfoPtr_;\n\ntypedef struct _BlobInfo* _BlobInfoPtr_;\n\ntypedef struct _CacheInfo* _CacheInfoPtr_;\n\ntypedef struct _ImageAttribute* _ImageAttributePtr_;\n\ntypedef struct _SemaphoreInfo* _SemaphoreInfoPtr_;\n\ntypedef struct _ThreadViewSet* _ThreadViewSetPtr_;\n\ntypedef void *ViewInfo;\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_FORWARD_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/fx.h",
    "content": "/*\n  Copyright (C) 2003-2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image FX Methods.\n*/\n#ifndef _MAGICK_FX_H\n#define _MAGICK_FX_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif  /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *CharcoalImage(const Image *,const double,const double,ExceptionInfo *),\n  *ColorizeImage(const Image *,const char *,const PixelPacket,ExceptionInfo *),\n  *ImplodeImage(const Image *,const double,ExceptionInfo *),\n  *MorphImages(const Image *,const unsigned long,ExceptionInfo *),\n  *OilPaintImage(const Image *,const double,ExceptionInfo *),\n  *SteganoImage(const Image *,const Image *,ExceptionInfo *),\n  *StereoImage(const Image *,const Image *,ExceptionInfo *),\n  *SwirlImage(const Image *,double,ExceptionInfo *),\n  *WaveImage(const Image *,const double,const double,ExceptionInfo *);\n\nextern MagickExport MagickPassFail\n  ColorMatrixImage(Image *image,const unsigned int order,const double *matrix),\n  SolarizeImage(Image *,const double);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_FX_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/gem.h",
    "content": "/*\n  Copyright (C) 2003-2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Graphic Gems - Graphic Support Methods.\n*/\n#ifndef _MAGICK_GEM_H\n#define _MAGICK_GEM_H\n\n#include \"magick/random.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Graphic gems define declarations.\n*/\nextern MagickExport double\n  ExpandAffine(const AffineMatrix *),\n  GenerateDifferentialNoise(const Quantum pixel,const NoiseType noise_type,\n    MagickRandomKernel *kernel);\n\nextern MagickExport int\n  GetOptimalKernelWidth(const double,const double),\n  GetOptimalKernelWidth1D(const double,const double),\n  GetOptimalKernelWidth2D(const double,const double);\n\n\nextern MagickExport Quantum\n  GenerateNoise(const Quantum,const NoiseType);\n\nextern MagickExport void\n  Contrast(const int,Quantum *,Quantum *,Quantum *),\n  HSLTransform(const double,const double,const double,Quantum *,Quantum *,\n    Quantum *),\n  HWBTransform(const double,const double,const double,Quantum *,Quantum *,\n    Quantum *),\n  Hull(const long,const long,const unsigned long,const unsigned long,Quantum *,\n    Quantum *,const int),\n  IdentityAffine(AffineMatrix *),\n  Modulate(const double,const double,const double,Quantum *,Quantum *,\n    Quantum *),\n  TransformHSL(const Quantum,const Quantum,const Quantum,double *,double *,\n    double *),\n  TransformHWB(const Quantum,const Quantum,const Quantum,double *,double *,\n    double *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/gradient.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Gradient Image Methods.\n*/\n#ifndef _MAGICK_GRADIENT_H\n#define _MAGICK_GRADIENT_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n\f\nextern MagickExport MagickPassFail\n  GradientImage(Image *,const PixelPacket *,const PixelPacket *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_GRADIENT_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/hclut.h",
    "content": "/*\n  Copyright (C) 2009 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Hald CLUT implementation\n\n*/\n#ifndef _MAGICK_HCLUT_H\n#define _MAGICK_HCLUT_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif  /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport MagickPassFail\n  HaldClutImage(Image *,const Image * clut);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_HCLUT_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/image.h",
    "content": "/*\n  Copyright (C) 2003 - 2019 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Methods.\n*/\n#ifndef _MAGICK_IMAGE_H\n#define _MAGICK_IMAGE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/forward.h\"\n#include \"magick/colorspace.h\"\n#include \"magick/error.h\"\n#include \"magick/timer.h\"\n\f\n/*\n  Define declarations.\n*/\n#if !defined(QuantumDepth)\n#  define QuantumDepth  16\n#endif\n\n/*\n  Maximum unsigned RGB value which fits in the specified bits\n\n  If bits <= 0, then zero is returned.  If bits exceeds bits in unsigned long,\n  then max value of unsigned long is returned.\n*/\n#define MaxValueGivenBits(bits) ((unsigned long) \\\n                                 (((int) bits <= 0) ? 0 :               \\\n                                   ((0x01UL << (Min(sizeof(unsigned long)*8U,(size_t)bits)-1)) + \\\n                                    ((0x01UL << (Min(sizeof(unsigned long)*8U,(size_t)bits)-1))-1))))\n\n#if (QuantumDepth == 8)\n#  define MaxColormapSize  256U\n#  define MaxMap  255U\n#  define MaxMapDepth 8\n#  define MaxMapFloat 255.0f\n#  define MaxMapDouble 255.0\n#  define MaxRGB  255U\n#  define MaxRGBFloat 255.0f\n#  define MaxRGBDouble 255.0\n#  define ScaleCharToMap(value)        ((unsigned char) (value))\n#  define ScaleCharToQuantum(value)    ((Quantum) (value))\n#  define ScaleLongToQuantum(value)    ((Quantum) ((value)/16843009UL))\n#  define ScaleMapToChar(value)        ((unsigned int) (value))\n#  define ScaleMapToQuantum(value)     ((Quantum) (value))\n#  define ScaleQuantum(quantum)        ((unsigned long) (quantum))\n#  define ScaleQuantumToChar(quantum)  ((unsigned char) (quantum))\n#  define ScaleQuantumToLong(quantum)  ((unsigned long) (16843009UL*(quantum)))\n#  define ScaleQuantumToMap(quantum)   ((unsigned char) (quantum))\n#  define ScaleQuantumToShort(quantum) ((unsigned short) (257U*(quantum)))\n#  define ScaleShortToQuantum(value)   ((Quantum) ((value)/257U))\n#  define ScaleToQuantum(value)        ((unsigned long) (value))\n#  define ScaleQuantumToIndex(value)   ((unsigned char) (value))\n   typedef unsigned char Quantum;\n#elif (QuantumDepth == 16)\n#  define MaxColormapSize  65536U\n#  define MaxMap 65535U\n#  define MaxMapDepth 16\n#  define MaxMapFloat 65535.0f\n#  define MaxMapDouble 65535.0\n#  define MaxRGB  65535U\n#  define MaxRGBFloat 65535.0f\n#  define MaxRGBDouble 65535.0\n#  define ScaleCharToMap(value)        ((unsigned short) (257U*(value)))\n#  define ScaleCharToQuantum(value)    ((Quantum) (257U*(value)))\n#  define ScaleLongToQuantum(value)    ((Quantum) ((value)/65537UL))\n#  define ScaleMapToChar(value)        ((unsigned int) ((value)/257U))\n#  define ScaleMapToQuantum(value)     ((Quantum) (value))\n#  define ScaleQuantum(quantum)        ((unsigned long) ((quantum)/257UL))\n#  define ScaleQuantumToChar(quantum)  ((unsigned char) ((quantum)/257U))\n#  define ScaleQuantumToLong(quantum)  ((unsigned long) (65537UL*(quantum)))\n#  define ScaleQuantumToMap(quantum)   ((unsigned short) (quantum))\n#  define ScaleQuantumToShort(quantum) ((unsigned short) (quantum))\n#  define ScaleShortToQuantum(value)   ((Quantum) (value))\n#  define ScaleToQuantum(value)        ((unsigned long) (257UL*(value)))\n#  define ScaleQuantumToIndex(value)   ((unsigned short) (value))\n   typedef unsigned short Quantum;\n#elif (QuantumDepth == 32)\n#  define MaxColormapSize  65536U\n#  define MaxRGB  4294967295U\n#  define MaxRGBFloat 4294967295.0f\n#  define MaxRGBDouble 4294967295.0\n#  define ScaleCharToQuantum(value)    ((Quantum) (16843009U*(value)))\n#  define ScaleLongToQuantum(value)    ((Quantum) ((value)))\n#  define ScaleQuantum(quantum)        ((unsigned long) ((quantum)/16843009UL))\n#  define ScaleQuantumToChar(quantum)  ((unsigned char) ((quantum)/16843009U))\n#  define ScaleQuantumToLong(quantum)  ((unsigned long) (quantum))\n#  define ScaleQuantumToShort(quantum) ((unsigned short) ((quantum)/65537U))\n#  define ScaleShortToQuantum(value)   ((Quantum) (65537U*(value)))\n#  define ScaleToQuantum(value)        ((unsigned long) (16843009UL*(value)))\n#  define ScaleQuantumToIndex(value)   ((unsigned short) ((value)/65537U))\n\n/*\n  MaxMap defines the maximum index value for algorithms which depend\n  on lookup tables (e.g. colorspace transformations and\n  normalization). When MaxMap is less than MaxRGB it is necessary to\n  downscale samples to fit the range of MaxMap. The number of bits\n  which are effectively preserved depends on the size of MaxMap.\n  MaxMap should be a multiple of 255 and no larger than MaxRGB.  Note\n  that tables can become quite large and as the tables grow larger it\n  may take more time to compute the table than to process the image.\n*/\n#define MaxMap 65535U\n#define MaxMapDepth 16\n#define MaxMapFloat 65535.0f\n#define MaxMapDouble 65535.0\n#if MaxMap == 65535U\n#  define ScaleCharToMap(value)        ((unsigned short) (257U*(value)))\n#  define ScaleMapToChar(value)        ((unsigned int) ((value)/257U))\n#  define ScaleMapToQuantum(value)     ((Quantum) (65537U*(value)))\n#  define ScaleQuantumToMap(quantum)   ((unsigned short) ((quantum)/65537U))\n#else\n#  define ScaleCharToMap(value)        ((unsigned short) ((MaxMap/255U)*(value)))\n#  define ScaleMapToChar(value)        ((unsigned int) ((value)/(MaxMap/255U)))\n#  define ScaleMapToQuantum(value)     ((Quantum) ((MaxRGB/MaxMap)*(value)))\n#  define ScaleQuantumToMap(quantum)   ((unsigned short) ((quantum)/(MaxRGB/MaxMap)))\n#endif\ntypedef unsigned int Quantum;\n#else\n#  error \"Specified value of QuantumDepth is not supported\"\n#endif\n\n#define OpaqueOpacity  0UL\n#define TransparentOpacity  MaxRGB\n#define RoundDoubleToQuantum(value) ((Quantum) (value < 0.0 ? 0U : \\\n  (value > MaxRGBDouble) ? MaxRGB : value + 0.5))\n#define RoundFloatToQuantum(value) ((Quantum) (value < 0.0f ? 0U : \\\n  (value > MaxRGBFloat) ? MaxRGB : value + 0.5f))\n#define ConstrainToRange(min,max,value) (value < min ? min :    \\\n  (value > max) ? max : value)\n#define ConstrainToQuantum(value) ConstrainToRange(0,MaxRGB,value)\n#define ScaleAnyToQuantum(x,max_value) \\\n  ((Quantum) (((double) MaxRGBDouble*x)/max_value+0.5))\n#define MagickBoolToString(value) (value != MagickFalse ? \"True\" : \"False\")\n\n/*\n  Return MagickTrue if channel is enabled in channels.  Allows using\n  code to adapt if ChannelType enumeration is changed to bit masks.\n*/\n#define MagickChannelEnabled(channels,channel) ((channels == AllChannels) || (channels == channel))\n\n/*\n  Deprecated defines.\n*/\n#define RunlengthEncodedCompression RLECompression\n#define RoundSignedToQuantum(value) RoundDoubleToQuantum(value)\n#define RoundToQuantum(value) RoundDoubleToQuantum(value)\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UnspecifiedAlpha,\n  AssociatedAlpha,\n  UnassociatedAlpha\n} AlphaType;\n\ntypedef enum\n{\n  UndefinedChannel,\n  RedChannel,     /* RGB Red channel */\n  CyanChannel,    /* CMYK Cyan channel */\n  GreenChannel,   /* RGB Green channel */\n  MagentaChannel, /* CMYK Magenta channel */\n  BlueChannel,    /* RGB Blue channel */\n  YellowChannel,  /* CMYK Yellow channel */\n  OpacityChannel, /* Opacity channel */\n  BlackChannel,   /* CMYK Black (K) channel */\n  MatteChannel,   /* Same as Opacity channel (deprecated) */\n  AllChannels,    /* Color channels */\n  GrayChannel     /* Color channels represent an intensity. */\n} ChannelType;\n\ntypedef enum\n{\n  UndefinedClass,\n  DirectClass,\n  PseudoClass\n} ClassType;\n\ntypedef enum\n{\n  UndefinedCompositeOp = 0,\n  OverCompositeOp,\n  InCompositeOp,\n  OutCompositeOp,\n  AtopCompositeOp,\n  XorCompositeOp,\n  PlusCompositeOp,\n  MinusCompositeOp,\n  AddCompositeOp,\n  SubtractCompositeOp,\n  DifferenceCompositeOp,\n  MultiplyCompositeOp,\n  BumpmapCompositeOp,\n  CopyCompositeOp,\n  CopyRedCompositeOp,\n  CopyGreenCompositeOp,\n  CopyBlueCompositeOp,\n  CopyOpacityCompositeOp,\n  ClearCompositeOp,\n  DissolveCompositeOp,\n  DisplaceCompositeOp,\n  ModulateCompositeOp,\n  ThresholdCompositeOp,\n  NoCompositeOp,\n  DarkenCompositeOp,\n  LightenCompositeOp,\n  HueCompositeOp,\n  SaturateCompositeOp,\n  ColorizeCompositeOp,\n  LuminizeCompositeOp,\n  ScreenCompositeOp,\n  OverlayCompositeOp,\n  CopyCyanCompositeOp,\n  CopyMagentaCompositeOp,\n  CopyYellowCompositeOp,\n  CopyBlackCompositeOp,\n  DivideCompositeOp,\n  HardLightCompositeOp,\n  ExclusionCompositeOp,\n  ColorDodgeCompositeOp,\n  ColorBurnCompositeOp,\n  SoftLightCompositeOp,\n  LinearBurnCompositeOp,\n  LinearDodgeCompositeOp,\n  LinearLightCompositeOp,\n  VividLightCompositeOp,\n  PinLightCompositeOp,\n  HardMixCompositeOp\n} CompositeOperator;\n\ntypedef enum\n{\n  UndefinedCompression,\n  NoCompression,\n  BZipCompression,\n  FaxCompression,\n  Group3Compression = FaxCompression,\n  Group4Compression,\n  JPEGCompression,\n  LosslessJPEGCompression,\n  LZWCompression,\n  RLECompression,\n  ZipCompression,\n  LZMACompression,              /* Lempel-Ziv-Markov chain algorithm */\n  JPEG2000Compression,          /* ISO/IEC std 15444-1 */\n  JBIG1Compression,             /* ISO/IEC std 11544 / ITU-T rec T.82 */\n  JBIG2Compression,             /* ISO/IEC std 14492 / ITU-T rec T.88 */\n  ZSTDCompression,              /* Facebook's Zstandard compression */\n  WebPCompression               /* Google's WebP compression */\n} CompressionType;\n\ntypedef enum\n{\n  UndefinedDispose,\n  NoneDispose,\n  BackgroundDispose,\n  PreviousDispose\n} DisposeType;\n\ntypedef enum\n{\n  UndefinedEndian,\n  LSBEndian,            /* \"little\" endian */\n  MSBEndian,            /* \"big\" endian */\n  NativeEndian          /* native endian */\n} EndianType;\n\ntypedef enum\n{\n  UndefinedFilter,\n  PointFilter,\n  BoxFilter,\n  TriangleFilter,\n  HermiteFilter,\n  HanningFilter,\n  HammingFilter,\n  BlackmanFilter,\n  GaussianFilter,\n  QuadraticFilter,\n  CubicFilter,\n  CatromFilter,\n  MitchellFilter,\n  LanczosFilter,\n  BesselFilter,\n  SincFilter\n} FilterTypes;\n\ntypedef enum\n{\n#undef NoValue\n  NoValue      = 0x00000,\n#undef XValue\n  XValue       = 0x00001,\n#undef YValue\n  YValue       = 0x00002,\n#undef WidthValue\n  WidthValue   = 0x00004,\n#undef HeightValue\n  HeightValue  = 0x00008,\n#undef AllValues\n  AllValues    = 0x0000F,\n#undef XNegative\n  XNegative    = 0x00010,\n#undef YNegative\n  YNegative    = 0x00020,\n  PercentValue = 0x01000, /* % */\n  AspectValue  = 0x02000, /* ! */\n  LessValue    = 0x04000, /* < */\n  GreaterValue = 0x08000, /* > */\n  AreaValue    = 0x10000, /* @  */\n  MinimumValue = 0x20000  /* ^ */\n} GeometryFlags;\n\ntypedef enum\n{\n#undef ForgetGravity\n  ForgetGravity,\n#undef NorthWestGravity\n  NorthWestGravity,\n#undef NorthGravity\n  NorthGravity,\n#undef NorthEastGravity\n  NorthEastGravity,\n#undef WestGravity\n  WestGravity,\n#undef CenterGravity\n  CenterGravity,\n#undef EastGravity\n  EastGravity,\n#undef SouthWestGravity\n  SouthWestGravity,\n#undef SouthGravity\n  SouthGravity,\n#undef SouthEastGravity\n  SouthEastGravity,\n#undef StaticGravity\n  StaticGravity\n} GravityType;\n\ntypedef enum\n{\n  UndefinedType,\n  BilevelType,\n  GrayscaleType,\n  GrayscaleMatteType,\n  PaletteType,\n  PaletteMatteType,\n  TrueColorType,\n  TrueColorMatteType,\n  ColorSeparationType,\n  ColorSeparationMatteType,\n  OptimizeType\n} ImageType;\n\ntypedef enum\n{\n  UndefinedInterlace,\n  NoInterlace,\n  LineInterlace,\n  PlaneInterlace,\n  PartitionInterlace\n} InterlaceType;\n\ntypedef enum\n{\n  UndefinedMode,\n  FrameMode,\n  UnframeMode,\n  ConcatenateMode\n} MontageMode;\n\ntypedef enum\n{\n  UniformNoise,\n  GaussianNoise,\n  MultiplicativeGaussianNoise,\n  ImpulseNoise,\n  LaplacianNoise,\n  PoissonNoise,\n  /* Below added on 2012-03-17 */\n  RandomNoise,\n  UndefinedNoise\n} NoiseType;\n\n/*\n  Image orientation.  Based on TIFF standard values (also EXIF).\n*/\ntypedef enum               /*    Exif     /  Row 0   / Column 0 */\n                           /* Orientation /  edge    /   edge   */\n{                          /* ----------- / -------- / -------- */\n  UndefinedOrientation,    /*      0      / Unknown  / Unknown  */\n  TopLeftOrientation,      /*      1      / Left     / Top      */\n  TopRightOrientation,     /*      2      / Right    / Top      */\n  BottomRightOrientation,  /*      3      / Right    / Bottom   */\n  BottomLeftOrientation,   /*      4      / Left     / Bottom   */\n  LeftTopOrientation,      /*      5      / Top      / Left     */\n  RightTopOrientation,     /*      6      / Top      / Right    */\n  RightBottomOrientation,  /*      7      / Bottom   / Right    */\n  LeftBottomOrientation    /*      8      / Bottom   / Left     */\n} OrientationType;\n\ntypedef enum\n{\n  UndefinedPreview = 0,\n  RotatePreview,\n  ShearPreview,\n  RollPreview,\n  HuePreview,\n  SaturationPreview,\n  BrightnessPreview,\n  GammaPreview,\n  SpiffPreview,\n  DullPreview,\n  GrayscalePreview,\n  QuantizePreview,\n  DespecklePreview,\n  ReduceNoisePreview,\n  AddNoisePreview,\n  SharpenPreview,\n  BlurPreview,\n  ThresholdPreview,\n  EdgeDetectPreview,\n  SpreadPreview,\n  SolarizePreview,\n  ShadePreview,\n  RaisePreview,\n  SegmentPreview,\n  SwirlPreview,\n  ImplodePreview,\n  WavePreview,\n  OilPaintPreview,\n  CharcoalDrawingPreview,\n  JPEGPreview\n} PreviewType;\n\ntypedef enum\n{\n  UndefinedIntent,\n  SaturationIntent,\n  PerceptualIntent,\n  AbsoluteIntent,\n  RelativeIntent\n} RenderingIntent;\n\ntypedef enum\n{\n  UndefinedResolution,\n  PixelsPerInchResolution,\n  PixelsPerCentimeterResolution\n} ResolutionType;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _AffineMatrix\n{\n  double\n    sx,\n    rx,\n    ry,\n    sy,\n    tx,\n    ty;\n} AffineMatrix;\n\ntypedef struct _PrimaryInfo\n{\n  double\n    x,\n    y,\n    z;\n} PrimaryInfo;\n\ntypedef struct _ChromaticityInfo\n{\n  PrimaryInfo\n    red_primary,\n    green_primary,\n    blue_primary,\n    white_point;\n} ChromaticityInfo;\n\n#if defined(MAGICK_IMPLEMENTATION)\n/*\n  Useful macros for accessing PixelPacket members in a generic way.\n*/\n# define GetRedSample(p) ((p)->red)\n# define GetGreenSample(p) ((p)->green)\n# define GetBlueSample(p) ((p)->blue)\n# define GetOpacitySample(p) ((p)->opacity)\n\n# define SetRedSample(q,value) ((q)->red=(value))\n# define SetGreenSample(q,value) ((q)->green=(value))\n# define SetBlueSample(q,value) ((q)->blue=(value))\n# define SetOpacitySample(q,value) ((q)->opacity=(value))\n\n# define GetGraySample(p) ((p)->red)\n# define SetGraySample(q,value) ((q)->red=(q)->green=(q)->blue=(value))\n\n# define GetYSample(p) ((p)->red)\n# define GetCbSample(p) ((p)->green)\n# define GetCrSample(p) ((p)->blue)\n\n# define SetYSample(q,value) ((q)->red=(value))\n# define SetCbSample(q,value) ((q)->green=(value))\n# define SetCrSample(q,value) ((q)->blue=(value))\n\n# define GetCyanSample(p) ((p)->red)\n# define GetMagentaSample(p) ((p)->green)\n# define GetYellowSample(p) ((p)->blue)\n# define GetBlackSample(p) ((p)->opacity)\n\n# define SetCyanSample(q,value) ((q)->red=(value))\n# define SetMagentaSample(q,value) ((q)->green=(value))\n# define SetYellowSample(q,value) ((q)->blue=(value))\n# define SetBlackSample(q,value) ((q)->opacity=(value))\n\n# define ClearPixelPacket(q) ((q)->red=(q)->green=(q)->blue=(q)->opacity=0)\n\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\ntypedef struct _PixelPacket\n{\n#if defined(WORDS_BIGENDIAN)\n  /* RGBA */\n#define MAGICK_PIXELS_RGBA 1\n  Quantum\n    red,\n    green,\n    blue,\n    opacity;\n#else\n  /* BGRA (as used by Microsoft Windows DIB) */\n#define MAGICK_PIXELS_BGRA 1\n  Quantum\n    blue,\n    green,\n    red,\n    opacity;\n#endif\n} PixelPacket;\n\ntypedef struct _DoublePixelPacket\n{\n  double\n    red,\n    green,\n    blue,\n    opacity;\n} DoublePixelPacket;\n\ntypedef struct _FloatPixelPacket\n{\n  float\n    red,\n    green,\n    blue,\n    opacity;\n} FloatPixelPacket;\n\n/*\n  ErrorInfo is used to record statistical difference (error)\n  information based on computed Euclidean distance in RGB space.\n*/\ntypedef struct _ErrorInfo\n{\n  double\n    mean_error_per_pixel,     /* Average error per pixel (absolute range) */\n    normalized_mean_error,    /* Average error per pixel (normalized to 1.0) */\n    normalized_maximum_error; /* Maximum error encountered (normalized to 1.0) */\n} ErrorInfo;\n\ntypedef struct _FrameInfo\n{\n  unsigned long\n    width,\n    height;\n\n  long\n    x,\n    y,\n    inner_bevel,\n    outer_bevel;\n} FrameInfo;\n\ntypedef Quantum IndexPacket;\n\ntypedef struct _LongPixelPacket\n{\n  unsigned long\n    red,\n    green,\n    blue,\n    opacity;\n} LongPixelPacket;\n\ntypedef struct _MontageInfo\n{\n  char\n    *geometry,\n    *tile,\n    *title,\n    *frame,\n    *texture,\n    *font;\n\n  double\n    pointsize;\n\n  unsigned long\n    border_width;\n\n  unsigned int\n    shadow;\n\n  PixelPacket\n    fill,\n    stroke,\n    background_color,\n    border_color,\n    matte_color;\n\n  GravityType\n    gravity;\n\n  char\n    filename[MaxTextExtent];\n\n  unsigned long\n    signature;\n} MontageInfo;\n\ntypedef struct _ProfileInfo\n{\n  size_t\n    length;\n\n  char\n    *name;\n\n  unsigned char\n    *info;\n} ProfileInfo;\n\ntypedef struct _RectangleInfo\n{\n  unsigned long\n    width,\n    height;\n\n  long\n    x,\n    y;\n} RectangleInfo;\n\ntypedef struct _SegmentInfo\n{\n  double\n    x1,\n    y1,\n    x2,\n    y2;\n} SegmentInfo;\n\nstruct _ImageExtra;  /* forward decl.; see member \"extra\" below */\n\ntypedef struct _Image\n{\n  ClassType\n    storage_class;      /* DirectClass (TrueColor) or PseudoClass (colormapped) */\n\n  ColorspaceType\n    colorspace;         /* Current image colorspace/model */\n\n  CompressionType\n    compression;        /* Compression algorithm to use when encoding image */\n\n  MagickBool\n    dither,             /* True if image is to be dithered */\n    matte;              /* True if image has an opacity (alpha) channel */\n\n  unsigned long\n    columns,            /* Number of image columns */\n    rows;               /* Number of image rows */\n\n  unsigned int\n    colors,             /* Current number of colors in PseudoClass colormap */\n    depth;              /* Bits of precision to preserve in color quantum */\n\n  PixelPacket\n    *colormap;          /* Pseudoclass colormap array */\n\n  PixelPacket\n    background_color,   /* Background color */\n    border_color,       /* Border color */\n    matte_color;        /* Matte (transparent) color */\n\n  double\n    gamma;              /* Image gamma (e.g. 0.45) */\n\n  ChromaticityInfo\n    chromaticity;       /* Red, green, blue, and white chromaticity values */\n\n  OrientationType\n    orientation;        /* Image orientation */\n\n  RenderingIntent\n    rendering_intent;   /* Rendering intent */\n\n  ResolutionType\n    units;              /* Units of image resolution (density) */\n\n  char\n    *montage,           /* Tile size and offset within an image montage */\n    *directory,         /* Tile names from within an image montage */\n    *geometry;          /* Composite/Crop options */\n\n  long\n    offset;             /* Offset to start of image data */\n\n  double\n    x_resolution,       /* Horizontal resolution (also see units) */\n    y_resolution;       /* Vertical resolution (also see units) */\n\n  RectangleInfo\n    page,               /* Offset to apply when placing image */\n    tile_info;          /* Subregion tile dimensions and offset */\n\n  double\n    blur,               /* Amount of blur to apply when zooming image */\n    fuzz;               /* Colors within this distance match target color */\n\n  FilterTypes\n    filter;             /* Filter to use when zooming image */\n\n  InterlaceType\n    interlace;          /* Interlace pattern to use when writing image */\n\n  EndianType\n    endian;             /* Byte order to use when writing image */\n\n  GravityType\n    gravity;            /* Image placement gravity */\n\n  CompositeOperator\n    compose;            /* Image placement composition (default OverCompositeOp) */\n\n  DisposeType\n    dispose;            /* GIF disposal option */\n\n  unsigned long\n    scene,              /* Animation frame scene number */\n    delay,              /* Animation frame scene delay */\n    iterations,         /* Animation iterations */\n    total_colors;       /* Number of unique colors. See GetNumberColors() */\n\n  long\n    start_loop;         /* Animation frame number to start looping at */\n\n  ErrorInfo\n    error;              /* Computed image comparison or quantization error */\n\n  TimerInfo\n    timer;              /* Operation micro-timer */\n\n  void\n    *client_data;       /* User specified opaque data pointer */\n\n  /*\n    Output file name.\n\n    A colon delimited format identifier may be prepended to the file\n    name in order to force a particular output format. Otherwise the\n    file extension is used. If no format prefix or file extension is\n    present, then the output format is determined by the 'magick'\n    field.\n  */\n  char\n    filename[MaxTextExtent];\n\n  /*\n    Original file name (name of input image file)\n  */\n  char\n    magick_filename[MaxTextExtent];\n\n  /*\n    File format of the input file, and the default output format.\n\n    The precedence when selecting the output format is:\n      1) magick prefix to file name (e.g. \"jpeg:foo).\n      2) file name extension. (e.g. \"foo.jpg\")\n      3) content of this magick field.\n\n  */\n  char\n    magick[MaxTextExtent];\n\n  /*\n    Original image width (before transformations)\n  */\n  unsigned long\n    magick_columns;\n\n  /*\n    Original image height (before transformations)\n  */\n  unsigned long\n    magick_rows;\n\n  ExceptionInfo\n    exception;          /* Any error associated with this image frame */\n\n  struct _Image\n    *previous,          /* Pointer to previous frame */\n    *next;              /* Pointer to next frame */\n\n  /*\n    To be added here for a later release:\n\n    quality?\n    subsampling\n    video black/white setup levels (ReferenceBlack/ReferenceWhite)\n    sample format (integer/float)\n   */\n\n  /*\n    Only private members appear past this point\n  */\n\n  void                  /* Private, Embedded profiles */\n    *profiles;\n\n  unsigned int\n    is_monochrome,      /* Private, True if image is known to be monochrome */\n    is_grayscale,       /* Private, True if image is known to be grayscale */\n    taint;              /* Private, True if image has not been modifed */\n\n  /*\n    Allow for expansion of Image without increasing its size.  The\n    internals are defined only in image.c.  Clients outside of image.c\n    can access the internals via the provided access functions (see below).\n\n    This location in Image used to be occupied by Image *clip_mask. The\n    clip_mask member now lives in _ImageExtra.\n  */\n  struct _ImageExtra\n    *extra;\n\n  MagickBool\n    ping;               /* Private, if true, pixels are undefined */\n\n  _CacheInfoPtr_\n    cache;              /* Private, image pixel cache */\n\n  _ThreadViewSetPtr_\n    default_views;      /* Private, default cache views */\n\n  _ImageAttributePtr_\n    attributes;         /* Private, Image attribute list */\n\n  _Ascii85InfoPtr_\n    ascii85;            /* Private, supports huffman encoding */\n\n  _BlobInfoPtr_\n    blob;               /* Private, file I/O object */\n\n  long\n    reference_count;    /* Private, Image reference count */\n\n  _SemaphoreInfoPtr_\n    semaphore;          /* Private, Per image lock (for reference count) */\n\n  unsigned int\n    logging;            /* Private, True if logging is enabled */\n\n  struct _Image\n    *list;              /* Private, used only by display */\n\n  unsigned long\n    signature;          /* Private, Unique code to validate structure */\n} Image;\n\ntypedef struct _ImageInfo\n{\n  CompressionType\n    compression;             /* Image compression to use while decoding */\n\n  MagickBool\n    temporary,               /* Remove file \"filename\" once it has been read. */\n    adjoin,                  /* If True, join multiple frames into one file */\n    antialias;               /* If True, antialias while rendering */\n\n  unsigned long\n    subimage,                /* Starting image scene ID to select */\n    subrange,                /* Span of image scene IDs (from starting scene) to select */\n    depth;                   /* Number of quantum bits to preserve while encoding */\n\n  char\n    *size,                   /* Desired/known dimensions to use when decoding image */\n    *tile,                   /* Deprecated, name of image to tile on background */\n    *page;                   /* Output page size & offset */\n\n  InterlaceType\n    interlace;               /* Interlace scheme to use when decoding image */\n\n  EndianType\n    endian;                  /* Select MSB/LSB endian output for TIFF format */\n\n  ResolutionType\n    units;                   /* Units to apply when evaluating the density option */\n\n  unsigned long\n    quality;                 /* Compression quality factor (format specific) */\n\n  char\n    *sampling_factor,        /* JPEG, MPEG, and YUV chroma downsample factor */\n    *server_name,            /* X11 server display specification */\n    *font,                   /* Font name to use for text annotations */\n    *texture,                /* Name of texture image to use for background fills */\n    *density;                /* Image resolution (also see units) */\n\n  double\n    pointsize;               /* Font pointsize */\n\n  double\n    fuzz;                    /* Colors within this distance are a match */\n\n  PixelPacket\n    pen,                     /* Stroke or fill color while drawing */\n    background_color,        /* Background color */\n    border_color,            /* Border color (color surrounding frame) */\n    matte_color;             /* Matte color (frame color) */\n\n  MagickBool\n    dither,                  /* If true, dither image while writing */\n    monochrome,              /* If true, use monochrome format */\n    progress;                /* If true, show progress indication */\n\n  ColorspaceType\n    colorspace;              /* Colorspace representations of image pixels */\n\n  ImageType\n    type;                    /* Desired image type (used while reading or writing) */\n\n  long\n    group;                   /* X11 window group ID */\n\n  unsigned int\n    verbose;                 /* If non-zero, display high-level processing */\n\n  char\n    *view,                   /* FlashPIX view specification */\n    *authenticate;           /* Password used to decrypt file */\n\n  void\n    *client_data;            /* User-specified data to pass to coder */\n\n  FILE\n    *file;                   /* If not null, stdio FILE * to read image from\n                                (fopen mode \"rb\") or write image to (fopen\n                                mode \"rb+\"). */\n\n  char\n    magick[MaxTextExtent],   /* File format to read. Overrides file extension */\n    filename[MaxTextExtent]; /* File name to read */\n\n  /*\n    Only private members appear past this point\n  */\n\n  _CacheInfoPtr_\n     cache;                  /* Private. Used to pass image via open cache */\n\n  void\n    *definitions;            /* Private. Map of coder specific options passed by user.\n                                Use AddDefinitions, RemoveDefinitions, & AccessDefinition\n                                to access and manipulate this data. */\n\n  Image\n    *attributes;             /* Private. Image attribute list */\n\n  MagickBool\n    ping;                    /* Private, if true, read file header only */\n\n  PreviewType\n    preview_type;            /* Private, used by PreviewImage */\n\n  MagickBool\n    affirm;                  /* Private, when true do not intuit image format */\n\n  _BlobInfoPtr_\n    blob;                    /* Private, used to pass in open blob */\n\n  size_t\n    length;                  /* Private, used to pass in open blob length */\n\n  char\n    unique[MaxTextExtent],   /* Private, passes temporary filename to TranslateText */\n    zero[MaxTextExtent];     /* Private, passes temporary filename to TranslateText */\n\n  unsigned long\n    signature;               /* Private, used to validate structure */\n} ImageInfo;\n\f\n/*\n  Image utilities methods.\n*/\n\nextern MagickExport ExceptionType\n  CatchImageException(Image *);\n\nextern MagickExport Image\n  *AllocateImage(const ImageInfo *),\n  *AppendImages(const Image *,const unsigned int,ExceptionInfo *),\n  *CloneImage(const Image *,const unsigned long,const unsigned long,\n   const unsigned int,ExceptionInfo *),\n  *GetImageClipMask(const Image *,ExceptionInfo *),\n  *GetImageCompositeMask(const Image *,ExceptionInfo *),  /*to support SVG masks*/\n  *ReferenceImage(Image *);\n\nextern MagickExport ImageInfo\n  *CloneImageInfo(const ImageInfo *);\n\nextern MagickExport const char\n  *AccessDefinition(const ImageInfo *image_info,const char *magick,\n     const char *key);\n\nextern MagickExport int\n  GetImageGeometry(const Image *,const char *,const unsigned int,\n  RectangleInfo *);\n\n/* Functions which return unsigned int as a True/False boolean value */\nextern MagickExport MagickBool\n  IsTaintImage(const Image *),\n  IsSubimage(const char *,const MagickBool);\n\n/* Functions which return unsigned int to indicate operation pass/fail */\nextern MagickExport MagickPassFail\n  AddDefinition(ImageInfo *image_info,const char *magick, const char *key,\n    const char *value, ExceptionInfo *exception),\n  AddDefinitions(ImageInfo *image_info,const char *options,\n    ExceptionInfo *exception),\n  AnimateImages(const ImageInfo *image_info,Image *image),\n  ClipImage(Image *image),\n  ClipPathImage(Image *image,const char *pathname,const MagickBool inside),\n  CompositeMaskImage(Image *image),   /*to support SVG masks*/\n  CompositePathImage(Image *image,const char *pathname,const MagickBool inside),  /*to support SVG masks*/\n  DisplayImages(const ImageInfo *image_info,Image *image),\n  RemoveDefinitions(const ImageInfo *image_info,const char *options),\n  ResetImagePage(Image *image,const char *page),\n  SetImage(Image *image,const Quantum),\n  SetImageEx(Image *image,const Quantum opacity,ExceptionInfo *exception),\n  SetImageColor(Image *image,const PixelPacket *pixel),\n  SetImageColorRegion(Image *image,long x,long y,unsigned long width,\n                      unsigned long height,const PixelPacket *pixel),\n  SetImageClipMask(Image *image,const Image *clip_mask),\n  SetImageCompositeMask(Image *image,const Image *composite_mask),  /*to support SVG masks*/\n  SetImageDepth(Image *image,const unsigned long),\n  SetImageInfo(ImageInfo *image_info,const unsigned int flags,ExceptionInfo *exception),\n  SetImageType(Image *image,const ImageType),\n  StripImage(Image *image),\n  SyncImage(Image *image);\n\nextern MagickExport void\n  AllocateNextImage(const ImageInfo *,Image *),\n  DestroyImage(Image *),\n  DestroyImageInfo(ImageInfo *),\n  GetImageException(Image *,ExceptionInfo *),\n  GetImageInfo(ImageInfo *),\n  ModifyImage(Image **,ExceptionInfo *),\n  SetImageOpacity(Image *,const unsigned int);\n\n/* provide public access to the clip_mask member of Image */\nextern MagickExport Image\n  **ImageGetClipMask(const Image *) MAGICK_FUNC_PURE;\n\n/* provide public access to the composite_mask member of Image */\nextern MagickExport Image\n  **ImageGetCompositeMask(const Image *) MAGICK_FUNC_PURE;\n\n#if defined(MAGICK_IMPLEMENTATION)\n  /*\n    SetImageInfo flags specification.\n  */\n#  define SETMAGICK_FALSE    0x00000 /* MagickFalse (\"read\") */\n#  define SETMAGICK_TRUE     0x00001 /* MagickTrue (\"write+rectify\") */\n#  define SETMAGICK_READ     0x00002 /* Filespec will be read */\n#  define SETMAGICK_WRITE    0x00004 /* Filespec will be written */\n#  define SETMAGICK_RECTIFY  0x00008 /* Look for adjoin in filespec */\n\n#include \"magick/image-private.h\"\n\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_IMAGE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/list.h",
    "content": "/*\n  Copyright (C) 2003-2018 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image List Methods.\n*/\n#ifndef _MAGICK_LIST_H\n#define _MAGICK_LIST_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\nextern MagickExport Image\n  *CloneImageList(const Image *,ExceptionInfo *),\n  *GetFirstImageInList(const Image *) MAGICK_FUNC_PURE,\n  *GetImageFromList(const Image *,const long) MAGICK_FUNC_PURE,\n  *GetLastImageInList(const Image *) MAGICK_FUNC_PURE,\n  *GetNextImageInList(const Image *) MAGICK_FUNC_PURE,\n  *GetPreviousImageInList(const Image *) MAGICK_FUNC_PURE,\n  **ImageListToArray(const Image *,ExceptionInfo *),\n  *NewImageList(void) MAGICK_FUNC_CONST,\n  *RemoveLastImageFromList(Image **),\n  *RemoveFirstImageFromList(Image **),\n  *SplitImageList(Image *),\n  *SyncNextImageInList(const Image *);\n\nextern MagickExport long\n  GetImageIndexInList(const Image *) MAGICK_FUNC_PURE;\n\nextern MagickExport unsigned long\n  GetImageListLength(const Image *) MAGICK_FUNC_PURE;\n\nextern MagickExport void\n  AppendImageToList(Image **,Image *),\n  DeleteImageFromList(Image **),\n  DestroyImageList(Image *),\n  InsertImageInList(Image **,Image *),\n  PrependImageToList(Image **,Image *),\n  ReplaceImageInList(Image **images,Image *image),\n  ReverseImageList(Image **),\n  SpliceImageIntoList(Image **,const unsigned long,Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/log.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Log methods.\n*/\n#ifndef _MAGICK_LOG_H\n#define _MAGICK_LOG_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Define declarations.\n  */\n#define MagickLogFilename  \"log.mgk\"\n\n  /*\n    Obtain the current C function name (if possible)\n  */\n#  if !defined(GetCurrentFunction)\n#    if (((defined(__cplusplus) || defined(c_plusplus)) && defined(HAS_CPP__func__)) || \\\n        (!(defined(__cplusplus) || defined(c_plusplus)) && defined(HAS_C__func__)))\n#      define GetCurrentFunction() (__func__)\n#    elif defined(_VISUALC_) && defined(__FUNCTION__)\n#      define GetCurrentFunction() (__FUNCTION__)\n#    else\n#      define GetCurrentFunction() (\"unknown\")\n#    endif\n#  endif\n\n  /*\n    Obtain current source file, function name, and source file line,\n    in a form acceptable for use with LogMagickEvent.\n  */\n#  if !defined(GetMagickModule)\n#    define GetMagickModule()  __FILE__,GetCurrentFunction(),__LINE__\n#  endif\n\n\n/* NOTE: any changes to this effect PerlMagick */\ntypedef enum\n{\n  UndefinedEventMask     = 0x00000000,\n  NoEventsMask           = 0x00000000,\n  ConfigureEventMask     = 0x00000001,\n  AnnotateEventMask      = 0x00000002,\n  RenderEventMask        = 0x00000004,\n  TransformEventMask     = 0x00000008,\n  LocaleEventMask        = 0x00000010,\n  CoderEventMask         = 0x00000020,\n  X11EventMask           = 0x00000040,\n  CacheEventMask         = 0x00000080,\n  BlobEventMask          = 0x00000100,\n  DeprecateEventMask     = 0x00000200,\n  UserEventMask          = 0x00000400,\n  ResourceEventMask      = 0x00000800,\n  TemporaryFileEventMask = 0x00001000,\n  /* ExceptionEventMask = WarningEventMask | ErrorEventMask |  FatalErrorEventMask */\n  ExceptionEventMask     = 0x00070000,\n  OptionEventMask        = 0x00004000,\n  InformationEventMask   = 0x00008000,\n  WarningEventMask       = 0x00010000,\n  ErrorEventMask         = 0x00020000,\n  FatalErrorEventMask    = 0x00040000,\n  AllEventsMask          = 0x7FFFFFFF\n} LogEventType;\n\ntypedef void\n  (*LogMethod)(const ExceptionType,const char *);\n\n/*\n  Method declarations.\n*/\nextern MagickExport MagickBool\n  IsEventLogging(void) MAGICK_FUNC_PURE,\n  LogMagickEvent(const ExceptionType type,\n    const char *module,const char *function,const unsigned long line,\n    const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,5,6))),\n  LogMagickEventList(const ExceptionType type,\n    const char *module,const char *function,const unsigned long line,\n    const char *format,va_list operands) MAGICK_ATTRIBUTE((__format__ (__printf__,5,0)));\n\nextern MagickExport unsigned long\n  SetLogEventMask(const char *events);\n\nextern MagickExport void\n  SetLogFormat(const char *format),\n  SetLogMethod(LogMethod);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/log-private.h\"\n#endif /* MAGICK_IMPLEMENTATION */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_LOG_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/magic.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Magic methods.\n*/\n#ifndef _MAGICK_MAGIC_H\n#define _MAGICK_MAGIC_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Method declarations.\n*/\nextern MagickExport MagickPassFail\n  GetMagickFileFormat(const unsigned char *header,const size_t header_length,\n     char *format,const size_t format_length,ExceptionInfo *exception),\n  ListMagicInfo(FILE *file,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/magic-private.h\"\n#endif /* MAGICK_IMPLEMENTATION */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_MAGIC_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/magick.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Application Programming Interface declarations.\n*/\n#ifndef _MAGICK_MAGICK_H\n#define _MAGICK_MAGICK_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Flags to form options passed to InitializeMagickEx\n*/\n#define MAGICK_OPT_NO_SIGNAL_HANDER 0x0001 /* Don't register ANSI/POSIX signal handlers */\n\ntypedef Image\n  *(*DecoderHandler)(const ImageInfo *,ExceptionInfo *);\n\ntypedef unsigned int\n  (*EncoderHandler)(const ImageInfo *,Image *),\n  (*MagickHandler)(const unsigned char *,const size_t);\n\n/*\n  Stability and usefulness of the coder.\n*/\ntypedef enum\n{\n  BrokenCoderClass = -1,   /* Known to sometimes/often not work properly or\n                              might not be useful at all */\n  UnstableCoderClass = 0,  /* Weak implementation, poorly designed file\n                              format, and/or hardly ever used */\n  StableCoderClass,        /* Well maintained, but not often used */\n  PrimaryCoderClass        /* Well maintained and commonly used */\n} CoderClass;\n\n/*\n  How the file extension should be treated (e.g. in SetImageInfo()).\n*/\ntypedef enum\n{\n  HintExtensionTreatment = 0, /* Extension is a useful hint to indicate format */\n  ObeyExtensionTreatment,     /* Extension must be obeyed as format indicator */\n  IgnoreExtensionTreatment    /* Format has no associated extension */\n} ExtensionTreatment;\n\ntypedef struct _MagickInfo\n{\n  struct _MagickInfo\n    *next,              /* private, next member in list */\n    *previous;          /* private, previous member in list */\n\n  const char\n    *name;              /* format ID (\"magick\") */\n\n  const char\n    *description,       /* format description */\n    *note,              /* usage note for user */\n    *version,           /* support library version */\n    *module;            /* name of loadable module */\n\n  DecoderHandler\n    decoder;            /* function vector to decoding routine */\n\n  EncoderHandler\n    encoder;            /* function vector to encoding routine */\n\n  MagickHandler\n    magick;             /* function vector to format test routine */\n\n  void\n    *client_data;       /* arbitrary user supplied data */\n\n  MagickBool\n    adjoin,             /* coder may read/write multiple frames (default True) */\n    raw,                /* coder requires that size be set (default False) */\n    stealth,            /* coder should not appear in formats listing (default MagickFalse) */\n    seekable_stream,    /* coder requires BLOB \"seek\" and \"tell\" APIs (default MagickFalse)\n                         *   Note that SetImageInfo() currently always copies input\n                         *   from a pipe, .gz, or .bz2 file, to a temporary file so\n                         *   that it can retrieve a bit of the file header in order to\n                         *   support the file header magic logic.\n                         */\n    blob_support,       /* coder uses BLOB APIs (default True) */\n    thread_support;     /* coder is thread safe (default True) */\n\n  CoderClass\n    coder_class;        /* Coder usefulness/stability level */\n\n  ExtensionTreatment\n    extension_treatment; /* How much faith should be placed on file extension? */\n\n  unsigned long\n    signature;          /* private, structure validator */\n\n} MagickInfo;\n\f\n/*\n  Magick method declaractions.\n*/\nextern MagickExport char\n  *MagickToMime(const char *magick);\n\nextern MagickExport const char\n  *GetImageMagick(const unsigned char *magick,const size_t length);\n\nextern MagickExport MagickBool\n  IsMagickConflict(const char *magick) MAGICK_FUNC_PURE;\n\nextern MagickExport MagickPassFail\n  ListModuleMap(FILE *file,ExceptionInfo *exception),\n  ListMagickInfo(FILE *file,ExceptionInfo *exception),\n  InitializeMagickEx(const char *path, unsigned int options,\n                     ExceptionInfo *exception),\n  UnregisterMagickInfo(const char *name);\n\nextern MagickExport void\n  DestroyMagick(void),\n  InitializeMagick(const char *path),\n  PanicDestroyMagick(void);\n\nextern MagickExport const MagickInfo\n  *GetMagickInfo(const char *name,ExceptionInfo *exception);\n\nextern MagickExport MagickInfo\n  **GetMagickInfoArray(ExceptionInfo *exception);\n\nextern MagickExport MagickInfo\n  *RegisterMagickInfo(MagickInfo *magick_info),\n  *SetMagickInfo(const char *name);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/magick-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_MAGICK_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/magick_config.h",
    "content": "/* magick/magick_config_api.h.  Generated from magick_config_api.h.in by configure.  */\n/* Defines required by <magick/api.h> */\n\n/* Define if you have X11 library */\n/* #undef HasX11 */\n\n/* Number of bits in a pixel Quantum (8/16/32) */\n#define QuantumDepth 8\n\n/* Define to 1 if your processor stores words with the most significant byte\n   first (like Motorola and SPARC, unlike Intel and VAX). */\n/* #undef WORDS_BIGENDIAN */\n\n/* Prefix Magick library symbols with a common string. */\n/* #undef PREFIX_MAGICK_SYMBOLS */\n\n/* Define to `unsigned int' if <sys/types.h> does not define. */\n/* #undef size_t */\n\n/* Define to `int' if <sys/types.h> does not define. */\n/* #undef ssize_t */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/magick_types.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick types typedefs.\n\n  GraphicsMagick is expected to compile with any C '89 ANSI C compiler\n  supporting at least 16-bit 'short', 32-bit 'int', and 32-bit 'long'.\n  It is also expected to take advantage of 64-bit LP64 and Windows\n  WIN64 LLP64.  We use C '99 style types but declare our own types so\n  as to not depend on C '99 header files, and take care to depend only\n  on C '89 library functions, POSIX, or well-known extensions.  Any C\n  '99 syntax used is removed if the compiler does not support it.\n*/\n\n#ifndef _MAGICK_TYPES_H\n#define _MAGICK_TYPES_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Assign ANSI C'99 stdint.h-like typedefs based on the sizes of native types\n  magick_int8_t   --                       -128 to 127\n  magick_uint8_t  --                          0 to 255\n  magick_int16_t  --                    -32,768 to 32,767\n  magick_uint16_t --                          0 to 65,535\n  magick_int32_t  --             -2,147,483,648 to 2,147,483,647\n  magick_uint32_t --                          0 to 4,294,967,295\n  magick_int64_t  -- -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807\n  magick_uint64_t --                          0 to 18,446,744,073,709,551,615\n\n  magick_uintmax_t -- largest native unsigned integer type (\"%ju\")\n                                              0 to UINTMAX_MAX\n                      UINTMAX_C(value) declares constant value\n  magick_uintptr_t -- unsigned type for storing a pointer value (\"%tu\")\n                                              0 to UINTPTR_MAX\n\n  ANSI C '89 stddef.h-like types\n  size_t           -- unsigned type representing sizes of objects (\"%zu\")\n                                              0 to SIZE_MAX\n  ptrdiff_t -- signed type for subtracting two pointers (\"%td\")\n                                    PTRDIFF_MIN to PTRDIFF_MAX\n\n  IEEE Std 1003.1 (1990), 2004 types.  Not part of ANSI C!\n  ssize_t          -- signed type for a count of bytes or an error indication (\"%zd\")\n                                              ? to SSIZE_MAX\n*/\n\n#if (defined(WIN32) || defined(WIN64)) && \\\n  !defined(__MINGW32__) && !defined(__MINGW64__)\n\n  /* The following typedefs are used for WIN32 & WIN64 (without\n     configure) */\n  typedef signed char   magick_int8_t;\n  typedef unsigned char  magick_uint8_t;\n\n  typedef signed short  magick_int16_t;\n  typedef unsigned short magick_uint16_t;\n\n  typedef signed int  magick_int32_t;\n#  define MAGICK_INT32_F \"\"\n  typedef unsigned int magick_uint32_t;\n#  define MAGICK_UINT32_F \"\"\n\n  typedef signed __int64  magick_int64_t;\n# define MAGICK_INT64_F \"I64\"\n  typedef unsigned __int64 magick_uint64_t;\n# define MAGICK_UINT64_F \"I64\"\n\n  typedef magick_uint64_t magick_uintmax_t;\n\n#  if defined(WIN64)\n  /* WIN64 uses the LLP64 model */\n  typedef unsigned long long magick_uintptr_t;\n#  define MAGICK_SIZE_T_F \"I64\"\n#  define MAGICK_SIZE_T unsigned __int64\n#  define MAGICK_SSIZE_T_F \"I64\"\n#  define MAGICK_SSIZE_T signed __int64\n#  else\n  typedef unsigned long magick_uintptr_t;\n#  define MAGICK_SIZE_T_F \"l\"\n#  define MAGICK_SIZE_T unsigned long\n#  define MAGICK_SSIZE_T_F \"l\"\n#  define MAGICK_SSIZE_T long\n#  endif // defined(WIN64)\n\n#else\n\n  /* The following typedefs are subtituted when using Unixish configure */\n  typedef signed char   magick_int8_t;\n  typedef unsigned char  magick_uint8_t;\n\n  typedef signed short  magick_int16_t;\n  typedef unsigned short magick_uint16_t;\n\n  typedef signed int  magick_int32_t;\n#  define MAGICK_INT32_F \"\"\n  typedef unsigned int magick_uint32_t;\n#  define MAGICK_UINT32_F \"\"\n\n  typedef signed long  magick_int64_t;\n#  define MAGICK_INT64_F \"l\"\n  typedef unsigned long magick_uint64_t;\n#  define MAGICK_UINT64_F \"l\"\n\n  typedef unsigned long magick_uintmax_t;\n#  define MAGICK_UINTMAX_F \"l\"\n\n  typedef unsigned long magick_uintptr_t;\n#  define MAGICK_UINTPTR_F \"l\"\n\n#  define MAGICK_SIZE_T_F \"l\"\n#  define MAGICK_SIZE_T unsigned long\n\n#  define MAGICK_SSIZE_T_F \"l\"\n#  define MAGICK_SSIZE_T signed long\n\n#endif\n\n  /* 64-bit file and blob offset type */\n  typedef magick_int64_t magick_off_t;\n#define MAGICK_OFF_F MAGICK_INT64_F\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_TYPES_H */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/memory.h",
    "content": "/*\n  Copyright (C) 2003-2020 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Memory Allocation Methods.\n*/\n#ifndef _MAGICK_MEMORY_H\n#define _MAGICK_MEMORY_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\ntypedef void *(*MagickMallocFunc)(size_t size);\ntypedef void (*MagickFreeFunc)(void *ptr);\ntypedef void *(*MagickReallocFunc)(void *ptr, size_t size);\n\nextern MagickExport void\n   MagickAllocFunctions(MagickFreeFunc free_func,MagickMallocFunc malloc_func,\n                        MagickReallocFunc realloc_func),\n  *MagickMalloc(const size_t size) MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(1),\n  *MagickMallocAligned(const size_t alignment, const size_t size) MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(2),\n  *MagickMallocCleared(const size_t size) MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(1),\n  *MagickCloneMemory(void *destination,const void *source,const size_t size) MAGICK_FUNC_NONNULL,\n  *MagickRealloc(void *memory,const size_t size) MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(2),\n   MagickFree(void *memory),\n   MagickFreeAligned(void *memory);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#include \"magick/memory-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/module.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Modules Methods.\n*/\n#ifndef _MAGICK_MODULE_H\n#define _MAGICK_MODULE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Modules declarations.\n*/\n\nextern MagickExport MagickPassFail\n  ExecuteModuleProcess(const char *tag,Image **image,\n                       const int argc,char **argv);\n\n\n#if defined(MAGICK_IMPLEMENTATION)\n#include \"magick/module-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/monitor.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Progress Monitor Methods.\n*/\n#ifndef _MAGICK_MONITOR_H\n#define _MAGICK_MONITOR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Monitor typedef declarations.\n  */\n  typedef MagickPassFail\n  (*MonitorHandler)(const char *text,const magick_int64_t quantum,\n                    const magick_uint64_t span,ExceptionInfo *exception);\n\f\n  /*\n    Monitor declarations.\n  */\n  extern MagickExport MonitorHandler\n  SetMonitorHandler(MonitorHandler handler);\n\n  extern MagickExport MagickPassFail\n  MagickMonitor(const char *text,\n                const magick_int64_t quantum,const magick_uint64_t span,\n                ExceptionInfo *exception) MAGICK_FUNC_DEPRECATED;\n\n  extern MagickExport MagickPassFail\n  MagickMonitorFormatted(const magick_int64_t quantum,\n                         const magick_uint64_t span,\n                         ExceptionInfo *exception,\n                         const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,4,5)));\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/monitor-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/montage.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Montage Methods.\n*/\n#ifndef _MAGICK_MONTAGE_H\n#define _MAGICK_MONTAGE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *MontageImages(const Image *,const MontageInfo *,ExceptionInfo *);\n\nextern MagickExport MontageInfo\n  *CloneMontageInfo(const ImageInfo *,const MontageInfo *);\n\nextern MagickExport void\n  DestroyMontageInfo(MontageInfo *),\n  GetMontageInfo(const ImageInfo *,MontageInfo *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_MONTAGE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/operator.h",
    "content": "/*\n% Copyright (C) 2004 - 2012 GraphicsMagick Group\n%\n% This program is covered by multiple licenses, which are described in\n% Copyright.txt. You should have received a copy of Copyright.txt with this\n% package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n%\n% Interfaces to support quantum operators.\n% Written by Bob Friesenhahn, March 2004.\n%\n*/\n#ifndef _MAGICK_OPERATOR_H\n#define _MAGICK_OPERATOR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\ntypedef enum\n{\n  UndefinedQuantumOp = 0,\n  AddQuantumOp,                   /* Add value */\n  AndQuantumOp,                   /* Bitwise AND value */\n  AssignQuantumOp,                /* Direct value assignment */\n  DivideQuantumOp,                /* Divide by value */\n  LShiftQuantumOp,                /* Bitwise left-shift value N bits */\n  MultiplyQuantumOp,              /* Multiply by value */\n  OrQuantumOp,                    /* Bitwise OR value */\n  RShiftQuantumOp,                /* Bitwise right shift value */\n  SubtractQuantumOp,              /* Subtract value */\n  ThresholdQuantumOp,             /* Above threshold white, otherwise black */\n  ThresholdBlackQuantumOp,        /* Below threshold is black */\n  ThresholdWhiteQuantumOp,        /* Above threshold is white */\n  XorQuantumOp,                   /* Bitwise XOR value */\n  NoiseGaussianQuantumOp,         /* Gaussian noise */\n  NoiseImpulseQuantumOp,          /* Impulse noise */\n  NoiseLaplacianQuantumOp,        /* Laplacian noise */\n  NoiseMultiplicativeQuantumOp,   /* Multiplicative gaussian noise */\n  NoisePoissonQuantumOp,          /* Poisson noise */\n  NoiseUniformQuantumOp,          /* Uniform noise */\n  NegateQuantumOp,                /* Negate (invert) channel, ignore value */\n  GammaQuantumOp,                 /* Adjust image gamma */\n  DepthQuantumOp,                 /* Adjust image depth */\n  /* Below added on 2008-12-13 */\n  LogQuantumOp,                   /* log(quantum*value+1)/log(value+1) */\n  MaxQuantumOp,                   /* Assign value if > quantum */\n  MinQuantumOp,                   /* Assign value if < quantum */\n  PowQuantumOp,                   /* Power function: pow(quantum,value) */\n  /* Below added on 2012-03-17 */\n  NoiseRandomQuantumOp,           /* Random noise */\n  /* Below added on 2014-05-17 */\n  ThresholdBlackNegateQuantumOp,  /* Below threshold is set to white */\n  ThresholdWhiteNegateQuantumOp   /* Above threshold is set to black */\n\n } QuantumOperator;\n\nextern MagickExport MagickPassFail\n  QuantumOperatorImage(Image *image,const ChannelType channel,\n    const QuantumOperator quantum_operator,const double rvalue,\n    ExceptionInfo *exception),\n  QuantumOperatorImageMultivalue(Image *image,\n                                 const QuantumOperator quantum_operator,\n                                 const char *values),\n  QuantumOperatorRegionImage(Image *image,const long x,const long y,\n    const unsigned long columns,const unsigned long rows,\n    const ChannelType channel,const QuantumOperator quantum_operator,\n    const double rvalue,ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/paint.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Paint Methods.\n*/\n#ifndef _MAGICK_PAINT_H\n#define _MAGICK_PAINT_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"magick/render.h\"\n\nextern MagickExport unsigned int\n  ColorFloodfillImage(Image *,const DrawInfo *,const PixelPacket,const long,\n    const long,const PaintMethod),\n  MatteFloodfillImage(Image *,const PixelPacket,const unsigned int,const long,\n    const long,const PaintMethod);\n\nextern MagickExport unsigned int\n  OpaqueImage(Image *,const PixelPacket,const PixelPacket),\n  TransparentImage(Image *,const PixelPacket,const unsigned int);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/pixel_cache.h",
    "content": "/*\n  Copyright (C) 2003 - 2018 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Pixel Cache Methods.\n*/\n#ifndef _MAGICK_CACHE_H\n#define _MAGICK_CACHE_H\n\n#include \"magick/forward.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Enum declaractions.\n  */\n\n  typedef enum\n    {\n      UndefinedVirtualPixelMethod,\n      ConstantVirtualPixelMethod,\n      EdgeVirtualPixelMethod,\n      MirrorVirtualPixelMethod,\n      TileVirtualPixelMethod\n    } VirtualPixelMethod;\n\n  /*\n    Typedef declaractions.\n  */\n  typedef _CacheInfoPtr_ Cache;\n\n  /*****\n   *\n   * Default View interfaces\n   *\n   *****/\n\n  /*\n    Read only access to a rectangular pixel region.\n  */\n  MagickExport const PixelPacket\n  *AcquireImagePixels(const Image *image,const long x,const long y,\n                      const unsigned long columns,\n                      const unsigned long rows,ExceptionInfo *exception);\n\n  /*\n    AccessImmutableIndexes() returns the read-only indexes\n    associated with a rectangular pixel region already selected via\n    AcquireImagePixels().\n  */\n  extern MagickExport const IndexPacket\n  *AccessImmutableIndexes(const Image *image);\n\n  /*\n    Return one DirectClass pixel at the the specified (x,y) location.\n    Similar function as GetOnePixel().  Note that the value returned\n    by GetIndexes() may or may not be influenced by this function.\n  */\n  extern MagickExport PixelPacket\n  AcquireOnePixel(const Image *image,const long x,const long y,\n                  ExceptionInfo *exception);\n\n\n  /*\n    GetImagePixels() and GetImagePixelsEx() obtains a pixel region for\n    read/write access.\n  */\n  extern MagickExport PixelPacket\n  *GetImagePixels(Image *image,const long x,const long y,\n                  const unsigned long columns,const unsigned long rows);\n  extern MagickExport PixelPacket\n  *GetImagePixelsEx(Image *image,const long x,const long y,\n                    const unsigned long columns,const unsigned long rows,\n                    ExceptionInfo *exception);\n\n  /*\n    GetImageVirtualPixelMethod() gets the \"virtual pixels\" method for\n    the image.\n  */\n  extern MagickExport VirtualPixelMethod\n  GetImageVirtualPixelMethod(const Image *image) MAGICK_FUNC_PURE;\n\n  /*\n    GetPixels() and AccessMutablePixels() return the pixels associated\n    with the last call to SetImagePixels() or GetImagePixels().\n  */\n  extern MagickExport PixelPacket\n  *GetPixels(const Image *image)\n    MAGICK_FUNC_DEPRECATED; /* Prefer AccessMutablePixels instead */\n  extern MagickExport PixelPacket\n  *AccessMutablePixels(Image *image);\n\n  /*\n    GetIndexes() and AccessMutableIndexes() return the colormap\n    indexes associated with the last call to SetImagePixels() or\n    GetImagePixels().\n  */\n  extern MagickExport IndexPacket\n  *GetIndexes(const Image *image)\n    MAGICK_FUNC_DEPRECATED; /* Prefer AccessMutableIndexes() instead */\n  extern MagickExport IndexPacket\n  *AccessMutableIndexes(Image *image);\n\n  /*\n    GetOnePixel() returns a single DirectClass pixel at the specified\n    (x,y) location.  Similar to AcquireOnePixel().  It is preferred to\n    use AcquireOnePixel() since it allows reporting to a specified\n    exception structure. Note that the value returned by GetIndexes()\n    is not reliably influenced by this function.\n  */\n  extern MagickExport PixelPacket\n  GetOnePixel(Image *image,const long x,const long y)\n    MAGICK_FUNC_DEPRECATED; /* Prefer AcquireOnePixel() instead */\n\n  /*\n    GetPixelCacheArea() returns the area (width * height in pixels)\n    consumed by the current pixel cache.\n  */\n  extern MagickExport magick_off_t\n  GetPixelCacheArea(const Image *image);\n\n  /*\n    SetImagePixels() and SetImagePixelsEx() initialize a pixel region\n    for write-only access.\n  */\n  extern MagickExport PixelPacket\n  *SetImagePixels(Image *image,const long x,const long y,\n                  const unsigned long columns,const unsigned long rows);\n  extern MagickExport PixelPacket\n  *SetImagePixelsEx(Image *image,const long x,const long y,\n                    const unsigned long columns,const unsigned long rows,\n                    ExceptionInfo *exception);\n\n  /*\n    SetImageVirtualPixelMethod() sets the \"virtual pixels\" method for\n    the image.\n  */\n  extern MagickExport MagickPassFail\n  SetImageVirtualPixelMethod(const Image *image,\n                             const VirtualPixelMethod method);\n\n  /*\n    SyncImagePixels() and SyncImagePixelsEx() save the image pixels to\n    the in-memory or disk cache.\n  */\n  extern MagickExport MagickPassFail\n  SyncImagePixels(Image *image);\n  extern MagickExport MagickPassFail\n  SyncImagePixelsEx(Image *image,ExceptionInfo *exception);\n\n  /****\n   *\n   * Cache view interfaces\n   *\n   ****/\n\n  /*\n    OpenCacheView() opens a cache view.\n  */\n  extern MagickExport ViewInfo\n  *OpenCacheView(Image *image);\n\n  /*\n    CloseCacheView() closes a cache view.\n  */\n  extern MagickExport void\n  CloseCacheView(ViewInfo *view);\n\n\n  /*\n    AccessCacheViewPixels() returns the pixels associated with the\n    last request to select a view pixel region\n    (i.e. AcquireCacheViewPixels() or GetCacheViewPixels()).\n  */\n  extern MagickExport PixelPacket\n  *AccessCacheViewPixels(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    AcquireCacheViewIndexes() returns read-only indexes associated\n    with a cache view.\n  */\n  extern MagickExport const IndexPacket\n  *AcquireCacheViewIndexes(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    AcquireCacheViewPixels() obtains a pixel region from a cache view\n    for read-only access.\n  */\n  extern MagickExport const PixelPacket\n  *AcquireCacheViewPixels(ViewInfo *view,\n                          const long x,const long y,\n                          const unsigned long columns,\n                          const unsigned long rows,\n                          ExceptionInfo *exception);\n\n  /*\n    AcquireOneCacheViewPixel() returns one DirectClass pixel from a\n    cache view. Note that the value returned by GetCacheViewIndexes()\n    is not reliably influenced by this function.\n  */\n  extern MagickExport MagickPassFail\n  AcquireOneCacheViewPixel(ViewInfo *view,PixelPacket *pixel,\n                           const long x,const long y,ExceptionInfo *exception);\n\n  /*\n    GetCacheViewArea() returns the area (width * height in pixels)\n    currently consumed by the pixel cache view.\n  */\n  extern MagickExport magick_off_t\n  GetCacheViewArea(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    GetCacheViewImage() obtains the image used to allocate the cache view.\n  */\n  extern Image *\n  GetCacheViewImage(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    GetCacheViewIndexes() returns the indexes associated with a cache view.\n  */\n  extern MagickExport IndexPacket\n  *GetCacheViewIndexes(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n  /*\n    GetCacheViewPixels() obtains a pixel region from a cache view for\n    read/write access.\n  */\n  extern MagickExport PixelPacket\n  *GetCacheViewPixels(ViewInfo *view,const long x,const long y,\n                      const unsigned long columns,const unsigned long rows,\n                      ExceptionInfo *exception);\n\n  /*\n    Obtain the offset and size of the selected region.\n  */\n  extern MagickExport RectangleInfo\n  GetCacheViewRegion(const ViewInfo *view) MAGICK_FUNC_PURE;\n\n\n  /*\n    SetCacheViewPixels() gets blank writeable pixels from the pixel\n    cache view.\n  */\n  extern MagickExport PixelPacket\n  *SetCacheViewPixels(ViewInfo *view,const long x,const long y,\n                      const unsigned long columns,const unsigned long rows,\n                      ExceptionInfo *exception);\n\n  /*\n    SyncCacheViewPixels() saves any changes to the pixel cache view.\n  */\n  extern MagickExport MagickPassFail\n  SyncCacheViewPixels(const ViewInfo *view,ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n\n#include \"magick/pixel_cache-private.h\"\n\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_CACHE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/pixel_iterator.h",
    "content": "/*\n  Copyright (C) 2004-2016 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Interfaces to support simple iterative pixel read/update access within an\n  image or between two images.  These interfaces exist in order to eliminate\n  large amounts of redundant code and to allow changing the underlying\n  implementation without changing the using code. These interfaces\n  intentionally omit any pixel position information in order to not constrain\n  the implementation and to improve performance.\n\n  User-provided callbacks must be thread-safe (preferably re-entrant) since\n  they may be invoked by multiple threads.\n\n  These interfaces have proven to be future safe (since implemented) and may\n  be safely used by other applications/libraries.\n\n  Written by Bob Friesenhahn, March 2004, Updated for regions 2008.\n\n*/\n#ifndef _PIXEL_ROW_ITERATOR_H\n#define _PIXEL_ROW_ITERATOR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n  /*\n    Pixel iterator options.\n  */\n  typedef struct _PixelIteratorOptions\n  {\n    int           max_threads; /* Desired number of threads */\n    unsigned long signature;\n  } PixelIteratorOptions;\n\n\n  /*\n    Initialize pixel iterator options with defaults.\n  */\n  extern MagickExport void\n  InitializePixelIteratorOptions(PixelIteratorOptions *options,\n                                 ExceptionInfo *exception);\n\n  /*\n    Read-only access across pixel region.\n  */\n\n  typedef MagickPassFail (*PixelIteratorMonoReadCallback)\n    (\n     void *mutable_data,                   /* User provided mutable data */\n     const void *immutable_data,       /* User provided immutable data */\n     const Image *const_image,          /* Input image */\n     const PixelPacket *pixels,         /* Pixel row */\n     const IndexPacket *indexes,        /* Pixel indexes */\n     const long npixels,                /* Number of pixels in row */\n     ExceptionInfo *exception           /* Exception report */\n     );\n\n  extern MagickExport MagickPassFail\n  PixelIterateMonoRead(PixelIteratorMonoReadCallback call_back,\n                       const PixelIteratorOptions *options,\n                       const char *description,\n                       void *mutable_data,\n                       const void *immutable_data,\n                       const long x,\n                       const long y,\n                       const unsigned long columns,\n                       const unsigned long rows,\n                       const Image *image,\n                       ExceptionInfo *exception);\n\n\n  typedef MagickPassFail (*PixelIteratorMonoModifyCallback)\n    (\n     void *mutable_data,                /* User provided mutable data */\n     const void *immutable_data,        /* User provided immutable data */\n     Image *image,                      /* Modify image */\n     PixelPacket *pixels,               /* Pixel row */\n     IndexPacket *indexes,              /* Pixel row indexes */\n     const long npixels,                /* Number of pixels in row */\n     ExceptionInfo *exception           /* Exception report */\n     );\n\n  /*\n    Write access across pixel region.\n  */\n  extern MagickExport MagickPassFail\n  PixelIterateMonoSet(PixelIteratorMonoModifyCallback call_back,\n                      const PixelIteratorOptions *options,\n                      const char *description,\n                      void *mutable_data,\n                      const void *immutable_data,\n                      const long x,\n                      const long y,\n                      const unsigned long columns,\n                      const unsigned long rows,\n                      Image *image,\n                      ExceptionInfo *exception);\n\n  /*\n    Read-write access across pixel region.\n  */\n  extern MagickExport MagickPassFail\n  PixelIterateMonoModify(PixelIteratorMonoModifyCallback call_back,\n                         const PixelIteratorOptions *options,\n                         const char *description,\n                         void *mutable_data,\n                         const void *immutable_data,\n                         const long x,\n                         const long y,\n                         const unsigned long columns,\n                         const unsigned long rows,\n                         Image *image,\n                         ExceptionInfo *exception);\n\n  /*\n    Read-only access across pixel regions of two images.\n  */\n\n  typedef MagickPassFail (*PixelIteratorDualReadCallback)\n    (\n     void *mutable_data,                /* User provided mutable data */\n     const void *immutable_data,        /* User provided immutable data */\n     const Image *first_image,          /* First Input image */\n     const PixelPacket *first_pixels,   /* Pixel row in first image */\n     const IndexPacket *first_indexes,  /* Pixel row indexes in first image */\n     const Image *second_image,         /* Second Input image */\n     const PixelPacket *second_pixels,  /* Pixel row in second image */\n     const IndexPacket *second_indexes, /* Pixel row indexes in second image */\n     const long npixels,                /* Number of pixels in row */\n     ExceptionInfo *exception           /* Exception report */\n     );\n\n  extern MagickExport MagickPassFail\n  PixelIterateDualRead(PixelIteratorDualReadCallback call_back,\n                       const PixelIteratorOptions *options,\n                       const char *description,\n                       void *mutable_data,\n                       const void *immutable_data,\n                       const unsigned long columns,\n                       const unsigned long rows,\n                       const Image *first_image,\n                       const long first_x,\n                       const long first_y,\n                       const Image *second_image,\n                       const long second_x,\n                       const long second_y,\n                       ExceptionInfo *exception);\n\n  /*\n    Read-write access across pixel regions of two images. The first\n    (source) image is accessed read-only while the second (update)\n    image is accessed as read-write.\n  */\n\n  typedef MagickPassFail (*PixelIteratorDualModifyCallback)\n    (\n     void *mutable_data,                /* User provided mutable data */\n     const void *immutable_data,        /* User provided immutable data */\n     const Image *source_image,         /* Source image */\n     const PixelPacket *source_pixels,  /* Pixel row in source image */\n     const IndexPacket *source_indexes, /* Pixel row indexes in source image */\n     Image *update_image,               /* Update image */\n     PixelPacket *update_pixels,        /* Pixel row in update image */\n     IndexPacket *update_indexes,       /* Pixel row indexes in update image */\n     const long npixels,                /* Number of pixels in row */\n     ExceptionInfo *exception           /* Exception report */\n     );\n\n  extern MagickExport MagickPassFail\n  PixelIterateDualModify(PixelIteratorDualModifyCallback call_back,\n                         const PixelIteratorOptions *options,\n                         const char *description,\n                         void *mutable_data,\n                         const void *immutable_data,\n                         const unsigned long columns,\n                         const unsigned long rows,\n                         const Image *source_image,\n                         const long source_x,\n                         const long source_y,\n                         Image *update_image,\n                         const long update_x,\n                         const long update_y,\n                         ExceptionInfo *exception);\n\n  /*\n    Read-write access across pixel regions of two images. The first\n    (source) image is accessed read-only while the second (new)\n    image is accessed for write (uninitialized pixels).\n  */\n  typedef PixelIteratorDualModifyCallback PixelIteratorDualNewCallback;\n\n  extern MagickExport MagickPassFail\n  PixelIterateDualNew(PixelIteratorDualNewCallback call_back,\n                      const PixelIteratorOptions *options,\n                      const char *description,\n                      void *mutable_data,\n                      const void *immutable_data,\n                      const unsigned long columns,\n                      const unsigned long rows,\n                      const Image *source_image,\n                      const long source_x,\n                      const long source_y,\n                      Image *new_image,\n                      const long new_x,\n                      const long new_y,\n                      ExceptionInfo *exception);\n\n  /*\n    Read-read-write access across pixel regions of three images. The\n    first two images are accessed read-only while the third is\n    accessed as read-write.\n  */\n\n  typedef MagickPassFail (*PixelIteratorTripleModifyCallback)\n    (\n     void *mutable_data,                 /* User provided mutable data */\n     const void *immutable_data,         /* User provided immutable data */\n     const Image *source1_image,         /* Source 1 image */\n     const PixelPacket *source1_pixels,  /* Pixel row in source 1 image */\n     const IndexPacket *source1_indexes, /* Pixel row indexes in source 1 image */\n     const Image *source2_image,         /* Source 2 image */\n     const PixelPacket *source2_pixels,  /* Pixel row in source 2 image */\n     const IndexPacket *source2_indexes, /* Pixel row indexes in source 2 image */\n     Image *update_image,                /* Update image */\n     PixelPacket *update_pixels,         /* Pixel row in update image */\n     IndexPacket *update_indexes,        /* Pixel row indexes in update image */\n     const long npixels,                 /* Number of pixels in row */\n     ExceptionInfo *exception            /* Exception report */\n     );\n\n  extern MagickExport MagickPassFail\n  PixelIterateTripleModify(PixelIteratorTripleModifyCallback call_back,\n                           const PixelIteratorOptions *options,\n                           const char *description,\n                           void *mutable_data,\n                           const void *immutable_data,\n                           const unsigned long columns,\n                           const unsigned long rows,\n                           const Image *source1_image,\n                           const Image *source2_image,\n                           const long source_x,\n                           const long source_y,\n                           Image *update_image,\n                           const long update_x,\n                           const long update_y,\n                           ExceptionInfo *exception);\n\n  /*\n    Read-write access across pixel regions of two images. The first\n    (source) image is accessed read-only while the second (new)\n    image is accessed for write (uninitialized pixels).\n  */\n  typedef PixelIteratorTripleModifyCallback PixelIteratorTripleNewCallback;\n\n  extern MagickExport MagickPassFail\n  PixelIterateTripleNew(PixelIteratorTripleNewCallback call_back,\n                        const PixelIteratorOptions *options,\n                        const char *description,\n                        void *mutable_data,\n                        const void *immutable_data,\n                        const unsigned long columns,\n                        const unsigned long rows,\n                        const Image *source1_image,\n                        const Image *source2_image,\n                        const long source_x,\n                        const long source_y,\n                        Image *new_image,\n                        const long new_x,\n                        const long new_y,\n                        ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _PIXEL_ROW_ITERATOR_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/plasma.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Plasma Methods.\n*/\n#ifndef _MAGICK_PLASMA_H\n#define _MAGICK_PLASMA_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n\f\nextern MagickExport MagickPassFail\nPlasmaImage(Image *image,const SegmentInfo *segment,\n            unsigned long attenuate,unsigned long depth);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_PLASMA_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/profile.h",
    "content": "/*\n  Copyright (C) 2004 - 2009 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Methods For Manipulating Embedded Image Profiles.\n*/\n#ifndef _MAGICK_PROFILE_H\n#define _MAGICK_PROFILE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n/*\n  Retrieve a profile from the image by name.\n*/\nextern MagickExport const unsigned char\n  *GetImageProfile(const Image* image, const char *name, size_t *length);\n\n/*\n  Remove a profile from the image by name.\n*/\nextern MagickExport MagickPassFail\n  DeleteImageProfile(Image *image,const char *name);\n\n/*\n  Apply (or add) a profile to the image.\n*/\nextern MagickExport MagickPassFail\n  ProfileImage(Image *image,const char *name,unsigned char *profile,\n               const size_t length,MagickBool clone);\n\n/*\n  Add (or replace) profile to the image by name.\n*/\nextern MagickExport MagickPassFail\n  SetImageProfile(Image *image,const char *name,const unsigned char *profile,\n                  const size_t length);\n\n/*\n  Add (or append) profile to the image by name.\n */\n  extern MagickExport MagickPassFail\n  AppendImageProfile(Image *image,const char *name,\n                     const unsigned char *profile_chunk,\n                     const size_t chunk_length);\n\n/*\n  Generic iterator for traversing profiles.\n*/\ntypedef void *ImageProfileIterator;\n\n/*\n  Allocate an image profile iterator which points to one before the\n  list so NextImageProfile() must be used to advance to first entry.\n*/\nextern MagickExport ImageProfileIterator\n  AllocateImageProfileIterator(const Image *image);\n\n/*\n  Advance to next image profile.  Name, profile, and length are\n  updated with information on current profile. MagickFail is returned\n  when there are no more entries.\n*/\nextern MagickExport MagickPassFail\n  NextImageProfile(ImageProfileIterator profile_iterator,const char **name,\n                   const unsigned char **profile,size_t *length);\n\n/*\n  Deallocate profile iterator.\n*/\nextern MagickExport void\n  DeallocateImageProfileIterator(ImageProfileIterator profile_iterator);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_PROFILE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/quantize.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Methods to Reduce the Number of Unique Colors in an Image.\n*/\n#ifndef _MAGICK_QUANTIZE_H\n#define _MAGICK_QUANTIZE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Define declarations.\n*/\n#define MaxTreeDepth  8\n#define NodesInAList  1536\n\f\n/*\n  Typedef declarations.\n*/\ntypedef struct _QuantizeInfo\n{\n  unsigned long\n    number_colors;\n\n  unsigned int\n    tree_depth,\n    dither;\n\n  ColorspaceType\n    colorspace;\n\n  unsigned int\n    measure_error;\n\n  unsigned long\n    signature;\n} QuantizeInfo;\n\f\n/*\n  Quantization utilities methods.\n*/\nextern MagickExport QuantizeInfo\n  *CloneQuantizeInfo(const QuantizeInfo *);\n\nextern MagickExport unsigned int\n  GetImageQuantizeError(Image *),\n  MapImage(Image *,const Image *,const unsigned int),\n  MapImages(Image *,const Image *,const unsigned int),\n  OrderedDitherImage(Image *),\n  QuantizeImage(const QuantizeInfo *,Image *),\n  QuantizeImages(const QuantizeInfo *,Image *),\n  SegmentImage(Image *,const ColorspaceType,const unsigned int,const double,\n    const double);\n\nextern MagickExport void\n  CompressImageColormap(Image *),\n  DestroyQuantizeInfo(QuantizeInfo *),\n  GetQuantizeInfo(QuantizeInfo *),\n  GrayscalePseudoClassImage(Image *,unsigned int);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/random.h",
    "content": "/*\n  Copyright (C) 2009, 2014 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Random number generator (semi-public interfaces).\n\n  Currently based on George Marsaglia's multiply-with-carry generator.\n  This is a k=2 generator with a period >2^60.\n*/\n\n#ifndef _MAGICK_RANDOM_H\n#define _MAGICK_RANDOM_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\ntypedef struct _MagickRandomKernel\n{\n  magick_uint32_t z;\n  magick_uint32_t w;\n} MagickRandomKernel;\n\n#define MAGICK_RANDOM_MAX 4294967295\n\n  /*\n    Generate a random integer value (0 - MAGICK_RANDOM_MAX)\n  */\n  MagickExport magick_uint32_t MagickRandomInteger(void);\n\n  /*\n    Generate a random double value (0.0 - 1.0)\n  */\n  MagickExport double MagickRandomReal(void);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#include \"magick/random-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* ifndef _MAGICK_RANDOM_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/registry.h",
    "content": "/*\n  Copyright (C) 2003-2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Magick registry methods.\n*/\n#ifndef _MAGICK_REGISTRY_H\n#define _MAGICK_REGISTRY_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UndefinedRegistryType,\n  ImageRegistryType,\n  ImageInfoRegistryType\n} RegistryType;\n\f\n/*\n  Magick registry methods.\n*/\nextern MagickExport Image\n  *GetImageFromMagickRegistry(const char *name,long *id,\n     ExceptionInfo *exception);\n\nextern MagickExport long\n  SetMagickRegistry(const RegistryType type,const void *blob,\n    const size_t length,ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  DeleteMagickRegistry(const long id);\n\nextern MagickExport void\n  *GetMagickRegistry(const long id,RegistryType *type,size_t *length,\n     ExceptionInfo *exception);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/registry-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/render.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Drawing methods.\n*/\n#ifndef _MAGICK_RENDER_H\n#define _MAGICK_RENDER_H\n\n#include \"magick/type.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UndefinedAlign,\n  LeftAlign,\n  CenterAlign,\n  RightAlign\n} AlignType;\n\ntypedef enum\n{\n  UserSpace,\n  UserSpaceOnUse,\n  ObjectBoundingBox\n} ClipPathUnits;\n\ntypedef enum\n{\n  NoDecoration,\n  UnderlineDecoration,\n  OverlineDecoration,\n  LineThroughDecoration\n} DecorationType;\n\ntypedef enum\n{\n  UndefinedRule,\n#undef EvenOddRule\n  EvenOddRule,\n  NonZeroRule\n} FillRule;\n\ntypedef enum\n{\n  UndefinedGradient,\n  LinearGradient,\n  RadialGradient\n} GradientType;\n\ntypedef enum\n{\n  UndefinedCap,\n  ButtCap,\n  RoundCap,\n  SquareCap\n} LineCap;\n\ntypedef enum\n{\n  UndefinedJoin,\n  MiterJoin,\n  RoundJoin,\n  BevelJoin\n} LineJoin;\n\ntypedef enum\n{\n  PointMethod = 0,\n  ReplaceMethod,\n  FloodfillMethod,\n  FillToBorderMethod,\n  ResetMethod\n} PaintMethod;\n\ntypedef enum\n{\n  UndefinedPrimitive = 0,\n  PointPrimitive,\n  LinePrimitive,\n  RectanglePrimitive,\n  RoundRectanglePrimitive,\n  ArcPrimitive,\n  EllipsePrimitive,\n  CirclePrimitive,\n  PolylinePrimitive,\n  PolygonPrimitive,\n  BezierPrimitive,\n  ColorPrimitive,\n  MattePrimitive,\n  TextPrimitive,\n  ImagePrimitive,\n  PathPrimitive\n} PrimitiveType;\n\ntypedef enum\n{\n  UndefinedReference,\n  GradientReference\n} ReferenceType;\n\ntypedef enum\n{\n  UndefinedSpread,\n  PadSpread,\n  ReflectSpead,\n  RepeatSpread\n} SpreadMethod;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _GradientInfo\n{\n  GradientType\n    type;\n\n  PixelPacket\n    color;\n\n  SegmentInfo\n    stop;\n\n  unsigned long\n    length;\n\n  SpreadMethod\n    spread;\n\n  unsigned long\n    signature;\n\n  struct _GradientInfo\n    *previous,\n    *next;\n} GradientInfo;\n\ntypedef struct _ElementReference\n{\n  char\n    *id;\n\n  ReferenceType\n    type;\n\n  GradientInfo\n    gradient;\n\n  unsigned long\n    signature;\n\n  struct _ElementReference\n    *previous,\n    *next;\n} ElementReference;\n\nstruct _DrawInfoExtra;  /* forward decl.; see member \"extra\" below */\n\ntypedef struct _DrawInfo\n{\n  char\n    *primitive,\n    *geometry;\n\n  AffineMatrix\n    affine;\n\n  GravityType\n    gravity;\n\n  PixelPacket\n    fill,\n    stroke;\n\n  double\n    stroke_width;\n\n  GradientInfo\n    gradient;\n\n  Image\n    *fill_pattern,\n    *tile,\n    *stroke_pattern;\n\n  unsigned int\n    stroke_antialias,\n    text_antialias;\n\n  FillRule\n    fill_rule;\n\n  LineCap\n    linecap;\n\n  LineJoin\n    linejoin;\n\n  unsigned long\n    miterlimit;\n\n  double\n    dash_offset;\n\n  DecorationType\n    decorate;\n\n  CompositeOperator\n    compose;\n\n  char\n    *text,\n    *font,\n    *family;\n\n  StyleType\n    style;\n\n  StretchType\n    stretch;\n\n  unsigned long\n    weight;\n\n  char\n    *encoding;\n\n  double\n    pointsize;\n\n  char\n    *density;\n\n  AlignType\n    align;\n\n  PixelPacket\n    undercolor,\n    border_color;\n\n  char\n    *server_name;\n\n  double\n    *dash_pattern; /* Terminated by value 0.0 (i.e. < MagickEpsilon)*/\n\n#if 0\n  char\n    *clip_path;\n#endif\n  /*\n    Allow for expansion of DrawInfo without increasing its size.  The\n    internals are defined only in render.c.  Clients outside of render.c\n    can access the internals via the provided access functions (see below).\n\n    This location in DrawInfo used to be occupied by char *clip_path. The\n    clip_path member now lives in _DrawInfoExtra.\n  */\n  struct _DrawInfoExtra\n    *extra;\n\n  SegmentInfo\n    bounds;\n\n  ClipPathUnits\n    clip_units;\n\n  Quantum\n    opacity;\n\n  unsigned int\n    render,\n    /*\n      Bit fields in flags:\n\n        Bit 0: should this DrawInfo should be drawn as:\n          0:  normal (original behavior)\n          1:  SVG compliant\n        Bit 1: is the DrawInfo a clipping path:\n          0:  is not a clipping path\n          1:  is a clipping path\n\n      Access to these bits should be through functions (defined in render.c):\n        IsDrawInfoClippingPath()\n        IsDrawInfoSVGCompliant()\n        IsDrawInfoSVGCompliantClippingPath()\n        SetDrawInfoClippingPath()\n        SetDrawInfoSVGCompliant()\n\n      At the present time the SVG compliance bit only affects how clipping paths are drawn.\n    */\n    flags;  /* previously \"unused1\" */\n\n  ElementReference\n    element_reference;\n\n  unsigned long\n    signature;\n} DrawInfo;\n\ntypedef struct _PointInfo\n{\n  double\n    x,\n    y;\n} PointInfo;\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/render-private.h\"\n#endif /* if defined(MAGICK_IMPLEMENTATION) */\n\ntypedef struct _TypeMetric\n{\n  PointInfo\n    pixels_per_em;\n\n  double\n    ascent,\n    descent,\n    width,\n    height,\n    max_advance;\n\n  SegmentInfo\n    bounds;\n\n  double\n    underline_position,\n    underline_thickness;\n} TypeMetric;\n\f\n/*\n  Method declarations.\n*/\nextern MagickExport DrawInfo\n  *CloneDrawInfo(const ImageInfo *,const DrawInfo *);\n\nextern MagickExport MagickPassFail\n  AnnotateImage(Image *,const DrawInfo *),\n  DrawAffineImage(Image *,const Image *,const AffineMatrix *),\n  DrawClipPath(Image *,const DrawInfo *,const char *),\n  DrawImage(Image *,const DrawInfo *),\n  DrawPatternPath(Image *,const DrawInfo *,const char *,Image **),\n  GetTypeMetrics(Image *,const DrawInfo *,TypeMetric *);\n\nextern MagickExport void\n  DestroyDrawInfo(DrawInfo *),\n  GetDrawInfo(const ImageInfo *,DrawInfo *);\n\n/* provide public access to the clip_path member of DrawInfo */\nextern MagickExport char\n  **DrawInfoGetClipPath(const DrawInfo *) MAGICK_FUNC_PURE;\n\n/* provide public access to the composite_path member of DrawInfo */\nextern MagickExport char\n  **DrawInfoGetCompositePath(const DrawInfo *) MAGICK_FUNC_PURE;\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_RENDER_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/resize.h",
    "content": "/*\n  Copyright (C) 2003 - 2012 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Resize Methods.\n*/\n#ifndef _MAGICK_RESIZE_H\n#define _MAGICK_RESIZE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#define DefaultResizeFilter LanczosFilter\n#define DefaultThumbnailFilter BoxFilter\n\nextern MagickExport Image\n  *MagnifyImage(const Image *,ExceptionInfo *),\n  *MinifyImage(const Image *,ExceptionInfo *),\n  *ResizeImage(const Image *,const unsigned long,const unsigned long,\n     const FilterTypes,const double,ExceptionInfo *),\n  *SampleImage(const Image *,const unsigned long,const unsigned long,\n   ExceptionInfo *),\n  *ScaleImage(const Image *,const unsigned long,const unsigned long,\n     ExceptionInfo *),\n  *ThumbnailImage(const Image *,const unsigned long,const unsigned long,\n   ExceptionInfo *),\n  *ZoomImage(const Image *,const unsigned long,const unsigned long,\n     ExceptionInfo *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_RESIZE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/resource.h",
    "content": "/*\n  Copyright (C) 2003 - 2015 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Resource methods.\n*/\n#ifndef _MAGICK_RESOURCE_H\n#define _MAGICK_RESOURCE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Typedef declarations.\n*/\ntypedef enum\n{\n  UndefinedResource=0, /* Undefined value */\n  DiskResource,        /* Pixel cache total disk space (Gigabytes) */\n  FileResource,        /* Pixel cache number of open files (Files) */\n  MapResource,         /* Pixel cache total file memory-mapping (Megabytes) */\n  MemoryResource,      /* Maximum pixel cache heap memory allocations (Megabytes) */\n  PixelsResource,      /* Maximum number of pixels in single image (Pixels) */\n  ThreadsResource,     /* Maximum number of worker threads */\n  WidthResource,       /* Maximum pixel width of an image (Pixels) */\n  HeightResource       /* Maximum pixel height of an image (Pixels) */\n} ResourceType;\n\n/*\n  Method declarations.\n*/\nextern MagickExport MagickPassFail\n  AcquireMagickResource(const ResourceType type,const magick_uint64_t size),\n  ListMagickResourceInfo(FILE *file,ExceptionInfo *exception),\n  SetMagickResourceLimit(const ResourceType type,const magick_int64_t limit);\n\nextern MagickExport magick_int64_t\n  GetMagickResource(const ResourceType type),\n  GetMagickResourceLimit(const ResourceType type);\n\nextern MagickExport void\n  DestroyMagickResources(void),\n  InitializeMagickResources(void),\n  LiberateMagickResource(const ResourceType type,const magick_uint64_t size);\n\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/shear.h",
    "content": "/*\n  Copyright (C) 2003-2012 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Shear Methods.\n*/\n#ifndef _MAGICK_SHEAR_H\n#define _MAGICK_SHEAR_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *AffineTransformImage(const Image *,const AffineMatrix *,ExceptionInfo *),\n  *AutoOrientImage(const Image *image,const OrientationType current_orientation,\n                   ExceptionInfo *exception),\n  *RotateImage(const Image *,const double,ExceptionInfo *),\n  *ShearImage(const Image *,const double,const double,ExceptionInfo *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_SHEAR_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/signature.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Digital signature methods.\n*/\n#ifndef _MAGICK_SIGNATURE_H\n#define _MAGICK_SIGNATURE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Define declarations.\n*/\n#define SignatureSize  64\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _SignatureInfo\n{\n  unsigned long\n    digest[8],\n    low_order,\n    high_order;\n\n  long\n    offset;\n\n  unsigned char\n    message[SignatureSize];\n} SignatureInfo;\n\n/*\n  Method declarations.\n*/\nextern MagickExport unsigned int\n  SignatureImage(Image *);\n\nextern MagickExport void\n  FinalizeSignature(SignatureInfo *),\n  GetSignatureInfo(SignatureInfo *),\n  TransformSignature(SignatureInfo *),\n  UpdateSignature(SignatureInfo *,const unsigned char *,const size_t);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/statistics.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Image Statistics Methods.\n*/\n#ifndef _MAGICK_STATISTICS_H\n#define _MAGICK_STATISTICS_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\ntypedef struct _ImageChannelStatistics\n {\n   /* Minimum value observed */\n   double maximum;\n   /* Maximum value observed */\n   double minimum;\n   /* Average (mean) value observed */\n   double mean;\n   /* Standard deviation, sqrt(variance) */\n   double standard_deviation;\n   /* Variance */\n   double variance;\n } ImageChannelStatistics;\n\ntypedef struct _ImageStatistics\n {\n   ImageChannelStatistics red;\n   ImageChannelStatistics green;\n   ImageChannelStatistics blue;\n   ImageChannelStatistics opacity;\n } ImageStatistics;\n\nextern MagickExport MagickPassFail\n  GetImageStatistics(const Image *image,ImageStatistics *statistics,\n                     ExceptionInfo *exception);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_STATISTICS_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/symbols.h",
    "content": "/*\n  Copyright (C) 2012-2018 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Library symbol name-scoping support.\n*/\n\n#if !defined(_MAGICK_SYMBOLS_H)\n#define _MAGICK_SYMBOLS_H\n\n#if defined(PREFIX_MAGICK_SYMBOLS)\n\n#define AccessCacheViewPixels GmAccessCacheViewPixels\n#define AccessDefaultCacheView GmAccessDefaultCacheView\n#define AccessDefinition GmAccessDefinition\n#define AccessImmutableIndexes GmAccessImmutableIndexes\n#define AccessMutableIndexes GmAccessMutableIndexes\n#define AccessMutablePixels GmAccessMutablePixels\n#define AccessThreadViewData GmAccessThreadViewData\n#define AccessThreadViewDataById GmAccessThreadViewDataById\n#define AcquireCacheView GmAcquireCacheView\n#define AcquireCacheViewIndexes GmAcquireCacheViewIndexes\n#define AcquireCacheViewPixels GmAcquireCacheViewPixels\n#define AcquireImagePixels GmAcquireImagePixels\n#define AcquireMagickRandomKernel GmAcquireMagickRandomKernel\n#define AcquireMagickResource GmAcquireMagickResource\n#define AcquireMemory GmAcquireMemory\n#define AcquireOneCacheViewPixel GmAcquireOneCacheViewPixel\n#define AcquireOnePixel GmAcquireOnePixel\n#define AcquireOnePixelByReference GmAcquireOnePixelByReference\n#define AcquireSemaphoreInfo GmAcquireSemaphoreInfo\n#define AcquireString GmAcquireString\n#define AcquireTemporaryFileDescriptor GmAcquireTemporaryFileDescriptor\n#define AcquireTemporaryFileName GmAcquireTemporaryFileName\n#define AcquireTemporaryFileStream GmAcquireTemporaryFileStream\n#define AdaptiveThresholdImage GmAdaptiveThresholdImage\n#define AddDefinition GmAddDefinition\n#define AddDefinitions GmAddDefinitions\n#define AddNoiseImage GmAddNoiseImage\n#define AddNoiseImageChannel GmAddNoiseImageChannel\n#define AffineTransformImage GmAffineTransformImage\n#define AllocateImage GmAllocateImage\n#define AllocateImageColormap GmAllocateImageColormap\n#define AllocateImageProfileIterator GmAllocateImageProfileIterator\n#define AllocateNextImage GmAllocateNextImage\n#define AllocateSemaphoreInfo GmAllocateSemaphoreInfo\n#define AllocateString GmAllocateString\n#define AllocateThreadViewDataArray GmAllocateThreadViewDataArray\n#define AllocateThreadViewDataSet GmAllocateThreadViewDataSet\n#define AllocateThreadViewSet GmAllocateThreadViewSet\n#define AnalyzeImage GmAnalyzeImage\n#define AnimateImageCommand GmAnimateImageCommand\n#define AnimateImages GmAnimateImages\n#define AnnotateImage GmAnnotateImage\n#define AppendImageFormat GmAppendImageFormat\n#define AppendImageProfile GmAppendImageProfile\n#define AppendImageToList GmAppendImageToList\n#define AppendImages GmAppendImages\n#define Ascii85Encode GmAscii85Encode\n#define Ascii85Flush GmAscii85Flush\n#define Ascii85Initialize GmAscii85Initialize\n#define Ascii85WriteByteHook GmAscii85WriteByteHook\n#define AssignThreadViewData GmAssignThreadViewData\n#define AttachBlob GmAttachBlob\n#define AutoOrientImage GmAutoOrientImage\n#define AverageImages GmAverageImages\n#define Base64Decode GmBase64Decode\n#define Base64Encode GmBase64Encode\n#define BenchmarkImageCommand GmBenchmarkImageCommand\n#define BlackThresholdImage GmBlackThresholdImage\n#define BlobIsSeekable GmBlobIsSeekable\n#define BlobModeToString GmBlobModeToString\n#define BlobReserveSize GmBlobReserveSize\n#define BlobToFile GmBlobToFile\n#define BlobToImage GmBlobToImage\n#define BlobWriteByteHook GmBlobWriteByteHook\n#define BlurImage GmBlurImage\n#define BlurImageChannel GmBlurImageChannel\n#define BorderImage GmBorderImage\n#define CatchException GmCatchException\n#define CatchImageException GmCatchImageException\n#define CdlImage GmCdlImage\n#define ChannelImage GmChannelImage\n#define ChannelThresholdImage GmChannelThresholdImage\n#define ChannelTypeToString GmChannelTypeToString\n#define CharcoalImage GmCharcoalImage\n#define CheckImagePixelLimits GmCheckImagePixelLimits\n#define ChopImage GmChopImage\n#define ClassTypeToString GmClassTypeToString\n#define ClipImage GmClipImage\n#define ClipPathImage GmClipPathImage\n#define CloneBlobInfo GmCloneBlobInfo\n#define CloneDrawInfo GmCloneDrawInfo\n#define CloneImage GmCloneImage\n#define CloneImageAttributes GmCloneImageAttributes\n#define CloneImageInfo GmCloneImageInfo\n#define CloneImageList GmCloneImageList\n#define CloneMemory GmCloneMemory\n#define CloneMontageInfo GmCloneMontageInfo\n#define CloneQuantizeInfo GmCloneQuantizeInfo\n#define CloneString GmCloneString\n#define CloseBlob GmCloseBlob\n#define CloseCacheView GmCloseCacheView\n#define CoalesceImages GmCoalesceImages\n#define ColorFloodfillImage GmColorFloodfillImage\n#define ColorMatrixImage GmColorMatrixImage\n#define ColorizeImage GmColorizeImage\n#define ColorspaceTypeToString GmColorspaceTypeToString\n#define CompareImageCommand GmCompareImageCommand\n#define CompositeImage GmCompositeImage\n#define CompositeImageCommand GmCompositeImageCommand\n#define CompositeImageRegion GmCompositeImageRegion\n#define CompositeMaskImage GmCompositeMaskImage\n#define CompositeOperatorToString GmCompositeOperatorToString\n#define CompositePathImage GmCompositePathImage\n#define CompressImageColormap GmCompressImageColormap\n#define CompressionTypeToString GmCompressionTypeToString\n#define ConcatenateString GmConcatenateString\n#define ConfirmAccessModeToString GmConfirmAccessModeToString\n#define ConjureImageCommand GmConjureImageCommand\n#define ConstituteImage GmConstituteImage\n#define ConstituteTextureImage GmConstituteTextureImage\n#define ContinueTimer GmContinueTimer\n#define Contrast GmContrast\n#define ContrastImage GmContrastImage\n#define ConvertImageCommand GmConvertImageCommand\n#define ConvolveImage GmConvolveImage\n#define CopyException GmCopyException\n#define CropImage GmCropImage\n#define CycleColormapImage GmCycleColormapImage\n#define DeallocateImageProfileIterator GmDeallocateImageProfileIterator\n#define DeconstructImages GmDeconstructImages\n#define DefineClientName GmDefineClientName\n#define DefineClientPathAndName GmDefineClientPathAndName\n#define DeleteImageFromList GmDeleteImageFromList\n#define DeleteImageProfile GmDeleteImageProfile\n#define DeleteMagickRegistry GmDeleteMagickRegistry\n#define DescribeImage GmDescribeImage\n#define DespeckleImage GmDespeckleImage\n#define DestroyBlob GmDestroyBlob\n#define DestroyBlobInfo GmDestroyBlobInfo\n#define DestroyCacheInfo GmDestroyCacheInfo\n#define DestroyColorInfo GmDestroyColorInfo\n#define DestroyConstitute GmDestroyConstitute\n#define DestroyDelegateInfo GmDestroyDelegateInfo\n#define DestroyDrawInfo GmDestroyDrawInfo\n#define DestroyExceptionInfo GmDestroyExceptionInfo\n#define DestroyImage GmDestroyImage\n#define DestroyImageAttributes GmDestroyImageAttributes\n#define DestroyImageInfo GmDestroyImageInfo\n#define DestroyImageList GmDestroyImageList\n#define DestroyImagePixels GmDestroyImagePixels\n#define DestroyLogInfo GmDestroyLogInfo\n#define DestroyMagicInfo GmDestroyMagicInfo\n#define DestroyMagick GmDestroyMagick\n#define DestroyMagickExceptionHandling GmDestroyMagickExceptionHandling\n#define DestroyMagickModules GmDestroyMagickModules\n#define DestroyMagickMonitor GmDestroyMagickMonitor\n#define DestroyMagickRandomGenerator GmDestroyMagickRandomGenerator\n#define DestroyMagickRegistry GmDestroyMagickRegistry\n#define DestroyMagickResources GmDestroyMagickResources\n#define DestroyMontageInfo GmDestroyMontageInfo\n#define DestroyQuantizeInfo GmDestroyQuantizeInfo\n#define DestroySemaphore GmDestroySemaphore\n#define DestroySemaphoreInfo GmDestroySemaphoreInfo\n#define DestroyTemporaryFiles GmDestroyTemporaryFiles\n#define DestroyThreadViewDataSet GmDestroyThreadViewDataSet\n#define DestroyThreadViewSet GmDestroyThreadViewSet\n#define DestroyTypeInfo GmDestroyTypeInfo\n#define DetachBlob GmDetachBlob\n#define DifferenceImage GmDifferenceImage\n#define DisassociateBlob GmDisassociateBlob\n#define DispatchImage GmDispatchImage\n#define DisplayImageCommand GmDisplayImageCommand\n#define DisplayImages GmDisplayImages\n#define DrawAffine GmDrawAffine\n#define DrawAffineImage GmDrawAffineImage\n#define DrawAllocateContext GmDrawAllocateContext\n#define DrawAnnotation GmDrawAnnotation\n#define DrawArc GmDrawArc\n#define DrawBezier GmDrawBezier\n#define DrawCircle GmDrawCircle\n#define DrawClipPath GmDrawClipPath\n#define DrawColor GmDrawColor\n#define DrawComment GmDrawComment\n#define DrawComposite GmDrawComposite\n#define DrawCompositeMask GmDrawCompositeMask\n#define DrawDestroyContext GmDrawDestroyContext\n#define DrawEllipse GmDrawEllipse\n#define DrawGetClipPath GmDrawGetClipPath\n#define DrawGetClipRule GmDrawGetClipRule\n#define DrawGetClipUnits GmDrawGetClipUnits\n#define DrawGetFillColor GmDrawGetFillColor\n#define DrawGetFillOpacity GmDrawGetFillOpacity\n#define DrawGetFillRule GmDrawGetFillRule\n#define DrawGetFont GmDrawGetFont\n#define DrawGetFontFamily GmDrawGetFontFamily\n#define DrawGetFontSize GmDrawGetFontSize\n#define DrawGetFontStretch GmDrawGetFontStretch\n#define DrawGetFontStyle GmDrawGetFontStyle\n#define DrawGetFontWeight GmDrawGetFontWeight\n#define DrawGetGravity GmDrawGetGravity\n#define DrawGetStrokeAntialias GmDrawGetStrokeAntialias\n#define DrawGetStrokeColor GmDrawGetStrokeColor\n#define DrawGetStrokeDashArray GmDrawGetStrokeDashArray\n#define DrawGetStrokeDashOffset GmDrawGetStrokeDashOffset\n#define DrawGetStrokeLineCap GmDrawGetStrokeLineCap\n#define DrawGetStrokeLineJoin GmDrawGetStrokeLineJoin\n#define DrawGetStrokeMiterLimit GmDrawGetStrokeMiterLimit\n#define DrawGetStrokeOpacity GmDrawGetStrokeOpacity\n#define DrawGetStrokeWidth GmDrawGetStrokeWidth\n#define DrawGetTextAntialias GmDrawGetTextAntialias\n#define DrawGetTextDecoration GmDrawGetTextDecoration\n#define DrawGetTextEncoding GmDrawGetTextEncoding\n#define DrawGetTextUnderColor GmDrawGetTextUnderColor\n#define DrawImage GmDrawImage\n#define DrawInfoGetClipPath GmDrawInfoGetClipPath\n#define DrawInfoGetCompositePath GmDrawInfoGetCompositePath\n#define DrawLine GmDrawLine\n#define DrawMatte GmDrawMatte\n#define DrawPathClose GmDrawPathClose\n#define DrawPathCurveToAbsolute GmDrawPathCurveToAbsolute\n#define DrawPathCurveToQuadraticBezierAbsolute GmDrawPathCurveToQuadraticBezierAbsolute\n#define DrawPathCurveToQuadraticBezierRelative GmDrawPathCurveToQuadraticBezierRelative\n#define DrawPathCurveToQuadraticBezierSmoothAbsolute GmDrawPathCurveToQuadraticBezierSmoothAbsolute\n#define DrawPathCurveToQuadraticBezierSmoothRelative GmDrawPathCurveToQuadraticBezierSmoothRelative\n#define DrawPathCurveToRelative GmDrawPathCurveToRelative\n#define DrawPathCurveToSmoothAbsolute GmDrawPathCurveToSmoothAbsolute\n#define DrawPathCurveToSmoothRelative GmDrawPathCurveToSmoothRelative\n#define DrawPathEllipticArcAbsolute GmDrawPathEllipticArcAbsolute\n#define DrawPathEllipticArcRelative GmDrawPathEllipticArcRelative\n#define DrawPathFinish GmDrawPathFinish\n#define DrawPathLineToAbsolute GmDrawPathLineToAbsolute\n#define DrawPathLineToHorizontalAbsolute GmDrawPathLineToHorizontalAbsolute\n#define DrawPathLineToHorizontalRelative GmDrawPathLineToHorizontalRelative\n#define DrawPathLineToRelative GmDrawPathLineToRelative\n#define DrawPathLineToVerticalAbsolute GmDrawPathLineToVerticalAbsolute\n#define DrawPathLineToVerticalRelative GmDrawPathLineToVerticalRelative\n#define DrawPathMoveToAbsolute GmDrawPathMoveToAbsolute\n#define DrawPathMoveToRelative GmDrawPathMoveToRelative\n#define DrawPathStart GmDrawPathStart\n#define DrawPatternPath GmDrawPatternPath\n#define DrawPeekGraphicContext GmDrawPeekGraphicContext\n#define DrawPoint GmDrawPoint\n#define DrawPolygon GmDrawPolygon\n#define DrawPolyline GmDrawPolyline\n#define DrawPopClipPath GmDrawPopClipPath\n#define DrawPopDefs GmDrawPopDefs\n#define DrawPopGraphicContext GmDrawPopGraphicContext\n#define DrawPopPattern GmDrawPopPattern\n#define DrawPushClipPath GmDrawPushClipPath\n#define DrawPushDefs GmDrawPushDefs\n#define DrawPushGraphicContext GmDrawPushGraphicContext\n#define DrawPushPattern GmDrawPushPattern\n#define DrawRectangle GmDrawRectangle\n#define DrawRender GmDrawRender\n#define DrawRotate GmDrawRotate\n#define DrawRoundRectangle GmDrawRoundRectangle\n#define DrawScale GmDrawScale\n#define DrawSetClipPath GmDrawSetClipPath\n#define DrawSetClipRule GmDrawSetClipRule\n#define DrawSetClipUnits GmDrawSetClipUnits\n#define DrawSetFillColor GmDrawSetFillColor\n#define DrawSetFillColorString GmDrawSetFillColorString\n#define DrawSetFillOpacity GmDrawSetFillOpacity\n#define DrawSetFillPatternURL GmDrawSetFillPatternURL\n#define DrawSetFillRule GmDrawSetFillRule\n#define DrawSetFont GmDrawSetFont\n#define DrawSetFontFamily GmDrawSetFontFamily\n#define DrawSetFontSize GmDrawSetFontSize\n#define DrawSetFontStretch GmDrawSetFontStretch\n#define DrawSetFontStyle GmDrawSetFontStyle\n#define DrawSetFontWeight GmDrawSetFontWeight\n#define DrawSetGravity GmDrawSetGravity\n#define DrawSetStrokeAntialias GmDrawSetStrokeAntialias\n#define DrawSetStrokeColor GmDrawSetStrokeColor\n#define DrawSetStrokeColorString GmDrawSetStrokeColorString\n#define DrawSetStrokeDashArray GmDrawSetStrokeDashArray\n#define DrawSetStrokeDashOffset GmDrawSetStrokeDashOffset\n#define DrawSetStrokeLineCap GmDrawSetStrokeLineCap\n#define DrawSetStrokeLineJoin GmDrawSetStrokeLineJoin\n#define DrawSetStrokeMiterLimit GmDrawSetStrokeMiterLimit\n#define DrawSetStrokeOpacity GmDrawSetStrokeOpacity\n#define DrawSetStrokePatternURL GmDrawSetStrokePatternURL\n#define DrawSetStrokeWidth GmDrawSetStrokeWidth\n#define DrawSetTextAntialias GmDrawSetTextAntialias\n#define DrawSetTextDecoration GmDrawSetTextDecoration\n#define DrawSetTextEncoding GmDrawSetTextEncoding\n#define DrawSetTextUnderColor GmDrawSetTextUnderColor\n#define DrawSetTextUnderColorString GmDrawSetTextUnderColorString\n#define DrawSetViewbox GmDrawSetViewbox\n#define DrawSkewX GmDrawSkewX\n#define DrawSkewY GmDrawSkewY\n#define DrawTranslate GmDrawTranslate\n#define EOFBlob GmEOFBlob\n#define EdgeImage GmEdgeImage\n#define EmbossImage GmEmbossImage\n#define EndianTypeToString GmEndianTypeToString\n#define EnhanceImage GmEnhanceImage\n#define EqualizeImage GmEqualizeImage\n#define EscapeString GmEscapeString\n#define ExecuteModuleProcess GmExecuteModuleProcess\n#define ExpandAffine GmExpandAffine\n#define ExpandFilename GmExpandFilename\n#define ExpandFilenames GmExpandFilenames\n#define ExportImageChannel GmExportImageChannel\n#define ExportImagePixelArea GmExportImagePixelArea\n#define ExportPixelAreaOptionsInit GmExportPixelAreaOptionsInit\n#define ExportViewPixelArea GmExportViewPixelArea\n#define ExtentImage GmExtentImage\n#define FileToBlob GmFileToBlob\n#define FinalizeSignature GmFinalizeSignature\n#define FlattenImages GmFlattenImages\n#define FlipImage GmFlipImage\n#define FlopImage GmFlopImage\n#define FormatSize GmFormatSize\n#define FormatString GmFormatString\n#define FormatStringList GmFormatStringList\n#define FrameImage GmFrameImage\n#define FuzzyColorMatch GmFuzzyColorMatch\n#define GammaImage GmGammaImage\n#define GaussianBlurImage GmGaussianBlurImage\n#define GaussianBlurImageChannel GmGaussianBlurImageChannel\n#define GenerateDifferentialNoise GmGenerateDifferentialNoise\n#define GenerateNoise GmGenerateNoise\n#define GetBlobFileHandle GmGetBlobFileHandle\n#define GetBlobFirstErrno GmGetBlobFirstErrno\n#define GetBlobInfo GmGetBlobInfo\n#define GetBlobIsOpen GmGetBlobIsOpen\n#define GetBlobSize GmGetBlobSize\n#define GetBlobStatus GmGetBlobStatus\n#define GetBlobStreamData GmGetBlobStreamData\n#define GetBlobTemporary GmGetBlobTemporary\n#define GetCacheInfo GmGetCacheInfo\n#define GetCacheView GmGetCacheView\n#define GetCacheViewArea GmGetCacheViewArea\n#define GetCacheViewImage GmGetCacheViewImage\n#define GetCacheViewIndexes GmGetCacheViewIndexes\n#define GetCacheViewPixels GmGetCacheViewPixels\n#define GetCacheViewRegion GmGetCacheViewRegion\n#define GetClientFilename GmGetClientFilename\n#define GetClientName GmGetClientName\n#define GetClientPath GmGetClientPath\n#define GetColorHistogram GmGetColorHistogram\n#define GetColorInfo GmGetColorInfo\n#define GetColorInfoArray GmGetColorInfoArray\n#define GetColorList GmGetColorList\n#define GetColorTuple GmGetColorTuple\n#define GetConfigureBlob GmGetConfigureBlob\n#define GetDelegateCommand GmGetDelegateCommand\n#define GetDelegateInfo GmGetDelegateInfo\n#define GetDrawInfo GmGetDrawInfo\n#define GetElapsedTime GmGetElapsedTime\n#define GetExceptionInfo GmGetExceptionInfo\n#define GetExecutionPath GmGetExecutionPath\n#define GetExecutionPathUsingName GmGetExecutionPathUsingName\n#define GetFirstImageInList GmGetFirstImageInList\n#define GetGeometry GmGetGeometry\n#define GetImageAttribute GmGetImageAttribute\n#define GetImageBoundingBox GmGetImageBoundingBox\n#define GetImageChannelDepth GmGetImageChannelDepth\n#define GetImageChannelDifference GmGetImageChannelDifference\n#define GetImageChannelDistortion GmGetImageChannelDistortion\n#define GetImageCharacteristics GmGetImageCharacteristics\n#define GetImageClipMask GmGetImageClipMask\n#define GetImageClippingPathAttribute GmGetImageClippingPathAttribute\n#define GetImageCompositeMask GmGetImageCompositeMask\n#define GetImageDepth GmGetImageDepth\n#define GetImageDistortion GmGetImageDistortion\n#define GetImageException GmGetImageException\n#define GetImageFromList GmGetImageFromList\n#define GetImageFromMagickRegistry GmGetImageFromMagickRegistry\n#define GetImageGeometry GmGetImageGeometry\n#define GetImageIndexInList GmGetImageIndexInList\n#define GetImageInfo GmGetImageInfo\n#define GetImageInfoAttribute GmGetImageInfoAttribute\n#define GetImageListLength GmGetImageListLength\n#define GetImageMagick GmGetImageMagick\n#define GetImagePixels GmGetImagePixels\n#define GetImagePixelsEx GmGetImagePixelsEx\n#define GetImageProfile GmGetImageProfile\n#define GetImageQuantizeError GmGetImageQuantizeError\n#define GetImageStatistics GmGetImageStatistics\n#define GetImageType GmGetImageType\n#define GetImageVirtualPixelMethod GmGetImageVirtualPixelMethod\n#define GetIndexes GmGetIndexes\n#define GetLastImageInList GmGetLastImageInList\n#define GetLocaleExceptionMessage GmGetLocaleExceptionMessage\n#define GetLocaleMessage GmGetLocaleMessage\n#define GetLocaleMessageFromID GmGetLocaleMessageFromID\n#define GetMagickCopyright GmGetMagickCopyright\n#define GetMagickDimension GmGetMagickDimension\n#define GetMagickFileFormat GmGetMagickFileFormat\n#define GetMagickGeometry GmGetMagickGeometry\n#define GetMagickInfo GmGetMagickInfo\n#define GetMagickInfoArray GmGetMagickInfoArray\n#define GetMagickRegistry GmGetMagickRegistry\n#define GetMagickResource GmGetMagickResource\n#define GetMagickResourceLimit GmGetMagickResourceLimit\n#define GetMagickVersion GmGetMagickVersion\n#define GetMagickWebSite GmGetMagickWebSite\n#define GetMontageInfo GmGetMontageInfo\n#define GetNextImageInList GmGetNextImageInList\n#define GetNumberColors GmGetNumberColors\n#define GetOnePixel GmGetOnePixel\n#define GetOptimalKernelWidth GmGetOptimalKernelWidth\n#define GetOptimalKernelWidth1D GmGetOptimalKernelWidth1D\n#define GetOptimalKernelWidth2D GmGetOptimalKernelWidth2D\n#define GetPageGeometry GmGetPageGeometry\n#define GetPathComponent GmGetPathComponent\n#define GetPixelCacheArea GmGetPixelCacheArea\n#define GetPixelCacheInCore GmGetPixelCacheInCore\n#define GetPixelCachePresent GmGetPixelCachePresent\n#define GetPixels GmGetPixels\n#define GetPostscriptDelegateInfo GmGetPostscriptDelegateInfo\n#define GetPreviousImageInList GmGetPreviousImageInList\n#define GetQuantizeInfo GmGetQuantizeInfo\n#define GetSignatureInfo GmGetSignatureInfo\n#define GetThreadViewDataSetAllocatedViews GmGetThreadViewDataSetAllocatedViews\n#define GetTimerInfo GmGetTimerInfo\n#define GetTimerResolution GmGetTimerResolution\n#define GetToken GmGetToken\n#define GetTypeInfo GmGetTypeInfo\n#define GetTypeInfoByFamily GmGetTypeInfoByFamily\n#define GetTypeList GmGetTypeList\n#define GetTypeMetrics GmGetTypeMetrics\n#define GetUserTime GmGetUserTime\n#define GlobExpression GmGlobExpression\n#define GradientImage GmGradientImage\n#define GravityTypeToString GmGravityTypeToString\n#define GrayscalePseudoClassImage GmGrayscalePseudoClassImage\n#define HSLTransform GmHSLTransform\n#define HWBTransform GmHWBTransform\n#define HaldClutImage GmHaldClutImage\n#define HighlightStyleToString GmHighlightStyleToString\n#define HuffmanDecodeImage GmHuffmanDecodeImage\n#define HuffmanEncode2Image GmHuffmanEncode2Image\n#define HuffmanEncodeImage GmHuffmanEncodeImage\n#define Hull GmHull\n#define IdentifyImageCommand GmIdentifyImageCommand\n#define IdentityAffine GmIdentityAffine\n#define ImageGetClipMask GmImageGetClipMask\n#define ImageGetCompositeMask GmImageGetCompositeMask\n#define ImageListToArray GmImageListToArray\n#define ImageToBlob GmImageToBlob\n#define ImageToFile GmImageToFile\n#define ImageToHuffman2DBlob GmImageToHuffman2DBlob\n#define ImageToJPEGBlob GmImageToJPEGBlob\n#define ImageTypeToString GmImageTypeToString\n#define ImplodeImage GmImplodeImage\n#define ImportImageChannel GmImportImageChannel\n#define ImportImageChannelsMasked GmImportImageChannelsMasked\n#define ImportImageCommand GmImportImageCommand\n#define ImportImagePixelArea GmImportImagePixelArea\n#define ImportPixelAreaOptionsInit GmImportPixelAreaOptionsInit\n#define ImportViewPixelArea GmImportViewPixelArea\n#define InitializeColorInfo GmInitializeColorInfo\n#define InitializeConstitute GmInitializeConstitute\n#define InitializeDelegateInfo GmInitializeDelegateInfo\n#define InitializeDifferenceImageOptions GmInitializeDifferenceImageOptions\n#define InitializeDifferenceStatistics GmInitializeDifferenceStatistics\n#define InitializeLogInfo GmInitializeLogInfo\n#define InitializeLogInfoPost GmInitializeLogInfoPost\n#define InitializeMagicInfo GmInitializeMagicInfo\n#define InitializeMagick GmInitializeMagick\n#define InitializeMagickEx GmInitializeMagickEx\n#define InitializeMagickExceptionHandling GmInitializeMagickExceptionHandling\n#define InitializeMagickModules GmInitializeMagickModules\n#define InitializeMagickMonitor GmInitializeMagickMonitor\n#define InitializeMagickRandomGenerator GmInitializeMagickRandomGenerator\n#define InitializeMagickRandomKernel GmInitializeMagickRandomKernel\n#define InitializeMagickRegistry GmInitializeMagickRegistry\n#define InitializeMagickResources GmInitializeMagickResources\n#define InitializePixelIteratorOptions GmInitializePixelIteratorOptions\n#define InitializeSemaphore GmInitializeSemaphore\n#define InitializeTemporaryFiles GmInitializeTemporaryFiles\n#define InitializeTypeInfo GmInitializeTypeInfo\n#define InsertImageInList GmInsertImageInList\n#define InsertRowHDU GmInsertRowHDU\n#define InterlaceTypeToString GmInterlaceTypeToString\n#define InterpolateColor GmInterpolateColor\n#define InterpolateViewColor GmInterpolateViewColor\n#define InvokeDelegate GmInvokeDelegate\n#define InvokePostscriptDelegate GmInvokePostscriptDelegate\n#define IsAccessible GmIsAccessible\n#define IsAccessibleAndNotEmpty GmIsAccessibleAndNotEmpty\n#define IsAccessibleNoLogging GmIsAccessibleNoLogging\n#define IsEventLogging GmIsEventLogging\n#define IsGeometry GmIsGeometry\n#define IsGlob GmIsGlob\n#define IsGrayImage GmIsGrayImage\n#define IsImagesEqual GmIsImagesEqual\n#define IsMagickConflict GmIsMagickConflict\n#define IsMonochromeImage GmIsMonochromeImage\n#define IsOpaqueImage GmIsOpaqueImage\n#define IsPaletteImage GmIsPaletteImage\n#define IsSubimage GmIsSubimage\n#define IsTaintImage GmIsTaintImage\n#define IsWriteable GmIsWriteable\n#define LZWEncode2Image GmLZWEncode2Image\n#define LZWEncodeImage GmLZWEncodeImage\n#define LevelImage GmLevelImage\n#define LevelImageChannel GmLevelImageChannel\n#define LiberateMagickResource GmLiberateMagickResource\n#define LiberateMemory GmLiberateMemory\n#define LiberateSemaphoreInfo GmLiberateSemaphoreInfo\n#define LiberateTemporaryFile GmLiberateTemporaryFile\n#define ListColorInfo GmListColorInfo\n#define ListDelegateInfo GmListDelegateInfo\n#define ListFiles GmListFiles\n#define ListMagicInfo GmListMagicInfo\n#define ListMagickInfo GmListMagickInfo\n#define ListMagickResourceInfo GmListMagickResourceInfo\n#define ListModuleMap GmListModuleMap\n#define ListTypeInfo GmListTypeInfo\n#define LocaleCompare GmLocaleCompare\n#define LocaleLower GmLocaleLower\n#define LocaleNCompare GmLocaleNCompare\n#define LocaleUpper GmLocaleUpper\n#define LockSemaphoreInfo GmLockSemaphoreInfo\n#define MSBOrderLong GmMSBOrderLong\n#define MSBOrderShort GmMSBOrderShort\n#define MagickAllocFunctions GmMagickAllocFunctions\n#define MagickArraySize GmMagickArraySize\n#define MagickAtoFChk GmMagickAtoFChk\n#define MagickAtoIChk GmMagickAtoIChk\n#define MagickAtoLChk GmMagickAtoLChk\n#define MagickAtoUIChk GmMagickAtoUIChk\n#define MagickAtoULChk GmMagickAtoULChk\n#define MagickBitStreamInitializeRead GmMagickBitStreamInitializeRead\n#define MagickBitStreamInitializeWrite GmMagickBitStreamInitializeWrite\n#define MagickBitStreamMSBRead GmMagickBitStreamMSBRead\n#define MagickBitStreamMSBWrite GmMagickBitStreamMSBWrite\n#define MagickCloneMemory GmMagickCloneMemory\n#define MagickCommand GmMagickCommand\n#define MagickCompositeImageUnderColor GmMagickCompositeImageUnderColor\n#define MagickConfirmAccess GmMagickConfirmAccess\n#define MagickConstrainColormapIndex GmMagickConstrainColormapIndex\n#define MagickCreateDirectoryPath GmMagickCreateDirectoryPath\n#define MagickDestroyCommandInfo GmMagickDestroyCommandInfo\n#define MagickFindRawImageMinMax GmMagickFindRawImageMinMax\n#define MagickFmax GmMagickFmax\n#define MagickFmin GmMagickFmin\n#define MagickFormatString GmMagickFormatString\n#define MagickFormatStringList GmMagickFormatStringList\n#define MagickFree GmMagickFree\n#define MagickFreeAligned GmMagickFreeAligned\n#define MagickGetBitRevTable GmMagickGetBitRevTable\n#define MagickGetFileAttributes GmMagickGetFileAttributes\n#define MagickGetFileSystemBlockSize GmMagickGetFileSystemBlockSize\n#define MagickGetMMUPageSize GmMagickGetMMUPageSize\n#define MagickGetQuantumSamplesPerPixel GmMagickGetQuantumSamplesPerPixel\n#define MagickGetToken GmMagickGetToken\n#define MagickInitializeCommandInfo GmMagickInitializeCommandInfo\n#define MagickIsTrue GmMagickIsTrue\n#define MagickMalloc GmMagickMalloc\n#define MagickMallocAligned GmMagickMallocAligned\n#define MagickMallocAlignedArray GmMagickMallocAlignedArray\n#define MagickMallocArray GmMagickMallocArray\n#define MagickMallocCleared GmMagickMallocCleared\n#define MagickMapAccessEntry GmMagickMapAccessEntry\n#define MagickMapAddEntry GmMagickMapAddEntry\n#define MagickMapAllocateIterator GmMagickMapAllocateIterator\n#define MagickMapAllocateMap GmMagickMapAllocateMap\n#define MagickMapClearMap GmMagickMapClearMap\n#define MagickMapCloneMap GmMagickMapCloneMap\n#define MagickMapCopyBlob GmMagickMapCopyBlob\n#define MagickMapCopyString GmMagickMapCopyString\n#define MagickMapDeallocateBlob GmMagickMapDeallocateBlob\n#define MagickMapDeallocateIterator GmMagickMapDeallocateIterator\n#define MagickMapDeallocateMap GmMagickMapDeallocateMap\n#define MagickMapDeallocateString GmMagickMapDeallocateString\n#define MagickMapDereferenceIterator GmMagickMapDereferenceIterator\n#define MagickMapIterateNext GmMagickMapIterateNext\n#define MagickMapIteratePrevious GmMagickMapIteratePrevious\n#define MagickMapIterateToBack GmMagickMapIterateToBack\n#define MagickMapIterateToFront GmMagickMapIterateToFront\n#define MagickMapRemoveEntry GmMagickMapRemoveEntry\n#define MagickMonitor GmMagickMonitor\n#define MagickMonitorActive GmMagickMonitorActive\n#define MagickMonitorFormatted GmMagickMonitorFormatted\n#define MagickRandNewSeed GmMagickRandNewSeed\n#define MagickRandReentrant GmMagickRandReentrant\n#define MagickRandomInteger GmMagickRandomInteger\n#define MagickRandomReal GmMagickRandomReal\n#define MagickRealloc GmMagickRealloc\n#define MagickReverseBits GmMagickReverseBits\n#define MagickSceneFileName GmMagickSceneFileName\n#define MagickSetConfirmAccessHandler GmMagickSetConfirmAccessHandler\n#define MagickSetFileAttributes GmMagickSetFileAttributes\n#define MagickSetFileSystemBlockSize GmMagickSetFileSystemBlockSize\n#define MagickSizeStrToInt64 GmMagickSizeStrToInt64\n#define MagickSpawnVP GmMagickSpawnVP\n#define MagickStripSpacesFromString GmMagickStripSpacesFromString\n#define MagickStrlCat GmMagickStrlCat\n#define MagickStrlCpy GmMagickStrlCpy\n#define MagickStrlCpyTrunc GmMagickStrlCpyTrunc\n#define MagickSwabArrayOfDouble GmMagickSwabArrayOfDouble\n#define MagickSwabArrayOfFloat GmMagickSwabArrayOfFloat\n#define MagickSwabArrayOfUInt16 GmMagickSwabArrayOfUInt16\n#define MagickSwabArrayOfUInt32 GmMagickSwabArrayOfUInt32\n#define MagickSwabDouble GmMagickSwabDouble\n#define MagickSwabFloat GmMagickSwabFloat\n#define MagickSwabUInt16 GmMagickSwabUInt16\n#define MagickSwabUInt32 GmMagickSwabUInt32\n#define MagickToMime GmMagickToMime\n#define MagickTsdGetSpecific GmMagickTsdGetSpecific\n#define MagickTsdKeyCreate GmMagickTsdKeyCreate\n#define MagickTsdKeyCreate2 GmMagickTsdKeyCreate2\n#define MagickTsdKeyDelete GmMagickTsdKeyDelete\n#define MagickTsdSetSpecific GmMagickTsdSetSpecific\n#define MagickWordStreamInitializeRead GmMagickWordStreamInitializeRead\n#define MagickWordStreamInitializeWrite GmMagickWordStreamInitializeWrite\n#define MagickWordStreamLSBRead GmMagickWordStreamLSBRead\n#define MagickWordStreamLSBWrite GmMagickWordStreamLSBWrite\n#define MagickWordStreamLSBWriteFlush GmMagickWordStreamLSBWriteFlush\n#define MagickXAnimateBackgroundImage GmMagickXAnimateBackgroundImage\n#define MagickXAnimateImages GmMagickXAnimateImages\n#define MagickXAnnotateImage GmMagickXAnnotateImage\n#define MagickXBestFont GmMagickXBestFont\n#define MagickXBestIconSize GmMagickXBestIconSize\n#define MagickXBestPixel GmMagickXBestPixel\n#define MagickXBestVisualInfo GmMagickXBestVisualInfo\n#define MagickXCheckRefreshWindows GmMagickXCheckRefreshWindows\n#define MagickXClientMessage GmMagickXClientMessage\n#define MagickXColorBrowserWidget GmMagickXColorBrowserWidget\n#define MagickXCommandWidget GmMagickXCommandWidget\n#define MagickXConfigureImageColormap GmMagickXConfigureImageColormap\n#define MagickXConfirmWidget GmMagickXConfirmWidget\n#define MagickXConstrainWindowPosition GmMagickXConstrainWindowPosition\n#define MagickXDelay GmMagickXDelay\n#define MagickXDestroyResourceInfo GmMagickXDestroyResourceInfo\n#define MagickXDestroyWindowColors GmMagickXDestroyWindowColors\n#define MagickXDestroyX11Resources GmMagickXDestroyX11Resources\n#define MagickXDestroyXWindowInfo GmMagickXDestroyXWindowInfo\n#define MagickXDestroyXWindows GmMagickXDestroyXWindows\n#define MagickXDialogWidget GmMagickXDialogWidget\n#define MagickXDisplayBackgroundImage GmMagickXDisplayBackgroundImage\n#define MagickXDisplayImage GmMagickXDisplayImage\n#define MagickXDisplayImageInfo GmMagickXDisplayImageInfo\n#define MagickXDrawImage GmMagickXDrawImage\n#define MagickXError GmMagickXError\n#define MagickXFileBrowserWidget GmMagickXFileBrowserWidget\n#define MagickXFontBrowserWidget GmMagickXFontBrowserWidget\n#define MagickXFreeResources GmMagickXFreeResources\n#define MagickXFreeStandardColormap GmMagickXFreeStandardColormap\n#define MagickXGetAnnotateInfo GmMagickXGetAnnotateInfo\n#define MagickXGetImportInfo GmMagickXGetImportInfo\n#define MagickXGetMapInfo GmMagickXGetMapInfo\n#define MagickXGetPixelPacket GmMagickXGetPixelPacket\n#define MagickXGetResourceClass GmMagickXGetResourceClass\n#define MagickXGetResourceDatabase GmMagickXGetResourceDatabase\n#define MagickXGetResourceInfo GmMagickXGetResourceInfo\n#define MagickXGetResourceInstance GmMagickXGetResourceInstance\n#define MagickXGetScreenDensity GmMagickXGetScreenDensity\n#define MagickXGetWindowColor GmMagickXGetWindowColor\n#define MagickXGetWindowInfo GmMagickXGetWindowInfo\n#define MagickXHighlightEllipse GmMagickXHighlightEllipse\n#define MagickXHighlightLine GmMagickXHighlightLine\n#define MagickXHighlightRectangle GmMagickXHighlightRectangle\n#define MagickXImportImage GmMagickXImportImage\n#define MagickXInfoWidget GmMagickXInfoWidget\n#define MagickXInitializeWindows GmMagickXInitializeWindows\n#define MagickXListBrowserWidget GmMagickXListBrowserWidget\n#define MagickXMagickMonitor GmMagickXMagickMonitor\n#define MagickXMakeCursor GmMagickXMakeCursor\n#define MagickXMakeImage GmMagickXMakeImage\n#define MagickXMakeMagnifyImage GmMagickXMakeMagnifyImage\n#define MagickXMakeStandardColormap GmMagickXMakeStandardColormap\n#define MagickXMakeWindow GmMagickXMakeWindow\n#define MagickXMenuWidget GmMagickXMenuWidget\n#define MagickXMonitorWidget GmMagickXMonitorWidget\n#define MagickXNoticeWidget GmMagickXNoticeWidget\n#define MagickXPreferencesWidget GmMagickXPreferencesWidget\n#define MagickXQueryColorDatabase GmMagickXQueryColorDatabase\n#define MagickXQueryPosition GmMagickXQueryPosition\n#define MagickXRefreshWindow GmMagickXRefreshWindow\n#define MagickXRemoteCommand GmMagickXRemoteCommand\n#define MagickXRetainWindowColors GmMagickXRetainWindowColors\n#define MagickXSetCursorState GmMagickXSetCursorState\n#define MagickXSetWindows GmMagickXSetWindows\n#define MagickXSignalHandler GmMagickXSignalHandler\n#define MagickXTextViewWidget GmMagickXTextViewWidget\n#define MagickXTextViewWidgetNDL GmMagickXTextViewWidgetNDL\n#define MagickXUserPreferences GmMagickXUserPreferences\n#define MagickXWarning GmMagickXWarning\n#define MagickXWindowByID GmMagickXWindowByID\n#define MagickXWindowByName GmMagickXWindowByName\n#define MagickXWindowByProperty GmMagickXWindowByProperty\n#define MagnifyImage GmMagnifyImage\n#define MapBlob GmMapBlob\n#define MapImage GmMapImage\n#define MapImages GmMapImages\n#define MapModeToString GmMapModeToString\n#define MatteFloodfillImage GmMatteFloodfillImage\n#define MedianFilterImage GmMedianFilterImage\n#define MetricTypeToString GmMetricTypeToString\n#define MinifyImage GmMinifyImage\n#define ModifyCache GmModifyCache\n#define ModifyImage GmModifyImage\n#define Modulate GmModulate\n#define ModulateImage GmModulateImage\n#define MogrifyImage GmMogrifyImage\n#define MogrifyImageCommand GmMogrifyImageCommand\n#define MogrifyImages GmMogrifyImages\n#define MontageImageCommand GmMontageImageCommand\n#define MontageImages GmMontageImages\n#define MorphImages GmMorphImages\n#define MosaicImages GmMosaicImages\n#define MotionBlurImage GmMotionBlurImage\n#define MultilineCensus GmMultilineCensus\n#define NegateImage GmNegateImage\n#define NewImageList GmNewImageList\n#define NextImageProfile GmNextImageProfile\n#define NoiseTypeToString GmNoiseTypeToString\n#define NormalizeImage GmNormalizeImage\n#define OilPaintImage GmOilPaintImage\n#define OpaqueImage GmOpaqueImage\n#define OpenBlob GmOpenBlob\n#define OpenCacheView GmOpenCacheView\n#define OpenModule GmOpenModule\n#define OpenModules GmOpenModules\n#define OrderedDitherImage GmOrderedDitherImage\n#define OrientationTypeToString GmOrientationTypeToString\n#define PackbitsEncode2Image GmPackbitsEncode2Image\n#define PackbitsEncodeImage GmPackbitsEncodeImage\n#define PanicDestroyMagick GmPanicDestroyMagick\n#define PersistCache GmPersistCache\n#define PingBlob GmPingBlob\n#define PingImage GmPingImage\n#define PixelIterateDualModify GmPixelIterateDualModify\n#define PixelIterateDualNew GmPixelIterateDualNew\n#define PixelIterateDualRead GmPixelIterateDualRead\n#define PixelIterateMonoModify GmPixelIterateMonoModify\n#define PixelIterateMonoRead GmPixelIterateMonoRead\n#define PixelIterateMonoSet GmPixelIterateMonoSet\n#define PixelIterateTripleModify GmPixelIterateTripleModify\n#define PixelIterateTripleNew GmPixelIterateTripleNew\n#define PlasmaImage GmPlasmaImage\n#define PopImagePixels GmPopImagePixels\n#define PrependImageToList GmPrependImageToList\n#define ProfileImage GmProfileImage\n#define PurgeTemporaryFiles GmPurgeTemporaryFiles\n#define PurgeTemporaryFilesAsyncSafe GmPurgeTemporaryFilesAsyncSafe\n#define PushImagePixels GmPushImagePixels\n#define QuantizeImage GmQuantizeImage\n#define QuantizeImages GmQuantizeImages\n#define QuantumOperatorImage GmQuantumOperatorImage\n#define QuantumOperatorImageMultivalue GmQuantumOperatorImageMultivalue\n#define QuantumOperatorRegionImage GmQuantumOperatorRegionImage\n#define QuantumOperatorToString GmQuantumOperatorToString\n#define QuantumSampleTypeToString GmQuantumSampleTypeToString\n#define QuantumTypeToString GmQuantumTypeToString\n#define QueryColorDatabase GmQueryColorDatabase\n#define QueryColorname GmQueryColorname\n#define RGBTransformImage GmRGBTransformImage\n#define RaiseImage GmRaiseImage\n#define RandomChannelThresholdImage GmRandomChannelThresholdImage\n#define ReacquireMemory GmReacquireMemory\n#define ReadBlob GmReadBlob\n#define ReadBlobByte GmReadBlobByte\n#define ReadBlobLSBDouble GmReadBlobLSBDouble\n#define ReadBlobLSBDoubles GmReadBlobLSBDoubles\n#define ReadBlobLSBFloat GmReadBlobLSBFloat\n#define ReadBlobLSBFloats GmReadBlobLSBFloats\n#define ReadBlobLSBLong GmReadBlobLSBLong\n#define ReadBlobLSBLongs GmReadBlobLSBLongs\n#define ReadBlobLSBShort GmReadBlobLSBShort\n#define ReadBlobLSBShorts GmReadBlobLSBShorts\n#define ReadBlobLSBSignedLong GmReadBlobLSBSignedLong\n#define ReadBlobLSBSignedShort GmReadBlobLSBSignedShort\n#define ReadBlobMSBDouble GmReadBlobMSBDouble\n#define ReadBlobMSBDoubles GmReadBlobMSBDoubles\n#define ReadBlobMSBFloat GmReadBlobMSBFloat\n#define ReadBlobMSBFloats GmReadBlobMSBFloats\n#define ReadBlobMSBLong GmReadBlobMSBLong\n#define ReadBlobMSBLongs GmReadBlobMSBLongs\n#define ReadBlobMSBShort GmReadBlobMSBShort\n#define ReadBlobMSBShorts GmReadBlobMSBShorts\n#define ReadBlobMSBSignedLong GmReadBlobMSBSignedLong\n#define ReadBlobMSBSignedShort GmReadBlobMSBSignedShort\n#define ReadBlobString GmReadBlobString\n#define ReadBlobZC GmReadBlobZC\n#define ReadImage GmReadImage\n#define ReadInlineImage GmReadInlineImage\n#define ReallocateImageColormap GmReallocateImageColormap\n#define ReduceNoiseImage GmReduceNoiseImage\n#define ReferenceBlob GmReferenceBlob\n#define ReferenceCache GmReferenceCache\n#define ReferenceImage GmReferenceImage\n#define RegisterARTImage GmRegisterARTImage\n#define RegisterAVSImage GmRegisterAVSImage\n#define RegisterBMPImage GmRegisterBMPImage\n#define RegisterBRAILLEImage GmRegisterBRAILLEImage\n#define RegisterCALSImage GmRegisterCALSImage\n#define RegisterCAPTIONImage GmRegisterCAPTIONImage\n#define RegisterCINEONImage GmRegisterCINEONImage\n#define RegisterCMYKImage GmRegisterCMYKImage\n#define RegisterCUTImage GmRegisterCUTImage\n#define RegisterDCMImage GmRegisterDCMImage\n#define RegisterDCRAWImage GmRegisterDCRAWImage\n#define RegisterDIBImage GmRegisterDIBImage\n#define RegisterDPXImage GmRegisterDPXImage\n#define RegisterEPTImage GmRegisterEPTImage\n#define RegisterFAXImage GmRegisterFAXImage\n#define RegisterFITSImage GmRegisterFITSImage\n#define RegisterGIFImage GmRegisterGIFImage\n#define RegisterGRADIENTImage GmRegisterGRADIENTImage\n#define RegisterGRAYImage GmRegisterGRAYImage\n#define RegisterHISTOGRAMImage GmRegisterHISTOGRAMImage\n#define RegisterHRZImage GmRegisterHRZImage\n#define RegisterHTMLImage GmRegisterHTMLImage\n#define RegisterICONImage GmRegisterICONImage\n#define RegisterIDENTITYImage GmRegisterIDENTITYImage\n#define RegisterINFOImage GmRegisterINFOImage\n#define RegisterJNXImage GmRegisterJNXImage\n#define RegisterJP2Image GmRegisterJP2Image\n#define RegisterJPEGImage GmRegisterJPEGImage\n#define RegisterLABELImage GmRegisterLABELImage\n#define RegisterLOCALEImage GmRegisterLOCALEImage\n#define RegisterLOGOImage GmRegisterLOGOImage\n#define RegisterMACImage GmRegisterMACImage\n#define RegisterMAPImage GmRegisterMAPImage\n#define RegisterMATImage GmRegisterMATImage\n#define RegisterMATTEImage GmRegisterMATTEImage\n#define RegisterMETAImage GmRegisterMETAImage\n#define RegisterMIFFImage GmRegisterMIFFImage\n#define RegisterMONOImage GmRegisterMONOImage\n#define RegisterMPCImage GmRegisterMPCImage\n#define RegisterMPEGImage GmRegisterMPEGImage\n#define RegisterMPRImage GmRegisterMPRImage\n#define RegisterMSLImage GmRegisterMSLImage\n#define RegisterMTVImage GmRegisterMTVImage\n#define RegisterMVGImage GmRegisterMVGImage\n#define RegisterMagickInfo GmRegisterMagickInfo\n#define RegisterNULLImage GmRegisterNULLImage\n#define RegisterOTBImage GmRegisterOTBImage\n#define RegisterPALMImage GmRegisterPALMImage\n#define RegisterPCDImage GmRegisterPCDImage\n#define RegisterPCLImage GmRegisterPCLImage\n#define RegisterPCXImage GmRegisterPCXImage\n#define RegisterPDBImage GmRegisterPDBImage\n#define RegisterPDFImage GmRegisterPDFImage\n#define RegisterPICTImage GmRegisterPICTImage\n#define RegisterPIXImage GmRegisterPIXImage\n#define RegisterPLASMAImage GmRegisterPLASMAImage\n#define RegisterPNGImage GmRegisterPNGImage\n#define RegisterPNMImage GmRegisterPNMImage\n#define RegisterPREVIEWImage GmRegisterPREVIEWImage\n#define RegisterPS2Image GmRegisterPS2Image\n#define RegisterPS3Image GmRegisterPS3Image\n#define RegisterPSDImage GmRegisterPSDImage\n#define RegisterPSImage GmRegisterPSImage\n#define RegisterPWPImage GmRegisterPWPImage\n#define RegisterRGBImage GmRegisterRGBImage\n#define RegisterRLAImage GmRegisterRLAImage\n#define RegisterRLEImage GmRegisterRLEImage\n#define RegisterSCTImage GmRegisterSCTImage\n#define RegisterSFWImage GmRegisterSFWImage\n#define RegisterSGIImage GmRegisterSGIImage\n#define RegisterSTEGANOImage GmRegisterSTEGANOImage\n#define RegisterSUNImage GmRegisterSUNImage\n#define RegisterSVGImage GmRegisterSVGImage\n#define RegisterStaticModules GmRegisterStaticModules\n#define RegisterTGAImage GmRegisterTGAImage\n#define RegisterTIFFImage GmRegisterTIFFImage\n#define RegisterTILEImage GmRegisterTILEImage\n#define RegisterTIMImage GmRegisterTIMImage\n#define RegisterTOPOLImage GmRegisterTOPOLImage\n#define RegisterTTFImage GmRegisterTTFImage\n#define RegisterTXTImage GmRegisterTXTImage\n#define RegisterUILImage GmRegisterUILImage\n#define RegisterURLImage GmRegisterURLImage\n#define RegisterUYVYImage GmRegisterUYVYImage\n#define RegisterVICARImage GmRegisterVICARImage\n#define RegisterVIDImage GmRegisterVIDImage\n#define RegisterVIFFImage GmRegisterVIFFImage\n#define RegisterWBMPImage GmRegisterWBMPImage\n#define RegisterWEBPImage GmRegisterWEBPImage\n#define RegisterWMFImage GmRegisterWMFImage\n#define RegisterWPGImage GmRegisterWPGImage\n#define RegisterXBMImage GmRegisterXBMImage\n#define RegisterXCFImage GmRegisterXCFImage\n#define RegisterXCImage GmRegisterXCImage\n#define RegisterXImage GmRegisterXImage\n#define RegisterXPMImage GmRegisterXPMImage\n#define RegisterXWDImage GmRegisterXWDImage\n#define RegisterYUVImage GmRegisterYUVImage\n#define RemoveDefinitions GmRemoveDefinitions\n#define RemoveFirstImageFromList GmRemoveFirstImageFromList\n#define RemoveLastImageFromList GmRemoveLastImageFromList\n#define ReplaceImageColormap GmReplaceImageColormap\n#define ReplaceImageInList GmReplaceImageInList\n#define ResetImagePage GmResetImagePage\n#define ResetTimer GmResetTimer\n#define ResizeFilterToString GmResizeFilterToString\n#define ResizeImage GmResizeImage\n#define ResolutionTypeToString GmResolutionTypeToString\n#define ReverseImageList GmReverseImageList\n#define RollImage GmRollImage\n#define RotateImage GmRotateImage\n#define SampleImage GmSampleImage\n#define ScaleImage GmScaleImage\n#define SeekBlob GmSeekBlob\n#define SetBlobClosable GmSetBlobClosable\n#define SetBlobTemporary GmSetBlobTemporary\n#define SetCacheView GmSetCacheView\n#define SetCacheViewPixels GmSetCacheViewPixels\n#define SetClientFilename GmSetClientFilename\n#define SetClientName GmSetClientName\n#define SetClientPath GmSetClientPath\n#define SetDelegateInfo GmSetDelegateInfo\n#define SetErrorHandler GmSetErrorHandler\n#define SetExceptionInfo GmSetExceptionInfo\n#define SetFatalErrorHandler GmSetFatalErrorHandler\n#define SetGeometry GmSetGeometry\n#define SetImage GmSetImage\n#define SetImageAttribute GmSetImageAttribute\n#define SetImageChannelDepth GmSetImageChannelDepth\n#define SetImageClipMask GmSetImageClipMask\n#define SetImageColor GmSetImageColor\n#define SetImageColorRegion GmSetImageColorRegion\n#define SetImageCompositeMask GmSetImageCompositeMask\n#define SetImageDepth GmSetImageDepth\n#define SetImageEx GmSetImageEx\n#define SetImageInfo GmSetImageInfo\n#define SetImageOpacity GmSetImageOpacity\n#define SetImagePixels GmSetImagePixels\n#define SetImagePixelsEx GmSetImagePixelsEx\n#define SetImageProfile GmSetImageProfile\n#define SetImageType GmSetImageType\n#define SetImageVirtualPixelMethod GmSetImageVirtualPixelMethod\n#define SetLogEventMask GmSetLogEventMask\n#define SetLogFormat GmSetLogFormat\n#define SetMagickInfo GmSetMagickInfo\n#define SetMagickRegistry GmSetMagickRegistry\n#define SetMagickResourceLimit GmSetMagickResourceLimit\n#define SetMonitorHandler GmSetMonitorHandler\n#define SetWarningHandler GmSetWarningHandler\n#define ShadeImage GmShadeImage\n#define SharpenImage GmSharpenImage\n#define SharpenImageChannel GmSharpenImageChannel\n#define ShaveImage GmShaveImage\n#define ShearImage GmShearImage\n#define SignatureImage GmSignatureImage\n#define SolarizeImage GmSolarizeImage\n#define SortColormapByIntensity GmSortColormapByIntensity\n#define SpliceImageIntoList GmSpliceImageIntoList\n#define SplitImageList GmSplitImageList\n#define SpreadImage GmSpreadImage\n#define StartTimer GmStartTimer\n#define SteganoImage GmSteganoImage\n#define StereoImage GmStereoImage\n#define StopTimer GmStopTimer\n#define StorageTypeToString GmStorageTypeToString\n#define StretchTypeToString GmStretchTypeToString\n#define StringToArgv GmStringToArgv\n#define StringToChannelType GmStringToChannelType\n#define StringToColorspaceType GmStringToColorspaceType\n#define StringToCompositeOperator GmStringToCompositeOperator\n#define StringToCompressionType GmStringToCompressionType\n#define StringToDouble GmStringToDouble\n#define StringToEndianType GmStringToEndianType\n#define StringToFilterTypes GmStringToFilterTypes\n#define StringToGravityType GmStringToGravityType\n#define StringToHighlightStyle GmStringToHighlightStyle\n#define StringToImageType GmStringToImageType\n#define StringToInterlaceType GmStringToInterlaceType\n#define StringToList GmStringToList\n#define StringToMetricType GmStringToMetricType\n#define StringToNoiseType GmStringToNoiseType\n#define StringToOrientationType GmStringToOrientationType\n#define StringToPreviewType GmStringToPreviewType\n#define StringToQuantumOperator GmStringToQuantumOperator\n#define StringToResolutionType GmStringToResolutionType\n#define StringToResourceType GmStringToResourceType\n#define StringToVirtualPixelMethod GmStringToVirtualPixelMethod\n#define Strip GmStrip\n#define StripImage GmStripImage\n#define StyleTypeToString GmStyleTypeToString\n#define SubstituteString GmSubstituteString\n#define SwirlImage GmSwirlImage\n#define SyncCacheView GmSyncCacheView\n#define SyncCacheViewPixels GmSyncCacheViewPixels\n#define SyncImage GmSyncImage\n#define SyncImagePixels GmSyncImagePixels\n#define SyncImagePixelsEx GmSyncImagePixelsEx\n#define SyncNextImageInList GmSyncNextImageInList\n#define SystemCommand GmSystemCommand\n#define TellBlob GmTellBlob\n#define TextureImage GmTextureImage\n#define ThresholdImage GmThresholdImage\n#define ThrowLoggedException GmThrowLoggedException\n#define ThumbnailImage GmThumbnailImage\n#define TimeImageCommand GmTimeImageCommand\n#define Tokenizer GmTokenizer\n#define TransformColorspace GmTransformColorspace\n#define TransformHSL GmTransformHSL\n#define TransformHWB GmTransformHWB\n#define TransformImage GmTransformImage\n#define TransformRGBImage GmTransformRGBImage\n#define TransformSignature GmTransformSignature\n#define TranslateText GmTranslateText\n#define TranslateTextEx GmTranslateTextEx\n#define TransparentImage GmTransparentImage\n#define UnlockSemaphoreInfo GmUnlockSemaphoreInfo\n#define UnmapBlob GmUnmapBlob\n#define UnregisterARTImage GmUnregisterARTImage\n#define UnregisterAVSImage GmUnregisterAVSImage\n#define UnregisterBMPImage GmUnregisterBMPImage\n#define UnregisterBRAILLEImage GmUnregisterBRAILLEImage\n#define UnregisterCALSImage GmUnregisterCALSImage\n#define UnregisterCAPTIONImage GmUnregisterCAPTIONImage\n#define UnregisterCINEONImage GmUnregisterCINEONImage\n#define UnregisterCMYKImage GmUnregisterCMYKImage\n#define UnregisterCUTImage GmUnregisterCUTImage\n#define UnregisterDCMImage GmUnregisterDCMImage\n#define UnregisterDCRAWImage GmUnregisterDCRAWImage\n#define UnregisterDIBImage GmUnregisterDIBImage\n#define UnregisterDPXImage GmUnregisterDPXImage\n#define UnregisterEPTImage GmUnregisterEPTImage\n#define UnregisterFAXImage GmUnregisterFAXImage\n#define UnregisterFITSImage GmUnregisterFITSImage\n#define UnregisterGIFImage GmUnregisterGIFImage\n#define UnregisterGRADIENTImage GmUnregisterGRADIENTImage\n#define UnregisterGRAYImage GmUnregisterGRAYImage\n#define UnregisterHISTOGRAMImage GmUnregisterHISTOGRAMImage\n#define UnregisterHRZImage GmUnregisterHRZImage\n#define UnregisterHTMLImage GmUnregisterHTMLImage\n#define UnregisterICONImage GmUnregisterICONImage\n#define UnregisterIDENTITYImage GmUnregisterIDENTITYImage\n#define UnregisterINFOImage GmUnregisterINFOImage\n#define UnregisterJNXImage GmUnregisterJNXImage\n#define UnregisterJP2Image GmUnregisterJP2Image\n#define UnregisterJPEGImage GmUnregisterJPEGImage\n#define UnregisterLABELImage GmUnregisterLABELImage\n#define UnregisterLOCALEImage GmUnregisterLOCALEImage\n#define UnregisterLOGOImage GmUnregisterLOGOImage\n#define UnregisterMACImage GmUnregisterMACImage\n#define UnregisterMAPImage GmUnregisterMAPImage\n#define UnregisterMATImage GmUnregisterMATImage\n#define UnregisterMATTEImage GmUnregisterMATTEImage\n#define UnregisterMETAImage GmUnregisterMETAImage\n#define UnregisterMIFFImage GmUnregisterMIFFImage\n#define UnregisterMONOImage GmUnregisterMONOImage\n#define UnregisterMPCImage GmUnregisterMPCImage\n#define UnregisterMPEGImage GmUnregisterMPEGImage\n#define UnregisterMPRImage GmUnregisterMPRImage\n#define UnregisterMSLImage GmUnregisterMSLImage\n#define UnregisterMTVImage GmUnregisterMTVImage\n#define UnregisterMVGImage GmUnregisterMVGImage\n#define UnregisterMagickInfo GmUnregisterMagickInfo\n#define UnregisterNULLImage GmUnregisterNULLImage\n#define UnregisterOTBImage GmUnregisterOTBImage\n#define UnregisterPALMImage GmUnregisterPALMImage\n#define UnregisterPCDImage GmUnregisterPCDImage\n#define UnregisterPCLImage GmUnregisterPCLImage\n#define UnregisterPCXImage GmUnregisterPCXImage\n#define UnregisterPDBImage GmUnregisterPDBImage\n#define UnregisterPDFImage GmUnregisterPDFImage\n#define UnregisterPICTImage GmUnregisterPICTImage\n#define UnregisterPIXImage GmUnregisterPIXImage\n#define UnregisterPLASMAImage GmUnregisterPLASMAImage\n#define UnregisterPNGImage GmUnregisterPNGImage\n#define UnregisterPNMImage GmUnregisterPNMImage\n#define UnregisterPREVIEWImage GmUnregisterPREVIEWImage\n#define UnregisterPS2Image GmUnregisterPS2Image\n#define UnregisterPS3Image GmUnregisterPS3Image\n#define UnregisterPSDImage GmUnregisterPSDImage\n#define UnregisterPSImage GmUnregisterPSImage\n#define UnregisterPWPImage GmUnregisterPWPImage\n#define UnregisterRGBImage GmUnregisterRGBImage\n#define UnregisterRLAImage GmUnregisterRLAImage\n#define UnregisterRLEImage GmUnregisterRLEImage\n#define UnregisterSCTImage GmUnregisterSCTImage\n#define UnregisterSFWImage GmUnregisterSFWImage\n#define UnregisterSGIImage GmUnregisterSGIImage\n#define UnregisterSTEGANOImage GmUnregisterSTEGANOImage\n#define UnregisterSUNImage GmUnregisterSUNImage\n#define UnregisterSVGImage GmUnregisterSVGImage\n#define UnregisterStaticModules GmUnregisterStaticModules\n#define UnregisterTGAImage GmUnregisterTGAImage\n#define UnregisterTIFFImage GmUnregisterTIFFImage\n#define UnregisterTILEImage GmUnregisterTILEImage\n#define UnregisterTIMImage GmUnregisterTIMImage\n#define UnregisterTOPOLImage GmUnregisterTOPOLImage\n#define UnregisterTTFImage GmUnregisterTTFImage\n#define UnregisterTXTImage GmUnregisterTXTImage\n#define UnregisterUILImage GmUnregisterUILImage\n#define UnregisterURLImage GmUnregisterURLImage\n#define UnregisterUYVYImage GmUnregisterUYVYImage\n#define UnregisterVICARImage GmUnregisterVICARImage\n#define UnregisterVIDImage GmUnregisterVIDImage\n#define UnregisterVIFFImage GmUnregisterVIFFImage\n#define UnregisterWBMPImage GmUnregisterWBMPImage\n#define UnregisterWEBPImage GmUnregisterWEBPImage\n#define UnregisterWMFImage GmUnregisterWMFImage\n#define UnregisterWPGImage GmUnregisterWPGImage\n#define UnregisterXBMImage GmUnregisterXBMImage\n#define UnregisterXCFImage GmUnregisterXCFImage\n#define UnregisterXCImage GmUnregisterXCImage\n#define UnregisterXImage GmUnregisterXImage\n#define UnregisterXPMImage GmUnregisterXPMImage\n#define UnregisterXWDImage GmUnregisterXWDImage\n#define UnregisterYUVImage GmUnregisterYUVImage\n#define UnsharpMaskImage GmUnsharpMaskImage\n#define UnsharpMaskImageChannel GmUnsharpMaskImageChannel\n#define UpdateSignature GmUpdateSignature\n#define WaveImage GmWaveImage\n#define WhiteThresholdImage GmWhiteThresholdImage\n#define WriteBlob GmWriteBlob\n#define WriteBlobByte GmWriteBlobByte\n#define WriteBlobFile GmWriteBlobFile\n#define WriteBlobLSBLong GmWriteBlobLSBLong\n#define WriteBlobLSBShort GmWriteBlobLSBShort\n#define WriteBlobLSBSignedLong GmWriteBlobLSBSignedLong\n#define WriteBlobLSBSignedShort GmWriteBlobLSBSignedShort\n#define WriteBlobMSBLong GmWriteBlobMSBLong\n#define WriteBlobMSBShort GmWriteBlobMSBShort\n#define WriteBlobMSBSignedLong GmWriteBlobMSBSignedLong\n#define WriteBlobMSBSignedShort GmWriteBlobMSBSignedShort\n#define WriteBlobString GmWriteBlobString\n#define WriteBlobStringEOL GmWriteBlobStringEOL\n#define WriteBlobStringWithEOL GmWriteBlobStringWithEOL\n#define WriteImage GmWriteImage\n#define WriteImages GmWriteImages\n#define WriteImagesFile GmWriteImagesFile\n#define ZoomImage GmZoomImage\n\n#endif /* defined(PREFIX_MAGICK_SYMBOLS) */\n#endif /* defined(_MAGICK_SYMBOLS_H) */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/texture.h",
    "content": "/*\n  Copyright (C) 2003 - 2009 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Texture Methods.\n*/\n#ifndef _MAGICK_TEXTURE_H\n#define _MAGICK_TEXTURE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Include declarations.\n*/\n#include \"magick/image.h\"\n#include \"magick/error.h\"\n\f\nextern MagickExport Image\n  *ConstituteTextureImage(const unsigned long columns,const unsigned long rows,\n                          const Image *texture,ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  TextureImage(Image *,const Image *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_TEXTURE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/timer.h",
    "content": "/*\n  Copyright (C) 2003 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Timer Methods.\n*/\n#ifndef _MAGICK_TIMER_H\n#define _MAGICK_TIMER_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  UndefinedTimerState,\n  StoppedTimerState,\n  RunningTimerState\n} TimerState;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _Timer\n{\n  double\n    start,\n    stop,\n    total;\n} Timer;\n\ntypedef struct _TimerInfo\n{\n  Timer\n    user,\n    elapsed;\n\n  TimerState\n    state;\n\n  unsigned long\n    signature;\n} TimerInfo;\n\f\n/*\n  Timer methods.\n*/\nextern MagickExport double\n  GetElapsedTime(TimerInfo *),\n  GetUserTime(TimerInfo *),\n  GetTimerResolution(void);\n\nextern MagickExport unsigned int\n  ContinueTimer(TimerInfo *);\n\nextern MagickExport void\n  GetTimerInfo(TimerInfo *),\n  ResetTimer(TimerInfo *),\n  StartTimer(TimerInfo *time_info,const unsigned int reset),\n  StopTimer(TimerInfo *time_info);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/transform.h",
    "content": "/*\n  Copyright (C) 2003 - 2010 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  ImageMagick Image Transform Methods.\n*/\n#ifndef _MAGICK_TRANSFORM_H\n#define _MAGICK_TRANSFORM_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\nextern MagickExport Image\n  *ChopImage(const Image *image,const RectangleInfo *chop_info,ExceptionInfo *exception),\n  *CoalesceImages(const Image *image,ExceptionInfo *exception),\n  *CropImage(const Image *image,const RectangleInfo *geometry,ExceptionInfo *exception),\n  *DeconstructImages(const Image *image,ExceptionInfo *exception),\n  *ExtentImage(const Image *image,const RectangleInfo *geometry,ExceptionInfo *exception),\n  *FlattenImages(const Image *image,ExceptionInfo *exception),\n  *FlipImage(const Image *image,ExceptionInfo *exception),\n  *FlopImage(const Image *image,ExceptionInfo *exception),\n  *MosaicImages(const Image *image,ExceptionInfo *exception),\n  *RollImage(const Image *image,const long x_offset,const long y_offset,ExceptionInfo *exception),\n  *ShaveImage(const Image *image,const RectangleInfo *shave_info,ExceptionInfo *exception);\n\nextern MagickExport MagickPassFail\n  TransformImage(Image **,const char *,const char *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_TRANSFORM_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/type.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Drawing methods.\n*/\n#ifndef _MAGICK_TYPE_H\n#define _MAGICK_TYPE_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  NormalStretch,\n  UltraCondensedStretch,\n  ExtraCondensedStretch,\n  CondensedStretch,\n  SemiCondensedStretch,\n  SemiExpandedStretch,\n  ExpandedStretch,\n  ExtraExpandedStretch,\n  UltraExpandedStretch,\n  AnyStretch\n} StretchType;\n\ntypedef enum\n{\n  NormalStyle,\n  ItalicStyle,\n  ObliqueStyle,\n  AnyStyle\n} StyleType;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _TypeInfo\n{\n  char\n    *path,\n    *name,\n    *description,\n    *family;\n\n  StyleType\n    style;\n\n  StretchType\n    stretch;\n\n  unsigned long\n    weight;\n\n  char\n    *encoding,\n    *foundry,\n    *format,\n    *metrics,\n    *glyphs;\n\n  unsigned int\n    stealth;\n\n  unsigned long\n    signature;\n\n  struct _TypeInfo\n    *previous,\n    *next;\n} TypeInfo;\n\f\n/*\n  Method declarations.\n*/\nextern MagickExport char\n  **GetTypeList(const char *,unsigned long *);\n\nextern MagickExport MagickPassFail\n  ListTypeInfo(FILE *,ExceptionInfo *);\n\nextern MagickExport const TypeInfo\n  *GetTypeInfo(const char *,ExceptionInfo *),\n  *GetTypeInfoByFamily(const char *,const StyleType,const StretchType,\n    const unsigned long,ExceptionInfo *);\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/type-private.h\"\n#endif /* MAGICK_IMPLEMENTATION */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif /* _MAGICK_TYPE_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/utility.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick Utility Methods.\n*/\n#ifndef _MAGICK_UTILITY_H\n#define _MAGICK_UTILITY_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Enum declarations.\n*/\ntypedef enum\n{\n  RootPath,\n  HeadPath,\n  TailPath,\n  BasePath,\n  ExtensionPath,\n  MagickPath,\n  SubImagePath,\n  FullPath\n} PathType;\n\n/*\n  Typedef declarations.\n*/\ntypedef struct _TokenInfo\n{\n  int\n    state;\n\n  unsigned int\n    flag;\n\n  long\n    offset;\n\n  char\n    quote;\n} TokenInfo;\n\f\n/*\n  Utilities methods.\n*/\n\n#undef ARG_NOT_USED\n#define ARG_NOT_USED(arg) (void) arg\n\n/*\n  A callback function which behaves similar to strlcpy() except which\n  optionally translates text while it is copied and always returns\n  the number of characters which were actually copied rather than\n  the number of characters which were available to copy.\n*/\ntypedef size_t\n  (*MagickTextTranslate)(char *dst, const char *src, const size_t size);\n\nextern MagickExport char\n  *AcquireString(const char *),\n  *AllocateString(const char *),\n  *Base64Encode(const unsigned char *,const size_t,size_t *),\n  *EscapeString(const char *,const char),\n  *GetPageGeometry(const char *),\n  **ListFiles(const char *,const char *,long *),\n  **StringToArgv(const char *,int *),\n  **StringToList(const char *),\n  *TranslateText(const ImageInfo *,Image *,const char *),\n  *TranslateTextEx(const ImageInfo *,Image *,const char *,MagickTextTranslate);\n\nextern MagickExport const char\n  *GetClientFilename(void) MAGICK_FUNC_CONST,\n  *GetClientName(void) MAGICK_FUNC_CONST,\n  *GetClientPath(void) MAGICK_FUNC_CONST,\n  *SetClientFilename(const char *),\n  *SetClientName(const char *),\n  *SetClientPath(const char *);\n\nextern MagickExport double\n  StringToDouble(const char *,const double);\n\nextern MagickExport int\n  GetGeometry(const char *,long *,long *,unsigned long *,unsigned long *),\n  GlobExpression(const char *,const char *) MAGICK_FUNC_PURE,\n  LocaleNCompare(const char *,const char *,const size_t) MAGICK_FUNC_PURE,\n  LocaleCompare(const char *,const char *) MAGICK_FUNC_PURE,\n  GetMagickDimension(const char *str,double *width,double *height,double *xoff,double *yoff),\n  GetMagickGeometry(const char *geometry,long *x,long *y,unsigned long *width,\n    unsigned long *height),\n  MagickRandReentrant(unsigned int *seed) MAGICK_FUNC_DEPRECATED,\n  MagickSpawnVP(const unsigned int verbose, const char *file, char *const argv[]),\n  SystemCommand(const unsigned int,const char *),\n  Tokenizer(TokenInfo *,unsigned,char *,size_t,char *,char *,char *,char *,\n    char,char *,int *,char *);\n\nextern MagickExport unsigned int\n  MagickRandNewSeed(void) MAGICK_FUNC_DEPRECATED;\n\nextern MagickExport unsigned char\n  *Base64Decode(const char *, size_t *);\n\nextern MagickExport MagickPassFail\n  CloneString(char **,const char *),\n  ConcatenateString(char **,const char *),\n  ExpandFilenames(int *,char ***),\n  GetExecutionPath(char *),\n  GetExecutionPathUsingName(char *),\n  MagickCreateDirectoryPath(const char *dir,ExceptionInfo *exception);\n\nextern MagickExport MagickBool\n  IsAccessible(const char *),\n  IsAccessibleNoLogging(const char *),\n  IsAccessibleAndNotEmpty(const char *),\n  IsGeometry(const char *),\n  IsGlob(const char *) MAGICK_FUNC_PURE,\n  IsWriteable(const char *),\n  MagickSceneFileName(char *filename,const char* filename_template,\n    const char* scene_template,const MagickBool force,unsigned long scene),\n  SubstituteString(char **buffer,const char *search,const char *replace);\n\nextern MagickExport unsigned long\n  MultilineCensus(const char *) MAGICK_FUNC_PURE;\n\nextern MagickExport void\n  AppendImageFormat(const char *,char *),\n  DefineClientName(const char *),\n  DefineClientPathAndName(const char *),\n  ExpandFilename(char *),\n  FormatSize(const magick_int64_t size,char *format),\n  GetPathComponent(const char *,PathType,char *),\n  GetToken(const char *,char **,char *) MAGICK_FUNC_DEPRECATED,\n  LocaleLower(char *),\n  LocaleUpper(char *),\n  Strip(char *),\n  SetGeometry(const Image *,RectangleInfo *);\n\nextern MagickExport void\n  FormatString(char *string,const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,2,3))),\n  FormatStringList(char *string,const char *format,va_list operands) MAGICK_ATTRIBUTE((__format__ (__printf__,2,0))),\n  MagickFormatString(char *string,const size_t length,const char *format,...) MAGICK_ATTRIBUTE((__format__ (__printf__,3,4))),\n  MagickFormatStringList(char *string,const size_t length,const char *format,va_list operands) MAGICK_ATTRIBUTE((__format__ (__printf__,3,0)));\n\nextern MagickExport magick_int64_t\n  MagickSizeStrToInt64(const char *str,const unsigned int kilo);\n\nextern MagickExport size_t\n  MagickGetToken(const char *start,char **end,char *token,\n                 const size_t buffer_length),\n  MagickStripSpacesFromString(char *string),\n  MagickStrlCat(char *dst, const char *src, const size_t size) MAGICK_FUNC_NONNULL,\n  MagickStrlCpy(char *dst, const char *src, const size_t size) MAGICK_FUNC_NONNULL,\n  MagickStrlCpyTrunc(char *dst, const char *src, const size_t size) MAGICK_FUNC_NONNULL;\n\n#if defined(MAGICK_IMPLEMENTATION)\n#  include \"magick/utility-private.h\"\n#endif /* defined(MAGICK_IMPLEMENTATION) */\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/magick/version.h",
    "content": "/*\n  Copyright (C) 2003 - 2020 GraphicsMagick Group\n  Copyright (C) 2002 ImageMagick Studio\n  Copyright 1991-1999 E. I. du Pont de Nemours and Company\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  GraphicsMagick version and copyright.\n*/\n#ifndef _MAGICK_VERSION_H\n#define _MAGICK_VERSION_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n/*\n  Define declarations.\n\n  MagickLibVersion and MagickLibVersionNumber are defined differently\n  than they are in ImageMagick. The three fields are based on library\n  interface versioning.  Each field in MagickLibVersion is one byte.\n  The most significant field (third byte from the right) defines the\n  library major interface, which is incremented whenever the library\n  ABI changes incompatibly with preceding versions. The second field\n  identifies an interface (a span) in a series of upward-compatible\n  interfaces with the same major interface (such as when only new\n  functions have) been added. The least significant field specifies\n  the revision across 100% compatible interfaces.\n\n  MagickLibVersionText provides a simple human-readable string for\n  identifying the release.\n*/\n#define MagickPackageName \"GraphicsMagick\"\n#define MagickCopyright  \"Copyright (C) 2002-2020 GraphicsMagick Group.\\nAdditional copyrights and licenses apply to this software.\\nSee http://www.GraphicsMagick.org/www/Copyright.html for details.\"\n#define MagickLibVersion  0x242100\n#define MagickLibVersionText  \"1.3.35\"\n#define MagickLibVersionNumber 24,21,0\n#define MagickChangeDate   \"20200223\"\n#define MagickReleaseDate  \"2020-02-23\"\n\n/*\n  The MagickLibInterfaceNewest and MagickLibInterfaceOldest defines\n  provide both the newest and oldest interfaces supported by the\n  library.  The 'newest' interface is incremented if new interfaces\n  are added to the library.  The 'oldest' interface is reset to the\n  value of 'newest' if an existing interface is changed incompatibly,\n  or an interface is removed.  This scheme is similar to that used by\n  ELF libraries.\n\n  Note that the values used are related to those in\n  MagickLibVersionNumber, but these are broken out and simplified so\n  that they can be easily used in C pre-processor logic.\n*/\n#define MagickLibInterfaceNewest 24\n#define MagickLibInterfaceOldest 3\n\n#if (QuantumDepth == 8)\n#define MagickQuantumDepth  \"Q8\"\n#elif (QuantumDepth == 16)\n#define MagickQuantumDepth  \"Q16\"\n#elif (QuantumDepth == 32)\n#define MagickQuantumDepth  \"Q32\"\n#else\n# error Unsupported quantum depth.\n#endif\n\n#define MagickVersion MagickPackageName \" \" MagickLibVersionText \" \" \\\n  MagickReleaseDate \" \" MagickQuantumDepth \" \" MagickWebSite\n#define MagickWebSite  \"http://www.\" MagickPackageName \".org/\"\n\n/*\n  Method declarations.\n*/\nextern MagickExport const char\n  *GetMagickCopyright(void) MAGICK_FUNC_CONST,\n  *GetMagickVersion(unsigned long *) MAGICK_FUNC_CONST,\n  *GetMagickWebSite(void) MAGICK_FUNC_CONST;\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/wand/drawing_wand.h",
    "content": "/* Copyright (C) 2003-2009 GraphicsMagick Group */\n/*\n  ImageMagick Drawing Wand API.\n*/\n#ifndef _MAGICK_DRAWING_WAND_H\n#define _MAGICK_DRAWING_WAND_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"wand/wand_symbols.h\"\n#include \"wand/pixel_wand.h\"\n\n#undef CloneDrawingWand\n#define CloneDrawingWand MagickCloneDrawingWand\n#undef DestroyDrawingWand\n#define DestroyDrawingWand MagickDestroyDrawingWand\n#undef DrawAffine\n#define DrawAffine MagickDrawAffine\n#undef DrawAllocateWand\n#define DrawAllocateWand MagickDrawAllocateWand\n#undef DrawAnnotation\n#define DrawAnnotation MagickDrawAnnotation\n#undef DrawArc\n#define DrawArc MagickDrawArc\n#undef DrawBezier\n#define DrawBezier MagickDrawBezier\n#undef DrawClearException\n#define DrawClearException MagickDrawClearException\n#undef DrawCircle\n#define DrawCircle MagickDrawCircle\n#undef DrawColor\n#define DrawColor MagickDrawColor\n#undef DrawComment\n#define DrawComment MagickDrawComment\n#undef DrawComposite\n#define DrawComposite MagickDrawComposite\n#undef DrawEllipse\n#define DrawEllipse MagickDrawEllipse\n#undef DrawGetClipPath\n#define DrawGetClipPath MagickDrawGetClipPath\n#undef DrawGetClipRule\n#define DrawGetClipRule MagickDrawGetClipRule\n#undef DrawGetClipUnits\n#define DrawGetClipUnits MagickDrawGetClipUnits\n#undef DrawGetException\n#define DrawGetException MagickDrawGetException\n#undef DrawGetFillColor\n#define DrawGetFillColor MagickDrawGetFillColor\n#undef DrawGetFillOpacity\n#define DrawGetFillOpacity MagickDrawGetFillOpacity\n#undef DrawGetFillRule\n#define DrawGetFillRule MagickDrawGetFillRule\n#undef DrawGetFont\n#define DrawGetFont MagickDrawGetFont\n#undef DrawGetFontFamily\n#define DrawGetFontFamily MagickDrawGetFontFamily\n#undef DrawGetFontSize\n#define DrawGetFontSize MagickDrawGetFontSize\n#undef DrawGetFontStretch\n#define DrawGetFontStretch MagickDrawGetFontStretch\n#undef DrawGetFontStyle\n#define DrawGetFontStyle MagickDrawGetFontStyle\n#undef DrawGetFontWeight\n#define DrawGetFontWeight MagickDrawGetFontWeight\n#undef DrawGetGravity\n#define DrawGetGravity MagickDrawGetGravity\n#undef DrawGetStrokeAntialias\n#define DrawGetStrokeAntialias MagickDrawGetStrokeAntialias\n#undef DrawGetStrokeColor\n#define DrawGetStrokeColor MagickDrawGetStrokeColor\n#undef DrawGetStrokeDashArray\n#define DrawGetStrokeDashArray MagickDrawGetStrokeDashArray\n#undef DrawGetStrokeDashOffset\n#define DrawGetStrokeDashOffset MagickDrawGetStrokeDashOffset\n#undef DrawGetStrokeLineCap\n#define DrawGetStrokeLineCap MagickDrawGetStrokeLineCap\n#undef DrawGetStrokeLineJoin\n#define DrawGetStrokeLineJoin MagickDrawGetStrokeLineJoin\n#undef DrawGetStrokeMiterLimit\n#define DrawGetStrokeMiterLimit MagickDrawGetStrokeMiterLimit\n#undef DrawGetStrokeOpacity\n#define DrawGetStrokeOpacity MagickDrawGetStrokeOpacity\n#undef DrawGetStrokeWidth\n#define DrawGetStrokeWidth MagickDrawGetStrokeWidth\n#undef DrawGetTextAntialias\n#define DrawGetTextAntialias MagickDrawGetTextAntialias\n#undef DrawGetTextDecoration\n#define DrawGetTextDecoration MagickDrawGetTextDecoration\n#undef DrawGetTextEncoding\n#define DrawGetTextEncoding MagickDrawGetTextEncoding\n#undef DrawGetTextUnderColor\n#define DrawGetTextUnderColor MagickDrawGetTextUnderColor\n#undef DrawLine\n#define DrawLine MagickDrawLine\n#undef DrawMatte\n#define DrawMatte MagickDrawMatte\n#undef DrawPathClose\n#define DrawPathClose MagickDrawPathClose\n#undef DrawPathCurveToAbsolute\n#define DrawPathCurveToAbsolute MagickDrawPathCurveToAbsolute\n#undef DrawPathCurveToQuadraticBezierAbsolute\n#define DrawPathCurveToQuadraticBezierAbsolute MagickDrawPathCurveToQuadraticBezierAbsolute\n#undef DrawPathCurveToQuadraticBezierRelative\n#define DrawPathCurveToQuadraticBezierRelative MagickDrawPathCurveToQuadraticBezierRelative\n#undef DrawPathCurveToQuadraticBezierSmoothAbsolute\n#define DrawPathCurveToQuadraticBezierSmoothAbsolute MagickDrawPathCurveToQuadraticBezierSmoothAbsolute\n#undef DrawPathCurveToQuadraticBezierSmoothRelative\n#define DrawPathCurveToQuadraticBezierSmoothRelative MagickDrawPathCurveToQuadraticBezierSmoothRelative\n#undef DrawPathCurveToRelative\n#define DrawPathCurveToRelative MagickDrawPathCurveToRelative\n#undef DrawPathCurveToSmoothAbsolute\n#define DrawPathCurveToSmoothAbsolute MagickDrawPathCurveToSmoothAbsolute\n#undef DrawPathCurveToSmoothRelative\n#define DrawPathCurveToSmoothRelative MagickDrawPathCurveToSmoothRelative\n#undef DrawPathEllipticArcAbsolute\n#define DrawPathEllipticArcAbsolute MagickDrawPathEllipticArcAbsolute\n#undef DrawPathEllipticArcRelative\n#define DrawPathEllipticArcRelative MagickDrawPathEllipticArcRelative\n#undef DrawPathFinish\n#define DrawPathFinish MagickDrawPathFinish\n#undef DrawPathLineToAbsolute\n#define DrawPathLineToAbsolute MagickDrawPathLineToAbsolute\n#undef DrawPathLineToHorizontalAbsolute\n#define DrawPathLineToHorizontalAbsolute MagickDrawPathLineToHorizontalAbsolute\n#undef DrawPathLineToHorizontalRelative\n#define DrawPathLineToHorizontalRelative MagickDrawPathLineToHorizontalRelative\n#undef DrawPathLineToRelative\n#define DrawPathLineToRelative MagickDrawPathLineToRelative\n#undef DrawPathLineToVerticalAbsolute\n#define DrawPathLineToVerticalAbsolute MagickDrawPathLineToVerticalAbsolute\n#undef DrawPathLineToVerticalRelative\n#define DrawPathLineToVerticalRelative MagickDrawPathLineToVerticalRelative\n#undef DrawPathMoveToAbsolute\n#define DrawPathMoveToAbsolute MagickDrawPathMoveToAbsolute\n#undef DrawPathMoveToRelative\n#define DrawPathMoveToRelative MagickDrawPathMoveToRelative\n#undef DrawPathStart\n#define DrawPathStart MagickDrawPathStart\n#undef DrawPeekGraphicContext\n#define DrawPeekGraphicContext MagickDrawPeekGraphicContext\n#undef DrawPoint\n#define DrawPoint MagickDrawPoint\n#undef DrawPolygon\n#define DrawPolygon MagickDrawPolygon\n#undef DrawPolyline\n#define DrawPolyline MagickDrawPolyline\n#undef DrawPopClipPath\n#define DrawPopClipPath MagickDrawPopClipPath\n#undef DrawPopDefs\n#define DrawPopDefs MagickDrawPopDefs\n#undef DrawPopGraphicContext\n#define DrawPopGraphicContext MagickDrawPopGraphicContext\n#undef DrawPopPattern\n#define DrawPopPattern MagickDrawPopPattern\n#undef DrawPushClipPath\n#define DrawPushClipPath MagickDrawPushClipPath\n#undef DrawPushDefs\n#define DrawPushDefs MagickDrawPushDefs\n#undef DrawPushGraphicContext\n#define DrawPushGraphicContext MagickDrawPushGraphicContext\n#undef DrawPushPattern\n#define DrawPushPattern MagickDrawPushPattern\n#undef DrawRectangle\n#define DrawRectangle MagickDrawRectangle\n#undef DrawRender\n#define DrawRender MagickDrawRender\n#undef DrawRotate\n#define DrawRotate MagickDrawRotate\n#undef DrawRoundRectangle\n#define DrawRoundRectangle MagickDrawRoundRectangle\n#undef DrawScale\n#define DrawScale MagickDrawScale\n#undef DrawSetClipPath\n#define DrawSetClipPath MagickDrawSetClipPath\n#undef DrawSetClipRule\n#define DrawSetClipRule MagickDrawSetClipRule\n#undef DrawSetClipUnits\n#define DrawSetClipUnits MagickDrawSetClipUnits\n#undef DrawSetFillColor\n#define DrawSetFillColor MagickDrawSetFillColor\n#undef DrawSetFillOpacity\n#define DrawSetFillOpacity MagickDrawSetFillOpacity\n#undef DrawSetFillPatternURL\n#define DrawSetFillPatternURL MagickDrawSetFillPatternURL\n#undef DrawSetFillRule\n#define DrawSetFillRule MagickDrawSetFillRule\n#undef DrawSetFont\n#define DrawSetFont MagickDrawSetFont\n#undef DrawSetFontFamily\n#define DrawSetFontFamily MagickDrawSetFontFamily\n#undef DrawSetFontSize\n#define DrawSetFontSize MagickDrawSetFontSize\n#undef DrawSetFontStretch\n#define DrawSetFontStretch MagickDrawSetFontStretch\n#undef DrawSetFontStyle\n#define DrawSetFontStyle MagickDrawSetFontStyle\n#undef DrawSetFontWeight\n#define DrawSetFontWeight MagickDrawSetFontWeight\n#undef DrawSetGravity\n#define DrawSetGravity MagickDrawSetGravity\n#undef DrawSetStrokeAntialias\n#define DrawSetStrokeAntialias MagickDrawSetStrokeAntialias\n#undef DrawSetStrokeColor\n#define DrawSetStrokeColor MagickDrawSetStrokeColor\n#undef DrawSetStrokeDashArray\n#define DrawSetStrokeDashArray MagickDrawSetStrokeDashArray\n#undef DrawSetStrokeDashOffset\n#define DrawSetStrokeDashOffset MagickDrawSetStrokeDashOffset\n#undef DrawSetStrokeLineCap\n#define DrawSetStrokeLineCap MagickDrawSetStrokeLineCap\n#undef DrawSetStrokeLineJoin\n#define DrawSetStrokeLineJoin MagickDrawSetStrokeLineJoin\n#undef DrawSetStrokeMiterLimit\n#define DrawSetStrokeMiterLimit MagickDrawSetStrokeMiterLimit\n#undef DrawSetStrokeOpacity\n#define DrawSetStrokeOpacity MagickDrawSetStrokeOpacity\n#undef DrawSetStrokePatternURL\n#define DrawSetStrokePatternURL MagickDrawSetStrokePatternURL\n#undef DrawSetStrokeWidth\n#define DrawSetStrokeWidth MagickDrawSetStrokeWidth\n#undef DrawSetTextAntialias\n#define DrawSetTextAntialias MagickDrawSetTextAntialias\n#undef DrawSetTextDecoration\n#define DrawSetTextDecoration MagickDrawSetTextDecoration\n#undef DrawSetTextEncoding\n#define DrawSetTextEncoding MagickDrawSetTextEncoding\n#undef DrawSetTextUnderColor\n#define DrawSetTextUnderColor MagickDrawSetTextUnderColor\n#undef DrawSetViewbox\n#define DrawSetViewbox MagickDrawSetViewbox\n#undef DrawSkewX\n#define DrawSkewX MagickDrawSkewX\n#undef DrawSkewY\n#define DrawSkewY MagickDrawSkewY\n#undef DrawTranslate\n#define DrawTranslate MagickDrawTranslate\n#undef NewDrawingWand\n#define NewDrawingWand MagickNewDrawingWand\n\ntypedef struct _DrawingWand\n  DrawingWand;\n\nextern WandExport char\n  *DrawGetClipPath(const DrawingWand *),\n  *DrawGetException(const DrawingWand *,ExceptionType *),\n  *DrawGetFont(const DrawingWand *),\n  *DrawGetFontFamily(const DrawingWand *),\n  *DrawGetTextEncoding(const DrawingWand *);\n\nextern WandExport ClipPathUnits\n  DrawGetClipUnits(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport DecorationType\n  DrawGetTextDecoration(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport double\n  DrawGetFillOpacity(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetFontSize(const DrawingWand *) MAGICK_FUNC_PURE,\n  *DrawGetStrokeDashArray(const DrawingWand *,unsigned long *),\n  DrawGetStrokeDashOffset(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetStrokeOpacity(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetStrokeWidth(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport DrawInfo\n  *DrawPeekGraphicContext(const DrawingWand *);\n\nextern WandExport DrawingWand\n  *CloneDrawingWand(const DrawingWand *drawing_wand),\n  *DrawAllocateWand(const DrawInfo *,Image *) MAGICK_ATTRIBUTE ((deprecated)),\n  *NewDrawingWand(void);\n\nextern WandExport FillRule\n  DrawGetClipRule(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetFillRule(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport GravityType\n  DrawGetGravity(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport LineCap\n  DrawGetStrokeLineCap(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport LineJoin\n  DrawGetStrokeLineJoin(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport StretchType\n  DrawGetFontStretch(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport StyleType\n  DrawGetFontStyle(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport unsigned int\n  DrawClearException(DrawingWand *),\n  DrawGetStrokeAntialias(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetTextAntialias(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawRender(const DrawingWand *) MAGICK_ATTRIBUTE ((deprecated)); /* Use MagickDrawImage() instead */\n\nextern WandExport unsigned long\n  DrawGetFontWeight(const DrawingWand *) MAGICK_FUNC_PURE,\n  DrawGetStrokeMiterLimit(const DrawingWand *) MAGICK_FUNC_PURE;\n\nextern WandExport void\n  DrawAffine(DrawingWand *,const AffineMatrix *),\n  DrawAnnotation(DrawingWand *,const double,const double,const unsigned char *),\n  DrawArc(DrawingWand *,const double,const double,const double,const double,\n    const double,const double),\n  DrawBezier(DrawingWand *,const unsigned long,const PointInfo *),\n  DrawCircle(DrawingWand *,const double,const double,const double,const double),\n  DrawColor(DrawingWand *,const double,const double,const PaintMethod),\n  DrawComment(DrawingWand *,const char *),\n  DestroyDrawingWand(DrawingWand *),\n  DrawEllipse(DrawingWand *,const double,const double,const double,const double,\n    const double,const double),\n  DrawComposite(DrawingWand *,const CompositeOperator,const double,const double,\n    const double,const double,const Image *),\n  DrawGetFillColor(const DrawingWand *,PixelWand *),\n  DrawGetStrokeColor(const DrawingWand *,PixelWand *),\n  DrawGetTextUnderColor(const DrawingWand *,PixelWand *),\n  DrawLine(DrawingWand *,const double, const double,const double,const double),\n  DrawMatte(DrawingWand *,const double,const double,const PaintMethod),\n  DrawPathClose(DrawingWand *),\n  DrawPathCurveToAbsolute(DrawingWand *,const double,const double,const double,\n    const double,const double,const double),\n  DrawPathCurveToRelative(DrawingWand *,const double,const double,const double,\n    const double,const double, const double),\n  DrawPathCurveToQuadraticBezierAbsolute(DrawingWand *,const double,\n    const double,const double,const double),\n  DrawPathCurveToQuadraticBezierRelative(DrawingWand *,const double,\n    const double,const double,const double),\n  DrawPathCurveToQuadraticBezierSmoothAbsolute(DrawingWand *,const double,\n    const double),\n  DrawPathCurveToQuadraticBezierSmoothRelative(DrawingWand *,const double,\n    const double),\n  DrawPathCurveToSmoothAbsolute(DrawingWand *,const double,const double,\n    const double,const double),\n  DrawPathCurveToSmoothRelative(DrawingWand *,const double,const double,\n    const double,const double),\n  DrawPathEllipticArcAbsolute(DrawingWand *,const double,const double,\n    const double,unsigned int,unsigned int,const double,const double),\n  DrawPathEllipticArcRelative(DrawingWand *,const double,const double,\n    const double,unsigned int,unsigned int,const double,const double),\n  DrawPathFinish(DrawingWand *),\n  DrawPathLineToAbsolute(DrawingWand *,const double,const double),\n  DrawPathLineToRelative(DrawingWand *,const double,const double),\n  DrawPathLineToHorizontalAbsolute(DrawingWand *,const double),\n  DrawPathLineToHorizontalRelative(DrawingWand *,const double),\n  DrawPathLineToVerticalAbsolute(DrawingWand *,const double),\n  DrawPathLineToVerticalRelative(DrawingWand *,const double),\n  DrawPathMoveToAbsolute(DrawingWand *,const double,const double),\n  DrawPathMoveToRelative(DrawingWand *,const double,const double),\n  DrawPathStart(DrawingWand *),\n  DrawPoint(DrawingWand *,const double,const double),\n  DrawPolygon(DrawingWand *,const unsigned long,const PointInfo *),\n  DrawPolyline(DrawingWand *,const unsigned long,const PointInfo *),\n  DrawPopClipPath(DrawingWand *),\n  DrawPopDefs(DrawingWand *),\n  DrawPopGraphicContext(DrawingWand *),\n  DrawPopPattern(DrawingWand *),\n  DrawPushClipPath(DrawingWand *,const char *),\n  DrawPushDefs(DrawingWand *),\n  DrawPushGraphicContext(DrawingWand *),\n  DrawPushPattern(DrawingWand *,const char *,const double,const double,\n    const double,const double),\n  DrawRectangle(DrawingWand *,const double,const double,const double,\n    const double),\n  DrawRotate(DrawingWand *,const double),\n  DrawRoundRectangle(DrawingWand *,double,double,double,double,double,double),\n  DrawScale(DrawingWand *,const double,const double),\n  DrawSetClipPath(DrawingWand *,const char *),\n  DrawSetClipRule(DrawingWand *,const FillRule),\n  DrawSetClipUnits(DrawingWand *,const ClipPathUnits),\n  DrawSetFillColor(DrawingWand *,const PixelWand *),\n  DrawSetFillOpacity(DrawingWand *,const double),\n  DrawSetFillRule(DrawingWand *,const FillRule),\n  DrawSetFillPatternURL(DrawingWand *,const char *),\n  DrawSetFont(DrawingWand *,const char *),\n  DrawSetFontFamily(DrawingWand *,const char *),\n  DrawSetFontSize(DrawingWand *,const double),\n  DrawSetFontStretch(DrawingWand *,const StretchType),\n  DrawSetFontStyle(DrawingWand *,const StyleType),\n  DrawSetFontWeight(DrawingWand *,const unsigned long),\n  DrawSetGravity(DrawingWand *,const GravityType),\n  DrawSkewX(DrawingWand *,const double),\n  DrawSkewY(DrawingWand *,const double),\n  DrawSetStrokeAntialias(DrawingWand *,const unsigned int),\n  DrawSetStrokeColor(DrawingWand *,const PixelWand *),\n  DrawSetStrokeDashArray(DrawingWand *,const unsigned long,const double *),\n  DrawSetStrokeDashOffset(DrawingWand *,const double dashoffset),\n  DrawSetStrokeLineCap(DrawingWand *,const LineCap),\n  DrawSetStrokeLineJoin(DrawingWand *,const LineJoin),\n  DrawSetStrokeMiterLimit(DrawingWand *,const unsigned long),\n  DrawSetStrokeOpacity(DrawingWand *, const double),\n  DrawSetStrokePatternURL(DrawingWand *,const char *),\n  DrawSetStrokeWidth(DrawingWand *,const double),\n  DrawSetTextAntialias(DrawingWand *,const unsigned int),\n  DrawSetTextDecoration(DrawingWand *,const DecorationType),\n  DrawSetTextEncoding(DrawingWand *,const char *),\n  DrawSetTextUnderColor(DrawingWand *,const PixelWand *),\n  DrawSetViewbox(DrawingWand *,unsigned long,unsigned long,unsigned long,\n    unsigned long),\n  DrawTranslate(DrawingWand *,const double,const double);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/wand/magick_wand.h",
    "content": "/* Copyright (C) 2003-2019 GraphicsMagick Group */\n\n/*\n  ImageMagick MagickWand interface.\n*/\n\n#ifndef _MAGICK_WAND_H\n#define _MAGICK_WAND_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#if defined(_VISUALC_)\n#  if defined(_MT) && defined(_DLL) && !defined(_LIB)\n#    pragma warning( disable: 4273 )\n#    if !defined(_WANDLIB_)\n#      define WandExport __declspec(dllimport)\n#    else\n#     define WandExport __declspec(dllexport)\n#    endif\n#  else\n#    define WandExport\n#  endif\n\n#  pragma warning(disable : 4018)\n#  pragma warning(disable : 4244)\n#  pragma warning(disable : 4142)\n#else\n#  define WandExport\n#endif\n\n#include \"magick/api.h\"\n#include \"wand/wand_symbols.h\"\n#include \"wand/drawing_wand.h\"\n#include \"wand/pixel_wand.h\"\n\n  /*\n    ImageMagick compatibility definitions\n  */\n#define MagickSizeType magick_int64_t\n#define ReplaceCompositeOp CopyCompositeOp\n#define IndexChannel BlackChannel\n#define AreaResource UndefinedResource /* not supported */\n\nextern WandExport int\n  FormatMagickString(char *,const size_t,const char *,...)\n    MAGICK_ATTRIBUTE((format (printf,3,4)));\nextern WandExport size_t\n  CopyMagickString(char *,const char *,const size_t);\n\ntypedef struct _MagickWand\n  MagickWand;\n\nextern WandExport char\n  *MagickDescribeImage(MagickWand *),\n  *MagickGetConfigureInfo(MagickWand *,const char *) MAGICK_FUNC_CONST,\n  *MagickGetException(const MagickWand *,ExceptionType *),\n  *MagickGetFilename(const MagickWand *),\n  *MagickGetImageAttribute(MagickWand *, const char *),\n  *MagickGetImageFilename(MagickWand *),\n  *MagickGetImageFormat(MagickWand *),\n  *MagickGetImageSignature(MagickWand *),\n  **MagickQueryFonts(const char *,unsigned long *),\n  **MagickQueryFormats(const char *,unsigned long *);\n\nextern WandExport CompositeOperator\n  MagickGetImageCompose(MagickWand *);\n\nextern WandExport ColorspaceType\n  MagickGetImageColorspace(MagickWand *);\n\nextern WandExport CompressionType\n  MagickGetImageCompression(MagickWand *);\n\nextern WandExport const char\n  *MagickGetCopyright(void) MAGICK_FUNC_CONST,\n  *MagickGetHomeURL(void) MAGICK_FUNC_CONST,\n  *MagickGetImageGeometry(MagickWand *),\n  *MagickGetPackageName(void) MAGICK_FUNC_CONST,\n  *MagickGetQuantumDepth(unsigned long *),\n  *MagickGetReleaseDate(void) MAGICK_FUNC_CONST,\n  *MagickGetVersion(unsigned long *) MAGICK_FUNC_CONST;\n\nextern WandExport DisposeType\n  MagickGetImageDispose(MagickWand *);\n\nextern WandExport double\n  MagickGetImageGamma(MagickWand *),\n  MagickGetImageFuzz(MagickWand *),\n  *MagickGetSamplingFactors(MagickWand *,unsigned long *),\n  *MagickQueryFontMetrics(MagickWand *,const DrawingWand *,const char *);\n\nextern WandExport GravityType\n  MagickGetImageGravity(MagickWand *wand);\n\nextern WandExport ImageType\n  MagickGetImageType(MagickWand *);\n\nextern WandExport ImageType\n  MagickGetImageSavedType(MagickWand *) MAGICK_FUNC_CONST;\n\nextern WandExport InterlaceType\n  MagickGetImageInterlaceScheme(MagickWand *);\n\nextern WandExport long\n  MagickGetImageIndex(MagickWand *);\n\nextern WandExport MagickSizeType\n  MagickGetImageSize(MagickWand *);\n\nextern WandExport MagickWand\n  *CloneMagickWand(const MagickWand *),\n  *MagickAppendImages(MagickWand *,const unsigned int),\n  *MagickAverageImages(MagickWand *),\n  *MagickCoalesceImages(MagickWand *),\n  *MagickCompareImageChannels(MagickWand *,const MagickWand *,const ChannelType,\n    const MetricType,double *),\n  *MagickCompareImages(MagickWand *,const MagickWand *,const MetricType,\n    double *),\n  *MagickDeconstructImages(MagickWand *),\n  *MagickFlattenImages(MagickWand *),\n  *MagickFxImage(MagickWand *,const char *),\n  *MagickFxImageChannel(MagickWand *,const ChannelType,const char *),\n  *MagickGetImage(MagickWand *),\n  *MagickMorphImages(MagickWand *,const unsigned long),\n  *MagickMosaicImages(MagickWand *),\n  *MagickMontageImage(MagickWand *,const DrawingWand *,const char *,\n    const char *,const MontageMode,const char *),\n  *MagickPreviewImages(MagickWand *wand,const PreviewType),\n  *MagickSteganoImage(MagickWand *,const MagickWand *,const long),\n  *MagickStereoImage(MagickWand *,const MagickWand *),\n  *MagickTextureImage(MagickWand *,const MagickWand *),\n  *MagickTransformImage(MagickWand *,const char *,const char *),\n  *NewMagickWand(void);\n\nextern WandExport OrientationType\n  MagickGetImageOrientation(MagickWand *);\n\nextern WandExport PixelWand\n  **MagickGetImageHistogram(MagickWand *,unsigned long *);\n\nextern WandExport RenderingIntent\n  MagickGetImageRenderingIntent(MagickWand *);\n\nextern WandExport ResolutionType\n  MagickGetImageUnits(MagickWand *);\n\nextern WandExport unsigned int\n  DestroyMagickWand(MagickWand *),\n  MagickAdaptiveThresholdImage(MagickWand *,const unsigned long,\n    const unsigned long,const long),\n  MagickAddImage(MagickWand *,const MagickWand *),\n  MagickAddNoiseImage(MagickWand *,const NoiseType),\n  MagickAffineTransformImage(MagickWand *,const DrawingWand *),\n  MagickAnnotateImage(MagickWand *,const DrawingWand *,const double,\n    const double,const double,const char *),\n  MagickAnimateImages(MagickWand *,const char *),\n  MagickAutoOrientImage(MagickWand *wand,const OrientationType),\n  MagickBlackThresholdImage(MagickWand *,const PixelWand *),\n  MagickBlurImage(MagickWand *,const double,const double),\n  MagickBorderImage(MagickWand *,const PixelWand *,const unsigned long,\n    const unsigned long),\n  MagickCdlImage(MagickWand *wand,const char *cdl),\n  MagickCharcoalImage(MagickWand *,const double,const double),\n  MagickChopImage(MagickWand *,const unsigned long,const unsigned long,\n    const long,const long),\n  MagickClipImage(MagickWand *),\n  MagickClipPathImage(MagickWand *,const char *,const unsigned int),\n  MagickColorFloodfillImage(MagickWand *,const PixelWand *,const double,\n    const PixelWand *,const long,const long),\n  MagickColorizeImage(MagickWand *,const PixelWand *,const PixelWand *),\n  MagickCommentImage(MagickWand *,const char *),\n  MagickCompositeImage(MagickWand *,const MagickWand *,const CompositeOperator,\n    const long,const long),\n  MagickContrastImage(MagickWand *,const unsigned int),\n  MagickConvolveImage(MagickWand *,const unsigned long,const double *),\n  MagickCropImage(MagickWand *,const unsigned long,const unsigned long,\n    const long,const long),\n  MagickCycleColormapImage(MagickWand *,const long),\n  MagickDespeckleImage(MagickWand *),\n  MagickDisplayImage(MagickWand *,const char *),\n  MagickDisplayImages(MagickWand *,const char *),\n  MagickDrawImage(MagickWand *,const DrawingWand *),\n  MagickEdgeImage(MagickWand *,const double),\n  MagickEmbossImage(MagickWand *,const double,const double),\n  MagickEnhanceImage(MagickWand *),\n  MagickEqualizeImage(MagickWand *),\n  MagickExtentImage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t),\n  MagickFlipImage(MagickWand *),\n  MagickFlopImage(MagickWand *),\n  MagickFrameImage(MagickWand *,const PixelWand *,const unsigned long,\n    const unsigned long,const long,const long),\n  MagickGammaImage(MagickWand *,const double),\n  MagickGammaImageChannel(MagickWand *,const ChannelType,const double),\n  MagickGetImageBackgroundColor(MagickWand *,PixelWand *),\n  MagickGetImageBluePrimary(MagickWand *,double *,double *),\n  MagickGetImageBorderColor(MagickWand *,PixelWand *),\n  MagickGetImageBoundingBox(MagickWand *wand,const double fuzz,\n    unsigned long *width,unsigned long *height,long *x, long *y),\n  MagickGetImageChannelExtrema(MagickWand *,const ChannelType,unsigned long *,\n    unsigned long *),\n  MagickGetImageChannelMean(MagickWand *,const ChannelType,double *,double *),\n  MagickGetImageColormapColor(MagickWand *,const unsigned long,PixelWand *),\n  MagickGetImageExtrema(MagickWand *,unsigned long *,unsigned long *),\n  MagickGetImageGreenPrimary(MagickWand *,double *,double *),\n  MagickGetImageMatte(MagickWand *),\n  MagickGetImageMatteColor(MagickWand *,PixelWand *),\n  MagickGetImagePage(MagickWand *wand,\n    unsigned long *width,unsigned long *height,long *x,long *y),\n  MagickGetImagePixels(MagickWand *,const long,const long,const unsigned long,\n    const unsigned long,const char *,const StorageType,unsigned char *),\n  MagickGetImageRedPrimary(MagickWand *,double *,double *),\n  MagickGetImageResolution(MagickWand *,double *,double *),\n  MagickGetImageWhitePoint(MagickWand *,double *,double *),\n  MagickGetSize(const MagickWand *,unsigned long *,unsigned long *),\n  MagickHaldClutImage(MagickWand *wand,const MagickWand *clut_wand),\n  MagickHasColormap(MagickWand *,unsigned int *),\n  MagickHasNextImage(MagickWand *),\n  MagickHasPreviousImage(MagickWand *),\n  MagickImplodeImage(MagickWand *,const double),\n  MagickIsGrayImage(MagickWand *,unsigned int *),\n  MagickIsMonochromeImage(MagickWand *,unsigned int *),\n  MagickIsOpaqueImage(MagickWand *,unsigned int *),\n  MagickIsPaletteImage(MagickWand *,unsigned int *),\n  MagickLabelImage(MagickWand *,const char *),\n  MagickLevelImage(MagickWand *,const double,const double,const double),\n  MagickLevelImageChannel(MagickWand *,const ChannelType,const double,\n    const double,const double),\n  MagickMagnifyImage(MagickWand *),\n  MagickMapImage(MagickWand *,const MagickWand *,const unsigned int),\n  MagickMatteFloodfillImage(MagickWand *,const Quantum,const double,\n    const PixelWand *,const long,const long),\n  MagickMedianFilterImage(MagickWand *,const double),\n  MagickMinifyImage(MagickWand *),\n  MagickModulateImage(MagickWand *,const double,const double,const double),\n  MagickMotionBlurImage(MagickWand *,const double,const double,const double),\n  MagickNegateImage(MagickWand *,const unsigned int),\n  MagickNegateImageChannel(MagickWand *,const ChannelType,const unsigned int),\n  MagickNextImage(MagickWand *),\n  MagickNormalizeImage(MagickWand *),\n  MagickOilPaintImage(MagickWand *,const double),\n  MagickOpaqueImage(MagickWand *,const PixelWand *,const PixelWand *,\n    const double),\n  MagickOperatorImageChannel(MagickWand *,const ChannelType,const QuantumOperator,\n    const double),\n  MagickPingImage(MagickWand *,const char *),\n  MagickPreviousImage(MagickWand *),\n  MagickProfileImage(MagickWand *,const char *,const unsigned char *,\n    const unsigned long),\n  MagickQuantizeImage(MagickWand *,const unsigned long,const ColorspaceType,\n    const unsigned long,const unsigned int,const unsigned int),\n  MagickQuantizeImages(MagickWand *,const unsigned long,const ColorspaceType,\n    const unsigned long,const unsigned int,const unsigned int),\n  MagickRadialBlurImage(MagickWand *,const double),\n  MagickRaiseImage(MagickWand *,const unsigned long,const unsigned long,\n    const long,const long,const unsigned int),\n  MagickReadImage(MagickWand *,const char *),\n  MagickReadImageBlob(MagickWand *,const unsigned char *,const size_t length),\n  MagickReadImageFile(MagickWand *,FILE *),\n  MagickReduceNoiseImage(MagickWand *,const double),\n  MagickRelinquishMemory(void *),\n  MagickRemoveImage(MagickWand *),\n  MagickRemoveImageOption(MagickWand *wand,const char *,const char *),\n  MagickResampleImage(MagickWand *,const double,const double,const FilterTypes,\n    const double),\n  MagickResizeImage(MagickWand *,const unsigned long,const unsigned long,\n    const FilterTypes,const double),\n  MagickRollImage(MagickWand *,const long,const long),\n  MagickRotateImage(MagickWand *,const PixelWand *,const double),\n  MagickSampleImage(MagickWand *,const unsigned long,const unsigned long),\n  MagickScaleImage(MagickWand *,const unsigned long,const unsigned long),\n  MagickSeparateImageChannel(MagickWand *,const ChannelType),\n  MagickSetCompressionQuality(MagickWand *wand,const unsigned long quality),\n  MagickSetFilename(MagickWand *,const char *),\n  MagickSetFormat(MagickWand *,const char *),\n  MagickSetImage(MagickWand *,const MagickWand *),\n  MagickSetImageAttribute(MagickWand *,const char *, const char *),\n  MagickSetImageBackgroundColor(MagickWand *,const PixelWand *),\n  MagickSetImageBluePrimary(MagickWand *,const double,const double),\n  MagickSetImageBorderColor(MagickWand *,const PixelWand *),\n  MagickSetImageChannelDepth(MagickWand *,const ChannelType,\n    const unsigned long),\n  MagickSetImageColormapColor(MagickWand *,const unsigned long,\n    const PixelWand *),\n  MagickSetImageCompose(MagickWand *,const CompositeOperator),\n  MagickSetImageCompression(MagickWand *,const CompressionType),\n  MagickSetImageDelay(MagickWand *,const unsigned long),\n  MagickSetImageDepth(MagickWand *,const unsigned long),\n  MagickSetImageDispose(MagickWand *,const DisposeType),\n  MagickSetImageColorspace(MagickWand *,const ColorspaceType),\n  MagickSetImageGreenPrimary(MagickWand *,const double,const double),\n  MagickSetImageGamma(MagickWand *,const double),\n  MagickSetImageGeometry(MagickWand *,const char *),\n  MagickSetImageGravity(MagickWand *,const GravityType),\n  MagickSetImageFilename(MagickWand *,const char *),\n  MagickSetImageFormat(MagickWand *wand,const char *format),\n  MagickSetImageFuzz(MagickWand *,const double),\n  MagickSetImageIndex(MagickWand *,const long),\n  MagickSetImageInterlaceScheme(MagickWand *,const InterlaceType),\n  MagickSetImageIterations(MagickWand *,const unsigned long),\n  MagickSetImageMatte(MagickWand *,const unsigned int),\n  MagickSetImageMatteColor(MagickWand *,const PixelWand *),\n  MagickSetImageOption(MagickWand *,const char *,const char *,const char *),\n  MagickSetImageOrientation(MagickWand *,const OrientationType),\n  MagickSetImagePage(MagickWand *wand,\n    const unsigned long width,const unsigned long height,const long x,\n    const long y),\n  MagickSetImagePixels(MagickWand *,const long,const long,const unsigned long,\n    const unsigned long,const char *,const StorageType,unsigned char *),\n  MagickSetImageRedPrimary(MagickWand *,const double,const double),\n  MagickSetImageRenderingIntent(MagickWand *,const RenderingIntent),\n  MagickSetImageResolution(MagickWand *,const double,const double),\n  MagickSetImageScene(MagickWand *,const unsigned long),\n  MagickSetImageType(MagickWand *,const ImageType),\n  MagickSetImageSavedType(MagickWand *,const ImageType),\n  MagickSetImageUnits(MagickWand *,const ResolutionType),\n  MagickSetImageVirtualPixelMethod(MagickWand *,const VirtualPixelMethod),\n  MagickSetPassphrase(MagickWand *,const char *),\n  MagickSetImageProfile(MagickWand *,const char *,const unsigned char *,\n    const unsigned long),\n  MagickSetResolution(MagickWand *wand,\n    const double x_resolution,const double y_resolution),\n  MagickSetResolutionUnits(MagickWand *wand,const ResolutionType units),\n  MagickSetResourceLimit(const ResourceType type,const unsigned long limit),\n  MagickSetSamplingFactors(MagickWand *,const unsigned long,const double *),\n  MagickSetSize(MagickWand *,const unsigned long,const unsigned long),\n  MagickSetImageWhitePoint(MagickWand *,const double,const double),\n  MagickSetInterlaceScheme(MagickWand *,const InterlaceType),\n  MagickSharpenImage(MagickWand *,const double,const double),\n  MagickShaveImage(MagickWand *,const unsigned long,const unsigned long),\n  MagickShearImage(MagickWand *,const PixelWand *,const double,const double),\n  MagickSolarizeImage(MagickWand *,const double),\n  MagickSpreadImage(MagickWand *,const double),\n  MagickStripImage(MagickWand *),\n  MagickSwirlImage(MagickWand *,const double),\n  MagickTintImage(MagickWand *,const PixelWand *,const PixelWand *),\n  MagickThresholdImage(MagickWand *,const double),\n  MagickThresholdImageChannel(MagickWand *,const ChannelType,const double),\n  MagickTransparentImage(MagickWand *,const PixelWand *,const Quantum,\n    const double),\n  MagickTrimImage(MagickWand *,const double),\n  MagickUnsharpMaskImage(MagickWand *,const double,const double,const double,\n    const double),\n  MagickWaveImage(MagickWand *,const double,const double),\n  MagickWhiteThresholdImage(MagickWand *,const PixelWand *),\n  MagickWriteImage(MagickWand *,const char *),\n  MagickWriteImageFile(MagickWand *,FILE *),\n  MagickWriteImagesFile(MagickWand *,FILE *,const unsigned int),\n  MagickWriteImages(MagickWand *,const char *,const unsigned int);\n\nextern WandExport unsigned long\n  MagickGetImageColors(MagickWand *),\n  MagickGetImageDelay(MagickWand *),\n  MagickGetImageChannelDepth(MagickWand *,const ChannelType),\n  MagickGetImageDepth(MagickWand *),\n  MagickGetImageHeight(MagickWand *),\n  MagickGetImageIterations(MagickWand *),\n  MagickGetImageScene(MagickWand *),\n  MagickGetImageWidth(MagickWand *),\n  MagickGetNumberImages(MagickWand *),\n  MagickGetResourceLimit(const ResourceType);\n\nextern WandExport VirtualPixelMethod\n  MagickGetImageVirtualPixelMethod(MagickWand *);\n\nextern WandExport unsigned char\n  *MagickGetImageProfile(MagickWand *,const char *,unsigned long *),\n  *MagickRemoveImageProfile(MagickWand *,const char *,unsigned long *),\n  *MagickWriteImageBlob(MagickWand *,size_t *);\n\nextern WandExport void\n  MagickClearException(MagickWand *),\n  MagickResetIterator(MagickWand *);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/wand/pixel_wand.h",
    "content": "/*\n  Copyright (C) 2003-2009 GraphicsMagick Group\n  Copyright (C) 2003 ImageMagick Studio\n \n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n \n  GraphicsMagick Pixel Wand Methods.\n*/\n#ifndef _MAGICK_PIXEL_WAND_H\n#define _MAGICK_PIXEL_WAND_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include \"wand/wand_symbols.h\"\n\ntypedef struct _PixelWand PixelWand;\n\nextern WandExport char\n  *PixelGetColorAsString(const PixelWand *);\n\nextern WandExport double\n  PixelGetBlack(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetBlue(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetCyan(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetGreen(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetMagenta(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetOpacity(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetRed(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetYellow(const PixelWand *) MAGICK_FUNC_PURE;\n\nextern WandExport PixelWand\n  *ClonePixelWand(const PixelWand *),\n  **ClonePixelWands(const PixelWand **,const unsigned long),\n  *NewPixelWand(void),\n  **NewPixelWands(const unsigned long);\n\nextern WandExport Quantum\n  PixelGetBlackQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetBlueQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetCyanQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetGreenQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetMagentaQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetOpacityQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetRedQuantum(const PixelWand *) MAGICK_FUNC_PURE,\n  PixelGetYellowQuantum(const PixelWand *) MAGICK_FUNC_PURE;\n\nextern WandExport unsigned int\n  PixelSetColor(PixelWand *,const char *);\n\nextern WandExport unsigned long\n  PixelGetColorCount(const PixelWand *) MAGICK_FUNC_PURE;\n\nextern WandExport void\n  DestroyPixelWand(PixelWand *),\n  PixelGetQuantumColor(const PixelWand *,PixelPacket *),\n  PixelSetBlack(PixelWand *,const double),\n  PixelSetBlackQuantum(PixelWand *,const Quantum),\n  PixelSetBlue(PixelWand *,const double),\n  PixelSetBlueQuantum(PixelWand *,const Quantum),\n  PixelSetColorCount(PixelWand *,const unsigned long),\n  PixelSetCyan(PixelWand *,const double),\n  PixelSetCyanQuantum(PixelWand *,const Quantum),\n  PixelSetGreen(PixelWand *,const double),\n  PixelSetGreenQuantum(PixelWand *,const Quantum),\n  PixelSetMagenta(PixelWand *,const double),\n  PixelSetMagentaQuantum(PixelWand *,const Quantum),\n  PixelSetOpacity(PixelWand *,const double),\n  PixelSetOpacityQuantum(PixelWand *,const Quantum),\n  PixelSetQuantumColor(PixelWand *,PixelPacket *),\n  PixelSetRed(PixelWand *,const double),\n  PixelSetRedQuantum(PixelWand *,const Quantum),\n  PixelSetYellow(PixelWand *,const double),\n  PixelSetYellowQuantum(PixelWand *,const Quantum);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif\n\n#endif\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/wand/wand_api.h",
    "content": "/*\n  Copyright (C) 2003-2018 GraphicsMagick Group\n\n  GraphicsMagick Wand API Methods\n*/\n#ifndef _MAGICK_WAND_API_H\n#define _MAGICK_WAND_API_H\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#include <magick/api.h>\n#include <wand/wand_symbols.h>\n\n#if defined(_VISUALC_)\n\n/**\n * Under VISUALC we have single threaded static libraries, or\n * mutli-threaded DLLs using the multithreaded runtime DLLs.\n **/\n#  if defined(_MT) && defined(_DLL) && !defined(_LIB)\n#    pragma warning( disable: 4273 )    /* Disable the stupid dll linkage warnings */\n#    if !defined(_WANDLIB_)\n#      define WandExport __declspec(dllimport)\n#    else\n#     define WandExport __declspec(dllexport)\n#    endif\n#  else\n#    define WandExport\n#  endif\n\n#  pragma warning(disable : 4018)\n#  pragma warning(disable : 4244)\n#  pragma warning(disable : 4142)\n#else\n#  define WandExport\n#endif\n\n#include <wand/drawing_wand.h>\n#include <wand/magick_wand.h>\n#include <wand/pixel_wand.h>\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}\n#endif /* defined(__cplusplus) || defined(c_plusplus) */\n\n#endif /* _MAGICK_WAND_API_H */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/include/wand/wand_symbols.h",
    "content": "/*\n  Copyright (C) 2012-2018 GraphicsMagick Group\n\n  This program is covered by multiple licenses, which are described in\n  Copyright.txt. You should have received a copy of Copyright.txt with this\n  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.\n\n  Library symbol name-scoping support.\n*/\n\n#if !defined(_MAGICK_WAND_SYMBOLS_H)\n#define _MAGICK_WAND_SYMBOLS_H\n\n#if defined(PREFIX_MAGICK_SYMBOLS)\n\n#define CloneMagickWand GmCloneMagickWand\n#define ClonePixelWand GmClonePixelWand\n#define ClonePixelWands GmClonePixelWands\n#define CopyMagickString GmCopyMagickString\n#define DestroyMagickWand GmDestroyMagickWand\n#define DestroyPixelWand GmDestroyPixelWand\n#define FormatMagickString GmFormatMagickString\n#define FormatMagickStringList GmFormatMagickStringList\n#define MagickAdaptiveThresholdImage GmMagickAdaptiveThresholdImage\n#define MagickAddImage GmMagickAddImage\n#define MagickAddNoiseImage GmMagickAddNoiseImage\n#define MagickAffineTransformImage GmMagickAffineTransformImage\n#define MagickAnimateImages GmMagickAnimateImages\n#define MagickAnnotateImage GmMagickAnnotateImage\n#define MagickAppendImages GmMagickAppendImages\n#define MagickAutoOrientImage GmMagickAutoOrientImage\n#define MagickAverageImages GmMagickAverageImages\n#define MagickBlackThresholdImage GmMagickBlackThresholdImage\n#define MagickBlurImage GmMagickBlurImage\n#define MagickBorderImage GmMagickBorderImage\n#define MagickCdlImage GmMagickCdlImage\n#define MagickCharcoalImage GmMagickCharcoalImage\n#define MagickChopImage GmMagickChopImage\n#define MagickClearException GmMagickClearException\n#define MagickClipImage GmMagickClipImage\n#define MagickClipPathImage GmMagickClipPathImage\n#define MagickCloneDrawingWand GmMagickCloneDrawingWand\n#define MagickCoalesceImages GmMagickCoalesceImages\n#define MagickColorFloodfillImage GmMagickColorFloodfillImage\n#define MagickColorizeImage GmMagickColorizeImage\n#define MagickCommentImage GmMagickCommentImage\n#define MagickCompareImageChannels GmMagickCompareImageChannels\n#define MagickCompareImages GmMagickCompareImages\n#define MagickCompositeImage GmMagickCompositeImage\n#define MagickContrastImage GmMagickContrastImage\n#define MagickConvolveImage GmMagickConvolveImage\n#define MagickCropImage GmMagickCropImage\n#define MagickCycleColormapImage GmMagickCycleColormapImage\n#define MagickDeconstructImages GmMagickDeconstructImages\n#define MagickDescribeImage GmMagickDescribeImage\n#define MagickDespeckleImage GmMagickDespeckleImage\n#define MagickDestroyDrawingWand GmMagickDestroyDrawingWand\n#define MagickDisplayImage GmMagickDisplayImage\n#define MagickDisplayImages GmMagickDisplayImages\n#define MagickDrawAffine GmMagickDrawAffine\n#define MagickDrawAllocateWand GmMagickDrawAllocateWand\n#define MagickDrawAnnotation GmMagickDrawAnnotation\n#define MagickDrawArc GmMagickDrawArc\n#define MagickDrawBezier GmMagickDrawBezier\n#define MagickDrawCircle GmMagickDrawCircle\n#define MagickDrawClearException GmMagickDrawClearException\n#define MagickDrawColor GmMagickDrawColor\n#define MagickDrawComment GmMagickDrawComment\n#define MagickDrawComposite GmMagickDrawComposite\n#define MagickDrawEllipse GmMagickDrawEllipse\n#define MagickDrawGetClipPath GmMagickDrawGetClipPath\n#define MagickDrawGetClipRule GmMagickDrawGetClipRule\n#define MagickDrawGetClipUnits GmMagickDrawGetClipUnits\n#define MagickDrawGetException GmMagickDrawGetException\n#define MagickDrawGetFillColor GmMagickDrawGetFillColor\n#define MagickDrawGetFillOpacity GmMagickDrawGetFillOpacity\n#define MagickDrawGetFillRule GmMagickDrawGetFillRule\n#define MagickDrawGetFont GmMagickDrawGetFont\n#define MagickDrawGetFontFamily GmMagickDrawGetFontFamily\n#define MagickDrawGetFontSize GmMagickDrawGetFontSize\n#define MagickDrawGetFontStretch GmMagickDrawGetFontStretch\n#define MagickDrawGetFontStyle GmMagickDrawGetFontStyle\n#define MagickDrawGetFontWeight GmMagickDrawGetFontWeight\n#define MagickDrawGetGravity GmMagickDrawGetGravity\n#define MagickDrawGetStrokeAntialias GmMagickDrawGetStrokeAntialias\n#define MagickDrawGetStrokeColor GmMagickDrawGetStrokeColor\n#define MagickDrawGetStrokeDashArray GmMagickDrawGetStrokeDashArray\n#define MagickDrawGetStrokeDashOffset GmMagickDrawGetStrokeDashOffset\n#define MagickDrawGetStrokeLineCap GmMagickDrawGetStrokeLineCap\n#define MagickDrawGetStrokeLineJoin GmMagickDrawGetStrokeLineJoin\n#define MagickDrawGetStrokeMiterLimit GmMagickDrawGetStrokeMiterLimit\n#define MagickDrawGetStrokeOpacity GmMagickDrawGetStrokeOpacity\n#define MagickDrawGetStrokeWidth GmMagickDrawGetStrokeWidth\n#define MagickDrawGetTextAntialias GmMagickDrawGetTextAntialias\n#define MagickDrawGetTextDecoration GmMagickDrawGetTextDecoration\n#define MagickDrawGetTextEncoding GmMagickDrawGetTextEncoding\n#define MagickDrawGetTextUnderColor GmMagickDrawGetTextUnderColor\n#define MagickDrawImage GmMagickDrawImage\n#define MagickDrawLine GmMagickDrawLine\n#define MagickDrawMatte GmMagickDrawMatte\n#define MagickDrawPathClose GmMagickDrawPathClose\n#define MagickDrawPathCurveToAbsolute GmMagickDrawPathCurveToAbsolute\n#define MagickDrawPathCurveToQuadraticBezierAbsolute GmMagickDrawPathCurveToQuadraticBezierAbsolute\n#define MagickDrawPathCurveToQuadraticBezierRelative GmMagickDrawPathCurveToQuadraticBezierRelative\n#define MagickDrawPathCurveToQuadraticBezierSmoothAbsolute GmMagickDrawPathCurveToQuadraticBezierSmoothAbsolute\n#define MagickDrawPathCurveToQuadraticBezierSmoothRelative GmMagickDrawPathCurveToQuadraticBezierSmoothRelative\n#define MagickDrawPathCurveToRelative GmMagickDrawPathCurveToRelative\n#define MagickDrawPathCurveToSmoothAbsolute GmMagickDrawPathCurveToSmoothAbsolute\n#define MagickDrawPathCurveToSmoothRelative GmMagickDrawPathCurveToSmoothRelative\n#define MagickDrawPathEllipticArcAbsolute GmMagickDrawPathEllipticArcAbsolute\n#define MagickDrawPathEllipticArcRelative GmMagickDrawPathEllipticArcRelative\n#define MagickDrawPathFinish GmMagickDrawPathFinish\n#define MagickDrawPathLineToAbsolute GmMagickDrawPathLineToAbsolute\n#define MagickDrawPathLineToHorizontalAbsolute GmMagickDrawPathLineToHorizontalAbsolute\n#define MagickDrawPathLineToHorizontalRelative GmMagickDrawPathLineToHorizontalRelative\n#define MagickDrawPathLineToRelative GmMagickDrawPathLineToRelative\n#define MagickDrawPathLineToVerticalAbsolute GmMagickDrawPathLineToVerticalAbsolute\n#define MagickDrawPathLineToVerticalRelative GmMagickDrawPathLineToVerticalRelative\n#define MagickDrawPathMoveToAbsolute GmMagickDrawPathMoveToAbsolute\n#define MagickDrawPathMoveToRelative GmMagickDrawPathMoveToRelative\n#define MagickDrawPathStart GmMagickDrawPathStart\n#define MagickDrawPeekGraphicContext GmMagickDrawPeekGraphicContext\n#define MagickDrawPoint GmMagickDrawPoint\n#define MagickDrawPolygon GmMagickDrawPolygon\n#define MagickDrawPolyline GmMagickDrawPolyline\n#define MagickDrawPopClipPath GmMagickDrawPopClipPath\n#define MagickDrawPopDefs GmMagickDrawPopDefs\n#define MagickDrawPopGraphicContext GmMagickDrawPopGraphicContext\n#define MagickDrawPopPattern GmMagickDrawPopPattern\n#define MagickDrawPushClipPath GmMagickDrawPushClipPath\n#define MagickDrawPushDefs GmMagickDrawPushDefs\n#define MagickDrawPushGraphicContext GmMagickDrawPushGraphicContext\n#define MagickDrawPushPattern GmMagickDrawPushPattern\n#define MagickDrawRectangle GmMagickDrawRectangle\n#define MagickDrawRender GmMagickDrawRender\n#define MagickDrawRotate GmMagickDrawRotate\n#define MagickDrawRoundRectangle GmMagickDrawRoundRectangle\n#define MagickDrawScale GmMagickDrawScale\n#define MagickDrawSetClipPath GmMagickDrawSetClipPath\n#define MagickDrawSetClipRule GmMagickDrawSetClipRule\n#define MagickDrawSetClipUnits GmMagickDrawSetClipUnits\n#define MagickDrawSetFillColor GmMagickDrawSetFillColor\n#define MagickDrawSetFillOpacity GmMagickDrawSetFillOpacity\n#define MagickDrawSetFillPatternURL GmMagickDrawSetFillPatternURL\n#define MagickDrawSetFillRule GmMagickDrawSetFillRule\n#define MagickDrawSetFont GmMagickDrawSetFont\n#define MagickDrawSetFontFamily GmMagickDrawSetFontFamily\n#define MagickDrawSetFontSize GmMagickDrawSetFontSize\n#define MagickDrawSetFontStretch GmMagickDrawSetFontStretch\n#define MagickDrawSetFontStyle GmMagickDrawSetFontStyle\n#define MagickDrawSetFontWeight GmMagickDrawSetFontWeight\n#define MagickDrawSetGravity GmMagickDrawSetGravity\n#define MagickDrawSetStrokeAntialias GmMagickDrawSetStrokeAntialias\n#define MagickDrawSetStrokeColor GmMagickDrawSetStrokeColor\n#define MagickDrawSetStrokeDashArray GmMagickDrawSetStrokeDashArray\n#define MagickDrawSetStrokeDashOffset GmMagickDrawSetStrokeDashOffset\n#define MagickDrawSetStrokeLineCap GmMagickDrawSetStrokeLineCap\n#define MagickDrawSetStrokeLineJoin GmMagickDrawSetStrokeLineJoin\n#define MagickDrawSetStrokeMiterLimit GmMagickDrawSetStrokeMiterLimit\n#define MagickDrawSetStrokeOpacity GmMagickDrawSetStrokeOpacity\n#define MagickDrawSetStrokePatternURL GmMagickDrawSetStrokePatternURL\n#define MagickDrawSetStrokeWidth GmMagickDrawSetStrokeWidth\n#define MagickDrawSetTextAntialias GmMagickDrawSetTextAntialias\n#define MagickDrawSetTextDecoration GmMagickDrawSetTextDecoration\n#define MagickDrawSetTextEncoding GmMagickDrawSetTextEncoding\n#define MagickDrawSetTextUnderColor GmMagickDrawSetTextUnderColor\n#define MagickDrawSetViewbox GmMagickDrawSetViewbox\n#define MagickDrawSkewX GmMagickDrawSkewX\n#define MagickDrawSkewY GmMagickDrawSkewY\n#define MagickDrawTranslate GmMagickDrawTranslate\n#define MagickEdgeImage GmMagickEdgeImage\n#define MagickEmbossImage GmMagickEmbossImage\n#define MagickEnhanceImage GmMagickEnhanceImage\n#define MagickEqualizeImage GmMagickEqualizeImage\n#define MagickExtentImage GmMagickExtentImage\n#define MagickFlattenImages GmMagickFlattenImages\n#define MagickFlipImage GmMagickFlipImage\n#define MagickFlopImage GmMagickFlopImage\n#define MagickFrameImage GmMagickFrameImage\n#define MagickFxImage GmMagickFxImage\n#define MagickFxImageChannel GmMagickFxImageChannel\n#define MagickGammaImage GmMagickGammaImage\n#define MagickGammaImageChannel GmMagickGammaImageChannel\n#define MagickGetConfigureInfo GmMagickGetConfigureInfo\n#define MagickGetCopyright GmMagickGetCopyright\n#define MagickGetException GmMagickGetException\n#define MagickGetFilename GmMagickGetFilename\n#define MagickGetHomeURL GmMagickGetHomeURL\n#define MagickGetImage GmMagickGetImage\n#define MagickGetImageAttribute GmMagickGetImageAttribute\n#define MagickGetImageBackgroundColor GmMagickGetImageBackgroundColor\n#define MagickGetImageBluePrimary GmMagickGetImageBluePrimary\n#define MagickGetImageBorderColor GmMagickGetImageBorderColor\n#define MagickGetImageBoundingBox GmMagickGetImageBoundingBox\n#define MagickGetImageChannelDepth GmMagickGetImageChannelDepth\n#define MagickGetImageChannelExtrema GmMagickGetImageChannelExtrema\n#define MagickGetImageChannelMean GmMagickGetImageChannelMean\n#define MagickGetImageColormapColor GmMagickGetImageColormapColor\n#define MagickGetImageColors GmMagickGetImageColors\n#define MagickGetImageColorspace GmMagickGetImageColorspace\n#define MagickGetImageCompose GmMagickGetImageCompose\n#define MagickGetImageCompression GmMagickGetImageCompression\n#define MagickGetImageDelay GmMagickGetImageDelay\n#define MagickGetImageDepth GmMagickGetImageDepth\n#define MagickGetImageDispose GmMagickGetImageDispose\n#define MagickGetImageExtrema GmMagickGetImageExtrema\n#define MagickGetImageFilename GmMagickGetImageFilename\n#define MagickGetImageFormat GmMagickGetImageFormat\n#define MagickGetImageFuzz GmMagickGetImageFuzz\n#define MagickGetImageGamma GmMagickGetImageGamma\n#define MagickGetImageGeometry GmMagickGetImageGeometry\n#define MagickGetImageGravity GmMagickGetImageGravity\n#define MagickGetImageGreenPrimary GmMagickGetImageGreenPrimary\n#define MagickGetImageHeight GmMagickGetImageHeight\n#define MagickGetImageHistogram GmMagickGetImageHistogram\n#define MagickGetImageIndex GmMagickGetImageIndex\n#define MagickGetImageInterlaceScheme GmMagickGetImageInterlaceScheme\n#define MagickGetImageIterations GmMagickGetImageIterations\n#define MagickGetImageMatte GmMagickGetImageMatte\n#define MagickGetImageMatteColor GmMagickGetImageMatteColor\n#define MagickGetImageOrientation GmMagickGetImageOrientation\n#define MagickGetImagePage GmMagickGetImagePage\n#define MagickGetImagePixels GmMagickGetImagePixels\n#define MagickGetImageProfile GmMagickGetImageProfile\n#define MagickGetImageRedPrimary GmMagickGetImageRedPrimary\n#define MagickGetImageRenderingIntent GmMagickGetImageRenderingIntent\n#define MagickGetImageResolution GmMagickGetImageResolution\n#define MagickGetImageSavedType GmMagickGetImageSavedType\n#define MagickGetImageScene GmMagickGetImageScene\n#define MagickGetImageSignature GmMagickGetImageSignature\n#define MagickGetImageSize GmMagickGetImageSize\n#define MagickGetImageType GmMagickGetImageType\n#define MagickGetImageUnits GmMagickGetImageUnits\n#define MagickGetImageVirtualPixelMethod GmMagickGetImageVirtualPixelMethod\n#define MagickGetImageWhitePoint GmMagickGetImageWhitePoint\n#define MagickGetImageWidth GmMagickGetImageWidth\n#define MagickGetNumberImages GmMagickGetNumberImages\n#define MagickGetPackageName GmMagickGetPackageName\n#define MagickGetQuantumDepth GmMagickGetQuantumDepth\n#define MagickGetReleaseDate GmMagickGetReleaseDate\n#define MagickGetResourceLimit GmMagickGetResourceLimit\n#define MagickGetSamplingFactors GmMagickGetSamplingFactors\n#define MagickGetSize GmMagickGetSize\n#define MagickGetVersion GmMagickGetVersion\n#define MagickHaldClutImage GmMagickHaldClutImage\n#define MagickHasColormap GmMagickHasColormap\n#define MagickHasNextImage GmMagickHasNextImage\n#define MagickHasPreviousImage GmMagickHasPreviousImage\n#define MagickImplodeImage GmMagickImplodeImage\n#define MagickIsGrayImage GmMagickIsGrayImage\n#define MagickIsMonochromeImage GmMagickIsMonochromeImage\n#define MagickIsOpaqueImage GmMagickIsOpaqueImage\n#define MagickIsPaletteImage GmMagickIsPaletteImage\n#define MagickLabelImage GmMagickLabelImage\n#define MagickLevelImage GmMagickLevelImage\n#define MagickLevelImageChannel GmMagickLevelImageChannel\n#define MagickMagnifyImage GmMagickMagnifyImage\n#define MagickMapImage GmMagickMapImage\n#define MagickMatteFloodfillImage GmMagickMatteFloodfillImage\n#define MagickMedianFilterImage GmMagickMedianFilterImage\n#define MagickMinifyImage GmMagickMinifyImage\n#define MagickModulateImage GmMagickModulateImage\n#define MagickMontageImage GmMagickMontageImage\n#define MagickMorphImages GmMagickMorphImages\n#define MagickMosaicImages GmMagickMosaicImages\n#define MagickMotionBlurImage GmMagickMotionBlurImage\n#define MagickNegateImage GmMagickNegateImage\n#define MagickNegateImageChannel GmMagickNegateImageChannel\n#define MagickNewDrawingWand GmMagickNewDrawingWand\n#define MagickNextImage GmMagickNextImage\n#define MagickNormalizeImage GmMagickNormalizeImage\n#define MagickOilPaintImage GmMagickOilPaintImage\n#define MagickOpaqueImage GmMagickOpaqueImage\n#define MagickOperatorImageChannel GmMagickOperatorImageChannel\n#define MagickPingImage GmMagickPingImage\n#define MagickPreviewImages GmMagickPreviewImages\n#define MagickPreviousImage GmMagickPreviousImage\n#define MagickProfileImage GmMagickProfileImage\n#define MagickQuantizeImage GmMagickQuantizeImage\n#define MagickQuantizeImages GmMagickQuantizeImages\n#define MagickQueryFontMetrics GmMagickQueryFontMetrics\n#define MagickQueryFonts GmMagickQueryFonts\n#define MagickQueryFormats GmMagickQueryFormats\n#define MagickRadialBlurImage GmMagickRadialBlurImage\n#define MagickRaiseImage GmMagickRaiseImage\n#define MagickReadImage GmMagickReadImage\n#define MagickReadImageBlob GmMagickReadImageBlob\n#define MagickReadImageFile GmMagickReadImageFile\n#define MagickReduceNoiseImage GmMagickReduceNoiseImage\n#define MagickRelinquishMemory GmMagickRelinquishMemory\n#define MagickRemoveImage GmMagickRemoveImage\n#define MagickRemoveImageOption GmMagickRemoveImageOption\n#define MagickRemoveImageProfile GmMagickRemoveImageProfile\n#define MagickResampleImage GmMagickResampleImage\n#define MagickResetIterator GmMagickResetIterator\n#define MagickResizeImage GmMagickResizeImage\n#define MagickRollImage GmMagickRollImage\n#define MagickRotateImage GmMagickRotateImage\n#define MagickSampleImage GmMagickSampleImage\n#define MagickScaleImage GmMagickScaleImage\n#define MagickSeparateImageChannel GmMagickSeparateImageChannel\n#define MagickSetCompressionQuality GmMagickSetCompressionQuality\n#define MagickSetDepth GmMagickSetDepth\n#define MagickSetFilename GmMagickSetFilename\n#define MagickSetFormat GmMagickSetFormat\n#define MagickSetImage GmMagickSetImage\n#define MagickSetImageAttribute GmMagickSetImageAttribute\n#define MagickSetImageBackgroundColor GmMagickSetImageBackgroundColor\n#define MagickSetImageBluePrimary GmMagickSetImageBluePrimary\n#define MagickSetImageBorderColor GmMagickSetImageBorderColor\n#define MagickSetImageChannelDepth GmMagickSetImageChannelDepth\n#define MagickSetImageColormapColor GmMagickSetImageColormapColor\n#define MagickSetImageColorspace GmMagickSetImageColorspace\n#define MagickSetImageCompose GmMagickSetImageCompose\n#define MagickSetImageCompression GmMagickSetImageCompression\n#define MagickSetImageDelay GmMagickSetImageDelay\n#define MagickSetImageDepth GmMagickSetImageDepth\n#define MagickSetImageDispose GmMagickSetImageDispose\n#define MagickSetImageFilename GmMagickSetImageFilename\n#define MagickSetImageFormat GmMagickSetImageFormat\n#define MagickSetImageFuzz GmMagickSetImageFuzz\n#define MagickSetImageGamma GmMagickSetImageGamma\n#define MagickSetImageGeometry GmMagickSetImageGeometry\n#define MagickSetImageGravity GmMagickSetImageGravity\n#define MagickSetImageGreenPrimary GmMagickSetImageGreenPrimary\n#define MagickSetImageIndex GmMagickSetImageIndex\n#define MagickSetImageInterlaceScheme GmMagickSetImageInterlaceScheme\n#define MagickSetImageIterations GmMagickSetImageIterations\n#define MagickSetImageMatte GmMagickSetImageMatte\n#define MagickSetImageMatteColor GmMagickSetImageMatteColor\n#define MagickSetImageOption GmMagickSetImageOption\n#define MagickSetImageOrientation GmMagickSetImageOrientation\n#define MagickSetImagePage GmMagickSetImagePage\n#define MagickSetImagePixels GmMagickSetImagePixels\n#define MagickSetImageProfile GmMagickSetImageProfile\n#define MagickSetImageRedPrimary GmMagickSetImageRedPrimary\n#define MagickSetImageRenderingIntent GmMagickSetImageRenderingIntent\n#define MagickSetImageResolution GmMagickSetImageResolution\n#define MagickSetImageSavedType GmMagickSetImageSavedType\n#define MagickSetImageScene GmMagickSetImageScene\n#define MagickSetImageType GmMagickSetImageType\n#define MagickSetImageUnits GmMagickSetImageUnits\n#define MagickSetImageVirtualPixelMethod GmMagickSetImageVirtualPixelMethod\n#define MagickSetImageWhitePoint GmMagickSetImageWhitePoint\n#define MagickSetInterlaceScheme GmMagickSetInterlaceScheme\n#define MagickSetPassphrase GmMagickSetPassphrase\n#define MagickSetResolution GmMagickSetResolution\n#define MagickSetResolutionUnits GmMagickSetResolutionUnits\n#define MagickSetResourceLimit GmMagickSetResourceLimit\n#define MagickSetSamplingFactors GmMagickSetSamplingFactors\n#define MagickSetSize GmMagickSetSize\n#define MagickSharpenImage GmMagickSharpenImage\n#define MagickShaveImage GmMagickShaveImage\n#define MagickShearImage GmMagickShearImage\n#define MagickSolarizeImage GmMagickSolarizeImage\n#define MagickSpreadImage GmMagickSpreadImage\n#define MagickSteganoImage GmMagickSteganoImage\n#define MagickStereoImage GmMagickStereoImage\n#define MagickStripImage GmMagickStripImage\n#define MagickSwirlImage GmMagickSwirlImage\n#define MagickTextureImage GmMagickTextureImage\n#define MagickThresholdImage GmMagickThresholdImage\n#define MagickThresholdImageChannel GmMagickThresholdImageChannel\n#define MagickTintImage GmMagickTintImage\n#define MagickTransformImage GmMagickTransformImage\n#define MagickTransparentImage GmMagickTransparentImage\n#define MagickTrimImage GmMagickTrimImage\n#define MagickUnsharpMaskImage GmMagickUnsharpMaskImage\n#define MagickWaveImage GmMagickWaveImage\n#define MagickWhiteThresholdImage GmMagickWhiteThresholdImage\n#define MagickWriteImage GmMagickWriteImage\n#define MagickWriteImageBlob GmMagickWriteImageBlob\n#define MagickWriteImageFile GmMagickWriteImageFile\n#define MagickWriteImages GmMagickWriteImages\n#define MagickWriteImagesFile GmMagickWriteImagesFile\n#define NewMagickWand GmNewMagickWand\n#define NewPixelWand GmNewPixelWand\n#define NewPixelWands GmNewPixelWands\n#define PixelGetBlack GmPixelGetBlack\n#define PixelGetBlackQuantum GmPixelGetBlackQuantum\n#define PixelGetBlue GmPixelGetBlue\n#define PixelGetBlueQuantum GmPixelGetBlueQuantum\n#define PixelGetColorAsString GmPixelGetColorAsString\n#define PixelGetColorCount GmPixelGetColorCount\n#define PixelGetCyan GmPixelGetCyan\n#define PixelGetCyanQuantum GmPixelGetCyanQuantum\n#define PixelGetException GmPixelGetException\n#define PixelGetGreen GmPixelGetGreen\n#define PixelGetGreenQuantum GmPixelGetGreenQuantum\n#define PixelGetMagenta GmPixelGetMagenta\n#define PixelGetMagentaQuantum GmPixelGetMagentaQuantum\n#define PixelGetOpacity GmPixelGetOpacity\n#define PixelGetOpacityQuantum GmPixelGetOpacityQuantum\n#define PixelGetQuantumColor GmPixelGetQuantumColor\n#define PixelGetRed GmPixelGetRed\n#define PixelGetRedQuantum GmPixelGetRedQuantum\n#define PixelGetYellow GmPixelGetYellow\n#define PixelGetYellowQuantum GmPixelGetYellowQuantum\n#define PixelSetBlack GmPixelSetBlack\n#define PixelSetBlackQuantum GmPixelSetBlackQuantum\n#define PixelSetBlue GmPixelSetBlue\n#define PixelSetBlueQuantum GmPixelSetBlueQuantum\n#define PixelSetColor GmPixelSetColor\n#define PixelSetColorCount GmPixelSetColorCount\n#define PixelSetCyan GmPixelSetCyan\n#define PixelSetCyanQuantum GmPixelSetCyanQuantum\n#define PixelSetGreen GmPixelSetGreen\n#define PixelSetGreenQuantum GmPixelSetGreenQuantum\n#define PixelSetMagenta GmPixelSetMagenta\n#define PixelSetMagentaQuantum GmPixelSetMagentaQuantum\n#define PixelSetOpacity GmPixelSetOpacity\n#define PixelSetOpacityQuantum GmPixelSetOpacityQuantum\n#define PixelSetQuantumColor GmPixelSetQuantumColor\n#define PixelSetRed GmPixelSetRed\n#define PixelSetRedQuantum GmPixelSetRedQuantum\n#define PixelSetYellow GmPixelSetYellow\n#define PixelSetYellowQuantum GmPixelSetYellowQuantum\n#define QueryMagickColor GmQueryMagickColor\n\n#endif /* defined(PREFIX_MAGICK_SYMBOLS) */\n#endif /* defined(_MAGICK_WAND_SYMBOLS_H) */\n\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 2\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/lib/GraphicsMagick-1.3.35/config/delegates.mgk",
    "content": "<?xml version=\"1.0\"?>\n<!--\n  Delegate command file.\n\n  Commands which specify\n\n    decode=\"in_format\" encode=\"out_format\"\n\n  specify the rules for converting from in_format to out_format\n  These rules may be used to translate directly between formats.\n\n  Commands which specify only\n\n    decode=\"in_format\"\n\n  specify the rules for converting from in_format to some format that\n  GraphicsMagick will automatically recognize. These rules are used to\n  decode formats.\n\n  Commands which specify only\n\n   encode=\"out_format\"\n\n  specify the rules for an \"encoder\" which may accept any input format.\n\n  For delegates other than gs-color, gs-mono, and mpeg-encode\n  the substitution rules are as follows:\n\n    %i  input image filename\n    %o  output image filename\n    %u  unique temporary filename\n    %z  secondary unique temporary filename\n\n    %#  input image signature\n    %b  image file size\n    %c  input image comment\n    %d  original filename directory part\n    %e  original filename extension part\n    %f  original filename\n    %t  original filename top (base) part\n    %g  window group\n    %h  image rows (height)\n    %k  input image number colors\n    %l  input image label\n    %m  input image format (\"magick\")\n    %n  input image number of scenes\n    %p  page number\n    %q  input image depth\n    %r  input image storage class, colorspace, and matte\n    %s  scene number\n    %w  image columns (width)\n    %x  input image x resolution\n    %y  input image y resolution\n    %[  input image attribute (e.g. \"%[EXIF:Orientation]\")\n    %%  pass through literal %\n\n  Under Unix, all text (non-numeric) substitutions should be\n  surrounded with double quotes for the purpose of security, and\n  because any double quotes occuring within the substituted text will\n  be escaped using a backslash.\n\n  Commands (excluding file names) containing one or more of the\n  special characters \";&|><\" (requiring that multiple processes be\n  executed) are executed via the Unix shell with text substitutions\n  carefully excaped to avoid possible compromise.  Otherwise, commands\n  are executed directly without use of the Unix shell.\n\n  Use 'gm convert -list delegates' to verify how the contents of this\n  file has been parsed.\n\n -->\n<delegatemap>\n  <delegate decode=\"browse\" stealth=\"True\" command='\"xdg-open\" \"http://www.GraphicsMagick.org/\" &'  />\n  <delegate decode=\"cgm\" command='\"ralcgm\" -d ps < \"%i\" > \"%o\" 2>/dev/null' />\n  <delegate decode=\"dcraw\" command='\"dcraw\" -c -w -T \"%i\" > \"%o\"' />\n  <delegate decode=\"dot\" command='\"dot\" -Tps \"%i\" -o \"%o\"' />\n  <delegate decode=\"dvi\" command='\"dvips\" -q -o \"%o\" \"%i\"' />\n  <delegate decode=\"edit\" stealth=\"True\" command='\"xterm\" -title \"Edit Image Comment\" -e vi \"%o\"' />\n  <delegate decode=\"eps\" encode=\"pdf\" mode=\"bi\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pdfwrite \"-sOutputFile=%o\" -- \"%i\" -c quit' />\n  <delegate decode=\"eps\" encode=\"ps\" mode=\"bi\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pswrite \"-sOutputFile=%o\" -- \"%i\" -c quit' />\n  <delegate decode=\"fig\" command='\"fig2dev\" -L ps \"%i\" \"%o\"' />\n\n  <!-- Read monochrome Postscript, EPS, and PDF  -->\n  <delegate decode=\"gs-mono\" stealth=\"True\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pbmraw -dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s \"-sOutputFile=%s\" -- \"%s\" -c quit' />\n\n  <!-- Read grayscale Postscript, EPS, and PDF  -->\n  <delegate decode=\"gs-gray\" stealth=\"True\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pgmraw -dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s \"-sOutputFile=%s\" -- \"%s\" -c quit' />\n\n  <!-- Read colormapped Postscript, EPS, and PDF  -->\n  <delegate decode=\"gs-palette\" stealth=\"True\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pcx256 -dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s \"-sOutputFile=%s\" -- \"%s\" -c quit' />\n\n  <!-- Read color Postscript, EPS, and PDF  -->\n  <delegate decode=\"gs-color\" stealth=\"True\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=ppmraw -dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s \"-sOutputFile=%s\" -- \"%s\" -c quit' />\n\n  <!-- Read color+alpha Postscript, EPS, and PDF  -->\n  <delegate decode=\"gs-color+alpha\" stealth=\"True\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pngalpha -dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s \"-sOutputFile=%s\" -- \"%s\" -c quit' />\n\n  <!-- Read CMYK Postscript, EPS, and PDF  -->\n  <delegate decode=\"gs-cmyk\" stealth=\"True\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE= -dTextAlphaBits=%u -dGraphicsAlphaBits=%u -r%s %s \"-sOutputFile=%s\" -- \"%s\" -c quit' />\n\n  <!-- Read monochrome PDF using Poppler's pdftoppm -->\n  <delegate decode=\"poppler-mono\" stealth=\"True\" command='\"pdftoppm\" \"-mono\" \"-freetype\" \"yes\" \"-aa\" \"yes\" \"-aaVector\" \"yes\" \"-rx\" \"72\" \"-ry\" \"72\" \"%s\" \">\" \"%s\"' />\n\n  <!-- Read grayscale PDF using Poppler's pdftoppm -->\n  <delegate decode=\"poppler-grey\" stealth=\"True\" command='\"pdftoppm\" \"-gray\" \"-freetype\" \"yes\" \"-aa\" \"yes\" \"-aaVector\" \"yes\" \"-rx\" \"72\" \"-ry\" \"72\" \"%s\" \">\" \"%s\"' />\n\n  <!-- Read color PDF using Poppler's pdftoppm -->\n  <delegate decode=\"poppler-color\" stealth=\"True\" command='\"pdftoppm\" \"-freetype\" \"yes\" \"-rx\" \"-aa\" \"yes\" \"-aaVector\" \"yes\" \"72\" \"-ry\" \"72\" \"%s\" \">\" \"%s\"' />\n\n  <delegate decode=\"hpg\" command='\"hp2xx\" -q -m eps -f `basename \"%o\"` \"%i\" && /usr/bin/mv -f `basename \"%o\"` \"%o\"' />\n  <delegate decode=\"hpgl\" command='\"hp2xx\" -q -m eps -f `basename \"%o\"` \"%i\" && /usr/bin/mv -f `basename \"%o\"` \"%o\"' />\n  <!-- Read HTML file  -->\n  <delegate decode=\"htm\" command='\"html2ps\" -U -o \"%o\" \"%i\"' />\n  <!-- Read HTML file  -->\n  <delegate decode=\"html\" command='\"html2ps\" -U -o \"%o\" \"%i\"' />\n  <!-- Read IFF ILBM file -->\n  <delegate decode=\"ilbm\" command='\"ilbmtoppm\" \"%i\" > \"%o\"' />\n  <!-- Read MPEG file using mpeg2decode  -->\n  <delegate decode=\"mpeg\" command='\"mpeg2decode\" -q -b \"%i\" -f -o3 \"%u%%05d\"; gm convert -temporary \"%u*.ppm\" \"miff:%o\" ; rm -f \"%u\"*.ppm ' />\n  <!-- Write MPEG file using mpeg2encode -->\n  <delegate encode=\"mpeg-encode\" stealth=\"True\" command='\"mpeg2encode\" \"%i\" \"%o\"' />\n  <!-- Convert PDF to Encapsulated Poscript using Ghostscript -->\n  <delegate decode=\"pdf\" encode=\"eps\" mode=\"bi\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=epswrite \"-sOutputFile=%o\" -- \"%i\" -c quit' />\n  <!-- Convert PDF to Postcript using Ghostscript -->\n  <delegate decode=\"pdf\" encode=\"ps\" mode=\"bi\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pswrite \"-sOutputFile=%o\" -- \"%i\" -c quit' />\n  <!-- Convert PNM file to IFF ILBM format using ppmtoilbm -->\n  <delegate decode=\"pnm\" encode=\"ilbm\" mode=\"encode\" command='\"ppmtoilbm\" -24if \"%i\" > \"%o\"' />\n  <delegate decode=\"pnm\" encode=\"launch\" mode=\"encode\" command='\"gimp\" \"%i\"' />\n  <delegate decode=\"pnm\" encode=\"win\" mode=\"encode\" command='\"gm\" display -immutable \"%i\"' />\n  <delegate decode=\"ps\" encode=\"eps\" mode=\"bi\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=epswrite \"-sOutputFile=%o\" -- \"%i\" -c quit' />\n  <delegate decode=\"ps\" encode=\"pdf\" mode=\"bi\" command='\"gs\" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pdfwrite \"-sOutputFile=%o\" -- \"%i\" -c quit' />\n  <delegate decode=\"ps\" encode=\"print\" mode=\"encode\" command='\"no -c -s\" \"%i\"' />\n  <!-- Read HTML file  -->\n  <delegate decode=\"shtml\" command='\"html2ps\" -U -o \"%o\" \"%i\"' />\n  <delegate encode=\"show\" stealth=\"True\" command='\"gm\" display -immutable -delay 0 -window_group %g -title \"%l of %f\" \"%o\" &' />\n</delegatemap>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/lib/GraphicsMagick-1.3.35/config/type-ghostscript.mgk",
    "content": "<?xml version=\"1.0\"?>\n<!--\nMapping for URW Standard postscript fonts (cyrillicized)\n\nThese used to be distributed with Ghostscript.\n\nDownload from https://src.fedoraproject.org/repo/pkgs/urw-fonts/\n(https://src.fedoraproject.org/repo/pkgs/urw-fonts/urw-fonts-2.0.tar.bz2/c5cc8237e4289fc6ebeaa296174fa504/urw-fonts-2.0.tar.bz2)\n\nNetBSD's pkgsrc (http://pkgsrc.se/fonts/urw-fonts) calls these \"urw-fonts-2.0nb1\".\n-->\n<typemap>\n  <type\n    name=\"AvantGarde-Book\"\n    fullname=\"AvantGarde Book\"\n    family=\"AvantGarde\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"a010013l.afm\"\n    glyphs=\"a010013l.pfb\"\n    />\n  <type\n    name=\"AvantGarde-BookOblique\"\n    fullname=\"AvantGarde Book Oblique\"\n    family=\"AvantGarde\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"oblique\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"a010033l.afm\"\n    glyphs=\"a010033l.pfb\"\n    />\n  <type\n    name=\"AvantGarde-Demi\"\n    fullname=\"AvantGarde DemiBold\"\n    family=\"AvantGarde\"\n    foundry=\"URW\"\n    weight=\"600\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"a010015l.afm\"\n    glyphs=\"a010015l.pfb\"\n    />\n  <type\n    name=\"AvantGarde-DemiOblique\"\n    fullname=\"AvantGarde DemiOblique\"\n    family=\"AvantGarde\"\n    foundry=\"URW\"\n    weight=\"600\"\n    style=\"oblique\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"a010035l.afm\"\n    glyphs=\"a010035l.pfb\"\n    />\n  <type\n    name=\"Bookman-Demi\"\n    fullname=\"Bookman DemiBold\"\n    family=\"Bookman\"\n    foundry=\"URW\"\n    weight=\"600\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"b018015l.afm\"\n    glyphs=\"b018015l.pfb\"\n    />\n  <type\n    name=\"Bookman-DemiItalic\"\n    fullname=\"Bookman DemiBold Italic\"\n    family=\"Bookman\"\n    foundry=\"URW\"\n    weight=\"600\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"b018035l.afm\"\n    glyphs=\"b018035l.pfb\"\n    />\n  <type\n    name=\"Bookman-Light\"\n    fullname=\"Bookman Light\"\n    family=\"Bookman\"\n    foundry=\"URW\"\n    weight=\"300\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"b018012l.afm\"\n    glyphs=\"b018012l.pfb\"\n    />\n  <type\n    name=\"Bookman-LightItalic\"\n    fullname=\"Bookman Light Italic\"\n    family=\"Bookman\"\n    foundry=\"URW\"\n    weight=\"300\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"b018032l.afm\"\n    glyphs=\"b018032l.pfb\"\n    />\n  <type\n    name=\"Courier\"\n    fullname=\"Courier Regular\"\n    family=\"Courier\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n022003l.afm\"\n    glyphs=\"n022003l.pfb\"\n    />\n  <type\n    name=\"Courier-Bold\"\n    fullname=\"Courier Bold\"\n    family=\"Courier\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n022004l.afm\"\n    glyphs=\"n022004l.pfb\"\n    />\n  <type\n    name=\"Courier-Oblique\"\n    fullname=\"Courier Regular Oblique\"\n    family=\"Courier\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"oblique\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n022023l.afm\"\n    glyphs=\"n022023l.pfb\"\n    />\n  <type\n    name=\"Courier-BoldOblique\"\n    fullname=\"Courier Bold Oblique\"\n    family=\"Courier\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"oblique\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n022024l.afm\"\n    glyphs=\"n022024l.pfb\"\n    />\n  <type\n    name=\"Helvetica\"\n    fullname=\"Helvetica Regular\"\n    family=\"Helvetica\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n019003l.afm\"\n    glyphs=\"n019003l.pfb\"\n    />\n  <type\n    name=\"Helvetica-Bold\"\n    fullname=\"Helvetica Bold\"\n    family=\"Helvetica\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n019004l.afm\"\n    glyphs=\"n019004l.pfb\"\n    />\n  <type\n    name=\"Helvetica-Oblique\"\n    fullname=\"Helvetica Regular Italic\"\n    family=\"Helvetica\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n019023l.afm\"\n    glyphs=\"n019023l.pfb\"\n    />\n  <type\n    name=\"Helvetica-BoldOblique\"\n    fullname=\"Helvetica Bold Italic\"\n    family=\"Helvetica\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n019024l.afm\"\n    glyphs=\"n019024l.pfb\"\n    />\n  <type\n    name=\"Helvetica-Narrow\"\n    fullname=\"Helvetica Narrow\"\n    family=\"Helvetica Narrow\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"condensed\"\n    format=\"type1\"\n    metrics=\"n019043l.afm\"\n    glyphs=\"n019043l.pfb\"\n    />\n  <type\n    name=\"Helvetica-Narrow-Oblique\"\n    fullname=\"Helvetica Narrow Oblique\"\n    family=\"Helvetica Narrow\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"oblique\"\n    stretch=\"condensed\"\n    format=\"type1\"\n    metrics=\"n019063l.afm\"\n    glyphs=\"n019063l.pfb\"\n    />\n  <type\n    name=\"Helvetica-Narrow-Bold\"\n    fullname=\"Helvetica Narrow Bold\"\n    family=\"Helvetica Narrow\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"condensed\"\n    format=\"type1\"\n    metrics=\"n019044l.afm\"\n    glyphs=\"n019044l.pfb\"\n    />\n  <type\n    name=\"Helvetica-Narrow-BoldOblique\"\n    fullname=\"Helvetica Narrow Bold Oblique\"\n    family=\"Helvetica Narrow\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"oblique\"\n    stretch=\"condensed\"\n    format=\"type1\"\n    metrics=\"n019064l.afm\"\n    glyphs=\"n019064l.pfb\"\n    />\n  <type\n    name=\"NewCenturySchlbk-Roman\"\n    fullname=\"New Century Schoolbook\"\n    family=\"NewCenturySchlbk\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"c059013l.afm\"\n    glyphs=\"c059013l.pfb\"\n    />\n  <type\n    name=\"NewCenturySchlbk-Italic\"\n    fullname=\"New Century Schoolbook Italic\"\n    family=\"NewCenturySchlbk\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"c059033l.afm\"\n    glyphs=\"c059033l.pfb\"\n    />\n  <type\n    name=\"NewCenturySchlbk-Bold\"\n    fullname=\"New Century Schoolbook Bold\"\n    family=\"NewCenturySchlbk\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"c059016l.afm\"\n    glyphs=\"c059016l.pfb\"\n    />\n  <type\n    name=\"NewCenturySchlbk-BoldItalic\"\n    fullname=\"New Century Schoolbook Bold Italic\"\n    family=\"NewCenturySchlbk\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"c059036l.afm\"\n    glyphs=\"c059036l.pfb\"\n    />\n  <type\n    name=\"Palatino-Roman\"\n    fullname=\"Palatino Regular\"\n    family=\"Palatino\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"p052003l.afm\"\n    glyphs=\"p052003l.pfb\"\n    />\n  <type\n    name=\"Palatino-Italic\"\n    fullname=\"Palatino Italic\"\n    family=\"Palatino\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"p052023l.afm\"\n    glyphs=\"p052023l.pfb\"\n    />\n  <type\n    name=\"Palatino-Bold\"\n    fullname=\"Palatino Bold\"\n    family=\"Palatino\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"p052004l.afm\"\n    glyphs=\"p052004l.pfb\"\n    />\n  <type\n    name=\"Palatino-BoldItalic\"\n    fullname=\"Palatino Bold Italic\"\n    family=\"Palatino\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"p052024l.afm\"\n    glyphs=\"p052024l.pfb\"\n    />\n  <type\n    name=\"Times-Roman\"\n    fullname=\"Times Regular\"\n    family=\"Times\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n021003l.afm\"\n    glyphs=\"n021003l.pfb\"\n    />\n  <type\n    name=\"Times-Bold\"\n    fullname=\"Times Medium\"\n    family=\"Times\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n021004l.afm\"\n    glyphs=\"n021004l.pfb\"\n    />\n  <type\n    name=\"Times-Italic\"\n    fullname=\"Times Regular Italic\"\n    family=\"Times\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n021023l.afm\"\n    glyphs=\"n021023l.pfb\"\n    />\n  <type\n    name=\"Times-BoldItalic\"\n    fullname=\"Times Medium Italic\"\n    family=\"Times\"\n    foundry=\"URW\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"n021024l.afm\"\n    glyphs=\"n021024l.pfb\"\n    />\n  <type\n    name=\"Symbol\"\n    fullname=\"Symbol\"\n    family=\"Symbol\"\n    foundry=\"URW\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"s050000l.afm\"\n    glyphs=\"s050000l.pfb\"\n    version=\"0.1\"\n    encoding=\"AdobeCustom\"\n    />\n</typemap>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/lib/GraphicsMagick-1.3.35/config/type-solaris.mgk",
    "content": "<?xml version=\"1.0\"?>\n<typemap>\n  <type\n    name=\"Courier\"\n    fullname=\"Courier Regular\"\n    family=\"Courier\"\n    foundry=\"Adobe\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Courier.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/cour.pfa\"\n    />\n  <type\n    name=\"Courier-Bold\"\n    fullname=\"Courier Bold\"\n    family=\"Courier\"\n    foundry=\"Adobe\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Courier-Bold.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/courb.pfa\"\n    />\n  <type\n    name=\"Courier-Oblique\"\n    fullname=\"Courier Regular Oblique\"\n    family=\"Courier\"\n    foundry=\"Adobe\"\n    weight=\"400\"\n    style=\"oblique\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Courier-Oblique.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/couri.pfa\"\n    />\n  <type\n    name=\"Courier-BoldOblique\"\n    fullname=\"Courier Bold Oblique\"\n    family=\"Courier\"\n    foundry=\"Adobe\"\n    weight=\"700\"\n    style=\"oblique\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Courier-BoldOblique.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/courbi.pfa\"\n    />\n  <type\n    name=\"Helvetica\"\n    fullname=\"Helvetica Regular\"\n    family=\"Helvetica\"\n    foundry=\"Linotype\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Helvetica.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/Helvetica.pfa\"\n    />\n  <type\n    name=\"Helvetica-Bold\"\n    fullname=\"Helvetica Bold\"\n    family=\"Helvetica\"\n    foundry=\"Linotype\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Helvetica-Bold.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/Helvetica-Bold.pfa\"\n    />\n  <type\n    name=\"Helvetica-Oblique\"\n    fullname=\"Helvetica Regular Italic\"\n    family=\"Helvetica\"\n    foundry=\"Linotype\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Helvetica-Oblique.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/Helvetica-Oblique.pfa\"\n    />\n  <type\n    name=\"Helvetica-BoldOblique\"\n    fullname=\"Helvetica Bold Italic\"\n    family=\"Helvetica\"\n    foundry=\"Linotype\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Helvetica-BoldOblique.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/Helvetica-BoldOblique.pfa\"\n    />\n  <type\n    name=\"Times-Roman\"\n    fullname=\"Times Regular\"\n    family=\"Times\"\n    foundry=\"Linotype\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Times-Roman.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/Times-Roman.pfa\"\n    />\n  <type\n    name=\"Times-Bold\"\n    fullname=\"Times Medium\"\n    family=\"Times\"\n    foundry=\"Linotype\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Times-Bold.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/Times-Bold.pfa\"\n    />\n  <type\n    name=\"Times-Italic\"\n    fullname=\"Times Regular Italic\"\n    family=\"Times\"\n    foundry=\"Linotype\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Times-Italic.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/Times-Italic.pfa\"\n    />\n  <type\n    name=\"Times-BoldItalic\"\n    fullname=\"Times Medium Italic\"\n    family=\"Times\"\n    foundry=\"Linotype\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/afm/Times-BoldItalic.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/Times-BoldItalic.pfa\"\n    />\n  <type\n    name=\"Symbol\"\n    fullname=\"Symbol\"\n    family=\"Symbol\"\n    foundry=\"Adobe\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    metrics=\"/usr/openwin/lib/X11/fonts/Type1/Symbol.afm\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/Symbol.pfa\"\n    version=\"0.1\"\n    encoding=\"AdobeCustom\"\n    />\n  <type\n    name=\"Utopia-Regular\"\n    fullname=\"Utopia Regular\"\n    family=\"Utopia\"\n    foundry=\"Adobe\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/UTRG____.pfa\"\n    />\n  <type\n    name=\"Utopia-Italic\"\n    fullname=\"Utopia Italic\"\n    family=\"Utopia\"\n    foundry=\"Adobe\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/UTI_____.pfa\"\n    />\n  <type\n    name=\"Utopia-Bold\"\n    fullname=\"Utopia Bold\"\n    family=\"Utopia\"\n    foundry=\"Adobe\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    format=\"type1\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/UTB_____.pfa\"\n    />\n  <type\n    name=\"Utopia-BoldItalic\"\n    fullname=\"Utopia Bold Italic\"\n    family=\"Utopia\"\n    foundry=\"Adobe\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    format=\"type1\"\n    glyphs=\"/usr/openwin/lib/X11/fonts/Type1/UTBI____.pfa\"\n    />\n</typemap>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/lib/GraphicsMagick-1.3.35/config/type-windows.mgk",
    "content": "<?xml version=\"1.0\"?>\n<typemap>\n  <type\n    name=\"Arial\"\n    fullname=\"Arial\"\n    family=\"Arial\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"arial.ttf\"\n    />\n  <type\n    name=\"Arial-Black\"\n    fullname=\"Arial Black\"\n    family=\"Arial\"\n    weight=\"900\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"ariblk.ttf\"\n    />\n  <type\n    name=\"Arial-Bold\"\n    fullname=\"Arial Bold\"\n    family=\"Arial\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"arialbd.ttf\"\n    />\n  <type\n    name=\"Arial-Bold-Italic\"\n    fullname=\"Arial Bold Italic\"\n    family=\"Arial\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"arialbi.ttf\"\n    />\n  <type\n    name=\"Arial-Italic\"\n    fullname=\"Arial Italic\"\n    family=\"Arial\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"ariali.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow\"\n    fullname=\"Arial Narrow\"\n    family=\"Arial Narrow\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"condensed\"\n    glyphs=\"arialn.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow-Bold\"\n    fullname=\"Arial Narrow Bold\"\n    family=\"Arial Narrow\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"condensed\"\n    glyphs=\"arialnb.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow-Bold-Italic\"\n    fullname=\"Arial Narrow Bold Italic\"\n    family=\"Arial Narrow\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"condensed\"\n    glyphs=\"arialnbi.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow-Italic\"\n    fullname=\"Arial Narrow Italic\"\n    family=\"Arial Narrow\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"condensed\"\n    glyphs=\"arnari.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow-Special-G1\"\n    fullname=\"Arial Narrow Special G1\"\n    family=\"Arial Narrow Special G1\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"condensed\"\n    glyphs=\"msgeonr1.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow-Special-G1-Bold\"\n    fullname=\"Arial Narrow Special G1 Bold\"\n    family=\"Arial Narrow Special G1\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"condensed\"\n    glyphs=\"msgeonb1.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow-Special-G1-Italic\"\n    fullname=\"Arial Narrow Special G1 Italic\"\n    family=\"Arial Narrow Special G1\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"condensed\"\n    glyphs=\"msgeoni1.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow-Special-G2\"\n    fullname=\"Arial Narrow Special G2\"\n    family=\"Arial Narrow Special G2\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"condensed\"\n    glyphs=\"msgeonr2.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow-Special-G2-Bold\"\n    fullname=\"Arial Narrow Special G2 Bold\"\n    family=\"Arial Narrow Special G2\"\n    weight=\"700\"\n    style=\"Narrow\"\n    stretch=\"normal\"\n    glyphs=\"msgeonb2.ttf\"\n    />\n  <type\n    name=\"Arial-Narrow-Special-G2-Italic\"\n    fullname=\"Arial Narrow Special G2 Italic\"\n    family=\"Arial Narrow Special G2\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"condensed\"\n    glyphs=\"msgeoni2.ttf\"\n    />\n  <type\n    name=\"Arial-Rounded-MT-Bold\"\n    fullname=\"Arial Rounded MT Bold\"\n    family=\"Arial Rounded MT\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"arlrdbd.ttf\"\n    />\n  <type\n    name=\"Arial-Special-G1\"\n    fullname=\"Arial Special G1\"\n    family=\"Arial Special G1\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"msgeor1.ttf\"\n    />\n  <type\n    name=\"Arial-Special-G1-Bold\"\n    fullname=\"Arial Special G1 Bold\"\n    family=\"Arial Special G1\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"msgeoab1.ttf\"\n    />\n  <type\n    name=\"Arial-Special-G1-Bold-Italic\"\n    fullname=\"Arial Special G1 Bold Italic\"\n    family=\"Arial Special G1\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"msgeoax1.ttf\"\n    />\n  <type\n    name=\"Arial-Special-G1-Italic\"\n    fullname=\"Arial Special G1 Italic\"\n    family=\"Arial Special G1\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"msgeoai1.ttf\"\n    />\n  <type\n    name=\"Arial-Special-G2\"\n    fullname=\"Arial Special G2\"\n    family=\"Arial Special G2\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"msgeoar2.ttf\"\n    />\n  <type\n    name=\"Arial-Special-G2-Bold\"\n    fullname=\"Arial Special G2 Bold\"\n    family=\"Arial Special G2\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"msgeoab2.ttf\"\n    />\n  <type\n    name=\"Arial-Special-G2-Bold-Italic\"\n    fullname=\"Arial Special G2 Bold Italic\"\n    family=\"Arial Special G2\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"msgeoax2.ttf\"\n    />\n  <type\n    name=\"Arial-Special-G2-Italic\"\n    fullname=\"Arial Special G2 Italic\"\n    family=\"Arial Special G2\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"msgeoai2.ttf\"\n    />\n  <type\n    name=\"Bookman-Old-Style\"\n    fullname=\"Bookman Old Style\"\n    family=\"Bookman Old Style\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"bkmnos.ttf\"\n    />\n  <type\n    name=\"Bookman-Old-Style-Bold\"\n    fullname=\"Bookman Old Style Bold\"\n    family=\"Bookman Old Style\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"bookosb.ttf\"\n    />\n  <type\n    name=\"Bookman-Old-Style-Bold-Italic\"\n    fullname=\"Bookman Old Style Bold Italic\"\n    family=\"Bookman Old Style\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"bookosbi.ttf\"\n    />\n  <type\n    name=\"Bookman-Old-Style-Italic\"\n    fullname=\"Bookman Old Style Italic\"\n    family=\"Bookman Old Style\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"boookosi.ttf\"\n    />\n  <type\n    name=\"Century-Schoolbook\"\n    fullname=\"Century Schoolbook\"\n    family=\"Century Schoolbook\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"censcbk.ttf\"\n    />\n  <type\n    name=\"Century-Schoolbook-Bold\"\n    fullname=\"Century Schoolbook Bold\"\n    family=\"Century Schoolbook\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"schlbkb.ttf\"\n    />\n  <type\n    name=\"Century-Schoolbook-Bold-Italic\"\n    fullname=\"Century Schoolbook Bold Italic\"\n    family=\"Century Schoolbook\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"schlbkbi.ttf\"\n    />\n  <type\n    name=\"Century-Schoolbook-Italic\"\n    fullname=\"Century Schoolbook Italic\"\n    family=\"Century Schoolbook\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"schlbki.ttf\"\n    />\n  <type\n    name=\"Comic-Sans-MS\"\n    fullname=\"Comic Sans MS\"\n    family=\"Comic Sans MS\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"comic.ttf\"\n    />\n  <type\n    name=\"Comic-Sans-MS-Bold\"\n    fullname=\"Comic Sans MS Bold\"\n    family=\"Comic Sans MS\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"comicbd.ttf\"\n    />\n  <type\n    name=\"Courier-New\"\n    fullname=\"Courier New\"\n    family=\"Courier New\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"cour.ttf\"\n    />\n  <type\n    name=\"Courier-New-Bold\"\n    fullname=\"Courier New Bold\"\n    family=\"Courier New\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"courbd.ttf\"\n    />\n  <type\n    name=\"Courier-New-Bold-Italic\"\n    fullname=\"Courier New Bold Italic\"\n    family=\"Courier New\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"courbi.ttf\"\n    />\n  <type\n    name=\"Courier-New-Italic\"\n    fullname=\"Courier New Italic\"\n    family=\"Courier New\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"couri.ttf\"\n    />\n  <type\n    name=\"Garamond\"\n    fullname=\"Garamond\"\n    family=\"Garamond\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"gara.ttf\"\n    />\n  <type\n    name=\"Garamond-Bold\"\n    fullname=\"Garamond Bold\"\n    family=\"Garamond\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"garabd.ttf\"\n    />\n  <type\n    name=\"Garamond-Italic\"\n    fullname=\"Garamond Italic\"\n    family=\"Garamond\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"Italic\"\n    />\n  <type\n    name=\"Gill-Sans-MT-Ext-Condensed-Bold\"\n    fullname=\"Gill Sans MT Ext Condensed Bold\"\n    family=\"Gill Sans MT\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"extra-condensed\"\n    glyphs=\"glsnecb.ttf\"\n    />\n  <type\n    name=\"Impact\"\n    fullname=\"Impact\"\n    family=\"Impact\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"impact.ttf\"\n    />\n  <type\n    name=\"Lucida-Blackletter\"\n    fullname=\"Lucida Blackletter\"\n    family=\"Lucida Blackletter\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"lblack.ttf\"\n    />\n  <type\n    name=\"Lucida-Bright\"\n    fullname=\"Lucida Bright\"\n    family=\"Lucida Bright\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"lbrite.ttf\"\n    />\n  <type\n    name=\"Lucida-Bright-Demibold\"\n    fullname=\"Lucida Bright Demibold\"\n    family=\"Lucida Bright\"\n    weight=\"600\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"lbrited.ttf\"\n    />\n  <type\n    name=\"Lucida-Bright-Demibold-Italic\"\n    fullname=\"Lucida Bright Demibold Italic\"\n    family=\"Lucida Bright\"\n    weight=\"600\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"lbritedi.ttf\"\n    />\n  <type\n    name=\"Lucida-Bright-Italic\"\n    fullname=\"Lucida Bright Italic\"\n    family=\"Lucida Bright\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"lbritei.ttf\"\n    />\n  <type\n    name=\"Lucida-Caligraphy-Italic\"\n    fullname=\"Lucida Caligraphy Italic\"\n    family=\"Lucida Caligraphy\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"lcalig.ttf\"\n    />\n  <type\n    name=\"Lucida-Console,\tLucida-Console\"\n    fullname=\"Lucida Console,\tLucida Console\"\n    family=\"Regular\"\n    weight=\"400\"\n    style=\"lucon.ttf\"\n    stretch=\"normal\"\n    glyphs=\"\"\n    />\n  <type\n    name=\"Lucida-Fax-Demibold\"\n    fullname=\"Lucida Fax Demibold\"\n    family=\"Lucida Fax\"\n    weight=\"600\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"lfaxd.ttf\"\n    />\n  <type\n    name=\"Lucida-Fax-Demibold-Italic\"\n    fullname=\"Lucida Fax Demibold Italic\"\n    family=\"Lucida Fax\"\n    weight=\"600\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"lfaxdi.ttf\"\n    />\n  <type\n    name=\"Lucida-Fax-Italic\"\n    fullname=\"Lucida Fax Italic\"\n    family=\"Lucida Fax\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"lfaxi.ttf\"\n    />\n  <type\n    name=\"Lucida-Fax-Regular\"\n    fullname=\"Lucida Fax Regular\"\n    family=\"Lucida Fax\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"lfax.ttf\"\n    />\n  <type\n    name=\"Lucida-Handwriting-Italic\"\n    fullname=\"Lucida Handwriting Italic\"\n    family=\"Lucida Handwriting\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"lhandw.ttf\"\n    />\n  <type\n    name=\"Lucida-Sans-Demibold-Italic\"\n    fullname=\"Lucida Sans Demibold Italic\"\n    family=\"Lucida Sans\"\n    weight=\"600\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"lsansdi.ttf\"\n    />\n  <type\n    name=\"Lucida-Sans-Demibold-Roman\"\n    fullname=\"Lucida Sans Demibold Roman\"\n    family=\"Lucida Sans Demibold\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"lsansd.ttf\"\n    />\n  <type\n    name=\"Lucida-Sans-Regular\"\n    fullname=\"Lucida Sans Regular\"\n    family=\"Lucida Sans\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"lsans.ttf\"\n    />\n  <type\n    name=\"Lucida-Sans-Typewriter-Bold\"\n    fullname=\"Lucida Sans Typewriter Bold\"\n    family=\"Lucida Sans Typewriter\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"ltypeb.ttf\"\n    />\n  <type\n    name=\"Lucida-Sans-Typewriter-Bold-Oblique\"\n    fullname=\"Lucida Sans Typewriter Bold Oblique\"\n    family=\"Lucida Sans Typewriter\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"ltypebo.ttf\"\n    />\n  <type\n    name=\"Lucida-Sans-Typewriter-Oblique\"\n    fullname=\"Lucida Sans Typewriter Oblique\"\n    family=\"Lucida Sans Typewriter\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"ltypeo.ttf\"\n    />\n  <type\n    name=\"Lucida-Sans-Typewriter-Regular\"\n    fullname=\"Lucida Sans Typewriter Regular\"\n    family=\"Lucida Sans Typewriter\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"ltype.ttf\"\n    />\n  <type\n    name=\"MS-Sans-Serif\"\n    fullname=\"MS Sans Serif\"\n    family=\"MS Sans Serif\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"sseriff.ttf\"\n    />\n  <type\n    name=\"MS-Serif\"\n    fullname=\"MS Serif\"\n    family=\"MS Serif\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"seriff.ttf\"\n    />\n  <type\n    name=\"Modern\"\n    fullname=\"Modern\"\n    family=\"Modern\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"modern.ttf\"\n    />\n  <type\n    name=\"Monotype-Corsiva\"\n    fullname=\"Monotype Corsiva\"\n    family=\"Monotype Corsiva\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"mtcorsva.ttf\"\n    />\n  <type\n    name=\"Small-Fonts\"\n    fullname=\"Small Fonts\"\n    family=\"Small Fonts\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"smallf.ttf\"\n    />\n  <type\n    name=\"Symbol\"\n    fullname=\"Symbol\"\n    family=\"Symbol\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"symbol.ttf\"\n    encoding=\"AppleRoman\"\n    />\n  <type\n    name=\"Tahoma\"\n    fullname=\"Tahoma\"\n    family=\"Tahoma\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"tahoma.ttf\"\n    />\n  <type\n    name=\"Tahoma-Bold\"\n    fullname=\"Tahoma Bold\"\n    family=\"Tahoma\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"tahomabd.ttf\"\n    />\n  <type\n    name=\"Times-New-Roman\"\n    fullname=\"Times New Roman\"\n    family=\"Times New Roman\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"times.ttf\"\n    />\n  <type\n    name=\"Times-New-Roman-Bold\"\n    fullname=\"Times New Roman Bold\"\n    family=\"Times New Roman\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"timesbd.ttf\"\n    />\n  <type\n    name=\"Times-New-Roman-Bold-Italic\"\n    fullname=\"Times New Roman Bold Italic\"\n    family=\"Times New Roman\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"timesbi.ttf\"\n    />\n  <type\n    name=\"Times-New-Roman-Italic\"\n    fullname=\"Times New Roman Italic\"\n    family=\"Times New Roman\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"timesi.ttf\"\n    />\n  <type\n    name=\"Times-New-Roman-MT-Extra-Bold\"\n    fullname=\"Times New Roman MT Extra Bold\"\n    family=\"Times New Roman MT\"\n    weight=\"800\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"timnreb.ttf\"\n    />\n  <type\n    name=\"Verdana\"\n    fullname=\"Verdana\"\n    family=\"Verdana\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"verdana.ttf\"\n    />\n  <type\n    name=\"Verdana-Bold\"\n    fullname=\"Verdana Bold\"\n    family=\"Verdana\"\n    weight=\"700\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"verdanab.ttf\"\n    />\n  <type\n    name=\"Verdana-Bold-Italic\"\n    fullname=\"Verdana Bold Italic\"\n    family=\"Verdana\"\n    weight=\"700\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"verdanaz.ttf\"\n    />\n  <type\n    name=\"Verdana-Italic\"\n    fullname=\"Verdana Italic\"\n    family=\"Verdana\"\n    weight=\"400\"\n    style=\"italic\"\n    stretch=\"normal\"\n    glyphs=\"verdanai.ttf\"\n    />\n  <type\n    name=\"Wingdings\"\n    fullname=\"Wingdings\"\n    family=\"Wingdings\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"wingding.ttf\"\n    encoding=\"AppleRoman\"\n    />\n  <type\n    name=\"Wingdings-2\"\n    fullname=\"Wingdings 2\"\n    family=\"Wingdings 2\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"wingdng2.ttf\"\n    encoding=\"AppleRoman\"\n    />\n  <type\n    name=\"Wingdings-3\"\n    fullname=\"Wingdings 3\"\n    family=\"Wingdings 3\"\n    weight=\"400\"\n    style=\"normal\"\n    stretch=\"normal\"\n    glyphs=\"wingdng3.ttf\"\n    encoding=\"AppleRoman\"\n    />\n</typemap>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/lib/GraphicsMagick-1.3.35/config/type.mgk",
    "content": "<?xml version=\"1.0\"?>\n<typemap>\n  \n</typemap>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/lib/pkgconfig/GraphicsMagick++.pc",
    "content": "prefix=/root/pinwoodxu/GraphicsMagick-source/release\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include/GraphicsMagick\n\n\nName: GraphicsMagick++\nVersion: 1.3.35\nDescription: C++ API for GraphicsMagick image processing library\nRequires: GraphicsMagick\nLibs: -lGraphicsMagick++\nCflags: \n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/lib/pkgconfig/GraphicsMagick.pc",
    "content": "prefix=/root/pinwoodxu/GraphicsMagick-source/release\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include/GraphicsMagick\n\n\nName: GraphicsMagick\nVersion: 1.3.35\nDescription: GraphicsMagick image processing library\nLibs: -L${libdir} -lGraphicsMagick\nCflags: -I${includedir} \n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/lib/pkgconfig/GraphicsMagickWand.pc",
    "content": "prefix=/root/pinwoodxu/GraphicsMagick-source/release\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include/GraphicsMagick\n\n\nName: GraphicsMagickWand\nVersion: 1.3.35\nDescription: GraphicsMagick Wand image processing library\nRequires: GraphicsMagick\nLibs: -lGraphicsMagickWand\nCflags:\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/GraphicsMagick-1.3.35/config/colors.mgk",
    "content": "<?xml version=\"1.0\"?>\n<!--\nColor definition file.  Definitions in this file extend or replace the\ncompiled in color definitions.  Use 'gm convert -list color' to list\nthe currently available colors.  This file is optional and the\nsoftware will still function if it is removed.\n\nFor example:\n\n<colormap>\n  <color name=\"mycolor1\" red=\"228\" green=\"118\" blue=\"33\" compliance=\"None\" />\n  <color name=\"mycolor2\" red=\"228\" green=\"123\" blue=\"66\" compliance=\"X11\" />\n</colormap>\n-->\n<colormap>\n</colormap>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/GraphicsMagick-1.3.35/config/log.mgk",
    "content": "<?xml version=\"1.0\"?>\n<!--\n\n                 GraphicsMagick Logging Configuration File\n\nThe following options are available:\n\n  o events [comma separated list]\n      annotate       Text annotation events.\n      blob           File opening/closing/loading events.\n      cache          Pixel cache events.\n      coder          File format coder events.\n      configure      Configuration events (searching for .mgk files, etc.).\n      deprecate      Identify use of deprecated functions.\n      error          Error exception report events.\n      exception      Exception report events (warning and error).\n      locale         Locale events.\n      none           Reporting disabled.\n      render         Rendering (drawing) events.\n      resource       Resource allocation events (memory, disk, etc.)\n      temporaryFile  Temporary file events (allocate, deallocate, etc.)\n      transform      Image processing events.\n      user           User events (not emitted by GraphicsMagick).\n      warning        Warning exception report events.\n      X11            X11 server events.\n\n  o output\n      none           Reporting disabled.\n      disabled       Reporting disabled.\n      stdout         Log to stdout in \"human readable\" format\n      stderr         Log to stderr in \"human readable\" format\n      xmlfile        Log to a file in an XML format\n      txtfile        Log to a file in a text format\n      win32debug     Windows, Output events to the application/system debugger.\n      win32eventlog  Windows, Output events to the Application event log.\n\n  o Filename - Use specified filename if output to a file is selected.\n    Place a %d in the file name in order to support multiple log generations.\n\n  o Generations - Number of log files to maintain before circulating back to\n      the first name.\n\n  o Limit - Maximum number of logging events before creating a new log file.\n\n  o Format - Format of logging output\n\n      You can display the following components by embedding\n      special format characters:\n\n        %d   domain\n        %e   event\n        %f   function\n        %l   line\n        %m   module\n        %p   process ID\n        %r   real CPU time\n        %t   wall clock time\n        %u   user CPU time\n        %%   percent sign\n        \\n   newline\n        \\r   carriage return\n\n -->\n<magicklog>\n  <log events=\"None\" />\n  <log output=\"stderr\" />\n  <log filename=\"Magick-%d.log\" />\n  <log generations=\"3\" />\n  <log limit=\"2000\" />\n  <log format=\"%t %r %u %p %m/%f/%l/%d:\\n  %e\"  />\n</magicklog>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/GraphicsMagick-1.3.35/config/modules.mgk",
    "content": "<?xml version=\"1.0\"?>\n<!--\n  Magick Module Alias Map (modules.mgk)\n\n  Provides a mapping from a magick format identifier string to the\n  name of the loadable module which supports it.  This allows a module\n  to support formats other than its own name.  This file is optional\n  and the software will still function if it is removed.\n\n  Entries are of the form:\n\n  <module magick=\"MYMAGICK\" name=\"MYMODULE\" />\n\n-->\n<modulemap>\n\n</modulemap>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog",
    "content": "2020-02-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Updates in preparation for the 1.3.35 release.\n\tMerge changes for 1.3.35 into GraphicsMagick-1_3 branch.\n\n\t* www/INSTALL-windows.rst: Update Windows installation and build\n\tdocumentation.\n\n2020-02-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update with News since previous release.\n\n\t* magick/magick.c (InitializeMagickSignalHandlers): This private\n\timplementation function is now a static function as it should have\n\tbeen.\n\t(InitializeMagickEx): New function which may be used in place of\n\tInitializeMagick() to initialize GraphicsMagick.  This\n\tinitialization function returns an error status value, may update\n\ta passed ExceptionInfo structure with error information, and\n\tprovides an options parameter which supports simple bit-flags to\n\ttailor initialization.  The signal handler registrations are\n\tskipped if the MAGICK_OPT_NO_SIGNAL_HANDER flag is set in the\n\toptions.\n\n2020-02-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (MagickToMime): Add a MIME translation for\n\t\"jpg\".  Issue reported by Pro Turm.\n\n2020-02-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/INSTALL-windows.rst: Add quoting to avoid losing backslashes\n\tin Windows paths.\n\n2020-02-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/common.h: Add missing unsupported handling for some\n\trecently added GCC/Clang attributes.\n\n\t* magick/: Move all remaining private implementation code in\n\tpublic headers which is guarded by MAGICK_IMPLEMENTATION into\n\tprivate headers, which are never installed.\n\n2020-02-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Evidence suggests that large\n\tstrip sizes improve performance by reducing the number of I/Os.\n\tThe defaults suggested by libtiff are way to small for today's\n\timages and computers.  Default TIFF strip sizes so that each\n\tuncompressed strip consumes up to 1MiB of memory, or 4MiB for FAX\n\toriented codecs, or based on LZMA compression level when using\n\tLZMA compression.  The default size may be adjusted via the\n\tTIFF_BYTES_PER_STRIP preprocessor definition.\n\n2020-02-09  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c ZeroFillMissing data will never been triggered when\n\ty>=image->rows.\n\n2020-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Limit pattern dimensions by\n\tLONG_MAX rather than ULONG_MAX since this seems more likely to\n\tavoid arithmetic overflows later on.\n\n2020-02-09  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Check for exception in image.\n\n2020-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (VersionCommand): Add Google perftools tcmalloc\n\tto the available feature support.\n\n\t* www/INSTALL-unix.rst: Include some information about building\n\twith MSYS2.\n\n\t* coders/png.c (ReadOnePNGImage): Eliminate compilation warnings\n\tabout signed/unsigned comparisons.\n\n\t* magick/image.c: Remove private global string constants, and one\n\tprivate global unsigned long constant, from the library ABI.\n\tSince the global constants were declared via a private header and\n\tonly used within the GraphicsMagick build, removing these does not\n\timpact the public ABI.  The globals removed are BackgroundColor,\n\tBorderColor, DefaultTileFrame, DefaultTileGeometry,\n\tDefaultTileLabel, ForegroundColor, HighlightColor, MatteColor,\n\tPSDensityGeometry, PSPageGeometry, and DefaultCompressionQuality.\n\n2020-02-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Apply draconian pattern\n\tspecification offset and dimension validations.  Hopefully there\n\tis no impact to usability.  If so please report it as a bug.\n\tFixes oss-fuzz 20586 \"graphicsmagick:coder_MVG_fuzzer:\n\tInteger-overflow in DrawPolygonPrimitive\".\n\n\t* coders/svg.c (ReadSVGImage): Fix dereference of NULL pointer\n\twhen stopping image timer.\n\n2020-02-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (DecodeImage): Allocate extra scanline memory to\n\tallow small RLE overrun.  Fixes oss-fuzz 20271\n\t\"graphicsmagick:coder_PICT_fuzzer: Heap-buffer-overflow in\n\tExpandBuffer\" and 20272 \"graphicsmagick:coder_PICT_fuzzer:\n\tHeap-buffer-overflow in DecodeImage\".\n\n\t* PerlMagick/t/wmf/read.t: Update WMF reference images.  Relax\n\ttest requirements for ski.wmf.\n\n\t* locale/C.mgk: Correct error message associated with\n\t\"UnsupportedNumberOfRows\".  Patch was submitted by Thorsten\n\tAlteholz via private email on 2020-02-05.\n\n2020-02-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/topol.c: Include magick/magick_endian.h.\n\n2020-02-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick, coders, wand: Added copious casts to avoid possible\n\tinteger overflows in the Microsoft Windows 64-bit build, where\n\tsizeof(long) < sizeof(size_t).\n\n2020-01-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.h (\"PrimitiveInfo\"): Change PrimitiveInfo\n\tcoordinates from type 'unsigned long' to 'size_t'.\n\n2020-01-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gradient.c (GradientImage): Warnings reduction, plus note\n\tabout incorrect diagonal gradients math.\n\n2020-01-20  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* VisualMagick\\configure\\configure.cpp Option /arch:SSE2 is\n\tavailable only for 32 bit build.\n\n2020-01-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcd.c (DecodeImage): Assure that pcd_length gets\n\tinitialized with something.\n\n\t* Magick++/lib/Options.cpp (strokeDashArray): Add needless check\n\tfor _drawInfo->dash_pattern null in order to make static analysis\n\thappy.\n\n\t* magick/render.c (DestroyPolygonInfo): Make sure to not\n\tdereference a null edges pointer.\n\n\t* coders/pdb.c (WritePDBImage): Make sure that null comment value\n\tis not dereferenced.\n\n\t* coders/vid.c (ReadVIDImage): Make sure that\n\tThrowVIDReaderException does not dereference a null pointer.\n\n\t* magick/quantize.c (ClassifyImageColors): Fix error handling so a\n\tnull pointer won't be consumed after a memory allocation failure.\n\tChanged the location of some variable declarations and added some\n\tcomments.\n\n2020-01-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/caption.c (ReadCAPTIONImage): Assure that metrics are\n\tinitialized.\n\n\t* magick/pixel_cache.c (DestroyThreadViewSet): Check if views\n\tpointer is not null before destroying views.\n\n\t* coders/xpm.c (ReadXPMImage): Properly detect the case where the\n\tXPM colormap is not fully initialized.\n\n\t* coders/pict.c (DecodeImage): Fix heap buffer over-reads. Fixes\n\toss-fuzz issue 20053 \"graphicsmagick:coder_PICT_fuzzer:\n\tHeap-buffer-overflow in ExpandBuffer\" and oss-fuzz issue 20048\n\t\"graphicsmagick:coder_PICT_fuzzer: Heap-buffer-overflow in\n\tDecodeImage\".  Both of these oss-fuzz issues appeared due to\n\trecent changes since the last release.\n\n\t* coders/meta.c (WriteMETAImage): Assure that 'iptc_offset' is\n\tinitialized and valid.\n\n\t* coders/jpeg.c (ReadJPEGImage): Assure that evaluating the\n\tembedded profile length does not suffer from undefined behavior.\n\n2020-01-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Add more MVG parser validations.\n\n2020-01-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/histogram.c (WriteHISTOGRAMImage): Histogram coder was\n\trelying on the previously removed '@' file inclusion feature to\n\tinsert the histogram comment text.  Write a PseudoClass MIFF image\n\twith RLE compression.  Fixes SourceForge issue #622 \"Histogram\n\tproduces incorrect color table attribute \".\n\n\t* magick/pixel_cache.c (ModifyCache): Re-open the pixel cache if\n\tthe cache rows/columns do not match the owning image rows/columns.\n\n\t* magick/transform.c (TransformImage): TransformImage now returns\n\ta MagickPassFail return status value rather than void.\n\n\t* coders/pict.c (ReadPICTImage): Fix some over-strict validations\n\twhich were preventing some PICT files which were previously read\n\tsuccessfully from being accepted. Fix problems which occurred when\n\tthe clipping rectangle changed the image size. Improve reading\n\tembedded JPEG blobs.  Now successfully reads all raster PICT files\n\tI have available.\n\n2020-01-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (ReadPICTImage): Be more strict about PICT\n\trectangle by treating rectangle dimensions as if they are a 16-bit\n\tsigned type and not allowing negative values.  Avoid GCC warnings\n\twhich sprung up similar to \"warning: comparison is always false\n\tdue to limited range of data type\".\n\n2020-01-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sfw.c (ReadSFWImage): Restore a DestroyImage() statement\n\twhich was accidentally deleted by recent edits.  Fixes oss-fuzz\n\t\"Issue 19819 in oss-fuzz: graphicsmagick:coder_SFW_fuzzer:\n\tIndirect-leak in AllocateImage\".\n\n\t* coders/png.c (WriteOneJNGImage): Detect when JPEG encoder has\n\tfailed, and throw exception.  Fix image dimension limit\n\tvalidations.  Stop discarding exception report.  Fixes SourceForge\n\tbug #621 \"Assertion in WriteBlob at magick/blob.c:4937\" which was\n\treported by Suhwan Song.\n\n\t* coders/pict.c (WritePICTImage): Eliminating small buffer overrun\n\twhen run-length encoding pixels.  Fixes SourceForge bug #620\n\t\"heap-buffer-overflow in EncodeImage at coders/pict.c:1114\" which\n\twas reported by Suhwan Song.\n\n\t* coders/logo.c (ReadLOGOImage): PATTERN error handling was\n\tincomplete.  Add appropriate error handling.\n\t(ReadLOGOImage): Switch to using ConstituteTextureImage() rather\n\tthan TextureImage() since it is more appropriate for this purpose.\n\t(ReadLOGOImage): Oops!  Accidental change of behavior. When size\n\tis not supplied, simply return the pattern image.\n\n2020-01-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/*.c (ReadFOOImage): Stop image timer just before\n\treturning from reader so that reported timings are correct when\n\tused in the future.\n\n2020-01-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/timer.c (StartTimer): Expose previously existing\n\tStartTimer() function.\n\t(StopTimer): Expose previously existing StartTimer() function.\n\n\t* magick/constitute.c (WriteImage): Don't over-write time-stamp\n\twhen output is to INFO format.\n\n2020-01-03  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* VisualMagick\\configure\\configure.exe: Should not depend on mfcr90.dll.\n\tIt is too bad when end user cannot run this tool because of missing DLL.\n\n\t* VisualMagick\\configure\\configure.cpp Make speed optimisation as default\n\toption.\n\n\t* VisualMagick\\configure\\configure.vcproj Give different filename to debug\n\tbuild to avoid accidental committing debug build to repository.\n\n2020-01-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (GenerateDPXTimeStamp): Use reentrant localtime_r()\n\tfunction if it is available.\n\n\t* magick/log.c (LogMagickEventList): Use reentrant\n\tlocaltime_r() function if it is available.\n\n\t* coders/cineon.c (GenerateCineonTimeStamp): Use reentrant\n\tlocaltime_r() function if it is available.\n\n\t* coders/mat.c (WriteMATLABImage): Use reentrant localtime_r()\n\tfunction if it is available.\n\n\t* coders/pdf.c (WritePDFImage): Use reentrant localtime_r()\n\tfunction if it is available.\n\n\t* coders/ps.c (WritePSImage): Use reentrant ctime_r() function\n\tif it is available.\n\n\t* coders/ps2.c (WritePS2Image): Use reentrant ctime_r() function\n\tif it is available.\n\n\t* coders/ps3.c (WritePS3Image): Use reentrant ctime_r() function\n\tif it is available.\n\n\t* configure.ac: Test for getpwnam_r().\n\n\t* magick/utility.c (ExpandFilename): Use reentrant getpwnam_r()\n\tfunction if it is available.\n\n\t* magick/magick.c (InitializeMagickSignalHandlers): Use the normal\n\ttermination signal handler for SIGXCPU and SIGXFSZ so that ulimit\n\tor setrlimit(2) may be used to apply CPU (RLIMIT_CPU) and output\n\tfile size (RLIMIT_FSIZE) limits with the normal cleanup, and\n\twithout dumping core.  Note that any output files currently being\n\twritten may be truncated and files being written by external\n\tprograms (e.g. Ghostscript) might be left behind unless they are\n\tto a temporary file assigned by GraphicsMagick.\n\n\t* coders/xpm.c (ReadXPMImage): Promote a color-lookup\n\twarning to an error.\n\n\t* coders/xc.c (ReadXCImage): Promote a color-lookup\n\twarning to an error.\n\n\t* coders/null.c (ReadNULLImage): Promote a color-lookup\n\twarning to an error.\n\n\t* Makefile.am: Rotate ChangeLogs for the new year.\n\n\t* coders/gradient.c (ReadGRADIENTImage): Promote a color-lookup\n\twarning to an error.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2001",
    "content": "2001-12-28  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Even more features and options were added to conjure\n\t* Added CropBox support to PDF writer\n\n2001-12-26  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Conjure now supports having a list of files for the script to\n\tprocess being passed on the command line.\n\t* More features and options were added to conjure\n\n2001-12-25  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Made a huge number of improvements to conjure.  It now supports\n\tover 15 different commands for manipulating your images.\n\n2001-12-24  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Started a new scripting language utility, conjure.\n\n2001-12-20  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Display the search path in the event a utility cannot find a\n\tparticular configuration file (thanks to billr@corbis.com)\n\n2001-12-14  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Fixed some bugs in the new composite operators.\n\n2001-12-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added native BLOB support to coders/wmf.c.\n\n2001-12-13  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Added new composite operators to support PSD/XCF\n\tlayer compositing:  NoCompositeOp, DarkenCompositeOp,\n\tLightenCompositeOp, HueCompositeOp, SaturateCompositeOp,\n\tValueCompositeOp, ColorizeCompositeOp, LuminizeCompositeOp,\n\tScreenCompositeOp, OverlayCompositeOp.\n\t* Modified the PSD coder to set the appropriate composite\n\toperator.\n\t* Modified the XCF coder to set the appropriate composite\n\toperator.\n\n2001-12-10  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Removed the flatten option from ImageInfo.\n\t* Added new compose member to ImageInfo that defines which of\n\tthe composite operators to use when flattening an image.\n\n2001-12-09  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Added new member to ImageInfo, flatten, used by PSD and XCF\n\tto determine whether to flatten an image when read.\n\t* PSD and XCF now respect image_info->flatten.\n\t* Fixed bug in XCF loader when loading layered image as layers.\n\t* Modified the convert program to set image_info->flatten if\n\t-flatten is specified; we still call FlattenImages for other\n\tformats that don't respect image_info->flatten.\n\t* Modified Magick++'s Image class to support image_info->flatten.\n\n2001-12-08  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Improvements to the Photoshop (PSD) coder:  1) added support\n\tfor Duotone images loaded as grayscale as per PSD docs;  and 2)\n\tadded option to composite layers when reading respects layer\n\tvisibility setting.\n\n2001-12-07  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* -dissolve wasn't working for the composite program (thanks to\n\tRick Manbry).\n\t* DCM coder failed to read a valid DCM image file.\n\n2001-12-06  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Stream buffer was not being freed in ReadStream().\n\n2001-12-05  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Corrected bias when downsizing an image with ResizeImage().\n\n2001-11-25  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* AcquireImagePixels() can accept (x,y) outside the image area\n\t(e.g. AcquireImagePixels(image,-3,-3,7,7,exception)).\n\n2001-11-22  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added limited SVG gradient support.\n\n2001-11-21  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added API method, PingBlob().\n\n2001-11-14  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Moved a few pixel related defines (e.g. Downscale()) to\n\ta corresponding method to enforce strong type checking at\n\tcompile time.\n\n2001-11-12  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Previously ImageMagick did not write 8-bit ASCII PPM/PGM files\n\twhen QuantumDepth == 16.\n\t* Added 'id' as an image attribute in PerlMagick (returns\n\tImageMagick registry ID).\n\n2001-11-10  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added SVG pattern support.\n\t* Changed default background color to none.\n\n2001-11-06  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added support of reading and writing 16-bit raw PPM/PGM files.\n\n2001-11-05  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added -level to convert/mogrify (suggested by\n\tmericson@phillynews.kom).\n\n2001-11-04  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* -shadow/-shade were not distiguished.\n\n2001-11-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Makefile.PL.in: Install PerlMagick using\n\tImageMagick's configure prefix.\n\n2001-11-02  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Typecast offset to unsigned long in coders/pdf.c.\n\n2001-11-01  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Convert's -flatten, -average, etc. failed with an assert error.\n\n2001-10-30  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added support for On-the-air bitmap.\n\n2001-09-29  Glenn  <randeg@alum.rpi.edu>\n\n\t* When the delay setting for an image is greater than 4cs, duplicate\n\tframes are inserted to achieve the desired delay while creating MPEG\n\tfiles (contributed by Lawrence Livermore National Laboratory (LLNL)).\n\n2001-10-29  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageMagick now has a registry for storing image blobs.\n\n2001-10-26  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added VMS patches (thanks to Jouk Jansen).\n\n2001-10-25 Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Fixed parsing bug for decorate #FFFFFF.\n\n2001-10-22 Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added tests for mpeg2 library to configure.\n\n2001-10-22  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added a MPEG coder module.\n\t* Added ImageType member to the image_info structure (suggested\n\tby Glenn)\n\n2001-10-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Eliminated libMagick.so dependency on libxml by not listing -lxml\n\twhen doing modules link.\n\n2001-10-18  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Eliminated the libMagick.so dependancy on libtiff by moving\n\tHuffman2DEncodeImage() from magick/compress.c to coders/pdf.c,\n\tcoders/ps2.c and coders/ps3.c (suggested by Bob Friesenhahn).\n\tThis change has the side-effect of elminating dependency on libpng\n\tand libjpeg as well (which libtiff may depend on).\n\n2001-10-16  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Convert now supports -channel {Cyan,Magenta,Yellow,Black}.\n\n2001-10-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c updated for libwmf 0.2.  Plenty of bugs remain within.\n\n2001-10-11  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* QueryFontMetrics() of PerlMagick now recognizes embedded\n\tspecial characters (e.g. %h).\n\n2001-10-10  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Fixed seg-fault for PingImage() on a JP2 image file.\n\n2001-10-07  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* CloneImage() now uses a referenced counted pixel cache.\n\n2001-10-05  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added AcquireImagePixels() method.\n\t* Changed the formal parameter from Image * to const Image *\n\tfor a number of methods (e.g. ZoomImage()).\n\t* Added ExceptionInfo parameter to DispatchImage().\n\n2001-10-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Find libxml headers under Debian Linux (bug ID 921).\n\n2001-10-02  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Fixed assertion error on drawing stroked text.\n\n2001-10-01  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added blob test to the PerlMagick test suite.\n\n2001-09-30  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* switched strcpy to strncpy to help protect against buffer\n\toverflow.\n\n\t* ltdl.c passed int reference but a long was needed; caused a\n\tfault on Solaris 64-bit compiles.\n\n2001-09-25  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Removed most lint complaints from the source.\n\t* strtod() returns different results on Linux and Solaris for 0x13.\n\t* Added a MATLAB encoder contributed by Jaroslav Fojtik.\n\n2001-09-21  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Replaced TemporaryFilename() with UniqueImageFilename().\n\t* ImageMagick CORE API is now 64-bit clean.\n\n2001-09-20  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Fixed svg.c to accept a viewbox with a negative offset.\n\n2001-09-15  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Surveying the code for 64-bit compatibility.\n\t* The cloned colormap was too small (reported by Glenn).\n\t* A blob was being unmapped more than once for multi-frame images.\n\n2001-09-12  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Text drawing now handles UTF8-encoding.\n\t* Off-by-one GetImagePixels() fix in draw.c\n\t* PingImage() now reports attributes for all images in an image\n\tsequence.\n\n2001-09-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h: Rename QuantumLeap define to QuantumDepth.\n\tQuantumDepth is set to the values 8 or 16, depending on user\n\tconfiguration option.\n\n2001-09-09  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Updated PerlMagick signatures to reflect new message digest\n\talgorithm.\n\n2001-09-08  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageMagick defaults to 16-bit quantum.  Set QuantumMagick\n\tfor 8-bit.\n\t* Changed image->blob from BlobInfo to BlobInfo* so the Image\n\tstructure size is not dependent on the large-file preprocessor\n\tdefines.\n\n2001-09-07  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added -background to convert program usage text.\n\t* DispatchImage() now properly handles grayscale images.\n\n2001-09-01  Glenn  <randeg@alum.rpi.edu>\n\n\t* The compression quality setting is now recognized when creating\n\tMPEG images (contributed by Lawrence Livermore National Laboratory\n\t(LLNL)).\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2002",
    "content": "2002-12-31  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* magick/command.c: Do not quantize CMYK (bug fix).\n\n\t* magick/render.c: Ensure that stroke is not drawn wider than\n\trequested when antialiasing is disabled (bug fix).\n\n2002-12-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c: For TransformRGBImage() and RGBTransformImage()\n\tround values to int when creating tables rather than using scaling\n\tto avoid rounding.\n\n2002-12-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c: Fixed compile problems.\n\n\t* magick/image.c: SyncImage() performance optimizations.\n\n\t* TransformRGBImage() cleanup/enhancements. Some rounding issues\n\tremain.\n\n\t* RGBTransformImage() cleanup/enhancements. Some rounding issues\n\tremain.\n\n2002-12-24  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* BUGFIX: Fixed bug, introduced on 12/18/02, in which a misplaced\n\t\"}\" caused an assertion failure after reading any opaque JNG\n\timage.\n\n\t* Added CloseBlob before returning a NULL JNG image.\n\n\t* Merged png.c with IM-5.5.3-1, including a seemingly pointless\n\trename of SaveImageText string to SaveImageTag.\n\n2002-12-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c: Optimized gray x, y, z, tables creation in\n\tRGBTransformImage().\n\n2002-12-27  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* coders/pcd.c: IsPCDImage() fix offset to test header magic.\n\n\t* coders/pcd.c: Ensure that blob is closed on error.\n\n\t* coders (all): Pass image->colorspace to TransformRGBImage()\n\n\t* magick (animate.c, command.c, display.c, image.c, nt_feature.c)\n\tPass image->colorspace to TransformRGBImage().\n\n\t* magick/nt_feature.c: Ensure that image is RGB prior to transfer\n\tto HBITMAP.\n\n2002-12-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c: Re-worked TransformRGBImage() again so that it\n\tis now smoking fast for Q:8 and Q:16. Changed lookup tables, and\n\tall per-pixel transforms to use only integer arithmetic. A\n\tpre-multiplication scheme is used which should actually improve\n\tthe quantization error over using double arithmetic.  It is\n\tactually possible to improve Q:32 performance a bit more but is it\n\tworth the effort?\n\n2002-12-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c: Implemented logging for TransformRGBImage() and\n\tRGBTransformImage().\n\n2002-12-24  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* The png codec would close the blob twice (second time raising an\n\tassertion) if a libpng error was encountered.\n\n\t* Sometimes the PNG writer would receive an invalid bit depth from\n\tCompositeImages(); this is now ignored.\n\n2002-12-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c: Re-wrote TransformRGBImage() so that it does not\n\tpenalize a Q:8 build.  The function should be faster now, but no\n\ttimings have been made to verify that.\n\n2002-12-21  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Elimimated unused transparent_pixel array in png.c.\n\n\t* Reverted to incrementing loops in bmp.c where the counter \"i\" is\n\tused in the loop.\n\n2002-12-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Update MogrifyImage() so that gm is 9X faster\n\twhen transforming a color image to grayscale.\n\n2002-12-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Updated coders to use VerifyColormapIndex macro rather than slow\n\tConstrainColormapIndex() function.\n\n\t* magick/constitute.c: Trial use of VerifyColormapIndex in\n\tPushImagePixels() IndexQuantum case.\n\n2002-12-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/color.c: Added VerifyColormapIndex macro to verify range\n\tof color index without a function call.\n\n\t* coders/bmp.c: Updated to use VerifyColormapIndex macro.\n\n2002-12-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c: Sped up RLE expansion and sped up byte-size\n\tPseudoColor scanline conversion.  Results in 50% speed-up when\n\trunning on SPARC.\n\n2002-12-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities: Removed legacy ImageMagick utilities which have been\n\trolled up into gm.c/command.c.\n\n2002-12-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: Fixed FormatString() format problems\n\tidentified by the compiler.\n\n2002-12-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h: Moved function prototypes for functions\n\timplemented in code modules other than image.c to seperate header\n\tfiles with names based on the implementation files.\n\n2002-12-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/enhance.c: Report appropriate message while leveling\n\timage.\n\n2002-12-18  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Sync png.c and fx.c with IM-5.5.3.  \"gm convert -list format\"\n\tnow includes zlib version info among the PNG info.\n\n\t* ConvolveImage() logs kernel info as a \"Transform\" debug event.\n\n\t* ReadJNGImage() now skips decoding JPEG subimage when \"pinging\" \n\n2002-12-17  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* SVG element `stroke-dasharray: 0` no longer causes a\n\tsegmentation fault.\n\n2002-12-17  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* CoaleseceImage() properly handles a dispose method of\n\tBackgroundDispose.\n\n2002-12-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Updated to substitute for @GMDelegate@.\n\n\t* magick/effect.c: Changed AdaptiveThresholdImage offset to double\n\tso that it works with QuantumDepth=32. Thanks to Glenn for\n\tpointing out this problem.\n\n\t* magick/image.c: Adapted to AdaptiveThresholdImage API change.\n\n\t* magick/image.h: Annotated global constants and functions with\n\tthe name of the source file where they are implemented.  This is\n\tin preparation to break up image.h into multiple header files to\n\tdiminish unnecessary header dependencies.\n\n\t* coders/delegates.mgk.in: Updated to use @GMDelegate@ definition\n\tand `gm` program rather than ImageMagick utility names.\n\n\t* PerlMagick/t/read.t: Converted gradient test (which was not\n\tworking at all) to compare with a reference image.\n\n\t* PerlMagick/t/jpeg/read.t: Re-wrote to compare with reference\n\timage.\n\n\t* PerlMagick/t/jpeg/write.t: Re-wrote to compare with reference\n\timage.\n\n\t* magick/image.c, magick/command.c: Moved MogrifyImage and\n\tMogrifyImages from image.c to command.c in order to diminish\n\tunnecessary inter-object coupling. Only functions in command.c\n\tshould use MogrifyImage or MogrifyImages.  Some work remains to\n\taccomplish that.\n\n2002-12-16  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* coders/jpeg.c: Add missing break statements to fix colorspace\n\thandling when image colorspace is CMYKColorspace or\n\tYCbCrColorspace.\n\n\t* magick/decorate.c: Cast to double in calculation.\n\n\t* magick/enhance.c: Tweaks to equalization map calculation to\n\t(hopefully) provide more consistent results.\n\n\t* magick/resize.c: Use type double rather than long for minify\n\tweighting constants.\n\n2002-12-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/image.h: AdaptiveThresholdImage offset must be a signed\n\ttype.\n\n2002-12-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Re-wrote PerlMagick filter.t tests so that they all compare\n\tresults with reference images rather than compare signatures.\n\tThis makes the tests easier to maintain and also makes it easier\n\tto find errors in ImageMagick.\n\n2002-12-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Warnings reduction\n\n\t* magick/list.c: Warnings reduction\n\n2002-12-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Updated PerlMagick tests for Emboss, Equalize, Gamma, Normalize,\n\tOilPaint, and Gradient so that they pass at Q:8 under Windows.\n\n\t* Updated PerlMagick tests for Emboss, and reading WMF, so that\n\tthey pass at Q:16 under Windows.\n\n\t* VisualMagick\\installer\\ImageMagick-16.iss: Ported over from\n\tImageMagick-8.iss and verified.\n\n2002-12-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Major smashing of ImageMagick to GraphicsMagick in .txt files\n\tand .html files.\n\n\t* ImageMagick.html: Renamed to index.html.\n\n\t* www/ImageMagick.html: Renamed to www/GraphicsMagick.html\n\n2002-12-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/list.c: Added GetFirstImageInList() function.\n\n\t* magick/list.c: Added GetLastImageInList() function.\n\n\t* coders/pcd.c: Re-implemented image tile labeling to avoid use of\n\tMogrifyImages().\n\n2002-12-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added `commit` shell script to CVS for those who chose to use\n\tit.\n\n2002-12-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c: Ensure that operating system call error return\n\tvalues are never used in resource limit calculation.\n\n2002-12-12 William Radcliffe <billr@corbis.com>\n\n\t* magick/magick.c: Fixed bugs in InitializeMagick, but I also\n\theavily commented the code so show what it seems to be doing. It\n\tappears broken and needs testing on all platforms. Toward that\n\tend, I added Log events so that we can see what it is doing.\n\n2002-12-12 William Radcliffe <billr@corbis.com>\n\n\t* utilities/gm.c: Fixes a crashing bug in gm.c caused by an\n\tattempt to free a bad pointer. Added comments to the code that\n\texplain why this happens so that future developers don't fall into\n\tthe same trap.  * win2k/IMDisplay/IMDisplay.rc Modified some of\n\tthe string resources that define supported file formats that were\n\tin error. One example was eps with had a *.eps in the string\n\tinstead of just .eps. This caused the document class to ASSERT\n\tunder the debug build.\n\n2002-12-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Enable the module loading code for shared/DLL builds regardless\n\tof whether the build is a \"modules\" build. This allows users to\n\tadd their own modules without requiring the use of a special\n\t\"modules\" build.\n\n2002-12-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h: Backed out arbitrary name change from\n\tChannelThresholdImage() to ThresholdImageChannel() that snuck in\n\tfrom Cristy's image.h changes.\n\n2002-12-11  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* coders/psd.c: Reference cloned image Blob (not sure why needed\n\tbut must be important).\n\n2002-12-11  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* magick/enhance.c: Fixed LevelImage() to accept percent\n\tblack/white points (.i.e. 90%).\n\n\t* magick/enhance.c: Added LevelImageChannel().\n\n\t* magick/enhance.c: Improved Q:8 performance of color\n\ttransformations (e.g. for Gamma) which are based on a mapping\n\tarray.\n\n\t* coders/pcl.c: Fixed PCL coder to output proper color PCL\n\tinstructions.\n\n2002-12-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c: Disabled SetImageInfo() code which uses\n\tGetImageMagick() to test file magic via Is* methods so that we can\n\tlearn if eliminating use of these tests causes any ill effects.\n\n2002-12-09 William Radcliffe <billr@corbis.com>\n\n\t* Moved xtrn.c from contrib area into coders area so that it can\n\tbe used from within the COM object. This is windows only code that\n\tprovides a back door way for the COM object to have data read or\n\twritten into VB arrays.\n\n2002-12-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/mac.c: Merged in fixes from ImageMagick version.\n\n\t* magick/magick.mgk: Merged in fixes from ImageMagick version.\n\n2002-12-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c: Fix ChannelImage() so that it does not destroy\n\tCMYK(A) channels by forcing RGB.\n\n2002-12-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/version.h: Changed to release 1.0.0.\n\n\t* magick/nt_base.c: Changed \"ImageMagick\" to \"GraphicsMagick\" so\n\tregistry lookups work for GraphicsMagick.  Probably should be\n\tconfigured via a magick_config.h define.\n\n\t* VisualMagick/installer/ImageMagick-8.iss:\n\tChanged for GraphicsMagick.\n\n\t* utilities/conjure.c: Fix unterminated comment.\n\n2002-12-06 William Radcliffe <billr@corbis.com>\n\n\t* coders/jpeg.c: Modification of JPEG APP1 detection logic to name\n\tEXIF and XMP profiles as EXIF and XMP instead of APP1. THe current\n\talgorithm is brute force.\n\n\t* coders/meta.c: Modification deal with EXIF and XMP requests so\n\tthat you can ask for these blobs specifically if they exist.\n\n\t* coders/pdf.c,ps.c,ps2.c,ps3.c: Cristy bug fixes to eliminate\n\tredundant file access checking and fix embedded JPEG support.\n\n\t* magick/random.c: Upgraded this to match current Cristy code. The\n\tupgrade is to support more robust temporary filenames in another\n\tchange to this in utility.c however, I have not upgraded this code\n\tyet because I don't understand it well enough.\n\n2002-12-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added build support for utilities/gm.c\n\n2002-12-06  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Relocated animate, conjure, display, and import functions into\n\tcommand.c.\n\n\t* Added utilities/gm.c; gm is a driver for all of the utility\n\tfunctions (animate, composite, conjure, convert, display,\n\tidentify, import, mongrify, and montage), which are now run with\n\t\"gm convert [convert_options]\", \"gm identify [identify_options]\",\n\tetc.\n\n2002-12-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c: Remove bogus code for handling temporary file.\n\n2002-12-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Updated to Autoconf 2.57.\n\n\t* Install libraries as -lGraphicsMagick and -lGraphicsMagick++\n\tunder Unix.\n\n\t* Install headers under ${PREFIX}/include/GraphicsMagick under\n\tUnix.\n\n\t* Update *-config scripts to produce correct library and include\n\tstatements.\n\n\t* Update PerlMagick to use correct library and include statements.\n\n2002-12-04 William Radcliffe <billr@corbis.com>\n\n\t* contrib/win32/ATL7/ImageMagickObject/ImageMagickObject.cpp:\n\tFixed serious problem with not installing custom error and warning\n\thandlers in the new version of the COM object.\n\n2002-12-04 William Radcliffe <billr@corbis.com>\n\n\t* magick/constitute.c: Pass exceptions on write up into the\n\texception structure passed into the WriteImages function.\n\n2002-12-04 William Radcliffe <billr@corbis.com>\n\n\t* magick/image.c: Added orphan image functionality changes that\n\tare purported to fix bugs in PDF and PS coders.\n\n2002-12-04 William Radcliffe <billr@corbis.com>\n\n\t* magick/locale.c: Hard coded the locale as per Cristy fix, but\n\talso added a comment and disabled useless code.\n\n2002-12-04 William Radcliffe <billr@corbis.com>\n\n\t* VisualMagick/bin/magic.mgk: Added JNG as per the copy in magick\n\tsubdirectory.\n\n2002-12-04 William Radcliffe <billr@corbis.com>\n\n\t* tiff/libtiff/tiff.h: Minor changes to make reading older\n\tPhotoshop TIFF files spew fewer warnings.\n\n2002-12-04  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Optimized ConvolveImage() by normalizing the kernel values\n\tinstead of normalizing the pixels.\n\n2002-12-01  Glenn Randers-Pehrson  <randeg@alum.rpi.edu>\n\n\t* www/formats.html: Add JNG and fix libpng links.\n\n2002-12-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ChangeLog: Updated this ChangeLog to use the format prescribed\n\tby the GNU coding standards.\n\n2002-12-01  Glenn Randers-Pehrson  <randeg@alum.rpi.edu>\n\n\t* coders/png.c: Use PNG_SETJMP_NOT_THREAD_SAFE to indicate that\n\tthe C library's setjmp() API is not thread safe.\n\n\t* Fix use of image_info->blob.\n\n2002-11-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Set up new CVS repository for GraphicsMagick based on current\n\tImageMagick 5.5.2 (pre-release) sources.\n\n2002-11-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Flashpix library now uses C++ standard <new> and iostreams\n\trather than legacy new and iostreams.\n\n2002-11-15  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* The blob methods were enhanced to use GZip or BZip API methods\n\tto compress/uncompress images (previously the external programs\n\tgunzip or bunzip2 were used).\n\n2002-11-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Update to Autoconf 2.56\n\n2002-11-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Update to Autoconf 2.55\n\n2002-11-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Moved coder Register/Unregister method prototypes to static.h\n\tsince they are only needed by static.c.\n\n\t* Removed defunct HDF and libmpeg2 support since it was confusing\n\tto users.\n\n2002-11-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c: Set white background of embedded bitmaps to\n\ttransparent if the image background is a texture image, not-white,\n\tor non-opaque.  This improves the output when the WMF is rendered\n\ton a non-default background.\n\n2002-11-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Updated Windows CVS to FreeType 2.1.2.\n\n2002-11-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Updated Windows CVS to Jasper 1.600.0.\n\n2002-11-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Verify sanity of sysconf(_SC_PAGE_SIZE) and\n\tsysconf(_SC_PHYS_PAGES) before using their values.\n\n2002-11-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Modified IMdisplay so that larger images may be loaded\n\t(primarily limited by Windows bitmap size limits).\n\n\t* Added some more file types (EPS, GIF, MIFF, SVG, & WMF) to\n\tIMdisplay's file open list.\n\n\t* The list management methods were given more meaningful names.\n\n2002-11-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Modified IMdisplay so that Magick++ Images are stored by value\n\trather than via pointer.\n\n\t* IMdisplay now uses minify(), magnify(), and zoom() methods where\n\tappropriate.\n\n2002-11-04  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Quantizing a DirectClass image with less than 256 unique colors\n\tis no longer lossy.\n\n\t* Transparent TGA images had incorrect opacity values.\n\n2002-10-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added configure test for compiler __func__ support\n\t(HAS___func__).\n\n\t* Added configure test for ftime().\n\n2002-10-31  Leonard Rosenthol <leonardr@lazerware.com>\n\n\t* CMYK + alpha layered PSD files now correctly read!\n\n2002-10-30  Leonard Rosenthol <leonardr@lazerware.com>\n\n\t* ReadPSDImage() is now fully instrumented with logging\n\n\t* Fixed long standing bug in ReadPSDImage, so it no longer returns\n\tan extra layer\n\n2002-10-29  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Added three output formats: PNG24 (24-bit RGB PNG, opaque only),\n\tPNG32 32-bit (RGBA PNG, semitransparency OK), and PNG8 (8-bit\n\tindexed PNG, binary transparency only).\n\n2002-10-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/vid.c: Modified to be 10X faster for large images and to\n\ttake advantage of JPEG size optimizations.\n\n2002-10-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/xwindow.c: Optimize loading of TrueColor images with\n\tgamma = 1.0.\n\n2002-10-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c: Added logging facilities.\n\n2002-10-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* display.c: removed unnecessary SignatureImage() calls which\n\tdramatically slowed down loading images and quiting the program.\n\n\t* xwindow.c: optimized image size reduction for the case where the\n\ttarget size is a small fraction of the original size. This makes\n\tcreation of display's panner and thumbnail images tremendously\n\tfaster, with no noticeable degradation of thumbnail quality.\n\n2002-10-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added Windows95 define to VisualMagick magick_config.h to\n\tdisable use of features not available under Windows '95\n\n2002-10-21  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added large file pixel cache support for Windows NT.\n\n2002-10-21  Leonard Rosenthol <leonardr@lazerware.com>\n\n\t* PDF coder no longer uses ASCII85 encoding with TIFF for MUCH\n\tsmaller files!\n\n\t* Cleaned up a few other things in PDF coder.\n\n2002-10-19  Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n\t* Updated to Automake 1.7.1.\n\n2002-10-18  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* PingBlob() improperly set the length of BlobInfo to zero.\n\n\t* Fixed Ping() memory leak in PerlMagick.\n\n\t* Fixed -map problem in convert/mogrify utilities.\n\n\t* Fixed -remote problem with display utility (returns correct\n\terror status).\n\n2002-10-16  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* -border with a single value now produces correct results\n\t(e.g. -border 10).\n\n\t* Added -lat to convert/mogrify (local adaptive thresholding).\n\n2002-10-15  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Set locale type LC_NUMERIC to \"C\".\n\n\t* Bug fix for PS2 encoder.\n\n\t* Added PS-Adobe preamble to PS3 encoder.\n\n2002-10-14  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageMagick 5.5.1 released.\n\n2002-10-12  Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n\t* Use ImageMagick release number to allow multiple ImageMagick\n\treleases to co-exist without interference on the same machine.\n\n2002-10-09  Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n\t* Decided that DrawGet functions should return by value.\n\n2002-10-06  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Added detailed logging to BMP, PNG, and JPEG codecs, including\n\tJPEG quality estimate.\n\n2002-10-01  Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\t\n\t* Added draw.h \"DrawGet\" equivalents to most of the \"DrawSet\"\n\tfunctions.\n\n\t* Added an array size argument to DrawSetDashPattern and got rid\n\tof the zero-termination garbage.\n\n\t* Remove `Set` from the names of draw.h functions which update the\n\tcurrent affine transformation array (e.g. DrawSetRotate becomes\n\tDrawRotate).\n\n2002-09-29  Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n\t* Updated to Automake 1.7.\n\n2002-09-29  Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n\t* Under Windows, a DllMain function which automatically\n\tinitializes ImageMagick (when ImageMagick is built using DLLs) may\n\tbe added by defining ProvideDllMain in magick_config.h\n\n2002-09-28  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added resource consumption methods, see magick/resource.c.\n\n2002-09-27  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Replaced underscores in commandline options with hyphens.  For\n\tbackward compatibility, underscores will continue to be\n\trecognized.\n\n\t* Added -blue-primary, -green-primary, -red-primary, -white-point\n\toptions.\n\n2002-09-27  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Added BMP2 and BMP3 output formats.\n\n\t* Changed chromaticity primary.z from 1.0 to\n\t1.0-(primary.x+primary.y) in the PNG and PCD codecs.\n\n2002-09-21  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added `exception` parameter to the ImageMagick progress monitor\n\tAPI.\n\n\t* Added enumerated types for the dispose member of the Image\n\tstructure.\n\n\t* Added -version option to commandline utilities.\n\n2002-09-21  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* The xcf decoder would sometimes create artifacts when reading\n\tRLE-encoded grayscale images, due to the green and blue samples\n\tnot being defined.\n\n2002-09-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Update to Autoconf 2.54.\n\n2002-08-08  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added logging capabilities to the CORE API.  This facility is\n\tuseful for debugging.  Added \"events\" parameter to the -debug\n\tcommandline option.\n\n\t* AcquireImagePixels() did not always return the same pixel values\n\tfor virtual pixels when the cache was stored on disk (very rare).\n\n\t* new -virtual-pixel command line option.\n\n\t* new PerlMagick virtual-pixel image attribute.\n\n2002-08-07  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageMagick 5.4.9 released.\n\n2002-09-06  Leonard Rosenthol <leonardr@lazerware.com>\n\n\t* Fixed some bugs in the Clipboard coder\n\n\t* Added new ImageToHBITMAP function to NTFeature.c/.h in core\n\n\t* Added support for Quantum==32 to IMDisplay\n\n2002-08-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Fix formatting in the *.mgk files so that they are XML conformant\n\n2002-08-30  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* QuantizeImage() did not always produce proper bilevel images.\n\n2002-08-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Apply prefix/suffix transformations to ImageMagick program names\n\twhich are substituted into delegates.mgk.  This fix was requested\n\tby Glenn Randers-Pehrson.\n\n2002-08-25  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Arcs are now rendered properly.\n\n\t* Use -authenticate to specifiy a password when viewing encrypted\n\tPDF's.\n\n\t* -page was previouly being ignored.\n\n\t* Configure files are returned as blobs now (suggested by William\n\tRadcliffe).\n\n2002-08-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added --disable-installed option to configure to support\n\tbuilding an ImageMagick which is not installed via hard-coded\n\tpaths. This is intended to be used for the ad-hoc binary\n\tdistributions built by ImageMagick Studio.\n\n\t* The UseInstalledImageMagick define is to be used by builds\n\tformally installed under a prefix, or via the Windows registry.\n\n\t* Replaced GetMagickConfigurePath() with the three functions\n\tFindConfigurationFile(), FindFontFile(), and FindModuleFile().\n\n\t* Re-implemented InitializeMagick() to try harder at finding the\n\tuninstalled ImageMagick without the help of MAGICK_HOME.  In the\n\tfuture, it can try even harder.\n\n\t* Unix binaries packages (built with --disable-installed) should\n\tnow work using the same file layout as the distribution file.\n\tThere is no longer a need to put all files in the same directory.\n\n2002-08-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Under Windows, define UseInstalledImageMagick to locate\n\tcomponents using the registry rather than scanning the filesystem.\n\n2002-08-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added DrawSetTextEncoding() function to specify text encoding\n\t(e.g. \"UTF-8\").\n\n2002-08-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Extend `convert -list type` output so it prints more details.\n\n\t* Fix draw.c problem when specifying font family names that\n\tcontain spaces.\n\n2002-08-15  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Finished 32-Bit QuantumDepth support.\n\n\t* Subimage memory leak fixed (bug report by William Radcliffe).\n\n\t* Fixed subimage specification memory overrun.\n\n\t* Subimage specification did not work properly under Windows.\n\n2002-08-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Fix problem with TEXT encoder.  It was prepending the filename\n\tto the text.\n\n2002-08-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Render Postscript via Ghostscript DLL (gsdll32.dll) under\n\tWindows if it can be loaded.  Only ps.c currently uses this to\n\tverify there are no problems.\n\n2002-08-14  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added 16-bit raw write support to PPM.\n\n2002-08-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Re-implemented ReadTTFImage() using the draw.h APIs.\n\n2002-08-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Fixed a libtool bug in order to allow passing -m64 to allow\n\tbuilding 64-bit ImageMagick using gcc 3.1 or later under SPARC\n\tSolaris.\n\n2002-08-04  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added experimental 32-bit QuantumDepth pixel support.\n\n\t* Stream support was not thread-safe (bug report by William Radcliffe).\n\n\t* Push/PopImagePixels() now recognizes the proper buffer length\n\t(previously it operated on one scanline at a time).\n\n\t* Deprecated Down/Upscale defines.  Replaced them with\n\tScale*ToQuantum() and ScaleQuantumTo*() methods.\n\n2002-08-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Changed configure argument --disable-16bit-pixel to\n\t--with-quantum-depth in order to make its usage more\n\tstraightforward and generic.  Build ImageMagick using an eight-bit\n\tquantum via --with-quantum-depth=8.\n\n\t* Magick++ library builds as a DLL under Windows now.\n\n2002-07-31  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Delegates/modules are restricted to hard-coded search paths (a\n\tsecurity feature suggested by Bob Friesenhahn).\n\n2002-07-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added SubstituteString to utility.c for performing substitions\n\ton strings.\n\n\t* Added support for performing Ghostscript-related substitutions\n\twhile reading delegates.mgk and type.mgk files.\n\n2002-07-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added the Windows utility functions NTGhostscriptDLL(),\n\tNTGhostscriptEXE(), and NTGhostscriptFonts(), to find the DLL,\n\texecutable, and font directory corresponding to the newest\n\tGhostscript install on the system.\n\n2002-07-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Split nt.c into ntbase.c and ntfeature.c\n\n\t* Split nt.h into ntbase.h and ntfeature.h\n\n\t* Invoke NTIsMagickConflict() under Cygwin to ensure that drive\n\tletters in file specifications are not confused with magick\n\tstrings.\n\n\t* Invoke NTGetTypeList() under Cygwin to read the list of Windows\n\tfonts.\n\n2002-07-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Created Windows \"setup.exe\" style installation package for\n\tImageMagick.\n\n\t* Include PerlMagick Perl extension for ActiveState ActivePerl as\n\tcheckmark install option in Windows installation package.\n\n\t* Include ImageMagickObject OLE Object for WSH and Visual Basic\n\t(not IIS!!!) as checkmark install option in Windows installation\n\tpackage.\n\n\t* Windows installation package establishes file extension\n\tassociations for ImageMagick.\n\n2002-07-17  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* PPM files were being written in P4 or P5 format if all pixels\n\twere gray.  This is correct behavior for the PNM format but not\n\tfor the PPM format.\n\n2002-07-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Load font information from Windows rather than depending on hand\n\tedited type-windows.mgk file. Still not incorporated in Cygwin\n\tbuild.\n\n2002-07-04  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Typos corrected in perl.html (thanks to Ron Savage);\n\n\t* A color profile is now correctly referred to as ICM instead of\n\tIPTC.\n\n\t* Added XPM color compliance to colors.mgk.\n\n\t* $image->Get(`clip-mask`) now returns the clipping image.\n\n2002-07-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added NTRegistryKeyLookup() to nt.c in order to look up\n\tImageMagick installation parameters from the Windows Registry.\n\n\t* Updated GetMagickConfigurePath() in magick.c to use installation\n\tpath data from the Windows Registry (if available).\n\n\t* Updated VisualMagick/ImageMagick.iss so that Windows Registry is\n\tupdated by install package.\n\n2002-07-03  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Semaphore.c will compile now when pthreads are not present.\n\n\t* 8-Bit Quantum PCD images now read correctly.\n\n\t* The antialias member of the ImageInfo structure was not being\n\tcloned.\n\n2002-07-01  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageMagick 5.4.7 released.\n\n2002-06-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt.c (readdir): Make readdir re-entrant for each instance\n\tof DIR.  This should improve thread safety.\n\n\t* ltdl/ltdl.c : Support building as DLL under Win32.\n\n2002-06-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Update to use Automake 1.6.2\n\n2002-06-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Try harder when searching for Ghostscript fonts under Linux.\n\n2002-06-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Identify PICT files via magic.mgk.\n\n2002-06-18  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added PerlMagick threading support (patch by Doug MacEachern).\n\n2002-06-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* CLIPBOARD and EMF modules compile under MinGW and Cygwin.\n\n2002-06-14  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* The wbmp writer would dump core if it received a DirectClass\n\timage that contained only black and white pixels, because no\n\tcolormap exists.\n\n2002-06-09  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Label color could not be set (bug report by Ron Savage).\n\n\t* Added CatchException() method to magick/error.c.\n\n2002-06-06  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageMagick, version 5.4.6-1 released.\n\n2002-06-05  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added -encoding option to command line utilities.\n\n2002-06-02  Cristy  <cristy@mystic.es.dupont.com>\n\t* ImageMagick, version 5.4.6 released.\n\n2002-05-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ImageMagick may now be built (static build only) using the free\n\tMinGW development package from http://www.mingw.org.  Leonard's\n\t\"clipboard\" coder is included in the build.\n\n2002-05-28  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Added new \"clipboard\" coder for reading/writing the system's\n\tclipboard.  Currently this is only implemented on Windows.  For\n\texample: `convert logo: clipboard:`, `convert clipboard: foo.png`.\n\n2002-05-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Support autotrace via delegates.mgk.  For example: `convert\n\tautotrace:file.png file.mvg`.\n\n2002-05-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added progress monitor support to DrawImage().\n\n2002-05-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added progress monitor support to wmf.c.\n\n2002-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added EscapeText() to utility.c to support escaping text.\n\n2002-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Text escaping for -draw and DrawAnnotation was not working\n\tproperly.  Now it does.  Backslash should act as a escape for the\n\tthe active quote character (', \", or }) as well as backslash.  The\n\tbackslash should be discarded if it was used as an escape\n\tcharacter.  In order to reliably pass a backslash, two successive\n\tbackslashes are required\n\t(e.g. \"\\\\\").\n\n2002-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Modified Base64Encode() of utility.c so that it returns the\n\tnumber of characters encoded. This avoids having to invoke\n\tstrlen() on possibly megabytes of data.\n\n2002-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Fixed compilation error with Sun Workshop compiler (wmf.c).\n\n2002-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Implement polypolygon support in WMF renderer.  Requires libwmf\n\t0.2.4 with draw_polypolygon IPA callback.\n\n2002-05-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added --enable-ccmalloc configure option.\n\n2002-05-09  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* DCM patch provided by Shane Blackett.\n\n2002-05-07  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Lock mutex when destroying a SemaphoreInfo structure (patch\n\tprovided by William Radcliffe).\n\n\t* Added mingw patches provided by Derry Bryson.\n\n2002-05-05  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageMagick, version 5.4.5-1 released.\n\n2002-04-30  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Subimage specification did not work for TIFF (e.g.  convert\n\t`image.tiff[1]` image.png).\n\n2002-04-30  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageMagick, version 5.4.5 released.\n\n2002-04-20  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added magic string detection for the FPX format (patch provided by\n\tMarc).\n\n2002-04-18  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added ExceptionInfo parameter to C API method,\n\tQueryColorDatabase().\n\n2002-04-17  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Fixed all known bugs with the IMDisplay utility for Windows.\n\n2002-04-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac (libtool_build_static_libs): Added\n\t--enable-delegate-build option to suuport building ImageMagick\n\tusing delegate libraries in subdirectories of the ImageMagick\n\tsource directory.\n\n2002-04-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* WMF now supplies bitmaps as inline images rather than via a mpri\n\treference.\n\n2002-04-15  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Fixed DrawImage() to properly handle affine image transforms.\n\n\t* Added AffineTransformImage() to C API.\n\n\t* Added -transform option to convert/mogrify program.\n\n2002-04-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (MagickToMime): New method to return the MIME\n\tmedia type corresponding to a specified magick tag.\n\n2002-04-12  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Fixed a bug in writing layer names in PSD files.\n\n2002-04-10  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Fixed PingImage() memory leak (thanks to Timo Vogel).\n\n\t* Added encoding and unicode attributes to PerlMagick (patch\n\tprovided by Youki Kadobayashi).\n\n2002-04-08  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added reference counted blobs.\n\n\t* Added MagickFatalError() and SetFatalErrorHandler() to the C\n\tAPI.\n\n\t* One color images caused memory corruption in QuantizeImage()\n\t(thanks to Vincent Broz).\n\n\t* Memory leak in NormalizeImage() (thanks to Vincent Broz).\n\n2002-04-06  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Added CCIS-601 4:2:2 YUV format read-write support.\n\n\t* Added CCIS-601 4:2:2 MPEG-2 format write support.\n\n\t* Fixed a bug introduced in 5.4.0 that caused files with \"M2V\"\n\tsuffix to be written in MPEG-1 instead of MPEG-2 format.\n\n2002-03-28  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageToBlob() only returned the first frame of a multi-frame\n\timage.\n\n2002-04-05  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Fixed inversion of colors when converting CMYk JPEG to PDF\n\n2002-04-01  Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n\t* Fixed TTF preview function.\n\n2002-03-28  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* DCM patches provided by Syam Gadde.\n\n\t* Multi-frame MPC image files caused a fault under Windows.\n\n\t* Copy entire comment from SVG (bug report from Bob Friesenhahn).\n\n\t* Enlarged scanline buffer for JPEG-compressed TIFF's (bug report\n\tfrom Bob Friesenhahn).\n\n2002-03-27  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* ImageMagick, version 5.4.4, released.\n\n2002-03-26  Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n\t* Added preliminary version of C API for vector drawing commands\n\t(draw.h & draw.c).  This interface is subject to change, and has\n\tnot even been tested yet so it should not be used to support\n\tproduction code.  The previous draw.h and draw.c have been renamed\n\tto render.h and render.c respectively.\n\n2002-03-25  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* Fixed bugs related to layered CMYK PSD images.\n\n2002-03-13  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* PSD coder now saves layer information (name, offset & opacity)\n\tin hidden attributes.\n\n2002-03-13  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Enhanced MPC to read/write image sequences.\n\n2002-03-13  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* A number of formats (e.g. JPEG, PS) did not handle DirectClass\n\tgrayscale images properly.\n\n2002-03-12  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Changed Clone*Info() API so structure members are set directly rather\n\tthan by the *clone=*info method (suggested by William Radcliffe).\n\n2002-03-11  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added AcquireString() to allocate read-only strings.\n\n2002-03-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/null.c (WriteNULLImage): Support writing \"null:\" image\n\ttype for use when profiling or testing ImageMagick.\n\n2002-03-08 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n\t* Update to Autoconf 2.53 (new release)\n\n\t* Update to Automake 1.6 (new release)\n\n2002-03-07  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Bob Friesenhahn's execution profile results in a number of\n\tspeed-ups with a faster LocaleCompare() algorithm and\n\tself-adjusting lists.\n\n\t* Recognize additional DCM metadata (suggested by Barry Branham).\n\n\t* Fixed CopyOpacity composite operator for CMYKA images.\n\n2002-03-06  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Inlined AlphaComposite() and ValidateColormapIndex().\n\n\t* Corrected compositing algorithm for the case where both source\n\tand destination pixels had opacity values that were neither fully\n\ttransparent nor fully opaque.\n\n2002-03-05  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Memory overrun when drawing large circles.\n\n2002-03-04  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Removed bug introduced into Bob's Base64Encode() method.\n\n2002-03-02  Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n\t* Added Base64Decode() and Base64Encode() to utility.c and updated\n\tReadInlineImage() in magick/constitute.c to use Base64Decode().\n\n2002-03-01  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* GetTypeInfoByFamily() null pointer fault (reported by Bob\n\tFriesenhahn).\n\n\t* Added module version number (patch by Glenn Randers-Pehrson).\n\n2002-03-01  Glenn Randers-Pehrson  <randeg@alum.rpi.edu>\n\n\t* image->matte was not being set when reading GRAY-ALPHA PNG\n\tfiles.\n\n2002-02-26  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Potential infinite loop in SyncBlob() (reported by Vladimir\n\tFaiden).\n\n2002-02-26  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Gravity not respected when drawing text with the convert\n\tprogram.\n\n2002-02-21  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* MPEG multi-part filenames require an embedded %d, not %lu.\n\n\t* WriteStream() did not write to fifo (thanks to William\n\tRadcliffe).\n\n2002-02-20  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Annotation did not support SJIS properly (patch provided by\n\tKatsutoshi Shibuya).\n\n2002-02-18  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Fixed memory overrun with -format option of the mogrify program.\n\n\t* Labels were not positioned correctly for VID format.\n\n2002-02-16  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Replaced -copy/-replace options with +/-write in the convert\n\tprogram.\n\n\t* Median filtering speed enhancement using skip list contributed\n\tby Mike Edmonds.\n\n2002-02-14  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Command line options now stay in effect for any image in command\n\tline order until a another option is encountered or if -noop is\n\tspecified.\n\n2002-02-07  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* SVG coders understands inline images.\n\n2002-02-06  Cristy  <cristy@mystic.es.dupont.com>, Glenn Randers-Pehrson\n\n\t* Made -scene consistent across all utilities.  -snaps replaces\n\tprevious functionality of -scene for import program.\n\n2002-01-30  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Correctly draw arc when arc end/start are not integer\n\t(patch contributed by Giuliano Pochini).\n\n2002-01-28  Cristy  <cristy@mystic.es.dupont.com>, Glenn Randers-Pehrson\n\n\t* Geometry strings respect -gravity (e.g. -gravity SouthWest -crop\n\t100x100).\n\n\t* Postive offsets in geometry strings move within the image canvas\n\twith respect to the gravity (SouthWest gravity is similar to\n\tPostscript page offsets).\n\n2002-01-24  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Use -trim to trim the edges of an image.\n\n\t* Palm pixmap supported contributed by Christopher R. Hawks.\n\n\t* Added -mask to the convert/mogrify programs to add clips masks\n\tto an image.\n\n2002-01-21  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Fixed occasional small memory leak associated with exceptions.\n\n\t* Persistent cache is no longer updated (MPC coder).\n\n2002-01-20  Glenn Randers-Pehrson  <randeg@alum.rpi.edu>\n\n\t* Fixed some bugs in the uncompressed PGM and PPM reader/writer\n\t(pnm.c).\n\n2002-01-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Removed test for libwmf/font.h.\n\n2002-01-13  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* More bug fixes and improvements in PSD writer.\n\n2002-01-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magic.mgk: Added entries for detecting PFA and PFB\n\tformats.  Is this file used for anything anymore?\n\n\t* coders/modules.mgk: Add support for PFA fonts.\n\n\t* coders/ttf.c (RegisterTTFImage): Add support for PFA fonts.\n\n\t* magick/annotate.c (RenderType): Add support for PFA fonts.\n\n2002-01-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Modified type.mgk so that it may include the additional files\n\ttype-windows.mgk, type-solaris.mgk, and type-ghostscript.mgk\n\tdepending on the operating system used, and the font files\n\tavailable.\n\n2002-01-11  Leonard Rosenthol  <leonardr@lazerware.com>\n\n\t* PSD now supports writing layered images and IPTC data\n\n\t* Fixed some bugs in XCF\n\n2002-01-11  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Added image list methods to the API.\n\n2002-01-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac : Renamed configure option --with-ttf-fontpath to\n\t--with-fontpath since ImageMagick loads more than TrueType fonts.\n\n\t* ChangeLog : Renamed Changelog.txt to ChangeLog in order to\n\tconform to GNU and open-source standards.\n\n2002-01-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am : $(DESTDIR) already contains trailing `/`.\n\n2002-01-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c (wmf_magick_device_begin): Fix non-opaque fills.\n\tNow properly fills with texture image.\n\n2002-01-05  Glenn Randers-Pehrson  <randeg@alum.rpi.edu>\n\n\t* Fixed an out-of-bounds memset() and two other memory overruns\n\twhen decoding 1-bit AVI, BMP, and DIB images.\n\n2002-01-04 Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Fix lcms header inclusion in transform.c.\n\n2002-01-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c (magick_brush): Fixed bug with setting fill color.\n\n2002-01-03  Cristy  <cristy@mystic.es.dupont.com>\n\n\t* Postscript Level II is now DCS compliant.\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2003",
    "content": "2003-12-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/annotate.c (RenderFreetype): Ensure that image storage\n\tclass is set to DirectClass. Text rendering was not working\n\tproperly on top of PseudoClass images.\n\n\t* magick/map.c (MagickMapRemoveEntry): Logic didn't properly\n\thandle removing entry in list.\n\n\t* configure.ac: Added --enable-efence option to enable memory\n\tdebugging using Electric Fence.\n\n2003-12-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/maptest.c (main): Extended test to add an entry to the\n\tlist after an entry has already been removed.\n\n\t* magick/image.c (ColorspaceTypeToString): Add support for LAB\n\tcolorspace.\n\n\t* magick/map.c: Added signature members to all structures and\n\tadded assertions to ensure that the signature == MagickSignature\n\tprior to use. MagickMapAllocateObject now initializes the object\n\treference count to one, and MagickMapDestroyObject decrements it\n\tin order to be more correct even though the object reference count\n\tis not actually used yet.\n\t(MagickMapCopyString): Preserve a null argument, and use\n\tAcquireString since it doesn't enlarge the string storage.\n\t(MagickMapCopyBlob): Preserve null blobs.\n\n\t* configure.ac: Search for the shmctl() function.  Under current\n\tCygwin, this is hiding in -lcygipc.\n\n2003-12-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c: Fixed the composite operator list in the\n\tCompositeImage documentation.\n\n\t* www/api/types.html: Corrected list of composition\n\toperators. Sometime prior to the creation of GraphicsMagick, the\n\t\"Replace\" composite operators were renamed to be \"Copy\" composite\n\toperators.  Thanks to David Relson for bringing this problem to\n\tour attention.\n\n\t* PerlMagick/Magick.xs: Added \"LAB\" to colorspace types.\n\n\t* magick/image.h (enum ColorSpace): Add LABColorspace enumeration.\n\n\t* wand/magick_wand.h : Add some compatibility definitions to\n\ttranslate from ImageMagick enumerations to existing GraphicsMagick\n\tenumerations.\n\n2003-12-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/annotate.c: Use header synonyms defined by FreeType's\n\tftheader.h (included via <ft2build.h>) to include FreeType headers.\n\tThis will presumably be more portable in the future.\n\n\t* configure.ac: <ft2build.h> is an optional prerequisite for\n\t<freetype/freetype.h> and <libwmf/ipa.h> so include it when\n\ttesting for these headers.\n\n\t* magick/annotate.c: Include <ft2build.h> if it is available.\n\n2003-12-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/wandtest.c: Ported from latest ImageMagick version.\n\n\t* wand/drawing_wand.c: Adapted to be compatible with latest\n\tImageMagick version.\n\n\t* wand/pixel_wand.c: Adapted to be compatible with latest\n\tImageMagick version.\n\n\t* wand/magick_wand.c: Ported from latest ImageMagick version.\n\n\t* magick/image.h (Image): Members color_profile, iptc_profile,\n\tgeneric_profile, and generic_profiles are now deprecated and\n\tprivate although they continue to work as before. Please migrate\n\texisting code to use the GetImageProfile and SetImageProfile\n\tfunctions since these members will eventually be removed.\n\n\t* magick/image.c (GetImageProfile): New function to retrieve an\n\timage profile. Return value differs from similarly named\n\tImageMagick method since the ImageMagick approach assumes a\n\tparticular storage method.\n\t(SetImageProfile): New function to add (or remove) an image\n\tprofile. Does not execute CMS color profiles.\n\n\t* magick/cache.c (SetImageVirtualPixelMethod): Return unsigned int to\n\tmake the Wand implementation happy.\n\n\t* magick/image.c (TransformColorspace): Return unsigned int to\n\tmake the Wand implementation happy.\n\t(SetImageType): Return unsigned int to make the Wand\n\timplementation happy.\n\n\t* magick/draw.h, magick/draw.c: Substitute `unsigned long` in\n\tplace of `size_t` in interfaces so that the draw API is not\n\tsensitive to the definition of _LP64.\n\n\t* locale/C.mgk: Added new messages required by Wand library.\n\n\t* magick/error.c (ExceptionSeverityToTag): Add tag translations\n\tfor the WandWarning, WandError, & WandFatalError enumerations\n\n\t* magick/error.h (enum ExceptionType): Add WandWarning, WandError,\n\t& WandFatalError enumerations to ExceptionType for ImageMagick\n\tAPI compatibility.\n\n\t* magick/image.h (enum ChannelType): Add an `AllChannels`\n\tenumeration to the ChannelType enumeration for ImageMagick\n\tAPI compatibility.\n\n2003-12-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick, tests: Adjusted allowed error values for tests based\n\ton new error computation arithmatic.  Some tests were left failing\n\tsince the operation they test provides results which are\n\tunreasonably inaccurate, or obviously broken.\n\n2003-12-17  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/jpeg.c: Changed \"JPEG:preserve-settings from a key/value\n\tpair to a simple flag.  Save and restore attributes when\n\t\"-define JPEG:preserve-settings\" appears on the commandline.  Use\n\t\"+define JPEG:preserve-settings\" to unset the flag.\n\n2003-12-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c: Include <ft2build.h> if it is available since some\n\tlibwmf installs don't work unless it is included before the libwmf\n\tAPI headers.\n\n\t* configure.ac: Check for <ft2build.h>.\n\n2003-12-16  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/jpeg.c: Changed stored jpeg quality attribute from\n\t[jpeg-quality] to JPEG-Quality.  Added attributes JPEG-Colorspace\n\tand JPEG-Sampling-factors.  Added code to save and restore\n\tthese attributes when \"-define JPEG:preserve-settings=yes\" is\n\tpresent in the comandline.  Quality is restored if the input\n\twas a JPEG and the quality was preserved.  Sampling factors\n\tare restored if the input was a JPEG, sampling factors were\n\tpreserved, and the colorspace for the output file is the same\n\tas that of the input file.\n\n2003-12-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* TclMagick/source/configure.ac: Add an initial TclMagick\n\tconfigure-based build environment based on a template and macros\n\tfrom the Tcl project.  I recall that while the extension does build,\n\tit is possible that it is not properly registered as a module to Tcl.\n\n2003-12-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (IsImagesEqual): Properly compute error distance\n\tvectors. Math was missing the necessary sqrt call.  Also,\n\tpre-normalize the error differences to 1.0 in order to reduce the\n\tstorage size required to store the summation of error values.\n\n\t* PerlMagick/t/composite.t: Update Minus and Xor reference images.\n\n\t* magick/composite.c (CompositeImage): Incorporated fixes from\n\tImageMagick for XorCompositeOp, PlusCompositeOp, and\n\tMinusCompositeOp.  Thanks to John Cristy for bringing the need for\n\tthese fixes to our attention.\n\n\t* magick/image.h (RoundToQuantum): Added missing parenthesis.\n\n2003-12-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/environment.imdoc: Document MAGICK_CODER_MODULE_PATH and\n\tMAGICK_FILTER_MODULE_PATH.\n\n\t* rungm.sh.in: Pass MAGICK_CODER_MODULE_PATH and\n\tMAGICK_FILTER_MODULE_PATH in the environment so modules build may\n\tbe tested without first being installed.\n\n\t* magick/module.c (FindMagickModule): Use the\n\tMAGICK_CODER_MODULE_PATH environment variable to specify a search\n\tpath for coder modules.  Use MAGICK_FILTER_MODULE_PATH to specify\n\ta search path for filter modules.\n\n\t* Makefile.am: Updated to Automake 1.8.\n\t(install-exec-perl): Fixes which achieve a successful\n\t`make distcheck` for the first time in *Magick history.\n\n\t* configure.ac: Set scripts to executable.\n\n2003-12-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (uninstall-data-html): Pathnames were computed\n\tincorrectly so documentation directories were being left behind.\n\n\t* configure.ac: --without-frozenpaths is now the default.  This\n\thelps `make distcheck` work and makes the package more portable.\n\tPath to gm was being incorrectly frozen when --without-frozenpaths\n\twas specified.\n\n\t* magick/delegate.c (ReadConfigureFile): Validate delegate paths\n\tprior to substitution.\n\n\t* rungm.sh.in (top_builddir): Use a more reliable scheme for\n\tcomputing location of source and build directories.\n\n\t* magick/Makefile.am: Improve include directory computation logic.\n\n\t* configure.ac: Don't override includedir.  Pass user-supplied LIBS\n\tto the linker.\n\n2003-12-08  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/jpeg.c: store JPEG quality as \"[jpeg_quality]\" attribute.\n\n2003-12-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* rungm.sh.in: New script to support executing uninstalled\n\texecutables.\n\n\t* magick/blob.c (GetConfigureBlob): New MAGICK_CONFIGURE_PATH\n\tenvironment variable allows the user to specify the search path\n\tfor configuration (.mgk) files.\n\n2003-12-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* index.html: Added a table showing current stable release and\n\tdevelopment version.\n\n2003-12-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc (use): Describe the syntax of the -process\n\targument.\n\n\t* acinclude.m4 (AC_CHECK_CC_OPT): Add quoting in AC_CHECK_CC_OPT\n\tdefinition.  Change suggested by Patrick Welche\n\n2003-12-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (GetMagickInfo): Fix preprocessing logic error\n\twhich caused moby shared library build to not register static\n\tmodules.\n\n2003-12-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/module.c (ExecuteModuleProcess): Add some logging.\n\n\t* magick/static.c (ExecuteStaticModuleProcess): Add some logging.\n\n2003-11-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer: Add optional build support for LZW.\n\n\t* wand/Makefile.am: Add AUTOMAKE_OPTIONS.\n\n\t* configure.ac: Update to Autoconf 2.59.\n\n2003-11-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/inc/tasks-install-perlmagick.isx: Update\n\tto reflect that the next release will use ActivePerl 5.8.1 Build\n\t807.\n\n\t* VisualMagick/installer/inc/files-configs.isx: Updated the source\n\tlocations for the .mgk files.  Install modules.mgk into the config\n\tdirectory rather than the modules directory.\n\n\t* configure.ac: Fixes to work with latest CVS libtool.\n\n\t* libtool.m4: Update to latest CVS libtool.\n\n\t* magick/modules.c, magick/static.c (ExecuteStaticModuleProcess):\n\tFix conditional compilation logic so that \"moby\" shared library\n\tbuild works again.\n\n\t* magick/compress.c, magick/mac.c: Use existing SaveImageText and\n\tLoadImageText global constants rather than separate defines.\n\n2003-11-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Update to Autoconf 2.58.\n\n\t* Makefile.am: Update to Automake 1.7.9.\n\n2003-11-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/draw.c (DrawComposite): Base64-encoded image was not\n\tbeing deallocated. Bad memory leak.\n\n2003-11-03  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick: Updated installation procedure. Please read \n\tBCBMagick/readme.txt for details.\n\t\n2003-11-03  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick: Released DLL Version. Please read BCBMagick/readme.txt\n\tfor details about installation and/or use.\n\n2003-11-03  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/utility.c (GetPathComponent): Added x, X, and +\n\tcharacters to list of legal characters in subimage\n\tspecifications. Required by raw RGB image reader which accepts the\n\tsyntax \"image.rgb[100x100+50+50]\". Thanks to John Cristy for\n\tcatching that one.\n\n2003-11-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/locale.c (GetLocaleMessageFromID): Fix ID range checking\n\tlogic.\n\n2003-10-30  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* coders/jpeg.c: changed to not write gray CMYK images as\n\tgrayscales. That would not be a valid optimization.\n\n\t* magick/color.c (IsGrayImage, IsMonochromeImage): Changed to\n\tnever return true for CMYK images. Separated images get wrong\n\tcolors when optimized to grayscales based on what these two\n\tfunctions return. Gray and CMYK are two different color spaces.\n\n\t* magick/nt_feature.c (NTIsMagickConflict): changed to accept\n\tcolon as part of the magick string, consistent with the way the\n\tfunction is used.\n\n\t* magick/utility.c, magick/utility.h (ExpandFilenames,\n\tGetPathComponent): Fixed filename glob expansion. Added handling\n\tof filename prefix-magick and sub-image specification to\n\tGetPathComponent. Sub-image specification takes precedence over\n\tany filename patterns.\n\n2003-10-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/static.c (ExecuteModuleProcess): Renamed from\n\tExecuteStaticModuleProcess. Only compiled if SupportMagickModules\n\tis not defined.\n\n\t* magick/type.c (GetTypeBlob): Eliminated function.\n\t(ReadTypeConfigureFile): Use GetConfigureBlob() rather than\n\tGetTypeBlob().\n\n\t* magick/module.c (GetModuleBlob): Eliminate this function since\n\tmodules.mgk is now installed under\n\t${prefix}/share/GraphicsMagick-version/config so\n\tGetConfigureBlob() may be used.\n\t(lt_dlexit, etc.) Eliminate fake libltdl function wrappers used\n\tfor the static build.\n\t(DestroyMagickModules): Added a new destroy function (simply\n\tinvokes DestroyModuleInfo()).\n\t(GetModuleList): Learn where modules live by using\n\tFindMagickModule() to locate the LOGO module rather than by using\n\tthe location of modules.mgk.  This is necessary since now\n\tmodules.mgk may be seperate from the modules.\n\t(GetModuleBlob): Eliminated function.\n\t(InitializeMagickModules): New function to safely initialize the\n\tmodule loader.\n\t(OpenModule): Added logging messages.\n\t(OpenModules): Added logging messages.\n\t(ReadModuleConfigureFile): Use GetConfigureBlob() rather than\n\tGetModuleBlob().\n\tTotally eliminated the rat's-nest of conditional code dependent on\n\tSupportMagickModules.  Now all the code in module.c is dependent\n\ton #if defined(SupportMagickModules).\n\n\t* magick/magick.c (DestroyMagick): Invoke DestroyMagickModules().\n\t(GetMagickInfo): #ifdef chunks of code which exist to support the\n\tmodules-build rather than forcing the module loader to pretend\n\tthat modules are being used when they are not. Pass module loading\n\texceptions back to the user rather than discarding them.\n\t(GetMagickInfoArray): Don't inspect the exception status since may\n\tshort-circuits the operation.  Use best-effort instead.\n\t(ListMagickInfo): Don't inspect the current exception status so\n\tthat all the modules which did load successfully will be\n\trepresented.\n\t(InitializeMagick): Invoke InitializeMagickModules().\n\n\t* magick/log.c: (GetLogBlob): Eliminated function.\n\tGetConfigureBlob() is safe to use now when configuring logging.\n\t(LogToBlob): Simplified function.  Only exists since FileToBlob()\n\tmay throw exceptions (which are logged, causing deadlock).\n\t(ReadLogConfigureFile): Use GetConfigureBlob().\n\n\t* magick/blob.c (GetConfigureBlob): Re-written to use the\n\tMagickMap interface and to support the new `lib` and `share`\n\tconfig directories.  The directory\n\t${prefix}/lib/GraphicsMagick-version/config is scanned before\n\t${prefix}/share/GraphicsMagick-version/config.\n\t(FileToBlob): Simplified implementation.\n\n\t* config/Makefile.am: New makefile to install .mgk files.\n\n\t* magick/magick_config.h.in: Added MagickLibConfigPath and\n\tMagickShareConfigPath defines.\n\n\t* configure.ac: Install configuration files (.mgk files) in\n\t${prefix}/lib/GraphicsMagick-version/config and\n\t${prefix}/share/GraphicsMagick-version/config.  Architecture\n\tindependent files to under \"share\" while architecture dependnet\n\tfiles go under \"lib\".\n\n\t* Makefile.am: Added `config` subdirectory to distribution.  All\n\t.mgk files are moved from `coders` & `magick` into this single\n\tdirectory.\n\n2003-10-21  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* magick/studio.h: small modifications to achieve DLL\n\tcompilation of library with Borland C++ Builder.\n\n\t* coders/ps3.c (ZLIBEncode2Image): Fixed bug. Compilation\n\tfail when HasZLIB is undefined because parameters 5 and 6,\n\tare undefined.\n\t\n2003-10-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* libtool.m4: Updated libtool again to CVS latest version.\n\tLibtool required some fixes for building DLLs under MinGW.\n\n\t* magick/resource.c (InitializeMagickResources): Some code is\n\tconditional based on HAVE_POPEN.\n\n\t* magick/utility.c (SystemCommand): Improved conditional\n\tcompilation logic.\n\n\t* magick/blob.c (OpenBlob): Code depending on popen() is\n\tconditionally compiled based on HAVE_POPEN.  Code depending on\n\tpclose() is conditionally compiled based on HAVE_PCLOSE.\n\n\t* configure.ac: Add test for _pclose(), pclose(), _popen(), and\n\tpopen().\n\n\t* magick/locale.c (GetLocaleMessage): Add missing MagickExport.\n\t(GetLocaleMessageFromID): Add missing MagickExport.\n\n\t* VisualMagick/installer/inc/files-development.isx (Source):\n\tInclude all of the headers from the magick directory in the\n\tdevelopment package.  Including them individually is too error\n\tprone.\n\n2003-10-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/magick/magick_config.h.in: Added\n\tPREFIX_MAGICK_SYMBOLS as a configuration option.\n\n\t* magick/module.c (_CoderInfo): Added register_function and\n\tunregister_function members to record the module's register and\n\tunregister function addresses.\n\t(OpenModule): Locate the module's register and unregister\n\tfunctions and save their address to the module's CoderInfo record.\n\t(UnloadModule): Invoke the module unregister function using the\n\taddress recorded by OpenModule().\n\t(TagToFunctionName): If PREFIX_MAGICK_SYMBOLS is defined, then add\n\ta \"Gm\" prefix to the register and unregister function names.\n\n\t* libtool: Updated libtool files to the latest CVS version.\n\n\t* configure.ac: Changed define name from MAGICK_SYMBOL_PREFIX to\n\tPREFIX_MAGICK_SYMBOLS since support is not available for\n\tspecifying an arbitrary prefix.\n\n2003-10-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Added --enable-symbol-prefix configure option\n\twhich prepends \"Gm\" to all GraphicsMagick library symbols using\n\tthe C pre-processor.  In the future, this may change to support\n\tspecifying an arbitrary prefix, depending on experience.\n\n\t* magick/studio.h: Include magick/symbols.h.\n\n\t* magick/api.h: Include magick/symbols.h.\n\n\t* magick/symbols.h: New header to support optionally remapping\n\tlibrary symbols.  If MAGICK_SYMBOL_PREFIX is defined, then\n\tlibrary symbols are remapped.\n\n2003-10-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/api.h: Removed inclusion of <magick/semaphore.h> since it\n\tis an implementation header.\n\n2003-10-13  Lars Skyum  <lrs@stibo.dk>\n\n\t* www/GraphicsMagick.html, www/animate.html, www/composite.html,\n\twww/conjure.html, www/convert.html, www/display.html, www/gm.html,\n\twww/identify.html, www/import.html, www/mogrify.html,\n\twww/montage.html: added documentation for \"-define\" command line\n\toption.\t\n\n\t* doc/brief_options.imdoc, doc/options.imdoc: Added documentation\n\tfor \"-define\" command line option.\n\n\t* doc/gmdocselect, doc/imdocselect: Changed \"skipform\" label in\n\tsed scripts to just \"skipf\". Solaris sed had problems with the\n\tlong(?) \"skipform\" label.\n\n2003-10-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/composite.imdoc, doc/options.imdoc, doc/GraphicsMagick.imdoc:\n\tAttempted to clarify the meaning of the compose arguments and how\n\tcomposition works, as well as eliminating use of hard-coded values like\n\t255.\n\n\t* www/links.html: Added a link to Michael Still's article\n\t\"Graphics from the command line\".\n\n2003-10-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/*.c: Updated module descriptions so that they accurately\n\tdescribe the module rather than saying \"Read/Write GraphicsMagick\n\tImage Format\".\n\n\t* coders/cineon.c: Fix source module description.  Contrary to\n\topinion, ImageMagick did not invent the Cineon X image format so\n\tdescription is now \"Read/Write Cineon X Image Format.\"\n\n\t* magick/magic.mgk: Added a CINEON entry for the Cineon X image\n\tformat.\n\n\t* magick/static.c (RegisterStaticModules): Invoke\n\tRegisterCINEONImage().\n\n\t* coders/modules.mgk: Map \"CIN\" magick to CINEON module.\n\n2003-10-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* locale/C.mgk: Added message for \"UnrecognizedCommand\".\n\n\t* magick/command.c (MagickCommand): No error was reported when a\n\tsubcommand failed to be matched so `gm foo` would silently return.\n\tNow an error message is properly reported.\n\n2003-10-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Updated to Automake 1.7.8.\n\n\t* various: Edits to eliminate minor issues detected by SGI C compiler.\n\n\t* coders/ps3.c (WritePS3Image): Variable `value` was set but never\n\tused so it is removed.\n\n\t* magick/image.c (RGBTransformPacket): Removed inline request\n\tsince this function is too big to inline.\n\n\t* magick/animate.c (XAnimateBackgroundImage): Fixed a GCC 3.X\n\t\"type pinning\" warning.\n\n\t* magick/display.c (XDisplayBackgroundImage): Fixed a GCC 3.X\n\t\"type pinning\" warning.\n\n\t* magick/render.c (GetPixelOpacity): Removed inline directive.  No\n\tone in their right mind could ever imagine this function inlining\n\tsuccessfully.\t\n\n\t* magick/cache.c (IsNexusInCore): Adjusted so function inlines as\n\trequested.\n\n\t* coders/tiff.c (ReadTIFFImage): Improved logging information.\n\t(WriteTIFFImage): Changed the way the bilevel/grayscale logic\n\tworks.  Now bilevel images are treated similar to any other\n\tgrayscale image unless CCITT FAX3 or FAX4 compression is requested\n\t(which selects the MINISWHITE photometric).  The default is now to\n\twrite uncompressed bilevel images with MINISBLACK photometric.\n\n\t* PerlMagick/t/composite.t: Use some reasonable error values.\n\n\t* magick/image.c (GetImageDepth): Added special cases for\n\tcolormapped images and monochrome images in order to improve\n\tperformance.\n\n2003-10-09  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* NEWS: added info about color scaling, sampling-factor, and\n\tchanged a reference to \"-coder-options\" to \"-define\".\n\n2003-10-09  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* VisualMagick/bin/modules.mgk: added EPS3 mapping to PS3 module.\n\n\t* coders/ps3.c, coders/tiff.c, magick/command.c, magick/image.c,\n\tmagick/image.h, magick/utility.c: Changed -coder-options option to\n\t-define. Also renamed functions {Add,Remove,Access}CoderOption(s)\n\tto {Add,Remove,Access}Definition(s). Changed ps coder-specific\n\toption ps:image=imagemask to just ps:imagemask.\n\n2003-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/cineon.c: Imported and adapted Cineon image format coder\n\twritten by Kelly Bergougnoux <three3@users.sourceforge.net> with\n\tassistance from John Cristy.\n\n2003-10-08  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/jpeg.c: Extended -sampling-factor option to allow\n\tuser to supply full set of sampling factors.  If the full\n\tset is not supplied, omitted ones are 1x1 by default, similar\n\tto the behavior of \"cjpeg -sample\".\n\n\t* magick/command.c: Accept multiple pairs of sampling factors.\n\n2003-10-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Re-arranged logging for improved\n\toutput.  Cleaned up evaluation of SAMPLESPERPIXEL and\n\tBITSPERSAMPLE.  Provided support for the TIFF coder options\n\ttiff:samples-per-pixel and tiff:bits-per-sample for power users.\n\t(ReadTIFFImage): Colormap generation for PHOTOMETRIC_MINISBLACK\n\tand PHOTOMETRIC_MINISWHITE was inaccurate.  Seems to be accurate\n\tnow.\n\n\t* PerlMagick/t/reference/read/input.miff: Updated due to Glenn's\n\tchange to scale macros.\n\n\t* PerlMagick/t/tiff/input_gray_12bit.tiff: Replaced 12 bit image\n\twith a different one which is written by GraphicsMagick.\n\n\t* coders/ps3.c (WritePS3Image): Use AccessCoderOption().\n\n\t* magick/image.c (AccessCoderOption): Added a function to use for\n\taccessing coder-specific options.\n\n2003-10-08  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/attribute.c (TraceSVGClippingPath): optimized for speed\n\tand precision in clipping mask generation by using lines to\n\tconnect Bezier curve anchor points where applicable.\n\n2003-10-07  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Revised ScaleColor5to8 and ScaleColor6to8 macros again, to\n\tfill the low bits correctly.\n\n2003-10-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/tiff/read.t: Added 16-color and 256 color\n\tcolormapped tests with a matte channel.\n\n\t* PerlMagick/t/tiff/write.t: Added 16-color and 256 color\n\tcolormapped tests with a matte channel.\n\n\t* coders/tiff.c (WriteTIFFImage): When using LZW compression,\n\tapply the horizontal differencing predictor to RGB truecolor and\n\tdeep gray images since the TIFF spec says that LZW compression is\n\tusually improved by using horizontal differencing with continuous\n\ttone images.\n\tRe-implemented grayscale and colormapped scanline preparation to\n\tuse the new bit-stream interface.  This is a bit slower, but very\n\tflexible, and the implementation is very compact.  Writing of a\n\tmatte (transparency) channel is now believed to be correct for all\n\tdepths.\n\n\t* magick/command.c (MogrifyImage): Only transform the colorspace\n\tif it has been set (i.e. is not UndefinedColorspace).\n\n2003-10-06  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/png.c (ReadOnePNGImage): PNG decoder would exit too\n\tearly when reading image.png[0].\n\n2003-10-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/tiff/write.t: Added TIFF write tests for 4\n\tbits-per-sample TIFF images, both with and without a transparency\n\tchannel.\n\n\t* magick/image.c (DescribeImage): Added -verbose support for\n\tdisplaying individual channel depths.\n\n2003-10-06  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/image.c (SetImageInfo): cleaned up parsing of subimage\n\tspecification (image.psd[0]). It would fail sometimes due to\n\tincorrect reuse of variables. It's a bit strange the code accepts\n\tmore range syntax-variations than can be stored in ImageInfo.\n\n2003-10-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (ChannelImage): The OpacityChannel, MatteChannel,\n\tand BlackChannel operations set the matte channel to opaque, so\n\tset image->matte to False for those operations.\n\t(RGBTransformImage): Add an assertion to prevent passing the\n\tcolorspace argument `UndefinedColorspace`.\n\t(TransformRGBImage): Add an assertion to prevent passing an image\n\twith colorspace set to `UndefinedColorspace`.\n\n2003-10-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (LogToBlob): Since MagickSeek(file,0,SEEK_END) is\n\tused to obtain the Blob size, MagickSeek(file,0,SEEK_SET) must be\n\tused to restore the seek position.  Thanks to John Cristy for\n\tbringing this to our attention.\n\n2003-10-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/bit_stream.h: Added a bit-stream writer function.\n\n\t* PerlMagick/t/reference/read/input_tim.miff: Reference image\n\twas defective.\n\n2003-10-03  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/image.c, magick/image.h: Updated AddCoderOptions to\n\taccept \"flag\" keys that have no values. They are placed in the\n\tcoder options map with an empty, zero length string value. Option\n\targument syntax is now: \"key1[=[value1]],key2[=[value2]],...\"\n\n2003-10-03  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/command.c: Updated +coder-options option to not clear the\n\tentire map of coder options, but accept a list of names to remove\n\tfrom the map. Use option argument \"*\" to clear the entire map of\n\tcoder options.\n\n\t* magick/image.c, magick/image.h: Added function\n\tRemoveCoderOptions. Added cast of signed char to unsigned char and\n\tint in calls to isspace and isprint.\n\n\t* magick/utility.c: Added cast of signed char to unsigned char and\n\tint in calls to isspace and isprint. Added special handling of\n\t+coder-options option in ExpandFilenames function.\n\n2003-10-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/reference/read/input_tim.miff: The TIM read results\n\tchanged somewhat due to Glenn's ScaleColor5to8 fix.\n\n2003-10-01  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Revised ScaleColor5to8 and ScaleColor6to8 macros to fill in the\n\tlow bytes.\n\n\t* coders/bmp.c (ReadBMPImage): scaling of 8-8-8-8-bit images was\n\talso slightly incorrect.\n\n2003-09-30  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/bmp.c (ReadBMPImage): scaling of 5-5-5-bit and 5-6-5-bit\n\timages was slightly incorrect.\n\n2003-09-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): When using the generic bit-stream\n\tmarshaller to read colormapped/gray images, the slight performance\n\timprovement from creating a special case for matte images did not\n\tjustify almost doubling the amount of code.  Therefore, the two\n\tloops are combined back into one.\n\n2003-09-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Fixed reading grayscale TIFFs\n\tthat have a transparency channel. Now uses a generic bit-stream\n\tmarshaller to allow reading any grayscale or colormapped TIFF with\n\tany bits per sample in the range of 1 to 16.\n\n\t* magick/bit_stream.h: Added a generic implementation for\n\tmarshalling from a bit-stream into a quantum.  Still needs\n\tre-writing for best performance.\n\n\t* PerlMagick/t/tiff/read.t: Added a test case for reading 8-bit\n\tgrayscale TIFF with matte.  Corrected grayscale 12-bit read\n\tsignatures.  Added 16 color PseudoClass read test.  Added 4-bit\n\tgrayscale read test.\n\n2003-09-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Add support for writing\n\tDirectClass grayscale images at 4 bits per sample, including those\n\twith an opacity channel.  This allows writing smaller files\n\t(half the size) when the image has 16 (or less) levels of gray.\n\tUse \"gm convert inimage.tiff -depth 4 outimage.tiff\" to quickly\n\tcreate grayscale TIFF file with 16 (or less) levels of gray.\n\n2003-09-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS: Updated NEWS file with changes since last update.\n\n\t* index.html: Added a link to the www/AUTHORS.html file, as well\n\tas text stating that GraphicsMagick is originally derived from\n\tImageMagick 5.5.2, with a link to the ImageMagick site.\n\n\t* Makefile.am: Add rules to generate www/AUTHORS.html.\n\n\t* www/AUTHORS.html: New HTML file based on the AUTHORS file in the\n\tsource package.  GraphicsMagick has many authors.\n\n2003-09-25  William Radcliffe  <billr@corbis.com>\n\t* magick/image.c: Updated DescribeImage to cleanup EXIF data display\n\tbased on work by Cristy in ImageMagick.\n\n2003-09-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Add support for writing\n\tcolormapped TIFF images with 1, 2, & 4 bits per colormap index.\n\tThis allows writing smaller files.\n\n2003-09-24  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* coders/ps3.c: Now creates a correct %%BoundingBox for images\n\twith resolution stored as pixels per centimeter. Renamed serialize\n\tfunctions. Added comment headers where they were\n\tmissing. Reformatted code to be in alignment with GraphicsMagick\n\tstandard formatting.\n\n\t* magick/map.c: Fixed semaphore double locking problem in\n\tMagickMapCloneMap.\n\n2003-09-23  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick/readme.txt : Updated compilation instructions.\n\n\t* BCBMagick/magick/libMagick.bpr : Updated project, now include map.c.\n\n\t* BCBMagick/lcms/Projects/BCB6/lcms.bpr : Updated project, now\n\tinclude cmscam02.c and cmsvirt.c.  Much thanks to Alex Dvoretsky\n\tfor bringing this problem to my attention.\n\t\n2003-09-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h (Image): Moved private members to bottom of\n\tstructure.\n\t(_ImageInfo): Moved private members to bottom of\n\tstructure.\n\n\t* magick/Makefile.am (pkginclude_HEADERS): Don't install\n\tsemaphore.h.\n\t(noinst_HEADERS): Distribute map.h and semaphore.h.\n\n\t* magick/image.h (ImageInfo): Change coder_options member from\n\ttype `MagickMap` to type `void *`.\n\n\t* coders/png.c: include magick/semaphore.h.\n\n\t* magick/blob.c: include magick/semaphore.h.\n\n\t* magick/color.c: include magick/semaphore.h.\n\n\t* magick/constitute.c: include magick/semaphore.h.\n\n\t* magick/delegate.c: include magick/semaphore.h.\n\n\t* magick/log.c: include magick/semaphore.h.\n\n\t* magick/magic.c: include magick/semaphore.h.\n\n\t* magick/magick.c: include magick/semaphore.h.\n\n\t* magick/module.c: include magick/semaphore.h.\n\n\t* magick/semaphore.c: include magick/semaphore.h.\n\n\t* magick/stream.c: include magick/semaphore.h.\n\n\t* magick/tempfile.c: include magick/semaphore.h.\n\n\t* magick/type.c: include magick/semaphore.h.\n\n\t* magick/blob.h (_BlobInfo): Changed `Semaphore *` to `void *`.\n\n\t* magick/cache.h (_CacheInfo): Changed `Semaphore *` to `void *`.\n\n\t* magick/image.h (_Image): Changed `Semaphore *` to `void *`.\n\n\t* magick/command.c: Updated each invokation of MagickMapAddEntry()\n\tto add an exception argument.\n\n\t* tests/maptest.c: Updated to pass an exception argument to\n\tMagickMapAddEntry.\n\n\t* magick/image.c (AddCoderOptions): Added exception argument\n\tand some more error handling.\n\n\t* magick/map.c: Added formal documentation for methods.\n\t(MagickMapCloneMap): Added exception argument.\n\t(MagickMapAddEntry): Added exception argument and status.\n\n2003-09-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/emf.c: Changed NotAnEMFFile to ImproperImageHeader.\n\n\t* magick/map.h: Changed all size parmeters from type `unsigned\n\tlong` to `size_t`.\n\n\t* magick/map.c (MagickMapCopyBlob): Add new function to support\n\tcopying a Blob in a MagickMap.\n\t(MagickMapDeallocateBlob): Add new function to support\n\tdeallocating a Blob in MagickMap.\n\n2003-09-23  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* coders/ps3.c: Fixed handling the case when no -coder-options are\n\tprovided to the PS3 coder.\n\n2003-09-22  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* coders/ps3.c: Changed %%Creator version to use\n\tMagickLibVersionText, increased precision in HiResBoundingBox,\n\tadded a coder specific option for rendering bilevel images with\n\tthe PS imagemask operator indstead of the image operator.  \n\n\t* magick/command.c: Added \"-coder-options\" command line argument\n\tto all relevant command line utilities. Option argument to\n\t-coder-options is a list of comma separated key-value pairs that\n\tare saved in a MagickMap in ImageInfo for (de-)coders to use. See\n\tPS3 coder for an example that checks for: -coder-options\n\t\"ps:image=imagemask\"\n\n\t* magick/image.c, magick/image.h: Added function AddCoderOptions().\n\n\t* magick/map.c, magick/map.h: removed MS-DOS line terminators.\n\n2003-09-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/maptest.c (main): Test/demo program for key,value map API.\n\n\t* magick/map.c, magick/map.h: Implementation of a key,value map\n\tAPI for internal use.\n\n2003-09-19  William Radcliffe  <billr@corbis.com>\n\n\t* lcms/include/icc34.h lcms.h: Added back the icc34.h header and\n\tchanges to make lcms compile on Win32\" icc34.h lcms.h.\n\n2003-09-19  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* coders/ps3.c: Fixed warnings from Solaris compiler.\n\n2003-09-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* locale/C.mgk: Eliminated the many \"NotA\" messages since they may\n\tall be considered forms of \"ImproperImageHeader\".  It is useful to\n\tprovide the origin of such messages in case the wrong coder has\n\tbeen invoked, however, this is expensive to do via the message\n\tdatabase since it explodes the number of messages.  The exception\n\tlogging can help here.  Once the exception reports include the\n\treporting entity, it will be more clear when the software\n\tmisbehaves.\n\n\t* magick/error.h (ThrowReaderException2): Remove since no longer\n\tused.\n\t(ThrowReaderException): Simplified implementation so that\n\tThrowException is not expanded twice.\n\n\t* magick/error.h (ThrowReaderException3): Remove since never used.\n\n\t* coders/xtrn.c (ReadXTRNImage): Use ThrowReaderException rather\n\tthan ThrowReaderException2.\n\n\t* locale/C.mgk (MissingArgument) Updated to include %s so that the\n\tdescription field appears earlier in the message.\n\n\t* magick/error.c (DefaultErrorHandler): Added a hack to allow the\n\t`reason` member to include a %s so that it may specify the\n\tformating of the message.  Care should be taken to not over-use\n\tthis hack.\n\n2003-09-18  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* coders/ps3.c: Major update of the PS3 coder. Now ascii85 encodes\n\tall binary data. Many printer spoolers don't like the binary\n\tdata. The coder now creates much smaller files for bilevel, gray,\n\tand colormapped images. Compression and image type is now\n\tseparated so they may be combined independently. Any alpha channel\n\tis separated into a separate mask so it's possible to mask\n\tbilevel, gray, colormapped, rgb, and CKYK images. You may also\n\tmask a JPEG compressed PS file for instance. Clipping masks\n\tcreated from a photoshop clipping path with -clip option is\n\tconverted to a corresponding postscript clipping path.  New\n\tfunctions need comment headers.\n\n\t* magick/attribute.c: Added TracePSClippingPath for creating a\n\tpostscript clipping path from a photoshop clipping path.\n\n\t* magick/compress.c, magick/compress.h: Added write-hook based\n\tinterface to compression functions. Required for ascii encoding\n\tcompressed, binary data. The interface between blob write\n\tfunctions, compression functions, and encoding functions could\n\tbenefit from more of this work.\n\n\t* magick/image.c: ClipPathImage now stores the name of the\n\tclipping path in the mask image filename so that it is remembered\n\tand may be used for creating a postscript clipping path for\n\tpostscript output.\n\n\t* coders/modules.mgk: Added EPS3 mapping to module PS3.\n\n2003-09-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Coalesced various \"Missing\" error reports into\n\tone \"MissingArgument\" error report in order to reduce the number\n\tof messages to be maintained.\n\n\t* locale/C.mgk: Removed almost all \"Missing\" messages.\n\n\t* magick/gm_messages.mc: Added Microsoft message compiler source\n\tfile to CVS until which time it may be generated automatically\n\tduring the build.\n\n2003-09-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* locale/Makefile: Added ability to generate gm_messages.mc\n\t(for Windows message compiler) as well as adding `clean` and\n\t`install` targets.\n\n\t* magick/delegate.h: Visual Studio .NET 2003 doesn't like\n\tthe chaining of GhostscriptVector members which share a\n\tcommon return type. Splitting the definitions solves this\n\tproblem.\n\n2003-09-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/deprecate.h (MagickSignedType): Compatibility definition\n\tto handle ImageMagick API change.\n\t(MagickUnsignedType): Compatibility definition to handle\n\tImageMagick API change. The new names are just as useless as the\n\told names, but at least they are shorter.\n\n\t* magick/command.c: Linux's sscanf has the terrible bug that it\n\timproperly handles pulling out the first floating value from the\n\tstring \"0x1\".  Instead of retrieving the value 0 and returning 1,\n\tit returns 0, probably because it rejects the string as a hex\n\tconstant. As a result, all options which used sscanf to validate\n\tthis input are now converted to use IsGeometry().\n\n2003-09-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ltdl/ltdl.c: Update to libltdl current as of today.\n\n\t* ltmain.sh: Update to libtool current as of today.\n\n\t* configure.ac: For HPUX C++ compiler, add -AA to CXXFLAGS rather\n\tthan CXX.\n\n2003-09-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Decided that the standards conformance\n\tdefines create more problems than they solve so they are\n\tremoved.\n\tMove the large-file tests to before the libtool configuration\n\tsince the libtool configuration was causing stdlib.h to be\n\tincluded prior to the large file defines, and this causes\n\theader failure with C++ under AIX.\n\n\t* www/api/types.html: Update description of MonitorHandler.\n\n2003-09-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Set CXX to PTHREAD_CXX if necessary (and warn).\n\n\t* acinclude.m4 (ACX_PTHREAD): Add check to see if xlC_r should be\n\tused for AIX.\n\n2003-09-10  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/render.c: Fixed handling of arc primitive (see IM-5.5.8).\n\n2003-09-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.h: It seems that test programs are using\n\tGetMagickModule so make it visible by default.\n\n\t* configure.ac: Use GM_FUNC_MMAP_FILEIO macro to test mmap.\n\n\t* acinclude.m4 (GM_FUNC_MMAP_FILEIO): New macro to test mmap's\n\tcapability to do coherent file I/O.  The AC_FUNC_MMAP macro\n\twas not testing the mmap features that GraphicsMagick uses, and\n\twas failing on a number of systems.\n\n\t* magick/blob.c (BlobMapModeToString): Only include this static\n\tfunction if HAVE_MMAP is defined.\n\n\t* coders/locale.c (WriteLOCALEImage): Fix FormatString argument\n\ttype inconsistencies.\n\n\t* wand/magick_compat.h: Change MagickExport to WandExport.\n\n\t* coders/jpeg.c, coders/locale.c, coders/meta.c, coders/miff.c,\n\tcoders/palm.c, coders/pict.c, coders/svg.c, coders/tiff.c,\n\tcoders/topol.c, magick/cache.c, magick/display.c, magick/image.c,\n\tmagick/widget.c: Removed unused values, changed storage types, or\n\tadded explicit casts, in order to reduce the number of \"REMARK\"s\n\twhen using the SGI IRIX compiler.\n\n\t* magick/render.c (DrawClipPath): Fix memory leak of\n\tclone_info->clip_path.  Problem reported by Vladimir\n\t<lvm@integrum.ru>.\n\t(DestroyDrawInfo): Remove unnecessary checks for non-null prior to\n\tinvoking MagickFreeMemory. MagickFreeMemory already checks for\n\tnon-null.\n\n\t* magick/log.h (GetCurrentFunction): Apparently Visual C++ 6.0\n\tdoes not support __FUNCTION__.  Problem reported by Vladimir\n\t<lvm@integrum.ru>.\n\n\t* wand/magick_compat.c: All functions in magick_compat.c must use\n\tWandExport rather than MagickExport. Fix recommended by Vladimir\n\t<lvm@integrum.ru>.\n\n\t* magick/constitute.c (PushImagePixels): number_pixels was always\n\tcast to a long during use, so change to store value in a long\n\tinstead.\n\t(PopImagePixels): number_pixels was always\n\tcast to a long during use, so change to store value in a long\n\tinstead.\n\n2003-09-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/psd.c: Eliminated warning regarding unused initialized\n\tvariable.\n\n\t* magick/log.c: Eliminate type warnings regarding enum assignment.\n\n\t* coders/locale.c (WriteLOCALEImage): Use UndefinedException\n\trather than 0 in severity_list terminating entry in order to avoid\n\ta type conversion warning.\n\n\t* magick/image.c (SetImageChannelDepth): Depth parameter was being\n\treturned rather than status.  Oops!\n\n\t* magick/effect.c (BlurScanline): Due to automatic casting\n\tconventions, computation was being done (at least with SGI\n\tcompiler) as type `unsigned long` rather than `long` as it should\n\thave been.\n\n\t* coders/jpeg.c, coders/meta.c, coders/miff.c, coders/msl.c,\n\tcoders/palm.c, coders/pcd.c, coders/psd.c, coders/svg.c,\n\tcoders/tiff.c, coders/xcf.c, magick/render.c, : Quench many SGI\n\tcompiler warnings regarding variables which are initialized but\n\tnever used.\n\n\t* magick/xwindow.h: Undef gravity defines so that enumerated type\n\tis used instead.\n\n2003-09-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (LogMagickEvent): Windows system logging\n\tfunctionality is not currently ported to work with Cygwin so\n\tdisable when compiling under Cygwin.\n\n\t* magick/log.c (Win32EventlogOutput): Remove spurious comma in enum.\n\n\t* wand/drawing_wand.h: Remove junk comment marker that I forgot to\n\tremove.\n\n\t* magick/studio.h: Provide prototypes for strlcpy and vsnprintf if\n\tthe system doesn't provide them in the requested compilation\n\tenvironment.\n\n\t* configure.ac: Add necessary standards compilance definitions to\n\tmagick_config.h.\n\tCheck for strlcpy and vsnprintf prototypes.\n\n\t* Makefile.am (DOCDIRS): www/api/types does not exist anymore.\n\n2003-09-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Move multithread tests prior to libtool\n\tconfiguration in case value of CC is changed.  Otherwise libtool\n\tgets confused and refuses to run.\n\n\t* acinclude.m4 (ACX_PTHREAD): If using AIX CC `xlc` use `xlc_r`\n\tfor multithread compiler.\n\n\t* coders/jpeg.c: Undef HAVE_STDLIB_H before including the\n\tjpeg headers or else we get an already defined error/warning.\n\n2003-09-04  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick : Updated whole directory tree to achieve correct\n\tcompilation with Borland C++ Buider 6.0.\n\n2003-09-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (ClipPathImage): Remove MS-DOS line terminations\n\t(actually, extra carriage returns) which somehow crept into\n\tClipPathImage.\n\n\t* locale/C.mgk: Added message for \"PNG library is too old\".\n\n2003-09-04  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/transform.c (ProfileImage): Bugfix: conditional\n\tcompilation based on LCMS being present or not now works as\n\texpected. An exception is thrown if LCMS is not present and\n\tprofile conversion is used.\n\n2003-09-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/txt.c (ReadTXTImage): Fix strlen() pointer type warning.\n\n\t* magick/image.c (TextureImage): Fixed return with no value warning.\n\n\t* magick/color.c (GetColorInfoArray): Decided that the const\n\treturn value was a bad idea.  Therefore, the return type has been\n\tmade non-const.\n\n\t* magick/magick.c (GetMagickInfoArray): Decided that the const\n\treturn value was a bad idea.  Therefore, the return type has been\n\tmade non-const.\t\n\n\t* tests/constitute.c, tests/rwblob.c, tests/rwfile.c : Define\n\tMAGICK_IMPLEMENTATION since these test programs using some internal\n\textensions.\n\n\t* configure.ac: Test C++ compiler for __func__ support.\n\n\t* magick/log.h: Added GetCurrentFunction() macro to handle\n\t__func__ support determination.  Re-wrote GetMagickModule() macro\n\tto use GetCurrentFunction().  Changes should allow compilation of\n\tMagick++ when the C compiler supports __func__ but the C++\n\tcompiler does not.\n\n\t* configure.ac: Changed from using HAS___func__ define to\n\tHAS_C__func__ since this feature may be language sensitive.\n\n\t* locale/C.mgk: Added missing JNGCompressionNotSupported message.\n\n2003-09-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (Generate8BIMAttribute): Fix sscanf argument\n\ttype mis-match.\n\n\t* coders/ps3.c (ZLIBEncodeImage): Fix mis-classified\n\tZipLibraryIsNotAvailable error report.\n\n\t* coders/url.c (RegisterURLImage): Only register URL format\n\tsupport if libxml2 is available.\n\n\t* coders/msl.c (RegisterMSLImage): Only register MSL format\n\tsupport if libxml2 is available.\n\n2003-09-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/histogram.c (WriteHISTOGRAMImage): Remove a useless loop.\n\n\t* coders/wpg.c: Applied patch from Fojtik Jaroslav to support\n\treading WPGs which use the EXT token.\n\n2003-08-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/color.c (HistogramToFile): Renamed static method\n\t`Histogram` to `HistogramToFile` to make it more clear what this\n\tfunction does.\n\t(GetColorHistogram): Added new function to support retrieving a\n\tcolor histogram of the image.  A color histogram contains a count\n\tof how many times each color occurs in the image.\n\n\t* magick/image.c (GetImageChannelDepth): Return an `unsigned int`\n\trather than `long`.\n\n2003-08-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: Add support for CopyCyan, CopyMagenta,\n\tCopyYellow, and CopyBlack, composition operators.\n\n\t* magick/composite.c (CompositeImage): Added support for\n\tCopyCyanCompositeOp, CopyMagentaCompositeOp,\n\tCopyYellowCompositeOp, and CopyBlackCompositeOp, composition\n\toperators.\n\n2003-08-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/*: Updated to current ImageMagick Wand API (minus a few\n\tunimplemented functions).\n\n\t* magick/image.c (TextureImage): Add status return because Wand API\n\twants it.  Inherit is_grayscale status from texture image.\n\n\t* magick/fx.c (SolarizeImage): Add status return because Wand API\n\twants it.\n\n\t* magick/resource.c (SetMagickResourceLimit): Add status return\n\tbecause Wand API wants it.\n\n\t* magick/draw.c (DrawPeekGraphicContext): Now returns a\n\tcopy of the current DrawInfo context rather than returning\n\ta pointer into the context stack. The user must destroy\n\tthis copy using DestroyDrawInfo() once it is no longer\n\tneeded.\n\n2003-08-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/filters/LIBRARY.txt: This file is necessary to\n\tincorporate analyze.c into the static build.  Without it the\n\tbuild fails.\n\n2003-08-23  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/transform.c: ProfileImage updated to handle alpha\n\tchannels and grayscale images. Also optimized color profiling of\n\tcolor mapped images and fixed a few bugs in profiling of CMYK\n\timages.\n\n\t* magic/locale_c.h: added MagickExport to prototype declaration of\n\tGetLocaleMessageFromID in WriteLOCALEImage again. Please update\n\tyour locale coder.\n\t\n2003-08-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c: Applied patch from Fojtik Jaroslav to use the\n\tGetMagicInfo() function to obtain the format of embedded images,\n\tand to provide a default WPG palette if the WPG file does not\n\tsupply a palette.\n\n2003-08-22  William Radcliffe  <billr@corbis.com>\n\n\t* magick\\gm_messages.bin locale_c.h transform.c: Fixed missing\n\tmessage problem and added support for new lcms error handler.\n\n2003-08-21  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/attribute.c, magick/image.c, magick/command.c: Added\n\t\"clippath\" option for clipping named Photoshop clipping paths,\n\tincreased precision in clipping path knots, added comments, and\n\tfixed a few bugs resulting from moving TraceClippingPath function\n\tfrom ImageMagick to GraphicsMagick. Still need to update some of\n\tthe documentation.\n\n\t* magick/locale_c.h, magick/studio.h: added MagickExport to\n\tdeclaration of GetLocaleMessageFromID and moved include of\n\tmagick/locale_c.h after declaration of MagickExport. This fixes a\n\tlink error in dynamic, DLL version.\n\n\t* coders/locale.h: added MagickExport to prototype declaration of\n\tGetLocaleMessageFromID in WriteLOCALEImage.\n\n2003-08-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/subroutines.pl (testRead): Ignore useless TIFF\n\twarning so that 12-bit TIFF test passes.\n\n\t* magick/constitute.c (ReadImage): Ensure that the reported image\n\tmagic string is that of the user-specified input file rather than\n\ta temporary file prepared by an external delegate program.\n\n\t* magick/command.c (ImportImageCommand): Since\n\tDestroyExceptionInfo() now sets the destroyed exception signature\n\tto an invalid value, GetExceptionInfo(exception) must be invoked\n\twhen the intention is to simply purge the exception.  This fix\n\tresolves an abort when executing `gm import`.\n\n2003-08-18  William Radcliffe  <billr@corbis.com>\n\n\t* magick\\gm_messages.bin locale_c.h transform.c: Updates that\n\tadd latest enhancments by Lars to color management code in\n\tProfileImage.\n\n2003-08-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c: Incorporated patch from Fojtik Jaroslav to support\n\trendering embedded WMFs.\n\n2003-08-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageChannelDepth): New function to transform\n\tthe specified channel so it fits the specified modulus depth.\n\n\t* magick/blob.c (BlobToImage): Skip calling SetImageInfo() if\n\tmagick is already set.\n\n2003-08-18  William Radcliffe  <billr@corbis.com>\n\n\t* PerlMagick/Magick.xs: Some fixes to get PerlMagick compiling\n\tagain due to new ID based error macros.\n\n2003-08-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/error.h (enum): Remove spurious comma.\n\n2003-08-17  William Radcliffe  <billr@corbis.com>\n\n\t* coders\\png.c: Had to modify a few exception calls to work with\n\tnewest macros.\n\n2003-08-17  William Radcliffe  <billr@corbis.com>\n\n\t* coders\\locale.c magick/error.h locale.c locale_c.h studio.h:\n\tThe LOCALEH header file generator now adds an MGK_ prefiix to\n\tall the ID defines as part of a fix to support the new error\n\tand exception macros cross platform.\n\n2003-08-16  William Radcliffe  <billr@corbis.com>\n\n\t* wand\\magick_wand.c pixel_wand.c: The wand api code was totally\n\tleft out of the large macro conversion below as an oversight.\n\n2003-08-15  William Radcliffe  <billr@corbis.com>\n\n\t* .\\coders art.c avi.c avs.c bmp.c caption.c clipboard.c cmyk.c\n\tcut.c dcm.c dib.c dps.c dpx.c emf.c ept.c fax.c fits.c fpx.c gif.c\n\tgradient.c gray.c hdf.c histogram.c html.c icon.c jbig.c jp2.c\n\tjpeg.c label.c locale.c logo.c map.c mat.c matte.c meta.c miff.c\n\tmono.c mpc.c mpeg.c msl.c mtv.c mvg.c null.c otb.c palm.c pcd.c\n\tpcl.c pcx.c pdb.c pdf.c pict.c pix.c png.c pnm.c preview.c ps.c\n\tps2.c ps3.c psd.c pwp.c rgb.c rla.c rle.c sct.c sfw.c sgi.c\n\tstegano.c sun.c svg.c tga.c tiff.c tile.c tim.c topol.c ttf.c txt.c\n\tuil.c url.c uyvy.c vicar.c vid.c viff.c wbmp.c wmf.c wpg.c x.c xbm.c\n\txc.c xcf.c xpm.c xtrn.c xwd.c yuv.c .\\magick\\animate.c annotate.c\n\tblob.c cache.c cache_view.c color.c color.h command.c compress.c\n\tconstitute.c decorate.c delegate.c display.c draw.c effect.c\n\tenhance.c error.c error.h fx.c gm_messages.bin image.c list.c\n\tlocale.c locale_c.h log.c mac.c magic.c magick.c module.c montage.c\n\tnt_feature.c paint.c quantize.c registry.c render.c resize.c\n\tsegment.c semaphore.c shear.c signature.c static.c static.h\n\tstream.c studio.h tempfile.h transform.c type.c utility.c widget.c\n\txwindow.c : Changes to support ID based message access and checking\n\tall message usages. The main thing that was done was to remove all\n\tthe quotes around the \"tags\" used to lookup messages defined in\n\tthe locale\\C.XML file. Macros were added to error.h to allow the\n\tcode to be compiled for either string based access or binary ID\n\tbased access. Using binary ID's will cause the code to fail to\n\tcompile if a message does not exist in C.XML, since no ID will be\n\tcreated for a missing message. This change then allowed us to\n\teasily track down all the messages that were \"missing\" or not\n\tbeing accessed properly. The problems were massive and took many\n\tdays to resolve. I have left the code compiling in ID mode to keep\n\tthings in sync going forward and also because it makes message\n\tlookup instantaneous. An ID is just an index into and array of\n\tchar *'s. There is still a lot of cleanup work remaining, but this\n\tis a very good start. \n\n2003-08-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/error.c (GetLocaleExceptionMessage): Add check to avoid\n\tduplicating severity prefix.\n\n\t* magick/log.c (LogMagickEvent): Incorporated fix from Bill\n\tRadcliffe to enable logging control flags to work properly again.\n\n\t* NEWS: Updated news.\n\n\t* magick/blob.c (OpenBlob): Rewind file descriptor so that first\n\tread is at zero offset. This fixes reading GIFs via a\n\tuser-provided file handle.\n\n2003-08-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (GetImageDepth): Extend so that the actual\n\tminimum depth required to represent the image is\n\treturned. Previously only the values 8, 16, and 32 were\n\treturned. This means that a value of one is returned for a\n\tmonochrome image. Also fixed a bug in that the pixels were\n\tincremented while the depth was incremented, resulting in the\n\tfirst image pixels not being properly evaluated for depth.\n\t(SetImageDepth): Extend to support converting the image to\n\tarbitrary modulus depths.\n\t(GetImageChannelDepth): New function to obtain the modulus depth\n\tfor a specified image channel.\n\n2003-08-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/draw.c (MvgAutoWrapPrintf): StreamError reported when\n\tDrawError was intended.\n\n\t* coders/logo.c (ReadLOGOImage): Report FileOpenError rather than\n\tBlobError if requested image does not exist.\n\n2003-08-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/cache.c (PersistCache): If HAVE_SYSCONF and _SC_PAGE_SIZE\n\tare defined, then assume that sysconf works and don't use legacy\n\tgetpagesize() function.\n\n\t* magick/studio.h (_XOPEN_SOURCE): Should be defined as 600 in\n\torder to match _POSIX_C_SOURCE=200112L according to the Single\n\tUNIX Specification v3.  This is necessary for the vsnprintf\n\tprototype to be visible.\n\n\t* magick/attribute.c (ReadByte): Fix compilation warnings due to\n\tcasting `unsigned char *` to `char *` by changing function\n\tdefinition to accept `unsigned char *` instead.\n\n\t* magick/error.h (UndefinedException): UndefinedException should\n\tbe ExceptionType, not ExceptionBaseType.\n\n\t* magick/magick.c (IsValidFilesystemPath): Eliminate warning about\n\tunused function when UseInstalledMagick is defined.\n\n\t* magick/error.c (ThrowLoggedException): Fix improper parameters\n\tpassed to LogMagickEvent() when reason is not available.\n\n003-08-07  William Radcliffe  <billr@corbis.com>\n\n\t* magick/log.c, log.h: Added ability to log by either severity\n\tor by category of event. Made the defualt on windows to log all\n\tfatal errors, errors, and warnings to the event log. This will\n\tinclude anything generated by exceptions currently, but not any\n\tnormal \"informational\" logging.\n\n2003-08-07  William Radcliffe  <billr@corbis.com>\n\n\t* magick/log.c, log.h: Translation of event codes to mask vals\n\twas not working. Code was left out of last update. It is now in.\n\n2003-08-07  William Radcliffe  <billr@corbis.com>\n\n\t* magick/error.c: Protect against NULL string passed into the\n\tmessage lookup function.\n\n2003-08-07  William Radcliffe  <billr@corbis.com>\n\n\t* magick/locale.c: Switched use of IsAccessible to nonloggging\n\tversion to prevent recursive problems.\n\n2003-08-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/Makefile.am (noinst_HEADERS): Distribute locale_c.h.\n\n\t* locale/Makefile: Output locale_c.h.\n\n\t* utilities/gm.c (main): Fix typo in Unix InitializeMagick\n\tinvocation.\n\n\t* configure.ac: Use ACX_PTHREAD pthreads test macro.\n\n\t* magick/(semaphore.c,spinlock.h,studio.h): Change HasPTHREADS\n\tconditional define to HAVE_PTHREAD.\n\n\t* magick/Makefile.am (noinst_HEADERS): Include spinlock.h in\n\tdistribution.\n\n2003-08-06  William Radcliffe  <billr@corbis.com>\n\n\t* contrib\\win32\\ATL7\\ImageMagickObject/ImageMagickObject.cpp,\n\tImageMagickObject_.h, ImageMagickObject.def, ImageMagickObject.rc\n\tgm.rc: Changes to get things compiling again since all windows\n\tspecific logging support has been eliminated. The special build\n\tscript BuildImageMagickObject.cmd now compiles the message file\n\tfor resource based messages. The result is in gm_messages.bin.\n\tThe script also generates a special version of gm.exe that uses\n\tthe COM dll as a regular DLL and links to it. This is the long\n\tdesired Moby DLL build idea.\n\n\t* magick/error.c, magick/error.h, magick/log.c, magick/log.h:\n\tUpgrade of logging system to take over previous special logging\n\tcode for windows in nt_base.c. The new logic provides logging of\n\tevents to the debug api and the windows event log and also\n\tprovides a generic text file logging method.\n\n\t* magick/gm_messages.bin, magick/ImageMagick.rc: New compiled\n\tmessage file based on data in locale\\C.mgk. RC file modified to\n\tinclude this as a resource.\n\n\t* magick/locale.c, magick/locale_c.h: locale_c.h is generated by\n\tthe LOCALEH format of the locale coder. The logic in locale.c uses\n\tthe tables in the header lookup messages. On windows, all the\n\tmessages are stored as resources, while on UNIX they remain in a\n\tstring table.\n\n\t* locale/C.mgk: Removed duplicate messages and added some new\n\tdefault messages that help to create a complete set of severity\n\tstrings.\n\n\t* magick/command.c, magick/magick.c: Get rid compiler warnings.\n\n2003-08-05  William Radcliffe  <billr@corbis.com>\n\n\t* magick/command.c, magick/gm.c: Application level changes to\n\timplement the client name - filename changes. The client name can\n\tnow be anything that the application wants and has nothing to do\n\twith the saved filename of the application.\n\n\t* magick/nt_base.c, magick/nt_base.h, magick/magick.c: Ripped out\n\told nt specific debugging and logging logic. Moving to the\n\tstandard logging. New and major revisions to InitializeMagick to\n\tmake the code more maintainable, reliable, and reaable. It should\n\tbe functionally identical, but implements the new split client\n\tname and filename methododology.\n\n\t* magick/utility.c, magick/utility.h: Added a couple of new\n\troutines to support splitting the overloaded use of the client\n\tname and client filename.\n\n\t* coders/xtrn.c: Minor code cleanup\n\n2003-08-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Copyright.txt: Added missing copyright notice which is required\n\tdue to copying the rlecomp manual page into ImageMagick.\n\n\t* doc/config_files.imdoc: Started documentation for configuration\n\tfiles.\n\n\t* magick/xwindow.c (XSignalHandler): Ensure that segment_info is\n\tnon-null before attempting to use it.  Much thanks to John Cristy\n\tfor bringing this problem to our attention.\n\n2003-08-05  William Radcliffe  <billr@corbis.com>\n\n\t* coders/locale.c: Added several new formats to this coder to\n\tgenerate windows message resource format messages and also to\n\tgenerates a new header file format that will support a table based\n\tversion of the other magick/locale.c.\n\n\t* coders/xtrn.c: Minor code cleanup\n\n2003-08-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Only configure C and C++ libtool tags.\n\n\t* PerlMagick/t/reference/composite/*.miff: Added some composition\n\ttest reference images.  These reference images will serve as\n\tplaceholders until better composition tests can be figured out.\n\tIt is not clear from the documentation what some of the\n\tcomposition operators are supposed to do.\n\n2003-08-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* README.txt: Add documentation regarding using TRIO.\n\n\t* configure.ac: Test for TRIO library if vsnprintf is not\n\tavailable.\n\n\t* magick/studio.h: Remap vsnprintf to trio_vsnprintf if TRIO is\n\tavailable.\n\n\t* coders/topol.c, coders/wmf.c, magick/magick.c, magick/nt_base.c,\n\tmagick/resource.c: Use traditional C comment form in C source\n\tfiles.\n\n2003-07-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.h (LogEventType::AllEvents): Increase the value of\n\tAllEvents so that it spans the complete positive range of a signed\n\tinteger.\n\n\t* magick/xwindow.c, magick/xwindow.h: Incorporate patch from John\n\tCristy's ImageMagick to eliminate conditional dependence of\n\tmagick/xwindow.h on <X11/extensions/XShm.h>.\n\n\t* magick/magick_config_api.h.in: HasSharedMemory define no longer\n\tneeded.\n\n2003-07-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/programming.html: Update Rmagick URL.\n\n\t* GraphicsMagick.spec.in : Update according to instructions from\n\tTroy Edwards.\n\n2003-07-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* GraphicsMagick.spec.in: Replaced GraphicsMagick.spec with\n\tGraphicsMagick.spec.in, which is configured to produce\n\tGraphicsMagick.spec.\n\n\t* configure.ac: Configure GraphicsMagick.spec.\n\n2003-07-29  Troy Edwards  <vallimar@sexorcisto.net>\n\n\t* GraphicsMagick.spec: Updated to CVS build. Added the\n\tGraphicsMagickWand files to the spec.  Only try to remove the\n\tunneeded perl package files if we are using PerlMagick.\n\n2003-07-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* GraphicsMagick.spec: Added RPM spec file authored by Troy\n\tEdwards <vallimar@sexorcisto.net>.\n\n\t* NEWS: Add note regarding EXIF fix.\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Look for the profile\n\tname \"EXIF\" rather than \"APP1\".\n\n2003-07-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick_config_api.h.in: XWindowInfo structure in\n\txwindow.h needs HasSharedMemory define.\n\n\t* magick/xwindow.c, magick/xwindow.h: Move inclusion of\n\t<X11/extensions/shape.h> to xwindow.c.\n\n\t* coders/dps.c, magick/xwindow.h: Move DPS includes to\n\tcoders/dps.c\n\n\t* coders/Makefile.am: Substituted values are also set as\n\tmake variables, so use variables rather than substitutions.\n\n\t* magick/log.c (GetLogBlob): MAGICK_HOME needs to take\n\tprecedence over the client path for the uninstalled build.\n\n\t* magick/type.c (GetTypeBlob): MAGICK_HOME needs to take\n\tprecedence over the client path for the uninstalled build.\n\n\t* magick/blob.c (GetConfigureBlob): MAGICK_HOME needs to take\n\tprecedence over the client path for the uninstalled build.\n\n\t* magick/module.c (FindMagickModule): MAGICK_HOME needs to take\n\tprecedence over the client path for the uninstalled build.\n\n2003-07-24  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/attribute.c (TraceClippingPath): Improvements to clipping\n\tpath parsing.\n\n2003-07-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/cache.c: Disable the Windows open() extensions when\n\tcompiling using Borland C++.\n\n\t* magick/log.c (LogMagickEvent): Unlock semaphore before\n\treturning.\n\n\t* ltdl/ltdl.h: Updated to latest CVS version.\n\n\t* ltdl/ltdl.c: Updated to latest CVS version.\n\n\t* Libtool: Updated to use latest CVS libtool.\n\n2003-07-17  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick: Contributed initial Borland C++ Builder 6.0 build\n\tenvironment.\n\n2003-07-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/color.c (GetColorInfoArray): Added a function to access\n\tthe color definition list as an array.\n\t(GetColorList): Added access locks to ensure that list is not\n\tre-ordered while it is being traversed.\n\n\t* www/Magick++/Image.html: Add some more information regarding raw\n\tpixel access.\n\n2003-07-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/GraphicsMagickWand.pc.in (Cflags): Remove LFS_CPPFLAGS.\n\n\t* wand/GraphicsMagickWand-config.in: Remove LFS_CPPFLAGS.\n\n\t* magick/GraphicsMagick.pc.in (Cflags): Remove LFS_CPPFLAGS.\n\n\t* magick/GraphicsMagick-config.in: Remove LFS_CPPFLAGS.\n\n\t* configure.ac: Logic for setting LFS_CPPFLAGS was incomplete.\n\n\t* coders/topol.c: Updated topol coder contributed by Jaroslav\n\tFojtik.  Topol is coming to life!\n\n2003-07-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.h: Add a typedef for ssize_t\n\n\t* magick/deprecate.h: ExtendedSignedIntegralType and\n\tExtendedUnsignedIntegralType are now deprecated types so they are\n\tmoved to deprecate.h. Existing code which uses these types should\n\tcontinue to work.\n\n\t* magick/blob.c (MapBlob): Change `offset` parameter from type\n\toff_t to magick_off_t so that it is not LFS dependent.\n\n\t* magick/cache.c (GetPixelCacheArea): Return magick_off_t.\n\t(PersistCache): Change `offset` parameter to type magick_off_t.\n\n\t* magick/cache.h (NexusInfo): Change `length` type from\n\tExtendedSignedIntegralType to magick_off_t.\n\t(CacheInfo): Change `offset` and `length` types from\n\tExtendedSignedIntegralType to magick_off_t.\n\n\t* magick/blob.c (BlobToFile): Use ssize_t rather than\n\tExtendedSignedIntegralType for count.\n\t(TellBlob): Return magick_off_t rather than\n\tExtendedSignedIntegralType.\n\n\t* configure.ac: Check for a ssize_t type.\n\n\t* magick/blob.h (_BlobInfo): Change `offset` and `size` members\n\tfrom ExtendedSignedIntegralType to magick_off_t.\n\n\t* magick/blob.c (GetBlobSize): Return magick_off_t rather than\n\tExtendedSignedIntegralType.\n\t(SeekBlob): Accept and return magick_off_t rather than\n\tExtendedSignedIntegralType.\n\n2003-07-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/monitor.c (MagickMonitor): Change `quantum` argument from\n\ttype ExtendedSignedIntegralType to magick_int64_t. Change `span`\n\targument from ExtendedUnsignedIntegralType to magick_uint64_t.\n\n\t* magick/xwindow.c (XMagickMonitor): Change `quantum` argument from\n\ttype ExtendedSignedIntegralType to magick_int64_t. Change `span`\n\targument from ExtendedUnsignedIntegralType to magick_uint64_t.\n\n\t* magick/widget.c (XMonitorWidget): Change `quantum` argument from\n\ttype ExtendedSignedIntegralType to magick_int64_t. Change `span`\n\targument from ExtendedUnsignedIntegralType to magick_uint64_t.\n\n\t* magick/studio.h (QuantumTick): Change typecast from\n\tExtendedSignedIntegralType to magick_int64_t.\n\n\t* magick/resource.c (AcquireMagickResource): Change `size`\n\targument type from ExtendedSignedIntegralType to magick_int64_t.\n\t(LiberateMagickResource): Change `size` argument type from\n\tExtendedSignedIntegralType to magick_int64_t.\n\n\t* magick/utility.c (FormatSize): Change `size` argument type from\n\tExtendedSignedIntegralType to magick_int64_t.\n\n\t* magick/nt_base.c: Change MagickOffset to magick_off_t.\n\n\t* magick/studio.h (magick_off_t): Change MagickOffset to magick_off_t.\n\n\t* coders/topol.c: Insert dummy member into palettRAS structure\n\tsince Visual C++ doesn`t seem to handle empty structures.\n\n\t* wand/GraphicsMagickWand.pc.in (prefix): Pass LFS CPPFLAGS.\n\n\t* wand/GraphicsMagickWand-config.in: Pass LFS CPPFLAGS.\n\n\t* wand/Makefile.am: Fix include path.\n\n\t* magick/GraphicsMagick.pc.in (prefix): Pass LFS CPPFLAGS.\n\n\t* magick/magick_config_api.h.in: Pass LFS configuration options\n\tuntil the API is fixed so that it is not LFS sensitive anymore.\n\n\t* magick/GraphicsMagick-config.in: Pass LFS CPPFLAGS.\n\n\t* PerlMagick/Makefile.PL.in: Pass LFS CPPFLAGS.\n\n\t* magick/Makefile.am: Install magick_types.h.\n\n\t* magick/api.h: Include magick_types.h.\n\n\t* magick/studio.h: Include magick_types.h rather than integral_types.h.\n\t* VisualMagick/magick/magick_types.h.in: New header file (replacing\n\tintegral_types.h) to contain CPU and system-dependent primitive\n\ttypedefs.\n\n\t* magick/magick_types.h.in: New header file (replacing\n\tintegral_types.h) to contain CPU and system-dependent primitive\n\ttypedefs.\n\n\t* configure.ac: Use AC_SYS_LARGEFILE to test for large file\n\toptions. Update to determine integral typedefs for current CPU and\n\tcompiler options. Configure magick_types.h.\n\n\t* magick/attribute.c (TraceClippingPath): Apply patch from Lars\n\tRuben Skyum which fixes clipping path parsing for paths generated\n\tby Adobe software which pre-dates the Photoshop file format\n\tspecification.\n\n2003-07-08  William Radcliffe  <billr@corbis.com>\n\n\t* magick/semaphore.c: Modified the way the system handles the\n\tinitialization of Win32 critical sections to use a spin lock\n\ton WIn32 to bootstrap the initialization of all other crtical\n\tsections. This is not an issue on UNIX since static init is used.\n\n\t* magick/magic.c module.c magick.c log.c resource.c constitute.c\n\tcolor.c cache.c delegate.c registry.c type.c: Small modifications\n\twere made to eliminate the side effect of unlocking semaphores\n\tas part of the releasing procedure. This also eliminated the\n\tapparent bug of the system double locking certain semaphores.\n\tThe locked flag should now not be needed, but remains in place\n\tfor the time being as an added safegaurd.\n\n2003-07-04  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* png.c: added missing #ifdef JNG_SUPPORTED/#endif directives.\n\n2003-07-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS: Updated news to include fixes and enhancements since the\n\t1.0 release.\n\n2003-07-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/semaphore.c (UnlockSemaphoreInfo): Bugfix, modify\n\tthe `locked` flag while still under protection of the lock.\n\tThis fix is necessary for thread-safety.\n\n2003-07-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (ReadJPEGImage): Conditionally copy exception.\n\n\t* wand/Makefile.am (noinst_HEADERS): Need to distribute\n\tmagick_compat.h.\n\t(EXTRA_DIST): Need to distribute GraphicsMagickWand-config.1.\n\n\t* coders/wmf.c (ipa_bmp_draw): Use CopyException.\n\t(ipa_device_begin): Use CopyException.\n\t(lite_font_map): Use CopyException.\n\t* coders/jpeg.c (ReadJPEGImage): Use CopyException.\n\t* magick/image.c (GetImageException): Use CopyException.\n\t* magick/constitute.c (WriteImages): Use CopyException.\n\t* Makefile.am (DIST_SUBDIRS): wand needs to be included in\n\tdistribution.\n\n2003-06-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/static.c (RegisterStaticModules): Invoke\n\tRegisterTOPOLImage.\n\n\t* magick/magick.h (MagickInfo): Add member usage comments.\n\n\t* magick/error.c (CatchException): Restore saved errno from\n\texception->error_number.\n\t(CopyException): Copy error_number.\n\t(DestroyExceptionInfo): Reset error_number to zero.\n\t(GetExceptionInfo): Initialize error_number to zero.\n\t(ThrowException): Save errno to exception-> error_number.\n\t(ThrowLoggedException): Save errno to exception-> error_number.\n\n\t* magick/error.h (ExceptionInfo): Borrow John Cristy's idea and\n\tadd a error_number member to ExceptionInfo to save the current\n\terrno value. Otherwise CatchException may use some random errno.\n\n\t* coders/Makefile.am: Build topol.c.\n\n\t* coders/topol.c: Added initial TOPOL X image coder which is under\n\tdevelopment by Jaroslav Fojtik. Not working yet.\n\n2003-06-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pwp.c (ReadPWPImage): Ensure that image is initialized\n\tbefore invoking ThrowReaderException.\n\n\t* magick/image.c (CloneImage): Use CopyException.\n\n\t* magick/error.c (CopyException): Add function to support copying\n\tExceptionInfo structures.\n\n\t* magick/error.h (ExceptionInfo): Replaced recently-added `whence`\n\tmember with module, function, and line members in order to keep\n\tthe information seperate, and match the parameters used by the\n\tlogging system.\n\t(ThrowException): Log thrown exceptions.\n\n\t* magick/error.c (ThrowLoggedException): New function used to\n\tthrow an exception, while recording and logging the location\n\twhere the exception is thrown.\n\n\t* doc/options.imdoc (operation): Document TemporaryFile and\n\tException events.\n\n\t* magick/log.c (LogMagickEvent): Support logging ExceptionEvent.\n\n\t* PerlMagick/Magick.xs: Added \"Exception\" event type.\n\n\t* magick/log.h (LogEventType): Added ExceptionEvent.\n\n2003-06-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/error.c (ThrowException): Handle `whence`\n\tmember. MagickFreeMemory already checks for null pointer so don't\n\tcheck again.\n\t(DestroyExceptionInfo): Handle `whence` member. MagickFreeMemory\n\talready checks for null pointer so don't check again.\n\n\t* magick/error.h (ExceptionInfo): Add a `whence` member to support\n\tthe ability to record where the exception is was thrown.\n\n\t* VisualMagick/installer: Install Wand files.\n\n2003-06-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (GetConfigureBlob): GetConfigureBlob should always\n\treturn a value.\n\n\t* magick/type.c (GetTypeBlob): GetTypeBlob should always return a\n\tvalue.\n\n\t* magick/log.c (GetLogBlob): GetLogBlob should always return\n\ta value.\n\n\t* magick/magick.c (GetMagickInfoArray): Fixed array memory\n\tallocation and clearing bug. Eliminate warnings.\n\n2003-06-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/inc/files-configs.isx: For a static\n\tbuild, install the configuration files directly into the\n\tapplication directory.\n\n\t* VisualMagick/installer/inc/uninstallrun-unregister-com.isx\n\t(Filename): Change ImageMagickObject.dll path.\n\n\t* VisualMagick/installer/inc/run-register-com.isx (Filename):\n\tChange ImageMagickObject.dll path.\n\n\t* VisualMagick/installer/inc/files-com.isx (Source): Install\n\tImageMagickObject.dll and MagickCMD.exe in the application\n\tdirectory alongside gm.exe and the CORE DLLs.\n\n\t* INSTALL-unix.txt: Add additional information regarding LZW.\n\n\t* VisualMagick/magick/magick_config.h.in: Add additional notes\n\tregarding UNISYS LZW patent.\n\n\t* PerlMagick/Magick.xs: Applied Dissolve composite operator fix\n\tobtained from from John Cristy's ImageMagick which ensures that an\n\tunused matte channel is set to Opaque, and uses this knowledge to\n\tsimplify the math.\n\n\t* VisualMagick/configure/configure.cpp: The `wand` library has a\n\tlinkage dependency on the `magick` library. Also don't include\n\tthe magick subdirectory so that headers must be included like\n\t<magick/api.h> for safety.\n\n\t* coders/xtrn.c: Fix magick header inclusion.\n\n\t* lcms\\src\\cmserr.c: Fix magick header inclusion.\n\n2003-06-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Fix to formatting. Fix spelling of origin.\n\n\t* PerlMagick/t/bzlib/read.t: Add test for reading BZipped file.\n\n\t* PerlMagick/t/subroutines.pl (testRead): Skip testing reads\n\tof compressed BLOBs because reading compressed BLOBs is not\n\tsupported yet.\n\n\t* coders/bmp.c (ReadBMPImage): Only validate the file size value\n\tfor compressed BMPs.\n\n\t* VisualMagick/wand, wand: First stab at building the Wand API\n\tunder Visual C++.  Still does not build as a DLL.\n\n2003-06-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/static.h: Add prototypes for RegisterXTRNImage and\n\tUnregisterXTRNImage.\t\n\n\t* Makefile.am (DISTDIRS): Don't distribute the `guide`\n\tsubdirectory. It is available for checkout from CVS.\n\n\t* www: Utilities documentation is updated from <imdoc> masters.\n\tFormatting could be improved, but the content seems ok.\n\n\t* doc/environment.imdoc: New file to describe environment\n\tvariables.\n\n\t* coders/cut.c (ReadCUTImage): Use MagickAllocateMemory and\n\tMagickFreeMemory rather than malloc and free.\n\n\t* doc/gmdoc2html: Add GraphicsMagick styling to utility web pages.\n\n\t* doc/Makefile: Additional documentation Makefile enhancements.\n\n\t* AUTHORS: New file to acknowledge significant contributors\n\tto the software. If an author is not listed here, please let\n\tus know.\n\n\t* configure.ac: test -a is not POSIX compliant.\n\n2003-06-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc: Source documentation for `gm` is now available via a `doc`\n\tCVS module. A Makefile is provided which formats the\n\tdocumentation and installs it into the `www` and `utilities`\n\tsubdirectories.\n\n2003-06-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand: Added Magick Wand library available via\n\t-lGraphicsMagickWand and <wand/wand_api.h>. Use\n\tGraphicsMagickWand-config or GraphicsMagickWand.pc to obtain the\n\tcompilation options required to use the library. Magick Wand is\n\tauthored by John Cristy. Magick Wand is provided as a separate\n\tlibrary from -lGraphicsMagick in order to assure the stability of\n\tthe core GraphicsMagick library while allowing Magick Wand to\n\tto evolve.\n\n\t* images: Replace existing logo images with cleaner ones.\n\n\t* www: Update links to point to updated logo images.\n\n\t* logos: New CVS directory to contain master logos.\n\n\t* scripts/txt2html: Updated inline logo image link.\n\n\t* scripts/format_c_api_docs: Updated inline logo image link.\n\n\t* version.sh: Support versioning all libraries independently.\n\n\t* coders/meta.c: Prefix include paths for safety.\n\n\t* magick/image.h: (TransmitType) Removed unused enumeration.\n\t(ProfileType) Removed unused enumeration.\n\t(QuantumType) Moved enumeration to constitute.h\n\t(StorageType) Moved enumeration to constitute.h\n\n\t* magick/draw.c (DrawPeekGraphicContext): Added function to peek\n\tat head of drawing context stack (function added for ImageMagick\n\tcompatability).\n\n\t* magick/image.c (CycleColormapImage): Change return type from\n\t`void` to `unsigned int` so that error status is returned to user.\n\t(DescribeImage): Change return type from\n\t`void` to `unsigned int` so that error status is returned to user.\n\n\t* magick/list.c (ReplaceImageInList): Incorporated function from\n\tJohn Cristy's ImageMagick to replace current image in the list.\n\n\t* coders/sgi.c (ReadSGIImage): Applied patch from John Cristy's\n\tImageMagick to save the compression type for SGI images.\n\n2003-06-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/txt.c (WriteTXTImage): Apply patch from John Cristy's\n\tImageMagick to observe image depth while writing pixel colors.\n\tThis patch is not applied to the 1.0 branch because it represents\n\tan output format change which could break a dependent application.\n\t(IsTXT): Recognize files written by the TXT coder.\n\t(ReadTXTImage): Reject files written by the TXT coder until support\n\tfor reading these files is implemented.\n\t(IsTXT): Ensure that sscanf doesn't read outside of provided data\n\tby using a fixed size buffer.\n\n2003-06-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Don't add -lfpx to LIBS while configuring\n\tbecause the C compiler may fail to link with it in later\n\ttests.\n\n2003-06-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: RotateImage is documented to take\n\t`degrees` argument, not `degree`.  SwirlImage is documented to\n\ttake `degrees` argument, not `degree`.  SolarizeImage is\n\tdocumented to take a `threshold` argument, not `factor`.  Wave is\n\tdocumented to take `amplitude` and `wavelength` arguments.  Don't\n\ttransform colorspace to RGB when retrieving `pixel` color value.\n\tRelease memory acquired to store `length` pointer.  Picked up\n\tmemory leak fix related to `SV **reference_vector` variable from\n\tJohn Cristy's ImageMagick.\t\n\n\t* configure: Incorporate patch to handle inline better.\n\n\t* magick/utility.c (GetToken): Adjust code to avoid \"end-of-loop\n\tcode not reached\" warning.\n\n\t* magick/log.c (GetLogBlob): Eliminate warning regarding\n\tunreached code.\t\n\n\t* magick/command.c (AnimateImageCommand): Eliminate warning regarding\n\tunreached code.\t\n\t(ConvertImageCommand): Eliminate warning regarding\n\tunreached code.\t\n\t(ImportImageCommand): Eliminate warning regarding\n\tunreached code.\t\n\n\t* magick/type.c (GetTypeBlob): Eliminate warning regarding\n\tunreached code.\t\n\n\t* magick/blob.c (GetConfigureBlob): Eliminate warning regarding\n\tunreached code.\n\n\t* coders/meta.c (super_fgets): Eliminated warnings regarding\n\tcomparison and return of incompatible pointer types.\n\t(super_fgets_w): Eliminated warnings regarding\n\tcomparison and return of incompatible pointer types.\n\n\t* magick/command.c (ConvertImageCommand): Eliminate warnings\n\tnoticed when using Sun's compiler.\n\n2003-06-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* acinclude.m4: Add `#undef inline` in front of C++ tests.\n\n\t* coders/x.c (RegisterXImage): Only register the X coder if HasX11\n\tis defined.\n\n2003-06-07  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/image.c (GetImageGeometry) Y was a function of width\n\tinstead of height when processing EastGravity or WestGravity\n\t(bug report from Cristy).\n\n2003-06-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (LocaleNCompare): Documented that comparison is\n\tcase-insensitive.\n\t(LocaleCompare): Documented that comparison is case-insensitive.\n\n\t* magick/log.c (ParseEvents): LocaleNCompare already does\n\tcase-insensitive compare so lower-casing is not necessary.\n\n\t* Magick++: Updates to cause exceptions to be thrown if a bad\n\tgeometry specification is supplied.\n\n2003-06-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (ReadConfigureFile): Move event parsing to\n\tParseEvents funtion.\n\t(SetLogEventMask): Move event parsing to\n\tParseEvents funtion.\n\n\t* magick/utility.c (GetGeometry): Validate that the geometry\n\tstring only contains valid characters.\n\n\t* PerlMagick/t/subroutines.pl (testMontage): It seems that passing\n\tan empty set of options to the SetImage method corrupts the image\n\toptions (surely a PerlMagick bug), so don't invoke SetImage unless\n\tthere are options to set.\n\n2003-06-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (VersionCommand): Add build information to\n\tversion output.\n\n\t* configure.ac: Save configure/build parameters for later use in\n\tversion output.\n\n2003-06-04  William Radcliffe  <billr@corbis.com>\n\n\t* coders/meta.c: Added some casts to make things compile better.\n\n2003-06-03  William Radcliffe  <billr@corbis.com>\n\n\t* coders/meta.c: Was broken due to editing mistakes as well\n\tas inherent incompatability with MagickReallocMemory macro.\n\n2003-06-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (RegisterXPMImage): Module registration for PICON\n\tshould have been XPM.  Thanks to John Cristy for noticing this\n\tbug.\n\n\t* coders/psd.c (ReadPSDImage): Applied John Cristy's patch to fix\n\ta index calculation bug which is evident when QuantumDepth>8.\n\n2003-06-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c: Eliminated some compiler warnings.\n\n\t* magick/transform.c (ProfileImage): Eliminated some compiler\n\twarnings.\n\n\t* magick/static.c (RegisterStaticModules): Invoke\n\tRegisterXTRNImage if _VISUALC_ is defined.\n\n2003-06-02  William Radcliffe  <billr@corbis.com>\n\n\t* utilities/gm.c: made -format work again but had to add off flag\n\tto MagickCommand to maintain backward compatability with previous\n\tversions of GM.\n\n\t* magick/command.c: Added flag to tell MagickCommand whether GM is\n\texpected to process metadata requests. The COM object *always* does.\n\n\t* magick/transform.c: Added error handling, memory leak avoidance\n\tand performanc enhancment.\n\n2003-06-01  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* NEWS: Added Bug Fixes item with info about the JNG encoder fix.\n\n2003-06-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS: Listed significant changes (thus far) in version 1.1.\n\n\t* version.sh: Updated LIBRARY_CURRENT and LIBRARY_REVISION since\n\tsome command.c interfaces have changed, and a new interface has\n\tbeen added. The only user of these interfaces should be `gm` but\n\tit always pays to be careful.\n\n\t* utilities/gm.c (main): Use MagickCommand.\n\n\t* magick/command.c (MagickCommand): New function to provide\n\tAPI-level command access to the command functions provided by the\n\tGM utility with an interface similar to ConvertImageCommand.\n\t(AnimateImageCommand): Changed function arguments to match\n\tConvertImageCommand.\n\t(ConjureImageCommand): Changed function arguments to match\n\tConvertImageCommand.\n\t(DisplayImageCommand): Changed function arguments to match\n\tConvertImageCommand.\n\t(ImportImageCommand): Changed function arguments to match\n\tConvertImageCommand.\n\n\t* libxml/libxml2.def: Remove LIBRARY line since Visual C++ 6.0\n\tdoesn't like that the build library doesn't match the name\n\tspecified by LIBRARY.\n\n2003-05-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (GetMagickInfoArray): Resolve thread-safety\n\tissue by accessing magick_list directly under the protection of a\n\tlock rather than using the pointer returned by GetMagickInfo.\n\tAdded error handling for insufficient memory.\n\n\t* coders/tile.c (RegisterTILEImage): Added a usage note in formats\n\tlisting.\n\n\t* coders/viff.c (RegisterVIFFImage): Module definition for \"XV\"\n\twas missing.\n\n\t* coders/ps2.c (RegisterPS2Image): Module definition for \"PS2\" was\n\tmissing.\n\n\t* coders/wmf.c (RegisterWMFImage): Added usage note in formats\n\tlisting.\n\n\t* coders/xpm.c (RegisterXPMImage): Hide PM alias for XPM in the\n\tformats listing.\n\n\t* coders/logo.c (RegisterLOGOImage): Hide registrations for\n\tGRANITE, LOGO, and NETSCAPE in the formats listing.\n\n\t* coders/jpeg.c (RegisterJPEGImage): Module definition for \"JPEG\"\n\twas missing.\n\n\t* coders/html.c (RegisterHTMLImage): Module definition for \"HTML\"\n\twas missing.\n\n\t* coders/bmp.c (RegisterBMPImage): Module names for \"BMP2\" and\n\t\"BMP3\" should be \"BMP\".\n\n2003-05-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (GetMagickInfoArray): New function to return\n\tMagickInfo array.\n\t(ListMagickInfo): Updated to use GetMagickInfoArray.\n\t(ListModuleMap): New function to list module map to a file.\n\n\t* utilities/gm.c: Centered the file header and made note of this\n\tstupendously significant accomplishment.\n\n\t* magick/command.c: Added a `-list modulemap` option. Added plural\n\tforms of other list options for people who are are not limited to\n\tthe singular.  Also `-list font` and `-list fonts` now work for\n\tpeople who think in terms of fonts rather than type.\n\n2003-05-30  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* MNG encoder failed to set the JNG bit in the simplicity profile.\n\n\t* MNG encoder failed to write FRAM chunks when all images were JNG.\n\n\t* JNG encoder wrote the wrong alpha_sample_depth for opaque images. \n\n2003-05-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magic.c (ReadConfigureFile): Removed bogus embedded magic\n\tdata and ensured that errors with loading magic.mgk propogate to\n\tthe top.\n\n\t* magick/constitute.c (ReadImage): When building delegate error\n\treport, handle the case where the filename is empty (such as for\n\t\"LOGO:\").\n\n\t* coders/png.c (WritePNGImage): Ensure that most severe exception\n\tis reported via exception argument.\n\t(ReadMNGImage): Ensure that most severe exception is reported via\n\texception argument.\n\n\t* magick/command.c (ConvertImageCommand): Ensure that most severe\n\texception is reported via exception argument.\n\t(CompositeImageList): Ensure that most severe exception is\n\treported via exception argument.\n\t(CompositeImageCommand): Ensure that most severe exception is\n\treported via exception argument.\n\n\t* magick/constitute.c (WriteImages): Ensure that most severe\n\texception is reported via exception argument.\n\n\t* utilities/gm.c: Centered file header because I didn't like it.\n\n\t* locale/C.mgk: Removed some defunct messages.\n\n\t* magick/blob.c (PingBlob): Report useful error message.\n\t(BlobToImage): Report sensible error message for null blob.\n\n\t* magick/utility.c (AcquireString): Change UnableToAquireString to\n\tUnableToAllocateString.\n\n\t* coders/xwd.c (ReadXWDImage): Report CorruptImage rather than\n\tCorruptXWDImage.\n\n\t* coders/xpm.c (ReadXPMImage): Report CorruptImage rather than\n\tCorruptXPMImage.\n\n\t* coders/xcf.c (load_level): Report CorruptImage rather than\n\tCorruptXCFImage.\n\n\t* coders/wbmp.c (ReadWBMPImage): Report CorruptImage rather than\n\tCorruptWBMPImage.\n\n\t* coders/pcd.c: Report CorruptImage rather than CorruptPCDImage.\n\n\t* coders/otb.c (ReadOTBImage): Report CorruptImage rather than\n\tCorruptOTBImage.\n\n\t* magick/constitute.c (ReadInlineImage): Report CorruptImage\n\trather than CorruptInlineImage.\n\n\t* coders/pdb.c (ReadPDBImage): Incorporated undocumented fix from\n\tImageMagick which obtains the image depth from the image depth\n\tattribute, and increases the packet memory allocation. Report\n\tCorruptImage rather than CorruptPDBImageFile.\n\n2003-05-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/bin/modules.mgk: Add mapping from SVGZ to SVG.\n\n\t* coders/modules.mgk: Add mapping from SVGZ to SVG.\n\n\t* coders/svg.c (RegisterSVGImage): Add registration for SVGZ\n\tformat.\n\n\t* PerlMagick/t/zlib/read.t: Added test to check reading a file\n\twith .gz extension. The blob portion of the test currently fails.\n\n\t* coders/wpg.c (ReadWPGImage): Fix reading WPGs with embedded\n\tPostscript. Ensure that scene numbers are sane. Bugs remain.\n\n\t* magick/blob.c (OpenBlob): Recognize the .svgz extension as a\n\tgzipped format.  Not required in order to read .svgz files since\n\tthe blob file magic detects gzip files.\n\n\t* magick/command.c (MontageImageCommand): Wrong exception\n\tmacro was being invoked.  Steps have been taken to ensure that\n\tthis doesn't happen again.\n\t(ImportUsage): Fix spelling of `type`.\n\n\t* magick/magick.c (DestroyMagick): Decided that initialization\n\tstate should be tracked via an enum so that DestroyMagick will\n\ttake effect even if InitializeMagick has never been called.\n\n2003-05-27  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/png.c: png.c would dump core when writing a grayscale\n\timage in png24 or png32 format.\n\n2003-05-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/ept.c (WriteEPTImage): Fixed writing EPT preview image and\n\tadded logging.\n\n\t* magick/enhance.c (NegateImage): If image is in CMYK colorspace,\n\tthen negate the `K` channel as well.\n\n\t* PerlMagick/Magick.xs: Fix spelling of `elevation` argument to\n\tShade method.\n\n\t* magick/image.h (ImageInfo): Added more documenting comments.\n\n\t* magick/image.c (CloneImage): Don't clone huffman ascii85\n\tencoding support structure since it is not useful outside of the\n\tcurrent image context. Cloning a structure via pointer assignment\n\tcauses a memory leak.\n\n2003-05-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c: Incorporate math tweaks obtained from\n\tImageMagick which are purported to improve accuracy when rotating\n\tand shearing using small angles. Also avoid unneccessarily\n\ttransforming CMYK images into RGB images.\n\n\t* magick/paint.c (ColorFloodfillImage): Fix hang while\n\tfloodfilling using a pattern image with color similar to the\n\tborder color.\n\n\t* coders/modules.mgk: Add missing mappings for PNG8,\n\tPNG24, and PNG32.\n\n\t* VisualMagick/bin/modules.mgk: Add missing mappings for PNG8,\n\tPNG24, and PNG32.\n\n2003-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (GetLogBlob): Return an error if log.mgk can not\n\tbe accessed.\n\n\t* locale/C.mgk: Added UnableToAccessLogFile.\n\n\t* magick/blob.c (GetConfigureBlob): Only return result of\n\tNTResourceToBlob if it is non-NULL.\n\n\t* magick/type.c (GetTypeBlob): Search $MAGICK_HOME for\n\ttype.mgk. Only return result of NTResourceToBlob if it is\n\tnon-NULL.\n\n\t* magick/magick.c (GetMagickInfo): Return an error if GetModuleInfo\n\treports an error.\n\n\t* magick/module.c (GetModuleInfo): Return an error if modules.txt\n\tfails to load.\n\n\t* utility.c (SubstituteString): Fixed a bug which was introduced\n\twhile updating the code to use the memory allocation macros.\n\n2003-05-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/GraphicsMagick-config.in (usage): Added example\n\tusage to the help output.\n\n\t* magick/magick.c (InitializeMagick): Added a static flag to\n\tensure that the Magick library is initialized only one time.\n\t(DestroyMagick): Ensure that Magick library resources are only\n\tdestroyed if it has previously been initialized.\n\n\t* magick/nt_base.c (DllMain): Fix contributed by Achim Domma. For\n\ta DLL build, update PATH during Magick DLL initialization to\n\tinclude the directory where the Magick core DLL resides. This\n\tallows the loadable modules to find the core DLLs, even if the\n\tcore DLLs are not already in the PATH.\n\n\t* magick/image.c (TextureImage): Incorporate new implementation\n\tauthored by John Cristy of ImageMagick Studio.  This\n\timplementation is a full 7X (run-time) or 14X (user-time) faster\n\tthan the original ImageMagick implementation, and is about 2X\n\tfaster than the speeded-up version I commited on the 19th.\n\n2003-05-20  William Radcliffe  <billr@corbis.com>\n\n\t* VisualMagick\\configure : Fixed bug with add on (plug-ins) not\n\tbuilding automatically in DLL mode.\n\n2003-05-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (TextureImage): Creation of tiled image textures\n\tis speeded up by 3.7X.\n\n\t* coders/tile.c (ReadTILEImage): Use TextureImage.\n\n\t* VisualMagick/bin/modules.mgk: Map \"PATTERN\" to \"LOGO\".\n\n\t* coders/modules.mgk: Map \"PATTERN\" to \"LOGO\".\n\n\t* coders/logo.c (ReadLOGOImage): Add \"PATTERN\" tiling support in\n\torder to be compatible with ImageMagick.\n\n\t* magick/image.c (SetImageInfo): Map \"MAGICK\" magick to \"IMAGE\" in\n\torder to be compatible with ImageMagick.\n\n2003-05-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Copyright.html: Try to fix formatting of XFig entry.\n\n\t* www/windows.html: Update file names for 1.0.1 release.\n\n\t* index.html: Mention 1.0.1 release as latest release.\n\n\t* magick/magick_config_api.h.in: Add define for HasX11\n\tso that it is possible to use functions in the installed\n\txwindow.h\n\n\t* */*.c: Updated to use MagickAllocateMemory macro.\n\n2003-05-17  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/png.c: stifled compiler warnings about uninitialized\n\tchunk and blob variables.\n\n2003-05-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.h (MagickAllocateMemory): New macro to allocate\n\tmemory.\n\t(MagickFreeMemory): New macro to free memory.\n\t(MagickReallocMemory): New macro to reallocate memory.\n\n\t* */*.c,*/*.h: Updated to use MagickFreeMemory and\n\tMagickReallocMemory. Eliminated warnings when compiling with\n\tGCC 3.3 using -Wall.\n\n\t* images: The logo image was determined to have a copyright\n\tproblem so replace with blank image until a replacement is\n\tavailable.\n\n2003-05-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/magick/magick_config.h.in (HAVE_SYS_TYPES_H): \n\tMoved this define back from nt_base.h since removing it was\n\tcausing some problems for Magick++.\n\n2003-05-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c: (SetMagickInfo): Don't mask failure to\n\tread magic.mgk.\n\n\t* magick/constitute.c (ReadImage): Don't overwrite specific\n\texception info.\n\n\t* magick/nt_base.c (NTResourceToBlob): Add logging similar\n\tto that used in IsAccessible() in order to make operation\n\tmore clear.\n\n\t* magick/module.c (FindMagickModule): Removed extraneous\n\t\"Searching for module file\" log event.\n\t(GetModuleBlob): Under Windows, don't clear or overwrite\n\tan existing exception.\n\n\t* magick/nt_base.h: Imported some obscure defines from\n\tmagick\\magick_config.h.\n\n\t* VisualMagick/magick/magick_config.h.in: Improved description\n\ttext and formatting.  Moved some obscure defines to\n\tmagick/nt_base.h.\n\n\t* locale/C.mgk: Added a \"RegistryKeyLookupFailed\" error message.\n\n\t* magick/type.c (GetTypeBlob): Report registry key lookup\n\tfailures. Also ensure correct return value when an error is\n\treported.\n\n\t* magick/log.c (GetLogBlob): Report registry key lookup failures.\n\n\t* magick/delegate.c (ReadConfigureFile): Report registry key\n\tlookup failures.\t\n\n\t* magick/blob.c (GetConfigureBlob): Report registry key lookup\n\tfailures. Also ensure correct return value when an error is\n\treported.\t\n\n\t* magick/module.c (FindMagickModule): Report registry key lookup\n\tfailures. Also ensure correct return value when an error is\n\treported.\n\n\t* magick/nt_base.c (NTRegistryKeyLookup): Simplify base key lookup\n\tcode, and improve coding style.\t\n\n\t* coders/logo.c, Copyright.txt, www/Copyright.html: Acknowledge\n\tand respect the XFig copyright.\n\n\t* VisualMagick/installer/inc/files-documentation.isx: QuickStart.txt\n\tis no longer distributed so it is removed.\n\n2003-05-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h (RoundToQuantum): New macro to round positive\n\tdouble to Quantum.\n\n\t* magick/xwindow.c, magick/xwindow.h, magick/studio.h: Use FreeBSD\n\tportability fixes from FreeBSD ports collection.\n\n\t* configure.ac: Test for <machine/param.h> as used by some *BSD systems.\n\n\t* QuickStart.txt, www/QuickStart.html: Don't distribute QuickStart.txt or\n\twww/QuickStart.html since the content doesn't currently apply to\n\tGraphicsMagick.\n\n2003-05-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* README.txt: Added text regarding where to obtain dcraw, a simple\n\tbut useful decoder for the proprietary raw file formats produced\n\tby digital cameras (58 supported cameras!).\n\n\t* configure.ac: Added support for finding dcraw.\n\n\t* VisualMagick/bin/delegates.mgk: Added support for dcraw.\n\n\t* coders/delegates.mgk.in: Added support for dcraw.\n\n\t* version.sh (PACKAGE_RELEASE_DATE): Extract the most recent\n\tupdate date from the ChangeLog file using awk.\n\n2003-05-12  William Radcliffe  <billr@corbis.com>\n\n\t* modules.mgk, magic.mgk : Sync up both of these for UNIX\n\tas well as VisualMagick builds. Includes changes for the\n\tmeta.c code.\n\n2003-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/formats.html: Documented embedded gray intensity images.\n\n\t* coders/logo.c: Added the embedded dithered gray intensity images\n\tgray0, gray5, ..., through gray100 to support bilevel filling and\n\tpainting with an intensity resolution of 5%.\n\n\t* www/formats.html: Added description of images available via\n\t\"IMAGE:\" format tag, as well as providing a tiled preview.\n\n\t* coders/logo.c: Renamed \"transparent\" image to \"checkerboard\"\n\tsince it is a better description.  Added a set of tiny bilevel\n\timages (accessed via IMAGE:) for use when tiling, filling, or for\n\tuse as a texture image.  The complete set of image names available\n\tvia the IMAGE: coder are now BRICKS, CIRCLES, CROSSHATCH,\n\tCROSSHATCH30, CROSSHATCH45, FISHSCALES, GRANITE, HEXAGONS,\n\tHORIZONTAL, HORIZONTALSAW, HS_BDIAGONAL, HS_CROSS, HS_DIAGCROSS,\n\tHS_FDIAGONAL, HS_HORIZONTAL, HS_VERTICAL, LEFT30, LEFT45,\n\tLEFTSHINGLE, LOGO, NETSCAPE, OCTAGONS, RIGHT30, RIGHT45,\n\tRIGHTSHINGLE, ROSE, SMALLFISHSCALES, CHECKERBOARD, VERTICAL,\n\tVERTICALBRICKS, VERTICALLEFTSHINGLE, VERTICALRIGHTSHINGLE, &\n\tVERTICALSAW.  The HS_* variants are similar to the standard\n\tpattern images provided with the Windows GDI.\n\n\t* coders/msl.c (MSLStartElement): Don't reset gravity if the user\n\tprovides an x,y coordinate. Passing coodinates was loosing the\n\tgravity setting.\n\n2003-05-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/modules.mgk: Support the IMAGE: format via the LOGO\n\tmodule.\n\t* win2k/IMDisplay/IMDisplayView.cpp (DoDisplayImage):\n\tTransparent tile is created by reading \"tile:image:transparent\".\n\t* coders/logo.c (ReadLOGOImage): Add IMAGE: format to front for\n\tembedded images so that adding new images doesn't proliferate coder\n\tregistrations. Legacy logo magick names (GRANITE, LOGO, NETSCAPE,\n\tand ROSE) are still supported, but they are also available in the\n\tIMAGE file space (e.g. IMAGE:ROSE).\n\n2003-05-09  William Radcliffe  <billr@corbis.com>\n\n\t* VisualMagick\\configure : Further refinements that support both\n\tthe new \"big\" library and the normal dynamic DLL buidling styles.\n\n2003-05-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/logo.c (ReadLOGOImage): Added a \"TRANSPARENT\" pattern\n\timage which can be tiled to form the background of transparent\n\timages.\n\n\t* win32/IMDisplay/IMDisplayView.cpp: When displaying images which\n\tinclude an opacity channel, use a checker-board pattern as the\n\timage background so non-opaque pixels become evident.\n\n2003-05-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c : Add or fix commenting of DebugString so that\n\tmodule does not require Windows.\n\n\t* lcms: Updated to release 1.10.\n\n2003-05-07  William Radcliffe  <billr@corbis.com>\n\n\t* VisualMagick\\bin : Brought the MGK files back into sync with\n\tthe rest of the package and added types for meta.c.\n\n\t* VisualMagick\\bin\\win32\\ATL : removed config files in order to\n\tprevent very old ATL project from being picked up in the config\n\n2003-05-06  William Radcliffe  <billr@corbis.com>\n\n\t* VisualMagick\\lcms\\LIBRARY.txt : a define to prevent popup message\n\tbox behaviour.\n\n\t* VisualMagick\\configure\\ : New feature - -t consolidates all the\n\tcoders into on library for the static build in order to make the\n\tbuild process tolerable.\n\n\t* coders\\xtrn.c : new support for BSTR - wdie character data\n\n\t* coders\\svg.c : put back logic that allows the -size parameter to\n\tcontrol the pixel dimensions of the output image.\n\n\t* coders\\meta.c : added support for wide character parsing of iptc\n\tand 8BIM formats.\n\n2003-05-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh : Update to reflect development status.\n\n2003-05-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* GraphicsMagick 1.0 Released.\n\n\t* version.sh (LIBRARY_REVISION): Updated for the 1.0 release.\n\n\t* magick/studio.h: Add fix to avoid problems caused by zlib\n\tunder AIX.\n\n\t* magick/cache.h: Parameterized prototypes to make them easier\n\tto follow.\n\n\t* filters/analyze.c: Replace C++ comments with C comments.\n\n\t* magick/command.c: For the composite, convert, identify, mogrify,\n\tand montage commands, make sure a usage error is returned if a\n\tusage message is printed. This is useful for ImageMagickObject\n\tusers who won't see the usage message if stdio is not supported.\n\n\t* locale/C.mgk: Added \"UsageError\" error.  Added missing closure\n\tto <Corrupt> tag which caused most/many message lookups to fail.\n\n\t* magick/nt_base.h: Fixed a compile problem caused by masking\n\tinternals in delegate.h\n\n\t* magick/ImageMagick.rc: Added missing .mgk files.\n\n2003-05-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (lt_dlerror): Defining lt_dlerror to be\n\tNTGetLastError was not a correct implementation since the\n\tinterface is defined to return a const pointer to a string, but\n\tNTGetLastError returns an allocated string, causing a memory leak\n\tif NTGetLastError is used in the place of lt_dlerror.  A new\n\tlt_dlerror function is added to fix this.\n\t(lt_dlsetsearchpath): lt_dlsetsearchpath should return an int\n\tand accept a const char *.\n\t(lt_dlsym): lt_dlsym is supposed to take a const char *.\n\n\t* magick/nt_base.h: lt_dlclose should return an `int`.\n\n\t* magick/nt_base.c (lt_dlclose): Return status from lt_dlclose.\n\n\t* magick/module.c (lt_dlclose): lt_dlclose is supposed to return\n\tan `int`, not `void`. A return value of zero indicates success.\n\n\t* VisualMagick/tests/run_constitute.bat: Add batch script to\n\trun constitute tests.\n\n\t* magick/module.c: Added a ltdl_initialized static flag to track\n\tif libltdl has been initialized by lt_dlinit().\n\t(TagToFunctionName): Use a stack buffer for the string rather than\n\tallocating heap data.\n\t(UnregisterModule): Report errors via exception info as the\n\tinterface suggests.\n\t(UnloadModule): Report errors via exception info as the interface\n\tsuggests.\n\t(DestroyModuleInfo): Only invoke lt_dlexit() if lt_dlinit() has\n\tpreviously been invoked.\n\n\t* locale/C.mgk: Added FailedToCloseModule module error.\n\n\t* magick/module.c (UnloadModule): Report exception via exception\n\tparameter rather than simply printing out an error message and\n\texiting.\n\n\t* magick/Makefile.am (noinst_HEADERS): integral_types.h had to be\n\tlisted *somewhere* in order to make it into the distribution.\n\n\t* Magick++/lib/Magick++/Image.h: InitializeMagick must be DLL\n\texported.\n\n2003-05-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (magick-version): Perform version.isx substitutions\n\tvia Makefile.am rather than configure.\n\n\t* magick/magick_config_api.h.in: Added template header for\n\tthe installed magick_config.h.\n\n\t* magick/magick.c (InitializeMagick): Improved the signal handling\n\tand registration method. Signal handlers are only registered for a\n\tsignal if the current signal handling disposition for that signal\n\tis set to the default (SIG_DFL). When a signal is caught,\n\tDestroyMagick is invoked, the handling for the signal is set back\n\tto SIG_DFL, and then the signal is re-raised to trigger the\n\tdefault handler for that signal. This causes the process to behave\n\tas closely to the default as possible (e.g. generating a core\n\tfile) while ensuring that DestroyMagick is executed. This also\n\tensures that signal handlers registered by API users are not\n\toverridden by invoking InitializeMagick.\n\n\t* configure.ac: Added tests for sigemptyset and\n\tsigaction.\n\tAdd a check for the return type of signal handlers.\n\tTest for the `raise` function.\n\n\t* www/formats.html: Add an entry for CUR, Microsoft\n\tCursor Icon format.\n\n2003-05-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/semaphore.c (struct SemaphoreInfo): Added\n\t`locked` and `thread_id` members. These are used to record\n\tif the semaphore is locked, and to validate the thread\n\tID of the unlocker.\n\n\t* www/links.html: Added link to Nathan Day's MagickDocs\n\t\"ImageMagick and GraphicsMagick documentation project\"\n\tsite.\n\tAdded a link to an on-line article regarding the PHP front-end\n\tto ImageMagick.\n\n\t* coders/icon.c (ReadIconImage): Add support for Windows\n\t.CUR format based on advice from Jean Piquemal.\n\n\t* magick/image.c (SetImageInfo): Added missing CloseBlob\n\tin error path for failure to allocate temporary file.\n\n\t* coders/pcx.c (ReadPCXImage): Added support for reading\n\tuncompressed PCX images based on code from Jean Piquemal.\n\n2003-05-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (AddNoiseImage): For gray images, wrong\n\tpointer was being used to evaluate intensity, leading to a\n\tblack image with noise.\n\t* magick/image.c (ChannelImage): Return the channel\n\timage in RGBColorspace. Also properly support extracting\n\tthe opacity channel for images which are not CMYK.\n\n2003-04-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/Makefile.am (install-data-local): Install\n\tmagick_config_api.h rather than magick_config.h.\n\n\t* magick/api.h: Removed inclusion of integral_types.h from\n\tmagick/api.h.  It is included by magick/studio.h.\n\n\t* magick/delegate.h: Mapped out a block of private implementation\n\tcode.\n\n\t* configure.ac: Perform substitutions on magick_config_api.h.\n\n\t* magick/magick_config_api.h.in: New header file template to\n\tuse for installed magick_config.h.\n\n\t* magick/studio.h (MAGICK_IMPLEMENTATION): Added the define\n\tMAGICK_IMPLEMENTATION used to enable private types, includes, and\n\tdefines in the headers. This supports hiding implementation stuff\n\tthat API users shouldn't see in the headers.\n\n\t* utilities/Makefile.am (check): Cleaned up the utilities\n\ttest/demo a bit as well as using the undocumented \"tmp:\" prefix to\n\tcause GraphicsMagick to remove temporary input files once they\n\thave been read.  This leaves just the final output file\n\t\"demo.miff\" when the test completes.\n\n\t* coders/jpeg.c (WriteJPEGImage): If the image resolution is\n\toverwritten with 72DPI, make sure that the resolution units are\n\tset to PixelsPerInchResolution.\t\n\n\t* coders/jpeg.c (WriteJPEGImage): Don't overwrite the image\n\tresolution if it is valid.\n\n\t* magick/command.c (MogrifyImageCommand): Added -resample\n\toption to match documentation.\n\n\t* VisualMagick/configure: Added rpcrt4.lib to project settings\n\tfor Visual C++ 6.0 so that configure links.  The code which\n\tneeds these interfaces is to support Visual C++ 7.0 XML-style\n\tproject files.\n\n2003-04-30  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* utilities/Makefile.am (check) Change % to %% in -label parameter.\n\n\t* www/gm.html, utilities/gm.1, etc. Documented use of %% to convey\n\tthe % sign in -format, -comment, -label strings.\n\n2003-04-30  William Radcliffe <billr@corbis.com>\n\n\t* magick/command.c: Changes from 2003-04-19 to free the arg\n\tlist when it was still pointed to by the option arg and accessed\n\ton an exception. This caused gm to crash on any erroneous command\n\tline argument.\n\n2003-04-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/windows.html: Updated to match current installer.\n\n\t* VisualMagick/installer/inc/tasks-install-devel.isx (Name): \n\tAdded an installation checkbox so the user can select to install\n\tdevelopment headers and libraries for C & C++.\n\n\t* VisualMagick/installer/inc/files-perlmagick.isx (Source):\n\tOnly install PerlMagick PPD files if the user selects to install\n\tPerlMagick.\t\n\n\t* VisualMagick/installer/inc/files-com.isx (Source): Only\n\tinstall ImageMagickObject files if the user selects to install\n\tImageMagickObject.\n\n\t* magick/version.h.in: Added some documentation for the\n\tfunctioning of MagickLibVersion and MagickLibVersionNumber.\n\n\t* configure.ac: Perform substutions to create\n\tVisualMagick/installer/inc/version.isx from\n\tVisualMagick/installer/inc/version.isx.in. This allows Windows\n\tversioning info to be updated from info in version.sh.\n\n\t* Makefile.am (magick-version): For a VPATH build, update\n\tVisualMagick/installer/inc/version.isx in the source directory if\n\tit is out of date.\n\n2003-04-28  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/cache.c: CloneImagePixels(): applied Cristy's bugfix\n\tfrom IM-5.5.7.\n\n2003-04-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/api.html: The demo program on the ImageMagick API page is\n\tusually intended to be an exercise for the reader.  It rarely\n\tcompiles or works.  Sure enough the demo code was not even close\n\tto compiling, didn't run, and did something totally different than\n\tdescribed. This is not a good way to treat new users.  Now the\n\tdemo program compiles and runs, and its description is correct.\n\n\t* www/magick.css, www/smile.c: Remove \"Pair\" advertisement which\n\twas discovered appended at the end of these files.\n\n\t* coders/jpeg.c (ReadJPEGImage): Check for failure of\n\tAllocateImage.  Close blob prior to error return.\n\n\t* configure.ac: Perform substitutions on magick/version.h\n\n\t* magick/version.h.in: New file to provide base for configured\n\tmagick/version.h\n\n\t* version.sh (PACKAGE_RELEASE_DATE): Support setting a package\n\trelease date.\n\n\t* configure.ac: Perform substitutions on PerlMagick/Magick.pm.in to\n\tcreate PerlMagick/Magick.pm.in.\n\n\t* PerlMagick/Magick.pm.in: @PACKAGE_VERSION@ is substituted while\n\tconfiguring PerlMagick/Magick.pm.\n\n\t* magick/magic.mgk, VisualMagick/bin/magic.mgk: Removed risky\n\tentry for PICT which has been demonstrated to lead to a false\n\tmatch in the real-world.\n\n\t* coders/pict.c (ReadPICTImage): Ensure that PICT decoder don't\n\tloop forever with an EOF condition if none of the PICT op-codes\n\tencountered result in a condition which terminates the input loop.\n\tIf EOF is dectected while in the input loop a \"corrupt image\"\n\t\"unexpected end of file\" error is reported.\n\n\t* VisualMagick/installer: Updated installer.\n\n2003-04-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c, magick/blob.c, magick/studio.h: Added\n\tCompilation fixes recommended by Harold Bien for for Borland C++.\n\n\t* www/contribute.html: Added text regarding contributing to\n\tGraphicsMagick.\n\n\t* www/api/types.html: Documentation for GraphicsMagick API types\n\tmoved from www/api/types/*.html into this one file.  Types\n\tdocumentation is still very much under development.\n\n\t* README.txt: Added note regarding the download location for free\n\tWindows fonts which are kindly made available by Microsoft.\n\n\t* VisualMagick/installer/gm-dynamic-full-*.iss: Install\n\tnt_base.h and nt_feature.h.\n\n2003-04-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/windows.html: Updated for GraphicsMagick 1.0 and to\n\tlink to ImageMagickObject.html.\n\n\t* www/programming.html: Added link to ImageMagickObject.html.\n\n\t* www/ImageMagickObject.html: New file to provide some\n\tdocumentation for ImageMagickObject.\n\n\t* www: Found and fixed broken URL links.\n\n2003-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* FlashPIX: Applied patches from FreeBSD.  Bumped package\n\tversion to version to 1.2.0.8.\n\n\t* www/api.html: Updated to reflect GraphicsMagick\n\n\t* www/*.html: Updated with format_c_api_docs script.\n\n\t* Makefile.am (format_c_api_docs): Add a target to update\n\tthe C API documentation.\n\n\t* scripts/format_c_api_docs: Add script which extracts and\n\tformats the C API documentation into HTML files in the www/api\n\tsubdirectory.\n\n2003-04-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh (PACKAGE_VERSION): Update release version ID.\n\n\t* magick/version.h (MagickReleaseDate): Update release date.\n\n\t* magick/constitute.c (ConstituteImage): Fixed problems with\n\treading intensity (gray) pixel arrays.\n\n\t* magick/image.c (GrayscalePseudoClassImage): Use\n\tScaleQuantumToIndex rather than ScaleQuantumToMap.\n\n\t* magick/constitute.c (ConstituteImage): Use ScaleQuantumToIndex\n\tmacro to scale integral intensity values to colormap range.\n\n\t* magick/image.h (ScaleQuantumToIndex): New macro to scale a\n\tquantum to the maximum range of a colormap index.  Useful when\n\twriting to PsuedoClass grayscale images.\n\n\t* VisualMagick/tests/run_constitute.bat: Batch script to run\n\tconstitute tests.\n\n\t* VisualMagick/installer/*.iss: Updated for Beta1 release.\n\n2003-04-22  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* utilities/Makefile.am (check) fixed typos (RM -> RMDelegate\n\tand removed stray \"gm\"), added -random-threshold, ordered-dither.\n\n\t* magick/effect.c: Random-threshold was not treating non-gray\n\tPseudoColor images correctly.\n\n2003-04-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/Makefile.am (check): Added code to put logo on demo\n\toutput.\n\n\t* magick/command.c (MontageImageCommand): Pass exception rather\n\tthan &image->exception because image may be null, and it is\n\tpointless to store the exception where it will not be reported to\n\tthe user anyway.\n\n\t* utilities/Makefile.am (check): Ported Glenn Randers-Pehrson's\n\tutilities demo script into the Makefile to serve as a check\n\ttarget.\n\t(check): Add definition to find Generic.ttf.\n\n\t* locale/C.mgk: Fixed syntax error in <Option><FatalError>\n\tsection.\n\n\t* www/development.html: New file to describe development\n\tprocess.\n\n\t* index.html, www/*.html: Added link to development.html\n\tand improved formatting a bit.\n\n2003-04-21  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Fixed bug with compiling png.c with libpng versions\n\tolder than libpng-0.95.\n\n2003-04-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/programming.html: Added links to Delphi and Scheme\n\tprogramming interfaces.\n\n\t* configure.ac : Removed outdated test for jp2conf.h.\n\n2003-04-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Add argument expansion and deallocation code\n\tto command functions which lacked this functionality.\n\tReplace calls to Exit with a return to the invoking function.\n\n\t* utilities/gm.c: Expect each subcommand to expand and deallocate\n\tits own argument list.  Treat subcommands more similarly.\n\n\t* magick/magick.c (InitializeMagick): Seed the random number\n\tgenerator.\n\n\t* magick/utility.c (ExpandFilenames): Handle tilde expansion\n\tproperly. Handle relative glob specifications. Skip over \"*\"\n\targument to +profile properly. Don't expand VID: specifications\n\tsince the VID: coder will execute ExpandFilenames() later. Apply\n\tformat specifier prefix to globbed file names. Fix double frees\n\tand rationalize memory management by always copying to a new\n\tvector.\n\n2003-04-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (InitializeMagick): Decided to\n\tmove clean-up signal-handler registration from gm.c\n\tto magick.c in order to ensure that resources are\n\tcleaned up for all library users. This means that\n\tif a user program wants to do something special for\n\tsignals registered to be caught by InitializeMagick\n\t(SIGHUP, SIGINT, SIGQUIT, SIGABRT, SIGTERM, SIGXCPU,\n\t& SIGXFSZ) then the user program should register its\n\town signal handlers after invoking InitializeMagick.\n\tThe user is then responsible for making sure that\n\tDestroyMagick is invoked if an unexpected signal is\n\tcaught.\n\n\t* tests/Makefile.am (check-constitute): Added\n\tconstitute tests.\n\n\t* magick/constitute.c: New test program to ensure\n\tthat ConstituteImage and DispatchImage are working\n\tcorrectly.\n\n2003-04-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/download.html: Added links to directories\n\tat ftp.graphicsmagick.org.\n\n\t* index.html: Add notice regarding 1.0 Beta0\n\tavailability.\n\n\t* www/cvs.html: Updated CVS checkout information to\n\tinclude the GraphicsMagick-1_0 branch.\n\n\t* coders/psd.c (ReadPSDImage): Applied patch\n\t(SourceForge patch ID 722849) from Derry Bryson to\n\tfix a memory leak. An image was being leaked.\n\n\t* magick/constitute.c (DispatchImage): Applied patch\n\t(SourceForge patch ID 722655) from Derry Bryson to\n\tcorrectly use the switch_map array rather than the\n\tmap array.  Without this patch, DispatchImage does\n\tnot work at all.\n\n\t* GraphicsMagick 1.0.0-beta0 release.\n\n\t* version.sh: Updated for beta0 release.\n\n\t* *.c magick/*.h: Update header inclusion to include\n\t\"magick/\" prefix in order to ensure that there is no\n\tconfusion with headers from another package.\n\n2003-04-16  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/effect.c: 4x4 ordered dither threshold was\n\tincorrect.\n\n2003-04-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c (InitializeMagickResources):\n\tAdded the ability to obtain the amount of physical\n\tmemory by executing an external command.\n\n\t* configure.ac: Check for getpagesize().\n\t(MAGICK_PHYSICAL_MEMORY_COMMAND): Added a test for\n\tan external command which (quickly) returns the\n\tamount of physical memory installed on the machine.\n\tCurrently only activated for FreeBSD.\n\t(MAGICK_PHYSICAL_MEMORY_COMMAND): Use sysctl to\n\tdetermine total physical memory for Darwin.\n\n\t* magick/delegate.c (ListDelegateInfo): If COLUMNS\n\tenvironment variable is set, then use it to obtain\n\tthe screen width.  Some shells dynamically update\n\tCOLUMNS, but COLUMNS may need to be explicitly\n\texported in order for it to be seen by subordinate\n\tprograms (such as gm).\n\n\t* magick/effect.c (AddNoiseImage): Use IsGrayImage()\n\tto check if the image is gray.  Add missing columns\n\tloop for intensity case (oops!).\n\n\t* magick/command.c (DisplayImageCommand): Fix\n\t-dispose option processing bug reported by \n\tFelix Heimbrecht.\n\n\t* coders/fpx.c: Check status from FPX_InitSystem().\n\n2003-04-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Define PERLMAINCC to be the C compiler\n\tif there are no C++ dependencies, or the C++ compiler\n\tif there are C++ dependencies.\n\n\t* PerlMagick/Makefile.PL.in: Use PERLMAINCC to compile\n\tand link perlmain.c.  This allows using the C++ compiler\n\tto link, which is useful when the build depends on C++\n\tlibraries like libfpx.\n\n\t* ltmain.sh: Updated to libtool 1.5 release.\n\n\t* Makefile.am ($(PERLMAGICK)/$(PERLSTATICNAME)): Add\n\trules to make sure that static PerlMagick is linked\n\tagainst the current GraphicsMagick library.\n\n\t* coders/miff.c (ReadMIFFImage): Properly scale\n\tcolormap entries.\n\n\t* magick/image.c (TransformRGBImage): Eliminate 32-bit\n\tinteger overflow condition for Q:32 build while\n\ttransforming CMYK pixels.\n\n2003-04-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/ttf/read.t: Updated signatures and\n\treference image for FreeType 2.1.4.\n\n\t* (PerlMagick/t/write.t, PerlMagick/t/montage.t,\n\tPerlMagick/t/rad/read.t, PerlMagick/t/rad/write.t):\n\tFix signatures which were thrown off by previous\n\tchange to how signatures are specified to functions\n\tin subroutines.pl.\n\n\t* PerlMagick/t/cgm/read.t: Updated to use reference\n\timage.\n\n\t* PerlMagick/Makefile.PL.in: Perform substitutions\n\ton generated Makefile to ensure that the proper\n\t-lGraphicsMagick is used for a static build.\n\n\t* ttf: Updated to FreeType 2.1.4.  Now stored in\n\tCVS as delegates/freetype2 rather than delegates/ttf\n\tso be sure to re-checkout the ttf directory so that\n\tthe correct files are used.\n\n\t* wmf/incude/libwmf/api.h: Updating FreeType caused\n\ta problem since it introduced a copy of zlib and\n\tapi.h included zlib.h.  Fixed problem by adding\n\ta typedef for gzFile and not including zlib.h.\n\n\t* utilities/gm.c: Fixed minor compilation problem\n\tunder Windows caused by a typo in the signal\n\thandler registration code.\n\n2003-04-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: When building a static PerlMagick,\n\tbuild PerlMagick as part of the `all` target and\n\tdon't do a `make clean` of PerlMagick at install\n\ttime.\n\n\t* configure.ac (LIB_DPS): Add check to see if -lXt\n\tis required by -ldps.  XFree86 -ldps requires -lXt.\n\n\t* FlashPIX: FlashPIX library now compiles under\n\tFreeBSD 5.0.\n\n\t* magick/deprecate.c (ValidateColormapIndex): Remove\n\tnon-interface deprecated function.\n\n\t* magick/tempfile.c (AcquireTemporaryFileDescriptor):\n\tPriortize use of mkstemp() over tempname() since *BSD\n\tcompilers whine about tempname() (although we do use\n\ttempname() safely).\n\n\t* magick/color.c (ConstrainColormapIndex): Removed\n\tfunction since it is no longer used.\n\n\t* magick/utility.c (TemporaryFilename): Removed\n\tTemporaryFilename utility function since it is\n\tno longer used and it makes *BSD compilers\n\tcomplain.\n\n\t* magick/studio.h: Don't define _ISOC99_SOURCE,\n\t_POSIX_C_SOURCE, or _XOPEN_SOURCE when compiling\n\tunder FreeBSD since this maps out a `ushort`\n\tdefinition required by /usr/include/sys/ipc.h.\n\n2003-04-11  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/png.c: Some grayscale PNG images and the\n\tJNG alpha channel were decoded improperly at Q:32.\n\n\t* magick/constitute.c (PopImagePixels): Changed many\n\tinstances of (Quantum) typecast to (unsigned char).\n\n2003-04-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/tiff/read.t: Added signature for 12-bit\n\tTIFF test and a Q:32 build.\n\n\t* PerlMagick/t/subroutines.pl: Extended routines\n\twhich are signature based to accept signatures for\n\tQ:32 as well.\n\n\t* PerlMagick/t/wmf/read.t: Relax error values slightly\n\tto pass at Q:32.\n\n\t* coders/miff.c (PushImageRLEPixels): Fix reading\n\tRLE MIFF at Q:32.  A fragment of old code was being\n\tused to obtain the length.\n\t(WriteRunlengthPacket): Fix writing RLE MIFF at Q:32.\n\tIn most cases the wrong scaling macro was being used.\n\n\t* tests/Makefile.am (check-miff): Added MIFF tests\n\tfor supported compression options.\n\n2003-04-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/color.c (QueryColorDatabase): Extended to\n\tsupport parsing Q:32 hex color specification strings.\n\tAlso add error reporting for failure to parse the\n\tcolor specification. This resolves a bug that drawing\n\tvia the draw.c APIs was not working for Q:32 builds.\n\n\t* utilities/gm.c (main): Add signal handlers to\n\tmake sure that program cleans-up on exit by invoking\n\tDestroyMagick.\n\n\t* magick/draw.c (DrawSetFillColor): Quote color\n\tspecification.\n\t(DrawSetStrokeColor): Quote color specification.\n\t(DrawSetTextUnderColor): Quote color specification.\n\n\t* ltmain.sh: Update to latest CVS libtool.\n\n2003-04-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/enhance.c (NormalizeImage): Only normalize the opacity\n\tchannel if image->matte is true. This results in some (15%)\n\tspeedup. While it can be argued that the `K` in CMYK should be\n\tnormalized, it can also be argued that this is senseless since `K`\n\tis not a \"linear\" measure like C, M, & Y are, and there may not be\n\tany any value to normalizing CMY at all.\n\t(EqualizeImage): Only equalize the opacity channel if image->matte\n\tis true.  This results in a 23% speedup.\n\t(GammaImage): Minor loop optimization.\n\t(LevelImage): Don't level the opacity channel.  Doing so doesn't\n\tmake any sense.\n\t(LevelImageChannel): Put loops inside switch statement rather than\n\taround it.\n\n\t* PerlMagick/t/tiff/read.t: Added grayscale 12-bit and 16-bit TIFF\n\tread tests.\n\n2003-04-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Add support for reading\n\t12-bit grayscale TIFFs. Fix reading 16-bit grayscale TIFFs\n\twhen QuantumDepth=8.\n\n\t* VisualMagick/installer/gm-dynamic-full-8.iss,\n\tVisualMagick/installer/gm-dynamic-full-16.iss: Many C header\n\tfiles were not being included in the distribution.  Oops!\n\n2003-04-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* (index.html, www/*.html): Update to new web page style.\n\n\t* scripts/txt2html: Update to output new web page style.\n\n\t* ltmain.sh: Updated to latest CVS libtool.\n\n\t* magick/tempfile.c (DestroyTemporaryFiles): Function was\n\tcrashing if it was executed twice.\n\n2003-04-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/delegates.mgk.in: Ralcgm was appending \".ps\" to the\n\tprovided output file name, so change cgm delegate command so that\n\tthe input file is delivered via standard input, output is\n\tre-directed to a file, and anything printed to stderr (such as\n\tthe Ralcgm program name and version) is sent to /dev/null.\n\n\t* INSTALL-unix.txt: Added/corrected/improved documentation\n\tregarding --disable-installed, --enable-shared, and\n\t--with-modules.\n\n\t* VisualMagick/magick/magick_config.h.in: Add more documentation\n\tand explanatory notes in order to lessen confusion.\n\n\t* Many files: Replaced \"UseInstalledImageMagick\" with\n\t\"UseInstalledMagick\" for obvious reasons.\n\n2003-04-04  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/command.c, utilities/gm.c: Print \"help\" screen for a\n\ttool when user types \"gm tool\" or \"gm tool -help\"\n\n\t* magick/command.c, magick/effect.c: add -ordered-dither option.\n\n2003-04-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* locale/C.mgk: Fixed message associated with\n\t\"UnableToCreateTemporaryFile\".\n\n\t* magick/tempfile.c (AcquireTemporaryFileDescriptor): Decided\n\tto return a pathname (if possible), even on failure, for use\n\tin error reports.  The function return status should be used\n\tto determine if the function has succeeded.\n\n\t* locale/locale.mgk: Updated copyright header.\n\n\t* (magick/annotate.c, magick/attribute.c, magick/blob.c,\n\tmagick/cache.c, magick/constitute.c, magick/delegate.c,\n\tmagick/display.c, magick/image.c, magick/locale.c\n\tmagick/tempfile.c, magick/tempfile.h, magick/utility.c,\n\tmagick/xwindow.c, coders/dcm.c, coders/ept.c,\n\tcoders/histogram.c, coders/mpeg.c, coders/pdf.c,\n\tcoders/pict.c, coders/preview.c, coders/ps2.c,\n\tcoders/ps3.c, coders/ps.c, coders/pwp.c, coders/sfw.c,\n\tcoders/svg.c, coders/tiff.c, coders/url.c, coders/wpg.c):\n\tEnsure that failure to allocate/create temporary file is\n\tproperly detected and reported.\n\n2003-04-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/type.c (GetTypeBlob): Prioritize hard-coded path\n\tover Windows registry values.\n\n\t* magick/log.c (GetLogBlob): Prioritize hard-coded path\n\tover Windows registry values.\n\n\t* magick/blob.c (GetConfigureBlob): Prioritize hard-coded path\n\tover Windows registry values.\n\n\t* magick/delegate.c (ReadConfigureFile): Perform substitutions\n\tfor \"@GMDelegate@\", \"@GMDisplayDelegate@\", \"@MPEGDecodeDelegate@\",\n\t\"@MPEGEncodeDelegate@\", and \"@HPGLDecodeDelegate@\" while reading\n\tdelegates.mgk under windows.\n\t(ListDelegateInfo): Format delegate command line to multiple\n\tlines if necessary rather than truncating.\n\n\t* configure.ac (MagickBinPathDefine): Added support for\n\ta MagickBinPath definition.\n\n\t* configure.ac (GSVersion): Added test to obtain version\n\tof installed Ghostcript.\n\n\t* magick/tempfile.c (AcquireTemporaryFileDescriptor): Open\n\tflag should have been O_RDWR, not O_WRONLY!\n\n2003-04-03  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/utility.c: Simplified skipping over the \"*\" in\n\tthe +profile \"*\" option when expanding filenames.\n\n2003-04-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/bin/delegates.mgk: Update similarly to\n\tcoders/delegates.mgk.in.\n\n\t* coders/delegates.mgk.in: Replaced `mpeg-decode` delegate\n\tspecification with `mpeg` delegate specification.\n\n\t* PerlMagick/t/mpeg/read.t: Since -r option is no longer\n\tsupplied to mpeg2decode, the signatures must be updated.\n\n\t* magick/utility.c (ExpandFilenames): Skip over no-argument\n\tcommands properly.\n\n\t* coders/mpeg.c: Removed ReadMPEGImage since this is handled\n\tentirely by delegate now.\n\n\t* magick/command.c: Add convert -temporary option for use\n\twhen input files are temporary files which should be\n\tautomatically removed.\n\n\t* magick/delegate.c (InvokeDelegate): Ensure that temporary\n\tfile access is secure.\n\n\t* coders/ept.c (ReadEPTImage): Ensure that temporary file\n\tspecified by image_info->filename is liberated before\n\tallocating a new temporary file name.\n\n\t* coders/ps.c (ReadPSImage): Ensure that temporary file\n\tspecified by image_info->filename is liberated before\n\tallocating a new temporary file name.\n\n\t* coders/pdf.c (ReadPDFImage): Change TemporaryFilename\n\tto AcquireTemporaryFileName.\n\n\t* magick/tempfile.c (LiberateTemporaryFile): Now takes\n\ta `char *` argument rather than `const char *`, and\n\terases the provided filename if it is the name of a valid\n\ttemporary file. This helps avoid errors. The return\n\tstatus may be used to determine if a file was removed.\n\t(AcquireTemporaryFileDescriptor): Decided that adding a\n\t.tmp extension to temporary file names is unnecessary.\n\n\t* coders/jp2.c (WriteJP2Image): Destroy pixel matrix\n\tafter encoding image.  Cristy says that there is memory\n\tcorruption otherwise.\n\n2003-04-01  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/png.c: Use new temporary file manager for JNG components.\n\tMerge with IM 5.5.7 (mostly cosmetic changes).\n\n2003-03-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/cache.c (OpenCache): Add some Windows-specific\n\topen options.\n\n\t* magick/resource.c (InitializeMagickResources): Increase\n\tthe number of \"lowio\" file handles available for use under\n\tWindows.\n\n\t* ltdl/ltdl.c: Incorporate more Darwin fixes from CVS libtool.\n\n\t* coders/pcx.c (ReadPCXImage): Incorporate bugfix from\n\tImageMagick -- Not enough memory allocated for reading PCX\n\t(bug report by Trevor Willis).\n\n\t* magick/magick.c (InitializeMagick): Only invoke\n\tSetLogEventMask() to set debug options based on\n\tgetenv(\"MAGICK_DEBUG\") if the environment variable is set.\n\n2003-03-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/tempfile.c: Include tempfile.h rather than temporary.h\n\n\t* magick/magick.c: Include tempfile.h rather than temporary.h\n\n\t* coders/dcm.c, coders/ept.c, coders/histogram.c, coders/mpeg.c,\n\tcoders/pdf.c, coders/pict.c, coders/preview.c, coders/ps.c,\n\tcoders/ps2.c, coders/ps3.c, coders/pwp.c, coders/sfw.c,\n\tcoders/svg.c, coders/tiff.c, coders/url.c, coders/wpg.c,\n\tmagick/annotate.c, magick/attribute.c, magick/blob.c,\n\tmagick/cache.c, magick/constitute.c, magick/delegate.c,\n\tmagick/display.c, magick/image.c, magick/magick.c,\n\tmagick/utility.c, magick/xwindow.c: Updated to use new temporary\n\tfile allocation APIs.\n\n\t* magick/tempfile.c: New temporary file allocation subsystem for\n\tallocating, tracking, and deallocating temporary files.  Use of\n\tthis subsystem should reduce the likelyhood that temporary\n\tfiles will be left behind once the process exits.\n\tIf the environment variable MAGICK_TMPDIR is set, then its\n\tvalue is used as the location to place temporary files.\n\n\t* magick/utility.c (IsAccessibleAndNotEmpty): New function\n\tfor testing for file exists, is a regular file, and is not empty.\n\tUsed to test if a temporary file has been updated by a delegate.\n\n\t* magick/log.c (SetLogEventMask): Add support for setting\n\tTemporaryFileEvent.\n\n\t* PerlMagick/Magick.xs: Added TemporaryFile log event type.\n\n\t* magick/log.h (LogEventType): Add TemporaryFileEvent event\n\tclassification.\n\n2003-03-29  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/resize.c (SampleImage) and magick/render.c (DrawAffineImage():\n\tApplied Cristy fix for bug that offset images to the top and left.\n\n\t* magick/resize.c (ScaleImage): Fixed bug that caused intensity\n\tlevels to be one unit too high.\n\n\t* coders/png.c: make JNG support depend on HasJPEG. Remove temp files.\n\n2003-03-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resize.c (ResizeImage): Applied fix authored by John\n\tCristy for distortion when using the bessel filter.\n\n\t* magick/display.c: Applied fix authored by John Cristy which\n\teliminates bogging down when using the magnifier window on\n\tlarge images.\n\n\t* Several files: A few files included multiple copies of the\n\tcopyright header text due to either pilot error, or equipment\n\tfailure.\n\n2003-03-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/Makefile.am : Removed some debug code which was\n\taccidentally committed to CVS.\n\n\t* Copyright.txt: Add copyright statements to all the files,\n\tincluding some apparently missing copyrights.\n\n2003-03-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\t* magick/Makefile.am: Added temporary.c and temporary.h. These\n\tare not finished yet.\n\n\t* magick/cache.c: Transferred optimization from ImageMagick\n\tto read/write all requested pixel cache rows in one system\n\tcall when accessing the cache using file I/O, and the\n\trequested columns equals the image columns.\n\n\t* magick/resource.c: (ResourceInfo): Use type `double` rather\n\tthan `long double`. For many systems, the range of `long double`\n\tis the same as `double`.  On others, use of `long double` incurs\n\tthe cost of function calls since there is no hardware support.\n\n2003-03-22  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/effect.h, effect.c, command.c: Revised -random-dither\n\tto require parameters: channel LOWxHIGH.  Channel can presently\n\tbe \"intensity\", \"opacity\", or \"all\".\n\n2003-03-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ltdl/ltdl.c: Updated to latest CVS version.  Claimed to\n\tsupport loading modules under MacOS-X.\n\n\t* magick/resource.c (InitializeMagickResources): Enable code\n\tunder Windows which queries system limits.\n\n\t* magick/cache.c (S_MODE): Fixed portability problems with\n\tdefinition.\n\n\t* VisualMagick/bin/delegates.mgk: Fix typo in \"mpeg-decode\"\n\tdecode rule.\n\n\t* libtool: Update to latest CVS version.\n\n\t* configure.ac: Test zlib for gzseek and gztell.\n\n\t* magick/effect.c (ChannelThresholdImage): The is_grayscale flag\n\twas not be evaluated correctly.\n\n2003-03-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h (RoundSignedToQuantum): Added handy\n\tRoundSignedToQuantum macro for munging doubles into Quantums.\n\n\t* magick/effect.c (ThresholdImage): Added optimizations for\n\tthresholding all pixels to white or black. Threshold using an\n\tintegral value rather than a double so compares are faster.\n\t(ChannelThresholdImage): Threshold against integral values since\n\tcompares are faster. Invoke ThresholdImage for simple thresholding\n\tacross all channels since it is faster.\n\n2003-03-19  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/meta.c: #ifdef'ed out some dead code.\n\n\t* magick/annotate.c: #ifdef'ed out some code that is only\n\tused when HasTTF is defined.\n\n\t* Added RandomThresholdImage() method and -random-threshold\n\tcommandline option.\n\n2003-03-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac (LIB_TIFF): Check for TIFFReadRGBATile and TIFFReadRGBAStrip\n\tin libtiff before deciding to use it.\n\n\t* magick/blob.c (WriteBlob): Move pointer increment into\n\tparanthesis.\n\t(ReadBlob): Move pointer increment into paranthesis.\n\n\t* magick/gem.c (HSLTransform): Removed inline statement.\n\t(TransformHSL): Removed inline statement.\n\n\t* magick/random.[c|h]: Removed files from CVS.\n\n\t* magick/command.c: Don't include random.h.\n\n\t* PerlMagick/t/reference/jng: Update reference files to current output.\n\n2003-03-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Added tests for pread and pwrite functions.\n\n\t* magick/image.c (GrayscalePseudoClassImage): Properly invoke\n\tSyncImagePixels.\n\n\t* magick/cache.c (SyncCacheNexus): Add back in is_monochrome and\n\tis_grayscale flag resetting which was lost by copying over\n\tImageMagick's cache.c.\n\t(FilePositionRead): Inline wrapper for reading a chunk of data at\n\tan offset.\n\tCleans up some messy code, and makes it easy to use pread().\n\t(FilePositionWrite): Inline wrapper for writing a chunk of data at\n\tan offset.\n\tCleans up some messy code, and makes it easy to use pwrite().\n\tCache now uses pread() and pwrite() to access the cache if these\n\tcalls are available.\n\n\t* magick/resource.c (InitializeMagickResources): Support setting\n\tresource limits via the environment variables MAGICK_LIMIT_DISK,\n\tMAGICK_LIMIT_FILES, MAGICK_LIMIT_MEMORY, and MAGICK_LIMIT_MAP.\n\n2003-03-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/stream.c (AcquirePixelStream): Store total pixels in\n\t64-bit type.\n\t(SetPixelStream): Store total pixels in 64-bit type.\n\n\t* coders/tiff.c (WriteTIFFImage): CoderError should be\n\tMissingDelegateError.\n\n\t* coders/ps3.c (Huffman2DEncodeImage): CoderError should be\n\tMissingDelegateError.\n\t(WritePS3Image): CoderError should be MissingDelegateError.\n\n\t* coders/ps2.c (Huffman2DEncodeImage): CoderError should be\n\tMissingDelegateError.\n\n\t* coders/pdf.c (Huffman2DEncodeImage): CoderError should be\n\tMissingDelegateError.\n\n\t* coders/fpx.c (ReadFPXImage): CoderError should be\n\tMissingDelegateError.\n\t(WriteFPXImage): CoderError should be MissingDelegateError.\n\n\t* coders/dps.c (ReadDPSImage): CoderError should be\n\tMissingDelegateError.\n\n\t* magick/image.c (AnimateImages): DelegateError should be\n\tMissingDelegateError.\n\n\t* magick/annotate.c (RenderX11): DelegateError should be\n\tMissingDelegateError.\n\n\t* magick/image.c (DisplayImages): DelegateError should be\n\tMissingDelegateError.\n\n2003-03-17  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/image.c Relocated misplaced break in ChannelImage()\n\tand sped up SetImageOpacity by avoiding blend operation when\n\tsetting the image fully opaque.\n\n2003-03-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/cache.c: Snarfed cache.c updates from ImageMagick.\n\n\t* magick/command.c: Added -list resource support.\n\n2003-03-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/Makefile.am (random.c): Removed building, packaging,\n\tand intialization of random.c functions since it is not actually\n\tused.\n\n\t* magick/semaphore.c (InitializeSemaphore): Only initialize\n\tcritical section if active_semaphore is not already true.\n\n\t* magick/resource.c: Snarf resource.c updates from ImageMagick.\n\n\t* PerlMagick/Magick.xs: Added missing log event types.\n\n\t* magick/log.h (enum): Added ResourceEvent enumeration.\n\n\t* magick/log.c (LogMagickEvent): fflush(stdout) at the end of\n\teach log.  Otherwise output may not be seen for a long time.\n\t(SetLogEventMask): Add support for \"-debug resource\".\n\n\t* coders/tiff.c (RegisterTIFFImage): Don't register encode and\n\tdecode handlers for TIFF if TIFF library is not available.\n\n\t* magick/constitute.c (WriteImage): Fix cut-n-paste error\n\tin log message (\"decoder\" --> \"encoder\").\n\n2003-03-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* index.html: Added a link to the GraphicsMagick mailing lists.\n\n\t* Magick++/demo/zoom.cpp: Added dashed option support, including\n\ta -resample option for image resampling.\n\n2003-03-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (DIST_SUBDIRS): Filters subdirectory needs to\n\tbe distributed.\n\n2003-03-14  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/render.c Ported Cristy's bugfix to DrawAffineImage().\n\n2003-03-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (DestroyImage): Comment out new assertions until\n\twe are certain that there are no ill effects.\n\n\t* coders/mat.c (ReadMATImage): Set image->depth to valid values.\n\n\t* PerlMagick/Magick.xs: Update so that new DestroyImage assertions\n \taren't asserted.\n\n\t* magick/list.c (DestroyImageList): Update so that new DestroyImage\n\tassertions aren't asserted.\n\n\t* coders/wpg.c (ReadWPGImage): Don't leave dangling pointer when\n\ttrimming list. Don't set image->depth to invalid values.\n\n2003-03-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (DestroyImage): Add assertions to verify\n\tthat destroyed image is not currently referenced by another\n\timage.  This should help prevent accidental continued use\n\tof a destroyed image.\n\t(DestroyImage): Added assertions to enforce that images\n\tshould not continue to reference the destroyed image.\n\n\t* coders/wpg.c: Incorporated fixes from Jaroslav Fojtik.\n\n\t* version.sh (PACKAGE_VERSION_ADDENDUM): Construct a package\n\tsnapshot version based on the ChangeLog modification time.\n\tThis requires GNU find to work propery since the -printf\n\toption is used.\n\n\t* configure.ac (LIB_GS): Do not test for the Ghostscript\n\tlibrary by default due to the issue of its embedded libjpeg\n\tconflicting with libjpeg.\n\n\t* coders/ept.c (ReadEPTImage): \"PostscriptDelegateFailed\" should\n\tbe classified as a DelegateError type.\n\n2003-03-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (BlobToFile): Truncate while opening file.\n\t(ImageToFile): Truncate while opening file.\n\n\t* magick/annotate.c (RenderFreetype): Missing freetype library\n\tshould result in a MissingDelegateError type rather than a\n\tDelegateError type.\n\n\t* INSTALL-windows.txt: Added a note regarding a workaround for\n\tinternal compiler errors while compiling image.c when using\n\tVisual C++ 7.0.\n\n\t* coders/jpeg.c (ReadICCProfile): Incorporate ImageMagick fix\n\tto handle short JPEG ICC profiles.\n\n\t* magick/integral_types.h: Ignore SIZEOF_LONG_LONG and\n\tSIZEOF_UNSIGNED_LONG_LONG defines if _VISUALC_ is defined.\n\n2003-03-11  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* www/gm.html, utilities/gm.1, guide/gm.tex: Expanded description\n\tof the -affine option.\n\n2003-03-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (GetImageDepth): Re-implemented using a single-pass\n\talgorithm and 1/2 the code. Previous implementation didn't return\n\tcorrect results for Q:32 build.  Now it does.\n\n\t* magick/command.c (IdentifyImageCommand): For identify, when\n\t%q format specifier is present, image must be read rather than\n\tpinged.  If not, either the value 8 is returned, or there is a\n\tcrash due to reading an uninitialized image.\n\n2003-03-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mat.c: Incorporate fixes from Jaroslav Fojtik.  Close\n\tBlob before rotating image.\n\n\t* PerlMagick/README.txt: Update to reflect that PerlMagick is\n\tpart of GraphicsMagick.\n\n\t* PerlMagick/t/input.mat: Added test image for Matlab format.\n\n\t* PerlMagick/t/input.wpg: Added test image for WordPerfect Graphics Format.\n\n\t* utilities/Makefile.am (ALLMANPAGES): Install gm.1 rather than\n\told utility manual pages.\n\n2003-03-09  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* www/gm.html, utilities/gm.1, guide/gm.tex: First cut at\n\tmanpage for gm, to replace individual utility manpages.\n\n2003-03-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c: Fix some erroneous log printf specifications.\n\tImproved blob log messages a bit. \n\n\t* magick/log.c (IsEventLogging): Use  InitializeLogInfo().\n\t(InitializeLogInfo): New function to intelligently initialize\n\tlogging subsystem.  Only locks when initialization may be required,\n\tand only locks long enough to determine if initialization is required.\n\tThis approach should avoid deadlocking while logging from functions\n\tused to initialize logging.\n\t(IsLogAccessible): No longer need this duplicate of IsAccessible().\n\t(SetLogEventMask): Use  InitializeLogInfo().\n\n\t* coders/fpx.c (ReadFPXImage): FlashPIX library does not support\n\tBLOB I/O so don't use OpenBlob/CloseBlob.  Opening the blob caused\n\ta conflict when the FlashPIX library attempted to open the file.\n\n2003-03-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Test for libtiff functions (TIFFClientOpen &\n\tTIFFIsByteSwapped), which are required by GraphicsMagick, but\n\tnot found in older libtiff versions.\n\n\t* magick/blob.c: Added logging for Blob open/close and memory\n\tmapping operations.\n\n2003-03-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwblob.c (main): DestroyImage asserts on NULL so only\n\tcall it for non-null image.\n\n\t* tests/rwfile.c (main): DestroyImage asserts on NULL so only\n\tcall it for non-null image.\n\n2003-03-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwblob.c (main): Add -pause option to require keypress to\n\texit program. Clean-up to avoid any appearance of leaks.\n\n\t* tests/rwfile.c (main): Add -pause option to require keypress to\n\texit program. Clean-up to avoid any appearance of leaks.\n\n\t* magick/static.c (ExecuteStaticModuleProcess): Don't bind in\n\tprocess filter functions for Visual C++ since the build environment\n\tdoesn't support it yet.\n\n\t* magick/log.c (GetLogBlob) Code wasn't actually testing current\n\tdirectory for log.mgk, now it does.\n\n\t* magick/log.c (IsEventLogging): Eliminate accidental recursive, or\n\trepeated, initialization of the logging system.\n\n2003-03-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (WriteJP2Image): Improved -quality rate estimation\n\tfor very small files.\n\n2003-03-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (WriteJP2Image): Add additional logging support.\n\n\t* tests/rwblob.c: Added BLOB read/write logging.\n\n\t* tests/rwfile.c: Added file read/write logging.\n\n\t* magick/module.c (FindMagickModule): Minor code cleanup and limit\n\tdirectory and file name lengths to sensible values.\n\n\t* magick/utility.c (IsAccessible): Log test failures along with\n\ttest failure reason [strerror(errno)]. Also log test success.\n\n\t* VisualMagick/bin/delegates.mgk: -DSAFER does not work with\n\tGhostscript 8.0.\n\n\t* magick/module.c: Needed to conditionally include nt_feature.h.\n\n2003-03-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/module.c (ExecuteModuleProcess): Updated to support locating\n\tfilter modules based on search rules.\n\t(CoderInfo): Declare only in module.c since use is private to this\n\tmodule.\n\t(GetCoderInfo): Made static and commented out since currently unused.\n\t(FindMagickModule): New function to search for a module.\n\t(GetModuleBlob): Moved from blob.c, made static, and re-implemented\n\tbased on FindMagickModule.\n\n\t* magick/blob.c: Moved GetTypeBlob() to type.c and made it static.\n\tMoved GetModuleBlob() to module.c and made it static.\n\n2003-03-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/Makefile.am: MIFF module does not depend on -ljpeg, but\n\tPNG module does (for JNG).\n\n\t* filters/analyze.c (AnalyzeImage): Bugfix, image should be passed\n\tas Image** rather than Image*.\n\n\t* magick/utility.c (IsAccessible): Don't log errno if errno==0.\n\n2003-03-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/Makefile.am: Link with libFilters convenience library.\n\n\t* VisualMagick/magick/magick_config.h.in: Change MagickModulesPath\n\tto MagickCoderModulesPath and add a MagickFilterModulesPath to\n\tlocate filter modules.\n\n\t* filters/Makefile.am: New makefile to build filter modules.\n\n\t* configure.ac: Configure magick/GraphicsMagick.pc and\n\tMagick++/lib/GraphicsMagick++.pc.\n\t(MagickModulesSubdir): Add quantum depth to modules path to ensure\n\tthat modules with the correct depth are loaded.  The modules path\n\tis now\n\t${libdir}/GraphicsMagick-${PACKAGE_VERSION}/modules-Q${QuantumDepth}/coders.\n\t(MagickCoderModulesPath): Rename MagickModulesPath to\n\tMagickCoderModulesPath.\n\t(MagickFilterModulesPath): Define to location of filter modules.\n\n\t* magick/Makefile.am: Added rules to install GraphicsMagick.pc.\n\n\t* magick/GraphicsMagick.pc.in: Added pkgconfig file for\n\t-lGraphicsMagick.\n\n2003-02-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (WriteJP2Image): Quality factor calculation had\n\taccidentally been removed.  The calculation is back, but has been\n\tbiased up slightly so that a quality factor of 75 results in a\n\tmore reasonable 16:1 compression. Past a quality factor of 99.5,\n\tthe compression is set to 1:1 (non-lossy).\n\n2003-02-27  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Fixed bug with reading interlaced PNG images, introduced\n\tyesterday.\n\n\t* Fixed bug with skipping MNG subimages, also introduced\n\tyesterday.\n\n2003-02-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (EXTRA_DIST): Forgot to distribute version.sh\n\n\t* configure.ac: Use definitions from version.sh to drive\n\tpackage versioning and naming. These definitions support\n\tlibtool's recommended approach to library versioning.\n\n\t* version.sh: New file for managing release versioning.\n\tEdit this file to change the release number, etc.\n\n\t* PerlMagick/t/tiff/read.t: Added read tests for stripped,\n\tplanar contiguous, and planar seperated TIFFs.\n\n\t* coders/tiff.c (ReadTIFFImage): Transferred stripped-TIFF\n\treading code from ImageMagick.\n\tEnumerated reading methods to make the logic more clear.\n\n2003-02-27  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* JNG alpha sample depth was sometimes inconsistent.\n\n\t* Bring only one line at a time into memory during PNG\n\tread/write (Merge with Cristy's 5.5.6 update).\n\n2003-02-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Makefile.PL.in (LIBS): Put MAGICKLIB first to\n\tdecrease the probability that the wrong libMagick is used\n\twhen linking static PerlMagick.\n\n\t* configure.ac (PerlMagick): Fix linker search path for\n\t-lGraphicsMagick when linking a static PerlMagick.  It seems\n\tthat libtool changed the location where it places static\n\tlibraries.\n\n\t* PerlMagick/t/tiff/read.t: Added test for reading tiled TIFF.\n\n\t* coders/tiff.c (ReadTIFFImage): Add optimized support for\n\treading tiled TIFFs.\n\t(ReadTIFFImage): Optimize loops for reading tiled TIFFs as well.\n\t(ReadTIFFImage): Eliminate compiler warning.\n\t(ReadTIFFImage): Add some missing error handling for tiled TIFF.\n\n2003-02-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Optimize RGBA transfer loop.\n\n2003-02-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawPrimitive): Return DrawPolygonPrimitive\n\tstatus (edit transferred from ImageMagick).\n\n\t* magick/utility.c (GetMagickGeometry): Scaling to an area now\n\tpreserves the image aspect ratio.\n\n2003-02-24  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* png.c: Added missing parentheses in typecast (cristy noticed\n\tthe bug that I introduced on 2/18).\n\n2003-02-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Add rules to produce www/README.html,\n\twww/INSTALL-mac.html, www/INSTALL-unix.html, www/INSTALL-vms.html,\n\tand www/INSTALL-windows.html\n\n\t* www/README.html: New file produced from README.txt\n\n\t* www/INSTALL-mac.html: New file produced from INSTALL-mac.txt.\n\n\t* www/INSTALL-unix.html: New file produced from INSTALL-unix.txt.\n\n\t* www/INSTALL-vms.html: New file produced from INSTALL-vms.txt.\n\n\t* www/INSTALL-windows.html: New file produced from INSTALL-windows.txt.\n\n\t* NEWS: Added news for GraphicsMagick 1.0.0.\n\n\t* magick/locale.c: Added error messages to support JP2.\n\n\t* locale/C.mgk: Added error messages to support JP2.\n\n\t* locale/locale.mgk: Update to GraphicsMagick copyright.\n\n\t* coders/jp2.c: Updated to use Jasper 1.700.1 interface\n\tconventions. Jasper 1.700.1 is required now. Support\n\treading arbitrary quantum sizes up to 16-bits.  Return\n\tgrayscale images as PseudoClass.\n\n\t* jp2/: Updated Jasper sources to version 1.700.1.\n\n2003-02-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (ReadJP2Image): Obtain channel indexes by\n\tID rather than assuming index value.  Validate that channel\n\tgeometry and encoding is supported.\n\n\t* magick/effect.c (ThresholdImage): Additional performance\n\toptimization. Work faster if image is already gray.\n\n2003-02-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (WriteJP2Image): Port to Jasper 1.7.\n\tFor Q:32, don't write 32-bit pixels rather than the\n\t16-bit pixels we told Jasper we would write.\n\t(WriteJP2Image): Back-port to Jasper 1.6.\n\n2003-02-18  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/modules.mgk: Added JNG entry.\n\n2003-02-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (RegisterJP2Image): Added registration for\n\t\"PGX\" magick tag.\n\n\t* magick/magic.mgk: Added entry for JPEG V2's PGX format.\n\n\t* PerlMagick/t/jp2/read.t: Added JPEG Version 2 read tests.\n\n\t* coders/modules.mgk: Added JPC and PGX magick types to\n\tsupport JPEG V2.\n\n\t* magick/color.c (IsMonochromeImage): Re-arranged test logic\n\tto short-circuit test using ORs.\n\t(IsGrayImage): Re-arranged test logic to short-circuit test\n\tusing ORs.\n\n\t* magick/constitute.c (PopImagePixels): Speed GrayQuantum\n\tand GrayAlphaQuantum cases if is_grayscale is True.\n\n\t* magick/quantize.c (AssignImageColors): Sync image to\n\tupdate DirectClass pixels to new colormap.\n\n\t* coders/fpx.c (RegisterFPXImage): FlashPIX does not\n\tprovide direct BLOB I/O support.\n\n\t* magick/blob.c (BlobToImage): Add logging.\n\t(BlobToFile): Add logging.\n\n2003-02-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/fpx.c (ReadFPXImage): Removing the input file is\n\tantisocial.\n\n\t* PerlMagick/t/fpx/*.fpx: Replaced with new copies.  Files\n\tseemed to be corrupt.\n\n\t* PerlMagick/t/cgm/read.t: Specify file magick so that CGM\n\tread test passes for BLOB case.\n\n\t* PerlMagick/t/rad/read.t: Specify file magick so that RAD\n\tread test passes for BLOB case.\n\n\t* PerlMagick/t/jng/read.t: Add read tests for JNG.\n\n\t* PerlMagick/t/jng/write.t: Add read/write tests for JNG.\n\n\t* configure.ac (DELEGATES): Added `jng` to the DELEGATES list\n\tso that JNG can be included in the PerlMagick tests.\n\n2003-02-18  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/png.c: Write proper JNG image_interlace_method.\n\n\t* coders/png.c: Read and write proper MNG and JNG sRGB intent.\n\n\t* PerlMagick/t/jng: Add twelve test files in JNG format.\n\n\t* coders/png.c: Write proper progressive JNG output when\n\ttransparency is present.\n\n2003-02-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/version.c (GetMagickWebSite): New function.\n\n2003-02-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c (ipa_device_begin): Use MagickWebSite definition.\n\n\t* www/Copyright.html: Updated to match Copyright.txt\n\n\t* www/perl: Updated to reflect GraphicsMagick vs ImageMagick.\n\n\t* magick/xwindow.c (XMakeImageMSBFirst): Minor loop optimizations.\n\n\t* magick/constitute.c (ConstituteImage): Check for grayscale\n\tand monochrome image if image is PseudoClass.\n\n2003-02-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/enhance.c (ContrastImage): Preserve is_grayscale flag.\n\t(EqualizeImage): Preserve is_grayscale flag.\n\t(ModulateImage): Preserve is_grayscale flag.\n\t(NegateImage): Preserve is_grayscale flag.\n\t(NormalizeImage): Preserve is_grayscale flag.\n\n\t* magick/fx.c (ColorizeImage): Evaluate is_grayscale status.\n\t(ConvolveImage): Preserve is_grayscale flag.\n\t(ImplodeImage): Preserve is_grayscale flag.\n\t(SolarizeImage): Preserve is_grayscale flag.\n\t(OilPaintImage): Preserve is_grayscale flag.\n\t(SwirlImage): Preserve is_grayscale flag.\n\t(WaveImage): Preserve is_grayscale flag.\n\n\t* magick/resize.c (MagnifyImage): Preserve is_grayscale flag.\n\t(MinifyImage): Preserve is_grayscale flag.\n\t(ResizeImage): Preserve is_grayscale flag.\n\n\t* magick/decorate.c (FrameImage): Evaluate is_grayscale status.\n\t(RaiseImage): Preserve is_grayscale.\n\n\t* magick/shear.c (IntegralRotateImage): Preserve is_grayscale.\n\tflag.\n\t(XShearImage): Evaluate is_grayscale status.\n\t(YShearImage): Evaluate is_grayscale status.\n\n\t* magick/transform.c (ChopImage): Preserve is_grayscale flag.\n\t(CropImage): Preserve is_grayscale flag.\n\t(FlipImage): Preserve is_grayscale flag.\n\t(FlopImage): Preserve is_grayscale flag.\n\t(RollImage): Preserve is_grayscale flag.\n\n\t* magick/effect.c (AddNoiseImage): If image colorspace is\n\tGRAYColorspace, then add intensity noise, and transfer\n\timage is_grayscale flag to output image.\n\t(BlurImage): Preserve is_grayscale flag.\n\t(DespeckleImage): Preserve is_grayscale flag.\n\t(EdgeImage): Preserve is_grayscale flag.\n\t(EmbossImage): Preserve is_grayscale flag.\n\t(GaussianBlurImage): Preserve is_grayscale flag.\n\t(MotionBlurImage): Preserve is_grayscale flag.\n\t(ShadeImage): Preserve is_grayscale flag.\n\t(SharpenImage): Preserve is_grayscale flag.\n\t(UnsharpMaskImage): Preserve is_grayscale flag.\n\n\t* magick/quantize.c (QuantizeImage): Pre-reduce gray images\n\tto PseudoClass in order to quickly determine the number of\n\tcolors, and provide the expected PseudoClass output. Also\n\tskip slow color quantization if there are already fewer\n\tcolors than requested.\n\n\t* magick/image.c (GrayscalePseudoClassImage): New function\n\tto quickly reduce an image to PseudoClass grayscale.  This\n\tis a fast way to determine the number of intensities in a\n\tgrayscale image. Either a compact sorted colormap or a faster,\n\tcontiguous linear colormap is created, depending on the\n\toptimize_colormap flag. If the image is already PseudoClass,\n\tand the optimize_colormap flag is True, then the existing\n\tcolormap is sorted and reduced.\n\t(SyncImage): Preserve is_grayscale flag.\n\t(ChannelImage): Result is grayscale.\n\t(CycleColormapImage): Preserve is_grayscale and is_monochrome flags.\n\t(SetImage): Evaluate is_grayscale flag.\n\t(SetImageDepth): Preserve is_grayscale flag.\n\t(SetImageOpacity): Preserve is_grayscale flag.\n\t(SortColormapByIntensity): Preserve is_grayscale flag.\n\t(TransformRGBImage): Evaluate is_grayscale flag.\n\n2003-02-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resize.c (SampleImage): Preserve grayscale and\n\tmonochrome flags.\n\n\t* magick/quantize.c (AssignImageColors): Set image monochrome\n\tflag to True when quantizing to two colors in GrayColorspace.\n\n\t* magick/effect.c (SpreadImage): Preserve grayscale and\n\tmonochrome flags.\n\t(AdaptiveThresholdImage): Short-circuit algorithm if image\n\tflags indicate it is already monochrome. Set monochrome and\n\tgrayscale flags once algorithm completes.\n\t(ThresholdImage): Short-circuit algorithm if image\n\tflags indicate it is already monochrome. Set monochrome and\n\tgrayscale flags once algorithm completes.\n\t(ChannelThresholdImage): Short-circuit algorithm if image\n\tflags indicate it is already monochrome. Set monochrome and\n\tgrayscale flags once algorithm completes.\n\t(ShadeImage): If grayscale shading is done, then set image\n\tgrayscale flag to True.\n\n\t* magick/color.c (IsGrayImage): If the image is_grayscale\n\tflag is True, then short-circuit the test. Update the flag\n\tif the test is performed.\n\t(IsMonochromeImage): If the image is_monochrome flag is True\n\tthen short-circuit the test. Update the flag if the test is\n\tperformed.\n\n\t* magick/image.c (CloneImage): Copy image is_grayscale and\n\tis_monochrome members.\n\n\t* magick/cache.c (SyncCacheNexus): If image pixels are updated\n\tthen set image is_grayscale and is_monochrome members to False.\n\tAlgorithms which want to preserve the values of these members\n\tshould save their original values before processing the image\n\tand restore them when processing is complete, or transfer them\n\tfrom the input image to the output image.\n\n\t* magick/constitute.c (ReadImage): If the returned image is\n\tPseudoClass then invoke IsGrayImage() and IsMonochromeImage()\n\tand cache the result in image is_grayscale and is_monochrome\n\tmembers for later use.\n\n\t* magick/image.h (Image): Added is_grayscale and is_monochrome\n\tmembers to remember if image is grayscale or monochrome.\n\n2003-02-14  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* www/archives.html: commented out sites not mirroring GM yet.\n\tChanged \"ftp.simplesystems.org\" to \"ftp.graphicsmagick.org\".\n\tAdded link to graphicsmagick.sf.net.\n\n2003-02-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (FormatString): Check for the availability of\n\tvsprintf.\n\n\t* magick/log.c (LogMagickEvent): Check for the availability of\n\tvsprintf.\n\n\t* configure.ac: Test for vsprintf.\n\n2003-02-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/annotate.c (RenderFreetype): Used smarter code to prepare\n\tthe beta argument for AlphaComposite.\n\n2003-02-12  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/logo.c: updated logo.c to produce the GraphicsMagick logo.\n\n2003-02-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* INSTALL-unix.txt: Document that default quantum depth is now 8.\n\n\t* VisualMagick/magick/magick_config.h.in: Default quantum depth is now 8.\n\n\t* configure.ac: Default quantum depth is now 8.\n\n\t* tests/Makefile.am: Test format types that require a size\n\tseperately since always specifying the size caused some formats\n\t(e.g. PCD) to improperly fail.\n\n2003-02-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/NEWS.html: New HTML file for project news.\n\n\t* scripts/txt2html: New script for formatting text into HTML.\n\n\t* Makefile.am: Automated the generation of www/Changelog.html and\n\twww/NEWS.html.\n\n\t* coders/xpm.c (WritePICONImage): Close blob using correct image.\n\n\t* tests/Makefile.am (CHECK_SIZED_FILES): Added files to tests\n\tsubdirectory so that tests don't need to use files from\n\tPerlMagick.\n\n\t* magick/image.c (TransformColorspace): New function to\n\tsimplify/centralize colorspace transform requests.  Replaced calls\n\tto RGBTransformImage and TransformRGBImage throughout the code\n\twith calls to TransformColorspace.\n\n\t* IMDisplay: Disable save function since it is not implemented yet.\n\n2003-02-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs (SetAttribute): Support changing back to\n\tRGB or Transparent colorspace.\n\n2003-02-10  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Brought MNG handling of final delay into compliance with MNG spec.\n\n2003-02-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (WriteBMPImage): Added support for\n\tbits_per_pixel==4.\n\t(WriteBMPImage): Convert PseudoClass images with more than 256\n\tcolors to DirectClass.\n\t(WriteBMPImage): Do not require 2-color images to pass the\n\tIsMonochromeImage() test before writing them as one-bit-per-pixel\n\tBMPs.  Decided to allow this after four readers (including Windows\n\tXP) displayed the image using the proper colormap.\n\t(WriteBMPImage): BMP2 encoder was writing colormap using wrong format.\n\n\t* images: Updated logo images to GraphicsMagick\n\n\t* Added PDF Sages to web page as a sponsor.\n\n2003-02-08  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* www/GraphicsMagick.html: add \"gm \" prefix to examples.\n\n2003-02-07  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* index.html: Update to distinguish between ImageMagick and\n\tGraphicsMagick, and to explain \"gm\" prefix of commandline utilities.\n\n2003-02-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_feature.c (CropImageToHBITMAP): Remove useless\n\tautocrop support which was transferred from CropImage when\n\tcreating CropImageToHBITMAP.\n\n2003-02-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): RLE packet size was not\n\tcalculated correctly, causing RLE-compressed MIFF images with\n\tdepth>8 to not be read.\n\n2003-02-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/paint.c (ColorFloodfillImage): Transfered fix from\n\tImageMagick for the problem that floodfill using a tiled image\n\tfailed if the target color happened to match the current fill\n\tcolor.\n\n2003-02-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Fixed preview error message.\n\n\t* coders/preview.c: Previous update had broken noiseimage demo.\n\tAlso some cleanups.\n\n\t* magick/display.c (XMagickCommand): No longer uses\n\tMogrifyImage.\n\n\t* coders/preview.c (WritePreviewImage): Re-wrote so that\n\tMogrifyImage is no longer used. Resize image outside of the loop\n\tto improve performance.\n\n2003-02-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (ShadeImage): Use PixelIntensityToDouble macro.\n\n\t* magick/image.h (PixelIntensityToDouble): Added\n\tPixelIntensityToDouble macro to handle the case where pixel\n\tintensity is used for floating arithmetic.\n\n2003-01-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Distribute files ChangeLog, INSTALL-mac.txt,\n\tINSTALL-unix.txt, INSTALL-vms.txt INSTALL-windows.txt, and NEWS.\n\n2003-01-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c (SVGStartElement): Applied fix from ImageMagick to\n\tcompute SVG +> MVG viewbox correctly.\n\n\t* magick/image.c (CloneImage): Applied fix from ImageMagick which\n\tis purported to solve the problem that \"negative (x,y) page offsets\n\tdid not clone properly\".\n\n\t* magick/gem.c (TransformHWB): Replace implementation with\n\tImageMagick's new version which is supposed to fix a rounding\n\terror problem.  Hard to say since implementation is totally\n\tdifferent.\n\n\t* coders/msl.c (MSLStartElement): Applied fix for missing break\n\tfrom ImageMagick.\n\n\t* magick/integral_types.h: New header to include the integral\n\ttypes typedefs.  Needed new header in order to include in both\n\tstudio.h and api.h at the right point.\n\n\t* magick/studio.h: Move nt_feature.h inclusion to the few modules\n\twhich actually use functions from it.\n\n\t* magick/api.h: Added typedefs gm_int16_t, gm_uint16_t,\n\tgm_int32_t, gm_uint32_t, gm_int64_t, gm_uint64_t to support\n\tspecifically sized types.\n\n\t* configure.ac: Test for size of `short`, `unsigned short`, `int`,\n\t`unsigned int`, `long`, `unsigned long`, `long long`, `unsigned\n\tlong long` assigning the result to the defines SIZEOF_SHORT,\n\tSIZEOF_UNSIGNED_SHORT, SIZEOF_INT, SIZEOF_UNSIGNED_INT,\n\tSIZEOF_LONG, SIZEOF_UNSIGNED_LONG, SIZEOF_LONG_LONG, and\n\tSIZEOF_UNSIGNED_LONG_LONG respectively.\n\n2003-01-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/fx.c (OilPaintImage): Compute histogram using 8-bit quantums\n\tfor more sensible performance with Q:16 and Q:32 builds.\n\n\t* magick/image.h (PixelIntensityToQuantum): Compute using integral\n\tarithmetic for Q:8 and Q:16.  Much faster than floating point!\n\t(PixelIntensity): Compute using integral arithmetic for Q:8 and\n\tQ:16. Much faster than floating point!\n\n2003-01-28  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* Fixed bug in png.c, introduced in IM-5.5.1.  A pair of\n\t{ } brackets were omitted when logging was added, which lets\n\told versions of libpng write a zero-length iCCP chunk.\n\n2003-01-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (DespeckleImage): Put loops inside of case\n\tstatement rather than outside.\n\t(SpreadImage): Improved algorithm so that -spread is 12X faster.\n\n\t* magick/nt_feature.c (CropImageToHBITMAP): New function to return\n\ta region of the image as a HBITMAP.\n\n2003-01-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Fixed Copyright statement on all source files.\n\n\t* magick/effect.c (ThresholdImage): Optimized loop.\n\n\t* coders/tiff.c (ReadTIFFImage): Read bits more efficiently for\n\tbits_per_sample=1.\n\n\t* magick/command.c (MogrifyImage): Set image->dither to\n\timage_info->dither prior to invoking SetImageType.\n\n\t* magick/constitute.c (WriteImage): Set image->dither to\n\timage_info->dither.\n\n\t* magick/image.c (SetImageType): For case BilevelType, normalize\n\timage, and threshold 50% if dithering is disabled.  This is at\n\tleast 10X faster than quantizing with dither.\n\t(AllocateImage): Initialize image->dither.\n\t(CloneImage): Copy image->dither.\n\n\t* magick/image.h: Added dither member to Image.\n\n2003-01-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/tiff/read.t: Added a test for reading 16-bit TIFF\n\timages.\n\n\t* coders/tiff.c (ReadTIFFImage): Support reading 16-bit TIFF images\n\twith a Q:8 build.\n\n\t* magick/color.c (ConstrainColormapIndex): Use VerifyColormapIndex.\n\n\t* coders/pnm.c (ReadPNMImage): Use VerifyColormapIndex.\n\n\t* coders/gif.c (DecodeImage): Use VerifyColormapIndex.\n\n\t* magick/image.c (SyncImage): Use VerifyColormapIndex.\n\n2003-01-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (ReadBlobByte): Use getc when reading from FILE stream.\n\n\t* configure.ac: Added tests for getc_unlocked and putc_unlocked.\n\n\t* magick/blob.c (ReadBlobByte): Optimized reading from BlobStream.\n\t(ReadBlobLSBLong): Optimized reading from BlobStream.\n\t(ReadBlobLSBShort): Optimized reading from BlobStream.\n\t(ReadBlobMSBLong): Optimized reading from BlobStream.\n\t(ReadBlobMSBShort): Optimized reading from BlobStream.\n\t(ReadBlobStream): New static inline function to read from BlobStream.\n\t(WriteBlob): \"Manually\" copy data rather than using memcpy() for\n\tvery small copy sizes.\n\t(WriteBlobByte): Use putc() when writing to a FILE stream.\n\n2003-01-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gem.c (Hull): Count down loops.  Might help.\n\t(InterpolateColor): Pre-compute common sub-expressions to improve\n\tperformance.\n\n\t* magick/segment.c (Classify): Implemented idea from Glenn\n\tRanders-Pehrson to avoid use of pow() when WeightingExponent is\n\t2.0 (which it is).  This makes image segmentation much faster\n\t(e.g. 8X).\n\n\t* magick/annotate.c (RenderFreetype): For images with\n\tmatte==False, simply set the opacity of the pixel to be updated to\n\tOpaqueOpacity before alpha-compositing the pixel rather than using\n\tSetImageType(TrueColorMatteType) to initialize the opacity of the\n\tentire image.  This is much faster and scales to large images.\n\n\t* magick/image.c (SetImageType): Eliminated unnecessary conditionals.\n\n2003-01-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (InsertMedianList): Assign computed quantum\n\tindexes to variables to avoid extra computations for\n\tQuantumDepth>8.\n\n\t* magick/composite.c (AlphaComposite): Pre-compute common\n\texpressions in order to improve performance.\n\n\t* magick/fx.c (ConvolveImage): Optimized loops.\n\n\t* magick/paint.c (TransparentImage): Optimize for case fuzz == 0.\n\n\t* magick/color.c (FuzzyColorMatch): Minor cleanup and optimization.\n\n\t* magick/locale.c: Added error messages for convolve option.\n\n\t* coders/locale.c: Picked up recent changes from ImageMagick version.\n\n\t* locale/C.mgk: Added error messages for convolve option.\n\n\t* magick/command.c (MogrifyImage): Added support for convolve option.\n\n\t* coders/xcf.c (ReadXCFImage): Recognize latest GIMP XCF header.\n\n\t* coders/dcm.c: Transferred the apparent salient fixes from\n\tImageMagick for a bug described as \"Some DCM grayscale images did\n\tnot display correctly.\".\n\n\t* coders/miff.c (ReadMIFFImage): Reading RLE-compressed MIFFs is\n\tnow about 4X faster.\n\n\t* magick/blob.c (OpenBlob): Use setvbuf() to increase stdio buffer\n\tsize to 16K.  Solaris default is 1K.  This should minimize system\n\tcall overhead for accessing large files.\n\t(ReadBlob): \"Manually\" copy data rather than using memcpy() for\n\tvery small copy sizes.\n\t(ReadBlobZC): New method, similar to ReadBlob, but provides the\n\topportunity for zero copy on read.\n\n\t* magick/constitute.c (PushImagePixels): CMYKA case for\n\timage->depth=16 was comparing with 8 instead.\n\n2003-01-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GetMagickGeometry): Removed support for `~`\n\tand disabled centering code until we learn where it should go (if\n\tanywhere).\n\n\t* magick/command.c : Add HWB colorspace transform support.\n\n\t* PerlMagick/Magick.xs: Add HWB colorspace transform support.\n\n\t* magick/image.c (RGBTransformImage): Add HWB colorspace transform\n\tsupport.\n\t(TransformRGBImage): Add HWB colorspace transform support.\n\n2003-01-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GetMagickGeometry): Add support for new new\n\t`~` geometry string flag.  This also fixes a montage bug in which\n\tthumbnails were mis-sized if the geometry specification incuded x\n\tor y offsets.\n\n\t* magick/image.h (GeometryFlags): Added CenterValue enumeration to\n\tcorrespond with new `~` geometry string flag.  Taking\n\tImageMagick's lead on this.\n\n\t* magick/render.c: Transferred fixes from ImageMagick for an\n\tartifact which occured at the 360 degree point when rendering\n\tcircles, ellipses, and arcs.  Bug reported by io219@attbi.com.\n\n\t* PerlMagick/Magick.xs: Add HSL colorspace transform support.\n\n\t* magick/command.c: Add HSL colorspace transform support.\n\n\t* magick/image.c (RGBTransformImage): Add HSL colorspace transform\n\tsupport.\n\t(TransformRGBImage): Add HSL colorspace transform support.\n\n2003-01-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Updated copyright statement on source files to reflect\n\tthe GraphicsMagick Group rather than ImageMagick Studio.\n\n\t* magick/constitute.c (ConstituteImage): Simplified the switch\n\tstatement for inner loops by creating a simplified map in advance.\n\t(DispatchImage): Simplified the switch statement for inner loops\n\tby creating a simplified map in advance.\n\n\t* magick/compress.c (HuffmanEncodeImage): Test and cache the\n\treturn value of LocaleCompare(image_info->magick,\"FAX\") so that\n\tLocaleCompare is not executed repeatedly in the output loop.\n\n\t* magick/color.c (IsGrayImage): Optimized loops.\n\t(IsMonochromeImage): Optimized loops.\n\t(IsOpaqueImage): Optimized loop.\n\n\t* magick/delegate.c (InvokePostscriptDelegate): When using the\n\tGhostscript library, identify the library as \"[ghostscript library]\"\n\trather then \"gsdll32\" so that -verbose prints something useful for\n\tboth Windows and Unix.\n\n2003-01-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS: New file.\n\n\t* magick/montage.c (MontageImages): Use ThumbnailImage() rather\n\tthan ZoomImage() to resize montage thumbnails provided that the\n\tuser has not specified an image filter, and the montage thumbnail\n\tis smaller than the image. This should provide faster montages\n\tfor large images.\n\n\t* magick/resize.c (ResizeImage): Added logging support.\n\t(MagnifyImage): Added logging support.\n\t(MinifyImage): Added logging support.\n\t(SampleImage): Added logging support.\n\t(ScaleImage): Added logging support.\n\n2003-01-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/transform.c (ProfileImage): Duplicate ImageMagick changes\n\tto image colorspace handling.  Avoids using\n\tSetImageType(image,ColorSeparationMatteType).\n\n\t* magick/fx.c (OilPaintImage): Replaced with ImageMagick version\n\tsince ImageMagick version has been updated to not penalize Q:8.\n\tOptimized loops.\n\n\t* magick/display.c (XDisplayImage): Display to 100% of\n\tthe screen size rather than 90% of the screen size.\n\n\t* magick/enhance.c (ModulateImage): Ensure that arguments\n\tare always positive values.  Optimized loops.\n\t(ContrastImage): Optimized loops.\n\n\t* magick/gem.c (HSLTransform): Optimized performance by\n\teliminating redundant intermediate calculations. This\n\tmakes `gm convert -contrast` 21% faster.\n\t(HSLTransform): Set to inline within the gem.c module.\n\t(TransformHSL): Set to inline within the gem.c module.\n\t(Contrast): Moved to bottom of gem.c module so HSLTransform\n\tand TransformHSL can be inlined. Simplified conditionals.\n\t(Modulate): Moved to bottom of gem.c module so HSLTransform\n\tand TransformHSL can be inlined. No longer check/correct\n\tnegative values.\n\n2003-01-14 William Radcliffe <billr@corbis.com>\n\n\t* magick/blob.c\n\n\t* magick/blob.h\n\tAdded new stream type flag and support to match with the one\n\tadded to ImageMagick.\n\n2003-01-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (RGBTransformImage): Fixed bug (thanks to\n\tBill for finding it) and finished optimizing XYZ table\n\tcreation.\n\t(AverageImages): Optimized loops.\n\t(ChannelImage): Optimized loops.  3X speed-up for SPARC.\n\n\t* magick/enhance.c: Optimized NegateImage().\n\n2003-01-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Set some common API structures to 0xbf prior to deallocation\n\tto make accidental continued use more obvious.\n\n2003-01-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c: Minor optimizations to PopImagePixels()\n\n\t* coders/dpx.c: Reading the DPX header was off by 4 bytes.\n\n\t* coders/(art.c,avs.c,bmp.c,cmyk.c,dcm.c,dib.c,dpx.c,fax.c,\n\tfits.c,gray.c,icon.c,map.c,miff.c,mono.c,mpc.c,mtv.c,otb.c,\n\tpcx.c,pdb.c,pict.c,pix.c,pnm.c,pwp.c,rgb.c,rla.c,rle.c,sct.c,\n\tsgi.c,sun.c,tga.c,tim.c,uyvy.c,vicar.c,viff.c,wbmp.c,xwd.c,\n\tyuv.c): Ensure that blob is closed on unexpected EOF.\n\n\t* magick/image.c: Optimized SetImageOpacity().\n\tOptimized SetImage() for intializing non-opaque images.  The\n\topacity channel was being intialized twice.\n\n2003-01-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c: Log entry and exit from coders so that\n\tcoders don't need to.\n\n\t* Finished re-writing PushImagePixels() using coding practices\n\twhich may result in faster code.\n\n\t* PerlMagick is changed from Image::Magick to Graphics::Magick\n\tin order to avoid conflicts with the ImageMagick version.  This\n\tmeans that any Perl scripts based on the ImageMagick version need\n\tto do a global replace of Image::Magick to Graphics::Magick.\n\n\t* PerlMagick/reference/filter/Raise.miff: Replaced with new version.\n\n2003-01-08 William Radcliffe <billr@corbis.com>\n\n\t* magick/nt_feature.c\n\tMake ImageToHBITMAP function in nt_feature.c compile under Visual\n\tC++ again.\n\n2003-01-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/delegates.mgk.in: Fix cgm entry.  How did it become so\n\tterribly broken?\n\n\t* coders/dps.c: Adding logging support.\n\n\t* PerlMagick/t/read.t: Changed file read tests to use image\n\tcompares with a reference image rather than comparing with a\n\tsignature.\n\n\t* PerlMagick/t/wmf/read.t: Ditto.\n\tmagick/shear.c: Fixed documentation for RotateImage.\n\n2003-01-08  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/magick.c, magick/magick.h: Add \"note\" member of magick_info.\n\n\t* coders/art.c, coders/fax.c, coders/dcm.c, coders/png.c: add notes\n\tto format registrations.\n\n\t* fx.c: changed default \"colorize\" behaviour to preserve image opacity.\n\n2003-01-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/svg.c: Allow the user to specify the initial background\n\tcolor via the -background option.  This is only useful if the SVG\n\tdoesn't draw its own background rectangle.\n\n2003-01-06  Albert Chin-A-Young  <china@thewrittenword.com>\n\n\t* ltdl/Makefile.am, ltdl/ltdl.c: Fix compilation problem\n\tunder Tru64 UNIX 5.1.  The GraphicsMagick random.h was being\n\tincluded when the system random.h was needed.\n\n\t* configure.ac: Improve robustness of POSIX thread API tests\n\tby including pthread.h when building the test program.\n\n2003-01-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c: In IsImagesEqual() only use type `long double`\n\tfor error summation if QuantumDepth > 16 and `long double` has\n\tmore range than `double`.\n\n\t* magick/quantize.c: In QuantizeImage() only use type `long\n\tdouble` for error summation if QuantumDepth > 16 and `long\n\tdouble` has more range than `double`.\n\n\t* Replaced redundant code with macros.\n\n\t* Optimize mapping to monochrome.\n\n\t* utilities/conjure.c: Had missed removing this file earlier.\n\n2003-01-04  Derry Bryson  <dbryson@techass.com>\n\n\t* magick/decorate.c: Use the ShadowFactor rather than ShadowModule\n\tdefine in RaiseImage() (bug-fix).\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2004",
    "content": "2004-12-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (DescribeImage): Add normalized channel\n\tstatistics to output.\n\n\t* NEWS: Updated with changes since July.\n\n\t* magick/constitute.c (ImportImagePixelArea): For GrayQuantum,\n\tGrayInvertedQuantum, GrayAlphaQuantum, and\n\tGrayInvertedAlphaQuantum, observe image storage_class so that a\n\tgray DirectClass image may be created.\n\n\t* coders/tiff.c (ReadTIFFImage): Fix overflow when computing\n\tcolormap size for bits-per-sample of 32.\n\t(WriteTIFFImage): Support writing 32-bit RGB(A) for\n\tQuantumDepth=32 build.\n\t(ReadTIFFImage): Support reading 32-bit RGB(A) for QuantumDepth=32\n\tbuild.  Support reading 32-bit grayscale without any quality loss\n\tfor QuantumDepth=32 build.\n\n2004-12-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): TrueColor 16-bits/sample RGB\n\timages were being written incorrectly on little-endian CPUs.\n\tAdded byte swapping to fix this problem.\n\n2004-12-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/operator.c: New file for quantum operator implementation.\n\t(QuantumOperatorImage): Moved from image.c.\n\t(QuantumOperatorRegionImage): Moved from from image.c.\n\n2004-12-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>\n\n\t* magick/Makefile.am (MAGICK_BASE_SRCS): Remove mention of\n\tnon-existent mmath.h.\n\n\t* configure.ac: AC_LIBTOOL_SETUP is an internal macro and must not\n\tbe used externally (will be pulled in automatically).\n\n\t* PerlMagick/Makefile.am: Missing file needed to be committed to CVS.\n\n\t* tests/Makefile.am (TESTS_TIFF_XFAIL_TESTS): EPT and PTIF tests\n\tare expected to fail if libtiff is missing.\n\n2004-12-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* TODO.txt: Organized todo list for 1.2 release.\n\n2004-12-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (WriteBMPImage): Handle the case where the image\n\thas an over-sized colormap.  Was writing on unallocated heap memory.\n\n\t* coders/dib.c (WriteDIBImage): Handle the case where the image\n\thas an over-sized colormap.  Was writing on unallocated heap memory.\n\n2004-12-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gem.c (Modulate): Hue argument now represents a rotation\n\tfrom -180 degrees to +180 degrees expressed as an argument of 0 to\n\t2.0 (1.0 for no change). Note that this change also effects the\n\t-modulate argument and the Magick++ modulate method(). This change\n\tis made because the previous hue adjustment strategy only\n\tsucceeded in corrupting the image.\n\n2004-12-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (opendir): Ensure that data may not overwrite\n\tthe stack.\n\t(readdir): Ensure that data may not overwrite the stack.\n\n\t* magick/blob.c (ImageToBlob): Ensure that image->logging is\n\tset prior to encoding image.\n\n\t* magick/constitute.c (WriteImage): Ensure that image->logging is\n\tset prior to encoding image.\n\n2004-11-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* rungm.sh.in: Compute final variable definitions from within\n\tconfigure in order to improve MinGW test execution times.\n\n2004-11-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c: Fix two error-path memory leaks which were noticed\n\tby Glenn Randers-Pehrson.\n\n2004-11-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (UnregisterPNGImage): Eliminate Warning: module\n\tregistration for \"JNG\" from module \"PNG\" still present!\n\n2004-11-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (DispatchImage): Fix documentation error\n\tregarding return status.\n\n2004-11-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.h: Only define HAVE_GLOBALMEMORYSTATUSEX for MSVC\n\t7.0 and later.\n\n2004-11-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Ensure that words in the\n\tscanline are converted to little-endian format on little-endian\n\tCPUs.\n\n2004-11-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (MagickStrlCat): New function which is\n\tequivalent to to OpenBSD's strlcat() function.  Concatenates one\n\tstring onto another within a fixed size buffer while ensuring null\n\ttermination.\n\t(MagickStrlCpy): New function which is equivalent to OpenBSD's\n\tstrlcpy() function.  Copies a string into a fixed size buffer\n\twhile ensuring null termination.\n\n\t* coders/gif.c (DecodeImage): Improve handling of corrupt GIF\n\tfiles.  Resolves SourceForge bug #1042904.  Also, eliminate a\n\tpotential memory leak.\n\n\t* magick/constitute.c (WriteImages): ImageInfo argument is now a\n\tconst pointer.\n\n2004-10-26 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* magick/render.c (TracePath): Applied bugfix from Cristy.\n\n2004-10-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c (InitializeMagickResources): Use\n\tGlobalMemoryStatusEx if it is available.\n\n\t* magick/nt_base.c (lt_dlopen): Handle errors while loading\n\tmodules rather than allow Windows to display a GUI dialog box.\n\t(NTKernelAPISupported): New function to support testing to see if\n\ta Windows kernel API is supported.\n\n\t* magick/constitute.c (ExportImagePixelArea): Add special-case for\n\tbilevel gray image in order to restore performance.\n\t(ImportImagePixelArea): Add special-case for bilevel gray image in\n\torder to restore performance.\n\n\t* coders/jpeg.c (ReadJPEGImage): Fix GCC warning about variable\n\tbeing clobbered by longjmp.\n\n\t* Re-port build to MinGW. Modules build passes all tests.\n\n\t* Skip build and install of modules if a key library is not available.\n\n\t* Partial recode of metadata handling to use Get/Set profile\n\tfunctions.  Big job!\n\n\t* GCC warnings reduction.\n\n\t* Remove MVG detection from magic.mgk due to security risk.\n\n2004-09-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Properly detect and handle\n\terrors reported by libtiff so that failure is reported rather than\n\twriting a corrupted output file.\n\t(WriteNewsProfile): Re-write so implementation is easier to\n\tunderstand.\n\n2004-09-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c: Don't use deprecated tiff.h _SUPPORT defines.\n\tSupport retrieving and saving XMP profile.  Use profile set/get\n\tmethods in implementation.\n\n\t* coders/mat.c,coders/topol.c (ReadBlobWordLSB,ReadBlobDoublesLSB):\n\tUse better variable name than `I` for image.\n\n2004-09-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (WriteMIFFImage): Ensure that MIFF files are never\n\twritten with bogus compression values.\n\n\t* magick/image.h: Protected/hid constants which only exist to\n\tsupport the library implementation.\n\n\t* tests/Makefile.am (TESTS_X11_XFAIL_TESTS): Fixed syntax error.\n\n\t* Makefile.am: Use one Makefile to rule them all as described in\n\tPeter Miller's excellent paper, Recursive Make Considered Harmful,\n\t\"http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html\".\n\tSome glitches may remain.\n\n\t* coders/tiff.c (TIFFErrors): Prevent possible stack overflow on\n\terror.\n\t(TIFFWarnings): Prevent possible stack overflow on error.\n\n\t* magick/constitute.c (ImportImagePixelArea): For RGBQuantum\n\tinitialize the opacity channel since it is easier than altering\n\tall code to properly access it.\n\n2004-09-02  Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* magick/transform.c: Bugfix from Cristy in CoalesceImages().\n\n2004-08-26  Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* Avoid error introduced in libpng-1.2.6 that causes the encoder\n\tto write out-of-spec zlib header bytes.\n\n2004-08-24  Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/bmp.c is said to have a potential buffer overrun.\n\tPatch from Cristy applied (also to avi.c and dib.c).\n\n2004-08-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Use ExportImagePixelArea to\n\twrite grayscale and colormapped output.\n\n\t* magick/constitute.c (ImportImagePixelArea): Implemented support\n\tfor GrayInvertedQuantum & GrayInvertedAlphaQuantum.\n\t(ExportImagePixelArea): Implemented support for\n\tGrayInvertedQuantum & GrayInvertedAlphaQuantum.\n\n\t* magick/constitute.h (enum QuantumType): Added\n\tGrayInvertedQuantum & GrayInvertedAlphaQuantum to support\n\tmin-is-white gray images.\n\n2004-08-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/tiff/write.t: Adjusted file naming.\n\n\t* PerlMagick/t/tiff/read.t: Added more tests.\n\n\t* coders/tiff.c (ReadTIFFImage): Use ImportImagePixelArea to read\n\tPseudoClass tiff.\n\t(WriteTIFFImage): Allow user to set the bits-per-sample define to\n\tany value in the range of 1 to 32.\n\t(ReadTIFFImage): Fix endian-reordering for DirectClass read and\n\tbits-per-sample values ranging 9-15.\n\n\t* coders/rgb.c: Support reading & writing 32-bit depths for raw\n\tRGB images.\n\n\t* coders/cmyk.c: Support reading & writing 32-bit depths for raw CMYK\n\timages.\n\n\t* coders/gray.c: Support reading & writing 32-bit depths for raw gray\n\timages.\n\n\t* magick/deprecate.c (PopImagePixels): Deprecated function.\n\t(PushImagePixels): Deprecated function.\n\n\t* magick/constitute.c (ExportImagePixelArea): New function to\n\texport pixel region using specified QuantumType and\n\tbits-per-sample.\n\t(ImportImagePixelArea): New function to import pixel region using\n\tspecified QuantumType and bits-per-sample.\n\n2004-08-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/cache.c (ClonePixelCache): It appeared that cloning a\n\tdisk-based pixel cache was limited to the maximum value of\n\tsize_t. This would result in a truncated cache.  The offset type\n\tis changed from size_t to magick_off_t in order to avoid this.\n\n\t* configure.ac: Check to see if the `char` type is unsigned,\n\tmostly out of curiosity since the code does not currently make use\n\tof the result.\n\n\t* Fixed many compilation warnings when the compiler warning level\n\tis set as high as possible.\n\n\t* configure.ac: Check /usr/share/ghostscript/fonts for Ghostscript Type1\n\tfonts.\n\n2004-08-13  Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* tEXt and zTXt were inadvertently included in list of unused chunks.\n\n2004-08-09  Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* fix incorrect argument to png_set_keep_unknown_chunks().\n\n2004-08-07  David R. Linn  <drl@vuse.vanderbilt.edu>\n\n\t* www/formats.html: Titles for JNG and MNG were reversed.\n\n2004-08-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/widget.c (XCommandWidget): Replace ImageMagick logo in\n\tdisplay command menu with GraphicsMagick logo.\n\n2004-08-05  Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/png.c: Fixes for CERT security alert TA04-217A described\n\tat \"http://www.us-cert.gov/cas/techalerts/TA04-217A.html\".\n\n2004-08-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h (Image): Changed type of `colors` and `depth`\n\tmembers from type `unsigned long` to `unsigned int`. This change\n\tis made because on 64-bit CPUs, `unsigned long` is a 64-bit\n\ttype. The depth member is often used in switch statements.  It is\n\tnot recommended to use 64-bit types in switch statements.  The\n\tmaximum number of colors in the colormap is limited to 64K so a\n\t64-bit type is not required.\n\n2004-08-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Restore previous 8/16\n\tbits-per-sample support code in order to regain lost performance.\n\n2004-07-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Support reading RGB/CMYK scanline\n\toriented TIFF images with arbitrary depth.\n\n2004-07-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am:  Update to Automake 1.9.\n\n2004-07-20  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick\\magick\\GM_magick.bpr: Updated to reflect changes since last update.\n\n\t* BCBMagick\\magick\\libMagick.bpr: Updated to reflect changes since last update.\n\n\t* BCBMagick\\bzlib\\GM_bzlib.bpr: Updated version number. \n\n\t* BCBMagick\\lcms\\BCB6\\GM_lcms.bpr: Updated version number.  \n\n\t* BCBMagick\\Magickpp\\lib\\GM_magickpp.bpr: Updated version number.  \n\n\t* BCBMagick\\ttf\\GM_ttf.bpr: Updated version number.  \n\n\t* BCBMagick\\zlib\\GM_zlib.bpr: Updated version number.  \n\n\t* BCBMagick now support full LZW encoding (read/write).\n\t\n2004-07-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff/libtiff/tif_lzw.c: Replace with version which supports LZW encoding.\n\n\t* magick/channel.c: New source file.\n\t(ExportImageChannel): New function to export an image channel.\n\t(ImportImageChannel): New function to import an image channel.\n\n2004-07-20  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* lcms/src/cmsio1.c: Test [testcms.c] related to lcms 1.13 fail\n\twith error #12288 when perform \"Checking saved linearization\n\tdevicelink\".  Fixed function __cmsSaveProfile().  \"...malloc(0) is\n\timplementation dependent and may return non NULL pointer on some\n\tcompilers, like VC++ and gcc. This is not the case of Borland C++\n\tBuilder\" - Thanks to Marti Maria that have supplied me this\n\tpatched file: this will be part of the next lcms 1.14 which\n\tprobabily will be released on summer's end.\n\n2004-07-20  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* lcms/include/lcms.h: Modified to achieve BCBMagick DLL compilation.\n\tIncluded modifications was introduced in GM in 2004-01-16 and \n\tprobabily lost with latest update of library.\n\n2004-07-20  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick: Updated lcms to version 1.13.\n\t  + Modified files: BCBMagick\\All\\bcbMagick.mak; BCBMagick\\lcms\\BCB6\\GM_lcms.bpr;\n\t    BCBMagick\\lcms\\BCB6\\lcms.bpg; BCBMagick\\lcms\\BCB6\\lcms.bpr; \n\t    BCBMagick\\lcms\\BCB6\\testcms.bpr\n\t  + Deleted files: BCBMagick\\lcms\\BCB6\\lcms.cpp; BCBMagick\\lcms\\BCB6\\testcms.cpp\n\t  + Added file: BCBMagick\\lcms\\BCB6\\lcms.bpf\n\n2004-07-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Fix typo regarding -define tiff:samples-per-pixel.\n\n\t* doc/GNUmakefile (utility-install): Utility HTML targets were not being installed.\n\n2004-07-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* lcms: Updated to version 1.13.\n\n2004-07-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh (CVS_BRANCH_TAG): Record the CVS branch tag that\n\tsource package is obtained from.\n\n2004-07-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Pass essential flags on down to subordinate\n\tconfigures when performing `make distcheck`.  Support DESTDIR\n\tinstalls for PERL 5.8.1 and later, which support DESTDIR\n\tinternally.\n\n2004-07-16  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick\\coders\\libCoders.bpr; BCBMagick\\magick\\GM_magick.bpr: include\n\t  file jbig.h could not be found during compilation. Solved.\n\t\n2004-07-15  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick\\magick\\magick_config.h.: enabled LZW compression by default.\n\n\t* BCBMagick: included jbig delegate library. \n\t  + Modified these files into directory BCBMagick: All\\bcbMagick.mak;\n\t    All\\GMlib.bpg; All\\GMdll.bpg; coders\\libCoders.bpr; magick\\GM_magick.bpr;\n\t    utilities\\gm_lib.bpr; utilities\\gm_dll.bpr\n\t  + Added these files into new directory BCBMagick\\jbig: jbig.bpr; \n\t    jbig.bpf; GM_jbig.bpr; GM_jbig.c; tstcodec.bpr\n\t  + Modified file jbig\\jbiglib\\jbig.h; \n\n\t* BCBMagick\\readme.txt: updated documentation.    \n\n2004-07-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyUsage): -ordered-dither help was\n\tformatted incorrectly.\n\n\t* doc/options.imdoc: Improve formatting a bit for manual pages and\n\tfix some syntax errors.\n\n2004-07-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS: Updated to reflect changes since last update.\n\n2004-07-09  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/bmp.c (ReadBMPImage): Removed if-test on reading\n\tred_mask, green_mask, and blue_mask.  These are only *valid*\n\tunder certain conditions, but they are always present in the\n\tfile.\n\n2004-07-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Enable LZW compression by default.\n\n2004-07-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (WriteJPEGImage): Don't enable Huffman compression\n\tfor large images (> 16 Mpixels for the moment) in order to\n\tconserve memory.  When Huffman compression is enabled the entire\n\timage is buffered in memory prior to encoding and writing\n\tanything.  Huffman compression is a method of eliminating\n\tredundant data so when the Huffman compression is disabled, files\n\tsizes will be larger, but otherwise the image is the same.\n\n\t* wand/magick_wand.c (MagickSetPassphrase): String was being\n\tcopied to a null pointer.  Now memory is allocated as required\n\tprior to a copy.\n\tEnsure that all unimplemented functions return a proper error\n\treport.\n\n2004-07-01  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick: updated to GraphicsMagick v.1.2\n\n\t* BCBMagick\\All: project GMlib-1.1.bpr has been replaced with\n\tGMlib.bpr\n\n\t* BCBMagick\\All: project GMdll-1.1.bpr has been replaced with\n\tGMdll.bpr\n\n\t* BCBMagick\\readme.txt: updated documentation.\n\n2004-06-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): For -units, don't reset\n\tresolution if units are undefined. Report an error if the -units\n\targument is not supported.\n\n2004-06-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): When setting image units, also\n\tadjust existing image x_resolution and y_resolution so that\n\texisting image resolution is not trashed.\n\t(MogrifyImage): When re-sampling an image, report an error if the\n\timage does not contain a valid resolution.\n\n2004-06-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcx.c (WritePCXImage): Support writing large PCX files.\n\t(WritePCXImage): Ensure that UndefinedResolution is handled\n\tproperly. Avoid round-off error for centimeter based resolution.\n\n2004-06-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Look for mozilla by default rather than netscape.\n\n2004-06-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/type.c (ReadTypeConfigureFile): Determine location of\n\tGhostscript fonts only once in order to improve performance.\n\n\t* magick/nt_base.c (NTGhostscriptFonts): Properly determine\n\tGhostscript font location for Ghostscript 8.0 and later.\n\n\t* GraphicsMagick.spec.in: Install *-config scripts with mode 755\n\trather than default 644.\n\n2004-05-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/module.c (InitializeModuleSearchPath): Evaluate and cache\n\tmodule search path.\n\t(FindMagickModule): Use cached module search path.\n\t(OpenModules): Load all modules rather than just the modules in\n\tthe directory where the LOGO module is found.  Besides allowing\n\tuser-provided modules in non-GraphicsMagick directories to be\n\tloaded, this allows the \"moby\" shared build to load additional\n\tmodules via OpenModules.\n\n2004-05-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/Makefile.am (check): Add convert -list tests.\n\n2004-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Magick++ needs to be built as a static library\n\tunder Cygwin and MinGW since C++ exceptions don't work otherwise.\n\tBe more assertive about that.\n\n\t* magick/nt_base.h: Avoid conflict with ssize_t definition under\n\tMinGW.\n\n2004-05-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (DispatchImage): Support 8-bit output to\n\tcommon formats BGR, BGRO, BGRP, RGB, RGBO, and I as special cases\n\tin order to improve performance.\n\t(ConstituteImage): Support 8-bit input from common formats BGR,\n\tBGRO, BGRP, RGB, RGBO, and I as special cases in order to improve\n\tperformance.\n\n2004-05-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ltmain.sh: Fix to allow exe wrapper to work under MinGW.\n\n\t* wand/magick_compat.c (QueryMagickColor): Fixed DLL export.\n\n\t* wand/magick_wand.c: Fixed some DLL exports (MagickExport->WandExport).\n\n2004-05-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageClipMask): Consistently report any\n\texceptions to image->exception.\n\n2004-05-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Update to Automake 1.8.5.\n\n\t* magick/image.h (ImageInfo): New `progress` monitor to indicate\n\tif progress monitor and busy cursor are enabled while displaying\n\tan image.  Defaults to True.\n\n\t* magick/display.c, magick/xwindow.c: Use +progress to disable\n\tprogress monitor and busy cursor.\n\n\t* magick/command.c (MogrifyUsage): Usage didn't list -operator.\n\t(ConvertUsage): Usage didn't list -operator.\n\n2004-05-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/compress.c (HuffmanDecodeImage): Properly return error status.\n\t(HuffmanEncode2Image): Properly return error status.\n\n\t* magick/composite.c (CompositeImage): Properly return error status.\n\n\t* magick/quantize.c (ClassifyImageColors): Properly return error status.\n\t(GetImageQuantizeError): Properly return error status.\n\t(OrderedDitherImage): Properly return error status.\n\n\t* magick/profile.c (ProfileImage): Properly return error status.\n\n\t* magick/paint.c (ColorFloodfillImage): Properly return error status.\n\t(MatteFloodfillImage): Properly return error status.\n\t(OpaqueImage): Properly return error status.\n\t(TransparentImage): Properly return error status.\n\n\t* magick/enhance.c (ContrastImage): Properly return error status.\n\t(EqualizeImage): Properly return error status.\n\t(GammaImage): Properly return error status.\n\t(LevelImage): Properly return error status.\n\t(LevelImageChannel): Properly return error status.\n\t(ModulateImage): Properly return error status.\n\t(NegateImage): Properly return error status.\n\t(NormalizeImage): Properly return error status.\n\n\t* magick/image.c (GetImageClipMask): New function to retrieve an\n\tassociated clip-mask image.\n\t(SetImageClipMask): Clip-mask image parameter may be const since\n\tit is cloned prior to storage.\n\t(ChannelImage): Properly return error status.\n\t(GradientImage): Properly return error status.\n\t(RGBTransformImage): Properly return error status.\n\t(TransformRGBImage): Properly return error status.\n\t(SyncImage): Return an error status.\n\n\t* magick/enhance.c (NegateImage): If image has a clip mask,\n\tthen force image to DirectClass so clip mask takes effect.\n\n2004-05-15  Vladimir Lukianov  <lvm@integrum.ru>\n\n\t* magick/image.c (SetImageOpacity): Ensure that image is\n\tDirectClass. If specified opacity is TransparentOpacity, then\n\treplace existing opacity with TransparentOpacity.\n\n2004-04-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Avoid duplicated test status messages for __func__\n\ttests.  Avoid duplicated test status message for jpeg 6b test.\n\n2004-04-19  Patrick Welche  <prlw1@newn.cam.ac.uk>\n\n\t* www/header.html: HTML syntax fixes.\n\n2004-04-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* : Change web pages to a frames-based design.\n\n2004-04-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/Makefile.am (check): Change geometry arguments which\n\twere expressed as 0.0xVAL to avoid the problematic Linux scanf\n\tfeature back to 0xVAL.\n\n2004-04-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/symbols.h (GetMagickDimension): Added GetMagickDimension.\n\n2004-04-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GetMagickDimension): New function to replace\n\toccurances of scanf(geometry,\"%lfx%lf\",&w,&h) since Linux scanf()\n\tand strtod() misbehave for strings that start with \"0x\". The Linux\n\tversions always treat 0x as the start of a value expressed in hex\n\tand can't be forced to read the leading value as a double.  This\n\tfunction has been applied globally to replace the problem scanf's.\t\n\n\t* magick/version.h.in: Make it clear in the -version output that a\n\tmutitude of copyrights and licenses apply to this software.\n\n\t* magick/utility.c (GetPathComponent): Avoid strncpy() of\n\toverlapping regions.\n\n\t* magick/command.c (DisplayImageCommand): Eliminate double-free\n\tof resource_info->image_geometry.\n\t(DisplayImageCommand): `display` was improperly requiring at least\n\tone argument (bug was added yesterday).\n\n2004-04-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/gm.c (main): Default usage message wasn't right for\n\taliased utility.\n\n\t* configure.ac: Added the --enable-magick-compat option to install\n\tcompatibility links to emulate ImageMagick commands.\n\n\t* magick/command.c: Ensure that each sub-command responds to -help\n\tand -version appropriately.\n\n\t* utilities/gm.c (main): Invoke appropriate sub-command if gm is\n\texecuted under a traditional alternate name such as \"convert\". The\n\tuser may create hard or symbolic links from `gm` to a traditional\n\tImageMagick utility name (or just copy `gm` to the desired\n\tsub-command name) in order to be 100% command-line compatible with\n\tImageMagick 5.5.2. This is necessary in order to work with\n\texisting software designed to execute ImageMagick utilities.\n\n2004-04-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/compress.c (Ascii85Tuple): Encoding bug is indeed fixed\n\ton DEC Alpha. Also warnings reduction with Digital Unix compiler.\n\n2004-04-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/compress.c (Ascii85Tuple): Add casts to reduce compiler\n\twarnings, and maybe even fix a bug.\n\n\t* coders/pdf.c (ReadPDFImage): Double-check that Ghostscript\n\tproduced an output file since sometimes it reports success after\n\tit has spewed an error message and has produced no output.\n\n2004-04-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/compress.c (HuffmanEncode2Image): Avoid out of bounds\n\tarray access.\n\n\t* magick/studio.h (_FILE_OFFSET_BITS): Fix _FILE_OFFSET_BITS\n\t#ifdef to avoid warnings when it is not defined.\n\n2004-04-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Fix minor shell syntax error (used ==).\n\n2004-04-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Merged in updates from 1.1 release branch.\n\n\t* version.sh (PACKAGE_VERSION): Release version 1.1.\n\t(PACKAGE_VERSION): Next major release will be 1.1.  Bump library\n\tversions since we anticipate adding interfaces.\n\n\t* magick/studio.h: Disabled use of Windows message lookups\n\tentirely since this doesn't seem to work for programs.  It\n\tprobably only works for DLLs like ImageMagickObject.\n\n\t* magick/delegate.c (ListDelegateInfo): Don't get stuck in a loop\n\tif fprintf() returns zero.\n\n2004-04-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/*/*.bat: Add .exe to exe file names in order to\n\tensure that the executable is executed rather than something else\n\t(such as a batch script).\n\n\t* magick/locale.c: Only use Windows resource message lookup for\n\tthe DLL build since it doesn't seem to work for static\n\texecutables.\n\n\t* magick/utility.c (SetClientPath): Ensure that client path is\n\tnull terminated.\n\t(SetClientFilename): Initialize default client filename to \"\"\n\trather than \"gm.exe\" and ensure that filename is null terminated.\n\t(SetClientName): Ensure that client path is null terminated.\n\n\t* magick/blob.c (GetConfigureBlob): Enable logging the load of\n\tlog.mgk\n\n\t* magick/log.c: Re-designed logging initialization in order to\n\tavoid the \"chicken and the egg\" snafu.  This allows logging the\n\tinitialization of the logging subsystem.\n\n2004-04-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/bin/log.mgk: Add comments to help document usage.\n\n\t* config/log.mgk: Add comments to help document usage.\n\n\t* magick/utility.c (IsAccessible): Use access() rather than stat().\n\t(IsAccessibleNoLogging): Use access() rather than stat().\n\t(IsDirectory): Implemented return status according to existing API\n\tdocumentation.\n\t(GetExecutionPathUsingName): Complete re-write in order to minimize\n\tpath computation logic and fix failure with partial paths.\n\n2004-03-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Add \"Color\" to the arguments available for -list.\n\n2004-03-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh (PACKAGE_CHANGE_DATE): Updated version to 1.1Beta3\n\n\t* magick/nt_base.c (NTSystemComman): Have not been successful with using\n\tMsgWaitForMultipleObjects() reliably, so back out usage of it for\n\tnow.\n\n\t* magick/fx.c (ConvolveImage): Support convolution in CMYK\n\tcolorspace.\n\n2004-03-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh (PACKAGE_CHANGE_DATE): Update release to 1.1Beta2.\n\n\t* magick/constitute.c (ReadImage): Ignore errors of type\n\tConfigureError when loading modules so that error report can still\n\treport the familiar \"No delegate for this image format\" message\n\twhile still being able to report problems with loading a module if\n\tit was found.  This is a compromise which reports useless messages\n\twhen the modules are not found at all, but I can't think of a way\n\taround it.\n\n\t* magick/nt_base.c (NTSystemComman): Adjust\n\tMsgWaitForMultipleObjects() arguments to wait for object to be\n\tsignaled only (FALSE) rather wait for object to be signaled as\n\twell as an input event received(TRUE).  It seems that process\n\tstatus changes do not result in an input event, so the call was\n\tdeadlocking.\n\n\t* magick/constitute.c (ReadImage): If module loading reported an\n\terror, ReadImage immediately returned an error rather than trying\n\tto use a delegate defined by delegates.mgk.\n\n2004-03-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Updated version to 1.1Beta1\n\n2004-03-24  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick/magick/libMagick.bpr: updated to latest source modifications.\n\n\t* BCBMagick/magick/GM_Magick.bpr: updated to latest source modifications.\n\n2004-03-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/plasma.c (ReadPlasmaImage): srand() is already invoked by\n\tInitializeMagick() so don't call it here.\n\n\t* configure.ac: Check for rand_r().\n\n\t* magick/tempfile.c (ComposeTemporaryFileName): The full range of\n\tsafe characters was not being used, thereby limiting the number of\n\tunique temporary file names available.\n\n2004-03-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (GetImageStatistics): New function to obtain\n\timage statistics (minimum, maximum, mean, variance, and standard\n\tdeviation).\n\t(DescribeImage): Include image channel statistics in verbose\n\toutput.\n\n2004-03-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (DispatchImage): Removed some unreachable\n\tcode that was accidentially left in the switch statement.\n\n\t* magick/pixel_iterator.c (PixelIterateDualRead): Extended so that\n\tthe region in each image may use a different origin.\n\t(PixelIterateDualModify): Extended so that\n\tthe region in each image may use a different origin.\n\n\t* magick/composite.c (CompositeImage): Fix XorCompositeOp overflow\n\tcondition which occured on non-Intel architectures.\n\n2004-03-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS: Updated with changes up to today's date.\n\n\t* tests/constitute.c (main): Float type seems to require allowing\n\ta bit of error for Q:32.\n\n\t* magick/constitute.c (DispatchImage): Be more careful when\n\trounding pixel intensity.\n\t(ConstituteImage): Be more careful when converting float and\n\tdouble to Quantum.\n\n\t* magick/composite.c (CompositeImage): Fix Multiply composite\n\toperator for Q:32 build (was all black image).\n\t(CompositeImage): Tidied up the documented composite operators so\n\tthe implementation is easier to understand.\n\n\t* PerlMagick/t/ttf/read.t: Set a desired label size so output\n\timage should be the same size as the reference image even if the\n\tFreeType type hinter is disabled.\n\n\t* magick/annotate.c (RenderFreetype): Improve outline bounding box\n\tcomputation accuracy.\n\n2004-03-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/x/write.t: Don't test X11 if DISPLAY is not set.\n\n\t* PerlMagick/t/x/read.t: Don't test X11 if DISPLAY is not set.\n\n2004-03-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/Makefile.am: Removed some apparently unnecessary library\n\tdependencies.\n\n\t* Makefile.am (windows-src): Added a way to generate a Windows\n\tsource zip file.\n\n2004-03-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: The -operator command now supports\n\tfloating-point and percent of range arguments.\n\n2004-03-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Added support for -operator command with\n\tsyntax \"-operator channel operator rvalue\" which applies a\n\tarithmetic or bitwise operator to a specified image channel\n\tor all channels.\n\n2004-03-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/filter.t: Fix Solarize test case.\n\n\t* PerlMagick/t/wmf/read.t: Added another WMF test case.\n\n\t* coders/wmf.c: Resolve WMF rendering bug with black color.\n\n\t* magick/utility.c (StringToArgv): Free argv data prior to error\n\treturn.\n\n2004-03-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (WriteJPEGImage): If image_info->colorspace is set\n\tto GRAYColorspace then make sure that image is in a gray\n\tcolorspace.\n\n\t* magick/image.c (TransformRGBImage): If colorspace is already an\n\tRGB type (RGBColorspace, GRAYColorspace, or TransparentColorspace),\n\tthen simply return.  Do *not* set image->colorspace to RGBColorspace\n\tsince this potentially loses a valuable setting.\n\n2004-03-10  Peter Boos  <pedib@colorfullife.com>\n\n\t* magick/annotate.c (RenderFreetype): If DrawAnnotation is called\n\twith a string containing only one character and this character is\n\tnot recognized by the TrueType engine, a crash occured due to the\n\tfailure of FT_Load_Glyph. The failure caused an uninitialized\n\tglyph.image pointer to be used by FT_Done_Glyph() later in the\n\tcode. The solution is to initialize the glyph.image pointer to\n\tnull.\n\n2004-03-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (QuantumOperatorRegionImage): Properly handle\n\tover and underflow of arithmetic operators.\n\n\t* magick/draw.c (DrawGetFillOpacity): Use fill opacity, and invert\n\topacity range so it is 0.0 to 1.0 (was acting like transparency).\n\t(DrawSetStrokeOpacity): Validate range of stroke_opacity.\n\t(DrawSetFillOpacity): Save value to context->fill.opacity and\n\tvalidate the range of fill_opacity.\n\n\t* magick/image.c (QuantumOperatorImage): New function to apply an\n\tarithmetic or bitwise operator to the pixel quantums in an image.\n\t(QuantumOperatorRegionImage): New function to apply an arithmetic\n\tor bitwise operator to the pixel quantums in an image region.\n\n\t* magick/image.c (IsImagesEqual): Re-implemented using the new\n\tpixel iteration functions as a proof of concept.\n\n\t* magick/pixel_iterator.h: Added some pixel iteration functions in\n\torder to make it easier to implement algorithms which only need to\n\titeratively access pixels in a region. These functions are not\n\tpart of the API yet so their interface should be considered\n\tunstable.\n\n\t* doc/GNUmakefile: Rename Makefile to GNUmakefile since it relies\n\ton GNU make extensions.\n\n2004-03-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ConstituteImage): Add support for `T`\n\t(transparency) and `O` (opacity) map types.  Simplify\n\timplementation.\n\t(DispatchImage): Add support for `T` (transparency) and `O`\n\t(opacity) map types.  Simplify implementation.\n\n\t* config/delegates.mgk.in: Quote delegate command names so\n\tthat they can contain embedded spaces.\n\n\t* VisualMagick/bin/delegates.mgk: Quote delegate command names so\n\tthat they can contain embedded spaces.\n\n\t* coders/tiff.c (WriteTIFFImage): Use the libtiff default endian\n\tmode when writing TIFF rather than forcing MSB2LSB bit order.\n\t(ReadTIFFImage): Enable reading in MSB2LSB bit order (better for\n\tour byte-level parsing), enable memory mapping, and enable strip\n\tchopping.  Memory mapping and strip chopping are probably enabled\n\tby default.\n\n\t* magick/nt_base.c (NTSystemComman): Use\n\tMsgWaitForMultipleObjects() rather than WaitForSingleObject() in\n\torder to avoid possible deadlock when application code directly or\n\tindirectly creates windows.\n\n2004-02-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/animate.c (XMagickCommand): URL should point to\n\thttp://graphicsmagick.org/.\n\n\t* magick/display.c (XMagickCommand): URL should point to\n\thttp://graphicsmagick.org/.\n\n\t* magick/image.c (DisplayImages): Changes to fix memory leaks in\n\tX11 commands had bugs which seriously broke DisplayImages.  Now\n\tDisplayImages works properly again.\n\n\t* magick/xwindow.c (XDestroyResourceInfo): New function to destroy\n\tXResourceInfo.\n\n\t* coders/x.c (WriteXImage): Implement based on DisplayImages().\n\t(RegisterXImage): Always register X coder, but with read/write\n\tsupport disabled if X11 not available.\n\n2004-02-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (ImportImageCommand): Eliminate memory leaks.\n\n\t* magick/memory.c (LiberateMemory): Use MagickFreeMemory macro for\n\timplementation.\n\t(ReacquireMemory): Use MagickReallocMemory macro for\n\timplementation.\n\t(AcquireMemory): Use MagickAllocateMemory for implementation.\n\n2004-02-26  Vladimir  <lvm@integrum.ru>\n\n\t* magick/memory.c (CloneMemory): Fixes to compile under Microsoft\n\tVisual C++ 6.0.\n\n2004-02-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/animate.c (XAnimateImages): Memory leak reduction and\n\tbetter integration with gm command.\n\n\t* magick/display.c (XDisplayImage): Display was leaking memory\n\tlike a sieve.  Now it doesn't.\n\n\t* magick/memory.c (CloneMemory): Computation for when it is safe\n\tto use memcpy() was incorrect.  Use memmove() rather than\n\tbackwards-copy loop.\n\n\t* Makefile.am ($(DIST_ARCHIVE_SRPM)): Added rules to build a\n\tsource RPM.\n\n\t* configure.ac: Search for `buildrpm` or `rpm` programs in order to\n\tsupport creating RPM packages on a system which has RPM installed.\n\n\t* version.sh (PACKAGE_VERSION): Changed snapshot release naming so\n\tthat there is only one dash in the name and the snapshot date is\n\tprefixed with `0` to assure proper directory sorting.  This allows\n\tsnapshot naming to be acceptable to RPM.  The snapshot package\n\tname is now similar to GraphicsMagick-1.1.020040218.tar.bz2\n\n2004-02-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xwd.c (RegisterXWDImage): Always register XWD, but only\n\tregister read/write methods if it is supported.\n\n\t* wand/magick_wand.c: Synchronized with latest ImageMagick API\n\tchanges.\n\n2004-02-16  Lars Ruben Skyum  <lars.skyum@stibo.com>\n\n\t* magick/resize.c (HorizontalFilter): Fixed: do process K channel\n\tfor CMYK images.\n\t(VerticalFilter): do process K channel for CMYK images.\n\t\n2004-02-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tga.c (ReadTGAImage): Fix matte channel handling. For\n\t16-bit packets, use integer rather than floating point. Return\n\tgray images as PseudoClass and set is_grayscale flag.  Add\n\tlogging.\n\n\t* magick/fx.c (WaveImage): Ensure that image is\n\tDirectClass. Ensure that matte channel is initialized if\n\tnecessary. Include background color in is_grayscale evaluation.\n\n\t* magick/gem.c (GenerateNoise): Scale noise to range of quantum.\n\n2004-02-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (WriteJP2Image): Support passing all documented\n\tJasper options using -define.\n\n2004-02-13  Peter Boos  <pedib@colorfullife.com>\n\n\t* coders/wmf.c (util_draw_arc): Fixes to improve handling for pie,\n\tarc, and chord.  These fixes produce correct output for\n\twmf/examples/fjftest.wmf, but it is not known if they are correct\n\tfor all cases.\n\n2004-02-12  Tim Hunter  <cyclists@nc.rr.com>\n\n\t* magick/profile.c (SetImageProfile): Bug fixes.\n\n2004-02-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (UnregisterXPMImage): Unregister PICON registration.\n\n2004-02-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/Makefile.am (label_la_LDFLAGS): Add a dependency on the\n\tmath library since floor() is used.\n\n\t* wand/magick_wand.c (MagickRemoveImageProfile): Use C comments in\n\tC files.\n\n\t* magick/constitute.c (MapQuantumType): Fix spurious comma in\n\tenum definition.\n\n\t* magick/blob.c (GetBlobStreamHandler): Apparently return type can\n\tnot be const.\n\n2004-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Check for Windows fonts under\n\t/usr/X11R6/lib/X11/fonts/truetype (XFree86 standard location?).\n\n\t* coders/jp2.c (WriteJP2Image): Support providing a compression\n\trate value (range 0.0 to 1.0) using command line syntax similar to\n\t`-define jp2:rate=0.5`.  In Magick++ this option may be accessed\n\tsimilar to image.defineValue(\"jp2\",\"rate\",\"0.5\");\n\n\t* magick/command.c (DisplayImageCommand): Exit status was inverted\n\tso `gm display` was returning 1 for successful commands, and 0 for\n\tfailures.\n\t(AnimateImageCommand): Exit status was inverted so `gm animate`\n\twas returning 1 for successful commands, and 0 for failures.\n\n2004-02-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.h (MagickReallocMemory): Solaris compiler\n\tcomplains about cast so remove it.\n\n\t* coders/xwd.c (WriteXWDImage): Right-size the pixels buffer and\n\ttune writer loops a bit.\n\n\t* magick/color.h (VerifyColormapIndex): Improve diagnostics.\n\n\t* coders/pict.c (WritePICTImage): Eliminate use of uninitialized\n\tdata when writing RGB PICT. Fix OpenBlob assertion when writing\n\tJPEG PICT.\t\n\t(ReadPICTImage): Validate `tile_image` colormap indexes rather\n\tthan `image` colormap indexes. Preserve compression attribute from\n\ttile image.\n\n\t* magick/constitute.c (DispatchImage): Don't access image opacity\n\tchannel unless image->matte is True.\n\n2004-02-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (UnregisterPNGImage): Destroy PNG semaphore.\n\n\t* magick/image.c (SetImageInfo): Since we don't know what the\n\t\"IMPLICIT\" specifier is supposed to do, support for it is\n\tremoved. Perhaps by removing support for it, we will be reminded\n\twhy it exists.\n\n\t* magick/magick.c (DestroyMagickInfo): Invoke\n\tUnregisterStaticModules().\n\t(GetMagickInfo): Remove registration for \"IMPLICIT\" format since\n\tits purpose is presumed bogus.\n\n\t* magick/static.c (UnregisterStaticModules): New function so we\n\tcan unregister static modules.\n\n\t* coders/plasma.c (UnregisterPLASMAImage): Unregister FRACTAL.\n\n\t* coders/icon.c (UnregisterICONImage): Unregister CUR.\n\n\t* coders/bmp.c (UnregisterBMPImage): Unregister BMP2 and BMP3.\n\n\t* coders/meta.c (UnregisterMETAImage): Unregister APP1JPEG, IPTC,\n\tIPTCTEXT, IPTCWTEXT, and PICON.\n\n\t* coders/miff.c: Check for run-length termination before testing\n\tmemory and only check opacity channel if matte is valid.\n\n\t* magick/compress.c: Check for run-length termination before\n\ttesting memory (bad read error).\n\n2004-02-07  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/bmp.c: Fix off-by-one error while initializing padding bytes.\n\n\t* coders/dib.c: Fix off-by-one error while initializing padding bytes.\n\n\t* magick/enhance.c: MaxMap vs MaxRGB error fixed.  Reported by Cristy.\n\n2004-02-04  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* magick/compress.c:  avoid a reference to uninitialized data.\n\n2004-02-04  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/dib.c: initialize padding bytes.\n\n2004-02-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/montage.c (MontageImages): Fix leak of texture image (big\n\tleak).\n\n2004-02-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Fix detection of when to use a\n\ttemporary file when writing TIFF.  Writing to TIFF BLOBs was\n\tbroken by the recent changes to make BlobInfo a private type.\n\n\t* magick/render.c (DestroyEdge): Use memmove for overlapping copy.\n\n2004-02-03  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/bmp.c: initialize padding bytes.\n\n2004-02-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ConstituteImage): Added map support for `P`,\n\tin order to skip over a pad quantum.\n\t(DispatchImage): Added map support for `P`, in order to write a pad\n\tquantum.\n\n\t* magick/resize.c (HorizontalFilter): Don't process opacity\n\tchannel unless matte is enabled.\n\t(VerticalFilter): Don't process opacity channel unless matte is\n\tenabled.\n\n\t* magick/compress.c (Ascii85Initialize): Don't overwrite an\n\texisting ascii85 allocation.\n\n\t* magick/utility.c (Strip): Use `memmove` rather than `memcpy` to\n\tcopy overlapping data.\n\n\t* tests/rwfile.c (main): Fix memory leak in test. Only apply size\n\tif format requires it.\n\n\t* tests/rwblob.c (main): Fix memory leak in test. Only apply size\n\tif format requires it.\n\n\t* coders/mono.c (RegisterMONOImage): Mono is a raw format.\n\n\t* magick/magic.c (GetMagicInfo): Ensure that magic tests are\n\twithin the range of header data which was read.\n\n2004-02-02  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/bmp.c: fix potential use of uninitialized data.\n\n\t* coders/png.c: fix potential use of uninitialized data.\n\n2004-01-31  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* magick/studio.h: Fixed problem related to DLL version of BCBMagick.\n\tSometimes was incorrectly checked the presence of VC++ DLL. Thanks \n\tvery much to Oliver Bertini for bringing this problem to our attention.\n\n\t* BCBMagick: added libpng delegate library in both static and DLL\n\tmodes.\n\n\t* BCBMagick: removed all unuseful files from CVS.\n\t\n2004-01-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (CloneDrawInfo): Fixed nasty memory leak which\n\tbecomes painfully evident when using Magick++.\n\n\t* magick/type.c (ReadTypeConfigureFile): Fix problem with parsing\n\t<include> directive.\n\n\t* configure.ac: The type.mgk generated had a syntax error.\n\n\t* magick/effect.c (SpreadImage): Eliminate read from uninitialized\n\tmemory.\n\n\t* magick/quantize.c (NodeInfo): Store nodes in a list similar to\n\tImageMagick.\n\t(DestroyCubeInfo): Eliminate a small memory leak.\n\n2004-01-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/montage.c (MontageImages): Free thumbnails once they are\n\tno longer needed (big leak).\n\n\t* magick/blob.c (OpenBlob): Ensure that magick array is\n\tfully initialized, even if the fread() is short.\n\n\t* magick/list.c (ImageListToArray): Add a null pointer to the end\n\tof the image list to serve as a handy list terminator.\n\n\t* magick/tempfile.c (DestroyTemporaryFiles): Fix memory leak of\n\tsemaphore.\n\n\t* magick/map.c (MagickMapDeallocateMap): Fix memory leak of\n\tsemaphore.\n\n\t* coders/png.c (WriteOneJNGImage): Use DestroyBlob.\n\n\t* magick/list.c (SyncNextImageInList): Use DestroyBlob.\n\n\t* magick/image.c (AllocateNextImage): Use DestroyBlob.\n\t(DestroyImage): DestroyBlob.\n\n\t* coders/wpg.c (ExtractPostscript): Use DestroyBlob.\n\n\t* magick/blob.c (DestroyBlob): New function. Similar to\n\tDestroyBlobInfo except that it requires an Image * argument and\n\tzeros the blob pointer. This one is preferred for use over\n\tDestroyBlobInfo.\n\n2004-01-27  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/png.c: Add DestroyBlobInfo() calls to stop memory leak when\n\tprocessing JNG datastreams.\n\n2004-01-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.h (MagickReallocMemory): Added a cast required to\n\tmake C++ Happy.\n\n\t* coders/tiff.c: Adjust for bitstream API function renaming.\n\n\t* magick/bit_stream.h: Rename BitStreamRead() to\n\tBitStreamMSBRead() to indicate that it reads most significant bytes\n\tfirst (\"big endian\" order).  Rename BitStreamWrite() to\n\tBitStreamMSBWrite() to indicate that it writes most significant\n\tbytes first (\"big endian\" order).\n\n\t* wand/magick_wand.c: Updated to lastest ImageMagick API.\n\n2004-01-26  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* magick/stream.c: (SetPixelStream) removed \"const\" from definition of \n\tlocal variable [StreamHandler stream]. Borland C++Builder compiler signal\n\terror \"Cannot modify a const object\".\n\t\n2004-01-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (TIFFMapBlob): Allow libtiff to access memory\n\tmapped file (or BLOB in memory) directly.  This provides a small\n\tperformance increase.\n\n\t* magick/constitute.c (ReadImage): If a .mpc file is a temporary\n\tfile, then be sure to remove the associated .cache file when\n\tremoving the .mpc file.\n\n\t* magick/log.h (LogEventType): ExceptionEventMask now maps to\n\tWarningEventMask|ErrorEventMask|FatalErrorEventMask so that\n\t`-debug exception` works again.\n\n\t* magick/blob.c (CloseBlob): Allow CloseBlob to be invoked on a\n\tblob which is not open (in UndefinedStream state).\n\t(BlobInfo): The definition of BlobInfo is now private to blob.c.\n\t(StreamType): The StreamType enumeration is now private to blob.c.\n\t(GetBlobFileHandle): New function to access the blob file handle.\n\t(GetBlobStreamHandler): New function to access the blob stream\n\thandler.\n\t(GetBlobStreamType): This function is removed entirely.\n\t(BlobIsSeekable): New function to test if SeekBlob will work\n\tproperly for this blob type.\n\t(GetBlobClosable): New function to test if the blob is allowed to\n\tbe closed by the library (may be an externally provided file\n\tdescriptor).\n\t(GetBlobTemporary): New function to test if input file is a\n\ttemporary file which is to be removed.\n\t(SetBlobClosable): New function to support setting the flag which\n\tkeeps the input file from being closed.\n\t(SetBlobTemporary): New function to support setting the flag which\n\tindicates that the input file is a temporary file.\n\n\t* coders/jpeg.c (ReadJPEGImage): Invoke CloseBlob even if\n\tblob is in UndefinedStream state.\n\n\t* magick/error.h (ThrowReaderException): Ditto.\n\t(ThrowWriterException): Ditto.\n\t(ThrowWriterException2): Ditto.\n\t(ThrowWriterException3): Ditto.\n\n\t* magick/tempfile.h (ThrowReaderTemporaryFileException): Ditto.\n\t(ThrowWriterTemporaryFileException): Ditto.\n\n\t* coders/dps.c,coders/jpeg.c, coders/meta.c, coders/mvg.c,\n\tcoders/png.c, coders/tiff.c, magick/constitute.c, magick/stream.c:\n\tUse new blob accessor functions.\n\n\t* magick/cache.c (OpenCache): For Windows, set the sequential\n\taccess flag in all cases.  Maybe it will make a difference.\n\n2004-01-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (GetConfigureBlob): Don't check Windows registry\n\tif MagickLibConfigPath or MagickShareConfigPath is defined.\n\n\t* magick/locale.c: Use a Unix-style message database for MinGW.\n\n\t* rungm.sh.in: Translate environment paths to Windows format when\n\trunning under MinGW.\n\n\t* magick/nt_base.c (mmap): Re-wrote mmap emulation to support\n\t64-bit file offsets and to support anonymous mapping.\n\t(msync): A crude emulation of Unix msync().\n\n\t* acinclude.m4 (GM_FUNC_MMAP_FILEIO): Change result define from\n\tHAVE_MMAP to HAVE_MMAP_FILEIO so that it doesn't conflict with\n\tAutoconf standard definition.\n\n2004-01-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/cache.c (OpenCache): While allocating the pixel cache\n\tfrom the heap, reserve enough memory to contain a full PseudoClass\n\timage in order to reduce the chance that there will be a memory\n\tallocation failure while processing the image. This also avoids\n\tthe possibility that the image pixels will be block-copied to a\n\tnew location due to heap memory fragmentation. If there is\n\tinsufficient heap memory (malloc() fails), then a disk-based pixel\n\tcache will be used.\n\n\t* coders/wpg.c: Backed out Jaroslav Fojtik's patch from 2004-01-13\n\tbecause WPG was failing PerlMagick's existing WPG read test.\n\n2004-01-16  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick: updated to recent Windows delegate libraries.\n\n\t* BCBMagick: modified build procedure. Removed all unused directories\n\tand include files.\n\n\t* lcms/include/lcms.h: Modified to achieve BCBMagick compilation.\n\n\t* tiff/libtiff/tiffio.h: Modified to achieve BCBMagick compilation\n\n\t* ttf/include/freetype/config/ftoption.h: Modified to achieve\n\tBCBMagick compilation\n\n\t* Magick++/lib/Magick++/Include.h: Modified to achieve BCBMagick compilation.\n\t\t\n2004-01-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c: Applied patch from Jaroslav Fojtik to support\n\treading the CTM (current transform matrix).  The CTM is not\n\tapplied yet (expect later patch).\n\n2004-01-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sfw.c (ReadSFWImage): Added size_t cast.\n\n\t* coders/msl.c (MSLStartElement): Added size_t cast.\n\n\t* coders/meta.c (convertHTMLcodes): Added size_t cast.\n\n\t* coders/locale.c: Add size_t casts and update to use memory\n\tallocation macros.\n\n\t* coders/html.c (WriteHTMLImage): Added size_t cast.\n\n\t* magick/utility.h (MagickAllocateMemory): Added size_t cast.\n\t(MagickReallocMemory): Added size_t cast.\n\n\t* coders/bmp.c (WriteBMPImage): Added size_t cast.\n\n\t* coders/art.c (ReadARTImage): Use memory allocation macros.\n\n\t* VisualMagick/configure/configure.cpp: Update to support library\n\t.def exports files with Visual C++ 7.0.\n\n\t* Updated Windows delegate libraries: LCMS 1.12, FreeType 2.1.5,\n\tBIG-KIT 1.5, libpng 1.2.5, libwmf 0.2.8.2, and zlib 1.2.1.\n\n\t* Verified Windows static and DLL compilation with Visual C++ 6.0.\n\n\t* Makefile.am: Update to automake 1.8.2.\n\n\t* coders/gif.c (WriteGIFImage): Use ColorMatch rather than\n\tFuzzyColorMatch when comparing colormap entries.\n\n2004-01-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/profile.c: Needed to include \"magick/profile.h\" in order\n\tto obtain prototypes.\n\n2004-01-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/wandtest.c: Change MagickCloneWand to MagickGetImage since\n\tthe API name changed.\n\n\t* wand/pixel_wand.c: Synchronized with\n\tlatest daily ImageMagick updates.\n\n\t* wand/magick_wand.c (MagickRemoveImageProfile): Synchronized with\n\tlatest daily ImageMagick updates.\n\n\t* magick/profile.c (DeleteImageProfile): New method to make\n\tit easier to destroy an image profile.\n\n\t* magick/profile.h: New source file to contain functions for\n\tdealing with embedded image profiles.\n\n\t* magick/profile.c: New source file to contain functions for\n\tdealing with embedded image profiles.\n\n\t* Makefile.am (DISTDIRS): Distribute TclMagick subdirectory.\n\n2004-01-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c: Ported over the latest ImageMagick Wand API\n\tupdates.  Note that a comment now says that the Wand API will not\n\tbe finished until around 4th quarter of 2004.  This represents a\n\t1-1/2 year slip from the original estimate!\n\n2004-01-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (IsImagesEqual): Simplified implementation.\n\n\t* magick/magick.c: Removed some unused code.\n\n\t* contrib/win32/ATL7/ImageMagickObject/ImageMagickObject.cpp\n\t(IDispatch): Comment out InitializeSemaphore() so code compiles.\n\n\t* libtool.m4: Updated to 2004-01-03 version of CVS libtool. This\n\tshould fix configure problems under AIX and IRIX.\n\n2004-01-03  Glenn Randers-Pehrson <randeg@alum.rpi.edu>\n\n\t* coders/sgi.c: opacity channel was lost when writing grayscale\n\tSGI images.  See bug report in magick-users list.\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2005",
    "content": "2005-12-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff: Update to libtiff 3.8.0. \n\n2005-12-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS: Updated with latest changes.\n\n\t* tiff: Update to libtiff 3.7.4.\n\n2005-12-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* lcms: Update to lcms 1.15.\n\n2005-12-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/enhance.c (LevelImage): Fix -level command parsing when a\n\tpercent symbol is supplied within the argument rather than at the\n\tend.\n\n\t* magick/utility.c (GetGeometry): Bounds-check geometry string\n\tlength.\n\n2005-12-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Decided to swap 10-bit subsampled 4:2:2 YCbCr by\n\tdefault since this is what practically all sample files I have\n\tbeen provided actually do.  Ignore the fact that there is nothing\n\tin the standard which supports this.\n\n2005-12-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (NormalizeSamplingFactor): Generalized\n\tsubsampling notation parsing support.\n\n2005-12-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (NormalizeSamplingFactor): Add some support for\n\tnormalizing industry-standard subsampling notation (e.g. 4:2:2)\n\tinto GraphicsMagick's unusual notation.\n\n2005-12-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>\n\n\t* Updates to use latest development autotools, including\n\tdevelopment libtool 2.0.\n\n2005-12-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h: Added some useful macros for accessing\n\tPixelPacket members in a generic way.\n\n\t* coders/dpx.c (ReadDPXImage): For YCbCr with `A` sample, `A`\n\tsample levels are like Luma.\n\t(WriteDPXImage): For YCbCr with `A` sample, `A` sample levels are\n\tlike Luma.\n\n2005-12-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (RegisterTIFFImage): Report libtiff release\n\tversion rather than ABI version.\n\n2005-11-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resize.c: Revert yesterday's benign-appearing edits since\n\tthey caused a bizzare bug.\n\n2005-11-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Improve performance when reading\n\tYCbCr files.  Handle files which use Printing Density on top of\n\tYCbCr.  Default YCbCr to Rec.709 if the transfer characteristic is\n\tUser Defined.\n\n\t* coders/pcd.c (Upsample): Moved Upsample from gem.c to here since\n\tPCD is the only user and it is not a general purpose function.\n\n2005-11-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/magick/magick_config.h.in: Remove unnecessary test\n\tfor WIN32.\n\n2005-11-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_compat.c (FormatMagickStringList): MagickExport since this\n\tfunction is used by Ch extension.\n\n\t* magick/log.c (LogMagickEventList): MagickExport since this\n\tfunction is used by Ch extension.\n\n\t* magick/utility.c (FormatStringList): MagickExport since this\n\tfunction is used by Ch extension.\n\n\t* coders/dpx.c (ReadDPXImage): Added support for dpx:swap-samples\n\tdefine in order to handle files with Cb and Cr swapped.  Fixed a\n\tbug in the header reading which caused some valid files to fail to\n\tread at all.\n\t(WriteDPXImage): Added support for dpx:swap-samples define in\n\torder to write files with Cb and Cr swapped.\n\n\t* magick/profile.c (ProfileImage): Add support for ICC CMS\n\tprofiles in YCbCr space.\n\n2005-10-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c (ReadSVGImage): Eliminate memory leak.\n\n2005-10-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h (Image): Added an orientation member to the Image\n\tstructure to record image orientation for the DPX, and TIFF\n\tformats. Eventually formats which support IPTC and EXIF embedded\n\tprofiles should be supported by the orientation member as well.\n\n2005-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/magick/magick_types.h.in: Add patch for Ch.\n\n\t* magick/command.c (TransmogrifyImage): Complete re-write of\n\tmogrify file handling.  Former version wrote to a temporary file\n\tand then moved temporary file to replace original if necessary.\n\tNew version moves an existing writable file to a backup file with\n\ttilde (`~`) added to end of file name, writes to the final output\n\tfile name, and removes the backup file on success.  The new\n\tapproach satisfies formats which embed the output name in the file\n\t(e.g. the DPX format) and still works when the output file exists\n\tand is writeable, but is in non-writeable directory.  The previous\n\tapproach would fail if the output file exists and is writable, but\n\tthe directory is not writeable.\n\n2005-10-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (AttributeToString): Use strncpy rather than\n\tstrlcpy to copy string.  This is important since DPX header\n\tstrings are not null terminated and may need to fill all available\n\tspace.  Certain short header fields like mp.film.manufacturer.id,\n\tmp.film.type, and mp.perfs.offset were being truncated!\n\n2005-09-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GetImageAttribute): Add more general support\n\tfor retrieving wildcarded attributes so that an identify -format\n\tspecification like `%[dpx:*]` works as expected.\n\n\t* coders/tiff.c (WriteTIFFImage): Transform quality value into zip\n\tcompression quality level similar to what is done for MIFF/MNG/PNG.\n\tSince default quality value is 75, this means that the default zip\n\tquality level is 7.\n\n2005-09-24  Peter Wu  <peterw@softintegration.com>\n\n\t* Incorporate changes necessary so that GraphicsMagick can work\n\twith the Ch C/C++ interpreter from SoftIntegration at\n\thttp://www.softintegration.com/.\n\n2005-09-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c: Incorporate all functionality from\n\tcache.c, cache_view.c, and stream.c so that all private interfaces\n\tcan be fully hidden.  As a result cache.c, cache_view.c, and\n\tstream.c are now removed.\n\n2005-09-18  Michal Kowalczuk  <sammael@brzydal.eu.org>\n\n\t* coders/gif.c: Free global_colormap before returning with error.\n\n2005-09-18  Stepan Kasal  <kasal@ucw.cz>\n\n\t* Makefile.am (BUILT_SOURCES): Removed.\n\n\t* magick/Makefile.am (MAGICK_BUILT_SRCS): Removed, too.\n\n2005-09-12 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* magick/profile.c (ProfileImage):  Free color_profile->name\n\tand iptc_profile->name when destroying the profile.\n\n2005-08-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/api.h: Eliminate requirement to include certain system\n\theaders prior to including <magick/api.h>.\n\n\t* utilities/gm.c: Move utility implementation to GMCommand() in\n\tcommand.c\n\n2005-08-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Added support for reading and writing DPX Luma\n\tfiles using proper video levels.\n\n\t* magick/colorspace.h (enum ColorspaceType): Decided that\n\tGRAYColorspace should be reserved for full-range grayscale data\n\twhile Rec601LumaColorspace and Rec709LumaColorspace should be for\n\tvideo colorspaces.  Therefore, GRAYColorspace is no longer a\n\tsynonym for Rec601LumaColorspace.\n\n\t* magick/colorspace.c: Added support for influencing Cineon Log\n\tcolorspace transformations via image attributes.\t\n\tPerform colorspace transformations in floating point rather than\n\tinteger in order to reduce the amount of noise added by\n\ttransform table quantization.\n\n\t* coders/psd.c (WritePSDImage): Ensure that output image is 8 or\n\t16-bits regardless of specific image depth.\n\n\t* coders/dpx.c: Added support for planar YCbCr 4:2:2.\n\n2005-08-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteDPXImage): 10 and 12-bit packed data was not\n\taccording to DPX specification.  Added dpx:pixel-endian={lsb|msb}\n\tto allow the user to specify the endian order of the pixel data in\n\tcase it does (or should not) not match the headers.  Library Of\n\tCongress format is 10-bit packed data in big-endian format, but is\n\tmarked as little-endian.\n\n2005-08-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Sample order for filled 10 bit samples matches DPX\n\tspecification (was intentionally reversed).  RGB sample order is\n\tchanged to match DPX specifiation (i.e. BGR rather than RGB).\n\tDisabled special support for Library Of Congress little-endian\n\t10-bit packed format.\n\n2005-08-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Extend all image rows to a 32-bit integer\n\tboundary.\n\n2005-07-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Support the little-endian 10-bit packed format as\n\tused by the Library Of Congress.\n\n2005-07-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c: Change how Jasper is intialized.  Hopefully\n\teliminate memory leak when reading ICC color profile.\n\n\t* Overall: Compilation warning elimination with GCC 4.0.1.\n\n\t* magick/utility.c (SystemCommand): Always report error status if\n\ta command fails.\n\n2005-07-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* zlib: Updated to version 1.2.3.\n\n\t* coders/dpx.c: Use TriangleFilter for scaling chroma.\n\n2005-07-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Support proper encode and decode of YCbCr video\n\tlevels.\n\n\t* magick/colorspace.c: Support Rec709YCbCrColorspace colorspace.\n\n2005-07-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/{animate.c, display.c, import.c, xwindow.c}: Rename all\n\tsymbols starting with `X` so that they are prefixed with `Magick`.\n\tThis eases maintenance since it is almost impossible to understand\n\tcode which pretends to be the X11 libraries.  The few programs\n\twhich use the GraphicsMagick `X` functions will need to alter the\n\tsymbol names they use.  Sorry.\n\n\t* magick/command.c (DisplayImageCommand): Don't invoke\n\tXrmDestroyDatabase() to destroy the resource database associated\n\twith the display since it seems that XCloseDisplay() does this for\n\tus.\n\n\t* magick/image.c (DisplayImages): Don't invoke\n\tXrmDestroyDatabase() to destroy the resource database associated\n\twith the display since it seems that XCloseDisplay() does this for\n\tus.\n\n\t* coders/uyvy.c: Enforce image width restrictions.\n\n\t* coders/dpx.c: Enforce image width restrictions when subsampling.\n\n2005-07-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Support reading and writing subsampled CbYCr\n\timages.  Colorimetery is not right yet.\n\n\t* magick/colorspace.h (enum Rec709YCbCrColorspace): New\n\tenumeration for Rec. 709 YcBCr colorspace.\n\n2005-06-21 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/png.c: Fixed a problem with reading 16-bit PNG images\n\tusing the Q8 quantum depth.\n\n2005-06-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Add read support for CbYCr at 4:4:4.\n\t(WriteDPXImage): Add write support for CbYCr at 4:4:4.\n\n2005-06-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteDPXImage): Only preserve source image\n\tdimension and offset information if image size has not changed.\n\tIf image size has changed, the existing information may become\n\tinvalid.\n\t(WriteDPXImage): Allow user to assign DPX header attribute values\n\tusing syntax like \"-define dpx:mp.frame.position=1000\".\n\n2005-06-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/fpx.c: Fix compilation problem due to additional\n\tExportImagePixelArea parameter.\n\n2005-06-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteMNGImage): Use -define mng:need-cacheoff to\n\twrite a libmng-specific nEED request to disable frame buffering.\n\tThis allows the MNG data to stream without increasing memory\n\tconsumption in the libmng client.\n\n2005-06-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (SMPTEStringToBits): Time code and user bits were\n\tbeing displayed in wrong order on little endian CPUs.  Thanks very\n\tmuch for bug report from Jason Howard.\n\t(SMPTEStringToBits): Similar fix for time code and user bits\n\tstring to binary.\n\n2005-06-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Use StringToColorspaceType() to\n\tparse colorspaces.\n\t* coders/dpx.c (ReadDPXImage): Change existing\n\tdpx:source-colorspace define to dpx:colorspace so it is easier to\n\tremember.\n\n\t* coders/cineon.c (ReadCINEONImage): Extract Cineon header\n\tattributes in DPX compatible form so that it is possible to\n\tconvert Cineon to DPX while losing as little header information as\n\tpossible.  Allow the user to set the existing image colorspace\n\tusing the cineon:colorspace define.\n\n2005-06-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (ReadJPEGImage): Report actual depth of JPEG file\n\t(8 or 12 bits).\n\n\t* coders/cineon.c (ReadCINEONImage): Report depth as 10 bits.\n\n2005-05-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Retrieve and restore the DPX user defined data\n\tarea.  Make available as a \"DPXUSERDATA\" attached profile.\n\n2005-05-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c (ReadMETAImage): Fixed reading ICM color profile\n\tfiles.  Due to a typo ICM color profiles were being stored as IPTC\n\tprofiles.  This restores proper operation of the -profile option.\n\t(ReadMETAImage): Fix double free bug.  Hopefully does not result\n\tin a memory leak in other cases.\n\n2005-05-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (DescribeImage): If the image is DirectClass,\n\tthen don't compute the number of unique colors unless verbose is\n\tgreater than one.  This change is made since computing the number\n\tof unique colors may take hours for some images.  The handling of\n\tthe -verbose argument is changed so that it is cumulative.\n\tSpecifying -verbose multiple times increases the level of\n\tverbosity.\n\n2005-05-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (NTreaddir): Fix write beyond buffer length\n\treported in SourceForge issue #1182003.  Only impacts Windows.\n\n2005-05-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadRowSamples): Added necessary masking necessary\n\tin order to cleanly retrieve DPX 10 bit samples.  Happened to work\n\tproperly without the masking with QuantumDepth=16.\n\n2005-05-16  Tavis Ormandy <taviso@gentoo.org>\n\n\t* coders/xwd.c (ReadXWDImage): Fix for infinite loop in the xwd\n\tdecoder when calculating the shift r/g/b values and the mask is\n\tset to zero.\n\n2005-05-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (ReadJP2Image): Return JP2 images as DirectClass\n\tgrayscale rather than PseudoClass.\n\n\t* coders/gray.c (ReadGRAYImage): Return GRAY images as DirectClass\n\tgrayscale rather than PseudoClass.\n\n\t* coders/dpx.c: Rewrote the DPX pixel reading/writing code yet\n\tagain to obtain up to 2X better performance.  In the process,\n\tsupport little-endian pixel storage.\n\n2005-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Added some performance optimizations for reading\n\tand writing.  Write the motion picture and television headers.\n\n\t* magick/colorspace.c (TransformRGBImage): Update image colorspace\n\tto RGB when transforming from Cineon log space to RGB.\n\n\t* coders/dpx.c (WriteDPXImage): Set image date & time field.\n\t(ReadDPXImage): Retrieve television header SMTPE time code and\n\tuser bits and return them as a formatted string.\n\t(WriteDPXImage): Fix colorspace mapping logic.  Was converting\n\tCineon log to RGB when it shouldn't be.\n\n2005-05-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteDPXImage): Default to big-endian output.\n\n\t* magick/delegate.c (InvokePostscriptDelegate): Improved\n\tGhostscript API-based error reporting and logging.\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Extend EXIF\n\tknowledge a bit.  Pass more characters from EXIF_FMT_BYTE in case\n\tthe byte stream contains nulls.\n\n\t* coders/dpx.c: Re-wrote the DPX read/write support in order to\n\thopefully surmount problems noticed when testing with files sent\n\tto me.\n\n\t* wand/pixel_wand.c (PixelSetYellowQuantum): Wrong PixelPacket\n\tmember was being set.  Thanks to Cristy for the heads-up.\n\n\t* magick/image.c (SetImageType): Revert change from 2005-03-12.\n\tSome coders require that when the image is set to Bilevel type,\n\tthat it be PseudoClass.\n\n2005-04-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/tests/convolve.sh: Add a convolution parameter.\n\n2005-04-28 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* magick/command.c: \"IsGeometry() test was rejecting valid\n\t-convolve parameters.  Also, the image returned by ConvolveImage()\n\twas ignored.\n\n2005-04-25 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/png.c: Initialize several variables to avoid new\n\tGCC 4.0.0 warnings.\n\n\t* coders/pnm.c: Defend against malicious \"P7\" files that try\n\tto set the colormap less than 256 bytes (bug fix from ImageMagick)\n\n2005-04-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteDPXImage): Fill out source information\n\theader.\n\n\t* Magick++: Added image leveling methods for Magick++.\n\n2005-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS: Update with latest news.\n\n\t* magick/blob.c (WriteBlob): Move BlobStream write support to a\n\tsubroutine for easier maintenance.\n\n\t* coders/dpx.c (ReadDPXImage): Support retrieving all DPX\n\tattributes as image attributes.\n\t(WriteDPXImage): Buffer writes for better performance on some\n\tplatforms.\n\n2005-04-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteDPXImage): Re-write sample marshalling to be\n\tbased on a series of tighter loops.  Results in a small\n\tperformance increase.\n\t(ReadDPXImage): Re-write sample marshalling to be\n\tbased on a series of tighter loops.  Results in a small\n\tperformance increase.\n\n2005-04-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/Xwindow.c (XDelay): Prefer use of select() over poll()\n\tsince it is more portable.  MacOS-X has a poll() but it doesn't\n\twork right.\n\n2005-04-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick_endian.h: Renamed from endian.h in order to avoid\n\tconflict with system headers.\n\n2005-04-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (WriteMIFFImage): Normalize image depth to 8/16/32.\n\n\t* coders/gray.c (WriteGRAYImage): Normalize image depth to 8/16/32.\n\n\t* coders/fits.c (WriteFITSImage): Normalize image depth to 8/16.\n\n\t* tests/Makefile.am: Extended read/write tests to include 10, 12,\n\tand 16-bit original test images.\n\n\t* coders/dpx.c (ReadDPXImage): If samples are log encoded, then\n\tset the image to CineonLogRGBColorspace.\n\t(WriteDPXImage): If image samples are log encoded, then mark DPX\n\tfile as being log encoded.\n\n\t* magick/colorspace.c (TransformRGBImage): Support translation\n\tfrom log RGB to linear RGB based on Cineon guidelines.\n\t(RGBTransformImage): Support translation from linear RGB to log RGB.\n\n\t* magick/colorspace.h (enum CineonLogRGBColorspace): New\n\tenumeration to record that the RGB values are log encoded in a\n\t2.048 density range as defined for the Cineon Digital Film System.\n\n2005-04-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Take advantage of ColorspaceTypeToString() and\n\tStringToColorspaceType() functions in implementation.\n\n\t* magick/colorspace.c (RGBTransformImage): Added support for\n\tconverting to Rec 709 grayscale colorspace.\n\t(ColorspaceTypeToString): New function to translate from\n\tColorspaceType enumeration value to a string.\n\t(StringToColorspaceType): New function to translate from a string\n\tto a ColorspaceType enumeration value.  * magick/colorspace.h\n\t(enum Rec601LumaColorspace): New enumeration to support the Rec\n\t601 grayscale colorspace.  This is the colorspace previously\n\trepresented by GRAYColorspace. If GRAYColorspace is specified,\n\tthen Rec601LumaColorspace is selected.\n\t(enum Rec709LumaColorspace): New enumeration to support the Rec\n\t707 grayscale colorspace.\n\n2005-04-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (IdentifyImageCommand): Use +ping to force\n\tidentify to read the image pixels.\n\n\t* magick/constitute.c (PingImage): Intentionally clear\n\tuser/elapsed timer when ping is used on an image since the results\n\tare misleading.\n\n\t* magick/image.c (DescribeImage): Only display pixel read rate if\n\tthe time accumulated is at least the timer's resolution.\n\n\t* magick/cache.c (OpenCache): Fix a memory resource leak noticed\n\tby Stefan v. Wachter <svwa-dev@mnet-online.de>.  This error with\n\tkeeping track of resources may eventually cause GraphicsMagick to\n\trun slower and slower due to using disk-based images rather than\n\tmemory-based images.\n\n2005-04-07 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/png.c: encoder now accepts image->depth other than 8 and 16.\n\n2005-04-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteDPXImage): First pass at a new SMPTE268M-2003\n\tDPX writer.\n\n2005-04-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (AllocateString): Performance enhancement.\n\t(CloneString): Performance enhancement.\n\t(ConcatenateString): Performance enhancement.\n\n2005-03-31 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/jpeg.c: revised EOF test.  It was rejecting good image\n\tfiles.  Needs more work.\n\n2005-03-30 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/pnm.c (ReadPNMImage): Throw a \"Corrupt Image\" exception\n\tif EOF is encountered while reading scanlines in P1, P2, P3, or P4\n\tformatted images (P5 and P6 were OK).\n\n2005-03-29 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/sgi.c (ReadSGIImage): Throw a \"Corrupt Image\" exception\n\tif EOF is encountered while reading scanlines.\n\n2005-03-28 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/jpeg.c (ReadJPEGImage): Throw a \"Corrupt Image\" exception\n\tif EOF is encountered while reading scanlines.\n\n\t* coders/pcx.c (ReadPCXImage): Throw a \"Corrupt Image\" exception\n\tif EOF is encountered while reading pixels.\n\n2005-03-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): First pass at a new SMPTE268M-2003\n\tDPX reader.\n\n\t* magick/bit_stream.h (WordStreamLSBRead): New function to parse\n\tvalues from a stream which is defined by 32-bit words.  Values are\n\tread starting with the least significant bits.\n\n2005-03-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ExtensionTagsInitialize): Fix conditional use of\n\tTIFFSetTagExtender().\n\n2005-03-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/endian.c: Imported libtiff's swab.c since its functions\n\tare so useful and well-tested.\n\n\t* magick/utility.c (FormatSize): Extend to support incredibly\n\tlarge sizes.\n\n\t* magick/image.c (DescribeImage): Use GetTimerResolution() when\n\tcomputing pixels-per-second rate in order to avoid computing\n\tastronomical rates when the time consumed is too small to measure.\n\n\t* magick/timer.c (GetTimerResolution): New function to return the\n\ttimer's resolution.\n\n2005-03-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Eliminate cause of annoying\n\twarning when PDFs are read by Ghostscript 8.5.\n\n2005-03-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.h (lt_dlerror): Needed to provide a mapping to\n\tNTdlerror().\n\n\t* coders/tiff.c (TIFFErrors): Update to make thread safe via\n\tthread specific data.\n\t(TIFFWarnings): Update to make thread safe via thread specific\n\tdata.\n\n\t* magick/tsd.c (MagickTsdKeyCreate): New function to support\n\tthread specific data.\n\t(MagickTsdKeyDelete): ditto\n\t(MagickTsdSetSpecific): ditto\n\t(MagickTsdGetSpecific): ditto.\n\n2005-03-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (ReplaceImageColormap): New function to replace\n\tthe image colormap with a user-provided one. Colormap indexes are\n\tadjusted to point to identical colors in the new colormap.\n\n\t* magick/nt_base.h: Reorganized a bit to cluster code supporting\n\tsimilar features in the same area of the header.\n\n\t* magick/nt_base.c: Renamed wrappers for standard functions so\n\tthat they have the prefix `NT`. Macros are used to apply the new\n\tnames. This assures that there will not be conflicts if the library\n\tis linked with a different package's wrapper functions.\n\n2005-03-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/quantize.c (GrayscalePseudoClassImage): Moved to here\n\tfrom image.c.  Added support for is_monochrome.\n\n2005-03-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* jp2: Updated Jasper library to version 1.701.0.\n\n\t* magick/nt_base.c (NTGhostscriptFonts): Fixed a coding error\n\twhich was added when strcpy/strcat code was replaced with\n\tstrlcpy/strlcat.  Ghostscript fonts were not being found.\n\n\t* magick/constitute.c (ReadImage): Don't attempt to access image\n\tmembers if image pointer is null.  Oops!\n\n2005-03-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageType): Bilevel image is not required to\n\tbe PseudoClass type.\n\n\t* coders/mpc.c (WriteMPCImage): Persist is_monochrome and\n\tis_grayscale flags.\n\t(ReadMPCImage): Restore is_monochrome and is_grayscale flags.\n\n\t* magick/constitute.c (WriteImage): Extended logging to include\n\tmonochrome and grayscale flags.\n\t(ReadImage): Extended logging to include monochrome and grayscale\n\tflags.\n\n\t* magick/image.c (DescribeImage): Include the effective pixel I/O\n\trate alongside the image read/write time.  This provides an easier\n\tway to evaluate image read/write performance when looking at\n\t`identify` or `convert -verbose` output.\n\n\t* coders/sun.c (ReadSUNImage): Ensure that pixel length value does\n\tnot overflow for large images.\n\n2005-03-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/cache.c (SetImagePixels): Improved documentation.\n\t(GetImagePixels): Improved documentation.\n\n2005-03-10 Glenn Randers-Pehrson <glennrp@glennrp.com>\n\n\t* coders/png.c: Avoid attempting to write indexed PNG when\n\ta color entry has more than one opacity level.  The PNG format\n\tsupports this but GM's colormap does not, so erroneous files\n\twere being written.\n\n2005-03-09  Arne Rusek  <zonk@matfyz.cz>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Offset type\n\tcorrection to fix loop termination if size_t type is not `long`.\n\n2005-03-09  Alexander Yaworsky  <yaworsky@users.sourceforge.net>\n\n\t* coders/jbig.c (WriteJBIGImage): JBIG was writing an empty output\n\tfile. Apparently libjbig parameters have changed. Setting l0\n\tparameter of jbg_enc_options to zero instead of -1 (like in\n\tjbigkit's pbmtools) solved the problem.\n\n2005-03-07  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick\\magick\\GM_magick.bpr: Updated to reflect changes since\n\tlast update.\n\n\t* BCBMagick\\magick\\libMagick.bpr: Updated to reflect changes since\n\tlast update.\n\n2005-03-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/alpha_composite.h (AlphaComposite): Moved AlphaComposite\n\tto new alpha_composite.h header since it was causing porting\n\tproblems.\n\n\t* magick/constitute.h (enum QuantumType): Added CIEYQuantum and\n\tCIEXYZQuantum quantum import options.\n\n\t* coders/tiff.c (ReadTIFFImage): Import LogLuv image data within\n\tGraphicsMagick (rather than libtiff) so that color resolution is\n\tnot lost.  Results in a small speedup as well.\n\n\t* magick/constitute.c (ImportImagePixelArea): Add a speed-up for\n\timporting bi-level images.  Add support for importing pixels in\n\tCIE XYZ and CIE Y colorspaces.\n\n\t* coders/tiff.c (ReadTIFFImage): Support reading TIFF images which\n\tfail to properly scale the samples to the sample size (e.g. 12\n\tbits in a 16-bit sample).\n\t(WriteTIFFImage): Adjustments to strip-size (rows-per-strip)\n\testimation.\n\n\t* magick/constitute.c (ExportImagePixelArea): Support exporting\n\tunsigned samples with values which span only part of the range.\n\tFor example, 12 bit data may be exported within 16 bit samples,\n\twith a value range of 0 to 4095.\n\t(ImportImagePixelArea): Support importing unsigned samples with\n\tvalues which span only part of the range.\n\n2005-02-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Support reading TIFF files in\n\tIEEEFP format.\n\t(WriteTIFFImage): Support writing TIFF files in IEEEFP format.\n\n\t* magick/constitute.c (ExportImagePixelArea): Support exporting\n\tfloating point data.\n\t(ImportImagePixelArea): Support importing floating point data.\n\n2005-02-26  Albert Chin-A-Young  <china@thewrittenword.com>\n\n\t* acinclude.m4 (AC_CXX_IOS_BINARY): Added macro to detect if the\n\tC++ compiler lacks support for ios::binary.\n\n\t* configure.ac: Use  AC_CXX_IOS_BINARY.\n\n2005-02-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Read grayscale TIFFs as\n\tDirectClass rather than promoting to PseudoClass.  Fix improper\n\tmultiple repeated \"disassociate\" operations when reading planar\n\timages which contain an alpha channel.\n\t(WriteTIFFImage): Fix improper multiple repeated \"associate\"\n\toperations when writing planar images with an alpha channel.\n\n2005-02-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* win2k/IMDisplay/IMDisplayView.cpp (DoDisplayImage): Use\n\tTextureImage to apply background pattern.\n\n\t* magick/image.c (TextureImage): Alpha blend the texture onto the\n\tbackground if the image has a matte channel.\n\n\t* magick/constitute.h (enum QuantumType): Eliminated\n\tGrayInvertedQuantum and GrayInvertedAlphaQuantum which were added\n\tsince GraphicsMagick 1.1.  Replaced this \"inverted\" gray\n\tfunctionality with the grayscale_inverted flag in\n\tExportPixelAreaOptions and ImportPixelAreaOptions.\n\n\t* magick/constitute.c (ExportImagePixelArea): Added an extra\n\tparameter for passing seldom used options via an\n\tExportPixelAreaOptions structure.\n\t(ImportImagePixelArea): Added an extra parameter for passing\n\tseldom used options via an ImportPixelAreaOptions structure.\n\t(ExportPixelAreaOptionsInit): New function to initialize the\n\tExportPixelAreaOptions structure with defaults.\n\t(ImportPixelAreaOptionsInit): New function to intialize the\n\tImportPixelAreaOptions structure with defaults.\n\n\t* coders/jpeg.c (WriteJPEGImage): Don't use jpeglib private\n\tBITS_IN_JSAMPLE definition to select JPEG bit depth.\n\n\t* coders/tiff.c (ReadTIFFImage): Support using -define\n\ttiff:alpha={unspecified|associated|unassociated} to specify the\n\talpha channel type in case the alpha channel is marked\n\tincorrectly.\n\tProperly read associated alpha images.\n\t(WriteTIFFImage): Support using -define\n\ttiff:alpha={unspecified|associated|unassociated} to override the\n\talpha channel type.\n\tProperly write associated alpha images by default.\n\n2005-02-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WritePTIFImage): Ensure that pyramid image frames\n\tare the same type as the original image.\n\t(WriteTIFFImage): Added support for writing tiled TIFF.\n\n2005-01-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (TraceBezier): Avoid probable bug under Visual\n\tC++ 7.0 or later due to the argument to pow not being promoted to\n\tdouble.\n\n2005-01-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Re-wrote TIFF writing code.\n\n\t* magick/image.h (MaxValueGivenBits): Renamed MaxRGBGivenBits\n\tmacro to MaxValueGivenBits.\n\n\t* magick/constitute.h (enum QuantumType): Added UndefinedQuantum.\n\n\t* magick/static.c (RegisterStaticModules): Support compiling\n\twithout PNG.\n\n2005-01-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/color.c (IsPaletteImage): Fix memory leak reported by\n\tStefan v. Wachter <svwa-dev@mnet-online.de>.\n\n\t* magick/Makefile.am (MAGICK_INCLUDE_HDRS): Needed to install\n\tmagick/operator.h.\n\n\t* coders/tiff.c (ReadTIFFImage): Re-wrote TIFF reading code again\n\tfor more flexibility and performance.\n\n2005-01-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Remove --disable-lzw option and HasLZW define.\n\tLZW support is always enabled now.\n\n2005-01-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tga.c (WriteTGAImage): Incorporated patch from Stefan\n\tv. Wachter to enable writing grayscale images as well as adding\n\tmore image type option smarts.\n\n\t* coders/psd.c (ReadPSDImage): Fix stack overflow vulnerability\n\treported by Andrei Nigmatulin. See http://lwn.net/Articles/119713/\n\tfor details.\n\n2005-01-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* win2k/IMDisplay/IMDisplayDoc.cpp (DoReadImage): Ensure that image\n\tis in RGB color space after being read since this is what Windows\n\texpects.\n\n2005-01-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Handle extra samples in scanline\n\tTIFFs.\n\n2005-01-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (DescribeImage): Report statistics for a virtual\n\tgray channel for grayscale images rather than discrete red, green,\n\tand blue.\n\n\t* PerlMagick/Makefile.nt: JNG and JP2 to test list.\n\n\t* configure.ac: Changed --without-fpx to --with-fpx due to\n\tdecision to default FlashPIX to `no`.  FlashPIX library is not\n\tvery portable and is only known to work properly under SPARC\n\tSolaris and Windows.\n\n\t* NEWS: Updated with latest news.\n\n\t* lcms: Updated to LCMS 1.14.\n\n2005-01-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (ReadJP2Image): Handle images in YCBCR colorspace.\n\t(ReadJP2Image): Retrieve and store an ICC ICM color profile if\n\tpresent.\n\n\t* PerlMagick/t/tiff/read.t: Added test for reading truecolor\n\tplanar TIFF image.\n\tAdded test for reading 32-bit TrueColor TIFF image.\n\tAdded test for reading 32-bit grayscale TIFF image.\n\n\t* coders/tiff.c (ReadTIFFImage): Fixed stripped TIFF reader.\n\n2005-01-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Only set TIFFTAG_PREDICTOR to 2\n\tfor bits-per-sample values that libtiff supports.\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2006",
    "content": "2006-11-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Magick++/Image.html: Fix documentation regarding retrieving\n\tEXIF attribute.\n\n\t* magick/command.c: Fix typo in usage messages.\n\n2006-11-02  Daniel Kobras  <kobras@debian.org>\n\n\t* coders/dcm.c: (ReadDCMImage) Prevent buffer overflow of\n\t`photometric` array in DCM coder. Original patch thanks to\n\tM Joonas Pihlaja. (CVE-2006-5456)\n\n\t* coders/palm.c: (ReadPALMImage) Fix heap overflows of `one_row`\n\tarray in PALM coder. Original patch thanks to M Joonas Pihlaja.\n\t(CVE-2006-5456)\n\n2006-10-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Updated libtool to latest CVS head version (1.2352 2006/10/24)\n\tin order to fix a bootstrap nit.\n\n2006-10-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Updated autoconf to version 2.60, automake to version 1.10, and\n\tlibtool to latest CVS head version (1.2348 2006/10/22).\n\n2006-09-11  Daniel Kobras  <kobras@debian.org>\n\n\t* coders/xcf.c (ReadBlobStringWithLongSize): Add new parameter `max`\n\tto prevent overflowing the `string` array. (CVE-2006-3743)\n\t(ReadOneLayer): Adjust callers of ReadBlobStringWithLongSize(), and\n\tguard against infinite loops on premature end-of-file.\n\t(ReadXCFImage): Adjust callers of ReadBlobStringWithLongSize(), and\n\tguard against infinite loops on premature end-of-file.\n\n2006-09-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sgi.c (ReadSGIImage): Mostly applied Debian patch for\n\tCVE-2006-4144 security issue related to RLE decoding.  Also added\n\tcomplete verification of file header.\n\n\t* magick/image.c (ComputePixelError): Add progress monitor.\n\t(GetImageStatisticsMean): Call progress monitor less often.\n\t(GetImageStatisticsVariance): Call progress monitor less often.\n\n2006-08-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): ImageInfo `endian` option now\n\tcontrols TIFF byte-order rather than bit-order when writing.\n\n\t* coders/png.c (ReadOnePNGImage): Fix compilation problem.  Patch\n\tsubmitted by Aron Stansvik.\n\n2006-07-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (WriteJPEGImage): Clear the JPEG library\n\tstructures in order to ensure a completely clean slate.\n\n2006-06-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (ConvertImageCommand): Fix memory leaks which\n\toccured when an image was not returned.\n\n\t* magick/command.c (IdentifyImageCommand): Ditto.\n\n\t* magick/command.c (MogrifyImageCommand): Ditto.\n\n2006-06-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Add mention of -resample to convert and\n\tmogrify usage messages.\n\n2006-05-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>\n\n\t* configure.ac: Fix arguments to AC_CHECK_HEADER.\n\n2006-05-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): -define tiff:alpha= override was\n\tonly working if the TIFFTAG_EXTRASAMPLES tag was present.  Now it\n\tis always available when an alpha channel is present.\n\n2006-05-11  JH  <jh@ops.everybox.com>\n\n\t* GraphicsMagick.spec.in (files devel): Include\n\t%{_libdir}/lib%{name}Wand.so.\n\n2006-05-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (NTGhostscriptEnumerateVersions): Recent GNU\n\tGhostscript identifies itself as \"GPL Ghostscript\".\n\n2006-04-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff: Updated bundled libtiff to version 3.8.2.\n\n2006-04-05  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c: Sets image is_grayscale flag as well as added more\n\tsymbolic constants.\n\n2006-04-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (IMAGE_DATA_ROUNDING): Thanks to Steve Sloan for\n\tnoticing that 8K is 8192 rather than 8092.  Added a define to\n\tallow tailoring the pixel data alignment boundary in case 8K is\n\tnot the right answer for some reason.\n\n2006-03-20  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c: Ensure that unusued opacity channel is set to opaque.\n\n\t* PerlMagick/t/input.art: New ART test image.\n\n\t* PerlMagick/t/input8.mat: New MATLAB test image (8-bit indexed).\n\n\t* PerlMagick/t/input_dbl.mat: New MATLAB test image (double grey)\n\n\t* PerlMagick/t/input_rgb.mat: New MATLAB test image (8-bit RGB)\n\n2006-03-19  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c: Use symbolic constants rather than plain numbers\n\tso the module is more maintainable.  Correct the format for the\n\tday of the week.\n\n2006-03-13  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c (WriteMATLABImage): Add RGB writer support for\n\tMATLAB format.\n\n2006-03-11  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c (ReadMATImage): RGB support for MAT reader.\n\n2006-03-02  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c: Fixes for observed crash.  Byte and word formats\n\tare working.\n\n2006-02-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/environment.imdoc: MAGICK_FONT_PATH has not been supported\n\tsince 1.1.  Remove mention of it!\n\n2006-02-23  Mike Chiarappa  <mikechiarappa@libero.it>\n\n\t* BCBMagick: Updated to latest changes\n\n2006-02-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sgi.c (ReadSGIImage): Properly compute image depth for\n\t16-bit SGI image files.\n\n2006-01-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GetExecutionPathUsingName): Search executable\n\tsearch path for binary.\n\n2006-01-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage, WriteDPXImage): Alpha channel in DPX\n\tuses zero, or reference black, to represent an opaque pixel.\n\n2006-01-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/semaphore.c (AllocateSemaphoreInfo): Allow semaphores to\n\trecurse on POSIX systems which support recursive semaphores but\n\talso warn if the semaphore recurses.\n\n\t* magick/log.c (SetLogEventMask): Avoid deadlock if invoked before\n        log.mgk has been loaded.\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Fix memory leak on\n\terror which was reported by Micha Kowalczuk.\n\n2006-01-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ReadImage): Avoid crash if delegate fails\n\tto return image.\n\n2006-01-03  Daniel Kobras  <kobras@debian.org>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Fix EXIF IFD stack\n\toverflow vulnerability.\n\n\t* configure.ac: Fix typo in HTMLDecodeDelegate.\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2007",
    "content": "2007-12-23  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* VisualMagick/configure/configure.rc: Better positioning of frog,\n\tchanged original ImageMagick messages.\t\n\n\t* VisualMagick/configure/configure.exe: New build.\n\n2007-12-22  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* magick/command.c: Fix compilability issue for Microsoft Visual\n\tStudio 6.\n\n2007-12-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Use some improved tests for POSIX standard types\n\tavailable in Autoconf 2.61.\n\tAdd support for configuring a magick_uintmax_t type.\n\tAdded support for configuring a magick_uintptr_t type.\n\n2007-12-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.h (MagickSafeMultiplySize_t): New function to\n\tperform a safe multiply.  A multiplication overflow results in\n\tzero.\n\t(MagickAllocateMemory): Check for size_t value truncation/overflow\n\tand zero size before deciding to allocate memory.  Any detected\n\tfailure results in a NULL pointer being returned.\n\t(MagickReallocMemory): Add a type parameter to use in cast in\n\torder to avoid C++ portability problem.\n\n\t* PerlMagick/Magick.xs: Eliminate use of deprecated methods.\n\n\t* magick/memory.c (MagickAcquireMemory): New function to allocate\n\tmemory.\n\t(MagickAcquireMemoryArray): New function to allocate memory for an\n\tarray of objects.\n\t(MagickCloneMemory): New function to intelligently copy memory.\n\t(MagickReallocateMemory): New function to re-allocate memory.\n\t(MagickReleaseMemory): New function to deallocate memory.\n\n\t* magick/deprecate.c (AcquireMemory): Deprecated in favor of new\n\tfunction MagickAcquireMemory().\n\t(CloneMemory): Deprecated in favor of new function\n\tMagickCloneMemory().\n\t(LiberateMemory): Deprecated in favor of new function\n\tMagickReleaseMemory().\n\t(ReacquireMemory): Deprecated in favor of new function\n\tMagickReallocateMemory().\n\n2007-11-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ReadImage): Log colorspace of returned image.\n\t(WriteImage): Log colorspace of image to be written.\n\n\t* coders/{miff.c,mpc.c,tga.c,tiff.c}: Use MagickBoolToString().\n\n\t* magick/{constitute.c,xwindow.c}: Use MagickBoolToString().\n\n\t* magick/image.h (MagickBoolToString): New macro to convert truth\n\tvalue to a constant \"True\" or \"False\" string.\n\n2007-11-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (IsImagesEqual): Allow comparing images if the\n\tcolorspace enumeration is different but the images are both an RGB\n\ttype.\n\n2007-11-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Add support for -monitor option to `animate`,\n\t`display`, and `import`.\n\n\t* coders/fpx.c (WriteFPXImage): Fix compilation problem.\n\n\t* coders/dpx.c (TentUpsampleChroma): Fix access beyond array.  Use\n\tinteger calculations where possible.\n\n2007-11-07  Andy Armstrong  <andy@hexten.net>\n\n\t* PerlMagick/t/setattribute.t: Fix for typo which breaks\n\tTest::Harness 3.00.\n\n2007-10-20  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* mat.c: Attempt to read `logic` type modification \n        as monochrome image.\n\n2007-10-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (ReadBlob?SBFoo): Return 0 on EOF conditions\n\trather than a magic value concocted using ~0.  The magic value was\n\tvery sensitive to the size/range of the type used to pass and\n\tstore it, leading to increased possibility of error.  There was\n\talso concern that sometimes a successfully read value may match\n\tthe magic value.  Added documentation that EOFBlob() may be used\n\tto determine that the blob is in EOF state.\n\n\t* coders/pix.c (ReadPIXImage): Avoid reliance on a particular\n\tmagic value being returned from ReadBlobMSBShort on EOF.\n\n\t* coders/avs.c (ReadAVSImage): Avoid reliance on a particular\n\tmagic value being returned from ReadBlobMSBLong() on EOF.\n\n2007-10-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* wpg.c: Monochrome images are not using palette - \n\tpalette is discarded in this case.\n\n2007-10-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.h: Blob I/O APIs now use sized types so that passed\n\tand returned data values are a specific size rather than\n\tarchitecture dependent.\n\n\t* PerlMagick/t/read.t: Added read test for unsigned 32-bit LSB MAT\n\tformat.\n\n2007-10-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dib.c (ReadDIBImage): Use appropriate sized cast for DIB\n\twidth and height values.  Validate width and height values.\n\n\t* coders/bmp.c (ReadBMPImage): Use appropriate sized cast for BMP\n\twidth and height values.\n\n\t* magick/colorspace.c (RGBTransformImage): Use a better rounding\n\talgorithm when converting to HSL/HWB colorspaces.\n\n\t* magick/gem.c (TransformHSL): Avoid GCC opimization bug on\n\tOpteron which caused wrong results.  Ensure that returned values\n\tfall within bounds 0.0 to 1.0.\n\t(TransformHWB): Avoid GCC opimization bug on\n\tOpteron which caused wrong results.  Ensure that returned values\n\tfall within bounds 0.0 to 1.0.\n\n\t* PerlMagick/t/ttf/read.t: Relax strictness quite a bit for TTF\n\tread tests in order to allow somewhat different FreeType output.\n\n2007-09-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colorspace.c (RGBTransformImage): Add missing break\n\tstatement. HWB colorspace was used rather than HSL.\n\t(TransformRGBImage): Add missing break\n\tstatement. HWB colorspace was used rather than HSL.\n\n2007-09-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sun.c (ReadSUNImage): Properly report SUN image depth.\n\n2007-09-28  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Ability to write multiple images to one MAT file.\n\tFixed bug - incorrect matrix size for gray image.\n\n2007-09-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c (IntegralRotateImage): Rotation by 270 degrees\n\twas wrong.  It was flipped from what it should be.\n\n2007-09-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (CommandProgressMonitor): Remove any preceding\n\twhitespace in the task descriptions so that we don't need to\n\tupdate all of the task descriptions right away.\n\n\t* magick/colorspace.c (RGBTransformImage): Improve progress monitor message.\n\t(TransformRGBImage): Improve progress monitor message.\n\n\t* coders/miff.c (ReadMIFFImage): Add read progress monitor support.\n\n2007-09-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Fix writing PDF with CCITT\n\tcompression.  Addresses SourceForge bug 1209177 \"TIFF to PDF CCITT\n\tcompression fails\".\n\n2007-09-14  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Ability to read multiple images from one MAT file.\n\tchanged ExtendedSignedIntegralType to magick_off_t that better\n\tcorresponds to file positioning.\n\n2007-09-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Use ThumbnailImage() to create\n\tthumbnail.\n\n\t* coders/preview.c (WritePreviewImage): Use ThumbnailImage() to\n\tcreate thumbnail.\n\n\t* coders/xpm.c (WritePICONImage): Use ThumbnailImage() to create\n\tthumbnail.\n\n2007-09-14  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Several warnings has been suppressed.\n\n2007-09-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Fix writing to pipes and other\n\tnon-seekable output destinations.\n\n\t* magick/blob.c (WriteBlobFile): New function to copy a disk file\n\tto a blob stream.\n\n\t* magick/profile.c (ProfileImage): Fix removing profiles.\n\n2007-09-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (png_flush_data): Don't invoke SyncBlob() since it\n\tdoes far more than force data to the output file.\n\t(ReadPNGImage): Make sure that PNG read errors are reported to the\n\tuser.\n\n\t* coders/jpeg.c (TerminateDestination): Don't invoke SyncBlob()\n\tsince it does far more than force data to the output file.\n\n\t* magick/blob.c (SyncBlob): Remove from public interface.\n\n2007-09-12  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Allowed to read signed integer matrices.\n\tFixed loop break.\n\n2007-09-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Ensure that selected photometric\n\tmost closely matches the user's expectation.  Remove compression\n\tif requested compression type is not compatible with the selected\n\tphotometric.\n\n2007-09-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c (IntegralRotateImage): Use tiles to speed up\n\trotation by 90 or 270 degrees.\n\n2007-09-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c The flop image has been eliminated in a reader.\n\tCode has been shrinked a little bit.\n\n2007-09-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (GetImageCharacteristics): Add progress monitor support.\n\n\t* magick/color.c (IsMonochromeImage): Add progress monitor support.\n\t(IsGrayImage): Add progress monitor support.\n\t(IsOpaqueImage): Add progress monitor support.\n\n\t* coders/dpx.c (ReadDPXImage): Added progress indication.\n\n\t* coders/cineon.c (WriteCINEONImage): Added progress indication.\n\n\t* magick/command.c : Added a -monitor command option for\n\t`composite`, `convert`, `identify`, `mogrify`, and `montage` in\n\torder to enable a simple progress indicator.\n\n2007-09-06  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Write native gray MAT data when gray image is detected.\n\n2007-09-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GetExecutionPath): Add support for Apple OS-X,\n\tLinux, and FreeBSD.\n\n2007-09-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: For Windows MinGW-based build, find Ghostscript\n\tfonts installed under C:/Program Files/.\n\n\t* VisualMagick/bin/delegates.mgk: Adjust quoting to Ghostscript arguments\n\tso that Ghostscript DLL is passed correct commands.\n\n\t* config/delegates.mgk.in: Adjust quoting to Ghostscript arguments\n\tso that Ghostscript DLL is passed correct commands.\n\n\t* configure.ac: Provide defaults for GSColorAlphaDevice and GSGrayDevice.\n\n\t* magick/nt_base.c (NTGhostscriptGetString): Support \"GPL Ghostscript\".\n\n2007-09-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/ps.c (WritePSImage): Improved Postscript writer\n\tperformance.\n\n2007-09-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/profile.c (AllocateImageProfileIterator): New function to\n\tallocate an image profile iterator.\n\t(DeallocateImageProfileIterator): New function to deallocate an\n\timage profile iterator.\n\t(NextImageProfile): New function to advance the image profile\n\titerator to the next profile.\n\n\t* magick/image.h (Image): Profiles are now stored in a generic\n\tcontainer.  As planned years ago, the color_profile, iptc_profile,\n\tgeneric_profile, and generic_profiles members are now removed.\n\n2007-09-01  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/bmp.c Ability to read true color bitmap with invalid palette size\n\tlike other readers do.\n\n2007-08-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (ClonePixelCacheMethods): Remove DLL export.\n\t(DestroyCacheInfo): Remove DLL export.\n\t(GetCacheInfo): Remove DLL export.\n\t(ReferenceCache): Remove DLL export.\n\n2007-08-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageType): More tweaks to obtain the desired\n\tbehavior when converting to a bilevel image.\n\n\t* coders/tiff.c (WriteTIFFImage): Logic which decided the output\n\tsubformat to write was too convoluted to understand, and in fact\n\tpalette images were not be written sometimes when they should be\n\t(bug added on 2007-08-19).  Deleted the convoluted code and\n\treplaced with a different design which should be more correct and\n\tflexible.\n\t(ReadTIFFImage): Decided to read bilevel TIFF using a colormap\n\tsince there are significant internal advantages to doing so.\n\tHowever, the writer is carefully designed to output normal bilevel\n\tTIFF so this should not annoy TIFF users.\n\n\t* magick/constitute.c (ImportImagePixelArea): Re-wrote grayscale\n\tpseudoclass import to be more efficient and more tidy.\n\n2007-08-30  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/art.c Added ART writer\n\n2007-08-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (ReadBlobLSBFloat): Promoted to be a public\n\tinterface (was in mat.c).\n\t(ReadBlobMSBFloat):Promoted to be a public interface (was in\n\tmat.c).\n\n2007-08-29  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/art.c InsertRow has been replaced by ImportImagePixelArea\n\n2007-08-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (ReadPNMImage): PNM \"raw\" formats are now read\n\tusing ImportImagePixelArea()\n\n\t* magick/constitute.c (ExportImagePixelArea): Added an optional\n\texport_info parameter for returning information back to the user.\n\t(ImportImagePixelArea): Added an optional import_info parameter\n\tfor returning information back to the user.\n\n\t* coders/jbig.c (ReadJBIGImage): Use ImportImagePixelArea().\n\t(WriteJBIGImage): Use ExportImagePixelArea();\n\n\t* coders/tiff.c (WriteTIFFImage): Make compression logic a bit\n\tmore tidy.\n\n\t* coders/pcx.c (WritePCXImage): Use GetImageCharacteristics().\n\n\t* coders/pcl.c (WritePCLImage): Use GetImageCharacteristics().\n\n\t* coders/dib.c (WriteDIBImage): Use GetImageCharacteristics().\n\n\t* coders/xpm.c (WritePICONImage): Use GetImageCharacteristics().\n\n\t* coders/viff.c (WriteVIFFImage): Use GetImageCharacteristics().\n\n\t* coders/tga.c (WriteTGAImage): Use GetImageCharacteristics().\n\n\t* coders/sgi.c (WriteSGIImage): Use GetImageCharacteristics().\n\n\t* coders/ps2.c (WritePS2Image): Use GetImageCharacteristics().\n\n\t* coders/pdf.c (WritePDFImage): Use GetImageCharacteristics().\n\n\t* coders/palm.c (WritePALMImage): Use GetImageCharacteristics().\n\n\t* coders/ps.c (WritePSImage): Use GetImageCharacteristics().\n\n\t* coders/jp2.c (WriteJP2Image): Use GetImageCharacteristics().\n\n\t* coders/jpeg.c (WriteJPEGImage): Use GetImageCharacteristics().\n\n\t* PerlMagick/t/read.t: Added read test for LSB `float` MAT.\n\n2007-08-26  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c: MAT reader now extensively uses ImportImagePixelArea.\n\n2007-08-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/Makefile.am: Add rwblob and rwfile tests for MAT format.\n\n\t* magick/constitute.c: Re-wrote Export/Import Float/Double macros\n\tbecause they did not actually work right, and to eliminate the\n\tperformance penalty for native order.\n\n2007-08-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: Add support for \"native\" endian parameter\n\tin PerlMagick.\n\n\t* magick/command.c: Utilities now understand \"native\" as an\n\targument to -endian.\n\n\t* magick/image.h (enum EndianType): Added NativeEndian enum value.\n\n\t* configure.ac: Test libtiff for TIFFSwabArrayOfTriples().\n\n\t* magick/constitute.c (ExportImagePixelArea): Support export in\n\tlittle, big, and native endian.\n\t(ImportImagePixelArea): Support import in little, big, and native\n\tendian.\n\n2007-08-23  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c (WriteMATLABImage): MAT writer uses\n\tExportImagePixelArea() now.  Fix issues noticed by valgrind.\n\n2007-08-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (WritePNMImage): Use `-quality 0` rather than\n\t`-compress none` to select the PNM ASCII subformats.  This change\n\tis made based on the principle of least surprise.\n\n\t* magick/constitute.c (ExportImagePixelArea): Add a GrayQuantum\n\timplementation for exporting from two color PsuedoClass.\n\n\t* coders/pnm.c (WritePNMImage): Use GetImageCharacteristics() and\n\tExportImagePixelArea() in implementation.\n\n2007-08-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ExportImagePixelArea): Performance\n\timprovements.\n\t(ImportImagePixelArea): Performance improvements.\n\n2007-08-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (IdentifyImageCommand): If \"%r\" is present in\n\t-format specifier, then read whole image.\n\n\t* magick/utility.c (TranslateTextEx): Undocumented \"%r\"\n\tsubstitution now returns a string based on GetImageType() rather\n\tthan a concatentation of image class and \"Matte\".\n\n\t* coders/tiff.c (WriteTIFFImage): Use GetImageCharacteristics().\n\n\t* magick/image.c (GetImageCharacteristics): New function to\n\tevaluate the basic characteristics of the image.\n\t(GetImageType): Use GetImageCharacteristics().\n\n2007-08-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (RegisterDPXImage): Remove extra newline in usage\n\tnote.\n\n\t* coders/fax.c (RegisterFAXImage): Fix note to reflect that the\n\toutput from this coder is *not* a TIFF subformat as was previously\n\tclaimed.\n\n\t* coders/tiff.c (WriteTIFFImage): Output G3 TIFF FAX images as per\n\tthe TIFF Class F specification.\n\n2007-08-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/{api.h, studio.h}: Strip out legacy MacOS 9 and VMS \"support\".\n\n\t* magick/{nt_base.c, unix_port.c} (MagickGetMMUPageSize): New function to obtain\n\tthe VM page size.\n\n\t* magick/pixel_cache.c (PersistCache): Fix a terrible memory leak\n\twhen reading MPC files.  Added Cache reference-count logging.\n\n2007-08-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (BenchMarkSubCommand): Added a new `benchmark`\n\tGraphicsMagick command which can be used to perform benchmarking\n\ton any other GraphicsMagick command.\n\n2007-08-11  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c (ReadMATImage): Support image is_grayscale flag.\n\tAdd some coder logging.\n\n2007-08-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/{paint.c, render.c, annotate.c}: Use AlphaComposite()\n\tfrom alpha_composite.h.\n\n\t* magick/alpha_composite.h (BlendComposite): Move inline\n\tBlendComposite() to a header file since it is used in multiple\n\tplaces.\n\n\t* magick/{shear.c, image.c}: Use BlendComposite() from\n\talpha_composite.h.\t\n\n\t* magick/image.c (SetImageDepth): Don't bother to test current\n\tdepth in advance. Preserve is_monochrome flag.  Encapsulate\n\tbit-reduction algorithm in a macro. Be a bit smarter with\n\tPseudoClass images.\n\t(SyncImage): Preserve is_monochrome flag.  Improve performance\n\twhen image does not have an opacity channel.\n\n\t* PerlMagick/t/read.t: Allow some error when reading double MAT.\n\n2007-08-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/read.t: Update MAT read tests according to\n\tinstructions from Fojtik Jaroslav.\n\n2007-08-06  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c (ReadWPGImage): Support WPG files which use XOR\n\toperator.\n\n2007-08-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (ReadBlobLSBdouble): Migrate from mat.c.\n\t(ReadBlobMSBdouble): Migrate from mat.c.\n\n2007-08-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ExportImagePixelArea): Add optimized\n\tsupport for 2 and 16 color PseudoClass.\n\t(ImportImagePixelArea): Add optimized support for 2 and 16 color\n\tPseudoClass.\n\n\t* magick/constitute.c (ImportImagePixelArea): Add option to output\n\tpad bytes at end of pixel data.  Added optimized implementation of\n\tIndexQuantum for bilevel images.\n\n\t* coders/tiff.c (WriteTIFFImage): Be smarter when writing gray\n\tPalette and grayscale TIFF images in order to not waste time.\n\n\t* coders/bmp.c (ReadBMPImage): Use ImportImagePixelArea() when\n\treading and writing bilevel and colormapped images.\n\t(WriteBMPImage): Use ExportImagePixelArea() when writing bilevel\n\timages.\n\n\t* magick/version.h.in: Added wrapping for copyright line to a\n\treasonable width.\n\n\t* AUTHORS: Added Daniel Kobras.\n\n\t* magick/command.c (VersionCommand): Added feature support list to\n\t-version output.\n\n2007-08-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (AnimateImageCommand): Add support for -type to\n\t`animate`.\n\t(DisplayImageCommand): Add support for -type to `convert`\n\n\t* config/delegates.mgk.in, VisualMagick/bin/delegates.mgk: Added\n\tgs-gray and gs-color+alpha delegate definitions.\n\n\t* coders/{ept.c, pdf.c, ps.c}: Respect a -type Bilevel, Grayscale,\n\tTrueColor, or TrueColorMatte request by passing appropriate\n\toptions to Ghostscript for rendering..\n\n2007-07-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ImportImagePixelArea): Improved read speed\n\tfor bilevel gray image.  Many thanks to Mark Mitchell for\n\tinspiration and ideas.\n\n\t* coders/caption.c (ReadCAPTIONImage): Eliminate use of strcpy().\n\n\t* coders/pnm.c (ReadPNMImage): Add logging as well as support for\n\tis_monochrome and is_grayscale flags.\n\n\t* magick/color.h (IsMonochrome): Add parenthesis so macro is more\n\trobust.\n\n2007-07-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/html.c (WriteHTMLImage): Eliminate use of strncat().\n\n\t* coders/locale.c (ReadConfigureFile): Eliminate use of strncat().\n\n\t* coders/png.c (ReadOnePNGImage): Eliminate use of strncat().\n\n\t* magick/fx.c (ConvolveImage): Eliminate use of strncat().\n\n\t* coders/tiff.c (WriteTIFFImage): Eliminate use of strncat().\n\n\t* magick/delegate.c (InvokePostscriptDelegate): Eliminate\n\tdoubled-output when running in verbose mode.\n\n2007-07-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/delegate.c (InvokePostscriptDelegate): MagickSpawnVP()\n\trequires three parameters.\n\n2007-07-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* bzlib: Updated bzip2 to 1.0.4.\n\n\t* jbig: Updated jbigkit to 1.6\n\n\t* jp2: Updated JasPer to 1.900.1.\n\n\t* lcms: Updated lcms to 1.16\n\n\t* png: Updated libpng to 1.2.18.\n\n2007-07-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xc.c (ReadXCImage): If ImageInfo type field is set to\n\tTrueColorType or TrueColorMatteType type, then return a\n\tDirectClass image, otherwise a PseudoClass image is returned as\n\tbefore.  From the command line this can be used like:\n\t`gm convert -size 640x480 -type TrueColor xc:red red.miff`.\n\tPrograms may also use this in order to obtain a DirectClass\n\tcanvas image to draw on.\n\n\t* magick/enhance.c (LevelImage): Fix potential buffer overflow\n\twhich was added since the 1.1 branch.\n\n2007-07-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/delegate.c (UnixShellTextEscape): Don't escape newline\n\tcharacter since it performs the opposite of what is desired.\n\n2007-07-23  Daniel Kobras  <kobras@debian.org>\n\n\t* magick/delegate.c (UnixShellTextEscape): Fix fencepost error\n\t  when checking whether escaping is safe.\n\n2007-07-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Retire VMS and MacOS 9 support from package.\n\n2007-07-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/{cmyk.c, gray.c, mono.c, rgb.c, uyvy.c, wbmp.c, yuv.c}\n\t(ReadFOOImage): Check for EOF while searching for start of image\n\tdata.\n\n\t* tests/Makefile.am: Don't test PTIF format with blob I/O since it\n\tis not possible to pass the rwblob test and it is really an output\n\tdriver rather than a format.\n\n\t* libtool: Update to latest CVS libtool.\n\n\t* magick/constitute.c (ExportModulo8Quantum): Move Import and\n\tExport macros from header file since they are not used anywhere\n\telse.\n\n\t* coders/dpx.c: Add underscore suffix to macro local variable\n\tnames in order to avoid conflict with names in code using the\n\tmacros.\n\n2007-07-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c: Reduce the number of warnings when compiling\n\tthe Wand library.\n\n\t* coders/xwd.c (XWD_OVERFLOW): Eliminate comparison between signed\n\tand unsigned.\n\n\t* coders/pnm.c (ValidateScalingIndex): Eliminate check to see if\n\tunsigned type is less than zero.\n\n\t* magick/log.c (LogMagickEvent): Even though log file name comes\n\tfrom a controlled source (log.mgk), perform safe numeric\n\tsubstitution on it.\n\n\t* coders/xwd.c (ReadXWDImage): Eliminate conflict between locally\n\tdefined OVERFLOW macro and similarly named macro under Windows.\n\n2007-07-18  Daniel Kobras  <kobras@debian.org>\n\n\t* coders/xwd.c (ReadXWDImage): Integer overflow fix\n\t(CVE-2007-1797).  From Debian patch\n\txwd_integer_overflow_fixes_CVE-2007-1797.\n\t(ReadXWDImage): Fix for integer under/overflow.  From Debian patch\n\txwd_overflow_fix.\n\n\t* coders/wpg.c (ReadWPGImage): WPG segfault fix.  From Debian\n\tpatch wpg_segfault_fix.\n\n\t* coders/viff.c (ReadVIFFImage): Verify number of bands prior to\n\tusing image.  From Debian patch viff_heap_corruption_fix.\n\n\t* coders/sun.c (ReadSUNImage): Sun segfault fix.  From Debian\n\tpatch sun_segfault_fix.\n\n\t* magick/blob.c (ReadBlobStream): Never try to read data beyond\n\tEOF in blob streams. Some (but not all) ReadBlob*() methods\n\talready implemented similiar checks. Moving it to the central\n\tReadBlobStream() increases robustness and prevents out-of-bounds\n\treads.  From Debian readblob_offset_robustness patch.\n\n\t* coders/pnm.c (ReadPNMImage): Validate pixel scaling.  From\n\tDebian pnm_scale_fix patch.\n\n\t* coders/pict.c (ReadPixmap): PICT segfault fix.  From Debian\n\tpict_segfault_fix patch.\n\n\t* coders/pcx.c (ReadPCXImage): PCX heap overflow fix.  From Debian\n\tpcx_heap_overflow_fix patch.\n\t(ReadPCXImage): PCX segfault fix.  From Debian pcx_segfault_fix.\n\n\t* magick/montage.c, PerlMagick/t/montage.t: Do not pass bogus\n\tnegative values to modulate shadow in montage. Instead, drop a\n\tconstant grey shadow like current ImageMagick.  From Debian\n\tmontage_shadow_fix patch.\n\n\t* coders/png.c (ReadMNGImage): MNG segfault fix.  From Debian\n\tmng_segfault_fix patch.\n\n\t* utilities/miff.4: MIFF man page apropos fix.  From\n\tDebian miff_apropos_fix patch.\n\n\t* coders/icon.c (ReadIconImage): Icon segfault fix.  From Debian\n\ticon_segfault_fix patch.\n\n\t* tests/drawtest.c: Make sure filename strings do not run out of\n\tbounds in drawtest. From Debian drawtest_segfault_fix patch.\n\n\t* config/delegates.mgk.in: Remove obsolete option -2 when calling\n\tdcraw as a delegate.  From Debian dcraw_options_fix patch.\n\n\t* coders/dcm.c (ReadDCMImage): Fix integer overflow in DCM\n\tcoder. (CVE-2007-1797).  From Debian dcm_overflow_fix patch.\n\n\t* coders/bmp.c (ReadBMPImage): Verify file seek success.  From\n\tDebian bmp_overflow_fix patch.\n\n2007-07-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.h (MagickReallocMemory): It seems that realloc()\n\tfrees the provided memory pointer if the requested size is zero.\n\tThis was causing MagickReallocMemory() to perform a double-free\n\tunder error conditions.  Inspired by Debian\n\trealloc_double_free_fix patch by Daniel Kobras.\n\n2007-07-18  Daniel Kobras  <kobras@debian.org>\n\n\t* magick/quantize.c (GrayscalePseudoClassImage): Fix computation\n\tof memory required for colormap index\n\t(colormap_heap_overflow_fix).\n\n2007-07-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (WriteRunlengthPacket): Converted excessively long\n\tmacro to a function and hopefully eliminate warnings when using\n\tVisual Studio 2005.\n\t* magick/pixel_cache.c (ClonePixelCache): Eliminate bug when\n\tsize_t is an unsigned type.\n\n2007-07-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageInfo): Address security issue noted by\n\tCVE-2006-0082\n\thttp://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-0082 in\n\twhich output filenames matching arbitrary printf specifications\n\tmay cause GraphicsMagick to crash.\n\n\t* magick/utility.c (TranslateTextEx): New version of TranslateText\n\twhich allows copying each attribute via a user-provided callback\n\tfunction.\n\n\t* magick/delegate.c (InvokeDelegate): Implement secure delegate\n\texecution in POSIX environments in order to avoid injection of\n\tarbitrary shell commands via carefully crafted filenames.  Fixes\n\tDebian Bug 345238 \"[CVE-2005-4601] Shell command injection in\n\tdelegate code (via file names)\"\n\thttp://bugs.debian.org/cgi-bin/bugreport.cgi?bug=345238\n\n2007-07-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/forward.h: New header file to support forward type\n\tdeclarations.\n\n\t* coders/pnm.c (ReadPNMImage):  Fix pixel scaling problem caused by\n        floating point rounding error.\n\n2007-07-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h: Provide pread() and pwrite() prototypes if they\n\tare missing.\n\n\t* configure.ac: Check for missing pread() and pwrite() prototypes.\n\n\t* m4/ac_func_fseeko.m4: Use fixed version of AC_FUNC_FSEEKO.\n\n\t* magick/utility.c (SystemCommand): Avoid use of snprintf.\n\n2007-07-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c: Only replace getc_unlocked() and putc__unlocked()\n\tfor a thread-safe build.\n\n\t* magick/studio.h: Always use fseeko() and ftello() if they are\n\tavailable.\n\n2007-07-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Avoid using seek() if possible, and\n\tdon't use at all if the input is not seekable.\n\n\t* coders/psd.c (ReadPSDImage): Eliminate memory leak when reading\n\tPSD files.  Fixes Sourceforge issue 1625477 \"Memory leak reading\n\tlayered PSD Image\".\n\n2007-06-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Fixed -affine command argument\n\tvalidation. Fixes SourceForge issue 1743141 \"Affine matrix option\n\tparsing\".\n\n\t* config/magic.mgk: Added detection for BigTIFF.\n\n\t* coders/tiff.c: Preliminary work to support BigTIFF.\n\n2007-06-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Fix problems encountered when reading and writing\n\tfrom/to pipes or compressed files.\n\n2007-06-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Improved the pixel data marshalling\n\tin order to obtain better read performance for 10-bit DPX.\n\n\t* magick/blob.c (OpenBlob): Added support for MAGICK_MMAP_READ and\n\tMAGICK_MMAP_WRITE environment variable options to enable input and\n\toutput file access using mmap().\n\n2007-06-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (OpenBlob): Use MAGICK_IOBUF_SIZE to tune the size\n\tof the I/O buffer.  Sometimes performance is improved by using\n\tsomething other than the current default of 16KB.\n\n2007-06-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Handle case where compression\n\tkeyword is present but has value of `None`.\n\n2007-06-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (OpenBlob): Disable reading input files using\n\tmemory mapping since it has been learned that some operating\n\tsystems fail to do read-ahead on network files.  Without\n\tread-ahead, performance is poor.\n\n\t* magick/resource.c (AcquireMagickResource): Map resource limit\n\twas not being properly checked due to a typo.  The memory limit\n\twas being tested instead.\n\n\t* coders/tiff.c (ReadTIFFImage): Use libtiff to decode OJPEG\n\tcompressed files into RGB.  Probably requires new OJPEG\n\timplementation from Joris Van Damme which is new in libtiff and\n\tnot yet released. I am not completely sure that this approach is\n\tcorrect yet.\n\n2007-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/xwindow.c (MagickXGetWindowImage): Set image->depth\n\tappropriately.\n\n\t* many files: Compiler warnings reduction.\n\n2007-05-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/cineon.c (ReadCINEONImage): Alter sample scaling\n\talgorithm a bit.\t\n\n\t* tests/rwblob.c, tests/rwfile.c: Allow some slop when testing\n\tCineon format with QuantumDepth=8 since we are currently only\n\tsupporting 10 bit samples.\n\n2007-05-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (ReadJPEGImage): Fix reading 12-bit grayscale\n\tJPEG.\n\n2007-05-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/cineon.c (WriteCINEONImage): Re-wrote Cineon writer from\n\tscratch.  There is no code originating from ImageMagick in this\n\tsource module any more.\n\n2007-04-30  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/art.c, coders.cut.c, coders/mat.c, coders/wpg.c: Add\n\tsupport for PingImage() so that image identification is fast by\n\tdefault.  Also eliminates error message produced by mat.c due to\n\trotating an image which has no pixel cache.\n\n2007-04-09  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c (ReadWPGImage): Fix for SourceForge bug id 1431805\n\t\"clip art wpg files cause access violation in graphics magick\".\n\n2007-04-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (ModifyCache): Ensure that the cache nexus\n\tis open.  Fix for SourceForge bug id 1173713 \"segfault in\n\tModifyCache\"\n\n\t* m4/acx_pthread.m4 (ACX_PTHREAD): Apply fixes necessary to\n\tsupport C++ compiler properly.\n\n2007-04-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/GraphicsMagick.pc.in: Fix for SourceForge bug id 1576616\n\t\"Fix includedir variable in pkg-config files\".\n\n\t* magick/pixel_cache.c (GetOnePixel): Fix for SourceForge bug id\n\t1572357 \"GetOnePixel definition appears incorrect\".  It is true\n\tthat this function is intended for read-only purposes and that the\n\tPixelPacket value is returned directly.\n\n\t* coders/pdf.c (WritePDFImage): Fix for SourceForge bug id 1510075\n\t\"Failed to write PDF with JPEG compression\".\n\n\t* magick/command.c (MogrifyImageCommand): Properly bubble up\n\terrors and terminate further mogrify processing immediately. This\n\tin response to SourceForge bug id 1391421 \"problem doing resize on\n\t273x1 JPEG\".\n\n\t* magick/magick.c (InitializeMagickClientPathAndName): Fix for\n\tSourceForge bug id 1315109 \"segfault in InitializeMagick(NULL)\".\n\n\t* wand/magick_wand.c (MagickGetQuantumDepth): Fix for SourceForge\n\tbug id 1353744 \"MagickGetQuantumDepth doesn't work\".\n\n\t* PerlMagick/t/read.t: Added a test for WPG v1.\n\n2007-04-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c: Read Matlab files in both big and little endian\n\tformat.\n\n2007-03-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteDPXImage): Set DPX reference high quantity to\n\t2.047 rather than 2.048 since zero is assumed to occupy one count\n\tand 2.047 seems to be the convention even though the DPX\n\tspecification says the default is 2.048.  Technicolor uses 2.047.\n\n\t* m4/acx_pthread.m4: Update version of ACX_PTHREAD macro used.\n\n2007-03-28  Fojtik Jaroslav  <fojtik@humusoft.cz>\n\n\t* coders/wpg.c: Support CTM translation in WPG reader.\n\n2007-03-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Store 10-bit Luma samples in the filled 32-bit\n\tstorage word starting with the datum in the least significant\n\tposition.\n\n2007-02-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Updated autoconf to version 2.61.\n\n2007-02-10  Daniel Kobras  <kobras@debian.org>\n\n\t* coders/palm.c: (ReadPALMImage) Do not implicitly call\n\tReadBlobByte() twice in Min() macro. Patch thanks to Vladimir\n\tNadvornik. This was a regression introduced in patch for\n\tCVE-2006-5456. (CVE-2007-0770)\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2008",
    "content": "2008-12-28  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c: Ability to read extension blocks.\n\n\t* coders/fits.c: Fixed MaxTextExtent limitation of blocks.\n\n2008-12-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/OpenMP.rst: Add results for Window Vista 64-bit / AMD Phenom\n\tX4 9550.\n\n\t* VisualMagick/installer/inc/body.isx: Revert yesterday's change\n\tregarding the placement of config files.  Place the config files\n\tin a `config` subdirectory just as before.\n\n2008-12-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/inc/body.isx: They say that when in Rome\n\tyou should do as the Roman's do.  Based on this philosophy, all of\n\tthe coder and filter DLLs are now installed to the same directory\n\tas the executables and DLLs which depend on them.  This eases\n\toperation under Windows Vista.\n\n2008-12-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c: First pass at supporting large file access under\n\tWindows.\n\n2008-12-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c (InitializeMagickResources): Improve resource\n\testimation for Microsoft Windows systems with large memory.\n\n\t* magick/segment.c: Added some code to dump histograms with\n\t`-verbose -verbose`.\n\n\t* coders/tiff.c: Support reading/writing 16 and 24 bit float TIFF\n\tfiles.\n\n\t* magick/constitute.c (ExportViewPixelArea): Support exporting 16\n\tand 24 bit short floats.  Relies on code developed for\n\tGraphicsMagick by Richard Nolde.\n\t(ImportViewPixelArea): Support importing 16 and 24 bit short\n\tfloats.  Relies on code developed for GraphicsMagick by Richard\n\tNolde.\n\n2008-12-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/operator.h (enum QuantumOperator): Added LogQuantumOp,\n\tMaxQuantumOp, MinQuantumOp, and PowQuantumOp enumerations as well\n\tas \"Log\", \"Max\", \"Min\", and \"Pow\" options to -operator.\n\n2008-12-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): The -write option was not\n\timplemented in a useful fashion and the +write option never worked\n\tat all.  Re-implement -write and eliminate +write from the\n\tdocumentation since +write is not needed.\n\n2008-12-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage, WriteTIFFImage) Support reading\n\tand writing 64-bit integer TIFF.\n\n\t* magick/constitute.c (ImportViewPixelArea): Add support for\n\timporting 64-bit integer values.\n\t(ImportViewPixelArea): Add support for exporting 64-bit integer\n\tvalues.\n\n2008-12-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Fix bug with reading one bit per\n\tsample RGB images.\n\n2008-12-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (OpenCache): Fix a code ordering problem\n\twhich results in `identify` throwing an assertion for PseudoClass\n\timage files.  This bug was added in the 1.3.2 release.\n\n\t* coders/tiff.c (ReadTIFFImage): Fix bug with `ping` mode.\n\n2008-12-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c: Proper signed to unsigned conversion for 64 bit LSB images.\n\n2008-12-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/Makefile.am: When X11 is disabled, don't compile the\n\tX11-specific source modules.  Don't ever install any X11-related\n\theader files.\n\n2008-12-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/segment.c (SegmentImage): Use `double` rather than 64-bit\n\tinteger to accumulate totalized values.  Make the cluster summary\n\treport more concise.\n\n2008-12-06  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c: Fix for 64 bit images.\n\n2008-12-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/segment.c (SegmentImage): Cluster threshold is expressed\n\tas a percentage of total cluster pixels.  Optimize for larger\n\timages.\n\n2008-12-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/segment.c (SegmentImage): Accelerate using OpenMP.\n\n2008-11-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (ExpandFilenames): Remove some arbitrary\n\targument length limits.  Pass -convolve argument without any\n\tadditional checking.  Verify that strings are not truncated during\n\tcopy.\n\t(ListFiles): Be more memory efficient.\n\n\t* magick/fx.c (ConvolveImage): Fix formatting problem when logging\n\tthe convolution kernel used.\n\n\t* magick/utility.c (TranslateTextEx): Support formatting huge\n\tcomment text.\n\n2008-11-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/fx.c (ConvolveImage): Don`t process opacity channel\n\tunless image has one.\n\n\t* magick/effect.c (MotionBlurImage): Use\n\tAcquireOnePixelByReference() rather than AcquireImagePixels() to\n\tretrieve one pixel.  This is much more efficient.\n\t(AdaptiveThresholdImage): Don`t process opacity channel unless\n\timage has one.\n\t(BlurImage): Don`t process opacity channel unless image has one.\n\n2008-11-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/profile.c (ProfileImage): +profile now supports a simple\n\texclusion syntax.  For example, to strip all of the profiles\n\texcept for the ICM profile use +profile '!icm,*'.  The new syntax\n\talso allows multiple profile names to be listed at once.  The\n\tprimary requirement is that all excluded profiles must be listed\n\tprior to those to be stripped.\n\n2008-11-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/transform.c (RollImage): Remove image storage class\n\talteration.\n\t(CompositeImageRegion): Ensure that the canvas image storage class\n\tis correct.\n\n2008-11-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* config/delegates.mgk.in: Since we removed support for `spawn` a\n\tlong time ago, and no longer execute using the Unix shell by\n\tdefault, we need to add an ampersand to the end of the two entries\n\tpreviously using `spawn` so that the display program does not hang\n\twhen it invokes the external program.\n\n\t* utilities/Makefile.am (UTILITIES_TESTS): Add preview-based\n\ttests.\n\n\t* coders/preview.c (WritePreviewImage): Solarize requires a\n\tthreshold argument.\n\n\t* coders/vid.c (WriteVIDImage): Eliminate memory leak.\n\n\t* magick/montage.c (MontageImages): Fix continued use of freed\n\tmemory.\n\n2008-11-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/omp_data_view.c (AccessThreadViewDataById): New function\n\tto allow retrieving data via the index it was registered with.\n\n\t* magick/enhance.c (BuildChannelHistograms): EnhanceImage() and\n\tNormalizeImage() now share one common function for generating the\n\thistogram.\n\n\t* magick/enhance.c (ModulateImage): Improve performance a bit.\n\t(ContrastImage): Improve performance a bit.\n\t(GammaImage): Improve performance a bit.\n\n2008-11-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/authors.rst: List Mark Mitchell as an author.\n\n\t* utilities/tests/msl_composite.sh: Fix `rm -f` without a valid\n\targument which annoyed NetBSD.\n\n\t* coders/fits.c: Impose a limit on the length of the row PDU.\n\tMake sure that GraphicsMagick version information does not\n\toverflow the length allowed by a row PDU.\n\n2008-11-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (WriteJPEGImage): Use DCT algorithm default from\n\tthe library rather than the header file.\n\n\t* magick: Adjust OpenMP scheduling options based on observed\n\tbehavior.\n\n2008-11-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c (IntegralRotateImage): Added OpenMP acceleration\n\tfor rotate by 90 and 270 degrees.\n\n\t* configure.ac: New --disable-openmp-slow configure for disabling\n\tuse of OpenMP for algorithms which may run slower on operating\n\tsystems with crummy thread libraries.  This still allows gaining\n\tthe benefits from OpenMP for CPU hogs.  Verified to help with\n\tFreeBSD 7.0 and Apple OS-X Leopard.\n\n\t* magick/semaphore.c: Trimmed out the debug code in order to\n\tobtain a bit more performance.\n\n2008-11-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c: Allow the user to specify the DCT method\n\t(jpeg:dct-method), or if huffman encoding should be enabled\n\t(jpeg:optimize-coding=true).  Default the DCT method to the\n\tlibjpeg default rather than forcing it to JDCT_FLOAT since float\n\tis slower on some systems.\n\n2008-11-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (BlobClose): Leak a little bit less memory when\n\treading a JP2 file.\n\n2008-11-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/wandtest.c: Eliminate memory leak.\n\n\t* wand/drawing_wand.c (DestroyDrawingWand): Eliminate memory\n\tleaks.\n\n\t* coders/xwd.c (WriteXWDImage): Force colormapped images with more\n\tthan 256 colors to DirectClass.\n\n\t* magick/enhance.c (ModulateImage): Improve progress message.\n\n\t* coders/msl.c: Eliminate memory leaks.\n\n\t* GraphicsMagick.spec.in: Apply RPM spec file fixes from Giacomo\n\tTenaglia for Red Hat Linux 4.\n\n2008-11-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/msl.c: Fix bug with attributes becoming appended to\n\tthemselves.  Resolves SF issue 2255754. Reflowed code.\n\n2008-11-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: GraphicsMagick 1.3 released.\n\tNext release on head will be 1.4.\n\n\t* www/OpenMP.rst: Updated with latest measurement data.\n\n\t* www/benchmarks.rst: Updated with latest benchmark data.\n\n\t* coders/url.c (RegisterURLImage): Register HTTP and FTP URL\n\tsupport in the \"unstable\" category since these are capable of\n\taccessing the network and therefore represent a potential security\n\tissue.  Register the FILE URL support in the \"stable\" category\n\tsince it is capable of incorporating local disk files, which may\n\tstill represent a security security issue for server applications.\n\tNote that disabling these functions might cause some existing MSL,\n\tMVG and SVG scripts to stop working if they use external URLs.\n\n2008-11-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (ReadPNMImage): Sequential multi-thread the PNM raw\n\tformat readers. Can improve read performance quite substantially\n\tfor large PBM and PGM files, and less so for PPM.  There is most\n\tbenefit for systems with more I/O than one CPU core will support.\n\tSystems with slow I/O and a relatively fast CPU may see somewhat\n\tdiminished read performance with more CPU consumption.  As such,\n\tthis is effectively a verification that multi-threading the reader\n\tis possible, and may be of benefit to power-users.\n\n\t* magick/omp_data_view.c (AllocateThreadViewDataArray): New\n\tfunction to allocate a thread view data array.  Updated modules\n\tusing similar code to use this function in order eliminate\n\tuseless redundancy.\n\n2008-11-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c: Incorporate OMP thread views into the\n\tpixel cache so usage is less invasive.  Update OMP-enhanced source\n\tmodules to suit.\n\t(GetImagePixelsEx): New function similar to GetImagePixels()\n\texcept that it reports exceptions to a user-provided structure.\n\t(SetImagePixelsEx): New function similar to SetImagePixels()\n\texcept that it reports exceptions to a user-provided structure.\n\t(SyncImagePixelsEx): New function similar to SyncImagePixels()\n\texcept that it reports exceptions to a user-provided structure.\n\t(AccessImmutableIndexes): New function to access read-only\n\tcolormap indexes.\n\t(AccessMutableIndexes): New function to access writeable colormap\n\tindexes.\n\t(AccessMutablePixels): New function to access writeable pixels.\n\t(AccessDefaultCacheView): New function to access the default cache\n\tview.\n\n2008-11-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (BenchmarkImageCommand): With no other\n\targuments, the benchmark command now defaults to one iteration.\n\n\t* magick/effect.c (SpreadImage): Offsets array size is a prime\n\tnumber to help avoid beating.\n\t(SpreadImage): Ensure that spread loops are always terminal.\n\n\t* magick/utility.c (MagickRandReentrant): Fix bug where rand() was\n\tbeing continually re-seeded if rand_r() was not available.\n\n2008-11-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/tests/msl_composite.sh: Replace SVG image generation\n\twith simpler approach which properly centers the text.  Use our\n\town font so that tests will pass if the user does not have fonts\n\tinstalled.\n\n\t* magick/utility.c (GetMagickDimension): Extend to support parsing\n\toptional x and y offset values and use to fix parsing for\n\t-oil-paint and -unsharp when sscanf() is C'99 compliant.\n\n2008-11-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.h (AcquireOneCacheViewPixel): Pass pixel to\n\tupdate by reference.\n\t(AcquireOnePixelByReference): New private inline method which\n\tpasses pixel to update by reference.\n\n\t* magick/omp_thread_view.h (AcquireOneThreadViewPixel): Pass pixel\n\tto update by reference.\n\n\t* magick/alpha_composite.h (BlendCompositePixel): Replace\n\tBlendComposite with BlendCompositePixel, which passes the\n\tcomposite pixel by reference.\n\t(AlphaCompositePixel): Replace AlphaComposite with\n\tAlphaCompositePixel, which passes the composite pixel by\n\treference.\n\t(AtopCompositePixel): Replace AtopComposite with\n\tAtopCompositePixel, which passes the composite pixel by reference.\n\n\t* configure.ac: With excessive maintenance releases, the library\n\tage portion of MAGICK_LIB_VERSION was overflowing its allotted\n\tspace.  This resulted in 1.1.X releases reporting the wrong\n\tMagickLibVersion as of 1.1.10.  Fix this by supporting up to 99\n\tvalues for each field.\n\n2008-11-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Fix passing the --with-windows-font-dir option via\n\tDISTCHECK_CONFIG_FLAGS.\n\n\t* utilities/tests/msl_composite.sh: Integrated MSL composition\n\ttest script contributed by Max Hohenegger, Max at hohenegger.eu.\n\n\t* magick/command.c (ConjureImageCommand): Return status was\n\tinverted so one was returned for command success rather than zero.\n\n2008-11-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* png: Updated libpng to 1.2.33 release.\n\n\t* magick/color.c (FuzzyColorMatch): If fuzz is zero then\n\tcompletely use the result of ColorMatch() rather than entering\n\tunnecessary expensive code.\n\n2008-10-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h: Make sure we don't conflict with OpenMP\n\timplementation if it is active but we are not using it.\n\n2008-10-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h (HAVE_OPENMP): Add logic to make sure that\n\tOpenMP is only engaged for OpenMP 2.0 or later.\n\n\t* magick/command.c (VersionCommand): Report OpenMP version.\n\n\t* Makefile.am: The Magick++ build was supposed to be optional. Now\n\tit is.\n\n\t* Makefile.am: Eliminated .tar.bz2 and .zip packages from the\n\tdistribution.  The .tar.bz2 package was hardly smaller than the\n\t.tar.gz package so it wasted 5.9MB with little benefit.  The\n\tcompression ratio on the .zip archives is absolutely terrible so\n\teliminating zip eliminates huge 9.6MB and 25MB files from the\n\tdistribution equation.  Windows users can easily learn how to use\n\tthe vastly more efficient 7-Zip format.\n\n2008-10-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Rationalize OpenMP tests to make sure that OpenMP\n\tcan not be enabled without thread support.\n\n2008-10-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c (CompositeImageRegion): Add some minimal\n\tregion limit checking.  Not completed yet.\n\n\t* magick/transform.c (RollImage): Accellerate using OpenMP.\n\n2008-10-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h (omp_get_thread_num): Remove spurious trailing\n\t`;`.\n\n\t* magick/render.c (DrawPrimitive): Make method private since\n\tnothing else is using it.\n\n\t* magick/omp_thread_view.h (AccessThreadView): Inline function for\n\ta bit more performance.\n\t(AcquireOneThreadViewPixel) Inline function for a bit more\n\tperformance.\n\n2008-10-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* pragma omp parallel for: Use consistent static scheduling\n\tthroughout and ensure that 64 threads can be usefully engaged on a\n\t1024 row image.\n\n\t* magick/pixel_iterator.c (SetRegionThreads): Implement logic so\n\tthat pixel iterators execute single-threaded when invoked on tiny\n\tregions.\n\n\t* magick/pixel_cache.c (SetNexus): Make staging buffer memset()\n\tconditional in order to dramatically diminish impact to small\n\taccesses.  This memset() only exists to make valgrind happy.\n\n2008-10-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Fix progress monitor for the case\n\tof reading planar stripped images.\n\n2008-10-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (DespeckleImage): Accelerate using OpenMP.\n\n\t* magick/paint.c (OpaqueImage): Update to use pixel iterators.\n\t(TransparentImage): Update to use pixel iterators.\n\n\t* magick/decorate.c (FrameImage): Accelerate using OpenMP.\n\t(RaiseImage): Accelerate using OpenMP.\n\n2008-10-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c (CompositeImageRegion): Start of new function\n\tto act as a lighter-weight yet more flexible image composition\n\tinterface.\n\n\t* magick/transform.c (ChopImage): Accelerate using OpenMP.\n\t(CropImage): Accelerate using OpenMP.\n\t(FlipImage): Accelerate using OpenMP.\n\t(FlopImage): Accelerate using OpenMP.\n\n\t* magick/effect.c (ThresholdImage): Accelerate using OpenMP.\n\n2008-10-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (AcquireOneCacheViewPixel): Optimize\n\timplementation.\n\n\t* magick/effect.c (MedianFilterImage): Accelerate using OpenMP.\n\t(ReduceNoiseImage): Accelerate using OpenMP.\n\n2008-10-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/fx.c (WaveImage): Accelerate using OpenMP.\n\t(SwirlImage): Accelerate using OpenMP.\n\t(ImplodeImage): Accelerate using OpenMP.\n\n2008-10-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (GetCacheViewRegion): New function to\n\treturn the region bounded by a pixel cache view.\n\n\t* magick/constitute.c (ExportViewPixelArea): New function to\n\tsupport exporting the pixels from a pixel cache view.\n\t(ImportViewPixelArea): New function to support importing pixels\n\tto a pixel cache view.\n\n\t* magick/pixel_cache.c (ReadStream): Eliminated function.\n\t(WriteStream): Eliminated function.\n\t(ClonePixelCacheMethods): Eliminated function.\n\n\t* magick/image.h: Eliminated StreamHandler call-back type.\n\tEliminated ImageInfo stream member.\n\n\t* magick/pixel_cache.c (GetCacheViewArea): New function to return\n\tthe area of a cache view.\n\t(AccessCacheViewPixels): New function to access already selected\n\tcache view pixels.\n\n2008-10-19  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c: Remove unused exponential data.\n\n2008-10-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/omp_thread_view.c: Move OMP Thread View functions out of\n\tpixel cache module and put them in this new module.\n\n\t* coders/xtrn.c (ReadXTRNImage): XTRNSTREAM mode was never\n\timplemented so remove unfinished stub code.\n\n2008-10-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageDepth): Needed to assign image depth\n\tattribute to user-specified depth rather than only altering the\n\tpixels.\n\t(SetImageOpacity): Reimplement using pixel iterators.\n\t(AverageImages): Accelerate using OpenMP.\n\t(GetImageBoundingBox): Accelerate using OpenMP.\n\n2008-10-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ConstituteTextureImage): Accelerate using\n\tOpenMP.\n\n\t* magick/image.c (TextureImage): Accelerate using OpenMP.\n\n\t* magick/render.c (DrawAffineImage): Accelerate using OpenMP.\n\n2008-10-13  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c Fixed palette problem for >8 bit images.\n\n2008-10-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): Using +page now resets image\n\tpage offsets as documented for convert and mogrify.\n\n2008-10-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (GradientImage): Re-do OpenMP accelleration based\n\ton new pixel cache interface for better performance.\n\n\t* coders/dpx.c (ReadDPXImage): Progress monitor needs to tick when\n\trow count is updated.\n\n\t* coders/fits.c (ReadFITSImage): Update to use\n\tMagickFindRawImageMinMax().\n\t(WriteFITSImage): Expand buffer size to MaxTextExtent.  Include\n\tGraphicsMagick version in FITS header.\n\n\t* coders/mat.c (ReadMATImage): Update to use\n\tMagickFindRawImageMinMax().\n\n\t* magick/constitute.c (MagickFindRawImageMinMax): New internal\n\tfunction to assist with finding the minimum and maximum data of\n\traw image files.\n\n2008-10-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (AcquireThreadViewPixels): Convert thread\n\tset view convenience methods into library methods because the\n\tinline methods were causing the Sun Studio compiler to produce\n\tthread unsafe code.  Due to likely beneficial inlining in the\n\tlibrary, this is not expected to cause any performance impact.\n\n2008-10-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/filter.t: Add a test for UnsharpMask.\n\n\t* magick/effect.c (UnsharpMaskImage): Use Blur rather than\n\tGaussianBlur to create blur image since it is faster.\n\n\t* magick/pixel_cache.c (AllocateThreadViewDataSet): Add a\n\tdestructor function in case data should not be destroyed, or needs\n\tsomething other than MagickFree().\n\t(AllocateThreadViewDataSet): Use user-provided destructor to free\n\tuser data.\n\n\t* scripts/format_c_api_doc.py: Improvements from Mark Mitchell to\n\tperform keyword/target substitions and wrap function prototypes.\n\n\t* coders/dpx.c (ReadDPXImage): Accellerate reader using OpenMP.\n\n2008-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/api/types.rst: Convert types.html to reStructured text\n\tformat.\n\n2008-10-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/monitor.c (MagickMonitorFormatted): New method to support\n\tissuing a formatted progress monitor message.  Use it throughout\n\tso that file name is included in progress indication.\n\n2008-10-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Bootstrap with autoconf 2.63.  Require autoconf\n\t2.62 to bootstrap.\n\n2008-10-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www: Adopted improved web page design by Mark Mitchell.\n\n2008-10-04  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c coders/mat.c Used a same piece of code to calculate\n\tmin and max data value.\n\n2008-09-30  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c Fixed 16 bit fits writer that wrote wrongly\n\tshaped unsigned ints.\n\n2008-09-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/conjure.imdoc: Applied patches from Max at hohenegger.eu to\n\tmention previously undocumented elements and to provide a\n\tcomposition example.\n\n2008-09-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c (IntegralRotateImage): Accelerate rotation by 0\n\tand 180 degrees using OpenMP.\n\t(XShearImage): Accellerate using OpenMP (accellerates -rotate and\n\t-shear).\n\t(YShearImage): Accellerate using OpenMP (accellerates -rotate and\n\t-shear).\n\n2008-09-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (MotionBlurImage): Enable OpenMP now that pixel\n\tcache is re-entrant.\n\n\t* magick/pixel_iterator.c: Updated to use thread view convenience\n\tinline methods as proof of principle.\n\n\t* magick/pixel_cache.h: Added convenience inline methods to make\n\tuse of thread views a bit more pleasant.\n\n2008-09-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (ShadeImage): Fix valgrind gripe.\n\t(MedianFilterImage): Fix valgrind gripe.\n\n2008-09-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c: Pixel cache is believed to be thread safe\n\tnow.\n\n\t* magick/deprecate.c (AcquireCacheView): Deprecate this function.\n\t(GetCacheView): Deprecate this function.\n\t(SetCacheView): Deprecate this function.\n\t(SyncCacheView): Deprecate this function.\n\n\t* magick/pixel_cache.c (AcquireCacheViewPixels): New function to\n\treplace AcquireCacheView().\n\t(GetCacheViewPixels): New function to replace GetCacheView().\n\t(SetCacheViewPixels): New function to replace SetCacheView().\n\t(SyncCacheViewPixels): New function to replace SyncCacheView().\n\n\t* coders/msl.c: Applied patches from Max at hohenegger.eu which\n\tfix a MSL parsing error related to gamma, and erroneous text\n\tcomments which claim that elements can't have attributes.\n\n2008-09-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resize.c (ResizeImage): Move OpenMP instrumentation to\n\touter loop so that eventually there can be more performance.\n\n2008-09-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resize.c (MinifyImage): Accelerate using OpenMP.\n\n\t* magick/command.c (ConvertImageCommand, MogrifyImageCommand):\n\tAccept -gaussian-blur as a synonym for -gaussian.\n\t(ConvertImageCommand, MogrifyImageCommand): Provide access to\n\tMinifyImage() via -minify.\n\t(ConvertImageCommand, MogrifyImageCommand): Provide access to\n\tMagnifyimage() via -magnify.\n\n2008-09-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/channel.c (ImportImageChannelsMasked): New function to\n\timport all the channels from an image except for the channels\n\tspecified.\n\n\t* magick/effect.c (AddNoiseImageChannel): New function to add\n\tnoise to an image channel.\n\t(BlurImageChannel): New function to blur one image channel.\n\t(GaussianBlurImageChannel): New function to gaussian blur an image\n\tchannel.\n\t(UnsharpMaskImageChannel): New function to unsharpmask an image\n\tchannel.\n\t(SharpenImageChannel): New function to sharpen an image channel.\n\n2008-09-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (MotionBlurImage): Use GetOptimalKernelWidth1D()\n\tto estimate a reasonable convolution kernel size.  Prepare code\n\tfor OpenMP but don't enable OpenMP until it runs faster.\n\t(AddNoiseImageChannel): New function to apply noise to a specified\n\timage channel.\n\n2008-09-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (ConvertImageCommand): Provide `convert` access\n\tto MotionBlurImage() via -motion-blur option.\n\t(MogrifyImageCommand): Provide `mogrify` access to\n\tMotionBlurImage() via -motion-blur option.\n\n2008-09-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (SpreadImage): Accelerate using OpenMP.\n\n\t* coders/msl.c: Applied MSL patch from graphicsmagick-bugs list to\n\tcorrect handling of geometry x,y values by setting gravity\n\tattribute to ForgetGravity.\n\n2008-09-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (ShadeImage): Accelerate using OpenMP.\n\n2008-09-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (RandomChannelThresholdImage): Accelerate using\n\tOpenMP.  Support individual thresholding of the color channels.\n\t(BlurImage): Blur was failing for PseudoClass images.  This bug\n\twas added on 2008-09-08.\n\n\t* magick/pixel_cache.c (AcquireOneCacheViewPixel): New function to\n\treturn just one pixel from a cache view.\n\n2008-09-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (EnhanceImage): Accelerate using OpenMP.\n\t(BlurImageScanlines): Added optimizations.\n\n\t* magick/shear.c (IntegralRotateImage): Add missing progress\n\tindication for 90 and 270 degrees rotation.\n\n\t* www/perl.html: Fix formatting of examples.  Should address\n\tSourceForge issue [ 2100339 ] \"Wrong format in example script on\n\tweb page\".\n\n2008-09-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (BlurImage): Accelerate using OpenMP.\n\n2008-09-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/fx.c (ColorizeImage): Re-implement using pixel iterators.\n\t(MorphImages): Re-implement using pixel iterators.\n\t(OilPaintImage): Accelerate using OpenMP.\n\t(SolarizeImage): Re-implement using pixel iterators.\n\n2008-09-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/fx.c (ConvolveImage): Accelerate using OpenMP.\n\n\t* magick/effect.c (AdaptiveThresholdImage): Accelerate using OpenMP.\n\n2008-09-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c: Exhuastive study of the pixel cache code\n\treveals that it is inscrutable and not implemented in a fashion\n\twhich enables useful multi-threading.  Therefore, the cache view\n\tinterfaces are now made OpenMP-safe via a global critical section.\n\n2008-09-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_iterator.c: Reduce use of critical sections around\n\tpixel cache to the bare minimum based on analysis and testing.\n\tUnfortunately, testing shows that the pixel cache views are still\n\tnot 100% thread safe so the extra locking is still required.\n\n\t* magick/pixel_cache.c (ModifyCache): Make implementation thread\n\tsafe.  This required removing a thread-unsafe optimization from\n\tBill Radcliffe.\n\n\t* magick/command.c (BenchmarkImageCommand): Restore original\n\tclient name for each loop so that it is not extended further for\n\teach iteration.\n\n\t* magick/semaphore.c (UnlockSemaphoreInfo): Decrement lock depth\n\tunder protection of the lock.\n\n2008-09-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (AddNoiseImagePixels): Update to pass per-thread\n\t`seed` value for more performance.\n\n2008-08-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gem.c (GenerateDifferentialNoise): Use\n\tMagickRandReentrant(). Added a `seed` argument so that we can pass\n\ta per-thread `seed` value.\n\n\t* magick/utility.c (MagickRandNewSeed): New function to produce a\n\tsemi-random `seed` value.\n\t(MagickRandReentrant): New function which works like rand() but\n\tattempts to be re-entrant if possible by allowing a seed value to\n\tbe passed.\n\n2008-08-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/channel.c (SetImageChannelDepth): Re-implement using\n\tQuantumOperatorImage().\n\n\t* magick/image.c (SetImageDepth): Re-implement using\n\tQuantumOperatorImage().\n\n\t* magick/operator.h (QuantumOperator): Added DepthQuantumOp for\n\tsetting the channel depth.\n\n\t* magick/command.c (BenchmarkImageCommand): Add CPU-based\n\titeration rate metric to benchmark output.\n\n\t* magick/resource.c (ListMagickResourceInfo): Include quantum\n\tdepth, bits per pixel, and process address size in resource\n\toutput so that output is more complete.\n\n2008-08-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SyncImage): Re-implement using pixel iterators.\n\t(SortColormapByIntensity): Re-implement using pixel iterators.\n\t(ClipPathImage): Re-implement using pixel iterators.\n\t(CycleColormapImage): Re-implement using pixel iterators.\n\t(GetImageDepth): Re-implement using pixel iterators.\n\t(GradientImage): Parallize inner loop for speedup with larger\n\timages.\n\t(ReplaceImageColormap): Re-implement using pixel iterators.\n\t(SetImage): Re-implement using pixel iterators.\n\n2008-08-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/operator.c (QuantumGamma): Removed unnecessary OpenMP\n\trequest on inner loops.\n\n\t* magick/enhance.c (EqualizeImage,NormalizeImage): Execute\n\thistogram generation pixel iterator with just one thread to\n\tdecrease contention for the histogram array.\n\n\t* magick/pixel_iterator.c (InitializePixelIteratorOptions): New\n\tfunction to initialize PixelIteratorOptions with defaults.\n\n\t* magick/pixel_iterator.h (PixelIteratorOptions): New structure to\n\tsupport passing pixel iterator execution options.\n\n2008-08-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated for changes to date in 1.3 development code.\n\n\t* magick/pixel_iterator.c: Execute pixel iterators in parallel via\n\tOpenMP.\n\n\t* magick/pixel_cache.c (OpenCacheView): Ensure that pixel cache is\n\topen.\n\t(GetCacheInfo): Allocate semaphore immediately.\n\n2008-08-16  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c Writer now creates valid images according to\n\thttp://fits.gsfc.nasa.gov/fits_verify.html\n\tFixed problems: 1) zeros in HDU, 2) wrong padding. 3) possible\n\tstrlen() overflow.\n\n2008-08-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/{compare.c, channel.c, enhance.c, image.c, operator.c}:\n\tUpdate existing pixel iterator callback functions so that they are\n\tOpenMP safe.\n\n2008-08-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/compare.c (InitializeDifferenceImageOptions): Renamed\n\tfrom DifferenceImageOptionsDefaults().\n\t(InitializeDifferenceStatistics): New function to initialize\n\tDifferenceStatistics.\n\t(ComputeAbsoluteError, ComputePeakAbsoluteError,\n\tComputeSquaredError): Use local totalizing structure on stack and\n\tupdate cumulative statistics when the loop terminates.\n\n2008-08-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www: Convert HTML pages to use a vibrant green theme rather than\n\tcolors stolen from old GIMP web site.\n\n2008-08-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/{compare.imdoc, options.imdoc}: Added documentation for\n\t`compare`.\n\n\t* magick/compare.h (enum HighlightStyle): Added\n\tAssignHighlightStyle for simple color assignment.  `Annotate` is\n\tnow `Tint`.\n\n\t* magick/command.c (CompareImageCommand): Useful options are now\n\t-metric, -highlight-color, and -hightlight-style.\n\n2008-08-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/compare.c (DifferenceImagePixels): Fixed `Annotate`\n\tdifference annotation algorithm.  Added `Threshold` and `Xor`\n\tdifference annotation algorithms.\n\t(GetImageChannelDifference): New function for computing\n\tstatistical image error using various metrics.  Inspired by\n\t`imgcmp` from Jasper.\n\t(GetImageChannelDistortion): New function for obtaining\n\tstatistical image error using various metrics for a specified\n\timage channel.  Signature is compatible with similar ImageMagick\n\tfunction.\n\t(GetImageDistortion): New function for obtaining statistical image\n\terror using various metrics for all the active channels in the\n\timage.  Signature is compatible with similar ImageMagick function.\n\n\t* magick/command.c (CompareImageCommand): Added a `compare`\n\tsubcommand which compares two images using various metrics, and/or\n\tgenerates a difference image using various difference annotation\n\talgorithms.  Documentation not yet updated.\n\n2008-08-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_iterator.c: Split user context in all pixel\n\titerator APIs into a mutable data part, and an immutable data\n\tpart.  This required modification to all modules using the pixel\n\titerator methods.\n\n2008-07-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickCompareImageChannels): Use\n\tDifferenceImage().\n\t(MagickCompareImages): Implement by calling\n\tMagickCompareImageChannels().\n\n\t* magick/compare.c (DifferenceImage): The ImageMagick-compatible\n\tCompareImages() function signature was clearly an example of bad\n\tdesign so rename CompareImages() to DifferenceImage() with a\n\tsignature which does not unnecessarily mix functionality and\n\tallows for ease of future expansion.\n\n2008-07-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/Makefile.am (WAND_TESTS): Added Wand drawtest and wandtest\n\tto automated test suite.\n\n2008-07-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (ThresholdImage): Don't read uninitialized pixel\n\tindexes (valgrind gripe).\n\n\t* coders/tiff.c (CompressionSupported): Use\n\tTIFFIsCODECConfigured() to test if a codec is supported.\n\n\t* tests/{rwblob.c, rwfile.c}: use DestroyImageList() rather than\n\tDestroyImage().\n\n\t* coders/psd.c (RegisterPSDImage): Fix module registration memory leak.\n\n\t* coders/jpeg.c (RegisterJPEGImage): Fix module registration memory leak.\n\n2008-07-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (DestroyBlob, DestroyBlobInfo): Implementation is\n\ta bit more robust.\n\n2008-07-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (ReadJPEGImage): Remove over-write of\n\timage->client_data.  Resolves SourceForge issue [ 2018974 ]\n\tclient_data is not passed to streamhandler.\n\n\t* coders/png.c (WriteOnePNGImage): Fix crash when writing PNG\n\timages with transparency and either type Optimize is requested, or\n\tthe image is colormapped.\n\n2008-07-12  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Fixed problem: \"In this case, the referenced \n\timages had previously been deallocated but are still being used.\n\tSince they are overwritten, their signatures are invalid.\n\n2008-07-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (ReadDCMImage): Report actual image depth.\n\n\t* magick/resource.c (InitializeMagickResources): Set default\n\tmaximum memory limit to physical memory rather than 2X physical\n\tmemory.  This decision is made since the system paging device is\n\toften slower than files in the filesystem, and so memory mapping\n\tis likely faster.\n\n\t* magick/blob.c (OpenBlob): The MAGICK_IO_FSYNC environment\n\tvariable causes output files to be synchronized to disk when set\n\tto TRUE.\n\n2008-07-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/GraphicsMagick.html: Improved formatting of documentation.\n\n2008-07-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageInfo): Make use of the new\n\t`extension_treatment` field.\n\n\t* coders/dcraw.c (ReadDCRAWImage): Added a coder module to proxy\n\tfrom various common RAW camera format extensions to the `dcraw`\n\tdelegate.\n\n\t* magick/magick.h (MagickInfo): Add an extension_treatment member\n\tto indicate how file extensions should be treated for this coder.\n\n2008-06-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/{animate.c,quantize.c}: Replace !ColorMatch() with\n\tNotColorMatch().\n\n\t* utilities/Makefile.am (install-exec-local-utilities): Add back\n\tin support for --enable-magick-compat which was accidentally\n\tdropped in the new makefiles for GraphicsMagick 1.2.  Resolves\n\tSourceForge bug 2005883.\n\n\t* magick/color.h (NotColorMatch): New macro for testing that two\n\tcolors are not the same.  Opposite from existing ColorMatch().\n\n\t* magick/command.c: Replaced the many duplicate enum conversion\n\tcode fragments with calls to functions in enum_strings.c.\n\n\t* magick/enum_strings.c: Absorbed the many \"ToString\" and\n\t\"StringTo\" functions from other source modules.\n\n\t* magick/effect.c (ThresholdImage): Optimize for larger images.\n\n\t* magick/constitute.c (ConstituteTextureImage): New function to\n\treturn a texture canvas image based on a tile image.  Similar to\n\texisting TextureImage() except better optimized for creating new\n\timages and inherits tile image properties.\n\n\t* magick/color.h (IsBlackPixel): New macro to test if a pixel is\n\tblack.\n\t(IsWhitePixel): New macro to test if a pixel is white.\n\n\t* coders/tile.c (ReadTILEImage): Use new ConstituteTextureImage()\n\tfunction rather than TextureImage().  Also allow the user to\n\trequest a particular image type.\n\n\t* coders/pdf.c (Huffman2DEncodeImage): Explicitly request a strip\n\tper page when writing Group4 TIFF.\n\n\t* coders/tiff.c (WriteTIFFImage): Place a generous default limit\n\ton rows-per-strip when using Group3 or Group4 FAX compression.\n\tThe default limit is added since it is observed that the Group4\n\tcompressor fails with extremely huge strips.  Added a define\n\t\"tiff:rows-per-strip\" to allow the user to explicitly set the rows\n\tper strip.  Added a define \"tiff:strip-per-page=true\" to allow the\n\tuser to force one strip per page no matter what.  Added progress\n\tmonitor support to tile writer.\n\n2008-06-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/configure/configure.cpp: The MAT coder now depends\n\ton zlib so add explicit dependencies for it.\n\n\t* wand/magick_wand.c (MagickNegateImage): Implemented previously\n\tunimplemented Wand method.\n\t(MagickGammaImageChannel): Implemented previously unimplemented\n\tWand method.\n\n\t* magick/operator.h (enum QuantumOperator): Added GammaQuantumOp\n\tand \"gamma\" operator.  Renamed InvertQuantumOp to NegateQuantumOp.\n\n2008-06-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/operator.h (enum QuantumOperator): Added InvertQuantumOp\n\tand \"invert\" operator.\n\n\t* coders/xcf.c (GIMPBlendModeToCompositeOperator): For XCF format,\n\twe do support GIMP_DIVIDE_MODE composition now. Disable progress\n\tmonitor during tile composition.\n\n\t* magick/composite.c (DivideCompositePixels): New Divide composite\n\toperator contributed by Michael Burian <michael.burian@sbg.at>.\n\n\t* magick/image.h (enum CompositeOperator): Added DivideCompositeOp.\n\n\t* magick/enum_strings.c (CompositeOperatorToString): New function\n\tto convert a composite operator to a string.\n\t(StringToCompositeOperator): New function to convert a string to a\n\tcomposite operator.\n\n2008-06-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickThresholdImageChannel): Implement\n\tpreviously unimplemented Wand function.\n\t(MagickGetImageExtrema): Implement previously unimplemented Wand\n\tfunction.\n\t(MagickGetImageChannelExtrema): Implement previously unimplemented\n\tWand function.\n\t(MagickQueryFonts): Implement previously unimplemented Wand\n\tfunction.\n\n2008-06-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* scripts/format_c_api_docs: Scan compare.c for API definitions.\n\n\t* wand/magick_wand.c (MagickCompareImageChannels): Enable use of\n\tthis function.\n\t(MagickCompareImages): Enable use of this function.\n\n\t* magick/compare.c: New source file.\n\t(IsImagesEqual): Move here from magick/image.c.\n\t(CompareImageChannels): Initial implementation of function roughly\n\tsimilar to the one in ImageMagick.\n\t(CompareImages): Initial implementation of function roughly\n\tsimilar to the one in ImageMagick.\n\n\t* magick/pixel_iterator.c (PixelIterateTripleModify): New pixel\n\titerator function to access two images as read-only and one as\n\tread-write for updating existing pixels.\n\t(PixelIterateTripleNew): New pixel iterator function to access two\n\timages as read-only and one as read-write for creating new pixels.\n\n2008-06-22  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* mat.c Added CloseBlob().\n\n2008-06-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickSetImageFormat): Add method to support\n\tsetting the image format.\n\n2008-06-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/profile.c (ProfileImage): Convert to use pixel iterators.\n\n2008-06-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/channel.c (ImportImageChannel): Convert to use pixel\n\titerators.\n\t(SetImageChannelDepth): Convert to use pixel\n\titerators.\n\n\t* Magick++/lib/Image.cpp (quantize): Error measurement support was\n\tbeing performed incorrectly.  SyncImage() is not needed here.\n\n2008-06-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/channel.c (GetImageChannelDepth): Convert to use pixel\n\titerators.\n\n2008-06-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mat.c (RegisterMATImage): Set blob support to false for\n\tMAT coder until bug related to blobs is fixed.\n\n2008-06-16  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* mat.c Ability to read a new compressed MATLAB image format.\n\n2008-06-15  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* mat.c, wpg.c: For empty images a message ImageFileDoesNotContainAnyImageData\n\tis returned.\n\n2008-06-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/channel.c (ChannelImage): Convert to use pixel iterators.\n\t(ExportImageChannel): Convert to use pixel iterators.\n\n\t* coders/dpx.c (WriteDPXImage): As an experimental feature, when\n\tthe environment variable MAGICK_RESERVE_STORAGE is set to \"TRUE\",\n\tthen the DPX format writer will request the required storage from\n\tthe filesystem in advance (if supported by the OS) or the full\n\tamount of memory required (when writing to an in-memory BLOB).\n\n2008-06-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magic.c (InitializeMagicInfo): New function to initialize\n\tfile format detection.\n\t(GetMagickFileFormat): New internal implementation function to\n\tdetect file format based on file header.\n\t(GetMagicInfo): This internal implementation function is eliminated.\n\t(MagicInfo): MagickInfo structure is now private to the\n\timplementation.\n\n2008-06-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (ListMagickInfo): Replace \"blob support\"\n\tindication with the coder stability classification.\n\t(RegisterMagickInfo): Pay attention to coder classification.\n\n\t* magick/magick.h (MagickInfo): Added a coder stability\n\tclassification field as well as the MAGICK_CODER_STABILITY\n\tenvironment variable to choose which coders are enabled.\n\n2008-06-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (GetImageCharacteristics): Don't access image\n\tpixels if they are not defined yet.\n\n\t* coders/{avi.c,avs.c,dcm.c,ept.c,fits.c,mtv.c,palm.c,rla.c,tga.c}:\n\tReaders are now much more robust when faced with reading random files.\n\n2008-06-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageInfo): Exclude all virtual delegates and\n\tcoders for pseudo-formats.\n\n2008-06-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (ReadDCMImage): Make DCM reader quit immediately on\n\tEOF condition.\n\n\t* coders/avi.c (ReadAVIImage): Make AVI reader more robust at\n\trejecting bad files.\n\n\t* configure.ac: Eliminated --enable-delegate-build option that I\n\thave not used or tested for almost ten years so it probably did\n\tnot work anyway.  Use --with-ttf=/prefix to specify the the\n\tinstallation prefix for freetype.  Use\n\t--with-ttf=/prefix/bin/freetype-config to specify the whole path\n\tto freetype-config.\n\n2008-06-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): Add support for\n\t-black-threshold and -white-threshold.\n\n\t* magick/image.h (enum ChannelType): Added GrayChannel\n\tenumeration.\n\n\t* magick/operator.c (QuantumOperatorImageMultivalue): New\n\timplementation function to make creating legacy functions like\n\tblack/white thresholding easier.\n\n\t* wand/magick_wand.c (MagickBlackThresholdImage): Implemented.\n\t(MagickWhiteThresholdImage): Implemented.\n\n\t* magick/effect.c (BlackThresholdImage): Implemented a\n\tBlackThresholdImage() which is similar to (but not identical to)\n\tthe one in ImageMagick.\n\t(WhiteThresholdImage): Implemented a WhiteThresholdImage() which\n\tis similar to (but not identical to) the one in ImageMagick.\n\n2008-06-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/operator.c: Added support for additional channel\n\toperators (-operator) for applying noise to one or more channels.\n\tThe additional operators are Noise-Gaussian, Noise-Impulse,\n\tNoise-Laplacian, Noise-Multiplicative, Noise-Poisson, and\n\tNoise-Uniform.  The amount of noise applied is controlled via the\n\tnumeric argument, which can specify the percentage of noise to\n\tapply.\n\n\t* magick/enum_strings.c: New source module to contain the various\n\tEnumToString() and StringToEnum() functions which seem to multiply\n\tlike bunny-rabbits.\n\n\t* magick/gem.c (GenerateNoise): Poisson noise generation was\n\ttaking excessively long and producing wrong results.  Noise\n\tgeneration was only producing the correct amount of noise in the\n\tQ8 build.\t\n\t(GenerateDifferentialNoise): New function to return noise in a\n\tfloating-point differential format.\n\n2008-06-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_iterator.h: Removed x,y coordinate information from\n\tall of the callback definitions since a use for this information\n\thas yet to be found.\n\n\t* magick/composite.c (CompositeImage): Use individual callback\n\tfunctions for the composition operations.\n\n\t* coders/xcf.c (ReadXCFImage): Deal with grayscale images the\n\tGraphicsMagick-way.\n\n2008-06-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c (ReadXCFImage): Validate XCF file data so that\n\tcorrupted files don't crash GraphicsMagick.\n\n2008-05-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Incrementally read user data\n\tpart and check for EOF so that bogus files are rejected quickly.\n\n\t* coders/cineon.c (ReadCINEONImage): Incrementally read user data\n\tpart and check for EOF so that bogus files are rejected quickly.\n\n2008-05-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (ReadPICTImage): Ensure that row_bytes calculation\n\tdoes not overflow.  Verify that RLE decode does not overflow\n\tbuffer.  Validate image frame dimensions.\t\n\n\t* coders/palm.c (ReadPALMImage): Validate PALM bits per pixel and\n\tcolormap indexes.\n\n\t* magick/resource.c (ListMagickResourceInfo): List controlling\n\tenvironment variable in `-list resource` output as a configuration\n\tusage reminder.\n\n\t* coders/pdf.c (ReadPDFImage): Properly deal with reading rotated\n\tPDFs.\n\n2008-05-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* FAQ.txt: Added a FAQ for how to extract and combine CMYK image\n\tchannels to individual files.\n\n2008-05-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/fx.c (ConvolveImage): Eliminate unnecessary \"range check\"\n\tfeature since range checking is not where the CPU time is going.\n\n\t* magick/effect.c (UnsharpMaskImage): Re-write implementation to\n\tuse pixel iterators.\n\n\t* magick/pixel_iterator.c: Decided that the old per-pixel\n\titerations were not useful enough to keep since the region-based\n\tones are working fine.  Moved pixel_row_iterator.c to\n\tpixel_iterator.c and renamed functions to remove the `Row`\n\tdesignation.\n\n\t* magick/composite.c (CompositeImage): Automatically adjust\n\tcolorspace of composite image so that it is compatible with canvas\n\timage.\n\n\t* magick/alpha_composite.h (AlphaComposite): Fix alpha composite\n\twhen both pixels contain transparency.\n\n\t* PerlMagick/demo/demo.pl: Use segmentation parameters which\n\tare more suitable for our image.\n\n2008-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c (CompositeImage): CMYK copy composition\n\toperators automatically set the image colorspace to CMYK.\n\n\t* coders/tiff.c (WriteTIFFImage): CMYK must take precedence over\n\tJPEG compression.  We don't support JPEG compression in TIFF with\n\tCMYK.\n\n2008-05-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (ChannelThresholdImage): Re-implement using\n\tpixel iterators.  Support thresholding only the red channel by\n\teliminating the switch to intensity thresholding if only one\n\tchannel parameter is supplied.\n\n\t* coders/tiff.c (WriteTIFFImage): Don't accidentially convert CMYK\n\timages to RGB.\n\n\t* magick/composite.c (CompositePixels): Handle CopyBlack properly\n\tfor CMYK images.\n\n\t* magick/command.c (CompositeImageCommand):  Support CopyCyan,\n\tCopyMagenta, CopyYellow, and CopyBlack.\n\n\t* magick/composite.c (CompositeImage): Preserve the canvas image\n\tcolorspace.\n\n\t* doc/options.imdoc: Remove mention of thresholding at the channel\n\tlevel since this never worked in a useful fashion and now only\n\tsimple intensity thresholding is available via -threshold.\n\n\t* magick/command.c (MogrifyImage): Revert to using ThresholdImage() rather\n\tthan ChannelThresholdImage().\n\n\t* PerlMagick/Magick.xs: Revert to using ThresholdImage() rather\n\tthan ChannelThresholdImage().\n\n2008-05-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (AddNoiseImage): Implemented using pixel\n\titerators.\n\n\t* magick/pixel_row_iterator.c (PixelRowIterateDualNew): New pixel\n\titerator.  Similar to existing PixelRowIterateDualModify except\n\tthat this one is for when initializing a new image.\n\n2008-05-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c (CompositeImage): Update image composition to\n\tuse pixel iterator methods.\n\n2008-05-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/enhance.c: Re-wrote all enhancement functions in this\n\tmodule to be based on the pixel iterator methods.\n\n\t* magick/command.c (ConvertImageCommand, MogrifyImageCommand,\n\tDisplayImageCommand): Gamma multiple channel syntax was broken.\n\tNow it is fixed.\n\n2008-05-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colorspace.c (RGBTransformImage): Optimized lookup table\n\tgeneration performance to the maximum extent possible.\n\t(TransformRGBImage): Optimized lookup table\n\tgeneration performance to the maximum extent possible.\n\n\t* magick/image.h (RoundDoubleToQuantum): New macro to explicitly\n\tsafely round a `double` to a Quantum.\n\t(RoundFloatToQuantum): New macro to explicitly safely round a\n\t`float` to a Quantum.\n\n\t* configure.ac: Add OpenMP support library to LIBS so that\n\tdependent applications will pick up this dependency without\n\tthemselves needing to enable OpenMP.\n\n\t* magick/command.c (CompositeImageList): Don't overwrite matte\n\tflag for CopyOpacity composition.\n\n\t* magick/composite.c (CompositeImage): CopyOpacity composition\n\tneeds the opacity channel to be enabled.\n\n\t* PerlMagick/Magick.xs: Dissolve composition with Opacity was not\n\tworking right.  Now it does.\n\n2008-05-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gem.c (HWBTransform): Hue value range was scaled wrong,\n\tleading to clipping.\n\t(TransformHWB): Hue value range was scaled wrong, leading to\n\tclipping.\n\n2008-05-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colorspace.c (RGBTransformImage): Re-implement transform\n\tloops using PixelRowIterateMonoModify() in order to simplify the\n\tcode.\n\n2008-05-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colorspace.c (TransformRGBImage): Re-implement transform\n\tloops using PixelRowIterateMonoModify() in order to simplify the\n\tcode.\n\n\t* magick/{pixel_iterator.h, pixel_row_iterator.h}: Pass pixel\n\tcolormap index/indexes to callback functions.  Dependent code is\n\tadjusted to match.\n\n2008-05-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (ConvertImageCommand, MogrifyImageCommand,\n\tMogrifyImage): Add command access to the new channel operators.\n\n\t* magick/operator.c (QuantumOperatorRegionImage): Support the new\n\tchannel operators.  Update to use PixelRowIterateMonoModify() for\n\ta bit more performance.\n\n\t* magick/operator.h (enum QuantumOperator): Added new operators\n\tAssignQuantumOp, ThresholdQuantumOp, ThresholdBlackQuantumOp, and\n\tThresholdWhiteQuantumOp.\n\n2008-05-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (VersionCommand): Report if OpenMP is supported\n\tby the build.\n\n\t* configure.ac, Makefile.am: Install documentation according to\n\tthe conventions established by the configure script.  This\n\tinstalls the documentation under\n\t/usr/local/share/doc/GraphicsMagick by default.\n\n2008-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* scripts/format_c_api_docs: Add pixel_iterator.c and\n\tpixel_row_iterator.c to API documentation formatter.\n\n\t* magick/api.h: Include pixel_iterator.h and pixel_row_iterator.h.\n\n\t* magick/Makefile.am (MAGICK_INCLUDE_HDRS): Formally install\n\tpixel_iterator.h and pixel_row_iterator.h.\n\n\t* magick/image.c (IsImagesEqual): Update to use\n\tPixelRowIterateDualRead().\n\t(GetImageStatistics): Update to use PixelRowIterateMonoRead().\n\n\t* magick/pixel_row_iterator.h: New interfaces which are similar to\n\tthe already existing interfaces in pixel_iterator.h except that\n\tthey pass a row to the callback rather than one pixel.\n\n\t* magick/operator.c (QuantumOperatorRegionImage): Add progress\n\tmonitor support.\n\n\t* magick/pixel_iterator.c (PixelIterateMonoRead): Add a\n\t`description` argument and progress monitor support.\n\t(PixelIterateMonoModify): Add a\n\t`description` argument and progress monitor support.\n\t(PixelIterateDualRead): Add a\n\t`description` argument and progress monitor support.\n\t(PixelIterateDualModify): Add a\n\t`description` argument and progress monitor support.\n\n\t* magick/resize.c (HorizontalFilter, VerticalFilter): Switch back\n\tto RoundSignedToQuantum() since some pixels were experiencing\n\tunderflow.  Localize some variables so that we don't have to\n\tdeclare them as private for OpenMP.\n\n2008-05-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac, magick/resize.c, PerlMagick/Makefile.PL.in: Added\n\tOpenMP support for parallelizing a task across multiple cores.\n\n2008-05-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac, magick/nt_base.h: Fix using libbz2 under MinGW.\n\n\t* coders/{msl.c, svg.c, url.c}: Fix compilation with modern\n\tlibxml2 under MinGW.\n\n2008-05-08  Josue Andrade Gomes  <josuegomes@gmail.com>\n\n\t* magick/nt_base.h, libxml/include/win32config.h (vsnprintf):\n\tFixed compilation issue noticed with Visual C++ 2008.\n\n2008-05-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (GetMagickInfo): Simplify implementation.\n\t(RegisterMagickInfo): Remove any existing entry since module\n\tloading may result in duplicate entries.\n\n2008-05-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* libtool: Update to libtool 1.2.4.\n\n\t* magick/magick.h (MagickInfo): Store string attributes as `const\n\tchar *` to statically allocated data rather than as heap allocated\n\tstrings.  THIS IS AN INTERFACE CHANGE.  Using a coder written to\n\tthe old interface is non-fatal but may resemble a small memory\n\tleak.  The reason for the change is to avoid at least 880 needless\n\tmalloc()/strlen()/strlcpy() operations at initialization time, and\n\tat least 880 free() calls at destruction time.  While these\n\toperations did not take long, they are still an unnecessary\n\toverhead, which is increased in thread-safe applications.\n\n\t* magick/module.c (OpenModule): Ignore requests to open modules\n        which have already been opened.\n\n\t* GraphicsMagick.spec.in: Add --with-included-ltdl to the default\n\toptions since this seems safest until the libltdl validation logic\n\tis fully robust.  This should be made user-configurable in the\n\tfuture.\n\n\t* magick/Makefile.am (magick_libGraphicsMagick_la_LIBADD): Apply\n\tlibltdl dependency argument as required for building.\n\n\t* configure.ac: Intuit if the GraphicsMagick library will depend\n\ton -lltdl.\n\n\t* Magick++/bin/GraphicsMagick++-config.in: Use substitutions\n\trather than invoking GraphicsMagick-config in order to determine\n\tGraphicsMagick library usage requirements.  This avoids problems\n\twhen GraphicsMagick-config is not in the executable search path.\n\n2008-05-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* GraphicsMagick.spec.in: NEWS was renamed to NEWS.txt.  Enable\n\tlibtool verbose output so it is possible to diagnose build\n\tfailures.\n\n2008-05-01  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* mat.c: gm convert -limit Pixels 1 input_gray_lsb_16bit.mat crap.miff\n\tdon't rotate partial image.\n\n2008-04-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (DestroyMagickInfoList): Use DestroyMagickInfo().\n\t(UnregisterMagickInfo): Use DestroyMagickInfo().\n\t(RegisterMagickInfo): Simplify dramatically by adding to the front\n\tof the list rather than maintaining alpha order.\n\n\t* magick/image.c (DestroyImageInfo): Tidy up and simplify code.\n\n\t* magick/constitute.c (WriteImage): Comment out the \"bi-modal\n\tdelegate\" execution code until we determine what value it offers.\n\tThe test suite passes without it.\n\n\t* magick/magick.h (struct MagickInfo): There is no need for `name`\n\tto be allocated data so make it const.\t\n\t(DestroyMagickInfo): Add a static function to destroy a MagickInfo\n\tstructure.  Renamed previous DestroyMagickInfo to\n\tDestroyMagickInfoList and made it static.\n\n2008-04-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: GraphicsMagick 1.2 released.\n\tCVS head is now 1.3 development.\n\n\t* png: Updated libpng to 1.2.27.\n\n2008-04-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageInfo): Ignore file extensions which\n\tmatch defined virtual delegate entries (including stealth\n\tentries).\n\n2008-04-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* BENCHMARKS.txt: Added timings for -blur.\n\n2008-04-27  Darko Kojic  <dkc@sf.net>\n\n\t* magick/effect.c (MedianFilterImage): Fixes to compile on ARM\n\tCPU.\n\n2008-04-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.h (MagickInfo): Remove image_info member since I\n\tcan not find any purpose for it.\n\n\t* coders/tiff.c (WriteTIFFImage): Remove assertion check on\n\tscanline size since it has not caught anything.\n\n\t* magick/image.c (SetImageInfo): Ensure that the file extension\n\tdoes not trigger unwanted activity such as access to an X11\n\tserver, printer, or the launch delegate.\n\n\t* config/Makefile.am (configshare_DATA): Install colors.mgk in\n\tshare path.\n\n\t* magick/blob.c (GetConfigureBlob): Search `share` config path\n\tprior to `lib` config path.\n\n2008-04-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): TrueColor RGB was usually\n\twritten rather than the desired more compact format.  This is a\n\tfirst pass at fixing that.\n\n2008-04-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* BENCHMARKS.txt: Added a benchmark summary.\n\n2008-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Prepare 1.2beta1 release.\n\n\t* NEWS.txt: Updated with latest news.\n\n2008-04-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* libtool: Update to 1.2965 2008-04-22\n\n\t* coders/png.c (ReadOneJNGImage): Deal with ReadImage() returning\n\ta NULL pointer when reading JPEG sub-image.\n\n2008-04-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/channel.c (ExportImageChannel): Added progress monitor\n\tsupport.\n\t(SetImageChannelDepth): Added progress monitor support.\n\t(ChannelImage): Don't preserve matte channel when extracting\n\tchannel.\n\n\t* magick/image.c (SetImageOpacity): Avoid integer overflow in Q32\n\tbuild.  Added progress monitor support.\n\t(SyncImage): Added progress monitor support.\n\t(SetImage): Added progress monitor support.\n\t(CycleColormapImage): Added progress monitor support.\n\t(GetImageBoundingBox): Added progress monitor support.\n\t(SortColormapByIntensity): Added progress monitor support.\n\n2008-04-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac, magick/Makefile.am: Don't use libtdl unless we are\n\tsupposed to be using it!\n\n\t* libtool: Updated to GNU libtool 1.2960 2008-04-19.\n\n\t* configure.ac, magick/delegate.h: It seems that the modern\n\tconvention is to store ghostscript headers in a subdirectory\n\tcalled `ghostscript` rather than `ps`.\n\tWe don't actually need Ghostscript errors.h and that is a good\n\tthing since it seems that some newer Ghostscript calls it ierrors.h\n\n2008-04-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/inc/files-dlls.isx: Comment out inclusion\n\tof X11 support DLLs.\n\n\t* VisualMagick/magick/magick_config.h.in: X11 is no longer in the\n\tdefault Windows build.\n\n2008-04-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c: Eliminate various annoying warnings noticed\n\tunder MinGW.\n\n\t* magick/spinlock.h (_spinlock_release): Use `long` rather than\n\t`int` in order to eliminate warning under MinGW.\n\n\t* magick/semaphore.c (spinlock_wait): Use `long` rather than `int`\n\tin order to eliminate warning under MinGW.\n\n\t* magick/log.c (LogMagickEventList): Eliminate warning under MinGW.\n\n\t* magick/compress.h: Clean up interface definitions to use\n\tmagick_uint8_t for unsigned character data.\n\n\t* coders/jpeg.c (ReadJPEGImage): Don't use GetPixelCachePresent()\n\tsince it is not DLL-exported.\n\n2008-04-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/yuv.c (ReadYUVImage): Report exception info correctly.\n\n\t* coders/xpm.c (ReadXPMImage): Report exception info correctly.\n\n\t* coders/xc.c (ReadXCImage): Report exception info correctly.\n\n\t* coders/tiff.c (ReadTIFFImage): Report exception info correctly.\n\n\t* coders/null.c (ReadNULLImage): Report exception info correctly.\n\n\t* coders/jpeg.c (ReadJPEGImage): Report exception info correctly.\n\tUse of Huffman optimization is now based on available memory\n\trather than a hard-coded image size.\n\n\t* coders/gif.c (ReadGIFImage): Report exception info correctly.\n\n\t* magick/utility.c (MagickSizeStrToInt64): New function to convert\n\ta size string with optional units suffix to a 64-bit integer.\n\t(MagickStrToInt64): New function to convert a string to a 64-bit\n\tinteger, with error checking.\n\n\t* magick/image.c (SetImage): SetImage now returns error status.\n\n\t* magick/command.c: Eliminated the long-deprecated -cache resource\n\tlimit option.\n\n\t* magick/resource.c: Complete re-write of the resource limit\n\tsystem.  Resource specifications are now absolute except that they\n\tsupport a binary metric suffix such as `K` to scale the value.\n\tAdded the `Pixels` limit type to limit the maximum number of\n\tpixels allowed for each image.\n\n2008-04-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (WriteJPEGImage): Output grayscale images more\n\tefficiently.\n\n2008-04-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* lcms: Updated lcms to 1.17.\n\n\t* png: Updated libpng to 1.2.26.\n\n2008-04-09  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c (ReadOnePNGImage) Use the low bits of the PNG\n\ttRNS values instead of scaling them when reducing from 16-bits.\n\n2008-04-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Updated to Autoconf 2.62.\n\n2008-04-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImageCommand): New -create-directories\n\toption automatically creates subdirectories as needed when\n\t-output-directory option is used.  This is useful when one\n\tdirectory tree of files is being mogrified to a new tree.\n\n2008-04-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (MagickCreateDirectoryPath): New function to\n\tcreate a directory path.  Will be used later.\n\t* configure.ac: Tweaks to produce a successful MinGW cross-compile.\n\n2008-04-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Added a simple sentinel\n\tassertion to hopefully flush out any remaining cases where\n\tExportImagePixelArea() writes past the end of its buffer.\n\n\t* magick/constitute.c (ExportImagePixelArea): GrayQuantum case for\n\tDirectClass pixels was sometimes writing a zero byte one past the\n\tend of the allocated buffer.  Thanks to Josue Gomes for reporting\n\tthis bug.\n\n2008-04-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/{pcd.c,pcx.c,pdb.c,pict.c,stegano.c,wpg.c,xcf.c}:\n\tWarnings reduction.\t\n\n\t* magick/{channel.c,image.c,unix_port.c,render.c}: Warnings\n\treduction.\n\n\t* coders/mat.c: Convert C99 comments to C89 comments so code can\n\tcompile with a C89 compiler.\n\n\t* coders/tiff.c (WriteTIFFImage): Add an assertion to enforce that\n\tthe bytes output to the scanline is no more than the bytes\n\tallocated for the scanline.\n\n\t* NEWS.txt: Updated with latest NEWS.\n\n2008-04-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Default to ZIP compression if\n\tavailable.  Ignore Image compression setting since the useful\n\tvalue (set by the user) usually comes from ImageInfo.\n\n\t* coders/png.c (WriteOnePNGImage): Fix progress monitor when\n\twriting PNG.\n\n\t* magick/channel.c (GetImageChannelDepth): Added progress monitor\n\tsupport.\n\n\t* magick/signature.c (SignatureImage): Added progress monitor support.\n\n\t* magick/image.c (GetImageDepth): Added progress monitor support.\n\n2008-04-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* libtool:  Update to libtool 2.2.2.\n\n\t* coders/jpeg.c: Convert more code to use size_t for sized values\n\trather than long.\n\n\t* coders/wpg.c (InsertRow): Fix log format string specification.\n\n\t* coders/dpx.c (WriteDPXImage): Fix typo in casts.\n\n\t* coders/fpx.c (ReadFPXImage): Apply FreeBSD patch from Mikhail\n\tTeterin to allow FlashPIX to work better for 64-bit builds.\n\tAddresses SourceForge issue 1824658 \"FPX should work again now\".\n\n\t* magick/blob.c (ImageToBlob): Fix typo in cast.\n\n2008-03-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* CONTRIBUTE.txt: Convert contribute.html to reStucturedText\n\tformat and generate HTML version from it.\n\n\t* PROCESS.txt: Convert description of development process to\n\treStucturedText format and generate HTML version from it.\n\n\t* INSTALL-windows.txt: Add instructions for how to install from\n\tsetup.exe style installer.  Also add instructions for how the\n\tdistribution package is built.\n\n\t* Copyright.txt: Reformat in reStucturedText format and generate\n\tHTML version from it.\n\n\t* VisualMagick/installer/inc/body.isx: No longer include\n\tdevelopment headers and libraries in the Windows DLL install\n\tpackage since they are large and they may only work with the\n\tversion of Visual C++ used to perform the build.  It is much safer\n\tfor the developer to build the package from source with his own\n\tcompiler.\n\n2008-03-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Fix compilation issues with Microsoft Visual Studio.\n\n2008-03-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage, WriteDPXImage): Use lookup tables to\n\tspeed up value conversion.\n\n\t* magick/memory.h (MagickAllocateArray): Renamed from\n\tMagickAllocateMemoryElements.\n\n2008-03-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: Use memory allocation macros like the rest\n\tof the code.\n\n\t* magick/memory.c (MagickMalloc): New function which behaves\n\tsimilar to malloc().\n\t(MagickMallocArray): New function for allocating an array.\n\t(MagickRealloc): New function which behaves similar to realloc().\n\t(MagickFree): New function which behaves similar to free().\n\t(MagickAllocFunctions): New function to allow the user to specify\n\tthe memory allocation functions.\n\n\t* magick/memory.h: New header file to define memory allocation\n\tfunctions.\n\n\t* magick/deprecate.c (DeleteImageList, DestroyImages,\n\tGetImageList, GetImageListIndex, GetImageListSize, GetNextImage,\n\tGetNumberScenes, GetPreviousImage, ParseImageGeometry,\n\tPopImageList, PostscriptGeometry, PushImageList,\n\tSetCacheThreshold, SetImageList, ShiftImageList, SizeBlob,\n\tSpliceImageList, UnshiftImageList): Remove functions which were\n\talready deprecated in ImageMagick 5.5.2 or earlier.\n\n2008-03-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteDPXImage): Support writing image which is\n\talready in a YCbCr colorspace.\n\t(ReadDPXImage): Return YCbCr images in YCbCr colorspace unless\n\tthey are also Cineon log encoded.\n\n\t* magick/image.c (CloneImage): Use CloneImageAttributes().\n\n\t* magick/attribute.c (CloneImageAttributes): New function for\n\tcopying image attributes from one image to another.\n\n\t* magick/utility.c (TranslateTextEx): Check if the pixel cache is\n\tinitialized before using a function which requires using it.\n\tThanks to Micha Kowalczuk for bringing this issue to my\n\tattention.\n\n\t* magick/attribute.c (SetImageAttribute): Only apply\n\ttransformations to \"comment\" and \"label\" attributes.\n\n\t* magick/pixel_cache.c (GetPixelCachePresent): New function to\n\ttest if the image pixel cache is present and initialized.\n\n2008-03-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colorspace.c (RGBTransformPacket): Rationalize casts for\n\timproved performance.\n\n\t* magick/image.c (GetImageDepth): Use table lookups to improve\n\tperformance.\n\n2008-03-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (AllocateImage): Transfer any attributes from\n\tImageInfo to allocated image.\n\t(SetImageDepth): Use table lookups to improve performance.\n\n2008-03-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImageCommand): Added an\n\t-output-directory option to `mogrify` to send output files to the\n\tspecified directory.\n\n2008-03-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/read.t: Add input_logical_lsb_08bit.mat to\n\tPerlMagick tests.\n\n\t* magick/nt_feature.c (CropImageToHBITMAP, ImageToHBITMAP): Use\n\tGlobalFree() to free bitmap handle.\n\n2008-03-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/read.t: Added/adjusted WPG test files from Jaroslav\n\tFojtik.\n\n2008-03-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* AUTHORS.txt, BUGS.txt, FAQ.txt, NEWS.txt, PLATFORMS.txt,\n\tTODO.txt, INSTALL-unix.txt, INSTALL-windows.txt: Use\n\treStructuredText format.\n\n\t* Makefile.am: Use reStructuredText for more files.\n\n2008-02-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ReadImage): Disable colorspace override\n\tcode since it was being wrongly-triggered in X11 display commands.\n\n2008-02-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/body.html: Update to mention 1.1.11 release.\n\n2008-02-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colorspace.c (RndToInt): Cast result to `unsigned int`\n\trather than `int` in order to avoid possible value truncation with\n\tQ32 build.  Problem was reported by Kai-Uwe Behrmann.\n\t(TransformRGBImage): Fix loop iterator which was looping one past\n\tthe end of the array.  Reported by Kai-Uwe Behrmann.\n\n\t* magick/command.c: Added a -set option to the composite, convert,\n\tdisplay, mogrify, import commands in order to allow setting an\n\timage attribute.\n\n2008-02-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: Use MagickAcquireMemory() rather than\n\tAquireMemory().\n\n\t* coders/xwd.c (ReadXWDImage): Eliminate integer overflow\n\tvulnerability (IDefense 09.19.07).\n\n\t* coders/xbm.c (ReadXBMImage): ditto\n\n\t* coders/xcf.c (ReadXCFImage): ditto\n\n\t* coders/dib.c (ReadDIBImage): ditto\n\n\t* coders/dcm.c (ReadDCMImage): ditto\n\n2008-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): The RFC 3949 specification for\n\tInternet FAX recommends LSB2MSB fill order so document that.\n\n2008-02-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Use `-define\n\ttiff:fill-order={msb2lsb|lsb2msb}` to control TIFF bit fill order.\n\n2008-02-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Updated to latest CVS libtool.\n\n\t* coders/tiff.c (CompressionSupported): Use\n\tTIFFGetConfiguredCODECs() to test if a requested compression type\n\tis supported by libtiff.  Based on advice from Frank Warmerdam.\n\n\t* configure.ac: Add test for TIFFGetConfiguredCODECs() in libtiff.\n\n2008-02-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c: With libtiff 3.6.1, including tiff.h and tiffio.h\n\tis not sufficient to obtain the definitions from tiffconf.h so\n\tlibtiff is assumed to not support any features, such as\n\tcompression.  Avoid this problem by explicitly including\n\ttiffconf.h if it is found.  This resolves SourceForge issue\n\t[1883527] compression of tiff-file has no effect.\n\n2008-02-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/inc/setup.isx: Set Inno Setup installer\n\tcompression to \"lzma/max\".\n\n\t* PerlMagick/Magick.xs: Eliminate use of memory allocation macros\n\tsince these failed miserably under Windows where it seems that\n\tmalloc, free, and realloc are redefined via macros by the Perl\n\tbuild environment.  This reverts changes made on 2007-12-01.\n\n\t* magick/memory.c (MagickAcquireMemoryArray): Use implementation\n\tfrom the 1.1 branch.\n\n\t* magick/utility.h: Remove MagickSafeMultiplySize_t since it seems\n\tthat use of inline functions in Windows is a disaster area.\n\n2008-02-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (windows-dist): Create a 7z compressed Windows\n\tcomprehensive source package.  See http://www.7-zip.org/ for\n\tinformation on Windows 7-Zip and http://p7zip.sourceforge.net/ for\n\tinformation on portable 7-Zip (P7ZIP).\n\n2008-02-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Add logging for image resolution\n\tand resolution units.\n\n\t* magick/version.h.in: Update copyright year to 2008.\n\n2008-02-01  Gary V. Vaughan  <gary@gnu.org>\n\t\n\t* configure.ac: Updated for libtool-2.1b.\n\n\t* bootstrap (libtoolize): Libtoolize can figure out the mode and\n\tdirectory for libltdl from configure.ac.\n\n2008-01-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>\n\n\t* magick/Makefile.am: Update\n\tmagick_libGraphicsMagick_la_DEPENDENCIES to use LTDLDEPS.\n\n2008-01-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageInfo): Successfully read existing file\n\tnames in the form file[123] which were failing to read since they\n\tappear to be a valid sub-image specification.\n\n2008-01-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (ExpandFilenames): If a filename appears to\n\tcontain a wildcard specification, first check to see if there is\n\tfile matching the unexpanded wildcard prior to engaging in the\n\tslow task of wildcard expansion.  Without this fix, expanding the\n\tcommand line takes a very long time if there are a huge number of\n\tfiles in the directory, and some file names appear to contain\n\twildcard specifications.  Inspired by SourceForge bug reports [\n\t1878992 ] \"literal square brackets in file name cause large delay\"\n\tand [ 1783209 ] \"converting runs slowly when subimage is\n\tspecified\", but this might not be the complete fix for the\n\tproblem.\n\n2008-01-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Update to Automake 1.10.1 and enable generation of\n\tan lzma compressed source package.\n\n2008-01-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Added configure option --with-umem to enable use\n\tof the umem memory allocation library available in Solaris 9,\n\tUpdate 3 and later, or from\n\thttps://labs.omniti.com/trac/portableumem/.  This library supports\n\tconcurrency in multi-threaded programs and supports debugging\n\tmemory issues.  See\n\thttp://developers.sun.com/solaris/articles/libumem_library.html\n\tfor a description of how to use the library for debugging memory\n\tissues.\n\n2008-01-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (VersionCommand): Include a \"Large Memory\" item\n\tin the Feature Support list.\n\n\t* coders/png.c (RegisterPNGImage): Remove reference to dead PNG\n\tftp site.\n\n\t* VisualMagick/configure/configure.cpp (InitInstance): Remove\n\tproject dependency on dxguid.lib (Direct-X).\n\n2008-01-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Update libtool to latest CVS version.\n\n2008-01-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (DisplayImageCommand): No longer default to\n\treading standard input if stdin fails isatty() test.  This\n\tbehavior was causing failure to launch from Gnome and it is\n\tdifficult to work around the issue from within a .desktop file.\t\n\t(AnimateImageCommand): No longer default to\n\treading standard input if stdin fails isatty() test.\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2009",
    "content": "\n2009-12-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/unix_port.c (MagickSpawnVP): Remove unneeded new line\n\tcharacter in error message format.\n\n\t* Magick++/Makefile.am: Allow Magick++ to be built as a shared\n\tlibrary under MinGW and Cygwin.  This requires a modern GCC in\n\torder for C++ exceptions to work.\n\n\t* utilities/tests/annotate.sh: MSYS is garbeling up draw command\n\tso use a command file rather than using command line.\n\n\t* coders/{fits.c,meta.c,locale.c}: Fix benign warnings noticed\n\tunder Cygwin 1.7.\n\n\t* magick/{constitute.c,resource.c,utility.c}: Fix benign warnings\n\tnoticed under Cygwin 1.7.\n\n2009-12-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/module.c (DestroyModuleInfo): If the Jasper library is\n\tused, then we can't invoke lt_dlexit() because this unloads the\n\tJasper library and Jasper sometimes registers an atexit() cleanup\n\thandler.  Unfortunately, this may annoy memory leak checkers.\n\n\t* coders/jp2.c: Defer Jasper initialization to point of use.\n\n2009-12-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickCdlImage): New method to apply the ASC\n\tCDL to an image.\n\t(MagickHaldClutImage): New method to apply a Hald CLUT to an image.\n\n2009-12-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h atof(), atoi(), and atol() are legacy functions\n\twhich might not be thread safe, might not enforce reasonable\n\tlimits, and should not be used for new code.  So we implement them\n\tvia strtod() and strtol().\n\n2009-12-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickGetImageBoundingBox): New method to\n\treturn the crop bounding box required to remove any solid-color\n\tborder from the image.\n\t(MagickGetImageFuzz/MagickSetImageFuzz): New methods to get and\n\tset the color comparison fuzz factor\n\n\t* wand/pixel_wand.c (ClonePixelWand): New method to deep-copy an\n\texisting pixel wand.\n\t(ClonePixelWands): New method to deep-copy an array of existing\n\tpixel wands.\n\n\t* wand/magick_wand.c (MagickSetResolution): New method to set the\n\twand resolution.  This one also works before the image has been\n\tread (unlike MagickSetImageResolution()).\n\t(MagickSetResolutionUnits): New method to set the wand resolution\n\tunits.  Use in conjunction with MagickSetResolution().  This one\n\talso works before the image has been read (unlike\n\tMagickSetImageUnits()).\n\n2009-12-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/demo/demo.cpp (main): Stop using deprecated functions.\n\n\t* wand/drawtest.c: Stop using deprecated functions.\n\n2009-12-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/module.c (ModuleAliases): J2C is supported by the JP2\n\tcoder.\n\n\t* coders/jp2.c: JP2 is now an alias for JPC since many files use\n\tthat extension.  Problem reported by Stefano Acerbetti.\n\n2009-12-09  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c: The png8 encoder would fail when trying to write\n\ta 1-color image.  Problem reported by Bob Clark.\n\n2009-12-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Define _GNU_SOURCE and _NETBSD_SOURCE so that\n\tpwrite() and pread() prototypes are available under GNU Linux and\n\tNetBSD.\n\n\t* coders/tiff.c: Warnings reduction.\n\n\t* magick/widget.c: Warnings reduction.\n\n\t* magick/segment.c (Classify): Warnings reduction.\n\n\t* magick/magic.c (struct StaticMagic): Length and offset can never\n\tbe negative so use an unsigned type rather than size_t.\n\n\t* magick/render.c (TracePath): Fix access one beyond the end of\n\tthe points array.\n\n2009-11-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gem.c (GetOptimalKernelWidth1D, GetOptimalKernelWidth2D):\n\tIn the Q32 build, convolution kernel size was estimated\n\tincorrectly for large sigmas on 32-bit systems due to arithmetic\n\toverflow.\n\n2009-11-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (ConvolveImage): Moved here from fx.c since this\n\tis a more suitable place for it to be.\n\n\t* magick/enhance.c (GammaImage): Improve performance a bit.\n\tPreserve full precision in Q32 build.\n\n2009-11-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/{channel.c,constitute.c,nt_base.h}: Start using the C'99\n\t`restrict` keyword.\n\n2009-11-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickGetImageAttribute): New method to get\n\tan image attribute.  Patch contributed by Mikko Koppanen.\n\t(MagickSetImageAttribute): New method to set an image attribute.\n\tPatch contributed by Mikko Koppanen.\n\n\t* magick/constitute.c (ReadImage): Log subimage and subrange.\n\n\t* configure: Update to Autoconf 2.65.\n\n\t* magick/attribute.c (GenerateIPTCAttribute): Returned IPTC string\n\tvalues were one character too short.\n\n2009-11-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (AllocateImage): The documented shorthand for\n\tspecifying image size via filename[WIDTHxHEIGHT] was not working\n\tfor raw formats which use the image tile_info data.\n\n2009-11-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (ParseSubImageSpecification): Try to match\n\tbehavior of previous sub-image specification parser.  Some\n\tincantations did not produce the same results.\n\n\t* win2k/IMDisplay/res/{IMDisplay.ico, IMDisplayDoc.ico}: Replaced\n\twith GraphicsMagick icon prepared by Jaroslav Fojtik.\n\n\t* coders/svg.c (ReadSVGImage): Use runtime initialization of\n\tSAXModules rather than static initialization.\n\n\t* magick/command.c: Commands now support reading an image from\n\tstdin in conjunction with a subrange specification (e.g. \"-[1]\").\n\tProblem was reported by Mario Becroft.\n\n\t* magick/common.h: New header file to incorporate the common bits\n\tshared by studio.h and api.h.\n\n\t* ltdl/ltdl.c: Update libltdl to 2.2.6b in order to fix security\n\tissue.  Resolves CVE-2009-3736 as it pertains to GraphicsMagick.\n\n2009-11-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ConstituteImage, DispatchImage): `A` and\n\t`T` should indicate transparency and `O` should indicate opacity.\n\tBehavior was inconsistent.  In some cases `O` meant transparency\n\twhile in other cases it meant opacity. Also, in a few cases, matte\n\twas not getting enabled in the image as it should.  Problems were\n\treported by Scott Kuhl.\n\n2009-11-10  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c: Also suppress new pedantic warnings from most\n\tolder libpng-1.4.0 betas.\n\n\t* coders/png.c: Added a warning when attempting to use libpng-1.4beta\n\tolder than 1.4.0beta67.\n\n2009-11-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): Only invoke ProfileImage() if\n\tan ICC CMS transform is to be performed.  Otherwise invoke\n\tSetImageProfile() to add the new profile.\n\n\t* magick/profile.c (ProfileImage): Improve logging messages.\n\n\t* coders/tiff.c (ReadTIFFImage): Allow CIELAB TIFF to be read.\n\n\t* coders/jpeg.c (ReadJPEGImage): Detect and apply colorspaces\n\tappropriately for ITU FAX JPEG.\n\n2009-11-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff: Updated to libtiff 3.9.2.\n\n2009-11-08  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c: Suppress new pedantic warnings from libpng\n\tversion 1.2.41 and 1.4.0 and later.\n\n2009-11-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Document difference between -recolor and\n\tAdobe Flash color matrix.\n\n2009-11-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImageCommand): Convolve does not accept\n\tan argument which looks like a geometry.  Resolves SourceForge\n\tissue #2890923 \"Different handling of -convolve between convert\n\tand mogrify\".\n\t(MogrifyImage): Validate that user-provided matrix is square when\n\tparsing -convolve and -recolor commands in order to avoid a core\n\tdump.\n\n\t* coders/tiff.c (ReadTIFFImage): Improved/added more coder logging\n\tstatements.\n\n\t* magick/xwindow.c: Reflowed some code and comments.\n\n\t* magick/utility.c (SetClientName): Default client name does need\n\tto be \"Magick\", so original value is restored.\n\n\t* coders/mpc.c (ReadMPCImage): is_monochrome and is_grayscale\n\tflags were not managed properly for the MPC coder.\n\n2009-10-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (ReadJPEGImage): Added jpeg:block-smoothing and\n\tjpeg:fancy-upsampling defines to control these JPEG library\n\toptions.\n\n\t* magick/image.c (SetImageInfo): Fix lockup due to hanging in loop\n\twhile parsing malformed sub-image specification (SourceForge issue\n\t2886560).  Also fixes the ability to pass the image size via the\n\tfilename specification like \"myfile.jpg[640x480]\" rather than\n\tneeding to use -size.\n\n\t* coders/jpeg.c (ReadJPEGImage): Fix image scaling when used with\n\tIJG JPEG library version 7.\n\n2009-10-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c: Added support for a \"Threads\" limit, which\n\tspecifies how many threads may be used.  Note that if\n\tomp_set_nested(true) is used, GCC's GOMP seems to replicate this\n\tnumber of threads for each level of threading rather than sharing\n\tthe specified number of threads across all teams.  For example,\n\tspecifying four threads leads to sixteen active threads with\n\tomp_set_nested(true) and nested threading.  This GOMP behavior\n\tdoes not seem to cause any harm.\n\t(GetMagickResourceLimit): New accessor function to retrieve the\n\tmaximum limit for a resource.\n\n\t* magick/module.c (ReadModuleConfigureFile): Default set of module\n\taliases is now statically initialized.  The modules.mgk file is\n\tnow optional and can be used to support adding more modules, or\n\tdiverting existing format support to a user-provided module.\n\n\t* magick/magick.c (DestroyMagick): Document that this function\n\tshould be invoked from the program's primary thread after any\n\tthreads using GraphicsMagick have terminated.\n\t(GetMagickInfo): Was thread safe for access but not properly\n\tthread safe during initialization.  Is now fully thread safe.\n\t(InitializeMagick): Fully initialize everything needed to\n\tread/write files.  Document that this function MUST be invoked\n\tfrom the program's primary thread prior to using any other\n\tGraphicsMagick functions.\n\n\t* magick/color_lookup.c (ReadColorConfigureFile): The colors.mgk\n\tis now optional so don't throw an exception if it is not found.\n\n\t* magick/semaphore.c (AcquireSemaphoreInfo): Deprecated this\n\tinternal function.  Use AllocateSemaphoreInfo() and\n\tLockSemaphoreInfo() instead.\n\t(LiberateSemaphoreInfo): Deprecated this internal function.  Use\n\tUnlockSemaphoreInfo() instead.\n\n2009-10-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* config/colors.mgk: Colors.mkg is now empty since it is used to\n\tmodify or extend the built-in color lookup table.\n\n\t* magick/{constitute.c,delegate.c,log.c,magic.c,magick.c,tempfile.c}:\n\tExplicitly initialize semaphores via InitializeMagick().\n\n\t* magick/type.h: New header file to contain types and function\n\tprototypes for functions in type.c.\n\n\t* magick/color_lookup.c (ReadColorConfigureFile): Store RGB color\n\ttable in a static struct.  Entries in the colors.mgk file are now\n\tused to modify statically-defined entries, or add new definitions\n\tto the color table.\n\n2009-10-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: --enable-libtool-verbose configure option is no\n\tlonger needed now that we have silent build capability.\n\n2009-10-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Add support for\n\tretrieving GPS EXIF attributes.  Based on work contributed by\n\tJukka Manner.\n\n\t* Magick++/lib/STL.cpp, Magick++/lib/Magick++/STL.h (shadeImage):\n\tShadeImage was the result of a botched cut-and-paste.  Corrected\n\tnow.  Thanks to Jukka Manner for making me aware of this.\n\n2009-10-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/analyze.c: New source file to contain image analysis\n\tfunctions.  Moved functions from image.c and color.c to this file.\n\n\t* magick/color_lookup.c: New source file to contain color lookup\n\tfunctions.  Moved associated functions from color.c to this file.\n\n\t* magick/ImageMagick.rc: Remove inclusion of magic.mgk.\n\n\t* magick/utility.c (MagickRoundUpStringLength): Use a bit less\n\tmemory.\n\n\t* magick/color.c: Use most efficient string allocation function.\n\n\t* config/Makefile.am: Eliminate use of magic.mgk.\n\n\t* magick/magic.c: Store file header magic data in a static struct.\n\n2009-10-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/describe.c (DescribeImage): Include composition operator\n\tin verbose output.  Also use CompressionTypeToString() to convert\n\ta compression enum to a string.\n\n2009-10-11  Toby Thain  <qu1j0t3@users.sourceforge.net>\n\n\t* coders/psd.c: Further fix for 2783535 reported by Daniel Kirsch.\n\tOmit 0x0 layers from the image list, or they break compositing.\n\n2009-10-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/xwindow.c: Check for overflow on all array allocations.\n\n\t* magick/command.c (MogrifyImages): If there is only one image in\n\tthe list, then -flatten does nothing at all.\n\n\t* magick/transform.c (FlattenImages): If the user provides only\n\tone image then return a clone of that image rather than reporting\n\tan error.\n\n\t* magick/texture.c (TextureImage): If an under-texture is applied,\n\tthen remove the matte channel.\n\n\t* magick/xwindow.c (MagickXMakeImage): Apply a checkerboard\n\tpattern when displaying non-opaque TrueColor images.  Fix a second\n\tinteger overflow issue related to CVE-2009-1882.\n\n2009-10-10  Toby Thain  <qu1j0t3@users.sourceforge.net>\n\n\t* coders/psd.c: Fix for 2783535 reported by Daniel Kirsch. PSD\n\tparser was confused by 0x0 pixel layers, resulting in image data\n\tcorruption of all following layers.\n\n2009-10-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/xwindow.c (MagickXMakeImage): Fix for CVE-2009-1882\n\t\"Integer overflow in the XMakeImage function\".  The problem is\n\tthat the shared memory segment allocated may be smaller than the\n\timage size requires due to integer overflow.  On some systems it\n\tmay be possible to crash GraphicsMagick (while displaying an image\n\tfile) but not likely to overwrite the heap since shared memory\n\tsegments are outside of the heap allocation.\n\n\t* magick/memory.c (MagickMallocArray): Use MagickArraySize().\n\n\t* magick/memory.c (MagickArraySize): New private function to\n\tcompute the size of an array and return zero if it overflows the\n\tsize_t type.\n\n2009-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (ReadDCMImage): Handle (UN)known type VRs correctly\n\tand interpret the transfer syntax correctly.  Added define\n\t\"dcm:avoid-scaling\" to request that the coder should not scale\n\timage samples unless necessary (i.e. when bits used > quantum\n\tdepth or maximum colormap depth, depending on image type).  Work\n\tis contributed by John Sergeant.\n\n2009-10-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/Makefile.am (CHECK_PDF_FILE_COMPRESS): Add PDF tests with\n\tthe various compression options.\n\n\t* coders/pdf.c (WritePDFImage): If the input file used JPEG\n\tcompression and has not been converted to a bilevel or palette\n\timage, then use JPEG compression with original settings.  Problem\n\twas reported by Marco Atzeri.\n\n2009-10-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* config/modules.mgk: DCRAW module entries were missing.\n\n\t* coders/tiff.c (WriteGROUP4RAWImage): Was not working properly on\n\tbig-endian CPUs with libtiff 1.4.\n\n\t* coders/ps2.c (WritePS2Image): Use ImageToJPEGBlob().\n\n\t* coders/ps3.c (WritePS3Image): Use ImageToJPEGBlob().\n\n\t* coders/pdf.c (WritePDFImage): Decouple from libtiff.  Use ImageToJPEGBlob().\n\n\t* coders/dcraw.c (RegisterDCRAWImage): Needed to register module\n\tname.\n\n\t* coders/cals.c (ReadCALSImage): Fix bug in CALS reader which\n\tcaused reading images taller than the image width to fail with an\n\terror.\n\n\t* magick/utility.c (AcquireString): Minor optimizations.\n\t(AllocateString): Minor optimizations.\n\t(CloneString): Minor optimizations.\n\t(LocaleCompare): Minor optimizations.\n\t(SubstituteString): Re-implemented in a more compact way which\n\tmight avoid some reallocations.\n\n\t* magick/magick.c (ListModuleMap): Don't crash if `module` was not\n\tset.\n\n\t* magick/delegate.c (ListDelegateInfo): Fix insignificant memory\n\tleak.\n\n\t* magick/compress.c (ImageToJPEGBlob): Preserve JPEG settings if\n\tfeasable.\n\n2009-09-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Use ImageToHuffman2DBlob() and\n\tImageToJPEGBlob().\n\n\t* coders/cals.c (WriteCALSImage): Use ImageToHuffman2DBlob().\n\n\t* magick/compress.c (ImageToHuffman2DBlob): New private\n\tconvenience function to produce a CCIT Group4 blob.\n\t(ImageToJPEGBlob): New private convenience function to produce a\n\tJPEG blob.\n\n2009-09-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (ReadJP2Image): Fix scaling problem noticed when\n\treading 12-bit JP2 format.  Problem was reported by Steve Shaw.\n\t(WriteJP2Image): Support writing JP2 files with arbitrary depth\n\tranging from 2 to 16 rather than just 8 or 16.\n\n2009-09-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/unix_port.c (MagickGetMMUPageSize): Cache returned page\n\tsize to eliminated repeated system calls.\n\n\t* magick/operator.c (QuantumOperatorRegionImage): Fix missing\n\tpercent in progress monitor message.\n\n2009-09-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c (GetIPTCStream): Should return IPTC block length\n\trather than remaining blob length.  Patch submitted by John\n\tSergeant.\n\n2009-09-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c (GetIPTCStream): IPTC blobs should be padded to an\n\teven size.  Patch submitted by John Sergeant.\n\n2009-09-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteGROUP4RAWImage): Added a GROUP4RAW encoder.\n\n\t* coders/cals.c (Huffman2DEncodeImage): Fix test failures when\n\tdoing I/O to an in-memory blob.\n\n\t* coders/pcl.c (WritePCLImage): Use a different control code to\n\t(hopefully) eject the page.  Patch submitted by John Sergeant.\n\n2009-09-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/Makefile.am: Add CALS tests.  Skip testing deep images for\n\tmost formats which don't support deep images.\n\n\t* coders/cals.c: CALS module was not being built under Windows\n\twith MSVC.  Now it is.\n\n\t* VisualMagick/configure/configure.cpp (process_library): CALS\n\tmodule is dependent on TIFF library.\n\n\t* coders/cals.c (WriteCALSImage): Allow CALS writing at any time,\n\tbut only enable CALS reader if libtiff is present at build time.\n\n\t* coders/{cals.c,pdf.c,ps2.c,ps3.c} (Huffman2DEncodeImage): Force\n\tTIFF image type to bilevel type.\n\n\t* config/modules.mgk, VisualMagick/bin/modules.mkg: CAL-->CALS\n\trather than CALS-->CAL.\n\n2009-09-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/benchmarks.rst: Updated GraphicsMagick vs ImageMagick\n\tbenchmark results.\n\n2009-09-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/cals.c (WriteCALSImage): Initial CALS Type 1 writer\n\timplementation.  Contributed by John Sergeant.\n\n\t* coders/png.c (ReadOnePNGImage): Fresh pixels should be set using\n\tSetImagePixels().\n\n2009-09-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Released GraphicsMagick 1.3.7.\n\n2009-09-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/msl.c, doc/conjure.imdoc: Add support for a new `profile`\n\tcommand in MSL/conjure which applies, adds, or removes one or more\n\tIPTC, ICC or generic profiles from a file.  Work contributed by\n\tJohn Sergeant.\n\n2009-09-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (NTGhostscriptFind): Make sure we close the\n\tregistry key.  Log any Windows error messages.\n\n\t* magick/profile.c (AppendImageProfile): New function to add or\n\tappend a profile.  If the profile already exists, then the data\n\tprovided is appended to it.\n\n\t* coders/jpeg.c (ReadGenericProfile,ReadICCProfile,ReadIPTCProfile):\n\tProfile chunks need to be concatenated.  Otherwise \"chunked\"\n\tprofiles become corrupted.\n\n2009-09-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/average.c (AverageImages): Moved from image.c to new\n\taverage.c file.\n\n\t* magick/colormap.h (VerifyColormapIndex): Moved here from color.h\n\n\t* magick/colormap.c (AllocateImageColormap): Moved from image.c to\n\tnew colormap.c source file.\n\t(CycleColormapImage): Moved from image.c.\n\t(ReplaceImageColormap): Moved from image.c.\n\t(SortColormapByIntensity): Moved from image.c.\n\t(MagickConstrainColormapIndex): Moved here from color.c.\n\n\t* magick/describe.c (DescribeImage): Moved from image.c to new\n\tdescribe.c source file.\n\n\t* magick/plasma.c (PlasmaImage): Moved from image.c to new\n\tplasma.c source file.\n\n\t* magick/statistics.c (GetImageStatistics): Moved from image.c to\n\tnew statistics.c source file.\n\n\t* magick/gradient.c (GradientImage): Moved from image.c to new\n\tgradient.c source file.\n\n\t* magick/texture.c (ConstituteTextureImage,TextureImage): Moved to\n\tnew texture.c source file.\n\n\t* coders/svg.c (ENABLE_SVG_WRITER): Disable SVG writer by default\n\tsince it usually does not work correctly and is unlikely to work\n\tcorrectly any time soon.\n\n2009-09-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/profile.c (ProfileImage): GlobExpression is case\n\tsensitive so assure that its glob strings are always upper-cased.\n\tWithout this fix, lower-cased arguments like \"icm\" would fail to\n\tbe removed.  This would not be much of a problem except that the\n\tdocumentation claims that lower-case works.\n\t(SetImageProfile): Assure that profile names are upper-cased.\n\n\t* magick/fx.c (ColorMatrixImage): Add opaque opacity channel if\n\timage currently lacks an opacity channel but the matrix updates\n\tthe opacity channel.  Requested by Kerry Panchoo.\n\n2009-09-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c (GetIPTCStream): Updates from John.Sergeant to fix\n\tissues with IPTC record 2 blocks and to deal better with IPTC\n\tembedded in an 8BIM profile.\n\n\t* PerlMagick/t/read.t: Added tests for Topol format.\n\n2009-09-12 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\t* coders/topol.c: Pallette overflow fixed for subtype 3.\n\n2009-09-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/tests/msl_composite.sh: Use a draw command file for\n\tthis test script too.\n\n\t* utilities/tests/{black-threshold.sh,draw.sh,recolor.sh,\n\twhite-threshold.sh}: MSYS is sometimes wreaking havoc on arguments\n\twith spaces in them so use work-arounds.\n\n2009-09-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (NTGhostscriptFind): Improve logging messages\n\twhen searching for Ghostscript.\n\n2009-09-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (CacheInfo): Add read_only member to\n\tindicate if cache is allowed to be modified.\n\t(ModifyCache): Clone cache if origin cache is read only.\n\t(PersistCache): Persistent caches which are attached are treated\n\tas read-only.  This avoids crash with MPC images which are read\n\tand subsequently modified.\n\tReverted pixel cache locking changes which were made yesterday\n\tsince I decided that they were too risky until file handle\n\tmanagement is addressed.\n\n2009-09-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c (InitializeMagickResources): Increase\n\toperating system file handle limits if necessary.\n\n\t* magick/pixel_cache.c: Pixel cache file locking is now done at\n\tpoint of access.\n\n\t* magick/nt_base.c (NTGhostscriptFind): New function to find\n\tGhostscript under Windows, replacing previous Ghostgum\n\timplementation.\n\n\t* Copyright.txt: License is now based on MIT license exactly,\n\twithout extra edits.  Ghostgum code has been eliminated so it is\n\tno longer necessary to include its license.\n\n2009-09-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/delegate.c (GetPostscriptDelegateInfo): Add a gs-palette\n\tdelegate entry in order to force Ghostscript to output a\n\tcolormapped image if `-type palette` is specified prior to the\n\tinput filename.  Ghostscript's dithering is much courser than\n\tGraphicsMagick's -colors default (more similar to\n\t-ordered-dither), but it is fast and produces smaller intermediate\n\tfiles.\n\n\t* coders/ps.c (ReadPSImage): Eliminate use of NULL pointer when\n\tprogress monitor is enabled.  Was referring to image->filename\n\trather than image_info->filename as it should have.\n\n\t* magick/delegate.c (InvokePostscriptDelegate): Added an\n\t`exception` argument so that failure details can be returned.\n\tTried to reorganize the code so that it is more tolerant of errors\n\tsuch as a dynamically-loadable DLL failing to load.  On POSIX\n\tsystems, Ghostscript was not being invoked as securely as\n\texpected.\n\n\t* coders/Makefile.am: Only build the DPS module if the Display\n\tPostscript library is available.\n\n\t* coders/ept.c (ReadEPTImage): If we don`t have the Display\n\tPostscript library, then don't try to use it as a fallback.\n\n\t* coders/ps.c (ReadPSImage): If we don't have the Display\n\tPostscript library, then don't try to use it as a fallback.\n\n\t* magick/blob.c (CloseBlob): If blob was never allocated, then\n\tdon't try to close it.\n\n2009-09-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/index.rst: Mention 1.2.8 release.\n\n2009-09-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++: New Image methods cdl(), colorMatrix(), and haldClut()\n\tadded.\n\n2009-09-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c (IntegralRotateImage): Select tile sizes in a\n\tmore intelligent fashion.\n\n\t* magick/pixel_cache.c (GetPixelCacheInCore): New private pixel\n\tcache method to see if image pixels are in core.\n\n2009-09-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ReadImage): No longer clear the exception\n\tat the start of ReadImage() and other similar functions.  If the\n\tuser of the function cares, she can clear the exception in\n\tadvance.  It is not right to overwrite exceptions which might not\n\thave been reported/handled yet.\n\n\t* magick/shear.c (IntegralRotateImage): Rotate by zero degrees\n\tdoes not need to do any work.\n\n\t* coders/*.c, magick/*.c: Include image dimensions in progress\n\tmonitor output when loading or saving a file.  Eliminate redundant\n\ttext from progress messages.\n\n2009-08-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c: Eliminate memory leaks.\n\n\t* magick/render.c (DrawDashPolygon): Avoid access beyond end of\n\tarray.  Resolves SourceForge issue 2832125 \"Crash on SVG\n\tconversion\".\n\n\t* coders/png.c (ReadOnePNGImage): Ensure that opacity channel is\n\tproperly initialized.  Resolves SourceForge issue 2831240\n\t\"Possible alpha channel issue with PNG w/palette and tRNS\".\n\n2009-08-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.h (HAVE_TIFFSWABARRAYOFTRIPLES): Need to define\n\tthis since libtiff includes this function now.\n\n\t* VisualMagick/tiff/libtiff/tiffconf.h.in: Enable all the options\n\tby default.\n\n\t* tiff: Updated to libtiff 3.9.1.  3.9.0 was broken.\n\n2009-08-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/profile.c (MagickFreeCMSTransform): Add a CMS transform\n\tdestructor since otherwise Visual Studio does not like it.\n\n\t* tiff: Updated to libtiff 3.9.0.\n\n2009-08-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (TimeImageCommand): Add a simple `time`\n\tsub-command to time the execution of any other GraphicsMagick\n\tsub-command.  Similar in concept to the `benchmark` sub-command\n\tbut produces output similar to the `time` command offered by the\n\tzsh command shell.  Handy for when `time` is not available, or\n\tconsistent output is desired.\n\n\t* magick/magick.c (MagickGetFileSystemBlockSize): New private\n\tfunction to allow getting desired filesystem block size.\n\t(MagickSetFileSystemBlockSize): New private function to allow\n\tsetting desired filesystem block size.\n\n\t* magick/pixel_cache.c (WriteCacheIndexes, WriteCachePixels):\n\tTemporarily disable pixel cache row coalescing when writing to\n\tdisk until we come up with a good way to optimize write sizes.\n\n\t* coders/meta.c (ReadMETAImage): Fix memory leak of profile blob.\n\n2009-08-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/tests/icc-transform.sh: Add a sanity-test for applying\n\tICC profiles.\n\n\t* magick/profile.c (ProfileImage): Improve OpenMP performance.\n\n2009-08-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawPolygonPrimitive): Drawing of points,\n\tlines, and polygons is now accelerated using OpenMP with good\n\tspeed-up.\n\n2009-08-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/drawing_wand.c (DrawClearException): New function to clear\n\tdrawing wand exception.\n\t(DrawGetException): New function to retrieve information regarding\n\tthe last drawing wand exception (if any).\n\t(DrawRender): DrawRender() is now deprecated since it requires an\n\tImage pointer to be embedded in the drawing wand.  The image\n\tpassed is subsequently lost by CloneDrawingWand() since it must\n\tclone the image using copy-on-write.  Subsequent use of\n\tDrawRender() on a cloned wand scribbles on an image the user does\n\tnot have access to.  Use existing Wand function MagickDrawImage()\n\tinstead.\n\t(DrawAllocateWand): DrawAllocateWand() is now deprecated since it\n\trequires passing an Image pointer into the drawing wand.  Use\n\texisting DrawingWand function NewDrawingWand() instead.\n\n2009-08-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/drawing_wand.c (CloneDrawingWand): New function to\n\tdeep-copy a drawing wand.\n\t(NewDrawingWand): Use a boolean flag to track if image is\n\tallocated by the wand, or by the user.  Most of the previous\n\tDrawAllocateWand() code is moved into NewDrawingWand() so that the\n\tboolean flag is easy to manage.\n\n2009-08-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Support writing grayscale\n\tJPEG-compressed TIFF.\n\n2009-08-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Don't override the photometric\n\tfor grayscale JPEG-compressed TIFF.\n\n2009-08-08  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c: Made compatible with libpng-1.4.0beta74 and later\n        (won't work with libpng-1.4.0beta35 through beta73) due to change\n        in names of png_struct members \"trans\" and \"trans_values\"). \n\n2009-08-08 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\t* coders/topol.c: Pallette is ignored for subtype 5 (RGB).\n\n2009-08-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/{cineon.c, dpx.c, locale.c, svg.c}, magick/{attribute.c,\n\teffect.c, utility.c}: Eliminate warnings reported by GCC 4.4.0.\n\n2009-07-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Try to be more insistent about compilation failure\n\tif libjpeg version is less than 6b.  IRIX compiler only warns\n\tabout #error preprocessor statement.\n\n2009-07-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickSetCompressionQuality): New Wand\n\tmethod to allow setting the compression quality.\n\n2009-07-29 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/topol.c: Fixed missing break. Added response to ping.\n\n2009-07-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcx.c (ReadPCXImage): Detect improper rows, columns, or\n\tdepth.  Fixes CVE-2008-1097 \"Memory corruption in ImageMagick's\n\tPCX coder\".\n\n\t* configure.ac: Update to Autoconf 2.64.\n\n2009-07-25 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/topol.c: Fixed several issues. Added possibility to read\n\tTopoL level 2 images.\n\n2009-07-25 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* VisualMagick\\configure\\configure.cpp: Fixed library absolute path issue.\n\n2009-07-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/random.c (DestroyMagickRandomGenerator): Trick to free\n\tthread specific random kernel contexts simply locks up with MSVC's\n\tOpenMP, so remove this functionality.\n\n2009-07-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/random.c (DestroyMagickRandomGenerator): Cleanup thread\n\tspecific random kernel data.\n\n\t* magick/tsd.c (MagickTsdKeyCreate): Fix glitch when built without\n\tany threads support.\n\n2009-07-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/benchmarks.rst: Update GraphicsMagick vs ImageMagick image\n\tprocessing benchmark results.\n\n2009-07-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/OpenMP.rst: Update performance measurements for readily\n\tavailable systems.\n\n\t* NEWS.txt: Updated to reflect latest changes.\n\n2009-07-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* png: Updated libpng to 1.2.38.\n\n2009-07-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (GetImageInfo): Default interlace for ImageInfo\n\tis now UndefinedInterlace so that it is possible to preserve the\n\toriginal interlace setting for the image file.  Code depending on\n\tthe previous default setting of NoInterlace is adjusted to suit.\n\tThis is a potentially risky change given the brittle nature of\n\tsome of the legacy code.\n\n\t* coders/tiff.c (ReadTIFFImage): Stripped reader needs to read\n\tplanar TIFF plane-wise in order to work with libtiff's internal\n\tbuffering.\n\t(ReadTIFFImage): Tiled reader needs to read planar TIFF plane-wise\n\tin order to work with libtiff's internal buffering.\n\t(WriteTIFFImage): Tiled writer needs to output planar TIFF\n\tplane-wise in order to work with libtiff's internal buffering.\n\n2009-07-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MontageUsage): Reconcile montage help output\n\twith actual montage options.\n\n2009-07-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Allow the user to be able to\n\tspecify rows_per_strip when using JPEG compression.  The\n\trows_per_strip value rounded up to the nearest multiple of 16.\n\n2009-07-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Add the ability for the user to\n\tmanually specify the predictor using syntax like `-define\n\ttiff:predictor=2`.\n\n2009-07-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/quantize.c (QuantizeImages): Avoid crash when using\n\t-monitor +map on an image list.\n\n\t* magick/command.c (BenchmarkImageCommand): Send benchmark report\n\tto stderr so that it does not interfer with pipes.\n\n\t* magick/cdl.c (CdlQuantum): Add range limiting of value before\n\tapplying power function.\n\n\t* coders/dpx.c (ReadDPXImage, WriteDPXImage): Using floating point\n\tcalculations when building sample value lookup tables in order to\n\tdecrease error.  In particular input values were being scaled too\n\tlow, resulting in improperly rounding down during processing of\n\tthe image.\n\n2009-07-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Incorporated updates from John\n\tSergeant to remove the font and thumbnail objects from PDF output.\n\n2009-07-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/cdl.c (CdlImage): New function to apply an ASC CDL\n\ttransform to the image.  Original implementation by Clment Follet\n\tfrom Workflowers but considerably re-worked by Bob Friesenhahn.\n\tAvailable as -asc-cdl via the `convert` and `mogrify` subcommands.\n\n2009-07-04 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* www/formats.rst: MAT module can read compressed files.\n\tRemove warning about unsupported compression.\n\n2009-07-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c: Eliminate compiler warnings.\n\n2009-07-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c: Significant re-write of the DICOM reader.  Work\n\tcontributed by John Sergeant.\n\n2009-07-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (OpenBlob): Subsequent research shows that Direct\n\tI/O will not be useful to ordinary file I/O due to specific\n\trequirements for buffer alignments and I/O sizes.  Support for\n\trequesting it is removed.\n\n2009-07-01  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* www/formats.rst: ART module has writer for more than year.\n\tSo mark this here.\n\n2009-06-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac, magick/blob.c: Add experimental Solaris direct I/O\n\tsupport which is enabled by setting the environment variable\n\tMAGICK_DIRECTIO to TRUE.  Direct I/O bypasses the filesystem\n\tcache.  Only works for NFS and UFS, and not for ZFS.\n\n2009-06-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* rungm.sh.in: Fix environment variable issues noticed while\n\trunning the test suite under MinGW.\n\n\t* Makefile.am (TESTS_ENVIRONMENT): Fix environment variable issues\n\tnoticed while running the test suite under MinGW.\n\n\t* magick/hclut.c (HaldClutImage): Don't convert Cineon Log to RGB.\n\n2009-06-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImageCommand): Cache mogrify argument\n\timages so that they are only loaded once when mogrify is used to\n\tprocess multiple image files.\n\n\t* coders/dpx.c (WriteDPXImage): Fix leak of chroma image when\n\tsubsampling to 4:2:2.\n\n2009-06-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (ExpandFilenames): Expand @filename to a list\n\tof arguments.\n\n2009-06-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImageCommand): Fix memory leak of\n\toutput_directory string buffer, if it was used.\n\n\t* magick/utility.c (ExpandFilenames): Input wildcard file\n\tspecifications with a subdirectory component such as\n\t\"subdir/*.dpx\" were not working.\n\n2009-06-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (InitializeMagick): Invoke InitializeMagickRegistry().\n\n\t* magick/registry.c (RegistryInfo): There is no reason to expose\n\tthe RegistryInfo structure in the public interface so it is moved\n\tto registry.c.\n\t(InitializeMagickRegistry): Add a function for initializing the\n\tmagick registry.\n\n2009-06-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (CompareImageCommand): Report full error rather\n\tthan rounded error in error reports since sometimes the value\n\treported was rounded down to zero.\n\n\t* utilities/tests/hald-clut-transform.sh: New test to verify that\n\tHald CLUT interpolation is working perfectly.\n\n\t* utilities/tests/hald-clut-identity.sh: Renamed from\n\thald-clut.sh.\n\n2009-06-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (RegisterJPEGImage): Fix typo which caused IJG\n\tlibrary version to be shown for \"JPG\" format but not for \"JPEG\".\n\tAlso use a more descriptive name for JPEG library.\n\n\t* magick/image.c (DescribeImage): Filter out spurious EXIF\n\tattributes which already exist because we previously accessed\n\tthem.  We do a full EXIF dump later.\n\n2009-06-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/FAQ.rst: Add a FAQ about how to process many files at once.\n\n2009-06-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Reduce usage of deprecated Autoconf macros.\n\n\t* coders/jpeg.c (ReadJPEGImage): Set image orientation from EXIF\n\tOrientation tag if it is present.\n\n\t* www/formats.rst: Add TopoL format as per Jaroslav Fojtik.\n\n2009-06-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: User provided LDFLAGS was being overwritten under\n\tSolaris.\n\t* Many files: Additional reduction of shadowing warnings.\n\n2009-06-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): Fix leak of the entire mask\n\timage supplied via -mask.\n\n\t* utilities/tests/mask.sh: Add a test for applying a mask image\n\twith -mask.\n\n2009-06-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Identify unknown\n\ttags via their four-character hex value.\n\n\t* magick/colorspace.c (CMYKToRGBTransform): Use symbolic notation\n\tto access pixel quantum values.\n\n\t* utilities/tests/identify.sh: Added a test for `identify\n\t-verbose` on a well-populated JPEG file.\n\n\t* PerlMagick/t/{jpeg/write.t, jng/read.t, jng/write.t}: Relax\n\tallowed error for JPEG-related tests.\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Attribute allocation\n\tsize was too small causing overrun of memory buffer.  Problem was\n\tadded on 2009-06-08.\n\n\t* magick/image.c (AllocateDepthMap): Allocation size was one\n\telement too small.\n\t(GetImageDepth): Forgot to free depth map.  Memory leak of 64K\n\tbytes per iteration.\n\n2009-06-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/{mat.c, miff.c, pdf.c, ps3.c}: Have Zlib use our memory\n\tallocators.\n\n\t* magick/memory.c (MagickMallocCleared): New memory allocation\n\tinterface which is similar to MagickMalloc() except that returned\n\tmemory has been cleared first.\n\n\t* magick/hclut.c (HaldClutImagePixels): Fix wrong accesses\n\tdetected by valgrind.  Also improve execution performance.\n\n\t* coders/xwd.c (WriteXWDImage): Fixed valgrind memcheck complaint\n\tabout access to uninitialized data.\n\n2009-06-09  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c Handle alpha channel for ImageMagick's alternative .txt\n\n2009-06-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteDPXImage): Fixed valgrind memcheck complaint\n\tabout access to uninitialized data.\n\n\t* magick/attribute.c (GenerateEXIFAttribute): For EXIF STRING,\n\toutput unprintable characters using three-digit octal notation.\n\n\t* coders/dpx.c (WriteDPXImage): Assure that offset count is\n\tcorrect according to reported bytes written.\n\n\t* utilities/tests/hald-clut.sh: Add a simple identity test for the\n\tHald CLUT support.\n\n2009-06-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c Handle alpha channel for ImageMagick's .txt\n\n2009-06-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/hclut.c (HaldClutImage): Add a Hald CLUT capability as\n\tdescribed at http://www.quelsolaar.com/technology/clut.html.  This\n\tallows a color transformation to be easily created and replicated\n\ton any number of images.  The algorithm is accessed by the\n\t-hald-clut option of `convert` and `mogrify`.  The original\n\talgorithm is by Eskil Steenberg and was adapted for GraphicsMagick\n\tby Clment Follet from Workflowers with support from Cdric\n\tLejeune of Workflowers.\n\n2009-06-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GetMagickGeometry): Support `^` modifier to\n\tgeometry specification which indicates that specified size is a\n\tminimum bounding box rather than a maximum bounding box while\n\tpreserving the image aspect ratio.\n\n2009-06-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c (ListMagickResourceInfo): If supporting\n\tOpenMP, then include a \"Threads\" limit in the output of `-list\n\tresource`.\n\n\t* coders/pnm.c (ReadPNMImage): Fix multi-thread issue detected by\n\tvalgrind's helgrind tool.  Diminish compilation warnings.\n\n\t* coders/dpx.c (ReadDPXImage): Diminish compilation warnings.\n\n\t* magick/random.c (AcquireMagickRandomKernel): Fix potential\n\tmulti-thread issue detected by valgrind's helgrind tool.\n\n\t* magick/magick.c (InitializeMagick): Semaphore subsystem needs to be\n\tinitialized before anything which uses it.\n\n\t* magick/semaphore.c (InitializeSemaphore): Since we are using\n\tPTHREAD_MUTEX_INITIALIZER to initialize primary POSIX mutex in the\n\tsemaphore subsystem, we should not explicitly initialize the\n\tsemaphore a second time.\n\n\t* magick/segment.c (Classify): Fix multi-thread issue detected by\n\tvalgrind's helgrind tool.\n\n\t* magick/render.c (DrawAffineImage): Use InterpolateViewColor() to\n\tevalute a bi-linear interpolated point rather than obtaining a\n\tpixel value from a close pixel.  This provides better results.\n\n2009-06-02  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c Attempt to handle alpha channel.\n\n2009-06-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (InterpolateViewColor, InterpolateColor):\n\tMoved from gem.c.  Gem functions should not be accessing the pixel\n\tcache.\n\n2009-06-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (CompareImageCommand): Add a -maximum-error\n\toption to `compare` so that it can easily be used in boolean logic\n\twhen comparing images.\n\n2009-05-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/Makefile.am (TESTS_XFAIL_TESTS): If Ghostscript is not\n\tavailable then XFAIL the tests which depend on it.\n\n\t* magick/pixel_cache.c (GetCacheInfo): Assure that allocated\n\tstuctures do not occupy the same cache lines.\n\n2009-05-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h (MAGICK_CACHE_LINE_SIZE): Allow cache line size\n\tto be set in one place in case we want to configure for it later.\n\n\t* magick/effect.c (AllocateMedianList): Assure that allocated\n\tstuctures do not occupy the same cache lines.\n\n\t* magick/random.c (AcquireMagickRandomKernel): Assure that\n\tallocated random kernels do not occupy the same cache lines.\n\n\t* magick/gem.c (GenerateDifferentialNoise): User is required to\n\tsupply random kernel.\n\n\t* doc/options.imdoc: Document -format \"%p\".  Problem was reported\n\tby Stijn Sanders.\n\n2009-05-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/Makefile.am (coders_tiff_la_LIBADD): Libtiff may now also\n\tdepend on libjbig and the math library.\n\n\t* doc/gmdoc2html: Fix link to ball.png.  Problem was reported by\n\tWes Fox.\n\n\t* VisualMagick/installer/inc/files-documentation.isx: Include Wand\n\tAPI documentation.\n\n\t* VisualMagick/installer/inc/icons-associate.isx: Fix Windows\n\tStart menu link to web pages.\n\n\t* configure.ac: --with-perl is changed to --without-perl since\n\tbuilding PerlMagick is no longer the default.  Building PerlMagick\n\tautomatically has caused too many problems.\n\n\t* PerlMagick/Makefile.am: GraphicsMagick no longer automatically\n\tinstalls PerlMagick.  Use the procedure described by\n\tPerlMagick/README.txt to build and install PerlMagick.\n\n2009-05-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Debian stores Ghostscript fonts under\n\t/usr/share/fonts/type1/gsfonts so check there for fonts.  Issue\n\treported by Ralf Wildenhues.\n\n2009-05-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: Fix Ping of blob.\n\n\t* PerlMagick/t/ping.t: Added tests for pinging files and blobs.\n\n\t* www/perl.rst: Ping blob syntax is like $image->Ping(blob=>@blob).\n\n\t* PerlMagick/Makefile.PL.in: Increase the probability of\n\tPerlMagick build success by using the user-specified C compiler as\n\tthe linker if the C compiler was already used as the linker.  This\n\thelps if the C compiler used to build GraphicsMagick is a more\n\trecent vintage than the one used to build Perl.\n\n\t* PerlMagick/t/wmf/read.t: Test needs to be more lenient for\n\tLinux.\n\n\t* Makefile.am (TESTS_ENVIRONMENT): Pass a complete text\n\tenvironment so that we don't need to execute rungm.sh in order to\n\trun the test suite.\n\n2009-05-25  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>\n\n\t* version.sh: Define PACKAGE_STRING.\n\n2009-05-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/tempfile.c (ComposeTemporaryFileName): Use new random\n\tnumber generator.\n\n\t* magick/random.c: Implement a random number generation system\n\tbased on George Marsaglia's multiply-with-carry generator.\n\tSomewhat slower than rand() but produces better random numbers\n\twith a period >2^60.  Suggested by Mark Mitchell.\n\n2009-05-24  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c Small optimization:\n\n\tBefore: 2000 iter 34.08s user 34.24s total 58.420 iter/s\n\n\tAfter: 2000 iter 21.55s user 21.76s total 91.891 iter/s\n\n2009-05-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (XFAIL_TESTS): Handle the case where FreeType is not\n\tavailable by marking tests dependent on FreeType as XFAIL.\n\t(TESTS): Reorder TESTS so that there will be no trailing spaces\n\tsince this confuses certain older versions of GNU make.\n\n2009-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/tempfile.c (ComposeTemporaryFileName): Use simpler code\n\t(suggested by Mark Mitchell) to compute the substitution index.\n\t(AcquireTemporaryFileDescriptor): Try harder to generate a\n\tsuccessful temporary file and fall through to alternative\n\timplementations if the first does not succeed.\n\n\t* magick/magick.c (InitializeMagick): Use MagickRandNewSeed() to\n\tseed the default random number generator.\n\n\t* magick/utility.c (MagickRandNewSeed): Include PID in random\n\tnumber seed generation.\n\n2009-05-22  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c Fixed char vs int parameter problem.\n        Better detection of too dark 16bit or 32bit images.\n\n2009-05-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (AUTOMAKE_OPTIONS): Enable parallel-tests and\n\tcolor-tests options.  Parallel test execution does not pass tests\n\tyet.\n\n\t* PerlMagick/PerlMagickCheck.sh.in: Run PerlMagick tests via a\n\tnormal check script rather than a check hook.\n\n\t* coders/identity.c (ReadIdentityImage): Fix compilation with Sun\n\tcompiler.\n\n2009-05-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwfile.c: Allow the user to specify the basename for\n\ttemporary files.\n\n\t* tests/Makefile.am: Add a set of TXT read/write tests.  Pass the\n\tfile name specification to use for the rwfile-based tests.\n\n2009-05-21  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c Fixed endian set to native endian.\n\n2009-05-20  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c Faster read ImageMagick files.\n\tRemoved BImgBuff=NULL;\n\n2009-05-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/txt.c (WriteTXTImage): Ensure that image depth is 8, 16,\n\tor 32.\n\n\t* www/formats.rst: Add CALS to formats list.\n\n\t* coders/cals.c (RegisterCALSImage): Consolidate duplicate text\n\tstrings.\n\n2009-05-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/cals.c: Add support for reading CALS type 1 format.\n\tContributed by John Sergeant.\n\n\t* coders/identity.c: New coder to return a Hald identity CLUT\n\timage.\n\n2009-05-19  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c Ability to read back Q32 txt files.\n\n2009-05-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Support Linux style silent build rules.\n\n2009-05-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Updated to Automake 1.11.\n\n2009-05-17  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c First attempt to read back txt file.\n\tIt is amazingly ineffective, but it seems to work.\n\n2009-05-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resize.c (HorizontalFilter, VerticalFilter): When\n\tresizing a non-opaque image, attenuate the influence of\n\tsurrounding colors based on their degree of transparency in order\n\tto avoid \"halos\" around objects caused by colors which are\n\ttransparent and therefore not part of the visible image.  Patch\n\tcontributed by Pavel Merdin via SourceForge Tracker #2792322.\n\t(VerticalFilter, VerticalFilter): Additional clean-up and\n\toptimizations.\n\n2009-05-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): Added a -recolor command option\n\tto provide access to ColorMatrixImage().\n\n\t* magick/fx.c (ColorMatrixImage): New function to apply a color\n\tmatrix similar to Adobe Flash Flash.filters.colorMatrixFilter(),\n\tand Windows GDI+ ColorMatrix class, (order up to 5x5) to the image\n\tpixels.\n\n2009-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/perl.rst: Add missing PerlMagick debug event types.\n\n\t* coders/pcl.c: Major improvements from John Sergeant.  These\n\tinclude: 1) Fixed 2 bit output where Max=BLACK - this always\n\tproduced negative images even when -negate was passed as a\n\tparameter. The code now uses a two element palette to handle this\n\tsituation.  2) Added support for 8 bit pseudoclass images.  3)\n\tChanged the coder to allow adjoin, placing each sub-image on a new\n\tpage.  4) Added support for compression. Any compression other\n\tthan \"None\" will cause the coder to to try to calculate and pick\n\tthe best out of the PCL set of RLE, Tiff RLE or delta compression\n\ton a per row basis, as well as handling repeated rows and zero\n\trows intelligently.\n\n2009-05-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/Makefile.am (MAGICKPROGRAMS): Add a `compare`\n\tImageMagick compatibility link.\n\n\t* INSTALL-unix.txt: Apply patch regarding GnuWin32 from John Wye,\n\tSourceForge #2779009.\n\n2009-05-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Add the LDFLAGS option -Wl,-zlazyload when using\n\tthe Solaris linker.\n\n2009-05-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/url.c (ReadURLImage): Fix typos.\n\n2009-05-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (SystemCommand): Added access confirmation\n\tchecks for external commands.\n\n\t* magick/unix_port.c (MagickSpawnVP): Added access confirmation\n\tchecks for external commands.\n\n\t* coders/url.c (ReadURLImage): Added access confirmation checks\n\tfor URLs.\n\n\t* magick/blob.c: Added access confirmation checks for files.\n\n\t* magick/confirm_access.c (MagickConfirmAccess): Added an access\n\tconfirmation facility to allow the API user to monitor and/or\n\tblock access to files and URLs.  This allows the API user to\n\timplement a security policy based on actual accesses.\n\n2009-05-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* png: Updated libpng to 1.2.35.\n\n\t* lcms: Updated lcms to 1.18a.\n\n2009-05-01  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c (WriteOnePNGImage and WriteOneJNGImage): Changed\n\tinternal attribute png_bit_depth to png:bit-depth-written to avoid\n\tconfusion with planned new public png:bit-depth attribute.\n\n2009-04-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImages): Deal slightly better with the\n\tcase when MogrifyImage() expands one image into several.  Still\n\tdon't know of a sane way to deal with -crop WIDTHxHEIGHT.\n\n\t* magick/transform.c (TransformImage): Image which is updated may\n\tbe a list so account for that.\n\n\t* configure.ac: Add a test for the `restrict` keyword so that\n\teventually we can use it.\n\n\t* coders/jpeg.c (ReadJPEGImage): Tidy JPEG reader by moving JPEG\n\tproperties analysis code into subroutines.\n\n2009-04-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/display.imdoc: Fix documentation for crop and chop keyboard\n\taccelerators.  Fixes SourceForge bug #2593388 \"error in the\n\tdocumentation/Keyboard accelarators\".\n\n2009-04-20  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c: Cosmetic-only, change `True` to `MagickTrue` or\n\t`MagickPass` and `False` to `MagickFalse` or `MagickFail`.\n\n2009-04-20  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c: Check error return from CompressColormapTransFirst()\n\n2009-04-20  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c: Refrain from modifying image struct members\n\t(matte, colors, depth) while writing a PNG.\n\n2009-04-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Document the direction of rotation.\n\n2009-04-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (LogMagickEventList): Use MagickPackageName from\n\tversion.h rather than hard-coding `GraphicsMagick`.\n\n2009-04-18  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/jpeg.c: Fixed a warning about `shadowed` variables.\n\n2009-04-17  Glenn Randers-Pehrson <glennrp@simple....>\n\n\t* coders/png.c: Fixed some warnings about `shadowed` variables.\n\n2009-04-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Add tests for some reentrant versions of functions\n\twhere we are still using the non-rentrant versions.\n\n\t* magick/composite.c (CompositeImage): Fix problem with\n\tcompositing images where the change image overlaps off the left\n\tside of the canvas.  Should fix SourceForge issue #2766200 `memory\n\tallocation error when compositing small images`.\n\n2009-04-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/semaphore.c: Re-arrange ifdefs so that it is possible to\n\tuse pthreads under the WIN32 API.\n\n2009-04-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/bit_stream.c: Bitstream functions were often not inlining\n\tand inline functions which don't inline are not much use.\n\tBitstream functions are now normal library functions.\n\n2009-03-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/bin/delegates.mgk: Remove bounding box option (-g) from\n\tPostscript delegate specifications.\n\n\t* config/delegates.mgk.in: Remove bounding box option (-g) from\n\tPostscript delegate specifications.\n\n\t* coders/{ept.c, pdf.c, ps.c} : PDF bounding box is sometimes\n\tincorrect or not globally applicable so don't specify bounding box\n\twhen reading PDF files.  Postscript files do need the bounding box\n\tso make sure that it is still supplied.  Resolves SF tracker issue\n\t2487651 `convert from pdf chops off rhs`.\n\n2009-03-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Magick++/Image.rst: Translate Image.html to reStructuredText\n\tformat for easier maintenance.\n\n2009-03-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/rgb.c: Compute the quantum type rather than using a\n\trecurring conditional statement.  It turns out that the -endian\n\toption is working as it should.\n\n2009-03-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/{gray.c, rgb.c, cymk.c}: Work toward supporting the\n\t-endian option.  Not working properly yet.\n\n\t* magick/enum_strings.c (EndianTypeToString): New function.\n\t(InterlaceTypeToString): New function.\n\n2009-03-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/drawing_wand.c: Stripped out unused code.\n\n\t* www/wand: Added formatted Wand API documentation.\n\n\t* scripts/format_c_api_doc.py: Now supports --include-rst option.\n\n2009-03-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (GetImageBoundingBox): If we fail to find a\n\tsmaller bounding box, then the returned bounding box is the entire\n\timage.\n\n2009-02-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/magick/magick_config.h.in: Provide configuration\n\taccess to the DisableSlowOpenMP define.\n\n\t* PerlMagick/t/read.t: Add a test for HRZ Slow scan TV.\n\n\t* magick/pixel_cache.c (ModifyCache): Set image `taint` flag and\n\tclear monochrome and grayscale flags when pixels are accessed\n\tread/write rather than at sync.\n\n\t* coders/Makefile.am (MAGICK_CODER_SRCS): Add coders/hrz.c to\n\tbuild.\n\n2009-01-27  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/hrz.c: New HRZ reader for slow scan TV.\n\n2009-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resize.c (ResizeImage): Make error handling more robust.\n\n\t* magick/pixel_cache.c (SetNexus): Return a run-time error to\n\tinvoking code rather than exiting the program if the pixel staging\n\tbuffer fails to be allocated.\n\n2009-02-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Allow the user to force the\n\treturned image to be TrueColor type for min-is-white and\n\tmin-is-black TIFF files.  Previous to this, bilevel TIFF files\n\twere always returned as PseudoClass.\n\n2009-01-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c, coders/pnm.c: Fix several race conditions\n\treported by Julian Seward.\n\t(OpenCache): Restore conservative pre-allocation of pixel indexes\n\tsince a glitch was encountered that needs to be resolved.\n\n\t* magick/{channel.c,compare.c,constitute.c,decorate.c,effect.c,fx.c,\n\timage.c,operator.c,pixel_iterator.c,render.c,resize.c,segment.c,\n\tshear.c,transform.c}: Use explicit OpenMP critical sections to\n\tavoid possible cross-contention.\n\n\t* coders/{dpx.c, pnm.c} Use explicit OpenMP critical sections to\n\tavoid possible cross-contention.\n\n2009-01-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (OpenCache): Remove conservative\n\tpre-allocation of pixel indexes.\n\n2009-01-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/index.rst: Reduce the amount of text on the front page.\n\n2009-01-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* GraphicsMagick.spec.in: The module .la files need to be\n\tinstalled as part of the base install or else the modules will\n\tfail to load.\n\n2009-01-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dib.c (ReadDIBImage): Fix assertion thrown for DIB files\n\twith negative image height values.\n\n2009-01-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (ReadBMPImage): Fix assertion thrown for BMP files\n\twith negative image height values.  Resolves SF issue 2523536 `bug\n\tin bmp coder`.\n\n\t* Makefile.am: Don't install Magick++ headers if Magick++ is\n\tdisabled.\n\n\t* GraphicsMagick.spec.in: --enable-lzw option is no longer used.\n\n2009-01-17  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c: More robust fits parsing.\n\n2009-01-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated news.\n\n2009-01-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colorspace.c (XYZTransformPackets): Fix arithmetic\n\toverflow problem noticed for Q32 build when using GCC on\n\tbig-endian systems.\n\n\t* magick/constitute.c: Update Richard Nolde's float 16 and 24\n\tfunctions.\n\n\t* magick/command.c (VersionCommand): Print some build information\n\tfor MSVC builds.\n\n2009-01-10  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c: Ability to skip unsupported multidimensional object.\n\n2009-01-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (GetBlobSize): It seems that under Windows, the\n\tzip stream is not usable as a file handle.  Switch back to using\n\tstat instead, but use _stati64 if available.\n\n2009-01-04  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/fits.c: Fixed bug in scene count in extension block.\n\t* coders/fits.c: Supported logging.\n\n2009-01-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Produce sprintf scaling strings for\n\tplatform-specific types.\n\n\t* magick/magick_types.h.in: Include sprintf scaling strings for\n\tplatform-specific types.\n\n\t* magick/constitute.c (WriteImage): If output stream is not\n\tseekable and coder needs to use seek, then divert output to\n\ttemporary file, and then send file to stream.\n\n\t* magick/blob.c (GetBlobSize): Simplify implementation.\n\t(OpenBlob): Don't attempt to test header magic on file we are\n\twriting.  Silly benign bug in obtuse code.\n\n\t* coders/tiff.c (ReadTIFFImage,WriteTIFFImage): Strip out use of\n\ttemporary file.  Use TIFFClientOpen() for writing.\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2010",
    "content": "2011-01-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickDescribeImage): Was sending\n\tdescriptive output to stdout rather than returning it in an\n\tallocated string as intended.\n\n2011-01-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/draw.c, wand/drawing_wand.c (MvgPrintf): Update to handle\n\tC99 vsnprintf() return values.\n\n\t* magick/draw.c, wand/drawing_wand.c (DrawAnnotation): Linux\n\tglibc does not pass extended text characters if \"%.1024s\"\n\tformatting convention is used.  Apparently it assumes that such\n\tcharacters may be UTF8 and returns -1 rather than outputting the\n\tstring, even if it is assured to fit.\n\n2010-12-30 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Matlab file level clarification.\n\n2010-12-27 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mac.c New MacPaint image format reader added.\n\n2010-12-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Default to using a LZMAPRESET\n\tvalue of 1 based on testing which observed minimal benefit, and\n\tsubstantially more cost, from larger values.  Value may be\n\tspecified by the user using command line syntax like `-define\n\ttiff:lzmapreset=7` for purposes of further experimentation.  Also\n\tadjusted default strip memory values for each preset level.\n\n2010-12-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: Add LZMA support to PerlMagick.\n\n\t* coders/tiff.c (WriteTIFFImage): Add TIFF LZMA compressor support.\n\n2010-12-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImages): Should send -verbose output to\n\tstderr rather than stdout since otherwise usage in pipelines may\n\tbe broken.  Resolves SourceForge issue 3131790 \"AVS -verbose\n\tprints to stdout\".\n\n2010-11-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* libtool: Upgrade to libtool 2.4.\n\n\t* coders/pnm.c (ReadPNMImage): Start work on reading NetPBM PAM\n\tformat.  Parses PAM header but pixels are not returned yet.\n\n\t* magick/magic.c (StaticMagic): Be more specific when identifying\n\tPNM subformats.  Return the specific subformat name PBM, PGM, or\n\tPPM rather than PNM.  XV P7 format is now identified as \"P7 332\".\n\tAdd detection of NetPBM PAM format.\n\n2010-11-04  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* magick/effect.c: Added 5x5, 6x6, and 7x7 circular ordered dither\n\tpatterns to create a halftone effect.\n\n2010-09-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Document pcl:fit-to-page define.\n\n\t* coders/pcl.c: Fix issue with printing a bi-level image on\n\tKonica-Minolta printers.  Define pcl:fit-to-page in order for the\n\tprinter to scale the image to fit the page.  Patch by John\n\tSergeant.\n\n2010-09-19  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* coders/png.c: removed an apparently harmless extra invocation\n\tof ScaleShortToQuantum() due to cut-and-paste error in the\n\tupdate of 2010-06-02.  Also added a line to explicitly set\n\tthe opacity of the background_color to OpaqueOpacity.\n\n2010-09-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (ReadPDFImage): Enable use of PDF crop box via\n\t-define pdf:use-cropbox=true. Patch contributed by Chris Gilling.\n\tSourceForge patch ID 3063794, \"Add support for using crop box for\n\tpdf import\".\n\n2010-09-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Image.cpp (backgroundColor, borderColor, matteColor):\n\tOpacity part of user-specified color needs to be preserved.\n\tProblem was reported by Alexander Zheltov.\n\n2010-09-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Applied Automake 1.11.1 patch by Ralf Wildenhues\n\twhich is necessary for the test suite to pass under Windows/MinGW\n\tdue to command line length limits.\n\n2010-09-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/draw.c, wand/drawing_wand.c: Pass full user-provided\n\tdouble precision resolution to renderer.  Truncating the\n\tresolution causes problems in some cases.  Resolves SourceForge\n\tbug 3058387 \"Incorrect Copy Compositing through C interface\".\n\n2010-09-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (StringToList): Fix performance problem caused\n\tby using strlcpy.\n\n\t* coders/pnm.c (ReadPNMImage): Q8 build should be able to read\n\t16-bit PGM images.\n\n2010-09-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MontageImageCommand): Fix memory leak of\n\tMontageInfo structure allocation in error handling path.\n\n\t* magick/montage.c (MontageImages): Fix crash observed with\n\t\"-geometry x+0+0\".  Problem reported by Simon Rainer.\n\n2010-08-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Update to Automake 1.11.1.\n\n2010-08-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Use AC_USE_SYSTEM_EXTENSIONS to enable system API\n\textensions.\n\n2010-08-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (ModifyCache): Fix deadlock in\n\tClonePixelCache() which was caused by using the same semaphore\n\tpointer in the source and destination images.  Problem was\n\treported by Stefan Schramowski.\n\n2010-08-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/info.c (WriteINFOImage): Added an `INFO` coder which\n\tproduces textual image description output similar to `identify`\n\tbut may be used with convert like \"gm convert myfile info:-\".\n\tFeature suggested by Stefan Schramowski.\n\n2010-08-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/Makefile.am (TESTS_PS_XFAIL_TESTS): Expect EPT tests to\n\tfail if Ghostscript is missing.\n\n\t* configure.ac: Updated to Autoconf 2.67.\n\n\t* magick/render.c (DrawImage): Use StringToGravityType() to parse\n\tgravity values.\n\n2010-07-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Document histogram-threshold setting.\n\n\t* magick/enhance.c (NormalizeImage): Add support for\n\thistogram-threshold setting to specify the percentage of the\n\thistogram to discard when computing image normalization parameters\n\t(default is 0.1%).  For example `-set histogram-threshold 0.01\n\t-normalize`.\n\n\t* www/api/types.rst: Update Image structure member documentation.\n\n2010-07-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Add a test for posix_spawnp().  Results may be\n\tused in later development.\n\n2010-07-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/Makefile.am (TESTS_PS_XFAIL_TESTS): PDF tests are expected\n\tto fail if Ghostscript is not available.\n\n\t* magick/utility.c (MagickStrlCat, MagickStrlCpy): Add handling\n\tfor the case where size is zero in order to be conformant with the\n\tstrlcat() and strlcpy() formal descriptions.  GraphicsMagick does\n\tits best to never pass a size of zero so an assertion that size is\n\tnot zero remains in order to help catch bugs in GraphicsMagick.\n\tIssue was reported by Albert Cahalan.\n\n2010-07-10  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* coders/png.c: Always scale tRNS color to 16-bit short.  Otherwise,\n\ttransparency was sometimes lost while reading PNG files whose depth\n\tis different from the Quantum depth.\n\n2010-07-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (LOG_TIFF_BLOB_IO): Define LOG_TIFF_BLOB_IO=1 when\n\tbuilding GraphicsMagick in order to enable verbose logging from\n\tthe TIFFClientOpen() registered callbacks when `coder` logging is\n\tenabled.\n\n2010-06-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwfile.c: Deal with formats which don't have an extension\n\tby prepending the magic specifier to the file name specification.\n\n\t* coders/mpr.c (RegisterMPRImage): MPR and MPRI are not useful\n\tfile extensions.\n\n\t* magick/command.c (CommandAccessMonitor): If the environment\n\tvariable MAGICK_ACCESS_MONITOR is set to TRUE then also log\n\tinvocations of the access monitor callback when -monitor is\n\tspecified.  This feature is intended to assist with understanding\n\twhen the access monitor is invoked, and the arguments which are\n\tpassed.\n\n\t* magick/blob.c (OpenBlob): Throw an exception on error rather\n\tthan depending on the invoking code to do so.  Resolves\n\tSourceForge bug #3023437 \"Magick::Image::ping() does not throw\n\texception in all cases\".\n\n2010-06-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): The -colors, -map, and\n\t-monochrome options now take effect immediately rather than at the\n\tend of all other processing.  This is is more intuitive and\n\treasonable but may impact the output of scripts which place these\n\toptions prior to additional image processing operations.\n\n2010-06-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (BlobToImage): If a temporary file must be used\n\tand the user has specified magic, then preserve the magic\n\tspecifier when reading the temporary file.\n\n\t* coders/mat.c (RegisterMATImage): More accurately describe MATLAB\n\tformat support as \"MATLAB Level 5\".\n\n\t* magick/magic.c (StaticMagic): Automatically detect MATLAB Level\n\t5 format based on file header.\n\n\t* PerlMagick/PerlMagickCheck.sh.in: Run PerlMagick tests in\n\tverbose mode so that all test output appears in \"test-suite.log\"\n\tif there is a failure.\n\n\t* coders/Makefile.am (coders_mat_la_LIBADD): MAT coder is\n\toptionally dependent on zlib so zlib should be listed as a\n\tdependency.\n\n\t* magick/blob.c (BlobToFile): MAGICK_IO_FSYNC=TRUE in the\n\tenvironment should cause file data to be explicitly synchronized\n\tprior to close.\n\n2010-06-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/inc/files-documentation.isx: There are\n\tnot currently any JPEG files in the www/images directory to\n\tdistribute.\n\n2010-06-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ltdl/config/ltmain.sh: Update libtool to 2.2.10.\n\n\t* magick/profile.c: Support lcms 2.0.\n\n\t* configure.ac: Add support for configuring for lcms 2.0,\n\tcontrolled via a new --without-lcms2 option.  By default lcms v2\n\tis used if it is available, otherwise v1.1X is used if it is\n\tavailable.\n\n2010-06-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ltdl/config/ltmain.sh: Update libtool to 2.2.8.\n\n2010-06-02  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* coders/png.c correctly scale bKGD chunk data in Q16 build\n\n2010-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Magick++/Image.rst: Fix documentation error which wrongly\n\trecommended multiplication by size of PixelPacket.  Correction by\n\tRoel Baardman.\n\n2010-05-23 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/txt.c (ReadTXTImage): Ability to read multiple images.\n\n2010-05-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (DispatchImage): `K` channel was always\n\toutput as black for \"CMYK\" specification unless image matte flag\n\twas True.  Bug report and proposed solution by Lance Brown.\n\n2010-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c (ShearImage): When one of the shear angles was\n\tspecified as zero, the shear request was ignored entirely.  An\n\tsimple optimization was using || rather than && to test the\n\tangles.  Resolves SourceForge issue #2991685 \"Shear command does\n\tnot handle zero angles correctly\".\n\n2010-05-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (InitializeMagick, DestroyMagick):\n\tInitializeMagick and DestroyMagick should be fully thread safe.\n\n2010-05-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (ReadGIFImage): Set the opacity value of the opaque\n\tcolor to transparent.  Patch by Tim Baker.\n\n\t* magick/image.c (SetImageColor): New function which is similar to\n\tSetImage() but which accepts the pixel color as a parameter rather\n\tthan using the image background color.  Patch by Tim Baker.\n\n\t* magick/transform.c (CoalesceImages): When applying background\n\tdisposal, fill the image with the transparent color, if one\n\texists.  Patch by Tim Baker.  Resolves SourceForge patch ID\n\t2989472.\n\n2010-05-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/txt.c (ReadTXTImage): Matte channel was not being enabled\n\tfor non-opaque images.\n\t(ReadTXTImage): Opacity values need to be inverted prior to\n\tingestion.\n\n2010-04-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Documentation for -flatten and -mosaic has\n\tbeen improved.\n\n\t* magick/transform.c (MosaicImages): The -mosaic command now\n\trespects the composition option specified by -compose as well as\n\tthe image background color specified by -background.\n\n2010-04-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/*.c, magick/*.c: Eliminate many benign data race\n\tconditions.\n\n2010-04-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* GraphicsMagick.spec.in: Avoid duplicate copies of documentation\n\tfiles.  Put documentation into a versioned directory as used by\n\tRed Hat and CentOS.  Include archive libraries in developer\n\tpackage.\n\n\t* PerlMagick/Makefile.PL.in: Include support for DESTDIR so that\n\tRPM builds find the installed GraphicsMagick library.\n\n2010-04-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Under Solaris, make sure that OpenWindows Type1\n\tfonts do exist before deciding to use them.  OpenSolaris does not\n\tprovide these fonts.\n\n2010-04-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* GraphicsMagick.spec.in: Fix RPM build.  PerlMagick was not being\n\tbuilt due to Makefile changes.  Resolves SourceForge issue\n\t#2952696 \"RPM build broken: (Perl) file not found by glob\".\n\n\t* magick/quantize.c (ReduceImageColors): Progress message should\n\tinclude the image file name.\n\n2010-03-24  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* Revised coders/jpeg.c to preserve the Exif profile.\n\n2010-03-24  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* coders/png.c (ReadOnePNGImage): Eliminated some of the deprecated\n\tdirect access to ping_info->members.\n\tEliminated support of very old libpng versions (1.0.11 and earlier).\n\n2010-03-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/delegate.c (GetPostscriptDelegateInfo): Add support for\n\tinvoking \"gs-cmyk\" and \"gs-cmyka\" entries in delegates.mgk when\n\tColorSeparationType or ColorSeparationMatteType is requested.\n\tRequisite entries in delegates.mgk are left for the user to add.\n\n2010-03-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (InitializeMagick): Don't initialize locale\n\tsettings in InitializeMagick().  Resolves SourceForge bug #2967282\n\t\"setlocale called by GraphicsMagick\".\n\n2010-03-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/{command.c, display.c}: Make sure that `animate`,\n\t`display`, and `identify` report any error only once, and then\n\tproceed to the next file name rather than quitting.  Problem was\n\treported by Patrick Welche.\n\n2010-03-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Released GraphicsMagick 1.3.12.\n\t\n2010-03-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Makefile.am: Update PerlMagick/Magick.pm in the\n\tsource tree (as required) since it is distributed source and\n\tcontains the current version number.\n\n2010-03-03  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* coders/png.c: restored missing \"US\" in PNG_USER_CHUNK_CACHE_MAX\n        at line 102.  Added some (unsigned long) typecasts on print statements\n        to stifle warnings.\n\n2010-03-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* png: Updated libpng to 1.2.43.  Resolves CVE-2010-0205 as\n\tpertains to GraphicsMagick Windows build.\n\n2010-03-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwfile_DCX_*.sh: Add tests for reading and writing DCX.\n\n\t* coders/pcx.c (WritePCXImage): DCX is not the same as PCX so only\n\twrite DCX when requested to (and vice-versa).\n\n\t* utilities/tests/convert-pipe-out.sh: New test to verify that\n\t`convert` can write to stdout.\n\n\t* utilities/tests/convert-pipe-in.sh: New test to verify that\n\t`convert` can read from stdin.\n\n\t* utilities/tests/convert-pipe-filter.sh: New test to verify that\n\t`convert` works properly as a filter.\n\n\t* magick/image.c (SetImageInfo): The `rectify` parameter was found\n\tto not be sufficient to meet requirements since it was\n\toverloaded. The utilities would malfunction (hang or throw an\n\texception) if requested to write to stdout.  As a result, this\n\tparameter has been changed to a binary flag type parameter.\n\tExisting True/False values are mapped to equivalents using the new\n\tbinary flag.  This is intended to resolve Debian bug 571719\n\t\"graphicsmagick: \"convert\" command is broken\", reported by\n\tVladimir Stavrinov.\n\n2010-02-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Released GraphicsMagick 1.3.11.\n\n2010-02-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c (GetCompositionPixelIteratorCallback):\n\tOverCompositeOp and AtopCompositeOp may be replaced with\n\tCopyCompositeOp in the case where neither image has a matte\n\tchannel.\n\n\t* magick/command.c (ConvertImageCommand, MogrifyImageCommand):\n\tAdded -extent option to apply a background color canvas behind the\n\timage. Added -compose option to allow specifying the composition\n\toperator to use.\n\n\t* magick/transform.c (ExtentImage): New function apply a\n\tbackground color canvas behind the image.\n\n2010-02-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Added a -thumbnail command to all of the GM\n\tsub-commands which currently support -resize.  This is a resize\n\tmethod optimized for speed when reducing the size of the image\n\t(such as when creating thumbnails).\n\n2010-02-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (LocaleCompare, LocaleNCompare): Fix array\n\tindex underflow which occurs if the char type is signed and the\n\tcharacter value is in the extended range.  Problem reported by\n\tArseny Solokha.  Resolves SourceForge patch #2953314.\n\n2010-02-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Released GraphicsMagick 1.3.10.\n\n2010-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/demo/demo.cpp (main): Split demo output frames into\n\tindividual files to enable easier viewing.\n\n2010-02-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/GraphicsMagick.imdoc: Improve usage synopsis for\n\t`convert`. SourceForge feature request 2845965 \"confusing\n\tdocumentation\".\n\n\t* magick/display.c (MagickXDisplayImage): Image number was\n\tincorrect in window title.\n\n\t* magick/render.c (DrawImage): Path points data allocation was\n\tmuch larger than it needed to be.  Patch by Vladimir Lukianov.\n\tResolves SourceForge issue 2947851 \"Memory allocation error on\n\tvector graphics (or mem bomb)\".\n\n\t* magick/constitute.c (WriteImages): +adjoin was not working\n\tcorrectly for the case when only one image frame is present.  With\n\t+adjoin and writing one frame to \"foo%d.jpg\" it was outputting\n\t\"foo%d.jpg\" rather than \"foo0.jpg\".  Problem reported by Frans\n\tCoetzee.\n\n2010-02-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Released GraphicsMagick 1.3.9.\n\n2010-02-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/imdoc2man: Bare single quotes at the beginning of a line\n\tneed to be escaped in order to make roff happy.  Problem reported\n\tby Daniel Kobras.\n\n\t* magick/command.c (ImportImageCommand): Don't assign a pointer to\n\tstatic constant data into an array which uses heap allocated data.\n\tAvoids a \"double free\" error when using gm import -frame.  Patch\n\tby Daniel Kobras.\n\n\t* magick/color_lookup.c (QueryColorname): XPM does not support\n\tRGBA color syntax, but it does support RGB.  Patch by Daniel\n\tKobras.\n\n\t* magick/blob.c (OpenBlob): Only form multi-part filename when\n\trequired.\n\n\t* magick/display.c (MagickXDisplayImage): The display `-update`\n\toption was only working in conjunction with the `-delay` option\n\twith a delay setting of 2 or greater.  Problem reported by Sami\n\tLiedes.  Patch by Vincent MAUGE.  Resolves Debian bug ID 414779.\n\n2010-02-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (OpenBlob): Only apply scene substitution to\n\tthe filename if adjoin is false.\n\n\t* magick/constitute.c (WriteImage): If adjoin is true, then\n\trestore original filename specification since opening the blob\n\tmodifies it.  Resolves Debian bug ID 552998.\n\n\t* magick/image.c (SetImageInfo): Don't check filename for scene\n\tsubstitution if adjoin is intentionally false.  This allows saving\n\tto file names which look like they contain a scene substitution\n\tpattern.\n\n\t* magick/command.c (MogrifyImage): Convolution failure results in\n\ta crash rather than an error report.  Resolves Debian bug ID\n\t539251.\n\n\t* magick/deprecate.c: The string constants LoadImageText,\n\tSaveImageText, LoadImagesText, and SaveImagesText should have been\n\tdeprecated, rather than being entirely removed.\n\n2010-01-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Makefile.am (install-data-html): Make sure that only the\n\tnecessary documentation files are installed.\n\n2010-01-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/inc/body.isx: Strip out executable\n\tcomponents which depend on proprietary MFC and ATL libraries.\n\tThis means that \"gmdisplay.exe\" and \"ImageMagickObject\" are no\n\tlonger distributed or installed via the Windows setup installer.\n\tWhen a new display application is developed based on open source\n\tlibraries, then the display functionality and associations can be\n\trestored.\n\n2010-01-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/transform.c (FlattenImages): Apply the image background\n\tcolor under the initial canvas image if it is non-opaque.\n\n\t* magick/composite.c (MagickCompositeImageUnderColor): New private\n\tfunction to apply a color underneath a non-opaque image.\n\n2010-01-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/prefetch.h: New header to provide wrapper macros for\n\tcompiler-specific explicit prefetch APIs.\n\n\t* magick/effect.c (BlurImageScanlines): Solid color images which\n\tonly differed in the matte channel were not being blurred.\n\n\t* magick/color.h (NotPixelMatch,PixelMatch): New macros to\n\tfully-compare a pixel, including matte.\n\n\t* magick/resource.c (SetMagickResourceLimit): Invoke\n\tomp_set_num_threads() to set thread limit if ThreadsResource is\n\trequested.\n\n\t* magick/pixel_cache.c (AllocateThreadViewSet): The number of\n\tcache views to allocate needs to be obtained from\n\tomp_get_max_threads().  Otherwise there is a crash if the number\n\tof threads is reduced from the original value.\n\n2010-01-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Released GraphicsMagick 1.3.8.\n\t\n\t* NEWS.txt: Update for the 1.3.8 release.\n\n2010-01-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/benchmarks.rst: Update benchmark report to compare\n\tperformance with ImageMagick 6.5.8-10.\n\n2010-01-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c (RotateImage, ShearImage): Ensure that errors\n\tpropagate up to the API user.  Don't overwrite a detailed\n\texception message with a generic one.  Don't return a bogus image\n\tif there is an error.\n\n2010-01-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/inc/files-base.isx: Third party\n\texecutables not included in the Visual Studio build are no longer\n\tbundled in the GraphicsMagick installer.  This means that\n\thp2xx.exe, mpeg2dec.exe, and mpeg2enc.exe are no longer\n\tdistributed.\n\n\t* www/Magick++/Image.rst: Emphasize that InitializeMagick() MUST\n\tbe invoked, and make sure that all of the examples show use of it.\n\n2010-01-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/delegate.c (InvokeDelegate): Use MagickSpawnVP() under\n\tWindows as well.\n\t(InvokePostscriptDelegate): Use MagickSpawnVP() under Windows as\n\twell.\n\n\t* magick/utility.c (MagickSpawnVP): Moved from unix_port.c.\n\tUpdated implementation to use spawnvp() rather than fork()/exec()\n\tunder Windows.\n\n\t* configure.ac: Add check for Windows spawnvp function.\n\tAdd check for process.h.\n\n\t* magick/semaphore.c (DestroySemaphore): POSIX mutex statically\n\tinitialized via PTHREAD_MUTEX_INITIALIZER should not be destroyed.\n\n\t* configure.ac: DisableSlowOpenMP is now the default.  Use\n\t--enable-openmp-slow to enable OpenMP for algorithms which\n\tsometimes run slower rather than faster.\n\n2010-01-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/version.h.in: Added MagickLibInterfaceNewest and\n\tMagickLibInterfaceOldest preprocessor defines so that applications\n\tmay easily test for library versions while compiling.\n\n2010-01-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawPolygonPrimitive): Use restrict keyword.\n\n\t* magick/pixel_iterator.c: Use restrict keyword.\n\n\t* utilities/Makefile.am: Modules are supported in the shared\n\tlibrary built so list-module.sh test should be expected to pass.\n\n\t* configure.ac: Add WITH_SHARED_LIBS conditional.\n\n2010-01-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/version.h.in: Update copyright years.\n\n\t* magick/semaphore.c: The return code from all pthread mutex APIs\n\tare now checked (not just initialize and destroy), and any error\n\tresults in an immediate fatal exit.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2011",
    "content": "2011-12-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (AcquireCacheNexus):\n\tMirrorVirtualPixelMethod was broken.\n\n2011-12-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Improve configuration support for Open64 Compiler\n\tSuite: Version 4.2.5.2 compiler with OpenMP.\n\n\t* coders/tga.c (ReadTGAImage): Assume that 32-bit TGA files have\n\tan alpha channel, even if they are not marked as such.  Fixes\n\tSourceForge issue 3466908 \"TGA with alpha\".\n\n\t* configure.ac: Revert changeset eaa27346d8e9 which tried to avoid\n\tthe OpenMP library being included multiple times because in some\n\tcases it is not included at all.\n\n2011-12-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (VersionCommand): For MSVC builds, report if\n\tSSE or SSE2 was used in the build.\n\n\t* Release GraphicsMagick 1.3.13.\n\n\t* Update libtiff to release 4.0.0\n\n2011-12-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Update libpng to release 1.5.7\n\n2011-12-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Update lcms2 to release 2.3\n\n2011-12-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Update Automake used to 1.11.2.\n\n2011-12-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/OpenMP.rst: Updated with new results, including 12-core\n\tIntel Xeon E5649 and 16-core AMD Opteron 6220 \"Bulldozer\" CPUs.\n\n\t* magick/studio.h: Enable building and running correctly with\n\tOpen64 Compiler Suite: Version 4.2.5.2 compiler with OpenMP.\n\n\t* magick/command.c (BenchmarkImageCommand): Add -rawcsv option to\n\tbenchmark to output only original data in a CSV format.\n\n2011-12-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Fix various issues noticed when cross-compiling for the\n\ti686-w64-mingw32 target.\n\n2011-12-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (ConvolveImage): For Q8 and Q16 builds use\n\t'float' rather than 'double' for computations in order to improve\n\tperformance with some compilers.\n\n2011-12-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (ConvolveImage): Special-case grayscale images\n\tfor better convolution performance.\n\n2011-12-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (BenchmarkUsage): -stepthreads now requires an\n\targument which is the increment (starting at zero) to the number\n\tof threads for each step.  This hastens benchmarking with a large\n\tnumber of cores.\n\n2011-12-07  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* coders/png.c: Eliminate use of FARDATA.  It's no longer needed\n\tand will no longer be supplied by png.h in libpng-1.6.0.\n\n2011-12-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (BenchmarkImageCommand): Added Karp-Flatt\n\tmetric to benchmark output.\n\n2011-12-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* GraphicsMagick.spec.in: Eliminate use of deprecated BuildPrereq\n\tin RPM spec file.\n\n2011-11-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (WriteImagesFile): Should set file in\n\tImageInfo based on provided parameter rather than relying on it\n\talready being set.  File argument was not being used.\n\n2011-11-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c: For packed 10 bits, datums are now represented in\n\tthe same (reversed) order for all RGB and YCbCr formats.\n\tPreviously YCbCr 4:4:4 formats were not swapping the word datums\n\tbecause the only real-world files encountered did not swap the\n\tword datums.  Resolves SourceForge bug 2057277 \"DPX 10bit CbYCr\n\tImage seems to be wrong\".\n\n\t* wand/magick_wand.c (MagickWriteImagesFile): New function to\n\tappend images to a provided file handle.  Resolves SourceForge\n\tissue 3046868 \"added MagickWriteImagesFile\".\n\n\t* magick/constitute.c (WriteImagesFile): New function to append\n\timages to a provided file handle.\n\n\t* magick/blob.c (OpenBlob): Don't rewind already open file handle\n\tpassed to OpenBlob() since we don't know the intended state of\n\tthis file handle, and because it prevents appending to an existing\n\tfile.  This change is part of the fix for SourceForge issue\n\t3046868 \"added MagickWriteImagesFile\".\n\n\t* wand/magick_wand.c (MagickSetImageSavedType): New function to\n\tallow specifying the storage type used when saving the file\n\t(rather than changing the current image characteristics).\n\tResolves SourceForge patch 3110185\n\t\"MagickGetImageSavedType()/MagickSetImageSavedType() API\".\n\t(MagickGetImageSavedType): Return the storage type which will be\n\tused when the image is saved.\n\n\t* magick/annotate.c (RenderFreetype): Add support for drawing text\n\tusing a bitmap font.  Resolves SourceForge patch 3230719 \"add\n\tsupport for drawing text with bitmap font to annotate.c\".\n\n\t* magick/profile.c (AppendImageProfile): Don't leak profile buffer\n\twhile appending a chunk to an existing profile.  Resolves\n\tSourceForge patch 3294496 \"Fix a memory leak in\n\tprofile.c(AppendImageProfile)\".\n\n2011-11-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (BenchmarkImageCommand): Include the number of\n\tthreads used in the benchmark results output.\n\t(BenchmarkImageCommand): New benchmark option -stepthreads to\n\texecute the specified command with an increasing number of threads\n\tto measure how an algorithm benefits from threading.\n\t(BenchmarkImageCommand): Fix benchmark argument parsing so it is\n\tnot order dependent.\n\t(BenchmarkImageCommand): Add a speedup indication to -stepthreads\n\toutput.\n\n\t* config/delegates.mgk.in: File names in gnuplot files need to be\n\tsurrounded by double quotes or gnuplot parser will reject them.\n\n2011-11-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (GetMedianList): Return PixelPacket via pointer\n\trather than by value.\n\n\t* version.sh: For snapshots packages, PACKAGE_CHANGE_DATE now uses\n\ta form like \"snapshot-20111121\" rather than \"unreleased\" so it is\n\tpossible to determine the vintage of an installed snapshot.\n\n2011-11-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tga.c (ReadTGAImage): Fix for poor TGA reading\n\tperformance due to excessive use of GetBlobByte().  Performance is\n\tfixed by adding local buffering.  Fixes SourceForge bug 3439531\n\t\"Slow TGA reading\".\n\n2011-11-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (AdaptiveThresholdImage): More performance\n\timprovements.\n\n2011-11-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/analyze.c (GetImageBoundingBox): Add a special case to\n\thandle absolute color comparison.\n\n2011-11-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* png: Update libpng to 1.5.6 release.\n\n2011-10-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Avoid linker warnings when building GraphicsMagick\n\tregarding OpenMP library being included multiple times.\n\n2011-10-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c (GetIPTCStream): Eliminate possible use of\n\tuninitialized data when parsing long format tag length.\n\n2011-10-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/import.c: Move low-level pixel import functions from\n\tconstitute.c to new file import.c.\n\n\t* magick/export.c: Move low-level pixel export functions from\n\tconstitute.c to new file export.c.\n\n\t* magick/floats.c: Move Richard Nolde's floating point conversion\n\tfunctions from constitute.c to new file floats.c.\n\n2011-10-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* libtool: Updated to libtool 2.4.2.\n\n\t* configure.ac: Automake conditional for HasPNG can not itself be\n\tconditional.  Indent PNG script code appropriately.\n\n2011-10-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (AUTOMAKE_OPTIONS): Distribute lzma-compressed\n\ttarball in 'xz' format rather than deprecated 'lzma' format.\n\n2011-10-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Fix syntax error with GSCMYKDevice ('==' rather\n\tthan '=').  Thanks to Glenn Randers-Pehrson for noticing and\n\treporting the issue.\n\n2011-10-12  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* Use a \"for\" loop in configure.ac to find libpngNN.\n\n2011-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/pixel_wand.c (NewPixelWand): Invoke InitializeMagick()\n\tautomatically in case user forgets to do so.\n\n\t* wand/drawing_wand.c (NewDrawingWand): Invoke InitializeMagick()\n\tautomatically in case user forgets to do so.\n\n\t* wand/magick_wand.c (NewMagickWand): Invoke InitializeMagick()\n\tautomatically in case user forgets to do so.\n\n\t* png: libpng sources were updated to release 1.5.4.\n\n2011-10-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): TIFFGetField() on\n\tTIFFTAG_OPIIMAGEID was causing a crash due to an argument\n\tmis-match between GraphicsMagick and libtiff.  Also fixed a few\n\tGCC 4.6 warnings.  Problem was reported by Dylan Millikin.\n\n2011-10-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickSetDepth): New function to set the\n\tdepth used when reading from an image format which requires that\n\tthe depth be specified in advance.\n\t(MagickReadImageBlob): Use BlobToImage() to read the blob.\n\n\t* magick/effect.c (AdaptiveThresholdImage): Reduce or eliminate\n\texpensive floating point calculations when possible.\n\n\t* wand/magick_wand.c (MagickSetFormat): New Wand function to allow\n\tsetting the file or blob format before it has been read.\n\n2011-09-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/inc/tasks-install-perlmagick.isx: Windows\n\tsetup installer now installs PerlMagick built against ActiveState\n\tPerl v5.12.4 build 1205.\n\n\t* magick/annotate.c (RenderFreetype): Eliminate spurious \"out of\n\tmemory\" exceptions due to empty text string.\n\n2011-09-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/module.c (ModuleAliases): PAM format is handled by PNM\n\tcoder.\n\n\t* jpeg: Record that jpeg sources were updated to release v8c.\n\n\t* lcms: Record that lcms sources were updated to release 2.2.\n\n\t* png: Record that png sources were updated to release 1.5.4.\n\n\t* tiff: Record that tiff sources were updated to release 4.0.0beta7.\n\n\t* xml: Record that libxml2 sources were updated to release 2.7.8.\n\n\t* zlib: Record that zlib sources were updated to release 1.2.5.\n\n\t* VisualMagick/installer/inc/body.isx: Set MagickConfigDirectory\n\tfor DLL build so that .mgk files are put in application top\n\tdirectory.  This makes installation layout between static and DLL\n\tbuilds more similar.\n\n2011-08-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/list.c (AppendImageToList): Documentation for\n\tAppendImageToList() was wrong.  Problem was reported by Brad\n\tHarder.\n\n2011-08-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/display.c (MagickXMagickCommand): Display 'save' and\n\t'print' should display useful error details.  Problem was reported\n\tby Brad Harder.\n\n2011-08-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/semaphore.c (AllocateSemaphoreInfo): Enable pthread mutex\n\terror checking if MAGICK_DEBUG is defined when the code is\n\tcompiled.  This mode helps validate that mutexes are used\n\tcorrectly.  No longer enable recursive mutexes since the\n\tGraphicsMagick logic should be able to operate without this\n\tassistance.\n\n2011-08-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (DCM_ReadOffsetTable): Fix wrong cast noticed when\n\tcompiling with LLVM.\n\n2011-08-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/enhance.c (LevelImageChannel): Fix documented prototype.\n\tProblem was reported by Brad Harder.\n\n2011-07-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (AcquireOneCacheViewPixelInlined): Only use\n\timage colormap if the image storage class is PseudoClass.\n\tEliminates a core dump when the image is in CMYK space.\n\n2011-07-20  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* coders/png.c: account for changed typecast of png_get_iCCP\n\targument in libpng15 \n\n2011-07-20  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* configure.ac: look for libpng15, libpng14, libpng12, and libpng\n\tin that order.\n\n2011-07-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* png: Update to libpng 1.5.4.\n\n2011-06-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/docutils-articles.css: Style sheet syntax fixes. Patch by\n\tMark Mitchell.\n\n\t* scripts/html_fragments.py: Use proper quoting in banner search\n\tHTML.  Patch by Mark Mitchell.\n\n2011-06-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageType): Fix documentation for enumeration\n\tnames. The types need \"Type\" as part of the name.  Problem was\n\treported by Brad Harder.\n\n2011-06-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* scripts/html_fragments.py (banner_template): HTML banner\n\timprovements to go along with style-sheet changes.\n\n\t* www/docutils-articles.css: Style-sheet improvements by Mark\n\tMitchell to work better on small screens.\n\n2011-06-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/project.rst: Add a page for links to pages about the\n\tproject.  The intention is to use this page to reduce the clutter\n\tin the banner.\n\n2011-05-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Document tiff:group-three-options define.\n\t* coders/tiff.c (WriteTIFFImage): Add support for a\n\ttiff:group-three-options define to allow power-users to set the\n\tvalue of the GROUP3OPTIONS tag.\n\n2011-05-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Makefile.am: Include Hg.*, remove CVS.*.\n\n\t* scripts/html_fragments.py (nav_template): CVS tab changed to\n\tSource, which links to Hg.html.\n\n\t* www/Hg.rst: Document Hg repository access.\n\n2011-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* scripts/rst2htmldeco.py (docutils_opts): Do not include a\n\tdatestamp of any kind since it unnecessarily churns the\n\trepository, particularly if the output file did not otherwise\n\tchange.\n\n\t* INSTALL-unix.txt: Fix typo in description of --without-lzma.\n\n2011-05-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (ReadJPEGImage): Treat exceptions thrown by\n\tjpeg_finish_decompress() as warnings rather than errors.\n\t(JPEGErrorHandler): Handle JPEG errors directly rather than\n\tpassing them to a message formatting routine for handling.  Also\n\tadded useful logging.\n\t(JPEGMessageHandler): Only handle JPEG traces and warnings.  Also\n\tadded useful logging.\n\n2011-05-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (EmitMessage): Treat an unhandled EXP marker as a\n\twarning rather than a hard error.  Resolves SourceForge issue\n\t3297995 \"Unsupported marker type 0xdf\".\n\n2011-05-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (AppendImages): If the input list only contains\n\tone image, then return a new handle to the one image in the list\n\trather than reporting an exception.  Problem was reported by Ravil\n\tRakhimgulov (\"Hunter1972\").\n\n2011-04-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageColorRegion): New function to set the\n\tconstant pixel color for a specified region of the image.\n\t(AppendImages): Only color background pixels when needed.\n\n2011-04-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Added TIFF writer support for\n\tJBIG1 compression.  Not proven to work yet.\n\n\t* magick/image.h (CompressionType): Added Group3Compression as an\n\talias for already existing FaxCompression.  Added\n\tJPEG2000Compression, JBIG1Compression, and JBIG2Compression for\n\tfuture use.\n\n2011-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: For MinGW32 use 64-bit value formatting\n\tconventions which will work with any version of the WIN32 CRT.\n\n2011-04-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (WriteJPEGImage): Properly handle errors reported\n\tby the JPEG library when writing.  Up to now, JPEG library simply\n\tinvoked exit(), which crashed or hung if driven by Magick++ API.\n\tFixes SourceForge bug 3106947 \"Assertion failure when saving an\n\t\"invalid\" image as JPEG\".\n\n\t* magick/module.c (ModuleAliases): Delete \"XTRNBSTR\"-entry. Fix by\n\tStefan Graff.\n\n\t* contrib/win32/ATL7/ImageMagickObject/ImageMagickObject.cpp\n\t(Perform): Member \"Perform\" - out-commented SafeArrayAccessData\n\tand following SafeArrayUnaccessData. Fix by Stefan Graff.\n\n\t* contrib/win32/ATL/ImageMagickObject/MagickImage.cpp: Delete\n\t\"XTRNSTREAM\"-branch because \"XTRNSTREAM\" doesn't exist\n\tanymore. Fix by Stefan Graff.\n\n\t* coders/xtrn.c: In function \"WriteXTRNImage\" there is no branch\n\tfor XTRNARRAY. Fix by Stefan Graff.\n\n\t* PerlMagick/Magick.xs: AdaptiveThreshold offset argument was\n\tbeing parsed into an 'unsigned long' rather than 'double' as it\n\tshould have been.  This resulted in inability to handle negative\n\toffsets. Fixes SourceForge bug 3288735 \"PerlMagick issue with\n\tAdaptiveThreshold\".\n\n\t* coders/jpeg.c (ReadIPTCProfile): JPEG may deliver IPTC profile\n\tin chunks but code was only allowing one chunk, even though it was\n\totherwise prepared to concatenate chunks.  Fixes SourceForge bug\n\t2978422 \"Clipping paths in JPG images are truncated\".\n\n\t* magick/utility.c (GetToken): Fix case where parser may run off\n\tend of string.  Also add asserts to check for passing null\n\tpointer.\n\n2011-04-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/channel.c (ChannelImage): Report an error if the\n\trequested channel is not compatible with the image colorspace.\n\tOnly deals with CMYK/RGB conflicts.  Resolves SourceForge issue\n\t3283046 \"Bug in CMYK\".\n\n2011-03-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/txt.c (ReadTXTImage): Throw error if attempt to read\n\tempty file.\n\n\t* coders/{fits.c,mac.c,miff.c,pcd.c,pict.c,ps3.c,rla.c,txt.c}:\n\tFormat requires seekable stream.\n\n\t* coders/pnm.c (WritePNMImage): Implement writer for PAM format.\n\n\t* coders/ept.c (WriteEPTImage): Fix error handling for case when\n\tTIFF writer fails.\n\n\t* magick/constitute.c (ReadImage): Use of GetBlobStatus() to\n\tevaluate image reader success is bogus.\n\t(MagickGetQuantumSamplesPerPixel): New private method to return\n\tthe number of samples returned per pixel for a given quantum type.\n\n2011-03-14  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* coders/png.c (WriteOnePNGImage(): Fixed a rounding error in\n\twriting the pHYs chunk (it was truncating instead of rounding).\n\n2011-02-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (MagickPanicSignalHandler,MagickSignalHandler):\n\tDon't invoke DestroyMagick() since there may be OpenMP worker\n\tthreads still running which are using data which would be\n\tdeallocated.  Instead we invoke PurgeTemporaryFiles() to remove\n\tany existing temporary files. Valgrind will report leaks if the\n\tprogram is terminated by a signal but this causes no actual harm.\n\tResolves SourceForge issue 3165456 \"^C causes semaphore failure in\n\tMacOSX\".\n\t(MagickPanicSignalHandler): Invoke abort() in panic signal handler\n\tso that we will reliably get a core dump.\n\n\t* magick/tempfile.c (PurgeTemporaryFiles): New private function to\n\tremove any existing temporary files but without destroying\n\ttemporary file semaphore.\n\n2011-02-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (ReadPNMImage): Fix mis-placed break in PAM header\n\tparser.\n\n\t* wand/magick_wand.c (MagickWriteImageBlob): Improve the\n\tdocumentation to mention the related use of MagickSetImageFormat()\n\tand MagickResetIterator().\n\n2011-02-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/xwindow.c (MagickXBestFont): Check for a few more common\n\tfont names, and ensure to always check for \"fixed\" as a final\n\tfallback.\n\n2011-02-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* config/delegates.mgk.in: Added gs-cmyk entry.  Used if '-type\n\tColorSeparation' is specified on the command-line prior to the PDF\n\tor Postscript file name.  This entry specifies use of the\n\tGhostscript PAM driver which is capable of supporting CMYK output.\n\tThis may be useful if it is desired to apply CMYK color profiles\n\tto the image returned from the PDF.  As fair warning, it seems\n\tthat Ghostscript 8.62 outputs CMYK even if the PDF was in RGB\n\tspace if the PAM driver is used.\n\n\t* coders/pnm.c (ReadPNMImage): Add support for reading netpbm's\n\tPAM format.\n\n2011-02-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwblob.c, tests/rwfile.c: Fixes to help tests work when\n\ttesting with multiple frames.\n\n\t* coders/sgi.c: SGI format is not documented to support multiple\n\tframes.  Remove the half-baked extension for it.\n\n2011-02-01  Glenn Randers-Pehrson  <glennrp@simple...>\n\n\t* coders/bmp.c (ReadBMPImage): Changed file_size greater than\n\texpected from a corrupt-image error to a debug log entry.\n\tFile_size too small is still an error, and made that so also for\n\tBI_RGB images which were previously exempted from the test.\n\n2011-01-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwblob.c, tests/rwfile.c: Validate the data in each image\n\tframe, validate that each read returns the same number of frames,\n\tand validate that the correct number of frames was ultimately\n\treturned.\n\n\t* magick/blob.c (SyncBlob): Disable bogus code which attempted to\n\treplicate the blob I/O object across all images in the list when\n\tthe blob is synced.  Leave a less bogus bit of code in place (but\n\tcommented out) in case such functionality is deemed to actually be\n\tneeded in the future.  The previous code was copying structs on\n\ttop of each other, including a pointer member to a semaphore.\n\n2011-01-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Changes.rst: Add a new Changes page to wrap up the yearly\n\tchange logs to lessen download size.\n\n\t* scripts/changelog2rst.sh: Simple utility to format ChangeLog\n\tformat into something resembling reStructuredText.\n\n\t* www/Makefile.am: Use reStructuredText to format the ChangeLog\n\tfiles to HTML so that we can inherit the improved formatting and\n\tpage style.\n\n\t* coders/pnm.c (ReadPNMImage): Support for multi-frame PNM was\n\tbotched due to on-going edits to support PAM format.\n\n2011-01-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickDescribeImage): Was sending\n\tdescriptive output to stdout rather than returning it in an\n\tallocated string as intended.\n\n2011-01-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/draw.c, wand/drawing_wand.c (MvgPrintf): Update to handle\n\tC99 vsnprintf() return values.\n\n\t* magick/draw.c, wand/drawing_wand.c (DrawAnnotation): Linux\n\tglibc does not pass extended text characters if \"%.1024s\"\n\tformatting convention is used.  Apparently it assumes that such\n\tcharacters may be UTF8 and returns -1 rather than outputting the\n\tstring, even if it is assured to fit.\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2012",
    "content": "2012-12-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Added -auto-orient to 'convert' and 'mogrify'\n\tto automatically rotate the image upright for viewing based on its\n\tcurrent orientation setting.\n\tAdded -orient to support setting the image orientation.\n\n\t* magick/shear.c (AutoOrientImage): New function to automatically\n\torient the image so that it is upright for normal viewing.\n\n2012-12-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* scripts/tap-functions.shi: Tidy TAP tests so that they may be\n\trun alone, or via Perl's 'prove'.\n\n2012-12-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwfile.c (main): Test file name generation was not\n\tcorrect.\n\n2012-12-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwfile.tap: Added -stdio tests for most file formats.\n\tThis tests I/O using an already-opened file handle passed via the\n\tImageInfo file member.  Formats using the Ghostscript delegate are\n\tnot working right yet.\n\n2012-12-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwfile.c (main): Added a '-stdio' option to test\n\treading/writing files using file handles opened by the API user.\n\n\t* magick/blob.c (CloseBlob): It should be possible to invoke\n\tCloseBlob() multiple times, including blobs set to \"exempt\".\n\tThere were some issues when passing in file descriptors.\n\n2012-12-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/api/api.rst: Add another example Core C API example program.\n\n\t* magick/blob.c (OpenBlob): Restore file position, rather than\n\trewind, after reading header bytes.\n\n\t* magick/image.c (SetImageInfo): Restore file position after\n\treading header bytes.  Resolves SourceForge issue 3597486\n\t\"ReadImage not working with file descriptors\".\n\n2012-12-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick: WIN64 (64-bit Windows) installer improvements to\n\tbring up to par with 32-bit installer.\n\n2012-12-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick: WIN64 (64-bit Windows) is supported now.\n\n2012-12-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c: Eliminate support for experimental\n\tMAGICK_MMAP_WRITE, which never quite worked correctly and did not\n\tprovide performance benefits.\n\n2012-12-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (FileToBlob): Rewrite to be based on stdio.\n\n2012-12-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick_types.h.in: Changes to try to work better with the\n\tWindows WIN64 API.\n\n2012-12-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageColorRegion): The provided color should\n\tbe in the same colorspace as the image.  The image is no longer\n\tconverted to RGB with the expectation that the provided color is\n\talways some particular RGB.\n\t(AppendImages): No longer transform the canvas image to RGB.  Now\n\tappend uses the first listed image to determine the colorspace\n\twhich should be used when appending the additional images and of\n\tthe output image.  The additional images are converted to the\n\tcanvas image colorspace.  Likewise, the background color is\n\tassumed to be in the same colorspace as the first listed image so\n\tthat it is compatible and can be used to fill the background color\n\twithout translation.\n\n2012-11-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* rungm.sh.in: Remove extraneous space in first line which\n\tprevents execution with T-shell (tsch).  Reported by William\n\tLangdon.\n\n2012-11-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/wand/wand.rst: Add a simple example of using the Wand API.\n\n2012-11-21  Glenn Randers-Pehrson  <glennrp@simplesystems.org> \n\n\t* coders/bmp.c (ReadBMPImage): Fixed an old bug with decoding\n\tchromaticity primaries.\n\n2012-11-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.h (\"C\"): Need to include wand/wand_symbols.h\n\tafter magick/api.h in order for options from magick_config.h to\n\ttake effect.\n\n\t* magick/symbols.h (PSPageGeometry): Fix typo. Should map to\n\tGmPSPageGeometry.\n\n2012-11-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/wand_symbols.h, magick/symbol.h: MagickWand API is now\n\tprefixed with 'Gm' when the --enable-symbol-prefix configure\n\toption is supplied.  These changes are contributed by Ben Wu.\n\tDetails of changes are as follows:\n\n\t1. A new header file wand/wand_symbols.h which prefixes all\n\t   MagickWand API symbols with Gm.\n\t2. Modification to all the header files in wand/ to include\n\t   wand_symbols.h.\n\t3. Modification to magick/symbols.h to include additional\n\t   symbols which were colliding with names in ImageMagick.\n\t4. Modification to magick/error.c to exclude function\n\t   definitions for MagickError, MagickFatalError,\n\t   MagickWarning, and ThrowException when building with\n\t   --enable-symbol-prefix option. There four names were also\n\t   defined as macros so it appears that putting them in a\n\t   symbol-remapping file wont work.\n\n\t* Makefile.am: Update Automake to 1.12.5.\n\n2012-11-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/COPYING: Change Magick++ usage license to be exactly\n\tthe MIT license without the additional sentence about retention of\n\tcopyright (which was already legally implicit).\n\n2012-11-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/symbols.h: Re-generate list of symbols to prefix.\n\n\t* magick/utility.c (IsGlob): IsGlob can be more efficient.\n\n\t* magick/floats.c: Use compile-time selection of endian-specific\n\tcode rather than run-time.  Fix cast warning with 64-bit builds.\n\n2012-11-07  Glenn Randers-Pehrson  <glennrp@simplesystems.org> \n\n\t* coders/png.c (WriteOnePNGImage): The wrong QuantumType was\n\tsometimes passed to ExportImagePixelArea() by the PNG encoder.\n\n\t* coders/png.c (ReadOnePNGImage): Let libpng unpack all sub-8-bit\n\tpixels (see change of 2012-08-31 which lets libpng unpack sub-8-bit\n\tpalette images; this also lets libpng unpack the grayscale images).\n\n\t* coders/png.c (ReadOnePNGImage): Corrected the reading of interlaced\n\timages (see SourceForge bug 3420695, in which all passes are\n\tdisplayed in a garbled manner instead of only the completed image).\n\n2012-10-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickGetImagePage): Need to use 'image'\n\trather than 'images' in order to work with iterator.\n\t(MagickSetImagePage): Need to use 'image'\n\trather than 'images' in order to work with iterator.\n\n2012-10-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (TranslateTextEx): Fix bug with input string\n\tread overrun if the input string ends with a single '%'.  This\n\tsometimes caused random heap data to be added to the output string\n\tuntil another null character is reached.  A simple work-around\n\twithout this fix is to use \"%%\" rather than \"%\".  Fixes\n\tSourceForge bug 3580219 \"strange results with '%' in Annotate()\".\n\n2012-10-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickSetImagePage): New method to support\n\tsetting the image page size and offsets.\n\t(MagickGetImagePage): New method to support getting image page\n\tsize and offsets.\n\n2012-10-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Report fatal error if doing modules build and\n\tlibltdl is not found.\n\n2012-10-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ltdl: Libltdl is no longer bundled.  Libltdl must be previously\n\tinstalled on the system in order to build the modules\n\tconfiguration.\n\n2012-10-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/index.rst: Update top index page for 1.3.17 release.\n\n\t* NEWS.txt: Update NEWS for 1.3.17 release.\n\n\t* version.sh: Update shared library versioning for 1.3.17 release.\n\n\t* coders/jnx.c: Fix format string compilation warnings.  Remove\n\tMS-DOS line terminations.\n\n\t* configure.ac: Module loading is now only supported by the\n\tmodules build and not just because shared libraries are enabled.\n\tThis means that libltdl is only depended upon by the modules\n\tbuild.  Sometime in the future, libltdl will no longer be bundled\n\tin the GraphicsMagick source tree.\n\n2012-10-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac (LTDL_INIT): Request installable libltdl rather\n\tthan convenience.\n\n2012-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c: Support alpha channel in uncompressed 32-bit BMP.\n\tResolves SourceForge issue 3566239 \"Can't open BMP with alpha\n\tcreated by photoshop\".\n\n2012-10-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* dcraw/dcraw.c: Fixed situation when M_PI is not defined.\n\n2012-10-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/jnx.c: Add image attribute with geolocation.\n\n2012-10-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* dcraw: VisualMagick configure fixes to support linking with JPEG\n\tand JPEG2000.\n\n2012-09-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* dcraw: Add dcraw to VisualMagick build.\n\n\t* libxml: Update libxml2 to 2.9.0 release.\n\n2012-09-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff: Update libtiff to 4.0.3 release.\n\n\t* lcms: Update liblcms2 to 2.4 release.\n\n\t* png: Update libpng to 1.5.13 release.\n\n2012-09-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am: Update to Automake 1.12.4.\n\n2012-09-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Fix Debian bug 687738 \"graphicsmagick:\n\trepeated words suitable for suitable for in gm manpage\" reported\n\tby Jonas Smedegaard.\n\n2012-09-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update with news since last release.\n\n\t* configure.ac: Added the configure option\n\t--enable-quantum-library-names to enable that shared library name\n\tincludes quantum depth to allow shared libraries with different\n\tquantum depths to co-exist in same directory (only one can be used\n\tfor development).\n\n2012-09-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (AdaptiveThresholdImage): New implementation\n\tcontributed by Roberto de Deus Barbosa Murta.  Executes in linear\n\ttime as threhold area is increased rather than being quadratic.\n\n2012-09-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c: Fix improper injection of XML headers as rendered\n\ttext.\n\n\t* magick/render.c (DrawImage): Fix SourceForge issue 3499164\n\t\"Drawing of text fails if text starts with \",\" character\".  Fix\n\tSourceForge issue 3411492 \"Certain SVGs hang GraphicsMagick\".  Fix\n\tSourceForge issue 1961000 \"Could not print ',' via convert draw\n\ttext\".\n\n2012-09-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c (lite_font_stringwidth): Simply return zero.\n\tReturning a computed string width was causing text placement\n\tproblems when testing with libwmf's fulltest.wmf.\n\n2012-08-31  Glenn Randers-Pehrson  <glennrp@simplesystems.org> \n\n\t* coders/png.c: ReadOnePNGImage: sub-8-bit palette images were\n\tgetting unpacked twice; once by libpng via png_set_packing()\n\tand again by coders/png.c in a switch() statement around line 2500,\n\tresulting in horizontally stretched pixels.\n\n2012-08-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (AUTOMAKE_OPTIONS): Include lzip as a distribution\n\tformat again.\n\n2012-08-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: BrowseDelegate now defaults to 'xdg-open', but if\n\tit is not found, then configure will search for firefox,\n\tgoogle-chrome, mozilla (in that order).\n\n2012-08-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: For testing on MinGW, assume that Postscript is\n\tavailable since we don't have a good way to check for that.\n\n\t* scripts/tap-functions.shi (test_count): Always execute the test\n\tprogram rather than skipping execution since we want to make sure\n\tthe test program fails correctly as well.\n\n\t* coders/gif.c (DecodeImage): Add a log message for attempted LZW\n\tstring data table overflow.\n\n2012-08-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (ConvolveImage): Allocate normalized convolution\n\tkernel using cache-line aligned memory allocator.\n\n\t* configure.ac: Remove support for legacy LZWDecodeDelegate and\n\tLZWEncodeDelegate since these are not used any more.\n\n2012-08-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* scripts/tap-functions.shi: If a test declares that it needs\n\tcertain features, skip the test if required features are not\n\tavailable.\n\n\t* configure.ac: Build a supported features list and save to\n\tcommon.shi script for use by test scripts.\n\n\t* Makefile.am (LOG_COMPILER): Run Bourne-shell based TAP scripts\n\twith the same shell $(SHELL) that configure selected for the\n\tMakefile to use.\n\n2012-08-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (AUTOMAKE_OPTIONS): Update to Automake 1.12.3.\n\tUpdate test suite to use Automake TAP driver rather than legacy\n\ttests.\n\n2012-08-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jnx.c (ExtractTileJPG): Add a trace of tile offset and size.\n\n2012-08-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jnx.c (ExtractTileJPG): Use a memory buffer for the JPEG\n\ttile rather than a temporary file.\n\n2012-08-12  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n        * PerlMagick/t/input_jnx.jnx: Small JNX test file.\n\n2012-08-11  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/jnx.c: speedup.\n\n2012-08-10  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/jnx.c: changed malloc/free to MagickMalloc/MagickFree.\n\n2012-08-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jnx.c (ReadJNXImage): Add progress monitor support for\n\tJNX.\n\n2012-08-06  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/jnx.c: Image cache is turned off to work-around memory\n\toverflow.\n\n2012-08-05  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/jnx.c: Fixed.\n\n2012-08-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jnx.c: Add JNX coder for \"Garmin proprietary Image\n\tFormat\" (implementation by Jaroslav Fojtik) to the build.  Code is\n\tnot yet working properly at this time.\n\n2012-08-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Remove use of -Wl,-zlazyload under Solaris since\n\tit seems to decrease the stability of C++ exceptions in x86-64\n\tbuild and does not measurably improve runtimes.  Don't force use\n\tof liblzma because libtiff is used.  User should always have\n\tcontrol.\n\n2012-07-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/memory.c (MagickMallocAligned): Use RoundUpToAlignment()\n\tmacro to compute aligned pointer.\n\n\t* magick/effect.c (EnhanceImage): Eliminate use of ugly Enhance\n\tmacro.  Only filter based on color channels (ignore opacity).\n\n2012-07-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h (MAGICK_CACHE_LINE_SIZE): Assume a cache line\n\tsize of 64 bytes except for on PowerPC which uses 128.\n\n\t* magick/pixel_cache.c: Use aligned memory allocator to allocate\n\tstructures and buffers which might suffer from false cache line\n\tsharing\n\n\t* magick/memory.c (MagickMallocAligned): Also round up allocation\n\tsize to alignment.\n\n2012-07-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c, magick/random.c, magick/semaphore.c: Use\n\taligned memory allocator to align allocations which should be\n\taligned to cache line boundary.\n\n2012-07-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/memory.h (MagickAllocateAlignedMemory): New macro to\n\tallocate aligned memory.\n\t(MagickFreeAlignedMemory): New macro to free aligned memory.\n\n\t* magick/memory.c (MagickMallocAligned): New internal function to\n\tallocate aligned memory.\n\t(MagickFreeAligned): New internal function to free aligned memory.\n\n2012-07-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/common.h (MAGICK_ASSUME_ALIGNED): Add some GCC attribute\n\twrappers for useful features added by GCC 4.7.\n\n2012-07-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (ReadGIFImage): Try to be better about reporting\n\tfailure when ReadBlob() fails to return the requested number of\n\tbytes.\n\n2012-06-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/benchmarks.rst: Strip the outdated benchmark results from\n\tthe benchmarks page.\n\n\t* magick/command.c (ImportImageCommand): Status returned from the\n\tcommand was inverted.\n\n2012-06-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Release GraphicsMagick 1.3.16\n\n2012-06-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): -units was adjusting existing\n\tresolution the wrong way around.\n\n2012-06-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* jpeg: Updated to IJG 8d release.\n\n\t* libxml: Updated libxml to 2.8.0 release.\n\n\t* zlib: Updated zlib to 1.2.7 release.\n\n\t* magick/blob.c (MagickFileHandle): Refer to stdio, bzip2, and\n\tgzip file handles using their own type.  Eliminates warnings\n\tobserved when compiling with zlib 1.2.7.\n\n\t* tiff: Updated libtiff to 4.0.2 release.\n\n\t* png: Updated libpng to 1.5.11 release.\n\n2012-06-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Fix typo which caused the --without-lzma option to\n\tbe handled incorrectly.  Resolves SourceForge issue 3535309\n\t\"graphicsmagick from 1.3.13 to 1.3.15 has broken lzma support\".\n\n2012-06-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwfile.c (main): Verify that we can 'ping' the file using\n\tPingImage().  Tests for some formats may take longer to complete.\n\n\t* tests/rwblob.c (main): Verify that we can 'ping' the blob using\n\tPingBlob().  Tests for some formats may take longer to complete.\n\n\t* coders/xbm.c (ReadXBMImage): Fix memory leak of temporary X\n\tbitmap image allocation encountered when reading in 'ping' mode.\n\n\t* magick/blob.c (PingBlob): Re-write to be based on BlobToImage()\n\tso that it works reliably.\n\t(BlobToImage): Restore original input file name to image if\n\ttemporary file was used so that image 'filename' and\n\t'magick_filename' do not contain unexpected content due to using a\n\ttemporary file.\n\n2012-06-07  Glenn Randers-Pehrson  <glennrp@simplesystems.org> \n\n\t* coders/png.c: Disable new libpng-1.5.10 test for invalid palette\n\tindex when reading a PNG or MNG (for speed), or when writing a MNG\n\t(because a zero-length PLTE is valid in a MNG).\n\n2012-06-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (SetImageAttribute): Don't translate\n\t'comment' and 'label' attributes if the request is made while a\n\tfile is being read.  This is a temporary workaround until there is\n\topportunity to modify the architecture so that there is a clear\n\tsplit between user-provided settings and values obtained from the\n\tinput image.\n\n\t* magick/blob.c (GetBlobIsOpen): New function to return if blob is\n\tcurrently open.\n\n2012-06-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/typemap: Add typemap file needed by Perl 5.16.\n\tResolves SourceForge issue 3531512 \"PerlMagick does not build with\n\tperl 5.16\".\n\n2012-05-29  Glenn Randers-Pehrson  <glennrp@simplesystems.org> \n\n\t* coders/png.c: Ignore APNG chunks even if we are using a libpng\n\tthat was built with the \"APNG patch\".\n\n2012-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (ConvertImageCommand): +repage does not require\n\tan argument.  Resolves SourceForge issue 3529158 \"+repage option\n\tnot respected with convert command\".\n\n\t* configure: Update to Autoconf 2.69.\n\n\t* magick/effect.c (MotionBlurImage): Motion blur does scale so\n\tremove DisableSlowOpenMP for it.\n\n\t* magick/command.c (BenchmarkImageCommand): Remove parenthesis\n\tfrom output, and change \"iter/sec cpu\" to \"iter/cpu\" to ease\n\tparsing.\n\n\t* magick/pixel_cache.c (GetPixelCacheInCore): Consider read-only\n\tmemory-mapped cache as being \"in-core\".  Otherwise MPC input files\n\tare penalized.\n\n2012-05-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/api.h: Include <sys/types.h> on POSIX systems in order to\n\thelp assure that 'size_t' and 'ssize_t' are declared.\n\n2012-05-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick_config_api.h.in: Need to provide definitions for\n\t'size_t' and 'ssize_t' in case the system headers lack these types\n\tbecause the definition of MagickExtentImage() requires them.  This\n\tshould resolve PHP bug #62034 \"gmagick does not compile\".\n\n2012-05-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_iterator.c (GetRegionThreads): Don't thread region\n\tif it is not memory-based.\n\n2012-05-09  Glenn Randers-Pehrson  <glennrp@simplesystems.org> \n\n\t* coders/png.c (ReadOnePNGImage): make transparent_color elements\n\tunsigned long instead of unsigned short, so 65537 is actually out of\n\trange as expected, and won't match any pixel if no tRNS chunk is\n\tpresent.\n\n2012-05-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sfw.c (ReadSFWImage): Reader needs to be more robust\n\tagainst corrupt or maligned headers.  Resolves SourceForge issue\n\t\"sfw file crash\".\n\n2012-05-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Add file basename as the PDF\n\tdocument title.  Resolves SourceForge bug ID 2835140\n\t\"GraphicsMagick fails to add title attribute to PDF output\".\n\n\t* coders/sfw.c (ReadSFWImage): Restore original filename and\n\tformat.\n\n\t* PerlMagick/t/jpeg/read.t: Add a test for reading Seattle\n\tFilmWorks format based on the sample image from\n\thttp://www.algonet.se/~cyren/sfw/.  Image was approved for\n\tdistribution in GraphicsMagick by Bengt Cyrn.\n\n\t* magick/analyze.c (GetImageBoundingBox): Only apply opacity-based\n\tbounding box detection if all three test points are non-opaque and\n\tthe same value.  Resolves SourceForge bug ID 3522804 \"convert\n\t-trim fails on 8-bit PNG that ImageMagick can trim\".\n\n\t* coders/sfw.c (ReadSFWImage): Fix variety of bugs related to\n\tclosing Image and blob at wrong points.  SFW reader is working\n\tagain.  Resolves SourceForge bug ID 523430 \"sfw file open failed\".\n\n2012-05-01 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Animated movies inside 4D matrices are loaded now.\n\n2012-04-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_iterator.c: Limit the number of threads to use in\n\tthe loop rather than the total number of threads available.\n\n2012-04-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Release GraphicsMagick 1.3.15\n\n2012-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageInfo): Remove automatic adjoin mode\n\tsupport logic.\n\t(AddDefinition): Fix use of uninitialized variable.\n\n2012-04-23  Glenn Randers-Pehrson  <glennrp@simplesystems.org> \n\n\t* doc/*.imdoc: some example commandlines in the documentation\n\twere missing the leading \"gm \".\n\n2012-04-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (FormMultiPartFilename): No longer add a\n\tprintf-style scene formatting specification to filenames which do\n\tnot have one and no longer automatically operate in 'adjoin' mode\n\tin such cases.  This is a BIG CHANGE for users who may have become\n\tused to this automatic functionality.  The simple solution to\n\tupdate existing scripts depending on this behavior is to change\n\tany bare filenames to include a format specification similar to\n\t\"image-%d.jpg\" and add +adjoin to the command line.  The reason\n\twhy this change is made is that the output files produced by any\n\tgiven operation were unpredictable, and it was causing temporary\n\tfiles to be leaked due to the renaming.\n\n2012-04-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (WriteBMPImage): Enforce that image width and\n\theight do not exceed BMP dimensions.  BMP dimensions are\n\trepresented by a signed type.  BMPv2 supports maximum dimensions\n\tof 32k by 32k.\n\n2012-04-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/info.c (WriteINFOImage): When driven by the 'convert'\n\tutility, -format produces user-controlled formatted output similar\n\tto -format in 'identify'.  This is accomplished via a\n\t'info:format=value' define.\n\n\t* magick/image.c (AddDefinition): New function for adding just one\n\tdefine to definitions list.\n\n2012-04-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (ReadPNMImage): Completely disable OpenMP in reader\n\tbecause there is too much contention.\n\n\t* magick/pixel_iterator.c: Dereference image to be modified in\n\tnon-threaded context in order to lessen contention.\n\n\t* magick/semaphore.c (AllocateSemaphoreInfo): Make sure that\n\tSemaphoreInfo does not share cache lines with another semaphore.\n\n2012-04-11  Glenn Randers-Pehrson  <glennrp@simplesystems.org>\n\n\t* coders/png.c: fixed problem with bit depth when the encoder\n\tdecides to write RGBA instead of indexed PNG, by delaying the\n\tcall to png_set_tRNS() until after calling png_set_IHDR().\n\n2012-03-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* png: Update bundled libpng to 1.5.10 release.  Provides security\n\tfix for CVE-2011-3048.\n\n\t* wand/magick_compat.c (ParseGeometry): Use strlcpy() rather than\n\tstrncpy().\n\t(CopyMagickString): Depend on strlcpy() because we provide it if\n\tit is missing.\n\t(ConcatenateMagickString): Depend on strlcat().\n\n\t* coders/xcf.c (ReadXCFImage): Now respects image subimage and\n\tsubrange members so that returned image layers may be selected.\n\tBased on patch from SourceForge issue 3513025 \"XCF reads all\n\tlayers all the time\".\n\n\t* magick/resize.c (ThumbnailImage): Thumbnail default filter is\n\tintended to be the box filter, but allow the user to override the\n\tfilter used.  Resolves SourceForge issue 3513239 \"-filter command\n\tline argument ignored\".\n\n2012-03-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (ConvertImageCommand, MogrifyImageCommand):\n\tAdded support for '+noise random' and '-operator noise-random' to\n\t'convert' and 'mogrify'.\n\n\t* magick/effect.c (AddNoiseImage): Added support for RandomNoise.\n\t(AddNoiseImageChannel): Added support for RandomNoise.\n\n\t* magick/enum_strings.c (StringToNoiseType): New function to\n\tconvert a string to a NoiseType enumeration value.\n\t(NoiseTypeToString): New function to convert a NoiseType\n\tenumeration value into a string.\n\n\t* PerlMagick/Magick.xs: Added support for RandomNoise.\n\n\t* magick/operator.c (QuantumOperatorRegionImage): Added support for\n\tRandomNoise.\n\n\t* magick/effect.c (AddNoiseImageChannel): Added support for\n\tRandomNoise.\n\n\t* magick/gem.c (GenerateDifferentialNoise): Added support for\n\tRandomNoise.\n\n\t* magick/random.h (MagickRandomRealInlined): The span of\n\tMagickRandomRealInlined() is now slightly more accurate.\n\n\t* magick/image.h (enum NoiseType): New enumeration value RandomNoise.\n\n2012-03-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): Add support for -repage option\n\tto composite, convert, mogrify, and montage subcommands.  Resets\n\tor adjusts the current image page offsets based on a provided\n\tgeometry specification.\n\n\t* magick/image.c (ResetImagePage): Add a function to adjust the\n\tcurrent image page canvas and position based on a relative page\n\tspecification.\n\n2012-03-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImage): Add support for -strip option\n\tto composite, convert, mogrify, and montage subcommands.  Removes\n\tall profiles and text attributes from the image.\n\n\t* magick/image.c (StripImage): New function to remove all profiles\n\tand text attributes from the image.\n\n2012-02-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Release GraphicsMagick 1.3.14.\n\n\t* NEWS.txt: Updated to describe updates since last release.\n\n2012-02-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Downgrade to Automake 1.11.2 so that test suite can run on\n\tsystems with limited command line length.  This means that lzip\n\tsupport is temporarily removed.\n\n\t* magick/resize.c (ResizeImage): Resize filter argument was being\n\tignored.  Filter from image 'filter' member was used instead.\n\tProblem was reported by Steven Bakhtiari.\n\n2012-02-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff: Update bundled libtiff to 4.0.1 release.\n\n\t* png: Update bundled libpng to 1.5.9 release.\n\n\t* magick/memory.h: Decorate memory allocation functions with GCC\n\tattribute 'alloc_size'.\n\n\t* magick/common.h: Add support for GCC 4.3+ attributes\n\t'alloc_size', 'hot', 'cold'.\n\n\t* magick/{log.h,monitor.h,utility.h}: Use double-underscore syntax\n\tin GCC format attribute specifications to defend against\n\taccidental macro expansion.\n\n2012-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c (ReadXCFImage): Fix reading XCF which is comprised\n\tof different sized layers.\n\n2012-02-08  Glenn Randers-Pehrson  <glennrp@simplesystems.org>\n\n\t* coders/txt.c: Added \"-define txt:with-im-header\" option.\n\n2012-02-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* png: Updated to libpng 1.5.8 release\n\n\t* zlib: Updated to zlib 1.2.6 release\n\n2012-02-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (AUTOMAKE_OPTIONS): Update to Automake 1.11.3.  Add\n\tlzip compressed archive to options.\n\n2012-01-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcraw.c (RegisterDCRAWImage): Add support for Mamiya\n\tPhoto RAW \"MEF\" format.  Resolves SourceForge issue #3481508\n\t\"*.MEF file open incorrect\".\n\n2012-01-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (WriteJPEGImage): Convert RGB-compatible\n\tcolorspaces (e.g. CineonLog) to RGB by default since that was the\n\tcase prior to release 1.3.13.  User can still override it\n\t(avoiding removal of log encoding) by explicitly specifying the\n\tdesired colorspace.  Problem was reported by Gary Margiotta.\n\n2012-01-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): When reading, save input file\n\tendianness so that the endianness of the original file is\n\tpreserved by default.  The user is able to override this default\n\tvia -endian.  Problem was reported by JongAm Park.\n\n2012-01-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/OpenMP.rst: Updated OpenMP results based on latest OpenMP\n\ttunings and the Intel Xeon E5649 CPU.\n\n2012-01-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcraw.c (ReadDCRAWImage): Fix memory leak of ImageInfo.\n\tResolves SourceForge bug #3475148 \"memery leaks\".\n\n\t* magick/module.c (ModuleAliases): EMF format is supported by EMF\n\tmodule and so mapping EMF to the WMF module caused EMF not to\n\twork.  Resolves SourceForge bug #3475147 \"emf files can not be\n\topened\".  Note that the EMF module only works for Microsoft\n\tWindows.\n\n2012-01-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gem.c (Hull): Improve performance.\n\n\t* magick/effect.c (DespeckleImage): Improve performance.\n\n2012-01-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/effect.c (DespeckleImage): Using schedule(static,4)\n\tblocks any opportunity for speedup.  This was a performance\n\tregression.  Oops!\n\n2012-01-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickExtentImage): Added\n\tMagickExtentImage() to Wand API.  Resolves SourceForge issue\n\t#3471915 \"MagickExtentImage in the Wand C API\".\n\n2012-01-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/export.c (ExportViewPixelArea): Break up implementation\n\tinto subroutines to ease compilation.\n\n2012-01-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/import.c (ImportViewPixelArea): Break up implementation\n\tinto subroutines to ease compilation.\n\n2012-01-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h: Use Magick prefixed macro names for ftruncate,\n\tmmap, and munmap in order to assure that introducing our macros\n\tdoes not cause trouble with system headers.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2013",
    "content": "2013-12-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Update for 1.3.19 release.\n\n\t* www/index.rst: Update for 1.3.19 release.\n\n\t* NEWS.txt: Update for 1.3.19 release.\n\n\t* magick/blob.c (GetBlobTemporary): Add assertions to assure that\n\timage and blob are valid structures.\n\n\t* coders/png.c (ReadOnePNGImage): Fix problem peculiar to Q8 build\n\twith reading 1-bit PNG files.\n\n\t* PerlMagick/t/png/(write-16.t, read.t, write-16.t, write.t):\n\tUpdate expected signatures\n\n\t* coders/xpm.c (WriteXPMImage): Limit XPM color resolution to what\n\tXPM can traditionally handle.\n\n\t* magick/enhance.c (GammaImage): Eliminate a compiler warning.\n\n\t* coders/png.c (ReadOnePNGImage): Eliminate a compiler warning.\n\n\t* coders/pcl.c (WritePCLImage): Eliminate a compiler warning.\n\n2013-12-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/delegate.c (InvokePostscriptDelegate): Log return status.\n\n\t* magick/nt_base.c (NTGhostscriptFonts): For Microsoft Windows,\n\talso search c:\\gs\\fonts for Ghostscript font files.\n\n\t* coders/ept.c (ReadEPTImage): Fix crash observed when Ghostscript\n\tfails to produce output.\n\n2013-12-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/annotate.c: Simplify FreeType2 header inclusion.\n\n\t* configure.ac: Only test for freetype/freetype.h if ft2build.h\n\twas not found.\n\n2013-12-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ttf: Update FreeType to release 2.5.2.\n\n\t* Updated build to use Automake 1.14.1.\n\n2013-12-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* libxml: Update libxml2 to release 2.9.1.\n\n2013-12-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* lcms/include/lcms2.h: Update lcms to release 2.5.\n\n\t* png/README: Update PNG library to release 1.6.8.\n\n\t* jpeg: Update Windows IJG JPEG library to release 9.\n\n2013-12-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/alpha_composite.h (BlendCompositePixel): Fix from Troy\n\tPatteson to eliminate induced color problems when compositing two\n\timages which include fully transparent pixels.  Now fully\n\ttransparent pixels do not contribute any color to the composed\n\tresult. Opacity used when blending is now based on the average\n\topacity of both pixels.  Resolves SourceForge issue #148 \"Pixel\n\tinterpolation problem with rotated transparent images \".\n\n2013-12-18  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Properly scale 16-bit input\n\tPNG down to 8-bit when using a Q8 build.\n\n2013-12-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/demo/piddle.cpp (main): Use DrawableDashArray to make\n\tsure that it works.\n\n\t* wand/drawing_wand.c (DrawSetStrokeDashArray): Fix defective\n\tstroke-dasharray MVG generation.  Resolves SourceForge issue \"#255\n\tDrawSetStrokeDashArray still fails\".\n\n\t* magick/draw.c (DrawSetStrokeDashArray): Fix defective\n\tstroke-dasharray MVG generation.\n\n2013-12-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c: Add value scaling changes which will be necessary\n\tto support all the build depths supported by IJG JPEG 9a.\n\n\t* coders/webp.c (ReadWEBPImage): Support 'ping'. Improve quality\n\tof error reporting.\n\n\t* GraphicsMagick.spec.in: Update RPM spec file to add\n\tlibwebp-devel as a build dependency, and libwebp as a run-time\n\tdepdendency.\n\n2013-12-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/webp.c: Incorporated simple WebP support as contributed\n\tby \"TIMEBUG\" at users.sf.net plus a few security changes. Does not\n\tyet support Windows Visual Studio build, input from a pipe,\n\tattached profiles, animation, or incremental pixel I/O.\n\t(RegisterWEBPImage): Register WebP as requiring seekable stream so\n\tinput from pipe works.\n\n2013-11-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/drawing_wand.c (DrawSetStrokeDashArray): Use array size\n\tspecified by user and don't expect user-provided array to be\n\tterminated by 0.0.  Resolves SourceForge bug \"#250 Unexpected\n\tresults from DrawSetStrokeDashArray\".\n\n\t* magick/draw.c (DrawSetStrokeDashArray): Use array size specified\n\tby user and don't expect user-provided array to be terminated by\n\t0.0.\n\n\t* wand/drawing_wand.c (DrawGetStrokeDashArray): terminating 0.0 to\n\tarray returned to user.\n\n\t* magick/draw.c (DrawGetStrokeDashArray): Add terminating 0.0 to\n\tarray returned to user.\n\n2013-11-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/annotate.c (RenderFreetype): Support rendering UTF-8\n\t21-bit code points.  Was limited to 16-bit code points due to an\n\toversight/bug.  Resolves SourceForge bug \"#149 Rendering UTF-8\n\tencoded file displays wrong glyphs\".\n\n2013-11-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ReadImage): Consistently initialize Image\n\tpage width and height to image width and height. Resolves\n\tSourceForge bug #253 convert pdf output page is the wrong size\n\twith -geometry \"100%\".\n\n2013-11-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): TIFFDefaultStripSize() sometimes\n\treturns zero so make sure that rows-per-strip is at least one to\n\tavoid divide by zero error.  This bug was added in the current\n\tdevelopment cycle.\n\n2013-10-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update news since last release.\n\n\t* magick/annotate.c (RenderFreetype): Support Johab, Latin-1, and\n\tLatin-2 encodings.\n\n2013-10-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/drawing_wand.c (DrawSetStrokeLineJoin): BevelJoin should\n\tproduce MVG text \"bevel\".\n\n\t* magick/draw.c (DrawSetStrokeLineJoin): BevelJoin should produce\n\tMVG text \"bevel\".  Fixes SourceForge bug \"#245 error occured to\n\tDrawableStrokeLineJoin(LineJoin.BevelJoin)\".\n\n2013-10-16  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* Added calls to png_set_benign_errors() to allow benign errors\n\tto be handled as warnings.  In particular, GM builds with libpng-1.6.x\n\twill not crash while copying a PNG with a \"known incorrect ICC\n\tprofile\".\n\n2013-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (NTGhostscriptEXE): Use gswin64c.exe as\n\tGhostscript executable name in a 64-bit application.\n\n2013-10-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (NTGhostscriptFind): 64-bit application should\n\tnot search for Ghostscript in 32-bit registry.  SourceForge bug\n\t#243 \"GM on Windows will find Ghostscript only if both are 32 bit\"\n\n2013-09-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c: As an extension to the standard PNM and PAM\n\tformats, support writing 32-bit sample depth in the Q32 build, and\n\tsupporting reading 32-bit sample depth in all builds.\n\n2013-09-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c: Allow reading signed integer TIFF files even\n\tthough internal storage uses signed integers.  Negative values\n\twill be handled incorrectly and positive values will be scaled to\n\tonly 1/2 of the available unsigned range.  Perhaps the situation\n\twill improve in the future.\n\n\t* tests/rwfile_miff.tap: Test MIFF with specific depths.\n\n\t* tests/rwblob.c: Add support for -quality option.\n\n\t* tests/rwfile.c: Add support for -quality option.\n\n\t* tests/rwfile.tap: Add tests for PGM and PPM ASCII subformats.\n\n\t* coders/pnm.c (WritePNMImage): PGM \"P2\" format writer was broken\n\tat 8-bit depth due to lack of white-space between the output\n\tvalues.  Fixed now.\n\n2013-09-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Fixes to be able to read MIFF\n\twritten by ImageMagick 6.X, including DirectClass grayscale\n\timages.  Interoperabilty is not completely assured since\n\tImageMagick is not consistent with itself and may only be able to\n\tread the file it just wrote.  Reading DirectClass grayscale RLE\n\tcompressed images is not supported yet.\n\n2013-09-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/profile.c (MagickFreeCMSTransform): Only delete the CMS\n\ttransform if it is non-null.  If lcms returned a null transform,\n\tan assertion was thrown in lcms when the pointer was freed.\n\tProblem was reported by James Bardin.\n\n2013-09-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c: PseudoClass format was written incorrectly in\n\tthat sample storage size is supposed to be selected based on the\n\tsize of the colormap, but it was being selected based on the depth\n\tparameter instead, leading to excessively sized files and failure\n\tto read what was written.  RLE compressed formats had the sense of\n\tthe alpha channel inverted from the other compression methods, and\n\tcontrary to the specification.  PseudoClass with Alpha was not\n\tsupported at all, and reading a file claiming to be such caused an\n\tassertion to be thrown.  Note that these fixes may cause some\n\texisting files to no longer be read correctly.\n\n\t* coders/xpm.c (ReadXPMImage): XPM is rarely used to produce\n\t16-bit output.  Set image depth based on the colormap.\n\n\t* coders/tim.c (ReadTIMImage): PSX TIM is not able to produce more\n\tthan 8-bit output, set image depth appropriately.\n\n2013-09-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Increase rows-per-strip as\n\trequired to try to avoid more than 32K strips per image since some\n\tprograms seem to use a 16-bit strip counter and fail with more\n\tthan 32K strips.  Problem was reported by Kevin Myers.\n\n\t* magick/transform.c (MosaicImages): Fix unsigned underflow\n\tproblem with -mosaic when page offset is negative and exceeds\n\timage width or height.  This problem caused assertions, out of\n\tmemory errors, or pixel cache limit errors due to requesting an\n\timage of outrageous size.\n\n2013-08-26  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n        * dcraw\\dcraw.c Updated from autor\n        * dcraw\\dcraw.c.patch\n\n2013-08-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (ReadPNMImage): Fix SourceForge issue #237\n\t\"Incorrect MAXVAL scaling when reading PAM images\".\n\n2013-08-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Improve error handling so that\n\trendering bails on image access/update errors.  Resolves\n\tSourceForge issues #233 \"Another SVG that hangs GraphicsMagick\"\n\tand #232 \"Another SVG that hangs GraphicsMagick\".  The resolution\n\tof the bug is to return from image access/update error right away\n\trather than adjusting the rendering density to produce a smaller\n\timage.\n\n\t* magick/error.h: Hide exception throwing convenience macros under\n\tMAGICK_IMPLEMENTATION definition.\n\n\t* Magick++/demo/demos.tap: Fix file naming for 'zoom' demos.\n\n\t* magick/annotate.c (RenderFreetype): Improve error handling so\n\tthat rendering bails on image access/update errors.\n\n2013-08-02  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): ping a png faster by\n\treturning the image without reading the pixel data.\n\n2013-07-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/xwindow.c (MagickXMakeImage): Only use ThumbnailImage()\n\tfor DirectClass images in order to avoid a crash while creating\n\tthe panner image.\n\n2013-04-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* design/pixel-cache-struct.dot: Update structure relationships\n\tdiagram.\n\n\t* design/pixel-cache.dot: Update call flow diagram.\n\n\t* magick/pixel_cache.c: Eliminate use of internal functions\n\tGetNexusIndexes(), GetNexusPixels().  Reduce usage of internal\n\tfunction IsNexusInCore().\n\n2013-04-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: MAGICK_SSIZE_T should always be a signed type.\n\n\t* coders/jpeg.c (WriteXMPProfile): Add support for writing 'XMP'\n\tprofile in JPEG.\n\t(WriteJPEGImage): Restructure/tidy JPEG profile writing code.\n\n2013-04-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Return DirectClass images by\n\tdefault for MINISWHITE and MINISBLACK TIFF formats.\n\n2013-04-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c, magick/attribute.c, magick/map.c, magick/render.c,\n\tmagick/widget.c, magick/xwindow.c: Fixes to reduce warnings with\n\tGCC 4.8.0 at -O3 optimimization level, and for clang 3.2.\n\n2013-04-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/xwindow.c (MagickXMakeImage): Use ThumbnailImage() rather\n\tthan SampleImage() when creating the panner image to improve the\n\tquality of the image.\n\n2013-03-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (tag_table): Add support for SubjectArea EXIF\n\ttag.  Resolves SourceForge issue #229 \"Cannot Parse the\n\tSubjectArea EXIF Info\".\n\n2013-03-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Hg.rst, www/index.rst: Update SourceForge Mercurial\n\trepository location (see\n\thttp://hg.code.sf.net/p/graphicsmagick/code) due to project\n\t\"upgrade\".  For the moment there are old and new\n\trepositories. Changes will be pushed to the new repository.\n\n2013-03-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c (InitializeMagickResources): Revert use of\n\tomp_set_dynamic() since it caused a severe performance regression\n\twhen doing a -stepthreads benchmark or when the number of OpenMP\n\tthreads is set via OMP_NUM_THREADS.\n\n2013-03-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* INSTALL-unix.txt: Add a section about building Windows binaries\n\tby cross-compiling from a Unix/Linux system.\n\n2013-03-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac, magick/magick_types.h.in: Fix issues noticed when\n\tcross-compiling with MinGW64.\n\n2013-03-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh, www/index.rst: Prepare for 1.3.18 release.\n\n2013-03-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (DisplayImageCommand): display is supposed to\n\trespond to +/-usePixmap, but was not.  It was responding to\n\t+/-use_pixmap.  Now it responds to both.\n\n2013-03-03  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* doc/GraphicsMagick.imdoc: Relocated some <im> .. </im> tags, to\n\tinclude several paragraphs that were omitted from the\n\tGraphicsMagick man page (Environment, Configuration Files, and\n\tCopyright).\n\n\t* doc/imdoc2man: the </pre> tag was being deleted instead of\n\treplaced with nothing, which caused the first line of the\n\tsubsequent material to be joined to the last line of the <pre>\n\tblock.\n\n2013-03-02  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Avoid a libpng16 warning about\n\tstoring unknown chunks.\n\n2013-02-25  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): Call png_set_bKGD(), etc.,\n\tafter png_set_IHDR() because they depend on members of info_ptr\n\twhich are set by png_set_IHDR().\n\n2013-02-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c (InitializeMagickResources): Enable the\n\tdynamic adjustment of OpenMP threads if there is more than one\n\tthread available.\n\n2013-02-18  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* configure.ac and configure: Check for libpng17 and libpng16.\n\n2013-02-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/programming.rst: Add mention of Clement Farabet's Lua\n\tscripting language wrapper for GraphicsMagick.\n\n2013-02-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (GetCacheNexus): Re-write function so it\n\thas a single point of return.\n\t(AcquireCacheNexus): Reduce the number of return points.\n\t(SetCacheNexus): Re-write function so it has a single point of\n\treturn.\n\n2013-02-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update with latest news.\n\n\t* magick/export.c (ExportAlphaQuantumType): Fix export of alpha\n\tfor RGBA image and depth 8.  Due to typo, was exporting 16-bits\n\trather than 8, causing output corruption or crashes.  Resolves\n\tissue reported in SourceForge GraphicsMagick forum under title\n\t\"CMYK per-channel byte order TIFF crashes gm\".\n\n2013-02-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h (MagickIsBlank): Add macro to substitute for ISO\n\tC99 isblank() which is not globally available.  Update 'gm batch'\n\tcode which had substituted isspace() for isblank() to use it.\n\n2013-01-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (BatchCommand): Flush stdout at key points in\n\torder to ensure that user sees text when it is produced.\n\n2013-01-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/random.c (InitializeMagickRandomGenerator): Use\n\tMagickTsdKeyCreate2() in order to avoid a small memory leak.\n\n\t* magick/tsd.c (MagickTsdKeyCreate2): New private function to\n\tsupport allocating a thread-specific data key with a specified\n\tdestructor function.  For single-threaded build, MagickTsdKey_t is\n\tnow type void* and there is provision to support the destructor\n\tfunction.\n\n2013-01-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (BatchCommand): New 'gm batch' command to\n\taccept one or more GraphicsMagick commands from a specified text\n\tfile, standard input, or CLI.  Feature is implemented by Kenneth\n\tXu.  Submitted via SourceForge Patch #3602331 \"Add interactive or\n\tbatch mode support to 1.3.17\".\n\n2013-01-27  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): Added PNG48 and PNG64 support.\n\tAdded PNG00 support (png encoder that inherits its color-type and\n\tbit-depth from the input, if the input was a PNG datastream).\n\n2013-01-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): PNG8 support was using\n\timage->colors to decide if the input image is PseudoClass.  This\n\tis totally bogus.  Use image->storage_class to determine if image\n\tis PseudoClass and quantize image colors if it is not.\n\n\t* magick/delegate.c (InvokePostscriptDelegate): Only invoke\n\tMagickSpawnVP() if Ghostscript filename argument is non-empty.\n\tThis argument may be empty if Ghostscript is not found on a\n\tWindows system.  Report a \"Failed to find Ghostscript\" error if\n\tthe Ghostscript command name is empty. Resolves SourceForge issue\n\t#3601816 \"Win64 build crashes trying to convert PDF to any other\n\tformat\".\n\n\t* magick/utility.c (MagickSpawnVP): Verify that file argument is\n\tnon-NULL and not empty.\n\n2013-01-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/tiff/LIBRARY.txt: Fix pre-processor definitions for\n\tlibtiff so that they use multiple statements rather than one long\n\tstatement.  Resolves SourceForge issue 3601001 \"libtiff won't\n\tcompile with ICL\".\n\n2013-01-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/memory.h (MagickAllocateAlignedArray): New macro to wrap\n\tuse of MagickMallocAlignedArray().\n\n\t* magick/memory.c (MagickMallocAlignedArray): New private function\n\tto support safe allocation of an array in memory with a specified\n\talignment.  Allocation may only be freed using MagickFreeAligned()\n\tand the allocation may not be reallocated.\n\n2013-01-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/{animate.c,display.c,utility.c}: Only invoke chdir() if\n\tpath is not an empty string.  Previously sometimes chdir() was\n\tpassed an empty string (because chdir() was not needed) and this\n\twas ok because we ignored the error status.  Now that we check the\n\tchdir() error status, some X11 GUI functions (e.g. save file to\n\tcurrent directory) encounter annoying issues.\n\n\t* magick/shear.c (IntegralRotateImage): Limit integral rotate to\n\ttwo threads.\n\n\t* coders/pnm.c (ReadPNMImage): Limit PNM reader to two threads.\n\n2013-01-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac (MAGICK_FEATURES): MinGW static build does not\n\tbuild modules so MODULES feature should not be listed as\n\tsupported.  Resolves MinGW test failures.\n\n\t* coders/dpx.c (OrientationTypeToDPXOrientation): Return U16 type\n\tas stored in DPX format.\n\n\t* coders/cineon.c: Add support for reading/writing 'orientation'\n\tsetting.\n\n\t* coders/mpc.c: Add support for reading/writing 'orientation'\n\tsetting.\n\n\t* coders/miff.c: Add support for reading/writing 'orientation'\n\tsetting.\n\n\t* Rotate ChangeLog for 2012 and update web page copyright years.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2014",
    "content": "2014-12-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c (UnpackWPGRaster): Fix some compilation and\n\tvalgrind warnings.\n\n\t* NEWS.txt: Updated news again.\n\n2014-12-31 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Fixed 2bpp issue.\n\n2014-12-31  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Validate MHDR chunk length.\n\n\t* coders/png.c: Use ReadBlob() once instead of ReadBlobByte()\n\tin a loop.\n\n\t* coders/png.c: Avoid reading beyond the end of a tEXt keyword.\n\n2014-12-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (ReadXPMImage): Detect short XPM rows and report\n\terror to user rather than overrunning a buffer.\n\n\t* coders/pcx.c (ReadPCXImage): Validate that header bytes per line\n\tis sufficient to contain the indicated data.\n\n\t* coders/pdb.c (ReadPDBImage): Fix indexes array overrun for 2 and\n\t4-bit PDB image files.\n\n\t* coders/xpm.c (ReadXPMImage): Avoid strncpy() of overlapping\n\tmemory.  Fix memory leaks in error paths.\n\n\t* coders/viff.c (ReadVIFFImage): Validate index before using it to\n\taccess colormap.\n\n\t* coders/{cineon.c, dpx.c} (StringToAttribute): Can't use\n\tstrlcpy() to copy string which might not be NULL-terminated since\n\tstrlcpy() continues searching for end of string after size bytes\n\thave been copied.\n\n\t* coders/meta.c (convertHTMLcodes): Avoid strcpy() of overlapping\n\tmemory.\n\n2014-12-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/process.rst: Update description of development process to be\n\tmore aligned with the process actually used.\n\n\t* coders/wpg.c (ReadWPGImage): Avoid use of NULL pointer returned\n\tfrom FlipImage(), FlopImage(), and RotateImage().\n\n\t* coders/rle.c (ReadRLEImage): URT RLE reader is now more robust\n\twith errant files.\n\n2014-12-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* libtool: Update bundled libtool to version 2.4.4.\n\n\t* magick/constitute.c (WriteImage): Remove bogus use of\n\tGetBlobStatus() as a catch-all for write errors.  Coders should be\n\tdetecting write errors all by themselves.\n\n2014-12-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated with more improvements since previous release.\n\n\t* coders/palm.c (WritePALMImage): Log header details.\n\n\t* coders/pdb.c: PDB reader and writer need to be more robust when\n\tcalculating packets and buffer allocation.  Also log header\n\tdetails.  Problem was reported by Hanno Böck.\n\n2014-12-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated with more improvements since previous release.\n\n\t* ttf: Update bundled Freetype to 2.5.4.\n\n\t* png: Update bundled libpng to 1.6.16.\n\n2014-12-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): The libtiff JBIG coder only\n\tsupports strip images, and fails when scanlines are requested.\n\tForce use of stripped read method when the file uses JBIG\n\tcompression.  It is still not possible to write JBIG compressed\n\tTIFF files since there is not yet a strip writer.  Problem\n\treported by Yuriy Kaminskiyon via the GM-bugs mailing list on\n\t2014-12-22.\n\n2014-12-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (QuantumTransferMode): Fix quantum transfer\n\thandling for photometrics which might deliver one or three samples\n\tper pixel.  These were assuming that three samples were always\n\tprovided.\n\n2014-12-21  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Impose a 10-million limit on dimensions\n\twhen reading a PNG file.\n\n2014-12-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated with improvements since previous release.\n\n2014-12-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/statistics.c (GetImageStatistics): Failed to compute\n\tstatistics for the Black channel of CMYK image files.  Problem\n\treported by Michael Below via Debian bug 773552:\n\t\"graphicsmagick-imagemagick-compat: convert to cmyk leaves k\n\tchannel empty\".\n\n2014-12-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/delegate.c (InvokeDelegate): Windows spawnvp() splits\n\targuments into more arguments.  Add escaping to avoid the\n\tsplitting.  Resolves SourceForge bug #276 \"dcraw 9.19 included\n\twith gm 1.3.20 doesn't support paths with spaces.\"\n\n\t* magick/utility.c (TranslateTextEx): Fix regression added on\n\t2014-12-13 (yesterday) which caused output file name passed to\n\tdelegate programs to be wrong.\n\n\t* magick/annotate.c (RenderFreetype): Fix regression added in\n\t1.3.19 which caused spurious drawing errors to be produced while\n\trendering with text when all of the text is off the left-hand side\n\tof the image.\n\n2014-12-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (CompareUsage): Options should be listed in\n\talphabetical order.\n\n\t* magick/annotate.c (RenderFreetype): Immediately quit processing\n\tand return an error if SyncImagePixels() reports a problem.\n\n\t* coders/psd.c (ReadPSDImage): Return with an error right away if\n\tSetImageEx() (to create solid-color background canvas) reports a\n\tfailure.\n\n\t* magick/annotate.c (AnnotateImage): Document all of the\n\tattributes which are supported.\n\n\t* magick/utility.c (TranslateTextEx): Assure that attributes\n\trequiring ImageInfo pointer are skipped.  AnnotateImage() does not\n\tpass ImageInfo.  Also document all of the attributes which are\n\tsupported.\n\n\t* doc/compare.imdoc: Compare documentation examples referred to\n\tnon-existing option -algorithm rather than the existing option\n\t-highlight-style.  Fixes SourceForge bug #286 \"docs are wrong\n\tabout `-algorithm` option of `gm compare`?\".\n\n\t* Magick++/lib/Magick++/Geometry.h (Magick): Re-implemented\n\tMagick++ Geometry to use bit-fields for booleans and used a union\n\tto reserve space for the future as well as to achieve the same\n\tsize as in the previous release.  Eliminated inline methods\n\tbecause they make it impossible to change the class internal\n\tdesign.  ABI was broken already when limitPixels() and fillArea()\n\tmethods were added on 2014-11-28.  Inline method instantiations in\n\talready compiled applications will malfunction unless the\n\tdependent applications are re-compiled.\n\n\t* magick/image.c (SetImageEx): Add a new version of SetImage()\n\tcalled SetImageEx() which reports exceptions to a provided\n\texception parameter rather than into the image.\n\n2014-12-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colormap.c (AllocateImageColormap): Refuse to allocate a\n\tcolormap larger than MaxColormapSize.\n\n\t* coders/psd.c (ReadPSDImage): Avoid extremely long execution time\n\tif the PSD colormap size is astonishingly large.  Problem was\n\treported by Hanno Böck.\n\n2014-11-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c: Verify that DCM data is available before\n\tattempting to use it.  Avoids a crash due to improper DCM header.\n\tProblem was reported by Hanno Böck.\n\t(DCM_ReadNonNativeImages): Fix array over-run (off by one error)\n\twhile looking for end of multi-fragment frames.\n\n2014-11-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sun.c: Thoroughly validate Sun Rasterfile headers and\n\tverify that there are no arithmetic overflows in buffer-size\n\tcalculations.  Problem was reported by Hanno Böck.\n\n2014-11-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Magick++/Geometry.h (Magick::Geometry): Add and\n\tdocument limitPixels() and fillArea() methods to support '@' and\n\t'^' geometry qualifiers.  Fill area contributed by Long Ho and\n\tlimitPixels() by Bob Friesenhahn.\n\n\t* www/Magick++/Image.rst: Document extent and resize methods.\n\n\t* Magick++/lib/STL.cpp (extentImage): New function object to\n\tinvoke image extent method. Original implementation contributed by\n\tLong Ho.  Subsequently modified by Bob Friesenhahn.\n\t(resizeImage): New function object to invoke image resize\n\tmethod. Contributed by Long Ho.\n\n\t* Magick++/lib/Image.cpp (extent): New method to place image on\n\tsized canvas of constant color using gravity.  Contributed by Long\n\tHo.\n\t(resize): New method to resize image specifying geometry, filter,\n\tand blur.  Original implementation contributed by Long Ho.\n\tSubsequently modified by Bob Friesenhahn.\n\n2014-11-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/avi.c: AVI support in GraphicsMagick is completely\n\tunusable and it could never compete with dedicated software like\n\t'ffmpeg'.  Removing AVI support until such time it can be\n\tsupported properly.\n\n\t* coders/viff.c: Add protections against buffer overflow by\n\tverifying that buffer size allocation calculations do not\n\toverflow.  Also added header logging for read and write. Work\n\tperformed due to complaint by Hanno Böck.\n\n2014-11-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/common.h (MAGICK_NO_SANITIZE_ADDRESS): Add\n\tMAGICK_NO_SANITIZE_ADDRESS macro definition for disabling\n\tclang/GCC address sanitizer on a function if the need arises.\n\n2014-11-24  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadPNGImage): Do not attempt to clean up\n\ta \"previous\" NULL PNG image.\n\n2014-11-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xwd.c (ReadXWDImage): Add logging of XWD header values.\n\tFix memory leaks in error reporting paths.  Ping mode skips\n\tallocating memory for data and colormap.  Added a few more header\n\tvalidation checks (not complete).  XWD is put in\n\tUnstableCoderClass until such time as header validation checks are\n\tcomplete.\n\n2014-11-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdb.c (WritePDBImage): Use MagickAllocateArray() when\n\tallocating packets.\n\n\t* coders/dpx.c (ReadDPXImage): Validate DPX header orientation and\n\tnumber of elements.  Problem was reported by Hanno Böck.\n\n2014-11-20  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadJNGImage): Do not attempt to clean up\n\ta \"previous\" NULL JNG image.\n\n2014-11-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/FAQ.rst: Add a FAQ entry regarding what 'identify' reports.\n\tResolves SF issue #280 \"Better documentation for spurious gm\n\tidentify in Q8 compilation.\"\n\n2014-11-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/enhance.c (ModulateImage): ModulateImage() should produce\n\ta progress indication even if only the colormap is modified.\n\n2014-11-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/psd.c (ReadPSDImage): Patch by Cédric Demière to fix\n\t\"Memory allocation failed\" error when reading PSDs files which\n\thave no layers.  Delivered via SF patch #41 \"PSD : files without\n\tlayers\".  Resolves SF bug #242 \"Can not convert PSD to JPG or PNG\n\t(gm convert: Memory allocation failed)\".\n\n2014-11-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/webp.c (WriteWEBPImage): WebP fix by Roman Hiestand to\n\tmake WebP lossless format truely lossless.\n\n\t* tests/rwblob.tap (check_types): Added a test for WebP lossless.\n\n\t* tests/rwfile.tap: Added a test for WebP lossless.\n\n\t* tests/rwblob.c: Added support for -define.\n\n\t* tests/rwfile.c: Added support for -define.\n\n2014-11-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* webp, VisualMagick/webp: Updated bundled WebP to 0.4.2 release.\n\n2014-11-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/tests/attributes.cpp: Add a simple test for\n\tImage::formatExpression().\n\n\t* Magick++/lib/Image.cpp (formatExpression): Handle case where\n\tTranslateText() returns NULL.  Problem was reported by Dirk\n\tLemstra..\n\n2014-10-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Image.cpp (formatExpression): New method to format\n\ta string based on a format similar to command-line -format.\n\tFeature was requested by Dirk Lemstra.\n\n\t* magick/blob.c (BlobReserveSize): Don't throw an exception if\n\tposix_fallocate() fails since it seems that it is not supported\n\tfor all filesystem types, and is only intended for optimization.\n\n\t* Magick++/lib/Image.cpp (resolutionUnits): Return resolution\n\tunits from Image if available, else return the value from\n\tImageInfo.  Issue was reported by Dirk Lemstra.\n\n2014-10-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (ReadPNMImage): Validate PGM, PPM, and PAM header\n\tMaxValue parameter.  Issue was reported by Hanno Böck.\n\n\t* coders/pcx.c (ReadPCXImage): Fix for CVE-2014-8355, eliminate\n\tmemory leaks in error paths, and add PCX header logging.  Issue\n\twas reported by Hanno Böck.\n\n2014-10-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/wand_symbols.h (MagickSetImageGamma): Fix typo in\n\twand/wand_symbols.h.  Resolves SF bug #277.\n\n2014-10-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (TIFFIgnoreTags): Avoid warning about unused\n\tstrtol() return value on Linux.\n\n\t* magick/random-private.h (\"C\"): Move random inlined\n\timplementation bits to random-private.h, which is not installed,\n\tor used outside of the core C library.\n\n2014-09-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/annotate.c (AnnotateImage): An empty text string should\n\tnot be treated as an error.  Resolves Debian bug 759956.\n\n2014-08-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c: Added a new define called tiff:ignore-tags that\n\tcan be used to ignore tags in 'corrupted' files with unknown and\n\tinvalid tags. Without this patch the file cannot be read and\n\traises an error. Patch by Dirk Lemstra via SF patches #40.\n\n\t* magick/type.c (ReadTypeConfigureFile): Support reading type\n\tconfiguration file from Windows resource. Patch by Dirk Lemstra\n\tvia SF patches #32.\n\n\t* Magick++/lib/Magick++/STL.h: Fixed code analysis warning in\n\tSTL.h. Patch by Dirk Lemstra via SF patches #32.\n\n\t* Magick++/lib/Magick++/Include.h: Autolink WebP in Visual\n\tStudio. Patch by Dirk Lemstra via SF patches #32.\n\n2014-08-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/psd.c (WritePSDImage): Fix small stack over-write if more\n\tthan 99 layers are written to PSD format.  Similar to\n\tCVE-2014-1947 for ImageMagick.  Changed layer naming to use at\n\tleast 4 digits.  Issue was brought to our attention by Rex Dieter\n\tand change is mostly based on his patch.\n\n2014-08-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/enum_strings.c (StringToCompositeOperator): Support\n\tcomposite operator names similar to the major brand, without\n\tlosing any compatibility with previous naming.\n\n2014-08-23  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\t* coders/png.c: Fixed handling of transparency when writing\n\tindexed PNG. Reference: SourceForge Bug tracker [bugs:#267]\n\tTransparency lost when converting from GIF to PNG.\n\n2014-08-17  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n\n\t* VisualMagick\\configure\\configure.cpp Remove webp when attempting\n\tto compile with Visual Studio 6.\n\n2014-08-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update for 1.3.20 release.\n\n\t* www/index.rst: Update for 1.3.20 release.\n\n\t* version.sh: Update library versioning for next release.\n\n2014-08-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* png: Updated libpng to 1.6.12 release.\n\n\t* zlib: Updated zlib to 1.2.8 release.\n\n2014-08-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated NEWS file to document changes since previous\n\trelease.\n\n2014-08-09  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n\n        * coders/webp.c webp cannot be compiled when HasWEBP is not set.\n\n2014-08-08  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Eliminated palette and depth optimization (see\n\thttps://sourceforge.net/p/graphicsmagick/feature-requests/35/).\n\n2014-08-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* dcraw/dcraw.c: Fix dcraw build for x64 target when only WIN64 is\n\tdefined (by also defining WIN32).\n\n\t* VisualMagick/configure/configure.cpp (write_file): Fix problem\n\twith x64 project naming which caused object file disambiguation\n\tnot to work for x64 target. Make line terminations consistent.\n\n2014-08-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick: VisualMagick fixes by Dirk Lemstra to improve\n\tconfigure program so that it is possible to select QuantumDepth,\n\tOpenMP, and 64-bit build via configure dialog boxes as well as\n\toptions on the command line.  Also automatically detects and deals\n\twith similarly named files in subdirectories so that WebP support\n\tcan now build successfully.  Resolves SF patches 31, 33, 35, 37,\n\tand 38.\n\n2014-07-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (NTResourceToBlob): Support loading mgk files\n\tas Windows resource from library if MagickLibName is defined.\n\tPatch contributed by Dirk Lemstra via SF patch #32.\n\t(NTGhostscriptDLL): For Microsoft Windows, add support for a\n\tMAGICK_GHOSTSCRIPT_PATH environment variable which specifies the\n\tpath to Ghostscript.  If this environment variable is defined,\n\tthen the Windows registry is not used to find Ghostscript.  Patch\n\tcontributed by Dirk Lemstra via SF patch #39.\n\n\t* magick/log.c: Added SetLogMethod() to allow an\n\tapplication/library to specify a function to be called for\n\tlogging.  Patch contributed by Dirk Lemstra.\n\n2014-07-20  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/bmp.c: \"opacity\" read from a BMP3 is actually \"alpha\",\n\tso store q->opacity=MaxRGB-opacity instead of q->opacity=opacity.\n\tReference: Bug tracker [bugs:#271] Blank result for BMP resize.\n\n2014-07-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* webp, VisualMagick/webp: Integrate webp 0.4.0 into windows\n\tbuild.  May require manual renaming of output object files in\n\tproject files to build webp until VisualMagick configure is\n\timproved!\n\n2014-07-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c: fmin() and fmax() are defined by C'99 and\n\tnot available everywhere, so add and use MagickFmin() and\n\tMagickFmax() to improve portability.\n\n2014-07-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Magick++/Image.h (Magick): Fix complilation errors\n\tcaused by continued raw use of __attribute__.\n\n2014-06-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c: Fixes by Brendan Lane for color channel\n\toverflows in modified/new quantum operators.  Fixes test suite\n\tresults for Q32 build and makes LinearBurn and LinearDodge work\n\tcorrectly at all.\n\n\t* wand/pixel_wand.c (PixelSetMagenta): Fix documentation.\n\tResolves SourceForge bug #273 'Green Magenta' typo in docs.\n\n2014-06-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c: Composition improvements and additions\n\tcontributed by Brendan Lane via SourceForge patch #34 \"Most of the\n\tmissing Photoshop separable compositing operations\"\n\t(https://sourceforge.net/p/graphicsmagick/patches/34/).  These\n\tcomposition operators were modified to include alpha in their\n\tcomputations: Difference, Darken, Lighten, HardLight, and these\n\toperators were added Overlay, Exclusion, ColorBurn, ColorDodge,\n\tSoftLight, LinearBurn, LinearDodge, LinearLight, VividLight,\n\tPinLight, HardMix.\n\n2014-06-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c (ScreenCompositePixels): Implementation of\n\tScreen composite contributed by Brendan Lane.  SourceForge patch\n\t#30 \"Missing Screen composite operation\".\n\n\t* wand/magick_compat.c: Re-worked Wand library implementation to\n\tdepend directly on GraphicsMagick library functionality rather\n\tthan using ImageMagick shim code from magick_compat.c and\n\tmagick_compat.h. The magick_compat.c source module becomes \"dead\n\tcode\", which remains only to support the existing ABI, and will be\n\tdeleted at the next major ABI break point.\n\n\t* magick/utility.c (MagickFormatString): New private function to\n\tformat a string into a buffer with a specified size.  Same as\n\tpreviously existing FormatString() except requires a length\n\targument.\n\n2014-06-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_compat.h: Use MAGICK_ATTRIBUTE definition from\n\tmagick/common.h.\n\n\t* magick/common.h (MAGICK_ATTRIBUTE): Don't undefine __attribute__\n\tsince this may be used by system or compiler headers.  Define\n\tprivate macro instead.  Resolves SourceForge bug #270 \"Compile\n\terror with g++ -std=c++11\".\n\n2014-06-06  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Free png_pixels and\n\tquantum_scanline before error return.  Use \"png_error()\"\n\tinstead of \"ThrowException2()\" for errors occuring while\n\tdecoding a PNG so proper cleanup will happen.\n\n2014-06-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Make sure that libtiff warnings\n\tare promoted to errors for critical tags.\n\n2014-06-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Be quite a lot more draconian\n\twhen retrieving the baseline standard TIFF tags we need in order\n\tto avoid consuming uninitalized data later.  An error with these\n\ttags will result in failure to read the image file.\n\n2014-05-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/operator.c: Decided that ThresholdBlackNegateQuantumOp\n\tand ThresholdWhiteNegateQuantumOp should set the result to white\n\tor black respectively rather than being based on subtraction.\n\n2014-05-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (AUTOMAKE_OPTIONS): Be ultra-pedantic with CPPFLAGS\n\tand include paths in order to assure that only required\n\tdirectories are supplied, and to avoid accidential collision with\n\tsystem header files.\n\n2014-05-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/operator.h (\"C\"): New quantum operators\n\tThresholdBlackNegateQuantumOp and ThresholdWhiteNegateQuantumOp.\n\tThese correspond to -operator \"Threshold-Black-Negate\" and\n\t\"Threshold-White-Negate\".\n\n2014-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/composite.c (MultiplyCompositePixels): Multiply\n\tcomposition now uses SVG interpretation of how alpha should be\n\thandled.  No longer does a simple multiply of alpha channel.\n\tBehavior change.  Patch contributed by Sara Shafaei.\n\n\t* coders/msl.c (ProcessMSLScript): Deal with case where\n\timage_info->attributes is NULL.\n\n2014-04-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (TranslateTextEx): Support additional format\n\tspecifiers 'g', 'A', 'C', 'D', 'G', 'H', 'M', 'O', 'P', 'Q', 'T',\n\t'U', 'W', 'X', and '@'.\n\t(GetMagickGeometry): Support '>' and '<' qualifiers with '@'\n\tqualifier to specify if image should be resized if larger or\n\tlesser than given area specification.  Resolves SourceForge bug\n\t#216 \">\" wont take effect when use @ to specify the maximum area.\n\n\t* magick/transform.c (GetImageMosaicDimensions): Move mosaic\n\tdimensions code to a static function for possible future re-use.\n\n2014-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gradient.c (GradientImage): Update image is_grayscale and\n\tis_monochrome flags based on gradient color properties.\n\n2014-04-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GetMagickGeometry): Deal with resize geometry\n\tmissing width or height (e.g. '640x' or 'x480') by substituting\n\tthe missing value with one which preserves the image aspect ratio.\n\tThis has been documented to be supported since almost the dawn of\n\tGraphicsMagick but was not actually supported until now.\n\n2014-04-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Document WebP encoder options.\n\n\t* coders/webp.c (WriteWEBPImage): Support all of the WebP encoder\n\toptions via -define arguments.  Most of this work is contributed\n\tby Roman Hiestand.\n\n\t* configure.ac: User-provided LIBS should be prepended to LIBS\n\tthat configure script produces so that user option takes\n\tprecedence.\n\n2014-04-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: Added support for HardLight composition\n\toperator.\n\n\t* www/perl.rst: Update PerlMagick documentation, including the\n\tcomposition operators.\n\n\t* coders/xcf.c (GIMPBlendModeToCompositeOperator): Use new\n\tHardLight composition operator to support XCF GIMP_HARDLIGHT_MODE\n\tblend mode.  Contributed by Sara Shafaei.\n\n\t* coders/psd.c (CompositeOperatorToPSDBlendMode): Use new\n\tHardLight composition operator to support PSD \"hLit\" blend mode.\n\tContributed by Sara Shafaei.\n\n\t* wand/magick_wand.c (MagickOperatorImageChannel): New function to\n\tapply an operator to an image channel.  Contributed by Sara\n\tShafaei.\n\n\t* magick/composite.c (HardLightCompositePixels): New HardLight\n\tcomposition operator.  Contributed by Sara Shafaei.\n\n2014-04-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (BenchmarkImageCommand): Add a CSV title line\n\tand quoting to benchmark -rawcsv output.\n\n2014-04-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/webp.c: Add progress indication support to WebP writer.\n\n\t* magick/command.c (VersionCommand): WebP support is included in\n\t-version output.\n\n\t* coders/webp.c: WebP coder identifies library version and header\n\tABI versions. Improve WebP error reporting.\n\n2014-04-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Allow specifying the TIFF image\n\tsoftware tag.  In the special case that the string length is zero\n\t(e.g. -set software '') then the tag is skipped entirely.  This is\n\tto support SourceForge feature request #37 \"Option to prevent\n\taddition of Exif Software tag\" opened by Jean-Louis Grall.  Please\n\tnote that this tag is not an EXIF tag.\n\n\t* magick/command.c: composite, convert, display, mogrify, and\n\timport now support +set to remove an existing image attribute.\n\n2014-03-16  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Don't block threads when PNG_SETJMP_SUPPORTED is\n\tnot enabled.\n\n\t* coders/png.c: Changed prefix of macros defined in coders/png.c\n\tfrom PNG_ to GMPNG_.  PNG_ is reserved for macros defined by\n\tlibpng.\n\n2014-03-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c: Don't use setvbuf() to set stdio block size if\n\tfilesystem block size is zero (e.g. MAGICK_IOBUF_SIZE=0)\n\n2014-03-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/{rwblob.tap, rwfile.tap}: Added tests for WEBP.\n\n\t* tests/{rwblob.c, rwfile.c}: Add lossy hint for WEBP.\n\n\t* coders/webp.c (WriteWEBPImage): Fix inverted return status.\n\tAdded a tiny bit of logging.\n\n2014-03-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ttf: Updated FreeType to release 2.5.3 of March 6, 2014.\n\tProvides security fixes for CVE-2014-2240.\n\n\t* jpeg: Update to libjpeg 9a of 19-Jan-2014.\n\n\t* png: Update to Libpng 1.6.10 - March 6, 2014.\n\n2014-03-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (NTResourceToBlob): According to Microsoft\n\tReport article 193678 (http://support.microsoft.com/kb/193678),\n\tFreeResource() is not needed in WIN32 and performs no useful\n\tfunction.  Remove use of it.  Also remove use of UnlockResource()\n\twhich is similarly unuseful for WIN32.\n\n\t* configure.ac (MAGICK_LIBRARY_REVISION): Test for Windows\n\t_aligned_malloc() is not reliable.  Use Windows CRT version to\n\tdecide if it is available.\n\n2014-03-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h: Make sure that Windows _aligned_malloc() is not\n\tused under MinGW unless the CRT version allows it.\n\n2014-02-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (InterpolateViewColor): Applied patch by\n\tTroy Patteson plus fixes to ignore opacity channel if image matte\n\tis false.  Replaces most of the code rewritten on 2014-02-16 and\n\twhich produced a faint darkened border.  The results look stellar\n\tnow.\n\n2014-02-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c: Applied patch by Troy Patteson to improve\n\tnon-integral rotation by around 40% by minimizing added image\n\tborders.  This may cause small differences in results for some\n\timages.\n\n\t* reference/filter/Rotate10.miff: Update rotate 10 degrees\n\treference image so that PerlMagick test passes.\n\n\t* magick/shear.c: Applied patch by Troy Patteson to fix\n\tSourceForge issue #260 \"Rotation exhibits clipping/shearing errors\n\tfor short wide images at some angles\".\n\n2014-02-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Fix documentation to note that 'unspecified\n\talpha' is the GraphicsMagick default when writing TIFF rather than\n\t'associated alpha'.  Much thanks to Mats Peterson for alerting us\n\tof this error.\n\n2014-02-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (InterpolateViewColor): Added a hack so that\n\taffine transformations and displace composite do not have\n\tbackground colored fringing on the transferred image edges when\n\tthe background is completely transparent.  Fringing problem was\n\tcaused by one or more of the line ends being a transparent pixel\n\toutside of the bounds of the original image content.  May not be\n\tthe final solution.\n\n2014-02-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/semaphore.c (AcquireSemaphoreInfo): Document that this\n\tfunction was deprecated.\n\t(LiberateSemaphoreInfo): Document that this function was\n\tdeprecated.\n\n2014-02-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/psd.c (RegisterPSDImage): Set PSD to UnstableCoderClass\n\tsince its implementation is currently rather marginal.  It may\n\teven be that this coder deserves to be marked with the new\n\tBrokenCoderClass.  We are still looking for a volunteer to iron\n\tout the wrinkles in the PSD reader.\n\n\t* magick/magick.h (CoderClass): Added BrokenCoderClass to mark\n\tcoders which often malfunction or are not very useful in their\n\tcurrent condition.  Sometimes there is still hope that problems\n\twill be resolved and so the source file is not outright deleted.\n\tThis setting allows us to mark and use coders which might\n\tmalfunction by defining MAGICK_CODER_STABILITY=BROKEN in the\n\tenvironment while not causing danger for normal use.\n\n2014-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c: Documentation improvements for\n\tMagickSetInterlaceScheme() and MagickSetImageInterlaceScheme().\n\tResolves SourceForge bug #262 \"setImageInterlaceScheme doesn't\n\tmake image progressive\".\n\n2014-02-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/{ps.c, ps2.c, ps3.c, pdf.c}: Only use resolution from\n\timage or -density if units was properly specified.  Without units,\n\tresolution is worthless.\n\n\t* coders/ps3.c (WritePS3Image): Use image resolution similar to PDF\n\tchanges.\n\n\t* coders/ps2.c (WritePS2Image): Use image resolution similar to PDF\n\tchanges.\n\n\t* coders/ps.c (WritePSImage): Use image resolution similar to PDF\n\tchanges.\n\n\t* coders/pdf.c (WritePDFImage): Use resolution from image if it\n\tappears to be valid.  Resolves SourceForge issue #261 \"PNG Pixel\n\tDensity Not Preserved Converting to PDF\".\n\n\t* magick/enum_strings.c (StringToResolutionType): New function to\n\tconvert ResolutionType to C string.\n\t(ResolutionTypeToString): New function to convert from C string to\n\tResolutionType.\n\n2014-02-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickGetImageGeometry): New function to get\n\tthe image geometry string.  This function and the three others in\n\tthis change set are contributed by Sara Shafaei.\n\t(MagickGetImageMatte): New function to read the image matte\n\t(opacity) channel enable flag.\n\t(MagickSetImageGeometry): New function to set the image geometry\n\tstring.\n\t(MagickSetImageMatte): New function to set the image matte\n\t(opacity) channel enable flag.\n\n2014-01-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.c (MagickDrawImage): Remove development debug\n\tfprintf which causes each drawing primitive to be printed to\n\tstderr.\n\n2014-01-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (ReadPNMImage): Fix scaling of alpha in sub-ranged\n\tpixels.  Addresses SourceForge issue #237 \"Incorrect MAXVAL\n\tscaling when reading PAM images\", which was not fully fixed in by\n\tthe previous attempt.\n\n2014-01-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/tsd.c: Implement TSD for \"pure\" OpenMP mode without\n\trelying on POSIX or WIN32 TSD APIs.\n\n\t* magick/semaphore.c: Implement OpenMP-based locking so that code\n\tcan compile in a \"pure\" OpenMP mode without relying on POSIX or\n\tWIN32 locking APIs.\n\n\t* configure.ac: --without-threads no longer disables use of\n\tOpenMP.  Use the already existing option --disable-openmp to\n\tdisable OpenMP.\n\n2014-01-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/common.h: Support use of clang/llvm __attribute__ and\n\t__builtin extensions similar to the existing support for GCC.\n\n2014-01-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Image.cpp (thumbnail): New method for fast image\n\tresizing, particularly to make thumbnails.\n\n\t* coders/gif.c: Log when Netscape loop exension is read and\n\twritten.\n\n\t* coders/png.c (WriteOnePNGImage): In optimize mode, disable matte\n\tchannel immediately if there are no non-opaque pixels.  Also added\n\tsome useful logging.  Resolves SourceForge issue #252 \"convert an\n\t8bit PNG result in a corrupted image \".\n\n\t* wand/magick_wand.c (MagickSetImageGravity): New Wand method to\n\tset image gravity.\n\t(MagickGetImageGravity): New wand method to get image gravity.\n\n2014-01-02  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Use libpng function\n\tpng_set_strip_16_to_8() when scaling 16-bit input PNG down to\n\t8-bit in a Q8 build.  The png_set_scale_16_to_8() function is\n\tmore accurate, but the slight difference causes reference tests\n\tto fail and causes unexpected difference between the behavior\n\tof PNG and other formats.  If png_set_strip_16_to_8() is not\n\tsupported in libpng, then we use png_set_scale_16_to_8() if\n\tthat is available.\n\n2014-01-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* INSTALL-windows.txt: Update for 2014.\n\n\t* INSTALL-unix.txt: Update for 2014.\n\n\t* Copyright.txt: Update for 2014.\n\n\t* NEWS.txt: Update for 2014.\n\n\t* README.txt: Update for 2014.\n\n\t* doc: Update for 2014.\n\n\t* www: Update for 2014.\n\n\t* VisualMagick/installer: Update for 2014.\n\n\t* ChangeLog: Rotate Changelog to ChangeLog.2013 for 2014.\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2015",
    "content": "2015-12-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* ttf: Update bundled freetype to release 2.6.2.\n\n\t* libxml: Update bundled libxml2 to release 2.9.3.\n\n2015-11-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* webp: Updated bundled libwebp to release 0.4.4.\n\n\t* png: Updated bundled libpng to release 1.6.19.\n\n2015-11-05  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): Added \"volatile\" to\n\tseveral declarations to stop \"might be clobbered\" warnings.\n\n2015-11-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update NEWS for 1.3.23 release.\n\n2015-11-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (IdentifyImageCommand): Fix problem that\n\tidentify with -format \"%A\" does not always report correct answer\n\tdue to insufficient analysis of image.  Fixes SourceForge bug #326\n\t\"gm identify: transparency detection bug \".\n\n2015-11-05  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): Restored a \"volatile\"\n\tdeclaration that was accidentally deleted on 2015-11-03.\n\n2015-11-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Add checks for 'ps2write' and 'eps2write' as\n\tGhostscript Postscript and Encapsulated Postscript\n\twriters. Resolves issue reported to graphicsmagick-bugs mailing\n\tlist on 2015-11-01 entitled \"Failure to detect pswrite and\n\tepswrite Ghostscript devices\".\n\n2015-11-03  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadRawProfile): Issue a warning instead of\n\tan error when attempting to read a zero-length profile.\n\n2015-11-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h (MagickSleep): Provide the macro 'MagickSleep'\n\tto call a function which delays for one second.  No longer provide\n\ta macro 'sleep' in WIN32 compiles.  Resolves issue reported to\n\tgraphicsmagick-bugs mailing list on 2005-11-01 entitled \"MinGW\n\tbuild error when sleep re#defined as Sleep\".\n\n2015-10-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/demo/demos.tap: Add zoom test cases to test resize to\n\toriginal dimensions, change height, and change width.\n\n\t* magick/resize.c (ScaleImage): Fix regression introduced in\n\t1.3.22 release which results in pixel cache not open if the scale\n\twidth and height match the original.  Patch by Troy Patteson.\n\tFixes part of SourceForge bug #323 \"ScaleImage() issues in\n\tv1.3.22\".\n\t(ScaleImage): Fix double free problem when scaled rows equals\n\toriginal rows.  This regression was added in the 1.3.22 release\n\tvia changset 080b99bba574.  Based on patch by Troy Patteson.\n\tFixes remaining part SourceForge bug #323 \"ScaleImage() issues in\n\tv1.3.22\".\n\n2015-10-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Magick++/Image.rst (thumbnail): Paragraph heading fix.\n\tResolves SourceForge issue #321 \"find tiny error in\n\tMagick++/Image.html document\".\n\n2015-10-06  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* docs/*.imdoc: Changed synopses in manpages to add \"gm \"\n\tprefix to commands. Updated synopsis for \"convert\" to agree\n\twith what's in the \"gm\" manpage.\n\n2015-10-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Remove CFLAGS and LDFLAGS deduplication code.\n\tResolves SourceForge bug #320 OS X \"universal build failure\".\n\n2015-10-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/index.rst: Updated for 1.3.22 release.\n\n\t* NEWS.txt: Updated for 1.3.22 release.\n\n2015-09-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Brought up to date with changes thus far since last\n\trelease.\n\n\t* magick/blob.c (OpenBlob): Disable fflush() of read-only handle\n\tunder Microsoft Windows, which produced a spurious error status,\n\tblocking file reads for Visual Studio 2015 on Windows 2012 server.\n\tProblem was reported and diagnosed by Dirk Lemstra.\n\n2015-09-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff: Update bundled libtiff sources to 4.0.6 release.\n\n\t* magick/module.c (InitializeModuleSearchPath): Fix compilation\n\tproblem when UseInstalledMagick is not defined.\n\n2015-09-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c: Static string/array allocations are now more\n\tconst.\n\n\t* coders/{ps.c, ps2.c, ps3.c}: Static string/array allocations are\n\tnow more const.\n\n\t* coders/palm.c: Palm static arrays should be 'const'.\n\n\t* coders/meta.c (jpeg_embed): Stop sharing writeable static string\n\t'psheader'.\n\t(tag_spec): The 'tags' static array should be all 'const'.\n\n\t* coders/jp2.c: Try to reduce the amount of non-const static data.\n\n\t* coders/dcm.c (dicom_info): Try to make dicom_info array more\n\t'const'.\n\n\t* coders/dpx.c: Eliminate use of static buffer strings.\n\n\t* coders/png.c: Make MNG chunk id strings constant rather than\n\tinitialized data.\n\n\t* magick/render.c (DrawAffineImage): Fix problem that sometimes\n\toutput rows are skipped when using OpenMP.  Problem identification\n\tand patch by Kevin Matzen.  Resolves SourceForge issue #316\n\t\"-affine sometimes produces output with missing rows\".\n\n2015-08-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwblob.tap: Add specific tests for BMP2 BMP3 subformats.\n\n\t* tests/rwfile.tap: Add specific tests for BMP2 BMP3 PS2 PS3\n\tsubformats.\n\n2015-08-30  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n\n        * magick/ImageMagick.rc Replace Imagemagick.ico by GraphicsMagick.ico\n\n        * magick/Imagemagick.ico is no longer needed and not referenced anywhere.\n\n2015-08-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* README.txt: Fix SourceForge bug 314 \"README: bad hg clone URL\".\n\n\t* magick/module.c (GetModuleListForDirectory): Fix Coverity 107017\n\t\"Copy into fixed size buffer\" and 107013 \"Overlapping buffer in\n\tmemory copy\".\n\t(UnloadModule): Fix SourceForge bug 312 \"uninitialized variable\n\t\"name\" in UnloadModule\".\n\n\t* coders/bmp.c (WriteBMPImage): Fix typo in fix on 2015-08-17.\n\tFixes Coverity 107014 \"Test should be assignment\".\n\n\t* magick/module.c (OpenModules): Fix Coverity 107016 \"Resource\n\tleak\".\n\t(GetModuleListForDirectory): Fix Coverity 107015 \"Resource leak\".\n\n2015-08-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (WriteBMPImage): Fix inverted alpha channel when\n\twriting BGRA8888 format.  Problem was reported by 张铎 via the\n\tgraphicsmagick-help discussion list on 2015-08-17.\n\n2015-08-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Verify that entry\n\tpointer is within the metadata buffer in order to avoid buffer\n\toverflow.  Resolution and patch by Federico Larumbe.\n\n\t* magick/profile.c (SetImageProfile): Avoid crash given NULL\n\tprofile pointer.  Resolution and patch by Federico Larumbe.\n\n2015-08-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Fix logic problem\n\twhile validating EXIF GPS_OFFSET.  Problem reported by Federico\n\tLarumbe.\n\n2015-07-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Applied fix\n\t(http://hg.code.sf.net/u/zacmorris/graphicsmagick/rev/edcc4c184b42)\n\tby Zac Morris to detect buffer overrun while reading zip\n\tcompressed data.\n\t(ReadMIFFImage): Fixed some memory leaks which were occuring when\n\tan exception was thrown from zip-compressed data reader.\n\n2015-07-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WritePTIFImage): Fix SourceForge issue #269\n\t\"Convert creates SubfileType 0x2 instead of 0x1\".  From looking at\n\tthe code, this is a regression since the time support for the page\n\tsubfile type was added (probably via changeset 11831\n\t(037eef0f67f2) on 2007-08-17).\n\n2015-07-19  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n\n\t* dcraw/dcraw.c: Fixed bad define WIN32.\n\n2015-07-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt, www/Hg.rst, www/index.rst: Applied English bugs patch\n\tby Amadu Jalloh.\n\n\t* dcraw/dcraw.c: Add a port replacement for strnlen().\n\n2015-07-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/magick_wand.h: The declaration for MagickGetImageGravity()\n\twas missing.  Resolves SourceForge bug #308 magick_wand.h misses\n\tdeclaration of MagickGetImageGravity.\n\n2015-07-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* dcraw: Update bundled dcraw to release 9.26.0.\n\n\t* png: Updated bundled libpng to release 1.6.17.\n\n\t* lcms: Update bundled lcms2 to release 2.7.\n\n2015-07-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Brought up to date with changes thus far since last\n\trelease.\n\n\t* magick/version.h.in (MagickCopyright): Update most recent\n\tcopyright year.\n\n\t* magick/render.c (DrawAffineImage): Fix problem with negative x\n\toffset.  Resolves SourceForge issue #306 \"gm fails to convert svg\n\tto jpeg if svg has images with negative coordinates\".\n\n\t* magick/pixel_cache.c (ReadCachePixels): Add checks for integer\n\toverflows.\n\n2015-07-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/module.c (ModuleAliases): Add a module alias for GRAYA.\n\n2015-07-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/montage.c (MontageImages): Fix Coverity 101317 \"Resource\n\tleak\".\n\n\t* magick/blob.c: Limit the data size passed to the read/write\n\tcalls to the filesystem blocksize and make multiple calls if\n\trequired.\n\n\t* magick/pixel_cache.c: Limit the data size passed to the\n\tread/write, pread/prwite calls and make multiple calls if\n\trequired.\n\n2015-07-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (WriteBlobFile): Properly handle short read. Read\n\tdata in units of filesystem block size.\n\t(BlobToFile): Write data in units of filesystem block size.\n\n\t* patches: Added directory of patches which may be useful when\n\tintegrating new versions of 3rd-party programs or libraries into\n\tthe VisualMagick build.\n\n\t* libxml: Re-applied libxml changes which were used in prior\n\trelease.\n\n2015-07-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* webp: Updated bundled libwebp to release 0.4.3.\n\n\t* ttf: Update bundled freetype to release 2.6.\n\n\t* libxml: Update bundled libxml2 to release 2.9.2.\n\n\t* tiff/VERSION: Update bundled libtiff to release 4.0.4.\n\n\t* magick/nt_base.h (HAVE_TIFFISCODECCONFIGURED): Enable use of\n\tTIFFIsCODECConfigured in MSVC build.\n\n\t* coders/tiff.c: I am too lazy to modify VisualMagick configure so\n\tit is possible to include jpeglib.h in tiff.c, so block out this\n\tlow-value code just for MSVC builds.\n\n2015-06-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac, magick/profile.c: Removed support for lcms 1.X.\n\tNo one should be using a lesser version than lcms 2.0.\n\n2015-06-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (DisassociateBlob): Applied patch by Dirk Lemstra\n\tto assure that the image blob is no longer shared with other\n\timages when the image is written. This helps with thread safety.\n\n2015-06-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Add/fix utility usage messages for -box,\n\t-convolve, -gravity, -linewidth, -list, -mattecolor, -render and\n\t-shave.  Resolves SourceForge issue #302 \"MogrifyUsage prints\n\tincomplete information \".\n\n2015-06-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Include JPEG headers to obtain\n\tits BITS_IN_JSAMPLE definition.  This is needed so we can know\n\twhat JPEG depth libtiff supports.\n\n\t* www/index.rst: Add mention of GraphicsMagick having zero defects\n\treported by Coverity.\n\n2015-06-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/STL.cpp (adaptiveThresholdImage): Add a new\n\tconstructor which accepts a 'double' offset value.  The previous\n\tversion of this constructor is deprecated and subject to removal\n\tin the future.  The size of the class is enlarged to store a\n\t'double' and so this is a break in the ABI when this class was\n\tused.  Code using this class should be re-compiled.\n\n\t* Magick++/lib/Image.cpp (adaptiveThreshold): Add a new version of\n\tthis method which accepts a 'double' offset value.  The previous\n\tversion of the method is deprecated and subject to removal in the\n\tfuture.  Problem was reported by Dirk Lemstra.\n\n2015-05-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gray.c (ReadGRAYImage): Based on feedback from Glenn,\n\treturn a gray image from the reader, even if a channelized format\n\tspecifier is given.\n\n2015-05-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gray.c (ReadGRAYImage): Fix read glitch caused by\n\tincorrect memset(). Added missing break statement to switch.\n\tAdded more logging.\n\t(RegisterGRAYImage): Register \"gray\" formats R, G, B, C, M, Y, K,\n\tO such that they are not triggered by file extension.  It is\n\tnecessary to apply a magick prefix to the file name (or set image\n\tmagick in the API) in order to force using these formats.  This\n\tavoids accidents in case the file extension was used for some\n\tother purpose.\n\n2015-05-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gray.c: Added support for \"GRAYA\" format.  Format\n\tspecifiers \"R\", \"G\", \"B\", \"A\", \"C\", \"M\", and \"Y\" may now be used\n\tto save and restore the associated channel using the same raw\n\tformat as \"GRAY\".  These format specifiers were already supported\n\tbut did not appear to serve any useful function.\n\n2015-05-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Improve handling of libxml2 dependencies.  Only\n\ttest for and use libwmflite.  Full-up libwmf is no longer used.\n\t* configure.ac: Deduplicate CFLAGS and LDFLAGS.\n\n2015-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): Eliminate a \"clobber\"\n\tcompilation warning.\n\n\t* coders/jpeg.c (WriteJPEGImage): Eliminate a \"clobber\"\n\tcompilation warning.\n\n\t* configure.ac: Don't compute libwmf2 and libxml2 linkage path\n\tbased on claimed installation prefix.  This is hoped to improve\n\tconfigure reliability on multi-arch type systems.\n\n2015-05-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Use the first -I, -L, and -l arguments produced by\n\tfreetype-config and don't produce arguments based on installation\n\tprefix.  This is hoped to improve configure reliability on\n\tmulti-arch type systems.\n\n2015-05-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/tempfile.c (AcquireTemporaryFileDescriptor): P_tmpdir is\n\tnot an environment variable.  Need to consider Windows environment\n\tvariables for Cygwin.\n\n\t* magick/random.c (InitializeMagickRandomKernel): For Microsoft\n\tWindows, use CryptGenRandom() to salt the built-in random number\n\tgenerator.\n\n2015-05-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (MagickRandReentrant): Quiet Coverity 10092\n\t\"Calling risky function\".\n\t(MagickRandNewSeed): Quiet Coverity 10093 \"Calling risky\n\tfunction\".\n\n\t* coders/tga.c (ReadTGAImage): Quiet Coverity 10201 \"Identical\n\tcode for different branches\".\n\n\t* coders/pcx.c (ReadPCXImage): Quiet Coverity 10218 \"Identical\n\tcode for different branches\".\n\n2015-05-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GetGeometry): Fix handling of area geometries\n\tin the form \"5000000@\".  Resolves SourceForge issue #299 \"-resize\n\twith @ and > in geometry specification\".\n\n2015-05-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Disable matte channel for\n\tcompression types which don't support it.  Resolves SourceForge\n\tbug #297 \"GM distorts image using -transform\".\n\t(WriteTIFFImage): When type is Optimize, disable matte channel if\n\timage is opaque.\n\n2015-05-09  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n\n\t* webp/src/utils/endian_inl.h: Fixed defect in intrinsic function\n\tbyteswap_ulong for Visual Studio less than 2005.\n\n2015-05-08  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n\n\t* VisualMagick/configure/system_page.cpp,\n\tVisualMagick/configure/system_page.h: Suppress reloading .vcproj\n\twhen configuration type does not change.\n\n2015-05-08  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n\n\t* VisualMagick/configure/system_page.cpp,\n\tVisualMagick/configure/system_page.h,\n\tVisualMagick/configure/target_page.h: Ability to re-use already\n\tgiven paths. It is highly frustrating to enter path for different\n\tconfigurations again and again.\n\n2015-05-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/vid.c (ReadVIDImage): Fix use of uninitialized variable\n\treported by MSVC 2003 (but not GCC, Clang, or Coverity).\n\n2015-05-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Fix possible leak of profiles in\n\terror path.\n\n\t* coders/mpc.c (ReadMPCImage): Fix memory leak of values\n\tallocation.\n\t(ReadMPCImage): Fix possible leak of profiles in error path. Fixes\n\tCoverity 80697 \"Resource leak\".\n\n2015-05-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Fix memory leak of values\n\tallocation.\n\n2015-05-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Hopefully quiet Coverity 10305\n\t\"Untrusted loop bound\".\n\n\t* coders/tga.c (ReadTGAImage): Hopefully quiet Coverity 53418\n\t\"Untrusted loop bound\".\n\n\t* magick/tempfile.c (AcquireTemporaryFileDescriptor): Eliminate\n\tall use of operating system provided temporary file allocation\n\tfunctions (all apparently flawed in one way or another) and rely\n\texclusively on our own implementation.\n\n\t* magick/constitute.c (ConstituteImage): Quiet Coverity 53399\n\t\"Logically dead code\".\n\n\t* coders/webp.c (ReadWEBPImage): Quiet Coverity 53400 \"Logically dead\n\tcode\".\n\n\t* coders/miff.c (WriteRunlengthPacket): More work to quiet\n\tCoverity 10186 and 10214 \"Missing break in switch\".\n\n2015-05-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/tempfile.c (AcquireTemporaryFileDescriptor): Thoroughly\n\tvet temporary file path.  Might quiet Coverity 64613 \"Use of\n\tuntrusted string value\".\n\n\t* wand/magick_compat.c (ParseGeometry): Another try at quieting\n\tCoverity 10248 \"Copy into fixed size buffer\" and 10078\n\t\"Overlapping buffer in memory copy\" in this dead code.\n\n\t* magick/tempfile.c (AcquireTemporaryFileDescriptor): Remove\n\tunneeded, almost certainly never used, and potentially insecure\n\tuse of mkstemp().  Will quiet Coverity 10315 \"Insecure temporary\n\tfile\".\n\n2015-04-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Keep Ghostscript gibberish from appearing in\n\tConfigure output.\n\n\t* coders/miff.c (WriteRunlengthPacket): Quiet Coverity 10186 and\n\t10214 \"Missing break in switch\".\n\n\t* magick/pixel_cache.c (GetCacheInfo): Quiet Coverity 10208 \"Data\n\trace condition\".\n\n\t* magick/blob.c (CloneBlobInfo): Quiet Coverity 10188 \"Data race\n\tcondition\".\n\t(GetBlobInfo): Quiet Coverity 10191 \"Data race condition\".\n\n\t* magick/image.c (AllocateImage): Quiet Coverity 10196 \"Data race\n\tcondition\".\n\t(CloneImage): Quiet Coverity 10206 \"Data race condition\".\n\n\t* magick/map.c (MagickMapAllocateMap): Quiet Coverity 10192, 10193\n\tand 10228 \"Data race condition\".\n\n\t* configure.ac: Use an algorithm to try to discover the best value\n\tfor GSCMYKDevice.\n\n\t* VisualMagick/bin/delegates.mgk: Recipe for 'gs-cmyk' contained a\n\ttypo which breaks using '-type ColorSeparation'.\n\n\t* coders/pwp.c (ReadPWPImage): Fix Coverity CID 64491 \"Integer\n\thandling issues\".\n\n2015-04-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c (load_tile_rle): Quiet Coverity 10259 \"Untrusted\n\tloop bound\".\n\n\t* coders/sct.c (ReadSCTImage): Quiet Coverity 10285 \"Untrusted\n\tloop bound\".\n\n\t* coders/pwp.c (ReadPWPImage): Quiet Coverity 10299 \"Untrusted\n\tloop bound\".\n\n\t* coders/pcd.c (ReadPCDImage): Quiet Coverity 10301 \"Untrusted\n\tloop bound\".\n\n\t* coders/tga.c (ReadTGAImage): Quiet Coverity 53418 \"Untrusted\n\tloop bound\".\n\n\t* wand/magick_compat.c (ParseGeometry): Fix overlap strcpy() in\n\tdead code.  Quiets Coverity 10078 \"Overlapping buffer in memory\n\tcopy\" and 10248 \"Copy into fixed size buffer\".\n\n\t* magick/segment.c (Classify): Fix Coverity 64317 \"Resource leak\".\n\n2015-04-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c (ReadXCFImage): Fix Coverity 64064 \"Resource leak\".\n\n\t* coders/txt.c (ReadTXTImage): Fix Coverity 64061 \"Resource leak\".\n\n\t* coders/rla.c (ReadRLAImage): Fix Coverity 64063 \"Resource leak\".\n\n\t* coders/dib.c (ReadDIBImage): Fix Coverity 64057 Resource leak\".\n\n\t* magick/segment.c (Classify): Fix Coverity 64056 \"Resource leak\".\n\n\t* magick/resize.c (SampleImage): Fix Coverity 64053, 64054, and\n\t64062 \"Resource leak\".\n\n\t* magick/render.c (TraceStrokePolygon): Fix Coverity 64055, 64059,\n\tand 64060 \"Resource leak\".\n\n\t* magick/magick.c (ListModuleMap): Quiet Coverity 64058 \"Resource\n\tleak\".\n\n2015-04-28  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/dpx.c: Fix Coverity 10305 \"Untrusted loop bound\".\n\n\t* coders/cineon.c: Fix Coverity 10310 \"Untrusted loop bound\".\n\n2015-04-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/memory.c: All use of user-provided allocation functions\n\tis done via MagickFree(), MagickMalloc(), and MagickRealloc().\n\n2015-04-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colormap.c (MagickConstrainColormapIndex): For out of\n\trange condition, specifically return 0 rather than setting index\n\tto zero, and then returning index.\n\n\t* coders/pcx.c (ReadPCXImage): Fix Coverity 10197 \"Negative loop\n\tbound\".\n\n\t* coders/map.c (ReadMAPImage): Allocate pixels after return case\n\tfor 'ping' mode.\n\t(ReadMAPImage): Fix problem added in last commit due to multiple\n\tuses of 'packet_size'.\n\n\t* magick/floats.c (_Gm_convert_fp16_to_fp32)\n\t(_Gm_convert_fp24_to_fp32): Fix Coverity 10094 \"Logically dead\n\tcode\".\n\n\t* coders/pcx.c (ReadPCXImage): Fix Coverity 10197 \"Negative loop\n\tbound\".\n\n\t* coders/wpg.c (UnpackWPG2Raster): Always test for EOF from\n\tReadBlobByte().  Should fix Coverity 10205 \"Negative loop bound\".\n\n2015-04-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcx.c (ReadPCXImage): Add some more integer-overflow\n\tsafety to computations.  Add some casts.\n\n\t* coders/meta.c (formatIPTC): Fix Coverity 10221 \"Infinite loop\".\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Fix Coverity 10320\n\t\"Untrusted array index read\" and \"Untrusted loop bound\".\n\n2015-04-24  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/gif.c (ReadGIFImage): Attempt to fix Coverity issue\n\t10284 by using \"opacity = (header[3] & 0xff)\".\n\n2015-04-23  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* magick/blob.c (ReadBlobMSBLong, ReadBlobLSBLong): Attempt\n\tto fix various \"tainted\" or \"untrusted\" variables\n\tby masking off all but the lower 32 bits returned.\n\n2015-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c (ReadXCFImage): Fix Coverity 10216 \"Integer\n\toverflowed argument\".\n\n\t* magick/transform.c (FlipImage): Fix Coverity 61461 \"Division or\n\tmodulo by zero\".\n\n\t* coders/gif.c: Protect against integer overflow in array size\n\tcalculations.  Used unsigned type for colormap index.\n\n2015-04-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/map.c (ReadMAPImage): Maybe quiet Coverity 10326\n\t\"Untrusted pointer read\".\n\n\t* magick/utility.c (GlobExpression): See if testing for null\n\tterminating character quiets Coverity 10246 \"Untrusted value as\n\targument\".\n\n\t* magick/transform.c (FlipImage): Possibly quiet case #4 of\n\tCoverity 10311 \"Untrusted value as argument\".\n\n\t* magick/utility.c (Base64Encode): Quiet Coverity 10296 and 10272\n\t\"Use of untrusted scalar value\".\n\n2015-04-22  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* magick/blob.c (ReadBlobMSBShort, ReadBlobLSBShort): Attempt\n\tto fix various \"tainted\" or \"untrusted\" variables, e.g., in\n\tcoders/gif.c and coders/sgi.c by masking off all but the lower\n\t16 bits returned.\n\n2015-04-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tim.c (ReadTIMImage): Make TIM reader more robust against\n\tEOF.\n\n\t* coders/sct.c (ReadSCTImage): Make SCT reader more robust against\n\tEOF.\n\n\t* coders/pwp.c (ReadPWPImage): Test loop for EOF.\n\n\t* coders/otb.c (ReadOTBImage): Make error reporting a bit more\n\trobust.\n\n\t* coders/jnx.c (ExtractTileJPG): Add some EOF checks.\n\n\t* coders/cut.c (ReadCUTImage): Limit width/height to range of\n\tsigned integer.\n\n\t* tests/rwfile.tap: Add a R/W file test for ART.\n\n\t* tests/rwblob.tap: Add a R/W blob test for ART.\n\n\t* coders/art.c (ReadARTImage): Improve error checking.\n\n2015-04-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sun.c (ReadSUNImage): Try to quench Coverity 10280\n\t\"Untrusted loop bound\".\n\n\t* coders/mpc.c (ReadMPCImage): Port MIFF header reading fixes.\n\n2015-04-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): MIFF reader failed to read some\n\tMIFF headers properly.  Fixes SourceForge issue #298 \"invalid next\n\tsize (normal)/memory corruption\".\n\n2015-04-18  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Fix Coverity 55862 \"Resource leak\"\n\tand quiet Coverity 55825, 55826, and 55827 \"Data race condition\".\n\n2015-04-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GetToken): Fix an overlapping strlcpy() which\n\tcaused a crash in pedantic strlcpy() implementations while parsing\n\ta SVG-style URL from text.  Several other issues remain.\n\n2015-04-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (ParseUnixCommandLine): Fix Coverity 59256\n\t\"Unused value\".\n\n2015-04-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/display.c (MagickXROIImage): Fix Coverity 10179 \"Missing\n\tbreak in switch\".\n\t(MagickXCropImage): Fix Coverity 10211 \"Missing break in switch\".\n\n\t* magick/utility.c (Base64Decode): Fix Coverity 10203 \"Missing\n\tbreak in switch\".\n\t(Tokenizer): Quench Coverity 10182 \"Missing break in switch\".  Not\n\tbelieved to be an actual problem.\n\n\t* magick/command.c (ParseUnixCommandLine): Fix Coverity 10174 and\n\t10178 \"Missing break in switch\".\n\t(ProcessBatchOptions): Fix Coverity 10180 \"Missing break in\n\tswitch\".\n\t(ParseWindowsCommandLine): Fix Coverity 10220 \"Missing break in\n\tswitch\".\n\n\t* coders/xwd.c (ReadXWDImage): Fix Coverity 10095 \"Division or\n\tmodulo by zero\".  3rd try.\n\n2015-04-14  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Fix Coverity 55829 and 55846\n\t\"Resource leak\".\n\n2015-04-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/quantize.c (GrayscalePseudoClassImage): Fix Coverity\n\t55831 \"Resource leak\".  2nd try.\n\n\t* coders/vid.c (ReadVIDImage): Fix Coverity 55868 and 55874\n\t\"Resource leak\".  2nd try.\n\n2015-04-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/psd.c (ReadPSDImage): Fix Coverity 55855 \"Resource\n\tleak\". 2nd try.\n\n\t* coders/pict.c (PictPixmapOp): Fix Coverity 55875 and 55883\n\t\"Resource leak\". 2nd try.\n\n\t* coders/pcx.c (WritePCXImage): Fix Coverity 55877 \"Resource\n\tleak\". 2nd try.\n\n\t* coders/meta.c (format8BIM): Fix Coverity 55842 \"Resource\n\tleak\". 2nd try.\n\n\t* coders/mat.c (WriteMATLABImage): Fix Coverity 55850 \"Resource\n\tleak\". 2nd try.\n\n\t* coders/dpx.c (ReadDPXImage): Fix Coverity 55878 \"Resource leak\".\n\t2nd try.\n\n\t* coders/preview.c (WritePreviewImage): Fix Coverity 55988\n\t\"Resource leak\".\n\n2015-04-12  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Avoid some memory leaks\n\tnewly reported by Coverity (work in progress)\n\n2015-04-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resize.c (ScaleImage): Fix Coverity 55824 \"Division or\n\tmodulo by float zero\".\n\n\t* magick/annotate.c (AnnotateImage): Fix Coverity 55863\n\t\"Uninitialized scalar variable\".\n\n\t* wand/magick_wand.c (MagickDrawImage): Fix Coverity 55828\n\t\"Resource leak\".\n\t(MagickMontageImage): Fix Coverity 55835 \"Resource leak\".\n\n\t* wand/drawing_wand.c (DrawComposite): Fix Coverity 55849\n\t\"Resource leak\".\n\n\t* magick/widget.c (MagickXColorBrowserWidget): Fix Coverity 55854\n\t\"Resource leak\".\n\n\t* magick/resize.c (ScaleImage): Fix Coverity 55841, 55853, 55858,\n\tand 55860 \"Resource leak\".\n\n\t* magick/render.c (ConvertPathToPolygon): Fix Coverity 55836\n\t\"Resource leak\".\n\t(DrawDashPolygon): Fix Coverity 55837 \"Resource leak\".\n\n\t* magick/quantize.c (GrayscalePseudoClassImage): Fix Coverity\n\t55831 \"Resource leak\".\n\n\t* magick/paint.c (ColorFloodfillImage): Fix Coverity 55886\n\t\"Resource leak\".\n\n\t* magick/map.c (MagickMapAddEntry): Possibly silence 55844\n\t\"Resource leak\".\n\n\t* magick/image.c (CloneImage): Fix Coverity 55833 \"Resource leak\".\n\n\t* magick/effect.c (BlurImage): Fix Coverity 55851 \"Resource leak\".\n\n\t* magick/display.c (MagickXAnnotateEditImage): Fix Coverity 55830\n\t\"Resource leak\".\n\t(MagickXVisualDirectoryImage): Fix Coverity 55894 \"Resource leak\".\n\n\t* magick/constitute.c (ReadImages): Fix Coverity 55834 \"Resource\n\tleak\".\n\t(ReadInlineImage): Fix Coverity 55843 \"Resource leak\".\n\n\t* magick/compress.c (HuffmanEncode2Image): Fix Coverity 55839\n\t\"Resource leak\".\n\t(HuffmanDecodeImage): Fix Coverity 55859 \"Resource leak\".\n\n\t* magick/color.c (GetColorHistogram): Fix Coverity 55845 \"Resource\n\tleak\".\n\t(ComputeCubeInfo): Fix Coverity 55857 \"Resource leak\".\n\n\t* coders/yuv.c (ReadYUVImage): Fix Coverity 55890 \"Resource leak\".\n\n\t* coders/wpg.c (UnpackWPG2Raster): Fix Coverity 55832 and 55848\n\t\"Resource leak\".\n\n2015-04-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/vid.c (ReadVIDImage): Fix Coverity 55868 \"Resource leak\"\n\t(ReadVIDImage): Fix Coverity 55874 \"Resource leak\".\n\n\t* coders/txt.c (ReadTXTImage): Fix Coverity 55866 \"Resource leak\".\n\n\t* coders/topol.c (ReadTOPOLImage): Fix Coverity 55865 \"Resource\n\tleak\".\n\n\t* coders/sgi.c (WriteSGIImage): Fix Coverity 55891 \"Resource leak\".\n\n\t* coders/psd.c (ReadPSDImage): Fix Coverity 55855 \"Resource leak\".\n\n\t* coders/pict.c (WritePICTImage): Fix Coverity 55867, 55875, 55883\n\t\"Resource leak\".  Fix Coverity 55892 \"Resource leak\".\n\n\t* coders/pdb.c (ReadPDBImage): Fix Coverity 55840, 55856, and\n\t55885 \"Resource leak\".\n\n\t* coders/pcx.c (WritePCXImage): Fix Coverity 55877 \"Resource\n\tleak\".\n\n\t* coders/mvg.c (ReadMVGImage): Fix Coverity 55873 \"Resource leak\".\n\n\t* coders/mpeg.c (WriteMPEGImage): Fix Coverity 55880 \"Resource\n\tleak\".\n\n\t* coders/miff.c (WriteMIFFImage): Fix Coverity 55864 \"Resource\n\tleak\".\n\t(WriteMIFFImage): Fix Coverity 55872 \"Resource leak\".\n\n\t* coders/meta.c (formatIPTCfromBuffer): Fix Coverity 55838\n\t\"Resource leak\".\n\t(format8BIM): Fix Coverity 55842 and 55852 \"Resource leak\".\n\t(formatIPTC): Fix Coverity 5882 \"Resource leak\".\n\n\t* coders/mat.c (ReadMATImage): Fix Coverity 55850 \"Resource leak\".\n\n\t* coders/map.c (ReadMAPImage): Fix Coverity 55876 \"Resource leak\".\n\n\t* coders/logo.c (ReadLOGOImage): Fix Coverity 55870 \"Resource\n\tleak\".\n\n\t* coders/label.c (ReadLABELImage): Fix Coverity 55869 \"Resource\n\tleak\".\n\n\t* coders/icon.c (ReadIconImage): Fix Coverity 55887 \"Resource\n\tleak\".\n\n\t* coders/fits.c (WriteFITSImage): Fix Coverity 55884 \"Resource\n\tleak\".\n\n\t* coders/dpx.c (WriteDPXImage): Fix Coverity 55861 \"Resource\n\tleak\".\n\t(ReadDPXImage): Fix Coverity 55878 \"Resource leak\".\n\t(ReadDPXImage): Fix Coverity 55879 \"Resource leak\".\n\n\t* coders/dib.c (WriteDIBImage): Fix Coverity 55881 \"Resource\n\tleak\".\n\t(WriteDIBImage): Fix Coverity 55895 \"Resource leak\".\n\n\t* coders/cut.c (ReadCUTImage): Fix Coverity 55893 \"Resource leak\".\n\n\t* coders/caption.c (ReadCAPTIONImage): Fix Coverity 55888\n\t\"Resource leak\".\n\t(ReadCAPTIONImage): Fix Coverity 55889 \"Resource leak\".\n\t(ReadCAPTIONImage): Fix Coverity 55896 \"Resource leak\".\n\n\t* magick/annotate.c (RenderX11): Silence Coverity 10106 \"Logically\n\tdead code\".\n\n\t* coders/xcf.c: Silence Coverity 10224, 10233, and 10236 \"Improper\n\tuse of negative value\".\n\n\t* coders/mat.c (ReadMATImage): Silence Coverity 10175 \"Improper\n\tuse of negative value\"\n\n\t* coders/tga.c (ReadTGAImage): Silence Coverity 10088 \"Operands\n\tdon't affect result\".\n\n\t* magick/annotate.c (RenderFreetype): Silence Coverity 14396 and\n\t44755 \"Unused value\".\n\n\t* coders/wpg.c (LoadWPG2Flags): Silence Coverity 10273 and 10253\n\t\"Unused value\".\n\n\t* magick/montage.c (MontageImages): Silence Coverity 10255 \"Unused\n\tvalue\".\n\t(MontageImages): Silence Coverity 10264 \"Unused value\".\n\n2015-04-09  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Avoid using a NULL alpha_image\n\tor color_image. (ReadJNGImage): Removed an extraneous CloseBlob().\n\n2015-04-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (MagickCreateDirectoryPath): Silence Coverity\n\t10098 \"Logically dead code\".\n\n\t* magick/resource.c (InitializeMagickResources): Silence Coverity\n\t10101 \"Logically dead code\".\n\n\t* magick/magick.c (MagickSignalHandlerMessage): Fix Coverity 44725\n\t\"Logically dead code\".\n\n\t* magick/log.c (DestroyLogInfo): Silence Coverity 53659 and 53661\n\t\"Data race condition\".\n\t(ReadLogConfigureFile): Silence Coverity 53660 \"Data race\n\tcondition\".\n\n\t* magick/effect.c (DespeckleImage): Fix error handling issue\n\tcaused by shadowed variable.  Fixes Coverity 10099 \"Logically dead\n\tcode\".\n\n\t* magick/command.c (TimeImageCommand): Fix Coverity 10097\n\t\"Logically dead code\".\n\n\t* magick/attribute.c (ReadMSBLong): Hopefully silence Coverity\n\t10276 \"Unintended sign extension\".\n\n\t* coders/sgi.c (ReadSGIImage, WriteSGIImage): Fix Coverity 10243,\n\t10244, 10247, 10254, and 10294 \"Unintended sign extension\".\n\n2015-04-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/xwindow.c (MagickXMakeImage): Quiet Coverity 10282\n\t\"Unused value\".\n\n2015-04-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Another change targeting\n\tCoverity 44742 and 44746 \"Unintended sign extension\".\n\n2015-04-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (TracePath): Fix Coverity 10258 \"Uninitialized\n\tscalar variable\".\n\n\t* magick/widget.c (MagickXFontBrowserWidget): Fix Coverity 10323\n\t\"Sizeof not portable\".  2nd try.\n\n\t* coders/xwd.c (ReadXWDImage): Fix Coverity 10095, 10100, 10104\n\t\"Division or modulo by zero\".  2nd try.\n\n\t* magick/analyze.c (GetImageCharacteristics): Fix Coverity 10096\n\t\"Logically dead code\".\n\n\t* coders/yuv.c (ReadYUVImage): Fix Coverity 10260 \"Structurally\n\tdead code\".\n\n\t* coders/xcf.c (ReadXCFImage): Fix Coverity 10226 \"Missing break\n\tin switch\".\n\n\t* coders/tim.c (ReadTIMImage): Fix Coverity 10249 \"Unused value\".\n\n\t* coders/tiff.c (CompressionSupported): Fix Coverity 44723\n\t\"Logically dead code\".\n\t(WriteTIFFImage): Fix Coverity 44742 and 44746 \"Unintended sign\n\textension\".\n\n\t* coders/ps3.c (WritePS3Image): Validate results from TellBlob()\n\tand SeekBlob().  Should quiet Coverity 10198 \"Improper use of\n\tnegative value\".\n\n\t* coders/ps2.c (WritePS2Image): Validate results from TellBlob()\n\tand SeekBlob().  Should quiet Coverity 10230 \"Improper use of\n\tnegative value\".\n\n\t* coders/mpeg.c (WriteMPEGImage): Quiet Coverity 10176 \"Missing\n\tbreak in switch\".\n\n\t* coders/map.c (WriteMAPImage): Make MAP reader/writer more\n\trobust.  May quiet 10326 \"Untrusted pointer read\".\n\n\t* coders/locale.c (ReadLOCALEImage): Quiet Coverity 10108\n\t\"Logically dead code\".\n\n\t* coders/rle.c: Make URT RLE reader more robust.  Should quiet\n\tCoverity CID 10070 \"Bad bit shift operation\", as well as 10235\n\t\"Improper use of negative value\".\n\n2015-04-04  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOneJNGImage): Quiet Coverity CID issue 14370,\n\t\"Unused value\" (status was ignored).\n\n\t* coders/png.c (ReadOneJNGImage): Quiet Coverity CID issue 44724,\n\t\"Logically dead code\" (skip_to_iend can't be true).\n\n\t* coders/png.c (ReadOnePNGImage): Attempt to quiet Coverity\n\tCID 10232 \"Missing unlock\", by using png_error() instead of\n\tthrowing an exception.\n\n2015-04-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xwd.c (ReadXWDImage): Fix Coverity 10104 \"Division or\n\tmodulo by zero\".\n\n\t* magick/resize.c (ResizeImage): Fix Coverity 53404 \"Division or\n\tmodulo by zero\".\n\n\t* coders/ps3.c (WritePS3MaskImage): Fix Coverity 53415 \"Improper\n\tuse of negative value\".\n\n\t* coders/meta.c (parse8BIM): Fix Coverity 53413 \"Improper use of\n\tnegative value\".\n\t(parse8BIMW): Fix Coverity 53414 \"Improper use of negative value\".\n\n\t* magick/utility.c (GetMagickGeometry): Fix Coverity 53403 and\n\t53405 \"Division or modulo by float zero\".\n\t(GetPathComponent): Fix Coverity 53417 \"Wrong sizeof argument.\n\n\t* magick/quantize.c (GrayscalePseudoClassImage): Fix Coverity\n\t10256 \"Wrong sizeof argument\".\n\n\t* magick/image.c (ResetImagePage): Fix Coverity 53401 \"Division or\n\tmodulo by float zero\" and 53402 \"Division or modulo by float\n\tzero\".\n\n\t* coders/histogram.c (WriteHISTOGRAMImage): Silence Coverity 10107\n\t\"Division or modulo by float zero\".  2nd try.\n\n\t* magick/xwindow.c (MagickXImportImage): Silence Coverity 10207\n\t\"Array compared against 0\".\n\n\t* magick/widget.c (MagickXColorBrowserWidget): Silence Coverity\n\t53406 \"Identical code for different branches\".\n\t(MagickXListBrowserWidget): Silence Coverity 53407 \"Identical code\n\tfor different branches\".\n\n\t* magick/animate.c (MagickXMagickCommand): Silence Coverity 53410\n\t\"Identical code for different branches\".\n\n\t* coders/rgb.c (WriteRGBImage): Silence Coverity 53409 \"Identical\n\tcode for different branches\".\n\n\t* coders/cmyk.c (WriteCMYKImage): Silence Coverity 53408\n\t\"Identical code for different branches\".\n\n\t* magick/xwindow.c (MagickXMakeImage): Silence Coverity 44727\n\t\"Dereference after null check\".  2nd try.\n\n\t* magick/utility.c (EscapeString): Silence Coverity 53416\n\t\"Dereference before null check\".\n\n\t* coders/gif.c (WriteGIFImage): Fix Coverity 10219 \"Dereference\n\tnull return value\".\n\n\t* magick/log.c (InitializeLogInfo): Hopefully silence Coverity\n\t53411 and 53412 \"Data race condition\".\n\n\t* coders/cineon.c (AttributeToString): Silence Coverity 10079\n\t\"Buffer not null terminated\".  2nd try.  The buffer is not\n\trequired to be null terminated!\n\n\t* coders/pict.c (ReadPICTImage): 10171 \"Resource leak\".  2nd try.\n\n\t* coders/wmf.c (util_set_brush): Silence Coverity 44739\n\t\"Out-of-bounds access\".  2nd try.\n\n2015-03-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (SetLogEventMask): Silence Coverity 10069 \"Value\n\tnot atomically updated\".  Logging initialization is done\n\tsingle-threaded entirely in InitializeLogInfo() now.\n\n2015-03-28  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Attempt to quiet Coverity\n\t44734 \"Data race condition\" by freeing mng_info->png_pixels\n\tand mng_info->quantum_scanline separately from MngInfoFreeStruct.\n\n2015-03-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/widget.c (XEditText): Silence Coverity 10072 \"Overlapping\n\tbuffer in memory copy\"\n\n\t* coders/locale.c (ReadConfigureFile): Silence Coverity 10075\n\t\"Overlapping buffer in memory copy\".\n\n\t* magick/xwindow.c (MagickXMakeWindow): Silence Coverity 10076\n\t\"Overlapping buffer in memory copy\".\n\n\t* coders/dcm.c (funcDCM_TransferSyntax): Silence Coverity 10083\n\t\"Unchecked return value\".\n\n\t* magick/static.c (ExecuteStaticModuleProcess): Silence Coverity\n\t10082 \"Unchecked return value\".\n\n\t* coders/cals.c (ReadCALSImage): Silence Coverity 10086 \"Unchecked\n\treturn value from library\".\n\t(ReadCALSImage): Silence Coverity 10085 \"Unchecked return value\".\n\t(ReadCALSImage): Silence Coverity 10084 \"Unchecked return value\n\tfrom library\".\n\n\t* magick/enhance.c (ModulateImage): Silence Coverity 10087\n\t\"Unchecked return value\".\n\n2014-03-24  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n\n        * coders/wpg.c More paranoa in checking ReadBlobByte() negative return.\n\n2015-03-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (Generate8BIMAttribute): Silence Coverity\n\t10195 \"Argument cannot be negative\".\n\n\t* Magick++/lib/Image.cpp (syncPixels): Silence Coverity 44722\n\t\"Unchecked return value\".\n\t(fontTypeMetrics): Silence Coverity 44721 \"Unchecked return\n\tvalue\".\n\n\t* magick/render.c (ConvertPathToPolygon): Silence Coverity 10120\n\t\"Dereference after null check\".\n\n\t* magick/effect.c (EmbossImage): Silence Coverity 10114\n\t\"Dereference after null check\".\n\t(AdaptiveThresholdImage): Silence Coverity 10118 \"Explicit null\n\tdereferenced\".\n\n\t* coders/msl.c (MSLPushImage): Silence Coverity 10128 \"Dereference\n\tafter null check\".\n\n\t* magick/render.c (DrawPolygonPrimitive): Silence Coverity 10136\n\t\"Dereference after null check\".\n\n\t* wand/drawing_wand.c (DrawSetStrokeDashArray): Silence Coverity\n\t10117 \"Dereference after null check\".\n\n\t* magick/draw.c (DrawSetStrokeDashArray): Silence Coverity 10150\n\t\"Dereference after null check\".\n\n\t* wand/drawing_wand.c (DrawPushGraphicContext): Silence Coverity\n\t10151 \"Dereference after null check\".\n\n2015-03-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c (parse8BIM): Silence Coverity 10159 \"Explicit null\n\tdereferenced\".\n\t(parse8BIMW): Silence Coverity 10144 \"Explicit null dereferenced\".\n\n\t* coders/uil.c (WriteUILImage): Silence Coverity 10202\n\t\"Dereference after null check\".  In fact, UIL output was not\n\tworking at all due to this bug.\n\n\t* magick/xwindow.c (MagickXMakeImage): Silence Coverity 44727\n\t\"Dereference after null check\".\n\n\t* Magick++/lib/Image.cpp (colorMapSize): Silence Coverity 44728\n\t\"Dereference after null check\".\n\n\t* coders/vid.c (ReadVIDImage): Silence Coverity 44730 \"Explicit\n\tnull dereferenced\".\n\n\t* coders/mpc.c (ReadMPCImage): Silence Coverity 44732 \"Dereference\n\tafter null check\".\n\n\t* Magick++/lib/Image.cpp (signature): Silence Coverity 44735\n\t\"Dereference null return value\".\n\n\t* coders/ps.c (ReadPSImage): Ghostscript options concatenation\n\tshould be more secure against buffer overflow.\n\n\t* coders/pdf.c (ReadPDFImage): Applied patch by Chris Gilling such\n\tthat '-define pdf:stop-on-error=true' will stop PDF processing\n\timmediately upon an error.\n\t(ReadPDFImage): Ghostscript options concatenation should be more\n\tsecure against buffer overflow.\n\n2015-03-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/animate.c (MagickXAnimateImages): Silence Coverity 44736\n\t\"Dereference null return value\".  Also fixed apparent memory leak\n\tthat Coverity did not notice.\n\n\t* coders/fits.c (ReadFITSImage): Silence Coverity 10209\n\t\"Dereference before null check\".\n\n\t* magick/color_lookup.c (ReadColorConfigureFile): Silence Coverity\n\t44743 \"Dereference before null check\".\n\n\t* magick/xwindow.c (MagickXMakeImage): Silence Coverity 44745\n\t\"Dereference before null check\".\n\n\t* coders/pict.c (ReadPICTImage): Hopefully address consequences of\n\tCoverity 10292 \"Untrusted loop bound\" although it will likely\n\tstill complain.\n\n\t* magick/utility.c (LocaleCompare, LocaleNCompare): Try to create\n\tan implementation that Coverity won't label an \"tainted sink\", and\n\ttherefore result in a Coverity \"Use of untrusted scalar value\"\n\treport whenever a string from an external source is compared.  The\n\toriginal implementations are not believed to be faulty.\n\n2015-03-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (ProcessBatchOptions): Silence Coverity 10080\n\t\"Buffer not null terminated\".\n\n\t* magick/widget.c (MagickXConfirmWidget): Silence Coverity 10089\n\t\"Copy-paste error\".  This is an amazing find by Coverity.\n\n\t* magick/xwindow.c (MagickXImportImage): Silence Coverity 10207\n\t\"Array compared against 0\".\n\n\t* magick/quantize.c (GrayscalePseudoClassImage): Silence Coverity\n\t10256 \"Wrong sizeof argument\".\n\n\t* coders/tiff.c (ReadTIFFImage): Fix Coverity 44747 and 44748\n\t\"Extra sizeof expression\".\n\n2015-03-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Magick++/Include.h (Magick): Fix compilation with\n\t'clang' under Linux.  Build was broken yesterday.\n\n\t* coders/tiff.c (QuantumTransferMode): Fix reading Old JPEG and\n\tYCbCr sample images from libtiff pics-3.8.0.tar.gz image file\n\tcollection.  There was a regression for YCbCr added in last\n\trelease.\n\n2015-03-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (ReadBMPImage): Fix Coverity 44726 \"Division or\n\tmodulo by float zero\".  I don't think that this can actually\n\thappen due to prior checks.\n\n\t* magick/xwindow.c (MagickXMakeWindow): Silence Coverity 10281\n\t\"Copy into fixed size buffer\".\n\n\t* coders/pdf.c (ReadPDFImage): Silence Coverity 10241 \"Copy into\n\tfixed size buffer\".\n\n\t* magick/type.c (ReadTypeConfigureFile): Silence Coverity 10242\n\t\"Copy into fixed size buffer\".\n\n\t* magick/utility.c (GetPathComponent): Silence Coverity 10263\n\t\"Copy into fixed size buffer\".\n\n\t* coders/txt.c (ReadTXTImage): Silence Coverity 10287 \"Copy into\n\tfixed size buffer\".\n\n\t* coders/ps.c (WritePSImage): Silence Coverity 10289 \"Copy into\n\tfixed size buffer\".\n\n\t* magick/delegate.c (ReadConfigureFile): Silence Coverity 10297\n\t\"Copy into fixed size buffer\".\n\n\t* magick/log.c (ReadLogConfigureFile): Silence Coverity 10300\n\t\"Copy into fixed size buffer\".\n\n\t* coders/ps3.c (WritePS3Image): Silence Coverity 10303 \"Copy into\n\tfixed size buffer\".\n\n\t* coders/pdf.c (WritePDFImage): Silence Coverity 10304 \"Copy into\n\tfixed size buffer\".\n\n\t* coders/ps.c (ReadPSImage): Silence Coverity 10306 \"Copy into\n\tfixed size buffer\".\n\n\t* coders/msl.c (MSLStartElement): Silence Coverity 10308 \"Copy\n\tinto fixed size buffer\".\n\n\t* coders/ps2.c (WritePS2Image): Silence Coverity 10309 \"Copy into\n\tfixed size buffer\".\n\n\t* Magick++/lib/Geometry.cpp (operator): Silence Coverity 44749\n\t\"Copy into fixed size buffer\".\n\n\t* Magick++/lib/Image.cpp (annotate): Silence Coverity 44750 \"Copy\n\tinto fixed size buffer\".\n\n\t* coders/ept.c (ReadEPTImage): Silence Coverity 44751 \"Copy into\n\tfixed size buffer\".\n\n\t* coders/wmf.c (ipa_device_begin): Silence Coverity 44753 \"Copy\n\tinto fixed size buffer\".\n\t(lite_font_map): Silence Coverity 44752 \"Copy into fixed size\n\tbuffer\".\n\n\t* magick/random.c (InitializeMagickRandomKernel): Silence Coverity\n\t10091 \"Don't Call\" in the case where /dev/random is available.\n\n\t* coders/mpeg.c (WriteMPEGParameterFiles): Fix Coverity 10190\n\t\"Resource leak\".  File descriptor was leaked under certain error\n\tconditions.\n\n\t* coders/wpg.c (UnpackWPG2Raster): Fix Coverity 10312\n\t\"Uninitialized scalar variable\" gripe.\n\n\t* magick/utility.c (ListFiles): Possibly address\n\tCoverity 10245 \"Sizeof not portable\" gripe.\n\n\t* magick/widget.c (MagickXFontBrowserWidget): Possibly address\n\tCoverity 10323 \"Sizeof not portable\" gripe.\n\n\t* coders/mat.c (WriteMATLABImage): FormatString() requires a\n\tbuffer of MaxTextExtent bytes.  Use sprintf instead.  Fix for\n\tCoverity issue 10170.\n\n\t* Magick++/lib/Geometry.cpp (string): FormatString() requires a\n\tbuffer of MaxTextExtent bytes. Fix for Coverity issue 44737.\n\n\t* coders/wmf.c (draw_pattern_push): FormatString() requires a\n\tbuffer of MaxTextExtent bytes.  Fix for Coverity issue 44741.\n\t(ipa_device_begin): FormatString() requires a buffer of\n\tMaxTextExtent bytes.  Fix for Coverity issue 44740.\n\t(util_set_brush): FormatString() requires a buffer of\n\tMaxTextExtent bytes. Fix for Coverity issue 44739.\n\t(ipa_region_clip): FormatString() requires a buffer of\n\tMaxTextExtent bytes. Fix for Coverity issue 44738.\n\n2015-03-15  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (WritePNGImage) Avoid a Coverity gripe about\n\tpotential NULL dereference (actually it is impossible because\n\tpng_error() does not return. Fix for Coverity gripe 44731.\n\n\t* coders/png.c (WritePNGImage) Avoid a null pointer dereference\n\twhile logging inherited color_type. Fix for Coverity issue 10185.\n\n\t* coders/png.c (WriteOneJNGImage) Avoid possible unintended sign\n\textension. Fix for Coverity issue 44744.\n\n\t* coders/png.c (WriteOnePNGImage) Quiet a false Coverity warning\n\tabout dereference after NULL check.  Fix for Coverity issue 44729.\n\n\t* coders/png.c (ReadOnePNGImage): Redid the \"Respect the\n\tPixelsResource limit\" patch of March 7, using unsigned arithmetic\n\tto determine the width limit.  Sometimes the calculated\n\twidth limit was incorrectly zero.\n\n2015-03-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageInfo): Fix problems with reading\n\tfilenames that include a colon.  Resolves SourceForge bug #294\n\t\"display and convert (probably other things too) choke on\n\tfilenames with colons in\".\n\n\t* magick/utility.c (GetPathComponent): Fix SubImagePath\n\textraction. Fixes SourceForge bug #66 \"converting runs slowly when\n\tsubimage is specified\".\n\n2015-03-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc (-geometry): Document the significance of 'x'\n\tas used in a geometry specification.  In particular, document that\n\tif width is specified without a trailing 'x' that height is set to\n\twidth.  This is in response to SourceForge bug #296 \"Strange\n\t-resize WIDTH results with version 1.3.21\".\n\n2015-03-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (GlobExpression): Remove use of IsSubimage().\n\n\t* magick/image.c (IsSubimage): Re-implement with a more robust\n\tsolution.  Combined with fixes to ps.c and pdf.c, allows selecting\n\tspecific pages, as well as re-ordering.\n\n\t* coders/ps.c (ReadPSImage): Set image frame scene ids\n\tappropriately.\n\n\t* coders/pdf.c (ReadPDFImage): Set image frame scene ids\n\tappropriately.\n\n\t* magick/utility.c (TranslateTextEx): -format %Q should report\n\tJPEG quality estimate if it is available.  Resolves SourceForge\n\tbug #293 \"gm identify bug?\".\n\n\t* doc/options.imdoc: Documented JPEG-specific -format tags.\n\n2015-03-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Image.cpp (repage): New method to reset page\n\tsettings.  Contributed by Dirk Lemstra.\n\n2015-03-07  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Respect the PixelsResource\n\tlimit.\n\n\t* coders/png.c (ReadOnePNGImage): Moved quantum_scanline\n\tand png_pixels into the MngInfo struct.  This prevents\n\tmemory leaks when reading malformed PNG images, but unfortunately\n\ttriggers a new complaint about a possible race condition.\n\n\t* coders/png.c (ReadOnePNGImage): Removed two superflous calls to\n\tCloseBlob().\n\n\t* coders/png.c (ReadOnePNGImage): Do the allocation and free of\n\tquantum_scanline outside the \"pass\" loop, i.e., do it once per\n\timage rather than once per pass while decoding interlaced PNG\n\timages.  Log these when -debug coders is enabled.\n\n\t* coders/png.c: Fixed typo recently introduced in the JNG reader\n\t(status != MagickFalse should be status == MagickFalse).\n\n2015-03-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xwd.c (ReadXWDImage): Fix memory leaks in error paths.\n\n\t* coders/xpm.c (ReadXPMImage): Fix memory leaks in error paths.\n\n\t* coders/miff.c (ReadMIFFImage): Fix memory leak of Image in error\n\tcase.\n\t(ReadMIFFImage): Fix memory leaks of zlib and bzlib2 context in\n\terror path which reports decompression failure.\n\n\t* coders/bmp.c (ReadBMPImage): BMP reader was wrongly rejecting\n\tRLE-compressed files as being too small.  Fixes SourceForge bug\n\t#295 \"1.3.21 identify regression\".  Also fixed 'ping' support code\n\twhich was still reading the pixels in 'ping' mode.\n\t(ReadBMPImage): Fix memory leak when BMP is handled as a sequence.\n\n2015-03-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/palm.c (ReadPALMImage): PALM reader now applies PALM's\n\tspecial non-linear colormap if the file does not provide a custom\n\tcolormap.  Custom colormap size is verified to not exceed image\n\tcolors.  Added logging statements regarding colormap.\n\n2015-02-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/index.rst: Update for 1.3.21 release.\n\n\t* www/Changes.rst: Update for 1.3.21 release.\n\n\t* NEWS.txt: Update NEWS for 1.3.21 release.\n\n\t* version.sh: Bump/adjust library versioning.\n\n2015-02-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/delegate.c: Fix compilation under Cygwin. Thanks to Marco\n\tAtzeri for advising us of this problem.\n\n2015-02-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/error.h (ThrowReaderException): More significant\n\texceptions (e.g. errors) should overwrite less significant\n\texceptions (e.g. warnings) thrown earlier.\n\n\t* coders/bmp.c (ReadBMPImage): Detect 32-bit integer overflows and\n\tother annoyances caused by intentionally broken files.  Also, only\n\twarn if the file header claims the file is larger than it is since\n\tthis is a benign issue.\n\n\t* magick/blob.c (OpenBlob): Fix \"magic header bytes\" log message\n\tcount value.\n\n2015-02-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated NEWS with more changes.\n\n\t* Magick++/lib/Magick++/Include.h (Magick): Add GetImageGeometry\n\tto MagickLib namespace in order to avoid a compilation problem\n\tnoticed with Visual C++ 6.0.\n\n2014-02-22  Jaroslav Fojtik  <JaFojtik@seznam.cz>\n\n\t* VisualMagick\\configure\\configure.cpp Fixed crash.\n        Renamed debug to configure_d.exe to prevent mess.\n\n2015-02-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (InitializeMagick): Invoke\n\tNTInitializeExceptionHandlers() under Windows.\n\n\t* magick/nt_base.c (NTInitializeExceptionHandlers): Add a new\n\tprivate function which disables pop-up Windows on exceptions and\n\tregisters a handler for Windows exceptions to clean up temporary\n\tfiles prior to program exit.\n\n\t* magick/magick.c (PanicDestroyMagick): Use\n\tPurgeTemporaryFilesAsyncSafe() rather than PurgeTemporaryFiles().\n\t(InitializeMagickSignalHandlers): Always register for SIGINT, even\n\tunder Microsoft Windows.\n\n\t* magick/tempfile.c (PurgeTemporaryFilesAsyncSafe): New private\n\tfunction to clean up temporary files prior to program exit.\n\tAsync-safe so it can be safely called from a signal handler.\n\tIntentionally leaks memory.\n\n2015-02-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Fix crash while\n\tparsing corrupt EXIF which was reported by Stijn Sanders on\n\t2015-02-17.\n\n\t* Magick++/lib/{Blob.cpp, Image.cpp}: Incorrect lock scope\n\tresulted in Magick++ locking not actually working to protect\n\tcritical sections in spite of no detected problems with locking\n\tthese past 16 years.  Problem was detected using the\n\tmisc-unused-raii check from clang-tidy and was reported by Hyrum\n\tWright.\n\n\t* coders/palm.c (ReadPALMImage): Add header logging to writer.\n\tWriter still seeks and overwrites its own header so logging is not\n\tentirely accurate yet.\n\n2015-02-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* libtool: Update GNU libtool to 2.4.6.\n\n\t* coders/palm.c (ReadPALMImage): Fix support for transparency in\n\tPALM reader.\n\n2015-02-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/palm.c (ReadPALMImage): Major re-work of PALM reader.\n\tMore log message improvements.  More header validation.\n\n2015-02-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/palm.c (ReadPALMImage): Improve log messages.  Add more\n\theader validation.  Check image pixel limits.  Support 'ping'\n\tmode.\n\n2015-02-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/palm.c (ReadPALMImage): PALM reader now supports 1, 2, 4,\n\t8, and 16-bit test files we were able to generate using\n\t'pnmtopalm'.  A progress monitor was added.  Memory leaks in error\n\tpaths were fixed.\n\n2015-02-12  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Insert \"if (QuantumTick(...))\" ahead of\n\teach \"if (!MagickMonitorFormatted(...)\".\n\n2015-02-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/rla.c (ReadRLAImage): Assure that header ASCII strings\n\tare properly terminated.  Resolves Coverity CID 10322.\n\n2015-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.h (STDERR_FILENO): Provide definitions for\n\tstandard POSIX file numbers so that Visual Studio should compile.\n\tFixes SourceForge bug #291 \"STDERR_FILENO (used in magick.c) is\n\tnot defined under Windows\"\n\n2015-02-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Image.cpp (Image::quiet()): Patch by Dirk Lemstra\n\tto support silencing warnings in Magick++.  Adds a quiet() method\n\twhich blocks (ignores) warning exceptions when passed a true\n\targument.  Warning exceptions are still generated by default.\n\n\t* coders/tiff.c: Support '-define tiff:report-warnings=true' to\n\tenable that warnings reported by libtiff are thrown as warning\n\texceptions so that they may be caught or will be reported at the\n\tgm command-line.\n\n2015-02-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Use YCbCr encoding when JPEG\n\tcompression is requested for an RGB image.\n\n2015-02-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (QuantumTransferMode): Fix reading or writing\n\tplanar min-is-white or min-is-black images with an associated\n\talpha channel.\n\n2015-02-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (ReadXPMImage): Reading empty XPM file should not\n\tcause bad memory access.\n\n\t* coders/gif.c (DecodeImage): Assure that GIF decoder does not use\n\tunitialized data.\n\n\t* coders/jpeg.c (ReadJPEGImage): Verify that we support the number\n\tof output components before proceeding to decode the image.\n\n2015-01-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): MIFF needs to stop spinning if\n\tzlib or bzlib report an error while decompressing.  Solves problem\n\twith file provided by Jodie Cunningham on 2015-01-25.\n\n\t* coders/vicar.c (ReadVICARImage): Fix Vicar reader's dogged\n\tdetermination to continue reading when there is nothing left to\n\tread.  Solves problem with file provided by Jodie Cunningham on\n\t2015-01-25.\n\n\t* magick/magick.c (PanicDestroyMagick): Replace memory allocation\n\tfunctions with dummy functions rather than NULL pointers.\n\t(InitializeMagickSignalHandlers): Register\n\tMagickPanicSignalHandler() for SIGSEGV.\n\t(MagickPanicSignalHandler): Produce an informative message for the\n\tuser.\n\t(MagickSignalHandlerMessage): Include more detailed information\n\tfrom the signal handler via a common routine used by default\n\tsignal handlers.\n\n2015-01-25  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/bmp.c (ReadBMPImage): An attempt to address CID 10291.\n\n2015-01-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (Exit): Changed to return 'void'. Function can\n\tnot return a value if it does not return.\n\n\t* magick/error.c (DefaultFatalErrorHandler): Invoke\n\tPanicDestroyMagick() rather than DestroyMagick().  If we are\n\treally that short on memory, DestroyMagick() might not work.\n\n\t* magick/magick.c (MagickPanicSignalHandler): Only use async-safe\n\tfunctions in signal handler.\n\t(PanicDestroyMagick): New function for emergency release of\n\tpersistent resources just prior to program exit.  Async-safe and\n\tdoes not acquire or release any heap memory.\n\n\t* magick/export.c: Eliminate two 'clang' warnings.\n\n2015-01-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdb.c (ReadPDBImage): Fix typo.\n\n\t* coders/cineon.c (ReadCINEONImage): Enforce that Cineon image\n\tinfo channels is valid.  Solves problem with file provided by\n\tJodie Cunningham on 2015-01-24\n\n\t* coders/fits.c (ReadFITSImage): Enforce valid bits-per-pixel\n\tvalues.  Add detailed header logging.  Solves problem with file\n\tprovided by Jodie Cunningham on 2015-01-24\n\n2015-01-22  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadPNGImage): Check length of various MNG\n\tchunks before using the chunk data.\n\n\t* coders/png.c (WriteOnePNGImage): Use png_error() instead of\n\tthrowing an exception so cleanup in the setjmp block can happen,\n\tincluding unlocking the semaphore.  Addresses Coverity CID 10184.\n\n2015-01-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (WriteGIFImage): Don't use an unchecked value from\n\tGetImageAttribute(), even if the access succeeded before.\n\tResolves Coverity CID 10219.\n\n\t* coders/dpx.c (StringToAttribute): Make sure that string is not\n\taccidentally shortened by one character if it occupies the full\n\tfield size.\n\t(ReadDPXImage): Validate that the bits per sample claimed by the\n\tfile header is a supported depth before using it further in the\n\tcode.  This might resolve Coverity CID 10071 \"Bad shift\n\toperation\".\n\t(ReadDPXImage): Check for EOF while reading forward to element\n\tdata.  Might solve Coverity CID 10305.\n\n\t* coders/dib.c (ReadDIBImage): Resolve Coverity CID 10228 \"Integer\n\toverflowed argument\".\n\t(ReadDIBImage): Hopefully resolve Coverity CID 10268 \"Various\",\n\twhich is primarily about placing too much trust in the claimed\n\tnumber of colors.\n\n\t* coders/pnm.c (WritePNMImage): Fix overwrite of status by\n\tprogress monitor.  Remaining issues may lurk within.  May resolve\n\tCoverity CID 10288.\n\n\t* coders/pdb.c: Resolve Coverity CID 11173 \"Buffer not null\n\tterminated\".\n\n2015-01-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (GetMagickInfoArray): Resolve Coverity CID 10212\n\t\"Missing unlock\".\n\n\t* magick/colormap.c (ReplaceImageColormap): Allocate new image\n\tcolormap up front in order to avoid the possibility that we are\n\tleft with an image with no colormap due to memory allocation\n\tfailure. If there is a memory allocation failure, then the\n\toriginal colormap is preserved.  Resolves Coverity CID 10194\n\t\"Dereference after null check\".\n\n\t* magick/utility.c (MagickStripSpacesFromString): New private\n\tutility function to strip spaces from a string.\n\n\t* magick/color_lookup.c (GetColorInfoArray): Resolves Coverity CID\n\t10231 \"Missing unlock\"\n\t(ReadColorConfigureFile): Resolves Coverity CID 10261 \"Use of\n\tuntrusted scalar value\"\n\t(GetColorInfo): Resolves Coverity CID 10077 \"Overlapping buffer in\n\tmemory copy\".\n\n2015-01-21  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Use png_error() instead of\n\tthrowing an exception so cleanup in the setjmp block can happen,\n\tincluding unlocking the semaphore.  Resolves Coverity CID 10232.\n\n\t* coders/png.c (ReadOnePNGImage): Moved a logging statement into a\n\tblock where \"attribute\" has been checked for NULL.  Resolves\n\tCoverity CIDs 10185 and 10187.\n\n\t* coders/png.c (ReadMNGImage): Fixed a cut-and-paste typo\n\t(change_delay should be change_timeout) reported by Coverity\n\tCID 10090.\n\n2015-01-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (CloneImage): The definition is poor as to what a\n\tnon-orphan clone should do.  However, the definition surely does\n\tnot include crashing the software or supplanting the original\n\timage in an image list.  Clone image blob and previous/next\n\tpointers but do not supplant original image in list.  Resolves\n\tCoverity CID 10155.\n\n2015-01-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (WriteRowSamples): Ensure that callback function is\n\talways defined. Resolves Coverity CID 10122.\n\t(ReadRowSamples): Ensure that callback function is always\n\tdefined. Resolves Coverity CID 10125.\n\n\t* magick/random.c (InitializeMagickRandomKernel): Avoid possible\n\tdouble-close of file.  Resolves Coverity CID 10257.\n\n\t* coders/histogram.c (WriteHISTOGRAMImage): Avoid possible divide\n\tby zero exception.  Resolves Coverity CID 10107.\n\n\t* magick/error.c (MagickFatalError): Document that\n\tMagickFatalError() is not supposed to return (program must quit)\n\tand add GCC/Clang hints to that effect.\n\n\t* magick/bit_stream.c (BitAndMasks): Avoid possible access\n\tone-beyond end of BitAndMasks array.  It is not clear if there is\n\ta possible bug with 32-bit quantums.  If there is a bug, it has\n\tnot been noticed via testing.  Resolves Coverity CID 10213.\n\n\t* magick/tempfile.c (AcquireTemporaryFileDescriptor): Avoid buffer\n\toverrun in the case of an astonishingly long environment variable\n\tstring.  Resolves Coverity CID 10267.\n\t(AddTemporaryFileToList): Use strlcpy() rather than strlcpy().  In\n\tpractice, should not make a difference.  Will quiet Coverity CID\n\t10321.\n\n\t* magick/command.c (GMCommandSingle): Don't use the address of a\n\tstack allocation to update argv[0]. Removed updating argv[0] until\n\ta better design can be found.  Resolves Coverity CID 10223.\n\t(GMCommandSingle): Plan B: Use static allocation from\n\tSetClientName() to both store the new command name and provide\n\tstorage for argv[0].\n\n\t* magick/utility.c (SystemCommand): Fix possible overwrite of\n\tmemory location due to uninitialized 'end' pointer.  Resolves\n\tCoverity CID 10251.\n\n\t* magick/blob.c (WriteBlobFile): Was not closing file in certain\n\terror conditions.  Resolves Coverity CID 10237.\n\n\t* coders/cineon.c (ReadCINEONImage): Don't trust file header so\n\tmuch.  Resolves Coverity CIDs 10079, 10310, 10325.\n\n\t* coders/art.c (ReadARTImage): Fix signed vs unsigned comparison\n\tcaused by earlier changes.\n\n2014-01-17 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Do not execute wpg raster read in ping mode.\n\n2014-01-15 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Properly deallocating zip structures.\n\n2015-01-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sfw.c (ReadSFWImage): Fix pixel cache access errors in\n\t'ping' mode.\n\n2015-01-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c (ReadWMFImage): Fix memory leak in 'ping' mode and\n\tsome error paths.\n\n2015-01-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jbig.c (ReadJBIGImage): Fix memory leak in 'ping' mode.\n\n\t* magick/delegate.c (InvokeDelegate): Fix memory leak of argument\n\tlist when invoking external program via MagickSpawnVP().\n\n2015-01-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c (InitializeMagickResources): Base image width\n\tand height default limits on the range of a 32-bit signed integer,\n\teven for 64-bit builds.  These limits are still beyond what most\n\tcomputers in the world can handle.  Limits can be increased by the\n\tuser.\n\n\t* coders/xwd.c (ReadXWDImage): Check image size limits\n\timmediately.\n\n\t* coders/xc.c (ReadXCImage): Check image size limits immediately.\n\n\t* coders/webp.c (ReadWEBPImage): Check image size limits\n\timmediately.\n\n\t* coders/viff.c (ReadVIFFImage): Check image size limits\n\timmediately.\n\n\t* coders/vicar.c (ReadVICARImage): Check image size limits\n\timmediately.\n\n\t* coders/txt.c (ReadTXTImage): Check image size limits\n\timmediately.\n\n\t* coders/ttf.c (ReadTTFImage): Check image size limits\n\timmediately.\n\n\t* coders/tim.c (ReadTIMImage): Check image size limits\n\timmediately.\n\n\t* coders/tiff.c (ReadTIFFImage): Check image size limits\n\timmediately.\n\n\t* coders/tga.c (ReadTGAImage): Check image size limits\n\timmediately.\n\n\t* coders/sgi.c (ReadSGIImage): Check image size limits\n\timmediately.\n\n\t* coders/sct.c (ReadSCTImage): Check image size limits\n\timmediately.\n\n\t* coders/rle.c (ReadRLEImage): Check image size limits\n\timmediately.\n\n\t* coders/rla.c (ReadRLAImage): Check image size limits\n\timmediately.\n\n\t* coders/psd.c (ReadPSDImage): Check image size limits\n\timmediately.\n\n\t* coders/pnm.c (ReadPNMImage): Check image size limits\n\timmediately.\n\n\t* coders/pix.c (ReadPIXImage): Check image size limits\n\timmediately.\n\n\t* coders/pict.c (ReadPICTImage): Check image size limits\n\timmediately.\n\n\t* coders/pdb.c (ReadPDBImage): Check image size limits\n\timmediately.\n\n\t* coders/pcx.c (ReadPCXImage): Check image size limits\n\timmediately.\n\n\t* coders/pcd.c (ReadPCDImage): Check image size limits\n\timmediately.\n\n\t* coders/otb.c (ReadOTBImage): Check image size limits\n\timmediately.\n\n\t* coders/null.c (ReadNULLImage): Check image size limits\n\timmediately.\n\n\t* coders/mvg.c (ReadMVGImage): Check image size limits\n\timmediately.\n\n\t* coders/mtv.c (ReadMTVImage): Check image size limits\n\timmediately.\n\n\t* coders/mpc.c (ReadMPCImage): Check image size limits\n\timmediately.\n\n\t* coders/miff.c (ReadMIFFImage): Check image size limits\n\timmediately.\n\n\t* coders/jpeg.c (ReadJPEGImage): Check image size limits\n\timmediately.\n\n\t* coders/jp2.c (ReadJP2Image): Check image size limits\n\timmediately.\n\n\t* coders/jbig.c (ReadJBIGImage): Check image size limits\n\timmediately.\n\n\t* coders/hdf.c (ReadHDFImage): Check image size limits\n\timmediately.\n\n\t* coders/gif.c (ReadGIFImage): Check image size limits\n\timmediately.\n\n\t* coders/fpx.c (ReadFPXImage): Check image size limits\n\timmediately.\n\n\t* coders/fax.c (ReadFAXImage): Check image size limits\n\timmediately.\n\n\t* coders/dpx.c (ReadDPXImage): Check image size limits\n\timmediately.\n\n\t* coders/dps.c (ReadDPSImage): Check image size limits\n\timmediately.\n\n\t* coders/dib.c (ReadDIBImage): Check image size limits\n\timmediately.\n\n\t* coders/dcm.c (ReadDCMImage): Check image size limits\n\timmediately.\n\n\t* coders/cut.c (ReadCUTImage): Check image size limits\n\timmediately.\n\n\t* coders/cineon.c (ReadCINEONImage): Check image size limits\n\timmediately.\n\n\t* coders/avs.c (ReadAVSImage): Check image size limits\n\timmediately.\n\n\t* coders/art.c (ReadARTImage): Check image size limits\n\timmediately.\n\n\t* coders/sun.c (ReadSUNImage): Check image size limits in advance\n\tof allocating memory for pixels.\n\n\t* coders/bmp.c (ReadBMPImage): Check image size limits in advance\n\tof allocating memory for pixels.\n\n\t* coders/sun.c (ReadSUNImage): There is no definition for Sun map\n\ttype RMT_RAW so it can not be supported.  Update DirectClass\n\tpixels directly rather using SyncImage().  Problem was reported by\n\tJodie Cunningham.\n\n2015-01-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (ReadPICTImage): Fix PICT reader crash when\n\treading corrupted file.\n\n\t* coders/sun.c (ReadSUNImage): Sun reader was still not as robust\n\tas it should be.  Now it is.\n\n2014-01-10 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Fixed reading behind EOF issue.\n\n2015-01-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (LSBPackedU32WordToOctets): Fix typo which adds\n\tsevere corruption to encoded little-endian 32-bit packed output.\n\tThe good news is that since the corruption is severe, it is easily\n\tvisually detected.  The problem has corrupted all such\n\t(little-endian 10-bit) output since it was originally implemented\n\ton 2007-06-17 (changeset 11686, first released in GraphicsMagick\n\t1.1.8).  GraphicsMagick preserves the endianness of input DPX\n\tfiles by default, defaults to big-endian, and DPX files are\n\tcommonly big-endian, so this problem may not have occured for many\n\tusages.  Problem was reported by Steve Dabner on the\n\tGraphicsMagick discussion mailing list.\n\n2015-01-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (MagickPanicSignalHandler): Print a message in\n\tthe case of signals SIGXCPU and SIGXFSZ.\n\n\t* coders/bmp.c (ReadBMPImage): Don't hang in endless loop if EOF\n\tis encountered while checking for \"BA\" header.\n\n\t* coders/icon.c (ReadIconImage): Limit icon image allocation size.\n\n2015-01-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/icon.c (ReadIconImage): Removed all of the\n\tpreviously-existing DIB reading code from icon.c and use new\n\t\"ICODIB\" reader to read DIB icons, or the PNG reader to read PNG\n\ticons.\n\n\t* coders/dib.c (ReadDIBImage): Added an \"ICODIB\" coder for\n\tinternal use which reads a Windows BMP 3 DIB followed by a Windows\n\tICO alpha mask.  This allows existing DIB code to be used to read\n\tICO directory entries.\n\n2015-01-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/icon.c: The Windows ICO reader is now more robust.  Still\n\ta work in progress since some files still can not be read or read\n\tincorrectly.\n\n2015-01-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resource.c (ListMagickResourceInfo): \"kilo\" for binary\n\tprefixes is supposed to be \"Ki\".\n\n\t* magick/utility.c (FormatSize): \"kilo\" for binary prefixes is\n\tsupposed to be \"Ki\".\n\n2015-01-01  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Use WidthResource and HeightResource instead\n\tof fixed 1-million limit for rows and columns.\n\n2015-01-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (FormatSize): Add 'i' to value range\n\tidentifiers since these are all in units of 2^10 rather than 1000.\n\n\t* magick/pixel_cache.c (CheckImagePixelLimits): Fix typo and\n\tproduce an informative error message.\n\n\t* magick/resource.c: Added support for Image width and height\n\tpixels resource limits.\n\n\t* magick/resource.h (ResourceType): New resource enumerations\n\tWidthResource and HeightResource.\n\n\t* magick/enum_strings.c (StringToResourceType): Added support for\n\tparsing '-limit Width' and '-limit Height'.\n\n\t* magick/pixel_cache.c (CheckImagePixelLimits): New function to\n\ttest image to see if it exceeds pixels limits.\n\n\t* coders/viff.c (ReadVIFFImage): Make the VIFF reader robust with\n\tdetecting and reporting problems.\n\n2014-12-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Rotate Changelog for new year.  Update documentation copyrights\n\tfor new year.\n\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2016",
    "content": "2016-12-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (WritePNMImage): Support writing GRAYSCALE PAM\n\tformat.  Before this fix, grayscale output was marked as type\n\tBLACKANDWHITE.  Problem was reported by Aaron Boxer via email on\n\tDecember 31, 2016.\n\n\t* TclMagick/generic/Makefile.am: Applied patch by Massimo Manghi\n\t(plus some fixes by me) to add a 'libttkcommon' shared library to\n\tcontain codde common to the TclMagick/TkMagick loadable modules,\n\tand particularly to allow TkMagick to access TclMagick functions\n\twithout depending on dlopen() with RTLD_GLOBAL behavior.\n\n2016-12-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/compare.c (DifferenceImage): Fix all-black difference\n\timage if an input file is colormapped.  Resolves SourceForge issue\n\t#404 \"Difference file does not work if PNG \".\n\n2016-12-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/txt.c (ReadTXTImage): Fix Coverity issue 55866 \"Resource\n\tleak\".\n\n\t* magick/enum_strings.c (StringToCompositeOperator): Fix Coverity\n\tissue 139296 \"Constant expression result\".\n\n\t* magick/channel.c (ImportImageChannelsMasked): Fix Coverity issue\n\t139297 \"Constant expression result\".  This was a bug but only in\n\tterms of reduced performance, not results.\n\n\t* Magick++/lib/Drawable.cpp\n\t(PathSmoothCurvetoRel::operator): Fix Coverity issue 139301 \"Using\n\tinvalid iterator\".\n\t(PathSmoothCurvetoRel::operator): Fix Coverity issue 139302 \"Using\n\tinvalid iterator\"\n\n\t* magick/attribute.c: From SourceForge patches #47\n\t\"GraphicsMagick-1.3.25-get-exif-attribute-gps-fix.patch\" and\n\t\"GraphicsMagick-1.3.25-set-exif-orientation-fix.patch\" by Troy\n\tPatteson with description (related to provided Coverity reports in\n\tcoverity.txt): Those coverity errors indicate a problem with the\n\tearlier patch I sent you to fix getting the EXIF orientation when\n\tthe GPS IFD occurs before the EXIF IFD. Although the patch fixed\n\tthat issue it introduced a new issue in that GPS tags could no\n\tlonger be retrieved. This occurs because the gpsfound flag is set\n\twhen the GPS IFD is pushed onto the stack but then cleared\n\timmediately when breaking out of the loop processing the directory\n\tentries for the current IFD. The solution is to push the gpsfound\n\tflag onto the stack as well as it needs to be set when the GPS IFD\n\tis popped off the stack rather than being set straight away.\n\n\tThe second coverity error relates to gpsoffset not being set in\n\tFindEXIFAttribute(). The code that sets gpsoffset in\n\tGenerateEXIFAttribute() was embedded in the code that gets tags\n\tvalues which was removed in FindEXIFAttribute() as only the DE\n\toffset is required. I have removed the need for gpsoffset and just\n\tcomputed the GPS IFD offset when pushing it onto the stack in the\n\tsame way the EXIF IFD offset is computed.\n\n2016-12-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c: From SourceForge patches #47\n\t\"GraphicsMagick-1.3.25-5-set-exif-orientation.patch\" by Troy\n\tPatteson with description: Rotating an image without resetting the\n\tEXIF orientation tag is problematic as follow-on viewers that\n\tsupport the EXIF orientation tag may incorrectly rotate the image\n\ta second time. For JPEG images, the current solution is to either\n\tstrip the image, remove the EXIF profile or modify the EXIF data\n\tof the written image with other software. This patch adds the\n\tability to set the orientation tag in the EXIF profile via the\n\tSetImageAttribute on attribute EXIF:Orientation provided the EXIF\n\torientation already exists. AutoOrientImage() has been modified to\n\tset the EXIF orientation tag on successful rotation of the image.\n\n\tThe implementation is less than ideal. The EXIF profile must be\n\tduplicated because it is returned read-only from the profiles\n\tmap. Large amounts of the GenerateEXIFAttribute() function has\n\tbeen duplicated in a function called FindEXIFAttribute() which\n\treturns the offset in the EXIF profile of a given tag ID. Once\n\tfound, the orientation tag value is updated accordingly and the\n\tnew EXIF profile set. Despite the patches shortcomings, I believe\n\tit is preferable to leaving the EXIF orientation tag unchanged\n\tafter auto-orienting the image.\n\n\t* wand/magick_wand.c (MagickClearException): From SourceForge\n\tpatches #47 \"GraphicsMagick-1.3.25-1-wand-clear-exception.patch\"\n\tby Troy Patteson with description: This patch adds the ability to\n\tclear the last Wand exception. This is particularly useful to\n\tclear any exception on the Wand before calling MagickReadImage()\n\twhich can return success with a warning exception such as \"JPEG\n\tdata: premature end of data segment\".\n\t(MagickRemoveImageOption): From SourceForge patches #47\n\t\"GraphicsMagick-1.3.25-2-wand-remove-image-option.patch\" by Troy\n\tPatteson with description: There is MagickSetImageOption() to set\n\toptions like JPEG preserve-settings but no way to remove the\n\toption once set. Since the mechanism to remove image options\n\talready exists in lower-level API there seems no reason not to\n\texpose it in the Wand API.\n\t(MagickGetImageOrientation, MagickSetImageOrientation): From\n\tSourceForge patches #47\n\t\"GraphicsMagick-1.3.25-3-wand-get-set-orientation.patch\" by Troy\n\tPatteson with description: MagickGetImageOrientation returns the\n\tinternal orientation setting which is useful to know to determine\n\twhether an image needs rotation. The function to set the\n\torientation is less useful as it only sets the internal\n\torientation setting which is only used when writing out TIFF\n\tfiles. A future patch addresses this issue.\n\t(MagickAutoOrientImage): From SourceForge patches #47\n\t\"GraphicsMagick-1.3.25-4-wand-auto-orient.patch\" by Troy Patteson\n\twith description: This patch adds auto-orient image to the Wand\n\tAPI.\n\n2016-12-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* TclMagick/{configure.ac, Makefile.am}: Applied patches by\n\tMassimo Manghi to use TEA tcl.m4 version 3.9.\n\n2016-11-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (DecodeImage): Applied fixes by Tianyu Lang for\n\t\"Excessive LZW string data\" problem leading to \"Corrupt image\"\n\treport while reading some GIF files.\n\n2016-11-18 Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* doc/options.imdoc, doc/config_files.imdoc, doc/benchmark.imdoc:\n\tFixed some indentation in the documentation.\n\n2016-10-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* acinclude.m4 (LIBS): Fix memory leaks in GM_FUNC_MMAP_FILEIO\n\tmacro test-case so that it can be used successfully with ASAN\n\tcompilation options.\n\n\t* magick/blob.c: Eliminate unused variable compiler warnings when\n\tHAVE_MMAP_FILEIO is not defined.\n\n2016-10-24  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Ability to read multiple images from Matlab V4 format.\n\n2016-10-21 Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t*coders/png.c (ReadOneJNGImage): Enforce spec requirement that the\n\tdimensions of the JPEG embedded in a JDAT chunk must match the\n\tJHDR dimensions. This issue was assigned CVE-2016-9830 on\n\t2016-12-04.  Please note that GraphicsMagick's pixel, width, and\n\theight default limits are often greater than the dimension limits\n\tof JNG and JPEG so the user should add explicit limits (if needed)\n\tto prevent unexpected memory consumption from properly-constructed\n\tJNG files with large dimensions.\n\n\t*doc/options.imdoc (-strip): Added a caution to not use the -strip\n\toption to remove author, copyright, and license information\n\twhen redistributing an image that requires them to be retained.\n\n\t*doc/options.imdoc (-comment and -label): Document the fact that\n\tonly one comment or label is stored, and how they are stored in\n\tPNG files.\n\n2016-10-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sgi.c (ReadSGIImage): Adjusts some variable types and\n\tlessen the amount of casting.\n\n2016-10-09 Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadJNGImage): Quiet COVERITY issue about\n\ta potential memory leak.\n\n2016-10-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c (ReadXCFImage): Fix memory leak of layer_info for\n\tsome recently added error-return paths.\n\n2016-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sgi.c (ReadSGIImage): For RLE SGI image, defer memory\n\tallocations for as long as possible and allow the file to prove\n\titself worthy before making the largest allocations.  This helps\n\twith rejecting bogus RLE files while avoiding rejecting valid\n\tfiles.\n\n2016-10-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): If TIFF uses Old JPEG\n\tcompression, then read using full tiles or strips.  Solves\n\t\"Improper call to JPEG library in state 0. (LibJpeg).\" error.\n\tProblem was reported via email on October 6, 2016 by John Brown.\n\n2016-10-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Fixed SourceForge\n\tbug 400 \"Exif orientation unknown for some JPEG files\".  Patch\n\tsubmitted by Troy Patteson.\n\n2016-10-02  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Add sanity check for palette.  Merge\n\tRemoveLastImageFromList+AppendImageToList to ReplaceImageInList.\n\tPossible heap overflow of colormap in Q8 build was assigned\n\tCVE-2016-7996.  Assertion crash due to blob != NULL was assigned\n\tCVE-2016-7997.\n\n2016-10-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c (parse8BIM): Fix unsigned underflow leading to\n\theap overflow when parsing 8BIM chunk.  Problem was reported by\n\tMarco Grassi via email on October 1, 2016.  Problem was already\n\tknown (but not fixed) based on comments in the code.  This issue\n\thas been assigned CVE-2016-7800.\n\n2016-09-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c: Improve the robustness of the XCF reader by adding\n\tmore error checking.\n\n2016-09-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/rle.c (RLEConstrainColormapIndex): Was not constraining\n\tcolormap index like it should be.  This problem was added on\n\t2016-09-23.\n\n\t* www/thanks.rst: Added Moshe Kaplan to Thanks.\n\n\t* www/Hg.rst: Mercurial URL fixes.  Patch from Mark Mitchell.\n\n\t* www/programming.rst: Updated programming APIs page.\n\n2016-09-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (OpenCache): Trace ExtendCache() failures.\n\n2016-09-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sgi.c (ReadSGIImage): Fix unexpectedly large memory\n\tallocation with corrupt SGI file provided via email by Agostino\n\tSarubbo on September 15, 2016.\n\n\t* coders/rle.c (ReadRLEImage): Only report an invalid colormap\n\tindex once.  Fixes slowness problem with corrupt file provided via\n\temail by Agostino Sarubbo on September 15, 2016.\n\n2016-09-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/thanks.rst: Added a 'thanks' page.\n\n2016-09-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/MANIFEST: Fix content of PerlMagick MANIFEST.\n\n2016-09-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcx.c (ReadPCXImage): Check that filesize is reasonable\n\tgiven header.  Fixes excessive memory allocation followed by\n\teventual file truncation error for corrupt file.  Problem was\n\treported via email by Agostino Sarubbo on 2016-09-10.\n\n\t* coders/sgi.c (ReadSGIImage): Check that filesize is reasonable\n\tgiven header.  Fixes excessive memory allocation followed by\n\teventual file truncation error for corrupt file.  Problem was\n\treported via email by Agostino Sarubbo on 2016-09-09.\n\n\t* coders/sct.c (ReadSCTImage): Fix stack-buffer read overflow\n\twhile reading SCT header.  Problem was reported via email by\n\tAgostino Sarubbo on 2016-09-09.\n\n\t* coders/svg.c: Fix Coverity issue 135772 \"RESOURCE_LEAK\" and\n\tissue 135829 \"Null pointer dereferences\".  None of these issues\n\twere new, but Coverity noticed them now.  Reflowed source to GNU C\n\tstyle for consistent indentation and so it does not fight with my\n\teditor.\n\n2016-09-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/common.h (MAGICK_HAS_ATTRIBUTE): Coverity is allergic to\n\t__has_attribute() so don't use it for Coverity builds.\n\n2016-09-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/index.rst: Update for 1.3.25 release.\n\n\t* version.sh: Update library versioning for 1.3.25 release.\n\n\t* NEWS.txt: Make sure is up to date.\n\n\t* Various fixes for minor issues noticed when compiling under\n\tVisual Studio.\n\n2016-08-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/studio.h (MAGICK_CACHE_LINE_SIZE): Apply patch from\n\tGentoo Linux to increase MAGICK_CACHE_LINE_SIZE to 128 when\n\t__powerpc__ is defined.\n\n2016-08-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated with latest changes.\n\n2016-08-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/rle.c (ReadRLEImage): Reject truncated/absurd Utah RLE\n\tfiles. Problem was reported by Agostino Sarubbo on August 19,\n\t2016.  This problem was assigned CVE-2016-7448 after the 1.3.25\n\trelease.\n\n2016-08-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Fix heap-based buffer read\n\toverflow.  TIFF sized attibutes were not being properly copied to\n\ta null-terminated string if the value was not null terminated.\n\tProblem was reported by Agostino Sarubbo on August 18, 2016.  This\n\tproblem was assigned CVE-2016-7449 after the 1.3.25 release.\n\n2016-08-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* lcms/src/cmstypes.c (Type_MLU_Read): \"Added an extra check to\n\tMLU bounds\", change based on github mm2/Little-CMS commit\n\t5ca71a7bc18b6897ab21d815d15e218e204581e2 and announced to the\n\toss-security list by Ibrahim M. El-Sayed on Mon, 15 Aug 2016.\n\n2016-08-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* webp: Updated bundled libwebp to release 0.5.1.\n\n\t* libxml: Updated bundled libxml2 to release 2.9.4.\n\n\t* lcms: Updated bundled lcms2 to release 2.8.\n\n\t* png: Update bundled libpng to release 1.6.24.\n\n\t* coders/jpeg.c (ReadJPEGImage): Log setting resolution and\n\tresolution units due to JFIF marker.\n\n\t* coders/sgi.c (SGIDecode): Fix integer overflow of size type in\n\tWin64 build where sizeof(long) < sizeof(size_t).\n\n2016-08-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders, magick: Compile clean using GCC with -std=c90.\n\n\t* magick/describe.c (DescribeImage): The 'identify' and 'info'\n\tfunctionality only shows the pixel read rate if image was not read\n\tin 'ping' mode.  Provide seconds timing with 6 digits of precision\n\tsince that is what is needed.\n\n2016-08-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/describe.c (DescribeImage): Include milliseconds\n\tresolution in elapsed time output.\n\n\t* magick/timer.c (ElapsedTime): Use clock_gettime() (when\n\tavailable with default linkage) to obtain elapsed time.\n\n2016-08-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/yuv.c (WriteYUVImage): Fix benign clang compiler warning\n\tregarding \"variable 'x' is incremented both in the loop header and\n\tin the loop body\".\n\n\t* configure.ac: Fixes to use clang's OpenMP runtime library\n\t(-lomp) for clang 3.8 and later.  Specifically tested with clang\n\t3.8 on Ubuntu 16.04 'xenial'.  Problem was reported by Holger\n\tHoffstätte via private email.\n\n\t* NEWS.txt: Bring up to date with latest changes.\n\n2016-07-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Reject abnormally absurd gradient\n\tsize requests (many absurd requests are still allowed).  Provide\n\tdetailed error reports when a gradient is rejected.\n\n\t* coders/svg.c: Support units for 'stroke-dashoffset'.\n\n2016-07-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/annotate.c (EscapeParenthesis): In private email on\n\t2016-07-07, Gustavo Grieco notified us of a heap overflow in\n\tEscapeParenthesis().  I was not able to reproduce the issue but\n\tchanged the implementation with the suspicion that the\n\timplementation has a bug, and due to noticing arbitary limits and\n\tinefficiency.  This issue was assigned CVE-2016-7447 after the\n\t1.3.25 release.\n\n2016-07-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Fix absolute and arbitrary gradient\n\tdimension sanity checks which caused gradient requests to fail.\n\tResolves SourceForge issue #392 \"SVG 'push defs' fails (Debian\n\tbugs 829063 and 828120)\".\n\n2016-06-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/security.rst: Add discussion of SVG format and SSRF\n\tvulnerability.\n\n2016-06-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c (ReadSVGImage): Assure that SVGInfo data is freed\n\twhen XMP parsing is aborted due to an error.\n\n2016-06-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated NEWS with changes since last release.\n\n\t* www/security.rst: Add a page about GraphicsMagick security.\n\n2016-06-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawPrimitive): Over-aggressive error reporting\n\twas causing failures when elements were \"drawn\" off-image.\n\tResolves SourceForge issue #389 \"Non-conforming drawing primitive\n\tdefinition (line)\".\n\n2016-05-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Fix problem while reading file\n\t\"tnamkejarz.svg.2532308010849170049\" provided via private email\n\tfrom Gustavo Grieco on May 31, 2016.\n\n\t* magick/utility.c (MagickGetToken): Fix problem while reading\n\tfile \"vqxwatmqmi.svg.-3669039972557308254\" provided via private\n\temail from Gustavo Grieco on May 31, 2016.\n\n2016-05-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update for 1.3.24 release.\n\n\t* www/Changes.rst: Mention 1.3.24 release.\n\n\t* www/index.rst: Update for 1.3.24 release.\n\n\t* version.sh: Update library ABI information in preparation for\n\t1.3.24 release.\n\n\t* NEWS.txt: Updated NEWS to reflect fixes and issues.\n\n2016-05-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated with latest news.\n\n\t* magick/blob.c (OpenBlob): Remove support for reading input from\n\ta shell command, or writing output to a shell command, by\n\tprefixing the specified filename (containing the command) with a\n\t'|'.  This feature provided a remote shell execution opportunity\n\t(CVE-2016-5118).\n\n\t* coders/mat.c (ReadMATImage): Validate that MAT frames is not\n\tzero.\n\n2016-05-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Be less optimistic when estimating\n\tthe number of points required to represent a path.  This should\n\thelp address CVE-2016-2317 \"Heap buffer overflow\".  This resolves\n\tSourceForge issue #275 \"Applying Clipping Path to high resolution\n\tJPG\".\n\n2016-05-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Fix problem while reading file\n\t\"pxypjhfdxf.svg.7406476585885697806\" provided via via private\n\temail from Gustavo Grieco on May 24, 2016.\n\n\t* coders/svg.c: Fix problem while reading file\n\t\"pxypjhfdxf.svg.308008972284643989\" provided via private email\n\tfrom Gustavo Grieco on May 24, 2016.\n\n2016-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c (\"C\"): Support font-size \"medium\".\n\n2016-05-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated NEWS.txt to reflect latest changes.\n\n\t* magick/render.c (DrawImage): Added DrawImage() recursion\n\tdetection/prevention.\n\n\t* coders/svg.c (ReadSVGImage): Add basic primitive argument\n\tvalidation.\n\n\t* magick/render.c (DrawImage): Add basic primitive argument\n\tvalidation.\n\n2016-05-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/url.c (ReadURLImage): Reading \"file://\" URLs was not\n\tworking.  Now file URLs are working.\n\n2016-05-21  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Respect JPEG limits (65535x65535) and user width\n\tand height limits from \"-limit\" while reading or writing JNG files.\n\n2016-05-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/url.c: Don't hide HTTP, FTP, and FILE URL support from\n\t'-list format' output.  Ignore HTTP, FTP, and FILE as a useful\n\tfile extension for determing the file format.\n\n2016-05-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (ConvertPathToPolygon): Make sure that first\n\tedge is initialized.  Make sure that points is not null.\n\n2016-05-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Fixed segmentation violation while\n\treading file \"275077586554139424.lqxdgqxtfs.svg\" provided via\n\tprivate email from Gustavo Grieco on May 15, 2016.  This is due to\n\tanother CVE-2016-2317 related issue.\n\n2016-05-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c (\"C\"): Fixed problems while reading files\n\t\"aaphrbkwwe.svg.-1899680443073025602\",\n\t\"aaphrbkwwe.svg.-5751004588641220738\",\n\t\"aaphrbkwwe.svg.-8875730334406147537\", and\n\t\"aaphrbkwwe.svg.4495884156523242589\" provided via private email\n\tfrom Gustavo Grieco on February 8, 2016.\n\n2016-05-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dib.c (ReadDIBImage): Verify that DIB file data is\n\tsufficient to meet claims made by file header.  Validate image\n\tplanes.  Fixes Fixes problem reported by Hanno Böck on May 8th,\n\t2016 via private email entitled \"malloc issue in ReadDIBImage\".\n\n2016-05-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/msl.c (RegisterMSLImage): Ignore the file extension on\n\tMSL files.  The only way to read an image from a MSL file (as\n\topposed to explicitly running a MSL script with 'conjure') is by\n\treading using a filename specification like \"msl:filename\".  This\n\tis done for security reasons.\n\n\t* magick/render.c (DrawPrimitive): Fix Coverity issue 126378\n\t\"Resource leak\".\n\n\t* coders/mat.c (DecompressBlock): Fix Coverity issue 126379\n\t\"Resource leak\".\n\n\t* magick/render.c (DrawImage): Fix Coverity issue 126380 \"Resource\n\tleak\".\n\n2016-05-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawPrimitive): Sanity check the image file\n\tpath or URL before passing it to ReadImage().\n\n\t* config/delegates.mgk.in: Pare down delegates.mgk to reduce\n\tsecurity exposure due to external programs not under our control.\n\n2016-05-08  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Typo fix - matrix has nothing to do with PostScript.\n\n2016-05-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mat.c (DecompressBlock): Don't hang on a corrupt deflate\n\tstream when reading matlab v6 file.  Fixes problem reported by\n\tHanno Böck on May 8, 2016 via private email entitled \"hang of\n\tmatlab input file\".\n\n2016-05-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageInfo): Undocumented \"TMP\" magick prefix\n\tno longer removes the argument file after it has been read. This\n\tfunctionality is only used to support the \"show\" delegate which is\n\tused by options in the 'display' program which need to display a\n\tgenerated image in a new instance of 'display'.  The \"show\"\n\tdelegate is used by writing a temporary file to be viewed, and\n\twhich should be removed before the program quits.  Since the \"TMP\"\n\tfeature was originally implemented, GraphicsMagick added a\n\ttemporary file management subsystem which assures that temporary\n\tfiles are removed so this feature is not needed.\n\n\t* coders/tiff.c (ReadTIFFImage): Fix heap overflow with file\n\t\"gkkxrilssm.tiff.-4678010562506843336\" provided by Gustavo Grieco\n\ton February 8, 2006 via private email.\n\n\t* coders/viff.c (ReadVIFFImage): Fix problem with a very large\n\tmalloc in sample file provided by Hanno Böck on May 7, 2016 with\n\tsubject \"large malloc in ReadVIFFImage\".\n\n\t* coders/mvg.c (RegisterMVGImage): Do not auto-detect MVG format\n\tbased on file extension.  MVG files can then only be read by\n\tadding a \"MVG:\" prefix to the file name. There is already no\n\tauto-detection of MVG based on content.\n\n2016-05-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (ReadXPMImage): Limit the number of XPM colors and\n\tassure array initialization.  Fixes bad behavior with a sample\n\tfile provided by Hanno Böck on May 6, 2016 with subject \"Invalid\n\tfree in ReadXPMImage\".\n\n\t* coders/pcx.c (ReadPCXImage): Limit the number of PCX image\n\tplanes allowed.  Fixes an unreasonable memory allocation in a\n\tsample file provided by Hanno Böck on May 5, 2016.\n\n2016-05-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* config/delegates.mgk.in: Gnuplot files are inherently insecure.\n\tRemove delegates support for reading them.  Reported by John\n\tLightsey via private email.\n\tAdded -dSAFER to Ghostscript invokations in delegates.mgk for more\n\tsecure execution.  Reported by David Chan via SourceForge bug\n\t\"#386 ghostscript delegates should explicitly use -dSAFER.\".\n\n\t* magick/constitute.c (ReadImages): Avoid possible infinite\n\tReadImage() recursion.\n\n2016-05-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawPolygonPrimitive): Fix divide by zero\n\texception encountered while reading file \"sigfpe.svg\" posted by\n\tGustavo Grieco on May 1, 2016 to the oss-security mailing list\n\twith subject \"CVE request: DoS in multiple versions of\n\tGraphicsMagick\".\n\t(DrawDashPolygon): Fix endless loop problem caused by negative\n\tstroke-dasharray arguments.  Resolves problem observed while\n\treading file \"circular.svg\" posted by Gustavo Grieco on May 1,\n\t2016 to the oss-security mailing list with subject \"CVE request:\n\tDoS in multiple versions of GraphicsMagick\".\n\n\t* magick/import.c (ImportViewPixelArea): Fix assertion while\n\treading TIFF file gkkxrilssm.tiff.105123337066 provided by Gustavo\n\tGrieco.\n\n2016-04-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/locale.c (ReadLOCALEImage): Make sure to close blob\n\tbefore returning.\n\n\t* coders/svg.c (\"C\"): Provide a hack work-around for double-quoted\n\tfont-family argument.\n\n\t* magick/render.c (DrawImage): Make SVG path and other primitive\n\tparsing more robust.  Fixes SEGV when reading files provided by\n\tCVE-2016-2318 test cases.  Fixes CVE-2016-2318 completely.\n\n2016-04-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Fix heap buffer overflow when\n\treading aaphrbkwwe.svg.-1114777018469422437 from CVE-2016-2317\n\ttest cases.  This resolves CVE-2016-2317 completely.\n\n2016-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MogrifyImageCommand): Added mogrify\n\t-preserve-timestamp option to preserve file access and\n\tmodification timestamps.  Contributed by Niko Rosvall via\n\tSourceForge patch #45 \"preserve-timestamp option for mogrify\n\tcommand.\"\n\n2016-04-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c: Added ReadBlobLSBSignedShort(),\n\tReadBlobMSBSignedShort(),\n\tReadBlobLSBSignedLong(),ReadBlobMSBSignedLong(),\n\tWriteBlobLSBSignedShort(), WriteBlobLSBSignedLong(),\n\tWriteBlobMSBSignedLong(), WriteBlobMSBSignedShort() for doing I/O\n\ton signed integer types without the need for dangerous casts or\n\tunexpected values due to signed/unsigned conversion.\n\n2016-04-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated with latest changes.\n\n\t* magick/constitute.c (ReadImage): Added asserts to check that the\n\tI/O blob is not still open in the returned image since this causes\n\tproblems.\n\n\t* magick/blob.c (CloneBlobInfo): Use a cloning approach which does\n\tnot require manually keeping structure members in sync.\n\n\t* coders/msl.c (ProcessMSLScript): Need to close I/O blob before\n\treturning.\n\n\t* coders/psd.c (ReadPSDImage): Assure that allocated image is not\n\tdereferenced before checking if it is NULL.  Check some memory\n\tcalculations for overflow.\n\t(ReadPSDImage): Need to close I/O blob before returning.\n\n\t* coders/dib.c (ReadDIBImage): Use DestroyBlob() rather than\n\tDestroyBlobInfo().\n\n\t* coders/bmp.c (ReadBMPImage): Use DestroyBlob() rather than\n\tDestroyBlobInfo().\n\n\t* magick/blob.c: Improve blob tracing.\n\n2016-04-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (ReadBMPImage): Fix reading 24-bit Microsoft BMP\n\twhich claims to have a colormap.\n\n2016-04-13 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* PerlMagick/t/input_complex_lsb_double_V4.mat Demo Matlab V4\n\tcomplex file.\n\t* coders/mat.c Missing break added.\n\n2016-04-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (ReadXPMImage): Fix SourceForge issue #361\n\t\"out-of-bounds read in coders/xpm.c:150:24\"\n\n\t* coders/psd.c (ReadPSDImage): Add some defensive code to assure\n\tthat image layers are not freed twice.\n\n2016-04-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (InitializeLogInfo): Simplify LogInfo structure and\n\tits allocation in order to lessen the amount of fixed overhead.\n\n2016-04-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c (WriteJP2Image): Fix SourceForge issue #378 \"jp2:\n\timpossible to create lossless jpeg-2000\".  With this fix,\n\tspecifying 'define jp2:rate=1.0' or '-quality 100' results in a\n\tlossless JP2 file.\n\n2016-04-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/common.h: Update for GCC 5.\n\n\t* PerlMagick/MANIFEST: Update PerlMagick manifest.\n\n\t* PerlMagick/t/{read.t, write.t}: Add tests for MAT v4.\n\n2016-04-03 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Matlab V4 attempt to read complex part of data.\n\n2016-04-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/features.pl.in: Provide a way that PerlMagick\n\tfeature tests can test if a feature is supported.  Use it to make\n\tthe PSD test optional.\n\n\t* coders/Makefile.am: Only build PSD module if\n\tENABLE_BROKEN_CODERS is enabled.\n\n\t* magick/module.c (UnloadModule): Only invoke the module\n\tunregister function if it is defined.  The module register\n\tfunction is not defined if either the register or unregister\n\tfunctions were not found in the module which was loaded.\n\n2016-04-02 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Matlab V4 files are also rotated.\n        * PerlMagick/t/input_gray_lsb_double_V4.mat   Demo Matlab V4 file.\n\n2016-04-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c (GetMagickInfo): Only declare that ExceptionInfo\n\targument is not used if modules are not supported.\n\n2016-03-28 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Attempt to read Matlab V4 files.\n\n2016-03-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (DestroyImage): Simply return if image is NULL\n\tsince it is more user-friendly.\n\n\t* magick/shear.c (RotateImage): Fix Coverity issue 124519\n\t\"Logically dead code\".\n\n\t* magick/effect.c (BlurImage): Fix Coverity issue 124520\n\t\"Dereference after null check\".\n\n\t* coders/pdb.c (WritePDBImage): Fix SourceForge bug #360\n\t\"out-of-bounds read in utilities/gm+0x80fcc71) (PDB reader)\".\n\n\t* coders/meta.c (convertHTMLcodes): Fix SourceForge bug #373\n\t\"out-of-bounds read in coders/meta.c:444:50\"\n\t(ReadMETAImage): Fix SourceForge bug #364 \"out-of-bounds write in\n\tcoders/meta.c:1331:7\".\n\n2016-03-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sgi.c (ReadSGIImage): Fix SourceForge bug #366\n\t\"out-of-bounds write in coders/sgi.c:528:4\" and bug #369\n\t\"out-of-bounds write in coders/sgi.c:535:4\".\n\n\t* coders/rle.c (ReadRLEImage): Fix SourceForge bug #371\n\t\"out-of-bounds read in coders/rle.c:633:39\".\n\n2016-03-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dib.c (ReadDIBImage): Fix SourceForge bug #367\n\t\"out-of-bounds read in coders/dib.c:706:13\" and bug #370\n\t\"out-of-bounds read in coders/dib.c:716:15\".\n\n\t* coders/pict.c (ReadPICTImage): Fix SourceForge bug #365\n\t\"out-of-bounds read in magick/image.c:1305:3\"\n\n\t* magick/utility.c (GetPageGeometry): Fix SourceForge bug #374\n\t\"out-of-bounds write in magick/utility.c:4355:7\"\n\n2016-03-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Fix SourceForge bug #376 \"SIGABRT\n\tin magick/colorspace.c:1052\".\n\n\t* magick/shear.c (RotateImage): Fix SourceForge bug #375 \"SIGABRT\n\tin magick/image.c:1230\".\n\n\t* coders/sun.c (DecodeImage): Fix SourceForge bug #368\n\t\"out-of-bounds read in coders/sun.c:223:17\" and bug #363\n\t\"out-of-bounds read in coders/sun.c:221:16\".\n\n2016-03-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c (GetUserSpaceCoordinateValue): Fix stack buffer\n\toverflow when reading file 'aaphrbkwwe.svg.-632425326915265752'\n\tfrom CVE-2016-2317 problem files.  Partial fix for SourceForge bug\n\t#358 \"CVE-2016-2317 - SVG heap/stack buffer overflows\".\n\n\t* magick/utility.c (MagickGetToken): New private function to\n\treplace GetToken().  The new function accepts a token buffer\n\tlength argument.  GetToken() is modified to assume a token buffer\n\tlength 'MaxTextExtent'.  All code using GetToken() is updated to\n\tuse MagickGetToken().\n\n\t* coders/svg.c: Fix heap buffer overflow when reading file\n\t\"aaphrbkwwe.svg.4495884156523242589\" from CVE-2016-2317 problem\n\tfiles.  Partial fix for SourceForge bug #358 \"CVE-2016-2317 - SVG\n\theap/stack buffer overflows\".\n\n2016-03-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/psd.c (ReadPSDImage): Fix SourceForge bug #341\n\t\"out-of-bounds read in coders/psd.c:1435\".\n\t(WriteWhiteBackground): Fix SourceForge bug #350 \"SEGV in\n\tcoders/psd.c:1685\".\n\t(DecodeImage): Fix SourceForge bug #351 \"heap-buffer-overflow in\n\tcoders/psd.c:142\".\n\t(ReadPSDImage): Fix SourceForge bug #342 \"out-of-bounds write in\n\tcoders/psd.c:892\"\n\n\t* coders/xcf.c (load_tile): Fix SourceForge bug #337\n\t\"heap-buffer-overflow in coders/xcf.c:373\".\n\n\t* coders/pict.c (WritePICTImage): Fix SourceForge bug #340\n\t\"out-of-bounds write in coders/pict.c:1929\".\n\n\t* coders/pdb.c (WritePDBImage): Fix SourceForge bug #348\n\t\"heap-buffer-overflow in coders/pdb.c:949:26\".\n\n\t* coders/xpm.c (ReadXPMImage): Fix SourceForge bug #334\n\t\"heap-buffer-overflow in coders/xpm.c:150\".\n\n2016-03-09 Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Fixed huge image limitation.\n\n2016-03-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sun.c (WriteSUNImage): Fix SourceForge bug #343\n\t\"out-of-bounds write in coders/sun.c:962\".\n\n\t* coders/rle.c (ReadRLEImage): Fix SourceForge bug #344\n\t\"out-of-bounds write in coders/rle.c:524\".\n\n\t* coders/xpm.c (ReadXPMImage): Fix SourceForge bug #335\n\t\"out-of-bounds read in coders/xpm.c:154 \".\n\n2016-03-06  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* doc/options.imdoc (-extent): Revised the example to\n\tclarify the interaction of -gravity with the \"geometry\" offsets.\n\n2016-03-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Add support for --enable-broken-coders which\n\tdetermines if broken or hazardous file format support should be\n\tenabled in the build.  Currently Adobe Photoshop (PSD) format is\n\tincluded in this category.\n\n\t* Rotate Changelog for new year.  Update documentation copyrights\n\tfor new year.\n\n2016-03-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff/libtiff/tif_config.h (HAVE_SNPRINTF): Define HAVE_SNPRINTF\n\twhen using Microsoft Visual C++ 14 (Visual Studio 2015) or later.\n\tThis is based on advice by Pablo Elpuro.\n\n2016-02-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Image.cpp (xResolution): New method to support\n\tsetting the horizontal resolution with double precision.\n\t(yResolution): New method to support setting the vertical\n\tresolution with double precision.\n\n\t* www/Hg.rst: Document the ssh public keys for the server hosting\n\tthe development Mercurial repository.\n\n2016-02-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (ReadXPMImage): Fix SourceForge bug #333\n\theap-buffer-overflow in coders/xpm.c:409.\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2017",
    "content": "2017-12-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwfile.tap: Add tests for MIFF compressed sub-formats.\n\n2017-12-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (OpenBlob): Zlib 1.2.8 does not accept an open\n\tmode of \"w+b\" or \"wb+\".  It seems to be allergic to '+'.  As a\n\tresult, writing to \".gz\" files was not working with Zlib 1.2.8.\n\tNote that \"w+b\" must be used in the normal case since the test\n\tsuite fails otherwise!\n\n2017-12-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Fix SourceForge issue #535\n\t\"heap-buffer-overflow in ReadMNGImage\".  Problem was caused by\n\taccessing byte before testing that limit has been reached, rather\n\tthan testing for limit before accessing the byte.  This means that\n\tit could only ever read one past the buffer allocation size.\n\n\t* coders/webp.c (WriteWEBPImage): Fix SourceForge issue #536\n\t\"stack-buffer-overflow in WriteWEBPImage\".  Due to a change to use\n\tWebPMemoryWriter as part of the EXIF and ICC profile support\n\taddition (enabled with libwebp 0.5.0), the progress indicator\n\tcallback is now passed a pointer to a wrong structure.  This is\n\tquite unfortunate since the progress indication is useful.  The\n\tprogress indication is temporarily disabled when the\n\tWebPMemoryWriter is in use until a solution is implemented.\n\t(ProgressCallback): Re-implement progress callback so that image\n\tpointer is stored/retrieved as thread-specific data.\n\n\t* coders/png.c (ReadMNGImage): Fix SourceForge issue #537 \"null\n\tpointer dereference in ReadMNGImage\".  DEFI chunk must be at least\n\t2 bytes long.\n\n\t* coders/tiff.c (ReadNewsProfile): Fix SourceForge issue #533\n\t\"heap-buffer-overflow on LocaleNCompare\".  LocaleNCompare() was\n\tbeing allowed to read heap data beyond the allocated region.\n\n2017-12-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/shear.c (IntegralRotateImage): Assure that reported error\n\tin rotate by 270 case does immediately terminate processing.\n\tReturn a NULL Image pointer if there is a problem rather than a\n\tcorrupted image.  Fix is related to SourceForge issue #532\n\t\"heap-buffer-overflow bug in ReadWPGImage\".\n\n\t* magick/pixel_cache.c (AcquireCacheNexus): Add a check that the\n\tpixel cache is compatible with the image dimensions.  Fix is\n\trelated to SourceForge issue #532 \"heap-buffer-overflow bug in\n\tReadWPGImage\".\n\n2017-12-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Fix SourceForge issue #530\n\t\"heap-buffer-overflow in ReadOneJNGImage\".  In this case there is\n\ta read one byte beyond the oFFs chunk allocation size due to an\n\terror in specifying an offset into the chunk.\n\n\t* coders/palm.c (ReadPALMImage): Fix SourceForge issue #529\n\t\"global-buffer-overflow in ReadPALMImage\".  This issue only\n\toccured in builds with QuantumDepth=8 due to the small range of\n\tIndexPacket.\n\n2017-12-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/{Magick.pm, Magick.pm.in, Makefile.PL.in}: Only base\n\tPerlMagick version on numeric portion of PACKAGE_VERSION.\n\n2017-12-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/index.rst: Update to 1.3.27.\n\n\t* www/Changes.rst: Add 1.3.27\n\n\t* version.sh: Update library versioning.\n\n\t* NEWS.txt: Update NEWS in preparation for releasing 1.3.27.\n\n2017-12-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (DCM_ReadElement): Change size checks addressing\n\tCVE-2017-12140 to be based on size_t rather than magick_off_t due\n\tto apparent instability of the previous check across compilers.\n\n2017-12-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): Fix heap read access outside of\n\tallocated PixelPacket array while testing pixels for opacity.\n\tResolves SourceForge issue #526 \"heap-buffer-overflow in\n\tWriteOnePNGImage\".\n\n2017-12-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (WritePNMImage): Fix SourceForge bug #525\n\t\"heap-buffer-overflow in MagickBitStreamMSBWrite\".\n\n2017-12-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (DCM_ReadElement): Eliminate huge memory allocation\n\tbased on bogus length value. Addresses CVE-2017-12140. Problem was\n\treported via email from Petr Gajdos on Tue, 5 Dec 2017.\n\n2017-12-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Image.cpp (colorMap): Try to eliminate Coverity CID\n\t172796 \"Dereference after null check\" which seems to be bogus.\n\n\t* coders/png.c (WriteOnePNGImage): Fix Coverity CID 168053\n\t\"Dereference after null check\".  The check for null and the error\n\treport which attempted to use the null value was not needed at\n\tall.\n\n\t* coders/cut.c (GetCutColors): Fix Coverity CID 10181: \"Null\n\tpointer dereferences\". SetImagePixels() may return NULL.\n\n\t* coders/rgb.c (ReadRGBImage): Fix SourceForge issue #523\n\t\"heap-buffer-overflow\".  Similar issue to cmyk.c.\n\n\t* coders/gray.c (ReadGRAYImage): Fix SourceForge issue #522\n\t\"heap-buffer-overflow\".  Similar issue to cmyk.c.\n\n\t* coders/cmyk.c (ReadCMYKImage): Fix SourceForge issue #521\n\t\"heap-buffer-overflow\". The requested tile must be within the\n\tbounds of the image.  As it happens, 'montage' passes size and\n\ttile information which is useless for reading a raw image so it is\n\tnot possible to read raw CMYK using 'montage'.\n\n2017-12-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pwp.c (ReadPWPImage): Eliminate dereference of null image\n\tpointer.  Addresses CVE-2017-11640.  Also address access to\n\tuninitialized memory.  Problem was reported via email from Petr\n\tGajdos on Wed, 29 Nov 2017.\n\n2017-11-22  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Additional check for wrong bpp CVE-2017-14342.\n\n\n2017-11-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Image.cpp (autoOrient): Add method to auto-orient\n\tan image so it looks right-side up by default.  Based on patch by\n\tPrzemysław Sobala submitted as SourceForge patch #53 \"Add\n\tMagick::Image::autoOrient() method to Magick++ library\".\n\n\t* www/download.rst: Change \"Czechoslovakian ftp mirror\" to \"Czech\n\tftp mirror\".  Resolves SourceForge bug #520 \"[web] Download sites:\n\tnon-existent country\".\n\n2017-11-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c (ReadWPGImage): Fix excessive use of disk resources\n\tdue to unreasonable record length.  Addresses CVE-2017-14341.\n\tNotified of this issue (with suggested patch) via email by Petr\n\tGajdos on Tue, 21 Nov 2017.\n\n2017-11-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* README.txt: Comprehensive white-space clean-up across\n\tGraphicsMagick core source files.  Hard TAB character is converted\n\tto spaces.  Trailing white-space garbage is stripped.\n\n\t* magick/colormap.c (MagickConstrainColormapIndex): Deprecate use\n\tof MagickConstrainColormapIndex() and prefer use of\n\tVerifyColormapIndex() and VerifyColormapIndexWithColors() due to\n\tavoiding dependence on index type, allowing provision of colors\n\tother than image->colors, and capturing more useful source file\n\tand line information.\n\n\t* coders/{rle.c, mat.c, xbm.c, sgi.c, png.c}: Eliminate size_t vs\n\tunsigned 32 conversion warnings in WIN64 build.\n\n2017-11-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff: Import libtiff 4.0.9.\n\n2017-11-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (DecodeImage): \"Right-size\" and \"Right-type\"\n\tDecodeImage() variables and check for EOF at every point of the\n\tway.  Pass buffer size as an argument.\n\n\t* coders/dib.c (DecodeImage): \"Right-size\" and \"Right-type\"\n\tDecodeImage() variables and check for EOF at every point of the\n\tway.  Pass buffer size as an argument.\n\n\t* coders/bmp.c (_BMPInfo): \"Right-size\" BMPInfo members.  The\n\t'long' type is promoted to 64-bit on LP64 systems and the large\n\tsize is not needed.\n\n2017-11-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/webp.c: Incorporate patch by Jan Spitalnik to add EXIF\n\tand ICC metadata support to the WebP coder.  While WebP is still\n\tsupported back to libwebp 0.1.99, the metadata support requires at\n\tleast libwebp 0.5.0.  Resolves SourceForge patch #52 \"Add EXIF/ICC\n\tmetadata support to WebP coder\".\n\n\t* coders/png.c (ReadOneJNGImage): Fix JNG memory leaks when JPEG\n\timage fails to be read.\n\t(WriteOnePNGImage): Promotion of indexed PNG to RGBA lacked\n\tsetting of image matte, resulting in undersized buffer allocation\n\tand heap overflow.  Fixes SourceForge bug #453 \"Heap overflow in\n\tsource-gra/coders/png.c\".\n\n2017-11-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sfw.c (SFWScan): Fix heap buffer overflow\n\t(CVE-2017-13134).  Notified of problem via email (including a\n\tpatch) from Petr Gajdos on Mon, 6 Nov 2017.\n\n2017-11-05  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Wrong MaxMap check condition - fixed.\n\n2017-11-04  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Check for InsertRow() return value.\n\n2017-11-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/export.c: Add not-null check for indexes pointer where\n\tneeded.\n\n\t* magick/import.c: Add not-null check for indexes pointer with\n\tassociated exception report where the indexes pointer is needed.\n\t(ImportCMYKQuantumType): Was wrongly importing an opacity channel\n\tin some cases. Would have crashed if these cases were ever used.\n\n\t* coders/wpg.c (ReadWPGImage): Assure that colormapped image is a\n\tPseudoClass type with valid colormapped indexes.  Fixes\n\tSourceForge bug 519 \"Null Pointer Dereference (Write) with\n\tmalformed WPG Image\".\n\n\t* coders/sfw.c (ReadSFWImage): Avoid possible heap overflow while\n\tcopying JFIF magic into buffer. Reject runt files.  Fixes\n\tCVE-2017-12983.  Notified of problem via email from Petr Gajdos on\n\tThu, 2 Nov 2017.\n\n2017-10-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Fix SourceForge bug #517 \"Push\n\toperations in DrawImage can lead to negative strncpy when looking\n\tfor pop\".  Interestingly, valgrind and ASAN only detected a\n\tproblem with one of the test cases since exercised code which\n\tupdated an array using the index.  It appears that Linux strncpy()\n\tsimply ignores the bad request.\n\n2017-10-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Make sure that a reasonable\n\texception is reported to the user when there is a read failure.\n\n2017-10-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Reject JNG files with\n\tunreasonable dimensions given the file size.\n\n2017-10-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Fix SourceForge bug #518 \"Null\n\tpointer in\".  Also make sure that errors are reported properly due\n\tto problems with transferring JPEG scanlines.\n\t(ReadOneJNGImage): Add more checks for null value returned from\n\tSetImagePixels().\n\n2017-10-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/describe.c (DescribeImage): Fix possible heap read\n\toverflow while accessing heap data, and possible information\n\tdisclosure while describing the IPTC profile.  Report was provided\n\tvia email from Maor Shwartz to the graphicsmagick-security mail\n\talias on Thu, 19 Oct 2017.  Independent security researchers,\n\tJeremy Heng (@nn_amon) and Terry Chia (Ayrx), reported this\n\tvulnerability to Beyond Security’s SecuriTeam Secure Disclosure\n\tprogram. Please note that this interface is usually (but not\n\texclusively) used from within the command-line utility program, in\n\twhich case there is not much useful information which might be\n\tdisclosed.\n\t(DescribeImage): Fix possible heap write overflow when describing\n\tvisual image directory.  Report was provided via email from Maor\n\tShwartz to the graphicsmagick-security mail alias on Thu, 19 Oct\n\t2017.  Independent security researchers, Jeremy Heng (@nn_amon)\n\tand Terry Chia (Ayrx), reported this vulnerability to Beyond\n\tSecurity’s SecuriTeam Secure Disclosure program. Please note that\n\tthis interface is usually (but not exclusively) used from within\n\tthe command-line utility program, in which case the only harm\n\twould be a program crash.\n\n\t* magick/constitute.c (WriteImage): Assure that the errno present\n\twhen the blob error status first occured is reported to the user.\n\n\t* magick/blob.c (GetBlobStatus): Blob error status is now updated\n\timmediately upon the first error reported.\n\t(GetBlobFirstErrno): Returns errno value when the first blob error\n\twas reported.  This is useful for error reporting.\n\n2017-10-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (WriteImage): Restore use of GetBlobStatus()\n\tto test if an I/O error was encountered while writing output file.\n\tThis assures that I/O failure in writers which do not themselves\n\tverify writes is assured to be reported.\n\n2017-10-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/webp.c (WriterCallback): WebP writer now detects partial\n\twrite to output file.  Patch by Przemysław Sobala from a posting\n\ton Mon, 16 Oct 2017 via the graphicsmagick-help mailing list.\n\n2017-10-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (MontageImageCommand): Fix memory leaks in\n\terror return path.  Only people doing leak testing or the few who\n\texecute MontageImageCommand() as a function will care about this.\n\n\t* magick/studio.h (NumberOfObjectsInArray): The\n\tNumberOfObjectsInArray() macro is used to compute the number of\n\twhole objects in an array.  Instead it was rounding up, resulting\n\tin scrambling the heap beyond the allocation.  Fixes\n\tCVE-2017-13737 \"There is an invalid free in the MagickFree\n\tfunction in magick/memory.c in GraphicsMagick 1.3.26 that will\n\tlead to a remote denial of service attack.\"\n\n2017-10-09  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Suppress \"comparison between\n\tsigned and unsigned integer expressions\" warning.\n\t* coders/png.c (ReadJNGImage): Fix memory leak in SourceForge\n\tIssue #469 \"use after free in ReadJNGImage\".\n\t* coders/png.c (ReadJNGImage): Fix memory leak in SourceForge\n\tIssue #470 \"Assert failure in writeblob\".\n\n2017-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc: Fix SourceForge issue #444 \"gm mogrify: Wrong\n\tdocumentation for option -output-directory\".\n\n2017-10-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/module.c (InitializeModuleSearchPath): Verify that any\n\tcomponent paths specified in MAGICK_CODER_MODULE_PATH and\n\tMAGICK_FILTER_MODULE_PATH exist before adding them to search paths\n\tactually used, and convert to real paths if possible.  This avoids\n\tpossible use of relative paths to load modules (a possible\n\tsecurity issue) and may improve efficiency by removing\n\tnon-existent paths.\n\n\t* coders/yuv.c (ReadYUVImage): Fix leak of scanline upon Image\n\tallocation failure.  Patch submitted by Petr Gajdos via email on\n\tFri, 6 Oct 2017.\n\n2017-09-13  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Attempt to fix SourceForge Issue #469 \"use after\n\tfree in ReadJNGImage\".  Note that this change was found to replace\n\ta use after free with a memory leak so the problem is not solved\n\tyet.\n\n2017-10-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (DCM_ReadNonNativeImages): Additional fix\n\t(improvement) for SourceForge issue #512 \"NULL Pointer Dereference\n\tin DICOM Decoder\".\n\n2017-10-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (ReadDCMImage): Fix SourceForge issue #512 \"NULL\n\tPointer Dereference in DICOM Decoder\".\n\n\t* coders/pict.c (ReadPICTImage): Fix SourceForge issue #511\n\t\"Memory Allocation error due to malformed image file\".\n\n\t* coders/pnm.c (WritePNMImage): Fix SourceForge issue #503 \"memory\n\tleak in WritePNMImage\".\n\n\t* coders/png.c (ReadMNGImage): Fix SourceForge issue #501 \"memory\n\tleak in ReadMNGImage\".\n\n\t* magick/segment.c (InitializeIntervalTree): Fix SourceForge issue\n\t#507 \"null pointer in segment.c\" and issue #508 \"null pointer in\n\tsegment.c\".\n\n\t* coders/topol.c (ReadTOPOLImage): Fix SourceForge issue #510\n\t\"null pointer and meory leak in topol.c\".\n\n\t* magick/widget.c (MagickXFileBrowserWidget): Fix SourceForge\n\tissue #506 \"null pointer in widget.c\".\n\n\t* coders/tiff.c (WriteTIFFImage): Fix SourceForge issue #509\n\t\"Memory leak in tiff.c\".\n\n\t* magick/module.c (FindMagickModule): Fix SourceForge issue #502\n\t\"null pointer in module.c\".\n\n\t* coders/avs.c (ReadAVSImage): Fix Coverity CID 184115 \"Control\n\tflow issues (DEADCODE)\".\n\n2017-09-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/avs.c (ReadAVSImage): Fix SourceForge issue #499 \"memory\n\tleak in avs.c\".\n\n\t* coders/cmyk.c (ReadCMYKImage): Fix SourceForge issue #498\n\t\"memory leak in cmyk.c\".\n\n\t* coders/cut.c (ReadCUTImage): Fix SourceForge issue #497 \"memory\n\tleak in cut.c\".\n\n\t* coders/dpx.c (ReadDPXImage): Fix SourceForge issue #496 \"memory\n\tleak in dpx.c\".\n\n\t* coders/hdf.c (ReadHDFImage): Fix SourceForge issue #495 \"memory\n\tleak in hdf.c\".\n\n\t* coders/pcx.c (ReadPCXImage): Fix SourceForge issue #494 \"memory\n\tleak in pcx.c\".\n\n\t* coders/pcd.c (ReadPCDImage): Fix SourceForge issue #493 \"memory\n\tleak in ReadPCDImage\".\n\n\t* coders/histogram.c (WriteHISTOGRAMImage): Fix SourceForge issue\n\t#492 \"memory leak in WriteHISTOGRAMImage\".\n\n\t* coders/gif.c (WriteGIFImage): Fix SourceForge issue #491 \"memory\n\tleak in WriteGIFImage\".\n\n\t* coders/fits.c (WriteFITSImage): Fix SourceForge issue #490\n\t\"memory leak in WriteFITSImage\".\n\n\t* coders/palm.c (WritePALMImage): Fix SourceForge issue #489\n\t\"memory leak in WritePALMImage\".\n\n\t* coders/rgb.c (ReadRGBImage): Fix SourceForge issue #488 \"Memory\n\tleak in rgb.c\".\n\n\t* coders/palm.c (ReadPALMImage): Fix SourceForge issue #487 \"NULL\n\tpointer dereference in ReadPALMImage\".\n\n\t* Magick++/lib/Options.cpp (strokeDashArray): Fix SourceForge\n\tissue #486 \"NULL pointer dereference in\n\tMagick::Options::strokeDashArray\".\n\n\t* magick/nt_feature.c (NTGetTypeList): Fix SourceForge issue #485\n\t\"NULL pointer dereference in NTGetTypeList\".\n\n\t* coders/sun.c (ReadSUNImage): Fix SourceForge issue #484 \"Memory\n\tleak in sun.c\".\n\n\t* coders/tim.c (ReadTIMImage): Fix SourceForge issue #483 \"Memory\n\tleak in tim.c\".\n\n\t* magick/nt_base.c (NTRegistryKeyLookup): Fix SourceForge issue\n\t#482 \"NULL pointer dereference in NTRegistryKeyLookup\".\n\n\t* coders/viff.c (ReadVIFFImage): Fix SourceForge issue #481\n\t\"Memory leak in viff.c\".\n\n\t* magick/profile.c (SetImageProfile): Fix SourceForge issue #480\n\t\"assertion failure in MagickMapAllocateMap\".\n\n\t* coders/yuv.c (ReadYUVImage): Fix SourceForge issue #478 \"Memory\n\tleak in yuv.c\".\n\n\t* magick/map.c (MagickMapCloneMap): Fix SourceForge issue #477\n\t\"assertion failure in MagickMapIterateNext\".\n\n\t* coders/emf.c (ReadEnhMetaFile): Fix SourceForge issue #475 \"NULL\n\tpointer dereference in ReadEnhMetaFile\".\n\n\t* coders/cineon.c (ReadCINEONImage): Fix SourceForge issue #473\n\t\"NULL pointer dereference in ReadCINEONImage\"\n\n\t* coders/tiff.c (TIFFIgnoreTags): Fix SourceForge issue #476 \"NULL\n\tPointer in tiff.c\".\n\n2017-09-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (GetConfigureBlob): Fix SourceForge issue #472\n\t\"NULL Pointer in GetConfigureBlob\".\n\n2017-09-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/rle.c (ReadRLEImage): Fix SourceForge issue #458 \"Heap\n\tout of bounds read in ReadRLEImage()\".\n\n2017-09-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sgi.c (ReadSGIImage): Check for EOF while reading SGI\n\tfile header.  Issue was brought to our attention by Petr Gajdos\n\tvia email on Fri, 1 Sep 2017.\n\n2017-09-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Allow a single scanline, strip,\n\ttile, to be 1000X larger than the input file in order to not cause\n\tproblems for extremely compressible images or tile sizes much\n\tlarger than the pixel dimensions.\n\n2017-09-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/symbols.h, wand/wand_symbols.h: Update C library symbols\n\twhich should be prefixed with 'Gm'. However, GM will not move\n\tMagick++ namespace because of the ImageMagick version.  Resolves\n\tSourceForge issue #468 \"--enable-symbol-prefix does not prevent\n\tclashes with libMagick++ or libMagickWand?\"\n\n\t* coders/png.c (DestroyJNG): DestroyJNG should be a static\n\tfunction.  Was wrongly exposed as DestroyJNGInfo in 1.3.26.  This\n\tis not a public function and was not intended to be part of the\n\tABI.\n\n\t* coders/tiff.c (ReadTIFFImage): Limit scanline, strip, and tile\n\tmemory allocations based on file size multiplied by a maximum\n\tcompression ratio.  Fixes SourceForge issues #460, #461, #462,\n\t#463, #464 \"allocation failure in ReadTIFFImage\".\n\n\t* coders/pnm.c (ReadPNMImage): Require that XV 332 format have 256\n\tcolors.  Fixes SourceForge issue #465 \"NULL Pointer Dereference\n\ttriggered by malformed file\".  In our own testing the test case\n\tproduced an assertion failure because assertions were enabled.\n\n\t* magick/colormap.c (AllocateImageColormap): Use unsigned array\n\tindex.\n\n2017-09-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mat.c (ReadMATImage): Fix CVE-2016-10070, which is a heap\n\toverflow in the MAT reader due to an under-sized memory\n\tallocation.  Based on private email from Petr Gajdos on Mon, 11\n\tSep 2017.\n\n2017-09-13  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Check MemoryResource before allocating\n\tping_pixel array.\n\n2017-09-11  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* magick/shear.c: Possible evil loop might waste CPU for long time\n        without any reason.\n\n2017-09-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Fix SourceForge issue #448 \"Heap\n\tout of bounds read in DrawDashPolygon()\".  Problem was reported by\n\tKamil Frankowicz on August 28, 2017.\n\n\t* coders/uil.c (WriteUILImage): Fix crash in UIL writer when\n\twriting image containing transparency.  Issue was reported by\n\tLCatro via email on 18 Jul 2017.\n\n\t* coders/wpg.c (InsertRow): Fix crash which occurs if image is not\n\tPseudoClass but a PseudoColor scanline is needed.  Resolves\n\tSourceForge issue #449 \"Null pointer dereference in InsertRow()\".\n\n\t* coders/rle.c (ReadRLEImage): Impose image dimension limits\n\taccording to Utah RLE specification. Cap number of planes handled\n\tinternally at 4.  Remove non-standard multi-frame extension, which\n\tdid not work anyway.\n\n2017-09-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadJNGImage): Complete fixing CVE-2017-8350 crash\n\twhile reading a malformed JNG file.\n\n\t* coders/{html.c, map.c, plasma.c, png.c, psd.c, rle.c, stegano.c,\n\tuil.c}: Downgrade claimed coder stability level for HTML, SHTML,\n\tMAP, FRACTAL, PLASMA, JNG, MNG, RLE, STEGANO, and UIL formats.\n\n2017-09-08  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadJNGImage): More efforts toward fixing\n\tCVE-2017-8350 while reading a malformed JNG file.\n\n2017-09-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/error.c (ThrowLoggedException): Capture the first\n\texception at ErrorException level or greater, or only capture\n\texception if it is more severe than an already reported exception.\n\tThis should help lead to better error reports since the first\n\terror is usually the most significant.\n\n\t* coders/png.c (ReadJNGImage): Add \"improper header\" exception\n\treporting.\n\n2017-09-01  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadJNGImage): Efforts toward fixing CVE-2017-8350\n\twhile reading a malformed JNG file.\n\n2017-08-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c (ReadWPGImage): Patch submitted by Petr Gajdos to\n\tcheck that .Width and .Height are greater than zero before they\n\tare assigned to image->columns and image->rows respectively\n\t(CVE-2014-9815).\n\t(ReadWPGImage): Do more validations on WPG_Palette.StartIndex and\n\tWPG_Palette.NumOfEntries.\n\n2017-08-29  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Fix for SourceForge issue #440\n\t\"use-after-free in CloseBlob (blob.c) (INCOMPLETE FIX FOR\n\tCVE-2017-11403)\" and SourceForge issue #438 \"heap use after free\n\tin CloseBlob\".\n\t* coders/png.c (ReadOneJNGImage): Fix for SourceForge issue #439\n\t\"assertion failure in magick/pixel_cache.c\"\n\n2017-08-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mpeg.c (WriteMPEGImage): Fix MPEG writer memory leak.\n\tOnly the first image in the coalesce image list was being freed.\n\tProblem was reported by LCatro via email on July 15, 2017.\n\n\t* magick/attribute.c (TracePSClippingPath, TraceSVGClippingPath):\n\tFix SourceForge bug #447 \"Heap out of bounds read in\n\tReadMSBShort()\".\n\n2017-08-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xbm.c (ReadXBMImage): Fix two denial of service (DOS)\n\tissues in ReadXBMImage() which result in the reader not\n\treturning. Problem was reported via email on Wed Aug 23 2017 by\n\tXiaohei and Wangchu from Alibaba Security Team.\n\n\t* coders/jnx.c (ReadJNXImage): Fix denial of service (DOS) issue\n\tin ReadJNXImage() whereby large amounts of CPU and memory\n\tresources may be consumed although the file itself does not\n\tsupport the requests.  Problem was reported via email on Wed Aug\n\t23 2017 by Xiaohei and Wangchu from Alibaba Security Team.\n\n2017-08-14  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneMNGImage): Deal with invalid (too large)\n\tlength of MNG chunks (bug #446).\n\n2017-08-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (ReadPNMImage): Verify that sufficient file data\n\texists to support what the file header requires before allocating\n\tmemory for it.  Fixes problem reported by Agostino Sarubbo via\n\temail on Wed, 12 Jul 2017 and reported yet again via SourceForge\n\tbug #441 \"memory allocation failure in MagickRealloc\".\n\n2017-08-20  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c: Fix SourceForge bug #433 \"memory leak in\n\tReadMATImage\".  Credit for discovering and reporting the problem\n\tis \"ADLab of Venustech\".\n\n\t* coders/sun.c (ReadSUNImage): Fix failure to allocate memory due\n\tto inadequate file data to support claimed image width and height.\n\tFirst notified by email from Agostino Sarubbo on 14 Jul 2017 and\n\tthen again as SourceForge bug #442 \"memory allocation failure in\n\tmagickmalloc\".\n\n2017-08-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c (GetStyleTokens): Fix SourceForge bugs 434 \"heap\n\tbuffer overflow in GetStyleTokens\", 435 \"null pointer\n\tdereference_in_SVGStartElement\", and 436 \"heap buffer overflow in\n\tGetStyleTokens\" which all originated from a heap buffer overflow\n\tin GetStyleStokens(), or inconsistent initialization.  Now the\n\timplementation truncates parsing for poorly-formed input (to avoid\n\tbuffer overflow) while still correctly parsing well-formed input.\n\tThe reproducers and problem reports are attributed to \"ADLab of\n\tVenustech\".\n\n2017-08-14  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Fixed double-free after\n\treading a malformed JNG (Issue #438).\n\n2017-08-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcd.c (ReadPCDImage): Fix memory leak on return path due\n\tto corrupted header.  Patch included in email on 14 Aug 2017 by\n\tPetr Gajdos (ImageMagick CVE CVE-2017-8351).\n\n2017-08-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (ReadGIFImage): Assure that global colormap is\n\tinitialized.\n\n\t* coders/pict.c (ReadPICTImage): Fix memory leaks in error return\n\tpath.  ImageMagick CVE CVE-2017-8353.  Patch by Petr Gajdos.\n\n2017-08-11  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* tests/rwblob.c and rwfile.c: Write the reason for FAIL in\n\ttest-suite.log.\n\t* magick/image.h: Revised table of image orientations to show\n\tExif ImageOrientation values (which happen to be the same as\n\tthe enum values 1 to 8).\n\t* coders/png.c: ReadJNGIMage(): fix memory leak (Issue 431).\n\n2017-08-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mtv.c (ReadMTVImage): Fix memory leak in error return\n\tpath upon unexpected EOF (ImageMagick CVE-2017-9142).  Problem was\n\tbrought to our attention via email from Petr Gajdos on Wed, 9 Aug\n\t2017.  Also changed pixel cache access functions used to assure\n\tdelivery of exception to the user.\n\n2017-08-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac (SETJMP_IS_THREAD_SAFE): Decide if setjmp/longjmp\n\tare thread safe based on host OS.  Assume that these interfaces\n\tare thread safe by default.  Declared not to be thread safe under\n\tSolaris.  Declaring these interfaces to be thread safe increases\n\tavailable concurrency for coders which use setjmp/longjmp for\n\terror recovery (e.g. PNG and JPEG).\n\n2017-08-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (RegisterJPEGImage): Add support for the\n\tSETJMP_IS_THREAD_SAFE preprocessor definition (already used by\n\tcoders/png.c) to indicate if setjmp/longjmp are thread safe on\n\tthis platform and that it is safe for multiple encoders/decoders\n\tto be active at one time.\n\n2017-07-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sun.c: Fix heap read overflow while indexing into\n\tcolormap. Problem was reported via email on 17 Jul 2017 by\n\tAgostino Sarubbo.\n\n2017-07-31  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Stop a leak when rejecting a\n\tMNG image with dimensions that are too large.\n\n2017-07-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c (ReadWMFImage): Eliminate use of already freed heap\n\tdata in error reporting path.  Problem was reported via email by\n\tAgostino Sarubbo on Fri, 14 Jul 2017\n\n2017-07-25  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage) Free chunk allocation that remains\n\tafter attempting to read a truncated file.\n\t* coders/png.c: Removed some redundant checks for chunk length\n\tbefore MagickFreeMemory(chunk), which is safe to call with a\n\tNULL argument.\n\t* coders/png.c: Fixed writer bug due to missing brackets; a Log\n\tstatement should have been inside the \"i\" loop but instead was\n\tusing i++ left over from the loop.  Bug report by L. Catro.\n\t* coders/png.c: Reject a MNG with dimensions greater than 65k\n\tby 65k.\n\t* coders/png.c (WriteOnePNGImage): Return without crashing if\n\tWriteOnePNGImage is passed a NULL image. Fixes CVE-2017-11522.\n\n2017-07-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcl.c (WritePCLImage): Fix null pointer dereference in\n\tPCL writer when writing monochrome images.  Problem was reported\n\tby LCatro via email on July 18.\n\n\t* magick/pixel_cache.c (PersistCache): Fix memory leak while\n\twriting a MPC file.  Problem was reported by LCatro via email on\n\tJuly 18.\n\n\t* coders/map.c (WriteMAPImage): Fix null pointer dereference or\n\tsegmentation violation in the MAP writer if the input image is not\n\talready colormapped.  Problem was reported by LCatro via email on\n\tJuly 18.\n\n\t* coders/gray.c (WriteGRAYImage): Improve tracing and tidy up.\n\n\t* coders/rgb.c (WriteRGBImage): Fix heap overwrite in raw RGB\n\twriter (all output subformats) given a multiframe sequence using\n\tdifferent widths.  Problem was reported by LCatro via email on\n\tJuly 18.\n\n\t* coders/cmyk.c (WriteCMYKImage): Fix heap overwrite in raw CMYK\n\twriter (all output subformats) given a multiframe sequence using\n\tdifferent widths.  Also fix wrong output of CMYKA (and vice-versa)\n\twhen CMYK was intended.  Problem was reported by LCatro via email\n\ton July 18.\n\n\t* coders/palm.c: Disable the PALM writer since the writer is a\n\twork in progress and still has implementation problems.  Perhaps\n\tno one in the world remains who cares about the undocumented PALM\n\tformat.  Resolves heap overflow and assertion issues reported by\n\tLCatro via emails on July 11th, and 12th, 2017.\n\n\t* magick/colormap.c (ReplaceImageColormap): Throw an exception\n\trather than assertion if the input image is not colormapped.\n\n2017-07-13  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Implemented eXIf chunk support.\n\n2017-07-12  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Fix typecast of left shifts (patch by Bob F)\n\n2017-07-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/ps.c (ReadPSImage): Fix reference to constant NULL image\n\targument which is dereferenced to pass an exception to\n\tMagickMonitorFormatted().  Problem was reported by Agostino\n\tSarubbo via email on Wed, 12 Jul 2017.\n\n2017-07-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c: Add casts to fix undefined behavior in left\n\tshifts.  Issue was reported by Agostino Sarubbo via email on Mon,\n\t10 Jul 2017.\n\n2017-07-10  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Ignore out-of-bounds MOVE\n\tand CLIP object_id's.\n\t* coders/png.c (ReadMNGImage): Fix apparent off-by-one error\n\tin MNG FRAM change_clipping processing.\n\t* coders/png.c (ReadMNGImage): Fix out-of-order CloseBlob()\n\tand DestroyImageList() that caused a use-after-free crash.\n\tFixes CVE-2017-11403.  This bug was discovered by Agostino Sarubbo.\n\n2017-07-08  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJngImage): Revised double-free fix.\n\n2017-07-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Fix double-frees caused by\n\tcommit on 2017-07-06.\n\n\t* coders/jpeg.c (ReadJPEGImage): Defer creating pixel cache until\n\tafter successfully reading first scanline.  Classify some serious\n\tlibjpeg reported \"warnings\" as errors and quit processing\n\tscanlines immediately upon first error so that corrupt JPEG does\n\tnot consume excessive resources.  Resolves excessive resource\n\tconsumption issue reported for two JPEG files provided via email\n\tby LCatro on Tue, 4 Jul 2017.\n\n2017-07-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Remove spurious '\\n' from log\n\tstatement.\n\n2017-07-06  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Consolidate JNG cleanup into a new DestroyJNG()\n\tfunction.\n\n2017-07-05  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: prevent a crash due to zero-length color_image\n\twhile reading a JNG image. (CVE-2017-11102)\n\n2017-07-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Make sure is up to date.\n\n\t* www/index.rst: Update for 1.3.26 release.\n\n\t* version.sh: Update library versioning for 1.3.26 release.\n\n\t* magick/command.c (BatchCommand): Add ferror() checks around\n\tbatch input loop.\n\n2017-07-03  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Reject a PNG file if the file size is too small\n\t(less than 61 bytes).  Reject a JNG file if it is too small (less\n\tthan 147 bytes).\n\t* coders/jpeg.c: Reject a JPEG file if the file size is too small\n\t(less than 107 bytes).\n\n2017-07-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Compute required file size and\n\tverify that sufficient data exists in file before allocating\n\tmemory to decode the image data.  Resolves problem with DPX file\n\twith valid header (but a huge claimed image width) provided\n\tprovided via email on Thu, 29 Jun 2017 by LCatro.  This issue has\n\tbeen assigned CVE-2017-10799.\n\n2016-07-02  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Check whether reported object size overflows file size.\n\n2016-07-01  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Safety check for forged and or corrupted data.\n\tThis issue has been assigned CVE-2017-10800.\n\n2017-07-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (\"QuantumTransferMode\"): Use a generalized method\n\tto enforce that buffer overflow can not happen while importing\n\tpixels.  Resolves problem with RGB TIFF claiming only one sample\n\tper pixel provided via email on Thu, 29 Jun 2017 by LCatro.  This\n\tissue has been assigned CVE-2017-10794.\n\n2017-06-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Convert bare 'unsigned int' to MagickPassFail\n\twhere suitable to make intentions clear.  Convert True/False to\n\tMagickTrue/MagickFalse or MagickPass/MagickFail according to\n\tpurpose.  This is a continuation of a gradual migration and does\n\tnot represent an API change.\n\n2017-06-25  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Avoid NULL dereference when MAGN chunk processing\n\tfails (https://sourceforge.net/p/graphicsmagick/bugs/426/). Expand\n\tTABs.\n\n2017-06-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update NEWS with changes since the previous release.\n\n\t* www/programming.rst: Switch the Lua link to\n\thttps://github.com/arcapos/luagraphicsmagick, which is a more\n\tcomplete and direct interface from Lua to GraphicsMagick's Wand\n\tAPI.\n\n2017-06-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* VisualMagick/installer/gm-foo-dll.iss: Remove PerlMagick from\n\tthe slim Inno Setup installer builder and remove mention of\n\tPerlMagick from the installer documentation.\n\n\t* TclMagick/generic/TclMagick.c (magickCmd): Resolve SourceForge\n\tpatch #51 \"TclMagick: memory access error; possible segfault\".\n\t(newMagickObj): Fix formatting of pointer value so it is 64-bit\n\tsafe.  Resolves SourceForge patch #50 \"TclMagick: 64-bit\n\tportability issue\".\n\n\t* coders/pict.c (ReadPICTImage): Avoid possible use of negative\n\tvalue when indexing array, which would cause buffer overflow.\n\tResolves SourceForge issue #427 \"One possible buffer overflow\n\tvulnerability in\n\tGraphicsMagick-1.3.25/coders/pict.c:ReadPICTImage()\".\n\n2017-06-22  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Stop memory leak when reading invalid JNG image.\n\tFixes CVE-2017-8350.\n\n2017-06-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c: Fix lcms2.h inclusion logic.\n\n\t* wand/magick_wand.c (MagickSetImageOrientation): Eliminate use of\n\tsnprintf, which is not supported by older Visual Studio.\n\n2017-06-09  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Accept exIf chunks whose data segment\n\terroneously begins with \"Exif\\0\\0\".\n\n2017-06-01  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Removed experimental zxIF chunk support.  That\n\tproposal is dead.\n\n2017-05-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* config/log.mgk: Added documentation suggested by SourceForge\n\tissue #419 \"Consider a small patch to log.mgk\".\n\n\t* www/Changes.rst: Add missing link to most recent changes.\n\n2017-05-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/Magick++/Image.rst: Improve documentation for Magick++\n\tImage::iccColorProfile() and Image::renderingIntent().\n\n2017-05-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff: Update to libtiff 4.0.8.\n\n2017-03-19  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Quieted a new Coverity complaint about a potential\n\ttext buffer overrun.\n\n2017-03-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.c (SetImageInfo): Ignore empty magic prefix\n\tspecification and do not remove colon character from start of\n\tfilename.  Resolves SourceForge bug #415 \"Inconsistent Behavior w/\n\tinput_file Parameter\".\n\n2017-03-18  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Added new private orNT PNG chunk, to\n\tpreserve image->orientation when it is defined and not\n\tthe default TopLeft.\n\t* coders/jpeg.c: Mention image->orientation in the log when\n\twriting a JPEG.\n\n2017-03-15  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): Add version info about\n\tgm, libpng, zlib, and lcms to the PNG debug log.\n\n2017-03-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (ImportImageCommand): Fix handling of -frame\n\toptions. Option handling was incorrect due to option checking the\n\tframe option after it had been freed.  Checking the frame dash\n\toption before freeing the argument solves the problem.  From patch\n\tprovided by Victor Ananjevsky as SourceForge patch #49 \"-frame\n\tdoesn't work in gm import\".\n\n\t* Magick++/lib/Image.cpp (attribute): Added Image attribute method\n\twhich accepts a 'char *' argument, and will remove the attribute\n\tif the value argument is NULL.  From patch provided by \"Gints\" as\n\tSourceForge patch #46 \"C++ api - method to clear/remove\n\tattribute\".\n\n\t* VisualMagick/configure/configure.cpp (InitInstance): Applied\n\tpatch by Paul McConkey to allow the quantum command line argument\n\tto set the default value in the wizard drop list.  This allows\n\tsetting the quantum depth when the /nowizard argument was\n\tsupplied.  Resolves SourceForge patch #48 \"When running from the\n\tcommand line configure.exe does not use the quantum argument\".\n\tThe provided configure.exe still needs to be rebuilt to\n\tincorporate this change.\n\n\t* magick/command.c (MogrifyImage): The -orient command now also\n\tupdates the orientation in the EXIF profile, if it exists.\n\n\t* Magick++/lib/Image.cpp (orientation): Update orientation in EXIF\n\tprofile, if it exists.\n\n2017-03-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c: Support PGX JPEG 2000 format for reading and\n\twriting (within the bounds of what JasPer supports).\n\n2017-02-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (QuantumTransferMode): Fix out of bounds read when\n\treading CMYKA TIFF which claims to have only 2 samples per pixel.\n\tProblem was reported via email on February 15, 2017 by Valon\n\tChu. This issue was assigned CVE-2017-6335.\n\n2017-01-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/options.imdoc (-geometry): Geometry documentation changes\n\tsuggested by Jon Wong.\n\n2017-01-26  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Added support for a proposed new PNG chunk\n\t(zxIf, read-only) that is currently being discussed on the\n\tpng-mng-misc at lists.sourceforge.net mailing list.  Enable\n\texIf and zxIf with CPPFLAGS=\"-DexIf_SUPPORTED -DxzIf_SUPPORTED\".\n\tIf exIf is enabled, only the uncompressed exIF chunk will be\n\twritten and the hex-encoded zTXt chunk containing the raw Exif\n\tprofile won't be written.\n\n2017-01-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/msl.c (MSLStartElement): Change test for NULL image\n\tpointer to before it is used rather than after it is used.\n\tProblem reported by Petr Gajdos on 2017-01-25.\n\n2017-01-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* TclMagick/unix/m4/tcl.m4: Update tcl.m4 to TEA 3.10.  File\n\tsupplied by Massimo Manghi.\n\n2017-01-21  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Added support for a proposed new PNG\n\tchunk (exIf read-write, eXIf read-only) that is currently\n\tbeing discussed on the png-mng-misc at lists.sourceforge.net\n\tmailing list.\n\n2017-01-21  Glenn Randers-Pehrson  <glennrp@simple.dallas.tx.us>\n\n\t* coders/png.c: Added read_user_chunk_callback() function\n\tand used it to implement a private PNG caNv (canvas) chunk\n\tfor remembering the original dimensions and offsets when an\n\timage is cropped.  Previously we used the oFFs chunk for this\n\tpurpose, but this had potential conflicts with other applications\n\tthat also use the oFFs chunk.\n\n2017-01-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* TclMagick/Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Applied\n\tpatch by Massimo Manghi to set AM_DISTCHECK_CONFIGURE_FLAGS so\n\tthat 'make distcheck' remembers configuration options, and also to\n\tuninstall pkgIndex.tcl.\n\n\t* magick/image.c (SetImageEx): Use PixelIterateMonoSet() for\n\tpossibly improved efficiency.\n\n\t* magick/pixel_iterator.c (PixelIterateMonoSet): New pixel\n\titerator intended for use when initializing image pixels, without\n\tregard to existing values.\n\n2017-01-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Copyright.txt: Bump copyright years and rotate ChangeLog.\n\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2018",
    "content": "2018-12-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (ReadJPEGImage): Move return point for 'ping' mode\n\tuntil after jpeg_start_decompress() and after JPEG compression\n\tproperties have been estimated.  Fixes SourceForge issue #578 \"gm\n\tidentify with format \"%[JPEG-Colorspace-Name]\" does not work\" and\n\t#586 \"Identify returning wrong compression values\".\n\n2018-12-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (ReadGIFImage): Don't throw an error if opacity is\n\toutside of the range of the image colors.  Fix suggested by 莫红波\n\t<hongbo.mo@upai.com> on the graphicsmagick-bugs mailinb list on\n\tFri, 9 Oct 2015.\n\n\t* magick/memory.h (MagickAllocateClearedArray): New macro for\n\tallocating a cleared array.\n\n\t* magick/resize.c (ScaleImage): Patch by Troy Patteson which\n\tresolves SourceForge issue #381 \"Artifacts when scaling a PNG with\n\tsemi-transparent pixels\".\n\n\tScaleImage() suffers from two problems related to the blending of\n\tfully transparent pixels with non-fully transparent pixels during\n\tthe scaling operation.\n\n\tThe first is that the colour values for fully transparent pixels\n\tare contributing to the colour values of the blended pixels when\n\tthey should not.\n\n\tThe second is that the colour values of pixels blended with fully\n\tand non-fully transparent pixels are scaled as though the fully\n\ttransparent pixels contribute to the blended pixels' colour values\n\twhen they should not. For example, if blending 10% of a fully\n\topaque white pixel with 90% of a fully transparent black pixel one\n\twould expect the blended pixel RGBA values to be 255,255,255,25.5\n\tassuming 8 bit colour but they are in fact 25.5,25.5,25.5,25.5.\n\n\tThe provided patch solves the first issue by treating the colour\n\tvalues of fully transparent pixels as zero and the second issue by\n\trecording the volume of each blended pixel made up of pxiels that\n\tare not fully transparent (0.1 in the above example) and then\n\tscaling the blended pixel RGB values by dividing by that\n\tamount. In the above example, 25.5/0.1 = 255.\n\n2018-12-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dib.c (ReadDIBImage): DIB images claiming more than\n\t8-bits per pixel are not colormapped.  Reject such files.  Fixes\n\tSourceForge issue #585 \"Assertion Failure in coders/png.c:7503\".\n\tThe problem is in the DIB reader rather than PNG.\n\n\t* coders/miff.c (ReadMIFFImage): Detect and reject zero-length\n\tdeflate-encoded row in MIFF version 0.  Fixes oss-fuzz 11876\n\t\"graphicsmagick/coder_MIFF_fuzzer: Use-of-uninitialized-value in\n\tdeflate_slow\". (Credit to OSS-Fuzz)\n\n\t* configure.ac: Improve search for true Microsoft Windows fonts\n\tand provide better indication of results.  Fix a typo which caused\n\tDcrawExtraOptions not to be evaluated correctly.\n\n2018-12-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (QuantumTransferMode): Be more strict about the\n\trequirements for CIE Log2(L) and LOGLUV images.\n\t(ReadTIFFImage): Apply memory resource limits to strip and tile\n\tallocations.\n\t(ReadTIFFImage): Rationalize tile width/height to reject large\n\ttile sizes which are much larger than the image dimensions.  Fixes\n\toss-fuzz 11824 \"graphicsmagick/coder_BIGTIFF_fuzzer: Out-of-memory\n\tin graphicsmagick_coder_BIGTIFF_fuzzer\". (Credit to OSS-Fuzz)\n\t(ReadTIFFImage): Return with error if TIFFClientOpen() reports\n\terrors yet still returns a TIFF handle.\n\n2018-12-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tga.c (WriteTGAImage): Image rows/columns must not be\n\tlarger than 65535. Fixes SourceForge #583 \"heap-buffer-overflow in\n\tWriteTGAImage of tga.c\".\n\n2018-12-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (ReadBMPImage): Fix heap overflow in 32-bit build\n\tdue to arithmetic overflow.  Only happens if limits are changed\n\tfrom defaults. Fixes SourceForge #582 \"heap-buffer-overflow in\n\tReadBMPImage of bmp.c\".\n\n2018-12-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* common.shi.in (MAGICK_FONT): The test suite must pass even on\n\tsystems where we don't find any fonts.\n\n2018-12-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Sanitize claimed profile size\n\tbefore allocating memory for it.  Fixes oss-fuzz 11781\n\t\"graphicsmagick/coder_MIFF_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_MIFF_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-12-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Fix non-terminal MNG looping.\n\tFixes oss-fuzz 11596 \"graphicsmagick/coder_MNG_fuzzer: Timeout in\n\tgraphicsmagick_coder_MNG_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-12-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (WriteXPMImage): Assure that added colormap entry\n\tfor transparent XPM is initialized. Fixes oss-fuzz 11617\n\t\"graphicsmagick/coder_XPM_fuzzer: Use-of-uninitialized-value in\n\tQueryColorname\". (Credit to OSS-Fuzz)\n\n\t* coders/miff.c (ReadMIFFImage): Fix memory leak of profiles\n\t'name' when claimed length is zero.  Fixes oss-fuzz 11710\n\t\"graphicsmagick/coder_MIFF_fuzzer: Direct-leak in AllocateString\".\n\tand oss-fuzz 11688 \"graphicsmagick/coder_MIFF_fuzzer:\n\tOut-of-memory in graphicsmagick_coder_MIFF_fuzzer\". (Credit to\n\tOSS-Fuzz)\n\n2018-12-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/oss-fuzz-build.sh: Apply patch from Alex Gaynor to add\n\tZstd to the oss-fuzz build.\n\n2018-12-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac (DcrawExtraOptions): For QuantumDepth > 8 pass -6\n\toption to dcraw.  Fixes SourceForge issue #568 \"dcraw not\n\treturning 16 bit image even though quantum depth is set to 16\".\n\n\t* fuzzing/oss-fuzz-build.sh (PKG_CONFIG_PATH): Build WebP prior to\n\tlibtiff so that libtiff has a chance to find it.\n\n2018-11-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (TimeImageCommand): Time command now shows 6\n\tdigits of elapsed time indication since this precision is often\n\tnow available and it is useful to see.\n\n2018-11-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Magick++/Drawable.h: Fix use of clang diagnostic\n\tsyntax. Addresses SourceForge bug #579 \"'diagnostic pop' pragma\n\twithout 'diagnostic push' in Drawable.h.\".\n\n2018-11-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (WriteImage): Eliminate use of just-freed\n\tmemory in clone_info->magick when throwing exception due to no\n\tsupport for format.  Fixes SourceForge issue #576 \"heap\n\tuse-after-freee when convert one format into another format\".\n\n\t* magick/command.c (BenchmarkImageCommand): Benchmark command now\n\tshows 6 digits of elapsed time indication since this precision is\n\toften now available and it is useful to see.\n\n2018-11-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* wand/wand_api.h (\"C\"): magick/api.h should be included prior to\n\twand/wand_symbols.h.  Change made due to report by yzh杨振宏 on\n\tWed, 21 Nov 2018 via the graphicsmagick-bugs mailing list.\n\n2018-11-20  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* magick/nt_base.c Fix a bug when OS does not support performance counter.\n\n2018-11-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c (NTElapsedTime): Use\n\tQueryPerformanceFrequency() and QueryPerformanceCounter() to\n\tmeasure elapsed time for Windows.\n\n2018-11-19  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* tiff/port/snprintf.c Fix for older Microsoft Visual Studio\n\n2018-11-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/index.rst: Update in preparation for 1.3.31 release.\n\n\t* version.sh: Update library versioning in preparation for\n\t1.3.31 release.\n\n\t* NEWS.txt: Update news in preparation for 1.3.31 release.\n\n2018-11-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (BenchmarkUsage): Document the benchmark\n\tcommand better.\n\n2018-11-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/resize.c (HorizontalFilter, VerticalFilter): quantum is a\n\tpointer so it's value can not be usefully flushed.  Use a local\n\tvariable and then update quantum pointer when done.\n\n2018-11-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/*: Changed row_count tallying to use 'omp atomic' and\n\tstatus update to use 'omp flush' for progress and error\n\tindication.  This replaces most use of 'omp critical' for this\n\tpurpose.  Changed some lumpy algorithms which were using 'static'\n\tscheduling to 'guided' scheduling due to observing better results.\n\tAlso added prolific 'restrict' annotations where they were\n\tmissing.\n\n\t* www/security.rst: Documented a PGP private key for file signing\n\tor private correspondence.\n\n2018-11-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/authors.rst: Moved \"Glenn Randers-Pehrson\" and \"Gregory J\n\tWolfe\" to the \"Former Contributor\" category.\n\n2018-11-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Added many GCC function annotations in the libraries and coders.\n\n2018-11-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Use printf rather than echo to portably expand tab\n\trequests in configuration summary.\n\n2018-11-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Use pkg-config data as the initial choice when\n\tconfiguring for FreeType 2.0 and libxml-2.0.  Only fall back to\n\tinvoking an external script (and then traditional methods) if\n\tpkg-config fails.\n\n\t* coders/msl.c (ProcessMSLScript): Release msl_image if OpenBlob\n\tfails.  Similar to ImageMagick CVE-2018-18544.  Problem was\n\treported to us via email from Petr Gajdos on Thu, 1 Nov 2018.\n\n2018-10-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (WriteMIFFImage): Only run\n\tstrlen(attribute->value) once per attribute since the length won't\n\tchange.  May address oss-fuzz 11158\n\t\"graphicsmagick/coder_MIFF_fuzzer: Timeout in\n\tgraphicsmagick_coder_MIFF_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* Fix compilation warnings observed with GCC 8.2.0.\n\n2018-10-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_iterator.c (PixelIterateMonoModifyImplementation):\n\tUse atomic and flush rather than critical construct for a small\n\tspeedup.\n\n\t* magick/monitor.c (MagickMonitorFormatted): Serialize calls to\n\tthe progress monitor so that the caller does not need to perform\n\tthis serialization.\n\t(MagickMonitor): Serialize calls to the progress monitor so that\n\tthe caller does not need to perform this serialization.  This\n\tfunction is now marked as deprecated.\n\t(InitializeMagickMonitor): New private function to initialize\n\tmonitor functionality.\n\t(DestroyMagickMonitor): New private function to destroy monitor\n\tfunctionality.\n\n2018-10-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (ReadGIFImage): Improve the efficiency of storing a\n\tGIF comment in order to avoid a DOS opportunity.  Fixes oss-fuzz\n\t11096 \"graphicsmagick/coder_GIF_fuzzer: Timeout in\n\tgraphicsmagick_coder_GIF_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-10-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Makefile.PL.in: Use MAGICK_API_LIBS to obtain the\n\tlist of libraries to use when linking.\n\n\t* configure.ac: OpenMP library is normally supplied due to a\n\tCFLAGS option so only supply it in cases where the CFLAGS option\n\tmay be lost or it might not be used.  Otherwise the compiler may\n\tapply the library twice when linking.\n\n2018-10-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Remove Ghostscript library support (--with-gslib)\n\tfrom configure script.  The 'HasGS' pre-processor defines which\n\twere enabled by this remain in the source code so it is still\n\tpossible to use this library if absolutely necessary\n\t(e.g. CPPFLAGS=-DHasGS LIBS=-lgs).\n\n\t* tests/rwfile.tap: Test TIFF format with all supported\n\tcompression options.\n\n\t* tests/{rwblob.c, rwfile.c} (main): Use StringToCompressionType()\n\tto parse compression option. Also consider requested compression\n\talgorithm when deciding if format is lossy.\n\n\t* coders/tiff.c (WriteTIFFImage): WebP compression needs\n\tPHOTOMETRIC_RGB. Fix wrong rows-per-strip calculation when using\n\tLZMA compression.\n\n\t* tests/rwblob.tap: Added a rwblob test to verify that lower-case\n\tmagick works.\n\n\t* magick/static.c (OpenModule): Upper case magick string before\n\tsearching static modules list.  Fixes Debian bug 911386\n\t\"libgraphicsmagick-q16-3: graphicsmagick 1.3.30 has made formats\n\tcase-sensitive at the API level\".\n\n\t* filters/analyze.c (AnalyzeImage): X and y should be unsigned\n\tlong to match image rows/columns type.  Calculate total pixels by\n\tsimple multiplication rather than counting.\n\n2018-10-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Support WebP compression in\n\tTIFF. This requires a libtiff release after 4.0.9.\n\n\t* magick/image.h (\"C\"): WebPCompression added to CompressionType\n\tenumeration.\n\n2018-10-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Configure for the Zstd library.  Use\n\t--without-zstd to disable searching for this library.  Libtiff may\n\trequire this library to successfully link so static linkage could\n\tfail if searching for libzstd is disabled.\n\n\t* magick/image.h (\"C\"): ZSTDCompression added to CompressionType\n\tenumeration.\n\n\t* coders/tiff.c (WriteTIFFImage): Support Zstd compression in\n\tTIFF.  This requires a libtiff release after 4.0.9.\n\n2018-10-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (GMCommandSingle): Add 'compare' to the list of\n\tcommand names that gm will support as a command if copied to or\n\tlinked from that name.  There was already a 'compare' link\n\tinstalled when the '--enable-magick-compat' configure option is\n\tused, but it could not possibly function without being blessed by\n\tthis list.  Related to Debian bug #910652\n\t\"graphicsmagick-imagemagick-compat: Doesn't ship a compare tool\".\n\n2018-09-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Magick++/lib/Magick++/Drawable.h: Block unused-private-field\n\twarnings from Clang due to _dummy members which were intentionally\n\tincluded in some parent class definitions.\n\n\t* magick/widget.c (XEditText): Fix compilation warnings about\n\tcases which fall-through.\n\n\t* magick/display.c (MagickXAnnotateEditImage): Fix compilation\n\twarnings about cases which fall-through.\n\n\t* coders/pict.c (WritePICTImage): Add more checks to memory\n\tallocation calculations.\n\n\t* magick/pixel_cache.c (DestroyCacheInfo): Eliminate intentional\n\tfall-through logic in switch statement which results in compiler\n\twarnings.  Eliminate switch statements entirely and split\n\tunrelated logic.\n\n\t* coders/txt.c (ReadTXTImage): Fix comparison between pointer and\n\t'\\0' rather than NULL as was obviously intended.\n\n\t* coders/msl.c (MSLStartElement): Add missing 'break' statements\n\tafter ThrowException() calls.  Otherwise execution falls through\n\tinto unrelated switch cases and throws a redundant exception.\n\n2018-09-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c (parse8BIM): Eliminate repeated use of strlen()\n\twhich scans the entire remaining string on each cycle.  Fixes\n\toss-fuzz 10667 \"graphicsmagick/coder_IPTCTEXT_fuzzer: Timeout in\n\tgraphicsmagick_coder_IPTCTEXT_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-09-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (MagickGetToken): Fix possible read up to four\n\tbytes beyond end of stack allocated token buffer.  Fixes oss-fuzz\n\t10653 \"graphicsmagick/coder_MVG_fuzzer: Stack-buffer-overflow in\n\tMagickGetToken\". (Credit to OSS-Fuzz)\n\n2018-09-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/coder_fuzzer.cc (LLVMFuzzerTestOneInput): Limit the\n\tmaximum number of JPEG progressive scans to 50.\n\n\t* coders/jpeg.c (ReadJPEGImage): Apply a default limit of 100\n\tprogressive scans before the reader quits with an error.  This\n\tlimit may be adjusted using the -define mechanism like -define\n\tJPEG:max-scan-number=500.  Also respond more quickly to files\n\twhich exceed the maximum image dimensions.  Fixes oss-fuzz 10258\n\t\"graphicsmagick/coder_JPEG_fuzzer: Timeout in\n\tgraphicsmagick_coder_JPEG_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-09-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): mng_LOOP chunk must be at least 5\n\tbytes long.  Fixes oss-fuzz 10455\n\t\"graphicsmagick/coder_MNG_fuzzer: Use-of-uninitialized-value in\n\tReadMNGImage\". (Credit to OSS-Fuzz)\n\n2018-09-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (TraceEllipse): Detect arithmetic overflow when\n\tcomputing the number of points to allocate for an ellipse.  Fixes\n\toss-fuzz 10306 \"graphicsmagick/coder_MVG_fuzzer:\n\tHeap-buffer-overflow in TracePoint\". (Credit to OSS-Fuzz)\n\n2018-09-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Eliminate undefined\n\tshift.  Also right-sized involved data types.  Fixes oss-fuzz\n\t10309 \"graphicsmagick/coder_JPG_fuzzer: Undefined-shift in\n\tRead32s\". (Credit to OSS-Fuzz)\n\n2018-09-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawClipPath): Fix Coverity 319663 \"Null\n\tpointer dereferences\".  Totally insignificant.\n\n\t* coders/wpg.c (ReadWPGImage): Mask/fix Coverity 319664 \"Error\n\thandling issues\".\n\n\t* magick/attribute.c (FindEXIFAttribute): Change size types from\n\tsigned to unsigned and check for unsigned overflow.\n\t(GenerateEXIFAttribute): Change size types from signed to unsigned\n\tand check for unsigned overflow. Fixes oss-fuzz 10283\n\t\"graphicsmagick/coder_JPG_fuzzer: Integer-overflow in\n\tGenerateEXIFAttribute\". (Credit to OSS-Fuzz)\n\n\t* coders/sfw.c (ReadSFWImage): Enforce that file is read using the\n\tJPEG reader. (Credit to OSS-Fuzz)\n\n\t* coders/miff.c (ReadMIFFImage): Fix leak of 'values' buffer due\n\tto change made yesterday.\n\n\t* coders/mpc.c (ReadMPCImage): Fix leak of 'values' buffer due to\n\tchange made yesterday.  Fixes oss-fuzz 10277\n\t\"graphicsmagick/coder_MPC_fuzzer: Direct-leak in\n\tReadMPCImage\". (Credit to OSS-Fuzz)\n\n2018-09-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Support legacy keyword\n\t'color-profile' for ICC color profile as was used by ImageMagick\n\t4.2.9.\n\n\t* coders/mpc.c (ReadMPCImage): Require that first keyword/value be\n\tid=MagickCache\n\n\t* coders/miff.c (ReadMIFFImage): Require that first keyword/value\n\tbe id=ImageMagick.\n\n2018-09-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (DCM_ReadElement): Add more size checks.\n\n\t* coders/jnx.c (ExtractTileJPG): Enforce that JPEG tiles are read\n\tby the JPEG coder.  Fixes oss-fuzz 10147\n\t\"graphicsmagick/coder_JNX_fuzzer: Use-of-uninitialized-value in\n\tfuncDCM_PhotometricInterpretation\". (Credit to OSS-Fuzz)\n\n2018-09-10  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Zero fill raster error recovery.\n\n2018-08-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (ConvertPrimitiveToPath): Second attempt to\n\tprevent heap write overflow of PathInfo array.  Fixes oss-fuzz\n\t10096 \"Heap-buffer-overflow in ConvertPrimitiveToPath\". (Credit to\n\tOSS-Fuzz)\n\n2018-08-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (\"QuantumTransferMode\"): CIE Log images with an\n\talpha channel are not supported.  Fixes oss-fuzz 10013\n\t\"graphicsmagick/coder_TIFF_fuzzer: Use-of-uninitialized-value in\n\tDisassociateAlphaRegion\". (Credit to OSS-Fuzz)\n\n\t* magick/render.c (DrawImage): SetImageAttribute() appends new\n\ttext to any existing value, leading to every increasing memory\n\tconsumption if the existing value is not deleted first by the\n\tunwary.  Fixes oss-fuzz 9983 \"graphicsmagick/coder_MVG_fuzzer:\n\tTimeout in graphicsmagick_coder_MVG_fuzzer\" and oss-fuzz 10016\n\t\"graphicsmagick/coder_MVG_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_MVG_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* magick/utility.c (TranslateTextEx): Fix off-by-one in loop\n\tbounds check which allowed a one-byte stack write overflow.  Fixes\n\toss-fuzz 10055 \"graphicsmagick/coder_MVG_fuzzer:\n\tStack-buffer-overflow in TranslateTextEx\". (Credit to OSS-Fuzz)\n\n\t* magick/render.c (DrawImage): Be more precise about error\n\tdetection and reporting, and return from an error more quickly.\n\tAlso added MAX_DRAWIMAGE_RECURSION pre-processor definition to\n\tallow adjusting the drawing recursion limit.  The drawing\n\trecursion limit is still 100, which seems exceptionally generous.\n\n\t* magick/constitute.c (WriteImage): Produce a more useful error\n\tmessage if an encoding delegate is not available.\n\n\t* magick/nt_base.h (isnan): Try adding a MSVC replacement for\n\tmissing isnan() function.  Not yet tested.\n\n2018-08-25  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c This should fix intentional 64 bit file offset\n\toverflow as depictedin OSS-fuzz-9936. Thanks to OSS-Fuzz.\n\n2018-08-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (ConvertPrimitiveToPath): Need to enlarge\n\tPathInfo array allocation to avoid possible heap write overflow.\n\tFixes oss-fuzz 9651 \"graphicsmagick/coder_MVG_fuzzer:\n\tHeap-buffer-overflow in ConvertPrimitiveToPath\". (Credit to\n\tOSS-Fuzz)\n\n2018-08-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mpc.c (ReadMPCImage): Insist that the format be\n\tidentified prior to any comment, and that there is only one\n\tcomment.\n\n\t* coders/miff.c (ReadMIFFImage): Insist that the format be\n\tidentified prior to any comment, and that there is only one\n\tcomment.  Fixes oss-fuzz 9979 \"graphicsmagick/coder_MIFF_fuzzer:\n\tTimeout in graphicsmagick_coder_MIFF_fuzzer\".  This is not a\n\tserious issue, but the code runs slowly under UBSAN.  (Credit to\n\tOSS-Fuzz)\n\n2018-08-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (MagickAtoFChk): Add additional validation\n\tchecks for floating point values.  NAN and +/- INFINITY values\n\talso map to 0.0. Fixes oss-fuzz 9630\n\t\"graphicsmagick/coder_MVG_fuzzer: Integer-overflow in\n\tIsNexusInCore\" and oss-fuzz 9612 \"graphicsmagick/coder_MVG_fuzzer:\n\tInteger-overflow in SetCacheNexus\". (Credit to OSS-Fuzz)\n\n\t* magick/render.c (DrawImage): Add missing error-reporting logic\n\tto return immediately upon memory reallocation failure.  Apply\n\tmemory resource limits to PrimitiveInfo array allocation.  Fixes\n\toss-fuzz 9576 \"graphicsmagick/coder_MVG_fuzzer: Null-dereference\n\tREAD in DrawImage\", oss-fuzz 9593\n\t\"graphicsmagick/coder_MVG_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_MVG_fuzzer\", oss-fuzz 9648\n\t\"graphicsmagick/coder_MVG_fuzzer: Unknown signal in\n\tDrawImage\". (Credit to OSS-Fuzz)\n\n2018-08-16  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coder/mat.c Explicitly reject non-seekable streams.\n\n2018-08-15  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coder/mat.c Correctly check GetBlobSize(image) even for zipstreams.\n\n2018-08-14  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c More aggresive data corruption checking.\n\n2018-08-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xbm.c (XBMInteger): Limit the number of hex digits parsed\n\tto avoid signed integer overflow.  Fixes oss-fuzz 9746\n\t\"graphicsmagick/coder_XBM_fuzzer: Undefined-shift in\n\tXBMInteger\". (Credit to OSS-Fuzz)\n\n2018-08-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Typecast difference to quantum.\n\n2018-08-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mat.c (InsertComplexFloatRow): Avoid signed\n\toverflow. Fixes oss-fuzz 9667 \"graphicsmagick/coder_MAT_fuzzer:\n\tInteger-overflow in InsertComplexFloatRow\". (Credit to OSS-Fuzz)\n\n\t* coders/xbm.c (ReadXBMImage): Add validations for row and column\n\tdimensions.  Fixes oss-fuzz 9736 \"graphicsmagick/coder_XBM_fuzzer:\n\tOut-of-memory in graphicsmagick_coder_XBM_fuzzer\". (Credit to\n\tOSS-Fuzz)\n\n2018-08-04  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Add mechanism to approve embedded subformats in\n\tWPG.  This should mute oss-fuzz 9559.  (Credit to OSS-Fuzz)\n\n2018-07-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mvg.c (ReadMVGImage): Fix memory leak added on\n\t2018-07-21.  Fixes oss-fuzz 9548 \"graphicsmagick/coder_MVG_fuzzer:\n\tDirect-leak in CloneDrawInfo\". (Credit to OSS-Fuzz)\n\n2018-07-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/cineon.c (ReadCINEONImage): Fix SourceForge issue 571\n\t\"Unexpected hang on a crafted Cineon image\" by detecting and\n\tquitting on EOF appropriately, and verifying that file size is\n\tsufficient for claimed pixel dimensions when possible.\n\n\t* fuzzing/oss-fuzz-build.sh, fuzzing/dictionaries/MVG.dict: Added\n\tMVG fuzzing dictionary by Alex Gaynor.\n\n2018-07-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (SetNexus): For requests one pixel tall,\n\tSetNexus() was wrongly using pixels in-core rather than using a\n\tstaging area for the case where the nexus rows extend beyond the\n\timage raster boundary, leading to heap overflow.  This can happen\n\twhen virtual pixels outside the image bounds are accessed.  Fixes\n\toss-fuzz 9512 \"graphicsmagick/graphicsmagick_coder_MVG_fuzzer:\n\tHeap-buffer-overflow in AcquireCacheNexus\". (Credit to OSS-Fuzz)\n\n\t* magick/render.c (ExtractTokensBetweenPushPop):\n\tExtractTokensBetweenPushPop() needs to always return a valid\n\tpointer into the primitive string.  Fixes oss-fuzz 9511\n\t\"graphicsmagick/graphicsmagick_coder_MVG_fuzzer: Null-dereference\n\tREAD in DrawImage\". (Credit to OSS-Fuzz)\n\t(DrawPolygonPrimitive): Fix leak of polygon set when object is\n\tcompletely outside image.  Fixes oss-fuzz 9513\n\t\"graphicsmagick/graphicsmagick_coder_MVG_fuzzer: Direct-leak in\n\tAllocateThreadViewDataSet\". (Credit to OSS-Fuzz)\n\n2018-07-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (FileToBlob): Use confirm access APIs to verify\n\tthat read access to this path is allowed by policy.  Check that\n\tfile is a regular file before proceeding to open and read from it.\n\n\t* coders/mvg.c (ReadMVGImage): Don't allow MVG files to side-load\n\ta file as the drawing primitive using '@' syntax.  Fixes oss-fuzz\n\t9494 \"graphicsmagick/coder_MVG_fuzzer: Sanitizer CHECK failure in\n\t\"((0)) != (0)\" (0x0, 0x0)\". (Credit to OSS-Fuzz)\n\n2018-07-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mvg.c (ReadMVGImage): Don't assume that in-memory MVG\n\tblob is a null-terminated C string. Fixes oss-fuzz 9469\n\t\"graphicsmagick/coder_MVG_fuzzer: Heap-buffer-overflow in\n\tAllocateString\". (Credit to OSS-Fuzz)\n\n2018-07-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Detect EOF when reading using\n\tReadBlobZC() and avoid subsequent heap read overflow.  Fixes\n\toss-fuzz 9357 \"graphicsmagick/coder_MIFF_fuzzer:\n\tHeap-buffer-overflow in ImportRGBQuantumType\". (Credit to\n\tOSS-Fuzz)\n\n2018-07-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/oss-fuzz-build.sh (CFLAGS): Try disabling SIMD\n\tinstructions in libjpeg-turbo build.\n\n2018-07-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): Free png_pixels as soon as\n\tpossible.  This might help with oss-fuzz 9334\n\t\"graphicsmagick/coder_PNG8_fuzzer: Direct-leak in\n\tWriteOnePNGImage\", which we have yet to reproduce.  It is not\n\tclear if png_pixels is being clobbered by longjmp or if something\n\telse is going on.\n\n2018-06-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (ReadJPEGImage): Provide a memory resource limit\n\t(of 1/5th the memory resource limit for Graphicsmagick) to libjpeg\n\tto limit how much memory it might consume for itself while reading\n\ta file.  Fixes oss-fuzz 9096 \"graphicsmagick/coder_JPEG_fuzzer:\n\tTimeout in graphicsmagick_coder_JPEG_fuzzer\".  (Credit to\n\tOSS-Fuzz)\n\t(ReadJPEGImage): Make sure that JPEG pixels array is initialized\n\tin case libjpeg fails to completely initialize it.  May fix\n\toss-fuzz 9115 \"graphicsmagick/coder_JPEG_fuzzer:\n\tUse-of-uninitialized-value in ReadJPEGImage\".  We are not sure\n\tsince the problem was not reproduced.  (Credit to OSS-Fuzz)\n\n2018-06-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Update library versioning for 1.3.30 release.\n\n\t* NEWS.txt: Update news for 1.3.30 release.\n\n2018-06-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Report exception on EOF file\n\treading DPX pixel data. Fixes oss-fuzz 8104\n\t\"graphicsmagick/coder_DPX_fuzzer: Use-of-uninitialized-value in\n\tWriteDPXImage\", oss-fuzz 8297 \"graphicsmagick/enhance_fuzzer:\n\tUse-of-uninitialized-value in EnhanceImage\", and oss-fuzz 8133\n\t\"graphicsmagick/coder_DPX_fuzzer: Use-of-uninitialized-value in\n\tRGBTransformPackets\". (Credit to OSS-Fuzz)\n\n2018-06-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/cmyk.c (ReadCMYKImage): Free scanline buffer in error\n\tpath. Fixes SourceForge issue #567 \"small memory leak in rgb.c,\n\tgray.c and cmyk.c\" reported by Petr Gajdos.\n\n\t* coders/gray.c (ReadGRAYImage): Free scanline buffer in error\n\tpath. Fixes SourceForge issue #567 \"small memory leak in rgb.c,\n\tgray.c and cmyk.c\" reported by Petr Gajdos.\n\n\t* coders/rgb.c (ReadRGBImage): Free scanline buffer in error\n\tpath. Fixes SourceForge issue #567 \"small memory leak in rgb.c,\n\tgray.c and cmyk.c\" reported by Petr Gajdos.\n\n\t* coders/jpeg.c (ReadJPEGImage): Avoid memory leak of profile\n\tbuffer when longjmp-based exception is thrown while reading a\n\tprofile. Fixes oss-fuzz 8957 \"graphicsmagick/enhance_fuzzer:\n\tDirect-leak in ReadGenericProfile\". (Credit to OSS-Fuzz)\n\n2018-06-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c (load_level): Make sure to free 'tile_image' before\n\treturning exception.  Fixes oss-fuzz 8935\n\t\"graphicsmagick/coder_XCF_fuzzer: Indirect-leak in\n\tCloneImage\". (Credit to OSS-Fuzz)\n\n\t* coders/jpeg.c (ReadJPEGImage): Allow three warnings of any given\n\ttype before promoting the next warning of the same type to a hard\n\terror.  The warning limit may be adjusted by the user using\n\t-define jpeg:max-warnings=<value>.  Fixes oss-fuzz 8704\n\t\"graphicsmagick/coder_JPG_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_JPG_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/png.c (ReadPNGImage): Detect EOF when reading\n\tmagic_number.  Fixes oss-fuzz 8944\n\t\"graphicsmagick/coder_PNG_fuzzer: Use-of-uninitialized-value in\n\tReadPNGImage\".  (Credit to OSS-Fuzz)\n\t(ReadPNGImage, ReadJNGImage): Makes sure that return value of\n\tReadBlob() is always checked to detect EOF.\n\n2018-06-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Re-structure exception reporting\n\tso that QuantumTransferMode() exceptions thrown for\n\tPLANARCONFIG_SEPARATE images are handled immediately.  Fixes\n\toss-fuzz 8896 \"graphicsmagick/coder_BIGTIFF_fuzzer:\n\tUse-of-uninitialized-value in DisassociateAlphaRegion\". (Credit to\n\tOSS-Fuzz)\n\t(ReadTIFFImage): tsize_t is a signed type so be prepared for\n\tunexpected negative values produced by libtiff size functions.\n\tFixes oss-fuzz 8934 \"graphicsmagick/coder_TIFF_fuzzer: Sanitizer\n\tCHECK failure in \"((0)) != (0)\" (0x0, 0x0)\". (Credit to OSS-Fuzz)\n\n2018-06-16  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Fix oss-fuzz 7735 \"graphicsmagick/coder_WPG_fuzzer:\n\tUse-of-uninitialized-value in ReadWPGImage\".  (Credit to OSS-Fuzz)\n\n2018-06-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): ENDL chunk must be at least one\n\tbyte in size. Fixes oss-fuzz 8832\n\t\"graphicsmagick/coder_MNG_fuzzer: Null-dereference READ in\n\tReadMNGImage\". (Credit to OSS-Fuzz)\n\t(ReadMNGImage): Length of DISC chunk must be evenly divisible by\n\t2.  Fixes oss-fuzz 8834 \"graphicsmagick/coder_MNG_fuzzer:\n\tHeap-buffer-overflow in ReadMNGImage\". (Credit to OSS-Fuzz)\n\n2018-06-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mpc.c (ReadMPCImage): Detect end of file while reading\n\timage directory.  Similar to MIFF fixes for ImageMagick\n\tCVE-2017-18272.\n\t(RegisterMPCImage): Require seekable stream since MPC is strictly\n\ta file-based format and so GetBlobSize() is assured to work.\n\tSimilar to MIFF behavior.  Claimed to be part of the resolution\n\tfor ImageMagick CVE CVE-2017-11449. Suggested by Petr Gajdos via\n\temail on January 3, 2018.\n\n2018-06-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/miff.c (ReadMIFFImage): Detect end of file while reading\n\timage directory. Fixes SourceForge issue 565 \"ImageMagick\n\tCVE-2017-18272 applies to GraphicsMagick\".  Thanks to Petr Gajdos\n\tfor reporting this issue to us.\n\n\t* magick/import.c (ImportViewPixelArea): Use appropriate\n\tbits_per_sample validations for FloatQuantumSampleType. Fixes\n\toss-fuzz 8780 \"graphicsmagick/coder_PTIF_fuzzer:\n\tUse-of-uninitialized-value in HorizontalFilter\". (Credit to\n\tOSS-Fuzz)\n\n2018-06-09  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c More than 4GiB are not supported in MAT!\n\n2018-06-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mat.c (ReadMATImage): Add casts to avoid arithmetic\n\toverflow when computing size and offsets.  Fixes oss-fuzz 8801\n\t\"graphicsmagick/coder_MAT_fuzzer: Timeout in\n\tgraphicsmagick_coder_MAT_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* magick/blob.c (ReadBlobLSBDoubles, ReadBlobMSBDoubles): Only\n\tbyte-swap doubles or test doubles for NAN if we have read enough\n\tbytes for at least one double value.\n\t(ReadBlob): Add an assertion to enforce that ReadBlob() will never\n\treport reading more bytes than requested due to some\n\timplementation issue.\n\n2018-06-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (ReadBlob, WriteBlob): gzread(), BZ2_bzread(),\n\tgzwrite(), BZ2_bzwrite() return type 'int' rather than 'size_t'\n\tlike their stdio equivalents.  Use correct signed type to avoid\n\treturning a negative value into an unsigned type, forming a huge\n\tpositive value.  Fixes oss-fuzz 8600\n\t\"graphicsmagick/coder_MAT_fuzzer: Heap-buffer-overflow in\n\tReadBlobLSBDoubles\". (Credit to OSS-Fuzz)\n\n2018-06-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (png_read_raw_profile): Try to shore up parsing of\n\traw profile reading to avoid heap read overruns.  Fixes oss-fuzz\n\t8763 \"graphicsmagick/coder_PNG32_fuzzer: Heap-buffer-overflow in\n\tpng_read_raw_profile\". (Credit to OSS-Fuzz)\n\n2018-06-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Reduce stack usage for 64 bit architecture.\n\n2018-06-06  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Check return values of SeekBlob for more safety.\n\n2018-06-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Use DestroyImageList() rather\n\tthan DestroyImage() on returned Image from supposed read of JPEG\n\tdata, in case multiple frames were unexpectedly returned.  Also\n\tadd \"JPEG:\" prefix to filename when reading from temporary file to\n\tforce that it can only be read as a JPEG file, disabling format\n\tauto-detection based on file header.  Fixes oss-fuzz 8755\n\t\"graphicsmagick/coder_JNG_fuzzer: Indirect-leak in\n\tAllocateImage\". (Credit to OSS-Fuzz)\n\n2018-06-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (EOFBlob): Implement EOF detection for ZipStream.\n\tDoes some archaic zlib not provide gzeof()?  Fixes oss-fuzz 8550\n\t\"graphicsmagick/coder_MAT_fuzzer: Timeout in\n\tgraphicsmagick_coder_MAT_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-06-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Skip adding empty raw profile.\n\tFixes oss-fuzz \"graphicsmagick/coder_PNG_fuzzer:\n\tHeap-buffer-overflow in png_read_raw_profile\". (Credit to\n\tOSS-Fuzz)\n\n2018-06-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update NEWS with latest changes.\n\n\t* coders/dcm.c (DCM_ReadRGBImage): Force the image to DirectClass\n\tto avoid later use of uninitialized indexes.  Fixes oss-fuzz 8602\n\t\"graphicsmagick/coder_DCM_fuzzer: Use-of-uninitialized-value in\n\tDCM_PostRescaleImage\". (Credit to OSS-Fuzz)\n\t(DCM_ReadPlanarRGBImage): Force the image to DirectClass to avoid\n\tlater use of uninitialized indexes.\n\n\t* coders/png.c (ReadMNGImage): Free chunk memory in error\n\treporting path to avoid leak.  Fixes oss-fuzz 8721\n\t\"graphicsmagick/coder_MNG_fuzzer: Direct-leak in\n\tReadMNGImage\". (Credit to OSS-Fuzz)\n\n2018-06-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/constitute.c (ReadImage): Assure that an error exception\n\tis thrown if coder returns null without properly reporting an\n\texception.\n\n\t* magick/blob.c (BlobToImage): Assure that an error exception is\n\tthrown if coder returns null without properly reporting an\n\texception.\n\n\t* coders/png.c (ReadMNGImage): Disable mystery \"linked list is\n\tcorrupted\" code.  Assure that exceptions are reported to the\n\tcorrect place so they are not lost.  Fixes oss-fuzz 8710\n\t\"graphicsmagick/coder_MNG_fuzzer: Indirect-leak in\n\tAllocateImage\". (Credit to OSS-Fuzz)\n\n\t* coders/tiff.c (ReadTIFFImage): Initialize allocated scanline,\n\tstrip, or tile to zero in order to avoid complaint about use of\n\tuninitialized data if libtiff fails to write all the bytes.  Fixes\n\toss-fuzz 8551 \"graphicsmagick/coder_TIFF_fuzzer:\n\tUse-of-uninitialized-value in ImportGrayQuantumType\". (Credit to\n\tOSS-Fuzz)\n\n\t* magick/annotate.c (RenderFreetype): Throw an exception if\n\tDrawInfo font is null.  Should fix oss-fuzz 8557\n\t\"graphicsmagick/coder_PCD_fuzzer: Unknown signal in\n\tRenderFreetype\" and may fix oss-fuzz 8544\n\t\"graphicsmagick/coder_PCD_fuzzer: Null-dereference READ in\n\tRenderFreetype\". (Credit to OSS-Fuzz)\n\n\t* coders/jpeg.c (ReadGenericProfile): Add/improve tracing for\n\tprofile size and when JPEG header is being read.\n\n2018-06-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Report a useful exception for\n\tthe case when the JNG file fails to provide the necessary image\n\tchunks to allocate the color image.  Inspired by oss-fuzz 8666\n\t\"graphicsmagick/coder_JNG_fuzzer: ASSERT: data != (const char *)\n\tNULL\" although the reported issue was not reproduced.\n\n2018-05-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Fix off-by-one in length validation\n\tfor TERM chunk which allowed one byte heap read overflow.  Fixes\n\toss-fuzz 8615 \"graphicsmagick/coder_MNG_fuzzer:\n\tHeap-buffer-overflow in mng_get_long\". (Credit to OSS-Fuzz)\n\t(ReadMNGImage): Fix leak of MngInfo in error reporting path.\n\tFixes oss-fuzz 8604 \"graphicsmagick/coder_MNG_fuzzer: Direct-leak\n\tin ReadMNGImage\". (Credit to OSS-Fuzz)\n\t(ReadMNGImage): Verify that claimed chunk size does not exceed\n\tinput size.  Fixes oss-fuzz 8564 \"graphicsmagick/coder_MNG_fuzzer:\n\tOut-of-memory in graphicsmagick_coder_MNG_fuzzer\". (Credit to\n\tOSS-Fuzz)\n\n\t* coders/tiff.c (ReadTIFFImage): Reject files with excessive\n\tsamples-per-pixel or extra-samples. Avoids potential issues\n\tobserved in oss-fuzz 8634 \"graphicsmagick/coder_BIGTIFF_fuzzer:\n\tUndefined-shift in ImportAlphaQuantumType\". (Credit to OSS-Fuzz)\n\n2018-05-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Assure that object id index is\n\talways less than MNG_MAX_OBJECTS to avoid overflow.  Fixes\n\toss-fuzz 8596 \"graphicsmagick/coder_MNG_fuzzer:\n\tIndex-out-of-bounds in ReadMNGImage\" and likely other issues yet\n\tto be reported. (Credit to OSS-Fuzz)\n\n2018-05-30  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (CompareEdges): Per ticket #562,\n\tfunction CompareEdges() did not conform to the qsort()\n\trequirement that if CompareEdges(edge0,edge1) returns\n\t-1 (i.e., edge0 \"less than\" edge1), then\n\tCompareEdges(edge1,edge0) should return 1 (edge1\n\t\"greater than\" edge0).  This has been fixed.\n\n2018-05-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Deal with JDAA JNG chunk with\n\tlength zero.  Fixes oss-fuzz 8562\n\t\"graphicsmagick/coder_JNG_fuzzer: ASSERT: data != (const char *)\n\tNULL\". (Credit to OSS-Fuzz)\n\n\t* coders/tiff.c (ReadTIFFImage): Check that the bits-per-sample is\n\tsupported by the implementation before attempting to decode the\n\timage. Fixes oss-fuzz 8554 \"graphicsmagick/coder_BIGTIFF_fuzzer:\n\tUndefined-shift in MagickBitStreamMSBWrite\". (Credit to OSS-Fuzz)\n\n\t* coders/png.c (ReadMNGImage): Eliminate use of uninitialized\n\theader magic data by checking for EOF first.  Fixes oss-fuzz 8597\n\t\"graphicsmagick/coder_MNG_fuzzer: Use-of-uninitialized-value in\n\tReadMNGImage\". (Credit to OSS-Fuzz)\n\n2018-05-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/oss-fuzz-build.sh: More fixes based on what is observed\n\tin oss-fuzz build log.\n\n2018-05-24  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/jnx.c The attribute should belong to only one scene and\n\tnot to whole image list.\n\n2018-05-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/oss-fuzz-build.sh: Changes to add CPPFLAGS to configure\n\texecutions to hopefully get oss-fuzz build closer to success.\n\n2018-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/t/jpeg/read.t: Add a JNX reader test case.\n\n\t* coders/jnx.c (ReadJNXImage): JNX image depth should be 8.\n\n\t* fuzzing/oss-fuzz-build.sh: Apply patch from Alex Gaynor to\n\tswitch libpng to autotools build system, as well as configure\n\tGraphicsMagick with '--with-quantum-depth=16'.\n\n2018-05-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Validate tile memory requests for\n\tthe TIFFReadRGBATile() case in the same way as the TIFFReadTile()\n\tcase.  Fixes oss-fuzz 8434 \"graphicsmagick/coder_BIGTIFF_fuzzer:\n\tOut-of-memory in graphicsmagick_coder_BIGTIFF_fuzzer\". (Credit to\n\tOSS-Fuzz)\n\n2018-05-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tile.c (ReadTILEImage): Remove any existing size request\n\twhen while image to tile.  This avoids size being used for both\n\tthe input image size and the tile image size.  Fixes SourceForge\n\tissue #563 \"tile:<image> appears to blow image up by 100% before\n\tapplying tiling\".\n\n2018-05-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/oss-fuzz-build.sh: Patch from Paul Kehrer to disable\n\tlibpng test programs and binaries while building libpng in support\n\tof oss-fuzz testing.\n\n\t* coders/dcm.c (DCM_ReadGrayscaleImage): If a palette was\n\tprovided, the image may be in PseudoClass but we need DirectClass\n\tfor gray image when GRAYSCALE_USES_PALETTE is not defined.  Fixes\n\toss-fuzz 7550 \"graphicsmagick/coder_DCM_fuzzer:\n\tUse-of-uninitialized-value in SyncImageCallBack\". (Credit to\n\tOSS-Fuzz)\n\t(ReadDCMImage): Restore use of DCM_PostRescaleImage() in order to\n\tobtain suitably scaled DICOM again.  Hopefully it is more robust\n\tnow.\n\t(DCM_ReadPaletteImage): Assure that DirectClass pixels are\n\tinitialized.\n\n2018-05-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Remove strange addition of\n\timage->columns to pixel buffer offsets which now causes a heap\n\toverflow since the buffer has been right-sized.  Perhaps the extra\n\toffset plus the over-sized allocation was some attempt to avoid\n\tbuffer over/underflows due to bugs in libtiff. Fixes oss-fuzz 8384\n\t\"graphicsmagick/coder_BIGTIFF_fuzzer: Heap-buffer-overflow in\n\tput1bitbwtile\" which is described to be a regression. (Credit to\n\tOSS-Fuzz)\n\n\t* magick/render.c (DrawImage): Fix wrong range checks which caused\n\tspurious \"Parsing of SVG images fail with \"Non-conforming drawing\n\tprimitive definition (push)\" failure.  Fixes SourceForge issue 561\n\t\"Parsing of SVG images fail with \"Non-conforming drawing primitive\n\tdefinition (push)\"\" which is due to problems caused by the fix for\n\tSourceForge issue 517.\n\n\t* coders/tiff.c (WritePTIFImage): Use '-define\n\tptif:minimum-geometry=<geometry>' to specify the smallest\n\tsubresolution frame which is produced by the PTIF (Pyramid TIFF)\n\twriter.\n\n2018-05-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WritePTIFImage): Allow 1x1 input image to be\n\tsupported.\n\n\t* coders/png.c (ReadOneJNGImage): Unconditionally free JDAT chunk\n\tmemory.  Fixes oss-fuzz 8366 \"graphicsmagick/coder_JNG_fuzzer:\n\tDirect-leak in ReadOneJNGImage\". (Credit to OSS-Fuzz)\n\n\t* coders/tiff.c (WritePTIFImage): Fix leak of pyramid Image list\n\tif ResizeImage() fails.  Fixes oss-fuzz 8364\n\t\"graphicsmagick/coder_PTIF_fuzzer: Indirect-leak in\n\tCloneImage\". (Credit to OSS-Fuzz)\n\n2018-05-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Add and use\n\tThrowTIFFWriterException() macro to consistently clean-up when\n\tthrowing writer exception.  May fix oss-fuzz 8321\n\t\"graphicsmagick/coder_EPT_fuzzer: Direct-leak in\n\tTIFFClientOpen\". (Credit to OSS-Fuzz)\n\t(ReadTIFFImage): Add and use ThrowTIFFReaderException() macro to\n\tconsistently clean-up when throwing reader exception.\n\n2018-05-16  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/alpha_composite.h (AlphaCompositePixel): The\n\tmacro definition for MagickAlphaCompositeQuantum in\n\talpha_composite.h computes an expression of the form:\n\n\ta * b + c * d * e\n\n\tCode in function AlphaCompositePixel() (also in\n\talpha_composite.h) multiplies the result of this macro\n\tby variable \"delta\" as follows:\n\n\tdelta * a * b + c * d * e\n\n\tHowever, the intended result is actually:\n\n\tdelta * ( a * b + c * d * e )\n\n\tThe macro definition has been modified to enclose the\n\tentire expression in parentheses.\n\n\tThe effects of this bug were particularly evident at the\n\tboundary between a stroked polygon and a transparent\n\tblack region. More generally, an incorrect composited\n\tpixel value was being computed by AlphaCompositePixel()\n\twhenever the output alpha value was not 100% opaque.\n\n2018-05-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwblob.tap: Add a test for PTIF format.\n\n\t* coders/tiff.c (WritePTIFImage): Fix Image blob referencing in\n\torder to avoid double-free when writing PTIF to memory BLOB. Fixes\n\toss-fuzz 8280 \"graphicsmagick/coder_PTIF_fuzzer: Heap-double-free\n\tin Magick::BlobRef::~BlobRef\". (Credit to OSS-Fuzz)\n\n2018-05-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (WriteTIFFImage): Use libtiff's\n\tTIFFDefaultStripSize() function rather than an old porting macro\n\trequired by some defunct libtiff version.  Expected to fix\n\toss-fuzz 8248 \"graphicsmagick/coder_EPT_fuzzer:\n\tFloating-point-exception in WriteTIFFImage\". (Credit to OSS-Fuzz)\n\n2018-05-13  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Fix potentional leak when compressed object is\n\tcorrupted. Fixes oss-fuzz 8251 (Credit to OSS-Fuzz)\n\n2018-05-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): Fix leak of Image when\n\tTIFFReadRGBAImage() reports failure.  Also harden buffer\n\tallocation calculation.  Fixes oss-fuzz 8275\n\t\"graphicsmagick/coder_BIGTIFF_fuzzer: Indirect-leak in\n\tAllocateImage\". (Credit to OSS-Fuzz)\n\n\t* coders/ept.c (ReadEPTImage): Add validations of 'count' and\n\t'filesize' read from EPT file. In response to oss-fuzz 8248\n\t\"graphicsmagick/coder_EPT_fuzzer: Floating-point-exception in\n\tWriteTIFFImage\" but we are unable to recreate the oss-fuzz issue\n\tsince the EPT reader already immediately reports an EOF exception.\n\n2018-05-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/oss-fuzz-build.sh: Apply SourceForge patch #57 \"Add\n\tfuzzing support for jpeg + freetype delegates\" by Alex Gaynor.\n\n\t* coders/png.c (read_user_chunk_callback): Fix memory leak and use\n\tof uninitialized memory when handling eXIf chunk. Fixes oss-fuzz\n\t8247 \"graphicsmagick/coder_PNG24_fuzzer: Direct-leak in\n\tpng_malloc\". (Credit to OSS-Fuzz)\n\n2018-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/oss-fuzz-build.sh: Apply SourceForge patch #56 \"Use a\n\tfew delegate libraries in fuzzing\" by Alex Gaynor.\n\n2018-05-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tests/rwfile.tap: MIFF zip and bzip compression tests do not\n\tfail if zlib and bzlib are not available because the compression\n\trequest is silently changed to no compression.\n\n2018-05-07  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (DrawImage, InsertAttributeIntoInputStream):\n\tFor a reference such as 'class=\"classname\"', the \"classname\"\n\tis now allowed to be undefined.\n\n\t* coders.svg.c (ProcessStyleClassDefs): Class definitions\n\tdefined within a <style> block may now be empty.\n\n\t* These relaxed conditions are not specifically called out in\n\tthe SVG spec as being either acceptable or unacceptable, but\n\tother SVG renderers (e.g., Chrome) handle them this way. These\n\tchanges do not resolve, but are related to, ticket #307.\n\n2018-05-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* utilities/Makefile.am (utilities/tests/montage.log): Fix\n\tdependency rule so that effects.tap is fully executed before\n\texecution of montage.tap starts.\n\n2018-05-04  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (DrawImage, TraceXXX): The PrimitiveInfo\n\tarray used to store points generated by TraceEllipse(), the\n\tother TraceXXX() functions, and DrawImage() was not always\n\tbeing expanded when needed, resulting in writes beyond the\n\tend of the currently allocated storage. To fix this problem,\n\ta new data structure PrimitiveInfoMgr, and an associated\n\tfunction, PrimtiveInfoRealloc(), were written to handle\n\texpanding the PrimitiveInfo array as needed. DrawImage() and\n\tthe TraceXXX() functions were modified to prevent the out of\n\tbounds writes to memory. This fixes ticket #516.\n\n2018-05-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOneJNGImage): Add more JNG chunk\n\tvalidations. Fixes an issue reported by \"Trace Probe\" via a\n\tfollow-up post to SourceForge issue 437 \"assertion failure in\n\tWriteBlob\", although the issue described was not reproduced.\n\n\t* coders/meta.c (ReadMETAImage): Detect and report 8BIMTEXT and\n\t8BIMWTEXT decoding problems.  Fixes oss-fuzz 8125\n\t\"graphicsmagick/coder_8BIMTEXT_fuzzer: Use-of-uninitialized-value\n\tin format8BIM\". (Credit to OSS-Fuzz)\n\n2018-05-02  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (TraceStrokePolygon): Excessively\n\tlarge values of stroke-width were cascading through\n\tother computations, causing the function to write beyond\n\tthe end of it's array of points when the stroke-linejoin\n\tattribute value was \"round\". Code was added to reallocate\n\tthe array of points as needed, and to limit the size of\n\tstroke-width (for computational purposes) to no more than\n\tapproximately twice the diagonal size of the output image.\n\tFixes ticket #515.\n\n\t* The same limit on stroke-width was applied to all other\n\tinstances of the same computation in render.c.\n\n2018-05-01  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* This change set fixes ticket #471.\n\n\t* magick/render.c (DrawImage): Polylines with fewer\n\tthan two points were being flagged as an error. The\n\tSVG spec has no such restriction (fixed).\n\n\t* coders/svg.c (SVGStartElement) Inner <svg> elements\n\tcould modify the output image dimensions if a geometry\n\tstring was supplied. Now the output image dimensions\n\tare determined by the outermost <svg> only.\n\n2018-05-01  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (TraceEllipse, TraceRectangle,\n\tTraceRoundRectangle): Per the SVG spec, rectangles and\n\tround rectangles having a width or height of zero are\n\tnot rendered. Also per the spec, ellipses having an x\n\tor y radius of zero are not rendered.  Fixes ticket #457.\n\n2018-04-30  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.h, (PrimitiveInfo), magick/render.c: Added\n\tmember \"flags\" to PrimitiveInfo to support indicating closed\n\tshapes (e.g., rectangle, circle, path closed using 'z' or 'Z').\n\tUpdated code in render.c (functions TraceXXX) to indicate\n\tclosed shapes.  This replaces the previous policy of detecing\n\tclosed shapes by comparing the first and last points to see if\n\tthey are identical (within MagickEpsilon). The old policy\n\tprevented open subpaths with the same first and last point from\n\tbeing rendered properly (per the SVG spec) when round or square\n\tendcaps were enabled.  Part of the fix for ticket #322.\n\n\t* magick/render.c (ConvertPrimitiveToPath): Modified duplicate\n\tpoint elimination code so that the first and last points of\n\ta subpath are always preserved.  Consequences: (1) Allows\n\tfor the correct rendering of the sequence \"move x1 y1 line\n\tx1 y1\" with round or square endcaps.  Part of the fix for\n\tticket #322. (2) Fixes a bug in which eliminating the last\n\tpoint as a duplicate caused a closed shape to no longer be\n\tclosed. This would manifest itself, for example, as a small\n\t\"nub\" on the boundary of a filled circle.\n\n\t* magick/render.c (GetPixelOpacity): Fixed a bug in the\n\tcode that computed the distance between a point and a\n\tsegment (polygon edge).  Prior to this fix, for zero length\n\tsegments this code would generate a divide-by-zero and\n\tincorrect output. Part of the fix for ticket #322.\n\n\t* magick/render.c (DrawPolygonPrimitive): Polygons/paths with\n\tzero or one points are no longer rendered per the SVG spec.\n\n\t* magick/render.c (DrawStrokePolygon): Per the SVG spec, a\n\tpolygon consisting of a single move-to command is not stroked.\n\n\t* magick/render.c (TracePath): Per the SVG spec, if the\n\tendpoints (x1, y1) and (x2, y2) of an arc subpath are identical,\n\tthen this is equivalent to omitting the elliptical arc segment\n\tentirely.  For rendering purposes the zero length arc is\n\ttreated like a zero length \"line to\" command to the current\n\tpoint.\n\n\t* magick/render.c (TraceStrokePolygon): Added code to detect\n\tzero length open subpaths and return a stroked polygon containing\n\tno points when round or square endcaps are not enabled.  This\n\tsatisfies the SVG spec requirement that zero length subpaths are\n\tonly stroked if the 'stroke-linecap' property has a value of\n\tround or square.\n\n\t* magick/render.c (TracePath): Fixed a bug in which if a \"move to\"\n\tcommand was followed by additional pairs of points, indicating\n\timplied \"line to\" commands, each point was added twice.\n\n2018-04-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcx.c (ReadPCXImage): Colormap from PCX header is only\n\tused if colors <= 16. Determination of DirectClass image was\n\twrong.  Fixes oss-fuzz 8093 \"graphicsmagick/coder_PCX_fuzzer:\n\tUse-of-uninitialized-value in IsMonochromeImage\". (Credit to\n\tOSS-Fuzz)\n\n2018-04-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* version.sh: Updates to prepare for the 1.3.29 release.\n\n\t* coders/pict.c (DecodeImage): Assure that scanline is initialized\n\tto avoid use of uninitialized data.  Fixes oss-fuzz 8063\n\t\"graphicsmagick/coder_WPG_fuzzer: Use-of-uninitialized-value in\n\tReadPICTImage\". (Credit to OSS-Fuzz)\n\n\t* coders/dpx.c (ReadDPXImage): Assure that NULL pixels is not\n\tused.  Fixes oss-fuzz 8078 \"graphicsmagick/coder_DPX_fuzzer:\n\tNull-dereference WRITE in ReadDPXImage\". (Credit to OSS-Fuzz)\n\n\t* NEWS.txt: Update NEWS file with information about changes since\n\tlast release.\n\n2018-04-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dib.c (ReadDIBImage): Disable EOF tests for \"ICODIB\"\n\tsubformat due to icon file provided by SourceForge issue #557\n\t\"ErrorCorruptImage: Magick: Unexpected end-of-file ()\" where an\n\tEOF error was reported due to no mask data being supplied.\n\n\t* coders/png.c (ReadOneJNGImage): The embedded JPEG image is\n\trequired to have the same dimensions as the JNG image as provided\n\tby JHDR.  Fixes SourceForge bug 555 \"heap-buffer-overflow in\n\tAcquireCacheNexus when processing jng file\".  It is likely that\n\tthis issue is precipitated by using 'montage' which seems to set a\n\tdefault non-zero image size.\n\t(ReadMNGImage): By default limit the maximum loops specifiable by\n\tthe MNG LOOP chunk to 512 loops, but allow this to be modified by\n\t'-define mng:maximum-loops=value'.  Also assure that the value is\n\tin the range of 0-2147483647 as per the MNG specification.  This\n\tis to address the denial of service issue described by\n\tCVE-2018-10177.  This problem was reported to us by Petr Gajdos\n\tvia email on Fri, 20 Apr 2018.\n\n\t* coders/dpx.c (ReadDPXImage): Move misplaced channel validation\n\tcode.  Fixes oss-fuzz 8041 \"graphicsmagick/coder_DPX_fuzzer:\n\tUse-of-uninitialized-value in WriteDPXImage\" and oss-fuzz 8055\n\t\"graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\n\tEnhanceImage\". (Credit to OSS-Fuzz)\n\n2018-04-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (StringToListMod): Algorithm fixes to fix use of\n\tuninitialized data.  Fixes oss-fuzz 8046\n\t\"graphicsmagick/coder_XPM_fuzzer: Use-of-uninitialized-value in\n\tStringToListMod\". (Credit to OSS-Fuzz)\n\n2018-04-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (ReadXPMImage): Reduce memory consumption further.\n\tHopefully fixes oss-fuzz 8013 \"graphicsmagick/coder_XPM_fuzzer:\n\tOut-of-memory in graphicsmagick_coder_XPM_fuzzer\". (Credit to\n\tOSS-Fuzz)\n\n\t* magick/utility.c (StringToList): Only allocate the memory\n\trequired when converting string to an ASCII list.  May or may not\n\tfix oss-fuzz 8013 \"graphicsmagick/coder_XPM_fuzzer: Out-of-memory\n\tin graphicsmagick_coder_XPM_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-04-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (ReadBMPImage): Fix benign use of uninitialized\n\tdata when testing header magick.  Fixes oss-fuzz 7980\n\t\"graphicsmagick/coder_BMP_fuzzer: Use-of-uninitialized-value in\n\tLocaleNCompare\". (Credit to OSS-Fuzz)\n\n\t* coders/dpx.c (ReadDPXImage): ColorDifferenceCbCr does require\n\teven image width. Fixes oss-fuzz 7966\n\t\"graphicsmagick/coder_DPX_fuzzer: Unknown signal in\n\tTentUpsampleChroma\". (Credit to OSS-Fuzz)\n\n2018-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): ColorDifferenceCbCr element\n\trequires two samples/pixel, not one. Fixes oss-fuzz 7951\n\t\"graphicsmagick/coder_DPX_fuzzer: Heap-buffer-overflow in\n\tReadDPXImage\". (Credit to OSS-Fuzz)\n\n2018-04-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdb.c (ReadPDBImage): Assure that pixels buffer is\n\tinitialized.  Fixes oss-fuzz 7937\n\t\"graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\n\tReadPDBImage\". (Credit to OSS-Fuzz)\n\n\t* coders/mvg.c (ReadMVGImage): Assure that MVG viewbox parameters\n\twere supplied.  Fixes oss-fuzz 7936\n\t\"graphicsmagick/coder_MVG_fuzzer: Use-of-uninitialized-value in\n\tReadMVGImage\". (Credit to OSS-Fuzz)\n\n\t* coders/dpx.c (ReadDPXImage): Element descriptors CbYCrY422 and\n\tCbYACrYA4224 require that the image width be evenly divisible by 2\n\tso enforce that.  Fixes oss-fuzz 7935\n\t\"graphicsmagick/coder_DPX_fuzzer: Heap-buffer-overflow in\n\tReadDPXImage\". (Credit to OSS-Fuzz)\n\n2018-04-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Reject DPX files which claim to use\n\tsigned data.  Fixes oss-fuzz 7758\n\t\"graphicsmagick/coder_DPX_fuzzer: Use-of-uninitialized-value in\n\tWriteDPXImage\". (Credit to OSS-Fuzz)\n\t(ReadDPXImage): Validate that the image elements do update all of\n\tthe channels, including the alpha channel.  Now report an error if\n\ta color channel is missing.  Fixes oss-fuzz 7758\n\t\"graphicsmagick/coder_DPX_fuzzer: Use-of-uninitialized-value in\n\tWriteDPXImage\".\n\n\t* coders/gif.c (DecodeImage): Finally fix oss-fuzz 7732\n\t\"graphicsmagick/coder_GIF_fuzzer: Heap-buffer-overflow in\n\tDecodeImage\" which was not actually fixed with previous\n\tchanges. (Credit to OSS-Fuzz)\n\n2018-04-21  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/topol.c Emit error when tile storage overflows image data;\n        fixes oss-fuzz 7769 thanks to oss-fuzz.\n\n2018-04-20  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (ConvertPrimitiveToPath):  Fixed a bug\n\tin which SVG paths containing multiple open subpaths were\n\tnot being processed correctly, resulting in incorrect\n\toutput.  This fixes ticket #94.\n\n2018-04-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (DecodeImage): Fix use of uninitialized memory\n\tduring error condition in decoder. Fixes oss-fuzz 7732\n\t\"graphicsmagick/coder_GIF_fuzzer: Heap-buffer-overflow in\n\tDecodeImage\". (Credit to OSS-Fuzz)\n\n\t* coders/txt.c (ReadTXTImage): Assure that all image pixels are\n\tinitialized to black.\n\n\t* Magick++/demo/zoom.cpp (main): Add a -read-blob option to read\n\tinput file into a Blob so that it is read by the Blob reader\n\trather than the file reader.  Default the output Geometry to the\n\tinput image geometry in case the user does not specify a resize\n\tresolution or geometry.\n\n\t* Magick++/tests/readWriteBlob.cpp (main): Improve the quality of\n\tcode which reads a file into memory for Blob testing.\n\n\t* magick/blob.c (BlobToImage): Add exception reports for the cases\n\twhere 'magick' was not set and the file format could not be\n\tdeduced from its header.  Previously a null Image pointer was\n\tbeing returned without any exception being thrown.\n\n2018-04-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Assure that CbCr layer initializes\n\tall channels if it is the first element of a planar DPX.  Fixes\n\toss-fuzz 7703 \"graphicsmagick/coder_DPX_fuzzer:\n\tUse-of-uninitialized-value in WriteDPXImage\". (Credit to OSS-Fuzz)\n\n\t* coders/pict.c (ReadPICTImage): Don't refer to filename member of\n\tImageInfo which was just destroyed. Much thanks to Alex Gaynor for\n\tfinding this.  Should fix oss-fuzz 6867\n\t\"graphicsmagick/coder_PCT_fuzzer: Heap-use-after-free in\n\tGetLocaleExceptionMessage\". (Credit to OSS-Fuzz).\n\n2018-04-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sgi.c (ReadSGIImage): Assure that iris pixels are fully\n\tinitialized.  Fixes oss-fuzz 7543\n\t\"graphicsmagick/coder_SGI_fuzzer: Use-of-uninitialized-value in\n\tSGIEncode\". (Credit to OSS-Fuzz).\n\n\t* coders/xcf.c (ReadXCFImage): Restore SetImage() which was\n\tpreviously commented out.  This is needed to assure initialized\n\tpixels.  Fixes oss-fuzz 7430 \"graphicsmagick/coder_XCF_fuzzer:\n\tUse-of-uninitialized-value in AlphaCompositePixel\". (Credit to\n\tOSS-Fuzz).\n\n\t* coders/pict.c (ReadPICTImage): Properly initialize \"black\n\tcanvas\" that tiles may be composed on.  Fixes oss-fuzz 7574\n\t\"graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\n\tEnhanceImage\". (Credit to OSS-Fuzz).\n\n\t* coders/rle.c (ReadRLEImage): Check for EOF when reading comment.\n\tFixes oss-fuzz 7667 \"graphicsmagick/coder_RLE_fuzzer:\n\tUse-of-uninitialized-value in ReadRLEImage\". (Credit to OSS-Fuzz).\n\n\t* coders/pdb.c (WritePDBImage): Avoid use of uninitialized\n\tbytes. Fixes oss-fuzz 7638 \"graphicsmagick/coder_PDB_fuzzer:\n\tUse-of-uninitialized-value in WritePDBImage\". (Credit to\n\tOSS-Fuzz).\n\n\t* coders/rla.c (ReadRLAImage): Add many more validations,\n\tincluding scanline offsets and number of channels.  Fixes oss-fuzz\n\t7653 \"graphicsmagick/coder_RLA_fuzzer: Timeout in\n\tgraphicsmagick_coder_RLA_fuzzer\". (Credit to OSS-Fuzz).\n\n\t* coders/txt.c (ReadTXTImage): Implement missing subrange logic to\n\tread only the specified range of frames.  Limits frames read from\n\toss-fuzz test case\n\tclusterfuzz-testcase-minimized-coder_TEXT_fuzzer-6061076048248832\n\t\"graphicsmagick/coder_TEXT_fuzzer: Timeout in\n\tgraphicsmagick_coder_TEXT_fuzzer\". (Credit to OSS-Fuzz).\n\n\t* Magick++/lib/Image.cpp (read): Set subrange = 1 since this\n\tinterface is intended to read just one frame from the input file.\n\tUse the STL-based interfaces to read multiple frames.\n\n\t* coders/fits.c (ReadFITSImage): Verify FITS header before reading\n\tfurther.  Rejects file from oss-fuzz 7650\n\t\"graphicsmagick/coder_FITS_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_FITS_fuzzer\".  (Credit to OSS-Fuzz).\n\n\t* PerlMagick/Magick.xs (Get): Fix PerlMagick compilation problem\n\tdue to rename/repurposing of image->clip_mask.\n\n2018-04-13  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/image.c, magick/image.h:  In order to be able to\n\tsupport SVG masks, and to be able to further extend the\n\tImage data structure without changing its size, new data\n\tstructure ImageExtra (struct _ImageExtra) has been added.\n\tHeader file image.h contains only a forward declaration;\n\tthe members of ImageExtra are defined in file image.c.\n\tImage member variable Image * clip_mask has been replaced\n\tby ImageExtra * extra, and function prototypes that enable\n\taccess to ImageExtra have been added to image.h.  The\n\tclip_mask member variable now resides in ImageExtra.  All\n\treferences to Image::clip_mask in the GraphicsMagick\n\tsource code have either been replaced with direct references\n\tto ImageExtra::clip_mask (image.c), or have been replaced\n\twith calls to access function ImageGetClipMask().\n\n\t* magick/render.c, magick/render.h:  In order to be able to\n\tsupport SVG masks, and to be able to further extend the\n\tDrawInfo data structure without changing its size, new data\n\tstructure DrawInfoExtra (struct _DrawInfoExtra) has been added.\n\tHeader file render.h contains only a forward declaration;\n\tthe members of DrawInfoExtra are defined in file render.c.\n\tDrawInfo member variable char * clip_path has been replaced by\n\tDrawInfoExtra * extra, and function prototypes that enable\n\taccess to DrawInfoExtra have been added to render.h.  The\n\tclip_path member variable now resides in ImageExtra.  All\n\treferences to DrawInfo::clip_path in the GraphicsMagick\n\tsource code have either been replaced with direct references\n\tto DrawInfoExtra::clip_path (render.c), or have been\n\treplaced with calls to access function DrawInfoGetClipPath().\n\n\t* magick/image.c (new functions CompositePathImage,\n\tCompositeMaskImage, GetImageCompositeMask,\n\tSetImageCompositeMask):  Defined new data structure ImageExtra,\n\tadded create/destroy logic, and implemented associated access\n\tfunctions.  Implemented SVG masks.\n\n\t* magick/render.c (DrawImage, new function DrawCompositeMask):\n\tDefined new data structure DrawInfoExtra, added create/destroy\n\tlogic, and implemented associated access functions.  Impemented\n\tSVG masks.\n\n\t* magick/pixel_cache.c (SyncCacheNexus, new function\n\tCompositeCacheNexus):  Fixed references to Image::clip_mask.\n\tImplemented SVG masks.\n\n\t* coders/svg.c (SVGStartElement, SVGEndElement): Implemented\n\tSVG masks.\n\n\t* locale/c.mgk, magick/gm_messages.mc, magick/local_c.h:\n\tAdded new error codes to support SVG masks.\n\n\t* coders/ps3.c, magick/enhance.c: Fixed references to\n\tImage::clip_mask.\n\n\t* magick/draw.c, wand/drawing_wand.c: Fixed references to\n\tDrawInfo::clip_path.\n\n2018-04-13  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Crash on row overflow fixed oss-fuzz 7639 thanks to oss-fuzz.\n\n2018-04-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Add more header validations.\n\tAlways assure that scanline is initialized for Luma channel. Fixes\n\toss-fuzz 7544 \"graphicsmagick/coder_DPX_fuzzer:\n\tUse-of-uninitialized-value in WriteDPXImage\". (Credit to OSS-Fuzz)\n\n\t* coders/pdb.c (ReadPDBImage): Add more EOF checks to avoid benign\n\tuse of uninitialized data.  Fixes oss-fuzz 7545\n\t\"graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\n\tReadPDBImage\".\n\n\t* coders/wpg.c (InsertRow, UnpackWPGRaster): x & y should be\n\t'unsigned long' to match type used by pixel cache APIs and image\n\trows/columns.\n\n2018-04-08  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Stop reading when last row is reached.\n\tThis should stop oss-fuzz 7528 thanks to oss-fuzz.\n\n\n2018-04-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c (ReadXCFImage): Fix use of uninitialized data in\n\tmagick header string for runt file.  Fixes oss-fuzz 7521\n\t\"graphicsmagick/coder_XCF_fuzzer: Use-of-uninitialized-value in\n\tLocaleNCompare\". (Credit to OSS-Fuzz).\n\n2018-04-09  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* OVERVIEW: Change set 9aaeeca0224c modified the drawing\n\tof clipping paths to conform to the SVG spec.  This change\n\tset restores the previous behavior for non-SVG clients of\n\trender.c, while still satisfying the SVG spec for SVG clients.\n\n\t* magick/render.h (DrawInfo): Added a bit field in member\n\t\"flags\" to indicate that drawing should be SVG compliant.\n\n\t* magick/render.c (DrawImage): Now recognizes keyword\n\t\"svg-compliant\", and tags DrawInfo accordingly.  This\n\tallows for existing features in render.c to be changed\n\tto comply with the SVG spec without impacting the previous\n\tbehavior expected by non-SVG clients.\n\n\t* magick/render.c (DrawImage): Now uses DrawInfo \"flags\"\n\tbit for SVG compliance in conjunction with \"flags\" bit\n\tfor \"clipping path\" to determine when to ignore changes\n\tto fill color, stroke color, etc.  This restores the\n\tprevious behavior for clipping paths for non-SVG clients.\n\n\t* coders/svg.c (SVGStartElement): The initial set of\n\tMVG commands for rendering an SVG file now includes\n\tnew keyword \"svg-compliant\" (to indicate that certain\n\tgraphical elements should be drawn according to the\n\tSVG spec), and includes an intialization of the SVG\n\t\"fill-rule\" to \"nonzero\" (the SVG default) instead of\n\tthe internally initialized value of \"evenodd\".\n\n\t* coders/wpg.c: Fixed C99 \"//\" comments.\n\n2018-04-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (ReadPICTImage): Copy tile exception info to main\n\timage and don't composite tile if it has a problem.  Fixes\n\toss-fuzz 7169 \"graphicsmagick/enhance_fuzzer:\n\tUse-of-uninitialized-value in EnhanceImage\". (Credit to OSS-Fuzz)\n\n\t* coders/dib.c (ReadDIBImage): Do not increase decode bits/pixel\n\tif compression=2, but use it to increase pixel packet size when\n\testimating bytes per line for decode buffer.  Fixes oss-fuzz issue\n\t7324 \"graphicsmagick/coder_WPG_fuzzer: Use-of-uninitialized-value\n\tin ReadDIBImage\". (Credit to OSS-Fuzz)\n\n\t* coders/dpx.c (ReadDPXImage): When handling the first element of\n\ta planar DPX, assure that the other channels are\n\tinitialized. Fixes oss-fuzz 7841 \"graphicsmagick/coder_DPX_fuzzer:\n\tUse-of-uninitialized-value in WriteDPXImage\". (Credit to OSS-Fuzz)\n\n\t* coders/tim.c (ReadTIMImage): Only 4 and 8 bit TIM requires a\n\tcolormap. For other depths, force reading as DirectClass even if\n\tthe TIM file provides a colormap.  Fixes oss-fuzz 7407\n\t\"graphicsmagick/coder_TIM_fuzzer: Use-of-uninitialized-value in\n\tSyncImageCallBack\". (Credit to OSS-Fuzz)\n\n2018-04-08  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c The unread data contains crap in memory,\n\terase current image data. This should mute oss-fuzz 6604.\n\n\t* coders/wpg.c - condition \"if(y<1) continue;\" is redundant\n\tand could be removed completely.\n\tAllow logging in MatlabV4 module.\n\n\t* coders/svg.c - Do not use C++ syntax in C code - removed.\n\n2018-04-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c (UnpackWPGRaster): Fix uninitialized row 0 when\n\trow-based RLE is used.  Fixes oss-fuzz 6603\n\t\"graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\n\tBlendCompositePixel\". (Credit to OSS-Fuzz)\n\n\t* coders/pcd.c: Fix many issues, including oss-fuzz 6016\n\t\"graphicsmagick/coder_PCD_fuzzer: Heap-double-free in\n\tMagickRealloc\" and oss-fuzz 6108 \"graphicsmagick/coder_PCD_fuzzer:\n\tUnknown signal in AllocateThreadViewDataSet\". (Credit to OSS-Fuzz)\n\n2018-04-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (funcDCM_BitsStored): Limit DICOM significant bits\n\tto 16.  Otherwise rescale map code blows up.  Fixes oss-fuzz 7435\n\t\"graphicsmagick/coder_DCM_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_DCM_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/pix.c (ReadPIXImage): Detect EOF.  Reject RLE lenth of\n\tzero.  Fixes oss-fuzz 7440 \"graphicsmagick/coder_PIX_fuzzer:\n\tOut-of-memory in graphicsmagick_coder_PIX_fuzzer\". (Credit to\n\tOSS-Fuzz)\n\n2018-04-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Insist on having an element\n\tdescriptor we understand since otherwise we can not decode the\n\timage.  Fixes oss-fuzz 7410 \"graphicsmagick/coder_DPX_fuzzer:\n\tUse-of-uninitialized-value in WriteDPXImage\". (Credit to OSS-Fuzz)\n\n\t* coders/avs.c, etc... (WriteAVSImage): Cache image list length\n\tbefore writing image sequence so that progress monitor is\n\tscalable.  Helps with oss-fuzz 7404\n\t\"graphicsmagick/coder_AVS_fuzzer: Timeout in\n\tgraphicsmagick_coder_AVS_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-04-05  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement, SVGEndElement),\n\tmagick/render.c (DrawImage): The current text position\n\tis now maintained by DrawImage() instead of by\n\tSVGStartElement() and SVGEndElement().  This change was\n\tmade to support the recently implmemented \"use\" and\n\t\"class\" elements, which may make changes to the font\n\tsize that are not visible to the code in svg.c.\n\n\t* coders/svg.c (GetStyleTokens, SVGStartElement): The\n\tlist of SVG attributes is now reordered so that\n\t\"font-size\", \"class\", and \"style\" are processed first.\n\tThis ensures that a change to the font size will be\n\tprocessed before any dimensional attribute whose value\n\tmay depend on the font size (e.g., a width value\n\tspecified in \"em\" units).\n\n\t* coders/svg.c (ProcessStyleClassDefs): Fixed two memory\n\tleaks associated with making an early return when\n\tmalformed input is detected.\n\n\t* magick/render.c (ExtractTokensBetweenPushPop): Fixed\n\tan uninitialized variable condition which can occur when\n\tmalformed input is detected.\n\n\t* magick/render.h (DrawInfo), magick/render.c: DrawInfo\n\tmember \"unused1\" has been renamed \"flags\".  It is now\n\tused to tag a DrawInfo as being a clipping path or a\n\tcompositing mask.\n\n2018-04-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdb.c (ReadPDBImage): Update DirectClass pixels to avoid\n\tuse of uninitialized memory for 2 bits/pixel.  Fixes oss-fuzz 7350\n\t\"graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\n\tWritePDBImage\".  (Credit to OSS-Fuzz)\n\n\t* coders/palm.c (ReadPALMImage): Fix use of uninitialized memory.\n\tFixes oss-fuzz 7325 \"graphicsmagick/coder_PALM_fuzzer:\n\tUse-of-uninitialized-value in TransparentImageCallBack\". (Credit\n\tto OSS-Fuzz)\n\n\t* coders/dcm.c (DCM_ReadNonNativeImages): Break out of reading\n\tloop on EOF and properly report exception.  Fixes oss-fuzz 7349\n\t\"graphicsmagick/coder_DCM_fuzzer: Timeout in\n\tgraphicsmagick_coder_DCM_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-04-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xcf.c (ReadXCFImage): Require that XCF file offsets be in\n\tascending order to avoid DOS.  Fixes oss-fuzz 7333\n\t\"graphicsmagick/coder_XCF_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_XCF_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/wpg.c (UnpackWPGRaster): Fix memory leak in error return\n\tpath. Fixes oss-fuzz 7338 \"graphicsmagick/enhance_fuzzer:\n\tDirect-leak in UnpackWPGRaster\". (Credit to OSS-Fuzz)\n\n2018-04-03  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement): This changeset adds\n\tsupport for SVG geometric transforms specified using the\n\tstyle=\"transform: ...\" syntax.  This syntax is sometimes\n\tused when exporting SVG files from Adobe Illustrator.\n\n2018-04-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Validate DPX packing method.  Fixes\n\toss-fuzz 7296 \"graphicsmagick/coder_DPX_fuzzer:\n\tUse-of-uninitialized-value in WriteDPXImage\". (Credit to OSS-Fuzz)\n\n2018-04-02  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement, SVGEndElement),\n\tmagick/render.c (DrawImage): This changeset adds support for\n\t\"class\" styling attributes within a <style> section within\n\tthe <defs> section, and the ability to reference them from\n\tother SVG elements by class=\"classname\".  SVG files exported\n\tfrom Adobe Illustrator make extensive use of \"class\" definitions.\n\n2018-04-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (ReadPICTImage): Fix leak of tile image on EOF.\n\tThis is a recent regression.  Fixes oss-fuzz 7287\n\t\"graphicsmagick/coder_PCT_fuzzer: Indirect-leak in\n\tCloneImage\". (Credit to OSS-Fuzz)\n\n\t* magick/pixel_cache.c (OpenCache): Use image->scene rather than\n\tGetImageIndexInList(image) for scene-id part of cache info file\n\tname.\n\n\t* coders/txt.c (WriteTXTImage): Optimize the progress indicator\n\tsince it is very inefficient with a large number of scenes and\n\toss-fuzz 7090 \"graphicsmagick/coder_TEXT_fuzzer: Timeout in\n\tgraphicsmagick_coder_TEXT_fuzzer\" consistently shows\n\tGetImageListLength() in its stack traces.\n\n\t* coders/dcm.c (ReadDCMImage): DICOM reader was no longer\n\timmediately quitting with excessive samples per pixel.  This\n\tcaused spinning for a very long time when reading planar images\n\twith large samples per pixel.  This is a regression due to recent\n\tchanges.  Fixes oss-fuzz 7269 \"graphicsmagick/coder_DCM_fuzzer:\n\tTimeout in graphicsmagick_coder_DCM_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/xcf.c (ReadXCFImage): Destroy layer info before returning\n\tdue to exception.  This is a new regression due to adding more\n\tchecks. Fixes oss-fuzz 7277 \"graphicsmagick/coder_XCF_fuzzer:\n\tDirect-leak in ReadXCFImage\". (Credit to OSS-Fuzz)\n\n\t* coders/pdb.c (ReadPDBImage): Assure that all bytes of scanline\n\tare initialized while decoding.  Fixes oss-fuzz 7051\n\t\"graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\n\tWritePDBImage\". (Credit to OSS-Fuzz)\n\n2018-03-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcx.c (ReadPCXImage): Assure that scanline is\n\tinitialized.  Fixes oss-fuzz 6612\n\t\"graphicsmagick/coder_PCX_fuzzer: Use-of-uninitialized-value in\n\tWriteRLEPixels\". (Credit to OSS-Fuzz)\n\n\t* coders/wpg.c (ReadWPGImage): Detect unexpected EOF and avoid use\n\tof uninitialized data.  Fixes oss-fuzz 6601\n\t\"graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\n\tImportIndexQuantumType\". (Credit to OSS-Fuzz)\n\n\t* coders/sgi.c (ReadSGIImage): Assure that RLE decode buffer is\n\tinitialized.  Fixes oss-fuzz 6599\n\t\"graphicsmagick/coder_SGI_fuzzer: Use-of-uninitialized-value in\n\tSyncImageCallBack\" and oss-fuzz 6600\n\t\"graphicsmagick/coder_SGI_fuzzer: Use-of-uninitialized-value in\n\tSGIEncode\". (Credit to OSS-Fuzz)\n\n\t* coders/viff.c (ReadVIFFImage): Fix blob I/O size validation to\n\tavoid use of uninitialized data. Fixes oss-fuzz 6597\n\t\"graphicsmagick/coder_VIFF_fuzzer: Use-of-uninitialized-value in\n\tThresholdImage\". (Credit to OSS-Fuzz)\n\t(ReadVIFFImage): Don't execute SetImageType(image,BilevelType) on\n\tan image which has no pixels yet in order to avoid use of\n\tuninitialized data. Fixes oss-fuzz 6597.  (Credit to OSS-Fuzz)\n\n\t* coders/wbmp.c (ReadWBMPImage): Fix blob I/O size validation to\n\tavoid use of uninitialized data. Fixes oss-fuzz 7047\n\t\"graphicsmagick/coder_WBMP_fuzzer: Use-of-uninitialized-value in\n\tReadWBMPImage\". (Credit to OSS-Fuzz)\n\n\t* coders/wpg.c (ExtractPostscript): Allow non-Postscript content\n\tbut force reading using the magick we already detected.  Also log\n\tthe format that we detected.\n\n\t* coders/xcf.c (ReadOneLayer): Reject layer size of 0x0.  Fixes\n\toss-fuzz 6636 \"graphicsmagick/coder_XCF_fuzzer: Direct-leak in\n\tMagickMallocAligned\". (Credit to OSS-Fuzz)\n\t(ReadXCFImage): Verify that seek offsets are within the bounds of\n\tthe file data. Fixes oss-fuzz 6682\n\t\"graphicsmagick/coder_XCF_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_XCF_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* magick/pixel_cache.c (ModifyCache): Destroy CacheInfo if\n\tOpenCache() fails so it is not leaked.\n\n\t* coders/wpg.c (ExtractPostscript): Enforce that embedded file is\n\ta Postscript file.  Fixes oss-fuzz 7235\n\t\"graphicsmagick/coder_WPG_fuzzer: Indirect-leak in MagickRealloc\".\n\tThis is indicated to be a regression. (Credit to OSS-Fuzz)\n\n2018-03-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (ReadPICTImage): Check image pixel limits before\n\tallocating memory for tile.  Fixes oss-fuzz 7217\n\t\"graphicsmagick/coder_PICT_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_PICT_fuzzer\".\n\n2018-03-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcd.c (ReadPCDImage): Add checks for EOF. Fixes oss-fuzz\n\tissue 7180 \"graphicsmagick/coder_PCDS_fuzzer: Timeout in\n\tgraphicsmagick_coder_PCDS_fuzzer\".  (Credit to OSS-Fuzz)\n\n2018-03-29  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement, SVGEndElement),\n\tmagick/render.c (DrawImage): This changeset implements the SVG\n\t\"use\" element.  Graphical elements (e.g., \"rect\", \"text\", etc.)\n\tcan be tagged with an identifier using 'id=\"identifier\"' when\n\tdefined within the \"defs\" section.  They can then be referenced\n\telsewhere in the SVG file using:\n\n\t<use xlink:href=\"#identifier\" ... />\n\n\tWhen referencing a graphical element by its identifier, the\n\tfollowing syntaxes are now treated as being the same:\n\n\thref=\"#identifier\"\n\thref=\"url(#identifier)\"\n\txlink:href=\"#identifier\"\n\txlink:href=\"url(#identifier)\"\n\n2018-03-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tim.c (ReadTIMImage): Reader was not observing subimage\n\tand subrange to quit after the specified frame range.  Inspired by\n\toss-fuzz 7132 \"graphicsmagick/coder_TIM_fuzzer: Timeout in\n\tgraphicsmagick_coder_TIM_fuzzer\" (Credit to OSS-Fuzz)\n\n2018-03-27  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement): Enable setting the\n\tbackground color from the SVG file when the client\n\tspecifies style=\"background:color\" inside the <svg>\n\t... </svg> element.\n\n2018-03-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mtv.c (ReadMTVImage): Add some elementary tracing to MTV\n\treader.\n\n\t* coders/png.c (ReadMNGImage): Fix SourceForge issue 554\n\t\"Divide-by-zero in ReadMNGImage (coders/png.c)\".  (Credit to Trace\n\tProbe)\n\n\t* coders/bmp.c (ReadBMPImage): Assure that start position always\n\tadvances to avoid looping BMPs.  Fixes oss-fuzz 7045\n\t\"graphicsmagick/coder_BMP_fuzzer: Timeout in\n\tgraphicsmagick_coder_BMP_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/pict.c (DecodeImage): Verify that sufficient backing data\n\texists before allocating memory to read it.  Fixes oss-fuzz 6629\n\t\"graphicsmagick/coder_PCT_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_PCT_fuzzer\".\n\t(ReadPICTImage): Destroy tile_image in ThrowPICTReaderException()\n\tmacro to simplify logic.\n\n2018-03-25  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Check whether datablock is really read.\n\tFixes oss-fuzz 7056 (Credit to OSS-Fuzz)\n\n\t* coders/txt.c Duplicate image check for data with fixed geometry\n\tprevious check is skipped. Fixes oss-fuzz 7090.\n\n2018-03-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (ReadDCMImage): Validate that samples per pixel is\n\tin valid range.  Fixes oss-fuzz 6260\n\t\"graphicsmagick/coder_DCM_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_DCM_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/meta.c (format8BIM): Allocate space for null termination\n\tand null terminate string.  Fixes oss-fuzz 5985\n\t\"graphicsmagick/coder_8BIMTEXT_fuzzer: Heap-buffer-overflow in\n\tformatIPTCfromBuffer\". (Credit to OSS-Fuzz)\n\n\t* coders/fits.c (ReadFITSImage): Include number of FITS scenes in\n\tfile size validations.  Fixes oss-fuzz 6781\n\t\"graphicsmagick/coder_FITS_fuzzer: Timeout in\n\tgraphicsmagick_coder_FITS_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-03-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/meta.c (format8BIM): Validate size request prior to\n\tallocation. Fixes oss-fuzz issue 5974\n\t\"graphicsmagick/coder_8BIMTEXT_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_8BIMTEXT_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-03-23  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Fix forged amount of frames 7076. (Credit to OSS-Fuzz)\n\n        * coders/topol.c Check for forged image that overflows file size\n        (fuzz 6836).\n\n2018-03-23  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c, render.h (DrawInfo, CloneDrawInfo,\n\tDrawClipPath, DrawImage, GetDrawInfo): According to the SVG\n\tspec, a clipping path is defined only by the geometry of its\n\tconstituent elements, and is not dependent on fill color/opacity,\n\tstroke color/opacity, or stroke width.  To ensure conformity\n\twith the spec, when a clipping path is created, these SVG\n\telements are set to appropriate values, and any attempt to\n\tmodify them is ignored.\n\n\tAlso, whenever a clipping path is drawn, the associated image\n\tattributes are now updated from the parent image structure.\n\tThis ensures that any added or modified attributes are up to\n\tdate.\n\n2018-03-22  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/topol.c Use rather MagickSwabArrayOfUInt32() to\n        flip all array elements at once.\n\n        * magick/annotate.c Compilation issue - using C++ syntax in C code.\n\n2018-03-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadDPXImage): Validate header length and offset\n\tproperties.  Fixes oss-fuzz \"graphicsmagick/coder_DPX_fuzzer:\n\tUse-of-uninitialized-value in WriteDPXImage\". (Credit to OSS-Fuzz)\n\n2018-03-20  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/annotate.c (RenderType): According to the SVG\n\tspec, the 'font-family' element can be a comma-separated\n\tlist of one or more font family names.  Function RenderType\n\tin file annotate.c has been modified to support multiple\n\tfont family names as follows.  The comma-separated list is\n\tprocessed until the first available font family is found.\n\tIf no font family is found, or if font substitution occurred,\n\tthen the entire font family string is tested to see if it\n\texactly matches a font name, or if the font family string\n\twith blanks changed to hypens exactly matches a font name.\n\tIf a font name match is found, the matched font overrides\n\tthe font substution.  The font name matching functionality\n\tis beyond what's in the SVG spec and is provided as a\n\tconvenience to the user.\n\n2018-03-20  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Fix forged amount of frames 6755. (Credit to OSS-Fuzz)\n\n2018-03-20  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/topol.c Redesign ReadBlobDwordLSB() to be more effective.\n\n2018-03-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (ReadXPMImage): Reject XPM if its condensed version\n\tcontains non-whitespace control characters.  Fixes oss-fuzz 7027\n\t\"graphicsmagick/coder_XPM_fuzzer: Timeout in\n\tgraphicsmagick_coder_XPM_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-03-19  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/topol.c Fix tile index overflow fuzz 6634. (Credit to OSS-Fuzz)\n\n2018-03-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (DCM_ReadGrayscaleImage): Don't use rescale map if\n\tit was not allocated.  This issue was induced in this development\n\tcycle due to disabling generating the rescale map.  Fixes oss-fuzz\n\t7021 \"graphicsmagick/coder_DCM_fuzzer: Null-dereference READ in\n\tDCM_ReadGrayscaleImage\". (Credit to OSS-Fuzz)\n\n2018-03-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/color_lookup.c (QueryColorDatabase): Defend against\n\tpartial scanf() expression matching, resulting in use of\n\tuninitialized data.  Likely fixes oss-fuzz 6596\n\t\"graphicsmagick/coder_XPM_fuzzer: Use-of-uninitialized-value in\n\tIsMonochromeImage\". (Credit to OSS-Fuzz)\n\n\t* coders/rle.c (ReadRLEImage): Validate number of colormap bits to\n\tavoid undefined shift behavior.  Fixes oss-fuzz 6630\n\t\"graphicsmagick/enhance_fuzzer: Undefined-shift in\n\tReadRLEImage\". (Credit to OSS-Fuzz)\n\n\t* coders/dcm.c (DCM_ReadRGBImage): Don't use rescale map if it was\n\tnot allocated.  This issue was induced in this development cycle\n\tdue to disabling generating the rescale map.  Fixes oss-fuzz 6995\n\t\"graphicsmagick/coder_DCM_fuzzer: Null-dereference READ in\n\tDCM_ReadRGBImage\". (Credit to OSS-Fuzz)\n\n\t* coders/dib.c (DecodeImage): Report failure to decode to expected\n\tamount of pixel data as an error.  Fixes oss-fuzz 7007\n\t\"graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\n\tEnhanceImage\". (Credit to OSS-Fuzz)\n\n\t* coders/bmp.c (ReadBMPImage): Add file size and offset/seek\n\tvalidations.  Fixes oss-fuzz 6623\n\t\"graphicsmagick/coder_BMP_fuzzer: Timeout in\n\tgraphicsmagick_coder_BMP_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-03-17  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* dcraw/dcraw.c Updated to version 9.27\n\n2018-03-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (ReadGIFImage): Fix botched fixes for use of\n\tuninitialized data when reading GIF extension blocks.  Hopefully\n\tok now.\n\n2018-03-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gif.c (ReadGIFImage): Fix use of uninitialized data when\n\treading GIF extension blocks.  Fixes oss-fuzz 6609\n\t\"graphicsmagick/coder_GIF_fuzzer: Use-of-uninitialized-value in\n\tMagickArraySize\". This seems to be a totally benign issue. (Credit\n\tto OSS-Fuzz)\n\n\t* magick/magick.c (MagickSignal): Use an alternate signal stack,\n\tif available.  This is required for Go lang C language extensions\n\tsince Go lang requests an alternate signal sack, and uses small\n\tstacks for its threads.  If the library user has not allocated an\n\talternate signal stack, then behavior should be just as before.\n\tIssue was originally reported by yzh杨振宏 on March 1, 2018 via\n\tthe graphicsmagick-help SourceForge mailing list.\n\n2018-02-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (AcquireCacheNexus): Add a check that the\n\tpixel cache is compatible with the image dimensions.  Fixes\n\toss-fuzz issues 5978 5988 5989 5990 5993 6016, and 6056, which are\n\tall related to the PICT writer. (Credit to OSS-Fuzz)\n\n\t* magick/draw.c (DrawGetStrokeDashArray): Check for failure to\n\tallocate memory.  Patch submited by Petr Gajdos via email on\n\tFebruary 28, 2018.\n\n2018-02-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/fits.c (ReadFITSImage): Fix signed integer overflow when\n\tcomputing pixels size.  Fixes oss-fuzz 6586\n\t\"graphicsmagick/coder_FITS_fuzzer: Integer-overflow in\n\tReadFITSImage\". (Credit to OSS-Fuzz)\n\n2018-02-27  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement, SVGEndElement): From the\n\tSVG spec:  \"The 'foreignObject' element allows for inclusion\n\tof a foreign namespace which has its graphical content drawn\n\tby a different user agent.\"  Code has been added to consume\n\tand discard the 'foreignObject' element and any settings (e.g.,\n\tfill color) internal to it.  Previously, settings internal\n\tto the 'foreignObject' element would persist and \"leak\" into\n\tthe graphic elements that followed it, resulting in undesired\n\tside effects (e.g., fill color other than the expected default).\n\n2018-02-27  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (DrawPolygonPrimitive): Fixed a bug\n\tintroduced by changeset 39102dd1d456.  For SVG, this\n\tchangeset applied both the group AND the fill opacity\n\tvalues to fill patterns (similarly for stroke).  For WMF,\n\thowever, this caused the fill pattern to be rendered as\n\t100% transparent.  A closer reading of the SVG spec does\n\tNOT show that the fill opacity should be applied to the\n\tfill pattern, so as of this latest changeset only the group\n\topacity value is applied to fill and stroke patterns.\n\n2018-02-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (ReadBMPImage): Fix divide by zero regression added\n\tby latest fixes.  Fixes oss-fuzz 6583\n\t\"graphicsmagick/coder_BMP_fuzzer: Divide-by-zero in ReadBMPImage\".\n\t(Credit to OSS-Fuzz)\n\n2018-02-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (ReadPICTImage): Validate that PICT rectangles do\n\tnot have zero dimensions.  Specify expected file type when reading\n\tfrom a temporary file.  Trace PICT rectangle dimensions.  More\n\tdetection of blob EOF and more error handling.  Fixes oss-fuzz\n\tissue 6193 \"graphicsmagick/coder_PCT_fuzzer: Unknown signal in\n\tAllocateImageColormap\" and likely many oss-fuzz ASAN/UBSAN issues\n\treported against \"PCT\" and \"PICT\" since this one problem appears\n\tto be causing a spew of reports.\n\n\t* coders/png.c (ReadMNGImage): Detect and handle failure to\n\tallocate global PLTE.  Problem was reported via email from Petr\n\tGajdos on February 26, 2018.\n\n2018-02-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/blob.c (ReadBlobLSBDouble): Make sure imported double is\n\ta normal value.\n\t(ReadBlobLSBDoubles): Make sure imported doubles are normal\n\tvalues.\n\t(ReadBlobLSBFloat): Make sure imported float is a normal value.\n\t(ReadBlobLSBFloats): Make sure imported floats are normal values.\n\t(ReadBlobMSBFloat): Make sure imported float is a normal value.\n\t(ReadBlobMSBFloats): Make sure imported floats are normal values.\n\t(ReadBlobMSBDouble): Make sure imported double is a normal value.\n\t(ReadBlobMSBDoubles): Make sure imported doubles are normal\n\tvalues.\n\n\t* magick/import.c (ImportFloat32Quantum): Make sure imported float\n\tis a normal value.\n\t(ImportFloat64Quantum): Make sure imported double is a normal\n\tvalue.\n\n\t* magick/image.h (RoundDoubleToQuantum): Restore previous behavior\n\t(from earlier today).\n\t(RoundFloatToQuantum): Restore previous behavior (from earlier\n\ttoday).\n\n\t* coders/bmp.c (ReadBMPImage): Fix UBSAN runtime error: left shift\n\tof 205 by 24 places cannot be represented in type 'int'.\n\n\t* coders/ept.c (ReadEPTImage): Fix dereference of NULL pointer\n\twhich was detected by UBSAN in the test suite.\n\n\t* magick/image.h (RoundDoubleToQuantum): Check double value for\n\tNaN and infinity in order to avoid undefined behavior.\n\t(RoundFloatToQuantum): Check float value for NaN and infinity in\n\torder to avoid undefined behavior.\n\n\t* magick/common.h (MAGICK_ISNAN): Add a isnan() wrapper macro.\n\t(MAGICK_ISINF): Add a isinf() wrapper macro.\n\n2018-02-25  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Fix oss-fuzz issue 6273 - Heap-use-after-free in\n\tGetLocaleExceptionMessage. (Credit to OSS-Fuzz)\n\n2018-02-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (DCM_PostRescaleImage): Remove use of\n\tDCM_PostRescaleImage() since its implementation is wrong and\n\taccesses non-allocated heap memory.  Problem was reported by Petr\n\tGajdos via email on February 8, 2018.\n\n\t* coders/jp2.c (ReadJP2Image): Use a ThrowJP2ReaderException macro\n\tto automatically clean up when throwing an exception.\n\n\t* coders/bmp.c (ReadBMPImage): Report an error if RLE decode does\n\tnot produce the expected number of bytes.  Fixes oss-fuzz issue\n\t6015 \"graphicsmagick/coder_BMP_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_BMP_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-02-23  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (DrawImage): Fixed a bug in which graphical\n\telements defined within <defs> ... </defs> were being rendered,\n\tcontrary to the SVG spec.\n\n2018-02-23  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (DrawPolygonPrimitive): When filling or\n\tstroking a polygon using a pattern, the fill (or stroke)\n\tand group/object opacity values were not being applied to\n\tthe pattern (fixed).\n\n2018-02-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (ReadBMPImage): Fix SeekBlob() return value checks.\n\tAdd more EOF checks.  Require that a provided ba_offset be a\n\tforward seek in order to avoid the possibility of endless looping.\n\n2018-02-23  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Fix oss-fuzz issue 6301. (Credit to OSS-Fuzz)\n\n2018-02-22  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/alpha_composite.c (BlendQuantumOpacity): The\n\tpixel compositing equation used when compositing an\n\timage into the output was incorrect and has been fixed.\n\n\t* magick/render.c (DrawPolygonPrimitive): When\n\tcompositing polygon edge pixels over a transparent\n\tblack background, the code would composite as if the\n\tbackground were opaque black, resulting in the edge\n\tpixels being too dark (fixed).\n\n2018-02-21  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (DrawImage): Per the SVG spec, opacity,\n\tfill-opacity, and stroke-opacity values are now clamped\n\tto [0,1].\n\n\tAlso fixed two bugs introduced by changeset 91de8039f27d\n\t(dated 2018-02-12): (1) a group/object opacity value\n\tspecified using a percentage was not being converted to a\n\tvalue in [0,1]; (2) if fill-opacity or stroke-opacity was\n\t1, and the group/object opacity value was set to 1, the\n\tresulting fill-opacity or stroke-opacity value would be\n\tset to 0 instead of 1.\n\t\n2018-02-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/viff.c (ReadVIFFImage): Fix excessive memory usage.\n\tFixes oss-fuzz 6006 \"graphicsmagick/coder_XV_fuzzer: Out-of-memory\n\tin graphicsmagick_coder_XV_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/txt.c (ReadInt): Avoid benign signed integer overflow due\n\tto accepting an arbitrary number of digits.  Fixes oss-fuzz 6002\n\t\"graphicsmagick/coder_TEXT_fuzzer: Integer-overflow in\n\tReadInt\". (Credit to OSS-Fuzz)\n\n\t* coders/viff.c (ReadVIFFImage): Verify that there is sufficient\n\tdata to back up colormap allocation request.  Fixes oss-fuzz 5986\n\t\"graphicsmagick/coder_VIFF_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_VIFF_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* magick/memory.c: Define MAGICK_MEMORY_HARD_LIMIT=value to abort\n\twhen memory request exceeds value.  Useful to find location of\n\texcessive memory requests.\n\n2018-02-19  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement): Per the SVG spec, the\n\tSVG coder now initializes the MVG coder (which renders\n\tSVG graphical elements) with the the SVG defaults for\n\tfill color, fill-opacity, stroke color, stroke-opacity,\n\tand stroke-width.  This makes the SVG coder independent\n\tof the MVG coder intial state.\n\n2018-02-19  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement): Fixed initialization of\n\tx and y attributes per the SVG spec:  for graphical elements\n\t\"image\", \"pattern\", \"text\", \"rect\", and \"use\", if the x or y\n\tattribute is not specified, the effect is as if a value of\n\t\"0\" were specified.\n\n2018-02-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/sun.c (ReadSUNImage): Fix edge case which broke file-size\n\tvalidation logic.  Fixes oss-fuzz issue 5981\n\t\"graphicsmagick/coder_SUN_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_SUN_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/txt.c (ReadTXTImage): Validate that file size is\n\tsufficient for claimed image properties.  Fixes oss-fuzz issue\n\t5960 \"graphicsmagick/coder_TXT_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_TXT_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/tga.c (ReadTGAImage): Only allow 1 and 8 bit\n\tcolormapped/grey images. Fixes oss-fuzz issue 6314\n\t\"graphicsmagick/coder_ICB_fuzzer: Undefined-shift in\n\tReadTGAImage\". (Credit to OSS-Fuzz)\n\n\t* coders/bmp.c (ReadBMPImage): Detect and report when BMP height\n\tvalue is out of range (too negative). Fixes oss-fuzz issue 6394\n\t\"graphicsmagick/coder_BMP_fuzzer: Integer-overflow in\n\tReadBMPImage\". (Credit to OSS-Fuzz)\n\n\t* coders/rla.c (ReadRLAImage): Detect when RLE decoding is\n\tproducing too many samples and report as an error.  Fixes oss-fuzz\n\tissue 6312 \"graphicsmagick/coder_RLA_fuzzer: Timeout in\n\tgraphicsmagick_coder_RLA_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/fits.c (ReadFITSImage): Validate that file size is\n\tsufficient for claimed image properties.  Fixes oss-fuzz issue\n\t6429 \"graphicsmagick/coder_FITS_fuzzer: Timeout in\n\tgraphicsmagick_coder_FITS_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* magick/image.c (CloneImage): Check image pixel limits in\n\tCloneImage() when it is used to change the image dimensions.  This\n\tavoids depending on the using code to detect and report such\n\tissues.\n\n\t* coders/xcf.c (ReadXCFImage): Check image pixel limits after each\n\tCloneImage() to assure that image is within specified resource\n\tlimits.  Fixes oss-fuzz issue 6399 \"graphicsmagick/enhance_fuzzer:\n\tTimeout in graphicsmagick_enhance_fuzzer\". (Credit to OSS-Fuzz)\n\n2018-02-16  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (TracePath): TracePath() was not\n\tcorrectly processing multiple sets of cubic or quadratic\n\tBezier coordinates when the previous path data command was\n\tnot a cubic or quadratic Bezier command.  This would result\n\tin the first control point being equal to the current path\n\tpoint instead of being computed using the current path\n\tpoint and the second control point of the previous Bezier\n\tcommand.\n\n2018-02-15  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (TracePath): TracePath() was not\n\tconsuming commas (if present) at the end of a set of\n\tpoints when multiple sets of points were specified for\n\tvarious path commands (e.g., line, Bezier). This\n\tresulted in the remaining sets of points being ignored\n\t(fixed).\n\n2018-02-15  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (TraceArcPath): No points are generated\n\tby TraceArcPath() if the starting and ending arc points\n\tare the same.  For this case, the coordinate count was not\n\tbeing set to zero before returning (fixed).\n\n2018-02-15  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (DrawImage): Clipping of polygons in\n\tDrawImage() would sometime result in a starting pixel\n\tlocation that was greater than the ending pixel location,\n\tcausing a subsequent call to GetImagePixelsEx() to fail\n\tdue a column count <= 0.  Modified the clipping code to\n\teliminate this condition, and also to return early if\n\tthe polygon lies completely outside the image boundaries.\n\tAlso fixed variable declarations from a previous commit\n\tthat were causing problems for the C89 compiler.\n\n2018-02-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/topol.c (ReadTOPOLImage): Detect EOF immediately rather\n\tthan spinning.  Fixes oss-fuzz issue 6303\n\t\"graphicsmagick/coder_TOPOL_fuzzer: Timeout in\n\tgraphicsmagick_coder_TOPOL_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/dcm.c (DCM_SetupRescaleMap): Avoid excessive left shift.\n\tFixes oss-fuzz issue 6256 \"graphicsmagick/coder_DCM_fuzzer:\n\tUndefined-shift in DCM_SetupRescaleMap\". (Credit to OSS-Fuzz)\n\n2018-02-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c (ExtractPostscript): Detect EOF on input while\n\ttransferring bytes to Postscript file.  Fixes oss-fuzz issue 6087\n\t\"graphicsmagick/coder_WPG_fuzzer: NULL\".  Later identified to be\n\tCVE-2017-17682 as previously discovered in ImageMagick.  (Credit to\n\tOSS-Fuzz)\n\n\t* coders/pdb.c (ReadPDBImage): Quit attempting to read image data\n\timmediately at EOF. Fixes oss-fuzz issue 6252\n\t\"graphicsmagick/coder_PDB_fuzzer: Timeout in\n\tgraphicsmagick_coder_PDB_fuzzer\".  (Credit to OSS-Fuzz)\n\n2018-02-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/topol.c (ReadTOPOLImage): Avoid index out of bounds when\n\tinput filename does not use a file extension. Fixes oss-fuzz issue\n\t6237 \"graphicsmagick/coder_TOPOL_fuzzer: Index-out-of-bounds in\n\tReadTOPOLImage\".  (Credit to OSS-Fuzz)\n\n2018-02-12  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (DrawImage): Object/group opacity,\n\twhen set in DrawImage(), would overwrite the fill\n\tand stroke opacities. This has been fixed so that\n\tthe object opacity is now combined with the fill\n\tand stroke opacities per the SVG spec.\n\n2018-02-12  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/mat.c Fix oss-fuzz issue 6021. (Credit to OSS-Fuzz)\n\n2018-02-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c (ReadDCMImage): Avoid undefined left shift of\n\tshort.  Fix memory leaks in error reporting paths.  Fixes oss-fuzz\n\tissue 6217 \"graphicsmagick/coder_DCM_fuzzer: Undefined-shift in\n\tReadDCMImage\". (Credit to OSS-Fuzz)\n\n\t* coders/dpx.c (ReadDPXImage): Avoid divide by zero exception in\n\tthe case where reference high equals reference low. Fixes oss-fuzz\n\tissue 6215 \"graphicsmagick/coder_DPX_fuzzer: Divide-by-zero in\n\tReadDPXImage\". (Credit to OSS-Fuzz)\n\n\t* coders/topol.c (ReadTOPOLImage): Avoid index out of bounds when\n\tinput filename does not use a file extension.\n\n\t* coders/cut.c (ReadCUTImage): Avoid index out of bounds when\n\tinput filename does not use a file extension. Fixes oss-fuzz issue\n\t6218 \"graphicsmagick/coder_CUT_fuzzer: Index-out-of-bounds in\n\tReadCUTImage\".  (Credit to OSS-Fuzz)\n\n\t* coders/pwp.c (ReadPWPImage): Force temporary file to be read as\n\ta SFW file rather than autodetecting the format.  Fixes oss-fuzz\n\tissue 6220 \"graphicsmagick/coder_PWP_fuzzer: Indirect-leak in\n\tAllocateImage\".  (Credit to OSS-Fuzz)\n\n2018-02-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Assure that xref memory is not\n\tleaked if an exception is thrown.  Fixes oss-fuzz issue 5968\n\t\"graphicsmagick/coder_EPDF_fuzzer: Direct-leak in MagickRealloc\".\n\t(Credit to OSS-Fuzz)\n\n\t* coders/tim.c (ReadTIMImage): Verify that 4/8 bit PSX TIM\n\tprovides a CLUT and verify indexes.  Fixes oss-fuzz issue 5972\n\t\"graphicsmagick/coder_TIM_fuzzer: Null-dereference WRITE in\n\tReadTIMImage\".  (Credit to OSS-Fuzz)\n\n\t* coders/topol.c (ReadTOPOLImage): Add additional header\n\tvalidations.  Fixes oss-fuzz issue 5975\n\t\"graphicsmagick/coder_TOPOL_fuzzer: Floating-point-exception in\n\tReadTOPOLImage\".  (Credit to OSS-Fuzz)\n\n\t* coders/bmp.c (ReadBMPImage): Avoid possible division by zero\n\twhen decoding CIE primary values. (Credit to OSS-Fuzz)\n\n\t* magick/export.c (ExportViewPixelArea): Only compute\n\tunsigned_maxvalue if sample_bits <= 32.\n\n\t* magick/import.c (ImportViewPixelArea): Assure that\n\tdouble_maxvalue minus double_minvalue is not zero, or excessively\n\tclose to zero to avoid divide by zero exception or impossible\n\tscaling factor. (Credit to OSS-Fuzz)\n\t(ImportViewPixelArea): Only compute unsigned_maxvalue if\n\tsample_bits <= 32.\n\n2018-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dib.c (ReadDIBImage): Validate that image width is not\n\ttoo negative such that it's absolute value can not fit in 32-bit\n\tunsigned width. Resolves oss-fuzz issue 6179\n\t\"graphicsmagick/coder_ICO_fuzzer: Integer-overflow in\n\tReadDIBImage\". (Credit to OSS-Fuzz)\n\n\t* coders/dcm.c (funcDCM_BitsStored): Validate DICOM datum size.\n\tUse a different means to determine the maximum value which does\n\tnot use excessive shifting.  Resolves oss-fuzz issue 6165\n\t\"graphicsmagick/coder_DCM_fuzzer: Undefined-shift in\n\tfuncDCM_BitsStored\". (Credit to OSS-Fuzz)\n\n2018-02-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dpx.c (ReadWordU32BE): Add casts to avoid default type\n\tpromotion from unsigned char to 'int' leading to undefined\n\tbehavior for 24 bit shift. Fixes oss-fuzz issue 6058\n\t\"graphicsmagick/coder_DPX_fuzzer: Undefined-shift in\n\tReadWordU32BE\". (Credit to OSS-Fuzz)\n\t(ReadDPXImage): Require that the file has at least one element.\n\tAdd bountiful casts for values which are left-shifted.  Fixes\n\toss-fuzz issue 5962 \"graphicsmagick/coder_DPX_fuzzer:\n\tUndefined-shift in ReadDPXImage\". (Credit to OSS-Fuzz)\n\n\t* coders/dcm.c (DCM_ReadOffsetTable): Add casts Add casts to avoid\n\tdefault type promotion from unsigned char to 'int' leading to\n\tundefined behavior for 16 bit shift. Fixes oss-fuzz issue 5980\n\t\"graphicsmagick/coder_DCM_fuzzer: Undefined-shift in\n\tDCM_ReadOffsetTable\". (Credit to OSS-Fuzz)\n\n\t* magick/module_aliases.h (ModuleAliases): Add missing mapping\n\tfrom \"ICODIB\" format to \"DIB\" module.\n\n\t* magick/import.c (ImportUInt32Quantum): Add casts to avoid\n\tdefault type promotion from unsigned char to 'int' leading to\n\tundefined behavior for 24 bit shift.  Fixes oss-fuzz\n\t\"graphicsmagick/coder_P7_fuzzer: Undefined-shift in\n\tImportRGBQuantumType\". (Credit to OSS-Fuzz)\n\n2018-02-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Fix oss-fuzz issue 5964\n\t\"graphicsmagick/coder_MAT_fuzzer: Heap-use-after-free in\n\tGetLocaleExceptionMessage\". (Credit to OSS-Fuzz)\n\n2018-02-07\tGreg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/render.c (IsPoint): Fixed a bug in which\n\tIsPoint() would reject as a valid coordinate value\n\tstrings that did not begin with an integer: e.g.,\n\t\"0.25\" would be accepted, but \".25\" would not.\n\n2018-02-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/cut.c (ReadCUTImage): Fix DestroyImageInfo() of NULL\n\tpointer leading to assertion.  Fixes oss-fuzz issue 6067\n\t\"graphicsmagick/coder_CUT_fuzzer: Unknown signal in\n\tDestroyImageInfo\".\n\n\t* coders/tga.c (ReadTGAImage): Throw exception rather than\n\tassertion for unexpected comment size.  Fixes oss-fuzz issue 5961\n\t\"graphicsmagick/coder_ICB_fuzzer: ASSERT: (size_t)\n\t(tga_info.id_length+1) == commentsize\".\n\n2018-02-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Free 'xref' allocation before\n\terror return.  Fixes oss-fuzz issue 5968\n\t\"graphicsmagick/coder_EPDF_fuzzer: Direct-leak in MagickRealloc\".\n\n2018-02-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdb.c (ReadPDBImage): Fix heap buffer overflow if blob is\n\talready at EOF when comment is read.  Fixes oss-fuzz issue 5997\n\t\"graphicsmagick/coder_PDB_fuzzer: Heap-buffer-overflow in\n\tSetImageAttribute\".\n\n\t* coders/dpx.c (ReadDPXImage): Fix memory leak of user data if\n\tuser data is truncated.  Fix consumption of one uninitialized\n\tstack bytes.  Fixes oss-fuzz issue 5973:\n\tgraphicsmagick/enhance_fuzzer: Direct-leak in ReadDPXImage.\n\n\t* coders/pnm.c (ReadPNMImage): Detect and avoid division by zero.\n\tFixes Issue 5959 in oss-fuzz: graphicsmagick/coder_P7_fuzzer:\n\tDivide-by-zero in ReadPNMImage\n\n\t* magick/xwindow.c (MagickXClientMessage): Eliminate valgrind\n\tgripe about use of uninitialized stack data by clearing allocation\n\tto zero.\n\t(MagickXMakeImage): Eliminate valgrind gripe about use of\n\tuninitialized heap data by clearing allocation to zero.\n\n\t* coders/pwp.c (ReadPWPImage): Remove bogus EOF test on an image\n\twith a closed blob.  Fixes Issue 5957 in oss-fuzz:\n\tgraphicsmagick/coder_PWP_fuzzer: ASSERT: image->blob->type !=\n\tUndefinedStream.\n\n\t* www/Changes.rst: Fix typo with spelling \"ChangeLog-2017.html\".\n\tResolves SourceForge issue #544 \"dead link 2017 changelog page on\n\tGraphicsMagick web site\".\n\n2018-02-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/static.c (OpenModule): Assure that status is initialized.\n\tResolves Coverity 261207 \"Uninitialized scalar variable\".\n\n\t* wand/magick_wand.c (MagickHasColormap): New function to test if\n\tthe image has a colormap.\n\t(MagickIsGrayImage): New function to test if the image uses only\n\tgray pixels.\n\t(MagickIsMonochromeImage): New function to test if the image uses\n\tonly monochrome pixels.\n\t(MagickIsOpaqueImage): New function to test if the image uses only\n\topaque pixels.\n\t(MagickIsPaletteImage): New function to test if the image is based\n\ton a color palette.  Above functions are written by Troy Patteson\n\tand submitted via SourceForge patch #54 \"Wand API patches: has\n\tcolormap, is gray image, is monochrome image, is opaque image, is\n\tpalette image\".\n\n\t* fuzzing: Added initial OSS-Fuzz integration by Alex Gaynor.\n\tFrom SourceForge patch #55 \"OSS-Fuzz integration\"\n\n\t* coders/png.c (ReadMNGImage): Fix free using possibly unallocated\n\tpointer value.\n\n\t* magick/blob.c (SeekBlob): Remove implicit extension of blob\n\tallocation size based on seek offset.  Besides making an\n\tassumption about how the blob memory was allocated, this\n\treallocation feature provides a memory DOS opportunity.  Resolves\n\tissue reported by Alex Gaynor via email entitled \"Security issue\n\twith memory management in Magick++\" to the graphicsmagick-security\n\tlist on 31 Jan 2018.\n\t(SeekBlob):\n\n\t* coders/jpeg.c (ReadIPTCProfile): Revert inadvertent wrong return\n\tcodes added by change on December 9, 2017.  Fixes SourceForge bug\n\t542 \"Improper call to JPEG library in state 201\" since 1.3.28.\n\n2018-02-01  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/annotate.c (RenderFreetype): Fixed the text\n\topacity computation in RenderFreeType(). This bug caused\n\tthe text fill color to bleed into the character cell when\n\tthe SVG \"fill-opacity\" is less than 1.0.\n\n2018-02-01  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* magick/attribute.c (CloneImageAttributes): Fixed a bug\n\tin which the source image attributes would always replace\n\tthe destination image attributes instead of being appended\n\tto them, and the destination image attributes would become\n\ta memory leak.\n\n2018-01-31  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement): Fixed a bug in which the\n\tx,y location values for a <text> or <tspan> were overwritten\n\tby the x,y values for the next <tspan> before the previous\n\tvalues were used.  This caused the text associated with the\n\tprevious <text> or <tspan> to appear at the location\n\tspecified for the next <tspan>.\n\n2018-01-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/static.c: Use !defined(SupportMagickModules) to enable\n\tstatic module loader.  Fixes SourceForge bug #543 \"Multiple\n\tdefinition of \"OpenModule\" (etc) when cross-compiling shared\".\n\n2018-01-29  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement): A terminating '>' in\n\ta geometry string is interpreted to mean that the dimensions\n\tof an image should only be changed if its width or height\n\texceeds the geometry specification.  For an unapparent and\n\tundocumented reason, a terminating '>', if present, was\n\tbeing nulled out, making this feature unusable for SVG files\n\t(now fixed).\n\n2018-01-29  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (ReadSVGImage): If there is a geometry string\n\tin image_info->size (e.g., gm convert -size \"50x50%\" in.svg\n\tout.png), AllocateImage() sets image->columns and image->rows\n\tto the width and height values from the size string.  However,\n\tthis makes no sense if the size string was something like\n\t\"50x50%\" (we'll get columns = rows = 50).  So we set columns\n\tand rows to 0 after AllocateImage(), which is the same as if\n\tno size string was supplied by the client.  This also results\n\tin svg_info.bounds to be set to 0,0 (i.e., unknown), so that\n\tsvg_info.bounds will later be set using the image size\n\tinformation from either the svg \"canvas\" width/height or from\n\tthe viewbox.  Later, variable \"page\" is set from\n\tsvg_info->bounds. Then the geometry string in image_info->size\n\tgets applied to the (now known) \"page\" width and height when\n\tSvgStartElement() calls GetMagickGeometry(), and the intended\n\tresult is obtained.\n\n\n2018-01-24  Greg Wolfe  <gregory.wolfe@kodakalaris.com>\n\n\t* coders/svg.c (SVGStartElement): When the density (DPI)\n\tis specified using the ImageInfo::density member, the derived\n\tscale factor is incorrectly applied a second time to the\n\twidth and height members of variable RectangleInfo page.\n\tFixes SourceForge ticket #451.\n\n2018-01-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/static.c: Use a lazy-loader for static modules with the\n\tsame external interface as the lazy-loader for dynamic modules.\n\n2018-01-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Prepare for 1.3.28 release.\n\n2018-01-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update with changes since previous release.\n\n2018-01-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* PerlMagick/Magick.xs: Compiler warnings reduction.\n\n\t* magick/pixel_cache.h: Mark GetPixels(), GetIndexes(), and\n\tGetOnePixel() as deprecated.  Compilers may produce a warning if\n\tthese functions are used.\n\n\t* magick/pixel_cache.c (InterpolateColor): Return black pixel if\n\tInterpolateViewColor() reports failure.\n\n\t* coders/png.c (ReadMNGImage): Fix memory leak of chunk and\n\tmng_info in error path.\n\n\t* coders/gif.c (ReadGIFImage): Fix memory leak of global colormap.\n\n2018-01-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/symbols.h: Fix SourceForge issue #538 \"13 symbols in\n\tcommon with ImageMagick despite --enable-symbol-prefix\".\n\n\t* coders/bmp.c (ReadBMPImage): Fix non-terminal loop due to\n\tunexpected bit-field mask value.  Fixes SourceForge issue #541\n\t\"Infinite Loop in ReadBMPImage (coders/bmp.c)\".\n\n\t* coders/jpeg.c (JPEGMessageHandler): Revert code added on\n\t2017-07-08 to promote certain warnings from libjpeg to errors.\n\tAdd code to rationalize claimed image dimensions based on file\n\tsize.  Resolves SourceForge issue #539 \"Images with libjpeg\n\twarnings result in error\".\n\n2018-01-11  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* coders/wpg.c Recursive ReadImage could return multiple scenes\n          fixed.\n\n2018-01-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadOnePNGImage): Quit 'passes' loop if we\n\tencountered an error\n\n\t* magick/pixel_cache.c (SetNexus): Fix heap overwrite in\n\tAcquireCacheNexus() due to SetNexus() not using an allocated\n\tstaging area for the pixels like it should.  This problem impacts\n\tall 1.3.X releases.  Resolves SourceForge issues 532\n\t\"heap-buffer-overflow bug in ReadWPGImage\" and #531\n\t\"heap-buffer-overflow in AcquireCacheNexus\".\n\n\t* magick/pixel_cache.c (InterpolateViewColor): Now returns\n\tMagickPassFail rather than void.  Code using this function is\n\tupdated to check the return status.\n\n2018-01-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/describe.c (DescribeImage): Discriminate between\n\tAcquireImagePixels() returning NULL or finding a transparent\n\tpixel.  This avoids use of a null pointer in the case where\n\tAcquireImagePixels() returns NULL.\n\n2017-12-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/static.c: Change static module initialization to be based\n\ton an initialized list rather than a squence of function calls in\n\torder to simplify maintenance and possibly address future\n\trequirements.\n\n2017-12-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Copyright.txt: Bump copyright years and rotate ChangeLog.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/ChangeLog.2019",
    "content": "2019-12-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/gradient.c (ReadGRADIENTImage): QueryColorDatabase() only\n\tthrows a warning so allow the warning to propagate to the user\n\trather than failing to report a useful message at all.\n\n2019-12-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gradient.c (GradientImage): OpenMP portability requires\n\tthat loop variable be signed.\n\n2019-12-30  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* magick/gradient.c: Visual studio does not compile file without\n\tthis fix.\n\n2019-12-30  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* VisualMagick\\configure\\configure.cpp Add option for speed optimisation\n\tto achieve better performance.\n\n2019-12-29  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/version.h.in: Bump copyright years.\n\n\t* magick/image.c (DisplayImages): Fix return status.  Was\n\treturning inverted return status.\n\n\t* coders/gradient.c (ReadGRADIENTImage): Support the\n\t\"gradient:direction\" definition to produce produce additional\n\tgradient vector directions corresponding to South, North, West,\n\tEast, NorthWest, NorthEast, SouthWest, and SouthEast.  This\n\tsupport is similar to a useful feature added in ImageMagick\n\t6.9.2.5 although there is no claim that the results are identical,\n\teven if the resulting images appear to be visually\n\tindistinguishable.\n\n\t* magick/gradient.c (GradientImage): Add support for using the\n\timage 'gravity' attribute to produce additional gradient vector\n\tdirections corresponding to SouthGravity (the previously-existing\n\tdefault), NorthGravity, WestGravity, EastGravity,\n\tNorthWestGravity, NorthEastGravity, SouthWestGravity, and\n\tSouthEastGravity.  Gradient images are updated to be PseudoClass\n\t(color-mapped), if possible.\n\n2019-12-28  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/gradient.c (GradientImage): Output PseudoClass images if\n\twe can.\n\n\t* coders/pcx.c (WritePCXImage): Fix heap overflow in PCX writer\n\twhen bytes per line value overflows its 16-bit storage unit.\n\tFixes SourceForge bug #619 \"heap-buffer-overflow in WritePCXImage\"\n\treported by Suhwan Song.\n\n\t* magick/gradient.c (GradientImage): Gradient levels were still\n\tnot spot-on.  Now they are.  Unfortunately, this necessitated\n\tre-generating reference test images based on gradient since the\n\tgradient output has changed a little bit more than the test error\n\tmargins allow.\n\n2019-12-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Test gradient image resource limits\n\tusing the proper API.\n\n\t* magick/resource.c (ResourceInfinity): Fix definition of\n\tResourceInfinity.  Due to parenthesis in the wrong place, the\n\tdefined value was -1 rather than the maximum range value.  The\n\teffect of this is that GetMagickResource() would return -1 rather\n\tthan the maximum range value for the return type as documented.\n\tRegression was added on Saturday, March 09, 2019 in the 1.3.32\n\trelease via changeset 15927:a5318823758c.\n\n\t* tests/rwfile.c (main): Allow Ghostscript supported formats to be\n\ta bit lossy.\n\n\t* tests/rwblob.c (main): Allow Ghostscript supported formats to be\n\ta bit lossy.\n\n\t* magick/gradient.c (GradientImage): Compute blending alpha with\n\tdouble precision for more precision.\n\n2019-12-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updates in preparation for 1.3.34 release.\n\n2019-12-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update with changes since the last GM release.\n\n\t* coders/png.c (png_read_raw_profile): Use size_t type to store\n\tprofile length and 'nibbles'.  Use safer way to test for profile\n\tbuffer overflow.\n\t(ReadOnePNGImage): Use size_t type to store 'ping_rowbytes',\n\t'length', and 'row_offset'.  Check png_pixels allocation for\n\tarithemetic overflow when computing the required allocation size.\n\n\t* coders/tiff.c (WriteNewsProfile): Use size_t type to store\n\tprofile length.\n\n\t* coders/pict.c (WritePICTImage): Avoid 'alloc-size-larger-than'\n\twarning from GCC when allocating row_bytes.\n\n2019-12-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* tiff/libtiff/tiffconf.h: Add standard/common libtiff 'SUPPORT'\n\toptions which are used in full-fledged Autoconf/Cmake libtiff\n\tbuilds but were missing from the Visual C template file.  In\n\tparticular, WebP is now supported and JBIG is somewhat supported.\n\n\t* VisualMagick/jbig/libjbig/LIBRARY.txt (EXCLUDE): Remove\n\ttstcodec85.c from JBIG library build.\n\n\t* VisualMagick/configure/configure.cpp: Add JBIG library to\n\tinclude path when building libraries.  Add WebP as a dependency\n\twhen building libtiff.\n\n2019-12-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.h (\"C\"): Assume that float versions of functions\n\tbecame available in Visual Studio 2008.\n\n2019-12-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (InitializeLogInfo): Using the compiled-in\n\tdefaults, always log to stderr by default, even under Microsoft\n\tWindows.  The logging output may then be diverted to\n\t'win32eventlog' as soon as a log.mgk file is loaded if that is\n\tdesired.  This should not be much of a problem because loading a\n\tlog.mgk file is the first thing that the library attempts to do.\n\tThis change is made due to users and developers being baffled at\n\tnot seeing any log output due to the log output going to the (very\n\tunfriendly) Windows application log.\n\n\t* webp: libwebp is updated to the 1.0.3 release.\n\n2019-12-15  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* magick/nt_base.c Fix user only installation of Ghostscript.\n\n2019-12-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* rungm.sh.in (DIRSEP): DIRSEP should always use Unix conventions for\n\tAutotools-based builds.\n\n\t* magick/module.h (\"C\"): Eliminiate redundant and conflicting\n\tListModuleInfo() prototype.\n\n\t* coders/miff.c (ReadMIFFImage): Eliminate warnings in trace\n\tstatements.\n\n\t* coders/dib.c (DecodeImage): Eliminate warnings in trace\n\tstatements.\n\n\t* coders/bmp.c (DecodeImage): Eliminate warnings in trace\n\tstatements.\n\n\t* magick/studio.h (SupportMagickModules): Fix the preprocessor\n\tlogic controlling SupportMagickModules, which became broken for\n\tGCC MinGW-based builds starting in the 1.3.29 release when a\n\t\"static\" module loader was implemented.  Due to an error in the\n\tpreprocessor logic, only the \"modules\" based build was working for\n\tMinGW.  Much thanks to Giovanni Remigi for making us aware of this\n\tissue.\n\n2019-12-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (WritePICTImage): Throw a writer exception if the\n\tPICT width limit is exceeded. Fixes SourceForge issue 617\n\t\"heap-buffer-overflow in function EncodeImage of coders/pict.c\".\n\n2019-12-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* jbig: jbigkit is updated to 2.1 release.\n\n\t* libxml: libxml2 is updated to 2.9.10 release.\n\n\t* bzlib: bzip is updated to 1.0.8 release.\n\n\t* zlib: zlib is updated to 1.2.11 release.\n\n\t* png: libpng is updated to 1.6.37 release.\n\n2019-12-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* lcms: lcms2 is updated to 2.9 release.\n\n\t* tiff: libtiff is updated to 4.1.0 release.\n\n2019-11-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawPatternPath): Don't leak memory if\n\tfill_pattern or stroke_pattern of cloned draw_info are not null.\n\tFixes oss-fuzz issue 18948 \"graphicsmagick:coder_MVG_fuzzer:\n\tIndirect-leak in CloneImage\".\n\t(PrimitiveInfoRealloc): Clear freshly-allocated PrimitiveInfo\n\tmemory.\n\n2019-11-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Fix oss-fuzz issue\n\t17986 \"graphicsmagick:coder_JPG_fuzzer: Heap-buffer-overflow in\n\tGenerateEXIFAttribute\".  This problem likely only happens in\n\t32-bit builds.\n\n2019-11-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Only magnify the image if the\n\trequested magnification methods are supported.\n\n2019-11-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/compress.c (HuffmanDecodeImage): Fix signed overflow on\n\trange check which leads to heap overflow in 32-bit\n\tapplications. Requires a relatively large file input compared with\n\ttypical fuzzer files (greater than a megabyte) to trigger.\n\tProblem reported to the graphicsmagick-security mail address by\n\tJustin Tripp on 2019-11-13.\n\t(Ascii85Tuple): Fix thread safety issue by requiring caller to\n\tpass in tuple buffer as an argument and having callers allocate\n\ttuple buffer on the stack.\n\n2019-11-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/bit_stream.c: Add restrict declarations to slightly\n\timprove performance and decrease code size.\n\n\t* TclMagick/pkgIndex.tcl: Incorporate recommendations from third\n\tproblem noted in SourceForge issue #420 \"TclMagick issues and\n\tpatch\".  This is supposed to help support using an uninstalled\n\tGraphicsMagick and allow the installation path to contain a space.\n\n\t* wand/magick_wand.c (MagickClearException): Destroy any existing\n\texception info before re-initializing the exception info or else\n\tthere will be a memory leak.\n\n\t* TclMagick/generic/libttkcommon.c (myMagickError): Clear\n\texception from the Wand after it has been reported.  Addresses the\n\tfourth problem noted by SourceForge issue #420 \"TclMagick issues\n\tand patch\".  However, MagickClearException() already clears an\n\texception in the Wand, so a new function is not needed.\n\n\t* TclMagick/unix/m4/tcl.m4: Change hard-coded INSTALL path to\n\tpoint to config/install-sh.  Re-generated/updated Autotools stuff\n\tby executing the genconf.sh script.  Addresses the first problem\n\tnoted by SourceForge issue #420 \"TclMagick issues and patch\".\n\n2019-11-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (SetNexus): Eliminate warning about\n\tpossibly uninitialized variable from primordial GCC 3.4.3.\n\n\t* magick/render.c (ConvertPrimitiveToPath): Eliminate warning that\n\tIsClosedSubPath might be used uninitialized.\n\n\t* magick/common.h (\"MAGICK_FALLTHROUGH\"): Added a\n\tMAGICK_FALLTHROUGH macro to support the GCC/Clang fallthrough\n\tattribute when the time comes again that it would be useful.\n\n2019-10-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pcx.c (ReadPCXImage): Verify that pixel region is not\n\tnegative. Assure that opacity channel is initialized to\n\topaqueOpacity.  Update DirectClass representation while\n\tPseudoClass representation is updated.  Improve read performance\n\twith uncompressed PCX.\n\n2019-10-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xpm.c (ReadXPMImage): Image properties are expected to\n\tappear within the first 512 bytes of the XPM file header.  fixes\n\toss-fuzz 18267 \"graphicsmagick:coder_PICON_fuzzer: Timeout in\n\tcoder_PICON_fuzzer\".\n\n2019-10-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Fix tcmalloc configuration report.\n\n2019-10-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c (ReadWPGImage): Implement subimage/subrange\n\tsupport.\n\n\t* coders/mat.c (ReadMATImage, ReadMATImageV4): Implement\n\tsubimage/subrange support.  Should resolve oss-fuzz 14999\n\t\"graphicsmagick/coder_MAT_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_MAT_fuzzer\".\n\n\t* coders/tiff.c (TIFFMapBlob): Fix compile problem if\n\tLOG_TIFF_BLOB_IO is defined.\n\n\t* coders/wpg.c (ExtractPostscript): Improve performance.  Avoid\n\ttemporary files if possible.  Avoid additional memory allocations\n\tif possible.  Should address oss-fuzz issue 18173\n\t\"graphicsmagick:enhance_fuzzer: Timeout in enhance_fuzzer\" and\n\toss-fuzz issue 17714 \"graphicsmagick:coder_WPG_fuzzer: Timeout in\n\tcoder_WPG_fuzzer\".\n\n2019-10-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pnm.c (PNMInteger): Place a generous arbitrary limit on\n\tthe amount of PNM comment text to avoid denial of service\n\topportunity.  Fixes oss-fuzz 18162 \"Timeout · coder_PNM_fuzzer\".\n\n2019-10-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dps.c (ReadDPSImage): Fix memory leak when OpenBlob()\n\treports failure.  Same as ImageMagick CVE CVE-2019-16709.\n\n2019-09-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Skip\n\tunsupported/invalid format 0.  Fixes oss-fuzz issue 17597\n\t\"graphicsmagick:coder_SFW_fuzzer: Heap-buffer-overflow in\n\tGenerateEXIFAttribute\".\n\n2019-09-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/oss-fuzz-build.sh: Change by Alex Gaynor so that the\n\tcorrect oss-fuzz fuzzing engine should be used.\n\n2019-09-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/static.c (OpenModule): Static module loader should use\n\tupper-cased magick string when searching for a module alias.\n\tFixes SourceForge issue #613 \"static module loader is still\n\tcase-sensitive\".\n\n2019-09-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Report status of zstd (FaceBook Zstandard)\n\tcompression in configuration summary.\n\n2019-09-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (TraceArcPath): Substitute a lineto command when\n\ttracing arc is impossible.  Fixes oss-fuzz 10765\n\t\"graphicsmagick/coder_MVG_fuzzer: Divide-by-zero in TraceArcPath\".\n\n2019-09-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (png_read_raw_profile): Fix validation of raw\n\tprofile length.  Fixes oss-fuzz 16906\n\t\"graphicsmagick:coder_ICO_fuzzer: Out-of-memory in\n\tgraphicsmagick_coder_ICO_fuzzer\".\n\n\t* coders/wpg.c (ReallocColormap): Avoid dereferencing a null\n\tpointer if image->colormap is null.  Fixes oss-fuzz 17004\n\t\"graphicsmagick:coder_WPG_fuzzer: Null-dereference READ in\n\tReallocColormap\".\n\n2019-09-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/memory.c (MagickRealloc): Add a note that the behavior of\n\tthis function is as described for BSD reallocf(3), which is now\n\tappearing in Linux's GNU libc and elsewhere.\n\n2019-09-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/OpenMP.rst: Document the significant OpenMP speed-up which\n\tmay be obtained by using an alternate memory allocation library.\n\tCurrently 'tcmalloc', 'mtmalloc', and 'umem' are supported as\n\toptions.\n\n\t* www/INSTALL-unix.rst: Document new --with-tcmalloc option to\n\tenable using Google gperftools tcmalloc library.\n\n\t* configure.ac: Add support for using Google gperftools tcmalloc\n\tlibrary via the --with-tcmalloc option.\n\n\t* scripts/rst2htmldeco.py: Port to Python 3 syntax and require at\n\tleast Python 2.6.\n\n\t* scripts/relpath.py: Port to Python 3 syntax and require\n\tat least Python 2.6.\n\n\t* scripts/html_fragments.py: Port to Python 3 syntax and require\n\tat least Python 2.6.\n\n\t* scripts/format_c_api_doc.py: Port to Python 3 syntax and require\n\tat least Python 2.6.\n\n2019-08-27  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* doc/GraphicsMagick.imdoc: Document gm utility exit status codes.\n\n2019-08-25  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (PRIMITIVE_INFO_POINTS_MAX): SIZE_MAX apparently\n\trounds up by one when cast to a double on 64-bit systems.  Due to\n\tthis, and in order to set more rational implementation limits, add\n\ta PRIMITIVE_INFO_POINTS_MAX definition which computes and\n\tconstrains the maximum number of PrimitiveInfo entries allowed.\n\n2019-08-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Check that we are\n\tnot being directed to read an IFD that we are already parsing and\n\tquit in order to avoid a loop.  Addresses oss-fuzz 15753\n\t\"graphicsmagick/coder_JPEG_fuzzer: Timeout in\n\tgraphicsmagick_coder_JPEG_fuzzer\" and 16068\n\t\"graphicsmagick/coder_SFW_fuzzer: Timeout in\n\tgraphicsmagick_coder_SFW_fuzzer\".\n\n\t* tests/{constitute.c, drawtest.c, rwblob.c, rwfile.c}: Eliminate\n\tirritating GCC 9 \"__builtin_strncpy' output may be truncated\"\n\twarnings due to copying MaxTextExtent-1 characters.  Instead\n\trequest copying all of the characters and also assure that string\n\tis still null terminated.\n\n\t* doc/environment.imdoc: Update documentation pertaining to HOME\n\tand MAGICK_DEBUG environment variables.\n\n2019-08-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (DestroyLogInfo): Only output text to terminate an\n\tXML format log file if XML format is active.\n\n2019-08-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (ExtractTokensBetweenPushPop): Previous fix for\n\tnon-terminal loop was broken by a last-minute untested edit.\n\tFinally addresses oss-fuzz 15318 \"graphicsmagick/coder_MVG_fuzzer:\n\tTimeout in graphicsmagick_coder_MVG_fuzzer\".\n\n2019-08-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* fuzzing/utils.cc (MemoryResource): Lessen the memory limit used\n\tfor oss-fuzz testing in order to provide more headroom and margin\n\tfor error.\n\n\t* magick/render.c (TraceBezier): Detect arithmetic overflow and\n\treturn errors via normal error path rather than exiting.  Fixes\n\toss-fuzz 16450 \"graphicsmagick:coder_MVG_fuzzer: Unexpected-exit\n\tin DefaultFatalErrorHandler\".\n\t(PrimitiveInfoRealloc): Implement more paranoid code related to\n\tprimitive allocation.\n\n2019-08-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawStrokePolygon): Handle case where\n\tTraceStrokePolygon() returns NULL.  Addresses oss-fuzz 15516\n\t\"graphicsmagick/coder_MVG_fuzzer: ASSERT: primitive_info !=\n\t(PrimitiveInfo *) NULL\".\n\t(DrawDashPolygon): Handle case where DrawStrokePolygon() returns\n\tMagickFail. Also needed to address oss-fuzz 15516, since otherwise\n\ttest-cases run for a very long time.\n\t(ExtractTokensBetweenPushPop): Fix non-terminal parsing loop.\n\tAddresses oss-fuzz 15318 \"graphicsmagick/coder_MVG_fuzzer: Timeout\n\tin graphicsmagick_coder_MVG_fuzzer\".\n\n2019-08-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/memory.h (MagickMallocAlignedArray): Add function\n\tattributes for added value and to quench GCC 9 warning with\n\tspecial build options enabled.\n\n\t* magick/deprecate.h (AcquireMemory): Add more function attributes\n\tto quench GCC 9 warning with special build options enabled.\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Fix compilation\n\twarning in 32-bit build.\n\n\t* coders/dpx.c (AttributeToString): Eliminate annoying warnings\n\tfrom GCC 9, although the code was correct.\n\n\t* coders/msl.c (MSLStartElement): Fix defective opacity percentage\n\tcode revealed by GCC 9 warning.\n\n2019-08-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Skip coalescing layers if there is\n\tonly one layer.  Fixes oss-fuzz 16274\n\t\"graphicsmagick/coder_MNG_fuzzer: Unexpected-exit in\n\tDefaultFatalErrorHandler\".\n\n2019-08-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadPNGImage): Post-processing to convert the\n\timage type in the PNG reader based on a specified magick prefix\n\tstring is now disabled.  This can (and should) be done after the\n\timage has been returned.  Fixes oss-fuzz 16386\n\t\"graphicsmagick:coder_PNG8_fuzzer: Timeout in\n\tgraphicsmagick_coder_PNG8_fuzzer\".\n\n2019-07-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updates in preparation for 1.3.33 release.\n\n2019-07-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Updated NEWS to reflect updates since last release.\n\n2019-07-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (WriteOnePNGImage): Fix saving to palette when\n\timage has an alpha channel but no color is marked as transparent.\n\tPatch submitted by Przemysław Sobala via SourceForge patch #61\n\t\"WriteOnePNGImage(): Fix saving to palette when image has an alpha\n\tchannel but no color is marked as transparent\".\n\n\t* doc/options.imdoc (characters): Fix -format documentation to\n\treflect that '%r' returns the image type.  Patch submitted by\n\tPrzemysław Sobala via SourceForge patch #60 \"Fix documentation\n\ttypo\".\n\n2019-07-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/tempfile.c (AcquireTemporaryFileDescriptor): Fix\n\tcompilation under Cygwin.  Patch by Marco Atzeri and submitted via\n\temail to the graphicsmagick-help mailing list on Fri, 5 Jul 2019.\n\n2019-06-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/attribute.c (GenerateEXIFAttribute): Added range checks\n\tand tracing.  Fixes oss-fuzz 14998\n\t\"graphicsmagick/coder_JPEG_fuzzer: Heap-buffer-overflow in\n\tRead32s\".  This is a tiny read overflow.\n\n\t* coders/miff.c (ReadMIFFImage): Similar fix as to mpc.c\n\n\t* coders/mpc.c (ReadMPCImage): Fix faulty signed overflow logic\n\tfor profiles[i].length which still allowed overflow.  Fixes\n\toss-fuzz issue 15190 \"graphicsmagick/coder_MPC_fuzzer:\n\tOut-of-memory in graphicsmagick_coder_MPC_fuzzer\".\n\n\t* doc/options.imdoc: Add notes about security hazards due to\n\tcommands which support a '@filename' syntax.\n\n\t* www/security.rst: Add notes about security hazards due to\n\tcommands which support a '@filename' syntax.\n\n2019-06-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Assure that 'token' is initialized.\n\tFixes oss-fuzz issue 14897 \"graphicsmagick/coder_MVG_fuzzer:\n\tUse-of-uninitialized-value in DrawImage\".\n\n\t* magick/animate.c (MagickXAnimateImages): Fix memory leak of\n\tscene_info.pixels.\n\n\t* magick/display.c (MagickXDisplayImage): Fix heap overwrite of\n\twindows->image.name and windows->image.icon_name buffers.  It\n\tappears that the code assumed that CloneString() would always\n\tallocated a string at least MaxTextExtent in size. I assume that\n\tthis issue has existed for a very long time since CloneString()\n\twas re-written many years ago.\n\n\t* coders/caption.c (ReadCAPTIONImage): The CAPTION reader did not\n\tappear to work at all any more.  Now it works again, but still not\n\tvery well.\n\n\t* magick/command.c: Re-implement '@' file inclusion support for\n\t-comment, -draw, -format, and -label which was removed for the\n\t1.3.32 release.  Note that arguments from untrusted sources will\n\tstill need to be sanitized to detect attempts to subvert this\n\tfeature to access file data, but this feature has always been\n\tsupported by GraphicsMagick and it originated early in the\n\tdevelopment of ImageMagick.\n\n2019-06-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (MagickStrlCat, MagickStrlCpy): Add debug\n\tchecks enabled by MAGICK_STRL_CHECK.\n\n\t* magick/montage.c (MontageImages): Fix wrong length argument to\n\tstrlcat() when building montage directory, which could allow heap\n\toverwrite.\n\n\t* coders/png.c (RegisterPNGImage): Pass correct size value to\n\tstrlcat().  Under Apple's OS X (and possibly other targets)\n\tstrlcat() writes bytes beyond what it needs to (but within the\n\trange it is allowed to) causing a crash due to the wrong limit\n\tvalue.  Fixes SourceForge issue #609 `gm identify foo.png` crashes\n\ton macOS (v 1.3.32).\n\n\t* www/Changes.rst: Update ChangeLog links due to new year, and\n\t1.3.32 release.\n\n2019-06-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (WriteBMPImage): Detect arithmetic overflow of\n\timage_size. Add more tracing. Reduce compilation warnings.\n\t(EncodeImage): Reduce compilation warnings.\n\t(WriteBMPImage): Assure that chromaticity uses double-precision\n\tfor multiply before casting to unsigned integer.\n\n\t* coders/wpg.c (ReallocColormap): Reduce compilation warnings.\n\n\t* coders/braille.c (WriteBRAILLEImage): Reduce compilation\n\twarnings.\n\n\t* coders/dib.c (WriteDIBImage): Detect arithmetic overflow of\n\timage_size. Reduce compilation warnings.\n\t(EncodeImage): Reduce compilation warnings.\n\n\t* coders/locale.c (WriteLOCALEImage): Reduce compilation warnings.\n\n2019-06-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (dist-zstd): Use the maximum possible compression\n\tlevel (22) when creating a Zstd-compressed tarball to get close to\n\tlzip/xz compression levels.\n\n\t* coders/tiff.c (ReadTIFFImage): Fix typo in initialization of\n\t'tile' pointer variable.\n\n\t* version.sh: Updates in preparation for 1.3.32 release.\n\n2019-06-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* Makefile.am (release): Add a release target to make it easier to\n\tproduce and sign the release files.  Add a zstd-compressed output\n\ttarball just because we can.\n\n2019-06-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Fix typo when initializing\n\tnumber_coordinates.  Somehow GCC and clang let this typo slip by.\n\n2019-06-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dib.c (ReadDIBImage): Preserve PseudoClass opaque\n\trepresentation if ICO mask is opaque, otherwise return a\n\tDirectClass image.\n\n2019-06-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Detect an error in TracePath() and\n\tquit rather than forging on.\n\n2019-06-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Terminate drawing if\n\tDrawCompositeMask() reports failure.  Fixes oss-fuzz 12373\n\t\"graphicsmagick/coder_MVG_fuzzer: Timeout in\n\tgraphicsmagick_coder_MVG_fuzzer\".\n\t(TracePath): Terminate path parsing upon first parsing error.\n\n2019-06-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/txt.c (ReadTXTImage): Use real a new-line character as\n\tline delimiter rather than '\\n' string.\n\n\t* magick/annotate.c (AnnotateImage): No longer implicitly call\n\tTranslateText() since this is not suitable for most use-cases and\n\tcauses additional performance impact.  The API user can perform\n\tsuch translations in advance on the text string using\n\tTranslateText() if need be.  No longer call StringToList() to\n\tsplit strings into an array of strings since this can lead to\n\tunexpected results, and a custom-splitter is more efficient.\n\n2019-06-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawImage): Only support '@filename' syntax to\n\tread drawing primitive from a file if we are not already drawing.\n\n\t* magick/utility.c (TranslateTextEx): Remove support for reading\n\tfrom a file using '@filename' syntax due to security concerns.\n\tProblem was reported to us by \"Battle Furry\" via the\n\tGraphicsMagick security mail alias on June 6, 2019.\n\n2019-06-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/utility.c (SetClientFilename): Reduce initialized data\n\tsome more.\n\n2019-06-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/nt_base.c: Search for n019003l.pfb (the \"Helvetica\"-like\n\tfont) rather than fonts.dir since fonts.dir is not present in all\n\tURW font collections.\n\n\t* NEWS.txt: Update news.\n\n2019-06-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/logo.c: Tidy logo image definitions, and logo image\n\toutput.\n\n2019-05-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mat.c: Make more data const.\n\n2019-05-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/animate.c: Reduce initialized static allocations.\n\n\t* magick/display.c: Reduce initialized static allocations.\n\n\t* magick/widget.c (MagickSplitNDLTextToList): Add static\n\timplementation function.\n\n2019-05-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/webp.c (RegisterWEBPImage): Use sprintf to format version\n\tsince snprintf is not available in old Visual Studio.\n\n2019-05-19  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dcm.c: Make more data const.\n\n\t* www/INSTALL-unix.rst: Add documentation for how to install URW\n\tfonts from various package management systems.\n\n2019-05-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/authors.rst: Add authorship attribution to Samuel Thibault\n\tfor contributing support for the Braille image format.\n\n\t* coders/braille.c: Add support for Braille image format by Samuel\n\tThibault.  Patch submitted via SourceForge patch #59 \"Add braille\n\timage format support.\n\n2019-05-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/tempfile.c: Make more data const.\n\n\t* magick/signature.c: Make more data const.\n\n\t* magick/quantize.c: Make more data const.\n\n\t* magick/attribute.c: Make more data const.\n\n\t* coders/png.c: Make more data const.\n\n\t* coders/mpeg.c: Make more data const.\n\n\t* coders/wmf.c: Make more data const.\n\n\t* coders/tile.c: Make more data const.\n\n2019-05-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/enum_strings.c: Make more data const.\n\n2019-05-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magick.c: Make more data const.\n\n\t* magick/type.c (GetTypeInfoByFamily): Make more data const.\n\n\t* magick/unix_port.c (MagickGetMMUPageSize): Decrease initialized\n\tdata.\n\n\t* magick/utility.c (GetPageGeometry): Make more data const.\n\n\t* coders/pdf.c (WritePDFImage): Allocate working buffer on stack\n\tand pass as argument to EscapeParenthesis() to eliminate a thread\n\tsafety problem and also reduce BSS size.\n\n\t* coders/webp.c (RegisterWEBPImage): Fix compiler warning.\n\n\t* coders/jbig.c (RegisterJBIGImage): Make more data const.\n\n\t* coders/pict.c (DecodeImage): Allocate output buffer used by\n\tExpandBuffer() on the stack rather than as static data private to\n\tExpandBuffer().  Eliminates a thread safety problem and also\n\treduces BSS size.\n\n\t* coders/webp.c (RegisterWEBPImage): Reduce BSS size.\n\n2019-05-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jp2.c: Make more data const.\n\n\t* coders/wmf.c: Make more data const.\n\n\t* coders/ps.c (WritePSImage): Make more data const.\n\n\t* coders/ps2.c (WritePS2Image): Make more data const.\n\n2019-05-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/static.c: Revert to previous 'name' storage. Callback\n\tfunctions in structure block being properly const.\n\n\t* coders/xpm.c: Make more data const.\n\n\t* coders/pnm.c: Make more data const.\n\n\t* coders/palm.c: Make more data const.\n\n\t* coders/meta.c: Make more data const.\n\n\t* coders/dcraw.c: Make more data const.\n\n\t* magick/command.c: Fix compilation problem when HasX11 is not\n\tdefined.\n\n2019-05-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c: Make more data const.\n\n2019-05-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/webp.c (RegisterWEBPImage): Make more data const.\n\n\t* coders/svg.c (RegisterSVGImage): Reduce BSS size.\n\n\t* coders/miff.c (RegisterMIFFImage): Fix version reporting.\n\n\t* coders/ttf.c (RegisterTTFImage): Fixed reporting of FreeType\n\tversion.\n\n\t* coders/tiff.c (RegisterTIFFImage): Reduce BSS size.\n\n\t* coders/sfw.c (ReadSFWImage): Make SFW static data completely\n\tconst.\n\n\t* coders/ps3.c: Make PS3 static data completely const.\n\n\t* coders/pict.c: Make PICT static data completely const.\n\n\t* magick/error.c (ThrowException, ThrowLoggedException): Handle\n\tthe case where some passed character strings refer to existing\n\texception character strings.  Fixes SourceForge issue #603\n\t\"heap-use-after-free in function ThrowLoggedException of\n\tmagick/error.c\".\n\t(CatchException): Restructure so there is one return point.\n\n\t* coders/miff.c (ImportRLEPixels): Fix heap overflow caused by a\n\ttypo in the code.  Also fix undefined behavior caused by large\n\tleft shifts of an unsigned char.  Fixes SourceForge issue #608\n\t\"heap-buffer-overflow in ImportRLEPixels of coders/miff.c.\n\n2019-05-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/bmp.c (ReadBMPImage): Fix subrange/scene handling in\n\t'ping' mode so it is like the other formats.  Only the first frame\n\twas being enumerated while in 'ping' mode.\n\n2019-05-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* NEWS.txt: Update news.\n\n\t* magick/utility.c (ExpandFilenames): Only expand '@filename' to a\n\tlist of arguments read from 'filename' if the path '@filename'\n\tdoes not exist.  This fix is made based on an email posting to the\n\t'graphicsmagick-help' mailing list at SourceForge by \"Test User\"\n\ton Tue, 7 May 2019.\n\n2019-05-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/colorspace.c: Reorder initialization of colorspace tables\n\tfor a possible performance improvement.\n\n\t* magick/fx.c (WaveImage): Use float for sin map.\n\n\t* configure.ac: Test for float versions of math functions.\n\n\t* magick/gem.c (GenerateDifferentialNoise): Use float versions of\n\tmath functions when available.\n\n2019-05-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* www/INSTALL-unix.rst: Expanded configure documentation for\n\t--with-modules.  Added specific configure documentation for\n\t--with-umem and --with-mtmalloc, which may be useful on\n\tSolaris-derived systems.\n\n2019-04-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/command.c (VersionCommand): Show OpenMP specification\n\tversion corresponding to version enumeration.\n\n\t* magick/locale.c (GetLocaleMessageFromTag): Eliminate clang\n\twarning about comparison with a constant value.\n\n\t* magick/log.c (InitializeLogInfo): Initialize LogInfo log_configured.\n\n2019-04-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/magic.c (struct): Ajust StaticMagic definition to be more\n\tconst-friendly.\n\n\t* magick/color_lookup.c (struct): Adjust StaticColors definition\n\tto be more const-friendly.\n\n\t* magick/attribute.c: Ajust tag_table definition to be more\n\tconst-friendly.\n\n\t* magick/log.c: Allocate LogInfo from heap as we used to do.\n\n\t* magick/locale.c (GetLocaleMessageFromTag): Adaptations to locale\n\tcoder output changes.\n\n\t* coders/locale.c (WriteLOCALEImage): Adjust locale coder output\n\tto be more const.\n\n2019-04-20  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/color_lookup.c: Make built-in color tables fully const.\n\n\t* magick/animate.c: Use MagickXTextViewWidgetNDL() to display help\n\ttext.\n\n\t* magick/display.c: Use MagickXTextViewWidgetNDL() to display help\n\ttext.\n\n\t* magick/widget.c (MagickXTextViewWidgetNDL): New private function\n\tto display multi-line null-delimited text in an X11 widget.\n\n\t* coders/xwd.c (ReadXWDImage): Added even more XWD header\n\tvalidation logic.  Addresses problems noted by email from Hongxu\n\tChen to the graphicsmagick-security mail alias on Fri, 19 Apr 2019\n\tand Sat, 20 Apr 2019 and entitled \"Multiple crashes (FPE and\n\tinvalid read) when processing XWD files\".\n\n2019-04-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xwd.c (ReadXWDImage): Added even more XWD header\n\tvalidation logic.  Addresses problems noted by email from Hongxu\n\tChen to the graphicsmagick-security mail alias on Wed, 17 Apr 2019\n\tand entitled \"Multiple crashes (FPE and invalid read) when\n\tprocessing XWD files\".  Also addresses additional issues noted\n\tthat an attacker could request to allocate an arbitrary amount of\n\tmemory based on ncolors and the claimed header size.\n\n2019-04-14  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xwd.c (ReadXWDImage): Add more XWD header validation\n\tlogic.  Addresses problems noted by email from Hongxu Chen to the\n\tgraphicsmagick-security mail alias on Sun, 14 Apr 2019 and\n\tentitled \"Multiple crashes (FPE and invalid read) when processing\n\tXWD files\".\n\n2019-04-13  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdb.c (WritePDBImage): Assure that input scanline is\n\tcleared in order to cover up some decoder bug.  May fix 14215\n\t\"graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\n\tWritePDBImage\", which I have not been able to reproduce.\n\n\t* magick/render.c (DrawPrimitive): Check primitive point x/y\n\tvalues for NaN.\n\t(DrawImage): Fix oss-fuzz issue 14173\n\t\"graphicsmagick/coder_MVG_fuzzer: Integer-overflow in DrawImage\".\n\n\t* magick/pixel_cache.c (SetNexus): Fix oss-fuzz issue 14208\n\t\"graphicsmagick/coder_MVG_fuzzer: Integer-overflow in SetNexus\".\n\n2019-04-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/display.c: Add even more const declarations.\n\n\t* coders/mat.c (WriteMATLABImage): Add completely missing error\n\thandling.  Fixes SourceForge issue #604 \"heap-buffer-overflow in\n\tfunction WriteMATLABImage of coders/mat.c\".\n\n2019-04-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdb.c (WritePDBImage): Fix SourceForge issue #605\n\t\"heap-buffer-overflow in function WritePDBImage of coders/pdb.c\".\n\n\t* magick/widget.c: Add many const declarations.\n\n\t* magick/display.c: Incorporate and eliminate display.h. Add many\n\tconst declarations.\n\n\t* magick/animate.c: Incorporate and eliminate animate.h. Add many\n\tconst declarations.\n\n2019-04-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wmf.c (ReadWMFImage): Reject WMF files with an empty\n\tbounding box.  Fixes SourceForge issue #606 \"Division by Zero in\n\tcoders/wmf.c\".\n\n2019-04-07  Fojtik Jaroslav  <JaFojtik@seznam.cz>\n\n\t* magick/nt_base.c Fix a problem of finding ghostscript fonts.\n\tVariable \"font_dir\" was useless and thus removed. No need to copy\n\ttext multiple times.  Use const char gs_font_dir[] instead of\n\tpointer.\n\n2019-04-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xwd.c (ReadXWDImage): Perform more header validations and\n\ta file size validation in order to reject files with bogus\n\theaders.\n\t(WriteXWDImage): Fix SourceForge issue #599\n\t\"heap_buffer_overflow_WRITE in function WriteXWDImage of\n\tcoders/xwd.c\".\n\n2019-04-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c (SVGStartElement): Fix stack buffer overflow while\n\tparsing quoted font family value.  Fixes SourceForge issue #600\n\t\"stack-buffer-overflow in function SVGStartElement of\n\tcoders/svg.c\".\n\n\t* coders/miff.c (ReadMIFFImage): Detect end of file while reading\n\tRLE packets.  Fixes SourceForge issue #598 \"heap-buffer-overflow\n\tin function ReadMIFFImage of coders/miff.c\".\n\n2019-04-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/xwd.c (ReadXWDImage): Fix heap buffer overflow while\n\treading DirectClass XWD file.  Fixes SourceForge issue #597\n\t\"heap-buffer-overflow in function ReadXWDImage of coders/xwd.c\".\n\n2019-04-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Fix small buffer overflow (one\n\tPixelPacket) of image colormap.  Fixes SourceForge issue #596\n\t\"heap-buffer-overflow in function CloneImage of magick/image.c\".\n\n\t* magick/colormap.c (ReallocateImageColormap): New function to\n\treallocate an image colormap.\n\n\t* coders/logo.c: Make more static data const.\n\n\t* magick/module_aliases.h: Make more static data const.\n\n\t* magick/static.c: Make more static data const.\n\n2019-04-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/log.c (LogMagickEventList): Log elapsed time with\n\tmicrosecond precision.\n\n2019-03-31  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mpc.c (ReadMPCImage): Deal with a profile length of zero,\n\tor an irrationally large profile length.  Fixes SourceForge issue\n\t#601 \"memory leak in function ReadMPCImage of coders/mpc.c \".\n\n\t* magick/xwindow.c (MagickXGetWindowInfo): Deal with the unlikely\n\tcase that the memory allocation for window->segment_info\n\tfails. Fixes SourceForge #595 \"use allocate memory before null\n\tcheck\" as pertains to magick/xwindow.c.\n\n\t* magick/segment.c (Classify): Add check for memory allocation\n\tfailure when allocating cluster array. Fixes SourceForge #595 \"use\n\tallocate memory before null check\" as pertains to\n\tmagick/segment.c.\n\n\t* coders/pdb.c (ReadPDBImage): Fix use of allocated memory before\n\tnull check.  Fixes SourceForge #595 \"use allocate memory before\n\tnull check\" as pertains to coders/pdb.c.\n\n2019-03-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (AllocateThreadViewSet): Simplify the image\n\tview model by adding NexusInfo to the View structure (rather than\n\treferencing it via a pointer) to lessen the number of required\n\tper-thread allocations and to improve locality of reference.\n\n2019-03-22  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c (WPG1_Palette): Change to a static declaration.\n\n\t* coders/dcm.c: dicom_info array is now fully in the data segment.\n\n2019-03-18  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* configure.ac: Add support for using the Solaris mtmalloc\n\tlibrary.  This is primarily for testing or as an alternative to\n\tSolaris umem.\n\tStop using posix_memalign() until it is uniformly more mature and\n\treliably quick.\n\n2019-03-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (SetNexus): Smallest staging-area\n\tallocation is cache line size so declare it as such.\n\n\t* magick/fx.c: Functions in the fx module which return a new Image\n\tshould return a null Image if an exception was thrown.  Also,\n\tassure that user has an opportunity to see the exception which was\n\tthrown.\n\n\t* magick/error.c (ThrowLoggedException): Throwing an exception is\n\tnow thread-safe.\n\n\t* magick/pixel_cache-private.h: Moved pixel cache private\n\tdefinitions to private header.\n\n2019-03-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (SetNexus): Pass x, y, columns, and rows\n\trather than a pointer to RectangleInfo.  This should be easier to\n\tinline on modern CPUs.\n\n2019-03-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (SetNexus): Cache resource limits in\n\tCacheInfo rather than repeatedly calling into the resource code in\n\torder to lessen the overhead of performing resource limit checks\n\ton the pixel cache views.\n\n\t* magick/resource.c (AcquireMagickResource): Use a lock for each\n\tresource in order to lessen contention.  Return a maximum 64-bit\n\tinteger value if the resource has not been limited.  Previously\n\treturned -1 in this case but this was not documented.\n\n2019-03-07  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/import.c (ImportViewPixelArea): If range between max and\n\tmin is less than MagickEpsilon, produce a black image rather than\n\tthrowing an exception.\n\n\t* coders/mat.c (ReadMATImage): Fix memory leak on unexpected end\n\tof file.  Fixes oss-fuzz 13556 \"graphicsmagick/coder_MAT_fuzzer:\n\tDirect-leak in ReadMATImage\". (Credit to OSS-Fuzz)\n\n2019-03-06  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mat.c (ReadMATImage): Quit if image scanlines are not\n\tfully populated due to exception.  Fixes oss-fuzz 13530\n\t\"graphicsmagick/coder_MAT_fuzzer: Use-of-uninitialized-value in\n\tInsertComplexFloatRow\". (Credit to OSS-Fuzz)\n\n2019-03-04  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/txt.c (ReadTXTImage): Don't start new line if x_max <\n\tx_min.  Avoids calling SetImagePixels() with a width of zero.\n\tRelated to oss-fuzz 13521 \"graphicsmagick/coder_TEXT_fuzzer:\n\tFloating-point-exception in SetNexus\". (Credit to OSS-Fuzz)\n\n\t* magick/pixel_cache.c (SetNexus): Report error for empty region\n\trather than crashing due to divide by zero exception. This is a\n\tnew bug due to yesterday's changes.  Fixes oss-fuzz 13521\n\t\"graphicsmagick/coder_TEXT_fuzzer: Floating-point-exception in\n\tSetNexus\". (Credit to OSS-Fuzz)\n\n2019-03-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* design/pixel-cache.dot: Update design dot diagram to remove\n\tIsNexusInCore and add CompositeCacheNexus.\n\n\t* magick/pixel_cache.c (SetNexus): Apply resource limits to pixel\n\tnexus allocations using the same limits (total pixels, width,\n\theight, memory) as applied to the whole image since some requests\n\tare directly influenced by the input file.  Add yet more tests for\n\tarithmetic overflow.  Whole source module is re-arranged so that\n\tstatic functions are in order of dependency so that forward\n\tprototype declarations are no longer needed.  Fixes oss-fuzz 13210\n\t\"graphicsmagick/coder_MVG_fuzzer: Integer-overflow in\n\tSetNexus\". (Credit to OSS-Fuzz)\n\n2019-03-02  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (OpenCache): Use unsigned 64-bit value to\n\tstore CacheInfo offset and length as well as for the total pixels\n\tcalculation.  Add some more arithmetic overflow detections.\n\n\t* coders/topol.c (ReadTOPOLImage): Report a corrupt image\n\texception \"Unexpected end-of-file\" if reader encounters end of\n\tfile while reading header rows.  Addresses oss-fuzz 7981\n\t\"graphicsmagick/coder_TOPOL_fuzzer: Use-of-uninitialized-value in\n\tInsertRow\". (Credit to OSS-Fuzz)\n\n\t* coders/mat.c (ReadMATImage): Report a corrupt image exception\n\t\"Unexpected end-of-file\" if reader encounters end of file while\n\treading scanlines.  Also added some helpful traces.  Hopefully\n\taddresses oss-fuzz 13445 \"graphicsmagick/coder_MAT_fuzzer:\n\tUse-of-uninitialized-value in IsGrayImage\". (Credit to OSS-Fuzz)\n\n2019-02-26  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image.h (\"C\"): Include as \"magick/image-private.h\" as the\n\tother headers are.\n\t(\"C\"): Include \"magick/image-private.h\" inside the protective\n\tMAGICK_IMPLEMENTATION guard, as it should have been.  This error\n\tbroke the oss-fuzz build.\n\n2019-02-24  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/image-private.h (_ImageExtra): Put ImageExtra definition\n\tin a private header file so that its definition may be accessed\n\tdirectly by library internals.  Add some accessor macros to\n\tprovide access and update code to use them.\n\n\t* coders/wpg.c (ReallocColormap): Make sure that there is not a\n\theap overwrite if the number of colors has been reduced.  Thanks\n\tto Jaroslav Fojtik for giving me a heads up about this.\n\n2019-02-23  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/monitor.c (MagickMonitorActive): Add new private function\n\tto test if a progress monitor is active.  Update all progress\n\tmonitor code in loops to use this information, while also updating\n\tcode to hopefully address concerns expressed by Hongxu Chen about\n\tdata races on the graphicsmagick-bugs mailing list starting on\n\tFebruary 6, 2019.\n\n2019-02-21  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/mpc.c (ReadMPCImage): Tally directory length to avoid\n\tdeath by strlen().\n\n\t* coders/miff.c (ReadMIFFImage): Tally directory length to avoid\n\tdeath by strlen().  Fixes oss-fuzz 13190\n\t\"graphicsmagick/coder_MIFF_fuzzer: Timeout in\n\tgraphicsmagick_coder_MIFF_fuzzer\". (Credit to OSS-Fuzz)\n\n2019-02-17  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/svg.c (ReadSVGImage): Don't call xmlCleanupParser()\n\tin module code since this may cause other libxml users to fail.\n\n\t* coders/msl.c (ProcessMSLScript): Don't call xmlCleanupParser()\n\tin module code since this may cause other libxml users to fail.\n\n\t* magick/render.c (DrawDashPolygon): (DrawDashPolygon): Don't read\n\tbeyond end of dash pattern array.  This is a second instance of\n\tissue identified by SourceForge issue #591.  Fixes oss-fuzz 13160\n\t\"graphicsmagick/coder_MVG_fuzzer: Heap-buffer-overflow in\n\tDrawDashPolygon\".  The earlier attempt to fix this problem today\n\tbroke dash patterns entirely.  (Credit to OSS-Fuzz)\n\n\t* magick/annotate.c (RenderFreetype): Eliminate memory leak of\n\tGlyphInfo.image (type FT_Glyph) while rendering some FreeType\n\tfonts such as the one we use now in the Magick++ test suite.\n\n2019-02-16  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/render.c (DrawDashPolygon): Avoid reading one beyond\n\tlength of dash pattern array, which is terminated by value 0.0.\n\tFixes SourceForge issue #591 \"Heap buffer overflow in\n\tDrawDashPolygon when parsing SVG images\".\n\t(DrawPrimitive): Add arithmetic overflow checks when converting\n\tcomputed coordinates from 'double' to 'long'.\n\t(DrawImage): Don't destroy draw_info in graphic_context when\n\tdraw_info has not been allocated yet.  Problem reported via email\n\tby Sami Supperi on Thu, 14 Feb 2019.\n\n\t* coders/jpeg.c (ReadJPEGImage): JPEG files are observed to\n\tprovide compression ratios as high as 2500 so allow for that.\n\tAlso, the test for \"Unreasonable dimensions\" delivered yesterday\n\twas flawed since magick_rows and magick_columns are only set if a\n\tdesired image size was provided.  Fixes SourceForge issue 592\n\t\"Non-malicious JPEG file fails with \"Unreasonable dimensions\"\".\n\n\t* coders/tiff.c (ReadTIFFImage): Only disassociate alpha channel\n\tfor images where photometic is PHOTOMETRIC_RGB. Fixes oss-fuzz\n\t13115 \"graphicsmagick/coder_PTIF_fuzzer:\n\tUse-of-uninitialized-value in DisassociateAlphaRegion\". (Credit to\n\tOSS-Fuzz)\n\n2019-02-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/jpeg.c (ReadJPEGImage): Base test for \"Unreasonable\n\tdimensions\" on original JPEG dimensions and not the scaled\n\tdimensions.  Fixes SourceForge issue 593 \"gm convert: Insufficient\n\timage data in file when hinting input image\".\n\n2019-02-13  Troy Patteson  <troyp@ieee.org>\n\n\t* PerlMagick/Magick.xs (Mogrify): Add decorate argument to Annotate.\n\n\t* PerlMagick/Magick.xs (Mogrify): Remove reference to undefined\n\tAnnotate argument.\n\n2019-02-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/tiff.c (ReadTIFFImage): For planar TIFF, make sure that\n\tpixels are initialized in case some planes are missing.  Fixes\n\toss-fuzz 13046 \"graphicsmagick/coder_PTIF_fuzzer:\n\tUse-of-uninitialized-value in DisassociateAlphaRegion\". (Credit to\n\tOSS-Fuzz)\n\n2019-02-11  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pdf.c (WritePDFImage): Make sure to free 'xref' before\n\treturning.  Similar to ImageMagick CVE-2019-7397 \"In ImageMagick\n\tbefore 7.0.8-25, several memory leaks exist in WritePDFImage in\n\tcoders/pdf.c.\".  Thanks to Petr Gajdos for bringing this issue to\n\tour attention.\n\n2019-02-10  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/wpg.c (ReadWPGImage): Use a different way to reallocate\n\tthe colormap which preserves existing content, but also updates\n\timage->colors and assures that added palette entries are\n\tinitialized.\n\n\t* coders/png.c (ReadMNGImage): Bound maximum loop iterations by\n\tsubrange as a primitive means of limiting resource consumption.\n\tThis should finally resolve oss-fuzz 12738\n\t\"graphicsmagick/enhance_fuzzer: Out-of-memory in\n\tgraphicsmagick_enhance_fuzzer\". (Credit to OSS-Fuzz)\n\n\t* coders/tiff.c (ReadTIFFImage): Assure that opacity channel is\n\tinitialized in the RGBAStrippedMethod case.  Convert\n\t'CorruptImageError' encountered while testing for more frames to\n\t'CorruptImageWarning' so we return the frames already read.\n\tSecond try at fixing oss-fuzz 11896\n\t\"graphicsmagick/coder_PTIF_fuzzer: Use-of-uninitialized-value in\n\tVerticalFilter\".\n\n\t* coders/dpx.c (AttributeToString): Eliminate clang\n\t\"-Wstring-plus-int\" warning observed in oss-fuzz build.\n\n\t* coders/cineon.c (AttributeToString): Eliminate clang\n\t\"-Wstring-plus-int\" warning observed in oss-fuzz build.\n\n2019-02-09  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/pict.c (DecodeImage): Avoide a one-byte over-read of\n\tpixels heap allocation.  The cause of the over-read is not yet\n\tunderstood.  Fixes oss-fuzz 12019\n\t\"graphicsmagick/coder_PICT_fuzzer: Heap-buffer-overflow in\n\tExpandBuffer\". (Credit to OSS-Fuzz)\n\n\t* coders/wpg.c (ReadWPGImage): Assure that all colormap entries\n\tare initialized.  Fixes oss-fuzz 12614\n\t\"graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\n\tEnhanceImage\". (Credit to OSS-Fuzz)\n\n\t* coders/tiff.c (ReadTIFFImage): Make sure that image is in\n\tDirectClass mode and ignore any claimed colormap when the image is\n\tread using the RGBAStrippedMethod, RGBATiledMethod, or\n\tRGBAPuntMethod cases.  Fixes oss-fuzz 12195\n\t\"graphicsmagick/coder_PTIF_fuzzer: Use-of-uninitialized-value in\n\tExportGrayQuantumType\". (Credit to OSS-Fuzz)\n\n\t* coders/miff.c (ReadMIFFImage): Improve pixel buffer calculations\n\tto defend against overflow.  Assure that zlib and bzlib decode the\n\texpected number of bytes for a pixel row.  Fixes oss-fuzz issue\n\t12448 \"graphicsmagick/coder_MIFF_fuzzer:\n\tUse-of-uninitialized-value in RGBTransformPackets\". (Credit to\n\tOSS-Fuzz)\n\n2019-02-08  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/png.c (ReadMNGImage): Quit processing and report error\n\tupon failure to insert MNG background layer.  Fixes oss-fuzz 12738\n\t\"graphicsmagick/enhance_fuzzer: Out-of-memory in\n\tgraphicsmagick_enhance_fuzzer\". (Credit to OSS-Fuzz)\n\n2019-02-03  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/dib.c (ReadDIBImage, WriteDIBImage): Improve buffer-size\n\tcalculations to guard against buffer overflows.  The reader\n\tversion was not as complete as it should have been, whereas the\n\twriter version did not guard against arithmetic overflow at all.\n\n\t* coders/bmp.c (ReadBMPImage, WriteBMPImage): Improve buffer-size\n\tcalculations to guard against buffer overflows.  This is a\n\tfollow-on fix to the previous fix submitted for SourceForge issue\n\t#582 \"heap-buffer-overflow in ReadBMPImage of bmp.c\" which is now\n\talso identified as CVE-2018-20185.\n\n\t* www/Hg.rst: Updates to reflect current usage and availability.\n\n\t* www/authors.rst: Promote Troy Patteson to the active contributor\n\tcategory.\n\n2019-02-01  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/version.h.in: Rotate ChangeLog and update copyright\n\tstatements for the new year.\n\n2019-01-30  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* coders/webp.c (WriteWEBPImage): Patch by Przemysław Sobala to\n\tsupport WebP 'use_sharp_yuv' option (\"if needed, use sharp (and\n\tslow) RGB->YUV conversion\") via `-define webp:use-sharp-yuv=true`.\n\n2019-01-05  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>\n\n\t* magick/pixel_cache.c (SetNexus): Merge IsNexusInCore()\n\timplementation code into SetNexus() and add check for if\n\tcache_info->pixels is null.  Fixes SourceForge issue #588 \"Bug in\n\tIsNexusInCore()\".\n\n\t* configure.ac (DcrawExtraOptions): Request TIFF output from dcraw\n\tif build supports TIFF format in order to obtain more metadata.\n\tThis allows obtaining some metadata from standard TIFF tags\n\t(e.g. camera make, model, and dcraw version), and any attached ICC\n\tprofile, but not specifically EXIF data since we don't support\n\textracting EXIF data from TIFF yet. Inspired by SourceForge issue\n\t589 \"Identify lack of data (no Exif) in RAW formats\".\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/Copyright.txt",
    "content": ".. -*- mode: rst -*-\n.. This text is in reStucturedText format, so it may look a bit odd.\n.. See http://docutils.sourceforge.net/rst.html for details.\n\n======================================\nGraphicsMagick Copyrights and Licenses\n======================================\n\nThis file is part of the GraphicsMagick software distributed by the\nGraphicsMagick Group.\n\n  [*Please note that the legal community considers 15 or more\n  total lines of code or text (not necessarily contiguous) to\n  be significant for the purposes of copyright. Repeated\n  changes such as renaming a symbol has similar significance\n  to changing one line of code.*]\n\nThe licenses which components of this software fall under are as follows.\n\n1)\n\n  In November 2002, the GraphicsMagick Group created GraphicsMagick\n  from ImageMagick Studio's ImageMagick and applied the \"MIT\" style\n  license:\n\n  Copyright (C) 2002-2020 GraphicsMagick Group\n\n  Permission is hereby granted, free of charge, to any person\n  obtaining a copy of this software and associated documentation files\n  (the \"Software\"), to deal in the Software without restriction,\n  including without limitation the rights to use, copy, modify, merge,\n  publish, distribute, sublicense, and/or sell copies of the Software,\n  and to permit persons to whom the Software is furnished to do so,\n  subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be\n  included in all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n  SOFTWARE.\n\n2)\n\n  In October 1999, ImageMagick Studio assumed the responsibility for\n  the development of ImageMagick (forking from the distribution by\n  E. I. du Pont de Nemours and Company) and applied a new license:\n\n  Copyright (C) 2002 ImageMagick Studio, a non-profit organization dedicated\n  to making software imaging solutions freely available.\n\n  Permission is hereby granted, free of charge, to any person obtaining a\n  copy of this software and associated documentation files (\"ImageMagick\"),\n  to deal in ImageMagick without restriction, including without limitation\n  the rights to use, copy, modify, merge, publish, distribute, sublicense,\n  and/or sell copies of ImageMagick, and to permit persons to whom the\n  ImageMagick is furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of ImageMagick.\n\n  The software is provided \"as is\", without warranty of any kind, express or\n  implied, including but not limited to the warranties of merchantability,\n  fitness for a particular purpose and noninfringement.  In no event shall\n  ImageMagick Studio be liable for any claim, damages or other liability,\n  whether in an action of contract, tort or otherwise, arising from, out of\n  or in connection with ImageMagick or the use or other dealings in\n  ImageMagick.\n\n  Except as contained in this notice, the name of the ImageMagick Studio\n  shall not be used in advertising or otherwise to promote the sale, use or\n  other dealings in ImageMagick without prior written authorization from the\n  ImageMagick Studio.\n\n3)\n\n  From 1991 to October 1999 (through ImageMagick 4.2.9), ImageMagick\n  was developed and distributed by E. I. du Pont de Nemours and\n  Company:\n\n  Copyright 1999 E. I. du Pont de Nemours and Company\n\n  Permission is hereby granted, free of charge, to any person obtaining a\n  copy of this software and associated documentation files\n  (\"ImageMagick\"), to deal in ImageMagick without restriction, including\n  without limitation the rights to use, copy, modify, merge, publish,\n  distribute, sublicense, and/or sell copies of ImageMagick, and to\n  permit persons to whom the ImageMagick is furnished to do so, subject\n  to the following conditions:\n\n  The above copyright notice and this permission notice shall be included\n  in all copies or substantial portions of ImageMagick.\n\n  The software is provided \"as is\", without warranty of any kind, express\n  or implied, including but not limited to the warranties of\n  merchantability, fitness for a particular purpose and noninfringement.\n  In no event shall E. I. du Pont de Nemours and Company be liable for\n  any claim, damages or other liability, whether in an action of\n  contract, tort or otherwise, arising from, out of or in connection with\n  ImageMagick or the use or other dealings in ImageMagick.\n\n  Except as contained in this notice, the name of the E. I. du Pont de\n  Nemours and Company shall not be used in advertising or otherwise to\n  promote the sale, use or other dealings in ImageMagick without prior\n  written authorization from the E. I. du Pont de Nemours and Company.\n\n4)\n\n  The GraphicsMagick Base64Decode() and Base64Encode() functions are\n  based on source code obtained from OpenSSH. This source code is\n  distributed under the following license:\n\n  Copyright (c) 2000 Markus Friedl.  All rights reserved.\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions\n  are met:\n\n  1. Redistributions of source code must retain the above copyright\n     notice, this list of conditions and the following disclaimer.\n\n  2. Redistributions in binary form must reproduce the above copyright\n     notice, this list of conditions and the following disclaimer in the\n     documentation and/or other materials provided with the distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE AUTHOR \\`\\`AS IS\\'\\' AND ANY EXPRESS OR\n  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n5)\n\n  Many of the pattern images in coders/logo.c are derived from XFig,\n  which is distributed under the following license:\n\n  | FIG : Facility for Interactive Generation of figures\n  | Copyright (c) 1985-1988 by Supoj Sutanthavibul\n  | Parts Copyright (c) 1989-2000 by Brian V. Smith\n  | Parts Copyright (c) 1991 by Paul King\n\n  Any party obtaining a copy of these files is granted, free of charge, a\n  full and unrestricted irrevocable, world-wide, paid up, royalty-free,\n  nonexclusive right and license to deal in this software and\n  documentation files (the \"Software\"), including without limitation the\n  rights to use, copy, modify, merge, publish, distribute, sublicense,\n  and/or sell copies of the Software, and to permit persons who receive\n  copies from any such party to do so, with the only requirement being\n  that this copyright notice remain intact.\n\n6)\n\n  The documentation for the composition operators is copied from the\n  rlecomp manual page, which is authored by Rod Bogart and John W.\n  Peterson. Rlecomp is part of the Utah Raster Toolkit distributed by the\n  University of Michigan and the University of Utah. The copyright for\n  this manual page is as follows:\n\n  Copyright (c) 1986, University of Utah\n\n  This software is copyrighted as noted below.  It may be freely copied,\n  modified, and redistributed, provided that the copyright notice is\n  preserved on all copies.\n\n  There is no warranty or other guarantee of fitness for this software,\n  it is provided solely \"as is\".  Bug reports or fixes may be sent\n  to the author, who may or may not act on them as he desires.\n\n  You may not include this software in a program or other software product\n  without supplying the source, or without informing the end-user that the\n  source is available for no extra charge.\n\n  If you modify this software, you should include a notice giving the\n  name of the person performing the modification, the date of modification,\n  and the reason for such modification.\n\n7)\n\n  The source code comprising magick_endian.c is originally derived\n  from libtiff which has the following license:\n\n  | Copyright (c) 1988-1997 Sam Leffler\n  | Copyright (c) 1991-1997 Silicon Graphics, Inc.\n\n  Permission to use, copy, modify, distribute, and sell this software and\n  its documentation for any purpose is hereby granted without fee, provided\n  that (i) the above copyright notices and this permission notice appear in\n  all copies of the software and related documentation, and (ii) the names of\n  Sam Leffler and Silicon Graphics may not be used in any advertising or\n  publicity relating to the software without the specific, prior written\n  permission of Sam Leffler and Silicon Graphics.\n\n  THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n  EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n  WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n\n  IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n  ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n  WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF\n  LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n  OF THIS SOFTWARE.\n\n8)\n\n  The C++ API known as \"Magick++\", and which resides in the Magick++\n  directory, is distributed under the following license:\n\n  Copyright 1999 - 2012 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>\n\n  Permission is hereby granted, free of charge, to any person\n  obtaining a copy of this software and associated documentation files\n  (\"Magick++\"), to deal in the Software without restriction, including\n  without limitation the rights to use, copy, modify, merge, publish,\n  distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so, subject\n  to the following conditions:\n\n  The above copyright notice and this permission notice shall be\n  included in all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n  SOFTWARE.\n\n9)\n\n  The GraphicsMagick HaldClutImagePixels() function in magick/hclut.c\n  is based on source code from the HaldCLUT package by Eskil Steenberg\n  (http://www.quelsolaar.com/technology/clut.html) which is\n  distributed under the following license:\n\n  Copyright (c) 2005 Eskil Steenberg.  All rights reserved.\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions\n  are met:\n\n  1. Redistributions of source code must retain the above copyright\n     notice, this list of conditions and the following disclaimer.\n\n  2. Redistributions in binary form must reproduce the above copyright\n     notice, this list of conditions and the following disclaimer in the\n     documentation and/or other materials provided with the distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE AUTHOR \\`\\`AS IS\\'\\' AND ANY EXPRESS OR\n  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n10)\n\n  GraphicsMagick makes use of third-party \"delegate\" libraries to\n  support certain optional features. These libraries bear their own\n  copyrights and licenses, which may be more or less restrictive than the\n  GraphicsMagick license. For convenience, when GraphicsMagick is\n  bundled with (or compiled with) \"delegate\" libraries, a copy of the\n  licenses for these libraries is provided in a \"licenses\" directory.\n\n--------------------------------------------------------------------------\n\n.. |copy|   unicode:: U+000A9 .. COPYRIGHT SIGN\n\nCopyright |copy| GraphicsMagick Group 2002 - 2018\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/NEWS.txt",
    "content": ".. -*- mode: rst -*-\n.. This text is in reStucturedText format, so it may look a bit odd.\n.. See http://docutils.sourceforge.net/rst.html for details.\n\n===================\nGraphicsMagick News\n===================\n\nThis file was last updated to reflect changes up to February 23, 2020\n\nPlease note that this file records news for the associated development\nbranch and that each development branch has its own NEWS file. See the\nChangeLog file, and/or the Mercurial changesets, for full details.\n\nDue to significant issues being discovered and addressed for almost\nevery release, it is recommended to update to the most current\nrelease and not attempt to patch older releases.\n\n.. contents::\n  :local:\n\n1.3.35 (February 23, 2020)\n==========================\n\nSpecial Issues:\n\n* It has been discovered that the 'ICU' library (a perhaps 30MB C++\n  library) which is now often a libxml2 dependendency causes huge\n  process initialization overhead.  This is noticed as unexpected\n  slowness when GraphicsMagick utilities are used to process small to\n  medium sized files.  The time to initialize the 'ICU' library is\n  often longer than the time that GraphicsMagick would otherwise\n  require to read the input file, process the image, and write the\n  output file.  If the 'ICU' dependency can not be avoided, then make\n  sure to use the modules build so there is only impact for file\n  formats which require libxml2.  Please lobby the 'ICU' library\n  developers to change their implementation to avoid long start-up\n  times due to merely linking with the library.\n\nSecurity Fixes:\n\n* GraphicsMagick is now participating in Google's oss-fuzz project due\n  to the contributions and assistance of Alex Gaynor. Since February 4\n  2018, 398 issues have been opened by oss-fuzz (some of which were\n  benign build issues) and 11 issues remain open.\n  The issues list is available at\n  https://bugs.chromium.org/p/oss-fuzz/issues/list under search term\n  \"graphicsmagick\".  Issues are available for anyone to view and\n  duplicate if they have been in \"Verified\" status for 30 days, or if\n  they have been in \"New\" status for 90 days.  There are too many\n  fixes to list here.  Please consult the GraphicsMagick ChangeLog\n  file, Mercurial repository commit log, and the oss-fuzz issues list\n  for details.\n\nBug fixes:\n\n* Fix broken definition of ResourceInfinity which resulted in that\n  GetMagickResource() would return -1 rather than the maximum range\n  value for the return type as documented. (problem added by the\n  1.3.32 release).\n\n* ModifyCache(): Re-open the pixel cache if the cache rows/columns do\n  not match the owning image rows/columns.\n\n* Fix DisplayImages() return status.  The return status was inverted.\n\n* HISTOGRAM: Histogram once again includes the histogram as a text\n  comment.  This became broken by previous security fixes.\n\n* PICT: Fixed heap buffer overuns reported multiple sources.\n\n* JNG: Detect when JPEG encoder has failed and throw an exception.\n\n* MVG/DrawImage(): Performs even more parsing validations.\n\n* Clang static analyzer fixes: A great many fixes were made based on\n  problem reports by the Clang static analyzer.\n\n* Visual Studio static analyzer fixes: A great many fixes were made\n  based on problem reports by the Visual Studio 2019 static analyzer.\n  Many of these may improve the robustness of 64-bit code.\n\nNew Features:\n\n* GRADIENT/GradientImage(): Improved accuracy of gradient levels as\n  well as dramaticaly improving performance.  Output PseudoClass\n  images if we can.  Add support for using the image 'gravity'\n  attribute as well as the \"gradient:direction\" definition to produce\n  gradient vector directions corresponding to SouthGravity (the\n  previously-existing default), NorthGravity, WestGravity,\n  EastGravity, NorthWestGravity, NorthEastGravity, SouthWestGravity,\n  and SouthEastGravity.\n\nAPI Updates:\n\n* InitializeMagickEx(): New function which may be used in place of\n  InitializeMagick() to initialize GraphicsMagick.  This\n  initialization function returns an error status value, may update a\n  passed ExceptionInfo structure with error information, and provides\n  an options parameter which supports simple bit-flags to tailor\n  initialization.  The signal handler registrations are skipped if the\n  MAGICK_OPT_NO_SIGNAL_HANDER flag is set in the options.\n\nFeature improvements:\n\n* Replace use of non-reentrant legacy POSIX functions with reentrant\n  equivalents.\n\n* Timing of image reads should now be very accurate.  The timer was\n  sometimes not stopped as soon as it should be.\n\n* PICT: The PICT reader is working pretty good now.  It handles all\n  the PICT image files I have available to me.\n\nWindows Delegate Updates/Additions:\n\n* None\n\nBuild Changes:\n\n* Visual Studio Build: Configure program now provides a checkbox to\n  enable common optimizations for better performance.\n\nBehavior Changes:\n\n* POSIX Signals: Use the normal termination signal handler for SIGXCPU\n  and SIGXFSZ so that ulimit or setrlimit(2) may be used to apply CPU\n  (RLIMIT_CPU) and output file size (RLIMIT_FSIZE) limits with the\n  normal cleanup, and without dumping core. Note that any output files\n  currently being written may be truncated and files being written by\n  external programs (e.g. Ghostscript) might be left behind unless\n  they are to a temporary file assigned by GraphicsMagick.\n\n* Some private string and integer constants were removed from the\n  apparent library ABI.  Some private functions were marked static and\n  removed from the apparent library ABI.  This is mentioned because\n  someone is sure to notice and be concerned about it.\n\n* The remaining private content in installed header files was moved\n  into -private.h header files which are not installed.  This should\n  not be cause for concern but is mentiond because someone is sure to\n  notice and be concerned about it.\n\n\n1.3.34 (December 24, 2019)\n==========================\n\nSpecial Issues:\n\n* It has been discovered that the 'ICU' library (a perhaps 30MB C++\n  library) which is now often a libxml2 dependendency causes huge\n  process initialization overhead.  This is noticed as unexpected\n  slowness when GraphicsMagick utilities are used to process small to\n  medium sized files.  The time to initialize the 'ICU' library is\n  often longer than the time that GraphicsMagick would otherwise\n  require to read the input file, process the image, and write the\n  output file.  If the 'ICU' dependency can not be avoided, then make\n  sure to use the modules build so there is only impact for file\n  formats which require libxml2.  Please lobby the 'ICU' library\n  developers to change their implementation to avoid long start-up\n  times due to merely linking with the library.\n\nSecurity Fixes:\n\n* GraphicsMagick is now participating in Google's oss-fuzz project due\n  to the contributions and assistance of Alex Gaynor. Since February 4\n  2018, 386 issues have been opened by oss-fuzz (some of which were\n  benign build issues) and 376 of those issues have been resolved.\n  The issues list is available at\n  https://bugs.chromium.org/p/oss-fuzz/issues/list under search term\n  \"graphicsmagick\".  Issues are available for anyone to view and\n  duplicate if they have been in \"Verified\" status for 30 days, or if\n  they have been in \"New\" status for 90 days.  There are too many\n  fixes to list here.  Please consult the GraphicsMagick ChangeLog\n  file, Mercurial repository commit log, and the oss-fuzz issues list\n  for details.\n\nBug fixes:\n\n* DPS: Eliminate a memory leak.\n\n* Debug Trace: Only output text to terminate an XML format log file if\n  XML format is active.\n\n* EXIF Parser: Detect non-terminal parsing and report an error.\n\n* EXIF Parser: Eliminate heap buffer overflows.\n\n* HuffmanDecodeImage(): Fix heap overflow in 32-bit applications.\n\n* MAT: Implement subimage/subrange support.\n\n* MVG: Address non-terminal loops, excessive run-time, thrown\n  assertions, divide-by-zero, heap overflow, and memory leaks.\n\n* OpenModule(): Now properly case-insensitive, as it used to be.\n\n* PCX: Verify that pixel region is not negative. Assure that opacity\n  channel is initialized to opaqueOpacity.  Update DirectClass\n  representation while PseudoClass representation is updated.  Improve\n  read performance with uncompressed PCX.\n\n* PICT: Fix heap overflow in PICT writer.\n\n* PNG: Fix validation of raw profile length.\n\n* PNG: Skip coalescing layers if there is only one layer.\n\n* PNM: Fix denial of service opportunity by limiting the length of PNM\n  comment text.\n\n* WPG: Avoid Avoid dereferencing a null pointer.\n\n* WPG: Implement subimage/subrange support.\n\n* WPG: Improve performance when reading an embedded image.\n\n* Wand library: In MagickClearException(), destroy any existing\n  exception info before re-initializing the exception info or else\n  there will be a memory leak.\n\n* XPM: Rquire that image properties appear in the first 512 bytes of\n  the XPM file header.\n\nNew Features:\n\n* Visual Studio build supports JBIG and WebP compression in TIFF format.\n\nAPI Updates:\n\n* None\n\nFeature improvements:\n\n* Compliles clean using GCC 9.\n\nWindows Delegate Updates/Additions:\n\n* bzlib: bzip is updated to 1.0.8 release.\n\n* jbig: jbigkit is updated to 2.1 release.\n\n* lcms: lcms2 is updated to 2.9 release.\n\n* libxml: libxml2 is updated to 2.9.10 release.\n\n* png: libpng is updated to 1.6.37 release.\n\n* tiff: libtiff is updated to 4.1.0 release.\n\n* webp: libwebp is updated to the 1.0.3 release.\n\n* zlib: zlib is updated to 1.2.11 release.\n\n* TIFF: Now also supports reading JBIG-compressed TIFF, and\n  reading/writing WebP-compressed TIFF.  A number of libtiff feature\n  options which are now commonly enabled were disabled and are now\n  enabled by default.\n\nBuild Changes:\n\n* MinGW: Static and shared library builds were not working.  Only the\n  modules build was actually working!\n\n* Python scripts related to the build (enabled by\n  --enable-maintainer-mode) are now compatible with Python 3.\n\n* Now supports using Google gperftools tcmalloc library for the memory\n  allocator.  This improves performance for certain repetitive\n  work-loads and heavily-threaded algorithms.\n\n* Configure now reports the status of zstd (FaceBook Zstandard)\n  compression in its configuration summary.\n\n* TclMagick: Address many issues mentioned by SourceForge issue #420\n  \"TclMagick issues and patch\".\n\nBehavior Changes:\n\n* PNG: Post-processing to convert the image type in the PNG reader\n  based on a specified magick prefix string is now disabled.  This can\n  (and should) be done after the image has been returned.\n\n* Trace Logging: The compiled-in logging default is always to stderr,\n  which may be over-ridden using log.mgk as soon as it is loaded.\n\n* Windows Build: Search registry key HKEY_CURRENT_USER as well as\n  HKEY_LOCAL_MACHINE when searching for Ghostscript.  By following the\n  procedure documented in SourceForge bug 615 \"GhostScript\n  installation check\", this allows for local user installations\n  without \"administrator\" privileges.\n\n1.3.33 (July 20, 2019)\n==========================\n\nSpecial Issues:\n\n* It has been discovered that the 'ICU' library (a perhaps 30MB C++\n  library) which is now often a libxml2 dependendency causes huge\n  process initialization overhead.  This is noticed as unexpected\n  slowness when GraphicsMagick utilities are used to process small to\n  medium sized files.  The time to initialize is often longer than the\n  time to read the input file, process the image, and write the output\n  file.  If the 'ICU' dependency can not be avoided, then make sure to\n  use the modules build.  Please lobby the 'ICU' library developers to\n  change their implementation to avoid long start-up times due to\n  merely linking with the library.\n\nSecurity Fixes:\n\n* GraphicsMagick is now participating in Google's oss-fuzz project due\n  to the contributions and assistance of Alex Gaynor. Since February 4\n  2018, 353 issues have been opened by oss-fuzz and 338 of those\n  issues have been resolved.  The issues list is available at\n  https://bugs.chromium.org/p/oss-fuzz/issues/list under search term\n  \"graphicsmagick\".  Issues are available for anyone to view and\n  duplicate if they have been in \"Verified\" status for 30 days, or if\n  they have been in \"New\" status for 90 days.  There are too many\n  fixes to list here.  Please consult the GraphicsMagick ChangeLog\n  file, Mercurial repository commit log, and the oss-fuzz issues list\n  for details.\n\n* Documentation has been added regarding security hazards due to\n  commands which support a '@filename' syntax.\n\n* MontageImages(): Fix wrong length argument to strlcat() when\n  building montage directory, which could allow heap overwrite.\n\nBug fixes:\n\n* PNG: Pass correct size value to strlcat() in module registration\n  code.  This bug is noticed to cause problems for Apple's OS X and\n  Linux Alpine with musl libc.  This fixes a regression introduced by\n  the 1.3.32 release.\n\n* Re-implement command-line utility `'@'` file inclusion support for\n  `-comment`, `-draw`, `-format`, and `-label` which was removed for\n  the 1.3.32 release.  The new implementation is isolated to\n  command-line utility implementation code rather than being deeply\n  embedded in the library and exposed in other usage contexts.  This\n  fixes a regression introduced by the 1.3.32 release.\n\n* CAPTION: The The CAPTION reader did not appear to work at all any\n  more.  Now it works again, but still not very well.\n\n* MagickXDisplayImage(): Fix heap overwrite of windows->image.name and\n  windows->image.icon_name buffers.  This bug has surely existed since\n  early GraphicsMagick releases.\n\n* MagickXAnimateImages(): Fix memory leak of scene_info.pixels.\n\n* AcquireTemporaryFileDescriptor(): Fix compilation under Cygwin. This\n  fixes a regression introduced by the 1.3.32 release.\n\n* PNG: Fix saving to palette when mage has an alpha channel but no\n  color is marked as transparent.\n\n* Compilation warnings in the Visual Studio WIN64 build due to the\n  'long' type being only 32-bits have been addressed.\n\nNew Features:\n\n* None\n\nAPI Updates:\n\n* None\n\nFeature improvements:\n\n* None\n\nWindows Delegate Updates/Additions:\n\n* None\n\nBuild Changes:\n\n* None\n\nBehavior Changes:\n\n* Support for `'@'` file inclusion support for `-comment`, `-draw`,\n  `-format`, and `-label` has been restored.\n\n1.3.32 (June 15, 2019)\n==========================\n\nSpecial Issues:\n\n* It has been discovered that the 'ICU' library (a perhaps 30MB C++\n  library) which is now often a libxml2 dependendency causes huge\n  process initialization overhead.  This is noticed as unexpected\n  slowness when GraphicsMagick utilities are used to process small to\n  medium sized files.  The time to initialize is often longer than the\n  time to read the input file, process the image, and write the output\n  file.  If the 'ICU' dependency can not be avoided, then make sure to\n  use the modules build.  Please lobby the 'ICU' library developers to\n  change their implementation to avoid long start-up times due to\n  merely linking with the library.\n\nSecurity Fixes:\n\n* GraphicsMagick is now participating in Google's oss-fuzz project due\n  to the contributions and assistance of Alex Gaynor. Since February 4\n  2018, 343 issues have been opened by oss-fuzz and 331 of those\n  issues have been resolved.  The issues list is available at\n  https://bugs.chromium.org/p/oss-fuzz/issues/list under search term\n  \"graphicsmagick\".  Issues are available for anyone to view and\n  duplicate if they have been in \"Verified\" status for 30 days, or if\n  they have been in \"New\" status for 90 days.  There are too many\n  fixes to list here.  Please consult the GraphicsMagick ChangeLog\n  file, Mercurial repository commit log, and the oss-fuzz issues list\n  for details.\n\n* BMP reader: Fix heap overflow in 32-bit build due to arithmetic\n  overflow. Only happens if limits are changed from defaults.\n\n* BMP reader/writer: Improve buffer-size calculations to guard against\n  buffer overflows.\n\n* DIB reader: Reject files which claim more than 8-bits per pixel but\n  also claim to be colormapped.\n\n* DIB reader/writer: Improve buffer-size calculations to guard against\n  buffer overflows.\n\n* MIFF reader: Detect end of file while reading RLE packets.\n\n* MIFF reader: Fix heap overflow (for some files using RLE\n  compression) caused by a typo in the code.\n\n* MAT writer: Added missing error handling to avoid heap overflow.\n\n* MNG reader: Fixed a small heap buffer overflow.\n\n* SVG reader: Fixed a stack buffer overflow.\n\n* TGA writer: Fix heap overflow when image rows/columns are larger\n  than 65535.\n\n* TIFF reader: Rationalize tile width/height to reject large tile\n  sizes which are much larger than the image dimensions.\n\n* TIFF reader: Apply memory resource limits to strip and tile allocations.\n\n* WMF reader: Fixed a division by zero problem.\n\n* XWD reader: Many heap buffer overflows and uses of uninitialized data were fixed.\n\n* Pixel cache: Now apply resource limits to pixel nexus allocations\n  using the same limits (total pixels, width, height, memory) as\n  applied to the whole image since some requests are directly\n  influenced by the input file.  More tests are added for arithmetic\n  overflow.  Care was taken to minimize performance impact due to the\n  many extra checks.\n\nBug fixes:\n\n* See above note about oss-fuzz fixes.\n\n* Fixed include order of magick/api.h vs wand/wand_symbols.h.\n\n* WriteImage(): Eliminate use of just-freed memory in\n  clone_info->magick when throwing exception due to no support for\n  format.\n\n* Magick++/lib/Magick++/Drawable.h: Fix use of clang diagnostic syntax.\n\n* DIB: Preserve PseudoClass opaque representation if ICO mask is opaque.\n\n* JPEG reader: Restore ability to access detailed image properties\n  while in 'ping' mode.\n\n* JPEG reader: Base test for \"Unreasonable dimensions\" on original\n  JPEG dimensions and not the scaled dimensions.\n\n* JPEG reader: Allow input files to have a compression ratio as high\n  as 2500.  Extremely compressed files were being rejected.\n\n* FreeType renderer: Fixed a memory leak.\n\n* PDF writer: Fixed a memory leak.\n\n* PDF writer: Fixed a thread safety problem.\n\n* PICT reader: Fix a thread safety problem.\n\n* Exception reporting: Throwing an exception was not thread safe.  Now it is.\n\n* Exception reporting: Handle the case where some passed character\n  strings refer to existing exception character strings.\n\n* Command-line parser now does not attempt to read a list of filenames\n  from a file in '@name' syntax if the path '@name' exists.\n  Previously it would attempt to read a list of file names from 'name'\n  even if '@name' did exist.\n\n* Rendering: Short-circuit path parsing and return and error\n  immediately if an error occurs.\n\nNew Features:\n\n* Added support for writing the Braille image format (by Samuel\n  Thibault).\n\n* WebP writer: Support WebP 'use_sharp_yuv' option (\"if needed, use\n  sharp (and slow) RGB->YUV conversion\") via `-define\n  webp:use-sharp-yuv=true`.\n\n* The version command output now reports the OpenMP specification\n  number rather than just the integer version identifier.\n\nAPI Updates:\n\n* ReallocateImageColormap() added to re-allocate an existing colormap.\n\n* Some improperly-exposed globals are now static as they should have\n  been.\n\nFeature improvements:\n\n* Microsoft Windows timing information now uses\n  QueryPerformanceFrequency() and QueryPerformanceCounter() for\n  increased precision.\n\n* The 'benchmark' command now shows 6 digits (microseconds) of elapsed\n  time indication.\n\n* The 'time' command now shows 6 digits (microseconds) of elapsed time\n  indication.\n\n* The logging facility now shows 6 digits (microseconds) of time\n  resolulution\n\n* Dcraw: When QuantumDepth is greater than 8, pass -6 option to dcraw\n  so that it returns a 16-bit/sample image.\n\n* Dcraw: If Dcraw supports TIFF format, then request TIFF format in\n  order to be able to acquire more metatdata.\n\n* Scale algorithm: Eliminate artifacts when scaling an image with\n  semi-transparent pixels.\n\n* Library metrics: The number of shared library relocations and the\n  amount of initialized data has been signficantly reduced by\n  following recommendations from Ulrich Drepper's document `How To\n  Write Shared Libraries <https://akkadia.org/drepper/dsohowto.pdf>`_.\n\n  For comparison, these are the differences in library metrics between\n  the 1.3.31 and 1.3.32 releases for a simple shared library with all\n  features supported:\n\n  +---------+-------------+------------------+------------+\n  | Release | Relocations | Initialized Data | Total Size |\n  +=========+=============+==================+============+\n  | 1.3.31  |      12,432 |          506,496 |  3,587,227 |\n  +---------+-------------+------------------+------------+\n  | 1.3.32  |         747 |          127,936 |  3,033,279 |\n  +---------+-------------+------------------+------------+\n\n  and these are the differences in library metrics between 1.3.31 and\n  1.3.32 for a shared library using the modules option (recommended!)\n  with all features supported:\n\n  +---------+-------------+------------------+------------+\n  | Release | Relocations | Initialized Data | Total Size |\n  +=========+=============+==================+============+\n  | 1.3.31  |       5,370 |          176,784 |  1,940,620 |\n  +---------+-------------+------------------+------------+\n  | 1.3.32  |         367 |          119,472 |  1,825,651 |\n  +---------+-------------+------------------+------------+\n\n  As can be seen, the number of relocations was extreme and has been\n  reduced to reasonable levels while also diminishing the amount of\n  initialized data and the total size of the library/program.  Most of\n  the remaining initialized data (106,648 bytes) and some of the\n  relocations (65 relocations) may be attributed to the optional X11\n  animate/display/import support.\n\nWindows Delegate Updates/Additions:\n\n* None\n\nBuild Changes:\n\n* The test suite now passes even if no fonts are found.\n\n* Configure script does better at finding Windows fonts on non-Windows systems.\n\n* The configure script now supports the option --with-mtmalloc to\n  enable use of the mtmalloc library as found on Solaris-derived\n  systems.\n\nBehavior Changes:\n\n* AnnotateImage(): No longer implicitly call TranslateText() since\n  this is not suitable for most use-cases and causes additional\n  performance impact.  The API user can perform such translations in\n  advance on the text string using TranslateText() if need be.\n\n\n1.3.31 (November 17, 2018)\n==========================\n\nSpecial Issues:\n\n* Firmware and operating system updates to address the Spectre\n  vulnerability (and possibly to some extent the Meltdown\n  vulnerability) have substantially penalized GraphicsMagick's OpenMP\n  performance.  Performance is reduced even with GCC 7 and 8's\n  improved optimizers. There does not appear to be anything we can do\n  about this.\n\nSecurity Fixes:\n\n* GraphicsMagick is now participating in Google's oss-fuzz project due\n  to the contributions and assistance of Alex Gaynor. Since February 4\n  2018, 292 issues have been opened by oss-fuzz and 279 of those\n  issues have been resolved.  The issues list is available at\n  https://bugs.chromium.org/p/oss-fuzz/issues/list under search term\n  \"graphicsmagick\".  Issues are available for anyone to view and\n  duplicate if they have been in \"Verified\" status for 30 days, or if\n  they have been in \"New\" status for 90 days.  There are too many\n  fixes to list here.  Please consult the GraphicsMagick ChangeLog\n  file, Mercurial repository commit log, and the oss-fuzz issues list\n  for details.\n\nBug fixes:\n\n* See above note about oss-fuzz fixes.\n\n* CINEON: Fix unexpected hang on a crafted Cineon image.  SourceForge\n  issue 571.\n\n* Drawing recursion is limited to 100 and may be tuned via the\n  MAX_DRAWIMAGE_RECURSION pre-processor definition.\n\n* Fix reading MIFF files using legacy keyword 'color-profile' for ICC\n  color profile as was used by ImageMagick 4.2.9.\n\n* Fix reading/writing files when 'magick' is specified in lower case.\n  This bug was a regression in 1.3.30.\n\n\nNew Features:\n\n* TIFF: Support Zstd compression in TIFF.  This requires libtiff\n  4.0.10 or later.\n\n* TIFF: Support WebP compression in TIFF.  This requires libtiff\n  4.0.10 or later.\n\nAPI Updates:\n\n* MagickMonitor() is marked as deprecated.  Code should not be using\n  this function any more.\n\nFeature improvements:\n\n* The progress monitor callbacks (registered using MagickMonitor() or\n  MagickMonitorFormatted()) are serialized via a common semaphore\n  rather than via critical sections in OpenMP loops.  OpenMP loops are\n  updated to use OpenMP 'atomic' and 'flush' to update shared loop\n  variables rather than using a OpenMP 'critical' construct, reducing\n  contention.  Performance on some targets is observed to have been\n  improved by this change.\n\nWindows Delegate Updates/Additions:\n\n* None\n\nBuild Changes:\n\n* There was already a 'compare' command installed with the\n  '--enable-magick-compat' configure option was used but it did not\n  function.  Now it functions.  There was no `compare` command in\n  ImageMagick 5.5.2 and this compare command is only roughly similar\n  to a `compare` command in some subsequent ImageMagick release.\n\n* Removed Remove Ghostscript library support (--with-gslib) from\n  configure script.  The 'HasGS' pre-processor defines which were\n  enabled by this remain in the source code so it is still possible to\n  use this library if absolutely necessary (e.g. CPPFLAGS=-DHasGS\n  LIBS=-lgs).\n\n* No longer explicitly link with the OpenMP library when it will be\n  supplied already due to CFLAGS.\n\nBehavior Changes:\n\n* JPEG: Libjpeg-turbo is allowed 1/5th the memory resource limit\n  provided for Graphicsmagick via the cinfo->mem->max_memory_to_use\n  option, which is part of the IJG JPEG API/ABI, but usually not\n  supported there.  This feature works for libjpeg-turbo 1.5.2 and\n  later.  Limiting the memory usage is useful since libjpeg-turbo may\n  otherwise consume arbitrary amounts of memory even before\n  Graphicsmagick is informed of the image dimensions.\n\n* JPEG: The maximum number of JPEG progressive scans is limited to 50.\n  Otherwise some technically valid files could be read for almost\n  forever.\n\n\n1.3.30 (June 23, 2018)\n=========================\n\nSpecial Issues:\n\n* None\n\nSecurity Fixes:\n\n* GraphicsMagick is now participating in Google's oss-fuzz project due\n  to the contributions and assistance of Alex Gaynor. Since February 4\n  2018, 238 issues have been opened by oss-fuzz and 230 of those\n  issues have been resolved.  The issues list is available at\n  https://bugs.chromium.org/p/oss-fuzz/issues/list under search term\n  \"graphicsmagick\".  Issues are available for anyone to view and\n  duplicate if they have been in \"Verified\" status for 30 days, or if\n  they have been in \"New\" status for 90 days.  There are too many\n  fixes to list here.  Please consult the GraphicsMagick ChangeLog\n  file, Mercurial repository commit log, and the oss-fuzz issues list\n  for details.\n\n* SVG/Rendering: Fix heap write overflow of PrimitiveInfo and\n  PointInfo arrays.  This is another manefestation of CVE-2016-2317,\n  which should finally be fixed correctly due to active\n  detection/correction of pending overflow rather than using\n  estimation.\n\nBug fixes:\n\n* Many oss-fuzz fixes are bug fixes.\n\n* Drawing/Rendering: Many more fixes by Gregory J Wolfe (see the ChangeLog).\n\n* MIFF: Detect end of file while reading image directory.\n\n* SVG: Many more fixes by Gregory J Wolfe (see the ChangeLog).\n\n* The AlphaCompositePixel macro was producing wrong results when the\n  output alpha value was not 100% opaque. This is a regression\n  introduced in 1.3.29.\n\n* TILE: Fix problem with tiling JPEG images because the size request\n  used by the TILE algorithm was also causing re-scaling in the JPEG\n  reader.  The problem is solved by stripping the size request before\n  reading the image.\n\nNew Features:\n\n* None\n\nAPI Updates:\n\n* The size of PrimitiveInfo (believed to be an internal/private\n  structure but in a header which is installed, has been increased to\n  store a 'flags' argument. This is intended to be an internal\n  interface but but may be detected as an ABI change.\n\nFeature improvements:\n\n* None\n\nWindows Delegate Updates/Additions:\n\n* None\n\nBuild Changes:\n\n* The oss-fuzz build script (fuzzing/oss-fuzz-build.sh) now includes\n  many delegate libraries such as zlib, libpng, libtiff, libjpeg, and\n  freetype, resulting in more comprehensive testing.  The Q16 build is\n  now being tested rather than the 'configure' default of Q8.\n\nBehavior Changes:\n\n* JPEG: The JPEG reader now allows 3 warnings of any particular type\n  before giving up on reading and throwing an exception.  This choice\n  was made after observing files which produce hundreds of warnings\n  and consume massive amounts of memory before reading the image data\n  has even started.  It is currently unknown how many files which were\n  previously accepted will be rejected by default.  The number of\n  allowed warnings may be adjusted using '-define\n  jpeg:max-warnings=<value>'.  The default limit will be adjusted\n  based on reported user experiences and may be adjusted prior to\n  compilation via the MaxWarningCount definition in coders/jpeg.c.\n\n\n1.3.29 (April 29, 2018)\n=========================\n\nSpecial Issues:\n\n* None\n\nSecurity Fixes:\n\n* GraphicsMagick is now participating in Google's oss-fuzz project due\n  to the contributions and assistance of Alex Gaynor. Since February 4\n  2018, 180 issues have been opened by oss-fuzz and 173 of those\n  issues have been resolved.  The issues list is available at\n  https://bugs.chromium.org/p/oss-fuzz/issues/list under search term\n  \"graphicsmagick\".  Issues are available for anyone to view and\n  duplicate if they have been in \"Verified\" status for 30 days, or if\n  they have been in \"New\" status for 90 days.  There are too many\n  fixes to list here.  Please consult the GraphicsMagick ChangeLog\n  file, Mercurial repository commit log, and the oss-fuzz issues list\n  for details.\n\n* JNG: Require that the embedded JPEG image have the same dimensions\n  as the JNG image as provided by JHDR. Avoids a heap write overflow.\n\n* MNG: Arbitrarily limit the number of loops which may be requested by\n  the MNG LOOP chunk to 512 loops, and provide the '-define\n  mng:maximum-loops=value' option in case the user wants to change the\n  limit.  This fixes a denial of service caused by large LOOP\n  specifications.\n\nBug fixes:\n\n* Many oss-fuzz fixes are bug fixes.\n\n* DICOM: Pre/post rescale functions are temporarily disabled (until\n  the implementation is fixed).\n\n* JPEG: Fix regression in last release in which reading some JPEG\n  files produces the error \"Improper call to JPEG library in state\n  201\".\n\n* ICON: Some DIB-based Windows ICON files were reported as corrupt to\n  an unexpectedly missing opacity mask image.\n\n* In-memory Blob I/O: Don't implicitly increase the allocation size\n  due to seek offsets.\n\n* MNG: Detect and handle failure to allocate global PLTE. Fix divide\n  by zero.\n\n* DrawGetStrokeDashArray(): Check for failure to allocate memory.\n\n* BlobToImage(): Now produces useful exception reports to cover the\n  cases where 'magick' was not set and the file format could not be\n  deduced from its header.\n\nNew Features:\n\n* None\n\nAPI Updates:\n\n* Wand API: Added MagickIsPaletteImage(), MagickIsOpaqueImage(),\n  MagickIsMonochromeImage(), MagickIsGrayImage(), MagickHasColormap()\n  based on contributions by Troy Patteson.\n\n* New structure ImageExtra added and Image 'clip_mask' member is\n  replaced by 'extra' which points to private ImageExtra allocation.\n  The ImageGetClipMask() function now provides access to the clip mask\n  image.\n\n* New structure DrawInfoExtra and DrawInfo 'clip_path' is replaced by\n  'extra' which points to private DrawInfoExtra allocation.  The\n  DrawInfoGetClipPath() function now provides access to the clip path.\n\n* New core library functions: GetImageCompositeMask(),\n  CompositeMaskImage(), CompositePathImage(), SetImageCompositeMask(),\n  ImageGetClipMask(), ImageGetCompositeMask(), DrawInfoGetClipPath(),\n  DrawInfoGetCompositePath()\n\n* Deprecated core library functions: RegisterStaticModules(),\n  UnregisterStaticModules().\n\nFeature improvements:\n\n* Static modules (in static library or shared library without\n  dynamically loadable modules) are now lazy-loaded using the same\n  external interface as the lazy-loader for dynamic modules.  This\n  results in more similarity between the builds and reduces the fixed\n  initialization overhead by only initializing the modules which are\n  used.\n\n* SVG: The quality of SVG support has been significantly improved due\n  to the efforts of Greg Wolfe.\n\n* FreeType/TTF rendering: Rendering fixes for opacity.\n\nWindows Delegate Updates/Additions:\n\n* None\n\nBuild Changes:\n\n* None\n\nBehavior Changes:\n\n* None\n\n\n1.3.28 (January 20, 2018)\n=========================\n\nSpecial Issues:\n\n* None\n\nSecurity Fixes:\n\n* BMP: Fix non-terminal loop due to unexpected bit-field mask value\n  (DOS opportunity).\n\n* PALM: Fix heap buffer underflow in builds with QuantumDepth=8.\n\n* SetNexus() Fix heap overwrite under certain conditions due to using\n  a wrong destination buffer.  This issue impacts all 1.3.X releases.\n\n* TIFF: Fix heap buffer read overflow in LocaleNCompare() when parsing\n  NEWS profile.\n\nBug fixes:\n\n* DescribeImage(): Eliminate possible use of null pointer.\n\n* GIF: Fix memory leak of global colormap in error path.\n\n* GZ: Writing to gzip files with the extension \".gz\" was not working\n  with Zlib 1.2.8.\n\n* JNG: Fix buffer read overflow (a tiny fixed overflow of just one byte).\n\n* JPEG: Promoting certain libjpeg warnings to errors caused much more\n  problems than expected.  The promotion of warnings to errors is\n  removed.  Claimed pixel dimensions are validated by file size before\n  allocating memory for the pixels.\n\n* IntegralRotateImage(): Assure that reported error in rotate by 270\n  case does immediately terminate processing.\n\n* MNG: Fix possible null pointer reference related to DEFI chunk\n  parsing.  Fix minor heap read overflow (constrained to just one\n  byte) due to an ordering issue in a limit check.  Fix memory leaks\n  in error path.\n\n* WebP: Fix stack buffer overflow in WriteWEBPImage() which occurs\n  with libwebp 0.5.0 or newer due to a structure type change in the\n  structure passed to the progress monitor callback.\n\n* WPG: Memory leaks fixed.\n\nNew Features:\n\n* None\n\nAPI Updates:\n\n* InterpolateViewColor(): This function now returns MagickPassFail (an\n  unsigned int) rather than void so that errors can be efficiently\n  reported.\n\n* The magick/pixel_cache.h header is updated to add deprecation\n  attributes such that code using GetPixels(), GetIndexes(), and\n  GetOnePixel() will produce deprecation warnings for compilers which\n  support them.  These functions will not be removed in the 1.3.X\n  release series and when they are removed, pre-processor macros will\n  be added so a replacement function is used instead.  There is a\n  long-term objective to eliminate functionally-redundant pixel cache\n  functions to only the ones with the best properties since this\n  reduces maintenance and may reduce the depth of the call stack\n  (improving performance).\n\nFeature improvements:\n\n* None\n\nWindows Delegate Updates/Additions:\n\n* None\n\nBuild Changes:\n\n* PerlMagick: Sanitize PACKAGE_VERSION so that Perl is not confused by\n  any trailing alpha character.\n\n* Improved symbol renaming due to adding --enable-symbol-prefix.  Some\n  symbols (for static const strings) were not being included in the\n  renaming.\n\n\nBehavior Changes:\n\n* None\n\n1.3.27 (December 9, 2017)\n=========================\n\nSpecial Issues:\n\n* None\n\nSecurity Fixes:\n\n* CMYK: Fix heap overwrites in raw CMYK writer.  Fix heap overwrites\n  in raw CMYK reader (noticed when doing montage).\n\n* GIF: Assure that global colormap is initialized.\n\n* DescribeImage(): Fix possible heap write overflow when describing\n  visual image directory. Fix possible heap read overflow while\n  accessing heap data, and possible information disclosure while\n  describing the IPTC profile.\n\n* DICOM: Fix huge memory allocation based on bogus length value (DOS\n  opportunity).\n\n* DrawDashPolygon(): Fix heap out of bounds read in render code.\n\n* GRAY: Fix heap overwrites in raw GRAY reader (noticed when doing\n  montage).\n\n* JNG: Fix heap overruns.  Fix assertions.\n\n* JNG: Prevent a crash due to zero-length color_image while reading a\n  JNG image. (CVE-2017-11102).  Reject JNG files with unreasonable\n  dimensions given the file size (avoid DOS).\n\n* JNX: Fix DOS due to excessive memory allocations with corrupt file.\n\n* JPEG: Do not allocate backing image pixels until a scanline has been\n  successfully read.  Avoids DOS opportunity with suitably\n  manufactured file.\n\n* MAP: Fix null pointer dereference or segmentation violation.\n\n* MAT: Fix heap write overflow.\n\n* MNG: Reject over-large (65k by 65k) image.  Fix heap overwrites.\n\n* PAM: Fix heap buffer overflow in PAM writer for 1 bit/sample + alpha.\n\n* PICT: Fix excessive memory allocation due to malformed image file.\n\n* PNG: Fix heap buffer overflow in PNG writer when promoting from\n  indexed PNG to RGBA.\n\n* PNM: Fix DOS due to excessive memory allocations with corrupt file.\n\n* RGB: Fix heap overwrite in raw RGB writer. Fix heap overwrites in\n  raw RGB reader (noticed when doing montage).\n\n* RLE: Fix DOS opportunities due to false claims in image header.  Fix\n  heap out of bounds read.\n\n* SFW: Avoid possible heap write overflow.\n\n* SUN: Fix heap read overflow.  Fix DOS due to excessive memory\n  allocations with corrupt file.\n\n* SVG: Fix heap write overflow.\n\n* TIFF: Use heuristics to avoid DOS (excessive memory use) due to\n  false claims by input file.  It is possible that this may reject\n  some valid files.  Fix possible small heap overwrite beyond the\n  allocated scanline buffer due to the NumberOfObjectsInArray() macro\n  rounding up rather than down.\n\n* UIL: Fix heap overwrite in writer.\n\n* WPG: Fix DOS issues (memory, disk space, CPU time) due to\n  insufficient validations.  Fix heap overwrites.\n\n* XBM: Fix DOS issue where code remains stuck in loop and does not\n  return.\n\n* XV 332 (PNM): Fix null pointer dereference due to malformed file.\n\n* TracePSClippingPath()/TraceSVGClippingPath(): Fix heap out of bounds\n  read.\n\n* Validate path entries in the MAGICK_CODER_MODULE_PATH and\n  MAGICK_FILTER_MODULE_PATH environment variables and convert all\n  paths to real paths if possible. This avoids possible use of\n  relative paths to load modules (a possible security issue), or the\n  possibility of adding a directory which was in the path, but\n  missing, and may improve efficiency by removing non-existent paths.\n\nBug fixes:\n\n* AVS: Memory leaks eliminated.\n\n* CINEON: Fix possible use of NULL pointer.\n\n* CMYK: Memory leaks eliminated.\n\n* CUT: Memory leaks eliminated.  Fix possible use of NULL pointer.\n\n* DCM: Fix possible use of NULL pointer.\n\n* DrawImage(): Avoid \"negative\" strncpy().  This seems to be benign\n  with glibc but perhaps not with other implementations.\n\n* DPX: Memory leaks eliminated.\n\n* EMF: Fix possible use of NULL pointer.\n\n* FindMagickModule(): Fix possible use of NULL pointer.\n\n* FITS: Fix memory leak.\n\n* GIF: Fix memory leak.\n\n* HDF: Memory leaks eliminated.\n\n* HISTOGRAM: Fix memory leak.\n\n* JNG: Memory leaks eliminated. Memory use after free and double-free\n  issues eliminated.  Error reporting fixes.\n\n* Magick::Options::strokeDashArray(): Fix possible use of NULL pointer.\n\n* MagickXFileBrowserWidget(): Fix possible use of NULL pointer.\n\n* MAT: Memory leaks eliminated.\n\n* MagickMapCloneMap(): Fix possible assertion failure.\n\n* MNG: Memory use after free issues eliminated.  Fix possible use of\n  NULL pointer.  Fix memory leaks.\n\n* MontageImageCommand(): Fix memory leaks.\n\n* MPC: Fix memory leak in writer.\n\n* MPEG: Fix memory leaks in writer.\n\n* MTV: Memory leaks eliminated.\n\n* NTRegistryKeyLookup(): Fix possible use of NULL pointer.\n\n* NTGetTypeList(): Fix possible use of NULL pointer.\n\n* PCD: Memory leaks eliminated.\n\n* PCL: Fix null pointer dereference in PCL writer.\n\n* PCX: Memory leaks eliminated.\n\n* PALM: Fix possible use of NULL pointer. Fix memory leak.\n\n* PICT: Memory leaks eliminated.\n\n* PNG: Fix small (one-off) heap read overflow.\n\n* PNM: Fix memory leaks.\n\n* PS: Fix use of null pointer in error path.\n\n* PWP: Fix possible use of null pointer.\n\n* ReplaceImageColormap(): Throw an exception rather than assertion if\n  the input image is not colormapped.\n\n* RGB: Fix memory leak.\n\n* SegmentImage(): Fix possible use of NULL pointer.\n\n* SetImageProfile(): Fix possible assertion failure.\n\n* SGI: Check for EOF while reading SGI file header.\n\n* SUN: Fix memory leak.\n\n* TIFF: Fix possible use of NULL pointer.  Fix memory leaks in writer.\n\n* TIM: Fix memory leak.\n\n* TOPOL: Fix possible use of NULL pointer.  Fix memory leaks.\n\n* VIFF: Fix memory leak.\n\n* WEBP: Detect partial write to output file.\n\n* WPG: Fix possible use of null pointer. Fix excessive use of disk\n  resources due to insufficient validations.\n\n* WriteImage(): Restore use of GetBlobStatus() to test if an I/O error\n  was encountered while writing output file. This assures that I/O\n  failure in writers which do not themselves verify writes is assured\n  to be reported.\n\n* WMF: Memory use after free issues eliminated.\n\n* YUV: Fix memory leaks.\n\n\nNew Features:\n\n* PNG: Implemented eXIf chunk support.\n\n* WEBP: Add support for EXIF and ICC metadata provided that at least\n  libwebp 0.5.0 is used.\n\n* Magick++ Image autoOrient(): New Image method to auto-orient an\n  image so it looks right-side up by default.\n\nFeature improvements:\n\n* None\n\nWindows Delegate Updates/Additions:\n\n* Libtiff is updated to libtiff 4.0.9.\n\nBuild Changes:\n\n* JPEG/PNG: The SETJMP_IS_THREAD_SAFE definition is used to determine\n  if setjmp/longjmp are thread safe.  If these interfaces are thread\n  safe, then concurrent reads/writes are possible.  This definition is\n  false for Solaris but true for Linux.  JPEG and PNG will be fully\n  concurrent if this definition is enabled.\n\nBehavior Changes:\n\n* PALM: PALM writer is disabled.\n\n* ThrowLoggedException(): Capture the first exception at\n  ErrorException level or greater, or only capture exception if it is\n  more severe than an already reported exception.\n\n* DestroyJNG(): This internal function is now declared static and is\n  removed from shared library or DLL namespace.\n\n\n1.3.26 (July 4, 2017)\n=====================\n\nSpecial Issues:\n\n* None\n\nSecurity Fixes:\n\n* DPX: Fix excessive use of memory (DOS issue) due to file header\n  claiming large image dimensions but insufficient backing\n  data. (CVE-2017-10799).\n\n* JNG: Fix memory leak when reading invalid JNG image (CVE-2017-8350).\n\n* MAT: Fix excessive use of memory (DOS issue) due to continuing\n  processing with insufficient data and claimed large image\n  size. Verify each file extent to make sure that it is within range\n  of file size. (CVE-2017-10800).\n\n* META: Fix heap overflow while parsing 8BIM chunk (CVE-2016-7800).\n\n* PCX: Fix denial of service issue.\n\n* RLE: Fix abnomally slow operation (denial of service issue) with\n  intentionally corrupt colormapped file.\n\n* PICT: Fix possible buffer overflow vulnerability given suitably\n  truncated input file.\n\n* PNG: Enforce spec requirement that the dimensions of the JPEG\n  embedded in a JDAT chunk must match the JHDR dimensions\n  (CVE-2016-9830).\n\n* PNG: Avoid NULL dereference when MAGN chunk processing fails.\n\n* SCT: Fix stack-buffer read overflow (underflow?) while reading SCT\n  header.\n\n* SGI: Fix denial of service issues.  Delay large memory allocations\n  until file header has fully passed sanity checks.\n\n* TIFF: Fix out of bounds read when reading CMYKA TIFF which claims to\n  have only 2 samples per pixel (CVE-2017-6335).\n\n* TIFF: Fix out of bounds read when reading RGB TIFF which claims to\n  have only 1 sample per pixel (CVE-2017-10794).\n\n* WPG: Fix heap overflow (CVE-2016-7996).  Fix assertion crash\n  (CVE-2016-7997).\n\nBug fixes:\n\n* DifferenceImage(): Fix Fix all-black difference image if an input\n  file is colormapped.\n\n* EXIF orientation was not being properly detected for some files.\n\n* -frame: The `import` command -frame handling was improperly\n  implemented and was using already freed data.\n\n* GIF: Fixes for \"Excessive LZW string data\" problem.\n\n* Magick++: Bug fixes to PathSmoothCurvetoRel::operator() and\n  PathSmoothCurvetoRel::operator().\n\n* PAM: Support writing GRAYSCALE PAM format.\n\n* PNG: Fix memory leaks.\n\n* SVG: Fixed a memory leak.  Fixed a possible null pointer dereference.\n\n* TclMagick: Problem that TkMagick could not resolve functions from\n  TclMagick under Linux is fixed.\n\n* TclMagick: Fix parser validatation in magickCmd() to avoid crash\n  given a syntax error.\n\n* TIFF: Fix for reading old JPEG files (avoids \"Improper call to JPEG\n  library in state 0. (LibJpeg).\").\n\n* TXT: Fixed memory leak.\n\n* XCF: Error checking is improved.\n\nNew Features:\n\n* EXIF rotation: Support is added such that the EXIF orientation tag\n  is updated when the image is rotated.\n\n* MAT: Now support reading multiple images from Matlab V4 format.\n\n* Magick++: Orientation method now updates orientation in EXIF\n  profile, if it exists.\n\n* Magick++: Added Image attribute method which accepts a character\n  pointer argument, and will remove the attribute if the value\n  argument is NULL.\n\n* -orient: The -orient command line option now also updates the\n  orientation in the EXIF profile, if it exists.\n\n* PGX: Support PGX JPEG 2000 format for reading and writing (within\n  the bounds of what JasPer supports).\n\n* Wand API: Added MagickAutoOrientImage(),\n  MagickGetImageOrientation(), MagickSetImageOrientation(),\n  MagickRemoveImageOption(), and MagickClearException().\n\n\nFeature improvements:\n\n* None\n\nWindows Delegate Updates/Additions:\n\n* TIFF: Updated to libtiff 4.0.8.\n\nBuild Changes:\n\n* TclMagick: Updated configure to use latest TEA tcl.m4 version 3.10.\n  Support for AM_DISTCHECK_CONFIGURE_FLAGS so that 'make distcheck'\n  remembers configuration options, and also to uninstall pkgIndex.tcl.\n\n* VisualMagick Configure: A 'quantum' command line argument is added\n  to set the default quantum depth in the wizard drop-down list.  This\n  This allows setting the quantum depth when the /nowizard argument\n  was supplied.\n\nBehavior Changes:\n\n* The installer for the Windows build no longer includes IMDisplay\n  (simple display program), ImageMagickDLL, and PerlMagick for\n  ActiveState Perl.  These are still available to build from the\n  source tree.  All of these depend on proprietary components.\n\n1.3.25 (September 5, 2016)\n==========================\n\nSpecial Issues:\n\n* None\n\nSecurity Fixes:\n\n* EscapeParenthesis(): I was notified by Gustavo Grieco of a heap\n  overflow in EscapeParenthesis() used in the text annotation code.\n  While not being able to reproduce the issue, the implementation of\n  this function is completely redone.  This issue was assigned\n  CVE-2016-7447 after the release.\n\n* Utah RLE: Reject truncated/absurd files which caused huge memory\n  allocations and/or consumed huge CPU.  Problem was reported by\n  Agostino Sarubbo based on testing with AFL.  This issue was assigned\n  CVE-2016-7448 after the release.\n\n* SVG/MVG: Fix another case of CVE-2016-2317 (heap buffer overflow) in\n  the MVG rendering code (also impacts SVG).  This issue (remaining\n  part) was assigned CVE-2016-7446 after the release.\n\n* TIFF: Fix heap buffer read overflow while copying sized TIFF\n  attributes.  Problem was reported by Agostino Sarubbo based on\n  testing with AFL.  This issue was assigned CVE-2016-7449 after the\n  release.\n\nBug fixes:\n\n* GetToken(): Fix obscure bug (read beyond end of string buffer)\n  noticed while parsing a MVG file.  This problem was reported by\n  Gustavo Grieco.\n\n* MVG rendering: Fix undesired hard errors when some objects were\n  drawn outside of the image bounds.  Requests to draw objects\n  entirely outside of the image should be silently ignored.\n\n* MVG/SVG rendering: Fix gradient size sanity checks which were\n  causing gradient requests to fail.  Due to a design weakness in that\n  gradient images allocate resources rather than being computations at\n  point of use, the maximum gradient image size is now hard-limited to\n  5000x5000 pixels until the design problem is fixed.  Some SVG icons\n  (as small as 8x8 pixels) authored using Inkscape request absurdly\n  huge gradients.  Gradient sizes as large as 20,000x20,000 have been\n  observed in SVG icon files delivered by packages on an Ubuntu Linux\n  system.\n\n* SVG: Fix some memory leaks which occur on parsing error.\n\nNew Features:\n\n* None\n\nFeature improvements:\n\n* ElapsedTime(): Use clock_gettime() (when available with default\n  linkage) to obtain elapsed time.\n\n* DescribeImage(): Provide 6 digits of seconds precision in in elapsed\n  time output.  Previously the resolution was rounded up to a full\n  second.\n\nWindows Delegate Updates/Additions:\n\n* webp: Updated bundled libwebp to release 0.5.1.\n\n* libxml: Updated bundled libxml2 to release 2.9.4.\n\n* lcms: Updated bundled lcms2 to release 2.8.\n\n* png: Update bundled libpng to release 1.6.24.\n\nBuild Changes:\n\n* OpenMP is properly configured for clang 3.8 using its own '-lomp'\n  rather than '-lgomp'.\n\nBehavior Changes:\n\n* SVG: Some SVG files may be rejected due to absurdly large gradient\n  requests.\n\n* The 'identify' and 'info' functionality only shows the pixel read\n  rate if image was not read in 'ping' mode. Provide 6 digits of\n  seconds precision in in elapsed time output.\n\n1.3.24 (May 30, 2016)\n==========================\n\n.. _`GCC bug 53967` : http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53967\n\nSpecial Issues:\n\n* A shell exploit (CVE-2016-5118) was discovered associated with a\n  filename syntax where file names starting with '|' are intepreted as\n  shell commands executed via popen().  Insufficient sanitization in\n  the SVG and MVG renderers allows such filenames to be passed through\n  from potentially untrusted files.  There might be other ways for\n  untrusted inputs to produce such filenames.  Due to this issue,\n  support for the feature is removed entirely.\n\n* A shell exploit was discovered associated with the gnuplot delegate\n  and which is triggered by the 'gplt' entry in delegates.mgk.  A\n  remote exploit is possible if the attacker can cause a provided SVG\n  or MVG file to be rendered (or the user opens a provided file).  The\n  gnuplot program must be installed in order for the exploit to be\n  successful.  It is strongly recommended to remove this entry in all\n  delegates.mgk files.\n\n* Due to `GCC bug 53967`_, several key agorithms (e.g. convolution)\n  may execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\n  enabled for floating point math (`-mfpmath=sse`) if the GCC option\n  `-frename-registers` is used. Default 32-bit builds do not\n  experience the problem since they use '387 math.  It is not clear in\n  what version of GCC this problem started but it was not noticed by\n  the developers until the GCC 4.6 timeframe.  Other compilers do not\n  suffer from this bug.  Please lobby the GCC project to fix this\n  embarrassing performance bug.\n\nSecurity Fixes:\n\n* BLOB: Remove support for reading input from a shell command, or\n  writing output to a shell command, by prefixing the specified\n  filename (containing the command) with a '|'.  This feature provided\n  a remote shell execution opportunity.\n\n* DIB: Fixed out of bounds reads.  Added more header validations.\n\n* JNG: File size limits are enforced.\n\n* MAT: Fixed denial of service opportunity.  Fix hang on corrupt deflate stream.\n\n* META: Fixed out of bounds reads and writes.\n\n* MIFF: Fixed thrown assertion.\n\n* MSL: Ignore the file extension on MSL files.  It is necessary to add\n  a \"msl:\" prefix to MSL files to read the as an image.\n\n* MVG: No longer assume that files ending with extension \".mvg\" are\n  MVG files.  MVG parsing does more validity checking on its input.\n  Assure that enough PrimitiveInfo structures are allocated in advance\n  to support a given vector path (heap overflow problem).\n\n* PCX: Fixed unreasonable memory allocation due to intentionally\n  corrupt file.\n\n* PDB: Fixed a heap buffer overflow and out of bounds read.\n\n* PICT: Fixed an out of bounds write.\n\n* PS: Ghostscript is now always run with -dSAFER for safer execution.\n\n* PSD: Fixed segmentation violations, heap buffer overflows, and out\n  of bounds writes.\n\n* RLE: Fixed out of bounds reads and writes.\n\n* ReadImages(): Fixed a possible infinite recursion due to a crafted input file.\n\n* RotateImage(): Fixed thrown assertion.\n\n* SGI: Fixed out of bounds writes.\n\n* SUN: Fixed out of bounds reads and writes.\n\n* SVG: Fixed heap and stack buffer overflows, as well as segmentation\n  violations (CVE-2016-2317 and CVE-2016-2318).  Also fixed endless\n  loop, unexpectedly large memory allocation, divide by zero, and\n  recursion issues.\n\n* TIFF: Fixed an assertion while reading.  Fixed benign heap overflow.\n\n* TMP: Adding a \"tmp:\" prefix to a filename no longer removes the file\n  since this seems dangerous.\n\n* VIFF: Fix excessive memory allocation with intentionally corrupted input file.\n\n* XCF: Fixed a heap buffer overflow.\n\n* XPM: Fixed several heap buffer overflows, and out of bound\n  reads/writes.  Also fixed a case of excessive memory allocation.\n\n* delegate.mgk: The default delegate.mgk file has been pared down in\n  order to reduce security exposure.\n\n* gnuplot ('gplt' delegate in delegates.mgk): Support for rendering\n  gnuplot files is removed since the format is inherently insecure.\n\n* File names: File names starting with a '|' character are no longer\n  interpreted as shell commands to be executed as input or output.\n\n\nBug fixes:\n\n* BMP: Fix reading 24-bit Microsoft BMP which claims to have a\n  colormap.\n\n* FILE: `file://` URLs are properly supported now (they never worked\n  before).\n\n* JP2: It is now possible to write lossless JPEG 2000 \"JP2\" format.\n\n* SVG: Support font-size \"medium\".\n\nNew Features:\n\n* Blob I/O C APIs: Added signed versions of short and long Read/Write\n  functions.\n\n* FILE: `file://` URLs are properly supported now (they never worked\n  before).\n\n* MAT: Matlab V4 is now partially supported.\n\n* Magick++: Added double-precision xResolution() and yResolution()\n  methods to support setting the horizontal and vertical resolution\n  with double floating point precision.\n\n* Mogrify now supports a -preserve-timestamp option to preserve file\n  access and modification timestamps.\n\nFeature improvements:\n\nWindows Delegate Updates/Additions:\n\n* Updated bundled libpng to release 1.6.19.\n\n* Updated bundled libwebp to release 0.4.4.\n\n* Update bundled libxml2 to release 2.9.3.\n\n* Update bundled freetype to release 2.6.2.\n\nBuild Changes:\n\n* Added ``--enable-broken-coders`` configure option to enable file\n  format support which may be broken or cause security issues.  The\n  PSD format is now classified as \"broken\" (until it is fixed).\n\nBehavior Changes:\n\n* PSD format is not included in the build by default.\n\n* Files ending with \".mvg\" and \".msl\" are not assumed to be image\n  files by default.\n\n* File names starting with '|' are no longer treated as shell\n  commands.\n\n* Gnuplot and POV delegate support is removed from the default\n  delegate.mgk file.\n\n1.3.23 (November 7, 2015)\n==========================\n\nSpecial Issues:\n\n* Due to `GCC bug 53967`_, several key agorithms (e.g. convolution)\n  may execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\n  enabled for floating point math (`-mfpmath=sse`) if the GCC option\n  `-frename-registers` is used. Default 32-bit builds do not\n  experience the problem since they use '387 math.  It is not clear in\n  what version of GCC this problem started but it was not noticed by\n  the developers until the GCC 4.6 timeframe.  Other compilers do not\n  suffer from this bug.  Please lobby the GCC project to fix this\n  embarrassing performance bug.\n\n\nSecurity Fixes:\n\n* ScaleImage(): While not strictly a security issue, requesting to\n  scale an image while retaining the original number of rows will lead\n  to a program crash or memory corruption due to double-free.\n\nBug fixes:\n\n* ScaleImage(): Fix problem with new width/height match original\n  (regression added by 1.3.22).\n\n* ScaleImage(): Fix double-free when new rows matches original rows\n  (regression added by 1.3.22).\n\n* MinGW build fix related to eliminating a sleep() macro which\n  conflicts with a MinGW-provided inline sleep() function.\n\n* PNG: Issue a warning instead of an error when attempting to read a\n  PNG file containing a zero-length profile.  This allows the file to\n  be read.\n\n* identify: Fix problem in that `identify -format \"%A\"` (to test if\n  transparency is supported in image) does not always produce the\n  correct results.\n\nNew Features:\n\n* None.\n\nFeature improvements:\n\n* None.\n\nPerformance Improvements:\n\n* None.\n\nWindows Delegate Updates/Additions:\n\n* None.\n\nBuild Changes:\n\n* Configure: Removed CFLAGS and LDFLAGS deduplication code which\n  caused problems for user-provided CFLAGS and LDFLAGS which added and\n  then removed compiler/linker options.  Specifically, this fixes a\n  problem with creating OS X universal builds.\n\n* Configure: Add tests for 'ps2write' and 'eps2write' which are\n  available in recent Ghostscript.\n\nBehavior Changes:\n\n* None\n\n\n1.3.22 (October 4, 2015)\n==========================\n\n.. _`GCC bug 53967` : http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53967\n\n\nThanks:\n\n* Coverity: We thank Coverity for providing free service for free\n  software projects, and thank Jodie Cunningham for getting the\n  project set up in Coverity.\n\nSpecial Issues:\n\n* Due to `GCC bug 53967`_, several key agorithms (e.g. convolution)\n  may execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\n  enabled for floating point math (`-mfpmath=sse`) if the GCC option\n  `-frename-registers` is used. Default 32-bit builds do not\n  experience the problem since they use '387 math.  It is not clear in\n  what version of GCC this problem started but it was not noticed by\n  the developers until the GCC 4.6 timeframe.  Other compilers do not\n  suffer from this bug.  Please lobby the GCC project to fix this\n  embarrassing performance bug.\n\n* Magick++: Any libraries or applications using Magick++ should be\n  rebuilt in order to use this new release.  Libraries and\n  applications will be able to continue to use prior versions of\n  Magick++ without being re-built, while benefiting from updated C\n  libraries, provided that the system supports library versioning.\n\nSecurity Fixes:\n\n* General Coverity fixes.  Some might have security consequences.\n\n* Ghostscript options concatenation is more secure against buffer\n  overflow.\n\n* Windows: Built-in random number generator is now salted using\n  CryptGenRandom().  This improves the robustness of the temporary\n  file allocator.\n\nBug fixes:\n\n* Coverity Fixes: Large amounts of fixes due to Coverity static\n  analysis.  See the ChangeLog and Mercurial for details. Coverity now\n  reports zero issues.\n\n* General: Fix problems with reading filenames that include a colon.\n\n* General: Fixed performance problem with sub-image path extraction\n  when there are many files in the directory.\n\n* General: Add missing options in utility help messages.\n\n* BMP: Reader was wrongly rejecting RLE-compressed files as being too\n  small (regression added in 1.3.21 release).\n\n* BMP: Fix inverted alpha channel when writing BGRA8888 format.\n\n* DrawAffineImage(): Fix problem with negative x offset.\n\n* DrawAffineImage(): Fix problem that sometimes output rows are skipped when using OpenMP.\n\n* EXIF: Properly validate GPS_OFFSET.\n\n* -format: %Q now reports JPEG quality estimate if it is available.\n\n* -geometry: Fix handling of area geometries in the form \"5000000@\".\n\n* MagickGetImageGravity(): Prototype was missing in header files.\n\n* MIFF: Memory leak fixes.\n\n* MIFF: MIFF reader failed to read some MIFF headers properly.\n\n* MIFF: Detect buffer overrun attempt while reading zip compressed data.\n\n* PDF: Set image frame scene ids appropriately.\n\n* PNG: Memory leak fixes.\n\n* PS: Set image frame scene ids appropriately.\n\n* PTIF: Mark reduced frames as SubfileType 0x2 instead of 0x1.\n\n* SetImageProfile(): Avoid crash given NULL profile pointer.\n\n* TIFF: Fix reading Old JPEG and YCbCr sample images from libtiff\n  pics-3.8.0.tar.gz image file collection.\n\n* TIFF: Disable matte channel for compression types which don't\n  support it.\n\n* XPM: Memory leak fixes.\n\n* XWD: Memory leak fixes.\n\nNew Features:\n\n* GRAYA: New subformat for gray coder which supports alpha channel.\n  Format specifiers \"R\", \"G\", \"B\", \"A\", \"C\", \"M\", and \"Y\" may now be\n  used to save and restore the associated channel using the same raw\n  format as \"GRAY\".\n\n* Magick++: Image::repage() method added to support resetting 'page'.\n\n* PDF: Added '-define pdf:stop-on-error=true' optoin to cause PDF\n  reading to quit immediately upon any error.\n\n* Subframe specification: Now specific PS and PDF pages may be\n  selected, including re-ordering.\n\nFeature improvements:\n\n* PALM: Still a work in progress.  Closer to working using netpbm's\n  implementation as a reference.\n\nPerformance Improvements:\n\n* None.\n\nWindows Delegate Updates/Additions:\n\n* dcraw: Update bundled dcraw to release 9.26.0.\n\n* lcms: Update bundled lcms2 to release 2.7.\n\n* png: Updated bundled libpng to release 1.6.17.\n\n* tiff: Update bundled libtiff to release 4.0.6.\n\n* ttf: Update bundled freetype to release 2.6.\n\n* webp: Updated bundled libwebp to release 0.4.3.\n\n* libxml: Update bundled libxml2 to release 2.9.2.\n\nBuild Changes:\n\n* lcms (\"Little CMS\") v1 is no longer supported.\n\n* VisualMagick: Remember and re-use already given paths.\n\nBehavior Changes:\n\nMagick++: adaptiveThreshold() now accepts a 'double' value and the\nprevious version of the method (using 'unsigned int') is deprecated.\nThe STL function-object equivalent of the deprecated method is removed\nentirely.\n\n\n1.3.21 (February 28, 2015)\n==========================\n\n.. _`AddressSanitizer` : https://code.google.com/p/address-sanitizer/\n\n.. _`Valgrind` : http://www.valgrind.org/\n\n.. _`American fuzzy lop` : http://lcamtuf.coredump.cx/afl/\n\nThanks:\n\n  * Gynvael Coldwind and Mateusz Jurczyk of the Google Security Team\n    provided test files which allowed us to find and fix security\n    problems in the software.\n\n  * Hanno Bck provided test files which allowed us to find and fix\n    security problems in the software.\n\n  * Tobias Ospelt provided test files and advice which allowed us to\n    find and fix security problems in the software.\n\n  * Michal Zalewski provided test files which allowed us to find and\n    fix security problems in the software.\n\n  * Jodie Cunningham did lots of fuzzing to find issues and set up the\n    project on Coverity for automatic analysis.\n\n  * `American fuzzy lop`_ was used to produce and discover many of the\n    files which caused problems for the software.\n\n  * `AddressSanitizer`_ (ASan) was used to detect and isolate memory\n    access issues.\n\n  * `Valgrind`_ was used to detect and isolate memory access issues as\n    well as memory leaks\n\nSpecial Issues:\n\n  * Due to `GCC bug 53967`_, several key agorithms (e.g. convolution)\n    may execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\n    enabled for floating point math (`-mfpmath=sse`) if the GCC option\n    `-frename-registers` is used. Default 32-bit builds do not\n    experience the problem since they use '387 math.  It is not clear\n    in what version of GCC this problem started but it was not noticed\n    by the developers until the GCC 4.6 timeframe.  Other compilers do\n    not suffer from this bug.  Please lobby the GCC project to fix\n    this embarrassing performance bug.\n\n  * Magick++: Any libraries or applications using Magick++ should be\n    rebuilt in order to use this new release.  Libraries and\n    applications will be able to continue to use prior versions of\n    Magick++ without being re-built, while benefiting from updated C\n    libraries, provided that the system supports library versioning.\n\nSecurity Fixes:\n\n  * Annotate: Some requestable text-substitution attributes caused a\n    crash.\n\n  * All formats: Image dimensions are checked to assure that they are\n    within limits before proceeding to read the image.\n\n  * BMP: Fix hang (endless loop) for certain files.\n\n  * DCM: Fix crash as well as small heap over-write.\n\n  * DPX: Fix crash due to DPX file reporting more elements than it\n    has.\n\n  * MNG: Validate MHDR chunk length to avoid huge memory allocation\n    and DOS.\n\n  * PCX: Fix for CVE-2014-8355. Validate file header in order to avoid\n    buffer overun later.\n\n  * PDB: Detect arithmetic overflows when calculating buffer sizes.\n    Fix crash in writer when image width is not even multiple of 16.\n    Fix buffer overrun with 2 and 4-bit PDB image files.\n\n  * PNM: Validate PGM, PPM, and PAM header MaxValue parameter to avoid\n    crash on poorly-formed input.\n\n  * PNG: Impose a 10-million limit on dimensions when reading a PNG\n    file to avoid denial of service.\n\n  * PSD: Avoid problems caused by huge PSD colormap size.\n\n  * PSD: Fix small stack over-write if more than 99 layers are written\n    to PSD format.\n\n  * PSD: Returns immediately if pixel limit was exceeded.\n\n  * RLE: URT RLE reader is now more robust with errant files.\n\n  * SUN: Header validation is now made fully robust, and arithmetic\n    overflows in buffer-size calculations are detected to avoid heap\n    overwrite.\n\n  * TIFF: Fix crashes for photometrics which may deliver one or three\n    samples per pixel (was assuming always three).\n\n  * VIFF: Fixes to prevent buffer overflow.  Validate colormap indexes.\n\n  * Windows delegates: Fix unexpected argument splitting when invoking\n    an external delegate program via delegates.mgk.\n\n  * WPG: Fix use of NULL pointers.  Fix buffer overflows.\n\n  * XPM: Detect truncated row and quit with error rather than\n    over-running a buffer.\n\n  * XWD: Improve header validation.  Added to UnstableCoderClass since\n    the reader for this format should not be entrusted with\n    untrustworthy input.\n\nBug fixes:\n\n  * CIN: Fix problem with text attribute values which are not NULL\n    terminated.  Validate sizes claimed by Cineon header.\n\n  * Coverity: Fixes for many issues detected by Coverity scan (see\n    ChangeLog).\n\n  * DPX: Fix problem with text attribute values which are not NULL\n    terminated.\n\n  * DPX: Fix severe corruption of little-endian 32-bit packed output.\n    Corruption was severe enough that it would have been noticed\n    immediately.\n\n  * Delegates: Fix possible memory leaks when invoking external\n    application.\n\n  * FITS: Properly validate values provided by file header.\n\n  * GIF: Fix use of uninitialized data.\n\n  * JBIG: Fix memory leaks.\n\n  * JNG: Fix double-free error in error path.\n\n  * JPEG: Verify the number of output components before attempting to\n    decode the image.\n\n  * Magick++: Image resolutionUnits() was not always returning correct\n    value.\n\n  * Magick++: Locking has not been working properly since the code was\n    written in 1998.  Apparently the issue has not been significant\n    enough to cause run-time issues.\n\n  * ICO: Windows icon reader is now much more robust.\n\n  * MIFF: Reader now quits with an error if zip or bzip2 stream is\n    corrupted.\n\n  * MAT: Fix memory leaks.\n\n  * PALM: Reader now reads various input formats (up to version 2)\n    correctly whereas it was crashing or otherwise malfunctioning\n    before.  More work remains, particularly in the writer.\n\n  * PCX: Eliminate memory leaks in error paths.\n\n  * PDB: In PDB writer, void possible under-allocation due to\n    arthimetic overflow when allocating packets.\n\n  * PICT: Fix PICT reader crash with corrupted file.\n\n  * PNG: Fix double-free error in error path.\n\n  * PNG: Fixed handling of transparency when writing indexed PNG.\n\n  * PNG: Avoid reading beyond the end of a tEXt keyword.\n\n  * PSD: Fix error when reading PSDs files which have no layers.\n\n  * RLA: Fix possible crash due to file header.\n\n  * Signal Handling: Signal handling is now more robust and handles\n    SIGSEGV and other critical signals.  The sole purpose of the\n    default signal handling is to remove any temporary files and quit.\n    An informative message is printed for signals other than SIGINT.\n\n  * SUN: Sun raster reader was not completely robust. Now it is.\n\n  * SWF: Fix pixel cache access errors in 'ping' mode.\n\n  * Text annotation: An empty text string is no longer treated as an\n    error.\n\n  * Text annotation: Fix regression added in 1.3.19 which caused\n    spurious drawing errors to be produced while rendering with text\n    when all of the text is off the left-hand side of the image.\n\n  * TIFF: Fix unreliable reading JBIG compressed files by forcing use\n    of strip reader rather than sometimes using scanline reader (which\n    libtiff's JBIG codec does not support).\n\n  * TIFF: Fix reading or writing planar min-is-white or min-is-black\n    images with an associated alpha channel.\n\n  * WebP: WebP writer now writes truely lossless output when\n    requested.\n\n  * identify / GetImageStatistics(): Failed to compute statistics for\n    the Black channel of CMYK image files.\n\n  * VICAR: Fix problem with continuing to \"read\" data when there is no\n    more data left to read.\n\n  * WMF: Fix memory leaks.\n\n  * WPG: Fix potential DOS due to long reads during an error\n    condition.\n\n  * XPM: Avoid strncpy() of overlapping memory.  Fixed memory leaks in\n    error paths.  Fixed bad memory access caused by empty file.\n\nNew Features:\n\n  * compose: Supports composite operator names similar to the major\n    \\*Magick brand, without losing any compatibility with previous\n    naming.\n\n  * ICO: Windows ICO reader now supports reading PNG-encoded files.\n\n  * Magick++ Geometry: New methods limitPixels() and fillArea() to\n    support '@' and '^' geometry qualifiers.  This enhancement breaks\n    the ABI due to previous use of inline methods and no place to put\n    the new flags.\n\n  * Magick++ Image::extent(): New method to place image on sized\n    canvas of constant color using gravity.\n\n  * Magick++ Image::formatExpression(): New method format a string\n    based on a format similar to command-line -format.\n\n  * Magick++ Image::resize(): New method to resize image specifying\n    geometry, filter, and blur.\n\n  * Magick++ STL extentImage: New function object to invoke image\n    extent method.\n\n  * Magick++ Image::quiet().  New method which blocks (ignores)\n    warning exceptions when passed a 'true' argument.\n\n  * Resource limits: Added support for image Width and Height limits.\n    Default image Width and Height limits are based on the range of a\n    32-bit signed integer, even for 64-bit builds which may have\n    sufficient numeric range to image an entire galaxy.  Limits may be\n    increased as desired.\n\n  * TIFF: Use define tiff:ignore-tags to ignore tags in 'corrupted'\n    files with unknown and invalid tags.  Use to read TIFF files which\n    otherwise can not be read due to errors.\n\n  * TIFF: Use '-define tiff:report-warnings=true' to enable that\n    warnings reported by libtiff are thrown as warning exceptions so\n    that they may be caught or will be reported at the gm\n    command-line.\n\n  * Windows Exceptions: A handler is registered (due to calling\n    InitializeMagick()) to capture Windows Exceptions in a similar\n    manner to the existing POSIX signal handler.  If an application is\n    using the library and wants to provide its own Windows exception\n    handling, then it should make any changes after invoking\n    InitializeMagick().\n\nFeature improvements:\n\n  * None.\n\nPerformance Improvements:\n\n  * None.\n\nWindows Delegate Updates/Additions:\n\n  * PNG: Update bundled libpng to 1.6.16.  Resolves known security\n    issues.\n\n  * FreeType: Update bundled Freetype to 2.5.4.  Resolves known\n    security issues.\n\n  * WebP: Update bundled WebP to 0.4.2 release.\n\n  * WebP is auto-linked in Visual Studio.\n\nBuild Changes:\n\n  * WebP is not included in the build when building with Visual Studio\n    6 (1998 vintage compiler!) since it requires more modern C.\n\nBehavior Changes:\n\n  * AVI: Support for this format is removed since the implementation\n    was worthless.\n\n  * TIFF: Now uses YCbCr encoding when JPEG compression is requested\n    for an RGB image.\n\n\n1.3.20 (August 16, 2014)\n=========================\n\nSpecial Issues:\n\n  * Due to `GCC bug 53967`_, several key agorithms (e.g. convolution)\n    may execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\n    enabled for floating point math (`-mfpmath=sse`) if the GCC option\n    `-frename-registers` is used. Default 32-bit builds do not\n    experience the problem since they use '387 math.  It is not clear\n    in what version of GCC this problem started but it was not noticed\n    by the developers until the GCC 4.6 timeframe.  Other compilers do\n    not suffer from this bug.  Please lobby the GCC project to fix\n    this embarrassing performance bug.\n\nSecurity Fixes:\n\n  * No security issues were reported or fixed.\n\nBug fixes:\n\n  * Compilation: No longer undefine __attribute__ since this may be\n    used by system or compiler headers and cause problems.\n\n  * BMP: Alpha channel from BMP3 format was inverted.\n\n  * PNG: Fix round-trip repeatability issue (due to rounding\n    algorithm) with modern versions of libpng.  Prefer the less\n    accurate method which does not alter the image.\n\n  * PNG: Fix some memory leaks in error-handling paths.\n\n  * PNM: Scaling of alpha in sub-ranged pixels is fixed.\n\n  * Wand API: Removed development debug fprintf which causes each\n    drawing primitive to be printed to stderr.\n\n  * PS, PS2, PS3, PDF: Only use resolution from image or -density if\n    units were properly specified.  Without units, resolution is\n    worthless.\n\n  * PS, PS2, PS3, PDF: Use resolution from image if it appears to be\n    valid.\n\n  * WebP: Fix inverted return status which caused failure to be\n    reported instead of success.\n\n  * Rotation clipping/shearing errors for short wide images at some\n    angles are fixed.\n\n  * -geometry: Deal with resize geometry missing width or height\n    (e.g. '640x' or 'x480') by substituting the missing value with one\n    which preserves the image aspect ratio.  This has been documented\n    to be supported since almost the dawn of GraphicsMagick but was\n    not actually supported until now.\n\n  * -geometry: Support '>' and '<' qualifiers with '@' qualifier to\n    specify if image should be resized if larger or lesser than given\n    area specification.\n\nNew Features:\n\n  * Wand API: MagickSetImageGravity() - New function to set image\n    gravity.\n\n  * Wand API: MagickGetImageGravity() - New function to get image\n    gravity.\n\n  * Wand API: MagickSetImageMatte() - New function to set the image\n    matte channel enable flag.\n\n  * Wand API: MagickGetImageMatte() - New function to read the image\n    matte channel enable flag.\n\n  * Wand API: MagickSetImageGeometry() - New function to set the image\n    geometry string.\n\n  * Wand API: MagickGetImageGeometry() - New function to get the image\n    geometry string.\n\n  * Wand API: MagickOperatorImageChannel() - New function to apply an\n    operator to an image channel.\n\n  * Magick++ API: New Image::thumbnail() method for fast image\n    resizing, particularly to make thumbnails.\n\n  * Core C API: Added SetLogMethod() to allow an application/library\n    to specify a function to be called for logging.\n\n  * Clang/LLVM: Provide support for clang/llvm attribute and builtin\n    specifiers similar to that provided for GCC.\n\n  * OpenMP: OpenMP native locking and thread specific data is\n    supported via a configuration option (is not the default).  This\n    offers a \"pure\" OpenMP compilation mode.  No real value for this\n    compilation mode has been observed yet but it seems worthy to\n    support.\n\n  * Coders: Added BrokenCoderClass to mark coders which often\n    malfunction or are not very useful in their current condition.\n\n  * Composition: Added HardLight composition operator, which is now\n    used by PSD and XCF formats, and available via command line,\n    Magick++ API, PerlMagick API, and Wand API.\n\n  * Composition: Added ScreenCompositePixels composition operator.\n\n  * Composition: Added missing Photoshop separable compositing\n    operations, Overlay, Exclusion, ColorBurn, ColorDodge, SoftLight,\n    LinearBurn, LinearDodge, LinearLight, VividLight, PinLight,\n    HardMix.\n\n  * +set: Command line utilities now support +set to remove an\n    existing image attribute.\n\n  * -format: Support additional format specifiers 'g', 'A', 'C', 'D',\n    'G', 'H', 'M', 'O', 'P', 'Q', 'T', 'U', 'W', 'X', and '@', similar\n    to the major brand.\n\n  * -operator: New quantum operators ThresholdBlackNegateQuantumOp and\n    ThresholdWhiteNegateQuantumOp. These correspond to -operator\n    \"Threshold-Black-Negate\" and \"Threshold-White-Negate\".\n\n  * TIFF: Now support setting the TIFF \"Software\" tag for users who do\n    not want to admit to using GraphicsMagick.\n\n  * WebP: All of the WebP encoder encoder options are now supported\n    by -define arguments.\n\n\nFeature improvements:\n\n  * Pixel interpolation quality is greatly improved, with minimal\n    impact on performance.  Pixel interpolation now also works well\n    given an alpha channel.\n\n  * WebP: WebP support is now prepared to compile with most WebP\n    library versions and supports all features except for those\n    pertaining to \"RIFF\" container support.\n\nPerformance Improvements:\n\n  * Non-integral image rotation performance has been improved by about\n    40%, with lower memory usage as well.\n\n  * GradientImage: Update image is_grayscale and is_monochrome flags\n    based on gradient color properties.\n\nWindows Delegate Updates/Additions:\n\n  * PNG: Libpng 1.6.12 - June 12, 2014.\n\n  * JPEG: libjpeg 9a of January 19, 2014.\n\n  * FreeType: FreeType 2.5.3 of March 6, 2014.\n\n  * WebP: webp 0.4.0 of January 20, 2013.\n\n  * zlib: zlib 1.2.8 of April 28, 2013.\n\nBuild Changes:\n\n  * --without-threads no longer disables use of OpenMP.  Use the\n    already existing option --disable-openmp to disable OpenMP.\n\n  * Makefiles: Include paths are now exceedingly pedantic to make sure\n    that only the required directories are included.\n\n  * VisualMagick configure: Improve configure program so that it is\n    possible to select QuantumDepth, OpenMP, and 64-bit build via\n    configure dialog boxes as well as options on the command line.\n    Also automatically detects and deals with similarly named files in\n    subdirectories so that WebP support can now build successfully.\n\nBehavior Changes:\n\n  * MultiplyCompositePixels: Multiply composition now uses SVG\n    interpretation of how alpha should be handled.  No longer does a\n    simple multiply of alpha channel.\n\n  * Composition: The Difference, Darken, Lighten, and HardLight\n    composition operators were modified to support alpha in their\n    computations.\n\n  * PNG: Using -optimize no longer triggers palette and depth\n    optimizations since their implementations have been problematic.\n\n\n1.3.19 (December 31, 2013)\n==========================\n\nSpecial Issues:\n\n  * Due to `GCC bug 53967`_, several key agorithms (e.g. convolution)\n    may execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\n    enabled for floating point math (`-mfpmath=sse`) if the GCC option\n    `-frename-registers` is used. Default 32-bit builds do not\n    experience the problem since they use '387 math.  It is not clear\n    in what version of GCC this problem started but it was not noticed\n    by the developers until the GCC 4.6 timeframe.  Other compilers do\n    not suffer from this bug.\n\nSecurity Fixes:\n\n  * EPT: Fix crash observed when Ghostscript fails to produce useful\n    output.  This was particularly noticeable when Ghostscript was not\n    installed.  This crash could be used to cause denial of service.\n\n  * PNG: With libpng 1.6.X, avoid a crash while copying a PNG with a\n    \"known incorrect ICC profile\".  This crash could be used to cause\n    denial of service.\n\nBug fixes:\n\n  * Build: Fix cross-compilation for MinGW64 on Linux build machine.\n\n  * Build: configure FreeType test no longer insists that\n    <freetype/freetype.h> can be included.\n\n  * CMS profile: Only delete the CMS transform if it is non-null.\n    Fixed assertion observed when lcms returned a null profile and\n    GraphicsMagick attempted to deallocate it.\n\n  * Drawing: Improve error handling logic so that drawing returns\n    quickly on pixel access errors rather than plowing on ahead.  This\n    avoids problems with SVGs which take seemingly forever to render.\n\n  * Drawing via C/C++ APIs: `BevelJoin` no longer causes a MVG parsing\n    error.\n\n  * EPT: Fix crash observed when Ghostscript fails to produce useful\n    output.  This was particularly noticeable when Ghostscript was not\n    installed.\n\n  * OpenMP: Revert use of omp_set_dynamic() since it caused\n    performance issues when using GCC's GOMP implementation and the\n    number of threads to use is specified.\n\n  * EXIF profile: Support the `SubjectArea` EXIF tag.\n\n  * MIFF writer: PseudoClass format was written incorrectly for depth\n    greater than 8.\n\n  * MIFF writer: RLE compressed format used inverted alpha from the\n    other subformats contrary to the MIFF specification.\n\n  * MIFF reader: Fixes to be able to read MIFF written by\n    ImageMagick 6.X, including DirectClass grayscale images (except\n    for RLE compressed).\n\n  * Mosaic: Fixed unsigned underflow problem with -mosaic when page\n    offset is negative and exceeds image width or height, resulting in\n    assertions, out of memory errors, or pixel cache limit errors.\n\n  * PDF: Consistently initialize Image page width and height to image\n    width and height.  While general to all of GraphicsMagick, this\n    change is to assure that the PDF writer computes page dimensioning\n    consistently.  PDF page dimensioning was wrong if the image had\n    been resized with -geometry \"100%\".\n\n  * PAM: Fix MAXVAL scaling when reading PAM images.  PAM was only\n    working correctly for images with 256 or 64k levels.\n\n  * PNM: PGM \"P2\" format writer wrote bad output for 8-bit depth.\n\n  * PNG: With libpng 1.6.X, avoid a crash while copying a PNG with a\n    \"known incorrect ICC profile\".\n\n  * PNG: Q8 GM build now correctly reads 16-bit PNG files.\n\n  * TIFF writer: Try to avoid writing more than 32k strips per image\n    by increasing rows-per-strip since some programs fail to read\n    images with more than 32k strips per image.\n\n  * TIM reader: PSX TIM reports 8-bit depth (rather than 16).\n\n  * TTF font rendering: Improve FreeType rendering error logic so that\n    rendering returns immediately on pixel access errors rather than\n    plowing on ahead.\n\n  * TTF font rendering: Support rendering UTF-8 up to 21-bit code\n    points.  Was only supporting 16-bit code points.\n\n  * Wand API: DrawSetStrokeDashArray() / DrawGetStrokeDashArray(), fix\n    failure to work properly due to this code path never being tested.\n\n  * Windows Ghostscript: 64-bit GraphicsMagick no longer requires both\n    32-bit and 64-bit builds of Ghostscript to be installed in order\n    to read Postscript and PDF formats.\n\n  * XPM reader: Reported depth now depends on the colormap rather than\n    always claiming to be 16-bit.\n\nNew Features:\n\n  * JPEG: Add support for writing 'XMP' profile.\n\n  * PNM: As a simple non-standard extension to the standard PNM and\n    PAM formats, support writing and reading 32-bit sample depth.\n    Writing such files is only supported by the Q32 build although\n    they may be read by any build.\n\n  * WebP: Now supports reading and writing Google's WebP format.  This\n    feature is not currently supported by the Windows Visual Studio\n    build.\n\nFeature improvements:\n\n  * Pixel composition based on BlendCompositePixel() is enhanced to\n    completely eliminate under-color from the blending if the\n    under-pixel is fully transparent.  Also blends based on the\n    average opacity of both pixels rather than only the over-pixel.\n    This change did not result in any change in the GM test suite\n    results but it is possible that there could be some negative\n    impact from it.  Please report any issues noticed which are due to\n    this change.\n\n  * X11 `display`: For DirectClass image, use ThumbnailImage() rather\n    than SampleImage() when creating the panner icon to improve the\n    quality of the image.\n\nPerformance Improvements:\n\n  * PNG: `ping` a PNG faster by avoiding reading the image data.\n\nWindows Delegate Updates:\n\n  * Updated IJG JPEG library to release 9.\n\n  * Updated PNG library to release 1.6.8.\n\n  * Updated lcms2 library to release 2.5.\n\n  * Updated libxml2 library to release 2.9.1.\n\n  * Updated FreeType library to release 2.5.2.\n\nBehavior Changes:\n\n  * MIFF: Now writes PseudoClass images correctly when depth is\n    greater than 8.  This impacts the reader, which will not be able\n    to read previously written incorrect format correctly.  Images\n    like this should be very rare.  The solution is to use an older\n    GraphicsMagick version to convert such images to a valid storage\n    format (with a depth of 8) so that they may be read with this\n    version.\n\n  * MIFF: Now writes RLE-compressed RGBA images with correct\n    alpha. This impacts the reader, which will not be able to read\n    previously written incorrect format correctly. Images like this\n    should be very rare. A solution is to use an older GraphicsMagick\n    version to use a compression algorithm other than RLE so that they\n    are read correctly with this version.  Another solution is to\n    process problematic images with '-operator Opacity Negate 0' to\n    invert the alpha channel.\n\n  * TIFF: Returns DirectClass images by default for MINISWHITE and\n    MINISBLACK TIFF formats (rather then colormapped).\n\n  * Windows: Also search c:\\gs\\fonts for Ghostscript font files.  This\n    search path is normally hard-coded into Ghostscript binaries and\n    is a convenient place to put fonts so they may be shared by\n    multiple Ghostscript versions.\n\n  * XPM: Now limits color resolution to 16-bits, even with Q32 build.\n\n\n1.3.18 (March 10, 2013)\n==========================\n\nSpecial Issues:\n\n  * Due to `GCC bug 53967`_, several key agorithms (e.g. convolution)\n    may execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\n    enabled for floating point math (`-mfpmath=sse`) if the GCC option\n    `-frename-registers` is used. Default 32-bit builds do not\n    experience the problem since they use '387 math.  It is not clear\n    in what version of GCC this problem started but it was not noticed\n    by the developers until the GCC 4.6 timeframe.  Other compilers do\n    not suffer from this bug.\n\nSecurity Fixes:\n\n  * None.\n\nBug fixes:\n\n  * Fixed bug with format substitutions if input string ends with a\n    single '%'.\n\n  * BMP: Fixed an old bug with decoding chromaticity primaries.\n\n  * PNG: Fixed reading of interlaced images.  Fix reading of sub-8-bit\n    palette and grayscale images.  Some PNG sub-formats were written\n    incorrectly.  Fix crash in PNG8 writer if image colors happened to\n    be non-zero but image was not actually colormapped.\n\n  * PNG: Configure script now also searches for libpng versions 16 and\n    17.\n\n  * TIFF: Fix a crash which was noticed when writing RGBA separated\n    (planar) format.\n\n  * `--enable-symbol-prefix` was not prefixing all of the C\n    symbols. Some core C library functions were not prefixed.  This\n    option applies to the Wand library API as well now.\n\n  * C API: When input is from a user-provided file descriptor, the\n    file position is restored after reading the file header bytes.\n    Previously the file position was rewound to the beginning of the\n    file.  This allows reading embedded image data from the current\n    offset in a file, and allows continuing to use the stream after\n    GraphicsMagick has returned the image.\n\n  * C API: It is now possible to invoke CloseBlob() multiple times.\n\n  * display: Display was supposed to respond to +/-usePixmap, but was\n    not. It was responding to +/-use_pixmap.  Now it responds to both.\n\n  * Windows/VisualMagick: Fix building GraphicsMagick with Intel ICC\n    compiler driven by Visual Studio Professional 2012.\n\n  * Windows: Avoid a crash and produce a useful diagnostic if\n    Ghostscript is needed but not yet installed.\n\n\nNew Features:\n\n  * GM utility: New 'batch' command was contributed by Kenneth Xu\n    which supports executing any number of other GM utility\n    sub-commands in a single invocation in a sort of \"batch\" script.\n    Input may be piped from standard input, from a specified file, or\n    from a 'GM >' command prompt.  This utilities front-end allows any\n    other program/script to drive 'gm' using a co-process model and\n    speeds up execution by eliminating utility start-up/shut-down\n    time.\n\n  * WIN64 (64-bit Windows): Windows 64-bit is now officially supported.\n\n  * convert/mogrify: Now support -auto-orient to automatically rotate\n    the image upright for viewing based on its current orientation\n    setting.  Also support -orient to support setting the current\n    image orientation.  Please note that the orientation property of\n    EXIF profiles is not yet updated so the EXIF profile will be wrong\n    after using -auto-orient.\n\n  * C API: AutoOrientImage(), new function to automatically orient\n    the image so that it is upright for normal viewing.\n\n  * Wand API: MagickGetImagePage()/MagickSetImagePage(), new functions\n    to support getting and setting the image page size and offsets.\n\n  * PNG: Added PNG48 and PNG64 support. Added PNG00 support (png\n    encoder that inherits its color-type and bit-depth from the input,\n    if the input was a PNG datastream).\n\nFeature improvements:\n\n  * GraphicsMagick TAP tests may now be run stand-alone using Perl's\n    'prove' TAP test driver.\n\nPerformance Improvements:\n\n  * Detection of glob specifications in file names is more efficient.\n\nWindows Delegate Updates:\n\n  * None.\n\nBehavior Changes:\n\n  * ltdl: Libltdl is no longer bundled.  Libltdl must be previously\n    installed on the system in order to build the modules\n    configuration.\n\n  * AppendImages() now converts subsequent images to the colorspace of\n    the first image, and no longer converts the first image to RGB.\n    Instead, it is assumed the user knows what she/he is doing.\n\n  * SetImageColorRegion() no longer automatically converts the image\n    to RGB.  The user is responsible for assuring that the provided\n    color is in the same colorspace as the image.\n\n\n1.3.17 (October 13, 2012)\n==========================\n\nSecurity Fixes:\n\n  * PNG: Fix for CVE-2012-3438. The Magick_png_malloc function in\n    coders/png.c in GraphicsMagick 6.7.8-6 does not use the proper\n    variable type for the allocation size, which might allow remote\n    attackers to cause a denial of service (crash) via a crafted PNG\n    file that triggers incorrect memory allocation.\n\n  * Automake (derived): Fix for CVE-2012-3386: The \"make distcheck\"\n    rule in GNU Automake before 1.11.6 and 1.12.x before 1.12.2 grants\n    world-writable permissions to the extraction directory, which\n    introduces a race condition that allows local users to execute\n    arbitrary code via unspecified vectors.\n\nBug fixes:\n\n  * PNG: Reading sub-8-bit palette images is fixed (images looked\n    stretched).\n\n  * SVG: Fixed bug which allowed MVG and SVG files with long vector\n    paths to crash the software.\n\n  * SVG: Ignore XML headers rather than rendering them as text.\n\n  * MVG/SVG/WMF/-draw: It is now possible to draw a plain ','\n    character.\n\n  * WMF: Fixed a bug which caused wrong centered-text placement.\n\n  * import: Return status was inverted.\n\n  * configure: Don't force that liblzma is used just because libtiff\n    is used.\n\nNew Features:\n\n  * The configure script now supports a --enable-quantum-library-names\n    option to enable that shared library name includes quantum depth\n    to allow shared libraries with different quantum depths to\n    co-exist in same directory (only one can be used for development).\n\n  * JNX: Support is added for reading the Garmin proprietary Image\n    Format.\n\n  * BMP: Support an alpha channel in uncompressed 32-bit BMP.\n\nFeature improvements:\n\n  * `-lat`: The adaptive threshold algorithm is replaced with a new\n    algorithm which scales linearly (rather than quadratically) with\n    area size.\n\n  * Tests: Test suite is re-written to use TAP-based tests.\n\n  * GIF: Reader tries to be better at detecting and reporting\n    failures.\n\nPerformance Improvements:\n\n  * -lat: Adaptive threshold is much faster with large area sizes.\n\nWindows Delegate Updates:\n\n  * Dcraw 9.16 is now included in the build (with JPEG and JPEG2000\n    support).\n\n  * Libxml2 is updated to the 2.9.0 release.\n\n  * Libtiff is updated to the 4.0.3 release.\n\n  * Lcms2 is updated to the 2.4 release.\n\n  * Libpng is updated to the 1.5.13 release.\n\nBehavior Changes:\n\n  * Loading modules is only supported for the modules build.\n    Previously any build using shared libraries could load modules.\n\n  * Bundled libltdl is now configured as 'installable' rather than\n    'convenience'.\n\n  * -enhance: Only filter based on color channels (ignore opacity).\n\n  * BrowseDelegate: Web browser (for viewing help information) now\n    defaults to 'xdg-open', but if it is not found, then configure\n    will search for firefox, google-chrome, mozilla (in that order).\n\n1.3.16 (June 24, 2012)\n==========================\n\nSecurity Fixes:\n\n  * Don't translate 'comment' and 'label' attributes if the request is\n    made while a file is being read.  Only translate such attributes\n    if they come from the command line or API user.\n\nBug fixes:\n\n  * SWT: SWT reader suffered from a number of implementation errors\n    which caused it not to work any more.  Works again.\n\n  * XBM: Fix memory leak observed when reading file in 'ping' mode.\n\n  * Support -trim on images which use a consistent (single color)\n    transparent background.  In this case, trim is done based on\n    opacity rather than foreground color.\n\n  * Include <sys/types.h> in order to assure that 'size_t' and\n    'ssize_t' are declared.  This is necessary since\n    MagickExtentImage() uses these types as part of its definition.\n\n  * `+repage` was not working because parser was insisting that it\n    should include an argument.\n\n  * -units was scaling existing resolution the wrong way around\n    (i.e. multiplying rather than dividing).\n\n  * PerlMagick: Fix compilation with Perl 5.16.\n\n  * PingBlob(): PingBlob was not working for all cases.  Is now based\n    on BlobToImage() for assured reliability.\n\nNew Features:\n\n  None\n\nFeature improvements:\n\n  * MAT: Animated movies inside 4D matrices are loaded now.\n\n  * PDF: File base name is used as the document title.\n\n  * PNG: Fix issues observed specifically with libpng 1.5.10.\n\nPerformance Improvements:\n\n  * Pixel iterators should be more efficient now if the image uses a\n    file-backed cache.\n\n  * Motion blur algorithm does scale well as cores are added so\n    include OpenMP support for it by default.\n\nWindows Delegate Updates:\n\n  * JPEG: Updated to IJG 8d release.\n\n  * PNG: Updated to 1.5.11 release\n\n  * TIFF: Updated to 4.0.2 release.\n\n  * Zlib: Updated to 1.2.7 release.\n\n  * libxml2: Updated to 2.8.0 release.\n\nBehavior Changes:\n\n  None\n\n1.3.15 (April 28, 2012)\n==========================\n\nSecurity Fixes:\n\n  * Libpng in Windows build is updated to 1.5.10 release.  Provides a\n    fix for CVE-2011-3048.\n\nBug fixes:\n\n  * PNG - fixed problem with bit depth when the encoder decides to\n    write RGBA instead of indexed PNG.\n\n  * Fixed some temporary file leaks which were caused by the temporary\n    file name being automatically extended to include a scene number,\n    and therefore fail to be deleted.\n\nNew Features:\n\n  * Added '+noise random' and '-operator noise-random' to 'convert'\n    and 'mogrify'.  This modulates the existing image data with\n    uniformly random noise.\n\n  * Added -strip option in composite, convert, mogrify, and montage to\n    remove all profiles and text attributes from the image.\n\n  * Added -repage option to composite, convert, mogrify, and montage\n    subcommands to reset or adjust the current image page offsets\n    based on a provided geometry specification.\n\n  * New C function StripImage() to remove all profiles and text\n    attributes from the image.\n\n  * New C function ResetImagePage() to adjust the current image page\n    canvas and position based on a relative page specification.\n\n  * C functions GenerateDifferentialNoise(), AddNoiseImageChannel(),\n    QuantumOperatorRegionImage(), AddNoiseImage() updated to support\n    RandomNoise enumeration.\n\n  * New C++ Image method strip(), and unary function stripImage() to\n    remove all profiles and text attributes from the image.\n\n  * XCF format now respects image subimage and subrange members so\n    that returned image layers may be selected.\n\n  * The INFO coder (e.g. output file \"info:-\") now respects the\n    -format option so that its output may be adjusted identically to\n    how -format works for 'identify'.\n\n  * TclMagick now supports Random noise.\n\nFeature improvements:\n\n  * C function ThumbnailImage() now allows the user to override the\n    filter used, but still defaults to using the box filter.\n\nPerformance Improvements:\n\n  * None\n\nBehavior Changes:\n\n  * No longer add a printf-style scene formatting specification to\n    filenames which do not have one and no longer automatically\n    operate in 'adjoin' mode in such cases.  If multiple numbered\n    files are intended to be output, then add +adjoin to the command\n    line and use an output filename specification similar to\n    \"image-%d.jpg\".  Output files are now completely specified and\n    predictable but this may break some existing usages which\n    anticipate the automatic file numbering.\n\n1.3.14 (February 25, 2012)\n==========================\n\nSecurity Fixes:\n\n  * Windows bundled libpng updated to the 1.5.9 release, which fixes\n    the dire CVE-2011-3026 buffer overrun bug.\n\nBug fixes:\n\n  * EMF format : Fixed wrong module mapping which caused EMF reading\n    to not work under Windows.\n\n  * TGA format: Assume that 32-bit TGA files have an alpha channel,\n    even if they are not marked as such.\n\n  * XCF format: Fix reading XCF which is comprised of different sized\n    layers.\n\n  * JPEG & CineonLog: Convert RGB-compatible colorspaces\n    (e.g. CineonLog) to RGB by default since that was the case prior\n    to release 1.3.13.\n\n  * RAW formats: Small memory leak in dcraw module was fixed.\n\n  * Resize: ResizeImage() was ignoring its resize filter argument and\n    was using the filter setting from the Image structure instead.\n\n  * The mirror virtual pixel method was broken.\n\nNew Features:\n\n  * Open64 Compiler Suite: Version 5.0 is fully supported.\n\n  * Wand API: Added MagickExtentImage().\n\n  * MEF RAW: Mamiya Photo RAW \"MEF\" format is now supported.\n\nFeature improvements:\n\n  * DPX format: Original file endianness is preserved by default.\n\n  * PNG library: Updated libpng to 1.5.9 release.\n\n  * TIFF library: Updated libtiff to 4.0.1 release.\n\n  * Zlib library: Updated to zlib 1.2.6 release.\n\nPerformance Improvements:\n\n  * Despeckle algorithm (-despeckle) is many times faster.\n\nBehavior Changes:\n\n  * DPX format: Original file endianness is preserved by default.\n\n1.3.13 (December 24, 2011)\n==========================\n\nSecurity Fixes:\n\n  None\n\nBug fixes:\n\n  * In I/O blob, don't rewind already open file handle passed to\n    OpenBlob() since we don't know the intended state of this file\n    handle, and because it prevents appending to an existing file.\n\n  * In AppendImageProfile(), don't leak profile buffer while appending\n    a chunk to an existing profile.\n\n  * Fix deadlock in ClonePixelCache() which was caused by using the\n    same semaphore pointer in the source and destination images.\n\n  * Removed bogus SyncBlob() code which sometimes caused a crash and\n    was not useful.\n\n  * Fixed crash or hang which occured when the user entered CONTROL-C\n    while threaded code was being executed.\n\n  * Fix core dump in AcquireOneCacheViewPixelInlined() when the image\n    is in CMYK space.\n\n  * In MontageImages (montage), fix crash observed with \"-geometry\n    x+0+0\".\n\n  * The TIFF reader was crashing for images which use the\n    TIFFTAG_OPIIMAGEID tag.\n\n  * AppendImages() (-append) was failing when only one image was\n    provided.\n\n  * The `animate`, `display`, and `identify` commands now report any\n    error only once, and then proceed to the next file name rather\n    than quitting.\n\n  * Don't change the locale settings in InitializeMagick() since this\n    may cause problems for international users.  API users are still\n    responsible for assuring that locale settings don't break floating\n    point parsing and output (i.e. floating point decimal needs to be\n    '.' rather than ',').\n\n  * RPM build is fixed (PerlMagick build was broken).\n\n  * RPM build installs documentation to expected places on Red Hat\n    type systems.\n\n  * Fixes for usage with OpenSolaris.\n\n  * DESTDIR is supported by PerlMagick build.\n\n  * The matte channel was not being properly enabled or respected for\n    TXT images.\n\n  * InitializeMagick() and DestroyMagick() are now fully thread safe.\n\n  * When a shear angle was zero, the shear request was being\n    ignored entirely.\n\n  * In DispatchImage(), the `K` channel was always output as black for\n    \"CMYK\" specification unless the image matte flag was True.\n\n  * MATLAB fixes.\n\n  * PNG fixes.\n\n  * PCL fixes for printing bi-level image on Konica-Minolta printers.\n\n  * EPT error handling fixes.\n\n  * JPEG reader was sometimes truncating large IPTC profiles.\n\n  * JPEG writer now handles errors properly rather than allowing\n    libjpeg to exit the program (or hanging if driven by Magick++).\n\n  * JPEG reader now treats an unhandled EXP marker as a warning rather\n    than a hard error.\n\n  * File open errors are now reliably reported.\n\n  * Improved rendering precision when using the drawing APIs.\n\n  * For the Magick++ Image backgroundColor(), borderColor(), and\n    matteColor() methods, preserve the opacity part of the\n    user-specified color.\n\nNew Features:\n\n  * Add support for drawing text using a bitmap font.\n\n  * benchmark command supports a -stepthreads option to execute the\n    specified command with an increasing number of threads to measure\n    how an algorithm benefits from threading.  This mode includes a\n    column to show the speedup compared with one thread, and the\n    Karp-Flatt metric\n\n  * Added support for invoking \"gs-cmyk\" and \"gs-cmyka\" entries in\n    delegates.mgk when ColorSeparationType or ColorSeparationMatteType\n    is requested.  These cause Ghostscript to always output CMYK PAM\n    format (even if the input file was not in CMYK format).\n\n  * EXIF profiles are preserved when writing JPEG files.\n\n  * The -mosaic command now respects the composition option specified\n    by -compose as well as the image background color specified by\n    -background.\n\n  * The TXT coder now supports multiple image frames.\n\n  * For image normalization (-normalize), add support for\n    histogram-threshold setting to specify the percentage of the\n    histogram to discard when computing image normalization parameters\n    (default is 0.1%).  For example `-set histogram-threshold 0.01\n    -normalize`.\n\n  * Added an `INFO` coder which produces textual image description\n    output similar to `identify` but may be used with convert like \"gm\n    convert myfile info:-\".\n\n  * Support application of the PDF crop box via '-define\n    pdf:use-cropbox=true'.\n\n  * For PCL printer output, define pcl:fit-to-page in order for the\n    printer to scale the image to fit the page.\n\n  * Added order dither 5x5, 6x6, and 7x7 circular dither patterns to\n    create a halftone effect.\n\n  * PNM subformats are now reported as the specific subformat rather\n    than just \"PNM\".\n\n  * NetPBM's PAM format is now supported.\n\n  * MacPaint image format reader is added.\n\n  * Added TIFF LZMA compressor support.\n\n  * Added TIFF support for a tiff:group-three-options define to allow\n    power-users to set the value of the GROUP3OPTIONS tag.\n\n  * New core C API function SetImageColorRegion() to set the constant\n    pixel color for a specified region of the image.\n\n  * New Wand C API function MagickWriteImagesFile() to append images\n    to a provided file handle.\n\n  * New Wand C API function MagickSetImageSavedType() to allow\n    specifying the storage type used when saving the file (rather than\n    changing the current image characteristics).\n\n  * In Wand C API, the functions NewPixelWand(), NewDrawingWand(), and\n    NewMagickWand() invoke InitializeMagick() automatically in case\n    user forgets to do so.\n\n  * New Wand C API function MagickSetFormat() to allow setting the\n    file or blob format before it has been read.\n\n  * New Wand C API function MagickSetDepth() to set the depth used\n    when reading from an image format which requires that the depth be\n    specified in advance.\n\nFeature improvements:\n\n  * Now compiles properly with libpng 1.4.X and 1.5.X.\n\n  * Lcms 2.X is supported.\n\nPerformance Improvements:\n\n  * TGA read performance improved.\n\n  * PNM read/write performance improved.\n\n  * Convolution (-convolve, -sharpen, -guassian, etc.) is faster.\n\n  * Adaptive threshold image (-lat) is faster.\n\n  * Image trimming (-trim) is faster.\n\nBehavior Changes:\n\n  * For DPX format and packed 10 bits, datums are now represented in\n    the same (reversed) order for all RGB and YCbCr formats.\n    Previously YCbCr 4:4:4 formats were not swapping the word datums\n    because the only real-world files encountered did not swap the\n    word datums.\n\n  * The -colors, -map, and -monochrome options now take effect\n    immediately rather than at the end of all other processing.\n\n  * Removed non-standard multi-frame extension for SGI format.\n\n  * Windows install footprint is more consistent between DLL and\n    static builds.\n\n  * LZMA compressed tarball is in 'xz' format rather than deprecated\n    'lzma' format.\n\n1.3.12 (March 8, 2010)\n==========================\n\nSecurity Fixes:\n\n  * Updated libpng Windows sources to 1.2.43 in order to resolve\n    CVE-2010-0205 as it pertains to the GraphicsMagick Windows build.\n\nBug fixes:\n\n  * Filter mode (write to stdout) was completely broken.\n\n  * Should now compile with libpng 1.4.\n\n  * Windows PerlMagick build identified itself as the wrong version.\n\nNew Features:\n\n  * None\n\nFeature improvements:\n\n  * None\n\nPerformance Improvements:\n\n  * None\n\nBehavior Changes:\n\n  * DCX output format is only written on request.  Previously the PCX\n    coder would automatically switch to DCX format if multiple frames\n    would be written.\n\n1.3.11 (February 21, 2010)\n==========================\n\nSecurity Fixes:\n\n  * Fixed array underflow on systems using signed char which could\n    result in a program crash due to extended characters in filenames\n    or in certain file formats.\n\nBug fixes:\n\n  * Fixed array underflow on systems using signed char which could\n    result in a program crash due to extended characters in filenames\n    or in certain file formats.\n\nNew Features:\n\n  * Added a -thumbnail command to 'convert' and 'mogrify'.  This is a\n    faster way to scale down the image when speed is a primary\n    concern.\n\n  * Added a -extent command to 'convert' and 'mogrify' which\n    composites the image on top of a backing canvas image of solid\n    color.\n\n  * Added support for -compose to the 'convert' and 'mogrify', which\n    were documented to support it (but did not).\n\nFeature improvements:\n\n  * None\n\nPerformance Improvements:\n\n  * Requests for 'Over' and 'Atop' composition are converted to a\n    request for the (faster) 'Copy' composition when both images are\n    opaque.\n\nBehavior Changes:\n\n  * None\n\n1.3.10 (February 10, 2010)\n==========================\n\nSecurity Fixes:\n\n  * None\n\nBug fixes:\n\n  * +adjoin was not working correctly for the case when only one image\n    frame is present.  With +adjoin and writing one frame to\n    \"foo%d.jpg\" it was outputting \"foo%d.jpg\" rather than \"foo0.jpg\".\n\n  * When drawing paths, memory allocation for the points was much\n    larger than it needed to be (patch by Vladimir Lukianov).\n\nNew Features:\n\n  * None\n\nFeature improvements:\n\n  * None\n\nPerformance Improvements:\n\n  * None\n\nBehavior Changes:\n\n  * To reiterate the change which first appeared in 1.3.9, there is no\n    longer an implicit +adjoin if the output file name happens to\n    contain a %d sequence, or there are multiple frames and the output\n    file format only supports storing one frame.  Specify +adjoin if\n    scene number substition is desired in the output file names.\n\n1.3.9 (February 4, 2010)\n========================\n\nSecurity Fixes:\n\n  * None\n\nBug fixes:\n\n  * Fix \"double free\" error when using gm import -frame.\n\n  * XPM does not support RGBA color syntax, so return RGB instead.\n\n  * The display '-update' option was only working in conjunction with\n    the '-delay' option with a delay setting of 2 or greater.\n\n  * For formats which support multiple frames, output with +adjoin to\n    filenames containing a scene specification (e.g. foo%02d.tiff) was\n    resulting in wrong output file names.\n\n  * -convolve was crashing rather than reporting an error.\n\n  * Fixed crash if the number of OpenMP threads was reduced from the\n    original value via '-limit threads' or omp_set_num_threads().\n\n  * -blur was not blurring the opacity channel for solid-color images.\n\n  * When installing HTML documentation, many files were included which\n    are not part of the formatted documentation.\n\n  * Several deleted global string constants are restored with\n    deprecated status in order to assure that symbols are not removed\n    from the ABI.\n\nNew Features:\n\n  * None\n\nFeature improvements:\n\n  * None\n\nPerformance Improvements:\n\n  * None\n\nBehavior Changes:\n\n  * There is no longer an implicit 'adjoin' if an output filename\n    contains an apparent scene specification (e.g. foo%02d.tiff) and\n    multiple files are not needed to save the image..  It is necessary\n    to use +adjoin.  For example ``gm convert foo.pdf +adjoin\n    %02d.tiff``.\n\n  * -flatten now applies the image background color under the first\n    image in the list if it is not already opaque.\n\n1.3.8 (January 21, 2010)\n========================\n\nSecurity Fixes:\n\n  * Fix for CVE-2009-1882 \"Integer overflow in the XMakeImage\n    function\".\n\n  * Fix lockup due to hanging in loop while parsing malformed\n    sub-image specification (SourceForge issue 2886560).\n\n  * Libltdl: Updated libtool to 2.2.6b in order to fix security issue.\n    Resolves CVE-2009-3736 as it pertains to GraphicsMagick.\n\nBug fixes:\n\n  * -convolve, -recolor: Validate that user-provided matrix is square\n    when parsing -convolve and -recolor commands in order to avoid a\n    core dump.\n\n  * CALS: Reading images taller than the image width resulted in a\n    failure.\n\n  * ConstituteImage(), DispatchImage(): 'A' and 'T' should indicate\n    transparency and 'O' should indicate opacity.  Behavior was\n    inconsistent.  In some cases 'O' meant transparency while in other\n    cases it meant opacity. Also, in a few cases, matte was not\n    getting enabled in the image as it should.\n\n  * DCRAW: Module name was not registered so modules based builds were\n    not supporting formats provided via 'dcraw'.\n\n  * GetOptimalKernelWidth1D(), GetOptimalKernelWidth2D(): In the Q32\n    build, convolution kernel size was estimated incorrectly for large\n    sigmas on 32-bit systems due to arithmetic overflow.  This could\n    cause wrong results for -convolve, -blur, -sharpen, and other\n    algorithms which use these functions.\n\n  * Image Size: Fixed the ability to pass the image size via the\n    filename specification like \"myfile.jpg[640x480]\" rather than\n    needing to use -size.\n\n  * IPTC: Blob data needed to be padded to an even size.  Size is now\n    correctly reported.\n\n  * IPTC: Returned IPTC string values were one character too short.\n\n  * Large Files: Large pixel cache files were not working under GNU\n    Linux.\n\n  * JP2: Fixed some value scaling problems.\n\n  * JP2: Fix possible crash at exit when Jasper is used by a modules\n    build.\n\n  * MPC: is_monochrome and is_grayscale flags were not managed\n    properly for the MPC coder.\n\n  * PCL: Page was not always being ejected.\n\n  * PNG: The png8 encoder would fail when trying to write a 1-color\n    image.\n\n  * PSD: PSD parser was confused by 0x0 pixel layers, resulting in\n    image data corruption of all following layers.\n\n  * -rotate, -shear: Some internally-reported errors were potentially\n    being lost.\n\n  * Subrange/stdin: Commands now support reading an image from stdin\n    in conjunction with a subrange specification (e.g. \"-[1]\").\n\n  * Magick++ STL ShadeImage: Implementation was completely botched.\n\nNew Features:\n\n  * CALS Type 1 files may now be written (Work contributed by John\n    Sergeant).  CALS support is dependent on the TIFF library.\n\n  * GROUP4RAW encoder supports reading/writing RAW Group4 data.\n\n  * JP2: JPEG 2000 may now be written in arbitrary bit depths ranging\n    from 2 to 16 rather than just 8 or 16.\n\n  * JPEG: IJG JPEG library version 7 is now supported.\n\n  * JPEG: Added jpeg:block-smoothing and jpeg:fancy-upsampling defines\n    to control these JPEG library options.\n\n  * JPEG: Detect and apply colorspaces appropriately for ITU FAX JPEG.\n\n  * Resource Limits: There is now a \"threads\" resource limit which\n    allows specifying the number of OpenMP threads which may be used,\n    similar to the OMP_NUM_THREADS environment variable.\n\n  * TIFF: Allow CIELAB TIFF to be read.\n\n  * MagickGetImageAttribute()/MagickSetImageAttribute(): New Wand\n    methods to support getting and setting an image attribute.\n    Contributed by Mikko Koppanen.\n\n  * ClonePixelWand(): New Wand method to deep-copy an existing pixel\n    wand.\n\n  * ClonePixelWands(): New Wand method to deep-copy an array of\n    existing pixel wands.\n\n  * MagickCdlImage(): New Wand method to apply the ASC CDL to an\n    image.\n\n  * MagickGetImageBoundingBox(): New Wand method to return the crop\n    bounding box required to remove any solid-color border from the\n    image.\n\n  * MagickGetImageFuzz(), MagickSetImageFuzz(): New Wand methods to\n    get and set the color comparison fuzz factor.\n\n  * MagickHaldClutImage(): New Wand method to apply a Hald CLUT to an\n    image.\n\n  * MagickSetResolution(): New Wand method to set the wand resolution.\n\n  * MagickSetResolutionUnits(): New Wand method to set the wand\n    resolution units.\n\n  * Magick++: Allow Magick++ library to built as a DLL under MinGW and\n    Cygwin.  This requires a modern GCC in order for C++ exceptions to\n    work.\n\nFeature improvements:\n\n  * Cygwin: Cygwin 1.7 is now supported.\n\n  * JPEG compression settings are preserved (if possible) when\n    inserting JPEG blobs into formats which use JPEG.\n\n  * PDF: If the original file used JPEG compression, then use JPEG\n    compression with original settings (if possible).\n\n  * TIFF: Update Windows build to use libtiff 3.9.2.\n\n  * X11 Display: Apply a checkerboard pattern underneath transparent\n    images which use more than simple binary transparency.\n\nPerformance Improvements:\n\n  * Gamma: Performance is improved for Q8 and Q16 builds.  Also\n    preserve full precision in Q32 build.\n\n  * String data is dealt with a bit more efficiently (fewer\n    allocations, less memory, and less CPU).\n\nBehavior Changes:\n\n  * InitializeMagick() MUST be invoked prior to using any Magick API\n    function.  Failure to do so will likely lead to an immediate\n    application crash.  This is due to initialization and runtime\n    changes intended to improve thread safety and efficiency.\n    Previously it was only strongly recommended to invoke\n    InitializeMagick().\n\n  * ConstituteImage(), DispatchImage(): 'A' and 'T' should indicate\n    transparency and 'O' should indicate opacity.  Behavior was\n    inconsistent.  In some cases 'O' meant transparency while in other\n    cases it meant opacity. Also, in a few cases, matte was not\n    getting enabled in the image as it should.\n\n  * colors.mgk: Is now empty to default and is optional.  Previous\n    content is now compiled into the library in an efficient way, but\n    existing values may be modified, or new values added by adding\n    entries to color.mgk.\n\n  * DisableSlowOpenMP is now the default.  Use --enable-openmp-slow to\n    enable OpenMP for algorithms which sometimes run slower rather\n    than faster.\n\n  * magic.mgk: This configuration file is no longer used since this\n    data is now compiled into the library in an efficient way.\n\n  * modules.mgk: Is now empty to default and is optional.  Previous\n    content is now compiled into the library in an efficient way, but\n    existing values may be modified, or new values added by adding\n    entries to modules.mgk.\n\n  * Third party executables not included in the Visual Studio build\n    are no longer bundled in the GraphicsMagick installer.  This means\n    that hp2xx.exe, mpeg2dec.exe, and mpeg2enc.exe are no longer\n    distributed.\n\n1.3.7 (September 17, 2009)\n==========================\n\nSecurity Fixes:\n\n  * PCX: Detect improper rows, columns, or depth.  Fixes CVE-2008-1097\n    \"Memory corruption in ImageMagick's PCX coder\".\n\n  * DrawDashPolygon: Avoid a crash which sometimes occured with tiny\n    polygons.\n\nBug fixes:\n\n  * JPEG: Profile chunks need to be concatenated in order to build\n    the whole profile.  This was not working so embedded profiles\n    larger than 32K or maybe 64K were being corrupted.  This bug was\n    introduced in GraphicsMagick 1.2.\n\n  * Meta: Fix memory leaks.\n\n  * Meta: Work better with with IPTC record 2 blocks and deal better\n    with IPTC embedded in an 8BIM profile.  Fixes by John Sergeant.\n\n  * MPC: Fix crash when reading MPC and the input image is modified.\n\n  * PNG: Ensure that the opacity channel is properly initialized.\n\n  * -profile: Lowercase arguments were sometimes not working as\n    expected.\n\n  * Topol: Topol reader actually works now and is included in test\n    suite.\n\n  * TIFF: Read and write JPEG-compressed grayscale TIFF correctly.\n\n  * VisualMagick configure now works properly when output paths are\n    specified.\n\n  * WMF: Eliminate memory leaks.\n\nNew Features:\n\n  * MagickWand: New method MagickSetCompressionQuality() to allow\n    setting the compression quality.\n\n  * MagickWand: New method CloneDrawingWand() to deep-copy a drawing\n    wand.\n\n  * MagickWand: New method DrawGetException() to retrieve information\n    regarding the last drawing wand exception (if any).\n\n  * MagickWand: New method DrawClearException() to clear a drawing wand\n    exception.\n\n  * Magick++: New Image method cdl() to apply the ASC CDL.\n\n  * Magick++: New Image method colorMatrix() to apply a color matrix\n    to the image channels.\n\n  * Magick++: New Image method haldClut() to apply a color lookup\n    table (Hald CLUT) to the image.\n\n  * MSL/Conjure: Added a new 'profile' command which applies, adds, or\n    removes one or more IPTC, ICC or generic profiles from a file.\n    Work contributed by John Sergeant.\n\n  * Added a 'time' subcommand to provide Unix-style 'time' output when\n    a 'time' capability is missing, or the reporting format is\n    inconsistent.  For example 'gm time convert ...'.\n\nFeature improvements:\n\n  * ColorMatrixImage(): Add opaque opacity channel when needed.\n\n  * PDF & PS: Use '-type palette' prior to input file name to cause\n    Ghostscript to return a dithered colormapped image.\n\n  * PNG: Now compiles with libpng-1.4.0beta74 and later.\n\n  * TIFF: Libtiff in Windows build is upgraded to 3.9.1.  This allows\n    GraphicsMagick to read and write 16 and 24 bit float TIFF files.\n\n  * Windows code to find Ghostscript is rewritten from scratch.\n\nPerformance Improvements:\n\n  * Drawing of points, lines, and polygons (and complex shapes based\n    on these) is now accelerated using OpenMP with excellent speed-up.\n\n  * ICC color transforms now see linear speedup from OpenMP.\n\n  * Rotate: For rotations of 90 or 270 degrees, tile sizes are\n    selected more appropriately.\n\nBehavior Changes:\n\n  * No longer clear the exception structure at the start of\n    ReadImage() and other similar functions since this sometimes masks\n    errors.  The API user is expected to make sure that the exception\n    structure is clean prior to invoking a function.\n\n  * SVG: Writer is now disabled since it usually does not work properly.\n\n1.3.6 (July 25, 2009)\n=====================\n\nSecurity Fixes:\n\n  * None.\n\nBug fixes:\n\n  * Composition was failing when the change image overlaps off the\n    left side of the canvas.\n\n  * EPT, PDF, PS: PDF bounding box is sometimes incorrect or not\n    globally applicable so don't specify bounding box when reading PDF\n    files.\n\n  * OpenMP: Fix (benign) multi-thread cross-contentions (detected by\n    valgrind's Helgrind).\n\n  * TIFF: Fix problem with reading one bit per sample RGB images.\n\n  * TIFF: Writer was using rows-per-strip of 8 when writing\n    JPEG-compressed TIFF.  This does not work for vertical\n    subsampling, and some TIFF readers insist on 16.  The\n    rows-per-strip is now required to be a multiple of 16.\n\n  * TIFF: In some cases, the TIFF reader and writer were accessing\n    planar TIFF in row-order rather than plane-order, which resulted\n    in sever buffering problems in libtiff, and failure when\n    compression was used.\n\n  * -write now works usefully as documented.\n\n  * Temporary file name generator was not random enough, resulting in\n    some file name collisions for GraphicsMagick processes started at\n    the same time.\n\n  * PerlMagick: Fixed Ping on a BLOB.\n\n  * GetImageDepth was leaking memory.\n\n  * Convert/mogrify -mask option was leaking memory.\n\n  * Mogrify -output-directory option was leaking memory.\n\n  * DPX: Fixed memory leak encountered when subsampling to 4:2:2.\n\n  * DPX: Values read received insuficient scaling, which round-tripped\n    correctly, but rounded-down excessively if any image processing\n    was applied.\n\nNew Features:\n\n  * Added HRS reader for slow scan TV (contributed by Fojtik Jaroslav).\n\n  * Pthreads (POSIX threads) API may now be used under the WIN32 API.\n\n  * New access confirmation facility (MagickConfirmAccess) to allow\n    the API user to monitor and/or block access to files and URLs.\n    This allows the API user to implement a security policy based on\n    actual accesses.\n\n  * New color matrix function (ColorMatrixImage) to apply a color\n    matrix similar to Adobe Flash Flash.filters.colorMatrixFilter(),\n    and Windows GDI+ ColorMatrix class, (order up to 5x5) to the image\n    pixels.  This is accessible via the -recolor command option.\n\n  * Added an IDENTITY coder to return a Hald identity CLUT image of\n    specified order (e.g. \"identity:8\").\n\n  * Added a Hald CLUT capability as described at\n    http://www.quelsolaar.com/technology/clut.html.  This allows a\n    color transformation to be easily created and replicated on any\n    number of images.  The algorithm is accessed by the -hald-clut\n    option of 'convert' and 'mogrify'.  Original algorithm by Eskil\n    Steenberg and adapted for GraphicsMagick by Clment Follet, with\n    additional work by Bob Friesenhahn.\n\n  * Added support for the ASC CDL transform.  Available as -asc-cdl\n    via the 'convert' and 'mogrify' subcommands.  Original\n    implementation by Clment Follet but considerably re-worked by Bob\n    Friesenhahn.  Implementation passes the +/- 1 count accuracy\n    requirement required by the ASC CDL SOP tests.\n\n  * Added support for reading CALS Type 1 format (contributed by John\n    Sergeant).  CALS is a standard raster format used by the US\n    Department of Defense for storing blueprint images.\n\n  * Added a random number generation system based on George\n    Marsaglia's multiply-with-carry generator.  Somewhat slower than\n    rand() but produces better random numbers with a period >2^60.\n    This is a much better random number generator than the C library\n    rand() and the algorithm is integrated in a way which maximizes\n    multi-thread performance.\n\n  * The 'compare' command now supports a -maximum-error option to\n    specify the maximum image error so that it may be used to support\n    boolean logic in automated test scripts.\n\n  * For OpenMP-builds, the '-list resource' output now indicates the\n    number of threads which will be used.\n\nFeature improvements:\n\n  * Image resize now avoids adding \"halos\" around objects when\n    resizing an image which contains transparency (patch contributed by\n    Pavel Merdin).\n\n  * DICOM: The DICOM reader is completely re-written and is much more\n    functional now.  A few features (e.g. RLE compression) are still\n    missing.  This work is contributed by John Sergeant.\n\n  * EXIF: Unprintable characters in EXIF attribute strings are now\n    returned using three-digit octal notation.  Unknown tags are\n    identified via their four-character hex value.\n\n  * PCL: PCL writer is rewritten to fix many bugs, add support for\n    compression, add support for 8 bit PseudoClass images, and\n    dramatically improve usability (work contributed by John Sergeant).\n\n  * TIFF: Allow the user to force the returned image to be TrueColor\n    type for min-is-white and min-is-black TIFF files.\n\n  * TIFF: User can now specify the predictor using syntax like\n    '-define tiff:predictor=2'.\n\n  * TIFF: User can now specify the rows-per-strip value when using\n    JPEG compression.\n\n  * TXT: The TXT reader is now capable of reading image files written\n    by the TXT writer, as well continuing to render ASCII text into an\n    image (work contributed by Fojtik Jaroslav).\n\n  * Utilities @file.txt syntax for including a list of files to use as\n    an argument now really works as expected.  This may be used to\n    inject any other text into the command line as well.  As a result,\n    the 'mogrify' utility may be invoked on thousands of files at once\n    while obtaining the list of files to process from a text file.\n\n  * The 'mogrify' utility now caches argument images so that they are\n    loaded only once when mogrify is used to process multiple image\n    files.\n\nPerformance Improvements:\n\n  * -median and -noise now see reliable linear speedup as threads are\n    added.\n\nBehavior Changes:\n\n  * PerlMagick is configured but no longer built by default.\n\n  * Use '-interlace Line' to produce an interlaced GIF, PNG, or\n    progressive JPEG.\n\n1.3.5 (January 26, 2009)\n=========================\n\nSecurity Fixes:\n\n  * BMP and DIB formats were throwing an assertion for negative height\n    values.  This caused the process to crash.\n\nBug fixes:\n\n  * Don't install Magick++ headers if C++ is disabled.\n\n  * Linux RPM SPEC file needs to always install the loadable module\n    .la files or else the modules won't load.\n\n  * Windows runtime DLLs were for the wrong compiler version,\n    resulting in failure to execute if the correct runtime DLLs are\n    not available.\n\nNew Features:\n\n  * None\n\nFeature improvements:\n\n  * FITS: Parsing is more robust.\n\nPerformance Improvements:\n\n  * None\n\n1.3.4 (January 13, 2009)\n=========================\n\nSecurity Fixes:\n\n  * None.\n\nBug fixes:\n\n  * Now runs under Windows Vista (as a 32-bit application).\n\n  * Fix for colorspace transform math overflow in Q32 build.\n\nNew Features:\n\n  * Windows build supports OpenMP and requires Windows 2000 or later\n    (source code still supports Windows '98).\n\n  * Support large files under Windows.\n\n  * Support reading/writing 16 and 24 bit float TIFF files.\n\n  * Support reading/writing 64 bit integer TIFF files.\n\n  * Added \"Log\", \"Max\", \"Min\", and \"Pow\" options to -operator.\n\nFeature improvements:\n\n  * Debug logging now properly prints 64-bit offset values.\n\nPerformance Improvements:\n\n  * Improve resource estimation for Microsoft Windows systems.\n\n1.3.3 (December 9, 2008)\n========================\n\nSecurity Fixes:\n\n  * None.\n\nBug fixes:\n\n  * 'identify' was throwing an assertion when used on colormapped\n    files (this bug was introduced by 1.3.2).\n\n  * With the -segment option, eliminate trashing the image colors when\n    used on huge images.\n\n  * 'identify -format \"%c\"' now reports the entire comment regardless\n    of size.\n\n  * Argument to -convolve is no longer arbitrarily truncated so huge\n    convolution kernels may now be specified from the command line.\n\nPerformance Improvements:\n\n  * Image segmentation (-segment) is now accelerated using OpenMP and\n    uses several other tactics to improve execution performance.\n\n  * 'identify \"*\"' now successfully works in a 32-bit application when\n    used in a directory containing a million files.\n\n  * 'identify' now executes quickly when used on TIFF files.\n\n1.3.2 (November 29, 2008)\n=========================\n\nSecurity Fixes:\n\n  * None.\n\nBug fixes:\n\n  * -roll was failing for colormapped images.\n\n  * VID: Memory leak fix.\n\n  * PREVIEW: Solarize parameter was wrong.\n\n  * Delegates previously using 'spawn' needed an ampersand so that\n    starting the child process does not hang the GUI.\n\nFeature improvements:\n\n  * +profile now supports an exclusion syntax.  For example ``+profile\n    '!icm,*'`` removes all of the profiles except for the ICM profile.\n    The new syntax also allows multiple profiles to be listed at once.\n\nPerformance Improvements:\n\n  * AdaptiveThreshold, Blur, Convolve, and MotionBlur no longer\n    process the opacity channel unless the image has one.\n\n1.3.1 (November 17, 2008)\n=========================\n\nSecurity Fixes:\n\n  * None.\n\nBug fixes:\n\n  * RPM build, Fixes to successfully build binary RPMs for Red Hat\n    Linux 4.\n\n  * MSL/conjure, Fix bug with attributes becoming appended to\n    themselves.  Fix memory leaks.\n\nFeature improvements:\n\n  * New --disable-openmp-slow configure option for disabling use of\n    OpenMP for algorithms which may run slower on operating systems\n    with crummy thread libraries.\n\n  * JPEG, Allow user to specify DCT encoding method via\n    jpeg:dct-method define.  Also allow control over whether huffman\n    encoding is used via jpeg:optimize-coding define.\n\nPerformance Improvements:\n\n  * OpenMP (parallel processing) improvements for these functions:\n\n    - Rotate by 90 and 270 degrees (-rotate)\n\n1.3 (November 9, 2008)\n======================\n\nSecurity fixes:\n\n  * AVI reader: Re-worked to be more robust against crash or DOS.\n\n  * AVS reader: Re-worked to be more robust against crash or DOS.\n\n  * DCM reader: Re-worked to be more robust against crash or DOS.\n\n  * EPT reader: Re-worked to be more robust against crash or DOS.\n\n  * FITS reader: Re-worked to be more robust against crash or DOS.\n\n  * MTV reader: Re-worked to be more robust against crash or DOS.\n\n  * PALM reader: Re-worked to be more robust against crash or DOS.\n\n  * RLA reader: Re-worked to be more robust against crash or DOS.\n\n  * TGA reader: Re-worked to be more robust against crash or DOS.\n\n  * Avoid possible crash in GetImageCharacteristics() when substituting\n    text in comment read from file.\n\n  * Cineon reader: Fixed crash with broken file from Sami Liedes.\n\n  * Palm reader: Fixed crash with broken files from Sami Liedes.\n\n  * PICT reader: Fixed crash with broken files from Sami Liedes.\n\n  * DPX reader: Validate file data better to avoid improper operation with\n    intentionally (or accidentally) defective files.\n\n  * XCF reader: Fixed crash with broken files from Sami Liedes.\n\nBug fixes:\n\n  * Libbz2 is now detected for MinGW.\n\n  * Install documentation under /usr/local/share/doc/GraphicsMagick by\n    default, according to GNU conventions.\n\n  * In PerlMagick, Dissolve composition was not working right.\n\n  * FITS: Ensure that written format conforms to specification.\n\n  * TIFF:\n\n    - Don't accidentially convert CMYK images to RGB.\n\n    - Eliminated a memory leak in the codec support detection code.\n\n  * JPEG: Removed over-write of image->client_data.\n\n  * PDF: Try to properly deal with reading rotated PDFs.\n\n  * PNG: Fixed crash when writing PNG images with transparency and either\n    optimize is requested, or the image is colormapped.\n\n  * Configure: Fixed the --enable-magick-compat configure option, which\n    had stopped working.\n\n  * Configure: Fixed --without-magick-plus-plus so that it works again.  This\n    stopped working in the 1.2 release cycle.\n\n  * Configure: Fixed MagickLibVersion text string generation so that it\n    is now correct when a component of the release number exceeds '9'.\n    Now components can safely count up to '99' before there is a problem.\n\nPerformance Improvements:\n\n  * OpenMP (parallel processing) improvements for these functions:\n\n    - Affine transform (-affine -transform)\n    - Average images (-average)\n    - Add noise (+noise)\n    - Black threshold (-black-threshold)\n    - Blur (-blur)\n    - Border (-border)\n    - Channel import, export, and depth-setting (-channel, -depth)\n    - Clip path\n    - Coalesce (-coalesce)\n    - Colorize (-colorize)\n    - Colorspace transformation (-colorspace)\n    - Compare images ('compare' command)\n    - Composition ('composite' command)\n    - Convolution (-convolve, -edge, -emboss, -gaussian, -sharpen)\n    - Contrast adjust (-contrast)\n    - Crop (-crop)\n    - CycleColormap (-cycle)\n    - Depth setting (-depth, -operator depth)\n    - Despeckle (-despeckle)\n    - Enhance (-enhance)\n    - Equalize (-equalize)\n    - Flatten (-flatten)\n    - Flip (-flip)\n    - Flop (-flop)\n    - Frame (-frame)\n    - Gamma adjust (-gamma, -operator gamma)\n    - Gradient\n    - Implode (-implode)\n    - Levels adjust image (-level)\n    - Local adaptive threshold (-lat)\n    - Median filter (-median)\n    - Minify image (-minify)\n    - Modulate image (-modulate)\n    - Morph image (-morph)\n    - Mosiac (-mosaic)\n    - Motion blur (-motion-blur)\n    - Negate image (-negate)\n    - Noise filter (-noise)\n    - Normalize image (-normalize)\n    - Oil Paint (-paint)\n    - Opaque (-opaque)\n    - Ordered dither (-ordered-dither)\n    - Operators (-operator)\n    - Profile adjust (ICC) (-profile)\n    - Random threshold (-random-threshold)\n    - Resize image (-resize)\n    - Raise image (-raise)\n    - Roll image (-roll)\n    - Rotate image (-rotate)\n    - Shade image (-shade)\n    - Shear image (-shear)\n    - Shave (-shave)\n    - Solarize image (-solarize)\n    - Spread image (-spread)\n    - Statistics computation (identify -verbose)\n    - Swirl (-swirl)\n    - Threshold channel (-threshold, -operator threshold)\n    - Threshold image (-threshold)\n    - Transparent (-transparent)\n    - Trim image (-trim)\n    - UnsharpMaskImage (-unsharp)\n    - Wave (-wave)\n    - White threshold (-white-threshold)\n\n  * Improved coder management performance.\n\n  * XCF (GIMP) reader is much faster.\n\nNew Features:\n\n  * Use MAGICK_CODER_STABILITY environment variable to enable a subset\n    of the coders based on their stability classification.\n\n  * Use MAGICK_IO_FSYNC environment variable to cause written file to\n    be synchronized to disk to avoid possible data loss on power fail.\n\n  * Added 'compare' command to statistically or visually compare two\n    image files.\n\n  * Added new channel operators (-operator):\n\n    - Assign\n    - Gamma\n    - Depth\n    - Negate\n    - Noise-Gaussian\n    - Noise-Impulse\n    - Noise-Laplacian\n    - Noise-Multiplicative\n    - Noise-Poisson\n    - Noise-Uniform\n    - Threshold\n    - ThresholdBlack\n    - ThresholdWhite\n\n  * New composition operators (-compose):\n\n    - CopyBlack\n    - CopyCyan\n    - CopyMagenta\n    - CopyYellow\n    - Divide\n\n  * Added -motion-blur to motion blur the image.\n\n  * Mogrify and convert now support -black-threshold and -white-threshold.\n\n  * MAT: Now supports reading compressed files.\n\n  * FITS: Now supports 8, 16, 32 bit integer, float, and double images\n    and writes correct FITS format.\n\n  * DCRAW: Coder proxy module allows reading digital camera files as if\n    they were natively supported.\n\n  * New C API functions:\n\n    - AddNoiseImageChannel(), add noise to an image channel.\n    - BlurImageChannel(), blur an image channel.\n    - GaussianBlurImageChannel(), gaussian blur an image channel.\n    - ImportImageChannelsMasked(), import selected image channels.\n    - SharpenImageChannel(), sharpen an image channel.\n    - UnsharpMaskImageChannel(), unsharpmask an image channel.\n    - New cache view interfaces to correct shortcomings of original\n      ones.  New interfaces are AcquireCacheViewPixels(),\n      AcquireOneCacheViewPixel(), AcquireCacheViewIndexes(),\n      GetCacheViewPixels(), SetCacheViewPixels(), and\n      SyncCacheViewPixels(). The deprecated functions are\n      AcquireCacheView(), GetCacheView(), SetCacheView(), and\n      SyncCacheView().\n    - GetCacheViewRegion() reports region bounded by a cache view.\n    - GetCacheViewArea() reports area bounded by a cache view.\n    - ExportViewPixelArea() exports a cache view as formatted pixels.\n    - ImportViewPixelArea imports formatted pixels into a cache view.\n\n  * Removed C API functions:\n\n    - ReadStream()\n    - WriteStream()\n\n  * Magick++ C++ API improvements\n\n    - Color class no longer considers transparent black to be an invalid\n      color.\n    - New Image methods addNoiseChannel(), blurChannel(),\n      gaussianBlurChannel(), motionBlur(), randomThresholdChannel(),\n      randomThresholdChannel(), sharpenChannel(), unsharpmaskChannel().\n\nFeature improvements:\n\n  * -ordered-dither and -random-threshold may now be used to individually\n    dither any named channel.\n  * Mogrify and convert now support -minify to halve the image size.\n  * Mogrify and convert now support -magnify to double the image size.\n\n1.2 (April 29, 2008)\n====================\n\nSecurity fixes:\n\n  * Fixes for CERT security alert TA04-217A described at\n    \"http://www.us-cert.gov/cas/techalerts/TA04-217A.html\".\n  * AVI, BMP, & DIB security fixes.\n  * PSD security fixes.\n  * P7 format security fix.\n  * Fix EXIF IFD stack overflow vulnerability.\n  * SGI security fix for RLE encoding (CVE-2006-4144)\n  * XCF security fix (CVE-2006-3743)\n  * PALM heap overflow fix (CVE-2006-5456)\n  * DCM security fix (CVE-2006-5456)\n  * Fix for shell command injection in delegate code via file names)\n    (CVE-2005-4601).  Delegate execution is much more secure now.\n  * Don't use filenames as printf specifications (CVE-2006-0082).\n  * Fix integer overflow in DCM coder (CVE-2007-1797).\n  * XWD integer overflow fix (CVE-2007-1797).\n  * Implementation has replaced usage of strcpy, strcat, and strncat\n    with the more security conscious strlcat and strlcpy.\n  * DCM, DIB, XCF, XBM, and XWD security fix for integer overflow\n    vulnerability (IDefense 09.19.07).\n  * Do not access X11 or invoke convenience or stealth delegate programs\n    based on the file extension. In particular, these file extensions are\n    rejected for consideration as a format specifier: 'autotrace',\n    'browse', 'dcraw', 'edit', 'gs-color', 'gs-color+alpha', 'gs-gray',\n    'gs-mono', 'launch', 'mpeg-encode', 'print', 'scan', 'show', 'win',\n    'xc', and 'x'.\n\nBug fixes:\n\n  * The configure script now searches for a web browser in the order\n    mozilla, firefox, and finally netscape.\n  * When the user specifies the -units option, the current image\n    resolution values are now re-scaled to match the new units.\n  * Properly determine Ghostscript font location for Ghostscript 8.0 and later.\n  * GraphicsMagick now successfully builds and passes all tests under\n    Digital Unix 5.1, using the vendor compiler.\n  * Ghostscript sometimes displays an error message and fails, yet it\n    returns a success error code to GraphicsMagick. Verify that\n    Ghostscript has updated the output file before attempting to use it.\n  * Fixed a configure script syntax error when testing for trio.\n  * When requesting a list of formats, all of the modules in the module\n    search path are considered. Previously only the modules in the same\n    directory as the LOGO module were listed.\n  * Ensure that an image clip mask is respected by the negate algorithm.\n  * The BMP writer was sometimes writing incorrect BMP v4 files.\n  * Support reading and writing large PCX files.\n  * The Red Hat source RPM was failing to install the -config scripts\n    with execute permissions.\n  * Fixed a bug which could cause possible truncation while cloning the\n    image cache.\n  * Ensure that MIFF files indicate the compression which was actually used.\n  * Properly handle errors from libtiff so that corrupted images are not\n    output.\n  * Fix for stripped-TIFF reader. Discard extra samples beyond alpha in\n    scanline TIFFs.\n  * Endian option now controls TIFF byte-order rather than bit-order.\n  * TIFF writer can now write to pipes and other non-seekable output\n    destinations.\n  * JBIG writer was writing empty files for some libjbig releases.\n  * Improved handling of corrupt GIF files.\n  * Handle large SUN format images.\n  * Properly compute image depth for 16-bit SGI image files.\n  * For the gmdisplay program, ensure that only RGB data is sent to Windows.\n  * Many memory leak fixes.\n  * PDF writer is fixed so that Ghoscript 8.5 doesn't warn about the output.\n  * PDF writer now writes proper output with CCITT compression.\n  * Properly use fseeko() and ftello() if they are available.\n  * Fixed a infinite loop bug in the XWD reader.\n  * Fix minor memory leak in ProfileImage().\n  * Fixed -level command parsing when a percent symbol is supplied within the\n    argument rather than at the end.\n  * Fix pixel scaling problem caused by floating point\n    rounding error (noticed under AIX).\n  * Fixed a memory leak in the GIF coder in the error return path.\n  * Fix for SourceForge bug id 1353744 \"MagickGetQuantumDepth doesn't work\".\n  * Fix for SourceForge bug id 1315109 \"segfault in InitializeMagick(NULL)\".\n  * Fix for SourceForge bug id 1391421 \"problem doing resize on 273x1 JPEG\".\n  * Fix for SourceForge bug id 1510075 \"Failed to write PDF with JPEG compression\".\n  * Fix for SourceForge bug id 1572357 \"GetOnePixel definition appears incorrect\".\n  * Fix for SourceForge bug id 1576616 Fix includedir variable in pkg-config files\".\n  * Fix for SourceForge bug id 1173713 \"segfault in ModifyCache\".\n  * Fix for SourceForge bug id 1431805 \"clip art wpg files cause access violation\n    in graphics magick\".\n  * Fix for SourceForge bug id 1743141 \"Affine matrix option parsing\".\n  * Fix for SourceForge bug id 1625477 \"Memory leak reading layered PSD Image\".\n  * Fix for SourceForge bug id 1878992 \"literal square brackets in file\n    name cause large delay and bug id 1783209 \"converting runs slowly\n    when subimage is specified\".\n  * Fix for SourceForge bug id 1883527 \"compression of tiff-file has no effect\".\n  * Successfully read files in the form \"file[123]\".\n  * Fix reading 12-bit grayscale JPEG.\n  * Set image depth appropriately when importing image from X11 display.\n  * Fix map resource tracking.\n  * Fix reading recent variants of ImageMagick's MIFF format.\n  * Output bilevel TIFF meeting the TIFF Class F specification.\n\nNew Utilities:\n\n  * A 'benchmark' subcommand is now available to benchmark the\n    performance of any other arbitrary subcommand (e.g. 'convert').\n\nFeature improvements:\n\n  * LZW compression is now enabled by default.\n  * Support industry-standard subsampling notation like \"4:2:2\".\n  * If gm is executed under a traditional alternate name (e.g.\n    convert), it will invoke the appropriate sub-command. This allows\n    use of hard links, symbolic links, or just copying 'gm' to the\n    desired sub-command name in order to achieve 100% ImageMagick 5.5.2\n    utility compatibility.\n  * Provide the --enable-magick-compat option when configuring to install\n    ImageMagick utilities compatibility links.\n  * Identify -verbose output includes normalized (0.0-1.0) statistics.\n  * Identify and convert now print \"pixels per second\" rates to help\n    evaluate performance.\n  * Added the identify +ping option to force reading the complete file.\n  * The display program now supports the +progress option to disable any\n    visual progress indication (and hourglass cursor) while loading images.\n  * Support writing grayscale TGA files.\n  * Provide explicit support for Rec 601 and Rec 709 grayscale spaces.\n  * Include some support for a log RGB space based on the 2.048 density\n    range as defined for the Cineon Digital Film System.\n  * Added utilities command-line support for industry standard subsampling\n    notation like 4:4:4 and 4:2:2.\n  * Use MAGICK_IOBUF_SIZE to tune the size of the I/O buffer.\n  * Use -type Bilevel, Grayscale, TrueColor, or TrueColorMatte to\n    influence the type of image that Ghostscript returns.\n  * Use '-define tiff:fill-order={msb2lsb|lsb2msb}' to control TIFF bit\n    fill order.\n  * The -version option now dumps a feature list as well as the build\n    options.\n  * The -endian option now supports the option 'native'.\n  * A -monitor is added to enable progress monitoring for the command line\n    utilities.\n  * Use the -output-directory option to 'mogrify' to send output files to\n    the specified directory.\n  * Use the -create-directories option in conjunction with\n    -output-directory and 'mogrify' to create any necessary subdirectories.\n  * A Pixels resource limit is added.  Use '-limit Pixels value' to limit\n    the maximum number of pixels in an image to 'value'.\n  * The already supported option '-type Optimize' is now honored by\n    formats that need to choose a subformat based on the properties of\n    the image. Grueling tests of many/all pixels are not performed\n    unless '-type Optimize' is supplied.\n  * Added a a -set option to the composite, convert, display, mogrify,\n    import commands in order to allow setting an image attribute.\n  * Display utility no longer defaults to reading from standard input if\n    stdin is not a tty.\n  * May now be configured to use the umem memory allocation library\n    available in Solaris 9, Update 3 and later, or from the portable umem\n    project.\n\nCoder additions/improvements:\n\n  * Replaced existing DPX \"support\" with all-new DPX support conforming\n    to the SMPTE 268M-2003 standard.\n  * Cineon reader completely rewritten.\n  * TIFF coder is completely re-written. Now supports reading and\n    writing RGB, CMYK, and grayscale, scanline-oriented TIFF images\n    with arbitrary (1 to 32 bits) depth. Includes support for tiled\n    TIFF, floating point TIFF, LogLuv TIFF, BigTIFF, arbitrary depths,\n    and associated alpha.\n  * TIFF coder now supports retrieving and saving XMP profiles.\n  * MATLAB support is much improved and supports writing as well.\n  * WPG reader now supports CTM translations.\n  * ART format now supports writing.\n  * Support 32-bit raw RGB images.\n  * Support 32-bit raw CMYK images.\n  * Support 32-bit raw gray images.\n  * JP2 coder reads images in YCbCr colorspace and retrieves an embedded\n    ICC ICM color profile if present.\n\nAPI enhancements:\n\n  * Added ExportImageChannel() and ImportImageChannel() APIs to support\n    exporting and importing pixel regions with an arbitary range of (1\n    to 32) bits per quantum.\n  * Added image leveling methods for Magick++.\n  * Generalized GetImageAttribute() support for retrieving wildcarded\n    attributes so that an identify -format specification like\n    ``\"%[dpx:*]\"`` works as expected.\n  * Incorporated changes changes necessary so that GraphicsMagick can\n    work with the Ch C/C++ interpreter from SoftIntegration at\n    http://www.softintegration.com/.\n  * Added MagickAllocFunctions() to allow the API user to replace the\n    underlying memory allocator functions.\n  * Added MagickMalloc() and deprecated AcquireMemory().\n  * Added MagickCloneMemory() and deprecated CloneMemory().\n  * Added MagickMallocArray() to safely allocate N items of size S.\n  * Added MagickRealloc() and deprecated ReacquireMemory().\n  * Added MagickFree() and deprecated LiberateMemory().\n\nPerformance improvments:\n\n  * The DispatchImage() and ConstituteImage() functions incorporate\n    special case code for BGR, BGRO, BGRP, RGB, RGBO, and I formats (8\n    bit only) in order to improve performance dramatically.\n  * When writing very large JPEG images, don't enable Huffman compression\n    since doing so requires libjpeg to buffer the entire image in memory.\n  * When using the 'identify' -verbose option, -verbose must be specified\n    twice in order to obtain the color count.  This makes normal use of\n    -verbose much faster.\n  * Significantly improved read/write speed for bilevel and gray images.\n  * TIFF I/O is considerably faster.\n  * Postscript writer is 10-15X faster.\n  * PNM formats writer is 10-100X faster.\n  * Rotate by 90 or 270 degrees is 2-9X faster.\n\nWindows-specific improvements/changes:\n\n  * For the MinGW and Cygwin builds, the Magick++ library is forced to\n    build as a static library since otherwise C++ exceptions don't work.\n  * MinGW cross-build is available from a Linux or FreeBSD host.\n  * Determine location of Ghostscript fonts only once in order to improve\n    performance.\n  * Updated bzip2 to 1.0.4.\n  * Updated Jasper library to version 1.900.1.\n  * Updated jbigkit to 1.6\n  * Updated lcms to 1.17\n  * Updated libpng to 1.2.27.\n  * Updated libtiff to 3.8.2\n  * Updated zlib to 1.2.3.\n  * Libtiff supports LZW compression.\n  * X11 is no longer part of the default build and will not be included\n    in the distributed install packages (but can still be built).\n  * Find latest Ghostscript which idenfies itself as \"GPL Ghostscript\".\n  * Use GlobalMemoryStatusEx(), if available, to determine how much\n    physical memory is available. Important for large-memory machines.\n  * Fixed NTreaddir() so that it does not write beyond its buffer.\n  * Fixed opendir() emulation function so it can't overwrite the stack.\n  * FlashPIX library sources are no longer distributed in the Windows\n    source package and building FlashPIX is disabled by default.\n    FlashPIX may still be built by adding the library (separately\n    distributed).\n  * Fix bitmap handle leak in CropImageToHBITMAP() and ImageToHBITMAP().\n\n1.1 (Released April 4, 2004)\n============================\n\nBug fixes:\n\n  * Semaphore fix which is necessary for proper multi-threaded operation.\n  * Configure script fix to ensure that -lfpx is not supplied to the C\n    compiler during subsequent tests since this fails on some systems.\n  * Fix for East and West gravity computations.\n  * System error reports (errno) associated with an exception are now\n    correctly obtained from the context existing when the exception was\n    thrown rather than the context of the reporting function.\n  * JNG encoder fix. Files were being written with incorrect\n    alpha_sample_value in the header. These can be repaired by reading\n    them into GM 1.1 and rewriting them.\n  * XPM fix to module registration.\n  * PSD fix for index calculation when QuantumDepth>8.\n  * Validate that geometry specifications only include allowed\n    characters.\n  * SGI fix to save compression type while writing.\n  * EXIF attributes were not being retrieved when requested.\n  * Fix for bug when reading an image via a user-provided file\n    descriptor.\n  * The reported image magick string is now always that of the original\n    input file (it was sometimes being reported as the format produced by\n    an intermediate delegate program).\n  * Fixes to color profiling of CMYK images.\n  * Memory leak fixed in DrawClipPath().\n  * Arc drawing is fixed.\n  * Command-line parsing bug under Linux due to Linux's sscanfs\n    inability to parse strings like \"0x1\" as \"%fx%f\" is fixed.\n  * Scaling of 5 and 6-bit colors was slightly incorrect in BMP, AVI,\n    DIB, and TIM datastreams.\n  * GM utility now reports an error rather than silently returning if\n    an unsupported sub-command is provided.\n  * TIFF coder was writing 16-bit per sample RGB images incorrectly on\n    little-endian CPUs.\n\nPerformance improvements:\n\n  * Texture tiling is now 7X faster.\n  * Color profile processing speed improvements for colormapped images.\n\nUtilities enhancements:\n\n  * For Unix, 'gm version' now includes a dump of the configure and\n    build parameters.\n  * Logging of thrown exceptions is now supported. Use '-debug\n    exception'. This is useful to learn when and where errors are\n    reported.\n  * The -define option is added in order to support supplying\n    additional options to coders without needing to add additional\n    command line options or structure members.\n  * The output of 'gm identify -verbose' now provides a nice dump\n    of EXIF data.\n  * The -sampling-factor option now accepts as many HxV pairs as\n    there are JPEG components.  Omitted ones default to 1x1.\n  * The convert and montage commands now support an -operator command to\n    perform arithmetic and bitwise operations on specified image channels.\n\nCoder additions/improvements\n\n  * The META coder supports wide characters for the IPTC and 8BIM\n    formats.\n  * The XTRN coder now supports wide characters.\n  * An \"IMAGE\" coder is provided which provides access to a large\n    number of images (derived from XFig) suitable for use as patterns,\n    or as test images.\n  * The \"PATTERN\" coder now returns an image pattern tiled to size\n    (equivalent results to TILE:IMAGE:pattern). This is for ImageMagick\n    compatibility.\n  * The CINEON coder now supports reading and writing images in CINEON\n    \"CIN\" linear gray and RGB formats. The read support is still very\n    weak, but it works for common images.\n  * The JPEG coder now estimates the original JPEG quality and sampling\n    factors and will reuse these options when writing JPEG if the image\n    is of the same type and the option \"-define JPEG:preserve-settings\"\n    is supplied.\n  * The JPEG-2000 coder now supports all Jasper library arguments using\n    command line syntax similar to '-define jp2:rate=0.5'.\n  * Reading and writting compressed SVG (SVGZ) is now supported.\n  * The TXT coder now observes depth when writing.\n  * The TIFF coder now outputs colormapped images with 1, 2, 4, and 8\n    bits per sample in order to provide much smaller file sizes for\n    images with very few colors.\n  * Many TIFF coder enhancements. Now reads colormapped and grayscale\n    images at arbitrary (even odd) bits-per-sample sizes. Now properly\n    supports an opacity channel (at any bits-per-sample value) for\n    grayscale images. Bilevel grayscale images are treated similar to any\n    other grayscale image unless CCITT FAX3/FAX4 compression is\n    requested. Now allows the user to specify an arbitrary\n    bits-per-sample value for grayscale images (even odd values) using\n    \"-define tiff:bits-per-sample=value\". Now automatically stores the\n    image as TrueColor RGB pixels if the image compression is set to JPEG.\n    TIFF files are now written in using the TIFF library's default endian\n    order rather than always big endian.\n  * The WPG coder now renders embedded WMFs.\n  * The PS3 coder is completely re-written to work much better and\n    support more features (see ChangeLog).\n\nCode structure enhancements:\n\n  * Error handling has been improved and validated through testing.\n    Some errors were being lost, unnecessarily ignored, or reported as\n    something else entirely.\n  * The number of error text messages to be maintained has been reduced\n    by consolidating similar messages.\n  * The memory allocator functions have been replaced with similar\n    macros in order to eliminate warnings with GCC 3.3, avoid\n    accidentally casting away const, and allow memory debuggers to\n    report memory allocations and frees against the correct functions.\n    The previously-used functions remain in the library for the purpose\n    of compatibility.\n  * <magick/xwindow.h> no longer depends on magick_config.h defines.\n  * The text string localization code has been replaced with a simpler\n    version written by Bill Radcliffe.\n  * Added key,value \"map\" APIs (somewhat similar to C++'s <map>) for\n    internal use.\n\nAPI enhancements:\n\n  * Incorporated John Cristy's Wand API's in a new GraphicsMagickWand\n    library.\n  * API definition is no longer dependent on types which vary in size\n    (e.g. size_t) depending on large file compilation options.  This means\n    that applications may now be compiled without any special large file\n    options and still work properly with the library.\n  * Thrown exceptions (ExceptionInfo structure) now include source\n    file, source line, function name, and current system error number.\n  * The GetMagickInfoArray() function is added to replace use of\n    GetMagickInfo() for code which needs to access the coder list. This\n    is necessary since invoking GetMagickInfo() may re-order the coder\n    list, causing problems for code which traverses the list. Using\n    GetMagickInfo() to access individual list elements is safe.\n  * Added the CopyException function to support copying exception info\n    from one structure to another.\n  * Added the ReplaceImageInList function to replace an image in an\n    image list.\n  * Added the DrawPeekGraphicContext function to access the current\n    DrawInfo structure in the drawing context stack. Use of this\n    function is not recommended since it voilates proper programming\n    practices. It is added to support the Wand API's.\n  * GetImageDepth() now returns an integral value between 1 and\n    QuantumDepth and is no longer limited to the values 8, 16, and 32.\n  * SetImageDepth() supports setting the image modulus depth to any\n    integral value between 1 and QuantumDepth. This effects the effective\n    numeric precision, not the storage depth, since the quantum storage\n    type is still a Quantum.\n  * GetImageChannelDepth() supports retrieving the modulus depth for a\n    specified channel.\n  * SetImageChannelDepth() supports setting the modulus depth for a\n    specified channel.\n  * ProfileImage is updated to handle alpha channels and grayscale\n    images.\n  * Added GetImageProfile() to retrieve a CMS profile from an image.\n  * Added SetImageProfile() to attach a CMS profile to an image without\n    adjusting the image pixels.\n  * Added DeleteImageProfile() to remove a CMS profile from an image.\n  * ConstituteImage() and DispatchImage() now support 'T' (transparency),\n    'O' (opacity), and 'P' (pad) options.\n  * CompositeImage() now supports CopyCyanCompositeOp,\n    CopyMagentaCompositeOp, CopyYellowCompositeOp, and\n    CopyBlackCompositeOp, composition operators.\n  * GetColorHistogram() obtains a color histogram for the image.\n  * QuantumOperatorImage() and QuantumOperatorRegionImage() support\n    arithmetic and bitwise operations on specified image channels.\n  * The semaphore.h header is no longer installed or included in the\n    API headers since these functions are private interfaces.\n  * Configure using --enable-symbol-prefix or define\n    PREFIX_MAGICK_SYMBOLS to use the C preprocessor to prefix all library\n    symbols with \"Gm\". This prevents library symbol conflicts with other\n    libraries.\n\nPerlMagick fixes:\n\n  * Adjusted a number of function option names so that they match the\n    documentation.\n  * Memory leak fixed.\n  * Reading files (e.g. GIF) via a file descriptor is fixed.\n\nBuild improvements:\n\n  * The TRIO library may be used to provide a replacement for vsnprintf\n    if the C library doesn't provide it.  This improves security on old\n    systems.\n  * Configure only configures for C & C++ languages.\n  * Configure now does a better job of figuring out how to build a\n    thread-safe library across multiple operating systems.\n  * Configure incorporates a new mmap() test which tests the\n    functionality which is needed so that mmap() is not unnecessarily\n    rejected on a number of systems. This improves performance for large\n    files on those systems.\n  * Configure/build fixes for IBM's AIX operating system.\n\nWindows-specific improvements:\n\n  * The static install package now uses the \"uninstalled\"\n    configuration so that it does not depend on the Windows registry in\n    order to run. This allows files from the static install package to\n    be copied to another computer without running an installer.\n  * The executable search path is extended at run-time to include the\n    directory where the CORE DLLs reside in order to ensure that they\n    are found.\n  * Adding the -t option to VisualMagick configure enables building\n    all of the coders into one library in order to save build time and\n    simplify linkage.\n  * The XTRN coder now supports wide characters.\n  * LCMS library updated to version 1.10.\n  * GMDisplay displays a checkerboard pattern behind transparent images.\n  * Support is provided for issuing log messages to the Windows standard\n    logging system.\n  * Project files are now provided for use with Borland C++ Builder 6.0.\n  * Updated LCMS version to 1.12.\n  * Updated FreeType version to 2.1.5.\n  * Updated JBIG-KIT to version 1.5.\n  * Updated libpng to version 1.2.5.\n  * Updated libwmf to version 0.2.8.2.\n  * Updates zlib to version 1.2.1.\n  * ActivePerl 5.8.1 Build 807 now supported.\n  * GraphicsMagick now compiles using Visual Studio .NET 2003.\n\n---------------------------------------------------------------------------\n\n1.0 (Released in May, 2003)\n===========================\n\nGraphicsMagick support services:\n\n  * Master web site at \"http://www.GraphicsMagick.org/\".\n  * Mailing lists, bug tracking, and forums available via\n    \"https://sourceforge.net/projects/graphicsmagick/\".\n  * Mercurial Web via \"http://hg.code.sf.net/p/graphicsmagick/code/\".\n  * Mercurial mirror via SourceForge (find instructions at\n    \"http://www.graphicsmagick.org/Hg.html\").\n  * FTP via \"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick\".\n\nProject maintenance improvements:\n\n  * ChangeLog conforms to the GNU standard and all CVS commits include\n    useful log messages.\n  * CVS commit messages posted to graphicsmagick-commit mail list.\n  * CVS commit messages contain CVSWeb URL references.\n\nFootprint changes from ImageMagick:\n\n  * Library -lMagick renamed to -lGraphicsMagick.\n  * Library -lMagick++ renamed to -lGraphicsMagick++.\n  * Utilities consolidated into a single 'gm' utility (e.g. use 'gm\n    convert').\n  * Script Magick-config renamed to GraphicsMagick-config.\n  * Script Magick++-config renamed to GraphicsMagick++-config.\n  * Headers installed under ${PREFIX}/include/GraphicsMagick.\n  * PerlMagick namespace renamed from \"Image::Magick\" to \"Graphics::Magick\".\n  * Pkgconfig files GraphicsMagick.pc and GraphicsMagick++.pc are\n    installed in $libdir/pkgconfig to assist pkg-config users.\n  * Coder modules installed to lib/GraphicsMagick-1.0/modules-Q8/coders.\n  * Filter modules installed to lib/GraphicsMagick-1.0/modules-Q8/filters.\n\nMany performance enhancements:\n\n  * Default QuantumDepth is 8 since this is adequate for most purposes\n    and more efficient than 16.\n  * The Magick++ demo (compiled with QuantumDepth=8 and -O2) runs about\n    1.8X faster under SPARC/Solaris than the same demo with ImageMagick\n    5.5.4.\n  * Colorspace transformations are much faster.\n  * Grayscale/monochrome image handling is much faster.\n  * PseudoClass image handling is faster.\n  * Text annotations using FreeType are much faster.\n  * Image file I/O is much faster.\n  * RLE-compressed MIFF reading much faster.\n\nCode structure enhancements:\n\n  * All utility support functions moved to magick/command.c in order to\n    significantly reduce link dependencies, allowing statically-linked\n    programs to be smaller.\n  * Use of MogrifyImage() eliminated except for by utilities.\n  * Re-builds due to changes to <magick/image.h> reduced by splitting the\n    header into multiple headers.\n  * ISO C '99 typedefs (gm_int16_t, gm_uint16_t, gm_int32_t, gm_uint32_t,\n    gm_int64_t, gm_uint64_t) are available for use.\n\nFeature enhancements:\n\n  * Module loader always enabled for shared builds to allow extension.\n  * Loading of arbitrary filter modules (via -process option) supported\n    under Unix as well as Windows.\n  * SVG coder allows specifying size and initial background color.\n  * JPEG-2000 coder (JP2) updated to work with Jasper 1.7.\n  * HWB and HSL image colorspace translation support.\n  * JNG/MNG/PNG format support tracks ImageMagick version.\n  * BMP encoder can write 16-color indexed BMPs now as well as 2-color\n    BMPs (not restricted to monochrome).\n  * TIFF decoder now includes optimized support for tiled and stripped\n    TIFF.\n  * The -random-threshold option (RandomThresholdImage()) is added to\n    threshold an image to bilevel using random thresholding.\n\nMajor bug fixes:\n\n  * 100% successful test completion at all quantum depths (8/16/32).\n  * A temporary file management subsystem is added to ensure that all\n    temporary files are removed before program exit. Temporary files are\n    created and used in a secure fashion to avoid the possibility that a\n    \"trojan\" temporary file (e.g. a symbolic link, or a file containing\n    unsafe content) is created before a delegate has the chance to write\n    to it. The environment variable MAGICK_TMPDIR allows the user to\n    specify where temporary files are created without altering where\n    other programs create their temporary files. Temporary filenames are\n    created in 8+3 format to hopefully be more acceptable to ralcgm.\n  * When dithering is disabled, don't dither when converting to a\n    PseudoClass, grayscale, or monochrome image. Disabling dithering\n    may cause these translations to be much faster.\n  * PICON format works with BLOBs.\n  * No longer removes input file when pinging a FlashPIX file.\n  * Arc drawing and texture fill fixes from ImageMagick.\n  * Sample, scale and affine fixes from ImageMagick.\n  * MIFF colormaps are now scaled properly while reading.\n  * CMYK translation works for QuantumDepth=32.\n  * ConstituteImage now works properly for grayscale images.\n  * Built-in tilde expansion and filename globbing now works properly.\n  * InitializeMagick now registers signal handlers to ensure that\n    resources are released before program exit.  This helps avoid\n    temporary file leaks due to the user using \"CONTROL-C\".\n  * The installed <magick/magick_config.h> header now only contains\n    the few definitions required by the API headers.  This should\n    significantly reduce or eliminate conflicts with other package\n    headers.\n\nWindows platform enhancements:\n\n  * Configure updated for Visual C++ 7.0.\n  * OLE object (ImageMagickObject) re-written to work with Visual C++ 7.0\n  * New function, CropImageToHBITMAP(), to return a region of the image\n    as a Windows HBITMAP.\n  * Use vsnprintf to format strings under Windows (safer).\n\n---------------------------------------------------------------------------\n\nOn November 19, 2002, GraphicsMagick was created as a fork of\nImageMagick, several days before the ImageMagick 5.5.2 release.\n\nThe objectives of GraphicsMagick are to:\n\n  * Use an open development model.\n  * Encourage new developers to join the project.\n  * Avoid unnecessary source code \"churn\".\n  * Establish and preserve a stable API.\n  * Use efficient coding practices which result in fast code.\n  * Improve memory efficiency.\n  * Use a release process which assures a working product.\n  * Maintain an accurate ChangeLog.\n\n\n---------------------------------------------------------------------------\n\n.. |copy|   unicode:: U+000A9 .. COPYRIGHT SIGN\n\nCopyright |copy| GraphicsMagick Group 2002 - 2018\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2001.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2001.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2001-12-28  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Even more features and options were added to conjure</li>\n<li>Added CropBox support to PDF writer</li>\n</ul>\n</blockquote>\n<p>2001-12-26  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Conjure now supports having a list of files for the script to\nprocess being passed on the command line.</li>\n<li>More features and options were added to conjure</li>\n</ul>\n</blockquote>\n<p>2001-12-25  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Made a huge number of improvements to conjure.  It now supports\nover 15 different commands for manipulating your images.</li>\n</ul>\n</blockquote>\n<p>2001-12-24  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Started a new scripting language utility, conjure.</li>\n</ul>\n</blockquote>\n<p>2001-12-20  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Display the search path in the event a utility cannot find a\nparticular configuration file (thanks to <a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>)</li>\n</ul>\n</blockquote>\n<p>2001-12-14  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed some bugs in the new composite operators.</li>\n</ul>\n</blockquote>\n<p>2001-12-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added native BLOB support to coders/wmf.c.</li>\n</ul>\n</blockquote>\n<p>2001-12-13  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added new composite operators to support PSD/XCF\nlayer compositing:  NoCompositeOp, DarkenCompositeOp,\nLightenCompositeOp, HueCompositeOp, SaturateCompositeOp,\nValueCompositeOp, ColorizeCompositeOp, LuminizeCompositeOp,\nScreenCompositeOp, OverlayCompositeOp.</li>\n<li>Modified the PSD coder to set the appropriate composite\noperator.</li>\n<li>Modified the XCF coder to set the appropriate composite\noperator.</li>\n</ul>\n</blockquote>\n<p>2001-12-10  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Removed the flatten option from ImageInfo.</li>\n<li>Added new compose member to ImageInfo that defines which of\nthe composite operators to use when flattening an image.</li>\n</ul>\n</blockquote>\n<p>2001-12-09  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added new member to ImageInfo, flatten, used by PSD and XCF\nto determine whether to flatten an image when read.</li>\n<li>PSD and XCF now respect image_info-&gt;flatten.</li>\n<li>Fixed bug in XCF loader when loading layered image as layers.</li>\n<li>Modified the convert program to set image_info-&gt;flatten if\n-flatten is specified; we still call FlattenImages for other\nformats that don't respect image_info-&gt;flatten.</li>\n<li>Modified Magick++'s Image class to support image_info-&gt;flatten.</li>\n</ul>\n</blockquote>\n<p>2001-12-08  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Improvements to the Photoshop (PSD) coder:  1) added support\nfor Duotone images loaded as grayscale as per PSD docs;  and 2)\nadded option to composite layers when reading respects layer\nvisibility setting.</li>\n</ul>\n</blockquote>\n<p>2001-12-07  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>-dissolve wasn't working for the composite program (thanks to\nRick Manbry).</li>\n<li>DCM coder failed to read a valid DCM image file.</li>\n</ul>\n</blockquote>\n<p>2001-12-06  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Stream buffer was not being freed in ReadStream().</li>\n</ul>\n</blockquote>\n<p>2001-12-05  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Corrected bias when downsizing an image with ResizeImage().</li>\n</ul>\n</blockquote>\n<p>2001-11-25  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>AcquireImagePixels() can accept (x,y) outside the image area\n(e.g. AcquireImagePixels(image,-3,-3,7,7,exception)).</li>\n</ul>\n</blockquote>\n<p>2001-11-22  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added limited SVG gradient support.</li>\n</ul>\n</blockquote>\n<p>2001-11-21  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added API method, PingBlob().</li>\n</ul>\n</blockquote>\n<p>2001-11-14  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Moved a few pixel related defines (e.g. Downscale()) to\na corresponding method to enforce strong type checking at\ncompile time.</li>\n</ul>\n</blockquote>\n<p>2001-11-12  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Previously ImageMagick did not write 8-bit ASCII PPM/PGM files\nwhen QuantumDepth == 16.</li>\n<li>Added 'id' as an image attribute in PerlMagick (returns\nImageMagick registry ID).</li>\n</ul>\n</blockquote>\n<p>2001-11-10  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added SVG pattern support.</li>\n<li>Changed default background color to none.</li>\n</ul>\n</blockquote>\n<p>2001-11-06  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added support of reading and writing 16-bit raw PPM/PGM files.</li>\n</ul>\n</blockquote>\n<p>2001-11-05  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added -level to convert/mogrify (suggested by\n<a class=\"reference external\" href=\"mailto:mericson&#37;&#52;&#48;phillynews&#46;kom\">mericson<span>&#64;</span>phillynews<span>&#46;</span>kom</a>).</li>\n</ul>\n</blockquote>\n<p>2001-11-04  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>-shadow/-shade were not distiguished.</li>\n</ul>\n</blockquote>\n<p>2001-11-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Makefile.PL.in: Install PerlMagick using\nImageMagick's configure prefix.</li>\n</ul>\n</blockquote>\n<p>2001-11-02  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Typecast offset to unsigned long in coders/pdf.c.</li>\n</ul>\n</blockquote>\n<p>2001-11-01  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Convert's -flatten, -average, etc. failed with an assert error.</li>\n</ul>\n</blockquote>\n<p>2001-10-30  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added support for On-the-air bitmap.</li>\n</ul>\n</blockquote>\n<p>2001-09-29  Glenn  &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>When the delay setting for an image is greater than 4cs, duplicate\nframes are inserted to achieve the desired delay while creating MPEG\nfiles (contributed by Lawrence Livermore National Laboratory (LLNL)).</li>\n</ul>\n</blockquote>\n<p>2001-10-29  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick now has a registry for storing image blobs.</li>\n</ul>\n</blockquote>\n<p>2001-10-26  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added VMS patches (thanks to Jouk Jansen).</li>\n</ul>\n</blockquote>\n<p>2001-10-25 Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed parsing bug for decorate #FFFFFF.</li>\n</ul>\n</blockquote>\n<p>2001-10-22 Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added tests for mpeg2 library to configure.</li>\n</ul>\n</blockquote>\n<p>2001-10-22  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added a MPEG coder module.</li>\n<li>Added ImageType member to the image_info structure (suggested\nby Glenn)</li>\n</ul>\n</blockquote>\n<p>2001-10-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Eliminated libMagick.so dependency on libxml by not listing -lxml\nwhen doing modules link.</li>\n</ul>\n</blockquote>\n<p>2001-10-18  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Eliminated the libMagick.so dependancy on libtiff by moving\nHuffman2DEncodeImage() from magick/compress.c to coders/pdf.c,\ncoders/ps2.c and coders/ps3.c (suggested by Bob Friesenhahn).\nThis change has the side-effect of elminating dependency on libpng\nand libjpeg as well (which libtiff may depend on).</li>\n</ul>\n</blockquote>\n<p>2001-10-16  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Convert now supports -channel {Cyan,Magenta,Yellow,Black}.</li>\n</ul>\n</blockquote>\n<p>2001-10-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c updated for libwmf 0.2.  Plenty of bugs remain within.</li>\n</ul>\n</blockquote>\n<p>2001-10-11  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>QueryFontMetrics() of PerlMagick now recognizes embedded\nspecial characters (e.g. %h).</li>\n</ul>\n</blockquote>\n<p>2001-10-10  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed seg-fault for PingImage() on a JP2 image file.</li>\n</ul>\n</blockquote>\n<p>2001-10-07  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>CloneImage() now uses a referenced counted pixel cache.</li>\n</ul>\n</blockquote>\n<p>2001-10-05  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added AcquireImagePixels() method.</li>\n<li>Changed the formal parameter from Image * to const Image *\nfor a number of methods (e.g. ZoomImage()).</li>\n<li>Added ExceptionInfo parameter to DispatchImage().</li>\n</ul>\n</blockquote>\n<p>2001-10-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Find libxml headers under Debian Linux (bug ID 921).</li>\n</ul>\n</blockquote>\n<p>2001-10-02  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed assertion error on drawing stroked text.</li>\n</ul>\n</blockquote>\n<p>2001-10-01  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added blob test to the PerlMagick test suite.</li>\n</ul>\n</blockquote>\n<p>2001-09-30  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>switched strcpy to strncpy to help protect against buffer\noverflow.</li>\n<li>ltdl.c passed int reference but a long was needed; caused a\nfault on Solaris 64-bit compiles.</li>\n</ul>\n</blockquote>\n<p>2001-09-25  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Removed most lint complaints from the source.</li>\n<li>strtod() returns different results on Linux and Solaris for 0x13.</li>\n<li>Added a MATLAB encoder contributed by Jaroslav Fojtik.</li>\n</ul>\n</blockquote>\n<p>2001-09-21  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Replaced TemporaryFilename() with UniqueImageFilename().</li>\n<li>ImageMagick CORE API is now 64-bit clean.</li>\n</ul>\n</blockquote>\n<p>2001-09-20  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed svg.c to accept a viewbox with a negative offset.</li>\n</ul>\n</blockquote>\n<p>2001-09-15  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Surveying the code for 64-bit compatibility.</li>\n<li>The cloned colormap was too small (reported by Glenn).</li>\n<li>A blob was being unmapped more than once for multi-frame images.</li>\n</ul>\n</blockquote>\n<p>2001-09-12  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Text drawing now handles UTF8-encoding.</li>\n<li>Off-by-one GetImagePixels() fix in draw.c</li>\n<li>PingImage() now reports attributes for all images in an image\nsequence.</li>\n</ul>\n</blockquote>\n<p>2001-09-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h: Rename QuantumLeap define to QuantumDepth.\nQuantumDepth is set to the values 8 or 16, depending on user\nconfiguration option.</li>\n</ul>\n</blockquote>\n<p>2001-09-09  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated PerlMagick signatures to reflect new message digest\nalgorithm.</li>\n</ul>\n</blockquote>\n<p>2001-09-08  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick defaults to 16-bit quantum.  Set QuantumMagick\nfor 8-bit.</li>\n<li>Changed image-&gt;blob from BlobInfo to BlobInfo* so the Image\nstructure size is not dependent on the large-file preprocessor\ndefines.</li>\n</ul>\n</blockquote>\n<p>2001-09-07  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added -background to convert program usage text.</li>\n<li>DispatchImage() now properly handles grayscale images.</li>\n</ul>\n</blockquote>\n<p>2001-09-01  Glenn  &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The compression quality setting is now recognized when creating\nMPEG images (contributed by Lawrence Livermore National Laboratory\n(LLNL)).</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2002.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2002.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2002-12-31  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Do not quantize CMYK (bug fix).</li>\n<li>magick/render.c: Ensure that stroke is not drawn wider than\nrequested when antialiasing is disabled (bug fix).</li>\n</ul>\n</blockquote>\n<p>2002-12-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: For TransformRGBImage() and RGBTransformImage()\nround values to int when creating tables rather than using scaling\nto avoid rounding.</li>\n</ul>\n</blockquote>\n<p>2002-12-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Fixed compile problems.</li>\n<li>magick/image.c: SyncImage() performance optimizations.</li>\n<li>TransformRGBImage() cleanup/enhancements. Some rounding issues\nremain.</li>\n<li>RGBTransformImage() cleanup/enhancements. Some rounding issues\nremain.</li>\n</ul>\n</blockquote>\n<p>2002-12-24  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BUGFIX: Fixed bug, introduced on 12/18/02, in which a misplaced\n&quot;}&quot; caused an assertion failure after reading any opaque JNG\nimage.</li>\n<li>Added CloseBlob before returning a NULL JNG image.</li>\n<li>Merged png.c with IM-5.5.3-1, including a seemingly pointless\nrename of SaveImageText string to SaveImageTag.</li>\n</ul>\n</blockquote>\n<p>2002-12-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: Optimized gray x, y, z, tables creation in\nRGBTransformImage().</li>\n</ul>\n</blockquote>\n<p>2002-12-27  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcd.c: IsPCDImage() fix offset to test header magic.</li>\n<li>coders/pcd.c: Ensure that blob is closed on error.</li>\n<li>coders (all): Pass image-&gt;colorspace to TransformRGBImage()</li>\n<li>magick (animate.c, command.c, display.c, image.c, nt_feature.c)\nPass image-&gt;colorspace to TransformRGBImage().</li>\n<li>magick/nt_feature.c: Ensure that image is RGB prior to transfer\nto HBITMAP.</li>\n</ul>\n</blockquote>\n<p>2002-12-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: Re-worked TransformRGBImage() again so that it\nis now smoking fast for Q:8 and Q:16. Changed lookup tables, and\nall per-pixel transforms to use only integer arithmetic. A\npre-multiplication scheme is used which should actually improve\nthe quantization error over using double arithmetic.  It is\nactually possible to improve Q:32 performance a bit more but is it\nworth the effort?</li>\n</ul>\n</blockquote>\n<p>2002-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: Implemented logging for TransformRGBImage() and\nRGBTransformImage().</li>\n</ul>\n</blockquote>\n<p>2002-12-24  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The png codec would close the blob twice (second time raising an\nassertion) if a libpng error was encountered.</li>\n<li>Sometimes the PNG writer would receive an invalid bit depth from\nCompositeImages(); this is now ignored.</li>\n</ul>\n</blockquote>\n<p>2002-12-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: Re-wrote TransformRGBImage() so that it does not\npenalize a Q:8 build.  The function should be faster now, but no\ntimings have been made to verify that.</li>\n</ul>\n</blockquote>\n<p>2002-12-21  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Elimimated unused transparent_pixel array in png.c.</li>\n<li>Reverted to incrementing loops in bmp.c where the counter &quot;i&quot; is\nused in the loop.</li>\n</ul>\n</blockquote>\n<p>2002-12-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Update MogrifyImage() so that gm is 9X faster\nwhen transforming a color image to grayscale.</li>\n</ul>\n</blockquote>\n<p>2002-12-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated coders to use VerifyColormapIndex macro rather than slow\nConstrainColormapIndex() function.</li>\n<li>magick/constitute.c: Trial use of VerifyColormapIndex in\nPushImagePixels() IndexQuantum case.</li>\n</ul>\n</blockquote>\n<p>2002-12-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/color.c: Added VerifyColormapIndex macro to verify range\nof color index without a function call.</li>\n<li>coders/bmp.c: Updated to use VerifyColormapIndex macro.</li>\n</ul>\n</blockquote>\n<p>2002-12-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c: Sped up RLE expansion and sped up byte-size\nPseudoColor scanline conversion.  Results in 50% speed-up when\nrunning on SPARC.</li>\n</ul>\n</blockquote>\n<p>2002-12-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities: Removed legacy ImageMagick utilities which have been\nrolled up into gm.c/command.c.</li>\n</ul>\n</blockquote>\n<p>2002-12-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Fixed FormatString() format problems\nidentified by the compiler.</li>\n</ul>\n</blockquote>\n<p>2002-12-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h: Moved function prototypes for functions\nimplemented in code modules other than image.c to seperate header\nfiles with names based on the implementation files.</li>\n</ul>\n</blockquote>\n<p>2002-12-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enhance.c: Report appropriate message while leveling\nimage.</li>\n</ul>\n</blockquote>\n<p>2002-12-18  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Sync png.c and fx.c with IM-5.5.3.  &quot;gm convert -list format&quot;\nnow includes zlib version info among the PNG info.</li>\n<li>ConvolveImage() logs kernel info as a &quot;Transform&quot; debug event.</li>\n<li>ReadJNGImage() now skips decoding JPEG subimage when &quot;pinging&quot;</li>\n</ul>\n</blockquote>\n<p>2002-12-17  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>SVG element <cite>stroke-dasharray: 0</cite> no longer causes a\nsegmentation fault.</li>\n</ul>\n</blockquote>\n<p>2002-12-17  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>CoaleseceImage() properly handles a dispose method of\nBackgroundDispose.</li>\n</ul>\n</blockquote>\n<p>2002-12-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Updated to substitute for &#64;GMDelegate&#64;.</li>\n<li>magick/effect.c: Changed AdaptiveThresholdImage offset to double\nso that it works with QuantumDepth=32. Thanks to Glenn for\npointing out this problem.</li>\n<li>magick/image.c: Adapted to AdaptiveThresholdImage API change.</li>\n<li>magick/image.h: Annotated global constants and functions with\nthe name of the source file where they are implemented.  This is\nin preparation to break up image.h into multiple header files to\ndiminish unnecessary header dependencies.</li>\n<li>coders/delegates.mgk.in: Updated to use &#64;GMDelegate&#64; definition\nand <cite>gm</cite> program rather than ImageMagick utility names.</li>\n<li>PerlMagick/t/read.t: Converted gradient test (which was not\nworking at all) to compare with a reference image.</li>\n<li>PerlMagick/t/jpeg/read.t: Re-wrote to compare with reference\nimage.</li>\n<li>PerlMagick/t/jpeg/write.t: Re-wrote to compare with reference\nimage.</li>\n<li>magick/image.c, magick/command.c: Moved MogrifyImage and\nMogrifyImages from image.c to command.c in order to diminish\nunnecessary inter-object coupling. Only functions in command.c\nshould use MogrifyImage or MogrifyImages.  Some work remains to\naccomplish that.</li>\n</ul>\n</blockquote>\n<p>2002-12-16  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: Add missing break statements to fix colorspace\nhandling when image colorspace is CMYKColorspace or\nYCbCrColorspace.</li>\n<li>magick/decorate.c: Cast to double in calculation.</li>\n<li>magick/enhance.c: Tweaks to equalization map calculation to\n(hopefully) provide more consistent results.</li>\n<li>magick/resize.c: Use type double rather than long for minify\nweighting constants.</li>\n</ul>\n</blockquote>\n<p>2002-12-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/image.h: AdaptiveThresholdImage offset must be a signed\ntype.</li>\n</ul>\n</blockquote>\n<p>2002-12-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Re-wrote PerlMagick filter.t tests so that they all compare\nresults with reference images rather than compare signatures.\nThis makes the tests easier to maintain and also makes it easier\nto find errors in ImageMagick.</li>\n</ul>\n</blockquote>\n<p>2002-12-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Warnings reduction</li>\n<li>magick/list.c: Warnings reduction</li>\n</ul>\n</blockquote>\n<p>2002-12-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated PerlMagick tests for Emboss, Equalize, Gamma, Normalize,\nOilPaint, and Gradient so that they pass at Q:8 under Windows.</li>\n<li>Updated PerlMagick tests for Emboss, and reading WMF, so that\nthey pass at Q:16 under Windows.</li>\n<li>VisualMagickinstallerImageMagick-16.iss: Ported over from\nImageMagick-8.iss and verified.</li>\n</ul>\n</blockquote>\n<p>2002-12-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Major smashing of ImageMagick to GraphicsMagick in .txt files\nand .html files.</li>\n<li>ImageMagick.html: Renamed to index.html.</li>\n<li>www/ImageMagick.html: Renamed to www/GraphicsMagick.html</li>\n</ul>\n</blockquote>\n<p>2002-12-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/list.c: Added GetFirstImageInList() function.</li>\n<li>magick/list.c: Added GetLastImageInList() function.</li>\n<li>coders/pcd.c: Re-implemented image tile labeling to avoid use of\nMogrifyImages().</li>\n</ul>\n</blockquote>\n<p>2002-12-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added <cite>commit</cite> shell script to CVS for those who chose to use\nit.</li>\n</ul>\n</blockquote>\n<p>2002-12-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c: Ensure that operating system call error return\nvalues are never used in resource limit calculation.</li>\n</ul>\n</blockquote>\n<p>2002-12-12 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c: Fixed bugs in InitializeMagick, but I also\nheavily commented the code so show what it seems to be doing. It\nappears broken and needs testing on all platforms. Toward that\nend, I added Log events so that we can see what it is doing.</li>\n</ul>\n</blockquote>\n<p>2002-12-12 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/gm.c: Fixes a crashing bug in gm.c caused by an\nattempt to free a bad pointer. Added comments to the code that\nexplain why this happens so that future developers don't fall into\nthe same trap.  * win2k/IMDisplay/IMDisplay.rc Modified some of\nthe string resources that define supported file formats that were\nin error. One example was eps with had a *.eps in the string\ninstead of just .eps. This caused the document class to ASSERT\nunder the debug build.</li>\n</ul>\n</blockquote>\n<p>2002-12-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Enable the module loading code for shared/DLL builds regardless\nof whether the build is a &quot;modules&quot; build. This allows users to\nadd their own modules without requiring the use of a special\n&quot;modules&quot; build.</li>\n</ul>\n</blockquote>\n<p>2002-12-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h: Backed out arbitrary name change from\nChannelThresholdImage() to ThresholdImageChannel() that snuck in\nfrom Cristy's image.h changes.</li>\n</ul>\n</blockquote>\n<p>2002-12-11  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/psd.c: Reference cloned image Blob (not sure why needed\nbut must be important).</li>\n</ul>\n</blockquote>\n<p>2002-12-11  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enhance.c: Fixed LevelImage() to accept percent\nblack/white points (.i.e. 90%).</li>\n<li>magick/enhance.c: Added LevelImageChannel().</li>\n<li>magick/enhance.c: Improved Q:8 performance of color\ntransformations (e.g. for Gamma) which are based on a mapping\narray.</li>\n<li>coders/pcl.c: Fixed PCL coder to output proper color PCL\ninstructions.</li>\n</ul>\n</blockquote>\n<p>2002-12-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: Disabled SetImageInfo() code which uses\nGetImageMagick() to test file magic via Is* methods so that we can\nlearn if eliminating use of these tests causes any ill effects.</li>\n</ul>\n</blockquote>\n<p>2002-12-09 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Moved xtrn.c from contrib area into coders area so that it can\nbe used from within the COM object. This is windows only code that\nprovides a back door way for the COM object to have data read or\nwritten into VB arrays.</li>\n</ul>\n</blockquote>\n<p>2002-12-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/mac.c: Merged in fixes from ImageMagick version.</li>\n<li>magick/magick.mgk: Merged in fixes from ImageMagick version.</li>\n</ul>\n</blockquote>\n<p>2002-12-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: Fix ChannelImage() so that it does not destroy\nCMYK(A) channels by forcing RGB.</li>\n</ul>\n</blockquote>\n<p>2002-12-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/version.h: Changed to release 1.0.0.</li>\n<li>magick/nt_base.c: Changed &quot;ImageMagick&quot; to &quot;GraphicsMagick&quot; so\nregistry lookups work for GraphicsMagick.  Probably should be\nconfigured via a magick_config.h define.</li>\n<li>VisualMagick/installer/ImageMagick-8.iss:\nChanged for GraphicsMagick.</li>\n<li>utilities/conjure.c: Fix unterminated comment.</li>\n</ul>\n</blockquote>\n<p>2002-12-06 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: Modification of JPEG APP1 detection logic to name\nEXIF and XMP profiles as EXIF and XMP instead of APP1. THe current\nalgorithm is brute force.</li>\n<li>coders/meta.c: Modification deal with EXIF and XMP requests so\nthat you can ask for these blobs specifically if they exist.</li>\n<li>coders/pdf.c,ps.c,ps2.c,ps3.c: Cristy bug fixes to eliminate\nredundant file access checking and fix embedded JPEG support.</li>\n<li>magick/random.c: Upgraded this to match current Cristy code. The\nupgrade is to support more robust temporary filenames in another\nchange to this in utility.c however, I have not upgraded this code\nyet because I don't understand it well enough.</li>\n</ul>\n</blockquote>\n<p>2002-12-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added build support for utilities/gm.c</li>\n</ul>\n</blockquote>\n<p>2002-12-06  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Relocated animate, conjure, display, and import functions into\ncommand.c.</li>\n<li>Added utilities/gm.c; gm is a driver for all of the utility\nfunctions (animate, composite, conjure, convert, display,\nidentify, import, mongrify, and montage), which are now run with\n&quot;gm convert [convert_options]&quot;, &quot;gm identify [identify_options]&quot;,\netc.</li>\n</ul>\n</blockquote>\n<p>2002-12-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c: Remove bogus code for handling temporary file.</li>\n</ul>\n</blockquote>\n<p>2002-12-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated to Autoconf 2.57.</li>\n<li>Install libraries as -lGraphicsMagick and -lGraphicsMagick++\nunder Unix.</li>\n<li>Install headers under ${PREFIX}/include/GraphicsMagick under\nUnix.</li>\n<li>Update *-config scripts to produce correct library and include\nstatements.</li>\n<li>Update PerlMagick to use correct library and include statements.</li>\n</ul>\n</blockquote>\n<p>2002-12-04 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>contrib/win32/ATL7/ImageMagickObject/ImageMagickObject.cpp:\nFixed serious problem with not installing custom error and warning\nhandlers in the new version of the COM object.</li>\n</ul>\n</blockquote>\n<p>2002-12-04 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c: Pass exceptions on write up into the\nexception structure passed into the WriteImages function.</li>\n</ul>\n</blockquote>\n<p>2002-12-04 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: Added orphan image functionality changes that\nare purported to fix bugs in PDF and PS coders.</li>\n</ul>\n</blockquote>\n<p>2002-12-04 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/locale.c: Hard coded the locale as per Cristy fix, but\nalso added a comment and disabled useless code.</li>\n</ul>\n</blockquote>\n<p>2002-12-04 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/bin/magic.mgk: Added JNG as per the copy in magick\nsubdirectory.</li>\n</ul>\n</blockquote>\n<p>2002-12-04 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff/libtiff/tiff.h: Minor changes to make reading older\nPhotoshop TIFF files spew fewer warnings.</li>\n</ul>\n</blockquote>\n<p>2002-12-04  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Optimized ConvolveImage() by normalizing the kernel values\ninstead of normalizing the pixels.</li>\n</ul>\n</blockquote>\n<p>2002-12-01  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/formats.html: Add JNG and fix libpng links.</li>\n</ul>\n</blockquote>\n<p>2002-12-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ChangeLog: Updated this ChangeLog to use the format prescribed\nby the GNU coding standards.</li>\n</ul>\n</blockquote>\n<p>2002-12-01  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Use PNG_SETJMP_NOT_THREAD_SAFE to indicate that\nthe C library's setjmp() API is not thread safe.</li>\n<li>Fix use of image_info-&gt;blob.</li>\n</ul>\n</blockquote>\n<p>2002-11-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Set up new CVS repository for GraphicsMagick based on current\nImageMagick 5.5.2 (pre-release) sources.</li>\n</ul>\n</blockquote>\n<p>2002-11-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Flashpix library now uses C++ standard &lt;new&gt; and iostreams\nrather than legacy new and iostreams.</li>\n</ul>\n</blockquote>\n<p>2002-11-15  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The blob methods were enhanced to use GZip or BZip API methods\nto compress/uncompress images (previously the external programs\ngunzip or bunzip2 were used).</li>\n</ul>\n</blockquote>\n<p>2002-11-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Update to Autoconf 2.56</li>\n</ul>\n</blockquote>\n<p>2002-11-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Update to Autoconf 2.55</li>\n</ul>\n</blockquote>\n<p>2002-11-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Moved coder Register/Unregister method prototypes to static.h\nsince they are only needed by static.c.</li>\n<li>Removed defunct HDF and libmpeg2 support since it was confusing\nto users.</li>\n</ul>\n</blockquote>\n<p>2002-11-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c: Set white background of embedded bitmaps to\ntransparent if the image background is a texture image, not-white,\nor non-opaque.  This improves the output when the WMF is rendered\non a non-default background.</li>\n</ul>\n</blockquote>\n<p>2002-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated Windows CVS to FreeType 2.1.2.</li>\n</ul>\n</blockquote>\n<p>2002-11-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated Windows CVS to Jasper 1.600.0.</li>\n</ul>\n</blockquote>\n<p>2002-11-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Verify sanity of sysconf(_SC_PAGE_SIZE) and\nsysconf(_SC_PHYS_PAGES) before using their values.</li>\n</ul>\n</blockquote>\n<p>2002-11-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Modified IMdisplay so that larger images may be loaded\n(primarily limited by Windows bitmap size limits).</li>\n<li>Added some more file types (EPS, GIF, MIFF, SVG, &amp; WMF) to\nIMdisplay's file open list.</li>\n<li>The list management methods were given more meaningful names.</li>\n</ul>\n</blockquote>\n<p>2002-11-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Modified IMdisplay so that Magick++ Images are stored by value\nrather than via pointer.</li>\n<li>IMdisplay now uses minify(), magnify(), and zoom() methods where\nappropriate.</li>\n</ul>\n</blockquote>\n<p>2002-11-04  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Quantizing a DirectClass image with less than 256 unique colors\nis no longer lossy.</li>\n<li>Transparent TGA images had incorrect opacity values.</li>\n</ul>\n</blockquote>\n<p>2002-10-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added configure test for compiler __func__ support\n(HAS___func__).</li>\n<li>Added configure test for ftime().</li>\n</ul>\n</blockquote>\n<p>2002-10-31  Leonard Rosenthol &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>CMYK + alpha layered PSD files now correctly read!</li>\n</ul>\n</blockquote>\n<p>2002-10-30  Leonard Rosenthol &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ReadPSDImage() is now fully instrumented with logging</li>\n<li>Fixed long standing bug in ReadPSDImage, so it no longer returns\nan extra layer</li>\n</ul>\n</blockquote>\n<p>2002-10-29  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added three output formats: PNG24 (24-bit RGB PNG, opaque only),\nPNG32 32-bit (RGBA PNG, semitransparency OK), and PNG8 (8-bit\nindexed PNG, binary transparency only).</li>\n</ul>\n</blockquote>\n<p>2002-10-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/vid.c: Modified to be 10X faster for large images and to\ntake advantage of JPEG size optimizations.</li>\n</ul>\n</blockquote>\n<p>2002-10-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/xwindow.c: Optimize loading of TrueColor images with\ngamma = 1.0.</li>\n</ul>\n</blockquote>\n<p>2002-10-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c: Added logging facilities.</li>\n</ul>\n</blockquote>\n<p>2002-10-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>display.c: removed unnecessary SignatureImage() calls which\ndramatically slowed down loading images and quiting the program.</li>\n<li>xwindow.c: optimized image size reduction for the case where the\ntarget size is a small fraction of the original size. This makes\ncreation of display's panner and thumbnail images tremendously\nfaster, with no noticeable degradation of thumbnail quality.</li>\n</ul>\n</blockquote>\n<p>2002-10-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added Windows95 define to VisualMagick magick_config.h to\ndisable use of features not available under Windows '95</li>\n</ul>\n</blockquote>\n<p>2002-10-21  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added large file pixel cache support for Windows NT.</li>\n</ul>\n</blockquote>\n<p>2002-10-21  Leonard Rosenthol &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PDF coder no longer uses ASCII85 encoding with TIFF for MUCH\nsmaller files!</li>\n<li>Cleaned up a few other things in PDF coder.</li>\n</ul>\n</blockquote>\n<p>2002-10-19  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated to Automake 1.7.1.</li>\n</ul>\n</blockquote>\n<p>2002-10-18  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PingBlob() improperly set the length of BlobInfo to zero.</li>\n<li>Fixed Ping() memory leak in PerlMagick.</li>\n<li>Fixed -map problem in convert/mogrify utilities.</li>\n<li>Fixed -remote problem with display utility (returns correct\nerror status).</li>\n</ul>\n</blockquote>\n<p>2002-10-16  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>-border with a single value now produces correct results\n(e.g. -border 10).</li>\n<li>Added -lat to convert/mogrify (local adaptive thresholding).</li>\n</ul>\n</blockquote>\n<p>2002-10-15  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Set locale type LC_NUMERIC to &quot;C&quot;.</li>\n<li>Bug fix for PS2 encoder.</li>\n<li>Added PS-Adobe preamble to PS3 encoder.</li>\n</ul>\n</blockquote>\n<p>2002-10-14  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick 5.5.1 released.</li>\n</ul>\n</blockquote>\n<p>2002-10-12  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Use ImageMagick release number to allow multiple ImageMagick\nreleases to co-exist without interference on the same machine.</li>\n</ul>\n</blockquote>\n<p>2002-10-09  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Decided that DrawGet functions should return by value.</li>\n</ul>\n</blockquote>\n<p>2002-10-06  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added detailed logging to BMP, PNG, and JPEG codecs, including\nJPEG quality estimate.</li>\n</ul>\n</blockquote>\n<p>2002-10-01  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added draw.h &quot;DrawGet&quot; equivalents to most of the &quot;DrawSet&quot;\nfunctions.</li>\n<li>Added an array size argument to DrawSetDashPattern and got rid\nof the zero-termination garbage.</li>\n<li>Remove <cite>Set</cite> from the names of draw.h functions which update the\ncurrent affine transformation array (e.g. DrawSetRotate becomes\nDrawRotate).</li>\n</ul>\n</blockquote>\n<p>2002-09-29  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated to Automake 1.7.</li>\n</ul>\n</blockquote>\n<p>2002-09-29  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Under Windows, a DllMain function which automatically\ninitializes ImageMagick (when ImageMagick is built using DLLs) may\nbe added by defining ProvideDllMain in magick_config.h</li>\n</ul>\n</blockquote>\n<p>2002-09-28  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added resource consumption methods, see magick/resource.c.</li>\n</ul>\n</blockquote>\n<p>2002-09-27  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Replaced underscores in commandline options with hyphens.  For\nbackward compatibility, underscores will continue to be\nrecognized.</li>\n<li>Added -blue-primary, -green-primary, -red-primary, -white-point\noptions.</li>\n</ul>\n</blockquote>\n<p>2002-09-27  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added BMP2 and BMP3 output formats.</li>\n<li>Changed chromaticity primary.z from 1.0 to\n1.0-(primary.x+primary.y) in the PNG and PCD codecs.</li>\n</ul>\n</blockquote>\n<p>2002-09-21  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added <cite>exception</cite> parameter to the ImageMagick progress monitor\nAPI.</li>\n<li>Added enumerated types for the dispose member of the Image\nstructure.</li>\n<li>Added -version option to commandline utilities.</li>\n</ul>\n</blockquote>\n<p>2002-09-21  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The xcf decoder would sometimes create artifacts when reading\nRLE-encoded grayscale images, due to the green and blue samples\nnot being defined.</li>\n</ul>\n</blockquote>\n<p>2002-09-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Update to Autoconf 2.54.</li>\n</ul>\n</blockquote>\n<p>2002-08-08  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added logging capabilities to the CORE API.  This facility is\nuseful for debugging.  Added &quot;events&quot; parameter to the -debug\ncommandline option.</li>\n<li>AcquireImagePixels() did not always return the same pixel values\nfor virtual pixels when the cache was stored on disk (very rare).</li>\n<li>new -virtual-pixel command line option.</li>\n<li>new PerlMagick virtual-pixel image attribute.</li>\n</ul>\n</blockquote>\n<p>2002-08-07  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick 5.4.9 released.</li>\n</ul>\n</blockquote>\n<p>2002-09-06  Leonard Rosenthol &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed some bugs in the Clipboard coder</li>\n<li>Added new ImageToHBITMAP function to NTFeature.c/.h in core</li>\n<li>Added support for Quantum==32 to IMDisplay</li>\n</ul>\n</blockquote>\n<p>2002-08-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fix formatting in the *.mgk files so that they are XML conformant</li>\n</ul>\n</blockquote>\n<p>2002-08-30  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>QuantizeImage() did not always produce proper bilevel images.</li>\n</ul>\n</blockquote>\n<p>2002-08-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Apply prefix/suffix transformations to ImageMagick program names\nwhich are substituted into delegates.mgk.  This fix was requested\nby Glenn Randers-Pehrson.</li>\n</ul>\n</blockquote>\n<p>2002-08-25  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Arcs are now rendered properly.</li>\n<li>Use -authenticate to specifiy a password when viewing encrypted\nPDF's.</li>\n<li>-page was previouly being ignored.</li>\n<li>Configure files are returned as blobs now (suggested by William\nRadcliffe).</li>\n</ul>\n</blockquote>\n<p>2002-08-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added --disable-installed option to configure to support\nbuilding an ImageMagick which is not installed via hard-coded\npaths. This is intended to be used for the ad-hoc binary\ndistributions built by ImageMagick Studio.</li>\n<li>The UseInstalledImageMagick define is to be used by builds\nformally installed under a prefix, or via the Windows registry.</li>\n<li>Replaced GetMagickConfigurePath() with the three functions\nFindConfigurationFile(), FindFontFile(), and FindModuleFile().</li>\n<li>Re-implemented InitializeMagick() to try harder at finding the\nuninstalled ImageMagick without the help of MAGICK_HOME.  In the\nfuture, it can try even harder.</li>\n<li>Unix binaries packages (built with --disable-installed) should\nnow work using the same file layout as the distribution file.\nThere is no longer a need to put all files in the same directory.</li>\n</ul>\n</blockquote>\n<p>2002-08-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Under Windows, define UseInstalledImageMagick to locate\ncomponents using the registry rather than scanning the filesystem.</li>\n</ul>\n</blockquote>\n<p>2002-08-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added DrawSetTextEncoding() function to specify text encoding\n(e.g. &quot;UTF-8&quot;).</li>\n</ul>\n</blockquote>\n<p>2002-08-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Extend <cite>convert -list type</cite> output so it prints more details.</li>\n<li>Fix draw.c problem when specifying font family names that\ncontain spaces.</li>\n</ul>\n</blockquote>\n<p>2002-08-15  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Finished 32-Bit QuantumDepth support.</li>\n<li>Subimage memory leak fixed (bug report by William Radcliffe).</li>\n<li>Fixed subimage specification memory overrun.</li>\n<li>Subimage specification did not work properly under Windows.</li>\n</ul>\n</blockquote>\n<p>2002-08-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fix problem with TEXT encoder.  It was prepending the filename\nto the text.</li>\n</ul>\n</blockquote>\n<p>2002-08-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Render Postscript via Ghostscript DLL (gsdll32.dll) under\nWindows if it can be loaded.  Only ps.c currently uses this to\nverify there are no problems.</li>\n</ul>\n</blockquote>\n<p>2002-08-14  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added 16-bit raw write support to PPM.</li>\n</ul>\n</blockquote>\n<p>2002-08-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Re-implemented ReadTTFImage() using the draw.h APIs.</li>\n</ul>\n</blockquote>\n<p>2002-08-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed a libtool bug in order to allow passing -m64 to allow\nbuilding 64-bit ImageMagick using gcc 3.1 or later under SPARC\nSolaris.</li>\n</ul>\n</blockquote>\n<p>2002-08-04  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added experimental 32-bit QuantumDepth pixel support.</li>\n<li>Stream support was not thread-safe (bug report by William Radcliffe).</li>\n<li>Push/PopImagePixels() now recognizes the proper buffer length\n(previously it operated on one scanline at a time).</li>\n<li>Deprecated Down/Upscale defines.  Replaced them with\nScale*ToQuantum() and ScaleQuantumTo*() methods.</li>\n</ul>\n</blockquote>\n<p>2002-08-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Changed configure argument --disable-16bit-pixel to\n--with-quantum-depth in order to make its usage more\nstraightforward and generic.  Build ImageMagick using an eight-bit\nquantum via --with-quantum-depth=8.</li>\n<li>Magick++ library builds as a DLL under Windows now.</li>\n</ul>\n</blockquote>\n<p>2002-07-31  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Delegates/modules are restricted to hard-coded search paths (a\nsecurity feature suggested by Bob Friesenhahn).</li>\n</ul>\n</blockquote>\n<p>2002-07-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added SubstituteString to utility.c for performing substitions\non strings.</li>\n<li>Added support for performing Ghostscript-related substitutions\nwhile reading delegates.mgk and type.mgk files.</li>\n</ul>\n</blockquote>\n<p>2002-07-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added the Windows utility functions NTGhostscriptDLL(),\nNTGhostscriptEXE(), and NTGhostscriptFonts(), to find the DLL,\nexecutable, and font directory corresponding to the newest\nGhostscript install on the system.</li>\n</ul>\n</blockquote>\n<p>2002-07-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Split nt.c into ntbase.c and ntfeature.c</li>\n<li>Split nt.h into ntbase.h and ntfeature.h</li>\n<li>Invoke NTIsMagickConflict() under Cygwin to ensure that drive\nletters in file specifications are not confused with magick\nstrings.</li>\n<li>Invoke NTGetTypeList() under Cygwin to read the list of Windows\nfonts.</li>\n</ul>\n</blockquote>\n<p>2002-07-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Created Windows &quot;setup.exe&quot; style installation package for\nImageMagick.</li>\n<li>Include PerlMagick Perl extension for ActiveState ActivePerl as\ncheckmark install option in Windows installation package.</li>\n<li>Include ImageMagickObject OLE Object for WSH and Visual Basic\n(not IIS!!!) as checkmark install option in Windows installation\npackage.</li>\n<li>Windows installation package establishes file extension\nassociations for ImageMagick.</li>\n</ul>\n</blockquote>\n<p>2002-07-17  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PPM files were being written in P4 or P5 format if all pixels\nwere gray.  This is correct behavior for the PNM format but not\nfor the PPM format.</li>\n</ul>\n</blockquote>\n<p>2002-07-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Load font information from Windows rather than depending on hand\nedited type-windows.mgk file. Still not incorporated in Cygwin\nbuild.</li>\n</ul>\n</blockquote>\n<p>2002-07-04  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Typos corrected in perl.html (thanks to Ron Savage);</li>\n<li>A color profile is now correctly referred to as ICM instead of\nIPTC.</li>\n<li>Added XPM color compliance to colors.mgk.</li>\n<li>$image-&gt;Get(<cite>clip-mask</cite>) now returns the clipping image.</li>\n</ul>\n</blockquote>\n<p>2002-07-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added NTRegistryKeyLookup() to nt.c in order to look up\nImageMagick installation parameters from the Windows Registry.</li>\n<li>Updated GetMagickConfigurePath() in magick.c to use installation\npath data from the Windows Registry (if available).</li>\n<li>Updated VisualMagick/ImageMagick.iss so that Windows Registry is\nupdated by install package.</li>\n</ul>\n</blockquote>\n<p>2002-07-03  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Semaphore.c will compile now when pthreads are not present.</li>\n<li>8-Bit Quantum PCD images now read correctly.</li>\n<li>The antialias member of the ImageInfo structure was not being\ncloned.</li>\n</ul>\n</blockquote>\n<p>2002-07-01  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick 5.4.7 released.</li>\n</ul>\n</blockquote>\n<p>2002-06-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt.c (readdir): Make readdir re-entrant for each instance\nof DIR.  This should improve thread safety.</li>\n<li>ltdl/ltdl.c : Support building as DLL under Win32.</li>\n</ul>\n</blockquote>\n<p>2002-06-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Update to use Automake 1.6.2</li>\n</ul>\n</blockquote>\n<p>2002-06-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Try harder when searching for Ghostscript fonts under Linux.</li>\n</ul>\n</blockquote>\n<p>2002-06-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Identify PICT files via magic.mgk.</li>\n</ul>\n</blockquote>\n<p>2002-06-18  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added PerlMagick threading support (patch by Doug MacEachern).</li>\n</ul>\n</blockquote>\n<p>2002-06-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>CLIPBOARD and EMF modules compile under MinGW and Cygwin.</li>\n</ul>\n</blockquote>\n<p>2002-06-14  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The wbmp writer would dump core if it received a DirectClass\nimage that contained only black and white pixels, because no\ncolormap exists.</li>\n</ul>\n</blockquote>\n<p>2002-06-09  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Label color could not be set (bug report by Ron Savage).</li>\n<li>Added CatchException() method to magick/error.c.</li>\n</ul>\n</blockquote>\n<p>2002-06-06  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick, version 5.4.6-1 released.</li>\n</ul>\n</blockquote>\n<p>2002-06-05  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added -encoding option to command line utilities.</li>\n</ul>\n</blockquote>\n<dl class=\"docutils\">\n<dt>2002-06-02  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</dt>\n<dd><ul class=\"first last simple\">\n<li>ImageMagick, version 5.4.6 released.</li>\n</ul>\n</dd>\n</dl>\n<p>2002-05-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick may now be built (static build only) using the free\nMinGW development package from <a class=\"reference external\" href=\"http://www.mingw.org\">http://www.mingw.org</a>.  Leonard's\n&quot;clipboard&quot; coder is included in the build.</li>\n</ul>\n</blockquote>\n<p>2002-05-28  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added new &quot;clipboard&quot; coder for reading/writing the system's\nclipboard.  Currently this is only implemented on Windows.  For\nexample: <cite>convert logo: clipboard:</cite>, <cite>convert clipboard: foo.png</cite>.</li>\n</ul>\n</blockquote>\n<p>2002-05-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Support autotrace via delegates.mgk.  For example: <cite>convert\nautotrace:file.png file.mvg</cite>.</li>\n</ul>\n</blockquote>\n<p>2002-05-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added progress monitor support to DrawImage().</li>\n</ul>\n</blockquote>\n<p>2002-05-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added progress monitor support to wmf.c.</li>\n</ul>\n</blockquote>\n<p>2002-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added EscapeText() to utility.c to support escaping text.</li>\n</ul>\n</blockquote>\n<p>2002-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Text escaping for -draw and DrawAnnotation was not working\nproperly.  Now it does.  Backslash should act as a escape for the\nthe active quote character (', &quot;, or }) as well as backslash.  The\nbackslash should be discarded if it was used as an escape\ncharacter.  In order to reliably pass a backslash, two successive\nbackslashes are required\n(e.g. &quot;\\&quot;).</li>\n</ul>\n</blockquote>\n<p>2002-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Modified Base64Encode() of utility.c so that it returns the\nnumber of characters encoded. This avoids having to invoke\nstrlen() on possibly megabytes of data.</li>\n</ul>\n</blockquote>\n<p>2002-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed compilation error with Sun Workshop compiler (wmf.c).</li>\n</ul>\n</blockquote>\n<p>2002-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Implement polypolygon support in WMF renderer.  Requires libwmf\n0.2.4 with draw_polypolygon IPA callback.</li>\n</ul>\n</blockquote>\n<p>2002-05-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added --enable-ccmalloc configure option.</li>\n</ul>\n</blockquote>\n<p>2002-05-09  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>DCM patch provided by Shane Blackett.</li>\n</ul>\n</blockquote>\n<p>2002-05-07  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Lock mutex when destroying a SemaphoreInfo structure (patch\nprovided by William Radcliffe).</li>\n<li>Added mingw patches provided by Derry Bryson.</li>\n</ul>\n</blockquote>\n<p>2002-05-05  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick, version 5.4.5-1 released.</li>\n</ul>\n</blockquote>\n<p>2002-04-30  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Subimage specification did not work for TIFF (e.g.  convert\n<cite>image.tiff[1]</cite> image.png).</li>\n</ul>\n</blockquote>\n<p>2002-04-30  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick, version 5.4.5 released.</li>\n</ul>\n</blockquote>\n<p>2002-04-20  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added magic string detection for the FPX format (patch provided by\nMarc).</li>\n</ul>\n</blockquote>\n<p>2002-04-18  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added ExceptionInfo parameter to C API method,\nQueryColorDatabase().</li>\n</ul>\n</blockquote>\n<p>2002-04-17  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed all known bugs with the IMDisplay utility for Windows.</li>\n</ul>\n</blockquote>\n<p>2002-04-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac (libtool_build_static_libs): Added\n--enable-delegate-build option to suuport building ImageMagick\nusing delegate libraries in subdirectories of the ImageMagick\nsource directory.</li>\n</ul>\n</blockquote>\n<p>2002-04-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>WMF now supplies bitmaps as inline images rather than via a mpri\nreference.</li>\n</ul>\n</blockquote>\n<p>2002-04-15  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed DrawImage() to properly handle affine image transforms.</li>\n<li>Added AffineTransformImage() to C API.</li>\n<li>Added -transform option to convert/mogrify program.</li>\n</ul>\n</blockquote>\n<p>2002-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (MagickToMime): New method to return the MIME\nmedia type corresponding to a specified magick tag.</li>\n</ul>\n</blockquote>\n<p>2002-04-12  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed a bug in writing layer names in PSD files.</li>\n</ul>\n</blockquote>\n<p>2002-04-10  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed PingImage() memory leak (thanks to Timo Vogel).</li>\n<li>Added encoding and unicode attributes to PerlMagick (patch\nprovided by Youki Kadobayashi).</li>\n</ul>\n</blockquote>\n<p>2002-04-08  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added reference counted blobs.</li>\n<li>Added MagickFatalError() and SetFatalErrorHandler() to the C\nAPI.</li>\n<li>One color images caused memory corruption in QuantizeImage()\n(thanks to Vincent Broz).</li>\n<li>Memory leak in NormalizeImage() (thanks to Vincent Broz).</li>\n</ul>\n</blockquote>\n<p>2002-04-06  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added CCIS-601 4:2:2 YUV format read-write support.</li>\n<li>Added CCIS-601 4:2:2 MPEG-2 format write support.</li>\n<li>Fixed a bug introduced in 5.4.0 that caused files with &quot;M2V&quot;\nsuffix to be written in MPEG-1 instead of MPEG-2 format.</li>\n</ul>\n</blockquote>\n<p>2002-03-28  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageToBlob() only returned the first frame of a multi-frame\nimage.</li>\n</ul>\n</blockquote>\n<p>2002-04-05  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed inversion of colors when converting CMYk JPEG to PDF</li>\n</ul>\n</blockquote>\n<p>2002-04-01  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed TTF preview function.</li>\n</ul>\n</blockquote>\n<p>2002-03-28  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>DCM patches provided by Syam Gadde.</li>\n<li>Multi-frame MPC image files caused a fault under Windows.</li>\n<li>Copy entire comment from SVG (bug report from Bob Friesenhahn).</li>\n<li>Enlarged scanline buffer for JPEG-compressed TIFF's (bug report\nfrom Bob Friesenhahn).</li>\n</ul>\n</blockquote>\n<p>2002-03-27  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ImageMagick, version 5.4.4, released.</li>\n</ul>\n</blockquote>\n<p>2002-03-26  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added preliminary version of C API for vector drawing commands\n(draw.h &amp; draw.c).  This interface is subject to change, and has\nnot even been tested yet so it should not be used to support\nproduction code.  The previous draw.h and draw.c have been renamed\nto render.h and render.c respectively.</li>\n</ul>\n</blockquote>\n<p>2002-03-25  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed bugs related to layered CMYK PSD images.</li>\n</ul>\n</blockquote>\n<p>2002-03-13  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PSD coder now saves layer information (name, offset &amp; opacity)\nin hidden attributes.</li>\n</ul>\n</blockquote>\n<p>2002-03-13  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Enhanced MPC to read/write image sequences.</li>\n</ul>\n</blockquote>\n<p>2002-03-13  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>A number of formats (e.g. JPEG, PS) did not handle DirectClass\ngrayscale images properly.</li>\n</ul>\n</blockquote>\n<p>2002-03-12  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Changed Clone*Info() API so structure members are set directly rather\nthan by the *clone=*info method (suggested by William Radcliffe).</li>\n</ul>\n</blockquote>\n<p>2002-03-11  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added AcquireString() to allocate read-only strings.</li>\n</ul>\n</blockquote>\n<p>2002-03-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/null.c (WriteNULLImage): Support writing &quot;null:&quot; image\ntype for use when profiling or testing ImageMagick.</li>\n</ul>\n</blockquote>\n<p>2002-03-08 Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Update to Autoconf 2.53 (new release)</li>\n<li>Update to Automake 1.6 (new release)</li>\n</ul>\n</blockquote>\n<p>2002-03-07  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Bob Friesenhahn's execution profile results in a number of\nspeed-ups with a faster LocaleCompare() algorithm and\nself-adjusting lists.</li>\n<li>Recognize additional DCM metadata (suggested by Barry Branham).</li>\n<li>Fixed CopyOpacity composite operator for CMYKA images.</li>\n</ul>\n</blockquote>\n<p>2002-03-06  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Inlined AlphaComposite() and ValidateColormapIndex().</li>\n<li>Corrected compositing algorithm for the case where both source\nand destination pixels had opacity values that were neither fully\ntransparent nor fully opaque.</li>\n</ul>\n</blockquote>\n<p>2002-03-05  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Memory overrun when drawing large circles.</li>\n</ul>\n</blockquote>\n<p>2002-03-04  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Removed bug introduced into Bob's Base64Encode() method.</li>\n</ul>\n</blockquote>\n<p>2002-03-02  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added Base64Decode() and Base64Encode() to utility.c and updated\nReadInlineImage() in magick/constitute.c to use Base64Decode().</li>\n</ul>\n</blockquote>\n<p>2002-03-01  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GetTypeInfoByFamily() null pointer fault (reported by Bob\nFriesenhahn).</li>\n<li>Added module version number (patch by Glenn Randers-Pehrson).</li>\n</ul>\n</blockquote>\n<p>2002-03-01  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>image-&gt;matte was not being set when reading GRAY-ALPHA PNG\nfiles.</li>\n</ul>\n</blockquote>\n<p>2002-02-26  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Potential infinite loop in SyncBlob() (reported by Vladimir\nFaiden).</li>\n</ul>\n</blockquote>\n<p>2002-02-26  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Gravity not respected when drawing text with the convert\nprogram.</li>\n</ul>\n</blockquote>\n<p>2002-02-21  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>MPEG multi-part filenames require an embedded %d, not %lu.</li>\n<li>WriteStream() did not write to fifo (thanks to William\nRadcliffe).</li>\n</ul>\n</blockquote>\n<p>2002-02-20  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Annotation did not support SJIS properly (patch provided by\nKatsutoshi Shibuya).</li>\n</ul>\n</blockquote>\n<p>2002-02-18  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed memory overrun with -format option of the mogrify program.</li>\n<li>Labels were not positioned correctly for VID format.</li>\n</ul>\n</blockquote>\n<p>2002-02-16  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Replaced -copy/-replace options with +/-write in the convert\nprogram.</li>\n<li>Median filtering speed enhancement using skip list contributed\nby Mike Edmonds.</li>\n</ul>\n</blockquote>\n<p>2002-02-14  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Command line options now stay in effect for any image in command\nline order until a another option is encountered or if -noop is\nspecified.</li>\n</ul>\n</blockquote>\n<p>2002-02-07  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>SVG coders understands inline images.</li>\n</ul>\n</blockquote>\n<p>2002-02-06  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;, Glenn Randers-Pehrson</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Made -scene consistent across all utilities.  -snaps replaces\nprevious functionality of -scene for import program.</li>\n</ul>\n</blockquote>\n<p>2002-01-30  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Correctly draw arc when arc end/start are not integer\n(patch contributed by Giuliano Pochini).</li>\n</ul>\n</blockquote>\n<p>2002-01-28  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;, Glenn Randers-Pehrson</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Geometry strings respect -gravity (e.g. -gravity SouthWest -crop\n100x100).</li>\n<li>Postive offsets in geometry strings move within the image canvas\nwith respect to the gravity (SouthWest gravity is similar to\nPostscript page offsets).</li>\n</ul>\n</blockquote>\n<p>2002-01-24  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Use -trim to trim the edges of an image.</li>\n<li>Palm pixmap supported contributed by Christopher R. Hawks.</li>\n<li>Added -mask to the convert/mogrify programs to add clips masks\nto an image.</li>\n</ul>\n</blockquote>\n<p>2002-01-21  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed occasional small memory leak associated with exceptions.</li>\n<li>Persistent cache is no longer updated (MPC coder).</li>\n</ul>\n</blockquote>\n<p>2002-01-20  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed some bugs in the uncompressed PGM and PPM reader/writer\n(pnm.c).</li>\n</ul>\n</blockquote>\n<p>2002-01-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Removed test for libwmf/font.h.</li>\n</ul>\n</blockquote>\n<p>2002-01-13  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>More bug fixes and improvements in PSD writer.</li>\n</ul>\n</blockquote>\n<p>2002-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magic.mgk: Added entries for detecting PFA and PFB\nformats.  Is this file used for anything anymore?</li>\n<li>coders/modules.mgk: Add support for PFA fonts.</li>\n<li>coders/ttf.c (RegisterTTFImage): Add support for PFA fonts.</li>\n<li>magick/annotate.c (RenderType): Add support for PFA fonts.</li>\n</ul>\n</blockquote>\n<p>2002-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Modified type.mgk so that it may include the additional files\ntype-windows.mgk, type-solaris.mgk, and type-ghostscript.mgk\ndepending on the operating system used, and the font files\navailable.</li>\n</ul>\n</blockquote>\n<p>2002-01-11  Leonard Rosenthol  &lt;<a class=\"reference external\" href=\"mailto:leonardr&#37;&#52;&#48;lazerware&#46;com\">leonardr<span>&#64;</span>lazerware<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PSD now supports writing layered images and IPTC data</li>\n<li>Fixed some bugs in XCF</li>\n</ul>\n</blockquote>\n<p>2002-01-11  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added image list methods to the API.</li>\n</ul>\n</blockquote>\n<p>2002-01-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac : Renamed configure option --with-ttf-fontpath to\n--with-fontpath since ImageMagick loads more than TrueType fonts.</li>\n<li>ChangeLog : Renamed Changelog.txt to ChangeLog in order to\nconform to GNU and open-source standards.</li>\n</ul>\n</blockquote>\n<p>2002-01-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am : $(DESTDIR) already contains trailing <cite>/</cite>.</li>\n</ul>\n</blockquote>\n<p>2002-01-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c (wmf_magick_device_begin): Fix non-opaque fills.\nNow properly fills with texture image.</li>\n</ul>\n</blockquote>\n<p>2002-01-05  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed an out-of-bounds memset() and two other memory overruns\nwhen decoding 1-bit AVI, BMP, and DIB images.</li>\n</ul>\n</blockquote>\n<p>2002-01-04 Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fix lcms header inclusion in transform.c.</li>\n</ul>\n</blockquote>\n<p>2002-01-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c (magick_brush): Fixed bug with setting fill color.</li>\n</ul>\n</blockquote>\n<p>2002-01-03  Cristy  &lt;<a class=\"reference external\" href=\"mailto:cristy&#37;&#52;&#48;mystic&#46;es&#46;dupont&#46;com\">cristy<span>&#64;</span>mystic<span>&#46;</span>es<span>&#46;</span>dupont<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Postscript Level II is now DCS compliant.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2003.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2003.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2003-12-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c (RenderFreetype): Ensure that image storage\nclass is set to DirectClass. Text rendering was not working\nproperly on top of PseudoClass images.</li>\n<li>magick/map.c (MagickMapRemoveEntry): Logic didn't properly\nhandle removing entry in list.</li>\n<li>configure.ac: Added --enable-efence option to enable memory\ndebugging using Electric Fence.</li>\n</ul>\n</blockquote>\n<p>2003-12-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/maptest.c (main): Extended test to add an entry to the\nlist after an entry has already been removed.</li>\n<li>magick/image.c (ColorspaceTypeToString): Add support for LAB\ncolorspace.</li>\n<li>magick/map.c: Added signature members to all structures and\nadded assertions to ensure that the signature == MagickSignature\nprior to use. MagickMapAllocateObject now initializes the object\nreference count to one, and MagickMapDestroyObject decrements it\nin order to be more correct even though the object reference count\nis not actually used yet.\n(MagickMapCopyString): Preserve a null argument, and use\nAcquireString since it doesn't enlarge the string storage.\n(MagickMapCopyBlob): Preserve null blobs.</li>\n<li>configure.ac: Search for the shmctl() function.  Under current\nCygwin, this is hiding in -lcygipc.</li>\n</ul>\n</blockquote>\n<p>2003-12-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c: Fixed the composite operator list in the\nCompositeImage documentation.</li>\n<li>www/api/types.html: Corrected list of composition\noperators. Sometime prior to the creation of GraphicsMagick, the\n&quot;Replace&quot; composite operators were renamed to be &quot;Copy&quot; composite\noperators.  Thanks to David Relson for bringing this problem to\nour attention.</li>\n<li>PerlMagick/Magick.xs: Added &quot;LAB&quot; to colorspace types.</li>\n<li>magick/image.h (enum ColorSpace): Add LABColorspace enumeration.</li>\n<li>wand/magick_wand.h : Add some compatibility definitions to\ntranslate from ImageMagick enumerations to existing GraphicsMagick\nenumerations.</li>\n</ul>\n</blockquote>\n<p>2003-12-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c: Use header synonyms defined by FreeType's\nftheader.h (included via &lt;ft2build.h&gt;) to include FreeType headers.\nThis will presumably be more portable in the future.</li>\n<li>configure.ac: &lt;ft2build.h&gt; is an optional prerequisite for\n&lt;freetype/freetype.h&gt; and &lt;libwmf/ipa.h&gt; so include it when\ntesting for these headers.</li>\n<li>magick/annotate.c: Include &lt;ft2build.h&gt; if it is available.</li>\n</ul>\n</blockquote>\n<p>2003-12-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/wandtest.c: Ported from latest ImageMagick version.</li>\n<li>wand/drawing_wand.c: Adapted to be compatible with latest\nImageMagick version.</li>\n<li>wand/pixel_wand.c: Adapted to be compatible with latest\nImageMagick version.</li>\n<li>wand/magick_wand.c: Ported from latest ImageMagick version.</li>\n<li>magick/image.h (Image): Members color_profile, iptc_profile,\ngeneric_profile, and generic_profiles are now deprecated and\nprivate although they continue to work as before. Please migrate\nexisting code to use the GetImageProfile and SetImageProfile\nfunctions since these members will eventually be removed.</li>\n<li>magick/image.c (GetImageProfile): New function to retrieve an\nimage profile. Return value differs from similarly named\nImageMagick method since the ImageMagick approach assumes a\nparticular storage method.\n(SetImageProfile): New function to add (or remove) an image\nprofile. Does not execute CMS color profiles.</li>\n<li>magick/cache.c (SetImageVirtualPixelMethod): Return unsigned int to\nmake the Wand implementation happy.</li>\n<li>magick/image.c (TransformColorspace): Return unsigned int to\nmake the Wand implementation happy.\n(SetImageType): Return unsigned int to make the Wand\nimplementation happy.</li>\n<li>magick/draw.h, magick/draw.c: Substitute <cite>unsigned long</cite> in\nplace of <cite>size_t</cite> in interfaces so that the draw API is not\nsensitive to the definition of _LP64.</li>\n<li>locale/C.mgk: Added new messages required by Wand library.</li>\n<li>magick/error.c (ExceptionSeverityToTag): Add tag translations\nfor the WandWarning, WandError, &amp; WandFatalError enumerations</li>\n<li>magick/error.h (enum ExceptionType): Add WandWarning, WandError,\n&amp; WandFatalError enumerations to ExceptionType for ImageMagick\nAPI compatibility.</li>\n<li>magick/image.h (enum ChannelType): Add an <cite>AllChannels</cite>\nenumeration to the ChannelType enumeration for ImageMagick\nAPI compatibility.</li>\n</ul>\n</blockquote>\n<p>2003-12-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick, tests: Adjusted allowed error values for tests based\non new error computation arithmatic.  Some tests were left failing\nsince the operation they test provides results which are\nunreasonably inaccurate, or obviously broken.</li>\n</ul>\n</blockquote>\n<p>2003-12-17  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: Changed &quot;JPEG:preserve-settings from a key/value\npair to a simple flag.  Save and restore attributes when\n&quot;-define JPEG:preserve-settings&quot; appears on the commandline.  Use\n&quot;+define JPEG:preserve-settings&quot; to unset the flag.</li>\n</ul>\n</blockquote>\n<p>2003-12-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c: Include &lt;ft2build.h&gt; if it is available since some\nlibwmf installs don't work unless it is included before the libwmf\nAPI headers.</li>\n<li>configure.ac: Check for &lt;ft2build.h&gt;.</li>\n</ul>\n</blockquote>\n<p>2003-12-16  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: Changed stored jpeg quality attribute from\n[jpeg-quality] to JPEG-Quality.  Added attributes JPEG-Colorspace\nand JPEG-Sampling-factors.  Added code to save and restore\nthese attributes when &quot;-define JPEG:preserve-settings=yes&quot; is\npresent in the comandline.  Quality is restored if the input\nwas a JPEG and the quality was preserved.  Sampling factors\nare restored if the input was a JPEG, sampling factors were\npreserved, and the colorspace for the output file is the same\nas that of the input file.</li>\n</ul>\n</blockquote>\n<p>2003-12-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>TclMagick/source/configure.ac: Add an initial TclMagick\nconfigure-based build environment based on a template and macros\nfrom the Tcl project.  I recall that while the extension does build,\nit is possible that it is not properly registered as a module to Tcl.</li>\n</ul>\n</blockquote>\n<p>2003-12-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (IsImagesEqual): Properly compute error distance\nvectors. Math was missing the necessary sqrt call.  Also,\npre-normalize the error differences to 1.0 in order to reduce the\nstorage size required to store the summation of error values.</li>\n<li>PerlMagick/t/composite.t: Update Minus and Xor reference images.</li>\n<li>magick/composite.c (CompositeImage): Incorporated fixes from\nImageMagick for XorCompositeOp, PlusCompositeOp, and\nMinusCompositeOp.  Thanks to John Cristy for bringing the need for\nthese fixes to our attention.</li>\n<li>magick/image.h (RoundToQuantum): Added missing parenthesis.</li>\n</ul>\n</blockquote>\n<p>2003-12-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/environment.imdoc: Document MAGICK_CODER_MODULE_PATH and\nMAGICK_FILTER_MODULE_PATH.</li>\n<li>rungm.sh.in: Pass MAGICK_CODER_MODULE_PATH and\nMAGICK_FILTER_MODULE_PATH in the environment so modules build may\nbe tested without first being installed.</li>\n<li>magick/module.c (FindMagickModule): Use the\nMAGICK_CODER_MODULE_PATH environment variable to specify a search\npath for coder modules.  Use MAGICK_FILTER_MODULE_PATH to specify\na search path for filter modules.</li>\n<li>Makefile.am: Updated to Automake 1.8.\n(install-exec-perl): Fixes which achieve a successful\n<cite>make distcheck</cite> for the first time in *Magick history.</li>\n<li>configure.ac: Set scripts to executable.</li>\n</ul>\n</blockquote>\n<p>2003-12-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (uninstall-data-html): Pathnames were computed\nincorrectly so documentation directories were being left behind.</li>\n<li>configure.ac: --without-frozenpaths is now the default.  This\nhelps <cite>make distcheck</cite> work and makes the package more portable.\nPath to gm was being incorrectly frozen when --without-frozenpaths\nwas specified.</li>\n<li>magick/delegate.c (ReadConfigureFile): Validate delegate paths\nprior to substitution.</li>\n<li>rungm.sh.in (top_builddir): Use a more reliable scheme for\ncomputing location of source and build directories.</li>\n<li>magick/Makefile.am: Improve include directory computation logic.</li>\n<li>configure.ac: Don't override includedir.  Pass user-supplied LIBS\nto the linker.</li>\n</ul>\n</blockquote>\n<p>2003-12-08  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: store JPEG quality as &quot;[jpeg_quality]&quot; attribute.</li>\n</ul>\n</blockquote>\n<p>2003-12-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>rungm.sh.in: New script to support executing uninstalled\nexecutables.</li>\n<li>magick/blob.c (GetConfigureBlob): New MAGICK_CONFIGURE_PATH\nenvironment variable allows the user to specify the search path\nfor configuration (.mgk) files.</li>\n</ul>\n</blockquote>\n<p>2003-12-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>index.html: Added a table showing current stable release and\ndevelopment version.</li>\n</ul>\n</blockquote>\n<p>2003-12-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc (use): Describe the syntax of the -process\nargument.</li>\n<li>acinclude.m4 (AC_CHECK_CC_OPT): Add quoting in AC_CHECK_CC_OPT\ndefinition.  Change suggested by Patrick Welche</li>\n</ul>\n</blockquote>\n<p>2003-12-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (GetMagickInfo): Fix preprocessing logic error\nwhich caused moby shared library build to not register static\nmodules.</li>\n</ul>\n</blockquote>\n<p>2003-12-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/module.c (ExecuteModuleProcess): Add some logging.</li>\n<li>magick/static.c (ExecuteStaticModuleProcess): Add some logging.</li>\n</ul>\n</blockquote>\n<p>2003-11-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer: Add optional build support for LZW.</li>\n<li>wand/Makefile.am: Add AUTOMAKE_OPTIONS.</li>\n<li>configure.ac: Update to Autoconf 2.59.</li>\n</ul>\n</blockquote>\n<p>2003-11-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/inc/tasks-install-perlmagick.isx: Update\nto reflect that the next release will use ActivePerl 5.8.1 Build\n807.</li>\n<li>VisualMagick/installer/inc/files-configs.isx: Updated the source\nlocations for the .mgk files.  Install modules.mgk into the config\ndirectory rather than the modules directory.</li>\n<li>configure.ac: Fixes to work with latest CVS libtool.</li>\n<li>libtool.m4: Update to latest CVS libtool.</li>\n<li>magick/modules.c, magick/static.c (ExecuteStaticModuleProcess):\nFix conditional compilation logic so that &quot;moby&quot; shared library\nbuild works again.</li>\n<li>magick/compress.c, magick/mac.c: Use existing SaveImageText and\nLoadImageText global constants rather than separate defines.</li>\n</ul>\n</blockquote>\n<p>2003-11-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Update to Autoconf 2.58.</li>\n<li>Makefile.am: Update to Automake 1.7.9.</li>\n</ul>\n</blockquote>\n<p>2003-11-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/draw.c (DrawComposite): Base64-encoded image was not\nbeing deallocated. Bad memory leak.</li>\n</ul>\n</blockquote>\n<p>2003-11-03  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagick: Updated installation procedure. Please read\nBCBMagick/readme.txt for details.</li>\n</ul>\n</blockquote>\n<p>2003-11-03  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagick: Released DLL Version. Please read BCBMagick/readme.txt\nfor details about installation and/or use.</li>\n</ul>\n</blockquote>\n<p>2003-11-03  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetPathComponent): Added x, X, and +\ncharacters to list of legal characters in subimage\nspecifications. Required by raw RGB image reader which accepts the\nsyntax &quot;image.rgb[100x100+50+50]&quot;. Thanks to John Cristy for\ncatching that one.</li>\n</ul>\n</blockquote>\n<p>2003-11-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/locale.c (GetLocaleMessageFromID): Fix ID range checking\nlogic.</li>\n</ul>\n</blockquote>\n<p>2003-10-30  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: changed to not write gray CMYK images as\ngrayscales. That would not be a valid optimization.</li>\n<li>magick/color.c (IsGrayImage, IsMonochromeImage): Changed to\nnever return true for CMYK images. Separated images get wrong\ncolors when optimized to grayscales based on what these two\nfunctions return. Gray and CMYK are two different color spaces.</li>\n<li>magick/nt_feature.c (NTIsMagickConflict): changed to accept\ncolon as part of the magick string, consistent with the way the\nfunction is used.</li>\n<li>magick/utility.c, magick/utility.h (ExpandFilenames,\nGetPathComponent): Fixed filename glob expansion. Added handling\nof filename prefix-magick and sub-image specification to\nGetPathComponent. Sub-image specification takes precedence over\nany filename patterns.</li>\n</ul>\n</blockquote>\n<p>2003-10-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/static.c (ExecuteModuleProcess): Renamed from\nExecuteStaticModuleProcess. Only compiled if SupportMagickModules\nis not defined.</li>\n<li>magick/type.c (GetTypeBlob): Eliminated function.\n(ReadTypeConfigureFile): Use GetConfigureBlob() rather than\nGetTypeBlob().</li>\n<li>magick/module.c (GetModuleBlob): Eliminate this function since\nmodules.mgk is now installed under\n${prefix}/share/GraphicsMagick-version/config so\nGetConfigureBlob() may be used.\n(lt_dlexit, etc.) Eliminate fake libltdl function wrappers used\nfor the static build.\n(DestroyMagickModules): Added a new destroy function (simply\ninvokes DestroyModuleInfo()).\n(GetModuleList): Learn where modules live by using\nFindMagickModule() to locate the LOGO module rather than by using\nthe location of modules.mgk.  This is necessary since now\nmodules.mgk may be seperate from the modules.\n(GetModuleBlob): Eliminated function.\n(InitializeMagickModules): New function to safely initialize the\nmodule loader.\n(OpenModule): Added logging messages.\n(OpenModules): Added logging messages.\n(ReadModuleConfigureFile): Use GetConfigureBlob() rather than\nGetModuleBlob().\nTotally eliminated the rat's-nest of conditional code dependent on\nSupportMagickModules.  Now all the code in module.c is dependent\non #if defined(SupportMagickModules).</li>\n<li>magick/magick.c (DestroyMagick): Invoke DestroyMagickModules().\n(GetMagickInfo): #ifdef chunks of code which exist to support the\nmodules-build rather than forcing the module loader to pretend\nthat modules are being used when they are not. Pass module loading\nexceptions back to the user rather than discarding them.\n(GetMagickInfoArray): Don't inspect the exception status since may\nshort-circuits the operation.  Use best-effort instead.\n(ListMagickInfo): Don't inspect the current exception status so\nthat all the modules which did load successfully will be\nrepresented.\n(InitializeMagick): Invoke InitializeMagickModules().</li>\n<li>magick/log.c: (GetLogBlob): Eliminated function.\nGetConfigureBlob() is safe to use now when configuring logging.\n(LogToBlob): Simplified function.  Only exists since FileToBlob()\nmay throw exceptions (which are logged, causing deadlock).\n(ReadLogConfigureFile): Use GetConfigureBlob().</li>\n<li>magick/blob.c (GetConfigureBlob): Re-written to use the\nMagickMap interface and to support the new <cite>lib</cite> and <cite>share</cite>\nconfig directories.  The directory\n${prefix}/lib/GraphicsMagick-version/config is scanned before\n${prefix}/share/GraphicsMagick-version/config.\n(FileToBlob): Simplified implementation.</li>\n<li>config/Makefile.am: New makefile to install .mgk files.</li>\n<li>magick/magick_config.h.in: Added MagickLibConfigPath and\nMagickShareConfigPath defines.</li>\n<li>configure.ac: Install configuration files (.mgk files) in\n${prefix}/lib/GraphicsMagick-version/config and\n${prefix}/share/GraphicsMagick-version/config.  Architecture\nindependent files to under &quot;share&quot; while architecture dependnet\nfiles go under &quot;lib&quot;.</li>\n<li>Makefile.am: Added <cite>config</cite> subdirectory to distribution.  All\n.mgk files are moved from <cite>coders</cite> &amp; <cite>magick</cite> into this single\ndirectory.</li>\n</ul>\n</blockquote>\n<p>2003-10-21  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h: small modifications to achieve DLL\ncompilation of library with Borland C++ Builder.</li>\n<li>coders/ps3.c (ZLIBEncode2Image): Fixed bug. Compilation\nfail when HasZLIB is undefined because parameters 5 and 6,\nare undefined.</li>\n</ul>\n</blockquote>\n<p>2003-10-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>libtool.m4: Updated libtool again to CVS latest version.\nLibtool required some fixes for building DLLs under MinGW.</li>\n<li>magick/resource.c (InitializeMagickResources): Some code is\nconditional based on HAVE_POPEN.</li>\n<li>magick/utility.c (SystemCommand): Improved conditional\ncompilation logic.</li>\n<li>magick/blob.c (OpenBlob): Code depending on popen() is\nconditionally compiled based on HAVE_POPEN.  Code depending on\npclose() is conditionally compiled based on HAVE_PCLOSE.</li>\n<li>configure.ac: Add test for _pclose(), pclose(), _popen(), and\npopen().</li>\n<li>magick/locale.c (GetLocaleMessage): Add missing MagickExport.\n(GetLocaleMessageFromID): Add missing MagickExport.</li>\n<li>VisualMagick/installer/inc/files-development.isx (Source):\nInclude all of the headers from the magick directory in the\ndevelopment package.  Including them individually is too error\nprone.</li>\n</ul>\n</blockquote>\n<p>2003-10-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/magick/magick_config.h.in: Added\nPREFIX_MAGICK_SYMBOLS as a configuration option.</li>\n<li>magick/module.c (_CoderInfo): Added register_function and\nunregister_function members to record the module's register and\nunregister function addresses.\n(OpenModule): Locate the module's register and unregister\nfunctions and save their address to the module's CoderInfo record.\n(UnloadModule): Invoke the module unregister function using the\naddress recorded by OpenModule().\n(TagToFunctionName): If PREFIX_MAGICK_SYMBOLS is defined, then add\na &quot;Gm&quot; prefix to the register and unregister function names.</li>\n<li>libtool: Updated libtool files to the latest CVS version.</li>\n<li>configure.ac: Changed define name from MAGICK_SYMBOL_PREFIX to\nPREFIX_MAGICK_SYMBOLS since support is not available for\nspecifying an arbitrary prefix.</li>\n</ul>\n</blockquote>\n<p>2003-10-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Added --enable-symbol-prefix configure option\nwhich prepends &quot;Gm&quot; to all GraphicsMagick library symbols using\nthe C pre-processor.  In the future, this may change to support\nspecifying an arbitrary prefix, depending on experience.</li>\n<li>magick/studio.h: Include magick/symbols.h.</li>\n<li>magick/api.h: Include magick/symbols.h.</li>\n<li>magick/symbols.h: New header to support optionally remapping\nlibrary symbols.  If MAGICK_SYMBOL_PREFIX is defined, then\nlibrary symbols are remapped.</li>\n</ul>\n</blockquote>\n<p>2003-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/api.h: Removed inclusion of &lt;magick/semaphore.h&gt; since it\nis an implementation header.</li>\n</ul>\n</blockquote>\n<p>2003-10-13  Lars Skyum  &lt;<a class=\"reference external\" href=\"mailto:lrs&#37;&#52;&#48;stibo&#46;dk\">lrs<span>&#64;</span>stibo<span>&#46;</span>dk</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/GraphicsMagick.html, www/animate.html, www/composite.html,\nwww/conjure.html, www/convert.html, www/display.html, www/gm.html,\nwww/identify.html, www/import.html, www/mogrify.html,\nwww/montage.html: added documentation for &quot;-define&quot; command line\noption.</li>\n<li>doc/brief_options.imdoc, doc/options.imdoc: Added documentation\nfor &quot;-define&quot; command line option.</li>\n<li>doc/gmdocselect, doc/imdocselect: Changed &quot;skipform&quot; label in\nsed scripts to just &quot;skipf&quot;. Solaris sed had problems with the\nlong(?) &quot;skipform&quot; label.</li>\n</ul>\n</blockquote>\n<p>2003-10-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/composite.imdoc, doc/options.imdoc, doc/GraphicsMagick.imdoc:\nAttempted to clarify the meaning of the compose arguments and how\ncomposition works, as well as eliminating use of hard-coded values like\n255.</li>\n<li>www/links.html: Added a link to Michael Still's article\n&quot;Graphics from the command line&quot;.</li>\n</ul>\n</blockquote>\n<p>2003-10-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/*.c: Updated module descriptions so that they accurately\ndescribe the module rather than saying &quot;Read/Write GraphicsMagick\nImage Format&quot;.</li>\n<li>coders/cineon.c: Fix source module description.  Contrary to\nopinion, ImageMagick did not invent the Cineon X image format so\ndescription is now &quot;Read/Write Cineon X Image Format.&quot;</li>\n<li>magick/magic.mgk: Added a CINEON entry for the Cineon X image\nformat.</li>\n<li>magick/static.c (RegisterStaticModules): Invoke\nRegisterCINEONImage().</li>\n<li>coders/modules.mgk: Map &quot;CIN&quot; magick to CINEON module.</li>\n</ul>\n</blockquote>\n<p>2003-10-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>locale/C.mgk: Added message for &quot;UnrecognizedCommand&quot;.</li>\n<li>magick/command.c (MagickCommand): No error was reported when a\nsubcommand failed to be matched so <cite>gm foo</cite> would silently return.\nNow an error message is properly reported.</li>\n</ul>\n</blockquote>\n<p>2003-10-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Updated to Automake 1.7.8.</li>\n<li>various: Edits to eliminate minor issues detected by SGI C compiler.</li>\n<li>coders/ps3.c (WritePS3Image): Variable <cite>value</cite> was set but never\nused so it is removed.</li>\n<li>magick/image.c (RGBTransformPacket): Removed inline request\nsince this function is too big to inline.</li>\n<li>magick/animate.c (XAnimateBackgroundImage): Fixed a GCC 3.X\n&quot;type pinning&quot; warning.</li>\n<li>magick/display.c (XDisplayBackgroundImage): Fixed a GCC 3.X\n&quot;type pinning&quot; warning.</li>\n<li>magick/render.c (GetPixelOpacity): Removed inline directive.  No\none in their right mind could ever imagine this function inlining\nsuccessfully.</li>\n<li>magick/cache.c (IsNexusInCore): Adjusted so function inlines as\nrequested.</li>\n<li>coders/tiff.c (ReadTIFFImage): Improved logging information.\n(WriteTIFFImage): Changed the way the bilevel/grayscale logic\nworks.  Now bilevel images are treated similar to any other\ngrayscale image unless CCITT FAX3 or FAX4 compression is requested\n(which selects the MINISWHITE photometric).  The default is now to\nwrite uncompressed bilevel images with MINISBLACK photometric.</li>\n<li>PerlMagick/t/composite.t: Use some reasonable error values.</li>\n<li>magick/image.c (GetImageDepth): Added special cases for\ncolormapped images and monochrome images in order to improve\nperformance.</li>\n</ul>\n</blockquote>\n<p>2003-10-09  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: added info about color scaling, sampling-factor, and\nchanged a reference to &quot;-coder-options&quot; to &quot;-define&quot;.</li>\n</ul>\n</blockquote>\n<p>2003-10-09  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/bin/modules.mgk: added EPS3 mapping to PS3 module.</li>\n<li>coders/ps3.c, coders/tiff.c, magick/command.c, magick/image.c,\nmagick/image.h, magick/utility.c: Changed -coder-options option to\n-define. Also renamed functions {Add,Remove,Access}CoderOption(s)\nto {Add,Remove,Access}Definition(s). Changed ps coder-specific\noption ps:image=imagemask to just ps:imagemask.</li>\n</ul>\n</blockquote>\n<p>2003-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/cineon.c: Imported and adapted Cineon image format coder\nwritten by Kelly Bergougnoux &lt;<a class=\"reference external\" href=\"mailto:three3&#37;&#52;&#48;users&#46;sourceforge&#46;net\">three3<span>&#64;</span>users<span>&#46;</span>sourceforge<span>&#46;</span>net</a>&gt; with\nassistance from John Cristy.</li>\n</ul>\n</blockquote>\n<p>2003-10-08  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: Extended -sampling-factor option to allow\nuser to supply full set of sampling factors.  If the full\nset is not supplied, omitted ones are 1x1 by default, similar\nto the behavior of &quot;cjpeg -sample&quot;.</li>\n<li>magick/command.c: Accept multiple pairs of sampling factors.</li>\n</ul>\n</blockquote>\n<p>2003-10-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Re-arranged logging for improved\noutput.  Cleaned up evaluation of SAMPLESPERPIXEL and\nBITSPERSAMPLE.  Provided support for the TIFF coder options\ntiff:samples-per-pixel and tiff:bits-per-sample for power users.\n(ReadTIFFImage): Colormap generation for PHOTOMETRIC_MINISBLACK\nand PHOTOMETRIC_MINISWHITE was inaccurate.  Seems to be accurate\nnow.</li>\n<li>PerlMagick/t/reference/read/input.miff: Updated due to Glenn's\nchange to scale macros.</li>\n<li>PerlMagick/t/tiff/input_gray_12bit.tiff: Replaced 12 bit image\nwith a different one which is written by GraphicsMagick.</li>\n<li>coders/ps3.c (WritePS3Image): Use AccessCoderOption().</li>\n<li>magick/image.c (AccessCoderOption): Added a function to use for\naccessing coder-specific options.</li>\n</ul>\n</blockquote>\n<p>2003-10-08  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (TraceSVGClippingPath): optimized for speed\nand precision in clipping mask generation by using lines to\nconnect Bezier curve anchor points where applicable.</li>\n</ul>\n</blockquote>\n<p>2003-10-07  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Revised ScaleColor5to8 and ScaleColor6to8 macros again, to\nfill the low bits correctly.</li>\n</ul>\n</blockquote>\n<p>2003-10-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/tiff/read.t: Added 16-color and 256 color\ncolormapped tests with a matte channel.</li>\n<li>PerlMagick/t/tiff/write.t: Added 16-color and 256 color\ncolormapped tests with a matte channel.</li>\n<li>coders/tiff.c (WriteTIFFImage): When using LZW compression,\napply the horizontal differencing predictor to RGB truecolor and\ndeep gray images since the TIFF spec says that LZW compression is\nusually improved by using horizontal differencing with continuous\ntone images.\nRe-implemented grayscale and colormapped scanline preparation to\nuse the new bit-stream interface.  This is a bit slower, but very\nflexible, and the implementation is very compact.  Writing of a\nmatte (transparency) channel is now believed to be correct for all\ndepths.</li>\n<li>magick/command.c (MogrifyImage): Only transform the colorspace\nif it has been set (i.e. is not UndefinedColorspace).</li>\n</ul>\n</blockquote>\n<p>2003-10-06  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): PNG decoder would exit too\nearly when reading image.png[0].</li>\n</ul>\n</blockquote>\n<p>2003-10-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/tiff/write.t: Added TIFF write tests for 4\nbits-per-sample TIFF images, both with and without a transparency\nchannel.</li>\n<li>magick/image.c (DescribeImage): Added -verbose support for\ndisplaying individual channel depths.</li>\n</ul>\n</blockquote>\n<p>2003-10-06  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): cleaned up parsing of subimage\nspecification (image.psd[0]). It would fail sometimes due to\nincorrect reuse of variables. It's a bit strange the code accepts\nmore range syntax-variations than can be stored in ImageInfo.</li>\n</ul>\n</blockquote>\n<p>2003-10-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (ChannelImage): The OpacityChannel, MatteChannel,\nand BlackChannel operations set the matte channel to opaque, so\nset image-&gt;matte to False for those operations.\n(RGBTransformImage): Add an assertion to prevent passing the\ncolorspace argument <cite>UndefinedColorspace</cite>.\n(TransformRGBImage): Add an assertion to prevent passing an image\nwith colorspace set to <cite>UndefinedColorspace</cite>.</li>\n</ul>\n</blockquote>\n<p>2003-10-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (LogToBlob): Since MagickSeek(file,0,SEEK_END) is\nused to obtain the Blob size, MagickSeek(file,0,SEEK_SET) must be\nused to restore the seek position.  Thanks to John Cristy for\nbringing this to our attention.</li>\n</ul>\n</blockquote>\n<p>2003-10-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/bit_stream.h: Added a bit-stream writer function.</li>\n<li>PerlMagick/t/reference/read/input_tim.miff: Reference image\nwas defective.</li>\n</ul>\n</blockquote>\n<p>2003-10-03  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c, magick/image.h: Updated AddCoderOptions to\naccept &quot;flag&quot; keys that have no values. They are placed in the\ncoder options map with an empty, zero length string value. Option\nargument syntax is now: &quot;key1[=[value1]],key2[=[value2]],...&quot;</li>\n</ul>\n</blockquote>\n<p>2003-10-03  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Updated +coder-options option to not clear the\nentire map of coder options, but accept a list of names to remove\nfrom the map. Use option argument &quot;*&quot; to clear the entire map of\ncoder options.</li>\n<li>magick/image.c, magick/image.h: Added function\nRemoveCoderOptions. Added cast of signed char to unsigned char and\nint in calls to isspace and isprint.</li>\n<li>magick/utility.c: Added cast of signed char to unsigned char and\nint in calls to isspace and isprint. Added special handling of\n+coder-options option in ExpandFilenames function.</li>\n</ul>\n</blockquote>\n<p>2003-10-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/reference/read/input_tim.miff: The TIM read results\nchanged somewhat due to Glenn's ScaleColor5to8 fix.</li>\n</ul>\n</blockquote>\n<p>2003-10-01  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Revised ScaleColor5to8 and ScaleColor6to8 macros to fill in the\nlow bytes.</li>\n<li>coders/bmp.c (ReadBMPImage): scaling of 8-8-8-8-bit images was\nalso slightly incorrect.</li>\n</ul>\n</blockquote>\n<p>2003-09-30  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): scaling of 5-5-5-bit and 5-6-5-bit\nimages was slightly incorrect.</li>\n</ul>\n</blockquote>\n<p>2003-09-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): When using the generic bit-stream\nmarshaller to read colormapped/gray images, the slight performance\nimprovement from creating a special case for matte images did not\njustify almost doubling the amount of code.  Therefore, the two\nloops are combined back into one.</li>\n</ul>\n</blockquote>\n<p>2003-09-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Fixed reading grayscale TIFFs\nthat have a transparency channel. Now uses a generic bit-stream\nmarshaller to allow reading any grayscale or colormapped TIFF with\nany bits per sample in the range of 1 to 16.</li>\n<li>magick/bit_stream.h: Added a generic implementation for\nmarshalling from a bit-stream into a quantum.  Still needs\nre-writing for best performance.</li>\n<li>PerlMagick/t/tiff/read.t: Added a test case for reading 8-bit\ngrayscale TIFF with matte.  Corrected grayscale 12-bit read\nsignatures.  Added 16 color PseudoClass read test.  Added 4-bit\ngrayscale read test.</li>\n</ul>\n</blockquote>\n<p>2003-09-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Add support for writing\nDirectClass grayscale images at 4 bits per sample, including those\nwith an opacity channel.  This allows writing smaller files\n(half the size) when the image has 16 (or less) levels of gray.\nUse &quot;gm convert inimage.tiff -depth 4 outimage.tiff&quot; to quickly\ncreate grayscale TIFF file with 16 (or less) levels of gray.</li>\n</ul>\n</blockquote>\n<p>2003-09-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: Updated NEWS file with changes since last update.</li>\n<li>index.html: Added a link to the www/AUTHORS.html file, as well\nas text stating that GraphicsMagick is originally derived from\nImageMagick 5.5.2, with a link to the ImageMagick site.</li>\n<li>Makefile.am: Add rules to generate www/AUTHORS.html.</li>\n<li>www/AUTHORS.html: New HTML file based on the AUTHORS file in the\nsource package.  GraphicsMagick has many authors.</li>\n</ul>\n</blockquote>\n<dl class=\"docutils\">\n<dt>2003-09-25  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</dt>\n<dd><ul class=\"first last simple\">\n<li>magick/image.c: Updated DescribeImage to cleanup EXIF data display\nbased on work by Cristy in ImageMagick.</li>\n</ul>\n</dd>\n</dl>\n<p>2003-09-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Add support for writing\ncolormapped TIFF images with 1, 2, &amp; 4 bits per colormap index.\nThis allows writing smaller files.</li>\n</ul>\n</blockquote>\n<p>2003-09-24  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/ps3.c: Now creates a correct %%BoundingBox for images\nwith resolution stored as pixels per centimeter. Renamed serialize\nfunctions. Added comment headers where they were\nmissing. Reformatted code to be in alignment with GraphicsMagick\nstandard formatting.</li>\n<li>magick/map.c: Fixed semaphore double locking problem in\nMagickMapCloneMap.</li>\n</ul>\n</blockquote>\n<p>2003-09-23  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagick/readme.txt : Updated compilation instructions.</li>\n<li>BCBMagick/magick/libMagick.bpr : Updated project, now include map.c.</li>\n<li>BCBMagick/lcms/Projects/BCB6/lcms.bpr : Updated project, now\ninclude cmscam02.c and cmsvirt.c.  Much thanks to Alex Dvoretsky\nfor bringing this problem to my attention.</li>\n</ul>\n</blockquote>\n<p>2003-09-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h (Image): Moved private members to bottom of\nstructure.\n(_ImageInfo): Moved private members to bottom of\nstructure.</li>\n<li>magick/Makefile.am (pkginclude_HEADERS): Don't install\nsemaphore.h.\n(noinst_HEADERS): Distribute map.h and semaphore.h.</li>\n<li>magick/image.h (ImageInfo): Change coder_options member from\ntype <cite>MagickMap</cite> to type <cite>void *</cite>.</li>\n<li>coders/png.c: include magick/semaphore.h.</li>\n<li>magick/blob.c: include magick/semaphore.h.</li>\n<li>magick/color.c: include magick/semaphore.h.</li>\n<li>magick/constitute.c: include magick/semaphore.h.</li>\n<li>magick/delegate.c: include magick/semaphore.h.</li>\n<li>magick/log.c: include magick/semaphore.h.</li>\n<li>magick/magic.c: include magick/semaphore.h.</li>\n<li>magick/magick.c: include magick/semaphore.h.</li>\n<li>magick/module.c: include magick/semaphore.h.</li>\n<li>magick/semaphore.c: include magick/semaphore.h.</li>\n<li>magick/stream.c: include magick/semaphore.h.</li>\n<li>magick/tempfile.c: include magick/semaphore.h.</li>\n<li>magick/type.c: include magick/semaphore.h.</li>\n<li>magick/blob.h (_BlobInfo): Changed <cite>Semaphore *</cite> to <cite>void *</cite>.</li>\n<li>magick/cache.h (_CacheInfo): Changed <cite>Semaphore *</cite> to <cite>void *</cite>.</li>\n<li>magick/image.h (_Image): Changed <cite>Semaphore *</cite> to <cite>void *</cite>.</li>\n<li>magick/command.c: Updated each invokation of MagickMapAddEntry()\nto add an exception argument.</li>\n<li>tests/maptest.c: Updated to pass an exception argument to\nMagickMapAddEntry.</li>\n<li>magick/image.c (AddCoderOptions): Added exception argument\nand some more error handling.</li>\n<li>magick/map.c: Added formal documentation for methods.\n(MagickMapCloneMap): Added exception argument.\n(MagickMapAddEntry): Added exception argument and status.</li>\n</ul>\n</blockquote>\n<p>2003-09-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/emf.c: Changed NotAnEMFFile to ImproperImageHeader.</li>\n<li>magick/map.h: Changed all size parmeters from type <cite>unsigned\nlong</cite> to <cite>size_t</cite>.</li>\n<li>magick/map.c (MagickMapCopyBlob): Add new function to support\ncopying a Blob in a MagickMap.\n(MagickMapDeallocateBlob): Add new function to support\ndeallocating a Blob in MagickMap.</li>\n</ul>\n</blockquote>\n<p>2003-09-23  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/ps3.c: Fixed handling the case when no -coder-options are\nprovided to the PS3 coder.</li>\n</ul>\n</blockquote>\n<p>2003-09-22  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/ps3.c: Changed %%Creator version to use\nMagickLibVersionText, increased precision in HiResBoundingBox,\nadded a coder specific option for rendering bilevel images with\nthe PS imagemask operator indstead of the image operator.</li>\n<li>magick/command.c: Added &quot;-coder-options&quot; command line argument\nto all relevant command line utilities. Option argument to\n-coder-options is a list of comma separated key-value pairs that\nare saved in a MagickMap in ImageInfo for (de-)coders to use. See\nPS3 coder for an example that checks for: -coder-options\n&quot;ps:image=imagemask&quot;</li>\n<li>magick/image.c, magick/image.h: Added function AddCoderOptions().</li>\n<li>magick/map.c, magick/map.h: removed MS-DOS line terminators.</li>\n</ul>\n</blockquote>\n<p>2003-09-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/maptest.c (main): Test/demo program for key,value map API.</li>\n<li>magick/map.c, magick/map.h: Implementation of a key,value map\nAPI for internal use.</li>\n</ul>\n</blockquote>\n<p>2003-09-19  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lcms/include/icc34.h lcms.h: Added back the icc34.h header and\nchanges to make lcms compile on Win32&quot; icc34.h lcms.h.</li>\n</ul>\n</blockquote>\n<p>2003-09-19  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/ps3.c: Fixed warnings from Solaris compiler.</li>\n</ul>\n</blockquote>\n<p>2003-09-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>locale/C.mgk: Eliminated the many &quot;NotA&quot; messages since they may\nall be considered forms of &quot;ImproperImageHeader&quot;.  It is useful to\nprovide the origin of such messages in case the wrong coder has\nbeen invoked, however, this is expensive to do via the message\ndatabase since it explodes the number of messages.  The exception\nlogging can help here.  Once the exception reports include the\nreporting entity, it will be more clear when the software\nmisbehaves.</li>\n<li>magick/error.h (ThrowReaderException2): Remove since no longer\nused.\n(ThrowReaderException): Simplified implementation so that\nThrowException is not expanded twice.</li>\n<li>magick/error.h (ThrowReaderException3): Remove since never used.</li>\n<li>coders/xtrn.c (ReadXTRNImage): Use ThrowReaderException rather\nthan ThrowReaderException2.</li>\n<li>locale/C.mgk (MissingArgument) Updated to include %s so that the\ndescription field appears earlier in the message.</li>\n<li>magick/error.c (DefaultErrorHandler): Added a hack to allow the\n<cite>reason</cite> member to include a %s so that it may specify the\nformating of the message.  Care should be taken to not over-use\nthis hack.</li>\n</ul>\n</blockquote>\n<p>2003-09-18  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/ps3.c: Major update of the PS3 coder. Now ascii85 encodes\nall binary data. Many printer spoolers don't like the binary\ndata. The coder now creates much smaller files for bilevel, gray,\nand colormapped images. Compression and image type is now\nseparated so they may be combined independently. Any alpha channel\nis separated into a separate mask so it's possible to mask\nbilevel, gray, colormapped, rgb, and CKYK images. You may also\nmask a JPEG compressed PS file for instance. Clipping masks\ncreated from a photoshop clipping path with -clip option is\nconverted to a corresponding postscript clipping path.  New\nfunctions need comment headers.</li>\n<li>magick/attribute.c: Added TracePSClippingPath for creating a\npostscript clipping path from a photoshop clipping path.</li>\n<li>magick/compress.c, magick/compress.h: Added write-hook based\ninterface to compression functions. Required for ascii encoding\ncompressed, binary data. The interface between blob write\nfunctions, compression functions, and encoding functions could\nbenefit from more of this work.</li>\n<li>magick/image.c: ClipPathImage now stores the name of the\nclipping path in the mask image filename so that it is remembered\nand may be used for creating a postscript clipping path for\npostscript output.</li>\n<li>coders/modules.mgk: Added EPS3 mapping to module PS3.</li>\n</ul>\n</blockquote>\n<p>2003-09-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Coalesced various &quot;Missing&quot; error reports into\none &quot;MissingArgument&quot; error report in order to reduce the number\nof messages to be maintained.</li>\n<li>locale/C.mgk: Removed almost all &quot;Missing&quot; messages.</li>\n<li>magick/gm_messages.mc: Added Microsoft message compiler source\nfile to CVS until which time it may be generated automatically\nduring the build.</li>\n</ul>\n</blockquote>\n<p>2003-09-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>locale/Makefile: Added ability to generate gm_messages.mc\n(for Windows message compiler) as well as adding <cite>clean</cite> and\n<cite>install</cite> targets.</li>\n<li>magick/delegate.h: Visual Studio .NET 2003 doesn't like\nthe chaining of GhostscriptVector members which share a\ncommon return type. Splitting the definitions solves this\nproblem.</li>\n</ul>\n</blockquote>\n<p>2003-09-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/deprecate.h (MagickSignedType): Compatibility definition\nto handle ImageMagick API change.\n(MagickUnsignedType): Compatibility definition to handle\nImageMagick API change. The new names are just as useless as the\nold names, but at least they are shorter.</li>\n<li>magick/command.c: Linux's sscanf has the terrible bug that it\nimproperly handles pulling out the first floating value from the\nstring &quot;0x1&quot;.  Instead of retrieving the value 0 and returning 1,\nit returns 0, probably because it rejects the string as a hex\nconstant. As a result, all options which used sscanf to validate\nthis input are now converted to use IsGeometry().</li>\n</ul>\n</blockquote>\n<p>2003-09-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ltdl/ltdl.c: Update to libltdl current as of today.</li>\n<li>ltmain.sh: Update to libtool current as of today.</li>\n<li>configure.ac: For HPUX C++ compiler, add -AA to CXXFLAGS rather\nthan CXX.</li>\n</ul>\n</blockquote>\n<p>2003-09-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Decided that the standards conformance\ndefines create more problems than they solve so they are\nremoved.\nMove the large-file tests to before the libtool configuration\nsince the libtool configuration was causing stdlib.h to be\nincluded prior to the large file defines, and this causes\nheader failure with C++ under AIX.</li>\n<li>www/api/types.html: Update description of MonitorHandler.</li>\n</ul>\n</blockquote>\n<p>2003-09-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Set CXX to PTHREAD_CXX if necessary (and warn).</li>\n<li>acinclude.m4 (ACX_PTHREAD): Add check to see if xlC_r should be\nused for AIX.</li>\n</ul>\n</blockquote>\n<p>2003-09-10  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c: Fixed handling of arc primitive (see IM-5.5.8).</li>\n</ul>\n</blockquote>\n<p>2003-09-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.h: It seems that test programs are using\nGetMagickModule so make it visible by default.</li>\n<li>configure.ac: Use GM_FUNC_MMAP_FILEIO macro to test mmap.</li>\n<li>acinclude.m4 (GM_FUNC_MMAP_FILEIO): New macro to test mmap's\ncapability to do coherent file I/O.  The AC_FUNC_MMAP macro\nwas not testing the mmap features that GraphicsMagick uses, and\nwas failing on a number of systems.</li>\n<li>magick/blob.c (BlobMapModeToString): Only include this static\nfunction if HAVE_MMAP is defined.</li>\n<li>coders/locale.c (WriteLOCALEImage): Fix FormatString argument\ntype inconsistencies.</li>\n<li>wand/magick_compat.h: Change MagickExport to WandExport.</li>\n<li>coders/jpeg.c, coders/locale.c, coders/meta.c, coders/miff.c,\ncoders/palm.c, coders/pict.c, coders/svg.c, coders/tiff.c,\ncoders/topol.c, magick/cache.c, magick/display.c, magick/image.c,\nmagick/widget.c: Removed unused values, changed storage types, or\nadded explicit casts, in order to reduce the number of &quot;REMARK&quot;s\nwhen using the SGI IRIX compiler.</li>\n<li>magick/render.c (DrawClipPath): Fix memory leak of\nclone_info-&gt;clip_path.  Problem reported by Vladimir\n&lt;<a class=\"reference external\" href=\"mailto:lvm&#37;&#52;&#48;integrum&#46;ru\">lvm<span>&#64;</span>integrum<span>&#46;</span>ru</a>&gt;.\n(DestroyDrawInfo): Remove unnecessary checks for non-null prior to\ninvoking MagickFreeMemory. MagickFreeMemory already checks for\nnon-null.</li>\n<li>magick/log.h (GetCurrentFunction): Apparently Visual C++ 6.0\ndoes not support __FUNCTION__.  Problem reported by Vladimir\n&lt;<a class=\"reference external\" href=\"mailto:lvm&#37;&#52;&#48;integrum&#46;ru\">lvm<span>&#64;</span>integrum<span>&#46;</span>ru</a>&gt;.</li>\n<li>wand/magick_compat.c: All functions in magick_compat.c must use\nWandExport rather than MagickExport. Fix recommended by Vladimir\n&lt;<a class=\"reference external\" href=\"mailto:lvm&#37;&#52;&#48;integrum&#46;ru\">lvm<span>&#64;</span>integrum<span>&#46;</span>ru</a>&gt;.</li>\n<li>magick/constitute.c (PushImagePixels): number_pixels was always\ncast to a long during use, so change to store value in a long\ninstead.\n(PopImagePixels): number_pixels was always\ncast to a long during use, so change to store value in a long\ninstead.</li>\n</ul>\n</blockquote>\n<p>2003-09-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/psd.c: Eliminated warning regarding unused initialized\nvariable.</li>\n<li>magick/log.c: Eliminate type warnings regarding enum assignment.</li>\n<li>coders/locale.c (WriteLOCALEImage): Use UndefinedException\nrather than 0 in severity_list terminating entry in order to avoid\na type conversion warning.</li>\n<li>magick/image.c (SetImageChannelDepth): Depth parameter was being\nreturned rather than status.  Oops!</li>\n<li>magick/effect.c (BlurScanline): Due to automatic casting\nconventions, computation was being done (at least with SGI\ncompiler) as type <cite>unsigned long</cite> rather than <cite>long</cite> as it should\nhave been.</li>\n<li>coders/jpeg.c, coders/meta.c, coders/miff.c, coders/msl.c,\ncoders/palm.c, coders/pcd.c, coders/psd.c, coders/svg.c,\ncoders/tiff.c, coders/xcf.c, magick/render.c, : Quench many SGI\ncompiler warnings regarding variables which are initialized but\nnever used.</li>\n<li>magick/xwindow.h: Undef gravity defines so that enumerated type\nis used instead.</li>\n</ul>\n</blockquote>\n<p>2003-09-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (LogMagickEvent): Windows system logging\nfunctionality is not currently ported to work with Cygwin so\ndisable when compiling under Cygwin.</li>\n<li>magick/log.c (Win32EventlogOutput): Remove spurious comma in enum.</li>\n<li>wand/drawing_wand.h: Remove junk comment marker that I forgot to\nremove.</li>\n<li>magick/studio.h: Provide prototypes for strlcpy and vsnprintf if\nthe system doesn't provide them in the requested compilation\nenvironment.</li>\n<li>configure.ac: Add necessary standards compilance definitions to\nmagick_config.h.\nCheck for strlcpy and vsnprintf prototypes.</li>\n<li>Makefile.am (DOCDIRS): www/api/types does not exist anymore.</li>\n</ul>\n</blockquote>\n<p>2003-09-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Move multithread tests prior to libtool\nconfiguration in case value of CC is changed.  Otherwise libtool\ngets confused and refuses to run.</li>\n<li>acinclude.m4 (ACX_PTHREAD): If using AIX CC <cite>xlc</cite> use <cite>xlc_r</cite>\nfor multithread compiler.</li>\n<li>coders/jpeg.c: Undef HAVE_STDLIB_H before including the\njpeg headers or else we get an already defined error/warning.</li>\n</ul>\n</blockquote>\n<p>2003-09-04  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagick : Updated whole directory tree to achieve correct\ncompilation with Borland C++ Buider 6.0.</li>\n</ul>\n</blockquote>\n<p>2003-09-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (ClipPathImage): Remove MS-DOS line terminations\n(actually, extra carriage returns) which somehow crept into\nClipPathImage.</li>\n<li>locale/C.mgk: Added message for &quot;PNG library is too old&quot;.</li>\n</ul>\n</blockquote>\n<p>2003-09-04  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/transform.c (ProfileImage): Bugfix: conditional\ncompilation based on LCMS being present or not now works as\nexpected. An exception is thrown if LCMS is not present and\nprofile conversion is used.</li>\n</ul>\n</blockquote>\n<p>2003-09-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c (ReadTXTImage): Fix strlen() pointer type warning.</li>\n<li>magick/image.c (TextureImage): Fixed return with no value warning.</li>\n<li>magick/color.c (GetColorInfoArray): Decided that the const\nreturn value was a bad idea.  Therefore, the return type has been\nmade non-const.</li>\n<li>magick/magick.c (GetMagickInfoArray): Decided that the const\nreturn value was a bad idea.  Therefore, the return type has been\nmade non-const.</li>\n<li>tests/constitute.c, tests/rwblob.c, tests/rwfile.c : Define\nMAGICK_IMPLEMENTATION since these test programs using some internal\nextensions.</li>\n<li>configure.ac: Test C++ compiler for __func__ support.</li>\n<li>magick/log.h: Added GetCurrentFunction() macro to handle\n__func__ support determination.  Re-wrote GetMagickModule() macro\nto use GetCurrentFunction().  Changes should allow compilation of\nMagick++ when the C compiler supports __func__ but the C++\ncompiler does not.</li>\n<li>configure.ac: Changed from using HAS___func__ define to\nHAS_C__func__ since this feature may be language sensitive.</li>\n<li>locale/C.mgk: Added missing JNGCompressionNotSupported message.</li>\n</ul>\n</blockquote>\n<p>2003-09-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (Generate8BIMAttribute): Fix sscanf argument\ntype mis-match.</li>\n<li>coders/ps3.c (ZLIBEncodeImage): Fix mis-classified\nZipLibraryIsNotAvailable error report.</li>\n<li>coders/url.c (RegisterURLImage): Only register URL format\nsupport if libxml2 is available.</li>\n<li>coders/msl.c (RegisterMSLImage): Only register MSL format\nsupport if libxml2 is available.</li>\n</ul>\n</blockquote>\n<p>2003-09-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/histogram.c (WriteHISTOGRAMImage): Remove a useless loop.</li>\n<li>coders/wpg.c: Applied patch from Fojtik Jaroslav to support\nreading WPGs which use the EXT token.</li>\n</ul>\n</blockquote>\n<p>2003-08-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/color.c (HistogramToFile): Renamed static method\n<cite>Histogram</cite> to <cite>HistogramToFile</cite> to make it more clear what this\nfunction does.\n(GetColorHistogram): Added new function to support retrieving a\ncolor histogram of the image.  A color histogram contains a count\nof how many times each color occurs in the image.</li>\n<li>magick/image.c (GetImageChannelDepth): Return an <cite>unsigned int</cite>\nrather than <cite>long</cite>.</li>\n</ul>\n</blockquote>\n<p>2003-08-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Add support for CopyCyan, CopyMagenta,\nCopyYellow, and CopyBlack, composition operators.</li>\n<li>magick/composite.c (CompositeImage): Added support for\nCopyCyanCompositeOp, CopyMagentaCompositeOp,\nCopyYellowCompositeOp, and CopyBlackCompositeOp, composition\noperators.</li>\n</ul>\n</blockquote>\n<p>2003-08-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/*: Updated to current ImageMagick Wand API (minus a few\nunimplemented functions).</li>\n<li>magick/image.c (TextureImage): Add status return because Wand API\nwants it.  Inherit is_grayscale status from texture image.</li>\n<li>magick/fx.c (SolarizeImage): Add status return because Wand API\nwants it.</li>\n<li>magick/resource.c (SetMagickResourceLimit): Add status return\nbecause Wand API wants it.</li>\n<li>magick/draw.c (DrawPeekGraphicContext): Now returns a\ncopy of the current DrawInfo context rather than returning\na pointer into the context stack. The user must destroy\nthis copy using DestroyDrawInfo() once it is no longer\nneeded.</li>\n</ul>\n</blockquote>\n<p>2003-08-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/filters/LIBRARY.txt: This file is necessary to\nincorporate analyze.c into the static build.  Without it the\nbuild fails.</li>\n</ul>\n</blockquote>\n<p>2003-08-23  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/transform.c: ProfileImage updated to handle alpha\nchannels and grayscale images. Also optimized color profiling of\ncolor mapped images and fixed a few bugs in profiling of CMYK\nimages.</li>\n<li>magic/locale_c.h: added MagickExport to prototype declaration of\nGetLocaleMessageFromID in WriteLOCALEImage again. Please update\nyour locale coder.</li>\n</ul>\n</blockquote>\n<p>2003-08-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c: Applied patch from Fojtik Jaroslav to use the\nGetMagicInfo() function to obtain the format of embedded images,\nand to provide a default WPG palette if the WPG file does not\nsupply a palette.</li>\n</ul>\n</blockquote>\n<p>2003-08-22  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magickgm_messages.bin locale_c.h transform.c: Fixed missing\nmessage problem and added support for new lcms error handler.</li>\n</ul>\n</blockquote>\n<p>2003-08-21  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c, magick/image.c, magick/command.c: Added\n&quot;clippath&quot; option for clipping named Photoshop clipping paths,\nincreased precision in clipping path knots, added comments, and\nfixed a few bugs resulting from moving TraceClippingPath function\nfrom ImageMagick to GraphicsMagick. Still need to update some of\nthe documentation.</li>\n<li>magick/locale_c.h, magick/studio.h: added MagickExport to\ndeclaration of GetLocaleMessageFromID and moved include of\nmagick/locale_c.h after declaration of MagickExport. This fixes a\nlink error in dynamic, DLL version.</li>\n<li>coders/locale.h: added MagickExport to prototype declaration of\nGetLocaleMessageFromID in WriteLOCALEImage.</li>\n</ul>\n</blockquote>\n<p>2003-08-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/subroutines.pl (testRead): Ignore useless TIFF\nwarning so that 12-bit TIFF test passes.</li>\n<li>magick/constitute.c (ReadImage): Ensure that the reported image\nmagic string is that of the user-specified input file rather than\na temporary file prepared by an external delegate program.</li>\n<li>magick/command.c (ImportImageCommand): Since\nDestroyExceptionInfo() now sets the destroyed exception signature\nto an invalid value, GetExceptionInfo(exception) must be invoked\nwhen the intention is to simply purge the exception.  This fix\nresolves an abort when executing <cite>gm import</cite>.</li>\n</ul>\n</blockquote>\n<p>2003-08-18  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magickgm_messages.bin locale_c.h transform.c: Updates that\nadd latest enhancments by Lars to color management code in\nProfileImage.</li>\n</ul>\n</blockquote>\n<p>2003-08-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c: Incorporated patch from Fojtik Jaroslav to support\nrendering embedded WMFs.</li>\n</ul>\n</blockquote>\n<p>2003-08-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageChannelDepth): New function to transform\nthe specified channel so it fits the specified modulus depth.</li>\n<li>magick/blob.c (BlobToImage): Skip calling SetImageInfo() if\nmagick is already set.</li>\n</ul>\n</blockquote>\n<p>2003-08-18  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Some fixes to get PerlMagick compiling\nagain due to new ID based error macros.</li>\n</ul>\n</blockquote>\n<p>2003-08-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/error.h (enum): Remove spurious comma.</li>\n</ul>\n</blockquote>\n<p>2003-08-17  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coderspng.c: Had to modify a few exception calls to work with\nnewest macros.</li>\n</ul>\n</blockquote>\n<p>2003-08-17  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coderslocale.c magick/error.h locale.c locale_c.h studio.h:\nThe LOCALEH header file generator now adds an MGK_ prefiix to\nall the ID defines as part of a fix to support the new error\nand exception macros cross platform.</li>\n</ul>\n</blockquote>\n<p>2003-08-16  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wandmagick_wand.c pixel_wand.c: The wand api code was totally\nleft out of the large macro conversion below as an oversight.</li>\n</ul>\n</blockquote>\n<p>2003-08-15  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>.coders art.c avi.c avs.c bmp.c caption.c clipboard.c cmyk.c\ncut.c dcm.c dib.c dps.c dpx.c emf.c ept.c fax.c fits.c fpx.c gif.c\ngradient.c gray.c hdf.c histogram.c html.c icon.c jbig.c jp2.c\njpeg.c label.c locale.c logo.c map.c mat.c matte.c meta.c miff.c\nmono.c mpc.c mpeg.c msl.c mtv.c mvg.c null.c otb.c palm.c pcd.c\npcl.c pcx.c pdb.c pdf.c pict.c pix.c png.c pnm.c preview.c ps.c\nps2.c ps3.c psd.c pwp.c rgb.c rla.c rle.c sct.c sfw.c sgi.c\nstegano.c sun.c svg.c tga.c tiff.c tile.c tim.c topol.c ttf.c txt.c\nuil.c url.c uyvy.c vicar.c vid.c viff.c wbmp.c wmf.c wpg.c x.c xbm.c\nxc.c xcf.c xpm.c xtrn.c xwd.c yuv.c .magickanimate.c annotate.c\nblob.c cache.c cache_view.c color.c color.h command.c compress.c\nconstitute.c decorate.c delegate.c display.c draw.c effect.c\nenhance.c error.c error.h fx.c gm_messages.bin image.c list.c\nlocale.c locale_c.h log.c mac.c magic.c magick.c module.c montage.c\nnt_feature.c paint.c quantize.c registry.c render.c resize.c\nsegment.c semaphore.c shear.c signature.c static.c static.h\nstream.c studio.h tempfile.h transform.c type.c utility.c widget.c\nxwindow.c : Changes to support ID based message access and checking\nall message usages. The main thing that was done was to remove all\nthe quotes around the &quot;tags&quot; used to lookup messages defined in\nthe localeC.XML file. Macros were added to error.h to allow the\ncode to be compiled for either string based access or binary ID\nbased access. Using binary ID's will cause the code to fail to\ncompile if a message does not exist in C.XML, since no ID will be\ncreated for a missing message. This change then allowed us to\neasily track down all the messages that were &quot;missing&quot; or not\nbeing accessed properly. The problems were massive and took many\ndays to resolve. I have left the code compiling in ID mode to keep\nthings in sync going forward and also because it makes message\nlookup instantaneous. An ID is just an index into and array of\nchar *'s. There is still a lot of cleanup work remaining, but this\nis a very good start.</li>\n</ul>\n</blockquote>\n<p>2003-08-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/error.c (GetLocaleExceptionMessage): Add check to avoid\nduplicating severity prefix.</li>\n<li>magick/log.c (LogMagickEvent): Incorporated fix from Bill\nRadcliffe to enable logging control flags to work properly again.</li>\n<li>NEWS: Updated news.</li>\n<li>magick/blob.c (OpenBlob): Rewind file descriptor so that first\nread is at zero offset. This fixes reading GIFs via a\nuser-provided file handle.</li>\n</ul>\n</blockquote>\n<p>2003-08-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (GetImageDepth): Extend so that the actual\nminimum depth required to represent the image is\nreturned. Previously only the values 8, 16, and 32 were\nreturned. This means that a value of one is returned for a\nmonochrome image. Also fixed a bug in that the pixels were\nincremented while the depth was incremented, resulting in the\nfirst image pixels not being properly evaluated for depth.\n(SetImageDepth): Extend to support converting the image to\narbitrary modulus depths.\n(GetImageChannelDepth): New function to obtain the modulus depth\nfor a specified image channel.</li>\n</ul>\n</blockquote>\n<p>2003-08-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/draw.c (MvgAutoWrapPrintf): StreamError reported when\nDrawError was intended.</li>\n<li>coders/logo.c (ReadLOGOImage): Report FileOpenError rather than\nBlobError if requested image does not exist.</li>\n</ul>\n</blockquote>\n<p>2003-08-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/cache.c (PersistCache): If HAVE_SYSCONF and _SC_PAGE_SIZE\nare defined, then assume that sysconf works and don't use legacy\ngetpagesize() function.</li>\n<li>magick/studio.h (_XOPEN_SOURCE): Should be defined as 600 in\norder to match _POSIX_C_SOURCE=200112L according to the Single\nUNIX Specification v3.  This is necessary for the vsnprintf\nprototype to be visible.</li>\n<li>magick/attribute.c (ReadByte): Fix compilation warnings due to\ncasting <cite>unsigned char *</cite> to <cite>char *</cite> by changing function\ndefinition to accept <cite>unsigned char *</cite> instead.</li>\n<li>magick/error.h (UndefinedException): UndefinedException should\nbe ExceptionType, not ExceptionBaseType.</li>\n<li>magick/magick.c (IsValidFilesystemPath): Eliminate warning about\nunused function when UseInstalledMagick is defined.</li>\n<li>magick/error.c (ThrowLoggedException): Fix improper parameters\npassed to LogMagickEvent() when reason is not available.</li>\n</ul>\n</blockquote>\n<p>003-08-07  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c, log.h: Added ability to log by either severity\nor by category of event. Made the defualt on windows to log all\nfatal errors, errors, and warnings to the event log. This will\ninclude anything generated by exceptions currently, but not any\nnormal &quot;informational&quot; logging.</li>\n</ul>\n</blockquote>\n<p>2003-08-07  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c, log.h: Translation of event codes to mask vals\nwas not working. Code was left out of last update. It is now in.</li>\n</ul>\n</blockquote>\n<p>2003-08-07  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/error.c: Protect against NULL string passed into the\nmessage lookup function.</li>\n</ul>\n</blockquote>\n<p>2003-08-07  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/locale.c: Switched use of IsAccessible to nonloggging\nversion to prevent recursive problems.</li>\n</ul>\n</blockquote>\n<p>2003-08-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/Makefile.am (noinst_HEADERS): Distribute locale_c.h.</li>\n<li>locale/Makefile: Output locale_c.h.</li>\n<li>utilities/gm.c (main): Fix typo in Unix InitializeMagick\ninvocation.</li>\n<li>configure.ac: Use ACX_PTHREAD pthreads test macro.</li>\n<li>magick/(semaphore.c,spinlock.h,studio.h): Change HasPTHREADS\nconditional define to HAVE_PTHREAD.</li>\n<li>magick/Makefile.am (noinst_HEADERS): Include spinlock.h in\ndistribution.</li>\n</ul>\n</blockquote>\n<p>2003-08-06  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>contribwin32ATL7ImageMagickObject/ImageMagickObject.cpp,\nImageMagickObject_.h, ImageMagickObject.def, ImageMagickObject.rc\ngm.rc: Changes to get things compiling again since all windows\nspecific logging support has been eliminated. The special build\nscript BuildImageMagickObject.cmd now compiles the message file\nfor resource based messages. The result is in gm_messages.bin.\nThe script also generates a special version of gm.exe that uses\nthe COM dll as a regular DLL and links to it. This is the long\ndesired Moby DLL build idea.</li>\n<li>magick/error.c, magick/error.h, magick/log.c, magick/log.h:\nUpgrade of logging system to take over previous special logging\ncode for windows in nt_base.c. The new logic provides logging of\nevents to the debug api and the windows event log and also\nprovides a generic text file logging method.</li>\n<li>magick/gm_messages.bin, magick/ImageMagick.rc: New compiled\nmessage file based on data in localeC.mgk. RC file modified to\ninclude this as a resource.</li>\n<li>magick/locale.c, magick/locale_c.h: locale_c.h is generated by\nthe LOCALEH format of the locale coder. The logic in locale.c uses\nthe tables in the header lookup messages. On windows, all the\nmessages are stored as resources, while on UNIX they remain in a\nstring table.</li>\n<li>locale/C.mgk: Removed duplicate messages and added some new\ndefault messages that help to create a complete set of severity\nstrings.</li>\n<li>magick/command.c, magick/magick.c: Get rid compiler warnings.</li>\n</ul>\n</blockquote>\n<p>2003-08-05  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c, magick/gm.c: Application level changes to\nimplement the client name - filename changes. The client name can\nnow be anything that the application wants and has nothing to do\nwith the saved filename of the application.</li>\n<li>magick/nt_base.c, magick/nt_base.h, magick/magick.c: Ripped out\nold nt specific debugging and logging logic. Moving to the\nstandard logging. New and major revisions to InitializeMagick to\nmake the code more maintainable, reliable, and reaable. It should\nbe functionally identical, but implements the new split client\nname and filename methododology.</li>\n<li>magick/utility.c, magick/utility.h: Added a couple of new\nroutines to support splitting the overloaded use of the client\nname and client filename.</li>\n<li>coders/xtrn.c: Minor code cleanup</li>\n</ul>\n</blockquote>\n<p>2003-08-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Copyright.txt: Added missing copyright notice which is required\ndue to copying the rlecomp manual page into ImageMagick.</li>\n<li>doc/config_files.imdoc: Started documentation for configuration\nfiles.</li>\n<li>magick/xwindow.c (XSignalHandler): Ensure that segment_info is\nnon-null before attempting to use it.  Much thanks to John Cristy\nfor bringing this problem to our attention.</li>\n</ul>\n</blockquote>\n<p>2003-08-05  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/locale.c: Added several new formats to this coder to\ngenerate windows message resource format messages and also to\ngenerates a new header file format that will support a table based\nversion of the other magick/locale.c.</li>\n<li>coders/xtrn.c: Minor code cleanup</li>\n</ul>\n</blockquote>\n<p>2003-08-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Only configure C and C++ libtool tags.</li>\n<li>PerlMagick/t/reference/composite/*.miff: Added some composition\ntest reference images.  These reference images will serve as\nplaceholders until better composition tests can be figured out.\nIt is not clear from the documentation what some of the\ncomposition operators are supposed to do.</li>\n</ul>\n</blockquote>\n<p>2003-08-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>README.txt: Add documentation regarding using TRIO.</li>\n<li>configure.ac: Test for TRIO library if vsnprintf is not\navailable.</li>\n<li>magick/studio.h: Remap vsnprintf to trio_vsnprintf if TRIO is\navailable.</li>\n<li>coders/topol.c, coders/wmf.c, magick/magick.c, magick/nt_base.c,\nmagick/resource.c: Use traditional C comment form in C source\nfiles.</li>\n</ul>\n</blockquote>\n<p>2003-07-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.h (LogEventType::AllEvents): Increase the value of\nAllEvents so that it spans the complete positive range of a signed\ninteger.</li>\n<li>magick/xwindow.c, magick/xwindow.h: Incorporate patch from John\nCristy's ImageMagick to eliminate conditional dependence of\nmagick/xwindow.h on &lt;X11/extensions/XShm.h&gt;.</li>\n<li>magick/magick_config_api.h.in: HasSharedMemory define no longer\nneeded.</li>\n</ul>\n</blockquote>\n<p>2003-07-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/programming.html: Update Rmagick URL.</li>\n<li>GraphicsMagick.spec.in : Update according to instructions from\nTroy Edwards.</li>\n</ul>\n</blockquote>\n<p>2003-07-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick.spec.in: Replaced GraphicsMagick.spec with\nGraphicsMagick.spec.in, which is configured to produce\nGraphicsMagick.spec.</li>\n<li>configure.ac: Configure GraphicsMagick.spec.</li>\n</ul>\n</blockquote>\n<p>2003-07-29  Troy Edwards  &lt;<a class=\"reference external\" href=\"mailto:vallimar&#37;&#52;&#48;sexorcisto&#46;net\">vallimar<span>&#64;</span>sexorcisto<span>&#46;</span>net</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick.spec: Updated to CVS build. Added the\nGraphicsMagickWand files to the spec.  Only try to remove the\nunneeded perl package files if we are using PerlMagick.</li>\n</ul>\n</blockquote>\n<p>2003-07-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick.spec: Added RPM spec file authored by Troy\nEdwards &lt;<a class=\"reference external\" href=\"mailto:vallimar&#37;&#52;&#48;sexorcisto&#46;net\">vallimar<span>&#64;</span>sexorcisto<span>&#46;</span>net</a>&gt;.</li>\n<li>NEWS: Add note regarding EXIF fix.</li>\n<li>magick/attribute.c (GenerateEXIFAttribute): Look for the profile\nname &quot;EXIF&quot; rather than &quot;APP1&quot;.</li>\n</ul>\n</blockquote>\n<p>2003-07-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick_config_api.h.in: XWindowInfo structure in\nxwindow.h needs HasSharedMemory define.</li>\n<li>magick/xwindow.c, magick/xwindow.h: Move inclusion of\n&lt;X11/extensions/shape.h&gt; to xwindow.c.</li>\n<li>coders/dps.c, magick/xwindow.h: Move DPS includes to\ncoders/dps.c</li>\n<li>coders/Makefile.am: Substituted values are also set as\nmake variables, so use variables rather than substitutions.</li>\n<li>magick/log.c (GetLogBlob): MAGICK_HOME needs to take\nprecedence over the client path for the uninstalled build.</li>\n<li>magick/type.c (GetTypeBlob): MAGICK_HOME needs to take\nprecedence over the client path for the uninstalled build.</li>\n<li>magick/blob.c (GetConfigureBlob): MAGICK_HOME needs to take\nprecedence over the client path for the uninstalled build.</li>\n<li>magick/module.c (FindMagickModule): MAGICK_HOME needs to take\nprecedence over the client path for the uninstalled build.</li>\n</ul>\n</blockquote>\n<p>2003-07-24  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (TraceClippingPath): Improvements to clipping\npath parsing.</li>\n</ul>\n</blockquote>\n<p>2003-07-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/cache.c: Disable the Windows open() extensions when\ncompiling using Borland C++.</li>\n<li>magick/log.c (LogMagickEvent): Unlock semaphore before\nreturning.</li>\n<li>ltdl/ltdl.h: Updated to latest CVS version.</li>\n<li>ltdl/ltdl.c: Updated to latest CVS version.</li>\n<li>Libtool: Updated to use latest CVS libtool.</li>\n</ul>\n</blockquote>\n<p>2003-07-17  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagick: Contributed initial Borland C++ Builder 6.0 build\nenvironment.</li>\n</ul>\n</blockquote>\n<p>2003-07-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/color.c (GetColorInfoArray): Added a function to access\nthe color definition list as an array.\n(GetColorList): Added access locks to ensure that list is not\nre-ordered while it is being traversed.</li>\n<li>www/Magick++/Image.html: Add some more information regarding raw\npixel access.</li>\n</ul>\n</blockquote>\n<p>2003-07-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/GraphicsMagickWand.pc.in (Cflags): Remove LFS_CPPFLAGS.</li>\n<li>wand/GraphicsMagickWand-config.in: Remove LFS_CPPFLAGS.</li>\n<li>magick/GraphicsMagick.pc.in (Cflags): Remove LFS_CPPFLAGS.</li>\n<li>magick/GraphicsMagick-config.in: Remove LFS_CPPFLAGS.</li>\n<li>configure.ac: Logic for setting LFS_CPPFLAGS was incomplete.</li>\n<li>coders/topol.c: Updated topol coder contributed by Jaroslav\nFojtik.  Topol is coming to life!</li>\n</ul>\n</blockquote>\n<p>2003-07-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.h: Add a typedef for ssize_t</li>\n<li>magick/deprecate.h: ExtendedSignedIntegralType and\nExtendedUnsignedIntegralType are now deprecated types so they are\nmoved to deprecate.h. Existing code which uses these types should\ncontinue to work.</li>\n<li>magick/blob.c (MapBlob): Change <cite>offset</cite> parameter from type\noff_t to magick_off_t so that it is not LFS dependent.</li>\n<li>magick/cache.c (GetPixelCacheArea): Return magick_off_t.\n(PersistCache): Change <cite>offset</cite> parameter to type magick_off_t.</li>\n<li>magick/cache.h (NexusInfo): Change <cite>length</cite> type from\nExtendedSignedIntegralType to magick_off_t.\n(CacheInfo): Change <cite>offset</cite> and <cite>length</cite> types from\nExtendedSignedIntegralType to magick_off_t.</li>\n<li>magick/blob.c (BlobToFile): Use ssize_t rather than\nExtendedSignedIntegralType for count.\n(TellBlob): Return magick_off_t rather than\nExtendedSignedIntegralType.</li>\n<li>configure.ac: Check for a ssize_t type.</li>\n<li>magick/blob.h (_BlobInfo): Change <cite>offset</cite> and <cite>size</cite> members\nfrom ExtendedSignedIntegralType to magick_off_t.</li>\n<li>magick/blob.c (GetBlobSize): Return magick_off_t rather than\nExtendedSignedIntegralType.\n(SeekBlob): Accept and return magick_off_t rather than\nExtendedSignedIntegralType.</li>\n</ul>\n</blockquote>\n<p>2003-07-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/monitor.c (MagickMonitor): Change <cite>quantum</cite> argument from\ntype ExtendedSignedIntegralType to magick_int64_t. Change <cite>span</cite>\nargument from ExtendedUnsignedIntegralType to magick_uint64_t.</li>\n<li>magick/xwindow.c (XMagickMonitor): Change <cite>quantum</cite> argument from\ntype ExtendedSignedIntegralType to magick_int64_t. Change <cite>span</cite>\nargument from ExtendedUnsignedIntegralType to magick_uint64_t.</li>\n<li>magick/widget.c (XMonitorWidget): Change <cite>quantum</cite> argument from\ntype ExtendedSignedIntegralType to magick_int64_t. Change <cite>span</cite>\nargument from ExtendedUnsignedIntegralType to magick_uint64_t.</li>\n<li>magick/studio.h (QuantumTick): Change typecast from\nExtendedSignedIntegralType to magick_int64_t.</li>\n<li>magick/resource.c (AcquireMagickResource): Change <cite>size</cite>\nargument type from ExtendedSignedIntegralType to magick_int64_t.\n(LiberateMagickResource): Change <cite>size</cite> argument type from\nExtendedSignedIntegralType to magick_int64_t.</li>\n<li>magick/utility.c (FormatSize): Change <cite>size</cite> argument type from\nExtendedSignedIntegralType to magick_int64_t.</li>\n<li>magick/nt_base.c: Change MagickOffset to magick_off_t.</li>\n<li>magick/studio.h (magick_off_t): Change MagickOffset to magick_off_t.</li>\n<li>coders/topol.c: Insert dummy member into palettRAS structure\nsince Visual C++ doesn`t seem to handle empty structures.</li>\n<li>wand/GraphicsMagickWand.pc.in (prefix): Pass LFS CPPFLAGS.</li>\n<li>wand/GraphicsMagickWand-config.in: Pass LFS CPPFLAGS.</li>\n<li>wand/Makefile.am: Fix include path.</li>\n<li>magick/GraphicsMagick.pc.in (prefix): Pass LFS CPPFLAGS.</li>\n<li>magick/magick_config_api.h.in: Pass LFS configuration options\nuntil the API is fixed so that it is not LFS sensitive anymore.</li>\n<li>magick/GraphicsMagick-config.in: Pass LFS CPPFLAGS.</li>\n<li>PerlMagick/Makefile.PL.in: Pass LFS CPPFLAGS.</li>\n<li>magick/Makefile.am: Install magick_types.h.</li>\n<li>magick/api.h: Include magick_types.h.</li>\n<li>magick/studio.h: Include magick_types.h rather than integral_types.h.</li>\n<li>VisualMagick/magick/magick_types.h.in: New header file (replacing\nintegral_types.h) to contain CPU and system-dependent primitive\ntypedefs.</li>\n<li>magick/magick_types.h.in: New header file (replacing\nintegral_types.h) to contain CPU and system-dependent primitive\ntypedefs.</li>\n<li>configure.ac: Use AC_SYS_LARGEFILE to test for large file\noptions. Update to determine integral typedefs for current CPU and\ncompiler options. Configure magick_types.h.</li>\n<li>magick/attribute.c (TraceClippingPath): Apply patch from Lars\nRuben Skyum which fixes clipping path parsing for paths generated\nby Adobe software which pre-dates the Photoshop file format\nspecification.</li>\n</ul>\n</blockquote>\n<p>2003-07-08  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/semaphore.c: Modified the way the system handles the\ninitialization of Win32 critical sections to use a spin lock\non WIn32 to bootstrap the initialization of all other crtical\nsections. This is not an issue on UNIX since static init is used.</li>\n<li>magick/magic.c module.c magick.c log.c resource.c constitute.c\ncolor.c cache.c delegate.c registry.c type.c: Small modifications\nwere made to eliminate the side effect of unlocking semaphores\nas part of the releasing procedure. This also eliminated the\napparent bug of the system double locking certain semaphores.\nThe locked flag should now not be needed, but remains in place\nfor the time being as an added safegaurd.</li>\n</ul>\n</blockquote>\n<p>2003-07-04  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png.c: added missing #ifdef JNG_SUPPORTED/#endif directives.</li>\n</ul>\n</blockquote>\n<p>2003-07-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: Updated news to include fixes and enhancements since the\n1.0 release.</li>\n</ul>\n</blockquote>\n<p>2003-07-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/semaphore.c (UnlockSemaphoreInfo): Bugfix, modify\nthe <cite>locked</cite> flag while still under protection of the lock.\nThis fix is necessary for thread-safety.</li>\n</ul>\n</blockquote>\n<p>2003-07-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Conditionally copy exception.</li>\n<li>wand/Makefile.am (noinst_HEADERS): Need to distribute\nmagick_compat.h.\n(EXTRA_DIST): Need to distribute GraphicsMagickWand-config.1.</li>\n<li>coders/wmf.c (ipa_bmp_draw): Use CopyException.\n(ipa_device_begin): Use CopyException.\n(lite_font_map): Use CopyException.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Use CopyException.</li>\n<li>magick/image.c (GetImageException): Use CopyException.</li>\n<li>magick/constitute.c (WriteImages): Use CopyException.</li>\n<li>Makefile.am (DIST_SUBDIRS): wand needs to be included in\ndistribution.</li>\n</ul>\n</blockquote>\n<p>2003-06-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/static.c (RegisterStaticModules): Invoke\nRegisterTOPOLImage.</li>\n<li>magick/magick.h (MagickInfo): Add member usage comments.</li>\n<li>magick/error.c (CatchException): Restore saved errno from\nexception-&gt;error_number.\n(CopyException): Copy error_number.\n(DestroyExceptionInfo): Reset error_number to zero.\n(GetExceptionInfo): Initialize error_number to zero.\n(ThrowException): Save errno to exception-&gt; error_number.\n(ThrowLoggedException): Save errno to exception-&gt; error_number.</li>\n<li>magick/error.h (ExceptionInfo): Borrow John Cristy's idea and\nadd a error_number member to ExceptionInfo to save the current\nerrno value. Otherwise CatchException may use some random errno.</li>\n<li>coders/Makefile.am: Build topol.c.</li>\n<li>coders/topol.c: Added initial TOPOL X image coder which is under\ndevelopment by Jaroslav Fojtik. Not working yet.</li>\n</ul>\n</blockquote>\n<p>2003-06-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pwp.c (ReadPWPImage): Ensure that image is initialized\nbefore invoking ThrowReaderException.</li>\n<li>magick/image.c (CloneImage): Use CopyException.</li>\n<li>magick/error.c (CopyException): Add function to support copying\nExceptionInfo structures.</li>\n<li>magick/error.h (ExceptionInfo): Replaced recently-added <cite>whence</cite>\nmember with module, function, and line members in order to keep\nthe information seperate, and match the parameters used by the\nlogging system.\n(ThrowException): Log thrown exceptions.</li>\n<li>magick/error.c (ThrowLoggedException): New function used to\nthrow an exception, while recording and logging the location\nwhere the exception is thrown.</li>\n<li>doc/options.imdoc (operation): Document TemporaryFile and\nException events.</li>\n<li>magick/log.c (LogMagickEvent): Support logging ExceptionEvent.</li>\n<li>PerlMagick/Magick.xs: Added &quot;Exception&quot; event type.</li>\n<li>magick/log.h (LogEventType): Added ExceptionEvent.</li>\n</ul>\n</blockquote>\n<p>2003-06-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/error.c (ThrowException): Handle <cite>whence</cite>\nmember. MagickFreeMemory already checks for null pointer so don't\ncheck again.\n(DestroyExceptionInfo): Handle <cite>whence</cite> member. MagickFreeMemory\nalready checks for null pointer so don't check again.</li>\n<li>magick/error.h (ExceptionInfo): Add a <cite>whence</cite> member to support\nthe ability to record where the exception is was thrown.</li>\n<li>VisualMagick/installer: Install Wand files.</li>\n</ul>\n</blockquote>\n<p>2003-06-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (GetConfigureBlob): GetConfigureBlob should always\nreturn a value.</li>\n<li>magick/type.c (GetTypeBlob): GetTypeBlob should always return a\nvalue.</li>\n<li>magick/log.c (GetLogBlob): GetLogBlob should always return\na value.</li>\n<li>magick/magick.c (GetMagickInfoArray): Fixed array memory\nallocation and clearing bug. Eliminate warnings.</li>\n</ul>\n</blockquote>\n<p>2003-06-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/inc/files-configs.isx: For a static\nbuild, install the configuration files directly into the\napplication directory.</li>\n<li>VisualMagick/installer/inc/uninstallrun-unregister-com.isx\n(Filename): Change ImageMagickObject.dll path.</li>\n<li>VisualMagick/installer/inc/run-register-com.isx (Filename):\nChange ImageMagickObject.dll path.</li>\n<li>VisualMagick/installer/inc/files-com.isx (Source): Install\nImageMagickObject.dll and MagickCMD.exe in the application\ndirectory alongside gm.exe and the CORE DLLs.</li>\n<li>INSTALL-unix.txt: Add additional information regarding LZW.</li>\n<li>VisualMagick/magick/magick_config.h.in: Add additional notes\nregarding UNISYS LZW patent.</li>\n<li>PerlMagick/Magick.xs: Applied Dissolve composite operator fix\nobtained from from John Cristy's ImageMagick which ensures that an\nunused matte channel is set to Opaque, and uses this knowledge to\nsimplify the math.</li>\n<li>VisualMagick/configure/configure.cpp: The <cite>wand</cite> library has a\nlinkage dependency on the <cite>magick</cite> library. Also don't include\nthe magick subdirectory so that headers must be included like\n&lt;magick/api.h&gt; for safety.</li>\n<li>coders/xtrn.c: Fix magick header inclusion.</li>\n<li>lcmssrccmserr.c: Fix magick header inclusion.</li>\n</ul>\n</blockquote>\n<p>2003-06-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Fix to formatting. Fix spelling of origin.</li>\n<li>PerlMagick/t/bzlib/read.t: Add test for reading BZipped file.</li>\n<li>PerlMagick/t/subroutines.pl (testRead): Skip testing reads\nof compressed BLOBs because reading compressed BLOBs is not\nsupported yet.</li>\n<li>coders/bmp.c (ReadBMPImage): Only validate the file size value\nfor compressed BMPs.</li>\n<li>VisualMagick/wand, wand: First stab at building the Wand API\nunder Visual C++.  Still does not build as a DLL.</li>\n</ul>\n</blockquote>\n<p>2003-06-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/static.h: Add prototypes for RegisterXTRNImage and\nUnregisterXTRNImage.</li>\n<li>Makefile.am (DISTDIRS): Don't distribute the <cite>guide</cite>\nsubdirectory. It is available for checkout from CVS.</li>\n<li>www: Utilities documentation is updated from &lt;imdoc&gt; masters.\nFormatting could be improved, but the content seems ok.</li>\n<li>doc/environment.imdoc: New file to describe environment\nvariables.</li>\n<li>coders/cut.c (ReadCUTImage): Use MagickAllocateMemory and\nMagickFreeMemory rather than malloc and free.</li>\n<li>doc/gmdoc2html: Add GraphicsMagick styling to utility web pages.</li>\n<li>doc/Makefile: Additional documentation Makefile enhancements.</li>\n<li>AUTHORS: New file to acknowledge significant contributors\nto the software. If an author is not listed here, please let\nus know.</li>\n<li>configure.ac: test -a is not POSIX compliant.</li>\n</ul>\n</blockquote>\n<p>2003-06-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc: Source documentation for <cite>gm</cite> is now available via a <cite>doc</cite>\nCVS module. A Makefile is provided which formats the\ndocumentation and installs it into the <cite>www</cite> and <cite>utilities</cite>\nsubdirectories.</li>\n</ul>\n</blockquote>\n<p>2003-06-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand: Added Magick Wand library available via\n-lGraphicsMagickWand and &lt;wand/wand_api.h&gt;. Use\nGraphicsMagickWand-config or GraphicsMagickWand.pc to obtain the\ncompilation options required to use the library. Magick Wand is\nauthored by John Cristy. Magick Wand is provided as a separate\nlibrary from -lGraphicsMagick in order to assure the stability of\nthe core GraphicsMagick library while allowing Magick Wand to\nto evolve.</li>\n<li>images: Replace existing logo images with cleaner ones.</li>\n<li>www: Update links to point to updated logo images.</li>\n<li>logos: New CVS directory to contain master logos.</li>\n<li>scripts/txt2html: Updated inline logo image link.</li>\n<li>scripts/format_c_api_docs: Updated inline logo image link.</li>\n<li>version.sh: Support versioning all libraries independently.</li>\n<li>coders/meta.c: Prefix include paths for safety.</li>\n<li>magick/image.h: (TransmitType) Removed unused enumeration.\n(ProfileType) Removed unused enumeration.\n(QuantumType) Moved enumeration to constitute.h\n(StorageType) Moved enumeration to constitute.h</li>\n<li>magick/draw.c (DrawPeekGraphicContext): Added function to peek\nat head of drawing context stack (function added for ImageMagick\ncompatability).</li>\n<li>magick/image.c (CycleColormapImage): Change return type from\n<cite>void</cite> to <cite>unsigned int</cite> so that error status is returned to user.\n(DescribeImage): Change return type from\n<cite>void</cite> to <cite>unsigned int</cite> so that error status is returned to user.</li>\n<li>magick/list.c (ReplaceImageInList): Incorporated function from\nJohn Cristy's ImageMagick to replace current image in the list.</li>\n<li>coders/sgi.c (ReadSGIImage): Applied patch from John Cristy's\nImageMagick to save the compression type for SGI images.</li>\n</ul>\n</blockquote>\n<p>2003-06-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c (WriteTXTImage): Apply patch from John Cristy's\nImageMagick to observe image depth while writing pixel colors.\nThis patch is not applied to the 1.0 branch because it represents\nan output format change which could break a dependent application.\n(IsTXT): Recognize files written by the TXT coder.\n(ReadTXTImage): Reject files written by the TXT coder until support\nfor reading these files is implemented.\n(IsTXT): Ensure that sscanf doesn't read outside of provided data\nby using a fixed size buffer.</li>\n</ul>\n</blockquote>\n<p>2003-06-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Don't add -lfpx to LIBS while configuring\nbecause the C compiler may fail to link with it in later\ntests.</li>\n</ul>\n</blockquote>\n<p>2003-06-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: RotateImage is documented to take\n<cite>degrees</cite> argument, not <cite>degree</cite>.  SwirlImage is documented to\ntake <cite>degrees</cite> argument, not <cite>degree</cite>.  SolarizeImage is\ndocumented to take a <cite>threshold</cite> argument, not <cite>factor</cite>.  Wave is\ndocumented to take <cite>amplitude</cite> and <cite>wavelength</cite> arguments.  Don't\ntransform colorspace to RGB when retrieving <cite>pixel</cite> color value.\nRelease memory acquired to store <cite>length</cite> pointer.  Picked up\nmemory leak fix related to <cite>SV **reference_vector</cite> variable from\nJohn Cristy's ImageMagick.</li>\n<li>configure: Incorporate patch to handle inline better.</li>\n<li>magick/utility.c (GetToken): Adjust code to avoid &quot;end-of-loop\ncode not reached&quot; warning.</li>\n<li>magick/log.c (GetLogBlob): Eliminate warning regarding\nunreached code.</li>\n<li>magick/command.c (AnimateImageCommand): Eliminate warning regarding\nunreached code.\n(ConvertImageCommand): Eliminate warning regarding\nunreached code.\n(ImportImageCommand): Eliminate warning regarding\nunreached code.</li>\n<li>magick/type.c (GetTypeBlob): Eliminate warning regarding\nunreached code.</li>\n<li>magick/blob.c (GetConfigureBlob): Eliminate warning regarding\nunreached code.</li>\n<li>coders/meta.c (super_fgets): Eliminated warnings regarding\ncomparison and return of incompatible pointer types.\n(super_fgets_w): Eliminated warnings regarding\ncomparison and return of incompatible pointer types.</li>\n<li>magick/command.c (ConvertImageCommand): Eliminate warnings\nnoticed when using Sun's compiler.</li>\n</ul>\n</blockquote>\n<p>2003-06-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>acinclude.m4: Add <cite>#undef inline</cite> in front of C++ tests.</li>\n<li>coders/x.c (RegisterXImage): Only register the X coder if HasX11\nis defined.</li>\n</ul>\n</blockquote>\n<p>2003-06-07  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (GetImageGeometry) Y was a function of width\ninstead of height when processing EastGravity or WestGravity\n(bug report from Cristy).</li>\n</ul>\n</blockquote>\n<p>2003-06-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (LocaleNCompare): Documented that comparison is\ncase-insensitive.\n(LocaleCompare): Documented that comparison is case-insensitive.</li>\n<li>magick/log.c (ParseEvents): LocaleNCompare already does\ncase-insensitive compare so lower-casing is not necessary.</li>\n<li>Magick++: Updates to cause exceptions to be thrown if a bad\ngeometry specification is supplied.</li>\n</ul>\n</blockquote>\n<p>2003-06-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (ReadConfigureFile): Move event parsing to\nParseEvents funtion.\n(SetLogEventMask): Move event parsing to\nParseEvents funtion.</li>\n<li>magick/utility.c (GetGeometry): Validate that the geometry\nstring only contains valid characters.</li>\n<li>PerlMagick/t/subroutines.pl (testMontage): It seems that passing\nan empty set of options to the SetImage method corrupts the image\noptions (surely a PerlMagick bug), so don't invoke SetImage unless\nthere are options to set.</li>\n</ul>\n</blockquote>\n<p>2003-06-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (VersionCommand): Add build information to\nversion output.</li>\n<li>configure.ac: Save configure/build parameters for later use in\nversion output.</li>\n</ul>\n</blockquote>\n<p>2003-06-04  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c: Added some casts to make things compile better.</li>\n</ul>\n</blockquote>\n<p>2003-06-03  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c: Was broken due to editing mistakes as well\nas inherent incompatability with MagickReallocMemory macro.</li>\n</ul>\n</blockquote>\n<p>2003-06-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (RegisterXPMImage): Module registration for PICON\nshould have been XPM.  Thanks to John Cristy for noticing this\nbug.</li>\n<li>coders/psd.c (ReadPSDImage): Applied John Cristy's patch to fix\na index calculation bug which is evident when QuantumDepth&gt;8.</li>\n</ul>\n</blockquote>\n<p>2003-06-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c: Eliminated some compiler warnings.</li>\n<li>magick/transform.c (ProfileImage): Eliminated some compiler\nwarnings.</li>\n<li>magick/static.c (RegisterStaticModules): Invoke\nRegisterXTRNImage if _VISUALC_ is defined.</li>\n</ul>\n</blockquote>\n<p>2003-06-02  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/gm.c: made -format work again but had to add off flag\nto MagickCommand to maintain backward compatability with previous\nversions of GM.</li>\n<li>magick/command.c: Added flag to tell MagickCommand whether GM is\nexpected to process metadata requests. The COM object *always* does.</li>\n<li>magick/transform.c: Added error handling, memory leak avoidance\nand performanc enhancment.</li>\n</ul>\n</blockquote>\n<p>2003-06-01  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: Added Bug Fixes item with info about the JNG encoder fix.</li>\n</ul>\n</blockquote>\n<p>2003-06-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: Listed significant changes (thus far) in version 1.1.</li>\n<li>version.sh: Updated LIBRARY_CURRENT and LIBRARY_REVISION since\nsome command.c interfaces have changed, and a new interface has\nbeen added. The only user of these interfaces should be <cite>gm</cite> but\nit always pays to be careful.</li>\n<li>utilities/gm.c (main): Use MagickCommand.</li>\n<li>magick/command.c (MagickCommand): New function to provide\nAPI-level command access to the command functions provided by the\nGM utility with an interface similar to ConvertImageCommand.\n(AnimateImageCommand): Changed function arguments to match\nConvertImageCommand.\n(ConjureImageCommand): Changed function arguments to match\nConvertImageCommand.\n(DisplayImageCommand): Changed function arguments to match\nConvertImageCommand.\n(ImportImageCommand): Changed function arguments to match\nConvertImageCommand.</li>\n<li>libxml/libxml2.def: Remove LIBRARY line since Visual C++ 6.0\ndoesn't like that the build library doesn't match the name\nspecified by LIBRARY.</li>\n</ul>\n</blockquote>\n<p>2003-05-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (GetMagickInfoArray): Resolve thread-safety\nissue by accessing magick_list directly under the protection of a\nlock rather than using the pointer returned by GetMagickInfo.\nAdded error handling for insufficient memory.</li>\n<li>coders/tile.c (RegisterTILEImage): Added a usage note in formats\nlisting.</li>\n<li>coders/viff.c (RegisterVIFFImage): Module definition for &quot;XV&quot;\nwas missing.</li>\n<li>coders/ps2.c (RegisterPS2Image): Module definition for &quot;PS2&quot; was\nmissing.</li>\n<li>coders/wmf.c (RegisterWMFImage): Added usage note in formats\nlisting.</li>\n<li>coders/xpm.c (RegisterXPMImage): Hide PM alias for XPM in the\nformats listing.</li>\n<li>coders/logo.c (RegisterLOGOImage): Hide registrations for\nGRANITE, LOGO, and NETSCAPE in the formats listing.</li>\n<li>coders/jpeg.c (RegisterJPEGImage): Module definition for &quot;JPEG&quot;\nwas missing.</li>\n<li>coders/html.c (RegisterHTMLImage): Module definition for &quot;HTML&quot;\nwas missing.</li>\n<li>coders/bmp.c (RegisterBMPImage): Module names for &quot;BMP2&quot; and\n&quot;BMP3&quot; should be &quot;BMP&quot;.</li>\n</ul>\n</blockquote>\n<p>2003-05-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (GetMagickInfoArray): New function to return\nMagickInfo array.\n(ListMagickInfo): Updated to use GetMagickInfoArray.\n(ListModuleMap): New function to list module map to a file.</li>\n<li>utilities/gm.c: Centered the file header and made note of this\nstupendously significant accomplishment.</li>\n<li>magick/command.c: Added a <cite>-list modulemap</cite> option. Added plural\nforms of other list options for people who are are not limited to\nthe singular.  Also <cite>-list font</cite> and <cite>-list fonts</cite> now work for\npeople who think in terms of fonts rather than type.</li>\n</ul>\n</blockquote>\n<p>2003-05-30  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>MNG encoder failed to set the JNG bit in the simplicity profile.</li>\n<li>MNG encoder failed to write FRAM chunks when all images were JNG.</li>\n<li>JNG encoder wrote the wrong alpha_sample_depth for opaque images.</li>\n</ul>\n</blockquote>\n<p>2003-05-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magic.c (ReadConfigureFile): Removed bogus embedded magic\ndata and ensured that errors with loading magic.mgk propogate to\nthe top.</li>\n<li>magick/constitute.c (ReadImage): When building delegate error\nreport, handle the case where the filename is empty (such as for\n&quot;LOGO:&quot;).</li>\n<li>coders/png.c (WritePNGImage): Ensure that most severe exception\nis reported via exception argument.\n(ReadMNGImage): Ensure that most severe exception is reported via\nexception argument.</li>\n<li>magick/command.c (ConvertImageCommand): Ensure that most severe\nexception is reported via exception argument.\n(CompositeImageList): Ensure that most severe exception is\nreported via exception argument.\n(CompositeImageCommand): Ensure that most severe exception is\nreported via exception argument.</li>\n<li>magick/constitute.c (WriteImages): Ensure that most severe\nexception is reported via exception argument.</li>\n<li>utilities/gm.c: Centered file header because I didn't like it.</li>\n<li>locale/C.mgk: Removed some defunct messages.</li>\n<li>magick/blob.c (PingBlob): Report useful error message.\n(BlobToImage): Report sensible error message for null blob.</li>\n<li>magick/utility.c (AcquireString): Change UnableToAquireString to\nUnableToAllocateString.</li>\n<li>coders/xwd.c (ReadXWDImage): Report CorruptImage rather than\nCorruptXWDImage.</li>\n<li>coders/xpm.c (ReadXPMImage): Report CorruptImage rather than\nCorruptXPMImage.</li>\n<li>coders/xcf.c (load_level): Report CorruptImage rather than\nCorruptXCFImage.</li>\n<li>coders/wbmp.c (ReadWBMPImage): Report CorruptImage rather than\nCorruptWBMPImage.</li>\n<li>coders/pcd.c: Report CorruptImage rather than CorruptPCDImage.</li>\n<li>coders/otb.c (ReadOTBImage): Report CorruptImage rather than\nCorruptOTBImage.</li>\n<li>magick/constitute.c (ReadInlineImage): Report CorruptImage\nrather than CorruptInlineImage.</li>\n<li>coders/pdb.c (ReadPDBImage): Incorporated undocumented fix from\nImageMagick which obtains the image depth from the image depth\nattribute, and increases the packet memory allocation. Report\nCorruptImage rather than CorruptPDBImageFile.</li>\n</ul>\n</blockquote>\n<p>2003-05-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/bin/modules.mgk: Add mapping from SVGZ to SVG.</li>\n<li>coders/modules.mgk: Add mapping from SVGZ to SVG.</li>\n<li>coders/svg.c (RegisterSVGImage): Add registration for SVGZ\nformat.</li>\n<li>PerlMagick/t/zlib/read.t: Added test to check reading a file\nwith .gz extension. The blob portion of the test currently fails.</li>\n<li>coders/wpg.c (ReadWPGImage): Fix reading WPGs with embedded\nPostscript. Ensure that scene numbers are sane. Bugs remain.</li>\n<li>magick/blob.c (OpenBlob): Recognize the .svgz extension as a\ngzipped format.  Not required in order to read .svgz files since\nthe blob file magic detects gzip files.</li>\n<li>magick/command.c (MontageImageCommand): Wrong exception\nmacro was being invoked.  Steps have been taken to ensure that\nthis doesn't happen again.\n(ImportUsage): Fix spelling of <cite>type</cite>.</li>\n<li>magick/magick.c (DestroyMagick): Decided that initialization\nstate should be tracked via an enum so that DestroyMagick will\ntake effect even if InitializeMagick has never been called.</li>\n</ul>\n</blockquote>\n<p>2003-05-27  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: png.c would dump core when writing a grayscale\nimage in png24 or png32 format.</li>\n</ul>\n</blockquote>\n<p>2003-05-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/ept.c (WriteEPTImage): Fixed writing EPT preview image and\nadded logging.</li>\n<li>magick/enhance.c (NegateImage): If image is in CMYK colorspace,\nthen negate the <cite>K</cite> channel as well.</li>\n<li>PerlMagick/Magick.xs: Fix spelling of <cite>elevation</cite> argument to\nShade method.</li>\n<li>magick/image.h (ImageInfo): Added more documenting comments.</li>\n<li>magick/image.c (CloneImage): Don't clone huffman ascii85\nencoding support structure since it is not useful outside of the\ncurrent image context. Cloning a structure via pointer assignment\ncauses a memory leak.</li>\n</ul>\n</blockquote>\n<p>2003-05-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c: Incorporate math tweaks obtained from\nImageMagick which are purported to improve accuracy when rotating\nand shearing using small angles. Also avoid unneccessarily\ntransforming CMYK images into RGB images.</li>\n<li>magick/paint.c (ColorFloodfillImage): Fix hang while\nfloodfilling using a pattern image with color similar to the\nborder color.</li>\n<li>coders/modules.mgk: Add missing mappings for PNG8,\nPNG24, and PNG32.</li>\n<li>VisualMagick/bin/modules.mgk: Add missing mappings for PNG8,\nPNG24, and PNG32.</li>\n</ul>\n</blockquote>\n<p>2003-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (GetLogBlob): Return an error if log.mgk can not\nbe accessed.</li>\n<li>locale/C.mgk: Added UnableToAccessLogFile.</li>\n<li>magick/blob.c (GetConfigureBlob): Only return result of\nNTResourceToBlob if it is non-NULL.</li>\n<li>magick/type.c (GetTypeBlob): Search $MAGICK_HOME for\ntype.mgk. Only return result of NTResourceToBlob if it is\nnon-NULL.</li>\n<li>magick/magick.c (GetMagickInfo): Return an error if GetModuleInfo\nreports an error.</li>\n<li>magick/module.c (GetModuleInfo): Return an error if modules.txt\nfails to load.</li>\n<li>utility.c (SubstituteString): Fixed a bug which was introduced\nwhile updating the code to use the memory allocation macros.</li>\n</ul>\n</blockquote>\n<p>2003-05-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/GraphicsMagick-config.in (usage): Added example\nusage to the help output.</li>\n<li>magick/magick.c (InitializeMagick): Added a static flag to\nensure that the Magick library is initialized only one time.\n(DestroyMagick): Ensure that Magick library resources are only\ndestroyed if it has previously been initialized.</li>\n<li>magick/nt_base.c (DllMain): Fix contributed by Achim Domma. For\na DLL build, update PATH during Magick DLL initialization to\ninclude the directory where the Magick core DLL resides. This\nallows the loadable modules to find the core DLLs, even if the\ncore DLLs are not already in the PATH.</li>\n<li>magick/image.c (TextureImage): Incorporate new implementation\nauthored by John Cristy of ImageMagick Studio.  This\nimplementation is a full 7X (run-time) or 14X (user-time) faster\nthan the original ImageMagick implementation, and is about 2X\nfaster than the speeded-up version I commited on the 19th.</li>\n</ul>\n</blockquote>\n<p>2003-05-20  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagickconfigure : Fixed bug with add on (plug-ins) not\nbuilding automatically in DLL mode.</li>\n</ul>\n</blockquote>\n<p>2003-05-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (TextureImage): Creation of tiled image textures\nis speeded up by 3.7X.</li>\n<li>coders/tile.c (ReadTILEImage): Use TextureImage.</li>\n<li>VisualMagick/bin/modules.mgk: Map &quot;PATTERN&quot; to &quot;LOGO&quot;.</li>\n<li>coders/modules.mgk: Map &quot;PATTERN&quot; to &quot;LOGO&quot;.</li>\n<li>coders/logo.c (ReadLOGOImage): Add &quot;PATTERN&quot; tiling support in\norder to be compatible with ImageMagick.</li>\n<li>magick/image.c (SetImageInfo): Map &quot;MAGICK&quot; magick to &quot;IMAGE&quot; in\norder to be compatible with ImageMagick.</li>\n</ul>\n</blockquote>\n<p>2003-05-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Copyright.html: Try to fix formatting of XFig entry.</li>\n<li>www/windows.html: Update file names for 1.0.1 release.</li>\n<li>index.html: Mention 1.0.1 release as latest release.</li>\n<li>magick/magick_config_api.h.in: Add define for HasX11\nso that it is possible to use functions in the installed\nxwindow.h</li>\n<li>*/*.c: Updated to use MagickAllocateMemory macro.</li>\n</ul>\n</blockquote>\n<p>2003-05-17  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: stifled compiler warnings about uninitialized\nchunk and blob variables.</li>\n</ul>\n</blockquote>\n<p>2003-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.h (MagickAllocateMemory): New macro to allocate\nmemory.\n(MagickFreeMemory): New macro to free memory.\n(MagickReallocMemory): New macro to reallocate memory.</li>\n<li>*/*.c,*/*.h: Updated to use MagickFreeMemory and\nMagickReallocMemory. Eliminated warnings when compiling with\nGCC 3.3 using -Wall.</li>\n<li>images: The logo image was determined to have a copyright\nproblem so replace with blank image until a replacement is\navailable.</li>\n</ul>\n</blockquote>\n<p>2003-05-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/magick/magick_config.h.in (HAVE_SYS_TYPES_H):\nMoved this define back from nt_base.h since removing it was\ncausing some problems for Magick++.</li>\n</ul>\n</blockquote>\n<p>2003-05-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: (SetMagickInfo): Don't mask failure to\nread magic.mgk.</li>\n<li>magick/constitute.c (ReadImage): Don't overwrite specific\nexception info.</li>\n<li>magick/nt_base.c (NTResourceToBlob): Add logging similar\nto that used in IsAccessible() in order to make operation\nmore clear.</li>\n<li>magick/module.c (FindMagickModule): Removed extraneous\n&quot;Searching for module file&quot; log event.\n(GetModuleBlob): Under Windows, don't clear or overwrite\nan existing exception.</li>\n<li>magick/nt_base.h: Imported some obscure defines from\nmagickmagick_config.h.</li>\n<li>VisualMagick/magick/magick_config.h.in: Improved description\ntext and formatting.  Moved some obscure defines to\nmagick/nt_base.h.</li>\n<li>locale/C.mgk: Added a &quot;RegistryKeyLookupFailed&quot; error message.</li>\n<li>magick/type.c (GetTypeBlob): Report registry key lookup\nfailures. Also ensure correct return value when an error is\nreported.</li>\n<li>magick/log.c (GetLogBlob): Report registry key lookup failures.</li>\n<li>magick/delegate.c (ReadConfigureFile): Report registry key\nlookup failures.</li>\n<li>magick/blob.c (GetConfigureBlob): Report registry key lookup\nfailures. Also ensure correct return value when an error is\nreported.</li>\n<li>magick/module.c (FindMagickModule): Report registry key lookup\nfailures. Also ensure correct return value when an error is\nreported.</li>\n<li>magick/nt_base.c (NTRegistryKeyLookup): Simplify base key lookup\ncode, and improve coding style.</li>\n<li>coders/logo.c, Copyright.txt, www/Copyright.html: Acknowledge\nand respect the XFig copyright.</li>\n<li>VisualMagick/installer/inc/files-documentation.isx: QuickStart.txt\nis no longer distributed so it is removed.</li>\n</ul>\n</blockquote>\n<p>2003-05-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h (RoundToQuantum): New macro to round positive\ndouble to Quantum.</li>\n<li>magick/xwindow.c, magick/xwindow.h, magick/studio.h: Use FreeBSD\nportability fixes from FreeBSD ports collection.</li>\n<li>configure.ac: Test for &lt;machine/param.h&gt; as used by some *BSD systems.</li>\n<li>QuickStart.txt, www/QuickStart.html: Don't distribute QuickStart.txt or\nwww/QuickStart.html since the content doesn't currently apply to\nGraphicsMagick.</li>\n</ul>\n</blockquote>\n<p>2003-05-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>README.txt: Added text regarding where to obtain dcraw, a simple\nbut useful decoder for the proprietary raw file formats produced\nby digital cameras (58 supported cameras!).</li>\n<li>configure.ac: Added support for finding dcraw.</li>\n<li>VisualMagick/bin/delegates.mgk: Added support for dcraw.</li>\n<li>coders/delegates.mgk.in: Added support for dcraw.</li>\n<li>version.sh (PACKAGE_RELEASE_DATE): Extract the most recent\nupdate date from the ChangeLog file using awk.</li>\n</ul>\n</blockquote>\n<p>2003-05-12  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>modules.mgk, magic.mgk : Sync up both of these for UNIX\nas well as VisualMagick builds. Includes changes for the\nmeta.c code.</li>\n</ul>\n</blockquote>\n<p>2003-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/formats.html: Documented embedded gray intensity images.</li>\n<li>coders/logo.c: Added the embedded dithered gray intensity images\ngray0, gray5, ..., through gray100 to support bilevel filling and\npainting with an intensity resolution of 5%.</li>\n<li>www/formats.html: Added description of images available via\n&quot;IMAGE:&quot; format tag, as well as providing a tiled preview.</li>\n<li>coders/logo.c: Renamed &quot;transparent&quot; image to &quot;checkerboard&quot;\nsince it is a better description.  Added a set of tiny bilevel\nimages (accessed via IMAGE:) for use when tiling, filling, or for\nuse as a texture image.  The complete set of image names available\nvia the IMAGE: coder are now BRICKS, CIRCLES, CROSSHATCH,\nCROSSHATCH30, CROSSHATCH45, FISHSCALES, GRANITE, HEXAGONS,\nHORIZONTAL, HORIZONTALSAW, HS_BDIAGONAL, HS_CROSS, HS_DIAGCROSS,\nHS_FDIAGONAL, HS_HORIZONTAL, HS_VERTICAL, LEFT30, LEFT45,\nLEFTSHINGLE, LOGO, NETSCAPE, OCTAGONS, RIGHT30, RIGHT45,\nRIGHTSHINGLE, ROSE, SMALLFISHSCALES, CHECKERBOARD, VERTICAL,\nVERTICALBRICKS, VERTICALLEFTSHINGLE, VERTICALRIGHTSHINGLE, &amp;\nVERTICALSAW.  The HS_* variants are similar to the standard\npattern images provided with the Windows GDI.</li>\n<li>coders/msl.c (MSLStartElement): Don't reset gravity if the user\nprovides an x,y coordinate. Passing coodinates was loosing the\ngravity setting.</li>\n</ul>\n</blockquote>\n<p>2003-05-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/modules.mgk: Support the IMAGE: format via the LOGO\nmodule.</li>\n<li>win2k/IMDisplay/IMDisplayView.cpp (DoDisplayImage):\nTransparent tile is created by reading &quot;tile:image:transparent&quot;.</li>\n<li>coders/logo.c (ReadLOGOImage): Add IMAGE: format to front for\nembedded images so that adding new images doesn't proliferate coder\nregistrations. Legacy logo magick names (GRANITE, LOGO, NETSCAPE,\nand ROSE) are still supported, but they are also available in the\nIMAGE file space (e.g. IMAGE:ROSE).</li>\n</ul>\n</blockquote>\n<p>2003-05-09  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagickconfigure : Further refinements that support both\nthe new &quot;big&quot; library and the normal dynamic DLL buidling styles.</li>\n</ul>\n</blockquote>\n<p>2003-05-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/logo.c (ReadLOGOImage): Added a &quot;TRANSPARENT&quot; pattern\nimage which can be tiled to form the background of transparent\nimages.</li>\n<li>win32/IMDisplay/IMDisplayView.cpp: When displaying images which\ninclude an opacity channel, use a checker-board pattern as the\nimage background so non-opaque pixels become evident.</li>\n</ul>\n</blockquote>\n<p>2003-05-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c : Add or fix commenting of DebugString so that\nmodule does not require Windows.</li>\n<li>lcms: Updated to release 1.10.</li>\n</ul>\n</blockquote>\n<p>2003-05-07  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagickbin : Brought the MGK files back into sync with\nthe rest of the package and added types for meta.c.</li>\n<li>VisualMagickbinwin32ATL : removed config files in order to\nprevent very old ATL project from being picked up in the config</li>\n</ul>\n</blockquote>\n<p>2003-05-06  William Radcliffe  &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagicklcmsLIBRARY.txt : a define to prevent popup message\nbox behaviour.</li>\n<li>VisualMagickconfigure: New feature - -t consolidates all the\ncoders into on library for the static build in order to make the\nbuild process tolerable.</li>\n<li>codersxtrn.c : new support for BSTR - wdie character data</li>\n<li>coderssvg.c : put back logic that allows the -size parameter to\ncontrol the pixel dimensions of the output image.</li>\n<li>codersmeta.c : added support for wide character parsing of iptc\nand 8BIM formats.</li>\n</ul>\n</blockquote>\n<p>2003-05-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh : Update to reflect development status.</li>\n</ul>\n</blockquote>\n<p>2003-05-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick 1.0 Released.</li>\n<li>version.sh (LIBRARY_REVISION): Updated for the 1.0 release.</li>\n<li>magick/studio.h: Add fix to avoid problems caused by zlib\nunder AIX.</li>\n<li>magick/cache.h: Parameterized prototypes to make them easier\nto follow.</li>\n<li>filters/analyze.c: Replace C++ comments with C comments.</li>\n<li>magick/command.c: For the composite, convert, identify, mogrify,\nand montage commands, make sure a usage error is returned if a\nusage message is printed. This is useful for ImageMagickObject\nusers who won't see the usage message if stdio is not supported.</li>\n<li>locale/C.mgk: Added &quot;UsageError&quot; error.  Added missing closure\nto &lt;Corrupt&gt; tag which caused most/many message lookups to fail.</li>\n<li>magick/nt_base.h: Fixed a compile problem caused by masking\ninternals in delegate.h</li>\n<li>magick/ImageMagick.rc: Added missing .mgk files.</li>\n</ul>\n</blockquote>\n<p>2003-05-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (lt_dlerror): Defining lt_dlerror to be\nNTGetLastError was not a correct implementation since the\ninterface is defined to return a const pointer to a string, but\nNTGetLastError returns an allocated string, causing a memory leak\nif NTGetLastError is used in the place of lt_dlerror.  A new\nlt_dlerror function is added to fix this.\n(lt_dlsetsearchpath): lt_dlsetsearchpath should return an int\nand accept a const char *.\n(lt_dlsym): lt_dlsym is supposed to take a const char *.</li>\n<li>magick/nt_base.h: lt_dlclose should return an <cite>int</cite>.</li>\n<li>magick/nt_base.c (lt_dlclose): Return status from lt_dlclose.</li>\n<li>magick/module.c (lt_dlclose): lt_dlclose is supposed to return\nan <cite>int</cite>, not <cite>void</cite>. A return value of zero indicates success.</li>\n<li>VisualMagick/tests/run_constitute.bat: Add batch script to\nrun constitute tests.</li>\n<li>magick/module.c: Added a ltdl_initialized static flag to track\nif libltdl has been initialized by lt_dlinit().\n(TagToFunctionName): Use a stack buffer for the string rather than\nallocating heap data.\n(UnregisterModule): Report errors via exception info as the\ninterface suggests.\n(UnloadModule): Report errors via exception info as the interface\nsuggests.\n(DestroyModuleInfo): Only invoke lt_dlexit() if lt_dlinit() has\npreviously been invoked.</li>\n<li>locale/C.mgk: Added FailedToCloseModule module error.</li>\n<li>magick/module.c (UnloadModule): Report exception via exception\nparameter rather than simply printing out an error message and\nexiting.</li>\n<li>magick/Makefile.am (noinst_HEADERS): integral_types.h had to be\nlisted *somewhere* in order to make it into the distribution.</li>\n<li>Magick++/lib/Magick++/Image.h: InitializeMagick must be DLL\nexported.</li>\n</ul>\n</blockquote>\n<p>2003-05-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (magick-version): Perform version.isx substitutions\nvia Makefile.am rather than configure.</li>\n<li>magick/magick_config_api.h.in: Added template header for\nthe installed magick_config.h.</li>\n<li>magick/magick.c (InitializeMagick): Improved the signal handling\nand registration method. Signal handlers are only registered for a\nsignal if the current signal handling disposition for that signal\nis set to the default (SIG_DFL). When a signal is caught,\nDestroyMagick is invoked, the handling for the signal is set back\nto SIG_DFL, and then the signal is re-raised to trigger the\ndefault handler for that signal. This causes the process to behave\nas closely to the default as possible (e.g. generating a core\nfile) while ensuring that DestroyMagick is executed. This also\nensures that signal handlers registered by API users are not\noverridden by invoking InitializeMagick.</li>\n<li>configure.ac: Added tests for sigemptyset and\nsigaction.\nAdd a check for the return type of signal handlers.\nTest for the <cite>raise</cite> function.</li>\n<li>www/formats.html: Add an entry for CUR, Microsoft\nCursor Icon format.</li>\n</ul>\n</blockquote>\n<p>2003-05-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/semaphore.c (struct SemaphoreInfo): Added\n<cite>locked</cite> and <cite>thread_id</cite> members. These are used to record\nif the semaphore is locked, and to validate the thread\nID of the unlocker.</li>\n<li>www/links.html: Added link to Nathan Day's MagickDocs\n&quot;ImageMagick and GraphicsMagick documentation project&quot;\nsite.\nAdded a link to an on-line article regarding the PHP front-end\nto ImageMagick.</li>\n<li>coders/icon.c (ReadIconImage): Add support for Windows\n.CUR format based on advice from Jean Piquemal.</li>\n<li>magick/image.c (SetImageInfo): Added missing CloseBlob\nin error path for failure to allocate temporary file.</li>\n<li>coders/pcx.c (ReadPCXImage): Added support for reading\nuncompressed PCX images based on code from Jean Piquemal.</li>\n</ul>\n</blockquote>\n<p>2003-05-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (AddNoiseImage): For gray images, wrong\npointer was being used to evaluate intensity, leading to a\nblack image with noise.</li>\n<li>magick/image.c (ChannelImage): Return the channel\nimage in RGBColorspace. Also properly support extracting\nthe opacity channel for images which are not CMYK.</li>\n</ul>\n</blockquote>\n<p>2003-04-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/Makefile.am (install-data-local): Install\nmagick_config_api.h rather than magick_config.h.</li>\n<li>magick/api.h: Removed inclusion of integral_types.h from\nmagick/api.h.  It is included by magick/studio.h.</li>\n<li>magick/delegate.h: Mapped out a block of private implementation\ncode.</li>\n<li>configure.ac: Perform substitutions on magick_config_api.h.</li>\n<li>magick/magick_config_api.h.in: New header file template to\nuse for installed magick_config.h.</li>\n<li>magick/studio.h (MAGICK_IMPLEMENTATION): Added the define\nMAGICK_IMPLEMENTATION used to enable private types, includes, and\ndefines in the headers. This supports hiding implementation stuff\nthat API users shouldn't see in the headers.</li>\n<li>utilities/Makefile.am (check): Cleaned up the utilities\ntest/demo a bit as well as using the undocumented &quot;tmp:&quot; prefix to\ncause GraphicsMagick to remove temporary input files once they\nhave been read.  This leaves just the final output file\n&quot;demo.miff&quot; when the test completes.</li>\n<li>coders/jpeg.c (WriteJPEGImage): If the image resolution is\noverwritten with 72DPI, make sure that the resolution units are\nset to PixelsPerInchResolution.</li>\n<li>coders/jpeg.c (WriteJPEGImage): Don't overwrite the image\nresolution if it is valid.</li>\n<li>magick/command.c (MogrifyImageCommand): Added -resample\noption to match documentation.</li>\n<li>VisualMagick/configure: Added rpcrt4.lib to project settings\nfor Visual C++ 6.0 so that configure links.  The code which\nneeds these interfaces is to support Visual C++ 7.0 XML-style\nproject files.</li>\n</ul>\n</blockquote>\n<p>2003-04-30  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/Makefile.am (check) Change % to %% in -label parameter.</li>\n<li>www/gm.html, utilities/gm.1, etc. Documented use of %% to convey\nthe % sign in -format, -comment, -label strings.</li>\n</ul>\n</blockquote>\n<p>2003-04-30  William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Changes from 2003-04-19 to free the arg\nlist when it was still pointed to by the option arg and accessed\non an exception. This caused gm to crash on any erroneous command\nline argument.</li>\n</ul>\n</blockquote>\n<p>2003-04-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/windows.html: Updated to match current installer.</li>\n<li>VisualMagick/installer/inc/tasks-install-devel.isx (Name):\nAdded an installation checkbox so the user can select to install\ndevelopment headers and libraries for C &amp; C++.</li>\n<li>VisualMagick/installer/inc/files-perlmagick.isx (Source):\nOnly install PerlMagick PPD files if the user selects to install\nPerlMagick.</li>\n<li>VisualMagick/installer/inc/files-com.isx (Source): Only\ninstall ImageMagickObject files if the user selects to install\nImageMagickObject.</li>\n<li>magick/version.h.in: Added some documentation for the\nfunctioning of MagickLibVersion and MagickLibVersionNumber.</li>\n<li>configure.ac: Perform substutions to create\nVisualMagick/installer/inc/version.isx from\nVisualMagick/installer/inc/version.isx.in. This allows Windows\nversioning info to be updated from info in version.sh.</li>\n<li>Makefile.am (magick-version): For a VPATH build, update\nVisualMagick/installer/inc/version.isx in the source directory if\nit is out of date.</li>\n</ul>\n</blockquote>\n<p>2003-04-28  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/cache.c: CloneImagePixels(): applied Cristy's bugfix\nfrom IM-5.5.7.</li>\n</ul>\n</blockquote>\n<p>2003-04-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/api.html: The demo program on the ImageMagick API page is\nusually intended to be an exercise for the reader.  It rarely\ncompiles or works.  Sure enough the demo code was not even close\nto compiling, didn't run, and did something totally different than\ndescribed. This is not a good way to treat new users.  Now the\ndemo program compiles and runs, and its description is correct.</li>\n<li>www/magick.css, www/smile.c: Remove &quot;Pair&quot; advertisement which\nwas discovered appended at the end of these files.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Check for failure of\nAllocateImage.  Close blob prior to error return.</li>\n<li>configure.ac: Perform substitutions on magick/version.h</li>\n<li>magick/version.h.in: New file to provide base for configured\nmagick/version.h</li>\n<li>version.sh (PACKAGE_RELEASE_DATE): Support setting a package\nrelease date.</li>\n<li>configure.ac: Perform substitutions on PerlMagick/Magick.pm.in to\ncreate PerlMagick/Magick.pm.in.</li>\n<li>PerlMagick/Magick.pm.in: &#64;PACKAGE_VERSION&#64; is substituted while\nconfiguring PerlMagick/Magick.pm.</li>\n<li>magick/magic.mgk, VisualMagick/bin/magic.mgk: Removed risky\nentry for PICT which has been demonstrated to lead to a false\nmatch in the real-world.</li>\n<li>coders/pict.c (ReadPICTImage): Ensure that PICT decoder don't\nloop forever with an EOF condition if none of the PICT op-codes\nencountered result in a condition which terminates the input loop.\nIf EOF is dectected while in the input loop a &quot;corrupt image&quot;\n&quot;unexpected end of file&quot; error is reported.</li>\n<li>VisualMagick/installer: Updated installer.</li>\n</ul>\n</blockquote>\n<p>2003-04-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c, magick/blob.c, magick/studio.h: Added\nCompilation fixes recommended by Harold Bien for for Borland C++.</li>\n<li>www/contribute.html: Added text regarding contributing to\nGraphicsMagick.</li>\n<li>www/api/types.html: Documentation for GraphicsMagick API types\nmoved from www/api/types/*.html into this one file.  Types\ndocumentation is still very much under development.</li>\n<li>README.txt: Added note regarding the download location for free\nWindows fonts which are kindly made available by Microsoft.</li>\n<li>VisualMagick/installer/gm-dynamic-full-*.iss: Install\nnt_base.h and nt_feature.h.</li>\n</ul>\n</blockquote>\n<p>2003-04-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/windows.html: Updated for GraphicsMagick 1.0 and to\nlink to ImageMagickObject.html.</li>\n<li>www/programming.html: Added link to ImageMagickObject.html.</li>\n<li>www/ImageMagickObject.html: New file to provide some\ndocumentation for ImageMagickObject.</li>\n<li>www: Found and fixed broken URL links.</li>\n</ul>\n</blockquote>\n<p>2003-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>FlashPIX: Applied patches from FreeBSD.  Bumped package\nversion to version to 1.2.0.8.</li>\n<li>www/api.html: Updated to reflect GraphicsMagick</li>\n<li>www/*.html: Updated with format_c_api_docs script.</li>\n<li>Makefile.am (format_c_api_docs): Add a target to update\nthe C API documentation.</li>\n<li>scripts/format_c_api_docs: Add script which extracts and\nformats the C API documentation into HTML files in the www/api\nsubdirectory.</li>\n</ul>\n</blockquote>\n<p>2003-04-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh (PACKAGE_VERSION): Update release version ID.</li>\n<li>magick/version.h (MagickReleaseDate): Update release date.</li>\n<li>magick/constitute.c (ConstituteImage): Fixed problems with\nreading intensity (gray) pixel arrays.</li>\n<li>magick/image.c (GrayscalePseudoClassImage): Use\nScaleQuantumToIndex rather than ScaleQuantumToMap.</li>\n<li>magick/constitute.c (ConstituteImage): Use ScaleQuantumToIndex\nmacro to scale integral intensity values to colormap range.</li>\n<li>magick/image.h (ScaleQuantumToIndex): New macro to scale a\nquantum to the maximum range of a colormap index.  Useful when\nwriting to PsuedoClass grayscale images.</li>\n<li>VisualMagick/tests/run_constitute.bat: Batch script to run\nconstitute tests.</li>\n<li>VisualMagick/installer/*.iss: Updated for Beta1 release.</li>\n</ul>\n</blockquote>\n<p>2003-04-22  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/Makefile.am (check) fixed typos (RM -&gt; RMDelegate\nand removed stray &quot;gm&quot;), added -random-threshold, ordered-dither.</li>\n<li>magick/effect.c: Random-threshold was not treating non-gray\nPseudoColor images correctly.</li>\n</ul>\n</blockquote>\n<p>2003-04-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/Makefile.am (check): Added code to put logo on demo\noutput.</li>\n<li>magick/command.c (MontageImageCommand): Pass exception rather\nthan &amp;image-&gt;exception because image may be null, and it is\npointless to store the exception where it will not be reported to\nthe user anyway.</li>\n<li>utilities/Makefile.am (check): Ported Glenn Randers-Pehrson's\nutilities demo script into the Makefile to serve as a check\ntarget.\n(check): Add definition to find Generic.ttf.</li>\n<li>locale/C.mgk: Fixed syntax error in &lt;Option&gt;&lt;FatalError&gt;\nsection.</li>\n<li>www/development.html: New file to describe development\nprocess.</li>\n<li>index.html, www/*.html: Added link to development.html\nand improved formatting a bit.</li>\n</ul>\n</blockquote>\n<p>2003-04-21  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed bug with compiling png.c with libpng versions\nolder than libpng-0.95.</li>\n</ul>\n</blockquote>\n<p>2003-04-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/programming.html: Added links to Delphi and Scheme\nprogramming interfaces.</li>\n<li>configure.ac : Removed outdated test for jp2conf.h.</li>\n</ul>\n</blockquote>\n<p>2003-04-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Add argument expansion and deallocation code\nto command functions which lacked this functionality.\nReplace calls to Exit with a return to the invoking function.</li>\n<li>utilities/gm.c: Expect each subcommand to expand and deallocate\nits own argument list.  Treat subcommands more similarly.</li>\n<li>magick/magick.c (InitializeMagick): Seed the random number\ngenerator.</li>\n<li>magick/utility.c (ExpandFilenames): Handle tilde expansion\nproperly. Handle relative glob specifications. Skip over &quot;*&quot;\nargument to +profile properly. Don't expand VID: specifications\nsince the VID: coder will execute ExpandFilenames() later. Apply\nformat specifier prefix to globbed file names. Fix double frees\nand rationalize memory management by always copying to a new\nvector.</li>\n</ul>\n</blockquote>\n<p>2003-04-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (InitializeMagick): Decided to\nmove clean-up signal-handler registration from gm.c\nto magick.c in order to ensure that resources are\ncleaned up for all library users. This means that\nif a user program wants to do something special for\nsignals registered to be caught by InitializeMagick\n(SIGHUP, SIGINT, SIGQUIT, SIGABRT, SIGTERM, SIGXCPU,\n&amp; SIGXFSZ) then the user program should register its\nown signal handlers after invoking InitializeMagick.\nThe user is then responsible for making sure that\nDestroyMagick is invoked if an unexpected signal is\ncaught.</li>\n<li>tests/Makefile.am (check-constitute): Added\nconstitute tests.</li>\n<li>magick/constitute.c: New test program to ensure\nthat ConstituteImage and DispatchImage are working\ncorrectly.</li>\n</ul>\n</blockquote>\n<p>2003-04-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/download.html: Added links to directories\nat ftp.graphicsmagick.org.</li>\n<li>index.html: Add notice regarding 1.0 Beta0\navailability.</li>\n<li>www/cvs.html: Updated CVS checkout information to\ninclude the GraphicsMagick-1_0 branch.</li>\n<li>coders/psd.c (ReadPSDImage): Applied patch\n(SourceForge patch ID 722849) from Derry Bryson to\nfix a memory leak. An image was being leaked.</li>\n<li>magick/constitute.c (DispatchImage): Applied patch\n(SourceForge patch ID 722655) from Derry Bryson to\ncorrectly use the switch_map array rather than the\nmap array.  Without this patch, DispatchImage does\nnot work at all.</li>\n<li>GraphicsMagick 1.0.0-beta0 release.</li>\n<li>version.sh: Updated for beta0 release.</li>\n<li>*.c magick/*.h: Update header inclusion to include\n&quot;magick/&quot; prefix in order to ensure that there is no\nconfusion with headers from another package.</li>\n</ul>\n</blockquote>\n<p>2003-04-16  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c: 4x4 ordered dither threshold was\nincorrect.</li>\n</ul>\n</blockquote>\n<p>2003-04-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c (InitializeMagickResources):\nAdded the ability to obtain the amount of physical\nmemory by executing an external command.</li>\n<li>configure.ac: Check for getpagesize().\n(MAGICK_PHYSICAL_MEMORY_COMMAND): Added a test for\nan external command which (quickly) returns the\namount of physical memory installed on the machine.\nCurrently only activated for FreeBSD.\n(MAGICK_PHYSICAL_MEMORY_COMMAND): Use sysctl to\ndetermine total physical memory for Darwin.</li>\n<li>magick/delegate.c (ListDelegateInfo): If COLUMNS\nenvironment variable is set, then use it to obtain\nthe screen width.  Some shells dynamically update\nCOLUMNS, but COLUMNS may need to be explicitly\nexported in order for it to be seen by subordinate\nprograms (such as gm).</li>\n<li>magick/effect.c (AddNoiseImage): Use IsGrayImage()\nto check if the image is gray.  Add missing columns\nloop for intensity case (oops!).</li>\n<li>magick/command.c (DisplayImageCommand): Fix\n-dispose option processing bug reported by\nFelix Heimbrecht.</li>\n<li>coders/fpx.c: Check status from FPX_InitSystem().</li>\n</ul>\n</blockquote>\n<p>2003-04-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Define PERLMAINCC to be the C compiler\nif there are no C++ dependencies, or the C++ compiler\nif there are C++ dependencies.</li>\n<li>PerlMagick/Makefile.PL.in: Use PERLMAINCC to compile\nand link perlmain.c.  This allows using the C++ compiler\nto link, which is useful when the build depends on C++\nlibraries like libfpx.</li>\n<li>ltmain.sh: Updated to libtool 1.5 release.</li>\n<li>Makefile.am ($(PERLMAGICK)/$(PERLSTATICNAME)): Add\nrules to make sure that static PerlMagick is linked\nagainst the current GraphicsMagick library.</li>\n<li>coders/miff.c (ReadMIFFImage): Properly scale\ncolormap entries.</li>\n<li>magick/image.c (TransformRGBImage): Eliminate 32-bit\ninteger overflow condition for Q:32 build while\ntransforming CMYK pixels.</li>\n</ul>\n</blockquote>\n<p>2003-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/ttf/read.t: Updated signatures and\nreference image for FreeType 2.1.4.</li>\n<li>(PerlMagick/t/write.t, PerlMagick/t/montage.t,\nPerlMagick/t/rad/read.t, PerlMagick/t/rad/write.t):\nFix signatures which were thrown off by previous\nchange to how signatures are specified to functions\nin subroutines.pl.</li>\n<li>PerlMagick/t/cgm/read.t: Updated to use reference\nimage.</li>\n<li>PerlMagick/Makefile.PL.in: Perform substitutions\non generated Makefile to ensure that the proper\n-lGraphicsMagick is used for a static build.</li>\n<li>ttf: Updated to FreeType 2.1.4.  Now stored in\nCVS as delegates/freetype2 rather than delegates/ttf\nso be sure to re-checkout the ttf directory so that\nthe correct files are used.</li>\n<li>wmf/incude/libwmf/api.h: Updating FreeType caused\na problem since it introduced a copy of zlib and\napi.h included zlib.h.  Fixed problem by adding\na typedef for gzFile and not including zlib.h.</li>\n<li>utilities/gm.c: Fixed minor compilation problem\nunder Windows caused by a typo in the signal\nhandler registration code.</li>\n</ul>\n</blockquote>\n<p>2003-04-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: When building a static PerlMagick,\nbuild PerlMagick as part of the <cite>all</cite> target and\ndon't do a <cite>make clean</cite> of PerlMagick at install\ntime.</li>\n<li>configure.ac (LIB_DPS): Add check to see if -lXt\nis required by -ldps.  XFree86 -ldps requires -lXt.</li>\n<li>FlashPIX: FlashPIX library now compiles under\nFreeBSD 5.0.</li>\n<li>magick/deprecate.c (ValidateColormapIndex): Remove\nnon-interface deprecated function.</li>\n<li>magick/tempfile.c (AcquireTemporaryFileDescriptor):\nPriortize use of mkstemp() over tempname() since *BSD\ncompilers whine about tempname() (although we do use\ntempname() safely).</li>\n<li>magick/color.c (ConstrainColormapIndex): Removed\nfunction since it is no longer used.</li>\n<li>magick/utility.c (TemporaryFilename): Removed\nTemporaryFilename utility function since it is\nno longer used and it makes *BSD compilers\ncomplain.</li>\n<li>magick/studio.h: Don't define _ISOC99_SOURCE,\n_POSIX_C_SOURCE, or _XOPEN_SOURCE when compiling\nunder FreeBSD since this maps out a <cite>ushort</cite>\ndefinition required by /usr/include/sys/ipc.h.</li>\n</ul>\n</blockquote>\n<p>2003-04-11  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Some grayscale PNG images and the\nJNG alpha channel were decoded improperly at Q:32.</li>\n<li>magick/constitute.c (PopImagePixels): Changed many\ninstances of (Quantum) typecast to (unsigned char).</li>\n</ul>\n</blockquote>\n<p>2003-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/tiff/read.t: Added signature for 12-bit\nTIFF test and a Q:32 build.</li>\n<li>PerlMagick/t/subroutines.pl: Extended routines\nwhich are signature based to accept signatures for\nQ:32 as well.</li>\n<li>PerlMagick/t/wmf/read.t: Relax error values slightly\nto pass at Q:32.</li>\n<li>coders/miff.c (PushImageRLEPixels): Fix reading\nRLE MIFF at Q:32.  A fragment of old code was being\nused to obtain the length.\n(WriteRunlengthPacket): Fix writing RLE MIFF at Q:32.\nIn most cases the wrong scaling macro was being used.</li>\n<li>tests/Makefile.am (check-miff): Added MIFF tests\nfor supported compression options.</li>\n</ul>\n</blockquote>\n<p>2003-04-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/color.c (QueryColorDatabase): Extended to\nsupport parsing Q:32 hex color specification strings.\nAlso add error reporting for failure to parse the\ncolor specification. This resolves a bug that drawing\nvia the draw.c APIs was not working for Q:32 builds.</li>\n<li>utilities/gm.c (main): Add signal handlers to\nmake sure that program cleans-up on exit by invoking\nDestroyMagick.</li>\n<li>magick/draw.c (DrawSetFillColor): Quote color\nspecification.\n(DrawSetStrokeColor): Quote color specification.\n(DrawSetTextUnderColor): Quote color specification.</li>\n<li>ltmain.sh: Update to latest CVS libtool.</li>\n</ul>\n</blockquote>\n<p>2003-04-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enhance.c (NormalizeImage): Only normalize the opacity\nchannel if image-&gt;matte is true. This results in some (15%)\nspeedup. While it can be argued that the <cite>K</cite> in CMYK should be\nnormalized, it can also be argued that this is senseless since <cite>K</cite>\nis not a &quot;linear&quot; measure like C, M, &amp; Y are, and there may not be\nany any value to normalizing CMY at all.\n(EqualizeImage): Only equalize the opacity channel if image-&gt;matte\nis true.  This results in a 23% speedup.\n(GammaImage): Minor loop optimization.\n(LevelImage): Don't level the opacity channel.  Doing so doesn't\nmake any sense.\n(LevelImageChannel): Put loops inside switch statement rather than\naround it.</li>\n<li>PerlMagick/t/tiff/read.t: Added grayscale 12-bit and 16-bit TIFF\nread tests.</li>\n</ul>\n</blockquote>\n<p>2003-04-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Add support for reading\n12-bit grayscale TIFFs. Fix reading 16-bit grayscale TIFFs\nwhen QuantumDepth=8.</li>\n<li>VisualMagick/installer/gm-dynamic-full-8.iss,\nVisualMagick/installer/gm-dynamic-full-16.iss: Many C header\nfiles were not being included in the distribution.  Oops!</li>\n</ul>\n</blockquote>\n<p>2003-04-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>(index.html, www/*.html): Update to new web page style.</li>\n<li>scripts/txt2html: Update to output new web page style.</li>\n<li>ltmain.sh: Updated to latest CVS libtool.</li>\n<li>magick/tempfile.c (DestroyTemporaryFiles): Function was\ncrashing if it was executed twice.</li>\n</ul>\n</blockquote>\n<p>2003-04-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/delegates.mgk.in: Ralcgm was appending &quot;.ps&quot; to the\nprovided output file name, so change cgm delegate command so that\nthe input file is delivered via standard input, output is\nre-directed to a file, and anything printed to stderr (such as\nthe Ralcgm program name and version) is sent to /dev/null.</li>\n<li>INSTALL-unix.txt: Added/corrected/improved documentation\nregarding --disable-installed, --enable-shared, and\n--with-modules.</li>\n<li>VisualMagick/magick/magick_config.h.in: Add more documentation\nand explanatory notes in order to lessen confusion.</li>\n<li>Many files: Replaced &quot;UseInstalledImageMagick&quot; with\n&quot;UseInstalledMagick&quot; for obvious reasons.</li>\n</ul>\n</blockquote>\n<p>2003-04-04  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c, utilities/gm.c: Print &quot;help&quot; screen for a\ntool when user types &quot;gm tool&quot; or &quot;gm tool -help&quot;</li>\n<li>magick/command.c, magick/effect.c: add -ordered-dither option.</li>\n</ul>\n</blockquote>\n<p>2003-04-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>locale/C.mgk: Fixed message associated with\n&quot;UnableToCreateTemporaryFile&quot;.</li>\n<li>magick/tempfile.c (AcquireTemporaryFileDescriptor): Decided\nto return a pathname (if possible), even on failure, for use\nin error reports.  The function return status should be used\nto determine if the function has succeeded.</li>\n<li>locale/locale.mgk: Updated copyright header.</li>\n<li>(magick/annotate.c, magick/attribute.c, magick/blob.c,\nmagick/cache.c, magick/constitute.c, magick/delegate.c,\nmagick/display.c, magick/image.c, magick/locale.c\nmagick/tempfile.c, magick/tempfile.h, magick/utility.c,\nmagick/xwindow.c, coders/dcm.c, coders/ept.c,\ncoders/histogram.c, coders/mpeg.c, coders/pdf.c,\ncoders/pict.c, coders/preview.c, coders/ps2.c,\ncoders/ps3.c, coders/ps.c, coders/pwp.c, coders/sfw.c,\ncoders/svg.c, coders/tiff.c, coders/url.c, coders/wpg.c):\nEnsure that failure to allocate/create temporary file is\nproperly detected and reported.</li>\n</ul>\n</blockquote>\n<p>2003-04-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/type.c (GetTypeBlob): Prioritize hard-coded path\nover Windows registry values.</li>\n<li>magick/log.c (GetLogBlob): Prioritize hard-coded path\nover Windows registry values.</li>\n<li>magick/blob.c (GetConfigureBlob): Prioritize hard-coded path\nover Windows registry values.</li>\n<li>magick/delegate.c (ReadConfigureFile): Perform substitutions\nfor &quot;&#64;GMDelegate&#64;&quot;, &quot;&#64;GMDisplayDelegate&#64;&quot;, &quot;&#64;MPEGDecodeDelegate&#64;&quot;,\n&quot;&#64;MPEGEncodeDelegate&#64;&quot;, and &quot;&#64;HPGLDecodeDelegate&#64;&quot; while reading\ndelegates.mgk under windows.\n(ListDelegateInfo): Format delegate command line to multiple\nlines if necessary rather than truncating.</li>\n<li>configure.ac (MagickBinPathDefine): Added support for\na MagickBinPath definition.</li>\n<li>configure.ac (GSVersion): Added test to obtain version\nof installed Ghostcript.</li>\n<li>magick/tempfile.c (AcquireTemporaryFileDescriptor): Open\nflag should have been O_RDWR, not O_WRONLY!</li>\n</ul>\n</blockquote>\n<p>2003-04-03  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c: Simplified skipping over the &quot;*&quot; in\nthe +profile &quot;*&quot; option when expanding filenames.</li>\n</ul>\n</blockquote>\n<p>2003-04-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/bin/delegates.mgk: Update similarly to\ncoders/delegates.mgk.in.</li>\n<li>coders/delegates.mgk.in: Replaced <cite>mpeg-decode</cite> delegate\nspecification with <cite>mpeg</cite> delegate specification.</li>\n<li>PerlMagick/t/mpeg/read.t: Since -r option is no longer\nsupplied to mpeg2decode, the signatures must be updated.</li>\n<li>magick/utility.c (ExpandFilenames): Skip over no-argument\ncommands properly.</li>\n<li>coders/mpeg.c: Removed ReadMPEGImage since this is handled\nentirely by delegate now.</li>\n<li>magick/command.c: Add convert -temporary option for use\nwhen input files are temporary files which should be\nautomatically removed.</li>\n<li>magick/delegate.c (InvokeDelegate): Ensure that temporary\nfile access is secure.</li>\n<li>coders/ept.c (ReadEPTImage): Ensure that temporary file\nspecified by image_info-&gt;filename is liberated before\nallocating a new temporary file name.</li>\n<li>coders/ps.c (ReadPSImage): Ensure that temporary file\nspecified by image_info-&gt;filename is liberated before\nallocating a new temporary file name.</li>\n<li>coders/pdf.c (ReadPDFImage): Change TemporaryFilename\nto AcquireTemporaryFileName.</li>\n<li>magick/tempfile.c (LiberateTemporaryFile): Now takes\na <cite>char *</cite> argument rather than <cite>const char *</cite>, and\nerases the provided filename if it is the name of a valid\ntemporary file. This helps avoid errors. The return\nstatus may be used to determine if a file was removed.\n(AcquireTemporaryFileDescriptor): Decided that adding a\n.tmp extension to temporary file names is unnecessary.</li>\n<li>coders/jp2.c (WriteJP2Image): Destroy pixel matrix\nafter encoding image.  Cristy says that there is memory\ncorruption otherwise.</li>\n</ul>\n</blockquote>\n<p>2003-04-01  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Use new temporary file manager for JNG components.\nMerge with IM 5.5.7 (mostly cosmetic changes).</li>\n</ul>\n</blockquote>\n<p>2003-03-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/cache.c (OpenCache): Add some Windows-specific\nopen options.</li>\n<li>magick/resource.c (InitializeMagickResources): Increase\nthe number of &quot;lowio&quot; file handles available for use under\nWindows.</li>\n<li>ltdl/ltdl.c: Incorporate more Darwin fixes from CVS libtool.</li>\n<li>coders/pcx.c (ReadPCXImage): Incorporate bugfix from\nImageMagick -- Not enough memory allocated for reading PCX\n(bug report by Trevor Willis).</li>\n<li>magick/magick.c (InitializeMagick): Only invoke\nSetLogEventMask() to set debug options based on\ngetenv(&quot;MAGICK_DEBUG&quot;) if the environment variable is set.</li>\n</ul>\n</blockquote>\n<p>2003-03-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/tempfile.c: Include tempfile.h rather than temporary.h</li>\n<li>magick/magick.c: Include tempfile.h rather than temporary.h</li>\n<li>coders/dcm.c, coders/ept.c, coders/histogram.c, coders/mpeg.c,\ncoders/pdf.c, coders/pict.c, coders/preview.c, coders/ps.c,\ncoders/ps2.c, coders/ps3.c, coders/pwp.c, coders/sfw.c,\ncoders/svg.c, coders/tiff.c, coders/url.c, coders/wpg.c,\nmagick/annotate.c, magick/attribute.c, magick/blob.c,\nmagick/cache.c, magick/constitute.c, magick/delegate.c,\nmagick/display.c, magick/image.c, magick/magick.c,\nmagick/utility.c, magick/xwindow.c: Updated to use new temporary\nfile allocation APIs.</li>\n<li>magick/tempfile.c: New temporary file allocation subsystem for\nallocating, tracking, and deallocating temporary files.  Use of\nthis subsystem should reduce the likelyhood that temporary\nfiles will be left behind once the process exits.\nIf the environment variable MAGICK_TMPDIR is set, then its\nvalue is used as the location to place temporary files.</li>\n<li>magick/utility.c (IsAccessibleAndNotEmpty): New function\nfor testing for file exists, is a regular file, and is not empty.\nUsed to test if a temporary file has been updated by a delegate.</li>\n<li>magick/log.c (SetLogEventMask): Add support for setting\nTemporaryFileEvent.</li>\n<li>PerlMagick/Magick.xs: Added TemporaryFile log event type.</li>\n<li>magick/log.h (LogEventType): Add TemporaryFileEvent event\nclassification.</li>\n</ul>\n</blockquote>\n<p>2003-03-29  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (SampleImage) and magick/render.c (DrawAffineImage():\nApplied Cristy fix for bug that offset images to the top and left.</li>\n<li>magick/resize.c (ScaleImage): Fixed bug that caused intensity\nlevels to be one unit too high.</li>\n<li>coders/png.c: make JNG support depend on HasJPEG. Remove temp files.</li>\n</ul>\n</blockquote>\n<p>2003-03-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (ResizeImage): Applied fix authored by John\nCristy for distortion when using the bessel filter.</li>\n<li>magick/display.c: Applied fix authored by John Cristy which\neliminates bogging down when using the magnifier window on\nlarge images.</li>\n<li>Several files: A few files included multiple copies of the\ncopyright header text due to either pilot error, or equipment\nfailure.</li>\n</ul>\n</blockquote>\n<p>2003-03-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/Makefile.am : Removed some debug code which was\naccidentally committed to CVS.</li>\n<li>Copyright.txt: Add copyright statements to all the files,\nincluding some apparently missing copyrights.</li>\n</ul>\n</blockquote>\n<dl class=\"docutils\">\n<dt>2003-03-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</dt>\n<dd><ul class=\"first last simple\">\n<li>magick/Makefile.am: Added temporary.c and temporary.h. These\nare not finished yet.</li>\n<li>magick/cache.c: Transferred optimization from ImageMagick\nto read/write all requested pixel cache rows in one system\ncall when accessing the cache using file I/O, and the\nrequested columns equals the image columns.</li>\n<li>magick/resource.c: (ResourceInfo): Use type <cite>double</cite> rather\nthan <cite>long double</cite>. For many systems, the range of <cite>long double</cite>\nis the same as <cite>double</cite>.  On others, use of <cite>long double</cite> incurs\nthe cost of function calls since there is no hardware support.</li>\n</ul>\n</dd>\n</dl>\n<p>2003-03-22  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.h, effect.c, command.c: Revised -random-dither\nto require parameters: channel LOWxHIGH.  Channel can presently\nbe &quot;intensity&quot;, &quot;opacity&quot;, or &quot;all&quot;.</li>\n</ul>\n</blockquote>\n<p>2003-03-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ltdl/ltdl.c: Updated to latest CVS version.  Claimed to\nsupport loading modules under MacOS-X.</li>\n<li>magick/resource.c (InitializeMagickResources): Enable code\nunder Windows which queries system limits.</li>\n<li>magick/cache.c (S_MODE): Fixed portability problems with\ndefinition.</li>\n<li>VisualMagick/bin/delegates.mgk: Fix typo in &quot;mpeg-decode&quot;\ndecode rule.</li>\n<li>libtool: Update to latest CVS version.</li>\n<li>configure.ac: Test zlib for gzseek and gztell.</li>\n<li>magick/effect.c (ChannelThresholdImage): The is_grayscale flag\nwas not be evaluated correctly.</li>\n</ul>\n</blockquote>\n<p>2003-03-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h (RoundSignedToQuantum): Added handy\nRoundSignedToQuantum macro for munging doubles into Quantums.</li>\n<li>magick/effect.c (ThresholdImage): Added optimizations for\nthresholding all pixels to white or black. Threshold using an\nintegral value rather than a double so compares are faster.\n(ChannelThresholdImage): Threshold against integral values since\ncompares are faster. Invoke ThresholdImage for simple thresholding\nacross all channels since it is faster.</li>\n</ul>\n</blockquote>\n<p>2003-03-19  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c: #ifdef'ed out some dead code.</li>\n<li>magick/annotate.c: #ifdef'ed out some code that is only\nused when HasTTF is defined.</li>\n<li>Added RandomThresholdImage() method and -random-threshold\ncommandline option.</li>\n</ul>\n</blockquote>\n<p>2003-03-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac (LIB_TIFF): Check for TIFFReadRGBATile and TIFFReadRGBAStrip\nin libtiff before deciding to use it.</li>\n<li>magick/blob.c (WriteBlob): Move pointer increment into\nparanthesis.\n(ReadBlob): Move pointer increment into paranthesis.</li>\n<li>magick/gem.c (HSLTransform): Removed inline statement.\n(TransformHSL): Removed inline statement.</li>\n<li>magick/random.[c|h]: Removed files from CVS.</li>\n<li>magick/command.c: Don't include random.h.</li>\n<li>PerlMagick/t/reference/jng: Update reference files to current output.</li>\n</ul>\n</blockquote>\n<p>2003-03-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Added tests for pread and pwrite functions.</li>\n<li>magick/image.c (GrayscalePseudoClassImage): Properly invoke\nSyncImagePixels.</li>\n<li>magick/cache.c (SyncCacheNexus): Add back in is_monochrome and\nis_grayscale flag resetting which was lost by copying over\nImageMagick's cache.c.\n(FilePositionRead): Inline wrapper for reading a chunk of data at\nan offset.\nCleans up some messy code, and makes it easy to use pread().\n(FilePositionWrite): Inline wrapper for writing a chunk of data at\nan offset.\nCleans up some messy code, and makes it easy to use pwrite().\nCache now uses pread() and pwrite() to access the cache if these\ncalls are available.</li>\n<li>magick/resource.c (InitializeMagickResources): Support setting\nresource limits via the environment variables MAGICK_LIMIT_DISK,\nMAGICK_LIMIT_FILES, MAGICK_LIMIT_MEMORY, and MAGICK_LIMIT_MAP.</li>\n</ul>\n</blockquote>\n<p>2003-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/stream.c (AcquirePixelStream): Store total pixels in\n64-bit type.\n(SetPixelStream): Store total pixels in 64-bit type.</li>\n<li>coders/tiff.c (WriteTIFFImage): CoderError should be\nMissingDelegateError.</li>\n<li>coders/ps3.c (Huffman2DEncodeImage): CoderError should be\nMissingDelegateError.\n(WritePS3Image): CoderError should be MissingDelegateError.</li>\n<li>coders/ps2.c (Huffman2DEncodeImage): CoderError should be\nMissingDelegateError.</li>\n<li>coders/pdf.c (Huffman2DEncodeImage): CoderError should be\nMissingDelegateError.</li>\n<li>coders/fpx.c (ReadFPXImage): CoderError should be\nMissingDelegateError.\n(WriteFPXImage): CoderError should be MissingDelegateError.</li>\n<li>coders/dps.c (ReadDPSImage): CoderError should be\nMissingDelegateError.</li>\n<li>magick/image.c (AnimateImages): DelegateError should be\nMissingDelegateError.</li>\n<li>magick/annotate.c (RenderX11): DelegateError should be\nMissingDelegateError.</li>\n<li>magick/image.c (DisplayImages): DelegateError should be\nMissingDelegateError.</li>\n</ul>\n</blockquote>\n<p>2003-03-17  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c Relocated misplaced break in ChannelImage()\nand sped up SetImageOpacity by avoiding blend operation when\nsetting the image fully opaque.</li>\n</ul>\n</blockquote>\n<p>2003-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/cache.c: Snarfed cache.c updates from ImageMagick.</li>\n<li>magick/command.c: Added -list resource support.</li>\n</ul>\n</blockquote>\n<p>2003-03-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/Makefile.am (random.c): Removed building, packaging,\nand intialization of random.c functions since it is not actually\nused.</li>\n<li>magick/semaphore.c (InitializeSemaphore): Only initialize\ncritical section if active_semaphore is not already true.</li>\n<li>magick/resource.c: Snarf resource.c updates from ImageMagick.</li>\n<li>PerlMagick/Magick.xs: Added missing log event types.</li>\n<li>magick/log.h (enum): Added ResourceEvent enumeration.</li>\n<li>magick/log.c (LogMagickEvent): fflush(stdout) at the end of\neach log.  Otherwise output may not be seen for a long time.\n(SetLogEventMask): Add support for &quot;-debug resource&quot;.</li>\n<li>coders/tiff.c (RegisterTIFFImage): Don't register encode and\ndecode handlers for TIFF if TIFF library is not available.</li>\n<li>magick/constitute.c (WriteImage): Fix cut-n-paste error\nin log message (&quot;decoder&quot; --&gt; &quot;encoder&quot;).</li>\n</ul>\n</blockquote>\n<p>2003-03-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>index.html: Added a link to the GraphicsMagick mailing lists.</li>\n<li>Magick++/demo/zoom.cpp: Added dashed option support, including\na -resample option for image resampling.</li>\n</ul>\n</blockquote>\n<p>2003-03-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (DIST_SUBDIRS): Filters subdirectory needs to\nbe distributed.</li>\n</ul>\n</blockquote>\n<p>2003-03-14  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c Ported Cristy's bugfix to DrawAffineImage().</li>\n</ul>\n</blockquote>\n<p>2003-03-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (DestroyImage): Comment out new assertions until\nwe are certain that there are no ill effects.</li>\n<li>coders/mat.c (ReadMATImage): Set image-&gt;depth to valid values.</li>\n<li><dl class=\"first docutils\">\n<dt>PerlMagick/Magick.xs: Update so that new DestroyImage assertions</dt>\n<dd>aren't asserted.</dd>\n</dl>\n</li>\n<li>magick/list.c (DestroyImageList): Update so that new DestroyImage\nassertions aren't asserted.</li>\n<li>coders/wpg.c (ReadWPGImage): Don't leave dangling pointer when\ntrimming list. Don't set image-&gt;depth to invalid values.</li>\n</ul>\n</blockquote>\n<p>2003-03-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (DestroyImage): Add assertions to verify\nthat destroyed image is not currently referenced by another\nimage.  This should help prevent accidental continued use\nof a destroyed image.\n(DestroyImage): Added assertions to enforce that images\nshould not continue to reference the destroyed image.</li>\n<li>coders/wpg.c: Incorporated fixes from Jaroslav Fojtik.</li>\n<li>version.sh (PACKAGE_VERSION_ADDENDUM): Construct a package\nsnapshot version based on the ChangeLog modification time.\nThis requires GNU find to work propery since the -printf\noption is used.</li>\n<li>configure.ac (LIB_GS): Do not test for the Ghostscript\nlibrary by default due to the issue of its embedded libjpeg\nconflicting with libjpeg.</li>\n<li>coders/ept.c (ReadEPTImage): &quot;PostscriptDelegateFailed&quot; should\nbe classified as a DelegateError type.</li>\n</ul>\n</blockquote>\n<p>2003-03-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (BlobToFile): Truncate while opening file.\n(ImageToFile): Truncate while opening file.</li>\n<li>magick/annotate.c (RenderFreetype): Missing freetype library\nshould result in a MissingDelegateError type rather than a\nDelegateError type.</li>\n<li>INSTALL-windows.txt: Added a note regarding a workaround for\ninternal compiler errors while compiling image.c when using\nVisual C++ 7.0.</li>\n<li>coders/jpeg.c (ReadICCProfile): Incorporate ImageMagick fix\nto handle short JPEG ICC profiles.</li>\n<li>magick/integral_types.h: Ignore SIZEOF_LONG_LONG and\nSIZEOF_UNSIGNED_LONG_LONG defines if _VISUALC_ is defined.</li>\n</ul>\n</blockquote>\n<p>2003-03-11  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/gm.html, utilities/gm.1, guide/gm.tex: Expanded description\nof the -affine option.</li>\n</ul>\n</blockquote>\n<p>2003-03-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (GetImageDepth): Re-implemented using a single-pass\nalgorithm and 1/2 the code. Previous implementation didn't return\ncorrect results for Q:32 build.  Now it does.</li>\n<li>magick/command.c (IdentifyImageCommand): For identify, when\n%q format specifier is present, image must be read rather than\npinged.  If not, either the value 8 is returned, or there is a\ncrash due to reading an uninitialized image.</li>\n</ul>\n</blockquote>\n<p>2003-03-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c: Incorporate fixes from Jaroslav Fojtik.  Close\nBlob before rotating image.</li>\n<li>PerlMagick/README.txt: Update to reflect that PerlMagick is\npart of GraphicsMagick.</li>\n<li>PerlMagick/t/input.mat: Added test image for Matlab format.</li>\n<li>PerlMagick/t/input.wpg: Added test image for WordPerfect Graphics Format.</li>\n<li>utilities/Makefile.am (ALLMANPAGES): Install gm.1 rather than\nold utility manual pages.</li>\n</ul>\n</blockquote>\n<p>2003-03-09  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/gm.html, utilities/gm.1, guide/gm.tex: First cut at\nmanpage for gm, to replace individual utility manpages.</li>\n</ul>\n</blockquote>\n<p>2003-03-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c: Fix some erroneous log printf specifications.\nImproved blob log messages a bit.</li>\n<li>magick/log.c (IsEventLogging): Use  InitializeLogInfo().\n(InitializeLogInfo): New function to intelligently initialize\nlogging subsystem.  Only locks when initialization may be required,\nand only locks long enough to determine if initialization is required.\nThis approach should avoid deadlocking while logging from functions\nused to initialize logging.\n(IsLogAccessible): No longer need this duplicate of IsAccessible().\n(SetLogEventMask): Use  InitializeLogInfo().</li>\n<li>coders/fpx.c (ReadFPXImage): FlashPIX library does not support\nBLOB I/O so don't use OpenBlob/CloseBlob.  Opening the blob caused\na conflict when the FlashPIX library attempted to open the file.</li>\n</ul>\n</blockquote>\n<p>2003-03-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Test for libtiff functions (TIFFClientOpen &amp;\nTIFFIsByteSwapped), which are required by GraphicsMagick, but\nnot found in older libtiff versions.</li>\n<li>magick/blob.c: Added logging for Blob open/close and memory\nmapping operations.</li>\n</ul>\n</blockquote>\n<p>2003-03-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwblob.c (main): DestroyImage asserts on NULL so only\ncall it for non-null image.</li>\n<li>tests/rwfile.c (main): DestroyImage asserts on NULL so only\ncall it for non-null image.</li>\n</ul>\n</blockquote>\n<p>2003-03-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwblob.c (main): Add -pause option to require keypress to\nexit program. Clean-up to avoid any appearance of leaks.</li>\n<li>tests/rwfile.c (main): Add -pause option to require keypress to\nexit program. Clean-up to avoid any appearance of leaks.</li>\n<li>magick/static.c (ExecuteStaticModuleProcess): Don't bind in\nprocess filter functions for Visual C++ since the build environment\ndoesn't support it yet.</li>\n<li>magick/log.c (GetLogBlob) Code wasn't actually testing current\ndirectory for log.mgk, now it does.</li>\n<li>magick/log.c (IsEventLogging): Eliminate accidental recursive, or\nrepeated, initialization of the logging system.</li>\n</ul>\n</blockquote>\n<p>2003-03-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (WriteJP2Image): Improved -quality rate estimation\nfor very small files.</li>\n</ul>\n</blockquote>\n<p>2003-03-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (WriteJP2Image): Add additional logging support.</li>\n<li>tests/rwblob.c: Added BLOB read/write logging.</li>\n<li>tests/rwfile.c: Added file read/write logging.</li>\n<li>magick/module.c (FindMagickModule): Minor code cleanup and limit\ndirectory and file name lengths to sensible values.</li>\n<li>magick/utility.c (IsAccessible): Log test failures along with\ntest failure reason [strerror(errno)]. Also log test success.</li>\n<li>VisualMagick/bin/delegates.mgk: -DSAFER does not work with\nGhostscript 8.0.</li>\n<li>magick/module.c: Needed to conditionally include nt_feature.h.</li>\n</ul>\n</blockquote>\n<p>2003-03-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/module.c (ExecuteModuleProcess): Updated to support locating\nfilter modules based on search rules.\n(CoderInfo): Declare only in module.c since use is private to this\nmodule.\n(GetCoderInfo): Made static and commented out since currently unused.\n(FindMagickModule): New function to search for a module.\n(GetModuleBlob): Moved from blob.c, made static, and re-implemented\nbased on FindMagickModule.</li>\n<li>magick/blob.c: Moved GetTypeBlob() to type.c and made it static.\nMoved GetModuleBlob() to module.c and made it static.</li>\n</ul>\n</blockquote>\n<p>2003-03-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/Makefile.am: MIFF module does not depend on -ljpeg, but\nPNG module does (for JNG).</li>\n<li>filters/analyze.c (AnalyzeImage): Bugfix, image should be passed\nas Image** rather than Image*.</li>\n<li>magick/utility.c (IsAccessible): Don't log errno if errno==0.</li>\n</ul>\n</blockquote>\n<p>2003-03-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/Makefile.am: Link with libFilters convenience library.</li>\n<li>VisualMagick/magick/magick_config.h.in: Change MagickModulesPath\nto MagickCoderModulesPath and add a MagickFilterModulesPath to\nlocate filter modules.</li>\n<li>filters/Makefile.am: New makefile to build filter modules.</li>\n<li>configure.ac: Configure magick/GraphicsMagick.pc and\nMagick++/lib/GraphicsMagick++.pc.\n(MagickModulesSubdir): Add quantum depth to modules path to ensure\nthat modules with the correct depth are loaded.  The modules path\nis now\n${libdir}/GraphicsMagick-${PACKAGE_VERSION}/modules-Q${QuantumDepth}/coders.\n(MagickCoderModulesPath): Rename MagickModulesPath to\nMagickCoderModulesPath.\n(MagickFilterModulesPath): Define to location of filter modules.</li>\n<li>magick/Makefile.am: Added rules to install GraphicsMagick.pc.</li>\n<li>magick/GraphicsMagick.pc.in: Added pkgconfig file for\n-lGraphicsMagick.</li>\n</ul>\n</blockquote>\n<p>2003-02-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (WriteJP2Image): Quality factor calculation had\naccidentally been removed.  The calculation is back, but has been\nbiased up slightly so that a quality factor of 75 results in a\nmore reasonable 16:1 compression. Past a quality factor of 99.5,\nthe compression is set to 1:1 (non-lossy).</li>\n</ul>\n</blockquote>\n<p>2003-02-27  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed bug with reading interlaced PNG images, introduced\nyesterday.</li>\n<li>Fixed bug with skipping MNG subimages, also introduced\nyesterday.</li>\n</ul>\n</blockquote>\n<p>2003-02-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (EXTRA_DIST): Forgot to distribute version.sh</li>\n<li>configure.ac: Use definitions from version.sh to drive\npackage versioning and naming. These definitions support\nlibtool's recommended approach to library versioning.</li>\n<li>version.sh: New file for managing release versioning.\nEdit this file to change the release number, etc.</li>\n<li>PerlMagick/t/tiff/read.t: Added read tests for stripped,\nplanar contiguous, and planar seperated TIFFs.</li>\n<li>coders/tiff.c (ReadTIFFImage): Transferred stripped-TIFF\nreading code from ImageMagick.\nEnumerated reading methods to make the logic more clear.</li>\n</ul>\n</blockquote>\n<p>2003-02-27  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>JNG alpha sample depth was sometimes inconsistent.</li>\n<li>Bring only one line at a time into memory during PNG\nread/write (Merge with Cristy's 5.5.6 update).</li>\n</ul>\n</blockquote>\n<p>2003-02-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Makefile.PL.in (LIBS): Put MAGICKLIB first to\ndecrease the probability that the wrong libMagick is used\nwhen linking static PerlMagick.</li>\n<li>configure.ac (PerlMagick): Fix linker search path for\n-lGraphicsMagick when linking a static PerlMagick.  It seems\nthat libtool changed the location where it places static\nlibraries.</li>\n<li>PerlMagick/t/tiff/read.t: Added test for reading tiled TIFF.</li>\n<li>coders/tiff.c (ReadTIFFImage): Add optimized support for\nreading tiled TIFFs.\n(ReadTIFFImage): Optimize loops for reading tiled TIFFs as well.\n(ReadTIFFImage): Eliminate compiler warning.\n(ReadTIFFImage): Add some missing error handling for tiled TIFF.</li>\n</ul>\n</blockquote>\n<p>2003-02-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Optimize RGBA transfer loop.</li>\n</ul>\n</blockquote>\n<p>2003-02-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawPrimitive): Return DrawPolygonPrimitive\nstatus (edit transferred from ImageMagick).</li>\n<li>magick/utility.c (GetMagickGeometry): Scaling to an area now\npreserves the image aspect ratio.</li>\n</ul>\n</blockquote>\n<p>2003-02-24  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png.c: Added missing parentheses in typecast (cristy noticed\nthe bug that I introduced on 2/18).</li>\n</ul>\n</blockquote>\n<p>2003-02-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Add rules to produce www/README.html,\nwww/INSTALL-mac.html, www/INSTALL-unix.html, www/INSTALL-vms.html,\nand www/INSTALL-windows.html</li>\n<li>www/README.html: New file produced from README.txt</li>\n<li>www/INSTALL-mac.html: New file produced from INSTALL-mac.txt.</li>\n<li>www/INSTALL-unix.html: New file produced from INSTALL-unix.txt.</li>\n<li>www/INSTALL-vms.html: New file produced from INSTALL-vms.txt.</li>\n<li>www/INSTALL-windows.html: New file produced from INSTALL-windows.txt.</li>\n<li>NEWS: Added news for GraphicsMagick 1.0.0.</li>\n<li>magick/locale.c: Added error messages to support JP2.</li>\n<li>locale/C.mgk: Added error messages to support JP2.</li>\n<li>locale/locale.mgk: Update to GraphicsMagick copyright.</li>\n<li>coders/jp2.c: Updated to use Jasper 1.700.1 interface\nconventions. Jasper 1.700.1 is required now. Support\nreading arbitrary quantum sizes up to 16-bits.  Return\ngrayscale images as PseudoClass.</li>\n<li>jp2/: Updated Jasper sources to version 1.700.1.</li>\n</ul>\n</blockquote>\n<p>2003-02-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (ReadJP2Image): Obtain channel indexes by\nID rather than assuming index value.  Validate that channel\ngeometry and encoding is supported.</li>\n<li>magick/effect.c (ThresholdImage): Additional performance\noptimization. Work faster if image is already gray.</li>\n</ul>\n</blockquote>\n<p>2003-02-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (WriteJP2Image): Port to Jasper 1.7.\nFor Q:32, don't write 32-bit pixels rather than the\n16-bit pixels we told Jasper we would write.\n(WriteJP2Image): Back-port to Jasper 1.6.</li>\n</ul>\n</blockquote>\n<p>2003-02-18  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/modules.mgk: Added JNG entry.</li>\n</ul>\n</blockquote>\n<p>2003-02-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (RegisterJP2Image): Added registration for\n&quot;PGX&quot; magick tag.</li>\n<li>magick/magic.mgk: Added entry for JPEG V2's PGX format.</li>\n<li>PerlMagick/t/jp2/read.t: Added JPEG Version 2 read tests.</li>\n<li>coders/modules.mgk: Added JPC and PGX magick types to\nsupport JPEG V2.</li>\n<li>magick/color.c (IsMonochromeImage): Re-arranged test logic\nto short-circuit test using ORs.\n(IsGrayImage): Re-arranged test logic to short-circuit test\nusing ORs.</li>\n<li>magick/constitute.c (PopImagePixels): Speed GrayQuantum\nand GrayAlphaQuantum cases if is_grayscale is True.</li>\n<li>magick/quantize.c (AssignImageColors): Sync image to\nupdate DirectClass pixels to new colormap.</li>\n<li>coders/fpx.c (RegisterFPXImage): FlashPIX does not\nprovide direct BLOB I/O support.</li>\n<li>magick/blob.c (BlobToImage): Add logging.\n(BlobToFile): Add logging.</li>\n</ul>\n</blockquote>\n<p>2003-02-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fpx.c (ReadFPXImage): Removing the input file is\nantisocial.</li>\n<li>PerlMagick/t/fpx/*.fpx: Replaced with new copies.  Files\nseemed to be corrupt.</li>\n<li>PerlMagick/t/cgm/read.t: Specify file magick so that CGM\nread test passes for BLOB case.</li>\n<li>PerlMagick/t/rad/read.t: Specify file magick so that RAD\nread test passes for BLOB case.</li>\n<li>PerlMagick/t/jng/read.t: Add read tests for JNG.</li>\n<li>PerlMagick/t/jng/write.t: Add read/write tests for JNG.</li>\n<li>configure.ac (DELEGATES): Added <cite>jng</cite> to the DELEGATES list\nso that JNG can be included in the PerlMagick tests.</li>\n</ul>\n</blockquote>\n<p>2003-02-18  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Write proper JNG image_interlace_method.</li>\n<li>coders/png.c: Read and write proper MNG and JNG sRGB intent.</li>\n<li>PerlMagick/t/jng: Add twelve test files in JNG format.</li>\n<li>coders/png.c: Write proper progressive JNG output when\ntransparency is present.</li>\n</ul>\n</blockquote>\n<p>2003-02-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/version.c (GetMagickWebSite): New function.</li>\n</ul>\n</blockquote>\n<p>2003-02-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c (ipa_device_begin): Use MagickWebSite definition.</li>\n<li>www/Copyright.html: Updated to match Copyright.txt</li>\n<li>www/perl: Updated to reflect GraphicsMagick vs ImageMagick.</li>\n<li>magick/xwindow.c (XMakeImageMSBFirst): Minor loop optimizations.</li>\n<li>magick/constitute.c (ConstituteImage): Check for grayscale\nand monochrome image if image is PseudoClass.</li>\n</ul>\n</blockquote>\n<p>2003-02-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enhance.c (ContrastImage): Preserve is_grayscale flag.\n(EqualizeImage): Preserve is_grayscale flag.\n(ModulateImage): Preserve is_grayscale flag.\n(NegateImage): Preserve is_grayscale flag.\n(NormalizeImage): Preserve is_grayscale flag.</li>\n<li>magick/fx.c (ColorizeImage): Evaluate is_grayscale status.\n(ConvolveImage): Preserve is_grayscale flag.\n(ImplodeImage): Preserve is_grayscale flag.\n(SolarizeImage): Preserve is_grayscale flag.\n(OilPaintImage): Preserve is_grayscale flag.\n(SwirlImage): Preserve is_grayscale flag.\n(WaveImage): Preserve is_grayscale flag.</li>\n<li>magick/resize.c (MagnifyImage): Preserve is_grayscale flag.\n(MinifyImage): Preserve is_grayscale flag.\n(ResizeImage): Preserve is_grayscale flag.</li>\n<li>magick/decorate.c (FrameImage): Evaluate is_grayscale status.\n(RaiseImage): Preserve is_grayscale.</li>\n<li>magick/shear.c (IntegralRotateImage): Preserve is_grayscale.\nflag.\n(XShearImage): Evaluate is_grayscale status.\n(YShearImage): Evaluate is_grayscale status.</li>\n<li>magick/transform.c (ChopImage): Preserve is_grayscale flag.\n(CropImage): Preserve is_grayscale flag.\n(FlipImage): Preserve is_grayscale flag.\n(FlopImage): Preserve is_grayscale flag.\n(RollImage): Preserve is_grayscale flag.</li>\n<li>magick/effect.c (AddNoiseImage): If image colorspace is\nGRAYColorspace, then add intensity noise, and transfer\nimage is_grayscale flag to output image.\n(BlurImage): Preserve is_grayscale flag.\n(DespeckleImage): Preserve is_grayscale flag.\n(EdgeImage): Preserve is_grayscale flag.\n(EmbossImage): Preserve is_grayscale flag.\n(GaussianBlurImage): Preserve is_grayscale flag.\n(MotionBlurImage): Preserve is_grayscale flag.\n(ShadeImage): Preserve is_grayscale flag.\n(SharpenImage): Preserve is_grayscale flag.\n(UnsharpMaskImage): Preserve is_grayscale flag.</li>\n<li>magick/quantize.c (QuantizeImage): Pre-reduce gray images\nto PseudoClass in order to quickly determine the number of\ncolors, and provide the expected PseudoClass output. Also\nskip slow color quantization if there are already fewer\ncolors than requested.</li>\n<li>magick/image.c (GrayscalePseudoClassImage): New function\nto quickly reduce an image to PseudoClass grayscale.  This\nis a fast way to determine the number of intensities in a\ngrayscale image. Either a compact sorted colormap or a faster,\ncontiguous linear colormap is created, depending on the\noptimize_colormap flag. If the image is already PseudoClass,\nand the optimize_colormap flag is True, then the existing\ncolormap is sorted and reduced.\n(SyncImage): Preserve is_grayscale flag.\n(ChannelImage): Result is grayscale.\n(CycleColormapImage): Preserve is_grayscale and is_monochrome flags.\n(SetImage): Evaluate is_grayscale flag.\n(SetImageDepth): Preserve is_grayscale flag.\n(SetImageOpacity): Preserve is_grayscale flag.\n(SortColormapByIntensity): Preserve is_grayscale flag.\n(TransformRGBImage): Evaluate is_grayscale flag.</li>\n</ul>\n</blockquote>\n<p>2003-02-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (SampleImage): Preserve grayscale and\nmonochrome flags.</li>\n<li>magick/quantize.c (AssignImageColors): Set image monochrome\nflag to True when quantizing to two colors in GrayColorspace.</li>\n<li>magick/effect.c (SpreadImage): Preserve grayscale and\nmonochrome flags.\n(AdaptiveThresholdImage): Short-circuit algorithm if image\nflags indicate it is already monochrome. Set monochrome and\ngrayscale flags once algorithm completes.\n(ThresholdImage): Short-circuit algorithm if image\nflags indicate it is already monochrome. Set monochrome and\ngrayscale flags once algorithm completes.\n(ChannelThresholdImage): Short-circuit algorithm if image\nflags indicate it is already monochrome. Set monochrome and\ngrayscale flags once algorithm completes.\n(ShadeImage): If grayscale shading is done, then set image\ngrayscale flag to True.</li>\n<li>magick/color.c (IsGrayImage): If the image is_grayscale\nflag is True, then short-circuit the test. Update the flag\nif the test is performed.\n(IsMonochromeImage): If the image is_monochrome flag is True\nthen short-circuit the test. Update the flag if the test is\nperformed.</li>\n<li>magick/image.c (CloneImage): Copy image is_grayscale and\nis_monochrome members.</li>\n<li>magick/cache.c (SyncCacheNexus): If image pixels are updated\nthen set image is_grayscale and is_monochrome members to False.\nAlgorithms which want to preserve the values of these members\nshould save their original values before processing the image\nand restore them when processing is complete, or transfer them\nfrom the input image to the output image.</li>\n<li>magick/constitute.c (ReadImage): If the returned image is\nPseudoClass then invoke IsGrayImage() and IsMonochromeImage()\nand cache the result in image is_grayscale and is_monochrome\nmembers for later use.</li>\n<li>magick/image.h (Image): Added is_grayscale and is_monochrome\nmembers to remember if image is grayscale or monochrome.</li>\n</ul>\n</blockquote>\n<p>2003-02-14  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/archives.html: commented out sites not mirroring GM yet.\nChanged &quot;ftp.simplesystems.org&quot; to &quot;ftp.graphicsmagick.org&quot;.\nAdded link to graphicsmagick.sf.net.</li>\n</ul>\n</blockquote>\n<p>2003-02-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (FormatString): Check for the availability of\nvsprintf.</li>\n<li>magick/log.c (LogMagickEvent): Check for the availability of\nvsprintf.</li>\n<li>configure.ac: Test for vsprintf.</li>\n</ul>\n</blockquote>\n<p>2003-02-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c (RenderFreetype): Used smarter code to prepare\nthe beta argument for AlphaComposite.</li>\n</ul>\n</blockquote>\n<p>2003-02-12  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/logo.c: updated logo.c to produce the GraphicsMagick logo.</li>\n</ul>\n</blockquote>\n<p>2003-02-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>INSTALL-unix.txt: Document that default quantum depth is now 8.</li>\n<li>VisualMagick/magick/magick_config.h.in: Default quantum depth is now 8.</li>\n<li>configure.ac: Default quantum depth is now 8.</li>\n<li>tests/Makefile.am: Test format types that require a size\nseperately since always specifying the size caused some formats\n(e.g. PCD) to improperly fail.</li>\n</ul>\n</blockquote>\n<p>2003-02-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/NEWS.html: New HTML file for project news.</li>\n<li>scripts/txt2html: New script for formatting text into HTML.</li>\n<li>Makefile.am: Automated the generation of www/Changelog.html and\nwww/NEWS.html.</li>\n<li>coders/xpm.c (WritePICONImage): Close blob using correct image.</li>\n<li>tests/Makefile.am (CHECK_SIZED_FILES): Added files to tests\nsubdirectory so that tests don't need to use files from\nPerlMagick.</li>\n<li>magick/image.c (TransformColorspace): New function to\nsimplify/centralize colorspace transform requests.  Replaced calls\nto RGBTransformImage and TransformRGBImage throughout the code\nwith calls to TransformColorspace.</li>\n<li>IMDisplay: Disable save function since it is not implemented yet.</li>\n</ul>\n</blockquote>\n<p>2003-02-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs (SetAttribute): Support changing back to\nRGB or Transparent colorspace.</li>\n</ul>\n</blockquote>\n<p>2003-02-10  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Brought MNG handling of final delay into compliance with MNG spec.</li>\n</ul>\n</blockquote>\n<p>2003-02-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (WriteBMPImage): Added support for\nbits_per_pixel==4.\n(WriteBMPImage): Convert PseudoClass images with more than 256\ncolors to DirectClass.\n(WriteBMPImage): Do not require 2-color images to pass the\nIsMonochromeImage() test before writing them as one-bit-per-pixel\nBMPs.  Decided to allow this after four readers (including Windows\nXP) displayed the image using the proper colormap.\n(WriteBMPImage): BMP2 encoder was writing colormap using wrong format.</li>\n<li>images: Updated logo images to GraphicsMagick</li>\n<li>Added PDF Sages to web page as a sponsor.</li>\n</ul>\n</blockquote>\n<p>2003-02-08  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/GraphicsMagick.html: add &quot;gm &quot; prefix to examples.</li>\n</ul>\n</blockquote>\n<p>2003-02-07  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>index.html: Update to distinguish between ImageMagick and\nGraphicsMagick, and to explain &quot;gm&quot; prefix of commandline utilities.</li>\n</ul>\n</blockquote>\n<p>2003-02-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_feature.c (CropImageToHBITMAP): Remove useless\nautocrop support which was transferred from CropImage when\ncreating CropImageToHBITMAP.</li>\n</ul>\n</blockquote>\n<p>2003-02-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): RLE packet size was not\ncalculated correctly, causing RLE-compressed MIFF images with\ndepth&gt;8 to not be read.</li>\n</ul>\n</blockquote>\n<p>2003-02-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/paint.c (ColorFloodfillImage): Transfered fix from\nImageMagick for the problem that floodfill using a tiled image\nfailed if the target color happened to match the current fill\ncolor.</li>\n</ul>\n</blockquote>\n<p>2003-02-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Fixed preview error message.</li>\n<li>coders/preview.c: Previous update had broken noiseimage demo.\nAlso some cleanups.</li>\n<li>magick/display.c (XMagickCommand): No longer uses\nMogrifyImage.</li>\n<li>coders/preview.c (WritePreviewImage): Re-wrote so that\nMogrifyImage is no longer used. Resize image outside of the loop\nto improve performance.</li>\n</ul>\n</blockquote>\n<p>2003-02-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (ShadeImage): Use PixelIntensityToDouble macro.</li>\n<li>magick/image.h (PixelIntensityToDouble): Added\nPixelIntensityToDouble macro to handle the case where pixel\nintensity is used for floating arithmetic.</li>\n</ul>\n</blockquote>\n<p>2003-01-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Distribute files ChangeLog, INSTALL-mac.txt,\nINSTALL-unix.txt, INSTALL-vms.txt INSTALL-windows.txt, and NEWS.</li>\n</ul>\n</blockquote>\n<p>2003-01-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement): Applied fix from ImageMagick to\ncompute SVG +&gt; MVG viewbox correctly.</li>\n<li>magick/image.c (CloneImage): Applied fix from ImageMagick which\nis purported to solve the problem that &quot;negative (x,y) page offsets\ndid not clone properly&quot;.</li>\n<li>magick/gem.c (TransformHWB): Replace implementation with\nImageMagick's new version which is supposed to fix a rounding\nerror problem.  Hard to say since implementation is totally\ndifferent.</li>\n<li>coders/msl.c (MSLStartElement): Applied fix for missing break\nfrom ImageMagick.</li>\n<li>magick/integral_types.h: New header to include the integral\ntypes typedefs.  Needed new header in order to include in both\nstudio.h and api.h at the right point.</li>\n<li>magick/studio.h: Move nt_feature.h inclusion to the few modules\nwhich actually use functions from it.</li>\n<li>magick/api.h: Added typedefs gm_int16_t, gm_uint16_t,\ngm_int32_t, gm_uint32_t, gm_int64_t, gm_uint64_t to support\nspecifically sized types.</li>\n<li>configure.ac: Test for size of <cite>short</cite>, <cite>unsigned short</cite>, <cite>int</cite>,\n<cite>unsigned int</cite>, <cite>long</cite>, <cite>unsigned long</cite>, <cite>long long</cite>, <cite>unsigned\nlong long</cite> assigning the result to the defines SIZEOF_SHORT,\nSIZEOF_UNSIGNED_SHORT, SIZEOF_INT, SIZEOF_UNSIGNED_INT,\nSIZEOF_LONG, SIZEOF_UNSIGNED_LONG, SIZEOF_LONG_LONG, and\nSIZEOF_UNSIGNED_LONG_LONG respectively.</li>\n</ul>\n</blockquote>\n<p>2003-01-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/fx.c (OilPaintImage): Compute histogram using 8-bit quantums\nfor more sensible performance with Q:16 and Q:32 builds.</li>\n<li>magick/image.h (PixelIntensityToQuantum): Compute using integral\narithmetic for Q:8 and Q:16.  Much faster than floating point!\n(PixelIntensity): Compute using integral arithmetic for Q:8 and\nQ:16. Much faster than floating point!</li>\n</ul>\n</blockquote>\n<p>2003-01-28  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed bug in png.c, introduced in IM-5.5.1.  A pair of\n{ } brackets were omitted when logging was added, which lets\nold versions of libpng write a zero-length iCCP chunk.</li>\n</ul>\n</blockquote>\n<p>2003-01-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (DespeckleImage): Put loops inside of case\nstatement rather than outside.\n(SpreadImage): Improved algorithm so that -spread is 12X faster.</li>\n<li>magick/nt_feature.c (CropImageToHBITMAP): New function to return\na region of the image as a HBITMAP.</li>\n</ul>\n</blockquote>\n<p>2003-01-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed Copyright statement on all source files.</li>\n<li>magick/effect.c (ThresholdImage): Optimized loop.</li>\n<li>coders/tiff.c (ReadTIFFImage): Read bits more efficiently for\nbits_per_sample=1.</li>\n<li>magick/command.c (MogrifyImage): Set image-&gt;dither to\nimage_info-&gt;dither prior to invoking SetImageType.</li>\n<li>magick/constitute.c (WriteImage): Set image-&gt;dither to\nimage_info-&gt;dither.</li>\n<li>magick/image.c (SetImageType): For case BilevelType, normalize\nimage, and threshold 50% if dithering is disabled.  This is at\nleast 10X faster than quantizing with dither.\n(AllocateImage): Initialize image-&gt;dither.\n(CloneImage): Copy image-&gt;dither.</li>\n<li>magick/image.h: Added dither member to Image.</li>\n</ul>\n</blockquote>\n<p>2003-01-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/tiff/read.t: Added a test for reading 16-bit TIFF\nimages.</li>\n<li>coders/tiff.c (ReadTIFFImage): Support reading 16-bit TIFF images\nwith a Q:8 build.</li>\n<li>magick/color.c (ConstrainColormapIndex): Use VerifyColormapIndex.</li>\n<li>coders/pnm.c (ReadPNMImage): Use VerifyColormapIndex.</li>\n<li>coders/gif.c (DecodeImage): Use VerifyColormapIndex.</li>\n<li>magick/image.c (SyncImage): Use VerifyColormapIndex.</li>\n</ul>\n</blockquote>\n<p>2003-01-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (ReadBlobByte): Use getc when reading from FILE stream.</li>\n<li>configure.ac: Added tests for getc_unlocked and putc_unlocked.</li>\n<li>magick/blob.c (ReadBlobByte): Optimized reading from BlobStream.\n(ReadBlobLSBLong): Optimized reading from BlobStream.\n(ReadBlobLSBShort): Optimized reading from BlobStream.\n(ReadBlobMSBLong): Optimized reading from BlobStream.\n(ReadBlobMSBShort): Optimized reading from BlobStream.\n(ReadBlobStream): New static inline function to read from BlobStream.\n(WriteBlob): &quot;Manually&quot; copy data rather than using memcpy() for\nvery small copy sizes.\n(WriteBlobByte): Use putc() when writing to a FILE stream.</li>\n</ul>\n</blockquote>\n<p>2003-01-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gem.c (Hull): Count down loops.  Might help.\n(InterpolateColor): Pre-compute common sub-expressions to improve\nperformance.</li>\n<li>magick/segment.c (Classify): Implemented idea from Glenn\nRanders-Pehrson to avoid use of pow() when WeightingExponent is\n2.0 (which it is).  This makes image segmentation much faster\n(e.g. 8X).</li>\n<li>magick/annotate.c (RenderFreetype): For images with\nmatte==False, simply set the opacity of the pixel to be updated to\nOpaqueOpacity before alpha-compositing the pixel rather than using\nSetImageType(TrueColorMatteType) to initialize the opacity of the\nentire image.  This is much faster and scales to large images.</li>\n<li>magick/image.c (SetImageType): Eliminated unnecessary conditionals.</li>\n</ul>\n</blockquote>\n<p>2003-01-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (InsertMedianList): Assign computed quantum\nindexes to variables to avoid extra computations for\nQuantumDepth&gt;8.</li>\n<li>magick/composite.c (AlphaComposite): Pre-compute common\nexpressions in order to improve performance.</li>\n<li>magick/fx.c (ConvolveImage): Optimized loops.</li>\n<li>magick/paint.c (TransparentImage): Optimize for case fuzz == 0.</li>\n<li>magick/color.c (FuzzyColorMatch): Minor cleanup and optimization.</li>\n<li>magick/locale.c: Added error messages for convolve option.</li>\n<li>coders/locale.c: Picked up recent changes from ImageMagick version.</li>\n<li>locale/C.mgk: Added error messages for convolve option.</li>\n<li>magick/command.c (MogrifyImage): Added support for convolve option.</li>\n<li>coders/xcf.c (ReadXCFImage): Recognize latest GIMP XCF header.</li>\n<li>coders/dcm.c: Transferred the apparent salient fixes from\nImageMagick for a bug described as &quot;Some DCM grayscale images did\nnot display correctly.&quot;.</li>\n<li>coders/miff.c (ReadMIFFImage): Reading RLE-compressed MIFFs is\nnow about 4X faster.</li>\n<li>magick/blob.c (OpenBlob): Use setvbuf() to increase stdio buffer\nsize to 16K.  Solaris default is 1K.  This should minimize system\ncall overhead for accessing large files.\n(ReadBlob): &quot;Manually&quot; copy data rather than using memcpy() for\nvery small copy sizes.\n(ReadBlobZC): New method, similar to ReadBlob, but provides the\nopportunity for zero copy on read.</li>\n<li>magick/constitute.c (PushImagePixels): CMYKA case for\nimage-&gt;depth=16 was comparing with 8 instead.</li>\n</ul>\n</blockquote>\n<p>2003-01-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetMagickGeometry): Removed support for <cite>~</cite>\nand disabled centering code until we learn where it should go (if\nanywhere).</li>\n<li>magick/command.c : Add HWB colorspace transform support.</li>\n<li>PerlMagick/Magick.xs: Add HWB colorspace transform support.</li>\n<li>magick/image.c (RGBTransformImage): Add HWB colorspace transform\nsupport.\n(TransformRGBImage): Add HWB colorspace transform support.</li>\n</ul>\n</blockquote>\n<p>2003-01-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetMagickGeometry): Add support for new new\n<cite>~</cite> geometry string flag.  This also fixes a montage bug in which\nthumbnails were mis-sized if the geometry specification incuded x\nor y offsets.</li>\n<li>magick/image.h (GeometryFlags): Added CenterValue enumeration to\ncorrespond with new <cite>~</cite> geometry string flag.  Taking\nImageMagick's lead on this.</li>\n<li>magick/render.c: Transferred fixes from ImageMagick for an\nartifact which occured at the 360 degree point when rendering\ncircles, ellipses, and arcs.  Bug reported by <a class=\"reference external\" href=\"mailto:io219&#37;&#52;&#48;attbi&#46;com\">io219<span>&#64;</span>attbi<span>&#46;</span>com</a>.</li>\n<li>PerlMagick/Magick.xs: Add HSL colorspace transform support.</li>\n<li>magick/command.c: Add HSL colorspace transform support.</li>\n<li>magick/image.c (RGBTransformImage): Add HSL colorspace transform\nsupport.\n(TransformRGBImage): Add HSL colorspace transform support.</li>\n</ul>\n</blockquote>\n<p>2003-01-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated copyright statement on source files to reflect\nthe GraphicsMagick Group rather than ImageMagick Studio.</li>\n<li>magick/constitute.c (ConstituteImage): Simplified the switch\nstatement for inner loops by creating a simplified map in advance.\n(DispatchImage): Simplified the switch statement for inner loops\nby creating a simplified map in advance.</li>\n<li>magick/compress.c (HuffmanEncodeImage): Test and cache the\nreturn value of LocaleCompare(image_info-&gt;magick,&quot;FAX&quot;) so that\nLocaleCompare is not executed repeatedly in the output loop.</li>\n<li>magick/color.c (IsGrayImage): Optimized loops.\n(IsMonochromeImage): Optimized loops.\n(IsOpaqueImage): Optimized loop.</li>\n<li>magick/delegate.c (InvokePostscriptDelegate): When using the\nGhostscript library, identify the library as &quot;[ghostscript library]&quot;\nrather then &quot;gsdll32&quot; so that -verbose prints something useful for\nboth Windows and Unix.</li>\n</ul>\n</blockquote>\n<p>2003-01-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: New file.</li>\n<li>magick/montage.c (MontageImages): Use ThumbnailImage() rather\nthan ZoomImage() to resize montage thumbnails provided that the\nuser has not specified an image filter, and the montage thumbnail\nis smaller than the image. This should provide faster montages\nfor large images.</li>\n<li>magick/resize.c (ResizeImage): Added logging support.\n(MagnifyImage): Added logging support.\n(MinifyImage): Added logging support.\n(SampleImage): Added logging support.\n(ScaleImage): Added logging support.</li>\n</ul>\n</blockquote>\n<p>2003-01-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/transform.c (ProfileImage): Duplicate ImageMagick changes\nto image colorspace handling.  Avoids using\nSetImageType(image,ColorSeparationMatteType).</li>\n<li>magick/fx.c (OilPaintImage): Replaced with ImageMagick version\nsince ImageMagick version has been updated to not penalize Q:8.\nOptimized loops.</li>\n<li>magick/display.c (XDisplayImage): Display to 100% of\nthe screen size rather than 90% of the screen size.</li>\n<li>magick/enhance.c (ModulateImage): Ensure that arguments\nare always positive values.  Optimized loops.\n(ContrastImage): Optimized loops.</li>\n<li>magick/gem.c (HSLTransform): Optimized performance by\neliminating redundant intermediate calculations. This\nmakes <cite>gm convert -contrast</cite> 21% faster.\n(HSLTransform): Set to inline within the gem.c module.\n(TransformHSL): Set to inline within the gem.c module.\n(Contrast): Moved to bottom of gem.c module so HSLTransform\nand TransformHSL can be inlined. Simplified conditionals.\n(Modulate): Moved to bottom of gem.c module so HSLTransform\nand TransformHSL can be inlined. No longer check/correct\nnegative values.</li>\n</ul>\n</blockquote>\n<p>2003-01-14 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c</li>\n<li>magick/blob.h\nAdded new stream type flag and support to match with the one\nadded to ImageMagick.</li>\n</ul>\n</blockquote>\n<p>2003-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (RGBTransformImage): Fixed bug (thanks to\nBill for finding it) and finished optimizing XYZ table\ncreation.\n(AverageImages): Optimized loops.\n(ChannelImage): Optimized loops.  3X speed-up for SPARC.</li>\n<li>magick/enhance.c: Optimized NegateImage().</li>\n</ul>\n</blockquote>\n<p>2003-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Set some common API structures to 0xbf prior to deallocation\nto make accidental continued use more obvious.</li>\n</ul>\n</blockquote>\n<p>2003-01-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c: Minor optimizations to PopImagePixels()</li>\n<li>coders/dpx.c: Reading the DPX header was off by 4 bytes.</li>\n<li>coders/(art.c,avs.c,bmp.c,cmyk.c,dcm.c,dib.c,dpx.c,fax.c,\nfits.c,gray.c,icon.c,map.c,miff.c,mono.c,mpc.c,mtv.c,otb.c,\npcx.c,pdb.c,pict.c,pix.c,pnm.c,pwp.c,rgb.c,rla.c,rle.c,sct.c,\nsgi.c,sun.c,tga.c,tim.c,uyvy.c,vicar.c,viff.c,wbmp.c,xwd.c,\nyuv.c): Ensure that blob is closed on unexpected EOF.</li>\n<li>magick/image.c: Optimized SetImageOpacity().\nOptimized SetImage() for intializing non-opaque images.  The\nopacity channel was being intialized twice.</li>\n</ul>\n</blockquote>\n<p>2003-01-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c: Log entry and exit from coders so that\ncoders don't need to.</li>\n<li>Finished re-writing PushImagePixels() using coding practices\nwhich may result in faster code.</li>\n<li>PerlMagick is changed from Image::Magick to Graphics::Magick\nin order to avoid conflicts with the ImageMagick version.  This\nmeans that any Perl scripts based on the ImageMagick version need\nto do a global replace of Image::Magick to Graphics::Magick.</li>\n<li>PerlMagick/reference/filter/Raise.miff: Replaced with new version.</li>\n</ul>\n</blockquote>\n<p>2003-01-08 William Radcliffe &lt;<a class=\"reference external\" href=\"mailto:billr&#37;&#52;&#48;corbis&#46;com\">billr<span>&#64;</span>corbis<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_feature.c\nMake ImageToHBITMAP function in nt_feature.c compile under Visual\nC++ again.</li>\n</ul>\n</blockquote>\n<p>2003-01-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/delegates.mgk.in: Fix cgm entry.  How did it become so\nterribly broken?</li>\n<li>coders/dps.c: Adding logging support.</li>\n<li>PerlMagick/t/read.t: Changed file read tests to use image\ncompares with a reference image rather than comparing with a\nsignature.</li>\n<li>PerlMagick/t/wmf/read.t: Ditto.\nmagick/shear.c: Fixed documentation for RotateImage.</li>\n</ul>\n</blockquote>\n<p>2003-01-08  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c, magick/magick.h: Add &quot;note&quot; member of magick_info.</li>\n<li>coders/art.c, coders/fax.c, coders/dcm.c, coders/png.c: add notes\nto format registrations.</li>\n<li>fx.c: changed default &quot;colorize&quot; behaviour to preserve image opacity.</li>\n</ul>\n</blockquote>\n<p>2003-01-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/svg.c: Allow the user to specify the initial background\ncolor via the -background option.  This is only useful if the SVG\ndoesn't draw its own background rectangle.</li>\n</ul>\n</blockquote>\n<p>2003-01-06  Albert Chin-A-Young  &lt;<a class=\"reference external\" href=\"mailto:china&#37;&#52;&#48;thewrittenword&#46;com\">china<span>&#64;</span>thewrittenword<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ltdl/Makefile.am, ltdl/ltdl.c: Fix compilation problem\nunder Tru64 UNIX 5.1.  The GraphicsMagick random.h was being\nincluded when the system random.h was needed.</li>\n<li>configure.ac: Improve robustness of POSIX thread API tests\nby including pthread.h when building the test program.</li>\n</ul>\n</blockquote>\n<p>2003-01-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c: In IsImagesEqual() only use type <cite>long double</cite>\nfor error summation if QuantumDepth &gt; 16 and <cite>long double</cite> has\nmore range than <cite>double</cite>.</li>\n<li>magick/quantize.c: In QuantizeImage() only use type <cite>long\ndouble</cite> for error summation if QuantumDepth &gt; 16 and <cite>long\ndouble</cite> has more range than <cite>double</cite>.</li>\n<li>Replaced redundant code with macros.</li>\n<li>Optimize mapping to monochrome.</li>\n<li>utilities/conjure.c: Had missed removing this file earlier.</li>\n</ul>\n</blockquote>\n<p>2003-01-04  Derry Bryson  &lt;<a class=\"reference external\" href=\"mailto:dbryson&#37;&#52;&#48;techass&#46;com\">dbryson<span>&#64;</span>techass<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/decorate.c: Use the ShadowFactor rather than ShadowModule\ndefine in RaiseImage() (bug-fix).</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2004.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2004.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2004-12-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (DescribeImage): Add normalized channel\nstatistics to output.</li>\n<li>NEWS: Updated with changes since July.</li>\n<li>magick/constitute.c (ImportImagePixelArea): For GrayQuantum,\nGrayInvertedQuantum, GrayAlphaQuantum, and\nGrayInvertedAlphaQuantum, observe image storage_class so that a\ngray DirectClass image may be created.</li>\n<li>coders/tiff.c (ReadTIFFImage): Fix overflow when computing\ncolormap size for bits-per-sample of 32.\n(WriteTIFFImage): Support writing 32-bit RGB(A) for\nQuantumDepth=32 build.\n(ReadTIFFImage): Support reading 32-bit RGB(A) for QuantumDepth=32\nbuild.  Support reading 32-bit grayscale without any quality loss\nfor QuantumDepth=32 build.</li>\n</ul>\n</blockquote>\n<p>2004-12-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): TrueColor 16-bits/sample RGB\nimages were being written incorrectly on little-endian CPUs.\nAdded byte swapping to fix this problem.</li>\n</ul>\n</blockquote>\n<p>2004-12-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/operator.c: New file for quantum operator implementation.\n(QuantumOperatorImage): Moved from image.c.\n(QuantumOperatorRegionImage): Moved from from image.c.</li>\n</ul>\n</blockquote>\n<p>2004-12-22  Ralf Wildenhues  &lt;<a class=\"reference external\" href=\"mailto:Ralf&#46;Wildenhues&#37;&#52;&#48;gmx&#46;de\">Ralf<span>&#46;</span>Wildenhues<span>&#64;</span>gmx<span>&#46;</span>de</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/Makefile.am (MAGICK_BASE_SRCS): Remove mention of\nnon-existent mmath.h.</li>\n<li>configure.ac: AC_LIBTOOL_SETUP is an internal macro and must not\nbe used externally (will be pulled in automatically).</li>\n<li>PerlMagick/Makefile.am: Missing file needed to be committed to CVS.</li>\n<li>tests/Makefile.am (TESTS_TIFF_XFAIL_TESTS): EPT and PTIF tests\nare expected to fail if libtiff is missing.</li>\n</ul>\n</blockquote>\n<p>2004-12-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>TODO.txt: Organized todo list for 1.2 release.</li>\n</ul>\n</blockquote>\n<p>2004-12-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (WriteBMPImage): Handle the case where the image\nhas an over-sized colormap.  Was writing on unallocated heap memory.</li>\n<li>coders/dib.c (WriteDIBImage): Handle the case where the image\nhas an over-sized colormap.  Was writing on unallocated heap memory.</li>\n</ul>\n</blockquote>\n<p>2004-12-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gem.c (Modulate): Hue argument now represents a rotation\nfrom -180 degrees to +180 degrees expressed as an argument of 0 to\n2.0 (1.0 for no change). Note that this change also effects the\n-modulate argument and the Magick++ modulate method(). This change\nis made because the previous hue adjustment strategy only\nsucceeded in corrupting the image.</li>\n</ul>\n</blockquote>\n<p>2004-12-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (opendir): Ensure that data may not overwrite\nthe stack.\n(readdir): Ensure that data may not overwrite the stack.</li>\n<li>magick/blob.c (ImageToBlob): Ensure that image-&gt;logging is\nset prior to encoding image.</li>\n<li>magick/constitute.c (WriteImage): Ensure that image-&gt;logging is\nset prior to encoding image.</li>\n</ul>\n</blockquote>\n<p>2004-11-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>rungm.sh.in: Compute final variable definitions from within\nconfigure in order to improve MinGW test execution times.</li>\n</ul>\n</blockquote>\n<p>2004-11-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c: Fix two error-path memory leaks which were noticed\nby Glenn Randers-Pehrson.</li>\n</ul>\n</blockquote>\n<p>2004-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (UnregisterPNGImage): Eliminate Warning: module\nregistration for &quot;JNG&quot; from module &quot;PNG&quot; still present!</li>\n</ul>\n</blockquote>\n<p>2004-11-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (DispatchImage): Fix documentation error\nregarding return status.</li>\n</ul>\n</blockquote>\n<p>2004-11-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.h: Only define HAVE_GLOBALMEMORYSTATUSEX for MSVC\n7.0 and later.</li>\n</ul>\n</blockquote>\n<p>2004-11-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Ensure that words in the\nscanline are converted to little-endian format on little-endian\nCPUs.</li>\n</ul>\n</blockquote>\n<p>2004-11-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (MagickStrlCat): New function which is\nequivalent to to OpenBSD's strlcat() function.  Concatenates one\nstring onto another within a fixed size buffer while ensuring null\ntermination.\n(MagickStrlCpy): New function which is equivalent to OpenBSD's\nstrlcpy() function.  Copies a string into a fixed size buffer\nwhile ensuring null termination.</li>\n<li>coders/gif.c (DecodeImage): Improve handling of corrupt GIF\nfiles.  Resolves SourceForge bug #1042904.  Also, eliminate a\npotential memory leak.</li>\n<li>magick/constitute.c (WriteImages): ImageInfo argument is now a\nconst pointer.</li>\n</ul>\n</blockquote>\n<p>2004-10-26 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TracePath): Applied bugfix from Cristy.</li>\n</ul>\n</blockquote>\n<p>2004-10-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c (InitializeMagickResources): Use\nGlobalMemoryStatusEx if it is available.</li>\n<li>magick/nt_base.c (lt_dlopen): Handle errors while loading\nmodules rather than allow Windows to display a GUI dialog box.\n(NTKernelAPISupported): New function to support testing to see if\na Windows kernel API is supported.</li>\n<li>magick/constitute.c (ExportImagePixelArea): Add special-case for\nbilevel gray image in order to restore performance.\n(ImportImagePixelArea): Add special-case for bilevel gray image in\norder to restore performance.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Fix GCC warning about variable\nbeing clobbered by longjmp.</li>\n<li>Re-port build to MinGW. Modules build passes all tests.</li>\n<li>Skip build and install of modules if a key library is not available.</li>\n<li>Partial recode of metadata handling to use Get/Set profile\nfunctions.  Big job!</li>\n<li>GCC warnings reduction.</li>\n<li>Remove MVG detection from magic.mgk due to security risk.</li>\n</ul>\n</blockquote>\n<p>2004-09-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Properly detect and handle\nerrors reported by libtiff so that failure is reported rather than\nwriting a corrupted output file.\n(WriteNewsProfile): Re-write so implementation is easier to\nunderstand.</li>\n</ul>\n</blockquote>\n<p>2004-09-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c: Don't use deprecated tiff.h _SUPPORT defines.\nSupport retrieving and saving XMP profile.  Use profile set/get\nmethods in implementation.</li>\n<li>coders/mat.c,coders/topol.c (ReadBlobWordLSB,ReadBlobDoublesLSB):\nUse better variable name than <cite>I</cite> for image.</li>\n</ul>\n</blockquote>\n<p>2004-09-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (WriteMIFFImage): Ensure that MIFF files are never\nwritten with bogus compression values.</li>\n<li>magick/image.h: Protected/hid constants which only exist to\nsupport the library implementation.</li>\n<li>tests/Makefile.am (TESTS_X11_XFAIL_TESTS): Fixed syntax error.</li>\n<li>Makefile.am: Use one Makefile to rule them all as described in\nPeter Miller's excellent paper, Recursive Make Considered Harmful,\n&quot;<a class=\"reference external\" href=\"http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html\">http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html</a>&quot;.\nSome glitches may remain.</li>\n<li>coders/tiff.c (TIFFErrors): Prevent possible stack overflow on\nerror.\n(TIFFWarnings): Prevent possible stack overflow on error.</li>\n<li>magick/constitute.c (ImportImagePixelArea): For RGBQuantum\ninitialize the opacity channel since it is easier than altering\nall code to properly access it.</li>\n</ul>\n</blockquote>\n<p>2004-09-02  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/transform.c: Bugfix from Cristy in CoalesceImages().</li>\n</ul>\n</blockquote>\n<p>2004-08-26  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Avoid error introduced in libpng-1.2.6 that causes the encoder\nto write out-of-spec zlib header bytes.</li>\n</ul>\n</blockquote>\n<p>2004-08-24  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c is said to have a potential buffer overrun.\nPatch from Cristy applied (also to avi.c and dib.c).</li>\n</ul>\n</blockquote>\n<p>2004-08-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Use ExportImagePixelArea to\nwrite grayscale and colormapped output.</li>\n<li>magick/constitute.c (ImportImagePixelArea): Implemented support\nfor GrayInvertedQuantum &amp; GrayInvertedAlphaQuantum.\n(ExportImagePixelArea): Implemented support for\nGrayInvertedQuantum &amp; GrayInvertedAlphaQuantum.</li>\n<li>magick/constitute.h (enum QuantumType): Added\nGrayInvertedQuantum &amp; GrayInvertedAlphaQuantum to support\nmin-is-white gray images.</li>\n</ul>\n</blockquote>\n<p>2004-08-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/tiff/write.t: Adjusted file naming.</li>\n<li>PerlMagick/t/tiff/read.t: Added more tests.</li>\n<li>coders/tiff.c (ReadTIFFImage): Use ImportImagePixelArea to read\nPseudoClass tiff.\n(WriteTIFFImage): Allow user to set the bits-per-sample define to\nany value in the range of 1 to 32.\n(ReadTIFFImage): Fix endian-reordering for DirectClass read and\nbits-per-sample values ranging 9-15.</li>\n<li>coders/rgb.c: Support reading &amp; writing 32-bit depths for raw\nRGB images.</li>\n<li>coders/cmyk.c: Support reading &amp; writing 32-bit depths for raw CMYK\nimages.</li>\n<li>coders/gray.c: Support reading &amp; writing 32-bit depths for raw gray\nimages.</li>\n<li>magick/deprecate.c (PopImagePixels): Deprecated function.\n(PushImagePixels): Deprecated function.</li>\n<li>magick/constitute.c (ExportImagePixelArea): New function to\nexport pixel region using specified QuantumType and\nbits-per-sample.\n(ImportImagePixelArea): New function to import pixel region using\nspecified QuantumType and bits-per-sample.</li>\n</ul>\n</blockquote>\n<p>2004-08-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/cache.c (ClonePixelCache): It appeared that cloning a\ndisk-based pixel cache was limited to the maximum value of\nsize_t. This would result in a truncated cache.  The offset type\nis changed from size_t to magick_off_t in order to avoid this.</li>\n<li>configure.ac: Check to see if the <cite>char</cite> type is unsigned,\nmostly out of curiosity since the code does not currently make use\nof the result.</li>\n<li>Fixed many compilation warnings when the compiler warning level\nis set as high as possible.</li>\n<li>configure.ac: Check /usr/share/ghostscript/fonts for Ghostscript Type1\nfonts.</li>\n</ul>\n</blockquote>\n<p>2004-08-13  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tEXt and zTXt were inadvertently included in list of unused chunks.</li>\n</ul>\n</blockquote>\n<p>2004-08-09  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fix incorrect argument to png_set_keep_unknown_chunks().</li>\n</ul>\n</blockquote>\n<p>2004-08-07  David R. Linn  &lt;<a class=\"reference external\" href=\"mailto:drl&#37;&#52;&#48;vuse&#46;vanderbilt&#46;edu\">drl<span>&#64;</span>vuse<span>&#46;</span>vanderbilt<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/formats.html: Titles for JNG and MNG were reversed.</li>\n</ul>\n</blockquote>\n<p>2004-08-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/widget.c (XCommandWidget): Replace ImageMagick logo in\ndisplay command menu with GraphicsMagick logo.</li>\n</ul>\n</blockquote>\n<p>2004-08-05  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Fixes for CERT security alert TA04-217A described\nat &quot;<a class=\"reference external\" href=\"http://www.us-cert.gov/cas/techalerts/TA04-217A.html\">http://www.us-cert.gov/cas/techalerts/TA04-217A.html</a>&quot;.</li>\n</ul>\n</blockquote>\n<p>2004-08-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h (Image): Changed type of <cite>colors</cite> and <cite>depth</cite>\nmembers from type <cite>unsigned long</cite> to <cite>unsigned int</cite>. This change\nis made because on 64-bit CPUs, <cite>unsigned long</cite> is a 64-bit\ntype. The depth member is often used in switch statements.  It is\nnot recommended to use 64-bit types in switch statements.  The\nmaximum number of colors in the colormap is limited to 64K so a\n64-bit type is not required.</li>\n</ul>\n</blockquote>\n<p>2004-08-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Restore previous 8/16\nbits-per-sample support code in order to regain lost performance.</li>\n</ul>\n</blockquote>\n<p>2004-07-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Support reading RGB/CMYK scanline\noriented TIFF images with arbitrary depth.</li>\n</ul>\n</blockquote>\n<p>2004-07-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am:  Update to Automake 1.9.</li>\n</ul>\n</blockquote>\n<p>2004-07-20  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagickmagickGM_magick.bpr: Updated to reflect changes since last update.</li>\n<li>BCBMagickmagicklibMagick.bpr: Updated to reflect changes since last update.</li>\n<li>BCBMagickbzlibGM_bzlib.bpr: Updated version number.</li>\n<li>BCBMagicklcmsBCB6GM_lcms.bpr: Updated version number.</li>\n<li>BCBMagickMagickpplibGM_magickpp.bpr: Updated version number.</li>\n<li>BCBMagickttfGM_ttf.bpr: Updated version number.</li>\n<li>BCBMagickzlibGM_zlib.bpr: Updated version number.</li>\n<li>BCBMagick now support full LZW encoding (read/write).</li>\n</ul>\n</blockquote>\n<p>2004-07-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff/libtiff/tif_lzw.c: Replace with version which supports LZW encoding.</li>\n<li>magick/channel.c: New source file.\n(ExportImageChannel): New function to export an image channel.\n(ImportImageChannel): New function to import an image channel.</li>\n</ul>\n</blockquote>\n<p>2004-07-20  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lcms/src/cmsio1.c: Test [testcms.c] related to lcms 1.13 fail\nwith error #12288 when perform &quot;Checking saved linearization\ndevicelink&quot;.  Fixed function __cmsSaveProfile().  &quot;...malloc(0) is\nimplementation dependent and may return non NULL pointer on some\ncompilers, like VC++ and gcc. This is not the case of Borland C++\nBuilder&quot; - Thanks to Marti Maria that have supplied me this\npatched file: this will be part of the next lcms 1.14 which\nprobabily will be released on summer's end.</li>\n</ul>\n</blockquote>\n<p>2004-07-20  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lcms/include/lcms.h: Modified to achieve BCBMagick DLL compilation.\nIncluded modifications was introduced in GM in 2004-01-16 and\nprobabily lost with latest update of library.</li>\n</ul>\n</blockquote>\n<p>2004-07-20  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>BCBMagick: Updated lcms to version 1.13.</dt>\n<dd><ul class=\"first last\">\n<li>Modified files: BCBMagickAllbcbMagick.mak; BCBMagicklcmsBCB6GM_lcms.bpr;\nBCBMagicklcmsBCB6lcms.bpg; BCBMagicklcmsBCB6lcms.bpr;\nBCBMagicklcmsBCB6testcms.bpr</li>\n<li>Deleted files: BCBMagicklcmsBCB6lcms.cpp; BCBMagicklcmsBCB6testcms.cpp</li>\n<li>Added file: BCBMagicklcmsBCB6lcms.bpf</li>\n</ul>\n</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2004-07-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Fix typo regarding -define tiff:samples-per-pixel.</li>\n<li>doc/GNUmakefile (utility-install): Utility HTML targets were not being installed.</li>\n</ul>\n</blockquote>\n<p>2004-07-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lcms: Updated to version 1.13.</li>\n</ul>\n</blockquote>\n<p>2004-07-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh (CVS_BRANCH_TAG): Record the CVS branch tag that\nsource package is obtained from.</li>\n</ul>\n</blockquote>\n<p>2004-07-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Pass essential flags on down to subordinate\nconfigures when performing <cite>make distcheck</cite>.  Support DESTDIR\ninstalls for PERL 5.8.1 and later, which support DESTDIR\ninternally.</li>\n</ul>\n</blockquote>\n<p>2004-07-16  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>BCBMagickcoderslibCoders.bpr; BCBMagickmagickGM_magick.bpr: include</dt>\n<dd>file jbig.h could not be found during compilation. Solved.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2004-07-15  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagickmagickmagick_config.h.: enabled LZW compression by default.</li>\n<li><dl class=\"first docutils\">\n<dt>BCBMagick: included jbig delegate library.</dt>\n<dd><ul class=\"first last\">\n<li>Modified these files into directory BCBMagick: AllbcbMagick.mak;\nAllGMlib.bpg; AllGMdll.bpg; coderslibCoders.bpr; magickGM_magick.bpr;\nutilitiesgm_lib.bpr; utilitiesgm_dll.bpr</li>\n<li>Added these files into new directory BCBMagickjbig: jbig.bpr;\njbig.bpf; GM_jbig.bpr; GM_jbig.c; tstcodec.bpr</li>\n<li>Modified file jbigjbiglibjbig.h;</li>\n</ul>\n</dd>\n</dl>\n</li>\n<li>BCBMagickreadme.txt: updated documentation.</li>\n</ul>\n</blockquote>\n<p>2004-07-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyUsage): -ordered-dither help was\nformatted incorrectly.</li>\n<li>doc/options.imdoc: Improve formatting a bit for manual pages and\nfix some syntax errors.</li>\n</ul>\n</blockquote>\n<p>2004-07-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: Updated to reflect changes since last update.</li>\n</ul>\n</blockquote>\n<p>2004-07-09  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Removed if-test on reading\nred_mask, green_mask, and blue_mask.  These are only *valid*\nunder certain conditions, but they are always present in the\nfile.</li>\n</ul>\n</blockquote>\n<p>2004-07-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Enable LZW compression by default.</li>\n</ul>\n</blockquote>\n<p>2004-07-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (WriteJPEGImage): Don't enable Huffman compression\nfor large images (&gt; 16 Mpixels for the moment) in order to\nconserve memory.  When Huffman compression is enabled the entire\nimage is buffered in memory prior to encoding and writing\nanything.  Huffman compression is a method of eliminating\nredundant data so when the Huffman compression is disabled, files\nsizes will be larger, but otherwise the image is the same.</li>\n<li>wand/magick_wand.c (MagickSetPassphrase): String was being\ncopied to a null pointer.  Now memory is allocated as required\nprior to a copy.\nEnsure that all unimplemented functions return a proper error\nreport.</li>\n</ul>\n</blockquote>\n<p>2004-07-01  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagick: updated to GraphicsMagick v.1.2</li>\n<li>BCBMagickAll: project GMlib-1.1.bpr has been replaced with\nGMlib.bpr</li>\n<li>BCBMagickAll: project GMdll-1.1.bpr has been replaced with\nGMdll.bpr</li>\n<li>BCBMagickreadme.txt: updated documentation.</li>\n</ul>\n</blockquote>\n<p>2004-06-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): For -units, don't reset\nresolution if units are undefined. Report an error if the -units\nargument is not supported.</li>\n</ul>\n</blockquote>\n<p>2004-06-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): When setting image units, also\nadjust existing image x_resolution and y_resolution so that\nexisting image resolution is not trashed.\n(MogrifyImage): When re-sampling an image, report an error if the\nimage does not contain a valid resolution.</li>\n</ul>\n</blockquote>\n<p>2004-06-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcx.c (WritePCXImage): Support writing large PCX files.\n(WritePCXImage): Ensure that UndefinedResolution is handled\nproperly. Avoid round-off error for centimeter based resolution.</li>\n</ul>\n</blockquote>\n<p>2004-06-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Look for mozilla by default rather than netscape.</li>\n</ul>\n</blockquote>\n<p>2004-06-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/type.c (ReadTypeConfigureFile): Determine location of\nGhostscript fonts only once in order to improve performance.</li>\n<li>magick/nt_base.c (NTGhostscriptFonts): Properly determine\nGhostscript font location for Ghostscript 8.0 and later.</li>\n<li>GraphicsMagick.spec.in: Install *-config scripts with mode 755\nrather than default 644.</li>\n</ul>\n</blockquote>\n<p>2004-05-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/module.c (InitializeModuleSearchPath): Evaluate and cache\nmodule search path.\n(FindMagickModule): Use cached module search path.\n(OpenModules): Load all modules rather than just the modules in\nthe directory where the LOGO module is found.  Besides allowing\nuser-provided modules in non-GraphicsMagick directories to be\nloaded, this allows the &quot;moby&quot; shared build to load additional\nmodules via OpenModules.</li>\n</ul>\n</blockquote>\n<p>2004-05-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/Makefile.am (check): Add convert -list tests.</li>\n</ul>\n</blockquote>\n<p>2004-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Magick++ needs to be built as a static library\nunder Cygwin and MinGW since C++ exceptions don't work otherwise.\nBe more assertive about that.</li>\n<li>magick/nt_base.h: Avoid conflict with ssize_t definition under\nMinGW.</li>\n</ul>\n</blockquote>\n<p>2004-05-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (DispatchImage): Support 8-bit output to\ncommon formats BGR, BGRO, BGRP, RGB, RGBO, and I as special cases\nin order to improve performance.\n(ConstituteImage): Support 8-bit input from common formats BGR,\nBGRO, BGRP, RGB, RGBO, and I as special cases in order to improve\nperformance.</li>\n</ul>\n</blockquote>\n<p>2004-05-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ltmain.sh: Fix to allow exe wrapper to work under MinGW.</li>\n<li>wand/magick_compat.c (QueryMagickColor): Fixed DLL export.</li>\n<li>wand/magick_wand.c: Fixed some DLL exports (MagickExport-&gt;WandExport).</li>\n</ul>\n</blockquote>\n<p>2004-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageClipMask): Consistently report any\nexceptions to image-&gt;exception.</li>\n</ul>\n</blockquote>\n<p>2004-05-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Update to Automake 1.8.5.</li>\n<li>magick/image.h (ImageInfo): New <cite>progress</cite> monitor to indicate\nif progress monitor and busy cursor are enabled while displaying\nan image.  Defaults to True.</li>\n<li>magick/display.c, magick/xwindow.c: Use +progress to disable\nprogress monitor and busy cursor.</li>\n<li>magick/command.c (MogrifyUsage): Usage didn't list -operator.\n(ConvertUsage): Usage didn't list -operator.</li>\n</ul>\n</blockquote>\n<p>2004-05-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/compress.c (HuffmanDecodeImage): Properly return error status.\n(HuffmanEncode2Image): Properly return error status.</li>\n<li>magick/composite.c (CompositeImage): Properly return error status.</li>\n<li>magick/quantize.c (ClassifyImageColors): Properly return error status.\n(GetImageQuantizeError): Properly return error status.\n(OrderedDitherImage): Properly return error status.</li>\n<li>magick/profile.c (ProfileImage): Properly return error status.</li>\n<li>magick/paint.c (ColorFloodfillImage): Properly return error status.\n(MatteFloodfillImage): Properly return error status.\n(OpaqueImage): Properly return error status.\n(TransparentImage): Properly return error status.</li>\n<li>magick/enhance.c (ContrastImage): Properly return error status.\n(EqualizeImage): Properly return error status.\n(GammaImage): Properly return error status.\n(LevelImage): Properly return error status.\n(LevelImageChannel): Properly return error status.\n(ModulateImage): Properly return error status.\n(NegateImage): Properly return error status.\n(NormalizeImage): Properly return error status.</li>\n<li>magick/image.c (GetImageClipMask): New function to retrieve an\nassociated clip-mask image.\n(SetImageClipMask): Clip-mask image parameter may be const since\nit is cloned prior to storage.\n(ChannelImage): Properly return error status.\n(GradientImage): Properly return error status.\n(RGBTransformImage): Properly return error status.\n(TransformRGBImage): Properly return error status.\n(SyncImage): Return an error status.</li>\n<li>magick/enhance.c (NegateImage): If image has a clip mask,\nthen force image to DirectClass so clip mask takes effect.</li>\n</ul>\n</blockquote>\n<p>2004-05-15  Vladimir Lukianov  &lt;<a class=\"reference external\" href=\"mailto:lvm&#37;&#52;&#48;integrum&#46;ru\">lvm<span>&#64;</span>integrum<span>&#46;</span>ru</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageOpacity): Ensure that image is\nDirectClass. If specified opacity is TransparentOpacity, then\nreplace existing opacity with TransparentOpacity.</li>\n</ul>\n</blockquote>\n<p>2004-04-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Avoid duplicated test status messages for __func__\ntests.  Avoid duplicated test status message for jpeg 6b test.</li>\n</ul>\n</blockquote>\n<p>2004-04-19  Patrick Welche  &lt;<a class=\"reference external\" href=\"mailto:prlw1&#37;&#52;&#48;newn&#46;cam&#46;ac&#46;uk\">prlw1<span>&#64;</span>newn<span>&#46;</span>cam<span>&#46;</span>ac<span>&#46;</span>uk</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/header.html: HTML syntax fixes.</li>\n</ul>\n</blockquote>\n<p>2004-04-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>: Change web pages to a frames-based design.</li>\n</ul>\n</blockquote>\n<p>2004-04-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/Makefile.am (check): Change geometry arguments which\nwere expressed as 0.0xVAL to avoid the problematic Linux scanf\nfeature back to 0xVAL.</li>\n</ul>\n</blockquote>\n<p>2004-04-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/symbols.h (GetMagickDimension): Added GetMagickDimension.</li>\n</ul>\n</blockquote>\n<p>2004-04-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetMagickDimension): New function to replace\noccurances of scanf(geometry,&quot;%lfx%lf&quot;,&amp;w,&amp;h) since Linux scanf()\nand strtod() misbehave for strings that start with &quot;0x&quot;. The Linux\nversions always treat 0x as the start of a value expressed in hex\nand can't be forced to read the leading value as a double.  This\nfunction has been applied globally to replace the problem scanf's.</li>\n<li>magick/version.h.in: Make it clear in the -version output that a\nmutitude of copyrights and licenses apply to this software.</li>\n<li>magick/utility.c (GetPathComponent): Avoid strncpy() of\noverlapping regions.</li>\n<li>magick/command.c (DisplayImageCommand): Eliminate double-free\nof resource_info-&gt;image_geometry.\n(DisplayImageCommand): <cite>display</cite> was improperly requiring at least\none argument (bug was added yesterday).</li>\n</ul>\n</blockquote>\n<p>2004-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/gm.c (main): Default usage message wasn't right for\naliased utility.</li>\n<li>configure.ac: Added the --enable-magick-compat option to install\ncompatibility links to emulate ImageMagick commands.</li>\n<li>magick/command.c: Ensure that each sub-command responds to -help\nand -version appropriately.</li>\n<li>utilities/gm.c (main): Invoke appropriate sub-command if gm is\nexecuted under a traditional alternate name such as &quot;convert&quot;. The\nuser may create hard or symbolic links from <cite>gm</cite> to a traditional\nImageMagick utility name (or just copy <cite>gm</cite> to the desired\nsub-command name) in order to be 100% command-line compatible with\nImageMagick 5.5.2. This is necessary in order to work with\nexisting software designed to execute ImageMagick utilities.</li>\n</ul>\n</blockquote>\n<p>2004-04-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/compress.c (Ascii85Tuple): Encoding bug is indeed fixed\non DEC Alpha. Also warnings reduction with Digital Unix compiler.</li>\n</ul>\n</blockquote>\n<p>2004-04-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/compress.c (Ascii85Tuple): Add casts to reduce compiler\nwarnings, and maybe even fix a bug.</li>\n<li>coders/pdf.c (ReadPDFImage): Double-check that Ghostscript\nproduced an output file since sometimes it reports success after\nit has spewed an error message and has produced no output.</li>\n</ul>\n</blockquote>\n<p>2004-04-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/compress.c (HuffmanEncode2Image): Avoid out of bounds\narray access.</li>\n<li>magick/studio.h (_FILE_OFFSET_BITS): Fix _FILE_OFFSET_BITS\n#ifdef to avoid warnings when it is not defined.</li>\n</ul>\n</blockquote>\n<p>2004-04-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Fix minor shell syntax error (used ==).</li>\n</ul>\n</blockquote>\n<p>2004-04-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Merged in updates from 1.1 release branch.</li>\n<li>version.sh (PACKAGE_VERSION): Release version 1.1.\n(PACKAGE_VERSION): Next major release will be 1.1.  Bump library\nversions since we anticipate adding interfaces.</li>\n<li>magick/studio.h: Disabled use of Windows message lookups\nentirely since this doesn't seem to work for programs.  It\nprobably only works for DLLs like ImageMagickObject.</li>\n<li>magick/delegate.c (ListDelegateInfo): Don't get stuck in a loop\nif fprintf() returns zero.</li>\n</ul>\n</blockquote>\n<p>2004-04-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/*/*.bat: Add .exe to exe file names in order to\nensure that the executable is executed rather than something else\n(such as a batch script).</li>\n<li>magick/locale.c: Only use Windows resource message lookup for\nthe DLL build since it doesn't seem to work for static\nexecutables.</li>\n<li>magick/utility.c (SetClientPath): Ensure that client path is\nnull terminated.\n(SetClientFilename): Initialize default client filename to &quot;&quot;\nrather than &quot;gm.exe&quot; and ensure that filename is null terminated.\n(SetClientName): Ensure that client path is null terminated.</li>\n<li>magick/blob.c (GetConfigureBlob): Enable logging the load of\nlog.mgk</li>\n<li>magick/log.c: Re-designed logging initialization in order to\navoid the &quot;chicken and the egg&quot; snafu.  This allows logging the\ninitialization of the logging subsystem.</li>\n</ul>\n</blockquote>\n<p>2004-04-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/bin/log.mgk: Add comments to help document usage.</li>\n<li>config/log.mgk: Add comments to help document usage.</li>\n<li>magick/utility.c (IsAccessible): Use access() rather than stat().\n(IsAccessibleNoLogging): Use access() rather than stat().\n(IsDirectory): Implemented return status according to existing API\ndocumentation.\n(GetExecutionPathUsingName): Complete re-write in order to minimize\npath computation logic and fix failure with partial paths.</li>\n</ul>\n</blockquote>\n<p>2004-03-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Add &quot;Color&quot; to the arguments available for -list.</li>\n</ul>\n</blockquote>\n<p>2004-03-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh (PACKAGE_CHANGE_DATE): Updated version to 1.1Beta3</li>\n<li>magick/nt_base.c (NTSystemComman): Have not been successful with using\nMsgWaitForMultipleObjects() reliably, so back out usage of it for\nnow.</li>\n<li>magick/fx.c (ConvolveImage): Support convolution in CMYK\ncolorspace.</li>\n</ul>\n</blockquote>\n<p>2004-03-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh (PACKAGE_CHANGE_DATE): Update release to 1.1Beta2.</li>\n<li>magick/constitute.c (ReadImage): Ignore errors of type\nConfigureError when loading modules so that error report can still\nreport the familiar &quot;No delegate for this image format&quot; message\nwhile still being able to report problems with loading a module if\nit was found.  This is a compromise which reports useless messages\nwhen the modules are not found at all, but I can't think of a way\naround it.</li>\n<li>magick/nt_base.c (NTSystemComman): Adjust\nMsgWaitForMultipleObjects() arguments to wait for object to be\nsignaled only (FALSE) rather wait for object to be signaled as\nwell as an input event received(TRUE).  It seems that process\nstatus changes do not result in an input event, so the call was\ndeadlocking.</li>\n<li>magick/constitute.c (ReadImage): If module loading reported an\nerror, ReadImage immediately returned an error rather than trying\nto use a delegate defined by delegates.mgk.</li>\n</ul>\n</blockquote>\n<p>2004-03-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Updated version to 1.1Beta1</li>\n</ul>\n</blockquote>\n<p>2004-03-24  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagick/magick/libMagick.bpr: updated to latest source modifications.</li>\n<li>BCBMagick/magick/GM_Magick.bpr: updated to latest source modifications.</li>\n</ul>\n</blockquote>\n<p>2004-03-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/plasma.c (ReadPlasmaImage): srand() is already invoked by\nInitializeMagick() so don't call it here.</li>\n<li>configure.ac: Check for rand_r().</li>\n<li>magick/tempfile.c (ComposeTemporaryFileName): The full range of\nsafe characters was not being used, thereby limiting the number of\nunique temporary file names available.</li>\n</ul>\n</blockquote>\n<p>2004-03-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (GetImageStatistics): New function to obtain\nimage statistics (minimum, maximum, mean, variance, and standard\ndeviation).\n(DescribeImage): Include image channel statistics in verbose\noutput.</li>\n</ul>\n</blockquote>\n<p>2004-03-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (DispatchImage): Removed some unreachable\ncode that was accidentially left in the switch statement.</li>\n<li>magick/pixel_iterator.c (PixelIterateDualRead): Extended so that\nthe region in each image may use a different origin.\n(PixelIterateDualModify): Extended so that\nthe region in each image may use a different origin.</li>\n<li>magick/composite.c (CompositeImage): Fix XorCompositeOp overflow\ncondition which occured on non-Intel architectures.</li>\n</ul>\n</blockquote>\n<p>2004-03-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: Updated with changes up to today's date.</li>\n<li>tests/constitute.c (main): Float type seems to require allowing\na bit of error for Q:32.</li>\n<li>magick/constitute.c (DispatchImage): Be more careful when\nrounding pixel intensity.\n(ConstituteImage): Be more careful when converting float and\ndouble to Quantum.</li>\n<li>magick/composite.c (CompositeImage): Fix Multiply composite\noperator for Q:32 build (was all black image).\n(CompositeImage): Tidied up the documented composite operators so\nthe implementation is easier to understand.</li>\n<li>PerlMagick/t/ttf/read.t: Set a desired label size so output\nimage should be the same size as the reference image even if the\nFreeType type hinter is disabled.</li>\n<li>magick/annotate.c (RenderFreetype): Improve outline bounding box\ncomputation accuracy.</li>\n</ul>\n</blockquote>\n<p>2004-03-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/x/write.t: Don't test X11 if DISPLAY is not set.</li>\n<li>PerlMagick/t/x/read.t: Don't test X11 if DISPLAY is not set.</li>\n</ul>\n</blockquote>\n<p>2004-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/Makefile.am: Removed some apparently unnecessary library\ndependencies.</li>\n<li>Makefile.am (windows-src): Added a way to generate a Windows\nsource zip file.</li>\n</ul>\n</blockquote>\n<p>2004-03-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: The -operator command now supports\nfloating-point and percent of range arguments.</li>\n</ul>\n</blockquote>\n<p>2004-03-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Added support for -operator command with\nsyntax &quot;-operator channel operator rvalue&quot; which applies a\narithmetic or bitwise operator to a specified image channel\nor all channels.</li>\n</ul>\n</blockquote>\n<p>2004-03-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/filter.t: Fix Solarize test case.</li>\n<li>PerlMagick/t/wmf/read.t: Added another WMF test case.</li>\n<li>coders/wmf.c: Resolve WMF rendering bug with black color.</li>\n<li>magick/utility.c (StringToArgv): Free argv data prior to error\nreturn.</li>\n</ul>\n</blockquote>\n<p>2004-03-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (WriteJPEGImage): If image_info-&gt;colorspace is set\nto GRAYColorspace then make sure that image is in a gray\ncolorspace.</li>\n<li>magick/image.c (TransformRGBImage): If colorspace is already an\nRGB type (RGBColorspace, GRAYColorspace, or TransparentColorspace),\nthen simply return.  Do *not* set image-&gt;colorspace to RGBColorspace\nsince this potentially loses a valuable setting.</li>\n</ul>\n</blockquote>\n<p>2004-03-10  Peter Boos  &lt;<a class=\"reference external\" href=\"mailto:pedib&#37;&#52;&#48;colorfullife&#46;com\">pedib<span>&#64;</span>colorfullife<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c (RenderFreetype): If DrawAnnotation is called\nwith a string containing only one character and this character is\nnot recognized by the TrueType engine, a crash occured due to the\nfailure of FT_Load_Glyph. The failure caused an uninitialized\nglyph.image pointer to be used by FT_Done_Glyph() later in the\ncode. The solution is to initialize the glyph.image pointer to\nnull.</li>\n</ul>\n</blockquote>\n<p>2004-03-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (QuantumOperatorRegionImage): Properly handle\nover and underflow of arithmetic operators.</li>\n<li>magick/draw.c (DrawGetFillOpacity): Use fill opacity, and invert\nopacity range so it is 0.0 to 1.0 (was acting like transparency).\n(DrawSetStrokeOpacity): Validate range of stroke_opacity.\n(DrawSetFillOpacity): Save value to context-&gt;fill.opacity and\nvalidate the range of fill_opacity.</li>\n<li>magick/image.c (QuantumOperatorImage): New function to apply an\narithmetic or bitwise operator to the pixel quantums in an image.\n(QuantumOperatorRegionImage): New function to apply an arithmetic\nor bitwise operator to the pixel quantums in an image region.</li>\n<li>magick/image.c (IsImagesEqual): Re-implemented using the new\npixel iteration functions as a proof of concept.</li>\n<li>magick/pixel_iterator.h: Added some pixel iteration functions in\norder to make it easier to implement algorithms which only need to\niteratively access pixels in a region. These functions are not\npart of the API yet so their interface should be considered\nunstable.</li>\n<li>doc/GNUmakefile: Rename Makefile to GNUmakefile since it relies\non GNU make extensions.</li>\n</ul>\n</blockquote>\n<p>2004-03-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ConstituteImage): Add support for <cite>T</cite>\n(transparency) and <cite>O</cite> (opacity) map types.  Simplify\nimplementation.\n(DispatchImage): Add support for <cite>T</cite> (transparency) and <cite>O</cite>\n(opacity) map types.  Simplify implementation.</li>\n<li>config/delegates.mgk.in: Quote delegate command names so\nthat they can contain embedded spaces.</li>\n<li>VisualMagick/bin/delegates.mgk: Quote delegate command names so\nthat they can contain embedded spaces.</li>\n<li>coders/tiff.c (WriteTIFFImage): Use the libtiff default endian\nmode when writing TIFF rather than forcing MSB2LSB bit order.\n(ReadTIFFImage): Enable reading in MSB2LSB bit order (better for\nour byte-level parsing), enable memory mapping, and enable strip\nchopping.  Memory mapping and strip chopping are probably enabled\nby default.</li>\n<li>magick/nt_base.c (NTSystemComman): Use\nMsgWaitForMultipleObjects() rather than WaitForSingleObject() in\norder to avoid possible deadlock when application code directly or\nindirectly creates windows.</li>\n</ul>\n</blockquote>\n<p>2004-02-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/animate.c (XMagickCommand): URL should point to\n<a class=\"reference external\" href=\"http://graphicsmagick.org/\">http://graphicsmagick.org/</a>.</li>\n<li>magick/display.c (XMagickCommand): URL should point to\n<a class=\"reference external\" href=\"http://graphicsmagick.org/\">http://graphicsmagick.org/</a>.</li>\n<li>magick/image.c (DisplayImages): Changes to fix memory leaks in\nX11 commands had bugs which seriously broke DisplayImages.  Now\nDisplayImages works properly again.</li>\n<li>magick/xwindow.c (XDestroyResourceInfo): New function to destroy\nXResourceInfo.</li>\n<li>coders/x.c (WriteXImage): Implement based on DisplayImages().\n(RegisterXImage): Always register X coder, but with read/write\nsupport disabled if X11 not available.</li>\n</ul>\n</blockquote>\n<p>2004-02-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (ImportImageCommand): Eliminate memory leaks.</li>\n<li>magick/memory.c (LiberateMemory): Use MagickFreeMemory macro for\nimplementation.\n(ReacquireMemory): Use MagickReallocMemory macro for\nimplementation.\n(AcquireMemory): Use MagickAllocateMemory for implementation.</li>\n</ul>\n</blockquote>\n<p>2004-02-26  Vladimir  &lt;<a class=\"reference external\" href=\"mailto:lvm&#37;&#52;&#48;integrum&#46;ru\">lvm<span>&#64;</span>integrum<span>&#46;</span>ru</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/memory.c (CloneMemory): Fixes to compile under Microsoft\nVisual C++ 6.0.</li>\n</ul>\n</blockquote>\n<p>2004-02-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/animate.c (XAnimateImages): Memory leak reduction and\nbetter integration with gm command.</li>\n<li>magick/display.c (XDisplayImage): Display was leaking memory\nlike a sieve.  Now it doesn't.</li>\n<li>magick/memory.c (CloneMemory): Computation for when it is safe\nto use memcpy() was incorrect.  Use memmove() rather than\nbackwards-copy loop.</li>\n<li>Makefile.am ($(DIST_ARCHIVE_SRPM)): Added rules to build a\nsource RPM.</li>\n<li>configure.ac: Search for <cite>buildrpm</cite> or <cite>rpm</cite> programs in order to\nsupport creating RPM packages on a system which has RPM installed.</li>\n<li>version.sh (PACKAGE_VERSION): Changed snapshot release naming so\nthat there is only one dash in the name and the snapshot date is\nprefixed with <cite>0</cite> to assure proper directory sorting.  This allows\nsnapshot naming to be acceptable to RPM.  The snapshot package\nname is now similar to GraphicsMagick-1.1.020040218.tar.bz2</li>\n</ul>\n</blockquote>\n<p>2004-02-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (RegisterXWDImage): Always register XWD, but only\nregister read/write methods if it is supported.</li>\n<li>wand/magick_wand.c: Synchronized with latest ImageMagick API\nchanges.</li>\n</ul>\n</blockquote>\n<p>2004-02-16  Lars Ruben Skyum  &lt;<a class=\"reference external\" href=\"mailto:lars&#46;skyum&#37;&#52;&#48;stibo&#46;com\">lars<span>&#46;</span>skyum<span>&#64;</span>stibo<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (HorizontalFilter): Fixed: do process K channel\nfor CMYK images.\n(VerticalFilter): do process K channel for CMYK images.</li>\n</ul>\n</blockquote>\n<p>2004-02-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tga.c (ReadTGAImage): Fix matte channel handling. For\n16-bit packets, use integer rather than floating point. Return\ngray images as PseudoClass and set is_grayscale flag.  Add\nlogging.</li>\n<li>magick/fx.c (WaveImage): Ensure that image is\nDirectClass. Ensure that matte channel is initialized if\nnecessary. Include background color in is_grayscale evaluation.</li>\n<li>magick/gem.c (GenerateNoise): Scale noise to range of quantum.</li>\n</ul>\n</blockquote>\n<p>2004-02-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (WriteJP2Image): Support passing all documented\nJasper options using -define.</li>\n</ul>\n</blockquote>\n<p>2004-02-13  Peter Boos  &lt;<a class=\"reference external\" href=\"mailto:pedib&#37;&#52;&#48;colorfullife&#46;com\">pedib<span>&#64;</span>colorfullife<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c (util_draw_arc): Fixes to improve handling for pie,\narc, and chord.  These fixes produce correct output for\nwmf/examples/fjftest.wmf, but it is not known if they are correct\nfor all cases.</li>\n</ul>\n</blockquote>\n<p>2004-02-12  Tim Hunter  &lt;<a class=\"reference external\" href=\"mailto:cyclists&#37;&#52;&#48;nc&#46;rr&#46;com\">cyclists<span>&#64;</span>nc<span>&#46;</span>rr<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/profile.c (SetImageProfile): Bug fixes.</li>\n</ul>\n</blockquote>\n<p>2004-02-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (UnregisterXPMImage): Unregister PICON registration.</li>\n</ul>\n</blockquote>\n<p>2004-02-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/Makefile.am (label_la_LDFLAGS): Add a dependency on the\nmath library since floor() is used.</li>\n<li>wand/magick_wand.c (MagickRemoveImageProfile): Use C comments in\nC files.</li>\n<li>magick/constitute.c (MapQuantumType): Fix spurious comma in\nenum definition.</li>\n<li>magick/blob.c (GetBlobStreamHandler): Apparently return type can\nnot be const.</li>\n</ul>\n</blockquote>\n<p>2004-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Check for Windows fonts under\n/usr/X11R6/lib/X11/fonts/truetype (XFree86 standard location?).</li>\n<li>coders/jp2.c (WriteJP2Image): Support providing a compression\nrate value (range 0.0 to 1.0) using command line syntax similar to\n<cite>-define jp2:rate=0.5</cite>.  In Magick++ this option may be accessed\nsimilar to image.defineValue(&quot;jp2&quot;,&quot;rate&quot;,&quot;0.5&quot;);</li>\n<li>magick/command.c (DisplayImageCommand): Exit status was inverted\nso <cite>gm display</cite> was returning 1 for successful commands, and 0 for\nfailures.\n(AnimateImageCommand): Exit status was inverted so <cite>gm animate</cite>\nwas returning 1 for successful commands, and 0 for failures.</li>\n</ul>\n</blockquote>\n<p>2004-02-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.h (MagickReallocMemory): Solaris compiler\ncomplains about cast so remove it.</li>\n<li>coders/xwd.c (WriteXWDImage): Right-size the pixels buffer and\ntune writer loops a bit.</li>\n<li>magick/color.h (VerifyColormapIndex): Improve diagnostics.</li>\n<li>coders/pict.c (WritePICTImage): Eliminate use of uninitialized\ndata when writing RGB PICT. Fix OpenBlob assertion when writing\nJPEG PICT.\n(ReadPICTImage): Validate <cite>tile_image</cite> colormap indexes rather\nthan <cite>image</cite> colormap indexes. Preserve compression attribute from\ntile image.</li>\n<li>magick/constitute.c (DispatchImage): Don't access image opacity\nchannel unless image-&gt;matte is True.</li>\n</ul>\n</blockquote>\n<p>2004-02-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (UnregisterPNGImage): Destroy PNG semaphore.</li>\n<li>magick/image.c (SetImageInfo): Since we don't know what the\n&quot;IMPLICIT&quot; specifier is supposed to do, support for it is\nremoved. Perhaps by removing support for it, we will be reminded\nwhy it exists.</li>\n<li>magick/magick.c (DestroyMagickInfo): Invoke\nUnregisterStaticModules().\n(GetMagickInfo): Remove registration for &quot;IMPLICIT&quot; format since\nits purpose is presumed bogus.</li>\n<li>magick/static.c (UnregisterStaticModules): New function so we\ncan unregister static modules.</li>\n<li>coders/plasma.c (UnregisterPLASMAImage): Unregister FRACTAL.</li>\n<li>coders/icon.c (UnregisterICONImage): Unregister CUR.</li>\n<li>coders/bmp.c (UnregisterBMPImage): Unregister BMP2 and BMP3.</li>\n<li>coders/meta.c (UnregisterMETAImage): Unregister APP1JPEG, IPTC,\nIPTCTEXT, IPTCWTEXT, and PICON.</li>\n<li>coders/miff.c: Check for run-length termination before testing\nmemory and only check opacity channel if matte is valid.</li>\n<li>magick/compress.c: Check for run-length termination before\ntesting memory (bad read error).</li>\n</ul>\n</blockquote>\n<p>2004-02-07  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c: Fix off-by-one error while initializing padding bytes.</li>\n<li>coders/dib.c: Fix off-by-one error while initializing padding bytes.</li>\n<li>magick/enhance.c: MaxMap vs MaxRGB error fixed.  Reported by Cristy.</li>\n</ul>\n</blockquote>\n<p>2004-02-04  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/compress.c:  avoid a reference to uninitialized data.</li>\n</ul>\n</blockquote>\n<p>2004-02-04  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c: initialize padding bytes.</li>\n</ul>\n</blockquote>\n<p>2004-02-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/montage.c (MontageImages): Fix leak of texture image (big\nleak).</li>\n</ul>\n</blockquote>\n<p>2004-02-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Fix detection of when to use a\ntemporary file when writing TIFF.  Writing to TIFF BLOBs was\nbroken by the recent changes to make BlobInfo a private type.</li>\n<li>magick/render.c (DestroyEdge): Use memmove for overlapping copy.</li>\n</ul>\n</blockquote>\n<p>2004-02-03  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c: initialize padding bytes.</li>\n</ul>\n</blockquote>\n<p>2004-02-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ConstituteImage): Added map support for <cite>P</cite>,\nin order to skip over a pad quantum.\n(DispatchImage): Added map support for <cite>P</cite>, in order to write a pad\nquantum.</li>\n<li>magick/resize.c (HorizontalFilter): Don't process opacity\nchannel unless matte is enabled.\n(VerticalFilter): Don't process opacity channel unless matte is\nenabled.</li>\n<li>magick/compress.c (Ascii85Initialize): Don't overwrite an\nexisting ascii85 allocation.</li>\n<li>magick/utility.c (Strip): Use <cite>memmove</cite> rather than <cite>memcpy</cite> to\ncopy overlapping data.</li>\n<li>tests/rwfile.c (main): Fix memory leak in test. Only apply size\nif format requires it.</li>\n<li>tests/rwblob.c (main): Fix memory leak in test. Only apply size\nif format requires it.</li>\n<li>coders/mono.c (RegisterMONOImage): Mono is a raw format.</li>\n<li>magick/magic.c (GetMagicInfo): Ensure that magic tests are\nwithin the range of header data which was read.</li>\n</ul>\n</blockquote>\n<p>2004-02-02  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c: fix potential use of uninitialized data.</li>\n<li>coders/png.c: fix potential use of uninitialized data.</li>\n</ul>\n</blockquote>\n<p>2004-01-31  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h: Fixed problem related to DLL version of BCBMagick.\nSometimes was incorrectly checked the presence of VC++ DLL. Thanks\nvery much to Oliver Bertini for bringing this problem to our attention.</li>\n<li>BCBMagick: added libpng delegate library in both static and DLL\nmodes.</li>\n<li>BCBMagick: removed all unuseful files from CVS.</li>\n</ul>\n</blockquote>\n<p>2004-01-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (CloneDrawInfo): Fixed nasty memory leak which\nbecomes painfully evident when using Magick++.</li>\n<li>magick/type.c (ReadTypeConfigureFile): Fix problem with parsing\n&lt;include&gt; directive.</li>\n<li>configure.ac: The type.mgk generated had a syntax error.</li>\n<li>magick/effect.c (SpreadImage): Eliminate read from uninitialized\nmemory.</li>\n<li>magick/quantize.c (NodeInfo): Store nodes in a list similar to\nImageMagick.\n(DestroyCubeInfo): Eliminate a small memory leak.</li>\n</ul>\n</blockquote>\n<p>2004-01-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/montage.c (MontageImages): Free thumbnails once they are\nno longer needed (big leak).</li>\n<li>magick/blob.c (OpenBlob): Ensure that magick array is\nfully initialized, even if the fread() is short.</li>\n<li>magick/list.c (ImageListToArray): Add a null pointer to the end\nof the image list to serve as a handy list terminator.</li>\n<li>magick/tempfile.c (DestroyTemporaryFiles): Fix memory leak of\nsemaphore.</li>\n<li>magick/map.c (MagickMapDeallocateMap): Fix memory leak of\nsemaphore.</li>\n<li>coders/png.c (WriteOneJNGImage): Use DestroyBlob.</li>\n<li>magick/list.c (SyncNextImageInList): Use DestroyBlob.</li>\n<li>magick/image.c (AllocateNextImage): Use DestroyBlob.\n(DestroyImage): DestroyBlob.</li>\n<li>coders/wpg.c (ExtractPostscript): Use DestroyBlob.</li>\n<li>magick/blob.c (DestroyBlob): New function. Similar to\nDestroyBlobInfo except that it requires an Image * argument and\nzeros the blob pointer. This one is preferred for use over\nDestroyBlobInfo.</li>\n</ul>\n</blockquote>\n<p>2004-01-27  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Add DestroyBlobInfo() calls to stop memory leak when\nprocessing JNG datastreams.</li>\n</ul>\n</blockquote>\n<p>2004-01-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.h (MagickReallocMemory): Added a cast required to\nmake C++ Happy.</li>\n<li>coders/tiff.c: Adjust for bitstream API function renaming.</li>\n<li>magick/bit_stream.h: Rename BitStreamRead() to\nBitStreamMSBRead() to indicate that it reads most significant bytes\nfirst (&quot;big endian&quot; order).  Rename BitStreamWrite() to\nBitStreamMSBWrite() to indicate that it writes most significant\nbytes first (&quot;big endian&quot; order).</li>\n<li>wand/magick_wand.c: Updated to lastest ImageMagick API.</li>\n</ul>\n</blockquote>\n<p>2004-01-26  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/stream.c: (SetPixelStream) removed &quot;const&quot; from definition of\nlocal variable [StreamHandler stream]. Borland C++Builder compiler signal\nerror &quot;Cannot modify a const object&quot;.</li>\n</ul>\n</blockquote>\n<p>2004-01-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (TIFFMapBlob): Allow libtiff to access memory\nmapped file (or BLOB in memory) directly.  This provides a small\nperformance increase.</li>\n<li>magick/constitute.c (ReadImage): If a .mpc file is a temporary\nfile, then be sure to remove the associated .cache file when\nremoving the .mpc file.</li>\n<li>magick/log.h (LogEventType): ExceptionEventMask now maps to\nWarningEventMask|ErrorEventMask|FatalErrorEventMask so that\n<cite>-debug exception</cite> works again.</li>\n<li>magick/blob.c (CloseBlob): Allow CloseBlob to be invoked on a\nblob which is not open (in UndefinedStream state).\n(BlobInfo): The definition of BlobInfo is now private to blob.c.\n(StreamType): The StreamType enumeration is now private to blob.c.\n(GetBlobFileHandle): New function to access the blob file handle.\n(GetBlobStreamHandler): New function to access the blob stream\nhandler.\n(GetBlobStreamType): This function is removed entirely.\n(BlobIsSeekable): New function to test if SeekBlob will work\nproperly for this blob type.\n(GetBlobClosable): New function to test if the blob is allowed to\nbe closed by the library (may be an externally provided file\ndescriptor).\n(GetBlobTemporary): New function to test if input file is a\ntemporary file which is to be removed.\n(SetBlobClosable): New function to support setting the flag which\nkeeps the input file from being closed.\n(SetBlobTemporary): New function to support setting the flag which\nindicates that the input file is a temporary file.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Invoke CloseBlob even if\nblob is in UndefinedStream state.</li>\n<li>magick/error.h (ThrowReaderException): Ditto.\n(ThrowWriterException): Ditto.\n(ThrowWriterException2): Ditto.\n(ThrowWriterException3): Ditto.</li>\n<li>magick/tempfile.h (ThrowReaderTemporaryFileException): Ditto.\n(ThrowWriterTemporaryFileException): Ditto.</li>\n<li>coders/dps.c,coders/jpeg.c, coders/meta.c, coders/mvg.c,\ncoders/png.c, coders/tiff.c, magick/constitute.c, magick/stream.c:\nUse new blob accessor functions.</li>\n<li>magick/cache.c (OpenCache): For Windows, set the sequential\naccess flag in all cases.  Maybe it will make a difference.</li>\n</ul>\n</blockquote>\n<p>2004-01-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (GetConfigureBlob): Don't check Windows registry\nif MagickLibConfigPath or MagickShareConfigPath is defined.</li>\n<li>magick/locale.c: Use a Unix-style message database for MinGW.</li>\n<li>rungm.sh.in: Translate environment paths to Windows format when\nrunning under MinGW.</li>\n<li>magick/nt_base.c (mmap): Re-wrote mmap emulation to support\n64-bit file offsets and to support anonymous mapping.\n(msync): A crude emulation of Unix msync().</li>\n<li>acinclude.m4 (GM_FUNC_MMAP_FILEIO): Change result define from\nHAVE_MMAP to HAVE_MMAP_FILEIO so that it doesn't conflict with\nAutoconf standard definition.</li>\n</ul>\n</blockquote>\n<p>2004-01-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/cache.c (OpenCache): While allocating the pixel cache\nfrom the heap, reserve enough memory to contain a full PseudoClass\nimage in order to reduce the chance that there will be a memory\nallocation failure while processing the image. This also avoids\nthe possibility that the image pixels will be block-copied to a\nnew location due to heap memory fragmentation. If there is\ninsufficient heap memory (malloc() fails), then a disk-based pixel\ncache will be used.</li>\n<li>coders/wpg.c: Backed out Jaroslav Fojtik's patch from 2004-01-13\nbecause WPG was failing PerlMagick's existing WPG read test.</li>\n</ul>\n</blockquote>\n<p>2004-01-16  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagick: updated to recent Windows delegate libraries.</li>\n<li>BCBMagick: modified build procedure. Removed all unused directories\nand include files.</li>\n<li>lcms/include/lcms.h: Modified to achieve BCBMagick compilation.</li>\n<li>tiff/libtiff/tiffio.h: Modified to achieve BCBMagick compilation</li>\n<li>ttf/include/freetype/config/ftoption.h: Modified to achieve\nBCBMagick compilation</li>\n<li>Magick++/lib/Magick++/Include.h: Modified to achieve BCBMagick compilation.</li>\n</ul>\n</blockquote>\n<p>2004-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c: Applied patch from Jaroslav Fojtik to support\nreading the CTM (current transform matrix).  The CTM is not\napplied yet (expect later patch).</li>\n</ul>\n</blockquote>\n<p>2004-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sfw.c (ReadSFWImage): Added size_t cast.</li>\n<li>coders/msl.c (MSLStartElement): Added size_t cast.</li>\n<li>coders/meta.c (convertHTMLcodes): Added size_t cast.</li>\n<li>coders/locale.c: Add size_t casts and update to use memory\nallocation macros.</li>\n<li>coders/html.c (WriteHTMLImage): Added size_t cast.</li>\n<li>magick/utility.h (MagickAllocateMemory): Added size_t cast.\n(MagickReallocMemory): Added size_t cast.</li>\n<li>coders/bmp.c (WriteBMPImage): Added size_t cast.</li>\n<li>coders/art.c (ReadARTImage): Use memory allocation macros.</li>\n<li>VisualMagick/configure/configure.cpp: Update to support library\n.def exports files with Visual C++ 7.0.</li>\n<li>Updated Windows delegate libraries: LCMS 1.12, FreeType 2.1.5,\nBIG-KIT 1.5, libpng 1.2.5, libwmf 0.2.8.2, and zlib 1.2.1.</li>\n<li>Verified Windows static and DLL compilation with Visual C++ 6.0.</li>\n<li>Makefile.am: Update to automake 1.8.2.</li>\n<li>coders/gif.c (WriteGIFImage): Use ColorMatch rather than\nFuzzyColorMatch when comparing colormap entries.</li>\n</ul>\n</blockquote>\n<p>2004-01-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/profile.c: Needed to include &quot;magick/profile.h&quot; in order\nto obtain prototypes.</li>\n</ul>\n</blockquote>\n<p>2004-01-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/wandtest.c: Change MagickCloneWand to MagickGetImage since\nthe API name changed.</li>\n<li>wand/pixel_wand.c: Synchronized with\nlatest daily ImageMagick updates.</li>\n<li>wand/magick_wand.c (MagickRemoveImageProfile): Synchronized with\nlatest daily ImageMagick updates.</li>\n<li>magick/profile.c (DeleteImageProfile): New method to make\nit easier to destroy an image profile.</li>\n<li>magick/profile.h: New source file to contain functions for\ndealing with embedded image profiles.</li>\n<li>magick/profile.c: New source file to contain functions for\ndealing with embedded image profiles.</li>\n<li>Makefile.am (DISTDIRS): Distribute TclMagick subdirectory.</li>\n</ul>\n</blockquote>\n<p>2004-01-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c: Ported over the latest ImageMagick Wand API\nupdates.  Note that a comment now says that the Wand API will not\nbe finished until around 4th quarter of 2004.  This represents a\n1-1/2 year slip from the original estimate!</li>\n</ul>\n</blockquote>\n<p>2004-01-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (IsImagesEqual): Simplified implementation.</li>\n<li>magick/magick.c: Removed some unused code.</li>\n<li>contrib/win32/ATL7/ImageMagickObject/ImageMagickObject.cpp\n(IDispatch): Comment out InitializeSemaphore() so code compiles.</li>\n<li>libtool.m4: Updated to 2004-01-03 version of CVS libtool. This\nshould fix configure problems under AIX and IRIX.</li>\n</ul>\n</blockquote>\n<p>2004-01-03  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:randeg&#37;&#52;&#48;alum&#46;rpi&#46;edu\">randeg<span>&#64;</span>alum<span>&#46;</span>rpi<span>&#46;</span>edu</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c: opacity channel was lost when writing grayscale\nSGI images.  See bug report in magick-users list.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2005.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2005.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2005-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff: Update to libtiff 3.8.0.</li>\n</ul>\n</blockquote>\n<p>2005-12-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: Updated with latest changes.</li>\n<li>tiff: Update to libtiff 3.7.4.</li>\n</ul>\n</blockquote>\n<p>2005-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lcms: Update to lcms 1.15.</li>\n</ul>\n</blockquote>\n<p>2005-12-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enhance.c (LevelImage): Fix -level command parsing when a\npercent symbol is supplied within the argument rather than at the\nend.</li>\n<li>magick/utility.c (GetGeometry): Bounds-check geometry string\nlength.</li>\n</ul>\n</blockquote>\n<p>2005-12-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Decided to swap 10-bit subsampled 4:2:2 YCbCr by\ndefault since this is what practically all sample files I have\nbeen provided actually do.  Ignore the fact that there is nothing\nin the standard which supports this.</li>\n</ul>\n</blockquote>\n<p>2005-12-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (NormalizeSamplingFactor): Generalized\nsubsampling notation parsing support.</li>\n</ul>\n</blockquote>\n<p>2005-12-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (NormalizeSamplingFactor): Add some support for\nnormalizing industry-standard subsampling notation (e.g. 4:2:2)\ninto GraphicsMagick's unusual notation.</li>\n</ul>\n</blockquote>\n<p>2005-12-06  Ralf Wildenhues  &lt;<a class=\"reference external\" href=\"mailto:Ralf&#46;Wildenhues&#37;&#52;&#48;gmx&#46;de\">Ralf<span>&#46;</span>Wildenhues<span>&#64;</span>gmx<span>&#46;</span>de</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updates to use latest development autotools, including\ndevelopment libtool 2.0.</li>\n</ul>\n</blockquote>\n<p>2005-12-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h: Added some useful macros for accessing\nPixelPacket members in a generic way.</li>\n<li>coders/dpx.c (ReadDPXImage): For YCbCr with <cite>A</cite> sample, <cite>A</cite>\nsample levels are like Luma.\n(WriteDPXImage): For YCbCr with <cite>A</cite> sample, <cite>A</cite> sample levels are\nlike Luma.</li>\n</ul>\n</blockquote>\n<p>2005-12-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (RegisterTIFFImage): Report libtiff release\nversion rather than ABI version.</li>\n</ul>\n</blockquote>\n<p>2005-11-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c: Revert yesterday's benign-appearing edits since\nthey caused a bizzare bug.</li>\n</ul>\n</blockquote>\n<p>2005-11-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Improve performance when reading\nYCbCr files.  Handle files which use Printing Density on top of\nYCbCr.  Default YCbCr to Rec.709 if the transfer characteristic is\nUser Defined.</li>\n<li>coders/pcd.c (Upsample): Moved Upsample from gem.c to here since\nPCD is the only user and it is not a general purpose function.</li>\n</ul>\n</blockquote>\n<p>2005-11-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/magick/magick_config.h.in: Remove unnecessary test\nfor WIN32.</li>\n</ul>\n</blockquote>\n<p>2005-11-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_compat.c (FormatMagickStringList): MagickExport since this\nfunction is used by Ch extension.</li>\n<li>magick/log.c (LogMagickEventList): MagickExport since this\nfunction is used by Ch extension.</li>\n<li>magick/utility.c (FormatStringList): MagickExport since this\nfunction is used by Ch extension.</li>\n<li>coders/dpx.c (ReadDPXImage): Added support for dpx:swap-samples\ndefine in order to handle files with Cb and Cr swapped.  Fixed a\nbug in the header reading which caused some valid files to fail to\nread at all.\n(WriteDPXImage): Added support for dpx:swap-samples define in\norder to write files with Cb and Cr swapped.</li>\n<li>magick/profile.c (ProfileImage): Add support for ICC CMS\nprofiles in YCbCr space.</li>\n</ul>\n</blockquote>\n<p>2005-10-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (ReadSVGImage): Eliminate memory leak.</li>\n</ul>\n</blockquote>\n<p>2005-10-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h (Image): Added an orientation member to the Image\nstructure to record image orientation for the DPX, and TIFF\nformats. Eventually formats which support IPTC and EXIF embedded\nprofiles should be supported by the orientation member as well.</li>\n</ul>\n</blockquote>\n<p>2005-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/magick/magick_types.h.in: Add patch for Ch.</li>\n<li>magick/command.c (TransmogrifyImage): Complete re-write of\nmogrify file handling.  Former version wrote to a temporary file\nand then moved temporary file to replace original if necessary.\nNew version moves an existing writable file to a backup file with\ntilde (<cite>~</cite>) added to end of file name, writes to the final output\nfile name, and removes the backup file on success.  The new\napproach satisfies formats which embed the output name in the file\n(e.g. the DPX format) and still works when the output file exists\nand is writeable, but is in non-writeable directory.  The previous\napproach would fail if the output file exists and is writable, but\nthe directory is not writeable.</li>\n</ul>\n</blockquote>\n<p>2005-10-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (AttributeToString): Use strncpy rather than\nstrlcpy to copy string.  This is important since DPX header\nstrings are not null terminated and may need to fill all available\nspace.  Certain short header fields like mp.film.manufacturer.id,\nmp.film.type, and mp.perfs.offset were being truncated!</li>\n</ul>\n</blockquote>\n<p>2005-09-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GetImageAttribute): Add more general support\nfor retrieving wildcarded attributes so that an identify -format\nspecification like <cite>%[dpx:*]</cite> works as expected.</li>\n<li>coders/tiff.c (WriteTIFFImage): Transform quality value into zip\ncompression quality level similar to what is done for MIFF/MNG/PNG.\nSince default quality value is 75, this means that the default zip\nquality level is 7.</li>\n</ul>\n</blockquote>\n<p>2005-09-24  Peter Wu  &lt;<a class=\"reference external\" href=\"mailto:peterw&#37;&#52;&#48;softintegration&#46;com\">peterw<span>&#64;</span>softintegration<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Incorporate changes necessary so that GraphicsMagick can work\nwith the Ch C/C++ interpreter from SoftIntegration at\n<a class=\"reference external\" href=\"http://www.softintegration.com/\">http://www.softintegration.com/</a>.</li>\n</ul>\n</blockquote>\n<p>2005-09-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c: Incorporate all functionality from\ncache.c, cache_view.c, and stream.c so that all private interfaces\ncan be fully hidden.  As a result cache.c, cache_view.c, and\nstream.c are now removed.</li>\n</ul>\n</blockquote>\n<p>2005-09-18  Michal Kowalczuk  &lt;<a class=\"reference external\" href=\"mailto:sammael&#37;&#52;&#48;brzydal&#46;eu&#46;org\">sammael<span>&#64;</span>brzydal<span>&#46;</span>eu<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c: Free global_colormap before returning with error.</li>\n</ul>\n</blockquote>\n<p>2005-09-18  Stepan Kasal  &lt;<a class=\"reference external\" href=\"mailto:kasal&#37;&#52;&#48;ucw&#46;cz\">kasal<span>&#64;</span>ucw<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (BUILT_SOURCES): Removed.</li>\n<li>magick/Makefile.am (MAGICK_BUILT_SRCS): Removed, too.</li>\n</ul>\n</blockquote>\n<p>2005-09-12 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/profile.c (ProfileImage):  Free color_profile-&gt;name\nand iptc_profile-&gt;name when destroying the profile.</li>\n</ul>\n</blockquote>\n<p>2005-08-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/api.h: Eliminate requirement to include certain system\nheaders prior to including &lt;magick/api.h&gt;.</li>\n<li>utilities/gm.c: Move utility implementation to GMCommand() in\ncommand.c</li>\n</ul>\n</blockquote>\n<p>2005-08-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Added support for reading and writing DPX Luma\nfiles using proper video levels.</li>\n<li>magick/colorspace.h (enum ColorspaceType): Decided that\nGRAYColorspace should be reserved for full-range grayscale data\nwhile Rec601LumaColorspace and Rec709LumaColorspace should be for\nvideo colorspaces.  Therefore, GRAYColorspace is no longer a\nsynonym for Rec601LumaColorspace.</li>\n<li>magick/colorspace.c: Added support for influencing Cineon Log\ncolorspace transformations via image attributes.\nPerform colorspace transformations in floating point rather than\ninteger in order to reduce the amount of noise added by\ntransform table quantization.</li>\n<li>coders/psd.c (WritePSDImage): Ensure that output image is 8 or\n16-bits regardless of specific image depth.</li>\n<li>coders/dpx.c: Added support for planar YCbCr 4:2:2.</li>\n</ul>\n</blockquote>\n<p>2005-08-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteDPXImage): 10 and 12-bit packed data was not\naccording to DPX specification.  Added dpx:pixel-endian={lsb|msb}\nto allow the user to specify the endian order of the pixel data in\ncase it does (or should not) not match the headers.  Library Of\nCongress format is 10-bit packed data in big-endian format, but is\nmarked as little-endian.</li>\n</ul>\n</blockquote>\n<p>2005-08-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Sample order for filled 10 bit samples matches DPX\nspecification (was intentionally reversed).  RGB sample order is\nchanged to match DPX specifiation (i.e. BGR rather than RGB).\nDisabled special support for Library Of Congress little-endian\n10-bit packed format.</li>\n</ul>\n</blockquote>\n<p>2005-08-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Extend all image rows to a 32-bit integer\nboundary.</li>\n</ul>\n</blockquote>\n<p>2005-07-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Support the little-endian 10-bit packed format as\nused by the Library Of Congress.</li>\n</ul>\n</blockquote>\n<p>2005-07-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c: Change how Jasper is intialized.  Hopefully\neliminate memory leak when reading ICC color profile.</li>\n<li>Overall: Compilation warning elimination with GCC 4.0.1.</li>\n<li>magick/utility.c (SystemCommand): Always report error status if\na command fails.</li>\n</ul>\n</blockquote>\n<p>2005-07-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>zlib: Updated to version 1.2.3.</li>\n<li>coders/dpx.c: Use TriangleFilter for scaling chroma.</li>\n</ul>\n</blockquote>\n<p>2005-07-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Support proper encode and decode of YCbCr video\nlevels.</li>\n<li>magick/colorspace.c: Support Rec709YCbCrColorspace colorspace.</li>\n</ul>\n</blockquote>\n<p>2005-07-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/{animate.c, display.c, import.c, xwindow.c}: Rename all\nsymbols starting with <cite>X</cite> so that they are prefixed with <cite>Magick</cite>.\nThis eases maintenance since it is almost impossible to understand\ncode which pretends to be the X11 libraries.  The few programs\nwhich use the GraphicsMagick <cite>X</cite> functions will need to alter the\nsymbol names they use.  Sorry.</li>\n<li>magick/command.c (DisplayImageCommand): Don't invoke\nXrmDestroyDatabase() to destroy the resource database associated\nwith the display since it seems that XCloseDisplay() does this for\nus.</li>\n<li>magick/image.c (DisplayImages): Don't invoke\nXrmDestroyDatabase() to destroy the resource database associated\nwith the display since it seems that XCloseDisplay() does this for\nus.</li>\n<li>coders/uyvy.c: Enforce image width restrictions.</li>\n<li>coders/dpx.c: Enforce image width restrictions when subsampling.</li>\n</ul>\n</blockquote>\n<p>2005-07-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Support reading and writing subsampled CbYCr\nimages.  Colorimetery is not right yet.</li>\n<li>magick/colorspace.h (enum Rec709YCbCrColorspace): New\nenumeration for Rec. 709 YcBCr colorspace.</li>\n</ul>\n</blockquote>\n<p>2005-06-21 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Fixed a problem with reading 16-bit PNG images\nusing the Q8 quantum depth.</li>\n</ul>\n</blockquote>\n<p>2005-06-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Add read support for CbYCr at 4:4:4.\n(WriteDPXImage): Add write support for CbYCr at 4:4:4.</li>\n</ul>\n</blockquote>\n<p>2005-06-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteDPXImage): Only preserve source image\ndimension and offset information if image size has not changed.\nIf image size has changed, the existing information may become\ninvalid.\n(WriteDPXImage): Allow user to assign DPX header attribute values\nusing syntax like &quot;-define dpx:mp.frame.position=1000&quot;.</li>\n</ul>\n</blockquote>\n<p>2005-06-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fpx.c: Fix compilation problem due to additional\nExportImagePixelArea parameter.</li>\n</ul>\n</blockquote>\n<p>2005-06-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteMNGImage): Use -define mng:need-cacheoff to\nwrite a libmng-specific nEED request to disable frame buffering.\nThis allows the MNG data to stream without increasing memory\nconsumption in the libmng client.</li>\n</ul>\n</blockquote>\n<p>2005-06-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (SMPTEStringToBits): Time code and user bits were\nbeing displayed in wrong order on little endian CPUs.  Thanks very\nmuch for bug report from Jason Howard.\n(SMPTEStringToBits): Similar fix for time code and user bits\nstring to binary.</li>\n</ul>\n</blockquote>\n<p>2005-06-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Use StringToColorspaceType() to\nparse colorspaces.</li>\n<li>coders/dpx.c (ReadDPXImage): Change existing\ndpx:source-colorspace define to dpx:colorspace so it is easier to\nremember.</li>\n<li>coders/cineon.c (ReadCINEONImage): Extract Cineon header\nattributes in DPX compatible form so that it is possible to\nconvert Cineon to DPX while losing as little header information as\npossible.  Allow the user to set the existing image colorspace\nusing the cineon:colorspace define.</li>\n</ul>\n</blockquote>\n<p>2005-06-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Report actual depth of JPEG file\n(8 or 12 bits).</li>\n<li>coders/cineon.c (ReadCINEONImage): Report depth as 10 bits.</li>\n</ul>\n</blockquote>\n<p>2005-05-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Retrieve and restore the DPX user defined data\narea.  Make available as a &quot;DPXUSERDATA&quot; attached profile.</li>\n</ul>\n</blockquote>\n<p>2005-05-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c (ReadMETAImage): Fixed reading ICM color profile\nfiles.  Due to a typo ICM color profiles were being stored as IPTC\nprofiles.  This restores proper operation of the -profile option.\n(ReadMETAImage): Fix double free bug.  Hopefully does not result\nin a memory leak in other cases.</li>\n</ul>\n</blockquote>\n<p>2005-05-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (DescribeImage): If the image is DirectClass,\nthen don't compute the number of unique colors unless verbose is\ngreater than one.  This change is made since computing the number\nof unique colors may take hours for some images.  The handling of\nthe -verbose argument is changed so that it is cumulative.\nSpecifying -verbose multiple times increases the level of\nverbosity.</li>\n</ul>\n</blockquote>\n<p>2005-05-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (NTreaddir): Fix write beyond buffer length\nreported in SourceForge issue #1182003.  Only impacts Windows.</li>\n</ul>\n</blockquote>\n<p>2005-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadRowSamples): Added necessary masking necessary\nin order to cleanly retrieve DPX 10 bit samples.  Happened to work\nproperly without the masking with QuantumDepth=16.</li>\n</ul>\n</blockquote>\n<p>2005-05-16  Tavis Ormandy &lt;<a class=\"reference external\" href=\"mailto:taviso&#37;&#52;&#48;gentoo&#46;org\">taviso<span>&#64;</span>gentoo<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (ReadXWDImage): Fix for infinite loop in the xwd\ndecoder when calculating the shift r/g/b values and the mask is\nset to zero.</li>\n</ul>\n</blockquote>\n<p>2005-05-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (ReadJP2Image): Return JP2 images as DirectClass\ngrayscale rather than PseudoClass.</li>\n<li>coders/gray.c (ReadGRAYImage): Return GRAY images as DirectClass\ngrayscale rather than PseudoClass.</li>\n<li>coders/dpx.c: Rewrote the DPX pixel reading/writing code yet\nagain to obtain up to 2X better performance.  In the process,\nsupport little-endian pixel storage.</li>\n</ul>\n</blockquote>\n<p>2005-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Added some performance optimizations for reading\nand writing.  Write the motion picture and television headers.</li>\n<li>magick/colorspace.c (TransformRGBImage): Update image colorspace\nto RGB when transforming from Cineon log space to RGB.</li>\n<li>coders/dpx.c (WriteDPXImage): Set image date &amp; time field.\n(ReadDPXImage): Retrieve television header SMTPE time code and\nuser bits and return them as a formatted string.\n(WriteDPXImage): Fix colorspace mapping logic.  Was converting\nCineon log to RGB when it shouldn't be.</li>\n</ul>\n</blockquote>\n<p>2005-05-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteDPXImage): Default to big-endian output.</li>\n<li>magick/delegate.c (InvokePostscriptDelegate): Improved\nGhostscript API-based error reporting and logging.</li>\n<li>magick/attribute.c (GenerateEXIFAttribute): Extend EXIF\nknowledge a bit.  Pass more characters from EXIF_FMT_BYTE in case\nthe byte stream contains nulls.</li>\n<li>coders/dpx.c: Re-wrote the DPX read/write support in order to\nhopefully surmount problems noticed when testing with files sent\nto me.</li>\n<li>wand/pixel_wand.c (PixelSetYellowQuantum): Wrong PixelPacket\nmember was being set.  Thanks to Cristy for the heads-up.</li>\n<li>magick/image.c (SetImageType): Revert change from 2005-03-12.\nSome coders require that when the image is set to Bilevel type,\nthat it be PseudoClass.</li>\n</ul>\n</blockquote>\n<p>2005-04-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/tests/convolve.sh: Add a convolution parameter.</li>\n</ul>\n</blockquote>\n<p>2005-04-28 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: &quot;IsGeometry() test was rejecting valid\n-convolve parameters.  Also, the image returned by ConvolveImage()\nwas ignored.</li>\n</ul>\n</blockquote>\n<p>2005-04-25 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Initialize several variables to avoid new\nGCC 4.0.0 warnings.</li>\n<li>coders/pnm.c: Defend against malicious &quot;P7&quot; files that try\nto set the colormap less than 256 bytes (bug fix from ImageMagick)</li>\n</ul>\n</blockquote>\n<p>2005-04-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteDPXImage): Fill out source information\nheader.</li>\n<li>Magick++: Added image leveling methods for Magick++.</li>\n</ul>\n</blockquote>\n<p>2005-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS: Update with latest news.</li>\n<li>magick/blob.c (WriteBlob): Move BlobStream write support to a\nsubroutine for easier maintenance.</li>\n<li>coders/dpx.c (ReadDPXImage): Support retrieving all DPX\nattributes as image attributes.\n(WriteDPXImage): Buffer writes for better performance on some\nplatforms.</li>\n</ul>\n</blockquote>\n<p>2005-04-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteDPXImage): Re-write sample marshalling to be\nbased on a series of tighter loops.  Results in a small\nperformance increase.\n(ReadDPXImage): Re-write sample marshalling to be\nbased on a series of tighter loops.  Results in a small\nperformance increase.</li>\n</ul>\n</blockquote>\n<p>2005-04-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/Xwindow.c (XDelay): Prefer use of select() over poll()\nsince it is more portable.  MacOS-X has a poll() but it doesn't\nwork right.</li>\n</ul>\n</blockquote>\n<p>2005-04-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick_endian.h: Renamed from endian.h in order to avoid\nconflict with system headers.</li>\n</ul>\n</blockquote>\n<p>2005-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (WriteMIFFImage): Normalize image depth to 8/16/32.</li>\n<li>coders/gray.c (WriteGRAYImage): Normalize image depth to 8/16/32.</li>\n<li>coders/fits.c (WriteFITSImage): Normalize image depth to 8/16.</li>\n<li>tests/Makefile.am: Extended read/write tests to include 10, 12,\nand 16-bit original test images.</li>\n<li>coders/dpx.c (ReadDPXImage): If samples are log encoded, then\nset the image to CineonLogRGBColorspace.\n(WriteDPXImage): If image samples are log encoded, then mark DPX\nfile as being log encoded.</li>\n<li>magick/colorspace.c (TransformRGBImage): Support translation\nfrom log RGB to linear RGB based on Cineon guidelines.\n(RGBTransformImage): Support translation from linear RGB to log RGB.</li>\n<li>magick/colorspace.h (enum CineonLogRGBColorspace): New\nenumeration to record that the RGB values are log encoded in a\n2.048 density range as defined for the Cineon Digital Film System.</li>\n</ul>\n</blockquote>\n<p>2005-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Take advantage of ColorspaceTypeToString() and\nStringToColorspaceType() functions in implementation.</li>\n<li>magick/colorspace.c (RGBTransformImage): Added support for\nconverting to Rec 709 grayscale colorspace.\n(ColorspaceTypeToString): New function to translate from\nColorspaceType enumeration value to a string.\n(StringToColorspaceType): New function to translate from a string\nto a ColorspaceType enumeration value.  * magick/colorspace.h\n(enum Rec601LumaColorspace): New enumeration to support the Rec\n601 grayscale colorspace.  This is the colorspace previously\nrepresented by GRAYColorspace. If GRAYColorspace is specified,\nthen Rec601LumaColorspace is selected.\n(enum Rec709LumaColorspace): New enumeration to support the Rec\n707 grayscale colorspace.</li>\n</ul>\n</blockquote>\n<p>2005-04-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (IdentifyImageCommand): Use +ping to force\nidentify to read the image pixels.</li>\n<li>magick/constitute.c (PingImage): Intentionally clear\nuser/elapsed timer when ping is used on an image since the results\nare misleading.</li>\n<li>magick/image.c (DescribeImage): Only display pixel read rate if\nthe time accumulated is at least the timer's resolution.</li>\n<li>magick/cache.c (OpenCache): Fix a memory resource leak noticed\nby Stefan v. Wachter &lt;<a class=\"reference external\" href=\"mailto:svwa-dev&#37;&#52;&#48;mnet-online&#46;de\">svwa-dev<span>&#64;</span>mnet-online<span>&#46;</span>de</a>&gt;.  This error with\nkeeping track of resources may eventually cause GraphicsMagick to\nrun slower and slower due to using disk-based images rather than\nmemory-based images.</li>\n</ul>\n</blockquote>\n<p>2005-04-07 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: encoder now accepts image-&gt;depth other than 8 and 16.</li>\n</ul>\n</blockquote>\n<p>2005-04-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteDPXImage): First pass at a new SMPTE268M-2003\nDPX writer.</li>\n</ul>\n</blockquote>\n<p>2005-04-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (AllocateString): Performance enhancement.\n(CloneString): Performance enhancement.\n(ConcatenateString): Performance enhancement.</li>\n</ul>\n</blockquote>\n<p>2005-03-31 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: revised EOF test.  It was rejecting good image\nfiles.  Needs more work.</li>\n</ul>\n</blockquote>\n<p>2005-03-30 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (ReadPNMImage): Throw a &quot;Corrupt Image&quot; exception\nif EOF is encountered while reading scanlines in P1, P2, P3, or P4\nformatted images (P5 and P6 were OK).</li>\n</ul>\n</blockquote>\n<p>2005-03-29 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c (ReadSGIImage): Throw a &quot;Corrupt Image&quot; exception\nif EOF is encountered while reading scanlines.</li>\n</ul>\n</blockquote>\n<p>2005-03-28 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Throw a &quot;Corrupt Image&quot; exception\nif EOF is encountered while reading scanlines.</li>\n<li>coders/pcx.c (ReadPCXImage): Throw a &quot;Corrupt Image&quot; exception\nif EOF is encountered while reading pixels.</li>\n</ul>\n</blockquote>\n<p>2005-03-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): First pass at a new SMPTE268M-2003\nDPX reader.</li>\n<li>magick/bit_stream.h (WordStreamLSBRead): New function to parse\nvalues from a stream which is defined by 32-bit words.  Values are\nread starting with the least significant bits.</li>\n</ul>\n</blockquote>\n<p>2005-03-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ExtensionTagsInitialize): Fix conditional use of\nTIFFSetTagExtender().</li>\n</ul>\n</blockquote>\n<p>2005-03-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/endian.c: Imported libtiff's swab.c since its functions\nare so useful and well-tested.</li>\n<li>magick/utility.c (FormatSize): Extend to support incredibly\nlarge sizes.</li>\n<li>magick/image.c (DescribeImage): Use GetTimerResolution() when\ncomputing pixels-per-second rate in order to avoid computing\nastronomical rates when the time consumed is too small to measure.</li>\n<li>magick/timer.c (GetTimerResolution): New function to return the\ntimer's resolution.</li>\n</ul>\n</blockquote>\n<p>2005-03-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Eliminate cause of annoying\nwarning when PDFs are read by Ghostscript 8.5.</li>\n</ul>\n</blockquote>\n<p>2005-03-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.h (lt_dlerror): Needed to provide a mapping to\nNTdlerror().</li>\n<li>coders/tiff.c (TIFFErrors): Update to make thread safe via\nthread specific data.\n(TIFFWarnings): Update to make thread safe via thread specific\ndata.</li>\n<li>magick/tsd.c (MagickTsdKeyCreate): New function to support\nthread specific data.\n(MagickTsdKeyDelete): ditto\n(MagickTsdSetSpecific): ditto\n(MagickTsdGetSpecific): ditto.</li>\n</ul>\n</blockquote>\n<p>2005-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (ReplaceImageColormap): New function to replace\nthe image colormap with a user-provided one. Colormap indexes are\nadjusted to point to identical colors in the new colormap.</li>\n<li>magick/nt_base.h: Reorganized a bit to cluster code supporting\nsimilar features in the same area of the header.</li>\n<li>magick/nt_base.c: Renamed wrappers for standard functions so\nthat they have the prefix <cite>NT</cite>. Macros are used to apply the new\nnames. This assures that there will not be conflicts if the library\nis linked with a different package's wrapper functions.</li>\n</ul>\n</blockquote>\n<p>2005-03-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/quantize.c (GrayscalePseudoClassImage): Moved to here\nfrom image.c.  Added support for is_monochrome.</li>\n</ul>\n</blockquote>\n<p>2005-03-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>jp2: Updated Jasper library to version 1.701.0.</li>\n<li>magick/nt_base.c (NTGhostscriptFonts): Fixed a coding error\nwhich was added when strcpy/strcat code was replaced with\nstrlcpy/strlcat.  Ghostscript fonts were not being found.</li>\n<li>magick/constitute.c (ReadImage): Don't attempt to access image\nmembers if image pointer is null.  Oops!</li>\n</ul>\n</blockquote>\n<p>2005-03-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageType): Bilevel image is not required to\nbe PseudoClass type.</li>\n<li>coders/mpc.c (WriteMPCImage): Persist is_monochrome and\nis_grayscale flags.\n(ReadMPCImage): Restore is_monochrome and is_grayscale flags.</li>\n<li>magick/constitute.c (WriteImage): Extended logging to include\nmonochrome and grayscale flags.\n(ReadImage): Extended logging to include monochrome and grayscale\nflags.</li>\n<li>magick/image.c (DescribeImage): Include the effective pixel I/O\nrate alongside the image read/write time.  This provides an easier\nway to evaluate image read/write performance when looking at\n<cite>identify</cite> or <cite>convert -verbose</cite> output.</li>\n<li>coders/sun.c (ReadSUNImage): Ensure that pixel length value does\nnot overflow for large images.</li>\n</ul>\n</blockquote>\n<p>2005-03-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/cache.c (SetImagePixels): Improved documentation.\n(GetImagePixels): Improved documentation.</li>\n</ul>\n</blockquote>\n<p>2005-03-10 Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;glennrp&#46;com\">glennrp<span>&#64;</span>glennrp<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Avoid attempting to write indexed PNG when\na color entry has more than one opacity level.  The PNG format\nsupports this but GM's colormap does not, so erroneous files\nwere being written.</li>\n</ul>\n</blockquote>\n<p>2005-03-09  Arne Rusek  &lt;<a class=\"reference external\" href=\"mailto:zonk&#37;&#52;&#48;matfyz&#46;cz\">zonk<span>&#64;</span>matfyz<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Offset type\ncorrection to fix loop termination if size_t type is not <cite>long</cite>.</li>\n</ul>\n</blockquote>\n<p>2005-03-09  Alexander Yaworsky  &lt;<a class=\"reference external\" href=\"mailto:yaworsky&#37;&#52;&#48;users&#46;sourceforge&#46;net\">yaworsky<span>&#64;</span>users<span>&#46;</span>sourceforge<span>&#46;</span>net</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jbig.c (WriteJBIGImage): JBIG was writing an empty output\nfile. Apparently libjbig parameters have changed. Setting l0\nparameter of jbg_enc_options to zero instead of -1 (like in\njbigkit's pbmtools) solved the problem.</li>\n</ul>\n</blockquote>\n<p>2005-03-07  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagickmagickGM_magick.bpr: Updated to reflect changes since\nlast update.</li>\n<li>BCBMagickmagicklibMagick.bpr: Updated to reflect changes since\nlast update.</li>\n</ul>\n</blockquote>\n<p>2005-03-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/alpha_composite.h (AlphaComposite): Moved AlphaComposite\nto new alpha_composite.h header since it was causing porting\nproblems.</li>\n<li>magick/constitute.h (enum QuantumType): Added CIEYQuantum and\nCIEXYZQuantum quantum import options.</li>\n<li>coders/tiff.c (ReadTIFFImage): Import LogLuv image data within\nGraphicsMagick (rather than libtiff) so that color resolution is\nnot lost.  Results in a small speedup as well.</li>\n<li>magick/constitute.c (ImportImagePixelArea): Add a speed-up for\nimporting bi-level images.  Add support for importing pixels in\nCIE XYZ and CIE Y colorspaces.</li>\n<li>coders/tiff.c (ReadTIFFImage): Support reading TIFF images which\nfail to properly scale the samples to the sample size (e.g. 12\nbits in a 16-bit sample).\n(WriteTIFFImage): Adjustments to strip-size (rows-per-strip)\nestimation.</li>\n<li>magick/constitute.c (ExportImagePixelArea): Support exporting\nunsigned samples with values which span only part of the range.\nFor example, 12 bit data may be exported within 16 bit samples,\nwith a value range of 0 to 4095.\n(ImportImagePixelArea): Support importing unsigned samples with\nvalues which span only part of the range.</li>\n</ul>\n</blockquote>\n<p>2005-02-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Support reading TIFF files in\nIEEEFP format.\n(WriteTIFFImage): Support writing TIFF files in IEEEFP format.</li>\n<li>magick/constitute.c (ExportImagePixelArea): Support exporting\nfloating point data.\n(ImportImagePixelArea): Support importing floating point data.</li>\n</ul>\n</blockquote>\n<p>2005-02-26  Albert Chin-A-Young  &lt;<a class=\"reference external\" href=\"mailto:china&#37;&#52;&#48;thewrittenword&#46;com\">china<span>&#64;</span>thewrittenword<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>acinclude.m4 (AC_CXX_IOS_BINARY): Added macro to detect if the\nC++ compiler lacks support for ios::binary.</li>\n<li>configure.ac: Use  AC_CXX_IOS_BINARY.</li>\n</ul>\n</blockquote>\n<p>2005-02-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Read grayscale TIFFs as\nDirectClass rather than promoting to PseudoClass.  Fix improper\nmultiple repeated &quot;disassociate&quot; operations when reading planar\nimages which contain an alpha channel.\n(WriteTIFFImage): Fix improper multiple repeated &quot;associate&quot;\noperations when writing planar images with an alpha channel.</li>\n</ul>\n</blockquote>\n<p>2005-02-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>win2k/IMDisplay/IMDisplayView.cpp (DoDisplayImage): Use\nTextureImage to apply background pattern.</li>\n<li>magick/image.c (TextureImage): Alpha blend the texture onto the\nbackground if the image has a matte channel.</li>\n<li>magick/constitute.h (enum QuantumType): Eliminated\nGrayInvertedQuantum and GrayInvertedAlphaQuantum which were added\nsince GraphicsMagick 1.1.  Replaced this &quot;inverted&quot; gray\nfunctionality with the grayscale_inverted flag in\nExportPixelAreaOptions and ImportPixelAreaOptions.</li>\n<li>magick/constitute.c (ExportImagePixelArea): Added an extra\nparameter for passing seldom used options via an\nExportPixelAreaOptions structure.\n(ImportImagePixelArea): Added an extra parameter for passing\nseldom used options via an ImportPixelAreaOptions structure.\n(ExportPixelAreaOptionsInit): New function to initialize the\nExportPixelAreaOptions structure with defaults.\n(ImportPixelAreaOptionsInit): New function to intialize the\nImportPixelAreaOptions structure with defaults.</li>\n<li>coders/jpeg.c (WriteJPEGImage): Don't use jpeglib private\nBITS_IN_JSAMPLE definition to select JPEG bit depth.</li>\n<li>coders/tiff.c (ReadTIFFImage): Support using -define\ntiff:alpha={unspecified|associated|unassociated} to specify the\nalpha channel type in case the alpha channel is marked\nincorrectly.\nProperly read associated alpha images.\n(WriteTIFFImage): Support using -define\ntiff:alpha={unspecified|associated|unassociated} to override the\nalpha channel type.\nProperly write associated alpha images by default.</li>\n</ul>\n</blockquote>\n<p>2005-02-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WritePTIFImage): Ensure that pyramid image frames\nare the same type as the original image.\n(WriteTIFFImage): Added support for writing tiled TIFF.</li>\n</ul>\n</blockquote>\n<p>2005-01-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TraceBezier): Avoid probable bug under Visual\nC++ 7.0 or later due to the argument to pow not being promoted to\ndouble.</li>\n</ul>\n</blockquote>\n<p>2005-01-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Re-wrote TIFF writing code.</li>\n<li>magick/image.h (MaxValueGivenBits): Renamed MaxRGBGivenBits\nmacro to MaxValueGivenBits.</li>\n<li>magick/constitute.h (enum QuantumType): Added UndefinedQuantum.</li>\n<li>magick/static.c (RegisterStaticModules): Support compiling\nwithout PNG.</li>\n</ul>\n</blockquote>\n<p>2005-01-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/color.c (IsPaletteImage): Fix memory leak reported by\nStefan v. Wachter &lt;<a class=\"reference external\" href=\"mailto:svwa-dev&#37;&#52;&#48;mnet-online&#46;de\">svwa-dev<span>&#64;</span>mnet-online<span>&#46;</span>de</a>&gt;.</li>\n<li>magick/Makefile.am (MAGICK_INCLUDE_HDRS): Needed to install\nmagick/operator.h.</li>\n<li>coders/tiff.c (ReadTIFFImage): Re-wrote TIFF reading code again\nfor more flexibility and performance.</li>\n</ul>\n</blockquote>\n<p>2005-01-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Remove --disable-lzw option and HasLZW define.\nLZW support is always enabled now.</li>\n</ul>\n</blockquote>\n<p>2005-01-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tga.c (WriteTGAImage): Incorporated patch from Stefan\nv. Wachter to enable writing grayscale images as well as adding\nmore image type option smarts.</li>\n<li>coders/psd.c (ReadPSDImage): Fix stack overflow vulnerability\nreported by Andrei Nigmatulin. See <a class=\"reference external\" href=\"http://lwn.net/Articles/119713/\">http://lwn.net/Articles/119713/</a>\nfor details.</li>\n</ul>\n</blockquote>\n<p>2005-01-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>win2k/IMDisplay/IMDisplayDoc.cpp (DoReadImage): Ensure that image\nis in RGB color space after being read since this is what Windows\nexpects.</li>\n</ul>\n</blockquote>\n<p>2005-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Handle extra samples in scanline\nTIFFs.</li>\n</ul>\n</blockquote>\n<p>2005-01-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (DescribeImage): Report statistics for a virtual\ngray channel for grayscale images rather than discrete red, green,\nand blue.</li>\n<li>PerlMagick/Makefile.nt: JNG and JP2 to test list.</li>\n<li>configure.ac: Changed --without-fpx to --with-fpx due to\ndecision to default FlashPIX to <cite>no</cite>.  FlashPIX library is not\nvery portable and is only known to work properly under SPARC\nSolaris and Windows.</li>\n<li>NEWS: Updated with latest news.</li>\n<li>lcms: Updated to LCMS 1.14.</li>\n</ul>\n</blockquote>\n<p>2005-01-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (ReadJP2Image): Handle images in YCBCR colorspace.\n(ReadJP2Image): Retrieve and store an ICC ICM color profile if\npresent.</li>\n<li>PerlMagick/t/tiff/read.t: Added test for reading truecolor\nplanar TIFF image.\nAdded test for reading 32-bit TrueColor TIFF image.\nAdded test for reading 32-bit grayscale TIFF image.</li>\n<li>coders/tiff.c (ReadTIFFImage): Fixed stripped TIFF reader.</li>\n</ul>\n</blockquote>\n<p>2005-01-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Only set TIFFTAG_PREDICTOR to 2\nfor bits-per-sample values that libtiff supports.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2006.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2006.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2006-11-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Magick++/Image.html: Fix documentation regarding retrieving\nEXIF attribute.</li>\n<li>magick/command.c: Fix typo in usage messages.</li>\n</ul>\n</blockquote>\n<p>2006-11-02  Daniel Kobras  &lt;<a class=\"reference external\" href=\"mailto:kobras&#37;&#52;&#48;debian&#46;org\">kobras<span>&#64;</span>debian<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c: (ReadDCMImage) Prevent buffer overflow of\n<cite>photometric</cite> array in DCM coder. Original patch thanks to\nM Joonas Pihlaja. (CVE-2006-5456)</li>\n<li>coders/palm.c: (ReadPALMImage) Fix heap overflows of <cite>one_row</cite>\narray in PALM coder. Original patch thanks to M Joonas Pihlaja.\n(CVE-2006-5456)</li>\n</ul>\n</blockquote>\n<p>2006-10-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated libtool to latest CVS head version (1.2352 2006/10/24)\nin order to fix a bootstrap nit.</li>\n</ul>\n</blockquote>\n<p>2006-10-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated autoconf to version 2.60, automake to version 1.10, and\nlibtool to latest CVS head version (1.2348 2006/10/22).</li>\n</ul>\n</blockquote>\n<p>2006-09-11  Daniel Kobras  &lt;<a class=\"reference external\" href=\"mailto:kobras&#37;&#52;&#48;debian&#46;org\">kobras<span>&#64;</span>debian<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (ReadBlobStringWithLongSize): Add new parameter <cite>max</cite>\nto prevent overflowing the <cite>string</cite> array. (CVE-2006-3743)\n(ReadOneLayer): Adjust callers of ReadBlobStringWithLongSize(), and\nguard against infinite loops on premature end-of-file.\n(ReadXCFImage): Adjust callers of ReadBlobStringWithLongSize(), and\nguard against infinite loops on premature end-of-file.</li>\n</ul>\n</blockquote>\n<p>2006-09-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c (ReadSGIImage): Mostly applied Debian patch for\nCVE-2006-4144 security issue related to RLE decoding.  Also added\ncomplete verification of file header.</li>\n<li>magick/image.c (ComputePixelError): Add progress monitor.\n(GetImageStatisticsMean): Call progress monitor less often.\n(GetImageStatisticsVariance): Call progress monitor less often.</li>\n</ul>\n</blockquote>\n<p>2006-08-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): ImageInfo <cite>endian</cite> option now\ncontrols TIFF byte-order rather than bit-order when writing.</li>\n<li>coders/png.c (ReadOnePNGImage): Fix compilation problem.  Patch\nsubmitted by Aron Stansvik.</li>\n</ul>\n</blockquote>\n<p>2006-07-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (WriteJPEGImage): Clear the JPEG library\nstructures in order to ensure a completely clean slate.</li>\n</ul>\n</blockquote>\n<p>2006-06-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (ConvertImageCommand): Fix memory leaks which\noccured when an image was not returned.</li>\n<li>magick/command.c (IdentifyImageCommand): Ditto.</li>\n<li>magick/command.c (MogrifyImageCommand): Ditto.</li>\n</ul>\n</blockquote>\n<p>2006-06-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Add mention of -resample to convert and\nmogrify usage messages.</li>\n</ul>\n</blockquote>\n<p>2006-05-31  Ralf Wildenhues  &lt;<a class=\"reference external\" href=\"mailto:Ralf&#46;Wildenhues&#37;&#52;&#48;gmx&#46;de\">Ralf<span>&#46;</span>Wildenhues<span>&#64;</span>gmx<span>&#46;</span>de</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Fix arguments to AC_CHECK_HEADER.</li>\n</ul>\n</blockquote>\n<p>2006-05-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): -define tiff:alpha= override was\nonly working if the TIFFTAG_EXTRASAMPLES tag was present.  Now it\nis always available when an alpha channel is present.</li>\n</ul>\n</blockquote>\n<p>2006-05-11  JH  &lt;<a class=\"reference external\" href=\"mailto:jh&#37;&#52;&#48;ops&#46;everybox&#46;com\">jh<span>&#64;</span>ops<span>&#46;</span>everybox<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick.spec.in (files devel): Include\n%{_libdir}/lib%{name}Wand.so.</li>\n</ul>\n</blockquote>\n<p>2006-05-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (NTGhostscriptEnumerateVersions): Recent GNU\nGhostscript identifies itself as &quot;GPL Ghostscript&quot;.</li>\n</ul>\n</blockquote>\n<p>2006-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff: Updated bundled libtiff to version 3.8.2.</li>\n</ul>\n</blockquote>\n<p>2006-04-05  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c: Sets image is_grayscale flag as well as added more\nsymbolic constants.</li>\n</ul>\n</blockquote>\n<p>2006-04-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (IMAGE_DATA_ROUNDING): Thanks to Steve Sloan for\nnoticing that 8K is 8192 rather than 8092.  Added a define to\nallow tailoring the pixel data alignment boundary in case 8K is\nnot the right answer for some reason.</li>\n</ul>\n</blockquote>\n<p>2006-03-20  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c: Ensure that unusued opacity channel is set to opaque.</li>\n<li>PerlMagick/t/input.art: New ART test image.</li>\n<li>PerlMagick/t/input8.mat: New MATLAB test image (8-bit indexed).</li>\n<li>PerlMagick/t/input_dbl.mat: New MATLAB test image (double grey)</li>\n<li>PerlMagick/t/input_rgb.mat: New MATLAB test image (8-bit RGB)</li>\n</ul>\n</blockquote>\n<p>2006-03-19  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c: Use symbolic constants rather than plain numbers\nso the module is more maintainable.  Correct the format for the\nday of the week.</li>\n</ul>\n</blockquote>\n<p>2006-03-13  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (WriteMATLABImage): Add RGB writer support for\nMATLAB format.</li>\n</ul>\n</blockquote>\n<p>2006-03-11  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (ReadMATImage): RGB support for MAT reader.</li>\n</ul>\n</blockquote>\n<p>2006-03-02  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c: Fixes for observed crash.  Byte and word formats\nare working.</li>\n</ul>\n</blockquote>\n<p>2006-02-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/environment.imdoc: MAGICK_FONT_PATH has not been supported\nsince 1.1.  Remove mention of it!</li>\n</ul>\n</blockquote>\n<p>2006-02-23  Mike Chiarappa  &lt;<a class=\"reference external\" href=\"mailto:mikechiarappa&#37;&#52;&#48;libero&#46;it\">mikechiarappa<span>&#64;</span>libero<span>&#46;</span>it</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BCBMagick: Updated to latest changes</li>\n</ul>\n</blockquote>\n<p>2006-02-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c (ReadSGIImage): Properly compute image depth for\n16-bit SGI image files.</li>\n</ul>\n</blockquote>\n<p>2006-01-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetExecutionPathUsingName): Search executable\nsearch path for binary.</li>\n</ul>\n</blockquote>\n<p>2006-01-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage, WriteDPXImage): Alpha channel in DPX\nuses zero, or reference black, to represent an opaque pixel.</li>\n</ul>\n</blockquote>\n<p>2006-01-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/semaphore.c (AllocateSemaphoreInfo): Allow semaphores to\nrecurse on POSIX systems which support recursive semaphores but\nalso warn if the semaphore recurses.</li>\n<li><dl class=\"first docutils\">\n<dt>magick/log.c (SetLogEventMask): Avoid deadlock if invoked before</dt>\n<dd>log.mgk has been loaded.</dd>\n</dl>\n</li>\n<li>magick/attribute.c (GenerateEXIFAttribute): Fix memory leak on\nerror which was reported by Micha³ Kowalczuk.</li>\n</ul>\n</blockquote>\n<p>2006-01-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ReadImage): Avoid crash if delegate fails\nto return image.</li>\n</ul>\n</blockquote>\n<p>2006-01-03  Daniel Kobras  &lt;<a class=\"reference external\" href=\"mailto:kobras&#37;&#52;&#48;debian&#46;org\">kobras<span>&#64;</span>debian<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Fix EXIF IFD stack\noverflow vulnerability.</li>\n<li>configure.ac: Fix typo in HTMLDecodeDelegate.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2007.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2007.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2007-12-23  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/configure/configure.rc: Better positioning of frog,\nchanged original ImageMagick messages.</li>\n<li>VisualMagick/configure/configure.exe: New build.</li>\n</ul>\n</blockquote>\n<p>2007-12-22  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Fix compilability issue for Microsoft Visual\nStudio 6.</li>\n</ul>\n</blockquote>\n<p>2007-12-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Use some improved tests for POSIX standard types\navailable in Autoconf 2.61.\nAdd support for configuring a magick_uintmax_t type.\nAdded support for configuring a magick_uintptr_t type.</li>\n</ul>\n</blockquote>\n<p>2007-12-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.h (MagickSafeMultiplySize_t): New function to\nperform a safe multiply.  A multiplication overflow results in\nzero.\n(MagickAllocateMemory): Check for size_t value truncation/overflow\nand zero size before deciding to allocate memory.  Any detected\nfailure results in a NULL pointer being returned.\n(MagickReallocMemory): Add a type parameter to use in cast in\norder to avoid C++ portability problem.</li>\n<li>PerlMagick/Magick.xs: Eliminate use of deprecated methods.</li>\n<li>magick/memory.c (MagickAcquireMemory): New function to allocate\nmemory.\n(MagickAcquireMemoryArray): New function to allocate memory for an\narray of objects.\n(MagickCloneMemory): New function to intelligently copy memory.\n(MagickReallocateMemory): New function to re-allocate memory.\n(MagickReleaseMemory): New function to deallocate memory.</li>\n<li>magick/deprecate.c (AcquireMemory): Deprecated in favor of new\nfunction MagickAcquireMemory().\n(CloneMemory): Deprecated in favor of new function\nMagickCloneMemory().\n(LiberateMemory): Deprecated in favor of new function\nMagickReleaseMemory().\n(ReacquireMemory): Deprecated in favor of new function\nMagickReallocateMemory().</li>\n</ul>\n</blockquote>\n<p>2007-11-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ReadImage): Log colorspace of returned image.\n(WriteImage): Log colorspace of image to be written.</li>\n<li>coders/{miff.c,mpc.c,tga.c,tiff.c}: Use MagickBoolToString().</li>\n<li>magick/{constitute.c,xwindow.c}: Use MagickBoolToString().</li>\n<li>magick/image.h (MagickBoolToString): New macro to convert truth\nvalue to a constant &quot;True&quot; or &quot;False&quot; string.</li>\n</ul>\n</blockquote>\n<p>2007-11-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (IsImagesEqual): Allow comparing images if the\ncolorspace enumeration is different but the images are both an RGB\ntype.</li>\n</ul>\n</blockquote>\n<p>2007-11-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Add support for -monitor option to <cite>animate</cite>,\n<cite>display</cite>, and <cite>import</cite>.</li>\n<li>coders/fpx.c (WriteFPXImage): Fix compilation problem.</li>\n<li>coders/dpx.c (TentUpsampleChroma): Fix access beyond array.  Use\ninteger calculations where possible.</li>\n</ul>\n</blockquote>\n<p>2007-11-07  Andy Armstrong  &lt;<a class=\"reference external\" href=\"mailto:andy&#37;&#52;&#48;hexten&#46;net\">andy<span>&#64;</span>hexten<span>&#46;</span>net</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/setattribute.t: Fix for typo which breaks\nTest::Harness 3.00.</li>\n</ul>\n</blockquote>\n<p>2007-10-20  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>mat.c: Attempt to read <cite>logic</cite> type modification</dt>\n<dd>as monochrome image.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2007-10-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (ReadBlob?SBFoo): Return 0 on EOF conditions\nrather than a magic value concocted using ~0.  The magic value was\nvery sensitive to the size/range of the type used to pass and\nstore it, leading to increased possibility of error.  There was\nalso concern that sometimes a successfully read value may match\nthe magic value.  Added documentation that EOFBlob() may be used\nto determine that the blob is in EOF state.</li>\n<li>coders/pix.c (ReadPIXImage): Avoid reliance on a particular\nmagic value being returned from ReadBlobMSBShort on EOF.</li>\n<li>coders/avs.c (ReadAVSImage): Avoid reliance on a particular\nmagic value being returned from ReadBlobMSBLong() on EOF.</li>\n</ul>\n</blockquote>\n<p>2007-10-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wpg.c: Monochrome images are not using palette -\npalette is discarded in this case.</li>\n</ul>\n</blockquote>\n<p>2007-10-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.h: Blob I/O APIs now use sized types so that passed\nand returned data values are a specific size rather than\narchitecture dependent.</li>\n<li>PerlMagick/t/read.t: Added read test for unsigned 32-bit LSB MAT\nformat.</li>\n</ul>\n</blockquote>\n<p>2007-10-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c (ReadDIBImage): Use appropriate sized cast for DIB\nwidth and height values.  Validate width and height values.</li>\n<li>coders/bmp.c (ReadBMPImage): Use appropriate sized cast for BMP\nwidth and height values.</li>\n<li>magick/colorspace.c (RGBTransformImage): Use a better rounding\nalgorithm when converting to HSL/HWB colorspaces.</li>\n<li>magick/gem.c (TransformHSL): Avoid GCC opimization bug on\nOpteron which caused wrong results.  Ensure that returned values\nfall within bounds 0.0 to 1.0.\n(TransformHWB): Avoid GCC opimization bug on\nOpteron which caused wrong results.  Ensure that returned values\nfall within bounds 0.0 to 1.0.</li>\n<li>PerlMagick/t/ttf/read.t: Relax strictness quite a bit for TTF\nread tests in order to allow somewhat different FreeType output.</li>\n</ul>\n</blockquote>\n<p>2007-09-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colorspace.c (RGBTransformImage): Add missing break\nstatement. HWB colorspace was used rather than HSL.\n(TransformRGBImage): Add missing break\nstatement. HWB colorspace was used rather than HSL.</li>\n</ul>\n</blockquote>\n<p>2007-09-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sun.c (ReadSUNImage): Properly report SUN image depth.</li>\n</ul>\n</blockquote>\n<p>2007-09-28  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Ability to write multiple images to one MAT file.\nFixed bug - incorrect matrix size for gray image.</li>\n</ul>\n</blockquote>\n<p>2007-09-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c (IntegralRotateImage): Rotation by 270 degrees\nwas wrong.  It was flipped from what it should be.</li>\n</ul>\n</blockquote>\n<p>2007-09-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (CommandProgressMonitor): Remove any preceding\nwhitespace in the task descriptions so that we don't need to\nupdate all of the task descriptions right away.</li>\n<li>magick/colorspace.c (RGBTransformImage): Improve progress monitor message.\n(TransformRGBImage): Improve progress monitor message.</li>\n<li>coders/miff.c (ReadMIFFImage): Add read progress monitor support.</li>\n</ul>\n</blockquote>\n<p>2007-09-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Fix writing PDF with CCITT\ncompression.  Addresses SourceForge bug 1209177 &quot;TIFF to PDF CCITT\ncompression fails&quot;.</li>\n</ul>\n</blockquote>\n<p>2007-09-14  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Ability to read multiple images from one MAT file.\nchanged ExtendedSignedIntegralType to magick_off_t that better\ncorresponds to file positioning.</li>\n</ul>\n</blockquote>\n<p>2007-09-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Use ThumbnailImage() to create\nthumbnail.</li>\n<li>coders/preview.c (WritePreviewImage): Use ThumbnailImage() to\ncreate thumbnail.</li>\n<li>coders/xpm.c (WritePICONImage): Use ThumbnailImage() to create\nthumbnail.</li>\n</ul>\n</blockquote>\n<p>2007-09-14  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Several warnings has been suppressed.</li>\n</ul>\n</blockquote>\n<p>2007-09-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Fix writing to pipes and other\nnon-seekable output destinations.</li>\n<li>magick/blob.c (WriteBlobFile): New function to copy a disk file\nto a blob stream.</li>\n<li>magick/profile.c (ProfileImage): Fix removing profiles.</li>\n</ul>\n</blockquote>\n<p>2007-09-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (png_flush_data): Don't invoke SyncBlob() since it\ndoes far more than force data to the output file.\n(ReadPNGImage): Make sure that PNG read errors are reported to the\nuser.</li>\n<li>coders/jpeg.c (TerminateDestination): Don't invoke SyncBlob()\nsince it does far more than force data to the output file.</li>\n<li>magick/blob.c (SyncBlob): Remove from public interface.</li>\n</ul>\n</blockquote>\n<p>2007-09-12  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Allowed to read signed integer matrices.\nFixed loop break.</li>\n</ul>\n</blockquote>\n<p>2007-09-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Ensure that selected photometric\nmost closely matches the user's expectation.  Remove compression\nif requested compression type is not compatible with the selected\nphotometric.</li>\n</ul>\n</blockquote>\n<p>2007-09-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c (IntegralRotateImage): Use tiles to speed up\nrotation by 90 or 270 degrees.</li>\n</ul>\n</blockquote>\n<p>2007-09-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c The flop image has been eliminated in a reader.\nCode has been shrinked a little bit.</li>\n</ul>\n</blockquote>\n<p>2007-09-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (GetImageCharacteristics): Add progress monitor support.</li>\n<li>magick/color.c (IsMonochromeImage): Add progress monitor support.\n(IsGrayImage): Add progress monitor support.\n(IsOpaqueImage): Add progress monitor support.</li>\n<li>coders/dpx.c (ReadDPXImage): Added progress indication.</li>\n<li>coders/cineon.c (WriteCINEONImage): Added progress indication.</li>\n<li>magick/command.c : Added a -monitor command option for\n<cite>composite</cite>, <cite>convert</cite>, <cite>identify</cite>, <cite>mogrify</cite>, and <cite>montage</cite> in\norder to enable a simple progress indicator.</li>\n</ul>\n</blockquote>\n<p>2007-09-06  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Write native gray MAT data when gray image is detected.</li>\n</ul>\n</blockquote>\n<p>2007-09-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetExecutionPath): Add support for Apple OS-X,\nLinux, and FreeBSD.</li>\n</ul>\n</blockquote>\n<p>2007-09-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: For Windows MinGW-based build, find Ghostscript\nfonts installed under C:/Program Files/.</li>\n<li>VisualMagick/bin/delegates.mgk: Adjust quoting to Ghostscript arguments\nso that Ghostscript DLL is passed correct commands.</li>\n<li>config/delegates.mgk.in: Adjust quoting to Ghostscript arguments\nso that Ghostscript DLL is passed correct commands.</li>\n<li>configure.ac: Provide defaults for GSColorAlphaDevice and GSGrayDevice.</li>\n<li>magick/nt_base.c (NTGhostscriptGetString): Support &quot;GPL Ghostscript&quot;.</li>\n</ul>\n</blockquote>\n<p>2007-09-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/ps.c (WritePSImage): Improved Postscript writer\nperformance.</li>\n</ul>\n</blockquote>\n<p>2007-09-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/profile.c (AllocateImageProfileIterator): New function to\nallocate an image profile iterator.\n(DeallocateImageProfileIterator): New function to deallocate an\nimage profile iterator.\n(NextImageProfile): New function to advance the image profile\niterator to the next profile.</li>\n<li>magick/image.h (Image): Profiles are now stored in a generic\ncontainer.  As planned years ago, the color_profile, iptc_profile,\ngeneric_profile, and generic_profiles members are now removed.</li>\n</ul>\n</blockquote>\n<p>2007-09-01  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c Ability to read true color bitmap with invalid palette size\nlike other readers do.</li>\n</ul>\n</blockquote>\n<p>2007-08-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (ClonePixelCacheMethods): Remove DLL export.\n(DestroyCacheInfo): Remove DLL export.\n(GetCacheInfo): Remove DLL export.\n(ReferenceCache): Remove DLL export.</li>\n</ul>\n</blockquote>\n<p>2007-08-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageType): More tweaks to obtain the desired\nbehavior when converting to a bilevel image.</li>\n<li>coders/tiff.c (WriteTIFFImage): Logic which decided the output\nsubformat to write was too convoluted to understand, and in fact\npalette images were not be written sometimes when they should be\n(bug added on 2007-08-19).  Deleted the convoluted code and\nreplaced with a different design which should be more correct and\nflexible.\n(ReadTIFFImage): Decided to read bilevel TIFF using a colormap\nsince there are significant internal advantages to doing so.\nHowever, the writer is carefully designed to output normal bilevel\nTIFF so this should not annoy TIFF users.</li>\n<li>magick/constitute.c (ImportImagePixelArea): Re-wrote grayscale\npseudoclass import to be more efficient and more tidy.</li>\n</ul>\n</blockquote>\n<p>2007-08-30  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/art.c Added ART writer</li>\n</ul>\n</blockquote>\n<p>2007-08-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (ReadBlobLSBFloat): Promoted to be a public\ninterface (was in mat.c).\n(ReadBlobMSBFloat):Promoted to be a public interface (was in\nmat.c).</li>\n</ul>\n</blockquote>\n<p>2007-08-29  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/art.c InsertRow has been replaced by ImportImagePixelArea</li>\n</ul>\n</blockquote>\n<p>2007-08-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (ReadPNMImage): PNM &quot;raw&quot; formats are now read\nusing ImportImagePixelArea()</li>\n<li>magick/constitute.c (ExportImagePixelArea): Added an optional\nexport_info parameter for returning information back to the user.\n(ImportImagePixelArea): Added an optional import_info parameter\nfor returning information back to the user.</li>\n<li>coders/jbig.c (ReadJBIGImage): Use ImportImagePixelArea().\n(WriteJBIGImage): Use ExportImagePixelArea();</li>\n<li>coders/tiff.c (WriteTIFFImage): Make compression logic a bit\nmore tidy.</li>\n<li>coders/pcx.c (WritePCXImage): Use GetImageCharacteristics().</li>\n<li>coders/pcl.c (WritePCLImage): Use GetImageCharacteristics().</li>\n<li>coders/dib.c (WriteDIBImage): Use GetImageCharacteristics().</li>\n<li>coders/xpm.c (WritePICONImage): Use GetImageCharacteristics().</li>\n<li>coders/viff.c (WriteVIFFImage): Use GetImageCharacteristics().</li>\n<li>coders/tga.c (WriteTGAImage): Use GetImageCharacteristics().</li>\n<li>coders/sgi.c (WriteSGIImage): Use GetImageCharacteristics().</li>\n<li>coders/ps2.c (WritePS2Image): Use GetImageCharacteristics().</li>\n<li>coders/pdf.c (WritePDFImage): Use GetImageCharacteristics().</li>\n<li>coders/palm.c (WritePALMImage): Use GetImageCharacteristics().</li>\n<li>coders/ps.c (WritePSImage): Use GetImageCharacteristics().</li>\n<li>coders/jp2.c (WriteJP2Image): Use GetImageCharacteristics().</li>\n<li>coders/jpeg.c (WriteJPEGImage): Use GetImageCharacteristics().</li>\n<li>PerlMagick/t/read.t: Added read test for LSB <cite>float</cite> MAT.</li>\n</ul>\n</blockquote>\n<p>2007-08-26  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c: MAT reader now extensively uses ImportImagePixelArea.</li>\n</ul>\n</blockquote>\n<p>2007-08-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/Makefile.am: Add rwblob and rwfile tests for MAT format.</li>\n<li>magick/constitute.c: Re-wrote Export/Import Float/Double macros\nbecause they did not actually work right, and to eliminate the\nperformance penalty for native order.</li>\n</ul>\n</blockquote>\n<p>2007-08-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Add support for &quot;native&quot; endian parameter\nin PerlMagick.</li>\n<li>magick/command.c: Utilities now understand &quot;native&quot; as an\nargument to -endian.</li>\n<li>magick/image.h (enum EndianType): Added NativeEndian enum value.</li>\n<li>configure.ac: Test libtiff for TIFFSwabArrayOfTriples().</li>\n<li>magick/constitute.c (ExportImagePixelArea): Support export in\nlittle, big, and native endian.\n(ImportImagePixelArea): Support import in little, big, and native\nendian.</li>\n</ul>\n</blockquote>\n<p>2007-08-23  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (WriteMATLABImage): MAT writer uses\nExportImagePixelArea() now.  Fix issues noticed by valgrind.</li>\n</ul>\n</blockquote>\n<p>2007-08-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (WritePNMImage): Use <cite>-quality 0</cite> rather than\n<cite>-compress none</cite> to select the PNM ASCII subformats.  This change\nis made based on the principle of least surprise.</li>\n<li>magick/constitute.c (ExportImagePixelArea): Add a GrayQuantum\nimplementation for exporting from two color PsuedoClass.</li>\n<li>coders/pnm.c (WritePNMImage): Use GetImageCharacteristics() and\nExportImagePixelArea() in implementation.</li>\n</ul>\n</blockquote>\n<p>2007-08-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ExportImagePixelArea): Performance\nimprovements.\n(ImportImagePixelArea): Performance improvements.</li>\n</ul>\n</blockquote>\n<p>2007-08-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (IdentifyImageCommand): If &quot;%r&quot; is present in\n-format specifier, then read whole image.</li>\n<li>magick/utility.c (TranslateTextEx): Undocumented &quot;%r&quot;\nsubstitution now returns a string based on GetImageType() rather\nthan a concatentation of image class and &quot;Matte&quot;.</li>\n<li>coders/tiff.c (WriteTIFFImage): Use GetImageCharacteristics().</li>\n<li>magick/image.c (GetImageCharacteristics): New function to\nevaluate the basic characteristics of the image.\n(GetImageType): Use GetImageCharacteristics().</li>\n</ul>\n</blockquote>\n<p>2007-08-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (RegisterDPXImage): Remove extra newline in usage\nnote.</li>\n<li>coders/fax.c (RegisterFAXImage): Fix note to reflect that the\noutput from this coder is *not* a TIFF subformat as was previously\nclaimed.</li>\n<li>coders/tiff.c (WriteTIFFImage): Output G3 TIFF FAX images as per\nthe TIFF Class F specification.</li>\n</ul>\n</blockquote>\n<p>2007-08-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/{api.h, studio.h}: Strip out legacy MacOS 9 and VMS &quot;support&quot;.</li>\n<li>magick/{nt_base.c, unix_port.c} (MagickGetMMUPageSize): New function to obtain\nthe VM page size.</li>\n<li>magick/pixel_cache.c (PersistCache): Fix a terrible memory leak\nwhen reading MPC files.  Added Cache reference-count logging.</li>\n</ul>\n</blockquote>\n<p>2007-08-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (BenchMarkSubCommand): Added a new <cite>benchmark</cite>\nGraphicsMagick command which can be used to perform benchmarking\non any other GraphicsMagick command.</li>\n</ul>\n</blockquote>\n<p>2007-08-11  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (ReadMATImage): Support image is_grayscale flag.\nAdd some coder logging.</li>\n</ul>\n</blockquote>\n<p>2007-08-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/{paint.c, render.c, annotate.c}: Use AlphaComposite()\nfrom alpha_composite.h.</li>\n<li>magick/alpha_composite.h (BlendComposite): Move inline\nBlendComposite() to a header file since it is used in multiple\nplaces.</li>\n<li>magick/{shear.c, image.c}: Use BlendComposite() from\nalpha_composite.h.</li>\n<li>magick/image.c (SetImageDepth): Don't bother to test current\ndepth in advance. Preserve is_monochrome flag.  Encapsulate\nbit-reduction algorithm in a macro. Be a bit smarter with\nPseudoClass images.\n(SyncImage): Preserve is_monochrome flag.  Improve performance\nwhen image does not have an opacity channel.</li>\n<li>PerlMagick/t/read.t: Allow some error when reading double MAT.</li>\n</ul>\n</blockquote>\n<p>2007-08-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/read.t: Update MAT read tests according to\ninstructions from Fojtik Jaroslav.</li>\n</ul>\n</blockquote>\n<p>2007-08-06  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (ReadWPGImage): Support WPG files which use XOR\noperator.</li>\n</ul>\n</blockquote>\n<p>2007-08-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (ReadBlobLSBdouble): Migrate from mat.c.\n(ReadBlobMSBdouble): Migrate from mat.c.</li>\n</ul>\n</blockquote>\n<p>2007-08-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ExportImagePixelArea): Add optimized\nsupport for 2 and 16 color PseudoClass.\n(ImportImagePixelArea): Add optimized support for 2 and 16 color\nPseudoClass.</li>\n<li>magick/constitute.c (ImportImagePixelArea): Add option to output\npad bytes at end of pixel data.  Added optimized implementation of\nIndexQuantum for bilevel images.</li>\n<li>coders/tiff.c (WriteTIFFImage): Be smarter when writing gray\nPalette and grayscale TIFF images in order to not waste time.</li>\n<li>coders/bmp.c (ReadBMPImage): Use ImportImagePixelArea() when\nreading and writing bilevel and colormapped images.\n(WriteBMPImage): Use ExportImagePixelArea() when writing bilevel\nimages.</li>\n<li>magick/version.h.in: Added wrapping for copyright line to a\nreasonable width.</li>\n<li>AUTHORS: Added Daniel Kobras.</li>\n<li>magick/command.c (VersionCommand): Added feature support list to\n-version output.</li>\n</ul>\n</blockquote>\n<p>2007-08-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (AnimateImageCommand): Add support for -type to\n<cite>animate</cite>.\n(DisplayImageCommand): Add support for -type to <cite>convert</cite></li>\n<li>config/delegates.mgk.in, VisualMagick/bin/delegates.mgk: Added\ngs-gray and gs-color+alpha delegate definitions.</li>\n<li>coders/{ept.c, pdf.c, ps.c}: Respect a -type Bilevel, Grayscale,\nTrueColor, or TrueColorMatte request by passing appropriate\noptions to Ghostscript for rendering..</li>\n</ul>\n</blockquote>\n<p>2007-07-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ImportImagePixelArea): Improved read speed\nfor bilevel gray image.  Many thanks to Mark Mitchell for\ninspiration and ideas.</li>\n<li>coders/caption.c (ReadCAPTIONImage): Eliminate use of strcpy().</li>\n<li>coders/pnm.c (ReadPNMImage): Add logging as well as support for\nis_monochrome and is_grayscale flags.</li>\n<li>magick/color.h (IsMonochrome): Add parenthesis so macro is more\nrobust.</li>\n</ul>\n</blockquote>\n<p>2007-07-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/html.c (WriteHTMLImage): Eliminate use of strncat().</li>\n<li>coders/locale.c (ReadConfigureFile): Eliminate use of strncat().</li>\n<li>coders/png.c (ReadOnePNGImage): Eliminate use of strncat().</li>\n<li>magick/fx.c (ConvolveImage): Eliminate use of strncat().</li>\n<li>coders/tiff.c (WriteTIFFImage): Eliminate use of strncat().</li>\n<li>magick/delegate.c (InvokePostscriptDelegate): Eliminate\ndoubled-output when running in verbose mode.</li>\n</ul>\n</blockquote>\n<p>2007-07-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/delegate.c (InvokePostscriptDelegate): MagickSpawnVP()\nrequires three parameters.</li>\n</ul>\n</blockquote>\n<p>2007-07-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>bzlib: Updated bzip2 to 1.0.4.</li>\n<li>jbig: Updated jbigkit to 1.6</li>\n<li>jp2: Updated JasPer to 1.900.1.</li>\n<li>lcms: Updated lcms to 1.16</li>\n<li>png: Updated libpng to 1.2.18.</li>\n</ul>\n</blockquote>\n<p>2007-07-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xc.c (ReadXCImage): If ImageInfo type field is set to\nTrueColorType or TrueColorMatteType type, then return a\nDirectClass image, otherwise a PseudoClass image is returned as\nbefore.  From the command line this can be used like:\n<cite>gm convert -size 640x480 -type TrueColor xc:red red.miff</cite>.\nPrograms may also use this in order to obtain a DirectClass\ncanvas image to draw on.</li>\n<li>magick/enhance.c (LevelImage): Fix potential buffer overflow\nwhich was added since the 1.1 branch.</li>\n</ul>\n</blockquote>\n<p>2007-07-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/delegate.c (UnixShellTextEscape): Don't escape newline\ncharacter since it performs the opposite of what is desired.</li>\n</ul>\n</blockquote>\n<p>2007-07-23  Daniel Kobras  &lt;<a class=\"reference external\" href=\"mailto:kobras&#37;&#52;&#48;debian&#46;org\">kobras<span>&#64;</span>debian<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>magick/delegate.c (UnixShellTextEscape): Fix fencepost error</dt>\n<dd>when checking whether escaping is safe.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2007-07-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Retire VMS and MacOS 9 support from package.</li>\n</ul>\n</blockquote>\n<p>2007-07-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/{cmyk.c, gray.c, mono.c, rgb.c, uyvy.c, wbmp.c, yuv.c}\n(ReadFOOImage): Check for EOF while searching for start of image\ndata.</li>\n<li>tests/Makefile.am: Don't test PTIF format with blob I/O since it\nis not possible to pass the rwblob test and it is really an output\ndriver rather than a format.</li>\n<li>libtool: Update to latest CVS libtool.</li>\n<li>magick/constitute.c (ExportModulo8Quantum): Move Import and\nExport macros from header file since they are not used anywhere\nelse.</li>\n<li>coders/dpx.c: Add underscore suffix to macro local variable\nnames in order to avoid conflict with names in code using the\nmacros.</li>\n</ul>\n</blockquote>\n<p>2007-07-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c: Reduce the number of warnings when compiling\nthe Wand library.</li>\n<li>coders/xwd.c (XWD_OVERFLOW): Eliminate comparison between signed\nand unsigned.</li>\n<li>coders/pnm.c (ValidateScalingIndex): Eliminate check to see if\nunsigned type is less than zero.</li>\n<li>magick/log.c (LogMagickEvent): Even though log file name comes\nfrom a controlled source (log.mgk), perform safe numeric\nsubstitution on it.</li>\n<li>coders/xwd.c (ReadXWDImage): Eliminate conflict between locally\ndefined OVERFLOW macro and similarly named macro under Windows.</li>\n</ul>\n</blockquote>\n<p>2007-07-18  Daniel Kobras  &lt;<a class=\"reference external\" href=\"mailto:kobras&#37;&#52;&#48;debian&#46;org\">kobras<span>&#64;</span>debian<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (ReadXWDImage): Integer overflow fix\n(CVE-2007-1797).  From Debian patch\nxwd_integer_overflow_fixes_CVE-2007-1797.\n(ReadXWDImage): Fix for integer under/overflow.  From Debian patch\nxwd_overflow_fix.</li>\n<li>coders/wpg.c (ReadWPGImage): WPG segfault fix.  From Debian\npatch wpg_segfault_fix.</li>\n<li>coders/viff.c (ReadVIFFImage): Verify number of bands prior to\nusing image.  From Debian patch viff_heap_corruption_fix.</li>\n<li>coders/sun.c (ReadSUNImage): Sun segfault fix.  From Debian\npatch sun_segfault_fix.</li>\n<li>magick/blob.c (ReadBlobStream): Never try to read data beyond\nEOF in blob streams. Some (but not all) ReadBlob*() methods\nalready implemented similiar checks. Moving it to the central\nReadBlobStream() increases robustness and prevents out-of-bounds\nreads.  From Debian readblob_offset_robustness patch.</li>\n<li>coders/pnm.c (ReadPNMImage): Validate pixel scaling.  From\nDebian pnm_scale_fix patch.</li>\n<li>coders/pict.c (ReadPixmap): PICT segfault fix.  From Debian\npict_segfault_fix patch.</li>\n<li>coders/pcx.c (ReadPCXImage): PCX heap overflow fix.  From Debian\npcx_heap_overflow_fix patch.\n(ReadPCXImage): PCX segfault fix.  From Debian pcx_segfault_fix.</li>\n<li>magick/montage.c, PerlMagick/t/montage.t: Do not pass bogus\nnegative values to modulate shadow in montage. Instead, drop a\nconstant grey shadow like current ImageMagick.  From Debian\nmontage_shadow_fix patch.</li>\n<li>coders/png.c (ReadMNGImage): MNG segfault fix.  From Debian\nmng_segfault_fix patch.</li>\n<li>utilities/miff.4: MIFF man page apropos fix.  From\nDebian miff_apropos_fix patch.</li>\n<li>coders/icon.c (ReadIconImage): Icon segfault fix.  From Debian\nicon_segfault_fix patch.</li>\n<li>tests/drawtest.c: Make sure filename strings do not run out of\nbounds in drawtest. From Debian drawtest_segfault_fix patch.</li>\n<li>config/delegates.mgk.in: Remove obsolete option -2 when calling\ndcraw as a delegate.  From Debian dcraw_options_fix patch.</li>\n<li>coders/dcm.c (ReadDCMImage): Fix integer overflow in DCM\ncoder. (CVE-2007-1797).  From Debian dcm_overflow_fix patch.</li>\n<li>coders/bmp.c (ReadBMPImage): Verify file seek success.  From\nDebian bmp_overflow_fix patch.</li>\n</ul>\n</blockquote>\n<p>2007-07-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.h (MagickReallocMemory): It seems that realloc()\nfrees the provided memory pointer if the requested size is zero.\nThis was causing MagickReallocMemory() to perform a double-free\nunder error conditions.  Inspired by Debian\nrealloc_double_free_fix patch by Daniel Kobras.</li>\n</ul>\n</blockquote>\n<p>2007-07-18  Daniel Kobras  &lt;<a class=\"reference external\" href=\"mailto:kobras&#37;&#52;&#48;debian&#46;org\">kobras<span>&#64;</span>debian<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/quantize.c (GrayscalePseudoClassImage): Fix computation\nof memory required for colormap index\n(colormap_heap_overflow_fix).</li>\n</ul>\n</blockquote>\n<p>2007-07-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (WriteRunlengthPacket): Converted excessively long\nmacro to a function and hopefully eliminate warnings when using\nVisual Studio 2005.</li>\n<li>magick/pixel_cache.c (ClonePixelCache): Eliminate bug when\nsize_t is an unsigned type.</li>\n</ul>\n</blockquote>\n<p>2007-07-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): Address security issue noted by\nCVE-2006-0082\n<a class=\"reference external\" href=\"http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-0082\">http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-0082</a> in\nwhich output filenames matching arbitrary printf specifications\nmay cause GraphicsMagick to crash.</li>\n<li>magick/utility.c (TranslateTextEx): New version of TranslateText\nwhich allows copying each attribute via a user-provided callback\nfunction.</li>\n<li>magick/delegate.c (InvokeDelegate): Implement secure delegate\nexecution in POSIX environments in order to avoid injection of\narbitrary shell commands via carefully crafted filenames.  Fixes\nDebian Bug 345238 &quot;[CVE-2005-4601] Shell command injection in\ndelegate code (via file names)&quot;\n<a class=\"reference external\" href=\"http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=345238\">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=345238</a></li>\n</ul>\n</blockquote>\n<p>2007-07-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/forward.h: New header file to support forward type\ndeclarations.</li>\n<li><dl class=\"first docutils\">\n<dt>coders/pnm.c (ReadPNMImage):  Fix pixel scaling problem caused by</dt>\n<dd>floating point rounding error.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2007-07-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h: Provide pread() and pwrite() prototypes if they\nare missing.</li>\n<li>configure.ac: Check for missing pread() and pwrite() prototypes.</li>\n<li>m4/ac_func_fseeko.m4: Use fixed version of AC_FUNC_FSEEKO.</li>\n<li>magick/utility.c (SystemCommand): Avoid use of snprintf.</li>\n</ul>\n</blockquote>\n<p>2007-07-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c: Only replace getc_unlocked() and putc__unlocked()\nfor a thread-safe build.</li>\n<li>magick/studio.h: Always use fseeko() and ftello() if they are\navailable.</li>\n</ul>\n</blockquote>\n<p>2007-07-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Avoid using seek() if possible, and\ndon't use at all if the input is not seekable.</li>\n<li>coders/psd.c (ReadPSDImage): Eliminate memory leak when reading\nPSD files.  Fixes Sourceforge issue 1625477 &quot;Memory leak reading\nlayered PSD Image&quot;.</li>\n</ul>\n</blockquote>\n<p>2007-06-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Fixed -affine command argument\nvalidation. Fixes SourceForge issue 1743141 &quot;Affine matrix option\nparsing&quot;.</li>\n<li>config/magic.mgk: Added detection for BigTIFF.</li>\n<li>coders/tiff.c: Preliminary work to support BigTIFF.</li>\n</ul>\n</blockquote>\n<p>2007-06-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Fix problems encountered when reading and writing\nfrom/to pipes or compressed files.</li>\n</ul>\n</blockquote>\n<p>2007-06-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Improved the pixel data marshalling\nin order to obtain better read performance for 10-bit DPX.</li>\n<li>magick/blob.c (OpenBlob): Added support for MAGICK_MMAP_READ and\nMAGICK_MMAP_WRITE environment variable options to enable input and\noutput file access using mmap().</li>\n</ul>\n</blockquote>\n<p>2007-06-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (OpenBlob): Use MAGICK_IOBUF_SIZE to tune the size\nof the I/O buffer.  Sometimes performance is improved by using\nsomething other than the current default of 16KB.</li>\n</ul>\n</blockquote>\n<p>2007-06-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Handle case where compression\nkeyword is present but has value of <cite>None</cite>.</li>\n</ul>\n</blockquote>\n<p>2007-06-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (OpenBlob): Disable reading input files using\nmemory mapping since it has been learned that some operating\nsystems fail to do read-ahead on network files.  Without\nread-ahead, performance is poor.</li>\n<li>magick/resource.c (AcquireMagickResource): Map resource limit\nwas not being properly checked due to a typo.  The memory limit\nwas being tested instead.</li>\n<li>coders/tiff.c (ReadTIFFImage): Use libtiff to decode OJPEG\ncompressed files into RGB.  Probably requires new OJPEG\nimplementation from Joris Van Damme which is new in libtiff and\nnot yet released. I am not completely sure that this approach is\ncorrect yet.</li>\n</ul>\n</blockquote>\n<p>2007-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/xwindow.c (MagickXGetWindowImage): Set image-&gt;depth\nappropriately.</li>\n<li>many files: Compiler warnings reduction.</li>\n</ul>\n</blockquote>\n<p>2007-05-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/cineon.c (ReadCINEONImage): Alter sample scaling\nalgorithm a bit.</li>\n<li>tests/rwblob.c, tests/rwfile.c: Allow some slop when testing\nCineon format with QuantumDepth=8 since we are currently only\nsupporting 10 bit samples.</li>\n</ul>\n</blockquote>\n<p>2007-05-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Fix reading 12-bit grayscale\nJPEG.</li>\n</ul>\n</blockquote>\n<p>2007-05-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/cineon.c (WriteCINEONImage): Re-wrote Cineon writer from\nscratch.  There is no code originating from ImageMagick in this\nsource module any more.</li>\n</ul>\n</blockquote>\n<p>2007-04-30  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/art.c, coders.cut.c, coders/mat.c, coders/wpg.c: Add\nsupport for PingImage() so that image identification is fast by\ndefault.  Also eliminates error message produced by mat.c due to\nrotating an image which has no pixel cache.</li>\n</ul>\n</blockquote>\n<p>2007-04-09  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (ReadWPGImage): Fix for SourceForge bug id 1431805\n&quot;clip art wpg files cause access violation in graphics magick&quot;.</li>\n</ul>\n</blockquote>\n<p>2007-04-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (ModifyCache): Ensure that the cache nexus\nis open.  Fix for SourceForge bug id 1173713 &quot;segfault in\nModifyCache&quot;</li>\n<li>m4/acx_pthread.m4 (ACX_PTHREAD): Apply fixes necessary to\nsupport C++ compiler properly.</li>\n</ul>\n</blockquote>\n<p>2007-04-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/GraphicsMagick.pc.in: Fix for SourceForge bug id 1576616\n&quot;Fix includedir variable in pkg-config files&quot;.</li>\n<li>magick/pixel_cache.c (GetOnePixel): Fix for SourceForge bug id\n1572357 &quot;GetOnePixel definition appears incorrect&quot;.  It is true\nthat this function is intended for read-only purposes and that the\nPixelPacket value is returned directly.</li>\n<li>coders/pdf.c (WritePDFImage): Fix for SourceForge bug id 1510075\n&quot;Failed to write PDF with JPEG compression&quot;.</li>\n<li>magick/command.c (MogrifyImageCommand): Properly bubble up\nerrors and terminate further mogrify processing immediately. This\nin response to SourceForge bug id 1391421 &quot;problem doing resize on\n273x1 JPEG&quot;.</li>\n<li>magick/magick.c (InitializeMagickClientPathAndName): Fix for\nSourceForge bug id 1315109 &quot;segfault in InitializeMagick(NULL)&quot;.</li>\n<li>wand/magick_wand.c (MagickGetQuantumDepth): Fix for SourceForge\nbug id 1353744 &quot;MagickGetQuantumDepth doesn't work&quot;.</li>\n<li>PerlMagick/t/read.t: Added a test for WPG v1.</li>\n</ul>\n</blockquote>\n<p>2007-04-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c: Read Matlab files in both big and little endian\nformat.</li>\n</ul>\n</blockquote>\n<p>2007-03-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteDPXImage): Set DPX reference high quantity to\n2.047 rather than 2.048 since zero is assumed to occupy one count\nand 2.047 seems to be the convention even though the DPX\nspecification says the default is 2.048.  Technicolor uses 2.047.</li>\n<li>m4/acx_pthread.m4: Update version of ACX_PTHREAD macro used.</li>\n</ul>\n</blockquote>\n<p>2007-03-28  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:fojtik&#37;&#52;&#48;humusoft&#46;cz\">fojtik<span>&#64;</span>humusoft<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c: Support CTM translation in WPG reader.</li>\n</ul>\n</blockquote>\n<p>2007-03-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Store 10-bit Luma samples in the filled 32-bit\nstorage word starting with the datum in the least significant\nposition.</li>\n</ul>\n</blockquote>\n<p>2007-02-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated autoconf to version 2.61.</li>\n</ul>\n</blockquote>\n<p>2007-02-10  Daniel Kobras  &lt;<a class=\"reference external\" href=\"mailto:kobras&#37;&#52;&#48;debian&#46;org\">kobras<span>&#64;</span>debian<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/palm.c: (ReadPALMImage) Do not implicitly call\nReadBlobByte() twice in Min() macro. Patch thanks to Vladimir\nNadvornik. This was a regression introduced in patch for\nCVE-2006-5456. (CVE-2007-0770)</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2008.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2008.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2008-12-28  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c: Ability to read extension blocks.</li>\n<li>coders/fits.c: Fixed MaxTextExtent limitation of blocks.</li>\n</ul>\n</blockquote>\n<p>2008-12-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/OpenMP.rst: Add results for Window Vista 64-bit / AMD Phenom\nX4 9550.</li>\n<li>VisualMagick/installer/inc/body.isx: Revert yesterday's change\nregarding the placement of config files.  Place the config files\nin a <cite>config</cite> subdirectory just as before.</li>\n</ul>\n</blockquote>\n<p>2008-12-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/inc/body.isx: They say that when in Rome\nyou should do as the Roman's do.  Based on this philosophy, all of\nthe coder and filter DLLs are now installed to the same directory\nas the executables and DLLs which depend on them.  This eases\noperation under Windows Vista.</li>\n</ul>\n</blockquote>\n<p>2008-12-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c: First pass at supporting large file access under\nWindows.</li>\n</ul>\n</blockquote>\n<p>2008-12-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c (InitializeMagickResources): Improve resource\nestimation for Microsoft Windows systems with large memory.</li>\n<li>magick/segment.c: Added some code to dump histograms with\n<cite>-verbose -verbose</cite>.</li>\n<li>coders/tiff.c: Support reading/writing 16 and 24 bit float TIFF\nfiles.</li>\n<li>magick/constitute.c (ExportViewPixelArea): Support exporting 16\nand 24 bit short floats.  Relies on code developed for\nGraphicsMagick by Richard Nolde.\n(ImportViewPixelArea): Support importing 16 and 24 bit short\nfloats.  Relies on code developed for GraphicsMagick by Richard\nNolde.</li>\n</ul>\n</blockquote>\n<p>2008-12-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/operator.h (enum QuantumOperator): Added LogQuantumOp,\nMaxQuantumOp, MinQuantumOp, and PowQuantumOp enumerations as well\nas &quot;Log&quot;, &quot;Max&quot;, &quot;Min&quot;, and &quot;Pow&quot; options to -operator.</li>\n</ul>\n</blockquote>\n<p>2008-12-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): The -write option was not\nimplemented in a useful fashion and the +write option never worked\nat all.  Re-implement -write and eliminate +write from the\ndocumentation since +write is not needed.</li>\n</ul>\n</blockquote>\n<p>2008-12-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage, WriteTIFFImage) Support reading\nand writing 64-bit integer TIFF.</li>\n<li>magick/constitute.c (ImportViewPixelArea): Add support for\nimporting 64-bit integer values.\n(ImportViewPixelArea): Add support for exporting 64-bit integer\nvalues.</li>\n</ul>\n</blockquote>\n<p>2008-12-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Fix bug with reading one bit per\nsample RGB images.</li>\n</ul>\n</blockquote>\n<p>2008-12-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (OpenCache): Fix a code ordering problem\nwhich results in <cite>identify</cite> throwing an assertion for PseudoClass\nimage files.  This bug was added in the 1.3.2 release.</li>\n<li>coders/tiff.c (ReadTIFFImage): Fix bug with <cite>ping</cite> mode.</li>\n</ul>\n</blockquote>\n<p>2008-12-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c: Proper signed to unsigned conversion for 64 bit LSB images.</li>\n</ul>\n</blockquote>\n<p>2008-12-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/Makefile.am: When X11 is disabled, don't compile the\nX11-specific source modules.  Don't ever install any X11-related\nheader files.</li>\n</ul>\n</blockquote>\n<p>2008-12-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/segment.c (SegmentImage): Use <cite>double</cite> rather than 64-bit\ninteger to accumulate totalized values.  Make the cluster summary\nreport more concise.</li>\n</ul>\n</blockquote>\n<p>2008-12-06  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c: Fix for 64 bit images.</li>\n</ul>\n</blockquote>\n<p>2008-12-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/segment.c (SegmentImage): Cluster threshold is expressed\nas a percentage of total cluster pixels.  Optimize for larger\nimages.</li>\n</ul>\n</blockquote>\n<p>2008-12-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/segment.c (SegmentImage): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-11-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (ExpandFilenames): Remove some arbitrary\nargument length limits.  Pass -convolve argument without any\nadditional checking.  Verify that strings are not truncated during\ncopy.\n(ListFiles): Be more memory efficient.</li>\n<li>magick/fx.c (ConvolveImage): Fix formatting problem when logging\nthe convolution kernel used.</li>\n<li>magick/utility.c (TranslateTextEx): Support formatting huge\ncomment text.</li>\n</ul>\n</blockquote>\n<p>2008-11-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/fx.c (ConvolveImage): Don`t process opacity channel\nunless image has one.</li>\n<li>magick/effect.c (MotionBlurImage): Use\nAcquireOnePixelByReference() rather than AcquireImagePixels() to\nretrieve one pixel.  This is much more efficient.\n(AdaptiveThresholdImage): Don`t process opacity channel unless\nimage has one.\n(BlurImage): Don`t process opacity channel unless image has one.</li>\n</ul>\n</blockquote>\n<p>2008-11-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/profile.c (ProfileImage): +profile now supports a simple\nexclusion syntax.  For example, to strip all of the profiles\nexcept for the ICM profile use +profile '!icm,*'.  The new syntax\nalso allows multiple profile names to be listed at once.  The\nprimary requirement is that all excluded profiles must be listed\nprior to those to be stripped.</li>\n</ul>\n</blockquote>\n<p>2008-11-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/transform.c (RollImage): Remove image storage class\nalteration.\n(CompositeImageRegion): Ensure that the canvas image storage class\nis correct.</li>\n</ul>\n</blockquote>\n<p>2008-11-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>config/delegates.mgk.in: Since we removed support for <cite>spawn</cite> a\nlong time ago, and no longer execute using the Unix shell by\ndefault, we need to add an ampersand to the end of the two entries\npreviously using <cite>spawn</cite> so that the display program does not hang\nwhen it invokes the external program.</li>\n<li>utilities/Makefile.am (UTILITIES_TESTS): Add preview-based\ntests.</li>\n<li>coders/preview.c (WritePreviewImage): Solarize requires a\nthreshold argument.</li>\n<li>coders/vid.c (WriteVIDImage): Eliminate memory leak.</li>\n<li>magick/montage.c (MontageImages): Fix continued use of freed\nmemory.</li>\n</ul>\n</blockquote>\n<p>2008-11-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/omp_data_view.c (AccessThreadViewDataById): New function\nto allow retrieving data via the index it was registered with.</li>\n<li>magick/enhance.c (BuildChannelHistograms): EnhanceImage() and\nNormalizeImage() now share one common function for generating the\nhistogram.</li>\n<li>magick/enhance.c (ModulateImage): Improve performance a bit.\n(ContrastImage): Improve performance a bit.\n(GammaImage): Improve performance a bit.</li>\n</ul>\n</blockquote>\n<p>2008-11-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/authors.rst: List Mark Mitchell as an author.</li>\n<li>utilities/tests/msl_composite.sh: Fix <cite>rm -f</cite> without a valid\nargument which annoyed NetBSD.</li>\n<li>coders/fits.c: Impose a limit on the length of the row PDU.\nMake sure that GraphicsMagick version information does not\noverflow the length allowed by a row PDU.</li>\n</ul>\n</blockquote>\n<p>2008-11-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (WriteJPEGImage): Use DCT algorithm default from\nthe library rather than the header file.</li>\n<li>magick: Adjust OpenMP scheduling options based on observed\nbehavior.</li>\n</ul>\n</blockquote>\n<p>2008-11-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c (IntegralRotateImage): Added OpenMP acceleration\nfor rotate by 90 and 270 degrees.</li>\n<li>configure.ac: New --disable-openmp-slow configure for disabling\nuse of OpenMP for algorithms which may run slower on operating\nsystems with crummy thread libraries.  This still allows gaining\nthe benefits from OpenMP for CPU hogs.  Verified to help with\nFreeBSD 7.0 and Apple OS-X Leopard.</li>\n<li>magick/semaphore.c: Trimmed out the debug code in order to\nobtain a bit more performance.</li>\n</ul>\n</blockquote>\n<p>2008-11-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: Allow the user to specify the DCT method\n(jpeg:dct-method), or if huffman encoding should be enabled\n(jpeg:optimize-coding=true).  Default the DCT method to the\nlibjpeg default rather than forcing it to JDCT_FLOAT since float\nis slower on some systems.</li>\n</ul>\n</blockquote>\n<p>2008-11-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (BlobClose): Leak a little bit less memory when\nreading a JP2 file.</li>\n</ul>\n</blockquote>\n<p>2008-11-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/wandtest.c: Eliminate memory leak.</li>\n<li>wand/drawing_wand.c (DestroyDrawingWand): Eliminate memory\nleaks.</li>\n<li>coders/xwd.c (WriteXWDImage): Force colormapped images with more\nthan 256 colors to DirectClass.</li>\n<li>magick/enhance.c (ModulateImage): Improve progress message.</li>\n<li>coders/msl.c: Eliminate memory leaks.</li>\n<li>GraphicsMagick.spec.in: Apply RPM spec file fixes from Giacomo\nTenaglia for Red Hat Linux 4.</li>\n</ul>\n</blockquote>\n<p>2008-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/msl.c: Fix bug with attributes becoming appended to\nthemselves.  Resolves SF issue 2255754. Reflowed code.</li>\n</ul>\n</blockquote>\n<p>2008-11-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: GraphicsMagick 1.3 released.\nNext release on head will be 1.4.</li>\n<li>www/OpenMP.rst: Updated with latest measurement data.</li>\n<li>www/benchmarks.rst: Updated with latest benchmark data.</li>\n<li>coders/url.c (RegisterURLImage): Register HTTP and FTP URL\nsupport in the &quot;unstable&quot; category since these are capable of\naccessing the network and therefore represent a potential security\nissue.  Register the FILE URL support in the &quot;stable&quot; category\nsince it is capable of incorporating local disk files, which may\nstill represent a security security issue for server applications.\nNote that disabling these functions might cause some existing MSL,\nMVG and SVG scripts to stop working if they use external URLs.</li>\n</ul>\n</blockquote>\n<p>2008-11-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (ReadPNMImage): Sequential multi-thread the PNM raw\nformat readers. Can improve read performance quite substantially\nfor large PBM and PGM files, and less so for PPM.  There is most\nbenefit for systems with more I/O than one CPU core will support.\nSystems with slow I/O and a relatively fast CPU may see somewhat\ndiminished read performance with more CPU consumption.  As such,\nthis is effectively a verification that multi-threading the reader\nis possible, and may be of benefit to power-users.</li>\n<li>magick/omp_data_view.c (AllocateThreadViewDataArray): New\nfunction to allocate a thread view data array.  Updated modules\nusing similar code to use this function in order eliminate\nuseless redundancy.</li>\n</ul>\n</blockquote>\n<p>2008-11-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c: Incorporate OMP thread views into the\npixel cache so usage is less invasive.  Update OMP-enhanced source\nmodules to suit.\n(GetImagePixelsEx): New function similar to GetImagePixels()\nexcept that it reports exceptions to a user-provided structure.\n(SetImagePixelsEx): New function similar to SetImagePixels()\nexcept that it reports exceptions to a user-provided structure.\n(SyncImagePixelsEx): New function similar to SyncImagePixels()\nexcept that it reports exceptions to a user-provided structure.\n(AccessImmutableIndexes): New function to access read-only\ncolormap indexes.\n(AccessMutableIndexes): New function to access writeable colormap\nindexes.\n(AccessMutablePixels): New function to access writeable pixels.\n(AccessDefaultCacheView): New function to access the default cache\nview.</li>\n</ul>\n</blockquote>\n<p>2008-11-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (BenchmarkImageCommand): With no other\narguments, the benchmark command now defaults to one iteration.</li>\n<li>magick/effect.c (SpreadImage): Offsets array size is a prime\nnumber to help avoid beating.\n(SpreadImage): Ensure that spread loops are always terminal.</li>\n<li>magick/utility.c (MagickRandReentrant): Fix bug where rand() was\nbeing continually re-seeded if rand_r() was not available.</li>\n</ul>\n</blockquote>\n<p>2008-11-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/tests/msl_composite.sh: Replace SVG image generation\nwith simpler approach which properly centers the text.  Use our\nown font so that tests will pass if the user does not have fonts\ninstalled.</li>\n<li>magick/utility.c (GetMagickDimension): Extend to support parsing\noptional x and y offset values and use to fix parsing for\n-oil-paint and -unsharp when sscanf() is C'99 compliant.</li>\n</ul>\n</blockquote>\n<p>2008-11-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.h (AcquireOneCacheViewPixel): Pass pixel to\nupdate by reference.\n(AcquireOnePixelByReference): New private inline method which\npasses pixel to update by reference.</li>\n<li>magick/omp_thread_view.h (AcquireOneThreadViewPixel): Pass pixel\nto update by reference.</li>\n<li>magick/alpha_composite.h (BlendCompositePixel): Replace\nBlendComposite with BlendCompositePixel, which passes the\ncomposite pixel by reference.\n(AlphaCompositePixel): Replace AlphaComposite with\nAlphaCompositePixel, which passes the composite pixel by\nreference.\n(AtopCompositePixel): Replace AtopComposite with\nAtopCompositePixel, which passes the composite pixel by reference.</li>\n<li>configure.ac: With excessive maintenance releases, the library\nage portion of MAGICK_LIB_VERSION was overflowing its allotted\nspace.  This resulted in 1.1.X releases reporting the wrong\nMagickLibVersion as of 1.1.10.  Fix this by supporting up to 99\nvalues for each field.</li>\n</ul>\n</blockquote>\n<p>2008-11-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Fix passing the --with-windows-font-dir option via\nDISTCHECK_CONFIG_FLAGS.</li>\n<li>utilities/tests/msl_composite.sh: Integrated MSL composition\ntest script contributed by Max Hohenegger, Max at hohenegger.eu.</li>\n<li>magick/command.c (ConjureImageCommand): Return status was\ninverted so one was returned for command success rather than zero.</li>\n</ul>\n</blockquote>\n<p>2008-11-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png: Updated libpng to 1.2.33 release.</li>\n<li>magick/color.c (FuzzyColorMatch): If fuzz is zero then\ncompletely use the result of ColorMatch() rather than entering\nunnecessary expensive code.</li>\n</ul>\n</blockquote>\n<p>2008-10-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h: Make sure we don't conflict with OpenMP\nimplementation if it is active but we are not using it.</li>\n</ul>\n</blockquote>\n<p>2008-10-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h (HAVE_OPENMP): Add logic to make sure that\nOpenMP is only engaged for OpenMP 2.0 or later.</li>\n<li>magick/command.c (VersionCommand): Report OpenMP version.</li>\n<li>Makefile.am: The Magick++ build was supposed to be optional. Now\nit is.</li>\n<li>Makefile.am: Eliminated .tar.bz2 and .zip packages from the\ndistribution.  The .tar.bz2 package was hardly smaller than the\n.tar.gz package so it wasted 5.9MB with little benefit.  The\ncompression ratio on the .zip archives is absolutely terrible so\neliminating zip eliminates huge 9.6MB and 25MB files from the\ndistribution equation.  Windows users can easily learn how to use\nthe vastly more efficient 7-Zip format.</li>\n</ul>\n</blockquote>\n<p>2008-10-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Rationalize OpenMP tests to make sure that OpenMP\ncan not be enabled without thread support.</li>\n</ul>\n</blockquote>\n<p>2008-10-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c (CompositeImageRegion): Add some minimal\nregion limit checking.  Not completed yet.</li>\n<li>magick/transform.c (RollImage): Accellerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-10-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h (omp_get_thread_num): Remove spurious trailing\n<cite>;</cite>.</li>\n<li>magick/render.c (DrawPrimitive): Make method private since\nnothing else is using it.</li>\n<li>magick/omp_thread_view.h (AccessThreadView): Inline function for\na bit more performance.\n(AcquireOneThreadViewPixel) Inline function for a bit more\nperformance.</li>\n</ul>\n</blockquote>\n<p>2008-10-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>pragma omp parallel for: Use consistent static scheduling\nthroughout and ensure that 64 threads can be usefully engaged on a\n1024 row image.</li>\n<li>magick/pixel_iterator.c (SetRegionThreads): Implement logic so\nthat pixel iterators execute single-threaded when invoked on tiny\nregions.</li>\n<li>magick/pixel_cache.c (SetNexus): Make staging buffer memset()\nconditional in order to dramatically diminish impact to small\naccesses.  This memset() only exists to make valgrind happy.</li>\n</ul>\n</blockquote>\n<p>2008-10-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Fix progress monitor for the case\nof reading planar stripped images.</li>\n</ul>\n</blockquote>\n<p>2008-10-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (DespeckleImage): Accelerate using OpenMP.</li>\n<li>magick/paint.c (OpaqueImage): Update to use pixel iterators.\n(TransparentImage): Update to use pixel iterators.</li>\n<li>magick/decorate.c (FrameImage): Accelerate using OpenMP.\n(RaiseImage): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-10-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c (CompositeImageRegion): Start of new function\nto act as a lighter-weight yet more flexible image composition\ninterface.</li>\n<li>magick/transform.c (ChopImage): Accelerate using OpenMP.\n(CropImage): Accelerate using OpenMP.\n(FlipImage): Accelerate using OpenMP.\n(FlopImage): Accelerate using OpenMP.</li>\n<li>magick/effect.c (ThresholdImage): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-10-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (AcquireOneCacheViewPixel): Optimize\nimplementation.</li>\n<li>magick/effect.c (MedianFilterImage): Accelerate using OpenMP.\n(ReduceNoiseImage): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-10-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/fx.c (WaveImage): Accelerate using OpenMP.\n(SwirlImage): Accelerate using OpenMP.\n(ImplodeImage): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-10-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (GetCacheViewRegion): New function to\nreturn the region bounded by a pixel cache view.</li>\n<li>magick/constitute.c (ExportViewPixelArea): New function to\nsupport exporting the pixels from a pixel cache view.\n(ImportViewPixelArea): New function to support importing pixels\nto a pixel cache view.</li>\n<li>magick/pixel_cache.c (ReadStream): Eliminated function.\n(WriteStream): Eliminated function.\n(ClonePixelCacheMethods): Eliminated function.</li>\n<li>magick/image.h: Eliminated StreamHandler call-back type.\nEliminated ImageInfo stream member.</li>\n<li>magick/pixel_cache.c (GetCacheViewArea): New function to return\nthe area of a cache view.\n(AccessCacheViewPixels): New function to access already selected\ncache view pixels.</li>\n</ul>\n</blockquote>\n<p>2008-10-19  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c: Remove unused exponential data.</li>\n</ul>\n</blockquote>\n<p>2008-10-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/omp_thread_view.c: Move OMP Thread View functions out of\npixel cache module and put them in this new module.</li>\n<li>coders/xtrn.c (ReadXTRNImage): XTRNSTREAM mode was never\nimplemented so remove unfinished stub code.</li>\n</ul>\n</blockquote>\n<p>2008-10-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageDepth): Needed to assign image depth\nattribute to user-specified depth rather than only altering the\npixels.\n(SetImageOpacity): Reimplement using pixel iterators.\n(AverageImages): Accelerate using OpenMP.\n(GetImageBoundingBox): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ConstituteTextureImage): Accelerate using\nOpenMP.</li>\n<li>magick/image.c (TextureImage): Accelerate using OpenMP.</li>\n<li>magick/render.c (DrawAffineImage): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-10-13  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c Fixed palette problem for &gt;8 bit images.</li>\n</ul>\n</blockquote>\n<p>2008-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): Using +page now resets image\npage offsets as documented for convert and mogrify.</li>\n</ul>\n</blockquote>\n<p>2008-10-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (GradientImage): Re-do OpenMP accelleration based\non new pixel cache interface for better performance.</li>\n<li>coders/dpx.c (ReadDPXImage): Progress monitor needs to tick when\nrow count is updated.</li>\n<li>coders/fits.c (ReadFITSImage): Update to use\nMagickFindRawImageMinMax().\n(WriteFITSImage): Expand buffer size to MaxTextExtent.  Include\nGraphicsMagick version in FITS header.</li>\n<li>coders/mat.c (ReadMATImage): Update to use\nMagickFindRawImageMinMax().</li>\n<li>magick/constitute.c (MagickFindRawImageMinMax): New internal\nfunction to assist with finding the minimum and maximum data of\nraw image files.</li>\n</ul>\n</blockquote>\n<p>2008-10-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (AcquireThreadViewPixels): Convert thread\nset view convenience methods into library methods because the\ninline methods were causing the Sun Studio compiler to produce\nthread unsafe code.  Due to likely beneficial inlining in the\nlibrary, this is not expected to cause any performance impact.</li>\n</ul>\n</blockquote>\n<p>2008-10-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/filter.t: Add a test for UnsharpMask.</li>\n<li>magick/effect.c (UnsharpMaskImage): Use Blur rather than\nGaussianBlur to create blur image since it is faster.</li>\n<li>magick/pixel_cache.c (AllocateThreadViewDataSet): Add a\ndestructor function in case data should not be destroyed, or needs\nsomething other than MagickFree().\n(AllocateThreadViewDataSet): Use user-provided destructor to free\nuser data.</li>\n<li>scripts/format_c_api_doc.py: Improvements from Mark Mitchell to\nperform keyword/target substitions and wrap function prototypes.</li>\n<li>coders/dpx.c (ReadDPXImage): Accellerate reader using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/api/types.rst: Convert types.html to reStructured text\nformat.</li>\n</ul>\n</blockquote>\n<p>2008-10-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/monitor.c (MagickMonitorFormatted): New method to support\nissuing a formatted progress monitor message.  Use it throughout\nso that file name is included in progress indication.</li>\n</ul>\n</blockquote>\n<p>2008-10-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Bootstrap with autoconf 2.63.  Require autoconf\n2.62 to bootstrap.</li>\n</ul>\n</blockquote>\n<p>2008-10-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www: Adopted improved web page design by Mark Mitchell.</li>\n</ul>\n</blockquote>\n<p>2008-10-04  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c coders/mat.c Used a same piece of code to calculate\nmin and max data value.</li>\n</ul>\n</blockquote>\n<p>2008-09-30  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c Fixed 16 bit fits writer that wrote wrongly\nshaped unsigned ints.</li>\n</ul>\n</blockquote>\n<p>2008-09-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/conjure.imdoc: Applied patches from Max at hohenegger.eu to\nmention previously undocumented elements and to provide a\ncomposition example.</li>\n</ul>\n</blockquote>\n<p>2008-09-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c (IntegralRotateImage): Accelerate rotation by 0\nand 180 degrees using OpenMP.\n(XShearImage): Accellerate using OpenMP (accellerates -rotate and\n-shear).\n(YShearImage): Accellerate using OpenMP (accellerates -rotate and\n-shear).</li>\n</ul>\n</blockquote>\n<p>2008-09-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (MotionBlurImage): Enable OpenMP now that pixel\ncache is re-entrant.</li>\n<li>magick/pixel_iterator.c: Updated to use thread view convenience\ninline methods as proof of principle.</li>\n<li>magick/pixel_cache.h: Added convenience inline methods to make\nuse of thread views a bit more pleasant.</li>\n</ul>\n</blockquote>\n<p>2008-09-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (ShadeImage): Fix valgrind gripe.\n(MedianFilterImage): Fix valgrind gripe.</li>\n</ul>\n</blockquote>\n<p>2008-09-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c: Pixel cache is believed to be thread safe\nnow.</li>\n<li>magick/deprecate.c (AcquireCacheView): Deprecate this function.\n(GetCacheView): Deprecate this function.\n(SetCacheView): Deprecate this function.\n(SyncCacheView): Deprecate this function.</li>\n<li>magick/pixel_cache.c (AcquireCacheViewPixels): New function to\nreplace AcquireCacheView().\n(GetCacheViewPixels): New function to replace GetCacheView().\n(SetCacheViewPixels): New function to replace SetCacheView().\n(SyncCacheViewPixels): New function to replace SyncCacheView().</li>\n<li>coders/msl.c: Applied patches from Max at hohenegger.eu which\nfix a MSL parsing error related to gamma, and erroneous text\ncomments which claim that elements can't have attributes.</li>\n</ul>\n</blockquote>\n<p>2008-09-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (ResizeImage): Move OpenMP instrumentation to\nouter loop so that eventually there can be more performance.</li>\n</ul>\n</blockquote>\n<p>2008-09-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (MinifyImage): Accelerate using OpenMP.</li>\n<li>magick/command.c (ConvertImageCommand, MogrifyImageCommand):\nAccept -gaussian-blur as a synonym for -gaussian.\n(ConvertImageCommand, MogrifyImageCommand): Provide access to\nMinifyImage() via -minify.\n(ConvertImageCommand, MogrifyImageCommand): Provide access to\nMagnifyimage() via -magnify.</li>\n</ul>\n</blockquote>\n<p>2008-09-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/channel.c (ImportImageChannelsMasked): New function to\nimport all the channels from an image except for the channels\nspecified.</li>\n<li>magick/effect.c (AddNoiseImageChannel): New function to add\nnoise to an image channel.\n(BlurImageChannel): New function to blur one image channel.\n(GaussianBlurImageChannel): New function to gaussian blur an image\nchannel.\n(UnsharpMaskImageChannel): New function to unsharpmask an image\nchannel.\n(SharpenImageChannel): New function to sharpen an image channel.</li>\n</ul>\n</blockquote>\n<p>2008-09-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (MotionBlurImage): Use GetOptimalKernelWidth1D()\nto estimate a reasonable convolution kernel size.  Prepare code\nfor OpenMP but don't enable OpenMP until it runs faster.\n(AddNoiseImageChannel): New function to apply noise to a specified\nimage channel.</li>\n</ul>\n</blockquote>\n<p>2008-09-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (ConvertImageCommand): Provide <cite>convert</cite> access\nto MotionBlurImage() via -motion-blur option.\n(MogrifyImageCommand): Provide <cite>mogrify</cite> access to\nMotionBlurImage() via -motion-blur option.</li>\n</ul>\n</blockquote>\n<p>2008-09-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (SpreadImage): Accelerate using OpenMP.</li>\n<li>coders/msl.c: Applied MSL patch from graphicsmagick-bugs list to\ncorrect handling of geometry x,y values by setting gravity\nattribute to ForgetGravity.</li>\n</ul>\n</blockquote>\n<p>2008-09-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (ShadeImage): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-09-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (RandomChannelThresholdImage): Accelerate using\nOpenMP.  Support individual thresholding of the color channels.\n(BlurImage): Blur was failing for PseudoClass images.  This bug\nwas added on 2008-09-08.</li>\n<li>magick/pixel_cache.c (AcquireOneCacheViewPixel): New function to\nreturn just one pixel from a cache view.</li>\n</ul>\n</blockquote>\n<p>2008-09-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (EnhanceImage): Accelerate using OpenMP.\n(BlurImageScanlines): Added optimizations.</li>\n<li>magick/shear.c (IntegralRotateImage): Add missing progress\nindication for 90 and 270 degrees rotation.</li>\n<li>www/perl.html: Fix formatting of examples.  Should address\nSourceForge issue [ 2100339 ] &quot;Wrong format in example script on\nweb page&quot;.</li>\n</ul>\n</blockquote>\n<p>2008-09-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (BlurImage): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-09-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/fx.c (ColorizeImage): Re-implement using pixel iterators.\n(MorphImages): Re-implement using pixel iterators.\n(OilPaintImage): Accelerate using OpenMP.\n(SolarizeImage): Re-implement using pixel iterators.</li>\n</ul>\n</blockquote>\n<p>2008-09-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/fx.c (ConvolveImage): Accelerate using OpenMP.</li>\n<li>magick/effect.c (AdaptiveThresholdImage): Accelerate using OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-09-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c: Exhuastive study of the pixel cache code\nreveals that it is inscrutable and not implemented in a fashion\nwhich enables useful multi-threading.  Therefore, the cache view\ninterfaces are now made OpenMP-safe via a global critical section.</li>\n</ul>\n</blockquote>\n<p>2008-09-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_iterator.c: Reduce use of critical sections around\npixel cache to the bare minimum based on analysis and testing.\nUnfortunately, testing shows that the pixel cache views are still\nnot 100% thread safe so the extra locking is still required.</li>\n<li>magick/pixel_cache.c (ModifyCache): Make implementation thread\nsafe.  This required removing a thread-unsafe optimization from\nBill Radcliffe.</li>\n<li>magick/command.c (BenchmarkImageCommand): Restore original\nclient name for each loop so that it is not extended further for\neach iteration.</li>\n<li>magick/semaphore.c (UnlockSemaphoreInfo): Decrement lock depth\nunder protection of the lock.</li>\n</ul>\n</blockquote>\n<p>2008-09-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (AddNoiseImagePixels): Update to pass per-thread\n<cite>seed</cite> value for more performance.</li>\n</ul>\n</blockquote>\n<p>2008-08-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gem.c (GenerateDifferentialNoise): Use\nMagickRandReentrant(). Added a <cite>seed</cite> argument so that we can pass\na per-thread <cite>seed</cite> value.</li>\n<li>magick/utility.c (MagickRandNewSeed): New function to produce a\nsemi-random <cite>seed</cite> value.\n(MagickRandReentrant): New function which works like rand() but\nattempts to be re-entrant if possible by allowing a seed value to\nbe passed.</li>\n</ul>\n</blockquote>\n<p>2008-08-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/channel.c (SetImageChannelDepth): Re-implement using\nQuantumOperatorImage().</li>\n<li>magick/image.c (SetImageDepth): Re-implement using\nQuantumOperatorImage().</li>\n<li>magick/operator.h (QuantumOperator): Added DepthQuantumOp for\nsetting the channel depth.</li>\n<li>magick/command.c (BenchmarkImageCommand): Add CPU-based\niteration rate metric to benchmark output.</li>\n<li>magick/resource.c (ListMagickResourceInfo): Include quantum\ndepth, bits per pixel, and process address size in resource\noutput so that output is more complete.</li>\n</ul>\n</blockquote>\n<p>2008-08-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SyncImage): Re-implement using pixel iterators.\n(SortColormapByIntensity): Re-implement using pixel iterators.\n(ClipPathImage): Re-implement using pixel iterators.\n(CycleColormapImage): Re-implement using pixel iterators.\n(GetImageDepth): Re-implement using pixel iterators.\n(GradientImage): Parallize inner loop for speedup with larger\nimages.\n(ReplaceImageColormap): Re-implement using pixel iterators.\n(SetImage): Re-implement using pixel iterators.</li>\n</ul>\n</blockquote>\n<p>2008-08-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/operator.c (QuantumGamma): Removed unnecessary OpenMP\nrequest on inner loops.</li>\n<li>magick/enhance.c (EqualizeImage,NormalizeImage): Execute\nhistogram generation pixel iterator with just one thread to\ndecrease contention for the histogram array.</li>\n<li>magick/pixel_iterator.c (InitializePixelIteratorOptions): New\nfunction to initialize PixelIteratorOptions with defaults.</li>\n<li>magick/pixel_iterator.h (PixelIteratorOptions): New structure to\nsupport passing pixel iterator execution options.</li>\n</ul>\n</blockquote>\n<p>2008-08-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated for changes to date in 1.3 development code.</li>\n<li>magick/pixel_iterator.c: Execute pixel iterators in parallel via\nOpenMP.</li>\n<li>magick/pixel_cache.c (OpenCacheView): Ensure that pixel cache is\nopen.\n(GetCacheInfo): Allocate semaphore immediately.</li>\n</ul>\n</blockquote>\n<p>2008-08-16  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c Writer now creates valid images according to\n<a class=\"reference external\" href=\"http://fits.gsfc.nasa.gov/fits_verify.html\">http://fits.gsfc.nasa.gov/fits_verify.html</a>\nFixed problems: 1) zeros in HDU, 2) wrong padding. 3) possible\nstrlen() overflow.</li>\n</ul>\n</blockquote>\n<p>2008-08-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/{compare.c, channel.c, enhance.c, image.c, operator.c}:\nUpdate existing pixel iterator callback functions so that they are\nOpenMP safe.</li>\n</ul>\n</blockquote>\n<p>2008-08-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/compare.c (InitializeDifferenceImageOptions): Renamed\nfrom DifferenceImageOptionsDefaults().\n(InitializeDifferenceStatistics): New function to initialize\nDifferenceStatistics.\n(ComputeAbsoluteError, ComputePeakAbsoluteError,\nComputeSquaredError): Use local totalizing structure on stack and\nupdate cumulative statistics when the loop terminates.</li>\n</ul>\n</blockquote>\n<p>2008-08-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www: Convert HTML pages to use a vibrant green theme rather than\ncolors stolen from old GIMP web site.</li>\n</ul>\n</blockquote>\n<p>2008-08-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/{compare.imdoc, options.imdoc}: Added documentation for\n<cite>compare</cite>.</li>\n<li>magick/compare.h (enum HighlightStyle): Added\nAssignHighlightStyle for simple color assignment.  <cite>Annotate</cite> is\nnow <cite>Tint</cite>.</li>\n<li>magick/command.c (CompareImageCommand): Useful options are now\n-metric, -highlight-color, and -hightlight-style.</li>\n</ul>\n</blockquote>\n<p>2008-08-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/compare.c (DifferenceImagePixels): Fixed <cite>Annotate</cite>\ndifference annotation algorithm.  Added <cite>Threshold</cite> and <cite>Xor</cite>\ndifference annotation algorithms.\n(GetImageChannelDifference): New function for computing\nstatistical image error using various metrics.  Inspired by\n<cite>imgcmp</cite> from Jasper.\n(GetImageChannelDistortion): New function for obtaining\nstatistical image error using various metrics for a specified\nimage channel.  Signature is compatible with similar ImageMagick\nfunction.\n(GetImageDistortion): New function for obtaining statistical image\nerror using various metrics for all the active channels in the\nimage.  Signature is compatible with similar ImageMagick function.</li>\n<li>magick/command.c (CompareImageCommand): Added a <cite>compare</cite>\nsubcommand which compares two images using various metrics, and/or\ngenerates a difference image using various difference annotation\nalgorithms.  Documentation not yet updated.</li>\n</ul>\n</blockquote>\n<p>2008-08-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_iterator.c: Split user context in all pixel\niterator APIs into a mutable data part, and an immutable data\npart.  This required modification to all modules using the pixel\niterator methods.</li>\n</ul>\n</blockquote>\n<p>2008-07-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickCompareImageChannels): Use\nDifferenceImage().\n(MagickCompareImages): Implement by calling\nMagickCompareImageChannels().</li>\n<li>magick/compare.c (DifferenceImage): The ImageMagick-compatible\nCompareImages() function signature was clearly an example of bad\ndesign so rename CompareImages() to DifferenceImage() with a\nsignature which does not unnecessarily mix functionality and\nallows for ease of future expansion.</li>\n</ul>\n</blockquote>\n<p>2008-07-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/Makefile.am (WAND_TESTS): Added Wand drawtest and wandtest\nto automated test suite.</li>\n</ul>\n</blockquote>\n<p>2008-07-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (ThresholdImage): Don't read uninitialized pixel\nindexes (valgrind gripe).</li>\n<li>coders/tiff.c (CompressionSupported): Use\nTIFFIsCODECConfigured() to test if a codec is supported.</li>\n<li>tests/{rwblob.c, rwfile.c}: use DestroyImageList() rather than\nDestroyImage().</li>\n<li>coders/psd.c (RegisterPSDImage): Fix module registration memory leak.</li>\n<li>coders/jpeg.c (RegisterJPEGImage): Fix module registration memory leak.</li>\n</ul>\n</blockquote>\n<p>2008-07-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (DestroyBlob, DestroyBlobInfo): Implementation is\na bit more robust.</li>\n</ul>\n</blockquote>\n<p>2008-07-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Remove over-write of\nimage-&gt;client_data.  Resolves SourceForge issue [ 2018974 ]\nclient_data is not passed to streamhandler.</li>\n<li>coders/png.c (WriteOnePNGImage): Fix crash when writing PNG\nimages with transparency and either type Optimize is requested, or\nthe image is colormapped.</li>\n</ul>\n</blockquote>\n<p>2008-07-12  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Fixed problem: &quot;In this case, the referenced\nimages had previously been deallocated but are still being used.\nSince they are overwritten, their signatures are invalid.</li>\n</ul>\n</blockquote>\n<p>2008-07-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (ReadDCMImage): Report actual image depth.</li>\n<li>magick/resource.c (InitializeMagickResources): Set default\nmaximum memory limit to physical memory rather than 2X physical\nmemory.  This decision is made since the system paging device is\noften slower than files in the filesystem, and so memory mapping\nis likely faster.</li>\n<li>magick/blob.c (OpenBlob): The MAGICK_IO_FSYNC environment\nvariable causes output files to be synchronized to disk when set\nto TRUE.</li>\n</ul>\n</blockquote>\n<p>2008-07-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/GraphicsMagick.html: Improved formatting of documentation.</li>\n</ul>\n</blockquote>\n<p>2008-07-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): Make use of the new\n<cite>extension_treatment</cite> field.</li>\n<li>coders/dcraw.c (ReadDCRAWImage): Added a coder module to proxy\nfrom various common RAW camera format extensions to the <cite>dcraw</cite>\ndelegate.</li>\n<li>magick/magick.h (MagickInfo): Add an extension_treatment member\nto indicate how file extensions should be treated for this coder.</li>\n</ul>\n</blockquote>\n<p>2008-06-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/{animate.c,quantize.c}: Replace !ColorMatch() with\nNotColorMatch().</li>\n<li>utilities/Makefile.am (install-exec-local-utilities): Add back\nin support for --enable-magick-compat which was accidentally\ndropped in the new makefiles for GraphicsMagick 1.2.  Resolves\nSourceForge bug 2005883.</li>\n<li>magick/color.h (NotColorMatch): New macro for testing that two\ncolors are not the same.  Opposite from existing ColorMatch().</li>\n<li>magick/command.c: Replaced the many duplicate enum conversion\ncode fragments with calls to functions in enum_strings.c.</li>\n<li>magick/enum_strings.c: Absorbed the many &quot;ToString&quot; and\n&quot;StringTo&quot; functions from other source modules.</li>\n<li>magick/effect.c (ThresholdImage): Optimize for larger images.</li>\n<li>magick/constitute.c (ConstituteTextureImage): New function to\nreturn a texture canvas image based on a tile image.  Similar to\nexisting TextureImage() except better optimized for creating new\nimages and inherits tile image properties.</li>\n<li>magick/color.h (IsBlackPixel): New macro to test if a pixel is\nblack.\n(IsWhitePixel): New macro to test if a pixel is white.</li>\n<li>coders/tile.c (ReadTILEImage): Use new ConstituteTextureImage()\nfunction rather than TextureImage().  Also allow the user to\nrequest a particular image type.</li>\n<li>coders/pdf.c (Huffman2DEncodeImage): Explicitly request a strip\nper page when writing Group4 TIFF.</li>\n<li>coders/tiff.c (WriteTIFFImage): Place a generous default limit\non rows-per-strip when using Group3 or Group4 FAX compression.\nThe default limit is added since it is observed that the Group4\ncompressor fails with extremely huge strips.  Added a define\n&quot;tiff:rows-per-strip&quot; to allow the user to explicitly set the rows\nper strip.  Added a define &quot;tiff:strip-per-page=true&quot; to allow the\nuser to force one strip per page no matter what.  Added progress\nmonitor support to tile writer.</li>\n</ul>\n</blockquote>\n<p>2008-06-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/configure/configure.cpp: The MAT coder now depends\non zlib so add explicit dependencies for it.</li>\n<li>wand/magick_wand.c (MagickNegateImage): Implemented previously\nunimplemented Wand method.\n(MagickGammaImageChannel): Implemented previously unimplemented\nWand method.</li>\n<li>magick/operator.h (enum QuantumOperator): Added GammaQuantumOp\nand &quot;gamma&quot; operator.  Renamed InvertQuantumOp to NegateQuantumOp.</li>\n</ul>\n</blockquote>\n<p>2008-06-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/operator.h (enum QuantumOperator): Added InvertQuantumOp\nand &quot;invert&quot; operator.</li>\n<li>coders/xcf.c (GIMPBlendModeToCompositeOperator): For XCF format,\nwe do support GIMP_DIVIDE_MODE composition now. Disable progress\nmonitor during tile composition.</li>\n<li>magick/composite.c (DivideCompositePixels): New Divide composite\noperator contributed by Michael Burian &lt;<a class=\"reference external\" href=\"mailto:michael&#46;burian&#37;&#52;&#48;sbg&#46;at\">michael<span>&#46;</span>burian<span>&#64;</span>sbg<span>&#46;</span>at</a>&gt;.</li>\n<li>magick/image.h (enum CompositeOperator): Added DivideCompositeOp.</li>\n<li>magick/enum_strings.c (CompositeOperatorToString): New function\nto convert a composite operator to a string.\n(StringToCompositeOperator): New function to convert a string to a\ncomposite operator.</li>\n</ul>\n</blockquote>\n<p>2008-06-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickThresholdImageChannel): Implement\npreviously unimplemented Wand function.\n(MagickGetImageExtrema): Implement previously unimplemented Wand\nfunction.\n(MagickGetImageChannelExtrema): Implement previously unimplemented\nWand function.\n(MagickQueryFonts): Implement previously unimplemented Wand\nfunction.</li>\n</ul>\n</blockquote>\n<p>2008-06-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>scripts/format_c_api_docs: Scan compare.c for API definitions.</li>\n<li>wand/magick_wand.c (MagickCompareImageChannels): Enable use of\nthis function.\n(MagickCompareImages): Enable use of this function.</li>\n<li>magick/compare.c: New source file.\n(IsImagesEqual): Move here from magick/image.c.\n(CompareImageChannels): Initial implementation of function roughly\nsimilar to the one in ImageMagick.\n(CompareImages): Initial implementation of function roughly\nsimilar to the one in ImageMagick.</li>\n<li>magick/pixel_iterator.c (PixelIterateTripleModify): New pixel\niterator function to access two images as read-only and one as\nread-write for updating existing pixels.\n(PixelIterateTripleNew): New pixel iterator function to access two\nimages as read-only and one as read-write for creating new pixels.</li>\n</ul>\n</blockquote>\n<p>2008-06-22  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>mat.c Added CloseBlob().</li>\n</ul>\n</blockquote>\n<p>2008-06-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickSetImageFormat): Add method to support\nsetting the image format.</li>\n</ul>\n</blockquote>\n<p>2008-06-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/profile.c (ProfileImage): Convert to use pixel iterators.</li>\n</ul>\n</blockquote>\n<p>2008-06-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/channel.c (ImportImageChannel): Convert to use pixel\niterators.\n(SetImageChannelDepth): Convert to use pixel\niterators.</li>\n<li>Magick++/lib/Image.cpp (quantize): Error measurement support was\nbeing performed incorrectly.  SyncImage() is not needed here.</li>\n</ul>\n</blockquote>\n<p>2008-06-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/channel.c (GetImageChannelDepth): Convert to use pixel\niterators.</li>\n</ul>\n</blockquote>\n<p>2008-06-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (RegisterMATImage): Set blob support to false for\nMAT coder until bug related to blobs is fixed.</li>\n</ul>\n</blockquote>\n<p>2008-06-16  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>mat.c Ability to read a new compressed MATLAB image format.</li>\n</ul>\n</blockquote>\n<p>2008-06-15  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>mat.c, wpg.c: For empty images a message ImageFileDoesNotContainAnyImageData\nis returned.</li>\n</ul>\n</blockquote>\n<p>2008-06-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/channel.c (ChannelImage): Convert to use pixel iterators.\n(ExportImageChannel): Convert to use pixel iterators.</li>\n<li>coders/dpx.c (WriteDPXImage): As an experimental feature, when\nthe environment variable MAGICK_RESERVE_STORAGE is set to &quot;TRUE&quot;,\nthen the DPX format writer will request the required storage from\nthe filesystem in advance (if supported by the OS) or the full\namount of memory required (when writing to an in-memory BLOB).</li>\n</ul>\n</blockquote>\n<p>2008-06-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magic.c (InitializeMagicInfo): New function to initialize\nfile format detection.\n(GetMagickFileFormat): New internal implementation function to\ndetect file format based on file header.\n(GetMagicInfo): This internal implementation function is eliminated.\n(MagicInfo): MagickInfo structure is now private to the\nimplementation.</li>\n</ul>\n</blockquote>\n<p>2008-06-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (ListMagickInfo): Replace &quot;blob support&quot;\nindication with the coder stability classification.\n(RegisterMagickInfo): Pay attention to coder classification.</li>\n<li>magick/magick.h (MagickInfo): Added a coder stability\nclassification field as well as the MAGICK_CODER_STABILITY\nenvironment variable to choose which coders are enabled.</li>\n</ul>\n</blockquote>\n<p>2008-06-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (GetImageCharacteristics): Don't access image\npixels if they are not defined yet.</li>\n<li>coders/{avi.c,avs.c,dcm.c,ept.c,fits.c,mtv.c,palm.c,rla.c,tga.c}:\nReaders are now much more robust when faced with reading random files.</li>\n</ul>\n</blockquote>\n<p>2008-06-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): Exclude all virtual delegates and\ncoders for pseudo-formats.</li>\n</ul>\n</blockquote>\n<p>2008-06-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (ReadDCMImage): Make DCM reader quit immediately on\nEOF condition.</li>\n<li>coders/avi.c (ReadAVIImage): Make AVI reader more robust at\nrejecting bad files.</li>\n<li>configure.ac: Eliminated --enable-delegate-build option that I\nhave not used or tested for almost ten years so it probably did\nnot work anyway.  Use --with-ttf=/prefix to specify the the\ninstallation prefix for freetype.  Use\n--with-ttf=/prefix/bin/freetype-config to specify the whole path\nto freetype-config.</li>\n</ul>\n</blockquote>\n<p>2008-06-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): Add support for\n-black-threshold and -white-threshold.</li>\n<li>magick/image.h (enum ChannelType): Added GrayChannel\nenumeration.</li>\n<li>magick/operator.c (QuantumOperatorImageMultivalue): New\nimplementation function to make creating legacy functions like\nblack/white thresholding easier.</li>\n<li>wand/magick_wand.c (MagickBlackThresholdImage): Implemented.\n(MagickWhiteThresholdImage): Implemented.</li>\n<li>magick/effect.c (BlackThresholdImage): Implemented a\nBlackThresholdImage() which is similar to (but not identical to)\nthe one in ImageMagick.\n(WhiteThresholdImage): Implemented a WhiteThresholdImage() which\nis similar to (but not identical to) the one in ImageMagick.</li>\n</ul>\n</blockquote>\n<p>2008-06-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/operator.c: Added support for additional channel\noperators (-operator) for applying noise to one or more channels.\nThe additional operators are Noise-Gaussian, Noise-Impulse,\nNoise-Laplacian, Noise-Multiplicative, Noise-Poisson, and\nNoise-Uniform.  The amount of noise applied is controlled via the\nnumeric argument, which can specify the percentage of noise to\napply.</li>\n<li>magick/enum_strings.c: New source module to contain the various\nEnumToString() and StringToEnum() functions which seem to multiply\nlike bunny-rabbits.</li>\n<li>magick/gem.c (GenerateNoise): Poisson noise generation was\ntaking excessively long and producing wrong results.  Noise\ngeneration was only producing the correct amount of noise in the\nQ8 build.\n(GenerateDifferentialNoise): New function to return noise in a\nfloating-point differential format.</li>\n</ul>\n</blockquote>\n<p>2008-06-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_iterator.h: Removed x,y coordinate information from\nall of the callback definitions since a use for this information\nhas yet to be found.</li>\n<li>magick/composite.c (CompositeImage): Use individual callback\nfunctions for the composition operations.</li>\n<li>coders/xcf.c (ReadXCFImage): Deal with grayscale images the\nGraphicsMagick-way.</li>\n</ul>\n</blockquote>\n<p>2008-06-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (ReadXCFImage): Validate XCF file data so that\ncorrupted files don't crash GraphicsMagick.</li>\n</ul>\n</blockquote>\n<p>2008-05-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Incrementally read user data\npart and check for EOF so that bogus files are rejected quickly.</li>\n<li>coders/cineon.c (ReadCINEONImage): Incrementally read user data\npart and check for EOF so that bogus files are rejected quickly.</li>\n</ul>\n</blockquote>\n<p>2008-05-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (ReadPICTImage): Ensure that row_bytes calculation\ndoes not overflow.  Verify that RLE decode does not overflow\nbuffer.  Validate image frame dimensions.</li>\n<li>coders/palm.c (ReadPALMImage): Validate PALM bits per pixel and\ncolormap indexes.</li>\n<li>magick/resource.c (ListMagickResourceInfo): List controlling\nenvironment variable in <cite>-list resource</cite> output as a configuration\nusage reminder.</li>\n<li>coders/pdf.c (ReadPDFImage): Properly deal with reading rotated\nPDFs.</li>\n</ul>\n</blockquote>\n<p>2008-05-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>FAQ.txt: Added a FAQ for how to extract and combine CMYK image\nchannels to individual files.</li>\n</ul>\n</blockquote>\n<p>2008-05-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/fx.c (ConvolveImage): Eliminate unnecessary &quot;range check&quot;\nfeature since range checking is not where the CPU time is going.</li>\n<li>magick/effect.c (UnsharpMaskImage): Re-write implementation to\nuse pixel iterators.</li>\n<li>magick/pixel_iterator.c: Decided that the old per-pixel\niterations were not useful enough to keep since the region-based\nones are working fine.  Moved pixel_row_iterator.c to\npixel_iterator.c and renamed functions to remove the <cite>Row</cite>\ndesignation.</li>\n<li>magick/composite.c (CompositeImage): Automatically adjust\ncolorspace of composite image so that it is compatible with canvas\nimage.</li>\n<li>magick/alpha_composite.h (AlphaComposite): Fix alpha composite\nwhen both pixels contain transparency.</li>\n<li>PerlMagick/demo/demo.pl: Use segmentation parameters which\nare more suitable for our image.</li>\n</ul>\n</blockquote>\n<p>2008-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c (CompositeImage): CMYK copy composition\noperators automatically set the image colorspace to CMYK.</li>\n<li>coders/tiff.c (WriteTIFFImage): CMYK must take precedence over\nJPEG compression.  We don't support JPEG compression in TIFF with\nCMYK.</li>\n</ul>\n</blockquote>\n<p>2008-05-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (ChannelThresholdImage): Re-implement using\npixel iterators.  Support thresholding only the red channel by\neliminating the switch to intensity thresholding if only one\nchannel parameter is supplied.</li>\n<li>coders/tiff.c (WriteTIFFImage): Don't accidentially convert CMYK\nimages to RGB.</li>\n<li>magick/composite.c (CompositePixels): Handle CopyBlack properly\nfor CMYK images.</li>\n<li>magick/command.c (CompositeImageCommand):  Support CopyCyan,\nCopyMagenta, CopyYellow, and CopyBlack.</li>\n<li>magick/composite.c (CompositeImage): Preserve the canvas image\ncolorspace.</li>\n<li>doc/options.imdoc: Remove mention of thresholding at the channel\nlevel since this never worked in a useful fashion and now only\nsimple intensity thresholding is available via -threshold.</li>\n<li>magick/command.c (MogrifyImage): Revert to using ThresholdImage() rather\nthan ChannelThresholdImage().</li>\n<li>PerlMagick/Magick.xs: Revert to using ThresholdImage() rather\nthan ChannelThresholdImage().</li>\n</ul>\n</blockquote>\n<p>2008-05-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (AddNoiseImage): Implemented using pixel\niterators.</li>\n<li>magick/pixel_row_iterator.c (PixelRowIterateDualNew): New pixel\niterator.  Similar to existing PixelRowIterateDualModify except\nthat this one is for when initializing a new image.</li>\n</ul>\n</blockquote>\n<p>2008-05-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c (CompositeImage): Update image composition to\nuse pixel iterator methods.</li>\n</ul>\n</blockquote>\n<p>2008-05-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enhance.c: Re-wrote all enhancement functions in this\nmodule to be based on the pixel iterator methods.</li>\n<li>magick/command.c (ConvertImageCommand, MogrifyImageCommand,\nDisplayImageCommand): Gamma multiple channel syntax was broken.\nNow it is fixed.</li>\n</ul>\n</blockquote>\n<p>2008-05-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colorspace.c (RGBTransformImage): Optimized lookup table\ngeneration performance to the maximum extent possible.\n(TransformRGBImage): Optimized lookup table\ngeneration performance to the maximum extent possible.</li>\n<li>magick/image.h (RoundDoubleToQuantum): New macro to explicitly\nsafely round a <cite>double</cite> to a Quantum.\n(RoundFloatToQuantum): New macro to explicitly safely round a\n<cite>float</cite> to a Quantum.</li>\n<li>configure.ac: Add OpenMP support library to LIBS so that\ndependent applications will pick up this dependency without\nthemselves needing to enable OpenMP.</li>\n<li>magick/command.c (CompositeImageList): Don't overwrite matte\nflag for CopyOpacity composition.</li>\n<li>magick/composite.c (CompositeImage): CopyOpacity composition\nneeds the opacity channel to be enabled.</li>\n<li>PerlMagick/Magick.xs: Dissolve composition with Opacity was not\nworking right.  Now it does.</li>\n</ul>\n</blockquote>\n<p>2008-05-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gem.c (HWBTransform): Hue value range was scaled wrong,\nleading to clipping.\n(TransformHWB): Hue value range was scaled wrong, leading to\nclipping.</li>\n</ul>\n</blockquote>\n<p>2008-05-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colorspace.c (RGBTransformImage): Re-implement transform\nloops using PixelRowIterateMonoModify() in order to simplify the\ncode.</li>\n</ul>\n</blockquote>\n<p>2008-05-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colorspace.c (TransformRGBImage): Re-implement transform\nloops using PixelRowIterateMonoModify() in order to simplify the\ncode.</li>\n<li>magick/{pixel_iterator.h, pixel_row_iterator.h}: Pass pixel\ncolormap index/indexes to callback functions.  Dependent code is\nadjusted to match.</li>\n</ul>\n</blockquote>\n<p>2008-05-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (ConvertImageCommand, MogrifyImageCommand,\nMogrifyImage): Add command access to the new channel operators.</li>\n<li>magick/operator.c (QuantumOperatorRegionImage): Support the new\nchannel operators.  Update to use PixelRowIterateMonoModify() for\na bit more performance.</li>\n<li>magick/operator.h (enum QuantumOperator): Added new operators\nAssignQuantumOp, ThresholdQuantumOp, ThresholdBlackQuantumOp, and\nThresholdWhiteQuantumOp.</li>\n</ul>\n</blockquote>\n<p>2008-05-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (VersionCommand): Report if OpenMP is supported\nby the build.</li>\n<li>configure.ac, Makefile.am: Install documentation according to\nthe conventions established by the configure script.  This\ninstalls the documentation under\n/usr/local/share/doc/GraphicsMagick by default.</li>\n</ul>\n</blockquote>\n<p>2008-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>scripts/format_c_api_docs: Add pixel_iterator.c and\npixel_row_iterator.c to API documentation formatter.</li>\n<li>magick/api.h: Include pixel_iterator.h and pixel_row_iterator.h.</li>\n<li>magick/Makefile.am (MAGICK_INCLUDE_HDRS): Formally install\npixel_iterator.h and pixel_row_iterator.h.</li>\n<li>magick/image.c (IsImagesEqual): Update to use\nPixelRowIterateDualRead().\n(GetImageStatistics): Update to use PixelRowIterateMonoRead().</li>\n<li>magick/pixel_row_iterator.h: New interfaces which are similar to\nthe already existing interfaces in pixel_iterator.h except that\nthey pass a row to the callback rather than one pixel.</li>\n<li>magick/operator.c (QuantumOperatorRegionImage): Add progress\nmonitor support.</li>\n<li>magick/pixel_iterator.c (PixelIterateMonoRead): Add a\n<cite>description</cite> argument and progress monitor support.\n(PixelIterateMonoModify): Add a\n<cite>description</cite> argument and progress monitor support.\n(PixelIterateDualRead): Add a\n<cite>description</cite> argument and progress monitor support.\n(PixelIterateDualModify): Add a\n<cite>description</cite> argument and progress monitor support.</li>\n<li>magick/resize.c (HorizontalFilter, VerticalFilter): Switch back\nto RoundSignedToQuantum() since some pixels were experiencing\nunderflow.  Localize some variables so that we don't have to\ndeclare them as private for OpenMP.</li>\n</ul>\n</blockquote>\n<p>2008-05-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac, magick/resize.c, PerlMagick/Makefile.PL.in: Added\nOpenMP support for parallelizing a task across multiple cores.</li>\n</ul>\n</blockquote>\n<p>2008-05-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac, magick/nt_base.h: Fix using libbz2 under MinGW.</li>\n<li>coders/{msl.c, svg.c, url.c}: Fix compilation with modern\nlibxml2 under MinGW.</li>\n</ul>\n</blockquote>\n<p>2008-05-08  Josue Andrade Gomes  &lt;<a class=\"reference external\" href=\"mailto:josuegomes&#37;&#52;&#48;gmail&#46;com\">josuegomes<span>&#64;</span>gmail<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.h, libxml/include/win32config.h (vsnprintf):\nFixed compilation issue noticed with Visual C++ 2008.</li>\n</ul>\n</blockquote>\n<p>2008-05-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (GetMagickInfo): Simplify implementation.\n(RegisterMagickInfo): Remove any existing entry since module\nloading may result in duplicate entries.</li>\n</ul>\n</blockquote>\n<p>2008-05-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>libtool: Update to libtool 1.2.4.</li>\n<li>magick/magick.h (MagickInfo): Store string attributes as <cite>const\nchar *</cite> to statically allocated data rather than as heap allocated\nstrings.  THIS IS AN INTERFACE CHANGE.  Using a coder written to\nthe old interface is non-fatal but may resemble a small memory\nleak.  The reason for the change is to avoid at least 880 needless\nmalloc()/strlen()/strlcpy() operations at initialization time, and\nat least 880 free() calls at destruction time.  While these\noperations did not take long, they are still an unnecessary\noverhead, which is increased in thread-safe applications.</li>\n<li><dl class=\"first docutils\">\n<dt>magick/module.c (OpenModule): Ignore requests to open modules</dt>\n<dd>which have already been opened.</dd>\n</dl>\n</li>\n<li>GraphicsMagick.spec.in: Add --with-included-ltdl to the default\noptions since this seems safest until the libltdl validation logic\nis fully robust.  This should be made user-configurable in the\nfuture.</li>\n<li>magick/Makefile.am (magick_libGraphicsMagick_la_LIBADD): Apply\nlibltdl dependency argument as required for building.</li>\n<li>configure.ac: Intuit if the GraphicsMagick library will depend\non -lltdl.</li>\n<li>Magick++/bin/GraphicsMagick++-config.in: Use substitutions\nrather than invoking GraphicsMagick-config in order to determine\nGraphicsMagick library usage requirements.  This avoids problems\nwhen GraphicsMagick-config is not in the executable search path.</li>\n</ul>\n</blockquote>\n<p>2008-05-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick.spec.in: NEWS was renamed to NEWS.txt.  Enable\nlibtool verbose output so it is possible to diagnose build\nfailures.</li>\n</ul>\n</blockquote>\n<p>2008-05-01  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>mat.c: gm convert -limit Pixels 1 input_gray_lsb_16bit.mat crap.miff\ndon't rotate partial image.</li>\n</ul>\n</blockquote>\n<p>2008-04-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (DestroyMagickInfoList): Use DestroyMagickInfo().\n(UnregisterMagickInfo): Use DestroyMagickInfo().\n(RegisterMagickInfo): Simplify dramatically by adding to the front\nof the list rather than maintaining alpha order.</li>\n<li>magick/image.c (DestroyImageInfo): Tidy up and simplify code.</li>\n<li>magick/constitute.c (WriteImage): Comment out the &quot;bi-modal\ndelegate&quot; execution code until we determine what value it offers.\nThe test suite passes without it.</li>\n<li>magick/magick.h (struct MagickInfo): There is no need for <cite>name</cite>\nto be allocated data so make it const.\n(DestroyMagickInfo): Add a static function to destroy a MagickInfo\nstructure.  Renamed previous DestroyMagickInfo to\nDestroyMagickInfoList and made it static.</li>\n</ul>\n</blockquote>\n<p>2008-04-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: GraphicsMagick 1.2 released.\nCVS head is now 1.3 development.</li>\n<li>png: Updated libpng to 1.2.27.</li>\n</ul>\n</blockquote>\n<p>2008-04-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): Ignore file extensions which\nmatch defined virtual delegate entries (including stealth\nentries).</li>\n</ul>\n</blockquote>\n<p>2008-04-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BENCHMARKS.txt: Added timings for -blur.</li>\n</ul>\n</blockquote>\n<p>2008-04-27  Darko Kojic  &lt;<a class=\"reference external\" href=\"mailto:dkc&#37;&#52;&#48;sf&#46;net\">dkc<span>&#64;</span>sf<span>&#46;</span>net</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (MedianFilterImage): Fixes to compile on ARM\nCPU.</li>\n</ul>\n</blockquote>\n<p>2008-04-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.h (MagickInfo): Remove image_info member since I\ncan not find any purpose for it.</li>\n<li>coders/tiff.c (WriteTIFFImage): Remove assertion check on\nscanline size since it has not caught anything.</li>\n<li>magick/image.c (SetImageInfo): Ensure that the file extension\ndoes not trigger unwanted activity such as access to an X11\nserver, printer, or the launch delegate.</li>\n<li>config/Makefile.am (configshare_DATA): Install colors.mgk in\nshare path.</li>\n<li>magick/blob.c (GetConfigureBlob): Search <cite>share</cite> config path\nprior to <cite>lib</cite> config path.</li>\n</ul>\n</blockquote>\n<p>2008-04-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): TrueColor RGB was usually\nwritten rather than the desired more compact format.  This is a\nfirst pass at fixing that.</li>\n</ul>\n</blockquote>\n<p>2008-04-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BENCHMARKS.txt: Added a benchmark summary.</li>\n</ul>\n</blockquote>\n<p>2008-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Prepare 1.2beta1 release.</li>\n<li>NEWS.txt: Updated with latest news.</li>\n</ul>\n</blockquote>\n<p>2008-04-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>libtool: Update to 1.2965 2008-04-22</li>\n<li>coders/png.c (ReadOneJNGImage): Deal with ReadImage() returning\na NULL pointer when reading JPEG sub-image.</li>\n</ul>\n</blockquote>\n<p>2008-04-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/channel.c (ExportImageChannel): Added progress monitor\nsupport.\n(SetImageChannelDepth): Added progress monitor support.\n(ChannelImage): Don't preserve matte channel when extracting\nchannel.</li>\n<li>magick/image.c (SetImageOpacity): Avoid integer overflow in Q32\nbuild.  Added progress monitor support.\n(SyncImage): Added progress monitor support.\n(SetImage): Added progress monitor support.\n(CycleColormapImage): Added progress monitor support.\n(GetImageBoundingBox): Added progress monitor support.\n(SortColormapByIntensity): Added progress monitor support.</li>\n</ul>\n</blockquote>\n<p>2008-04-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac, magick/Makefile.am: Don't use libtdl unless we are\nsupposed to be using it!</li>\n<li>libtool: Updated to GNU libtool 1.2960 2008-04-19.</li>\n<li>configure.ac, magick/delegate.h: It seems that the modern\nconvention is to store ghostscript headers in a subdirectory\ncalled <cite>ghostscript</cite> rather than <cite>ps</cite>.\nWe don't actually need Ghostscript errors.h and that is a good\nthing since it seems that some newer Ghostscript calls it ierrors.h</li>\n</ul>\n</blockquote>\n<p>2008-04-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/inc/files-dlls.isx: Comment out inclusion\nof X11 support DLLs.</li>\n<li>VisualMagick/magick/magick_config.h.in: X11 is no longer in the\ndefault Windows build.</li>\n</ul>\n</blockquote>\n<p>2008-04-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c: Eliminate various annoying warnings noticed\nunder MinGW.</li>\n<li>magick/spinlock.h (_spinlock_release): Use <cite>long</cite> rather than\n<cite>int</cite> in order to eliminate warning under MinGW.</li>\n<li>magick/semaphore.c (spinlock_wait): Use <cite>long</cite> rather than <cite>int</cite>\nin order to eliminate warning under MinGW.</li>\n<li>magick/log.c (LogMagickEventList): Eliminate warning under MinGW.</li>\n<li>magick/compress.h: Clean up interface definitions to use\nmagick_uint8_t for unsigned character data.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Don't use GetPixelCachePresent()\nsince it is not DLL-exported.</li>\n</ul>\n</blockquote>\n<p>2008-04-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/yuv.c (ReadYUVImage): Report exception info correctly.</li>\n<li>coders/xpm.c (ReadXPMImage): Report exception info correctly.</li>\n<li>coders/xc.c (ReadXCImage): Report exception info correctly.</li>\n<li>coders/tiff.c (ReadTIFFImage): Report exception info correctly.</li>\n<li>coders/null.c (ReadNULLImage): Report exception info correctly.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Report exception info correctly.\nUse of Huffman optimization is now based on available memory\nrather than a hard-coded image size.</li>\n<li>coders/gif.c (ReadGIFImage): Report exception info correctly.</li>\n<li>magick/utility.c (MagickSizeStrToInt64): New function to convert\na size string with optional units suffix to a 64-bit integer.\n(MagickStrToInt64): New function to convert a string to a 64-bit\ninteger, with error checking.</li>\n<li>magick/image.c (SetImage): SetImage now returns error status.</li>\n<li>magick/command.c: Eliminated the long-deprecated -cache resource\nlimit option.</li>\n<li>magick/resource.c: Complete re-write of the resource limit\nsystem.  Resource specifications are now absolute except that they\nsupport a binary metric suffix such as <cite>K</cite> to scale the value.\nAdded the <cite>Pixels</cite> limit type to limit the maximum number of\npixels allowed for each image.</li>\n</ul>\n</blockquote>\n<p>2008-04-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (WriteJPEGImage): Output grayscale images more\nefficiently.</li>\n</ul>\n</blockquote>\n<p>2008-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lcms: Updated lcms to 1.17.</li>\n<li>png: Updated libpng to 1.2.26.</li>\n</ul>\n</blockquote>\n<p>2008-04-09  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage) Use the low bits of the PNG\ntRNS values instead of scaling them when reducing from 16-bits.</li>\n</ul>\n</blockquote>\n<p>2008-04-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Updated to Autoconf 2.62.</li>\n</ul>\n</blockquote>\n<p>2008-04-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImageCommand): New -create-directories\noption automatically creates subdirectories as needed when\n-output-directory option is used.  This is useful when one\ndirectory tree of files is being mogrified to a new tree.</li>\n</ul>\n</blockquote>\n<p>2008-04-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (MagickCreateDirectoryPath): New function to\ncreate a directory path.  Will be used later.</li>\n<li>configure.ac: Tweaks to produce a successful MinGW cross-compile.</li>\n</ul>\n</blockquote>\n<p>2008-04-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Added a simple sentinel\nassertion to hopefully flush out any remaining cases where\nExportImagePixelArea() writes past the end of its buffer.</li>\n<li>magick/constitute.c (ExportImagePixelArea): GrayQuantum case for\nDirectClass pixels was sometimes writing a zero byte one past the\nend of the allocated buffer.  Thanks to Josue Gomes for reporting\nthis bug.</li>\n</ul>\n</blockquote>\n<p>2008-04-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/{pcd.c,pcx.c,pdb.c,pict.c,stegano.c,wpg.c,xcf.c}:\nWarnings reduction.</li>\n<li>magick/{channel.c,image.c,unix_port.c,render.c}: Warnings\nreduction.</li>\n<li>coders/mat.c: Convert C99 comments to C89 comments so code can\ncompile with a C89 compiler.</li>\n<li>coders/tiff.c (WriteTIFFImage): Add an assertion to enforce that\nthe bytes output to the scanline is no more than the bytes\nallocated for the scanline.</li>\n<li>NEWS.txt: Updated with latest NEWS.</li>\n</ul>\n</blockquote>\n<p>2008-04-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Default to ZIP compression if\navailable.  Ignore Image compression setting since the useful\nvalue (set by the user) usually comes from ImageInfo.</li>\n<li>coders/png.c (WriteOnePNGImage): Fix progress monitor when\nwriting PNG.</li>\n<li>magick/channel.c (GetImageChannelDepth): Added progress monitor\nsupport.</li>\n<li>magick/signature.c (SignatureImage): Added progress monitor support.</li>\n<li>magick/image.c (GetImageDepth): Added progress monitor support.</li>\n</ul>\n</blockquote>\n<p>2008-04-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>libtool:  Update to libtool 2.2.2.</li>\n<li>coders/jpeg.c: Convert more code to use size_t for sized values\nrather than long.</li>\n<li>coders/wpg.c (InsertRow): Fix log format string specification.</li>\n<li>coders/dpx.c (WriteDPXImage): Fix typo in casts.</li>\n<li>coders/fpx.c (ReadFPXImage): Apply FreeBSD patch from Mikhail\nTeterin to allow FlashPIX to work better for 64-bit builds.\nAddresses SourceForge issue 1824658 &quot;FPX should work again now&quot;.</li>\n<li>magick/blob.c (ImageToBlob): Fix typo in cast.</li>\n</ul>\n</blockquote>\n<p>2008-03-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>CONTRIBUTE.txt: Convert contribute.html to reStucturedText\nformat and generate HTML version from it.</li>\n<li>PROCESS.txt: Convert description of development process to\nreStucturedText format and generate HTML version from it.</li>\n<li>INSTALL-windows.txt: Add instructions for how to install from\nsetup.exe style installer.  Also add instructions for how the\ndistribution package is built.</li>\n<li>Copyright.txt: Reformat in reStucturedText format and generate\nHTML version from it.</li>\n<li>VisualMagick/installer/inc/body.isx: No longer include\ndevelopment headers and libraries in the Windows DLL install\npackage since they are large and they may only work with the\nversion of Visual C++ used to perform the build.  It is much safer\nfor the developer to build the package from source with his own\ncompiler.</li>\n</ul>\n</blockquote>\n<p>2008-03-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fix compilation issues with Microsoft Visual Studio.</li>\n</ul>\n</blockquote>\n<p>2008-03-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage, WriteDPXImage): Use lookup tables to\nspeed up value conversion.</li>\n<li>magick/memory.h (MagickAllocateArray): Renamed from\nMagickAllocateMemoryElements.</li>\n</ul>\n</blockquote>\n<p>2008-03-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Use memory allocation macros like the rest\nof the code.</li>\n<li>magick/memory.c (MagickMalloc): New function which behaves\nsimilar to malloc().\n(MagickMallocArray): New function for allocating an array.\n(MagickRealloc): New function which behaves similar to realloc().\n(MagickFree): New function which behaves similar to free().\n(MagickAllocFunctions): New function to allow the user to specify\nthe memory allocation functions.</li>\n<li>magick/memory.h: New header file to define memory allocation\nfunctions.</li>\n<li>magick/deprecate.c (DeleteImageList, DestroyImages,\nGetImageList, GetImageListIndex, GetImageListSize, GetNextImage,\nGetNumberScenes, GetPreviousImage, ParseImageGeometry,\nPopImageList, PostscriptGeometry, PushImageList,\nSetCacheThreshold, SetImageList, ShiftImageList, SizeBlob,\nSpliceImageList, UnshiftImageList): Remove functions which were\nalready deprecated in ImageMagick 5.5.2 or earlier.</li>\n</ul>\n</blockquote>\n<p>2008-03-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteDPXImage): Support writing image which is\nalready in a YCbCr colorspace.\n(ReadDPXImage): Return YCbCr images in YCbCr colorspace unless\nthey are also Cineon log encoded.</li>\n<li>magick/image.c (CloneImage): Use CloneImageAttributes().</li>\n<li>magick/attribute.c (CloneImageAttributes): New function for\ncopying image attributes from one image to another.</li>\n<li>magick/utility.c (TranslateTextEx): Check if the pixel cache is\ninitialized before using a function which requires using it.\nThanks to Micha³ Kowalczuk for bringing this issue to my\nattention.</li>\n<li>magick/attribute.c (SetImageAttribute): Only apply\ntransformations to &quot;comment&quot; and &quot;label&quot; attributes.</li>\n<li>magick/pixel_cache.c (GetPixelCachePresent): New function to\ntest if the image pixel cache is present and initialized.</li>\n</ul>\n</blockquote>\n<p>2008-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colorspace.c (RGBTransformPacket): Rationalize casts for\nimproved performance.</li>\n<li>magick/image.c (GetImageDepth): Use table lookups to improve\nperformance.</li>\n</ul>\n</blockquote>\n<p>2008-03-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (AllocateImage): Transfer any attributes from\nImageInfo to allocated image.\n(SetImageDepth): Use table lookups to improve performance.</li>\n</ul>\n</blockquote>\n<p>2008-03-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImageCommand): Added an\n-output-directory option to <cite>mogrify</cite> to send output files to the\nspecified directory.</li>\n</ul>\n</blockquote>\n<p>2008-03-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/read.t: Add input_logical_lsb_08bit.mat to\nPerlMagick tests.</li>\n<li>magick/nt_feature.c (CropImageToHBITMAP, ImageToHBITMAP): Use\nGlobalFree() to free bitmap handle.</li>\n</ul>\n</blockquote>\n<p>2008-03-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/read.t: Added/adjusted WPG test files from Jaroslav\nFojtik.</li>\n</ul>\n</blockquote>\n<p>2008-03-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>AUTHORS.txt, BUGS.txt, FAQ.txt, NEWS.txt, PLATFORMS.txt,\nTODO.txt, INSTALL-unix.txt, INSTALL-windows.txt: Use\nreStructuredText format.</li>\n<li>Makefile.am: Use reStructuredText for more files.</li>\n</ul>\n</blockquote>\n<p>2008-02-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ReadImage): Disable colorspace override\ncode since it was being wrongly-triggered in X11 display commands.</li>\n</ul>\n</blockquote>\n<p>2008-02-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/body.html: Update to mention 1.1.11 release.</li>\n</ul>\n</blockquote>\n<p>2008-02-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colorspace.c (RndToInt): Cast result to <cite>unsigned int</cite>\nrather than <cite>int</cite> in order to avoid possible value truncation with\nQ32 build.  Problem was reported by Kai-Uwe Behrmann.\n(TransformRGBImage): Fix loop iterator which was looping one past\nthe end of the array.  Reported by Kai-Uwe Behrmann.</li>\n<li>magick/command.c: Added a -set option to the composite, convert,\ndisplay, mogrify, import commands in order to allow setting an\nimage attribute.</li>\n</ul>\n</blockquote>\n<p>2008-02-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Use MagickAcquireMemory() rather than\nAquireMemory().</li>\n<li>coders/xwd.c (ReadXWDImage): Eliminate integer overflow\nvulnerability (IDefense 09.19.07).</li>\n<li>coders/xbm.c (ReadXBMImage): ditto</li>\n<li>coders/xcf.c (ReadXCFImage): ditto</li>\n<li>coders/dib.c (ReadDIBImage): ditto</li>\n<li>coders/dcm.c (ReadDCMImage): ditto</li>\n</ul>\n</blockquote>\n<p>2008-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): The <a class=\"reference external\" href=\"http://tools.ietf.org/html/rfc3949.html\">RFC 3949</a> specification for\nInternet FAX recommends LSB2MSB fill order so document that.</li>\n</ul>\n</blockquote>\n<p>2008-02-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Use <cite>-define\ntiff:fill-order={msb2lsb|lsb2msb}</cite> to control TIFF bit fill order.</li>\n</ul>\n</blockquote>\n<p>2008-02-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Updated to latest CVS libtool.</li>\n<li>coders/tiff.c (CompressionSupported): Use\nTIFFGetConfiguredCODECs() to test if a requested compression type\nis supported by libtiff.  Based on advice from Frank Warmerdam.</li>\n<li>configure.ac: Add test for TIFFGetConfiguredCODECs() in libtiff.</li>\n</ul>\n</blockquote>\n<p>2008-02-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c: With libtiff 3.6.1, including tiff.h and tiffio.h\nis not sufficient to obtain the definitions from tiffconf.h so\nlibtiff is assumed to not support any features, such as\ncompression.  Avoid this problem by explicitly including\ntiffconf.h if it is found.  This resolves SourceForge issue\n[1883527] compression of tiff-file has no effect.</li>\n</ul>\n</blockquote>\n<p>2008-02-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/inc/setup.isx: Set Inno Setup installer\ncompression to &quot;lzma/max&quot;.</li>\n<li>PerlMagick/Magick.xs: Eliminate use of memory allocation macros\nsince these failed miserably under Windows where it seems that\nmalloc, free, and realloc are redefined via macros by the Perl\nbuild environment.  This reverts changes made on 2007-12-01.</li>\n<li>magick/memory.c (MagickAcquireMemoryArray): Use implementation\nfrom the 1.1 branch.</li>\n<li>magick/utility.h: Remove MagickSafeMultiplySize_t since it seems\nthat use of inline functions in Windows is a disaster area.</li>\n</ul>\n</blockquote>\n<p>2008-02-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (windows-dist): Create a 7z compressed Windows\ncomprehensive source package.  See <a class=\"reference external\" href=\"http://www.7-zip.org/\">http://www.7-zip.org/</a> for\ninformation on Windows 7-Zip and <a class=\"reference external\" href=\"http://p7zip.sourceforge.net/\">http://p7zip.sourceforge.net/</a> for\ninformation on portable 7-Zip (P7ZIP).</li>\n</ul>\n</blockquote>\n<p>2008-02-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Add logging for image resolution\nand resolution units.</li>\n<li>magick/version.h.in: Update copyright year to 2008.</li>\n</ul>\n</blockquote>\n<p>2008-02-01  Gary V. Vaughan  &lt;<a class=\"reference external\" href=\"mailto:gary&#37;&#52;&#48;gnu&#46;org\">gary<span>&#64;</span>gnu<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Updated for libtool-2.1b.</li>\n<li>bootstrap (libtoolize): Libtoolize can figure out the mode and\ndirectory for libltdl from configure.ac.</li>\n</ul>\n</blockquote>\n<p>2008-01-28  Ralf Wildenhues  &lt;<a class=\"reference external\" href=\"mailto:Ralf&#46;Wildenhues&#37;&#52;&#48;gmx&#46;de\">Ralf<span>&#46;</span>Wildenhues<span>&#64;</span>gmx<span>&#46;</span>de</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/Makefile.am: Update\nmagick_libGraphicsMagick_la_DEPENDENCIES to use LTDLDEPS.</li>\n</ul>\n</blockquote>\n<p>2008-01-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): Successfully read existing file\nnames in the form file[123] which were failing to read since they\nappear to be a valid sub-image specification.</li>\n</ul>\n</blockquote>\n<p>2008-01-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (ExpandFilenames): If a filename appears to\ncontain a wildcard specification, first check to see if there is\nfile matching the unexpanded wildcard prior to engaging in the\nslow task of wildcard expansion.  Without this fix, expanding the\ncommand line takes a very long time if there are a huge number of\nfiles in the directory, and some file names appear to contain\nwildcard specifications.  Inspired by SourceForge bug reports [\n1878992 ] &quot;literal square brackets in file name cause large delay&quot;\nand [ 1783209 ] &quot;converting runs slowly when subimage is\nspecified&quot;, but this might not be the complete fix for the\nproblem.</li>\n</ul>\n</blockquote>\n<p>2008-01-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Update to Automake 1.10.1 and enable generation of\nan lzma compressed source package.</li>\n</ul>\n</blockquote>\n<p>2008-01-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Added configure option --with-umem to enable use\nof the umem memory allocation library available in Solaris 9,\nUpdate 3 and later, or from\n<a class=\"reference external\" href=\"https://labs.omniti.com/trac/portableumem/\">https://labs.omniti.com/trac/portableumem/</a>.  This library supports\nconcurrency in multi-threaded programs and supports debugging\nmemory issues.  See\n<a class=\"reference external\" href=\"http://developers.sun.com/solaris/articles/libumem_library.html\">http://developers.sun.com/solaris/articles/libumem_library.html</a>\nfor a description of how to use the library for debugging memory\nissues.</li>\n</ul>\n</blockquote>\n<p>2008-01-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (VersionCommand): Include a &quot;Large Memory&quot; item\nin the Feature Support list.</li>\n<li>coders/png.c (RegisterPNGImage): Remove reference to dead PNG\nftp site.</li>\n<li>VisualMagick/configure/configure.cpp (InitInstance): Remove\nproject dependency on dxguid.lib (Direct-X).</li>\n</ul>\n</blockquote>\n<p>2008-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Update libtool to latest CVS version.</li>\n</ul>\n</blockquote>\n<p>2008-01-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (DisplayImageCommand): No longer default to\nreading standard input if stdin fails isatty() test.  This\nbehavior was causing failure to launch from Gnome and it is\ndifficult to work around the issue from within a .desktop file.\n(AnimateImageCommand): No longer default to\nreading standard input if stdin fails isatty() test.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2009.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2009.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2009-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/unix_port.c (MagickSpawnVP): Remove unneeded new line\ncharacter in error message format.</li>\n<li>Magick++/Makefile.am: Allow Magick++ to be built as a shared\nlibrary under MinGW and Cygwin.  This requires a modern GCC in\norder for C++ exceptions to work.</li>\n<li>utilities/tests/annotate.sh: MSYS is garbeling up draw command\nso use a command file rather than using command line.</li>\n<li>coders/{fits.c,meta.c,locale.c}: Fix benign warnings noticed\nunder Cygwin 1.7.</li>\n<li>magick/{constitute.c,resource.c,utility.c}: Fix benign warnings\nnoticed under Cygwin 1.7.</li>\n</ul>\n</blockquote>\n<p>2009-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/module.c (DestroyModuleInfo): If the Jasper library is\nused, then we can't invoke lt_dlexit() because this unloads the\nJasper library and Jasper sometimes registers an atexit() cleanup\nhandler.  Unfortunately, this may annoy memory leak checkers.</li>\n<li>coders/jp2.c: Defer Jasper initialization to point of use.</li>\n</ul>\n</blockquote>\n<p>2009-12-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickCdlImage): New method to apply the ASC\nCDL to an image.\n(MagickHaldClutImage): New method to apply a Hald CLUT to an image.</li>\n</ul>\n</blockquote>\n<p>2009-12-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h atof(), atoi(), and atol() are legacy functions\nwhich might not be thread safe, might not enforce reasonable\nlimits, and should not be used for new code.  So we implement them\nvia strtod() and strtol().</li>\n</ul>\n</blockquote>\n<p>2009-12-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickGetImageBoundingBox): New method to\nreturn the crop bounding box required to remove any solid-color\nborder from the image.\n(MagickGetImageFuzz/MagickSetImageFuzz): New methods to get and\nset the color comparison fuzz factor</li>\n<li>wand/pixel_wand.c (ClonePixelWand): New method to deep-copy an\nexisting pixel wand.\n(ClonePixelWands): New method to deep-copy an array of existing\npixel wands.</li>\n<li>wand/magick_wand.c (MagickSetResolution): New method to set the\nwand resolution.  This one also works before the image has been\nread (unlike MagickSetImageResolution()).\n(MagickSetResolutionUnits): New method to set the wand resolution\nunits.  Use in conjunction with MagickSetResolution().  This one\nalso works before the image has been read (unlike\nMagickSetImageUnits()).</li>\n</ul>\n</blockquote>\n<p>2009-12-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/demo/demo.cpp (main): Stop using deprecated functions.</li>\n<li>wand/drawtest.c: Stop using deprecated functions.</li>\n</ul>\n</blockquote>\n<p>2009-12-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/module.c (ModuleAliases): J2C is supported by the JP2\ncoder.</li>\n<li>coders/jp2.c: JP2 is now an alias for JPC since many files use\nthat extension.  Problem reported by Stefano Acerbetti.</li>\n</ul>\n</blockquote>\n<p>2009-12-09  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: The png8 encoder would fail when trying to write\na 1-color image.  Problem reported by Bob Clark.</li>\n</ul>\n</blockquote>\n<p>2009-12-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Define _GNU_SOURCE and _NETBSD_SOURCE so that\npwrite() and pread() prototypes are available under GNU Linux and\nNetBSD.</li>\n<li>coders/tiff.c: Warnings reduction.</li>\n<li>magick/widget.c: Warnings reduction.</li>\n<li>magick/segment.c (Classify): Warnings reduction.</li>\n<li>magick/magic.c (struct StaticMagic): Length and offset can never\nbe negative so use an unsigned type rather than size_t.</li>\n<li>magick/render.c (TracePath): Fix access one beyond the end of\nthe points array.</li>\n</ul>\n</blockquote>\n<p>2009-11-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gem.c (GetOptimalKernelWidth1D, GetOptimalKernelWidth2D):\nIn the Q32 build, convolution kernel size was estimated\nincorrectly for large sigmas on 32-bit systems due to arithmetic\noverflow.</li>\n</ul>\n</blockquote>\n<p>2009-11-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (ConvolveImage): Moved here from fx.c since this\nis a more suitable place for it to be.</li>\n<li>magick/enhance.c (GammaImage): Improve performance a bit.\nPreserve full precision in Q32 build.</li>\n</ul>\n</blockquote>\n<p>2009-11-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/{channel.c,constitute.c,nt_base.h}: Start using the C'99\n<cite>restrict</cite> keyword.</li>\n</ul>\n</blockquote>\n<p>2009-11-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickGetImageAttribute): New method to get\nan image attribute.  Patch contributed by Mikko Koppanen.\n(MagickSetImageAttribute): New method to set an image attribute.\nPatch contributed by Mikko Koppanen.</li>\n<li>magick/constitute.c (ReadImage): Log subimage and subrange.</li>\n<li>configure: Update to Autoconf 2.65.</li>\n<li>magick/attribute.c (GenerateIPTCAttribute): Returned IPTC string\nvalues were one character too short.</li>\n</ul>\n</blockquote>\n<p>2009-11-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (AllocateImage): The documented shorthand for\nspecifying image size via filename[WIDTHxHEIGHT] was not working\nfor raw formats which use the image tile_info data.</li>\n</ul>\n</blockquote>\n<p>2009-11-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (ParseSubImageSpecification): Try to match\nbehavior of previous sub-image specification parser.  Some\nincantations did not produce the same results.</li>\n<li>win2k/IMDisplay/res/{IMDisplay.ico, IMDisplayDoc.ico}: Replaced\nwith GraphicsMagick icon prepared by Jaroslav Fojtik.</li>\n<li>coders/svg.c (ReadSVGImage): Use runtime initialization of\nSAXModules rather than static initialization.</li>\n<li>magick/command.c: Commands now support reading an image from\nstdin in conjunction with a subrange specification (e.g. &quot;-[1]&quot;).\nProblem was reported by Mario Becroft.</li>\n<li>magick/common.h: New header file to incorporate the common bits\nshared by studio.h and api.h.</li>\n<li>ltdl/ltdl.c: Update libltdl to 2.2.6b in order to fix security\nissue.  Resolves CVE-2009-3736 as it pertains to GraphicsMagick.</li>\n</ul>\n</blockquote>\n<p>2009-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ConstituteImage, DispatchImage): <cite>A</cite> and\n<cite>T</cite> should indicate transparency and <cite>O</cite> should indicate opacity.\nBehavior was inconsistent.  In some cases <cite>O</cite> meant transparency\nwhile in other cases it meant opacity. Also, in a few cases, matte\nwas not getting enabled in the image as it should.  Problems were\nreported by Scott Kuhl.</li>\n</ul>\n</blockquote>\n<p>2009-11-10  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Also suppress new pedantic warnings from most\nolder libpng-1.4.0 betas.</li>\n<li>coders/png.c: Added a warning when attempting to use libpng-1.4beta\nolder than 1.4.0beta67.</li>\n</ul>\n</blockquote>\n<p>2009-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): Only invoke ProfileImage() if\nan ICC CMS transform is to be performed.  Otherwise invoke\nSetImageProfile() to add the new profile.</li>\n<li>magick/profile.c (ProfileImage): Improve logging messages.</li>\n<li>coders/tiff.c (ReadTIFFImage): Allow CIELAB TIFF to be read.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Detect and apply colorspaces\nappropriately for ITU FAX JPEG.</li>\n</ul>\n</blockquote>\n<p>2009-11-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff: Updated to libtiff 3.9.2.</li>\n</ul>\n</blockquote>\n<p>2009-11-08  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Suppress new pedantic warnings from libpng\nversion 1.2.41 and 1.4.0 and later.</li>\n</ul>\n</blockquote>\n<p>2009-11-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Document difference between -recolor and\nAdobe Flash color matrix.</li>\n</ul>\n</blockquote>\n<p>2009-11-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImageCommand): Convolve does not accept\nan argument which looks like a geometry.  Resolves SourceForge\nissue #2890923 &quot;Different handling of -convolve between convert\nand mogrify&quot;.\n(MogrifyImage): Validate that user-provided matrix is square when\nparsing -convolve and -recolor commands in order to avoid a core\ndump.</li>\n<li>coders/tiff.c (ReadTIFFImage): Improved/added more coder logging\nstatements.</li>\n<li>magick/xwindow.c: Reflowed some code and comments.</li>\n<li>magick/utility.c (SetClientName): Default client name does need\nto be &quot;Magick&quot;, so original value is restored.</li>\n<li>coders/mpc.c (ReadMPCImage): is_monochrome and is_grayscale\nflags were not managed properly for the MPC coder.</li>\n</ul>\n</blockquote>\n<p>2009-10-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Added jpeg:block-smoothing and\njpeg:fancy-upsampling defines to control these JPEG library\noptions.</li>\n<li>magick/image.c (SetImageInfo): Fix lockup due to hanging in loop\nwhile parsing malformed sub-image specification (SourceForge issue\n2886560).  Also fixes the ability to pass the image size via the\nfilename specification like &quot;myfile.jpg[640x480]&quot; rather than\nneeding to use -size.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Fix image scaling when used with\nIJG JPEG library version 7.</li>\n</ul>\n</blockquote>\n<p>2009-10-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c: Added support for a &quot;Threads&quot; limit, which\nspecifies how many threads may be used.  Note that if\nomp_set_nested(true) is used, GCC's GOMP seems to replicate this\nnumber of threads for each level of threading rather than sharing\nthe specified number of threads across all teams.  For example,\nspecifying four threads leads to sixteen active threads with\nomp_set_nested(true) and nested threading.  This GOMP behavior\ndoes not seem to cause any harm.\n(GetMagickResourceLimit): New accessor function to retrieve the\nmaximum limit for a resource.</li>\n<li>magick/module.c (ReadModuleConfigureFile): Default set of module\naliases is now statically initialized.  The modules.mgk file is\nnow optional and can be used to support adding more modules, or\ndiverting existing format support to a user-provided module.</li>\n<li>magick/magick.c (DestroyMagick): Document that this function\nshould be invoked from the program's primary thread after any\nthreads using GraphicsMagick have terminated.\n(GetMagickInfo): Was thread safe for access but not properly\nthread safe during initialization.  Is now fully thread safe.\n(InitializeMagick): Fully initialize everything needed to\nread/write files.  Document that this function MUST be invoked\nfrom the program's primary thread prior to using any other\nGraphicsMagick functions.</li>\n<li>magick/color_lookup.c (ReadColorConfigureFile): The colors.mgk\nis now optional so don't throw an exception if it is not found.</li>\n<li>magick/semaphore.c (AcquireSemaphoreInfo): Deprecated this\ninternal function.  Use AllocateSemaphoreInfo() and\nLockSemaphoreInfo() instead.\n(LiberateSemaphoreInfo): Deprecated this internal function.  Use\nUnlockSemaphoreInfo() instead.</li>\n</ul>\n</blockquote>\n<p>2009-10-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>config/colors.mgk: Colors.mkg is now empty since it is used to\nmodify or extend the built-in color lookup table.</li>\n<li>magick/{constitute.c,delegate.c,log.c,magic.c,magick.c,tempfile.c}:\nExplicitly initialize semaphores via InitializeMagick().</li>\n<li>magick/type.h: New header file to contain types and function\nprototypes for functions in type.c.</li>\n<li>magick/color_lookup.c (ReadColorConfigureFile): Store RGB color\ntable in a static struct.  Entries in the colors.mgk file are now\nused to modify statically-defined entries, or add new definitions\nto the color table.</li>\n</ul>\n</blockquote>\n<p>2009-10-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: --enable-libtool-verbose configure option is no\nlonger needed now that we have silent build capability.</li>\n</ul>\n</blockquote>\n<p>2009-10-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Add support for\nretrieving GPS EXIF attributes.  Based on work contributed by\nJukka Manner.</li>\n<li>Magick++/lib/STL.cpp, Magick++/lib/Magick++/STL.h (shadeImage):\nShadeImage was the result of a botched cut-and-paste.  Corrected\nnow.  Thanks to Jukka Manner for making me aware of this.</li>\n</ul>\n</blockquote>\n<p>2009-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/analyze.c: New source file to contain image analysis\nfunctions.  Moved functions from image.c and color.c to this file.</li>\n<li>magick/color_lookup.c: New source file to contain color lookup\nfunctions.  Moved associated functions from color.c to this file.</li>\n<li>magick/ImageMagick.rc: Remove inclusion of magic.mgk.</li>\n<li>magick/utility.c (MagickRoundUpStringLength): Use a bit less\nmemory.</li>\n<li>magick/color.c: Use most efficient string allocation function.</li>\n<li>config/Makefile.am: Eliminate use of magic.mgk.</li>\n<li>magick/magic.c: Store file header magic data in a static struct.</li>\n</ul>\n</blockquote>\n<p>2009-10-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/describe.c (DescribeImage): Include composition operator\nin verbose output.  Also use CompressionTypeToString() to convert\na compression enum to a string.</li>\n</ul>\n</blockquote>\n<p>2009-10-11  Toby Thain  &lt;<a class=\"reference external\" href=\"mailto:qu1j0t3&#37;&#52;&#48;users&#46;sourceforge&#46;net\">qu1j0t3<span>&#64;</span>users<span>&#46;</span>sourceforge<span>&#46;</span>net</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/psd.c: Further fix for 2783535 reported by Daniel Kirsch.\nOmit 0x0 layers from the image list, or they break compositing.</li>\n</ul>\n</blockquote>\n<p>2009-10-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/xwindow.c: Check for overflow on all array allocations.</li>\n<li>magick/command.c (MogrifyImages): If there is only one image in\nthe list, then -flatten does nothing at all.</li>\n<li>magick/transform.c (FlattenImages): If the user provides only\none image then return a clone of that image rather than reporting\nan error.</li>\n<li>magick/texture.c (TextureImage): If an under-texture is applied,\nthen remove the matte channel.</li>\n<li>magick/xwindow.c (MagickXMakeImage): Apply a checkerboard\npattern when displaying non-opaque TrueColor images.  Fix a second\ninteger overflow issue related to CVE-2009-1882.</li>\n</ul>\n</blockquote>\n<p>2009-10-10  Toby Thain  &lt;<a class=\"reference external\" href=\"mailto:qu1j0t3&#37;&#52;&#48;users&#46;sourceforge&#46;net\">qu1j0t3<span>&#64;</span>users<span>&#46;</span>sourceforge<span>&#46;</span>net</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/psd.c: Fix for 2783535 reported by Daniel Kirsch. PSD\nparser was confused by 0x0 pixel layers, resulting in image data\ncorruption of all following layers.</li>\n</ul>\n</blockquote>\n<p>2009-10-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/xwindow.c (MagickXMakeImage): Fix for CVE-2009-1882\n&quot;Integer overflow in the XMakeImage function&quot;.  The problem is\nthat the shared memory segment allocated may be smaller than the\nimage size requires due to integer overflow.  On some systems it\nmay be possible to crash GraphicsMagick (while displaying an image\nfile) but not likely to overwrite the heap since shared memory\nsegments are outside of the heap allocation.</li>\n<li>magick/memory.c (MagickMallocArray): Use MagickArraySize().</li>\n<li>magick/memory.c (MagickArraySize): New private function to\ncompute the size of an array and return zero if it overflows the\nsize_t type.</li>\n</ul>\n</blockquote>\n<p>2009-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (ReadDCMImage): Handle (UN)known type VRs correctly\nand interpret the transfer syntax correctly.  Added define\n&quot;dcm:avoid-scaling&quot; to request that the coder should not scale\nimage samples unless necessary (i.e. when bits used &gt; quantum\ndepth or maximum colormap depth, depending on image type).  Work\nis contributed by John Sergeant.</li>\n</ul>\n</blockquote>\n<p>2009-10-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/Makefile.am (CHECK_PDF_FILE_COMPRESS): Add PDF tests with\nthe various compression options.</li>\n<li>coders/pdf.c (WritePDFImage): If the input file used JPEG\ncompression and has not been converted to a bilevel or palette\nimage, then use JPEG compression with original settings.  Problem\nwas reported by Marco Atzeri.</li>\n</ul>\n</blockquote>\n<p>2009-10-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>config/modules.mgk: DCRAW module entries were missing.</li>\n<li>coders/tiff.c (WriteGROUP4RAWImage): Was not working properly on\nbig-endian CPUs with libtiff 1.4.</li>\n<li>coders/ps2.c (WritePS2Image): Use ImageToJPEGBlob().</li>\n<li>coders/ps3.c (WritePS3Image): Use ImageToJPEGBlob().</li>\n<li>coders/pdf.c (WritePDFImage): Decouple from libtiff.  Use ImageToJPEGBlob().</li>\n<li>coders/dcraw.c (RegisterDCRAWImage): Needed to register module\nname.</li>\n<li>coders/cals.c (ReadCALSImage): Fix bug in CALS reader which\ncaused reading images taller than the image width to fail with an\nerror.</li>\n<li>magick/utility.c (AcquireString): Minor optimizations.\n(AllocateString): Minor optimizations.\n(CloneString): Minor optimizations.\n(LocaleCompare): Minor optimizations.\n(SubstituteString): Re-implemented in a more compact way which\nmight avoid some reallocations.</li>\n<li>magick/magick.c (ListModuleMap): Don't crash if <cite>module</cite> was not\nset.</li>\n<li>magick/delegate.c (ListDelegateInfo): Fix insignificant memory\nleak.</li>\n<li>magick/compress.c (ImageToJPEGBlob): Preserve JPEG settings if\nfeasable.</li>\n</ul>\n</blockquote>\n<p>2009-09-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Use ImageToHuffman2DBlob() and\nImageToJPEGBlob().</li>\n<li>coders/cals.c (WriteCALSImage): Use ImageToHuffman2DBlob().</li>\n<li>magick/compress.c (ImageToHuffman2DBlob): New private\nconvenience function to produce a CCIT Group4 blob.\n(ImageToJPEGBlob): New private convenience function to produce a\nJPEG blob.</li>\n</ul>\n</blockquote>\n<p>2009-09-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (ReadJP2Image): Fix scaling problem noticed when\nreading 12-bit JP2 format.  Problem was reported by Steve Shaw.\n(WriteJP2Image): Support writing JP2 files with arbitrary depth\nranging from 2 to 16 rather than just 8 or 16.</li>\n</ul>\n</blockquote>\n<p>2009-09-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/unix_port.c (MagickGetMMUPageSize): Cache returned page\nsize to eliminated repeated system calls.</li>\n<li>magick/operator.c (QuantumOperatorRegionImage): Fix missing\npercent in progress monitor message.</li>\n</ul>\n</blockquote>\n<p>2009-09-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c (GetIPTCStream): Should return IPTC block length\nrather than remaining blob length.  Patch submitted by John\nSergeant.</li>\n</ul>\n</blockquote>\n<p>2009-09-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c (GetIPTCStream): IPTC blobs should be padded to an\neven size.  Patch submitted by John Sergeant.</li>\n</ul>\n</blockquote>\n<p>2009-09-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteGROUP4RAWImage): Added a GROUP4RAW encoder.</li>\n<li>coders/cals.c (Huffman2DEncodeImage): Fix test failures when\ndoing I/O to an in-memory blob.</li>\n<li>coders/pcl.c (WritePCLImage): Use a different control code to\n(hopefully) eject the page.  Patch submitted by John Sergeant.</li>\n</ul>\n</blockquote>\n<p>2009-09-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/Makefile.am: Add CALS tests.  Skip testing deep images for\nmost formats which don't support deep images.</li>\n<li>coders/cals.c: CALS module was not being built under Windows\nwith MSVC.  Now it is.</li>\n<li>VisualMagick/configure/configure.cpp (process_library): CALS\nmodule is dependent on TIFF library.</li>\n<li>coders/cals.c (WriteCALSImage): Allow CALS writing at any time,\nbut only enable CALS reader if libtiff is present at build time.</li>\n<li>coders/{cals.c,pdf.c,ps2.c,ps3.c} (Huffman2DEncodeImage): Force\nTIFF image type to bilevel type.</li>\n<li>config/modules.mgk, VisualMagick/bin/modules.mkg: CAL--&gt;CALS\nrather than CALS--&gt;CAL.</li>\n</ul>\n</blockquote>\n<p>2009-09-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/benchmarks.rst: Updated GraphicsMagick vs ImageMagick\nbenchmark results.</li>\n</ul>\n</blockquote>\n<p>2009-09-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/cals.c (WriteCALSImage): Initial CALS Type 1 writer\nimplementation.  Contributed by John Sergeant.</li>\n<li>coders/png.c (ReadOnePNGImage): Fresh pixels should be set using\nSetImagePixels().</li>\n</ul>\n</blockquote>\n<p>2009-09-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Released GraphicsMagick 1.3.7.</li>\n</ul>\n</blockquote>\n<p>2009-09-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/msl.c, doc/conjure.imdoc: Add support for a new <cite>profile</cite>\ncommand in MSL/conjure which applies, adds, or removes one or more\nIPTC, ICC or generic profiles from a file.  Work contributed by\nJohn Sergeant.</li>\n</ul>\n</blockquote>\n<p>2009-09-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (NTGhostscriptFind): Make sure we close the\nregistry key.  Log any Windows error messages.</li>\n<li>magick/profile.c (AppendImageProfile): New function to add or\nappend a profile.  If the profile already exists, then the data\nprovided is appended to it.</li>\n<li>coders/jpeg.c (ReadGenericProfile,ReadICCProfile,ReadIPTCProfile):\nProfile chunks need to be concatenated.  Otherwise &quot;chunked&quot;\nprofiles become corrupted.</li>\n</ul>\n</blockquote>\n<p>2009-09-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/average.c (AverageImages): Moved from image.c to new\naverage.c file.</li>\n<li>magick/colormap.h (VerifyColormapIndex): Moved here from color.h</li>\n<li>magick/colormap.c (AllocateImageColormap): Moved from image.c to\nnew colormap.c source file.\n(CycleColormapImage): Moved from image.c.\n(ReplaceImageColormap): Moved from image.c.\n(SortColormapByIntensity): Moved from image.c.\n(MagickConstrainColormapIndex): Moved here from color.c.</li>\n<li>magick/describe.c (DescribeImage): Moved from image.c to new\ndescribe.c source file.</li>\n<li>magick/plasma.c (PlasmaImage): Moved from image.c to new\nplasma.c source file.</li>\n<li>magick/statistics.c (GetImageStatistics): Moved from image.c to\nnew statistics.c source file.</li>\n<li>magick/gradient.c (GradientImage): Moved from image.c to new\ngradient.c source file.</li>\n<li>magick/texture.c (ConstituteTextureImage,TextureImage): Moved to\nnew texture.c source file.</li>\n<li>coders/svg.c (ENABLE_SVG_WRITER): Disable SVG writer by default\nsince it usually does not work correctly and is unlikely to work\ncorrectly any time soon.</li>\n</ul>\n</blockquote>\n<p>2009-09-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/profile.c (ProfileImage): GlobExpression is case\nsensitive so assure that its glob strings are always upper-cased.\nWithout this fix, lower-cased arguments like &quot;icm&quot; would fail to\nbe removed.  This would not be much of a problem except that the\ndocumentation claims that lower-case works.\n(SetImageProfile): Assure that profile names are upper-cased.</li>\n<li>magick/fx.c (ColorMatrixImage): Add opaque opacity channel if\nimage currently lacks an opacity channel but the matrix updates\nthe opacity channel.  Requested by Kerry Panchoo.</li>\n</ul>\n</blockquote>\n<p>2009-09-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c (GetIPTCStream): Updates from John.Sergeant to fix\nissues with IPTC record 2 blocks and to deal better with IPTC\nembedded in an 8BIM profile.</li>\n<li>PerlMagick/t/read.t: Added tests for Topol format.</li>\n</ul>\n</blockquote>\n<dl class=\"docutils\">\n<dt>2009-09-12 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</dt>\n<dd><ul class=\"first last simple\">\n<li>coders/topol.c: Pallette overflow fixed for subtype 3.</li>\n</ul>\n</dd>\n</dl>\n<p>2009-09-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/tests/msl_composite.sh: Use a draw command file for\nthis test script too.</li>\n<li>utilities/tests/{black-threshold.sh,draw.sh,recolor.sh,\nwhite-threshold.sh}: MSYS is sometimes wreaking havoc on arguments\nwith spaces in them so use work-arounds.</li>\n</ul>\n</blockquote>\n<p>2009-09-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (NTGhostscriptFind): Improve logging messages\nwhen searching for Ghostscript.</li>\n</ul>\n</blockquote>\n<p>2009-09-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (CacheInfo): Add read_only member to\nindicate if cache is allowed to be modified.\n(ModifyCache): Clone cache if origin cache is read only.\n(PersistCache): Persistent caches which are attached are treated\nas read-only.  This avoids crash with MPC images which are read\nand subsequently modified.\nReverted pixel cache locking changes which were made yesterday\nsince I decided that they were too risky until file handle\nmanagement is addressed.</li>\n</ul>\n</blockquote>\n<p>2009-09-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c (InitializeMagickResources): Increase\noperating system file handle limits if necessary.</li>\n<li>magick/pixel_cache.c: Pixel cache file locking is now done at\npoint of access.</li>\n<li>magick/nt_base.c (NTGhostscriptFind): New function to find\nGhostscript under Windows, replacing previous Ghostgum\nimplementation.</li>\n<li>Copyright.txt: License is now based on MIT license exactly,\nwithout extra edits.  Ghostgum code has been eliminated so it is\nno longer necessary to include its license.</li>\n</ul>\n</blockquote>\n<p>2009-09-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/delegate.c (GetPostscriptDelegateInfo): Add a gs-palette\ndelegate entry in order to force Ghostscript to output a\ncolormapped image if <cite>-type palette</cite> is specified prior to the\ninput filename.  Ghostscript's dithering is much courser than\nGraphicsMagick's -colors default (more similar to\n-ordered-dither), but it is fast and produces smaller intermediate\nfiles.</li>\n<li>coders/ps.c (ReadPSImage): Eliminate use of NULL pointer when\nprogress monitor is enabled.  Was referring to image-&gt;filename\nrather than image_info-&gt;filename as it should have.</li>\n<li>magick/delegate.c (InvokePostscriptDelegate): Added an\n<cite>exception</cite> argument so that failure details can be returned.\nTried to reorganize the code so that it is more tolerant of errors\nsuch as a dynamically-loadable DLL failing to load.  On POSIX\nsystems, Ghostscript was not being invoked as securely as\nexpected.</li>\n<li>coders/Makefile.am: Only build the DPS module if the Display\nPostscript library is available.</li>\n<li>coders/ept.c (ReadEPTImage): If we don`t have the Display\nPostscript library, then don't try to use it as a fallback.</li>\n<li>coders/ps.c (ReadPSImage): If we don't have the Display\nPostscript library, then don't try to use it as a fallback.</li>\n<li>magick/blob.c (CloseBlob): If blob was never allocated, then\ndon't try to close it.</li>\n</ul>\n</blockquote>\n<p>2009-09-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/index.rst: Mention 1.2.8 release.</li>\n</ul>\n</blockquote>\n<p>2009-09-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++: New Image methods cdl(), colorMatrix(), and haldClut()\nadded.</li>\n</ul>\n</blockquote>\n<p>2009-09-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c (IntegralRotateImage): Select tile sizes in a\nmore intelligent fashion.</li>\n<li>magick/pixel_cache.c (GetPixelCacheInCore): New private pixel\ncache method to see if image pixels are in core.</li>\n</ul>\n</blockquote>\n<p>2009-09-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ReadImage): No longer clear the exception\nat the start of ReadImage() and other similar functions.  If the\nuser of the function cares, she can clear the exception in\nadvance.  It is not right to overwrite exceptions which might not\nhave been reported/handled yet.</li>\n<li>magick/shear.c (IntegralRotateImage): Rotate by zero degrees\ndoes not need to do any work.</li>\n<li>coders/*.c, magick/*.c: Include image dimensions in progress\nmonitor output when loading or saving a file.  Eliminate redundant\ntext from progress messages.</li>\n</ul>\n</blockquote>\n<p>2009-08-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c: Eliminate memory leaks.</li>\n<li>magick/render.c (DrawDashPolygon): Avoid access beyond end of\narray.  Resolves SourceForge issue 2832125 &quot;Crash on SVG\nconversion&quot;.</li>\n<li>coders/png.c (ReadOnePNGImage): Ensure that opacity channel is\nproperly initialized.  Resolves SourceForge issue 2831240\n&quot;Possible alpha channel issue with PNG w/palette and tRNS&quot;.</li>\n</ul>\n</blockquote>\n<p>2009-08-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.h (HAVE_TIFFSWABARRAYOFTRIPLES): Need to define\nthis since libtiff includes this function now.</li>\n<li>VisualMagick/tiff/libtiff/tiffconf.h.in: Enable all the options\nby default.</li>\n<li>tiff: Updated to libtiff 3.9.1.  3.9.0 was broken.</li>\n</ul>\n</blockquote>\n<p>2009-08-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/profile.c (MagickFreeCMSTransform): Add a CMS transform\ndestructor since otherwise Visual Studio does not like it.</li>\n<li>tiff: Updated to libtiff 3.9.0.</li>\n</ul>\n</blockquote>\n<p>2009-08-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (TimeImageCommand): Add a simple <cite>time</cite>\nsub-command to time the execution of any other GraphicsMagick\nsub-command.  Similar in concept to the <cite>benchmark</cite> sub-command\nbut produces output similar to the <cite>time</cite> command offered by the\nzsh command shell.  Handy for when <cite>time</cite> is not available, or\nconsistent output is desired.</li>\n<li>magick/magick.c (MagickGetFileSystemBlockSize): New private\nfunction to allow getting desired filesystem block size.\n(MagickSetFileSystemBlockSize): New private function to allow\nsetting desired filesystem block size.</li>\n<li>magick/pixel_cache.c (WriteCacheIndexes, WriteCachePixels):\nTemporarily disable pixel cache row coalescing when writing to\ndisk until we come up with a good way to optimize write sizes.</li>\n<li>coders/meta.c (ReadMETAImage): Fix memory leak of profile blob.</li>\n</ul>\n</blockquote>\n<p>2009-08-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/tests/icc-transform.sh: Add a sanity-test for applying\nICC profiles.</li>\n<li>magick/profile.c (ProfileImage): Improve OpenMP performance.</li>\n</ul>\n</blockquote>\n<p>2009-08-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawPolygonPrimitive): Drawing of points,\nlines, and polygons is now accelerated using OpenMP with good\nspeed-up.</li>\n</ul>\n</blockquote>\n<p>2009-08-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/drawing_wand.c (DrawClearException): New function to clear\ndrawing wand exception.\n(DrawGetException): New function to retrieve information regarding\nthe last drawing wand exception (if any).\n(DrawRender): DrawRender() is now deprecated since it requires an\nImage pointer to be embedded in the drawing wand.  The image\npassed is subsequently lost by CloneDrawingWand() since it must\nclone the image using copy-on-write.  Subsequent use of\nDrawRender() on a cloned wand scribbles on an image the user does\nnot have access to.  Use existing Wand function MagickDrawImage()\ninstead.\n(DrawAllocateWand): DrawAllocateWand() is now deprecated since it\nrequires passing an Image pointer into the drawing wand.  Use\nexisting DrawingWand function NewDrawingWand() instead.</li>\n</ul>\n</blockquote>\n<p>2009-08-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/drawing_wand.c (CloneDrawingWand): New function to\ndeep-copy a drawing wand.\n(NewDrawingWand): Use a boolean flag to track if image is\nallocated by the wand, or by the user.  Most of the previous\nDrawAllocateWand() code is moved into NewDrawingWand() so that the\nboolean flag is easy to manage.</li>\n</ul>\n</blockquote>\n<p>2009-08-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Support writing grayscale\nJPEG-compressed TIFF.</li>\n</ul>\n</blockquote>\n<p>2009-08-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Don't override the photometric\nfor grayscale JPEG-compressed TIFF.</li>\n</ul>\n</blockquote>\n<p>2009-08-08  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>coders/png.c: Made compatible with libpng-1.4.0beta74 and later</dt>\n<dd>(won't work with libpng-1.4.0beta35 through beta73) due to change\nin names of png_struct members &quot;trans&quot; and &quot;trans_values&quot;).</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<dl class=\"docutils\">\n<dt>2009-08-08 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</dt>\n<dd><ul class=\"first last simple\">\n<li>coders/topol.c: Pallette is ignored for subtype 5 (RGB).</li>\n</ul>\n</dd>\n</dl>\n<p>2009-08-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/{cineon.c, dpx.c, locale.c, svg.c}, magick/{attribute.c,\neffect.c, utility.c}: Eliminate warnings reported by GCC 4.4.0.</li>\n</ul>\n</blockquote>\n<p>2009-07-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Try to be more insistent about compilation failure\nif libjpeg version is less than 6b.  IRIX compiler only warns\nabout #error preprocessor statement.</li>\n</ul>\n</blockquote>\n<p>2009-07-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickSetCompressionQuality): New Wand\nmethod to allow setting the compression quality.</li>\n</ul>\n</blockquote>\n<p>2009-07-29 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/topol.c: Fixed missing break. Added response to ping.</li>\n</ul>\n</blockquote>\n<p>2009-07-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcx.c (ReadPCXImage): Detect improper rows, columns, or\ndepth.  Fixes CVE-2008-1097 &quot;Memory corruption in ImageMagick's\nPCX coder&quot;.</li>\n<li>configure.ac: Update to Autoconf 2.64.</li>\n</ul>\n</blockquote>\n<p>2009-07-25 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/topol.c: Fixed several issues. Added possibility to read\nTopoL level 2 images.</li>\n</ul>\n</blockquote>\n<p>2009-07-25 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagickconfigureconfigure.cpp: Fixed library absolute path issue.</li>\n</ul>\n</blockquote>\n<p>2009-07-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/random.c (DestroyMagickRandomGenerator): Trick to free\nthread specific random kernel contexts simply locks up with MSVC's\nOpenMP, so remove this functionality.</li>\n</ul>\n</blockquote>\n<p>2009-07-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/random.c (DestroyMagickRandomGenerator): Cleanup thread\nspecific random kernel data.</li>\n<li>magick/tsd.c (MagickTsdKeyCreate): Fix glitch when built without\nany threads support.</li>\n</ul>\n</blockquote>\n<p>2009-07-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/benchmarks.rst: Update GraphicsMagick vs ImageMagick image\nprocessing benchmark results.</li>\n</ul>\n</blockquote>\n<p>2009-07-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/OpenMP.rst: Update performance measurements for readily\navailable systems.</li>\n<li>NEWS.txt: Updated to reflect latest changes.</li>\n</ul>\n</blockquote>\n<p>2009-07-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png: Updated libpng to 1.2.38.</li>\n</ul>\n</blockquote>\n<p>2009-07-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (GetImageInfo): Default interlace for ImageInfo\nis now UndefinedInterlace so that it is possible to preserve the\noriginal interlace setting for the image file.  Code depending on\nthe previous default setting of NoInterlace is adjusted to suit.\nThis is a potentially risky change given the brittle nature of\nsome of the legacy code.</li>\n<li>coders/tiff.c (ReadTIFFImage): Stripped reader needs to read\nplanar TIFF plane-wise in order to work with libtiff's internal\nbuffering.\n(ReadTIFFImage): Tiled reader needs to read planar TIFF plane-wise\nin order to work with libtiff's internal buffering.\n(WriteTIFFImage): Tiled writer needs to output planar TIFF\nplane-wise in order to work with libtiff's internal buffering.</li>\n</ul>\n</blockquote>\n<p>2009-07-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MontageUsage): Reconcile montage help output\nwith actual montage options.</li>\n</ul>\n</blockquote>\n<p>2009-07-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Allow the user to be able to\nspecify rows_per_strip when using JPEG compression.  The\nrows_per_strip value rounded up to the nearest multiple of 16.</li>\n</ul>\n</blockquote>\n<p>2009-07-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Add the ability for the user to\nmanually specify the predictor using syntax like <cite>-define\ntiff:predictor=2</cite>.</li>\n</ul>\n</blockquote>\n<p>2009-07-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/quantize.c (QuantizeImages): Avoid crash when using\n-monitor +map on an image list.</li>\n<li>magick/command.c (BenchmarkImageCommand): Send benchmark report\nto stderr so that it does not interfer with pipes.</li>\n<li>magick/cdl.c (CdlQuantum): Add range limiting of value before\napplying power function.</li>\n<li>coders/dpx.c (ReadDPXImage, WriteDPXImage): Using floating point\ncalculations when building sample value lookup tables in order to\ndecrease error.  In particular input values were being scaled too\nlow, resulting in improperly rounding down during processing of\nthe image.</li>\n</ul>\n</blockquote>\n<p>2009-07-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Incorporated updates from John\nSergeant to remove the font and thumbnail objects from PDF output.</li>\n</ul>\n</blockquote>\n<p>2009-07-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/cdl.c (CdlImage): New function to apply an ASC CDL\ntransform to the image.  Original implementation by Clément Follet\nfrom Workflowers but considerably re-worked by Bob Friesenhahn.\nAvailable as -asc-cdl via the <cite>convert</cite> and <cite>mogrify</cite> subcommands.</li>\n</ul>\n</blockquote>\n<p>2009-07-04 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/formats.rst: MAT module can read compressed files.\nRemove warning about unsupported compression.</li>\n</ul>\n</blockquote>\n<p>2009-07-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c: Eliminate compiler warnings.</li>\n</ul>\n</blockquote>\n<p>2009-07-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c: Significant re-write of the DICOM reader.  Work\ncontributed by John Sergeant.</li>\n</ul>\n</blockquote>\n<p>2009-07-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (OpenBlob): Subsequent research shows that Direct\nI/O will not be useful to ordinary file I/O due to specific\nrequirements for buffer alignments and I/O sizes.  Support for\nrequesting it is removed.</li>\n</ul>\n</blockquote>\n<p>2009-07-01  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/formats.rst: ART module has writer for more than year.\nSo mark this here.</li>\n</ul>\n</blockquote>\n<p>2009-06-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac, magick/blob.c: Add experimental Solaris direct I/O\nsupport which is enabled by setting the environment variable\nMAGICK_DIRECTIO to TRUE.  Direct I/O bypasses the filesystem\ncache.  Only works for NFS and UFS, and not for ZFS.</li>\n</ul>\n</blockquote>\n<p>2009-06-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>rungm.sh.in: Fix environment variable issues noticed while\nrunning the test suite under MinGW.</li>\n<li>Makefile.am (TESTS_ENVIRONMENT): Fix environment variable issues\nnoticed while running the test suite under MinGW.</li>\n<li>magick/hclut.c (HaldClutImage): Don't convert Cineon Log to RGB.</li>\n</ul>\n</blockquote>\n<p>2009-06-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImageCommand): Cache mogrify argument\nimages so that they are only loaded once when mogrify is used to\nprocess multiple image files.</li>\n<li>coders/dpx.c (WriteDPXImage): Fix leak of chroma image when\nsubsampling to 4:2:2.</li>\n</ul>\n</blockquote>\n<p>2009-06-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (ExpandFilenames): Expand &#64;filename to a list\nof arguments.</li>\n</ul>\n</blockquote>\n<p>2009-06-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImageCommand): Fix memory leak of\noutput_directory string buffer, if it was used.</li>\n<li>magick/utility.c (ExpandFilenames): Input wildcard file\nspecifications with a subdirectory component such as\n&quot;subdir/*.dpx&quot; were not working.</li>\n</ul>\n</blockquote>\n<p>2009-06-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (InitializeMagick): Invoke InitializeMagickRegistry().</li>\n<li>magick/registry.c (RegistryInfo): There is no reason to expose\nthe RegistryInfo structure in the public interface so it is moved\nto registry.c.\n(InitializeMagickRegistry): Add a function for initializing the\nmagick registry.</li>\n</ul>\n</blockquote>\n<p>2009-06-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (CompareImageCommand): Report full error rather\nthan rounded error in error reports since sometimes the value\nreported was rounded down to zero.</li>\n<li>utilities/tests/hald-clut-transform.sh: New test to verify that\nHald CLUT interpolation is working perfectly.</li>\n<li>utilities/tests/hald-clut-identity.sh: Renamed from\nhald-clut.sh.</li>\n</ul>\n</blockquote>\n<p>2009-06-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (RegisterJPEGImage): Fix typo which caused IJG\nlibrary version to be shown for &quot;JPG&quot; format but not for &quot;JPEG&quot;.\nAlso use a more descriptive name for JPEG library.</li>\n<li>magick/image.c (DescribeImage): Filter out spurious EXIF\nattributes which already exist because we previously accessed\nthem.  We do a full EXIF dump later.</li>\n</ul>\n</blockquote>\n<p>2009-06-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/FAQ.rst: Add a FAQ about how to process many files at once.</li>\n</ul>\n</blockquote>\n<p>2009-06-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Reduce usage of deprecated Autoconf macros.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Set image orientation from EXIF\nOrientation tag if it is present.</li>\n<li>www/formats.rst: Add TopoL format as per Jaroslav Fojtik.</li>\n</ul>\n</blockquote>\n<p>2009-06-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: User provided LDFLAGS was being overwritten under\nSolaris.</li>\n<li>Many files: Additional reduction of shadowing warnings.</li>\n</ul>\n</blockquote>\n<p>2009-06-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): Fix leak of the entire mask\nimage supplied via -mask.</li>\n<li>utilities/tests/mask.sh: Add a test for applying a mask image\nwith -mask.</li>\n</ul>\n</blockquote>\n<p>2009-06-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Identify unknown\ntags via their four-character hex value.</li>\n<li>magick/colorspace.c (CMYKToRGBTransform): Use symbolic notation\nto access pixel quantum values.</li>\n<li>utilities/tests/identify.sh: Added a test for <cite>identify\n-verbose</cite> on a well-populated JPEG file.</li>\n<li>PerlMagick/t/{jpeg/write.t, jng/read.t, jng/write.t}: Relax\nallowed error for JPEG-related tests.</li>\n<li>magick/attribute.c (GenerateEXIFAttribute): Attribute allocation\nsize was too small causing overrun of memory buffer.  Problem was\nadded on 2009-06-08.</li>\n<li>magick/image.c (AllocateDepthMap): Allocation size was one\nelement too small.\n(GetImageDepth): Forgot to free depth map.  Memory leak of 64K\nbytes per iteration.</li>\n</ul>\n</blockquote>\n<p>2009-06-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/{mat.c, miff.c, pdf.c, ps3.c}: Have Zlib use our memory\nallocators.</li>\n<li>magick/memory.c (MagickMallocCleared): New memory allocation\ninterface which is similar to MagickMalloc() except that returned\nmemory has been cleared first.</li>\n<li>magick/hclut.c (HaldClutImagePixels): Fix wrong accesses\ndetected by valgrind.  Also improve execution performance.</li>\n<li>coders/xwd.c (WriteXWDImage): Fixed valgrind memcheck complaint\nabout access to uninitialized data.</li>\n</ul>\n</blockquote>\n<p>2009-06-09  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c Handle alpha channel for ImageMagick's alternative .txt</li>\n</ul>\n</blockquote>\n<p>2009-06-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteDPXImage): Fixed valgrind memcheck complaint\nabout access to uninitialized data.</li>\n<li>magick/attribute.c (GenerateEXIFAttribute): For EXIF STRING,\noutput unprintable characters using three-digit octal notation.</li>\n<li>coders/dpx.c (WriteDPXImage): Assure that offset count is\ncorrect according to reported bytes written.</li>\n<li>utilities/tests/hald-clut.sh: Add a simple identity test for the\nHald CLUT support.</li>\n</ul>\n</blockquote>\n<p>2009-06-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c Handle alpha channel for ImageMagick's .txt</li>\n</ul>\n</blockquote>\n<p>2009-06-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/hclut.c (HaldClutImage): Add a Hald CLUT capability as\ndescribed at <a class=\"reference external\" href=\"http://www.quelsolaar.com/technology/clut.html\">http://www.quelsolaar.com/technology/clut.html</a>.  This\nallows a color transformation to be easily created and replicated\non any number of images.  The algorithm is accessed by the\n-hald-clut option of <cite>convert</cite> and <cite>mogrify</cite>.  The original\nalgorithm is by Eskil Steenberg and was adapted for GraphicsMagick\nby Clément Follet from Workflowers with support from Cédric\nLejeune of Workflowers.</li>\n</ul>\n</blockquote>\n<p>2009-06-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetMagickGeometry): Support <cite>^</cite> modifier to\ngeometry specification which indicates that specified size is a\nminimum bounding box rather than a maximum bounding box while\npreserving the image aspect ratio.</li>\n</ul>\n</blockquote>\n<p>2009-06-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c (ListMagickResourceInfo): If supporting\nOpenMP, then include a &quot;Threads&quot; limit in the output of <cite>-list\nresource</cite>.</li>\n<li>coders/pnm.c (ReadPNMImage): Fix multi-thread issue detected by\nvalgrind's helgrind tool.  Diminish compilation warnings.</li>\n<li>coders/dpx.c (ReadDPXImage): Diminish compilation warnings.</li>\n<li>magick/random.c (AcquireMagickRandomKernel): Fix potential\nmulti-thread issue detected by valgrind's helgrind tool.</li>\n<li>magick/magick.c (InitializeMagick): Semaphore subsystem needs to be\ninitialized before anything which uses it.</li>\n<li>magick/semaphore.c (InitializeSemaphore): Since we are using\nPTHREAD_MUTEX_INITIALIZER to initialize primary POSIX mutex in the\nsemaphore subsystem, we should not explicitly initialize the\nsemaphore a second time.</li>\n<li>magick/segment.c (Classify): Fix multi-thread issue detected by\nvalgrind's helgrind tool.</li>\n<li>magick/render.c (DrawAffineImage): Use InterpolateViewColor() to\nevalute a bi-linear interpolated point rather than obtaining a\npixel value from a close pixel.  This provides better results.</li>\n</ul>\n</blockquote>\n<p>2009-06-02  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c Attempt to handle alpha channel.</li>\n</ul>\n</blockquote>\n<p>2009-06-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (InterpolateViewColor, InterpolateColor):\nMoved from gem.c.  Gem functions should not be accessing the pixel\ncache.</li>\n</ul>\n</blockquote>\n<p>2009-06-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (CompareImageCommand): Add a -maximum-error\noption to <cite>compare</cite> so that it can easily be used in boolean logic\nwhen comparing images.</li>\n</ul>\n</blockquote>\n<p>2009-05-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/Makefile.am (TESTS_XFAIL_TESTS): If Ghostscript is not\navailable then XFAIL the tests which depend on it.</li>\n<li>magick/pixel_cache.c (GetCacheInfo): Assure that allocated\nstuctures do not occupy the same cache lines.</li>\n</ul>\n</blockquote>\n<p>2009-05-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h (MAGICK_CACHE_LINE_SIZE): Allow cache line size\nto be set in one place in case we want to configure for it later.</li>\n<li>magick/effect.c (AllocateMedianList): Assure that allocated\nstuctures do not occupy the same cache lines.</li>\n<li>magick/random.c (AcquireMagickRandomKernel): Assure that\nallocated random kernels do not occupy the same cache lines.</li>\n<li>magick/gem.c (GenerateDifferentialNoise): User is required to\nsupply random kernel.</li>\n<li>doc/options.imdoc: Document -format &quot;%p&quot;.  Problem was reported\nby Stijn Sanders.</li>\n</ul>\n</blockquote>\n<p>2009-05-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/Makefile.am (coders_tiff_la_LIBADD): Libtiff may now also\ndepend on libjbig and the math library.</li>\n<li>doc/gmdoc2html: Fix link to ball.png.  Problem was reported by\nWes Fox.</li>\n<li>VisualMagick/installer/inc/files-documentation.isx: Include Wand\nAPI documentation.</li>\n<li>VisualMagick/installer/inc/icons-associate.isx: Fix Windows\nStart menu link to web pages.</li>\n<li>configure.ac: --with-perl is changed to --without-perl since\nbuilding PerlMagick is no longer the default.  Building PerlMagick\nautomatically has caused too many problems.</li>\n<li>PerlMagick/Makefile.am: GraphicsMagick no longer automatically\ninstalls PerlMagick.  Use the procedure described by\nPerlMagick/README.txt to build and install PerlMagick.</li>\n</ul>\n</blockquote>\n<p>2009-05-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Debian stores Ghostscript fonts under\n/usr/share/fonts/type1/gsfonts so check there for fonts.  Issue\nreported by Ralf Wildenhues.</li>\n</ul>\n</blockquote>\n<p>2009-05-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Fix Ping of blob.</li>\n<li>PerlMagick/t/ping.t: Added tests for pinging files and blobs.</li>\n<li>www/perl.rst: Ping blob syntax is like $image-&gt;Ping(blob=&gt;&#64;blob).</li>\n<li>PerlMagick/Makefile.PL.in: Increase the probability of\nPerlMagick build success by using the user-specified C compiler as\nthe linker if the C compiler was already used as the linker.  This\nhelps if the C compiler used to build GraphicsMagick is a more\nrecent vintage than the one used to build Perl.</li>\n<li>PerlMagick/t/wmf/read.t: Test needs to be more lenient for\nLinux.</li>\n<li>Makefile.am (TESTS_ENVIRONMENT): Pass a complete text\nenvironment so that we don't need to execute rungm.sh in order to\nrun the test suite.</li>\n</ul>\n</blockquote>\n<p>2009-05-25  Ralf Wildenhues  &lt;<a class=\"reference external\" href=\"mailto:Ralf&#46;Wildenhues&#37;&#52;&#48;gmx&#46;de\">Ralf<span>&#46;</span>Wildenhues<span>&#64;</span>gmx<span>&#46;</span>de</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Define PACKAGE_STRING.</li>\n</ul>\n</blockquote>\n<p>2009-05-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/tempfile.c (ComposeTemporaryFileName): Use new random\nnumber generator.</li>\n<li>magick/random.c: Implement a random number generation system\nbased on George Marsaglia's multiply-with-carry generator.\nSomewhat slower than rand() but produces better random numbers\nwith a period &gt;2^60.  Suggested by Mark Mitchell.</li>\n</ul>\n</blockquote>\n<p>2009-05-24  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">coders/txt.c Small optimization:</p>\n<p>Before: 2000 iter 34.08s user 34.24s total 58.420 iter/s</p>\n<p>After: 2000 iter 21.55s user 21.76s total 91.891 iter/s</p>\n</li>\n</ul>\n</blockquote>\n<p>2009-05-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (XFAIL_TESTS): Handle the case where FreeType is not\navailable by marking tests dependent on FreeType as XFAIL.\n(TESTS): Reorder TESTS so that there will be no trailing spaces\nsince this confuses certain older versions of GNU make.</li>\n</ul>\n</blockquote>\n<p>2009-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/tempfile.c (ComposeTemporaryFileName): Use simpler code\n(suggested by Mark Mitchell) to compute the substitution index.\n(AcquireTemporaryFileDescriptor): Try harder to generate a\nsuccessful temporary file and fall through to alternative\nimplementations if the first does not succeed.</li>\n<li>magick/magick.c (InitializeMagick): Use MagickRandNewSeed() to\nseed the default random number generator.</li>\n<li>magick/utility.c (MagickRandNewSeed): Include PID in random\nnumber seed generation.</li>\n</ul>\n</blockquote>\n<p>2009-05-22  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>coders/txt.c Fixed char vs int parameter problem.</dt>\n<dd>Better detection of too dark 16bit or 32bit images.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2009-05-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (AUTOMAKE_OPTIONS): Enable parallel-tests and\ncolor-tests options.  Parallel test execution does not pass tests\nyet.</li>\n<li>PerlMagick/PerlMagickCheck.sh.in: Run PerlMagick tests via a\nnormal check script rather than a check hook.</li>\n<li>coders/identity.c (ReadIdentityImage): Fix compilation with Sun\ncompiler.</li>\n</ul>\n</blockquote>\n<p>2009-05-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwfile.c: Allow the user to specify the basename for\ntemporary files.</li>\n<li>tests/Makefile.am: Add a set of TXT read/write tests.  Pass the\nfile name specification to use for the rwfile-based tests.</li>\n</ul>\n</blockquote>\n<p>2009-05-21  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c Fixed endian set to native endian.</li>\n</ul>\n</blockquote>\n<p>2009-05-20  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c Faster read ImageMagick files.\nRemoved BImgBuff=NULL;</li>\n</ul>\n</blockquote>\n<p>2009-05-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c (WriteTXTImage): Ensure that image depth is 8, 16,\nor 32.</li>\n<li>www/formats.rst: Add CALS to formats list.</li>\n<li>coders/cals.c (RegisterCALSImage): Consolidate duplicate text\nstrings.</li>\n</ul>\n</blockquote>\n<p>2009-05-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/cals.c: Add support for reading CALS type 1 format.\nContributed by John Sergeant.</li>\n<li>coders/identity.c: New coder to return a Hald identity CLUT\nimage.</li>\n</ul>\n</blockquote>\n<p>2009-05-19  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c Ability to read back Q32 txt files.</li>\n</ul>\n</blockquote>\n<p>2009-05-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Support Linux style silent build rules.</li>\n</ul>\n</blockquote>\n<p>2009-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Updated to Automake 1.11.</li>\n</ul>\n</blockquote>\n<p>2009-05-17  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c First attempt to read back txt file.\nIt is amazingly ineffective, but it seems to work.</li>\n</ul>\n</blockquote>\n<p>2009-05-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (HorizontalFilter, VerticalFilter): When\nresizing a non-opaque image, attenuate the influence of\nsurrounding colors based on their degree of transparency in order\nto avoid &quot;halos&quot; around objects caused by colors which are\ntransparent and therefore not part of the visible image.  Patch\ncontributed by Pavel Merdin via SourceForge Tracker #2792322.\n(VerticalFilter, VerticalFilter): Additional clean-up and\noptimizations.</li>\n</ul>\n</blockquote>\n<p>2009-05-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): Added a -recolor command option\nto provide access to ColorMatrixImage().</li>\n<li>magick/fx.c (ColorMatrixImage): New function to apply a color\nmatrix similar to Adobe Flash Flash.filters.colorMatrixFilter(),\nand Windows GDI+ ColorMatrix class, (order up to 5x5) to the image\npixels.</li>\n</ul>\n</blockquote>\n<p>2009-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/perl.rst: Add missing PerlMagick debug event types.</li>\n<li>coders/pcl.c: Major improvements from John Sergeant.  These\ninclude: 1) Fixed 2 bit output where Max=BLACK - this always\nproduced negative images even when -negate was passed as a\nparameter. The code now uses a two element palette to handle this\nsituation.  2) Added support for 8 bit pseudoclass images.  3)\nChanged the coder to allow adjoin, placing each sub-image on a new\npage.  4) Added support for compression. Any compression other\nthan &quot;None&quot; will cause the coder to to try to calculate and pick\nthe best out of the PCL set of RLE, Tiff RLE or delta compression\non a per row basis, as well as handling repeated rows and zero\nrows intelligently.</li>\n</ul>\n</blockquote>\n<p>2009-05-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/Makefile.am (MAGICKPROGRAMS): Add a <cite>compare</cite>\nImageMagick compatibility link.</li>\n<li>INSTALL-unix.txt: Apply patch regarding GnuWin32 from John Wye,\nSourceForge #2779009.</li>\n</ul>\n</blockquote>\n<p>2009-05-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Add the LDFLAGS option -Wl,-zlazyload when using\nthe Solaris linker.</li>\n</ul>\n</blockquote>\n<p>2009-05-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/url.c (ReadURLImage): Fix typos.</li>\n</ul>\n</blockquote>\n<p>2009-05-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (SystemCommand): Added access confirmation\nchecks for external commands.</li>\n<li>magick/unix_port.c (MagickSpawnVP): Added access confirmation\nchecks for external commands.</li>\n<li>coders/url.c (ReadURLImage): Added access confirmation checks\nfor URLs.</li>\n<li>magick/blob.c: Added access confirmation checks for files.</li>\n<li>magick/confirm_access.c (MagickConfirmAccess): Added an access\nconfirmation facility to allow the API user to monitor and/or\nblock access to files and URLs.  This allows the API user to\nimplement a security policy based on actual accesses.</li>\n</ul>\n</blockquote>\n<p>2009-05-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png: Updated libpng to 1.2.35.</li>\n<li>lcms: Updated lcms to 1.18a.</li>\n</ul>\n</blockquote>\n<p>2009-05-01  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage and WriteOneJNGImage): Changed\ninternal attribute png_bit_depth to png:bit-depth-written to avoid\nconfusion with planned new public png:bit-depth attribute.</li>\n</ul>\n</blockquote>\n<p>2009-04-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImages): Deal slightly better with the\ncase when MogrifyImage() expands one image into several.  Still\ndon't know of a sane way to deal with -crop WIDTHxHEIGHT.</li>\n<li>magick/transform.c (TransformImage): Image which is updated may\nbe a list so account for that.</li>\n<li>configure.ac: Add a test for the <cite>restrict</cite> keyword so that\neventually we can use it.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Tidy JPEG reader by moving JPEG\nproperties analysis code into subroutines.</li>\n</ul>\n</blockquote>\n<p>2009-04-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/display.imdoc: Fix documentation for crop and chop keyboard\naccelerators.  Fixes SourceForge bug #2593388 &quot;error in the\ndocumentation/Keyboard accelarators&quot;.</li>\n</ul>\n</blockquote>\n<p>2009-04-20  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Cosmetic-only, change <cite>True</cite> to <cite>MagickTrue</cite> or\n<cite>MagickPass</cite> and <cite>False</cite> to <cite>MagickFalse</cite> or <cite>MagickFail</cite>.</li>\n</ul>\n</blockquote>\n<p>2009-04-20  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Check error return from CompressColormapTransFirst()</li>\n</ul>\n</blockquote>\n<p>2009-04-20  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Refrain from modifying image struct members\n(matte, colors, depth) while writing a PNG.</li>\n</ul>\n</blockquote>\n<p>2009-04-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Document the direction of rotation.</li>\n</ul>\n</blockquote>\n<p>2009-04-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (LogMagickEventList): Use MagickPackageName from\nversion.h rather than hard-coding <cite>GraphicsMagick</cite>.</li>\n</ul>\n</blockquote>\n<p>2009-04-18  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: Fixed a warning about <cite>shadowed</cite> variables.</li>\n</ul>\n</blockquote>\n<p>2009-04-17  Glenn Randers-Pehrson &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Fixed some warnings about <cite>shadowed</cite> variables.</li>\n</ul>\n</blockquote>\n<p>2009-04-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Add tests for some reentrant versions of functions\nwhere we are still using the non-rentrant versions.</li>\n<li>magick/composite.c (CompositeImage): Fix problem with\ncompositing images where the change image overlaps off the left\nside of the canvas.  Should fix SourceForge issue #2766200 <cite>memory\nallocation error when compositing small images</cite>.</li>\n</ul>\n</blockquote>\n<p>2009-04-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/semaphore.c: Re-arrange ifdefs so that it is possible to\nuse pthreads under the WIN32 API.</li>\n</ul>\n</blockquote>\n<p>2009-04-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/bit_stream.c: Bitstream functions were often not inlining\nand inline functions which don't inline are not much use.\nBitstream functions are now normal library functions.</li>\n</ul>\n</blockquote>\n<p>2009-03-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/bin/delegates.mgk: Remove bounding box option (-g) from\nPostscript delegate specifications.</li>\n<li>config/delegates.mgk.in: Remove bounding box option (-g) from\nPostscript delegate specifications.</li>\n<li>coders/{ept.c, pdf.c, ps.c} : PDF bounding box is sometimes\nincorrect or not globally applicable so don't specify bounding box\nwhen reading PDF files.  Postscript files do need the bounding box\nso make sure that it is still supplied.  Resolves SF tracker issue\n2487651 <cite>convert from pdf chops off rhs</cite>.</li>\n</ul>\n</blockquote>\n<p>2009-03-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Magick++/Image.rst: Translate Image.html to reStructuredText\nformat for easier maintenance.</li>\n</ul>\n</blockquote>\n<p>2009-03-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/rgb.c: Compute the quantum type rather than using a\nrecurring conditional statement.  It turns out that the -endian\noption is working as it should.</li>\n</ul>\n</blockquote>\n<p>2009-03-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/{gray.c, rgb.c, cymk.c}: Work toward supporting the\n-endian option.  Not working properly yet.</li>\n<li>magick/enum_strings.c (EndianTypeToString): New function.\n(InterlaceTypeToString): New function.</li>\n</ul>\n</blockquote>\n<p>2009-03-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/drawing_wand.c: Stripped out unused code.</li>\n<li>www/wand: Added formatted Wand API documentation.</li>\n<li>scripts/format_c_api_doc.py: Now supports --include-rst option.</li>\n</ul>\n</blockquote>\n<p>2009-03-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (GetImageBoundingBox): If we fail to find a\nsmaller bounding box, then the returned bounding box is the entire\nimage.</li>\n</ul>\n</blockquote>\n<p>2009-02-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/magick/magick_config.h.in: Provide configuration\naccess to the DisableSlowOpenMP define.</li>\n<li>PerlMagick/t/read.t: Add a test for HRZ Slow scan TV.</li>\n<li>magick/pixel_cache.c (ModifyCache): Set image <cite>taint</cite> flag and\nclear monochrome and grayscale flags when pixels are accessed\nread/write rather than at sync.</li>\n<li>coders/Makefile.am (MAGICK_CODER_SRCS): Add coders/hrz.c to\nbuild.</li>\n</ul>\n</blockquote>\n<p>2009-01-27  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/hrz.c: New HRZ reader for slow scan TV.</li>\n</ul>\n</blockquote>\n<p>2009-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (ResizeImage): Make error handling more robust.</li>\n<li>magick/pixel_cache.c (SetNexus): Return a run-time error to\ninvoking code rather than exiting the program if the pixel staging\nbuffer fails to be allocated.</li>\n</ul>\n</blockquote>\n<p>2009-02-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Allow the user to force the\nreturned image to be TrueColor type for min-is-white and\nmin-is-black TIFF files.  Previous to this, bilevel TIFF files\nwere always returned as PseudoClass.</li>\n</ul>\n</blockquote>\n<p>2009-01-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c, coders/pnm.c: Fix several race conditions\nreported by Julian Seward.\n(OpenCache): Restore conservative pre-allocation of pixel indexes\nsince a glitch was encountered that needs to be resolved.</li>\n<li>magick/{channel.c,compare.c,constitute.c,decorate.c,effect.c,fx.c,\nimage.c,operator.c,pixel_iterator.c,render.c,resize.c,segment.c,\nshear.c,transform.c}: Use explicit OpenMP critical sections to\navoid possible cross-contention.</li>\n<li>coders/{dpx.c, pnm.c} Use explicit OpenMP critical sections to\navoid possible cross-contention.</li>\n</ul>\n</blockquote>\n<p>2009-01-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (OpenCache): Remove conservative\npre-allocation of pixel indexes.</li>\n</ul>\n</blockquote>\n<p>2009-01-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/index.rst: Reduce the amount of text on the front page.</li>\n</ul>\n</blockquote>\n<p>2009-01-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick.spec.in: The module .la files need to be\ninstalled as part of the base install or else the modules will\nfail to load.</li>\n</ul>\n</blockquote>\n<p>2009-01-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c (ReadDIBImage): Fix assertion thrown for DIB files\nwith negative image height values.</li>\n</ul>\n</blockquote>\n<p>2009-01-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Fix assertion thrown for BMP files\nwith negative image height values.  Resolves SF issue 2523536 <cite>bug\nin bmp coder</cite>.</li>\n<li>Makefile.am: Don't install Magick++ headers if Magick++ is\ndisabled.</li>\n<li>GraphicsMagick.spec.in: --enable-lzw option is no longer used.</li>\n</ul>\n</blockquote>\n<p>2009-01-17  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c: More robust fits parsing.</li>\n</ul>\n</blockquote>\n<p>2009-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated news.</li>\n</ul>\n</blockquote>\n<p>2009-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colorspace.c (XYZTransformPackets): Fix arithmetic\noverflow problem noticed for Q32 build when using GCC on\nbig-endian systems.</li>\n<li>magick/constitute.c: Update Richard Nolde's float 16 and 24\nfunctions.</li>\n<li>magick/command.c (VersionCommand): Print some build information\nfor MSVC builds.</li>\n</ul>\n</blockquote>\n<p>2009-01-10  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c: Ability to skip unsupported multidimensional object.</li>\n</ul>\n</blockquote>\n<p>2009-01-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (GetBlobSize): It seems that under Windows, the\nzip stream is not usable as a file handle.  Switch back to using\nstat instead, but use _stati64 if available.</li>\n</ul>\n</blockquote>\n<p>2009-01-04  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c: Fixed bug in scene count in extension block.</li>\n<li>coders/fits.c: Supported logging.</li>\n</ul>\n</blockquote>\n<p>2009-01-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Produce sprintf scaling strings for\nplatform-specific types.</li>\n<li>magick/magick_types.h.in: Include sprintf scaling strings for\nplatform-specific types.</li>\n<li>magick/constitute.c (WriteImage): If output stream is not\nseekable and coder needs to use seek, then divert output to\ntemporary file, and then send file to stream.</li>\n<li>magick/blob.c (GetBlobSize): Simplify implementation.\n(OpenBlob): Don't attempt to test header magic on file we are\nwriting.  Silly benign bug in obtuse code.</li>\n<li>coders/tiff.c (ReadTIFFImage,WriteTIFFImage): Strip out use of\ntemporary file.  Use TIFFClientOpen() for writing.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2010.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2010.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2011-01-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickDescribeImage): Was sending\ndescriptive output to stdout rather than returning it in an\nallocated string as intended.</li>\n</ul>\n</blockquote>\n<p>2011-01-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/draw.c, wand/drawing_wand.c (MvgPrintf): Update to handle\nC99 vsnprintf() return values.</li>\n<li>magick/draw.c, wand/drawing_wand.c (DrawAnnotation): Linux\nglibc does not pass extended text characters if &quot;%.1024s&quot;\nformatting convention is used.  Apparently it assumes that such\ncharacters may be UTF8 and returns -1 rather than outputting the\nstring, even if it is assured to fit.</li>\n</ul>\n</blockquote>\n<p>2010-12-30 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Matlab file level clarification.</li>\n</ul>\n</blockquote>\n<p>2010-12-27 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mac.c New MacPaint image format reader added.</li>\n</ul>\n</blockquote>\n<p>2010-12-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Default to using a LZMAPRESET\nvalue of 1 based on testing which observed minimal benefit, and\nsubstantially more cost, from larger values.  Value may be\nspecified by the user using command line syntax like <cite>-define\ntiff:lzmapreset=7</cite> for purposes of further experimentation.  Also\nadjusted default strip memory values for each preset level.</li>\n</ul>\n</blockquote>\n<p>2010-12-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Add LZMA support to PerlMagick.</li>\n<li>coders/tiff.c (WriteTIFFImage): Add TIFF LZMA compressor support.</li>\n</ul>\n</blockquote>\n<p>2010-12-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImages): Should send -verbose output to\nstderr rather than stdout since otherwise usage in pipelines may\nbe broken.  Resolves SourceForge issue 3131790 &quot;AVS -verbose\nprints to stdout&quot;.</li>\n</ul>\n</blockquote>\n<p>2010-11-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>libtool: Upgrade to libtool 2.4.</li>\n<li>coders/pnm.c (ReadPNMImage): Start work on reading NetPBM PAM\nformat.  Parses PAM header but pixels are not returned yet.</li>\n<li>magick/magic.c (StaticMagic): Be more specific when identifying\nPNM subformats.  Return the specific subformat name PBM, PGM, or\nPPM rather than PNM.  XV P7 format is now identified as &quot;P7 332&quot;.\nAdd detection of NetPBM PAM format.</li>\n</ul>\n</blockquote>\n<p>2010-11-04  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c: Added 5x5, 6x6, and 7x7 circular ordered dither\npatterns to create a halftone effect.</li>\n</ul>\n</blockquote>\n<p>2010-09-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Document pcl:fit-to-page define.</li>\n<li>coders/pcl.c: Fix issue with printing a bi-level image on\nKonica-Minolta printers.  Define pcl:fit-to-page in order for the\nprinter to scale the image to fit the page.  Patch by John\nSergeant.</li>\n</ul>\n</blockquote>\n<p>2010-09-19  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: removed an apparently harmless extra invocation\nof ScaleShortToQuantum() due to cut-and-paste error in the\nupdate of 2010-06-02.  Also added a line to explicitly set\nthe opacity of the background_color to OpaqueOpacity.</li>\n</ul>\n</blockquote>\n<p>2010-09-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (ReadPDFImage): Enable use of PDF crop box via\n-define pdf:use-cropbox=true. Patch contributed by Chris Gilling.\nSourceForge patch ID 3063794, &quot;Add support for using crop box for\npdf import&quot;.</li>\n</ul>\n</blockquote>\n<p>2010-09-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Image.cpp (backgroundColor, borderColor, matteColor):\nOpacity part of user-specified color needs to be preserved.\nProblem was reported by Alexander Zheltov.</li>\n</ul>\n</blockquote>\n<p>2010-09-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Applied Automake 1.11.1 patch by Ralf Wildenhues\nwhich is necessary for the test suite to pass under Windows/MinGW\ndue to command line length limits.</li>\n</ul>\n</blockquote>\n<p>2010-09-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/draw.c, wand/drawing_wand.c: Pass full user-provided\ndouble precision resolution to renderer.  Truncating the\nresolution causes problems in some cases.  Resolves SourceForge\nbug 3058387 &quot;Incorrect Copy Compositing through C interface&quot;.</li>\n</ul>\n</blockquote>\n<p>2010-09-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (StringToList): Fix performance problem caused\nby using strlcpy.</li>\n<li>coders/pnm.c (ReadPNMImage): Q8 build should be able to read\n16-bit PGM images.</li>\n</ul>\n</blockquote>\n<p>2010-09-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MontageImageCommand): Fix memory leak of\nMontageInfo structure allocation in error handling path.</li>\n<li>magick/montage.c (MontageImages): Fix crash observed with\n&quot;-geometry x+0+0&quot;.  Problem reported by Simon Rainer.</li>\n</ul>\n</blockquote>\n<p>2010-08-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Update to Automake 1.11.1.</li>\n</ul>\n</blockquote>\n<p>2010-08-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Use AC_USE_SYSTEM_EXTENSIONS to enable system API\nextensions.</li>\n</ul>\n</blockquote>\n<p>2010-08-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (ModifyCache): Fix deadlock in\nClonePixelCache() which was caused by using the same semaphore\npointer in the source and destination images.  Problem was\nreported by Stefan Schramowski.</li>\n</ul>\n</blockquote>\n<p>2010-08-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/info.c (WriteINFOImage): Added an <cite>INFO</cite> coder which\nproduces textual image description output similar to <cite>identify</cite>\nbut may be used with convert like &quot;gm convert myfile info:-&quot;.\nFeature suggested by Stefan Schramowski.</li>\n</ul>\n</blockquote>\n<p>2010-08-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/Makefile.am (TESTS_PS_XFAIL_TESTS): Expect EPT tests to\nfail if Ghostscript is missing.</li>\n<li>configure.ac: Updated to Autoconf 2.67.</li>\n<li>magick/render.c (DrawImage): Use StringToGravityType() to parse\ngravity values.</li>\n</ul>\n</blockquote>\n<p>2010-07-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Document histogram-threshold setting.</li>\n<li>magick/enhance.c (NormalizeImage): Add support for\nhistogram-threshold setting to specify the percentage of the\nhistogram to discard when computing image normalization parameters\n(default is 0.1%).  For example <cite>-set histogram-threshold 0.01\n-normalize</cite>.</li>\n<li>www/api/types.rst: Update Image structure member documentation.</li>\n</ul>\n</blockquote>\n<p>2010-07-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Add a test for posix_spawnp().  Results may be\nused in later development.</li>\n</ul>\n</blockquote>\n<p>2010-07-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/Makefile.am (TESTS_PS_XFAIL_TESTS): PDF tests are expected\nto fail if Ghostscript is not available.</li>\n<li>magick/utility.c (MagickStrlCat, MagickStrlCpy): Add handling\nfor the case where size is zero in order to be conformant with the\nstrlcat() and strlcpy() formal descriptions.  GraphicsMagick does\nits best to never pass a size of zero so an assertion that size is\nnot zero remains in order to help catch bugs in GraphicsMagick.\nIssue was reported by Albert Cahalan.</li>\n</ul>\n</blockquote>\n<p>2010-07-10  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Always scale tRNS color to 16-bit short.  Otherwise,\ntransparency was sometimes lost while reading PNG files whose depth\nis different from the Quantum depth.</li>\n</ul>\n</blockquote>\n<p>2010-07-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (LOG_TIFF_BLOB_IO): Define LOG_TIFF_BLOB_IO=1 when\nbuilding GraphicsMagick in order to enable verbose logging from\nthe TIFFClientOpen() registered callbacks when <cite>coder</cite> logging is\nenabled.</li>\n</ul>\n</blockquote>\n<p>2010-06-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwfile.c: Deal with formats which don't have an extension\nby prepending the magic specifier to the file name specification.</li>\n<li>coders/mpr.c (RegisterMPRImage): MPR and MPRI are not useful\nfile extensions.</li>\n<li>magick/command.c (CommandAccessMonitor): If the environment\nvariable MAGICK_ACCESS_MONITOR is set to TRUE then also log\ninvocations of the access monitor callback when -monitor is\nspecified.  This feature is intended to assist with understanding\nwhen the access monitor is invoked, and the arguments which are\npassed.</li>\n<li>magick/blob.c (OpenBlob): Throw an exception on error rather\nthan depending on the invoking code to do so.  Resolves\nSourceForge bug #3023437 &quot;Magick::Image::ping() does not throw\nexception in all cases&quot;.</li>\n</ul>\n</blockquote>\n<p>2010-06-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): The -colors, -map, and\n-monochrome options now take effect immediately rather than at the\nend of all other processing.  This is is more intuitive and\nreasonable but may impact the output of scripts which place these\noptions prior to additional image processing operations.</li>\n</ul>\n</blockquote>\n<p>2010-06-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (BlobToImage): If a temporary file must be used\nand the user has specified magic, then preserve the magic\nspecifier when reading the temporary file.</li>\n<li>coders/mat.c (RegisterMATImage): More accurately describe MATLAB\nformat support as &quot;MATLAB Level 5&quot;.</li>\n<li>magick/magic.c (StaticMagic): Automatically detect MATLAB Level\n5 format based on file header.</li>\n<li>PerlMagick/PerlMagickCheck.sh.in: Run PerlMagick tests in\nverbose mode so that all test output appears in &quot;test-suite.log&quot;\nif there is a failure.</li>\n<li>coders/Makefile.am (coders_mat_la_LIBADD): MAT coder is\noptionally dependent on zlib so zlib should be listed as a\ndependency.</li>\n<li>magick/blob.c (BlobToFile): MAGICK_IO_FSYNC=TRUE in the\nenvironment should cause file data to be explicitly synchronized\nprior to close.</li>\n</ul>\n</blockquote>\n<p>2010-06-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/inc/files-documentation.isx: There are\nnot currently any JPEG files in the www/images directory to\ndistribute.</li>\n</ul>\n</blockquote>\n<p>2010-06-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ltdl/config/ltmain.sh: Update libtool to 2.2.10.</li>\n<li>magick/profile.c: Support lcms 2.0.</li>\n<li>configure.ac: Add support for configuring for lcms 2.0,\ncontrolled via a new --without-lcms2 option.  By default lcms v2\nis used if it is available, otherwise v1.1X is used if it is\navailable.</li>\n</ul>\n</blockquote>\n<p>2010-06-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ltdl/config/ltmain.sh: Update libtool to 2.2.8.</li>\n</ul>\n</blockquote>\n<p>2010-06-02  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c correctly scale bKGD chunk data in Q16 build</li>\n</ul>\n</blockquote>\n<p>2010-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Magick++/Image.rst: Fix documentation error which wrongly\nrecommended multiplication by size of PixelPacket.  Correction by\nRoel Baardman.</li>\n</ul>\n</blockquote>\n<p>2010-05-23 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c (ReadTXTImage): Ability to read multiple images.</li>\n</ul>\n</blockquote>\n<p>2010-05-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (DispatchImage): <cite>K</cite> channel was always\noutput as black for &quot;CMYK&quot; specification unless image matte flag\nwas True.  Bug report and proposed solution by Lance Brown.</li>\n</ul>\n</blockquote>\n<p>2010-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c (ShearImage): When one of the shear angles was\nspecified as zero, the shear request was ignored entirely.  An\nsimple optimization was using || rather than &amp;&amp; to test the\nangles.  Resolves SourceForge issue #2991685 &quot;Shear command does\nnot handle zero angles correctly&quot;.</li>\n</ul>\n</blockquote>\n<p>2010-05-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (InitializeMagick, DestroyMagick):\nInitializeMagick and DestroyMagick should be fully thread safe.</li>\n</ul>\n</blockquote>\n<p>2010-05-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (ReadGIFImage): Set the opacity value of the opaque\ncolor to transparent.  Patch by Tim Baker.</li>\n<li>magick/image.c (SetImageColor): New function which is similar to\nSetImage() but which accepts the pixel color as a parameter rather\nthan using the image background color.  Patch by Tim Baker.</li>\n<li>magick/transform.c (CoalesceImages): When applying background\ndisposal, fill the image with the transparent color, if one\nexists.  Patch by Tim Baker.  Resolves SourceForge patch ID\n2989472.</li>\n</ul>\n</blockquote>\n<p>2010-05-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c (ReadTXTImage): Matte channel was not being enabled\nfor non-opaque images.\n(ReadTXTImage): Opacity values need to be inverted prior to\ningestion.</li>\n</ul>\n</blockquote>\n<p>2010-04-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Documentation for -flatten and -mosaic has\nbeen improved.</li>\n<li>magick/transform.c (MosaicImages): The -mosaic command now\nrespects the composition option specified by -compose as well as\nthe image background color specified by -background.</li>\n</ul>\n</blockquote>\n<p>2010-04-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/*.c, magick/*.c: Eliminate many benign data race\nconditions.</li>\n</ul>\n</blockquote>\n<p>2010-04-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick.spec.in: Avoid duplicate copies of documentation\nfiles.  Put documentation into a versioned directory as used by\nRed Hat and CentOS.  Include archive libraries in developer\npackage.</li>\n<li>PerlMagick/Makefile.PL.in: Include support for DESTDIR so that\nRPM builds find the installed GraphicsMagick library.</li>\n</ul>\n</blockquote>\n<p>2010-04-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Under Solaris, make sure that OpenWindows Type1\nfonts do exist before deciding to use them.  OpenSolaris does not\nprovide these fonts.</li>\n</ul>\n</blockquote>\n<p>2010-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick.spec.in: Fix RPM build.  PerlMagick was not being\nbuilt due to Makefile changes.  Resolves SourceForge issue\n#2952696 &quot;RPM build broken: (Perl) file not found by glob&quot;.</li>\n<li>magick/quantize.c (ReduceImageColors): Progress message should\ninclude the image file name.</li>\n</ul>\n</blockquote>\n<p>2010-03-24  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Revised coders/jpeg.c to preserve the Exif profile.</li>\n</ul>\n</blockquote>\n<p>2010-03-24  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Eliminated some of the deprecated\ndirect access to ping_info-&gt;members.\nEliminated support of very old libpng versions (1.0.11 and earlier).</li>\n</ul>\n</blockquote>\n<p>2010-03-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/delegate.c (GetPostscriptDelegateInfo): Add support for\ninvoking &quot;gs-cmyk&quot; and &quot;gs-cmyka&quot; entries in delegates.mgk when\nColorSeparationType or ColorSeparationMatteType is requested.\nRequisite entries in delegates.mgk are left for the user to add.</li>\n</ul>\n</blockquote>\n<p>2010-03-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (InitializeMagick): Don't initialize locale\nsettings in InitializeMagick().  Resolves SourceForge bug #2967282\n&quot;setlocale called by GraphicsMagick&quot;.</li>\n</ul>\n</blockquote>\n<p>2010-03-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/{command.c, display.c}: Make sure that <cite>animate</cite>,\n<cite>display</cite>, and <cite>identify</cite> report any error only once, and then\nproceed to the next file name rather than quitting.  Problem was\nreported by Patrick Welche.</li>\n</ul>\n</blockquote>\n<p>2010-03-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Released GraphicsMagick 1.3.12.</li>\n</ul>\n</blockquote>\n<p>2010-03-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Makefile.am: Update PerlMagick/Magick.pm in the\nsource tree (as required) since it is distributed source and\ncontains the current version number.</li>\n</ul>\n</blockquote>\n<p>2010-03-03  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>coders/png.c: restored missing &quot;US&quot; in PNG_USER_CHUNK_CACHE_MAX</dt>\n<dd>at line 102.  Added some (unsigned long) typecasts on print statements\nto stifle warnings.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2010-03-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png: Updated libpng to 1.2.43.  Resolves CVE-2010-0205 as\npertains to GraphicsMagick Windows build.</li>\n</ul>\n</blockquote>\n<p>2010-03-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwfile_DCX_*.sh: Add tests for reading and writing DCX.</li>\n<li>coders/pcx.c (WritePCXImage): DCX is not the same as PCX so only\nwrite DCX when requested to (and vice-versa).</li>\n<li>utilities/tests/convert-pipe-out.sh: New test to verify that\n<cite>convert</cite> can write to stdout.</li>\n<li>utilities/tests/convert-pipe-in.sh: New test to verify that\n<cite>convert</cite> can read from stdin.</li>\n<li>utilities/tests/convert-pipe-filter.sh: New test to verify that\n<cite>convert</cite> works properly as a filter.</li>\n<li>magick/image.c (SetImageInfo): The <cite>rectify</cite> parameter was found\nto not be sufficient to meet requirements since it was\noverloaded. The utilities would malfunction (hang or throw an\nexception) if requested to write to stdout.  As a result, this\nparameter has been changed to a binary flag type parameter.\nExisting True/False values are mapped to equivalents using the new\nbinary flag.  This is intended to resolve Debian bug 571719\n&quot;graphicsmagick: &quot;convert&quot; command is broken&quot;, reported by\nVladimir Stavrinov.</li>\n</ul>\n</blockquote>\n<p>2010-02-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Released GraphicsMagick 1.3.11.</li>\n</ul>\n</blockquote>\n<p>2010-02-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c (GetCompositionPixelIteratorCallback):\nOverCompositeOp and AtopCompositeOp may be replaced with\nCopyCompositeOp in the case where neither image has a matte\nchannel.</li>\n<li>magick/command.c (ConvertImageCommand, MogrifyImageCommand):\nAdded -extent option to apply a background color canvas behind the\nimage. Added -compose option to allow specifying the composition\noperator to use.</li>\n<li>magick/transform.c (ExtentImage): New function apply a\nbackground color canvas behind the image.</li>\n</ul>\n</blockquote>\n<p>2010-02-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Added a -thumbnail command to all of the GM\nsub-commands which currently support -resize.  This is a resize\nmethod optimized for speed when reducing the size of the image\n(such as when creating thumbnails).</li>\n</ul>\n</blockquote>\n<p>2010-02-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (LocaleCompare, LocaleNCompare): Fix array\nindex underflow which occurs if the char type is signed and the\ncharacter value is in the extended range.  Problem reported by\nArseny Solokha.  Resolves SourceForge patch #2953314.</li>\n</ul>\n</blockquote>\n<p>2010-02-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Released GraphicsMagick 1.3.10.</li>\n</ul>\n</blockquote>\n<p>2010-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/demo/demo.cpp (main): Split demo output frames into\nindividual files to enable easier viewing.</li>\n</ul>\n</blockquote>\n<p>2010-02-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/GraphicsMagick.imdoc: Improve usage synopsis for\n<cite>convert</cite>. SourceForge feature request 2845965 &quot;confusing\ndocumentation&quot;.</li>\n<li>magick/display.c (MagickXDisplayImage): Image number was\nincorrect in window title.</li>\n<li>magick/render.c (DrawImage): Path points data allocation was\nmuch larger than it needed to be.  Patch by Vladimir Lukianov.\nResolves SourceForge issue 2947851 &quot;Memory allocation error on\nvector graphics (or mem bomb)&quot;.</li>\n<li>magick/constitute.c (WriteImages): +adjoin was not working\ncorrectly for the case when only one image frame is present.  With\n+adjoin and writing one frame to &quot;foo%d.jpg&quot; it was outputting\n&quot;foo%d.jpg&quot; rather than &quot;foo0.jpg&quot;.  Problem reported by Frans\nCoetzee.</li>\n</ul>\n</blockquote>\n<p>2010-02-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Released GraphicsMagick 1.3.9.</li>\n</ul>\n</blockquote>\n<p>2010-02-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/imdoc2man: Bare single quotes at the beginning of a line\nneed to be escaped in order to make roff happy.  Problem reported\nby Daniel Kobras.</li>\n<li>magick/command.c (ImportImageCommand): Don't assign a pointer to\nstatic constant data into an array which uses heap allocated data.\nAvoids a &quot;double free&quot; error when using gm import -frame.  Patch\nby Daniel Kobras.</li>\n<li>magick/color_lookup.c (QueryColorname): XPM does not support\nRGBA color syntax, but it does support RGB.  Patch by Daniel\nKobras.</li>\n<li>magick/blob.c (OpenBlob): Only form multi-part filename when\nrequired.</li>\n<li>magick/display.c (MagickXDisplayImage): The display <cite>-update</cite>\noption was only working in conjunction with the <cite>-delay</cite> option\nwith a delay setting of 2 or greater.  Problem reported by Sami\nLiedes.  Patch by Vincent MAUGE.  Resolves Debian bug ID 414779.</li>\n</ul>\n</blockquote>\n<p>2010-02-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (OpenBlob): Only apply scene substitution to\nthe filename if adjoin is false.</li>\n<li>magick/constitute.c (WriteImage): If adjoin is true, then\nrestore original filename specification since opening the blob\nmodifies it.  Resolves Debian bug ID 552998.</li>\n<li>magick/image.c (SetImageInfo): Don't check filename for scene\nsubstitution if adjoin is intentionally false.  This allows saving\nto file names which look like they contain a scene substitution\npattern.</li>\n<li>magick/command.c (MogrifyImage): Convolution failure results in\na crash rather than an error report.  Resolves Debian bug ID\n539251.</li>\n<li>magick/deprecate.c: The string constants LoadImageText,\nSaveImageText, LoadImagesText, and SaveImagesText should have been\ndeprecated, rather than being entirely removed.</li>\n</ul>\n</blockquote>\n<p>2010-01-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Makefile.am (install-data-html): Make sure that only the\nnecessary documentation files are installed.</li>\n</ul>\n</blockquote>\n<p>2010-01-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/inc/body.isx: Strip out executable\ncomponents which depend on proprietary MFC and ATL libraries.\nThis means that &quot;gmdisplay.exe&quot; and &quot;ImageMagickObject&quot; are no\nlonger distributed or installed via the Windows setup installer.\nWhen a new display application is developed based on open source\nlibraries, then the display functionality and associations can be\nrestored.</li>\n</ul>\n</blockquote>\n<p>2010-01-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/transform.c (FlattenImages): Apply the image background\ncolor under the initial canvas image if it is non-opaque.</li>\n<li>magick/composite.c (MagickCompositeImageUnderColor): New private\nfunction to apply a color underneath a non-opaque image.</li>\n</ul>\n</blockquote>\n<p>2010-01-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/prefetch.h: New header to provide wrapper macros for\ncompiler-specific explicit prefetch APIs.</li>\n<li>magick/effect.c (BlurImageScanlines): Solid color images which\nonly differed in the matte channel were not being blurred.</li>\n<li>magick/color.h (NotPixelMatch,PixelMatch): New macros to\nfully-compare a pixel, including matte.</li>\n<li>magick/resource.c (SetMagickResourceLimit): Invoke\nomp_set_num_threads() to set thread limit if ThreadsResource is\nrequested.</li>\n<li>magick/pixel_cache.c (AllocateThreadViewSet): The number of\ncache views to allocate needs to be obtained from\nomp_get_max_threads().  Otherwise there is a crash if the number\nof threads is reduced from the original value.</li>\n</ul>\n</blockquote>\n<p>2010-01-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Released GraphicsMagick 1.3.8.</li>\n<li>NEWS.txt: Update for the 1.3.8 release.</li>\n</ul>\n</blockquote>\n<p>2010-01-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/benchmarks.rst: Update benchmark report to compare\nperformance with ImageMagick 6.5.8-10.</li>\n</ul>\n</blockquote>\n<p>2010-01-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c (RotateImage, ShearImage): Ensure that errors\npropagate up to the API user.  Don't overwrite a detailed\nexception message with a generic one.  Don't return a bogus image\nif there is an error.</li>\n</ul>\n</blockquote>\n<p>2010-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/inc/files-base.isx: Third party\nexecutables not included in the Visual Studio build are no longer\nbundled in the GraphicsMagick installer.  This means that\nhp2xx.exe, mpeg2dec.exe, and mpeg2enc.exe are no longer\ndistributed.</li>\n<li>www/Magick++/Image.rst: Emphasize that InitializeMagick() MUST\nbe invoked, and make sure that all of the examples show use of it.</li>\n</ul>\n</blockquote>\n<p>2010-01-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/delegate.c (InvokeDelegate): Use MagickSpawnVP() under\nWindows as well.\n(InvokePostscriptDelegate): Use MagickSpawnVP() under Windows as\nwell.</li>\n<li>magick/utility.c (MagickSpawnVP): Moved from unix_port.c.\nUpdated implementation to use spawnvp() rather than fork()/exec()\nunder Windows.</li>\n<li>configure.ac: Add check for Windows spawnvp function.\nAdd check for process.h.</li>\n<li>magick/semaphore.c (DestroySemaphore): POSIX mutex statically\ninitialized via PTHREAD_MUTEX_INITIALIZER should not be destroyed.</li>\n<li>configure.ac: DisableSlowOpenMP is now the default.  Use\n--enable-openmp-slow to enable OpenMP for algorithms which\nsometimes run slower rather than faster.</li>\n</ul>\n</blockquote>\n<p>2010-01-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/version.h.in: Added MagickLibInterfaceNewest and\nMagickLibInterfaceOldest preprocessor defines so that applications\nmay easily test for library versions while compiling.</li>\n</ul>\n</blockquote>\n<p>2010-01-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawPolygonPrimitive): Use restrict keyword.</li>\n<li>magick/pixel_iterator.c: Use restrict keyword.</li>\n<li>utilities/Makefile.am: Modules are supported in the shared\nlibrary built so list-module.sh test should be expected to pass.</li>\n<li>configure.ac: Add WITH_SHARED_LIBS conditional.</li>\n</ul>\n</blockquote>\n<p>2010-01-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/version.h.in: Update copyright years.</li>\n<li>magick/semaphore.c: The return code from all pthread mutex APIs\nare now checked (not just initialize and destroy), and any error\nresults in an immediate fatal exit.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2011.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2011.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2011-12-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (AcquireCacheNexus):\nMirrorVirtualPixelMethod was broken.</li>\n</ul>\n</blockquote>\n<p>2011-12-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Improve configuration support for Open64 Compiler\nSuite: Version 4.2.5.2 compiler with OpenMP.</li>\n<li>coders/tga.c (ReadTGAImage): Assume that 32-bit TGA files have\nan alpha channel, even if they are not marked as such.  Fixes\nSourceForge issue 3466908 &quot;TGA with alpha&quot;.</li>\n<li>configure.ac: Revert changeset eaa27346d8e9 which tried to avoid\nthe OpenMP library being included multiple times because in some\ncases it is not included at all.</li>\n</ul>\n</blockquote>\n<p>2011-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (VersionCommand): For MSVC builds, report if\nSSE or SSE2 was used in the build.</li>\n<li>Release GraphicsMagick 1.3.13.</li>\n<li>Update libtiff to release 4.0.0</li>\n</ul>\n</blockquote>\n<p>2011-12-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Update libpng to release 1.5.7</li>\n</ul>\n</blockquote>\n<p>2011-12-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Update lcms2 to release 2.3</li>\n</ul>\n</blockquote>\n<p>2011-12-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Update Automake used to 1.11.2.</li>\n</ul>\n</blockquote>\n<p>2011-12-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/OpenMP.rst: Updated with new results, including 12-core\nIntel Xeon E5649 and 16-core AMD Opteron 6220 &quot;Bulldozer&quot; CPUs.</li>\n<li>magick/studio.h: Enable building and running correctly with\nOpen64 Compiler Suite: Version 4.2.5.2 compiler with OpenMP.</li>\n<li>magick/command.c (BenchmarkImageCommand): Add -rawcsv option to\nbenchmark to output only original data in a CSV format.</li>\n</ul>\n</blockquote>\n<p>2011-12-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fix various issues noticed when cross-compiling for the\ni686-w64-mingw32 target.</li>\n</ul>\n</blockquote>\n<p>2011-12-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (ConvolveImage): For Q8 and Q16 builds use\n'float' rather than 'double' for computations in order to improve\nperformance with some compilers.</li>\n</ul>\n</blockquote>\n<p>2011-12-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (ConvolveImage): Special-case grayscale images\nfor better convolution performance.</li>\n</ul>\n</blockquote>\n<p>2011-12-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (BenchmarkUsage): -stepthreads now requires an\nargument which is the increment (starting at zero) to the number\nof threads for each step.  This hastens benchmarking with a large\nnumber of cores.</li>\n</ul>\n</blockquote>\n<p>2011-12-07  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Eliminate use of FARDATA.  It's no longer needed\nand will no longer be supplied by png.h in libpng-1.6.0.</li>\n</ul>\n</blockquote>\n<p>2011-12-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (BenchmarkImageCommand): Added Karp-Flatt\nmetric to benchmark output.</li>\n</ul>\n</blockquote>\n<p>2011-12-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick.spec.in: Eliminate use of deprecated BuildPrereq\nin RPM spec file.</li>\n</ul>\n</blockquote>\n<p>2011-11-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (WriteImagesFile): Should set file in\nImageInfo based on provided parameter rather than relying on it\nalready being set.  File argument was not being used.</li>\n</ul>\n</blockquote>\n<p>2011-11-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: For packed 10 bits, datums are now represented in\nthe same (reversed) order for all RGB and YCbCr formats.\nPreviously YCbCr 4:4:4 formats were not swapping the word datums\nbecause the only real-world files encountered did not swap the\nword datums.  Resolves SourceForge bug 2057277 &quot;DPX 10bit CbYCr\nImage seems to be wrong&quot;.</li>\n<li>wand/magick_wand.c (MagickWriteImagesFile): New function to\nappend images to a provided file handle.  Resolves SourceForge\nissue 3046868 &quot;added MagickWriteImagesFile&quot;.</li>\n<li>magick/constitute.c (WriteImagesFile): New function to append\nimages to a provided file handle.</li>\n<li>magick/blob.c (OpenBlob): Don't rewind already open file handle\npassed to OpenBlob() since we don't know the intended state of\nthis file handle, and because it prevents appending to an existing\nfile.  This change is part of the fix for SourceForge issue\n3046868 &quot;added MagickWriteImagesFile&quot;.</li>\n<li>wand/magick_wand.c (MagickSetImageSavedType): New function to\nallow specifying the storage type used when saving the file\n(rather than changing the current image characteristics).\nResolves SourceForge patch 3110185\n&quot;MagickGetImageSavedType()/MagickSetImageSavedType() API&quot;.\n(MagickGetImageSavedType): Return the storage type which will be\nused when the image is saved.</li>\n<li>magick/annotate.c (RenderFreetype): Add support for drawing text\nusing a bitmap font.  Resolves SourceForge patch 3230719 &quot;add\nsupport for drawing text with bitmap font to annotate.c&quot;.</li>\n<li>magick/profile.c (AppendImageProfile): Don't leak profile buffer\nwhile appending a chunk to an existing profile.  Resolves\nSourceForge patch 3294496 &quot;Fix a memory leak in\nprofile.c(AppendImageProfile)&quot;.</li>\n</ul>\n</blockquote>\n<p>2011-11-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (BenchmarkImageCommand): Include the number of\nthreads used in the benchmark results output.\n(BenchmarkImageCommand): New benchmark option -stepthreads to\nexecute the specified command with an increasing number of threads\nto measure how an algorithm benefits from threading.\n(BenchmarkImageCommand): Fix benchmark argument parsing so it is\nnot order dependent.\n(BenchmarkImageCommand): Add a speedup indication to -stepthreads\noutput.</li>\n<li>config/delegates.mgk.in: File names in gnuplot files need to be\nsurrounded by double quotes or gnuplot parser will reject them.</li>\n</ul>\n</blockquote>\n<p>2011-11-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (GetMedianList): Return PixelPacket via pointer\nrather than by value.</li>\n<li>version.sh: For snapshots packages, PACKAGE_CHANGE_DATE now uses\na form like &quot;snapshot-20111121&quot; rather than &quot;unreleased&quot; so it is\npossible to determine the vintage of an installed snapshot.</li>\n</ul>\n</blockquote>\n<p>2011-11-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tga.c (ReadTGAImage): Fix for poor TGA reading\nperformance due to excessive use of GetBlobByte().  Performance is\nfixed by adding local buffering.  Fixes SourceForge bug 3439531\n&quot;Slow TGA reading&quot;.</li>\n</ul>\n</blockquote>\n<p>2011-11-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (AdaptiveThresholdImage): More performance\nimprovements.</li>\n</ul>\n</blockquote>\n<p>2011-11-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/analyze.c (GetImageBoundingBox): Add a special case to\nhandle absolute color comparison.</li>\n</ul>\n</blockquote>\n<p>2011-11-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png: Update libpng to 1.5.6 release.</li>\n</ul>\n</blockquote>\n<p>2011-10-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Avoid linker warnings when building GraphicsMagick\nregarding OpenMP library being included multiple times.</li>\n</ul>\n</blockquote>\n<p>2011-10-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c (GetIPTCStream): Eliminate possible use of\nuninitialized data when parsing long format tag length.</li>\n</ul>\n</blockquote>\n<p>2011-10-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/import.c: Move low-level pixel import functions from\nconstitute.c to new file import.c.</li>\n<li>magick/export.c: Move low-level pixel export functions from\nconstitute.c to new file export.c.</li>\n<li>magick/floats.c: Move Richard Nolde's floating point conversion\nfunctions from constitute.c to new file floats.c.</li>\n</ul>\n</blockquote>\n<p>2011-10-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>libtool: Updated to libtool 2.4.2.</li>\n<li>configure.ac: Automake conditional for HasPNG can not itself be\nconditional.  Indent PNG script code appropriately.</li>\n</ul>\n</blockquote>\n<p>2011-10-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (AUTOMAKE_OPTIONS): Distribute lzma-compressed\ntarball in 'xz' format rather than deprecated 'lzma' format.</li>\n</ul>\n</blockquote>\n<p>2011-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Fix syntax error with GSCMYKDevice ('==' rather\nthan '=').  Thanks to Glenn Randers-Pehrson for noticing and\nreporting the issue.</li>\n</ul>\n</blockquote>\n<p>2011-10-12  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Use a &quot;for&quot; loop in configure.ac to find libpngNN.</li>\n</ul>\n</blockquote>\n<p>2011-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/pixel_wand.c (NewPixelWand): Invoke InitializeMagick()\nautomatically in case user forgets to do so.</li>\n<li>wand/drawing_wand.c (NewDrawingWand): Invoke InitializeMagick()\nautomatically in case user forgets to do so.</li>\n<li>wand/magick_wand.c (NewMagickWand): Invoke InitializeMagick()\nautomatically in case user forgets to do so.</li>\n<li>png: libpng sources were updated to release 1.5.4.</li>\n</ul>\n</blockquote>\n<p>2011-10-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): TIFFGetField() on\nTIFFTAG_OPIIMAGEID was causing a crash due to an argument\nmis-match between GraphicsMagick and libtiff.  Also fixed a few\nGCC 4.6 warnings.  Problem was reported by Dylan Millikin.</li>\n</ul>\n</blockquote>\n<p>2011-10-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickSetDepth): New function to set the\ndepth used when reading from an image format which requires that\nthe depth be specified in advance.\n(MagickReadImageBlob): Use BlobToImage() to read the blob.</li>\n<li>magick/effect.c (AdaptiveThresholdImage): Reduce or eliminate\nexpensive floating point calculations when possible.</li>\n<li>wand/magick_wand.c (MagickSetFormat): New Wand function to allow\nsetting the file or blob format before it has been read.</li>\n</ul>\n</blockquote>\n<p>2011-09-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/inc/tasks-install-perlmagick.isx: Windows\nsetup installer now installs PerlMagick built against ActiveState\nPerl v5.12.4 build 1205.</li>\n<li>magick/annotate.c (RenderFreetype): Eliminate spurious &quot;out of\nmemory&quot; exceptions due to empty text string.</li>\n</ul>\n</blockquote>\n<p>2011-09-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/module.c (ModuleAliases): PAM format is handled by PNM\ncoder.</li>\n<li>jpeg: Record that jpeg sources were updated to release v8c.</li>\n<li>lcms: Record that lcms sources were updated to release 2.2.</li>\n<li>png: Record that png sources were updated to release 1.5.4.</li>\n<li>tiff: Record that tiff sources were updated to release 4.0.0beta7.</li>\n<li>xml: Record that libxml2 sources were updated to release 2.7.8.</li>\n<li>zlib: Record that zlib sources were updated to release 1.2.5.</li>\n<li>VisualMagick/installer/inc/body.isx: Set MagickConfigDirectory\nfor DLL build so that .mgk files are put in application top\ndirectory.  This makes installation layout between static and DLL\nbuilds more similar.</li>\n</ul>\n</blockquote>\n<p>2011-08-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/list.c (AppendImageToList): Documentation for\nAppendImageToList() was wrong.  Problem was reported by Brad\nHarder.</li>\n</ul>\n</blockquote>\n<p>2011-08-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/display.c (MagickXMagickCommand): Display 'save' and\n'print' should display useful error details.  Problem was reported\nby Brad Harder.</li>\n</ul>\n</blockquote>\n<p>2011-08-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/semaphore.c (AllocateSemaphoreInfo): Enable pthread mutex\nerror checking if MAGICK_DEBUG is defined when the code is\ncompiled.  This mode helps validate that mutexes are used\ncorrectly.  No longer enable recursive mutexes since the\nGraphicsMagick logic should be able to operate without this\nassistance.</li>\n</ul>\n</blockquote>\n<p>2011-08-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (DCM_ReadOffsetTable): Fix wrong cast noticed when\ncompiling with LLVM.</li>\n</ul>\n</blockquote>\n<p>2011-08-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enhance.c (LevelImageChannel): Fix documented prototype.\nProblem was reported by Brad Harder.</li>\n</ul>\n</blockquote>\n<p>2011-07-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (AcquireOneCacheViewPixelInlined): Only use\nimage colormap if the image storage class is PseudoClass.\nEliminates a core dump when the image is in CMYK space.</li>\n</ul>\n</blockquote>\n<p>2011-07-20  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: account for changed typecast of png_get_iCCP\nargument in libpng15</li>\n</ul>\n</blockquote>\n<p>2011-07-20  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: look for libpng15, libpng14, libpng12, and libpng\nin that order.</li>\n</ul>\n</blockquote>\n<p>2011-07-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png: Update to libpng 1.5.4.</li>\n</ul>\n</blockquote>\n<p>2011-06-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/docutils-articles.css: Style sheet syntax fixes. Patch by\nMark Mitchell.</li>\n<li>scripts/html_fragments.py: Use proper quoting in banner search\nHTML.  Patch by Mark Mitchell.</li>\n</ul>\n</blockquote>\n<p>2011-06-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageType): Fix documentation for enumeration\nnames. The types need &quot;Type&quot; as part of the name.  Problem was\nreported by Brad Harder.</li>\n</ul>\n</blockquote>\n<p>2011-06-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>scripts/html_fragments.py (banner_template): HTML banner\nimprovements to go along with style-sheet changes.</li>\n<li>www/docutils-articles.css: Style-sheet improvements by Mark\nMitchell to work better on small screens.</li>\n</ul>\n</blockquote>\n<p>2011-06-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/project.rst: Add a page for links to pages about the\nproject.  The intention is to use this page to reduce the clutter\nin the banner.</li>\n</ul>\n</blockquote>\n<p>2011-05-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Document tiff:group-three-options define.</li>\n<li>coders/tiff.c (WriteTIFFImage): Add support for a\ntiff:group-three-options define to allow power-users to set the\nvalue of the GROUP3OPTIONS tag.</li>\n</ul>\n</blockquote>\n<p>2011-05-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Makefile.am: Include Hg.*, remove CVS.*.</li>\n<li>scripts/html_fragments.py (nav_template): CVS tab changed to\nSource, which links to Hg.html.</li>\n<li>www/Hg.rst: Document Hg repository access.</li>\n</ul>\n</blockquote>\n<p>2011-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>scripts/rst2htmldeco.py (docutils_opts): Do not include a\ndatestamp of any kind since it unnecessarily churns the\nrepository, particularly if the output file did not otherwise\nchange.</li>\n<li>INSTALL-unix.txt: Fix typo in description of --without-lzma.</li>\n</ul>\n</blockquote>\n<p>2011-05-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Treat exceptions thrown by\njpeg_finish_decompress() as warnings rather than errors.\n(JPEGErrorHandler): Handle JPEG errors directly rather than\npassing them to a message formatting routine for handling.  Also\nadded useful logging.\n(JPEGMessageHandler): Only handle JPEG traces and warnings.  Also\nadded useful logging.</li>\n</ul>\n</blockquote>\n<p>2011-05-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (EmitMessage): Treat an unhandled EXP marker as a\nwarning rather than a hard error.  Resolves SourceForge issue\n3297995 &quot;Unsupported marker type 0xdf&quot;.</li>\n</ul>\n</blockquote>\n<p>2011-05-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (AppendImages): If the input list only contains\none image, then return a new handle to the one image in the list\nrather than reporting an exception.  Problem was reported by Ravil\nRakhimgulov (&quot;Hunter1972&quot;).</li>\n</ul>\n</blockquote>\n<p>2011-04-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageColorRegion): New function to set the\nconstant pixel color for a specified region of the image.\n(AppendImages): Only color background pixels when needed.</li>\n</ul>\n</blockquote>\n<p>2011-04-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Added TIFF writer support for\nJBIG1 compression.  Not proven to work yet.</li>\n<li>magick/image.h (CompressionType): Added Group3Compression as an\nalias for already existing FaxCompression.  Added\nJPEG2000Compression, JBIG1Compression, and JBIG2Compression for\nfuture use.</li>\n</ul>\n</blockquote>\n<p>2011-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: For MinGW32 use 64-bit value formatting\nconventions which will work with any version of the WIN32 CRT.</li>\n</ul>\n</blockquote>\n<p>2011-04-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (WriteJPEGImage): Properly handle errors reported\nby the JPEG library when writing.  Up to now, JPEG library simply\ninvoked exit(), which crashed or hung if driven by Magick++ API.\nFixes SourceForge bug 3106947 &quot;Assertion failure when saving an\n&quot;invalid&quot; image as JPEG&quot;.</li>\n<li>magick/module.c (ModuleAliases): Delete &quot;XTRNBSTR&quot;-entry. Fix by\nStefan Graff.</li>\n<li>contrib/win32/ATL7/ImageMagickObject/ImageMagickObject.cpp\n(Perform): Member &quot;Perform&quot; - out-commented SafeArrayAccessData\nand following SafeArrayUnaccessData. Fix by Stefan Graff.</li>\n<li>contrib/win32/ATL/ImageMagickObject/MagickImage.cpp: Delete\n&quot;XTRNSTREAM&quot;-branch because &quot;XTRNSTREAM&quot; doesn't exist\nanymore. Fix by Stefan Graff.</li>\n<li>coders/xtrn.c: In function &quot;WriteXTRNImage&quot; there is no branch\nfor XTRNARRAY. Fix by Stefan Graff.</li>\n<li>PerlMagick/Magick.xs: AdaptiveThreshold offset argument was\nbeing parsed into an 'unsigned long' rather than 'double' as it\nshould have been.  This resulted in inability to handle negative\noffsets. Fixes SourceForge bug 3288735 &quot;PerlMagick issue with\nAdaptiveThreshold&quot;.</li>\n<li>coders/jpeg.c (ReadIPTCProfile): JPEG may deliver IPTC profile\nin chunks but code was only allowing one chunk, even though it was\notherwise prepared to concatenate chunks.  Fixes SourceForge bug\n2978422 &quot;Clipping paths in JPG images are truncated&quot;.</li>\n<li>magick/utility.c (GetToken): Fix case where parser may run off\nend of string.  Also add asserts to check for passing null\npointer.</li>\n</ul>\n</blockquote>\n<p>2011-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/channel.c (ChannelImage): Report an error if the\nrequested channel is not compatible with the image colorspace.\nOnly deals with CMYK/RGB conflicts.  Resolves SourceForge issue\n3283046 &quot;Bug in CMYK&quot;.</li>\n</ul>\n</blockquote>\n<p>2011-03-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c (ReadTXTImage): Throw error if attempt to read\nempty file.</li>\n<li>coders/{fits.c,mac.c,miff.c,pcd.c,pict.c,ps3.c,rla.c,txt.c}:\nFormat requires seekable stream.</li>\n<li>coders/pnm.c (WritePNMImage): Implement writer for PAM format.</li>\n<li>coders/ept.c (WriteEPTImage): Fix error handling for case when\nTIFF writer fails.</li>\n<li>magick/constitute.c (ReadImage): Use of GetBlobStatus() to\nevaluate image reader success is bogus.\n(MagickGetQuantumSamplesPerPixel): New private method to return\nthe number of samples returned per pixel for a given quantum type.</li>\n</ul>\n</blockquote>\n<p>2011-03-14  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage(): Fixed a rounding error in\nwriting the pHYs chunk (it was truncating instead of rounding).</li>\n</ul>\n</blockquote>\n<p>2011-02-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (MagickPanicSignalHandler,MagickSignalHandler):\nDon't invoke DestroyMagick() since there may be OpenMP worker\nthreads still running which are using data which would be\ndeallocated.  Instead we invoke PurgeTemporaryFiles() to remove\nany existing temporary files. Valgrind will report leaks if the\nprogram is terminated by a signal but this causes no actual harm.\nResolves SourceForge issue 3165456 &quot;^C causes semaphore failure in\nMacOSX&quot;.\n(MagickPanicSignalHandler): Invoke abort() in panic signal handler\nso that we will reliably get a core dump.</li>\n<li>magick/tempfile.c (PurgeTemporaryFiles): New private function to\nremove any existing temporary files but without destroying\ntemporary file semaphore.</li>\n</ul>\n</blockquote>\n<p>2011-02-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (ReadPNMImage): Fix mis-placed break in PAM header\nparser.</li>\n<li>wand/magick_wand.c (MagickWriteImageBlob): Improve the\ndocumentation to mention the related use of MagickSetImageFormat()\nand MagickResetIterator().</li>\n</ul>\n</blockquote>\n<p>2011-02-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/xwindow.c (MagickXBestFont): Check for a few more common\nfont names, and ensure to always check for &quot;fixed&quot; as a final\nfallback.</li>\n</ul>\n</blockquote>\n<p>2011-02-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>config/delegates.mgk.in: Added gs-cmyk entry.  Used if '-type\nColorSeparation' is specified on the command-line prior to the PDF\nor Postscript file name.  This entry specifies use of the\nGhostscript PAM driver which is capable of supporting CMYK output.\nThis may be useful if it is desired to apply CMYK color profiles\nto the image returned from the PDF.  As fair warning, it seems\nthat Ghostscript 8.62 outputs CMYK even if the PDF was in RGB\nspace if the PAM driver is used.</li>\n<li>coders/pnm.c (ReadPNMImage): Add support for reading netpbm's\nPAM format.</li>\n</ul>\n</blockquote>\n<p>2011-02-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwblob.c, tests/rwfile.c: Fixes to help tests work when\ntesting with multiple frames.</li>\n<li>coders/sgi.c: SGI format is not documented to support multiple\nframes.  Remove the half-baked extension for it.</li>\n</ul>\n</blockquote>\n<p>2011-02-01  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;&#46;&#46;\">glennrp<span>&#64;</span>simple<span>&#46;</span><span>&#46;</span><span>&#46;</span></a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Changed file_size greater than\nexpected from a corrupt-image error to a debug log entry.\nFile_size too small is still an error, and made that so also for\nBI_RGB images which were previously exempted from the test.</li>\n</ul>\n</blockquote>\n<p>2011-01-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwblob.c, tests/rwfile.c: Validate the data in each image\nframe, validate that each read returns the same number of frames,\nand validate that the correct number of frames was ultimately\nreturned.</li>\n<li>magick/blob.c (SyncBlob): Disable bogus code which attempted to\nreplicate the blob I/O object across all images in the list when\nthe blob is synced.  Leave a less bogus bit of code in place (but\ncommented out) in case such functionality is deemed to actually be\nneeded in the future.  The previous code was copying structs on\ntop of each other, including a pointer member to a semaphore.</li>\n</ul>\n</blockquote>\n<p>2011-01-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Changes.rst: Add a new Changes page to wrap up the yearly\nchange logs to lessen download size.</li>\n<li>scripts/changelog2rst.sh: Simple utility to format ChangeLog\nformat into something resembling reStructuredText.</li>\n<li>www/Makefile.am: Use reStructuredText to format the ChangeLog\nfiles to HTML so that we can inherit the improved formatting and\npage style.</li>\n<li>coders/pnm.c (ReadPNMImage): Support for multi-frame PNM was\nbotched due to on-going edits to support PAM format.</li>\n</ul>\n</blockquote>\n<p>2011-01-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickDescribeImage): Was sending\ndescriptive output to stdout rather than returning it in an\nallocated string as intended.</li>\n</ul>\n</blockquote>\n<p>2011-01-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/draw.c, wand/drawing_wand.c (MvgPrintf): Update to handle\nC99 vsnprintf() return values.</li>\n<li>magick/draw.c, wand/drawing_wand.c (DrawAnnotation): Linux\nglibc does not pass extended text characters if &quot;%.1024s&quot;\nformatting convention is used.  Apparently it assumes that such\ncharacters may be UTF8 and returns -1 rather than outputting the\nstring, even if it is assured to fit.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2012.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2012.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2012-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Added -auto-orient to 'convert' and 'mogrify'\nto automatically rotate the image upright for viewing based on its\ncurrent orientation setting.\nAdded -orient to support setting the image orientation.</li>\n<li>magick/shear.c (AutoOrientImage): New function to automatically\norient the image so that it is upright for normal viewing.</li>\n</ul>\n</blockquote>\n<p>2012-12-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>scripts/tap-functions.shi: Tidy TAP tests so that they may be\nrun alone, or via Perl's 'prove'.</li>\n</ul>\n</blockquote>\n<p>2012-12-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwfile.c (main): Test file name generation was not\ncorrect.</li>\n</ul>\n</blockquote>\n<p>2012-12-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwfile.tap: Added -stdio tests for most file formats.\nThis tests I/O using an already-opened file handle passed via the\nImageInfo file member.  Formats using the Ghostscript delegate are\nnot working right yet.</li>\n</ul>\n</blockquote>\n<p>2012-12-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwfile.c (main): Added a '-stdio' option to test\nreading/writing files using file handles opened by the API user.</li>\n<li>magick/blob.c (CloseBlob): It should be possible to invoke\nCloseBlob() multiple times, including blobs set to &quot;exempt&quot;.\nThere were some issues when passing in file descriptors.</li>\n</ul>\n</blockquote>\n<p>2012-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/api/api.rst: Add another example Core C API example program.</li>\n<li>magick/blob.c (OpenBlob): Restore file position, rather than\nrewind, after reading header bytes.</li>\n<li>magick/image.c (SetImageInfo): Restore file position after\nreading header bytes.  Resolves SourceForge issue 3597486\n&quot;ReadImage not working with file descriptors&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-12-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick: WIN64 (64-bit Windows) installer improvements to\nbring up to par with 32-bit installer.</li>\n</ul>\n</blockquote>\n<p>2012-12-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick: WIN64 (64-bit Windows) is supported now.</li>\n</ul>\n</blockquote>\n<p>2012-12-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c: Eliminate support for experimental\nMAGICK_MMAP_WRITE, which never quite worked correctly and did not\nprovide performance benefits.</li>\n</ul>\n</blockquote>\n<p>2012-12-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (FileToBlob): Rewrite to be based on stdio.</li>\n</ul>\n</blockquote>\n<p>2012-12-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick_types.h.in: Changes to try to work better with the\nWindows WIN64 API.</li>\n</ul>\n</blockquote>\n<p>2012-12-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageColorRegion): The provided color should\nbe in the same colorspace as the image.  The image is no longer\nconverted to RGB with the expectation that the provided color is\nalways some particular RGB.\n(AppendImages): No longer transform the canvas image to RGB.  Now\nappend uses the first listed image to determine the colorspace\nwhich should be used when appending the additional images and of\nthe output image.  The additional images are converted to the\ncanvas image colorspace.  Likewise, the background color is\nassumed to be in the same colorspace as the first listed image so\nthat it is compatible and can be used to fill the background color\nwithout translation.</li>\n</ul>\n</blockquote>\n<p>2012-11-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>rungm.sh.in: Remove extraneous space in first line which\nprevents execution with T-shell (tsch).  Reported by William\nLangdon.</li>\n</ul>\n</blockquote>\n<p>2012-11-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/wand/wand.rst: Add a simple example of using the Wand API.</li>\n</ul>\n</blockquote>\n<p>2012-11-21  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simplesystems&#46;org\">glennrp<span>&#64;</span>simplesystems<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Fixed an old bug with decoding\nchromaticity primaries.</li>\n</ul>\n</blockquote>\n<p>2012-11-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.h (&quot;C&quot;): Need to include wand/wand_symbols.h\nafter magick/api.h in order for options from magick_config.h to\ntake effect.</li>\n<li>magick/symbols.h (PSPageGeometry): Fix typo. Should map to\nGmPSPageGeometry.</li>\n</ul>\n</blockquote>\n<p>2012-11-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/wand_symbols.h, magick/symbol.h: MagickWand API is now\nprefixed with 'Gm' when the --enable-symbol-prefix configure\noption is supplied.  These changes are contributed by Ben Wu.\nDetails of changes are as follows:<ol class=\"arabic\">\n<li>A new header file wand/wand_symbols.h which prefixes all\nMagickWand API symbols with Gm.</li>\n<li>Modification to all the header files in wand/ to include\nwand_symbols.h.</li>\n<li>Modification to magick/symbols.h to include additional\nsymbols which were colliding with names in ImageMagick.</li>\n<li>Modification to magick/error.c to exclude function\ndefinitions for MagickError, MagickFatalError,\nMagickWarning, and ThrowException when building with\n--enable-symbol-prefix option. There four names were also\ndefined as macros so it appears that putting them in a\nsymbol-remapping file wont work.</li>\n</ol>\n</li>\n<li>Makefile.am: Update Automake to 1.12.5.</li>\n</ul>\n</blockquote>\n<p>2012-11-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/COPYING: Change Magick++ usage license to be exactly\nthe MIT license without the additional sentence about retention of\ncopyright (which was already legally implicit).</li>\n</ul>\n</blockquote>\n<p>2012-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/symbols.h: Re-generate list of symbols to prefix.</li>\n<li>magick/utility.c (IsGlob): IsGlob can be more efficient.</li>\n<li>magick/floats.c: Use compile-time selection of endian-specific\ncode rather than run-time.  Fix cast warning with 64-bit builds.</li>\n</ul>\n</blockquote>\n<p>2012-11-07  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simplesystems&#46;org\">glennrp<span>&#64;</span>simplesystems<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): The wrong QuantumType was\nsometimes passed to ExportImagePixelArea() by the PNG encoder.</li>\n<li>coders/png.c (ReadOnePNGImage): Let libpng unpack all sub-8-bit\npixels (see change of 2012-08-31 which lets libpng unpack sub-8-bit\npalette images; this also lets libpng unpack the grayscale images).</li>\n<li>coders/png.c (ReadOnePNGImage): Corrected the reading of interlaced\nimages (see SourceForge bug 3420695, in which all passes are\ndisplayed in a garbled manner instead of only the completed image).</li>\n</ul>\n</blockquote>\n<p>2012-10-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickGetImagePage): Need to use 'image'\nrather than 'images' in order to work with iterator.\n(MagickSetImagePage): Need to use 'image'\nrather than 'images' in order to work with iterator.</li>\n</ul>\n</blockquote>\n<p>2012-10-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (TranslateTextEx): Fix bug with input string\nread overrun if the input string ends with a single '%'.  This\nsometimes caused random heap data to be added to the output string\nuntil another null character is reached.  A simple work-around\nwithout this fix is to use &quot;%%&quot; rather than &quot;%&quot;.  Fixes\nSourceForge bug 3580219 &quot;strange results with '%' in Annotate()&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-10-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickSetImagePage): New method to support\nsetting the image page size and offsets.\n(MagickGetImagePage): New method to support getting image page\nsize and offsets.</li>\n</ul>\n</blockquote>\n<p>2012-10-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Report fatal error if doing modules build and\nlibltdl is not found.</li>\n</ul>\n</blockquote>\n<p>2012-10-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ltdl: Libltdl is no longer bundled.  Libltdl must be previously\ninstalled on the system in order to build the modules\nconfiguration.</li>\n</ul>\n</blockquote>\n<p>2012-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/index.rst: Update top index page for 1.3.17 release.</li>\n<li>NEWS.txt: Update NEWS for 1.3.17 release.</li>\n<li>version.sh: Update shared library versioning for 1.3.17 release.</li>\n<li>coders/jnx.c: Fix format string compilation warnings.  Remove\nMS-DOS line terminations.</li>\n<li>configure.ac: Module loading is now only supported by the\nmodules build and not just because shared libraries are enabled.\nThis means that libltdl is only depended upon by the modules\nbuild.  Sometime in the future, libltdl will no longer be bundled\nin the GraphicsMagick source tree.</li>\n</ul>\n</blockquote>\n<p>2012-10-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac (LTDL_INIT): Request installable libltdl rather\nthan convenience.</li>\n</ul>\n</blockquote>\n<p>2012-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c: Support alpha channel in uncompressed 32-bit BMP.\nResolves SourceForge issue 3566239 &quot;Can't open BMP with alpha\ncreated by photoshop&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-10-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>dcraw/dcraw.c: Fixed situation when M_PI is not defined.</li>\n</ul>\n</blockquote>\n<p>2012-10-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c: Add image attribute with geolocation.</li>\n</ul>\n</blockquote>\n<p>2012-10-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>dcraw: VisualMagick configure fixes to support linking with JPEG\nand JPEG2000.</li>\n</ul>\n</blockquote>\n<p>2012-09-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>dcraw: Add dcraw to VisualMagick build.</li>\n<li>libxml: Update libxml2 to 2.9.0 release.</li>\n</ul>\n</blockquote>\n<p>2012-09-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff: Update libtiff to 4.0.3 release.</li>\n<li>lcms: Update liblcms2 to 2.4 release.</li>\n<li>png: Update libpng to 1.5.13 release.</li>\n</ul>\n</blockquote>\n<p>2012-09-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am: Update to Automake 1.12.4.</li>\n</ul>\n</blockquote>\n<p>2012-09-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Fix Debian bug 687738 &quot;graphicsmagick:\nrepeated words suitable for suitable for in gm manpage&quot; reported\nby Jonas Smedegaard.</li>\n</ul>\n</blockquote>\n<p>2012-09-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update with news since last release.</li>\n<li>configure.ac: Added the configure option\n--enable-quantum-library-names to enable that shared library name\nincludes quantum depth to allow shared libraries with different\nquantum depths to co-exist in same directory (only one can be used\nfor development).</li>\n</ul>\n</blockquote>\n<p>2012-09-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (AdaptiveThresholdImage): New implementation\ncontributed by Roberto de Deus Barbosa Murta.  Executes in linear\ntime as threhold area is increased rather than being quadratic.</li>\n</ul>\n</blockquote>\n<p>2012-09-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c: Fix improper injection of XML headers as rendered\ntext.</li>\n<li>magick/render.c (DrawImage): Fix SourceForge issue 3499164\n&quot;Drawing of text fails if text starts with &quot;,&quot; character&quot;.  Fix\nSourceForge issue 3411492 &quot;Certain SVGs hang GraphicsMagick&quot;.  Fix\nSourceForge issue 1961000 &quot;Could not print ',' via convert draw\ntext&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-09-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c (lite_font_stringwidth): Simply return zero.\nReturning a computed string width was causing text placement\nproblems when testing with libwmf's fulltest.wmf.</li>\n</ul>\n</blockquote>\n<p>2012-08-31  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simplesystems&#46;org\">glennrp<span>&#64;</span>simplesystems<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: ReadOnePNGImage: sub-8-bit palette images were\ngetting unpacked twice; once by libpng via png_set_packing()\nand again by coders/png.c in a switch() statement around line 2500,\nresulting in horizontally stretched pixels.</li>\n</ul>\n</blockquote>\n<p>2012-08-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (AUTOMAKE_OPTIONS): Include lzip as a distribution\nformat again.</li>\n</ul>\n</blockquote>\n<p>2012-08-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: BrowseDelegate now defaults to 'xdg-open', but if\nit is not found, then configure will search for firefox,\ngoogle-chrome, mozilla (in that order).</li>\n</ul>\n</blockquote>\n<p>2012-08-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: For testing on MinGW, assume that Postscript is\navailable since we don't have a good way to check for that.</li>\n<li>scripts/tap-functions.shi (test_count): Always execute the test\nprogram rather than skipping execution since we want to make sure\nthe test program fails correctly as well.</li>\n<li>coders/gif.c (DecodeImage): Add a log message for attempted LZW\nstring data table overflow.</li>\n</ul>\n</blockquote>\n<p>2012-08-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (ConvolveImage): Allocate normalized convolution\nkernel using cache-line aligned memory allocator.</li>\n<li>configure.ac: Remove support for legacy LZWDecodeDelegate and\nLZWEncodeDelegate since these are not used any more.</li>\n</ul>\n</blockquote>\n<p>2012-08-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>scripts/tap-functions.shi: If a test declares that it needs\ncertain features, skip the test if required features are not\navailable.</li>\n<li>configure.ac: Build a supported features list and save to\ncommon.shi script for use by test scripts.</li>\n<li>Makefile.am (LOG_COMPILER): Run Bourne-shell based TAP scripts\nwith the same shell $(SHELL) that configure selected for the\nMakefile to use.</li>\n</ul>\n</blockquote>\n<p>2012-08-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (AUTOMAKE_OPTIONS): Update to Automake 1.12.3.\nUpdate test suite to use Automake TAP driver rather than legacy\ntests.</li>\n</ul>\n</blockquote>\n<p>2012-08-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c (ExtractTileJPG): Add a trace of tile offset and size.</li>\n</ul>\n</blockquote>\n<p>2012-08-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c (ExtractTileJPG): Use a memory buffer for the JPEG\ntile rather than a temporary file.</li>\n</ul>\n</blockquote>\n<p>2012-08-12  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n* PerlMagick/t/input_jnx.jnx: Small JNX test file.</blockquote>\n<p>2012-08-11  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c: speedup.</li>\n</ul>\n</blockquote>\n<p>2012-08-10  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c: changed malloc/free to MagickMalloc/MagickFree.</li>\n</ul>\n</blockquote>\n<p>2012-08-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c (ReadJNXImage): Add progress monitor support for\nJNX.</li>\n</ul>\n</blockquote>\n<p>2012-08-06  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c: Image cache is turned off to work-around memory\noverflow.</li>\n</ul>\n</blockquote>\n<p>2012-08-05  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c: Fixed.</li>\n</ul>\n</blockquote>\n<p>2012-08-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c: Add JNX coder for &quot;Garmin proprietary Image\nFormat&quot; (implementation by Jaroslav Fojtik) to the build.  Code is\nnot yet working properly at this time.</li>\n</ul>\n</blockquote>\n<p>2012-08-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Remove use of -Wl,-zlazyload under Solaris since\nit seems to decrease the stability of C++ exceptions in x86-64\nbuild and does not measurably improve runtimes.  Don't force use\nof liblzma because libtiff is used.  User should always have\ncontrol.</li>\n</ul>\n</blockquote>\n<p>2012-07-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/memory.c (MagickMallocAligned): Use RoundUpToAlignment()\nmacro to compute aligned pointer.</li>\n<li>magick/effect.c (EnhanceImage): Eliminate use of ugly Enhance\nmacro.  Only filter based on color channels (ignore opacity).</li>\n</ul>\n</blockquote>\n<p>2012-07-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h (MAGICK_CACHE_LINE_SIZE): Assume a cache line\nsize of 64 bytes except for on PowerPC which uses 128.</li>\n<li>magick/pixel_cache.c: Use aligned memory allocator to allocate\nstructures and buffers which might suffer from false cache line\nsharing</li>\n<li>magick/memory.c (MagickMallocAligned): Also round up allocation\nsize to alignment.</li>\n</ul>\n</blockquote>\n<p>2012-07-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c, magick/random.c, magick/semaphore.c: Use\naligned memory allocator to align allocations which should be\naligned to cache line boundary.</li>\n</ul>\n</blockquote>\n<p>2012-07-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/memory.h (MagickAllocateAlignedMemory): New macro to\nallocate aligned memory.\n(MagickFreeAlignedMemory): New macro to free aligned memory.</li>\n<li>magick/memory.c (MagickMallocAligned): New internal function to\nallocate aligned memory.\n(MagickFreeAligned): New internal function to free aligned memory.</li>\n</ul>\n</blockquote>\n<p>2012-07-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/common.h (MAGICK_ASSUME_ALIGNED): Add some GCC attribute\nwrappers for useful features added by GCC 4.7.</li>\n</ul>\n</blockquote>\n<p>2012-07-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (ReadGIFImage): Try to be better about reporting\nfailure when ReadBlob() fails to return the requested number of\nbytes.</li>\n</ul>\n</blockquote>\n<p>2012-06-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/benchmarks.rst: Strip the outdated benchmark results from\nthe benchmarks page.</li>\n<li>magick/command.c (ImportImageCommand): Status returned from the\ncommand was inverted.</li>\n</ul>\n</blockquote>\n<p>2012-06-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Release GraphicsMagick 1.3.16</li>\n</ul>\n</blockquote>\n<p>2012-06-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): -units was adjusting existing\nresolution the wrong way around.</li>\n</ul>\n</blockquote>\n<p>2012-06-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>jpeg: Updated to IJG 8d release.</li>\n<li>libxml: Updated libxml to 2.8.0 release.</li>\n<li>zlib: Updated zlib to 1.2.7 release.</li>\n<li>magick/blob.c (MagickFileHandle): Refer to stdio, bzip2, and\ngzip file handles using their own type.  Eliminates warnings\nobserved when compiling with zlib 1.2.7.</li>\n<li>tiff: Updated libtiff to 4.0.2 release.</li>\n<li>png: Updated libpng to 1.5.11 release.</li>\n</ul>\n</blockquote>\n<p>2012-06-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Fix typo which caused the --without-lzma option to\nbe handled incorrectly.  Resolves SourceForge issue 3535309\n&quot;graphicsmagick from 1.3.13 to 1.3.15 has broken lzma support&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-06-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwfile.c (main): Verify that we can 'ping' the file using\nPingImage().  Tests for some formats may take longer to complete.</li>\n<li>tests/rwblob.c (main): Verify that we can 'ping' the blob using\nPingBlob().  Tests for some formats may take longer to complete.</li>\n<li>coders/xbm.c (ReadXBMImage): Fix memory leak of temporary X\nbitmap image allocation encountered when reading in 'ping' mode.</li>\n<li>magick/blob.c (PingBlob): Re-write to be based on BlobToImage()\nso that it works reliably.\n(BlobToImage): Restore original input file name to image if\ntemporary file was used so that image 'filename' and\n'magick_filename' do not contain unexpected content due to using a\ntemporary file.</li>\n</ul>\n</blockquote>\n<p>2012-06-07  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simplesystems&#46;org\">glennrp<span>&#64;</span>simplesystems<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Disable new libpng-1.5.10 test for invalid palette\nindex when reading a PNG or MNG (for speed), or when writing a MNG\n(because a zero-length PLTE is valid in a MNG).</li>\n</ul>\n</blockquote>\n<p>2012-06-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (SetImageAttribute): Don't translate\n'comment' and 'label' attributes if the request is made while a\nfile is being read.  This is a temporary workaround until there is\nopportunity to modify the architecture so that there is a clear\nsplit between user-provided settings and values obtained from the\ninput image.</li>\n<li>magick/blob.c (GetBlobIsOpen): New function to return if blob is\ncurrently open.</li>\n</ul>\n</blockquote>\n<p>2012-06-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/typemap: Add typemap file needed by Perl 5.16.\nResolves SourceForge issue 3531512 &quot;PerlMagick does not build with\nperl 5.16&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-05-29  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simplesystems&#46;org\">glennrp<span>&#64;</span>simplesystems<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Ignore APNG chunks even if we are using a libpng\nthat was built with the &quot;APNG patch&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (ConvertImageCommand): +repage does not require\nan argument.  Resolves SourceForge issue 3529158 &quot;+repage option\nnot respected with convert command&quot;.</li>\n<li>configure: Update to Autoconf 2.69.</li>\n<li>magick/effect.c (MotionBlurImage): Motion blur does scale so\nremove DisableSlowOpenMP for it.</li>\n<li>magick/command.c (BenchmarkImageCommand): Remove parenthesis\nfrom output, and change &quot;iter/sec cpu&quot; to &quot;iter/cpu&quot; to ease\nparsing.</li>\n<li>magick/pixel_cache.c (GetPixelCacheInCore): Consider read-only\nmemory-mapped cache as being &quot;in-core&quot;.  Otherwise MPC input files\nare penalized.</li>\n</ul>\n</blockquote>\n<p>2012-05-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/api.h: Include &lt;sys/types.h&gt; on POSIX systems in order to\nhelp assure that 'size_t' and 'ssize_t' are declared.</li>\n</ul>\n</blockquote>\n<p>2012-05-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick_config_api.h.in: Need to provide definitions for\n'size_t' and 'ssize_t' in case the system headers lack these types\nbecause the definition of MagickExtentImage() requires them.  This\nshould resolve PHP bug #62034 &quot;gmagick does not compile&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-05-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_iterator.c (GetRegionThreads): Don't thread region\nif it is not memory-based.</li>\n</ul>\n</blockquote>\n<p>2012-05-09  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simplesystems&#46;org\">glennrp<span>&#64;</span>simplesystems<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): make transparent_color elements\nunsigned long instead of unsigned short, so 65537 is actually out of\nrange as expected, and won't match any pixel if no tRNS chunk is\npresent.</li>\n</ul>\n</blockquote>\n<p>2012-05-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sfw.c (ReadSFWImage): Reader needs to be more robust\nagainst corrupt or maligned headers.  Resolves SourceForge issue\n&quot;sfw file crash&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-05-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Add file basename as the PDF\ndocument title.  Resolves SourceForge bug ID 2835140\n&quot;GraphicsMagick fails to add title attribute to PDF output&quot;.</li>\n<li>coders/sfw.c (ReadSFWImage): Restore original filename and\nformat.</li>\n<li>PerlMagick/t/jpeg/read.t: Add a test for reading Seattle\nFilmWorks format based on the sample image from\n<a class=\"reference external\" href=\"http://www.algonet.se/~cyren/sfw/\">http://www.algonet.se/~cyren/sfw/</a>.  Image was approved for\ndistribution in GraphicsMagick by Bengt Cyrén.</li>\n<li>magick/analyze.c (GetImageBoundingBox): Only apply opacity-based\nbounding box detection if all three test points are non-opaque and\nthe same value.  Resolves SourceForge bug ID 3522804 &quot;convert\n-trim fails on 8-bit PNG that ImageMagick can trim&quot;.</li>\n<li>coders/sfw.c (ReadSFWImage): Fix variety of bugs related to\nclosing Image and blob at wrong points.  SFW reader is working\nagain.  Resolves SourceForge bug ID 523430 &quot;sfw file open failed&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-05-01 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Animated movies inside 4D matrices are loaded now.</li>\n</ul>\n</blockquote>\n<p>2012-04-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_iterator.c: Limit the number of threads to use in\nthe loop rather than the total number of threads available.</li>\n</ul>\n</blockquote>\n<p>2012-04-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Release GraphicsMagick 1.3.15</li>\n</ul>\n</blockquote>\n<p>2012-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): Remove automatic adjoin mode\nsupport logic.\n(AddDefinition): Fix use of uninitialized variable.</li>\n</ul>\n</blockquote>\n<p>2012-04-23  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simplesystems&#46;org\">glennrp<span>&#64;</span>simplesystems<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/*.imdoc: some example commandlines in the documentation\nwere missing the leading &quot;gm &quot;.</li>\n</ul>\n</blockquote>\n<p>2012-04-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (FormMultiPartFilename): No longer add a\nprintf-style scene formatting specification to filenames which do\nnot have one and no longer automatically operate in 'adjoin' mode\nin such cases.  This is a BIG CHANGE for users who may have become\nused to this automatic functionality.  The simple solution to\nupdate existing scripts depending on this behavior is to change\nany bare filenames to include a format specification similar to\n&quot;image-%d.jpg&quot; and add +adjoin to the command line.  The reason\nwhy this change is made is that the output files produced by any\ngiven operation were unpredictable, and it was causing temporary\nfiles to be leaked due to the renaming.</li>\n</ul>\n</blockquote>\n<p>2012-04-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (WriteBMPImage): Enforce that image width and\nheight do not exceed BMP dimensions.  BMP dimensions are\nrepresented by a signed type.  BMPv2 supports maximum dimensions\nof 32k by 32k.</li>\n</ul>\n</blockquote>\n<p>2012-04-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/info.c (WriteINFOImage): When driven by the 'convert'\nutility, -format produces user-controlled formatted output similar\nto -format in 'identify'.  This is accomplished via a\n'<a class=\"reference external\" href=\"info:format=value\">info:format=value</a>' define.</li>\n<li>magick/image.c (AddDefinition): New function for adding just one\ndefine to definitions list.</li>\n</ul>\n</blockquote>\n<p>2012-04-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (ReadPNMImage): Completely disable OpenMP in reader\nbecause there is too much contention.</li>\n<li>magick/pixel_iterator.c: Dereference image to be modified in\nnon-threaded context in order to lessen contention.</li>\n<li>magick/semaphore.c (AllocateSemaphoreInfo): Make sure that\nSemaphoreInfo does not share cache lines with another semaphore.</li>\n</ul>\n</blockquote>\n<p>2012-04-11  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simplesystems&#46;org\">glennrp<span>&#64;</span>simplesystems<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: fixed problem with bit depth when the encoder\ndecides to write RGBA instead of indexed PNG, by delaying the\ncall to png_set_tRNS() until after calling png_set_IHDR().</li>\n</ul>\n</blockquote>\n<p>2012-03-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png: Update bundled libpng to 1.5.10 release.  Provides security\nfix for CVE-2011-3048.</li>\n<li>wand/magick_compat.c (ParseGeometry): Use strlcpy() rather than\nstrncpy().\n(CopyMagickString): Depend on strlcpy() because we provide it if\nit is missing.\n(ConcatenateMagickString): Depend on strlcat().</li>\n<li>coders/xcf.c (ReadXCFImage): Now respects image subimage and\nsubrange members so that returned image layers may be selected.\nBased on patch from SourceForge issue 3513025 &quot;XCF reads all\nlayers all the time&quot;.</li>\n<li>magick/resize.c (ThumbnailImage): Thumbnail default filter is\nintended to be the box filter, but allow the user to override the\nfilter used.  Resolves SourceForge issue 3513239 &quot;-filter command\nline argument ignored&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (ConvertImageCommand, MogrifyImageCommand):\nAdded support for '+noise random' and '-operator noise-random' to\n'convert' and 'mogrify'.</li>\n<li>magick/effect.c (AddNoiseImage): Added support for RandomNoise.\n(AddNoiseImageChannel): Added support for RandomNoise.</li>\n<li>magick/enum_strings.c (StringToNoiseType): New function to\nconvert a string to a NoiseType enumeration value.\n(NoiseTypeToString): New function to convert a NoiseType\nenumeration value into a string.</li>\n<li>PerlMagick/Magick.xs: Added support for RandomNoise.</li>\n<li>magick/operator.c (QuantumOperatorRegionImage): Added support for\nRandomNoise.</li>\n<li>magick/effect.c (AddNoiseImageChannel): Added support for\nRandomNoise.</li>\n<li>magick/gem.c (GenerateDifferentialNoise): Added support for\nRandomNoise.</li>\n<li>magick/random.h (MagickRandomRealInlined): The span of\nMagickRandomRealInlined() is now slightly more accurate.</li>\n<li>magick/image.h (enum NoiseType): New enumeration value RandomNoise.</li>\n</ul>\n</blockquote>\n<p>2012-03-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): Add support for -repage option\nto composite, convert, mogrify, and montage subcommands.  Resets\nor adjusts the current image page offsets based on a provided\ngeometry specification.</li>\n<li>magick/image.c (ResetImagePage): Add a function to adjust the\ncurrent image page canvas and position based on a relative page\nspecification.</li>\n</ul>\n</blockquote>\n<p>2012-03-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImage): Add support for -strip option\nto composite, convert, mogrify, and montage subcommands.  Removes\nall profiles and text attributes from the image.</li>\n<li>magick/image.c (StripImage): New function to remove all profiles\nand text attributes from the image.</li>\n</ul>\n</blockquote>\n<p>2012-02-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Release GraphicsMagick 1.3.14.</li>\n<li>NEWS.txt: Updated to describe updates since last release.</li>\n</ul>\n</blockquote>\n<p>2012-02-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Downgrade to Automake 1.11.2 so that test suite can run on\nsystems with limited command line length.  This means that lzip\nsupport is temporarily removed.</li>\n<li>magick/resize.c (ResizeImage): Resize filter argument was being\nignored.  Filter from image 'filter' member was used instead.\nProblem was reported by Steven Bakhtiari.</li>\n</ul>\n</blockquote>\n<p>2012-02-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff: Update bundled libtiff to 4.0.1 release.</li>\n<li>png: Update bundled libpng to 1.5.9 release.</li>\n<li>magick/memory.h: Decorate memory allocation functions with GCC\nattribute 'alloc_size'.</li>\n<li>magick/common.h: Add support for GCC 4.3+ attributes\n'alloc_size', 'hot', 'cold'.</li>\n<li>magick/{log.h,monitor.h,utility.h}: Use double-underscore syntax\nin GCC format attribute specifications to defend against\naccidental macro expansion.</li>\n</ul>\n</blockquote>\n<p>2012-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (ReadXCFImage): Fix reading XCF which is comprised\nof different sized layers.</li>\n</ul>\n</blockquote>\n<p>2012-02-08  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simplesystems&#46;org\">glennrp<span>&#64;</span>simplesystems<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c: Added &quot;-define txt:with-im-header&quot; option.</li>\n</ul>\n</blockquote>\n<p>2012-02-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png: Updated to libpng 1.5.8 release</li>\n<li>zlib: Updated to zlib 1.2.6 release</li>\n</ul>\n</blockquote>\n<p>2012-02-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (AUTOMAKE_OPTIONS): Update to Automake 1.11.3.  Add\nlzip compressed archive to options.</li>\n</ul>\n</blockquote>\n<p>2012-01-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcraw.c (RegisterDCRAWImage): Add support for Mamiya\nPhoto RAW &quot;MEF&quot; format.  Resolves SourceForge issue #3481508\n&quot;*.MEF file open incorrect&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-01-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (WriteJPEGImage): Convert RGB-compatible\ncolorspaces (e.g. CineonLog) to RGB by default since that was the\ncase prior to release 1.3.13.  User can still override it\n(avoiding removal of log encoding) by explicitly specifying the\ndesired colorspace.  Problem was reported by Gary Margiotta.</li>\n</ul>\n</blockquote>\n<p>2012-01-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): When reading, save input file\nendianness so that the endianness of the original file is\npreserved by default.  The user is able to override this default\nvia -endian.  Problem was reported by JongAm Park.</li>\n</ul>\n</blockquote>\n<p>2012-01-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/OpenMP.rst: Updated OpenMP results based on latest OpenMP\ntunings and the Intel Xeon E5649 CPU.</li>\n</ul>\n</blockquote>\n<p>2012-01-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcraw.c (ReadDCRAWImage): Fix memory leak of ImageInfo.\nResolves SourceForge bug #3475148 &quot;memery leaks&quot;.</li>\n<li>magick/module.c (ModuleAliases): EMF format is supported by EMF\nmodule and so mapping EMF to the WMF module caused EMF not to\nwork.  Resolves SourceForge bug #3475147 &quot;emf files can not be\nopened&quot;.  Note that the EMF module only works for Microsoft\nWindows.</li>\n</ul>\n</blockquote>\n<p>2012-01-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gem.c (Hull): Improve performance.</li>\n<li>magick/effect.c (DespeckleImage): Improve performance.</li>\n</ul>\n</blockquote>\n<p>2012-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/effect.c (DespeckleImage): Using schedule(static,4)\nblocks any opportunity for speedup.  This was a performance\nregression.  Oops!</li>\n</ul>\n</blockquote>\n<p>2012-01-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickExtentImage): Added\nMagickExtentImage() to Wand API.  Resolves SourceForge issue\n#3471915 &quot;MagickExtentImage in the Wand C API&quot;.</li>\n</ul>\n</blockquote>\n<p>2012-01-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/export.c (ExportViewPixelArea): Break up implementation\ninto subroutines to ease compilation.</li>\n</ul>\n</blockquote>\n<p>2012-01-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/import.c (ImportViewPixelArea): Break up implementation\ninto subroutines to ease compilation.</li>\n</ul>\n</blockquote>\n<p>2012-01-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h: Use Magick prefixed macro names for ftruncate,\nmmap, and munmap in order to assure that introducing our macros\ndoes not cause trouble with system headers.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2013.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2013.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2013-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Update for 1.3.19 release.</li>\n<li>www/index.rst: Update for 1.3.19 release.</li>\n<li>NEWS.txt: Update for 1.3.19 release.</li>\n<li>magick/blob.c (GetBlobTemporary): Add assertions to assure that\nimage and blob are valid structures.</li>\n<li>coders/png.c (ReadOnePNGImage): Fix problem peculiar to Q8 build\nwith reading 1-bit PNG files.</li>\n<li>PerlMagick/t/png/(write-16.t, read.t, write-16.t, write.t):\nUpdate expected signatures</li>\n<li>coders/xpm.c (WriteXPMImage): Limit XPM color resolution to what\nXPM can traditionally handle.</li>\n<li>magick/enhance.c (GammaImage): Eliminate a compiler warning.</li>\n<li>coders/png.c (ReadOnePNGImage): Eliminate a compiler warning.</li>\n<li>coders/pcl.c (WritePCLImage): Eliminate a compiler warning.</li>\n</ul>\n</blockquote>\n<p>2013-12-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/delegate.c (InvokePostscriptDelegate): Log return status.</li>\n<li>magick/nt_base.c (NTGhostscriptFonts): For Microsoft Windows,\nalso search c:gsfonts for Ghostscript font files.</li>\n<li>coders/ept.c (ReadEPTImage): Fix crash observed when Ghostscript\nfails to produce output.</li>\n</ul>\n</blockquote>\n<p>2013-12-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c: Simplify FreeType2 header inclusion.</li>\n<li>configure.ac: Only test for freetype/freetype.h if ft2build.h\nwas not found.</li>\n</ul>\n</blockquote>\n<p>2013-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ttf: Update FreeType to release 2.5.2.</li>\n<li>Updated build to use Automake 1.14.1.</li>\n</ul>\n</blockquote>\n<p>2013-12-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>libxml: Update libxml2 to release 2.9.1.</li>\n</ul>\n</blockquote>\n<p>2013-12-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lcms/include/lcms2.h: Update lcms to release 2.5.</li>\n<li>png/README: Update PNG library to release 1.6.8.</li>\n<li>jpeg: Update Windows IJG JPEG library to release 9.</li>\n</ul>\n</blockquote>\n<p>2013-12-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/alpha_composite.h (BlendCompositePixel): Fix from Troy\nPatteson to eliminate induced color problems when compositing two\nimages which include fully transparent pixels.  Now fully\ntransparent pixels do not contribute any color to the composed\nresult. Opacity used when blending is now based on the average\nopacity of both pixels.  Resolves SourceForge issue #148 &quot;Pixel\ninterpolation problem with rotated transparent images &quot;.</li>\n</ul>\n</blockquote>\n<p>2013-12-18  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Properly scale 16-bit input\nPNG down to 8-bit when using a Q8 build.</li>\n</ul>\n</blockquote>\n<p>2013-12-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/demo/piddle.cpp (main): Use DrawableDashArray to make\nsure that it works.</li>\n<li>wand/drawing_wand.c (DrawSetStrokeDashArray): Fix defective\nstroke-dasharray MVG generation.  Resolves SourceForge issue &quot;#255\nDrawSetStrokeDashArray still fails&quot;.</li>\n<li>magick/draw.c (DrawSetStrokeDashArray): Fix defective\nstroke-dasharray MVG generation.</li>\n</ul>\n</blockquote>\n<p>2013-12-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c: Add value scaling changes which will be necessary\nto support all the build depths supported by IJG JPEG 9a.</li>\n<li>coders/webp.c (ReadWEBPImage): Support 'ping'. Improve quality\nof error reporting.</li>\n<li>GraphicsMagick.spec.in: Update RPM spec file to add\nlibwebp-devel as a build dependency, and libwebp as a run-time\ndepdendency.</li>\n</ul>\n</blockquote>\n<p>2013-12-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/webp.c: Incorporated simple WebP support as contributed\nby &quot;TIMEBUG&quot; at users.sf.net plus a few security changes. Does not\nyet support Windows Visual Studio build, input from a pipe,\nattached profiles, animation, or incremental pixel I/O.\n(RegisterWEBPImage): Register WebP as requiring seekable stream so\ninput from pipe works.</li>\n</ul>\n</blockquote>\n<p>2013-11-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/drawing_wand.c (DrawSetStrokeDashArray): Use array size\nspecified by user and don't expect user-provided array to be\nterminated by 0.0.  Resolves SourceForge bug &quot;#250 Unexpected\nresults from DrawSetStrokeDashArray&quot;.</li>\n<li>magick/draw.c (DrawSetStrokeDashArray): Use array size specified\nby user and don't expect user-provided array to be terminated by\n0.0.</li>\n<li>wand/drawing_wand.c (DrawGetStrokeDashArray): terminating 0.0 to\narray returned to user.</li>\n<li>magick/draw.c (DrawGetStrokeDashArray): Add terminating 0.0 to\narray returned to user.</li>\n</ul>\n</blockquote>\n<p>2013-11-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c (RenderFreetype): Support rendering UTF-8\n21-bit code points.  Was limited to 16-bit code points due to an\noversight/bug.  Resolves SourceForge bug &quot;#149 Rendering UTF-8\nencoded file displays wrong glyphs&quot;.</li>\n</ul>\n</blockquote>\n<p>2013-11-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ReadImage): Consistently initialize Image\npage width and height to image width and height. Resolves\nSourceForge bug #253 convert pdf output page is the wrong size\nwith -geometry &quot;100%&quot;.</li>\n</ul>\n</blockquote>\n<p>2013-11-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): TIFFDefaultStripSize() sometimes\nreturns zero so make sure that rows-per-strip is at least one to\navoid divide by zero error.  This bug was added in the current\ndevelopment cycle.</li>\n</ul>\n</blockquote>\n<p>2013-10-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update news since last release.</li>\n<li>magick/annotate.c (RenderFreetype): Support Johab, Latin-1, and\nLatin-2 encodings.</li>\n</ul>\n</blockquote>\n<p>2013-10-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/drawing_wand.c (DrawSetStrokeLineJoin): BevelJoin should\nproduce MVG text &quot;bevel&quot;.</li>\n<li>magick/draw.c (DrawSetStrokeLineJoin): BevelJoin should produce\nMVG text &quot;bevel&quot;.  Fixes SourceForge bug &quot;#245 error occured to\nDrawableStrokeLineJoin(LineJoin.BevelJoin)&quot;.</li>\n</ul>\n</blockquote>\n<p>2013-10-16  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added calls to png_set_benign_errors() to allow benign errors\nto be handled as warnings.  In particular, GM builds with libpng-1.6.x\nwill not crash while copying a PNG with a &quot;known incorrect ICC\nprofile&quot;.</li>\n</ul>\n</blockquote>\n<p>2013-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (NTGhostscriptEXE): Use gswin64c.exe as\nGhostscript executable name in a 64-bit application.</li>\n</ul>\n</blockquote>\n<p>2013-10-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (NTGhostscriptFind): 64-bit application should\nnot search for Ghostscript in 32-bit registry.  SourceForge bug\n#243 &quot;GM on Windows will find Ghostscript only if both are 32 bit&quot;</li>\n</ul>\n</blockquote>\n<p>2013-09-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c: As an extension to the standard PNM and PAM\nformats, support writing 32-bit sample depth in the Q32 build, and\nsupporting reading 32-bit sample depth in all builds.</li>\n</ul>\n</blockquote>\n<p>2013-09-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c: Allow reading signed integer TIFF files even\nthough internal storage uses signed integers.  Negative values\nwill be handled incorrectly and positive values will be scaled to\nonly 1/2 of the available unsigned range.  Perhaps the situation\nwill improve in the future.</li>\n<li>tests/rwfile_miff.tap: Test MIFF with specific depths.</li>\n<li>tests/rwblob.c: Add support for -quality option.</li>\n<li>tests/rwfile.c: Add support for -quality option.</li>\n<li>tests/rwfile.tap: Add tests for PGM and PPM ASCII subformats.</li>\n<li>coders/pnm.c (WritePNMImage): PGM &quot;P2&quot; format writer was broken\nat 8-bit depth due to lack of white-space between the output\nvalues.  Fixed now.</li>\n</ul>\n</blockquote>\n<p>2013-09-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Fixes to be able to read MIFF\nwritten by ImageMagick 6.X, including DirectClass grayscale\nimages.  Interoperabilty is not completely assured since\nImageMagick is not consistent with itself and may only be able to\nread the file it just wrote.  Reading DirectClass grayscale RLE\ncompressed images is not supported yet.</li>\n</ul>\n</blockquote>\n<p>2013-09-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/profile.c (MagickFreeCMSTransform): Only delete the CMS\ntransform if it is non-null.  If lcms returned a null transform,\nan assertion was thrown in lcms when the pointer was freed.\nProblem was reported by James Bardin.</li>\n</ul>\n</blockquote>\n<p>2013-09-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c: PseudoClass format was written incorrectly in\nthat sample storage size is supposed to be selected based on the\nsize of the colormap, but it was being selected based on the depth\nparameter instead, leading to excessively sized files and failure\nto read what was written.  RLE compressed formats had the sense of\nthe alpha channel inverted from the other compression methods, and\ncontrary to the specification.  PseudoClass with Alpha was not\nsupported at all, and reading a file claiming to be such caused an\nassertion to be thrown.  Note that these fixes may cause some\nexisting files to no longer be read correctly.</li>\n<li>coders/xpm.c (ReadXPMImage): XPM is rarely used to produce\n16-bit output.  Set image depth based on the colormap.</li>\n<li>coders/tim.c (ReadTIMImage): PSX TIM is not able to produce more\nthan 8-bit output, set image depth appropriately.</li>\n</ul>\n</blockquote>\n<p>2013-09-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Increase rows-per-strip as\nrequired to try to avoid more than 32K strips per image since some\nprograms seem to use a 16-bit strip counter and fail with more\nthan 32K strips.  Problem was reported by Kevin Myers.</li>\n<li>magick/transform.c (MosaicImages): Fix unsigned underflow\nproblem with -mosaic when page offset is negative and exceeds\nimage width or height.  This problem caused assertions, out of\nmemory errors, or pixel cache limit errors due to requesting an\nimage of outrageous size.</li>\n</ul>\n</blockquote>\n<dl class=\"docutils\">\n<dt>2013-08-26  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</dt>\n<dd>* dcrawdcraw.c Updated from autor\n* dcrawdcraw.c.patch</dd>\n</dl>\n<p>2013-08-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (ReadPNMImage): Fix SourceForge issue #237\n&quot;Incorrect MAXVAL scaling when reading PAM images&quot;.</li>\n</ul>\n</blockquote>\n<p>2013-08-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Improve error handling so that\nrendering bails on image access/update errors.  Resolves\nSourceForge issues #233 &quot;Another SVG that hangs GraphicsMagick&quot;\nand #232 &quot;Another SVG that hangs GraphicsMagick&quot;.  The resolution\nof the bug is to return from image access/update error right away\nrather than adjusting the rendering density to produce a smaller\nimage.</li>\n<li>magick/error.h: Hide exception throwing convenience macros under\nMAGICK_IMPLEMENTATION definition.</li>\n<li>Magick++/demo/demos.tap: Fix file naming for 'zoom' demos.</li>\n<li>magick/annotate.c (RenderFreetype): Improve error handling so\nthat rendering bails on image access/update errors.</li>\n</ul>\n</blockquote>\n<p>2013-08-02  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): ping a png faster by\nreturning the image without reading the pixel data.</li>\n</ul>\n</blockquote>\n<p>2013-07-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/xwindow.c (MagickXMakeImage): Only use ThumbnailImage()\nfor DirectClass images in order to avoid a crash while creating\nthe panner image.</li>\n</ul>\n</blockquote>\n<p>2013-04-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>design/pixel-cache-struct.dot: Update structure relationships\ndiagram.</li>\n<li>design/pixel-cache.dot: Update call flow diagram.</li>\n<li>magick/pixel_cache.c: Eliminate use of internal functions\nGetNexusIndexes(), GetNexusPixels().  Reduce usage of internal\nfunction IsNexusInCore().</li>\n</ul>\n</blockquote>\n<p>2013-04-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: MAGICK_SSIZE_T should always be a signed type.</li>\n<li>coders/jpeg.c (WriteXMPProfile): Add support for writing 'XMP'\nprofile in JPEG.\n(WriteJPEGImage): Restructure/tidy JPEG profile writing code.</li>\n</ul>\n</blockquote>\n<p>2013-04-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Return DirectClass images by\ndefault for MINISWHITE and MINISBLACK TIFF formats.</li>\n</ul>\n</blockquote>\n<p>2013-04-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c, magick/attribute.c, magick/map.c, magick/render.c,\nmagick/widget.c, magick/xwindow.c: Fixes to reduce warnings with\nGCC 4.8.0 at -O3 optimimization level, and for clang 3.2.</li>\n</ul>\n</blockquote>\n<p>2013-04-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/xwindow.c (MagickXMakeImage): Use ThumbnailImage() rather\nthan SampleImage() when creating the panner image to improve the\nquality of the image.</li>\n</ul>\n</blockquote>\n<p>2013-03-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (tag_table): Add support for SubjectArea EXIF\ntag.  Resolves SourceForge issue #229 &quot;Cannot Parse the\nSubjectArea EXIF Info&quot;.</li>\n</ul>\n</blockquote>\n<p>2013-03-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Hg.rst, www/index.rst: Update SourceForge Mercurial\nrepository location (see\n<a class=\"reference external\" href=\"http://hg.code.sf.net/p/graphicsmagick/code\">http://hg.code.sf.net/p/graphicsmagick/code</a>) due to project\n&quot;upgrade&quot;.  For the moment there are old and new\nrepositories. Changes will be pushed to the new repository.</li>\n</ul>\n</blockquote>\n<p>2013-03-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c (InitializeMagickResources): Revert use of\nomp_set_dynamic() since it caused a severe performance regression\nwhen doing a -stepthreads benchmark or when the number of OpenMP\nthreads is set via OMP_NUM_THREADS.</li>\n</ul>\n</blockquote>\n<p>2013-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>INSTALL-unix.txt: Add a section about building Windows binaries\nby cross-compiling from a Unix/Linux system.</li>\n</ul>\n</blockquote>\n<p>2013-03-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac, magick/magick_types.h.in: Fix issues noticed when\ncross-compiling with MinGW64.</li>\n</ul>\n</blockquote>\n<p>2013-03-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh, www/index.rst: Prepare for 1.3.18 release.</li>\n</ul>\n</blockquote>\n<p>2013-03-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (DisplayImageCommand): display is supposed to\nrespond to +/-usePixmap, but was not.  It was responding to\n+/-use_pixmap.  Now it responds to both.</li>\n</ul>\n</blockquote>\n<p>2013-03-03  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/GraphicsMagick.imdoc: Relocated some &lt;im&gt; .. &lt;/im&gt; tags, to\ninclude several paragraphs that were omitted from the\nGraphicsMagick man page (Environment, Configuration Files, and\nCopyright).</li>\n<li>doc/imdoc2man: the &lt;/pre&gt; tag was being deleted instead of\nreplaced with nothing, which caused the first line of the\nsubsequent material to be joined to the last line of the &lt;pre&gt;\nblock.</li>\n</ul>\n</blockquote>\n<p>2013-03-02  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Avoid a libpng16 warning about\nstoring unknown chunks.</li>\n</ul>\n</blockquote>\n<p>2013-02-25  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): Call png_set_bKGD(), etc.,\nafter png_set_IHDR() because they depend on members of info_ptr\nwhich are set by png_set_IHDR().</li>\n</ul>\n</blockquote>\n<p>2013-02-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c (InitializeMagickResources): Enable the\ndynamic adjustment of OpenMP threads if there is more than one\nthread available.</li>\n</ul>\n</blockquote>\n<p>2013-02-18  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac and configure: Check for libpng17 and libpng16.</li>\n</ul>\n</blockquote>\n<p>2013-02-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/programming.rst: Add mention of Clement Farabet's Lua\nscripting language wrapper for GraphicsMagick.</li>\n</ul>\n</blockquote>\n<p>2013-02-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (GetCacheNexus): Re-write function so it\nhas a single point of return.\n(AcquireCacheNexus): Reduce the number of return points.\n(SetCacheNexus): Re-write function so it has a single point of\nreturn.</li>\n</ul>\n</blockquote>\n<p>2013-02-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update with latest news.</li>\n<li>magick/export.c (ExportAlphaQuantumType): Fix export of alpha\nfor RGBA image and depth 8.  Due to typo, was exporting 16-bits\nrather than 8, causing output corruption or crashes.  Resolves\nissue reported in SourceForge GraphicsMagick forum under title\n&quot;CMYK per-channel byte order TIFF crashes gm&quot;.</li>\n</ul>\n</blockquote>\n<p>2013-02-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h (MagickIsBlank): Add macro to substitute for ISO\nC99 isblank() which is not globally available.  Update 'gm batch'\ncode which had substituted isspace() for isblank() to use it.</li>\n</ul>\n</blockquote>\n<p>2013-01-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (BatchCommand): Flush stdout at key points in\norder to ensure that user sees text when it is produced.</li>\n</ul>\n</blockquote>\n<p>2013-01-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/random.c (InitializeMagickRandomGenerator): Use\nMagickTsdKeyCreate2() in order to avoid a small memory leak.</li>\n<li>magick/tsd.c (MagickTsdKeyCreate2): New private function to\nsupport allocating a thread-specific data key with a specified\ndestructor function.  For single-threaded build, MagickTsdKey_t is\nnow type void* and there is provision to support the destructor\nfunction.</li>\n</ul>\n</blockquote>\n<p>2013-01-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (BatchCommand): New 'gm batch' command to\naccept one or more GraphicsMagick commands from a specified text\nfile, standard input, or CLI.  Feature is implemented by Kenneth\nXu.  Submitted via SourceForge Patch #3602331 &quot;Add interactive or\nbatch mode support to 1.3.17&quot;.</li>\n</ul>\n</blockquote>\n<p>2013-01-27  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): Added PNG48 and PNG64 support.\nAdded PNG00 support (png encoder that inherits its color-type and\nbit-depth from the input, if the input was a PNG datastream).</li>\n</ul>\n</blockquote>\n<p>2013-01-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): PNG8 support was using\nimage-&gt;colors to decide if the input image is PseudoClass.  This\nis totally bogus.  Use image-&gt;storage_class to determine if image\nis PseudoClass and quantize image colors if it is not.</li>\n<li>magick/delegate.c (InvokePostscriptDelegate): Only invoke\nMagickSpawnVP() if Ghostscript filename argument is non-empty.\nThis argument may be empty if Ghostscript is not found on a\nWindows system.  Report a &quot;Failed to find Ghostscript&quot; error if\nthe Ghostscript command name is empty. Resolves SourceForge issue\n#3601816 &quot;Win64 build crashes trying to convert PDF to any other\nformat&quot;.</li>\n<li>magick/utility.c (MagickSpawnVP): Verify that file argument is\nnon-NULL and not empty.</li>\n</ul>\n</blockquote>\n<p>2013-01-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/tiff/LIBRARY.txt: Fix pre-processor definitions for\nlibtiff so that they use multiple statements rather than one long\nstatement.  Resolves SourceForge issue 3601001 &quot;libtiff won't\ncompile with ICL&quot;.</li>\n</ul>\n</blockquote>\n<p>2013-01-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/memory.h (MagickAllocateAlignedArray): New macro to wrap\nuse of MagickMallocAlignedArray().</li>\n<li>magick/memory.c (MagickMallocAlignedArray): New private function\nto support safe allocation of an array in memory with a specified\nalignment.  Allocation may only be freed using MagickFreeAligned()\nand the allocation may not be reallocated.</li>\n</ul>\n</blockquote>\n<p>2013-01-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/{animate.c,display.c,utility.c}: Only invoke chdir() if\npath is not an empty string.  Previously sometimes chdir() was\npassed an empty string (because chdir() was not needed) and this\nwas ok because we ignored the error status.  Now that we check the\nchdir() error status, some X11 GUI functions (e.g. save file to\ncurrent directory) encounter annoying issues.</li>\n<li>magick/shear.c (IntegralRotateImage): Limit integral rotate to\ntwo threads.</li>\n<li>coders/pnm.c (ReadPNMImage): Limit PNM reader to two threads.</li>\n</ul>\n</blockquote>\n<p>2013-01-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac (MAGICK_FEATURES): MinGW static build does not\nbuild modules so MODULES feature should not be listed as\nsupported.  Resolves MinGW test failures.</li>\n<li>coders/dpx.c (OrientationTypeToDPXOrientation): Return U16 type\nas stored in DPX format.</li>\n<li>coders/cineon.c: Add support for reading/writing 'orientation'\nsetting.</li>\n<li>coders/mpc.c: Add support for reading/writing 'orientation'\nsetting.</li>\n<li>coders/miff.c: Add support for reading/writing 'orientation'\nsetting.</li>\n<li>Rotate ChangeLog for 2012 and update web page copyright years.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2014.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2014.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2014-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (UnpackWPGRaster): Fix some compilation and\nvalgrind warnings.</li>\n<li>NEWS.txt: Updated news again.</li>\n</ul>\n</blockquote>\n<p>2014-12-31 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Fixed 2bpp issue.</li>\n</ul>\n</blockquote>\n<p>2014-12-31  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Validate MHDR chunk length.</li>\n<li>coders/png.c: Use ReadBlob() once instead of ReadBlobByte()\nin a loop.</li>\n<li>coders/png.c: Avoid reading beyond the end of a tEXt keyword.</li>\n</ul>\n</blockquote>\n<p>2014-12-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (ReadXPMImage): Detect short XPM rows and report\nerror to user rather than overrunning a buffer.</li>\n<li>coders/pcx.c (ReadPCXImage): Validate that header bytes per line\nis sufficient to contain the indicated data.</li>\n<li>coders/pdb.c (ReadPDBImage): Fix indexes array overrun for 2 and\n4-bit PDB image files.</li>\n<li>coders/xpm.c (ReadXPMImage): Avoid strncpy() of overlapping\nmemory.  Fix memory leaks in error paths.</li>\n<li>coders/viff.c (ReadVIFFImage): Validate index before using it to\naccess colormap.</li>\n<li>coders/{cineon.c, dpx.c} (StringToAttribute): Can't use\nstrlcpy() to copy string which might not be NULL-terminated since\nstrlcpy() continues searching for end of string after size bytes\nhave been copied.</li>\n<li>coders/meta.c (convertHTMLcodes): Avoid strcpy() of overlapping\nmemory.</li>\n</ul>\n</blockquote>\n<p>2014-12-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/process.rst: Update description of development process to be\nmore aligned with the process actually used.</li>\n<li>coders/wpg.c (ReadWPGImage): Avoid use of NULL pointer returned\nfrom FlipImage(), FlopImage(), and RotateImage().</li>\n<li>coders/rle.c (ReadRLEImage): URT RLE reader is now more robust\nwith errant files.</li>\n</ul>\n</blockquote>\n<p>2014-12-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>libtool: Update bundled libtool to version 2.4.4.</li>\n<li>magick/constitute.c (WriteImage): Remove bogus use of\nGetBlobStatus() as a catch-all for write errors.  Coders should be\ndetecting write errors all by themselves.</li>\n</ul>\n</blockquote>\n<p>2014-12-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated with more improvements since previous release.</li>\n<li>coders/palm.c (WritePALMImage): Log header details.</li>\n<li>coders/pdb.c: PDB reader and writer need to be more robust when\ncalculating packets and buffer allocation.  Also log header\ndetails.  Problem was reported by Hanno Böck.</li>\n</ul>\n</blockquote>\n<p>2014-12-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated with more improvements since previous release.</li>\n<li>ttf: Update bundled Freetype to 2.5.4.</li>\n<li>png: Update bundled libpng to 1.6.16.</li>\n</ul>\n</blockquote>\n<p>2014-12-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): The libtiff JBIG coder only\nsupports strip images, and fails when scanlines are requested.\nForce use of stripped read method when the file uses JBIG\ncompression.  It is still not possible to write JBIG compressed\nTIFF files since there is not yet a strip writer.  Problem\nreported by Yuriy Kaminskiyon via the GM-bugs mailing list on\n2014-12-22.</li>\n</ul>\n</blockquote>\n<p>2014-12-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (QuantumTransferMode): Fix quantum transfer\nhandling for photometrics which might deliver one or three samples\nper pixel.  These were assuming that three samples were always\nprovided.</li>\n</ul>\n</blockquote>\n<p>2014-12-21  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Impose a 10-million limit on dimensions\nwhen reading a PNG file.</li>\n</ul>\n</blockquote>\n<p>2014-12-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated with improvements since previous release.</li>\n</ul>\n</blockquote>\n<p>2014-12-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/statistics.c (GetImageStatistics): Failed to compute\nstatistics for the Black channel of CMYK image files.  Problem\nreported by Michael Below via Debian bug 773552:\n&quot;graphicsmagick-imagemagick-compat: convert to cmyk leaves k\nchannel empty&quot;.</li>\n</ul>\n</blockquote>\n<p>2014-12-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/delegate.c (InvokeDelegate): Windows spawnvp() splits\narguments into more arguments.  Add escaping to avoid the\nsplitting.  Resolves SourceForge bug #276 &quot;dcraw 9.19 included\nwith gm 1.3.20 doesn't support paths with spaces.&quot;</li>\n<li>magick/utility.c (TranslateTextEx): Fix regression added on\n2014-12-13 (yesterday) which caused output file name passed to\ndelegate programs to be wrong.</li>\n<li>magick/annotate.c (RenderFreetype): Fix regression added in\n1.3.19 which caused spurious drawing errors to be produced while\nrendering with text when all of the text is off the left-hand side\nof the image.</li>\n</ul>\n</blockquote>\n<p>2014-12-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (CompareUsage): Options should be listed in\nalphabetical order.</li>\n<li>magick/annotate.c (RenderFreetype): Immediately quit processing\nand return an error if SyncImagePixels() reports a problem.</li>\n<li>coders/psd.c (ReadPSDImage): Return with an error right away if\nSetImageEx() (to create solid-color background canvas) reports a\nfailure.</li>\n<li>magick/annotate.c (AnnotateImage): Document all of the\nattributes which are supported.</li>\n<li>magick/utility.c (TranslateTextEx): Assure that attributes\nrequiring ImageInfo pointer are skipped.  AnnotateImage() does not\npass ImageInfo.  Also document all of the attributes which are\nsupported.</li>\n<li>doc/compare.imdoc: Compare documentation examples referred to\nnon-existing option -algorithm rather than the existing option\n-highlight-style.  Fixes SourceForge bug #286 &quot;docs are wrong\nabout <cite>-algorithm</cite> option of <cite>gm compare</cite>?&quot;.</li>\n<li>Magick++/lib/Magick++/Geometry.h (Magick): Re-implemented\nMagick++ Geometry to use bit-fields for booleans and used a union\nto reserve space for the future as well as to achieve the same\nsize as in the previous release.  Eliminated inline methods\nbecause they make it impossible to change the class internal\ndesign.  ABI was broken already when limitPixels() and fillArea()\nmethods were added on 2014-11-28.  Inline method instantiations in\nalready compiled applications will malfunction unless the\ndependent applications are re-compiled.</li>\n<li>magick/image.c (SetImageEx): Add a new version of SetImage()\ncalled SetImageEx() which reports exceptions to a provided\nexception parameter rather than into the image.</li>\n</ul>\n</blockquote>\n<p>2014-12-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colormap.c (AllocateImageColormap): Refuse to allocate a\ncolormap larger than MaxColormapSize.</li>\n<li>coders/psd.c (ReadPSDImage): Avoid extremely long execution time\nif the PSD colormap size is astonishingly large.  Problem was\nreported by Hanno Böck.</li>\n</ul>\n</blockquote>\n<p>2014-11-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c: Verify that DCM data is available before\nattempting to use it.  Avoids a crash due to improper DCM header.\nProblem was reported by Hanno Böck.\n(DCM_ReadNonNativeImages): Fix array over-run (off by one error)\nwhile looking for end of multi-fragment frames.</li>\n</ul>\n</blockquote>\n<p>2014-11-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sun.c: Thoroughly validate Sun Rasterfile headers and\nverify that there are no arithmetic overflows in buffer-size\ncalculations.  Problem was reported by Hanno Böck.</li>\n</ul>\n</blockquote>\n<p>2014-11-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Magick++/Geometry.h (Magick::Geometry): Add and\ndocument limitPixels() and fillArea() methods to support '&#64;' and\n'^' geometry qualifiers.  Fill area contributed by Long Ho and\nlimitPixels() by Bob Friesenhahn.</li>\n<li>www/Magick++/Image.rst: Document extent and resize methods.</li>\n<li>Magick++/lib/STL.cpp (extentImage): New function object to\ninvoke image extent method. Original implementation contributed by\nLong Ho.  Subsequently modified by Bob Friesenhahn.\n(resizeImage): New function object to invoke image resize\nmethod. Contributed by Long Ho.</li>\n<li>Magick++/lib/Image.cpp (extent): New method to place image on\nsized canvas of constant color using gravity.  Contributed by Long\nHo.\n(resize): New method to resize image specifying geometry, filter,\nand blur.  Original implementation contributed by Long Ho.\nSubsequently modified by Bob Friesenhahn.</li>\n</ul>\n</blockquote>\n<p>2014-11-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/avi.c: AVI support in GraphicsMagick is completely\nunusable and it could never compete with dedicated software like\n'ffmpeg'.  Removing AVI support until such time it can be\nsupported properly.</li>\n<li>coders/viff.c: Add protections against buffer overflow by\nverifying that buffer size allocation calculations do not\noverflow.  Also added header logging for read and write. Work\nperformed due to complaint by Hanno Böck.</li>\n</ul>\n</blockquote>\n<p>2014-11-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/common.h (MAGICK_NO_SANITIZE_ADDRESS): Add\nMAGICK_NO_SANITIZE_ADDRESS macro definition for disabling\nclang/GCC address sanitizer on a function if the need arises.</li>\n</ul>\n</blockquote>\n<p>2014-11-24  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadPNGImage): Do not attempt to clean up\na &quot;previous&quot; NULL PNG image.</li>\n</ul>\n</blockquote>\n<p>2014-11-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (ReadXWDImage): Add logging of XWD header values.\nFix memory leaks in error reporting paths.  Ping mode skips\nallocating memory for data and colormap.  Added a few more header\nvalidation checks (not complete).  XWD is put in\nUnstableCoderClass until such time as header validation checks are\ncomplete.</li>\n</ul>\n</blockquote>\n<p>2014-11-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdb.c (WritePDBImage): Use MagickAllocateArray() when\nallocating packets.</li>\n<li>coders/dpx.c (ReadDPXImage): Validate DPX header orientation and\nnumber of elements.  Problem was reported by Hanno Böck.</li>\n</ul>\n</blockquote>\n<p>2014-11-20  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadJNGImage): Do not attempt to clean up\na &quot;previous&quot; NULL JNG image.</li>\n</ul>\n</blockquote>\n<p>2014-11-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/FAQ.rst: Add a FAQ entry regarding what 'identify' reports.\nResolves SF issue #280 &quot;Better documentation for spurious gm\nidentify in Q8 compilation.&quot;</li>\n</ul>\n</blockquote>\n<p>2014-11-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enhance.c (ModulateImage): ModulateImage() should produce\na progress indication even if only the colormap is modified.</li>\n</ul>\n</blockquote>\n<p>2014-11-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/psd.c (ReadPSDImage): Patch by Cédric Demière to fix\n&quot;Memory allocation failed&quot; error when reading PSDs files which\nhave no layers.  Delivered via SF patch #41 &quot;PSD : files without\nlayers&quot;.  Resolves SF bug #242 &quot;Can not convert PSD to JPG or PNG\n(gm convert: Memory allocation failed)&quot;.</li>\n</ul>\n</blockquote>\n<p>2014-11-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/webp.c (WriteWEBPImage): WebP fix by Roman Hiestand to\nmake WebP lossless format truely lossless.</li>\n<li>tests/rwblob.tap (check_types): Added a test for WebP lossless.</li>\n<li>tests/rwfile.tap: Added a test for WebP lossless.</li>\n<li>tests/rwblob.c: Added support for -define.</li>\n<li>tests/rwfile.c: Added support for -define.</li>\n</ul>\n</blockquote>\n<p>2014-11-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>webp, VisualMagick/webp: Updated bundled WebP to 0.4.2 release.</li>\n</ul>\n</blockquote>\n<p>2014-11-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/tests/attributes.cpp: Add a simple test for\nImage::formatExpression().</li>\n<li>Magick++/lib/Image.cpp (formatExpression): Handle case where\nTranslateText() returns NULL.  Problem was reported by Dirk\nLemstra..</li>\n</ul>\n</blockquote>\n<p>2014-10-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Image.cpp (formatExpression): New method to format\na string based on a format similar to command-line -format.\nFeature was requested by Dirk Lemstra.</li>\n<li>magick/blob.c (BlobReserveSize): Don't throw an exception if\nposix_fallocate() fails since it seems that it is not supported\nfor all filesystem types, and is only intended for optimization.</li>\n<li>Magick++/lib/Image.cpp (resolutionUnits): Return resolution\nunits from Image if available, else return the value from\nImageInfo.  Issue was reported by Dirk Lemstra.</li>\n</ul>\n</blockquote>\n<p>2014-10-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (ReadPNMImage): Validate PGM, PPM, and PAM header\nMaxValue parameter.  Issue was reported by Hanno Böck.</li>\n<li>coders/pcx.c (ReadPCXImage): Fix for CVE-2014-8355, eliminate\nmemory leaks in error paths, and add PCX header logging.  Issue\nwas reported by Hanno Böck.</li>\n</ul>\n</blockquote>\n<p>2014-10-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/wand_symbols.h (MagickSetImageGamma): Fix typo in\nwand/wand_symbols.h.  Resolves SF bug #277.</li>\n</ul>\n</blockquote>\n<p>2014-10-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (TIFFIgnoreTags): Avoid warning about unused\nstrtol() return value on Linux.</li>\n<li>magick/random-private.h (&quot;C&quot;): Move random inlined\nimplementation bits to random-private.h, which is not installed,\nor used outside of the core C library.</li>\n</ul>\n</blockquote>\n<p>2014-09-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c (AnnotateImage): An empty text string should\nnot be treated as an error.  Resolves Debian bug 759956.</li>\n</ul>\n</blockquote>\n<p>2014-08-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c: Added a new define called tiff:ignore-tags that\ncan be used to ignore tags in 'corrupted' files with unknown and\ninvalid tags. Without this patch the file cannot be read and\nraises an error. Patch by Dirk Lemstra via SF patches #40.</li>\n<li>magick/type.c (ReadTypeConfigureFile): Support reading type\nconfiguration file from Windows resource. Patch by Dirk Lemstra\nvia SF patches #32.</li>\n<li>Magick++/lib/Magick++/STL.h: Fixed code analysis warning in\nSTL.h. Patch by Dirk Lemstra via SF patches #32.</li>\n<li>Magick++/lib/Magick++/Include.h: Autolink WebP in Visual\nStudio. Patch by Dirk Lemstra via SF patches #32.</li>\n</ul>\n</blockquote>\n<p>2014-08-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/psd.c (WritePSDImage): Fix small stack over-write if more\nthan 99 layers are written to PSD format.  Similar to\nCVE-2014-1947 for ImageMagick.  Changed layer naming to use at\nleast 4 digits.  Issue was brought to our attention by Rex Dieter\nand change is mostly based on his patch.</li>\n</ul>\n</blockquote>\n<p>2014-08-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enum_strings.c (StringToCompositeOperator): Support\ncomposite operator names similar to the major brand, without\nlosing any compatibility with previous naming.</li>\n</ul>\n</blockquote>\n<dl class=\"docutils\">\n<dt>2014-08-23  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</dt>\n<dd><ul class=\"first last simple\">\n<li>coders/png.c: Fixed handling of transparency when writing\nindexed PNG. Reference: SourceForge Bug tracker [bugs:#267]\nTransparency lost when converting from GIF to PNG.</li>\n</ul>\n</dd>\n</dl>\n<p>2014-08-17  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagickconfigureconfigure.cpp Remove webp when attempting\nto compile with Visual Studio 6.</li>\n</ul>\n</blockquote>\n<p>2014-08-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update for 1.3.20 release.</li>\n<li>www/index.rst: Update for 1.3.20 release.</li>\n<li>version.sh: Update library versioning for next release.</li>\n</ul>\n</blockquote>\n<p>2014-08-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>png: Updated libpng to 1.6.12 release.</li>\n<li>zlib: Updated zlib to 1.2.8 release.</li>\n</ul>\n</blockquote>\n<p>2014-08-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated NEWS file to document changes since previous\nrelease.</li>\n</ul>\n</blockquote>\n<p>2014-08-09  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n* coders/webp.c webp cannot be compiled when HasWEBP is not set.</blockquote>\n<p>2014-08-08  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Eliminated palette and depth optimization (see\n<a class=\"reference external\" href=\"https://sourceforge.net/p/graphicsmagick/feature-requests/35/\">https://sourceforge.net/p/graphicsmagick/feature-requests/35/</a>).</li>\n</ul>\n</blockquote>\n<p>2014-08-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>dcraw/dcraw.c: Fix dcraw build for x64 target when only WIN64 is\ndefined (by also defining WIN32).</li>\n<li>VisualMagick/configure/configure.cpp (write_file): Fix problem\nwith x64 project naming which caused object file disambiguation\nnot to work for x64 target. Make line terminations consistent.</li>\n</ul>\n</blockquote>\n<p>2014-08-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick: VisualMagick fixes by Dirk Lemstra to improve\nconfigure program so that it is possible to select QuantumDepth,\nOpenMP, and 64-bit build via configure dialog boxes as well as\noptions on the command line.  Also automatically detects and deals\nwith similarly named files in subdirectories so that WebP support\ncan now build successfully.  Resolves SF patches 31, 33, 35, 37,\nand 38.</li>\n</ul>\n</blockquote>\n<p>2014-07-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (NTResourceToBlob): Support loading mgk files\nas Windows resource from library if MagickLibName is defined.\nPatch contributed by Dirk Lemstra via SF patch #32.\n(NTGhostscriptDLL): For Microsoft Windows, add support for a\nMAGICK_GHOSTSCRIPT_PATH environment variable which specifies the\npath to Ghostscript.  If this environment variable is defined,\nthen the Windows registry is not used to find Ghostscript.  Patch\ncontributed by Dirk Lemstra via SF patch #39.</li>\n<li>magick/log.c: Added SetLogMethod() to allow an\napplication/library to specify a function to be called for\nlogging.  Patch contributed by Dirk Lemstra.</li>\n</ul>\n</blockquote>\n<p>2014-07-20  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c: &quot;opacity&quot; read from a BMP3 is actually &quot;alpha&quot;,\nso store q-&gt;opacity=MaxRGB-opacity instead of q-&gt;opacity=opacity.\nReference: Bug tracker [bugs:#271] Blank result for BMP resize.</li>\n</ul>\n</blockquote>\n<p>2014-07-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>webp, VisualMagick/webp: Integrate webp 0.4.0 into windows\nbuild.  May require manual renaming of output object files in\nproject files to build webp until VisualMagick configure is\nimproved!</li>\n</ul>\n</blockquote>\n<p>2014-07-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c: fmin() and fmax() are defined by C'99 and\nnot available everywhere, so add and use MagickFmin() and\nMagickFmax() to improve portability.</li>\n</ul>\n</blockquote>\n<p>2014-07-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Magick++/Image.h (Magick): Fix complilation errors\ncaused by continued raw use of __attribute__.</li>\n</ul>\n</blockquote>\n<p>2014-06-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c: Fixes by Brendan Lane for color channel\noverflows in modified/new quantum operators.  Fixes test suite\nresults for Q32 build and makes LinearBurn and LinearDodge work\ncorrectly at all.</li>\n<li>wand/pixel_wand.c (PixelSetMagenta): Fix documentation.\nResolves SourceForge bug #273 'Green Magenta' typo in docs.</li>\n</ul>\n</blockquote>\n<p>2014-06-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c: Composition improvements and additions\ncontributed by Brendan Lane via SourceForge patch #34 &quot;Most of the\nmissing Photoshop separable compositing operations&quot;\n(<a class=\"reference external\" href=\"https://sourceforge.net/p/graphicsmagick/patches/34/\">https://sourceforge.net/p/graphicsmagick/patches/34/</a>).  These\ncomposition operators were modified to include alpha in their\ncomputations: Difference, Darken, Lighten, HardLight, and these\noperators were added Overlay, Exclusion, ColorBurn, ColorDodge,\nSoftLight, LinearBurn, LinearDodge, LinearLight, VividLight,\nPinLight, HardMix.</li>\n</ul>\n</blockquote>\n<p>2014-06-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c (ScreenCompositePixels): Implementation of\nScreen composite contributed by Brendan Lane.  SourceForge patch\n#30 &quot;Missing Screen composite operation&quot;.</li>\n<li>wand/magick_compat.c: Re-worked Wand library implementation to\ndepend directly on GraphicsMagick library functionality rather\nthan using ImageMagick shim code from magick_compat.c and\nmagick_compat.h. The magick_compat.c source module becomes &quot;dead\ncode&quot;, which remains only to support the existing ABI, and will be\ndeleted at the next major ABI break point.</li>\n<li>magick/utility.c (MagickFormatString): New private function to\nformat a string into a buffer with a specified size.  Same as\npreviously existing FormatString() except requires a length\nargument.</li>\n</ul>\n</blockquote>\n<p>2014-06-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_compat.h: Use MAGICK_ATTRIBUTE definition from\nmagick/common.h.</li>\n<li>magick/common.h (MAGICK_ATTRIBUTE): Don't undefine __attribute__\nsince this may be used by system or compiler headers.  Define\nprivate macro instead.  Resolves SourceForge bug #270 &quot;Compile\nerror with g++ -std=c++11&quot;.</li>\n</ul>\n</blockquote>\n<p>2014-06-06  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Free png_pixels and\nquantum_scanline before error return.  Use &quot;png_error()&quot;\ninstead of &quot;ThrowException2()&quot; for errors occuring while\ndecoding a PNG so proper cleanup will happen.</li>\n</ul>\n</blockquote>\n<p>2014-06-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Make sure that libtiff warnings\nare promoted to errors for critical tags.</li>\n</ul>\n</blockquote>\n<p>2014-06-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Be quite a lot more draconian\nwhen retrieving the baseline standard TIFF tags we need in order\nto avoid consuming uninitalized data later.  An error with these\ntags will result in failure to read the image file.</li>\n</ul>\n</blockquote>\n<p>2014-05-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/operator.c: Decided that ThresholdBlackNegateQuantumOp\nand ThresholdWhiteNegateQuantumOp should set the result to white\nor black respectively rather than being based on subtraction.</li>\n</ul>\n</blockquote>\n<p>2014-05-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (AUTOMAKE_OPTIONS): Be ultra-pedantic with CPPFLAGS\nand include paths in order to assure that only required\ndirectories are supplied, and to avoid accidential collision with\nsystem header files.</li>\n</ul>\n</blockquote>\n<p>2014-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/operator.h (&quot;C&quot;): New quantum operators\nThresholdBlackNegateQuantumOp and ThresholdWhiteNegateQuantumOp.\nThese correspond to -operator &quot;Threshold-Black-Negate&quot; and\n&quot;Threshold-White-Negate&quot;.</li>\n</ul>\n</blockquote>\n<p>2014-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/composite.c (MultiplyCompositePixels): Multiply\ncomposition now uses SVG interpretation of how alpha should be\nhandled.  No longer does a simple multiply of alpha channel.\nBehavior change.  Patch contributed by Sara Shafaei.</li>\n<li>coders/msl.c (ProcessMSLScript): Deal with case where\nimage_info-&gt;attributes is NULL.</li>\n</ul>\n</blockquote>\n<p>2014-04-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (TranslateTextEx): Support additional format\nspecifiers 'g', 'A', 'C', 'D', 'G', 'H', 'M', 'O', 'P', 'Q', 'T',\n'U', 'W', 'X', and '&#64;'.\n(GetMagickGeometry): Support '&gt;' and '&lt;' qualifiers with '&#64;'\nqualifier to specify if image should be resized if larger or\nlesser than given area specification.  Resolves SourceForge bug\n#216 &quot;&gt;&quot; wont take effect when use &#64; to specify the maximum area.</li>\n<li>magick/transform.c (GetImageMosaicDimensions): Move mosaic\ndimensions code to a static function for possible future re-use.</li>\n</ul>\n</blockquote>\n<p>2014-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gradient.c (GradientImage): Update image is_grayscale and\nis_monochrome flags based on gradient color properties.</li>\n</ul>\n</blockquote>\n<p>2014-04-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetMagickGeometry): Deal with resize geometry\nmissing width or height (e.g. '640x' or 'x480') by substituting\nthe missing value with one which preserves the image aspect ratio.\nThis has been documented to be supported since almost the dawn of\nGraphicsMagick but was not actually supported until now.</li>\n</ul>\n</blockquote>\n<p>2014-04-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Document WebP encoder options.</li>\n<li>coders/webp.c (WriteWEBPImage): Support all of the WebP encoder\noptions via -define arguments.  Most of this work is contributed\nby Roman Hiestand.</li>\n<li>configure.ac: User-provided LIBS should be prepended to LIBS\nthat configure script produces so that user option takes\nprecedence.</li>\n</ul>\n</blockquote>\n<p>2014-04-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Added support for HardLight composition\noperator.</li>\n<li>www/perl.rst: Update PerlMagick documentation, including the\ncomposition operators.</li>\n<li>coders/xcf.c (GIMPBlendModeToCompositeOperator): Use new\nHardLight composition operator to support XCF GIMP_HARDLIGHT_MODE\nblend mode.  Contributed by Sara Shafaei.</li>\n<li>coders/psd.c (CompositeOperatorToPSDBlendMode): Use new\nHardLight composition operator to support PSD &quot;hLit&quot; blend mode.\nContributed by Sara Shafaei.</li>\n<li>wand/magick_wand.c (MagickOperatorImageChannel): New function to\napply an operator to an image channel.  Contributed by Sara\nShafaei.</li>\n<li>magick/composite.c (HardLightCompositePixels): New HardLight\ncomposition operator.  Contributed by Sara Shafaei.</li>\n</ul>\n</blockquote>\n<p>2014-04-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (BenchmarkImageCommand): Add a CSV title line\nand quoting to benchmark -rawcsv output.</li>\n</ul>\n</blockquote>\n<p>2014-04-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/webp.c: Add progress indication support to WebP writer.</li>\n<li>magick/command.c (VersionCommand): WebP support is included in\n-version output.</li>\n<li>coders/webp.c: WebP coder identifies library version and header\nABI versions. Improve WebP error reporting.</li>\n</ul>\n</blockquote>\n<p>2014-04-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Allow specifying the TIFF image\nsoftware tag.  In the special case that the string length is zero\n(e.g. -set software '') then the tag is skipped entirely.  This is\nto support SourceForge feature request #37 &quot;Option to prevent\naddition of Exif Software tag&quot; opened by Jean-Louis Grall.  Please\nnote that this tag is not an EXIF tag.</li>\n<li>magick/command.c: composite, convert, display, mogrify, and\nimport now support +set to remove an existing image attribute.</li>\n</ul>\n</blockquote>\n<p>2014-03-16  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Don't block threads when PNG_SETJMP_SUPPORTED is\nnot enabled.</li>\n<li>coders/png.c: Changed prefix of macros defined in coders/png.c\nfrom PNG_ to GMPNG_.  PNG_ is reserved for macros defined by\nlibpng.</li>\n</ul>\n</blockquote>\n<p>2014-03-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c: Don't use setvbuf() to set stdio block size if\nfilesystem block size is zero (e.g. MAGICK_IOBUF_SIZE=0)</li>\n</ul>\n</blockquote>\n<p>2014-03-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/{rwblob.tap, rwfile.tap}: Added tests for WEBP.</li>\n<li>tests/{rwblob.c, rwfile.c}: Add lossy hint for WEBP.</li>\n<li>coders/webp.c (WriteWEBPImage): Fix inverted return status.\nAdded a tiny bit of logging.</li>\n</ul>\n</blockquote>\n<p>2014-03-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ttf: Updated FreeType to release 2.5.3 of March 6, 2014.\nProvides security fixes for CVE-2014-2240.</li>\n<li>jpeg: Update to libjpeg 9a of 19-Jan-2014.</li>\n<li>png: Update to Libpng 1.6.10 - March 6, 2014.</li>\n</ul>\n</blockquote>\n<p>2014-03-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (NTResourceToBlob): According to Microsoft\nReport article 193678 (<a class=\"reference external\" href=\"http://support.microsoft.com/kb/193678\">http://support.microsoft.com/kb/193678</a>),\nFreeResource() is not needed in WIN32 and performs no useful\nfunction.  Remove use of it.  Also remove use of UnlockResource()\nwhich is similarly unuseful for WIN32.</li>\n<li>configure.ac (MAGICK_LIBRARY_REVISION): Test for Windows\n_aligned_malloc() is not reliable.  Use Windows CRT version to\ndecide if it is available.</li>\n</ul>\n</blockquote>\n<p>2014-03-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h: Make sure that Windows _aligned_malloc() is not\nused under MinGW unless the CRT version allows it.</li>\n</ul>\n</blockquote>\n<p>2014-02-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (InterpolateViewColor): Applied patch by\nTroy Patteson plus fixes to ignore opacity channel if image matte\nis false.  Replaces most of the code rewritten on 2014-02-16 and\nwhich produced a faint darkened border.  The results look stellar\nnow.</li>\n</ul>\n</blockquote>\n<p>2014-02-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c: Applied patch by Troy Patteson to improve\nnon-integral rotation by around 40% by minimizing added image\nborders.  This may cause small differences in results for some\nimages.</li>\n<li>reference/filter/Rotate10.miff: Update rotate 10 degrees\nreference image so that PerlMagick test passes.</li>\n<li>magick/shear.c: Applied patch by Troy Patteson to fix\nSourceForge issue #260 &quot;Rotation exhibits clipping/shearing errors\nfor short wide images at some angles&quot;.</li>\n</ul>\n</blockquote>\n<p>2014-02-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Fix documentation to note that 'unspecified\nalpha' is the GraphicsMagick default when writing TIFF rather than\n'associated alpha'.  Much thanks to Mats Peterson for alerting us\nof this error.</li>\n</ul>\n</blockquote>\n<p>2014-02-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (InterpolateViewColor): Added a hack so that\naffine transformations and displace composite do not have\nbackground colored fringing on the transferred image edges when\nthe background is completely transparent.  Fringing problem was\ncaused by one or more of the line ends being a transparent pixel\noutside of the bounds of the original image content.  May not be\nthe final solution.</li>\n</ul>\n</blockquote>\n<p>2014-02-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/semaphore.c (AcquireSemaphoreInfo): Document that this\nfunction was deprecated.\n(LiberateSemaphoreInfo): Document that this function was\ndeprecated.</li>\n</ul>\n</blockquote>\n<p>2014-02-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/psd.c (RegisterPSDImage): Set PSD to UnstableCoderClass\nsince its implementation is currently rather marginal.  It may\neven be that this coder deserves to be marked with the new\nBrokenCoderClass.  We are still looking for a volunteer to iron\nout the wrinkles in the PSD reader.</li>\n<li>magick/magick.h (CoderClass): Added BrokenCoderClass to mark\ncoders which often malfunction or are not very useful in their\ncurrent condition.  Sometimes there is still hope that problems\nwill be resolved and so the source file is not outright deleted.\nThis setting allows us to mark and use coders which might\nmalfunction by defining MAGICK_CODER_STABILITY=BROKEN in the\nenvironment while not causing danger for normal use.</li>\n</ul>\n</blockquote>\n<p>2014-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c: Documentation improvements for\nMagickSetInterlaceScheme() and MagickSetImageInterlaceScheme().\nResolves SourceForge bug #262 &quot;setImageInterlaceScheme doesn't\nmake image progressive&quot;.</li>\n</ul>\n</blockquote>\n<p>2014-02-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/{ps.c, ps2.c, ps3.c, pdf.c}: Only use resolution from\nimage or -density if units was properly specified.  Without units,\nresolution is worthless.</li>\n<li>coders/ps3.c (WritePS3Image): Use image resolution similar to PDF\nchanges.</li>\n<li>coders/ps2.c (WritePS2Image): Use image resolution similar to PDF\nchanges.</li>\n<li>coders/ps.c (WritePSImage): Use image resolution similar to PDF\nchanges.</li>\n<li>coders/pdf.c (WritePDFImage): Use resolution from image if it\nappears to be valid.  Resolves SourceForge issue #261 &quot;PNG Pixel\nDensity Not Preserved Converting to PDF&quot;.</li>\n<li>magick/enum_strings.c (StringToResolutionType): New function to\nconvert ResolutionType to C string.\n(ResolutionTypeToString): New function to convert from C string to\nResolutionType.</li>\n</ul>\n</blockquote>\n<p>2014-02-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickGetImageGeometry): New function to get\nthe image geometry string.  This function and the three others in\nthis change set are contributed by Sara Shafaei.\n(MagickGetImageMatte): New function to read the image matte\n(opacity) channel enable flag.\n(MagickSetImageGeometry): New function to set the image geometry\nstring.\n(MagickSetImageMatte): New function to set the image matte\n(opacity) channel enable flag.</li>\n</ul>\n</blockquote>\n<p>2014-01-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.c (MagickDrawImage): Remove development debug\nfprintf which causes each drawing primitive to be printed to\nstderr.</li>\n</ul>\n</blockquote>\n<p>2014-01-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (ReadPNMImage): Fix scaling of alpha in sub-ranged\npixels.  Addresses SourceForge issue #237 &quot;Incorrect MAXVAL\nscaling when reading PAM images&quot;, which was not fully fixed in by\nthe previous attempt.</li>\n</ul>\n</blockquote>\n<p>2014-01-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/tsd.c: Implement TSD for &quot;pure&quot; OpenMP mode without\nrelying on POSIX or WIN32 TSD APIs.</li>\n<li>magick/semaphore.c: Implement OpenMP-based locking so that code\ncan compile in a &quot;pure&quot; OpenMP mode without relying on POSIX or\nWIN32 locking APIs.</li>\n<li>configure.ac: --without-threads no longer disables use of\nOpenMP.  Use the already existing option --disable-openmp to\ndisable OpenMP.</li>\n</ul>\n</blockquote>\n<p>2014-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/common.h: Support use of clang/llvm __attribute__ and\n__builtin extensions similar to the existing support for GCC.</li>\n</ul>\n</blockquote>\n<p>2014-01-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Image.cpp (thumbnail): New method for fast image\nresizing, particularly to make thumbnails.</li>\n<li>coders/gif.c: Log when Netscape loop exension is read and\nwritten.</li>\n<li>coders/png.c (WriteOnePNGImage): In optimize mode, disable matte\nchannel immediately if there are no non-opaque pixels.  Also added\nsome useful logging.  Resolves SourceForge issue #252 &quot;convert an\n8bit PNG result in a corrupted image &quot;.</li>\n<li>wand/magick_wand.c (MagickSetImageGravity): New Wand method to\nset image gravity.\n(MagickGetImageGravity): New wand method to get image gravity.</li>\n</ul>\n</blockquote>\n<p>2014-01-02  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Use libpng function\npng_set_strip_16_to_8() when scaling 16-bit input PNG down to\n8-bit in a Q8 build.  The png_set_scale_16_to_8() function is\nmore accurate, but the slight difference causes reference tests\nto fail and causes unexpected difference between the behavior\nof PNG and other formats.  If png_set_strip_16_to_8() is not\nsupported in libpng, then we use png_set_scale_16_to_8() if\nthat is available.</li>\n</ul>\n</blockquote>\n<p>2014-01-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>INSTALL-windows.txt: Update for 2014.</li>\n<li>INSTALL-unix.txt: Update for 2014.</li>\n<li>Copyright.txt: Update for 2014.</li>\n<li>NEWS.txt: Update for 2014.</li>\n<li>README.txt: Update for 2014.</li>\n<li>doc: Update for 2014.</li>\n<li>www: Update for 2014.</li>\n<li>VisualMagick/installer: Update for 2014.</li>\n<li>ChangeLog: Rotate Changelog to ChangeLog.2013 for 2014.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2015.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2015.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2015-12-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ttf: Update bundled freetype to release 2.6.2.</li>\n<li>libxml: Update bundled libxml2 to release 2.9.3.</li>\n</ul>\n</blockquote>\n<p>2015-11-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>webp: Updated bundled libwebp to release 0.4.4.</li>\n<li>png: Updated bundled libpng to release 1.6.19.</li>\n</ul>\n</blockquote>\n<p>2015-11-05  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): Added &quot;volatile&quot; to\nseveral declarations to stop &quot;might be clobbered&quot; warnings.</li>\n</ul>\n</blockquote>\n<p>2015-11-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update NEWS for 1.3.23 release.</li>\n</ul>\n</blockquote>\n<p>2015-11-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (IdentifyImageCommand): Fix problem that\nidentify with -format &quot;%A&quot; does not always report correct answer\ndue to insufficient analysis of image.  Fixes SourceForge bug #326\n&quot;gm identify: transparency detection bug &quot;.</li>\n</ul>\n</blockquote>\n<p>2015-11-05  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): Restored a &quot;volatile&quot;\ndeclaration that was accidentally deleted on 2015-11-03.</li>\n</ul>\n</blockquote>\n<p>2015-11-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Add checks for 'ps2write' and 'eps2write' as\nGhostscript Postscript and Encapsulated Postscript\nwriters. Resolves issue reported to graphicsmagick-bugs mailing\nlist on 2015-11-01 entitled &quot;Failure to detect pswrite and\nepswrite Ghostscript devices&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-11-03  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadRawProfile): Issue a warning instead of\nan error when attempting to read a zero-length profile.</li>\n</ul>\n</blockquote>\n<p>2015-11-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h (MagickSleep): Provide the macro 'MagickSleep'\nto call a function which delays for one second.  No longer provide\na macro 'sleep' in WIN32 compiles.  Resolves issue reported to\ngraphicsmagick-bugs mailing list on 2005-11-01 entitled &quot;MinGW\nbuild error when sleep re#defined as Sleep&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-10-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/demo/demos.tap: Add zoom test cases to test resize to\noriginal dimensions, change height, and change width.</li>\n<li>magick/resize.c (ScaleImage): Fix regression introduced in\n1.3.22 release which results in pixel cache not open if the scale\nwidth and height match the original.  Patch by Troy Patteson.\nFixes part of SourceForge bug #323 &quot;ScaleImage() issues in\nv1.3.22&quot;.\n(ScaleImage): Fix double free problem when scaled rows equals\noriginal rows.  This regression was added in the 1.3.22 release\nvia changset 080b99bba574.  Based on patch by Troy Patteson.\nFixes remaining part SourceForge bug #323 &quot;ScaleImage() issues in\nv1.3.22&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-10-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Magick++/Image.rst (thumbnail): Paragraph heading fix.\nResolves SourceForge issue #321 &quot;find tiny error in\nMagick++/Image.html document&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-10-06  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>docs/*.imdoc: Changed synopses in manpages to add &quot;gm &quot;\nprefix to commands. Updated synopsis for &quot;convert&quot; to agree\nwith what's in the &quot;gm&quot; manpage.</li>\n</ul>\n</blockquote>\n<p>2015-10-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Remove CFLAGS and LDFLAGS deduplication code.\nResolves SourceForge bug #320 OS X &quot;universal build failure&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-10-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/index.rst: Updated for 1.3.22 release.</li>\n<li>NEWS.txt: Updated for 1.3.22 release.</li>\n</ul>\n</blockquote>\n<p>2015-09-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Brought up to date with changes thus far since last\nrelease.</li>\n<li>magick/blob.c (OpenBlob): Disable fflush() of read-only handle\nunder Microsoft Windows, which produced a spurious error status,\nblocking file reads for Visual Studio 2015 on Windows 2012 server.\nProblem was reported and diagnosed by Dirk Lemstra.</li>\n</ul>\n</blockquote>\n<p>2015-09-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff: Update bundled libtiff sources to 4.0.6 release.</li>\n<li>magick/module.c (InitializeModuleSearchPath): Fix compilation\nproblem when UseInstalledMagick is not defined.</li>\n</ul>\n</blockquote>\n<p>2015-09-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c: Static string/array allocations are now more\nconst.</li>\n<li>coders/{ps.c, ps2.c, ps3.c}: Static string/array allocations are\nnow more const.</li>\n<li>coders/palm.c: Palm static arrays should be 'const'.</li>\n<li>coders/meta.c (jpeg_embed): Stop sharing writeable static string\n'psheader'.\n(tag_spec): The 'tags' static array should be all 'const'.</li>\n<li>coders/jp2.c: Try to reduce the amount of non-const static data.</li>\n<li>coders/dcm.c (dicom_info): Try to make dicom_info array more\n'const'.</li>\n<li>coders/dpx.c: Eliminate use of static buffer strings.</li>\n<li>coders/png.c: Make MNG chunk id strings constant rather than\ninitialized data.</li>\n<li>magick/render.c (DrawAffineImage): Fix problem that sometimes\noutput rows are skipped when using OpenMP.  Problem identification\nand patch by Kevin Matzen.  Resolves SourceForge issue #316\n&quot;-affine sometimes produces output with missing rows&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-08-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwblob.tap: Add specific tests for BMP2 BMP3 subformats.</li>\n<li>tests/rwfile.tap: Add specific tests for BMP2 BMP3 PS2 PS3\nsubformats.</li>\n</ul>\n</blockquote>\n<p>2015-08-30  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<p>* magick/ImageMagick.rc Replace Imagemagick.ico by GraphicsMagick.ico</p>\n<p>* magick/Imagemagick.ico is no longer needed and not referenced anywhere.</p>\n</blockquote>\n<p>2015-08-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>README.txt: Fix SourceForge bug 314 &quot;README: bad hg clone URL&quot;.</li>\n<li>magick/module.c (GetModuleListForDirectory): Fix Coverity 107017\n&quot;Copy into fixed size buffer&quot; and 107013 &quot;Overlapping buffer in\nmemory copy&quot;.\n(UnloadModule): Fix SourceForge bug 312 &quot;uninitialized variable\n&quot;name&quot; in UnloadModule&quot;.</li>\n<li>coders/bmp.c (WriteBMPImage): Fix typo in fix on 2015-08-17.\nFixes Coverity 107014 &quot;Test should be assignment&quot;.</li>\n<li>magick/module.c (OpenModules): Fix Coverity 107016 &quot;Resource\nleak&quot;.\n(GetModuleListForDirectory): Fix Coverity 107015 &quot;Resource leak&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-08-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (WriteBMPImage): Fix inverted alpha channel when\nwriting BGRA8888 format.  Problem was reported by 张铎 via the\ngraphicsmagick-help discussion list on 2015-08-17.</li>\n</ul>\n</blockquote>\n<p>2015-08-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Verify that entry\npointer is within the metadata buffer in order to avoid buffer\noverflow.  Resolution and patch by Federico Larumbe.</li>\n<li>magick/profile.c (SetImageProfile): Avoid crash given NULL\nprofile pointer.  Resolution and patch by Federico Larumbe.</li>\n</ul>\n</blockquote>\n<p>2015-08-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Fix logic problem\nwhile validating EXIF GPS_OFFSET.  Problem reported by Federico\nLarumbe.</li>\n</ul>\n</blockquote>\n<p>2015-07-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Applied fix\n(<a class=\"reference external\" href=\"http://hg.code.sf.net/u/zacmorris/graphicsmagick/rev/edcc4c184b42\">http://hg.code.sf.net/u/zacmorris/graphicsmagick/rev/edcc4c184b42</a>)\nby Zac Morris to detect buffer overrun while reading zip\ncompressed data.\n(ReadMIFFImage): Fixed some memory leaks which were occuring when\nan exception was thrown from zip-compressed data reader.</li>\n</ul>\n</blockquote>\n<p>2015-07-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WritePTIFImage): Fix SourceForge issue #269\n&quot;Convert creates SubfileType 0x2 instead of 0x1&quot;.  From looking at\nthe code, this is a regression since the time support for the page\nsubfile type was added (probably via changeset 11831\n(037eef0f67f2) on 2007-08-17).</li>\n</ul>\n</blockquote>\n<p>2015-07-19  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>dcraw/dcraw.c: Fixed bad define WIN32.</li>\n</ul>\n</blockquote>\n<p>2015-07-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt, www/Hg.rst, www/index.rst: Applied English bugs patch\nby Amadu Jalloh.</li>\n<li>dcraw/dcraw.c: Add a port replacement for strnlen().</li>\n</ul>\n</blockquote>\n<p>2015-07-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/magick_wand.h: The declaration for MagickGetImageGravity()\nwas missing.  Resolves SourceForge bug #308 magick_wand.h misses\ndeclaration of MagickGetImageGravity.</li>\n</ul>\n</blockquote>\n<p>2015-07-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>dcraw: Update bundled dcraw to release 9.26.0.</li>\n<li>png: Updated bundled libpng to release 1.6.17.</li>\n<li>lcms: Update bundled lcms2 to release 2.7.</li>\n</ul>\n</blockquote>\n<p>2015-07-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Brought up to date with changes thus far since last\nrelease.</li>\n<li>magick/version.h.in (MagickCopyright): Update most recent\ncopyright year.</li>\n<li>magick/render.c (DrawAffineImage): Fix problem with negative x\noffset.  Resolves SourceForge issue #306 &quot;gm fails to convert svg\nto jpeg if svg has images with negative coordinates&quot;.</li>\n<li>magick/pixel_cache.c (ReadCachePixels): Add checks for integer\noverflows.</li>\n</ul>\n</blockquote>\n<p>2015-07-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/module.c (ModuleAliases): Add a module alias for GRAYA.</li>\n</ul>\n</blockquote>\n<p>2015-07-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/montage.c (MontageImages): Fix Coverity 101317 &quot;Resource\nleak&quot;.</li>\n<li>magick/blob.c: Limit the data size passed to the read/write\ncalls to the filesystem blocksize and make multiple calls if\nrequired.</li>\n<li>magick/pixel_cache.c: Limit the data size passed to the\nread/write, pread/prwite calls and make multiple calls if\nrequired.</li>\n</ul>\n</blockquote>\n<p>2015-07-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (WriteBlobFile): Properly handle short read. Read\ndata in units of filesystem block size.\n(BlobToFile): Write data in units of filesystem block size.</li>\n<li>patches: Added directory of patches which may be useful when\nintegrating new versions of 3rd-party programs or libraries into\nthe VisualMagick build.</li>\n<li>libxml: Re-applied libxml changes which were used in prior\nrelease.</li>\n</ul>\n</blockquote>\n<p>2015-07-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>webp: Updated bundled libwebp to release 0.4.3.</li>\n<li>ttf: Update bundled freetype to release 2.6.</li>\n<li>libxml: Update bundled libxml2 to release 2.9.2.</li>\n<li>tiff/VERSION: Update bundled libtiff to release 4.0.4.</li>\n<li>magick/nt_base.h (HAVE_TIFFISCODECCONFIGURED): Enable use of\nTIFFIsCODECConfigured in MSVC build.</li>\n<li>coders/tiff.c: I am too lazy to modify VisualMagick configure so\nit is possible to include jpeglib.h in tiff.c, so block out this\nlow-value code just for MSVC builds.</li>\n</ul>\n</blockquote>\n<p>2015-06-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac, magick/profile.c: Removed support for lcms 1.X.\nNo one should be using a lesser version than lcms 2.0.</li>\n</ul>\n</blockquote>\n<p>2015-06-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (DisassociateBlob): Applied patch by Dirk Lemstra\nto assure that the image blob is no longer shared with other\nimages when the image is written. This helps with thread safety.</li>\n</ul>\n</blockquote>\n<p>2015-06-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Add/fix utility usage messages for -box,\n-convolve, -gravity, -linewidth, -list, -mattecolor, -render and\n-shave.  Resolves SourceForge issue #302 &quot;MogrifyUsage prints\nincomplete information &quot;.</li>\n</ul>\n</blockquote>\n<p>2015-06-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Include JPEG headers to obtain\nits BITS_IN_JSAMPLE definition.  This is needed so we can know\nwhat JPEG depth libtiff supports.</li>\n<li>www/index.rst: Add mention of GraphicsMagick having zero defects\nreported by Coverity.</li>\n</ul>\n</blockquote>\n<p>2015-06-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/STL.cpp (adaptiveThresholdImage): Add a new\nconstructor which accepts a 'double' offset value.  The previous\nversion of this constructor is deprecated and subject to removal\nin the future.  The size of the class is enlarged to store a\n'double' and so this is a break in the ABI when this class was\nused.  Code using this class should be re-compiled.</li>\n<li>Magick++/lib/Image.cpp (adaptiveThreshold): Add a new version of\nthis method which accepts a 'double' offset value.  The previous\nversion of the method is deprecated and subject to removal in the\nfuture.  Problem was reported by Dirk Lemstra.</li>\n</ul>\n</blockquote>\n<p>2015-05-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gray.c (ReadGRAYImage): Based on feedback from Glenn,\nreturn a gray image from the reader, even if a channelized format\nspecifier is given.</li>\n</ul>\n</blockquote>\n<p>2015-05-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gray.c (ReadGRAYImage): Fix read glitch caused by\nincorrect memset(). Added missing break statement to switch.\nAdded more logging.\n(RegisterGRAYImage): Register &quot;gray&quot; formats R, G, B, C, M, Y, K,\nO such that they are not triggered by file extension.  It is\nnecessary to apply a magick prefix to the file name (or set image\nmagick in the API) in order to force using these formats.  This\navoids accidents in case the file extension was used for some\nother purpose.</li>\n</ul>\n</blockquote>\n<p>2015-05-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gray.c: Added support for &quot;GRAYA&quot; format.  Format\nspecifiers &quot;R&quot;, &quot;G&quot;, &quot;B&quot;, &quot;A&quot;, &quot;C&quot;, &quot;M&quot;, and &quot;Y&quot; may now be used\nto save and restore the associated channel using the same raw\nformat as &quot;GRAY&quot;.  These format specifiers were already supported\nbut did not appear to serve any useful function.</li>\n</ul>\n</blockquote>\n<p>2015-05-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Improve handling of libxml2 dependencies.  Only\ntest for and use libwmflite.  Full-up libwmf is no longer used.</li>\n<li>configure.ac: Deduplicate CFLAGS and LDFLAGS.</li>\n</ul>\n</blockquote>\n<p>2015-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): Eliminate a &quot;clobber&quot;\ncompilation warning.</li>\n<li>coders/jpeg.c (WriteJPEGImage): Eliminate a &quot;clobber&quot;\ncompilation warning.</li>\n<li>configure.ac: Don't compute libwmf2 and libxml2 linkage path\nbased on claimed installation prefix.  This is hoped to improve\nconfigure reliability on multi-arch type systems.</li>\n</ul>\n</blockquote>\n<p>2015-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Use the first -I, -L, and -l arguments produced by\nfreetype-config and don't produce arguments based on installation\nprefix.  This is hoped to improve configure reliability on\nmulti-arch type systems.</li>\n</ul>\n</blockquote>\n<p>2015-05-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/tempfile.c (AcquireTemporaryFileDescriptor): P_tmpdir is\nnot an environment variable.  Need to consider Windows environment\nvariables for Cygwin.</li>\n<li>magick/random.c (InitializeMagickRandomKernel): For Microsoft\nWindows, use CryptGenRandom() to salt the built-in random number\ngenerator.</li>\n</ul>\n</blockquote>\n<p>2015-05-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (MagickRandReentrant): Quiet Coverity 10092\n&quot;Calling risky function&quot;.\n(MagickRandNewSeed): Quiet Coverity 10093 &quot;Calling risky\nfunction&quot;.</li>\n<li>coders/tga.c (ReadTGAImage): Quiet Coverity 10201 &quot;Identical\ncode for different branches&quot;.</li>\n<li>coders/pcx.c (ReadPCXImage): Quiet Coverity 10218 &quot;Identical\ncode for different branches&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-05-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetGeometry): Fix handling of area geometries\nin the form &quot;5000000&#64;&quot;.  Resolves SourceForge issue #299 &quot;-resize\nwith &#64; and &gt; in geometry specification&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-05-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Disable matte channel for\ncompression types which don't support it.  Resolves SourceForge\nbug #297 &quot;GM distorts image using -transform&quot;.\n(WriteTIFFImage): When type is Optimize, disable matte channel if\nimage is opaque.</li>\n</ul>\n</blockquote>\n<p>2015-05-09  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>webp/src/utils/endian_inl.h: Fixed defect in intrinsic function\nbyteswap_ulong for Visual Studio less than 2005.</li>\n</ul>\n</blockquote>\n<p>2015-05-08  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/configure/system_page.cpp,\nVisualMagick/configure/system_page.h: Suppress reloading .vcproj\nwhen configuration type does not change.</li>\n</ul>\n</blockquote>\n<p>2015-05-08  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/configure/system_page.cpp,\nVisualMagick/configure/system_page.h,\nVisualMagick/configure/target_page.h: Ability to re-use already\ngiven paths. It is highly frustrating to enter path for different\nconfigurations again and again.</li>\n</ul>\n</blockquote>\n<p>2015-05-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/vid.c (ReadVIDImage): Fix use of uninitialized variable\nreported by MSVC 2003 (but not GCC, Clang, or Coverity).</li>\n</ul>\n</blockquote>\n<p>2015-05-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Fix possible leak of profiles in\nerror path.</li>\n<li>coders/mpc.c (ReadMPCImage): Fix memory leak of values\nallocation.\n(ReadMPCImage): Fix possible leak of profiles in error path. Fixes\nCoverity 80697 &quot;Resource leak&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-05-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Fix memory leak of values\nallocation.</li>\n</ul>\n</blockquote>\n<p>2015-05-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Hopefully quiet Coverity 10305\n&quot;Untrusted loop bound&quot;.</li>\n<li>coders/tga.c (ReadTGAImage): Hopefully quiet Coverity 53418\n&quot;Untrusted loop bound&quot;.</li>\n<li>magick/tempfile.c (AcquireTemporaryFileDescriptor): Eliminate\nall use of operating system provided temporary file allocation\nfunctions (all apparently flawed in one way or another) and rely\nexclusively on our own implementation.</li>\n<li>magick/constitute.c (ConstituteImage): Quiet Coverity 53399\n&quot;Logically dead code&quot;.</li>\n<li>coders/webp.c (ReadWEBPImage): Quiet Coverity 53400 &quot;Logically dead\ncode&quot;.</li>\n<li>coders/miff.c (WriteRunlengthPacket): More work to quiet\nCoverity 10186 and 10214 &quot;Missing break in switch&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-05-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/tempfile.c (AcquireTemporaryFileDescriptor): Thoroughly\nvet temporary file path.  Might quiet Coverity 64613 &quot;Use of\nuntrusted string value&quot;.</li>\n<li>wand/magick_compat.c (ParseGeometry): Another try at quieting\nCoverity 10248 &quot;Copy into fixed size buffer&quot; and 10078\n&quot;Overlapping buffer in memory copy&quot; in this dead code.</li>\n<li>magick/tempfile.c (AcquireTemporaryFileDescriptor): Remove\nunneeded, almost certainly never used, and potentially insecure\nuse of mkstemp().  Will quiet Coverity 10315 &quot;Insecure temporary\nfile&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Keep Ghostscript gibberish from appearing in\nConfigure output.</li>\n<li>coders/miff.c (WriteRunlengthPacket): Quiet Coverity 10186 and\n10214 &quot;Missing break in switch&quot;.</li>\n<li>magick/pixel_cache.c (GetCacheInfo): Quiet Coverity 10208 &quot;Data\nrace condition&quot;.</li>\n<li>magick/blob.c (CloneBlobInfo): Quiet Coverity 10188 &quot;Data race\ncondition&quot;.\n(GetBlobInfo): Quiet Coverity 10191 &quot;Data race condition&quot;.</li>\n<li>magick/image.c (AllocateImage): Quiet Coverity 10196 &quot;Data race\ncondition&quot;.\n(CloneImage): Quiet Coverity 10206 &quot;Data race condition&quot;.</li>\n<li>magick/map.c (MagickMapAllocateMap): Quiet Coverity 10192, 10193\nand 10228 &quot;Data race condition&quot;.</li>\n<li>configure.ac: Use an algorithm to try to discover the best value\nfor GSCMYKDevice.</li>\n<li>VisualMagick/bin/delegates.mgk: Recipe for 'gs-cmyk' contained a\ntypo which breaks using '-type ColorSeparation'.</li>\n<li>coders/pwp.c (ReadPWPImage): Fix Coverity CID 64491 &quot;Integer\nhandling issues&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (load_tile_rle): Quiet Coverity 10259 &quot;Untrusted\nloop bound&quot;.</li>\n<li>coders/sct.c (ReadSCTImage): Quiet Coverity 10285 &quot;Untrusted\nloop bound&quot;.</li>\n<li>coders/pwp.c (ReadPWPImage): Quiet Coverity 10299 &quot;Untrusted\nloop bound&quot;.</li>\n<li>coders/pcd.c (ReadPCDImage): Quiet Coverity 10301 &quot;Untrusted\nloop bound&quot;.</li>\n<li>coders/tga.c (ReadTGAImage): Quiet Coverity 53418 &quot;Untrusted\nloop bound&quot;.</li>\n<li>wand/magick_compat.c (ParseGeometry): Fix overlap strcpy() in\ndead code.  Quiets Coverity 10078 &quot;Overlapping buffer in memory\ncopy&quot; and 10248 &quot;Copy into fixed size buffer&quot;.</li>\n<li>magick/segment.c (Classify): Fix Coverity 64317 &quot;Resource leak&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (ReadXCFImage): Fix Coverity 64064 &quot;Resource leak&quot;.</li>\n<li>coders/txt.c (ReadTXTImage): Fix Coverity 64061 &quot;Resource leak&quot;.</li>\n<li>coders/rla.c (ReadRLAImage): Fix Coverity 64063 &quot;Resource leak&quot;.</li>\n<li>coders/dib.c (ReadDIBImage): Fix Coverity 64057 Resource leak&quot;.</li>\n<li>magick/segment.c (Classify): Fix Coverity 64056 &quot;Resource leak&quot;.</li>\n<li>magick/resize.c (SampleImage): Fix Coverity 64053, 64054, and\n64062 &quot;Resource leak&quot;.</li>\n<li>magick/render.c (TraceStrokePolygon): Fix Coverity 64055, 64059,\nand 64060 &quot;Resource leak&quot;.</li>\n<li>magick/magick.c (ListModuleMap): Quiet Coverity 64058 &quot;Resource\nleak&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-28  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c: Fix Coverity 10305 &quot;Untrusted loop bound&quot;.</li>\n<li>coders/cineon.c: Fix Coverity 10310 &quot;Untrusted loop bound&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/memory.c: All use of user-provided allocation functions\nis done via MagickFree(), MagickMalloc(), and MagickRealloc().</li>\n</ul>\n</blockquote>\n<p>2015-04-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colormap.c (MagickConstrainColormapIndex): For out of\nrange condition, specifically return 0 rather than setting index\nto zero, and then returning index.</li>\n<li>coders/pcx.c (ReadPCXImage): Fix Coverity 10197 &quot;Negative loop\nbound&quot;.</li>\n<li>coders/map.c (ReadMAPImage): Allocate pixels after return case\nfor 'ping' mode.\n(ReadMAPImage): Fix problem added in last commit due to multiple\nuses of 'packet_size'.</li>\n<li>magick/floats.c (_Gm_convert_fp16_to_fp32)\n(_Gm_convert_fp24_to_fp32): Fix Coverity 10094 &quot;Logically dead\ncode&quot;.</li>\n<li>coders/pcx.c (ReadPCXImage): Fix Coverity 10197 &quot;Negative loop\nbound&quot;.</li>\n<li>coders/wpg.c (UnpackWPG2Raster): Always test for EOF from\nReadBlobByte().  Should fix Coverity 10205 &quot;Negative loop bound&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcx.c (ReadPCXImage): Add some more integer-overflow\nsafety to computations.  Add some casts.</li>\n<li>coders/meta.c (formatIPTC): Fix Coverity 10221 &quot;Infinite loop&quot;.</li>\n<li>magick/attribute.c (GenerateEXIFAttribute): Fix Coverity 10320\n&quot;Untrusted array index read&quot; and &quot;Untrusted loop bound&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-24  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (ReadGIFImage): Attempt to fix Coverity issue\n10284 by using &quot;opacity = (header[3] &amp; 0xff)&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-23  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (ReadBlobMSBLong, ReadBlobLSBLong): Attempt\nto fix various &quot;tainted&quot; or &quot;untrusted&quot; variables\nby masking off all but the lower 32 bits returned.</li>\n</ul>\n</blockquote>\n<p>2015-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (ReadXCFImage): Fix Coverity 10216 &quot;Integer\noverflowed argument&quot;.</li>\n<li>magick/transform.c (FlipImage): Fix Coverity 61461 &quot;Division or\nmodulo by zero&quot;.</li>\n<li>coders/gif.c: Protect against integer overflow in array size\ncalculations.  Used unsigned type for colormap index.</li>\n</ul>\n</blockquote>\n<p>2015-04-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/map.c (ReadMAPImage): Maybe quiet Coverity 10326\n&quot;Untrusted pointer read&quot;.</li>\n<li>magick/utility.c (GlobExpression): See if testing for null\nterminating character quiets Coverity 10246 &quot;Untrusted value as\nargument&quot;.</li>\n<li>magick/transform.c (FlipImage): Possibly quiet case #4 of\nCoverity 10311 &quot;Untrusted value as argument&quot;.</li>\n<li>magick/utility.c (Base64Encode): Quiet Coverity 10296 and 10272\n&quot;Use of untrusted scalar value&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-22  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (ReadBlobMSBShort, ReadBlobLSBShort): Attempt\nto fix various &quot;tainted&quot; or &quot;untrusted&quot; variables, e.g., in\ncoders/gif.c and coders/sgi.c by masking off all but the lower\n16 bits returned.</li>\n</ul>\n</blockquote>\n<p>2015-04-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tim.c (ReadTIMImage): Make TIM reader more robust against\nEOF.</li>\n<li>coders/sct.c (ReadSCTImage): Make SCT reader more robust against\nEOF.</li>\n<li>coders/pwp.c (ReadPWPImage): Test loop for EOF.</li>\n<li>coders/otb.c (ReadOTBImage): Make error reporting a bit more\nrobust.</li>\n<li>coders/jnx.c (ExtractTileJPG): Add some EOF checks.</li>\n<li>coders/cut.c (ReadCUTImage): Limit width/height to range of\nsigned integer.</li>\n<li>tests/rwfile.tap: Add a R/W file test for ART.</li>\n<li>tests/rwblob.tap: Add a R/W blob test for ART.</li>\n<li>coders/art.c (ReadARTImage): Improve error checking.</li>\n</ul>\n</blockquote>\n<p>2015-04-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sun.c (ReadSUNImage): Try to quench Coverity 10280\n&quot;Untrusted loop bound&quot;.</li>\n<li>coders/mpc.c (ReadMPCImage): Port MIFF header reading fixes.</li>\n</ul>\n</blockquote>\n<p>2015-04-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): MIFF reader failed to read some\nMIFF headers properly.  Fixes SourceForge issue #298 &quot;invalid next\nsize (normal)/memory corruption&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-18  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Fix Coverity 55862 &quot;Resource leak&quot;\nand quiet Coverity 55825, 55826, and 55827 &quot;Data race condition&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GetToken): Fix an overlapping strlcpy() which\ncaused a crash in pedantic strlcpy() implementations while parsing\na SVG-style URL from text.  Several other issues remain.</li>\n</ul>\n</blockquote>\n<p>2015-04-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (ParseUnixCommandLine): Fix Coverity 59256\n&quot;Unused value&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/display.c (MagickXROIImage): Fix Coverity 10179 &quot;Missing\nbreak in switch&quot;.\n(MagickXCropImage): Fix Coverity 10211 &quot;Missing break in switch&quot;.</li>\n<li>magick/utility.c (Base64Decode): Fix Coverity 10203 &quot;Missing\nbreak in switch&quot;.\n(Tokenizer): Quench Coverity 10182 &quot;Missing break in switch&quot;.  Not\nbelieved to be an actual problem.</li>\n<li>magick/command.c (ParseUnixCommandLine): Fix Coverity 10174 and\n10178 &quot;Missing break in switch&quot;.\n(ProcessBatchOptions): Fix Coverity 10180 &quot;Missing break in\nswitch&quot;.\n(ParseWindowsCommandLine): Fix Coverity 10220 &quot;Missing break in\nswitch&quot;.</li>\n<li>coders/xwd.c (ReadXWDImage): Fix Coverity 10095 &quot;Division or\nmodulo by zero&quot;.  3rd try.</li>\n</ul>\n</blockquote>\n<p>2015-04-14  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Fix Coverity 55829 and 55846\n&quot;Resource leak&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/quantize.c (GrayscalePseudoClassImage): Fix Coverity\n55831 &quot;Resource leak&quot;.  2nd try.</li>\n<li>coders/vid.c (ReadVIDImage): Fix Coverity 55868 and 55874\n&quot;Resource leak&quot;.  2nd try.</li>\n</ul>\n</blockquote>\n<p>2015-04-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/psd.c (ReadPSDImage): Fix Coverity 55855 &quot;Resource\nleak&quot;. 2nd try.</li>\n<li>coders/pict.c (PictPixmapOp): Fix Coverity 55875 and 55883\n&quot;Resource leak&quot;. 2nd try.</li>\n<li>coders/pcx.c (WritePCXImage): Fix Coverity 55877 &quot;Resource\nleak&quot;. 2nd try.</li>\n<li>coders/meta.c (format8BIM): Fix Coverity 55842 &quot;Resource\nleak&quot;. 2nd try.</li>\n<li>coders/mat.c (WriteMATLABImage): Fix Coverity 55850 &quot;Resource\nleak&quot;. 2nd try.</li>\n<li>coders/dpx.c (ReadDPXImage): Fix Coverity 55878 &quot;Resource leak&quot;.\n2nd try.</li>\n<li>coders/preview.c (WritePreviewImage): Fix Coverity 55988\n&quot;Resource leak&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-12  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Avoid some memory leaks\nnewly reported by Coverity (work in progress)</li>\n</ul>\n</blockquote>\n<p>2015-04-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (ScaleImage): Fix Coverity 55824 &quot;Division or\nmodulo by float zero&quot;.</li>\n<li>magick/annotate.c (AnnotateImage): Fix Coverity 55863\n&quot;Uninitialized scalar variable&quot;.</li>\n<li>wand/magick_wand.c (MagickDrawImage): Fix Coverity 55828\n&quot;Resource leak&quot;.\n(MagickMontageImage): Fix Coverity 55835 &quot;Resource leak&quot;.</li>\n<li>wand/drawing_wand.c (DrawComposite): Fix Coverity 55849\n&quot;Resource leak&quot;.</li>\n<li>magick/widget.c (MagickXColorBrowserWidget): Fix Coverity 55854\n&quot;Resource leak&quot;.</li>\n<li>magick/resize.c (ScaleImage): Fix Coverity 55841, 55853, 55858,\nand 55860 &quot;Resource leak&quot;.</li>\n<li>magick/render.c (ConvertPathToPolygon): Fix Coverity 55836\n&quot;Resource leak&quot;.\n(DrawDashPolygon): Fix Coverity 55837 &quot;Resource leak&quot;.</li>\n<li>magick/quantize.c (GrayscalePseudoClassImage): Fix Coverity\n55831 &quot;Resource leak&quot;.</li>\n<li>magick/paint.c (ColorFloodfillImage): Fix Coverity 55886\n&quot;Resource leak&quot;.</li>\n<li>magick/map.c (MagickMapAddEntry): Possibly silence 55844\n&quot;Resource leak&quot;.</li>\n<li>magick/image.c (CloneImage): Fix Coverity 55833 &quot;Resource leak&quot;.</li>\n<li>magick/effect.c (BlurImage): Fix Coverity 55851 &quot;Resource leak&quot;.</li>\n<li>magick/display.c (MagickXAnnotateEditImage): Fix Coverity 55830\n&quot;Resource leak&quot;.\n(MagickXVisualDirectoryImage): Fix Coverity 55894 &quot;Resource leak&quot;.</li>\n<li>magick/constitute.c (ReadImages): Fix Coverity 55834 &quot;Resource\nleak&quot;.\n(ReadInlineImage): Fix Coverity 55843 &quot;Resource leak&quot;.</li>\n<li>magick/compress.c (HuffmanEncode2Image): Fix Coverity 55839\n&quot;Resource leak&quot;.\n(HuffmanDecodeImage): Fix Coverity 55859 &quot;Resource leak&quot;.</li>\n<li>magick/color.c (GetColorHistogram): Fix Coverity 55845 &quot;Resource\nleak&quot;.\n(ComputeCubeInfo): Fix Coverity 55857 &quot;Resource leak&quot;.</li>\n<li>coders/yuv.c (ReadYUVImage): Fix Coverity 55890 &quot;Resource leak&quot;.</li>\n<li>coders/wpg.c (UnpackWPG2Raster): Fix Coverity 55832 and 55848\n&quot;Resource leak&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/vid.c (ReadVIDImage): Fix Coverity 55868 &quot;Resource leak&quot;\n(ReadVIDImage): Fix Coverity 55874 &quot;Resource leak&quot;.</li>\n<li>coders/txt.c (ReadTXTImage): Fix Coverity 55866 &quot;Resource leak&quot;.</li>\n<li>coders/topol.c (ReadTOPOLImage): Fix Coverity 55865 &quot;Resource\nleak&quot;.</li>\n<li>coders/sgi.c (WriteSGIImage): Fix Coverity 55891 &quot;Resource leak&quot;.</li>\n<li>coders/psd.c (ReadPSDImage): Fix Coverity 55855 &quot;Resource leak&quot;.</li>\n<li>coders/pict.c (WritePICTImage): Fix Coverity 55867, 55875, 55883\n&quot;Resource leak&quot;.  Fix Coverity 55892 &quot;Resource leak&quot;.</li>\n<li>coders/pdb.c (ReadPDBImage): Fix Coverity 55840, 55856, and\n55885 &quot;Resource leak&quot;.</li>\n<li>coders/pcx.c (WritePCXImage): Fix Coverity 55877 &quot;Resource\nleak&quot;.</li>\n<li>coders/mvg.c (ReadMVGImage): Fix Coverity 55873 &quot;Resource leak&quot;.</li>\n<li>coders/mpeg.c (WriteMPEGImage): Fix Coverity 55880 &quot;Resource\nleak&quot;.</li>\n<li>coders/miff.c (WriteMIFFImage): Fix Coverity 55864 &quot;Resource\nleak&quot;.\n(WriteMIFFImage): Fix Coverity 55872 &quot;Resource leak&quot;.</li>\n<li>coders/meta.c (formatIPTCfromBuffer): Fix Coverity 55838\n&quot;Resource leak&quot;.\n(format8BIM): Fix Coverity 55842 and 55852 &quot;Resource leak&quot;.\n(formatIPTC): Fix Coverity 5882 &quot;Resource leak&quot;.</li>\n<li>coders/mat.c (ReadMATImage): Fix Coverity 55850 &quot;Resource leak&quot;.</li>\n<li>coders/map.c (ReadMAPImage): Fix Coverity 55876 &quot;Resource leak&quot;.</li>\n<li>coders/logo.c (ReadLOGOImage): Fix Coverity 55870 &quot;Resource\nleak&quot;.</li>\n<li>coders/label.c (ReadLABELImage): Fix Coverity 55869 &quot;Resource\nleak&quot;.</li>\n<li>coders/icon.c (ReadIconImage): Fix Coverity 55887 &quot;Resource\nleak&quot;.</li>\n<li>coders/fits.c (WriteFITSImage): Fix Coverity 55884 &quot;Resource\nleak&quot;.</li>\n<li>coders/dpx.c (WriteDPXImage): Fix Coverity 55861 &quot;Resource\nleak&quot;.\n(ReadDPXImage): Fix Coverity 55878 &quot;Resource leak&quot;.\n(ReadDPXImage): Fix Coverity 55879 &quot;Resource leak&quot;.</li>\n<li>coders/dib.c (WriteDIBImage): Fix Coverity 55881 &quot;Resource\nleak&quot;.\n(WriteDIBImage): Fix Coverity 55895 &quot;Resource leak&quot;.</li>\n<li>coders/cut.c (ReadCUTImage): Fix Coverity 55893 &quot;Resource leak&quot;.</li>\n<li>coders/caption.c (ReadCAPTIONImage): Fix Coverity 55888\n&quot;Resource leak&quot;.\n(ReadCAPTIONImage): Fix Coverity 55889 &quot;Resource leak&quot;.\n(ReadCAPTIONImage): Fix Coverity 55896 &quot;Resource leak&quot;.</li>\n<li>magick/annotate.c (RenderX11): Silence Coverity 10106 &quot;Logically\ndead code&quot;.</li>\n<li>coders/xcf.c: Silence Coverity 10224, 10233, and 10236 &quot;Improper\nuse of negative value&quot;.</li>\n<li>coders/mat.c (ReadMATImage): Silence Coverity 10175 &quot;Improper\nuse of negative value&quot;</li>\n<li>coders/tga.c (ReadTGAImage): Silence Coverity 10088 &quot;Operands\ndon't affect result&quot;.</li>\n<li>magick/annotate.c (RenderFreetype): Silence Coverity 14396 and\n44755 &quot;Unused value&quot;.</li>\n<li>coders/wpg.c (LoadWPG2Flags): Silence Coverity 10273 and 10253\n&quot;Unused value&quot;.</li>\n<li>magick/montage.c (MontageImages): Silence Coverity 10255 &quot;Unused\nvalue&quot;.\n(MontageImages): Silence Coverity 10264 &quot;Unused value&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-09  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Avoid using a NULL alpha_image\nor color_image. (ReadJNGImage): Removed an extraneous CloseBlob().</li>\n</ul>\n</blockquote>\n<p>2015-04-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (MagickCreateDirectoryPath): Silence Coverity\n10098 &quot;Logically dead code&quot;.</li>\n<li>magick/resource.c (InitializeMagickResources): Silence Coverity\n10101 &quot;Logically dead code&quot;.</li>\n<li>magick/magick.c (MagickSignalHandlerMessage): Fix Coverity 44725\n&quot;Logically dead code&quot;.</li>\n<li>magick/log.c (DestroyLogInfo): Silence Coverity 53659 and 53661\n&quot;Data race condition&quot;.\n(ReadLogConfigureFile): Silence Coverity 53660 &quot;Data race\ncondition&quot;.</li>\n<li>magick/effect.c (DespeckleImage): Fix error handling issue\ncaused by shadowed variable.  Fixes Coverity 10099 &quot;Logically dead\ncode&quot;.</li>\n<li>magick/command.c (TimeImageCommand): Fix Coverity 10097\n&quot;Logically dead code&quot;.</li>\n<li>magick/attribute.c (ReadMSBLong): Hopefully silence Coverity\n10276 &quot;Unintended sign extension&quot;.</li>\n<li>coders/sgi.c (ReadSGIImage, WriteSGIImage): Fix Coverity 10243,\n10244, 10247, 10254, and 10294 &quot;Unintended sign extension&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/xwindow.c (MagickXMakeImage): Quiet Coverity 10282\n&quot;Unused value&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Another change targeting\nCoverity 44742 and 44746 &quot;Unintended sign extension&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TracePath): Fix Coverity 10258 &quot;Uninitialized\nscalar variable&quot;.</li>\n<li>magick/widget.c (MagickXFontBrowserWidget): Fix Coverity 10323\n&quot;Sizeof not portable&quot;.  2nd try.</li>\n<li>coders/xwd.c (ReadXWDImage): Fix Coverity 10095, 10100, 10104\n&quot;Division or modulo by zero&quot;.  2nd try.</li>\n<li>magick/analyze.c (GetImageCharacteristics): Fix Coverity 10096\n&quot;Logically dead code&quot;.</li>\n<li>coders/yuv.c (ReadYUVImage): Fix Coverity 10260 &quot;Structurally\ndead code&quot;.</li>\n<li>coders/xcf.c (ReadXCFImage): Fix Coverity 10226 &quot;Missing break\nin switch&quot;.</li>\n<li>coders/tim.c (ReadTIMImage): Fix Coverity 10249 &quot;Unused value&quot;.</li>\n<li>coders/tiff.c (CompressionSupported): Fix Coverity 44723\n&quot;Logically dead code&quot;.\n(WriteTIFFImage): Fix Coverity 44742 and 44746 &quot;Unintended sign\nextension&quot;.</li>\n<li>coders/ps3.c (WritePS3Image): Validate results from TellBlob()\nand SeekBlob().  Should quiet Coverity 10198 &quot;Improper use of\nnegative value&quot;.</li>\n<li>coders/ps2.c (WritePS2Image): Validate results from TellBlob()\nand SeekBlob().  Should quiet Coverity 10230 &quot;Improper use of\nnegative value&quot;.</li>\n<li>coders/mpeg.c (WriteMPEGImage): Quiet Coverity 10176 &quot;Missing\nbreak in switch&quot;.</li>\n<li>coders/map.c (WriteMAPImage): Make MAP reader/writer more\nrobust.  May quiet 10326 &quot;Untrusted pointer read&quot;.</li>\n<li>coders/locale.c (ReadLOCALEImage): Quiet Coverity 10108\n&quot;Logically dead code&quot;.</li>\n<li>coders/rle.c: Make URT RLE reader more robust.  Should quiet\nCoverity CID 10070 &quot;Bad bit shift operation&quot;, as well as 10235\n&quot;Improper use of negative value&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-04-04  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOneJNGImage): Quiet Coverity CID issue 14370,\n&quot;Unused value&quot; (status was ignored).</li>\n<li>coders/png.c (ReadOneJNGImage): Quiet Coverity CID issue 44724,\n&quot;Logically dead code&quot; (skip_to_iend can't be true).</li>\n<li>coders/png.c (ReadOnePNGImage): Attempt to quiet Coverity\nCID 10232 &quot;Missing unlock&quot;, by using png_error() instead of\nthrowing an exception.</li>\n</ul>\n</blockquote>\n<p>2015-04-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (ReadXWDImage): Fix Coverity 10104 &quot;Division or\nmodulo by zero&quot;.</li>\n<li>magick/resize.c (ResizeImage): Fix Coverity 53404 &quot;Division or\nmodulo by zero&quot;.</li>\n<li>coders/ps3.c (WritePS3MaskImage): Fix Coverity 53415 &quot;Improper\nuse of negative value&quot;.</li>\n<li>coders/meta.c (parse8BIM): Fix Coverity 53413 &quot;Improper use of\nnegative value&quot;.\n(parse8BIMW): Fix Coverity 53414 &quot;Improper use of negative value&quot;.</li>\n<li>magick/utility.c (GetMagickGeometry): Fix Coverity 53403 and\n53405 &quot;Division or modulo by float zero&quot;.\n(GetPathComponent): Fix Coverity 53417 &quot;Wrong sizeof argument.</li>\n<li>magick/quantize.c (GrayscalePseudoClassImage): Fix Coverity\n10256 &quot;Wrong sizeof argument&quot;.</li>\n<li>magick/image.c (ResetImagePage): Fix Coverity 53401 &quot;Division or\nmodulo by float zero&quot; and 53402 &quot;Division or modulo by float\nzero&quot;.</li>\n<li>coders/histogram.c (WriteHISTOGRAMImage): Silence Coverity 10107\n&quot;Division or modulo by float zero&quot;.  2nd try.</li>\n<li>magick/xwindow.c (MagickXImportImage): Silence Coverity 10207\n&quot;Array compared against 0&quot;.</li>\n<li>magick/widget.c (MagickXColorBrowserWidget): Silence Coverity\n53406 &quot;Identical code for different branches&quot;.\n(MagickXListBrowserWidget): Silence Coverity 53407 &quot;Identical code\nfor different branches&quot;.</li>\n<li>magick/animate.c (MagickXMagickCommand): Silence Coverity 53410\n&quot;Identical code for different branches&quot;.</li>\n<li>coders/rgb.c (WriteRGBImage): Silence Coverity 53409 &quot;Identical\ncode for different branches&quot;.</li>\n<li>coders/cmyk.c (WriteCMYKImage): Silence Coverity 53408\n&quot;Identical code for different branches&quot;.</li>\n<li>magick/xwindow.c (MagickXMakeImage): Silence Coverity 44727\n&quot;Dereference after null check&quot;.  2nd try.</li>\n<li>magick/utility.c (EscapeString): Silence Coverity 53416\n&quot;Dereference before null check&quot;.</li>\n<li>coders/gif.c (WriteGIFImage): Fix Coverity 10219 &quot;Dereference\nnull return value&quot;.</li>\n<li>magick/log.c (InitializeLogInfo): Hopefully silence Coverity\n53411 and 53412 &quot;Data race condition&quot;.</li>\n<li>coders/cineon.c (AttributeToString): Silence Coverity 10079\n&quot;Buffer not null terminated&quot;.  2nd try.  The buffer is not\nrequired to be null terminated!</li>\n<li>coders/pict.c (ReadPICTImage): 10171 &quot;Resource leak&quot;.  2nd try.</li>\n<li>coders/wmf.c (util_set_brush): Silence Coverity 44739\n&quot;Out-of-bounds access&quot;.  2nd try.</li>\n</ul>\n</blockquote>\n<p>2015-03-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (SetLogEventMask): Silence Coverity 10069 &quot;Value\nnot atomically updated&quot;.  Logging initialization is done\nsingle-threaded entirely in InitializeLogInfo() now.</li>\n</ul>\n</blockquote>\n<p>2015-03-28  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Attempt to quiet Coverity\n44734 &quot;Data race condition&quot; by freeing mng_info-&gt;png_pixels\nand mng_info-&gt;quantum_scanline separately from MngInfoFreeStruct.</li>\n</ul>\n</blockquote>\n<p>2015-03-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/widget.c (XEditText): Silence Coverity 10072 &quot;Overlapping\nbuffer in memory copy&quot;</li>\n<li>coders/locale.c (ReadConfigureFile): Silence Coverity 10075\n&quot;Overlapping buffer in memory copy&quot;.</li>\n<li>magick/xwindow.c (MagickXMakeWindow): Silence Coverity 10076\n&quot;Overlapping buffer in memory copy&quot;.</li>\n<li>coders/dcm.c (funcDCM_TransferSyntax): Silence Coverity 10083\n&quot;Unchecked return value&quot;.</li>\n<li>magick/static.c (ExecuteStaticModuleProcess): Silence Coverity\n10082 &quot;Unchecked return value&quot;.</li>\n<li>coders/cals.c (ReadCALSImage): Silence Coverity 10086 &quot;Unchecked\nreturn value from library&quot;.\n(ReadCALSImage): Silence Coverity 10085 &quot;Unchecked return value&quot;.\n(ReadCALSImage): Silence Coverity 10084 &quot;Unchecked return value\nfrom library&quot;.</li>\n<li>magick/enhance.c (ModulateImage): Silence Coverity 10087\n&quot;Unchecked return value&quot;.</li>\n</ul>\n</blockquote>\n<p>2014-03-24  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n* coders/wpg.c More paranoa in checking ReadBlobByte() negative return.</blockquote>\n<p>2015-03-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (Generate8BIMAttribute): Silence Coverity\n10195 &quot;Argument cannot be negative&quot;.</li>\n<li>Magick++/lib/Image.cpp (syncPixels): Silence Coverity 44722\n&quot;Unchecked return value&quot;.\n(fontTypeMetrics): Silence Coverity 44721 &quot;Unchecked return\nvalue&quot;.</li>\n<li>magick/render.c (ConvertPathToPolygon): Silence Coverity 10120\n&quot;Dereference after null check&quot;.</li>\n<li>magick/effect.c (EmbossImage): Silence Coverity 10114\n&quot;Dereference after null check&quot;.\n(AdaptiveThresholdImage): Silence Coverity 10118 &quot;Explicit null\ndereferenced&quot;.</li>\n<li>coders/msl.c (MSLPushImage): Silence Coverity 10128 &quot;Dereference\nafter null check&quot;.</li>\n<li>magick/render.c (DrawPolygonPrimitive): Silence Coverity 10136\n&quot;Dereference after null check&quot;.</li>\n<li>wand/drawing_wand.c (DrawSetStrokeDashArray): Silence Coverity\n10117 &quot;Dereference after null check&quot;.</li>\n<li>magick/draw.c (DrawSetStrokeDashArray): Silence Coverity 10150\n&quot;Dereference after null check&quot;.</li>\n<li>wand/drawing_wand.c (DrawPushGraphicContext): Silence Coverity\n10151 &quot;Dereference after null check&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-03-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c (parse8BIM): Silence Coverity 10159 &quot;Explicit null\ndereferenced&quot;.\n(parse8BIMW): Silence Coverity 10144 &quot;Explicit null dereferenced&quot;.</li>\n<li>coders/uil.c (WriteUILImage): Silence Coverity 10202\n&quot;Dereference after null check&quot;.  In fact, UIL output was not\nworking at all due to this bug.</li>\n<li>magick/xwindow.c (MagickXMakeImage): Silence Coverity 44727\n&quot;Dereference after null check&quot;.</li>\n<li>Magick++/lib/Image.cpp (colorMapSize): Silence Coverity 44728\n&quot;Dereference after null check&quot;.</li>\n<li>coders/vid.c (ReadVIDImage): Silence Coverity 44730 &quot;Explicit\nnull dereferenced&quot;.</li>\n<li>coders/mpc.c (ReadMPCImage): Silence Coverity 44732 &quot;Dereference\nafter null check&quot;.</li>\n<li>Magick++/lib/Image.cpp (signature): Silence Coverity 44735\n&quot;Dereference null return value&quot;.</li>\n<li>coders/ps.c (ReadPSImage): Ghostscript options concatenation\nshould be more secure against buffer overflow.</li>\n<li>coders/pdf.c (ReadPDFImage): Applied patch by Chris Gilling such\nthat '-define pdf:stop-on-error=true' will stop PDF processing\nimmediately upon an error.\n(ReadPDFImage): Ghostscript options concatenation should be more\nsecure against buffer overflow.</li>\n</ul>\n</blockquote>\n<p>2015-03-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/animate.c (MagickXAnimateImages): Silence Coverity 44736\n&quot;Dereference null return value&quot;.  Also fixed apparent memory leak\nthat Coverity did not notice.</li>\n<li>coders/fits.c (ReadFITSImage): Silence Coverity 10209\n&quot;Dereference before null check&quot;.</li>\n<li>magick/color_lookup.c (ReadColorConfigureFile): Silence Coverity\n44743 &quot;Dereference before null check&quot;.</li>\n<li>magick/xwindow.c (MagickXMakeImage): Silence Coverity 44745\n&quot;Dereference before null check&quot;.</li>\n<li>coders/pict.c (ReadPICTImage): Hopefully address consequences of\nCoverity 10292 &quot;Untrusted loop bound&quot; although it will likely\nstill complain.</li>\n<li>magick/utility.c (LocaleCompare, LocaleNCompare): Try to create\nan implementation that Coverity won't label an &quot;tainted sink&quot;, and\ntherefore result in a Coverity &quot;Use of untrusted scalar value&quot;\nreport whenever a string from an external source is compared.  The\noriginal implementations are not believed to be faulty.</li>\n</ul>\n</blockquote>\n<p>2015-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (ProcessBatchOptions): Silence Coverity 10080\n&quot;Buffer not null terminated&quot;.</li>\n<li>magick/widget.c (MagickXConfirmWidget): Silence Coverity 10089\n&quot;Copy-paste error&quot;.  This is an amazing find by Coverity.</li>\n<li>magick/xwindow.c (MagickXImportImage): Silence Coverity 10207\n&quot;Array compared against 0&quot;.</li>\n<li>magick/quantize.c (GrayscalePseudoClassImage): Silence Coverity\n10256 &quot;Wrong sizeof argument&quot;.</li>\n<li>coders/tiff.c (ReadTIFFImage): Fix Coverity 44747 and 44748\n&quot;Extra sizeof expression&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-03-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Magick++/Include.h (Magick): Fix compilation with\n'clang' under Linux.  Build was broken yesterday.</li>\n<li>coders/tiff.c (QuantumTransferMode): Fix reading Old JPEG and\nYCbCr sample images from libtiff pics-3.8.0.tar.gz image file\ncollection.  There was a regression for YCbCr added in last\nrelease.</li>\n</ul>\n</blockquote>\n<p>2015-03-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Fix Coverity 44726 &quot;Division or\nmodulo by float zero&quot;.  I don't think that this can actually\nhappen due to prior checks.</li>\n<li>magick/xwindow.c (MagickXMakeWindow): Silence Coverity 10281\n&quot;Copy into fixed size buffer&quot;.</li>\n<li>coders/pdf.c (ReadPDFImage): Silence Coverity 10241 &quot;Copy into\nfixed size buffer&quot;.</li>\n<li>magick/type.c (ReadTypeConfigureFile): Silence Coverity 10242\n&quot;Copy into fixed size buffer&quot;.</li>\n<li>magick/utility.c (GetPathComponent): Silence Coverity 10263\n&quot;Copy into fixed size buffer&quot;.</li>\n<li>coders/txt.c (ReadTXTImage): Silence Coverity 10287 &quot;Copy into\nfixed size buffer&quot;.</li>\n<li>coders/ps.c (WritePSImage): Silence Coverity 10289 &quot;Copy into\nfixed size buffer&quot;.</li>\n<li>magick/delegate.c (ReadConfigureFile): Silence Coverity 10297\n&quot;Copy into fixed size buffer&quot;.</li>\n<li>magick/log.c (ReadLogConfigureFile): Silence Coverity 10300\n&quot;Copy into fixed size buffer&quot;.</li>\n<li>coders/ps3.c (WritePS3Image): Silence Coverity 10303 &quot;Copy into\nfixed size buffer&quot;.</li>\n<li>coders/pdf.c (WritePDFImage): Silence Coverity 10304 &quot;Copy into\nfixed size buffer&quot;.</li>\n<li>coders/ps.c (ReadPSImage): Silence Coverity 10306 &quot;Copy into\nfixed size buffer&quot;.</li>\n<li>coders/msl.c (MSLStartElement): Silence Coverity 10308 &quot;Copy\ninto fixed size buffer&quot;.</li>\n<li>coders/ps2.c (WritePS2Image): Silence Coverity 10309 &quot;Copy into\nfixed size buffer&quot;.</li>\n<li>Magick++/lib/Geometry.cpp (operator): Silence Coverity 44749\n&quot;Copy into fixed size buffer&quot;.</li>\n<li>Magick++/lib/Image.cpp (annotate): Silence Coverity 44750 &quot;Copy\ninto fixed size buffer&quot;.</li>\n<li>coders/ept.c (ReadEPTImage): Silence Coverity 44751 &quot;Copy into\nfixed size buffer&quot;.</li>\n<li>coders/wmf.c (ipa_device_begin): Silence Coverity 44753 &quot;Copy\ninto fixed size buffer&quot;.\n(lite_font_map): Silence Coverity 44752 &quot;Copy into fixed size\nbuffer&quot;.</li>\n<li>magick/random.c (InitializeMagickRandomKernel): Silence Coverity\n10091 &quot;Don't Call&quot; in the case where /dev/random is available.</li>\n<li>coders/mpeg.c (WriteMPEGParameterFiles): Fix Coverity 10190\n&quot;Resource leak&quot;.  File descriptor was leaked under certain error\nconditions.</li>\n<li>coders/wpg.c (UnpackWPG2Raster): Fix Coverity 10312\n&quot;Uninitialized scalar variable&quot; gripe.</li>\n<li>magick/utility.c (ListFiles): Possibly address\nCoverity 10245 &quot;Sizeof not portable&quot; gripe.</li>\n<li>magick/widget.c (MagickXFontBrowserWidget): Possibly address\nCoverity 10323 &quot;Sizeof not portable&quot; gripe.</li>\n<li>coders/mat.c (WriteMATLABImage): FormatString() requires a\nbuffer of MaxTextExtent bytes.  Use sprintf instead.  Fix for\nCoverity issue 10170.</li>\n<li>Magick++/lib/Geometry.cpp (string): FormatString() requires a\nbuffer of MaxTextExtent bytes. Fix for Coverity issue 44737.</li>\n<li>coders/wmf.c (draw_pattern_push): FormatString() requires a\nbuffer of MaxTextExtent bytes.  Fix for Coverity issue 44741.\n(ipa_device_begin): FormatString() requires a buffer of\nMaxTextExtent bytes.  Fix for Coverity issue 44740.\n(util_set_brush): FormatString() requires a buffer of\nMaxTextExtent bytes. Fix for Coverity issue 44739.\n(ipa_region_clip): FormatString() requires a buffer of\nMaxTextExtent bytes. Fix for Coverity issue 44738.</li>\n</ul>\n</blockquote>\n<p>2015-03-15  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WritePNGImage) Avoid a Coverity gripe about\npotential NULL dereference (actually it is impossible because\npng_error() does not return. Fix for Coverity gripe 44731.</li>\n<li>coders/png.c (WritePNGImage) Avoid a null pointer dereference\nwhile logging inherited color_type. Fix for Coverity issue 10185.</li>\n<li>coders/png.c (WriteOneJNGImage) Avoid possible unintended sign\nextension. Fix for Coverity issue 44744.</li>\n<li>coders/png.c (WriteOnePNGImage) Quiet a false Coverity warning\nabout dereference after NULL check.  Fix for Coverity issue 44729.</li>\n<li>coders/png.c (ReadOnePNGImage): Redid the &quot;Respect the\nPixelsResource limit&quot; patch of March 7, using unsigned arithmetic\nto determine the width limit.  Sometimes the calculated\nwidth limit was incorrectly zero.</li>\n</ul>\n</blockquote>\n<p>2015-03-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): Fix problems with reading\nfilenames that include a colon.  Resolves SourceForge bug #294\n&quot;display and convert (probably other things too) choke on\nfilenames with colons in&quot;.</li>\n<li>magick/utility.c (GetPathComponent): Fix SubImagePath\nextraction. Fixes SourceForge bug #66 &quot;converting runs slowly when\nsubimage is specified&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-03-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc (-geometry): Document the significance of 'x'\nas used in a geometry specification.  In particular, document that\nif width is specified without a trailing 'x' that height is set to\nwidth.  This is in response to SourceForge bug #296 &quot;Strange\n-resize WIDTH results with version 1.3.21&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-03-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (GlobExpression): Remove use of IsSubimage().</li>\n<li>magick/image.c (IsSubimage): Re-implement with a more robust\nsolution.  Combined with fixes to ps.c and pdf.c, allows selecting\nspecific pages, as well as re-ordering.</li>\n<li>coders/ps.c (ReadPSImage): Set image frame scene ids\nappropriately.</li>\n<li>coders/pdf.c (ReadPDFImage): Set image frame scene ids\nappropriately.</li>\n<li>magick/utility.c (TranslateTextEx): -format %Q should report\nJPEG quality estimate if it is available.  Resolves SourceForge\nbug #293 &quot;gm identify bug?&quot;.</li>\n<li>doc/options.imdoc: Documented JPEG-specific -format tags.</li>\n</ul>\n</blockquote>\n<p>2015-03-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Image.cpp (repage): New method to reset page\nsettings.  Contributed by Dirk Lemstra.</li>\n</ul>\n</blockquote>\n<p>2015-03-07  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Respect the PixelsResource\nlimit.</li>\n<li>coders/png.c (ReadOnePNGImage): Moved quantum_scanline\nand png_pixels into the MngInfo struct.  This prevents\nmemory leaks when reading malformed PNG images, but unfortunately\ntriggers a new complaint about a possible race condition.</li>\n<li>coders/png.c (ReadOnePNGImage): Removed two superflous calls to\nCloseBlob().</li>\n<li>coders/png.c (ReadOnePNGImage): Do the allocation and free of\nquantum_scanline outside the &quot;pass&quot; loop, i.e., do it once per\nimage rather than once per pass while decoding interlaced PNG\nimages.  Log these when -debug coders is enabled.</li>\n<li>coders/png.c: Fixed typo recently introduced in the JNG reader\n(status != MagickFalse should be status == MagickFalse).</li>\n</ul>\n</blockquote>\n<p>2015-03-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (ReadXWDImage): Fix memory leaks in error paths.</li>\n<li>coders/xpm.c (ReadXPMImage): Fix memory leaks in error paths.</li>\n<li>coders/miff.c (ReadMIFFImage): Fix memory leak of Image in error\ncase.\n(ReadMIFFImage): Fix memory leaks of zlib and bzlib2 context in\nerror path which reports decompression failure.</li>\n<li>coders/bmp.c (ReadBMPImage): BMP reader was wrongly rejecting\nRLE-compressed files as being too small.  Fixes SourceForge bug\n#295 &quot;1.3.21 identify regression&quot;.  Also fixed 'ping' support code\nwhich was still reading the pixels in 'ping' mode.\n(ReadBMPImage): Fix memory leak when BMP is handled as a sequence.</li>\n</ul>\n</blockquote>\n<p>2015-03-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/palm.c (ReadPALMImage): PALM reader now applies PALM's\nspecial non-linear colormap if the file does not provide a custom\ncolormap.  Custom colormap size is verified to not exceed image\ncolors.  Added logging statements regarding colormap.</li>\n</ul>\n</blockquote>\n<p>2015-02-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/index.rst: Update for 1.3.21 release.</li>\n<li>www/Changes.rst: Update for 1.3.21 release.</li>\n<li>NEWS.txt: Update NEWS for 1.3.21 release.</li>\n<li>version.sh: Bump/adjust library versioning.</li>\n</ul>\n</blockquote>\n<p>2015-02-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/delegate.c: Fix compilation under Cygwin. Thanks to Marco\nAtzeri for advising us of this problem.</li>\n</ul>\n</blockquote>\n<p>2015-02-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/error.h (ThrowReaderException): More significant\nexceptions (e.g. errors) should overwrite less significant\nexceptions (e.g. warnings) thrown earlier.</li>\n<li>coders/bmp.c (ReadBMPImage): Detect 32-bit integer overflows and\nother annoyances caused by intentionally broken files.  Also, only\nwarn if the file header claims the file is larger than it is since\nthis is a benign issue.</li>\n<li>magick/blob.c (OpenBlob): Fix &quot;magic header bytes&quot; log message\ncount value.</li>\n</ul>\n</blockquote>\n<p>2015-02-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated NEWS with more changes.</li>\n<li>Magick++/lib/Magick++/Include.h (Magick): Add GetImageGeometry\nto MagickLib namespace in order to avoid a compilation problem\nnoticed with Visual C++ 6.0.</li>\n</ul>\n</blockquote>\n<p>2014-02-22  Jaroslav Fojtik  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>VisualMagickconfigureconfigure.cpp Fixed crash.</dt>\n<dd>Renamed debug to configure_d.exe to prevent mess.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2015-02-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (InitializeMagick): Invoke\nNTInitializeExceptionHandlers() under Windows.</li>\n<li>magick/nt_base.c (NTInitializeExceptionHandlers): Add a new\nprivate function which disables pop-up Windows on exceptions and\nregisters a handler for Windows exceptions to clean up temporary\nfiles prior to program exit.</li>\n<li>magick/magick.c (PanicDestroyMagick): Use\nPurgeTemporaryFilesAsyncSafe() rather than PurgeTemporaryFiles().\n(InitializeMagickSignalHandlers): Always register for SIGINT, even\nunder Microsoft Windows.</li>\n<li>magick/tempfile.c (PurgeTemporaryFilesAsyncSafe): New private\nfunction to clean up temporary files prior to program exit.\nAsync-safe so it can be safely called from a signal handler.\nIntentionally leaks memory.</li>\n</ul>\n</blockquote>\n<p>2015-02-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Fix crash while\nparsing corrupt EXIF which was reported by Stijn Sanders on\n2015-02-17.</li>\n<li>Magick++/lib/{Blob.cpp, Image.cpp}: Incorrect lock scope\nresulted in Magick++ locking not actually working to protect\ncritical sections in spite of no detected problems with locking\nthese past 16 years.  Problem was detected using the\nmisc-unused-raii check from clang-tidy and was reported by Hyrum\nWright.</li>\n<li>coders/palm.c (ReadPALMImage): Add header logging to writer.\nWriter still seeks and overwrites its own header so logging is not\nentirely accurate yet.</li>\n</ul>\n</blockquote>\n<p>2015-02-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>libtool: Update GNU libtool to 2.4.6.</li>\n<li>coders/palm.c (ReadPALMImage): Fix support for transparency in\nPALM reader.</li>\n</ul>\n</blockquote>\n<p>2015-02-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/palm.c (ReadPALMImage): Major re-work of PALM reader.\nMore log message improvements.  More header validation.</li>\n</ul>\n</blockquote>\n<p>2015-02-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/palm.c (ReadPALMImage): Improve log messages.  Add more\nheader validation.  Check image pixel limits.  Support 'ping'\nmode.</li>\n</ul>\n</blockquote>\n<p>2015-02-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/palm.c (ReadPALMImage): PALM reader now supports 1, 2, 4,\n8, and 16-bit test files we were able to generate using\n'pnmtopalm'.  A progress monitor was added.  Memory leaks in error\npaths were fixed.</li>\n</ul>\n</blockquote>\n<p>2015-02-12  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Insert &quot;if (QuantumTick(...))&quot; ahead of\neach &quot;if (!MagickMonitorFormatted(...)&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-02-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/rla.c (ReadRLAImage): Assure that header ASCII strings\nare properly terminated.  Resolves Coverity CID 10322.</li>\n</ul>\n</blockquote>\n<p>2015-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.h (STDERR_FILENO): Provide definitions for\nstandard POSIX file numbers so that Visual Studio should compile.\nFixes SourceForge bug #291 &quot;STDERR_FILENO (used in magick.c) is\nnot defined under Windows&quot;</li>\n</ul>\n</blockquote>\n<p>2015-02-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Image.cpp (Image::quiet()): Patch by Dirk Lemstra\nto support silencing warnings in Magick++.  Adds a quiet() method\nwhich blocks (ignores) warning exceptions when passed a true\nargument.  Warning exceptions are still generated by default.</li>\n<li>coders/tiff.c: Support '-define tiff:report-warnings=true' to\nenable that warnings reported by libtiff are thrown as warning\nexceptions so that they may be caught or will be reported at the\ngm command-line.</li>\n</ul>\n</blockquote>\n<p>2015-02-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Use YCbCr encoding when JPEG\ncompression is requested for an RGB image.</li>\n</ul>\n</blockquote>\n<p>2015-02-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (QuantumTransferMode): Fix reading or writing\nplanar min-is-white or min-is-black images with an associated\nalpha channel.</li>\n</ul>\n</blockquote>\n<p>2015-02-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (ReadXPMImage): Reading empty XPM file should not\ncause bad memory access.</li>\n<li>coders/gif.c (DecodeImage): Assure that GIF decoder does not use\nunitialized data.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Verify that we support the number\nof output components before proceeding to decode the image.</li>\n</ul>\n</blockquote>\n<p>2015-01-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): MIFF needs to stop spinning if\nzlib or bzlib report an error while decompressing.  Solves problem\nwith file provided by Jodie Cunningham on 2015-01-25.</li>\n<li>coders/vicar.c (ReadVICARImage): Fix Vicar reader's dogged\ndetermination to continue reading when there is nothing left to\nread.  Solves problem with file provided by Jodie Cunningham on\n2015-01-25.</li>\n<li>magick/magick.c (PanicDestroyMagick): Replace memory allocation\nfunctions with dummy functions rather than NULL pointers.\n(InitializeMagickSignalHandlers): Register\nMagickPanicSignalHandler() for SIGSEGV.\n(MagickPanicSignalHandler): Produce an informative message for the\nuser.\n(MagickSignalHandlerMessage): Include more detailed information\nfrom the signal handler via a common routine used by default\nsignal handlers.</li>\n</ul>\n</blockquote>\n<p>2015-01-25  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): An attempt to address CID 10291.</li>\n</ul>\n</blockquote>\n<p>2015-01-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (Exit): Changed to return 'void'. Function can\nnot return a value if it does not return.</li>\n<li>magick/error.c (DefaultFatalErrorHandler): Invoke\nPanicDestroyMagick() rather than DestroyMagick().  If we are\nreally that short on memory, DestroyMagick() might not work.</li>\n<li>magick/magick.c (MagickPanicSignalHandler): Only use async-safe\nfunctions in signal handler.\n(PanicDestroyMagick): New function for emergency release of\npersistent resources just prior to program exit.  Async-safe and\ndoes not acquire or release any heap memory.</li>\n<li>magick/export.c: Eliminate two 'clang' warnings.</li>\n</ul>\n</blockquote>\n<p>2015-01-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdb.c (ReadPDBImage): Fix typo.</li>\n<li>coders/cineon.c (ReadCINEONImage): Enforce that Cineon image\ninfo channels is valid.  Solves problem with file provided by\nJodie Cunningham on 2015-01-24</li>\n<li>coders/fits.c (ReadFITSImage): Enforce valid bits-per-pixel\nvalues.  Add detailed header logging.  Solves problem with file\nprovided by Jodie Cunningham on 2015-01-24</li>\n</ul>\n</blockquote>\n<p>2015-01-22  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadPNGImage): Check length of various MNG\nchunks before using the chunk data.</li>\n<li>coders/png.c (WriteOnePNGImage): Use png_error() instead of\nthrowing an exception so cleanup in the setjmp block can happen,\nincluding unlocking the semaphore.  Addresses Coverity CID 10184.</li>\n</ul>\n</blockquote>\n<p>2015-01-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (WriteGIFImage): Don't use an unchecked value from\nGetImageAttribute(), even if the access succeeded before.\nResolves Coverity CID 10219.</li>\n<li>coders/dpx.c (StringToAttribute): Make sure that string is not\naccidentally shortened by one character if it occupies the full\nfield size.\n(ReadDPXImage): Validate that the bits per sample claimed by the\nfile header is a supported depth before using it further in the\ncode.  This might resolve Coverity CID 10071 &quot;Bad shift\noperation&quot;.\n(ReadDPXImage): Check for EOF while reading forward to element\ndata.  Might solve Coverity CID 10305.</li>\n<li>coders/dib.c (ReadDIBImage): Resolve Coverity CID 10228 &quot;Integer\noverflowed argument&quot;.\n(ReadDIBImage): Hopefully resolve Coverity CID 10268 &quot;Various&quot;,\nwhich is primarily about placing too much trust in the claimed\nnumber of colors.</li>\n<li>coders/pnm.c (WritePNMImage): Fix overwrite of status by\nprogress monitor.  Remaining issues may lurk within.  May resolve\nCoverity CID 10288.</li>\n<li>coders/pdb.c: Resolve Coverity CID 11173 &quot;Buffer not null\nterminated&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-01-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (GetMagickInfoArray): Resolve Coverity CID 10212\n&quot;Missing unlock&quot;.</li>\n<li>magick/colormap.c (ReplaceImageColormap): Allocate new image\ncolormap up front in order to avoid the possibility that we are\nleft with an image with no colormap due to memory allocation\nfailure. If there is a memory allocation failure, then the\noriginal colormap is preserved.  Resolves Coverity CID 10194\n&quot;Dereference after null check&quot;.</li>\n<li>magick/utility.c (MagickStripSpacesFromString): New private\nutility function to strip spaces from a string.</li>\n<li>magick/color_lookup.c (GetColorInfoArray): Resolves Coverity CID\n10231 &quot;Missing unlock&quot;\n(ReadColorConfigureFile): Resolves Coverity CID 10261 &quot;Use of\nuntrusted scalar value&quot;\n(GetColorInfo): Resolves Coverity CID 10077 &quot;Overlapping buffer in\nmemory copy&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-01-21  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Use png_error() instead of\nthrowing an exception so cleanup in the setjmp block can happen,\nincluding unlocking the semaphore.  Resolves Coverity CID 10232.</li>\n<li>coders/png.c (ReadOnePNGImage): Moved a logging statement into a\nblock where &quot;attribute&quot; has been checked for NULL.  Resolves\nCoverity CIDs 10185 and 10187.</li>\n<li>coders/png.c (ReadMNGImage): Fixed a cut-and-paste typo\n(change_delay should be change_timeout) reported by Coverity\nCID 10090.</li>\n</ul>\n</blockquote>\n<p>2015-01-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (CloneImage): The definition is poor as to what a\nnon-orphan clone should do.  However, the definition surely does\nnot include crashing the software or supplanting the original\nimage in an image list.  Clone image blob and previous/next\npointers but do not supplant original image in list.  Resolves\nCoverity CID 10155.</li>\n</ul>\n</blockquote>\n<p>2015-01-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (WriteRowSamples): Ensure that callback function is\nalways defined. Resolves Coverity CID 10122.\n(ReadRowSamples): Ensure that callback function is always\ndefined. Resolves Coverity CID 10125.</li>\n<li>magick/random.c (InitializeMagickRandomKernel): Avoid possible\ndouble-close of file.  Resolves Coverity CID 10257.</li>\n<li>coders/histogram.c (WriteHISTOGRAMImage): Avoid possible divide\nby zero exception.  Resolves Coverity CID 10107.</li>\n<li>magick/error.c (MagickFatalError): Document that\nMagickFatalError() is not supposed to return (program must quit)\nand add GCC/Clang hints to that effect.</li>\n<li>magick/bit_stream.c (BitAndMasks): Avoid possible access\none-beyond end of BitAndMasks array.  It is not clear if there is\na possible bug with 32-bit quantums.  If there is a bug, it has\nnot been noticed via testing.  Resolves Coverity CID 10213.</li>\n<li>magick/tempfile.c (AcquireTemporaryFileDescriptor): Avoid buffer\noverrun in the case of an astonishingly long environment variable\nstring.  Resolves Coverity CID 10267.\n(AddTemporaryFileToList): Use strlcpy() rather than strlcpy().  In\npractice, should not make a difference.  Will quiet Coverity CID\n10321.</li>\n<li>magick/command.c (GMCommandSingle): Don't use the address of a\nstack allocation to update argv[0]. Removed updating argv[0] until\na better design can be found.  Resolves Coverity CID 10223.\n(GMCommandSingle): Plan B: Use static allocation from\nSetClientName() to both store the new command name and provide\nstorage for argv[0].</li>\n<li>magick/utility.c (SystemCommand): Fix possible overwrite of\nmemory location due to uninitialized 'end' pointer.  Resolves\nCoverity CID 10251.</li>\n<li>magick/blob.c (WriteBlobFile): Was not closing file in certain\nerror conditions.  Resolves Coverity CID 10237.</li>\n<li>coders/cineon.c (ReadCINEONImage): Don't trust file header so\nmuch.  Resolves Coverity CIDs 10079, 10310, 10325.</li>\n<li>coders/art.c (ReadARTImage): Fix signed vs unsigned comparison\ncaused by earlier changes.</li>\n</ul>\n</blockquote>\n<p>2014-01-17 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Do not execute wpg raster read in ping mode.</li>\n</ul>\n</blockquote>\n<p>2014-01-15 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Properly deallocating zip structures.</li>\n</ul>\n</blockquote>\n<p>2015-01-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sfw.c (ReadSFWImage): Fix pixel cache access errors in\n'ping' mode.</li>\n</ul>\n</blockquote>\n<p>2015-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c (ReadWMFImage): Fix memory leak in 'ping' mode and\nsome error paths.</li>\n</ul>\n</blockquote>\n<p>2015-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jbig.c (ReadJBIGImage): Fix memory leak in 'ping' mode.</li>\n<li>magick/delegate.c (InvokeDelegate): Fix memory leak of argument\nlist when invoking external program via MagickSpawnVP().</li>\n</ul>\n</blockquote>\n<p>2015-01-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c (InitializeMagickResources): Base image width\nand height default limits on the range of a 32-bit signed integer,\neven for 64-bit builds.  These limits are still beyond what most\ncomputers in the world can handle.  Limits can be increased by the\nuser.</li>\n<li>coders/xwd.c (ReadXWDImage): Check image size limits\nimmediately.</li>\n<li>coders/xc.c (ReadXCImage): Check image size limits immediately.</li>\n<li>coders/webp.c (ReadWEBPImage): Check image size limits\nimmediately.</li>\n<li>coders/viff.c (ReadVIFFImage): Check image size limits\nimmediately.</li>\n<li>coders/vicar.c (ReadVICARImage): Check image size limits\nimmediately.</li>\n<li>coders/txt.c (ReadTXTImage): Check image size limits\nimmediately.</li>\n<li>coders/ttf.c (ReadTTFImage): Check image size limits\nimmediately.</li>\n<li>coders/tim.c (ReadTIMImage): Check image size limits\nimmediately.</li>\n<li>coders/tiff.c (ReadTIFFImage): Check image size limits\nimmediately.</li>\n<li>coders/tga.c (ReadTGAImage): Check image size limits\nimmediately.</li>\n<li>coders/sgi.c (ReadSGIImage): Check image size limits\nimmediately.</li>\n<li>coders/sct.c (ReadSCTImage): Check image size limits\nimmediately.</li>\n<li>coders/rle.c (ReadRLEImage): Check image size limits\nimmediately.</li>\n<li>coders/rla.c (ReadRLAImage): Check image size limits\nimmediately.</li>\n<li>coders/psd.c (ReadPSDImage): Check image size limits\nimmediately.</li>\n<li>coders/pnm.c (ReadPNMImage): Check image size limits\nimmediately.</li>\n<li>coders/pix.c (ReadPIXImage): Check image size limits\nimmediately.</li>\n<li>coders/pict.c (ReadPICTImage): Check image size limits\nimmediately.</li>\n<li>coders/pdb.c (ReadPDBImage): Check image size limits\nimmediately.</li>\n<li>coders/pcx.c (ReadPCXImage): Check image size limits\nimmediately.</li>\n<li>coders/pcd.c (ReadPCDImage): Check image size limits\nimmediately.</li>\n<li>coders/otb.c (ReadOTBImage): Check image size limits\nimmediately.</li>\n<li>coders/null.c (ReadNULLImage): Check image size limits\nimmediately.</li>\n<li>coders/mvg.c (ReadMVGImage): Check image size limits\nimmediately.</li>\n<li>coders/mtv.c (ReadMTVImage): Check image size limits\nimmediately.</li>\n<li>coders/mpc.c (ReadMPCImage): Check image size limits\nimmediately.</li>\n<li>coders/miff.c (ReadMIFFImage): Check image size limits\nimmediately.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Check image size limits\nimmediately.</li>\n<li>coders/jp2.c (ReadJP2Image): Check image size limits\nimmediately.</li>\n<li>coders/jbig.c (ReadJBIGImage): Check image size limits\nimmediately.</li>\n<li>coders/hdf.c (ReadHDFImage): Check image size limits\nimmediately.</li>\n<li>coders/gif.c (ReadGIFImage): Check image size limits\nimmediately.</li>\n<li>coders/fpx.c (ReadFPXImage): Check image size limits\nimmediately.</li>\n<li>coders/fax.c (ReadFAXImage): Check image size limits\nimmediately.</li>\n<li>coders/dpx.c (ReadDPXImage): Check image size limits\nimmediately.</li>\n<li>coders/dps.c (ReadDPSImage): Check image size limits\nimmediately.</li>\n<li>coders/dib.c (ReadDIBImage): Check image size limits\nimmediately.</li>\n<li>coders/dcm.c (ReadDCMImage): Check image size limits\nimmediately.</li>\n<li>coders/cut.c (ReadCUTImage): Check image size limits\nimmediately.</li>\n<li>coders/cineon.c (ReadCINEONImage): Check image size limits\nimmediately.</li>\n<li>coders/avs.c (ReadAVSImage): Check image size limits\nimmediately.</li>\n<li>coders/art.c (ReadARTImage): Check image size limits\nimmediately.</li>\n<li>coders/sun.c (ReadSUNImage): Check image size limits in advance\nof allocating memory for pixels.</li>\n<li>coders/bmp.c (ReadBMPImage): Check image size limits in advance\nof allocating memory for pixels.</li>\n<li>coders/sun.c (ReadSUNImage): There is no definition for Sun map\ntype RMT_RAW so it can not be supported.  Update DirectClass\npixels directly rather using SyncImage().  Problem was reported by\nJodie Cunningham.</li>\n</ul>\n</blockquote>\n<p>2015-01-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (ReadPICTImage): Fix PICT reader crash when\nreading corrupted file.</li>\n<li>coders/sun.c (ReadSUNImage): Sun reader was still not as robust\nas it should be.  Now it is.</li>\n</ul>\n</blockquote>\n<p>2014-01-10 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Fixed reading behind EOF issue.</li>\n</ul>\n</blockquote>\n<p>2015-01-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (LSBPackedU32WordToOctets): Fix typo which adds\nsevere corruption to encoded little-endian 32-bit packed output.\nThe good news is that since the corruption is severe, it is easily\nvisually detected.  The problem has corrupted all such\n(little-endian 10-bit) output since it was originally implemented\non 2007-06-17 (changeset 11686, first released in GraphicsMagick\n1.1.8).  GraphicsMagick preserves the endianness of input DPX\nfiles by default, defaults to big-endian, and DPX files are\ncommonly big-endian, so this problem may not have occured for many\nusages.  Problem was reported by Steve Dabner on the\nGraphicsMagick discussion mailing list.</li>\n</ul>\n</blockquote>\n<p>2015-01-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (MagickPanicSignalHandler): Print a message in\nthe case of signals SIGXCPU and SIGXFSZ.</li>\n<li>coders/bmp.c (ReadBMPImage): Don't hang in endless loop if EOF\nis encountered while checking for &quot;BA&quot; header.</li>\n<li>coders/icon.c (ReadIconImage): Limit icon image allocation size.</li>\n</ul>\n</blockquote>\n<p>2015-01-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/icon.c (ReadIconImage): Removed all of the\npreviously-existing DIB reading code from icon.c and use new\n&quot;ICODIB&quot; reader to read DIB icons, or the PNG reader to read PNG\nicons.</li>\n<li>coders/dib.c (ReadDIBImage): Added an &quot;ICODIB&quot; coder for\ninternal use which reads a Windows BMP 3 DIB followed by a Windows\nICO alpha mask.  This allows existing DIB code to be used to read\nICO directory entries.</li>\n</ul>\n</blockquote>\n<p>2015-01-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/icon.c: The Windows ICO reader is now more robust.  Still\na work in progress since some files still can not be read or read\nincorrectly.</li>\n</ul>\n</blockquote>\n<p>2015-01-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resource.c (ListMagickResourceInfo): &quot;kilo&quot; for binary\nprefixes is supposed to be &quot;Ki&quot;.</li>\n<li>magick/utility.c (FormatSize): &quot;kilo&quot; for binary prefixes is\nsupposed to be &quot;Ki&quot;.</li>\n</ul>\n</blockquote>\n<p>2015-01-01  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Use WidthResource and HeightResource instead\nof fixed 1-million limit for rows and columns.</li>\n</ul>\n</blockquote>\n<p>2015-01-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (FormatSize): Add 'i' to value range\nidentifiers since these are all in units of 2^10 rather than 1000.</li>\n<li>magick/pixel_cache.c (CheckImagePixelLimits): Fix typo and\nproduce an informative error message.</li>\n<li>magick/resource.c: Added support for Image width and height\npixels resource limits.</li>\n<li>magick/resource.h (ResourceType): New resource enumerations\nWidthResource and HeightResource.</li>\n<li>magick/enum_strings.c (StringToResourceType): Added support for\nparsing '-limit Width' and '-limit Height'.</li>\n<li>magick/pixel_cache.c (CheckImagePixelLimits): New function to\ntest image to see if it exceeds pixels limits.</li>\n<li>coders/viff.c (ReadVIFFImage): Make the VIFF reader robust with\ndetecting and reporting problems.</li>\n</ul>\n</blockquote>\n<p>2014-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Rotate Changelog for new year.  Update documentation copyrights\nfor new year.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2016.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2016.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2016-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (WritePNMImage): Support writing GRAYSCALE PAM\nformat.  Before this fix, grayscale output was marked as type\nBLACKANDWHITE.  Problem was reported by Aaron Boxer via email on\nDecember 31, 2016.</li>\n<li>TclMagick/generic/Makefile.am: Applied patch by Massimo Manghi\n(plus some fixes by me) to add a 'libttkcommon' shared library to\ncontain codde common to the TclMagick/TkMagick loadable modules,\nand particularly to allow TkMagick to access TclMagick functions\nwithout depending on dlopen() with RTLD_GLOBAL behavior.</li>\n</ul>\n</blockquote>\n<p>2016-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/compare.c (DifferenceImage): Fix all-black difference\nimage if an input file is colormapped.  Resolves SourceForge issue\n#404 &quot;Difference file does not work if PNG &quot;.</li>\n</ul>\n</blockquote>\n<p>2016-12-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">coders/txt.c (ReadTXTImage): Fix Coverity issue 55866 &quot;Resource\nleak&quot;.</p>\n</li>\n<li><p class=\"first\">magick/enum_strings.c (StringToCompositeOperator): Fix Coverity\nissue 139296 &quot;Constant expression result&quot;.</p>\n</li>\n<li><p class=\"first\">magick/channel.c (ImportImageChannelsMasked): Fix Coverity issue\n139297 &quot;Constant expression result&quot;.  This was a bug but only in\nterms of reduced performance, not results.</p>\n</li>\n<li><p class=\"first\">Magick++/lib/Drawable.cpp\n(PathSmoothCurvetoRel::operator): Fix Coverity issue 139301 &quot;Using\ninvalid iterator&quot;.\n(PathSmoothCurvetoRel::operator): Fix Coverity issue 139302 &quot;Using\ninvalid iterator&quot;</p>\n</li>\n<li><p class=\"first\">magick/attribute.c: From SourceForge patches #47\n&quot;GraphicsMagick-1.3.25-get-exif-attribute-gps-fix.patch&quot; and\n&quot;GraphicsMagick-1.3.25-set-exif-orientation-fix.patch&quot; by Troy\nPatteson with description (related to provided Coverity reports in\ncoverity.txt): Those coverity errors indicate a problem with the\nearlier patch I sent you to fix getting the EXIF orientation when\nthe GPS IFD occurs before the EXIF IFD. Although the patch fixed\nthat issue it introduced a new issue in that GPS tags could no\nlonger be retrieved. This occurs because the gpsfound flag is set\nwhen the GPS IFD is pushed onto the stack but then cleared\nimmediately when breaking out of the loop processing the directory\nentries for the current IFD. The solution is to push the gpsfound\nflag onto the stack as well as it needs to be set when the GPS IFD\nis popped off the stack rather than being set straight away.</p>\n<p>The second coverity error relates to gpsoffset not being set in\nFindEXIFAttribute(). The code that sets gpsoffset in\nGenerateEXIFAttribute() was embedded in the code that gets tags\nvalues which was removed in FindEXIFAttribute() as only the DE\noffset is required. I have removed the need for gpsoffset and just\ncomputed the GPS IFD offset when pushing it onto the stack in the\nsame way the EXIF IFD offset is computed.</p>\n</li>\n</ul>\n</blockquote>\n<p>2016-12-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">magick/attribute.c: From SourceForge patches #47\n&quot;GraphicsMagick-1.3.25-5-set-exif-orientation.patch&quot; by Troy\nPatteson with description: Rotating an image without resetting the\nEXIF orientation tag is problematic as follow-on viewers that\nsupport the EXIF orientation tag may incorrectly rotate the image\na second time. For JPEG images, the current solution is to either\nstrip the image, remove the EXIF profile or modify the EXIF data\nof the written image with other software. This patch adds the\nability to set the orientation tag in the EXIF profile via the\nSetImageAttribute on attribute EXIF:Orientation provided the EXIF\norientation already exists. AutoOrientImage() has been modified to\nset the EXIF orientation tag on successful rotation of the image.</p>\n<p>The implementation is less than ideal. The EXIF profile must be\nduplicated because it is returned read-only from the profiles\nmap. Large amounts of the GenerateEXIFAttribute() function has\nbeen duplicated in a function called FindEXIFAttribute() which\nreturns the offset in the EXIF profile of a given tag ID. Once\nfound, the orientation tag value is updated accordingly and the\nnew EXIF profile set. Despite the patches shortcomings, I believe\nit is preferable to leaving the EXIF orientation tag unchanged\nafter auto-orienting the image.</p>\n</li>\n<li><p class=\"first\">wand/magick_wand.c (MagickClearException): From SourceForge\npatches #47 &quot;GraphicsMagick-1.3.25-1-wand-clear-exception.patch&quot;\nby Troy Patteson with description: This patch adds the ability to\nclear the last Wand exception. This is particularly useful to\nclear any exception on the Wand before calling MagickReadImage()\nwhich can return success with a warning exception such as &quot;JPEG\ndata: premature end of data segment&quot;.\n(MagickRemoveImageOption): From SourceForge patches #47\n&quot;GraphicsMagick-1.3.25-2-wand-remove-image-option.patch&quot; by Troy\nPatteson with description: There is MagickSetImageOption() to set\noptions like JPEG preserve-settings but no way to remove the\noption once set. Since the mechanism to remove image options\nalready exists in lower-level API there seems no reason not to\nexpose it in the Wand API.\n(MagickGetImageOrientation, MagickSetImageOrientation): From\nSourceForge patches #47\n&quot;GraphicsMagick-1.3.25-3-wand-get-set-orientation.patch&quot; by Troy\nPatteson with description: MagickGetImageOrientation returns the\ninternal orientation setting which is useful to know to determine\nwhether an image needs rotation. The function to set the\norientation is less useful as it only sets the internal\norientation setting which is only used when writing out TIFF\nfiles. A future patch addresses this issue.\n(MagickAutoOrientImage): From SourceForge patches #47\n&quot;GraphicsMagick-1.3.25-4-wand-auto-orient.patch&quot; by Troy Patteson\nwith description: This patch adds auto-orient image to the Wand\nAPI.</p>\n</li>\n</ul>\n</blockquote>\n<p>2016-12-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>TclMagick/{configure.ac, Makefile.am}: Applied patches by\nMassimo Manghi to use TEA tcl.m4 version 3.9.</li>\n</ul>\n</blockquote>\n<p>2016-11-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (DecodeImage): Applied fixes by Tianyu Lang for\n&quot;Excessive LZW string data&quot; problem leading to &quot;Corrupt image&quot;\nreport while reading some GIF files.</li>\n</ul>\n</blockquote>\n<p>2016-11-18 Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc, doc/config_files.imdoc, doc/benchmark.imdoc:\nFixed some indentation in the documentation.</li>\n</ul>\n</blockquote>\n<p>2016-10-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>acinclude.m4 (LIBS): Fix memory leaks in GM_FUNC_MMAP_FILEIO\nmacro test-case so that it can be used successfully with ASAN\ncompilation options.</li>\n<li>magick/blob.c: Eliminate unused variable compiler warnings when\nHAVE_MMAP_FILEIO is not defined.</li>\n</ul>\n</blockquote>\n<p>2016-10-24  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Ability to read multiple images from Matlab V4 format.</li>\n</ul>\n</blockquote>\n<p>2016-10-21 Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<p>*coders/png.c (ReadOneJNGImage): Enforce spec requirement that the\ndimensions of the JPEG embedded in a JDAT chunk must match the\nJHDR dimensions. This issue was assigned CVE-2016-9830 on\n2016-12-04.  Please note that GraphicsMagick's pixel, width, and\nheight default limits are often greater than the dimension limits\nof JNG and JPEG so the user should add explicit limits (if needed)\nto prevent unexpected memory consumption from properly-constructed\nJNG files with large dimensions.</p>\n<p>*doc/options.imdoc (-strip): Added a caution to not use the -strip\noption to remove author, copyright, and license information\nwhen redistributing an image that requires them to be retained.</p>\n<p>*doc/options.imdoc (-comment and -label): Document the fact that\nonly one comment or label is stored, and how they are stored in\nPNG files.</p>\n</blockquote>\n<p>2016-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c (ReadSGIImage): Adjusts some variable types and\nlessen the amount of casting.</li>\n</ul>\n</blockquote>\n<p>2016-10-09 Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadJNGImage): Quiet COVERITY issue about\na potential memory leak.</li>\n</ul>\n</blockquote>\n<p>2016-10-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (ReadXCFImage): Fix memory leak of layer_info for\nsome recently added error-return paths.</li>\n</ul>\n</blockquote>\n<p>2016-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c (ReadSGIImage): For RLE SGI image, defer memory\nallocations for as long as possible and allow the file to prove\nitself worthy before making the largest allocations.  This helps\nwith rejecting bogus RLE files while avoiding rejecting valid\nfiles.</li>\n</ul>\n</blockquote>\n<p>2016-10-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): If TIFF uses Old JPEG\ncompression, then read using full tiles or strips.  Solves\n&quot;Improper call to JPEG library in state 0. (LibJpeg).&quot; error.\nProblem was reported via email on October 6, 2016 by John Brown.</li>\n</ul>\n</blockquote>\n<p>2016-10-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Fixed SourceForge\nbug 400 &quot;Exif orientation unknown for some JPEG files&quot;.  Patch\nsubmitted by Troy Patteson.</li>\n</ul>\n</blockquote>\n<p>2016-10-02  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Add sanity check for palette.  Merge\nRemoveLastImageFromList+AppendImageToList to ReplaceImageInList.\nPossible heap overflow of colormap in Q8 build was assigned\nCVE-2016-7996.  Assertion crash due to blob != NULL was assigned\nCVE-2016-7997.</li>\n</ul>\n</blockquote>\n<p>2016-10-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c (parse8BIM): Fix unsigned underflow leading to\nheap overflow when parsing 8BIM chunk.  Problem was reported by\nMarco Grassi via email on October 1, 2016.  Problem was already\nknown (but not fixed) based on comments in the code.  This issue\nhas been assigned CVE-2016-7800.</li>\n</ul>\n</blockquote>\n<p>2016-09-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c: Improve the robustness of the XCF reader by adding\nmore error checking.</li>\n</ul>\n</blockquote>\n<p>2016-09-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/rle.c (RLEConstrainColormapIndex): Was not constraining\ncolormap index like it should be.  This problem was added on\n2016-09-23.</li>\n<li>www/thanks.rst: Added Moshe Kaplan to Thanks.</li>\n<li>www/Hg.rst: Mercurial URL fixes.  Patch from Mark Mitchell.</li>\n<li>www/programming.rst: Updated programming APIs page.</li>\n</ul>\n</blockquote>\n<p>2016-09-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (OpenCache): Trace ExtendCache() failures.</li>\n</ul>\n</blockquote>\n<p>2016-09-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c (ReadSGIImage): Fix unexpectedly large memory\nallocation with corrupt SGI file provided via email by Agostino\nSarubbo on September 15, 2016.</li>\n<li>coders/rle.c (ReadRLEImage): Only report an invalid colormap\nindex once.  Fixes slowness problem with corrupt file provided via\nemail by Agostino Sarubbo on September 15, 2016.</li>\n</ul>\n</blockquote>\n<p>2016-09-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/thanks.rst: Added a 'thanks' page.</li>\n</ul>\n</blockquote>\n<p>2016-09-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/MANIFEST: Fix content of PerlMagick MANIFEST.</li>\n</ul>\n</blockquote>\n<p>2016-09-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcx.c (ReadPCXImage): Check that filesize is reasonable\ngiven header.  Fixes excessive memory allocation followed by\neventual file truncation error for corrupt file.  Problem was\nreported via email by Agostino Sarubbo on 2016-09-10.</li>\n<li>coders/sgi.c (ReadSGIImage): Check that filesize is reasonable\ngiven header.  Fixes excessive memory allocation followed by\neventual file truncation error for corrupt file.  Problem was\nreported via email by Agostino Sarubbo on 2016-09-09.</li>\n<li>coders/sct.c (ReadSCTImage): Fix stack-buffer read overflow\nwhile reading SCT header.  Problem was reported via email by\nAgostino Sarubbo on 2016-09-09.</li>\n<li>coders/svg.c: Fix Coverity issue 135772 &quot;RESOURCE_LEAK&quot; and\nissue 135829 &quot;Null pointer dereferences&quot;.  None of these issues\nwere new, but Coverity noticed them now.  Reflowed source to GNU C\nstyle for consistent indentation and so it does not fight with my\neditor.</li>\n</ul>\n</blockquote>\n<p>2016-09-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/common.h (MAGICK_HAS_ATTRIBUTE): Coverity is allergic to\n__has_attribute() so don't use it for Coverity builds.</li>\n</ul>\n</blockquote>\n<p>2016-09-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/index.rst: Update for 1.3.25 release.</li>\n<li>version.sh: Update library versioning for 1.3.25 release.</li>\n<li>NEWS.txt: Make sure is up to date.</li>\n<li>Various fixes for minor issues noticed when compiling under\nVisual Studio.</li>\n</ul>\n</blockquote>\n<p>2016-08-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/studio.h (MAGICK_CACHE_LINE_SIZE): Apply patch from\nGentoo Linux to increase MAGICK_CACHE_LINE_SIZE to 128 when\n__powerpc__ is defined.</li>\n</ul>\n</blockquote>\n<p>2016-08-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated with latest changes.</li>\n</ul>\n</blockquote>\n<p>2016-08-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/rle.c (ReadRLEImage): Reject truncated/absurd Utah RLE\nfiles. Problem was reported by Agostino Sarubbo on August 19,\n2016.  This problem was assigned CVE-2016-7448 after the 1.3.25\nrelease.</li>\n</ul>\n</blockquote>\n<p>2016-08-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Fix heap-based buffer read\noverflow.  TIFF sized attibutes were not being properly copied to\na null-terminated string if the value was not null terminated.\nProblem was reported by Agostino Sarubbo on August 18, 2016.  This\nproblem was assigned CVE-2016-7449 after the 1.3.25 release.</li>\n</ul>\n</blockquote>\n<p>2016-08-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lcms/src/cmstypes.c (Type_MLU_Read): &quot;Added an extra check to\nMLU bounds&quot;, change based on github mm2/Little-CMS commit\n5ca71a7bc18b6897ab21d815d15e218e204581e2 and announced to the\noss-security list by Ibrahim M. El-Sayed on Mon, 15 Aug 2016.</li>\n</ul>\n</blockquote>\n<p>2016-08-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>webp: Updated bundled libwebp to release 0.5.1.</li>\n<li>libxml: Updated bundled libxml2 to release 2.9.4.</li>\n<li>lcms: Updated bundled lcms2 to release 2.8.</li>\n<li>png: Update bundled libpng to release 1.6.24.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Log setting resolution and\nresolution units due to JFIF marker.</li>\n<li>coders/sgi.c (SGIDecode): Fix integer overflow of size type in\nWin64 build where sizeof(long) &lt; sizeof(size_t).</li>\n</ul>\n</blockquote>\n<p>2016-08-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders, magick: Compile clean using GCC with -std=c90.</li>\n<li>magick/describe.c (DescribeImage): The 'identify' and 'info'\nfunctionality only shows the pixel read rate if image was not read\nin 'ping' mode.  Provide seconds timing with 6 digits of precision\nsince that is what is needed.</li>\n</ul>\n</blockquote>\n<p>2016-08-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/describe.c (DescribeImage): Include milliseconds\nresolution in elapsed time output.</li>\n<li>magick/timer.c (ElapsedTime): Use clock_gettime() (when\navailable with default linkage) to obtain elapsed time.</li>\n</ul>\n</blockquote>\n<p>2016-08-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/yuv.c (WriteYUVImage): Fix benign clang compiler warning\nregarding &quot;variable 'x' is incremented both in the loop header and\nin the loop body&quot;.</li>\n<li>configure.ac: Fixes to use clang's OpenMP runtime library\n(-lomp) for clang 3.8 and later.  Specifically tested with clang\n3.8 on Ubuntu 16.04 'xenial'.  Problem was reported by Holger\nHoffstätte via private email.</li>\n<li>NEWS.txt: Bring up to date with latest changes.</li>\n</ul>\n</blockquote>\n<p>2016-07-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Reject abnormally absurd gradient\nsize requests (many absurd requests are still allowed).  Provide\ndetailed error reports when a gradient is rejected.</li>\n<li>coders/svg.c: Support units for 'stroke-dashoffset'.</li>\n</ul>\n</blockquote>\n<p>2016-07-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c (EscapeParenthesis): In private email on\n2016-07-07, Gustavo Grieco notified us of a heap overflow in\nEscapeParenthesis().  I was not able to reproduce the issue but\nchanged the implementation with the suspicion that the\nimplementation has a bug, and due to noticing arbitary limits and\ninefficiency.  This issue was assigned CVE-2016-7447 after the\n1.3.25 release.</li>\n</ul>\n</blockquote>\n<p>2016-07-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Fix absolute and arbitrary gradient\ndimension sanity checks which caused gradient requests to fail.\nResolves SourceForge issue #392 &quot;SVG 'push defs' fails (Debian\nbugs 829063 and 828120)&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-06-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/security.rst: Add discussion of SVG format and SSRF\nvulnerability.</li>\n</ul>\n</blockquote>\n<p>2016-06-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (ReadSVGImage): Assure that SVGInfo data is freed\nwhen XMP parsing is aborted due to an error.</li>\n</ul>\n</blockquote>\n<p>2016-06-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated NEWS with changes since last release.</li>\n<li>www/security.rst: Add a page about GraphicsMagick security.</li>\n</ul>\n</blockquote>\n<p>2016-06-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawPrimitive): Over-aggressive error reporting\nwas causing failures when elements were &quot;drawn&quot; off-image.\nResolves SourceForge issue #389 &quot;Non-conforming drawing primitive\ndefinition (line)&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-05-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Fix problem while reading file\n&quot;tnamkejarz.svg.2532308010849170049&quot; provided via private email\nfrom Gustavo Grieco on May 31, 2016.</li>\n<li>magick/utility.c (MagickGetToken): Fix problem while reading\nfile &quot;vqxwatmqmi.svg.-3669039972557308254&quot; provided via private\nemail from Gustavo Grieco on May 31, 2016.</li>\n</ul>\n</blockquote>\n<p>2016-05-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update for 1.3.24 release.</li>\n<li>www/Changes.rst: Mention 1.3.24 release.</li>\n<li>www/index.rst: Update for 1.3.24 release.</li>\n<li>version.sh: Update library ABI information in preparation for\n1.3.24 release.</li>\n<li>NEWS.txt: Updated NEWS to reflect fixes and issues.</li>\n</ul>\n</blockquote>\n<p>2016-05-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated with latest news.</li>\n<li>magick/blob.c (OpenBlob): Remove support for reading input from\na shell command, or writing output to a shell command, by\nprefixing the specified filename (containing the command) with a\n'|'.  This feature provided a remote shell execution opportunity\n(CVE-2016-5118).</li>\n<li>coders/mat.c (ReadMATImage): Validate that MAT frames is not\nzero.</li>\n</ul>\n</blockquote>\n<p>2016-05-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Be less optimistic when estimating\nthe number of points required to represent a path.  This should\nhelp address CVE-2016-2317 &quot;Heap buffer overflow&quot;.  This resolves\nSourceForge issue #275 &quot;Applying Clipping Path to high resolution\nJPG&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-05-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Fix problem while reading file\n&quot;pxypjhfdxf.svg.7406476585885697806&quot; provided via via private\nemail from Gustavo Grieco on May 24, 2016.</li>\n<li>coders/svg.c: Fix problem while reading file\n&quot;pxypjhfdxf.svg.308008972284643989&quot; provided via private email\nfrom Gustavo Grieco on May 24, 2016.</li>\n</ul>\n</blockquote>\n<p>2016-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (&quot;C&quot;): Support font-size &quot;medium&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-05-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated NEWS.txt to reflect latest changes.</li>\n<li>magick/render.c (DrawImage): Added DrawImage() recursion\ndetection/prevention.</li>\n<li>coders/svg.c (ReadSVGImage): Add basic primitive argument\nvalidation.</li>\n<li>magick/render.c (DrawImage): Add basic primitive argument\nvalidation.</li>\n</ul>\n</blockquote>\n<p>2016-05-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/url.c (ReadURLImage): Reading &quot;<a class=\"reference external\" href=\"file://\">file://</a>&quot; URLs was not\nworking.  Now file URLs are working.</li>\n</ul>\n</blockquote>\n<p>2016-05-21  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Respect JPEG limits (65535x65535) and user width\nand height limits from &quot;-limit&quot; while reading or writing JNG files.</li>\n</ul>\n</blockquote>\n<p>2016-05-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/url.c: Don't hide HTTP, FTP, and FILE URL support from\n'-list format' output.  Ignore HTTP, FTP, and FILE as a useful\nfile extension for determing the file format.</li>\n</ul>\n</blockquote>\n<p>2016-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (ConvertPathToPolygon): Make sure that first\nedge is initialized.  Make sure that points is not null.</li>\n</ul>\n</blockquote>\n<p>2016-05-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Fixed segmentation violation while\nreading file &quot;275077586554139424.lqxdgqxtfs.svg&quot; provided via\nprivate email from Gustavo Grieco on May 15, 2016.  This is due to\nanother CVE-2016-2317 related issue.</li>\n</ul>\n</blockquote>\n<p>2016-05-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (&quot;C&quot;): Fixed problems while reading files\n&quot;aaphrbkwwe.svg.-1899680443073025602&quot;,\n&quot;aaphrbkwwe.svg.-5751004588641220738&quot;,\n&quot;aaphrbkwwe.svg.-8875730334406147537&quot;, and\n&quot;aaphrbkwwe.svg.4495884156523242589&quot; provided via private email\nfrom Gustavo Grieco on February 8, 2016.</li>\n</ul>\n</blockquote>\n<p>2016-05-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c (ReadDIBImage): Verify that DIB file data is\nsufficient to meet claims made by file header.  Validate image\nplanes.  Fixes Fixes problem reported by Hanno Böck on May 8th,\n2016 via private email entitled &quot;malloc issue in ReadDIBImage&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-05-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/msl.c (RegisterMSLImage): Ignore the file extension on\nMSL files.  The only way to read an image from a MSL file (as\nopposed to explicitly running a MSL script with 'conjure') is by\nreading using a filename specification like &quot;msl:filename&quot;.  This\nis done for security reasons.</li>\n<li>magick/render.c (DrawPrimitive): Fix Coverity issue 126378\n&quot;Resource leak&quot;.</li>\n<li>coders/mat.c (DecompressBlock): Fix Coverity issue 126379\n&quot;Resource leak&quot;.</li>\n<li>magick/render.c (DrawImage): Fix Coverity issue 126380 &quot;Resource\nleak&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-05-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawPrimitive): Sanity check the image file\npath or URL before passing it to ReadImage().</li>\n<li>config/delegates.mgk.in: Pare down delegates.mgk to reduce\nsecurity exposure due to external programs not under our control.</li>\n</ul>\n</blockquote>\n<p>2016-05-08  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Typo fix - matrix has nothing to do with PostScript.</li>\n</ul>\n</blockquote>\n<p>2016-05-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (DecompressBlock): Don't hang on a corrupt deflate\nstream when reading matlab v6 file.  Fixes problem reported by\nHanno Böck on May 8, 2016 via private email entitled &quot;hang of\nmatlab input file&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-05-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): Undocumented &quot;TMP&quot; magick prefix\nno longer removes the argument file after it has been read. This\nfunctionality is only used to support the &quot;show&quot; delegate which is\nused by options in the 'display' program which need to display a\ngenerated image in a new instance of 'display'.  The &quot;show&quot;\ndelegate is used by writing a temporary file to be viewed, and\nwhich should be removed before the program quits.  Since the &quot;TMP&quot;\nfeature was originally implemented, GraphicsMagick added a\ntemporary file management subsystem which assures that temporary\nfiles are removed so this feature is not needed.</li>\n<li>coders/tiff.c (ReadTIFFImage): Fix heap overflow with file\n&quot;gkkxrilssm.tiff.-4678010562506843336&quot; provided by Gustavo Grieco\non February 8, 2006 via private email.</li>\n<li>coders/viff.c (ReadVIFFImage): Fix problem with a very large\nmalloc in sample file provided by Hanno Böck on May 7, 2016 with\nsubject &quot;large malloc in ReadVIFFImage&quot;.</li>\n<li>coders/mvg.c (RegisterMVGImage): Do not auto-detect MVG format\nbased on file extension.  MVG files can then only be read by\nadding a &quot;MVG:&quot; prefix to the file name. There is already no\nauto-detection of MVG based on content.</li>\n</ul>\n</blockquote>\n<p>2016-05-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (ReadXPMImage): Limit the number of XPM colors and\nassure array initialization.  Fixes bad behavior with a sample\nfile provided by Hanno Böck on May 6, 2016 with subject &quot;Invalid\nfree in ReadXPMImage&quot;.</li>\n<li>coders/pcx.c (ReadPCXImage): Limit the number of PCX image\nplanes allowed.  Fixes an unreasonable memory allocation in a\nsample file provided by Hanno Böck on May 5, 2016.</li>\n</ul>\n</blockquote>\n<p>2016-05-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>config/delegates.mgk.in: Gnuplot files are inherently insecure.\nRemove delegates support for reading them.  Reported by John\nLightsey via private email.\nAdded -dSAFER to Ghostscript invokations in delegates.mgk for more\nsecure execution.  Reported by David Chan via SourceForge bug\n&quot;#386 ghostscript delegates should explicitly use -dSAFER.&quot;.</li>\n<li>magick/constitute.c (ReadImages): Avoid possible infinite\nReadImage() recursion.</li>\n</ul>\n</blockquote>\n<p>2016-05-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawPolygonPrimitive): Fix divide by zero\nexception encountered while reading file &quot;sigfpe.svg&quot; posted by\nGustavo Grieco on May 1, 2016 to the oss-security mailing list\nwith subject &quot;CVE request: DoS in multiple versions of\nGraphicsMagick&quot;.\n(DrawDashPolygon): Fix endless loop problem caused by negative\nstroke-dasharray arguments.  Resolves problem observed while\nreading file &quot;circular.svg&quot; posted by Gustavo Grieco on May 1,\n2016 to the oss-security mailing list with subject &quot;CVE request:\nDoS in multiple versions of GraphicsMagick&quot;.</li>\n<li>magick/import.c (ImportViewPixelArea): Fix assertion while\nreading TIFF file gkkxrilssm.tiff.105123337066 provided by Gustavo\nGrieco.</li>\n</ul>\n</blockquote>\n<p>2016-04-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/locale.c (ReadLOCALEImage): Make sure to close blob\nbefore returning.</li>\n<li>coders/svg.c (&quot;C&quot;): Provide a hack work-around for double-quoted\nfont-family argument.</li>\n<li>magick/render.c (DrawImage): Make SVG path and other primitive\nparsing more robust.  Fixes SEGV when reading files provided by\nCVE-2016-2318 test cases.  Fixes CVE-2016-2318 completely.</li>\n</ul>\n</blockquote>\n<p>2016-04-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Fix heap buffer overflow when\nreading aaphrbkwwe.svg.-1114777018469422437 from CVE-2016-2317\ntest cases.  This resolves CVE-2016-2317 completely.</li>\n</ul>\n</blockquote>\n<p>2016-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MogrifyImageCommand): Added mogrify\n-preserve-timestamp option to preserve file access and\nmodification timestamps.  Contributed by Niko Rosvall via\nSourceForge patch #45 &quot;preserve-timestamp option for mogrify\ncommand.&quot;</li>\n</ul>\n</blockquote>\n<p>2016-04-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c: Added ReadBlobLSBSignedShort(),\nReadBlobMSBSignedShort(),\nReadBlobLSBSignedLong(),ReadBlobMSBSignedLong(),\nWriteBlobLSBSignedShort(), WriteBlobLSBSignedLong(),\nWriteBlobMSBSignedLong(), WriteBlobMSBSignedShort() for doing I/O\non signed integer types without the need for dangerous casts or\nunexpected values due to signed/unsigned conversion.</li>\n</ul>\n</blockquote>\n<p>2016-04-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated with latest changes.</li>\n<li>magick/constitute.c (ReadImage): Added asserts to check that the\nI/O blob is not still open in the returned image since this causes\nproblems.</li>\n<li>magick/blob.c (CloneBlobInfo): Use a cloning approach which does\nnot require manually keeping structure members in sync.</li>\n<li>coders/msl.c (ProcessMSLScript): Need to close I/O blob before\nreturning.</li>\n<li>coders/psd.c (ReadPSDImage): Assure that allocated image is not\ndereferenced before checking if it is NULL.  Check some memory\ncalculations for overflow.\n(ReadPSDImage): Need to close I/O blob before returning.</li>\n<li>coders/dib.c (ReadDIBImage): Use DestroyBlob() rather than\nDestroyBlobInfo().</li>\n<li>coders/bmp.c (ReadBMPImage): Use DestroyBlob() rather than\nDestroyBlobInfo().</li>\n<li>magick/blob.c: Improve blob tracing.</li>\n</ul>\n</blockquote>\n<p>2016-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Fix reading 24-bit Microsoft BMP\nwhich claims to have a colormap.</li>\n</ul>\n</blockquote>\n<p>2016-04-13 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/input_complex_lsb_double_V4.mat Demo Matlab V4\ncomplex file.</li>\n<li>coders/mat.c Missing break added.</li>\n</ul>\n</blockquote>\n<p>2016-04-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (ReadXPMImage): Fix SourceForge issue #361\n&quot;out-of-bounds read in coders/xpm.c:150:24&quot;</li>\n<li>coders/psd.c (ReadPSDImage): Add some defensive code to assure\nthat image layers are not freed twice.</li>\n</ul>\n</blockquote>\n<p>2016-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (InitializeLogInfo): Simplify LogInfo structure and\nits allocation in order to lessen the amount of fixed overhead.</li>\n</ul>\n</blockquote>\n<p>2016-04-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c (WriteJP2Image): Fix SourceForge issue #378 &quot;jp2:\nimpossible to create lossless jpeg-2000&quot;.  With this fix,\nspecifying 'define jp2:rate=1.0' or '-quality 100' results in a\nlossless JP2 file.</li>\n</ul>\n</blockquote>\n<p>2016-04-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/common.h: Update for GCC 5.</li>\n<li>PerlMagick/MANIFEST: Update PerlMagick manifest.</li>\n<li>PerlMagick/t/{read.t, write.t}: Add tests for MAT v4.</li>\n</ul>\n</blockquote>\n<p>2016-04-03 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Matlab V4 attempt to read complex part of data.</li>\n</ul>\n</blockquote>\n<p>2016-04-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/features.pl.in: Provide a way that PerlMagick\nfeature tests can test if a feature is supported.  Use it to make\nthe PSD test optional.</li>\n<li>coders/Makefile.am: Only build PSD module if\nENABLE_BROKEN_CODERS is enabled.</li>\n<li>magick/module.c (UnloadModule): Only invoke the module\nunregister function if it is defined.  The module register\nfunction is not defined if either the register or unregister\nfunctions were not found in the module which was loaded.</li>\n</ul>\n</blockquote>\n<p>2016-04-02 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>coders/mat.c Matlab V4 files are also rotated.</dt>\n<dd>* PerlMagick/t/input_gray_lsb_double_V4.mat   Demo Matlab V4 file.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2016-04-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (GetMagickInfo): Only declare that ExceptionInfo\nargument is not used if modules are not supported.</li>\n</ul>\n</blockquote>\n<p>2016-03-28 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Attempt to read Matlab V4 files.</li>\n</ul>\n</blockquote>\n<p>2016-03-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (DestroyImage): Simply return if image is NULL\nsince it is more user-friendly.</li>\n<li>magick/shear.c (RotateImage): Fix Coverity issue 124519\n&quot;Logically dead code&quot;.</li>\n<li>magick/effect.c (BlurImage): Fix Coverity issue 124520\n&quot;Dereference after null check&quot;.</li>\n<li>coders/pdb.c (WritePDBImage): Fix SourceForge bug #360\n&quot;out-of-bounds read in utilities/gm+0x80fcc71) (PDB reader)&quot;.</li>\n<li>coders/meta.c (convertHTMLcodes): Fix SourceForge bug #373\n&quot;out-of-bounds read in coders/meta.c:444:50&quot;\n(ReadMETAImage): Fix SourceForge bug #364 &quot;out-of-bounds write in\ncoders/meta.c:1331:7&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-03-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c (ReadSGIImage): Fix SourceForge bug #366\n&quot;out-of-bounds write in coders/sgi.c:528:4&quot; and bug #369\n&quot;out-of-bounds write in coders/sgi.c:535:4&quot;.</li>\n<li>coders/rle.c (ReadRLEImage): Fix SourceForge bug #371\n&quot;out-of-bounds read in coders/rle.c:633:39&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-03-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c (ReadDIBImage): Fix SourceForge bug #367\n&quot;out-of-bounds read in coders/dib.c:706:13&quot; and bug #370\n&quot;out-of-bounds read in coders/dib.c:716:15&quot;.</li>\n<li>coders/pict.c (ReadPICTImage): Fix SourceForge bug #365\n&quot;out-of-bounds read in magick/image.c:1305:3&quot;</li>\n<li>magick/utility.c (GetPageGeometry): Fix SourceForge bug #374\n&quot;out-of-bounds write in magick/utility.c:4355:7&quot;</li>\n</ul>\n</blockquote>\n<p>2016-03-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Fix SourceForge bug #376 &quot;SIGABRT\nin magick/colorspace.c:1052&quot;.</li>\n<li>magick/shear.c (RotateImage): Fix SourceForge bug #375 &quot;SIGABRT\nin magick/image.c:1230&quot;.</li>\n<li>coders/sun.c (DecodeImage): Fix SourceForge bug #368\n&quot;out-of-bounds read in coders/sun.c:223:17&quot; and bug #363\n&quot;out-of-bounds read in coders/sun.c:221:16&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-03-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (GetUserSpaceCoordinateValue): Fix stack buffer\noverflow when reading file 'aaphrbkwwe.svg.-632425326915265752'\nfrom CVE-2016-2317 problem files.  Partial fix for SourceForge bug\n#358 &quot;CVE-2016-2317 - SVG heap/stack buffer overflows&quot;.</li>\n<li>magick/utility.c (MagickGetToken): New private function to\nreplace GetToken().  The new function accepts a token buffer\nlength argument.  GetToken() is modified to assume a token buffer\nlength 'MaxTextExtent'.  All code using GetToken() is updated to\nuse MagickGetToken().</li>\n<li>coders/svg.c: Fix heap buffer overflow when reading file\n&quot;aaphrbkwwe.svg.4495884156523242589&quot; from CVE-2016-2317 problem\nfiles.  Partial fix for SourceForge bug #358 &quot;CVE-2016-2317 - SVG\nheap/stack buffer overflows&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-03-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/psd.c (ReadPSDImage): Fix SourceForge bug #341\n&quot;out-of-bounds read in coders/psd.c:1435&quot;.\n(WriteWhiteBackground): Fix SourceForge bug #350 &quot;SEGV in\ncoders/psd.c:1685&quot;.\n(DecodeImage): Fix SourceForge bug #351 &quot;heap-buffer-overflow in\ncoders/psd.c:142&quot;.\n(ReadPSDImage): Fix SourceForge bug #342 &quot;out-of-bounds write in\ncoders/psd.c:892&quot;</li>\n<li>coders/xcf.c (load_tile): Fix SourceForge bug #337\n&quot;heap-buffer-overflow in coders/xcf.c:373&quot;.</li>\n<li>coders/pict.c (WritePICTImage): Fix SourceForge bug #340\n&quot;out-of-bounds write in coders/pict.c:1929&quot;.</li>\n<li>coders/pdb.c (WritePDBImage): Fix SourceForge bug #348\n&quot;heap-buffer-overflow in coders/pdb.c:949:26&quot;.</li>\n<li>coders/xpm.c (ReadXPMImage): Fix SourceForge bug #334\n&quot;heap-buffer-overflow in coders/xpm.c:150&quot;.</li>\n</ul>\n</blockquote>\n<p>2016-03-09 Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Fixed huge image limitation.</li>\n</ul>\n</blockquote>\n<p>2016-03-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sun.c (WriteSUNImage): Fix SourceForge bug #343\n&quot;out-of-bounds write in coders/sun.c:962&quot;.</li>\n<li>coders/rle.c (ReadRLEImage): Fix SourceForge bug #344\n&quot;out-of-bounds write in coders/rle.c:524&quot;.</li>\n<li>coders/xpm.c (ReadXPMImage): Fix SourceForge bug #335\n&quot;out-of-bounds read in coders/xpm.c:154 &quot;.</li>\n</ul>\n</blockquote>\n<p>2016-03-06  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc (-extent): Revised the example to\nclarify the interaction of -gravity with the &quot;geometry&quot; offsets.</li>\n</ul>\n</blockquote>\n<p>2016-03-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Add support for --enable-broken-coders which\ndetermines if broken or hazardous file format support should be\nenabled in the build.  Currently Adobe Photoshop (PSD) format is\nincluded in this category.</li>\n<li>Rotate Changelog for new year.  Update documentation copyrights\nfor new year.</li>\n</ul>\n</blockquote>\n<p>2016-03-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff/libtiff/tif_config.h (HAVE_SNPRINTF): Define HAVE_SNPRINTF\nwhen using Microsoft Visual C++ 14 (Visual Studio 2015) or later.\nThis is based on advice by Pablo Elpuro.</li>\n</ul>\n</blockquote>\n<p>2016-02-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Image.cpp (xResolution): New method to support\nsetting the horizontal resolution with double precision.\n(yResolution): New method to support setting the vertical\nresolution with double precision.</li>\n<li>www/Hg.rst: Document the ssh public keys for the server hosting\nthe development Mercurial repository.</li>\n</ul>\n</blockquote>\n<p>2016-02-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (ReadXPMImage): Fix SourceForge bug #333\nheap-buffer-overflow in coders/xpm.c:409.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2017.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2017.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2017-12-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwfile.tap: Add tests for MIFF compressed sub-formats.</li>\n</ul>\n</blockquote>\n<p>2017-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (OpenBlob): Zlib 1.2.8 does not accept an open\nmode of &quot;w+b&quot; or &quot;wb+&quot;.  It seems to be allergic to '+'.  As a\nresult, writing to &quot;.gz&quot; files was not working with Zlib 1.2.8.\nNote that &quot;w+b&quot; must be used in the normal case since the test\nsuite fails otherwise!</li>\n</ul>\n</blockquote>\n<p>2017-12-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Fix SourceForge issue #535\n&quot;heap-buffer-overflow in ReadMNGImage&quot;.  Problem was caused by\naccessing byte before testing that limit has been reached, rather\nthan testing for limit before accessing the byte.  This means that\nit could only ever read one past the buffer allocation size.</li>\n<li>coders/webp.c (WriteWEBPImage): Fix SourceForge issue #536\n&quot;stack-buffer-overflow in WriteWEBPImage&quot;.  Due to a change to use\nWebPMemoryWriter as part of the EXIF and ICC profile support\naddition (enabled with libwebp 0.5.0), the progress indicator\ncallback is now passed a pointer to a wrong structure.  This is\nquite unfortunate since the progress indication is useful.  The\nprogress indication is temporarily disabled when the\nWebPMemoryWriter is in use until a solution is implemented.\n(ProgressCallback): Re-implement progress callback so that image\npointer is stored/retrieved as thread-specific data.</li>\n<li>coders/png.c (ReadMNGImage): Fix SourceForge issue #537 &quot;null\npointer dereference in ReadMNGImage&quot;.  DEFI chunk must be at least\n2 bytes long.</li>\n<li>coders/tiff.c (ReadNewsProfile): Fix SourceForge issue #533\n&quot;heap-buffer-overflow on LocaleNCompare&quot;.  LocaleNCompare() was\nbeing allowed to read heap data beyond the allocated region.</li>\n</ul>\n</blockquote>\n<p>2017-12-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/shear.c (IntegralRotateImage): Assure that reported error\nin rotate by 270 case does immediately terminate processing.\nReturn a NULL Image pointer if there is a problem rather than a\ncorrupted image.  Fix is related to SourceForge issue #532\n&quot;heap-buffer-overflow bug in ReadWPGImage&quot;.</li>\n<li>magick/pixel_cache.c (AcquireCacheNexus): Add a check that the\npixel cache is compatible with the image dimensions.  Fix is\nrelated to SourceForge issue #532 &quot;heap-buffer-overflow bug in\nReadWPGImage&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-12-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Fix SourceForge issue #530\n&quot;heap-buffer-overflow in ReadOneJNGImage&quot;.  In this case there is\na read one byte beyond the oFFs chunk allocation size due to an\nerror in specifying an offset into the chunk.</li>\n<li>coders/palm.c (ReadPALMImage): Fix SourceForge issue #529\n&quot;global-buffer-overflow in ReadPALMImage&quot;.  This issue only\noccured in builds with QuantumDepth=8 due to the small range of\nIndexPacket.</li>\n</ul>\n</blockquote>\n<p>2017-12-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/{Magick.pm, Magick.pm.in, Makefile.PL.in}: Only base\nPerlMagick version on numeric portion of PACKAGE_VERSION.</li>\n</ul>\n</blockquote>\n<p>2017-12-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/index.rst: Update to 1.3.27.</li>\n<li>www/Changes.rst: Add 1.3.27</li>\n<li>version.sh: Update library versioning.</li>\n<li>NEWS.txt: Update NEWS in preparation for releasing 1.3.27.</li>\n</ul>\n</blockquote>\n<p>2017-12-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (DCM_ReadElement): Change size checks addressing\nCVE-2017-12140 to be based on size_t rather than magick_off_t due\nto apparent instability of the previous check across compilers.</li>\n</ul>\n</blockquote>\n<p>2017-12-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): Fix heap read access outside of\nallocated PixelPacket array while testing pixels for opacity.\nResolves SourceForge issue #526 &quot;heap-buffer-overflow in\nWriteOnePNGImage&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-12-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (WritePNMImage): Fix SourceForge bug #525\n&quot;heap-buffer-overflow in MagickBitStreamMSBWrite&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-12-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (DCM_ReadElement): Eliminate huge memory allocation\nbased on bogus length value. Addresses CVE-2017-12140. Problem was\nreported via email from Petr Gajdos on Tue, 5 Dec 2017.</li>\n</ul>\n</blockquote>\n<p>2017-12-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Image.cpp (colorMap): Try to eliminate Coverity CID\n172796 &quot;Dereference after null check&quot; which seems to be bogus.</li>\n<li>coders/png.c (WriteOnePNGImage): Fix Coverity CID 168053\n&quot;Dereference after null check&quot;.  The check for null and the error\nreport which attempted to use the null value was not needed at\nall.</li>\n<li>coders/cut.c (GetCutColors): Fix Coverity CID 10181: &quot;Null\npointer dereferences&quot;. SetImagePixels() may return NULL.</li>\n<li>coders/rgb.c (ReadRGBImage): Fix SourceForge issue #523\n&quot;heap-buffer-overflow&quot;.  Similar issue to cmyk.c.</li>\n<li>coders/gray.c (ReadGRAYImage): Fix SourceForge issue #522\n&quot;heap-buffer-overflow&quot;.  Similar issue to cmyk.c.</li>\n<li>coders/cmyk.c (ReadCMYKImage): Fix SourceForge issue #521\n&quot;heap-buffer-overflow&quot;. The requested tile must be within the\nbounds of the image.  As it happens, 'montage' passes size and\ntile information which is useless for reading a raw image so it is\nnot possible to read raw CMYK using 'montage'.</li>\n</ul>\n</blockquote>\n<p>2017-12-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pwp.c (ReadPWPImage): Eliminate dereference of null image\npointer.  Addresses CVE-2017-11640.  Also address access to\nuninitialized memory.  Problem was reported via email from Petr\nGajdos on Wed, 29 Nov 2017.</li>\n</ul>\n</blockquote>\n<p>2017-11-22  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Additional check for wrong bpp CVE-2017-14342.</li>\n</ul>\n</blockquote>\n<p>2017-11-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Image.cpp (autoOrient): Add method to auto-orient\nan image so it looks right-side up by default.  Based on patch by\nPrzemysław Sobala submitted as SourceForge patch #53 &quot;Add\nMagick::Image::autoOrient() method to Magick++ library&quot;.</li>\n<li>www/download.rst: Change &quot;Czechoslovakian ftp mirror&quot; to &quot;Czech\nftp mirror&quot;.  Resolves SourceForge bug #520 &quot;[web] Download sites:\nnon-existent country&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-11-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (ReadWPGImage): Fix excessive use of disk resources\ndue to unreasonable record length.  Addresses CVE-2017-14341.\nNotified of this issue (with suggested patch) via email by Petr\nGajdos on Tue, 21 Nov 2017.</li>\n</ul>\n</blockquote>\n<p>2017-11-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>README.txt: Comprehensive white-space clean-up across\nGraphicsMagick core source files.  Hard TAB character is converted\nto spaces.  Trailing white-space garbage is stripped.</li>\n<li>magick/colormap.c (MagickConstrainColormapIndex): Deprecate use\nof MagickConstrainColormapIndex() and prefer use of\nVerifyColormapIndex() and VerifyColormapIndexWithColors() due to\navoiding dependence on index type, allowing provision of colors\nother than image-&gt;colors, and capturing more useful source file\nand line information.</li>\n<li>coders/{rle.c, mat.c, xbm.c, sgi.c, png.c}: Eliminate size_t vs\nunsigned 32 conversion warnings in WIN64 build.</li>\n</ul>\n</blockquote>\n<p>2017-11-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff: Import libtiff 4.0.9.</li>\n</ul>\n</blockquote>\n<p>2017-11-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (DecodeImage): &quot;Right-size&quot; and &quot;Right-type&quot;\nDecodeImage() variables and check for EOF at every point of the\nway.  Pass buffer size as an argument.</li>\n<li>coders/dib.c (DecodeImage): &quot;Right-size&quot; and &quot;Right-type&quot;\nDecodeImage() variables and check for EOF at every point of the\nway.  Pass buffer size as an argument.</li>\n<li>coders/bmp.c (_BMPInfo): &quot;Right-size&quot; BMPInfo members.  The\n'long' type is promoted to 64-bit on LP64 systems and the large\nsize is not needed.</li>\n</ul>\n</blockquote>\n<p>2017-11-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/webp.c: Incorporate patch by Jan Spitalnik to add EXIF\nand ICC metadata support to the WebP coder.  While WebP is still\nsupported back to libwebp 0.1.99, the metadata support requires at\nleast libwebp 0.5.0.  Resolves SourceForge patch #52 &quot;Add EXIF/ICC\nmetadata support to WebP coder&quot;.</li>\n<li>coders/png.c (ReadOneJNGImage): Fix JNG memory leaks when JPEG\nimage fails to be read.\n(WriteOnePNGImage): Promotion of indexed PNG to RGBA lacked\nsetting of image matte, resulting in undersized buffer allocation\nand heap overflow.  Fixes SourceForge bug #453 &quot;Heap overflow in\nsource-gra/coders/png.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-11-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sfw.c (SFWScan): Fix heap buffer overflow\n(CVE-2017-13134).  Notified of problem via email (including a\npatch) from Petr Gajdos on Mon, 6 Nov 2017.</li>\n</ul>\n</blockquote>\n<p>2017-11-05  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Wrong MaxMap check condition - fixed.</li>\n</ul>\n</blockquote>\n<p>2017-11-04  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Check for InsertRow() return value.</li>\n</ul>\n</blockquote>\n<p>2017-11-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/export.c: Add not-null check for indexes pointer where\nneeded.</li>\n<li>magick/import.c: Add not-null check for indexes pointer with\nassociated exception report where the indexes pointer is needed.\n(ImportCMYKQuantumType): Was wrongly importing an opacity channel\nin some cases. Would have crashed if these cases were ever used.</li>\n<li>coders/wpg.c (ReadWPGImage): Assure that colormapped image is a\nPseudoClass type with valid colormapped indexes.  Fixes\nSourceForge bug 519 &quot;Null Pointer Dereference (Write) with\nmalformed WPG Image&quot;.</li>\n<li>coders/sfw.c (ReadSFWImage): Avoid possible heap overflow while\ncopying JFIF magic into buffer. Reject runt files.  Fixes\nCVE-2017-12983.  Notified of problem via email from Petr Gajdos on\nThu, 2 Nov 2017.</li>\n</ul>\n</blockquote>\n<p>2017-10-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Fix SourceForge bug #517 &quot;Push\noperations in DrawImage can lead to negative strncpy when looking\nfor pop&quot;.  Interestingly, valgrind and ASAN only detected a\nproblem with one of the test cases since exercised code which\nupdated an array using the index.  It appears that Linux strncpy()\nsimply ignores the bad request.</li>\n</ul>\n</blockquote>\n<p>2017-10-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Make sure that a reasonable\nexception is reported to the user when there is a read failure.</li>\n</ul>\n</blockquote>\n<p>2017-10-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Reject JNG files with\nunreasonable dimensions given the file size.</li>\n</ul>\n</blockquote>\n<p>2017-10-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Fix SourceForge bug #518 &quot;Null\npointer in&quot;.  Also make sure that errors are reported properly due\nto problems with transferring JPEG scanlines.\n(ReadOneJNGImage): Add more checks for null value returned from\nSetImagePixels().</li>\n</ul>\n</blockquote>\n<p>2017-10-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/describe.c (DescribeImage): Fix possible heap read\noverflow while accessing heap data, and possible information\ndisclosure while describing the IPTC profile.  Report was provided\nvia email from Maor Shwartz to the graphicsmagick-security mail\nalias on Thu, 19 Oct 2017.  Independent security researchers,\nJeremy Heng (&#64;nn_amon) and Terry Chia (Ayrx), reported this\nvulnerability to Beyond Security’s SecuriTeam Secure Disclosure\nprogram. Please note that this interface is usually (but not\nexclusively) used from within the command-line utility program, in\nwhich case there is not much useful information which might be\ndisclosed.\n(DescribeImage): Fix possible heap write overflow when describing\nvisual image directory.  Report was provided via email from Maor\nShwartz to the graphicsmagick-security mail alias on Thu, 19 Oct\n2017.  Independent security researchers, Jeremy Heng (&#64;nn_amon)\nand Terry Chia (Ayrx), reported this vulnerability to Beyond\nSecurity’s SecuriTeam Secure Disclosure program. Please note that\nthis interface is usually (but not exclusively) used from within\nthe command-line utility program, in which case the only harm\nwould be a program crash.</li>\n<li>magick/constitute.c (WriteImage): Assure that the errno present\nwhen the blob error status first occured is reported to the user.</li>\n<li>magick/blob.c (GetBlobStatus): Blob error status is now updated\nimmediately upon the first error reported.\n(GetBlobFirstErrno): Returns errno value when the first blob error\nwas reported.  This is useful for error reporting.</li>\n</ul>\n</blockquote>\n<p>2017-10-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (WriteImage): Restore use of GetBlobStatus()\nto test if an I/O error was encountered while writing output file.\nThis assures that I/O failure in writers which do not themselves\nverify writes is assured to be reported.</li>\n</ul>\n</blockquote>\n<p>2017-10-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/webp.c (WriterCallback): WebP writer now detects partial\nwrite to output file.  Patch by Przemysław Sobala from a posting\non Mon, 16 Oct 2017 via the graphicsmagick-help mailing list.</li>\n</ul>\n</blockquote>\n<p>2017-10-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (MontageImageCommand): Fix memory leaks in\nerror return path.  Only people doing leak testing or the few who\nexecute MontageImageCommand() as a function will care about this.</li>\n<li>magick/studio.h (NumberOfObjectsInArray): The\nNumberOfObjectsInArray() macro is used to compute the number of\nwhole objects in an array.  Instead it was rounding up, resulting\nin scrambling the heap beyond the allocation.  Fixes\nCVE-2017-13737 &quot;There is an invalid free in the MagickFree\nfunction in magick/memory.c in GraphicsMagick 1.3.26 that will\nlead to a remote denial of service attack.&quot;</li>\n</ul>\n</blockquote>\n<p>2017-10-09  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Suppress &quot;comparison between\nsigned and unsigned integer expressions&quot; warning.</li>\n<li>coders/png.c (ReadJNGImage): Fix memory leak in SourceForge\nIssue #469 &quot;use after free in ReadJNGImage&quot;.</li>\n<li>coders/png.c (ReadJNGImage): Fix memory leak in SourceForge\nIssue #470 &quot;Assert failure in writeblob&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc: Fix SourceForge issue #444 &quot;gm mogrify: Wrong\ndocumentation for option -output-directory&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-10-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/module.c (InitializeModuleSearchPath): Verify that any\ncomponent paths specified in MAGICK_CODER_MODULE_PATH and\nMAGICK_FILTER_MODULE_PATH exist before adding them to search paths\nactually used, and convert to real paths if possible.  This avoids\npossible use of relative paths to load modules (a possible\nsecurity issue) and may improve efficiency by removing\nnon-existent paths.</li>\n<li>coders/yuv.c (ReadYUVImage): Fix leak of scanline upon Image\nallocation failure.  Patch submitted by Petr Gajdos via email on\nFri, 6 Oct 2017.</li>\n</ul>\n</blockquote>\n<p>2017-09-13  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Attempt to fix SourceForge Issue #469 &quot;use after\nfree in ReadJNGImage&quot;.  Note that this change was found to replace\na use after free with a memory leak so the problem is not solved\nyet.</li>\n</ul>\n</blockquote>\n<p>2017-10-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (DCM_ReadNonNativeImages): Additional fix\n(improvement) for SourceForge issue #512 &quot;NULL Pointer Dereference\nin DICOM Decoder&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-10-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (ReadDCMImage): Fix SourceForge issue #512 &quot;NULL\nPointer Dereference in DICOM Decoder&quot;.</li>\n<li>coders/pict.c (ReadPICTImage): Fix SourceForge issue #511\n&quot;Memory Allocation error due to malformed image file&quot;.</li>\n<li>coders/pnm.c (WritePNMImage): Fix SourceForge issue #503 &quot;memory\nleak in WritePNMImage&quot;.</li>\n<li>coders/png.c (ReadMNGImage): Fix SourceForge issue #501 &quot;memory\nleak in ReadMNGImage&quot;.</li>\n<li>magick/segment.c (InitializeIntervalTree): Fix SourceForge issue\n#507 &quot;null pointer in segment.c&quot; and issue #508 &quot;null pointer in\nsegment.c&quot;.</li>\n<li>coders/topol.c (ReadTOPOLImage): Fix SourceForge issue #510\n&quot;null pointer and meory leak in topol.c&quot;.</li>\n<li>magick/widget.c (MagickXFileBrowserWidget): Fix SourceForge\nissue #506 &quot;null pointer in widget.c&quot;.</li>\n<li>coders/tiff.c (WriteTIFFImage): Fix SourceForge issue #509\n&quot;Memory leak in tiff.c&quot;.</li>\n<li>magick/module.c (FindMagickModule): Fix SourceForge issue #502\n&quot;null pointer in module.c&quot;.</li>\n<li>coders/avs.c (ReadAVSImage): Fix Coverity CID 184115 &quot;Control\nflow issues (DEADCODE)&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-09-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/avs.c (ReadAVSImage): Fix SourceForge issue #499 &quot;memory\nleak in avs.c&quot;.</li>\n<li>coders/cmyk.c (ReadCMYKImage): Fix SourceForge issue #498\n&quot;memory leak in cmyk.c&quot;.</li>\n<li>coders/cut.c (ReadCUTImage): Fix SourceForge issue #497 &quot;memory\nleak in cut.c&quot;.</li>\n<li>coders/dpx.c (ReadDPXImage): Fix SourceForge issue #496 &quot;memory\nleak in dpx.c&quot;.</li>\n<li>coders/hdf.c (ReadHDFImage): Fix SourceForge issue #495 &quot;memory\nleak in hdf.c&quot;.</li>\n<li>coders/pcx.c (ReadPCXImage): Fix SourceForge issue #494 &quot;memory\nleak in pcx.c&quot;.</li>\n<li>coders/pcd.c (ReadPCDImage): Fix SourceForge issue #493 &quot;memory\nleak in ReadPCDImage&quot;.</li>\n<li>coders/histogram.c (WriteHISTOGRAMImage): Fix SourceForge issue\n#492 &quot;memory leak in WriteHISTOGRAMImage&quot;.</li>\n<li>coders/gif.c (WriteGIFImage): Fix SourceForge issue #491 &quot;memory\nleak in WriteGIFImage&quot;.</li>\n<li>coders/fits.c (WriteFITSImage): Fix SourceForge issue #490\n&quot;memory leak in WriteFITSImage&quot;.</li>\n<li>coders/palm.c (WritePALMImage): Fix SourceForge issue #489\n&quot;memory leak in WritePALMImage&quot;.</li>\n<li>coders/rgb.c (ReadRGBImage): Fix SourceForge issue #488 &quot;Memory\nleak in rgb.c&quot;.</li>\n<li>coders/palm.c (ReadPALMImage): Fix SourceForge issue #487 &quot;NULL\npointer dereference in ReadPALMImage&quot;.</li>\n<li>Magick++/lib/Options.cpp (strokeDashArray): Fix SourceForge\nissue #486 &quot;NULL pointer dereference in\nMagick::Options::strokeDashArray&quot;.</li>\n<li>magick/nt_feature.c (NTGetTypeList): Fix SourceForge issue #485\n&quot;NULL pointer dereference in NTGetTypeList&quot;.</li>\n<li>coders/sun.c (ReadSUNImage): Fix SourceForge issue #484 &quot;Memory\nleak in sun.c&quot;.</li>\n<li>coders/tim.c (ReadTIMImage): Fix SourceForge issue #483 &quot;Memory\nleak in tim.c&quot;.</li>\n<li>magick/nt_base.c (NTRegistryKeyLookup): Fix SourceForge issue\n#482 &quot;NULL pointer dereference in NTRegistryKeyLookup&quot;.</li>\n<li>coders/viff.c (ReadVIFFImage): Fix SourceForge issue #481\n&quot;Memory leak in viff.c&quot;.</li>\n<li>magick/profile.c (SetImageProfile): Fix SourceForge issue #480\n&quot;assertion failure in MagickMapAllocateMap&quot;.</li>\n<li>coders/yuv.c (ReadYUVImage): Fix SourceForge issue #478 &quot;Memory\nleak in yuv.c&quot;.</li>\n<li>magick/map.c (MagickMapCloneMap): Fix SourceForge issue #477\n&quot;assertion failure in MagickMapIterateNext&quot;.</li>\n<li>coders/emf.c (ReadEnhMetaFile): Fix SourceForge issue #475 &quot;NULL\npointer dereference in ReadEnhMetaFile&quot;.</li>\n<li>coders/cineon.c (ReadCINEONImage): Fix SourceForge issue #473\n&quot;NULL pointer dereference in ReadCINEONImage&quot;</li>\n<li>coders/tiff.c (TIFFIgnoreTags): Fix SourceForge issue #476 &quot;NULL\nPointer in tiff.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-09-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (GetConfigureBlob): Fix SourceForge issue #472\n&quot;NULL Pointer in GetConfigureBlob&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-09-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/rle.c (ReadRLEImage): Fix SourceForge issue #458 &quot;Heap\nout of bounds read in ReadRLEImage()&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-09-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c (ReadSGIImage): Check for EOF while reading SGI\nfile header.  Issue was brought to our attention by Petr Gajdos\nvia email on Fri, 1 Sep 2017.</li>\n</ul>\n</blockquote>\n<p>2017-09-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Allow a single scanline, strip,\ntile, to be 1000X larger than the input file in order to not cause\nproblems for extremely compressible images or tile sizes much\nlarger than the pixel dimensions.</li>\n</ul>\n</blockquote>\n<p>2017-09-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/symbols.h, wand/wand_symbols.h: Update C library symbols\nwhich should be prefixed with 'Gm'. However, GM will not move\nMagick++ namespace because of the ImageMagick version.  Resolves\nSourceForge issue #468 &quot;--enable-symbol-prefix does not prevent\nclashes with libMagick++ or libMagickWand?&quot;</li>\n<li>coders/png.c (DestroyJNG): DestroyJNG should be a static\nfunction.  Was wrongly exposed as DestroyJNGInfo in 1.3.26.  This\nis not a public function and was not intended to be part of the\nABI.</li>\n<li>coders/tiff.c (ReadTIFFImage): Limit scanline, strip, and tile\nmemory allocations based on file size multiplied by a maximum\ncompression ratio.  Fixes SourceForge issues #460, #461, #462,\n#463, #464 &quot;allocation failure in ReadTIFFImage&quot;.</li>\n<li>coders/pnm.c (ReadPNMImage): Require that XV 332 format have 256\ncolors.  Fixes SourceForge issue #465 &quot;NULL Pointer Dereference\ntriggered by malformed file&quot;.  In our own testing the test case\nproduced an assertion failure because assertions were enabled.</li>\n<li>magick/colormap.c (AllocateImageColormap): Use unsigned array\nindex.</li>\n</ul>\n</blockquote>\n<p>2017-09-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (ReadMATImage): Fix CVE-2016-10070, which is a heap\noverflow in the MAT reader due to an under-sized memory\nallocation.  Based on private email from Petr Gajdos on Mon, 11\nSep 2017.</li>\n</ul>\n</blockquote>\n<p>2017-09-13  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Check MemoryResource before allocating\nping_pixel array.</li>\n</ul>\n</blockquote>\n<p>2017-09-11  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>magick/shear.c: Possible evil loop might waste CPU for long time</dt>\n<dd>without any reason.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2017-09-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Fix SourceForge issue #448 &quot;Heap\nout of bounds read in DrawDashPolygon()&quot;.  Problem was reported by\nKamil Frankowicz on August 28, 2017.</li>\n<li>coders/uil.c (WriteUILImage): Fix crash in UIL writer when\nwriting image containing transparency.  Issue was reported by\nLCatro via email on 18 Jul 2017.</li>\n<li>coders/wpg.c (InsertRow): Fix crash which occurs if image is not\nPseudoClass but a PseudoColor scanline is needed.  Resolves\nSourceForge issue #449 &quot;Null pointer dereference in InsertRow()&quot;.</li>\n<li>coders/rle.c (ReadRLEImage): Impose image dimension limits\naccording to Utah RLE specification. Cap number of planes handled\ninternally at 4.  Remove non-standard multi-frame extension, which\ndid not work anyway.</li>\n</ul>\n</blockquote>\n<p>2017-09-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadJNGImage): Complete fixing CVE-2017-8350 crash\nwhile reading a malformed JNG file.</li>\n<li>coders/{html.c, map.c, plasma.c, png.c, psd.c, rle.c, stegano.c,\nuil.c}: Downgrade claimed coder stability level for HTML, SHTML,\nMAP, FRACTAL, PLASMA, JNG, MNG, RLE, STEGANO, and UIL formats.</li>\n</ul>\n</blockquote>\n<p>2017-09-08  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadJNGImage): More efforts toward fixing\nCVE-2017-8350 while reading a malformed JNG file.</li>\n</ul>\n</blockquote>\n<p>2017-09-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/error.c (ThrowLoggedException): Capture the first\nexception at ErrorException level or greater, or only capture\nexception if it is more severe than an already reported exception.\nThis should help lead to better error reports since the first\nerror is usually the most significant.</li>\n<li>coders/png.c (ReadJNGImage): Add &quot;improper header&quot; exception\nreporting.</li>\n</ul>\n</blockquote>\n<p>2017-09-01  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadJNGImage): Efforts toward fixing CVE-2017-8350\nwhile reading a malformed JNG file.</li>\n</ul>\n</blockquote>\n<p>2017-08-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (ReadWPGImage): Patch submitted by Petr Gajdos to\ncheck that .Width and .Height are greater than zero before they\nare assigned to image-&gt;columns and image-&gt;rows respectively\n(CVE-2014-9815).\n(ReadWPGImage): Do more validations on WPG_Palette.StartIndex and\nWPG_Palette.NumOfEntries.</li>\n</ul>\n</blockquote>\n<p>2017-08-29  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Fix for SourceForge issue #440\n&quot;use-after-free in CloseBlob (blob.c) (INCOMPLETE FIX FOR\nCVE-2017-11403)&quot; and SourceForge issue #438 &quot;heap use after free\nin CloseBlob&quot;.</li>\n<li>coders/png.c (ReadOneJNGImage): Fix for SourceForge issue #439\n&quot;assertion failure in magick/pixel_cache.c&quot;</li>\n</ul>\n</blockquote>\n<p>2017-08-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mpeg.c (WriteMPEGImage): Fix MPEG writer memory leak.\nOnly the first image in the coalesce image list was being freed.\nProblem was reported by LCatro via email on July 15, 2017.</li>\n<li>magick/attribute.c (TracePSClippingPath, TraceSVGClippingPath):\nFix SourceForge bug #447 &quot;Heap out of bounds read in\nReadMSBShort()&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-08-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xbm.c (ReadXBMImage): Fix two denial of service (DOS)\nissues in ReadXBMImage() which result in the reader not\nreturning. Problem was reported via email on Wed Aug 23 2017 by\nXiaohei and Wangchu from Alibaba Security Team.</li>\n<li>coders/jnx.c (ReadJNXImage): Fix denial of service (DOS) issue\nin ReadJNXImage() whereby large amounts of CPU and memory\nresources may be consumed although the file itself does not\nsupport the requests.  Problem was reported via email on Wed Aug\n23 2017 by Xiaohei and Wangchu from Alibaba Security Team.</li>\n</ul>\n</blockquote>\n<p>2017-08-14  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneMNGImage): Deal with invalid (too large)\nlength of MNG chunks (bug #446).</li>\n</ul>\n</blockquote>\n<p>2017-08-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (ReadPNMImage): Verify that sufficient file data\nexists to support what the file header requires before allocating\nmemory for it.  Fixes problem reported by Agostino Sarubbo via\nemail on Wed, 12 Jul 2017 and reported yet again via SourceForge\nbug #441 &quot;memory allocation failure in MagickRealloc&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-08-20  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c: Fix SourceForge bug #433 &quot;memory leak in\nReadMATImage&quot;.  Credit for discovering and reporting the problem\nis &quot;ADLab of Venustech&quot;.</li>\n<li>coders/sun.c (ReadSUNImage): Fix failure to allocate memory due\nto inadequate file data to support claimed image width and height.\nFirst notified by email from Agostino Sarubbo on 14 Jul 2017 and\nthen again as SourceForge bug #442 &quot;memory allocation failure in\nmagickmalloc&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-08-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (GetStyleTokens): Fix SourceForge bugs 434 &quot;heap\nbuffer overflow in GetStyleTokens&quot;, 435 &quot;null pointer\ndereference_in_SVGStartElement&quot;, and 436 &quot;heap buffer overflow in\nGetStyleTokens&quot; which all originated from a heap buffer overflow\nin GetStyleStokens(), or inconsistent initialization.  Now the\nimplementation truncates parsing for poorly-formed input (to avoid\nbuffer overflow) while still correctly parsing well-formed input.\nThe reproducers and problem reports are attributed to &quot;ADLab of\nVenustech&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-08-14  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Fixed double-free after\nreading a malformed JNG (Issue #438).</li>\n</ul>\n</blockquote>\n<p>2017-08-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcd.c (ReadPCDImage): Fix memory leak on return path due\nto corrupted header.  Patch included in email on 14 Aug 2017 by\nPetr Gajdos (ImageMagick CVE CVE-2017-8351).</li>\n</ul>\n</blockquote>\n<p>2017-08-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (ReadGIFImage): Assure that global colormap is\ninitialized.</li>\n<li>coders/pict.c (ReadPICTImage): Fix memory leaks in error return\npath.  ImageMagick CVE CVE-2017-8353.  Patch by Petr Gajdos.</li>\n</ul>\n</blockquote>\n<p>2017-08-11  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwblob.c and rwfile.c: Write the reason for FAIL in\ntest-suite.log.</li>\n<li>magick/image.h: Revised table of image orientations to show\nExif ImageOrientation values (which happen to be the same as\nthe enum values 1 to 8).</li>\n<li>coders/png.c: ReadJNGIMage(): fix memory leak (Issue 431).</li>\n</ul>\n</blockquote>\n<p>2017-08-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mtv.c (ReadMTVImage): Fix memory leak in error return\npath upon unexpected EOF (ImageMagick CVE-2017-9142).  Problem was\nbrought to our attention via email from Petr Gajdos on Wed, 9 Aug\n2017.  Also changed pixel cache access functions used to assure\ndelivery of exception to the user.</li>\n</ul>\n</blockquote>\n<p>2017-08-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac (SETJMP_IS_THREAD_SAFE): Decide if setjmp/longjmp\nare thread safe based on host OS.  Assume that these interfaces\nare thread safe by default.  Declared not to be thread safe under\nSolaris.  Declaring these interfaces to be thread safe increases\navailable concurrency for coders which use setjmp/longjmp for\nerror recovery (e.g. PNG and JPEG).</li>\n</ul>\n</blockquote>\n<p>2017-08-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (RegisterJPEGImage): Add support for the\nSETJMP_IS_THREAD_SAFE preprocessor definition (already used by\ncoders/png.c) to indicate if setjmp/longjmp are thread safe on\nthis platform and that it is safe for multiple encoders/decoders\nto be active at one time.</li>\n</ul>\n</blockquote>\n<p>2017-07-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sun.c: Fix heap read overflow while indexing into\ncolormap. Problem was reported via email on 17 Jul 2017 by\nAgostino Sarubbo.</li>\n</ul>\n</blockquote>\n<p>2017-07-31  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Stop a leak when rejecting a\nMNG image with dimensions that are too large.</li>\n</ul>\n</blockquote>\n<p>2017-07-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c (ReadWMFImage): Eliminate use of already freed heap\ndata in error reporting path.  Problem was reported via email by\nAgostino Sarubbo on Fri, 14 Jul 2017</li>\n</ul>\n</blockquote>\n<p>2017-07-25  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage) Free chunk allocation that remains\nafter attempting to read a truncated file.</li>\n<li>coders/png.c: Removed some redundant checks for chunk length\nbefore MagickFreeMemory(chunk), which is safe to call with a\nNULL argument.</li>\n<li>coders/png.c: Fixed writer bug due to missing brackets; a Log\nstatement should have been inside the &quot;i&quot; loop but instead was\nusing i++ left over from the loop.  Bug report by L. Catro.</li>\n<li>coders/png.c: Reject a MNG with dimensions greater than 65k\nby 65k.</li>\n<li>coders/png.c (WriteOnePNGImage): Return without crashing if\nWriteOnePNGImage is passed a NULL image. Fixes CVE-2017-11522.</li>\n</ul>\n</blockquote>\n<p>2017-07-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcl.c (WritePCLImage): Fix null pointer dereference in\nPCL writer when writing monochrome images.  Problem was reported\nby LCatro via email on July 18.</li>\n<li>magick/pixel_cache.c (PersistCache): Fix memory leak while\nwriting a MPC file.  Problem was reported by LCatro via email on\nJuly 18.</li>\n<li>coders/map.c (WriteMAPImage): Fix null pointer dereference or\nsegmentation violation in the MAP writer if the input image is not\nalready colormapped.  Problem was reported by LCatro via email on\nJuly 18.</li>\n<li>coders/gray.c (WriteGRAYImage): Improve tracing and tidy up.</li>\n<li>coders/rgb.c (WriteRGBImage): Fix heap overwrite in raw RGB\nwriter (all output subformats) given a multiframe sequence using\ndifferent widths.  Problem was reported by LCatro via email on\nJuly 18.</li>\n<li>coders/cmyk.c (WriteCMYKImage): Fix heap overwrite in raw CMYK\nwriter (all output subformats) given a multiframe sequence using\ndifferent widths.  Also fix wrong output of CMYKA (and vice-versa)\nwhen CMYK was intended.  Problem was reported by LCatro via email\non July 18.</li>\n<li>coders/palm.c: Disable the PALM writer since the writer is a\nwork in progress and still has implementation problems.  Perhaps\nno one in the world remains who cares about the undocumented PALM\nformat.  Resolves heap overflow and assertion issues reported by\nLCatro via emails on July 11th, and 12th, 2017.</li>\n<li>magick/colormap.c (ReplaceImageColormap): Throw an exception\nrather than assertion if the input image is not colormapped.</li>\n</ul>\n</blockquote>\n<p>2017-07-13  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Implemented eXIf chunk support.</li>\n</ul>\n</blockquote>\n<p>2017-07-12  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Fix typecast of left shifts (patch by Bob F)</li>\n</ul>\n</blockquote>\n<p>2017-07-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/ps.c (ReadPSImage): Fix reference to constant NULL image\nargument which is dereferenced to pass an exception to\nMagickMonitorFormatted().  Problem was reported by Agostino\nSarubbo via email on Wed, 12 Jul 2017.</li>\n</ul>\n</blockquote>\n<p>2017-07-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c: Add casts to fix undefined behavior in left\nshifts.  Issue was reported by Agostino Sarubbo via email on Mon,\n10 Jul 2017.</li>\n</ul>\n</blockquote>\n<p>2017-07-10  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Ignore out-of-bounds MOVE\nand CLIP object_id's.</li>\n<li>coders/png.c (ReadMNGImage): Fix apparent off-by-one error\nin MNG FRAM change_clipping processing.</li>\n<li>coders/png.c (ReadMNGImage): Fix out-of-order CloseBlob()\nand DestroyImageList() that caused a use-after-free crash.\nFixes CVE-2017-11403.  This bug was discovered by Agostino Sarubbo.</li>\n</ul>\n</blockquote>\n<p>2017-07-08  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJngImage): Revised double-free fix.</li>\n</ul>\n</blockquote>\n<p>2017-07-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Fix double-frees caused by\ncommit on 2017-07-06.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Defer creating pixel cache until\nafter successfully reading first scanline.  Classify some serious\nlibjpeg reported &quot;warnings&quot; as errors and quit processing\nscanlines immediately upon first error so that corrupt JPEG does\nnot consume excessive resources.  Resolves excessive resource\nconsumption issue reported for two JPEG files provided via email\nby LCatro on Tue, 4 Jul 2017.</li>\n</ul>\n</blockquote>\n<p>2017-07-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Remove spurious 'n' from log\nstatement.</li>\n</ul>\n</blockquote>\n<p>2017-07-06  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Consolidate JNG cleanup into a new DestroyJNG()\nfunction.</li>\n</ul>\n</blockquote>\n<p>2017-07-05  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: prevent a crash due to zero-length color_image\nwhile reading a JNG image. (CVE-2017-11102)</li>\n</ul>\n</blockquote>\n<p>2017-07-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Make sure is up to date.</li>\n<li>www/index.rst: Update for 1.3.26 release.</li>\n<li>version.sh: Update library versioning for 1.3.26 release.</li>\n<li>magick/command.c (BatchCommand): Add ferror() checks around\nbatch input loop.</li>\n</ul>\n</blockquote>\n<p>2017-07-03  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Reject a PNG file if the file size is too small\n(less than 61 bytes).  Reject a JNG file if it is too small (less\nthan 147 bytes).</li>\n<li>coders/jpeg.c: Reject a JPEG file if the file size is too small\n(less than 107 bytes).</li>\n</ul>\n</blockquote>\n<p>2017-07-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Compute required file size and\nverify that sufficient data exists in file before allocating\nmemory to decode the image data.  Resolves problem with DPX file\nwith valid header (but a huge claimed image width) provided\nprovided via email on Thu, 29 Jun 2017 by LCatro.  This issue has\nbeen assigned CVE-2017-10799.</li>\n</ul>\n</blockquote>\n<p>2016-07-02  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Check whether reported object size overflows file size.</li>\n</ul>\n</blockquote>\n<p>2016-07-01  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Safety check for forged and or corrupted data.\nThis issue has been assigned CVE-2017-10800.</li>\n</ul>\n</blockquote>\n<p>2017-07-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (&quot;QuantumTransferMode&quot;): Use a generalized method\nto enforce that buffer overflow can not happen while importing\npixels.  Resolves problem with RGB TIFF claiming only one sample\nper pixel provided via email on Thu, 29 Jun 2017 by LCatro.  This\nissue has been assigned CVE-2017-10794.</li>\n</ul>\n</blockquote>\n<p>2017-06-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Convert bare 'unsigned int' to MagickPassFail\nwhere suitable to make intentions clear.  Convert True/False to\nMagickTrue/MagickFalse or MagickPass/MagickFail according to\npurpose.  This is a continuation of a gradual migration and does\nnot represent an API change.</li>\n</ul>\n</blockquote>\n<p>2017-06-25  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Avoid NULL dereference when MAGN chunk processing\nfails (<a class=\"reference external\" href=\"https://sourceforge.net/p/graphicsmagick/bugs/426/\">https://sourceforge.net/p/graphicsmagick/bugs/426/</a>). Expand\nTABs.</li>\n</ul>\n</blockquote>\n<p>2017-06-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update NEWS with changes since the previous release.</li>\n<li>www/programming.rst: Switch the Lua link to\n<a class=\"reference external\" href=\"https://github.com/arcapos/luagraphicsmagick\">https://github.com/arcapos/luagraphicsmagick</a>, which is a more\ncomplete and direct interface from Lua to GraphicsMagick's Wand\nAPI.</li>\n</ul>\n</blockquote>\n<p>2017-06-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagick/installer/gm-foo-dll.iss: Remove PerlMagick from\nthe slim Inno Setup installer builder and remove mention of\nPerlMagick from the installer documentation.</li>\n<li>TclMagick/generic/TclMagick.c (magickCmd): Resolve SourceForge\npatch #51 &quot;TclMagick: memory access error; possible segfault&quot;.\n(newMagickObj): Fix formatting of pointer value so it is 64-bit\nsafe.  Resolves SourceForge patch #50 &quot;TclMagick: 64-bit\nportability issue&quot;.</li>\n<li>coders/pict.c (ReadPICTImage): Avoid possible use of negative\nvalue when indexing array, which would cause buffer overflow.\nResolves SourceForge issue #427 &quot;One possible buffer overflow\nvulnerability in\nGraphicsMagick-1.3.25/coders/pict.c:ReadPICTImage()&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-06-22  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Stop memory leak when reading invalid JNG image.\nFixes CVE-2017-8350.</li>\n</ul>\n</blockquote>\n<p>2017-06-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Fix lcms2.h inclusion logic.</li>\n<li>wand/magick_wand.c (MagickSetImageOrientation): Eliminate use of\nsnprintf, which is not supported by older Visual Studio.</li>\n</ul>\n</blockquote>\n<p>2017-06-09  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Accept exIf chunks whose data segment\nerroneously begins with &quot;Exif00&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-06-01  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Removed experimental zxIF chunk support.  That\nproposal is dead.</li>\n</ul>\n</blockquote>\n<p>2017-05-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>config/log.mgk: Added documentation suggested by SourceForge\nissue #419 &quot;Consider a small patch to log.mgk&quot;.</li>\n<li>www/Changes.rst: Add missing link to most recent changes.</li>\n</ul>\n</blockquote>\n<p>2017-05-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/Magick++/Image.rst: Improve documentation for Magick++\nImage::iccColorProfile() and Image::renderingIntent().</li>\n</ul>\n</blockquote>\n<p>2017-05-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff: Update to libtiff 4.0.8.</li>\n</ul>\n</blockquote>\n<p>2017-03-19  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Quieted a new Coverity complaint about a potential\ntext buffer overrun.</li>\n</ul>\n</blockquote>\n<p>2017-03-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c (SetImageInfo): Ignore empty magic prefix\nspecification and do not remove colon character from start of\nfilename.  Resolves SourceForge bug #415 &quot;Inconsistent Behavior w/\ninput_file Parameter&quot;.</li>\n</ul>\n</blockquote>\n<p>2017-03-18  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Added new private orNT PNG chunk, to\npreserve image-&gt;orientation when it is defined and not\nthe default TopLeft.</li>\n<li>coders/jpeg.c: Mention image-&gt;orientation in the log when\nwriting a JPEG.</li>\n</ul>\n</blockquote>\n<p>2017-03-15  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): Add version info about\ngm, libpng, zlib, and lcms to the PNG debug log.</li>\n</ul>\n</blockquote>\n<p>2017-03-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (ImportImageCommand): Fix handling of -frame\noptions. Option handling was incorrect due to option checking the\nframe option after it had been freed.  Checking the frame dash\noption before freeing the argument solves the problem.  From patch\nprovided by Victor Ananjevsky as SourceForge patch #49 &quot;-frame\ndoesn't work in gm import&quot;.</li>\n<li>Magick++/lib/Image.cpp (attribute): Added Image attribute method\nwhich accepts a 'char *' argument, and will remove the attribute\nif the value argument is NULL.  From patch provided by &quot;Gints&quot; as\nSourceForge patch #46 &quot;C++ api - method to clear/remove\nattribute&quot;.</li>\n<li>VisualMagick/configure/configure.cpp (InitInstance): Applied\npatch by Paul McConkey to allow the quantum command line argument\nto set the default value in the wizard drop list.  This allows\nsetting the quantum depth when the /nowizard argument was\nsupplied.  Resolves SourceForge patch #48 &quot;When running from the\ncommand line configure.exe does not use the quantum argument&quot;.\nThe provided configure.exe still needs to be rebuilt to\nincorporate this change.</li>\n<li>magick/command.c (MogrifyImage): The -orient command now also\nupdates the orientation in the EXIF profile, if it exists.</li>\n<li>Magick++/lib/Image.cpp (orientation): Update orientation in EXIF\nprofile, if it exists.</li>\n</ul>\n</blockquote>\n<p>2017-03-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c: Support PGX JPEG 2000 format for reading and\nwriting (within the bounds of what JasPer supports).</li>\n</ul>\n</blockquote>\n<p>2017-02-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (QuantumTransferMode): Fix out of bounds read when\nreading CMYKA TIFF which claims to have only 2 samples per pixel.\nProblem was reported via email on February 15, 2017 by Valon\nChu. This issue was assigned CVE-2017-6335.</li>\n</ul>\n</blockquote>\n<p>2017-01-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/options.imdoc (-geometry): Geometry documentation changes\nsuggested by Jon Wong.</li>\n</ul>\n</blockquote>\n<p>2017-01-26  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Added support for a proposed new PNG chunk\n(zxIf, read-only) that is currently being discussed on the\npng-mng-misc at lists.sourceforge.net mailing list.  Enable\nexIf and zxIf with CPPFLAGS=&quot;-DexIf_SUPPORTED -DxzIf_SUPPORTED&quot;.\nIf exIf is enabled, only the uncompressed exIF chunk will be\nwritten and the hex-encoded zTXt chunk containing the raw Exif\nprofile won't be written.</li>\n</ul>\n</blockquote>\n<p>2017-01-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/msl.c (MSLStartElement): Change test for NULL image\npointer to before it is used rather than after it is used.\nProblem reported by Petr Gajdos on 2017-01-25.</li>\n</ul>\n</blockquote>\n<p>2017-01-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>TclMagick/unix/m4/tcl.m4: Update tcl.m4 to TEA 3.10.  File\nsupplied by Massimo Manghi.</li>\n</ul>\n</blockquote>\n<p>2017-01-21  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Added support for a proposed new PNG\nchunk (exIf read-write, eXIf read-only) that is currently\nbeing discussed on the png-mng-misc at lists.sourceforge.net\nmailing list.</li>\n</ul>\n</blockquote>\n<p>2017-01-21  Glenn Randers-Pehrson  &lt;<a class=\"reference external\" href=\"mailto:glennrp&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">glennrp<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c: Added read_user_chunk_callback() function\nand used it to implement a private PNG caNv (canvas) chunk\nfor remembering the original dimensions and offsets when an\nimage is cropped.  Previously we used the oFFs chunk for this\npurpose, but this had potential conflicts with other applications\nthat also use the oFFs chunk.</li>\n</ul>\n</blockquote>\n<p>2017-01-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>TclMagick/Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Applied\npatch by Massimo Manghi to set AM_DISTCHECK_CONFIGURE_FLAGS so\nthat 'make distcheck' remembers configuration options, and also to\nuninstall pkgIndex.tcl.</li>\n<li>magick/image.c (SetImageEx): Use PixelIterateMonoSet() for\npossibly improved efficiency.</li>\n<li>magick/pixel_iterator.c (PixelIterateMonoSet): New pixel\niterator intended for use when initializing image pixels, without\nregard to existing values.</li>\n</ul>\n</blockquote>\n<p>2017-01-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Copyright.txt: Bump copyright years and rotate ChangeLog.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2018.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2018.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2018-12-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Move return point for 'ping' mode\nuntil after jpeg_start_decompress() and after JPEG compression\nproperties have been estimated.  Fixes SourceForge issue #578 &quot;gm\nidentify with format &quot;%[JPEG-Colorspace-Name]&quot; does not work&quot; and\n#586 &quot;Identify returning wrong compression values&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-12-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">coders/gif.c (ReadGIFImage): Don't throw an error if opacity is\noutside of the range of the image colors.  Fix suggested by 莫红波\n&lt;<a class=\"reference external\" href=\"mailto:hongbo&#46;mo&#37;&#52;&#48;upai&#46;com\">hongbo<span>&#46;</span>mo<span>&#64;</span>upai<span>&#46;</span>com</a>&gt; on the graphicsmagick-bugs mailinb list on\nFri, 9 Oct 2015.</p>\n</li>\n<li><p class=\"first\">magick/memory.h (MagickAllocateClearedArray): New macro for\nallocating a cleared array.</p>\n</li>\n<li><p class=\"first\">magick/resize.c (ScaleImage): Patch by Troy Patteson which\nresolves SourceForge issue #381 &quot;Artifacts when scaling a PNG with\nsemi-transparent pixels&quot;.</p>\n<p>ScaleImage() suffers from two problems related to the blending of\nfully transparent pixels with non-fully transparent pixels during\nthe scaling operation.</p>\n<p>The first is that the colour values for fully transparent pixels\nare contributing to the colour values of the blended pixels when\nthey should not.</p>\n<p>The second is that the colour values of pixels blended with fully\nand non-fully transparent pixels are scaled as though the fully\ntransparent pixels contribute to the blended pixels' colour values\nwhen they should not. For example, if blending 10% of a fully\nopaque white pixel with 90% of a fully transparent black pixel one\nwould expect the blended pixel RGBA values to be 255,255,255,25.5\nassuming 8 bit colour but they are in fact 25.5,25.5,25.5,25.5.</p>\n<p>The provided patch solves the first issue by treating the colour\nvalues of fully transparent pixels as zero and the second issue by\nrecording the volume of each blended pixel made up of pxiels that\nare not fully transparent (0.1 in the above example) and then\nscaling the blended pixel RGB values by dividing by that\namount. In the above example, 25.5/0.1 = 255.</p>\n</li>\n</ul>\n</blockquote>\n<p>2018-12-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c (ReadDIBImage): DIB images claiming more than\n8-bits per pixel are not colormapped.  Reject such files.  Fixes\nSourceForge issue #585 &quot;Assertion Failure in coders/png.c:7503&quot;.\nThe problem is in the DIB reader rather than PNG.</li>\n<li>coders/miff.c (ReadMIFFImage): Detect and reject zero-length\ndeflate-encoded row in MIFF version 0.  Fixes oss-fuzz 11876\n&quot;graphicsmagick/coder_MIFF_fuzzer: Use-of-uninitialized-value in\ndeflate_slow&quot;. (Credit to OSS-Fuzz)</li>\n<li>configure.ac: Improve search for true Microsoft Windows fonts\nand provide better indication of results.  Fix a typo which caused\nDcrawExtraOptions not to be evaluated correctly.</li>\n</ul>\n</blockquote>\n<p>2018-12-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (QuantumTransferMode): Be more strict about the\nrequirements for CIE Log2(L) and LOGLUV images.\n(ReadTIFFImage): Apply memory resource limits to strip and tile\nallocations.\n(ReadTIFFImage): Rationalize tile width/height to reject large\ntile sizes which are much larger than the image dimensions.  Fixes\noss-fuzz 11824 &quot;graphicsmagick/coder_BIGTIFF_fuzzer: Out-of-memory\nin graphicsmagick_coder_BIGTIFF_fuzzer&quot;. (Credit to OSS-Fuzz)\n(ReadTIFFImage): Return with error if TIFFClientOpen() reports\nerrors yet still returns a TIFF handle.</li>\n</ul>\n</blockquote>\n<p>2018-12-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tga.c (WriteTGAImage): Image rows/columns must not be\nlarger than 65535. Fixes SourceForge #583 &quot;heap-buffer-overflow in\nWriteTGAImage of tga.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-12-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Fix heap overflow in 32-bit build\ndue to arithmetic overflow.  Only happens if limits are changed\nfrom defaults. Fixes SourceForge #582 &quot;heap-buffer-overflow in\nReadBMPImage of bmp.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-12-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>common.shi.in (MAGICK_FONT): The test suite must pass even on\nsystems where we don't find any fonts.</li>\n</ul>\n</blockquote>\n<p>2018-12-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Sanitize claimed profile size\nbefore allocating memory for it.  Fixes oss-fuzz 11781\n&quot;graphicsmagick/coder_MIFF_fuzzer: Out-of-memory in\ngraphicsmagick_coder_MIFF_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-12-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Fix non-terminal MNG looping.\nFixes oss-fuzz 11596 &quot;graphicsmagick/coder_MNG_fuzzer: Timeout in\ngraphicsmagick_coder_MNG_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-12-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (WriteXPMImage): Assure that added colormap entry\nfor transparent XPM is initialized. Fixes oss-fuzz 11617\n&quot;graphicsmagick/coder_XPM_fuzzer: Use-of-uninitialized-value in\nQueryColorname&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/miff.c (ReadMIFFImage): Fix memory leak of profiles\n'name' when claimed length is zero.  Fixes oss-fuzz 11710\n&quot;graphicsmagick/coder_MIFF_fuzzer: Direct-leak in AllocateString&quot;.\nand oss-fuzz 11688 &quot;graphicsmagick/coder_MIFF_fuzzer:\nOut-of-memory in graphicsmagick_coder_MIFF_fuzzer&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-12-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/oss-fuzz-build.sh: Apply patch from Alex Gaynor to add\nZstd to the oss-fuzz build.</li>\n</ul>\n</blockquote>\n<p>2018-12-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac (DcrawExtraOptions): For QuantumDepth &gt; 8 pass -6\noption to dcraw.  Fixes SourceForge issue #568 &quot;dcraw not\nreturning 16 bit image even though quantum depth is set to 16&quot;.</li>\n<li>fuzzing/oss-fuzz-build.sh (PKG_CONFIG_PATH): Build WebP prior to\nlibtiff so that libtiff has a chance to find it.</li>\n</ul>\n</blockquote>\n<p>2018-11-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (TimeImageCommand): Time command now shows 6\ndigits of elapsed time indication since this precision is often\nnow available and it is useful to see.</li>\n</ul>\n</blockquote>\n<p>2018-11-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Magick++/Drawable.h: Fix use of clang diagnostic\nsyntax. Addresses SourceForge bug #579 &quot;'diagnostic pop' pragma\nwithout 'diagnostic push' in Drawable.h.&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-11-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (WriteImage): Eliminate use of just-freed\nmemory in clone_info-&gt;magick when throwing exception due to no\nsupport for format.  Fixes SourceForge issue #576 &quot;heap\nuse-after-freee when convert one format into another format&quot;.</li>\n<li>magick/command.c (BenchmarkImageCommand): Benchmark command now\nshows 6 digits of elapsed time indication since this precision is\noften now available and it is useful to see.</li>\n</ul>\n</blockquote>\n<p>2018-11-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>wand/wand_api.h (&quot;C&quot;): magick/api.h should be included prior to\nwand/wand_symbols.h.  Change made due to report by yzh杨振宏 on\nWed, 21 Nov 2018 via the graphicsmagick-bugs mailing list.</li>\n</ul>\n</blockquote>\n<p>2018-11-20  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c Fix a bug when OS does not support performance counter.</li>\n</ul>\n</blockquote>\n<p>2018-11-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c (NTElapsedTime): Use\nQueryPerformanceFrequency() and QueryPerformanceCounter() to\nmeasure elapsed time for Windows.</li>\n</ul>\n</blockquote>\n<p>2018-11-19  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff/port/snprintf.c Fix for older Microsoft Visual Studio</li>\n</ul>\n</blockquote>\n<p>2018-11-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/index.rst: Update in preparation for 1.3.31 release.</li>\n<li>version.sh: Update library versioning in preparation for\n1.3.31 release.</li>\n<li>NEWS.txt: Update news in preparation for 1.3.31 release.</li>\n</ul>\n</blockquote>\n<p>2018-11-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (BenchmarkUsage): Document the benchmark\ncommand better.</li>\n</ul>\n</blockquote>\n<p>2018-11-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/resize.c (HorizontalFilter, VerticalFilter): quantum is a\npointer so it's value can not be usefully flushed.  Use a local\nvariable and then update quantum pointer when done.</li>\n</ul>\n</blockquote>\n<p>2018-11-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/*: Changed row_count tallying to use 'omp atomic' and\nstatus update to use 'omp flush' for progress and error\nindication.  This replaces most use of 'omp critical' for this\npurpose.  Changed some lumpy algorithms which were using 'static'\nscheduling to 'guided' scheduling due to observing better results.\nAlso added prolific 'restrict' annotations where they were\nmissing.</li>\n<li>www/security.rst: Documented a PGP private key for file signing\nor private correspondence.</li>\n</ul>\n</blockquote>\n<p>2018-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/authors.rst: Moved &quot;Glenn Randers-Pehrson&quot; and &quot;Gregory J\nWolfe&quot; to the &quot;Former Contributor&quot; category.</li>\n</ul>\n</blockquote>\n<p>2018-11-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added many GCC function annotations in the libraries and coders.</li>\n</ul>\n</blockquote>\n<p>2018-11-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Use printf rather than echo to portably expand tab\nrequests in configuration summary.</li>\n</ul>\n</blockquote>\n<p>2018-11-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Use pkg-config data as the initial choice when\nconfiguring for FreeType 2.0 and libxml-2.0.  Only fall back to\ninvoking an external script (and then traditional methods) if\npkg-config fails.</li>\n<li>coders/msl.c (ProcessMSLScript): Release msl_image if OpenBlob\nfails.  Similar to ImageMagick CVE-2018-18544.  Problem was\nreported to us via email from Petr Gajdos on Thu, 1 Nov 2018.</li>\n</ul>\n</blockquote>\n<p>2018-10-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (WriteMIFFImage): Only run\nstrlen(attribute-&gt;value) once per attribute since the length won't\nchange.  May address oss-fuzz 11158\n&quot;graphicsmagick/coder_MIFF_fuzzer: Timeout in\ngraphicsmagick_coder_MIFF_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>Fix compilation warnings observed with GCC 8.2.0.</li>\n</ul>\n</blockquote>\n<p>2018-10-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_iterator.c (PixelIterateMonoModifyImplementation):\nUse atomic and flush rather than critical construct for a small\nspeedup.</li>\n<li>magick/monitor.c (MagickMonitorFormatted): Serialize calls to\nthe progress monitor so that the caller does not need to perform\nthis serialization.\n(MagickMonitor): Serialize calls to the progress monitor so that\nthe caller does not need to perform this serialization.  This\nfunction is now marked as deprecated.\n(InitializeMagickMonitor): New private function to initialize\nmonitor functionality.\n(DestroyMagickMonitor): New private function to destroy monitor\nfunctionality.</li>\n</ul>\n</blockquote>\n<p>2018-10-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (ReadGIFImage): Improve the efficiency of storing a\nGIF comment in order to avoid a DOS opportunity.  Fixes oss-fuzz\n11096 &quot;graphicsmagick/coder_GIF_fuzzer: Timeout in\ngraphicsmagick_coder_GIF_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-10-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Makefile.PL.in: Use MAGICK_API_LIBS to obtain the\nlist of libraries to use when linking.</li>\n<li>configure.ac: OpenMP library is normally supplied due to a\nCFLAGS option so only supply it in cases where the CFLAGS option\nmay be lost or it might not be used.  Otherwise the compiler may\napply the library twice when linking.</li>\n</ul>\n</blockquote>\n<p>2018-10-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Remove Ghostscript library support (--with-gslib)\nfrom configure script.  The 'HasGS' pre-processor defines which\nwere enabled by this remain in the source code so it is still\npossible to use this library if absolutely necessary\n(e.g. CPPFLAGS=-DHasGS LIBS=-lgs).</li>\n<li>tests/rwfile.tap: Test TIFF format with all supported\ncompression options.</li>\n<li>tests/{rwblob.c, rwfile.c} (main): Use StringToCompressionType()\nto parse compression option. Also consider requested compression\nalgorithm when deciding if format is lossy.</li>\n<li>coders/tiff.c (WriteTIFFImage): WebP compression needs\nPHOTOMETRIC_RGB. Fix wrong rows-per-strip calculation when using\nLZMA compression.</li>\n<li>tests/rwblob.tap: Added a rwblob test to verify that lower-case\nmagick works.</li>\n<li>magick/static.c (OpenModule): Upper case magick string before\nsearching static modules list.  Fixes Debian bug 911386\n&quot;libgraphicsmagick-q16-3: graphicsmagick 1.3.30 has made formats\ncase-sensitive at the API level&quot;.</li>\n<li>filters/analyze.c (AnalyzeImage): X and y should be unsigned\nlong to match image rows/columns type.  Calculate total pixels by\nsimple multiplication rather than counting.</li>\n</ul>\n</blockquote>\n<p>2018-10-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Support WebP compression in\nTIFF. This requires a libtiff release after 4.0.9.</li>\n<li>magick/image.h (&quot;C&quot;): WebPCompression added to CompressionType\nenumeration.</li>\n</ul>\n</blockquote>\n<p>2018-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Configure for the Zstd library.  Use\n--without-zstd to disable searching for this library.  Libtiff may\nrequire this library to successfully link so static linkage could\nfail if searching for libzstd is disabled.</li>\n<li>magick/image.h (&quot;C&quot;): ZSTDCompression added to CompressionType\nenumeration.</li>\n<li>coders/tiff.c (WriteTIFFImage): Support Zstd compression in\nTIFF.  This requires a libtiff release after 4.0.9.</li>\n</ul>\n</blockquote>\n<p>2018-10-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (GMCommandSingle): Add 'compare' to the list of\ncommand names that gm will support as a command if copied to or\nlinked from that name.  There was already a 'compare' link\ninstalled when the '--enable-magick-compat' configure option is\nused, but it could not possibly function without being blessed by\nthis list.  Related to Debian bug #910652\n&quot;graphicsmagick-imagemagick-compat: Doesn't ship a compare tool&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-09-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++/lib/Magick++/Drawable.h: Block unused-private-field\nwarnings from Clang due to _dummy members which were intentionally\nincluded in some parent class definitions.</li>\n<li>magick/widget.c (XEditText): Fix compilation warnings about\ncases which fall-through.</li>\n<li>magick/display.c (MagickXAnnotateEditImage): Fix compilation\nwarnings about cases which fall-through.</li>\n<li>coders/pict.c (WritePICTImage): Add more checks to memory\nallocation calculations.</li>\n<li>magick/pixel_cache.c (DestroyCacheInfo): Eliminate intentional\nfall-through logic in switch statement which results in compiler\nwarnings.  Eliminate switch statements entirely and split\nunrelated logic.</li>\n<li>coders/txt.c (ReadTXTImage): Fix comparison between pointer and\n'0' rather than NULL as was obviously intended.</li>\n<li>coders/msl.c (MSLStartElement): Add missing 'break' statements\nafter ThrowException() calls.  Otherwise execution falls through\ninto unrelated switch cases and throws a redundant exception.</li>\n</ul>\n</blockquote>\n<p>2018-09-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c (parse8BIM): Eliminate repeated use of strlen()\nwhich scans the entire remaining string on each cycle.  Fixes\noss-fuzz 10667 &quot;graphicsmagick/coder_IPTCTEXT_fuzzer: Timeout in\ngraphicsmagick_coder_IPTCTEXT_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-09-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (MagickGetToken): Fix possible read up to four\nbytes beyond end of stack allocated token buffer.  Fixes oss-fuzz\n10653 &quot;graphicsmagick/coder_MVG_fuzzer: Stack-buffer-overflow in\nMagickGetToken&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-09-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/coder_fuzzer.cc (LLVMFuzzerTestOneInput): Limit the\nmaximum number of JPEG progressive scans to 50.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Apply a default limit of 100\nprogressive scans before the reader quits with an error.  This\nlimit may be adjusted using the -define mechanism like -define\nJPEG:max-scan-number=500.  Also respond more quickly to files\nwhich exceed the maximum image dimensions.  Fixes oss-fuzz 10258\n&quot;graphicsmagick/coder_JPEG_fuzzer: Timeout in\ngraphicsmagick_coder_JPEG_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-09-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): mng_LOOP chunk must be at least 5\nbytes long.  Fixes oss-fuzz 10455\n&quot;graphicsmagick/coder_MNG_fuzzer: Use-of-uninitialized-value in\nReadMNGImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-09-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TraceEllipse): Detect arithmetic overflow when\ncomputing the number of points to allocate for an ellipse.  Fixes\noss-fuzz 10306 &quot;graphicsmagick/coder_MVG_fuzzer:\nHeap-buffer-overflow in TracePoint&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-09-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Eliminate undefined\nshift.  Also right-sized involved data types.  Fixes oss-fuzz\n10309 &quot;graphicsmagick/coder_JPG_fuzzer: Undefined-shift in\nRead32s&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-09-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawClipPath): Fix Coverity 319663 &quot;Null\npointer dereferences&quot;.  Totally insignificant.</li>\n<li>coders/wpg.c (ReadWPGImage): Mask/fix Coverity 319664 &quot;Error\nhandling issues&quot;.</li>\n<li>magick/attribute.c (FindEXIFAttribute): Change size types from\nsigned to unsigned and check for unsigned overflow.\n(GenerateEXIFAttribute): Change size types from signed to unsigned\nand check for unsigned overflow. Fixes oss-fuzz 10283\n&quot;graphicsmagick/coder_JPG_fuzzer: Integer-overflow in\nGenerateEXIFAttribute&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/sfw.c (ReadSFWImage): Enforce that file is read using the\nJPEG reader. (Credit to OSS-Fuzz)</li>\n<li>coders/miff.c (ReadMIFFImage): Fix leak of 'values' buffer due\nto change made yesterday.</li>\n<li>coders/mpc.c (ReadMPCImage): Fix leak of 'values' buffer due to\nchange made yesterday.  Fixes oss-fuzz 10277\n&quot;graphicsmagick/coder_MPC_fuzzer: Direct-leak in\nReadMPCImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-09-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Support legacy keyword\n'color-profile' for ICC color profile as was used by ImageMagick\n4.2.9.</li>\n<li>coders/mpc.c (ReadMPCImage): Require that first keyword/value be\nid=MagickCache</li>\n<li>coders/miff.c (ReadMIFFImage): Require that first keyword/value\nbe id=ImageMagick.</li>\n</ul>\n</blockquote>\n<p>2018-09-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (DCM_ReadElement): Add more size checks.</li>\n<li>coders/jnx.c (ExtractTileJPG): Enforce that JPEG tiles are read\nby the JPEG coder.  Fixes oss-fuzz 10147\n&quot;graphicsmagick/coder_JNX_fuzzer: Use-of-uninitialized-value in\nfuncDCM_PhotometricInterpretation&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-09-10  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Zero fill raster error recovery.</li>\n</ul>\n</blockquote>\n<p>2018-08-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (ConvertPrimitiveToPath): Second attempt to\nprevent heap write overflow of PathInfo array.  Fixes oss-fuzz\n10096 &quot;Heap-buffer-overflow in ConvertPrimitiveToPath&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-08-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (&quot;QuantumTransferMode&quot;): CIE Log images with an\nalpha channel are not supported.  Fixes oss-fuzz 10013\n&quot;graphicsmagick/coder_TIFF_fuzzer: Use-of-uninitialized-value in\nDisassociateAlphaRegion&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/render.c (DrawImage): SetImageAttribute() appends new\ntext to any existing value, leading to every increasing memory\nconsumption if the existing value is not deleted first by the\nunwary.  Fixes oss-fuzz 9983 &quot;graphicsmagick/coder_MVG_fuzzer:\nTimeout in graphicsmagick_coder_MVG_fuzzer&quot; and oss-fuzz 10016\n&quot;graphicsmagick/coder_MVG_fuzzer: Out-of-memory in\ngraphicsmagick_coder_MVG_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/utility.c (TranslateTextEx): Fix off-by-one in loop\nbounds check which allowed a one-byte stack write overflow.  Fixes\noss-fuzz 10055 &quot;graphicsmagick/coder_MVG_fuzzer:\nStack-buffer-overflow in TranslateTextEx&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/render.c (DrawImage): Be more precise about error\ndetection and reporting, and return from an error more quickly.\nAlso added MAX_DRAWIMAGE_RECURSION pre-processor definition to\nallow adjusting the drawing recursion limit.  The drawing\nrecursion limit is still 100, which seems exceptionally generous.</li>\n<li>magick/constitute.c (WriteImage): Produce a more useful error\nmessage if an encoding delegate is not available.</li>\n<li>magick/nt_base.h (isnan): Try adding a MSVC replacement for\nmissing isnan() function.  Not yet tested.</li>\n</ul>\n</blockquote>\n<p>2018-08-25  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c This should fix intentional 64 bit file offset\noverflow as depictedin OSS-fuzz-9936. Thanks to OSS-Fuzz.</li>\n</ul>\n</blockquote>\n<p>2018-08-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (ConvertPrimitiveToPath): Need to enlarge\nPathInfo array allocation to avoid possible heap write overflow.\nFixes oss-fuzz 9651 &quot;graphicsmagick/coder_MVG_fuzzer:\nHeap-buffer-overflow in ConvertPrimitiveToPath&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-08-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mpc.c (ReadMPCImage): Insist that the format be\nidentified prior to any comment, and that there is only one\ncomment.</li>\n<li>coders/miff.c (ReadMIFFImage): Insist that the format be\nidentified prior to any comment, and that there is only one\ncomment.  Fixes oss-fuzz 9979 &quot;graphicsmagick/coder_MIFF_fuzzer:\nTimeout in graphicsmagick_coder_MIFF_fuzzer&quot;.  This is not a\nserious issue, but the code runs slowly under UBSAN.  (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-08-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (MagickAtoFChk): Add additional validation\nchecks for floating point values.  NAN and +/- INFINITY values\nalso map to 0.0. Fixes oss-fuzz 9630\n&quot;graphicsmagick/coder_MVG_fuzzer: Integer-overflow in\nIsNexusInCore&quot; and oss-fuzz 9612 &quot;graphicsmagick/coder_MVG_fuzzer:\nInteger-overflow in SetCacheNexus&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/render.c (DrawImage): Add missing error-reporting logic\nto return immediately upon memory reallocation failure.  Apply\nmemory resource limits to PrimitiveInfo array allocation.  Fixes\noss-fuzz 9576 &quot;graphicsmagick/coder_MVG_fuzzer: Null-dereference\nREAD in DrawImage&quot;, oss-fuzz 9593\n&quot;graphicsmagick/coder_MVG_fuzzer: Out-of-memory in\ngraphicsmagick_coder_MVG_fuzzer&quot;, oss-fuzz 9648\n&quot;graphicsmagick/coder_MVG_fuzzer: Unknown signal in\nDrawImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-08-16  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coder/mat.c Explicitly reject non-seekable streams.</li>\n</ul>\n</blockquote>\n<p>2018-08-15  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coder/mat.c Correctly check GetBlobSize(image) even for zipstreams.</li>\n</ul>\n</blockquote>\n<p>2018-08-14  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c More aggresive data corruption checking.</li>\n</ul>\n</blockquote>\n<p>2018-08-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xbm.c (XBMInteger): Limit the number of hex digits parsed\nto avoid signed integer overflow.  Fixes oss-fuzz 9746\n&quot;graphicsmagick/coder_XBM_fuzzer: Undefined-shift in\nXBMInteger&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-08-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Typecast difference to quantum.</li>\n</ul>\n</blockquote>\n<p>2018-08-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (InsertComplexFloatRow): Avoid signed\noverflow. Fixes oss-fuzz 9667 &quot;graphicsmagick/coder_MAT_fuzzer:\nInteger-overflow in InsertComplexFloatRow&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/xbm.c (ReadXBMImage): Add validations for row and column\ndimensions.  Fixes oss-fuzz 9736 &quot;graphicsmagick/coder_XBM_fuzzer:\nOut-of-memory in graphicsmagick_coder_XBM_fuzzer&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-08-04  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Add mechanism to approve embedded subformats in\nWPG.  This should mute oss-fuzz 9559.  (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-07-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mvg.c (ReadMVGImage): Fix memory leak added on\n2018-07-21.  Fixes oss-fuzz 9548 &quot;graphicsmagick/coder_MVG_fuzzer:\nDirect-leak in CloneDrawInfo&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-07-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/cineon.c (ReadCINEONImage): Fix SourceForge issue 571\n&quot;Unexpected hang on a crafted Cineon image&quot; by detecting and\nquitting on EOF appropriately, and verifying that file size is\nsufficient for claimed pixel dimensions when possible.</li>\n<li>fuzzing/oss-fuzz-build.sh, fuzzing/dictionaries/MVG.dict: Added\nMVG fuzzing dictionary by Alex Gaynor.</li>\n</ul>\n</blockquote>\n<p>2018-07-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (SetNexus): For requests one pixel tall,\nSetNexus() was wrongly using pixels in-core rather than using a\nstaging area for the case where the nexus rows extend beyond the\nimage raster boundary, leading to heap overflow.  This can happen\nwhen virtual pixels outside the image bounds are accessed.  Fixes\noss-fuzz 9512 &quot;graphicsmagick/graphicsmagick_coder_MVG_fuzzer:\nHeap-buffer-overflow in AcquireCacheNexus&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/render.c (ExtractTokensBetweenPushPop):\nExtractTokensBetweenPushPop() needs to always return a valid\npointer into the primitive string.  Fixes oss-fuzz 9511\n&quot;graphicsmagick/graphicsmagick_coder_MVG_fuzzer: Null-dereference\nREAD in DrawImage&quot;. (Credit to OSS-Fuzz)\n(DrawPolygonPrimitive): Fix leak of polygon set when object is\ncompletely outside image.  Fixes oss-fuzz 9513\n&quot;graphicsmagick/graphicsmagick_coder_MVG_fuzzer: Direct-leak in\nAllocateThreadViewDataSet&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-07-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (FileToBlob): Use confirm access APIs to verify\nthat read access to this path is allowed by policy.  Check that\nfile is a regular file before proceeding to open and read from it.</li>\n<li>coders/mvg.c (ReadMVGImage): Don't allow MVG files to side-load\na file as the drawing primitive using '&#64;' syntax.  Fixes oss-fuzz\n9494 &quot;graphicsmagick/coder_MVG_fuzzer: Sanitizer CHECK failure in\n&quot;((0)) != (0)&quot; (0x0, 0x0)&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-07-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mvg.c (ReadMVGImage): Don't assume that in-memory MVG\nblob is a null-terminated C string. Fixes oss-fuzz 9469\n&quot;graphicsmagick/coder_MVG_fuzzer: Heap-buffer-overflow in\nAllocateString&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-07-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Detect EOF when reading using\nReadBlobZC() and avoid subsequent heap read overflow.  Fixes\noss-fuzz 9357 &quot;graphicsmagick/coder_MIFF_fuzzer:\nHeap-buffer-overflow in ImportRGBQuantumType&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-07-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/oss-fuzz-build.sh (CFLAGS): Try disabling SIMD\ninstructions in libjpeg-turbo build.</li>\n</ul>\n</blockquote>\n<p>2018-07-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): Free png_pixels as soon as\npossible.  This might help with oss-fuzz 9334\n&quot;graphicsmagick/coder_PNG8_fuzzer: Direct-leak in\nWriteOnePNGImage&quot;, which we have yet to reproduce.  It is not\nclear if png_pixels is being clobbered by longjmp or if something\nelse is going on.</li>\n</ul>\n</blockquote>\n<p>2018-06-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Provide a memory resource limit\n(of 1/5th the memory resource limit for Graphicsmagick) to libjpeg\nto limit how much memory it might consume for itself while reading\na file.  Fixes oss-fuzz 9096 &quot;graphicsmagick/coder_JPEG_fuzzer:\nTimeout in graphicsmagick_coder_JPEG_fuzzer&quot;.  (Credit to\nOSS-Fuzz)\n(ReadJPEGImage): Make sure that JPEG pixels array is initialized\nin case libjpeg fails to completely initialize it.  May fix\noss-fuzz 9115 &quot;graphicsmagick/coder_JPEG_fuzzer:\nUse-of-uninitialized-value in ReadJPEGImage&quot;.  We are not sure\nsince the problem was not reproduced.  (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Update library versioning for 1.3.30 release.</li>\n<li>NEWS.txt: Update news for 1.3.30 release.</li>\n</ul>\n</blockquote>\n<p>2018-06-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Report exception on EOF file\nreading DPX pixel data. Fixes oss-fuzz 8104\n&quot;graphicsmagick/coder_DPX_fuzzer: Use-of-uninitialized-value in\nWriteDPXImage&quot;, oss-fuzz 8297 &quot;graphicsmagick/enhance_fuzzer:\nUse-of-uninitialized-value in EnhanceImage&quot;, and oss-fuzz 8133\n&quot;graphicsmagick/coder_DPX_fuzzer: Use-of-uninitialized-value in\nRGBTransformPackets&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/cmyk.c (ReadCMYKImage): Free scanline buffer in error\npath. Fixes SourceForge issue #567 &quot;small memory leak in rgb.c,\ngray.c and cmyk.c&quot; reported by Petr Gajdos.</li>\n<li>coders/gray.c (ReadGRAYImage): Free scanline buffer in error\npath. Fixes SourceForge issue #567 &quot;small memory leak in rgb.c,\ngray.c and cmyk.c&quot; reported by Petr Gajdos.</li>\n<li>coders/rgb.c (ReadRGBImage): Free scanline buffer in error\npath. Fixes SourceForge issue #567 &quot;small memory leak in rgb.c,\ngray.c and cmyk.c&quot; reported by Petr Gajdos.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Avoid memory leak of profile\nbuffer when longjmp-based exception is thrown while reading a\nprofile. Fixes oss-fuzz 8957 &quot;graphicsmagick/enhance_fuzzer:\nDirect-leak in ReadGenericProfile&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (load_level): Make sure to free 'tile_image' before\nreturning exception.  Fixes oss-fuzz 8935\n&quot;graphicsmagick/coder_XCF_fuzzer: Indirect-leak in\nCloneImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/jpeg.c (ReadJPEGImage): Allow three warnings of any given\ntype before promoting the next warning of the same type to a hard\nerror.  The warning limit may be adjusted by the user using\n-define jpeg:max-warnings=&lt;value&gt;.  Fixes oss-fuzz 8704\n&quot;graphicsmagick/coder_JPG_fuzzer: Out-of-memory in\ngraphicsmagick_coder_JPG_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/png.c (ReadPNGImage): Detect EOF when reading\nmagic_number.  Fixes oss-fuzz 8944\n&quot;graphicsmagick/coder_PNG_fuzzer: Use-of-uninitialized-value in\nReadPNGImage&quot;.  (Credit to OSS-Fuzz)\n(ReadPNGImage, ReadJNGImage): Makes sure that return value of\nReadBlob() is always checked to detect EOF.</li>\n</ul>\n</blockquote>\n<p>2018-06-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Re-structure exception reporting\nso that QuantumTransferMode() exceptions thrown for\nPLANARCONFIG_SEPARATE images are handled immediately.  Fixes\noss-fuzz 8896 &quot;graphicsmagick/coder_BIGTIFF_fuzzer:\nUse-of-uninitialized-value in DisassociateAlphaRegion&quot;. (Credit to\nOSS-Fuzz)\n(ReadTIFFImage): tsize_t is a signed type so be prepared for\nunexpected negative values produced by libtiff size functions.\nFixes oss-fuzz 8934 &quot;graphicsmagick/coder_TIFF_fuzzer: Sanitizer\nCHECK failure in &quot;((0)) != (0)&quot; (0x0, 0x0)&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-16  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Fix oss-fuzz 7735 &quot;graphicsmagick/coder_WPG_fuzzer:\nUse-of-uninitialized-value in ReadWPGImage&quot;.  (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): ENDL chunk must be at least one\nbyte in size. Fixes oss-fuzz 8832\n&quot;graphicsmagick/coder_MNG_fuzzer: Null-dereference READ in\nReadMNGImage&quot;. (Credit to OSS-Fuzz)\n(ReadMNGImage): Length of DISC chunk must be evenly divisible by\n2.  Fixes oss-fuzz 8834 &quot;graphicsmagick/coder_MNG_fuzzer:\nHeap-buffer-overflow in ReadMNGImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mpc.c (ReadMPCImage): Detect end of file while reading\nimage directory.  Similar to MIFF fixes for ImageMagick\nCVE-2017-18272.\n(RegisterMPCImage): Require seekable stream since MPC is strictly\na file-based format and so GetBlobSize() is assured to work.\nSimilar to MIFF behavior.  Claimed to be part of the resolution\nfor ImageMagick CVE CVE-2017-11449. Suggested by Petr Gajdos via\nemail on January 3, 2018.</li>\n</ul>\n</blockquote>\n<p>2018-06-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/miff.c (ReadMIFFImage): Detect end of file while reading\nimage directory. Fixes SourceForge issue 565 &quot;ImageMagick\nCVE-2017-18272 applies to GraphicsMagick&quot;.  Thanks to Petr Gajdos\nfor reporting this issue to us.</li>\n<li>magick/import.c (ImportViewPixelArea): Use appropriate\nbits_per_sample validations for FloatQuantumSampleType. Fixes\noss-fuzz 8780 &quot;graphicsmagick/coder_PTIF_fuzzer:\nUse-of-uninitialized-value in HorizontalFilter&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-09  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c More than 4GiB are not supported in MAT!</li>\n</ul>\n</blockquote>\n<p>2018-06-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (ReadMATImage): Add casts to avoid arithmetic\noverflow when computing size and offsets.  Fixes oss-fuzz 8801\n&quot;graphicsmagick/coder_MAT_fuzzer: Timeout in\ngraphicsmagick_coder_MAT_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/blob.c (ReadBlobLSBDoubles, ReadBlobMSBDoubles): Only\nbyte-swap doubles or test doubles for NAN if we have read enough\nbytes for at least one double value.\n(ReadBlob): Add an assertion to enforce that ReadBlob() will never\nreport reading more bytes than requested due to some\nimplementation issue.</li>\n</ul>\n</blockquote>\n<p>2018-06-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (ReadBlob, WriteBlob): gzread(), BZ2_bzread(),\ngzwrite(), BZ2_bzwrite() return type 'int' rather than 'size_t'\nlike their stdio equivalents.  Use correct signed type to avoid\nreturning a negative value into an unsigned type, forming a huge\npositive value.  Fixes oss-fuzz 8600\n&quot;graphicsmagick/coder_MAT_fuzzer: Heap-buffer-overflow in\nReadBlobLSBDoubles&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (png_read_raw_profile): Try to shore up parsing of\nraw profile reading to avoid heap read overruns.  Fixes oss-fuzz\n8763 &quot;graphicsmagick/coder_PNG32_fuzzer: Heap-buffer-overflow in\npng_read_raw_profile&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Reduce stack usage for 64 bit architecture.</li>\n</ul>\n</blockquote>\n<p>2018-06-06  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Check return values of SeekBlob for more safety.</li>\n</ul>\n</blockquote>\n<p>2018-06-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Use DestroyImageList() rather\nthan DestroyImage() on returned Image from supposed read of JPEG\ndata, in case multiple frames were unexpectedly returned.  Also\nadd &quot;JPEG:&quot; prefix to filename when reading from temporary file to\nforce that it can only be read as a JPEG file, disabling format\nauto-detection based on file header.  Fixes oss-fuzz 8755\n&quot;graphicsmagick/coder_JNG_fuzzer: Indirect-leak in\nAllocateImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (EOFBlob): Implement EOF detection for ZipStream.\nDoes some archaic zlib not provide gzeof()?  Fixes oss-fuzz 8550\n&quot;graphicsmagick/coder_MAT_fuzzer: Timeout in\ngraphicsmagick_coder_MAT_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Skip adding empty raw profile.\nFixes oss-fuzz &quot;graphicsmagick/coder_PNG_fuzzer:\nHeap-buffer-overflow in png_read_raw_profile&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update NEWS with latest changes.</li>\n<li>coders/dcm.c (DCM_ReadRGBImage): Force the image to DirectClass\nto avoid later use of uninitialized indexes.  Fixes oss-fuzz 8602\n&quot;graphicsmagick/coder_DCM_fuzzer: Use-of-uninitialized-value in\nDCM_PostRescaleImage&quot;. (Credit to OSS-Fuzz)\n(DCM_ReadPlanarRGBImage): Force the image to DirectClass to avoid\nlater use of uninitialized indexes.</li>\n<li>coders/png.c (ReadMNGImage): Free chunk memory in error\nreporting path to avoid leak.  Fixes oss-fuzz 8721\n&quot;graphicsmagick/coder_MNG_fuzzer: Direct-leak in\nReadMNGImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-06-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/constitute.c (ReadImage): Assure that an error exception\nis thrown if coder returns null without properly reporting an\nexception.</li>\n<li>magick/blob.c (BlobToImage): Assure that an error exception is\nthrown if coder returns null without properly reporting an\nexception.</li>\n<li>coders/png.c (ReadMNGImage): Disable mystery &quot;linked list is\ncorrupted&quot; code.  Assure that exceptions are reported to the\ncorrect place so they are not lost.  Fixes oss-fuzz 8710\n&quot;graphicsmagick/coder_MNG_fuzzer: Indirect-leak in\nAllocateImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/tiff.c (ReadTIFFImage): Initialize allocated scanline,\nstrip, or tile to zero in order to avoid complaint about use of\nuninitialized data if libtiff fails to write all the bytes.  Fixes\noss-fuzz 8551 &quot;graphicsmagick/coder_TIFF_fuzzer:\nUse-of-uninitialized-value in ImportGrayQuantumType&quot;. (Credit to\nOSS-Fuzz)</li>\n<li>magick/annotate.c (RenderFreetype): Throw an exception if\nDrawInfo font is null.  Should fix oss-fuzz 8557\n&quot;graphicsmagick/coder_PCD_fuzzer: Unknown signal in\nRenderFreetype&quot; and may fix oss-fuzz 8544\n&quot;graphicsmagick/coder_PCD_fuzzer: Null-dereference READ in\nRenderFreetype&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/jpeg.c (ReadGenericProfile): Add/improve tracing for\nprofile size and when JPEG header is being read.</li>\n</ul>\n</blockquote>\n<p>2018-06-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Report a useful exception for\nthe case when the JNG file fails to provide the necessary image\nchunks to allocate the color image.  Inspired by oss-fuzz 8666\n&quot;graphicsmagick/coder_JNG_fuzzer: ASSERT: data != (const char *)\nNULL&quot; although the reported issue was not reproduced.</li>\n</ul>\n</blockquote>\n<p>2018-05-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Fix off-by-one in length validation\nfor TERM chunk which allowed one byte heap read overflow.  Fixes\noss-fuzz 8615 &quot;graphicsmagick/coder_MNG_fuzzer:\nHeap-buffer-overflow in mng_get_long&quot;. (Credit to OSS-Fuzz)\n(ReadMNGImage): Fix leak of MngInfo in error reporting path.\nFixes oss-fuzz 8604 &quot;graphicsmagick/coder_MNG_fuzzer: Direct-leak\nin ReadMNGImage&quot;. (Credit to OSS-Fuzz)\n(ReadMNGImage): Verify that claimed chunk size does not exceed\ninput size.  Fixes oss-fuzz 8564 &quot;graphicsmagick/coder_MNG_fuzzer:\nOut-of-memory in graphicsmagick_coder_MNG_fuzzer&quot;. (Credit to\nOSS-Fuzz)</li>\n<li>coders/tiff.c (ReadTIFFImage): Reject files with excessive\nsamples-per-pixel or extra-samples. Avoids potential issues\nobserved in oss-fuzz 8634 &quot;graphicsmagick/coder_BIGTIFF_fuzzer:\nUndefined-shift in ImportAlphaQuantumType&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Assure that object id index is\nalways less than MNG_MAX_OBJECTS to avoid overflow.  Fixes\noss-fuzz 8596 &quot;graphicsmagick/coder_MNG_fuzzer:\nIndex-out-of-bounds in ReadMNGImage&quot; and likely other issues yet\nto be reported. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-30  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (CompareEdges): Per ticket #562,\nfunction CompareEdges() did not conform to the qsort()\nrequirement that if CompareEdges(edge0,edge1) returns\n-1 (i.e., edge0 &quot;less than&quot; edge1), then\nCompareEdges(edge1,edge0) should return 1 (edge1\n&quot;greater than&quot; edge0).  This has been fixed.</li>\n</ul>\n</blockquote>\n<p>2018-05-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Deal with JDAA JNG chunk with\nlength zero.  Fixes oss-fuzz 8562\n&quot;graphicsmagick/coder_JNG_fuzzer: ASSERT: data != (const char *)\nNULL&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/tiff.c (ReadTIFFImage): Check that the bits-per-sample is\nsupported by the implementation before attempting to decode the\nimage. Fixes oss-fuzz 8554 &quot;graphicsmagick/coder_BIGTIFF_fuzzer:\nUndefined-shift in MagickBitStreamMSBWrite&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/png.c (ReadMNGImage): Eliminate use of uninitialized\nheader magic data by checking for EOF first.  Fixes oss-fuzz 8597\n&quot;graphicsmagick/coder_MNG_fuzzer: Use-of-uninitialized-value in\nReadMNGImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/oss-fuzz-build.sh: More fixes based on what is observed\nin oss-fuzz build log.</li>\n</ul>\n</blockquote>\n<p>2018-05-24  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jnx.c The attribute should belong to only one scene and\nnot to whole image list.</li>\n</ul>\n</blockquote>\n<p>2018-05-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/oss-fuzz-build.sh: Changes to add CPPFLAGS to configure\nexecutions to hopefully get oss-fuzz build closer to success.</li>\n</ul>\n</blockquote>\n<p>2018-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/t/jpeg/read.t: Add a JNX reader test case.</li>\n<li>coders/jnx.c (ReadJNXImage): JNX image depth should be 8.</li>\n<li>fuzzing/oss-fuzz-build.sh: Apply patch from Alex Gaynor to\nswitch libpng to autotools build system, as well as configure\nGraphicsMagick with '--with-quantum-depth=16'.</li>\n</ul>\n</blockquote>\n<p>2018-05-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Validate tile memory requests for\nthe TIFFReadRGBATile() case in the same way as the TIFFReadTile()\ncase.  Fixes oss-fuzz 8434 &quot;graphicsmagick/coder_BIGTIFF_fuzzer:\nOut-of-memory in graphicsmagick_coder_BIGTIFF_fuzzer&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tile.c (ReadTILEImage): Remove any existing size request\nwhen while image to tile.  This avoids size being used for both\nthe input image size and the tile image size.  Fixes SourceForge\nissue #563 &quot;tile:&lt;image&gt; appears to blow image up by 100% before\napplying tiling&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-05-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/oss-fuzz-build.sh: Patch from Paul Kehrer to disable\nlibpng test programs and binaries while building libpng in support\nof oss-fuzz testing.</li>\n<li>coders/dcm.c (DCM_ReadGrayscaleImage): If a palette was\nprovided, the image may be in PseudoClass but we need DirectClass\nfor gray image when GRAYSCALE_USES_PALETTE is not defined.  Fixes\noss-fuzz 7550 &quot;graphicsmagick/coder_DCM_fuzzer:\nUse-of-uninitialized-value in SyncImageCallBack&quot;. (Credit to\nOSS-Fuzz)\n(ReadDCMImage): Restore use of DCM_PostRescaleImage() in order to\nobtain suitably scaled DICOM again.  Hopefully it is more robust\nnow.\n(DCM_ReadPaletteImage): Assure that DirectClass pixels are\ninitialized.</li>\n</ul>\n</blockquote>\n<p>2018-05-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Remove strange addition of\nimage-&gt;columns to pixel buffer offsets which now causes a heap\noverflow since the buffer has been right-sized.  Perhaps the extra\noffset plus the over-sized allocation was some attempt to avoid\nbuffer over/underflows due to bugs in libtiff. Fixes oss-fuzz 8384\n&quot;graphicsmagick/coder_BIGTIFF_fuzzer: Heap-buffer-overflow in\nput1bitbwtile&quot; which is described to be a regression. (Credit to\nOSS-Fuzz)</li>\n<li>magick/render.c (DrawImage): Fix wrong range checks which caused\nspurious &quot;Parsing of SVG images fail with &quot;Non-conforming drawing\nprimitive definition (push)&quot; failure.  Fixes SourceForge issue 561\n&quot;Parsing of SVG images fail with &quot;Non-conforming drawing primitive\ndefinition (push)&quot;&quot; which is due to problems caused by the fix for\nSourceForge issue 517.</li>\n<li>coders/tiff.c (WritePTIFImage): Use '-define\nptif:minimum-geometry=&lt;geometry&gt;' to specify the smallest\nsubresolution frame which is produced by the PTIF (Pyramid TIFF)\nwriter.</li>\n</ul>\n</blockquote>\n<p>2018-05-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WritePTIFImage): Allow 1x1 input image to be\nsupported.</li>\n<li>coders/png.c (ReadOneJNGImage): Unconditionally free JDAT chunk\nmemory.  Fixes oss-fuzz 8366 &quot;graphicsmagick/coder_JNG_fuzzer:\nDirect-leak in ReadOneJNGImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/tiff.c (WritePTIFImage): Fix leak of pyramid Image list\nif ResizeImage() fails.  Fixes oss-fuzz 8364\n&quot;graphicsmagick/coder_PTIF_fuzzer: Indirect-leak in\nCloneImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Add and use\nThrowTIFFWriterException() macro to consistently clean-up when\nthrowing writer exception.  May fix oss-fuzz 8321\n&quot;graphicsmagick/coder_EPT_fuzzer: Direct-leak in\nTIFFClientOpen&quot;. (Credit to OSS-Fuzz)\n(ReadTIFFImage): Add and use ThrowTIFFReaderException() macro to\nconsistently clean-up when throwing reader exception.</li>\n</ul>\n</blockquote>\n<p>2018-05-16  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">magick/alpha_composite.h (AlphaCompositePixel): The\nmacro definition for MagickAlphaCompositeQuantum in\nalpha_composite.h computes an expression of the form:</p>\n<p>a * b + c * d * e</p>\n<p>Code in function AlphaCompositePixel() (also in\nalpha_composite.h) multiplies the result of this macro\nby variable &quot;delta&quot; as follows:</p>\n<p>delta * a * b + c * d * e</p>\n<p>However, the intended result is actually:</p>\n<p>delta * ( a * b + c * d * e )</p>\n<p>The macro definition has been modified to enclose the\nentire expression in parentheses.</p>\n<p>The effects of this bug were particularly evident at the\nboundary between a stroked polygon and a transparent\nblack region. More generally, an incorrect composited\npixel value was being computed by AlphaCompositePixel()\nwhenever the output alpha value was not 100% opaque.</p>\n</li>\n</ul>\n</blockquote>\n<p>2018-05-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwblob.tap: Add a test for PTIF format.</li>\n<li>coders/tiff.c (WritePTIFImage): Fix Image blob referencing in\norder to avoid double-free when writing PTIF to memory BLOB. Fixes\noss-fuzz 8280 &quot;graphicsmagick/coder_PTIF_fuzzer: Heap-double-free\nin Magick::BlobRef::~BlobRef&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Use libtiff's\nTIFFDefaultStripSize() function rather than an old porting macro\nrequired by some defunct libtiff version.  Expected to fix\noss-fuzz 8248 &quot;graphicsmagick/coder_EPT_fuzzer:\nFloating-point-exception in WriteTIFFImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-13  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Fix potentional leak when compressed object is\ncorrupted. Fixes oss-fuzz 8251 (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): Fix leak of Image when\nTIFFReadRGBAImage() reports failure.  Also harden buffer\nallocation calculation.  Fixes oss-fuzz 8275\n&quot;graphicsmagick/coder_BIGTIFF_fuzzer: Indirect-leak in\nAllocateImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/ept.c (ReadEPTImage): Add validations of 'count' and\n'filesize' read from EPT file. In response to oss-fuzz 8248\n&quot;graphicsmagick/coder_EPT_fuzzer: Floating-point-exception in\nWriteTIFFImage&quot; but we are unable to recreate the oss-fuzz issue\nsince the EPT reader already immediately reports an EOF exception.</li>\n</ul>\n</blockquote>\n<p>2018-05-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/oss-fuzz-build.sh: Apply SourceForge patch #57 &quot;Add\nfuzzing support for jpeg + freetype delegates&quot; by Alex Gaynor.</li>\n<li>coders/png.c (read_user_chunk_callback): Fix memory leak and use\nof uninitialized memory when handling eXIf chunk. Fixes oss-fuzz\n8247 &quot;graphicsmagick/coder_PNG24_fuzzer: Direct-leak in\npng_malloc&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/oss-fuzz-build.sh: Apply SourceForge patch #56 &quot;Use a\nfew delegate libraries in fuzzing&quot; by Alex Gaynor.</li>\n</ul>\n</blockquote>\n<p>2018-05-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/rwfile.tap: MIFF zip and bzip compression tests do not\nfail if zlib and bzlib are not available because the compression\nrequest is silently changed to no compression.</li>\n</ul>\n</blockquote>\n<p>2018-05-07  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage, InsertAttributeIntoInputStream):\nFor a reference such as 'class=&quot;classname&quot;', the &quot;classname&quot;\nis now allowed to be undefined.</li>\n<li>coders.svg.c (ProcessStyleClassDefs): Class definitions\ndefined within a &lt;style&gt; block may now be empty.</li>\n<li>These relaxed conditions are not specifically called out in\nthe SVG spec as being either acceptable or unacceptable, but\nother SVG renderers (e.g., Chrome) handle them this way. These\nchanges do not resolve, but are related to, ticket #307.</li>\n</ul>\n</blockquote>\n<p>2018-05-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>utilities/Makefile.am (utilities/tests/montage.log): Fix\ndependency rule so that effects.tap is fully executed before\nexecution of montage.tap starts.</li>\n</ul>\n</blockquote>\n<p>2018-05-04  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage, TraceXXX): The PrimitiveInfo\narray used to store points generated by TraceEllipse(), the\nother TraceXXX() functions, and DrawImage() was not always\nbeing expanded when needed, resulting in writes beyond the\nend of the currently allocated storage. To fix this problem,\na new data structure PrimitiveInfoMgr, and an associated\nfunction, PrimtiveInfoRealloc(), were written to handle\nexpanding the PrimitiveInfo array as needed. DrawImage() and\nthe TraceXXX() functions were modified to prevent the out of\nbounds writes to memory. This fixes ticket #516.</li>\n</ul>\n</blockquote>\n<p>2018-05-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOneJNGImage): Add more JNG chunk\nvalidations. Fixes an issue reported by &quot;Trace Probe&quot; via a\nfollow-up post to SourceForge issue 437 &quot;assertion failure in\nWriteBlob&quot;, although the issue described was not reproduced.</li>\n<li>coders/meta.c (ReadMETAImage): Detect and report 8BIMTEXT and\n8BIMWTEXT decoding problems.  Fixes oss-fuzz 8125\n&quot;graphicsmagick/coder_8BIMTEXT_fuzzer: Use-of-uninitialized-value\nin format8BIM&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-05-02  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TraceStrokePolygon): Excessively\nlarge values of stroke-width were cascading through\nother computations, causing the function to write beyond\nthe end of it's array of points when the stroke-linejoin\nattribute value was &quot;round&quot;. Code was added to reallocate\nthe array of points as needed, and to limit the size of\nstroke-width (for computational purposes) to no more than\napproximately twice the diagonal size of the output image.\nFixes ticket #515.</li>\n<li>The same limit on stroke-width was applied to all other\ninstances of the same computation in render.c.</li>\n</ul>\n</blockquote>\n<p>2018-05-01  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>This change set fixes ticket #471.</li>\n<li>magick/render.c (DrawImage): Polylines with fewer\nthan two points were being flagged as an error. The\nSVG spec has no such restriction (fixed).</li>\n<li>coders/svg.c (SVGStartElement) Inner &lt;svg&gt; elements\ncould modify the output image dimensions if a geometry\nstring was supplied. Now the output image dimensions\nare determined by the outermost &lt;svg&gt; only.</li>\n</ul>\n</blockquote>\n<p>2018-05-01  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TraceEllipse, TraceRectangle,\nTraceRoundRectangle): Per the SVG spec, rectangles and\nround rectangles having a width or height of zero are\nnot rendered. Also per the spec, ellipses having an x\nor y radius of zero are not rendered.  Fixes ticket #457.</li>\n</ul>\n</blockquote>\n<p>2018-04-30  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.h, (PrimitiveInfo), magick/render.c: Added\nmember &quot;flags&quot; to PrimitiveInfo to support indicating closed\nshapes (e.g., rectangle, circle, path closed using 'z' or 'Z').\nUpdated code in render.c (functions TraceXXX) to indicate\nclosed shapes.  This replaces the previous policy of detecing\nclosed shapes by comparing the first and last points to see if\nthey are identical (within MagickEpsilon). The old policy\nprevented open subpaths with the same first and last point from\nbeing rendered properly (per the SVG spec) when round or square\nendcaps were enabled.  Part of the fix for ticket #322.</li>\n<li>magick/render.c (ConvertPrimitiveToPath): Modified duplicate\npoint elimination code so that the first and last points of\na subpath are always preserved.  Consequences: (1) Allows\nfor the correct rendering of the sequence &quot;move x1 y1 line\nx1 y1&quot; with round or square endcaps.  Part of the fix for\nticket #322. (2) Fixes a bug in which eliminating the last\npoint as a duplicate caused a closed shape to no longer be\nclosed. This would manifest itself, for example, as a small\n&quot;nub&quot; on the boundary of a filled circle.</li>\n<li>magick/render.c (GetPixelOpacity): Fixed a bug in the\ncode that computed the distance between a point and a\nsegment (polygon edge).  Prior to this fix, for zero length\nsegments this code would generate a divide-by-zero and\nincorrect output. Part of the fix for ticket #322.</li>\n<li>magick/render.c (DrawPolygonPrimitive): Polygons/paths with\nzero or one points are no longer rendered per the SVG spec.</li>\n<li>magick/render.c (DrawStrokePolygon): Per the SVG spec, a\npolygon consisting of a single move-to command is not stroked.</li>\n<li>magick/render.c (TracePath): Per the SVG spec, if the\nendpoints (x1, y1) and (x2, y2) of an arc subpath are identical,\nthen this is equivalent to omitting the elliptical arc segment\nentirely.  For rendering purposes the zero length arc is\ntreated like a zero length &quot;line to&quot; command to the current\npoint.</li>\n<li>magick/render.c (TraceStrokePolygon): Added code to detect\nzero length open subpaths and return a stroked polygon containing\nno points when round or square endcaps are not enabled.  This\nsatisfies the SVG spec requirement that zero length subpaths are\nonly stroked if the 'stroke-linecap' property has a value of\nround or square.</li>\n<li>magick/render.c (TracePath): Fixed a bug in which if a &quot;move to&quot;\ncommand was followed by additional pairs of points, indicating\nimplied &quot;line to&quot; commands, each point was added twice.</li>\n</ul>\n</blockquote>\n<p>2018-04-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcx.c (ReadPCXImage): Colormap from PCX header is only\nused if colors &lt;= 16. Determination of DirectClass image was\nwrong.  Fixes oss-fuzz 8093 &quot;graphicsmagick/coder_PCX_fuzzer:\nUse-of-uninitialized-value in IsMonochromeImage&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Updates to prepare for the 1.3.29 release.</li>\n<li>coders/pict.c (DecodeImage): Assure that scanline is initialized\nto avoid use of uninitialized data.  Fixes oss-fuzz 8063\n&quot;graphicsmagick/coder_WPG_fuzzer: Use-of-uninitialized-value in\nReadPICTImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dpx.c (ReadDPXImage): Assure that NULL pixels is not\nused.  Fixes oss-fuzz 8078 &quot;graphicsmagick/coder_DPX_fuzzer:\nNull-dereference WRITE in ReadDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>NEWS.txt: Update NEWS file with information about changes since\nlast release.</li>\n</ul>\n</blockquote>\n<p>2018-04-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c (ReadDIBImage): Disable EOF tests for &quot;ICODIB&quot;\nsubformat due to icon file provided by SourceForge issue #557\n&quot;ErrorCorruptImage: Magick: Unexpected end-of-file ()&quot; where an\nEOF error was reported due to no mask data being supplied.</li>\n<li>coders/png.c (ReadOneJNGImage): The embedded JPEG image is\nrequired to have the same dimensions as the JNG image as provided\nby JHDR.  Fixes SourceForge bug 555 &quot;heap-buffer-overflow in\nAcquireCacheNexus when processing jng file&quot;.  It is likely that\nthis issue is precipitated by using 'montage' which seems to set a\ndefault non-zero image size.\n(ReadMNGImage): By default limit the maximum loops specifiable by\nthe MNG LOOP chunk to 512 loops, but allow this to be modified by\n'-define mng:maximum-loops=value'.  Also assure that the value is\nin the range of 0-2147483647 as per the MNG specification.  This\nis to address the denial of service issue described by\nCVE-2018-10177.  This problem was reported to us by Petr Gajdos\nvia email on Fri, 20 Apr 2018.</li>\n<li>coders/dpx.c (ReadDPXImage): Move misplaced channel validation\ncode.  Fixes oss-fuzz 8041 &quot;graphicsmagick/coder_DPX_fuzzer:\nUse-of-uninitialized-value in WriteDPXImage&quot; and oss-fuzz 8055\n&quot;graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\nEnhanceImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (StringToListMod): Algorithm fixes to fix use of\nuninitialized data.  Fixes oss-fuzz 8046\n&quot;graphicsmagick/coder_XPM_fuzzer: Use-of-uninitialized-value in\nStringToListMod&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (ReadXPMImage): Reduce memory consumption further.\nHopefully fixes oss-fuzz 8013 &quot;graphicsmagick/coder_XPM_fuzzer:\nOut-of-memory in graphicsmagick_coder_XPM_fuzzer&quot;. (Credit to\nOSS-Fuzz)</li>\n<li>magick/utility.c (StringToList): Only allocate the memory\nrequired when converting string to an ASCII list.  May or may not\nfix oss-fuzz 8013 &quot;graphicsmagick/coder_XPM_fuzzer: Out-of-memory\nin graphicsmagick_coder_XPM_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Fix benign use of uninitialized\ndata when testing header magick.  Fixes oss-fuzz 7980\n&quot;graphicsmagick/coder_BMP_fuzzer: Use-of-uninitialized-value in\nLocaleNCompare&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dpx.c (ReadDPXImage): ColorDifferenceCbCr does require\neven image width. Fixes oss-fuzz 7966\n&quot;graphicsmagick/coder_DPX_fuzzer: Unknown signal in\nTentUpsampleChroma&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): ColorDifferenceCbCr element\nrequires two samples/pixel, not one. Fixes oss-fuzz 7951\n&quot;graphicsmagick/coder_DPX_fuzzer: Heap-buffer-overflow in\nReadDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdb.c (ReadPDBImage): Assure that pixels buffer is\ninitialized.  Fixes oss-fuzz 7937\n&quot;graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\nReadPDBImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/mvg.c (ReadMVGImage): Assure that MVG viewbox parameters\nwere supplied.  Fixes oss-fuzz 7936\n&quot;graphicsmagick/coder_MVG_fuzzer: Use-of-uninitialized-value in\nReadMVGImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dpx.c (ReadDPXImage): Element descriptors CbYCrY422 and\nCbYACrYA4224 require that the image width be evenly divisible by 2\nso enforce that.  Fixes oss-fuzz 7935\n&quot;graphicsmagick/coder_DPX_fuzzer: Heap-buffer-overflow in\nReadDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Reject DPX files which claim to use\nsigned data.  Fixes oss-fuzz 7758\n&quot;graphicsmagick/coder_DPX_fuzzer: Use-of-uninitialized-value in\nWriteDPXImage&quot;. (Credit to OSS-Fuzz)\n(ReadDPXImage): Validate that the image elements do update all of\nthe channels, including the alpha channel.  Now report an error if\na color channel is missing.  Fixes oss-fuzz 7758\n&quot;graphicsmagick/coder_DPX_fuzzer: Use-of-uninitialized-value in\nWriteDPXImage&quot;.</li>\n<li>coders/gif.c (DecodeImage): Finally fix oss-fuzz 7732\n&quot;graphicsmagick/coder_GIF_fuzzer: Heap-buffer-overflow in\nDecodeImage&quot; which was not actually fixed with previous\nchanges. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-21  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>coders/topol.c Emit error when tile storage overflows image data;</dt>\n<dd>fixes oss-fuzz 7769 thanks to oss-fuzz.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2018-04-20  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (ConvertPrimitiveToPath):  Fixed a bug\nin which SVG paths containing multiple open subpaths were\nnot being processed correctly, resulting in incorrect\noutput.  This fixes ticket #94.</li>\n</ul>\n</blockquote>\n<p>2018-04-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (DecodeImage): Fix use of uninitialized memory\nduring error condition in decoder. Fixes oss-fuzz 7732\n&quot;graphicsmagick/coder_GIF_fuzzer: Heap-buffer-overflow in\nDecodeImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/txt.c (ReadTXTImage): Assure that all image pixels are\ninitialized to black.</li>\n<li>Magick++/demo/zoom.cpp (main): Add a -read-blob option to read\ninput file into a Blob so that it is read by the Blob reader\nrather than the file reader.  Default the output Geometry to the\ninput image geometry in case the user does not specify a resize\nresolution or geometry.</li>\n<li>Magick++/tests/readWriteBlob.cpp (main): Improve the quality of\ncode which reads a file into memory for Blob testing.</li>\n<li>magick/blob.c (BlobToImage): Add exception reports for the cases\nwhere 'magick' was not set and the file format could not be\ndeduced from its header.  Previously a null Image pointer was\nbeing returned without any exception being thrown.</li>\n</ul>\n</blockquote>\n<p>2018-04-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Assure that CbCr layer initializes\nall channels if it is the first element of a planar DPX.  Fixes\noss-fuzz 7703 &quot;graphicsmagick/coder_DPX_fuzzer:\nUse-of-uninitialized-value in WriteDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/pict.c (ReadPICTImage): Don't refer to filename member of\nImageInfo which was just destroyed. Much thanks to Alex Gaynor for\nfinding this.  Should fix oss-fuzz 6867\n&quot;graphicsmagick/coder_PCT_fuzzer: Heap-use-after-free in\nGetLocaleExceptionMessage&quot;. (Credit to OSS-Fuzz).</li>\n</ul>\n</blockquote>\n<p>2018-04-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sgi.c (ReadSGIImage): Assure that iris pixels are fully\ninitialized.  Fixes oss-fuzz 7543\n&quot;graphicsmagick/coder_SGI_fuzzer: Use-of-uninitialized-value in\nSGIEncode&quot;. (Credit to OSS-Fuzz).</li>\n<li>coders/xcf.c (ReadXCFImage): Restore SetImage() which was\npreviously commented out.  This is needed to assure initialized\npixels.  Fixes oss-fuzz 7430 &quot;graphicsmagick/coder_XCF_fuzzer:\nUse-of-uninitialized-value in AlphaCompositePixel&quot;. (Credit to\nOSS-Fuzz).</li>\n<li>coders/pict.c (ReadPICTImage): Properly initialize &quot;black\ncanvas&quot; that tiles may be composed on.  Fixes oss-fuzz 7574\n&quot;graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\nEnhanceImage&quot;. (Credit to OSS-Fuzz).</li>\n<li>coders/rle.c (ReadRLEImage): Check for EOF when reading comment.\nFixes oss-fuzz 7667 &quot;graphicsmagick/coder_RLE_fuzzer:\nUse-of-uninitialized-value in ReadRLEImage&quot;. (Credit to OSS-Fuzz).</li>\n<li>coders/pdb.c (WritePDBImage): Avoid use of uninitialized\nbytes. Fixes oss-fuzz 7638 &quot;graphicsmagick/coder_PDB_fuzzer:\nUse-of-uninitialized-value in WritePDBImage&quot;. (Credit to\nOSS-Fuzz).</li>\n<li>coders/rla.c (ReadRLAImage): Add many more validations,\nincluding scanline offsets and number of channels.  Fixes oss-fuzz\n7653 &quot;graphicsmagick/coder_RLA_fuzzer: Timeout in\ngraphicsmagick_coder_RLA_fuzzer&quot;. (Credit to OSS-Fuzz).</li>\n<li>coders/txt.c (ReadTXTImage): Implement missing subrange logic to\nread only the specified range of frames.  Limits frames read from\noss-fuzz test case\nclusterfuzz-testcase-minimized-coder_TEXT_fuzzer-6061076048248832\n&quot;graphicsmagick/coder_TEXT_fuzzer: Timeout in\ngraphicsmagick_coder_TEXT_fuzzer&quot;. (Credit to OSS-Fuzz).</li>\n<li>Magick++/lib/Image.cpp (read): Set subrange = 1 since this\ninterface is intended to read just one frame from the input file.\nUse the STL-based interfaces to read multiple frames.</li>\n<li>coders/fits.c (ReadFITSImage): Verify FITS header before reading\nfurther.  Rejects file from oss-fuzz 7650\n&quot;graphicsmagick/coder_FITS_fuzzer: Out-of-memory in\ngraphicsmagick_coder_FITS_fuzzer&quot;.  (Credit to OSS-Fuzz).</li>\n<li>PerlMagick/Magick.xs (Get): Fix PerlMagick compilation problem\ndue to rename/repurposing of image-&gt;clip_mask.</li>\n</ul>\n</blockquote>\n<p>2018-04-13  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.c, magick/image.h:  In order to be able to\nsupport SVG masks, and to be able to further extend the\nImage data structure without changing its size, new data\nstructure ImageExtra (struct _ImageExtra) has been added.\nHeader file image.h contains only a forward declaration;\nthe members of ImageExtra are defined in file image.c.\nImage member variable Image * clip_mask has been replaced\nby ImageExtra * extra, and function prototypes that enable\naccess to ImageExtra have been added to image.h.  The\nclip_mask member variable now resides in ImageExtra.  All\nreferences to Image::clip_mask in the GraphicsMagick\nsource code have either been replaced with direct references\nto ImageExtra::clip_mask (image.c), or have been replaced\nwith calls to access function ImageGetClipMask().</li>\n<li>magick/render.c, magick/render.h:  In order to be able to\nsupport SVG masks, and to be able to further extend the\nDrawInfo data structure without changing its size, new data\nstructure DrawInfoExtra (struct _DrawInfoExtra) has been added.\nHeader file render.h contains only a forward declaration;\nthe members of DrawInfoExtra are defined in file render.c.\nDrawInfo member variable char * clip_path has been replaced by\nDrawInfoExtra * extra, and function prototypes that enable\naccess to DrawInfoExtra have been added to render.h.  The\nclip_path member variable now resides in ImageExtra.  All\nreferences to DrawInfo::clip_path in the GraphicsMagick\nsource code have either been replaced with direct references\nto DrawInfoExtra::clip_path (render.c), or have been\nreplaced with calls to access function DrawInfoGetClipPath().</li>\n<li>magick/image.c (new functions CompositePathImage,\nCompositeMaskImage, GetImageCompositeMask,\nSetImageCompositeMask):  Defined new data structure ImageExtra,\nadded create/destroy logic, and implemented associated access\nfunctions.  Implemented SVG masks.</li>\n<li>magick/render.c (DrawImage, new function DrawCompositeMask):\nDefined new data structure DrawInfoExtra, added create/destroy\nlogic, and implemented associated access functions.  Impemented\nSVG masks.</li>\n<li>magick/pixel_cache.c (SyncCacheNexus, new function\nCompositeCacheNexus):  Fixed references to Image::clip_mask.\nImplemented SVG masks.</li>\n<li>coders/svg.c (SVGStartElement, SVGEndElement): Implemented\nSVG masks.</li>\n<li>locale/c.mgk, magick/gm_messages.mc, magick/local_c.h:\nAdded new error codes to support SVG masks.</li>\n<li>coders/ps3.c, magick/enhance.c: Fixed references to\nImage::clip_mask.</li>\n<li>magick/draw.c, wand/drawing_wand.c: Fixed references to\nDrawInfo::clip_path.</li>\n</ul>\n</blockquote>\n<p>2018-04-13  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Crash on row overflow fixed oss-fuzz 7639 thanks to oss-fuzz.</li>\n</ul>\n</blockquote>\n<p>2018-04-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Add more header validations.\nAlways assure that scanline is initialized for Luma channel. Fixes\noss-fuzz 7544 &quot;graphicsmagick/coder_DPX_fuzzer:\nUse-of-uninitialized-value in WriteDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/pdb.c (ReadPDBImage): Add more EOF checks to avoid benign\nuse of uninitialized data.  Fixes oss-fuzz 7545\n&quot;graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\nReadPDBImage&quot;.</li>\n<li>coders/wpg.c (InsertRow, UnpackWPGRaster): x &amp; y should be\n'unsigned long' to match type used by pixel cache APIs and image\nrows/columns.</li>\n</ul>\n</blockquote>\n<p>2018-04-08  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Stop reading when last row is reached.\nThis should stop oss-fuzz 7528 thanks to oss-fuzz.</li>\n</ul>\n</blockquote>\n<p>2018-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (ReadXCFImage): Fix use of uninitialized data in\nmagick header string for runt file.  Fixes oss-fuzz 7521\n&quot;graphicsmagick/coder_XCF_fuzzer: Use-of-uninitialized-value in\nLocaleNCompare&quot;. (Credit to OSS-Fuzz).</li>\n</ul>\n</blockquote>\n<p>2018-04-09  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>OVERVIEW: Change set 9aaeeca0224c modified the drawing\nof clipping paths to conform to the SVG spec.  This change\nset restores the previous behavior for non-SVG clients of\nrender.c, while still satisfying the SVG spec for SVG clients.</li>\n<li>magick/render.h (DrawInfo): Added a bit field in member\n&quot;flags&quot; to indicate that drawing should be SVG compliant.</li>\n<li>magick/render.c (DrawImage): Now recognizes keyword\n&quot;svg-compliant&quot;, and tags DrawInfo accordingly.  This\nallows for existing features in render.c to be changed\nto comply with the SVG spec without impacting the previous\nbehavior expected by non-SVG clients.</li>\n<li>magick/render.c (DrawImage): Now uses DrawInfo &quot;flags&quot;\nbit for SVG compliance in conjunction with &quot;flags&quot; bit\nfor &quot;clipping path&quot; to determine when to ignore changes\nto fill color, stroke color, etc.  This restores the\nprevious behavior for clipping paths for non-SVG clients.</li>\n<li>coders/svg.c (SVGStartElement): The initial set of\nMVG commands for rendering an SVG file now includes\nnew keyword &quot;svg-compliant&quot; (to indicate that certain\ngraphical elements should be drawn according to the\nSVG spec), and includes an intialization of the SVG\n&quot;fill-rule&quot; to &quot;nonzero&quot; (the SVG default) instead of\nthe internally initialized value of &quot;evenodd&quot;.</li>\n<li>coders/wpg.c: Fixed C99 &quot;//&quot; comments.</li>\n</ul>\n</blockquote>\n<p>2018-04-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (ReadPICTImage): Copy tile exception info to main\nimage and don't composite tile if it has a problem.  Fixes\noss-fuzz 7169 &quot;graphicsmagick/enhance_fuzzer:\nUse-of-uninitialized-value in EnhanceImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dib.c (ReadDIBImage): Do not increase decode bits/pixel\nif compression=2, but use it to increase pixel packet size when\nestimating bytes per line for decode buffer.  Fixes oss-fuzz issue\n7324 &quot;graphicsmagick/coder_WPG_fuzzer: Use-of-uninitialized-value\nin ReadDIBImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dpx.c (ReadDPXImage): When handling the first element of\na planar DPX, assure that the other channels are\ninitialized. Fixes oss-fuzz 7841 &quot;graphicsmagick/coder_DPX_fuzzer:\nUse-of-uninitialized-value in WriteDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/tim.c (ReadTIMImage): Only 4 and 8 bit TIM requires a\ncolormap. For other depths, force reading as DirectClass even if\nthe TIM file provides a colormap.  Fixes oss-fuzz 7407\n&quot;graphicsmagick/coder_TIM_fuzzer: Use-of-uninitialized-value in\nSyncImageCallBack&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-08  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c The unread data contains crap in memory,\nerase current image data. This should mute oss-fuzz 6604.</li>\n<li>coders/wpg.c - condition &quot;if(y&lt;1) continue;&quot; is redundant\nand could be removed completely.\nAllow logging in MatlabV4 module.</li>\n<li>coders/svg.c - Do not use C++ syntax in C code - removed.</li>\n</ul>\n</blockquote>\n<p>2018-04-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (UnpackWPGRaster): Fix uninitialized row 0 when\nrow-based RLE is used.  Fixes oss-fuzz 6603\n&quot;graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\nBlendCompositePixel&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/pcd.c: Fix many issues, including oss-fuzz 6016\n&quot;graphicsmagick/coder_PCD_fuzzer: Heap-double-free in\nMagickRealloc&quot; and oss-fuzz 6108 &quot;graphicsmagick/coder_PCD_fuzzer:\nUnknown signal in AllocateThreadViewDataSet&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (funcDCM_BitsStored): Limit DICOM significant bits\nto 16.  Otherwise rescale map code blows up.  Fixes oss-fuzz 7435\n&quot;graphicsmagick/coder_DCM_fuzzer: Out-of-memory in\ngraphicsmagick_coder_DCM_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/pix.c (ReadPIXImage): Detect EOF.  Reject RLE lenth of\nzero.  Fixes oss-fuzz 7440 &quot;graphicsmagick/coder_PIX_fuzzer:\nOut-of-memory in graphicsmagick_coder_PIX_fuzzer&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Insist on having an element\ndescriptor we understand since otherwise we can not decode the\nimage.  Fixes oss-fuzz 7410 &quot;graphicsmagick/coder_DPX_fuzzer:\nUse-of-uninitialized-value in WriteDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/avs.c, etc... (WriteAVSImage): Cache image list length\nbefore writing image sequence so that progress monitor is\nscalable.  Helps with oss-fuzz 7404\n&quot;graphicsmagick/coder_AVS_fuzzer: Timeout in\ngraphicsmagick_coder_AVS_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-05  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement, SVGEndElement),\nmagick/render.c (DrawImage): The current text position\nis now maintained by DrawImage() instead of by\nSVGStartElement() and SVGEndElement().  This change was\nmade to support the recently implmemented &quot;use&quot; and\n&quot;class&quot; elements, which may make changes to the font\nsize that are not visible to the code in svg.c.</li>\n<li>coders/svg.c (GetStyleTokens, SVGStartElement): The\nlist of SVG attributes is now reordered so that\n&quot;font-size&quot;, &quot;class&quot;, and &quot;style&quot; are processed first.\nThis ensures that a change to the font size will be\nprocessed before any dimensional attribute whose value\nmay depend on the font size (e.g., a width value\nspecified in &quot;em&quot; units).</li>\n<li>coders/svg.c (ProcessStyleClassDefs): Fixed two memory\nleaks associated with making an early return when\nmalformed input is detected.</li>\n<li>magick/render.c (ExtractTokensBetweenPushPop): Fixed\nan uninitialized variable condition which can occur when\nmalformed input is detected.</li>\n<li>magick/render.h (DrawInfo), magick/render.c: DrawInfo\nmember &quot;unused1&quot; has been renamed &quot;flags&quot;.  It is now\nused to tag a DrawInfo as being a clipping path or a\ncompositing mask.</li>\n</ul>\n</blockquote>\n<p>2018-04-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdb.c (ReadPDBImage): Update DirectClass pixels to avoid\nuse of uninitialized memory for 2 bits/pixel.  Fixes oss-fuzz 7350\n&quot;graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\nWritePDBImage&quot;.  (Credit to OSS-Fuzz)</li>\n<li>coders/palm.c (ReadPALMImage): Fix use of uninitialized memory.\nFixes oss-fuzz 7325 &quot;graphicsmagick/coder_PALM_fuzzer:\nUse-of-uninitialized-value in TransparentImageCallBack&quot;. (Credit\nto OSS-Fuzz)</li>\n<li>coders/dcm.c (DCM_ReadNonNativeImages): Break out of reading\nloop on EOF and properly report exception.  Fixes oss-fuzz 7349\n&quot;graphicsmagick/coder_DCM_fuzzer: Timeout in\ngraphicsmagick_coder_DCM_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xcf.c (ReadXCFImage): Require that XCF file offsets be in\nascending order to avoid DOS.  Fixes oss-fuzz 7333\n&quot;graphicsmagick/coder_XCF_fuzzer: Out-of-memory in\ngraphicsmagick_coder_XCF_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/wpg.c (UnpackWPGRaster): Fix memory leak in error return\npath. Fixes oss-fuzz 7338 &quot;graphicsmagick/enhance_fuzzer:\nDirect-leak in UnpackWPGRaster&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-03  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement): This changeset adds\nsupport for SVG geometric transforms specified using the\nstyle=&quot;transform: ...&quot; syntax.  This syntax is sometimes\nused when exporting SVG files from Adobe Illustrator.</li>\n</ul>\n</blockquote>\n<p>2018-04-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Validate DPX packing method.  Fixes\noss-fuzz 7296 &quot;graphicsmagick/coder_DPX_fuzzer:\nUse-of-uninitialized-value in WriteDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-04-02  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement, SVGEndElement),\nmagick/render.c (DrawImage): This changeset adds support for\n&quot;class&quot; styling attributes within a &lt;style&gt; section within\nthe &lt;defs&gt; section, and the ability to reference them from\nother SVG elements by class=&quot;classname&quot;.  SVG files exported\nfrom Adobe Illustrator make extensive use of &quot;class&quot; definitions.</li>\n</ul>\n</blockquote>\n<p>2018-04-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (ReadPICTImage): Fix leak of tile image on EOF.\nThis is a recent regression.  Fixes oss-fuzz 7287\n&quot;graphicsmagick/coder_PCT_fuzzer: Indirect-leak in\nCloneImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/pixel_cache.c (OpenCache): Use image-&gt;scene rather than\nGetImageIndexInList(image) for scene-id part of cache info file\nname.</li>\n<li>coders/txt.c (WriteTXTImage): Optimize the progress indicator\nsince it is very inefficient with a large number of scenes and\noss-fuzz 7090 &quot;graphicsmagick/coder_TEXT_fuzzer: Timeout in\ngraphicsmagick_coder_TEXT_fuzzer&quot; consistently shows\nGetImageListLength() in its stack traces.</li>\n<li>coders/dcm.c (ReadDCMImage): DICOM reader was no longer\nimmediately quitting with excessive samples per pixel.  This\ncaused spinning for a very long time when reading planar images\nwith large samples per pixel.  This is a regression due to recent\nchanges.  Fixes oss-fuzz 7269 &quot;graphicsmagick/coder_DCM_fuzzer:\nTimeout in graphicsmagick_coder_DCM_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/xcf.c (ReadXCFImage): Destroy layer info before returning\ndue to exception.  This is a new regression due to adding more\nchecks. Fixes oss-fuzz 7277 &quot;graphicsmagick/coder_XCF_fuzzer:\nDirect-leak in ReadXCFImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/pdb.c (ReadPDBImage): Assure that all bytes of scanline\nare initialized while decoding.  Fixes oss-fuzz 7051\n&quot;graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\nWritePDBImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcx.c (ReadPCXImage): Assure that scanline is\ninitialized.  Fixes oss-fuzz 6612\n&quot;graphicsmagick/coder_PCX_fuzzer: Use-of-uninitialized-value in\nWriteRLEPixels&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/wpg.c (ReadWPGImage): Detect unexpected EOF and avoid use\nof uninitialized data.  Fixes oss-fuzz 6601\n&quot;graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\nImportIndexQuantumType&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/sgi.c (ReadSGIImage): Assure that RLE decode buffer is\ninitialized.  Fixes oss-fuzz 6599\n&quot;graphicsmagick/coder_SGI_fuzzer: Use-of-uninitialized-value in\nSyncImageCallBack&quot; and oss-fuzz 6600\n&quot;graphicsmagick/coder_SGI_fuzzer: Use-of-uninitialized-value in\nSGIEncode&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/viff.c (ReadVIFFImage): Fix blob I/O size validation to\navoid use of uninitialized data. Fixes oss-fuzz 6597\n&quot;graphicsmagick/coder_VIFF_fuzzer: Use-of-uninitialized-value in\nThresholdImage&quot;. (Credit to OSS-Fuzz)\n(ReadVIFFImage): Don't execute SetImageType(image,BilevelType) on\nan image which has no pixels yet in order to avoid use of\nuninitialized data. Fixes oss-fuzz 6597.  (Credit to OSS-Fuzz)</li>\n<li>coders/wbmp.c (ReadWBMPImage): Fix blob I/O size validation to\navoid use of uninitialized data. Fixes oss-fuzz 7047\n&quot;graphicsmagick/coder_WBMP_fuzzer: Use-of-uninitialized-value in\nReadWBMPImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/wpg.c (ExtractPostscript): Allow non-Postscript content\nbut force reading using the magick we already detected.  Also log\nthe format that we detected.</li>\n<li>coders/xcf.c (ReadOneLayer): Reject layer size of 0x0.  Fixes\noss-fuzz 6636 &quot;graphicsmagick/coder_XCF_fuzzer: Direct-leak in\nMagickMallocAligned&quot;. (Credit to OSS-Fuzz)\n(ReadXCFImage): Verify that seek offsets are within the bounds of\nthe file data. Fixes oss-fuzz 6682\n&quot;graphicsmagick/coder_XCF_fuzzer: Out-of-memory in\ngraphicsmagick_coder_XCF_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/pixel_cache.c (ModifyCache): Destroy CacheInfo if\nOpenCache() fails so it is not leaked.</li>\n<li>coders/wpg.c (ExtractPostscript): Enforce that embedded file is\na Postscript file.  Fixes oss-fuzz 7235\n&quot;graphicsmagick/coder_WPG_fuzzer: Indirect-leak in MagickRealloc&quot;.\nThis is indicated to be a regression. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (ReadPICTImage): Check image pixel limits before\nallocating memory for tile.  Fixes oss-fuzz 7217\n&quot;graphicsmagick/coder_PICT_fuzzer: Out-of-memory in\ngraphicsmagick_coder_PICT_fuzzer&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-03-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcd.c (ReadPCDImage): Add checks for EOF. Fixes oss-fuzz\nissue 7180 &quot;graphicsmagick/coder_PCDS_fuzzer: Timeout in\ngraphicsmagick_coder_PCDS_fuzzer&quot;.  (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-29  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">coders/svg.c (SVGStartElement, SVGEndElement),\nmagick/render.c (DrawImage): This changeset implements the SVG\n&quot;use&quot; element.  Graphical elements (e.g., &quot;rect&quot;, &quot;text&quot;, etc.)\ncan be tagged with an identifier using 'id=&quot;identifier&quot;' when\ndefined within the &quot;defs&quot; section.  They can then be referenced\nelsewhere in the SVG file using:</p>\n<p>&lt;use xlink:href=&quot;#identifier&quot; ... /&gt;</p>\n<p>When referencing a graphical element by its identifier, the\nfollowing syntaxes are now treated as being the same:</p>\n<p>href=&quot;#identifier&quot;\nhref=&quot;url(#identifier)&quot;\nxlink:href=&quot;#identifier&quot;\nxlink:href=&quot;url(#identifier)&quot;</p>\n</li>\n</ul>\n</blockquote>\n<p>2018-03-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tim.c (ReadTIMImage): Reader was not observing subimage\nand subrange to quit after the specified frame range.  Inspired by\noss-fuzz 7132 &quot;graphicsmagick/coder_TIM_fuzzer: Timeout in\ngraphicsmagick_coder_TIM_fuzzer&quot; (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-27  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement): Enable setting the\nbackground color from the SVG file when the client\nspecifies style=&quot;background:color&quot; inside the &lt;svg&gt;\n... &lt;/svg&gt; element.</li>\n</ul>\n</blockquote>\n<p>2018-03-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mtv.c (ReadMTVImage): Add some elementary tracing to MTV\nreader.</li>\n<li>coders/png.c (ReadMNGImage): Fix SourceForge issue 554\n&quot;Divide-by-zero in ReadMNGImage (coders/png.c)&quot;.  (Credit to Trace\nProbe)</li>\n<li>coders/bmp.c (ReadBMPImage): Assure that start position always\nadvances to avoid looping BMPs.  Fixes oss-fuzz 7045\n&quot;graphicsmagick/coder_BMP_fuzzer: Timeout in\ngraphicsmagick_coder_BMP_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/pict.c (DecodeImage): Verify that sufficient backing data\nexists before allocating memory to read it.  Fixes oss-fuzz 6629\n&quot;graphicsmagick/coder_PCT_fuzzer: Out-of-memory in\ngraphicsmagick_coder_PCT_fuzzer&quot;.\n(ReadPICTImage): Destroy tile_image in ThrowPICTReaderException()\nmacro to simplify logic.</li>\n</ul>\n</blockquote>\n<p>2018-03-25  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Check whether datablock is really read.\nFixes oss-fuzz 7056 (Credit to OSS-Fuzz)</li>\n<li>coders/txt.c Duplicate image check for data with fixed geometry\nprevious check is skipped. Fixes oss-fuzz 7090.</li>\n</ul>\n</blockquote>\n<p>2018-03-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (ReadDCMImage): Validate that samples per pixel is\nin valid range.  Fixes oss-fuzz 6260\n&quot;graphicsmagick/coder_DCM_fuzzer: Out-of-memory in\ngraphicsmagick_coder_DCM_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/meta.c (format8BIM): Allocate space for null termination\nand null terminate string.  Fixes oss-fuzz 5985\n&quot;graphicsmagick/coder_8BIMTEXT_fuzzer: Heap-buffer-overflow in\nformatIPTCfromBuffer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/fits.c (ReadFITSImage): Include number of FITS scenes in\nfile size validations.  Fixes oss-fuzz 6781\n&quot;graphicsmagick/coder_FITS_fuzzer: Timeout in\ngraphicsmagick_coder_FITS_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/meta.c (format8BIM): Validate size request prior to\nallocation. Fixes oss-fuzz issue 5974\n&quot;graphicsmagick/coder_8BIMTEXT_fuzzer: Out-of-memory in\ngraphicsmagick_coder_8BIMTEXT_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-23  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">coders/mat.c Fix forged amount of frames 7076. (Credit to OSS-Fuzz)</p>\n<blockquote>\n<p>* coders/topol.c Check for forged image that overflows file size\n(fuzz 6836).</p>\n</blockquote>\n</li>\n</ul>\n</blockquote>\n<p>2018-03-23  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">magick/render.c, render.h (DrawInfo, CloneDrawInfo,\nDrawClipPath, DrawImage, GetDrawInfo): According to the SVG\nspec, a clipping path is defined only by the geometry of its\nconstituent elements, and is not dependent on fill color/opacity,\nstroke color/opacity, or stroke width.  To ensure conformity\nwith the spec, when a clipping path is created, these SVG\nelements are set to appropriate values, and any attempt to\nmodify them is ignored.</p>\n<p>Also, whenever a clipping path is drawn, the associated image\nattributes are now updated from the parent image structure.\nThis ensures that any added or modified attributes are up to\ndate.</p>\n</li>\n</ul>\n</blockquote>\n<p>2018-03-22  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul>\n<li><dl class=\"first docutils\">\n<dt>coders/topol.c Use rather MagickSwabArrayOfUInt32() to</dt>\n<dd><p class=\"first\">flip all array elements at once.</p>\n<p class=\"last\">* magick/annotate.c Compilation issue - using C++ syntax in C code.</p>\n</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2018-03-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadDPXImage): Validate header length and offset\nproperties.  Fixes oss-fuzz &quot;graphicsmagick/coder_DPX_fuzzer:\nUse-of-uninitialized-value in WriteDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-20  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c (RenderType): According to the SVG\nspec, the 'font-family' element can be a comma-separated\nlist of one or more font family names.  Function RenderType\nin file annotate.c has been modified to support multiple\nfont family names as follows.  The comma-separated list is\nprocessed until the first available font family is found.\nIf no font family is found, or if font substitution occurred,\nthen the entire font family string is tested to see if it\nexactly matches a font name, or if the font family string\nwith blanks changed to hypens exactly matches a font name.\nIf a font name match is found, the matched font overrides\nthe font substution.  The font name matching functionality\nis beyond what's in the SVG spec and is provided as a\nconvenience to the user.</li>\n</ul>\n</blockquote>\n<p>2018-03-20  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Fix forged amount of frames 6755. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-20  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/topol.c Redesign ReadBlobDwordLSB() to be more effective.</li>\n</ul>\n</blockquote>\n<p>2018-03-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (ReadXPMImage): Reject XPM if its condensed version\ncontains non-whitespace control characters.  Fixes oss-fuzz 7027\n&quot;graphicsmagick/coder_XPM_fuzzer: Timeout in\ngraphicsmagick_coder_XPM_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-19  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/topol.c Fix tile index overflow fuzz 6634. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (DCM_ReadGrayscaleImage): Don't use rescale map if\nit was not allocated.  This issue was induced in this development\ncycle due to disabling generating the rescale map.  Fixes oss-fuzz\n7021 &quot;graphicsmagick/coder_DCM_fuzzer: Null-dereference READ in\nDCM_ReadGrayscaleImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/color_lookup.c (QueryColorDatabase): Defend against\npartial scanf() expression matching, resulting in use of\nuninitialized data.  Likely fixes oss-fuzz 6596\n&quot;graphicsmagick/coder_XPM_fuzzer: Use-of-uninitialized-value in\nIsMonochromeImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/rle.c (ReadRLEImage): Validate number of colormap bits to\navoid undefined shift behavior.  Fixes oss-fuzz 6630\n&quot;graphicsmagick/enhance_fuzzer: Undefined-shift in\nReadRLEImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dcm.c (DCM_ReadRGBImage): Don't use rescale map if it was\nnot allocated.  This issue was induced in this development cycle\ndue to disabling generating the rescale map.  Fixes oss-fuzz 6995\n&quot;graphicsmagick/coder_DCM_fuzzer: Null-dereference READ in\nDCM_ReadRGBImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dib.c (DecodeImage): Report failure to decode to expected\namount of pixel data as an error.  Fixes oss-fuzz 7007\n&quot;graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\nEnhanceImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/bmp.c (ReadBMPImage): Add file size and offset/seek\nvalidations.  Fixes oss-fuzz 6623\n&quot;graphicsmagick/coder_BMP_fuzzer: Timeout in\ngraphicsmagick_coder_BMP_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-03-17  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>dcraw/dcraw.c Updated to version 9.27</li>\n</ul>\n</blockquote>\n<p>2018-03-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (ReadGIFImage): Fix botched fixes for use of\nuninitialized data when reading GIF extension blocks.  Hopefully\nok now.</li>\n</ul>\n</blockquote>\n<p>2018-03-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gif.c (ReadGIFImage): Fix use of uninitialized data when\nreading GIF extension blocks.  Fixes oss-fuzz 6609\n&quot;graphicsmagick/coder_GIF_fuzzer: Use-of-uninitialized-value in\nMagickArraySize&quot;. This seems to be a totally benign issue. (Credit\nto OSS-Fuzz)</li>\n<li>magick/magick.c (MagickSignal): Use an alternate signal stack,\nif available.  This is required for Go lang C language extensions\nsince Go lang requests an alternate signal sack, and uses small\nstacks for its threads.  If the library user has not allocated an\nalternate signal stack, then behavior should be just as before.\nIssue was originally reported by yzh杨振宏 on March 1, 2018 via\nthe graphicsmagick-help SourceForge mailing list.</li>\n</ul>\n</blockquote>\n<p>2018-02-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (AcquireCacheNexus): Add a check that the\npixel cache is compatible with the image dimensions.  Fixes\noss-fuzz issues 5978 5988 5989 5990 5993 6016, and 6056, which are\nall related to the PICT writer. (Credit to OSS-Fuzz)</li>\n<li>magick/draw.c (DrawGetStrokeDashArray): Check for failure to\nallocate memory.  Patch submited by Petr Gajdos via email on\nFebruary 28, 2018.</li>\n</ul>\n</blockquote>\n<p>2018-02-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/fits.c (ReadFITSImage): Fix signed integer overflow when\ncomputing pixels size.  Fixes oss-fuzz 6586\n&quot;graphicsmagick/coder_FITS_fuzzer: Integer-overflow in\nReadFITSImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-27  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement, SVGEndElement): From the\nSVG spec:  &quot;The 'foreignObject' element allows for inclusion\nof a foreign namespace which has its graphical content drawn\nby a different user agent.&quot;  Code has been added to consume\nand discard the 'foreignObject' element and any settings (e.g.,\nfill color) internal to it.  Previously, settings internal\nto the 'foreignObject' element would persist and &quot;leak&quot; into\nthe graphic elements that followed it, resulting in undesired\nside effects (e.g., fill color other than the expected default).</li>\n</ul>\n</blockquote>\n<p>2018-02-27  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawPolygonPrimitive): Fixed a bug\nintroduced by changeset 39102dd1d456.  For SVG, this\nchangeset applied both the group AND the fill opacity\nvalues to fill patterns (similarly for stroke).  For WMF,\nhowever, this caused the fill pattern to be rendered as\n100% transparent.  A closer reading of the SVG spec does\nNOT show that the fill opacity should be applied to the\nfill pattern, so as of this latest changeset only the group\nopacity value is applied to fill and stroke patterns.</li>\n</ul>\n</blockquote>\n<p>2018-02-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Fix divide by zero regression added\nby latest fixes.  Fixes oss-fuzz 6583\n&quot;graphicsmagick/coder_BMP_fuzzer: Divide-by-zero in ReadBMPImage&quot;.\n(Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (ReadPICTImage): Validate that PICT rectangles do\nnot have zero dimensions.  Specify expected file type when reading\nfrom a temporary file.  Trace PICT rectangle dimensions.  More\ndetection of blob EOF and more error handling.  Fixes oss-fuzz\nissue 6193 &quot;graphicsmagick/coder_PCT_fuzzer: Unknown signal in\nAllocateImageColormap&quot; and likely many oss-fuzz ASAN/UBSAN issues\nreported against &quot;PCT&quot; and &quot;PICT&quot; since this one problem appears\nto be causing a spew of reports.</li>\n<li>coders/png.c (ReadMNGImage): Detect and handle failure to\nallocate global PLTE.  Problem was reported via email from Petr\nGajdos on February 26, 2018.</li>\n</ul>\n</blockquote>\n<p>2018-02-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/blob.c (ReadBlobLSBDouble): Make sure imported double is\na normal value.\n(ReadBlobLSBDoubles): Make sure imported doubles are normal\nvalues.\n(ReadBlobLSBFloat): Make sure imported float is a normal value.\n(ReadBlobLSBFloats): Make sure imported floats are normal values.\n(ReadBlobMSBFloat): Make sure imported float is a normal value.\n(ReadBlobMSBFloats): Make sure imported floats are normal values.\n(ReadBlobMSBDouble): Make sure imported double is a normal value.\n(ReadBlobMSBDoubles): Make sure imported doubles are normal\nvalues.</li>\n<li>magick/import.c (ImportFloat32Quantum): Make sure imported float\nis a normal value.\n(ImportFloat64Quantum): Make sure imported double is a normal\nvalue.</li>\n<li>magick/image.h (RoundDoubleToQuantum): Restore previous behavior\n(from earlier today).\n(RoundFloatToQuantum): Restore previous behavior (from earlier\ntoday).</li>\n<li>coders/bmp.c (ReadBMPImage): Fix UBSAN runtime error: left shift\nof 205 by 24 places cannot be represented in type 'int'.</li>\n<li>coders/ept.c (ReadEPTImage): Fix dereference of NULL pointer\nwhich was detected by UBSAN in the test suite.</li>\n<li>magick/image.h (RoundDoubleToQuantum): Check double value for\nNaN and infinity in order to avoid undefined behavior.\n(RoundFloatToQuantum): Check float value for NaN and infinity in\norder to avoid undefined behavior.</li>\n<li>magick/common.h (MAGICK_ISNAN): Add a isnan() wrapper macro.\n(MAGICK_ISINF): Add a isinf() wrapper macro.</li>\n</ul>\n</blockquote>\n<p>2018-02-25  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Fix oss-fuzz issue 6273 - Heap-use-after-free in\nGetLocaleExceptionMessage. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (DCM_PostRescaleImage): Remove use of\nDCM_PostRescaleImage() since its implementation is wrong and\naccesses non-allocated heap memory.  Problem was reported by Petr\nGajdos via email on February 8, 2018.</li>\n<li>coders/jp2.c (ReadJP2Image): Use a ThrowJP2ReaderException macro\nto automatically clean up when throwing an exception.</li>\n<li>coders/bmp.c (ReadBMPImage): Report an error if RLE decode does\nnot produce the expected number of bytes.  Fixes oss-fuzz issue\n6015 &quot;graphicsmagick/coder_BMP_fuzzer: Out-of-memory in\ngraphicsmagick_coder_BMP_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-23  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Fixed a bug in which graphical\nelements defined within &lt;defs&gt; ... &lt;/defs&gt; were being rendered,\ncontrary to the SVG spec.</li>\n</ul>\n</blockquote>\n<p>2018-02-23  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawPolygonPrimitive): When filling or\nstroking a polygon using a pattern, the fill (or stroke)\nand group/object opacity values were not being applied to\nthe pattern (fixed).</li>\n</ul>\n</blockquote>\n<p>2018-02-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Fix SeekBlob() return value checks.\nAdd more EOF checks.  Require that a provided ba_offset be a\nforward seek in order to avoid the possibility of endless looping.</li>\n</ul>\n</blockquote>\n<p>2018-02-23  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Fix oss-fuzz issue 6301. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-22  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/alpha_composite.c (BlendQuantumOpacity): The\npixel compositing equation used when compositing an\nimage into the output was incorrect and has been fixed.</li>\n<li>magick/render.c (DrawPolygonPrimitive): When\ncompositing polygon edge pixels over a transparent\nblack background, the code would composite as if the\nbackground were opaque black, resulting in the edge\npixels being too dark (fixed).</li>\n</ul>\n</blockquote>\n<p>2018-02-21  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">magick/render.c (DrawImage): Per the SVG spec, opacity,\nfill-opacity, and stroke-opacity values are now clamped\nto [0,1].</p>\n<p>Also fixed two bugs introduced by changeset 91de8039f27d\n(dated 2018-02-12): (1) a group/object opacity value\nspecified using a percentage was not being converted to a\nvalue in [0,1]; (2) if fill-opacity or stroke-opacity was\n1, and the group/object opacity value was set to 1, the\nresulting fill-opacity or stroke-opacity value would be\nset to 0 instead of 1.</p>\n</li>\n</ul>\n</blockquote>\n<p>2018-02-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/viff.c (ReadVIFFImage): Fix excessive memory usage.\nFixes oss-fuzz 6006 &quot;graphicsmagick/coder_XV_fuzzer: Out-of-memory\nin graphicsmagick_coder_XV_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/txt.c (ReadInt): Avoid benign signed integer overflow due\nto accepting an arbitrary number of digits.  Fixes oss-fuzz 6002\n&quot;graphicsmagick/coder_TEXT_fuzzer: Integer-overflow in\nReadInt&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/viff.c (ReadVIFFImage): Verify that there is sufficient\ndata to back up colormap allocation request.  Fixes oss-fuzz 5986\n&quot;graphicsmagick/coder_VIFF_fuzzer: Out-of-memory in\ngraphicsmagick_coder_VIFF_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/memory.c: Define MAGICK_MEMORY_HARD_LIMIT=value to abort\nwhen memory request exceeds value.  Useful to find location of\nexcessive memory requests.</li>\n</ul>\n</blockquote>\n<p>2018-02-19  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement): Per the SVG spec, the\nSVG coder now initializes the MVG coder (which renders\nSVG graphical elements) with the the SVG defaults for\nfill color, fill-opacity, stroke color, stroke-opacity,\nand stroke-width.  This makes the SVG coder independent\nof the MVG coder intial state.</li>\n</ul>\n</blockquote>\n<p>2018-02-19  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement): Fixed initialization of\nx and y attributes per the SVG spec:  for graphical elements\n&quot;image&quot;, &quot;pattern&quot;, &quot;text&quot;, &quot;rect&quot;, and &quot;use&quot;, if the x or y\nattribute is not specified, the effect is as if a value of\n&quot;0&quot; were specified.</li>\n</ul>\n</blockquote>\n<p>2018-02-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sun.c (ReadSUNImage): Fix edge case which broke file-size\nvalidation logic.  Fixes oss-fuzz issue 5981\n&quot;graphicsmagick/coder_SUN_fuzzer: Out-of-memory in\ngraphicsmagick_coder_SUN_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/txt.c (ReadTXTImage): Validate that file size is\nsufficient for claimed image properties.  Fixes oss-fuzz issue\n5960 &quot;graphicsmagick/coder_TXT_fuzzer: Out-of-memory in\ngraphicsmagick_coder_TXT_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/tga.c (ReadTGAImage): Only allow 1 and 8 bit\ncolormapped/grey images. Fixes oss-fuzz issue 6314\n&quot;graphicsmagick/coder_ICB_fuzzer: Undefined-shift in\nReadTGAImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/bmp.c (ReadBMPImage): Detect and report when BMP height\nvalue is out of range (too negative). Fixes oss-fuzz issue 6394\n&quot;graphicsmagick/coder_BMP_fuzzer: Integer-overflow in\nReadBMPImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/rla.c (ReadRLAImage): Detect when RLE decoding is\nproducing too many samples and report as an error.  Fixes oss-fuzz\nissue 6312 &quot;graphicsmagick/coder_RLA_fuzzer: Timeout in\ngraphicsmagick_coder_RLA_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/fits.c (ReadFITSImage): Validate that file size is\nsufficient for claimed image properties.  Fixes oss-fuzz issue\n6429 &quot;graphicsmagick/coder_FITS_fuzzer: Timeout in\ngraphicsmagick_coder_FITS_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/image.c (CloneImage): Check image pixel limits in\nCloneImage() when it is used to change the image dimensions.  This\navoids depending on the using code to detect and report such\nissues.</li>\n<li>coders/xcf.c (ReadXCFImage): Check image pixel limits after each\nCloneImage() to assure that image is within specified resource\nlimits.  Fixes oss-fuzz issue 6399 &quot;graphicsmagick/enhance_fuzzer:\nTimeout in graphicsmagick_enhance_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-16  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TracePath): TracePath() was not\ncorrectly processing multiple sets of cubic or quadratic\nBezier coordinates when the previous path data command was\nnot a cubic or quadratic Bezier command.  This would result\nin the first control point being equal to the current path\npoint instead of being computed using the current path\npoint and the second control point of the previous Bezier\ncommand.</li>\n</ul>\n</blockquote>\n<p>2018-02-15  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TracePath): TracePath() was not\nconsuming commas (if present) at the end of a set of\npoints when multiple sets of points were specified for\nvarious path commands (e.g., line, Bezier). This\nresulted in the remaining sets of points being ignored\n(fixed).</li>\n</ul>\n</blockquote>\n<p>2018-02-15  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TraceArcPath): No points are generated\nby TraceArcPath() if the starting and ending arc points\nare the same.  For this case, the coordinate count was not\nbeing set to zero before returning (fixed).</li>\n</ul>\n</blockquote>\n<p>2018-02-15  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Clipping of polygons in\nDrawImage() would sometime result in a starting pixel\nlocation that was greater than the ending pixel location,\ncausing a subsequent call to GetImagePixelsEx() to fail\ndue a column count &lt;= 0.  Modified the clipping code to\neliminate this condition, and also to return early if\nthe polygon lies completely outside the image boundaries.\nAlso fixed variable declarations from a previous commit\nthat were causing problems for the C89 compiler.</li>\n</ul>\n</blockquote>\n<p>2018-02-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/topol.c (ReadTOPOLImage): Detect EOF immediately rather\nthan spinning.  Fixes oss-fuzz issue 6303\n&quot;graphicsmagick/coder_TOPOL_fuzzer: Timeout in\ngraphicsmagick_coder_TOPOL_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dcm.c (DCM_SetupRescaleMap): Avoid excessive left shift.\nFixes oss-fuzz issue 6256 &quot;graphicsmagick/coder_DCM_fuzzer:\nUndefined-shift in DCM_SetupRescaleMap&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (ExtractPostscript): Detect EOF on input while\ntransferring bytes to Postscript file.  Fixes oss-fuzz issue 6087\n&quot;graphicsmagick/coder_WPG_fuzzer: NULL&quot;.  Later identified to be\nCVE-2017-17682 as previously discovered in ImageMagick.  (Credit to\nOSS-Fuzz)</li>\n<li>coders/pdb.c (ReadPDBImage): Quit attempting to read image data\nimmediately at EOF. Fixes oss-fuzz issue 6252\n&quot;graphicsmagick/coder_PDB_fuzzer: Timeout in\ngraphicsmagick_coder_PDB_fuzzer&quot;.  (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/topol.c (ReadTOPOLImage): Avoid index out of bounds when\ninput filename does not use a file extension. Fixes oss-fuzz issue\n6237 &quot;graphicsmagick/coder_TOPOL_fuzzer: Index-out-of-bounds in\nReadTOPOLImage&quot;.  (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-12  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Object/group opacity,\nwhen set in DrawImage(), would overwrite the fill\nand stroke opacities. This has been fixed so that\nthe object opacity is now combined with the fill\nand stroke opacities per the SVG spec.</li>\n</ul>\n</blockquote>\n<p>2018-02-12  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c Fix oss-fuzz issue 6021. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c (ReadDCMImage): Avoid undefined left shift of\nshort.  Fix memory leaks in error reporting paths.  Fixes oss-fuzz\nissue 6217 &quot;graphicsmagick/coder_DCM_fuzzer: Undefined-shift in\nReadDCMImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dpx.c (ReadDPXImage): Avoid divide by zero exception in\nthe case where reference high equals reference low. Fixes oss-fuzz\nissue 6215 &quot;graphicsmagick/coder_DPX_fuzzer: Divide-by-zero in\nReadDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/topol.c (ReadTOPOLImage): Avoid index out of bounds when\ninput filename does not use a file extension.</li>\n<li>coders/cut.c (ReadCUTImage): Avoid index out of bounds when\ninput filename does not use a file extension. Fixes oss-fuzz issue\n6218 &quot;graphicsmagick/coder_CUT_fuzzer: Index-out-of-bounds in\nReadCUTImage&quot;.  (Credit to OSS-Fuzz)</li>\n<li>coders/pwp.c (ReadPWPImage): Force temporary file to be read as\na SFW file rather than autodetecting the format.  Fixes oss-fuzz\nissue 6220 &quot;graphicsmagick/coder_PWP_fuzzer: Indirect-leak in\nAllocateImage&quot;.  (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Assure that xref memory is not\nleaked if an exception is thrown.  Fixes oss-fuzz issue 5968\n&quot;graphicsmagick/coder_EPDF_fuzzer: Direct-leak in MagickRealloc&quot;.\n(Credit to OSS-Fuzz)</li>\n<li>coders/tim.c (ReadTIMImage): Verify that 4/8 bit PSX TIM\nprovides a CLUT and verify indexes.  Fixes oss-fuzz issue 5972\n&quot;graphicsmagick/coder_TIM_fuzzer: Null-dereference WRITE in\nReadTIMImage&quot;.  (Credit to OSS-Fuzz)</li>\n<li>coders/topol.c (ReadTOPOLImage): Add additional header\nvalidations.  Fixes oss-fuzz issue 5975\n&quot;graphicsmagick/coder_TOPOL_fuzzer: Floating-point-exception in\nReadTOPOLImage&quot;.  (Credit to OSS-Fuzz)</li>\n<li>coders/bmp.c (ReadBMPImage): Avoid possible division by zero\nwhen decoding CIE primary values. (Credit to OSS-Fuzz)</li>\n<li>magick/export.c (ExportViewPixelArea): Only compute\nunsigned_maxvalue if sample_bits &lt;= 32.</li>\n<li>magick/import.c (ImportViewPixelArea): Assure that\ndouble_maxvalue minus double_minvalue is not zero, or excessively\nclose to zero to avoid divide by zero exception or impossible\nscaling factor. (Credit to OSS-Fuzz)\n(ImportViewPixelArea): Only compute unsigned_maxvalue if\nsample_bits &lt;= 32.</li>\n</ul>\n</blockquote>\n<p>2018-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c (ReadDIBImage): Validate that image width is not\ntoo negative such that it's absolute value can not fit in 32-bit\nunsigned width. Resolves oss-fuzz issue 6179\n&quot;graphicsmagick/coder_ICO_fuzzer: Integer-overflow in\nReadDIBImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dcm.c (funcDCM_BitsStored): Validate DICOM datum size.\nUse a different means to determine the maximum value which does\nnot use excessive shifting.  Resolves oss-fuzz issue 6165\n&quot;graphicsmagick/coder_DCM_fuzzer: Undefined-shift in\nfuncDCM_BitsStored&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (ReadWordU32BE): Add casts to avoid default type\npromotion from unsigned char to 'int' leading to undefined\nbehavior for 24 bit shift. Fixes oss-fuzz issue 6058\n&quot;graphicsmagick/coder_DPX_fuzzer: Undefined-shift in\nReadWordU32BE&quot;. (Credit to OSS-Fuzz)\n(ReadDPXImage): Require that the file has at least one element.\nAdd bountiful casts for values which are left-shifted.  Fixes\noss-fuzz issue 5962 &quot;graphicsmagick/coder_DPX_fuzzer:\nUndefined-shift in ReadDPXImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/dcm.c (DCM_ReadOffsetTable): Add casts Add casts to avoid\ndefault type promotion from unsigned char to 'int' leading to\nundefined behavior for 16 bit shift. Fixes oss-fuzz issue 5980\n&quot;graphicsmagick/coder_DCM_fuzzer: Undefined-shift in\nDCM_ReadOffsetTable&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/module_aliases.h (ModuleAliases): Add missing mapping\nfrom &quot;ICODIB&quot; format to &quot;DIB&quot; module.</li>\n<li>magick/import.c (ImportUInt32Quantum): Add casts to avoid\ndefault type promotion from unsigned char to 'int' leading to\nundefined behavior for 24 bit shift.  Fixes oss-fuzz\n&quot;graphicsmagick/coder_P7_fuzzer: Undefined-shift in\nImportRGBQuantumType&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Fix oss-fuzz issue 5964\n&quot;graphicsmagick/coder_MAT_fuzzer: Heap-use-after-free in\nGetLocaleExceptionMessage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2018-02-07    Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (IsPoint): Fixed a bug in which\nIsPoint() would reject as a valid coordinate value\nstrings that did not begin with an integer: e.g.,\n&quot;0.25&quot; would be accepted, but &quot;.25&quot; would not.</li>\n</ul>\n</blockquote>\n<p>2018-02-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/cut.c (ReadCUTImage): Fix DestroyImageInfo() of NULL\npointer leading to assertion.  Fixes oss-fuzz issue 6067\n&quot;graphicsmagick/coder_CUT_fuzzer: Unknown signal in\nDestroyImageInfo&quot;.</li>\n<li>coders/tga.c (ReadTGAImage): Throw exception rather than\nassertion for unexpected comment size.  Fixes oss-fuzz issue 5961\n&quot;graphicsmagick/coder_ICB_fuzzer: ASSERT: (size_t)\n(tga_info.id_length+1) == commentsize&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-02-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Free 'xref' allocation before\nerror return.  Fixes oss-fuzz issue 5968\n&quot;graphicsmagick/coder_EPDF_fuzzer: Direct-leak in MagickRealloc&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-02-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdb.c (ReadPDBImage): Fix heap buffer overflow if blob is\nalready at EOF when comment is read.  Fixes oss-fuzz issue 5997\n&quot;graphicsmagick/coder_PDB_fuzzer: Heap-buffer-overflow in\nSetImageAttribute&quot;.</li>\n<li>coders/dpx.c (ReadDPXImage): Fix memory leak of user data if\nuser data is truncated.  Fix consumption of one uninitialized\nstack bytes.  Fixes oss-fuzz issue 5973:\ngraphicsmagick/enhance_fuzzer: Direct-leak in ReadDPXImage.</li>\n<li>coders/pnm.c (ReadPNMImage): Detect and avoid division by zero.\nFixes Issue 5959 in oss-fuzz: graphicsmagick/coder_P7_fuzzer:\nDivide-by-zero in ReadPNMImage</li>\n<li>magick/xwindow.c (MagickXClientMessage): Eliminate valgrind\ngripe about use of uninitialized stack data by clearing allocation\nto zero.\n(MagickXMakeImage): Eliminate valgrind gripe about use of\nuninitialized heap data by clearing allocation to zero.</li>\n<li>coders/pwp.c (ReadPWPImage): Remove bogus EOF test on an image\nwith a closed blob.  Fixes Issue 5957 in oss-fuzz:\ngraphicsmagick/coder_PWP_fuzzer: ASSERT: image-&gt;blob-&gt;type !=\nUndefinedStream.</li>\n<li>www/Changes.rst: Fix typo with spelling &quot;ChangeLog-2017.html&quot;.\nResolves SourceForge issue #544 &quot;dead link 2017 changelog page on\nGraphicsMagick web site&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-02-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/static.c (OpenModule): Assure that status is initialized.\nResolves Coverity 261207 &quot;Uninitialized scalar variable&quot;.</li>\n<li>wand/magick_wand.c (MagickHasColormap): New function to test if\nthe image has a colormap.\n(MagickIsGrayImage): New function to test if the image uses only\ngray pixels.\n(MagickIsMonochromeImage): New function to test if the image uses\nonly monochrome pixels.\n(MagickIsOpaqueImage): New function to test if the image uses only\nopaque pixels.\n(MagickIsPaletteImage): New function to test if the image is based\non a color palette.  Above functions are written by Troy Patteson\nand submitted via SourceForge patch #54 &quot;Wand API patches: has\ncolormap, is gray image, is monochrome image, is opaque image, is\npalette image&quot;.</li>\n<li>fuzzing: Added initial OSS-Fuzz integration by Alex Gaynor.\nFrom SourceForge patch #55 &quot;OSS-Fuzz integration&quot;</li>\n<li>coders/png.c (ReadMNGImage): Fix free using possibly unallocated\npointer value.</li>\n<li>magick/blob.c (SeekBlob): Remove implicit extension of blob\nallocation size based on seek offset.  Besides making an\nassumption about how the blob memory was allocated, this\nreallocation feature provides a memory DOS opportunity.  Resolves\nissue reported by Alex Gaynor via email entitled &quot;Security issue\nwith memory management in Magick++&quot; to the graphicsmagick-security\nlist on 31 Jan 2018.\n(SeekBlob):</li>\n<li>coders/jpeg.c (ReadIPTCProfile): Revert inadvertent wrong return\ncodes added by change on December 9, 2017.  Fixes SourceForge bug\n542 &quot;Improper call to JPEG library in state 201&quot; since 1.3.28.</li>\n</ul>\n</blockquote>\n<p>2018-02-01  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/annotate.c (RenderFreetype): Fixed the text\nopacity computation in RenderFreeType(). This bug caused\nthe text fill color to bleed into the character cell when\nthe SVG &quot;fill-opacity&quot; is less than 1.0.</li>\n</ul>\n</blockquote>\n<p>2018-02-01  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (CloneImageAttributes): Fixed a bug\nin which the source image attributes would always replace\nthe destination image attributes instead of being appended\nto them, and the destination image attributes would become\na memory leak.</li>\n</ul>\n</blockquote>\n<p>2018-01-31  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement): Fixed a bug in which the\nx,y location values for a &lt;text&gt; or &lt;tspan&gt; were overwritten\nby the x,y values for the next &lt;tspan&gt; before the previous\nvalues were used.  This caused the text associated with the\nprevious &lt;text&gt; or &lt;tspan&gt; to appear at the location\nspecified for the next &lt;tspan&gt;.</li>\n</ul>\n</blockquote>\n<p>2018-01-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/static.c: Use !defined(SupportMagickModules) to enable\nstatic module loader.  Fixes SourceForge bug #543 &quot;Multiple\ndefinition of &quot;OpenModule&quot; (etc) when cross-compiling shared&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-01-29  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement): A terminating '&gt;' in\na geometry string is interpreted to mean that the dimensions\nof an image should only be changed if its width or height\nexceeds the geometry specification.  For an unapparent and\nundocumented reason, a terminating '&gt;', if present, was\nbeing nulled out, making this feature unusable for SVG files\n(now fixed).</li>\n</ul>\n</blockquote>\n<p>2018-01-29  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (ReadSVGImage): If there is a geometry string\nin image_info-&gt;size (e.g., gm convert -size &quot;50x50%&quot; in.svg\nout.png), AllocateImage() sets image-&gt;columns and image-&gt;rows\nto the width and height values from the size string.  However,\nthis makes no sense if the size string was something like\n&quot;50x50%&quot; (we'll get columns = rows = 50).  So we set columns\nand rows to 0 after AllocateImage(), which is the same as if\nno size string was supplied by the client.  This also results\nin svg_info.bounds to be set to 0,0 (i.e., unknown), so that\nsvg_info.bounds will later be set using the image size\ninformation from either the svg &quot;canvas&quot; width/height or from\nthe viewbox.  Later, variable &quot;page&quot; is set from\nsvg_info-&gt;bounds. Then the geometry string in image_info-&gt;size\ngets applied to the (now known) &quot;page&quot; width and height when\nSvgStartElement() calls GetMagickGeometry(), and the intended\nresult is obtained.</li>\n</ul>\n</blockquote>\n<p>2018-01-24  Greg Wolfe  &lt;<a class=\"reference external\" href=\"mailto:gregory&#46;wolfe&#37;&#52;&#48;kodakalaris&#46;com\">gregory<span>&#46;</span>wolfe<span>&#64;</span>kodakalaris<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement): When the density (DPI)\nis specified using the ImageInfo::density member, the derived\nscale factor is incorrectly applied a second time to the\nwidth and height members of variable RectangleInfo page.\nFixes SourceForge ticket #451.</li>\n</ul>\n</blockquote>\n<p>2018-01-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/static.c: Use a lazy-loader for static modules with the\nsame external interface as the lazy-loader for dynamic modules.</li>\n</ul>\n</blockquote>\n<p>2018-01-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Prepare for 1.3.28 release.</li>\n</ul>\n</blockquote>\n<p>2018-01-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update with changes since previous release.</li>\n</ul>\n</blockquote>\n<p>2018-01-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs: Compiler warnings reduction.</li>\n<li>magick/pixel_cache.h: Mark GetPixels(), GetIndexes(), and\nGetOnePixel() as deprecated.  Compilers may produce a warning if\nthese functions are used.</li>\n<li>magick/pixel_cache.c (InterpolateColor): Return black pixel if\nInterpolateViewColor() reports failure.</li>\n<li>coders/png.c (ReadMNGImage): Fix memory leak of chunk and\nmng_info in error path.</li>\n<li>coders/gif.c (ReadGIFImage): Fix memory leak of global colormap.</li>\n</ul>\n</blockquote>\n<p>2018-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/symbols.h: Fix SourceForge issue #538 &quot;13 symbols in\ncommon with ImageMagick despite --enable-symbol-prefix&quot;.</li>\n<li>coders/bmp.c (ReadBMPImage): Fix non-terminal loop due to\nunexpected bit-field mask value.  Fixes SourceForge issue #541\n&quot;Infinite Loop in ReadBMPImage (coders/bmp.c)&quot;.</li>\n<li>coders/jpeg.c (JPEGMessageHandler): Revert code added on\n2017-07-08 to promote certain warnings from libjpeg to errors.\nAdd code to rationalize claimed image dimensions based on file\nsize.  Resolves SourceForge issue #539 &quot;Images with libjpeg\nwarnings result in error&quot;.</li>\n</ul>\n</blockquote>\n<p>2018-01-11  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li><dl class=\"first docutils\">\n<dt>coders/wpg.c Recursive ReadImage could return multiple scenes</dt>\n<dd>fixed.</dd>\n</dl>\n</li>\n</ul>\n</blockquote>\n<p>2018-01-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadOnePNGImage): Quit 'passes' loop if we\nencountered an error</li>\n<li>magick/pixel_cache.c (SetNexus): Fix heap overwrite in\nAcquireCacheNexus() due to SetNexus() not using an allocated\nstaging area for the pixels like it should.  This problem impacts\nall 1.3.X releases.  Resolves SourceForge issues 532\n&quot;heap-buffer-overflow bug in ReadWPGImage&quot; and #531\n&quot;heap-buffer-overflow in AcquireCacheNexus&quot;.</li>\n<li>magick/pixel_cache.c (InterpolateViewColor): Now returns\nMagickPassFail rather than void.  Code using this function is\nupdated to check the return status.</li>\n</ul>\n</blockquote>\n<p>2018-01-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/describe.c (DescribeImage): Discriminate between\nAcquireImagePixels() returning NULL or finding a transparent\npixel.  This avoids use of a null pointer in the case where\nAcquireImagePixels() returns NULL.</li>\n</ul>\n</blockquote>\n<p>2017-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/static.c: Change static module initialization to be based\non an initialized list rather than a squence of function calls in\norder to simplify maintenance and possibly address future\nrequirements.</li>\n</ul>\n</blockquote>\n<p>2017-12-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Copyright.txt: Bump copyright years and rotate ChangeLog.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ChangeLog-2019.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog-2019.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2019-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/gradient.c (ReadGRADIENTImage): QueryColorDatabase() only\nthrows a warning so allow the warning to propagate to the user\nrather than failing to report a useful message at all.</li>\n</ul>\n</blockquote>\n<p>2019-12-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gradient.c (GradientImage): OpenMP portability requires\nthat loop variable be signed.</li>\n</ul>\n</blockquote>\n<p>2019-12-30  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gradient.c: Visual studio does not compile file without\nthis fix.</li>\n</ul>\n</blockquote>\n<p>2019-12-30  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagickconfigureconfigure.cpp Add option for speed optimisation\nto achieve better performance.</li>\n</ul>\n</blockquote>\n<p>2019-12-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/version.h.in: Bump copyright years.</li>\n<li>magick/image.c (DisplayImages): Fix return status.  Was\nreturning inverted return status.</li>\n<li>coders/gradient.c (ReadGRADIENTImage): Support the\n&quot;gradient:direction&quot; definition to produce produce additional\ngradient vector directions corresponding to South, North, West,\nEast, NorthWest, NorthEast, SouthWest, and SouthEast.  This\nsupport is similar to a useful feature added in ImageMagick\n6.9.2.5 although there is no claim that the results are identical,\neven if the resulting images appear to be visually\nindistinguishable.</li>\n<li>magick/gradient.c (GradientImage): Add support for using the\nimage 'gravity' attribute to produce additional gradient vector\ndirections corresponding to SouthGravity (the previously-existing\ndefault), NorthGravity, WestGravity, EastGravity,\nNorthWestGravity, NorthEastGravity, SouthWestGravity, and\nSouthEastGravity.  Gradient images are updated to be PseudoClass\n(color-mapped), if possible.</li>\n</ul>\n</blockquote>\n<p>2019-12-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gradient.c (GradientImage): Output PseudoClass images if\nwe can.</li>\n<li>coders/pcx.c (WritePCXImage): Fix heap overflow in PCX writer\nwhen bytes per line value overflows its 16-bit storage unit.\nFixes SourceForge bug #619 &quot;heap-buffer-overflow in WritePCXImage&quot;\nreported by Suhwan Song.</li>\n<li>magick/gradient.c (GradientImage): Gradient levels were still\nnot spot-on.  Now they are.  Unfortunately, this necessitated\nre-generating reference test images based on gradient since the\ngradient output has changed a little bit more than the test error\nmargins allow.</li>\n</ul>\n</blockquote>\n<p>2019-12-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Test gradient image resource limits\nusing the proper API.</li>\n<li>magick/resource.c (ResourceInfinity): Fix definition of\nResourceInfinity.  Due to parenthesis in the wrong place, the\ndefined value was -1 rather than the maximum range value.  The\neffect of this is that GetMagickResource() would return -1 rather\nthan the maximum range value for the return type as documented.\nRegression was added on Saturday, March 09, 2019 in the 1.3.32\nrelease via changeset 15927:a5318823758c.</li>\n<li>tests/rwfile.c (main): Allow Ghostscript supported formats to be\na bit lossy.</li>\n<li>tests/rwblob.c (main): Allow Ghostscript supported formats to be\na bit lossy.</li>\n<li>magick/gradient.c (GradientImage): Compute blending alpha with\ndouble precision for more precision.</li>\n</ul>\n</blockquote>\n<p>2019-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updates in preparation for 1.3.34 release.</li>\n</ul>\n</blockquote>\n<p>2019-12-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update with changes since the last GM release.</li>\n<li>coders/png.c (png_read_raw_profile): Use size_t type to store\nprofile length and 'nibbles'.  Use safer way to test for profile\nbuffer overflow.\n(ReadOnePNGImage): Use size_t type to store 'ping_rowbytes',\n'length', and 'row_offset'.  Check png_pixels allocation for\narithemetic overflow when computing the required allocation size.</li>\n<li>coders/tiff.c (WriteNewsProfile): Use size_t type to store\nprofile length.</li>\n<li>coders/pict.c (WritePICTImage): Avoid 'alloc-size-larger-than'\nwarning from GCC when allocating row_bytes.</li>\n</ul>\n</blockquote>\n<p>2019-12-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tiff/libtiff/tiffconf.h: Add standard/common libtiff 'SUPPORT'\noptions which are used in full-fledged Autoconf/Cmake libtiff\nbuilds but were missing from the Visual C template file.  In\nparticular, WebP is now supported and JBIG is somewhat supported.</li>\n<li>VisualMagick/jbig/libjbig/LIBRARY.txt (EXCLUDE): Remove\ntstcodec85.c from JBIG library build.</li>\n<li>VisualMagick/configure/configure.cpp: Add JBIG library to\ninclude path when building libraries.  Add WebP as a dependency\nwhen building libtiff.</li>\n</ul>\n</blockquote>\n<p>2019-12-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.h (&quot;C&quot;): Assume that float versions of functions\nbecame available in Visual Studio 2008.</li>\n</ul>\n</blockquote>\n<p>2019-12-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (InitializeLogInfo): Using the compiled-in\ndefaults, always log to stderr by default, even under Microsoft\nWindows.  The logging output may then be diverted to\n'win32eventlog' as soon as a log.mgk file is loaded if that is\ndesired.  This should not be much of a problem because loading a\nlog.mgk file is the first thing that the library attempts to do.\nThis change is made due to users and developers being baffled at\nnot seeing any log output due to the log output going to the (very\nunfriendly) Windows application log.</li>\n<li>webp: libwebp is updated to the 1.0.3 release.</li>\n</ul>\n</blockquote>\n<p>2019-12-15  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c Fix user only installation of Ghostscript.</li>\n</ul>\n</blockquote>\n<p>2019-12-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>rungm.sh.in (DIRSEP): DIRSEP should always use Unix conventions for\nAutotools-based builds.</li>\n<li>magick/module.h (&quot;C&quot;): Eliminiate redundant and conflicting\nListModuleInfo() prototype.</li>\n<li>coders/miff.c (ReadMIFFImage): Eliminate warnings in trace\nstatements.</li>\n<li>coders/dib.c (DecodeImage): Eliminate warnings in trace\nstatements.</li>\n<li>coders/bmp.c (DecodeImage): Eliminate warnings in trace\nstatements.</li>\n<li>magick/studio.h (SupportMagickModules): Fix the preprocessor\nlogic controlling SupportMagickModules, which became broken for\nGCC MinGW-based builds starting in the 1.3.29 release when a\n&quot;static&quot; module loader was implemented.  Due to an error in the\npreprocessor logic, only the &quot;modules&quot; based build was working for\nMinGW.  Much thanks to Giovanni Remigi for making us aware of this\nissue.</li>\n</ul>\n</blockquote>\n<p>2019-12-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (WritePICTImage): Throw a writer exception if the\nPICT width limit is exceeded. Fixes SourceForge issue 617\n&quot;heap-buffer-overflow in function EncodeImage of coders/pict.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-12-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>jbig: jbigkit is updated to 2.1 release.</li>\n<li>libxml: libxml2 is updated to 2.9.10 release.</li>\n<li>bzlib: bzip is updated to 1.0.8 release.</li>\n<li>zlib: zlib is updated to 1.2.11 release.</li>\n<li>png: libpng is updated to 1.6.37 release.</li>\n</ul>\n</blockquote>\n<p>2019-12-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lcms: lcms2 is updated to 2.9 release.</li>\n<li>tiff: libtiff is updated to 4.1.0 release.</li>\n</ul>\n</blockquote>\n<p>2019-11-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawPatternPath): Don't leak memory if\nfill_pattern or stroke_pattern of cloned draw_info are not null.\nFixes oss-fuzz issue 18948 &quot;graphicsmagick:coder_MVG_fuzzer:\nIndirect-leak in CloneImage&quot;.\n(PrimitiveInfoRealloc): Clear freshly-allocated PrimitiveInfo\nmemory.</li>\n</ul>\n</blockquote>\n<p>2019-11-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Fix oss-fuzz issue\n17986 &quot;graphicsmagick:coder_JPG_fuzzer: Heap-buffer-overflow in\nGenerateEXIFAttribute&quot;.  This problem likely only happens in\n32-bit builds.</li>\n</ul>\n</blockquote>\n<p>2019-11-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Only magnify the image if the\nrequested magnification methods are supported.</li>\n</ul>\n</blockquote>\n<p>2019-11-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/compress.c (HuffmanDecodeImage): Fix signed overflow on\nrange check which leads to heap overflow in 32-bit\napplications. Requires a relatively large file input compared with\ntypical fuzzer files (greater than a megabyte) to trigger.\nProblem reported to the graphicsmagick-security mail address by\nJustin Tripp on 2019-11-13.\n(Ascii85Tuple): Fix thread safety issue by requiring caller to\npass in tuple buffer as an argument and having callers allocate\ntuple buffer on the stack.</li>\n</ul>\n</blockquote>\n<p>2019-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/bit_stream.c: Add restrict declarations to slightly\nimprove performance and decrease code size.</li>\n<li>TclMagick/pkgIndex.tcl: Incorporate recommendations from third\nproblem noted in SourceForge issue #420 &quot;TclMagick issues and\npatch&quot;.  This is supposed to help support using an uninstalled\nGraphicsMagick and allow the installation path to contain a space.</li>\n<li>wand/magick_wand.c (MagickClearException): Destroy any existing\nexception info before re-initializing the exception info or else\nthere will be a memory leak.</li>\n<li>TclMagick/generic/libttkcommon.c (myMagickError): Clear\nexception from the Wand after it has been reported.  Addresses the\nfourth problem noted by SourceForge issue #420 &quot;TclMagick issues\nand patch&quot;.  However, MagickClearException() already clears an\nexception in the Wand, so a new function is not needed.</li>\n<li>TclMagick/unix/m4/tcl.m4: Change hard-coded INSTALL path to\npoint to config/install-sh.  Re-generated/updated Autotools stuff\nby executing the genconf.sh script.  Addresses the first problem\nnoted by SourceForge issue #420 &quot;TclMagick issues and patch&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-11-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (SetNexus): Eliminate warning about\npossibly uninitialized variable from primordial GCC 3.4.3.</li>\n<li>magick/render.c (ConvertPrimitiveToPath): Eliminate warning that\nIsClosedSubPath might be used uninitialized.</li>\n<li>magick/common.h (&quot;MAGICK_FALLTHROUGH&quot;): Added a\nMAGICK_FALLTHROUGH macro to support the GCC/Clang fallthrough\nattribute when the time comes again that it would be useful.</li>\n</ul>\n</blockquote>\n<p>2019-10-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcx.c (ReadPCXImage): Verify that pixel region is not\nnegative. Assure that opacity channel is initialized to\nopaqueOpacity.  Update DirectClass representation while\nPseudoClass representation is updated.  Improve read performance\nwith uncompressed PCX.</li>\n</ul>\n</blockquote>\n<p>2019-10-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xpm.c (ReadXPMImage): Image properties are expected to\nappear within the first 512 bytes of the XPM file header.  fixes\noss-fuzz 18267 &quot;graphicsmagick:coder_PICON_fuzzer: Timeout in\ncoder_PICON_fuzzer&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-10-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Fix tcmalloc configuration report.</li>\n</ul>\n</blockquote>\n<p>2019-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (ReadWPGImage): Implement subimage/subrange\nsupport.</li>\n<li>coders/mat.c (ReadMATImage, ReadMATImageV4): Implement\nsubimage/subrange support.  Should resolve oss-fuzz 14999\n&quot;graphicsmagick/coder_MAT_fuzzer: Out-of-memory in\ngraphicsmagick_coder_MAT_fuzzer&quot;.</li>\n<li>coders/tiff.c (TIFFMapBlob): Fix compile problem if\nLOG_TIFF_BLOB_IO is defined.</li>\n<li>coders/wpg.c (ExtractPostscript): Improve performance.  Avoid\ntemporary files if possible.  Avoid additional memory allocations\nif possible.  Should address oss-fuzz issue 18173\n&quot;graphicsmagick:enhance_fuzzer: Timeout in enhance_fuzzer&quot; and\noss-fuzz issue 17714 &quot;graphicsmagick:coder_WPG_fuzzer: Timeout in\ncoder_WPG_fuzzer&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-10-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pnm.c (PNMInteger): Place a generous arbitrary limit on\nthe amount of PNM comment text to avoid denial of service\nopportunity.  Fixes oss-fuzz 18162 &quot;Timeout · coder_PNM_fuzzer&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dps.c (ReadDPSImage): Fix memory leak when OpenBlob()\nreports failure.  Same as ImageMagick CVE CVE-2019-16709.</li>\n</ul>\n</blockquote>\n<p>2019-09-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Skip\nunsupported/invalid format 0.  Fixes oss-fuzz issue 17597\n&quot;graphicsmagick:coder_SFW_fuzzer: Heap-buffer-overflow in\nGenerateEXIFAttribute&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-09-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/oss-fuzz-build.sh: Change by Alex Gaynor so that the\ncorrect oss-fuzz fuzzing engine should be used.</li>\n</ul>\n</blockquote>\n<p>2019-09-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/static.c (OpenModule): Static module loader should use\nupper-cased magick string when searching for a module alias.\nFixes SourceForge issue #613 &quot;static module loader is still\ncase-sensitive&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-09-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Report status of zstd (FaceBook Zstandard)\ncompression in configuration summary.</li>\n</ul>\n</blockquote>\n<p>2019-09-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (TraceArcPath): Substitute a lineto command when\ntracing arc is impossible.  Fixes oss-fuzz 10765\n&quot;graphicsmagick/coder_MVG_fuzzer: Divide-by-zero in TraceArcPath&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-09-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (png_read_raw_profile): Fix validation of raw\nprofile length.  Fixes oss-fuzz 16906\n&quot;graphicsmagick:coder_ICO_fuzzer: Out-of-memory in\ngraphicsmagick_coder_ICO_fuzzer&quot;.</li>\n<li>coders/wpg.c (ReallocColormap): Avoid dereferencing a null\npointer if image-&gt;colormap is null.  Fixes oss-fuzz 17004\n&quot;graphicsmagick:coder_WPG_fuzzer: Null-dereference READ in\nReallocColormap&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-09-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/memory.c (MagickRealloc): Add a note that the behavior of\nthis function is as described for BSD reallocf(3), which is now\nappearing in Linux's GNU libc and elsewhere.</li>\n</ul>\n</blockquote>\n<p>2019-09-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/OpenMP.rst: Document the significant OpenMP speed-up which\nmay be obtained by using an alternate memory allocation library.\nCurrently 'tcmalloc', 'mtmalloc', and 'umem' are supported as\noptions.</li>\n<li>www/INSTALL-unix.rst: Document new --with-tcmalloc option to\nenable using Google gperftools tcmalloc library.</li>\n<li>configure.ac: Add support for using Google gperftools tcmalloc\nlibrary via the --with-tcmalloc option.</li>\n<li>scripts/rst2htmldeco.py: Port to Python 3 syntax and require at\nleast Python 2.6.</li>\n<li>scripts/relpath.py: Port to Python 3 syntax and require\nat least Python 2.6.</li>\n<li>scripts/html_fragments.py: Port to Python 3 syntax and require\nat least Python 2.6.</li>\n<li>scripts/format_c_api_doc.py: Port to Python 3 syntax and require\nat least Python 2.6.</li>\n</ul>\n</blockquote>\n<p>2019-08-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>doc/GraphicsMagick.imdoc: Document gm utility exit status codes.</li>\n</ul>\n</blockquote>\n<p>2019-08-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (PRIMITIVE_INFO_POINTS_MAX): SIZE_MAX apparently\nrounds up by one when cast to a double on 64-bit systems.  Due to\nthis, and in order to set more rational implementation limits, add\na PRIMITIVE_INFO_POINTS_MAX definition which computes and\nconstrains the maximum number of PrimitiveInfo entries allowed.</li>\n</ul>\n</blockquote>\n<p>2019-08-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Check that we are\nnot being directed to read an IFD that we are already parsing and\nquit in order to avoid a loop.  Addresses oss-fuzz 15753\n&quot;graphicsmagick/coder_JPEG_fuzzer: Timeout in\ngraphicsmagick_coder_JPEG_fuzzer&quot; and 16068\n&quot;graphicsmagick/coder_SFW_fuzzer: Timeout in\ngraphicsmagick_coder_SFW_fuzzer&quot;.</li>\n<li>tests/{constitute.c, drawtest.c, rwblob.c, rwfile.c}: Eliminate\nirritating GCC 9 &quot;__builtin_strncpy' output may be truncated&quot;\nwarnings due to copying MaxTextExtent-1 characters.  Instead\nrequest copying all of the characters and also assure that string\nis still null terminated.</li>\n<li>doc/environment.imdoc: Update documentation pertaining to HOME\nand MAGICK_DEBUG environment variables.</li>\n</ul>\n</blockquote>\n<p>2019-08-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (DestroyLogInfo): Only output text to terminate an\nXML format log file if XML format is active.</li>\n</ul>\n</blockquote>\n<p>2019-08-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (ExtractTokensBetweenPushPop): Previous fix for\nnon-terminal loop was broken by a last-minute untested edit.\nFinally addresses oss-fuzz 15318 &quot;graphicsmagick/coder_MVG_fuzzer:\nTimeout in graphicsmagick_coder_MVG_fuzzer&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-08-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>fuzzing/utils.cc (MemoryResource): Lessen the memory limit used\nfor oss-fuzz testing in order to provide more headroom and margin\nfor error.</li>\n<li>magick/render.c (TraceBezier): Detect arithmetic overflow and\nreturn errors via normal error path rather than exiting.  Fixes\noss-fuzz 16450 &quot;graphicsmagick:coder_MVG_fuzzer: Unexpected-exit\nin DefaultFatalErrorHandler&quot;.\n(PrimitiveInfoRealloc): Implement more paranoid code related to\nprimitive allocation.</li>\n</ul>\n</blockquote>\n<p>2019-08-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawStrokePolygon): Handle case where\nTraceStrokePolygon() returns NULL.  Addresses oss-fuzz 15516\n&quot;graphicsmagick/coder_MVG_fuzzer: ASSERT: primitive_info !=\n(PrimitiveInfo *) NULL&quot;.\n(DrawDashPolygon): Handle case where DrawStrokePolygon() returns\nMagickFail. Also needed to address oss-fuzz 15516, since otherwise\ntest-cases run for a very long time.\n(ExtractTokensBetweenPushPop): Fix non-terminal parsing loop.\nAddresses oss-fuzz 15318 &quot;graphicsmagick/coder_MVG_fuzzer: Timeout\nin graphicsmagick_coder_MVG_fuzzer&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-08-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/memory.h (MagickMallocAlignedArray): Add function\nattributes for added value and to quench GCC 9 warning with\nspecial build options enabled.</li>\n<li>magick/deprecate.h (AcquireMemory): Add more function attributes\nto quench GCC 9 warning with special build options enabled.</li>\n<li>magick/attribute.c (GenerateEXIFAttribute): Fix compilation\nwarning in 32-bit build.</li>\n<li>coders/dpx.c (AttributeToString): Eliminate annoying warnings\nfrom GCC 9, although the code was correct.</li>\n<li>coders/msl.c (MSLStartElement): Fix defective opacity percentage\ncode revealed by GCC 9 warning.</li>\n</ul>\n</blockquote>\n<p>2019-08-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Skip coalescing layers if there is\nonly one layer.  Fixes oss-fuzz 16274\n&quot;graphicsmagick/coder_MNG_fuzzer: Unexpected-exit in\nDefaultFatalErrorHandler&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-08-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadPNGImage): Post-processing to convert the\nimage type in the PNG reader based on a specified magick prefix\nstring is now disabled.  This can (and should) be done after the\nimage has been returned.  Fixes oss-fuzz 16386\n&quot;graphicsmagick:coder_PNG8_fuzzer: Timeout in\ngraphicsmagick_coder_PNG8_fuzzer&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-07-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updates in preparation for 1.3.33 release.</li>\n</ul>\n</blockquote>\n<p>2019-07-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Updated NEWS to reflect updates since last release.</li>\n</ul>\n</blockquote>\n<p>2019-07-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (WriteOnePNGImage): Fix saving to palette when\nimage has an alpha channel but no color is marked as transparent.\nPatch submitted by Przemysław Sobala via SourceForge patch #61\n&quot;WriteOnePNGImage(): Fix saving to palette when image has an alpha\nchannel but no color is marked as transparent&quot;.</li>\n<li>doc/options.imdoc (characters): Fix -format documentation to\nreflect that '%r' returns the image type.  Patch submitted by\nPrzemysław Sobala via SourceForge patch #60 &quot;Fix documentation\ntypo&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-07-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/tempfile.c (AcquireTemporaryFileDescriptor): Fix\ncompilation under Cygwin.  Patch by Marco Atzeri and submitted via\nemail to the graphicsmagick-help mailing list on Fri, 5 Jul 2019.</li>\n</ul>\n</blockquote>\n<p>2019-06-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/attribute.c (GenerateEXIFAttribute): Added range checks\nand tracing.  Fixes oss-fuzz 14998\n&quot;graphicsmagick/coder_JPEG_fuzzer: Heap-buffer-overflow in\nRead32s&quot;.  This is a tiny read overflow.</li>\n<li>coders/miff.c (ReadMIFFImage): Similar fix as to mpc.c</li>\n<li>coders/mpc.c (ReadMPCImage): Fix faulty signed overflow logic\nfor profiles[i].length which still allowed overflow.  Fixes\noss-fuzz issue 15190 &quot;graphicsmagick/coder_MPC_fuzzer:\nOut-of-memory in graphicsmagick_coder_MPC_fuzzer&quot;.</li>\n<li>doc/options.imdoc: Add notes about security hazards due to\ncommands which support a <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;filename\">'<span>&#64;</span>filename</a>' syntax.</li>\n<li>www/security.rst: Add notes about security hazards due to\ncommands which support a <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;filename\">'<span>&#64;</span>filename</a>' syntax.</li>\n</ul>\n</blockquote>\n<p>2019-06-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Assure that 'token' is initialized.\nFixes oss-fuzz issue 14897 &quot;graphicsmagick/coder_MVG_fuzzer:\nUse-of-uninitialized-value in DrawImage&quot;.</li>\n<li>magick/animate.c (MagickXAnimateImages): Fix memory leak of\nscene_info.pixels.</li>\n<li>magick/display.c (MagickXDisplayImage): Fix heap overwrite of\nwindows-&gt;image.name and windows-&gt;image.icon_name buffers.  It\nappears that the code assumed that CloneString() would always\nallocated a string at least MaxTextExtent in size. I assume that\nthis issue has existed for a very long time since CloneString()\nwas re-written many years ago.</li>\n<li>coders/caption.c (ReadCAPTIONImage): The CAPTION reader did not\nappear to work at all any more.  Now it works again, but still not\nvery well.</li>\n<li>magick/command.c: Re-implement '&#64;' file inclusion support for\n-comment, -draw, -format, and -label which was removed for the\n1.3.32 release.  Note that arguments from untrusted sources will\nstill need to be sanitized to detect attempts to subvert this\nfeature to access file data, but this feature has always been\nsupported by GraphicsMagick and it originated early in the\ndevelopment of ImageMagick.</li>\n</ul>\n</blockquote>\n<p>2019-06-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (MagickStrlCat, MagickStrlCpy): Add debug\nchecks enabled by MAGICK_STRL_CHECK.</li>\n<li>magick/montage.c (MontageImages): Fix wrong length argument to\nstrlcat() when building montage directory, which could allow heap\noverwrite.</li>\n<li>coders/png.c (RegisterPNGImage): Pass correct size value to\nstrlcat().  Under Apple's OS X (and possibly other targets)\nstrlcat() writes bytes beyond what it needs to (but within the\nrange it is allowed to) causing a crash due to the wrong limit\nvalue.  Fixes SourceForge issue #609 <cite>gm identify foo.png</cite> crashes\non macOS (v 1.3.32).</li>\n<li>www/Changes.rst: Update ChangeLog links due to new year, and\n1.3.32 release.</li>\n</ul>\n</blockquote>\n<p>2019-06-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (WriteBMPImage): Detect arithmetic overflow of\nimage_size. Add more tracing. Reduce compilation warnings.\n(EncodeImage): Reduce compilation warnings.\n(WriteBMPImage): Assure that chromaticity uses double-precision\nfor multiply before casting to unsigned integer.</li>\n<li>coders/wpg.c (ReallocColormap): Reduce compilation warnings.</li>\n<li>coders/braille.c (WriteBRAILLEImage): Reduce compilation\nwarnings.</li>\n<li>coders/dib.c (WriteDIBImage): Detect arithmetic overflow of\nimage_size. Reduce compilation warnings.\n(EncodeImage): Reduce compilation warnings.</li>\n<li>coders/locale.c (WriteLOCALEImage): Reduce compilation warnings.</li>\n</ul>\n</blockquote>\n<p>2019-06-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (dist-zstd): Use the maximum possible compression\nlevel (22) when creating a Zstd-compressed tarball to get close to\nlzip/xz compression levels.</li>\n<li>coders/tiff.c (ReadTIFFImage): Fix typo in initialization of\n'tile' pointer variable.</li>\n<li>version.sh: Updates in preparation for 1.3.32 release.</li>\n</ul>\n</blockquote>\n<p>2019-06-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (release): Add a release target to make it easier to\nproduce and sign the release files.  Add a zstd-compressed output\ntarball just because we can.</li>\n</ul>\n</blockquote>\n<p>2019-06-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Fix typo when initializing\nnumber_coordinates.  Somehow GCC and clang let this typo slip by.</li>\n</ul>\n</blockquote>\n<p>2019-06-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c (ReadDIBImage): Preserve PseudoClass opaque\nrepresentation if ICO mask is opaque, otherwise return a\nDirectClass image.</li>\n</ul>\n</blockquote>\n<p>2019-06-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Detect an error in TracePath() and\nquit rather than forging on.</li>\n</ul>\n</blockquote>\n<p>2019-06-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Terminate drawing if\nDrawCompositeMask() reports failure.  Fixes oss-fuzz 12373\n&quot;graphicsmagick/coder_MVG_fuzzer: Timeout in\ngraphicsmagick_coder_MVG_fuzzer&quot;.\n(TracePath): Terminate path parsing upon first parsing error.</li>\n</ul>\n</blockquote>\n<p>2019-06-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c (ReadTXTImage): Use real a new-line character as\nline delimiter rather than 'n' string.</li>\n<li>magick/annotate.c (AnnotateImage): No longer implicitly call\nTranslateText() since this is not suitable for most use-cases and\ncauses additional performance impact.  The API user can perform\nsuch translations in advance on the text string using\nTranslateText() if need be.  No longer call StringToList() to\nsplit strings into an array of strings since this can lead to\nunexpected results, and a custom-splitter is more efficient.</li>\n</ul>\n</blockquote>\n<p>2019-06-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Only support <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;filename\">'<span>&#64;</span>filename</a>' syntax to\nread drawing primitive from a file if we are not already drawing.</li>\n<li>magick/utility.c (TranslateTextEx): Remove support for reading\nfrom a file using <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;filename\">'<span>&#64;</span>filename</a>' syntax due to security concerns.\nProblem was reported to us by &quot;Battle Furry&quot; via the\nGraphicsMagick security mail alias on June 6, 2019.</li>\n</ul>\n</blockquote>\n<p>2019-06-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/utility.c (SetClientFilename): Reduce initialized data\nsome more.</li>\n</ul>\n</blockquote>\n<p>2019-06-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c: Search for n019003l.pfb (the &quot;Helvetica&quot;-like\nfont) rather than fonts.dir since fonts.dir is not present in all\nURW font collections.</li>\n<li>NEWS.txt: Update news.</li>\n</ul>\n</blockquote>\n<p>2019-06-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/logo.c: Tidy logo image definitions, and logo image\noutput.</li>\n</ul>\n</blockquote>\n<p>2019-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c: Make more data const.</li>\n</ul>\n</blockquote>\n<p>2019-05-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/animate.c: Reduce initialized static allocations.</li>\n<li>magick/display.c: Reduce initialized static allocations.</li>\n<li>magick/widget.c (MagickSplitNDLTextToList): Add static\nimplementation function.</li>\n</ul>\n</blockquote>\n<p>2019-05-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/webp.c (RegisterWEBPImage): Use sprintf to format version\nsince snprintf is not available in old Visual Studio.</li>\n</ul>\n</blockquote>\n<p>2019-05-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dcm.c: Make more data const.</li>\n<li>www/INSTALL-unix.rst: Add documentation for how to install URW\nfonts from various package management systems.</li>\n</ul>\n</blockquote>\n<p>2019-05-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/authors.rst: Add authorship attribution to Samuel Thibault\nfor contributing support for the Braille image format.</li>\n<li>coders/braille.c: Add support for Braille image format by Samuel\nThibault.  Patch submitted via SourceForge patch #59 &quot;Add braille\nimage format support.</li>\n</ul>\n</blockquote>\n<p>2019-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/tempfile.c: Make more data const.</li>\n<li>magick/signature.c: Make more data const.</li>\n<li>magick/quantize.c: Make more data const.</li>\n<li>magick/attribute.c: Make more data const.</li>\n<li>coders/png.c: Make more data const.</li>\n<li>coders/mpeg.c: Make more data const.</li>\n<li>coders/wmf.c: Make more data const.</li>\n<li>coders/tile.c: Make more data const.</li>\n</ul>\n</blockquote>\n<p>2019-05-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/enum_strings.c: Make more data const.</li>\n</ul>\n</blockquote>\n<p>2019-05-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c: Make more data const.</li>\n<li>magick/type.c (GetTypeInfoByFamily): Make more data const.</li>\n<li>magick/unix_port.c (MagickGetMMUPageSize): Decrease initialized\ndata.</li>\n<li>magick/utility.c (GetPageGeometry): Make more data const.</li>\n<li>coders/pdf.c (WritePDFImage): Allocate working buffer on stack\nand pass as argument to EscapeParenthesis() to eliminate a thread\nsafety problem and also reduce BSS size.</li>\n<li>coders/webp.c (RegisterWEBPImage): Fix compiler warning.</li>\n<li>coders/jbig.c (RegisterJBIGImage): Make more data const.</li>\n<li>coders/pict.c (DecodeImage): Allocate output buffer used by\nExpandBuffer() on the stack rather than as static data private to\nExpandBuffer().  Eliminates a thread safety problem and also\nreduces BSS size.</li>\n<li>coders/webp.c (RegisterWEBPImage): Reduce BSS size.</li>\n</ul>\n</blockquote>\n<p>2019-05-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jp2.c: Make more data const.</li>\n<li>coders/wmf.c: Make more data const.</li>\n<li>coders/ps.c (WritePSImage): Make more data const.</li>\n<li>coders/ps2.c (WritePS2Image): Make more data const.</li>\n</ul>\n</blockquote>\n<p>2019-05-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/static.c: Revert to previous 'name' storage. Callback\nfunctions in structure block being properly const.</li>\n<li>coders/xpm.c: Make more data const.</li>\n<li>coders/pnm.c: Make more data const.</li>\n<li>coders/palm.c: Make more data const.</li>\n<li>coders/meta.c: Make more data const.</li>\n<li>coders/dcraw.c: Make more data const.</li>\n<li>magick/command.c: Fix compilation problem when HasX11 is not\ndefined.</li>\n</ul>\n</blockquote>\n<p>2019-05-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c: Make more data const.</li>\n</ul>\n</blockquote>\n<p>2019-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/webp.c (RegisterWEBPImage): Make more data const.</li>\n<li>coders/svg.c (RegisterSVGImage): Reduce BSS size.</li>\n<li>coders/miff.c (RegisterMIFFImage): Fix version reporting.</li>\n<li>coders/ttf.c (RegisterTTFImage): Fixed reporting of FreeType\nversion.</li>\n<li>coders/tiff.c (RegisterTIFFImage): Reduce BSS size.</li>\n<li>coders/sfw.c (ReadSFWImage): Make SFW static data completely\nconst.</li>\n<li>coders/ps3.c: Make PS3 static data completely const.</li>\n<li>coders/pict.c: Make PICT static data completely const.</li>\n<li>magick/error.c (ThrowException, ThrowLoggedException): Handle\nthe case where some passed character strings refer to existing\nexception character strings.  Fixes SourceForge issue #603\n&quot;heap-use-after-free in function ThrowLoggedException of\nmagick/error.c&quot;.\n(CatchException): Restructure so there is one return point.</li>\n<li>coders/miff.c (ImportRLEPixels): Fix heap overflow caused by a\ntypo in the code.  Also fix undefined behavior caused by large\nleft shifts of an unsigned char.  Fixes SourceForge issue #608\n&quot;heap-buffer-overflow in ImportRLEPixels of coders/miff.c.</li>\n</ul>\n</blockquote>\n<p>2019-05-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/bmp.c (ReadBMPImage): Fix subrange/scene handling in\n'ping' mode so it is like the other formats.  Only the first frame\nwas being enumerated while in 'ping' mode.</li>\n</ul>\n</blockquote>\n<p>2019-05-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update news.</li>\n<li>magick/utility.c (ExpandFilenames): Only expand <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;filename\">'<span>&#64;</span>filename</a>' to a\nlist of arguments read from 'filename' if the path <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;filename\">'<span>&#64;</span>filename</a>'\ndoes not exist.  This fix is made based on an email posting to the\n'graphicsmagick-help' mailing list at SourceForge by &quot;Test User&quot;\non Tue, 7 May 2019.</li>\n</ul>\n</blockquote>\n<p>2019-05-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/colorspace.c: Reorder initialization of colorspace tables\nfor a possible performance improvement.</li>\n<li>magick/fx.c (WaveImage): Use float for sin map.</li>\n<li>configure.ac: Test for float versions of math functions.</li>\n<li>magick/gem.c (GenerateDifferentialNoise): Use float versions of\nmath functions when available.</li>\n</ul>\n</blockquote>\n<p>2019-05-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/INSTALL-unix.rst: Expanded configure documentation for\n--with-modules.  Added specific configure documentation for\n--with-umem and --with-mtmalloc, which may be useful on\nSolaris-derived systems.</li>\n</ul>\n</blockquote>\n<p>2019-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (VersionCommand): Show OpenMP specification\nversion corresponding to version enumeration.</li>\n<li>magick/locale.c (GetLocaleMessageFromTag): Eliminate clang\nwarning about comparison with a constant value.</li>\n<li>magick/log.c (InitializeLogInfo): Initialize LogInfo log_configured.</li>\n</ul>\n</blockquote>\n<p>2019-04-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magic.c (struct): Ajust StaticMagic definition to be more\nconst-friendly.</li>\n<li>magick/color_lookup.c (struct): Adjust StaticColors definition\nto be more const-friendly.</li>\n<li>magick/attribute.c: Ajust tag_table definition to be more\nconst-friendly.</li>\n<li>magick/log.c: Allocate LogInfo from heap as we used to do.</li>\n<li>magick/locale.c (GetLocaleMessageFromTag): Adaptations to locale\ncoder output changes.</li>\n<li>coders/locale.c (WriteLOCALEImage): Adjust locale coder output\nto be more const.</li>\n</ul>\n</blockquote>\n<p>2019-04-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/color_lookup.c: Make built-in color tables fully const.</li>\n<li>magick/animate.c: Use MagickXTextViewWidgetNDL() to display help\ntext.</li>\n<li>magick/display.c: Use MagickXTextViewWidgetNDL() to display help\ntext.</li>\n<li>magick/widget.c (MagickXTextViewWidgetNDL): New private function\nto display multi-line null-delimited text in an X11 widget.</li>\n<li>coders/xwd.c (ReadXWDImage): Added even more XWD header\nvalidation logic.  Addresses problems noted by email from Hongxu\nChen to the graphicsmagick-security mail alias on Fri, 19 Apr 2019\nand Sat, 20 Apr 2019 and entitled &quot;Multiple crashes (FPE and\ninvalid read) when processing XWD files&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-04-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (ReadXWDImage): Added even more XWD header\nvalidation logic.  Addresses problems noted by email from Hongxu\nChen to the graphicsmagick-security mail alias on Wed, 17 Apr 2019\nand entitled &quot;Multiple crashes (FPE and invalid read) when\nprocessing XWD files&quot;.  Also addresses additional issues noted\nthat an attacker could request to allocate an arbitrary amount of\nmemory based on ncolors and the claimed header size.</li>\n</ul>\n</blockquote>\n<p>2019-04-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (ReadXWDImage): Add more XWD header validation\nlogic.  Addresses problems noted by email from Hongxu Chen to the\ngraphicsmagick-security mail alias on Sun, 14 Apr 2019 and\nentitled &quot;Multiple crashes (FPE and invalid read) when processing\nXWD files&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdb.c (WritePDBImage): Assure that input scanline is\ncleared in order to cover up some decoder bug.  May fix 14215\n&quot;graphicsmagick/coder_PDB_fuzzer: Use-of-uninitialized-value in\nWritePDBImage&quot;, which I have not been able to reproduce.</li>\n<li>magick/render.c (DrawPrimitive): Check primitive point x/y\nvalues for NaN.\n(DrawImage): Fix oss-fuzz issue 14173\n&quot;graphicsmagick/coder_MVG_fuzzer: Integer-overflow in DrawImage&quot;.</li>\n<li>magick/pixel_cache.c (SetNexus): Fix oss-fuzz issue 14208\n&quot;graphicsmagick/coder_MVG_fuzzer: Integer-overflow in SetNexus&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-04-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/display.c: Add even more const declarations.</li>\n<li>coders/mat.c (WriteMATLABImage): Add completely missing error\nhandling.  Fixes SourceForge issue #604 &quot;heap-buffer-overflow in\nfunction WriteMATLABImage of coders/mat.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdb.c (WritePDBImage): Fix SourceForge issue #605\n&quot;heap-buffer-overflow in function WritePDBImage of coders/pdb.c&quot;.</li>\n<li>magick/widget.c: Add many const declarations.</li>\n<li>magick/display.c: Incorporate and eliminate display.h. Add many\nconst declarations.</li>\n<li>magick/animate.c: Incorporate and eliminate animate.h. Add many\nconst declarations.</li>\n</ul>\n</blockquote>\n<p>2019-04-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wmf.c (ReadWMFImage): Reject WMF files with an empty\nbounding box.  Fixes SourceForge issue #606 &quot;Division by Zero in\ncoders/wmf.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-04-07  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/nt_base.c Fix a problem of finding ghostscript fonts.\nVariable &quot;font_dir&quot; was useless and thus removed. No need to copy\ntext multiple times.  Use const char gs_font_dir[] instead of\npointer.</li>\n</ul>\n</blockquote>\n<p>2019-04-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (ReadXWDImage): Perform more header validations and\na file size validation in order to reject files with bogus\nheaders.\n(WriteXWDImage): Fix SourceForge issue #599\n&quot;heap_buffer_overflow_WRITE in function WriteXWDImage of\ncoders/xwd.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-04-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (SVGStartElement): Fix stack buffer overflow while\nparsing quoted font family value.  Fixes SourceForge issue #600\n&quot;stack-buffer-overflow in function SVGStartElement of\ncoders/svg.c&quot;.</li>\n<li>coders/miff.c (ReadMIFFImage): Detect end of file while reading\nRLE packets.  Fixes SourceForge issue #598 &quot;heap-buffer-overflow\nin function ReadMIFFImage of coders/miff.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-04-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/xwd.c (ReadXWDImage): Fix heap buffer overflow while\nreading DirectClass XWD file.  Fixes SourceForge issue #597\n&quot;heap-buffer-overflow in function ReadXWDImage of coders/xwd.c&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-04-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Fix small buffer overflow (one\nPixelPacket) of image colormap.  Fixes SourceForge issue #596\n&quot;heap-buffer-overflow in function CloneImage of magick/image.c&quot;.</li>\n<li>magick/colormap.c (ReallocateImageColormap): New function to\nreallocate an image colormap.</li>\n<li>coders/logo.c: Make more static data const.</li>\n<li>magick/module_aliases.h: Make more static data const.</li>\n<li>magick/static.c: Make more static data const.</li>\n</ul>\n</blockquote>\n<p>2019-04-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/log.c (LogMagickEventList): Log elapsed time with\nmicrosecond precision.</li>\n</ul>\n</blockquote>\n<p>2019-03-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mpc.c (ReadMPCImage): Deal with a profile length of zero,\nor an irrationally large profile length.  Fixes SourceForge issue\n#601 &quot;memory leak in function ReadMPCImage of coders/mpc.c &quot;.</li>\n<li>magick/xwindow.c (MagickXGetWindowInfo): Deal with the unlikely\ncase that the memory allocation for window-&gt;segment_info\nfails. Fixes SourceForge #595 &quot;use allocate memory before null\ncheck&quot; as pertains to magick/xwindow.c.</li>\n<li>magick/segment.c (Classify): Add check for memory allocation\nfailure when allocating cluster array. Fixes SourceForge #595 &quot;use\nallocate memory before null check&quot; as pertains to\nmagick/segment.c.</li>\n<li>coders/pdb.c (ReadPDBImage): Fix use of allocated memory before\nnull check.  Fixes SourceForge #595 &quot;use allocate memory before\nnull check&quot; as pertains to coders/pdb.c.</li>\n</ul>\n</blockquote>\n<p>2019-03-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (AllocateThreadViewSet): Simplify the image\nview model by adding NexusInfo to the View structure (rather than\nreferencing it via a pointer) to lessen the number of required\nper-thread allocations and to improve locality of reference.</li>\n</ul>\n</blockquote>\n<p>2019-03-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (WPG1_Palette): Change to a static declaration.</li>\n<li>coders/dcm.c: dicom_info array is now fully in the data segment.</li>\n</ul>\n</blockquote>\n<p>2019-03-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>configure.ac: Add support for using the Solaris mtmalloc\nlibrary.  This is primarily for testing or as an alternative to\nSolaris umem.\nStop using posix_memalign() until it is uniformly more mature and\nreliably quick.</li>\n</ul>\n</blockquote>\n<p>2019-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (SetNexus): Smallest staging-area\nallocation is cache line size so declare it as such.</li>\n<li>magick/fx.c: Functions in the fx module which return a new Image\nshould return a null Image if an exception was thrown.  Also,\nassure that user has an opportunity to see the exception which was\nthrown.</li>\n<li>magick/error.c (ThrowLoggedException): Throwing an exception is\nnow thread-safe.</li>\n<li>magick/pixel_cache-private.h: Moved pixel cache private\ndefinitions to private header.</li>\n</ul>\n</blockquote>\n<p>2019-03-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (SetNexus): Pass x, y, columns, and rows\nrather than a pointer to RectangleInfo.  This should be easier to\ninline on modern CPUs.</li>\n</ul>\n</blockquote>\n<p>2019-03-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (SetNexus): Cache resource limits in\nCacheInfo rather than repeatedly calling into the resource code in\norder to lessen the overhead of performing resource limit checks\non the pixel cache views.</li>\n<li>magick/resource.c (AcquireMagickResource): Use a lock for each\nresource in order to lessen contention.  Return a maximum 64-bit\ninteger value if the resource has not been limited.  Previously\nreturned -1 in this case but this was not documented.</li>\n</ul>\n</blockquote>\n<p>2019-03-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/import.c (ImportViewPixelArea): If range between max and\nmin is less than MagickEpsilon, produce a black image rather than\nthrowing an exception.</li>\n<li>coders/mat.c (ReadMATImage): Fix memory leak on unexpected end\nof file.  Fixes oss-fuzz 13556 &quot;graphicsmagick/coder_MAT_fuzzer:\nDirect-leak in ReadMATImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-03-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mat.c (ReadMATImage): Quit if image scanlines are not\nfully populated due to exception.  Fixes oss-fuzz 13530\n&quot;graphicsmagick/coder_MAT_fuzzer: Use-of-uninitialized-value in\nInsertComplexFloatRow&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-03-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/txt.c (ReadTXTImage): Don't start new line if x_max &lt;\nx_min.  Avoids calling SetImagePixels() with a width of zero.\nRelated to oss-fuzz 13521 &quot;graphicsmagick/coder_TEXT_fuzzer:\nFloating-point-exception in SetNexus&quot;. (Credit to OSS-Fuzz)</li>\n<li>magick/pixel_cache.c (SetNexus): Report error for empty region\nrather than crashing due to divide by zero exception. This is a\nnew bug due to yesterday's changes.  Fixes oss-fuzz 13521\n&quot;graphicsmagick/coder_TEXT_fuzzer: Floating-point-exception in\nSetNexus&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-03-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>design/pixel-cache.dot: Update design dot diagram to remove\nIsNexusInCore and add CompositeCacheNexus.</li>\n<li>magick/pixel_cache.c (SetNexus): Apply resource limits to pixel\nnexus allocations using the same limits (total pixels, width,\nheight, memory) as applied to the whole image since some requests\nare directly influenced by the input file.  Add yet more tests for\narithmetic overflow.  Whole source module is re-arranged so that\nstatic functions are in order of dependency so that forward\nprototype declarations are no longer needed.  Fixes oss-fuzz 13210\n&quot;graphicsmagick/coder_MVG_fuzzer: Integer-overflow in\nSetNexus&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-03-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (OpenCache): Use unsigned 64-bit value to\nstore CacheInfo offset and length as well as for the total pixels\ncalculation.  Add some more arithmetic overflow detections.</li>\n<li>coders/topol.c (ReadTOPOLImage): Report a corrupt image\nexception &quot;Unexpected end-of-file&quot; if reader encounters end of\nfile while reading header rows.  Addresses oss-fuzz 7981\n&quot;graphicsmagick/coder_TOPOL_fuzzer: Use-of-uninitialized-value in\nInsertRow&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/mat.c (ReadMATImage): Report a corrupt image exception\n&quot;Unexpected end-of-file&quot; if reader encounters end of file while\nreading scanlines.  Also added some helpful traces.  Hopefully\naddresses oss-fuzz 13445 &quot;graphicsmagick/coder_MAT_fuzzer:\nUse-of-uninitialized-value in IsGrayImage&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-02-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image.h (&quot;C&quot;): Include as &quot;magick/image-private.h&quot; as the\nother headers are.\n(&quot;C&quot;): Include &quot;magick/image-private.h&quot; inside the protective\nMAGICK_IMPLEMENTATION guard, as it should have been.  This error\nbroke the oss-fuzz build.</li>\n</ul>\n</blockquote>\n<p>2019-02-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/image-private.h (_ImageExtra): Put ImageExtra definition\nin a private header file so that its definition may be accessed\ndirectly by library internals.  Add some accessor macros to\nprovide access and update code to use them.</li>\n<li>coders/wpg.c (ReallocColormap): Make sure that there is not a\nheap overwrite if the number of colors has been reduced.  Thanks\nto Jaroslav Fojtik for giving me a heads up about this.</li>\n</ul>\n</blockquote>\n<p>2019-02-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/monitor.c (MagickMonitorActive): Add new private function\nto test if a progress monitor is active.  Update all progress\nmonitor code in loops to use this information, while also updating\ncode to hopefully address concerns expressed by Hongxu Chen about\ndata races on the graphicsmagick-bugs mailing list starting on\nFebruary 6, 2019.</li>\n</ul>\n</blockquote>\n<p>2019-02-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/mpc.c (ReadMPCImage): Tally directory length to avoid\ndeath by strlen().</li>\n<li>coders/miff.c (ReadMIFFImage): Tally directory length to avoid\ndeath by strlen().  Fixes oss-fuzz 13190\n&quot;graphicsmagick/coder_MIFF_fuzzer: Timeout in\ngraphicsmagick_coder_MIFF_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-02-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/svg.c (ReadSVGImage): Don't call xmlCleanupParser()\nin module code since this may cause other libxml users to fail.</li>\n<li>coders/msl.c (ProcessMSLScript): Don't call xmlCleanupParser()\nin module code since this may cause other libxml users to fail.</li>\n<li>magick/render.c (DrawDashPolygon): (DrawDashPolygon): Don't read\nbeyond end of dash pattern array.  This is a second instance of\nissue identified by SourceForge issue #591.  Fixes oss-fuzz 13160\n&quot;graphicsmagick/coder_MVG_fuzzer: Heap-buffer-overflow in\nDrawDashPolygon&quot;.  The earlier attempt to fix this problem today\nbroke dash patterns entirely.  (Credit to OSS-Fuzz)</li>\n<li>magick/annotate.c (RenderFreetype): Eliminate memory leak of\nGlyphInfo.image (type FT_Glyph) while rendering some FreeType\nfonts such as the one we use now in the Magick++ test suite.</li>\n</ul>\n</blockquote>\n<p>2019-02-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawDashPolygon): Avoid reading one beyond\nlength of dash pattern array, which is terminated by value 0.0.\nFixes SourceForge issue #591 &quot;Heap buffer overflow in\nDrawDashPolygon when parsing SVG images&quot;.\n(DrawPrimitive): Add arithmetic overflow checks when converting\ncomputed coordinates from 'double' to 'long'.\n(DrawImage): Don't destroy draw_info in graphic_context when\ndraw_info has not been allocated yet.  Problem reported via email\nby Sami Supperi on Thu, 14 Feb 2019.</li>\n<li>coders/jpeg.c (ReadJPEGImage): JPEG files are observed to\nprovide compression ratios as high as 2500 so allow for that.\nAlso, the test for &quot;Unreasonable dimensions&quot; delivered yesterday\nwas flawed since magick_rows and magick_columns are only set if a\ndesired image size was provided.  Fixes SourceForge issue 592\n&quot;Non-malicious JPEG file fails with &quot;Unreasonable dimensions&quot;&quot;.</li>\n<li>coders/tiff.c (ReadTIFFImage): Only disassociate alpha channel\nfor images where photometic is PHOTOMETRIC_RGB. Fixes oss-fuzz\n13115 &quot;graphicsmagick/coder_PTIF_fuzzer:\nUse-of-uninitialized-value in DisassociateAlphaRegion&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-02-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/jpeg.c (ReadJPEGImage): Base test for &quot;Unreasonable\ndimensions&quot; on original JPEG dimensions and not the scaled\ndimensions.  Fixes SourceForge issue 593 &quot;gm convert: Insufficient\nimage data in file when hinting input image&quot;.</li>\n</ul>\n</blockquote>\n<p>2019-02-13  Troy Patteson  &lt;<a class=\"reference external\" href=\"mailto:troyp&#37;&#52;&#48;ieee&#46;org\">troyp<span>&#64;</span>ieee<span>&#46;</span>org</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick/Magick.xs (Mogrify): Add decorate argument to Annotate.</li>\n<li>PerlMagick/Magick.xs (Mogrify): Remove reference to undefined\nAnnotate argument.</li>\n</ul>\n</blockquote>\n<p>2019-02-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (ReadTIFFImage): For planar TIFF, make sure that\npixels are initialized in case some planes are missing.  Fixes\noss-fuzz 13046 &quot;graphicsmagick/coder_PTIF_fuzzer:\nUse-of-uninitialized-value in DisassociateAlphaRegion&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-02-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pdf.c (WritePDFImage): Make sure to free 'xref' before\nreturning.  Similar to ImageMagick CVE-2019-7397 &quot;In ImageMagick\nbefore 7.0.8-25, several memory leaks exist in WritePDFImage in\ncoders/pdf.c.&quot;.  Thanks to Petr Gajdos for bringing this issue to\nour attention.</li>\n</ul>\n</blockquote>\n<p>2019-02-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c (ReadWPGImage): Use a different way to reallocate\nthe colormap which preserves existing content, but also updates\nimage-&gt;colors and assures that added palette entries are\ninitialized.</li>\n<li>coders/png.c (ReadMNGImage): Bound maximum loop iterations by\nsubrange as a primitive means of limiting resource consumption.\nThis should finally resolve oss-fuzz 12738\n&quot;graphicsmagick/enhance_fuzzer: Out-of-memory in\ngraphicsmagick_enhance_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/tiff.c (ReadTIFFImage): Assure that opacity channel is\ninitialized in the RGBAStrippedMethod case.  Convert\n'CorruptImageError' encountered while testing for more frames to\n'CorruptImageWarning' so we return the frames already read.\nSecond try at fixing oss-fuzz 11896\n&quot;graphicsmagick/coder_PTIF_fuzzer: Use-of-uninitialized-value in\nVerticalFilter&quot;.</li>\n<li>coders/dpx.c (AttributeToString): Eliminate clang\n&quot;-Wstring-plus-int&quot; warning observed in oss-fuzz build.</li>\n<li>coders/cineon.c (AttributeToString): Eliminate clang\n&quot;-Wstring-plus-int&quot; warning observed in oss-fuzz build.</li>\n</ul>\n</blockquote>\n<p>2019-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (DecodeImage): Avoide a one-byte over-read of\npixels heap allocation.  The cause of the over-read is not yet\nunderstood.  Fixes oss-fuzz 12019\n&quot;graphicsmagick/coder_PICT_fuzzer: Heap-buffer-overflow in\nExpandBuffer&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/wpg.c (ReadWPGImage): Assure that all colormap entries\nare initialized.  Fixes oss-fuzz 12614\n&quot;graphicsmagick/enhance_fuzzer: Use-of-uninitialized-value in\nEnhanceImage&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/tiff.c (ReadTIFFImage): Make sure that image is in\nDirectClass mode and ignore any claimed colormap when the image is\nread using the RGBAStrippedMethod, RGBATiledMethod, or\nRGBAPuntMethod cases.  Fixes oss-fuzz 12195\n&quot;graphicsmagick/coder_PTIF_fuzzer: Use-of-uninitialized-value in\nExportGrayQuantumType&quot;. (Credit to OSS-Fuzz)</li>\n<li>coders/miff.c (ReadMIFFImage): Improve pixel buffer calculations\nto defend against overflow.  Assure that zlib and bzlib decode the\nexpected number of bytes for a pixel row.  Fixes oss-fuzz issue\n12448 &quot;graphicsmagick/coder_MIFF_fuzzer:\nUse-of-uninitialized-value in RGBTransformPackets&quot;. (Credit to\nOSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-02-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/png.c (ReadMNGImage): Quit processing and report error\nupon failure to insert MNG background layer.  Fixes oss-fuzz 12738\n&quot;graphicsmagick/enhance_fuzzer: Out-of-memory in\ngraphicsmagick_enhance_fuzzer&quot;. (Credit to OSS-Fuzz)</li>\n</ul>\n</blockquote>\n<p>2019-02-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dib.c (ReadDIBImage, WriteDIBImage): Improve buffer-size\ncalculations to guard against buffer overflows.  The reader\nversion was not as complete as it should have been, whereas the\nwriter version did not guard against arithmetic overflow at all.</li>\n<li>coders/bmp.c (ReadBMPImage, WriteBMPImage): Improve buffer-size\ncalculations to guard against buffer overflows.  This is a\nfollow-on fix to the previous fix submitted for SourceForge issue\n#582 &quot;heap-buffer-overflow in ReadBMPImage of bmp.c&quot; which is now\nalso identified as CVE-2018-20185.</li>\n<li>www/Hg.rst: Updates to reflect current usage and availability.</li>\n<li>www/authors.rst: Promote Troy Patteson to the active contributor\ncategory.</li>\n</ul>\n</blockquote>\n<p>2019-02-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/version.h.in: Rotate ChangeLog and update copyright\nstatements for the new year.</li>\n</ul>\n</blockquote>\n<p>2019-01-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/webp.c (WriteWEBPImage): Patch by Przemysław Sobala to\nsupport WebP 'use_sharp_yuv' option (&quot;if needed, use sharp (and\nslow) RGB-&gt;YUV conversion&quot;) via <cite>-define webp:use-sharp-yuv=true</cite>.</li>\n</ul>\n</blockquote>\n<p>2019-01-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/pixel_cache.c (SetNexus): Merge IsNexusInCore()\nimplementation code into SetNexus() and add check for if\ncache_info-&gt;pixels is null.  Fixes SourceForge issue #588 &quot;Bug in\nIsNexusInCore()&quot;.</li>\n<li>configure.ac (DcrawExtraOptions): Request TIFF output from dcraw\nif build supports TIFF format in order to obtain more metadata.\nThis allows obtaining some metadata from standard TIFF tags\n(e.g. camera make, model, and dcraw version), and any attached ICC\nprofile, but not specifically EXIF data since we don't support\nextracting EXIF data from TIFF yet. Inspired by SourceForge issue\n589 &quot;Identify lack of data (no Exif) in RAW formats&quot;.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Changelog.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Changelog.rst</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2020-02-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>version.sh: Updates in preparation for the 1.3.35 release.\nMerge changes for 1.3.35 into GraphicsMagick-1_3 branch.</li>\n<li>www/INSTALL-windows.rst: Update Windows installation and build\ndocumentation.</li>\n</ul>\n</blockquote>\n<p>2020-02-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>NEWS.txt: Update with News since previous release.</li>\n<li>magick/magick.c (InitializeMagickSignalHandlers): This private\nimplementation function is now a static function as it should have\nbeen.\n(InitializeMagickEx): New function which may be used in place of\nInitializeMagick() to initialize GraphicsMagick.  This\ninitialization function returns an error status value, may update\na passed ExceptionInfo structure with error information, and\nprovides an options parameter which supports simple bit-flags to\ntailor initialization.  The signal handler registrations are\nskipped if the MAGICK_OPT_NO_SIGNAL_HANDER flag is set in the\noptions.</li>\n</ul>\n</blockquote>\n<p>2020-02-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/magick.c (MagickToMime): Add a MIME translation for\n&quot;jpg&quot;.  Issue reported by Pro Turm.</li>\n</ul>\n</blockquote>\n<p>2020-02-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>www/INSTALL-windows.rst: Add quoting to avoid losing backslashes\nin Windows paths.</li>\n</ul>\n</blockquote>\n<p>2020-02-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/common.h: Add missing unsupported handling for some\nrecently added GCC/Clang attributes.</li>\n<li>magick/: Move all remaining private implementation code in\npublic headers which is guarded by MAGICK_IMPLEMENTATION into\nprivate headers, which are never installed.</li>\n</ul>\n</blockquote>\n<p>2020-02-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/tiff.c (WriteTIFFImage): Evidence suggests that large\nstrip sizes improve performance by reducing the number of I/Os.\nThe defaults suggested by libtiff are way to small for today's\nimages and computers.  Default TIFF strip sizes so that each\nuncompressed strip consumes up to 1MiB of memory, or 4MiB for FAX\noriented codecs, or based on LZMA compression level when using\nLZMA compression.  The default size may be adjusted via the\nTIFF_BYTES_PER_STRIP preprocessor definition.</li>\n</ul>\n</blockquote>\n<p>2020-02-09  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c ZeroFillMissing data will never been triggered when\ny&gt;=image-&gt;rows.</li>\n</ul>\n</blockquote>\n<p>2020-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Limit pattern dimensions by\nLONG_MAX rather than ULONG_MAX since this seems more likely to\navoid arithmetic overflows later on.</li>\n</ul>\n</blockquote>\n<p>2020-02-09  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/wpg.c Check for exception in image.</li>\n</ul>\n</blockquote>\n<p>2020-02-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/command.c (VersionCommand): Add Google perftools tcmalloc\nto the available feature support.</li>\n<li>www/INSTALL-unix.rst: Include some information about building\nwith MSYS2.</li>\n<li>coders/png.c (ReadOnePNGImage): Eliminate compilation warnings\nabout signed/unsigned comparisons.</li>\n<li>magick/image.c: Remove private global string constants, and one\nprivate global unsigned long constant, from the library ABI.\nSince the global constants were declared via a private header and\nonly used within the GraphicsMagick build, removing these does not\nimpact the public ABI.  The globals removed are BackgroundColor,\nBorderColor, DefaultTileFrame, DefaultTileGeometry,\nDefaultTileLabel, ForegroundColor, HighlightColor, MatteColor,\nPSDensityGeometry, PSPageGeometry, and DefaultCompressionQuality.</li>\n</ul>\n</blockquote>\n<p>2020-02-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Apply draconian pattern\nspecification offset and dimension validations.  Hopefully there\nis no impact to usability.  If so please report it as a bug.\nFixes oss-fuzz 20586 &quot;graphicsmagick:coder_MVG_fuzzer:\nInteger-overflow in DrawPolygonPrimitive&quot;.</li>\n<li>coders/svg.c (ReadSVGImage): Fix dereference of NULL pointer\nwhen stopping image timer.</li>\n</ul>\n</blockquote>\n<p>2020-02-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (DecodeImage): Allocate extra scanline memory to\nallow small RLE overrun.  Fixes oss-fuzz 20271\n&quot;graphicsmagick:coder_PICT_fuzzer: Heap-buffer-overflow in\nExpandBuffer&quot; and 20272 &quot;graphicsmagick:coder_PICT_fuzzer:\nHeap-buffer-overflow in DecodeImage&quot;.</li>\n<li>PerlMagick/t/wmf/read.t: Update WMF reference images.  Relax\ntest requirements for ski.wmf.</li>\n<li>locale/C.mgk: Correct error message associated with\n&quot;UnsupportedNumberOfRows&quot;.  Patch was submitted by Thorsten\nAlteholz via private email on 2020-02-05.</li>\n</ul>\n</blockquote>\n<p>2020-02-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/topol.c: Include magick/magick_endian.h.</li>\n</ul>\n</blockquote>\n<p>2020-02-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick, coders, wand: Added copious casts to avoid possible\ninteger overflows in the Microsoft Windows 64-bit build, where\nsizeof(long) &lt; sizeof(size_t).</li>\n</ul>\n</blockquote>\n<p>2020-01-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.h (&quot;PrimitiveInfo&quot;): Change PrimitiveInfo\ncoordinates from type 'unsigned long' to 'size_t'.</li>\n</ul>\n</blockquote>\n<p>2020-01-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/gradient.c (GradientImage): Warnings reduction, plus note\nabout incorrect diagonal gradients math.</li>\n</ul>\n</blockquote>\n<p>2020-01-20  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagickconfigureconfigure.cpp Option /arch:SSE2 is\navailable only for 32 bit build.</li>\n</ul>\n</blockquote>\n<p>2020-01-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pcd.c (DecodeImage): Assure that pcd_length gets\ninitialized with something.</li>\n<li>Magick++/lib/Options.cpp (strokeDashArray): Add needless check\nfor _drawInfo-&gt;dash_pattern null in order to make static analysis\nhappy.</li>\n<li>magick/render.c (DestroyPolygonInfo): Make sure to not\ndereference a null edges pointer.</li>\n<li>coders/pdb.c (WritePDBImage): Make sure that null comment value\nis not dereferenced.</li>\n<li>coders/vid.c (ReadVIDImage): Make sure that\nThrowVIDReaderException does not dereference a null pointer.</li>\n<li>magick/quantize.c (ClassifyImageColors): Fix error handling so a\nnull pointer won't be consumed after a memory allocation failure.\nChanged the location of some variable declarations and added some\ncomments.</li>\n</ul>\n</blockquote>\n<p>2020-01-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/caption.c (ReadCAPTIONImage): Assure that metrics are\ninitialized.</li>\n<li>magick/pixel_cache.c (DestroyThreadViewSet): Check if views\npointer is not null before destroying views.</li>\n<li>coders/xpm.c (ReadXPMImage): Properly detect the case where the\nXPM colormap is not fully initialized.</li>\n<li>coders/pict.c (DecodeImage): Fix heap buffer over-reads. Fixes\noss-fuzz issue 20053 &quot;graphicsmagick:coder_PICT_fuzzer:\nHeap-buffer-overflow in ExpandBuffer&quot; and oss-fuzz issue 20048\n&quot;graphicsmagick:coder_PICT_fuzzer: Heap-buffer-overflow in\nDecodeImage&quot;.  Both of these oss-fuzz issues appeared due to\nrecent changes since the last release.</li>\n<li>coders/meta.c (WriteMETAImage): Assure that 'iptc_offset' is\ninitialized and valid.</li>\n<li>coders/jpeg.c (ReadJPEGImage): Assure that evaluating the\nembedded profile length does not suffer from undefined behavior.</li>\n</ul>\n</blockquote>\n<p>2020-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/render.c (DrawImage): Add more MVG parser validations.</li>\n</ul>\n</blockquote>\n<p>2020-01-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/histogram.c (WriteHISTOGRAMImage): Histogram coder was\nrelying on the previously removed '&#64;' file inclusion feature to\ninsert the histogram comment text.  Write a PseudoClass MIFF image\nwith RLE compression.  Fixes SourceForge issue #622 &quot;Histogram\nproduces incorrect color table attribute &quot;.</li>\n<li>magick/pixel_cache.c (ModifyCache): Re-open the pixel cache if\nthe cache rows/columns do not match the owning image rows/columns.</li>\n<li>magick/transform.c (TransformImage): TransformImage now returns\na MagickPassFail return status value rather than void.</li>\n<li>coders/pict.c (ReadPICTImage): Fix some over-strict validations\nwhich were preventing some PICT files which were previously read\nsuccessfully from being accepted. Fix problems which occurred when\nthe clipping rectangle changed the image size. Improve reading\nembedded JPEG blobs.  Now successfully reads all raster PICT files\nI have available.</li>\n</ul>\n</blockquote>\n<p>2020-01-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/pict.c (ReadPICTImage): Be more strict about PICT\nrectangle by treating rectangle dimensions as if they are a 16-bit\nsigned type and not allowing negative values.  Avoid GCC warnings\nwhich sprung up similar to &quot;warning: comparison is always false\ndue to limited range of data type&quot;.</li>\n</ul>\n</blockquote>\n<p>2020-01-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/sfw.c (ReadSFWImage): Restore a DestroyImage() statement\nwhich was accidentally deleted by recent edits.  Fixes oss-fuzz\n&quot;Issue 19819 in oss-fuzz: graphicsmagick:coder_SFW_fuzzer:\nIndirect-leak in AllocateImage&quot;.</li>\n<li>coders/png.c (WriteOneJNGImage): Detect when JPEG encoder has\nfailed, and throw exception.  Fix image dimension limit\nvalidations.  Stop discarding exception report.  Fixes SourceForge\nbug #621 &quot;Assertion in WriteBlob at magick/blob.c:4937&quot; which was\nreported by Suhwan Song.</li>\n<li>coders/pict.c (WritePICTImage): Eliminating small buffer overrun\nwhen run-length encoding pixels.  Fixes SourceForge bug #620\n&quot;heap-buffer-overflow in EncodeImage at coders/pict.c:1114&quot; which\nwas reported by Suhwan Song.</li>\n<li>coders/logo.c (ReadLOGOImage): PATTERN error handling was\nincomplete.  Add appropriate error handling.\n(ReadLOGOImage): Switch to using ConstituteTextureImage() rather\nthan TextureImage() since it is more appropriate for this purpose.\n(ReadLOGOImage): Oops!  Accidental change of behavior. When size\nis not supplied, simply return the pattern image.</li>\n</ul>\n</blockquote>\n<p>2020-01-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/*.c (ReadFOOImage): Stop image timer just before\nreturning from reader so that reported timings are correct when\nused in the future.</li>\n</ul>\n</blockquote>\n<p>2020-01-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>magick/timer.c (StartTimer): Expose previously existing\nStartTimer() function.\n(StopTimer): Expose previously existing StartTimer() function.</li>\n<li>magick/constitute.c (WriteImage): Don't over-write time-stamp\nwhen output is to INFO format.</li>\n</ul>\n</blockquote>\n<p>2020-01-03  Fojtik Jaroslav  &lt;<a class=\"reference external\" href=\"mailto:JaFojtik&#37;&#52;&#48;seznam&#46;cz\">JaFojtik<span>&#64;</span>seznam<span>&#46;</span>cz</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>VisualMagickconfigureconfigure.exe: Should not depend on mfcr90.dll.\nIt is too bad when end user cannot run this tool because of missing DLL.</li>\n<li>VisualMagickconfigureconfigure.cpp Make speed optimisation as default\noption.</li>\n<li>VisualMagickconfigureconfigure.vcproj Give different filename to debug\nbuild to avoid accidental committing debug build to repository.</li>\n</ul>\n</blockquote>\n<p>2020-01-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>coders/dpx.c (GenerateDPXTimeStamp): Use reentrant localtime_r()\nfunction if it is available.</li>\n<li>magick/log.c (LogMagickEventList): Use reentrant\nlocaltime_r() function if it is available.</li>\n<li>coders/cineon.c (GenerateCineonTimeStamp): Use reentrant\nlocaltime_r() function if it is available.</li>\n<li>coders/mat.c (WriteMATLABImage): Use reentrant localtime_r()\nfunction if it is available.</li>\n<li>coders/pdf.c (WritePDFImage): Use reentrant localtime_r()\nfunction if it is available.</li>\n<li>coders/ps.c (WritePSImage): Use reentrant ctime_r() function\nif it is available.</li>\n<li>coders/ps2.c (WritePS2Image): Use reentrant ctime_r() function\nif it is available.</li>\n<li>coders/ps3.c (WritePS3Image): Use reentrant ctime_r() function\nif it is available.</li>\n<li>configure.ac: Test for getpwnam_r().</li>\n<li>magick/utility.c (ExpandFilename): Use reentrant getpwnam_r()\nfunction if it is available.</li>\n<li>magick/magick.c (InitializeMagickSignalHandlers): Use the normal\ntermination signal handler for SIGXCPU and SIGXFSZ so that ulimit\nor setrlimit(2) may be used to apply CPU (RLIMIT_CPU) and output\nfile size (RLIMIT_FSIZE) limits with the normal cleanup, and\nwithout dumping core.  Note that any output files currently being\nwritten may be truncated and files being written by external\nprograms (e.g. Ghostscript) might be left behind unless they are\nto a temporary file assigned by GraphicsMagick.</li>\n<li>coders/xpm.c (ReadXPMImage): Promote a color-lookup\nwarning to an error.</li>\n<li>coders/xc.c (ReadXCImage): Promote a color-lookup\nwarning to an error.</li>\n<li>coders/null.c (ReadNULLImage): Promote a color-lookup\nwarning to an error.</li>\n<li>Makefile.am: Rotate ChangeLogs for the new year.</li>\n<li>coders/gradient.c (ReadGRADIENTImage): Promote a color-lookup\nwarning to an error.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Changes.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Change Logs</title>\n<meta content=\"GraphicsMagick is a robust collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats including GIF, JPEG, PNG, PDF, and WebP. With GraphicsMagick you can create GIFs dynamically making it suitable for Web applications. You can also resize, rotate, sharpen, color reduce, or add special effects to an image and save your completed work in the same or differing image format. \" name=\"description\" />\n<meta content=\"GraphicsMagick, GM, PerlMagick, Perl Magick, Perl Magic, image processing, software development, TclMagick, Magick++\" name=\"keywords\" />\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-change-logs\">\n<h1 class=\"title\">GraphicsMagick Change Logs</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The following are the <tt class=\"docutils literal\">GraphicsMagick</tt> change logs since 2001:</p>\n<blockquote>\n<ul class=\"simple\">\n<li><a class=\"reference external\" href=\"Changelog.html\">2020</a> (1.3.35 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2019.html\">2019</a> (1.3.32, 1.3.33, 1.3.34 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2018.html\">2018</a> (1.3.28, 1.3.29, 1.3.30, 1.3.31 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2017.html\">2017</a> (1.3.26, 1.3.27, 1.3.27a released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2016.html\">2016</a> (1.3.24, 1.3.25 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2015.html\">2015</a> (1.3.21 - 1.3.23 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2014.html\">2014</a> (1.3.20 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2013.html\">2013</a> (1.3.18 - 1.3.19 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2012.html\">2012</a> (1.3.14 - 1.3.17 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2011.html\">2011</a> (1.3.13 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2010.html\">2010</a> (1.2.10, 1.3.8 - 1.3.12 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2009.html\">2009</a> (1.3.4 - 1.3.7 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2008.html\">2008</a> (1.1.11 - 1.1.14, 1.2 - 1.2.9, 1.3 - 1.3.3 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2007.html\">2007</a> (1.1.8 - 1.1.10 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2006.html\">2006</a></li>\n<li><a class=\"reference external\" href=\"ChangeLog-2005.html\">2005</a> (1.1.5 - 1.1.7 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2004.html\">2004</a> (1.0.5 - 1.0.6, 1.1 - 1.1.4 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2003.html\">2003</a> (1.0 - 1.0.4 released)</li>\n<li><a class=\"reference external\" href=\"ChangeLog-2002.html\">2002</a></li>\n<li><a class=\"reference external\" href=\"ChangeLog-2001.html\">2001</a></li>\n</ul>\n</blockquote>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Copyright.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Copyrights and Licenses</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-copyrights-and-licenses\">\n<h1 class=\"title\">GraphicsMagick Copyrights and Licenses</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>This file is part of the GraphicsMagick software distributed by the\nGraphicsMagick Group.</p>\n<blockquote>\n[<em>Please note that the legal community considers 15 or more\ntotal lines of code or text (not necessarily contiguous) to\nbe significant for the purposes of copyright. Repeated\nchanges such as renaming a symbol has similar significance\nto changing one line of code.</em>]</blockquote>\n<p>The licenses which components of this software fall under are as follows.</p>\n<ol class=\"arabic\">\n<li><p class=\"first\">In November 2002, the GraphicsMagick Group created GraphicsMagick\nfrom ImageMagick Studio's ImageMagick and applied the &quot;MIT&quot; style\nlicense:</p>\n<p>Copyright (C) 2002-2020 GraphicsMagick Group</p>\n<p>Permission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation files\n(the &quot;Software&quot;), to deal in the Software without restriction,\nincluding without limitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of the Software,\nand to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:</p>\n<p>The above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.</p>\n<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\nBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\nACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.</p>\n</li>\n<li><p class=\"first\">In October 1999, ImageMagick Studio assumed the responsibility for\nthe development of ImageMagick (forking from the distribution by\nE. I. du Pont de Nemours and Company) and applied a new license:</p>\n<p>Copyright (C) 2002 ImageMagick Studio, a non-profit organization dedicated\nto making software imaging solutions freely available.</p>\n<p>Permission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (&quot;ImageMagick&quot;),\nto deal in ImageMagick without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of ImageMagick, and to permit persons to whom the\nImageMagick is furnished to do so, subject to the following conditions:</p>\n<p>The above copyright notice and this permission notice shall be included in\nall copies or substantial portions of ImageMagick.</p>\n<p>The software is provided &quot;as is&quot;, without warranty of any kind, express or\nimplied, including but not limited to the warranties of merchantability,\nfitness for a particular purpose and noninfringement.  In no event shall\nImageMagick Studio be liable for any claim, damages or other liability,\nwhether in an action of contract, tort or otherwise, arising from, out of\nor in connection with ImageMagick or the use or other dealings in\nImageMagick.</p>\n<p>Except as contained in this notice, the name of the ImageMagick Studio\nshall not be used in advertising or otherwise to promote the sale, use or\nother dealings in ImageMagick without prior written authorization from the\nImageMagick Studio.</p>\n</li>\n<li><p class=\"first\">From 1991 to October 1999 (through ImageMagick 4.2.9), ImageMagick\nwas developed and distributed by E. I. du Pont de Nemours and\nCompany:</p>\n<p>Copyright 1999 E. I. du Pont de Nemours and Company</p>\n<p>Permission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files\n(&quot;ImageMagick&quot;), to deal in ImageMagick without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of ImageMagick, and to\npermit persons to whom the ImageMagick is furnished to do so, subject\nto the following conditions:</p>\n<p>The above copyright notice and this permission notice shall be included\nin all copies or substantial portions of ImageMagick.</p>\n<p>The software is provided &quot;as is&quot;, without warranty of any kind, express\nor implied, including but not limited to the warranties of\nmerchantability, fitness for a particular purpose and noninfringement.\nIn no event shall E. I. du Pont de Nemours and Company be liable for\nany claim, damages or other liability, whether in an action of\ncontract, tort or otherwise, arising from, out of or in connection with\nImageMagick or the use or other dealings in ImageMagick.</p>\n<p>Except as contained in this notice, the name of the E. I. du Pont de\nNemours and Company shall not be used in advertising or otherwise to\npromote the sale, use or other dealings in ImageMagick without prior\nwritten authorization from the E. I. du Pont de Nemours and Company.</p>\n</li>\n<li><p class=\"first\">The GraphicsMagick Base64Decode() and Base64Encode() functions are\nbased on source code obtained from OpenSSH. This source code is\ndistributed under the following license:</p>\n<p>Copyright (c) 2000 Markus Friedl.  All rights reserved.</p>\n<p>Redistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:</p>\n<ol class=\"arabic simple\">\n<li>Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.</li>\n<li>Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.</li>\n</ol>\n<p>THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\nNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>\n</li>\n<li><p class=\"first\">Many of the pattern images in coders/logo.c are derived from XFig,\nwhich is distributed under the following license:</p>\n<div class=\"line-block\">\n<div class=\"line\">FIG : Facility for Interactive Generation of figures</div>\n<div class=\"line\">Copyright (c) 1985-1988 by Supoj Sutanthavibul</div>\n<div class=\"line\">Parts Copyright (c) 1989-2000 by Brian V. Smith</div>\n<div class=\"line\">Parts Copyright (c) 1991 by Paul King</div>\n</div>\n<p>Any party obtaining a copy of these files is granted, free of charge, a\nfull and unrestricted irrevocable, world-wide, paid up, royalty-free,\nnonexclusive right and license to deal in this software and\ndocumentation files (the &quot;Software&quot;), including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons who receive\ncopies from any such party to do so, with the only requirement being\nthat this copyright notice remain intact.</p>\n</li>\n<li><p class=\"first\">The documentation for the composition operators is copied from the\nrlecomp manual page, which is authored by Rod Bogart and John W.\nPeterson. Rlecomp is part of the Utah Raster Toolkit distributed by the\nUniversity of Michigan and the University of Utah. The copyright for\nthis manual page is as follows:</p>\n<p>Copyright (c) 1986, University of Utah</p>\n<p>This software is copyrighted as noted below.  It may be freely copied,\nmodified, and redistributed, provided that the copyright notice is\npreserved on all copies.</p>\n<p>There is no warranty or other guarantee of fitness for this software,\nit is provided solely &quot;as is&quot;.  Bug reports or fixes may be sent\nto the author, who may or may not act on them as he desires.</p>\n<p>You may not include this software in a program or other software product\nwithout supplying the source, or without informing the end-user that the\nsource is available for no extra charge.</p>\n<p>If you modify this software, you should include a notice giving the\nname of the person performing the modification, the date of modification,\nand the reason for such modification.</p>\n</li>\n<li><p class=\"first\">The source code comprising magick_endian.c is originally derived\nfrom libtiff which has the following license:</p>\n<div class=\"line-block\">\n<div class=\"line\">Copyright (c) 1988-1997 Sam Leffler</div>\n<div class=\"line\">Copyright (c) 1991-1997 Silicon Graphics, Inc.</div>\n</div>\n<p>Permission to use, copy, modify, distribute, and sell this software and\nits documentation for any purpose is hereby granted without fee, provided\nthat (i) the above copyright notices and this permission notice appear in\nall copies of the software and related documentation, and (ii) the names of\nSam Leffler and Silicon Graphics may not be used in any advertising or\npublicity relating to the software without the specific, prior written\npermission of Sam Leffler and Silicon Graphics.</p>\n<p>THE SOFTWARE IS PROVIDED &quot;AS-IS&quot; AND WITHOUT WARRANTY OF ANY KIND,\nEXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\nWARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.</p>\n<p>IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\nANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\nOR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF\nLIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\nOF THIS SOFTWARE.</p>\n</li>\n<li><p class=\"first\">The C++ API known as &quot;Magick++&quot;, and which resides in the Magick++\ndirectory, is distributed under the following license:</p>\n<p>Copyright 1999 - 2012 Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<p>Permission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation files\n(&quot;Magick++&quot;), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject\nto the following conditions:</p>\n<p>The above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.</p>\n<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\nBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\nACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.</p>\n</li>\n<li><p class=\"first\">The GraphicsMagick HaldClutImagePixels() function in magick/hclut.c\nis based on source code from the HaldCLUT package by Eskil Steenberg\n(<a class=\"reference external\" href=\"http://www.quelsolaar.com/technology/clut.html\">http://www.quelsolaar.com/technology/clut.html</a>) which is\ndistributed under the following license:</p>\n<p>Copyright (c) 2005 Eskil Steenberg.  All rights reserved.</p>\n<p>Redistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:</p>\n<ol class=\"arabic simple\">\n<li>Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.</li>\n<li>Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.</li>\n</ol>\n<p>THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\nNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick makes use of third-party &quot;delegate&quot; libraries to\nsupport certain optional features. These libraries bear their own\ncopyrights and licenses, which may be more or less restrictive than the\nGraphicsMagick license. For convenience, when GraphicsMagick is\nbundled with (or compiled with) &quot;delegate&quot; libraries, a copy of the\nlicenses for these libraries is provided in a &quot;licenses&quot; directory.</p>\n</li>\n</ol>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2018</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/FAQ.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick FAQ</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-faq\">\n<h1 class=\"title\">GraphicsMagick FAQ</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<!-- URL links -->\n<div class=\"contents topic\" id=\"faq-contents\">\n<p class=\"topic-title first\">FAQ Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#how-does-graphicsmagick-differ-from-imagemagick\" id=\"id1\">How does GraphicsMagick differ from ImageMagick?</a></li>\n<li><a class=\"reference internal\" href=\"#how-often-does-graphicsmagick-pick-up-new-code-from-imagemagick\" id=\"id2\">How often does GraphicsMagick pick up new code from ImageMagick?</a></li>\n<li><a class=\"reference internal\" href=\"#are-there-any-plans-to-use-opencl-or-cuda-to-use-a-gpu\" id=\"id3\">Are there any plans to use OpenCL or CUDA to use a GPU?</a></li>\n<li><a class=\"reference internal\" href=\"#what-is-the-meaning-of-magick\" id=\"id4\">What is the meaning of &quot;magick&quot;?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-process-many-files-at-once\" id=\"id5\">How can I process many files at once?</a></li>\n<li><a class=\"reference internal\" href=\"#i-received-the-following-message-delegation-failed-what-does-it-mean\" id=\"id6\">I received the following message, &quot;?????? delegation failed ...&quot;. What does it mean?</a></li>\n<li><a class=\"reference internal\" href=\"#how-do-i-set-the-transparency-index-in-a-gif-image-so-it-displays-properly-within-mozilla\" id=\"id7\">How do I set the transparency index in a GIF image so it displays properly within Mozilla?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-stop-the-filenames-from-changing-in-the-title-bar-of-the-animate-1-image-window\" id=\"id8\">How can I stop the filenames from changing in the title bar of the animate(1) image window?</a></li>\n<li><a class=\"reference internal\" href=\"#the-image-grabbed-by-import-1-does-not-look-like-the-image-on-my-x-server-what-s-wrong\" id=\"id9\">The image grabbed by import(1) does not look like the image on my X server. What's wrong?</a></li>\n<li><a class=\"reference internal\" href=\"#how-do-i-animate-a-digital-yuv-image-sequence\" id=\"id10\">How do I animate a digital YUV image sequence?</a></li>\n<li><a class=\"reference internal\" href=\"#how-do-i-change-the-default-postscript-page-size\" id=\"id11\">How do I change the default <em>PostScript</em> page size?</a></li>\n<li><a class=\"reference internal\" href=\"#i-get-a-memory-allocation-error-what-can-i-do\" id=\"id12\">I get a memory allocation error. What can I do?</a></li>\n<li><a class=\"reference internal\" href=\"#how-do-i-concatenate-three-images-left-to-right-with-no-borders-frames-or-text\" id=\"id13\">How do I concatenate three images left-to-right with no borders, frames, or text?</a></li>\n<li><a class=\"reference internal\" href=\"#how-do-i-create-a-gif-animation-sequence-to-display-within-firefox\" id=\"id14\">How do I create a GIF animation sequence to display within Firefox?</a></li>\n<li><a class=\"reference internal\" href=\"#when-i-display-a-postscript-image-white-borders-are-trimmed\" id=\"id15\">When I display a <em>PostScript</em> image, white borders are trimmed.</a></li>\n<li><a class=\"reference internal\" href=\"#what-are-visual-image-directories-how-do-i-use-them\" id=\"id16\">What are visual image directories? How do I use them?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-include-the-window-frame-when-importing-a-window\" id=\"id17\">How can I include the window frame when importing a window?</a></li>\n<li><a class=\"reference internal\" href=\"#i-displayed-an-image-and-it-appears-as-one-solid-color-what-did-i-do-wrong\" id=\"id18\">I displayed an image and it appears as one solid color. What did I do wrong?</a></li>\n<li><a class=\"reference internal\" href=\"#i-received-the-following-message-library-is-not-available\" id=\"id19\">I received the following message, &quot;???? library is not available...&quot;.</a></li>\n<li><a class=\"reference internal\" href=\"#i-want-to-inspect-the-values-of-the-matte-channel-within-my-image\" id=\"id20\">I want to inspect the values of the matte channel within my image.</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-add-one-of-those-cool-bevels-to-my-image-that-i-see-used-on-the-web\" id=\"id21\">How can I add one of those cool bevels to my image that I see used on the Web?</a></li>\n<li><a class=\"reference internal\" href=\"#i-try-to-launch-display-from-my-window-manager-and-it-fails-what-s-up\" id=\"id22\">I try to launch display from my window manager and it fails. What's up?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-make-postscript-text-look-good\" id=\"id23\">How can I make Postscript text look good?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-annotate-an-image-with-text-that-is-2-to-3-inches-tall\" id=\"id24\">How can I annotate an image with text that is 2 to 3 inches tall?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-convert-my-gif-animation-sequence-to-individual-image-files\" id=\"id25\">How can I convert my GIF animation sequence to individual image files?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-remove-the-background-that-prints-around-my-image-when-i-display-it-with-firefox\" id=\"id26\">How can I remove the background that prints around my image when I display it with Firefox?</a></li>\n<li><a class=\"reference internal\" href=\"#how-do-i-create-a-gif-or-png-image-with-web-safe-colors\" id=\"id27\">How do I create a GIF or PNG image with Web safe colors?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-add-a-matte-layer-to-my-image\" id=\"id28\">How can I add a matte layer to my image?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-draw-with-text-using-convert-under-windows-nt\" id=\"id29\">How can I draw with text using 'convert' under Windows NT?</a></li>\n<li><a class=\"reference internal\" href=\"#why-are-my-jpeg-files-larger-than-expected\" id=\"id30\">Why are my JPEG files larger than expected?</a></li>\n<li><a class=\"reference internal\" href=\"#how-do-i-extract-a-single-image-from-a-multi-image-file\" id=\"id31\">How do I extract a single image from a multi-image file?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-extract-and-combine-cmyk-channels-in-a-cmyk-image\" id=\"id32\">How can I extract and combine CMYK channels in a CMYK image?</a></li>\n<li><a class=\"reference internal\" href=\"#how-can-i-create-a-solid-or-patterned-canvas-image\" id=\"id33\">How can I create a solid or patterned canvas image?</a></li>\n<li><a class=\"reference internal\" href=\"#what-does-identify-report\" id=\"id34\">What does <cite>identify</cite> report?</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"how-does-graphicsmagick-differ-from-imagemagick\">\n<h1><a class=\"toc-backref\" href=\"#id1\">How does GraphicsMagick differ from ImageMagick?</a></h1>\n<p><em>GraphicsMagick</em> is originally based on (forked from) ImageMagick\n5.5.2 in November 2002, from the version distributed by ImageMagick\nStudio LLC, which is itself forked in August 1999 from ImageMagick\ndeveloped by E. I. du Pont de Nemours and Company starting in\n1992. Other than utilities being executed as sub-commands of the 'gm'\ncommand, the command-line syntax and programming APIs remain entirely\nupward compatible with ImageMagick 5.5.2. A better question might be\n&quot;<em>How does ImageMagick differ from ImageMagick?</em>&quot; since ImageMagick\ncontinues to alter and evolve its interfaces so they are no longer\ncompletely compatible with earlier versions. While GraphicsMagick also\nadds new features, it does so in a way which assures that existing\nfeatures work as they did before. ImageMagick focuses on adding new\nfunctionality and features and has dramatically mutated several times\nsince the fork.</p>\n<p>GraphicsMagick maintains a stable release branch, maintains a detailed\nChangeLog, and maintains a stable source repository with complete version\nhistory so that changes are controlled, and changes between releases are\naccurately described. GraphicsMagick provides continued support for a\nrelease branch. ImageMagick does not offer any of these things.</p>\n<p>Since GraphicsMagick is more stable, more time has been spent optimizing\nand debugging its code.</p>\n<p>GraphicsMagick is much smaller than ImageMagick and has dramatically\nfewer dependencies on external libraries. For example, on the FreeBSD\noperating system, a fully-featured install of GraphicsMagick depends\non 36 libraries whereas ImageMagick requires 64.  GraphicsMagick's\ninstallation footprint is 3-5X smaller than ImageMagick.</p>\n<p>GraphicsMagick is usually faster than ImageMagick. The baseline execution\noverhead for simple commands is much lower, and GraphicsMagick is also\nmore efficient at dealing with large images.</p>\n</div>\n<div class=\"section\" id=\"how-often-does-graphicsmagick-pick-up-new-code-from-imagemagick\">\n<h1><a class=\"toc-backref\" href=\"#id2\">How often does GraphicsMagick pick up new code from ImageMagick?</a></h1>\n<p>GraphicsMagick never picks up new code from ImageMagick as distributed\nby ImageMagick Studio LLC. Not long after the GraphicsMagick project\nwas started in November 2002, ImageMagick from ImageMagick Studio LLC\nabandoned the MIT X11 style license it had been using since 1992, and\nswitched between several different licenses until it ended up with one\nbased on the Apache license, which is intended to penalize projects\nwhich borrow some of its source code, or fork from it. Since that\ntime, GraphicsMagick has not incorporated any ImageMagick source code.</p>\n<p>On November 27, 2003 ImageMagick Studio LLC applied to register\n&quot;ImageMagick&quot; as its trademark, and it was awarded this registered\ntrademark (serial number 78333969) on August 30, 2005.  Those who\nre-distribute modified versions of &quot;ImageMagick&quot; (e.g. patched or\nimproved) under license as &quot;ImageMagick&quot; now face the risk of\narbitrary trademark infringement claims by ImageMagick Studio LLC.</p>\n<p>Authors of new features are encouraged to independently contribute\ntheir work to the GraphicsMagick project so that it can be released\nunder GraphicsMagick's MIT X11 style license without additional\nencumberment.  In order for a work to be accepted, it must have been\ndeveloped entirely outside the ImageMagick source base to avoid any\npossibility of copyright taint.</p>\n</div>\n<div class=\"section\" id=\"are-there-any-plans-to-use-opencl-or-cuda-to-use-a-gpu\">\n<h1><a class=\"toc-backref\" href=\"#id3\">Are there any plans to use OpenCL or CUDA to use a GPU?</a></h1>\n<p>It is well known that some math-intensive algorithms run very quickly\non video-card (and stand-alone) GPUs.  Video card vendors encourage\nyou to buy an expensive video card with quite a lot of installed RAM\nand modify applications to use the GPU via their proprietary or\nlimited-purpose APIs.  GPUs are quite effective at producing images\nfor real-time display, such as for video games and virtual reality.\nGraphicsMagick has been significantly updated to use multiple CPU\ncores to speed up the image processing, and work continues to thread\nthe few remaining algorithms, or remove inefficiencies in algorithms\nwhich don't see as much speed-up as they should.  Linear speedup as\ncores are added is typical for CPU-bound algorithms on well-designed\nCPUs.  Regardless, <a class=\"reference external\" href=\"http://en.wikipedia.org/wiki/Amdal%27s_law\">Amdahl's law</a> is a significant factor\nin GraphicsMagick, with non-parallelizable code paths often dominating\nthe time.</p>\n<p>It is my belief that stand-alone GPUs are a poor design (expensive,\ninefficient, failure-prone, bandwidth bottlenecked, lack\nfunctionality, are insecure, and are not supported in servers) and\nthat multi-core CPUs will ultimately prevail.  Functionality which\ncurrently works best in a GPU will simply be integrated into\ntomorrow's multi-core CPUs and C compilers will naturally support that\nfunctionality.  Once GPU capabilities are integrated into CPUs, there\nwill be no more need to develop specialized code for a GPU.  Today 16\ncore CPUs are readily available for purchase in systems at reasonable\nprices, and this trend is certain to continue.</p>\n<p>Intel's <a class=\"reference external\" href=\"http://en.wikipedia.org/wiki/Xeon_Phi\">Xeon Phi</a> offers a\n61 core 'x86 CPU in a GPU-like plugin form-factor which provides over\na TeraFLOP of performance.  Being based on power-hungry plug-in cards,\nthis solution suffers from many of the issues associated with GPUs.\nHowever, since it supports OpenMP, it may be a suitable target for\nexecuting some GraphicsMagick algorithms. Effective use of Xeon Phi\ncurrently requires use of Intel's development tools so from that\nstandpoint it is not much more open than GPUs.</p>\n<p>Future multi-core CPUs will use a similar amount of power to today's\nCPUs, will idle at very low power consumption levels, and will fit\ninto a very small chassis.  Due to this trend, there is no value\nobtained by expending energy toward developing specialized code for\ntoday's GPUs.</p>\n</div>\n<div class=\"section\" id=\"what-is-the-meaning-of-magick\">\n<h1><a class=\"toc-backref\" href=\"#id4\">What is the meaning of &quot;magick&quot;?</a></h1>\n<p>According to the infamous British accultist <a class=\"reference external\" href=\"http://en.wikipedia.org/wiki/Aleister_Crowley\">Aleister Crowley</a>, the definition of\n<a class=\"reference external\" href=\"http://en.wikipedia.org/wiki/Magick_(Aleister_Crowley)\">magick</a> is\n&quot;the science and art of causing change to occur in conformity with the\nwill&quot;.</p>\n</div>\n<div class=\"section\" id=\"how-can-i-process-many-files-at-once\">\n<h1><a class=\"toc-backref\" href=\"#id5\">How can I process many files at once?</a></h1>\n<p>Use 'gm mogrify'.  The 'mogrify' subcommand is designed to operate on\nany number of files in one command.  Normally 'mogrify' overwrites the\ninput files but the <cite>-output-directory</cite> option (which must appear\nbefore any input file names!) allows sending the modified files to a\ndifferent directory (which could be in a subdirectory).  For example:</p>\n<pre class=\"literal-block\">\ngm mogrify -output-directory .thumbs -resize 320x200 *.jpg\n</pre>\n<p>If you encounter command line length limitations then you can have\nGraphicsMagick expand the file list by quoting the wildcard argument\nto prevent it from being expanded by your command shell:</p>\n<pre class=\"literal-block\">\ngm mogrify -output-directory .thumbs -resize 320x200 &quot;*.jpg&quot;\n</pre>\n<p>and you can also retrieve a list of files to process from a text file\n(e.g. named 'files.txt') like:</p>\n<pre class=\"literal-block\">\ngm mogrify -output-directory .thumbs -resize 320x200 &#64;files.txt\n</pre>\n<p>where files.txt has one line per file name.  If the input file paths\ncontain relative sub-directory paths (e.g. &quot;foo/file1&quot;, &quot;bar/file2&quot;),\nyou can instruct GraphicsMagick to create a similar subdirectory\nstructure under the output directory by adding the\n<cite>-create-directories</cite> option:</p>\n<pre class=\"literal-block\">\ngm mogrify -output-directory .thumbs -create-directories -resize 320x200 &#64;files.txt\n</pre>\n<p>Note that the algorithm used to generate output file names is quite\nsimple.  If -output-directory is &quot;/foo&quot; and the file path is\n&quot;bar/none.jpg&quot; then the final path will be &quot;foo/bar/none.jpg&quot;.  Based\non this it should be clear that when <cite>-output-directory</cite> is used, file\npaths should be relative paths rather than absolute paths or else the\nconcatenation won't work.</p>\n</div>\n<div class=\"section\" id=\"i-received-the-following-message-delegation-failed-what-does-it-mean\">\n<h1><a class=\"toc-backref\" href=\"#id6\">I received the following message, &quot;?????? delegation failed ...&quot;. What does it mean?</a></h1>\n<p><em>GraphicsMagick</em> uses several freely available packages to perform the\ntranslation of certain image formats (<em>PostScript</em>, <em>MPEG</em>, etc.). Make\nsure these packages are available as described in the <a class=\"reference external\" href=\"README.html\">README</a> file. Also\nverify that you have plenty of temporary disk space. If not, set the\nMAGICK_TMPDIR (or TMPDIR) environment variable to an area where\nsufficient space is available. Finally, for <em>PostScript</em>, verify that\nGhostscript supports the <em>pnmraw</em> or <em>ppmraw</em> device (<tt class=\"docutils literal\">gs <span class=\"pre\">-h</span></tt>) and that\nthe document contains valid <em>PostScript</em> statements (<tt class=\"docutils literal\">gs image.ps</tt>).</p>\n</div>\n<div class=\"section\" id=\"how-do-i-set-the-transparency-index-in-a-gif-image-so-it-displays-properly-within-mozilla\">\n<h1><a class=\"toc-backref\" href=\"#id7\">How do I set the transparency index in a GIF image so it displays properly within Mozilla?</a></h1>\n<p>Display your GIF image with <a class=\"reference external\" href=\"display.html\">display</a>. Choose <em>Matte</em> from the <em>Image\nEdit</em> command menu and identify a pixel that has the <em>transparency</em>\ncolor. Press <em>Method</em> and select a matte edit method from a pop-up menu.\nChoose from these methods:</p>\n<ul class=\"simple\">\n<li>point</li>\n<li>replace</li>\n<li>floodfill</li>\n</ul>\n<p>The <em>point</em> method changes the matte value of any pixel selected with the\npointer until the button is is released. The <em>replace</em> method changes the\nmatte value of any pixel that matches the color of the pixel you select\nwith a button press. <em>Floodfill</em> changes the matte value of any pixel\nthat matches the color of the pixel you select with a button press and is\na neighbor.</p>\n<p>Select your transparent pixel with the pointer and press a button. The\nimage is redisplayed with any transparent pixels recolored to the\nbackground color. You can select other pixels or areas to force to\ntransparent. When you are satisfied, press Return.</p>\n<p>Finally, choose <em>Save</em> from the command menu and write your GIF image to\na file. <strong>Note that setting transparency works best on a TrueColor or\nDirectColor visual</strong>. If your server only exports colormapped visuals you\nwill need to use a <em>Standard Colormap</em> to set transparency.</p>\n<pre class=\"literal-block\">\nxstdcmap -best\ngm display -map list image.gif\n[ choose Matte Edit ]\n[ select your transparent pixel then press Return ]\n[ choose Save '\n</pre>\n<p>If you do not have the <em>xstdcmap(1)</em> program, try</p>\n<pre class=\"literal-block\">\ngm display -visual TrueColor image.gif\n</pre>\n</div>\n<div class=\"section\" id=\"how-can-i-stop-the-filenames-from-changing-in-the-title-bar-of-the-animate-1-image-window\">\n<h1><a class=\"toc-backref\" href=\"#id8\">How can I stop the filenames from changing in the title bar of the animate(1) image window?</a></h1>\n<p><a class=\"reference external\" href=\"animate.html\">Animate</a> updates the image file name in the title bar of the image window\nas each image is displayed from the image sequence. To display just a\nsingle name that will not change, use <em>-title</em>:</p>\n<pre class=\"literal-block\">\ngm animate -title &quot;My Image Sequence&quot; images.\n</pre>\n</div>\n<div class=\"section\" id=\"the-image-grabbed-by-import-1-does-not-look-like-the-image-on-my-x-server-what-s-wrong\">\n<h1><a class=\"toc-backref\" href=\"#id9\">The image grabbed by import(1) does not look like the image on my X server. What's wrong?</a></h1>\n<p>Use the <em>-descend</em> option:</p>\n<pre class=\"literal-block\">\ngm import -descend image.miff\n</pre>\n<p>or set this X resource:</p>\n<pre class=\"literal-block\">\ngm import.descend: True\n</pre>\n<p>By default, <a class=\"reference external\" href=\"import.html\">import</a> quickly grabs the image from the X server. However,\nit may not always have the correct colors in some areas. This can happen\nwhen a subwindow has a different colormap than its parent. With\n<em>-descend</em>, <a class=\"reference external\" href=\"import.html\">import</a> descends the window hierarchy. Descending involves\ngrabbing the image and colormap of each window or subwindow associated\nwith the window you select and compositing it on a blank canvas. This can\nbe significantly slower than just grabbing the top-level window but\nensures the correct image.</p>\n</div>\n<div class=\"section\" id=\"how-do-i-animate-a-digital-yuv-image-sequence\">\n<h1><a class=\"toc-backref\" href=\"#id10\">How do I animate a digital YUV image sequence?</a></h1>\n<p>Suppose your sequence is 72 352x240 frames titled frame0.Y, frame0.U,\nframe0.V, frame1.Y, frame1.U, etc. Use this command:</p>\n<pre class=\"literal-block\">\ngm animate -geometry 352x240 -scene 0-71 yuv3:frame%d\n</pre>\n</div>\n<div class=\"section\" id=\"how-do-i-change-the-default-postscript-page-size\">\n<h1><a class=\"toc-backref\" href=\"#id11\">How do I change the default <em>PostScript</em> page size?</a></h1>\n<p>The default dimensions of a <em>PostScript</em> page is 612x792. If you prefer\nanother default, change the page geometries (PSPageGeometry) in\n<cite>magick/image.h</cite> and recompile.</p>\n</div>\n<div class=\"section\" id=\"i-get-a-memory-allocation-error-what-can-i-do\">\n<h1><a class=\"toc-backref\" href=\"#id12\">I get a memory allocation error. What can I do?</a></h1>\n<p>Memory allocation is a complex topic in GraphicsMagick and image\nprocessing requires a lot of memory. GraphicsMagick tries to take best\nadvantage of the resources available by optimizing its use of <em>virtual</em>\nmemory. Virtual memory is normally the amount of RAM (Random Access\nMemory) available to the process plus the amount of free space in the\nsystem paging area (known as &quot;swap&quot; under Unix, or a &quot;page file&quot; under\nWindows). In addition to the RAM and the paging area, GraphicsMagick is\nable to expand the amount of virtual memory available by using\nmemory-mapped files which cause the file to be treated as extra memory. A\npiece of hardware known as the Memory Management Unit (MMU) performs the\nmagic which allows the system paging area and memory-mapped files to be\ntreated as more memory by your system's CPU.</p>\n<p>Usually when a memory allocation error occurs, it is because the system's\npaging area is full, or the programs memory (heap) is fragmented badly\nenough that there is no large-enough block of memory available to satisfy\nthe request. In some cases the operating system may artificially limit\nthe memory available to the program. Failures of small memory allocations\nare generally considered fatal by GraphicsMagick. If it is impossible to\nallocate even a little bit of memory, then there is no point in\ncontinuing. When large memory allocations associated with allocating\nmemory for image pixels fail, GraphicsMagick uses that as a key to know\nthat it should start using memory-mapped temporary files to increase\nvirtual memory. Under Unix and other POSIX-compliant systems, these\nmemory-mapped temporary files are created in either the system default\nlocation (e.g. <cite>/var/tmp</cite>) or the directory set by the TMPDIR environment\nvariable. Under Windows, temporary files are created in the directory set\nby the TEMP or TMP environment variable. Use the MAGICK_TMPDIR\nenvironment variable to specify a directory for GraphicsMagick to write\nits temporary files.</p>\n<p>If the temporary file directory is too small, or is itself mapped to the\nsystem's paging area (no win!), then GraphicsMagick will fail to allocate\nmore virtual memory via the temporary file and will return an error.</p>\n<p>The single biggest factor in how much memory is required by\nGraphicsMagick is the QuantumDepth setting when it was compiled. The\namount of memory (in bytes) required to store a single image in memory is\nmay be calculated via the equation (QuantumDepth*Rows*Columns*5)/8. As a\nmeans of example, the following table shows the amount of memory consumed\nby a single 1024x768 image using the supported QuantumDepth settings:</p>\n<blockquote>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"46%\" />\n<col width=\"54%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">QuantumDepth</th>\n<th class=\"head\">Virtual Memory</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>8</td>\n<td>3MB</td>\n</tr>\n<tr><td>16</td>\n<td>8MB</td>\n</tr>\n<tr><td>32</td>\n<td>15MB</td>\n</tr>\n</tbody>\n</table>\n</blockquote>\n<p>Performing an image processing operation may require that several images\nbe in memory at one time. In the case of animations, hundreds of images\nmay be in memory at one time.</p>\n<p><em>GraphicsMagick</em> is designed to be general purpose. It can display many\nimage storage formats (<em>Monochrome</em>, <em>PseudoColor</em>, or <em>TrueColor</em>) on\nmany different types of X visuals (<em>StaticGray, StaticColor, PseudoColor,\nGrayScale, DirectColor,</em> or <em>TrueColor</em>). To support all these\ncombinations of image storage formats and X visuals, extra memory is\nrequired. Additionally, <a class=\"reference external\" href=\"animate.html\">animate</a> and <a class=\"reference external\" href=\"montage.html\">montage</a> store an entire image\nsequence in memory.</p>\n<p>It is recommended that systems used to run <em>GraphicsMagick</em> have at least\n96MB of RAM and 140MB free in their paging area. Systems used to process\nlarge images (do the math!) may require considerably more memory to\noperate efficiently. GraphicsMagick is proven to be far more efficient at\nprocessing huge images when it is compiled as a 64-bit application on a\n64-bit capable CPU. RAM is typically 1000 times faster than disk, so it\nis important to keep as much data in RAM as possible (buy lots of RAM).\nThe temporary file area should have plenty of free space. The size of the\ntemporary file area is usually the deciding factor as to whether\nGraphicsMagick is able to complete an operation. With sufficient free\ndisk space, GraphicsMagick is primarily limited by your CPU, your\noperating system's ability to address memory, and your degree of\npatience. GraphicsMagick has been used to process RGB images 64K by 64K\npixels in size!</p>\n</div>\n<div class=\"section\" id=\"how-do-i-concatenate-three-images-left-to-right-with-no-borders-frames-or-text\">\n<h1><a class=\"toc-backref\" href=\"#id13\">How do I concatenate three images left-to-right with no borders, frames, or text?</a></h1>\n<p>Assume your three images are called image1.ppm, image2.ppm, and\nimage3.ppm. Type</p>\n<pre class=\"literal-block\">\ngm montage -mode concatenate -tile 3x1 image1.ppm image2.ppm \\\n  image3.ppm concatenated.miff\n</pre>\n<p>To concatenate the images top-to-bottom, use -tile 1x3.</p>\n<p>For more control over the placement of an image, use <a class=\"reference external\" href=\"composite.html\">composite</a>. First\ncreate a matte image and position your images onto the matte. For\nexample,</p>\n<pre class=\"literal-block\">\ngm convert -size 350x500 xc:black composite.miff\ngm composite -geometry +0+0 composite.miff image1.gif composite.miff\ngm composite -geometry &quot;+1&quot;00+0 composite.miff image2.gif composite.miff\ngm composite -geometry +0+300 composite.miff image3.gif composite.miff\ngm composite -geometry +0+375 composite.miff image4.gif composite.miff\n</pre>\n</div>\n<div class=\"section\" id=\"how-do-i-create-a-gif-animation-sequence-to-display-within-firefox\">\n<h1><a class=\"toc-backref\" href=\"#id14\">How do I create a GIF animation sequence to display within Firefox?</a></h1>\n<p>Use <a class=\"reference external\" href=\"convert.html\">convert</a> with the <em>-delay</em> and <em>-page</em> options. The <em>-delay</em> option\nis used to specify the delay in <em>1/100ths of a second</em> between the\ndisplay of each frame of the animation. For example,</p>\n<pre class=\"literal-block\">\ngm convert -delay 20 frame*.gif animation.gif\n</pre>\n<p>You can also declare specific delays for each frame of the image\nsequence. For example, if the delay was 20, 10, and 5, use</p>\n<pre class=\"literal-block\">\ngm convert -delay 20 frame1.gif -delay 10 frame2.gif \\\n  -delay 5 frame3.gif animation.gif\n</pre>\n<p>Use <em>-page</em> to specify the <em>left</em> and <em>top</em> locations of the image frame</p>\n<pre class=\"literal-block\">\ngm convert frame1.gif -page +50&quot;+1&quot;00 frame2.gif -page +0&quot;+1&quot;00 \\\n  frame3.gif animation.gif\n</pre>\n<p>Finally, if you want the image to loop within <em>FireFox</em>, use <em>-loop</em></p>\n<pre class=\"literal-block\">\ngm convert -loop 50 frame*.gif animation.gif\n</pre>\n<p>Note, that all the images are composited into a single multi-image GIF\nanimation. If you want a single image produced for each frame, use\n<em>+adjoin</em></p>\n<pre class=\"literal-block\">\ngm convert +adjoin images.* frames%d.gif\n</pre>\n</div>\n<div class=\"section\" id=\"when-i-display-a-postscript-image-white-borders-are-trimmed\">\n<h1><a class=\"toc-backref\" href=\"#id15\">When I display a <em>PostScript</em> image, white borders are trimmed.</a></h1>\n<p><em>GraphicsMagick</em> automatically trims any <em>PostScript</em> image as defined by\nthe bounding box. To preempt this behavior, remove the bounding box\nstatement from the <em>Postscript</em> or explicitly set the page size. For\nexample,</p>\n<pre class=\"literal-block\">\ngm display -page letter image.ps\n</pre>\n</div>\n<div class=\"section\" id=\"what-are-visual-image-directories-how-do-i-use-them\">\n<h1><a class=\"toc-backref\" href=\"#id16\">What are visual image directories? How do I use them?</a></h1>\n<p>A visual image directory (VID) is an image that contains thumbnails of\none or more images in a file directory. Rather than displaying each\nindividual image at its full resolution, you can browse the visual image\ndirectory and choose an image to display. You can create a VID with\neither of these commands:</p>\n<pre class=\"literal-block\">\ngm montage *.jpg directory.vid\ngm convert 'vid:*.jpg' directory.vid\n</pre>\n<p>Of course you can substitute any filenames you desire. <a class=\"reference external\" href=\"montage.html\">Montage</a> has many\nrelevant command line options. You can exercise more control over the\nappearance of the VID than with <a class=\"reference external\" href=\"convert.html\">convert</a>.</p>\n<p>Next display the directory:</p>\n<pre class=\"literal-block\">\ngm display directory.vid\n</pre>\n<p>Finally browse and select an image to display. Move the pointer to the\nimage and press button 3.</p>\n<p>You can create the VID directory with this command:</p>\n<pre class=\"literal-block\">\ngm display 'vid:*.jpg'\n</pre>\n<p>You can also select <em>Visual Image...</em> from the <em>File</em> menu of the command\nwidget.</p>\n<p><em>Note, that creating a VID is time consuming</em>. Creating them on-the-fly\nwithin <a class=\"reference external\" href=\"display.html\">display</a> may be less convenient than using <a class=\"reference external\" href=\"montage.html\">montage</a> or <a class=\"reference external\" href=\"convert.html\">convert</a> .\nAlso, if you create them with <a class=\"reference external\" href=\"montage.html\">montage</a>. or <a class=\"reference external\" href=\"convert.html\">convert</a>, you can reuse them\nas often as necessary.</p>\n<p>Note that a visual image directory is useful for looking at individual\nframes of an image sequence:</p>\n<pre class=\"literal-block\">\ngm display vid:movie.mpg\n</pre>\n</div>\n<div class=\"section\" id=\"how-can-i-include-the-window-frame-when-importing-a-window\">\n<h1><a class=\"toc-backref\" href=\"#id17\">How can I include the window frame when importing a window?</a></h1>\n<p>I use the window ID reported by <em>xwininfo(1)</em> with import and it does not\ninclude the window manager frame as expected. How can I save the window\nwith its frame?</p>\n<p>By default, <em>xwininfo(1)</em> returns the ID of the window you click on. Use\nthe <em>-frame</em> option to get the reparented window ID:</p>\n<pre class=\"literal-block\">\nxwininfo -frame\n</pre>\n<p>You can then use the returned window ID with <a class=\"reference external\" href=\"import.html\">import</a>:</p>\n<pre class=\"literal-block\">\ngm import -frame -window ID window.miff\n</pre>\n</div>\n<div class=\"section\" id=\"i-displayed-an-image-and-it-appears-as-one-solid-color-what-did-i-do-wrong\">\n<h1><a class=\"toc-backref\" href=\"#id18\">I displayed an image and it appears as one solid color. What did I do wrong?</a></h1>\n<p>A blank image generally means that the image is either corrupt or it has\na matte channel and the matte values are all zero. <em>GraphicsMagick</em>\ntreats a matte value of zero as completely transparent. To determine if\nthis is the problem, try</p>\n<pre class=\"literal-block\">\ngm display +matte image.miff\n</pre>\n</div>\n<div class=\"section\" id=\"i-received-the-following-message-library-is-not-available\">\n<h1><a class=\"toc-backref\" href=\"#id19\">I received the following message, &quot;???? library is not available...&quot;.</a></h1>\n<p><em>GraphicsMagick</em> requires source libraries not included with the\ndistribution to view or convert certain image formats such as JPEG or\nTIFF. The above message means you did not compile the required library\nand link with the <em>GraphicsMagick</em> utilities. See <a class=\"reference external\" href=\"README.html\">README</a> for the\nlocation of these libraries and compiling instructions.</p>\n</div>\n<div class=\"section\" id=\"i-want-to-inspect-the-values-of-the-matte-channel-within-my-image\">\n<h1><a class=\"toc-backref\" href=\"#id20\">I want to inspect the values of the matte channel within my image.</a></h1>\n<p>View the matte image as a gray scale image. Suppose you have a TIFF image\nthat has a matte channel and is 640 pixels in width and 480 in height.\nType:</p>\n<pre class=\"literal-block\">\ngm convert image.tiff image.matte\ngm display -size 640x480 gray:image.matte\n</pre>\n</div>\n<div class=\"section\" id=\"how-can-i-add-one-of-those-cool-bevels-to-my-image-that-i-see-used-on-the-web\">\n<h1><a class=\"toc-backref\" href=\"#id21\">How can I add one of those cool bevels to my image that I see used on the Web?</a></h1>\n<p>There are four types of ornamental borders you can add to your image\nwith GraphicsMagick. Each is listed below with the procedure to use\nthem with your image.</p>\n<ul>\n<li><p class=\"first\">Surround the image with a border of color</p>\n<p>Use -border followed by the width and height of the border. Set the\ncolor of the border with -bordercolor. For example, to surround your\nimage with a red border that is 25 pixels wide on each side, use</p>\n<pre class=\"literal-block\">\ngm convert -bordercolor red -border 25x25 image.jpg image.gif\n</pre>\n</li>\n<li><p class=\"first\">Lighten or darken image edges to create a 3-D effect</p>\n<p>Use -raise followed by the width of the image edge. For example, to\ncreate a raised edge effect of 25 pixels, use</p>\n<pre class=\"literal-block\">\ngm convert -raise 25 image.jpg image.gif\n</pre>\n</li>\n<li><p class=\"first\">Surround the image with an ornamental frame</p>\n<p>Use -frame followed by the width and height of the frame. Set the\ncolor of the border with -mattecolor. For example, to surround your\nimage with a gray frame that is 25 pixels wide on each side, use</p>\n<pre class=\"literal-block\">\ngm convert -mattecolor gray -frame 25x25 image.jpg image.gif\n</pre>\n</li>\n<li><p class=\"first\">Surround the image with a raised or sunken bevel</p>\n<p>Use -frame followed by the width and height of the bevel. Set the\ncolor of the border with -mattecolor. This is just like the\ndescription above except you specify a bevel width that matches the\nframe width. For example, to surround your image with a gray bevel\nthat is 25 pixels wide on each side, use</p>\n<pre class=\"literal-block\">\ngm convert -mattecolor gray -frame 25x25+0+25 image.jpg image.gif\ngm convert -mattecolor gray -frame 25x25+25+0 image.jpg image.gif\n</pre>\n</li>\n</ul>\n</div>\n<div class=\"section\" id=\"i-try-to-launch-display-from-my-window-manager-and-it-fails-what-s-up\">\n<h1><a class=\"toc-backref\" href=\"#id22\">I try to launch display from my window manager and it fails. What's up?</a></h1>\n<p><a class=\"reference external\" href=\"display.html\">Display</a> determines if it is executing interactively and behaves\ndifferently depending on the result. To convince display &lt;display.html&gt;\nyou are running in an interactive environment when launching from a\nwindow manager, use either of</p>\n<pre class=\"literal-block\">\ndisplay logo:Untitled\ndisplay &lt; /dev/console\n</pre>\n<p>Note that this issue no longer exists as of GraphicsMagick 1.2.</p>\n</div>\n<div class=\"section\" id=\"how-can-i-make-postscript-text-look-good\">\n<h1><a class=\"toc-backref\" href=\"#id23\">How can I make Postscript text look good?</a></h1>\n<p>Simple. Increase the dots-per-inch when converting and sub-sample:</p>\n<pre class=\"literal-block\">\ngm convert -density 288 -geometry 25% image.ps image.gif\n</pre>\n<p>Change the density to 144 and geometry to 50% if the above command fails\ndue to insufficient memory. Alternatively, see the Ghostscript\ndocumentation about using high-quality fonts.</p>\n<p>The -density option increases the number of pixels (or dots) generated by\nGhostscript when processing the input postscript file. However as all\nother images formats are generally displayed on screens which are\ntypically about 72 to 100 dots per inch, the output image will be larger.</p>\n<p>The <em>-geometry</em> option reduces the large image output of ghostscript\nimage back to a normal 72 dpi resolution (25% of 288 dpi gives 72 dpi)\nbut in the process anti-aliases (or smooths) the fonts and lines of the\nimage so as to remove the jaggies you would otherwise get from a normal\npostscript to image conversion.</p>\n</div>\n<div class=\"section\" id=\"how-can-i-annotate-an-image-with-text-that-is-2-to-3-inches-tall\">\n<h1><a class=\"toc-backref\" href=\"#id24\">How can I annotate an image with text that is 2 to 3 inches tall?</a></h1>\n<p>If you do not access to a particular named font that is large, try\nscalable fonts. First see if you have any scalable fonts. Type</p>\n<pre class=\"literal-block\">\nxlsfonts -fn '*-0-0-0-0-*'\n</pre>\n<p>Or if you are using <a class=\"reference external\" href=\"display.html\">display</a>, use the font pattern above within the Font\nBrowser (see Image Edit-&gt;Annotate). Next substitute the appropriate\nresolution. Keep in mind that a scalable font must be fully qualified to\nwork. That is, all 14 fields must be specified. Here is one example where\nwe annotate an image with large <em>Helvetica</em> text:</p>\n<pre class=\"literal-block\">\ngm convert -font '-*-helvetica-*-*-*--300-300-*-*-*-*-iso8859-1' \\\n  -fill green -draw 'text 50,300 Magick' image.gif annotated.gif\n</pre>\n<p>If you have the FreeType support built into GraphicsMagick, just\nincrease your pointsize and/or density:</p>\n<pre class=\"literal-block\">\ngm convert -font Helvetica -pointsize 100 -density 300 ...\n</pre>\n</div>\n<div class=\"section\" id=\"how-can-i-convert-my-gif-animation-sequence-to-individual-image-files\">\n<h1><a class=\"toc-backref\" href=\"#id25\">How can I convert my GIF animation sequence to individual image files?</a></h1>\n<p>Use the scene embedded file format with <a class=\"reference external\" href=\"convert.html\">convert</a>:</p>\n<pre class=\"literal-block\">\ngm convert animation.gif +adjoin frame%02d.gif\n</pre>\n<p>The resulting image files are titled frame01.gif, frame02.gif,\nframe03.gif, etc.</p>\n</div>\n<div class=\"section\" id=\"how-can-i-remove-the-background-that-prints-around-my-image-when-i-display-it-with-firefox\">\n<h1><a class=\"toc-backref\" href=\"#id26\">How can I remove the background that prints around my image when I display it with Firefox?</a></h1>\n<p>Use the +page option of the <a class=\"reference external\" href=\"convert.html\">convert</a> command:</p>\n<pre class=\"literal-block\">\ngm convert +page alpha.gif beta.gif\n</pre>\n<p>GIF allows for a page offset relative to some background. The page\noffset information may have been in your GIF image already or it\ncould have been introduced by GraphicsMagick. Either way, +page\nremoves the unwanted page offset and FireFox should behave as\nexpected.</p>\n</div>\n<div class=\"section\" id=\"how-do-i-create-a-gif-or-png-image-with-web-safe-colors\">\n<h1><a class=\"toc-backref\" href=\"#id27\">How do I create a GIF or PNG image with Web safe colors?</a></h1>\n<p>Web safe colors are not normally needed any more since almost all\ncomputers now have true color displays. However, this FAQ may still be\nuseful since it demonstrates how a colormap from an image may be\napplied to another image..</p>\n<p>Use the -map option of the <a class=\"reference external\" href=\"convert.html\">convert</a> command:</p>\n<pre class=\"literal-block\">\ngm convert -map netscape: alpha.gif beta.gif\n</pre>\n<p>Netscape predefines 216 colors for colormapped displays. Use the above\ncommand to ensure only these predefined colors are used. Otherwise\nNetscape dithers your image with varying degrees of image fidelity.</p>\n</div>\n<div class=\"section\" id=\"how-can-i-add-a-matte-layer-to-my-image\">\n<h1><a class=\"toc-backref\" href=\"#id28\">How can I add a matte layer to my image?</a></h1>\n<p>One way is to use a bitmap as your transparency mask First, use the\n-matte option to add an all-opaque opacity channel, then use the\ncomposite utility to copy the graylevel samples from the mask file\ninto your new opacity channel:</p>\n<pre class=\"literal-block\">\ngm convert image.gif -matte temp.miff\ngm composite -compose CopyOpacity mask.xbm temp.miff transparent.gif\n</pre>\n<p>Note, GIF is limited to one transparent color. If your mask has\nvariable opacity, use a format like MIFF, TIFF, or PNG as your output\nimage format.</p>\n</div>\n<div class=\"section\" id=\"how-can-i-draw-with-text-using-convert-under-windows-nt\">\n<h1><a class=\"toc-backref\" href=\"#id29\">How can I draw with text using 'convert' under Windows NT?</a></h1>\n<p>The problem is that NT interprets the command line differently than\nUnix does, causing the documented command to fail. The following\ncommand has been reported to work correctly (all on one line):</p>\n<pre class=\"literal-block\">\ngm convert -font Arial -fill blue -draw &quot;text 10,10 'your text here'&quot; \\\n   d:\\test.tif png:d:\\test.png\n</pre>\n<p>and here is another example which is reported to work (which relies\non Ghostscript's 'gs' program to installed):</p>\n<pre class=\"literal-block\">\ngm convert.exe -pointsize 18 -draw &quot;text 0,0 &quot;This is my text!&quot;&quot; \\\n  C:\\blank.gif c:\\text.gif\n</pre>\n</div>\n<div class=\"section\" id=\"why-are-my-jpeg-files-larger-than-expected\">\n<h1><a class=\"toc-backref\" href=\"#id30\">Why are my JPEG files larger than expected?</a></h1>\n<p>Your JPEG files may contain embedded &quot;profiles&quot; such as Exif or IPTC,\nor they may contain uncompressed thumbnails. You can use the <cite>+profile\n&quot;*&quot;</cite> commandline option or an equivalent API method to remove them.</p>\n</div>\n<div class=\"section\" id=\"how-do-i-extract-a-single-image-from-a-multi-image-file\">\n<h1><a class=\"toc-backref\" href=\"#id31\">How do I extract a single image from a multi-image file?</a></h1>\n<p>Use a square-bracket syntax to indicate which frame or frames you\nwant. For example,</p>\n<pre class=\"literal-block\">\ngm convert &quot;Image.gif[0]&quot; first.gif\n</pre>\n<p>Will extract the first image (scene 0) from a GIF animation. Be sure\nto surround the file specification with quotation marks, to prevent\nthe shell from interpreting the square brackets.</p>\n</div>\n<div class=\"section\" id=\"how-can-i-extract-and-combine-cmyk-channels-in-a-cmyk-image\">\n<h1><a class=\"toc-backref\" href=\"#id32\">How can I extract and combine CMYK channels in a CMYK image?</a></h1>\n<p>GraphicsMagick 1.2.2 and later support combining multiple channels in of\nany image file format in order to create a CMYK image file.  For example,\nstarting with a CMYK JPEG file, we can create a set of separate files\nwith one file per channel:</p>\n<pre class=\"literal-block\">\ngm convert cmyk.jpg -channel cyan cyan.tiff\ngm convert cmyk.jpg -channel magenta magenta.tiff\ngm convert cmyk.jpg -channel yellow yellow.tiff\ngm convert cmyk.jpg -channel black black.tiff\n</pre>\n<p>and then we can join them back together:</p>\n<pre class=\"literal-block\">\ngm composite -compose CopyMagenta magenta.tiff cyan.tiff result.tiff\ngm composite -compose CopyYellow yellow.tiff result.tiff result.tiff\ngm composite -compose CopyBlack black.tiff result.tiff result.tiff\n</pre>\n<p>Perhaps it is possible to accomplish this in one composite command. We\nwill leave that as an exercise for later. Note that it is possible to\nextract just one channel, manipulate it, and then insert it back into the\noriginal image file.</p>\n<p>There is also built-in support for a <em>Partition</em> interlace format which\ncan split to a set of files, and join a set of files, but the only\nsupported format is a raw format which is not easy to deal with.</p>\n</div>\n<div class=\"section\" id=\"how-can-i-create-a-solid-or-patterned-canvas-image\">\n<h1><a class=\"toc-backref\" href=\"#id33\">How can I create a solid or patterned canvas image?</a></h1>\n<p>Canvas images may be created using the 'XC:' or 'TILE:' pseudo-image\nformats. XC produces solid color images based on an color you specify\nwhile TILE produces a tiled image based on an an image you specify. Both\nof these require that the desired size be specified, and the desired\nimage type may be specified as well.</p>\n<p>To create a solid red canvas image:</p>\n<pre class=\"literal-block\">\ngm convert -size 640x480 xc:red canvas.tiff\n</pre>\n<p>or using hex syntax to specify the color:</p>\n<pre class=\"literal-block\">\ngm convert -size 640x480 &quot;xc:#f00&quot; canvas.tiff\n</pre>\n<p>To create a solid red canvas image using truecolor pixels:</p>\n<pre class=\"literal-block\">\ngm convert -size 640x480 -type TrueColor xc:red canvas.tiff\n</pre>\n<p>To create a patterned canvas image using a built-in crosshatch pattern:</p>\n<pre class=\"literal-block\">\ngm convert -size 640x480 tile:image:CROSSHATCH45 canvas.tiff\n</pre>\n<p>To create a patterned canvas image using a user-supplied image:</p>\n<pre class=\"literal-block\">\ngm convert -size 640x480 tile:myimage.tiff canvas.tiff\n</pre>\n</div>\n<div class=\"section\" id=\"what-does-identify-report\">\n<h1><a class=\"toc-backref\" href=\"#id34\">What does <cite>identify</cite> report?</a></h1>\n<p>GraphicsMagick is sophisticated image handling software supporting\nperhaps a hundred formats, and hundreds of subformats, yet it needs to\nbe able to apply image processing algorithms in a consistent way, and\nsave to many output formats.  Some image types are radically different\nfrom others.  Due to this, GraphicsMagick normalizes images it reads\ninto only nine internal in-memory formats (see the description of\n-type) which are a specialization of just two internal formats.  The\n<cite>identify</cite> command reports the characteristics of one of those\ninternal formats rather than the genuine properties of the input image\nfile.  In fact, if the properties of all the input files were to be\nreported, it would require a book to describe all of the properties.\nFor example, the WMF vector-drawing format is much different from the\nPNG image file format, yet GraphicsMagick can read both.</p>\n<p>Only limited original properties are preserved, and it depends on how\nGraphicsMagick was built.  For example, a &quot;Q8&quot; build can only report\nup to a depth of 8 bits, but a &quot;Q32&quot; build can report a depth of up to\n32 bits.  The original image depth is reported if it is at least 8\nbits, and equal to or less than the build depth.</p>\n<p>By default <cite>identify</cite> reports only the most basic properties:</p>\n<pre class=\"literal-block\">\n% gm identify seaworld.jpg\nseaworld.jpg JPEG 1530x1020+0+0 DirectClass 8-bit 204.0K 0.000u 0:01\n</pre>\n<p>but with -verbose it can report on a large number of properties.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/GraphicsMagick.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\ngm - command-line utility to create, edit, compare, convert, or display images\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#files\">Files and Formats</a>\n</dt>\n<dt>\n<a href=\"#opti\">Options</a>\n</dt>\n<dt>\n<a href=\"#envi\">Environment</a>\n</dt>\n<dt>\n<a href=\"#file\">Configuration Files</a>\n</dt>\n<dt>\n<a href=\"#auth\">Authors</a>\n</dt>\n<dt>\n<a href=\"#copy\">Copyright</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm animate</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file</em> <strong>[ [</strong>\n<em>options ...</em> <strong>]</strong> <em>file ...</em> <strong>]</strong>\n<p>\n<strong>gm batch</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <strong>[</strong> <em>script</em> <strong>]</strong>\n<p>\n<strong>gm benchmark</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> subcommand\n<p>\n<strong>gm compare</strong> <strong>[</strong> <em>options</em> <strong>... ]</strong> <em>reference-image</em>\n<strong>[</strong> <em>options</em> <strong>... ]</strong> <em>compare-image</em>\n<strong>[</strong> <em>options</em> <strong>... ]</strong>\n<p>\n<strong>gm composite</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>change-image base-image</em>\n<strong>[</strong> <em>mask-image</em> <strong>]</strong> <em>output-image</em>\n<p>\n<strong>gm conjure</strong> <strong>[</strong> <em>options</em> <strong>]</strong> <em>script.msl</em>\n<strong>[ [</strong> <em>options</em> <strong>]</strong> <em>script.msl</em> <strong>]</strong>\n<p>\n<strong>gm convert</strong> <strong>[ [</strong> <em>options ...</em> <strong>] [</strong> <em>input-file ...</em>\n<strong>] [</strong> <em>options ...</em> <strong>] ]</strong> <em>output-file</em> \n<p>\n<strong>gm display</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file ...</em>\n<strong>[ [</strong><em>options ...</em> <strong>]</strong><em>file ...</em> <strong>]</strong>\n<p>\n<strong>gm identify</strong> <em>file</em> <strong>[</strong> <em>file ...</em> <strong>]</strong>\n<p>\n<strong>gm import</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file</em>\n<p>\n<strong>gm mogrify</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file ...</em>\n<p>\n<strong>gm montage</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file</em> <strong>[ [</strong>\n<em>options ...</em> <strong>]</strong> <em>file ...</em> <strong>]</strong> <em>output-file</em>\n<p>\n<strong>gm time</strong> subcommand\n<p>\n<strong>gm version</strong>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nGraphicsMagick's <strong>gm</strong> provides a suite of utilities for creating,\ncomparing, converting, editing, and displaying images.  All of the\nutilities are provided as sub-commands of a single <strong>gm</strong>\nexecutable.  The <strong>gm</strong> executable returns the exit code 0 to\nindicate success, or 1 to indicate failure:\n<p>\n<a href=\"animate.html\"><strong>animate</strong></a>\ndisplays an animation (e.g. a GIF file) on any workstation display\nrunning an <em>X</em> server.\n<p>\n<a href=\"batch.html\"><strong>batch</strong></a>\nexecutes an arbitary number of the utility commands\n(e.g. <strong>convert</strong>) in the form of a simple linear batch script in\norder to improve execution efficiency, and/or to allow use as a\nsubordinate co-process under the control of an arbitrary script or\nprogram.\n<p>\n<a href=\"benchmark.html\"><strong>benchmark</strong></a>\nexecutes one of the other utility commands (e.g. <strong>convert</strong>) for a\nspecified number of iterations, or execution time, and reports\nexecution time and other profiling information such as CPU\nutilization. <strong>Benchmark</strong> provides various operating modes\nincluding executing the command with a varying number of threads, and\nalternate reporting formats such as comma-separated value (CSV).\n<p>\n<a href=\"compare.html\"><strong>compare</strong></a>\ncompares two images and reports difference statistics according to\nspecified metrics and/or outputs an image with a visual representation\nof the differences.  It may also be used to test if images are similar\nwithin a particular range and specified metric, returning a truth\nvalue to the executing environment.\n<p>\n<a href=\"composite.html\"><strong>composite</strong></a>\ncomposites images (blends or merges images together) to create new images.\n<p>\n<a href=\"conjure.html\"><strong>conjure</strong></a>\ninterprets and executes scripts in\nthe Magick Scripting Language (MSL).\n<p>\n<a href=\"convert.html\"><strong>convert</strong></a>\nconverts an input file using one image format to an output file with\nthe same or differing image format while applying an arbitrary number\nof image transformations.\n<p>\n<a href=\"display.html\"><strong>display</strong></a>\nis a machine architecture independent image processing and display\nfacility. It can display an image on any workstation display running\nan <em>X</em> server.\n<p>\n<a href=\"identify.html\"><strong>identify</strong></a>\ndescribes the format and characteristics of one or more image\nfiles. It will also report if an image is incomplete or corrupt.\n<p>\n<a href=\"import.html\"><strong>import</strong></a>\nreads an image from any visible window on an <em>X</em> server and\noutputs it as an image file. You can capture a single window, the\nentire screen, or any rectangular portion of the screen.\n<p>\n<a href=\"mogrify.html\"><strong>mogrify</strong></a>\ntransforms an image or a sequence of images. These transforms include\n<strong>image scaling</strong>, <strong>image rotation</strong>, <strong>color reduction</strong>,\nand others. The transmogrified image <strong>overwrites</strong> the original\nimage.\n<p>\n<a href=\"montage.html\"><strong>montage</strong></a>\ncreates a composite by combining several separate images. The images\nare tiled on the composite image with the name of the image optionally\nappearing just below the individual tile.\n<p>\n<a href=\"time.html\"><strong>time</strong></a>\nexecutes a subcommand and reports the user, system, and total\nexecution time consumed.\n<p>\n<a href=\"version.html\"><strong>version</strong></a>\nreports the GraphicsMagick release version, maximum sample-depth,\ncopyright notice, supported features, and the options used while\nbuilding the software.\n<p>\nThe <strong>GraphicsMagick</strong> utilities recognize the following image formats:\n<br>&nbsp;<br>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<p>\n<tr><td><strong>Name</strong> </td><td><strong>Mode</strong></td><td><strong>Description</strong></td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">3FR      </td><td>r--</td><td>Hasselblad Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">8BIM     </td><td>rw-</td><td>Photoshop resource format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">8BIMTEXT </td><td>rw-</td><td>Photoshop resource text format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">8BIMWTEXT</td><td>rw-</td><td>Photoshop resource wide text format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">APP1     </td><td>rw-</td><td>Raw application information</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">APP1JPEG </td><td>rw-</td><td>Raw JPEG binary data</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ART      </td><td>r--</td><td>PF1: 1st Publisher</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ARW      </td><td>r--</td><td>Sony Alpha DSLR RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">AVS      </td><td>rw+</td><td>AVS X image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">BIE      </td><td>rw-</td><td>Joint Bi-level Image experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">BMP      </td><td>rw+</td><td>Microsoft Windows bitmap image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">BMP2     </td><td>-w-</td><td>Microsoft Windows bitmap image v2</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">BMP3     </td><td>-w-</td><td>Microsoft Windows bitmap image v3</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CACHE    </td><td>---</td><td>Magick Persistent Cache image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CALS     </td><td>rw-</td><td>Continuous Acquisition and Life-cycle</td></tr>\n<tr><td>          </td><td>   </td><td>Support Type 1 image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CAPTION  </td><td>r--</td><td>Caption (requires separate size info)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CIN      </td><td>rw-</td><td>Kodak Cineon Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CMYK     </td><td>rw-</td><td>Raw cyan, magenta, yellow, and black</td></tr>\n<tr><td>          </td><td>   </td><td>samples (8 or 16 bits, depending on</td></tr>\n<tr><td>          </td><td>   </td><td>the image depth)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CMYKA    </td><td>rw-</td><td>Raw cyan, magenta, yellow, black, and</td></tr>\n<tr><td>          </td><td>   </td><td>matte samples (8 or 16 bits, depending</td></tr>\n<tr><td>          </td><td>   </td><td>on the image depth)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CR2      </td><td>r--</td><td>Canon Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CRW      </td><td>r--</td><td>Canon Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CUR      </td><td>r--</td><td>Microsoft Cursor Icon</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CUT      </td><td>r--</td><td>DR Halo</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DCM      </td><td>r--</td><td>Digital Imaging and Communications in</td></tr>\n<tr><td>          </td><td>   </td><td>Medicine image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DCR      </td><td>r--</td><td>Kodak Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DCX      </td><td>rw+</td><td>ZSoft IBM PC multi-page Paintbrush</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DNG      </td><td>r--</td><td>Adobe Digital Negative</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DPS      </td><td>r--</td><td>Display PostScript Interpreter</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DPX      </td><td>rw-</td><td>Digital Moving Picture Exchange</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPDF     </td><td>rw-</td><td>Encapsulated Portable Document Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPI      </td><td>rw-</td><td>Adobe Encapsulated PostScript</td></tr>\n<tr><td>          </td><td>   </td><td>Interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPS      </td><td>rw-</td><td>Adobe Encapsulated PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPS2     </td><td>-w-</td><td>Adobe Level II Encapsulated PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPS3     </td><td>-w-</td><td>Adobe Level III Encapsulated PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPSF     </td><td>rw-</td><td>Adobe Encapsulated PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPSI     </td><td>rw-</td><td>Adobe Encapsulated PostScript</td></tr>\n<tr><td>          </td><td>   </td><td>Interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPT      </td><td>rw-</td><td>Adobe Encapsulated PostScript with MS-DOS</td></tr>\n<tr><td>          </td><td>   </td><td>TIFF preview</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPT2     </td><td>rw-</td><td>Adobe Level II Encapsulated PostScript</td></tr>\n<tr><td>          </td><td>   </td><td>with MS-DOS TIFF preview</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPT3     </td><td>rw-</td><td>Adobe Level III Encapsulated PostScript</td></tr>\n<tr><td>          </td><td>   </td><td>with MS-DOS TIFF preview</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EXIF     </td><td>rw-</td><td>Exif digital camera binary data</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">FAX      </td><td>rw+</td><td>Group 3 FAX (Not TIFF Group3 FAX!)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">FITS     </td><td>rw-</td><td>Flexible Image Transport System</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">FRACTAL  </td><td>r--</td><td>Plasma fractal image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">FPX      </td><td>rw-</td><td>FlashPix Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">GIF      </td><td>rw+</td><td>CompuServe graphics interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">GIF87    </td><td>rw-</td><td>CompuServe graphics interchange format</td></tr>\n<tr><td>          </td><td>   </td><td>(version 87a)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">GRADIENT </td><td>r--</td><td>Gradual passing from one shade to</td></tr>\n<tr><td>          </td><td>   </td><td>another</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">GRAY     </td><td>rw+</td><td>Raw gray samples (8/16/32 bits,</td></tr>\n<tr><td>          </td><td>   </td><td>depending on the image depth)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">HISTOGRAM</td><td>-w-</td><td>Histogram of the image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">HRZ      </td><td>r--</td><td>HRZ: Slow scan TV</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">HTML     </td><td>-w-</td><td>Hypertext Markup Language and a</td></tr>\n<tr><td>          </td><td>   </td><td>client-side image map</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICB      </td><td>rw+</td><td>Truevision Targa image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICC      </td><td>rw-</td><td>ICC Color Profile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICM      </td><td>rw-</td><td>ICC Color Profile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICO      </td><td>r--</td><td>Microsoft icon</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICON     </td><td>r--</td><td>Microsoft icon</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IDENTITY </td><td>r--</td><td>Hald CLUT identity image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IMAGE    </td><td>r--</td><td>GraphicsMagick Embedded Image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">INFO     </td><td>-w+</td><td>Image descriptive information and</td></tr>\n<tr><td>          </td><td>   </td><td> statistics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IPTC     </td><td>rw-</td><td>IPTC Newsphoto</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IPTCTEXT </td><td>rw-</td><td>IPTC Newsphoto text format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IPTCWTEXT</td><td>rw-</td><td>IPTC Newsphoto wide text format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JBG      </td><td>rw+</td><td>Joint Bi-level Image experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JBIG     </td><td>rw+</td><td>Joint Bi-level Image experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JNG      </td><td>rw-</td><td>JPEG Network Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JP2      </td><td>rw-</td><td>JPEG-2000 JP2 File Format Syntax</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JPC      </td><td>rw-</td><td>JPEG-2000 Code Stream Syntax</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JPEG     </td><td>rw-</td><td>Joint Photographic Experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>JFIF format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JPG      </td><td>rw-</td><td>Joint Photographic Experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>JFIF format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">K25      </td><td>r--</td><td>Kodak Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">KDC      </td><td>r--</td><td>Kodak Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">LABEL    </td><td>r--</td><td>Text image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">M2V      </td><td>rw+</td><td>MPEG-2 Video Stream</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MAP      </td><td>rw-</td><td>Colormap intensities and indices</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MAT      </td><td>r--</td><td>MATLAB image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MATTE    </td><td>-w+</td><td>MATTE format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MIFF     </td><td>rw+</td><td>Magick Image File Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MNG      </td><td>rw+</td><td>Multiple-image Network Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MONO     </td><td>rw-</td><td>Bi-level bitmap in least-significant-</td></tr>\n<tr><td>          </td><td>   </td><td>-byte-first order</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MPC      </td><td>rw+</td><td>Magick Persistent Cache image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MPEG     </td><td>rw+</td><td>MPEG-1 Video Stream</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MPG      </td><td>rw+</td><td>MPEG-1 Video Stream</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MRW      </td><td>r--</td><td>Minolta Photo Raw</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MSL      </td><td>r--</td><td>Magick Scripting Language</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MTV      </td><td>rw+</td><td>MTV Raytracing image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MVG      </td><td>rw-</td><td>Magick Vector Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">NEF      </td><td>r--</td><td>Nikon Electronic Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">NULL     </td><td>r--</td><td>Constant image of uniform color</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">OTB      </td><td>rw-</td><td>On-the-air bitmap</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">P7       </td><td>rw+</td><td>Xv thumbnail format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PAL      </td><td>rw-</td><td>16bit/pixel interleaved YUV</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PALM     </td><td>rw-</td><td>Palm Pixmap</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PBM      </td><td>rw+</td><td>Portable bitmap format (black and white)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCD      </td><td>rw-</td><td>Photo CD</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCDS     </td><td>rw-</td><td>Photo CD</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCL      </td><td>-w-</td><td>Page Control Language</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCT      </td><td>rw-</td><td>Apple Macintosh QuickDraw/PICT</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCX      </td><td>rw-</td><td>ZSoft IBM PC Paintbrush</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PDB      </td><td>rw+</td><td>Palm Database ImageViewer Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PDF      </td><td>rw+</td><td>Portable Document Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PEF      </td><td>r--</td><td>Pentax Electronic File</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PFA      </td><td>r--</td><td>TrueType font</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PFB      </td><td>r--</td><td>TrueType font</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PGM      </td><td>rw+</td><td>Portable graymap format (gray scale)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PGX      </td><td>r--</td><td>JPEG-2000 VM Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PICON    </td><td>rw-</td><td>Personal Icon</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PICT     </td><td>rw-</td><td>Apple Macintosh QuickDraw/PICT</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PIX      </td><td>r--</td><td>Alias/Wavefront RLE image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PLASMA   </td><td>r--</td><td>Plasma fractal image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNG      </td><td>rw-</td><td>Portable Network Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNG24    </td><td>rw-</td><td>Portable Network Graphics, 24 bit RGB</td></tr>\n<tr><td>          </td><td>   </td><td>opaque only</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNG32    </td><td>rw-</td><td>Portable Network Graphics, 32 bit RGBA</td></tr>\n<tr><td>          </td><td>   </td><td>semitransparency OK</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNG8     </td><td>rw-</td><td>Portable Network Graphics, 8-bit</td></tr>\n<tr><td>          </td><td>   </td><td>indexed, binary transparency only</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNM      </td><td>rw+</td><td>Portable anymap</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PPM      </td><td>rw+</td><td>Portable pixmap format (color)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PREVIEW  </td><td>-w-</td><td>Show a preview an image enhancement,</td></tr>\n<tr><td>          </td><td>   </td><td>effect, or f/x</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PS       </td><td>rw+</td><td>Adobe PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PS2      </td><td>-w+</td><td>Adobe Level II PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PS3      </td><td>-w+</td><td>Adobe Level III PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PSD      </td><td>rw-</td><td>Adobe Photoshop bitmap</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PTIF     </td><td>rw-</td><td>Pyramid encoded TIFF</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PWP      </td><td>r--</td><td>Seattle Film Works</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RAF      </td><td>r--</td><td>Fuji Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RAS      </td><td>rw+</td><td>SUN Rasterfile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RGB      </td><td>rw+</td><td>Raw red, green, and blue samples</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RGBA     </td><td>rw+</td><td>Raw red, green, blue, and matte samples</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RLA      </td><td>r--</td><td>Alias/Wavefront image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RLE      </td><td>r--</td><td>Utah Run length encoded image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SCT      </td><td>r--</td><td>Scitex HandShake</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SFW      </td><td>r--</td><td>Seattle Film Works</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SGI      </td><td>rw+</td><td>Irix RGB image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SHTML    </td><td>-w-</td><td>Hypertext Markup Language and a</td></tr>\n<tr><td>          </td><td>   </td><td>client-side image map</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">STEGANO  </td><td>r--</td><td>Steganographic image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SUN      </td><td>rw+</td><td>SUN Rasterfile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SVG      </td><td>rw+</td><td>Scalable Vector Gaphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TEXT     </td><td>rw+</td><td>Raw text</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TGA      </td><td>rw+</td><td>Truevision Targa image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TIFF     </td><td>rw+</td><td>Tagged Image File Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TILE     </td><td>r--</td><td>Tile image with a texture</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TIM      </td><td>r--</td><td>PSX TIM</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TOPOL    </td><td>r--</td><td>TOPOL X Image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TTF      </td><td>r--</td><td>TrueType font</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TXT      </td><td>rw+</td><td>Raw text</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">UIL      </td><td>-w-</td><td>X-Motif UIL table</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">UYVY     </td><td>rw-</td><td>16bit/pixel interleaved YUV</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VDA      </td><td>rw+</td><td>Truevision Targa image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VICAR    </td><td>rw-</td><td>VICAR rasterfile format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VID      </td><td>rw+</td><td>Visual Image Directory</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VIFF     </td><td>rw+</td><td>Khoros Visualization image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VST      </td><td>rw+</td><td>Truevision Targa image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">WBMP     </td><td>rw-</td><td>Wireless Bitmap (level 0) image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">WMF      </td><td>r--</td><td>Windows Metafile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">WPG      </td><td>r--</td><td>Word Perfect Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">X        </td><td>rw-</td><td>X Image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">X3F      </td><td>r--</td><td>Foveon X3 (Sigma/Polaroid) RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XBM      </td><td>rw-</td><td>X Windows system bitmap (black</td></tr>\n<tr><td>          </td><td>   </td><td>and white)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XC       </td><td>r--</td><td>Constant image uniform color</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XCF      </td><td>r--</td><td>GIMP image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XMP      </td><td>rw-</td><td>Adobe XML metadata</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XPM      </td><td>rw-</td><td>X Windows system pixmap (color)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XV       </td><td>rw+</td><td>Khoros Visualization image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XWD      </td><td>rw-</td><td>X Windows system window dump (color)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">YUV      </td><td>rw-</td><td>CCIR 601 4:1:1 or 4:2:2 (8-bit only)</td></tr>\n<tr><td>          </td><td>   </td><td></td></tr>\n<tr><td> Modes:   </td><td>   </td><td></td></tr>\n<tr><td>          </td><td>r  </td><td>Read</td></tr>\n<tr><td>          </td><td>w  </td><td>Write</td></tr>\n<tr><td>          </td><td>+  </td><td>Multi-image</td></tr>\n<br>&nbsp;<br>\n</table>\n<p>\n<em>Support for some of these formats require additional programs or libraries.\nSee <a href=\"README.html\">README</a>\nin the source package for where to find optional additional software</em>.\n<p>\nNote, a format delineated with <tt>+</tt> means that if more than one\nimage is specified, frames are combined into a single multi-image\nfile. Use <strong>+adjoin</strong> if you want a single image produced for each\nframe.\n<p>\nYour installation might not support all of the formats in the list.\nTo get an accurate listing of the formats supported by your particular\nconfiguration, run <tt>\"gm convert -list format\"</tt>.\n<p>\nRaw images are expected to have one byte per pixel unless <strong>gm</strong> is\ncompiled in 16-bit quantum mode or in 32-bit quantum mode. Here, the\nraw data is expected to be stored two or four bytes per pixel,\nrespectively, in most-significant-byte-first order.  For example, you\ncan tell if <strong>gm</strong> was compiled in 16-bit mode by typing \"gm\nversion\" without any options, and looking for \"Q:16\" in the first line\nof output.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"files\"></a>Files and Formats\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nBy default, the image format is determined by its magic number, i.e., the\nfirst few bytes of the file. To specify\na particular image format, precede the filename with an image format name\nand a colon (<em>i.e.</em><strong>ps:image</strong>) or specify the image type as the\nfilename suffix (<em>i.e.</em><strong>image.ps</strong>).\nThe magic number takes precedence over the filename suffix\nand the prefix takes precedence over the magic number and the suffix\nin input files.\nWhen a file is read, its magic number is stored in the \"image-&gt;magick\"\nstring.\nIn output files, the prefix takes precedence over the filename suffix,\nand the filename suffix takes precedence over the\n\"image-&gt;magick\" string.\n<br>&nbsp;<br>\n<p>To read the \"built-in\" formats (GRANITE, H, LOGO,\nNETSCAPE, PLASMA, and ROSE) use a prefix (including the colon) without a\nfilename or suffix.  To read the XC format, follow the colon with a color\nspecification.  To read the CAPTION format, follow the colon with a text\nstring or with a filename prefixed with the at symbol (<strong>@</strong>).\n<br>&nbsp;<br>\n<p>\nWhen you specify <strong>X</strong> as your image type, the filename has special\nmeaning. It specifies an X window by <strong>id, name</strong>, or\n<strong>root</strong>. If\nno filename is specified, the window is selected by clicking the mouse\nin the desired window.\n<p>\nSpecify <em>input_file</em> as <strong>-</strong> for standard input,\n<em>output_file</em> as <strong>-</strong> for standard output.\nIf <em>input_file</em> has the extension <strong>.Z</strong> or <strong>.gz</strong>, the\nfile is uncompressed with <strong>uncompress</strong> or <strong>gunzip</strong>\nrespectively.\nIf <em>output_file</em> has the extension <strong>.Z</strong> or <strong>.gz</strong>,\nthe file is compressed using with <em>compress</em> or <em>gzip</em> respectively.\n<p>\nUse an optional index enclosed in brackets after an input file name to\nspecify a desired subimage of a multi-resolution image format like\nPhoto CD (e.g. <tt>\"img0001.pcd[4]\"</tt>) or a range for MPEG images\n(e.g. <tt>\"video.mpg[50-75]\"</tt>). A subimage specification can be\ndisjoint (e.g. <tt>\"image.tiff[2,7,4]\"</tt>). For raw images, specify\na subimage with a geometry (e.g. <tt>-size 640x512</tt>\n<tt>\"image.rgb[320x256+50+50]\"</tt>).  Surround the image name with\nquotation marks to prevent your shell from interpreting the square\nbrackets. <p>Single images are written with the filename you\nspecify. However, multi-part images (e.g., a multi-page PostScript\ndocument with <strong>+adjoin</strong> specified) may be written with the scene\nnumber included as part of the filename. In order to include the scene\nnumber in the filename, it is necessary to include a printf-style\n<tt>%d</tt> format specification in the file name and use the +adjoin\noption. For example,\n<pre>\n    image%02d.miff\n</pre>\n<p>\nwrites files <em>image00.miff, image01.miff,</em> etc. Only a single\nspecification is allowed within an output filename. If more than one\nspecification is present, it will be ignored. It is best to embed the\nscene number in the base part of the file name, not in the extension,\nbecause the extension will not be a recognizeable image type.\n<p>\nWhen running a commandline utility, you can\nprepend an at sign <tt>@</tt> to a filename to read a list of image\nfilenames from that file. This is convenient in the event you have too\nmany image filenames to fit on the command line.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images that follows,\nuntil the set is terminated by the appearance of any option or <strong>-noop</strong>.\nSome options only affect the decoding of images and others only the encoding.\nThe latter can appear after the final group of input images.\n<p>\nThis is a combined list of the command-line options used by the\nGraphicsMagick utilities (<em>animate</em>, <em>compare</em>,\n<em>composite</em>, <em>convert</em>, <em>display</em>, <em>identify</em>,\n<em>import</em>, <em>mogrify</em> and <em>montage</em>).\n<br>&nbsp;<br>\n<p>\nIn this document, angle brackets (\"&lt;&gt;\") enclose variables and curly\nbrackets (\"{}\") enclose optional parameters. For example,\n\"<strong>-fuzz &lt;distance&gt;{%}</strong>\" means you can use the\noption <tt>\"-fuzz 10\"</tt>\nor <tt>\"-fuzz 2%\"</tt>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-adjoin\"></a>-adjoin\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>join images into a single multi-image file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, all images of an image sequence are stored in the same\nfile. However, some formats (e.g. JPEG) do not support storing more\nthan one image per file and only the first frame in an image sequence\nwill be saved unless the result is saved to separate files. Use\n<strong>+adjoin</strong> to force saving multiple frames to multiple numbered\nfiles. If <strong>+adjoin</strong> is used, then the output filename must\ninclude a printf style formatting specification for the numeric part\nof the filename.  For example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    image%02d.miff\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-affine\"></a>-affine <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>drawing transform matrix</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option provides a transform matrix <tt>{sx,rx,ry,sy,tx,ty}</tt> for\nuse by subsequent <strong>-draw</strong> or <strong>-transform</strong> options.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-antialias\"></a>-antialias\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixel aliasing</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default antialiasing algorithms are used when drawing objects (e.g. lines)\nor rendering vector formats (e.g. WMF and Postscript). Use +antialias to\ndisable use of antialiasing algorithms. Reasons to disable antialiasing\ninclude avoiding increasing colors in the image, or improving rendering speed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-append\"></a>-append\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>append a set of images</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option creates a single image where the images in the original set\nare stacked top-to-bottom.  If they are not of the same width,\nany narrow images will be expanded to fit using the background color.\nUse <strong>+append</strong> to stack images left-to-right.  The set of images\nis terminated by the appearance of any option.\nIf the <strong>-append</strong>\noption appears after all of the input images, all images are appended.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details\"></a> <i>-asc-cdl &lt;spec&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply ASC CDL color transform</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nApplies (\"bakes in\") the ASC CDL, which is a format for the exchange\nof basic primary color grading information between equipment and\nsoftware from different manufacturers. The format defines the math for\nthree functions: slope, offset and power. Each function uses a number\nfor the red, green, and blue color channels for a total of nine\nnumbers comprising a single color decision. The tenth number\n(optional) is for chromiance (saturation) as specified by ASC CDL\n1.2.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe argument string is comma delimited and is in the following form\n(but without invervening spaces or line breaks)</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    redslope,redoffset,redpower:\n    greenslope,greenoffset,greenpower:\n    blueslope,blueoffset,bluepower:\n    saturation\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nwith the unity (no change) specification being:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    \"1.0,0.0,1.0:1.0,0.0,1.0:1.0,0.0,1.0:1.0\"\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-authenticate\"></a>-authenticate <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to supply a password for decrypting an image or an\nimage sequence, if it is being read from a format such as PDF that supports\nencryption.  Encrypting images being written is not supported.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-auto-orient\"></a>-auto-orient\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>orient (rotate) image so it is upright</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAdjusts the image orienation so that it is suitable for viewing.  Uses\nthe orientation tag obtained from the image file or as supplied by the\n<strong>-orient</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-average\"></a>-average\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>average a set of images</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe set of images\nis terminated by the appearance of any option.\nIf the <strong>-average</strong>\noption appears after all of the input images, all images are averaged.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-backdrop\"></a>-backdrop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the image centered on a backdrop.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis backdrop covers the entire workstation screen and is useful for hiding\nother X window activity while viewing the image. The color of the backdrop\nis specified as the foreground color (X11 default is black).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Refer to\n<a href=\"#xres\">X Resources</a>\nfor details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-background\"></a>-background <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-black-threshold\"></a>-black-threshold <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels below the threshold become black</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>-black-threshold</strong> to set pixels with values below the specified\nthreshold to minimum value (black). If only one value is supplied, or the\nred, green, and blue values are identical, then intensity thresholding is\nused. If the color threshold values are not identical then channel-based\nthresholding is used, and color distortion will occur. Specify a negative\nvalue (e.g. -1) if you want a channel to be ignored but you do want to\nthreshold a channel later in the list. If a percent (%) symbol is\nappended, then the values are treated as a percentage of maximum\nrange.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-blue-primary\"></a>-blue-primary <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-blur\"></a>-blur <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBlur with the given radius and\nstandard deviation (sigma).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-border\"></a>-border <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with a border of color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details\nabout the geometry specification.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-bordercolor\"></a>-bordercolor <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -borderwidth <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-box\"></a>-box <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the color of the annotation bounding box</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-draw</strong> for further\ndetails.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-channel\"></a>-channel <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of channel</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from: <strong>Red</strong>, <strong>Green</strong>, <strong>Blue</strong>, <strong>Opacity</strong>,\n<strong>Matte</strong>, <strong>Cyan</strong>, <strong>Magenta</strong>, <strong>Yellow</strong>, <strong>Black</strong>,\nor <strong>Gray</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to extract a particular <em>channel</em> from the image.\n<strong>Opacity</strong>,\nfor example, is useful for extracting the opacity values from an image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -charcoal <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate a charcoal drawing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-chop\"></a>-chop <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixels from the interior of an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>Width</em> and <em>height</em> give the number of columns and rows to remove,\nand <em>x</em> and <em>y</em> are offsets that give the location of the\nleftmost column and topmost row to remove.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <em>x</em> offset normally specifies the leftmost column to remove.\nIf the <strong>-gravity</strong> option is present with <em>NorthEast, East,</em>\nor <em>SouthEast</em>\ngravity, it gives the distance leftward from the right edge\nof the image to the rightmost column to remove.  Similarly, the <em>y</em> offset\nnormally specifies the topmost row to remove, but if\nthe <strong>-gravity</strong> option is present with <em>SouthWest, South,</em>\nor <em>SouthEast</em>\ngravity, it specifies the distance upward from the bottom edge of the\nimage to the bottom row to remove.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-chop</strong> option removes entire rows and columns,\nand moves the remaining corner blocks leftward and upward to close the gaps.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-clip\"></a>-clip\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply the clipping path, if one is present</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf a clipping path is present, it will be applied to subsequent operations.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, if you type the following command:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -clip -negate cockatoo.tif negated.tif\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nonly the pixels within the clipping path are negated.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-clip</strong> feature requires the XML library.  If the XML library\nis not present, the option is ignored.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-coalesce\"></a>-coalesce\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>merge a sequence of images</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEach image N in the sequence after Image 0 is replaced with the image\ncreated by flattening images 0 through N.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe set of images\nis terminated by the appearance of any option.\nIf the <strong>-coalesce</strong>\noption appears after all of the input images, all images are coalesced.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-colorize\"></a>-colorize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colorize the image with the pen color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify the amount of colorization as a percentage. You can apply separate\ncolorization values to the red, green, and blue channels of the image with\na colorization value list delimited with slashes (e.g. 0/0/50).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-colorize</strong> option may be used in conjunction with <strong>-modulate</strong>\nto produce a nice sepia toned image like:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert input.ppm -modulate 115,0,100 \\\n              -colorize 7,21,50 output.ppm.\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-colormap\"></a>-colormap <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the colormap type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose between <strong>shared</strong> or <strong>private</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option only applies when the default X server visual is <em>PseudoColor</em>\nor <em>GRAYScale</em>. Refer to <strong>-visual</strong> for more details. By default,\na shared colormap is allocated. The image shares colors with other X clients.\nSome image colors could be approximated, therefore your image may look\nvery different than intended. Choose <strong>Private</strong> and the image colors\nappear exactly as they are defined. However, other clients may\ngo <em>technicolor</em> when the image colormap is installed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-colors\"></a>-colors <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe actual number of colors in the image may be less than your request,\nbut never more. Note, this is a color reduction option. Images with less\nunique colors than specified with this option will have any duplicate or\nunused colors removed. The ordering of an existing color palette may be\naltered. When converting an image from color to grayscale, convert the\nimage to the gray colorspace before reducing the number of colors since\ndoing so is most efficient. Refer to &lt;a\nhref=\"quantize.html\"&gt;quantize</a> for more details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nNote, options <strong>-dither</strong>, <strong>-colorspace</strong>, and <strong>-treedepth</strong>\naffect the color reduction algorithm.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-colorspace\"></a>-colorspace <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are:\n<strong>CineonLog</strong>, <strong>CMYK</strong>, <strong>GRAY</strong>, <strong>HSL</strong>, <strong>HWB</strong>,\n<strong>OHTA</strong>, <strong>RGB</strong>, <strong>Rec601Luma</strong>, <strong>Rec709Luma</strong>,\n<strong>Rec601YCbCr</strong>, <strong>Rec709YCbCr</strong>, <strong>Transparent</strong>, <strong>XYZ</strong>,\n<strong>YCbCr</strong>, <strong>YIQ</strong>, <strong>YPbPr</strong>, or <strong>YUV</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nColor reduction, by default, takes place in the RGB color space. Empirical\nevidence suggests that distances in color spaces such as YUV or YIQ correspond\nto perceptual color differences more closely than do distances in RGB space.\nThese color spaces may give better results when color reducing an image.\nRefer to <a href=\"quantize.html\">quantize</a> for more details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Two gray colorspaces are supported. The <strong>Rec601Luma</strong> space is\nbased on the recommendations for legacy NTSC television (ITU-R\nBT.601-5).  The <strong>Rec709Luma</strong> space is based on the\nrecommendations for HDTV (Rec. ITU-R BT.709-5) and is suitable for use\nwith computer graphics, and for contemporary CRT displays. The\n<strong>GRAY</strong> colorspace currently selects the <strong>Rec601Luma</strong>\ncolorspace by default for backwards compatibly reasons. This default\nmay be re-considered in the future.\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Two YCbCr colorspaces are supported. The <strong>Rec601YCbCr</strong> space is\nbased on the recommendations for legacy NTSC television (ITU-R BT.601-5). The\n<strong>Rec709CbCr</strong> space is based on the recommendations for HDTV (Rec.\nITU-R BT.709-5) and is suitable for suitable for use with computer\ngraphics, and for contemporary CRT displays. The <strong>YCbCr</strong> colorspace\nspecification is equivalent to<strong>Rec601YCbCr</strong>.\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>Transparent</strong> color space behaves uniquely in that it preserves\nthe matte channel of the image if it exists.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-colors</strong> or <strong>-monochrome</strong> option, or saving to a file\nformat which requires color reduction, is required for this option to\ntake effect.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-comment\"></a>-comment <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to assign a specific comment to the image, when writing\nto an image format that supports comments. You can include the\nimage filename, type, width, height, or other image attribute by embedding\nspecial format characters listed under the <strong>-format</strong> option.\nThe comment is not drawn on the image, but is embedded in the image\ndatastream via a \"Comment\" tag or similar mechanism.  If you want the\ncomment to be visible on the image itself, use the <strong>-draw</strong> option\ninstead.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -comment \"%m:%f %wx%h\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nproduces an image comment of <strong>MIFF:bird.miff 512x480</strong> for an image\ntitled <strong>bird.miff</strong> and whose width is 512 and height is 480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the first character of <em>string</em> is <em>@</em>, the image comment\nis read from a file titled by the remaining characters in the string.\nPlease note that if the string comes from an untrusted source that it\nshould be sanitized before use since otherwise the content of an\narbitrary readable file could be incorporated in a comment in the\noutput file (a security risk).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the -comment option appears multiple times, only the last comment is\nstored.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn PNG images, the comment is stored in a <strong>tEXt</strong> or <strong>zTXt</strong> chunk\nwith the keyword \"comment\".</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-compose\"></a>-compose <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe description of composition uses abstract terminology in order to\nallow the the description to be more clear, while avoiding constant\nvalues which are specific to a particular build configuration. Each image\npixel is represented by red, green, and blue levels (which are equal for\na gray pixel). MaxRGB is the maximum integral value which may be stored\nin the red, green, or blue channels of the image. Each image pixel may\nalso optionally (if the image matte channel is enabled) have an\nassociated level of opacity (ranging from opaque to transparent), which\nmay be used to determine the influence of the pixel color when\ncompositing the pixel with another image pixel. If the image matte\nchannel is disabled, then all pixels in the image are treated as opaque.\nThe color of an <em>opaque</em> pixel is fully visible while the color of a\n<em>transparent</em> pixel color is entirely absent (pixel color is ignored).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy definition, raster images have a rectangular shape. All image rows are\nof equal length, and all image columns have the same number of rows. By\ntreating the opacity channel as a visual \"mask\" the rectangular image may\nbe given a \"shape\" by treating the opacity channel as a cookie-cutter for\nthe image. Pixels within the shape are opaque, while pixels outside the\nshape are transparent. Pixels on the boundary of the shape may be between\nopaque and transparent in order to provide antialiasing (visually smooth\nedges). The description of the composition operators use this concept of\nimage \"shape\" in order to make the description of the operators easier to\nunderstand. While it is convenient to describe the operators in terms of\n\"shapes\" they are by no means limited to mask-style operations since they\nare based on continuous floating-point mathematics rather than simple\nboolean operations.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, the <em>Over</em> composite operator is used. The following\ncomposite operators are available:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Over\n     In\n     Out\n     Atop\n     Xor\n     Plus\n     Minus\n     Add\n     Subtract\n     Difference\n     Divide\n     Multiply\n     Bumpmap\n     Copy\n     CopyRed\n     CopyGreen\n     CopyBlue\n     CopyOpacity\n     CopyCyan\n     CopyMagenta\n     CopyYellow\n     CopyBlack\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe behavior of each operator is described below.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>Over</dt>\n<dd>The result will be the union of the two image shapes, with opaque areas\nof <em>change-image</em> obscuring <em>base-image</em> in the region of\noverlap.\n</dd>\n<dt>In</dt>\n<dd>The result is simply <em>change-image</em> cut by the shape of\n<em>base-image</em>. None of the image data of <em>base-image</em> will be in\nthe result.\n</dd>\n<dt>Out</dt>\n<dd>The resulting image is <em>change-image</em> with the shape of\n<em>base-image</em> cut out.\n</dd>\n<dt>Atop</dt>\n<dd>The result is the same shape as <em>base-image</em>, with\n<em>change-image</em> obscuring <em>base-image</em> where the image shapes\noverlap. Note this differs from <strong>over</strong> because the portion of\n<em>change-image</em> outside <em>base-image</em>'s shape does not appear in\nthe result.\n</dd>\n<dt>Xor</dt>\n<dd>The result is the image data from both <em>change-image</em> and\n<em>base-image</em> that is outside the overlap region. The overlap region\nwill be blank.\n</dd>\n<dt>Plus</dt>\n<dd>The result is just the sum of the image data. Output values are cropped\nto MaxRGB (no overflow). This operation is independent of the matte\nchannels.\n</dd>\n<dt>Minus</dt>\n<dd>The result of <em>change-image</em> - <em>base-image</em>, with underflow\ncropped to zero. The matte channel is ignored (set to opaque, full\ncoverage).\n</dd>\n<dt>Add</dt>\n<dd>The result of <em>change-image</em> + <em>base-image</em>, with overflow\nwrapping around (<em>mod</em> MaxRGB+1).\n</dd>\n<dt>Subtract</dt>\n<dd>The result of <em>change-image</em> - <em>base-image</em>, with underflow\nwrapping around (<em>mod</em> MaxRGB+1). The <strong>add</strong> and <strong>subtract</strong>\noperators can be used to perform reversible transformations.\n</dd>\n<dt>Difference</dt>\n<dd>The result of abs(<em>change-image</em> - <em>base-image</em>). This is\nuseful for comparing two very similar images.\n</dd>\n<dt>Divide</dt>\n<dd>The result of <em>change-image</em> / <em>base-image</em>. This is useful\nfor improving the readability of text on unevenly illuminated photos (by\nusing a gaussian blurred copy of change-image as base-image).\n</dd>\n<dt>Multiply</dt>\n<dd>The result of <em>change-image</em> * <em>base-image</em>. This is useful for\nthe creation of drop-shadows.\n</dd>\n<dt>Bumpmap</dt>\n<dd>The result <em>base-image</em> shaded by <em>change-image</em>.\n</dd>\n<dt>Copy</dt>\n<dd>The resulting image is <em>base-image</em> replaced with\n<em>change-image</em>. Here the matte information is ignored.\n</dd>\n<dt>CopyRed</dt>\n<dd>The resulting image is the red channel in <em>base-image</em> replaced with\nthe red channel in <em>change-image</em>. The other channels are copied\nuntouched.\n</dd>\n<dt>CopyGreen</dt>\n<dd>The resulting image is the green channel in <em>base-image</em> replaced\nwith the green channel in <em>change-image</em>. The other channels are\ncopied untouched.\n</dd>\n<dt>CopyBlue</dt>\n<dd>The resulting image is the blue channel in <em>base-image</em> replaced\nwith the blue channel in <em>change-image</em>. The other channels are\ncopied untouched.\n</dd>\n<dt>CopyOpacity</dt>\n<dd>The resulting image is the opacity channel in <em>base-image</em> replaced\nwith the opacity channel in <em>change-image</em>. The other channels are\ncopied untouched.\n</dd>\n<dt>CopyCyan</dt>\n<dd>The resulting image is the cyan channel in <em>base-image</em> replaced\nwith the cyan channel in <em>change-image</em>. The other channels are\ncopied untouched. Use of this operator requires that base-image be in\nCMYK(A) colorspace.\n</dd>\n<dt>CopyMagenta</dt>\n<dd>The resulting image is the magenta channel in <em>base-image</em>\nreplaced with the magenta channel in <em>change-image</em>. The other\nchannels are copied untouched. Use of this operator requires that\nbase-image be in CMYK(A) colorspace.\n</dd>\n<dt>CopyYellow</dt>\n<dd>The resulting image is the yellow channel in <em>base-image</em>\nreplaced with the yellow channel in <em>change-image</em>. The other\nchannels are copied untouched. Use of this operator requires that\nbase-image be in CMYK(A) colorspace.\n</dd>\n<dt>CopyBlack</dt>\n<dd>The resulting image is the black channel in <em>base-image</em>\nreplaced with the black channel in <em>change-image</em>. The other\nchannels are copied untouched. Use of this operator requires that\nbase-image be in CMYK(A) colorspace. If change-image is not in CMYK\nspace, then the change-image pixel intensities are used.\n</dd>\n</dl>\n</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-compress\"></a>-compress <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are: <em>None</em>, <em>BZip</em>, <em>Fax</em>,\n<em>Group3</em>, <em>Group4</em>,\n<em>JPEG</em>, <em>Lossless</em>,\n<em>LZW</em>, <em>RLE</em>, <em>Zip</em>, <em>LZMA</em>, <em>JPEG2000</em>,\n<em>JPEG2000</em>, <em>JBIG</em>, <em>JBIG2</em>, <em>WebP</em>, or <em>ZSTD</em>.\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <strong>+compress</strong> to store the binary image in an uncompressed format.\nThe default is the compression type of the specified image file.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>\"Lossless\"</em> refers to lossless JPEG, which is only available if\nthe JPEG library has been patched to support it. Use of lossless JPEG is\ngenerally not recommended.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the <strong>-quality</strong> option to set the compression level to be used\nby the JPEG, JPEG-2000, PNG, MIFF, MPEG, and TIFF encoders. Use the\n<strong>-sampling-factor</strong> option to set the sampling factor to be used\nby the DPX, JPEG, MPEG, and YUV encoders for downsampling the chroma\nchannels.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-contrast\"></a>-contrast\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enhance or reduce the image contrast</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option enhances the intensity differences between the lighter and\ndarker elements of the image. Use <strong>-contrast</strong> to enhance\nthe image\nor <strong>+contrast</strong> to reduce the image contrast.\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor a more pronounced effect you can repeat the option:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert rose: -contrast -contrast rose_c2.png\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-convolve\"></a>-convolve <i>&lt;kernel&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>convolve image with the specified convolution kernel</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe kernel is specified as a comma-separated list of floating point\nvalues, ordered left-to right, starting with the top row. The order of\nthe kernel is determined by the square root of the number of entries.\nPresently only square kernels are supported.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-create-directories\"></a>-create-directories\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create output directory if required</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option with <strong>-output-directory</strong> if the input paths contain\nsubdirectories and it is desired to create similar subdirectories in the\noutput directory.  Without this option, <strong>mogrify</strong> will fail if the\nrequired output directory does not exist.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-crop\"></a>-crop <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details\nabout the geometry specification.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe width and height give the size of the image that remains after cropping,\nand <em>x</em> and <em>y</em> are offsets that give the location of the top left\ncorner of the cropped\nimage with respect to the original image.  To specify the amount to be\nremoved, use <strong>-shave</strong> instead.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the <em>x</em> and <em>y</em> offsets are present, a single image is\ngenerated, consisting of the pixels from the cropping region.\nThe offsets specify the location of the upper left corner of\nthe cropping region measured downward and rightward with respect to the\nupper left corner of the image.\nIf the <strong>-gravity</strong> option is present with <em>NorthEast, East,</em>\nor <em>SouthEast</em>\ngravity, it gives the distance leftward from the right edge\nof the image to the right edge of the cropping region.  Similarly, if\nthe <strong>-gravity</strong> option is present with <em>SouthWest, South,</em>\nor <em>SouthEast</em>\ngravity, the distance is measured upward between the bottom\nedges.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the <em>x</em> and <em>y</em> offsets are omitted, a set of tiles of the\nspecified geometry, covering the entire input image, is generated.  The\nrightmost tiles and the bottom tiles are smaller if the\nspecified geometry extends beyond the dimensions of the input image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-cycle\"></a>-cycle <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image colormap by amount</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>Amount</em> defines the number of positions each colormap entry isshifted.\n</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <tt>events</tt> parameter specifies which events are to be logged.  It\ncan be either <tt>None</tt>, <tt>All</tt>, or a comma-separated list\nconsisting of one or more of the following domains:\n<tt>Annotate</tt>,\n<tt>Blob</tt>,\n<tt>Cache</tt>,\n<tt>Coder</tt>,\n<tt>Configure</tt>,\n<tt>Deprecate</tt>,\n<tt>Error</tt>,\n<tt>Exception</tt>,\n<tt>FatalError</tt>,\n<tt>Information</tt>,\n<tt>Locale</tt>,\n<tt>Option</tt>,\n<tt>Render</tt>,\n<tt>Resource</tt>,\n<tt>TemporaryFile</tt>,\n<tt>Transform</tt>,\n<tt>User</tt>.\n<tt>Warning</tt>, or\n<tt>X11</tt>,\nFor example, to log cache and blob events, use</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -debug \"Cache,Blob\" rose: rose.png\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe \"User\" domain is normally empty, but developers can log \"User\" events\nin their private copy of GraphicsMagick.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the <strong>-log</strong> option to specify the format for debugging output.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+debug</strong> to turn off all logging.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAn alternative to using <strong>-debug</strong> is to use the <strong>MAGICK_DEBUG</strong>\nenvironment variable. The allowed values for the <strong>MAGICK_DEBUG</strong>\nenvironment variable are the same as for the <strong>-debug</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-deconstruct\"></a>-deconstruct\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>break down an image sequence into constituent parts</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option compares each image with the next in a sequence and\nreturns the maximum bounding region of any pixel differences it discovers.\nThis method can undo a coalesced sequence returned by the\n<strong>-coalesce</strong> option, and is useful for removing redundant information\nfrom a GIF or MNG animation.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images\nis terminated by the appearance of any option.\nIf the <strong>-deconstruct</strong>\noption appears after all of the input images, all images are deconstructed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-define\"></a>-define <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">This option creates one or more definitions for coders and\ndecoders to use while reading and writing image data. Definitions\nmay be passed to coders and decoders to control options that are\nspecific to certain image formats. If <em>value</em> is missing for a\ndefinition, an empty-valued definition of a flag will be created with\nthat name. This is used to control on/off options. Use <tt>+define\n&lt;key&gt;,...</tt> to remove definitions previously created. Use\n<tt>+define \"*\"</tt> to remove all existing definitions.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe following definitions may be created:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>cineon:colorspace={rgb|cineonlog}</dt>\n<dd>Use the cineon:colorspace option when reading a Cineon file to\nspecify the colorspace the Cineon file uses. This overrides the colorspace\ntype implied by the DPX header (if any).\n</dd>\n<dt>dpx:bits-per-sample=&lt;value&gt;</dt>\n<dd>If the dpx:bits-per-sample key is defined, GraphicsMagick will write\nDPX images with the specified bits per sample, overriding any existing\ndepth value. If this option is not specified, then the value is based on\nthe existing image depth value from the original image file. The DPX\nstandard supports bits per sample values of 1, 8, 10, 12, and 16. Many\nDPX readers demand a sample size of 10 bits with type A padding (see\nbelow).\n</dd>\n<dt>dpx:colorspace={rgb|cineonlog}</dt>\n<dd>Use the dpx:colorspace option when reading a DPX file to\nspecify the colorspace the DPX file uses. This overrides the colorspace\ntype implied by the DPX header (if any).\n</dd>\n<dt>dpx:packing-method={packed|a|b|lsbpad|msbpad}</dt>\n<dd>DPX samples are output within 32-bit words. They may be tightly\npacked end-to-end within the words (\"packed\"), padded with null bits to\nthe right of the sample (\"a\" or \"lsbpad\"), or padded with null bits to the\nleft of the sample (\"b\" or \"msbpad\"). This option only has an effect for\nsample sizes of 10 or 12 bits. If samples are not packed, the DPX\nstandard recommends type A padding. Many DPX readers demand a sample size\nof 10 bits with type A padding.\n</dd>\n<dt>dpx:pixel-endian={lsb|msb}</dt>\n<dd>Allows the user to specify the endian order of the pixels when\nreading or writing the DPX files. Sometimes this is useful if the file is\n(or must be) written incorrectly so that the file header and the pixels\nuse different endianness.\n</dd>\n<dt>dpx:swap-samples={true|false}</dt>\n<dd>GraphicsMagick strives to adhere to the DPX standard but certain\naspects of the standard can be quite confusing. As a result, some 10-bit\nDPX files have Red and Blue interchanged, or Cb and Cr interchanged due\nto an different interpretation of the standard, or getting the wires\ncrossed. The swap-samples option may be supplied when reading or writing\nin order to read or write using the necessary sample order.\n</dd>\n<dt>gradient:direction={South|North|West|East|NorthWest|NorthEast|SouthWest|SouthEast}</dt>\n<dd>By default, the gradient coder produces a gradient from top to\nbottom (\"South\").  Since GraphicsMagick 1.3.35, the gradient direction\nmay be specified to produce gradient vectors according to a\ngravity-like specification.  The arguments are <strong>South</strong> (Top to\nBottom), <strong>North</strong> (Bottom to Top), <strong>West</strong> (Right to Left),\n<strong>East</strong> (Left to Right), <strong>NorthWest</strong> (Bottom-Right to\nTop-Left), <strong>NorthEast</strong> (Bottom-Left to Top-Right),\n<strong>SouthWest</strong> (Top-Right Bottom-Left), and <strong>SouthEast</strong>\n(Top-Left to Bottom-Right).\n</dd>\n<dt>jp2:rate=&lt;value&gt;</dt>\n<dd>Specify the compression factor to use while writing JPEG-2000\nfiles. The compression factor is the reciprocal of the compression\nratio. The valid range is 0.0 to 1.0, with 1.0 indicating lossless\ncompression. If defined, this value overrides the -quality\nsetting. The default quality setting of 75 results in a rate value of\n0.06641.\n</dd>\n<dt>jpeg:block-smoothing={true|false}</dt>\n<dd>Enables or disables block smoothing when reading a JPEG file\n(default enabled).\n</dd>\n<dt>jpeg:dct-method=&lt;value&gt;</dt>\n<dd>Selects the IJG JPEG library DCT implementation to use. The\nencoding implementations vary in speed and encoding error. The\navailable choices for <strong>value</strong> are <strong>islow</strong>, <strong>ifast</strong>,\n<strong>float</strong>, <strong>default</strong> and <strong>fastest</strong>. Note that\n<strong>fastest</strong> might not necessarily be fastest on your CPU, depending\non the choices made when the JPEG library was built and how your CPU\nbehaves.\n</dd>\n<dt>jpeg:fancy-upsampling={true|false}</dt>\n<dd>Enables or disables fancy upsampling when reading a JPEG file\n(default enabled).\n</dd>\n<dt>jpeg:max-scan-number=&lt;value&gt;</dt>\n<dd>Specifies an integer value for the maximum number of progressive\nscans allowed in a JPEG file.  The default maximum is 100 scans.  This\nlimit is imposed due to a weakness in the JPEG standard which allows\nsmall JPEG files to take many minutes or hours to be read.\n</dd>\n<dt>jpeg:max-warnings=&lt;value&gt;</dt>\n<dd>Specifies an integer value for how many warnings are allowed for\nany given error type before being promoted to a hard error.  JPEG\nfiles producing excessive warnings indicate a problem with the file.\n</dd>\n<dt>jpeg:optimize-coding={true|false}</dt>\n<dd>Selects if huffman encoding should be used. Huffman encoding is enabled\nby default, but may be disabled for very large images since it encoding\nrequires that the entire image be buffered in memory. Huffman encoding\nproduces smaller JPEG files at the expense of added compression time and\nmemory consumption.\n</dd>\n<dt>jpeg:preserve-settings</dt>\n<dd>If the jpeg:preserve-settings flag is defined, the JPEG encoder will\nuse the same \"quality\" and \"sampling-factor\" settings that were found\nin the input file, if the input was in JPEG format. These settings are\nalso preserved if the input is a JPEG file and the output is a JNG\nfile.  If the colorspace of the output file differs from that of the\ninput file, the quality setting is preserved but the sampling-factors\nare not.\n</dd>\n<dt>pcl:fit-to-page</dt>\n<dd>If the pcl:fit-to-page flag is defined, then the printer is\nrequested to scale the image to fit the page size (width and/or\nheight).</dd>\n<dt>mng:maximum-loops=&lt;value&gt;</dt>\n<dd>mng:maximum-loops specifies the maximum number of loops allowed to\nbe specified by a MNG LOOP chunk. Without an imposed limit, a MNG file\ncould request up to 2147483647 loops, which could run for a very long\ntime.  The current default limit is 512 loops.\n</dd>\n<dt>pdf:use-cropbox={true|false}</dt>\n<dd>If the pdf:use-cropbox flag is set to <strong>true</strong>, then\nGhostscript is requested to apply the PDF crop box.\n</dd>\n<dt>pdf:stop-on-error={true|false}</dt>\n<dd>If the pdf:stop-on-error flag is set to <strong>true</strong>, then\nGhostscript is requested to stop processing the PDF when the first\nerror is encountered.  Otherwise it will attempt to process all\nrequested pages.\n</dd>\n<dt>ps:imagemask</dt>\n<dd>If the ps:imagemask flag is defined, the PS3 and EPS3 coders will\ncreate Postscript files that render bilevel images with the Postscript\nimagemask operator instead of the image operator.\n</dd>\n<dt>ptif:minimum-geometry=&lt;geometry&gt;</dt>\n<dd>If the ptif:minimum-geometry key is defined, GraphicsMagick will\nuse it to determine the minimum frame size to output when writing a\npyramid TIFF file (a TIFF file containing a succession of reduced\nversions of the first frame). The default minimum geometry is 32x32.\n</dd>\n<dt>tiff:alpha={unspecified|associated|unassociated}</dt>\n<dd>Specify the TIFF alpha channel type when reading or writing TIFF files,\noverriding the normal value. The default alpha channel type for new files\nis unspecified alpha. Existing alpha settings are preserved when\nconverting from one TIFF file to another. When a TIFF file uses\nassociated alpha, the image pixels are pre-multiplied (i.e. altered) with\nthe alpha channel. Files with \"associated\" alpha appear as if they were\nalpha composited on a black background when the matte channel is\ndisabled. If the unassociated alpha type is selected, then the alpha\nchannel is saved without altering the pixels. Photoshop recognizes\nassociated alpha as transparency information, if the file is saved with\nunassociated alpha, the alpha information is loaded as an independent\nchannel.  Note that for many years, ImageMagick and GraphicsMagick marked\nTIFF files as using associated alpha, without properly pre-multiplying\nthe pixels.\n</dd>\n<dt>tiff:fill-order={msb2lsb|lsb2msb}</dt>\n<dd>If the tiff:fill-order key is defined, GraphicsMagick will use it to\ndetermine the bit fill order used while writing TIFF files. The normal default\nis \"msb2lsb\", which matches the native bit order of all modern CPUs. The\nonly exception to this is when Group3 or Group4 FAX compression is\nrequested since FAX machines send data in bit-reversed order and\ntherefore RFC 2301 recommends using reverse order.\n</dd>\n<dt>tiff:group-three-options=&lt;value&gt;</dt>\n<dd>If the tiff:group-three-options key is defined, GraphicsMagick\nwill use it to set the group3 options tag when writing\ngroup3-compressed TIFF.  Please see the TIFF specification for the\nusage of this tag.  The default value is 4.\n</dd>\n<dt>tiff:ignore-tags=&lt;tags&gt;</dt>\n<dd>If the tiff:ignore-tags key is defined, then it is used as a list\nof comma-delimited integer TIFF tag values to ignore while reading the\nTIFF file.  This is useful in order to be able to read files which\nwhich otherwise fail to read due to problems with TIFF tags.  Note\nthat some TIFF tags are required in order to be able to read the image\ndata at all.\n</dd>\n<dt>tiff:report-warnings={false|true}</dt>\n<dd>If the tiff:report-warnings key is defined and set to <strong>true</strong>,\nthen TIFF warnings are reported as a warning exception rather than as\na coder log message.  Such warnings are reported after the image has\nbeen read or written.  Most TIFF warnings are benign but sometimes\nthey may help deduce problems with the TIFF file, or help detect that\nthe TIFF file requires a special application to read successfully due\nto the use of proprietary or specialized extensions.\n</dd>\n<dt>tiff:sample-format={unsigned|ieeefp}</dt>\n<dd>If the tiff:sample-format key is defined, GraphicsMagick will use it to\ndetermine the sample format used while writing TIFF files. The default is\n\"unsigned\". Specify \"ieeefp\" in order to write floating-point TIFF\nfiles with float (32-bit) or double (64-bit) values. Use the\ntiff:bits-per-sample define to determine the type of floating-point value\nto use.\n</dd>\n<dt>tiff:max-sample-value=&lt;value&gt;</dt>\n<dd>If the tiff:max-sample-value key is defined, GraphicsMagick will use the\nassigned value as the maximum floating point value while reading or\nwriting IEEE floating point TIFFs. Otherwise the maximum value is 1.0 or\nthe value obtained from the file's SMaxSampleValue tag (if present). The\nfloating point data is currently not scanned in advance to determine a\nbest maximum sample value so if the range is not 1.0, or the\nSMaxSampleValue tag is not present, it may be necessary to\n(intelligently) use this parameter to properly read a file.\n</dd>\n<dt>tiff:min-sample-value=&lt;value&gt;</dt>\n<dd>If the tiff:min-sample-value key is defined, GraphicsMagick will use\nthe assigned value as the minimum floating point value while reading or\nwriting IEEE floating point TIFFs. Otherwise the minimum value is 0.0 or\nthe value obtained from the file's SMinSampleValue tag (if present).\n</dd>\n<dt>tiff:bits-per-sample=&lt;value&gt;</dt>\n<dd>If the tiff:bits-per-sample key is defined, GraphicsMagick will write\nimages with the specified bits per sample, overriding any existing depth\nvalue. Value may be any in the range of 1 to 32, or 64 when the default\n'unsigned' format is written, or 16/32/24/64 if IEEEFP format is written.\nPlease note that the baseline TIFF 6.0 specification only requires\nreaders to handle certain powers of two, and the values to be handled\ndepend on the nature of the image (e.g. colormapped, grayscale, RGB, CMYK).\n</dd>\n<dt>tiff:samples-per-pixel=&lt;value&gt;</dt>\n<dd>If the tiff:samples-per-pixel key is defined to a value, the TIFF coder\nwill write TIFF images with the defined samples per pixel, overriding any\nvalue stored in the image. This option should not normally be used.\n</dd>\n<dt>tiff:rows-per-strip=&lt;value&gt;</dt>\n<dd>Allows the user to specify the number of rows per TIFF strip.\nRounded up to a multiple of 16 when using JPEG compression. Ignored when\nusing tiles.\n</dd>\n<dt>tiff:strip-per-page=true</dt>\n<dd>Requests that the image is written in a single TIFF strip. This is\nnormally the default when group3 or group4 compression is requested\nwithin reasonable limits. Requesting a single strip for large images may\nresult in failure due to resource consumption in the writer or reader.\n</dd>\n<dt>tiff:tile</dt>\n<dd>Enable writing tiled TIFF (rather than stripped) using the default tile\nsize. Tiled TIFF organizes the image as an array of smaller images\n(tiles) in order to enable random access.\n</dd>\n<dt>tiff:tile-geometry=&lt;width&gt;x&lt;height&gt;</dt>\n<dd>Specify the tile size to use while writing tiled TIFF. Width and\nheight should be a multiple of 16. If the value is not a multiple of 16,\nthen it will be rounded down. Enables tiled TIFF if it has not already\nbeen enabled. GraphicsMagick does not use tiled storage internally so\ntiles need to be converted back and forth from the internal\nscanline-oriented storage to tile-oriented storage. Testing with typical\nRGB images shows that useful square tile size values range from 128x128\nto 1024x1024. Large images which require using a disk-based pixel cache\nbenefit from large tile sizes while images which fit in memory work well\nwith smaller tile sizes.\n</dd>\n<dt>tiff:tile-width=&lt;width&gt;</dt>\n<dd>Specify the tile width to use while writing tiled TIFF. The tile height\nis then defaulted to an appropriate size. Width should be a multiple of\n16. If the value is not a multiple of 16, then it will be rounded down.\nEnables tiled TIFF if it has not already been enabled.\n</dd>\n<dt>tiff:tile-height=&lt;height&gt;</dt>\n<dd>Specify the tile height to use while writing tiled TIFF. The tile width\nis then defaulted to an appropriate size. Height should be a multiple of\n16. If the value is not a multiple of 16, then it will be rounded down.\nEnables tiled TIFF if it has not already been enabled.\n</dd>\n<dt>tiff:webp-lossless={TRUE|FALSE}</dt>\n<dd>Specify a value of <strong>TRUE</strong> to enable lossless mode while\nwriting WebP-compressed TIFF files. The WebP <strong>webp:lossless</strong>\noption may also be used.  The quality factor set by the\n<strong>-quality</strong> option may be used to influence the level of effort\nexpended while compressing.\n</dd>\n<dt>tiff:zstd-compress-level=&lt;value&gt;</dt>\n<dd>Specify the compression level to use while writing Zstd-compressed\nTIFF files. The valid range is 1 to 22. If this define is not\nspecified, then the 'quality' value is used such that the default\nquality setting of 75 is translated to a compress level of 9 such that\n'quality' has a useful range of 10-184 if used for this purpose.\n</dd>\n<dt>webp:lossless={true|false}</dt>\n<dd>Enable lossless encoding.\n</dd>\n<dt>webp:method={0-6}</dt>\n<dd>Quality/speed trade-off.\n</dd>\n<dt>webp:image-hint={default,graph,photo,picture}</dt>\n<dd>Hint for image type.\n</dd>\n<dt>webp:target-size=&lt;integer&gt;</dt>\n<dd>Target size in bytes.\n</dd>\n<dt>webp:target-psnr=&lt;float&gt;</dt>\n<dd>Minimal distortion to try to achieve.\n</dd>\n<dt>webp:segments={1-4}</dt>\n<dd>Maximum number of segments to use.\n</dd>\n<dt>webp:sns-strength={0-100}</dt>\n<dd>Spatial Noise Shaping.\n</dd>\n<dt>webp:filter-strength={0-100}</dt>\n<dd>Filter strength.\n</dd>\n<dt>webp:filter-sharpness={0-7}</dt>\n<dd>Filter sharpness.\n</dd>\n<dt>webp:filter-type={0,1}</dt>\n<dd>Filtering type. 0 = simple, 1 = strong (only used if\nfilter-strength &gt; 0 or autofilter is enabled).\n</dd>\n<dt>webp:auto-filter={true|false}</dt>\n<dd>Auto adjust filter's strength.\n</dd>\n<dt>webp:alpha-compression=&lt;integer&gt;</dt>\n<dd>Algorithm for encoding the alpha plane (0 = none, 1 = compressed\nwith WebP lossless). Default is 1.\n</dd>\n<dt>webp:alpha-filtering=&lt;integer&gt;</dt>\n<dd>Predictive filtering method for alpha plane. 0: none, 1: fast, 2:\nbest. Default is 1.\n</dd>\n<dt>webp:alpha-quality={0-100}</dt>\n<dd>Between 0 (smallest size) and 100 (lossless). Default is 100.\n</dd>\n<dt>webp:pass=[1..10]</dt>\n<dd>Number of entropy-analysis passes.\n</dd>\n<dt>webp:show-compressed={true|false}</dt>\n<dd>Export the compressed picture back.  In-loop filtering is not\napplied.\n</dd>\n<dt>webp:preprocessing=[0,1,2]</dt>\n<dd>0=none, 1=segment-smooth, 2=pseudo-random dithering\n</dd>\n<dt>webp:partitions=[0-3]</dt>\n<dd>log2(number of token partitions) in [0..3].  Default is 0 for\neasier progressive decoding.\n</dd>\n<dt>webp:partition-limit={0-100}</dt>\n<dd>Quality degradation allowed to fit the 512k limit on prediction\nmodes coding (0: no degradation, 100: maximum possible\ndegradation).\n</dd>\n<dt>webp:emulate-jpeg-size={true|false}</dt>\n<dd>If true, compression parameters will be remapped to better match\nthe expected output size from JPEG compression. Generally, the output\nsize will be similar but the degradation will be lower.\n</dd>\n<dt>webp:thread-level=&lt;integer&gt;</dt>\n<dd>If non-zero, try and use multi-threaded encoding.\n</dd>\n<dt>webp:low-memory={true|false}</dt>\n<dd>If set, reduce memory usage (but increase CPU use)\n</dd>\n<dt>webp:use-sharp-yuv={true|false}</dt>\n<dd>If set, if needed, use sharp (and slow) RGB-&gt;YUV conversion\n</dd>\n</dl>\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, to create a postscript file that will render only the black\npixels of a bilevel image, use:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert bilevel.tif -define ps:imagemask eps3:stencil.ps\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-delay\"></a>-delay <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is useful for regulating the animation of image sequences\n<em>Delay/100</em> seconds must expire before the display\nof the next image. The default is no delay between each showing of the\nimage sequence. The maximum delay is 65535.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can specify a delay range (e.g. <em>-delay 10-500</em>) which sets the\nminimum and maximum delay.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-density\"></a>-density <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">This option specifies the image resolution to store while encoding a\nraster image or the canvas resolution while rendering (reading) vector\nformats such as Postscript, PDF, WMF, and SVG into a raster image. Image\nresolution provides the unit of measure to apply when rendering to an\noutput device or raster image. The default unit of measure is in dots\nper inch (DPI). The <strong>-units</strong> option may be used to select dots per\ncentimeter instead.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"> The default resolution is 72 dots per inch, which is equivalent to\none point per pixel (Macintosh and Postscript standard). Computer\nscreens are normally 72 or 96 dots per inch while printers typically\nsupport 150, 300, 600, or 1200 dots per inch. To determine the\nresolution of your display, use a ruler to measure the width of your\nscreen in inches, and divide by the number of horizontal pixels (1024 on\na 1024x768 display).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">If the file format supports it, this option may be used to update\nthe stored image resolution. Note that Photoshop stores and obtains\nimage resolution from a proprietary embedded profile. If this profile is\nnot stripped from the image, then Photoshop will continue to treat the\nimage using its former resolution, ignoring the image resolution\nspecified in the standard file header.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">The density option is an attribute and does not alter the underlying\nraster image. It may be used to adjust the rendered size for desktop\npublishing purposes by adjusting the scale applied to the pixels. To\nresize the image so that it is the same size at a different resolution,\nuse the <strong>-resample</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-depth\"></a>-depth <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis is the number of bits of color to preserve in the image. Any value\nbetween 1 and <strong>QuantumDepth</strong> (build option) may be specified,\nalthough 8 or 16 are the most common values. Use this option to specify\nthe depth of raw images whose depth is unknown such as GRAY, RGB, or\nCMYK, or to change the depth of any image after it has been read.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">The depth option is applied to the pixels immediately so it may be\nused as a form of simple compression by discarding the least significant\nbits. Reducing the depth in advance may speed up color quantization, and\nhelp create smaller file sizes when using a compression algorithm like\nLZW or ZIP.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -descend\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>obtain image by descending window hierarchy</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -despeckle\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>reduce the speckles within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-displace\"></a>-displace <i>&lt;horizontal scale&gt;x&lt;vertical scale&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shift image pixels as defined by a displacement map</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWith this option, <em>composite image</em> is used as a displacement map.  Black,\nwithin the displacement map, is a maximum positive displacement.  White is a\nmaximum negative displacement and middle gray is neutral.  The displacement\nis scaled to determine the pixel shift.  By default, the displacement applies\nin both the horizontal and vertical directions.  However, if you specify\n<em>mask</em>, <em>composite image</em> is the horizontal X displacement and\n<em>mask</em> the vertical Y displacement.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-display\"></a>-display <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is used with convert for\nobtaining image or font from this X server.  See <em>X(1)</em>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-dispose\"></a>-dispose <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe Disposal Method indicates the way in which the graphic is to\nbe treated after being displayed.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nHere are the valid methods:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    Undefined       No disposal specified.\n    None            Do not dispose between frames.\n    Background      Overwrite the image area with\n                    the background color.\n    Previous        Overwrite the image area with\n                    what was there prior to rendering\n                    the image.\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-dissolve\"></a>-dissolve <i>&lt;percent&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>dissolve an image into another by the given percent</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe opacity of the composite image is multiplied by the given percent,\nthen it is composited over the main image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-dither\"></a>-dither\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe basic strategy of dithering is to trade intensity resolution for spatial\nresolution by averaging the intensities of several neighboring pixels.\nImages which suffer from severe contouring when reducing colors can be\nimproved with this option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-colors</strong> or <strong>-monochrome</strong> option is required for this option\nto take effect.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+dither</strong> to turn off dithering and to render PostScript\nwithout text or graphic aliasing. Disabling dithering often (but not\nalways) leads to decreased processing time.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-draw\"></a>-draw <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with one or more graphic primitives</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to annotate an image with one or more graphic primitives.\nThe primitives include shapes, text, transformations,\nand pixel operations.  The shape primitives are</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     point           x,y\n     line            x0,y0 x1,y1\n     rectangle       x0,y0 x1,y1\n     roundRectangle  x0,y0 x1,y1 wc,hc\n     arc             x0,y0 x1,y1 a0,a1\n     ellipse         x0,y0 rx,ry a0,a1\n     circle          x0,y0 x1,y1\n     polyline        x0,y0  ...  xn,yn\n     polygon         x0,y0  ...  xn,yn\n     Bezier          x0,y0  ...  xn,yn\n     path            path specification\n     image           operator x0,y0 w,h filename\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe text primitive is</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     text            x0,y0 string\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe text gravity primitive is</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     gravity         NorthWest, North, NorthEast, West, Center,\n                     East, SouthWest, South, or SouthEast\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe text gravity primitive only affects the placement of text and\ndoes not interact with the other primitives.  It is equivalent to\nusing the <strong>-gravity</strong> commandline option, except that it is\nlimited in scope to the <strong>-draw</strong> option in which it appears.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe transformation primitives are</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     rotate          degrees\n     translate       dx,dy\n     scale           sx,sy\n     skewX           degrees\n     skewY           degrees\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe pixel operation primitives are</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     color           x0,y0 method\n     matte           x0,y0 method\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe shape primitives are drawn in the color specified in the preceding\n<strong>-stroke</strong> option. Except for the <strong>line</strong> and <strong>point</strong>\nprimitives, they are filled with the color specified in the preceding\n<strong>-fill</strong> option.  For unfilled shapes, use <tt>-fill none</tt></font></td></tr></table>.\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Point</strong> requires a single coordinate.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Line</strong> requires a start and end coordinate.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Rectangle</strong>\nexpects an upper left and lower right coordinate.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>RoundRectangle</strong> has the upper left and lower right coordinates\nand the width and height of the corners.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Circle</strong> has a center coordinate and a coordinate for\nthe outer edge.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>Arc</strong> to inscribe an elliptical arc within\na rectangle.  Arcs require a start and end point as well as the degree\nof rotation (e.g. 130,30 200,100 45,90).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>Ellipse</strong> to draw a partial ellipse\ncentered at the given point with the x-axis and y-axis radius\nand start and end of arc in degrees (e.g. 100,100 100,150 0,360).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFinally, <strong>polyline</strong> and <strong>polygon</strong> require\nthree or more coordinates to define its boundaries.\nCoordinates are integers separated by an optional comma.  For example,\nto define a circle centered at 100,100\nthat extends to 150,150 use:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -draw 'circle 100,100 150,150'\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Paths</strong>\n(See <a href=\"http://www.w3.org/TR/SVG/paths.html\">Paths</a>)\nrepresent an outline of an object which is defined in terms of\nmoveto (set a new current point), lineto (draw a straight line),\ncurveto (draw a curve using a cubic Bezier), arc (elliptical or\ncircular arc) and closepath (close the current shape by drawing a line\nto the last moveto) elements. Compound paths (i.e., a path with\nsubpaths, each consisting of a single moveto followed by one or more\nline or curve operations) are possible to allow effects such as\n\"donut holes\" in objects.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>image</strong> to composite an image with another image. Follow the\nimage keyword with the composite operator, image location, image size,\nand filename:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -draw 'image Over 100,100 225,225 image.jpg'\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can use 0,0 for the image size, which means to use the actual\ndimensions found in the image header. Otherwise, it will\nbe scaled to the given dimensions.\nSee <strong>-compose</strong> for a description of the composite operators.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>text</strong> to annotate an image with text. Follow the text\ncoordinates with a string. If the string has embedded spaces, enclose it\nin single or double quotes. Optionally you can include the image\nfilename, type, width, height, or other image attribute by embedding\nspecial format character. See <strong>-comment</strong> for details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -draw 'text 100,100 \"%m:%f %wx%h\"'\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nannotates the image with <tt>MIFF:bird.miff 512x480</tt> for an image titled\n<tt>bird.miff</tt>\nand whose width is 512 and height is 480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the first character of <em>string</em> is <em>@</em>, the text is read\nfrom a file titled by the remaining characters in the string.  Please\nnote that if the string comes from an untrusted source that it should\nbe sanitized before use (a security risk).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Rotate</strong> rotates subsequent shape primitives and text primitives about\nthe origin of the main image. If the <strong>-region</strong> option precedes the\n<strong>-draw</strong> option, the origin for transformations is the upper left\ncorner of the region.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Translate</strong> translates them.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Scale</strong> scales them.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>SkewX</strong> and <strong>SkewY</strong> skew them with respect to the origin of\nthe main image or the region.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe transformations modify the current affine matrix, which is initialized\nfrom the initial affine matrix defined by the <strong>-affine</strong> option.\nTransformations are cumulative within the <strong>-draw</strong> option.\nThe initial affine matrix is not affected; that matrix is only changed by the\nappearance of another <strong>-affine</strong> option.  If another <strong>-draw</strong>\noption appears, the current affine matrix is reinitialized from\nthe initial affine matrix.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>color</strong> to change the color of a pixel to the fill color (see\n<strong>-fill</strong>). Follow the pixel coordinate\nwith a method:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     point\n     replace\n     floodfill\n     filltoborder\n     reset\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nConsider the target pixel as that specified by your coordinate. The\n<strong>point</strong>\nmethod recolors the target pixel. The <strong>replace</strong> method recolors any\npixel that matches the color of the target pixel.\n<strong>Floodfill</strong> recolors\nany pixel that matches the color of the target pixel and is a neighbor,\nwhereas <strong>filltoborder</strong> recolors any neighbor pixel that is not the\nborder color. Finally, <strong>reset</strong> recolors all pixels.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>matte</strong> to the change the pixel matte value to transparent. Follow\nthe pixel coordinate with a method (see the <strong>color</strong> primitive for\na description of methods). The <strong>point</strong> method changes the matte value\nof the target pixel. The <strong>replace</strong> method changes the matte value\nof any pixel that matches the color of the target pixel. <strong>Floodfill</strong>\nchanges the matte value of any pixel that matches the color of the target\npixel and is a neighbor, whereas\n<strong>filltoborder</strong> changes the matte\nvalue of any neighbor pixel that is not the border color (<strong>-bordercolor</strong>).\nFinally <strong>reset</strong> changes the matte value of all pixels.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can set the primitive color, font, and font bounding box\ncolor with\n<strong>-fill</strong>, <strong>-font</strong>, and <strong>-box</strong> respectively. Options\nare processed in command line order so be sure to use these\noptions <em>before</em> the <strong>-draw</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -edge <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>detect edges within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -emboss <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>emboss an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-encoding\"></a>-encoding <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from <em>AdobeCustom, AdobeExpert, AdobeStandard, AppleRoman,\nBIG5, GB2312, Latin 2, None, SJIScode, Symbol, Unicode, Wansung.</em></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-endian\"></a>-endian <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>MSB</em> indicates big-endian (e.g. SPARC, Motorola 68K) while\n<em>LSB</em> indicates little-endian (e.g. Intel 'x86, VAX) byte\nordering.  <em>Native</em> indicates to use the normal ordering for the\ncurrent CPU.  This option currently only influences the CMYK, DPX,\nGRAY, RGB, and TIFF, formats.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+endian</strong> to revert to unspecified endianness.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -enhance\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a digital filter to enhance a noisy image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -equalize\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform histogram equalization to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-extent\"></a>-extent <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite image on background color canvas image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option composites the image on a new background color\n(<strong>-background</strong>) canvas image of size &lt;width&gt;x&lt;height&gt;. The\nexisting image content is composited at the position specified by\ngeometry x and y offset and/or desired gravity (<strong>-gravity</strong>) using\nthe current image compose (<strong>-compose</strong>) method.  Image content\nwhich falls outside the bounds of the new image dimensions is\ndiscarded.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, this command creates a thumbnail of an image, and centers\nit on a red color backdrop image, offsetting the canvas ten pixels to\nthe left and five pixels up, with respect to the thumbnail:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert infile.jpg -thumbnail 120x80 -background red -gravity center \\\n              -extent 140x100-10-5 outfile.jpg\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis command reduces or expands a JPEG image to fit on an 800x600\ndisplay: </font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -size 800x600 input.jpg \\\n              -resize 800x600 -background black \\\n              -compose Copy -gravity center \\\n              -extent 800x600 \\\n              -quality 92 output.jpg\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the aspect ratio of the input image isn't exactly 4:3, then the\nimage is centered on an 800x600 black canvas. </font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-file\"></a>-file <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write annotated difference image to file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf <strong>-file</strong> is specified, then an annotated difference image is\ngenerated and written to the specified file. Pixels which differ between\nthe <strong>reference</strong> and <strong>compare</strong> images are modified from those in\nthe <strong>compare</strong> image so that the changed pixels become more obvious.\nSome images may require use of an alternative highlight style (see\n<strong>-highlight-style</strong>) or highlight color (see <strong>-highlight-color</strong>)\nbefore the changes are obvious.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-fill\"></a>-fill <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when filling a graphic primitive</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nColors are represented in GraphicsMagick in the same form used by SVG. Use \"gm convert -list color\" to list named colors:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    name               (named color)\n    #RGB               (hex numbers, 4 bits each)\n    #RRGGBB            (8 bits each)\n    #RRRGGGBBB         (12 bits each)\n    #RRRRGGGGBBBB      (16 bits each)\n    #RGBA              (4 bits each)\n    #RRGGBBAA          (8 bits each)\n    #RRRGGGBBBAAA      (12 bits each)\n    #RRRRGGGGBBBBAAAA  (16 bits each)\n    rgb(r,g,b)         (r,g,b are decimal numbers)\n    rgba(r,g,b,a)      (r,g,b,a are decimal numbers)\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEnclose the color specification in quotation marks to prevent the \"#\"\nor the parentheses from being interpreted by your shell.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -fill blue ...\n    gm convert -fill \"#ddddff\" ...\n    gm convert -fill \"rgb(65000,65000,65535)\" ...\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe shorter forms are scaled up, if necessary by replication.  For example, \n#3af, #33aaff, and #3333aaaaffff are all equivalent.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-draw</strong> for further details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-filter\"></a>-filter <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to affect the resizing operation of an image (see\n<strong>-geometry</strong>).\nChoose from these filters (ordered by approximate increasing CPU\ntime):</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Point\n     Box\n     Triangle\n     Hermite\n     Hanning\n     Hamming\n     Blackman\n     Gaussian\n     Quadratic\n     Cubic\n     Catrom\n     Mitchell\n     Lanczos\n     Bessel\n     Sinc\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default filter is automatically selected to provide the best quality\nwhile consuming a reasonable amount of time. The <strong>Mitchell</strong> filter\nis used if the image supports a palette, supports a matte channel, or is\nbeing enlarged, otherwise the <strong>Lanczos</strong> filter is used.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-flatten\"></a>-flatten\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>flatten a sequence of images</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn some file formats (e.g. Photoshop's PSD) complex images may be\nrepresented by \"layers\" (independent images) which must be composited\nin order to obtain the final rendition.  The <strong>-flatten</strong> option\naccomplishes this composition.  The sequence of images is replaced by\na single image created by compositing each image in turn, while\nrespecting composition operators and page offsets.  While\n<strong>-flatten</strong> is immediately useful for eliminating layers, it is\nalso useful as a general-purpose composition tool.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images is terminated by the appearance of any option.\nIf the <strong>-flatten</strong> option appears after all of the input images,\nall images are flattened.  Also see <strong>-mosaic</strong> which is similar to\n<strong>-flatten</strong> except that it adds a suitably-sized canvas base\nimage.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, this composites an image on top of a 640x400 transparent\nblack canvas image:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -size 640x300 xc:transparent \\\n              -compose over -page +0-100 \\\n              frame.png -flatten output.png\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nand this flattens a Photoshop PSD file:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert input.psd -flatten output.png\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-flip\"></a>-flip\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nreflect the scanlines in the vertical direction.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-flop\"></a>-flop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nreflect the scanlines in the horizontal direction.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-font\"></a>-font <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can tag a font to specify whether it is a PostScript, TrueType, or X11\nfont.  For example, <tt>Arial.ttf</tt> is a TrueType font, <tt>ps:helvetica</tt>\nis PostScript, and <tt>x:fixed</tt> is X11.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-foreground\"></a>-foreground <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the foreground color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-format\"></a>-format <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image format type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used with the <strong>mogrify</strong> utility,\nthis option will convert any image to the image format you specify.\nSee <em>GraphicsMagick(1)</em> for a list of image format types supported by\n<strong>GraphicsMagick</strong>, or see the output of 'gm -list format'.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default the file is written to its original name.  However, if the\nfilename extension matches a supported format, the extension is replaced\nwith the image format type specified with <strong>-format</strong>.  For example,\nif you specify <em>tiff</em> as the format type and the input image\nfilename is <em>image.gif</em>, the output image filename becomes\n<em>image.tiff</em>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-format\"></a>-format <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output formatted image characteristics</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used with the <strong>identify</strong> utility, or the <strong>convert</strong>\nutility with output written to the 'info:-' file specification, use\nthis option to print information about the image in a format of your\nchoosing.  You can include the image filename, type, width, height,\nExif data, or other image attributes by embedding special format\ncharacters:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     %b   file size\n     %c   comment\n     %d   directory\n     %e   filename extension\n     %f   filename\n     %g   page dimensions and offsets\n     %h   height\n     %i   input filename\n     %k   number of unique colors\n     %l   label\n     %m   magick\n     %n   number of scenes\n     %o   output filename\n     %p   page number\n     %q   image bit depth\n     %r   image type description\n     %s   scene number\n     %t   top of filename\n     %u   unique temporary filename\n     %w   width\n     %x   horizontal resolution\n     %y   vertical resolution\n     %A   transparency supported\n     %C   compression type\n     %D   GIF disposal method\n     %G   Original width and height\n     %H   page height\n     %M   original filename specification\n     %O   page offset (x,y)\n     %P   page dimensions (width,height)\n     %Q   compression quality\n     %T   time delay (in centi-seconds)\n     %U   resolution units\n     %W   page width\n     %X   page horizontal offset (x)\n     %Y   page vertical offset (y)\n     %@   trim bounding box\n     %#   signature\n     \\n   newline\n     \\r   carriage return\n     %%   %\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -format \"%m:%f %wx%h\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\ndisplays <strong>MIFF:bird.miff 512x480</strong> for an image\ntitled <strong>bird.miff</strong> and whose width is 512 and height is 480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the first character of <em>string</em> is <strong>@</strong>, the format is\nread from a file titled by the remaining characters in the string.\nPlease note that if the string comes from an untrusted source that it\nshould be sanitized before use since this may be used to incorporate\nany readable file on the system (a security risk).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe values of image type (<strong>%r</strong>) which may be returned include:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Bilevel\n     Grayscale\n     GrayscaleMatte\n     Palette\n     PaletteMatte\n     TrueColor\n     TrueColorMatte\n     ColorSeparation\n     ColorSeparationMatte\n     Optimize\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can also use the following special formatting syntax to print Exif\ninformation contained in the file:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     %[EXIF:&lt;tag&gt;]\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhere \"&lt;tag&gt;\" may be one of the following:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     *  (print all Exif tags, in keyword=data format)\n     !  (print all Exif tags, in tag_number format)\n     #hhhh (print data for Exif tag #hhhh)\n     ImageWidth\n     ImageLength\n     BitsPerSample\n     Compression\n     PhotometricInterpretation\n     FillOrder\n     DocumentName\n     ImageDescription\n     Make\n     Model\n     StripOffsets\n     Orientation\n     SamplesPerPixel\n     RowsPerStrip\n     StripByteCounts\n     XResolution\n     YResolution\n     PlanarConfiguration\n     ResolutionUnit\n     TransferFunction\n     Software\n     DateTime\n     Artist\n     WhitePoint\n     PrimaryChromaticities\n     TransferRange\n     JPEGProc\n     JPEGInterchangeFormat\n     JPEGInterchangeFormatLength\n     YCbCrCoefficients\n     YCbCrSubSampling\n     YCbCrPositioning\n     ReferenceBlackWhite\n     CFARepeatPatternDim\n     CFAPattern\n     BatteryLevel\n     Copyright\n     ExposureTime\n     FNumber\n     IPTC/NAA\n     ExifOffset\n     InterColorProfile\n     ExposureProgram\n     SpectralSensitivity\n     GPSInfo\n     ISOSpeedRatings\n     OECF\n     ExifVersion\n     DateTimeOriginal\n     DateTimeDigitized\n     ComponentsConfiguration\n     CompressedBitsPerPixel\n     ShutterSpeedValue\n     ApertureValue\n     BrightnessValue\n     ExposureBiasValue\n     MaxApertureValue\n     SubjectDistance\n     MeteringMode\n     LightSource\n     Flash\n     FocalLength\n     MakerNote\n     UserComment\n     SubSecTime\n     SubSecTimeOriginal\n     SubSecTimeDigitized\n     FlashPixVersion\n     ColorSpace\n     ExifImageWidth\n     ExifImageLength\n     InteroperabilityOffset\n     FlashEnergy\n     SpatialFrequencyResponse\n     FocalPlaneXResolution\n     FocalPlaneYResolution\n     FocalPlaneResolutionUnit\n     SubjectLocation\n     ExposureIndex\n     SensingMethod\n     FileSource\n     SceneType\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nJPEG specific information (from reading a JPEG file) may be obtained\nlike this:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     %[JPEG-&lt;tag&gt;]\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhere \"&lt;tag&gt;\" may be one of the following:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     *                 (all JPEG-related tags, in\n                        keyword=data format)\n     Quality           IJG JPEG \"quality\" estimate\n     Colorspace        JPEG colorspace numeric ID\n     Colorspace-Name   JPEG colorspace name\n     Sampling-factors  JPEG sampling factors\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPlease note that JPEG has no notion of \"quality\" and that the quality\nmetric used by, and estimated by the software is based on the quality\nmetric established by IJG JPEG 6b.  Other encoders (e.g. that used by\nAdobe Photoshop) use different encoding metrics.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSurround the format specification with quotation marks to prevent your shell\nfrom misinterpreting any spaces and square brackets.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-frame\"></a>-frame <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details about the geometry\nspecification.  The <strong>-frame</strong> option is not affected by the\n<strong>-gravity</strong> option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color of the border is specified with the <strong>-mattecolor</strong>\ncommand line option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -frame\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>include the X window frame in the imported image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-fuzz\"></a>-fuzz <i>&lt;distance&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colors within this Euclidean distance are considered equal</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA number of algorithms search for a target color. By default the color\nmust be exact. Use this option to match colors that are close (in\nEuclidean distance) to the target color in RGB 3D space. For example,\nif you want to automatically trim the edges of an image with\n<strong>-trim</strong> but the image was scanned and the target background color\nmay differ by a small amount. This option can account for these\ndifferences.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <em>distance</em> can be in absolute intensity units or, by appending\n<em>\"%\"</em>, as a percentage of the maximum possible intensity (255,\n65535, or 4294967295).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-gamma\"></a>-gamma <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe same color image displayed on two different workstations may look\ndifferent due to differences in the display monitor. Use gamma\ncorrection to adjust for this color difference. Reasonable values extend\nfrom <strong>0.8</strong> to <strong>2.3</strong>. Gamma less than 1.0 darkens the image and\ngamma greater than 1.0 lightens it. Large adjustments to image gamma may\nresult in the loss of some image information if the pixel quantum size\nis only eight bits (quantum range 0 to 255).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can apply separate gamma values to the red, green, and blue channels\nof the image with a gamma value list delimited with slashes\n(e.g., <strong>1.7</strong>/<strong>2.3</strong>/<strong>1.2</strong>).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+gamma</strong> <em>value</em>\nto set the image gamma level without actually adjusting\nthe image pixels. This option is useful if the image is of a known gamma\nbut not set as an image attribute (e.g. PNG images).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-gaussian\"></a>-gaussian <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the given radius and standard deviation (sigma).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-geometry\"></a>-geometry <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-geometry</strong> option is used for a number of different\npurposes, depending on the utility it is used with.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the X11 commands ('animate', 'display', and 'import'), it\nspecifies the preferred size and location of the Image window.  By\ndefault, the window size is the image size and the location is chosen\nby you (or your window manager) when it is mapped.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"> For the 'import', 'convert', 'mogrify' utility commands it may be\nused to specify the desired size when resizing an image.  In this\ncase, symbols representing resize options may be appended to the\ngeometry string to influence how the resize request is treated.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee later notes corresponding to usage by particular commands.  The\nfollowing notes apply to when <strong>-geometry</strong> is used to express a\nresize request, taking into account the current properties of the\nimage.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, the width and height are maximum values. That is, the\nimage is expanded or contracted to fit the width and height value\nwhile maintaining the aspect ratio of the image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAppend a ^ to the geometry so that the image aspect ratio is\nmaintained when the image is resized, but the resulting width or\nheight are treated as minimum values rather than maximum values.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAppend a ! (exclamation point) to the geometry to force the image size to\nexactly the size you specify. For example, if you specify\n<tt>640x480!</tt> the image width is set to 640 pixels and height to\n480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf only the width is specified, without the trailing 'x', then height\nis set to width (e.g., <tt>-geometry 100</tt> is the same as\n<tt>-geometry 100x100</tt>).  If only the width is specified but with\nthe trailing 'x', then width assumes the value and the height is\nchosen to maintain the aspect ratio of the image.  Similarly, if only\nthe height is specified prefixed by 'x' (e.g., <tt>-geometry\nx256</tt>), the width is chosen to maintain the aspect ratio.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nTo specify a percentage width or height instead, append %. The image size\nis multiplied by the width and height percentages to obtain the final image\ndimensions. To increase the size of an image, use a value greater than\n100 (e.g. 125%). To decrease an image's size, use a percentage less than\n100.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <tt>@</tt> to specify the maximum area in pixels of an image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <tt>&gt;</tt> to change the dimensions of the image <em>only</em> if\nits width or height exceeds the geometry specification. <tt>&lt;</tt> resizes\nthe image <em>only</em> if both of its dimensions are less than the geometry\nspecification. For example,\nif you specify <tt>'640x480&gt;'</tt> and the image size is 256x256, the image\nsize does not change. However, if the image is 512x512 or 1024x1024, it is\nresized to 480x480.  Enclose the geometry specification in quotation marks to\nprevent the <tt>&lt;</tt> or <tt>&gt;</tt> from being interpreted by your shell\nas a file redirection.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used with <em>animate</em> and <em>display</em>, offsets are handled in\nthe same manner as in <em>X(1)</em> and the <strong>-gravity</strong> option is not used.\nIf the <em>x</em> is negative, the offset is measured leftward\nfrom the right edge of the\nscreen to the right edge of the image being displayed.\nSimilarly, negative <em>y</em> is measured between the bottom edges.  The\noffsets are not affected by \"%\"; they are always measured in pixels.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>composite</em> option, <strong>-geometry</strong>\ngives the dimensions of the image and its location with respect\nto the composite image.  If the <strong>-gravity</strong> option is present\nwith <em>NorthEast, East,</em> or <em>SouthEast</em> gravity, the <em>x</em>\nrepresents the distance from the right edge of the image to the right edge of\nthe composite image.  Similarly, if the <strong>-gravity</strong> option is present\nwith <em>SouthWest, South,</em> or <em>SouthEast</em> gravity, <em>y</em>\nis measured between the bottom edges. Accordingly, a positive offset will\nnever point in the direction outside of the image.  The\noffsets are not affected by \"%\"; they are always measured in pixels.\nTo specify the dimensions of the composite image, use the <strong>-resize</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>convert</em>, <em>import</em> or <em>mogrify</em> option,\n<strong>-geometry</strong> is synonymous with <strong>-resize</strong> and\nspecifies the size of the output image.  The offsets, if present, are ignored.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>montage</em> option, <strong>-geometry</strong> specifies the image\nsize and border size for each tile; default is 256x256+0+0.  Negative\noffsets (border dimensions) are meaningless.  The <strong>-gravity</strong>\noption affects the placement of the image within the tile; the default\ngravity for this purpose is <em>Center</em>.  If the \"%\" sign appears in\nthe geometry specification, the tile size is the specified percentage of\nthe original dimensions of the first tile.\nTo specify the dimensions of the montage, use the <strong>-resize</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-gravity\"></a>-gravity <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are: NorthWest, North,\nNorthEast, West, Center, East, SouthWest, South, SouthEast.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe direction you choose specifies where to position the text \nwhen annotating\nthe image. For example <em>Center</em> gravity forces the text to be centered\nwithin the image. By default, the image gravity is <em>NorthWest</em>.\nSee <strong>-draw</strong> for more details about graphic primitives.  Only the\ntext primitive is affected by the <strong>-gravity</strong> option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-gravity</strong> option is also used in concert with the <strong>-geometry</strong>\noption and other options that take <strong>&lt;geometry&gt;</strong> as a parameter, such\nas the <strong>-crop</strong> option.  See <strong>-geometry</strong> for details of how the\n<strong>-gravity</strong> option interacts with the\n<strong>&lt;x&gt;</strong> and <strong>&lt;y&gt;</strong> parameters of a geometry\nspecification.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as an option to <em>composite</em>, <strong>-gravity</strong>\ngives the direction that the image gravitates within the composite.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as an option to <em>montage</em>, <strong>-gravity</strong> gives the direction\nthat an image gravitates within a tile.  The default gravity is <em>Center</em>\nfor this purpose.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-green-primary\"></a>-green-primary <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -hald-clut <i>&lt;clut&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a Hald CLUT to the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA Hald CLUT (\"Color Look-Up Table\") is a special square color image\nwhich contains a look-up table for red, green, and blue.  The size of\nthe Hald CLUT image is determined by its order.  The width (and\nheight) of a Hald CLUT is the cube of the order.  For example, a Hald\nCLUT of order 8 is 512x512 pixels (262,144 colors) and of order 16 is\n4096x4096 (16,777,216 colors).  A special CLUT is the identity CLUT\nwhich which causes no change to the input image.  In order to use the\nHald CLUT, one takes an identity CLUT and adjusts its colors in some\nway.  The modified CLUT can then be used to transform any number of\nimages in an identical way.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nGraphicsMagick contains a built-in identity CLUT generator via the\n<strong>IDENTITY</strong> coder.  For example reading from the file name\n</strong>IDENTITY:8</strong> returns an identity CLUT of order 8.  Typical Hald\nCLUT identity images have an order of between 8 and 16.  The default\norder for the <strong>IDENTITY</strong> CLUT generator is 8.  Interpolation is\nused so it is not usually necessary for CLUT images to be very large.\nThe PNG file format is ideal for storing Hald CLUT images because it\ncompresses them very well.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-highlight-color\"></a>-highlight-color <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixel annotation color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecifies the color to use when annotating difference pixels.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-highlight-style\"></a>-highlight-style <i>&lt;style&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixel annotation style</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecifies the pixel difference annotation style used to draw attention to\nchanged pixels. May be one of <strong>Assign</strong>, <strong>Threshold</strong>,\n<strong>Tint</strong>, or <strong>XOR</strong>; where <strong>Assign</strong> replaces the pixel with\nthe highlight color (see <strong>-highlight-color</strong>), <strong>Threshold</strong>\nreplaces the pixel with black or white based on the difference in\nintensity, <strong>Tint</strong> alpha tints the pixel with the highlight color,\nand <strong>XOR</strong> does an XOR between the pixel and the highlight color.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-iconGeometry\"></a>-iconGeometry <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the icon geometry</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nOffsets, if present in the geometry specification, are handled in\nthe same manner as the <strong>-geometry</strong> option, using X11 style to handle\nnegative offsets.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -iconic\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>iconic animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -immutable\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image immutable</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -implode <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>implode image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-intent\"></a>-intent <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of rendering intent when managing the image color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to affect the the color management operation of an image (see\n<strong>-profile</strong>).\nChoose from these intents:\n<strong>Absolute, Perceptual, Relative, Saturation</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default intent is undefined.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-interlace\"></a>-interlace <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are: <strong>None, Line, Plane,</strong>\nor <strong>Partition</strong>. The default is <strong>None</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is used to specify the type of interlacing scheme for raw image\nformats such as <strong>RGB</strong> or <strong>YUV</strong>.</font></td></tr></table><table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>None</strong> means do not interlace\n(RGBRGBRGBRGBRGBRGB...),</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Line</strong> uses scanline interlacing\n(RRR...GGG...BBB...RRR...GGG...BBB...),\nand</font></td></tr></table><table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Plane</strong> uses plane interlacing (RRRRRR...GGGGGG...BBBBBB...).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Partition</strong>\nis like plane except the different planes are saved to individual files\n(e.g. image.R, image.G, and image.B).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>Line</strong> to create an <strong>interlaced PNG</strong> or <strong> GIF</strong> or\n<strong>progressive JPEG</strong> image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-label\"></a>-label <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to assign a specific label to the image, when writing\nto an image format that supports labels, such as TIFF, PNG, MIFF, or\nPostScript. You can include the the image filename, type, width, height,\nor other image attribute by embedding special format character.  A label\nis not drawn on the image, but is embedded in the image datastream via\na \"Label\" tag or similar mechanism.  If you want the\nlabel to be visible on the image itself, use the <strong>-draw</strong> option.\nSee <strong>-comment</strong> for details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -label \"%m:%f %wx%h\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nproduces an image label of <strong>MIFF:bird.miff 512x480</strong> for an image titled\n<strong>bird.miff</strong>\nand whose width is 512 and height is 480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the first character of <em>string</em> is <em>@</em>, the image label\nis read from a file titled by the remaining characters in the string.\nPlease note that if the string comes from an untrusted source that it\nshould be sanitized before use since otherwise the content of an\narbitrary readable file might be incorporated into the image\nlabel (a security risk).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the -label option appears multiple times, only the last label is\nstored.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn PNG images, the label is stored in a <strong>tEXt</strong> or <strong>zTXt</strong> chunk\nwith the keyword \"label\".</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen converting to <em>PostScript</em>, use this option to specify a header\nstring to print above the image. Specify the label font with\n<strong>-font</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen creating a montage, by default the label associated with an image\nis displayed with the corresponding tile in the montage.  Use the\n<strong>+label</strong> option to suppress this behavior.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-lat\"></a>-lat <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;offset&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform local adaptive thresholding</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPerform local adaptive thresholding using the specified width, height,\nand offset.  The offset is a distance in sample space from the mean,\nas an absolute integer ranging from 0 to the maximum sample value or\nas a percentage.  If the percent option is supplied, then the offset\nis computed as a percentage of the quantum range.  It is strongly\nrecommended to use the percent option so that results are not\nsensitive to pixel quantum depth.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -colorspace gray -lat \"10x10-5%\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nwill help clarify a scanned grayscale or color document, producing a\nbi-level equivalent.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-level\"></a>-level <i>&lt;black_point&gt;</i>{<i>,&lt;gamma&gt;</i>}<i></i>{<i>,&lt;white_point&gt;</i>}<i></i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>adjust the level of image contrast</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nGive one, two or three values delimited with commas: black-point, gamma,\nwhite-point (e.g. 10,1.0,250 or 2%,0.5,98%). The black and white\npoints range from 0 to MaxRGB or from 0 to 100%; if the white point is\nomitted it is set to MaxRGB-black_point. If a \"%\" sign is present\nanywhere in the string, the black and white points are percentages of\nMaxRGB. Gamma is an exponent that ranges from 0.1 to 10.; if it is\nomitted, the default of 1.0 (no gamma correction) is assumed. This\ninterface works similar to Photoshop's \"Image-&gt;Adjustments-&gt;Levels...\"\n\"Input Levels\" interface.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-limit\"></a>-limit <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, resource limits are estimated based on the available\nresources of the system. The resource limits are <strong>Disk</strong>, maximum\ntotal disk space consumed; <strong>File</strong>, maximum number of file\ndescriptors allowed to be open at once; <strong>Map</strong>, maximum total\nnumber of file bytes which may be memory mapped; <strong>Memory</strong>,\nmaximum total number of bytes of heap memory used for image storage;\n<strong>Pixels</strong>, maximum absolute image size (per image); <strong>Width</strong>,\nmaximum image pixels width; <strong>Height</strong>, maximum image pixels\nheight; and <strong>Threads</strong>, the maximum number of worker threads to\nuse per OpenMP thread team.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThese resource limits are used to decide if (for a given image) the\ndecoded image (\"pixel cache\") should be stored in heap memory (RAM),\nin a memory-mapped disk file, or in a disk file accessed via\nread/write I/O.  The number of total pixels in one image, and/or the\nwidth/height, may also be limited in order to force the reading, or\ncreation of images larger than the limit (in pixels) to intentionally\nfail. The disk limit establishes an overall limit since using the disk\nis the means of last resort. When the disk limit has been reached, no\nmore images may be read.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe value argument is an absolute value, but may have standard binary\nsuffix characters applied ('K', 'M', 'G', 'T', 'P', 'E') to apply a\nscaling to the value (based on a multiplier of 1024). Any additional\ncharacters are ignored. For example, <tt>'-limit Pixels 10MP'</tt> limits\nthe maximum image size to 10 megapixels and <tt>'-limit memory 32MB\n-limit map 64MB'</tt> limits memory and memory mapped files to 32\nmegabytes and 64 megabytes respectively.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nResource limits may also be set using environment variables. The\nenvironment variables <strong>MAGICK_LIMIT_DISK</strong>,\n<strong>MAGICK_LIMIT_FILES</strong>, <strong>MAGICK_LIMIT_MAP</strong>,\n<strong>MAGICK_LIMIT_MEMORY</strong>, <strong>MAGICK_LIMIT_PIXELS</strong>,\n<strong>MAGICK_LIMIT_WIDTH</strong>, <strong>MAGICK_LIMIT_HEIGHT</strong>,and\n<strong>OMP_NUM_THREADS</strong> may be used to set the limits for disk space,\nopen files, memory mapped size, heap memory, per-image pixels, image\nwidth, image height, and threads respectively.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the option <tt>-list resource</tt> list the current limits.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -linewidth\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the line width for subsequent draw operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-list\"></a>-list <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of list</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are: <strong>Color</strong>, <strong>Delegate</strong>, <strong>Format</strong>, <strong>Magic</strong>,\n<strong>Module</strong>, <strong>Resource</strong>, or <strong>Type</strong>. The <strong>Module</strong> option\nis only available if GraphicsMagick was built to support loadable modules.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option lists information about the GraphicsMagick configuration.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-log\"></a>-log <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option specifies the format for the log printed when the <strong>-debug</strong>\noption is active.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can display the following components by embedding\nspecial format characters:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     %d   domain\n     %e   event\n     %f   function\n     %l   line\n     %m   module\n     %p   process ID\n     %r   real CPU time\n     %t   wall clock time\n     %u   user CPU time\n     %%   percent sign\n     \\n   newline\n     \\r   carriage return\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -debug coders -log \"%u %m:%l %e\" in.gif out.png\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default behavior is to print all of the components.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-loop\"></a>-loop <i>&lt;iterations&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add Netscape loop extension to your GIF animation</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA value other than zero forces the animation to repeat itself up to\n<em>iterations</em>\ntimes.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe image size is doubled using linear interpolation.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe displayed image is magnified by <strong>factor</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-map\"></a>-map <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>choose a particular set of colors from this image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n[<em>convert</em> or <em>mogrify</em>]</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, color reduction chooses an optimal set of colors that best\nrepresent the original image. Alternatively, you can choose a particular\nset of colors from an image file with this option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse\n<strong>+map</strong> to reduce\nall images in the image sequence that follows to a single optimal set of colors\nthat best represent all the images.  The sequence of images\nis terminated by the appearance of any option.\nIf the <strong>+map</strong>\noption appears after all of the input images, all images are mapped.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-map\"></a>-map <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display image using this type.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n[<em>animate</em> or <em>display</em>]</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from these <em>Standard Colormap</em> types:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     best\n     default\n     gray\n     red\n     green\n     blue\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <em>X server</em> must support the <em>Standard Colormap</em> you choose,\notherwise an error occurs. Use <strong>list</strong> as the type and <strong>display</strong>\nsearches the list of colormap types in <strong>top-to-bottom</strong> order until\none is located. See <em>xstdcmap(1)</em> for one way of creating Standard\nColormaps.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-mask\"></a>-mask <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify a clipping mask</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe image read from the file is used as a clipping mask.  It must have\nthe same dimensions as the image being masked.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the mask image contains an opacity channel, the opacity of each\npixel is used to define the mask.  Otherwise, the intensity (gray\nlevel) of each pixel is used.  Unmasked (black) pixels are modified\nwhile masked pixels (not black) are protected from alteration.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+mask</strong> to remove the clipping mask.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIt is not necessary to use <strong>-clip</strong> to activate the mask; <strong>-clip</strong>\nis implied by <strong>-mask</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-matte\"></a>-matte\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the image does not have a matte channel, create an opaque one.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+matte</strong> to ignore the matte channel and to avoid writing a\nmatte channel in the output file.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-mattecolor\"></a>-mattecolor <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-maximum-error\"></a>-maximum-error <i>&lt;limit&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the maximum amount of total image error</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecifies the maximum amount of total image error (based on comparison\nusing a specified metric) before an error (\"image difference exceeds\nlimit\") is reported.  The error is reported via a non-zero command\nexecution return status.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -median <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a median filter to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -metric <i>&lt;metric&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>comparison metric (MAE, MSE, PAE, PSNR, RMSE)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -minify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>minify the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe image size is halved using linear interpolation.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -mode <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>mode of operation</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe available montage modes are <strong>frame</strong> to place the images in a\nrectangular grid while adding a decorative frame with dropshadow,\n<strong>unframe</strong> to place undecorated images in a rectangular grid, and\n<strong>concatenate</strong> to pack the images closely together without any\nwell-defined grid or decoration. </font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-modulate\"></a>-modulate <i>brightness[,saturation[,hue]]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>vary the brightness, saturation, and hue of an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify the percent change in brightness, color saturation, and\nhue separated by commas. Default argument values are 100 percent,\nresulting in no change. For example, to increase the color brightness\nby 20% and decrease the color saturation by 10% and leave the hue\nunchanged, use: <strong>-modulate 120,90</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nHue is the percentage of absolute rotation from the current\nposition. For example 50 results in a counter-clockwise rotation of 90\ndegrees, 150 results in a clockwise rotation of 90 degrees, with 0 and\n200 both resulting in a rotation of 180 degrees.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA simple command-line progress indication is shown while the command is\nrunning. The process indication shows the operation currently being\nperformed and the percent completed. Commands using X11 may replace the\ncommand line progress indication with a graphical one once an image has\nbeen displayed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-morph\"></a>-morph <i>&lt;frames&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>morphs an image sequence</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBoth the image pixels and size are linearly interpolated to give the appearance\nof a meta-morphosis from one image to the next.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images\nis terminated by the appearance of any option.\nIf the <strong>-morph</strong>\noption appears after all of the input images, all images are morphed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-mosaic\"></a>-mosaic\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a mosaic from an image or an image sequence</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-mosaic</strong> option provides a flexible way to composite one or\nmore images onto a solid-color canvas image. It works similar to\n<strong>-flatten</strong> except that a base canvas image is automatically\ncreated with a suitable size given the image size, page dimensions,\nand page offsets of images to be composited.  The color of the base\ncanvas image may be set via the <strong>-background</strong> option.  The\ndefault canvas color is 'white', but 'black' or 'transparent' may be\nmore suitable depending on the composition algorithm requested.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-compose</strong> option may be used to specify the composition\nalgorithm to use when compositing the subsequent image on the base\ncanvas.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-page</strong> option can be used to establish the dimensions of the\nmosaic and to position the subsequent image within the mosaic.  If the\n<strong>-page</strong> argument does not specify width and height, then the\ncanvas dimensions are evaluated based on the image sizes and\noffsets.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images is terminated by the appearance of any option.\nIf the <strong>-mosaic</strong> option appears after all of the input images,\nall images are included in the mosaic.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe following is an example of composing an image based on red, green,\nand blue layers extracted from a sequence of images and pasted on the\ncanvas image at specified offsets:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -background black \\\n              -compose CopyRed   -page +0-100 red.png \\\n              -compose CopyGreen -page +0+40  green.png \\\n              -compose CopyBlue  -page +0+180 blue.png \\\n              -mosaic output.png\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-motion-blur\"></a>-motion-blur <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+angle</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Simulate motion blur</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSimulate motion blur by convolving the image with a Gaussian operator of\nthe given radius and standard deviation (sigma). For reasonable results,\nradius should be larger than sigma. If radius is zero, then a suitable\nradius is automatically selected based on sigma. The angle specifies the\nangle that the object is coming from (side which is blurred).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -name\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-negate\"></a>-negate\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe red, green, and blue intensities of an image are negated.\nWhite becomes black,\nyellow becomes blue, etc.\nUse <strong>+negate</strong>\nto only negate the grayscale pixels of the image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-noise\"></a>-noise <i>&lt;radius|type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add or reduce noise in an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe principal function of noise peak elimination filter is to smooth the\nobjects within an image without losing edge information and without creating\nundesired structures. The central idea of the algorithm is to replace a\npixel with its next neighbor in value within a pixel window, if this pixel\nhas been found to be noise. A pixel is defined as noise if and only if\nthis pixel is a maximum or minimum within the pixel window.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>radius</strong> to specify the width of the neighborhood.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+noise</strong> followed by a noise type to add noise to an image.\nThe noise added modulates the existing image pixels. Choose from these\nnoise types:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Uniform\n     Gaussian\n     Multiplicative\n     Impulse\n     Laplacian\n     Poisson\n     Random (uniform distribution)\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-noop\"></a>-noop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-noop</strong> option can be used to terminate a group of images\nand reset all options to their default values, when no other option is\ndesired.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-normalize\"></a>-normalize\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform image to span the full range of color values</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis is a contrast enhancement technique based on the image histogram.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen computing the contrast enhancement values, the histogram edges\nare truncated so that the majority of the image pixels are considered\nin the constrast enhancement, and outliers (e.g. random noise or\nminute details) are ignored.  The default is that 0.1 percent of the\nhistogram entries are ignored.  The percentage of the histogram to\nignore may be specified by using the <strong>-set</strong> option with the\n<strong>histogram-threshold</strong> parameter similar to <strong>-set\nhistogram-threshold 0.01</strong> to specify 0.01 percent.  Use 0 percent\nto use the entire histogram, with possibly diminished contrast\nenhancement.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-opaque\"></a>-opaque <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>change this color to the pen color within the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the\n<strong>-fill</strong> option.  The color is replaced if it is identical to the\ntarget color, or close enough to the target color in a 3D space as\ndefined by the Euclidean distance specified by <strong>-fuzz</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-fill</strong> and <strong>-fuzz</strong> for more details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-operator\"></a>-operator <i>channel operator rvalue[%]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a mathematical, bitwise, or value operator to an image channel</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nApply a low-level mathematical, bitwise, or value operator to a selected\nimage channel or all image channels. Operations which result in negative\nresults are reset to zero, and operations which overflow the available\nrange are reset to the maximum possible value.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSelect a channel from: <strong>Red</strong>, <strong>Green</strong>, <strong>Blue</strong>,\n<strong>Opacity</strong>, <strong>Matte</strong>, <strong>Cyan</strong>, <strong>Magenta</strong>, <strong>Yellow</strong>,\n<strong>Black</strong>, <strong>All</strong>, or <strong>Gray</strong>. <strong>All</strong> only modifies the\ncolor channels and does not modify the <strong>Opacity</strong> channel. Except for\nthe threshold operators, <strong>All</strong> operates on each channel\nindependently so that operations are on a per-channel basis.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Gray</strong> treats the color channels as a grayscale intensity and\nperforms the requested operation on the equivalent pixel intensity so the\nresult is a gray image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Select an operator from <strong>Add</strong>, <strong>And</strong>, <strong>Assign</strong>,\n<strong>Depth</strong>, <strong>Divide</strong>, <strong>Gamma</strong>, <strong>Negate</strong>,\n<strong>LShift</strong>, <strong>Log</strong>, <strong>Max</strong>, <strong>Min</strong>, <strong>Multiply</strong>,\n<strong>Or</strong>, <strong>Pow</strong> <strong>RShift</strong>, <strong>Subtract</strong>,\n<strong>Threshold</strong>, <strong>Threshold-White</strong>,\n<strong>Threshold-White-Negate</strong>, <strong>Threshold-Black</strong>,\n<strong>Threshold-Black-Negate</strong>, <strong>Xor</strong>, <strong>Noise-Gaussian</strong>,\n<strong>Noise-Impulse</strong>, <strong>Noise-Laplacian</strong>,\n<strong>Noise-Multiplicative</strong>, <strong>Noise-Poisson</strong>,\n<strong>Noise-Random</strong>, and <strong>Noise-Uniform</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nRvalue may be any floating point or integer value. Normally rvalue will\nbe in the range of 0 to MaxRGB, where MaxRGB is the largest quantum value\nsupported by the GraphicsMagick build (255, 65535, or 4294967295) but\nvalues outside this range are useful for some arithmetic operations.\nArguments to logical or bit-wise operations are rounded to a positive\nintegral value prior to use. If a percent (<strong>%</strong>) symbol is appended\nto the argument, then the argument has a range of 0 to 100 percent.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe following is a description of the operators:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>Add</dt>\n<dd>Result is rvalue added to channel value.\n</dd>\n<dt>And</dt>\n<dd>Result is the logical AND of rvalue with channel value.\n</dd>\n<dt>Assign</dt>\n<dd>Result is rvalue.\n</dd>\n<dt>Depth</dt>\n<dd>Result is channel value adjusted so that it may be (approximately)\nstored in the specified number of bits without additional loss.\n</dd>\n<dt>Divide</dt>\n<dd>Result is channel value divided by rvalue.\n</dd>\n<dt>Gamma</dt>\n<dd>Result is channel value gamma adjusted by rvalue.\n</dd>\n<dt>LShift</dt>\n<dd>Result is channel value bitwise left shifted by rvalue bits.\n</dd>\n<dt>Log</dt>\n<dd>Result is computed as log(value*rvalue+1)/log(rvalue+1).\n</dd>\n<dt>Max</dt>\n<dd>Result is assigned to rvalue if rvalue is greater than value.\n</dd>\n<dt>Min</dt>\n<dd>Result is assigned to rvalue if rvalue is less than value.\n</dd>\n<dt>Multiply</dt>\n<dd>Result is channel value multiplied by rvalue.\n</dd>\n<dt>Negate</dt>\n<dd>Result is inverse of channel value (like a film negative). An rvalue\nmust be supplied but is currently not used. Inverting the image twice\nresults in the original image.\n</dd>\n<dt>Or</dt>\n<dd>Result is the logical OR of rvalue with channel value.\n</dd>\n<dt>Pow</dt>\n<dd>Result is computed as pow(value,rvalue). Similar to Gamma except that\nrvalue is not inverted.\n</dd>\n<dt>RShift</dt>\n<dd>Result is channel value bitwise right shifted by rvalue bits.\n</dd>\n<dt>Subtract</dt>\n<dd>Result is channel value minus rvalue.\n</dd>\n<dt>Threshold</dt>\n<dd>Result is maximum (white) if channel value is greater than rvalue,\nor minimum (black) if it is less than or equal to rvalue. If <strong>all</strong>\nchannels are specified, then thresholding is done based on computed pixel\nintensity.\n</dd>\n<dt>Threshold-white</dt>\n<dd>Result is maximum (white) if channel value is greater than rvalue and\nis unchanged if it is less than or equal to rvalue. This can be used to\nremove apparent noise from the bright parts of an image. If <strong>all</strong>\nchannels are specified, then thresholding is done based on computed pixel\nintensity.\n</dd>\n<dt>Threshold-White-Negate</dt>\n<dd>Result is set to black if channel value is greater than\nrvalue and is unchanged if it is less than or equal to rvalue. If\n<strong>all</strong> channels are specified, then thresholding is done based on\ncomputed pixel intensity.\n</dd>\n<dt>Threshold-black</dt>\n<dd>Result is minimum (black) if channel value is less than than rvalue\nand is unchanged if it is greater than or equal to rvalue. This can be\nused to remove apparent noise from the dark parts of an image. If\n<strong>all</strong> channels are specified, then thresholding is done based on\ncomputed pixel intensity.\n</dd>\n<dt>Threshold-Black-Negate</dt>\n<dd>Result is set to white if channel value is less than than\nrvalue and is unchanged if it is greater than or equal to rvalue. If\n<strong>all</strong> channels are specified, then thresholding is done based on\ncomputed pixel intensity.\n</dd>\n<dt>Xor</dt>\n<dd>Result is the logical XOR of rvalue with channel value. An\ninteresting property of XOR is that performing the same operation twice\nresults in the original value.\n</dd>\n<dt>Noise-Gaussian</dt>\n<dd>Result is the current channel value modulated with gaussian noise\naccording to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Impulse</dt>\n<dd>Result is the current channel value modulated with impulse noise\naccording to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Laplacian</dt>\n<dd>Result is the current channel value modulated with laplacian noise\naccording to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Multiplicative</dt>\n<dd>Result is the current channel value modulated with multiplicative\ngaussian noise according to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Poisson</dt>\n<dd>Result is the current channel value modulated with poisson noise\naccording to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Random</dt>\n<dd>Result is the current channel value modulated with random (uniform\ndistribution) noise according to the intensity specified by rvalue.\nThe initial noise intensity (rvalue=1.0) is the range of one pixel\nquantum span.\n</dd>\n<dt>Noise-Uniform</dt>\n<dd>Result is the channel value with uniform noise applied according to\nthe intensity specified by rvalue.\n</dd>\n</dl>\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAs an example, the <strong>Assign</strong> operator assigns a fixed value to a\nchannel. For example, this command sets the red channel to the mid-range\nvalue:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert in.bmp -operator red assign \"50%\" out.bmp\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe following applies 50% thresholding to the image and returns a gray\nimage:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert in.bmp -operator gray threshold \"50%\" out.bmp\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-ordered-dither\"></a>-ordered-dither <i>&lt;channeltype&gt; &lt;NxN&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>ordered dither the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe channel or channels specified in the <strong>channeltype</strong> argument are\nreduced to binary, using an ordered dither method. The choices for\n<strong>channeltype</strong> are <strong>All</strong>, <strong>Intensity</strong>, <strong>Red</strong>,\n<strong>Green</strong>, <strong>Blue</strong>, <strong>Cyan</strong>, <strong>Magenta</strong>, <strong>Yellow</strong>,\n<strong>Black</strong>, and <strong>Opacity</strong></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen <strong>channeltype</strong> is \"All\", the color samples are dithered into\na gray level and then that gray level is stored in the three color\nchannels.  Separately, the opacity channel is dithered into a bilevel\nopacity value which is stored in the opacity channel.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen <strong>channeltype</strong> is \"Intensity\", only the color samples are\ndithered. When <strong>channeltype</strong> is \"opacity\" or \"matte\", only the\nopacity channel is dithered. When a color channel is specified, only that\nchannel is dithered.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe choices for N are 2 through 7. The image is divided into\nNxN pixel tiles.  In each tile, some or all pixels are turned to\nwhite depending on their intensity.  For each N, (N**2)+1 levels\nof gray can be represented.  For N == 2, 3, or 4, the pixels\nare turned to white in an order that maximizes dispersion (i.e.,\nreduces granularity), while\nfor N == 5, 6, and 7, they are turned to white in an order that\ncreates a roughly circular black blob in the middle of each tile.\nAn attractive \"half-tone\" looking image can be obtained by first\nrotating the image 45 degrees, performing a 5x5 ordered-dither\noperation, then rotating it back to the original orientation and\ncropping to the original image dimensions.  If the original image\nis gamma-encoded, it is adviseable to convert it to linear intensity\nfirst, e.g., with the \"-gamma 0.45455\" option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-output-directory\"></a>-output-directory <i>&lt;directory&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output files to directory</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse -output-directory to specify a directory under which to write the\noutput files. Normally mogrify overwrites the input files, but with\nthis option the output files may be written to a different directory\ntree so that the input files are preserved. The algorithm used\npreserves all of the input path specification in the output path so\nthat the user-specified input path (including any sub-directory part)\nis appended to the output path. If the input file lacks an extension,\nthen a suitable extension is automatically added to the output file.\nThe user is responsible for creating the output directory specified as\nan argument, but subdirectories will be created as needed if the\n<strong>-create-directories</strong> option is supplied.  This option may be\nused to apply transformations on files from one directory and write\nthe transformed files to a different directory.  In conjunction with\n<strong>-create-directories</strong>, this option is designed to support\ntransforming whole directory trees of files provided that the relative\npath of the input file is included as part the list of filenames.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-orient\"></a>-orient <i>&lt;orientation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Set the image orientation attribute</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSets the image orientation attribute.  The image orientation attribute\nis compatible with the TIFF orientation tag (and the EXIF orientation\ntag).  Accepted values are <strong>undefined</strong>, <strong>TopLeft</strong>,\n<strong>TopRight</strong>, <strong>BottomRight</strong>, <strong>BottomLeft</strong>,\n<strong>LeftTop</strong>, <strong>RightTop</strong>, <strong>RightBottom</strong>,\n<strong>LeftBottom</strong>, and hyphenated versions thereof\n(e.g. <strong>left-bottom</strong>).  Please note that GraphicsMagick does not\ninclude an EXIF editor so if an EXIF profile is written to the output\nimage, the value in the EXIF profile might not match the image.  It is\npossible for an image file to indicate its orientation in several\ndifferent ways simultaneously.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-page\"></a>-page <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to specify the dimensions of the\n<em>PostScript</em> page\nin dots per inch or a TEXT page in pixels. The choices for a PostScript\npage are:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     11x17         792  1224\n     Ledger       1224   792\n     Legal         612  1008\n     Letter        612   792\n     LetterSmall   612   792\n     ArchE        2592  3456\n     ArchD        1728  2592\n     ArchC        1296  1728\n     ArchB         864  1296\n     ArchA         648   864\n     A0           2380  3368\n     A1           1684  2380\n     A2           1190  1684\n     A3            842  1190\n     A4            595   842\n     A4Small       595   842\n     A5            421   595\n     A6            297   421\n     A7            210   297\n     A8            148   210\n     A9            105   148\n     A10            74   105\n     B0           2836  4008\n     B1           2004  2836\n     B2           1418  2004\n     B3           1002  1418\n     B4            709  1002\n     B5            501   709\n     C0           2600  3677\n     C1           1837  2600\n     C2           1298  1837\n     C3            918  1298\n     C4            649   918\n     C5            459   649\n     C6            323   459\n     Flsa          612   936\n     Flse          612   936\n     HalfLetter    396   612\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor convenience you can specify the page size by media (e.g. A4, Ledger,\netc.). Otherwise, <strong>-page</strong> behaves much like\n<strong>-geometry</strong> (e.g.  <tt>-page letter+43+43&gt;</tt>).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is also used to place subimages when writing to a multi-image\nformat that supports offsets, such as GIF89 and MNG.  When used for this\npurpose the offsets are always  measured from the\ntop left corner of the canvas and are not affected by the <strong>-gravity</strong>\noption.\nTo position a GIF or MNG image, use <strong>-page</strong><em>{+-}&lt;x&gt;{+-}&lt;y&gt;</em>\n(e.g. -page +100+200).  When writing to a MNG file, a <strong>-page</strong>\noption appearing ahead of the first image in the sequence with nonzero\nwidth and height defines the width and height values that are written in\nthe <strong>MHDR</strong> chunk.  Otherwise, the MNG width and height are computed\nfrom the bounding box that contains all images in the sequence.  When\nwriting a GIF89 file, only the bounding box method is used to determine its\ndimensions.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor a PostScript page, the image is sized as in <strong>-geometry</strong> and positioned\nrelative to the lower left hand corner of the page by\n{+-}&lt;<strong>x</strong><em>offset</em>&gt;{+-}&lt;<strong>y</strong>\n<em>offset&gt;</em>. Use\n<tt>-page 612x792&gt;</tt>, for example, to center the\nimage within the page. If the image size exceeds the PostScript page, it\nis reduced to fit the page.\nThe default gravity for the <strong>-page</strong>\noption is <em>NorthWest</em>, i.e., positive <strong>x</strong> and\n<strong>y</strong> <em>offset</em> are measured rightward and downward from the top\nleft corner of the page, unless the <strong>-gravity</strong> option is present with\na value other than <em>NorthWest</em>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default page dimensions for a TEXT image is 612x792.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is used in concert with <strong>-density</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+page</strong> to remove the page settings for an image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-paint\"></a>-paint <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate an oil painting</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEach pixel is replaced by the most frequent color in a circular neighborhood\nwhose width is specified with <em>radius</em>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-pause\"></a>-pause <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pause between animation loops [animate]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPause for the specified number of seconds before repeating the\nanimation.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-pause\"></a>-pause <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pause between snapshots [import]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPause for the specified number of seconds before taking the next\nsnapshot.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-pen\"></a>-pen <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>(This option has been replaced by the -fill option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -ping\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>efficiently determine image characteristics</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to disable reading the image pixels so that image\ncharacteristics such as the image dimensions may be obtained very\nquickly. For identify, use +ping to force reading the image pixels so\nthat the pixel read rate may be included in the displayed information.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-preview\"></a>-preview <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>image preview type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to affect the preview operation of an image (e.g.\n<tt>convert file.png -preview Gamma Preview:gamma.png</tt>). Choose\nfrom these previews:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Rotate\n     Shear\n     Roll\n     Hue\n     Saturation\n     Brightness\n     Gamma\n     Spiff\n     Dull\n     Grayscale\n     Quantize\n     Despeckle\n     ReduceNoise\n     AddNoise\n     Sharpen\n     Blur\n     Threshold\n     EdgeDetect\n     Spread\n     Shade\n     Raise\n     Segment\n     Solarize\n     Swirl\n     Implode\n     Wave\n     OilPaint\n     CharcoalDrawing\n     JPEG\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default preview is <strong>JPEG</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-process\"></a>-process <i>&lt;command&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>process a sequence of images using a process module</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe command argument has the form <strong>module=arg1,arg2,arg3,...,argN</strong>\nwhere <strong>module</strong> is the name of the module to invoke (e.g. \"analyze\")\nand arg1,arg2,arg3,...,argN are an arbitrary number of arguments to\npass to the process module.</font></td></tr></table><table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images\nis terminated by the appearance of any option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the <strong>-process</strong>\noption appears after all of the input images, all images are processed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-profile\"></a>-profile <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add ICM, IPTC, or generic profile  to image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<tt>-profile filename</tt> adds an ICM (ICC color management), IPTC\n(newswire information), or a generic (including Exif) profile to the image\n</font></td></tr></table>.\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <tt>+profile icm</tt>, <tt>+profile iptc</tt>, or\n<tt>+profile profile_name</tt> to remove the respective profile.\nMultiple profiles may be listed, separated by commas. Profiles may be\nexcluded from subsequent listed matches by preceding their name with\nan exclamation point.  For example, <tt>+profile '!icm,*'</tt> strips\nall profiles except for the ICM profile.  Use <tt>identify\n-verbose</tt> to find out what profiles are in the image file.  Use\n<tt>+profile \"*\"</tt> to remove all profiles.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Writing the image to a format that does not support profiles will\nof course also cause all profiles to be removed.  The JPEG and PNG\nformats will store any profiles that have been read and not removed.\nIn JPEG they are stored in APP1 markers, and in PNG they are stored\nas hex-coded binary in compressed zTXt chunks, except for the iCC\nchunk which is stored in the iCCP chunk.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nTo extract a profile, the <strong>-profile</strong> option is not used.  Instead,\nsimply write the file to an image\nformat such as <em>APP1, 8BIM, ICM,</em> or <em>IPTC</em>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, to extract the Exif data (which is stored in JPEG files\nin the <em>APP1</em> profile), use\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert cockatoo.jpg exifdata.app1\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Note that GraphicsMagick does not attempt to update any profile to\nreflect changes made to the image, e.g., rotation from portrait to landscape\norientation, so it is possible that the preserved profile may contain\ninvalid data.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-preserve-timestamp\"></a>-preserve-timestamp\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preserve the original timestamps of the file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to preserve the original modification and access\ntimestamps of the file, even if it has been modified.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details+progress\"></a>+progress\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>disable progress monitor and busy cursor</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, when an image is displayed, a progress monitor bar is shown\nin the top left corner of an existing image display window, and the\ncurrent cursor is replaced with an hourglass cursor. Use <strong>+progress</strong>\nto disable the progress monitor and busy cursor during display operations.\nWhile the progress monitor is disabled for all operations, the busy\ncursor continues to be enabled for non-display operations such as image\nprocessing. This option is useful for non-interactive display operations,\nor when a \"clean\" look is desired.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-quality\"></a>-quality <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"> For the JPEG and MPEG image formats, quality is 0 (lowest image\nquality and highest compression) to 100 (best quality but least\neffective compression). The default quality is 75.  Use the\n<strong>-sampling-factor</strong> option to specify the factors for chroma\ndownsampling.  To use the same quality value as that found by the JPEG\ndecoder, use the <tt>-define jpeg:preserve-settings</tt> flag.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the MIFF image format, and the TIFF format while using ZIP\ncompression, quality/10 is the zlib compression level, which is 0 (worst\nbut fastest compression) to 9 (best but slowest). It has no effect on the\nimage appearance, since the compression is always lossless.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the JPEG-2000 image format, quality is mapped using a non-linear\nequation to the compression ratio required by the Jasper library. This\nnon-linear equation is intended to loosely approximate the quality\nprovided by the JPEG v1 format. The default quality value 75 results in\na request for 16:1 compression. The quality value 100 results in\na request for non-lossy compression.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the MNG and PNG image formats, the quality value sets the zlib compression\nlevel (quality / 10) and filter-type (quality % 10). Compression levels\nrange from 0 (fastest compression) to 100 (best but slowest). For compression\nlevel 0, the Huffman-only strategy is used, which is fastest but not\nnecessarily the worst compression.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf\nfilter-type is 4 or less, the specified filter-type is used for all scanlines:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     0: none\n     1: sub\n     2: up\n     3: average\n     4: Paeth\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf filter-type is 5, adaptive filtering is used when quality is greater\nthan 50 and the image does not have a color map, otherwise no filtering\nis used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf filter-type is 6, adaptive filtering\nwith <em>minimum-sum-of-absolute-values</em>\nis used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nOnly if the output is MNG, if filter-type is 7, the LOCO color transformation\nand adaptive filtering with <em>minimum-sum-of-absolute-values</em>\nare used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default is quality is 75, which means nearly the best compression with\nadaptive filtering.  The quality setting has no effect on the appearance\nof PNG and MNG images, since the compression is always lossless.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor further information, see the <a href=\"http://www.w3.org/TR/\">PNG</a>\nspecification.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen writing a JNG image with transparency, two quality values are required,\none for the main image and one for the grayscale image that conveys the\nopacity channel.  These are written as a single integer equal to the main\nimage quality plus 1000 times the opacity quality.  For example, if you\nwant to use quality 75 for the main image and quality 90 to compress\nthe opacity data, use <tt>-quality 90075</tt>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the PNM family of formats (PNM, PGM, and PPM) specify a quality\nfactor of zero in order to obtain the ASCII variant of the format. Note\nthat -compress <em>none</em> used to be used to trigger ASCII output but\nprovided the opposite result of what was expected as compared with other\nformats.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the TIFF format, the JPEG, WebP, Zip, and Zstd compression\nalgorithms are influenced by the quality value.  JPEG and WebP provide\nlossy compression so higher quality produces a larger file with less\ndegradation.  The Zip and Zstd compression algorithms (and WebP in\nlossless mode) are lossless and for these algorithms a higher\n'quality' means to work harder to produce a smaller file, but with no\ndifference in image quality.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-raise\"></a>-raise <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>lighten or darken image edges</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis will create a 3-D effect. See <strong>-geometry</strong> for details\ndetails about the geometry specification. Offsets are not used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>-raise</strong> to create a raised effect, otherwise use <strong>+raise</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-random-threshold\"></a>-random-threshold <i>&lt;channeltype&gt; &lt;LOWxHIGH&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>random threshold the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe channel or channels specified in the &lt;channeltype&gt; argument are\nreduced to binary, using an random-threshold method. The choices for\n<strong>channeltype</strong> are <strong>All</strong>, <strong>Intensity</strong>, <strong>Red</strong>,\n<strong>Green</strong>, <strong>Blue</strong>, <strong>Cyan</strong>, <strong>Magenta</strong>, <strong>Yellow</strong>,\n<strong>Black</strong>, and <strong>Opacity</strong></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen <strong>channeltype</strong> is \"All\", the color samples are thresholded into\na graylevel and then that gray level is stored in the three color\nchannels. Separately, the opacity channel is thresholded into a bilevel\nopacity value which is stored in the opacity channel. For each pixel, a\nnew random number is used to establish the threshold to be used. The\nthreshold never exceeds the specified maximum (HIGH) and is never less\nthan the specified minimum (LOW).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen <strong>channeltype</strong> is \"intensity\", only the color samples are\nthresholded. When <strong>channeltype</strong> is \"opacity\" or \"matte\", only the\nopacity channel is thresholded. The other named channels only threshold\nthe associated channel.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-recolor\"></a>-recolor <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a color translation matrix to image channels</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA user supplied color translation matrix (expressed as a text string)\nis used to translate/blend the image channels based on weightings in a\nsupplied matrix which may be of order 3 (color channels only), 4\n(color channels plus opacity), or 5 (color channels plus opacity and\noffset).  Values in the columns of the matrix (red, green, blue,\nopacity) are used as multipliers with the existing channel values and\nadded together according to the rows of the matrix.  Matrix values are\nfloating point and may be negative.  The offset column (column 5) is\npurely additive and is scaled such that 0.0 to 1.0 represents the\nmaximum quantum range (but values are not limited to this range). The\nmath for the color translation matrix is similar to that used by Adobe\nFlash except that the offset is scaled to 1.0 (divide Flash offset by\n255 for use with GraphicsMagick) so that the results are independent\nof quantum depth.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAn <strong>identity</strong> matrix exists for each matrix order which\nresults in no change to the image.  The translation matrix should be\nbased on an alteration of the identity matrix.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIdentity matrix of order 3</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  1 0 0\n  0 1 0\n  0 0 1\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nwhich may be formatted into a convenient matrix argument similar to\n(comma is treated as white space):</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  -recolor \"1 0 0, 0 1 0, 0 0 1\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIdentity matrix of order 4</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  1 0 0 0\n  0 1 0 0\n  0 0 1 0\n  0 0 0 1\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIdentity matrix of order 5.  The last row is required to exist\nfor the purpose of parsing, but is otherwise not used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  1 0 0 0 0\n  0 1 0 0 0\n  0 0 1 0 0\n  0 0 0 1 0\n  0 0 0 0 1\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAs an example, an image wrongly in BGR channel order may be converted\nto RGB using this matrix (blue-&gt;red, red-&gt;blue):</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  0 0 1\n  0 1 0\n  1 0 0\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nand an RGB image using standard Rec.709 primaries may be converted\nto grayscale using this matrix of standard weighting factors:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  0.2126 0.7152 0.0722\n  0.2126 0.7152 0.0722\n  0.2126 0.7152 0.0722\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nand contrast may be reduced by scaling down by 80% and adding a 10%\noffset:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  0.8 0.0 0.0 0.0 0.1\n  0.0 0.8 0.0 0.0 0.1\n  0.0 0.0 0.8 0.0 0.1\n  0.0 0.0 0.0 0.8 0.1\n  0.0 0.0 0.0 0.0 1.0\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-red-primary\"></a>-red-primary <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-region\"></a>-region <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply options to a portion of the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <em>x</em> and <em>y</em> offsets are treated in the same manner as in <strong>-crop</strong></font></td></tr></table>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-remote\"></a>-remote\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform a X11 remote operation</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-remote</strong> command sends a command to a \"gm display\" or \"gm\nanimate\" which is already running. The only command recognized at this\ntime is the name of an image file to load. This capability is very\nuseful to load new images without needing to restart GraphicsMagick\n(e.g. for a slide-show or to use GraphicsMagick as the display engine\nfor a different GUI). Also see the <strong>+progress</strong> option for a way\nto disable progress indication for a clean look while loading new images.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-render\"></a>-render\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+render</strong> to turn off rendering vector operations. This is\nuseful when saving the result to vector formats such as MVG or SVG.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-repage\"></a>-repage <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAdjust the current image page canvas and position based on a relative\npage specification.  This option may be used to change the location of\na subframe (e.g. part of an animation) prior to composition.  If the\ngeometry specification is absolute (includes a '!'), then the offset\nadjustment is absolute and there is no adjustment to page width and\nheight, otherwise the page width and height values are also adjusted\nbased on the current image dimensions.  Use <strong>+repage</strong> to set the\nimage page offsets to default.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-resample\"></a>-resample <i>&lt;horizontal&gt;x&lt;vertical&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Resample image to specified horizontal and vertical resolution</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nResize the image so that its rendered size remains the same as the\noriginal at the specified target resolution. Either the current image\nresolution units or the previously set with <strong>-units</strong> are used to\ninterpret the argument. For example, if a 300 DPI image renders at 3\ninches by 2 inches on a 300 DPI device, when the image has been\nresampled to 72 DPI, it will render at 3 inches by 2 inches on a 72\nDPI device.  Note that only a small number of image formats\n(e.g. JPEG, PNG, and TIFF) are capable of storing the image\nresolution. For formats which do not support an image resolution, the\noriginal resolution of the image must be specified via <strong>-density</strong>\non the command line prior to specifying the resample resolution.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nNote that Photoshop stores and obtains image resolution from a\nproprietary embedded profile. If this profile exists in the image,\nthen Photoshop will continue to treat the image using its former\nresolution, ignoring the image resolution specified in the standard\nfile header.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSome image formats (e.g. PNG) require use of metric or english units\nso even if the original image used a particular unit system, if it is\nsaved to a different format prior to resampling, then it may be\nnecessary to specify the desired resolution units using <strong>-units</strong>\nsince the original units may have been lost. In other words, do not\nassume that the resolution units are restored if the image has been\nsaved to a file.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-resize\"></a>-resize <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis is an alias for the <strong>-geometry</strong> option and it behaves in the\nsame manner. If the <strong>-filter</strong> option precedes the <strong>-resize</strong>\noption, the specified filter is used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThere are some exceptions:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>composite</em> option, <strong>-resize</strong> conveys the\npreferred size of the output image, while <strong>-geometry</strong> conveys the\nsize and placement of the <em>composite image</em> within the main\nimage.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>montage</em> option, <strong>-resize</strong> conveys the preferred\nsize of the montage, while <strong>-geometry</strong> conveys\ninformation about the tiles.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-roll\"></a>-roll <i></i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>roll an image vertically or horizontally</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details the geometry specification.  The\n<em>x</em> and <em>y</em> offsets are not affected by the <strong>-gravity</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA negative <em>x</em> offset rolls the image left-to-right. A negative\n<em>y</em> offset rolls the image top-to-bottom.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-rotate\"></a>-rotate <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPositive angles rotate the image in a clockwise direction while\nnegative angles rotate counter-clockwise.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <tt>&gt;</tt> to rotate the image only if its width exceeds the\nheight.  <tt>&lt;</tt> rotates the image <em>only</em> if its width is less\nthan the height. For example, if you specify <tt>-rotate \"-90&gt;\"</tt>\nand the image size is 480x640, the image is not rotated.  However, if\nthe image is 640x480, it is rotated by -90 degrees.  If you use\n<tt>&gt;</tt> or <tt>&lt;</tt>, enclose it in quotation marks to prevent it\nfrom being misinterpreted as a file redirection.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEmpty triangles left over from rotating the image are filled with the\ncolor defined as <strong>background</strong> (class <strong>backgroundColor</strong>).\nThe color is specified using the format described under the\n<strong>-fill</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-sample\"></a>-sample <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale image using pixel sampling</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details about\nthe geometry specification.\n<strong>-sample</strong> ignores the <strong>-filter</strong> selection if the <strong>-filter</strong> option\nis present.  Offsets, if present in the geometry string, are ignored, and\nthe <strong>-gravity</strong> option has no effect.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-sampling-factor\"></a>-sampling-factor <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option specifies the sampling factors to be used by the DPX, JPEG,\nMPEG, or YUV encoders for chroma downsampling. The sampling factor must\nbe specified while reading the raw YUV format since it is not preserved\nin the file header.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Industry-standard video subsampling notation such as \"4:2:2\" may also\nbe used to specify the sampling factors. \"4:2:2\" is equivalent to a\nspecification of \"2x1\"</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe JPEG decoder obtains the original sampling factors (and quality\nsettings) when a JPEG file is read. To re-use the original sampling\nfactors (and quality setting) when JPEG is output, use the <tt>-define\njpeg:preserve-settings</tt> flag.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-scale\"></a>-scale <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale the image.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details about\nthe geometry specification.  <strong>-scale</strong> uses a simpler, faster algorithm,\nand it ignores the <strong>-filter</strong> selection if the <strong>-filter</strong> option\nis present.  Offsets, if present in the geometry string, are ignored, and\nthe <strong>-gravity</strong> option has no effect.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-scene\"></a>-scene <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option sets the scene number of an image or the first image in\nan image sequence.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-scenes\"></a>-scenes <i>&lt;value-value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>range of image scene numbers to read</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEach image in the range is read\nwith the filename followed by a period (<strong>.</strong>) and the decimal scene\nnumber.  You\ncan change this behavior by embedding a <strong>%d, %0Nd, %o, %0No, %x, or %0Nx\nprintf</strong> format specification in the file name. For example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm montage -scenes 5-7 image.miff montage.miff\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nmakes a montage of files image.miff.5, image.miff.6, and image.miff.7, and</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm animate -scenes 0-12 image%02d.miff\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nanimates files image00.miff, image01.miff, through image12.miff.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-screen\"></a>-screen\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the screen to capture</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option indicates that the GetImage request used to obtain the image\nshould be done on the root window, rather than directly on the specified\nwindow.  In this way, you can obtain pieces of other windows that overlap\nthe specified window, and more importantly, you can capture menus or other\npopups that are independent windows but appear over the specified window.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-set\"></a>-set <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSet a named image attribute.  The attribute is set on the current\n(previously specified on command line) image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details+set\"></a>+set <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUnset a named image attribute.  The attribute is removed from the current\n(previously specified on command line) image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-segment\"></a>-segment <i>&lt;cluster threshold&gt;x&lt;smoothing threshold&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>segment an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSegment an image by analyzing the histograms of the color components and\nidentifying units that are homogeneous with the fuzzy c-means technique.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSegmentation is a very useful fast and and approximate color quantization\nalgorithm for scanned printed pages or scanned cartoons. It may also be\nused as a special effect. Specify <em>cluster threshold</em> as the minimum\npercentage of total pixels in a cluster before it is considered valid.\nFor huge images containing small detail, this may need to be a tiny\nfraction of a percent (e.g. 0.015) so that important detail is not lost.\n<em>Smoothing threshold</em> eliminates noise in the second derivative of\nthe histogram. As the value is increased, you can expect a smoother\nsecond derivative. The default is 1.5. Add the <em>-verbose</em> option to\nsee a dump of cluster statistics given the parameters used. The\nstatistics may be used as a guide to help fine tune the options.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-shade\"></a>-shade <i>&lt;azimuth&gt;x&lt;elevation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shade the image using a distant light source</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <em>azimuth</em> and <em>elevation</em> as the position of the light\nsource. Use <strong>+shade</strong> to return the shading results as a grayscale\nimage.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -shadow <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shadow the montage</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-shared-memory\"></a>-shared-memory\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use shared memory</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option specifies whether the utility should attempt to use shared\nmemory for pixmaps.  GraphicsMagick must be compiled with shared\nmemory support, and the display must support the <em>MIT-SHM</em>\nextension.  Otherwise, this option is ignored.  The default is\n<strong>True</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-sharpen\"></a>-sharpen <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse a Gaussian operator of the given radius and standard deviation\n(sigma).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-shave\"></a>-shave <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shave pixels from the image edges</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify the width of the region to be removed from both\nsides of the image and the height of the regions to be removed from\ntop and bottom.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-shear\"></a>-shear <i>&lt;x degrees&gt;x&lt;y degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shear the image along the X or Y axis</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the specified positive or negative shear angle.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nShearing slides one edge of an image along the X or Y axis, creating a\nparallelogram. An X direction shear slides an edge along the X axis,\nwhile a Y direction shear slides an edge along the Y axis. The amount\nof the shear is controlled by a shear angle. For X direction shears,\n<em>x degrees</em> is measured relative to the Y axis, and similarly,\nfor Y direction shears <em>y degrees</em> is measured relative to the X\naxis.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEmpty triangles left over from shearing the image are filled with the\ncolor defined as <strong>background</strong> (class <strong>backgroundColor</strong>).\nThe color is specified using the format described under the\n<strong>-fill</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -silent\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>operate silently</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-size\"></a>-size <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to specify the width and height of raw images whose\ndimensions are unknown such as <strong>GRAY</strong>, <strong>RGB</strong>, or\n<strong>CMYK</strong>. In addition to width and height, use <strong>-size</strong> with an\noffset to skip any header information in the image or tell the number\nof colors in a <strong>MAP</strong> image file, (e.g. -size 640x512+256).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor Photo CD images, choose from these sizes:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     192x128\n     384x256\n     768x512\n     1536x1024\n     3072x2048\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFinally, use this option to choose a particular resolution layer of a JBIG\nor JPEG image (e.g. -size 1024x768).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-snaps\"></a>-snaps <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>number of screen snapshots</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option\nto grab more than one image from the X server screen, to create\nan animation sequence.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-solarize\"></a>-solarize <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>negate all pixels above the threshold level</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <em>factor</em> as the\npercent threshold of the intensity (0 - 99.9%).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option produces a <em>solarization</em> effect seen when exposing a\nphotographic film to light during the development process.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-spread\"></a>-spread <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image pixels by a random amount</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>Amount</em> defines the size of the neighborhood around each pixel to\nchoose a candidate pixel to swap.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-stegano\"></a>-stegano <i>&lt;offset&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>hide watermark within an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse an offset to start the image hiding some number of pixels from the\nbeginning of the image.  Note this offset and the image size.  You will\nneed this information to recover the steganographic image\n(e.g. display -size 320x256+35 stegano:image.png).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-stereo\"></a>-stereo\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite two images to create a stereo anaglyph</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe left side of the stereo pair is saved as the red channel of the output\nimage.  The right side is saved as the green channel.  Red-green stereo\nglasses are required to properly view the stereo image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-strip\"></a>-strip\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAll embedded profiles and text attributes are stripped from the image.\nThis is useful for images used for the web, or when output files need\nto be as small as possible</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBe careful not to use this option to remove author, copyright, and\nlicense information that you are required to retain when redistributing\nan image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-stroke\"></a>-stroke <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when stroking a graphic primitive</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-draw</strong> for further details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-strokewidth\"></a>-strokewidth <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the stroke width</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-draw</strong> for further details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-swirl\"></a>-swirl <i>&lt;degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>swirl image pixels about the center</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>Degrees</em> defines the tightness of the swirl.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-text-font\"></a>-text-font <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>font for writing fixed-width text</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecifies the name of the preferred font to use in fixed (typewriter style)\nformatted text.  The default is 14 point <em>Courier</em>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can tag a font to specify whether it is a PostScript, TrueType, or\nX11 font.  For example, <tt>Courier.ttf</tt> is a TrueType font\nand <tt>x:fixed</tt> is X11.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-threshold\"></a>-threshold <i>&lt;value&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>threshold the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nModify the image such that any pixel sample with an intensity value\ngreater than the threshold is assigned the maximum intensity (white), or\notherwise is assigned the minimum intensity (black). If a percent prefix\nis applied, then the threshold is a percentage of the available range.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nTo efficiently create a black and white image from a color image, use</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -threshold 50% in.png out.png\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe optimum threshold value depends on the nature of the image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">In order to threshold individual channels, use the <strong>-operator</strong>\nsubcommand with it's <strong>Threshold</strong>, <strong>Threshold-White</strong>, or\n<strong>Threshold-Black</strong> options.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-thumbnail\"></a>-thumbnail <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-thumbnail</strong> command resizes the image as quickly as\npossible, with more concern for speed than resulting image quality.\nRegardless, resulting image quality should be acceptable for many\nuses.  It is primarily intended to be used to generate smaller\nversions of the image, but may also be used to enlarge the image.  The\n<strong>-thumbnail</strong> <strong>geometry</strong> argument observes the same syntax\nand rules as it does for <strong>-resize</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tile image when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>layout of images [<em>montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-title\"></a>-title <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign title to displayed image [<em>animate, display, montage</em>]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to assign a specific title to the image. This is\nassigned to the image window and is typically displayed in the window\ntitle bar.  Optionally you can include the image filename, type,\nwidth, height, Exif data, or other image attribute by embedding\nspecial format characters described under the <strong>-format</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -title \"%m:%f %wx%h\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nproduces an image title of <tt>MIFF:bird.miff 512x480</tt> for an image\ntitled <tt>bird.miff</tt> and whose width is 512 and height is 480.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-transform\"></a>-transform\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option applies the transformation matrix from a previous\n<strong>-affine</strong> option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -affine 2,2,-2,2,0,0 -transform bird.ppm bird.jpg\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-transparent\"></a>-transparent <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-treedepth\"></a>-treedepth <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nNormally, this integer value is zero or one. A value of zero or one\ncauses the use of an optimal tree depth for the color reduction\nalgorithm</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAn optimal depth generally allows the best representation of the source\nimage with the fastest computational speed and the least amount of memory.\nHowever, the default depth is inappropriate for some images. To assure\nthe best representation, try values between 2 and 8 for this parameter.\nRefer to\n<a href=\"quantize.html\">quantize</a> for more details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-colors</strong> or <strong>-monochrome</strong> option, or writing to an image\nformat which requires color reduction, is required for this option to\ntake effect.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-trim\"></a>-trim\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option removes any edges that are exactly the same color as the\ncorner pixels.  Use <strong>-fuzz</strong> to make <strong>-trim</strong> remove edges that\nare nearly the same color as the corner pixels.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-type\"></a>-type <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from:\n<strong>Bilevel</strong>, <strong>Grayscale</strong>, <strong>Palette</strong>,\n<strong>PaletteMatte</strong>, <strong>TrueColor</strong>, <strong>TrueColorMatte</strong>,\n<strong>ColorSeparation</strong>, <strong>ColorSeparationMatte</strong>, or <strong>Optimize</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nNormally, when a format supports different subformats such as bilevel,\ngrayscale, palette, truecolor, and truecolor+alpha, the encoder will try\nto choose a suitable subformat based on the nature of the image. The\n<strong>-type</strong> option may be used to tailor the output subformat. By\ndefault the output subformat is based on readily available image\ninformation and is usually similar to the input format.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <tt>-type Optimize</tt> in order to enable inspecting all pixels\n(if necessary) in order to find the most efficient subformat. Inspecting\nall of the pixels may be slow for very large images, particularly if they\nare stored in a disk cache. If an RGB image contains only gray pixels,\nthen every pixel in the image must be inspected in order to decide that\nthe image is actually grayscale!</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSometimes a specific subformat is desired. For example, to force a JPEG\nimage to be written in TrueColor RGB format even though only gray pixels\nare present, use</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert bird.pgm -type TrueColor bird.jpg\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSimilarly, using <tt>-type TrueColorMatte</tt> will force the encoder to\nwrite an alpha channel even though the image is opaque, if the output\nformat supports transparency.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSome pseudo-formats (e.g. the XC format) will respect the requested\ntype if it occurs previously on the command line.  For example, to obtain\na DirectClass solid color canvas image rather than PsuedoClass, use</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -size 640x480 -type TrueColor xc:red red.miff\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nLikewise, specify <strong>-type</strong> <strong>Bilevel</strong>, <strong>Grayscale</strong>,\n<strong>TrueColor</strong>, or <strong>TrueColorMatte</strong> prior to reading a Postscript\n(or PDF file) in order to influence the type of image that Ghostcript\nreturns. Reading performance will be dramatically improved for\nblack/white Postscript if <strong>Bilevel</strong> is specified, and will be\nconsiderably faster if <strong>Grayscale</strong> is specified.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-update\"></a>-update <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\ndetect when image file is modified and redisplay.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSuppose that while you are displaying an image the file that is currently\ndisplayed is over-written.\n<strong>display</strong> will automatically detect that\nthe input file has been changed and update the displayed image accordingly.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-units\"></a>-units <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the units of image resolution</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from: <strong>Undefined</strong>, <strong>PixelsPerInch</strong>, or\n<strong>PixelsPerCentimeter</strong>. This option is normally used in conjunction\nwith the <strong>-density</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-unsharp\"></a>-unsharp <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+&lt;amount&gt;</i>}<i></i>{<i>+&lt;threshold&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image with an unsharp mask operator</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-unsharp</strong> option sharpens an image. The image is convolved\nwith a Gaussian operator of the given radius and standard deviation\n(sigma). For reasonable results, radius should be larger than sigma. Use\na radius of 0 to have the method select a suitable radius.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe parameters are:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>radius</dt>\n<dd>\nThe radius of the Gaussian, in pixels, not counting the center pixel (default 0).\n</dd>\n<dt>sigma</dt>\n<dd>\nThe standard deviation of the Gaussian, in pixels (default 1.0).\n</dd>\n<dt>amount</dt>\n<dd>\nThe percentage of the difference between the original and the blur image that\nis added back into the original (default 1.0).\n</dd>\n<dt>threshold</dt>\n<dd>\nThe threshold, as a fraction of MaxRGB, needed to apply the difference\namount (default 0.05).\n</dd>\n</dl>\n</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -use-pixmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use the pixmap</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-verbose\"></a>-verbose\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis information is printed: image scene number; image name; image size;\nthe image class (<em>DirectClass</em> or <em>PseudoClass</em>); the total\nnumber of unique colors; and the number of seconds to read and transform\nthe image. If the image is <em>DirectClass</em>, the total number of unique\ncolors is not displayed unless <strong>-verbose</strong> is specified twice since\nit may take quite a long time to compute, particularly for deep images.\nIf the image is <em>PseudoClass</em> then its pixels are defined by indexes\ninto a colormap. If the image is <em>DirectClass</em> then each pixel\nincludes a complete and independent color specification.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf <strong>-colors</strong> is also specified, the total unique colors in the image\nand color reduction error values are printed. Refer to <a href=\"quantize.html\">quantize</a>\nfor a description of these values.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-version\"></a>-version\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -view <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>FlashPix viewing parameters</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-virtual-pixel\"></a>-virtual-pixel <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify contents of \"virtual pixels\"</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option \ndefines \"virtual pixels\" for use in operations that can access pixels outside\nthe boundaries of an image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from these methods:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>Constant</dt>\n<dd>\nUse the image background color.\n</dd>\n<dt>Edge</dt>\n<dd>\nExtend the edge pixel toward infinity (default).\n</dd>\n<dt>Mirror</dt>\n<dd>\nMirror the image.\n</dd>\n<dt>Tile</dt>\n<dd>\nTile the image.\n</dd>\n</dl>\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option affects operations that use\nvirtual pixels such as <strong>-blur</strong>, <strong>-sharpen</strong>, <strong>-wave</strong>, etc.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-visual\"></a>-visual <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>animate images using this X visual type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from these visual classes:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     StaticGray\n     GrayScale\n     StaticColor\n     PseudoColor\n     TrueColor\n     DirectColor\n     default\n     visual id\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe X server must support the visual you choose, otherwise an error occurs.\nIf a visual is not specified, the visual class that can display the most\nsimultaneous colors on the default screen is chosen.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -watermark <i>&lt;brightness&gt;x&lt;saturation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>percent brightness and saturation of a watermark</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-wave\"></a>-wave <i>&lt;amplitude&gt;x&lt;wavelength&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>alter an image along a sine wave</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <em>amplitude</em> and <em>wavelength</em>\nof the wave.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-white-point\"></a>-white-point <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-white-threshold\"></a>-white-threshold <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels above the threshold become white</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>-white-threshold</strong> to set pixels with values above the specified\nthreshold to maximum value (white). If only one value is supplied, or the\nred, green, and blue values are identical, then intensity thresholding is\nused. If the color threshold values are not identical then channel-based\nthresholding is used, and color distortion will occur. Specify a negative\nvalue (e.g. -1) if you want a channel to be ignored but you do want to\nthreshold a channel later in the list. If a percent (%) symbol is\nappended, then the values are treated as a percentage of maximum\nrange.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-window\"></a>-window <i>&lt;id&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image the background of a window</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>id</em> can be a window id or name.  Specify <strong>root</strong> to\nselect X's root window as the target window.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default the image is tiled onto the background of the target\nwindow.   If <strong>backdrop</strong> or <strong>-geometry</strong> are\nspecified, the image is surrounded by the background color.  Refer to\n<strong>X RESOURCES</strong> for details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe image will not display on the root window if the image has more\nunique colors than the target window colormap allows.  Use\n<strong>-colors</strong> to reduce the number of colors.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -window-group\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the window group</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-write\"></a>-write <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write an intermediate image [<em>convert, composite</em>]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe current image is written to the specified filename and then\nprocessing continues using that image. The following is an example of how\nseveral sizes of an image may be generated in one command (repeat as\noften as needed):</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert input.jpg -resize 50% -write input50.jpg \\\n              -resize 25% input25.jpg\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-write\"></a>-write <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write the image to a file [<em>display</em>]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf <em>filename</em> already exists, you will be prompted as to whether it should\nbe overwritten.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, the image is written in the format that it was read in as.\nTo specify a particular image format, prefix <em>filename</em> with the\nimage type and a colon (e.g., ps:image) or specify the image type as\nthe filename suffix (e.g., image.ps). Specify file as - for standard\noutput. If file has the extension <strong>.Z</strong> or <strong>.gz</strong>, the file\nsize is <strong>compressed</strong> using compress or <strong>gzip</strong>\nrespectively. Precede the image file name with | to pipe to a system\ncommand.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>-compress</strong> to specify the type of image compression.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe equivalent X resource for this option is\n<strong>writeFilename</strong> (class <strong>WriteFilename</strong>).\nSee\n<a href=\"#xres\">X Resources</a>\nfor details.</font></td></tr></table>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"envi\"></a>Environment\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    COLUMNS\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Output screen width. Used when formatting text for the screen. Many\nUnix systems keep this shell variable up to date, but it may need to be\nexplicitly exported in order for GraphicsMagick to see it.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    DISPLAY\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>X11 display ID (host, display number, and screen in the form\nhostname:display.screen).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    HOME\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Location of user's home directory. For security reasons, now only\nobserved by \"uninstalled\" builds of GraphicsMagick which do not have\ntheir location hard-coded or set by an installer.  When supported,\nGraphicsMagick searches for configuration files in $HOME/.magick if\nthe directory exists. See <strong>MAGICK_CODER_MODULE_PATH</strong>,\n<strong>MAGICK_CONFIGURE_PATH</strong>, and <strong>MAGICK_FILTER_MODULE_PATH</strong> if\nmore flexibility is needed.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_ACCESS_MONITOR\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>When set to <strong>TRUE</strong>, command line monitor mode (enabled by\n<strong>-monitor</strong>) will also show files accessed (including temporary\nfiles) and any external commands which are executed. This is useful\nfor debugging, but also illustrates arguments made available to an\naccess handler registered by the\n<strong>MagickSetConfirmAccessHandler()</strong> C library function.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_CODER_STABILITY\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>The minimum coder stability level before it will be used. The\navailable levels are <strong>PRIMARY</strong>, <strong>STABLE</strong>, <strong>UNSTABLE</strong>,\nand <strong>BROKEN</strong>.  The default minimum level is <strong>UNSTABLE</strong>,\nwhich means that all available working coders will be used. The\npurpose of this option is to reduce the security exposure (or apparent\ncomplexity) due to the huge number of formats supported. Coders at the\n<strong>PRIMARY</strong> level are commonly used formats with very well\nmaintained implementations. Coders at the <strong>STABLE</strong> level are\nreasonably well maintained but represent less used formats. Coders at\nthe <strong>UNSTABLE</strong> level either have weak implementations, the file\nformat itself is weak, or the probability the coder will be needed is\nvanishingly small. Coders at the <strong>BROKEN</strong> level are known to\noften not work properly or might not be useful in their current state\nat all.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_CODER_MODULE_PATH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Search path to use when searching for image format coder modules.\nThis path allows the user to arbitrarily extend the image formats\nsupported by GraphicsMagick by adding loadable modules to an arbitrary\nlocation rather than copying them into the GraphicsMagick installation\ndirectory. The formatting of the search path is similar to operating\nsystem search paths (i.e. colon delimited for Unix, and semi-colon\ndelimited for Microsoft Windows). This user specified search path is used\nbefore trying the default search path.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_CONFIGURE_PATH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Search path to use when searching for configuration (.mgk) files.\nThe formatting of the search path is similar to operating system search\npaths (i.e. colon delimited for Unix, and semi-colon delimited for\nMicrosoft Windows). This user specified search path is used before trying\nthe default search path.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_DEBUG\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Debug options (see <strong>-debug</strong> for details).  Setting the\nconfigure debug option via an environment variable\n(e.g. <strong>MAGICK_DEBUG=configure</strong>) is necessary to see the complete\ninitialization process, which includes searching for configuration\nfiles.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_FILTER_MODULE_PATH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Search path to use when searching for filter process modules\n(invoked via <strong>-process</strong>). This path allows the user to arbitrarily\nextend GraphicsMagick's image processing functionality by adding loadable\nmodules to an arbitrary location rather than copying them into the\nGraphicsMagick installation directory. The formatting of the search path\nis similar to operating system search paths (i.e. colon delimited for\nUnix, and semi-colon delimited for Microsoft Windows). This user\nspecified search path is used before trying the default search path.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_GHOSTSCRIPT_PATH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>For Microsoft Windows, specify the path to the Ghostscript\ninstallation rather than searching for it via the Windows registry.\nThis helps in case Ghostscript is not installed via the Ghostscript\nWindows installer or the user wants more control over the Ghostscript\nused.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_HOME\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Path to top of GraphicsMagick installation directory. Only observed\nby \"uninstalled\" builds of GraphicsMagick which do not have their location\nhard-coded or set by an installer.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_MMAP_READ\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>If <strong>MAGICK_MMAP_READ</strong> is set to <strong>TRUE</strong>, GraphicsMagick\nwill attempt to memory-map the input file for reading. This usually\nsubstantially improves repeated read performance since the file is\nalready in memory after the first time it has been read. However,\ntesting shows that performance may be reduced for files accessed for\nthe first time since data is accessed via page-faults (upon first\naccess) and many operating systems fail to do sequential read-ahead of\nmemory mapped files, and particularly if those files are accessed over\na network.  If many large input files are read, then enabling this\noption may harm performance by overloading the operating system's VM\nsystem as it then needs to free unmapped pages and map new ones.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_IO_FSYNC\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>If <strong>MAGICK_IO_FSYNC</strong> is set to <strong>TRUE</strong>, then GraphicsMagick\nwill request that the output file is fully flushed and synchronized to\ndisk when it is closed. This incurs a performance penalty, but has the\nbenefit that if the power fails or the system crashes, the file should be\nvalid on disk. If image files are referenced from a database, then this\noption helps assure that the files referenced by the database are\nvalid.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_IOBUF_SIZE\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>The amount of I/O buffering (in bytes) to use when reading and\nwriting encoded files. The default is 16384, which is observed to work\nwell for many cases. The best value for a local filesystem is usually the\nthe native filesystem block size (e.g. 4096, 8192, or even 131,072 for\nZFS) in order to minimize the number of physical disk I/O operations.\nI/O performance to files accessed over a network may benefit\nsignificantly by tuning this option. Larger values are not necessarily\nbetter (they may be slower!), and there is rarely any benefit from using\nvalues larger than 32768. Use convert's <strong>-verbose</strong> option in order\nto evaluate read and write rates in pixels per second while keeping in\nmind that the operating system will try to cache files in RAM.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_DISK\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum amount of disk space allowed for use by the pixel cache.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_FILES\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum number of open files.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_MAP\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum size of a memory mapped file allocation.  A memory mapped\nfile consumes memory when the file is accessed, although the system\nmay reclaim such memory when needed.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_MEMORY\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum amount of memory to allocate from the heap.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_PIXELS\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum number of total pixels (image rows times image colums) to\nallow for any image which is requested to be created or read.  This is\nuseful to place a limit on how large an image may be.  If the input\nimage file has image dimensions larger than the pixel limit, then the\nimage memory allocation is denied and an error is returned\nimmediately.  This is a per-image limit and does not limit the total\nnumber of pixels due to multiple image frames/pages (e.g. multi-page\ndocument or an animation).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_WIDTH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum pixel width of an image read, or created.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_HEIGHT\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum pixel height of an image read, or created.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_TMPDIR\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Path to directory where GraphicsMagick should write temporary\nfiles. The default is to use the system default, or the location set by\n<strong>TMPDIR</strong>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    TMPDIR\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>For POSIX-compatible systems (Unix-compatible), the path to the\ndirectory where all applications should write temporary files.\nOverridden by <strong>MAGICK_TMPDIR</strong> if it is set.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    TMP <i>or TEMP</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>For Microsoft Windows, the path to the directory where applications\nshould write temporary files. Overridden by <strong>MAGICK_TMPDIR</strong> if it\nis set.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    OMP_NUM_THREADS\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>As per the OpenMP standard, this specifies the number of threads to\nuse in parallel regions. Some compilers default the number of threads to\nuse to the number of processor cores available while others default to\njust one thread. See the OpenMP specification for other standard\nadjustments and your compiler's manual for vendor-specific settings.</td></tr></table>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"file\"></a>Configuration Files\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>GraphicsMagick uses a number of XML format configuration files:\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    colors.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colors configuration file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  &lt;?xml version=\"1.0\"?&gt;\n  &lt;colormap&gt;\n    &lt;color name=\"AliceBlue\" red=\"240\" green=\"248\" blue=\"255\"\n           compliance=\"SVG, X11, XPM\" /&gt;\n  &lt;/colormap&gt;\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    delegates.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>delegates configuration file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    log.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>logging configuration file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  &lt;?xml version=\"1.0\"?&gt;\n  &lt;magicklog&gt;\n    &lt;log events=\"None\" /&gt;\n    &lt;log output=\"stdout\" /&gt;\n    &lt;log filename=\"Magick-%d.log\" /&gt;\n    &lt;log generations=\"3\" /&gt;\n    &lt;log limit=\"2000\" /&gt;\n    &lt;log format=\"%t %r %u %p %m/%f/%l/%d:\\n  %e\"  /&gt;\n  &lt;/magicklog&gt;\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    modules.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>loadable modules configuration file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  &lt;?xml version=\"1.0\"?&gt;\n  &lt;modulemap&gt;\n    &lt;module magick=\"8BIM\" name=\"META\" /&gt;\n  &lt;/modulemap&gt;\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    type.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>master type (fonts) configuration file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  &lt;?xml version=\"1.0\"?&gt;\n  &lt;typemap&gt;\n    &lt;<strong></strong>include file=\"type-windows.mgk\" /&gt;\n    &lt;type\n      name=\"AvantGarde-Book\"\n      fullname=\"AvantGarde Book\"\n      family=\"AvantGarde\"\n      foundry=\"URW\"\n      weight=\"400\"\n      style=\"normal\"\n      stretch=\"normal\"\n      format=\"type1\"\n      metrics=\"/usr/local/share/ghostscript/fonts/a010013l.afm\"\n      glyphs=\"/usr/local/share/ghostscript/fonts/a010013l.pfb\"\n    /&gt;\n  &lt;/typemap&gt;\n</pre></font></td></tr></table>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"auth\"></a>Authors\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<em>\nJohn Cristy,<br>\nBob Friesenhahn,<br>\nGlenn Randers-Pehrson,<br>\nWilliam Radcliff,<br>\nLeonard Rosenthol,<br>\nLars Ruben Skyum,<br>\nJaroslav Fojtik,<br>\nand many more.\n</em>\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"copy\"></a>Copyright\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Copyright (C) 2002 - 2020 GraphicsMagick Group.</strong> Additional\ncopyrights apply. Please see see\nhttp://www.GraphicsMagick.org/Copyright.html for details.\n<p>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<HR>\n\n[<a href=\"index.html\">Home</a>] [<a href=\"utilities.html\">Utilities Index</a>]\n<BR>\n<p align=center <a href=\"Copyright.html\">Copyright &#169; GraphicsMagick Group 2002 - 2020</a></p></td>\n</tr></table>\n</body></html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Hg.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Mercurial</title>\n<meta content=\"GraphicsMagick is a robust collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats including GIF, JPEG, PNG, PDF, and Photo CD. With GraphicsMagick you can create GIFs dynamically making it suitable for Web applications.  You can also resize, rotate, sharpen, color reduce, or add special effects to an image and save your completed work in the same or differing image format. \" name=\"description\" />\n<meta content=\"GraphicsMagick, PerlMagick, visualization, image processing, software development, simulation, image, software, Magick++\" name=\"keywords\" />\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-mercurial\">\n<h1 class=\"title\">GraphicsMagick Mercurial</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#what-is-mercurial\" id=\"id1\">What is Mercurial?</a></li>\n<li><a class=\"reference internal\" href=\"#web-access\" id=\"id2\">Web Access</a></li>\n<li><a class=\"reference internal\" href=\"#cloning-the-mercurial-repository\" id=\"id3\">Cloning the Mercurial Repository</a></li>\n<li><a class=\"reference internal\" href=\"#selecting-a-version-of-the-code\" id=\"id4\">Selecting a version of the code</a></li>\n<li><a class=\"reference internal\" href=\"#updating-from-the-mercurial-repository\" id=\"id5\">Updating from the Mercurial Repository</a></li>\n<li><a class=\"reference internal\" href=\"#mercurial-software\" id=\"id6\">Mercurial Software</a></li>\n<li><a class=\"reference internal\" href=\"#mercurial-for-graphicsmagick-developers\" id=\"id7\">Mercurial for GraphicsMagick Developers</a></li>\n<li><a class=\"reference internal\" href=\"#ssh-public-keys-for-hg-graphicsmagick-org\" id=\"id8\">SSH Public Keys For hg.GraphicsMagick.org</a></li>\n<li><a class=\"reference internal\" href=\"#email-notifications\" id=\"id9\">Email Notifications</a></li>\n<li><a class=\"reference internal\" href=\"#mercurial-topics\" id=\"id10\">Mercurial Topics</a></li>\n</ul>\n</div>\n<p>The GraphicsMagick source code is available via <a class=\"reference external\" href=\"https://www.mercurial-scm.org/\">Mercurial</a>. <a class=\"reference external\" href=\"https://www.mercurial-scm.org/\">Mercurial</a>\nis a convenient way for developers from around the country or world to\ndownload the GraphicsMagick source, fix bugs, or add new features.\nDue to the way <a class=\"reference external\" href=\"https://www.mercurial-scm.org/\">Mercurial</a> works, it may also be used to manage local\nchanges to GraphicsMagick.</p>\n<div class=\"section\" id=\"what-is-mercurial\">\n<h1><a class=\"toc-backref\" href=\"#id1\">What is Mercurial?</a></h1>\n<p><a class=\"reference external\" href=\"https://www.mercurial-scm.org/\">Mercurial</a> (also known as <cite>Hg</cite> due to the abbreviation for Mercury in\nthe periodic table of the elements) is a modern source control system\nwhich provides anyone who clones a repository with a stand-alone local\nrepository containing the full development history and the ability to\nselect any version of the code.  Since the local repository is\nfully-functional, you may use the same repository to manage your local\nchanges to GraphicsMagick code and you may use the repository to share\nyour changes with others.</p>\n</div>\n<div class=\"section\" id=\"web-access\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Web Access</a></h1>\n<p>The <a class=\"reference external\" href=\"http://hg.code.sf.net/p/graphicsmagick/code/\">GraphicsMagick repository at SourceForge</a> web interface is\navailable which may be used to interactively view the latest versions\nof files, or the changes to files, using your web browser.</p>\n</div>\n<div class=\"section\" id=\"cloning-the-mercurial-repository\">\n<h1><a class=\"toc-backref\" href=\"#id3\">Cloning the Mercurial Repository</a></h1>\n<p>To get the tree and place it in a sub-directory of your current working\ndirectory, issue the command:</p>\n<pre class=\"literal-block\">\nhg clone http://hg.code.sf.net/p/graphicsmagick/code GM\n</pre>\n</div>\n<div class=\"section\" id=\"selecting-a-version-of-the-code\">\n<h1><a class=\"toc-backref\" href=\"#id4\">Selecting a version of the code</a></h1>\n<p>By default the cloned directory is populated with files from the\n<cite>default</cite> (i.e. head) branch of the code, which is where active\ndevelopment happens.</p>\n<p>If you require a specific release of GraphicsMagick (e.g. 1.3.23), you may select it like:</p>\n<pre class=\"literal-block\">\nhg update -r GraphicsMagick-1_3_23\n</pre>\n<p>or if you require a specific branch of GraphicsMagick (e.g. 1.3), you may use:</p>\n<pre class=\"literal-block\">\nhg update -r GraphicsMagick-1_3\n</pre>\n<p>or you may request the files which were current on a specific date:</p>\n<pre class=\"literal-block\">\nhg update -d 2009-01-14\n</pre>\n<p>Use:</p>\n<pre class=\"literal-block\">\nhg branches\n</pre>\n<p>to see the available branches, and:</p>\n<pre class=\"literal-block\">\nhg tags\n</pre>\n<p>to see the available release tags.</p>\n</div>\n<div class=\"section\" id=\"updating-from-the-mercurial-repository\">\n<h1><a class=\"toc-backref\" href=\"#id5\">Updating from the Mercurial Repository</a></h1>\n<p>To pull more changes from the repository, execute:</p>\n<pre class=\"literal-block\">\nhg pull\n</pre>\n<p>and to make them visible in your files (via a merge), execute:</p>\n<pre class=\"literal-block\">\nhg update\n</pre>\n<p>or just:</p>\n<pre class=\"literal-block\">\nhg pull -u\n</pre>\n<p>The latter pulls down any updates into your local repository and\nautomatically does a merge.</p>\n</div>\n<div class=\"section\" id=\"mercurial-software\">\n<h1><a class=\"toc-backref\" href=\"#id6\">Mercurial Software</a></h1>\n<p>The best place to look for the latest version of Mercurial (<cite>Hg</cite>) is\nat the <a class=\"reference external\" href=\"https://www.mercurial-scm.org/\">Mercurial</a> web site.  Most free operating systems (e.g. Linux,\nOpenIndiana, and *BSD) will offer a version of Mercurial as an\ninstallable package and it may already be installed on your system.\nWe recommend use of <a class=\"reference external\" href=\"https://tortoisehg.bitbucket.io/\">TortoiseHg</a> on Microsoft Windows systems since it\nprovides a very nice graphical interface.  <a class=\"reference external\" href=\"https://tortoisehg.bitbucket.io/\">TortoiseHg</a> is also\navailable on Linux and other systems.</p>\n</div>\n<div class=\"section\" id=\"mercurial-for-graphicsmagick-developers\">\n<h1><a class=\"toc-backref\" href=\"#id7\">Mercurial for GraphicsMagick Developers</a></h1>\n<p>Since <a class=\"reference external\" href=\"https://www.mercurial-scm.org/\">Mercurial</a> is a distributed revision control system, you may\nclone the GraphicsMagick repository and work for days or weeks (making\nyour own local commits) before you decide to push some or all of your\nchanges to the GraphicsMagick development repository.  GraphicsMagick\ndevelopers first commit changes to their own local respository, then\nthey push their changes to the GraphicsMagick development repository\nat hg.graphicsmagick.org, later on (after testing and possible fixes)\nI will push the changes to the stable repository at SourceForge.\nPushes to the stable repository at SourceForge should occur at least\nas often as source code snapshots are produced.</p>\n<p>The repository hierarchy is as follows:</p>\n<ol class=\"arabic simple\">\n<li>Local</li>\n</ol>\n<blockquote>\nThe developer makes any local changes and commits what he likes in his\nown repository.  It is best to commit often and whenever all the\nfiles have been updated to implement a coherent change or feature\n(including the ChangeLog file!) since <a class=\"reference external\" href=\"https://www.mercurial-scm.org/\">Mercurial</a> stores related\nchanges as a changeset along with the change message you enter.\nWhen you push your repository, these changesets and messages are\npreserved.</blockquote>\n<ol class=\"arabic simple\" start=\"2\">\n<li>Unstable</li>\n</ol>\n<blockquote>\n<p>The unstable development repository is available via ssh at\n&quot;<a class=\"reference external\" href=\"ssh://yourid&#64;hg.GraphicsMagick.org//hg/GraphicsMagick\">ssh://yourid&#64;hg.GraphicsMagick.org//hg/GraphicsMagick</a>&quot;.</p>\n<p>Where <cite>yourid</cite> is the Unix user ID on the GraphicsMagick server.\nThe <cite>yourid&#64;</cite> part may left out if your client system uses the same\nuser ID as on the GraphicsMagick server.</p>\n</blockquote>\n<ol class=\"arabic simple\" start=\"3\">\n<li>Stable</li>\n</ol>\n<blockquote>\nThe stable repository is available via http at\n&quot;<a class=\"reference external\" href=\"http://hg.code.sf.net/p/graphicsmagick/code\">http://hg.code.sf.net/p/graphicsmagick/code</a>&quot;.  Any changes in the\nunstable development repository are pushed to the stable repository\n(by the developer responsible for this role) once any necessary\nadjustments have been made, documentation files have been generated,\nand the software test suite has passed on at least one machine.</blockquote>\n<p>To build your local development repository (as quickly as possible),\nyou may use these steps:</p>\n<ol class=\"arabic\">\n<li><p class=\"first\">Clone the stable respository at SourceForge:</p>\n<pre class=\"literal-block\">\nhg clone http://hg.code.sf.net/p/graphicsmagick/code GM\n</pre>\n</li>\n<li><p class=\"first\">Adjust your local repository path default to use the unstable repository.</p>\n<p>Edit .hg/hgrc in your local repository so that it contains:</p>\n<pre class=\"literal-block\">\n[paths]\ndefault = ssh://yourid&#64;hg.GraphicsMagick.org//hg/GraphicsMagick\n</pre>\n<p>where <cite>yourid</cite> is the Unix user ID on the GraphicsMagick server.</p>\n</li>\n<li><p class=\"first\">Pull any additional pending updates from the unstable repository:</p>\n<pre class=\"literal-block\">\nhg pull -u\n</pre>\n</li>\n</ol>\n<p>Please note that when ssh access is used, Mercurial uncompresses any\ndata and sends it in uncompressed form.  Mercurial expects that\ncompression will be enabled in ssh when needed.  One way to enable ssh\ncompression is to put this in your local .hgrc:</p>\n<pre class=\"literal-block\">\n[ui]\nssh = ssh -C\n</pre>\n<p>but ssh also provides its own way to enable compression on a\nsite-by-site basis (e.g. via .ssh/config).  For example an entry in\n.ssh/config will enable use of compression:</p>\n<pre class=\"literal-block\">\nHost hg.GraphicsMagick.org\n  Compression yes\n</pre>\n</div>\n<div class=\"section\" id=\"ssh-public-keys-for-hg-graphicsmagick-org\">\n<h1><a class=\"toc-backref\" href=\"#id8\">SSH Public Keys For hg.GraphicsMagick.org</a></h1>\n<p>For reference, these are the ssh public keys for the server at hg.GraphicsMagick.org:</p>\n<p>DSS (DSA):</p>\n<pre class=\"literal-block\">\nssh-dss AAAAB3NzaC1kc3MAAACBANZAsDZ9fUWQNwUoRw8HoNl8aLLs97KmyiaA6mSPeM1NeQKrxk0PAFEXMR05CNcZHSyopUx6B8PuTWE4+4rDhFCw7J0JkfFS4uIG3bu3YCRqQrg2k4VsDw60zK9sNum5BcLEWd+qs8X7DrEff5fGmXkc8IdMXPgHTzaJWCT9YJU1AAAAFQCJaFq4/7FqHcHm5abhW5qJyH0RgQAAAIEAgv6s3gfB8p/Elf0ZcIZ5eITCpI9aZFaSLSeKHMmhYps1uMuZ9LtWjZ11cotcuOh0tlwGUixlu/5soZqX6VbnJAuyvfI+7WSUFuJmRjsbXJVCBuSPZ7YgMNuLYlLst7sZLCs5hU61jxnaR2zmkUjDWP4GWROC6AYZXlbJX1qRJ7YAAACBAMsIbVVgz/aP95yCPk1Pw0FjoL5t6C3BpxdA9aiIFBMg14ElaHh+gaXQoZfjAuafZ8pc5woYtQLLkzinCQnmvH/EqqYCe+Fu7jcsYU7oWUXG1O9ZBKI7QZkeCTaYMXIWBplgVD+tkRpH/gxn5iweNMM9e43qPB0b2JYObliqD1E9 root&#64;src\n</pre>\n<p>RSA:</p>\n<pre class=\"literal-block\">\nssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1IuJDYT85qz/w6+vn5hkpzM5Ju5dsMeJD9GnATj3op5dhBWyfbaJpS7yyK2Vhhz26GBUvUtO3LGm0dQvdj83P3DX3aUuzfnC3Bc9dWeARomQPtDy9MfDikD6kqjD9/Lemgvv8I4Na9vUEmYvXUpTrtawJ4S7A7IctPnvKLPGA5+qY5XzMSE0wcOSBdbeV1PAIDOXYH2hKakZwtxXlvfTv6CZphz/jG5nmf+/Zlkr4yopNvPFbtd3vbaaqSuCoGHXKfmpRko2gXf6EGF92wXzbsE1tW3AkSJ2xdhFHRNmQEu2y9F1l9zb8IETBtKMWRJWAsPPpUSkht0DRsTXt/f+Zw== root&#64;src\n</pre>\n<p>ECDSA:</p>\n<pre class=\"literal-block\">\necdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOrGQ6tjmZvm8w+GP7yLFJ1/vkImKkpXv7kPNxA0+Sfx6WCqAjV0pWP5MVCraP8SNbphL8jiS/x3WADXlf+R2KQ= root&#64;src\n</pre>\n<p>ED25519:</p>\n<pre class=\"literal-block\">\nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAtwIcJEBiSUWsB2sydInR76gE84Jp1rxmc8lTGPg5cB root&#64;src\n</pre>\n</div>\n<div class=\"section\" id=\"email-notifications\">\n<h1><a class=\"toc-backref\" href=\"#id9\">Email Notifications</a></h1>\n<p>An email notification is sent to the <a class=\"reference external\" href=\"https://lists.sourceforge.net/lists/listinfo/graphicsmagick-commit\">graphicsmagick-commit</a> mailing\nlist at SourceForge whenever a change is submitted to the development\n(unstable) repository.  Subscribe to this list if you would like to be\nnotified by email of changes when they occur.</p>\n</div>\n<div class=\"section\" id=\"mercurial-topics\">\n<h1><a class=\"toc-backref\" href=\"#id10\">Mercurial Topics</a></h1>\n<ul class=\"simple\">\n<li><a class=\"reference external\" href=\"https://www.mercurial-scm.org/wiki/MergeToolConfiguration\">Merge Tool Configuration</a></li>\n<li><a class=\"reference external\" href=\"https://www.mercurial-scm.org/wiki/TipsAndTricks#Keep_.22My.22_or_.22Their.22_files_when_doing_a_merge\">Keep &quot;My&quot; or &quot;Their&quot; files when doing a merge</a></li>\n</ul>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2012 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/INSTALL-unix.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>UNIX/Cygwin/MinGW/MSYS2 Compilation</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"unix-cygwin-mingw-msys2-compilation\">\n<h1 class=\"title\">UNIX/Cygwin/MinGW/MSYS2 Compilation</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#archive-formats\" id=\"id1\">Archive Formats</a></li>\n<li><a class=\"reference internal\" href=\"#build-configuration\" id=\"id2\">Build Configuration</a><ul>\n<li><a class=\"reference internal\" href=\"#optional-features\" id=\"id3\">Optional Features</a></li>\n<li><a class=\"reference internal\" href=\"#optional-packages-options\" id=\"id4\">Optional Packages/Options</a></li>\n</ul>\n</li>\n<li><a class=\"reference internal\" href=\"#building-under-cygwin\" id=\"id5\">Building under Cygwin</a></li>\n<li><a class=\"reference internal\" href=\"#building-under-mingw-msys2\" id=\"id6\">Building under MinGW &amp; MSYS2</a><ul>\n<li><a class=\"reference internal\" href=\"#cross-compilation-on-unix-linux-host\" id=\"id7\">Cross-compilation On Unix/Linux Host</a></li>\n</ul>\n</li>\n<li><a class=\"reference internal\" href=\"#dealing-with-configuration-failures\" id=\"id8\">Dealing with configuration failures</a></li>\n<li><a class=\"reference internal\" href=\"#makefile-build-targets\" id=\"id9\">Makefile Build Targets</a></li>\n<li><a class=\"reference internal\" href=\"#build-install\" id=\"id10\">Build &amp; Install</a></li>\n<li><a class=\"reference internal\" href=\"#verifying-the-build\" id=\"id11\">Verifying The Build</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"archive-formats\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Archive Formats</a></h1>\n<p>GraphicsMagick is distributed in a number of different archive formats.\nThe source code must be extracted prior to compilation as follows:</p>\n<p>7z</p>\n<blockquote>\n<p>7-Zip archive format. The Z-Zip format may be extracted under Unix\nusing '7za' from the P7ZIP package (<a class=\"reference external\" href=\"http://p7zip.sourceforge.net/\">http://p7zip.sourceforge.net/</a>).\nExtract similar to:</p>\n<pre class=\"literal-block\">\n7za x GraphicsMagick-1.3.7z\n</pre>\n</blockquote>\n<p>.tar.bz2</p>\n<blockquote>\n<p>BZip2 compressed tar archive format. Requires that both the bzip2\n(<a class=\"reference external\" href=\"http://www.sourceware.org/bzip2/\">http://www.sourceware.org/bzip2/</a>) and tar programs to be available. Extract\nsimilar to:</p>\n<pre class=\"literal-block\">\nbzip2 -d GraphicsMagick-1.3.tar.bz | tar -xvf -\n</pre>\n</blockquote>\n<p>.tar.gz</p>\n<blockquote>\n<p>Gzip compressed tar archive format. Requires that both the gzip\n(<a class=\"reference external\" href=\"http://www.gzip.org/\">http://www.gzip.org/</a>) and tar programs to be available. Extract\nsimilar to:</p>\n<pre class=\"literal-block\">\ngzip -d GraphicsMagick-1.3.tar.gz | tar -xvf -\n</pre>\n</blockquote>\n<p>.tar.lz</p>\n<blockquote>\n<p>Lzip compressed tar archive format.  Requires that both the lzip\n(<a class=\"reference external\" href=\"http://lzip.nongnu.org/lzip.html\">http://lzip.nongnu.org/lzip.html</a>) and tar programs to be\navailable. Extract similar to:</p>\n<pre class=\"literal-block\">\nlzip -d -c GraphicsMagick-1.3.tar.gz | tar -xvf -\n</pre>\n</blockquote>\n<p>.tar.xz</p>\n<blockquote>\n<p>LZMA compressed tar archive format. Requires that LZMA utils\n(<a class=\"reference external\" href=\"http://tukaani.org/lzma/\">http://tukaani.org/lzma/</a>) and tar programs to be available. Extract\nsimilar to:</p>\n<pre class=\"literal-block\">\nxz -d GraphicsMagick-1.3.tar.xz | tar -xvf -\n</pre>\n</blockquote>\n<p>zip</p>\n<blockquote>\n<p>PK-ZIP archive format. Requires that the unzip program from Info-Zip\n(<a class=\"reference external\" href=\"http://www.info-zip.org/UnZip.html\">http://www.info-zip.org/UnZip.html</a>) be available. Extract similar to:</p>\n<pre class=\"literal-block\">\nunzip GraphicsMagick-1.3.zip\n</pre>\n</blockquote>\n<p>The GraphicsMagick source code is extracted into a subdirectory\nsimilar to 'GraphicsMagick-1.3'. After the source code extracted,\nchange to the new directory (using the actual directory name) using\na command similar to:</p>\n<pre class=\"literal-block\">\ncd GraphicsMagick-1.3\n</pre>\n</div>\n<div class=\"section\" id=\"build-configuration\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Build Configuration</a></h1>\n<p>Use 'configure' to automatically configure, build, and install\nGraphicsMagick. The configure script may be executed from the\nGraphicsMagick source directory (e.g ./configure) or from a separate\nbuild directory by specifying the full path to configure (e.g.\n/src/GraphicsMagick-1.3/configure). The advantage of using a separate\nbuild directory is that multiple GraphicsMagick builds may share the\nsame GraphicsMagick source directory while allowing each build to use a\nunique set of options.  Using a separate directory also makes it easier\nto keep track of any files you may have edited.</p>\n<p>If you are willing to accept configure's default options (static\nbuild, 8 bits/sample), and build from within the source directory,\ntype:</p>\n<pre class=\"literal-block\">\n./configure\n</pre>\n<p>and watch the configure script output to verify that it finds everything\nthat you think it should. If it does not, then adjust your environment\nso that it does.</p>\n<p>By default, 'make install' will install the package's files\nin '/usr/local/bin', '/usr/local/man', etc. You can specify an\ninstallation prefix other than '/usr/local' by giving 'configure'\nthe option '--prefix=PATH'.  This is valuable in case you don't have\nprivileges to install under the default paths or if you want to install\nin the system directories instead.</p>\n<p>If you are not happy with configure's choice of compiler, compilation\nflags, or libraries, you can give 'configure' initial values for\nvariables by specifying them on the configure command line, e.g.:</p>\n<pre class=\"literal-block\">\n./configure CC=c99 CFLAGS=-O2 LIBS=-lposix\n</pre>\n<p>Options which should be common to packages installed under the same\ndirectory heirarchy may be supplied via a 'config.site' file located\nunder the installation prefix via the path ${prefix}/share/config.site\nwhere ${prefix} is the installation prefix. This file is used for all\npackages installed under that prefix. As an alternative, the CONFIG_SITE\nenvironment variable may be used to specify the path of a site\nconfiguration file to load. This is an example config.site file:</p>\n<pre class=\"literal-block\">\n# Configuration values for all packages installed under this prefix\nCC=gcc\nCXX=c++\nCPPFLAGS='-I/usr/local/include'\nLDFLAGS='-L/usr/local/lib -R/usr/local/lib'\n</pre>\n<p>When the 'config.site' file is being used to supply configuration\noptions, configure will issue a message similar to:</p>\n<pre class=\"literal-block\">\nconfigure: loading site script /usr/local/share/config.site\n</pre>\n<p>The configure variables you should be aware of are:</p>\n<p>CC</p>\n<blockquote>\nName of C compiler (e.g. 'cc -Xa') to use</blockquote>\n<p>CXX</p>\n<blockquote>\nName of C++ compiler to use (e.g. 'CC')</blockquote>\n<p>CFLAGS</p>\n<blockquote>\nCompiler flags (e.g. '-g -O2') to compile C code</blockquote>\n<p>CXXFLAGS</p>\n<blockquote>\nCompiler flags (e.g. '-g -O2') to compile C++ code</blockquote>\n<p>CPPFLAGS</p>\n<blockquote>\nInclude paths (-I/somedir) to look for header files</blockquote>\n<p>LDFLAGS</p>\n<blockquote>\nLibrary paths (-L/somedir) to look for libraries Systems that\nsupport the notion of a library run-path may require an additional\nargument in order to find shared libraries at run time. For\nexample, the Solaris linker requires an argument of the form\n'-R/somedir', some Linux systems will work with '-rpath /somedir',\nwhile some other Linux systems who's gcc does not pass -rpath to\nthe linker require an argument of the form '-Wl,-rpath,/somedir'.</blockquote>\n<p>LIBS</p>\n<blockquote>\nExtra libraries (-lsomelib) required to link</blockquote>\n<p>Any variable (e.g. CPPFLAGS or LDFLAGS) which requires a directory\npath must specify an absolute path rather than a relative path.</p>\n<p>The build now supports a Linux-style &quot;silent&quot; build (default\ndisabled).  To enable this, add the configure option\n--enable-silent-rules or invoke make like 'make V=0'.  If the build\nhas been configured for silent mode and it is necessary to see a\nverbose build, then invoke make like 'make V=1'.</p>\n<p>Configure can usually find the X include and library files\nautomatically, but if it doesn't, you can use the 'configure' options\n'--x-includes=DIR' and '--x-libraries=DIR' to specify their locations.</p>\n<p>The configure script provides a number of GraphicsMagick specific\noptions.  When disabling an option --disable-something is equivalent\nto specifying --enable-something=no and --without-something is\nequivalent to --with-something=no.  The configure options are as\nfollows (execute 'configure --help' to see all options).</p>\n<div class=\"section\" id=\"optional-features\">\n<h2><a class=\"toc-backref\" href=\"#id3\">Optional Features</a></h2>\n<table class=\"docutils option-list\" frame=\"void\" rules=\"none\">\n<col class=\"option\" />\n<col class=\"description\" />\n<tbody valign=\"top\">\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--enable-prof</span></kbd></td>\n<td>enable 'prof' profiling support (default disabled)</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--enable-gprof</span></kbd></td>\n<td>enable 'gprof' profiling support (default disabled)</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--enable-gcov</span></kbd></td>\n<td>enable 'gcov' profiling support (default disabled)</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--disable-installed</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>disable building an installed GraphicsMagick (default enabled)</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-broken-coders</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>enable broken/dangerous file formats support</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--disable-largefile</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>disable support for large (64 bit) file offsets</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--disable-openmp</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>disable use of OpenMP (automatic multi-threaded loops) at all</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-openmp-slow</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>enable OpenMP for algorithms which sometimes run slower</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-symbol-prefix</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>enable prefixing library symbols with &quot;Gm&quot;</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-magick-compat</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>install ImageMagick utility shortcuts (default disabled)</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-maintainer-mode</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>enable additional Makefile rules which update generated files\nincluded in the distribution. Requires GNU make as well as a\nnumber of utilities and tools.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-quantum-library-names</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>shared library name includes quantum depth to allow shared\nlibraries with different quantum depths to co-exist in same\ndirectory (only one can be used for development)</td></tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"optional-packages-options\">\n<h2><a class=\"toc-backref\" href=\"#id4\">Optional Packages/Options</a></h2>\n<table class=\"docutils option-list\" frame=\"void\" rules=\"none\">\n<col class=\"option\" />\n<col class=\"description\" />\n<tbody valign=\"top\">\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-quantum-depth</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>number of bits in a pixel quantum (default 8).  Also see\n'--enable-quantum-library-names.'</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--with-modules</span></kbd></td>\n<td>enable building dynamically loadable modules</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--without-threads</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>disable POSIX threads API support</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-frozenpaths</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>enable frozen delegate paths</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--without-magick-plus-plus</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>disable build/install of Magick++</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--with-perl</span></kbd></td>\n<td>enable build/install of PerlMagick</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-perl=<var>PERL</var></span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>use specified Perl binary to configure PerlMagick</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-perl-options=<var>OPTIONS</var></span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>options to pass on command-line when generating PerlMagick's Makefile from Makefile.PL</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--without-bzlib</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>disable BZLIB support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-dps</span></kbd></td>\n<td>disable Display Postscript support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--with-fpx</span></kbd></td>\n<td>enable FlashPIX support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-jbig</span></kbd></td>\n<td>disable JBIG support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-webp</span></kbd></td>\n<td>disable WEBP support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-jp2</span></kbd></td>\n<td>disable JPEG v2 support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-jpeg</span></kbd></td>\n<td>disable JPEG support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-jp2</span></kbd></td>\n<td>disable JPEG v2 support</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--without-lcms2</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>disable lcms (v2.X) support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-lzma</span></kbd></td>\n<td>disable LZMA support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-png</span></kbd></td>\n<td>disable PNG support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-tiff</span></kbd></td>\n<td>disable TIFF support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-trio</span></kbd></td>\n<td>disable TRIO library support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-ttf</span></kbd></td>\n<td>disable TrueType support</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-tcmalloc</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>enable Google perftools tcmalloc (minimal) memory allocation\nlibrary support</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-mtmalloc</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>enable Solaris mtmalloc memory allocation library support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--with-umem</span></kbd></td>\n<td>enable Solaris libumem memory allocation library support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-wmf</span></kbd></td>\n<td>disable WMF support</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-fontpath</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>prepend to default font search path</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-gs-font-dir</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>directory containing Ghostscript fonts</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-windows-font-dir</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>directory containing MS-Windows fonts</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-xml</span></kbd></td>\n<td>disable XML support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-zlib</span></kbd></td>\n<td>disable ZLIB support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-zstd</span></kbd></td>\n<td>disable Zstd support</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--with-x</span></kbd></td>\n<td>use the X Window System</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-share-path=<var>DIR</var></span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>Alternate path to share directory (default share/GraphicsMagick)</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-libstdc=<var>DIR</var></span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>use libstdc++ in DIR (for GNU C++)</td></tr>\n</tbody>\n</table>\n<p>GraphicsMagick options represent either features to be enabled, disabled,\nor packages to be included in the build.  When a feature is enabled (via\n--enable-something), it enables code already present in GraphicsMagick.\nWhen a package is enabled (via --with-something), the configure script\nwill search for it, and if is is properly installed and ready to use\n(headers and built libraries are found by compiler) it will be included\nin the build.  The configure script is delivered with all features\ndisabled and all packages enabled. In general, the only reason to\ndisable a package is if a package exists but it is unsuitable for\nthe build (perhaps an old version or not compiled with the right\ncompilation flags).</p>\n<p>Several configure options require special note:</p>\n<table class=\"docutils option-list\" frame=\"void\" rules=\"none\">\n<col class=\"option\" />\n<col class=\"description\" />\n<tbody valign=\"top\">\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-shared</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td><p class=\"first\">The shared libraries are built and support for loading coder and\nprocess modules is enabled. Shared libraries are preferred because\nthey allow programs to share common code, making the individual\nprograms much smaller. In addition shared libraries are required in\norder for PerlMagick to be dynamically loaded by an installed PERL\n(otherwise an additional PERL (PerlMagick) must be installed. This\noption is not the default because all libraries used by\nGraphicsMagick must also be dynamic libraries if GraphicsMagick\nitself is to be dynamically loaded (such as for PerlMagick).</p>\n<p>GraphicsMagick built with delegates (see MAGICK PLUG-INS below)\ncan pose additional challenges. If GraphicsMagick is built using\nstatic libraries (the default without --enable-shared) then\ndelegate libraries may be built as either static libraries or\nshared libraries. However, if GraphicsMagick is built using shared\nlibraries, then all delegate libraries must also be built as\nshared libraries.  Static libraries usually have the extension .a,\nwhile shared libraries typically have extensions like .so, .sa,\nor .dll. Code in shared libraries normally must compiled using\na special compiler option to produce Position Independent Code\n(PIC). The only time this is not necessary is if the platform\ncompiles code as PIC by default.</p>\n<p>PIC compilation flags differ from vendor to vendor (gcc's is\n-fPIC). However, you must compile all shared library source with\nthe same flag (for gcc use -fPIC rather than -fpic). While static\nlibraries are normally created using an archive tool like 'ar',\nshared libraries are built using special linker or compiler options\n(e.g. -shared for gcc).</p>\n<p>Building shared libraries often requires subtantial hand-editing\nof Makefiles and is only recommended for those who know what they\nare doing.</p>\n<p class=\"last\">If --enable-shared is not specified, a new PERL interpreter\n(PerlMagick) is built which is statically linked against the\nPerlMagick extension. This new interpreter is installed into the\nsame directory as the GraphicsMagick utilities. If --enable-shared\nis specified, the PerlMagick extension is built as a dynamically\nloadable object which is loaded into your current PERL interpreter\nat run-time. Use of dynamically-loaded extensions is preferable over\nstatically linked extensions so --enable-shared should be specified\nif possible (note that all libraries used with GraphicsMagick must\nbe shared libraries!).</p>\n</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--disable-static</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>static archive libraries (with extension .a) are not built. If you\nare building shared libraries, there is little value to building\nstatic libraries. Reasons to build static libraries include: 1) they\ncan be easier to debug; 2) the clients do not have external\ndependencies (i.e. libMagick.so); 3) building PIC versions of the\ndelegate libraries may take additional expertise and effort; 4) you\nare unable to build shared libraries.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--disable-installed</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>By default the GraphicsMagick build is configured to formally install\ninto a directory tree. This is the most secure and reliable way to\ninstall GraphicsMagick. Specifying --disable-installed configures\nGraphicsMagick so that it doesn't use hard-coded paths and locates\nsupport files by computing an offset path from the executable (or\nfrom the location specified by the MAGICK_HOME environment variable.\nThe uninstalled configuration is ideal for binary distributions which\nare expected to extract and run in any location.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-broken-coders</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>The implementation of file format support for some formats is\nincomplete or imperfectly implemented such that file corruption or a\nsecurity exploit might occur.  These formats are not included in the\nbuild by default but may be enabled using\n<tt class=\"docutils literal\"><span class=\"pre\">--enable-broken-coders</span></tt>.  The existing implementation may still\nhave value in controlled circumstances so it remains but needs to be\nenabled.  One of the formats currently controlled by this is Adobe\nPhotoshop bitmap format (PSD).</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--with-modules</span></kbd></td>\n<td><p class=\"first\">Image coders and process modules are built as loadable modules which\nare installed under the directory\n[prefix]/lib/GraphicsMagick-X.X.X/modules-QN (where 'N' equals 8, 16,\nor 32 depending on the quantum depth) in the subdirectories 'coders'\nand 'filters' respectively. The modules build option is only\navailable in conjunction with --enable-shared. If --enable-shared is\nnot also specified, then support for building modules is disabled.\nNote that if --enable-shared is specified, the module loader is\nactive (allowing extending an installed GraphicsMagick by simply\ncopying a module into place) but GraphicsMagick itself is not built\nusing modules.</p>\n<p>Use of the modules build is recommended where it is possible to use\nit.  Using modules defers the overhead due to library dependencies\n(searching the filesystem for libraries, shared library relocations,\ninitialized data, and constructors) until the point the libraries\nare required to be used to support the file format requested.\nTraditionally it has been thought that a 'static' program will be\nmore performant than one built with shared libraries, and perhaps\nthis may be true, but building a 'static' GraphicsMagick does not\naccount for the many shared libraries it uses on a typical\nUnix/Linux system.  These shared libraries may impose unexpected\noverhead.  For example, it was recently noted that libxml2 is now\noften linked with the ICU (international character sets) libraries\nwhich are huge C++ libraries consuming almost 30MB of disk space and\nthat simply linking with these libraries causes GraphicsMagick to\nstart up much more slowly. By using the modules build, libxml2 (and\ntherefore the huge ICU C++ libraries) are only loaded in the few\ncases (e.g. SVG format) where it is needed.</p>\n<p class=\"last\">When applications depend on the GraphicsMagick libraries, using the\nmodules build lessens the linkage overhead due to using\nGraphicsMagick.</p>\n</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-symbol-prefix</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>The GraphicsMagick libraries may contain symbols which conflict with\nother libraries. Specifify this option to prefix &quot;Gm&quot; to all library\nsymbols, and use the C pre-processor to allow dependent code to still\ncompile as before.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-magick-compat</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>Normally GraphicsMagick installs only the 'gm' utility from which all\ncommands may be accessed. Existing packages may be designed to invoke\nImageMagick utilities (e.g. &quot;convert&quot;). Specify this option to\ninstall ImageMagick utility compatibility links to allow\nGraphicsMagick to substitute directly for ImageMagick. Take care when\nselecting this option since if there is an existing ImageMagick\ninstallation installed in the same directory, its utilities will be\nreplaced when GraphicsMagick is installed.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-quantum-depth</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td><p class=\"first\">This option allows the user to specify the number of bits to use per\npixel quantum (the size of the red, green, blue, and alpha pixel\ncomponents. When an image file with less depth is read, smaller\nvalues are scaled up to this size for processing, and are scaled\ndown from this size when a file with lower depth is written.  For\nexample, &quot;--with-quantum-depth=8&quot; builds GraphicsMagick using 8-bit\nquantums. Most computer display adaptors use 8-bit\nquantums. Currently supported arguments are 8, 16, or 32.  The\ndefault is 8. This option is the most important option in\ndetermining the overall run-time performance of GraphicsMagick.</p>\n<p>The number of bits in a quantum determines how many values it may\ncontain. Each quantum level supports 256 times as many values as\nthe previous level. The following table shows the range available\nfor various quantum sizes.</p>\n<blockquote>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"24%\" />\n<col width=\"42%\" />\n<col width=\"34%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">QuantumDepth</th>\n<th class=\"head\">Valid Range (Decimal)</th>\n<th class=\"head\">Valid Range (Hex)</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>8</td>\n<td>0-255</td>\n<td>00-FF</td>\n</tr>\n<tr><td>16</td>\n<td>0-65535</td>\n<td>0000-FFFF</td>\n</tr>\n<tr><td>32</td>\n<td>0-4294967295</td>\n<td>00000000-FFFFFFFF</td>\n</tr>\n</tbody>\n</table>\n</blockquote>\n<p>Larger pixel quantums cause GraphicsMagick to run more slowly and to\nrequire more memory. For example, using sixteen-bit pixel quantums\ncauses GraphicsMagick to run 15% to 50% slower (and take twice as\nmuch memory) than when it is built to support eight-bit pixel\nquantums.  Regardless, the GraphicsMagick authors prefer to use\nsixteen-bit pixel quantums since they support all common image\nformats and assure that there is no loss of color precision.</p>\n<p>The amount of virtual memory consumed by an image can be computed\nby the equation (QuantumDepth*Rows*Columns*5)/8. This is an\nimportant consideration when resources are limited, particularly\nsince processing an image may require several images to be in\nmemory at one time. The following table shows memory consumption\nvalues for a 1024x768 image:</p>\n<blockquote>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"46%\" />\n<col width=\"54%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">QuantumDepth</th>\n<th class=\"head\">Virtual Memory</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>8</td>\n<td>3MB</td>\n</tr>\n<tr><td>16</td>\n<td>8MB</td>\n</tr>\n<tr><td>32</td>\n<td>15MB</td>\n</tr>\n</tbody>\n</table>\n</blockquote>\n<p>GraphicsMagick performs all image processing computations using\nfloating point or non-lossy integer arithmetic, so results are very\naccurate.  Increasing the quantum storage size decreases the amount\nof quantization noise (usually not visible at 8 bits) and helps\nprevent countouring and posterization in the image.</p>\n<p class=\"last\">Consider also using the --enable-quantum-library-names configure\noption so that installed shared libraries include the quantum depth\nas part of their names so that shared libraries using different\nquantum depth options may co-exist in the same directory.</p>\n</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--without-magick-plus-plus</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>Disable building Magick++, the C++ application programming interface\nto GraphicsMagick. A suitable C++ compiler is required in order to\nbuild Magick++. Specify the CXX configure variable to select the C++\ncompiler to use (default &quot;g++&quot;), and CXXFLAGS to select the desired\ncompiler opimization and debug flags (default &quot;-g -O2&quot;). Antique C++\ncompilers will normally be rejected by configure tests so specifying\nthis option should only be necessary if Magick++ fails to compile.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-frozenpaths</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>Normally external program names are substituted into the\ndelegates.mgk file without full paths. Specify this option to enable\nsaving full paths to programs using locations determined by\nconfigure. This is useful for environments where programs are stored\nunder multiple paths, and users may use different PATH settings than\nthe person who builds GraphicsMagick.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--without-threads</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>By default, the GraphicsMagick library is compiled to be fully\nthread safe by using thread APIs to implement required locking.\nThis is intended to allow the GraphicsMagick library to be used by\nmulti-threaded programs using native POSIX threads. If the locking\nor dependence on thread APIs is undesireable, then specify\n--without-threads.  Testing shows that the overhead from thread\nsafety is virtually unmeasurable so usually there is no reason to\ndisable multi-thread support.  While previous versions disabled\nOpenMP support when this option was supplied, that is no longer the\ncase since then OpenMP locking APIs are used instead.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--disable-largefile</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>By default, GraphicsMagick is compiled with support for large (&gt; 2GB\non a 32-bit CPU) files if the operating system supports large files.\nApplications which use the GraphicsMagick library might then also\nneed to be compiled to support for large files (operating system\ndependent).  Normally support for large files is a good thing.  Only\ndisable this option if there is a need to do so.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--disable-openmp</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td><p class=\"first\">By default, GraphicsMagick is compiled with support for OpenMP\n(<a class=\"reference external\" href=\"http://www.openmp.org/\">http://www.openmp.org/</a>) if the compilation environment supports it.\nOpenMP automatically parallizes loops across concurrent threads\nbased on instructions in pragmas. OpenMP was introduced in GCC\n4.2. OpenMP is a well-established standard and was implemented in\nsome other compilers in the late '90s, long before its appearance in\nGCC. OpenMP adds additional build and linkage requirements.\nGraphicsMagick supports OpenMP version 2.0 and later, primarily\nusing features defined by version 2.5, but will be optionally using\nfeatures from version 3.1 in the future since it is commonly\navailable.</p>\n<p class=\"last\">By default, GraphicsMagick enables as many threads as there are CPU\ncores (or CPU threads).  According to the OpenMP standard, the\nOMP_NUM_THREADS environment variable specifies how many threads\nshould be used and GraphicsMagick also honors this request. In order\nto obtain the best single-user performance, set OMP_NUM_THREADS\nequal to the number of available CPU cores.  On a server with many\ncores and many programs running at once, there may be benefit to\nsetting OMP_NUM_THREADS to a much smaller value than the number of\ncores, and sometimes values as low as two (or even one, to disable\nthreading) will offer the best overall system performance.  Tuning a\nlarge system with OpenMP programs running in parallel (competing for\nresources) is a complex topic and some research and experimentation\nmay be required in order to find the best parameters.</p>\n</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--enable-openmp-slow</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>On some systems, memory-bound algorithms run slower (rather than\nfaster) as threads are added via OpenMP.  This may be due to CPU\ncache and memory architecture implementation, or OS thread API\nimplementation.  Since it is not known how a system will behave\nwithout testing and pre-built binaries need to work well on all\nsystems, these algorithms are now disabled for OpenMP by default.\nIf you are using a well-threaded OS on a CPU with a good\nhigh-performance memory architecture, you might consider enabling\nthis option based on experimentation.</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--with-perl</span></kbd></td>\n<td><p class=\"first\">Use this option to include PerlMagick in the GraphicsMagick build\nand test suite. While PerlMagick is always configured by default\n(PerlMagick/Makefile.PL is generated by the configure script),\nPerlMagick is no longer installed by GraphicsMagick's ''make\ninstall''.  The procedure to configure, build, install, and check\nPerlMagick is described in PerlMagick/README.txt.  When using a\nshared library build of GraphicsMagick, it is necessary to formally\ninstall GraphicsMagick prior to building PerlMagick in order to\nachieve a working PerlMagick since otherwise the wrong\nGraphicsMagick libraries may be used.</p>\n<p class=\"last\">If the argument ''--with-perl=/path/to/perl'' is supplied, then\n/path/to/perl will be taken as the PERL interpreter to use. This is\nimportant in case the 'perl' executable in your PATH is not PERL5,\nor is not the PERL you want to use.  Experience suggests that static\nPerlMagick builds may not be fully successful (at least for\nexecuting the test suite) for Perl versions newer than 5.8.8.</p>\n</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-perl-options</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>The PerlMagick module is normally installed using the Perl\ninterpreter's installation PREFIX, rather than GraphicsMagick's. If\nGraphicsMagick's installation prefix is not the same as PERL's\nPREFIX, then you may find that PerlMagick's 'make install' step tries\nto install into a directory tree that you don't have write\npermissions to. This is common when PERL is delivered with the\noperating system or on Internet Service Provider (ISP) web servers.\nIf you want PerlMagick to install elsewhere, then provide a PREFIX\noption to PERL's configuration step via\n&quot;--with-perl-options=PREFIX=/some/place&quot;. Other options accepted by\nMakeMaker are 'LIB', 'LIBPERL_A', 'LINKTYPE', and 'OPTIMIZE'. See the\nExtUtils::MakeMaker(3) manual page for more information on\nconfiguring PERL extensions.</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--without-x</span></kbd></td>\n<td>By default, GraphicsMagick will use X11 libraries if they are\navailable. When --without-x is specified, use of X11 is disabled. The\ndisplay, animate, and import sub-commands are not included. The\nremaining sub-commands have reduced functionality such as no access\nto X11 fonts (consider using Postscript or TrueType fonts instead).</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-gs-font-dir</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td><p class=\"first\">Specify the directory containing the Ghostscript Postscript Type 1\nfont files (e.g. &quot;n019003l.pfb&quot;) also known as the &quot;URW Fonts&quot; so\nthat they can be rendered using the FreeType library.  These fonts\nemulate the standard 35 fonts commonly available on printers\nsupporting Adobe Postscript so they are very useful to have. If the\nfont files are installed using the default Ghostscript installation\npaths (${prefix}/share/ghostscript/fonts), they should be discovered\nautomatically by configure and specifying this option is not\nnecessary. Specify this option if the Ghostscript fonts fail to be\nlocated automatically, or the location needs to be overridden.</p>\n<p>The &quot;Ghostscript&quot; fonts (also known as &quot;URW Standard postscript\nfonts (cyrillicized)&quot;) are available from</p>\n<blockquote>\n<a class=\"reference external\" href=\"https://sourceforge.net/projects/gs-fonts/\">https://sourceforge.net/projects/gs-fonts/</a></blockquote>\n<p>These fonts may are often available as a package installed by a\npackage manager and installing from a package manager is easier than\ninstalling from source:</p>\n<table border=\"1\" class=\"last docutils\">\n<caption>URW Font Packages</caption>\n<colgroup>\n<col width=\"22%\" />\n<col width=\"32%\" />\n<col width=\"46%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Distribution</th>\n<th class=\"head\">Package Name</th>\n<th class=\"head\">Fonts Installation Path</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>Cygwin</td>\n<td>urw-base35-fonts</td>\n<td>/usr/share/ghostscript/fonts</td>\n</tr>\n<tr><td>Debian Linux</td>\n<td>fonts-urw-base35</td>\n<td>/usr/share/fonts/type1/gsfonts</td>\n</tr>\n<tr><td>Gentoo Linux</td>\n<td>media-fonts/urw-fonts</td>\n<td>/usr/share/fonts/ghostscript</td>\n</tr>\n<tr><td>Illumos/pkgsrc</td>\n<td>urw-fonts-2.0nb1</td>\n<td>/opt/local/share/fonts/urw</td>\n</tr>\n<tr><td>NetBSD/pkgsrc</td>\n<td>urw-fonts-2.0nb1</td>\n<td>/share/fonts/urw</td>\n</tr>\n<tr><td>OpenIndiana</td>\n<td>gnu-gs-fonts-std</td>\n<td>/usr/share/ghostscript/fonts</td>\n</tr>\n<tr><td>OS X/Homebrew</td>\n<td>font-urw-base35</td>\n<td>[ TBD ]</td>\n</tr>\n<tr><td>Red Hat Linux</td>\n<td>urw-fonts-2.0</td>\n<td>/usr/share/fonts/default/Type1</td>\n</tr>\n<tr><td>Ubuntu Linux</td>\n<td>fonts-urw-base35</td>\n<td>/usr/share/fonts/type1/gsfonts</td>\n</tr>\n</tbody>\n</table>\n</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-windows-font-dir</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>Specify the directory containing MS-Windows-compatible fonts. This is\nnot necessary when GraphicsMagick is running under MS-Windows.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-tcmalloc</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>The GNU libc malloc and some other mallocs exhibits poor concurrency\nin multi-threaded OpenMP programs and this can severely impact\nOpenMP speedup.  The 'tcmalloc' library provided as part of Google\n<a class=\"reference external\" href=\"https://github.com/gperftools/gperftools\">gperftools</a> has been\nobserved to perform far better than the default GNU libc memory\nallocator for multi-threaded use, and also for single-threaded use.\nOverall benchmark performance improvements of up to a factor of two\nare observed for some algorithms (even with just 12 cores) and it is\nexpected that the improvements will become much more apparent with\nlarger numbers of cores (e.g. 64 cores).  Using tcmalloc may improve\nperformance dramatically for some work-loads on modern multi-core\nsystems.</td></tr>\n<tr><td class=\"option-group\">\n<kbd><span class=\"option\">--with-umem</span></kbd></td>\n<td>The default Solaris memory allocator exhibits poor concurrency in\nmulti-threaded programs and this can impact OpenMP speedup under\nSolaris (and systems derived from it such as Illumos).  Use this\nconvenience option to enable use of the umem memory allocation\nlibrary, which is observed to be more performant in multi-threaded\nprograms.  There is a port of umem available for Linux so this\noption is not specific to Solaris.</td></tr>\n<tr><td class=\"option-group\" colspan=\"2\">\n<kbd><span class=\"option\">--with-mtmalloc</span></kbd></td>\n</tr>\n<tr><td>&nbsp;</td><td>The default Solaris memory allocator exhibits poor concurrency in\nmulti-threaded programs and this can impact OpenMP speedup under\nSolaris (and systems derived from it such as Illumos).  Use this\nconvenience option to enable use of the mtmalloc memory allocation\nlibrary, which is more performant in multi-threaded programs than\nthe default libc memory allocator, and more performant in\nmulti-threaded programs than umem, but is less memory efficient.</td></tr>\n</tbody>\n</table>\n</div>\n</div>\n<div class=\"section\" id=\"building-under-cygwin\">\n<h1><a class=\"toc-backref\" href=\"#id5\">Building under Cygwin</a></h1>\n<p>GraphicsMagick may be built under the Windows '95-XP Cygwin\nUnix-emulation environment available for free from</p>\n<blockquote>\n<a class=\"reference external\" href=\"http://www.cygwin.com/\">http://www.cygwin.com/</a></blockquote>\n<p>It is suggested that the X11R6 package be installed since this enables\nGraphicsMagick's X11 support (animate, display, and import\nsub-commands will work) and it includes the Freetype v2 DLL required\nto support TrueType and Postscript Type 1 fonts. Make sure that\n/usr/X11R6/bin is in your PATH prior to running configure.</p>\n<p>If you are using Cygwin version 1.3.9 or later, you may specify the\nconfigure option '--enable-shared' to build Cygwin DLLs. Specifying\n'--enable-shared' is required if you want to build PerlMagick under\nCygwin because Cygwin does not provide the libperl.a static library\nrequired to create a static PerlMagick.  Note that older Cygwin\ncompilers may not generate code which supports reliably catching C++\nexceptions thrown by DLL code.  The Magick++ library requires that it\nbe possible to catch C++ exceptions thrown from DLLs.  The test suite\n<tt class=\"docutils literal\">make check</tt> includes several tests to verify that C++ exceptions\nare working properly.</p>\n</div>\n<div class=\"section\" id=\"building-under-mingw-msys2\">\n<h1><a class=\"toc-backref\" href=\"#id6\">Building under MinGW &amp; MSYS2</a></h1>\n<p>GraphicsMagick may easily be built using the free <a class=\"reference external\" href=\"https://www.msys2.org/\">MSYS2</a> distribution which provides GCC compilers,\nlibraries, and headers, targeting native Windows along with a\nUnix-like command shell and a package manager ('Pacman') to install\npre-compiled components.  Using the pre-compiled packages, it is\nalmost as easy to compile GraphicsMagick under MSYS2 as it is under\nLinux!</p>\n<p>When using MSYS2, requesting to install these packages using 'pacman\n-S' (in addition to compilation tools for C/C++) should result in\ngetting up to speed very quicky with a featureful build:</p>\n<p>mingw-w64-x86_64-bzip2, mingw-w64-x86_64-freetype,\nmingw-w64-x86_64-ghostscript, mingw-w64-x86_64-jbigkit,\nmingw-w64-x86_64-lcms2, mingw-w64-x86_64-libjpeg-turbo,\nmingw-w64-x86_64-libpng, mingw-w64-x86_64-libtool,\nmingw-w64-x86_64-libwebp mingw-w64-x86_64-libwmf,\nmingw-w64-x86_64-libxml2, mingw-w64-x86_64-zlib</p>\n<p>GraphicsMagick may also be built using the free MinGW\n(&quot;Minimalistic GNU for Windows&quot;) package, available from</p>\n<blockquote>\n<a class=\"reference external\" href=\"http://www.mingw.org/\">http://www.mingw.org/</a></blockquote>\n<p>or from</p>\n<blockquote>\n<a class=\"reference external\" href=\"http://mingw-w64.sourceforge.net/\">http://mingw-w64.sourceforge.net/</a></blockquote>\n<p>which consist of GNU-based (GCC) compilation toolsets plus headers and\nlibraries required to build programs which are entirely based on\nstandard Microsoft Windows DLLs so that they may be used for\nproprietary applications. MSYS provides a Unix-style console shell\nwindow with sufficient functionality to run the GraphicsMagick\nconfigure script and execute 'make', 'make check', and 'make install'.\nGraphicsMagick may be executed from the MSYS shell, but since it is a\nnormal Windows application, it will work just as well from the Windows\ncommand line.</p>\n<p>Unlike the Cygwin build which creates programs based on a\nUnix-emulation DLL, and which uses Unix-style paths to access Windows\nfiles, the MinGW build creates native Windows console applications\nsimilar to the Visual C++ build. Run-time performance is similar to the\nMicrosoft compilers.</p>\n<p>The base MinGW (or MinGW-w64) package and the MSYS package should be\ninstalled. Other MinGW packages are entirely optional. Once MSYS is\ninstalled a MSYS icon (blue capital 'M') is added to the\ndesktop. Double clicking on this icon starts an instance of the MSYS\nshell.</p>\n<p>Start the MSYS console and follow the Unix configure and build\ninstructions. The configure and build for MinGW is the same as for\nUnix. Any additional delegate libraries (e.g. libpng) will need to be\nbuilt under MinGW in order to be used. These libraries should be built\nand installed prior to configuring GraphicsMagick. While some delegate\nlibraries are easy to configure and build under MinGW, others may be\nquite a challenge.</p>\n<p>Lucky for us, the most common delegate libraries are available\npre-built, as part of the GnuWin32 project, from</p>\n<blockquote>\n<a class=\"reference external\" href=\"http://gnuwin32.sourceforge.net/packages.html\">http://gnuwin32.sourceforge.net/packages.html</a></blockquote>\n<p>The relevant packages are bzip2, freetype, jbigkit, libintl, jpeg,\nlibpng, libtiff, libwmf and zlib. However, note that for freetype\nto be detected by configure, you must move the <tt class=\"docutils literal\">freetype</tt> directory\nout of <tt class=\"docutils literal\">GnuWin32\\include\\freetype2</tt> and into <tt class=\"docutils literal\">GnuWin32\\include</tt>.</p>\n<p>Note that older MinGW compilers may not generate code which supports\nreliably catching C++ exceptions thrown by DLL code.  The Magick++\nlibrary requires that it be possible to catch C++ exceptions thrown\nfrom DLLs.  The test suite (<tt class=\"docutils literal\">make check</tt>) includes several tests to\nverify that C++ exceptions are working properly.  If the MinGW you are\nusing fails the C++ exception tests, then the solution is to either\nfind a MinGW with working C++ exceptions, configure a static build\nwith --disable-shared, or disable building Magick++ with\n--without-magick-plus-plus.</p>\n<p>Note that the default installation prefix is MSYS's notion of\n<tt class=\"docutils literal\">/usr/local</tt> which installs the package into a MSYS directory. To\ninstall outside of the MSYS directory tree, you may specify an\ninstallation prefix like <tt class=\"docutils literal\">/c/GraphicsMagick</tt> which causes the package\nto be installed under the Windows directory <tt class=\"docutils literal\"><span class=\"pre\">C:\\GraphicsMagick</span></tt>. The\ninstallation directory structure will look very much like the Unix\ninstallation layout (e.g. <tt class=\"docutils literal\"><span class=\"pre\">C:\\GraphicsMagick\\bin</span></tt>,\n<tt class=\"docutils literal\"><span class=\"pre\">C:\\GraphicsMagick\\lib</span></tt>, <tt class=\"docutils literal\"><span class=\"pre\">C:\\GraphicsMagick\\share</span></tt>, etc.). Paths\nwhich may be embedded in libraries and configuration files are\ntransformed into Windows paths so they don't depend on MSYS.</p>\n<div class=\"section\" id=\"cross-compilation-on-unix-linux-host\">\n<h2><a class=\"toc-backref\" href=\"#id7\">Cross-compilation On Unix/Linux Host</a></h2>\n<p>Given a modern and working MinGW32 or mingw-w64 installation, it is\neasy to cross-compile GraphicsMagick from a Unix-type host to produce\nMicrosoft Windows executables.</p>\n<p>This incantation produces a static WIN32 <cite>gm.exe</cite> executable on an\nUbuntu Linux host with the i686-w64 cross-compiler installed:</p>\n<pre class=\"literal-block\">\n./configure '--host=i686-w64-mingw32' '--disable-shared'\n</pre>\n<p>and this incantation produces a static WIN64 <cite>gm.exe</cite> executable on an\nUbuntu Linux host with the x86_64-w64 cross-compiler installed:</p>\n<pre class=\"literal-block\">\n./configure '--host=x86_64-w64-mingw32' '--disable-shared'\n</pre>\n<p>For a full-fledged GraphicsMagick program, normally one will want to\npre-install or cross-compile the optional libraries that\nGraphicsMagick may depend on and install them where the cross-compiler\nwill find them, or add extra <cite>CPPFLAGS</cite> and <cite>LDFLAGS</cite> options so that\nthe compiler searches for header files and libraries in the correct\nplace.</p>\n<p>Configuring for building with shared libraries (libGraphicsMagick,\nlibGraphicsMagickWand, and libGraphicsMagick++ DLLs) and modules\n(coders as DLLs) is also supported by the cross-builds.  A cross-built\nlibtool libltdl needs to be built in advance in order to use the\n<cite>--with-modules</cite> modules option.</p>\n<p>After configuring the software for cross-compilation, the software is\nbuilt using <cite>make</cite> as usual and everything should be as with native\ncompilation except that <cite>make check</cite> is likely not available (testing\nmight be possible on build system via WINE, not currently\ntested/supported by GraphicsMagick authors).</p>\n<p>Use of the <cite>DESTDIR</cite> approach as described in the <a class=\"reference internal\" href=\"#build-install\">Build &amp; Install</a>\nsection is recommended in order to install the build products into a\nformal directory tree before preparing to copy onto the Windows target\nsystem (e.g. by packaging via an installer).</p>\n</div>\n</div>\n<div class=\"section\" id=\"dealing-with-configuration-failures\">\n<h1><a class=\"toc-backref\" href=\"#id8\">Dealing with configuration failures</a></h1>\n<p>While configure is designed to ease installation of GraphicsMagick, it\noften discovers problems that would otherwise be encountered later\nwhen compiling GraphicsMagick. The configure script tests for headers\nand libraries by executing the compiler (CC) with the specified\ncompilation flags (CFLAGS), pre-processor flags (CPPFLAGS), and linker\nflags (LDFLAGS). Any errors are logged to the file 'config.log'. If\nconfigure fails to discover a header or library please review this\nlog file to determine why, however, please be aware that <em>errors\nin the config.log are normal</em> because configure works by trying\nsomething and seeing if it fails. An error in config.log is only a\nproblem if the test should have passed on your system. After taking\ncorrective action, be sure to remove the 'config.cache' file before\nrunning configure so that configure will re-inspect the environment\nrather than using cached values.</p>\n<p>Common causes of configure failures are:</p>\n<ol class=\"arabic simple\">\n<li>A delegate header is not in the header include path (CPPFLAGS -I\noption).</li>\n<li>A delegate library is not in the linker search/run path (LDFLAGS\n-L/-R option).</li>\n<li>A delegate library is missing a function (old version?).\u001bOB</li>\n<li>The compilation environment is faulty.</li>\n</ol>\n<p>If all reasonable corrective actions have been tried and the problem\nappears to be due to a flaw in the configure script, please send a\nbug report to the configure script maintainer (currently\n<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;graphicsmagick&#46;org\">bfriesen<span>&#64;</span>graphicsmagick<span>&#46;</span>org</a>). All bug reports should contain the\noperating system type (as reported by 'uname -a') and the\ncompiler/compiler-version. A copy of the configure script output\nand/or the config.log file may be valuable in order to find the\nproblem. If you send a config.log, please also send a script of the\nconfigure output and a description of what you expected to see (and\nwhy) so the failure you are observing can be identified and resolved.</p>\n</div>\n<div class=\"section\" id=\"makefile-build-targets\">\n<h1><a class=\"toc-backref\" href=\"#id9\">Makefile Build Targets</a></h1>\n<p>Once GraphicsMagick is configured, these standard build targets are\navailable from the generated Makefiles:</p>\n<blockquote>\n<p>'make'</p>\n<blockquote>\nBuild the package</blockquote>\n<p>'make install'</p>\n<blockquote>\nInstall the package</blockquote>\n<p>'make check'</p>\n<blockquote>\nRun tests using the uninstalled software. On some systems, 'make\ninstall' must be done before the test suite will work but usually\nthe software can be tested prior to installation.</blockquote>\n<p>'make clean'</p>\n<blockquote>\nRemove everything in the build directory created by 'make'</blockquote>\n<p>'make distclean'</p>\n<blockquote>\nRemove everything in the build directory created by 'configure'\nand 'make'. This is useful if you want to start over from scratch.</blockquote>\n<p>'make uninstall'</p>\n<blockquote>\nRemove all files from the system which are (or would be) installed\nby 'make install' using the current configuration. Note that this\ntarget does not work for PerlMagick since Perl no longer supports\nan 'uninstall' target.</blockquote>\n</blockquote>\n</div>\n<div class=\"section\" id=\"build-install\">\n<h1><a class=\"toc-backref\" href=\"#id10\">Build &amp; Install</a></h1>\n<p>Now that GraphicsMagick is configured, type</p>\n<pre class=\"literal-block\">\nmake\n</pre>\n<p>to build the package and</p>\n<pre class=\"literal-block\">\nmake install\n</pre>\n<p>to install it.</p>\n<p>To install under a specified directory using the install directory\ntree layout (e.g. as part of the process for packaging the built\nsoftware), specify DESTDIR like</p>\n<pre class=\"literal-block\">\nmake DESTDIR=/my/dest/dir install\n</pre>\n</div>\n<div class=\"section\" id=\"verifying-the-build\">\n<h1><a class=\"toc-backref\" href=\"#id11\">Verifying The Build</a></h1>\n<p>To confirm your installation of the GraphicsMagick distribution was\nsuccessful, ensure that the installation directory is in your executable\nsearch path and type</p>\n<pre class=\"literal-block\">\ngm display\n</pre>\n<p>The GraphicsMagick logo should be displayed on your X11 display.</p>\n<p>Verify that the expected image formats are supported by executing</p>\n<pre class=\"literal-block\">\ngm convert -list formats\n</pre>\n<p>Verify that the expected fonts are available by executing</p>\n<pre class=\"literal-block\">\ngm convert -list fonts\n</pre>\n<p>Verify that delegates (external programs) are configured as expected\nby executing</p>\n<pre class=\"literal-block\">\ngm convert -list delegates\n</pre>\n<p>Verify that color definitions may be loaded by executing</p>\n<pre class=\"literal-block\">\ngm convert -list colors\n</pre>\n<p>If GraphicsMagick is built to use loadable coder modules, then verify\nthat the modules load via</p>\n<pre class=\"literal-block\">\ngm convert -list modules\n</pre>\n<p>Verify that GraphicsMagick is properly identifying the resources of\nyour machine via</p>\n<pre class=\"literal-block\">\ngm convert -list resources\n</pre>\n<p>For a thorough test, you should run the GraphicsMagick test suite by\ntyping</p>\n<pre class=\"literal-block\">\nmake check\n</pre>\n<p>Note that due to differences between the developer's environment and\nyour own, it is possible that some tests may be indicated as failed\neven though the results are ok.  Such failures should be rare, and if\nthey do occur, they should be reported as a bug.  Differences between\nthe developer's environment environment and your own may include the\ncompiler, the CPU type, and the library versions used. The\nGraphicsMagick developers use the current release of all dependent\nlibraries.</p>\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/INSTALL-windows.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Windows Installation</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-windows-installation\">\n<h1 class=\"title\">GraphicsMagick Windows Installation</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#installing-using-installer-package\" id=\"id1\">Installing Using Installer Package</a><ul>\n<li><a class=\"reference internal\" href=\"#prerequisites\" id=\"id2\">Prerequisites</a></li>\n<li><a class=\"reference internal\" href=\"#retrieve-install-package\" id=\"id3\">Retrieve Install Package</a></li>\n<li><a class=\"reference internal\" href=\"#start-installation-wizard\" id=\"id4\">Start Installation Wizard</a></li>\n<li><a class=\"reference internal\" href=\"#read-installation-information\" id=\"id5\">Read Installation Information</a></li>\n<li><a class=\"reference internal\" href=\"#select-destination-directory\" id=\"id6\">Select Destination Directory</a></li>\n<li><a class=\"reference internal\" href=\"#select-start-menu-folder\" id=\"id7\">Select Start Menu Folder</a></li>\n<li><a class=\"reference internal\" href=\"#select-additional-tasks\" id=\"id8\">Select Additional Tasks</a></li>\n<li><a class=\"reference internal\" href=\"#ready-to-install\" id=\"id9\">Ready to Install</a></li>\n<li><a class=\"reference internal\" href=\"#installation-progress\" id=\"id10\">Installation Progress</a></li>\n<li><a class=\"reference internal\" href=\"#final-information\" id=\"id11\">Final Information</a></li>\n<li><a class=\"reference internal\" href=\"#finishing-up\" id=\"id12\">Finishing Up</a></li>\n<li><a class=\"reference internal\" href=\"#testing-the-installation\" id=\"id13\">Testing The Installation</a></li>\n<li><a class=\"reference internal\" href=\"#uninstall\" id=\"id14\">Uninstall</a></li>\n<li><a class=\"reference internal\" href=\"#use-from-another-package-or-program\" id=\"id15\">Use From Another Package or Program</a></li>\n</ul>\n</li>\n<li><a class=\"reference internal\" href=\"#installing-from-source-code\" id=\"id16\">Installing From Source Code</a><ul>\n<li><a class=\"reference internal\" href=\"#applicability\" id=\"id17\">Applicability</a></li>\n<li><a class=\"reference internal\" href=\"#important-notes\" id=\"id18\">Important Notes</a></li>\n<li><a class=\"reference internal\" href=\"#windows-xp-vista-7-visual-c-6-0-through-19-0-compilation\" id=\"id19\">Windows XP, Vista, 7 Visual C++ 6.0 through 19.0 Compilation</a></li>\n<li><a class=\"reference internal\" href=\"#environment-variables\" id=\"id20\">Environment Variables</a></li>\n<li><a class=\"reference internal\" href=\"#windows-distribution-build-procedure\" id=\"id21\">Windows Distribution Build Procedure</a></li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"section\" id=\"installing-using-installer-package\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Installing Using Installer Package</a></h1>\n<blockquote>\nThis section provides information specific to GraphicsMagick installed\nvia a &quot;setup.exe&quot; style installation wizard under Microsoft Windows. It\napplies only to the pre-built &quot;binaries&quot; package, and not to versions\ncompiled from source code. If you would like to install GraphicsMagick\nfrom source code, then please refer to the Installing From Source Code\nsection.</blockquote>\n<div class=\"section\" id=\"prerequisites\">\n<h2><a class=\"toc-backref\" href=\"#id2\">Prerequisites</a></h2>\n<blockquote>\n<p>While multiple versions of GraphicsMagick may be installed at one\ntime, if your intention is to replace a prior installation of\nGraphicsMagick with a newer version, then it is wise to uninstall\nthe existing GraphicsMagick (see uninstall procedure) prior to\ninstalling the newer version.</p>\n<p>While it is not a requirement, it is strongly recommended that the\n<a class=\"reference external\" href=\"http://sourceforge.net/projects/ghostscript/\">Ghostscript</a>\npackage (GraphicsMagick is tested with version 9.27) be\ninstalled. GraphicsMagick uses Ghostscript to render Postscript and\nPDF files, as well as formats where a translator to Postscript is\navailable. GraphicsMagick will use the <a class=\"reference external\" href=\"http://sourceforge.net/projects/gs-fonts/\">Ghostscript Fonts</a> (also known as &quot;URW\nFonts&quot;) to support the standard set of Adobe Postscript fonts like\n&quot;Helvetica&quot; and &quot;Times Roman&quot; if these fonts are not available as\nTrueType fonts.  The Ghostscript fonts need to manually installed\nwith administrator privileges in the Ghostscript installation\ndirectory (e.g. as <tt class=\"docutils literal\"><span class=\"pre\">C:\\Program</span> Files\\gs\\fonts</tt> or <tt class=\"docutils literal\">C:Program\nFiles\\gs\\gs9.27\\fonts</tt>).</p>\n<p>The algorithm used to find the fonts consults the Windows registry\nto learn Ghostscript installation paths, and then looks for a\n&quot;fonts/n019003l.pfb&quot; file in each path until it finds a match.</p>\n<p>Make sure to install a Ghostscript which is compatible with the\nGraphicsMagick you are installing.  For example, if you are\ninstalling a 64-bit GraphicsMagick, you should install a 64-bit\nGhostscript.  The installation order of the two packages is not\nimportant.  Both 32 and 64-bit versions of GraphicsMagick and\nGhostscript may be installed at the same time.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"retrieve-install-package\">\n<h2><a class=\"toc-backref\" href=\"#id3\">Retrieve Install Package</a></h2>\n<blockquote>\n<p>Retrieve the GraphicsMagick Windows binary install package from a one\nof the ftp sites listed at the <a class=\"reference external\" href=\"download.html\">GraphicsMagick Download Sites</a> page. The available install packages are as follows</p>\n<p>Windows Dynamic-Multithread (DLL-based) install package with utilities,\nImageMagickObject COM object, and web pages:</p>\n<blockquote>\n<pre class=\"literal-block\">\nGraphicsMagick-1.3-Q8-win32-dll.exe\nGraphicsMagick-1.3-Q16-win32-dll.exe\nGraphicsMagick-1.3-Q8-win64-dll.exe\nGraphicsMagick-1.3-Q16-win64-dll.exe\n</pre>\n</blockquote>\n<p>Note that the QuantumDepth=8 version (Q8) which provides industry\nstandard 24/32 bit pixels consumes half the memory and about 30% less\nCPU than the QuantumDepth=16 version (Q16) which provides 48/64 bit\npixels for high-resolution color. A Q8 version is fine for processing\ntypical photos intended for viewing on a computer screen. If you are\ndealing with film, scientific, or medical images, use ICC color\nprofiles, or deal with images that have limited contrast, then the Q16\nversion is recommended.</p>\n<p>The <cite>win32</cite> packages are for 32-bit or 64-bit Windows, whereas the\n<cite>win64</cite> packages are only for 64-bit Windows.  The 64-bit version\nallows processing larger images in memory (rather than disk files),\nprovided that the system has more than 2GB of RAM installed.  Memory\naccess is 1000 times faster than disk access.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"start-installation-wizard\">\n<h2><a class=\"toc-backref\" href=\"#id4\">Start Installation Wizard</a></h2>\n<blockquote>\nExecute the downloaded file from your browser or by double-clicking on\nthe filename from within Windows Explorer. The GraphicsMagick Setup\nWizard will appear. Click on &quot;<em>Next&gt;</em>&quot; to continue.</blockquote>\n</div>\n<div class=\"section\" id=\"read-installation-information\">\n<h2><a class=\"toc-backref\" href=\"#id5\">Read Installation Information</a></h2>\n<blockquote>\nAn informational screen is presented which provides a summary of things\nyou should know before you proceed. Please take care to read this\ninformation. Once you have finished, Click on &quot;<em>Next&gt;</em>&quot; to continue.</blockquote>\n</div>\n<div class=\"section\" id=\"select-destination-directory\">\n<h2><a class=\"toc-backref\" href=\"#id6\">Select Destination Directory</a></h2>\n<blockquote>\nSpecify what drive and directory to install GraphicsMagick into.\nApproximately 15MB of free disk space is required to install all of\nGraphicsMagick (you may choose to install a subset to save space). A\nmessage at the bottom of the screen will tell you exactly how much\nspace is required to install the complete package. The default\ninstallation directory is similar to <tt class=\"docutils literal\"><span class=\"pre\">C:\\Program</span>\n<span class=\"pre\">Files\\GraphicsMagick-1.3-Q8</span></tt>. Once you have entered the desired\ninstallation directory, then select &quot;<em>Next&gt;</em>&quot; to continue.</blockquote>\n</div>\n<div class=\"section\" id=\"select-start-menu-folder\">\n<h2><a class=\"toc-backref\" href=\"#id7\">Select Start Menu Folder</a></h2>\n<blockquote>\nSelect the folder where you would like the program's shortcuts to\nappear. The default should normally be satisfactory. Click on &quot;<em>Next&gt;</em>&quot;\nto continue.</blockquote>\n</div>\n<div class=\"section\" id=\"select-additional-tasks\">\n<h2><a class=\"toc-backref\" href=\"#id8\">Select Additional Tasks</a></h2>\n<blockquote>\n<p>A screen is displayed which presents some (or all) of the following\noptions:</p>\n<ul class=\"simple\">\n<li>Create a desktop icon</li>\n<li>Update executable search path</li>\n<li>Associate supported file extensions with GraphicsMagick</li>\n</ul>\n<p>&quot;Creating a desktop icon&quot; and &quot;Update the executable search path&quot;\nare selected by default. The remaining options default to\nun-selected.  Select the options you prefer.</p>\n<p>Think twice before selecting &quot;<em>Associate supported file extensions\nwith GraphicsMagick</em>&quot; since this will set up approximately fifty\nfile associations, including common formats like JPEG, GIF, PNG,\nTIFF, and PDF. These file associations will be to the 'gmdisplay'\nprogram which is suitable for displaying images, but currently\noffers little more than that.  Associations for GraphicsMagick's\nnative formats (such as <a class=\"reference external\" href=\"miff.html\">MIFF</a>) will always be made.</p>\n<p>Once you have made your selections, click on &quot;<em>Next&gt;</em>&quot; to continue.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"ready-to-install\">\n<h2><a class=\"toc-backref\" href=\"#id9\">Ready to Install</a></h2>\n<blockquote>\nA screen is displayed which displays the selected options. If you are\nnot satisfied with a selected option, then click on &quot;<em>&lt;Back</em>&quot; to go back\nto a previous screen so that the option may be adjusted. If you are\nsatisfied with the options and are ready to install, then select\n&quot;<em>Install</em>&quot;. To abort the installation entirely, select &quot;<em>Cancel</em>&quot;.</blockquote>\n</div>\n<div class=\"section\" id=\"installation-progress\">\n<h2><a class=\"toc-backref\" href=\"#id10\">Installation Progress</a></h2>\n<blockquote>\nWhile the install program is performing the installation, it will\ndisplay what it is doing in an installation progress window.</blockquote>\n</div>\n<div class=\"section\" id=\"final-information\">\n<h2><a class=\"toc-backref\" href=\"#id11\">Final Information</a></h2>\n<blockquote>\nA summary of post-install steps is provided. These steps include some\ncommands you can execute to make sure that GraphicsMagick is working,\nas well as some notes about what has been installed on your system, and\nwhere to find additional information. Once you have read this\ninformation, click on &quot;<em>Next&gt;</em>&quot; to continue.</blockquote>\n</div>\n<div class=\"section\" id=\"finishing-up\">\n<h2><a class=\"toc-backref\" href=\"#id12\">Finishing Up</a></h2>\n<blockquote>\nBy default &quot;<em>View GraphicsMagick.html</em>&quot; is check-marked. This causes the\nGraphicsMagick web pages to be displayed in your web browser when\n&quot;<em>Finish</em>&quot; is selected. If you do not want to view the web pages, then\nde-select &quot;<em>View GraphicsMagick.html</em>&quot;. Select &quot;<em>Finish</em>&quot; to exit the\ninstallation program.</blockquote>\n</div>\n<div class=\"section\" id=\"testing-the-installation\">\n<h2><a class=\"toc-backref\" href=\"#id13\">Testing The Installation</a></h2>\n<blockquote>\n<p>Select &quot;<em>Command Prompt</em>&quot; from the Windows Start menu. Within the window\ntype</p>\n<blockquote>\n<pre class=\"literal-block\">\ngm convert logo: logo.miff\ngm convert logo.miff win:\n</pre>\n</blockquote>\n<p>and the GraphicsMagick logo should be displayed in a window.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"uninstall\">\n<h2><a class=\"toc-backref\" href=\"#id14\">Uninstall</a></h2>\n<blockquote>\n<p>The GraphicsMagick package incorporates its own uninstall\nfunctionality. Always remove an installed GraphicsMagick via its\nuninstall function since manually removing it (such as by removing its\ninstallation directory) will leave behind the registry entries and path\nsettings established at install time.</p>\n<p>GraphicsMagick should be removed via the &quot;<em>Add or Remove Programs</em>&quot;\narea of the Windows Control Panel. Select the GraphicsMagick package\nfrom the list, and click on &quot;<em>Change/Remove</em>&quot; to uninstall it.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"use-from-another-package-or-program\">\n<h2><a class=\"toc-backref\" href=\"#id15\">Use From Another Package or Program</a></h2>\n<blockquote>\n<p>The GraphicsMagick gm utility may be executed as a sub-process by\nother programs. If gm utility is not in the systems executable\nsearch path (it should be since the GraphicsMagick install extends\nthe path by default), then the utility should be executed via the\ncomplete path to the executable.</p>\n<p>The <a class=\"reference external\" href=\"ImageMagickObject.html\">ImageMagickObject</a> COM object may be\nused to execute the gm sub-functions (e.g. &quot;convert&quot;) without\nspawning a new process or causing Windows to pop up a window. The\nCOM object supports multi-threaded concurrent use.  Note that the\nCOM object (and other components depending on proprietary libraries)\nis no longer included in the installation packages we create.  If\nyou need this, then you will need to build GraphicsMagick from\nsource code.</p>\n<p>When GraphicsMagick is installed, entries are added to the Windows\nRegistry so that other programs may obtain information regarding the\nmost recently installed GraphicsMagick. These entries are available\nunder the registry path <tt class=\"docutils literal\">HKEY_LOCAL_MACHINE\\SOFTWARE\\GraphicsMagick\\Current</tt>.</p>\n<p>These registry keys are currently available:</p>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"25%\" />\n<col width=\"12%\" />\n<col width=\"64%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Key Name</th>\n<th class=\"head\">Key Type</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>BinPath</td>\n<td>REG_SZ</td>\n<td>Directory where GraphicsMagick executables\nare installed</td>\n</tr>\n<tr><td>ConfigurePath</td>\n<td>REG_SZ</td>\n<td>Directory where configuration files are\ninstalled</td>\n</tr>\n<tr><td>LibPath</td>\n<td>REG_SZ</td>\n<td>Directory where GraphicsMagick core DLLs\nare installed</td>\n</tr>\n<tr><td>CoderModulesPath</td>\n<td>REG_SZ</td>\n<td>Directory where GraphicsMagick loadable\ncoder modules are installed</td>\n</tr>\n<tr><td>FilterModulesPath</td>\n<td>REG_SZ</td>\n<td>Directory where GraphicsMagick loadable\nfilter modules are installed</td>\n</tr>\n<tr><td>SharePath</td>\n<td>REG_SZ</td>\n<td>Directory where configuration files are\ninstalled</td>\n</tr>\n</tbody>\n</table>\n</blockquote>\n</div>\n</div>\n<div class=\"section\" id=\"installing-from-source-code\">\n<h1><a class=\"toc-backref\" href=\"#id16\">Installing From Source Code</a></h1>\n<div class=\"section\" id=\"applicability\">\n<h2><a class=\"toc-backref\" href=\"#id17\">Applicability</a></h2>\n<blockquote>\nThis section provides instructions for building GraphicsMagick\nMicrosoft Windows using the Visual C++ (Visual Studio, etc.)\nIDE. For building using the free Cygwin or MinGW compilers (e.g. as\npart of <a class=\"reference external\" href=\"https://www.msys2.org/\">MSYS2</a>), follow the instructions\nin INSTALL-unix.txt.</blockquote>\n</div>\n<div class=\"section\" id=\"important-notes\">\n<h2><a class=\"toc-backref\" href=\"#id18\">Important Notes</a></h2>\n<blockquote>\nOn some platforms Visual C++ may fail with an internal compiler\nerror.  If this happens to you, then make sure that your compiler is\nupdated with the latest fixes from the Microsoft web site and the\nproblem will hopefully go away.  If the problem does not go away,\nthen adjust the settings for the module which failed and disable\noptimization, and the problem is likely to go away (but with less\nperformance).</blockquote>\n</div>\n<div class=\"section\" id=\"windows-xp-vista-7-visual-c-6-0-through-19-0-compilation\">\n<h2><a class=\"toc-backref\" href=\"#id19\">Windows XP, Vista, 7 Visual C++ 6.0 through 19.0 Compilation</a></h2>\n<blockquote>\n<p>The Visual C++ distribution targeted at Windows 2000 through Windows\n10 does not provide any stock workspace (DSW) or project files (DSP)\nexcept for those included with third party libraries. Instead, there\nis a &quot;configure&quot; program that must run to create build\nenvironments to satisfy various requirements.</p>\n<p>The configure program resides in <tt class=\"docutils literal\">VisualMagick\\configure</tt> in the\nGraphicsMagick source tree.  A pre-compiled configure.exe is\nprovided, as well as Visual Studio project files to recompile it\nfrom source code if needed.</p>\n<p>Once started, the configure program provides this configuration\ndialog after proceeding past the initial notifications screen:</p>\n<img alt=\"Configure program screen shot\" class=\"align-center\" src=\"configure-target-setup.png\" style=\"width: 498.0px; height: 473.0px;\" />\n<p>In addition to (or as a replacement to) the above dialog, the\nconfigure.exe program supports these command-line options:</p>\n<dl class=\"docutils\">\n<dt><cite>/Q8 /Q16 /Q32</cite></dt>\n<dd>Set quantum depth</dd>\n<dt><cite>/x64</cite></dt>\n<dd>Add x64 configuration</dd>\n<dt><cite>/mtd /sts /mts /mtsd</cite></dt>\n<dd>Set project type</dd>\n<dt><cite>/noWizard</cite></dt>\n<dd>Do not show the wizard</dd>\n<dt><cite>/openMP</cite></dt>\n<dd>Enable openMP</dd>\n</dl>\n<p>The Visual C++ system provides three different types of &quot;runtimes&quot;\nthat must match across all application, library, and DLL code that is\nbuilt. The &quot;configure&quot; program creates a set of build files that are\nconsistent for a specific runtime selection.</p>\n<p>The three options for runtime support are:</p>\n<ol class=\"arabic simple\">\n<li>Dynamic Multi-threaded DLL runtimes (VisualDynamicMT), <cite>/mtd</cite> option</li>\n<li>Static Single-threaded runtimes (<cite>VisualStaticST</cite>), <cite>/sts</cite> option</li>\n<li>Static Multi-threaded runtimes (VisualStaticMT), <cite>/mts</cite> option</li>\n<li>Static Multi-threaded DLL runtimes (VisualStaticMTDLL), <cite>/mtsd</cite> option</li>\n</ol>\n<p>In addition to these runtimes, the VisualMagick build environment allows\nyou to select whether to include the X11 libraries in the build or not.\nX11 DLLs and headers are provided with the VisualMagick build\nenvironment. Most Windows users do not use X11 so they will prefer to\nbuild without X11 support. When X11 is not supported, gm subcommands\n'animate', 'display', and 'import' will not work.</p>\n<p>This leads to five different possible build options, which should\ncover almost any particular situation. The default binary\ndistribution is built using #1 from above with the X11 libraries\nexcluded. This results build using all DLL's for everything and\nmulti-threaded support (the only option for DLL's).</p>\n<p>To do a build for your requirements, simply go to the configure sub-\ndirectory under VisualMagick and open the configure.dsw workspace\n(for Visual C++ 6.0) or configure.sln (for Visual C++ 7.X through\n9.X). Set the build configuration to &quot;Release&quot; under the</p>\n<blockquote>\n&quot;Build..., Set Active Configuration...&quot;  menu.</blockquote>\n<p>Build and execute the configure program and follow the on-screen\ninstructions. You should not change any of the defaults unless you have a\nspecific reason to do so.</p>\n<p>The configure program provides a button entitled</p>\n<blockquote>\nEdit &quot;magick_config.h&quot;</blockquote>\n<p>Clicking this button brings up magick_config.h in Windows notepad\nfor optionally changing any preprocessor defines in GraphicsMagick's\nmagick_config.h file. This file is copied to\n<tt class=\"docutils literal\">magick\\magick_config.h</tt>. You may safely open\n<tt class=\"docutils literal\">magick\\magick_config.h</tt>, modify it, and recompile without\nre-running the configure program. In fact, using Visual Studio to\nedit the copied file may be preferable since it preserves the\noriginal magick_config.h file.</p>\n<p>Key user tunables in magick_config.h include:</p>\n<blockquote>\n<p>QuantumDepth (default 8)</p>\n<blockquote>\nSpecify size of PixelPacket color Quantums (8, 16, or 32) A value of\n8 uses half the memory than 16 and may run 30% faster, but provides\n256 times less color resolution than a value of 16.</blockquote>\n<p>UseInstalledMagick (default undefined)</p>\n<blockquote>\nDefine to build a GraphicsMagick which uses registry settings or\nembedded paths to locate installed components (coder modules and\nconfiguration files). The default is to look for all files in the\nsame directory as the executable.</blockquote>\n<p>ProvideDllMain (default undefined)</p>\n<blockquote>\nDefine to include a DllMain() function ensures that the GraphicsMagick\nDLL is properly initialized without participation from dependent\napplications. This avoids the requirement to invoke IntializeMagick()\nfrom dependent applications but only works for DLL builds.</blockquote>\n<p>EnableBrokenCoders (default undefined)</p>\n<blockquote>\nDefine to enable broken/dangerous file format support.  Only\nenable this if you have complete control over the input files\nand not for arbitrary files such as uploaded from untrusted\nsources via the Internet.  Currently this must be enabled to\nenable Adobe Photoshop Format (PSD).</blockquote>\n</blockquote>\n<p>After creating your build environment you can proceed to open the DSW (or\nSLN) file that was generated in the VisualMagick directory and build\neverything from there.</p>\n<p>In the final DSW file you will find a project call &quot;All&quot;. In order to\nbuild everything in the distribution, select this project and make it\nthe &quot;active&quot; project. Set the build configuration to the desired one\n(Debug, or Release) and do a &quot;clean&quot; followed by a &quot;build&quot;. You should\ndo the build in a specific way:</p>\n<blockquote>\n<ol class=\"arabic simple\">\n<li>Make the &quot;All&quot; project the active project (Bold)\nRight click on the All project and select &quot;Set As Active Project&quot;</li>\n<li>Select &quot;Build..., Clean&quot;</li>\n<li>Select &quot;Build..., Build&quot;</li>\n<li>Go get some coffee unless you have a very fast machine!.</li>\n</ol>\n</blockquote>\n<p>The &quot;Clean&quot; step is needed in order to make sure that all of the target\nsupport libraries are updated with any patches needed to get them to\ncompile properly under Visual C++.</p>\n<p>All of the required files that are needed to run any of the command\nline tools will be found in the &quot;bin&quot; subdirectory of the VisualMagick\nsubdirectory. This includes EXE, and DLL files. You should be able\nto test the build directly from this directory without having to move\nanything to any of the global SYSTEM or SYSTEM32 areas in the operating\nsystem installation.</p>\n<p>Note #1:</p>\n<p>The Visual C++ distribution of GraphicsMagick comes with the Magick++\nC++ wrapper by default. This add-on layer has a large number of demo\nand test files that can be found in <tt class=\"docutils literal\"><span class=\"pre\">GraphicsMagick\\Magick++\\demo</span></tt>, and\n<tt class=\"docutils literal\"><span class=\"pre\">GraphicsMagick\\Magick++\\tests</span></tt>. There are also a variety of tests that\nuse the straight C API as well in <tt class=\"docutils literal\">GraphicsMagick\\tests</tt>.</p>\n<p>All of these programs are NOT configured to be built in the default\nworkspace created by the configure program. You can cause all of these\ndemos and test programs to be built by checking the box in configure\nthat says:</p>\n<blockquote>\n&quot;Include all demo and test programs&quot;</blockquote>\n<p>In addition, there is another related checkbox (checked by default)\nthat causes all generated project files to be created standalone so\nthat they can be copied to other areas of you system.</p>\n<p>This is the checkbox:</p>\n<blockquote>\n&quot;Generate all utility projects with full paths rather then relative\npaths&quot;</blockquote>\n<p>WOW - that a mouthfull - eh?</p>\n<p>Visual C++ uses a concept of &quot;dependencies&quot; that tell it what other\ncomponents need to be build when a particular project is being build. This\nmechanism is also used to ensure that components link properly. In my normal\ndevelopment environment, I want to be able to make changes and debug the\nsystem as a whole, so I like and NEED to use dependencies. However, most\nend users don't want to work this way.</p>\n<p>Instead they really just want to build the package and then get down\nto business working on their application. The solution is to make all\nthe utility projects (UTIL_xxxx_yy_exe.dsp) use full absolute paths\nto all the things they need. This way the projects stand on their own\nand can actually be copied and used as templates to get a particular\ncustom application compiling with little effort.</p>\n<p>With this feature enabled, you should be able to nab a copy of...</p>\n<blockquote>\n<p><tt class=\"docutils literal\">VisualMagick\\utilities\\UTIL_gm_xxx_exe.dsp</tt>  (for C)</p>\n<blockquote>\n-or-</blockquote>\n<p><tt class=\"docutils literal\"><span class=\"pre\">VisualMagick\\Magick++\\demo\\UTIL_demo_xxx_exe.dsp</span></tt> (for C++)</p>\n</blockquote>\n<p>... and pop it into notepad, modify it (carefully) to your needs and\nbe on your way to happy compiling and linking.</p>\n<p>You can feel free to pick any of the standard utilities, tests, or\ndemo programs as the basis for a new program by copying the project\nand the source and hacking away.</p>\n<p>The choice of what to use as a starting point is very easy...</p>\n<p>For straight C API command line applications use something from</p>\n<blockquote>\n<p><tt class=\"docutils literal\">GraphicsMagick\\tests</tt> or <tt class=\"docutils literal\">GraphicsMagick\\utilities</tt> (source code)</p>\n<p><tt class=\"docutils literal\">GraphicsMagick\\VisualMagick\\tests</tt> or <tt class=\"docutils literal\">GraphicsMagick\\Visualmagick\\utilities</tt>\n(project - DSP)</p>\n</blockquote>\n<p>For C++ and Magick++ command line applications use something from</p>\n<blockquote>\n<p><tt class=\"docutils literal\"><span class=\"pre\">GraphicsMagick\\Magick++\\tests</span></tt> or <tt class=\"docutils literal\"><span class=\"pre\">GraphicsMagick\\Magick++\\demo</span></tt> (source code)</p>\n<p><tt class=\"docutils literal\"><span class=\"pre\">GraphicsMagick\\VisualMagick\\Magick++\\tests</span></tt> or\n<tt class=\"docutils literal\"><span class=\"pre\">GraphicsMagick\\VisualMagick\\Magick++\\demo</span></tt> (project - DSP)</p>\n</blockquote>\n<p>For C++ and Magick++ and MFC windows applications use</p>\n<blockquote>\n<p><tt class=\"docutils literal\">GraphicsMagick\\win2k\\IMDisplay</tt> (source code)</p>\n<p><tt class=\"docutils literal\">GraphicsMagick\\VisualMagick\\win32\\NtMagick</tt> (project - DSP)</p>\n</blockquote>\n<p>Note #2:</p>\n<p>The GraphicsMagick distribution is very modular. The default\nconfiguration is there to get you rolling, but you need to make some\nserious choices when you wish to change things around.</p>\n<p>The default options are all targeted at having all the components in one\nplace (e.g. the &quot;bin&quot; directory of the VisualMagick build tree). These\ncomponents may be copied to another folder (such as to another computer).</p>\n<p>The folder containing the executables and DLLs should contain the\nfollowing files:</p>\n<blockquote>\n<ol class=\"arabic simple\">\n<li>colors.mgk</li>\n<li>delegates.mgk</li>\n<li>log.mgk</li>\n<li>magic.mgk</li>\n<li>modules.mgk</li>\n<li>type.mgk</li>\n<li>type-ghostscript.mgk (if Ghostscript is used)</li>\n</ol>\n</blockquote>\n<p>The &quot;bin&quot; folder should contains all EXE's and DLL's as well as the\nvery important &quot;modules.mgk&quot; file.</p>\n<p>With this default setup, you can use any of the command line tools\nand run scripts as normal. You can actually get by quite nicely this\nway by doing something like <tt class=\"docutils literal\">pushd <span class=\"pre\">e:\\xxx\\yyy\\bin</span></tt> in any scripts you\nwrite to execute &quot;out of&quot; this directory.</p>\n<p>By default the core of GraphicsMagick on Win32 always looks in the place\nwere the exe program is run from in order to find all of the files as\nwell as the DLL's it needs.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"environment-variables\">\n<h2><a class=\"toc-backref\" href=\"#id20\">Environment Variables</a></h2>\n<blockquote>\n<p>You can use the &quot;System&quot; control panel to allow you to add and delete\nwhat is in any of the environment variables. You can even have user\nspecific environment variables if you wish.</p>\n<p>PATH</p>\n<blockquote>\n<p>This sets the default list of places were Windows looks for EXE's and\nDLL's. Windows CMD shell seems to look in the &quot;current&quot; directory first\n- no matter what, which may make it unnecessary to update the PATH. If\nyou wish to run any of utilities from another location then you must\nadd the path to your &quot;bin&quot; directory in. For instance, you might add:</p>\n<blockquote>\n<tt class=\"docutils literal\"><span class=\"pre\">D:\\Devel\\GraphicsMagick\\VisualMagick\\bin</span></tt></blockquote>\n<p>to do this for the default build environment like I do.</p>\n</blockquote>\n<p>MAGICK_HOME</p>\n<blockquote>\n<p>If all you do is modify the PATH variable, the first problem you\nwill run into is that GraphicsMagick may not be able to find any of\nits &quot;modules. Modules are all the IM_MOD*.DLL files you see in the\ndistribution. There is one of these for each and every file format\nthat GraphicsMagick supports. This environment variable tells the system\nwere to look for these DLL's. The compiled in &quot;default&quot; is &quot;execution\npath&quot; - which says - look in the same place that the application is\nrunning &quot;in&quot;. If you are running from somewhere other then &quot;bin&quot; -\nthis will no longer work and you must use this variable. If you elect\nto leave the modules in the same place as the EXE's (a good idea)\nthen you can simply set this to the same place\nas you did the PATH variable. In my case:</p>\n<blockquote>\n<tt class=\"docutils literal\"><span class=\"pre\">D:\\\\GraphicsMagick\\coders</span></tt></blockquote>\n<p>This is also the place were GraphicsMagick expects to find the\n&quot;colors.mgk&quot;, &quot;delegates.mgk&quot;, &quot;magic.mgk&quot;, &quot;modules.mgk&quot;, and\n&quot;type.mgk&quot; files.</p>\n<p>One cool thing about the modules build of GraphicsMagick is that you can\nnow leave out file formats and lighten you load. If all you ever need\nis GIF and JPEG, then simply drop all the other DLL's into the local\ntrash can and get on with your life.</p>\n<p>WARNING: Always keep the &quot;xc&quot; format, since GM uses it for internal\npurposes.</p>\n</blockquote>\n<p>ALSO. You can elect to changes these things the good old &quot;hard-coded&quot;\nway. Two #defines are applicable.</p>\n<p>defines.h has</p>\n<blockquote>\n<tt class=\"docutils literal\">#define MagickConfigurePath&nbsp; <span class=\"pre\">&quot;c:\\\\GraphicsMagick\\\\&quot;</span></tt></blockquote>\n<p>To view any image in a Microsoft window, type</p>\n<blockquote>\n<tt class=\"docutils literal\">gm convert image.ext win:</tt></blockquote>\n<p>Make sure Ghostscript is installed, otherwise, you will be unable to\nconvert or view a Postscript document, and Postscript standard fonts will\nnot be available.</p>\n<p>You may use any standard web browser (e.g. Internet Explorer) to browse\nthe GraphicsMagick documentation.</p>\n<p>The Win2K executables will work under Windows '98 and later.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"windows-distribution-build-procedure\">\n<h2><a class=\"toc-backref\" href=\"#id21\">Windows Distribution Build Procedure</a></h2>\n<blockquote>\n<p>The following are the instructions for how to build a Q:8 (or Q:16)\nDLL-based distribution installer package using Visual Studio 2008\nProfessional.  This is the same procedure used to produce the\nrelease packages.  The PerlMagick steps are skipped as of\nGraphicsMagick 1.3.26):</p>\n<ol class=\"arabic simple\">\n<li>Install prerequisite software:</li>\n</ol>\n<blockquote>\n<ol class=\"loweralpha simple\">\n<li>Install Microsoft Visual Studio.</li>\n<li>Download and install Inno Setup 6\n&lt;&quot;<a class=\"reference external\" href=\"http://www.jrsoftware.org/isinfo.php\">http://www.jrsoftware.org/isinfo.php</a>&quot;&gt;.</li>\n<li>Download and install ActiveState ActivePerl (optional)\n&lt;&quot;<a class=\"reference external\" href=\"http://www.activestate.com/activeperl/downloads/\">http://www.activestate.com/activeperl/downloads/</a>&quot;&gt;.</li>\n</ol>\n</blockquote>\n<ol class=\"arabic\" start=\"2\">\n<li><p class=\"first\">Disable automatic indexing and virus scanning for the\nGraphicsMagick source tree.  In particular, &quot;Windows Defender&quot; in\nWindows 10 (and similar software in earlier Windows releases) has\nbeen observed to cause Visual Studio builds to fail since the\nvirus scanner opens built libraries and executables to inspect\nwhem while Visual Studio is still using them.  Indexing and\nscanning also cause significant slowdowns since there are many\nmegabytes of files to index.</p>\n</li>\n<li><p class=\"first\">Build <cite>GMVisualMagickconfigureconfigure.exe</cite> (if\nmissing/outdated)</p>\n<ol class=\"loweralpha simple\">\n<li>Open workspace <cite>GMVisualMagickconfigureconfigure.dsp</cite> by\ndouble-clicking from Windows Explorer.</li>\n<li>Upgrade Visual Studio project (as required)</li>\n<li>Select <cite>Rebuild All</cite> to build configure.exe</li>\n<li>Close the project.</li>\n</ol>\n</li>\n<li><p class=\"first\">Configure Initial GraphicsMagick Visual Studio Workspace</p>\n<ol class=\"loweralpha simple\">\n<li>Use Windows Explorer to navigate to <cite>GMVisualMagickconfigure</cite>.</li>\n<li>Double-click on <cite>configure.exe</cite> to run configure program.</li>\n<li>Select desired build options: DLL build, Quantum Depth, 64-bit, OpenMP)</li>\n<li>Check <cite>Build demo and test programs</cite>.</li>\n<li>Finish remaining configure wizard screens to complete.</li>\n<li><cite>File</cite> -&gt; <cite>Close Workspace</cite>.</li>\n</ol>\n</li>\n<li><p class=\"first\">Open Workspace, set build configuration, build GraphicsMagick software.</p>\n<ol class=\"loweralpha simple\">\n<li>Open workspace <cite>GMVisualMagickconfigureconfigure.sln</cite> by\ndouble-clicking from Windows Explorer.</li>\n<li>Build -&gt; &quot;Set Active Configuration&quot; -&gt; &quot;All - Win32 Release&quot; -&gt; OK</li>\n<li>Optionally enable 64-bit (WIN64) compilation.  &quot;<cite>Build</cite> /\n<cite>Configuration Manager...</cite> / <cite>Active Solution Platform</cite> /\n<cite>New</cite> / <cite>x64</cite>&quot;.</li>\n<li>Open <cite>CORE_magickmagickmagick_config.h</cite> and edit any\nconfiguration settings you would like to change.  For example,\nyou might change QuantumDepth to 16 for a&quot;Q:16&quot; build.</li>\n<li>If using Visual Studio Professional Edition, and OpenMP\nsupport is desired, then select <cite>CORE_magick</cite> in the Solution\nExplorer pane and use the right mouse button menu to select\n<cite>Properties</cite>.  In <cite>Configuration Properties</cite> / <cite>C/C++</cite> /\n<cite>Language</cite> set OpenMP support to 'yes'.</li>\n<li>Select &quot;Rebuild All&quot;</li>\n<li>Click on '!' icon to run configure program</li>\n<li>Select DLL build</li>\n<li>Check <cite>Build demo and test programs</cite>.</li>\n<li>Click on Edit <cite>magick_config.h</cite> and verify desired settings\nsuch as QuantumDepth.  You can also defer this step to later\nby opening the header file\n<tt class=\"docutils literal\">CORE_magick\\include\\magick_config.h</tt> in the Visual Studio\nproject.</li>\n<li>Finish remaining configure wizard screens to complete.</li>\n<li>File -&gt; <cite>Close Workspace</cite></li>\n</ol>\n</li>\n<li><p class=\"first\">Build ImageMagickObject</p>\n<ol class=\"loweralpha simple\">\n<li>Open Visual Studio Command Shell Window for WIN32 or WIN64</li>\n<li>Change to GraphicsMagick project directory <tt class=\"docutils literal\">GM</tt></li>\n<li><tt class=\"docutils literal\">cd GM\\contrib\\win32\\ATL7\\ImageMagickObject</tt></li>\n<li><tt class=\"docutils literal\">BuildImageMagickObject clean</tt></li>\n<li><tt class=\"docutils literal\">BuildImageMagickObject release</tt></li>\n<li><tt class=\"docutils literal\">cd <span class=\"pre\">..\\..\\..\\..</span></tt></li>\n</ol>\n</li>\n<li><p class=\"first\">Build PerlMagick extension (optional and now rarely done)</p>\n<ol class=\"loweralpha\">\n<li><p class=\"first\">Open Visual Studio Command Shell Window for WIN32  or WIN64</p>\n</li>\n<li><p class=\"first\">Change to GraphicsMagick project directory <tt class=\"docutils literal\">GM</tt></p>\n</li>\n<li><p class=\"first\"><tt class=\"docutils literal\">cd GM\\PerlMagick</tt></p>\n</li>\n<li><p class=\"first\"><tt class=\"docutils literal\">nmake clean</tt> (only if this is a rebuild)</p>\n</li>\n<li><p class=\"first\"><tt class=\"docutils literal\"><span class=\"pre\">C:\\Perl32\\bin\\perl.exe</span> Makefile.nt</tt> (or Perl64)</p>\n<p>Note that if multiple Perl's are installed, then it may be\nnecessary to specify the full path to perl.exe in order to use\nthe correct Perl.</p>\n</li>\n<li><p class=\"first\"><tt class=\"docutils literal\">nmake release</tt></p>\n</li>\n</ol>\n</li>\n</ol>\n<p>NOTE: access to <em>nmake</em> requires that there be a path to it. Depending on\nhow the install of Visual Studio was done, this may not be the case.\nVisual Studio provides a batch script in VC98Bin called VCVARS32.BAT\nthat can be used to do this manually after you open up a command prompt.</p>\n<ol class=\"arabic simple\" start=\"8\">\n<li>Open <cite>GMVisualMagickinstallergm-win32-Q8-dll-full.iss</cite> (or\n<cite>gm-win32-Q16-dll-full.iss</cite> if QuantumDepth=16) by\ndouble-clicking from Windows Explorer.<ol class=\"loweralpha\">\n<li><cite>File</cite> -&gt; <cite>Compile</cite></li>\n<li>Test install by clicking on green triangle</li>\n</ol>\n</li>\n<li>Test PerlMagick (optional).<ol class=\"loweralpha\">\n<li><tt class=\"docutils literal\">cd PerlMagick</tt></li>\n<li><tt class=\"docutils literal\">nmake test</tt> (All tests must pass!)</li>\n</ol>\n</li>\n<li>Test file format read and write.</li>\n</ol>\n<blockquote>\n<ol class=\"loweralpha simple\">\n<li><tt class=\"docutils literal\">cd VisualMagick\\tests</tt></li>\n<li><tt class=\"docutils literal\">run_rwfile.bat</tt> (All tests must pass!)</li>\n<li><tt class=\"docutils literal\">run_rwblob.bat</tt> (All tests must pass!)</li>\n</ol>\n</blockquote>\n<ol class=\"arabic simple\" start=\"11\">\n<li>Run Magick++ test programs.</li>\n</ol>\n<blockquote>\n<ol class=\"loweralpha simple\">\n<li><tt class=\"docutils literal\">cd <span class=\"pre\">Magick++/tests</span></tt></li>\n<li><tt class=\"docutils literal\">run_tests.bat</tt> (All tests must pass!)</li>\n</ol>\n</blockquote>\n<ol class=\"arabic simple\" start=\"12\">\n<li>Run Magick++ demo programs.</li>\n</ol>\n<blockquote>\n<ol class=\"loweralpha simple\">\n<li><tt class=\"docutils literal\">cd <span class=\"pre\">Magick++/demo</span></tt></li>\n<li><tt class=\"docutils literal\">run_demos.bat</tt></li>\n<li>Use <em>gmdisplay</em> to visually inspect all output files.</li>\n</ol>\n</blockquote>\n<ol class=\"arabic simple\" start=\"13\">\n<li>Distribution package is available named similar to\n<tt class=\"docutils literal\"><span class=\"pre\">GM\\VisualMagick\\bin\\GraphicsMagick-1.3-Q8-dll.exe</span></tt></li>\n</ol>\n</blockquote>\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/ImageMagickObject.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ImageMagickObject</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"imagemagickobject\">\n<h1 class=\"title\">ImageMagickObject</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"section\" id=\"overview\">\n<h1>Overview</h1>\n<p>The <em>ImageMagickObject</em> is a COM+ compatible component that may be\ninvoked from any language capable of using COM objects. The intended use\nis for Windows Scripting Host VBS scripts and Visual Basic, but it can\nalso be used from C++, ASP, and other languages like Delphi, Perl and PHP.</p>\n<p>The strategy with the <em>ImageMagickObject</em> COM+ component is not to the\nsame as with PerlMagick interface provided with ImageMagick. PerlMagick\nis a low level API based system that defines a whole new way of scripting\nIM operations. The IM COM+ component simply provides access to the\n<a class=\"reference external\" href=\"convert.html\">convert</a>, composite, <a class=\"reference external\" href=\"mogrify.html\">mogrify</a>, <a class=\"reference external\" href=\"identify.html\">identify</a>, and <a class=\"reference external\" href=\"montage.html\">montage</a> tools,\nefficiently executing them as part of your process, rather than as\nexternal programs. The way you use it is exactly the same. You pass it a\nlist of strings including filenames and various options and it does the\njob. In fact, you can take any existing batch scripts that use the\ncommand line tools and translate them into the equivalent calls to the\nCOM+ object in a matter of minutes. Beyond that, there is also a way to\npass in and retrieve images in memory in the form of standard smart\narrays (byte arrays). Samples are provided, to show both the simple and\nmore elaborate forms of access.</p>\n<p><em>GraphicsMagick</em> provides a statically-built ImageMagick object as part of\nits &quot;utils&quot; <a class=\"reference external\" href=\"INSTALL-windows.html\">Windows installation package</a>. When this package is\ninstalled, <em>ImageMagickObject</em> and its sample programs are installed to</p>\n<pre class=\"literal-block\">\nc:\\Program Files\\GraphicsMagick-1.3-Q16\\ImageMagickObject\n</pre>\n<p>by default (path shown is for the Q:16 build). <em>ImageMagickObject</em> is\nregistered if the checkbox for &quot;Register ImageMagickObject&quot; is checked at\ninstall time.</p>\n<p>You may execute the sample program from the Windows Command Shell like:</p>\n<pre class=\"literal-block\">\ncscript SimpleTest.vbs\n</pre>\n<p>Since the <em>GraphicsMagick</em> utility command line parsers are incorporated\nwithin <em>ImageMagickObject</em>, please refer to the command line <a class=\"reference external\" href=\"utilities.html\">utility\ndocumentation</a> to learn how to use it. The sample VBS scripts show how\nthe object should be called and used and have lots of comments.</p>\n<p>For C++ programmers - have a look at the MagickCMD.cpp command line\nutility for an example of how to call the object from C++. This is a bit\ncomplex because the object requires a variable size list of BSTR's to\nemulate the command line argc, argv style calling conventions of the COM\ncomponent which is more complex in C++ then in VBS or VB.</p>\n</div>\n<div class=\"section\" id=\"other-goodies\">\n<h1>Other goodies...</h1>\n<p>MagickCMD is a C++ sample, but it can also server as a replacement for\nall the other command line utilities in most applications. Instead of\nusing &quot;<tt class=\"docutils literal\">convert xxxx yyyy</tt>&quot; you can use &quot;<tt class=\"docutils literal\">MagickCMD convert xxxx\nyyyy</tt>&quot; instead. MagickCMD calls the COM object to get the job done. This\nsmall tight combination replaces the entire usual binary distribution in\njust a few megabytes.</p>\n</div>\n<div class=\"section\" id=\"building-imagemagickobject-from-source\">\n<h1>Building ImageMagickObject From Source</h1>\n<p>The source code for <em>ImageMagickObject</em> is available from <em>GraphicsMagick</em>\nCVS, or as part of the <em>GraphicsMagick</em> Windows source package. Once the\nsource code has been retrieved and extracted, the source for\n<em>ImageMagickObject</em> may be found hidden in the directory\n&quot;<tt class=\"docutils literal\">GraphicsMagick\\contrib\\win32\\ATL7ImageMagickObject</tt>&quot;, however,\n<em>GraphicsMagick</em> itself must be built using the &quot;static-multithread&quot;\n(VisualStaticMT) build configuration. Building <em>ImageMagickObject</em>\nrequires Microsoft Visual C++ 7.0 as delivered with Microsoft's Visual\nStudio .net package. See the Windows compilation instructions in order to\nget <em>GraphicsMagick</em> itself built before building <em>ImageMagickObject</em>.</p>\n<p>Once the VisualStaticMT project has been built, <em>ImageMagickObject</em> may\nbe built by following the procedure:</p>\n<pre class=\"literal-block\">\ncd  GraphicsMagick\\contrib\\win32\\ATL7ImageMagickObject\nBuildImageMagickObject release\n</pre>\n<p>This procedure assumes that the VisualStaticMT project has been built\nusing the &quot;release&quot; setting for an optimized build. If the &quot;debug&quot;\nsetting was used for a debug build, then specify the argument &quot;debug&quot;\ninstead.</p>\n<p>To register the DLL as a COM+ server use</p>\n<pre class=\"literal-block\">\nregsvr32 /c /s ImageMagickObject.dll\n</pre>\n<p>To unregister the DLL use</p>\n<pre class=\"literal-block\">\nregsvr32 /u /s ImageMagickObject.dll\n</pre>\n<p>The MagickCMD sample program operates similarly to the gm.exe program,\nand is a great way to exercise <em>ImageMagickObject</em> to verify that it is\nworking.</p>\n<p>Sometime in the future, MagickCMD may assume the place of gm.exe in the\n&quot;utils&quot; distribution in order to decrease the overall package size.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/Blob.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::Blob</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-blob\">\n<h1 class=\"title\">Magick::Blob</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>Blob provides the means to contain any opaque data. It is named after\nthe term <a class=\"reference external\" href=\"http://en.wikipedia.org/wiki/Binary_large_object\">Binary Large OBject</a> commonly used to\ndescribe unstructured data (such as encoded images) which are stored\nin a database. While the function of Blob is very simple (store a\npointer and and size associated with allocated data), the Blob class\nprovides some very useful capabilities. In particular, it is fully\nreference counted just like the Image class.</p>\n<p>The Blob class supports value assignment while preserving any\noutstanding earlier versions of the object. Since assignment is via a\npointer internally, Blob is efficient enough to be stored directly in\nan STL container or any other data structure which requires\nassignment. In particular, by storing a Blob in an <a class=\"reference external\" href=\"http://www.sgi.com/tech/stl/AssociativeContainer.html\">associative\ncontainer</a>\n(such as STL's <a class=\"reference external\" href=\"http://www.sgi.com/tech/stl/Map.html\">map</a>) it is\npossible to create simple indexed in-memory &quot;database&quot; of Blobs.</p>\n<p>Magick++ currently uses Blob to contain encoded images (e.g. JPEG) as\nwell as ICC and IPTC profiles. Since Blob is a general-purpose class,\nit may be used for other purposes as well.</p>\n<p>The following is the definition of the Magick::Blob class:</p>\n<pre class=\"literal-block\">\nclass Blob\n{\n\npublic:\n\n  enum Allocator\n  {\n    MallocAllocator,\n    NewAllocator\n  };\n\n  // Default constructor\n  Blob ( void );\n\n  // Construct object with data, making a copy of the supplied data.\n  Blob ( const void* data_, size_t length_ );\n\n  // Copy constructor (reference counted)\n  Blob ( const Blob&amp; blob_ );\n\n  // Destructor (reference counted)\n  virtual       ~Blob ();\n\n  // Assignment operator (reference counted)\n  Blob&amp;         operator= ( const Blob&amp; blob_ );\n\n  // Update object contents from Base64-encoded string representation.\n  void          base64 ( const std::string base64_ );\n  // Return Base64-encoded string representation.\n  std::string   base64 ( void );\n\n  // Update object contents, making a copy of the supplied data.\n  // Any existing data in the object is deallocated.\n  void          update ( const void* data_, size_t length_ );\n\n  // Update object contents, using supplied pointer directly (no\n  // copy). Any existing data in the object is deallocated.  The user\n  // must ensure that the pointer supplied is not deleted or\n  // otherwise modified after it has been supplied to this method.\n  // Specify allocator_ as &quot;MallocAllocator&quot; if memory is allocated\n  // via the C language malloc() function, or &quot;NewAllocator&quot; if\n  // memory is allocated via C++ 'new'.\n  void          updateNoCopy ( void* data_, size_t length_,\n                               Allocator allocator_ = NewAllocator );\n\n  // Obtain pointer to data. The user should never try to modify or\n  // free this data since the Blob class manages its own data. The\n  // user must be finished with the data before allowing the Blob to\n  // be destroyed since the pointer is invalid once the Blob is\n  // destroyed.\n  const void*   data ( void ) const;\n\n  // Obtain data length\n  size_t length ( void ) const;\n\n};\n</pre>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/ChangeLog.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>ChangeLog.rst</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\">\n\n\n<p>2017-03-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (orientation): Update orientation in EXIF profile,\nif it exists.\n(attribute): Added Image attribute method which accepts a 'char *'\nargument, and will remove the attribute if the value argument is\nNULL.</li>\n</ul>\n</blockquote>\n<p>2014-11-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Geometry.h (Magick::Geometry): Add and document\nlimitPixels() and fillArea() methods to support '&#64;' and '^'\ngeometry qualifiers.  Fill area contributed by Long Ho and\nlimitPixels() by Bob Friesenhahn.</li>\n<li>../www/Magick++/Image.rst: Document extent and resize methods.</li>\n<li>lib/STL.cpp (extentImage): New function object to invoke image\nextent method. Original implementation contributed by Long Ho.\nSubsequently modified by Bob Friesenhahn.\n(resizeImage): New function object to invoke image resize\nmethod. Contributed by Long Ho.</li>\n<li>lib/Image.cpp (extent): New method to place image on sized\ncanvas of constant color using gravity.  Contributed by Long Ho.\n(resize): New method to resize image specifying geometry, filter,\nand blur.  Original implementation contributed by Long Ho.\nSubsequently modified by Bob Friesenhahn.</li>\n</ul>\n</blockquote>\n<p>2014-01-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (thumbnail): New method for fast image resizing,\nparticularly to make thumbnails.</li>\n</ul>\n</blockquote>\n<p>2013-12-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableDashArray): DrawableDashArray now uses\nC++ memory allocation rather than from GraphicsMagick library.\nAlso, implement direct copy constructor and assignment operator\nrather than using dasyarray() method.</li>\n</ul>\n</blockquote>\n<p>2012-11-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>COPYING: Change Magick++ usage license to be exactly the MIT\nlicense without the additional sentence about retention of\ncopyright (which was already legally implicit).</li>\n</ul>\n</blockquote>\n<p>2012-04-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (defineValue): Use AddDefinition() rather than\nAddDefinitions().</li>\n</ul>\n</blockquote>\n<p>2012-03-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h (Magick): Added support for RandomNoise.</li>\n</ul>\n</blockquote>\n<p>2012-03-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/STL.cpp (stripImage): New unary function to to remove all\nprofiles and text attributes from the image.</li>\n<li>lib/Image.cpp (strip): New method to remove all profiles and\ntext attributes from the image.</li>\n</ul>\n</blockquote>\n<p>2011-12-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h: Explicitly DLL import/export Magick++\nsymbols when building under MinGW GCC.</li>\n</ul>\n</blockquote>\n<p>2010-12-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h (Magick): Add LZMACompression</li>\n</ul>\n</blockquote>\n<p>2010-12-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (InitializeMagick): Don't use atexit().  C++\ndestructures are sufficient.</li>\n</ul>\n</blockquote>\n<p>2010-09-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (backgroundColor, borderColor, matteColor):\nOpacity part of user-specified color needs to be preserved.\nProblem was reported by Alexander Zheltov.</li>\n</ul>\n</blockquote>\n<p>2010-04-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/CoderInfo.h: Add default constructor, copy\nconstructor, and assignment operator.</li>\n</ul>\n</blockquote>\n<p>2010-01-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (Magick): Fix potential memory leak.</li>\n</ul>\n</blockquote>\n<p>2010-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>demo/shapes.cpp (main): Floodfill shape more agressively and\nscale fuzz factor so that it provides the same results across\nquantum depths.</li>\n</ul>\n</blockquote>\n<p>2009-10-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/STL.cpp, lib/Magick++/STL.h (shadeImage): ShadeImage was the\nresult of a botched cut-and-paste.  Corrected now.  Thanks to\nJukka Manner for making me aware of this.</li>\n</ul>\n</blockquote>\n<p>2009-09-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (cdl): New method to apply the ASC CDL.\n(colorMatrix): New method to apply a color matrix to the image\nchannels.\n(haldClut): New method to apply a color lookup table (Hald CLUT)\nto the image.</li>\n</ul>\n</blockquote>\n<p>2009-07-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (attribute): Invoke modifyImage() to assure\nexclusive access to image when updating attributes.</li>\n</ul>\n</blockquote>\n<p>2009-03-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (quantumOperator): New variant of method which\ntakes a 'double' argument, as it originally should.  Previous\nmethod taking a Quantum argument is still supported but marked\ndeprecated.</li>\n</ul>\n</blockquote>\n<p>2009-01-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h: If the user defines STATIC_MAGICK in his\nproject, then the Windows DLL decorations are ignored.  Without\nthis, Windows DLL-based code can't use a static GraphicsMagick.\nThis is recommended by SourceForge bug 2537627.</li>\n<li>lib/Magick++/Drawable.h: Apparently the only STL container which\nmay be DLL-exported is &lt;vector&gt; but we are using &lt;list&gt; so disable\nDLL-export of list-based template objects.</li>\n</ul>\n</blockquote>\n<p>2008-10-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Color.cpp: Added an _isValid boolean to represent an invalid\ncolor.  Transparent black is no longer special and can be used in\ndrawing.</li>\n<li>lib/Pixels.cpp: Update to use new cache view interfaces provided\nby GraphicsMagick 1.3.</li>\n</ul>\n</blockquote>\n<p>2008-09-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (addNoiseChannel): New method to add noise to a\nspecified channel.\n(blurChannel): New method to blur a specified channel.\n(gaussianBlurChannel): New method to gaussian blur a specified\nchannel.\n(motionBlur): New method to motion blur the image.\n(randomThresholdChannel): New method to apply random thresholding\nor ordered dithering to the image.\n(randomThresholdChannel): New method to apply random thresholding\nor ordered dithering to the specified image channels.\n(sharpenChannel): New method to sharpen a specified image channel.\n(unsharpmaskChannel): New method to unsharpmask a specified image\nchannel.</li>\n</ul>\n</blockquote>\n<p>2008-06-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (quantize): Error measurement support was being\nperformed incorrectly.  SyncImage() is not needed here.</li>\n</ul>\n</blockquote>\n<p>2008-05-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>demo/demo.cpp (main): Fix segmentation parameters so they are\nmore suitable for our image.</li>\n</ul>\n</blockquote>\n<p>2008-04-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (depth): Remove 8/16/32 restriction on depth\nvalue.</li>\n</ul>\n</blockquote>\n<p>2008-03-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Geometry.cpp, lib/Image.cpp: Include &lt;strings.h&gt; since it is\nneeded in order to use strcpy().</li>\n</ul>\n</blockquote>\n<p>2007-12-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/{Drawable.cpp, Geometry.cpp, BlobRef.cpp, Blob.cpp,\nMontage.cpp, Options.cpp, Image.cpp}: Eliminate use of deprecated\nGraphicsMagick functions.</li>\n<li>lib/Magick++/{STL.h, Include.h}: Eliminate use of deprecated\nGraphicsMagick functions.</li>\n</ul>\n</blockquote>\n<p>2007-07-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp: Include &lt;cstdlib&gt;</li>\n</ul>\n</blockquote>\n<p>2006-10-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (pixelColor): Don't enforce color &quot;validity&quot; when\nsetting the pixel color.</li>\n</ul>\n</blockquote>\n<p>2005-10-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (orientation): New accessor method to support\nimage orientation.</li>\n</ul>\n</blockquote>\n<p>2005-04-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/STL.cpp (levelImage): New function object for leveling the\nimage channels.\n(levelChannelImage): New function object for leveling a specific\nimage channel.</li>\n<li>lib/Image.cpp (level): New method for leveling the image\nchannels.\n(levelChannel): New method for leveling a specific image channel.</li>\n</ul>\n</blockquote>\n<p>2005-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h (Magick): Import CineonLogRGBColorspace\ninto Magick namespace.</li>\n</ul>\n</blockquote>\n<p>2005-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h: Import Rec601LumaColorspace (was called\nGRAYColorspace) and Rec709LumaColorspace into Magick\nnamespace. Use of GRAYColorspace is mapped via a macro into\nRec601LumaColorspace in order to avoid a user-visible API change.</li>\n</ul>\n</blockquote>\n<p>2004-08-17  Volker Lukas  &lt;<a class=\"reference external\" href=\"mailto:vlukas&#37;&#52;&#48;gmx&#46;de\">vlukas<span>&#64;</span>gmx<span>&#46;</span>de</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp: Fixes to ensure that drawable objects remain\ncoherent even if an exception is thrown within the assignment\noperator.</li>\n</ul>\n</blockquote>\n<p>2004-07-22  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>demo/Makefile.am (AUTOMAKE_OPTIONS): Added nostdinc in order to\navoid accidentally using magick/list.h when including &lt;list&gt;.</li>\n<li>tests/Makefile.am (AUTOMAKE_OPTIONS): Added nostdinc in order to\navoid accidentally using magick/list.h when including &lt;list&gt;.</li>\n<li>tests/readWriteBlob.cpp: If MISSING_STD_IOS_BINARY is defined,\nthen ios::binary is not used.  Use simple ifstream rather than\nstd::ifstream since we are already using the std namespace.</li>\n</ul>\n</blockquote>\n<p>2004-06-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h: Disable unavoidable warnings under\nVisual C++ when instantiating STL templates within DLL\ncode. Consensus from postings on the net is that as long as the\nsame C++ compiler is used throughout, these warnings are of no\nconcern.</li>\n</ul>\n</blockquote>\n<p>2004-05-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (coderInfoList): Make error reporting a bit\nmore lenient so that if an error occurs while loading a module it\nis not reported as an exception unless no coders were found at\nall.</li>\n</ul>\n</blockquote>\n<p>2004-05-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (clipMask): Use GetImageClipMask.</li>\n</ul>\n</blockquote>\n<p>2004-04-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/CoderInfo.cpp (CoderInfo): Sense of isReadable() and\nisWritable() was inverted.</li>\n</ul>\n</blockquote>\n<p>2004-04-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h: &lt;inttypes.h&gt; is not used. Inclusion\nremoved.</li>\n</ul>\n</blockquote>\n<p>2004-03-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Thread.cpp (lock): Have not been successful with using\nMsgWaitForMultipleObjects() reliably, so back out usage of it for\nnow.</li>\n</ul>\n</blockquote>\n<p>2004-03-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Thread.cpp (lock): For MsgWaitForMultipleObjects, monitor\nstate change only.  Otherwise lock may deadlock.</li>\n</ul>\n</blockquote>\n<p>2004-03-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (statistics): New method to obtain image\nstatistics (minimum, maximum, mean, variance, and standard\ndeviation).</li>\n</ul>\n</blockquote>\n<p>2004-03-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (quantumOperator): New image method to apply an\narithmetic or bitwise operator to the pixel quantums in an image.\nStill needs documentation.\n(quantumOperator): New image method to apply an arithmetic or\nbitwise operator to the pixel quantums in an image region.</li>\n</ul>\n</blockquote>\n<p>2004-03-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Makefile.am (../www/Magick++/ChangeLog.html): Fix execution of\ntxt2html.</li>\n<li>lib/STL.cpp (composeImage): Added a function object to set/get\nthe Image composition option.</li>\n<li>lib/Image.cpp (compose): Added a method to set/get the Image\ncomposition option.</li>\n</ul>\n</blockquote>\n<p>2004-03-06  Vladimir Lukianov  &lt;<a class=\"reference external\" href=\"mailto:lvm&#37;&#52;&#48;integrum&#46;ru\">lvm<span>&#64;</span>integrum<span>&#46;</span>ru</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Thread.cpp (lock): Use MsgWaitForMultipleObjects() rather\nthan WaitForSingleObject() in order to avoid possible deadlock\nwhen application code directly or indirectly creates windows.</li>\n</ul>\n</blockquote>\n<p>2004-02-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (interlaceType): Retrieve interlace setting from\nImage rather than ImageInfo.</li>\n</ul>\n</blockquote>\n<p>2004-02-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (Image): Delete the allocated image reference\nobject if a Magick::Error is thrown by the Image constructor.\nOtherwise the image reference object becomes a memory leak.</li>\n</ul>\n</blockquote>\n<p>2004-01-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (WriteImages): Pass Blob::MallocAllocator to\nupdateNoCopy() in order to ensure that correct deallocator is\nused.</li>\n<li>tests/readWriteBlob.cpp (main): Needed to delete character array\nusing array [] reference.</li>\n</ul>\n</blockquote>\n<p>2004-01-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>demo/analyze.cpp (main): Fix a GNU C++ library portability\nproblem noticed under MinGW. The 'left' iostream manipulator seems\nto be missing.</li>\n</ul>\n</blockquote>\n<p>2004-01-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/Makefile.am: coderInfo test is expected to fail for moby\nbuilds when the package is not yet installed since a .la file\nexists in the coders directory, but there is no associated .so\nfile.  Therefore failures of the coderInfo test are now ignored.</li>\n</ul>\n</blockquote>\n<p>2003-12-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (defineValue): New method to support setting\nformat-specific defines.\n(defineSet): New method to support setting or testing for\nformat-specific flags.</li>\n</ul>\n</blockquote>\n<p>2003-12-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (iccColorProfile): Implementation now uses the\nprofile method with profile name &quot;ICM&quot;.  Note that this now\ninvokes the color profile if the image already has one.\n(iccColorProfile): Reimplement using new GetImageProfile function.\n(iptcProfile): Reimplement using the new GetImageProfile and\nSetImageProfile functions.\n(profile): Reimplement using new GetImageProfile function.</li>\n</ul>\n</blockquote>\n<p>2003-12-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Makefile.am (pkglibdir): Improve header file\ninstall location logic.</li>\n</ul>\n</blockquote>\n<p>2003-12-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>demo/analyze.cpp (main): New program to demonstrate using the\n'analyze' process module.</li>\n<li>demo/Makefile.am: Add rules to build analyze program.</li>\n<li>lib/Image.cpp (process): New method to execute process modules.</li>\n<li>lib/Image.cpp (attribute): New method to get and set named image\nattributes.</li>\n</ul>\n</blockquote>\n<p>2003-10-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Color.cpp: Ensure that all non-default constructors set\nopacity to opaque.</li>\n</ul>\n</blockquote>\n<p>2003-09-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (colorHistogram): If map key is not const,\nthen implicit type conversion occurs.  Sun's C++ compiler doesn't\nseem to handle that.  The map key is now defined as const in the\ninsert arguments.</li>\n</ul>\n</blockquote>\n<p>2003-09-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/Makefile.am: Add build support for colorHistogram.cpp.</li>\n<li>tests/colorHistogram.cpp: New test program to test retrieving\ncolor histograms from the image using colorHistogram().</li>\n<li>lib/Magick++/STL.h (colorHistogram): Added new template function\nto retrieve a color histogram into a user-provided container.\nVerified to work when using STL &lt;vector&gt; and &lt;map&gt; as the target\ncontainer types.  When &lt;map&gt; is used, a user-specified color may\nbe used to perform lookups in the map to obtain the usage count\nfor that color.</li>\n<li>lib/Color.cpp (operator &gt;=): Insufficient resolution was being\nprovided in order to reliably sort color objects in STL\ncontainers.  The updated algorithm should be fail-safe.</li>\n</ul>\n</blockquote>\n<p>2003-08-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (channelDepth): New method to set or get the\nmodulus depth for a specified channel.</li>\n</ul>\n</blockquote>\n<p>2003-08-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h (Magick): Added support for\nCopyCyanCompositeOp, CopyMagentaCompositeOp,\nCopyYellowCompositeOp, and CopyBlackCompositeOp, composition\noperators.</li>\n</ul>\n</blockquote>\n<p>2003-08-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (depth): Method now only updates the\nImage/ImageInfo depth member and retrieves the value of the Image\ndepth member.\n(modulusDepth): New method to inspect the pixels for actual\nmodulus depth, or update/reduce the pixels to a specified modulus\ndepth.  The depth method was performing this function so any code\nwhich depended on the depth method to compute or set the modulus\ndepth should be updated to use modulusDepth() instead.</li>\n</ul>\n</blockquote>\n<p>2003-08-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (matte): If a new matte channel is created,\ninitialize it to opaque.  Likewise, if the matte channel is\neliminated, initialize the unused channel to opaque.</li>\n</ul>\n</blockquote>\n<p>2003-07-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>demo/demo.cpp (main): Don't crop logo image.</li>\n<li>*.h, *.cpp: Include &quot;Magick++/Include.h&quot; before including any\ncompiler or system header in order to ensure that LFS defines are\nproperly applied. Inspired by patch from Albert Chin-A-Young.</li>\n</ul>\n</blockquote>\n<p>2003-06-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h: Needed to import ThrowLoggedException.</li>\n<li>lib/Exception.cpp (throwException): Add originating source\nmodule, source line, and function name (if available) to exception\nreport. This is useful in order to determine the exact conditions\nthat lead to the exception being thrown.</li>\n<li>lib/Magick++/Exception.h: Added ErrorCoder, WarningCoder,\nErrorConfigure, WarningConfigure, ErrorDraw, WarningDraw,\nErrorImage, WarningImage, ErrorMonitor, WarningMonitor,\nErrorRegistry, WarningRegistry, ErrorStream, WarningStream,\nErrorType, and WarningType, exception classes to support the full\nset of exceptions that GraphicsMagick can throw.</li>\n</ul>\n</blockquote>\n<p>2003-06-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/CoderInfo.cpp (CoderInfo): Applied compilation fix from Mike\nChiarappa to compile using Borland C++.</li>\n</ul>\n</blockquote>\n<p>2003-06-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Geometry.cpp (string): Throw an exception if a string is\nrequested from an invalid geometry object.</li>\n</ul>\n</blockquote>\n<p>2003-06-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Geometry.cpp (operator =): If GetGeometry returns NoValue,\nthen assign an invalid geometry object to cause an exception if\nthe geometry is then used.</li>\n</ul>\n</blockquote>\n<p>2003-06-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Exception.h (ErrorModule): Added class to handle\nmodule errors.</li>\n<li>lib/Magick++/Exception.h (WarningModule) Added class to handle\nmodule warnings.</li>\n</ul>\n</blockquote>\n<p>2003-05-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (coderInfoList): Use GetMagickInfoArray to\naccess coder list.</li>\n</ul>\n</blockquote>\n<p>2003-05-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (affineTransformImage): Add function object\ncontributed by Vladimir Lukianov to apply an affine transform to\nthe image.</li>\n<li>lib/Image.cpp (affineTransform): Added method contributed by\nVladimir Lukianov to apply an affine transform to the image.</li>\n</ul>\n</blockquote>\n<p>2003-05-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h: Decided to back out change which used\nthe _VISUALC_ define to trigger inclusion of &lt;sys/types.h&gt;.</li>\n</ul>\n</blockquote>\n<p>2003-05-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h: If _VISUALC_ is defined, include\n&lt;sys/types.h&gt;. This ensures that this necessary header is included\neven if HAVE_SYS_TYPES_H is not defined in magick_config.h.</li>\n</ul>\n</blockquote>\n<p>2003-05-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (InitializeMagick): InitializeMagick is now a C++\nfunction rather than a namespace inclusion.  An atexit() handler\nis registered to invoke DestroyMagick when the program\nexits. Relying on static deconstruction to invoke DestroyMagick\nproved to be unreliable due to translation unit destruction\nuncertainty.</li>\n</ul>\n</blockquote>\n<p>2003-04-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (Image::Image (MagickLib::Image* image_)):\nIncorporated recommended fix from Jukka Manner to avoid\na scenario which leaks an Options object.</li>\n<li>tests/coalesceImages.cpp: Updated to use modified\ncoalesceImages() interface.</li>\n<li>lib/Magick++/STL.h (coalesceImages): Replaced implementation\nwith one from Felix Heimbrecht. The template signature has changed\nto return a new image sequence. This template API silently ceased\nto funtion due to an ImageMagick CoalesceImages API change.</li>\n</ul>\n</blockquote>\n<p>2003-03-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/readWriteBlob.cpp (main): Added check for stream read\nfailure when reading blob data.\n(class myBlob): Use get rather than read.</li>\n</ul>\n</blockquote>\n<p>2003-03-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/attributes.cpp : Change in the way that Magick++ retrieves\ndensity caused tests to fail.  Density now defaults to 72x72\n(GraphicsMagick default) rather than invalid.</li>\n</ul>\n</blockquote>\n<p>2003-03-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>demo/Makefile.am (CLEANFILES): Fix clean target to\nremove *_out.mvg output files as well.</li>\n<li>demo/zoom.cpp: Added a command-line parser for dash arguments as\nwell as an image &quot;resample&quot; capability.</li>\n<li>lib/Image.cpp (density): Obtain density from Image rather than\nImageInfo if the Image is valid.</li>\n</ul>\n</blockquote>\n<p>2003-03-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Makefile.am : Added rules to install GraphicsMagick++.pc.</li>\n<li>lib/GraphicsMagick++.pc.in : Added pkgconfig file for\n-lGraphicsMagick++.</li>\n</ul>\n</blockquote>\n<p>2003-02-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (colorSpace): Pass image-&gt;colorspace to\nTransformRGBColorspace.</li>\n</ul>\n</blockquote>\n<p>2003-01-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (writeImages): Should have been invoking\nWriteImages rather than WriteImage!</li>\n</ul>\n</blockquote>\n<p>2003-01-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h: Add HSL and HWB colorspace\ntransformation support.</li>\n</ul>\n</blockquote>\n<p>2003-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (colorSpace): Support colorspace transforms other\nthan to and from RGB by translating to RGB as an intermediate\nstep.</li>\n</ul>\n</blockquote>\n<p>2002-11-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp: Added DrawablePushClipPath,\nDrawablePopClipPath, and DrawableClipPath.  Implementation\ncontributed by Vladimir &lt;<a class=\"reference external\" href=\"mailto:lvm&#37;&#52;&#48;integrum&#46;ru\">lvm<span>&#64;</span>integrum<span>&#46;</span>ru</a>&gt;.</li>\n</ul>\n</blockquote>\n<p>2002-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (colorMapSize): New method to set, or return the\ncolormap size.</li>\n</ul>\n</blockquote>\n<p>2002-11-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (adaptiveThreshold): New method.</li>\n</ul>\n</blockquote>\n<p>2002-10-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (coderInfoList): Intentionally ignore missing\ndelegate exceptions.</li>\n</ul>\n</blockquote>\n<p>2002-09-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Options.cpp (textEncoding): Had forgotten to implement\ntextEncoding!</li>\n</ul>\n</blockquote>\n<p>2002-09-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Color.cpp (Color): Use of 'new' and 'delete' in inlines was\ncausing memory allocation/deallocation problems for users of the\nDLL build.  Problem was identified by Marc Iwan.</li>\n</ul>\n</blockquote>\n<p>2002-09-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (compare): New method to compare current image\nwith a reference image.</li>\n</ul>\n</blockquote>\n<p>2002-08-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (textEncoding): New method to allow setting the\ndefault text encoding (e.g. &quot;UTF-8&quot;).</li>\n<li>lib/Drawable.cpp (DrawableText): Added an alternate constructor\nto allow specifying the text encoding (e.g. &quot;UTF-8&quot;).</li>\n</ul>\n</blockquote>\n<p>2002-08-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Overall: Now compiles as a DLL using Visual C++.</li>\n</ul>\n</blockquote>\n<p>2002-07-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (profile): Added method to store, delete, or\nretrieve named application profiles.</li>\n</ul>\n</blockquote>\n<p>2002-07-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (type): Set the ImageInfo type attribute when\nsetting the image type.  If the type attribute is set to something\nother than UndefinedType (implying that the user has set a desired\noutput image type), then return that as the image type, otherwise\nuse GetImageType() to evaluate the image type.</li>\n</ul>\n</blockquote>\n<p>2002-05-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableTextUnderColor): New class to set the\ntext undercolor.  When text undercolor is set, a rectangle of the\nspecified color is rendered under text annotations.</li>\n</ul>\n</blockquote>\n<p>2002-05-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Magick++ library no longer depends on iostreams at all.</li>\n</ul>\n</blockquote>\n<p>2002-04-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (throwImageException): ExceptionInfo was not being\nproperly initialized.  This could cause some errors to cause an\nabort in error.c rather than throwing an exception.</li>\n</ul>\n</blockquote>\n<p>2002-04-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (draw): Use draw.h drawing APIs to draw on image.\nThis means that MVG output no longer comes from code in\nDrawable.cpp.</li>\n</ul>\n</blockquote>\n<p>2002-04-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/STL.cpp: Moved function object implementations from STL.h to\nSTL.cpp.</li>\n</ul>\n</blockquote>\n<p>2002-04-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (getConstPixels): Changed offset parameter type\nfrom 'unsigned int' to 'int'.\n(getPixels): Changed offset parameter type from 'unsigned int' to\n'int'.\n(setPixels): Changed offset parameter type from 'unsigned int' to\n'int'.\n(cacheThreshold): Changed argument type from 'const long' to\n'const int'.\n(matteFloodfill): Changed offset parameter type from 'const long'\nto 'const int'.</li>\n<li>lib/Pixels.cpp (getConst): New method to return read-only\npixels.\n(get): Offset parameter types changed from 'unsigned int' to\n'int'.</li>\n</ul>\n</blockquote>\n<p>2002-04-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Drawable.h (DrawableDashOffset): Change dashoffset\ntype to 'double' rather than 'unsigned int' in order to match\nImageMagick.</li>\n<li>lib/Drawable.cpp (DrawableDashArray): Change dasharray type to\n'double' rather than 'unsigned int' in order to match\nImageMagick. Previous 'unsigned int' methods remain for\ncompatability reasons.</li>\n</ul>\n</blockquote>\n<p>2002-04-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableCompositeImage): Always output\ncomposite images as inlined Base64.</li>\n</ul>\n</blockquote>\n<p>2002-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableCompositeImage): If magick attribute\nstring is specified, then composite image is supplied to\nImageMagick as inlined Base64 rather than by MPRI reference.</li>\n<li>lib/Blob.cpp (base64): Added methods to update Blob with data\nfrom Base64-encoded string, or to return a Base64-encoded string\nfrom Blob.  Still needs documentation.</li>\n</ul>\n</blockquote>\n<p>2002-04-09  Dom Lachowicz    &lt;<a class=\"reference external\" href=\"mailto:cinamod&#37;&#52;&#48;hotmail&#46;com\">cinamod<span>&#64;</span>hotmail<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (Image::ping): Added PingBlob function</li>\n</ul>\n</blockquote>\n<p>2002-04-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableDashArray::operator=): Added missing\nassignment operator (fixes a bug).\n(DrawableDashArray::DrawableDashArray): Added missing copy\nconstructor (fixes a bug).</li>\n<li>lib/Image.cpp (oilPaint): Changed argument type from unsigned\nint to double.\n(chromaBluePrimary): Changed argument type from float to double.\n(chromaGreenPrimary): Changed argument type from float to double.\n(chromaRedPrimary): Changed argument type from float to double.\n(chromaWhitePoint): Changed argument type from float to double.\n(getConstPixels): Changed argument type of x_ &amp; _y from 'int' to\n'unsigned int'.\n(getPixels): Changed argument type of x_ &amp; _y from 'int' to\n'unsigned int'.</li>\n</ul>\n</blockquote>\n<p>2002-04-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (debug): Added method to set ImageMagick debug\nflag so that it prints debugging information while it runs.</li>\n</ul>\n</blockquote>\n<p>2002-04-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp: Fixed a bunch of bugs related to\nDrawableCompositeImage, DrawableFont, and inconsistencies\ndiscovered by Gimpel lint.</li>\n</ul>\n</blockquote>\n<p>2002-04-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (draw): Properly delimit individual drawing\ncommands so that MVG output is correct.</li>\n</ul>\n</blockquote>\n<p>2002-03-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableViewbox): MVG syntax wasn't correct.</li>\n<li>lib/Image.cpp (draw): Fix algorithm used to append newlines to\nMVG commands so that draw() may be invoked multiple times while\nstill producing valid MVG.</li>\n</ul>\n</blockquote>\n<p>2002-03-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableViewbox): New class to allow setting\nthe MVG output size.</li>\n</ul>\n</blockquote>\n<p>2002-03-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (print): Changed &quot;mpr:&quot; to &quot;mpri:&quot; in order to\nfinally get DrawableCompositeImage to work as intended.</li>\n<li>lib/Image.cpp (registerId): Bugfix. Register using\nsizeof(MagickLib::Image) rather than sizeof(Image).</li>\n</ul>\n</blockquote>\n<p>2002-03-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableCompositeImage): Had failed to\ninitialize width and height in object to image width and height.</li>\n</ul>\n</blockquote>\n<p>2002-02-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (endianImage): New class to specify the\nendian option for formats which support this notion (e.g. TIFF).</li>\n<li>lib/Image.cpp (endian): New method to specify the endian option\nfor formats which support this notion (e.g. TIFF).</li>\n</ul>\n</blockquote>\n<p>2002-02-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableFont): Support specifying a font via\nfont-family, font-style, font-weight, and font-stretch. Wildcard\nmatches are supported.</li>\n</ul>\n</blockquote>\n<p>2002-02-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (charcoal): Replace Magick++'s charcoal effect\nwith the output of ImageMagick's CharcoalImage function in order\nto ensure consistency.</li>\n<li>lib/Magick++/CoderInfo.h (MatchType): Scope the MatchType\nenumeration to the CoderInfo class so these enumeration names can\nbe re-used elsewhere without conflict.  This results in a minor\nAPI change to the coderInfoList() templated function since\nenumerations must be specified like &quot;CoderInfo::TrueMatch&quot; rather\nthan just &quot;TrueMatch&quot;.  Hopefully not a problem since this\nfunction and class were not documented outside of the headers\nuntil this release.</li>\n</ul>\n</blockquote>\n<p>2002-02-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (coderInfoList): Finally wrote some\ndocumentation.</li>\n</ul>\n</blockquote>\n<p>2002-01-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Options.cpp : Use DestroyImageList() rather than\nDestroyImage().</li>\n<li>lib/Geometry.cpp (operator =): Use GetPageGeometry() rather than\nPostscriptGeometry() to parse geometry specifications containing a\npage size.</li>\n</ul>\n</blockquote>\n<p>2002-01-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Remove bogus cast of blob data in readImages().</li>\n</ul>\n</blockquote>\n<p>2002-01-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (throwImageException): Throwing exceptions was\nleaking memory.</li>\n<li>lib/Exception.cpp (throwException): Throwing exceptions was\nleaking memory.</li>\n<li>lib/Image.cpp (replaceImage): Updated to properly handle\nregistration ids.\n(modifyImage): Updated to properly handle registration ids.</li>\n</ul>\n</blockquote>\n<p>2002-01-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (Magick::DrawableGravity::print):\nBugfix. Remove &quot;Gravity&quot; from the end of each gravity\nspecification string.  Reported as PR#1084 by stefan&#64;dotify.com.</li>\n</ul>\n</blockquote>\n<p>2002-01-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp, Magick++/Include.h: Use DestroyImageList() rather\nthan DestroyImages().</li>\n</ul>\n</blockquote>\n<p>2002-01-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Options.h (antiAlias): Bugfix, set\ndrawInfo-&gt;text_antialias to control text antialiasing.</li>\n</ul>\n</blockquote>\n<p>2002-01-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h : Imported new composition operators to\nnamespace: NoCompositeOp, DarkenCompositeOp, LightenCompositeOp,\nHueCompositeOp, SaturateCompositeOp, ValueCompositeOp,\nColorizeCompositeOp, LuminizeCompositeOp, ScreenCompositeOp,\nOverlayCompositeOp.</li>\n</ul>\n</blockquote>\n<p>2001-12-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (strokePattern): New method to specify image to\nuse as pattern while drawing stroked-outlines of drawn objects.\n(fillPattern): New method to specify image to use as pattern while\nfilling drawn objects.\n(penTexture): Method is officially deprecated.  Don't use anymore.\n(penColor): Method is officially deprecated. Don't use anymore.</li>\n<li>lib/Drawable.cpp (DrawablePushPattern): Support pushing\n(starting) pattern definition.\n(DrawablePopPattern): Support popping (terminating) pattern\ndefinition.</li>\n</ul>\n</blockquote>\n<p>2001-12-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableCompositeImage): Read image\nimmediately if provided by filename, register with peristent\nregistry, and pass as perisistant image type.\n(DrawableCompositeImage): Support specifying Image in memory.\nPassed as perisistant image type.</li>\n</ul>\n</blockquote>\n<p>2001-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Color.cpp (operator std::string): Color string buffer was\none character too short!</li>\n</ul>\n</blockquote>\n<p>2001-12-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;sun1107&#46;ssd&#46;usa&#46;alcatel&#46;com\">bfriesen<span>&#64;</span>sun1107<span>&#46;</span>ssd<span>&#46;</span>usa<span>&#46;</span>alcatel<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/TypeMetric.cpp (characterWidth): Eliminate method.\n(characterHeight): Eliminate method.\n(all remaining methods): Change return type to 'double'.  Fix\ndocumentation in source files to reflect that units are in pixels\nrather than points.\n(descent): Renamed method from 'decent' to 'descent'.</li>\n</ul>\n</blockquote>\n<p>2001-11-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (Magick): Invoke DestroyMagick() to clean up\nImageMagick allocations.</li>\n<li>lib/Magick++/Include.h (ImageType): Added some missing enums to\nMagick namespace.</li>\n</ul>\n</blockquote>\n<p>2001-11-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/CoderInfo.h (CoderInfo): Syntax fix.\nImageMagick bug #975.</li>\n<li>lib/Image.cpp (draw): Delete ostrstream data when it is no\nlonger needed.  ImageMagick bug #988.</li>\n</ul>\n</blockquote>\n<p>2001-11-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (pixelColor): Implementation didn't handle pixels\nindexes correctly.  Now it does.</li>\n</ul>\n</blockquote>\n<p>2001-11-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (matteFloodfill): Coordinates are long values.\n(floodFillOpacity): New method to floodfill opacity across pixels\nmatching color (within fuzz-factor) at point. Similar to\nmatteFloodfill except that color is selected from starting point.</li>\n</ul>\n</blockquote>\n<p>2001-10-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;sun1107&#46;ssd&#46;usa&#46;alcatel&#46;com\">bfriesen<span>&#64;</span>sun1107<span>&#46;</span>ssd<span>&#46;</span>usa<span>&#46;</span>alcatel<span>&#46;</span>com</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (strokeDashArray): Change to type double.\n(strokeDashOffset): Change to type double.</li>\n</ul>\n</blockquote>\n<p>2001-10-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Geometry.cpp (Geometry): Add constructor from\nMagickLib::RectangleInfo.</li>\n<li>lib/Image.cpp (boundingBox): Method to return smallest bounding\nbox enclosing non-border pixels.</li>\n</ul>\n</blockquote>\n<p>2001-10-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (getConstIndexes): Add method to obtain read-only\npixel indexes.\n(getIndexes): Add method to obtain read-write pixel indexes.\n(Image::Image): Send warnings from Image constructor to cerr\nrather than throwing.</li>\n<li>lib/Color.cpp (Color(PixelPacket&amp;)): Change argument to const\nPixelPacket&amp; as it should have been from the beginning.</li>\n<li>lib/Image.cpp (pixelColor): Reimplemented to be a const method.</li>\n</ul>\n</blockquote>\n<p>2001-10-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (getConstPixels): New method for returning a\nread-only pixel view.  Still requires documentation.</li>\n<li>lib/Magick++/STL.h (coderInfoList): Fixed compilation problem\nwhen compiling with Visual C++.</li>\n</ul>\n</blockquote>\n<p>2001-10-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Color.h (scaleQuantumToDouble): Add polymorphic\nversion that accepts double to avoid downconversion error.</li>\n</ul>\n</blockquote>\n<p>2001-10-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Color.h (scaleQuantumToDouble): Cast Quantum to\ndouble prior to division.  Hopefully fix bug.</li>\n</ul>\n</blockquote>\n<p>2001-10-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Color.h (Color(const std::string)): Pass argument by reference.</li>\n<li>(operator=): Pass argument by const reference.</li>\n</ul>\n</blockquote>\n<p>2001-09-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (coderInfoList): New function to support\nobtaining format coder information (as a list of type CoderInfo).</li>\n<li>lib/CoderInfo.cpp (CoderInfo): New class to support obtaining\nformat coder information.</li>\n</ul>\n</blockquote>\n<p>2001-09-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (depth): Use GetImageDepth and SetImageDepth\nrather than just getting/setting depth attributes.</li>\n<li>lib/Magick++/STL.h (opacityImage): New unary function object to\nset, or attenuate, image pixel opacity throughout the image.</li>\n<li>lib/Image.cpp (opacity): New method to set, or attenuate, image\npixel opacity throughout the image.</li>\n<li>lib/Magick++/STL.h (typeImage): New unary function object to set\nimage type.</li>\n<li>lib/Image.cpp (type): Added ability to set image type.</li>\n</ul>\n</blockquote>\n<p>2001-09-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (write(Blob)): Tell blob to use malloc allocator.</li>\n<li>lib/Blob.cpp (updateNoCopy): Added parameter so that user can\nspecify the allocation system (malloc or new) the memory came\nfrom.  Defaults to C++ memory allocator.</li>\n</ul>\n</blockquote>\n<p>2001-09-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (fileSize): Decided to change return type to off_t\nfor increased range and portability.</li>\n</ul>\n</blockquote>\n<p>2001-09-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (fileSize): Changed return value to double.</li>\n</ul>\n</blockquote>\n<p>2001-09-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (colorMap): Allocate a colormap if it does not\nalready exist.</li>\n<li>lib/Pixels.cpp (indexes): Don't attempt to validate image type.</li>\n<li>lib/Image.cpp (colorMap): Optimized more for performance.</li>\n</ul>\n</blockquote>\n<p>2001-09-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (fontTypeMetrics): New method to support\nretrieving font metrics.</li>\n<li>lib/TypeMetric.cpp : New class to support font metrics\ninformation.</li>\n</ul>\n</blockquote>\n<p>2001-09-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Color.h (scaleDoubleToQuantum): Inline static\nmethod made from previous ScaleDoubleToQuantum #define.\n(scaleQuantumToDouble): Inline static method made from previous\nScaleQuantumToDouble #define. Helps avoid possibility of clash\nwith user code.</li>\n</ul>\n</blockquote>\n<p>2001-08-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (colorMap): Automatically extend colormap if\nspecified index is past end of current colormap.  Colormap is\nlimited to a maximum depth of MaxRGB entries.</li>\n</ul>\n</blockquote>\n<p>2001-08-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (clipMask): New method to add a clip mask to the\nimage.  Adds clipping to any image operation wherever the clip\nmask image is tranparent.</li>\n</ul>\n</blockquote>\n<p>2001-08-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (print): Add single quotes around file names\nand font specifications.</li>\n</ul>\n</blockquote>\n<p>2001-07-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (read): Ensure that only a single image frame is\nread.</li>\n</ul>\n</blockquote>\n<p>2001-07-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (flattenImages): New function to flatten a\nlayered image.</li>\n<li>lib/Montage.cpp (Montage): Montage initial defaults are no\nlonger drawn from ImageInfo.  MontageInfo structure is entirely\nfilled out by updateMontageInfo();</li>\n</ul>\n</blockquote>\n<p>2001-07-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Montage.cpp (updateMontageInfo): Bugfix; colors which were\nintentionally specified as invalid (unset) were being ignored.\nThis produced unattractive label text when doing a montage.</li>\n</ul>\n</blockquote>\n<p>2001-07-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (medianFilterImage): Changed argument from\nunsigned int to const double.\n(fillColorImage): New method.\n(strokeColorImage): New method.\n(isValidImage): New method.</li>\n<li>lib/Magick++/Image.h (edge): Change argument from unsigned int\nto double.\n(medianFilter): Changed argument from unsigned int to const\ndouble.</li>\n<li>lib/Magick++/STL.h (edgeImage): Change argument from unsigned\nint to double.</li>\n<li>demo/demo.cpp (main): Updated to match PerlMagick demo.</li>\n</ul>\n</blockquote>\n<p>2001-06-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (shaveImage): New function to shave edges\nfrom image.</li>\n<li>lib/Image.cpp (shave): New method to shave edges from image.</li>\n</ul>\n</blockquote>\n<p>2001-06-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (quantize): Remove conditions on whether\nquantization should be done.  Now quantization is always done.</li>\n</ul>\n</blockquote>\n<p>2001-06-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Image.h (blur,charcoal,emboss,sharpen): Changed\nradius and sigma parameters to match current ImageMagick defaults.</li>\n</ul>\n</blockquote>\n<p>2001-02-22  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Options.cpp (updateDrawInfo): The updateDrawInfo() method\nwas no longer needed.  Due to ImageMagick changes, calling it was\ncausing some options to be lost.</li>\n</ul>\n</blockquote>\n<p>2001-01-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (fillRule): New method to specify the rule to use\nwhen filling drawn objects.</li>\n</ul>\n</blockquote>\n<p>2001-01-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (erase): New method to reset image to background\ncolor.\n(strokeAntiAlias): New method to control antialiasing of stroked\nobjects.</li>\n</ul>\n</blockquote>\n<p>2001-01-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (channel): Renamed method from 'layer' to match\nequivalent change in ImageMagick (ChannelImage).  Enumeration\nnames *Layer renamed to *Channel.</li>\n</ul>\n</blockquote>\n<p>2001-01-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Montage.h (strokeColor): New method.\n(fillColor): New method.</li>\n<li>lib/Image.cpp (replaceImage): Revised logic so that an inValid\nimage should be returned if a NULL pointer is passed.  Before this\nchange the existing image was preserved.\n(label): Work-around ImageMagick SetImageAttribute bug.</li>\n</ul>\n</blockquote>\n<p>2001-01-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp : Adjusted to ImageMagick animation parameter API\nchange.</li>\n</ul>\n</blockquote>\n<p>2000-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableCompositeImage): Support specifying\ncomposition rule.</li>\n</ul>\n</blockquote>\n<p>2000-12-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (draw): Bugfix - the primitive string was not\nproperly null terminated. It is a wonder that the code usually\nworked at all.  Thanks to <a class=\"reference external\" href=\"mailto:afatela&#37;&#52;&#48;marktest&#46;pt\">afatela<span>&#64;</span>marktest<span>&#46;</span>pt</a> for reporting it.</li>\n</ul>\n</blockquote>\n<p>2000-12-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (deconstructImages): New STL function for\ndeconstructing an image list to assist with creating an animation.\n(mosaicImages): New STL function for inlaying an image list to\nform a single coherent picture.</li>\n</ul>\n</blockquote>\n<p>2000-12-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (convolve): New method to convolve image using\nuser-supplied convolution matrix.\n(unsharpmask): New method to replace image with a sharpened\nversion of the original image using the unsharp mask algorithm.</li>\n</ul>\n</blockquote>\n<p>2000-12-14  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>: Adapted to ImageMagick API change which eliminates\nAnnotateInfo.</li>\n</ul>\n</blockquote>\n<p>2000-12-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (annotateImage): Brought into sync with\nannotate methods in Image.</li>\n</ul>\n</blockquote>\n<p>2000-12-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (annotate): Usage of Geometry parameter was\nincorrect. Geometry parameter is used to specify bounding\narea. This changes the interpretation for two of the annotate\nmethods (which probably weren't usable before).</li>\n</ul>\n</blockquote>\n<p>2000-11-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Color.h (alphaQuantum): Bugfix.  Due to change in\ntreatment of opacity member, alphaQuantum() was not allowing value\nto be set.</li>\n</ul>\n</blockquote>\n<p>2000-11-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableFillRule): New class to specify fill\nrule (see SVG's fill-rule).\n(DrawableDashOffset): New class to specify initial offset in dash\narray.\n(DrawableDashArray): New class to specify a stroke dash pattern.\n(DrawableStrokeLineCap): New class to specify the shape to be used\nat the end of open subpaths when they are stroked.\n(DrawableStrokeLineJoin): New class to specify the shape to be\nused at the corners of paths (or other vector shapes) when they\nare stroked.\n(DrawableMiterLimit): New class to specify extension limit for\nmiter joins.</li>\n</ul>\n</blockquote>\n<p>2000-11-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (annotate): Reimplement text rotation using affine\nmember of AnnotateInfo.\n(strokeDashOffset): New method for specifying the dash offset to\nuse for drawing vector objects. Similar to SVG stroke-dashoffset.\n(strokeDashArray): New method for specifying the dash pattern to\nuse for drawing vector objects.  Similar to SVG stroke-dasharray\n(strokeLineCap): New method to specify the shape to be used at the\nend of open subpaths when they are stroked. Similar to SVG\nstroke-linecap.\n(strokLineJoin): New method to specify the shape to be used at the\ncorners of paths (or other vector shapes) when they are\nstroked. Similar to SVG stroke-linejoin.\n(strokeMiterLimit): New method to specify the miter limit when\njoining lines using MiterJoin. Similar to SVG stroke-miterlimit.\n(strokeWidth): Renamed lineWidth method to strokeWidth.</li>\n</ul>\n</blockquote>\n<p>2000-10-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Drawable.h (DrawableCompositeImage): Add a\nshort-form constructor to support specifying image location and\nname, but without specifying rendered size (use existing image\nsize).</li>\n</ul>\n</blockquote>\n<p>2000-10-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Drawable.h (DrawablePopGraphicContext): New class\nto pop graphic context.\n(DrawablePushGraphicContext): New class to push graphic context.</li>\n<li>lib/Drawable.cpp (DrawableStrokeAntialias): New class to set\nstroke antialiasing.\n(DrawableTextAntialias): New class to set text antialiasing.</li>\n</ul>\n</blockquote>\n<p>2000-10-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (transformOrigin): New method to set origin of\ncoordinate system for use when annotating with text or drawing\n(transformRotation): New method to set rotation for use when\nannotating with text or drawing\n(transformScale): New method to set scale for use when annotating\nwith text or drawing.\n(transformSkewX): New method to set skew for use in X axis when\nannotating with text or drawing.\n(transformSkewY): New method to set skew for use in Y axis when\nannotating with text or drawing.\n(transformReset): New method to reset transformation to default.</li>\n<li>lib/Drawable.cpp (DrawablePath): New class for drawing SVG-style\nvector paths.\n(PathArcArgs): New class. Argument for PathArcArgs &amp; PathArcAbs.\n(PathArcAbs): New class. Draw arc using absolute coordinates.\n(PathArcRel): New class. Draw arc using relative coordinates.\n(PathClosePath): New class. Close drawing path.\n(PathCurvetoArgs): New class. Argument class for PathCurvetoAbs &amp;\nPathCurvetoRel.\n(PathCurvetoAbs): New class. Cubic bezier, absolute coordinates\n(PathCurvetoRel): New class. Cubic bezier, relative coordinates\n(PathSmoothCurvetoAbs): New class. Cubic bezier, absolute\ncoordinates\n(PathSmoothCurvetoRel): New class. Cubic bezier, relative\ncoordinates\n(PathQuadraticCurvetoArgs): New class. Argument class for\nPathQuadraticCurvetoAbs and PathQuadraticCurvetoRel.\n(PathQuadraticCurvetoAbs): New class. Quadratic bezier, absolute\ncoordinates\n(PathQuadraticCurvetoRel): New class. Quadratic bezier, relative\ncoordinates\n(PathSmoothQuadraticCurvetoAbs): New class. Quadratic bezier,\nabsolute coordinates\n(PathSmoothQuadraticCurvetoRel): New class. Quadratic bezier,\nrelative coordinates\n(PathLinetoAbs): New class. Line to, absolute coordinates\n(PathLinetoRel): New class. Line to, relative coordinates\n(PathLinetoHorizontalAbs): New class. Horizontal lineto, absolute\ncoordinates\n(PathLinetoHorizontalRel): New class. Horizontal lineto, relative\ncoordinates\n(PathLinetoVerticalAbs): New class. Veritical lineto, absolute\ncoordinates.\n(PathLinetoVerticalRel): New class. Vertical lineto, relative\ncoordinates.\n(PathMovetoAbs): New class. Moveto, absolute coordinates\n(PathMovetoRel): New class. Moveto, relative coordinates</li>\n</ul>\n</blockquote>\n<p>2000-10-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableSkewX): New object to apply skew in X\ndirection.\n(DrawableSkewY): New object to apply skew in Y direction.</li>\n</ul>\n</blockquote>\n<p>2000-10-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (edge): Change argument from 'unsigned int' to\n'double' in order to match ImageMagick API.</li>\n</ul>\n</blockquote>\n<p>2000-10-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableCompositeImage): Renamed from\nDrawableImage.\n(DrawableTextDecoration): Renamed form DrawableDecoration.\n(all-classes): Complete re-write to write the drawing command to a\nstream when draw() is invoked rather than at object construction\ntime. This may be somewhat slower for individual draw operations\nbut but should be at least as fast for lists of drawing commands,\nand is more flexible going into the future. Drawable classes now\ninherit from DrawableBase but are passed into STL lists and Image\ndraw() methods via the surrogate class Drawable.  The upshot of\nall this is that the existing published API has not been altered\nbut things work much differently under the covers.</li>\n</ul>\n</blockquote>\n<p>2000-10-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableStrokeColor): Renamed from\nDrawableStroke\n(DrawableFillColor): Renamed from DrawableFill\n(DrawableRotation): New class to influence object rotation.\n(DrawableScaling): New class to influence object scaling.\n(DrawableTranslation): New class to influence object translation.</li>\n</ul>\n</blockquote>\n<p>2000-10-04  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableAffine): New class to influence object\nscaling, rotation, and translation (as defined by SVG XML).\n(DrawableAngle): New class to influence drawing angle.\n(DrawableDecoration): New class to influence text decoration such\nas underline.\n(DrawableFill): New class to set object filling color.\n(DrawableFillOpacity): New class to set opacity to use when\nfilling object.\n(DrawableFont::): New class to set font.\n(DrawableGravity): New class to set text placement gravity.\n(DrawablePointSize): New class to set font point size.\n(DrawableStroke): New class to set drawing stroke color.\n(DrawableStrokeOpacity): New class to set drawing stroke opacity.\n(DrawableStrokeWidth): New class to set drawing stroke width.</li>\n</ul>\n</blockquote>\n<p>2000-10-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableImage): Added width and height\nparameters to specify size to scale rendered image to.  This is\nactually a bug-fix since it seems that the correct drawing command\nwas no longer being generated.</li>\n</ul>\n</blockquote>\n<p>2000-09-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (read): New overloaded method to read an image\nbased on an array of raw pixels, of specified type and mapping, in\nmemory.\n(write): New overloaded method to write image to an array of\npixels, of specified type and mapping.\n(Image): New overloaded constructor to construct an image based on\nan array of raw pixels, of specified type and mapping, in memory.</li>\n</ul>\n</blockquote>\n<p>2000-09-27  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (colorize): API change to match change in\nImageMagick.  Now accepts percentage of red, green, and blue to\ncolorize with using specified pen color.</li>\n</ul>\n</blockquote>\n<p>2000-09-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Drawable.h: Reverted Coordinate implemenation back\nfrom and STL pair based implementation to a simple class.  Maybe\nthis will improve portability.  It is more understandable anyway.</li>\n</ul>\n</blockquote>\n<p>2000-09-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Options.cpp : Bugfix.  Some DrawInfo attributes were not\nbeing updated.  This lead to options like fontPointsize not\nchanging the font.</li>\n</ul>\n</blockquote>\n<p>2000-08-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (blurImage, charcoalImage, embossImage,\nsharpenImage): Expand order_ argument to radius_ &amp; sigma_\narguments for more control (matches ImageMagick API change).</li>\n<li>lib/Image.cpp (blur, charcoal, emboss, sharpen): Expand order_\nargument to radius_ &amp; sigma_ arguments for more control (matches\nImageMagick API change).</li>\n</ul>\n</blockquote>\n<p>2000-08-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (read): Check returned Image for embedded\nexception, as well as the existing parameter check.  This fixes\nthe bug that warnings are not reported.</li>\n</ul>\n</blockquote>\n<p>2000-07-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>test/*.cpp demo/*.cpp: Added call to MagickIncarnate() to set\nImageMagick install location for Windows.  Hopefully this hack can\nbe removed someday.</li>\n</ul>\n</blockquote>\n<p>2000-07-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (colorFuzz): Changed type to 'double' from\n'unsigned int' to match change in ImageMagick.</li>\n<li>lib/Color.cpp (Color*): Added copy constructor from base class.\n(operator =): Added assignment operator from base class.</li>\n</ul>\n</blockquote>\n<p>2000-06-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h : Changed enumeration FilterType to\nFilterTypes, and QuantumTypes to QuantumType in order to match\nlast-minute API change in ImageMagick.</li>\n</ul>\n</blockquote>\n<p>2000-06-22  Bob Friesenhahn &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Pixels.cpp (indexes): Bugfix, use\nGetCacheViewIndexes() rather than GetIndexes().</li>\n</ul>\n</blockquote>\n<p>2000-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Montage.h (gravity): Type of gravity_ argument, and\nreturn value changed from 'unsigned int' to GravityType.</li>\n</ul>\n</blockquote>\n<p>2000-04-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (DrawableArc, DrawableBezier, DrawablePolyline,\nRoundRectangle): Added support for new drawing objects.</li>\n</ul>\n</blockquote>\n<p>2000-04-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp: Removed all public methods which accept\nCoordinate arguments except those that accept lists of\nCoordinates.  Converted remaining drawable object methods into\nindividual classes which inherit from Drawable (e.g. &quot;circle&quot;\nbecomes &quot;DrawableCircle&quot;). The constructor for each class is\ncompatible with the original method. This results in annoying\nchanges to user code but provides more implementation flexibility.</li>\n</ul>\n</blockquote>\n<p>2000-04-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp\n(fillEllipse,fillRectangle,fillCircle,fillPolygon): Removed\nmethods.  Object filling is now based on whether fillColor or\npenTexture are valid or not.  This reflects ImageMagick internal\nchanges.</li>\n<li>lib/Image.cpp (fillColor): New method to specify fill color when\ndrawing objects.\n(strokeColor): New method to specify outline color when drawing\nobjects.\n(penColor): Setting penColor now sets fillColor and\nstrokeColor. Getting penColor retrieves the value of\nstrokeColor. This supports backwards compatability.</li>\n</ul>\n</blockquote>\n<p>2000-03-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (lineWidth): Type changed from unsigned int to\ndouble.</li>\n</ul>\n</blockquote>\n<p>2000-03-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (Magick):</li>\n</ul>\n</blockquote>\n<p>2000-03-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h\n(blurImage,charcoalImage,edgeImage,embossImage,\nreduceNoiseImage,sharpenImage): Modified to support order of the\npixel neighborhood. Backward compatable function objects\nconstructors are provided for embossImage, and reduceNoiseImage.</li>\n<li>lib/Image.cpp (blur,charcoal,edge,emboss,reduceNoise,sharpen):\nNow accept unsigned int argument which represents the order of the\npixel neighborhood (e.g. 3).  This is not a backwards compatable\nchange, however, backward compatable methods are provided for\nemboss, and reduceNoise.</li>\n</ul>\n</blockquote>\n<p>2000-03-02  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Pixels.h (Pixels): Moved Image pixel methods to\nPixels class.</li>\n</ul>\n</blockquote>\n<p>2000-02-29  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (annotate): Re-wrote to improve performance.\n(draw): Re-wrote to improve performance.</li>\n</ul>\n</blockquote>\n<p>2000-02-26  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Drawable.cpp (text): Bugfix: support spaces in annotation\ntext.</li>\n</ul>\n</blockquote>\n<p>2000-02-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (gaussianBlurImage): New function object to\nGaussian blur image.</li>\n<li>lib/Image.cpp (gaussianBlur): New method to Gaussian blur image.</li>\n</ul>\n</blockquote>\n<p>2000-02-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp : Call-back based LastError class is eliminated in\nfavor of ImageMagick 5.2's re-entrant ExceptionInfo reporting.\nThis should make Magick++ thread safe under Win32.</li>\n</ul>\n</blockquote>\n<p>2000-02-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (floodFillTexture): Fixed bug due to pixel pointer\nbecoming invalid in ImageMagick function.</li>\n</ul>\n</blockquote>\n<p>2000-01-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp : Added locking to reference counting to ensure\nthread (pthread) safety.</li>\n<li>lib/Blob.cpp : Added locking to reference counting to ensure\nthread (pthread) safety.</li>\n<li>lib/LastError.cpp: Added support for thread specific data\n(pthreads) so that error reporting is thread safe.</li>\n<li>lib/Magick++/Thread.h: Added thread wrapper class to provide\nthread-safe locking (pthreads) to Magick++.</li>\n</ul>\n</blockquote>\n<p>2000-01-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp: Added methods getPixels, setPixels, syncPixels,\nreadPixels, and writePixels, in order to provide low-level access\nto Image pixels.  This approach (direct wrapper around ImageMagick\nfunctions) does not mean that the planned object-oriented wrapper\nhas been forgotten, only that this wrapper is not ready yet, and\nusers need to manipulate pixels *now*.</li>\n</ul>\n</blockquote>\n<p>2000-01-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/LastError.cpp: Complete re-implementation of LastError so\nthat it hides its implementation.  Also assures that all memory is\nexplicitly deallocated at program exit to avoid the appearance of\na leak.</li>\n</ul>\n</blockquote>\n<p>2000-01-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (size): Bug-fix. Set image columns and rows as\nwell as image options columns and rows.</li>\n<li>lib/Image.cpp :Depth parameters are now all unsigned in for\nconsistency.</li>\n<li>lib/Image.cpp (write): Parameters for writing Blobs re-arranged\nagain to hopefully be more sensible.</li>\n<li>lib/Magick++/STL.h: Bug-fix. Re-number scenes from zero when\nlinking image range in container into a list. This provides\nexpected results.</li>\n</ul>\n</blockquote>\n<p>1999-12-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp\n(write): Additional overloaded methods for BLOBs.\n(read): Additional overloaded methods for BLOBs. Re-ordered\nparameters for one existing method.\n(Image): Additional overloaded methods for BLOBs.  Re-ordered\nparameters for one existing method.</li>\n</ul>\n</blockquote>\n<p>1999-12-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (floodFillTexture): Changed coordinates to\nunsigned.</li>\n</ul>\n</blockquote>\n<p>1999-12-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (medianFilter): New method.</li>\n</ul>\n</blockquote>\n<p>1999-12-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (density): Bug fix. Was not setting image x &amp; y\ndensity.</li>\n</ul>\n</blockquote>\n<p>1999-11-30  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (page): psPageSize() is renamed to page() and now\nproperly returns the attribute from the image.</li>\n</ul>\n</blockquote>\n<p>1999-11-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp: Rename transformColorSpace() to colorSpace().\nAdded colorSpace() accessor method.</li>\n</ul>\n</blockquote>\n<p>1999-11-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Color.cpp: Re-implemented PixelPacket pointer so that it is\nnever NULL and added a 'valid' field for tracking object validity.</li>\n</ul>\n</blockquote>\n<p>1999-11-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (quantizeError): Eliminated method.</li>\n</ul>\n</blockquote>\n<p>1999-11-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (annotate &amp; draw): Changed implementation to\nreflect change to the way AnnotateInfo is managed by ImageMagick.</li>\n</ul>\n</blockquote>\n<p>1999-11-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (cacheThreshold): New method to set the pixel\ncache threshold.</li>\n<li>lib/Magick++/Include.h (Magick): Added new enumerations from\nclassify.h.</li>\n</ul>\n</blockquote>\n<p>1999-10-28  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Options.h (fontPointsize): Argument is now a double\nto match change in ImageMagick.</li>\n<li>lib/Image.cpp (fontPointsize): Argument is now a double to match\nchange in ImageMagick.</li>\n</ul>\n</blockquote>\n<p>1999-10-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Blob.cpp (BlobRef): Bugfix -- start blob reference count at\none rather than zero.</li>\n</ul>\n</blockquote>\n<p>1999-10-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (Image): Fixed Image constructors from Blob.  The\nimage reference was not being instantiated as it should have been,\ncausing a crash.</li>\n</ul>\n</blockquote>\n<p>1999-10-05  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Blob.cpp: All blob length parameters are now of type size_t.</li>\n<li>lib/Image.cpp (write): Length estimate is now of type size_t.</li>\n</ul>\n</blockquote>\n<p>1999-09-20  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (rotate): No longer accepts a crop option since\nImageMagick no longer supports this.\n(shear): No longer accepts a crop option since ImageMagick no\nlonger supports this.</li>\n</ul>\n</blockquote>\n<p>1999-09-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp:\n(rotate): No longer accepts sharpen argument.  User must sharpen\nseperately if desired.  This change is due to a similar change in\nImageMagick 5.0.\n(condense): Removed method.\n(uncondense): Removed method.\n(condensed): Removed method.\n(pixelColor): Adapted to 5.0.</li>\n<li>lib/Magick++/Color.h : Rewrote to efficiently use ImageMagick\n5.0's PixelPacket color representation.</li>\n<li>lib/Color.cpp : Rewrote to efficiently use ImageMagick 5.0's\nPixelPacket color representation.</li>\n</ul>\n</blockquote>\n<p>1999-09-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (condensed): Bug fix.  The condensed() method was\nreturning the opposite bool value than it should.  Oops!</li>\n</ul>\n</blockquote>\n<p>1999-09-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Include.h (MagickLib): Eliminated requirement for\nincluding &lt;magick/define.h&gt;.</li>\n</ul>\n</blockquote>\n<p>1999-08-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp: Added accessor methods for other key ImageMagick\nstructs.</li>\n<li>lib/Options.cpp (penTexture): Fixed bug with removing texture\ncaused by change in Image constructor.</li>\n<li>lib/Image.cpp: Changed strategy such that an Image containing a\nnull MagickLib::Image pointer is never constructed except for\nunder error conditions.  Removed existing checks for null image\npointer on attribute methods.\nUse image() and constImage() accessor methods as part of Image\nimplementation in order to clean-up code and ensure\nconst-correctness.</li>\n</ul>\n</blockquote>\n<p>1999-08-03  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/STL.h (Magick): Added STL function readImages().\nNot tested yet.\n(Magick): Added STL function writeImages(). Not tested yet.</li>\n<li>lib/Image.cpp: Removed support for 'text' attribute as this is\nno longer present in ImageMagick as of 4.2.8.</li>\n</ul>\n</blockquote>\n<p>1999-07-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Image.cpp (condense): Skip condensing image if already\ncondensed.\n(uncondense): Skip uncondensing image if not condensed.\n(condensed): New method to test if image is condensed.\n(classType): New method which supports conversion of the image\nstorage class. May result in loss of color information\n(quantization is used) if a DirectClass image is converted to\nPseudoClass.</li>\n</ul>\n</blockquote>\n<p>1999-07-18  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Magick++/Color.h (Magick::Color): Color parameters are now\nstored in a MagickLib::RunlengthPacket structure which is\nreferenced via a pointer.  This structure is either allocated by a\nMagick::Color constructor or passed as an argument to a\nMagick::Color constructor so that it may refer to to a\nMagickLib::Image pixel. The owner of the structure is managed so\nthat the structure is only deleted if it was allocated by\nMagick::Color.</li>\n</ul>\n</blockquote>\n<p>1999-07-09  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>overall : Removed 'Magick' prefix from all source file\nnames. Moved class headers to Magick++ subdirectory.  This should\nnot break any code using the documented interface (via\nMagick++.h).</li>\n</ul>\n</blockquote>\n<p>1999-07-08  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickImage.cpp (composite): Support composition placement\nby gravity like PerlMagick does.</li>\n</ul>\n</blockquote>\n<p>1999-07-07  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickImage.cpp (Image): Added constructors to construct an\nImage from a BLOB.</li>\n</ul>\n</blockquote>\n<p>1999-07-06  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/manipulate.cpp (main): Wrote a basic sanity test for\nreading and writing BLOBS.</li>\n</ul>\n</blockquote>\n<p>1999-06-21  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickImage.cpp (read): Added support for reading an encoded\nimage stored in a BLOB.  Uses new ImageMagick APIs introduced on\nJuly 21, 1999.\n(write): Added support for writing an encoded image to a BLOB.</li>\n</ul>\n</blockquote>\n<p>1999-06-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickInclude.h : Use new &lt;magick/api.h&gt; interface to\nImageMagick to avoid namespace-induced problems.</li>\n<li>configure.in : CPPFLAGS and LDFLAGS specified via the\nenvironment take precidence over flags from Magick-config.</li>\n</ul>\n</blockquote>\n<p>1999-05-31  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickSTL.h (mapImages): New algorithm to map the sequence\nof images to the color map of a provided image.\n(quantizeImages): New algorithm to quantize a sequence of images\nto a common color map.</li>\n</ul>\n</blockquote>\n<p>1999-05-24  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickBlob.cpp (updateNoCopy): New method to allow derived\nclasses to insert data into the base class without making a copy\nof the data. This represents a transfer of ownership of the data\nfrom the derived class to the base class.</li>\n</ul>\n</blockquote>\n<p>1999-05-23  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickColor.cpp (operator =): Adapted to new ImageMagick\n4.2.6 as of 5/23/99 which removes X11 compatability functions.</li>\n<li>lib/MagickGeometry.cpp (operator =): Adapted to new ImageMagick\n4.2.6 as of 5/23/99 which removes X11 compatability functions.</li>\n</ul>\n</blockquote>\n<p>1999-05-17  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickBlob.cpp (Blob): Support default constructor for Blob.</li>\n</ul>\n</blockquote>\n<p>1999-05-16  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickSTL.h (transformColorSpaceImage): New unary function\nobject to invoke transformColorSpace on STL container object.</li>\n<li>lib/MagickImage.cpp (transformColorSpace): New method to\ntransform the image data to a new colorspace.</li>\n</ul>\n</blockquote>\n<p>1999-05-15  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickImage.cpp (ping): Re-implemented to match (requested)\nAPI change in ImageMagick 4.2.5. Method signature has changed to\nbe like 'read'.\n(annotate): Added two new overloaded methods for text annotation\nin order to support the new rotated text capability in ImageMagick\n4.2.5.  To accomplish this, the default for gravity had to be\nremoved from several methods. This may impact existing code.\nStill not sure if this is the best set of method signatures.</li>\n</ul>\n</blockquote>\n<p>1999-05-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickImage.cpp (ping): New method to obtain image size in\nbytes and geometry without the overhead of reading the complete\nimage.\n(uncondense): New method to uncompress run-length encoded pixels\ninto a simple array to make them easy to operate on.</li>\n</ul>\n</blockquote>\n<p>1999-05-12  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickImage.cpp (comment): Passing an empty string as the\ncomment results in no comment at all rather than a comment with no\ndata.</li>\n</ul>\n</blockquote>\n<p>1999-05-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickImage.cpp (iccColorProfile): Implemented method to set\nICC color profile from opaque object in memory (must be formatted\noutside of Magick++).\n(iptcProfile): Implemented method to set IPTC profile from opaque\nobject in memory (must be formatted outside of Magick++).</li>\n<li>lib/MagickBlob.cpp: New class to support managing user-supplied\nopaque Binary Large OBjects (BLOBS) in the API. Reference counted\nto improve semantics and to possibly reduce memory consumption.</li>\n</ul>\n</blockquote>\n<p>1999-05-01  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/Makefile.am (libMagick): Updated to use libtool 1.3 so that\nshared library can be built.</li>\n</ul>\n</blockquote>\n<p>1999-04-25  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickImage.cpp (montageGeometry): Return Magick::Geometry\nrather than std::string.</li>\n</ul>\n</blockquote>\n<p>1999-04-19  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickColor.cpp (alpha): Added support for setting alpha via\nscaled-double to the Color class.  The new method name is 'alpha'.</li>\n</ul>\n</blockquote>\n<p>1999-04-13  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>lib/MagickColor.cpp: Added support for setting an alpha value\n(unscaled Quantum only) for use on DirectColor images that have\nmatte enabled.  This requires ImageMagick 4.2.2 dated April 13,\n1999 or later to compile since Cristy added a special flag to\nallow testing to see if the user has specified an opacity value:\n&quot;I added XColorFlags to magick/classify.h.  If DoMatte is set in\ncolor-&gt;flags then the opacity value is valid in color-&gt;pixel.&quot;</li>\n</ul>\n</blockquote>\n<p>1999-04-11  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>demo/flip.cpp (main): New file.  Demonstrates use of flipImage\nfunction object as well as morphImages algorithm.</li>\n</ul>\n</blockquote>\n<p>1999-04-10  Bob Friesenhahn  &lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>\n<blockquote>\n<ul class=\"simple\">\n<li>tests/color.cpp : New file to support testing the Magick::Color\nclasses.</li>\n<li>lib/MagickOptions.cpp: The ImageInfo filter member is now\nignored by ImageMagick (as of ImageMagick 4.2.2 April 10, 1998) so\nsupport for setting it is removed. The Image filter member is\nstill updated. According to Cristy, this ImageMagick version\nremoves automatic sharpening of resized images.  The blur member\nis added to the Image structure. A blur value &lt; 1 causes the image\nto be sharpened when resizing while a value &gt; 1 leaves the image\nblurry.  Magick++ does not yet support the blur member.</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/CoderInfo.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::CoderInfo Class</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-coderinfo-class\">\n<h1 class=\"title\">Magick::CoderInfo Class</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The CoderInfo class supports obtaining information about\nGraphicsMagick support for an image format (designated by a magick\nstring). It may be used to provide support for a specific named format\n(provided as an argument to the constructor), or as an element of a\ncontainer when format support is queried using the coderInfoList()\ntemplated function.</p>\n<p>The following code fragment illustrates how CoderInfo may be used:</p>\n<pre class=\"literal-block\">\nCoderInfo info(&quot;GIF&quot;);\ncout &lt;&lt; info-&gt;name() &lt;&lt; &quot;: (&quot; &lt;&lt; info-&gt;description() &lt;&lt; &quot;) : &quot;;\ncout &lt;&lt; &quot;Readable = &quot;;\nif ( info-&gt;isReadable() )\n  cout &lt;&lt; &quot;true&quot;;\nelse\n  cout &lt;&lt; &quot;false&quot;;\ncout &lt;&lt; &quot;, &quot;;\ncout &lt;&lt; &quot;Writable = &quot;;\nif ( info-&gt;isWritable() )\n  cout &lt;&lt; &quot;true&quot;;\nelse\n  cout &lt;&lt; &quot;false&quot;;\ncout &lt;&lt; &quot;, &quot;;\ncout &lt;&lt; &quot;Multiframe = &quot;;\nif ( info-&gt;isMultiframe() )\n  cout &lt;&lt; &quot;true&quot;;\nelse\n  cout &lt;&lt; &quot;false&quot;;\ncout &lt;&lt; endl;\n</pre>\n<p>The definition of class 'Magick::CoderInfo' is:</p>\n<pre class=\"literal-block\">\nnamespace Magick\n{\n  class MagickDLLDecl CoderInfo\n  {\n  public:\n\n    enum MatchType {\n      AnyMatch,       // match any coder\n      TrueMatch,      // match coder if true\n      FalseMatch      // match coder if false\n    };\n\n    // Default constructor\n    CoderInfo ( void );\n\n    // Copy constructor\n    CoderInfo ( const CoderInfo &amp;coder_ );\n\n    // Construct with coder name\n    CoderInfo ( const std::string &amp;name_ );\n\n    // Destructor\n    ~CoderInfo ( void );\n\n    // Format name\n    std::string name( void ) const;\n\n    // Format description\n    std::string description( void ) const;\n\n    // Format is readable\n    bool isReadable( void ) const;\n\n    // Format is writeable\n    bool isWritable( void ) const;\n\n    // Format supports multiple frames\n    bool isMultiFrame( void ) const;\n\n    // Assignment operator\n    CoderInfo&amp; operator= (const CoderInfo &amp;coder_ );\n\n  };\n}\n</pre>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/Color.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::Color Class</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-color-class\">\n<h1 class=\"title\">Magick::Color Class</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>Color is the base color class in Magick++. It is a simple container\nclass for the pixel red, green, blue, and alpha values scaled to fit\nGraphicsMagick's Quantum (number of bits in a color component value)\nsize. Normally users will instantiate a class derived from Color which\nsupports the color model that fits the needs of the application. The\nColor class may be constructed directly from an X11-style color\nstring. As a perhaps odd design decision, the value transparent black\nis considered to represent an unset value (invalid color) in many\ncases. This choice was made since it avoided using more memory. The\ndefault Color constructor constructs an invalid color\n(i.e. transparent black) and may be used as a parameter in order to\nremove a color setting.</p>\n<div class=\"section\" id=\"quantum\">\n<h1>Quantum</h1>\n<p>The base type used to represent color samples in GraphicsMagick is the\nQuantum type. Pixels are represented by a structure of Quantum\nvalues. For example, an RGB pixel contains red, green, and blue\nquantums, while an RGBA pixel contains red, green, blue, and opacity\nquantums. The maximum value that a Quantum can attain is specified by\na constant value represented by the MaxRGB define, which is itself\ndetermined by the number of bits in a Quantum. The QuantumDepth build\noption determines the number of bits in a Quantum.</p>\n</div>\n<div class=\"section\" id=\"pixelpacket\">\n<h1>PixelPacket</h1>\n<p>PixelPacket is the internal representation of a pixel in\nGraphicsMagick. GraphicsMagick may be compiled to support 32, 64, or\n128 bit pixels of type PixelPacket. This is controlled by the value of\nthe QuantumDepth define. The default is 32 bit pixels\n(QuantumDepth=8), which provides the best performance and the least\nresource consumption. If additional color precision or range is\ndesired, then GraphicsMagick may be compiled with QuantumDepth=16 or\nQuantumDepth=32. The following table shows the relationship between\nQuantumDepth, the type of Quantum, and the overall PixelPacket size:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Effect Of QuantumDepth Values</caption>\n<colgroup>\n<col width=\"28%\" />\n<col width=\"35%\" />\n<col width=\"37%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">QuantumDepth</th>\n<th class=\"head\">Quantum Typedef</th>\n<th class=\"head\">PixelPacket Size</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>8</td>\n<td>unsigned char</td>\n<td>32 bits</td>\n</tr>\n<tr><td>16</td>\n<td>unsigned short</td>\n<td>64 bits</td>\n</tr>\n<tr><td>32</td>\n<td>unsigned int</td>\n<td>128 bits</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"color-class\">\n<h1>Color Class</h1>\n<p>The Color base class is not intended to be used directly. Normally a\nuser will construct a derived class or inherit from this class. Color\narguments are must be scaled to fit the Quantum size according to the\nrange of MaxRGB. The Color class contains a pointer to a PixelPacket,\nwhich may be allocated by the Color class, or may refer to an existing\npixel in an image.</p>\n<p>An alternate way to construct the class is via an X11-compatible color\nspecification string (e.g. Color(“red”) or Color (“#FF0000”)). Since\nthe class may be constructed from a string, convenient strings may be\npassed in place of an explicit Color object in methods which accept a\nreference to Color. Color may also be converted to a std::string for\nconvenience in user interfaces, and for saving settings to a text\nfile.</p>\n<p>The following is the definition of the Color class:</p>\n<pre class=\"literal-block\">\n// Compare two Color objects regardless of LHS/RHS\nint MagickDLLDecl operator == ( const Magick::Color&amp; left_, const Magick::Color&amp; right_ );\nint MagickDLLDecl operator != ( const Magick::Color&amp; left_, const Magick::Color&amp; right_ );\nint MagickDLLDecl operator &gt;  ( const Magick::Color&amp; left_, const Magick::Color&amp; right_ );\nint MagickDLLDecl operator &lt;  ( const Magick::Color&amp; left_, const Magick::Color&amp; right_ );\nint MagickDLLDecl operator &gt;= ( const Magick::Color&amp; left_, const Magick::Color&amp; right_ );\nint MagickDLLDecl operator &lt;= ( const Magick::Color&amp; left_, const Magick::Color&amp; right_ );\n\n// Base color class stores RGB components scaled to fit Quantum\nclass MagickDLLDecl Color\n{\npublic:\n  Color ( Quantum red_,\n          Quantum green_,\n          Quantum blue_ );\n  Color ( Quantum red_,\n          Quantum green_,\n          Quantum blue_,\n          Quantum alpha_ );\n  Color ( const std::string &amp;x11color_ );\n  Color ( const char * x11color_ );\n  Color ( void );\n  virtual        ~Color ( void );\n  Color ( const Color &amp; color_ );\n\n  // Red color (range 0 to MaxRGB)\n  void           redQuantum ( Quantum red_ );\n  Quantum        redQuantum ( void ) const;\n\n  // Green color (range 0 to MaxRGB)\n  void           greenQuantum ( Quantum green_ );\n  Quantum        greenQuantum ( void ) const;\n\n  // Blue color (range 0 to MaxRGB)\n  void           blueQuantum ( Quantum blue_ );\n  Quantum        blueQuantum ( void ) const;\n\n  // Alpha level (range OpaqueOpacity=0 to TransparentOpacity=MaxRGB)\n  void           alphaQuantum ( Quantum alpha_ );\n  Quantum        alphaQuantum ( void ) const;\n\n  // Scaled (to 1.0) version of alpha for use in sub-classes\n  // (range opaque=0 to transparent=1.0)\n  void           alpha ( double alpha_ );\n  double         alpha ( void ) const;\n\n  // Does object contain valid color?\n  void           isValid ( bool valid_ );\n  bool           isValid ( void ) const;\n\n  // Set color via X11 color specification string\n  const Color&amp; operator= ( const std::string &amp;x11color_ );\n  const Color&amp; operator= ( const char * x11color_ );\n\n  // Assignment operator\n  Color&amp; operator= ( const Color&amp; color_ );\n\n  // Return X11 color specification string\n  /* virtual */ operator std::string() const;\n\n  // Return ImageMagick PixelPacket\n  operator PixelPacket() const;\n\n  // Construct color via ImageMagick PixelPacket\n  Color ( const PixelPacket &amp;color_ );\n\n  // Set color via ImageMagick PixelPacket\n  const Color&amp; operator= ( const PixelPacket &amp;color_ );\n\n};\n</pre>\n</div>\n<div class=\"section\" id=\"color-derived-classes\">\n<h1>Color Derived Classes</h1>\n<p>Available derived color specification classes are shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Color Derived Classes</caption>\n<colgroup>\n<col width=\"14%\" />\n<col width=\"86%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Class</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td><a class=\"reference internal\" href=\"#colorrgb\">ColorRGB</a></td>\n<td>Representation of RGB color with red, green, and blue specified\nas ratios (0 to 1)</td>\n</tr>\n<tr><td><a class=\"reference internal\" href=\"#colorgray\">ColorGray</a></td>\n<td>Representation of grayscale RGB color (equal parts red, green,\nand blue) specified as a ratio (0 to 1)</td>\n</tr>\n<tr><td><a class=\"reference internal\" href=\"#colormono\">ColorMono</a></td>\n<td>Representation of a black/white color (true/false)</td>\n</tr>\n<tr><td><a class=\"reference internal\" href=\"#colorhsl\">ColorHSL</a></td>\n<td>Representation of a color in Hue/Saturation/Luminosity (HSL)\ncolorspace</td>\n</tr>\n<tr><td><a class=\"reference internal\" href=\"#coloryuv\">ColorYUV</a></td>\n<td>Representation of a color in the YUV colorspace</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"colorrgb\">\n<h1>ColorRGB</h1>\n<p>Representation of an RGB color in floating point. All color arguments\nhave a valid range of 0.0 - 1.0. Note that floating point alpha may be\nset via the alpha() method in the Color base class:</p>\n<pre class=\"literal-block\">\nclass ColorRGB : public Color\n{\npublic:\n  ColorRGB ( double red_, double green_, double blue_ );\n  ColorRGB ( void );\n  ColorRGB ( const Color &amp; color_ );\n  /* virtual */  ~ColorRGB ( void );\n\n  void           red ( double red_ );\n  double         red ( void ) const;\n\n  void           green ( double green_ );\n  double         green ( void ) const;\n\n  void           blue ( double blue_ );\n  double         blue ( void ) const;\n\n  // Assignment operator from base class\n  ColorRGB&amp; operator= ( const Color&amp; color_ );\n\nprotected:\n  // Constructor to construct with PixelPacket*\n  ColorRGB ( PixelPacket* rep_, PixelType pixelType_ );\n};\n</pre>\n</div>\n<div class=\"section\" id=\"colorgray\">\n<h1>ColorGray</h1>\n<p>Representation of a floating point grayscale color (in RGB\ncolorspace). Grayscale is simply RGB with equal parts of red, green,\nand blue. All double arguments have a valid range of 0.0 - 1.0:</p>\n<pre class=\"literal-block\">\nclass ColorGray : public Color\n{\npublic:\n  ColorGray ( double shade_ );\n  ColorGray ( void );\n  ColorGray ( const Color &amp; color_ );\n  /* virtual */ ~ColorGray ();\n\n  void           shade ( double shade_ );\n  double         shade ( void ) const;\n\n  // Assignment operator from base class\n  ColorGray&amp; operator= ( const Color&amp; color_ );\n\n};\n</pre>\n</div>\n<div class=\"section\" id=\"colormono\">\n<h1>ColorMono</h1>\n<p>Representation of a black/white pixel (in RGB colorspace). Color\narguments are constrained to 'false' (black pixel) and 'true' (white\npixel):</p>\n<pre class=\"literal-block\">\nclass ColorMono : public Color\n{\npublic:\n  ColorMono ( bool mono_ );\n  ColorMono ( void );\n  ColorMono ( const Color &amp; color_ );\n  /* virtual */ ~ColorMono ();\n\n  void           mono ( bool mono_ );\n  bool           mono ( void ) const;\n\n  // Assignment operator from base class\n  ColorMono&amp; operator= ( const Color&amp; color_ );\n\n};\n</pre>\n</div>\n<div class=\"section\" id=\"colorhsl\">\n<h1>ColorHSL</h1>\n<p>Representation of a color in Hue/Saturation/Luminosity (HSL) colorspace:</p>\n<pre class=\"literal-block\">\nclass MagickDLLDecl ColorHSL : public Color\n{\npublic:\n  ColorHSL ( double hue_, double saturation_, double luminosity_ );\n  ColorHSL ( void );\n  ColorHSL ( const Color &amp; color_ );\n  /* virtual */  ~ColorHSL ( );\n\n  void           hue ( double hue_ );\n  double         hue ( void ) const;\n\n  void           saturation ( double saturation_ );\n  double         saturation ( void ) const;\n\n  void           luminosity ( double luminosity_ );\n  double         luminosity ( void ) const;\n\n  // Assignment operator from base class\n  ColorHSL&amp; operator= ( const Color&amp; color_ );\n\n};\n</pre>\n</div>\n<div class=\"section\" id=\"coloryuv\">\n<h1>ColorYUV</h1>\n<p>Representation of a color in YUV colorspace (used to encode color for\ntelevision transmission).  Argument ranges are</p>\n<blockquote>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"11%\" />\n<col width=\"89%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Y</td>\n<td>0.0 through 1.0</td>\n</tr>\n<tr><td>U</td>\n<td>-0.5 through 0.5</td>\n</tr>\n<tr><td>V</td>\n<td>-0.5 through 0.5</td>\n</tr>\n</tbody>\n</table>\n</blockquote>\n<pre class=\"literal-block\">\nclass ColorYUV : public Color\n{\npublic:\n  ColorYUV ( double y_, double u_, double v_ );\n  ColorYUV ( void );\n  ColorYUV ( const Color &amp; color_ );\n  /* virtual */ ~ColorYUV ( void );\n\n  void           u ( double u_ );\n  double         u ( void ) const;\n\n  void           v ( double v_ );\n  double         v ( void ) const;\n\n  void           y ( double y_ );\n  double         y ( void ) const;\n\n  // Assignment operator from base class\n  ColorYUV&amp; operator= ( const Color&amp; color_ );\n\n};\n</pre>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/Drawable.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::Drawable</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-drawable\">\n<h1 class=\"title\">Magick::Drawable</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#coordinate-structure\" id=\"id8\">Coordinate structure</a></li>\n<li><a class=\"reference internal\" href=\"#drawable-classes\" id=\"id9\">Drawable classes</a></li>\n<li><a class=\"reference internal\" href=\"#vector-path-classes\" id=\"id10\">Vector Path Classes</a></li>\n</ul>\n</div>\n<p>Drawable provides a convenient interface for preparing vector, image,\nor text arguments for the Image::draw() method. Each instance of a\nDrawable sub-class represents a single drawable object. Drawable\nobjects may be drawn &quot;one-by-one&quot; via multiple invocations of the\nImage <a class=\"reference external\" href=\"Image.html#draw\">draw()</a> method, or may be drawn\n&quot;all-at-once&quot; by passing a list of Drawable objects to the Image\n<a class=\"reference external\" href=\"Image.html#draw\">draw()</a> method. The one-by-one approach is\nconvenient for simple drawings, while the list-based approach is\nappropriate for drawings which require more sophistication.</p>\n<p>The following is an example using the Drawable subclasses with a\none-by-one approach to draw the following figure:</p>\n<img alt=\"Figure showing drawing example\" src=\"Drawable_example_1.png\" style=\"width: 300px; height: 200px;\" />\n<pre class=\"literal-block\">\n#include &lt;string&gt;\n#include &lt;iostream&gt;\n#include &lt;Magick++.h&gt;\n\nusing namespace std;\nusing namespace Magick;\n\nint main(int /*argc*/,char **argv)\n{\n  try {\n    InitializeMagick(*argv);\n\n    // Create base image (white image of 300 by 200 pixels)\n    Image image( Geometry(300,200), Color(&quot;white&quot;) );\n\n    // Set draw options\n    image.strokeColor(&quot;red&quot;); // Outline color\n    image.fillColor(&quot;green&quot;); // Fill color\n    image.strokeWidth(5);\n\n    // Draw a circle\n    image.draw( DrawableCircle(100,100, 50,100) );\n\n    // Draw a rectangle\n    image.draw( DrawableRectangle(200,200, 270,170) );\n\n    // Display the result\n    image.display( );\n  }\n  catch( exception &amp;error_ )\n    {\n      cout &lt;&lt; &quot;Caught exception: &quot; &lt;&lt; error_.what() &lt;&lt; endl;\n      return 1;\n    }\n\n  return 0;\n}\n</pre>\n<p>Since Drawable is an object it may be saved in an array or a list for\nlater (perhaps repeated) use. The following example shows how to draw\nthe same figure using the list-based approach:</p>\n<pre class=\"literal-block\">\n#include &lt;string&gt;\n#include &lt;iostream&gt;\n#include &lt;list&gt;\n#include &lt;Magick++.h&gt;\n\nusing namespace std;\nusing namespace Magick;\n\nint main(int /*argc*/,char **/*argv*/)\n{\n  try {\n\n    InitializeMagick(*argv);\n\n    // Create base image (white image of 300 by 200 pixels)\n    Image image( Geometry(300,200), Color(&quot;white&quot;) );\n\n    // Construct drawing list\n    std::list&lt;Magick::Drawable&gt; drawList;\n\n    // Add some drawing options to drawing list\n    drawList.push_back(DrawableStrokeColor(&quot;red&quot;)); // Outline color\n    drawList.push_back(DrawableStrokeWidth(5)); // Stroke width\n    drawList.push_back(DrawableFillColor(&quot;green&quot;)); // Fill color\n\n    // Add a Circle to drawing list\n    drawList.push_back(DrawableCircle(100,100, 50,100));\n\n    // Add a Rectangle to drawing list\n    drawList.push_back(DrawableRectangle(200,100, 270,170));\n\n    // Draw everything using completed drawing list\n    image.draw(drawList);\n\n    // Display the result\n    image.display( );\n  }\n  catch( exception &amp;error_ )\n    {\n      cout &lt;&lt; &quot;Caught exception: &quot; &lt;&lt; error_.what() &lt;&lt; endl;\n      return 1;\n    }\n\n  return 0;\n}\n</pre>\n<div class=\"section\" id=\"coordinate-structure\">\n<h1><a class=\"toc-backref\" href=\"#id8\">Coordinate structure</a></h1>\n<p>Drawable depends on the simple Coordinate structure which represents a\npair of x,y coodinates. The Coordinate structure is defined as\nfollows:</p>\n<pre class=\"literal-block\">\nclass Coordinate\n{\npublic:\n\n  // Default Constructor\n  Coordinate ( void );\n\n  // Constructor, setting first &amp; second\n  Coordinate ( double x_, double y_ );\n\n  // Destructor\n  virtual ~Coordinate ();\n\n  // x coordinate member\n  void   x ( double x_ );\n  double x ( void ) const;\n\n  // y coordinate member\n  void   y ( double y_ );\n  double y ( void ) const;\n};\n</pre>\n</div>\n<div class=\"section\" id=\"drawable-classes\">\n<h1><a class=\"toc-backref\" href=\"#id9\">Drawable classes</a></h1>\n<p>Drawable classes represent objects to be drawn on the image.</p>\n<div class=\"contents local topic\" id=\"id2\">\n<p class=\"topic-title first\">Drawable classes</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#drawableaffine\" id=\"id11\">DrawableAffine</a></li>\n<li><a class=\"reference internal\" href=\"#drawablearc\" id=\"id12\">DrawableArc</a></li>\n<li><a class=\"reference internal\" href=\"#drawablebezier\" id=\"id13\">DrawableBezier</a></li>\n<li><a class=\"reference internal\" href=\"#drawableclippath\" id=\"id14\">DrawableClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawablecircle\" id=\"id15\">DrawableCircle</a></li>\n<li><a class=\"reference internal\" href=\"#drawablecolor\" id=\"id16\">DrawableColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawablecompositeimage\" id=\"id17\">DrawableCompositeImage</a></li>\n<li><a class=\"reference internal\" href=\"#drawabledasharray\" id=\"id18\">DrawableDashArray</a></li>\n<li><a class=\"reference internal\" href=\"#drawabledashoffset\" id=\"id19\">DrawableDashOffset</a></li>\n<li><a class=\"reference internal\" href=\"#drawableellipse\" id=\"id20\">DrawableEllipse</a></li>\n<li><a class=\"reference internal\" href=\"#drawablefillcolor\" id=\"id21\">DrawableFillColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawablefillrule\" id=\"id22\">DrawableFillRule</a></li>\n<li><a class=\"reference internal\" href=\"#drawablefillopacity\" id=\"id23\">DrawableFillOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawablefont\" id=\"id24\">DrawableFont</a></li>\n<li><a class=\"reference internal\" href=\"#drawablegravity\" id=\"id25\">DrawableGravity</a></li>\n<li><a class=\"reference internal\" href=\"#drawableline\" id=\"id26\">DrawableLine</a></li>\n<li><a class=\"reference internal\" href=\"#drawablematte\" id=\"id27\">DrawableMatte</a></li>\n<li><a class=\"reference internal\" href=\"#drawablemiterlimit\" id=\"id28\">DrawableMiterLimit</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepath\" id=\"id29\">DrawablePath</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepoint\" id=\"id30\">DrawablePoint</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepointsize\" id=\"id31\">DrawablePointSize</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepolygon\" id=\"id32\">DrawablePolygon</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepolyline\" id=\"id33\">DrawablePolyline</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepopclippath\" id=\"id34\">DrawablePopClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepopgraphiccontext\" id=\"id35\">DrawablePopGraphicContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepushclippath\" id=\"id36\">DrawablePushClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepushgraphiccontext\" id=\"id37\">DrawablePushGraphicContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepushpattern\" id=\"id38\">DrawablePushPattern</a></li>\n<li><a class=\"reference internal\" href=\"#drawablepoppattern\" id=\"id39\">DrawablePopPattern</a></li>\n<li><a class=\"reference internal\" href=\"#drawablerectangle\" id=\"id40\">DrawableRectangle</a></li>\n<li><a class=\"reference internal\" href=\"#drawablerotation\" id=\"id41\">DrawableRotation</a></li>\n<li><a class=\"reference internal\" href=\"#drawableroundrectangle\" id=\"id42\">DrawableRoundRectangle</a></li>\n<li><a class=\"reference internal\" href=\"#drawablescaling\" id=\"id43\">DrawableScaling</a></li>\n<li><a class=\"reference internal\" href=\"#drawableskewx\" id=\"id44\">DrawableSkewX</a></li>\n<li><a class=\"reference internal\" href=\"#drawableskewy\" id=\"id45\">DrawableSkewY</a></li>\n<li><a class=\"reference internal\" href=\"#drawablestrokeantialias\" id=\"id46\">DrawableStrokeAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawablestrokecolor\" id=\"id47\">DrawableStrokeColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawablestrokelinecap\" id=\"id48\">DrawableStrokeLineCap</a></li>\n<li><a class=\"reference internal\" href=\"#drawablestrokelinejoin\" id=\"id49\">DrawableStrokeLineJoin</a></li>\n<li><a class=\"reference internal\" href=\"#drawablestrokeopacity\" id=\"id50\">DrawableStrokeOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawablestrokewidth\" id=\"id51\">DrawableStrokeWidth</a></li>\n<li><a class=\"reference internal\" href=\"#drawabletext\" id=\"id52\">DrawableText</a></li>\n<li><a class=\"reference internal\" href=\"#drawabletextantialias\" id=\"id53\">DrawableTextAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawabletextdecoration\" id=\"id54\">DrawableTextDecoration</a></li>\n<li><a class=\"reference internal\" href=\"#drawabletextundercolor\" id=\"id55\">DrawableTextUnderColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawabletranslation\" id=\"id56\">DrawableTranslation</a></li>\n<li><a class=\"reference internal\" href=\"#drawableviewbox\" id=\"id57\">DrawableViewbox</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"drawableaffine\">\n<h2><a class=\"toc-backref\" href=\"#id11\">DrawableAffine</a></h2>\n<p>Specify a transformation matrix to adjust scaling, rotation, and\ntranslation (coordinate transformation) for subsequently drawn objects\nin the same or decendent drawing context.  The <cite>sx_</cite> &amp; <cite>sy_</cite> parameters\nrepresent the x &amp; y scale factors, the <cite>rx_</cite> &amp; <cite>ry_</cite> parameters represent\nthe x &amp; y rotation, and the <cite>tx_</cite> &amp; <cite>ty_</cite> parameters represent the x &amp; y\ntranslation:</p>\n<pre class=\"literal-block\">\nDrawableAffine ( double sx_, double sy_,\n                 double rx_, double ry_,\n                 double tx_, double ty_ );\n</pre>\n<p>Specify a transformation matrix to adjust scaling, rotation, and\ntranslation (coordinate transformation) for subsequently drawn objects\nin the same or decendent drawing context. Initialized to unity (no\neffect) affine values. Use class methods (not currently documented but\ndefined in the Drawable.h header file) to adjust individual parameters\nfrom their unity values:</p>\n<pre class=\"literal-block\">\nDrawableAffine ( void );\n</pre>\n</div>\n<div class=\"section\" id=\"drawablearc\">\n<h2><a class=\"toc-backref\" href=\"#id12\">DrawableArc</a></h2>\n<p>Draw an arc using the stroke color and based on the circle starting at\ncoordinates <cite>startX_</cite>,`startY_`, and ending with coordinates\n<cite>endX_</cite>,`endY_`, and bounded by the rotational arc\n<cite>startDegrees_</cite>,`endDegrees_`:</p>\n<pre class=\"literal-block\">\nDrawableArc ( double startX_, double startY_,\n              double endX_, double endY_,\n              double startDegrees_, double endDegrees_ );\n</pre>\n</div>\n<div class=\"section\" id=\"drawablebezier\">\n<h2><a class=\"toc-backref\" href=\"#id13\">DrawableBezier</a></h2>\n<p>Draw a bezier curve using the stroke color and based on the\ncoordinates specified by the <cite>coordinates_</cite> list:</p>\n<pre class=\"literal-block\">\nDrawableBezier ( const CoordinateList &amp;coordinates_ );\n</pre>\n</div>\n<div class=\"section\" id=\"drawableclippath\">\n<h2><a class=\"toc-backref\" href=\"#id14\">DrawableClipPath</a></h2>\n<p>Select a drawing clip path matching <cite>id_</cite>:</p>\n<pre class=\"literal-block\">\nDrawableClipPath ( const std::string &amp;id_ );\n</pre>\n</div>\n<div class=\"section\" id=\"drawablecircle\">\n<h2><a class=\"toc-backref\" href=\"#id15\">DrawableCircle</a></h2>\n<p>Draw a circle using the stroke color and thickness using specified\norigin and perimeter coordinates. If a fill color is specified, then\nthe object is filled:</p>\n<pre class=\"literal-block\">\nDrawableCircle ( double originX_, double originY_,\n                 double perimX_, double perimY_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablecolor\">\n<h2><a class=\"toc-backref\" href=\"#id16\">DrawableColor</a></h2>\n<p>Color image according to paintMethod. The point method recolors the\ntarget pixel.  The replace method recolors any pixel that matches the\ncolor of the target pixel.  Floodfill recolors any pixel that matches\nthe color of the target pixel and is a neighbor, whereas filltoborder\nrecolors any neighbor pixel that is not the border color. Finally,\nreset recolors all pixels:</p>\n<pre class=\"literal-block\">\nDrawableColor ( double x_, double y_,\n                PaintMethod paintMethod_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablecompositeimage\">\n<h2><a class=\"toc-backref\" href=\"#id17\">DrawableCompositeImage</a></h2>\n<p>Composite current image with contents of specified image, at specified\ncoordinates. If the matte attribute is set to true, then the image\ncomposition will consider an alpha channel, or transparency, present\nin the image file so that non-opaque portions allow part (or all) of\nthe composite image to show through:</p>\n<pre class=\"literal-block\">\nDrawableCompositeImage ( double x_, double y_,\n                         const std::string &amp;filename_ );\nDrawableCompositeImage ( double x_, double y_,\n                         const Image &amp;image_ );\n</pre>\n<p>Composite current image with contents of specified image, rendered\nwith specified width and height, at specified coordinates. If the\nmatte attribute is set to true, then the image composition will\nconsider an alpha channel, or transparency, present in the image file\nso that non-opaque portions allow part (or all) of the composite image\nto show through. If the specified width or height is zero, then the\nimage is composited at its natural size, without enlargement or\nreduction:</p>\n<pre class=\"literal-block\">\nDrawableCompositeImage ( double x_, double y_,\n                         double width_, double height_,\n                         const std::string &amp;filename_ );\n\nDrawableCompositeImage ( double x_, double y_,\n                         double width_, double height_,\n                         const Image &amp;image_ );\n</pre>\n<p>Composite current image with contents of specified image, rendered\nwith specified width and height, using specified composition\nalgorithm, at specified coordinates. If the matte attribute is set to\ntrue, then the image composition will consider an alpha channel, or\ntransparency, present in the image file so that non-opaque portions\nallow part (or all) of the composite image to show through. If the\nspecified width or height is zero, then the image is composited at its\nnatural size, without enlargement or reduction:</p>\n<pre class=\"literal-block\">\nDrawableCompositeImage ( double x_, double y_,\n                         double width_, double height_,\n                         const std::string &amp;filename_,\n                         CompositeOperator composition_ );\n\nDrawableCompositeImage ( double x_, double y_,\n                         double width_, double height_,\n                         const Image &amp;image_,\n                         CompositeOperator composition_ );\n</pre>\n</div>\n<div class=\"section\" id=\"drawabledasharray\">\n<h2><a class=\"toc-backref\" href=\"#id18\">DrawableDashArray</a></h2>\n<p>Specify the pattern of dashes and gaps used to stroke paths. The\nstrokeDashArray represents a zero-terminated array of numbers that\nspecify the lengths of alternating dashes and gaps in pixels. If an\nodd number of values is provided, then the list of values is repeated\nto yield an even number of values.  A typical <cite>strokeDashArray_</cite> array\nmight contain the members 5 3 2 0, where the zero value indicates the\nend of the pattern array:</p>\n<pre class=\"literal-block\">\nDrawableDashArray( const double* dasharray_ );\n</pre>\n</div>\n<div class=\"section\" id=\"drawabledashoffset\">\n<h2><a class=\"toc-backref\" href=\"#id19\">DrawableDashOffset</a></h2>\n<p>Specify the distance into the dash pattern to start the dash. See\ndocumentation on SVG's <a class=\"reference external\" href=\"http://www.w3.org/TR/SVG/painting.html#StrokeDashoffsetProperty\">stroke-dashoffset</a>\nproperty for usage details:</p>\n<pre class=\"literal-block\">\nDrawableDashOffset ( const double offset_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawableellipse\">\n<h2><a class=\"toc-backref\" href=\"#id20\">DrawableEllipse</a></h2>\n<p>Draw an ellipse using the stroke color and thickness, specified\norigin, x &amp; y radius, as well as specified start and end of arc in\ndegrees. If a fill color is specified, then the object is filled:</p>\n<pre class=\"literal-block\">\nDrawableEllipse ( double originX_, double originY_,\n                  double radiusX_, double radiusY_,\n                  double arcStart_, double arcEnd_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablefillcolor\">\n<h2><a class=\"toc-backref\" href=\"#id21\">DrawableFillColor</a></h2>\n<p>Specify drawing object fill color:</p>\n<blockquote>\nDrawableFillColor ( const Color &amp;color_ );</blockquote>\n</div>\n<div class=\"section\" id=\"drawablefillrule\">\n<h2><a class=\"toc-backref\" href=\"#id22\">DrawableFillRule</a></h2>\n<p>Specify the algorithm which is to be used to determine what parts of\nthe canvas are included inside the shape. See documentation on SVG's\n<a class=\"reference external\" href=\"http://www.w3.org/TR/SVG/painting.html#FillRuleProperty\">fill-rule</a>\nproperty for usage details:</p>\n<pre class=\"literal-block\">\nDrawableFillRule ( const FillRule fillRule_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablefillopacity\">\n<h2><a class=\"toc-backref\" href=\"#id23\">DrawableFillOpacity</a></h2>\n<p>Specify opacity to use when drawing using fill color:</p>\n<pre class=\"literal-block\">\nDrawableFillOpacity ( double opacity_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablefont\">\n<h2><a class=\"toc-backref\" href=\"#id24\">DrawableFont</a></h2>\n<p>Specify font family, style, weight (one of the set { 100 | 200 | 300 |\n400 | 500 | 600 | 700 | 800 | 900 } with 400 being the normal size),\nand stretch to be used to select the font used when drawing\ntext. Wildcard matches may be applied to style via the AnyStyle\nenumeration, applied to weight if weight is zero, and applied to\nstretch via the AnyStretch enumeration:</p>\n<pre class=\"literal-block\">\nDrawableFont ( const std::string &amp;font_ );\n\nDrawableFont ( const std::string &amp;family_,\n               StyleType style_,\n               const unsigned long weight_,\n               StretchType stretch_ );\n</pre>\n</div>\n<div class=\"section\" id=\"drawablegravity\">\n<h2><a class=\"toc-backref\" href=\"#id25\">DrawableGravity</a></h2>\n<p>Specify text positioning gravity:</p>\n<pre class=\"literal-block\">\nDrawableGravity ( GravityType gravity_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawableline\">\n<h2><a class=\"toc-backref\" href=\"#id26\">DrawableLine</a></h2>\n<p>Draw a line using stroke color and thickness using starting and ending\ncoordinates:</p>\n<pre class=\"literal-block\">\nDrawableLine ( double startX_, double startY_,\n               double endX_, double endY_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablematte\">\n<h2><a class=\"toc-backref\" href=\"#id27\">DrawableMatte</a></h2>\n<p>Change the pixel matte value to transparent. The point method changes\nthe matte value of the target pixel.  The replace method changes the\nmatte value of any pixel that matches the color of the target\npixel. Floodfill changes the matte value of any pixel that matches the\ncolor of the target pixel and is a neighbor, whereas filltoborder\nchanges the matte value of any neighbor pixel that is not the border\ncolor, Finally reset changes the matte value of all pixels:</p>\n<pre class=\"literal-block\">\nDrawableMatte ( double x_, double y_,\n                PaintMethod paintMethod_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablemiterlimit\">\n<h2><a class=\"toc-backref\" href=\"#id28\">DrawableMiterLimit</a></h2>\n<p>Specify miter limit. When two line segments meet at a sharp angle and\nmiter joins have been specified for 'lineJoin', it is possible for the\nmiter to extend far beyond the thickness of the line stroking the\npath. The miterLimit' imposes a limit on the ratio of the miter length\nto the 'lineWidth'. The default value of this parameter is 4:</p>\n<pre class=\"literal-block\">\nDrawableMiterLimit ( unsigned int miterlimit_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepath\">\n<h2><a class=\"toc-backref\" href=\"#id29\">DrawablePath</a></h2>\n<p>Draw on image using vector path:</p>\n<pre class=\"literal-block\">\nDrawablePath ( const VPathList &amp;path_ );\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepoint\">\n<h2><a class=\"toc-backref\" href=\"#id30\">DrawablePoint</a></h2>\n<p>Draw a point using stroke color and thickness at coordinate:</p>\n<pre class=\"literal-block\">\nDrawablePoint ( double x_, double y_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepointsize\">\n<h2><a class=\"toc-backref\" href=\"#id31\">DrawablePointSize</a></h2>\n<p>Set font point size:</p>\n<pre class=\"literal-block\">\nDrawablePointSize ( double pointSize_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepolygon\">\n<h2><a class=\"toc-backref\" href=\"#id32\">DrawablePolygon</a></h2>\n<p>Draw an arbitrary polygon using stroke color and thickness consisting\nof three or more coordinates contained in an STL list. If a fill color\nis specified, then the object is filled:</p>\n<pre class=\"literal-block\">\nDrawablePolygon ( const CoordinateList &amp;coordinates_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepolyline\">\n<h2><a class=\"toc-backref\" href=\"#id33\">DrawablePolyline</a></h2>\n<p>Draw an arbitrary polyline using stroke color and thickness consisting\nof three or more coordinates contained in an STL list. If a fill color\nis specified, then the object is filled:</p>\n<pre class=\"literal-block\">\nDrawablePolyline ( const CoordinateList &amp;coordinates_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepopclippath\">\n<h2><a class=\"toc-backref\" href=\"#id34\">DrawablePopClipPath</a></h2>\n<p>Pop (terminate) clip path definition started by DrawablePushClipPath:</p>\n<pre class=\"literal-block\">\nDrawablePopClipPath ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepopgraphiccontext\">\n<h2><a class=\"toc-backref\" href=\"#id35\">DrawablePopGraphicContext</a></h2>\n<p>Pop Graphic Context. Removing the current graphic context from the\ngraphic context stack restores the options to the values they had\nprior to the preceding <a class=\"reference internal\" href=\"#drawablepushgraphiccontext\">DrawablePushGraphicContext</a> operation:</p>\n<pre class=\"literal-block\">\nDrawablePopGraphicContext ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepushclippath\">\n<h2><a class=\"toc-backref\" href=\"#id36\">DrawablePushClipPath</a></h2>\n<p>Push (create) clip path definition with <cite>id_</cite>. Clip patch definition\nconsists of subsequent drawing commands, terminated by\n<a class=\"reference internal\" href=\"#drawablepopclippath\">DrawablePopClipPath</a>:</p>\n<pre class=\"literal-block\">\nDrawablePushClipPath ( const std::string &amp;id_)\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepushgraphiccontext\">\n<h2><a class=\"toc-backref\" href=\"#id37\">DrawablePushGraphicContext</a></h2>\n<p>Push Graphic Context. When a graphic context is pushed, options set\nafter the context is pushed (such as coordinate transformations, color\nsettings, etc.) are saved to a new graphic context. This allows\nrelated options to be saved on a graphic context &quot;stack&quot; in order to\nsupport heirarchical nesting of options. When\n<a class=\"reference internal\" href=\"#drawablepopgraphiccontext\">DrawablePopGraphicContext</a> is used to pop the current graphic context,\nthe options in effect during the last <a class=\"reference internal\" href=\"#drawablepushgraphiccontext\">DrawablePushGraphicContext</a>\noperation are restored:</p>\n<pre class=\"literal-block\">\nDrawablePushGraphicContext ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepushpattern\">\n<h2><a class=\"toc-backref\" href=\"#id38\">DrawablePushPattern</a></h2>\n<p>Start a pattern definition with arbitrary pattern name specified by\n<cite>id_</cite>, pattern offset specified by <cite>x_</cite> and <cite>y_</cite>, and pattern size\nspecified by <cite>width_</cite> and <cite>height_</cite>. The pattern is defined within the\ncoordinate system defined by the specified offset and size. Arbitrary\ndrawing objects (including <a class=\"reference internal\" href=\"#drawablecompositeimage\">DrawableCompositeImage</a>) may be specified\nbetween <a class=\"reference internal\" href=\"#drawablepushpattern\">DrawablePushPattern</a> and <a class=\"reference internal\" href=\"#drawablepoppattern\">DrawablePopPattern</a> in order to draw\nthe pattern. Normally the pair <a class=\"reference internal\" href=\"#drawablepushgraphiccontext\">DrawablePushGraphicContext</a> &amp;\n<a class=\"reference internal\" href=\"#drawablepopgraphiccontext\">DrawablePopGraphicContext</a> are used to enclose a pattern\ndefinition. Pattern definitions are terminated by a\n<a class=\"reference internal\" href=\"#drawablepoppattern\">DrawablePopPattern</a> object:</p>\n<pre class=\"literal-block\">\nDrawablePushPattern ( const std::string &amp;id_, long x_, long y_,\n                      long width_, long height_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablepoppattern\">\n<h2><a class=\"toc-backref\" href=\"#id39\">DrawablePopPattern</a></h2>\n<p>Terminate a pattern definition started via <a class=\"reference internal\" href=\"#drawablepushpattern\">DrawablePushPattern</a>:</p>\n<pre class=\"literal-block\">\nDrawablePopPattern ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablerectangle\">\n<h2><a class=\"toc-backref\" href=\"#id40\">DrawableRectangle</a></h2>\n<p>Draw a rectangle using stroke color and thickness from upper-left\ncoordinates to lower-right coordinates. If a fill color is specified,\nthen the object is filled:</p>\n<pre class=\"literal-block\">\nDrawableRectangle ( double upperLeftX_, double upperLeftY_,\n                    double lowerRightX_, double lowerRightY_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablerotation\">\n<h2><a class=\"toc-backref\" href=\"#id41\">DrawableRotation</a></h2>\n<p>Set rotation to use when drawing (coordinate transformation):</p>\n<pre class=\"literal-block\">\nDrawableRotation ( double angle_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawableroundrectangle\">\n<h2><a class=\"toc-backref\" href=\"#id42\">DrawableRoundRectangle</a></h2>\n<p>Draw a rounded rectangle using stroke color and thickness, with\nspecified center coordinate, specified width and height, and specified\ncorner width and height.  If a fill color is specified, then the\nobject is filled:</p>\n<pre class=\"literal-block\">\nDrawableRoundRectangle ( double centerX_, double centerY_,\n                         double width_, double hight_,\n                         double cornerWidth_, double cornerHeight_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablescaling\">\n<h2><a class=\"toc-backref\" href=\"#id43\">DrawableScaling</a></h2>\n<p>Apply scaling in x and y direction while drawing objects (coordinate\ntransformation):</p>\n<pre class=\"literal-block\">\nDrawableScaling ( double x_, double y_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawableskewx\">\n<h2><a class=\"toc-backref\" href=\"#id44\">DrawableSkewX</a></h2>\n<p>Apply Skew in X direction (coordinate transformation):</p>\n<pre class=\"literal-block\">\nDrawableSkewX ( double angle_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawableskewy\">\n<h2><a class=\"toc-backref\" href=\"#id45\">DrawableSkewY</a></h2>\n<p>Apply Skew in Y direction:</p>\n<pre class=\"literal-block\">\nDrawableSkewY ( double angle_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablestrokeantialias\">\n<h2><a class=\"toc-backref\" href=\"#id46\">DrawableStrokeAntialias</a></h2>\n<p>Antialias while drawing lines or object outlines:</p>\n<pre class=\"literal-block\">\nDrawableStrokeAntialias ( bool flag_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablestrokecolor\">\n<h2><a class=\"toc-backref\" href=\"#id47\">DrawableStrokeColor</a></h2>\n<p>Set color to use when drawing lines or object outlines:</p>\n<pre class=\"literal-block\">\nDrawableStrokeColor ( const Color &amp;color_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablestrokelinecap\">\n<h2><a class=\"toc-backref\" href=\"#id48\">DrawableStrokeLineCap</a></h2>\n<p>Specify the shape to be used at the end of open subpaths when they are\nstroked. Values of LineCap are UndefinedCap, ButtCap, RoundCap, and\nSquareCap:</p>\n<pre class=\"literal-block\">\nDrawableStrokeLineCap ( LineCap linecap_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablestrokelinejoin\">\n<h2><a class=\"toc-backref\" href=\"#id49\">DrawableStrokeLineJoin</a></h2>\n<p>Specify the shape to be used at the corners of paths (or other vector\nshapes) when they are stroked. Values of LineJoin are UndefinedJoin,\nMiterJoin, RoundJoin, and BevelJoin:</p>\n<pre class=\"literal-block\">\nDrawableStrokeLineJoin ( LineJoin linejoin_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablestrokeopacity\">\n<h2><a class=\"toc-backref\" href=\"#id50\">DrawableStrokeOpacity</a></h2>\n<p>Opacity to use when drawing lines or object outlines:</p>\n<pre class=\"literal-block\">\nDrawableStrokeOpacity ( double opacity_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawablestrokewidth\">\n<h2><a class=\"toc-backref\" href=\"#id51\">DrawableStrokeWidth</a></h2>\n<p>Set width to use when drawing lines or object outlines:</p>\n<pre class=\"literal-block\">\nDrawableStrokeWidth ( double width_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawabletext\">\n<h2><a class=\"toc-backref\" href=\"#id52\">DrawableText</a></h2>\n<p>Annotate image with text using stroke color, font, font pointsize, and\nbox color (text background color), at specified coordinates. If text\ncontains <a class=\"reference external\" href=\"FormatCharacters.html\">special format characters</a> the\nimage filename, type, width, height, or other image attributes may be\nincorporated in the text (see label()):</p>\n<pre class=\"literal-block\">\nDrawableText ( const double x_, const double y_,\n               const std::string &amp;text_ )\n</pre>\n<p>Annotate image with text represented with text encoding, using current\nstroke color, font, font pointsize, and box color (text background\ncolor), at specified coordinates. If text contains <a class=\"reference external\" href=\"FormatCharacters.html\">special format\ncharacters</a> the image filename, type, width,\nheight, or other image attributes may be incorporated in the text (see\nlabel()).</p>\n<p>The text encoding specifies the code set to use for text\nannotations. The only character encoding which may be specified at\nthis time is &quot;UTF-8&quot; for representing <a class=\"reference external\" href=\"http://www.unicode.org/\">Unicode</a> as a sequence of bytes. Specify an empty\nstring to set text encoding to the system's default. Successful text\nannotation using Unicode may require fonts designed to support\nUnicode:</p>\n<pre class=\"literal-block\">\nDrawableText ( const double x_, const double y_,\n               const std::string &amp;text_, const std::string &amp;encoding_)\n</pre>\n</div>\n<div class=\"section\" id=\"drawabletextantialias\">\n<h2><a class=\"toc-backref\" href=\"#id53\">DrawableTextAntialias</a></h2>\n<p>Antialias while drawing text (default true). The main reason to\ndisable text antialiasing is to avoid adding new colors to the image:</p>\n<pre class=\"literal-block\">\nDrawableTextAntialias ( bool flag_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawabletextdecoration\">\n<h2><a class=\"toc-backref\" href=\"#id54\">DrawableTextDecoration</a></h2>\n<p>Specify decoration (e.g. UnderlineDecoration) to apply to text:</p>\n<pre class=\"literal-block\">\nDrawableTextDecoration ( DecorationType decoration_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawabletextundercolor\">\n<h2><a class=\"toc-backref\" href=\"#id55\">DrawableTextUnderColor</a></h2>\n<p>Draw a box under rendered text using the specified color:</p>\n<pre class=\"literal-block\">\nDrawableTextUnderColor ( const Color &amp;color_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawabletranslation\">\n<h2><a class=\"toc-backref\" href=\"#id56\">DrawableTranslation</a></h2>\n<p>Apply coordinate translation (set new coordinate origin):</p>\n<pre class=\"literal-block\">\nDrawableTranslation ( double x_, double y_ )\n</pre>\n</div>\n<div class=\"section\" id=\"drawableviewbox\">\n<h2><a class=\"toc-backref\" href=\"#id57\">DrawableViewbox</a></h2>\n<p>Dimensions of the output viewbox. If the image is to be written to a\nvector format (e.g. MVG or SVG), then a <a class=\"reference internal\" href=\"#drawablepushgraphiccontext\">DrawablePushGraphicContext</a>\nobject should be pushed to the head of the list, followed by a\n<a class=\"reference internal\" href=\"#drawableviewbox\">DrawableViewbox</a> object to establish the output canvas size. A\nmatching <a class=\"reference internal\" href=\"#drawablepopgraphiccontext\">DrawablePopGraphicContext</a> object should be pushed to the\ntail of the list:</p>\n<pre class=\"literal-block\">\nDrawableViewbox(unsigned long x1_, unsigned long y1_,\n                unsigned long x2_, unsigned long y2_)\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"vector-path-classes\">\n<h1><a class=\"toc-backref\" href=\"#id10\">Vector Path Classes</a></h1>\n<p>The vector paths supported by Magick++ are based on those supported by\nthe <a class=\"reference external\" href=\"http://www.w3.org/TR/SVG/paths.html\">SVG XML specification</a>. Vector paths are not directly\ndrawable, they must first be supplied as a constructor argument to the\n<a class=\"reference internal\" href=\"#drawablepath\">DrawablePath</a> class in order to create a drawable object. The\n<a class=\"reference internal\" href=\"#drawablepath\">DrawablePath</a> class effectively creates a drawable compound component\nwhich may be replayed as desired. If the drawable compound component\nconsists only of vector path objects using relative coordinates then\nthe object may be positioned on the image by preceding it with a\n<a class=\"reference internal\" href=\"#drawablepath\">DrawablePath</a> which sets the current drawing coordinate. Alternatively\ncoordinate transforms may be used to <a class=\"reference external\" href=\"#DrawableTranslation\">translate the origin</a> in order to position the object, rotate it,\nskew it, or scale it.</p>\n<div class=\"contents local topic\" id=\"vector-path-commands\">\n<p class=\"topic-title first\">Vector path commands</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#the-moveto-commands\" id=\"id58\">The &quot;moveto&quot; commands</a></li>\n<li><a class=\"reference internal\" href=\"#the-closepath-command\" id=\"id59\">The &quot;closepath&quot; command</a></li>\n<li><a class=\"reference internal\" href=\"#the-lineto-commands\" id=\"id60\">The &quot;lineto&quot; commands</a></li>\n<li><a class=\"reference internal\" href=\"#curve-commands\" id=\"id61\">Curve commands</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"the-moveto-commands\">\n<h2><a class=\"toc-backref\" href=\"#id58\">The &quot;moveto&quot; commands</a></h2>\n<p>The &quot;moveto&quot; commands establish a new current point. The effect is as\nif the &quot;pen&quot; were lifted and moved to a new location. A path data\nsegment must begin with either one of the &quot;moveto&quot; commands or one of\nthe &quot;arc&quot; commands. Subsequent &quot;moveto&quot; commands (i.e., when the\n&quot;moveto&quot; is not the first command) represent the start of a new\nsubpath.</p>\n<p>Start a new sub-path at the given coordinate. PathMovetoAbs indicates\nthat absolute coordinates will follow; PathMovetoRel indicates that\nrelative coordinates will follow. If a relative moveto appears as the\nfirst element of the path, then it is treated as a pair of absolute\ncoordinates. If a moveto is followed by multiple pairs of coordinates,\nthe subsequent pairs are treated as implicit lineto commands.</p>\n<div class=\"section\" id=\"pathmovetoabs\">\n<h3>PathMovetoAbs</h3>\n<p>Simple moveto:</p>\n<pre class=\"literal-block\">\nPathMovetoAbs ( const Magick::Coordinate &amp;coordinate_ )\n</pre>\n<p>Moveto followed by implicit linetos:</p>\n<pre class=\"literal-block\">\nPathMovetoAbs ( const CoordinateList &amp;coordinates_ )\n</pre>\n</div>\n<div class=\"section\" id=\"pathmovetorel\">\n<h3>PathMovetoRel</h3>\n<p>Simple moveto:</p>\n<pre class=\"literal-block\">\nPathMovetoRel ( const Magick::Coordinate &amp;coordinate_ );\n</pre>\n<p>Moveto followed by implicit linetos:</p>\n<pre class=\"literal-block\">\nPathMovetoRel ( const CoordinateList &amp;coordinates_ );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"the-closepath-command\">\n<h2><a class=\"toc-backref\" href=\"#id59\">The &quot;closepath&quot; command</a></h2>\n<p>The &quot;closepath&quot; command causes an automatic straight line to be drawn from the current point to the initial point of the current subpath.</p>\n<div class=\"section\" id=\"pathclosepath\">\n<h3>PathClosePath</h3>\n<p>Close the current subpath by drawing a straight line from the current\npoint to current subpath's most recent starting point (usually, the\nmost recent moveto point):</p>\n<pre class=\"literal-block\">\nPathClosePath ( void )\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"the-lineto-commands\">\n<h2><a class=\"toc-backref\" href=\"#id60\">The &quot;lineto&quot; commands</a></h2>\n<p>The various &quot;lineto&quot; commands draw straight lines from the current\npoint to a new point.</p>\n<div class=\"section\" id=\"pathlinetoabs\">\n<h3>PathLinetoAbs</h3>\n<p>Draw a line from the current point to the given coordinate which\nbecomes the new current point.  <em>PathLinetoAbs</em> indicates that absolute\ncoordinates are used. A number of coordinates pairs may be specified\nin a list to draw a polyline. At the end of the command, the new\ncurrent point is set to the final set of coordinates provided.</p>\n<p>Draw to a single point:</p>\n<pre class=\"literal-block\">\nPathLinetoAbs ( const Magick::Coordinate&amp; coordinate_  );\n</pre>\n<p>Draw to multiple points:</p>\n<pre class=\"literal-block\">\nPathLinetoAbs ( const CoordinateList &amp;coordinates_ );\n</pre>\n</div>\n<div class=\"section\" id=\"pathlinetorel\">\n<h3>PathLinetoRel</h3>\n<p>Draw a line from the current point to the given coordinate which\nbecomes the new current point. <em>PathLinetoRel</em> indicates that relative\ncoordinates are used. A number of coordinates pairs may be specified\nin a list to draw a polyline. At the end of the command, the new\ncurrent point is set to the final set of coordinates provided.</p>\n<p>Draw to a single point:</p>\n<pre class=\"literal-block\">\nPathLinetoRel ( const Magick::Coordinate&amp; coordinate_ );\n</pre>\n<p>Draw to multiple points:</p>\n<pre class=\"literal-block\">\nPathLinetoRel ( const CoordinateList &amp;coordinates_ );\n</pre>\n</div>\n<div class=\"section\" id=\"pathlinetohorizontalabs\">\n<h3>PathLinetoHorizontalAbs</h3>\n<p>Draws a horizontal line from the current point (cpx, cpy) to (x,\ncpy). <em>PathLinetoHorizontalAbs</em> indicates that absolute coordinates\nare supplied.  At the end of the command, the new current point\nbecomes (x, cpy) for the final value of x:</p>\n<pre class=\"literal-block\">\nPathLinetoHorizontalAbs ( double x_ )\n</pre>\n</div>\n<div class=\"section\" id=\"pathlinetohorizontalrel\">\n<h3>PathLinetoHorizontalRel</h3>\n<p>Draws a horizontal line from the current point (cpx, cpy) to (x,\ncpy). <em>PathLinetoHorizontalRel</em> indicates that relative coordinates\nare supplied. At the end of the command, the new current point becomes\n(x, cpy) for the final value of x:</p>\n<pre class=\"literal-block\">\nPathLinetoHorizontalRel ( double x_ )\n</pre>\n</div>\n<div class=\"section\" id=\"pathlinetoverticalabs\">\n<h3>PathLinetoVerticalAbs</h3>\n<p>Draws a vertical line from the current point (cpx, cpy) to (cpx,\ny). <em>PathLinetoVerticalAbs</em> indicates that absolute coordinates are\nsupplied.  At the end of the command, the new current point becomes\n(cpx, y) for the final value of y:</p>\n<pre class=\"literal-block\">\nPathLinetoVerticalAbs ( double y_ )\n</pre>\n</div>\n<div class=\"section\" id=\"pathlinetoverticalrel\">\n<h3>PathLinetoVerticalRel</h3>\n<p>Draws a vertical line from the current point (cpx, cpy) to (cpx, y).\n<em>PathLinetoVerticalRel</em> indicates that relative coordinates are\nsupplied.  At the end of the command, the new current point becomes\n(cpx, y) for the final value of y:</p>\n<pre class=\"literal-block\">\nPathLinetoVerticalRel ( double y_ )\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"curve-commands\">\n<h2><a class=\"toc-backref\" href=\"#id61\">Curve commands</a></h2>\n<p>These three groups of commands draw curves:</p>\n<ul>\n<li><p class=\"first\">Cubic Bézier commands.</p>\n<p>A cubic Bézier segment is defined by a start point, an end point,\nand two control points.</p>\n</li>\n<li><p class=\"first\">Quadratic Bézier commands.</p>\n<p>A quadratic Bézier segment is defined by a start point, an end\npoint, and one control point.</p>\n</li>\n<li><p class=\"first\">Elliptical arc commands.</p>\n<p>An elliptical arc segment draws a segment of an ellipse.</p>\n</li>\n</ul>\n<div class=\"contents local topic\" id=\"id4\">\n<p class=\"topic-title first\">Curve Commands</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#cubic-bezier-curve-commands\" id=\"id62\">Cubic Bézier curve commands</a></li>\n<li><a class=\"reference internal\" href=\"#quadratic-bezier-curve-commands\" id=\"id63\">Quadratic Bézier curve commands</a></li>\n<li><a class=\"reference internal\" href=\"#elliptical-arc-curve-commands\" id=\"id64\">Elliptical arc curve commands</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"cubic-bezier-curve-commands\">\n<h3><a class=\"toc-backref\" href=\"#id62\">Cubic Bézier curve commands</a></h3>\n<div class=\"contents local topic\" id=\"id5\">\n<p class=\"topic-title first\">Cubic Bézier curve commands</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#pathcurvetoargs\" id=\"id65\">PathCurvetoArgs</a></li>\n<li><a class=\"reference internal\" href=\"#pathcurvetoabs\" id=\"id66\">PathCurvetoAbs</a></li>\n<li><a class=\"reference internal\" href=\"#pathcurvetorel\" id=\"id67\">PathCurvetoRel</a></li>\n<li><a class=\"reference internal\" href=\"#pathsmoothcurvetoabs\" id=\"id68\">PathSmoothCurvetoAbs</a></li>\n<li><a class=\"reference internal\" href=\"#pathsmoothcurvetorel\" id=\"id69\">PathSmoothCurvetoRel</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"pathcurvetoargs\">\n<h4><a class=\"toc-backref\" href=\"#id65\">PathCurvetoArgs</a></h4>\n<p>The cubic Bézier commands depend on the <a class=\"reference internal\" href=\"#pathcurvetoargs\">PathCurvetoArgs</a> argument\nclass, which has the constructor signature:</p>\n<pre class=\"literal-block\">\nPathCurvetoArgs( double x1_, double y1_,\n                 double x2_, double y2_,\n                 double x_, double y_ );\n</pre>\n<p>PathCurveto:</p>\n<p>Draws a cubic Bézier curve from the current point to (<em>x</em>,*y*) using\n(<em>x1</em>,*y1*) as the control point at the beginning of the curve and\n(<em>x2</em>,*y2*) as the control point at the end of the\ncurve. <a class=\"reference internal\" href=\"#pathcurvetoabs\">PathCurvetoAbs</a> indicates that absolutecoordinates will follow;\n<a class=\"reference internal\" href=\"#pathcurvetorel\">PathCurvetoRel</a> indicates that relative coordinates will\nfollow. Multiple sets of coordinates may be specified to draw a\npolybezier. At the end of the command, the new current point becomes\nthe final (<em>x</em>,*y*) coordinate pair used in the polybezier.</p>\n</div>\n<div class=\"section\" id=\"pathcurvetoabs\">\n<h4><a class=\"toc-backref\" href=\"#id66\">PathCurvetoAbs</a></h4>\n<p>Draw a single curve:</p>\n<pre class=\"literal-block\">\nPathCurvetoAbs ( const PathCurvetoArgs &amp;args_ );\n</pre>\n<p>Draw multiple curves:</p>\n<pre class=\"literal-block\">\nPathCurvetoAbs ( const PathCurveToArgsList &amp;args_ );\n</pre>\n</div>\n<div class=\"section\" id=\"pathcurvetorel\">\n<h4><a class=\"toc-backref\" href=\"#id67\">PathCurvetoRel</a></h4>\n<p>Draw a single curve:</p>\n<pre class=\"literal-block\">\nPathCurvetoRel ( const PathCurvetoArgs &amp;args_ );\n</pre>\n<p>Draw multiple curves:</p>\n<pre class=\"literal-block\">\nPathCurvetoRel ( const PathCurveToArgsList &amp;args_ );\n</pre>\n<p>PathSmoothCurveto:</p>\n<p>Draws a cubic Bézier curve from the current point to (x,y). The first\ncontrol point is assumed to be the reflection of the second control\npoint on the previous command relative to the current point. (If there\nis no previous command or if the previous command was not an\nPathCurvetoAbs, PathCurvetoRel, PathSmoothCurvetoAbs or\nPathSmoothCurvetoRel, assume the first control point is coincident\nwith the current point.) (x2,y2) is the second control point (i.e.,\nthe control point at the end of the curve).  PathSmoothCurvetoAbs\nindicates that absolute coordinates will follow; PathSmoothCurvetoRel\nindicates that relative coordinates will follow. Multiple sets of\ncoordinates may be specified to draw a polybezier. At the end of the\ncommand, the new current point becomes the final (x,y) coordinate pair\nused in the polybezier.</p>\n</div>\n<div class=\"section\" id=\"pathsmoothcurvetoabs\">\n<h4><a class=\"toc-backref\" href=\"#id68\">PathSmoothCurvetoAbs</a></h4>\n<p>Draw a single curve:</p>\n<pre class=\"literal-block\">\nPathSmoothCurvetoAbs ( const Magick::Coordinate &amp;coordinates_ );\n</pre>\n<p>Draw multiple curves</p>\n<blockquote>\nPathSmoothCurvetoAbs ( const CoordinateList &amp;coordinates_ );</blockquote>\n</div>\n<div class=\"section\" id=\"pathsmoothcurvetorel\">\n<h4><a class=\"toc-backref\" href=\"#id69\">PathSmoothCurvetoRel</a></h4>\n<p>Draw a single curve:</p>\n<pre class=\"literal-block\">\nPathSmoothCurvetoRel ( const Coordinate &amp;coordinates_ );\n</pre>\n<p>Draw multiple curves:</p>\n<pre class=\"literal-block\">\nPathSmoothCurvetoRel ( const CoordinateList &amp;coordinates_ );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"quadratic-bezier-curve-commands\">\n<h3><a class=\"toc-backref\" href=\"#id63\">Quadratic Bézier curve commands</a></h3>\n<div class=\"contents local topic\" id=\"id6\">\n<p class=\"topic-title first\">Quadratic Bézier curve commands</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#pathquadraticcurvetoargs\" id=\"id70\">PathQuadraticCurvetoArgs</a></li>\n<li><a class=\"reference internal\" href=\"#pathquadraticcurvetoabs\" id=\"id71\">PathQuadraticCurvetoAbs</a></li>\n<li><a class=\"reference internal\" href=\"#pathquadraticcurvetorel\" id=\"id72\">PathQuadraticCurvetoRel</a></li>\n<li><a class=\"reference internal\" href=\"#pathsmoothquadraticcurvetoabs\" id=\"id73\">PathSmoothQuadraticCurvetoAbs</a></li>\n<li><a class=\"reference internal\" href=\"#pathsmoothquadraticcurvetorel\" id=\"id74\">PathSmoothQuadraticCurvetoRel</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"pathquadraticcurvetoargs\">\n<h4><a class=\"toc-backref\" href=\"#id70\">PathQuadraticCurvetoArgs</a></h4>\n<p>The quadratic Bézier commands depend on the <a class=\"reference internal\" href=\"#pathquadraticcurvetoargs\">PathQuadraticCurvetoArgs</a>\nargument class, which has the constructor signature:</p>\n<pre class=\"literal-block\">\nPathQuadraticCurvetoArgs( double x1_, double y1_,\n                          double x_, double y_ );\n</pre>\n</div>\n<div class=\"section\" id=\"pathquadraticcurvetoabs\">\n<h4><a class=\"toc-backref\" href=\"#id71\">PathQuadraticCurvetoAbs</a></h4>\n<p>Draw a single curve:</p>\n<pre class=\"literal-block\">\nPathQuadraticCurvetoAbs ( const Magick::PathQuadraticCurvetoArgs &amp;args_ );\n</pre>\n<p>Draw multiple curves:</p>\n<pre class=\"literal-block\">\nPathQuadraticCurvetoAbs ( const PathQuadraticCurvetoArgsList &amp;args_ );\n</pre>\n</div>\n<div class=\"section\" id=\"pathquadraticcurvetorel\">\n<h4><a class=\"toc-backref\" href=\"#id72\">PathQuadraticCurvetoRel</a></h4>\n<p>Draw a single curve:</p>\n<pre class=\"literal-block\">\nPathQuadraticCurvetoRel ( const Magick::PathQuadraticCurvetoArgs &amp;args_ );\n</pre>\n<p>Draw multiple curves:</p>\n<pre class=\"literal-block\">\nPathQuadraticCurvetoRel ( const PathQuadraticCurvetoArgsList &amp;args_ );\n</pre>\n</div>\n<div class=\"section\" id=\"pathsmoothquadraticcurvetoabs\">\n<h4><a class=\"toc-backref\" href=\"#id73\">PathSmoothQuadraticCurvetoAbs</a></h4>\n<p>Draw a single curve:</p>\n<pre class=\"literal-block\">\nPathSmoothQuadraticCurvetoAbs ( const Magick::Coordinate &amp;coordinate_ );\n</pre>\n<p>Draw multiple curves:</p>\n<pre class=\"literal-block\">\nPathSmoothQuadraticCurvetoAbs ( const CoordinateList &amp;coordinates_ );\n</pre>\n</div>\n<div class=\"section\" id=\"pathsmoothquadraticcurvetorel\">\n<h4><a class=\"toc-backref\" href=\"#id74\">PathSmoothQuadraticCurvetoRel</a></h4>\n<p>Draw a single curve:</p>\n<pre class=\"literal-block\">\nPathSmoothQuadraticCurvetoRel ( const Magick::Coordinate &amp;coordinate_ );\n</pre>\n<p>Draw multiple curves:</p>\n<pre class=\"literal-block\">\nPathSmoothQuadraticCurvetoRel ( const CoordinateList &amp;coordinates_ );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"elliptical-arc-curve-commands\">\n<h3><a class=\"toc-backref\" href=\"#id64\">Elliptical arc curve commands</a></h3>\n<div class=\"contents local topic\" id=\"id7\">\n<p class=\"topic-title first\">Elliptical arc curve commands</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#patharcargs\" id=\"id75\">PathArcArgs</a></li>\n<li><a class=\"reference internal\" href=\"#patharcabs\" id=\"id76\">PathArcAbs</a></li>\n<li><a class=\"reference internal\" href=\"#patharcrel\" id=\"id77\">PathArcRel</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"patharcargs\">\n<h4><a class=\"toc-backref\" href=\"#id75\">PathArcArgs</a></h4>\n<p>The elliptical arc curve commands depend on the PathArcArgs argument\nclass, which has the constructor signature:</p>\n<pre class=\"literal-block\">\nPathArcArgs( double radiusX_, double radiusY_,\n             double xAxisRotation_, bool largeArcFlag_,\n             bool sweepFlag_, double x_, double y_ );\n</pre>\n<p>Draws an elliptical arc from the current point to (<em>x</em>, <em>y</em>). The size and\norientation of the ellipse are defined by two radii (<em>radiusX</em>, <em>radiusY</em>)\nand an <em>xAxisRotation</em>, which indicates how the ellipse as a whole is\nrotated relative to the current coordinate system. The center (cx, cy)\nof the ellipse is calculated automatically to satisfy the constraints\nimposed by the other parameters. <em>largeArcFlag</em> and <em>sweepFlag</em> contribute\nto the automatic calculations and help determine how the arc is\ndrawn. If <em>largeArcFlag</em> is true then draw the larger of the available\narcs. If <em>sweepFlag</em> is true, then draw the arc matching a clock-wise\nrotation.</p>\n</div>\n<div class=\"section\" id=\"patharcabs\">\n<h4><a class=\"toc-backref\" href=\"#id76\">PathArcAbs</a></h4>\n<p>Draw a single arc segment:</p>\n<pre class=\"literal-block\">\nPathArcAbs ( const PathArcArgs &amp;coordinates_ );\n</pre>\n<p>Draw multiple arc segments:</p>\n<pre class=\"literal-block\">\nPathArcAbs ( const PathArcArgsList &amp;coordinates_ );\n</pre>\n</div>\n<div class=\"section\" id=\"patharcrel\">\n<h4><a class=\"toc-backref\" href=\"#id77\">PathArcRel</a></h4>\n<p>Draw a single arc segment:</p>\n<pre class=\"literal-block\">\nPathArcRel ( const PathArcArgs &amp;coordinates_ );\n</pre>\n<p>Draw multiple arc segments:</p>\n<pre class=\"literal-block\">\nPathArcRel ( const PathArcArgsList &amp;coordinates_ );\n</pre>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</div>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/Enumerations.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Enumerations</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"enumerations\">\n<h1 class=\"title\">Enumerations</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents topic\" id=\"magick-enumerations\">\n<p class=\"topic-title first\">Magick++ Enumerations</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#channeltype\" id=\"id2\">ChannelType</a></li>\n<li><a class=\"reference internal\" href=\"#classtype\" id=\"id3\">ClassType</a></li>\n<li><a class=\"reference internal\" href=\"#colorspacetype\" id=\"id4\">ColorspaceType</a></li>\n<li><a class=\"reference internal\" href=\"#compositeoperator\" id=\"id5\">CompositeOperator</a></li>\n<li><a class=\"reference internal\" href=\"#compressiontype\" id=\"id6\">CompressionType</a></li>\n<li><a class=\"reference internal\" href=\"#decorationtype\" id=\"id7\">DecorationType</a></li>\n<li><a class=\"reference internal\" href=\"#endiantype\" id=\"id8\">EndianType</a></li>\n<li><a class=\"reference internal\" href=\"#fillrule\" id=\"id9\">FillRule</a></li>\n<li><a class=\"reference internal\" href=\"#filtertypes\" id=\"id10\">FilterTypes</a></li>\n<li><a class=\"reference internal\" href=\"#gravitytype\" id=\"id11\">GravityType</a></li>\n<li><a class=\"reference internal\" href=\"#imagetype\" id=\"id12\">ImageType</a></li>\n<li><a class=\"reference internal\" href=\"#interlacetype\" id=\"id13\">InterlaceType</a></li>\n<li><a class=\"reference internal\" href=\"#id1\" id=\"id14\">ChannelType</a></li>\n<li><a class=\"reference internal\" href=\"#linecap\" id=\"id15\">LineCap</a></li>\n<li><a class=\"reference internal\" href=\"#linejoin\" id=\"id16\">LineJoin</a></li>\n<li><a class=\"reference internal\" href=\"#noisetype\" id=\"id17\">NoiseType</a></li>\n<li><a class=\"reference internal\" href=\"#orientationtype\" id=\"id18\">OrientationType</a></li>\n<li><a class=\"reference internal\" href=\"#paintmethod\" id=\"id19\">PaintMethod</a></li>\n<li><a class=\"reference internal\" href=\"#quantumtypes\" id=\"id20\">QuantumTypes</a></li>\n<li><a class=\"reference internal\" href=\"#renderingintent\" id=\"id21\">RenderingIntent</a></li>\n<li><a class=\"reference internal\" href=\"#resolutiontype\" id=\"id22\">ResolutionType</a></li>\n<li><a class=\"reference internal\" href=\"#storagetype\" id=\"id23\">StorageType</a></li>\n<li><a class=\"reference internal\" href=\"#stretchtype\" id=\"id24\">StretchType</a></li>\n<li><a class=\"reference internal\" href=\"#styletype\" id=\"id25\">StyleType</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"channeltype\">\n<h1><a class=\"toc-backref\" href=\"#id2\">ChannelType</a></h1>\n<p><em>ChannelType</em> is used as an argument when doing color separations. Use\n<em>ChannelType</em> when extracting a layer from an image. <em>MatteChannel</em> is\nuseful for extracting the opacity values from an image. Note that an\nimage may be represented in RGB, RGBA, CMYK, or CMYKA, pixel formats\nand a channel may only be extracted if it is valid for the current\npixel format.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ChannelType</caption>\n<colgroup>\n<col width=\"30%\" />\n<col width=\"70%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedChannel</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>RedChannel</td>\n<td>RGB Red channel</td>\n</tr>\n<tr><td>CyanChannel</td>\n<td>CMYK Cyan channel</td>\n</tr>\n<tr><td>GreenChannel</td>\n<td>RGB Green channel</td>\n</tr>\n<tr><td>MagentaChannel</td>\n<td>CMYK Magenta channel</td>\n</tr>\n<tr><td>BlueChannel</td>\n<td>RGB Blue channel</td>\n</tr>\n<tr><td>YellowChannel</td>\n<td>CMYK Yellow channel</td>\n</tr>\n<tr><td>OpacityChannel</td>\n<td>Opacity channel (inverse of transparency)</td>\n</tr>\n<tr><td>BlackChannel</td>\n<td>CMYK Black (K) channel</td>\n</tr>\n<tr><td>MatteChannel</td>\n<td>Same as Opacity channel (deprecated)</td>\n</tr>\n<tr><td>AllChannels</td>\n<td>All color channels</td>\n</tr>\n<tr><td>GrayChannel</td>\n<td>Color channels represent an intensity</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"classtype\">\n<h1><a class=\"toc-backref\" href=\"#id3\">ClassType</a></h1>\n<p><em>ClassType</em> specifies the image storage class.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ClassType</caption>\n<colgroup>\n<col width=\"30%\" />\n<col width=\"70%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedClass</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>DirectClass</td>\n<td>Image is composed of pixels which represent\nliteral color values.</td>\n</tr>\n<tr><td>PseudoClass</td>\n<td>Image is composed of pixels which specify an index\nin a color palette.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"colorspacetype\">\n<h1><a class=\"toc-backref\" href=\"#id4\">ColorspaceType</a></h1>\n<p>The <em>ColorspaceType</em> enumeration is used to specify the colorspace that\nquantization (color reduction and mapping) is done under or to specify\nthe colorspace when encoding an output image. Colorspaces are ways of\ndescribing colors to fit the requirements of a particular application\n(e.g. Television, offset printing, color monitors).  Color reduction,\nby default, takes place in the <em>RGBColorspace</em>. Empirical evidence\nsuggests that distances in color spaces such as <em>YUVColorspace</em> or\n<em>YIQColorspace</em> correspond to perceptual color differences more closely\nhan do distances in RGB space. These color spaces may give better\nresults when color reducing an image. Refer to quantize for more\ndetails.</p>\n<p>When encoding an output image, the colorspaces <em>RGBColorspace</em>,\n<em>CMYKColorspace</em>, <em>GRAYColorspace</em>, or <em>YCbCrColorspace</em> may be\nspecified. The CMYKColorspace option is only applicable when writing\nTIFF, JPEG, and Adobe Photoshop bitmap (PSD) files.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ColorspaceType</caption>\n<colgroup>\n<col width=\"29%\" />\n<col width=\"71%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedColorspace</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>RGBColorspace</td>\n<td>Red-Green-Blue colorspace.</td>\n</tr>\n<tr><td>GRAYColorspace</td>\n<td>Grayscale colorspace</td>\n</tr>\n<tr><td>TransparentColorspace</td>\n<td>The Transparent color space behaves uniquely in\nthat it preserves the matte channel of the image\nif it exists.</td>\n</tr>\n<tr><td>OHTAColorspace</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>XYZColorspace</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>YCbCrColorspace</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>YCCColorspace</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>YIQColorspace</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>YPbPrColorspace</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>YUVColorspace</td>\n<td>Y-signal, U-signal, and V-signal colorspace. YUV is\nmost widely used to encode color for use in\ntelevision transmission.</td>\n</tr>\n<tr><td>CMYKColorspace</td>\n<td>Cyan-Magenta-Yellow-Black colorspace. CYMK is a\nsubtractive color system used by printers and\nphotographers for the rendering of colors with ink\nor emulsion,\nnormally on a white surface.</td>\n</tr>\n<tr><td>sRGBColorspace</td>\n<td>Kodak PhotoCD sRGB</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"compositeoperator\">\n<h1><a class=\"toc-backref\" href=\"#id5\">CompositeOperator</a></h1>\n<p><em>CompositeOperator</em> is used to select the image composition algorithm\nused to compose a composite image with an image. By default, each of\nthe composite image pixels are replaced by the corresponding image\ntile pixel. Specify <em>CompositeOperator</em> to select a different\nalgorithm.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>CompositeOperator</caption>\n<colgroup>\n<col width=\"31%\" />\n<col width=\"69%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedCompositeOp</td>\n<td>Not defined.</td>\n</tr>\n<tr><td>OverCompositeOp</td>\n<td>Union of the two image shapes, with\nopaque areas of change-image obscuring base-image\nin the region of overlap.</td>\n</tr>\n<tr><td>InCompositeOp</td>\n<td>Change-image cut by the shape of base-image.\nNone of the image data of base-image will be\nin the result.</td>\n</tr>\n<tr><td>OutCompositeOp</td>\n<td>Change-image with the shape of base-image cut out.</td>\n</tr>\n<tr><td>AtopCompositeOp</td>\n<td>Same shape as base-image, with change-image\nobscuring base-image where the image shapes\noverlap. Note this differs from over because the\nportion of change-image outside base-image's shape\ndoes not appear in the result.</td>\n</tr>\n<tr><td>XorCompositeOp</td>\n<td>Image data from both change-image and base-image\nthat is outside the overlap region. The overlap\nregion will be blank</td>\n</tr>\n<tr><td>PlusCompositeOp</td>\n<td>Sum of the image data. Output values are\ncropped to MaxRGB (no overflow). This operation is\nindependent of the matte channels.</td>\n</tr>\n<tr><td>MinusCompositeOp</td>\n<td>Change-image - base-image, with underflow cropped\nto zero. The matte channel is ignored (set to\nopaque, full coverage)</td>\n</tr>\n<tr><td>AddCompositeOp</td>\n<td>Change-image + base-image, with overflow wrapping\naround (mod MaxRGB+1)</td>\n</tr>\n<tr><td>SubtractCompositeOp</td>\n<td>Change-image - base-image, with underflow wrapping\naround (mod MaxRGB+1). The add and subtract\noperators can be used to perform reversible\ntransformations</td>\n</tr>\n<tr><td>DifferenceCompositeOp</td>\n<td>Absolute value of change-image minus base-image.</td>\n</tr>\n<tr><td>MultiplyCompositeOp</td>\n<td>Change-image * base-image. This is useful for the\ncreation of drop-shadows.</td>\n</tr>\n<tr><td>BumpmapCompositeOp</td>\n<td>Base-image shaded by change-image</td>\n</tr>\n<tr><td>CopyCompositeOp</td>\n<td>Base-image replaced with change-image. Here\nthe matte information is ignored</td>\n</tr>\n<tr><td>CopyRedCompositeOp</td>\n<td>Red channel in base-image replaced with\nthe red channel in change-image. The other channels\nare copied untouched</td>\n</tr>\n<tr><td>CopyGreenCompositeOp</td>\n<td>Green channel in base-image replaced with the green\nchannel in change-image. The other channels are\ncopied untouched.</td>\n</tr>\n<tr><td>CopyBlueCompositeOp</td>\n<td>Blue channel in base-image replaced with the blue\nchannel in change-image. The other channels are\ncopied untouched.</td>\n</tr>\n<tr><td>CopyOpacityCompositeOp</td>\n<td>Opacity channel in base-image replaced with the\nopacity channel in change-image.  The other\nchannels are copied untouched.</td>\n</tr>\n<tr><td>ClearCompositeOp</td>\n<td>Pixels are set to transparent.</td>\n</tr>\n<tr><td>DissolveCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>DisplaceCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>ModulateCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>ThresholdCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>NoCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>DarkenCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>LightenCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>HueCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>SaturateCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>ColorizeCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>LuminizeCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>ScreenCompositeOp</td>\n<td>Not yet implemented (Photoshop &amp; PDF)</td>\n</tr>\n<tr><td>OverlayCompositeOp</td>\n<td>Not yet implemented (Photoshop &amp; PDF)</td>\n</tr>\n<tr><td>CopyCyanCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>CopyMagentaCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>CopyYellowCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>CopyBlackCompositeOp</td>\n<td>Copy CMYK Black (K) channel.</td>\n</tr>\n<tr><td>DivideCompositeOp</td>\n<td>Change-image / base-image. This is useful for\nimproving the readability of text on unevenly\nilluminated photos. (by using a gaussian blurred\ncopy of change-image as base-image)</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"compressiontype\">\n<h1><a class=\"toc-backref\" href=\"#id6\">CompressionType</a></h1>\n<p><em>CompressionType</em> is used to express the desired compression type when\nencoding an image. Be aware that most image types only support a\nsub-set of the available compression types. If the compression type\nspecified is incompatable with the image, GraphicsMagick selects a\ncompression type compatable with the image type.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>CompressionType</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedCompression</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>NoCompression</td>\n<td>No compression</td>\n</tr>\n<tr><td>BZipCompression</td>\n<td>BZip as used by bzip2 utilities</td>\n</tr>\n<tr><td>FaxCompression</td>\n<td>CCITT Group 3 FAX compression</td>\n</tr>\n<tr><td>Group4Compression</td>\n<td>CCITT Group 4 FAX compression (used only for TIFF)</td>\n</tr>\n<tr><td>JPEGCompression</td>\n<td>JPEG compression</td>\n</tr>\n<tr><td>LZWCompression</td>\n<td>Lempel-Ziv-Welch (LZW) compression</td>\n</tr>\n<tr><td>RLECompression</td>\n<td>Run-Length encoded (RLE) compression</td>\n</tr>\n<tr><td>ZipCompression</td>\n<td>Lempel-Ziv compression (LZ77) as used in GNU gzip.</td>\n</tr>\n<tr><td>LZMACompression</td>\n<td>Lempel-Ziv-Markov chain algorithm</td>\n</tr>\n<tr><td>JPEG2000Compression</td>\n<td>ISO/IEC std 15444-1</td>\n</tr>\n<tr><td>JBIG1Compression</td>\n<td>ISO/IEC std 11544 / ITU-T rec T.82</td>\n</tr>\n<tr><td>JBIG2Compression</td>\n<td>ISO/IEC std 14492 / ITU-T rec T.88</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"decorationtype\">\n<h1><a class=\"toc-backref\" href=\"#id7\">DecorationType</a></h1>\n<p>The <em>DecorationType</em> enumerations are used to specify line decorations\nof rendered text.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>DecorationType</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>NoDecoration</td>\n<td>No decoration</td>\n</tr>\n<tr><td>UnderlineDecoration</td>\n<td>Underlined text</td>\n</tr>\n<tr><td>OverlineDecoration</td>\n<td>Overlined text</td>\n</tr>\n<tr><td>LineThroughDecoration</td>\n<td>Strike-through text</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"endiantype\">\n<h1><a class=\"toc-backref\" href=\"#id8\">EndianType</a></h1>\n<p>The <em>EndianType</em> enumerations are used to specify the endian option\nfor formats which support it (e.g. TIFF).</p>\n<table border=\"1\" class=\"docutils\">\n<caption>EndianType</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedEndian</td>\n<td>Not defined (default)</td>\n</tr>\n<tr><td>LSBEndian</td>\n<td>Little endian (like Intel X86 and DEC Alpha)</td>\n</tr>\n<tr><td>MSBEndian</td>\n<td>Big endian (like Motorola 68K, Mac PowerPC, &amp;\nSPARC)</td>\n</tr>\n<tr><td>NativeEndian</td>\n<td>Use native endian of this CPU</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"fillrule\">\n<h1><a class=\"toc-backref\" href=\"#id9\">FillRule</a></h1>\n<p><em>FillRule</em> specifies the algorithm which is to be used to determine\nwhat parts of the canvas are included inside the shape. See the\ndocumentation on SVG's <a class=\"reference external\" href=\"http://www.w3.org/TR/SVG/painting.html#FillRuleProperty\">fill-rule</a> property\nfor usage details.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>FillRule</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedRule</td>\n<td>Fill rule not specified</td>\n</tr>\n<tr><td>EvenOddRule</td>\n<td>See SVG fill-rule evenodd rule.</td>\n</tr>\n<tr><td>NonZeroRule</td>\n<td>See SVG fill-rule nonzero rule.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"filtertypes\">\n<h1><a class=\"toc-backref\" href=\"#id10\">FilterTypes</a></h1>\n<p><em>FilterTypes</em> is used to adjust the filter algorithm used when\nresizing images. Different filters experience varying degrees of\nsuccess with various images and can take sipngicantly different\namounts of processing time. GraphicsMagick uses the <em>LanczosFilter</em> by\ndefault since this filter has been shown to provide the best results\nfor most images in a reasonable amount of time. Other filter types\n(e.g. <em>TriangleFilter</em>) may execute much faster but may show artifacts\nwhen the image is re-sized or around diagonal lines. The only way to\nbe sure is to test the filter with sample images.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>FilterTypes</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedFilter</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>PointFilter</td>\n<td>Point Filter</td>\n</tr>\n<tr><td>BoxFilter</td>\n<td>Box Filter</td>\n</tr>\n<tr><td>TriangleFilter</td>\n<td>Triangle Filter</td>\n</tr>\n<tr><td>HermiteFilter</td>\n<td>Hermite Filter</td>\n</tr>\n<tr><td>HanningFilter</td>\n<td>Hanning Filter</td>\n</tr>\n<tr><td>HammingFilter</td>\n<td>Hamming Filter</td>\n</tr>\n<tr><td>BlackmanFilter</td>\n<td>Blackman Filter</td>\n</tr>\n<tr><td>GaussianFilter</td>\n<td>Gaussian Filter</td>\n</tr>\n<tr><td>QuadraticFilter</td>\n<td>Quadratic Filter</td>\n</tr>\n<tr><td>CubicFilter</td>\n<td>Cubic Filter</td>\n</tr>\n<tr><td>CatromFilter</td>\n<td>Catrom Filter</td>\n</tr>\n<tr><td>MitchellFilter</td>\n<td>Mitchell Filter</td>\n</tr>\n<tr><td>LanczosFilter</td>\n<td>Lanczos Filter</td>\n</tr>\n<tr><td>BesselFilter</td>\n<td>Bessel Filter</td>\n</tr>\n<tr><td>SincFilter</td>\n<td>Sinc Filter</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"gravitytype\">\n<h1><a class=\"toc-backref\" href=\"#id11\">GravityType</a></h1>\n<p><em>GravityType</em> specifies positioning of an object (e.g. text, image)\nwithin a bounding region (e.g. an image). Gravity provides a\nconvenient way to locate objects irrespective of the size of the\nbounding region, in other words, you don't need to provide absolute\ncoordinates in order to position an object. A common default for\ngravity is <em>NorthWestGravity</em>.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>GravityType</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>ForgetGravity</td>\n<td>Don't use gravity.</td>\n</tr>\n<tr><td>NorthWestGravity</td>\n<td>Position object at top-left of region.</td>\n</tr>\n<tr><td>NorthGravity</td>\n<td>Postiion object at top-center of region</td>\n</tr>\n<tr><td>NorthEastGravity</td>\n<td>Position object at top-right of region</td>\n</tr>\n<tr><td>WestGravity</td>\n<td>Position object at left-center of region</td>\n</tr>\n<tr><td>CenterGravity</td>\n<td>Position object at center of region</td>\n</tr>\n<tr><td>EastGravity</td>\n<td>Position object at right-center of region</td>\n</tr>\n<tr><td>SouthWestGravity</td>\n<td>Position object at left-bottom of region</td>\n</tr>\n<tr><td>SouthGravity</td>\n<td>Position object at bottom-center of region</td>\n</tr>\n<tr><td>SouthEastGravity</td>\n<td>Position object at bottom-right of region</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"imagetype\">\n<h1><a class=\"toc-backref\" href=\"#id12\">ImageType</a></h1>\n<p><em>ImageType</em> indicates the type classification of the image.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ImageType</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedType</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>BilevelType</td>\n<td>Monochrome bi-level image</td>\n</tr>\n<tr><td>GrayscaleType</td>\n<td>Grayscale image</td>\n</tr>\n<tr><td>GrayscaleMatteType</td>\n<td>Grayscale image with opacity</td>\n</tr>\n<tr><td>PaletteType</td>\n<td>Indexed color (palette) image</td>\n</tr>\n<tr><td>PaletteMatteType</td>\n<td>Indexed color (palette) image with opacity</td>\n</tr>\n<tr><td>TrueColorType</td>\n<td>Truecolor image</td>\n</tr>\n<tr><td>TrueColorMatteType</td>\n<td>Truecolor image with opacity</td>\n</tr>\n<tr><td>ColorSeparationType</td>\n<td>Cyan/Yellow/Magenta/Black (CYMK) image</td>\n</tr>\n<tr><td>OptimizeType</td>\n<td>Optimize type based on image characteristics</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"interlacetype\">\n<h1><a class=\"toc-backref\" href=\"#id13\">InterlaceType</a></h1>\n<p><em>InterlaceType</em> specifies the ordering of the red, green, and blue\npixel information in the image. Interlacing is often used to make\nimage information available to the user faster by taking advantage of\nthe space vs time tradeoff. For example, interlacing allows images on\nthe Web to be recognizable sooner and satellite images to\naccumulate/render with image resolution increasing over time.</p>\n<p>Use <em>LineInterlace</em> or <em>PlaneInterlace</em> to create an interlaced GIF or\nprogressive JPEG image.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>InterlaceType</caption>\n<colgroup>\n<col width=\"31%\" />\n<col width=\"69%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedInterlace</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>NoInterlace</td>\n<td>Don't interlace image (RGBRGBRGBRGBRGBRGB...)</td>\n</tr>\n<tr><td>LineInterlace</td>\n<td>Use scanline interlacing\n(RRR...GGG...BBB...RRR...GGG...BBB...)</td>\n</tr>\n<tr><td>PlaneInterlace</td>\n<td>Use plane interlacing (RRRRRR...GGGGGG...BBBBBB...)</td>\n</tr>\n<tr><td>PartitionInterlace</td>\n<td>Similar to plane interlaing except that the\ndifferent planes are saved to individual files\n(e.g. image.R, image.G, and image.B)</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"id1\">\n<h1><a class=\"toc-backref\" href=\"#id14\">ChannelType</a></h1>\n<p><em>ChannelType</em> is used as an argument when doing color separations. Use\n<em>ChannelType</em> when extracting a layer from an image. <em>MatteLayer</em> is\nuseful for extracting the opacity values from an image.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ChannelType</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedLayer</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>RedLayer</td>\n<td>Select red layer</td>\n</tr>\n<tr><td>GreenLayer</td>\n<td>Select green layer</td>\n</tr>\n<tr><td>BlueLayer</td>\n<td>Select blue layer</td>\n</tr>\n<tr><td>MatteLayer</td>\n<td>Select matte (opacity values) layer</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"linecap\">\n<h1><a class=\"toc-backref\" href=\"#id15\">LineCap</a></h1>\n<p>The <em>LineCap</em> enumerations specify shape to be used at the end of open\nsubpaths when they are stroked. See SVG's <a class=\"reference external\" href=\"http://www.w3.org/TR/SVG/painting.html#StrokeLinecapProperty\">stroke-linecap</a> for\nexamples.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>LineCap</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedCap</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>ButtCap</td>\n<td>Square ending.</td>\n</tr>\n<tr><td>RoundCap</td>\n<td>Rounded ending (half-circle end with radius of 1/2\nstroke width).</td>\n</tr>\n<tr><td>SquareCap</td>\n<td>Square ending, extended by 1/2 the stroke width at\nend.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"linejoin\">\n<h1><a class=\"toc-backref\" href=\"#id16\">LineJoin</a></h1>\n<p>The <em>LineJoin</em> enumerations specify the shape to be used at the\ncorners of paths or basic shapes when they are stroked. See SVG's\n<a class=\"reference external\" href=\"http://www.w3.org/TR/SVG/painting.html#StrokeLinejoinProperty\">stroke-linejoin</a> for\nexamples.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>LineJoin</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedJoin</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>MiterJoin</td>\n<td>Sharp-edged join</td>\n</tr>\n<tr><td>RoundJoin</td>\n<td>Rounded-edged join</td>\n</tr>\n<tr><td>BevelJoin</td>\n<td>Beveled-edged join</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"noisetype\">\n<h1><a class=\"toc-backref\" href=\"#id17\">NoiseType</a></h1>\n<p><em>NoiseType</em> is used as an argument to select the type of noise to be\nadded to the image.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>NoiseType</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedNoise</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>UniformNoise</td>\n<td>Uniform noise</td>\n</tr>\n<tr><td>GaussianNoise</td>\n<td>Gaussian noise</td>\n</tr>\n<tr><td>MultiplicativeGaussianNoise</td>\n<td>Multiplicative Gaussian noise</td>\n</tr>\n<tr><td>ImpulseNoise</td>\n<td>Impulse noise</td>\n</tr>\n<tr><td>LaplacianNoise</td>\n<td>Laplacian noise</td>\n</tr>\n<tr><td>PoissonNoise</td>\n<td>Poisson noise</td>\n</tr>\n<tr><td>RandomNoise</td>\n<td>Random noise</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"orientationtype\">\n<h1><a class=\"toc-backref\" href=\"#id18\">OrientationType</a></h1>\n<p><em>OrientationType</em> specifies the orientation of the image. Useful for\nwhen the image is produced via a different ordinate system, the camera\nwas turned on its side, or the page was scanned sideways.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>OrientationType</caption>\n<colgroup>\n<col width=\"38%\" />\n<col width=\"28%\" />\n<col width=\"34%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Scanline Direction</th>\n<th class=\"head\">Frame Direction</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedOrientation</td>\n<td>Unknown</td>\n<td>Unknown</td>\n</tr>\n<tr><td>TopLeftOrientation</td>\n<td>Left to right</td>\n<td>Top to bottom</td>\n</tr>\n<tr><td>TopRightOrientation</td>\n<td>Right to left</td>\n<td>Top to bottom</td>\n</tr>\n<tr><td>BottomRightOrientation</td>\n<td>Right to left</td>\n<td>Bottom to top</td>\n</tr>\n<tr><td>BottomLeftOrientation</td>\n<td>Left to right</td>\n<td>Bottom to top</td>\n</tr>\n<tr><td>LeftTopOrientation</td>\n<td>Top to bottom</td>\n<td>Left to right</td>\n</tr>\n<tr><td>RightTopOrientation</td>\n<td>Top to bottom</td>\n<td>Right to left</td>\n</tr>\n<tr><td>RightBottomOrientation</td>\n<td>Bottom to top</td>\n<td>Right to left</td>\n</tr>\n<tr><td>LeftBottomOrientation</td>\n<td>Bottom to top</td>\n<td>Left to right</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"paintmethod\">\n<h1><a class=\"toc-backref\" href=\"#id19\">PaintMethod</a></h1>\n<p><em>PaintMethod</em> specifies how pixel colors are to be replaced in the\nimage. It is used to select the pixel-filling algorithm employed.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>PaintMethod</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>PointMethod</td>\n<td>Replace pixel color at point.</td>\n</tr>\n<tr><td>ReplaceMethod</td>\n<td>Replace color for all image pixels matching\ncolor at point.</td>\n</tr>\n<tr><td>FloodfillMethod</td>\n<td>Replace color for pixels surrounding point\nuntil encountering pixel that fails to match\ncolor at point.</td>\n</tr>\n<tr><td>FillToBorderMethod</td>\n<td>Replace color for pixels surrounding point\nuntil encountering pixels matching border\ncolor.</td>\n</tr>\n<tr><td>ResetMethod</td>\n<td>Replace colors for all pixels in image with\npen color.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"quantumtypes\">\n<h1><a class=\"toc-backref\" href=\"#id20\">QuantumTypes</a></h1>\n<p><em>QuantumTypes</em> is used to indicate the source or destination format of\nentire pixels, or components of pixels (&quot;Quantums&quot;) while they are\nbeing read, or written to, a pixel cache. The validity of these format\nspecifications depends on whether the Image pixels are in RGB format,\nRGBA format, or CMYK format. The pixel Quantum size is determined by\nthe Image depth (typically 8, 16, or 32 bits, but any value from 1-64\nbits integer or float is supported).</p>\n<table border=\"1\" class=\"docutils\">\n<caption>RGB(A) Image Quantums</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>IndexQuantum</td>\n<td>PseudoColor colormap indices</td>\n</tr>\n<tr><td>RedQuantum</td>\n<td>Red pixel Quantum</td>\n</tr>\n<tr><td>GreenQuantum</td>\n<td>Green pixel Quantum</td>\n</tr>\n<tr><td>BlueQuantum</td>\n<td>Blue pixel Quantum</td>\n</tr>\n<tr><td>OpacityQuantum</td>\n<td>Opacity (Alpha) Quantum</td>\n</tr>\n</tbody>\n</table>\n<table border=\"1\" class=\"docutils\">\n<caption>CMY(K) Image Quantum</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>CyanQuantum</td>\n<td>Cyan pixel Quantum</td>\n</tr>\n<tr><td>MagentaQuantum</td>\n<td>Magenta pixel Quantum</td>\n</tr>\n<tr><td>YellowQuantum</td>\n<td>Yellow pixel Quantum</td>\n</tr>\n<tr><td>BlackQuantum</td>\n<td>Black pixel Quantum</td>\n</tr>\n</tbody>\n</table>\n<table border=\"1\" class=\"docutils\">\n<caption>Grayscale Image Quantums</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>GrayQuantum</td>\n<td>Gray pixel</td>\n</tr>\n<tr><td>GrayOpacityQuantum</td>\n<td>Pixel opacity</td>\n</tr>\n</tbody>\n</table>\n<table border=\"1\" class=\"docutils\">\n<caption>Entire Pixels (Expressed in Byte Order)</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>RGBQuantum</td>\n<td>RGB pixel (1 to 64 bits)</td>\n</tr>\n<tr><td>RGBAQuantum</td>\n<td>RGBA pixel (1 to 64 bits)</td>\n</tr>\n<tr><td>CMYKQuantum</td>\n<td>CMYK pixel (1 to 64 bits)</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"renderingintent\">\n<h1><a class=\"toc-backref\" href=\"#id21\">RenderingIntent</a></h1>\n<p>Rendering intent is a concept defined by <a class=\"reference external\" href=\"http://www.color.org/\">ICC</a> Spec ICC.1:1998-09, &quot;File Format for Color\nProfiles&quot;. GraphicsMagick uses RenderingIntent in order to support ICC\nColor Profiles.</p>\n<p>From the specification: &quot;Rendering intent specifies the style of\nreproduction to be used during the evaluation of this profile in a\nsequence of profiles. It applies specifically to that profile in the\nsequence and not to the entire sequence. Typically, the user or\napplication will set the rendering intent dynamically at runtime or\nembedding time.&quot;</p>\n<table border=\"1\" class=\"docutils\">\n<caption>RenderingIntent</caption>\n<colgroup>\n<col width=\"36%\" />\n<col width=\"64%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedIntent</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>SaturationIntent</td>\n<td>A rendering intent that specifies the saturation\nof the pixels in the image is preserved perhaps\nat the expense of accuracy in hue and lightness.</td>\n</tr>\n<tr><td>PerceptualIntent</td>\n<td>A rendering intent that specifies the full gamut\nof the image is compressed or expanded to fill\nthe gamut of the destination device. Gray\nbalance is preserved but colorimetric accuracy\nmight not be preserved.</td>\n</tr>\n<tr><td>AbsoluteIntent</td>\n<td>Absolute colorimetric</td>\n</tr>\n<tr><td>RelativeIntent</td>\n<td>Relative colorimetric</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"resolutiontype\">\n<h1><a class=\"toc-backref\" href=\"#id22\">ResolutionType</a></h1>\n<p>By default, GraphicsMagick defines resolutions in pixels per\ninch. <em>ResolutionType</em> provides a means to adjust this.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ResolutionType</caption>\n<colgroup>\n<col width=\"39%\" />\n<col width=\"61%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedResolution</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>PixelsPerInchResolution</td>\n<td>Density specifications are specified in units\nof pixels per inch (english units).</td>\n</tr>\n<tr><td>PixelsPerCentimeterResolution</td>\n<td>Density specifications are specified in units\nof pixels per centimeter (metric units).</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"storagetype\">\n<h1><a class=\"toc-backref\" href=\"#id23\">StorageType</a></h1>\n<p>The <em>StorageType</em> enumerations are used to specify the storage format\nof pixels in the source or destination pixel array.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>StorageType</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>CharPixel</td>\n<td>Character type</td>\n</tr>\n<tr><td>ShortPixel</td>\n<td>Short type</td>\n</tr>\n<tr><td>IntegerPixel</td>\n<td>Integer type</td>\n</tr>\n<tr><td>FloatPixel</td>\n<td>Float type</td>\n</tr>\n<tr><td>DoublePixel</td>\n<td>Double type</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"stretchtype\">\n<h1><a class=\"toc-backref\" href=\"#id24\">StretchType</a></h1>\n<p>The <em>StretchType</em> enumerations are used to specify the relative width\nof a font to the regular width for the font family. If the width is\nnot important, the <em>AnyStretch</em> enumeration may be specified for a\nwildcard match.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>StretchType</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>AnyStretch</td>\n<td>Wildcard match for font stretch</td>\n</tr>\n<tr><td>NormalStretch</td>\n<td>Normal width font</td>\n</tr>\n<tr><td>UltraCondensedStretch</td>\n<td>Ultra-condensed (narrowest) font</td>\n</tr>\n<tr><td>ExtraCondensedStretch</td>\n<td>Extra-condensed font</td>\n</tr>\n<tr><td>CondensedStretch</td>\n<td>Condensed font</td>\n</tr>\n<tr><td>SemiCondensedStretch</td>\n<td>Semi-Condensed font</td>\n</tr>\n<tr><td>SemiExpandedStretch</td>\n<td>Semi-Expanded font</td>\n</tr>\n<tr><td>ExpandedStretch</td>\n<td>Expanded font</td>\n</tr>\n<tr><td>ExtraExpandedStretch</td>\n<td>Extra-Expanded font</td>\n</tr>\n<tr><td>UltraExpandedStretch</td>\n<td>Ultra-expanded (widest) font</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"styletype\">\n<h1><a class=\"toc-backref\" href=\"#id25\">StyleType</a></h1>\n<p>The <em>StyleType</em> enumerations are used to specify the style\n(e.g. Italic) of a font. If the style is not important, the <em>AnyStyle</em>\nenumeration may be specified for a wildcard match.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>StyleType</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>AnyStyle</td>\n<td>Wildcard match for font style</td>\n</tr>\n<tr><td>NormalStyle</td>\n<td>Normal font style</td>\n</tr>\n<tr><td>ItalicStyle</td>\n<td>Italic font style</td>\n</tr>\n<tr><td>ObliqueStyle</td>\n<td>Oblique font style</td>\n</tr>\n</tbody>\n</table>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/Exception.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::Exception</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-exception\">\n<h1 class=\"title\">Magick::Exception</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p><em>Exception</em> represents the base class of objects thrown when\nMagick++ reports an error. Magick++ throws C++ exceptions synchronous\nwith the operation where the error occurred. This allows errors to be\ntrapped within the enclosing code (perhaps the code to process a\nsingle image) while allowing the code to be written with a simple\ncoding style.</p>\n<p>A try/catch block should be placed around any sequence of operations\nwhich can be considered an important body of work. For example, if\nyour program processes lists of images and some of these images may be\ndefective, by placing the try/catch block around the entire sequence\nof code that processes one image (including instantiating the image\nobject), you can minimize the overhead of error checking while\nensuring that all objects created to deal with that object are safely\ndestroyed (C++ exceptions unroll the stack until the enclosing try\nblock, destroying any objects on the stack).</p>\n<p>Note that any objects allocated via 'new' with a pointer on the stack\nare not automatically destroyed by unrolling the stack via a C++\nexception so that it may be necessary to catch the exception at each\nlevel, destroy any objects allocated via 'new' (or malloc()) and then\nre-throw the exception.  This includes constructors which might\nencounter an exception while the object is being constructed and\nshould destroy any already-allocated data.  Magick++ classes are\ndesigned to be <strong>very</strong> tiny so it is recommended to automatically\nallocate them on the stack when possible rather than via 'new'.</p>\n<p>The pseudo code for the main loop of your program may look like:</p>\n<pre class=\"literal-block\">\n using namespace std;\n for infile in list\n {\n   try {\n     // Construct an image instance first so that we don't have to worry\n     // about object construction failure due to a minor warning exception\n     // being thrown.\n     Magick::Image image;\n\n     // Determine if Warning exceptions are thrown.\n     // Use is optional.  Set to true to block Warning exceptions.\n     image.quiet( false );\n\n     try {\n       // Try reading image file\n       image.read(infile);\n     }\n     catch( Magick::WarningCoder &amp;warning )\n     {\n       // Process coder warning while loading file (e.g. TIFF warning)\n       // Maybe the user will be interested in these warnings (or not).\n       // If a warning is produced while loading an image, the image\n       // can normally still be used (but not if the warning was about\n       // something important!)\n       cerr &lt;&lt; “Coder Warning: “ &lt;&lt; warning.what() &lt;&lt; endl;\n     }\n     catch( Magick::Warning &amp;warning )\n     {\n       // Handle any other Magick++ warning.\n       cerr &lt;&lt; “Warning: “ &lt;&lt; warning.what() &lt;&lt; endl;\n     }\n     catch( Magick::ErrorFileOpen &amp;error )\n     {\n       // Process Magick++ file open error\n       cerr &lt;&lt; “Error: “ &lt;&lt; error.what() &lt;&lt; endl;\n       continue; // Try next image.\n     }\n     try {\n       image.rotate(90);\n       image.write(“outfile”);\n     }\n     catch ( MagickExeption &amp; error)\n     {\n        // Handle problem while rotating or writing outfile.\n        cerr &lt;&lt; “Caught Magick++ exception: “ &lt;&lt; error.what() &lt;&lt; endl;\n     }\n   }\n   catch( std::exception &amp;error )\n   {\n      // Process any other exceptions derived from standard C++ exception\n      cerr &lt;&lt; “Caught C++ STD exception: “ &lt;&lt; error.what() &lt;&lt; endl;\n   }\n   catch( ... )\n   {\n     // Process *any* exception (last-ditch effort). There is not a lot\n     // you can do here other to retry the operation that failed, or exit\n     // the program.\n   }\n }\n\nThe desired location and number of try/catch blocks in your program\ndepends how sophisticated its error handling must be. Very simple\nprograms may use just one try/catch block.\n</pre>\n<p>The <em>Exception</em> class is derived from the C++ standard\n<em>std::exception</em> class. This means that it contains a C++ string\ncontaining additional information about the error (e.g to display to\nthe user). Obtain access to this string via the what() method.  For\nexample:</p>\n<pre class=\"literal-block\">\ncatch( Exception &amp;error_ )\n{\n  cout &lt;&lt; &quot;Caught exception: &quot; &lt;&lt; error_.what() &lt;&lt; endl;\n}\n</pre>\n<p>The classes <em>Warning</em> and <em>Error</em> derive from the <em>Exception</em>\nclass. Exceptions derived from <em>Warning</em> are thrown to represent\nnon-fatal errors which may effect the completeness or quality of the\nresult (e.g. one image provided as an argument to montage is\ndefective). In most cases, a <em>Warning</em> exception may be ignored by\ncatching it immediately, processing it (e.g. printing a diagnostic)\nand continuing on. Exceptions derived from <em>Error</em> are thrown to\nrepresent fatal errors that can not produce a valid result\n(e.g. attempting to read a file which does not exist).</p>\n<p>The specific derived exception classes are shown in the following tables:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Warning (Suspect but completed) Sub-Classes</caption>\n<colgroup>\n<col width=\"35%\" />\n<col width=\"65%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Warning</th>\n<th class=\"head\">Warning Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>WarningUndefined</td>\n<td>Unspecified type.</td>\n</tr>\n<tr><td>WarningBlob</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningCache</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningCoder</td>\n<td>Issued by some coders.</td>\n</tr>\n<tr><td>WarningConfigure</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningCorruptImage</td>\n<td>Issued when an image may be corrupt.</td>\n</tr>\n<tr><td>WarningDelegate</td>\n<td>Reported by a subordinate program.</td>\n</tr>\n<tr><td>WarningDraw</td>\n<td>Reported by the rendering subsystem.</td>\n</tr>\n<tr><td>WarningFileOpen</td>\n<td>Reported when file could not be opened.</td>\n</tr>\n<tr><td>WarningImage</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningMissingDelegate</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningModule</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningMonitor</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningOption</td>\n<td>Reported when an option is incorrect.</td>\n</tr>\n<tr><td>WarningRegistry</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningResourceLimit</td>\n<td>Reported when a resource is exhausted.</td>\n</tr>\n<tr><td>WarningStream</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningType</td>\n<td>NOT CURRENTLY USED</td>\n</tr>\n<tr><td>WarningXServer</td>\n<td>Warnings reported by the X11 subsystem.</td>\n</tr>\n</tbody>\n</table>\n<table border=\"1\" class=\"docutils\">\n<caption>Error (Failed) Sub-Classes</caption>\n<colgroup>\n<col width=\"33%\" />\n<col width=\"67%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Error</th>\n<th class=\"head\">Error Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>ErrorUndefined</td>\n<td>Unspecified error type.</td>\n</tr>\n<tr><td>ErrorBlob</td>\n<td>Reported by BLOB I/O subsystem.</td>\n</tr>\n<tr><td>ErrorCache</td>\n<td>Reported by the pixel cache subsystem.</td>\n</tr>\n<tr><td>ErrorCoder</td>\n<td>Reported by coders (image format support).</td>\n</tr>\n<tr><td>ErrorConfigure</td>\n<td>Reported while loading configuration files.</td>\n</tr>\n<tr><td>ErrorCorruptImage</td>\n<td>Reported when the image file is corrupt.</td>\n</tr>\n<tr><td>ErrorDelegate</td>\n<td>Reported by a subordinate program</td>\n</tr>\n<tr><td>ErrorDraw</td>\n<td>Reported while drawing on image.</td>\n</tr>\n<tr><td>ErrorFileOpen</td>\n<td>Reported when the image file can not be opened.</td>\n</tr>\n<tr><td>ErrorImage</td>\n<td>Reported while drawing.</td>\n</tr>\n<tr><td>ErrorMissingDelegate</td>\n<td>Reported when optional add-on library or\nsubordinate program is missing (but is needed).</td>\n</tr>\n<tr><td>ErrorModule</td>\n<td>Reported by the module loader subsystem.</td>\n</tr>\n<tr><td>ErrorMonitor</td>\n<td>Reported by the progress monitor.</td>\n</tr>\n<tr><td>ErrorOption</td>\n<td>Reported when option is malformed or out of range.</td>\n</tr>\n<tr><td>ErrorRegistry</td>\n<td>Reported by the image/BLOB registry subsystem.</td>\n</tr>\n<tr><td>ErrorResourceLimit</td>\n<td>Reported when a program resource is exhausted.</td>\n</tr>\n<tr><td>ErrorStream</td>\n<td>Reported by the pixel stream subsystem.</td>\n</tr>\n<tr><td>ErrorType</td>\n<td>Reported by the type (font) rendering subsystem.</td>\n</tr>\n<tr><td>ErrorXServer</td>\n<td>Reported by the X11 subsystem.</td>\n</tr>\n</tbody>\n</table>\n<p>Note that <em>ErrorMissingDelegate</em> is a &quot;catch-all&quot; error reported when\nGraphicsMagick is unable to figure out how to open the file.</p>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/FormatCharacters.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Special Format Characters</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"special-format-characters\">\n<h1 class=\"title\">Special Format Characters</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The Magick::Image methods <a class=\"reference external\" href=\"Image.html#annotate\">annotate</a>, <a class=\"reference external\" href=\"Image.html#draw\">draw</a>, <a class=\"reference external\" href=\"Image.html#label\">label</a>, and the template\nfunction <a class=\"reference external\" href=\"STL.html#montageImages\">montageImages</a> support special\nformat characters contained in the argument text. These format\ncharacters work similar to C's printf. Whenever a format character\nappears in the text, it is replaced with the equivalent attribute\ntext. The available format characters are shown in the following\ntable:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Format Characters</caption>\n<colgroup>\n<col width=\"37%\" />\n<col width=\"63%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Format Character</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>%b</td>\n<td>file size</td>\n</tr>\n<tr><td>%d</td>\n<td>directory</td>\n</tr>\n<tr><td>%e</td>\n<td>filename extension</td>\n</tr>\n<tr><td>%f</td>\n<td>filename</td>\n</tr>\n<tr><td>%h</td>\n<td>height</td>\n</tr>\n<tr><td>%m</td>\n<td>magick (e.g GIF)</td>\n</tr>\n<tr><td>%p</td>\n<td>page number</td>\n</tr>\n<tr><td>%s</td>\n<td>scene number</td>\n</tr>\n<tr><td>%t</td>\n<td>top of filename</td>\n</tr>\n<tr><td>%w</td>\n<td>width</td>\n</tr>\n<tr><td>%x</td>\n<td>x resolution</td>\n</tr>\n<tr><td>%y</td>\n<td>y resolution</td>\n</tr>\n<tr><td>n</td>\n<td>newline</td>\n</tr>\n<tr><td>r</td>\n<td>carriage return</td>\n</tr>\n</tbody>\n</table>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/Geometry.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::Geometry</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-geometry\">\n<h1 class=\"title\">Magick::Geometry</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>Geometry provides a convenient means to specify a geometry\nargument. The object may be initialized from a C string or C++ string\ncontaining a geometry specification. It may also be initialized by\nmore efficient parameterized constructors.</p>\n<div class=\"section\" id=\"x11-geometry-specifications\">\n<h1>X11 Geometry Specifications</h1>\n<p>X11 geometry specifications are in the form\n&quot;&lt;width&gt;x&lt;height&gt;{+-}&lt;xoffset&gt;{+-}&lt;yoffset&gt;&quot; (where width, height,\nxoffset, and yoffset are numbers) for specifying the size and\nplacement location for an object.</p>\n<p>The width and height parts of the geometry specification are measured\nin pixels. The xoffset and yoffset parts are also measured in pixels\nand are used to specify the distance of the placement coordinate from\nthe left and top and edges of the image, respectively. Both types of\noffsets are measured from the indicated edge of the object to the\ncorresponding edge of the image. The X offset may be specified in the\nfollowing ways:</p>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"13%\" />\n<col width=\"87%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>+xoffset</td>\n<td>The left edge of the object is to be placed xoffset\npixels in from the left edge of the image.</td>\n</tr>\n<tr><td>-xoffset</td>\n<td>The left edge of the object is to be placed outside the\nimage, xoffset pixels out from the left edge of the image.</td>\n</tr>\n</tbody>\n</table>\n<p>The Y offset has similar meanings:</p>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"14%\" />\n<col width=\"86%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>+yoffset</td>\n<td>The top edge of the object is to be yoffset pixels below\nthe top edge of the image.</td>\n</tr>\n<tr><td>-yoffset</td>\n<td>The top edge of the object is to be yoffset pixels above\nthe top edge of the image.</td>\n</tr>\n</tbody>\n</table>\n<p>Offsets must be given as pairs; in other words, in order to specify\neither xoffset or yoffset both must be present.</p>\n</div>\n<div class=\"section\" id=\"graphicsmagick-extensions-to-x11-geometry-specifications\">\n<h1>GraphicsMagick Extensions To X11 Geometry Specifications</h1>\n<p>GraphicsMagick has added a number of qualifiers to the standard\ngeometry string for use when resizing images. The form of an extended\ngeometry string is\n&quot;&lt;width&gt;x&lt;height&gt;{+-}&lt;xoffset&gt;{+-}&lt;yoffset&gt;{%}{&#64;}{!}{^}{&lt;}{&gt;}&quot;. Extended\ngeometry strings should only be used when resizing an image. Using an\nextended geometry string for other applications may cause the API call\nto fail. The available qualifiers are shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>GraphicsMagick Geometry Qualifiers</caption>\n<colgroup>\n<col width=\"12%\" />\n<col width=\"88%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Qualifier</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>%</td>\n<td>Interpret width and height as a percentage of the current size.</td>\n</tr>\n<tr><td>!</td>\n<td>Resize to width and height exactly, loosing original aspect ratio.</td>\n</tr>\n<tr><td>&lt;</td>\n<td>Resize only if the image is smaller than the geometry specification.</td>\n</tr>\n<tr><td>&gt;</td>\n<td>Resize only if the image is greater than the geometry specification.</td>\n</tr>\n<tr><td>&#64;</td>\n<td>Resize such that width and height are a maximum area in total pixels.</td>\n</tr>\n<tr><td>^</td>\n<td>Dimensions are treated as minimum rather than maximum values.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"postscript-page-size-extension-to-geometry-specifications\">\n<h1>Postscript Page Size Extension To Geometry Specifications</h1>\n<p>Any geometry string specification supplied to the Geometry constructor\nis considered to be a Postscript page size nickname if the first\ncharacter is not numeric. The page size nickname is not case\nsensitive. The Geometry constructor converts these page size\nspecifications into the equivalent numeric geometry string\nspecification (preserving any offset component) prior to conversion to\nthe internal object format. Postscript page size specifications are\nshort-hand for the pixel geometry required to fill a page of that\nsize. Since the 11x17 inch page size used in the US starts with a\ndigit, it is not supported as a Postscript page size\nnickname. Instead, substitute the geometry specification &quot;792x1224&gt;&quot;\nwhen 11x17 output is desired.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Postscript Page Size Nicknames</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Postscript Nickname</th>\n<th class=\"head\">Equivalent Extended Geometry Specification</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>A0</td>\n<td>2384x3370&gt;</td>\n</tr>\n<tr><td>A1</td>\n<td>1684x2384&gt;</td>\n</tr>\n<tr><td>A10</td>\n<td>73x105&gt;</td>\n</tr>\n<tr><td>A2</td>\n<td>1191x1684&gt;</td>\n</tr>\n<tr><td>A3</td>\n<td>842x1191&gt;</td>\n</tr>\n<tr><td>A4</td>\n<td>595x842&gt;</td>\n</tr>\n<tr><td>A4SMALL</td>\n<td>595x842&gt;</td>\n</tr>\n<tr><td>A5</td>\n<td>420x595&gt;</td>\n</tr>\n<tr><td>A6</td>\n<td>297x420&gt;</td>\n</tr>\n<tr><td>A7</td>\n<td>210x297&gt;</td>\n</tr>\n<tr><td>A8</td>\n<td>148x210&gt;</td>\n</tr>\n<tr><td>A9</td>\n<td>105x148&gt;</td>\n</tr>\n<tr><td>ARCHA</td>\n<td>648x864&gt;</td>\n</tr>\n<tr><td>ARCHB</td>\n<td>864x1296&gt;</td>\n</tr>\n<tr><td>ARCHC</td>\n<td>1296x1728&gt;</td>\n</tr>\n<tr><td>ARCHD</td>\n<td>1728x2592&gt;</td>\n</tr>\n<tr><td>ARCHE</td>\n<td>2592x3456&gt;</td>\n</tr>\n<tr><td>B0</td>\n<td>2920x4127&gt;</td>\n</tr>\n<tr><td>B1</td>\n<td>2064x2920&gt;</td>\n</tr>\n<tr><td>B10</td>\n<td>91x127&gt;</td>\n</tr>\n<tr><td>B2</td>\n<td>1460x2064&gt;</td>\n</tr>\n<tr><td>B3</td>\n<td>1032x1460&gt;</td>\n</tr>\n<tr><td>B4</td>\n<td>729x1032&gt;</td>\n</tr>\n<tr><td>B5</td>\n<td>516x729&gt;</td>\n</tr>\n<tr><td>B6</td>\n<td>363x516&gt;</td>\n</tr>\n<tr><td>B7</td>\n<td>258x363&gt;</td>\n</tr>\n<tr><td>B8</td>\n<td>181x258&gt;</td>\n</tr>\n<tr><td>B9</td>\n<td>127x181&gt;</td>\n</tr>\n<tr><td>C0</td>\n<td>2599x3676&gt;</td>\n</tr>\n<tr><td>C1</td>\n<td>1837x2599&gt;</td>\n</tr>\n<tr><td>C2</td>\n<td>1298x1837&gt;</td>\n</tr>\n<tr><td>C3</td>\n<td>918x1296&gt;</td>\n</tr>\n<tr><td>C4</td>\n<td>649x918&gt;</td>\n</tr>\n<tr><td>C5</td>\n<td>459x649&gt;</td>\n</tr>\n<tr><td>C6</td>\n<td>323x459&gt;</td>\n</tr>\n<tr><td>C7</td>\n<td>230x323&gt;</td>\n</tr>\n<tr><td>EXECUTIVE</td>\n<td>540x720&gt;</td>\n</tr>\n<tr><td>FLSA</td>\n<td>612x936&gt;</td>\n</tr>\n<tr><td>FLSE</td>\n<td>612x936&gt;</td>\n</tr>\n<tr><td>FOLIO</td>\n<td>612x936&gt;</td>\n</tr>\n<tr><td>HALFLETTER</td>\n<td>396x612&gt;</td>\n</tr>\n<tr><td>ISOB0</td>\n<td>2835x4008&gt;</td>\n</tr>\n<tr><td>ISOB1</td>\n<td>2004x2835&gt;</td>\n</tr>\n<tr><td>ISOB10</td>\n<td>88x125&gt;</td>\n</tr>\n<tr><td>ISOB2</td>\n<td>1417x2004&gt;</td>\n</tr>\n<tr><td>ISOB3</td>\n<td>1001x1417&gt;</td>\n</tr>\n<tr><td>ISOB4</td>\n<td>709x1001&gt;</td>\n</tr>\n<tr><td>ISOB5</td>\n<td>499x709&gt;</td>\n</tr>\n<tr><td>ISOB6</td>\n<td>354x499&gt;</td>\n</tr>\n<tr><td>ISOB7</td>\n<td>249x354&gt;</td>\n</tr>\n<tr><td>ISOB8</td>\n<td>176x249&gt;</td>\n</tr>\n<tr><td>ISOB9</td>\n<td>125x176&gt;</td>\n</tr>\n<tr><td>LEDGER</td>\n<td>1224x792&gt;</td>\n</tr>\n<tr><td>LEGAL</td>\n<td>612x1008&gt;</td>\n</tr>\n<tr><td>LETTER</td>\n<td>612x792&gt;</td>\n</tr>\n<tr><td>LETTERSMALL</td>\n<td>612x792&gt;</td>\n</tr>\n<tr><td>QUARTO</td>\n<td>610x780&gt;</td>\n</tr>\n<tr><td>STATEMENT</td>\n<td>396x612&gt;</td>\n</tr>\n<tr><td>TABLOID</td>\n<td>792x1224&gt;</td>\n</tr>\n</tbody>\n</table>\n<p>The following is the definition of the Magick::Geometry class:</p>\n<pre class=\"literal-block\">\nclass Geometry\n{\npublic:\n\n  Geometry ( unsigned int width_,\n             unsigned int height_,\n             unsigned int xOff_ = 0,\n             unsigned int yOff_ = 0,\n             bool xNegative_ = false,\n             bool yNegative_ = false );\n  Geometry ( const std::string &amp;geometry_ );\n  Geometry ( const char * geometry_ );\n  Geometry ( const Geometry &amp;geometry_ );\n  Geometry ( );\n  ~Geometry ( void );\n\n  // Width\n  void          width ( unsigned int width_ );\n  unsigned int  width ( void ) const;\n\n  // Height\n  void          height ( unsigned int height_ );\n  unsigned int  height ( void ) const;\n\n  // X offset from origin\n  void          xOff ( unsigned int xOff_ );\n  unsigned int  xOff ( void ) const;\n\n  // Y offset from origin\n  void          yOff ( unsigned int yOff_ );\n  unsigned int  yOff ( void ) const;\n\n  // Sign of X offset negative? (X origin at right)\n  void          xNegative ( bool xNegative_ );\n  bool          xNegative ( void ) const;\n\n  // Sign of Y offset negative? (Y origin at bottom)\n  void          yNegative ( bool yNegative_ );\n  bool          yNegative ( void ) const;\n\n  // Width and height are expressed as percentages\n  void          percent ( bool percent_ );\n  bool          percent ( void ) const;\n\n  // Resize without preserving aspect ratio (!)\n  void          aspect ( bool aspect_ );\n  bool          aspect ( void ) const;\n\n  // Resize if image is greater than size (&gt;)\n  void          greater ( bool greater_ );\n  bool          greater ( void ) const;\n\n  // Resize if image is less than size (&lt;)\n  void          less ( bool less_ );\n  bool          less ( void ) const;\n\n  // Resize image to fit total pixel area specified by dimensions (&#64;).\n  void          limitPixels ( bool limitPixels_ );\n  bool          limitPixels ( void ) const;\n\n  // Dimensions are treated as minimum rather than maximum values (^)\n  void          fillArea ( bool fillArea_ );\n  bool          fillArea ( void ) const;\n\n  // Does object contain valid geometry?\n  void          isValid ( bool isValid_ );\n  bool          isValid ( void ) const;\n\n  // Set via geometry string\n  const Geometry&amp; operator = ( const std::string &amp;geometry_ );\n  const Geometry&amp; operator = ( const char * geometry_ );\n\n  // Assignment operator\n  Geometry&amp; operator= ( const Geometry&amp; Geometry_ );\n\n  // Return geometry string\n  operator std::string() const;\n\n};\n</pre>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/Image.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::Image Class</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-image-class\">\n<h1 class=\"title\">Magick::Image Class</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#introduction\" id=\"id9\">Introduction</a></li>\n<li><a class=\"reference internal\" href=\"#blobs\" id=\"id10\">BLOBs</a></li>\n<li><a class=\"reference internal\" href=\"#construct-an-image\" id=\"id11\">Construct An Image</a></li>\n<li><a class=\"reference internal\" href=\"#read-or-write-an-image\" id=\"id12\">Read Or Write An Image</a></li>\n<li><a class=\"reference internal\" href=\"#manipulate-an-image\" id=\"id13\">Manipulate An Image</a></li>\n<li><a class=\"reference internal\" href=\"#set-get-image-attributes\" id=\"id14\">Set/Get Image Attributes</a></li>\n<li><a class=\"reference internal\" href=\"#low-level-image-pixel-access\" id=\"id15\">Low-Level Image Pixel Access</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"introduction\">\n<h1><a class=\"toc-backref\" href=\"#id9\">Introduction</a></h1>\n<p>Image is the primary object in Magick++ and represents a single image\nframe (see <a class=\"reference external\" href=\"ImageDesign.html\">image design</a>). The <a class=\"reference external\" href=\"STL.html\">STL</a> interface must be used to\noperate on image sequences or images (e.g. of format GIF, TIFF, MIFF,\nPostscript, &amp; MNG) which are comprized of multiple image\nframes. Individual frames of a multi-frame image may be requested by\nadding array-style notation to the end of the file name\n(e.g. &quot;animation.gif[3]&quot; retrieves the fourth frame of a GIF\nanimation.  Various image manipulation operations may be applied to\nthe image. Attributes may be set on the image to influence the\noperation of the manipulation operations. The <a class=\"reference external\" href=\"Pixels.html\">Pixels</a> class provides\nlow-level access to image pixels. As a convenience, including\n&lt;Magick++.h&gt; is sufficient in order to use the complete Magick++\nAPI. The Magick++ API is enclosed within the Magick namespace so you\nmust either add the prefix &quot; Magick:: &quot; to each class/enumeration name\nor add the statement &quot; using namespace Magick;&quot; after including the\nMagick++.h header.</p>\n<p>The InitializeMagick() function <em>MUST</em> be invoked before constructing\nany Magick++ objects.  This used to be optional, but now it is\nabsolutely required.  This function initalizes semaphores and\nconfiguration information necessary for the software to work\ncorrectly.  Failing to invoke InitializeMagick() is likely to lead to\na program crash or thrown assertion.  If the program resides in the\nsame directory as the GraphicsMagick files, then argv[0] may be passed\nas an argument so that GraphicsMagick knows where its files reside,\notherwise NULL may be passed and GraphicsMagick will try to use other\nmeans (if necessary).</p>\n<p>The preferred way to allocate Image objects is via automatic\nallocation (on the stack). There is no concern that allocating Image\nobjects on the stack will excessively enlarge the stack since Magick++\nallocates all large data objects (such as the actual image data) from\nthe heap. Use of automatic allocation is preferred over explicit\nallocation (via new) since it is much less error prone and allows use\nof C++ scoping rules to avoid memory leaks. Use of automatic\nallocation allows Magick++ objects to be assigned and copied just like\nthe C++ intrinsic data types (e.g. 'int '), leading to clear and easy\nto read code. Use of automatic allocation leads to naturally\nexception-safe code since if an exception is thrown, the object is\nautomatically deallocated once the stack unwinds past the scope of the\nallocation (not the case for objects allocated via new ).</p>\n<p>Image is very easy to use. For example, here is a the source to a\nprogram which reads an image, crops it, and writes it to a new file\n(the exception handling is optional but strongly recommended):</p>\n<pre class=\"literal-block\">\n#include &lt;Magick++.h&gt;\n#include &lt;iostream&gt;\nusing namespace std;\nusing namespace Magick;\nint main(int argc,char **argv)\n{\n  // Initialize the API.  Can pass NULL if argv is not available.\n  InitializeMagick(*argv);\n\n  // Construct the image object. Seperating image construction from the\n  // the read operation ensures that a failure to read the image file\n  // doesn't render the image object useless.\n  Image image;\n\n  try {\n    // Determine if Warning exceptions are thrown.\n    // Use is optional.  Set to true to block Warning exceptions.\n    image.quiet( false );\n\n    // Read a file into image object\n    image.read( &quot;girl.gif&quot; );\n\n    // Crop the image to specified size (width, height, xOffset, yOffset)\n    image.crop( Geometry(100,100, 100, 100) );\n\n    // Write the image to a file\n    image.write( &quot;x.gif&quot; );\n  }\n  catch( Exception &amp;error_ )\n    {\n      cout &lt;&lt; &quot;Caught exception: &quot; &lt;&lt; error_.what() &lt;&lt; endl;\n      return 1;\n    }\n  return 0;\n}\n</pre>\n<p>The following is the source to a program which illustrates the use of\nMagick++'s efficient reference-counted assignment and copy-constructor\noperations which minimize use of memory and eliminate unncessary copy\noperations (allowing Image objects to be efficiently assigned, and\ncopied into containers).  The program accomplishes the following:</p>\n<ol class=\"arabic simple\">\n<li>Read master image.</li>\n<li>Assign master image to second image.</li>\n<li>Zoom second image to the size 640x480.</li>\n<li>Assign master image to a third image.</li>\n<li>Zoom third image to the size 800x600.</li>\n<li>Write the second image to a file.</li>\n<li>Write the third image to a file.</li>\n</ol>\n<pre class=\"literal-block\">\n#include &lt;Magick++.h&gt;\n#include &lt;iostream&gt;\nusing namespace std;\nusing namespace Magick;\nint main(int argc,char **argv)\n{\n    InitializeMagick(*argv);\n    Image master(&quot;horse.jpg&quot;);\n    Image second = master;\n    second.zoom(&quot;640x480&quot;);\n    Image third = master;\n    third.zoom(&quot;800x600&quot;);\n    second.write(&quot;horse640x480.jpg&quot;);\n    third.write(&quot;horse800x600.jpg&quot;);\n    return 0;\n}\n</pre>\n<p>During the entire operation, a maximum of three images exist in memory\nand the image data is never copied.</p>\n<p>The following is the source for another simple program which creates a\n100 by 100 pixel white image with a red pixel in the center and writes\nit to a file:</p>\n<pre class=\"literal-block\">\n#include &lt;Magick++.h&gt;\nusing namespace std;\nusing namespace Magick;\nint main(int argc,char **argv)\n{\n    InitializeMagick(*argv);\n    Image image( &quot;100x100&quot;, &quot;white&quot; );\n    image.pixelColor( 49, 49, &quot;red&quot; );\n    image.write( &quot;red_pixel.png&quot; );\n    return 0;\n}\n</pre>\n<p>If you wanted to change the color image to grayscale, you could add\nthe lines:</p>\n<pre class=\"literal-block\">\nimage.quantizeColorSpace( GRAYColorspace );\nimage.quantizeColors( 256 );\nimage.quantize( );\n</pre>\n<p>or, more simply:</p>\n<pre class=\"literal-block\">\nimage.type( GrayscaleType );\n</pre>\n<p>prior to writing the image.</p>\n</div>\n<div class=\"section\" id=\"blobs\">\n<h1><a class=\"toc-backref\" href=\"#id10\">BLOBs</a></h1>\n<p>While encoded images (e.g. JPEG) are most often written-to and\nread-from a disk file, encoded images may also reside in\nmemory. Encoded images in memory are known as BLOBs (Binary Large\nOBjects) and may be represented using the <a class=\"reference external\" href=\"Blob.html\">Blob</a> class. The encoded\nimage may be initially placed in memory by reading it directly from a\nfile, reading the image from a database, memory-mapped from a disk\nfile, or could be written to memory by Magick++. Once the encoded\nimage has been placed within a <a class=\"reference external\" href=\"Blob.html\">Blob</a>, it may be read into a Magick++\nImage via a constructor or read() . Likewise, a Magick++ image may be\nwritten to a <a class=\"reference external\" href=\"Blob.html\">Blob</a> via write().</p>\n<p>An example of using Image to write to a <a class=\"reference external\" href=\"Blob.html\">Blob</a> follows:</p>\n<pre class=\"literal-block\">\n#include &lt;Magick++.h&gt;\nusing namespace std;\nusing namespace Magick;\nint main(int argc,char **argv)\n{\n    // Read GIF file from disk\n    Image image( &quot;giraffe.gif&quot; );\n\n    // Write to BLOB in JPEG format\n    Blob blob;\n    image.magick( &quot;JPEG&quot; ) // Set JPEG output format\n    image.write( &amp;blob );\n\n    [ Use BLOB data (in JPEG format) here ]\n\n    return 0;\n}\n</pre>\n<p>likewise, to read an image from a <a class=\"reference external\" href=\"Blob.html\">Blob</a>, you could use one of the\nfollowing examples:</p>\n<p>[ Entry condition for the following examples is that data is pointer\nto encoded image data and length represents the size of the data ]</p>\n<pre class=\"literal-block\">\nBlob blob( data, length );\nImage image( blob );\n</pre>\n<p>or</p>\n<pre class=\"literal-block\">\nBlob blob( data, length );\nImage image;\nimage.read( blob);\n</pre>\n<p>Some images do not contain their size or format so the size and format\nmust be specified in advance:</p>\n<pre class=\"literal-block\">\nBlob blob( data, length );\nImage image;\nimage.size( &quot;640x480&quot;)\nimage.magick( &quot;RGBA&quot; );\nimage.read( blob);\n</pre>\n</div>\n<div class=\"section\" id=\"construct-an-image\">\n<h1><a class=\"toc-backref\" href=\"#id11\">Construct An Image</a></h1>\n<p>An Image may be constructed in a number of ways. It may be constructed\nfrom a file, a URL, or an encoded image (e.g. JPEG) contained in an\nin-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a> . The following Image constructors and assignment\noperators are available:</p>\n<p>Construct from image file or image specification:</p>\n<pre class=\"literal-block\">\nImage( const std::string &amp;imageSpec_ )\n</pre>\n<p>Construct a blank image canvas of specified size and <a class=\"reference external\" href=\"Color.html\">color</a>:</p>\n<pre class=\"literal-block\">\nImage( const Geometry &amp;size_, const Color &amp;color_ )\n</pre>\n<p>Construct Image from in-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nImage ( const Blob &amp;blob_ )\n</pre>\n<p>Construct Image of specified size from in-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nImage ( const Blob &amp;blob_, const Geometry &amp;size_ )\n</pre>\n<p>Construct Image of specified size and depth from in-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nImage ( const Blob &amp;blob_, const Geometry &amp;size,\n        const unsigned int depth )\n</pre>\n<p>Construct Image of specified size, depth, and format from in-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nImage ( const Blob &amp;blob_, const Geometry &amp;size,\n        const unsigned int depth_,\n        const std::string &amp;magick_ )\n</pre>\n<p>Construct Image of specified size, and format from in-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nImage ( const Blob &amp;blob_, const Geometry &amp;size,\n        const std::string &amp;magick_ )\n</pre>\n<p>Construct an image based on an array of raw pixels, of specified type\nand mapping, in memory:</p>\n<pre class=\"literal-block\">\nImage ( const unsigned int width_,\n        const unsigned int height_,\n        const std::string &amp;map_,\n        const StorageType type_,\n        const void *pixels_ )\n</pre>\n<p>Default constructor:</p>\n<pre class=\"literal-block\">\nImage( void )\n</pre>\n<p>Copy constructor:</p>\n<pre class=\"literal-block\">\nImage ( const Image &amp; image_ )\n</pre>\n<p>Assignment operator:</p>\n<pre class=\"literal-block\">\nImage&amp; operator= ( const Image &amp;image_ )\n</pre>\n</div>\n<div class=\"section\" id=\"read-or-write-an-image\">\n<h1><a class=\"toc-backref\" href=\"#id12\">Read Or Write An Image</a></h1>\n<div class=\"contents local topic\" id=\"id1\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#ping\" id=\"id16\">ping</a></li>\n<li><a class=\"reference internal\" href=\"#read\" id=\"id17\">read</a></li>\n<li><a class=\"reference internal\" href=\"#write\" id=\"id18\">write</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"ping\">\n<h2><a class=\"toc-backref\" href=\"#id16\">ping</a></h2>\n<p>Ping is similar to <a class=\"reference internal\" href=\"#read\">read</a> except only enough of the image is read to\ndetermine the image columns, rows, and filesize.  Access the\ncolumns(), rows(), and fileSize() attributes after invoking ping.\nOther attributes may also be available.  The image pixels are not\nvalid after calling ping:</p>\n<pre class=\"literal-block\">\nvoid            ping ( const std::string &amp;imageSpec_ )\n</pre>\n<p>Ping is similar to read except only enough of the image is read\nto determine the image columns, rows, and filesize.  Access the\ncolumns(), rows(), and fileSize() attributes after invoking\nping.  The image pixels are not valid after calling ping:</p>\n<pre class=\"literal-block\">\nvoid            ping ( const Blob &amp;blob_ )\n</pre>\n</div>\n<div class=\"section\" id=\"read\">\n<h2><a class=\"toc-backref\" href=\"#id17\">read</a></h2>\n<p>Read single image frame into current object.  Use <a class=\"reference internal\" href=\"#ping\">ping</a> instead if you\nwant to obtain the basic attributes of the image without reading the\nwhole file/blob:</p>\n<pre class=\"literal-block\">\nvoid            read ( const std::string &amp;imageSpec_ )\n</pre>\n<p>Read single image frame of specified size into current object:</p>\n<pre class=\"literal-block\">\nvoid            read ( const Geometry &amp;size_,\n                       const std::string &amp;imageSpec_ )\n</pre>\n<p>Read single image frame from in-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nvoid            read ( const Blob        &amp;blob_ )\n</pre>\n<p>Read single image frame of specified size from in-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nvoid            read ( const Blob        &amp;blob_,\n                       const Geometry    &amp;size_ )\n</pre>\n<p>Read single image frame of specified size and depth from in-memory\n<a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nvoid            read ( const Blob         &amp;blob_,\n                       const Geometry     &amp;size_,\n                       const unsigned int depth_ )\n</pre>\n<p>Read single image frame of specified size, depth, and format from\nin-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nvoid            read ( const Blob         &amp;blob_,\n                       const Geometry     &amp;size_,\n                       const unsigned int depth_,\n                       const std::string  &amp;magick_ )\n</pre>\n<p>Read single image frame of specified size, and format from in-memory\n<a class=\"reference external\" href=\"Blob.html\">Blob</a>:</p>\n<pre class=\"literal-block\">\nvoid            read ( const Blob         &amp;blob_,\n                       const Geometry     &amp;size_,\n                       const std::string  &amp;magick_ )\n</pre>\n<p>Read single image frame from an array of raw pixels, with\nspecified storage type (ConstituteImage), e.g.\n<tt class=\"docutils literal\">image.read( 640, 480, &quot;RGB&quot;, 0, pixels )</tt>:</p>\n<pre class=\"literal-block\">\nvoid            read ( const unsigned int width_,\n                       const unsigned int height_,\n                       const std::string &amp;map_,\n                       const StorageType  type_,\n                       const void        *pixels_ )\n</pre>\n</div>\n<div class=\"section\" id=\"write\">\n<h2><a class=\"toc-backref\" href=\"#id18\">write</a></h2>\n<p>Write single image frame to a file:</p>\n<pre class=\"literal-block\">\nvoid            write ( const std::string &amp;imageSpec_ )\n</pre>\n<p>Write single image frame to in-memory <a class=\"reference external\" href=\"Blob.html\">Blob</a>, with optional format and\nadjoin parameters:</p>\n<pre class=\"literal-block\">\nvoid            write ( Blob *blob_ )\n\nvoid            write ( Blob *blob_,\n                        const std::string &amp;magick_ )\n\nvoid            write ( Blob *blob_,\n                        const std::string &amp;magick_,\n                        const unsigned int depth_ )\n</pre>\n<p>Write single image frame to an array of pixels with storage type\nspecified by user (DispatchImage), e.g.  <tt class=\"docutils literal\">image.write( 0, 0, 640, 1,\n&quot;RGB&quot;, 0, pixels )</tt>:</p>\n<pre class=\"literal-block\">\nvoid            write ( const int x_,\n                        const int y_,\n                        const unsigned int columns_,\n                        const unsigned int rows_,\n                        const std::string&amp; map_,\n                        const StorageType type_,\n                        void *pixels_ )\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"manipulate-an-image\">\n<h1><a class=\"toc-backref\" href=\"#id13\">Manipulate An Image</a></h1>\n<p>Image supports access to all the single-image (versus image-list)\nmanipulation operations provided by the GraphicsMagick library. If you\nmust process a multi-image file (such as an animation), the <a class=\"reference external\" href=\"STL.html\">STL</a>\ninterface , which provides a multi-image abstraction on top of Image,\nmust be used.</p>\n<p>Image manipulation methods are very easy to use.  For example:</p>\n<pre class=\"literal-block\">\nImage image;\nimage.read(&quot;myImage.tiff&quot;);\nimage.addNoise(GaussianNoise);\nimage.write(&quot;myImage.tiff&quot;);\n</pre>\n<p>adds gaussian noise to the image file &quot;myImage.tiff&quot;.</p>\n<p>The following image manipulation methods are available:</p>\n<div class=\"contents local topic\" id=\"id2\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#adaptivethreshold\" id=\"id19\">adaptiveThreshold</a></li>\n<li><a class=\"reference internal\" href=\"#addnoise\" id=\"id20\">addNoise</a></li>\n<li><a class=\"reference internal\" href=\"#addnoisechannel\" id=\"id21\">addNoiseChannel</a></li>\n<li><a class=\"reference internal\" href=\"#affinetransform\" id=\"id22\">affineTransform</a></li>\n<li><a class=\"reference internal\" href=\"#annotate\" id=\"id23\">annotate</a></li>\n<li><a class=\"reference internal\" href=\"#autoorient\" id=\"id24\">autoOrient</a></li>\n<li><a class=\"reference internal\" href=\"#blur\" id=\"id25\">blur</a></li>\n<li><a class=\"reference internal\" href=\"#blurchannel\" id=\"id26\">blurChannel</a></li>\n<li><a class=\"reference internal\" href=\"#border\" id=\"id27\">border</a></li>\n<li><a class=\"reference internal\" href=\"#cdl\" id=\"id28\">cdl</a></li>\n<li><a class=\"reference internal\" href=\"#channel\" id=\"id29\">channel</a></li>\n<li><a class=\"reference internal\" href=\"#channeldepth\" id=\"id30\">channelDepth</a></li>\n<li><a class=\"reference internal\" href=\"#charcoal\" id=\"id31\">charcoal</a></li>\n<li><a class=\"reference internal\" href=\"#chop\" id=\"id32\">chop</a></li>\n<li><a class=\"reference internal\" href=\"#colorize\" id=\"id33\">colorize</a></li>\n<li><a class=\"reference internal\" href=\"#colormatrix\" id=\"id34\">colorMatrix</a></li>\n<li><a class=\"reference internal\" href=\"#comment\" id=\"id35\">comment</a></li>\n<li><a class=\"reference internal\" href=\"#compare\" id=\"id36\">compare</a></li>\n<li><a class=\"reference internal\" href=\"#composite\" id=\"id37\">composite</a></li>\n<li><a class=\"reference internal\" href=\"#contrast\" id=\"id38\">contrast</a></li>\n<li><a class=\"reference internal\" href=\"#convolve\" id=\"id39\">convolve</a></li>\n<li><a class=\"reference internal\" href=\"#crop\" id=\"id40\">crop</a></li>\n<li><a class=\"reference internal\" href=\"#cyclecolormap\" id=\"id41\">cycleColormap</a></li>\n<li><a class=\"reference internal\" href=\"#despeckle\" id=\"id42\">despeckle</a></li>\n<li><a class=\"reference internal\" href=\"#display\" id=\"id43\">display</a></li>\n<li><a class=\"reference internal\" href=\"#draw\" id=\"id44\">draw</a></li>\n<li><a class=\"reference internal\" href=\"#edge\" id=\"id45\">edge</a></li>\n<li><a class=\"reference internal\" href=\"#emboss\" id=\"id46\">emboss</a></li>\n<li><a class=\"reference internal\" href=\"#enhance\" id=\"id47\">enhance</a></li>\n<li><a class=\"reference internal\" href=\"#equalize\" id=\"id48\">equalize</a></li>\n<li><a class=\"reference internal\" href=\"#erase\" id=\"id49\">erase</a></li>\n<li><a class=\"reference internal\" href=\"#extent\" id=\"id50\">extent</a></li>\n<li><a class=\"reference internal\" href=\"#flip\" id=\"id51\">flip</a></li>\n<li><a class=\"reference internal\" href=\"#floodfillcolor\" id=\"id52\">floodFillColor</a></li>\n<li><a class=\"reference internal\" href=\"#floodfillopacity\" id=\"id53\">floodFillOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#floodfilltexture\" id=\"id54\">floodFillTexture</a></li>\n<li><a class=\"reference internal\" href=\"#flop\" id=\"id55\">flop</a></li>\n<li><a class=\"reference internal\" href=\"#frame\" id=\"id56\">frame</a></li>\n<li><a class=\"reference internal\" href=\"#gamma\" id=\"id57\">gamma</a></li>\n<li><a class=\"reference internal\" href=\"#gaussianblur\" id=\"id58\">gaussianBlur</a></li>\n<li><a class=\"reference internal\" href=\"#gaussianblurchannel\" id=\"id59\">gaussianBlurChannel</a></li>\n<li><a class=\"reference internal\" href=\"#implode\" id=\"id60\">implode</a></li>\n<li><a class=\"reference internal\" href=\"#haldclut\" id=\"id61\">haldClut</a></li>\n<li><a class=\"reference internal\" href=\"#label\" id=\"id62\">label</a></li>\n<li><a class=\"reference internal\" href=\"#level\" id=\"id63\">level</a></li>\n<li><a class=\"reference internal\" href=\"#levelchannel\" id=\"id64\">levelChannel</a></li>\n<li><a class=\"reference internal\" href=\"#magnify\" id=\"id65\">magnify</a></li>\n<li><a class=\"reference internal\" href=\"#map\" id=\"id66\">map</a></li>\n<li><a class=\"reference internal\" href=\"#mattefloodfill\" id=\"id67\">matteFloodfill</a></li>\n<li><a class=\"reference internal\" href=\"#medianfilter\" id=\"id68\">medianFilter</a></li>\n<li><a class=\"reference internal\" href=\"#minify\" id=\"id69\">minify</a></li>\n<li><a class=\"reference internal\" href=\"#modifyimage\" id=\"id70\">modifyImage</a></li>\n<li><a class=\"reference internal\" href=\"#modulate\" id=\"id71\">modulate</a></li>\n<li><a class=\"reference internal\" href=\"#motionblur\" id=\"id72\">motionBlur</a></li>\n<li><a class=\"reference internal\" href=\"#negate\" id=\"id73\">negate</a></li>\n<li><a class=\"reference internal\" href=\"#normalize\" id=\"id74\">normalize</a></li>\n<li><a class=\"reference internal\" href=\"#oilpaint\" id=\"id75\">oilPaint</a></li>\n<li><a class=\"reference internal\" href=\"#opacity\" id=\"id76\">opacity</a></li>\n<li><a class=\"reference internal\" href=\"#opaque\" id=\"id77\">opaque</a></li>\n<li><a class=\"reference internal\" href=\"#quantize\" id=\"id78\">quantize</a></li>\n<li><a class=\"reference internal\" href=\"#quantumoperator\" id=\"id79\">quantumOperator</a></li>\n<li><a class=\"reference internal\" href=\"#process\" id=\"id80\">process</a></li>\n<li><a class=\"reference internal\" href=\"#raise\" id=\"id81\">raise</a></li>\n<li><a class=\"reference internal\" href=\"#randomthreshold\" id=\"id82\">randomThreshold</a></li>\n<li><a class=\"reference internal\" href=\"#randomthresholdchannel\" id=\"id83\">randomThresholdChannel</a></li>\n<li><a class=\"reference internal\" href=\"#reducenoise\" id=\"id84\">reduceNoise</a></li>\n<li><a class=\"reference internal\" href=\"#resize\" id=\"id85\">resize</a></li>\n<li><a class=\"reference internal\" href=\"#roll\" id=\"id86\">roll</a></li>\n<li><a class=\"reference internal\" href=\"#rotate\" id=\"id87\">rotate</a></li>\n<li><a class=\"reference internal\" href=\"#sample\" id=\"id88\">sample</a></li>\n<li><a class=\"reference internal\" href=\"#scale\" id=\"id89\">scale</a></li>\n<li><a class=\"reference internal\" href=\"#thumbnail\" id=\"id90\">thumbnail</a></li>\n<li><a class=\"reference internal\" href=\"#segment\" id=\"id91\">segment</a></li>\n<li><a class=\"reference internal\" href=\"#shade\" id=\"id92\">shade</a></li>\n<li><a class=\"reference internal\" href=\"#sharpen\" id=\"id93\">sharpen</a></li>\n<li><a class=\"reference internal\" href=\"#sharpenchannel\" id=\"id94\">sharpenChannel</a></li>\n<li><a class=\"reference internal\" href=\"#shave\" id=\"id95\">shave</a></li>\n<li><a class=\"reference internal\" href=\"#shear\" id=\"id96\">shear</a></li>\n<li><a class=\"reference internal\" href=\"#solarize\" id=\"id97\">solarize</a></li>\n<li><a class=\"reference internal\" href=\"#spread\" id=\"id98\">spread</a></li>\n<li><a class=\"reference internal\" href=\"#stegano\" id=\"id99\">stegano</a></li>\n<li><a class=\"reference internal\" href=\"#stereo\" id=\"id100\">stereo</a></li>\n<li><a class=\"reference internal\" href=\"#strip\" id=\"id101\">strip</a></li>\n<li><a class=\"reference internal\" href=\"#swirl\" id=\"id102\">swirl</a></li>\n<li><a class=\"reference internal\" href=\"#texture\" id=\"id103\">texture</a></li>\n<li><a class=\"reference internal\" href=\"#threshold\" id=\"id104\">threshold</a></li>\n<li><a class=\"reference internal\" href=\"#transform\" id=\"id105\">transform</a></li>\n<li><a class=\"reference internal\" href=\"#transparent\" id=\"id106\">transparent</a></li>\n<li><a class=\"reference internal\" href=\"#trim\" id=\"id107\">trim</a></li>\n<li><a class=\"reference internal\" href=\"#type\" id=\"id108\">type</a></li>\n<li><a class=\"reference internal\" href=\"#unsharpmask\" id=\"id109\">unsharpmask</a></li>\n<li><a class=\"reference internal\" href=\"#unsharpmaskchannel\" id=\"id110\">unsharpmaskChannel</a></li>\n<li><a class=\"reference internal\" href=\"#wave\" id=\"id111\">wave</a></li>\n<li><a class=\"reference internal\" href=\"#zoom\" id=\"id112\">zoom</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"adaptivethreshold\">\n<h2><a class=\"toc-backref\" href=\"#id19\">adaptiveThreshold</a></h2>\n<p>Apply adaptive thresholding to the image (see\n<a class=\"reference external\" href=\"http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm\">http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm</a>). Adaptive\nthresholding is useful if the ideal threshold level is not known in\nadvance, or if the illumination gradient is not constant across the\nimage. Adaptive thresholding works by evaulating the mean (average) of\na pixel region (size specified by width and height) and using the mean\nas the thresholding value. In order to remove residual noise from the\nbackground, the threshold may be adjusted by subtracting a constant\noffset (default zero) from the mean to compute the threshold:</p>\n<pre class=\"literal-block\">\nvoid            adaptiveThreshold ( const unsigned int width,\n                                    const unsigned int height,\n                                    const double offset = 0.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"addnoise\">\n<h2><a class=\"toc-backref\" href=\"#id20\">addNoise</a></h2>\n<p>Add noise to image with the specified noise type:</p>\n<pre class=\"literal-block\">\nvoid            addNoise ( const NoiseType noiseType_ )\n</pre>\n</div>\n<div class=\"section\" id=\"addnoisechannel\">\n<h2><a class=\"toc-backref\" href=\"#id21\">addNoiseChannel</a></h2>\n<p>Add noise to an image channel with the specified noise type. The\n<cite>channel</cite> parameter specifies the channel to add noise to.  The\n<cite>noiseType</cite> parameter specifies the type of noise:</p>\n<pre class=\"literal-block\">\nvoid            addNoiseChannel ( const ChannelType channel_,\n                                  const NoiseType noiseType_)\n</pre>\n</div>\n<div class=\"section\" id=\"affinetransform\">\n<h2><a class=\"toc-backref\" href=\"#id22\">affineTransform</a></h2>\n<p>Transform image by specified affine (or free transform) matrix:</p>\n<pre class=\"literal-block\">\nvoid            affineTransform ( const DrawableAffine &amp;affine )\n</pre>\n</div>\n<div class=\"section\" id=\"annotate\">\n<h2><a class=\"toc-backref\" href=\"#id23\">annotate</a></h2>\n<p>Annotate image (draw text on image)</p>\n<p>Gravity effects text placement in bounding area according to these\nrules:</p>\n<dl class=\"docutils\">\n<dt>NorthWestGravity</dt>\n<dd>text bottom-left corner placed at top-left</dd>\n<dt>NorthGravity</dt>\n<dd>text bottom-center placed at top-center</dd>\n<dt>NorthEastGravity</dt>\n<dd>text bottom-right corner placed at top-right</dd>\n<dt>WestGravity</dt>\n<dd>text left-center placed at left-center</dd>\n<dt>CenterGravity</dt>\n<dd>text center placed at center</dd>\n<dt>EastGravity</dt>\n<dd>text right-center placed at right-center</dd>\n<dt>SouthWestGravity</dt>\n<dd>text top-left placed at bottom-left</dd>\n<dt>SouthGravity</dt>\n<dd>text top-center placed at bottom-center</dd>\n<dt>SouthEastGravity</dt>\n<dd>text top-right placed at bottom-right</dd>\n</dl>\n<p>Annotate using specified text, and placement location:</p>\n<pre class=\"literal-block\">\nvoid            annotate ( const std::string &amp;text_,\n                           const Geometry &amp;location_ )\n</pre>\n<p>Annotate using specified text, bounding area, and placement gravity:</p>\n<pre class=\"literal-block\">\nvoid            annotate ( const std::string &amp;text_,\n                           const Geometry &amp;boundingArea_,\n                           const GravityType gravity_ )\n</pre>\n<p>Annotate with text using specified text, bounding area, placement\ngravity, and rotation:</p>\n<pre class=\"literal-block\">\nvoid            annotate ( const std::string &amp;text_,\n                           const Geometry &amp;boundingArea_,\n                           const GravityType gravity_,\n                           const double degrees_ )\n</pre>\n<p>Annotate with text (bounding area is entire image) and placement\ngravity:</p>\n<pre class=\"literal-block\">\nvoid            annotate ( const std::string &amp;text_,\n                           const GravityType gravity_ )\n</pre>\n</div>\n<div class=\"section\" id=\"autoorient\">\n<h2><a class=\"toc-backref\" href=\"#id24\">autoOrient</a></h2>\n<p>Automatically orient image to be right-side up based on its current\norientation attribute.  This allows the image to be viewed correctly\nwhen the orientation attribute is not available, or is not respected:</p>\n<pre class=\"literal-block\">\nvoid            autoOrient( void )\n</pre>\n</div>\n<div class=\"section\" id=\"blur\">\n<h2><a class=\"toc-backref\" href=\"#id25\">blur</a></h2>\n<p>Blur an image with the specified blur factor.</p>\n<p>The <cite>radius</cite> parameter specifies the radius of the Gaussian, in\npixels, not counting the center pixel.  The <cite>sigma</cite> parameter\nspecifies the standard deviation of the Laplacian, in pixels:</p>\n<pre class=\"literal-block\">\nvoid            blur ( const double radius_ = 0.0,\n                       const double sigma_ = 1.0  )\n</pre>\n</div>\n<div class=\"section\" id=\"blurchannel\">\n<h2><a class=\"toc-backref\" href=\"#id26\">blurChannel</a></h2>\n<p>Blur an image channel with the specified blur factor.</p>\n<p>The <cite>channel</cite> parameter specifies the channel to modify. The <cite>radius</cite>\nparameter specifies the radius of the Gaussian, in pixels, not\ncounting the center pixel.  The <cite>sigma</cite> parameter specifies the\nstandard deviation of the Laplacian, in pixels:</p>\n<pre class=\"literal-block\">\nvoid            blurChannel ( const ChannelType channel_,\n                              const double radius_ = 0.0,\n                              const double sigma_ = 1.0  )\n</pre>\n</div>\n<div class=\"section\" id=\"border\">\n<h2><a class=\"toc-backref\" href=\"#id27\">border</a></h2>\n<p>Border image (add border to image).  The <a class=\"reference external\" href=\"Color.html\">color</a> of the border is\nspecified by the borderColor attribute:</p>\n<pre class=\"literal-block\">\nvoid            border ( const Geometry &amp;geometry_\n                         = borderGeometryDefault )\n</pre>\n</div>\n<div class=\"section\" id=\"cdl\">\n<h2><a class=\"toc-backref\" href=\"#id28\">cdl</a></h2>\n<p>Bake in the ASC-CDL, which is a convention for the for the exchange of\nbasic primary color grading information between for the exchange of\nbasic primary color grading information between equipment and software\nfrom different manufacturers.  It is a useful transform for other\npurposes as well:</p>\n<blockquote>\nvoid            cdl ( const std::string &amp;cdl_ )</blockquote>\n<p>See <a class=\"reference external\" href=\"../api/cdl.html#cdlimage\">CdlImage</a> for more details on the ASC-CDL.</p>\n</div>\n<div class=\"section\" id=\"channel\">\n<h2><a class=\"toc-backref\" href=\"#id29\">channel</a></h2>\n<p>Extract channel from image. Use this option to extract a particular\nchannel from the image.  MatteChannel for example, is useful for\nextracting the opacity values from an image:</p>\n<pre class=\"literal-block\">\nvoid            channel ( const ChannelType channel_ )\n</pre>\n</div>\n<div class=\"section\" id=\"channeldepth\">\n<h2><a class=\"toc-backref\" href=\"#id30\">channelDepth</a></h2>\n<p>Set or obtain modulus channel depth:</p>\n<pre class=\"literal-block\">\nvoid            channelDepth ( const ChannelType channel_,\n                               const unsigned int depth_ )\n\nunsigned int    channelDepth ( const ChannelType channel_ )\n</pre>\n</div>\n<div class=\"section\" id=\"charcoal\">\n<h2><a class=\"toc-backref\" href=\"#id31\">charcoal</a></h2>\n<p>Charcoal effect image (looks like charcoal sketch).</p>\n<p>The <cite>radius</cite> parameter specifies the radius of the Gaussian, in\npixels, not counting the center pixel.  The <cite>sigma</cite> parameter\nspecifies the standard deviation of the Laplacian, in pixels:</p>\n<pre class=\"literal-block\">\nvoid            charcoal ( const double radius_ = 0.0,\n                           const double sigma_ = 1.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"chop\">\n<h2><a class=\"toc-backref\" href=\"#id32\">chop</a></h2>\n<p>Chop image (remove vertical or horizontal subregion of image):</p>\n<pre class=\"literal-block\">\nvoid            chop ( const Geometry &amp;geometry_ )\n</pre>\n</div>\n<div class=\"section\" id=\"colorize\">\n<h2><a class=\"toc-backref\" href=\"#id33\">colorize</a></h2>\n<p>Colorize image with pen <a class=\"reference external\" href=\"Color.html\">color</a>, using specified percent opacity for\nred, green, and blue quantums:</p>\n<pre class=\"literal-block\">\nvoid            colorize ( const unsigned int opacityRed_,\n                           const unsigned int opacityGreen_,\n                           const unsigned int opacityBlue_,\n                           const Color &amp;penColor_ )\n</pre>\n<p>Colorize image with pen <a class=\"reference external\" href=\"Color.html\">color</a>, using specified percent opacity:</p>\n<pre class=\"literal-block\">\nvoid            colorize ( const unsigned int opacity_,\n                           const Color &amp;penColor_ )\n</pre>\n</div>\n<div class=\"section\" id=\"colormatrix\">\n<h2><a class=\"toc-backref\" href=\"#id34\">colorMatrix</a></h2>\n<p>Apply a color matrix to the image channels.  The user supplied matrix\nmay be of order 1 to 5 (1x1 through 5x5):</p>\n<pre class=\"literal-block\">\nvoid            colorMatrix (const unsigned int order_,\n                             const double *color_matrix_)\n</pre>\n<p>See <a class=\"reference external\" href=\"../api/fx.html#colormatriximage\">ColorMatrixImage</a> for more details.</p>\n</div>\n<div class=\"section\" id=\"comment\">\n<h2><a class=\"toc-backref\" href=\"#id35\">comment</a></h2>\n<p>Comment image (add comment string to image). By default, each image is\ncommented with its file name. Use this method to assign a specific\ncomment to the image.  Optionally you can include the image filename,\ntype, width, height, or other image attributes by embedding <a class=\"reference external\" href=\"FormatCharacters.html\">special\nformat characters</a>:</p>\n<pre class=\"literal-block\">\nvoid            comment ( const std::string &amp;comment_ )\n</pre>\n</div>\n<div class=\"section\" id=\"compare\">\n<h2><a class=\"toc-backref\" href=\"#id36\">compare</a></h2>\n<p>Compare current image with another image.  Sets meanErrorPerPixel,\nnormalizedMaxError, and normalizedMeanError in the current\nimage. False is returned if the images are identical. An ErrorOption\nexception is thrown if the reference image columns, rows, colorspace,\nor matte differ from the current image:</p>\n<pre class=\"literal-block\">\nbool            compare ( const Image &amp;reference_ )\n</pre>\n</div>\n<div class=\"section\" id=\"composite\">\n<h2><a class=\"toc-backref\" href=\"#id37\">composite</a></h2>\n<p>Compose an image onto another at specified x and y offset and using a\nspecified algorithm:</p>\n<pre class=\"literal-block\">\nvoid            composite ( const Image &amp;compositeImage_,\n                            const int xOffset_,\n                            const int yOffset_,\n                            const CompositeOperator compose_\n                            = InCompositeOp )\n\nvoid            composite ( const Image &amp;compositeImage_,\n                            const Geometry &amp;offset_,\n                            const CompositeOperator compose_\n                            = InCompositeOp )\n\nvoid            composite ( const Image &amp;compositeImage_,\n                            const GravityType gravity_,\n                            const CompositeOperator compose_\n                            = InCompositeOp )\n</pre>\n</div>\n<div class=\"section\" id=\"contrast\">\n<h2><a class=\"toc-backref\" href=\"#id38\">contrast</a></h2>\n<p>Contrast image (enhance intensity differences in image):</p>\n<pre class=\"literal-block\">\nvoid            contrast ( const unsigned int sharpen_ )\n</pre>\n</div>\n<div class=\"section\" id=\"convolve\">\n<h2><a class=\"toc-backref\" href=\"#id39\">convolve</a></h2>\n<p>Convolve image.  Applies a user-specified convolution to the image.\nThe <cite>order</cite> parameter represents the number of columns and rows in the\nfilter kernel while <cite>kernel</cite> is a two-dimensional array of doubles\nrepresenting the convolution kernel to apply:</p>\n<pre class=\"literal-block\">\nvoid            convolve ( const unsigned int order_,\n                           const double *kernel_ )\n</pre>\n</div>\n<div class=\"section\" id=\"crop\">\n<h2><a class=\"toc-backref\" href=\"#id40\">crop</a></h2>\n<p>Crop image (return subregion of original image):</p>\n<pre class=\"literal-block\">\nvoid            crop ( const Geometry &amp;geometry_ )\n</pre>\n</div>\n<div class=\"section\" id=\"cyclecolormap\">\n<h2><a class=\"toc-backref\" href=\"#id41\">cycleColormap</a></h2>\n<p>Cycle (rotate) image colormap:</p>\n<pre class=\"literal-block\">\nvoid            cycleColormap ( const int amount_ )\n</pre>\n</div>\n<div class=\"section\" id=\"despeckle\">\n<h2><a class=\"toc-backref\" href=\"#id42\">despeckle</a></h2>\n<p>Despeckle image (reduce speckle noise):</p>\n<pre class=\"literal-block\">\nvoid            despeckle ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"display\">\n<h2><a class=\"toc-backref\" href=\"#id43\">display</a></h2>\n<p>Display image on screen. Caution: if an image format is is not\ncompatible with the display visual (e.g. JPEG on a colormapped\ndisplay) then the original image will be altered. Use a copy of the\noriginal if this is a problem:</p>\n<blockquote>\nvoid            display ( void )</blockquote>\n</div>\n<div class=\"section\" id=\"draw\">\n<h2><a class=\"toc-backref\" href=\"#id44\">draw</a></h2>\n<p>Draw shape or text on image using a single <a class=\"reference external\" href=\"Drawable.html\">drawable</a> object:</p>\n<pre class=\"literal-block\">\nvoid            draw ( const Drawable &amp;drawable_ );\n</pre>\n<p>Draw shapes or text on image using a set of <a class=\"reference external\" href=\"Drawable.html\">Drawable</a> objects\ncontained in an <a class=\"reference external\" href=\"STL.html\">STL</a> list. Use of this method improves drawing\nperformance and allows batching draw objects together in a list for\nrepeated use:</p>\n<pre class=\"literal-block\">\nvoid            draw ( const std::list&lt;Magick::Drawable&gt; &amp;drawable_ );\n</pre>\n</div>\n<div class=\"section\" id=\"edge\">\n<h2><a class=\"toc-backref\" href=\"#id45\">edge</a></h2>\n<p>Edge image (hilight edges in image).  The radius is the radius of the\npixel neighborhood.. Specify a radius of zero for automatic radius\nselection:</p>\n<pre class=\"literal-block\">\nvoid            edge ( const double radius_ = 0.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"emboss\">\n<h2><a class=\"toc-backref\" href=\"#id46\">emboss</a></h2>\n<p>Emboss image (hilight edges with 3D effect).  The <cite>radius</cite> parameter\nspecifies the radius of the Gaussian, in pixels, not counting the\ncenter pixel.  The <cite>sigma</cite> parameter specifies the standard deviation\nof the Laplacian, in pixels:</p>\n<pre class=\"literal-block\">\nvoid            emboss ( const double radius_ = 0.0,\n                         const double sigma_ = 1.0)\n</pre>\n</div>\n<div class=\"section\" id=\"enhance\">\n<h2><a class=\"toc-backref\" href=\"#id47\">enhance</a></h2>\n<p>Enhance image (minimize noise):</p>\n<pre class=\"literal-block\">\nvoid            enhance ( void );\n</pre>\n</div>\n<div class=\"section\" id=\"equalize\">\n<h2><a class=\"toc-backref\" href=\"#id48\">equalize</a></h2>\n<p>Equalize image (histogram equalization):</p>\n<pre class=\"literal-block\">\nvoid            equalize ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"erase\">\n<h2><a class=\"toc-backref\" href=\"#id49\">erase</a></h2>\n<p>Set all image pixels to the current background color:</p>\n<pre class=\"literal-block\">\nvoid            erase ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"extent\">\n<h2><a class=\"toc-backref\" href=\"#id50\">extent</a></h2>\n<p>Create an image canvas using background color sized according to\ngeometry and composite existing image on it, with image placement\ncontrolled by gravity.  Parameters are obtained from existing image\nproperties if they are not specified via a method\nparameter. Parameters which are supported by image properties (gravity\nand backgroundColor) update those image properties as a side-effect:</p>\n<pre class=\"literal-block\">\nvoid            extent ( const Geometry &amp;geometry_ )\n\nvoid            extent ( const Geometry &amp;geometry_,\n                         const GravityType &amp;gravity_ )\n\nvoid            extent ( const Geometry &amp;geometry_,\n                         const Color &amp;backgroundColor_ )\n\nvoid            extent ( const Geometry &amp;geometry_,\n                         const Color &amp;backgroundColor_,\n                         const GravityType &amp;gravity_ );\n</pre>\n</div>\n<div class=\"section\" id=\"flip\">\n<h2><a class=\"toc-backref\" href=\"#id51\">flip</a></h2>\n<p>Flip image (reflect each scanline in the vertical direction):</p>\n<pre class=\"literal-block\">\nvoid            flip ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"floodfillcolor\">\n<h2><a class=\"toc-backref\" href=\"#id52\">floodFillColor</a></h2>\n<p>Flood-fill <a class=\"reference external\" href=\"Color.html\">color</a> across pixels that match the <a class=\"reference external\" href=\"Color.html\">color</a> of the target\npixel and are neighbors of the target pixel.  Uses current fuzz\nsetting when determining <a class=\"reference external\" href=\"Color.html\">color</a> match:</p>\n<pre class=\"literal-block\">\nvoid            floodFillColor( const unsigned int x_,\n                                const unsigned int y_,\n                                const Color &amp;fillColor_ )\n\nvoid            floodFillColor( const Geometry &amp;point_,\n                                const Color &amp;fillColor_ )\n</pre>\n<p>Flood-fill <a class=\"reference external\" href=\"Color.html\">color</a> across pixels starting at target-pixel and stopping\nat pixels matching specified border <a class=\"reference external\" href=\"Color.html\">color</a>.  Uses current fuzz setting\nwhen determining <a class=\"reference external\" href=\"Color.html\">color</a> match:</p>\n<pre class=\"literal-block\">\nvoid            floodFillColor( const unsigned int x_,\n                                const unsigned int y_,\n                                const Color &amp;fillColor_,\n                                const Color &amp;borderColor_ )\n\nvoid            floodFillColor( const Geometry &amp;point_,\n                                const Color &amp;fillColor_,\n                                const Color &amp;borderColor_ )\n</pre>\n</div>\n<div class=\"section\" id=\"floodfillopacity\">\n<h2><a class=\"toc-backref\" href=\"#id53\">floodFillOpacity</a></h2>\n<p>Flood-fill pixels matching <a class=\"reference external\" href=\"Color.html\">color</a> (within fuzz factor) of target\npixel(x,y) with replacement opacity value using method:</p>\n<pre class=\"literal-block\">\nvoid            floodFillOpacity ( const unsigned int x_,\n                                   const unsigned int y_,\n                                   const unsigned int opacity_,\n                                   const PaintMethod method_ )\n</pre>\n</div>\n<div class=\"section\" id=\"floodfilltexture\">\n<h2><a class=\"toc-backref\" href=\"#id54\">floodFillTexture</a></h2>\n<p>Flood-fill texture across pixels that match the <a class=\"reference external\" href=\"Color.html\">color</a> of the\ntarget pixel and are neighbors of the target pixel.\nUses current fuzz setting when determining <a class=\"reference external\" href=\"Color.html\">color</a> match:</p>\n<pre class=\"literal-block\">\nvoid            floodFillTexture( const unsigned int x_,\n                                  const unsigned int y_,\n                                  const Image &amp;texture_ )\n\nvoid            floodFillTexture( const Geometry &amp;point_,\n                                  const Image &amp;texture_ )\n</pre>\n<p>Flood-fill texture across pixels starting at target-pixel and\nstopping at pixels matching specified border <a class=\"reference external\" href=\"Color.html\">color</a>.\nUses current fuzz setting when determining <a class=\"reference external\" href=\"Color.html\">color</a> match:</p>\n<pre class=\"literal-block\">\nvoid            floodFillTexture( const unsigned int x_,\n                                  const unsigned int y_,\n                                  const Image &amp;texture_,\n                                  const Color &amp;borderColor_ )\n\nvoid            floodFillTexture( const Geometry &amp;point_,\n                                  const Image &amp;texture_,\n                                  const Color &amp;borderColor_ )\n</pre>\n</div>\n<div class=\"section\" id=\"flop\">\n<h2><a class=\"toc-backref\" href=\"#id55\">flop</a></h2>\n<p>Flop image (reflect each scanline in the horizontal direction):</p>\n<pre class=\"literal-block\">\nvoid            flop ( void );\n</pre>\n</div>\n<div class=\"section\" id=\"frame\">\n<h2><a class=\"toc-backref\" href=\"#id56\">frame</a></h2>\n<p>Draw a decorative frame around the image:</p>\n<pre class=\"literal-block\">\nvoid            frame ( const Geometry &amp;geometry_ = frameGeometryDefault )\n\nvoid            frame ( const unsigned int width_,\n                        const unsigned int height_,\n                        const int innerBevel_ = 6,\n                        const int outerBevel_ = 6 )\n</pre>\n</div>\n<div class=\"section\" id=\"gamma\">\n<h2><a class=\"toc-backref\" href=\"#id57\">gamma</a></h2>\n<p>Gamma correct the image or individual image channels:</p>\n<pre class=\"literal-block\">\nvoid            gamma ( const double gamma_ )\n\nvoid            gamma ( const double gammaRed_,\n                        const double gammaGreen_,\n                        const double gammaBlue_ )\n</pre>\n</div>\n<div class=\"section\" id=\"gaussianblur\">\n<h2><a class=\"toc-backref\" href=\"#id58\">gaussianBlur</a></h2>\n<p>Gaussian blur image.  The number of neighbor pixels to be included in\nthe convolution mask is specified by <cite>width</cite>. The standard deviation\nof the gaussian bell curve is specified by <cite>sigma</cite>:</p>\n<pre class=\"literal-block\">\nvoid            gaussianBlur ( const double width_, const double sigma_ )\n</pre>\n</div>\n<div class=\"section\" id=\"gaussianblurchannel\">\n<h2><a class=\"toc-backref\" href=\"#id59\">gaussianBlurChannel</a></h2>\n<p>Gaussian blur image channel.  The number of neighbor pixels to be\nincluded in the convolution mask is specified by <cite>width</cite>. The\nstandard deviation of the gaussian bell curve is specified by\n<cite>sigma</cite>:</p>\n<pre class=\"literal-block\">\nvoid            gaussianBlurChannel ( const ChannelType channel_,\n                                      const double width_,\n                                      const double sigma_ )\n</pre>\n</div>\n<div class=\"section\" id=\"implode\">\n<h2><a class=\"toc-backref\" href=\"#id60\">implode</a></h2>\n<p>Implode image (special effect):</p>\n<pre class=\"literal-block\">\nvoid            implode ( const double factor_ )\n</pre>\n</div>\n<div class=\"section\" id=\"haldclut\">\n<h2><a class=\"toc-backref\" href=\"#id61\">haldClut</a></h2>\n<p>Apply a color lookup table (Hald CLUT) to the image:</p>\n<pre class=\"literal-block\">\nvoid            haldClut ( const Image &amp;clutImage_ )\n</pre>\n<p>See <a class=\"reference external\" href=\"../api/hclut.html#haldclutimage\">HaldClutImage</a> for more details.</p>\n</div>\n<div class=\"section\" id=\"label\">\n<h2><a class=\"toc-backref\" href=\"#id62\">label</a></h2>\n<p>Assign a label to an image. Use this option to assign a specific label\nto the image. Optionally you can include the image filename, type,\nwidth, height, or scene number in the label by embedding <a class=\"reference external\" href=\"FormatCharacters.html\">special\nformat characters</a>. If the first character of string is &#64;, the image\nlabel is read from a file titled by the remaining characters in the\nstring. When converting to Postscript, use this option to specify a\nheader string to print above the image:</p>\n<pre class=\"literal-block\">\nvoid            label ( const std::string &amp;label_ )\n</pre>\n</div>\n<div class=\"section\" id=\"level\">\n<h2><a class=\"toc-backref\" href=\"#id63\">level</a></h2>\n<p>Level image to increase image contrast, and/or adjust image\ngamma. Adjust the levels of the image by scaling the colors falling\nbetween specified white and black points to the full available quantum\nrange. The parameters provided represent the black, mid (gamma), and\nwhite points.  The black point specifies the darkest color in the\nimage. Colors darker than the black point are set to zero. Mid point\n(gamma) specifies a gamma correction to apply to the image. White\npoint specifies the lightest color in the image.  Colors brighter than\nthe white point are set to the maximum quantum value. The black and\nwhite point have the valid range 0 to MaxRGB while mid (gamma) has a\nuseful range of 0 to ten:</p>\n<pre class=\"literal-block\">\nvoid            level ( const double black_point,\n                        const double white_point,\n                        const double mid_point=1.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"levelchannel\">\n<h2><a class=\"toc-backref\" href=\"#id64\">levelChannel</a></h2>\n<p>Level image channel to increase image contrast, and/or adjust image\ngamma. Adjust the levels of the image channel by scaling the colors\nfalling between specified white and black points to the full available\nquantum range. The parameters provided represent the black, mid\n(gamma), and white points.  The black point specifies the darkest\ncolor in the image. Colors darker than the black point are set to\nzero. Mid point (gamma) specifies a gamma correction to apply to the\nimage. White point specifies the lightest color in the image.  Colors\nbrighter than the white point are set to the maximum quantum\nvalue. The black and white point have the valid range 0 to MaxRGB\nwhile mid (gamma) has a useful range of 0 to ten:</p>\n<pre class=\"literal-block\">\nvoid            levelChannel ( const ChannelType channel,\n                               const double black_point,\n                               const double white_point,\n                               const double mid_point=1.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"magnify\">\n<h2><a class=\"toc-backref\" href=\"#id65\">magnify</a></h2>\n<p>Magnify image by integral size (double the dimensions):</p>\n<pre class=\"literal-block\">\nvoid            magnify ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"map\">\n<h2><a class=\"toc-backref\" href=\"#id66\">map</a></h2>\n<p>Remap image colors with closest color from a reference image. Set\n<cite>dither</cite> to true in to apply Floyd/Steinberg error diffusion to the\nimage. By default, color reduction chooses an optimal set of colors\nthat best represent the original image. Alternatively, you can choose\na particular set of colors from an image file with this option:</p>\n<pre class=\"literal-block\">\nvoid            map ( const Image &amp;mapImage_ ,\n                      const bool dither_ = false )\n</pre>\n</div>\n<div class=\"section\" id=\"mattefloodfill\">\n<h2><a class=\"toc-backref\" href=\"#id67\">matteFloodfill</a></h2>\n<p>Floodfill designated area with a replacement opacity value:</p>\n<pre class=\"literal-block\">\nvoid            matteFloodfill ( const Color &amp;target_ ,\n                                 const unsigned int opacity_,\n                                 const int x_, const int y_,\n                                 const PaintMethod method_ )\n</pre>\n</div>\n<div class=\"section\" id=\"medianfilter\">\n<h2><a class=\"toc-backref\" href=\"#id68\">medianFilter</a></h2>\n<p>Filter image by replacing each pixel component with the median color\nin a circular neighborhood:</p>\n<pre class=\"literal-block\">\nvoid            medianFilter ( const double radius_ = 0.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"minify\">\n<h2><a class=\"toc-backref\" href=\"#id69\">minify</a></h2>\n<p>Reduce image by integral (half) size:</p>\n<pre class=\"literal-block\">\nvoid            minify ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"modifyimage\">\n<h2><a class=\"toc-backref\" href=\"#id70\">modifyImage</a></h2>\n<p>Prepare to update image (copy if reference &gt; 1). Normally Magick++'s\nimplicit reference counting takes care of all instance management.  In\nthe rare case that the automatic instance management does not work,\nuse this method to assure that there is only one reference to the\nimage to be modified.  It should be used in the cases where a\nGraphicsMagick C function is used directly on an image which may have\nmultiple references:</p>\n<pre class=\"literal-block\">\nvoid            modifyImage ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"modulate\">\n<h2><a class=\"toc-backref\" href=\"#id71\">modulate</a></h2>\n<p>Modulate percent hue, saturation, and brightness of an image.\nModulation of saturation and brightness is as a ratio of the current\nvalue (1.0 for no change). Modulation of hue is an absolute rotation\nof -180 degrees to +180 degrees from the current position\ncorresponding to an argument range of 0 to 2.0 (1.0 for no change):</p>\n<pre class=\"literal-block\">\nvoid            modulate ( const double brightness_,\n                           const double saturation_,\n                           const double hue_ )\n</pre>\n</div>\n<div class=\"section\" id=\"motionblur\">\n<h2><a class=\"toc-backref\" href=\"#id72\">motionBlur</a></h2>\n<p>Motion blur image with specified blur factor. The <cite>radius</cite> parameter\nspecifies the radius of the Gaussian, in pixels, not counting the\ncenter pixel.  The <cite>sigma</cite> parameter specifies the standard\ndeviation of the Laplacian, in pixels.  The <cite>angle</cite> parameter\nspecifies the angle the object appears to be comming from (zero\ndegrees is from the right):</p>\n<pre class=\"literal-block\">\nvoid            motionBlur ( const double radius_,\n                             const double sigma_,\n                             const double angle_ )\n</pre>\n</div>\n<div class=\"section\" id=\"negate\">\n<h2><a class=\"toc-backref\" href=\"#id73\">negate</a></h2>\n<p>Negate colors in image.  Set <cite>grayscale</cite> to only negate grayscale\nvalues in image:</p>\n<pre class=\"literal-block\">\nvoid            negate ( const bool grayscale_ = false )\n</pre>\n</div>\n<div class=\"section\" id=\"normalize\">\n<h2><a class=\"toc-backref\" href=\"#id74\">normalize</a></h2>\n<p>Normalize image (increase contrast by normalizing the pixel values to\nspan the full range of color values):</p>\n<pre class=\"literal-block\">\nvoid            normalize ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"oilpaint\">\n<h2><a class=\"toc-backref\" href=\"#id75\">oilPaint</a></h2>\n<p>Oilpaint image (image looks like an oil painting):</p>\n<pre class=\"literal-block\">\nvoid            oilPaint ( const double radius_ = 3.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"opacity\">\n<h2><a class=\"toc-backref\" href=\"#id76\">opacity</a></h2>\n<p>Set or attenuate the opacity channel in the image. If the image pixels\nare opaque then they are set to the specified opacity value, otherwise\nthey are blended with the supplied opacity value.  The value of\n<cite>opacity</cite> ranges from 0 (completely opaque) to MaxRGB. The defines\n<cite>OpaqueOpacity</cite> and <cite>TransparentOpacity</cite> are available to specify\ncompletely opaque or completely transparent, respectively:</p>\n<pre class=\"literal-block\">\nvoid            opacity ( const unsigned int opacity_ )\n</pre>\n</div>\n<div class=\"section\" id=\"opaque\">\n<h2><a class=\"toc-backref\" href=\"#id77\">opaque</a></h2>\n<p>Change <a class=\"reference external\" href=\"Color.html\">color</a> of specified opaque pixel to specified pen <a class=\"reference external\" href=\"Color.html\">color</a>:</p>\n<pre class=\"literal-block\">\nvoid            opaque ( const Color &amp;opaqueColor_,\n                         const Color &amp;penColor_ )\n</pre>\n</div>\n<div class=\"section\" id=\"quantize\">\n<h2><a class=\"toc-backref\" href=\"#id78\">quantize</a></h2>\n<p>Quantize image (reduce number of colors). Set <cite>measureError</cite> to true\nin order to calculate error attributes:</p>\n<pre class=\"literal-block\">\nvoid            quantize ( const bool measureError_ = false )\n</pre>\n</div>\n<div class=\"section\" id=\"quantumoperator\">\n<h2><a class=\"toc-backref\" href=\"#id79\">quantumOperator</a></h2>\n<p>Apply an arithmetic or bitwise operator to the image pixel quantums:</p>\n<pre class=\"literal-block\">\nvoid            quantumOperator ( const ChannelType channel_,\n                                  const QuantumOperator operator_,\n                                  double rvalue_)\n\nvoid            quantumOperator ( const int x_,const int y_,\n                                  const unsigned int columns_,\n                                  const unsigned int rows_,\n                                  const ChannelType channel_,\n                                  const QuantumOperator operator_,\n                                  const double rvalue_)\n</pre>\n</div>\n<div class=\"section\" id=\"process\">\n<h2><a class=\"toc-backref\" href=\"#id80\">process</a></h2>\n<p>Execute a named process module using an argc/argv syntax similar to\nthat accepted by a C 'main' routine. An exception is thrown if the\nrequested process module doesn't exist, fails to load, or fails during\nexecution:</p>\n<pre class=\"literal-block\">\nvoid            process ( std::string name_,\n                          const int argc_,\n                          char **argv_ )\n</pre>\n</div>\n<div class=\"section\" id=\"raise\">\n<h2><a class=\"toc-backref\" href=\"#id81\">raise</a></h2>\n<p>Raise image (lighten or darken the edges of an image to give a 3-D\nraised or lowered effect):</p>\n<pre class=\"literal-block\">\nvoid            raise ( const Geometry &amp;geometry_ = &quot;6x6+0+0&quot;,\n                        const bool raisedFlag_ = false )\n</pre>\n</div>\n<div class=\"section\" id=\"randomthreshold\">\n<h2><a class=\"toc-backref\" href=\"#id82\">randomThreshold</a></h2>\n<p>Random threshold image.</p>\n<p>Changes the value of individual pixels based on the intensity\nof each pixel compared to a random threshold.  The result is a\nlow-contrast, two color image.  The <cite>thresholds</cite> argument is a\ngeometry containing LOWxHIGH thresholds.  If the string\ncontains 2x2, 3x3, or 4x4, then an ordered dither of order 2,\n3, or 4 will be performed instead.  If a <cite>channel</cite> argument is\nspecified then only the specified channel is altered.  This is\na very fast alternative to 'quantize' based dithering:</p>\n<pre class=\"literal-block\">\nvoid            randomThreshold( const Geometry &amp;thresholds_ )\n</pre>\n</div>\n<div class=\"section\" id=\"randomthresholdchannel\">\n<h2><a class=\"toc-backref\" href=\"#id83\">randomThresholdChannel</a></h2>\n<p>Random threshold image channel.</p>\n<p>Changes the value of individual pixels based on the intensity of each\npixel compared to a random threshold.  The result is a low-contrast,\ntwo color image.  The <cite>thresholds</cite> argument is a geometry containing\nLOWxHIGH thresholds.  If the string contains 2x2, 3x3, or 4x4, then an\nordered dither of order 2, 3, or 4 will be performed instead.  If a\n<cite>channel</cite> argument is specified then only the specified channel is\naltered.  This is a very fast alternative to 'quantize' based\ndithering:</p>\n<pre class=\"literal-block\">\nvoid            randomThresholdChannel( const Geometry &amp;thresholds_,\n                                        const ChannelType channel_ )\n</pre>\n</div>\n<div class=\"section\" id=\"reducenoise\">\n<h2><a class=\"toc-backref\" href=\"#id84\">reduceNoise</a></h2>\n<p>Reduce noise in image using a noise peak elimination filter:</p>\n<pre class=\"literal-block\">\nvoid            reduceNoise ( void )\n\nvoid            reduceNoise ( const double order_ )\n</pre>\n</div>\n<div class=\"section\" id=\"resize\">\n<h2><a class=\"toc-backref\" href=\"#id85\">resize</a></h2>\n<p>Resize image, specifying geometry, filter, and blur (blur &gt; 1.0 is\nmore blurry and &lt; 1.0 is sharper):</p>\n<pre class=\"literal-block\">\nvoid            resize ( const Geometry &amp;geometry_,\n                         const FilterTypes filterType_,\n                         const double blur_ )\n</pre>\n<p>Resize image, specifying geometry and filter, with blur using Image\ndefault:</p>\n<pre class=\"literal-block\">\nvoid            resize ( const Geometry &amp;geometry_,\n                         const FilterTypes filterType_ )\n</pre>\n<p>Resize image, specifying only geometry, with filter and blur obtained\nfrom Image default.  Provides the same result as the <cite>zoom</cite> method:</p>\n<pre class=\"literal-block\">\nvoid            resize ( const Geometry &amp;geometry_ );\n</pre>\n</div>\n<div class=\"section\" id=\"roll\">\n<h2><a class=\"toc-backref\" href=\"#id86\">roll</a></h2>\n<p>Roll image (rolls image vertically and horizontally) by specified\nnumber of columnms and rows):</p>\n<pre class=\"literal-block\">\nvoid            roll ( const Geometry &amp;roll_ )\n\nvoid            roll ( const unsigned int columns_,\n                       const unsigned int rows_ )\n</pre>\n</div>\n<div class=\"section\" id=\"rotate\">\n<h2><a class=\"toc-backref\" href=\"#id87\">rotate</a></h2>\n<p>Rotate image counter-clockwise by specified number of degrees:</p>\n<pre class=\"literal-block\">\nvoid            rotate ( const double degrees_ )\n</pre>\n</div>\n<div class=\"section\" id=\"sample\">\n<h2><a class=\"toc-backref\" href=\"#id88\">sample</a></h2>\n<p>Resize image by using pixel sampling algorithm:</p>\n<pre class=\"literal-block\">\nvoid            sample ( const Geometry &amp;geometry_ )\n</pre>\n</div>\n<div class=\"section\" id=\"scale\">\n<h2><a class=\"toc-backref\" href=\"#id89\">scale</a></h2>\n<p>Resize image by using simple ratio algorithm which provides good\nquality:</p>\n<pre class=\"literal-block\">\nvoid            scale ( const Geometry &amp;geometry_ )\n</pre>\n</div>\n<div class=\"section\" id=\"thumbnail\">\n<h2><a class=\"toc-backref\" href=\"#id90\">thumbnail</a></h2>\n<p>Resize image using several algorithms to make smaller images very\nquickly.  This is very useful to create thumbnails from large images\nbut usually works well for any image resizing purpose:</p>\n<pre class=\"literal-block\">\nvoid            thumbnail ( const Geometry &amp;geometry_ );\n</pre>\n</div>\n<div class=\"section\" id=\"segment\">\n<h2><a class=\"toc-backref\" href=\"#id91\">segment</a></h2>\n<p>Segment (coalesce similar image components) by analyzing the\nhistograms of the color components and identifying units that are\nhomogeneous with the fuzzy c-means technique.  A histogram is built\nfor the image.  This histogram is filtered to reduce noise and a\nsecond derivative of the histogram plot is built and used to identify\npotential cluster colors (peaks in the histogram).  The cluster colors\nare then validated by scanning through all of the pixels to see how\nmany pixels fall within each cluster.  Some candidate cluster colors\nmay not match any of the image pixels at all and should be discarded.\nSpecify <cite>clusterThreshold</cite>, as the number of pixels matching a cluster\ncolor in order for the cluster to be considered\nvalid. <cite>SmoothingThreshold</cite> eliminates noise in the second derivative\nof the histogram. As the value is increased, you can expect a smoother\nsecond derivative.  The default is 1.5:</p>\n<pre class=\"literal-block\">\nvoid            segment ( const double clusterThreshold_ = 1.0,\n                          const double smoothingThreshold_ = 1.5 )\n</pre>\n</div>\n<div class=\"section\" id=\"shade\">\n<h2><a class=\"toc-backref\" href=\"#id92\">shade</a></h2>\n<p>Shade image using distant light source. Specify <cite>azimuth</cite> and\n<cite>elevation</cite> as the position of the light source. By default, the\nshading results as a grayscale image.. Set <cite>colorShading</cite> to true to\nshade the red, green, and blue components of the image:</p>\n<pre class=\"literal-block\">\nvoid            shade ( const double azimuth_ = 30,\n                        const double elevation_ = 30,\n                        const bool   colorShading_ = false )\n</pre>\n</div>\n<div class=\"section\" id=\"sharpen\">\n<h2><a class=\"toc-backref\" href=\"#id93\">sharpen</a></h2>\n<p>Sharpen pixels in image.  The <cite>radius</cite> parameter specifies the radius\nof the Gaussian, in pixels, not counting the center pixel.  The\n<cite>sigma</cite> parameter specifies the standard deviation of the Laplacian,\nin pixels:</p>\n<pre class=\"literal-block\">\nvoid            sharpen ( const double radius_ = 0.0,\n                          const double sigma_ = 1.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"sharpenchannel\">\n<h2><a class=\"toc-backref\" href=\"#id94\">sharpenChannel</a></h2>\n<p>Sharpen pixels in image channel.  The <cite>radius</cite> parameter specifies the\nradius of the Gaussian, in pixels, not counting the center pixel.  The\n<cite>sigma</cite> parameter specifies the standard deviation of the Laplacian,\nin pixels:</p>\n<pre class=\"literal-block\">\nvoid            sharpenChannel ( const ChannelType channel_,\n                                 const double radius_ = 0.0,\n                                 const double sigma_ = 1.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"shave\">\n<h2><a class=\"toc-backref\" href=\"#id95\">shave</a></h2>\n<p>Shave pixels from image edges:</p>\n<pre class=\"literal-block\">\nvoid            shave ( const Geometry &amp;geometry_ )\n</pre>\n</div>\n<div class=\"section\" id=\"shear\">\n<h2><a class=\"toc-backref\" href=\"#id96\">shear</a></h2>\n<p>Shear image (create parallelogram by sliding image by X or Y\naxis). Shearing slides one edge of an image along the X or Y axis,\ncreating a parallelogram.  An X direction shear slides an edge along\nthe X axis, while a Y direction shear slides an edge along the Y axis.\nThe amount of the shear is controlled by a shear angle.  For X\ndirection shears, x degrees is measured relative to the Y axis, and\nsimilarly, for Y direction shears y degrees is measured relative to\nthe X axis. Empty triangles left over from shearing the image are\nfilled with the <a class=\"reference external\" href=\"Color.html\">color</a> defined as borderColor:</p>\n<pre class=\"literal-block\">\nvoid            shear ( const double xShearAngle_,\n                        const double yShearAngle_ )\n</pre>\n</div>\n<div class=\"section\" id=\"solarize\">\n<h2><a class=\"toc-backref\" href=\"#id97\">solarize</a></h2>\n<p>Solarize image (similar to effect seen when exposing a photographic\nfilm to light during the development process):</p>\n<pre class=\"literal-block\">\nvoid            solarize ( const double factor_ = 50.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"spread\">\n<h2><a class=\"toc-backref\" href=\"#id98\">spread</a></h2>\n<p>Spread pixels randomly within image by specified ammount:</p>\n<pre class=\"literal-block\">\nvoid            spread ( const unsigned int amount_ = 3 )\n</pre>\n</div>\n<div class=\"section\" id=\"stegano\">\n<h2><a class=\"toc-backref\" href=\"#id99\">stegano</a></h2>\n<p>Add a digital watermark to the image (based on second image):</p>\n<pre class=\"literal-block\">\nvoid            stegano ( const Image &amp;watermark_ )\n</pre>\n</div>\n<div class=\"section\" id=\"stereo\">\n<h2><a class=\"toc-backref\" href=\"#id100\">stereo</a></h2>\n<p>Create an image which appears in stereo when viewed with red-blue\nglasses (Red image on left, blue on right):</p>\n<pre class=\"literal-block\">\nvoid            stereo ( const Image &amp;rightImage_ )\n</pre>\n</div>\n<div class=\"section\" id=\"strip\">\n<h2><a class=\"toc-backref\" href=\"#id101\">strip</a></h2>\n<p>Remove all profiles and text attributes from the image.</p>\n<blockquote>\nvoid            strip ( void );</blockquote>\n</div>\n<div class=\"section\" id=\"swirl\">\n<h2><a class=\"toc-backref\" href=\"#id102\">swirl</a></h2>\n<p>Swirl image (image pixels are rotated by degrees):</p>\n<pre class=\"literal-block\">\nvoid            swirl ( const double degrees_ )\n</pre>\n</div>\n<div class=\"section\" id=\"texture\">\n<h2><a class=\"toc-backref\" href=\"#id103\">texture</a></h2>\n<p>Channel a texture on pixels matching image background <a class=\"reference external\" href=\"Color.html\">color</a>:</p>\n<pre class=\"literal-block\">\nvoid            texture ( const Image &amp;texture_ )\n</pre>\n</div>\n<div class=\"section\" id=\"threshold\">\n<h2><a class=\"toc-backref\" href=\"#id104\">threshold</a></h2>\n<p>Threshold image channels (below threshold becomes black, above\nthreshold becomes white).  The range of the threshold parameter is 0\nto MaxRGB:</p>\n<pre class=\"literal-block\">\nvoid            threshold ( const double threshold_ )\n</pre>\n</div>\n<div class=\"section\" id=\"transform\">\n<h2><a class=\"toc-backref\" href=\"#id105\">transform</a></h2>\n<p>Transform image based on image and crop geometries. Crop geometry is\noptional:</p>\n<pre class=\"literal-block\">\nvoid            transform ( const Geometry &amp;imageGeometry_ )\n\nvoid            transform ( const Geometry &amp;imageGeometry_,\n                            const Geometry &amp;cropGeometry_  )\n</pre>\n</div>\n<div class=\"section\" id=\"transparent\">\n<h2><a class=\"toc-backref\" href=\"#id106\">transparent</a></h2>\n<p>Add matte channel to image, setting pixels matching <a class=\"reference external\" href=\"Color.html\">color</a> to\ntransparent:</p>\n<pre class=\"literal-block\">\nvoid            transparent ( const Color &amp;color_ )\n</pre>\n</div>\n<div class=\"section\" id=\"trim\">\n<h2><a class=\"toc-backref\" href=\"#id107\">trim</a></h2>\n<p>Trim edges that are the background <a class=\"reference external\" href=\"Color.html\">color</a> from the image:</p>\n<pre class=\"literal-block\">\nvoid            trim ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"type\">\n<h2><a class=\"toc-backref\" href=\"#id108\">type</a></h2>\n<p>Convert the image representation to the specified type or retrieve the\ncurrent image type.  If the image is reduced to an inferior type, then\nimage information may be lost (e.g. color changed to grayscale).</p>\n<p>Available enumerations for the <cite>type</cite> parameter:</p>\n<blockquote>\n<dl class=\"docutils\">\n<dt>BilevelType</dt>\n<dd>black/white</dd>\n<dt>GrayscaleType</dt>\n<dd>grayscale</dd>\n<dt>GrayscaleMatteType</dt>\n<dd>grayscale with alpha (opacity) channel</dd>\n<dt>PaletteType</dt>\n<dd>colormapped</dd>\n<dt>PaletteMatteType</dt>\n<dd>colormapped with transparency</dd>\n<dt>TrueColorType</dt>\n<dd>true (full) color</dd>\n<dt>TrueColorMatteType</dt>\n<dd>true (full) color with alpha (opacity) channel</dd>\n<dt>ColorSeparationType</dt>\n<dd>Cyan, magenta, yellow, and black</dd>\n<dt>ColorSeparationMatteType</dt>\n<dd>Cyan, magenta, yellow, and black with alpha (opacity) channel</dd>\n<dt>OptimizeType</dt>\n<dd>Optimize the image type to best represent the existing pixels</dd>\n</dl>\n</blockquote>\n<pre class=\"literal-block\">\nvoid            type ( const ImageType type_ )\n\nImageType       type ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"unsharpmask\">\n<h2><a class=\"toc-backref\" href=\"#id109\">unsharpmask</a></h2>\n<p>Replace image with a sharpened version of the original image using the\nunsharp mask algorithm.</p>\n<blockquote>\n<dl class=\"docutils\">\n<dt><cite>radius</cite></dt>\n<dd>the radius of the Gaussian, in pixels, not counting the\ncenter pixel.</dd>\n<dt><cite>sigma</cite></dt>\n<dd>the standard deviation of the Gaussian, in pixels.</dd>\n<dt><cite>amount</cite></dt>\n<dd>the percentage of the difference between the original and\nthe blur image that is added back into the original.</dd>\n<dt><cite>threshold</cite></dt>\n<dd>the threshold in pixels needed to apply the diffence amount.</dd>\n</dl>\n</blockquote>\n<pre class=\"literal-block\">\nvoid            unsharpmask ( const double radius_,\n                              const double sigma_,\n                              const double amount_,\n                              const double threshold_ )\n</pre>\n</div>\n<div class=\"section\" id=\"unsharpmaskchannel\">\n<h2><a class=\"toc-backref\" href=\"#id110\">unsharpmaskChannel</a></h2>\n<p>Replace image channel with a sharpened version of the original image\nusing the unsharp mask algorithm.</p>\n<blockquote>\n<dl class=\"docutils\">\n<dt><cite>channel</cite></dt>\n<dd>image channel to modify.</dd>\n<dt><cite>radius</cite></dt>\n<dd>the radius of the Gaussian, in pixels, not counting the\ncenter pixel.</dd>\n<dt><cite>sigma</cite></dt>\n<dd>the standard deviation of the Gaussian, in pixels.</dd>\n<dt><cite>amount</cite></dt>\n<dd>the percentage of the difference between the original and\nthe blur image that is added back into the original.</dd>\n<dt><cite>threshold</cite></dt>\n<dd>the threshold in pixels needed to apply the diffence amount.</dd>\n</dl>\n</blockquote>\n<pre class=\"literal-block\">\nvoid            unsharpmaskChannel ( const ChannelType channel_,\n                                     const double radius_,\n                                     const double sigma_,\n                                     const double amount_,\n                                     const double threshold_ );\n</pre>\n</div>\n<div class=\"section\" id=\"wave\">\n<h2><a class=\"toc-backref\" href=\"#id111\">wave</a></h2>\n<p>Map image pixels to a sine wave:</p>\n<pre class=\"literal-block\">\nvoid            wave ( const double amplitude_ = 25.0,\n                       const double wavelength_ = 150.0 )\n</pre>\n</div>\n<div class=\"section\" id=\"zoom\">\n<h2><a class=\"toc-backref\" href=\"#id112\">zoom</a></h2>\n<p>Zoom (resize) image to specified size:</p>\n<pre class=\"literal-block\">\nvoid            zoom ( const Geometry &amp;geometry_ )\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"set-get-image-attributes\">\n<h1><a class=\"toc-backref\" href=\"#id14\">Set/Get Image Attributes</a></h1>\n<p>Image attributes are set and obtained via methods in Image. Except for\nmethods which accept pointer arguments (e.g. chromaBluePrimary) all\nmethods return attributes by value.</p>\n<p>Image attributes are easily used. For example, to set the resolution\nof the TIFF file &quot;file.tiff&quot; to 150 dots-per-inch (DPI) in both the\nhorizontal and vertical directions, you can use the following example\ncode:</p>\n<pre class=\"literal-block\">\nstring filename(&quot;file.tiff&quot;);\nImage image;\nimage.read(filename);\nimage.resolutionUnits(PixelsPerInchResolution);\nimage.density(Geometry(150,150));   // could also use image.density(&quot;150x150&quot;)\nimage.write(filename)\n</pre>\n<p>The following image attribute methods are available:</p>\n<div class=\"contents local topic\" id=\"id3\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#adjoin\" id=\"id113\">adjoin</a></li>\n<li><a class=\"reference internal\" href=\"#antialias\" id=\"id114\">antiAlias</a></li>\n<li><a class=\"reference internal\" href=\"#animationdelay\" id=\"id115\">animationDelay</a></li>\n<li><a class=\"reference internal\" href=\"#animationiterations\" id=\"id116\">animationIterations</a></li>\n<li><a class=\"reference internal\" href=\"#attribute\" id=\"id117\">attribute</a></li>\n<li><a class=\"reference internal\" href=\"#backgroundcolor\" id=\"id118\">backgroundColor</a></li>\n<li><a class=\"reference internal\" href=\"#backgroundtexture\" id=\"id119\">backgroundTexture</a></li>\n<li><a class=\"reference internal\" href=\"#basecolumns\" id=\"id120\">baseColumns</a></li>\n<li><a class=\"reference internal\" href=\"#basefilename\" id=\"id121\">baseFilename</a></li>\n<li><a class=\"reference internal\" href=\"#baserows\" id=\"id122\">baseRows</a></li>\n<li><a class=\"reference internal\" href=\"#bordercolor\" id=\"id123\">borderColor</a></li>\n<li><a class=\"reference internal\" href=\"#boundingbox\" id=\"id124\">boundingBox</a></li>\n<li><a class=\"reference internal\" href=\"#boxcolor\" id=\"id125\">boxColor</a></li>\n<li><a class=\"reference internal\" href=\"#cachethreshold\" id=\"id126\">cacheThreshold</a></li>\n<li><a class=\"reference internal\" href=\"#chromablueprimary\" id=\"id127\">chromaBluePrimary</a></li>\n<li><a class=\"reference internal\" href=\"#chromagreenprimary\" id=\"id128\">chromaGreenPrimary</a></li>\n<li><a class=\"reference internal\" href=\"#chromaredprimary\" id=\"id129\">chromaRedPrimary</a></li>\n<li><a class=\"reference internal\" href=\"#chromawhitepoint\" id=\"id130\">chromaWhitePoint</a></li>\n<li><a class=\"reference internal\" href=\"#classtype\" id=\"id131\">classType</a></li>\n<li><a class=\"reference internal\" href=\"#clipmask\" id=\"id132\">clipMask</a></li>\n<li><a class=\"reference internal\" href=\"#colorfuzz\" id=\"id133\">colorFuzz</a></li>\n<li><a class=\"reference internal\" href=\"#colormap\" id=\"id134\">colorMap</a></li>\n<li><a class=\"reference internal\" href=\"#colormapsize\" id=\"id135\">colorMapSize</a></li>\n<li><a class=\"reference internal\" href=\"#colorspace\" id=\"id136\">colorSpace</a></li>\n<li><a class=\"reference internal\" href=\"#columns\" id=\"id137\">columns</a></li>\n<li><a class=\"reference internal\" href=\"#id4\" id=\"id138\">comment</a></li>\n<li><a class=\"reference internal\" href=\"#compose\" id=\"id139\">compose</a></li>\n<li><a class=\"reference internal\" href=\"#compresstype\" id=\"id140\">compressType</a></li>\n<li><a class=\"reference internal\" href=\"#debug\" id=\"id141\">debug</a></li>\n<li><a class=\"reference internal\" href=\"#definevalue\" id=\"id142\">defineValue</a></li>\n<li><a class=\"reference internal\" href=\"#defineset\" id=\"id143\">defineSet</a></li>\n<li><a class=\"reference internal\" href=\"#density\" id=\"id144\">density</a></li>\n<li><a class=\"reference internal\" href=\"#depth\" id=\"id145\">depth</a></li>\n<li><a class=\"reference internal\" href=\"#directory\" id=\"id146\">directory</a></li>\n<li><a class=\"reference internal\" href=\"#endian\" id=\"id147\">endian</a></li>\n<li><a class=\"reference internal\" href=\"#filename\" id=\"id148\">fileName</a></li>\n<li><a class=\"reference internal\" href=\"#filesize\" id=\"id149\">fileSize</a></li>\n<li><a class=\"reference internal\" href=\"#fillcolor\" id=\"id150\">fillColor</a></li>\n<li><a class=\"reference internal\" href=\"#fillpattern\" id=\"id151\">fillPattern</a></li>\n<li><a class=\"reference internal\" href=\"#fillrule\" id=\"id152\">fillRule</a></li>\n<li><a class=\"reference internal\" href=\"#filtertype\" id=\"id153\">filterType</a></li>\n<li><a class=\"reference internal\" href=\"#font\" id=\"id154\">font</a></li>\n<li><a class=\"reference internal\" href=\"#fontpointsize\" id=\"id155\">fontPointsize</a></li>\n<li><a class=\"reference internal\" href=\"#fonttypemetrics\" id=\"id156\">fontTypeMetrics</a></li>\n<li><a class=\"reference internal\" href=\"#format\" id=\"id157\">format</a></li>\n<li><a class=\"reference internal\" href=\"#formatexpression\" id=\"id158\">formatExpression</a></li>\n<li><a class=\"reference internal\" href=\"#id5\" id=\"id159\">gamma</a></li>\n<li><a class=\"reference internal\" href=\"#id6\" id=\"id160\">geometry</a></li>\n<li><a class=\"reference internal\" href=\"#gifdisposemethod\" id=\"id161\">gifDisposeMethod</a></li>\n<li><a class=\"reference internal\" href=\"#icccolorprofile\" id=\"id162\">iccColorProfile</a></li>\n<li><a class=\"reference internal\" href=\"#interlacetype\" id=\"id163\">interlaceType</a></li>\n<li><a class=\"reference internal\" href=\"#iptcprofile\" id=\"id164\">iptcProfile</a></li>\n<li><a class=\"reference internal\" href=\"#isvalid\" id=\"id165\">isValid</a></li>\n<li><a class=\"reference internal\" href=\"#id7\" id=\"id166\">label</a></li>\n<li><a class=\"reference internal\" href=\"#linewidth\" id=\"id167\">lineWidth</a></li>\n<li><a class=\"reference internal\" href=\"#magick\" id=\"id168\">magick</a></li>\n<li><a class=\"reference internal\" href=\"#matte\" id=\"id169\">matte</a></li>\n<li><a class=\"reference internal\" href=\"#mattecolor\" id=\"id170\">matteColor</a></li>\n<li><a class=\"reference internal\" href=\"#meanerrorperpixel\" id=\"id171\">meanErrorPerPixel</a></li>\n<li><a class=\"reference internal\" href=\"#modulusdepth\" id=\"id172\">modulusDepth</a></li>\n<li><a class=\"reference internal\" href=\"#monochrome\" id=\"id173\">monochrome</a></li>\n<li><a class=\"reference internal\" href=\"#montagegeometry\" id=\"id174\">montageGeometry</a></li>\n<li><a class=\"reference internal\" href=\"#normalizedmaxerror\" id=\"id175\">normalizedMaxError</a></li>\n<li><a class=\"reference internal\" href=\"#normalizedmeanerror\" id=\"id176\">normalizedMeanError</a></li>\n<li><a class=\"reference internal\" href=\"#orientation\" id=\"id177\">orientation</a></li>\n<li><a class=\"reference internal\" href=\"#page\" id=\"id178\">page</a></li>\n<li><a class=\"reference internal\" href=\"#pixelcolor\" id=\"id179\">pixelColor</a></li>\n<li><a class=\"reference internal\" href=\"#profile\" id=\"id180\">profile</a></li>\n<li><a class=\"reference internal\" href=\"#quality\" id=\"id181\">quality</a></li>\n<li><a class=\"reference internal\" href=\"#quantizecolors\" id=\"id182\">quantizeColors</a></li>\n<li><a class=\"reference internal\" href=\"#quantizecolorspace\" id=\"id183\">quantizeColorSpace</a></li>\n<li><a class=\"reference internal\" href=\"#quantizedither\" id=\"id184\">quantizeDither</a></li>\n<li><a class=\"reference internal\" href=\"#quantizetreedepth\" id=\"id185\">quantizeTreeDepth</a></li>\n<li><a class=\"reference internal\" href=\"#quiet\" id=\"id186\">quiet</a></li>\n<li><a class=\"reference internal\" href=\"#renderingintent\" id=\"id187\">renderingIntent</a></li>\n<li><a class=\"reference internal\" href=\"#repage\" id=\"id188\">repage</a></li>\n<li><a class=\"reference internal\" href=\"#resolutionunits\" id=\"id189\">resolutionUnits</a></li>\n<li><a class=\"reference internal\" href=\"#rows\" id=\"id190\">rows</a></li>\n<li><a class=\"reference internal\" href=\"#scene\" id=\"id191\">scene</a></li>\n<li><a class=\"reference internal\" href=\"#signature\" id=\"id192\">signature</a></li>\n<li><a class=\"reference internal\" href=\"#size\" id=\"id193\">size</a></li>\n<li><a class=\"reference internal\" href=\"#statistics\" id=\"id194\">statistics</a></li>\n<li><a class=\"reference internal\" href=\"#strokeantialias\" id=\"id195\">strokeAntiAlias</a></li>\n<li><a class=\"reference internal\" href=\"#strokecolor\" id=\"id196\">strokeColor</a></li>\n<li><a class=\"reference internal\" href=\"#strokedasharray\" id=\"id197\">strokeDashArray</a></li>\n<li><a class=\"reference internal\" href=\"#strokedashoffset\" id=\"id198\">strokeDashOffset</a></li>\n<li><a class=\"reference internal\" href=\"#strokelinecap\" id=\"id199\">strokeLineCap</a></li>\n<li><a class=\"reference internal\" href=\"#strokelinejoin\" id=\"id200\">strokeLineJoin</a></li>\n<li><a class=\"reference internal\" href=\"#strokemiterlimit\" id=\"id201\">strokeMiterLimit</a></li>\n<li><a class=\"reference internal\" href=\"#strokepattern\" id=\"id202\">strokePattern</a></li>\n<li><a class=\"reference internal\" href=\"#strokewidth\" id=\"id203\">strokeWidth</a></li>\n<li><a class=\"reference internal\" href=\"#subimage\" id=\"id204\">subImage</a></li>\n<li><a class=\"reference internal\" href=\"#subrange\" id=\"id205\">subRange</a></li>\n<li><a class=\"reference internal\" href=\"#textencoding\" id=\"id206\">textEncoding</a></li>\n<li><a class=\"reference internal\" href=\"#tilename\" id=\"id207\">tileName</a></li>\n<li><a class=\"reference internal\" href=\"#totalcolors\" id=\"id208\">totalColors</a></li>\n<li><a class=\"reference internal\" href=\"#transformorigin\" id=\"id209\">transformOrigin</a></li>\n<li><a class=\"reference internal\" href=\"#transformrotation\" id=\"id210\">transformRotation</a></li>\n<li><a class=\"reference internal\" href=\"#transformreset\" id=\"id211\">transformReset</a></li>\n<li><a class=\"reference internal\" href=\"#transformscale\" id=\"id212\">transformScale</a></li>\n<li><a class=\"reference internal\" href=\"#transformskewx\" id=\"id213\">transformSkewX</a></li>\n<li><a class=\"reference internal\" href=\"#transformskewy\" id=\"id214\">transformSkewY</a></li>\n<li><a class=\"reference internal\" href=\"#verbose\" id=\"id215\">verbose</a></li>\n<li><a class=\"reference internal\" href=\"#view\" id=\"id216\">view</a></li>\n<li><a class=\"reference internal\" href=\"#x11display\" id=\"id217\">x11Display</a></li>\n<li><a class=\"reference internal\" href=\"#xresolution\" id=\"id218\">xResolution</a></li>\n<li><a class=\"reference internal\" href=\"#yresolution\" id=\"id219\">yResolution</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"adjoin\">\n<h2><a class=\"toc-backref\" href=\"#id113\">adjoin</a></h2>\n<p>Join images into a single multi-image file:</p>\n<pre class=\"literal-block\">\nvoid            adjoin ( const bool flag_ )\n\nbool            adjoin ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"antialias\">\n<h2><a class=\"toc-backref\" href=\"#id114\">antiAlias</a></h2>\n<p>Control antialiasing of rendered Postscript and Postscript or TrueType\nfonts. Enabled by default:</p>\n<pre class=\"literal-block\">\nvoid            antiAlias( const bool flag_ )\n\nbool            antiAlias( void )\n</pre>\n</div>\n<div class=\"section\" id=\"animationdelay\">\n<h2><a class=\"toc-backref\" href=\"#id115\">animationDelay</a></h2>\n<p>Time in 1/100ths of a second (0 to 65535) which must expire before\ndisplaying the next image in an animated sequence. This option is\nuseful for regulating the animation of a sequence of GIF images within\nNetscape:</p>\n<pre class=\"literal-block\">\nvoid            animationDelay ( const unsigned int delay_ )\n\nunsigned int    animationDelay ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"animationiterations\">\n<h2><a class=\"toc-backref\" href=\"#id116\">animationIterations</a></h2>\n<p>Number of iterations to loop an animation (e.g. Netscape loop\nextension) for:</p>\n<pre class=\"literal-block\">\nvoid            animationIterations ( const unsigned int iterations_ )\n\nunsigned int    animationIterations ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"attribute\">\n<h2><a class=\"toc-backref\" href=\"#id117\">attribute</a></h2>\n<p>Access or update an arbitrary named image attribute. Any number of\nnamed attributes may be attached to the image. For example, the image\ncomment is a named image attribute with the name &quot;comment&quot;.  If the\nnamed attribute already exists, the provided text is appended to the\nexisting attribute text.  Pass NULL to remove an existing text\nattribute, or to restart the text attribute from scratch.</p>\n<p>EXIF tags are attached to the image as named attributes. Use the\nsyntax &quot;EXIF:&lt;tag&gt;&quot; to request an EXIF tag similar to\n&quot;EXIF:DateTime&quot;:</p>\n<pre class=\"literal-block\">\nvoid            attribute ( const std::string name_,\n                            const char * value_ );\n\nvoid            attribute ( const std::string name_,\n                            const std::string value_ )\n\nstd::string     attribute ( const std::string name_ )\n</pre>\n</div>\n<div class=\"section\" id=\"backgroundcolor\">\n<h2><a class=\"toc-backref\" href=\"#id118\">backgroundColor</a></h2>\n<p>Image background <a class=\"reference external\" href=\"Color.html\">color</a>:</p>\n<pre class=\"literal-block\">\nvoid            backgroundColor ( const Color &amp;color_ )\n\nColor           backgroundColor ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"backgroundtexture\">\n<h2><a class=\"toc-backref\" href=\"#id119\">backgroundTexture</a></h2>\n<p>Image file name to use as the background texture. Does not modify\nimage pixels:</p>\n<pre class=\"literal-block\">\nvoid            backgroundTexture (const std::string &amp;backgroundTexture_ )\n\nstd::string     backgroundTexture ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"basecolumns\">\n<h2><a class=\"toc-backref\" href=\"#id120\">baseColumns</a></h2>\n<p>Base image width (before transformations):</p>\n<pre class=\"literal-block\">\nunsigned int    baseColumns ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"basefilename\">\n<h2><a class=\"toc-backref\" href=\"#id121\">baseFilename</a></h2>\n<p>Base image filename (before transformations):</p>\n<pre class=\"literal-block\">\nstd::string     baseFilename ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"baserows\">\n<h2><a class=\"toc-backref\" href=\"#id122\">baseRows</a></h2>\n<p>Base image height (before transformations):</p>\n<pre class=\"literal-block\">\nunsigned int    baseRows ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"bordercolor\">\n<h2><a class=\"toc-backref\" href=\"#id123\">borderColor</a></h2>\n<p>Image border <a class=\"reference external\" href=\"Color.html\">color</a>:</p>\n<pre class=\"literal-block\">\nvoid            borderColor ( const Color &amp;color_ )\n\nColor           borderColor ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"boundingbox\">\n<h2><a class=\"toc-backref\" href=\"#id124\">boundingBox</a></h2>\n<p>Return smallest bounding box enclosing non-border pixels. The\ncurrent fuzz value is used when discriminating between pixels.\nThis is the crop bounding box used by <tt class=\"docutils literal\">crop(Geometry(0,0))</tt>:</p>\n<pre class=\"literal-block\">\nGeometry        boundingBox ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"boxcolor\">\n<h2><a class=\"toc-backref\" href=\"#id125\">boxColor</a></h2>\n<p>Base <a class=\"reference external\" href=\"Color.html\">color</a> that annotation text is rendered on (default none):</p>\n<pre class=\"literal-block\">\nvoid            boxColor ( const Color &amp;boxColor_ )\n\nColor           boxColor ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"cachethreshold\">\n<h2><a class=\"toc-backref\" href=\"#id126\">cacheThreshold</a></h2>\n<p>Pixel cache threshold in megabytes.  Once this memory threshold is\nexceeded, all subsequent pixels cache operations are to/from disk.\nThis setting is shared by all Image objects:</p>\n<pre class=\"literal-block\">\nstatic void     cacheThreshold ( const unsigned int threshold_ )\n</pre>\n</div>\n<div class=\"section\" id=\"chromablueprimary\">\n<h2><a class=\"toc-backref\" href=\"#id127\">chromaBluePrimary</a></h2>\n<p>Chromaticity blue primary point (e.g. x=0.15, y=0.06):</p>\n<pre class=\"literal-block\">\nvoid            chromaBluePrimary ( const double x_, const double y_ )\n\nvoid            chromaBluePrimary ( double *x_, double *y_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"chromagreenprimary\">\n<h2><a class=\"toc-backref\" href=\"#id128\">chromaGreenPrimary</a></h2>\n<p>Chromaticity green primary point (e.g. x=0.3, y=0.6):</p>\n<pre class=\"literal-block\">\nvoid            chromaGreenPrimary ( const double x_, const double y_ )\n\nvoid            chromaGreenPrimary ( double *x_, double *y_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"chromaredprimary\">\n<h2><a class=\"toc-backref\" href=\"#id129\">chromaRedPrimary</a></h2>\n<p>Chromaticity red primary point (e.g. x=0.64, y=0.33):</p>\n<pre class=\"literal-block\">\nvoid            chromaRedPrimary ( const double x_, const double y_ )\n\nvoid            chromaRedPrimary ( double *x_, double *y_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"chromawhitepoint\">\n<h2><a class=\"toc-backref\" href=\"#id130\">chromaWhitePoint</a></h2>\n<p>Chromaticity white point (e.g. x=0.3127, y=0.329):</p>\n<pre class=\"literal-block\">\nvoid            chromaWhitePoint ( const double x_, const double y_ )\nvoid            chromaWhitePoint ( double *x_, double *y_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"classtype\">\n<h2><a class=\"toc-backref\" href=\"#id131\">classType</a></h2>\n<p>Image class (DirectClass or PseudoClass).  NOTE: setting a DirectClass\nimage to PseudoClass will result in the loss of color information if\nthe number of colors in the image is greater than the maximum palette\nsize (either 256 or 65536 entries depending on the value of\nQuantumDepth when ImageMagick was built):</p>\n<pre class=\"literal-block\">\nvoid            classType ( const ClassType class_ )\n\nClassType       classType ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"clipmask\">\n<h2><a class=\"toc-backref\" href=\"#id132\">clipMask</a></h2>\n<p>Associate a clip mask image with the current image. The clip mask\nimage must have the same dimensions as the current image or an\nexception is thrown. Clipping occurs wherever pixels are transparent\nin the clip mask image. Clipping Pass an invalid image to unset an\nexisting clip mask:</p>\n<pre class=\"literal-block\">\nvoid            clipMask ( const Image &amp; clipMask_ )\n\nImage           clipMask ( void  ) const\n</pre>\n</div>\n<div class=\"section\" id=\"colorfuzz\">\n<h2><a class=\"toc-backref\" href=\"#id133\">colorFuzz</a></h2>\n<p>Colors within this distance are considered equal. A number of\nalgorithms search for a target color. By default the color must be\nexact. Use this option to match colors that are close to the target\ncolor in RGB space:</p>\n<pre class=\"literal-block\">\nvoid            colorFuzz ( const double fuzz_ )\n\ndouble          colorFuzz ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"colormap\">\n<h2><a class=\"toc-backref\" href=\"#id134\">colorMap</a></h2>\n<p><a class=\"reference external\" href=\"Color.html\">Color</a> at colormap position <cite>index</cite>:</p>\n<pre class=\"literal-block\">\nvoid            colorMap ( const unsigned int index_,\n                           const Color &amp;color_ )\n\nColor           colorMap ( const unsigned int index_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"colormapsize\">\n<h2><a class=\"toc-backref\" href=\"#id135\">colorMapSize</a></h2>\n<p>Number of entries in the colormap. Setting the colormap size may\nextend or truncate the colormap. The maximum number of supported\nentries is specified by the MaxColormapSize constant, and is dependent\non the value of QuantumDepth when GraphicsMagick is compiled. An\nexception is thrown if more entries are requested than may be\nsupported. Care should be taken when truncating the colormap to ensure\nthat the image colormap indexes reference valid colormap entries:</p>\n<pre class=\"literal-block\">\nvoid            colorMapSize ( const unsigned int entries_ )\n\nunsigned int    colorMapSize ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"colorspace\">\n<h2><a class=\"toc-backref\" href=\"#id136\">colorSpace</a></h2>\n<p>The colorspace (e.g. CMYK) used to represent the image pixel colors:</p>\n<pre class=\"literal-block\">\nvoid            colorSpace( const ColorspaceType colorSpace_ )\n\nColorspaceType  colorSpace ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"columns\">\n<h2><a class=\"toc-backref\" href=\"#id137\">columns</a></h2>\n<p>Image width:</p>\n<pre class=\"literal-block\">\nunsigned int    columns ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2><a class=\"toc-backref\" href=\"#id138\">comment</a></h2>\n<p>Image comment:</p>\n<pre class=\"literal-block\">\nstd::string     comment ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"compose\">\n<h2><a class=\"toc-backref\" href=\"#id139\">compose</a></h2>\n<p>Composition operator to be used when composition is implicitly\nused (such as for image flattening):</p>\n<pre class=\"literal-block\">\nvoid            compose (const CompositeOperator compose_)\n\nCompositeOperator compose ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"compresstype\">\n<h2><a class=\"toc-backref\" href=\"#id140\">compressType</a></h2>\n<p>Image compresion type. The default is the compression type of the\ninput image file:</p>\n<pre class=\"literal-block\">\nvoid            compressType ( const CompressionType compressType_ )\n\nCompressionType compressType ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"debug\">\n<h2><a class=\"toc-backref\" href=\"#id141\">debug</a></h2>\n<p>Enable printing of debug messages from GraphicsMagick as it executes:</p>\n<pre class=\"literal-block\">\nvoid            debug ( const bool flag_ )\n\nbool            debug ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"definevalue\">\n<h2><a class=\"toc-backref\" href=\"#id142\">defineValue</a></h2>\n<p>Set or obtain a definition string to applied when encoding or decoding\nthe specified format. The meanings of the definitions are format\nspecific. The format is designated by the <cite>magick</cite> argument, the\nformat-specific key is designated by <cite>key</cite>, and the associated value\nis specified by <cite>value</cite>. See the defineSet() method if the key must be\nremoved entirely:</p>\n<pre class=\"literal-block\">\nvoid            defineValue ( const std::string &amp;magick_,\n                              const std::string &amp;key_,\n                              const std::string &amp;value_ )\n\nstd::string     defineValue ( const std::string &amp;magick_,\n                              const std::string &amp;key_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"defineset\">\n<h2><a class=\"toc-backref\" href=\"#id143\">defineSet</a></h2>\n<p>Set or obtain a definition flag to applied when encoding or decoding\nthe specified format. Similar to the defineValue() method except that\npassing the <cite>flag</cite> value 'true' creates a value-less define with that\nformat and key. Passing the <cite>flag</cite> value 'false' removes any existing\nmatching definition. The method returns 'true' if a matching key\nexists, and 'false' if no matching key exists:</p>\n<pre class=\"literal-block\">\nvoid            defineSet ( const std::string &amp;magick_,\n                            const std::string &amp;key_,\n                            bool flag_ )\n\nbool            defineSet ( const std::string &amp;magick_,\n                            const std::string &amp;key_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"density\">\n<h2><a class=\"toc-backref\" href=\"#id144\">density</a></h2>\n<p>Vertical and horizontal resolution in pixels of the image. This option\nspecifies an image density when decoding a Postscript or Portable\nDocument page. Often used with <cite>psPageSize</cite>:</p>\n<pre class=\"literal-block\">\nvoid            density ( const Geometry &amp;geomery_ )\n\nGeometry        density ( void ) const\n</pre>\n<p>Please note that the 'density' method suffers from a design problem in\nthat the Geometry object only supports integer dimensions, but the\nunderlying image resolution is a floating point value.  This results\nin rounding off the value.  Please see the xResolution() and\nyResolution() methods for a way to set and get the resolution in\nfloating point.</p>\n<p>The resolution units may be obtained via the resolutionUnits() method.</p>\n</div>\n<div class=\"section\" id=\"depth\">\n<h2><a class=\"toc-backref\" href=\"#id145\">depth</a></h2>\n<p>Image depth (bits allocated to red/green/blue components). Used to\nspecify the bit depth when reading or writing raw images or when the\noutput format supports multiple depths. Defaults to the quantum depth\nthat GraphicsMagick is compiled with:</p>\n<pre class=\"literal-block\">\nvoid            depth ( const unsigned int depth_ )\n\nunsigned int    depth ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"directory\">\n<h2><a class=\"toc-backref\" href=\"#id146\">directory</a></h2>\n<p>Tile names from within an image montage:</p>\n<pre class=\"literal-block\">\nstd::string     directory ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"endian\">\n<h2><a class=\"toc-backref\" href=\"#id147\">endian</a></h2>\n<p>Endianness (<cite>LSBEndian</cite> like Intel, <cite>MSBEndian</cite> like SPARC, or\n<cite>NativeEndian</cite> for what this computer uses) for image formats which\nsupport endian-specific options:</p>\n<pre class=\"literal-block\">\nvoid            endian ( const EndianType endian_ )\n\nEndianType      endian ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"filename\">\n<h2><a class=\"toc-backref\" href=\"#id148\">fileName</a></h2>\n<p>Image file name:</p>\n<pre class=\"literal-block\">\nvoid            fileName ( const std::string &amp;fileName_ )\n\nstd::string     fileName ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"filesize\">\n<h2><a class=\"toc-backref\" href=\"#id149\">fileSize</a></h2>\n<p>Number of bytes of the image on disk:</p>\n<pre class=\"literal-block\">\noff_t          fileSize ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"fillcolor\">\n<h2><a class=\"toc-backref\" href=\"#id150\">fillColor</a></h2>\n<p><a class=\"reference external\" href=\"Color.html\">Color</a> to use when filling drawn objects:</p>\n<pre class=\"literal-block\">\nvoid            fillColor ( const Color &amp;fillColor_ )\n\nColor           fillColor ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"fillpattern\">\n<h2><a class=\"toc-backref\" href=\"#id151\">fillPattern</a></h2>\n<p>Pattern to use while filling drawn objects:</p>\n<pre class=\"literal-block\">\nvoid            fillPattern ( const Image &amp;fillPattern_ )\n\nImage           fillPattern ( void  ) const\n</pre>\n</div>\n<div class=\"section\" id=\"fillrule\">\n<h2><a class=\"toc-backref\" href=\"#id152\">fillRule</a></h2>\n<p>Rule to use when filling drawn objects:</p>\n<pre class=\"literal-block\">\nvoid            fillRule ( const FillRule &amp;fillRule_ )\n\nFillRule        fillRule ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"filtertype\">\n<h2><a class=\"toc-backref\" href=\"#id153\">filterType</a></h2>\n<p>Filter to use when resizing image. The reduction filter employed has a\nsigificant effect on the time required to resize an image and the\nresulting quality. The default filter is Lanczos which has been shown\nto produce high quality results when reducing most images:</p>\n<pre class=\"literal-block\">\nvoid            filterType ( const FilterTypes filterType_ )\n\nFilterTypes     filterType ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"font\">\n<h2><a class=\"toc-backref\" href=\"#id154\">font</a></h2>\n<p>Text rendering font. If the font is a fully qualified X server font\nname, the font is obtained from an X server. To use a TrueType font,\nprecede the TrueType filename with an &#64;. Otherwise, specify a\nPostscript font name (e.g. &quot;helvetica&quot;).:</p>\n<pre class=\"literal-block\">\nvoid            font ( const std::string &amp;font_ )\n\nstd::string     font ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"fontpointsize\">\n<h2><a class=\"toc-backref\" href=\"#id155\">fontPointsize</a></h2>\n<p>Text rendering font point size:</p>\n<pre class=\"literal-block\">\nvoid            fontPointsize ( const double pointSize_ )\n\ndouble          fontPointsize ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"fonttypemetrics\">\n<h2><a class=\"toc-backref\" href=\"#id156\">fontTypeMetrics</a></h2>\n<p>Obtain font metrics (see <a class=\"reference external\" href=\"TypeMetric.html\">TypeMetric</a>) for text string given current\nfont, pointsize, and density settings.  This information is necessary\nin order to do fancy layout of text:</p>\n<pre class=\"literal-block\">\nvoid            fontTypeMetrics( const std::string &amp;text_,\n                                 TypeMetric *metrics )\n</pre>\n</div>\n<div class=\"section\" id=\"format\">\n<h2><a class=\"toc-backref\" href=\"#id157\">format</a></h2>\n<p>Long image format description:</p>\n<pre class=\"literal-block\">\nstd::string     format ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"formatexpression\">\n<h2><a class=\"toc-backref\" href=\"#id158\">formatExpression</a></h2>\n<p>Format a string based on image properties similar to <cite>identify</cite>\n<cite>-format</cite>.  For example, the format expression &quot;%wx%h&quot; is converted to\na string containing image WIDTHxHEIGHT like &quot;640x480&quot;:</p>\n<pre class=\"literal-block\">\nstd::string     formatExpression( const std::string expression )\n</pre>\n<p>Please note that this method is not a const method (may modify the\nImage object and will assure a reference count of one) and it <em>may</em>\nthrow an exception if there is an internal error.</p>\n</div>\n<div class=\"section\" id=\"id5\">\n<h2><a class=\"toc-backref\" href=\"#id159\">gamma</a></h2>\n<p>Gamma level of the image.  Gamma is a pow() function which converts\nbetween the linear light representation and the representation for the\ncomputer display.  Most computer images are gamma corrected to 2.2\n(1/0.4545) so that each step results in a visually linear step on a\ncomputer or video display:</p>\n<pre class=\"literal-block\">\ndouble          gamma ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2><a class=\"toc-backref\" href=\"#id160\">geometry</a></h2>\n<p>Preferred size of the image when encoding:</p>\n<pre class=\"literal-block\">\nGeometry        geometry ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"gifdisposemethod\">\n<h2><a class=\"toc-backref\" href=\"#id161\">gifDisposeMethod</a></h2>\n<p>GIF disposal method. This option (specific to the GIF file format) is\nused to control how successive frames are rendered (how the preceding\nframe is disposed of) when creating a GIF animation:</p>\n<pre class=\"literal-block\">\nvoid            gifDisposeMethod ( const unsigned int disposeMethod_ )\n\nunsigned int    gifDisposeMethod ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"icccolorprofile\">\n<h2><a class=\"toc-backref\" href=\"#id162\">iccColorProfile</a></h2>\n<p>ICC color profile. Supplied via a <a class=\"reference external\" href=\"Blob.html\">Blob</a> since Magick++/ and\nGraphicsMagick do not currently support formating this data structure\ndirectly.</p>\n<p>If there is not already an ICC color profile, the profile is merely\nattached to the image without transforming the pixels.  If there is\nalready an ICC color profile (the source profile), the pixels are\ntranslated according to the source and target profiles, and the\nexisting profile is replaced with the target profile.</p>\n<p>Also see <a class=\"reference internal\" href=\"#renderingintent\">renderingIntent</a>, which allows specifying the rendering\nintent if the profile is executed.</p>\n<p>Specifications for ICC color profiles and their usage are available\nfrom the International Color Consortium for the format of ICC color\nprofiles:</p>\n<pre class=\"literal-block\">\nvoid            iccColorProfile( const Blob &amp;colorProfile_ )\n\nBlob            iccColorProfile( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"interlacetype\">\n<h2><a class=\"toc-backref\" href=\"#id163\">interlaceType</a></h2>\n<p>The type of interlacing scheme (default <cite>NoInterlace</cite> ). This option\nis used to specify the type of interlacing scheme for raw image\nformats such as RGB or YUV. <cite>NoInterlace</cite> means do not interlace,\n<cite>LineInterlace</cite> uses scanline interlacing, and <cite>PlaneInterlace</cite> uses\nplane interlacing. <cite>PartitionInterlace</cite> is like <cite>PlaneInterlace</cite>\nexcept the different planes are saved to individual files (e.g.\nimage.R, image.G, and image.B). Use <cite>LineInterlace</cite> or\n<cite>PlaneInterlace</cite> to create an interlaced GIF or progressive JPEG\nimage:</p>\n<pre class=\"literal-block\">\nvoid            interlaceType ( const InterlaceType interlace_ )\n\nInterlaceType   interlaceType ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"iptcprofile\">\n<h2><a class=\"toc-backref\" href=\"#id164\">iptcProfile</a></h2>\n<p>IPTC profile. Supplied via a <a class=\"reference external\" href=\"Blob.html\">Blob</a> since Magick++ and GraphicsMagick do\nnot currently support formating this data structure\ndirectly. Specifications are available from the International Press\nTelecommunications Council for IPTC profiles:</p>\n<pre class=\"literal-block\">\nvoid            iptcProfile( const Blob&amp; iptcProfile_ )\n\nBlob            iptcProfile( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"isvalid\">\n<h2><a class=\"toc-backref\" href=\"#id165\">isValid</a></h2>\n<p>Does object contain valid image? Set to <cite>false</cite> in order to invalidate\nthe image. Images constructed via the default constructor are invalid\nimages and isValid() will return false:</p>\n<pre class=\"literal-block\">\nvoid            isValid ( const bool isValid_ )\n\nbool            isValid ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"id7\">\n<h2><a class=\"toc-backref\" href=\"#id166\">label</a></h2>\n<p>Image label:</p>\n<pre class=\"literal-block\">\nstd::string     label ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"linewidth\">\n<h2><a class=\"toc-backref\" href=\"#id167\">lineWidth</a></h2>\n<p>Stroke width for drawing vector objects (default one)\nThis method is now deprecated. Please use strokeWidth instead:</p>\n<pre class=\"literal-block\">\nvoid            lineWidth ( const double lineWidth_ )\n\ndouble          lineWidth ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"magick\">\n<h2><a class=\"toc-backref\" href=\"#id168\">magick</a></h2>\n<p>File type magick identifier (.e.g &quot;GIF&quot;):</p>\n<pre class=\"literal-block\">\nvoid            magick ( const std::string &amp;magick_ )\n\nstd::string     magick ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"matte\">\n<h2><a class=\"toc-backref\" href=\"#id169\">matte</a></h2>\n<p>Image supports transparency (matte channel):</p>\n<pre class=\"literal-block\">\nvoid            matte ( const bool matteFlag_ )\n\nbool            matte ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"mattecolor\">\n<h2><a class=\"toc-backref\" href=\"#id170\">matteColor</a></h2>\n<p>Image matte (frame) <a class=\"reference external\" href=\"Color.html\">color</a>:</p>\n<pre class=\"literal-block\">\nvoid            matteColor ( const Color &amp;matteColor_ )\n\nColor           matteColor ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"meanerrorperpixel\">\n<h2><a class=\"toc-backref\" href=\"#id171\">meanErrorPerPixel</a></h2>\n<p>The mean error per pixel computed when an image is color reduced. This\nparameter is only valid if verbose is set to true and the image has\njust been quantized:</p>\n<pre class=\"literal-block\">\ndouble          meanErrorPerPixel ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"modulusdepth\">\n<h2><a class=\"toc-backref\" href=\"#id172\">modulusDepth</a></h2>\n<p>Image modulus depth (minimum number of bits required to support\nred/green/blue components without loss of accuracy). The pixel modulus\ndepth may be decreased by supplying a value which is less than the\ncurrent value, updating the pixels (reducing accuracy) to the new\ndepth. The pixel modulus depth can not be increased over the current\nvalue using this method:</p>\n<pre class=\"literal-block\">\nvoid            modulusDepth ( const unsigned int modulusDepth_ )\n\nunsigned int    modulusDepth ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"monochrome\">\n<h2><a class=\"toc-backref\" href=\"#id173\">monochrome</a></h2>\n<p>Transform image to black and white while color reducing (quantizing):</p>\n<pre class=\"literal-block\">\nvoid            monochrome ( const bool monochromeFlag_ )\n\nbool            monochrome ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"montagegeometry\">\n<h2><a class=\"toc-backref\" href=\"#id174\">montageGeometry</a></h2>\n<p>Tile size and offset within an image montage. Only valid for montage\nimages:</p>\n<pre class=\"literal-block\">\nGeometry        montageGeometry ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"normalizedmaxerror\">\n<h2><a class=\"toc-backref\" href=\"#id175\">normalizedMaxError</a></h2>\n<p>The normalized max error per pixel computed when an image is color\nreduced. This parameter is only valid if verbose is set to true and\nthe image has just been quantized:</p>\n<pre class=\"literal-block\">\ndouble          normalizedMaxError ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"normalizedmeanerror\">\n<h2><a class=\"toc-backref\" href=\"#id176\">normalizedMeanError</a></h2>\n<p>The normalized mean error per pixel computed when an image is color\nreduced. This parameter is only valid if verbose is set to true and\nthe image has just been quantized:</p>\n<pre class=\"literal-block\">\ndouble          normalizedMeanError ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"orientation\">\n<h2><a class=\"toc-backref\" href=\"#id177\">orientation</a></h2>\n<p>Image orientation.  Supported by some file formats such as DPX and\nTIFF. Useful for turning the right way up:</p>\n<pre class=\"literal-block\">\nvoid            orientation ( const OrientationType orientation_ )\n\nOrientationType orientation ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"page\">\n<h2><a class=\"toc-backref\" href=\"#id178\">page</a></h2>\n<p>Preferred size and location of an image canvas.</p>\n<p>Use this option to specify the dimensions and position of the\nPostscript page in dots per inch or a TEXT page in pixels. This option\nis typically used in concert with density .</p>\n<p>Page may also be used to position a GIF image (such as for a scene in\nan animation):</p>\n<pre class=\"literal-block\">\nvoid            page ( const Geometry &amp;pageSize_ )\n\nGeometry        page ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"pixelcolor\">\n<h2><a class=\"toc-backref\" href=\"#id179\">pixelColor</a></h2>\n<p>Get/set pixel <a class=\"reference external\" href=\"Color.html\">color</a> at location x &amp; y:</p>\n<pre class=\"literal-block\">\nvoid            pixelColor ( const unsigned int x_,\n                             const unsigned int y_,\n                             const Color &amp;color_ )\n\nColor           pixelColor ( const unsigned int x_,\n                             const unsigned int y_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"profile\">\n<h2><a class=\"toc-backref\" href=\"#id180\">profile</a></h2>\n<p>Add or remove a named profile to/from the image. Remove the\nprofile by passing an empty <a class=\"reference external\" href=\"Blob.html\">Blob</a> (e.g. Blob()). Valid names are\n&quot;*&quot;, &quot;8BIM&quot;, &quot;ICM&quot;, &quot;IPTC&quot;, or a user/format-defined profile name:</p>\n<pre class=\"literal-block\">\nvoid            profile( const std::string name_,\n                         const Blob &amp;colorProfile_ )\n</pre>\n<p>Retrieve a named profile from the image. Valid names are:\n&quot;8BIM&quot;, &quot;8BIMTEXT&quot;, &quot;APP1&quot;, &quot;APP1JPEG&quot;, &quot;ICC&quot;, &quot;ICM&quot;, &amp; &quot;IPTC&quot;\nor an existing user/format-defined profile name:</p>\n<pre class=\"literal-block\">\nBlob            profile( const std::string name_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"quality\">\n<h2><a class=\"toc-backref\" href=\"#id181\">quality</a></h2>\n<p>JPEG/MIFF/PNG compression level (default 75):</p>\n<pre class=\"literal-block\">\nvoid            quality ( const unsigned int quality_ )\n\nunsigned int    quality ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"quantizecolors\">\n<h2><a class=\"toc-backref\" href=\"#id182\">quantizeColors</a></h2>\n<p>Maximum number of colors to quantize to:</p>\n<pre class=\"literal-block\">\nvoid            quantizeColors ( const unsigned int colors_ )\n\nunsigned int    quantizeColors ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"quantizecolorspace\">\n<h2><a class=\"toc-backref\" href=\"#id183\">quantizeColorSpace</a></h2>\n<p>Colorspace to quantize in (default RGB). Empirical evidence suggests\nthat distances in color spaces such as YUV or YIQ correspond to\nperceptual color differences more closely than do distances in RGB\nspace. These color spaces may give better results when color reducing\nan image:</p>\n<pre class=\"literal-block\">\nvoid            quantizeColorSpace ( const ColorspaceType colorSpace_ )\n\nColorspaceType  quantizeColorSpace ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"quantizedither\">\n<h2><a class=\"toc-backref\" href=\"#id184\">quantizeDither</a></h2>\n<p>Apply Floyd/Steinberg error diffusion to the image. The basic strategy\nof dithering is to trade intensity resolution for spatial resolution\nby averaging the intensities of several neighboring pixels. Images\nwhich suffer from severe contouring when reducing colors can be\nimproved with this option. The quantizeColors or monochrome option\nmust be set for this option to take effect:</p>\n<pre class=\"literal-block\">\nvoid            quantizeDither ( const bool ditherFlag_ )\n\nbool            quantizeDither ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"quantizetreedepth\">\n<h2><a class=\"toc-backref\" href=\"#id185\">quantizeTreeDepth</a></h2>\n<p>Depth of the quantization color classification tree. Values of 0 or 1\nallow selection of the optimal tree depth for the color reduction\nalgorithm. Values between 2 and 8 may be used to manually adjust the\ntree depth:</p>\n<pre class=\"literal-block\">\nvoid            quantizeTreeDepth ( const unsigned int treeDepth_ )\n\nunsigned int    quantizeTreeDepth ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"quiet\">\n<h2><a class=\"toc-backref\" href=\"#id186\">quiet</a></h2>\n<p>Determines if Warning exceptions will be thrown, or suppressed.\nThe default is that warnings will be thrown (i.e. false):</p>\n<pre class=\"literal-block\">\nvoid            quiet ( const bool quiet_ );\nbool            quiet ( void ) const;\n</pre>\n</div>\n<div class=\"section\" id=\"renderingintent\">\n<h2><a class=\"toc-backref\" href=\"#id187\">renderingIntent</a></h2>\n<p>The type of rendering intent (used when applying an ICC color\nprofile using <a class=\"reference internal\" href=\"#icccolorprofile\">iccColorProfile</a>):</p>\n<pre class=\"literal-block\">\nvoid            renderingIntent ( const RenderingIntent renderingIntent_ )\n\nRenderingIntent renderingIntent ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"repage\">\n<h2><a class=\"toc-backref\" href=\"#id188\">repage</a></h2>\n<p>Reset the image page canvas and position:</p>\n<pre class=\"literal-block\">\nvoid            repage();\n</pre>\n</div>\n<div class=\"section\" id=\"resolutionunits\">\n<h2><a class=\"toc-backref\" href=\"#id189\">resolutionUnits</a></h2>\n<p>Units of image resolution:</p>\n<pre class=\"literal-block\">\nvoid            resolutionUnits ( const ResolutionType resolutionUnits_ )\n\nResolutionType  resolutionUnits ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"rows\">\n<h2><a class=\"toc-backref\" href=\"#id190\">rows</a></h2>\n<p>The number of pixel rows in the image:</p>\n<pre class=\"literal-block\">\nunsigned int    rows ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"scene\">\n<h2><a class=\"toc-backref\" href=\"#id191\">scene</a></h2>\n<p>Image scene number:</p>\n<pre class=\"literal-block\">\nvoid            scene ( const unsigned int scene_ )\n\nunsigned int    scene ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"signature\">\n<h2><a class=\"toc-backref\" href=\"#id192\">signature</a></h2>\n<p>Image textual signature.  Set <cite>force</cite> to true in order to re-calculate\nthe signature regardless of whether the image data has been modified:</p>\n<pre class=\"literal-block\">\nstd::string     signature ( const bool force_ = false ) const\n</pre>\n</div>\n<div class=\"section\" id=\"size\">\n<h2><a class=\"toc-backref\" href=\"#id193\">size</a></h2>\n<p>Width and height of a raw image (an image which does not support width\nand height information).  Size may also be used to affect the image\nsize read from a multi-resolution format (e.g. Photo CD, JBIG, or\nJPEG:</p>\n<pre class=\"literal-block\">\nvoid            size ( const Geometry &amp;geometry_ )\n\nGeometry        size ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"statistics\">\n<h2><a class=\"toc-backref\" href=\"#id194\">statistics</a></h2>\n<p>Obtain image statistics. Statistics are normalized to the range\nof 0.0 to 1.0 and are output to the specified ImageStatistics\nstructure:</p>\n<pre class=\"literal-block\">\nvoid            statistics ( ImageStatistics *statistics ) const\n</pre>\n</div>\n<div class=\"section\" id=\"strokeantialias\">\n<h2><a class=\"toc-backref\" href=\"#id195\">strokeAntiAlias</a></h2>\n<p>Enable/disable stroke anti-aliasing:</p>\n<pre class=\"literal-block\">\nvoid            strokeAntiAlias( const bool flag_ )\n\nbool            strokeAntiAlias( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"strokecolor\">\n<h2><a class=\"toc-backref\" href=\"#id196\">strokeColor</a></h2>\n<p><a class=\"reference external\" href=\"Color.html\">Color</a> to use when drawing object outlines:</p>\n<pre class=\"literal-block\">\nvoid            strokeColor ( const Color &amp;strokeColor_ )\n\nColor           strokeColor ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"strokedasharray\">\n<h2><a class=\"toc-backref\" href=\"#id197\">strokeDashArray</a></h2>\n<p>Specify the pattern of dashes and gaps used to stroke paths. The\nstrokeDashArray represents a zero-terminated array of numbers that\nspecify the lengths of alternating dashes and gaps in pixels. If an\nodd number of values is provided, then the list of values is repeated\nto yield an even number of values.  A typical <cite>strokeDashArray</cite> array\nmight contain the members 5 3 2 0, where the zero value indicates the\nend of the pattern array:</p>\n<pre class=\"literal-block\">\nvoid            strokeDashArray ( const double* strokeDashArray_ )\n\nconst double*   strokeDashArray ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"strokedashoffset\">\n<h2><a class=\"toc-backref\" href=\"#id198\">strokeDashOffset</a></h2>\n<p>While drawing using a dash pattern, specify distance into the\ndash pattern to start the dash (default 0):</p>\n<pre class=\"literal-block\">\nvoid            strokeDashOffset ( const double strokeDashOffset_ )\n\ndouble          strokeDashOffset ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"strokelinecap\">\n<h2><a class=\"toc-backref\" href=\"#id199\">strokeLineCap</a></h2>\n<p>Specify the shape to be used at the end of open subpaths when\nthey are stroked. Values of LineCap are UndefinedCap, ButtCap,\nRoundCap, and SquareCap:</p>\n<pre class=\"literal-block\">\nvoid            strokeLineCap ( const LineCap lineCap_ )\n\nLineCap         strokeLineCap ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"strokelinejoin\">\n<h2><a class=\"toc-backref\" href=\"#id200\">strokeLineJoin</a></h2>\n<p>Specify the shape to be used at the corners of paths (or other\nvector shapes) when they are stroked. Values of LineJoin are\nUndefinedJoin, MiterJoin, RoundJoin, and BevelJoin:</p>\n<pre class=\"literal-block\">\nvoid            strokeLineJoin ( const LineJoin lineJoin_ )\n\nLineJoin        strokeLineJoin ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"strokemiterlimit\">\n<h2><a class=\"toc-backref\" href=\"#id201\">strokeMiterLimit</a></h2>\n<p>Specify miter limit. When two line segments meet at a sharp\nangle and miter joins have been specified for 'lineJoin', it is\npossible for the miter to extend far beyond the thickness of\nthe line stroking the path. The miterLimit' imposes a limit on\nthe ratio of the miter length to the 'lineWidth'. The default\nvalue of this parameter is 4:</p>\n<pre class=\"literal-block\">\nvoid            strokeMiterLimit ( const unsigned int miterLimit_ )\n\nunsigned int    strokeMiterLimit ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"strokepattern\">\n<h2><a class=\"toc-backref\" href=\"#id202\">strokePattern</a></h2>\n<p>Pattern image to use while stroking object outlines:</p>\n<pre class=\"literal-block\">\nvoid            strokePattern ( const Image &amp;strokePattern_ )\n\nImage           strokePattern ( void  ) const\n</pre>\n</div>\n<div class=\"section\" id=\"strokewidth\">\n<h2><a class=\"toc-backref\" href=\"#id203\">strokeWidth</a></h2>\n<p>Stroke width for drawing vector objects (default one):</p>\n<pre class=\"literal-block\">\nvoid            strokeWidth ( const double strokeWidth_ )\n\ndouble          strokeWidth ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"subimage\">\n<h2><a class=\"toc-backref\" href=\"#id204\">subImage</a></h2>\n<p>Subimage of an image sequence:</p>\n<pre class=\"literal-block\">\nvoid            subImage ( const unsigned int subImage_ )\n\nunsigned int    subImage ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"subrange\">\n<h2><a class=\"toc-backref\" href=\"#id205\">subRange</a></h2>\n<p>Number of images relative to the base image:</p>\n<pre class=\"literal-block\">\nvoid            subRange ( const unsigned int subRange_ )\n\nunsigned int    subRange ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"textencoding\">\n<h2><a class=\"toc-backref\" href=\"#id206\">textEncoding</a></h2>\n<p>Annotation text encoding (e.g. &quot;UTF-16&quot;):</p>\n<pre class=\"literal-block\">\nvoid            textEncoding ( const std::string &amp;encoding_ )\n\nstd::string     textEncoding ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"tilename\">\n<h2><a class=\"toc-backref\" href=\"#id207\">tileName</a></h2>\n<p>Tile name:</p>\n<pre class=\"literal-block\">\nvoid            tileName ( const std::string &amp;tileName_ )\n\nstd::string     tileName ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"totalcolors\">\n<h2><a class=\"toc-backref\" href=\"#id208\">totalColors</a></h2>\n<p>Number of colors in the image:</p>\n<pre class=\"literal-block\">\nunsigned long   totalColors ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"transformorigin\">\n<h2><a class=\"toc-backref\" href=\"#id209\">transformOrigin</a></h2>\n<p>Origin of coordinate system to use when annotating with text or drawing:</p>\n<pre class=\"literal-block\">\nvoid            transformOrigin ( const double x_,const  double y_ )\n</pre>\n</div>\n<div class=\"section\" id=\"transformrotation\">\n<h2><a class=\"toc-backref\" href=\"#id210\">transformRotation</a></h2>\n<p>Rotation to use when annotating with text or drawing:</p>\n<pre class=\"literal-block\">\nvoid            transformRotation ( const double angle_ )\n</pre>\n</div>\n<div class=\"section\" id=\"transformreset\">\n<h2><a class=\"toc-backref\" href=\"#id211\">transformReset</a></h2>\n<p>Reset transformation parameters to default:</p>\n<pre class=\"literal-block\">\nvoid            transformReset ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"transformscale\">\n<h2><a class=\"toc-backref\" href=\"#id212\">transformScale</a></h2>\n<p>Scale to use when annotating with text or drawing:</p>\n<pre class=\"literal-block\">\nvoid            transformScale ( const double sx_, const double sy_ )\n</pre>\n</div>\n<div class=\"section\" id=\"transformskewx\">\n<h2><a class=\"toc-backref\" href=\"#id213\">transformSkewX</a></h2>\n<p>Skew to use in X axis when annotating with text or drawing:</p>\n<pre class=\"literal-block\">\nvoid            transformSkewX ( const double skewx_ )\n</pre>\n</div>\n<div class=\"section\" id=\"transformskewy\">\n<h2><a class=\"toc-backref\" href=\"#id214\">transformSkewY</a></h2>\n<p>Skew to use in Y axis when annotating with text or drawing:</p>\n<pre class=\"literal-block\">\nvoid            transformSkewY ( const double skewy_ )\n</pre>\n</div>\n<div class=\"section\" id=\"verbose\">\n<h2><a class=\"toc-backref\" href=\"#id215\">verbose</a></h2>\n<p>Print detailed information about the image:</p>\n<pre class=\"literal-block\">\nvoid            verbose ( const bool verboseFlag_ )\n\nbool            verbose ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"view\">\n<h2><a class=\"toc-backref\" href=\"#id216\">view</a></h2>\n<p>FlashPix viewing parameters:</p>\n<pre class=\"literal-block\">\nvoid            view ( const std::string &amp;view_ )\n\nstd::string     view ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"x11display\">\n<h2><a class=\"toc-backref\" href=\"#id217\">x11Display</a></h2>\n<p>X11 display to display to, obtain fonts from, or to capture\nimage from:</p>\n<pre class=\"literal-block\">\nvoid            x11Display ( const std::string &amp;display_ )\n\nstd::string     x11Display ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"xresolution\">\n<h2><a class=\"toc-backref\" href=\"#id218\">xResolution</a></h2>\n<p>x resolution of the image:</p>\n<pre class=\"literal-block\">\nvoid            xResolution ( const double x_resolution )\ndouble          xResolution ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"yresolution\">\n<h2><a class=\"toc-backref\" href=\"#id219\">yResolution</a></h2>\n<p>y resolution of the image:</p>\n<pre class=\"literal-block\">\nvoid            yResolution ( const double y_resolution )\ndouble          yResolution ( void ) const\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"low-level-image-pixel-access\">\n<h1><a class=\"toc-backref\" href=\"#id15\">Low-Level Image Pixel Access</a></h1>\n<p>Image pixels (of type <a class=\"reference external\" href=\"PixelPacket.html\">PixelPacket</a> ) may be accessed directly via\nthe Image Pixel Cache .  The image pixel cache is a rectangular window\ninto the actual image pixels (which may be in memory, memory-mapped\nfrom a disk file, or entirely on disk). Two interfaces exist to access\nthe Image Pixel Cache. The interface described here (part of the Image\nclass) supports only one view at a time. See the <a class=\"reference external\" href=\"Pixels.html\">Pixels</a> class for a\nmore abstract interface which supports simultaneous pixel views (up to\nthe number of rows). As an analogy, the interface described here\nrelates to the <a class=\"reference external\" href=\"Pixels.html\">Pixels</a> class as stdio's gets() relates to\nfgets(). The <a class=\"reference external\" href=\"Pixels.html\">Pixels</a> class provides the more general form of the\ninterface.</p>\n<p>Obtain existing image pixels via getPixels(). Create a new pixel\nregion using setPixels().</p>\n<p>In order to ensure that only the current generation of the image is\nmodified, the Image's modifyImage() method should be invoked to reduce\nthe reference count on the underlying image to one. If this is not\ndone, then it is possible for a previous generation of the image to be\nmodified due to the use of reference counting when copying or\nconstructing an Image.</p>\n<p>Depending on the capabilities of the operating system, and the\nrelationship of the window to the image, the pixel cache may be a copy\nof the pixels in the selected window, or it may be the actual image\npixels. In any case calling syncPixels() insures that the base image\nis updated with the contents of the modified pixel cache. The method\nreadPixels() supports copying foreign pixel data formats into the\npixel cache according to the QuantumTypes. The method writePixels()\nsupports copying the pixels in the cache to a foreign pixel\nrepresentation according to the format specified by QuantumTypes.</p>\n<p>The pixel region is effectively a small image in which the pixels may\nbe accessed, addressed, and updated, as shown in the following\nexample:</p>\n<p><img alt=\"pixel_cache\" src=\"Cache.png\" /></p>\n<pre class=\"literal-block\">\n// Construct image based on an existing file\nImage image(&quot;cow.png&quot;);\n\n// Ensure that there are no other references to this image.\nimage.modifyImage();\n\n// Set the image type to TrueColor DirectClass representation.\nimage.type(TrueColorType);\n\n// Request pixel region with size 60x40, and top origin at 20x30\nint columns = 60;\nPixelPacket *pixel_cache = image.getPixels(20,30,columns,40);\n\n// Set pixel at column 5, and row 10 in the pixel cache to red.\nint column = 5;\nint row = 10;\nPixelPacket *pixel = pixel_cache+row*columns+column;\n*pixel = Color(&quot;red&quot;);\n\n// Save changes to underlying image .\nimage.syncPixels();\n\n // Save updated image to file.\nimage.write(&quot;horse.png&quot;);\n</pre>\n<p>The image cache supports the following methods:</p>\n<div class=\"contents local topic\" id=\"id8\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#getconstpixels\" id=\"id220\">getConstPixels</a></li>\n<li><a class=\"reference internal\" href=\"#getindexes\" id=\"id221\">getIndexes</a></li>\n<li><a class=\"reference internal\" href=\"#getconstindexes\" id=\"id222\">getConstIndexes</a></li>\n<li><a class=\"reference internal\" href=\"#getpixels\" id=\"id223\">getPixels</a></li>\n<li><a class=\"reference internal\" href=\"#setpixels\" id=\"id224\">setPixels</a></li>\n<li><a class=\"reference internal\" href=\"#syncpixels\" id=\"id225\">syncPixels</a></li>\n<li><a class=\"reference internal\" href=\"#readpixels\" id=\"id226\">readPixels</a></li>\n<li><a class=\"reference internal\" href=\"#writepixels\" id=\"id227\">writePixels</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"getconstpixels\">\n<h2><a class=\"toc-backref\" href=\"#id220\">getConstPixels</a></h2>\n<p>Transfers read-only pixels from the image to the pixel cache as\ndefined by the specified region:</p>\n<pre class=\"literal-block\">\nconst PixelPacket* getConstPixels ( const int x_, const int y_,\n                                    const unsigned int columns_,\n                                    const unsigned int rows_ ) const\n</pre>\n</div>\n<div class=\"section\" id=\"getindexes\">\n<h2><a class=\"toc-backref\" href=\"#id221\">getIndexes</a></h2>\n<p>Obtain mutable image pixel indexes (valid for PseudoClass images):</p>\n<pre class=\"literal-block\">\nIndexPacket* getIndexes ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"getconstindexes\">\n<h2><a class=\"toc-backref\" href=\"#id222\">getConstIndexes</a></h2>\n<p>Obtain immutable image pixel indexes (valid for PseudoClass images):</p>\n<pre class=\"literal-block\">\nconst IndexPacket* getConstIndexes ( void ) const\n</pre>\n</div>\n<div class=\"section\" id=\"getpixels\">\n<h2><a class=\"toc-backref\" href=\"#id223\">getPixels</a></h2>\n<p>Transfers pixels from the image to the pixel cache as defined by the\nspecified region. Modified pixels may be subsequently transferred back\nto the image via syncPixels.  This method is valid for DirectClass\nimages:</p>\n<pre class=\"literal-block\">\nPixelPacket* getPixels ( const int x_, const int y_,\n                         const unsigned int columns_,\n                         const unsigned int rows_ )\n</pre>\n</div>\n<div class=\"section\" id=\"setpixels\">\n<h2><a class=\"toc-backref\" href=\"#id224\">setPixels</a></h2>\n<p>Allocates a pixel cache region to store image pixels as defined by the\nregion rectangle.  This area is subsequently transferred from the\npixel cache to the image via syncPixels:</p>\n<pre class=\"literal-block\">\nPixelPacket* setPixels ( const int x_, const int y_,\n                         const unsigned int columns_,\n                         const unsigned int rows_ )\n</pre>\n</div>\n<div class=\"section\" id=\"syncpixels\">\n<h2><a class=\"toc-backref\" href=\"#id225\">syncPixels</a></h2>\n<p>Transfers the image cache pixels to the image:</p>\n<pre class=\"literal-block\">\nvoid syncPixels ( void )\n</pre>\n</div>\n<div class=\"section\" id=\"readpixels\">\n<h2><a class=\"toc-backref\" href=\"#id226\">readPixels</a></h2>\n<p>Transfers one or more pixel components from a buffer or file into the\nimage pixel cache of an image.  Used to support image decoders:</p>\n<pre class=\"literal-block\">\nvoid readPixels ( const QuantumType quantum_,\n                  const unsigned char *source_ )\n</pre>\n</div>\n<div class=\"section\" id=\"writepixels\">\n<h2><a class=\"toc-backref\" href=\"#id227\">writePixels</a></h2>\n<p>Transfers one or more pixel components from the image pixel cache to a\nbuffer or file.  Used to support image encoders:</p>\n<pre class=\"literal-block\">\nvoid writePixels ( const QuantumType quantum_,\n                   unsigned char *destination_ )\n</pre>\n<p>Copyright © <a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">Bob Friesenhahn</a> 1999 - 2020</p>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/ImageDesign.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::Image Data Structures</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-image-data-structures\">\n<h1 class=\"title\">Magick::Image Data Structures</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The class Magick::Image is a simple handle which points to a\nreference-counted image representation. This allows multiple\nMagick::Image instances to share the same image and attributes. At the\npoint in time that the image data, or image attributes are modified\nand the current reference count is greater than one, the image data\nand attributes are copied to create a new image with a reference count\nof one and the reference count on the old image is decremented. If the\nreference count on the old image becomes zero, then the associated\nreference and data are deleted. This strategy represents a simple (but\neffective) form of garbage collection.</p>\n<img alt=\"Figure showing Image class design\" src=\"Image.png\" style=\"width: 910px; height: 490px;\" />\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/Montage.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::Montage Class</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-montage-class\">\n<h1 class=\"title\">Magick::Montage Class</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>A montage is a single image which is composed of thumbnail images\ncomposed in a uniform grid. The size of the montage image is\ndetermined by the size of the individual thumbnails and the number of\nrows and columns in the grid.</p>\n<p>The following illustration shows a montage consisting of three columns\nand two rows of thumbnails rendered on a gray background:</p>\n<img alt=\"Figure showing framed montage\" class=\"align-center\" src=\"montage-sample-framed.jpg\" style=\"width: 378.0px; height: 238.0px;\" />\n<p>Montages may be either &quot;plain&quot; (undecorated thumbnails) or &quot;framed&quot;\n(decorated thumbnails). In order to more easily understand the options\nsupplied to MontageImages(), montage options are supplied by two\ndifferent classes: Magick::Montage and Magick::MontageFramed.</p>\n<div class=\"section\" id=\"plain-montages\">\n<h1>Plain Montages</h1>\n<p>Magick::Montage is the base class to provide montage options and\nprovides methods to set all options required to render simple\n(unframed) montages. See Magick::MontageFramedif you would like to\ncreate a framed montage.</p>\n<p>Unframed thumbnails consist of four components: the thumbnail image,\nthe thumbnail border, an optional thumbnail shadow, and an optional\nthumbnail label area.</p>\n<img alt=\"Figure showing plain montage\" class=\"align-center\" src=\"thumbnail-anatomy-plain.jpg\" style=\"width: 309.0px; height: 327.0px;\" />\n<p>The following is the definition of the Magick::Montage class:</p>\n<pre class=\"literal-block\">\nclass Montage\n{\npublic:\n  Montage( void );\n  virtual ~Montage( void );\n\n  // Specifies the background color that thumbnails are imaged upon.\n  void              backgroundColor ( const Color &amp;backgroundColor_ );\n  Color             backgroundColor ( void ) const;\n\n  // Specifies the image composition algorithm for thumbnails. This\n  // controls the algorithm by which the thumbnail image is placed\n  // on the background. Use of OverCompositeOp is recommended for\n  // use with images that have transparency. This option may have\n  // negative side-effects for images without transparency.\n  void              compose ( CompositeOperator compose_ );\n  CompositeOperator compose ( void ) const;\n\n  // Specifies the image filename to be used for the generated\n  // montage images. To handle the case were multiple montage images\n  // are generated, a printf-style format may be embedded within the\n  // filename. For example, a filename specification of\n  // image%02d.miff names the montage images as image00.miff,\n  // image01.miff, etc.\n  void              fileName( const std::string &amp;fileName_ );\n  std::string       fileName( void ) const;\n\n  // Specifies the fill color to use for the label text.\n  void              fillColor ( const Color &amp;fill_ );\n  Color             fillColor ( void ) const;\n\n  // Specifies the thumbnail label font.\n  void              font ( const std::string &amp;font_ );\n  std::string       font ( void ) const;\n\n  // Specifies the size of the generated thumbnail.\n  void              geometry ( const Geometry &amp;geometry_ );\n  Geometry          geometry ( void ) const;\n\n  // Specifies the thumbnail positioning within the specified\n  // geometry area. If the thumbnail is smaller in any dimension\n  // than the geometry, then it is placed according to this\n  // specification\n  void              gravity ( GravityType gravity_ );\n  GravityType       gravity ( void ) const;\n\n  // Specifies the format used for the image label. Special format\n  // characters may be embedded in the format string to include\n  // information about the image.\n  void              label( const std::string &amp;label_ );\n  std::string       label( void ) const;\n\n  // Specifies the pen color to use for the label text (same as fill).\n  void              penColor ( const Color &amp;pen_ );\n  Color             penColor ( void ) const;\n\n  // Specifies the thumbnail label font size.\n  void              pointSize ( unsigned int pointSize_ );\n  unsigned int      pointSize ( void ) const;\n\n  // Enable/disable drop-shadow on thumbnails.\n  void              shadow ( bool shadow_ );\n  bool              shadow ( void ) const;\n\n  // Specifies the stroke color to use for the label text .\n  void              strokeColor ( const Color &amp;stroke_ );\n  Color             strokeColor ( void ) const;\n\n  // Specifies a texture image to use as montage background. The\n  // built-in textures &quot;granite:&quot; and &quot;plasma:&quot; are available. A\n  // texture is the same as a background image.\n  void              texture ( const std::string &amp;texture_ );\n  std::string       texture ( void ) const;\n\n  // Specifies the maximum number of montage columns and rows in the\n  // montage. The montage is built by filling out all cells in a row\n  // before advancing to the next row. Once the montage has reached\n  // the maximum number of columns and rows, a new montage image is\n  // started.\n  void              tile ( const Geometry &amp;tile_ );\n  Geometry          tile ( void ) const;\n\n  // Specifies the montage title\n  void              title ( const std::string &amp;title_ );\n  std::string       title ( void ) const;\n\n  // Specifies a montage color to set transparent. This option can\n  // be set the same as the background color in order for the\n  // thumbnails to appear without a background when rendered on an\n  // HTML page. For best effect, ensure that the transparent color\n  // selected does not occur in the rendered thumbnail colors.\n  void              transparentColor ( const Color &amp;transparentColor_ );\n  Color             transparentColor ( void ) const;\n\n};\n</pre>\n</div>\n<div class=\"section\" id=\"framed-montages\">\n<h1>Framed Montages</h1>\n<p>Magick::MontageFramed provides the means to specify montage options\nwhen it is desired to have decorative frames around the image\nthumbnails. MontageFramed inherits from Montage and therefore provides\nall the methods of Montage as well as those shown in the table\n&quot;MontageFramed Methods&quot;.</p>\n<p>Framed thumbnails consist of four components: the thumbnail image, the\nthumbnail frame, the thumbnail border, an optional thumbnail shadow,\nand an optional thumbnail label area.</p>\n<img alt=\"Figure showing anatomy of a framed montage\" class=\"align-center\" src=\"thumbnail-anatomy-framed.jpg\" style=\"width: 350.0px; height: 345.0px;\" />\n<p>The following is the definition of the Magick::MontageFramed class:</p>\n<pre class=\"literal-block\">\nclass MontageFramed : public Montage\n{\npublic:\n  MontageFramed ( void );\n  /* virtual */ ~MontageFramed ( void );\n\n  // Specifies the background color within the thumbnail frame.\n  void           borderColor ( const Color &amp;borderColor_ );\n  Color          borderColor ( void ) const;\n\n  // Specifies the border (in pixels) to place between a thumbnail\n  // and its surrounding frame. This option only takes effect if\n  // thumbnail frames are enabled (via frameGeometry) and the\n  // thumbnail geometry specification doesn't also specify the\n  // thumbnail border width.\n  void           borderWidth ( unsigned int borderWidth_ );\n  unsigned int   borderWidth ( void ) const;\n\n  // Specifies the geometry specification for frame to place around\n  // thumbnail. If this parameter is not specified, then the montage\n  // is unframed.\n  void           frameGeometry ( const Geometry &amp;frame_ );\n  Geometry       frameGeometry ( void ) const;\n\n  // Specifies the thumbnail frame color.\n  void           matteColor ( const Color &amp;matteColor_ );\n  Color          matteColor ( void ) const;\n\n};\n</pre>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/PixelPacket.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::PixelPacket Structure</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-pixelpacket-structure\">\n<h1 class=\"title\">Magick::PixelPacket Structure</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The PixelPacket structure is used to represent DirectClass pixels in\nGraphicsMagick. GraphicsMagick may be compiled to support 32, 64, or\neven 128 bit pixels. The size of PixelPacket is controlled by the\nvalue of the QuantumDepth define. The default build depth is 32 bit\npixels, which provides minumum (&quot;web standard&quot;) accuracy, least memory\nconsumption, and best performance.  If deeper images need to be\nsupported or more mathematical accuracy is desired, then\nGraphicsMagick may be compiled with QuantumDepth=16 or\nQuantumDepth=32.</p>\n<p>The following table shows the relationship between QuantumDepth, the\ntype of Quantum, and the overall PixelPacket size:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Effect Of QuantumDepth Values</caption>\n<colgroup>\n<col width=\"28%\" />\n<col width=\"35%\" />\n<col width=\"37%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">QuantumDepth</th>\n<th class=\"head\">Quantum Type</th>\n<th class=\"head\">PixelPacket Size</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>8</td>\n<td>unsigned char</td>\n<td>32 bits</td>\n</tr>\n<tr><td>16</td>\n<td>unsigned short</td>\n<td>64 bits</td>\n</tr>\n<tr><td>32</td>\n<td>unsigned int</td>\n<td>128 bits</td>\n</tr>\n</tbody>\n</table>\n<p>The members of the PixelPacket structure, and their interpretation,\nare shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>PixelPacket Structure Members</caption>\n<colgroup>\n<col width=\"10%\" />\n<col width=\"10%\" />\n<col width=\"19%\" />\n<col width=\"31%\" />\n<col width=\"28%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Member</th>\n<th class=\"head\">Type</th>\n<th class=\"head\" colspan=\"3\">Interpretation</th>\n</tr>\n<tr><th class=\"head\"></th>\n<th class=\"head\">&nbsp;</th>\n<th class=\"head\">RGBColorspace</th>\n<th class=\"head\">RGBColorspace + matte</th>\n<th class=\"head\">CMYKColorspace</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>red</td>\n<td>Quantum</td>\n<td>Red</td>\n<td>Red</td>\n<td>Cyan</td>\n</tr>\n<tr><td>green</td>\n<td>Quantum</td>\n<td>Green</td>\n<td>Green</td>\n<td>Magenta</td>\n</tr>\n<tr><td>blue</td>\n<td>Quantum</td>\n<td>Blue</td>\n<td>Blue</td>\n<td>Yellow</td>\n</tr>\n<tr><td>opacity</td>\n<td>Quantum</td>\n<td>Ignored</td>\n<td>Opacity</td>\n<td>Black</td>\n</tr>\n</tbody>\n</table>\n<p>Note that opacity is stored inverted from most other software\n(i.e. maximum value is completely transparent and minum value is\ntotally opaque).</p>\n<p>Note that for CMYKColorspace + matte (CMYKA), the opacity is stored in\nthe assocated IndexPacket.</p>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/Pixels.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::Pixels</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-pixels\">\n<h1 class=\"title\">Magick::Pixels</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The Pixels class provides efficient access to raw image pixels. Image\npixels (of type <a class=\"reference external\" href=\"PixelPacket.html\">PixelPacket</a>) may be accessed\ndirectly via the Image Pixel Cache. The image pixel cache is a\nrectangular window (a view) into the actual image pixels (which may be\nin memory, memory-mapped from a disk file, or entirely on\ndisk). Obtain existing image pixels via get(). Create a new pixel\nregion using set().</p>\n<p>Depending on the capabilities of the operating system, and the\nrelationship of the window to the image, the pixel cache may be a copy\nof the pixels in the selected window, or it may be the actual image\npixels. In any case calling sync() insures that the base image is\nupdated with the contents of the modified pixel cache. The method\ndecode()supports copying foreign pixel data formats into the pixel\ncache according to the QuantumTypes. The method encode() supports\ncopying the pixels in the cache to a foreign pixel representation\naccording to the format specified by QuantumTypes.</p>\n<p>Setting a view using the Pixels class does not cause the number of\nreferences to the underlying image to be reduced to one. Therefore, in\norder to ensure that only the current generation of the image is\nmodified, the Image's modifyImage() method should be invoked to reduce\nthe reference count on the underlying image to one. If this is not\ndone, then it is possible for a previous generation of the image to be\nmodified due to the use of reference counting when copying or\nconstructing an Image.</p>\n<p>The PixelPacket* returned by the set and get methods, and the\nIndexPacket* returned by the indexes method point to pixel data\nmanaged by the Pixels class. The Pixels class is responsible for\nreleasing resources associated with the pixel view. This means that\nthe pointer should never be passed to delete() or free().</p>\n<img alt=\"Figure showing pixel cache access\" class=\"align-center\" src=\"Cache.png\" style=\"width: 254.0px; height: 218.0px;\" />\n<!-- Probably want bottom alignment for above (but not accepted by -->\n<!-- currently installed rst2html.py parser) -->\n<p>The pixel view is a small image in which the pixels may be accessed,\naddressed, and updated, as shown in the following example, which\nproduces an image similar to the one on the right (minus lines and\ntext):</p>\n<pre class=\"literal-block\">\n// Create base image\nImage image(Geometry(254,218), &quot;white&quot;);\n\n// Set the image type to TrueColor DirectClass representation.\nimage.type(TrueColorType);\n\n// Ensure that there is only one reference to underlying image\n// If this is not done, then image pixels will not be modified.\nimage.modifyImage();\n\n// Allocate pixel view\nPixels view(image);\n\n// Set all pixels in region anchored at 38x36, with size 160x230 to green.\nunsigned int columns = 196; unsigned int rows = 162;\nColor green(&quot;green&quot;);\nPixelPacket *pixels = view.get(38,36,columns,rows);\nfor ( int row = 0; row &lt; rows ; ++row )\nfor ( int column = 0; column &lt; columns ; ++column )\n*pixels++=green;\n\n// Save changes to image.\nview.sync();\n\n// Set all pixels in region anchored at 86x72, with size 108x67 to yellow.\ncolumns = 108; rows = 67;\nColor yellow(&quot;yellow&quot;);\npixels = view.get(86,72,columns,rows);\nfor ( int row = 0; row &lt; rows ; ++row )\nfor ( int column = 0; column &lt; columns ; ++column )\n*pixels++=yellow;\nview.sync();\n\n// Set pixel at position 108,94 to red\n*(view.get(108,94,1,1)) = Color(&quot;red&quot;);\n\n// Save changes to image.\nview.sync();\n</pre>\n<p>The following is the definition of the Magick::Pixels class:</p>\n<pre class=\"literal-block\">\nclass Pixels\n{\npublic:\n\n  // Construct pixel view using specified image.\n  Pixels( Magick::Image &amp;image_ );\n\n  // Destroy pixel view\n  ~Pixels( void );\n\n  // Transfer pixels from the image to the pixel view as defined by\n  // the specified region. Modified pixels may be subsequently\n  // transferred back to the image via sync.\n  PixelPacket* get ( const int x_, const int y_,\n                     const unsigned int columns_,const  unsigned int rows_ );\n\n  // Transfer read-only pixels from the image to the pixel view as\n  // defined by the specified region.\n  const PixelPacket* getConst ( const int x_, const int y_,\n                                const unsigned int columns_,\n                                const unsigned int rows_ );\n\n  // Transfers the image view pixels to the image.\n  void sync ( void );\n\n  // Allocate a pixel view region to store image pixels as defined\n  // by the region rectangle.  This area is subsequently transferred\n  // from the pixel view to the image via sync.\n  PixelPacket* set ( const int x_, const int y_,\n                     const unsigned int columns_, const unsigned int rows_ );\n\n  // Return pixel colormap index array\n  IndexPacket* indexes ( void );\n\n  // Left ordinate of view\n  int x ( void ) const;\n\n  // Top ordinate of view\n  int y ( void ) const;\n\n  // Width of view\n  unsigned int columns ( void ) const;\n\n  // Height of view\n  unsigned int rows ( void ) const;\n\n};\n</pre>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/STL.html",
    "content": "<!DOCTYPE html PUBLIC \"-//w3c//dtd html 4.0 transitional//en\">\n<html>\n<head>\n  <meta http-equiv=\"Content-Type\"\n content=\"text/html; charset=iso-8859-1\">\n  <meta name=\"GENERATOR\"\n content=\"Mozilla/4.78 [en] (X11; U; SunOS 5.6 sun4u) [Netscape]\">\n  <meta name=\"Author\" content=\"Bob Friesenhahn\">\n  <meta name=\"Description\"\n content=\"Documentation on Magick++'s STL support templates.\">\n  <meta name=\"Keywords\" content=\"STL,Magick++,GraphicsMagick\">\n  <title>Magick++ STL Support</title>\n</head>\n<body text=\"#000000\" bgcolor=\"#ffffff\" link=\"#0000ff\" vlink=\"#ff0000\"\n alink=\"#000088\">\n<center>\n<h1> Magick++ STL Support</h1>\n</center>\nMagick++ provides a set of <a href=\"http://www.sgi.com/tech/stl/\">Standard\nTemplate Libary</a> (<a href=\"http://www.sgi.com/tech/stl/\">STL</a> )\nalgorithms for operating across ranges of image frames in a container.\nIt also provides a set of STL unary function objects to apply an\noperation on image frames in a container via an algorithm which uses\nunary function objects. A good example of a standard algorithm which is\nuseful for processing containers of image frames is the STL <i><a\n href=\"http://www.sgi.com/tech/stl/for_each.html\"> for_each</a> </i>\nalgorithm which invokes a unary function object on a range of container\nelements.\n<p>Magick++ uses a limited set of template argument types. The current\ntemplate argument types are: </p>\n<blockquote><a href=\"http://www.sgi.com/tech/stl/Container.html\">Container</a>\n  <blockquote>A container having the properties of a <a\n href=\"http://www.sgi.com/tech/stl/BackInsertionSequence.html\"> Back\nInsertion Sequence</a> . Sequences support forward iterators and Back\nInsertion Sequences support the additional abilty to append an element\nvia push_back(). Common compatable container types are the STL &lt;<a\n href=\"http://www.sgi.com/tech/stl/Vector.html\"> vector</a> &gt; and &lt;<a\n href=\"http://www.sgi.com/tech/stl/List.html\">list</a> &gt; template\ncontainers. This template argument is usually used to represent an\noutput container in which one or more image frames may be appended.\nContainers like STL &lt;<a href=\"http://www.sgi.com/tech/stl/Vector.html\">vector</a>\n&gt; which have a given default <i>capacity</i> may need to have their <i>\ncapacity</i> adjusted via r<i>eserve() </i>to a larger <i>capacity</i>\nin order to support the expected final <i>size</i> . Since Magick++\nimages are very small, it is likely that the default capacity of STL &lt;<a\n href=\"http://www.sgi.com/tech/stl/Vector.html\"> vector</a> &gt; is\nsufficient for most situations.</blockquote>\n  <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\n  <blockquote>An input iterator used to express a position in a\ncontainer. These template arguments are typically used to represent a\nrange of elements  with f<i>irst_</i> representing the first element to\nbe processed and <i> last_</i> representing the element to stop at. When\nprocessing the entire contents of a container, it is handy to know that\nSTL containers usually provide the begin() and end() methods to return\ninput interators which correspond  with the first and last elements,\nrespectively.</blockquote>\n</blockquote>\nThe following is an example of how frames from a GIF animation <font\n color=\"#000000\"> \"test_image_anim.gif\" may be appended horizontally\nwith the resulting image written to the file \"appended_image.miff\":</font>\n<p><tt><font color=\"#000066\">#include &lt;list&gt;</font></tt> <br>\n<tt><font color=\"#000066\">#include &lt;Magick++.h&gt;</font></tt> <br>\n<tt><font color=\"#000066\">using namespace std;</font></tt> <br>\n<tt><font color=\"#000066\">using namespace Magick;</font></tt> </p>\n<p><tt><font color=\"#000066\">int main(int /*argc*/,char **/*argv*/)</font></tt> <br>\n<tt><font color=\"#000066\">{</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp; list&lt;Image&gt; imageList;</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp; readImages( &amp;imageList,\n\"test_image_anim.gif\" );</font></tt> </p>\n<p><tt><font color=\"#000066\">&nbsp;&nbsp; Image appended;</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp; appendImages( &amp;appended,\nimageList.begin(), imageList.end() );</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp; appended.write(\n\"appended_image.miff\" );</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp; return 0;</font></tt> <br>\n<tt><font color=\"#000066\">}</font></tt> </p>\n<p>The available Magick++ specific STL algorithms for operating on\nsequences of image frames are shown in the following table: <br>\n&nbsp;\n<table border=\"1\" width=\"100%\">\n  <caption><b>Magick++ STL Algorithms For Image Sequences</b></caption> <tbody>\n    <tr>\n      <td>\n      <center><b>Algorithm</b></center>\n      </td>\n      <td>\n      <center><b>Signature</b></center>\n      </td>\n      <td>\n      <center><b>Description</b></center>\n      </td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"animateImages\"></a> <font size=\"-1\">animateImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_</font></td>\n      <td><font size=\"-1\">Animate a sequence of image frames. Image\nframes are  displayed in succession, creating an animated effect. The\nanimation options  are taken from the first image frame. This feature is\nonly supported under  X11 at the moment.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"appendImages\"></a> <font size=\"-1\">appendImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Image.html\">Image</a>\n*appendedImage_, <a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_, bool stack_ = false</font></td>\n      <td><font size=\"-1\">Append a sequence of image frames, writing\nthe result  to <i>appendedImage_.</i> All the input image frames must\nhave the same width or height. Image frames of the same width are\nstacked top-to-bottom. Image frames of the same height are stacked\nleft-to-right. If the <i>stack_</i> parameter is false, rectangular\nimage frames are stacked left-to-right otherwise top-to-bottom.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"averageImages\"></a> <font size=\"-1\">averageImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Image.html\">Image</a>\n*averagedImage_, <a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_</font></td>\n      <td><font size=\"-1\">Average a sequence of image frames, writing\nthe result  to <i>averagedImage_</i>. All the input image frames must\nbe the same size  in pixels.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"coalesceImages\"></a> <font size=\"-1\">coalesceImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/Container.html\"> Container</a>\n*coalescedImages_, <a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_</font><br>\n      </td>\n      <td><font size=\"-1\">Create a coalesced image sequence obtained by\n\"playing\" the image sequence (observing page offsets and disposal\nmethods) to create a new image sequence in which all frames are full\nsize and completely rendered. Note that if the original image sequence\nrelied on page offsets and disposal methods that the resulting sequence\nwill be larger (perhaps much larger) then the original. This is useful\nfor GIF animation sequences that have page offsets and disposal methods.\nThe resuting image sequence is returned via <i>coalescedImages_.</i></font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"deconstructImages\"></a> <font size=\"-1\">deconstructImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/Container.html\"> Container</a>\n*deconstructedImages_, <a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_</font></td>\n      <td><font size=\"-1\">Break down an image sequence into constituent\nparts.&nbsp; This is useful for creating GIF or MNG animation sequences.\nThe input sequence  is specified by <i>first_</i> and <i>last_</i>, and\nthe deconstruted images  are returned via <i>deconstructedImages_</i>.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"displayImages\"></a> <font size=\"-1\">displayImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_</font></td>\n      <td><font size=\"-1\">Display a sequence of image frames. Through\nuse of a pop-up menu, image frames may be selected in succession. This\nfeature is  fully supported under X11 but may have only limited support\nin other environments.</font> <br>\n      <font size=\"-1\"><b><font color=\"#ff0000\">Caution: </font></b> if\nan image format is is not compatable with the display visual (e.g. JPEG\non a colormapped display) then the original image will be altered. Use a\ncopy of the original if this is a problem.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"flattenImages\"></a> <font size=\"-1\">flattenImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Image.html\">Image</a>\n*flattendImage_, <a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_</font></td>\n      <td><font size=\"-1\">Merge a sequence of image frames which\nrepresent image  layers into a single composited representation. The <i>flattendImage_</i>\nparameter points to an existing Image to update with the flattened\nimage. This function is useful for combining Photoshop layers into a\nsingle image.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"mapImages\"></a> <font size=\"-1\">mapImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_, const <a href=\"Image.html\">Image</a> &amp; mapImage_, bool\ndither_,&nbsp; bool measureError_ = false</font></td>\n      <td><font size=\"-1\">Replace the colors of a sequence of images\nwith the closest color from a reference image. Set <i>dither_</i> to <i>true</i>\nto enable dithering.&nbsp; Set <i>measureError_</i> to <i>true</i> in\norder to evaluate quantization error.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"montageImages\"></a> <font size=\"-1\">montageImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/Container.html\"> Container</a>\n*montageImages_, <a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_, const <a href=\"Montage.html\">Montage</a> &amp;montageOpts_</font></td>\n      <td><font size=\"-1\">Create a composite image by combining several\nseparate image frames. Multiple frames may be generated in the output\ncontainer <i> montageImages_ </i>depending on the tile setting and the\nnumber of image frames montaged. Montage options are provided via the\nparameter <i>montageOpts_</i> . Options set in the first image frame (<a\n href=\"Image.html#backgroundcolor\"> backgroundColor,</a> <a\n href=\"Image.html#bordercolor\">borderColor</a> , <a\n href=\"Image.html#mattecolor\">matteColor</a> , <a\n href=\"Image.html#fillcolor\">fillColor,</a> <a\n href=\"Image.html#strokecolor\">strokeColor,</a> <a\n href=\"Image.html#font\">font,</a>\nand <a href=\"Image.html#fontpointsize\">fontPointsize</a> ) are also used\nas options by <i>montageImages().</i></font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"morphImages\"></a> <font size=\"-1\">morphImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/Container.html\"> Container</a>\n*morphedImages_, <a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_, unsigned int frames_</font></td>\n      <td><font size=\"-1\">Morph a seqence of image frames. This\nalgorithm&nbsp; expands the number of image frames (output to the\ncontainer <i>morphedImages_)</i> by adding the number of intervening\nframes specified by <i>frames_</i> such that the original frames morph\n(blend) into each other when played as an animation.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"mosaicImages\"></a> <font size=\"-1\">mosaicImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Image.html\">Image</a> *mosaicImage_, <a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_</font></td>\n      <td><font size=\"-1\">Inlay a number of images to form a single\ncoherent picture. The <i>mosicImage_</i> argument is updated with a\nmosaic constructed from the image sequence represented by <i>first_</i>\nthrough <i>last_</i> .</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">\n      <center><a name=\"readImages\"></a> <font size=\"-1\">readImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/Container.html\"> Container</a>\n*sequence_, const std::string &amp;imageSpec_</font></td>\n      <td><font size=\"-1\">Read a sequence of image frames into existing\ncontainer (appending to container <i>sequence_</i>) with image names\nspecified in the string <i>imageSpec_</i>.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/Container.html\"> Container</a>\n*sequence_, const <a href=\"Blob.html\">Blob</a> &amp;blob_</font></td>\n      <td><font size=\"-1\">Read a sequence of image frames into existing\ncontainer (appending to container sequence_) from <a href=\"Blob.html\">Blob</a>\nblob_.</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">\n      <center><a name=\"writeImages\"></a> <font size=\"-1\">writeImages</font></center>\n      </td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_, const std::string &amp;imageSpec_, bool adjoin_ = true</font></td>\n      <td><font size=\"-1\">Write images in container to file specified\nby string <i>imageSpec_</i>. Set <i>adjoin_ </i>to false to write a\nset of image frames via a wildcard <i>imageSpec_ </i>(e.g.\nimage%02d.miff).</font> <br>\nThe wildcard must be one of <tt>%0Nd, %0No, or %0Nx</tt>. <br>\n      <font size=\"-1\"><b><font color=\"#ff0000\">Caution: </font></b> if\nan image format is selected which is capable of supporting fewer colors\nthan the original image or quantization has been requested, the original\nimage will be quantized to fewer colors. Use a copy of the original if\nthis is a problem.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_, <a href=\"Blob.html\">Blob</a> *blob_, bool adjoin_ = true</font></td>\n      <td><font size=\"-1\">Write images in container to in-memory BLOB\nspecified by <a href=\"Blob.html\">Blob</a> blob_. Set adjoin_ to false to\nwrite a set of image frames via a wildcard imageSpec_ (e.g.\nimage%02d.miff).</font> <br>\n      <font size=\"-1\"><b><font color=\"#ff0000\">Caution:</font></b> if an\nimage format is selected which is capable of supporting fewer colors\nthan the original image or quantization has been requested, the original\nimage will be quantized to fewer colors. Use a copy of the original if\nthis is a problem.</font></td>\n    </tr>\n    <tr>\n      <td><a name=\"quantizeImages\"></a> <font size=\"-1\">quantizeImages</font></td>\n      <td><font size=\"-1\"><a\n href=\"http://www.sgi.com/tech/stl/InputIterator.html\"> InputIterator</a>\nfirst_, <a href=\"http://www.sgi.com/tech/stl/InputIterator.html\">InputIterator</a>\nlast_, bool measureError_ = false</font></td>\n      <td><font size=\"-1\">Quantize colors in images using current\nquantization settings. Set <i>measureError_</i> to <i>true</i> in order\nto measure quantization  error.</font></td>\n    </tr>\n  </tbody>\n</table>\n<br>\n&nbsp; </p>\n<center>\n<h3> Magick++ Unary Function Objects</h3>\n</center>\nMagick++ unary function objects inherit from the STL unary_function\ntemplate class . The STL unary_function template class is of the form\n<blockquote><tt><font color=\"#000099\">unary_function&lt;Arg, Result&gt;</font></tt></blockquote>\nand expects that derived classes implement a method of the form:\n<blockquote><tt><font color=\"#000099\">Result operator()( Arg argument_\n);</font></tt></blockquote>\nwhich is invoked by algorithms using the function object. In the case\nof unary function objects defined by Magick++, the invoked function\nlooks like:\n<blockquote><tt><font color=\"#000099\">void operator()( Image\n&amp;image_);</font></tt></blockquote>\nwith a typical implementation looking similar to:\n<blockquote><tt><font color=\"#000099\">void operator()( Image\n&amp;image_ )</font></tt> <br>\n  <tt><font color=\"#000099\">&nbsp; {</font></tt> <br>\n  <tt><font color=\"#000099\">&nbsp;&nbsp;&nbsp; image_.contrast(\n_sharpen );</font></tt> <br>\n  <tt><font color=\"#000099\">&nbsp; }</font></tt></blockquote>\nwhere <i>contrast</i> is an Image method and <i>_sharpen </i>is an\nargument stored within the function object by its contructor. Since\nconstructors may be polymorphic, a given function object may have\nseveral constructors and selects the appropriate Image method based on\nthe arguments supplied.\n<p>In essence, unary function objects (as provided by Magick++) simply\nprovide the means to construct an object which caches arguments for\nlater use by an algorithm designed for use with unary function objects.\nThere is a unary function object corresponding each algorithm provided\nby the <a href=\"Image.html\"> Image</a> class and there is a contructor\navailable compatable with each synonymous  method in the Image class. </p>\n<p>The unary function objects that Magick++ provides to support\nmanipulating images are shown in the following table: <br>\n&nbsp;\n<table border=\"1\">\n  <caption><b>Magick++ Unary Function Objects For Image Manipulation</b></caption> <tbody>\n    <tr align=\"center\">\n      <td><b>Function Object</b></td>\n      <td><b>Constructor Signatures(s)</b></td>\n      <td><b>Description</b></td>\n    </tr>\n    <tr>\n      <td valign=\"middle\">\n      <div align=\"center\"><a name=\"adaptiveThresholdImage\"></a> <font\n size=\"-1\">adaptiveThresholdImage</font><br>\n      </div>\n      </td>\n      <td valign=\"middle\"><font size=\"-1\">unsigned int width, unsigned\nint height, unsigned offset = 0</font><br>\n      </td>\n      <td valign=\"top\"><font size=\"-1\">Apply adaptive thresholding to\nthe image. Adaptive thresholding is useful if the ideal threshold level\nis not known in advance, or if the illumination gradient is not constant\nacross the image. Adaptive thresholding works by evaulating the mean\n(average) of a pixel region (size specified by <i>width</i> and <i>height</i>)\nand using the mean as the thresholding value. In order to remove\nresidual noise from the background, the threshold may be adjusted by\nsubtracting a constant <i>offset</i> (default zero) from the mean to\ncompute the threshold.</font><br>\n      </td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"addNoiseImage\"></a> <font size=\"-1\">addNoiseImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#NoiseType\">NoiseType</a>\nnoiseType_</font></td>\n      <td><font size=\"-1\">Add noise to image with specified noise type.</font></td>\n    </tr>\n    <tr>\n      <td style=\"vertical-align: middle;\"><small><a\n name=\"affineTransformImage\"></a>affineTransformImage<br>\n      </small></td>\n      <td style=\"vertical-align: middle;\"><small>const DrawableAffine\n&amp;affine_<br>\n      </small></td>\n      <td style=\"vertical-align: middle;\"><small>Transform image by\nspecified affine (or free transform) matrix.<br>\n      </small></td>\n    </tr>\n    <tr>\n      <td rowspan=\"4\">\n      <center><a name=\"annotateImage\"></a> <font size=\"-1\">annotateImage</font></center>\n      </td>\n      <td><font size=\"-1\">const std::string &amp;text_, const <a\n href=\"Geometry.html\"> Geometry</a> &amp;location_</font></td>\n      <td><font size=\"-1\">Annotate with text using specified text,\nbounding area,  placement gravity, and rotation. If <i>boundingArea_</i>\nis invalid, then  bounding area is entire image.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">std::string text_, const <a\n href=\"Geometry.html\">Geometry</a> &amp;boundingArea_, <a\n href=\"Enumerations.html#GravityType\">GravityType</a> gravity_</font></td>\n      <td><font size=\"-1\">Annotate using specified text, bounding area,\nand placement  gravity. If <i>boundingArea_</i> is invalid, then\nbounding area is entire  image.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const std::string &amp;text_, const <a\n href=\"Geometry.html\"> Geometry</a> &amp;boundingArea_, <a\n href=\"Enumerations.html#GravityType\">GravityType</a> gravity_, double\ndegrees_,&nbsp;</font></td>\n      <td><font size=\"-1\">Annotate with text using specified text,\nbounding area,  placement gravity, and rotation. If <i>boundingArea_</i>\nis invalid, then  bounding area is entire image.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const std::string &amp;text_, <a\n href=\"Enumerations.html#GravityType\"> GravityType</a> gravity_</font></td>\n      <td><font size=\"-1\">Annotate with text (bounding area is entire\nimage) and placement gravity.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"blurImage\"></a> <font size=\"-1\">blurImage</font></center>\n      </td>\n      <td><font size=\"-1\">const double radius_ = 1, const double sigma_\n= 0.5</font></td>\n      <td><font size=\"-1\">Blur image. The radius_ parameter specifies\nthe radius  of the Gaussian, in pixels, not counting the center\npixel.&nbsp; The sigma_  parameter specifies the standard deviation of\nthe Laplacian, in pixels.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"borderImage\"></a> <font size=\"-1\">borderImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_ = \"6x6+0+0\"</font></td>\n      <td><font size=\"-1\">Border image (add border to image).&nbsp; The\ncolor of the border is specified by the <i>borderColor</i> attribute.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"charcoalImage\"></a> <font size=\"-1\">charcoalImage</font></center>\n      </td>\n      <td><font size=\"-1\">const double radius_ = 1, const double sigma_\n= 0.5</font></td>\n      <td><font size=\"-1\">Charcoal effect image (looks like charcoal\nsketch). The radius_ parameter specifies the radius of the Gaussian, in\npixels, not  counting the center pixel.&nbsp; The sigma_ parameter\nspecifies the standard  deviation of the Laplacian, in pixels.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"chopImage\"></a> <font size=\"-1\">chopImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_</font></td>\n      <td><font size=\"-1\">Chop image (remove vertical or horizontal\nsubregion of image)</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">\n      <center><a name=\"colorizeImage\"></a> <font size=\"-1\">colorizeImage</font></center>\n      </td>\n      <td><font size=\"-1\">const unsigned int opacityRed_, const\nunsigned int opacityGreen_, const unsigned int opacityBlue_, const Color\n&amp;penColor_</font></td>\n      <td><font size=\"-1\">Colorize image with pen color, using\nspecified percent  opacity for red, green, and blue quantums.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const unsigned int opacity_, const <a\n href=\"Color.html\"> Color</a> &amp;penColor_</font></td>\n      <td><font size=\"-1\">Colorize image with pen color, using\nspecified percent  opacity.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"commentImage\"></a> <font size=\"-1\">commentImage</font></center>\n      </td>\n      <td><font size=\"-1\">const std::string &amp;comment_</font></td>\n      <td><font size=\"-1\">Comment image (add comment string to\nimage).&nbsp; By default, each image is commented with its file name.\nUse&nbsp; this&nbsp;  method to&nbsp; assign a specific comment to the\nimage.&nbsp; Optionally you can include the image filename, type, width,\nheight, or other&nbsp; image&nbsp; attributes by embedding <a\n href=\"FormatCharacters.html\">special format characters.</a> </font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">\n      <center><a name=\"compositeImage\"></a> <font size=\"-1\">compositeImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Image.html\">Image</a>\n&amp;compositeImage_, int xOffset_, int yOffset_, <a\n href=\"Enumerations.html#CompositeOperator\"> CompositeOperator</a>\ncompose_ = <i>InCompositeOp</i></font></td>\n      <td rowspan=\"2\"><font size=\"-1\">Compose an image onto another at\nspecified offset and using specified algorithm</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const <a href=\"Image.html\">Image</a>\n&amp;compositeImage_, const Geometry &amp;offset_, <a\n href=\"Enumerations.html#CompositeOperator\"> CompositeOperator</a>\ncompose_ = <i>InCompositeOp</i></font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"condenseImage\"></a> <font size=\"-1\">condenseImage</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td><font size=\"-1\">Condense image (Re-run-length encode image in\nmemory).</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"contrastImage\"></a> <font size=\"-1\">contrastImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int sharpen_</font></td>\n      <td><font size=\"-1\">Contrast image (enhance intensity differences\nin image)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"cropImage\"></a> <font size=\"-1\">cropImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_</font></td>\n      <td><font size=\"-1\">Crop image (subregion of original image)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"cycleColormapImage\"></a> <font size=\"-1\">cycleColormap-</font> <br>\n      <font size=\"-1\">Image</font></center>\n      </td>\n      <td><font size=\"-1\">int amount_</font></td>\n      <td><font size=\"-1\">Cycle image colormap</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"despeckleImage\"></a> <font size=\"-1\">despeckleImage</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td><font size=\"-1\">Despeckle image (reduce speckle noise)</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">\n      <center><a name=\"drawImage\"></a> <font size=\"-1\">drawImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Drawable.html\">Drawable</a>\n&amp;drawable_</font></td>\n      <td><font size=\"-1\">Draw shape or text on image.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const std::list&lt;<a href=\"Drawable.html\">Drawable</a>\n&gt; &amp;drawable_</font></td>\n      <td><font size=\"-1\">Draw shapes or text on image using a set of\nDrawable objects contained in an STL list. Use of this method improves\ndrawing performance  and allows batching draw objects together in a list\nfor repeated use.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"edgeImage\"></a> <font size=\"-1\">edgeImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int radius_ = 0.0</font></td>\n      <td><font size=\"-1\">Edge image (hilight edges in image).&nbsp;\nThe radius  is the radius of the pixel neighborhood.. Specify a radius\nof zero for automatic radius selection.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"embossImage\"></a> <font size=\"-1\">embossImage</font></center>\n      </td>\n      <td><font size=\"-1\">const double radius_ = 1, const double sigma_\n= 0.5</font></td>\n      <td><font size=\"-1\">Emboss image (hilight edges with 3D effect).\nThe radius_  parameter specifies the radius of the Gaussian, in pixels,\nnot counting the center pixel.&nbsp; The sigma_ parameter specifies the\nstandard deviation  of the Laplacian, in pixels.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"enhanceImage\"></a> <font size=\"-1\">enhanceImage</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td><font size=\"-1\">Enhance image (minimize noise)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"equalizeImage\"></a> <font size=\"-1\">equalizeImage</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td><font size=\"-1\">Equalize image (histogram equalization)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"flipImage\"></a> <font size=\"-1\">flipImage</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td><font size=\"-1\">Flip image (reflect each scanline in the\nvertical direction)</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"4\">\n      <center><a name=\"floodFillColorImage\"></a> <font size=\"-1\">floodFill-</font> <br>\n      <font size=\"-1\">ColorImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int x_, unsigned int y_, const <a\n href=\"Color.html\"> Color</a> &amp;fillColor_</font></td>\n      <td rowspan=\"2\"><font size=\"-1\">Flood-fill color across pixels\nthat match  the color of the target pixel and are neighbors of the\ntarget pixel. Uses  current fuzz setting when determining color match.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;point_, const <a href=\"Color.html\">Color</a> &amp;fillColor_</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">unsigned int x_, unsigned int y_, const <a\n href=\"Color.html\"> Color</a> &amp;fillColor_, const <a href=\"Color.html\">Color</a>\n&amp;borderColor_</font></td>\n      <td rowspan=\"2\"><font size=\"-1\">Flood-fill color across pixels\nstarting at target-pixel and stopping at pixels matching specified\nborder color. Uses  current fuzz setting when determining color match.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;point_, const <a href=\"Color.html\">Color</a> &amp;fillColor_, const <a\n href=\"Color.html\">Color</a> &amp;borderColor_</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"4\">\n      <center><a name=\"floodFillTextureImage\"></a> <font size=\"-1\">floodFill-</font> <br>\n      <font size=\"-1\">TextureImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int x_, unsigned int y_,&nbsp; const <a\n href=\"Image.html\"> Image</a> &amp;texture_</font></td>\n      <td rowspan=\"2\"><font size=\"-1\">Flood-fill texture across pixels\nthat match  the color of the target pixel and are neighbors of the\ntarget pixel. Uses  current fuzz setting when determining color match.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;point_, const Image &amp;texture_</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">unsigned int x_, unsigned int y_, const Image\n&amp;texture_, const <a href=\"Color.html\">Color</a> &amp;borderColor_</font></td>\n      <td rowspan=\"2\"><font size=\"-1\">Flood-fill texture across pixels\nstarting at target-pixel and stopping at pixels matching specified\nborder color. Uses current fuzz setting when determining color match.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;point_, const Image &amp;texture_, const <a href=\"Color.html\">Color</a>\n&amp;borderColor_</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"flopImage\"></a> <font size=\"-1\">flopImage</font></center>\n      </td>\n      <td><font size=\"-1\">void&nbsp;</font></td>\n      <td><font size=\"-1\">Flop image (reflect each scanline in the\nhorizontal direction)</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">\n      <center><a name=\"frameImage\"></a> <font size=\"-1\">frameImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_ = \"25x25+6+6\"</font></td>\n      <td rowspan=\"2\"><font size=\"-1\">Add decorative frame around image</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">unsigned int width_, unsigned int height_,\nint x_, int  y_, int innerBevel_ = 0, int outerBevel_ = 0</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">\n      <center><a name=\"gammaImage\"></a> <font size=\"-1\">gammaImage</font></center>\n      </td>\n      <td><font size=\"-1\">double gamma_</font></td>\n      <td><font size=\"-1\">Gamma correct image (uniform red, green, and\nblue correction).</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">double gammaRed_, double gammaGreen_, double\ngammaBlue_</font></td>\n      <td><font size=\"-1\">Gamma correct red, green, and blue channels\nof image.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"gaussianBlur\"></a> <font size=\"-1\">gaussianBlurImage</font></center>\n      </td>\n      <td><font size=\"-1\">double width_, double sigma_</font></td>\n      <td><font size=\"-1\">Gaussian blur image. The number of neighbor\npixels to be included in the convolution mask is specified by\n'width_'.&nbsp; For  example, a width of one gives a (standard) 3x3\nconvolution mask. The standard  deviation of the gaussian bell curve is\nspecified by 'sigma_'.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"implodeImage\"></a> <font size=\"-1\">implodeImage</font></center>\n      </td>\n      <td><font size=\"-1\">double factor_</font></td>\n      <td><font size=\"-1\">Implode image (special effect)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"labelImage\"></a> <font size=\"-1\">labelImage</font></center>\n      </td>\n      <td><font size=\"-1\">const string &amp;label_</font></td>\n      <td><font size=\"-1\">Assign a label to an image. Use this option\nto&nbsp; assign&nbsp; a&nbsp; specific label to the image. Optionally\nyou can include  the image filename, type, width, height, or scene\nnumber in the label by embedding&nbsp; <a href=\"FormatCharacters.html\">special\nformat characters.</a> If the first character of string is @, the image\nlabel is read from a file titled by the remaining characters in the\nstring. When converting to Postscript,  use this&nbsp; option to specify\na header string to print above the image.</font></td>\n    </tr>\n    <tr>\n      <td style=\"text-align: center; vertical-align: middle;\"><small><a\n name=\"levelImage\"></a>levelImage<br>\n      </small></td>\n      <td style=\"vertical-align: top;\"><small>const double black_point,\nconst double white_point, const double mid_point=1.0<br>\n      </small></td>\n      <td style=\"vertical-align: top;\"><small>Level image. Adjust the\nlevels of the image by scaling the colors falling between specified\nwhite and black points to the full available quantum range. The\nparameters provided represent the black, mid (gamma), and white\npoints.&nbsp; The black point specifies the darkest color in the image.\nColors darker than the black point are set to zero. Mid point (gamma)\nspecifies a gamma correction to apply to the image. White point\nspecifies the lightest color in the image.&nbsp; Colors brighter than\nthe white point are set to the maximum quantum value. The black and\nwhite point have the valid range 0 to MaxRGB while mid (gamma) has a\nuseful range of 0 to ten.</small></td>\n    </tr>\n    <tr>\n      <td style=\"text-align: center; vertical-align: middle;\"><small><a\n name=\"levelChannelImage\"></a>levelChannelImage<br>\n      </small></td>\n      <td style=\"vertical-align: top;\"><small>const Magick::ChannelType\nchannel, const double black_point, const double white_point, const\ndouble mid_point=1.0<br>\n      </small></td>\n      <td style=\"vertical-align: top;\"><small>Level image channel.\nAdjust the levels of the image channel by scaling the values falling\nbetween specified white and black points to the full available quantum\nrange. The parameters provided represent the black, mid (gamma), and\nwhite points. The black point specifies the darkest color in the image.\nColors darker than the black point are set to zero. Mid point (gamma)\nspecifies a gamma correction to apply to the image. White point\nspecifies the lightest color in the image. Colors brighter than the\nwhite point are set to the maximum quantum value. The black and white\npoint have the valid range 0 to MaxRGB while mid (gamma) has a useful\nrange of 0 to ten.</small></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"layerImage\"></a> <font size=\"-1\">layerImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#ChannelType\">ChannelType</a>\nlayer_</font></td>\n      <td><font size=\"-1\">Extract layer from image. Use this option to\nextract a particular layer from&nbsp; the image.&nbsp; <i>MatteLayer</i>,&nbsp;\nfor&nbsp; example, is useful for extracting the opacity values from an\nimage.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"magnifyImage\"></a> <font size=\"-1\">magnifyImage</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td><font size=\"-1\">Magnify image by integral size</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"mapImage\"></a> <font size=\"-1\">mapImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Image.html\">Image</a>\n&amp;mapImage_ , bool dither_ = false</font></td>\n      <td><font size=\"-1\">Remap image colors with closest color from\nreference image. Set dither_ to <i>true</i> in to apply Floyd/Steinberg\nerror diffusion  to the image. By default, color reduction chooses an\noptimal&nbsp; set&nbsp;  of colors that best represent the original\nimage. Alternatively, you can&nbsp; choose&nbsp; a&nbsp;\nparticular&nbsp; set&nbsp; of colors&nbsp; from&nbsp;  an image file\nwith this option.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"matteFloodfillImage\"></a> <font size=\"-1\">matteFloodfill-</font> <br>\n      <font size=\"-1\">Image</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Color.html\">Color</a>\n&amp;target_, unsigned int matte_, int x_, int y_, <a\n href=\"Enumerations.html#PaintMethod\"> PaintMethod</a> method_</font></td>\n      <td><font size=\"-1\">Floodfill designated area with a matte value</font></td>\n    </tr>\n    <tr>\n      <td><a name=\"medianFilterImage\"></a> <font size=\"-1\">medianFilterImage</font></td>\n      <td><font size=\"-1\">const double radius_ = 0.0</font></td>\n      <td><font size=\"-1\">Filter image by replacing each pixel\ncomponent with the median color in a circular neighborhood</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"minifyImage\"></a> <font size=\"-1\">minifyImage</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td><font size=\"-1\">Reduce image by integral size</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"modulateImage\"></a> <font size=\"-1\">modulateImage</font></center>\n      </td>\n      <td><font size=\"-1\">double brightness_, double saturation_,\ndouble hue_</font></td>\n      <td><font size=\"-1\">Modulate percent hue, saturation, and\nbrightness of an image.&nbsp;</font><font size=\"-1\">Modulation of\nsaturation and brightness is as a ratio of the current value (1.0 for no\nchange). Modulation of hue is an absolute rotation of -180 degrees to\n+180 degrees from the current position corresponding to an argument\nrange of 0 to 2.0 (1.0 for no change).</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"negateImage\"></a> <font size=\"-1\">negateImage</font></center>\n      </td>\n      <td><font size=\"-1\">bool grayscale_ = false</font></td>\n      <td><font size=\"-1\">Negate colors in image.&nbsp; Replace every\npixel with  its complementary color (white becomes black, yellow becomes\nblue, etc.).&nbsp;  Set grayscale to only negate grayscale values in\nimage.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"normalizeImage\"></a> <font size=\"-1\">normalizeImage</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td><font size=\"-1\">Normalize image (increase contrast by\nnormalizing the  pixel values to span the full range of color values).</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"oilPaintImage\"></a> <font size=\"-1\">oilPaintImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int radius_ = 3</font></td>\n      <td><font size=\"-1\">Oilpaint image (image looks like oil painting)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"opacityImage\"></a> <font size=\"-1\">opacityImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int opacity_</font></td>\n      <td><font size=\"-1\">Set or attenuate the opacity channel in the\nimage. If the image pixels are opaque then they are set to the specified\nopacity value, otherwise they are blended with the supplied opacity\nvalue.&nbsp; The value of opacity_ ranges from 0 (completely opaque) to <i>MaxRGB</i>.\nThe defines <i>OpaqueOpacity</i> and <i>TransparentOpacity</i> are\navailable to specify completely opaque or completely transparent,\nrespectively.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"opaqueImage\"></a> <font size=\"-1\">opaqueImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Color.html\">Color</a>\n&amp;opaqueColor_, const <a href=\"Color.html\">Color</a> &amp;penColor_</font></td>\n      <td><font size=\"-1\">Change color of pixels matching opaqueColor_\nto specified  penColor_.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"quantizeImage\"></a> <font size=\"-1\">quantizeImage</font></center>\n      </td>\n      <td><font size=\"-1\">bool measureError_ = false</font></td>\n      <td><font size=\"-1\">Quantize image (reduce number of colors). Set\nmeasureError_ to true in order to calculate error attributes.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"raiseImage\"></a> <font size=\"-1\">raiseImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_ = \"6x6+0+0\",&nbsp; bool raisedFlag_ =&nbsp; false</font></td>\n      <td><font size=\"-1\">Raise image (lighten or darken the edges of\nan image  to give a 3-D raised or lowered effect)</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">\n      <center><a name=\"reduceNoiseImage\"></a> <font size=\"-1\">reduceNoise-</font> <br>\n      <font size=\"-1\">Image</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td rowspan=\"2\"><font size=\"-1\">Reduce noise in image using a\nnoise peak  elimination filter.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">unsigned int order_</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"rollImage\"></a> <font size=\"-1\">rollImage</font></center>\n      </td>\n      <td><font size=\"-1\">int columns_, int rows_</font></td>\n      <td><font size=\"-1\">Roll image (rolls image vertically and\nhorizontally) by specified number of columnms and rows)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"rotateImage\"></a> <font size=\"-1\">rotateImage</font></center>\n      </td>\n      <td><font size=\"-1\">double degrees_</font></td>\n      <td><font size=\"-1\">Rotate image counter-clockwise by specified\nnumber of degrees</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"sampleImage\"></a> <font size=\"-1\">sampleImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_&nbsp;</font></td>\n      <td><font size=\"-1\">Resize image by using pixel sampling algorithm</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"scaleImage\"></a> <font size=\"-1\">scaleImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_</font></td>\n      <td><font size=\"-1\">Resize image by using simple ratio algorithm</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"segmentImage\"></a> <font size=\"-1\">segmentImage</font></center>\n      </td>\n      <td><font size=\"-1\">double clusterThreshold_ = 1.0,</font> <br>\n      <font size=\"-1\">double smoothingThreshold_ = 1.5</font></td>\n      <td><font size=\"-1\">Segment (coalesce similar image components)\nby analyzing  the histograms of the color components and identifying\nunits that are homogeneous  with the fuzzy c-means technique. Also uses <i>quantizeColorSpace</i>\nand <i>verbose</i> image attributes. Specify <i>clusterThreshold_</i> ,\nas the number&nbsp; of&nbsp; pixels&nbsp; each cluster&nbsp; must exceed\nthe cluster threshold to be considered valid. <i>SmoothingThreshold_</i>\neliminates noise in the&nbsp; second derivative of the histogram. As the\nvalue is&nbsp; increased, you can&nbsp; expect&nbsp; a&nbsp; smoother\nsecond derivative.&nbsp; The default is 1.5.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"shadeImage\"></a> <font size=\"-1\">shadeImage</font></center>\n      </td>\n      <td><font size=\"-1\">double azimuth_ = 30, double elevation_ = 30,</font> <br>\n      <font size=\"-1\">bool colorShading_ = false</font></td>\n      <td><font size=\"-1\">Shade image using distant light source.\nSpecify <i> azimuth_</i> and <i>elevation_</i> as the&nbsp;\nposition&nbsp; of&nbsp; the light source. By default, the shading\nresults as a grayscale image.. Set c<i>olorShading_</i> to <i>true</i> to\nshade the red, green, and blue components of the image.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"sharpenImage\"></a> <font size=\"-1\">sharpenImage</font></center>\n      </td>\n      <td><font size=\"-1\">const double radius_ = 1, const double sigma_\n= 0.5</font></td>\n      <td><font size=\"-1\">Sharpen pixels in image. The radius_\nparameter specifies  the radius of the Gaussian, in pixels, not counting\nthe center pixel.&nbsp;  The sigma_ parameter specifies the standard\ndeviation of the Laplacian, in pixels.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"shaveImage\"></a> <font size=\"-1\">shaveImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_</font></td>\n      <td><font size=\"-1\">Shave pixels from image edges.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"shearImage\"></a> <font size=\"-1\">shearImage</font></center>\n      </td>\n      <td><font size=\"-1\">double xShearAngle_, double yShearAngle_</font></td>\n      <td><font size=\"-1\">Shear image (create parallelogram by sliding\nimage by X or Y axis).&nbsp; Shearing slides one edge of an image along\nthe X&nbsp;  or&nbsp; Y axis,&nbsp; creating&nbsp; a\nparallelogram.&nbsp; An X direction  shear slides an edge along the X\naxis, while&nbsp; a&nbsp; Y&nbsp; direction  shear&nbsp; slides&nbsp; an\nedge along the Y axis.&nbsp; The amount of the shear is controlled by a\nshear angle.&nbsp; For X direction&nbsp; shears,&nbsp;  x&nbsp; degrees\nis measured relative to the Y axis, and similarly, for Y direction\nshears&nbsp; y&nbsp; degrees is measured relative to the X axis. Empty\ntriangles left over from shearing the&nbsp; image&nbsp; are filled&nbsp;\nwith&nbsp; the&nbsp; color&nbsp; defined as <i>borderColor</i>.&nbsp;</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"solarizeImage\"></a> <font size=\"-1\">solarizeImage</font></center>\n      </td>\n      <td><font size=\"-1\">double factor_</font></td>\n      <td><font size=\"-1\">Solarize image (similar to effect seen when\nexposing a photographic film to light during the development process)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"spreadImage\"></a> <font size=\"-1\">spreadImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int amount_ = 3</font></td>\n      <td><font size=\"-1\">Spread pixels randomly within image by\nspecified amount</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"steganoImage\"></a> <font size=\"-1\">steganoImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Image.html\">Image</a>\n&amp;watermark_</font></td>\n      <td><font size=\"-1\">Add a digital watermark to the image (based\non second  image)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"stereoImage\"></a> <font size=\"-1\">stereoImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Image.html\">Image</a>\n&amp;rightImage_</font></td>\n      <td><font size=\"-1\">Create an image which appears in stereo when\nviewed with red-blue glasses (Red image on left, blue on right)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"swirlImage\"></a> <font size=\"-1\">swirlImage</font></center>\n      </td>\n      <td><font size=\"-1\">double degrees_</font></td>\n      <td><font size=\"-1\">Swirl image (image pixels are rotated by\ndegrees)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"textureImage\"></a> <font size=\"-1\">textureImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Image.html\">Image</a>\n&amp;texture_</font></td>\n      <td><font size=\"-1\">Layer a texture on image background</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"thresholdImage\"></a> <font size=\"-1\">thresholdImage</font></center>\n      </td>\n      <td><font size=\"-1\">double threshold_</font></td>\n      <td><font size=\"-1\">Threshold image</font></td>\n    </tr>\n    <tr>\n      <td rowspan=\"2\">\n      <center><a name=\"transformImage\"></a> <font size=\"-1\">transformImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;imageGeometry_</font></td>\n      <td rowspan=\"2\"><font size=\"-1\">Transform image based on image\nand crop geometries. Crop geometry is optional.</font></td>\n    </tr>\n    <tr>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;imageGeometry_, const <a href=\"Geometry.html\">Geometry</a>\n&amp;cropGeometry_&nbsp;</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"transparentImage\"></a> <font size=\"-1\">transparentImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Color.html\">Color</a>\n&amp;color_</font></td>\n      <td><font size=\"-1\">Add matte image to image, setting pixels\nmatching color  to transparent.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"trimImage\"></a> <font size=\"-1\">trimImage</font></center>\n      </td>\n      <td><font size=\"-1\">void</font></td>\n      <td><font size=\"-1\">Trim edges that are the background color from\nthe image.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"waveImage\"></a> <font size=\"-1\">waveImage</font></center>\n      </td>\n      <td><font size=\"-1\">double amplitude_ = 25.0, double wavelength_\n= 150.0</font></td>\n      <td><font size=\"-1\">Alter an image along a sine wave.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"zoomImage\"></a> <font size=\"-1\">zoomImage</font></center>\n      </td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_</font></td>\n      <td><font size=\"-1\">Zoom image to specified size.</font></td>\n    </tr>\n  </tbody>\n</table>\n</p>\n<p>Function objects are available to set attributes on image frames\nwhich are equivalent to methods in the Image object. These function\nobjects allow setting an option across a range of image frames using f<tt>\nor_each()</tt>. </p>\n<p>The following code is an example of how the color 'red' may be set\nto transparent in a GIF animation: </p>\n<p><tt><font color=\"#000066\">list&lt;image&gt; images;</font></tt> <br>\n<tt><font color=\"#000066\">readImages( &amp;images, \"animation.gif\"  );</font></tt> <br>\n<tt><font color=\"#000066\">for_each ( images.begin(), images.end(),\ntransparentImage( \"red\" )&nbsp; );</font></tt> <br>\n<tt><font color=\"#000066\">writeImages( images.begin(), images.end(),\n\"animation.gif\" );</font></tt> </p>\n<p>The available function objects for setting image attributes are <br>\n&nbsp;\n<table border=\"1\">\n  <caption style=\"font-weight: bold;\">Image Attributes</caption> <tbody>\n    <tr>\n      <td>\n      <center><b>Attribute</b></center>\n      </td>\n      <td>\n      <center><b>Type</b></center>\n      </td>\n      <td>\n      <center><b>Constructor Signature(s)</b></center>\n      </td>\n      <td>\n      <center><b>Description</b></center>\n      </td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"adjoinImage\"></a> <font size=\"-1\">adjoinImage</font></center>\n      </td>\n      <td><font size=\"-1\">bool</font></td>\n      <td><font size=\"-1\">bool flag_</font></td>\n      <td><font size=\"-1\">Join images into a single multi-image file.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"antiAlias\"></a> <font size=\"-1\">antiAliasImage</font></center>\n      </td>\n      <td><font size=\"-1\">bool</font></td>\n      <td><font size=\"-1\">bool flag_</font></td>\n      <td><font size=\"-1\">Control antialiasing of rendered Postscript\nand Postscript  or TrueType fonts. Enabled by default.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"animationDelay\"></a> <font size=\"-1\">animation-</font> <br>\n      <font size=\"-1\">DelayImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int (0 to 65535)</font></td>\n      <td><font size=\"-1\">unsigned int delay_</font></td>\n      <td><font size=\"-1\">Time in 1/100ths of a second (0 to 65535)\nwhich must  expire before displaying the next image in an animated\nsequence. This option  is useful for regulating the animation of a\nsequence&nbsp; of GIF images within Netscape.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"animationIterations\"></a> <font size=\"-1\">animation-</font> <br>\n      <font size=\"-1\">IterationsImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int</font></td>\n      <td><font size=\"-1\">unsigned int iterations_</font></td>\n      <td><font size=\"-1\">Number of iterations to loop an animation\n(e.g. Netscape  loop extension) for.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"backgroundColor\"></a> <font size=\"-1\">background-</font> <br>\n      <font size=\"-1\">ColorImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Color.html\">Color</a> </font></td>\n      <td><font size=\"-1\">const <a href=\"Color.html\">Color</a>\n&amp;color_</font></td>\n      <td><font size=\"-1\">Image background color</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"backgroundTexture\"></a> <font size=\"-1\">background-</font> <br>\n      <font size=\"-1\">TextureImage</font></center>\n      </td>\n      <td><font size=\"-1\">std::string</font></td>\n      <td><font size=\"-1\">const string &amp;texture_</font></td>\n      <td><font size=\"-1\">Image to use as background texture.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"borderColor\"></a> <font size=\"-1\">borderColor-</font> <br>\n      <font size=\"-1\">Image</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Color.html\">Color</a> </font></td>\n      <td><font size=\"-1\">&nbsp;const <a href=\"Color.html\">Color</a>\n&amp;color_</font></td>\n      <td><font size=\"-1\">Image border color</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"boxColor\"></a> <font size=\"-1\">boxColorImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Color.html\">Color</a> </font></td>\n      <td><font size=\"-1\">const <a href=\"Color.html\">Color</a>\n&amp;boxColor_</font></td>\n      <td><font size=\"-1\">Base color that annotation text is rendered\non.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"chromaBluePrimary\"></a> <font size=\"-1\">chroma-</font> <br>\n      <font size=\"-1\">BluePrimaryImage</font></center>\n      </td>\n      <td><font size=\"-1\">double x &amp; y</font></td>\n      <td><font size=\"-1\">double x_, double y_</font></td>\n      <td><font size=\"-1\">Chromaticity blue primary point (e.g. x=0.15,\ny=0.06)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"chromaGreenPrimary\"></a> <font size=\"-1\">chroma-</font> <br>\n      <font size=\"-1\">GreenPrimaryImage</font></center>\n      </td>\n      <td><font size=\"-1\">double x &amp; y</font></td>\n      <td><font size=\"-1\">double x_, double y_</font></td>\n      <td><font size=\"-1\">Chromaticity green primary point (e.g. x=0.3,\ny=0.6)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"chromaRedPrimary\"></a> <font size=\"-1\">chroma-</font> <br>\n      <font size=\"-1\">RedPrimaryImage</font></center>\n      </td>\n      <td><font size=\"-1\">double x &amp; y</font></td>\n      <td><font size=\"-1\">double x_, double y_</font></td>\n      <td><font size=\"-1\">Chromaticity red primary point (e.g. x=0.64,\ny=0.33)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"chromaWhitePoint\"></a> <font size=\"-1\">chroma-</font> <br>\n      <font size=\"-1\">WhitePointImage</font></center>\n      </td>\n      <td><font size=\"-1\">double x &amp; y</font></td>\n      <td><font size=\"-1\">double x_, double y_</font></td>\n      <td><font size=\"-1\">Chromaticity white point (e.g. x=0.3127,\ny=0.329)</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"colorFuzz\"></a> <font size=\"-1\">colorFuzzImage</font></center>\n      </td>\n      <td><font size=\"-1\">double</font></td>\n      <td><font size=\"-1\">double fuzz_</font></td>\n      <td><font size=\"-1\">Colors within this distance are considered\nequal. A number of algorithms search for a target&nbsp; color. By\ndefault the color must be exact. Use this option to match colors that\nare close to the target  color in RGB space.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"colorMap\"></a> <font size=\"-1\">colorMapImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Color.html\">Color</a> </font></td>\n      <td><font size=\"-1\">unsigned int index_, const <a\n href=\"Color.html\">Color</a> &amp;color_</font></td>\n      <td><font size=\"-1\">Color at color-pallet index.</font></td>\n    </tr>\n    <tr>\n      <td><a name=\"colorSpaceImage\"></a> <font size=\"-1\">colorSpaceImage</font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#ColorspaceType\">ColorspaceType</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#ColorspaceType\">ColorspaceType</a>\ncolorSpace_</font></td>\n      <td><font size=\"-1\">The colorspace (e.g. CMYK) used to represent\nthe image  pixel colors. Image pixels are always stored as RGB(A) except\nfor the case  of CMY(K).</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"composeImage\"></a> <font size=\"-1\">composeImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#CompositeOperator\">CompositeOperator</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#CompositeOperator\">CompositeOperator</a>\ncompose_</font></td>\n      <td><font size=\"-1\">Composition operator to be used when\ncomposition is implicitly used (such as for image flattening).</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"compressType\"></a> <font size=\"-1\">compressType-</font> <br>\n      <font size=\"-1\">Image</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#CompressionType\">CompressionType</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#CompressionType\">CompressionType</a>\ncompressType_</font></td>\n      <td><font size=\"-1\">Image compresion type. The default is the\ncompression type of the specified image file.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"density\"></a> <font size=\"-1\">densityImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Geometry.html\">Geometry</a> &nbsp;\n(default 72x72)</font></td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;density_</font></td>\n      <td><font size=\"-1\">Vertical and horizontal resolution in pixels\nof the image. This option specifies an image density when decoding a\nPostscript or Portable Document page. Often used with <i>psPageSize</i>.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"depth\"></a> <font size=\"-1\">depthImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int</font></td>\n      <td><font size=\"-1\">unsigned int depth_</font></td>\n      <td><font size=\"-1\">Image depth. Used to specify the bit depth\nwhen reading  or writing&nbsp; raw images or thwn the output format\nsupports multiple depths. Defaults to the quantum depth that\nGraphicsMagick is compiled with.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"endianImage\"></a> <font size=\"-1\">endianImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#EndianType\">EndianType</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#EndianType\">EndianType</a>\nendian_</font></td>\n      <td><font size=\"-1\">Specify (or obtain) endian option for formats\nwhich support it.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"fileName\"></a> <font size=\"-1\">fileNameImage</font></center>\n      </td>\n      <td><font size=\"-1\">std::string</font></td>\n      <td><font size=\"-1\">const std::string &amp;fileName_</font></td>\n      <td><font size=\"-1\">Image file name.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"fillColorImage\"></a> <font size=\"-1\">fillColorImage</font></center>\n      </td>\n      <td><font size=\"-1\">Color</font></td>\n      <td><font size=\"-1\">const Color &amp;fillColor_</font></td>\n      <td><font size=\"-1\">Color to use when filling drawn objects</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"filterType\"></a> <font size=\"-1\">filterTypeImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#FilterTypes\">FilterTypes</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#FilterTypes\">FilterTypes</a>\nfilterType_</font></td>\n      <td><font size=\"-1\">Filter to use when resizing image. The\nreduction filter  employed has a sigificant effect on the time required\nto resize an image and the resulting quality. The default filter is <i>Lanczos</i>\nwhich has been shown to produce good results when reducing images.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"font\"></a> <font size=\"-1\">fontImage</font></center>\n      </td>\n      <td><font size=\"-1\">std::string</font></td>\n      <td><font size=\"-1\">const std::string &amp;font_</font></td>\n      <td><font size=\"-1\">Text rendering font. If the font is a fully\nqualified X server font name, the font is obtained from an X&nbsp;\nserver. To use a TrueType font, precede the TrueType filename with an @.\nOtherwise, specify&nbsp;  a&nbsp; Postscript font name (e.g.\n\"helvetica\").</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"fontPointsize\"></a> <font size=\"-1\">fontPointsize-</font> <br>\n      <font size=\"-1\">Image</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int</font></td>\n      <td><font size=\"-1\">unsigned int pointSize_</font></td>\n      <td><font size=\"-1\">Text rendering font point size</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"gifDisposeMethod\"></a> <font size=\"-1\">gifDispose-</font> <br>\n      <font size=\"-1\">MethodImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int</font> <br>\n      <font size=\"-1\">{ 0 = Disposal not specified,</font> <br>\n      <font size=\"-1\">1 = Do not dispose of graphic,</font> <br>\n      <font size=\"-1\">3 = Overwrite graphic with background color,</font> <br>\n      <font size=\"-1\">4 = Overwrite graphic with previous graphic. }</font></td>\n      <td><font size=\"-1\">unsigned int disposeMethod_</font></td>\n      <td><font size=\"-1\">GIF disposal method. This option is used to\ncontrol how successive frames are rendered (how the preceding frame is\ndisposed of)  when creating a GIF animation.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"interlaceType\"></a> <font size=\"-1\">interlace-</font> <br>\n      <font size=\"-1\">TypeImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#InterlaceType\">InterlaceType</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#InterlaceType\">InterlaceType</a>\ninterlace_</font></td>\n      <td><font size=\"-1\">The type of interlacing scheme (default <i>NoInterlace</i>\n). This option is used to specify the type of&nbsp; interlacing\nscheme&nbsp; for&nbsp; raw&nbsp; image formats such as RGB or YUV. <i>NoInterlace</i>\nmeans do not&nbsp; interlace, <i>LineInterlace</i> uses scanline\ninterlacing, and <i>PlaneInterlace</i> uses plane interlacing. <i>\nPartitionInterlace</i> is like <i>PlaneInterlace</i> except the&nbsp;\ndifferent planes&nbsp; are  saved&nbsp; to individual files (e.g.&nbsp;\nimage.R, image.G, and image.B).  Use <i>LineInterlace</i> or <i>PlaneInterlace</i>\nto create an interlaced  GIF or progressive JPEG image.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"isValidImage\"></a> <font size=\"-1\">isValidImage</font></center>\n      </td>\n      <td><font size=\"-1\">bool</font></td>\n      <td><font size=\"-1\">bool isValid_</font></td>\n      <td><font size=\"-1\">Set image validity. Valid images become empty\n(inValid) if argument is false.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"label\"></a> <font size=\"-1\">labelImage</font></center>\n      </td>\n      <td><font size=\"-1\">std::string</font></td>\n      <td><font size=\"-1\">const std::string &amp;label_</font></td>\n      <td><font size=\"-1\">Image label</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"lineWidth\"></a> <font size=\"-1\">lineWidthImage</font></center>\n      </td>\n      <td><font size=\"-1\">double</font></td>\n      <td><font size=\"-1\">double lineWidth_</font></td>\n      <td><font size=\"-1\">Line width for drawing lines, circles,\nellipses, etc.  See <a href=\"Drawable.html\">Drawable</a> .</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"magick\"></a> <font size=\"-1\">magickImage</font></center>\n      </td>\n      <td><font size=\"-1\">std::string</font></td>\n      <td><font size=\"-1\">&nbsp;const std::string &amp;magick_</font></td>\n      <td><font size=\"-1\">Get image format (e.g. \"GIF\")</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"matte\"></a> <font size=\"-1\">matteImage</font></center>\n      </td>\n      <td><font size=\"-1\">bool</font></td>\n      <td><font size=\"-1\">bool matteFlag_</font></td>\n      <td><font size=\"-1\">True if the image has transparency. If set\nTrue, store  matte channel if&nbsp; the image has one otherwise create\nan opaque one.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"matteColor\"></a> <font size=\"-1\">matteColorImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Color.html\">Color</a> </font></td>\n      <td><font size=\"-1\">const <a href=\"Color.html\">Color</a>\n&amp;matteColor_</font></td>\n      <td><font size=\"-1\">Image matte (frame) color</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"monochrome\"></a> <font size=\"-1\">monochrome-</font> <br>\n      <font size=\"-1\">Image</font></center>\n      </td>\n      <td><font size=\"-1\">bool</font></td>\n      <td><font size=\"-1\">bool flag_</font></td>\n      <td><font size=\"-1\">Transform the image to black and white</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"pageImage\"></a> <font size=\"-1\">pageImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Geometry.html#PostscriptPageSize\">Geometry</a> </font></td>\n      <td><font size=\"-1\">const <a\n href=\"Geometry.html#PostscriptPageSize\">Geometry</a> &amp;pageSize_</font></td>\n      <td><font size=\"-1\">Preferred size and location of an image\ncanvas.</font>\n      <p><font size=\"-1\">Use this option to specify the dimensions and\nposition of the Postscript page in dots per inch or a TEXT page in\npixels. This option is typically used in concert with <i><a\n href=\"#density\">density</a> </i>.</font> </p>\n      <p><font size=\"-1\">Page may also be used to position a GIF image\n(such as for a scene in an animation)</font></p>\n      </td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"penColor\"></a> <font size=\"-1\">penColorImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Color.html\">Color</a> </font></td>\n      <td><font size=\"-1\">const <a href=\"Color.html\">Color</a>\n&amp;penColor_</font></td>\n      <td><font size=\"-1\">Pen color to use when annotating on or\ndrawing on image.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"penTexture\"></a> <font size=\"-1\">penTextureImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Image.html\">Image</a> </font></td>\n      <td><font size=\"-1\">const Image &amp; penTexture_</font></td>\n      <td><font size=\"-1\">Texture image to paint with (similar to\npenColor).</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"pixelColor\"></a> <font size=\"-1\">pixelColorImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Color.html\">Color</a> </font></td>\n      <td><font size=\"-1\">unsigned int x_, unsigned int y_, const <a\n href=\"Color.html\"> Color</a> &amp;color_</font></td>\n      <td><font size=\"-1\">Get/set pixel color at location x &amp; y.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"psPageSize\"></a> <font size=\"-1\">psPageSizeImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Geometry.html#PostscriptPageSize\">Geometry</a> </font></td>\n      <td><font size=\"-1\">const <a\n href=\"Geometry.html#PostscriptPageSize\">Geometry</a> &amp;pageSize_</font></td>\n      <td><font size=\"-1\">Postscript page size. Use this&nbsp; option\nto specify  the dimensions&nbsp; of the Postscript page in dots per inch\nor a TEXT page in pixels. This option is typically used in concert with <i>density</i>.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"quality\"></a> <font size=\"-1\">qualityImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int (0 to 100)</font></td>\n      <td><font size=\"-1\">unsigned int quality_</font></td>\n      <td><font size=\"-1\">JPEG/MIFF/PNG compression level (default 75).</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"quantizeColors\"></a> <font size=\"-1\">quantize-</font> <br>\n      <font size=\"-1\">ColorsImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int</font></td>\n      <td><font size=\"-1\">unsigned int colors_</font></td>\n      <td><font size=\"-1\">Preferred number of colors in the image. The\nactual number of colors in the image may be less than your request, but\nnever more. Images with less unique colors than specified with this\noption will have any duplicate or unused colors removed.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"quantizeColorSpace\"></a> <font size=\"-1\">quantize-</font> <br>\n      <font size=\"-1\">ColorSpaceImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#ColorspaceType\">ColorspaceType</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#ColorspaceType\">ColorspaceType</a>\ncolorSpace_</font></td>\n      <td><font size=\"-1\">Colorspace to quantize colors in (default\nRGB). Empirical  evidence suggests that distances in color spaces such\nas YUV or YIQ correspond  to perceptual color differences more closely\nthan do distances in RGB space.  These color spaces may give better\nresults when color reducing an image.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"quantizeDither\"></a> <font size=\"-1\">quantize-</font> <br>\n      <font size=\"-1\">DitherImage</font></center>\n      </td>\n      <td><font size=\"-1\">bool</font></td>\n      <td><font size=\"-1\">bool flag_</font></td>\n      <td><font size=\"-1\">Apply Floyd/Steinberg error diffusion to the\nimage. The basic strategy of dithering is to&nbsp; trade&nbsp; intensity\nresolution&nbsp; for&nbsp; spatial&nbsp; resolution&nbsp; by&nbsp;\naveraging the intensities&nbsp;  of&nbsp; several&nbsp;\nneighboring&nbsp; pixels. Images which&nbsp; suffer&nbsp;  from&nbsp;\nsevere&nbsp; contouring&nbsp; when&nbsp; reducing colors can be improved\nwith this option. The quantizeColors or monochrome option must be set\nfor this option to take effect.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"quantizeTreeDepth\"></a> <font size=\"-1\">quantize-</font> <br>\n      <font size=\"-1\">TreeDepthImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int (0 to 8)</font></td>\n      <td><font size=\"-1\">unsigned int treeDepth_</font></td>\n      <td><font size=\"-1\">Depth of the quantization color\nclassification tree.  Values of 0 or 1 allow selection of the optimal\ntree depth for the color reduction algorithm. Values between 2 and 8 may\nbe used to manually adjust the tree depth.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"renderingIntent\"></a> <font size=\"-1\">rendering-</font> <br>\n      <font size=\"-1\">IntentImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#RenderingIntent\">RenderingIntent</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#RenderingIntent\">RenderingIntent</a>\nrender_</font></td>\n      <td><font size=\"-1\">The type of rendering intent</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"resolutionUnits\"></a> <font size=\"-1\">resolution-</font> <br>\n      <font size=\"-1\">UnitsImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#ResolutionType\">ResolutionType</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#ResolutionType\">ResolutionType</a>\nunits_</font></td>\n      <td><font size=\"-1\">Units of image resolution</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"scene\"></a> <font size=\"-1\">sceneImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int</font></td>\n      <td><font size=\"-1\">unsigned int scene_</font></td>\n      <td><font size=\"-1\">Image scene number</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"size\"></a> <font size=\"-1\">sizeImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Geometry.html\">Geometry</a> </font></td>\n      <td><font size=\"-1\">const <a href=\"Geometry.html\">Geometry</a>\n&amp;geometry_</font></td>\n      <td><font size=\"-1\">Width and height of a raw image (an image\nwhich does  not support width and height information).&nbsp; Size may\nalso be used to affect the image size read from a multi-resolution\nformat (e.g. Photo CD, JBIG, or JPEG.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"strokeColorImage\"></a> <font size=\"-1\">strokeColorImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Color.html\">Color</a> </font></td>\n      <td><font size=\"-1\">const <a href=\"Color.html\">Color</a>\n&amp;strokeColor_</font></td>\n      <td><font size=\"-1\">Color to use when drawing object outlines</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"subImage\"></a> <font size=\"-1\">subImageImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int</font></td>\n      <td><font size=\"-1\">unsigned int subImage_</font></td>\n      <td><font size=\"-1\">Subimage of an image sequence</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"subRange\"></a> <font size=\"-1\">subRangeImage</font></center>\n      </td>\n      <td><font size=\"-1\">unsigned int</font></td>\n      <td><font size=\"-1\">unsigned int subRange_</font></td>\n      <td><font size=\"-1\">Number of images relative to the base image</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"tileName\"></a> <font size=\"-1\">tileNameImage</font></center>\n      </td>\n      <td><font size=\"-1\">std::string</font></td>\n      <td><font size=\"-1\">const std::string &amp;tileName_</font></td>\n      <td><font size=\"-1\">Tile name</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"typeImage\"></a> <font size=\"-1\">typeImage</font></center>\n      </td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#ImageType\">ImageType</a> </font></td>\n      <td><font size=\"-1\"><a href=\"Enumerations.html#ImageType\">ImageType</a>\ntype_</font></td>\n      <td><font size=\"-1\">Image storage type.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"verbose\"></a> <font size=\"-1\">verboseImage</font></center>\n      </td>\n      <td><font size=\"-1\">bool</font></td>\n      <td><font size=\"-1\">bool verboseFlag_</font></td>\n      <td><font size=\"-1\">Print detailed information about the image</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"view\"></a> <font size=\"-1\">viewImage</font></center>\n      </td>\n      <td><font size=\"-1\">std::string</font></td>\n      <td><font size=\"-1\">const std::string &amp;view_</font></td>\n      <td><font size=\"-1\">FlashPix viewing parameters.</font></td>\n    </tr>\n    <tr>\n      <td>\n      <center><a name=\"x11Display\"></a> <font size=\"-1\">x11DisplayImage</font></center>\n      </td>\n      <td><font size=\"-1\">std::string (e.g. \"hostname:0.0\")</font></td>\n      <td><font size=\"-1\">const std::string &amp;display_</font></td>\n      <td><font size=\"-1\">X11 display to display to, obtain fonts from,\nor to capture image from</font></td>\n    </tr>\n  </tbody>\n</table>\n<br>\n&nbsp; </p>\n<center>\n<h3> Query Image Format Support</h3>\n</center>\nMagick++ provides the&nbsp;<a name=\"coderInfoList\"></a> <i>coderInfoList()</i>\nfunction to support obtaining information about the image formats\nsupported by GraphicsMagick. Support for image formats in GraphicsMagick\nis provided by modules known as \"coders\". A user-provided container is\nupdated based on a boolean truth-table match. The truth-table supports\nmatching based on whether GraphicsMagick can read the format, write the\nformat, or supports multiple frames for the format. A wildcard specifier\nis supported for any \"don't care\" field. The data obtained via\ncoderInfoList() may be useful for preparing GUI dialog boxes or for\ndeciding which output format to write based on support within the\nGraphicsMagick build.\n<p>The definition of coderInfoList is: </p>\n<p><tt><font color=\"#000066\">&nbsp; class CoderInfo</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp; {</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp; public:</font></tt> </p>\n<p><tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; enum MatchType {</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nAnyMatch,&nbsp; // match any coder</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TrueMatch,  //\nmatch coder if true</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FalseMatch  //\nmatch coder if false</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; };</font></tt> </p>\n<p><tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; [ remaining CoderInfo\nmethods ]</font></tt> </p>\n<p><tt><font color=\"#000066\">&nbsp;&nbsp; }</font></tt> </p>\n<p><tt><font color=\"#000066\">&nbsp; template &lt;class Container &gt;</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp; void coderInfoList( Container\n*container_,</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nCoderInfo::MatchType isReadable_&nbsp;&nbsp; = CoderInfo::AnyMatch,</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nCoderInfo::MatchType isWritable_&nbsp;&nbsp; = CoderInfo::AnyMatch,</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nCoderInfo::MatchType isMultiFrame_ = CoderInfo::AnyMatch</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n);</font></tt> </p>\n<p>The following example shows how to retrieve a list of all of the\ncoders which support reading images and print the coder attributes (all\nlisted formats will be readable): </p>\n<p><tt><font color=\"#000066\">&nbsp; list&lt;CoderInfo&gt; coderList;</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp; coderInfoList(\n&amp;coderList,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n// Reference to output list</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nCoderInfo::TrueMatch, // Match readable formats</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nCoderInfo::AnyMatch,&nbsp; // Don't care about writable formats</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nCoderInfo::AnyMatch); // Don't care about multi-frame support</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp; list&lt;CoderInfo&gt;::iterator entry\n= coderList.begin();</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp; while( entry != coderList.end() )</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp; {</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; cout &lt;&lt;\nentry-&gt;name() &lt;&lt; \": (\" &lt;&lt; entry-&gt;description()\n&lt;&lt; \") : \";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; cout &lt;&lt; \"Readable =\n\";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; if (\nentry-&gt;isReadable() )</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt;\n\"true\";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; else</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt;\n\"false\";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; cout &lt;&lt; \", \";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; cout &lt;&lt; \"Writable =\n\";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; if (\nentry-&gt;isWritable() )</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt;\n\"true\";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; else</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt;\n\"false\";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; cout &lt;&lt; \", \";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; cout &lt;&lt; \"Multiframe\n= \";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; if (\nentry-&gt;isMultiframe() )</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt;\n\"true\";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; else</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt;\n\"false\";</font></tt> <br>\n<tt><font color=\"#000066\">&nbsp;&nbsp;&nbsp; cout &lt;&lt; endl;<br>\n&nbsp; &nbsp; entry ++;</font></tt><br>\n<tt><font color=\"#000066\">&nbsp;&nbsp; }</font></tt>&nbsp;</p>\n<h3 style=\"text-align: center;\">Obtaining A Color Histogram&nbsp; </h3>\n<p> &nbsp;Magick++ provides the <a name=\"colorHistogram\"></a><span\n style=\"font-weight: bold;\">colorHistogram</span> template function to\nretrieve a color histogram from an image. A color histogram provides a\ncount of how many times each color occurs in the image. The histogram is\nwritten into a user-provided container, which (for example) could be a <span\n style=\"font-style: italic;\">&lt;vector&gt;</span> or a <span\n style=\"font-style: italic;\">&lt;map&gt;</span>. &nbsp;When a\n&lt;map&gt; is used, the <span style=\"font-style: italic;\">Color</span>\nis used as the key so that quick lookups of usage counts for colors may\nbe performed. Writing into a <span style=\"font-style: italic;\">&lt;map&gt;</span>\nmay be slower than writing into a <span style=\"font-style: italic;\">&lt;vector&gt;</span>\nsince the <span style=\"font-style: italic;\">&lt;map&gt;</span> sorts the\nentries (by color intensity) and checks for uniqueness. Each histogram\nentry is contained in type&nbsp;<span style=\"font-style: italic;\">std::pair&lt;Magick::Color,unsigned\nlong&gt;</span><span style=\"font-style: italic;\"> </span>with the first\nmember of the pair being a <span style=\"font-style: italic;\">Color,</span>\nand the second member of the pair being an '<span\n style=\"font-style: italic;\">unsigned long</span>'. Use the <span\n style=\"font-style: italic;\">&lt;pair&gt;</span> \"<span\n style=\"font-style: italic;\">first</span>\" member to access the Color\nand the \"<span style=\"font-style: italic;\">second</span>\" member to\naccess&nbsp;the number of times the color occurs in the image.</p>\n<p>The template function declaration is as follows:<br>\n</p>\n<p><span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\ntemplate &lt;class Container &gt;</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\nvoid colorHistogram( Container *histogram_, const Image image)</span><br>\n</p>\n<p>The following examples illustrate using both a &lt;map&gt; and a\n&lt;vector&gt; to retrieve the color histogram, and print out a\nformatted summary.<br>\n<br>\nUsing &lt;map&gt;:<br>\n&nbsp; &nbsp; <br>\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\nImage image(\"image.miff\");</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\nmap&lt;Color,unsigned long&gt; histogram;</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\ncolorHistogram( &amp;histogram, image );</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\nstd::map&lt;Color,unsigned long&gt;::const_iterator p=histogram.begin();</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\nwhile (p != histogram.end())</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp; {</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;cout &lt;&lt; setw(10) &lt;&lt; (int)p-&gt;second\n&lt;&lt; \": (\"</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; setw(quantum_width)\n&lt;&lt; (int)p-&gt;first.redQuantum() &lt;&lt; \",\"</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; setw(quant</span><span\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">um_width)\n&lt;&lt; (int)p-&gt;first.greenQuantum() &lt;&lt; \",\"</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; setw(quantum_width)\n&lt;&lt; (int)p-&gt;first.blueQuantum() &lt;&lt; \")\"</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; endl;</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp; p++;</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp; }</span><br>\n<br>\nUsing &lt;vector&gt;:<br>\n&nbsp; &nbsp; <br>\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\nImage image(\"image.miff\");</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\nstd::vector&lt;std::pair&lt;Color,unsigned long&gt; &gt; histogram;</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\ncolorHistogram( &amp;histogram, image );</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\nstd::vector&lt;std::pair&lt;Color,unsigned long&gt; &gt;::const_iterator\np=histogram.begin();</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\nwhile (p != histogram.end())</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp; {</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;cout &lt;&lt; setw(10) &lt;&lt; (int)p-&gt;second\n&lt;&lt; \": (\"</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; setw(quantum_width)\n&lt;&lt; (int)p-&gt;first.redQuantum() &lt;&lt; \",\"</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; setw(quantum_width)\n&lt;&lt; (int)p-&gt;first.greenQuantum() &lt;&lt; \",\"</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; setw(quantum_width)\n&lt;&lt; (int)p-&gt;first.blueQuantum() &lt;&lt; \")\"</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; endl;</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp;&nbsp; &nbsp;p++;</span><br\n style=\"color: rgb(51, 51, 153); font-family: monospace;\">\n<span style=\"color: rgb(51, 51, 153); font-family: monospace;\">&nbsp;\n&nbsp; }</span><br>\n</p>\n<p><br>\n<br>\n</p>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/TypeMetric.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick::TypeMetric</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-typemetric\">\n<h1 class=\"title\">Magick::TypeMetric</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The TypeMetric class provides the means to pass data from the Image\nclass's TypeMetric method to the user. It provides information\nregarding font metrics such as ascent, descent, text width, text\nheight, and maximum horizontal advance. The units of these font\nmetrics are in pixels, and that the metrics are dependent on the\ncurrent Image font (default Ghostscript's &quot;Helvetica&quot;), pointsize\n(default 12 points), and x/y resolution (default 72 DPI) settings.</p>\n<p>The pixel units may be converted to points (the standard\nresolution-independent measure used by the typesetting industry) via\nthe following equation:</p>\n<pre class=\"literal-block\">\nsize_points = (size_pixels * 72)/resolution\n</pre>\n<p>where resolution is in dots-per-inch (DPI). This means that at the\ndefault image resolution, there is one pixel per point.</p>\n<p>Note that a font's pointsize is only a first-order approximation of\nthe font height (ascender + descender) in points. The relationship\nbetween the specified pointsize and the rendered font height is\ndetermined by the font designer.</p>\n<p>See <a class=\"reference external\" href=\"http://freetype.sourceforge.net/freetype2/docs/glyphs/index.html\">FreeType Glyph Conventions</a>\nfor a detailed description of font metrics related issues.</p>\n<p>The following is the definition of the Magick::TypeMetric class:</p>\n<pre class=\"literal-block\">\nclass MagickDLLDecl TypeMetric\n{\n  friend class Image;\npublic:\n\n  TypeMetric ( void );\n  ~TypeMetric ( void );\n\n  // Ascent, the distance in pixels from the text baseline to the\n  // highest/upper grid coordinate used to place an outline point.\n  double         ascent ( void ) const;\n\n  // Descent, the distance in pixels from the baseline to the lowest\n  // grid coordinate used to place an outline point. Always a\n  // negative value.\n  double         descent ( void ) const;\n\n  // Text width in pixels.\n  double         textWidth ( void ) const;\n\n  // Text height in pixels.\n  double         textHeight ( void ) const;\n\n  // Maximum horizontal advance in pixels.\n  double         maxHorizontalAdvance ( void ) const;\n\n};\n</pre>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/Magick++/index.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick++ API for GraphicsMagick</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-api-for-graphicsmagick\">\n<h1 class=\"title\">Magick++ API for GraphicsMagick</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#introduction\" id=\"id1\">Introduction</a></li>\n<li><a class=\"reference internal\" href=\"#api\" id=\"id2\">API</a></li>\n<li><a class=\"reference internal\" href=\"#obtaining-magick\" id=\"id3\">Obtaining Magick++</a></li>\n<li><a class=\"reference internal\" href=\"#installation\" id=\"id4\">Installation</a></li>\n<li><a class=\"reference internal\" href=\"#usage\" id=\"id5\">Usage</a></li>\n<li><a class=\"reference internal\" href=\"#reporting-bugs\" id=\"id6\">Reporting Bugs</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"introduction\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Introduction</a></h1>\n<p><em>Magick++</em> is the object-oriented C++ API to the <a class=\"reference external\" href=\"../index.html\">GraphicsMagick</a>\nimage-processing library, the most comprehensive open-source image\nprocessing package available. Read the <a class=\"reference external\" href=\"ChangeLog.html\">ChangeLog</a> for <em>Magick++</em>.</p>\n<p><em>Magick++</em> supports an object model which is inspired by <a class=\"reference external\" href=\"../perl.html\">PerlMagick</a>.\nImages support implicit reference counting so that copy constructors and\nassignment incur almost no cost. The cost of actually copying an image\n(if necessary) is done just before modification and this copy is managed\nautomatically by <em>Magick++</em>. De-referenced copies are automatically\ndeleted. The image objects support value (rather than pointer) semantics\nso it is trivial to support multiple generations of an image in memory at\none time.</p>\n<p><em>Magick++</em> provides integrated support for the <a class=\"reference external\" href=\"http://www.sgi.com/tech/stl/\">Standard Template\nLibrary</a> (<cite>STL</cite>) which is part of the standard C++ language so that\nthe powerful containers available (e.g. <a class=\"reference external\" href=\"http://www.sgi.com/tech/stl/Deque.html\">deque</a>, <a class=\"reference external\" href=\"http://www.sgi.com/tech/stl/Vector.html\">vector</a>, <a class=\"reference external\" href=\"http://www.sgi.com/tech/stl/List.html\">list</a>, and\n<a class=\"reference external\" href=\"http://www.sgi.com/tech/stl/Map.html\">map</a>) can be used to write programs similar to those possible with\nPERL &amp; <a class=\"reference external\" href=\"../perl.html\">PerlMagick</a>. STL-compatible template versions of\nGraphicsMagick's list-style operations are provided so that operations\nmay be performed on multiple images stored in STL containers.</p>\n</div>\n<div class=\"section\" id=\"api\">\n<h1><a class=\"toc-backref\" href=\"#id2\">API</a></h1>\n<p><em>Magick++</em> provides a simple C++ API to the GraphicsMagick image\nprocessing library which supports reading and writing a huge number of\nimage formats as well as supporting a broad spectrum of traditional image\nprocessing operations. The GraphicsMagick C API is complex and the data\nstructures are not well documented. <em>Magick++</em> provides access to most of\nthe features available from the C API but in a simple object-oriented and\nwell-documented framework.</p>\n<p><em>Magick++</em> is intended to support commercial-grade application\ndevelopment. In order to avoid possible conflicts with the user's\napplication, all symbols contained in <em>Magick++</em> (included by the header\n&lt;Magick++.h&gt;) are scoped to the namespace Magick. Symbols from the\nGraphicsMagick C library are imported under the MagickLib namespace to\navoid possible conflicts and GraphicsMagick macros are only included\nwithin the <em>Magick++</em> implementation so they won't impact the user's\napplication.</p>\n<p>The InitializeMagick() function <em>MUST</em> be invoked before constructing\nany Magick++ objects.  This used to be optional, but now it is\nabsolutely required.  This function initalizes semaphores and\nconfiguration information necessary for the software to work\ncorrectly.  Failing to invoke InitializeMagick() is likely to lead to\na program crash or thrown assertion.  If the program resides in the\nsame directory as the GraphicsMagick files, then argv[0] may be passed\nas an argument so that GraphicsMagick knows where its files reside,\notherwise NULL may be passed and GraphicsMagick will try to use other\nmeans (if necessary).</p>\n<p>The core class in <em>Magick++</em> is the <a class=\"reference external\" href=\"Image.html\">Image</a> class. The <a class=\"reference external\" href=\"Image.html\">Image</a> class\nprovides methods to manipulate a single image frame (e.g. a JPEG image).\nStandard Template Library (<a class=\"reference external\" href=\"STL.html\">STL</a>) compatible algorithms and function\nobjects are provided in order to manipulate multiple image frames or to\nread and write file formats which support multiple image frames (e.g. GIF\nanimations, MPEG animations, and Postscript files).</p>\n<p>The <a class=\"reference external\" href=\"Image.html\">Image</a> class supports reference-counted memory management which\nsupports the semantics of an intrinsic variable type (e.g. 'int') with an\nextremely efficient operator = and copy constructor (only a pointer is\nassigned) while ensuring that the image data is replicated as required so\nthat it the image may be modified without impacting earlier generations.\nSince the <a class=\"reference external\" href=\"Image.html\">Image</a> class manages heap memory internally, images are best\nallocated via C++ automatic (stack-based) memory allocation. This support\nallows most programs using <em>Magick++</em> to be written without using any\npointers, simplifying the implementation and avoiding the risks of using\npointers. When a program uses automatic memory allocation to allocate\n<em>Magick++</em> images, that aspect of the program becomes naturally\nexception-safe and thread-safe.</p>\n<p>The image class uses a number of supportive classes in order to specify\narguments. Colors are specified via the <a class=\"reference external\" href=\"Color.html\">Color</a> class. Colors specified\nin X11-style string form are implicitly converted to the <a class=\"reference external\" href=\"Color.html\">Color</a> class.\nGeometry arguments (those specifying width, height, and/or x and y\noffset) are specified via the <a class=\"reference external\" href=\"Geometry.html\">Geometry</a> class. Similar to the <a class=\"reference external\" href=\"Color.html\">Color</a>\nclass, geometries specified as an X11-style string are implicitly\nconverted to the <a class=\"reference external\" href=\"Geometry.html\">Geometry</a> class. Two dimensional drawable objects are\nspecified via the <a class=\"reference external\" href=\"Drawable.html\">Drawable</a> class. Drawable objects may be provided as\na single object or as a list of objects to be rendered using the current\nimage options. <a class=\"reference external\" href=\"Montage.html\">Montage</a> options (a montage is a rendered grid of\nthumbnails in one image) are specified via the <a class=\"reference external\" href=\"Montage.html\">Montage</a> class.</p>\n<p>Errors are reported using C++ exceptions derived from the <a class=\"reference external\" href=\"Exception.html\">Exception</a>\nclass, which is itself derived from the standard C++ exception class.\nExceptions are reported synchronous with the operation and are caught by\nthe first matching try block as the stack is unraveled. This allows a\nclean coding style in which multiple related <em>Magick++</em> commands may be\nexecuted with errors handled as a unit rather than line-by-line. Since\nthe <a class=\"reference external\" href=\"Image.html\">Image</a> object provides reference-counted memory management,\nunreferenced images on the stack are automatically cleaned up, avoiding\nthe potential for memory leaks.</p>\n<p>For ease of access, the documentation for the available user-level\nclasses is available via the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption><em>Magick++</em> User-Level Classes</caption>\n<colgroup>\n<col width=\"18%\" />\n<col width=\"82%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td><a class=\"reference external\" href=\"Blob.html\">Blob</a></td>\n<td>Binary Large OBject container.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"CoderInfo.html\">CoderInfo</a></td>\n<td>Report information about supported image formats (use with\n<a class=\"reference external\" href=\"STL.html#coderInfoList\">coderInfoList</a>())</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"Color.html\">Color</a></td>\n<td>Color specification.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"Drawable.html\">Drawable</a></td>\n<td>Drawable shape (for input to 'draw').</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"Exception.html\">Exception</a></td>\n<td>C++ exception objects.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"Geometry.html\">Geometry</a></td>\n<td>Geometry specification.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"Image.html\">Image</a></td>\n<td>Image frame.  This is the primary object in <em>Magick++</em>.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"Montage.html\">Montage</a></td>\n<td>Montage options for montageImages().</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"Pixels.html\">Pixels</a></td>\n<td>Low-level access to image pixels.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"STL.html\">STL</a></td>\n<td>STL algorithms and function objects for operating on\ncontainers of image frames.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"TypeMetric.html\">TypeMetric</a></td>\n<td>Container for font type metrics (use with\n<a class=\"reference external\" href=\"Image.html#fonttypemetrics\">Image::fontTypeMetrics</a>).</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"obtaining-magick\">\n<h1><a class=\"toc-backref\" href=\"#id3\">Obtaining Magick++</a></h1>\n<p><em>Magick++</em> is included as part of <a class=\"reference external\" href=\"../index.html\">GraphicsMagick</a> source releases and may\nbe retrieved via <a class=\"reference external\" href=\"../download.html\">ftp</a> or <a class=\"reference external\" href=\"../Hg.html\">Mercurial</a>.</p>\n</div>\n<div class=\"section\" id=\"installation\">\n<h1><a class=\"toc-backref\" href=\"#id4\">Installation</a></h1>\n<p>Installation is very easy since <em>Magick++</em> is part of <a class=\"reference external\" href=\"../index.html\">GraphicsMagick</a> and\nis built by default. Once <a class=\"reference external\" href=\"../index.html\">GraphicsMagick</a> is built, then <em>Magick++</em> is\navailable for use.</p>\n</div>\n<div class=\"section\" id=\"usage\">\n<h1><a class=\"toc-backref\" href=\"#id5\">Usage</a></h1>\n<p>A helper script named <em>GraphicsMagick++-config</em> is installed in the same\ndirectory as the GraphicsMagick <em>gm</em> program under Unix which assists\nwith recalling compilation options required to compile and link programs\nwhich depend on <em>Magick++</em>. For example, the following command will\ncompile and link the source file example.cpp to produce the executable\nexample (notice that quotes are backward quotes):</p>\n<pre class=\"literal-block\">\nc++ -o example example.cpp `GraphicsMagick++-config --cppflags --cxxflags\n  --ldflags --libs`\n</pre>\n<p>Windows users may get started by manually editing a project file for one\nof the <em>Magick++</em> demo programs.</p>\n<p>It is necessary to initialize the GraphicsMagick library prior to\nusing the <em>Magick++</em> library. This initialization is performed by\npassing the path to the GraphicsMagick DLLs (assumed to be in the same\ndirectory as your program) to the InitializeMagick() function\ncall. This is commonly performed by providing the path to your program\n(argv[0]) as shown in the following example:</p>\n<pre class=\"literal-block\">\nint main( int /*argc*/, char ** argv)\n{\n  InitializeMagick(*argv);\n</pre>\n<p>If you don't have the path to your executable, then pass NULL and\nusually the library will be found anyway. Besides helping to find the\nGraphicsMagick DLL/library and configuration files, InitializeMagick()\ninitializes all of the semaphores and data necessary for a\nmulti-threaded program to be completely thread safe.  This step used\nto be optional, but it is now absolutely required.  Failure to\ninitialize GraphicsMagick will result in an application crash.</p>\n</div>\n<div class=\"section\" id=\"reporting-bugs\">\n<h1><a class=\"toc-backref\" href=\"#id6\">Reporting Bugs</a></h1>\n<p>Please report any bugs via the <a class=\"reference external\" href=\"http://sourceforge.net/projects/graphicsmagick/\">GraphicsMagick Bug Tracker</a>. Questions\nregarding usage should be directed to <a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">Bob Friesenhahn</a>.</p>\n<p>Copyright © Bob Friesenhahn 1999 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/NEWS.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick News</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-news\">\n<h1 class=\"title\">GraphicsMagick News</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>This file was last updated to reflect changes up to February 23, 2020</p>\n<p>Please note that this file records news for the associated development\nbranch and that each development branch has its own NEWS file. See the\nChangeLog file, and/or the Mercurial changesets, for full details.</p>\n<p>Due to significant issues being discovered and addressed for almost\nevery release, it is recommended to update to the most current\nrelease and not attempt to patch older releases.</p>\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#february-23-2020\" id=\"id2\">1.3.35 (February 23, 2020)</a></li>\n<li><a class=\"reference internal\" href=\"#december-24-2019\" id=\"id3\">1.3.34 (December 24, 2019)</a></li>\n<li><a class=\"reference internal\" href=\"#july-20-2019\" id=\"id4\">1.3.33 (July 20, 2019)</a></li>\n<li><a class=\"reference internal\" href=\"#june-15-2019\" id=\"id5\">1.3.32 (June 15, 2019)</a></li>\n<li><a class=\"reference internal\" href=\"#november-17-2018\" id=\"id6\">1.3.31 (November 17, 2018)</a></li>\n<li><a class=\"reference internal\" href=\"#june-23-2018\" id=\"id7\">1.3.30 (June 23, 2018)</a></li>\n<li><a class=\"reference internal\" href=\"#april-29-2018\" id=\"id8\">1.3.29 (April 29, 2018)</a></li>\n<li><a class=\"reference internal\" href=\"#january-20-2018\" id=\"id9\">1.3.28 (January 20, 2018)</a></li>\n<li><a class=\"reference internal\" href=\"#december-9-2017\" id=\"id10\">1.3.27 (December 9, 2017)</a></li>\n<li><a class=\"reference internal\" href=\"#july-4-2017\" id=\"id11\">1.3.26 (July 4, 2017)</a></li>\n<li><a class=\"reference internal\" href=\"#september-5-2016\" id=\"id12\">1.3.25 (September 5, 2016)</a></li>\n<li><a class=\"reference internal\" href=\"#may-30-2016\" id=\"id13\">1.3.24 (May 30, 2016)</a></li>\n<li><a class=\"reference internal\" href=\"#november-7-2015\" id=\"id14\">1.3.23 (November 7, 2015)</a></li>\n<li><a class=\"reference internal\" href=\"#october-4-2015\" id=\"id15\">1.3.22 (October 4, 2015)</a></li>\n<li><a class=\"reference internal\" href=\"#february-28-2015\" id=\"id16\">1.3.21 (February 28, 2015)</a></li>\n<li><a class=\"reference internal\" href=\"#august-16-2014\" id=\"id17\">1.3.20 (August 16, 2014)</a></li>\n<li><a class=\"reference internal\" href=\"#december-31-2013\" id=\"id18\">1.3.19 (December 31, 2013)</a></li>\n<li><a class=\"reference internal\" href=\"#march-10-2013\" id=\"id19\">1.3.18 (March 10, 2013)</a></li>\n<li><a class=\"reference internal\" href=\"#october-13-2012\" id=\"id20\">1.3.17 (October 13, 2012)</a></li>\n<li><a class=\"reference internal\" href=\"#june-24-2012\" id=\"id21\">1.3.16 (June 24, 2012)</a></li>\n<li><a class=\"reference internal\" href=\"#april-28-2012\" id=\"id22\">1.3.15 (April 28, 2012)</a></li>\n<li><a class=\"reference internal\" href=\"#february-25-2012\" id=\"id23\">1.3.14 (February 25, 2012)</a></li>\n<li><a class=\"reference internal\" href=\"#december-24-2011\" id=\"id24\">1.3.13 (December 24, 2011)</a></li>\n<li><a class=\"reference internal\" href=\"#march-8-2010\" id=\"id25\">1.3.12 (March 8, 2010)</a></li>\n<li><a class=\"reference internal\" href=\"#february-21-2010\" id=\"id26\">1.3.11 (February 21, 2010)</a></li>\n<li><a class=\"reference internal\" href=\"#february-10-2010\" id=\"id27\">1.3.10 (February 10, 2010)</a></li>\n<li><a class=\"reference internal\" href=\"#february-4-2010\" id=\"id28\">1.3.9 (February 4, 2010)</a></li>\n<li><a class=\"reference internal\" href=\"#january-21-2010\" id=\"id29\">1.3.8 (January 21, 2010)</a></li>\n<li><a class=\"reference internal\" href=\"#september-17-2009\" id=\"id30\">1.3.7 (September 17, 2009)</a></li>\n<li><a class=\"reference internal\" href=\"#july-25-2009\" id=\"id31\">1.3.6 (July 25, 2009)</a></li>\n<li><a class=\"reference internal\" href=\"#january-26-2009\" id=\"id32\">1.3.5 (January 26, 2009)</a></li>\n<li><a class=\"reference internal\" href=\"#january-13-2009\" id=\"id33\">1.3.4 (January 13, 2009)</a></li>\n<li><a class=\"reference internal\" href=\"#december-9-2008\" id=\"id34\">1.3.3 (December 9, 2008)</a></li>\n<li><a class=\"reference internal\" href=\"#november-29-2008\" id=\"id35\">1.3.2 (November 29, 2008)</a></li>\n<li><a class=\"reference internal\" href=\"#november-17-2008\" id=\"id36\">1.3.1 (November 17, 2008)</a></li>\n<li><a class=\"reference internal\" href=\"#november-9-2008\" id=\"id37\">1.3 (November 9, 2008)</a></li>\n<li><a class=\"reference internal\" href=\"#april-29-2008\" id=\"id38\">1.2 (April 29, 2008)</a></li>\n<li><a class=\"reference internal\" href=\"#released-april-4-2004\" id=\"id39\">1.1 (Released April 4, 2004)</a></li>\n<li><a class=\"reference internal\" href=\"#released-in-may-2003\" id=\"id40\">1.0 (Released in May, 2003)</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"february-23-2020\">\n<h1><a class=\"toc-backref\" href=\"#id2\">1.3.35 (February 23, 2020)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>It has been discovered that the 'ICU' library (a perhaps 30MB C++\nlibrary) which is now often a libxml2 dependendency causes huge\nprocess initialization overhead.  This is noticed as unexpected\nslowness when GraphicsMagick utilities are used to process small to\nmedium sized files.  The time to initialize the 'ICU' library is\noften longer than the time that GraphicsMagick would otherwise\nrequire to read the input file, process the image, and write the\noutput file.  If the 'ICU' dependency can not be avoided, then make\nsure to use the modules build so there is only impact for file\nformats which require libxml2.  Please lobby the 'ICU' library\ndevelopers to change their implementation to avoid long start-up\ntimes due to merely linking with the library.</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>GraphicsMagick is now participating in Google's oss-fuzz project due\nto the contributions and assistance of Alex Gaynor. Since February 4\n2018, 398 issues have been opened by oss-fuzz (some of which were\nbenign build issues) and 11 issues remain open.\nThe issues list is available at\n<a class=\"reference external\" href=\"https://bugs.chromium.org/p/oss-fuzz/issues/list\">https://bugs.chromium.org/p/oss-fuzz/issues/list</a> under search term\n&quot;graphicsmagick&quot;.  Issues are available for anyone to view and\nduplicate if they have been in &quot;Verified&quot; status for 30 days, or if\nthey have been in &quot;New&quot; status for 90 days.  There are too many\nfixes to list here.  Please consult the GraphicsMagick ChangeLog\nfile, Mercurial repository commit log, and the oss-fuzz issues list\nfor details.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>Fix broken definition of ResourceInfinity which resulted in that\nGetMagickResource() would return -1 rather than the maximum range\nvalue for the return type as documented. (problem added by the\n1.3.32 release).</li>\n<li>ModifyCache(): Re-open the pixel cache if the cache rows/columns do\nnot match the owning image rows/columns.</li>\n<li>Fix DisplayImages() return status.  The return status was inverted.</li>\n<li>HISTOGRAM: Histogram once again includes the histogram as a text\ncomment.  This became broken by previous security fixes.</li>\n<li>PICT: Fixed heap buffer overuns reported multiple sources.</li>\n<li>JNG: Detect when JPEG encoder has failed and throw an exception.</li>\n<li>MVG/DrawImage(): Performs even more parsing validations.</li>\n<li>Clang static analyzer fixes: A great many fixes were made based on\nproblem reports by the Clang static analyzer.</li>\n<li>Visual Studio static analyzer fixes: A great many fixes were made\nbased on problem reports by the Visual Studio 2019 static analyzer.\nMany of these may improve the robustness of 64-bit code.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>GRADIENT/GradientImage(): Improved accuracy of gradient levels as\nwell as dramaticaly improving performance.  Output PseudoClass\nimages if we can.  Add support for using the image 'gravity'\nattribute as well as the &quot;gradient:direction&quot; definition to produce\ngradient vector directions corresponding to SouthGravity (the\npreviously-existing default), NorthGravity, WestGravity,\nEastGravity, NorthWestGravity, NorthEastGravity, SouthWestGravity,\nand SouthEastGravity.</li>\n</ul>\n<p>API Updates:</p>\n<ul class=\"simple\">\n<li>InitializeMagickEx(): New function which may be used in place of\nInitializeMagick() to initialize GraphicsMagick.  This\ninitialization function returns an error status value, may update a\npassed ExceptionInfo structure with error information, and provides\nan options parameter which supports simple bit-flags to tailor\ninitialization.  The signal handler registrations are skipped if the\nMAGICK_OPT_NO_SIGNAL_HANDER flag is set in the options.</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>Replace use of non-reentrant legacy POSIX functions with reentrant\nequivalents.</li>\n<li>Timing of image reads should now be very accurate.  The timer was\nsometimes not stopped as soon as it should be.</li>\n<li>PICT: The PICT reader is working pretty good now.  It handles all\nthe PICT image files I have available to me.</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>Visual Studio Build: Configure program now provides a checkbox to\nenable common optimizations for better performance.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>POSIX Signals: Use the normal termination signal handler for SIGXCPU\nand SIGXFSZ so that ulimit or setrlimit(2) may be used to apply CPU\n(RLIMIT_CPU) and output file size (RLIMIT_FSIZE) limits with the\nnormal cleanup, and without dumping core. Note that any output files\ncurrently being written may be truncated and files being written by\nexternal programs (e.g. Ghostscript) might be left behind unless\nthey are to a temporary file assigned by GraphicsMagick.</li>\n<li>Some private string and integer constants were removed from the\napparent library ABI.  Some private functions were marked static and\nremoved from the apparent library ABI.  This is mentioned because\nsomeone is sure to notice and be concerned about it.</li>\n<li>The remaining private content in installed header files was moved\ninto -private.h header files which are not installed.  This should\nnot be cause for concern but is mentiond because someone is sure to\nnotice and be concerned about it.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"december-24-2019\">\n<h1><a class=\"toc-backref\" href=\"#id3\">1.3.34 (December 24, 2019)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>It has been discovered that the 'ICU' library (a perhaps 30MB C++\nlibrary) which is now often a libxml2 dependendency causes huge\nprocess initialization overhead.  This is noticed as unexpected\nslowness when GraphicsMagick utilities are used to process small to\nmedium sized files.  The time to initialize the 'ICU' library is\noften longer than the time that GraphicsMagick would otherwise\nrequire to read the input file, process the image, and write the\noutput file.  If the 'ICU' dependency can not be avoided, then make\nsure to use the modules build so there is only impact for file\nformats which require libxml2.  Please lobby the 'ICU' library\ndevelopers to change their implementation to avoid long start-up\ntimes due to merely linking with the library.</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>GraphicsMagick is now participating in Google's oss-fuzz project due\nto the contributions and assistance of Alex Gaynor. Since February 4\n2018, 386 issues have been opened by oss-fuzz (some of which were\nbenign build issues) and 376 of those issues have been resolved.\nThe issues list is available at\n<a class=\"reference external\" href=\"https://bugs.chromium.org/p/oss-fuzz/issues/list\">https://bugs.chromium.org/p/oss-fuzz/issues/list</a> under search term\n&quot;graphicsmagick&quot;.  Issues are available for anyone to view and\nduplicate if they have been in &quot;Verified&quot; status for 30 days, or if\nthey have been in &quot;New&quot; status for 90 days.  There are too many\nfixes to list here.  Please consult the GraphicsMagick ChangeLog\nfile, Mercurial repository commit log, and the oss-fuzz issues list\nfor details.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>DPS: Eliminate a memory leak.</li>\n<li>Debug Trace: Only output text to terminate an XML format log file if\nXML format is active.</li>\n<li>EXIF Parser: Detect non-terminal parsing and report an error.</li>\n<li>EXIF Parser: Eliminate heap buffer overflows.</li>\n<li>HuffmanDecodeImage(): Fix heap overflow in 32-bit applications.</li>\n<li>MAT: Implement subimage/subrange support.</li>\n<li>MVG: Address non-terminal loops, excessive run-time, thrown\nassertions, divide-by-zero, heap overflow, and memory leaks.</li>\n<li>OpenModule(): Now properly case-insensitive, as it used to be.</li>\n<li>PCX: Verify that pixel region is not negative. Assure that opacity\nchannel is initialized to opaqueOpacity.  Update DirectClass\nrepresentation while PseudoClass representation is updated.  Improve\nread performance with uncompressed PCX.</li>\n<li>PICT: Fix heap overflow in PICT writer.</li>\n<li>PNG: Fix validation of raw profile length.</li>\n<li>PNG: Skip coalescing layers if there is only one layer.</li>\n<li>PNM: Fix denial of service opportunity by limiting the length of PNM\ncomment text.</li>\n<li>WPG: Avoid Avoid dereferencing a null pointer.</li>\n<li>WPG: Implement subimage/subrange support.</li>\n<li>WPG: Improve performance when reading an embedded image.</li>\n<li>Wand library: In MagickClearException(), destroy any existing\nexception info before re-initializing the exception info or else\nthere will be a memory leak.</li>\n<li>XPM: Rquire that image properties appear in the first 512 bytes of\nthe XPM file header.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>Visual Studio build supports JBIG and WebP compression in TIFF format.</li>\n</ul>\n<p>API Updates:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>Compliles clean using GCC 9.</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>bzlib: bzip is updated to 1.0.8 release.</li>\n<li>jbig: jbigkit is updated to 2.1 release.</li>\n<li>lcms: lcms2 is updated to 2.9 release.</li>\n<li>libxml: libxml2 is updated to 2.9.10 release.</li>\n<li>png: libpng is updated to 1.6.37 release.</li>\n<li>tiff: libtiff is updated to 4.1.0 release.</li>\n<li>webp: libwebp is updated to the 1.0.3 release.</li>\n<li>zlib: zlib is updated to 1.2.11 release.</li>\n<li>TIFF: Now also supports reading JBIG-compressed TIFF, and\nreading/writing WebP-compressed TIFF.  A number of libtiff feature\noptions which are now commonly enabled were disabled and are now\nenabled by default.</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>MinGW: Static and shared library builds were not working.  Only the\nmodules build was actually working!</li>\n<li>Python scripts related to the build (enabled by\n--enable-maintainer-mode) are now compatible with Python 3.</li>\n<li>Now supports using Google gperftools tcmalloc library for the memory\nallocator.  This improves performance for certain repetitive\nwork-loads and heavily-threaded algorithms.</li>\n<li>Configure now reports the status of zstd (FaceBook Zstandard)\ncompression in its configuration summary.</li>\n<li>TclMagick: Address many issues mentioned by SourceForge issue #420\n&quot;TclMagick issues and patch&quot;.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>PNG: Post-processing to convert the image type in the PNG reader\nbased on a specified magick prefix string is now disabled.  This can\n(and should) be done after the image has been returned.</li>\n<li>Trace Logging: The compiled-in logging default is always to stderr,\nwhich may be over-ridden using log.mgk as soon as it is loaded.</li>\n<li>Windows Build: Search registry key HKEY_CURRENT_USER as well as\nHKEY_LOCAL_MACHINE when searching for Ghostscript.  By following the\nprocedure documented in SourceForge bug 615 &quot;GhostScript\ninstallation check&quot;, this allows for local user installations\nwithout &quot;administrator&quot; privileges.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"july-20-2019\">\n<h1><a class=\"toc-backref\" href=\"#id4\">1.3.33 (July 20, 2019)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>It has been discovered that the 'ICU' library (a perhaps 30MB C++\nlibrary) which is now often a libxml2 dependendency causes huge\nprocess initialization overhead.  This is noticed as unexpected\nslowness when GraphicsMagick utilities are used to process small to\nmedium sized files.  The time to initialize is often longer than the\ntime to read the input file, process the image, and write the output\nfile.  If the 'ICU' dependency can not be avoided, then make sure to\nuse the modules build.  Please lobby the 'ICU' library developers to\nchange their implementation to avoid long start-up times due to\nmerely linking with the library.</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>GraphicsMagick is now participating in Google's oss-fuzz project due\nto the contributions and assistance of Alex Gaynor. Since February 4\n2018, 353 issues have been opened by oss-fuzz and 338 of those\nissues have been resolved.  The issues list is available at\n<a class=\"reference external\" href=\"https://bugs.chromium.org/p/oss-fuzz/issues/list\">https://bugs.chromium.org/p/oss-fuzz/issues/list</a> under search term\n&quot;graphicsmagick&quot;.  Issues are available for anyone to view and\nduplicate if they have been in &quot;Verified&quot; status for 30 days, or if\nthey have been in &quot;New&quot; status for 90 days.  There are too many\nfixes to list here.  Please consult the GraphicsMagick ChangeLog\nfile, Mercurial repository commit log, and the oss-fuzz issues list\nfor details.</li>\n<li>Documentation has been added regarding security hazards due to\ncommands which support a <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;filename\">'<span>&#64;</span>filename</a>' syntax.</li>\n<li>MontageImages(): Fix wrong length argument to strlcat() when\nbuilding montage directory, which could allow heap overwrite.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>PNG: Pass correct size value to strlcat() in module registration\ncode.  This bug is noticed to cause problems for Apple's OS X and\nLinux Alpine with musl libc.  This fixes a regression introduced by\nthe 1.3.32 release.</li>\n<li>Re-implement command-line utility <cite>'&#64;'</cite> file inclusion support for\n<cite>-comment</cite>, <cite>-draw</cite>, <cite>-format</cite>, and <cite>-label</cite> which was removed for\nthe 1.3.32 release.  The new implementation is isolated to\ncommand-line utility implementation code rather than being deeply\nembedded in the library and exposed in other usage contexts.  This\nfixes a regression introduced by the 1.3.32 release.</li>\n<li>CAPTION: The The CAPTION reader did not appear to work at all any\nmore.  Now it works again, but still not very well.</li>\n<li>MagickXDisplayImage(): Fix heap overwrite of windows-&gt;image.name and\nwindows-&gt;image.icon_name buffers.  This bug has surely existed since\nearly GraphicsMagick releases.</li>\n<li>MagickXAnimateImages(): Fix memory leak of scene_info.pixels.</li>\n<li>AcquireTemporaryFileDescriptor(): Fix compilation under Cygwin. This\nfixes a regression introduced by the 1.3.32 release.</li>\n<li>PNG: Fix saving to palette when mage has an alpha channel but no\ncolor is marked as transparent.</li>\n<li>Compilation warnings in the Visual Studio WIN64 build due to the\n'long' type being only 32-bits have been addressed.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>API Updates:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>Support for <cite>'&#64;'</cite> file inclusion support for <cite>-comment</cite>, <cite>-draw</cite>,\n<cite>-format</cite>, and <cite>-label</cite> has been restored.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"june-15-2019\">\n<h1><a class=\"toc-backref\" href=\"#id5\">1.3.32 (June 15, 2019)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>It has been discovered that the 'ICU' library (a perhaps 30MB C++\nlibrary) which is now often a libxml2 dependendency causes huge\nprocess initialization overhead.  This is noticed as unexpected\nslowness when GraphicsMagick utilities are used to process small to\nmedium sized files.  The time to initialize is often longer than the\ntime to read the input file, process the image, and write the output\nfile.  If the 'ICU' dependency can not be avoided, then make sure to\nuse the modules build.  Please lobby the 'ICU' library developers to\nchange their implementation to avoid long start-up times due to\nmerely linking with the library.</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>GraphicsMagick is now participating in Google's oss-fuzz project due\nto the contributions and assistance of Alex Gaynor. Since February 4\n2018, 343 issues have been opened by oss-fuzz and 331 of those\nissues have been resolved.  The issues list is available at\n<a class=\"reference external\" href=\"https://bugs.chromium.org/p/oss-fuzz/issues/list\">https://bugs.chromium.org/p/oss-fuzz/issues/list</a> under search term\n&quot;graphicsmagick&quot;.  Issues are available for anyone to view and\nduplicate if they have been in &quot;Verified&quot; status for 30 days, or if\nthey have been in &quot;New&quot; status for 90 days.  There are too many\nfixes to list here.  Please consult the GraphicsMagick ChangeLog\nfile, Mercurial repository commit log, and the oss-fuzz issues list\nfor details.</li>\n<li>BMP reader: Fix heap overflow in 32-bit build due to arithmetic\noverflow. Only happens if limits are changed from defaults.</li>\n<li>BMP reader/writer: Improve buffer-size calculations to guard against\nbuffer overflows.</li>\n<li>DIB reader: Reject files which claim more than 8-bits per pixel but\nalso claim to be colormapped.</li>\n<li>DIB reader/writer: Improve buffer-size calculations to guard against\nbuffer overflows.</li>\n<li>MIFF reader: Detect end of file while reading RLE packets.</li>\n<li>MIFF reader: Fix heap overflow (for some files using RLE\ncompression) caused by a typo in the code.</li>\n<li>MAT writer: Added missing error handling to avoid heap overflow.</li>\n<li>MNG reader: Fixed a small heap buffer overflow.</li>\n<li>SVG reader: Fixed a stack buffer overflow.</li>\n<li>TGA writer: Fix heap overflow when image rows/columns are larger\nthan 65535.</li>\n<li>TIFF reader: Rationalize tile width/height to reject large tile\nsizes which are much larger than the image dimensions.</li>\n<li>TIFF reader: Apply memory resource limits to strip and tile allocations.</li>\n<li>WMF reader: Fixed a division by zero problem.</li>\n<li>XWD reader: Many heap buffer overflows and uses of uninitialized data were fixed.</li>\n<li>Pixel cache: Now apply resource limits to pixel nexus allocations\nusing the same limits (total pixels, width, height, memory) as\napplied to the whole image since some requests are directly\ninfluenced by the input file.  More tests are added for arithmetic\noverflow.  Care was taken to minimize performance impact due to the\nmany extra checks.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>See above note about oss-fuzz fixes.</li>\n<li>Fixed include order of magick/api.h vs wand/wand_symbols.h.</li>\n<li>WriteImage(): Eliminate use of just-freed memory in\nclone_info-&gt;magick when throwing exception due to no support for\nformat.</li>\n<li>Magick++/lib/Magick++/Drawable.h: Fix use of clang diagnostic syntax.</li>\n<li>DIB: Preserve PseudoClass opaque representation if ICO mask is opaque.</li>\n<li>JPEG reader: Restore ability to access detailed image properties\nwhile in 'ping' mode.</li>\n<li>JPEG reader: Base test for &quot;Unreasonable dimensions&quot; on original\nJPEG dimensions and not the scaled dimensions.</li>\n<li>JPEG reader: Allow input files to have a compression ratio as high\nas 2500.  Extremely compressed files were being rejected.</li>\n<li>FreeType renderer: Fixed a memory leak.</li>\n<li>PDF writer: Fixed a memory leak.</li>\n<li>PDF writer: Fixed a thread safety problem.</li>\n<li>PICT reader: Fix a thread safety problem.</li>\n<li>Exception reporting: Throwing an exception was not thread safe.  Now it is.</li>\n<li>Exception reporting: Handle the case where some passed character\nstrings refer to existing exception character strings.</li>\n<li>Command-line parser now does not attempt to read a list of filenames\nfrom a file in <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;name\">'<span>&#64;</span>name</a>' syntax if the path <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;name\">'<span>&#64;</span>name</a>' exists.\nPreviously it would attempt to read a list of file names from 'name'\neven if <a class=\"reference external\" href=\"mailto:'&#37;&#52;&#48;name\">'<span>&#64;</span>name</a>' did exist.</li>\n<li>Rendering: Short-circuit path parsing and return and error\nimmediately if an error occurs.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>Added support for writing the Braille image format (by Samuel\nThibault).</li>\n<li>WebP writer: Support WebP 'use_sharp_yuv' option (&quot;if needed, use\nsharp (and slow) RGB-&gt;YUV conversion&quot;) via <cite>-define\nwebp:use-sharp-yuv=true</cite>.</li>\n<li>The version command output now reports the OpenMP specification\nnumber rather than just the integer version identifier.</li>\n</ul>\n<p>API Updates:</p>\n<ul class=\"simple\">\n<li>ReallocateImageColormap() added to re-allocate an existing colormap.</li>\n<li>Some improperly-exposed globals are now static as they should have\nbeen.</li>\n</ul>\n<p>Feature improvements:</p>\n<ul>\n<li><p class=\"first\">Microsoft Windows timing information now uses\nQueryPerformanceFrequency() and QueryPerformanceCounter() for\nincreased precision.</p>\n</li>\n<li><p class=\"first\">The 'benchmark' command now shows 6 digits (microseconds) of elapsed\ntime indication.</p>\n</li>\n<li><p class=\"first\">The 'time' command now shows 6 digits (microseconds) of elapsed time\nindication.</p>\n</li>\n<li><p class=\"first\">The logging facility now shows 6 digits (microseconds) of time\nresolulution</p>\n</li>\n<li><p class=\"first\">Dcraw: When QuantumDepth is greater than 8, pass -6 option to dcraw\nso that it returns a 16-bit/sample image.</p>\n</li>\n<li><p class=\"first\">Dcraw: If Dcraw supports TIFF format, then request TIFF format in\norder to be able to acquire more metatdata.</p>\n</li>\n<li><p class=\"first\">Scale algorithm: Eliminate artifacts when scaling an image with\nsemi-transparent pixels.</p>\n</li>\n<li><p class=\"first\">Library metrics: The number of shared library relocations and the\namount of initialized data has been signficantly reduced by\nfollowing recommendations from Ulrich Drepper's document <a class=\"reference external\" href=\"https://akkadia.org/drepper/dsohowto.pdf\">How To\nWrite Shared Libraries</a>.</p>\n<p>For comparison, these are the differences in library metrics between\nthe 1.3.31 and 1.3.32 releases for a simple shared library with all\nfeatures supported:</p>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"17%\" />\n<col width=\"25%\" />\n<col width=\"35%\" />\n<col width=\"23%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Release</th>\n<th class=\"head\">Relocations</th>\n<th class=\"head\">Initialized Data</th>\n<th class=\"head\">Total Size</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>1.3.31</td>\n<td>12,432</td>\n<td>506,496</td>\n<td>3,587,227</td>\n</tr>\n<tr><td>1.3.32</td>\n<td>747</td>\n<td>127,936</td>\n<td>3,033,279</td>\n</tr>\n</tbody>\n</table>\n<p>and these are the differences in library metrics between 1.3.31 and\n1.3.32 for a shared library using the modules option (recommended!)\nwith all features supported:</p>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"17%\" />\n<col width=\"25%\" />\n<col width=\"35%\" />\n<col width=\"23%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Release</th>\n<th class=\"head\">Relocations</th>\n<th class=\"head\">Initialized Data</th>\n<th class=\"head\">Total Size</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>1.3.31</td>\n<td>5,370</td>\n<td>176,784</td>\n<td>1,940,620</td>\n</tr>\n<tr><td>1.3.32</td>\n<td>367</td>\n<td>119,472</td>\n<td>1,825,651</td>\n</tr>\n</tbody>\n</table>\n<p>As can be seen, the number of relocations was extreme and has been\nreduced to reasonable levels while also diminishing the amount of\ninitialized data and the total size of the library/program.  Most of\nthe remaining initialized data (106,648 bytes) and some of the\nrelocations (65 relocations) may be attributed to the optional X11\nanimate/display/import support.</p>\n</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>The test suite now passes even if no fonts are found.</li>\n<li>Configure script does better at finding Windows fonts on non-Windows systems.</li>\n<li>The configure script now supports the option --with-mtmalloc to\nenable use of the mtmalloc library as found on Solaris-derived\nsystems.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>AnnotateImage(): No longer implicitly call TranslateText() since\nthis is not suitable for most use-cases and causes additional\nperformance impact.  The API user can perform such translations in\nadvance on the text string using TranslateText() if need be.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"november-17-2018\">\n<h1><a class=\"toc-backref\" href=\"#id6\">1.3.31 (November 17, 2018)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>Firmware and operating system updates to address the Spectre\nvulnerability (and possibly to some extent the Meltdown\nvulnerability) have substantially penalized GraphicsMagick's OpenMP\nperformance.  Performance is reduced even with GCC 7 and 8's\nimproved optimizers. There does not appear to be anything we can do\nabout this.</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>GraphicsMagick is now participating in Google's oss-fuzz project due\nto the contributions and assistance of Alex Gaynor. Since February 4\n2018, 292 issues have been opened by oss-fuzz and 279 of those\nissues have been resolved.  The issues list is available at\n<a class=\"reference external\" href=\"https://bugs.chromium.org/p/oss-fuzz/issues/list\">https://bugs.chromium.org/p/oss-fuzz/issues/list</a> under search term\n&quot;graphicsmagick&quot;.  Issues are available for anyone to view and\nduplicate if they have been in &quot;Verified&quot; status for 30 days, or if\nthey have been in &quot;New&quot; status for 90 days.  There are too many\nfixes to list here.  Please consult the GraphicsMagick ChangeLog\nfile, Mercurial repository commit log, and the oss-fuzz issues list\nfor details.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>See above note about oss-fuzz fixes.</li>\n<li>CINEON: Fix unexpected hang on a crafted Cineon image.  SourceForge\nissue 571.</li>\n<li>Drawing recursion is limited to 100 and may be tuned via the\nMAX_DRAWIMAGE_RECURSION pre-processor definition.</li>\n<li>Fix reading MIFF files using legacy keyword 'color-profile' for ICC\ncolor profile as was used by ImageMagick 4.2.9.</li>\n<li>Fix reading/writing files when 'magick' is specified in lower case.\nThis bug was a regression in 1.3.30.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>TIFF: Support Zstd compression in TIFF.  This requires libtiff\n4.0.10 or later.</li>\n<li>TIFF: Support WebP compression in TIFF.  This requires libtiff\n4.0.10 or later.</li>\n</ul>\n<p>API Updates:</p>\n<ul class=\"simple\">\n<li>MagickMonitor() is marked as deprecated.  Code should not be using\nthis function any more.</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>The progress monitor callbacks (registered using MagickMonitor() or\nMagickMonitorFormatted()) are serialized via a common semaphore\nrather than via critical sections in OpenMP loops.  OpenMP loops are\nupdated to use OpenMP 'atomic' and 'flush' to update shared loop\nvariables rather than using a OpenMP 'critical' construct, reducing\ncontention.  Performance on some targets is observed to have been\nimproved by this change.</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>There was already a 'compare' command installed with the\n'--enable-magick-compat' configure option was used but it did not\nfunction.  Now it functions.  There was no <cite>compare</cite> command in\nImageMagick 5.5.2 and this compare command is only roughly similar\nto a <cite>compare</cite> command in some subsequent ImageMagick release.</li>\n<li>Removed Remove Ghostscript library support (--with-gslib) from\nconfigure script.  The 'HasGS' pre-processor defines which were\nenabled by this remain in the source code so it is still possible to\nuse this library if absolutely necessary (e.g. CPPFLAGS=-DHasGS\nLIBS=-lgs).</li>\n<li>No longer explicitly link with the OpenMP library when it will be\nsupplied already due to CFLAGS.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>JPEG: Libjpeg-turbo is allowed 1/5th the memory resource limit\nprovided for Graphicsmagick via the cinfo-&gt;mem-&gt;max_memory_to_use\noption, which is part of the IJG JPEG API/ABI, but usually not\nsupported there.  This feature works for libjpeg-turbo 1.5.2 and\nlater.  Limiting the memory usage is useful since libjpeg-turbo may\notherwise consume arbitrary amounts of memory even before\nGraphicsmagick is informed of the image dimensions.</li>\n<li>JPEG: The maximum number of JPEG progressive scans is limited to 50.\nOtherwise some technically valid files could be read for almost\nforever.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"june-23-2018\">\n<h1><a class=\"toc-backref\" href=\"#id7\">1.3.30 (June 23, 2018)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>GraphicsMagick is now participating in Google's oss-fuzz project due\nto the contributions and assistance of Alex Gaynor. Since February 4\n2018, 238 issues have been opened by oss-fuzz and 230 of those\nissues have been resolved.  The issues list is available at\n<a class=\"reference external\" href=\"https://bugs.chromium.org/p/oss-fuzz/issues/list\">https://bugs.chromium.org/p/oss-fuzz/issues/list</a> under search term\n&quot;graphicsmagick&quot;.  Issues are available for anyone to view and\nduplicate if they have been in &quot;Verified&quot; status for 30 days, or if\nthey have been in &quot;New&quot; status for 90 days.  There are too many\nfixes to list here.  Please consult the GraphicsMagick ChangeLog\nfile, Mercurial repository commit log, and the oss-fuzz issues list\nfor details.</li>\n<li>SVG/Rendering: Fix heap write overflow of PrimitiveInfo and\nPointInfo arrays.  This is another manefestation of CVE-2016-2317,\nwhich should finally be fixed correctly due to active\ndetection/correction of pending overflow rather than using\nestimation.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>Many oss-fuzz fixes are bug fixes.</li>\n<li>Drawing/Rendering: Many more fixes by Gregory J Wolfe (see the ChangeLog).</li>\n<li>MIFF: Detect end of file while reading image directory.</li>\n<li>SVG: Many more fixes by Gregory J Wolfe (see the ChangeLog).</li>\n<li>The AlphaCompositePixel macro was producing wrong results when the\noutput alpha value was not 100% opaque. This is a regression\nintroduced in 1.3.29.</li>\n<li>TILE: Fix problem with tiling JPEG images because the size request\nused by the TILE algorithm was also causing re-scaling in the JPEG\nreader.  The problem is solved by stripping the size request before\nreading the image.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>API Updates:</p>\n<ul class=\"simple\">\n<li>The size of PrimitiveInfo (believed to be an internal/private\nstructure but in a header which is installed, has been increased to\nstore a 'flags' argument. This is intended to be an internal\ninterface but but may be detected as an ABI change.</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>The oss-fuzz build script (fuzzing/oss-fuzz-build.sh) now includes\nmany delegate libraries such as zlib, libpng, libtiff, libjpeg, and\nfreetype, resulting in more comprehensive testing.  The Q16 build is\nnow being tested rather than the 'configure' default of Q8.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>JPEG: The JPEG reader now allows 3 warnings of any particular type\nbefore giving up on reading and throwing an exception.  This choice\nwas made after observing files which produce hundreds of warnings\nand consume massive amounts of memory before reading the image data\nhas even started.  It is currently unknown how many files which were\npreviously accepted will be rejected by default.  The number of\nallowed warnings may be adjusted using '-define\njpeg:max-warnings=&lt;value&gt;'.  The default limit will be adjusted\nbased on reported user experiences and may be adjusted prior to\ncompilation via the MaxWarningCount definition in coders/jpeg.c.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"april-29-2018\">\n<h1><a class=\"toc-backref\" href=\"#id8\">1.3.29 (April 29, 2018)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>GraphicsMagick is now participating in Google's oss-fuzz project due\nto the contributions and assistance of Alex Gaynor. Since February 4\n2018, 180 issues have been opened by oss-fuzz and 173 of those\nissues have been resolved.  The issues list is available at\n<a class=\"reference external\" href=\"https://bugs.chromium.org/p/oss-fuzz/issues/list\">https://bugs.chromium.org/p/oss-fuzz/issues/list</a> under search term\n&quot;graphicsmagick&quot;.  Issues are available for anyone to view and\nduplicate if they have been in &quot;Verified&quot; status for 30 days, or if\nthey have been in &quot;New&quot; status for 90 days.  There are too many\nfixes to list here.  Please consult the GraphicsMagick ChangeLog\nfile, Mercurial repository commit log, and the oss-fuzz issues list\nfor details.</li>\n<li>JNG: Require that the embedded JPEG image have the same dimensions\nas the JNG image as provided by JHDR. Avoids a heap write overflow.</li>\n<li>MNG: Arbitrarily limit the number of loops which may be requested by\nthe MNG LOOP chunk to 512 loops, and provide the '-define\nmng:maximum-loops=value' option in case the user wants to change the\nlimit.  This fixes a denial of service caused by large LOOP\nspecifications.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>Many oss-fuzz fixes are bug fixes.</li>\n<li>DICOM: Pre/post rescale functions are temporarily disabled (until\nthe implementation is fixed).</li>\n<li>JPEG: Fix regression in last release in which reading some JPEG\nfiles produces the error &quot;Improper call to JPEG library in state\n201&quot;.</li>\n<li>ICON: Some DIB-based Windows ICON files were reported as corrupt to\nan unexpectedly missing opacity mask image.</li>\n<li>In-memory Blob I/O: Don't implicitly increase the allocation size\ndue to seek offsets.</li>\n<li>MNG: Detect and handle failure to allocate global PLTE. Fix divide\nby zero.</li>\n<li>DrawGetStrokeDashArray(): Check for failure to allocate memory.</li>\n<li>BlobToImage(): Now produces useful exception reports to cover the\ncases where 'magick' was not set and the file format could not be\ndeduced from its header.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>API Updates:</p>\n<ul class=\"simple\">\n<li>Wand API: Added MagickIsPaletteImage(), MagickIsOpaqueImage(),\nMagickIsMonochromeImage(), MagickIsGrayImage(), MagickHasColormap()\nbased on contributions by Troy Patteson.</li>\n<li>New structure ImageExtra added and Image 'clip_mask' member is\nreplaced by 'extra' which points to private ImageExtra allocation.\nThe ImageGetClipMask() function now provides access to the clip mask\nimage.</li>\n<li>New structure DrawInfoExtra and DrawInfo 'clip_path' is replaced by\n'extra' which points to private DrawInfoExtra allocation.  The\nDrawInfoGetClipPath() function now provides access to the clip path.</li>\n<li>New core library functions: GetImageCompositeMask(),\nCompositeMaskImage(), CompositePathImage(), SetImageCompositeMask(),\nImageGetClipMask(), ImageGetCompositeMask(), DrawInfoGetClipPath(),\nDrawInfoGetCompositePath()</li>\n<li>Deprecated core library functions: RegisterStaticModules(),\nUnregisterStaticModules().</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>Static modules (in static library or shared library without\ndynamically loadable modules) are now lazy-loaded using the same\nexternal interface as the lazy-loader for dynamic modules.  This\nresults in more similarity between the builds and reduces the fixed\ninitialization overhead by only initializing the modules which are\nused.</li>\n<li>SVG: The quality of SVG support has been significantly improved due\nto the efforts of Greg Wolfe.</li>\n<li>FreeType/TTF rendering: Rendering fixes for opacity.</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</div>\n<div class=\"section\" id=\"january-20-2018\">\n<h1><a class=\"toc-backref\" href=\"#id9\">1.3.28 (January 20, 2018)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>BMP: Fix non-terminal loop due to unexpected bit-field mask value\n(DOS opportunity).</li>\n<li>PALM: Fix heap buffer underflow in builds with QuantumDepth=8.</li>\n<li>SetNexus() Fix heap overwrite under certain conditions due to using\na wrong destination buffer.  This issue impacts all 1.3.X releases.</li>\n<li>TIFF: Fix heap buffer read overflow in LocaleNCompare() when parsing\nNEWS profile.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>DescribeImage(): Eliminate possible use of null pointer.</li>\n<li>GIF: Fix memory leak of global colormap in error path.</li>\n<li>GZ: Writing to gzip files with the extension &quot;.gz&quot; was not working\nwith Zlib 1.2.8.</li>\n<li>JNG: Fix buffer read overflow (a tiny fixed overflow of just one byte).</li>\n<li>JPEG: Promoting certain libjpeg warnings to errors caused much more\nproblems than expected.  The promotion of warnings to errors is\nremoved.  Claimed pixel dimensions are validated by file size before\nallocating memory for the pixels.</li>\n<li>IntegralRotateImage(): Assure that reported error in rotate by 270\ncase does immediately terminate processing.</li>\n<li>MNG: Fix possible null pointer reference related to DEFI chunk\nparsing.  Fix minor heap read overflow (constrained to just one\nbyte) due to an ordering issue in a limit check.  Fix memory leaks\nin error path.</li>\n<li>WebP: Fix stack buffer overflow in WriteWEBPImage() which occurs\nwith libwebp 0.5.0 or newer due to a structure type change in the\nstructure passed to the progress monitor callback.</li>\n<li>WPG: Memory leaks fixed.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>API Updates:</p>\n<ul class=\"simple\">\n<li>InterpolateViewColor(): This function now returns MagickPassFail (an\nunsigned int) rather than void so that errors can be efficiently\nreported.</li>\n<li>The magick/pixel_cache.h header is updated to add deprecation\nattributes such that code using GetPixels(), GetIndexes(), and\nGetOnePixel() will produce deprecation warnings for compilers which\nsupport them.  These functions will not be removed in the 1.3.X\nrelease series and when they are removed, pre-processor macros will\nbe added so a replacement function is used instead.  There is a\nlong-term objective to eliminate functionally-redundant pixel cache\nfunctions to only the ones with the best properties since this\nreduces maintenance and may reduce the depth of the call stack\n(improving performance).</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>PerlMagick: Sanitize PACKAGE_VERSION so that Perl is not confused by\nany trailing alpha character.</li>\n<li>Improved symbol renaming due to adding --enable-symbol-prefix.  Some\nsymbols (for static const strings) were not being included in the\nrenaming.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</div>\n<div class=\"section\" id=\"december-9-2017\">\n<h1><a class=\"toc-backref\" href=\"#id10\">1.3.27 (December 9, 2017)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>CMYK: Fix heap overwrites in raw CMYK writer.  Fix heap overwrites\nin raw CMYK reader (noticed when doing montage).</li>\n<li>GIF: Assure that global colormap is initialized.</li>\n<li>DescribeImage(): Fix possible heap write overflow when describing\nvisual image directory. Fix possible heap read overflow while\naccessing heap data, and possible information disclosure while\ndescribing the IPTC profile.</li>\n<li>DICOM: Fix huge memory allocation based on bogus length value (DOS\nopportunity).</li>\n<li>DrawDashPolygon(): Fix heap out of bounds read in render code.</li>\n<li>GRAY: Fix heap overwrites in raw GRAY reader (noticed when doing\nmontage).</li>\n<li>JNG: Fix heap overruns.  Fix assertions.</li>\n<li>JNG: Prevent a crash due to zero-length color_image while reading a\nJNG image. (CVE-2017-11102).  Reject JNG files with unreasonable\ndimensions given the file size (avoid DOS).</li>\n<li>JNX: Fix DOS due to excessive memory allocations with corrupt file.</li>\n<li>JPEG: Do not allocate backing image pixels until a scanline has been\nsuccessfully read.  Avoids DOS opportunity with suitably\nmanufactured file.</li>\n<li>MAP: Fix null pointer dereference or segmentation violation.</li>\n<li>MAT: Fix heap write overflow.</li>\n<li>MNG: Reject over-large (65k by 65k) image.  Fix heap overwrites.</li>\n<li>PAM: Fix heap buffer overflow in PAM writer for 1 bit/sample + alpha.</li>\n<li>PICT: Fix excessive memory allocation due to malformed image file.</li>\n<li>PNG: Fix heap buffer overflow in PNG writer when promoting from\nindexed PNG to RGBA.</li>\n<li>PNM: Fix DOS due to excessive memory allocations with corrupt file.</li>\n<li>RGB: Fix heap overwrite in raw RGB writer. Fix heap overwrites in\nraw RGB reader (noticed when doing montage).</li>\n<li>RLE: Fix DOS opportunities due to false claims in image header.  Fix\nheap out of bounds read.</li>\n<li>SFW: Avoid possible heap write overflow.</li>\n<li>SUN: Fix heap read overflow.  Fix DOS due to excessive memory\nallocations with corrupt file.</li>\n<li>SVG: Fix heap write overflow.</li>\n<li>TIFF: Use heuristics to avoid DOS (excessive memory use) due to\nfalse claims by input file.  It is possible that this may reject\nsome valid files.  Fix possible small heap overwrite beyond the\nallocated scanline buffer due to the NumberOfObjectsInArray() macro\nrounding up rather than down.</li>\n<li>UIL: Fix heap overwrite in writer.</li>\n<li>WPG: Fix DOS issues (memory, disk space, CPU time) due to\ninsufficient validations.  Fix heap overwrites.</li>\n<li>XBM: Fix DOS issue where code remains stuck in loop and does not\nreturn.</li>\n<li>XV 332 (PNM): Fix null pointer dereference due to malformed file.</li>\n<li>TracePSClippingPath()/TraceSVGClippingPath(): Fix heap out of bounds\nread.</li>\n<li>Validate path entries in the MAGICK_CODER_MODULE_PATH and\nMAGICK_FILTER_MODULE_PATH environment variables and convert all\npaths to real paths if possible. This avoids possible use of\nrelative paths to load modules (a possible security issue), or the\npossibility of adding a directory which was in the path, but\nmissing, and may improve efficiency by removing non-existent paths.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>AVS: Memory leaks eliminated.</li>\n<li>CINEON: Fix possible use of NULL pointer.</li>\n<li>CMYK: Memory leaks eliminated.</li>\n<li>CUT: Memory leaks eliminated.  Fix possible use of NULL pointer.</li>\n<li>DCM: Fix possible use of NULL pointer.</li>\n<li>DrawImage(): Avoid &quot;negative&quot; strncpy().  This seems to be benign\nwith glibc but perhaps not with other implementations.</li>\n<li>DPX: Memory leaks eliminated.</li>\n<li>EMF: Fix possible use of NULL pointer.</li>\n<li>FindMagickModule(): Fix possible use of NULL pointer.</li>\n<li>FITS: Fix memory leak.</li>\n<li>GIF: Fix memory leak.</li>\n<li>HDF: Memory leaks eliminated.</li>\n<li>HISTOGRAM: Fix memory leak.</li>\n<li>JNG: Memory leaks eliminated. Memory use after free and double-free\nissues eliminated.  Error reporting fixes.</li>\n<li>Magick::Options::strokeDashArray(): Fix possible use of NULL pointer.</li>\n<li>MagickXFileBrowserWidget(): Fix possible use of NULL pointer.</li>\n<li>MAT: Memory leaks eliminated.</li>\n<li>MagickMapCloneMap(): Fix possible assertion failure.</li>\n<li>MNG: Memory use after free issues eliminated.  Fix possible use of\nNULL pointer.  Fix memory leaks.</li>\n<li>MontageImageCommand(): Fix memory leaks.</li>\n<li>MPC: Fix memory leak in writer.</li>\n<li>MPEG: Fix memory leaks in writer.</li>\n<li>MTV: Memory leaks eliminated.</li>\n<li>NTRegistryKeyLookup(): Fix possible use of NULL pointer.</li>\n<li>NTGetTypeList(): Fix possible use of NULL pointer.</li>\n<li>PCD: Memory leaks eliminated.</li>\n<li>PCL: Fix null pointer dereference in PCL writer.</li>\n<li>PCX: Memory leaks eliminated.</li>\n<li>PALM: Fix possible use of NULL pointer. Fix memory leak.</li>\n<li>PICT: Memory leaks eliminated.</li>\n<li>PNG: Fix small (one-off) heap read overflow.</li>\n<li>PNM: Fix memory leaks.</li>\n<li>PS: Fix use of null pointer in error path.</li>\n<li>PWP: Fix possible use of null pointer.</li>\n<li>ReplaceImageColormap(): Throw an exception rather than assertion if\nthe input image is not colormapped.</li>\n<li>RGB: Fix memory leak.</li>\n<li>SegmentImage(): Fix possible use of NULL pointer.</li>\n<li>SetImageProfile(): Fix possible assertion failure.</li>\n<li>SGI: Check for EOF while reading SGI file header.</li>\n<li>SUN: Fix memory leak.</li>\n<li>TIFF: Fix possible use of NULL pointer.  Fix memory leaks in writer.</li>\n<li>TIM: Fix memory leak.</li>\n<li>TOPOL: Fix possible use of NULL pointer.  Fix memory leaks.</li>\n<li>VIFF: Fix memory leak.</li>\n<li>WEBP: Detect partial write to output file.</li>\n<li>WPG: Fix possible use of null pointer. Fix excessive use of disk\nresources due to insufficient validations.</li>\n<li>WriteImage(): Restore use of GetBlobStatus() to test if an I/O error\nwas encountered while writing output file. This assures that I/O\nfailure in writers which do not themselves verify writes is assured\nto be reported.</li>\n<li>WMF: Memory use after free issues eliminated.</li>\n<li>YUV: Fix memory leaks.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>PNG: Implemented eXIf chunk support.</li>\n<li>WEBP: Add support for EXIF and ICC metadata provided that at least\nlibwebp 0.5.0 is used.</li>\n<li>Magick++ Image autoOrient(): New Image method to auto-orient an\nimage so it looks right-side up by default.</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>Libtiff is updated to libtiff 4.0.9.</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>JPEG/PNG: The SETJMP_IS_THREAD_SAFE definition is used to determine\nif setjmp/longjmp are thread safe.  If these interfaces are thread\nsafe, then concurrent reads/writes are possible.  This definition is\nfalse for Solaris but true for Linux.  JPEG and PNG will be fully\nconcurrent if this definition is enabled.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>PALM: PALM writer is disabled.</li>\n<li>ThrowLoggedException(): Capture the first exception at\nErrorException level or greater, or only capture exception if it is\nmore severe than an already reported exception.</li>\n<li>DestroyJNG(): This internal function is now declared static and is\nremoved from shared library or DLL namespace.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"july-4-2017\">\n<h1><a class=\"toc-backref\" href=\"#id11\">1.3.26 (July 4, 2017)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>DPX: Fix excessive use of memory (DOS issue) due to file header\nclaiming large image dimensions but insufficient backing\ndata. (CVE-2017-10799).</li>\n<li>JNG: Fix memory leak when reading invalid JNG image (CVE-2017-8350).</li>\n<li>MAT: Fix excessive use of memory (DOS issue) due to continuing\nprocessing with insufficient data and claimed large image\nsize. Verify each file extent to make sure that it is within range\nof file size. (CVE-2017-10800).</li>\n<li>META: Fix heap overflow while parsing 8BIM chunk (CVE-2016-7800).</li>\n<li>PCX: Fix denial of service issue.</li>\n<li>RLE: Fix abnomally slow operation (denial of service issue) with\nintentionally corrupt colormapped file.</li>\n<li>PICT: Fix possible buffer overflow vulnerability given suitably\ntruncated input file.</li>\n<li>PNG: Enforce spec requirement that the dimensions of the JPEG\nembedded in a JDAT chunk must match the JHDR dimensions\n(CVE-2016-9830).</li>\n<li>PNG: Avoid NULL dereference when MAGN chunk processing fails.</li>\n<li>SCT: Fix stack-buffer read overflow (underflow?) while reading SCT\nheader.</li>\n<li>SGI: Fix denial of service issues.  Delay large memory allocations\nuntil file header has fully passed sanity checks.</li>\n<li>TIFF: Fix out of bounds read when reading CMYKA TIFF which claims to\nhave only 2 samples per pixel (CVE-2017-6335).</li>\n<li>TIFF: Fix out of bounds read when reading RGB TIFF which claims to\nhave only 1 sample per pixel (CVE-2017-10794).</li>\n<li>WPG: Fix heap overflow (CVE-2016-7996).  Fix assertion crash\n(CVE-2016-7997).</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>DifferenceImage(): Fix Fix all-black difference image if an input\nfile is colormapped.</li>\n<li>EXIF orientation was not being properly detected for some files.</li>\n<li>-frame: The <cite>import</cite> command -frame handling was improperly\nimplemented and was using already freed data.</li>\n<li>GIF: Fixes for &quot;Excessive LZW string data&quot; problem.</li>\n<li>Magick++: Bug fixes to PathSmoothCurvetoRel::operator() and\nPathSmoothCurvetoRel::operator().</li>\n<li>PAM: Support writing GRAYSCALE PAM format.</li>\n<li>PNG: Fix memory leaks.</li>\n<li>SVG: Fixed a memory leak.  Fixed a possible null pointer dereference.</li>\n<li>TclMagick: Problem that TkMagick could not resolve functions from\nTclMagick under Linux is fixed.</li>\n<li>TclMagick: Fix parser validatation in magickCmd() to avoid crash\ngiven a syntax error.</li>\n<li>TIFF: Fix for reading old JPEG files (avoids &quot;Improper call to JPEG\nlibrary in state 0. (LibJpeg).&quot;).</li>\n<li>TXT: Fixed memory leak.</li>\n<li>XCF: Error checking is improved.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>EXIF rotation: Support is added such that the EXIF orientation tag\nis updated when the image is rotated.</li>\n<li>MAT: Now support reading multiple images from Matlab V4 format.</li>\n<li>Magick++: Orientation method now updates orientation in EXIF\nprofile, if it exists.</li>\n<li>Magick++: Added Image attribute method which accepts a character\npointer argument, and will remove the attribute if the value\nargument is NULL.</li>\n<li>-orient: The -orient command line option now also updates the\norientation in the EXIF profile, if it exists.</li>\n<li>PGX: Support PGX JPEG 2000 format for reading and writing (within\nthe bounds of what JasPer supports).</li>\n<li>Wand API: Added MagickAutoOrientImage(),\nMagickGetImageOrientation(), MagickSetImageOrientation(),\nMagickRemoveImageOption(), and MagickClearException().</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>TIFF: Updated to libtiff 4.0.8.</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>TclMagick: Updated configure to use latest TEA tcl.m4 version 3.10.\nSupport for AM_DISTCHECK_CONFIGURE_FLAGS so that 'make distcheck'\nremembers configuration options, and also to uninstall pkgIndex.tcl.</li>\n<li>VisualMagick Configure: A 'quantum' command line argument is added\nto set the default quantum depth in the wizard drop-down list.  This\nThis allows setting the quantum depth when the /nowizard argument\nwas supplied.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>The installer for the Windows build no longer includes IMDisplay\n(simple display program), ImageMagickDLL, and PerlMagick for\nActiveState Perl.  These are still available to build from the\nsource tree.  All of these depend on proprietary components.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"september-5-2016\">\n<h1><a class=\"toc-backref\" href=\"#id12\">1.3.25 (September 5, 2016)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>EscapeParenthesis(): I was notified by Gustavo Grieco of a heap\noverflow in EscapeParenthesis() used in the text annotation code.\nWhile not being able to reproduce the issue, the implementation of\nthis function is completely redone.  This issue was assigned\nCVE-2016-7447 after the release.</li>\n<li>Utah RLE: Reject truncated/absurd files which caused huge memory\nallocations and/or consumed huge CPU.  Problem was reported by\nAgostino Sarubbo based on testing with AFL.  This issue was assigned\nCVE-2016-7448 after the release.</li>\n<li>SVG/MVG: Fix another case of CVE-2016-2317 (heap buffer overflow) in\nthe MVG rendering code (also impacts SVG).  This issue (remaining\npart) was assigned CVE-2016-7446 after the release.</li>\n<li>TIFF: Fix heap buffer read overflow while copying sized TIFF\nattributes.  Problem was reported by Agostino Sarubbo based on\ntesting with AFL.  This issue was assigned CVE-2016-7449 after the\nrelease.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>GetToken(): Fix obscure bug (read beyond end of string buffer)\nnoticed while parsing a MVG file.  This problem was reported by\nGustavo Grieco.</li>\n<li>MVG rendering: Fix undesired hard errors when some objects were\ndrawn outside of the image bounds.  Requests to draw objects\nentirely outside of the image should be silently ignored.</li>\n<li>MVG/SVG rendering: Fix gradient size sanity checks which were\ncausing gradient requests to fail.  Due to a design weakness in that\ngradient images allocate resources rather than being computations at\npoint of use, the maximum gradient image size is now hard-limited to\n5000x5000 pixels until the design problem is fixed.  Some SVG icons\n(as small as 8x8 pixels) authored using Inkscape request absurdly\nhuge gradients.  Gradient sizes as large as 20,000x20,000 have been\nobserved in SVG icon files delivered by packages on an Ubuntu Linux\nsystem.</li>\n<li>SVG: Fix some memory leaks which occur on parsing error.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>ElapsedTime(): Use clock_gettime() (when available with default\nlinkage) to obtain elapsed time.</li>\n<li>DescribeImage(): Provide 6 digits of seconds precision in in elapsed\ntime output.  Previously the resolution was rounded up to a full\nsecond.</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>webp: Updated bundled libwebp to release 0.5.1.</li>\n<li>libxml: Updated bundled libxml2 to release 2.9.4.</li>\n<li>lcms: Updated bundled lcms2 to release 2.8.</li>\n<li>png: Update bundled libpng to release 1.6.24.</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>OpenMP is properly configured for clang 3.8 using its own '-lomp'\nrather than '-lgomp'.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>SVG: Some SVG files may be rejected due to absurdly large gradient\nrequests.</li>\n<li>The 'identify' and 'info' functionality only shows the pixel read\nrate if image was not read in 'ping' mode. Provide 6 digits of\nseconds precision in in elapsed time output.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"may-30-2016\">\n<h1><a class=\"toc-backref\" href=\"#id13\">1.3.24 (May 30, 2016)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>A shell exploit (CVE-2016-5118) was discovered associated with a\nfilename syntax where file names starting with '|' are intepreted as\nshell commands executed via popen().  Insufficient sanitization in\nthe SVG and MVG renderers allows such filenames to be passed through\nfrom potentially untrusted files.  There might be other ways for\nuntrusted inputs to produce such filenames.  Due to this issue,\nsupport for the feature is removed entirely.</li>\n<li>A shell exploit was discovered associated with the gnuplot delegate\nand which is triggered by the 'gplt' entry in delegates.mgk.  A\nremote exploit is possible if the attacker can cause a provided SVG\nor MVG file to be rendered (or the user opens a provided file).  The\ngnuplot program must be installed in order for the exploit to be\nsuccessful.  It is strongly recommended to remove this entry in all\ndelegates.mgk files.</li>\n<li>Due to <a class=\"reference external\" href=\"http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53967\">GCC bug 53967</a>, several key agorithms (e.g. convolution)\nmay execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\nenabled for floating point math (<cite>-mfpmath=sse</cite>) if the GCC option\n<cite>-frename-registers</cite> is used. Default 32-bit builds do not\nexperience the problem since they use '387 math.  It is not clear in\nwhat version of GCC this problem started but it was not noticed by\nthe developers until the GCC 4.6 timeframe.  Other compilers do not\nsuffer from this bug.  Please lobby the GCC project to fix this\nembarrassing performance bug.</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>BLOB: Remove support for reading input from a shell command, or\nwriting output to a shell command, by prefixing the specified\nfilename (containing the command) with a '|'.  This feature provided\na remote shell execution opportunity.</li>\n<li>DIB: Fixed out of bounds reads.  Added more header validations.</li>\n<li>JNG: File size limits are enforced.</li>\n<li>MAT: Fixed denial of service opportunity.  Fix hang on corrupt deflate stream.</li>\n<li>META: Fixed out of bounds reads and writes.</li>\n<li>MIFF: Fixed thrown assertion.</li>\n<li>MSL: Ignore the file extension on MSL files.  It is necessary to add\na &quot;msl:&quot; prefix to MSL files to read the as an image.</li>\n<li>MVG: No longer assume that files ending with extension &quot;.mvg&quot; are\nMVG files.  MVG parsing does more validity checking on its input.\nAssure that enough PrimitiveInfo structures are allocated in advance\nto support a given vector path (heap overflow problem).</li>\n<li>PCX: Fixed unreasonable memory allocation due to intentionally\ncorrupt file.</li>\n<li>PDB: Fixed a heap buffer overflow and out of bounds read.</li>\n<li>PICT: Fixed an out of bounds write.</li>\n<li>PS: Ghostscript is now always run with -dSAFER for safer execution.</li>\n<li>PSD: Fixed segmentation violations, heap buffer overflows, and out\nof bounds writes.</li>\n<li>RLE: Fixed out of bounds reads and writes.</li>\n<li>ReadImages(): Fixed a possible infinite recursion due to a crafted input file.</li>\n<li>RotateImage(): Fixed thrown assertion.</li>\n<li>SGI: Fixed out of bounds writes.</li>\n<li>SUN: Fixed out of bounds reads and writes.</li>\n<li>SVG: Fixed heap and stack buffer overflows, as well as segmentation\nviolations (CVE-2016-2317 and CVE-2016-2318).  Also fixed endless\nloop, unexpectedly large memory allocation, divide by zero, and\nrecursion issues.</li>\n<li>TIFF: Fixed an assertion while reading.  Fixed benign heap overflow.</li>\n<li>TMP: Adding a &quot;tmp:&quot; prefix to a filename no longer removes the file\nsince this seems dangerous.</li>\n<li>VIFF: Fix excessive memory allocation with intentionally corrupted input file.</li>\n<li>XCF: Fixed a heap buffer overflow.</li>\n<li>XPM: Fixed several heap buffer overflows, and out of bound\nreads/writes.  Also fixed a case of excessive memory allocation.</li>\n<li>delegate.mgk: The default delegate.mgk file has been pared down in\norder to reduce security exposure.</li>\n<li>gnuplot ('gplt' delegate in delegates.mgk): Support for rendering\ngnuplot files is removed since the format is inherently insecure.</li>\n<li>File names: File names starting with a '|' character are no longer\ninterpreted as shell commands to be executed as input or output.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>BMP: Fix reading 24-bit Microsoft BMP which claims to have a\ncolormap.</li>\n<li>FILE: <cite>file://</cite> URLs are properly supported now (they never worked\nbefore).</li>\n<li>JP2: It is now possible to write lossless JPEG 2000 &quot;JP2&quot; format.</li>\n<li>SVG: Support font-size &quot;medium&quot;.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>Blob I/O C APIs: Added signed versions of short and long Read/Write\nfunctions.</li>\n<li>FILE: <cite>file://</cite> URLs are properly supported now (they never worked\nbefore).</li>\n<li>MAT: Matlab V4 is now partially supported.</li>\n<li>Magick++: Added double-precision xResolution() and yResolution()\nmethods to support setting the horizontal and vertical resolution\nwith double floating point precision.</li>\n<li>Mogrify now supports a -preserve-timestamp option to preserve file\naccess and modification timestamps.</li>\n</ul>\n<p>Feature improvements:</p>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>Updated bundled libpng to release 1.6.19.</li>\n<li>Updated bundled libwebp to release 0.4.4.</li>\n<li>Update bundled libxml2 to release 2.9.3.</li>\n<li>Update bundled freetype to release 2.6.2.</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>Added <tt class=\"docutils literal\"><span class=\"pre\">--enable-broken-coders</span></tt> configure option to enable file\nformat support which may be broken or cause security issues.  The\nPSD format is now classified as &quot;broken&quot; (until it is fixed).</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>PSD format is not included in the build by default.</li>\n<li>Files ending with &quot;.mvg&quot; and &quot;.msl&quot; are not assumed to be image\nfiles by default.</li>\n<li>File names starting with '|' are no longer treated as shell\ncommands.</li>\n<li>Gnuplot and POV delegate support is removed from the default\ndelegate.mgk file.</li>\n</ul>\n</div>\n<div class=\"section\" id=\"november-7-2015\">\n<h1><a class=\"toc-backref\" href=\"#id14\">1.3.23 (November 7, 2015)</a></h1>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>Due to <a class=\"reference external\" href=\"http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53967\">GCC bug 53967</a>, several key agorithms (e.g. convolution)\nmay execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\nenabled for floating point math (<cite>-mfpmath=sse</cite>) if the GCC option\n<cite>-frename-registers</cite> is used. Default 32-bit builds do not\nexperience the problem since they use '387 math.  It is not clear in\nwhat version of GCC this problem started but it was not noticed by\nthe developers until the GCC 4.6 timeframe.  Other compilers do not\nsuffer from this bug.  Please lobby the GCC project to fix this\nembarrassing performance bug.</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>ScaleImage(): While not strictly a security issue, requesting to\nscale an image while retaining the original number of rows will lead\nto a program crash or memory corruption due to double-free.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>ScaleImage(): Fix problem with new width/height match original\n(regression added by 1.3.22).</li>\n<li>ScaleImage(): Fix double-free when new rows matches original rows\n(regression added by 1.3.22).</li>\n<li>MinGW build fix related to eliminating a sleep() macro which\nconflicts with a MinGW-provided inline sleep() function.</li>\n<li>PNG: Issue a warning instead of an error when attempting to read a\nPNG file containing a zero-length profile.  This allows the file to\nbe read.</li>\n<li>identify: Fix problem in that <cite>identify -format &quot;%A&quot;</cite> (to test if\ntransparency is supported in image) does not always produce the\ncorrect results.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n<p>Performance Improvements:</p>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>Configure: Removed CFLAGS and LDFLAGS deduplication code which\ncaused problems for user-provided CFLAGS and LDFLAGS which added and\nthen removed compiler/linker options.  Specifically, this fixes a\nproblem with creating OS X universal builds.</li>\n<li>Configure: Add tests for 'ps2write' and 'eps2write' which are\navailable in recent Ghostscript.</li>\n</ul>\n<p>Behavior Changes:</p>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</div>\n<div class=\"section\" id=\"october-4-2015\">\n<h1><a class=\"toc-backref\" href=\"#id15\">1.3.22 (October 4, 2015)</a></h1>\n<p>Thanks:</p>\n<ul class=\"simple\">\n<li>Coverity: We thank Coverity for providing free service for free\nsoftware projects, and thank Jodie Cunningham for getting the\nproject set up in Coverity.</li>\n</ul>\n<p>Special Issues:</p>\n<ul class=\"simple\">\n<li>Due to <a class=\"reference external\" href=\"http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53967\">GCC bug 53967</a>, several key agorithms (e.g. convolution)\nmay execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\nenabled for floating point math (<cite>-mfpmath=sse</cite>) if the GCC option\n<cite>-frename-registers</cite> is used. Default 32-bit builds do not\nexperience the problem since they use '387 math.  It is not clear in\nwhat version of GCC this problem started but it was not noticed by\nthe developers until the GCC 4.6 timeframe.  Other compilers do not\nsuffer from this bug.  Please lobby the GCC project to fix this\nembarrassing performance bug.</li>\n<li>Magick++: Any libraries or applications using Magick++ should be\nrebuilt in order to use this new release.  Libraries and\napplications will be able to continue to use prior versions of\nMagick++ without being re-built, while benefiting from updated C\nlibraries, provided that the system supports library versioning.</li>\n</ul>\n<p>Security Fixes:</p>\n<ul class=\"simple\">\n<li>General Coverity fixes.  Some might have security consequences.</li>\n<li>Ghostscript options concatenation is more secure against buffer\noverflow.</li>\n<li>Windows: Built-in random number generator is now salted using\nCryptGenRandom().  This improves the robustness of the temporary\nfile allocator.</li>\n</ul>\n<p>Bug fixes:</p>\n<ul class=\"simple\">\n<li>Coverity Fixes: Large amounts of fixes due to Coverity static\nanalysis.  See the ChangeLog and Mercurial for details. Coverity now\nreports zero issues.</li>\n<li>General: Fix problems with reading filenames that include a colon.</li>\n<li>General: Fixed performance problem with sub-image path extraction\nwhen there are many files in the directory.</li>\n<li>General: Add missing options in utility help messages.</li>\n<li>BMP: Reader was wrongly rejecting RLE-compressed files as being too\nsmall (regression added in 1.3.21 release).</li>\n<li>BMP: Fix inverted alpha channel when writing BGRA8888 format.</li>\n<li>DrawAffineImage(): Fix problem with negative x offset.</li>\n<li>DrawAffineImage(): Fix problem that sometimes output rows are skipped when using OpenMP.</li>\n<li>EXIF: Properly validate GPS_OFFSET.</li>\n<li>-format: %Q now reports JPEG quality estimate if it is available.</li>\n<li>-geometry: Fix handling of area geometries in the form &quot;5000000&#64;&quot;.</li>\n<li>MagickGetImageGravity(): Prototype was missing in header files.</li>\n<li>MIFF: Memory leak fixes.</li>\n<li>MIFF: MIFF reader failed to read some MIFF headers properly.</li>\n<li>MIFF: Detect buffer overrun attempt while reading zip compressed data.</li>\n<li>PDF: Set image frame scene ids appropriately.</li>\n<li>PNG: Memory leak fixes.</li>\n<li>PS: Set image frame scene ids appropriately.</li>\n<li>PTIF: Mark reduced frames as SubfileType 0x2 instead of 0x1.</li>\n<li>SetImageProfile(): Avoid crash given NULL profile pointer.</li>\n<li>TIFF: Fix reading Old JPEG and YCbCr sample images from libtiff\npics-3.8.0.tar.gz image file collection.</li>\n<li>TIFF: Disable matte channel for compression types which don't\nsupport it.</li>\n<li>XPM: Memory leak fixes.</li>\n<li>XWD: Memory leak fixes.</li>\n</ul>\n<p>New Features:</p>\n<ul class=\"simple\">\n<li>GRAYA: New subformat for gray coder which supports alpha channel.\nFormat specifiers &quot;R&quot;, &quot;G&quot;, &quot;B&quot;, &quot;A&quot;, &quot;C&quot;, &quot;M&quot;, and &quot;Y&quot; may now be\nused to save and restore the associated channel using the same raw\nformat as &quot;GRAY&quot;.</li>\n<li>Magick++: Image::repage() method added to support resetting 'page'.</li>\n<li>PDF: Added '-define pdf:stop-on-error=true' optoin to cause PDF\nreading to quit immediately upon any error.</li>\n<li>Subframe specification: Now specific PS and PDF pages may be\nselected, including re-ordering.</li>\n</ul>\n<p>Feature improvements:</p>\n<ul class=\"simple\">\n<li>PALM: Still a work in progress.  Closer to working using netpbm's\nimplementation as a reference.</li>\n</ul>\n<p>Performance Improvements:</p>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n<p>Windows Delegate Updates/Additions:</p>\n<ul class=\"simple\">\n<li>dcraw: Update bundled dcraw to release 9.26.0.</li>\n<li>lcms: Update bundled lcms2 to release 2.7.</li>\n<li>png: Updated bundled libpng to release 1.6.17.</li>\n<li>tiff: Update bundled libtiff to release 4.0.6.</li>\n<li>ttf: Update bundled freetype to release 2.6.</li>\n<li>webp: Updated bundled libwebp to release 0.4.3.</li>\n<li>libxml: Update bundled libxml2 to release 2.9.2.</li>\n</ul>\n<p>Build Changes:</p>\n<ul class=\"simple\">\n<li>lcms (&quot;Little CMS&quot;) v1 is no longer supported.</li>\n<li>VisualMagick: Remember and re-use already given paths.</li>\n</ul>\n<p>Behavior Changes:</p>\n<p>Magick++: adaptiveThreshold() now accepts a 'double' value and the\nprevious version of the method (using 'unsigned int') is deprecated.\nThe STL function-object equivalent of the deprecated method is removed\nentirely.</p>\n</div>\n<div class=\"section\" id=\"february-28-2015\">\n<h1><a class=\"toc-backref\" href=\"#id16\">1.3.21 (February 28, 2015)</a></h1>\n<p>Thanks:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Gynvael Coldwind and Mateusz Jurczyk of the Google Security Team\nprovided test files which allowed us to find and fix security\nproblems in the software.</li>\n<li>Hanno Böck provided test files which allowed us to find and fix\nsecurity problems in the software.</li>\n<li>Tobias Ospelt provided test files and advice which allowed us to\nfind and fix security problems in the software.</li>\n<li>Michal Zalewski provided test files which allowed us to find and\nfix security problems in the software.</li>\n<li>Jodie Cunningham did lots of fuzzing to find issues and set up the\nproject on Coverity for automatic analysis.</li>\n<li><a class=\"reference external\" href=\"http://lcamtuf.coredump.cx/afl/\">American fuzzy lop</a> was used to produce and discover many of the\nfiles which caused problems for the software.</li>\n<li><a class=\"reference external\" href=\"https://code.google.com/p/address-sanitizer/\">AddressSanitizer</a> (ASan) was used to detect and isolate memory\naccess issues.</li>\n<li><a class=\"reference external\" href=\"http://www.valgrind.org/\">Valgrind</a> was used to detect and isolate memory access issues as\nwell as memory leaks</li>\n</ul>\n</blockquote>\n<p>Special Issues:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Due to <a class=\"reference external\" href=\"http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53967\">GCC bug 53967</a>, several key agorithms (e.g. convolution)\nmay execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\nenabled for floating point math (<cite>-mfpmath=sse</cite>) if the GCC option\n<cite>-frename-registers</cite> is used. Default 32-bit builds do not\nexperience the problem since they use '387 math.  It is not clear\nin what version of GCC this problem started but it was not noticed\nby the developers until the GCC 4.6 timeframe.  Other compilers do\nnot suffer from this bug.  Please lobby the GCC project to fix\nthis embarrassing performance bug.</li>\n<li>Magick++: Any libraries or applications using Magick++ should be\nrebuilt in order to use this new release.  Libraries and\napplications will be able to continue to use prior versions of\nMagick++ without being re-built, while benefiting from updated C\nlibraries, provided that the system supports library versioning.</li>\n</ul>\n</blockquote>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Annotate: Some requestable text-substitution attributes caused a\ncrash.</li>\n<li>All formats: Image dimensions are checked to assure that they are\nwithin limits before proceeding to read the image.</li>\n<li>BMP: Fix hang (endless loop) for certain files.</li>\n<li>DCM: Fix crash as well as small heap over-write.</li>\n<li>DPX: Fix crash due to DPX file reporting more elements than it\nhas.</li>\n<li>MNG: Validate MHDR chunk length to avoid huge memory allocation\nand DOS.</li>\n<li>PCX: Fix for CVE-2014-8355. Validate file header in order to avoid\nbuffer overun later.</li>\n<li>PDB: Detect arithmetic overflows when calculating buffer sizes.\nFix crash in writer when image width is not even multiple of 16.\nFix buffer overrun with 2 and 4-bit PDB image files.</li>\n<li>PNM: Validate PGM, PPM, and PAM header MaxValue parameter to avoid\ncrash on poorly-formed input.</li>\n<li>PNG: Impose a 10-million limit on dimensions when reading a PNG\nfile to avoid denial of service.</li>\n<li>PSD: Avoid problems caused by huge PSD colormap size.</li>\n<li>PSD: Fix small stack over-write if more than 99 layers are written\nto PSD format.</li>\n<li>PSD: Returns immediately if pixel limit was exceeded.</li>\n<li>RLE: URT RLE reader is now more robust with errant files.</li>\n<li>SUN: Header validation is now made fully robust, and arithmetic\noverflows in buffer-size calculations are detected to avoid heap\noverwrite.</li>\n<li>TIFF: Fix crashes for photometrics which may deliver one or three\nsamples per pixel (was assuming always three).</li>\n<li>VIFF: Fixes to prevent buffer overflow.  Validate colormap indexes.</li>\n<li>Windows delegates: Fix unexpected argument splitting when invoking\nan external delegate program via delegates.mgk.</li>\n<li>WPG: Fix use of NULL pointers.  Fix buffer overflows.</li>\n<li>XPM: Detect truncated row and quit with error rather than\nover-running a buffer.</li>\n<li>XWD: Improve header validation.  Added to UnstableCoderClass since\nthe reader for this format should not be entrusted with\nuntrustworthy input.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>CIN: Fix problem with text attribute values which are not NULL\nterminated.  Validate sizes claimed by Cineon header.</li>\n<li>Coverity: Fixes for many issues detected by Coverity scan (see\nChangeLog).</li>\n<li>DPX: Fix problem with text attribute values which are not NULL\nterminated.</li>\n<li>DPX: Fix severe corruption of little-endian 32-bit packed output.\nCorruption was severe enough that it would have been noticed\nimmediately.</li>\n<li>Delegates: Fix possible memory leaks when invoking external\napplication.</li>\n<li>FITS: Properly validate values provided by file header.</li>\n<li>GIF: Fix use of uninitialized data.</li>\n<li>JBIG: Fix memory leaks.</li>\n<li>JNG: Fix double-free error in error path.</li>\n<li>JPEG: Verify the number of output components before attempting to\ndecode the image.</li>\n<li>Magick++: Image resolutionUnits() was not always returning correct\nvalue.</li>\n<li>Magick++: Locking has not been working properly since the code was\nwritten in 1998.  Apparently the issue has not been significant\nenough to cause run-time issues.</li>\n<li>ICO: Windows icon reader is now much more robust.</li>\n<li>MIFF: Reader now quits with an error if zip or bzip2 stream is\ncorrupted.</li>\n<li>MAT: Fix memory leaks.</li>\n<li>PALM: Reader now reads various input formats (up to version 2)\ncorrectly whereas it was crashing or otherwise malfunctioning\nbefore.  More work remains, particularly in the writer.</li>\n<li>PCX: Eliminate memory leaks in error paths.</li>\n<li>PDB: In PDB writer, void possible under-allocation due to\narthimetic overflow when allocating packets.</li>\n<li>PICT: Fix PICT reader crash with corrupted file.</li>\n<li>PNG: Fix double-free error in error path.</li>\n<li>PNG: Fixed handling of transparency when writing indexed PNG.</li>\n<li>PNG: Avoid reading beyond the end of a tEXt keyword.</li>\n<li>PSD: Fix error when reading PSDs files which have no layers.</li>\n<li>RLA: Fix possible crash due to file header.</li>\n<li>Signal Handling: Signal handling is now more robust and handles\nSIGSEGV and other critical signals.  The sole purpose of the\ndefault signal handling is to remove any temporary files and quit.\nAn informative message is printed for signals other than SIGINT.</li>\n<li>SUN: Sun raster reader was not completely robust. Now it is.</li>\n<li>SWF: Fix pixel cache access errors in 'ping' mode.</li>\n<li>Text annotation: An empty text string is no longer treated as an\nerror.</li>\n<li>Text annotation: Fix regression added in 1.3.19 which caused\nspurious drawing errors to be produced while rendering with text\nwhen all of the text is off the left-hand side of the image.</li>\n<li>TIFF: Fix unreliable reading JBIG compressed files by forcing use\nof strip reader rather than sometimes using scanline reader (which\nlibtiff's JBIG codec does not support).</li>\n<li>TIFF: Fix reading or writing planar min-is-white or min-is-black\nimages with an associated alpha channel.</li>\n<li>WebP: WebP writer now writes truely lossless output when\nrequested.</li>\n<li>identify / GetImageStatistics(): Failed to compute statistics for\nthe Black channel of CMYK image files.</li>\n<li>VICAR: Fix problem with continuing to &quot;read&quot; data when there is no\nmore data left to read.</li>\n<li>WMF: Fix memory leaks.</li>\n<li>WPG: Fix potential DOS due to long reads during an error\ncondition.</li>\n<li>XPM: Avoid strncpy() of overlapping memory.  Fixed memory leaks in\nerror paths.  Fixed bad memory access caused by empty file.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>compose: Supports composite operator names similar to the major\n*Magick brand, without losing any compatibility with previous\nnaming.</li>\n<li>ICO: Windows ICO reader now supports reading PNG-encoded files.</li>\n<li>Magick++ Geometry: New methods limitPixels() and fillArea() to\nsupport '&#64;' and '^' geometry qualifiers.  This enhancement breaks\nthe ABI due to previous use of inline methods and no place to put\nthe new flags.</li>\n<li>Magick++ Image::extent(): New method to place image on sized\ncanvas of constant color using gravity.</li>\n<li>Magick++ Image::formatExpression(): New method format a string\nbased on a format similar to command-line -format.</li>\n<li>Magick++ Image::resize(): New method to resize image specifying\ngeometry, filter, and blur.</li>\n<li>Magick++ STL extentImage: New function object to invoke image\nextent method.</li>\n<li>Magick++ Image::quiet().  New method which blocks (ignores)\nwarning exceptions when passed a 'true' argument.</li>\n<li>Resource limits: Added support for image Width and Height limits.\nDefault image Width and Height limits are based on the range of a\n32-bit signed integer, even for 64-bit builds which may have\nsufficient numeric range to image an entire galaxy.  Limits may be\nincreased as desired.</li>\n<li>TIFF: Use define tiff:ignore-tags to ignore tags in 'corrupted'\nfiles with unknown and invalid tags.  Use to read TIFF files which\notherwise can not be read due to errors.</li>\n<li>TIFF: Use '-define tiff:report-warnings=true' to enable that\nwarnings reported by libtiff are thrown as warning exceptions so\nthat they may be caught or will be reported at the gm\ncommand-line.</li>\n<li>Windows Exceptions: A handler is registered (due to calling\nInitializeMagick()) to capture Windows Exceptions in a similar\nmanner to the existing POSIX signal handler.  If an application is\nusing the library and wants to provide its own Windows exception\nhandling, then it should make any changes after invoking\nInitializeMagick().</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n</blockquote>\n<p>Windows Delegate Updates/Additions:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PNG: Update bundled libpng to 1.6.16.  Resolves known security\nissues.</li>\n<li>FreeType: Update bundled Freetype to 2.5.4.  Resolves known\nsecurity issues.</li>\n<li>WebP: Update bundled WebP to 0.4.2 release.</li>\n<li>WebP is auto-linked in Visual Studio.</li>\n</ul>\n</blockquote>\n<p>Build Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>WebP is not included in the build when building with Visual Studio\n6 (1998 vintage compiler!) since it requires more modern C.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>AVI: Support for this format is removed since the implementation\nwas worthless.</li>\n<li>TIFF: Now uses YCbCr encoding when JPEG compression is requested\nfor an RGB image.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"august-16-2014\">\n<h1><a class=\"toc-backref\" href=\"#id17\">1.3.20 (August 16, 2014)</a></h1>\n<p>Special Issues:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Due to <a class=\"reference external\" href=\"http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53967\">GCC bug 53967</a>, several key agorithms (e.g. convolution)\nmay execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\nenabled for floating point math (<cite>-mfpmath=sse</cite>) if the GCC option\n<cite>-frename-registers</cite> is used. Default 32-bit builds do not\nexperience the problem since they use '387 math.  It is not clear\nin what version of GCC this problem started but it was not noticed\nby the developers until the GCC 4.6 timeframe.  Other compilers do\nnot suffer from this bug.  Please lobby the GCC project to fix\nthis embarrassing performance bug.</li>\n</ul>\n</blockquote>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>No security issues were reported or fixed.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Compilation: No longer undefine __attribute__ since this may be\nused by system or compiler headers and cause problems.</li>\n<li>BMP: Alpha channel from BMP3 format was inverted.</li>\n<li>PNG: Fix round-trip repeatability issue (due to rounding\nalgorithm) with modern versions of libpng.  Prefer the less\naccurate method which does not alter the image.</li>\n<li>PNG: Fix some memory leaks in error-handling paths.</li>\n<li>PNM: Scaling of alpha in sub-ranged pixels is fixed.</li>\n<li>Wand API: Removed development debug fprintf which causes each\ndrawing primitive to be printed to stderr.</li>\n<li>PS, PS2, PS3, PDF: Only use resolution from image or -density if\nunits were properly specified.  Without units, resolution is\nworthless.</li>\n<li>PS, PS2, PS3, PDF: Use resolution from image if it appears to be\nvalid.</li>\n<li>WebP: Fix inverted return status which caused failure to be\nreported instead of success.</li>\n<li>Rotation clipping/shearing errors for short wide images at some\nangles are fixed.</li>\n<li>-geometry: Deal with resize geometry missing width or height\n(e.g. '640x' or 'x480') by substituting the missing value with one\nwhich preserves the image aspect ratio.  This has been documented\nto be supported since almost the dawn of GraphicsMagick but was\nnot actually supported until now.</li>\n<li>-geometry: Support '&gt;' and '&lt;' qualifiers with '&#64;' qualifier to\nspecify if image should be resized if larger or lesser than given\narea specification.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Wand API: MagickSetImageGravity() - New function to set image\ngravity.</li>\n<li>Wand API: MagickGetImageGravity() - New function to get image\ngravity.</li>\n<li>Wand API: MagickSetImageMatte() - New function to set the image\nmatte channel enable flag.</li>\n<li>Wand API: MagickGetImageMatte() - New function to read the image\nmatte channel enable flag.</li>\n<li>Wand API: MagickSetImageGeometry() - New function to set the image\ngeometry string.</li>\n<li>Wand API: MagickGetImageGeometry() - New function to get the image\ngeometry string.</li>\n<li>Wand API: MagickOperatorImageChannel() - New function to apply an\noperator to an image channel.</li>\n<li>Magick++ API: New Image::thumbnail() method for fast image\nresizing, particularly to make thumbnails.</li>\n<li>Core C API: Added SetLogMethod() to allow an application/library\nto specify a function to be called for logging.</li>\n<li>Clang/LLVM: Provide support for clang/llvm attribute and builtin\nspecifiers similar to that provided for GCC.</li>\n<li>OpenMP: OpenMP native locking and thread specific data is\nsupported via a configuration option (is not the default).  This\noffers a &quot;pure&quot; OpenMP compilation mode.  No real value for this\ncompilation mode has been observed yet but it seems worthy to\nsupport.</li>\n<li>Coders: Added BrokenCoderClass to mark coders which often\nmalfunction or are not very useful in their current condition.</li>\n<li>Composition: Added HardLight composition operator, which is now\nused by PSD and XCF formats, and available via command line,\nMagick++ API, PerlMagick API, and Wand API.</li>\n<li>Composition: Added ScreenCompositePixels composition operator.</li>\n<li>Composition: Added missing Photoshop separable compositing\noperations, Overlay, Exclusion, ColorBurn, ColorDodge, SoftLight,\nLinearBurn, LinearDodge, LinearLight, VividLight, PinLight,\nHardMix.</li>\n<li>+set: Command line utilities now support +set to remove an\nexisting image attribute.</li>\n<li>-format: Support additional format specifiers 'g', 'A', 'C', 'D',\n'G', 'H', 'M', 'O', 'P', 'Q', 'T', 'U', 'W', 'X', and '&#64;', similar\nto the major brand.</li>\n<li>-operator: New quantum operators ThresholdBlackNegateQuantumOp and\nThresholdWhiteNegateQuantumOp. These correspond to -operator\n&quot;Threshold-Black-Negate&quot; and &quot;Threshold-White-Negate&quot;.</li>\n<li>TIFF: Now support setting the TIFF &quot;Software&quot; tag for users who do\nnot want to admit to using GraphicsMagick.</li>\n<li>WebP: All of the WebP encoder encoder options are now supported\nby -define arguments.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Pixel interpolation quality is greatly improved, with minimal\nimpact on performance.  Pixel interpolation now also works well\ngiven an alpha channel.</li>\n<li>WebP: WebP support is now prepared to compile with most WebP\nlibrary versions and supports all features except for those\npertaining to &quot;RIFF&quot; container support.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Non-integral image rotation performance has been improved by about\n40%, with lower memory usage as well.</li>\n<li>GradientImage: Update image is_grayscale and is_monochrome flags\nbased on gradient color properties.</li>\n</ul>\n</blockquote>\n<p>Windows Delegate Updates/Additions:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PNG: Libpng 1.6.12 - June 12, 2014.</li>\n<li>JPEG: libjpeg 9a of January 19, 2014.</li>\n<li>FreeType: FreeType 2.5.3 of March 6, 2014.</li>\n<li>WebP: webp 0.4.0 of January 20, 2013.</li>\n<li>zlib: zlib 1.2.8 of April 28, 2013.</li>\n</ul>\n</blockquote>\n<p>Build Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>--without-threads no longer disables use of OpenMP.  Use the\nalready existing option --disable-openmp to disable OpenMP.</li>\n<li>Makefiles: Include paths are now exceedingly pedantic to make sure\nthat only the required directories are included.</li>\n<li>VisualMagick configure: Improve configure program so that it is\npossible to select QuantumDepth, OpenMP, and 64-bit build via\nconfigure dialog boxes as well as options on the command line.\nAlso automatically detects and deals with similarly named files in\nsubdirectories so that WebP support can now build successfully.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>MultiplyCompositePixels: Multiply composition now uses SVG\ninterpretation of how alpha should be handled.  No longer does a\nsimple multiply of alpha channel.</li>\n<li>Composition: The Difference, Darken, Lighten, and HardLight\ncomposition operators were modified to support alpha in their\ncomputations.</li>\n<li>PNG: Using -optimize no longer triggers palette and depth\noptimizations since their implementations have been problematic.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"december-31-2013\">\n<h1><a class=\"toc-backref\" href=\"#id18\">1.3.19 (December 31, 2013)</a></h1>\n<p>Special Issues:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Due to <a class=\"reference external\" href=\"http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53967\">GCC bug 53967</a>, several key agorithms (e.g. convolution)\nmay execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\nenabled for floating point math (<cite>-mfpmath=sse</cite>) if the GCC option\n<cite>-frename-registers</cite> is used. Default 32-bit builds do not\nexperience the problem since they use '387 math.  It is not clear\nin what version of GCC this problem started but it was not noticed\nby the developers until the GCC 4.6 timeframe.  Other compilers do\nnot suffer from this bug.</li>\n</ul>\n</blockquote>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>EPT: Fix crash observed when Ghostscript fails to produce useful\noutput.  This was particularly noticeable when Ghostscript was not\ninstalled.  This crash could be used to cause denial of service.</li>\n<li>PNG: With libpng 1.6.X, avoid a crash while copying a PNG with a\n&quot;known incorrect ICC profile&quot;.  This crash could be used to cause\ndenial of service.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Build: Fix cross-compilation for MinGW64 on Linux build machine.</li>\n<li>Build: configure FreeType test no longer insists that\n&lt;freetype/freetype.h&gt; can be included.</li>\n<li>CMS profile: Only delete the CMS transform if it is non-null.\nFixed assertion observed when lcms returned a null profile and\nGraphicsMagick attempted to deallocate it.</li>\n<li>Drawing: Improve error handling logic so that drawing returns\nquickly on pixel access errors rather than plowing on ahead.  This\navoids problems with SVGs which take seemingly forever to render.</li>\n<li>Drawing via C/C++ APIs: <cite>BevelJoin</cite> no longer causes a MVG parsing\nerror.</li>\n<li>EPT: Fix crash observed when Ghostscript fails to produce useful\noutput.  This was particularly noticeable when Ghostscript was not\ninstalled.</li>\n<li>OpenMP: Revert use of omp_set_dynamic() since it caused\nperformance issues when using GCC's GOMP implementation and the\nnumber of threads to use is specified.</li>\n<li>EXIF profile: Support the <cite>SubjectArea</cite> EXIF tag.</li>\n<li>MIFF writer: PseudoClass format was written incorrectly for depth\ngreater than 8.</li>\n<li>MIFF writer: RLE compressed format used inverted alpha from the\nother subformats contrary to the MIFF specification.</li>\n<li>MIFF reader: Fixes to be able to read MIFF written by\nImageMagick 6.X, including DirectClass grayscale images (except\nfor RLE compressed).</li>\n<li>Mosaic: Fixed unsigned underflow problem with -mosaic when page\noffset is negative and exceeds image width or height, resulting in\nassertions, out of memory errors, or pixel cache limit errors.</li>\n<li>PDF: Consistently initialize Image page width and height to image\nwidth and height.  While general to all of GraphicsMagick, this\nchange is to assure that the PDF writer computes page dimensioning\nconsistently.  PDF page dimensioning was wrong if the image had\nbeen resized with -geometry &quot;100%&quot;.</li>\n<li>PAM: Fix MAXVAL scaling when reading PAM images.  PAM was only\nworking correctly for images with 256 or 64k levels.</li>\n<li>PNM: PGM &quot;P2&quot; format writer wrote bad output for 8-bit depth.</li>\n<li>PNG: With libpng 1.6.X, avoid a crash while copying a PNG with a\n&quot;known incorrect ICC profile&quot;.</li>\n<li>PNG: Q8 GM build now correctly reads 16-bit PNG files.</li>\n<li>TIFF writer: Try to avoid writing more than 32k strips per image\nby increasing rows-per-strip since some programs fail to read\nimages with more than 32k strips per image.</li>\n<li>TIM reader: PSX TIM reports 8-bit depth (rather than 16).</li>\n<li>TTF font rendering: Improve FreeType rendering error logic so that\nrendering returns immediately on pixel access errors rather than\nplowing on ahead.</li>\n<li>TTF font rendering: Support rendering UTF-8 up to 21-bit code\npoints.  Was only supporting 16-bit code points.</li>\n<li>Wand API: DrawSetStrokeDashArray() / DrawGetStrokeDashArray(), fix\nfailure to work properly due to this code path never being tested.</li>\n<li>Windows Ghostscript: 64-bit GraphicsMagick no longer requires both\n32-bit and 64-bit builds of Ghostscript to be installed in order\nto read Postscript and PDF formats.</li>\n<li>XPM reader: Reported depth now depends on the colormap rather than\nalways claiming to be 16-bit.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>JPEG: Add support for writing 'XMP' profile.</li>\n<li>PNM: As a simple non-standard extension to the standard PNM and\nPAM formats, support writing and reading 32-bit sample depth.\nWriting such files is only supported by the Q32 build although\nthey may be read by any build.</li>\n<li>WebP: Now supports reading and writing Google's WebP format.  This\nfeature is not currently supported by the Windows Visual Studio\nbuild.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Pixel composition based on BlendCompositePixel() is enhanced to\ncompletely eliminate under-color from the blending if the\nunder-pixel is fully transparent.  Also blends based on the\naverage opacity of both pixels rather than only the over-pixel.\nThis change did not result in any change in the GM test suite\nresults but it is possible that there could be some negative\nimpact from it.  Please report any issues noticed which are due to\nthis change.</li>\n<li>X11 <cite>display</cite>: For DirectClass image, use ThumbnailImage() rather\nthan SampleImage() when creating the panner icon to improve the\nquality of the image.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PNG: <cite>ping</cite> a PNG faster by avoiding reading the image data.</li>\n</ul>\n</blockquote>\n<p>Windows Delegate Updates:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated IJG JPEG library to release 9.</li>\n<li>Updated PNG library to release 1.6.8.</li>\n<li>Updated lcms2 library to release 2.5.</li>\n<li>Updated libxml2 library to release 2.9.1.</li>\n<li>Updated FreeType library to release 2.5.2.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>MIFF: Now writes PseudoClass images correctly when depth is\ngreater than 8.  This impacts the reader, which will not be able\nto read previously written incorrect format correctly.  Images\nlike this should be very rare.  The solution is to use an older\nGraphicsMagick version to convert such images to a valid storage\nformat (with a depth of 8) so that they may be read with this\nversion.</li>\n<li>MIFF: Now writes RLE-compressed RGBA images with correct\nalpha. This impacts the reader, which will not be able to read\npreviously written incorrect format correctly. Images like this\nshould be very rare. A solution is to use an older GraphicsMagick\nversion to use a compression algorithm other than RLE so that they\nare read correctly with this version.  Another solution is to\nprocess problematic images with '-operator Opacity Negate 0' to\ninvert the alpha channel.</li>\n<li>TIFF: Returns DirectClass images by default for MINISWHITE and\nMINISBLACK TIFF formats (rather then colormapped).</li>\n<li>Windows: Also search c:gsfonts for Ghostscript font files.  This\nsearch path is normally hard-coded into Ghostscript binaries and\nis a convenient place to put fonts so they may be shared by\nmultiple Ghostscript versions.</li>\n<li>XPM: Now limits color resolution to 16-bits, even with Q32 build.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"march-10-2013\">\n<h1><a class=\"toc-backref\" href=\"#id19\">1.3.18 (March 10, 2013)</a></h1>\n<p>Special Issues:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Due to <a class=\"reference external\" href=\"http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53967\">GCC bug 53967</a>, several key agorithms (e.g. convolution)\nmay execute much faster (e.g. 2-3X) for x86-64 and/or when SSE is\nenabled for floating point math (<cite>-mfpmath=sse</cite>) if the GCC option\n<cite>-frename-registers</cite> is used. Default 32-bit builds do not\nexperience the problem since they use '387 math.  It is not clear\nin what version of GCC this problem started but it was not noticed\nby the developers until the GCC 4.6 timeframe.  Other compilers do\nnot suffer from this bug.</li>\n</ul>\n</blockquote>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed bug with format substitutions if input string ends with a\nsingle '%'.</li>\n<li>BMP: Fixed an old bug with decoding chromaticity primaries.</li>\n<li>PNG: Fixed reading of interlaced images.  Fix reading of sub-8-bit\npalette and grayscale images.  Some PNG sub-formats were written\nincorrectly.  Fix crash in PNG8 writer if image colors happened to\nbe non-zero but image was not actually colormapped.</li>\n<li>PNG: Configure script now also searches for libpng versions 16 and\n17.</li>\n<li>TIFF: Fix a crash which was noticed when writing RGBA separated\n(planar) format.</li>\n<li><cite>--enable-symbol-prefix</cite> was not prefixing all of the C\nsymbols. Some core C library functions were not prefixed.  This\noption applies to the Wand library API as well now.</li>\n<li>C API: When input is from a user-provided file descriptor, the\nfile position is restored after reading the file header bytes.\nPreviously the file position was rewound to the beginning of the\nfile.  This allows reading embedded image data from the current\noffset in a file, and allows continuing to use the stream after\nGraphicsMagick has returned the image.</li>\n<li>C API: It is now possible to invoke CloseBlob() multiple times.</li>\n<li>display: Display was supposed to respond to +/-usePixmap, but was\nnot. It was responding to +/-use_pixmap.  Now it responds to both.</li>\n<li>Windows/VisualMagick: Fix building GraphicsMagick with Intel ICC\ncompiler driven by Visual Studio Professional 2012.</li>\n<li>Windows: Avoid a crash and produce a useful diagnostic if\nGhostscript is needed but not yet installed.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GM utility: New 'batch' command was contributed by Kenneth Xu\nwhich supports executing any number of other GM utility\nsub-commands in a single invocation in a sort of &quot;batch&quot; script.\nInput may be piped from standard input, from a specified file, or\nfrom a 'GM &gt;' command prompt.  This utilities front-end allows any\nother program/script to drive 'gm' using a co-process model and\nspeeds up execution by eliminating utility start-up/shut-down\ntime.</li>\n<li>WIN64 (64-bit Windows): Windows 64-bit is now officially supported.</li>\n<li>convert/mogrify: Now support -auto-orient to automatically rotate\nthe image upright for viewing based on its current orientation\nsetting.  Also support -orient to support setting the current\nimage orientation.  Please note that the orientation property of\nEXIF profiles is not yet updated so the EXIF profile will be wrong\nafter using -auto-orient.</li>\n<li>C API: AutoOrientImage(), new function to automatically orient\nthe image so that it is upright for normal viewing.</li>\n<li>Wand API: MagickGetImagePage()/MagickSetImagePage(), new functions\nto support getting and setting the image page size and offsets.</li>\n<li>PNG: Added PNG48 and PNG64 support. Added PNG00 support (png\nencoder that inherits its color-type and bit-depth from the input,\nif the input was a PNG datastream).</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GraphicsMagick TAP tests may now be run stand-alone using Perl's\n'prove' TAP test driver.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Detection of glob specifications in file names is more efficient.</li>\n</ul>\n</blockquote>\n<p>Windows Delegate Updates:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ltdl: Libltdl is no longer bundled.  Libltdl must be previously\ninstalled on the system in order to build the modules\nconfiguration.</li>\n<li>AppendImages() now converts subsequent images to the colorspace of\nthe first image, and no longer converts the first image to RGB.\nInstead, it is assumed the user knows what she/he is doing.</li>\n<li>SetImageColorRegion() no longer automatically converts the image\nto RGB.  The user is responsible for assuring that the provided\ncolor is in the same colorspace as the image.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"october-13-2012\">\n<h1><a class=\"toc-backref\" href=\"#id20\">1.3.17 (October 13, 2012)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PNG: Fix for CVE-2012-3438. The Magick_png_malloc function in\ncoders/png.c in GraphicsMagick 6.7.8-6 does not use the proper\nvariable type for the allocation size, which might allow remote\nattackers to cause a denial of service (crash) via a crafted PNG\nfile that triggers incorrect memory allocation.</li>\n<li>Automake (derived): Fix for CVE-2012-3386: The &quot;make distcheck&quot;\nrule in GNU Automake before 1.11.6 and 1.12.x before 1.12.2 grants\nworld-writable permissions to the extraction directory, which\nintroduces a race condition that allows local users to execute\narbitrary code via unspecified vectors.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PNG: Reading sub-8-bit palette images is fixed (images looked\nstretched).</li>\n<li>SVG: Fixed bug which allowed MVG and SVG files with long vector\npaths to crash the software.</li>\n<li>SVG: Ignore XML headers rather than rendering them as text.</li>\n<li>MVG/SVG/WMF/-draw: It is now possible to draw a plain ','\ncharacter.</li>\n<li>WMF: Fixed a bug which caused wrong centered-text placement.</li>\n<li>import: Return status was inverted.</li>\n<li>configure: Don't force that liblzma is used just because libtiff\nis used.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The configure script now supports a --enable-quantum-library-names\noption to enable that shared library name includes quantum depth\nto allow shared libraries with different quantum depths to\nco-exist in same directory (only one can be used for development).</li>\n<li>JNX: Support is added for reading the Garmin proprietary Image\nFormat.</li>\n<li>BMP: Support an alpha channel in uncompressed 32-bit BMP.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li><cite>-lat</cite>: The adaptive threshold algorithm is replaced with a new\nalgorithm which scales linearly (rather than quadratically) with\narea size.</li>\n<li>Tests: Test suite is re-written to use TAP-based tests.</li>\n<li>GIF: Reader tries to be better at detecting and reporting\nfailures.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>-lat: Adaptive threshold is much faster with large area sizes.</li>\n</ul>\n</blockquote>\n<p>Windows Delegate Updates:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Dcraw 9.16 is now included in the build (with JPEG and JPEG2000\nsupport).</li>\n<li>Libxml2 is updated to the 2.9.0 release.</li>\n<li>Libtiff is updated to the 4.0.3 release.</li>\n<li>Lcms2 is updated to the 2.4 release.</li>\n<li>Libpng is updated to the 1.5.13 release.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Loading modules is only supported for the modules build.\nPreviously any build using shared libraries could load modules.</li>\n<li>Bundled libltdl is now configured as 'installable' rather than\n'convenience'.</li>\n<li>-enhance: Only filter based on color channels (ignore opacity).</li>\n<li>BrowseDelegate: Web browser (for viewing help information) now\ndefaults to 'xdg-open', but if it is not found, then configure\nwill search for firefox, google-chrome, mozilla (in that order).</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"june-24-2012\">\n<h1><a class=\"toc-backref\" href=\"#id21\">1.3.16 (June 24, 2012)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Don't translate 'comment' and 'label' attributes if the request is\nmade while a file is being read.  Only translate such attributes\nif they come from the command line or API user.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>SWT: SWT reader suffered from a number of implementation errors\nwhich caused it not to work any more.  Works again.</li>\n<li>XBM: Fix memory leak observed when reading file in 'ping' mode.</li>\n<li>Support -trim on images which use a consistent (single color)\ntransparent background.  In this case, trim is done based on\nopacity rather than foreground color.</li>\n<li>Include &lt;sys/types.h&gt; in order to assure that 'size_t' and\n'ssize_t' are declared.  This is necessary since\nMagickExtentImage() uses these types as part of its definition.</li>\n<li><cite>+repage</cite> was not working because parser was insisting that it\nshould include an argument.</li>\n<li>-units was scaling existing resolution the wrong way around\n(i.e. multiplying rather than dividing).</li>\n<li>PerlMagick: Fix compilation with Perl 5.16.</li>\n<li>PingBlob(): PingBlob was not working for all cases.  Is now based\non BlobToImage() for assured reliability.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\nNone</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>MAT: Animated movies inside 4D matrices are loaded now.</li>\n<li>PDF: File base name is used as the document title.</li>\n<li>PNG: Fix issues observed specifically with libpng 1.5.10.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Pixel iterators should be more efficient now if the image uses a\nfile-backed cache.</li>\n<li>Motion blur algorithm does scale well as cores are added so\ninclude OpenMP support for it by default.</li>\n</ul>\n</blockquote>\n<p>Windows Delegate Updates:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>JPEG: Updated to IJG 8d release.</li>\n<li>PNG: Updated to 1.5.11 release</li>\n<li>TIFF: Updated to 4.0.2 release.</li>\n<li>Zlib: Updated to 1.2.7 release.</li>\n<li>libxml2: Updated to 2.8.0 release.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\nNone</blockquote>\n</div>\n<div class=\"section\" id=\"april-28-2012\">\n<h1><a class=\"toc-backref\" href=\"#id22\">1.3.15 (April 28, 2012)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Libpng in Windows build is updated to 1.5.10 release.  Provides a\nfix for CVE-2011-3048.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PNG - fixed problem with bit depth when the encoder decides to\nwrite RGBA instead of indexed PNG.</li>\n<li>Fixed some temporary file leaks which were caused by the temporary\nfile name being automatically extended to include a scene number,\nand therefore fail to be deleted.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added '+noise random' and '-operator noise-random' to 'convert'\nand 'mogrify'.  This modulates the existing image data with\nuniformly random noise.</li>\n<li>Added -strip option in composite, convert, mogrify, and montage to\nremove all profiles and text attributes from the image.</li>\n<li>Added -repage option to composite, convert, mogrify, and montage\nsubcommands to reset or adjust the current image page offsets\nbased on a provided geometry specification.</li>\n<li>New C function StripImage() to remove all profiles and text\nattributes from the image.</li>\n<li>New C function ResetImagePage() to adjust the current image page\ncanvas and position based on a relative page specification.</li>\n<li>C functions GenerateDifferentialNoise(), AddNoiseImageChannel(),\nQuantumOperatorRegionImage(), AddNoiseImage() updated to support\nRandomNoise enumeration.</li>\n<li>New C++ Image method strip(), and unary function stripImage() to\nremove all profiles and text attributes from the image.</li>\n<li>XCF format now respects image subimage and subrange members so\nthat returned image layers may be selected.</li>\n<li>The INFO coder (e.g. output file &quot;info:-&quot;) now respects the\n-format option so that its output may be adjusted identically to\nhow -format works for 'identify'.</li>\n<li>TclMagick now supports Random noise.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>C function ThumbnailImage() now allows the user to override the\nfilter used, but still defaults to using the box filter.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>No longer add a printf-style scene formatting specification to\nfilenames which do not have one and no longer automatically\noperate in 'adjoin' mode in such cases.  If multiple numbered\nfiles are intended to be output, then add +adjoin to the command\nline and use an output filename specification similar to\n&quot;image-%d.jpg&quot;.  Output files are now completely specified and\npredictable but this may break some existing usages which\nanticipate the automatic file numbering.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"february-25-2012\">\n<h1><a class=\"toc-backref\" href=\"#id23\">1.3.14 (February 25, 2012)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Windows bundled libpng updated to the 1.5.9 release, which fixes\nthe dire CVE-2011-3026 buffer overrun bug.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>EMF format : Fixed wrong module mapping which caused EMF reading\nto not work under Windows.</li>\n<li>TGA format: Assume that 32-bit TGA files have an alpha channel,\neven if they are not marked as such.</li>\n<li>XCF format: Fix reading XCF which is comprised of different sized\nlayers.</li>\n<li>JPEG &amp; CineonLog: Convert RGB-compatible colorspaces\n(e.g. CineonLog) to RGB by default since that was the case prior\nto release 1.3.13.</li>\n<li>RAW formats: Small memory leak in dcraw module was fixed.</li>\n<li>Resize: ResizeImage() was ignoring its resize filter argument and\nwas using the filter setting from the Image structure instead.</li>\n<li>The mirror virtual pixel method was broken.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Open64 Compiler Suite: Version 5.0 is fully supported.</li>\n<li>Wand API: Added MagickExtentImage().</li>\n<li>MEF RAW: Mamiya Photo RAW &quot;MEF&quot; format is now supported.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>DPX format: Original file endianness is preserved by default.</li>\n<li>PNG library: Updated libpng to 1.5.9 release.</li>\n<li>TIFF library: Updated libtiff to 4.0.1 release.</li>\n<li>Zlib library: Updated to zlib 1.2.6 release.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Despeckle algorithm (-despeckle) is many times faster.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>DPX format: Original file endianness is preserved by default.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"december-24-2011\">\n<h1><a class=\"toc-backref\" href=\"#id24\">1.3.13 (December 24, 2011)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\nNone</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>In I/O blob, don't rewind already open file handle passed to\nOpenBlob() since we don't know the intended state of this file\nhandle, and because it prevents appending to an existing file.</li>\n<li>In AppendImageProfile(), don't leak profile buffer while appending\na chunk to an existing profile.</li>\n<li>Fix deadlock in ClonePixelCache() which was caused by using the\nsame semaphore pointer in the source and destination images.</li>\n<li>Removed bogus SyncBlob() code which sometimes caused a crash and\nwas not useful.</li>\n<li>Fixed crash or hang which occured when the user entered CONTROL-C\nwhile threaded code was being executed.</li>\n<li>Fix core dump in AcquireOneCacheViewPixelInlined() when the image\nis in CMYK space.</li>\n<li>In MontageImages (montage), fix crash observed with &quot;-geometry\nx+0+0&quot;.</li>\n<li>The TIFF reader was crashing for images which use the\nTIFFTAG_OPIIMAGEID tag.</li>\n<li>AppendImages() (-append) was failing when only one image was\nprovided.</li>\n<li>The <cite>animate</cite>, <cite>display</cite>, and <cite>identify</cite> commands now report any\nerror only once, and then proceed to the next file name rather\nthan quitting.</li>\n<li>Don't change the locale settings in InitializeMagick() since this\nmay cause problems for international users.  API users are still\nresponsible for assuring that locale settings don't break floating\npoint parsing and output (i.e. floating point decimal needs to be\n'.' rather than ',').</li>\n<li>RPM build is fixed (PerlMagick build was broken).</li>\n<li>RPM build installs documentation to expected places on Red Hat\ntype systems.</li>\n<li>Fixes for usage with OpenSolaris.</li>\n<li>DESTDIR is supported by PerlMagick build.</li>\n<li>The matte channel was not being properly enabled or respected for\nTXT images.</li>\n<li>InitializeMagick() and DestroyMagick() are now fully thread safe.</li>\n<li>When a shear angle was zero, the shear request was being\nignored entirely.</li>\n<li>In DispatchImage(), the <cite>K</cite> channel was always output as black for\n&quot;CMYK&quot; specification unless the image matte flag was True.</li>\n<li>MATLAB fixes.</li>\n<li>PNG fixes.</li>\n<li>PCL fixes for printing bi-level image on Konica-Minolta printers.</li>\n<li>EPT error handling fixes.</li>\n<li>JPEG reader was sometimes truncating large IPTC profiles.</li>\n<li>JPEG writer now handles errors properly rather than allowing\nlibjpeg to exit the program (or hanging if driven by Magick++).</li>\n<li>JPEG reader now treats an unhandled EXP marker as a warning rather\nthan a hard error.</li>\n<li>File open errors are now reliably reported.</li>\n<li>Improved rendering precision when using the drawing APIs.</li>\n<li>For the Magick++ Image backgroundColor(), borderColor(), and\nmatteColor() methods, preserve the opacity part of the\nuser-specified color.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Add support for drawing text using a bitmap font.</li>\n<li>benchmark command supports a -stepthreads option to execute the\nspecified command with an increasing number of threads to measure\nhow an algorithm benefits from threading.  This mode includes a\ncolumn to show the speedup compared with one thread, and the\nKarp-Flatt metric</li>\n<li>Added support for invoking &quot;gs-cmyk&quot; and &quot;gs-cmyka&quot; entries in\ndelegates.mgk when ColorSeparationType or ColorSeparationMatteType\nis requested.  These cause Ghostscript to always output CMYK PAM\nformat (even if the input file was not in CMYK format).</li>\n<li>EXIF profiles are preserved when writing JPEG files.</li>\n<li>The -mosaic command now respects the composition option specified\nby -compose as well as the image background color specified by\n-background.</li>\n<li>The TXT coder now supports multiple image frames.</li>\n<li>For image normalization (-normalize), add support for\nhistogram-threshold setting to specify the percentage of the\nhistogram to discard when computing image normalization parameters\n(default is 0.1%).  For example <cite>-set histogram-threshold 0.01\n-normalize</cite>.</li>\n<li>Added an <cite>INFO</cite> coder which produces textual image description\noutput similar to <cite>identify</cite> but may be used with convert like &quot;gm\nconvert myfile info:-&quot;.</li>\n<li>Support application of the PDF crop box via '-define\npdf:use-cropbox=true'.</li>\n<li>For PCL printer output, define pcl:fit-to-page in order for the\nprinter to scale the image to fit the page.</li>\n<li>Added order dither 5x5, 6x6, and 7x7 circular dither patterns to\ncreate a halftone effect.</li>\n<li>PNM subformats are now reported as the specific subformat rather\nthan just &quot;PNM&quot;.</li>\n<li>NetPBM's PAM format is now supported.</li>\n<li>MacPaint image format reader is added.</li>\n<li>Added TIFF LZMA compressor support.</li>\n<li>Added TIFF support for a tiff:group-three-options define to allow\npower-users to set the value of the GROUP3OPTIONS tag.</li>\n<li>New core C API function SetImageColorRegion() to set the constant\npixel color for a specified region of the image.</li>\n<li>New Wand C API function MagickWriteImagesFile() to append images\nto a provided file handle.</li>\n<li>New Wand C API function MagickSetImageSavedType() to allow\nspecifying the storage type used when saving the file (rather than\nchanging the current image characteristics).</li>\n<li>In Wand C API, the functions NewPixelWand(), NewDrawingWand(), and\nNewMagickWand() invoke InitializeMagick() automatically in case\nuser forgets to do so.</li>\n<li>New Wand C API function MagickSetFormat() to allow setting the\nfile or blob format before it has been read.</li>\n<li>New Wand C API function MagickSetDepth() to set the depth used\nwhen reading from an image format which requires that the depth be\nspecified in advance.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Now compiles properly with libpng 1.4.X and 1.5.X.</li>\n<li>Lcms 2.X is supported.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>TGA read performance improved.</li>\n<li>PNM read/write performance improved.</li>\n<li>Convolution (-convolve, -sharpen, -guassian, etc.) is faster.</li>\n<li>Adaptive threshold image (-lat) is faster.</li>\n<li>Image trimming (-trim) is faster.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>For DPX format and packed 10 bits, datums are now represented in\nthe same (reversed) order for all RGB and YCbCr formats.\nPreviously YCbCr 4:4:4 formats were not swapping the word datums\nbecause the only real-world files encountered did not swap the\nword datums.</li>\n<li>The -colors, -map, and -monochrome options now take effect\nimmediately rather than at the end of all other processing.</li>\n<li>Removed non-standard multi-frame extension for SGI format.</li>\n<li>Windows install footprint is more consistent between DLL and\nstatic builds.</li>\n<li>LZMA compressed tarball is in 'xz' format rather than deprecated\n'lzma' format.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"march-8-2010\">\n<h1><a class=\"toc-backref\" href=\"#id25\">1.3.12 (March 8, 2010)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Updated libpng Windows sources to 1.2.43 in order to resolve\nCVE-2010-0205 as it pertains to the GraphicsMagick Windows build.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Filter mode (write to stdout) was completely broken.</li>\n<li>Should now compile with libpng 1.4.</li>\n<li>Windows PerlMagick build identified itself as the wrong version.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>DCX output format is only written on request.  Previously the PCX\ncoder would automatically switch to DCX format if multiple frames\nwould be written.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"february-21-2010\">\n<h1><a class=\"toc-backref\" href=\"#id26\">1.3.11 (February 21, 2010)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed array underflow on systems using signed char which could\nresult in a program crash due to extended characters in filenames\nor in certain file formats.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixed array underflow on systems using signed char which could\nresult in a program crash due to extended characters in filenames\nor in certain file formats.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added a -thumbnail command to 'convert' and 'mogrify'.  This is a\nfaster way to scale down the image when speed is a primary\nconcern.</li>\n<li>Added a -extent command to 'convert' and 'mogrify' which\ncomposites the image on top of a backing canvas image of solid\ncolor.</li>\n<li>Added support for -compose to the 'convert' and 'mogrify', which\nwere documented to support it (but did not).</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Requests for 'Over' and 'Atop' composition are converted to a\nrequest for the (faster) 'Copy' composition when both images are\nopaque.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"february-10-2010\">\n<h1><a class=\"toc-backref\" href=\"#id27\">1.3.10 (February 10, 2010)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>+adjoin was not working correctly for the case when only one image\nframe is present.  With +adjoin and writing one frame to\n&quot;foo%d.jpg&quot; it was outputting &quot;foo%d.jpg&quot; rather than &quot;foo0.jpg&quot;.</li>\n<li>When drawing paths, memory allocation for the points was much\nlarger than it needed to be (patch by Vladimir Lukianov).</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>To reiterate the change which first appeared in 1.3.9, there is no\nlonger an implicit +adjoin if the output file name happens to\ncontain a %d sequence, or there are multiple frames and the output\nfile format only supports storing one frame.  Specify +adjoin if\nscene number substition is desired in the output file names.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"february-4-2010\">\n<h1><a class=\"toc-backref\" href=\"#id28\">1.3.9 (February 4, 2010)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fix &quot;double free&quot; error when using gm import -frame.</li>\n<li>XPM does not support RGBA color syntax, so return RGB instead.</li>\n<li>The display '-update' option was only working in conjunction with\nthe '-delay' option with a delay setting of 2 or greater.</li>\n<li>For formats which support multiple frames, output with +adjoin to\nfilenames containing a scene specification (e.g. foo%02d.tiff) was\nresulting in wrong output file names.</li>\n<li>-convolve was crashing rather than reporting an error.</li>\n<li>Fixed crash if the number of OpenMP threads was reduced from the\noriginal value via '-limit threads' or omp_set_num_threads().</li>\n<li>-blur was not blurring the opacity channel for solid-color images.</li>\n<li>When installing HTML documentation, many files were included which\nare not part of the formatted documentation.</li>\n<li>Several deleted global string constants are restored with\ndeprecated status in order to assure that symbols are not removed\nfrom the ABI.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>There is no longer an implicit 'adjoin' if an output filename\ncontains an apparent scene specification (e.g. foo%02d.tiff) and\nmultiple files are not needed to save the image..  It is necessary\nto use +adjoin.  For example <tt class=\"docutils literal\">gm convert foo.pdf +adjoin\n%02d.tiff</tt>.</li>\n<li>-flatten now applies the image background color under the first\nimage in the list if it is not already opaque.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"january-21-2010\">\n<h1><a class=\"toc-backref\" href=\"#id29\">1.3.8 (January 21, 2010)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fix for CVE-2009-1882 &quot;Integer overflow in the XMakeImage\nfunction&quot;.</li>\n<li>Fix lockup due to hanging in loop while parsing malformed\nsub-image specification (SourceForge issue 2886560).</li>\n<li>Libltdl: Updated libtool to 2.2.6b in order to fix security issue.\nResolves CVE-2009-3736 as it pertains to GraphicsMagick.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>-convolve, -recolor: Validate that user-provided matrix is square\nwhen parsing -convolve and -recolor commands in order to avoid a\ncore dump.</li>\n<li>CALS: Reading images taller than the image width resulted in a\nfailure.</li>\n<li>ConstituteImage(), DispatchImage(): 'A' and 'T' should indicate\ntransparency and 'O' should indicate opacity.  Behavior was\ninconsistent.  In some cases 'O' meant transparency while in other\ncases it meant opacity. Also, in a few cases, matte was not\ngetting enabled in the image as it should.</li>\n<li>DCRAW: Module name was not registered so modules based builds were\nnot supporting formats provided via 'dcraw'.</li>\n<li>GetOptimalKernelWidth1D(), GetOptimalKernelWidth2D(): In the Q32\nbuild, convolution kernel size was estimated incorrectly for large\nsigmas on 32-bit systems due to arithmetic overflow.  This could\ncause wrong results for -convolve, -blur, -sharpen, and other\nalgorithms which use these functions.</li>\n<li>Image Size: Fixed the ability to pass the image size via the\nfilename specification like &quot;myfile.jpg[640x480]&quot; rather than\nneeding to use -size.</li>\n<li>IPTC: Blob data needed to be padded to an even size.  Size is now\ncorrectly reported.</li>\n<li>IPTC: Returned IPTC string values were one character too short.</li>\n<li>Large Files: Large pixel cache files were not working under GNU\nLinux.</li>\n<li>JP2: Fixed some value scaling problems.</li>\n<li>JP2: Fix possible crash at exit when Jasper is used by a modules\nbuild.</li>\n<li>MPC: is_monochrome and is_grayscale flags were not managed\nproperly for the MPC coder.</li>\n<li>PCL: Page was not always being ejected.</li>\n<li>PNG: The png8 encoder would fail when trying to write a 1-color\nimage.</li>\n<li>PSD: PSD parser was confused by 0x0 pixel layers, resulting in\nimage data corruption of all following layers.</li>\n<li>-rotate, -shear: Some internally-reported errors were potentially\nbeing lost.</li>\n<li>Subrange/stdin: Commands now support reading an image from stdin\nin conjunction with a subrange specification (e.g. &quot;-[1]&quot;).</li>\n<li>Magick++ STL ShadeImage: Implementation was completely botched.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>CALS Type 1 files may now be written (Work contributed by John\nSergeant).  CALS support is dependent on the TIFF library.</li>\n<li>GROUP4RAW encoder supports reading/writing RAW Group4 data.</li>\n<li>JP2: JPEG 2000 may now be written in arbitrary bit depths ranging\nfrom 2 to 16 rather than just 8 or 16.</li>\n<li>JPEG: IJG JPEG library version 7 is now supported.</li>\n<li>JPEG: Added jpeg:block-smoothing and jpeg:fancy-upsampling defines\nto control these JPEG library options.</li>\n<li>JPEG: Detect and apply colorspaces appropriately for ITU FAX JPEG.</li>\n<li>Resource Limits: There is now a &quot;threads&quot; resource limit which\nallows specifying the number of OpenMP threads which may be used,\nsimilar to the OMP_NUM_THREADS environment variable.</li>\n<li>TIFF: Allow CIELAB TIFF to be read.</li>\n<li>MagickGetImageAttribute()/MagickSetImageAttribute(): New Wand\nmethods to support getting and setting an image attribute.\nContributed by Mikko Koppanen.</li>\n<li>ClonePixelWand(): New Wand method to deep-copy an existing pixel\nwand.</li>\n<li>ClonePixelWands(): New Wand method to deep-copy an array of\nexisting pixel wands.</li>\n<li>MagickCdlImage(): New Wand method to apply the ASC CDL to an\nimage.</li>\n<li>MagickGetImageBoundingBox(): New Wand method to return the crop\nbounding box required to remove any solid-color border from the\nimage.</li>\n<li>MagickGetImageFuzz(), MagickSetImageFuzz(): New Wand methods to\nget and set the color comparison fuzz factor.</li>\n<li>MagickHaldClutImage(): New Wand method to apply a Hald CLUT to an\nimage.</li>\n<li>MagickSetResolution(): New Wand method to set the wand resolution.</li>\n<li>MagickSetResolutionUnits(): New Wand method to set the wand\nresolution units.</li>\n<li>Magick++: Allow Magick++ library to built as a DLL under MinGW and\nCygwin.  This requires a modern GCC in order for C++ exceptions to\nwork.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Cygwin: Cygwin 1.7 is now supported.</li>\n<li>JPEG compression settings are preserved (if possible) when\ninserting JPEG blobs into formats which use JPEG.</li>\n<li>PDF: If the original file used JPEG compression, then use JPEG\ncompression with original settings (if possible).</li>\n<li>TIFF: Update Windows build to use libtiff 3.9.2.</li>\n<li>X11 Display: Apply a checkerboard pattern underneath transparent\nimages which use more than simple binary transparency.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Gamma: Performance is improved for Q8 and Q16 builds.  Also\npreserve full precision in Q32 build.</li>\n<li>String data is dealt with a bit more efficiently (fewer\nallocations, less memory, and less CPU).</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>InitializeMagick() MUST be invoked prior to using any Magick API\nfunction.  Failure to do so will likely lead to an immediate\napplication crash.  This is due to initialization and runtime\nchanges intended to improve thread safety and efficiency.\nPreviously it was only strongly recommended to invoke\nInitializeMagick().</li>\n<li>ConstituteImage(), DispatchImage(): 'A' and 'T' should indicate\ntransparency and 'O' should indicate opacity.  Behavior was\ninconsistent.  In some cases 'O' meant transparency while in other\ncases it meant opacity. Also, in a few cases, matte was not\ngetting enabled in the image as it should.</li>\n<li>colors.mgk: Is now empty to default and is optional.  Previous\ncontent is now compiled into the library in an efficient way, but\nexisting values may be modified, or new values added by adding\nentries to color.mgk.</li>\n<li>DisableSlowOpenMP is now the default.  Use --enable-openmp-slow to\nenable OpenMP for algorithms which sometimes run slower rather\nthan faster.</li>\n<li>magic.mgk: This configuration file is no longer used since this\ndata is now compiled into the library in an efficient way.</li>\n<li>modules.mgk: Is now empty to default and is optional.  Previous\ncontent is now compiled into the library in an efficient way, but\nexisting values may be modified, or new values added by adding\nentries to modules.mgk.</li>\n<li>Third party executables not included in the Visual Studio build\nare no longer bundled in the GraphicsMagick installer.  This means\nthat hp2xx.exe, mpeg2dec.exe, and mpeg2enc.exe are no longer\ndistributed.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"september-17-2009\">\n<h1><a class=\"toc-backref\" href=\"#id30\">1.3.7 (September 17, 2009)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PCX: Detect improper rows, columns, or depth.  Fixes CVE-2008-1097\n&quot;Memory corruption in ImageMagick's PCX coder&quot;.</li>\n<li>DrawDashPolygon: Avoid a crash which sometimes occured with tiny\npolygons.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>JPEG: Profile chunks need to be concatenated in order to build\nthe whole profile.  This was not working so embedded profiles\nlarger than 32K or maybe 64K were being corrupted.  This bug was\nintroduced in GraphicsMagick 1.2.</li>\n<li>Meta: Fix memory leaks.</li>\n<li>Meta: Work better with with IPTC record 2 blocks and deal better\nwith IPTC embedded in an 8BIM profile.  Fixes by John Sergeant.</li>\n<li>MPC: Fix crash when reading MPC and the input image is modified.</li>\n<li>PNG: Ensure that the opacity channel is properly initialized.</li>\n<li>-profile: Lowercase arguments were sometimes not working as\nexpected.</li>\n<li>Topol: Topol reader actually works now and is included in test\nsuite.</li>\n<li>TIFF: Read and write JPEG-compressed grayscale TIFF correctly.</li>\n<li>VisualMagick configure now works properly when output paths are\nspecified.</li>\n<li>WMF: Eliminate memory leaks.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>MagickWand: New method MagickSetCompressionQuality() to allow\nsetting the compression quality.</li>\n<li>MagickWand: New method CloneDrawingWand() to deep-copy a drawing\nwand.</li>\n<li>MagickWand: New method DrawGetException() to retrieve information\nregarding the last drawing wand exception (if any).</li>\n<li>MagickWand: New method DrawClearException() to clear a drawing wand\nexception.</li>\n<li>Magick++: New Image method cdl() to apply the ASC CDL.</li>\n<li>Magick++: New Image method colorMatrix() to apply a color matrix\nto the image channels.</li>\n<li>Magick++: New Image method haldClut() to apply a color lookup\ntable (Hald CLUT) to the image.</li>\n<li>MSL/Conjure: Added a new 'profile' command which applies, adds, or\nremoves one or more IPTC, ICC or generic profiles from a file.\nWork contributed by John Sergeant.</li>\n<li>Added a 'time' subcommand to provide Unix-style 'time' output when\na 'time' capability is missing, or the reporting format is\ninconsistent.  For example 'gm time convert ...'.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ColorMatrixImage(): Add opaque opacity channel when needed.</li>\n<li>PDF &amp; PS: Use '-type palette' prior to input file name to cause\nGhostscript to return a dithered colormapped image.</li>\n<li>PNG: Now compiles with libpng-1.4.0beta74 and later.</li>\n<li>TIFF: Libtiff in Windows build is upgraded to 3.9.1.  This allows\nGraphicsMagick to read and write 16 and 24 bit float TIFF files.</li>\n<li>Windows code to find Ghostscript is rewritten from scratch.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Drawing of points, lines, and polygons (and complex shapes based\non these) is now accelerated using OpenMP with excellent speed-up.</li>\n<li>ICC color transforms now see linear speedup from OpenMP.</li>\n<li>Rotate: For rotations of 90 or 270 degrees, tile sizes are\nselected more appropriately.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>No longer clear the exception structure at the start of\nReadImage() and other similar functions since this sometimes masks\nerrors.  The API user is expected to make sure that the exception\nstructure is clean prior to invoking a function.</li>\n<li>SVG: Writer is now disabled since it usually does not work properly.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"july-25-2009\">\n<h1><a class=\"toc-backref\" href=\"#id31\">1.3.6 (July 25, 2009)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Composition was failing when the change image overlaps off the\nleft side of the canvas.</li>\n<li>EPT, PDF, PS: PDF bounding box is sometimes incorrect or not\nglobally applicable so don't specify bounding box when reading PDF\nfiles.</li>\n<li>OpenMP: Fix (benign) multi-thread cross-contentions (detected by\nvalgrind's Helgrind).</li>\n<li>TIFF: Fix problem with reading one bit per sample RGB images.</li>\n<li>TIFF: Writer was using rows-per-strip of 8 when writing\nJPEG-compressed TIFF.  This does not work for vertical\nsubsampling, and some TIFF readers insist on 16.  The\nrows-per-strip is now required to be a multiple of 16.</li>\n<li>TIFF: In some cases, the TIFF reader and writer were accessing\nplanar TIFF in row-order rather than plane-order, which resulted\nin sever buffering problems in libtiff, and failure when\ncompression was used.</li>\n<li>-write now works usefully as documented.</li>\n<li>Temporary file name generator was not random enough, resulting in\nsome file name collisions for GraphicsMagick processes started at\nthe same time.</li>\n<li>PerlMagick: Fixed Ping on a BLOB.</li>\n<li>GetImageDepth was leaking memory.</li>\n<li>Convert/mogrify -mask option was leaking memory.</li>\n<li>Mogrify -output-directory option was leaking memory.</li>\n<li>DPX: Fixed memory leak encountered when subsampling to 4:2:2.</li>\n<li>DPX: Values read received insuficient scaling, which round-tripped\ncorrectly, but rounded-down excessively if any image processing\nwas applied.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added HRS reader for slow scan TV (contributed by Fojtik Jaroslav).</li>\n<li>Pthreads (POSIX threads) API may now be used under the WIN32 API.</li>\n<li>New access confirmation facility (MagickConfirmAccess) to allow\nthe API user to monitor and/or block access to files and URLs.\nThis allows the API user to implement a security policy based on\nactual accesses.</li>\n<li>New color matrix function (ColorMatrixImage) to apply a color\nmatrix similar to Adobe Flash Flash.filters.colorMatrixFilter(),\nand Windows GDI+ ColorMatrix class, (order up to 5x5) to the image\npixels.  This is accessible via the -recolor command option.</li>\n<li>Added an IDENTITY coder to return a Hald identity CLUT image of\nspecified order (e.g. &quot;identity:8&quot;).</li>\n<li>Added a Hald CLUT capability as described at\n<a class=\"reference external\" href=\"http://www.quelsolaar.com/technology/clut.html\">http://www.quelsolaar.com/technology/clut.html</a>.  This allows a\ncolor transformation to be easily created and replicated on any\nnumber of images.  The algorithm is accessed by the -hald-clut\noption of 'convert' and 'mogrify'.  Original algorithm by Eskil\nSteenberg and adapted for GraphicsMagick by Clément Follet, with\nadditional work by Bob Friesenhahn.</li>\n<li>Added support for the ASC CDL transform.  Available as -asc-cdl\nvia the 'convert' and 'mogrify' subcommands.  Original\nimplementation by Clément Follet but considerably re-worked by Bob\nFriesenhahn.  Implementation passes the +/- 1 count accuracy\nrequirement required by the ASC CDL SOP tests.</li>\n<li>Added support for reading CALS Type 1 format (contributed by John\nSergeant).  CALS is a standard raster format used by the US\nDepartment of Defense for storing blueprint images.</li>\n<li>Added a random number generation system based on George\nMarsaglia's multiply-with-carry generator.  Somewhat slower than\nrand() but produces better random numbers with a period &gt;2^60.\nThis is a much better random number generator than the C library\nrand() and the algorithm is integrated in a way which maximizes\nmulti-thread performance.</li>\n<li>The 'compare' command now supports a -maximum-error option to\nspecify the maximum image error so that it may be used to support\nboolean logic in automated test scripts.</li>\n<li>For OpenMP-builds, the '-list resource' output now indicates the\nnumber of threads which will be used.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Image resize now avoids adding &quot;halos&quot; around objects when\nresizing an image which contains transparency (patch contributed by\nPavel Merdin).</li>\n<li>DICOM: The DICOM reader is completely re-written and is much more\nfunctional now.  A few features (e.g. RLE compression) are still\nmissing.  This work is contributed by John Sergeant.</li>\n<li>EXIF: Unprintable characters in EXIF attribute strings are now\nreturned using three-digit octal notation.  Unknown tags are\nidentified via their four-character hex value.</li>\n<li>PCL: PCL writer is rewritten to fix many bugs, add support for\ncompression, add support for 8 bit PseudoClass images, and\ndramatically improve usability (work contributed by John Sergeant).</li>\n<li>TIFF: Allow the user to force the returned image to be TrueColor\ntype for min-is-white and min-is-black TIFF files.</li>\n<li>TIFF: User can now specify the predictor using syntax like\n'-define tiff:predictor=2'.</li>\n<li>TIFF: User can now specify the rows-per-strip value when using\nJPEG compression.</li>\n<li>TXT: The TXT reader is now capable of reading image files written\nby the TXT writer, as well continuing to render ASCII text into an\nimage (work contributed by Fojtik Jaroslav).</li>\n<li>Utilities &#64;file.txt syntax for including a list of files to use as\nan argument now really works as expected.  This may be used to\ninject any other text into the command line as well.  As a result,\nthe 'mogrify' utility may be invoked on thousands of files at once\nwhile obtaining the list of files to process from a text file.</li>\n<li>The 'mogrify' utility now caches argument images so that they are\nloaded only once when mogrify is used to process multiple image\nfiles.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>-median and -noise now see reliable linear speedup as threads are\nadded.</li>\n</ul>\n</blockquote>\n<p>Behavior Changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>PerlMagick is configured but no longer built by default.</li>\n<li>Use '-interlace Line' to produce an interlaced GIF, PNG, or\nprogressive JPEG.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"january-26-2009\">\n<h1><a class=\"toc-backref\" href=\"#id32\">1.3.5 (January 26, 2009)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BMP and DIB formats were throwing an assertion for negative height\nvalues.  This caused the process to crash.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Don't install Magick++ headers if C++ is disabled.</li>\n<li>Linux RPM SPEC file needs to always install the loadable module\n.la files or else the modules won't load.</li>\n<li>Windows runtime DLLs were for the wrong compiler version,\nresulting in failure to execute if the correct runtime DLLs are\nnot available.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>FITS: Parsing is more robust.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"january-13-2009\">\n<h1><a class=\"toc-backref\" href=\"#id33\">1.3.4 (January 13, 2009)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Now runs under Windows Vista (as a 32-bit application).</li>\n<li>Fix for colorspace transform math overflow in Q32 build.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Windows build supports OpenMP and requires Windows 2000 or later\n(source code still supports Windows '98).</li>\n<li>Support large files under Windows.</li>\n<li>Support reading/writing 16 and 24 bit float TIFF files.</li>\n<li>Support reading/writing 64 bit integer TIFF files.</li>\n<li>Added &quot;Log&quot;, &quot;Max&quot;, &quot;Min&quot;, and &quot;Pow&quot; options to -operator.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Debug logging now properly prints 64-bit offset values.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Improve resource estimation for Microsoft Windows systems.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"december-9-2008\">\n<h1><a class=\"toc-backref\" href=\"#id34\">1.3.3 (December 9, 2008)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>'identify' was throwing an assertion when used on colormapped\nfiles (this bug was introduced by 1.3.2).</li>\n<li>With the -segment option, eliminate trashing the image colors when\nused on huge images.</li>\n<li>'identify -format &quot;%c&quot;' now reports the entire comment regardless\nof size.</li>\n<li>Argument to -convolve is no longer arbitrarily truncated so huge\nconvolution kernels may now be specified from the command line.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Image segmentation (-segment) is now accelerated using OpenMP and\nuses several other tactics to improve execution performance.</li>\n<li>'identify &quot;*&quot;' now successfully works in a 32-bit application when\nused in a directory containing a million files.</li>\n<li>'identify' now executes quickly when used on TIFF files.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"november-29-2008\">\n<h1><a class=\"toc-backref\" href=\"#id35\">1.3.2 (November 29, 2008)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>-roll was failing for colormapped images.</li>\n<li>VID: Memory leak fix.</li>\n<li>PREVIEW: Solarize parameter was wrong.</li>\n<li>Delegates previously using 'spawn' needed an ampersand so that\nstarting the child process does not hang the GUI.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>+profile now supports an exclusion syntax.  For example <tt class=\"docutils literal\">+profile\n<span class=\"pre\">'!icm,*'</span></tt> removes all of the profiles except for the ICM profile.\nThe new syntax also allows multiple profiles to be listed at once.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>AdaptiveThreshold, Blur, Convolve, and MotionBlur no longer\nprocess the opacity channel unless the image has one.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"november-17-2008\">\n<h1><a class=\"toc-backref\" href=\"#id36\">1.3.1 (November 17, 2008)</a></h1>\n<p>Security Fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>None.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>RPM build, Fixes to successfully build binary RPMs for Red Hat\nLinux 4.</li>\n<li>MSL/conjure, Fix bug with attributes becoming appended to\nthemselves.  Fix memory leaks.</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>New --disable-openmp-slow configure option for disabling use of\nOpenMP for algorithms which may run slower on operating systems\nwith crummy thread libraries.</li>\n<li>JPEG, Allow user to specify DCT encoding method via\njpeg:dct-method define.  Also allow control over whether huffman\nencoding is used via jpeg:optimize-coding define.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>OpenMP (parallel processing) improvements for these functions:<ul>\n<li>Rotate by 90 and 270 degrees (-rotate)</li>\n</ul>\n</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"november-9-2008\">\n<h1><a class=\"toc-backref\" href=\"#id37\">1.3 (November 9, 2008)</a></h1>\n<p>Security fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>AVI reader: Re-worked to be more robust against crash or DOS.</li>\n<li>AVS reader: Re-worked to be more robust against crash or DOS.</li>\n<li>DCM reader: Re-worked to be more robust against crash or DOS.</li>\n<li>EPT reader: Re-worked to be more robust against crash or DOS.</li>\n<li>FITS reader: Re-worked to be more robust against crash or DOS.</li>\n<li>MTV reader: Re-worked to be more robust against crash or DOS.</li>\n<li>PALM reader: Re-worked to be more robust against crash or DOS.</li>\n<li>RLA reader: Re-worked to be more robust against crash or DOS.</li>\n<li>TGA reader: Re-worked to be more robust against crash or DOS.</li>\n<li>Avoid possible crash in GetImageCharacteristics() when substituting\ntext in comment read from file.</li>\n<li>Cineon reader: Fixed crash with broken file from Sami Liedes.</li>\n<li>Palm reader: Fixed crash with broken files from Sami Liedes.</li>\n<li>PICT reader: Fixed crash with broken files from Sami Liedes.</li>\n<li>DPX reader: Validate file data better to avoid improper operation with\nintentionally (or accidentally) defective files.</li>\n<li>XCF reader: Fixed crash with broken files from Sami Liedes.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Libbz2 is now detected for MinGW.</li>\n<li>Install documentation under /usr/local/share/doc/GraphicsMagick by\ndefault, according to GNU conventions.</li>\n<li>In PerlMagick, Dissolve composition was not working right.</li>\n<li>FITS: Ensure that written format conforms to specification.</li>\n<li>TIFF:<ul>\n<li>Don't accidentially convert CMYK images to RGB.</li>\n<li>Eliminated a memory leak in the codec support detection code.</li>\n</ul>\n</li>\n<li>JPEG: Removed over-write of image-&gt;client_data.</li>\n<li>PDF: Try to properly deal with reading rotated PDFs.</li>\n<li>PNG: Fixed crash when writing PNG images with transparency and either\noptimize is requested, or the image is colormapped.</li>\n<li>Configure: Fixed the --enable-magick-compat configure option, which\nhad stopped working.</li>\n<li>Configure: Fixed --without-magick-plus-plus so that it works again.  This\nstopped working in the 1.2 release cycle.</li>\n<li>Configure: Fixed MagickLibVersion text string generation so that it\nis now correct when a component of the release number exceeds '9'.\nNow components can safely count up to '99' before there is a problem.</li>\n</ul>\n</blockquote>\n<p>Performance Improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>OpenMP (parallel processing) improvements for these functions:<ul>\n<li>Affine transform (-affine -transform)</li>\n<li>Average images (-average)</li>\n<li>Add noise (+noise)</li>\n<li>Black threshold (-black-threshold)</li>\n<li>Blur (-blur)</li>\n<li>Border (-border)</li>\n<li>Channel import, export, and depth-setting (-channel, -depth)</li>\n<li>Clip path</li>\n<li>Coalesce (-coalesce)</li>\n<li>Colorize (-colorize)</li>\n<li>Colorspace transformation (-colorspace)</li>\n<li>Compare images ('compare' command)</li>\n<li>Composition ('composite' command)</li>\n<li>Convolution (-convolve, -edge, -emboss, -gaussian, -sharpen)</li>\n<li>Contrast adjust (-contrast)</li>\n<li>Crop (-crop)</li>\n<li>CycleColormap (-cycle)</li>\n<li>Depth setting (-depth, -operator depth)</li>\n<li>Despeckle (-despeckle)</li>\n<li>Enhance (-enhance)</li>\n<li>Equalize (-equalize)</li>\n<li>Flatten (-flatten)</li>\n<li>Flip (-flip)</li>\n<li>Flop (-flop)</li>\n<li>Frame (-frame)</li>\n<li>Gamma adjust (-gamma, -operator gamma)</li>\n<li>Gradient</li>\n<li>Implode (-implode)</li>\n<li>Levels adjust image (-level)</li>\n<li>Local adaptive threshold (-lat)</li>\n<li>Median filter (-median)</li>\n<li>Minify image (-minify)</li>\n<li>Modulate image (-modulate)</li>\n<li>Morph image (-morph)</li>\n<li>Mosiac (-mosaic)</li>\n<li>Motion blur (-motion-blur)</li>\n<li>Negate image (-negate)</li>\n<li>Noise filter (-noise)</li>\n<li>Normalize image (-normalize)</li>\n<li>Oil Paint (-paint)</li>\n<li>Opaque (-opaque)</li>\n<li>Ordered dither (-ordered-dither)</li>\n<li>Operators (-operator)</li>\n<li>Profile adjust (ICC) (-profile)</li>\n<li>Random threshold (-random-threshold)</li>\n<li>Resize image (-resize)</li>\n<li>Raise image (-raise)</li>\n<li>Roll image (-roll)</li>\n<li>Rotate image (-rotate)</li>\n<li>Shade image (-shade)</li>\n<li>Shear image (-shear)</li>\n<li>Shave (-shave)</li>\n<li>Solarize image (-solarize)</li>\n<li>Spread image (-spread)</li>\n<li>Statistics computation (identify -verbose)</li>\n<li>Swirl (-swirl)</li>\n<li>Threshold channel (-threshold, -operator threshold)</li>\n<li>Threshold image (-threshold)</li>\n<li>Transparent (-transparent)</li>\n<li>Trim image (-trim)</li>\n<li>UnsharpMaskImage (-unsharp)</li>\n<li>Wave (-wave)</li>\n<li>White threshold (-white-threshold)</li>\n</ul>\n</li>\n<li>Improved coder management performance.</li>\n<li>XCF (GIMP) reader is much faster.</li>\n</ul>\n</blockquote>\n<p>New Features:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Use MAGICK_CODER_STABILITY environment variable to enable a subset\nof the coders based on their stability classification.</li>\n<li>Use MAGICK_IO_FSYNC environment variable to cause written file to\nbe synchronized to disk to avoid possible data loss on power fail.</li>\n<li>Added 'compare' command to statistically or visually compare two\nimage files.</li>\n<li>Added new channel operators (-operator):<ul>\n<li>Assign</li>\n<li>Gamma</li>\n<li>Depth</li>\n<li>Negate</li>\n<li>Noise-Gaussian</li>\n<li>Noise-Impulse</li>\n<li>Noise-Laplacian</li>\n<li>Noise-Multiplicative</li>\n<li>Noise-Poisson</li>\n<li>Noise-Uniform</li>\n<li>Threshold</li>\n<li>ThresholdBlack</li>\n<li>ThresholdWhite</li>\n</ul>\n</li>\n<li>New composition operators (-compose):<ul>\n<li>CopyBlack</li>\n<li>CopyCyan</li>\n<li>CopyMagenta</li>\n<li>CopyYellow</li>\n<li>Divide</li>\n</ul>\n</li>\n<li>Added -motion-blur to motion blur the image.</li>\n<li>Mogrify and convert now support -black-threshold and -white-threshold.</li>\n<li>MAT: Now supports reading compressed files.</li>\n<li>FITS: Now supports 8, 16, 32 bit integer, float, and double images\nand writes correct FITS format.</li>\n<li>DCRAW: Coder proxy module allows reading digital camera files as if\nthey were natively supported.</li>\n<li>New C API functions:<ul>\n<li>AddNoiseImageChannel(), add noise to an image channel.</li>\n<li>BlurImageChannel(), blur an image channel.</li>\n<li>GaussianBlurImageChannel(), gaussian blur an image channel.</li>\n<li>ImportImageChannelsMasked(), import selected image channels.</li>\n<li>SharpenImageChannel(), sharpen an image channel.</li>\n<li>UnsharpMaskImageChannel(), unsharpmask an image channel.</li>\n<li>New cache view interfaces to correct shortcomings of original\nones.  New interfaces are AcquireCacheViewPixels(),\nAcquireOneCacheViewPixel(), AcquireCacheViewIndexes(),\nGetCacheViewPixels(), SetCacheViewPixels(), and\nSyncCacheViewPixels(). The deprecated functions are\nAcquireCacheView(), GetCacheView(), SetCacheView(), and\nSyncCacheView().</li>\n<li>GetCacheViewRegion() reports region bounded by a cache view.</li>\n<li>GetCacheViewArea() reports area bounded by a cache view.</li>\n<li>ExportViewPixelArea() exports a cache view as formatted pixels.</li>\n<li>ImportViewPixelArea imports formatted pixels into a cache view.</li>\n</ul>\n</li>\n<li>Removed C API functions:<ul>\n<li>ReadStream()</li>\n<li>WriteStream()</li>\n</ul>\n</li>\n<li>Magick++ C++ API improvements<ul>\n<li>Color class no longer considers transparent black to be an invalid\ncolor.</li>\n<li>New Image methods addNoiseChannel(), blurChannel(),\ngaussianBlurChannel(), motionBlur(), randomThresholdChannel(),\nrandomThresholdChannel(), sharpenChannel(), unsharpmaskChannel().</li>\n</ul>\n</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>-ordered-dither and -random-threshold may now be used to individually\ndither any named channel.</li>\n<li>Mogrify and convert now support -minify to halve the image size.</li>\n<li>Mogrify and convert now support -magnify to double the image size.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"april-29-2008\">\n<h1><a class=\"toc-backref\" href=\"#id38\">1.2 (April 29, 2008)</a></h1>\n<p>Security fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Fixes for CERT security alert TA04-217A described at\n&quot;<a class=\"reference external\" href=\"http://www.us-cert.gov/cas/techalerts/TA04-217A.html\">http://www.us-cert.gov/cas/techalerts/TA04-217A.html</a>&quot;.</li>\n<li>AVI, BMP, &amp; DIB security fixes.</li>\n<li>PSD security fixes.</li>\n<li>P7 format security fix.</li>\n<li>Fix EXIF IFD stack overflow vulnerability.</li>\n<li>SGI security fix for RLE encoding (CVE-2006-4144)</li>\n<li>XCF security fix (CVE-2006-3743)</li>\n<li>PALM heap overflow fix (CVE-2006-5456)</li>\n<li>DCM security fix (CVE-2006-5456)</li>\n<li>Fix for shell command injection in delegate code via file names)\n(CVE-2005-4601).  Delegate execution is much more secure now.</li>\n<li>Don't use filenames as printf specifications (CVE-2006-0082).</li>\n<li>Fix integer overflow in DCM coder (CVE-2007-1797).</li>\n<li>XWD integer overflow fix (CVE-2007-1797).</li>\n<li>Implementation has replaced usage of strcpy, strcat, and strncat\nwith the more security conscious strlcat and strlcpy.</li>\n<li>DCM, DIB, XCF, XBM, and XWD security fix for integer overflow\nvulnerability (IDefense 09.19.07).</li>\n<li>Do not access X11 or invoke convenience or stealth delegate programs\nbased on the file extension. In particular, these file extensions are\nrejected for consideration as a format specifier: 'autotrace',\n'browse', 'dcraw', 'edit', 'gs-color', 'gs-color+alpha', 'gs-gray',\n'gs-mono', 'launch', 'mpeg-encode', 'print', 'scan', 'show', 'win',\n'xc', and 'x'.</li>\n</ul>\n</blockquote>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The configure script now searches for a web browser in the order\nmozilla, firefox, and finally netscape.</li>\n<li>When the user specifies the -units option, the current image\nresolution values are now re-scaled to match the new units.</li>\n<li>Properly determine Ghostscript font location for Ghostscript 8.0 and later.</li>\n<li>GraphicsMagick now successfully builds and passes all tests under\nDigital Unix 5.1, using the vendor compiler.</li>\n<li>Ghostscript sometimes displays an error message and fails, yet it\nreturns a success error code to GraphicsMagick. Verify that\nGhostscript has updated the output file before attempting to use it.</li>\n<li>Fixed a configure script syntax error when testing for trio.</li>\n<li>When requesting a list of formats, all of the modules in the module\nsearch path are considered. Previously only the modules in the same\ndirectory as the LOGO module were listed.</li>\n<li>Ensure that an image clip mask is respected by the negate algorithm.</li>\n<li>The BMP writer was sometimes writing incorrect BMP v4 files.</li>\n<li>Support reading and writing large PCX files.</li>\n<li>The Red Hat source RPM was failing to install the -config scripts\nwith execute permissions.</li>\n<li>Fixed a bug which could cause possible truncation while cloning the\nimage cache.</li>\n<li>Ensure that MIFF files indicate the compression which was actually used.</li>\n<li>Properly handle errors from libtiff so that corrupted images are not\noutput.</li>\n<li>Fix for stripped-TIFF reader. Discard extra samples beyond alpha in\nscanline TIFFs.</li>\n<li>Endian option now controls TIFF byte-order rather than bit-order.</li>\n<li>TIFF writer can now write to pipes and other non-seekable output\ndestinations.</li>\n<li>JBIG writer was writing empty files for some libjbig releases.</li>\n<li>Improved handling of corrupt GIF files.</li>\n<li>Handle large SUN format images.</li>\n<li>Properly compute image depth for 16-bit SGI image files.</li>\n<li>For the gmdisplay program, ensure that only RGB data is sent to Windows.</li>\n<li>Many memory leak fixes.</li>\n<li>PDF writer is fixed so that Ghoscript 8.5 doesn't warn about the output.</li>\n<li>PDF writer now writes proper output with CCITT compression.</li>\n<li>Properly use fseeko() and ftello() if they are available.</li>\n<li>Fixed a infinite loop bug in the XWD reader.</li>\n<li>Fix minor memory leak in ProfileImage().</li>\n<li>Fixed -level command parsing when a percent symbol is supplied within the\nargument rather than at the end.</li>\n<li>Fix pixel scaling problem caused by floating point\nrounding error (noticed under AIX).</li>\n<li>Fixed a memory leak in the GIF coder in the error return path.</li>\n<li>Fix for SourceForge bug id 1353744 &quot;MagickGetQuantumDepth doesn't work&quot;.</li>\n<li>Fix for SourceForge bug id 1315109 &quot;segfault in InitializeMagick(NULL)&quot;.</li>\n<li>Fix for SourceForge bug id 1391421 &quot;problem doing resize on 273x1 JPEG&quot;.</li>\n<li>Fix for SourceForge bug id 1510075 &quot;Failed to write PDF with JPEG compression&quot;.</li>\n<li>Fix for SourceForge bug id 1572357 &quot;GetOnePixel definition appears incorrect&quot;.</li>\n<li>Fix for SourceForge bug id 1576616 Fix includedir variable in pkg-config files&quot;.</li>\n<li>Fix for SourceForge bug id 1173713 &quot;segfault in ModifyCache&quot;.</li>\n<li>Fix for SourceForge bug id 1431805 &quot;clip art wpg files cause access violation\nin graphics magick&quot;.</li>\n<li>Fix for SourceForge bug id 1743141 &quot;Affine matrix option parsing&quot;.</li>\n<li>Fix for SourceForge bug id 1625477 &quot;Memory leak reading layered PSD Image&quot;.</li>\n<li>Fix for SourceForge bug id 1878992 &quot;literal square brackets in file\nname cause large delay and bug id 1783209 &quot;converting runs slowly\nwhen subimage is specified&quot;.</li>\n<li>Fix for SourceForge bug id 1883527 &quot;compression of tiff-file has no effect&quot;.</li>\n<li>Successfully read files in the form &quot;file[123]&quot;.</li>\n<li>Fix reading 12-bit grayscale JPEG.</li>\n<li>Set image depth appropriately when importing image from X11 display.</li>\n<li>Fix map resource tracking.</li>\n<li>Fix reading recent variants of ImageMagick's MIFF format.</li>\n<li>Output bilevel TIFF meeting the TIFF Class F specification.</li>\n</ul>\n</blockquote>\n<p>New Utilities:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>A 'benchmark' subcommand is now available to benchmark the\nperformance of any other arbitrary subcommand (e.g. 'convert').</li>\n</ul>\n</blockquote>\n<p>Feature improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>LZW compression is now enabled by default.</li>\n<li>Support industry-standard subsampling notation like &quot;4:2:2&quot;.</li>\n<li>If gm is executed under a traditional alternate name (e.g.\nconvert), it will invoke the appropriate sub-command. This allows\nuse of hard links, symbolic links, or just copying 'gm' to the\ndesired sub-command name in order to achieve 100% ImageMagick 5.5.2\nutility compatibility.</li>\n<li>Provide the --enable-magick-compat option when configuring to install\nImageMagick utilities compatibility links.</li>\n<li>Identify -verbose output includes normalized (0.0-1.0) statistics.</li>\n<li>Identify and convert now print &quot;pixels per second&quot; rates to help\nevaluate performance.</li>\n<li>Added the identify +ping option to force reading the complete file.</li>\n<li>The display program now supports the +progress option to disable any\nvisual progress indication (and hourglass cursor) while loading images.</li>\n<li>Support writing grayscale TGA files.</li>\n<li>Provide explicit support for Rec 601 and Rec 709 grayscale spaces.</li>\n<li>Include some support for a log RGB space based on the 2.048 density\nrange as defined for the Cineon Digital Film System.</li>\n<li>Added utilities command-line support for industry standard subsampling\nnotation like 4:4:4 and 4:2:2.</li>\n<li>Use MAGICK_IOBUF_SIZE to tune the size of the I/O buffer.</li>\n<li>Use -type Bilevel, Grayscale, TrueColor, or TrueColorMatte to\ninfluence the type of image that Ghostscript returns.</li>\n<li>Use '-define tiff:fill-order={msb2lsb|lsb2msb}' to control TIFF bit\nfill order.</li>\n<li>The -version option now dumps a feature list as well as the build\noptions.</li>\n<li>The -endian option now supports the option 'native'.</li>\n<li>A -monitor is added to enable progress monitoring for the command line\nutilities.</li>\n<li>Use the -output-directory option to 'mogrify' to send output files to\nthe specified directory.</li>\n<li>Use the -create-directories option in conjunction with\n-output-directory and 'mogrify' to create any necessary subdirectories.</li>\n<li>A Pixels resource limit is added.  Use '-limit Pixels value' to limit\nthe maximum number of pixels in an image to 'value'.</li>\n<li>The already supported option '-type Optimize' is now honored by\nformats that need to choose a subformat based on the properties of\nthe image. Grueling tests of many/all pixels are not performed\nunless '-type Optimize' is supplied.</li>\n<li>Added a a -set option to the composite, convert, display, mogrify,\nimport commands in order to allow setting an image attribute.</li>\n<li>Display utility no longer defaults to reading from standard input if\nstdin is not a tty.</li>\n<li>May now be configured to use the umem memory allocation library\navailable in Solaris 9, Update 3 and later, or from the portable umem\nproject.</li>\n</ul>\n</blockquote>\n<p>Coder additions/improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Replaced existing DPX &quot;support&quot; with all-new DPX support conforming\nto the SMPTE 268M-2003 standard.</li>\n<li>Cineon reader completely rewritten.</li>\n<li>TIFF coder is completely re-written. Now supports reading and\nwriting RGB, CMYK, and grayscale, scanline-oriented TIFF images\nwith arbitrary (1 to 32 bits) depth. Includes support for tiled\nTIFF, floating point TIFF, LogLuv TIFF, BigTIFF, arbitrary depths,\nand associated alpha.</li>\n<li>TIFF coder now supports retrieving and saving XMP profiles.</li>\n<li>MATLAB support is much improved and supports writing as well.</li>\n<li>WPG reader now supports CTM translations.</li>\n<li>ART format now supports writing.</li>\n<li>Support 32-bit raw RGB images.</li>\n<li>Support 32-bit raw CMYK images.</li>\n<li>Support 32-bit raw gray images.</li>\n<li>JP2 coder reads images in YCbCr colorspace and retrieves an embedded\nICC ICM color profile if present.</li>\n</ul>\n</blockquote>\n<p>API enhancements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Added ExportImageChannel() and ImportImageChannel() APIs to support\nexporting and importing pixel regions with an arbitary range of (1\nto 32) bits per quantum.</li>\n<li>Added image leveling methods for Magick++.</li>\n<li>Generalized GetImageAttribute() support for retrieving wildcarded\nattributes so that an identify -format specification like\n<tt class=\"docutils literal\"><span class=\"pre\">&quot;%[dpx:*]&quot;</span></tt> works as expected.</li>\n<li>Incorporated changes changes necessary so that GraphicsMagick can\nwork with the Ch C/C++ interpreter from SoftIntegration at\n<a class=\"reference external\" href=\"http://www.softintegration.com/\">http://www.softintegration.com/</a>.</li>\n<li>Added MagickAllocFunctions() to allow the API user to replace the\nunderlying memory allocator functions.</li>\n<li>Added MagickMalloc() and deprecated AcquireMemory().</li>\n<li>Added MagickCloneMemory() and deprecated CloneMemory().</li>\n<li>Added MagickMallocArray() to safely allocate N items of size S.</li>\n<li>Added MagickRealloc() and deprecated ReacquireMemory().</li>\n<li>Added MagickFree() and deprecated LiberateMemory().</li>\n</ul>\n</blockquote>\n<p>Performance improvments:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The DispatchImage() and ConstituteImage() functions incorporate\nspecial case code for BGR, BGRO, BGRP, RGB, RGBO, and I formats (8\nbit only) in order to improve performance dramatically.</li>\n<li>When writing very large JPEG images, don't enable Huffman compression\nsince doing so requires libjpeg to buffer the entire image in memory.</li>\n<li>When using the 'identify' -verbose option, -verbose must be specified\ntwice in order to obtain the color count.  This makes normal use of\n-verbose much faster.</li>\n<li>Significantly improved read/write speed for bilevel and gray images.</li>\n<li>TIFF I/O is considerably faster.</li>\n<li>Postscript writer is 10-15X faster.</li>\n<li>PNM formats writer is 10-100X faster.</li>\n<li>Rotate by 90 or 270 degrees is 2-9X faster.</li>\n</ul>\n</blockquote>\n<p>Windows-specific improvements/changes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>For the MinGW and Cygwin builds, the Magick++ library is forced to\nbuild as a static library since otherwise C++ exceptions don't work.</li>\n<li>MinGW cross-build is available from a Linux or FreeBSD host.</li>\n<li>Determine location of Ghostscript fonts only once in order to improve\nperformance.</li>\n<li>Updated bzip2 to 1.0.4.</li>\n<li>Updated Jasper library to version 1.900.1.</li>\n<li>Updated jbigkit to 1.6</li>\n<li>Updated lcms to 1.17</li>\n<li>Updated libpng to 1.2.27.</li>\n<li>Updated libtiff to 3.8.2</li>\n<li>Updated zlib to 1.2.3.</li>\n<li>Libtiff supports LZW compression.</li>\n<li>X11 is no longer part of the default build and will not be included\nin the distributed install packages (but can still be built).</li>\n<li>Find latest Ghostscript which idenfies itself as &quot;GPL Ghostscript&quot;.</li>\n<li>Use GlobalMemoryStatusEx(), if available, to determine how much\nphysical memory is available. Important for large-memory machines.</li>\n<li>Fixed NTreaddir() so that it does not write beyond its buffer.</li>\n<li>Fixed opendir() emulation function so it can't overwrite the stack.</li>\n<li>FlashPIX library sources are no longer distributed in the Windows\nsource package and building FlashPIX is disabled by default.\nFlashPIX may still be built by adding the library (separately\ndistributed).</li>\n<li>Fix bitmap handle leak in CropImageToHBITMAP() and ImageToHBITMAP().</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"released-april-4-2004\">\n<h1><a class=\"toc-backref\" href=\"#id39\">1.1 (Released April 4, 2004)</a></h1>\n<p>Bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Semaphore fix which is necessary for proper multi-threaded operation.</li>\n<li>Configure script fix to ensure that -lfpx is not supplied to the C\ncompiler during subsequent tests since this fails on some systems.</li>\n<li>Fix for East and West gravity computations.</li>\n<li>System error reports (errno) associated with an exception are now\ncorrectly obtained from the context existing when the exception was\nthrown rather than the context of the reporting function.</li>\n<li>JNG encoder fix. Files were being written with incorrect\nalpha_sample_value in the header. These can be repaired by reading\nthem into GM 1.1 and rewriting them.</li>\n<li>XPM fix to module registration.</li>\n<li>PSD fix for index calculation when QuantumDepth&gt;8.</li>\n<li>Validate that geometry specifications only include allowed\ncharacters.</li>\n<li>SGI fix to save compression type while writing.</li>\n<li>EXIF attributes were not being retrieved when requested.</li>\n<li>Fix for bug when reading an image via a user-provided file\ndescriptor.</li>\n<li>The reported image magick string is now always that of the original\ninput file (it was sometimes being reported as the format produced by\nan intermediate delegate program).</li>\n<li>Fixes to color profiling of CMYK images.</li>\n<li>Memory leak fixed in DrawClipPath().</li>\n<li>Arc drawing is fixed.</li>\n<li>Command-line parsing bug under Linux due to Linux's sscanfs\ninability to parse strings like &quot;0x1&quot; as &quot;%fx%f&quot; is fixed.</li>\n<li>Scaling of 5 and 6-bit colors was slightly incorrect in BMP, AVI,\nDIB, and TIM datastreams.</li>\n<li>GM utility now reports an error rather than silently returning if\nan unsupported sub-command is provided.</li>\n<li>TIFF coder was writing 16-bit per sample RGB images incorrectly on\nlittle-endian CPUs.</li>\n</ul>\n</blockquote>\n<p>Performance improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Texture tiling is now 7X faster.</li>\n<li>Color profile processing speed improvements for colormapped images.</li>\n</ul>\n</blockquote>\n<p>Utilities enhancements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>For Unix, 'gm version' now includes a dump of the configure and\nbuild parameters.</li>\n<li>Logging of thrown exceptions is now supported. Use '-debug\nexception'. This is useful to learn when and where errors are\nreported.</li>\n<li>The -define option is added in order to support supplying\nadditional options to coders without needing to add additional\ncommand line options or structure members.</li>\n<li>The output of 'gm identify -verbose' now provides a nice dump\nof EXIF data.</li>\n<li>The -sampling-factor option now accepts as many HxV pairs as\nthere are JPEG components.  Omitted ones default to 1x1.</li>\n<li>The convert and montage commands now support an -operator command to\nperform arithmetic and bitwise operations on specified image channels.</li>\n</ul>\n</blockquote>\n<p>Coder additions/improvements</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The META coder supports wide characters for the IPTC and 8BIM\nformats.</li>\n<li>The XTRN coder now supports wide characters.</li>\n<li>An &quot;IMAGE&quot; coder is provided which provides access to a large\nnumber of images (derived from XFig) suitable for use as patterns,\nor as test images.</li>\n<li>The &quot;PATTERN&quot; coder now returns an image pattern tiled to size\n(equivalent results to TILE:IMAGE:pattern). This is for ImageMagick\ncompatibility.</li>\n<li>The CINEON coder now supports reading and writing images in CINEON\n&quot;CIN&quot; linear gray and RGB formats. The read support is still very\nweak, but it works for common images.</li>\n<li>The JPEG coder now estimates the original JPEG quality and sampling\nfactors and will reuse these options when writing JPEG if the image\nis of the same type and the option &quot;-define JPEG:preserve-settings&quot;\nis supplied.</li>\n<li>The JPEG-2000 coder now supports all Jasper library arguments using\ncommand line syntax similar to '-define jp2:rate=0.5'.</li>\n<li>Reading and writting compressed SVG (SVGZ) is now supported.</li>\n<li>The TXT coder now observes depth when writing.</li>\n<li>The TIFF coder now outputs colormapped images with 1, 2, 4, and 8\nbits per sample in order to provide much smaller file sizes for\nimages with very few colors.</li>\n<li>Many TIFF coder enhancements. Now reads colormapped and grayscale\nimages at arbitrary (even odd) bits-per-sample sizes. Now properly\nsupports an opacity channel (at any bits-per-sample value) for\ngrayscale images. Bilevel grayscale images are treated similar to any\nother grayscale image unless CCITT FAX3/FAX4 compression is\nrequested. Now allows the user to specify an arbitrary\nbits-per-sample value for grayscale images (even odd values) using\n&quot;-define tiff:bits-per-sample=value&quot;. Now automatically stores the\nimage as TrueColor RGB pixels if the image compression is set to JPEG.\nTIFF files are now written in using the TIFF library's default endian\norder rather than always big endian.</li>\n<li>The WPG coder now renders embedded WMFs.</li>\n<li>The PS3 coder is completely re-written to work much better and\nsupport more features (see ChangeLog).</li>\n</ul>\n</blockquote>\n<p>Code structure enhancements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Error handling has been improved and validated through testing.\nSome errors were being lost, unnecessarily ignored, or reported as\nsomething else entirely.</li>\n<li>The number of error text messages to be maintained has been reduced\nby consolidating similar messages.</li>\n<li>The memory allocator functions have been replaced with similar\nmacros in order to eliminate warnings with GCC 3.3, avoid\naccidentally casting away const, and allow memory debuggers to\nreport memory allocations and frees against the correct functions.\nThe previously-used functions remain in the library for the purpose\nof compatibility.</li>\n<li>&lt;magick/xwindow.h&gt; no longer depends on magick_config.h defines.</li>\n<li>The text string localization code has been replaced with a simpler\nversion written by Bill Radcliffe.</li>\n<li>Added key,value &quot;map&quot; APIs (somewhat similar to C++'s &lt;map&gt;) for\ninternal use.</li>\n</ul>\n</blockquote>\n<p>API enhancements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Incorporated John Cristy's Wand API's in a new GraphicsMagickWand\nlibrary.</li>\n<li>API definition is no longer dependent on types which vary in size\n(e.g. size_t) depending on large file compilation options.  This means\nthat applications may now be compiled without any special large file\noptions and still work properly with the library.</li>\n<li>Thrown exceptions (ExceptionInfo structure) now include source\nfile, source line, function name, and current system error number.</li>\n<li>The GetMagickInfoArray() function is added to replace use of\nGetMagickInfo() for code which needs to access the coder list. This\nis necessary since invoking GetMagickInfo() may re-order the coder\nlist, causing problems for code which traverses the list. Using\nGetMagickInfo() to access individual list elements is safe.</li>\n<li>Added the CopyException function to support copying exception info\nfrom one structure to another.</li>\n<li>Added the ReplaceImageInList function to replace an image in an\nimage list.</li>\n<li>Added the DrawPeekGraphicContext function to access the current\nDrawInfo structure in the drawing context stack. Use of this\nfunction is not recommended since it voilates proper programming\npractices. It is added to support the Wand API's.</li>\n<li>GetImageDepth() now returns an integral value between 1 and\nQuantumDepth and is no longer limited to the values 8, 16, and 32.</li>\n<li>SetImageDepth() supports setting the image modulus depth to any\nintegral value between 1 and QuantumDepth. This effects the effective\nnumeric precision, not the storage depth, since the quantum storage\ntype is still a Quantum.</li>\n<li>GetImageChannelDepth() supports retrieving the modulus depth for a\nspecified channel.</li>\n<li>SetImageChannelDepth() supports setting the modulus depth for a\nspecified channel.</li>\n<li>ProfileImage is updated to handle alpha channels and grayscale\nimages.</li>\n<li>Added GetImageProfile() to retrieve a CMS profile from an image.</li>\n<li>Added SetImageProfile() to attach a CMS profile to an image without\nadjusting the image pixels.</li>\n<li>Added DeleteImageProfile() to remove a CMS profile from an image.</li>\n<li>ConstituteImage() and DispatchImage() now support 'T' (transparency),\n'O' (opacity), and 'P' (pad) options.</li>\n<li>CompositeImage() now supports CopyCyanCompositeOp,\nCopyMagentaCompositeOp, CopyYellowCompositeOp, and\nCopyBlackCompositeOp, composition operators.</li>\n<li>GetColorHistogram() obtains a color histogram for the image.</li>\n<li>QuantumOperatorImage() and QuantumOperatorRegionImage() support\narithmetic and bitwise operations on specified image channels.</li>\n<li>The semaphore.h header is no longer installed or included in the\nAPI headers since these functions are private interfaces.</li>\n<li>Configure using --enable-symbol-prefix or define\nPREFIX_MAGICK_SYMBOLS to use the C preprocessor to prefix all library\nsymbols with &quot;Gm&quot;. This prevents library symbol conflicts with other\nlibraries.</li>\n</ul>\n</blockquote>\n<p>PerlMagick fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Adjusted a number of function option names so that they match the\ndocumentation.</li>\n<li>Memory leak fixed.</li>\n<li>Reading files (e.g. GIF) via a file descriptor is fixed.</li>\n</ul>\n</blockquote>\n<p>Build improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The TRIO library may be used to provide a replacement for vsnprintf\nif the C library doesn't provide it.  This improves security on old\nsystems.</li>\n<li>Configure only configures for C &amp; C++ languages.</li>\n<li>Configure now does a better job of figuring out how to build a\nthread-safe library across multiple operating systems.</li>\n<li>Configure incorporates a new mmap() test which tests the\nfunctionality which is needed so that mmap() is not unnecessarily\nrejected on a number of systems. This improves performance for large\nfiles on those systems.</li>\n<li>Configure/build fixes for IBM's AIX operating system.</li>\n</ul>\n</blockquote>\n<p>Windows-specific improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>The static install package now uses the &quot;uninstalled&quot;\nconfiguration so that it does not depend on the Windows registry in\norder to run. This allows files from the static install package to\nbe copied to another computer without running an installer.</li>\n<li>The executable search path is extended at run-time to include the\ndirectory where the CORE DLLs reside in order to ensure that they\nare found.</li>\n<li>Adding the -t option to VisualMagick configure enables building\nall of the coders into one library in order to save build time and\nsimplify linkage.</li>\n<li>The XTRN coder now supports wide characters.</li>\n<li>LCMS library updated to version 1.10.</li>\n<li>GMDisplay displays a checkerboard pattern behind transparent images.</li>\n<li>Support is provided for issuing log messages to the Windows standard\nlogging system.</li>\n<li>Project files are now provided for use with Borland C++ Builder 6.0.</li>\n<li>Updated LCMS version to 1.12.</li>\n<li>Updated FreeType version to 2.1.5.</li>\n<li>Updated JBIG-KIT to version 1.5.</li>\n<li>Updated libpng to version 1.2.5.</li>\n<li>Updated libwmf to version 0.2.8.2.</li>\n<li>Updates zlib to version 1.2.1.</li>\n<li>ActivePerl 5.8.1 Build 807 now supported.</li>\n<li>GraphicsMagick now compiles using Visual Studio .NET 2003.</li>\n</ul>\n</blockquote>\n</div>\n<hr class=\"docutils\" />\n<div class=\"section\" id=\"released-in-may-2003\">\n<h1><a class=\"toc-backref\" href=\"#id40\">1.0 (Released in May, 2003)</a></h1>\n<p>GraphicsMagick support services:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Master web site at &quot;<a class=\"reference external\" href=\"http://www.GraphicsMagick.org/\">http://www.GraphicsMagick.org/</a>&quot;.</li>\n<li>Mailing lists, bug tracking, and forums available via\n&quot;<a class=\"reference external\" href=\"https://sourceforge.net/projects/graphicsmagick/\">https://sourceforge.net/projects/graphicsmagick/</a>&quot;.</li>\n<li>Mercurial Web via &quot;<a class=\"reference external\" href=\"http://hg.code.sf.net/p/graphicsmagick/code/\">http://hg.code.sf.net/p/graphicsmagick/code/</a>&quot;.</li>\n<li>Mercurial mirror via SourceForge (find instructions at\n&quot;<a class=\"reference external\" href=\"http://www.graphicsmagick.org/Hg.html\">http://www.graphicsmagick.org/Hg.html</a>&quot;).</li>\n<li>FTP via &quot;<a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick\">ftp://ftp.graphicsmagick.org/pub/GraphicsMagick</a>&quot;.</li>\n</ul>\n</blockquote>\n<p>Project maintenance improvements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>ChangeLog conforms to the GNU standard and all CVS commits include\nuseful log messages.</li>\n<li>CVS commit messages posted to graphicsmagick-commit mail list.</li>\n<li>CVS commit messages contain CVSWeb URL references.</li>\n</ul>\n</blockquote>\n<p>Footprint changes from ImageMagick:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Library -lMagick renamed to -lGraphicsMagick.</li>\n<li>Library -lMagick++ renamed to -lGraphicsMagick++.</li>\n<li>Utilities consolidated into a single 'gm' utility (e.g. use 'gm\nconvert').</li>\n<li>Script Magick-config renamed to GraphicsMagick-config.</li>\n<li>Script Magick++-config renamed to GraphicsMagick++-config.</li>\n<li>Headers installed under ${PREFIX}/include/GraphicsMagick.</li>\n<li>PerlMagick namespace renamed from &quot;Image::Magick&quot; to &quot;Graphics::Magick&quot;.</li>\n<li>Pkgconfig files GraphicsMagick.pc and GraphicsMagick++.pc are\ninstalled in $libdir/pkgconfig to assist pkg-config users.</li>\n<li>Coder modules installed to lib/GraphicsMagick-1.0/modules-Q8/coders.</li>\n<li>Filter modules installed to lib/GraphicsMagick-1.0/modules-Q8/filters.</li>\n</ul>\n</blockquote>\n<p>Many performance enhancements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Default QuantumDepth is 8 since this is adequate for most purposes\nand more efficient than 16.</li>\n<li>The Magick++ demo (compiled with QuantumDepth=8 and -O2) runs about\n1.8X faster under SPARC/Solaris than the same demo with ImageMagick\n5.5.4.</li>\n<li>Colorspace transformations are much faster.</li>\n<li>Grayscale/monochrome image handling is much faster.</li>\n<li>PseudoClass image handling is faster.</li>\n<li>Text annotations using FreeType are much faster.</li>\n<li>Image file I/O is much faster.</li>\n<li>RLE-compressed MIFF reading much faster.</li>\n</ul>\n</blockquote>\n<p>Code structure enhancements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>All utility support functions moved to magick/command.c in order to\nsignificantly reduce link dependencies, allowing statically-linked\nprograms to be smaller.</li>\n<li>Use of MogrifyImage() eliminated except for by utilities.</li>\n<li>Re-builds due to changes to &lt;magick/image.h&gt; reduced by splitting the\nheader into multiple headers.</li>\n<li>ISO C '99 typedefs (gm_int16_t, gm_uint16_t, gm_int32_t, gm_uint32_t,\ngm_int64_t, gm_uint64_t) are available for use.</li>\n</ul>\n</blockquote>\n<p>Feature enhancements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Module loader always enabled for shared builds to allow extension.</li>\n<li>Loading of arbitrary filter modules (via -process option) supported\nunder Unix as well as Windows.</li>\n<li>SVG coder allows specifying size and initial background color.</li>\n<li>JPEG-2000 coder (JP2) updated to work with Jasper 1.7.</li>\n<li>HWB and HSL image colorspace translation support.</li>\n<li>JNG/MNG/PNG format support tracks ImageMagick version.</li>\n<li>BMP encoder can write 16-color indexed BMPs now as well as 2-color\nBMPs (not restricted to monochrome).</li>\n<li>TIFF decoder now includes optimized support for tiled and stripped\nTIFF.</li>\n<li>The -random-threshold option (RandomThresholdImage()) is added to\nthreshold an image to bilevel using random thresholding.</li>\n</ul>\n</blockquote>\n<p>Major bug fixes:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>100% successful test completion at all quantum depths (8/16/32).</li>\n<li>A temporary file management subsystem is added to ensure that all\ntemporary files are removed before program exit. Temporary files are\ncreated and used in a secure fashion to avoid the possibility that a\n&quot;trojan&quot; temporary file (e.g. a symbolic link, or a file containing\nunsafe content) is created before a delegate has the chance to write\nto it. The environment variable MAGICK_TMPDIR allows the user to\nspecify where temporary files are created without altering where\nother programs create their temporary files. Temporary filenames are\ncreated in 8+3 format to hopefully be more acceptable to ralcgm.</li>\n<li>When dithering is disabled, don't dither when converting to a\nPseudoClass, grayscale, or monochrome image. Disabling dithering\nmay cause these translations to be much faster.</li>\n<li>PICON format works with BLOBs.</li>\n<li>No longer removes input file when pinging a FlashPIX file.</li>\n<li>Arc drawing and texture fill fixes from ImageMagick.</li>\n<li>Sample, scale and affine fixes from ImageMagick.</li>\n<li>MIFF colormaps are now scaled properly while reading.</li>\n<li>CMYK translation works for QuantumDepth=32.</li>\n<li>ConstituteImage now works properly for grayscale images.</li>\n<li>Built-in tilde expansion and filename globbing now works properly.</li>\n<li>InitializeMagick now registers signal handlers to ensure that\nresources are released before program exit.  This helps avoid\ntemporary file leaks due to the user using &quot;CONTROL-C&quot;.</li>\n<li>The installed &lt;magick/magick_config.h&gt; header now only contains\nthe few definitions required by the API headers.  This should\nsignificantly reduce or eliminate conflicts with other package\nheaders.</li>\n</ul>\n</blockquote>\n<p>Windows platform enhancements:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Configure updated for Visual C++ 7.0.</li>\n<li>OLE object (ImageMagickObject) re-written to work with Visual C++ 7.0</li>\n<li>New function, CropImageToHBITMAP(), to return a region of the image\nas a Windows HBITMAP.</li>\n<li>Use vsnprintf to format strings under Windows (safer).</li>\n</ul>\n</blockquote>\n<hr class=\"docutils\" />\n<p>On November 19, 2002, GraphicsMagick was created as a fork of\nImageMagick, several days before the ImageMagick 5.5.2 release.</p>\n<p>The objectives of GraphicsMagick are to:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Use an open development model.</li>\n<li>Encourage new developers to join the project.</li>\n<li>Avoid unnecessary source code &quot;churn&quot;.</li>\n<li>Establish and preserve a stable API.</li>\n<li>Use efficient coding practices which result in fast code.</li>\n<li>Improve memory efficiency.</li>\n<li>Use a release process which assures a working product.</li>\n<li>Maintain an accurate ChangeLog.</li>\n</ul>\n</blockquote>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2018</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/OpenMP.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>OpenMP in GraphicsMagick</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"openmp-in-graphicsmagick\">\n<h1 class=\"title\">OpenMP in GraphicsMagick</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#overview\" id=\"id1\">Overview</a></li>\n<li><a class=\"reference internal\" href=\"#limitations\" id=\"id2\">Limitations</a></li>\n<li><a class=\"reference internal\" href=\"#openmp-variables\" id=\"id3\">OpenMP Variables</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"overview\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Overview</a></h1>\n<p>GraphicsMagick has been transformed to use <a class=\"reference external\" href=\"http://openmp.org/\">OpenMP</a> for the 1.3 release\nseries. OpenMP is a portable framework for accelerating CPU-bound and\nmemory-bound operations using multiple threads. OpenMP originates in\nthe super-computing world and has been available in one form or\nanother since the late '90s.</p>\n<p>Since GCC 4.2 has introduced excellent OpenMP support via <a class=\"reference external\" href=\"http://gcc.gnu.org/onlinedocs/libgomp/\">GOMP</a>,\nOpenMP has become available to the masses.  Recently, <a class=\"reference external\" href=\"https://clang.llvm.org/\">Clang</a> has\nalso implemented good OpenMP support. Microsoft Visual Studio\nProfessional 2005 and later support OpenMP so Windows users can\nbenefit as well. Any multi-CPU and/or multi-core system is potentially\na good candidate for use with OpenMP.  Modern multi-core chipsets from\nAMD, Intel, IBM, Oracle, and ARM perform very well with OpenMP.</p>\n<p>Most image processing routines are comprised of loops which iterate\nthrough the image pixels, image rows, or image regions. These loops\nare accelerated using OpenMP by executing portions of the total loops\nin different threads, and therefore on a different processor\ncore. CPU-bound algorithms benefit most from OpenMP, but memory-bound\nalgorithms may also benefit as well since the memory is accessed by\ndifferent CPU cores, and sometimes the CPUs have their own path to\nmemory. For example, the AMD Opteron is a <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Non-uniform_memory_access\">NUMA</a> (Non-Uniform Memory\nArchitecture) design such that multi-CPU systems split the system\nmemory across CPUs so each CPU adds more memory bandwidth as well.\nServer-class CPUs offer more independent memory channels than desktop\nCPUs do.</p>\n<p>For severely CPU-bound algorithms, it is not uncommon to see a linear\nspeed-up (within the constraints of <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Amdahl%27s_law\">Amdahl's law</a>) due to the number\nof cores. For example, a two core system executes the algorithm twice\nas fast, and a four core system executes the algorithm four times as\nfast. Memory-bound algorithms scale based on the memory bandwith\navailable to the cores. For example, memory-bound algorithms scale up\nto almost 1.5X on my four core Opteron system due to its <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Non-uniform_memory_access\">NUMA</a>\narchitecture. Some systems/CPUs are able to immediately context switch\nto another thread if the core would be blocked waiting for memory,\nallowing multiple memory accesses to be pending at once, and thereby\nimproving throughput.  For example, typical speedup of 20-32X (average\n24X) has been observed on the Sun SPARC T2 CPU, which provides 8\ncores, with 8 virtual CPUs per core (64 threads).</p>\n<p>An approach used in GraphicsMagick is to recognize the various access\npatterns in the existing code, and re-write the algorithms (sometimes\nfrom scratch) to be based on a framework that we call &quot;pixel iterators&quot;.\nWith this approach, the computation is restricted to a small unit (a\ncallback function) with very well defined properties, and no knowledge as\nto how it is executed or where the data comes from. This approach removes\nthe loops from the code and puts the loops in the framework, which may be\nadjusted based on experience. The continuing strategy will be to\nrecognize design patterns and build frameworks which support those\npatterns. Sometimes algorithms are special/exotic enough that it is much\neasier to instrument the code for OpenMP rather than to attempt to fit\nthe algorithm into a framework.</p>\n<p>Since OpenMP is based on multi-threading, multiple threads access the\nunderlying pixel storage at once. The interface to this underlying\nstorage is called the &quot;pixel cache&quot;. The original pixel cache code\n(derived from ImageMagick) was thread safe only to the extent that it\nallowed one thread per image. This code has now been re-written so that\nmultiple threads may safely and efficiently work on the pixels in one\nimage. The re-write also makes the pixel cache thread safe if a\nmulti-threaded application uses an OpenMP-fortified library.</p>\n<p>GraphicsMagick provides its own built-in 'benchmark' driver utility\nwhich may be used to execute a multi-threaded benchmark of any other\nutility command.</p>\n<p>Using the built-in 'benchmark' driver utility, the following is an\nexample of per-core speed-up due to OpenMP on a four-core AMD Opteron\nsystem (with Firefox and other desktop software still running).  The\nimage is generated dynamically based on the 'granite' pattern and all\nthe pixel quantum values have 30% gaussian noise added:</p>\n<pre class=\"literal-block\">\n% gm benchmark -stepthreads 1 -duration 10 convert \\\n  -size 2048x1080 pattern:granite -operator all Noise-Gaussian 30% null:\nResults: 1 threads 5 iter 11.34s user 11.340000s total 0.441 iter/s 0.441 iter/cpu 1.00 speedup 1.000 karp-flatt\nResults: 2 threads 9 iter 20.34s user 10.190000s total 0.883 iter/s 0.442 iter/cpu 2.00 speedup 0.000 karp-flatt\nResults: 3 threads 14 iter 31.72s user 10.600000s total 1.321 iter/s 0.441 iter/cpu 3.00 speedup 0.001 karp-flatt\nResults: 4 threads 18 iter 40.84s user 10.460000s total 1.721 iter/s 0.441 iter/cpu 3.90 speedup 0.008 karp-flatt\n</pre>\n<p>Note that the &quot;iter/s cpu&quot; value is a measure of the number of\niterations given the amount of reported CPU time consumed. It is an\neffective measure of relative efficacy since its value should ideally\nnot drop as iterations are added.  The <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Karp%E2%80%93Flatt_metric\">karp-flatt metric</a> is another\nuseful metric for evaluating thread-speedup efficiency. In the above\nexample, the total speedup was about 3.9X with only a slight loss of\nCPU efficiency as threads are added.</p>\n</div>\n<div class=\"section\" id=\"limitations\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Limitations</a></h1>\n<p>Often it is noticed that the memory allocation functions (e.g. from\nthe standard C library such as GNU libc) significantly hinder\nperformance since they are designed or optimized for single-threaded\nprograms, or prioritize returning memory to the system over speed.\nMemory allocators are usually designed and optimized for programs\nwhich perform thousands of small allocations, and if they make a large\nmemory allocation, they retain that memory for a long time.\nGraphicsMagick performs large memory allocations for raster image\nstorage interspersed with a limited number of smaller allocations for\nsupportive data structures.  This memory is released very quickly\nsince GraphicsMagick is highly optimized and thus the time between\nallocation and deallocation can be very short.  It has been observed\nthat some memory allocators are much slower to allocate and deallocate\nlarge amounts of memory (e.g. a hundred megabytes) than alternative\nallocators, even in single-threaded programs.  Under these conditions,\nthe program can spend considerable time mysteriously &quot;sleeping&quot;.</p>\n<p>In order to help surmount problems with the default memory allocators,\nthe configure script offers support for use of Google <a class=\"reference external\" href=\"https://github.com/gperftools/gperftools\">gperftools</a> <a class=\"reference external\" href=\"https://github.com/gperftools/gperftools/wiki\">'tcmalloc'</a>, Solaris mtmalloc,\nand Solaris umem libraries via the --with-tcmalloc, --with-mtmalloc,\nand --with-umem options, respectively.  When the allocation functions\nare behaving badly, the memory allocation/deallocation performance\ndoes not scale as threads are added and thus additional threads spend\nmore time sleeping (e.g. on a lock, or in munmap()) rather than doing\nmore work.  Performance improvements of a factor of two are not\nuncommon even before contending with the hugh CPU core/thread counts\navailable on modern CPUs.  Using more threads which are slowed by\npoorly-matched memory allocation functions is wasteful of memory,\nsystem resources, human patience, and electrical power.</p>\n<p>Many modern CPUs support &quot;Turbo&quot; modes where the CPU clock rate is\nboosted if only a few cores are active.  When a CPU provides a &quot;Turbo&quot;\nmode, this decreases the apparent speed-up compared to using one\nthread because the one thread was executed at a much higher clock\nrate.  Likewise, when a CPU becomes very hot (due to being heavily\nused), it may decrease its clock rates overall to avoid burning up,\nand this may also decreases the actual speed-up when using many\nthreads compared to using one thread.  Many CPUs support\n&quot;hyperthreads&quot; or other mechanisms in which one physical core will\nsupport multiple light-weight threads, and if the core is efficiently\nused by one thread, then this will decrease the apparent per-thread\nspeed-up but the peak speed-up will hopefully still be bounded by the\nnumber of physical cores.</p>\n<p>In most cases, OpenMP does not speed-up loading an image from a file,\nor writing an image to a file.  It is common for file decode and\nencode to take longer than processing the image.  Using uncompressed\nformats is recommended with a fast I/O subsystem (or in-memory 'blobs'\nin order to obtain the greated speed-up from OpenMP.</p>\n<p>It has been observed that sometimes it takes much longer to start and\nstop GraphicsMagick than it takes for it to run the requested\nalgorithm.  The slowness is due to inefficiencies of the libraries\nthat GraphicsMagick is linked with (especially the ICU library that\nlibxml2 is often linked with).  If GraphicsMagick takes too long to\nperform trivial operations, then consider using the 'modules' build,\nand investigate the 'batch' utility which allows running many\nGraphicsMagick commands as a 'batch' script.  If a 'modules' build is\nnot feasible, then configuring GraphicsMagick to only support the\nspecific formats actually needed can help with its execution time and\nimprove opportunity for OpenMP speed-up.</p>\n</div>\n<div class=\"section\" id=\"openmp-variables\">\n<h1><a class=\"toc-backref\" href=\"#id3\">OpenMP Variables</a></h1>\n<p>According to the OpenMP specification, the OMP_NUM_THREADS evironment\nvariable may be used to specify the number of threads available to the\napplication. Typically this is set to the number of processor cores on\nthe system but may be set lower to limit resource consumption or (in\nsome cases) to improve execution efficiency.  The GraphicsMagick\ncommands also accept a <tt class=\"docutils literal\"><span class=\"pre\">-limit</span> threads limit</tt> type option for\nspecifying the maximum number of threads to use.</p>\n<hr class=\"docutils\" />\n<div class=\"line-block\">\n<div class=\"line\">Copyright (C) 2008 - 2020 GraphicsMagick Group</div>\n</div>\n<p>This program is covered by multiple licenses, which are described in\nCopyright.txt. You should have received a copy of Copyright.txt with this\npackage; otherwise see <a class=\"reference external\" href=\"http://www.graphicsmagick.org/Copyright.html\">http://www.graphicsmagick.org/Copyright.html</a>.</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/README.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Installing GraphicsMagick</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"installing-graphicsmagick\">\n<h1 class=\"title\">Installing GraphicsMagick</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#executive-summary\" id=\"id1\">Executive Summary</a></li>\n<li><a class=\"reference internal\" href=\"#availability\" id=\"id2\">Availability</a></li>\n<li><a class=\"reference internal\" href=\"#documentation\" id=\"id3\">Documentation</a></li>\n<li><a class=\"reference internal\" href=\"#installation\" id=\"id4\">Installation</a></li>\n<li><a class=\"reference internal\" href=\"#add-on-libraries-programs\" id=\"id5\">Add-On Libraries &amp; Programs</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"executive-summary\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Executive Summary</a></h1>\n<p>GraphicsMagick provides a comprehensive collection of utilities,\nprogramming interfaces, and GUIs, to support file format conversion,\nimage processing, and 2D vector rendering.</p>\n<p>GraphicsMagick is originally based on ImageMagick from ImageMagick Studio\n(which was originally written by John Cristy at Dupont). The goal of\nGraphicsMagick is to provide the highest quality product possible while\nencouraging open and active participation from all interested developers.\nThe GraphicsMagick usage license is designed to allow it to be used for\nany application, including proprietary or GPLed applications. Please see\nthe file <a class=\"reference external\" href=\"Copyright.html\">Copyright.txt</a> for the GraphicsMagick licence.</p>\n</div>\n<div class=\"section\" id=\"availability\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Availability</a></h1>\n<p>The master ftp site for GraphicsMagick distributions is\n<a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/\">ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/</a>. Bandwidth on this\nsite is very limited, so it is recommended to download from SourceForge\nat <a class=\"reference external\" href=\"http://sourceforge.net/projects/graphicsmagick/files/\">http://sourceforge.net/projects/graphicsmagick/files/</a> if\npossible.</p>\n<p>GraphicsMagick is a continual work in progress. The very latest code\nis available via the Mercurial distributed source control management\ntool (<a class=\"reference external\" href=\"https://www.mercurial-scm.org/\">https://www.mercurial-scm.org/</a>). GraphicsMagick may be retrieved\nvia the following command:</p>\n<blockquote>\nhg clone <a class=\"reference external\" href=\"http://hg.code.sf.net/p/graphicsmagick/code/\">http://hg.code.sf.net/p/graphicsmagick/code/</a> GM</blockquote>\n<p>Mercurial provides a complete stand-alone repository which contains\nthe full history of the GraphicsMagick project.  You may use the\ncloned repository for your own purposes related to GraphicsMagick\n(e.g. manage local GraphicsMagick changes), and can easily pull\nGraphicsMagick updates from the main repository whenever you like.</p>\n</div>\n<div class=\"section\" id=\"documentation\">\n<h1><a class=\"toc-backref\" href=\"#id3\">Documentation</a></h1>\n<blockquote>\nOpen the file index.html in a web browser, or refer to the gm(1) manual\npage. Also read the GraphicsMagick frequently asked questions in the\nfile <a class=\"reference external\" href=\"FAQ.html\">www/FAQ.html</a>.</blockquote>\n</div>\n<div class=\"section\" id=\"installation\">\n<h1><a class=\"toc-backref\" href=\"#id4\">Installation</a></h1>\n<blockquote>\n<p>GraphicsMagick may be compiled from source code for virtually any\nmodern Unix system (including Linux and MacOS X) and Microsoft Windows.\nInstallation instructions may be found in the following files (or their\nHTML equivalents):</p>\n<ul>\n<li><p class=\"first\">Unix / Linux / *BSD / MacOS-X / Cygwin / MinGW:</p>\n<p><a class=\"reference external\" href=\"INSTALL-unix.html\">Installation on Unix-like systems</a></p>\n</li>\n<li><p class=\"first\">Microsoft Windows (Via &quot;setup&quot; style installer or from source code):</p>\n<p><a class=\"reference external\" href=\"INSTALL-windows.html\">Installation on Microsoft Windows</a></p>\n</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"add-on-libraries-programs\">\n<h1><a class=\"toc-backref\" href=\"#id5\">Add-On Libraries &amp; Programs</a></h1>\n<p>To further enhance the capabilities of GraphicsMagick, you may want to\nget these programs or libraries. Note that these packages are already\nintegrated into the GraphicsMagick Mercurial repository for use when\nbuilding under Microsoft Windows:</p>\n<ul>\n<li><p class=\"first\">GraphicsMagick requires the BZLIB library from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.sourceware.org/bzip2/\">http://www.sourceware.org/bzip2/</a></p>\n</blockquote>\n<p>to read and write BZip compressed MIFF images.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires 'ralcgm' from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.agocg.ac.uk/train/cgm/ralcgm.htm\">http://www.agocg.ac.uk/train/cgm/ralcgm.htm</a></p>\n</blockquote>\n<p>to read the Computer Graphics Metafile (CGM) image format. You also\nneed Ghostscript and Ghostscript Fonts (see below).</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires 'dcraw' (version 8.95 or later) from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.cybercom.net/~dcoffin/dcraw/\">http://www.cybercom.net/~dcoffin/dcraw/</a></p>\n</blockquote>\n<p>to read raw images from digital cameras.  Dcraw is invoked\nautomatically when used to read files using a common RAW file format\nextension.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires 'fig2dev' provided in the transfig package\nfrom</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.xfig.org/\">http://www.xfig.org/</a></p>\n</blockquote>\n<p>to read the Fig image format. Ghostscript and Ghostscript Fonts (see\nbelow) are also required.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the FreeType software, version 2.0 or above,\navailable as</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.freetype.org/\">http://www.freetype.org/</a></p>\n</blockquote>\n<p>to annotate with TrueType and Postscript Type 1 fonts.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires Ghostscript software available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">http://pages.cs.wisc.edu/~ghost/</a></p>\n<blockquote>\n<p>or</p>\n</blockquote>\n<p><a class=\"reference external\" href=\"http://sourceforge.net/projects/ghostscript/\">http://sourceforge.net/projects/ghostscript/</a></p>\n</blockquote>\n<p>to read the Postscript or the Portable Document Format (PDF).</p>\n<p>Ghostscript Fonts (also known as &quot;URW Standard postscript fonts\n(cyrillicized)&quot;) are available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"https://sourceforge.net/projects/gs-fonts/\">https://sourceforge.net/projects/gs-fonts/</a></p>\n</blockquote>\n<p>Ghostscript (at the time this text is written in October, 2018) has\nbeen observed to have severe security issues when reading untrusted\nPostscript files (does not apply to PDF).  Examples of these severe\nsecurity issues are being tricked into reading or writing arbitrary\nfiles when executing in &quot;-dSAFER&quot; mode, which which is supposed to\nprevent such access.  Users of Ghostscript who may encounter\nuntrusted Postscript files are recommended to assure that all\nsecurity patches have been applied and it might be necessary to use\nthe latest upstream release.</p>\n<p>Ghostscript is available for use under both free (GPL) and\ncommercial licenses.  We are not lawyers so we can not provide\nadvice as to when the commercial license from Artifex is required.\nPlease make sure that you are aware of Ghostscript licencing and\nusage terms if you plan to use it in some sort of commercial\nsituation.</p>\n<p>Ghostscript (release 7.0 and later) may optionally install a library\n(libgs) under Linux. If this library is installed, GraphicsMagick may\nbe configured to use it. We do <strong>NOT</strong> recommend using this library\nunder Unix type systems. The Ghostscript library does not support\nconcurrency since only one instance of the interpreter is available.\nUnix systems will obtain better performance from executing Ghostscript as\nan external process since then multiple interpreters may execute at\nonce on multiple CPU cores.</p>\n<p>If the Ghostscript library is used, then please be aware that\nGhostscript provides its own modified version of libjpeg and\nlibJasper while GraphicsMagick will be using these libraries as\nprovided with the system. If Ghostscript is not using the same\nlibraries, then identically named symbols may be used from the wrong\ncode, causing confusion or a program crash. If conflicts cause JPEG\nto fail (JPEG returns an error regarding expected structure sizes),\nit may be necessary to use Ghostscript's copy of libjpeg for\nGraphicsMagick, and all delegate libraries which depend on libjpeg,\nor convince Ghostscript to build against an unmodified installed\nJPEG library (and lose compatibility with some Postscript files).</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires hp2xx available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.gnu.org/software/hp2xx/hp2xx.html\">http://www.gnu.org/software/hp2xx/hp2xx.html</a></p>\n</blockquote>\n<p>to read the HP-GL image format. Note that HPGL is a plotter file\nformat. HP printers usually accept PCL format rather than HPGL\nformat.  Ghostscript (see above) is also required.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the lcms library (2.0 or later) available\nfrom</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.littlecms.com/\">http://www.littlecms.com/</a></p>\n</blockquote>\n<p>to perform ICC CMS color management.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires Graphviz available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.graphviz.org/\">http://www.graphviz.org/</a></p>\n</blockquote>\n<p>to read Graphvis 'dot' digraph files (with extension dot).\nGhostscript (see above) is also required.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires html2ps available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://user.it.uu.se/~jan/html2ps.html\">http://user.it.uu.se/~jan/html2ps.html</a></p>\n</blockquote>\n<p>to rasterize HTML files.  Ghostscript (see above) is also required.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the JBIG-Kit software available via\nHTTP from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.cl.cam.ac.uk/~mgk25/jbigkit/\">http://www.cl.cam.ac.uk/~mgk25/jbigkit/</a></p>\n</blockquote>\n<p>to read and write the JBIG image format.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the WebP library version 0.1.99 (or later)\navailable via HTTPS from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"https://developers.google.com/speed/webp/\">https://developers.google.com/speed/webp/</a></p>\n</blockquote>\n<p>to read and write the WebP image format.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the Independent JPEG Group's software\navailable from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.ijg.org/\">http://www.ijg.org/</a></p>\n</blockquote>\n<p>or libjpeg-turbo available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"https://libjpeg-turbo.org/\">https://libjpeg-turbo.org/</a> or <a class=\"reference external\" href=\"https://github.com/libjpeg-turbo/libjpeg-turbo\">https://github.com/libjpeg-turbo/libjpeg-turbo</a></p>\n</blockquote>\n<p>to read and write the JPEG v1 image format.  The 'turbo' releases\nare much faster than the IJG releases on certain targets (due to\nusing assembly code and other optimizations), but lack the\nSmartScale JPEG extension introduced in IJG JPEG v8, and the\nlossless coding mode JPEG extension introduced in IJG JPEG v9 (which\nis not compatible with standard lossless JPEG!).</p>\n<p>GraphicsMagick supports both 8-bit and 12-bit JPEG, but\nunfortunately it does not yet support both at once.</p>\n<p>Apply this JPEG patch to Independent JPEG Group's (6b release!)\nsource distribution if you want to read lossless jpeg-encoded DICOM\n(medical) images:</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/delegates/ljpeg-6b.tar.gz\">ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/delegates/ljpeg-6b.tar.gz</a></p>\n</blockquote>\n<p>Use of lossless JPEG is not encouraged. Unless you have a requirement\nto read lossless jpeg-encoded DICOM images, please disregard the patch.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the JasPer Project's JasPer library version\n1.701.0 (or later) available via http from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.ece.uvic.ca/~mdadams/jasper/\">http://www.ece.uvic.ca/~mdadams/jasper/</a></p>\n</blockquote>\n<p>to read and write the JPEG-2000 format. Please note that JasPer 1.900.1\nmay have a problem when used with GraphicsMagick's modules build. To\nsolve this problem, edit the file src/libjasper/base/jas_init.c and\ncomment out the line which invokes atexit().</p>\n</li>\n<li><p class=\"first\">On Unix-type systems, Windows/MinGW, and Windows/Cygwin,\nGraphicsMagick requires libltdl from libtool in order to support\nbuilding GraphicsMagick with dynamically loadable modules.  Libtool\nis available via anonymous FTP from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"ftp://ftp.gnu.org/pub/gnu/libtool/\">ftp://ftp.gnu.org/pub/gnu/libtool/</a></p>\n</blockquote>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the MPEG utilities from the MPEG Software\nSimulation Group, which are available via anonymous FTP as</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"ftp://ftp.GraphicsMagick.org/pub/GraphicsMagick/delegates/mpeg2vidcodec_v12.tar.gz\">ftp://ftp.GraphicsMagick.org/pub/GraphicsMagick/delegates/mpeg2vidcodec_v12.tar.gz</a></p>\n</blockquote>\n<p>to read or write the MPEG image format.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the LIBPNG library, version 1.0 or above, from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.libpng.org/pub/png/pngcode.html\">http://www.libpng.org/pub/png/pngcode.html</a></p>\n</blockquote>\n<p>to read or write the PNG, MNG, or JNG image formats.  LIBPNG depends\nupon the ZLIB library (see below).</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires Sam Leffler's TIFF software available via\nHTTP at</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.simplesystems.org/libtiff/\">http://www.simplesystems.org/libtiff/</a></p>\n</blockquote>\n<p>to read the TIFF image format. It in turn optionally requires the\nJPEG and ZLIB libraries.  Libtiff 3.8.2 or later is recommended.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick may optionally use the TRIO library from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://sourceforge.net/projects/ctrio/\">http://sourceforge.net/projects/ctrio/</a></p>\n</blockquote>\n<p>to substitute for the vsnprintf function when the operating system\ndoes not provide one. Older operating systems (e.g. Solaris 2.5)\nmay not provide a vsnprintf function. If vsnprintf (or the TRIO\nreplacement) is not used, then vsprintf is used instead, which\ndecreases the security of GraphicsMagick due to possible buffer\noverrun exploits.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick may optionally use the 'tcmalloc' library provided as\npart of Google gperftools available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"https://github.com/gperftools/gperftools\">https://github.com/gperftools/gperftools</a></p>\n</blockquote>\n<p>to provide enhanced versions of the standard memory allocation\nfacilities.  Use of tcmalloc may improve performance for both\nsingle-threaded and multi-threaded programs.  Benchmarking under\nLinux shows a doubling of performance with tcmalloc over the default\nglibc malloc when images are repeatedly allocated, cleared, and\nde-allocated.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick may optionally use the umem memory allocation library\nwhich is included in Sun's Solaris operating system, and\nOpenSolaris/Illumos derivatives, or available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"https://labs.omniti.com/trac/portableumem\">https://labs.omniti.com/trac/portableumem</a></p>\n</blockquote>\n<p>to provide enhanced versions of the standard memory allocation\nfacilities. Use of umem may improve performance for multi-threaded\nprograms and provides access to debugging features that detect memory\nleaks, buffer overruns, multiple frees, use of uninitialized data, use\nof freed data, and many other common programming errors.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires libwmflite from libwmf 0.2.5 (or later) from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://sourceforge.net/projects/wvware/\">http://sourceforge.net/projects/wvware/</a></p>\n</blockquote>\n<p>to render files in the Windows Meta File (WMF) metafile format\n(16-bit WMF files only, not 32-bit &quot;EMF&quot;). This is the format\ncommonly used for Windows clipart (available on CD at your local\ncomputer or technical book store). WMF support requires the FreeType\n2 library in order to render TrueType and Postscript fonts.</p>\n<p>While GraphicsMagick uses the libwmflite (parser) component of the\nlibwmf package which does not depend on any special libraries, the\nlibwmf package as a whole depends on FreeType 2 and either the\nxmlsoft libxml, or expat libraries. Since GraphicsMagick already uses\nlibxml (for reading SVG and to retrieve files via HTTP or FTP), it is\nrecommended that the options '--without-expat --with-xml' be supplied\nto libwmf's configure script.  If the other features of libwmf are\nnot needed, then the '--disable-heavy' option may be used to only\nbuild libwmflite.</p>\n<p>GraphicsMagick's WMF renderer provides some of the finest WMF\nrendering available due its use of antialiased drawing algorithms.\nYou may select a background color or texture image to render on. For\nexample, &quot;-background '#ffffffff'&quot; renders on a transparent\nbackground while &quot;-texture plasma:fractal&quot; renders on a fractal image.</p>\n<blockquote>\n<p>A free set of Microsoft Windows fonts may be retrieved from\n<a class=\"reference external\" href=\"http://sourceforge.net/projects/corefonts/\">http://sourceforge.net/projects/corefonts/</a>. Note that the license\nfor these fonts requires that they be distributed in the original\n.exe form, but the Linux folks have found ways to deal with that on\nnon-Windows systems.</p>\n</blockquote>\n</li>\n<li><p class=\"first\">GraphicsMagick requires an X server for the 'display', 'animate', and\n'import' functions to work properly. Unix systems usually provide an X\nserver as part of their standard installation. For MacOS-X, X11 is a\nsystem install time option.</p>\n<p>A free X server for Microsoft Windows is included as part of\nCygwin and may be selected from the Cygwin installer. Cygwin is\navailable from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.cygwin.com/\">http://www.cygwin.com/</a></p>\n</blockquote>\n<p>There is a nearly free X server available for Windows and Macintosh at</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.microimages.com/downloads/mix/\">http://www.microimages.com/downloads/mix/</a></p>\n</blockquote>\n</li>\n<li><p class=\"first\">GraphicsMagick requires libxml2 available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://xmlsoft.org/\">http://xmlsoft.org/</a></p>\n</blockquote>\n<p>to read the SVG image format and to retrieve files from over a\nnetwork via FTP and HTTP.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the liblzma library from XZ Utils available from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.tukaani.org/xz/\">http://www.tukaani.org/xz/</a></p>\n</blockquote>\n<p>to support TIFF with LZMA compression and future LZMA-compression\nfeatures (yet to be developed).  The utilities from this package are\nalso necessary in order to decompress GraphicsMagick packages\ndistributed with &quot;.xz&quot; or &quot;.lzma&quot; extensions.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the ZLIB library from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"http://www.zlib.net/\">http://www.zlib.net/</a></p>\n</blockquote>\n<p>to read or write the PNG or Zip compressed MIFF images.</p>\n</li>\n<li><p class=\"first\">GraphicsMagick requires the Zstd library from</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"https://facebook.github.io/zstd/\">https://facebook.github.io/zstd/</a></p>\n</blockquote>\n<p>to read or write Zstd compressed TIFF images.  In the future it is\nlikely that other purposes will be found for Zstd.</p>\n</li>\n</ul>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/animate.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"animate\"></a>gm animate\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#opti\">Options</a>\n</dt>\n<dt>\n<a href=\"#mous\">Mouse Buttons</a>\n</dt>\n<dt>\n<a href=\"#comm\">Command Widget</a>\n</dt>\n<dt>\n<a href=\"#keyb\">Keyboard Accelerators</a>\n</dt>\n<dt>\n<a href=\"#xres\">X Resources</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm animate</strong> <strong>[</strong> <em>options</em> <strong>...]</strong> <em>file</em> [ [\n<em>options</em> ...] <em>file</em> ...]\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Animate</strong> displays a sequence of images on any workstation display\nrunning an X server. <strong>animate</strong> first determines the hardware capabilities\nof the workstation. If the number of unique colors in an image is less\nthan or equal to the number the workstation can support, the image is displayed\nin an X window. Otherwise the number of colors in the image is first reduced\nto match the color resolution of the workstation before it is displayed.\n<p>\nThis means that a continuous-tone 24 bits-per-pixel image can display on\na 8 bit pseudo-color device or monochrome device. In most instances the\nreduced color image closely resembles the original. Alternatively, a monochrome\nor pseudo-color image sequence can display on a continuous-tone 24 bits-per-pixel\ndevice.\n<p>\nTo help prevent color flashing on X server visuals that have colormaps,\n<strong>animate</strong>\ncreates a single colormap from the image sequence. This can be rather time\nconsuming. You can speed this operation up by reducing the colors in the\nimage before you \"animate\" them. Use <strong>mogrify</strong> to color reduce the\nimages to a single colormap. See <strong>mogrify(1)</strong> for details. Alternatively,\nyou can use a Standard Colormap; or a static, direct, or true color visual.\nYou can define a Standard Colormap with <em>xstdcmap</em>. See <strong>xstdcmap(1)</strong>\nfor details. This method is recommended for colormapped X server because\nit eliminates the need to compute a global colormap.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo animate a set of images of a cockatoo, use:\n<pre>\n    gm animate cockatoo.*\n</pre>\n<p>\nTo animate a cockatoo image sequence while using the Standard Colormap\n<em>best</em>, use:\n<pre>\n    xstdcmap -best\n    gm animate -map best cockatoo.*\n</pre>\n<p>\nTo animate an image of a cockatoo without a border centered on a backdrop,\nuse:\n<br>&nbsp;<br>\n<pre>\n    gm animate +borderwidth -backdrop cockatoo.*\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-backdrop\">-backdrop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the image centered on a backdrop.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -borderwidth <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-chop\">-chop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixels from the interior of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colormap\">-colormap</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the colormap type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-foreground\">-foreground</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the foreground color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-iconGeometry\">-iconGeometry</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the icon geometry</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -iconic\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>iconic animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-map\">-map</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display image using this type.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -name\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pause\">-pause</a> <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pause between animation loops [animate]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-remote\">-remote</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform a X11 remote operation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scenes\">-scenes</a> <i>&lt;value-value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>range of image scene numbers to read</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shared-memory\">-shared-memory</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use shared memory</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-text-font\">-text-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>font for writing fixed-width text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-title\">-title</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign title to displayed image [<em>animate, display, montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-visual\">-visual</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>animate images using this X visual type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-window\">-window</a> <i>&lt;id&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image the background of a window</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<p>\nAny option you specify on the command line remains in effect for the group\nof images following it, until the group is terminated by the appearance of\nany option or <strong>-noop</strong>.  For example, to animate three images, the first\nwith 32 colors, the second with an unlimited number of colors, and the\nthird with only 16 colors, use:\n<br>&nbsp;<br>\n<pre>\n    gm animate -colors 32 cockatoo.1 -noop cockatoo.2 -colors 16 cockatoo.3\n</pre>\n<p>\n<strong>Animate</strong> options can appear on the command line or in your X resources\nfile. See <em>X(1)</em>. Options on the command line supersede values specified\nin your X resources file.\n<p>Image filenames may appear in any order on the command line if the image\nformat is <em>MIFF</em> (refer to <strong>miff(5)</strong> and the\n<strong>scene</strong> keyword\nis specified in the image. Otherwise the images will display in the order\nthey appear on the command line.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mous\"></a>Mouse Buttons\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nPress any button to map or unmap the Command widget. See the next section\nfor more information about the Command widget.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comm\"></a>Command Widget\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe Command widget lists a number of sub-menus and commands. They are\n<ul>\n<li><strong>Animate</strong>\n<ul>\n<li>    Open\n<li>    Play\n<li>    Step\n<li>    Repeat\n<li>    Auto Reverse\n</ul>\n<li><strong>Speed</strong>\n<ul>\n<li>    Faster\n<li>    Slower\n</ul>\n<li><strong>Direction</strong>\n<ul>\n<li>    Forward\n<li>    Reverse\n</ul>\n<li><strong>Image Info</strong>\n<li><strong>Help</strong>\n<li><strong>Quit</strong>\n</ul>\n<p>\nMenu items with a indented triangle have a sub-menu. They are represented\nabove as the indented items. To access a sub-menu item, move the pointer\nto the appropriate menu and press a button and drag. When you find the\ndesired sub-menu item, release the button and the command is executed.\nMove the pointer away from the sub-menu if you decide not to execute a\nparticular command.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"keyb\"></a>Keyboard Accelerators\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt><strong>Ctl+O</strong></dt>\n<dd>Press to load an image from a file.</dd>\n<dt><strong>space</strong></dt>\n<dd>Press to display the next image in the sequence.</dd>\n<dt><strong>&lt;</strong></dt>\n<dd>Press to speed-up the display of the images.  Refer to\n<strong>-delay</strong> for more information.</dd>\n<dt><strong>&gt;</strong></dt>\n<dd>Press to slow the display of the images.  Refer to\n<strong>-delay</strong> for more information.</dd>\n<dt><strong>?</strong></dt>\n<dd>Press to display information about the image.  Press\nany key or button to erase the information.</dd>\n<dd>This information is printed: image name;  image size;\nand the total number of unique colors in the image.</dd>\n<dt><strong>F1</strong></dt>\n<dd>Press to display helpful information about <strong>animate(1)</strong>.</dd>\n<dt><strong>Ctl-q</strong></dt>\n<dd>Press to discard all images and exit program.</dd>\n</dl>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"xres\"></a>X Resources\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Animate</strong> options can appear on the command line or in your X resource\nfile. Options on the command line supersede values specified in your X\nresource file. See <strong>X(1)</strong> for more information on X resources.\n<p>\nAll <strong>animate</strong> options have a corresponding X resource. In addition,\nthe <strong>animate</strong> program uses the following X resources:\n<dl>\n<dt><strong>background</strong> <strong>(</strong><em>class</em> <strong>Background)</strong></dt>\n<dd>\nSpecifies the preferred color to use for the Image window background. The\ndefault is #ccc.</dd>\n<dt><strong>borderColor</strong> <strong>(</strong><em>class</em> <strong>BorderColor)</strong></dt>\n<dd>\nSpecifies the preferred color to use for the Image window border. The default\nis #ccc.</dd>\n<dt><strong>borderWidth</strong> <strong>(</strong><em>class</em> <strong>BorderWidth)</strong></dt>\n<dd>\nSpecifies the width in pixels of the Image window border. The default is\n2.</dd>\n<dt><strong>font</strong> <strong>(</strong><em>class</em> <strong>Font</strong> <strong>or</strong> <strong>FontList)</strong></dt>\n<dd>\nSpecifies the name of the preferred font to use in normal formatted text.\nThe default is 14 point <em>Helvetica</em>.</dd>\n<dt><strong>foreground</strong> <strong>(</strong><em>class</em> <strong>Foreground)</strong></dt>\n<dd>\nSpecifies the preferred color to use for text within the Image window.\nThe default is black.</dd>\n<dt><strong>geometry</strong> <strong>(</strong><em>class</em> <strong>geometry)</strong></dt>\n<dd>\nSpecifies the preferred size and position of the image window. It is not\nnecessarily obeyed by all window managers.\nOffsets, if present, are handled in <em>X(1)</em> style.  A negative x offset is\nmeasured from the right edge of the screen to the right edge of the icon,\nand a negative y offset is measured from the bottom edge of the screen\nto the bottom edge of the icon.</dd>\n<dt><strong>iconGeometry</strong> <strong>(</strong><em>class</em> <strong>IconGeometry)</strong></dt>\n<dd>\nSpecifies the preferred size and position of the application when iconified.\nIt is not necessarily obeyed by all window managers.\nOffsets, if present, are handled in the same manner as in class Geometry.</dd>\n<dt><strong>iconic</strong> <strong>(</strong><em>class</em> <strong>Iconic)</strong></dt>\n<dd>\nThis resource indicates that you would prefer that the application's windows\ninitially not be visible as if the windows had be immediately iconified\nby you. Window managers may choose not to honor the application's request.</dd>\n<dt><strong>matteColor</strong> <strong>(</strong><em>class</em> <strong>MatteColor)</strong></dt>\n<dd>\nSpecify the color of windows. It is used for the backgrounds of windows,\nmenus, and notices. A 3D effect is achieved by using highlight and shadow\ncolors derived from this color. Default value: #ddd.</dd>\n<dt><strong>name</strong> <strong>(</strong><em>class</em> <strong>Name)</strong></dt>\n<dd>\nThis resource specifies the name under which resources for the application\nshould be found. This resource is useful in shell aliases to distinguish\nbetween invocations of an application, without resorting to creating links\nto alter the executable file name. The default is the application name.</dd>\n<dt><strong>sharedMemory</strong> <strong>(</strong><em>class</em> <strong>SharedMemory)</strong></dt>\n<dd>\nThis resource specifies whether animate should attempt use shared memory\nfor pixmaps. ImageMagick must be compiled with shared memory support, and\nthe display must support the MIT-SHM extension. Otherwise, this resource\nis ignored. The default is True.</dd>\n<dt><strong>text_font</strong> <strong>(</strong><em>class</em> <strong>textFont)</strong></dt>\n<dd>\nSpecifies the name of the preferred font to use in fixed (typewriter style)\nformatted text. The default is 14 point <em>Courier</em>.</dd>\n<dt><strong>title</strong> <strong>(</strong><em>class</em> <strong>Title)</strong></dt>\n<dd>\nThis resource specifies the title to be used for the Image window. This\ninformation is sometimes used by a window manager to provide some sort\nof header identifying the window. The default is the image file name.</dd>\n</dl>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/animate.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>animate</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"animate\">\n<h1 class=\"title\">animate</h1>\n<h2 class=\"subtitle\" id=\"interactively-animate-an-image-sequence\">Interactively animate an image sequence</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#magickxanimatebackgroundimage\" id=\"id3\">MagickXAnimateBackgroundImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickxanimateimages\" id=\"id4\">MagickXAnimateImages</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"magickxanimatebackgroundimage\">\n<h1><a class=\"toc-backref\" href=\"#id3\">MagickXAnimateBackgroundImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickXAnimateBackgroundImage( Display *display, <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                                    <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>MagickXAnimateBackgroundImage() animates an image sequence in the background of\na window.</p>\n<p>The format of the MagickXAnimateBackgroundImage method is:</p>\n<pre class=\"literal-block\">\nvoid MagickXAnimateBackgroundImage( Display *display, <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                                    <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>resource_info:</dt>\n<dd>Specifies a pointer to a X11 MagickXResourceInfo structure.</dd>\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickxanimateimages\">\n<h1><a class=\"toc-backref\" href=\"#id4\">MagickXAnimateImages</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MagickXAnimateImages( Display *display, <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                             char ** argv, const int argc, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>MagickXAnimateImages() displays an image via X11.</p>\n<p>The format of the MagickXAnimateImages method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MagickXAnimateImages( Display *display, <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                             char ** argv, const int argc, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>resource_info:</dt>\n<dd>Specifies a pointer to a X11 MagickXResourceInfo structure.</dd>\n<dt>argv:</dt>\n<dd>Specifies the application's argument list.</dd>\n<dt>argc:</dt>\n<dd>Specifies the number of arguments.</dd>\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/annotate.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>annotate</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"annotate\">\n<h1 class=\"title\">annotate</h1>\n<h2 class=\"subtitle\" id=\"annotate-an-image-with-text\">Annotate an image with text</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#annotateimage\" id=\"id3\">AnnotateImage</a></li>\n<li><a class=\"reference internal\" href=\"#gettypemetrics\" id=\"id4\">GetTypeMetrics</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"annotateimage\">\n<h1><a class=\"toc-backref\" href=\"#id3\">AnnotateImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail AnnotateImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>AnnotateImage() annotates an image with DrawInfo 'text' based on other\nparameters from DrawInfo such as 'affine', 'align', 'decorate', and\n'gravity'.</p>\n<p>Originally this function additionally transformed 'text' using\nTranslateText() but it no longer does so as of GraphicsMagick 1.3.32.</p>\n<p>The format of the AnnotateImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail AnnotateImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method AnnotateImage returns MagickPass if the image is annotated\notherwise MagickFail.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>draw_info:</dt>\n<dd>The draw info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"gettypemetrics\">\n<h1><a class=\"toc-backref\" href=\"#id4\">GetTypeMetrics</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int GetTypeMetrics( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                             <a class=\"reference external\" href=\"../api/types.html#typemetric\">TypeMetric</a> *metrics );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>GetTypeMetrics() returns the following information for the specified font\nand text:</p>\n<p>o character width\no character height\no ascent\no descent\no text width\no text height\no maximum horizontal advance\no underline position\no underline thickness</p>\n<p>The format of the GetTypeMetrics method is:</p>\n<pre class=\"literal-block\">\nunsigned int GetTypeMetrics( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                             <a class=\"reference external\" href=\"../api/types.html#typemetric\">TypeMetric</a> *metrics );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>draw_info:</dt>\n<dd>The draw info.</dd>\n<dt>metrics:</dt>\n<dd>Return the font metrics in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/api.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Core C API</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-core-c-api\">\n<h1 class=\"title\">GraphicsMagick Core C API</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The GraphicsMagick core C library constitutes the implementation of\nGraphicsMagick and provides the lowest-level C language programming\ninterface for GraphicsMagick.  The core C API provides many functions\nto read, manipulate, write, or display an image.  To invoke the\nfunctions, write your program in C (or C++) language while making\ncalls to the core library functions and link with libGraphicsMagick.a,\nlibGraphicsMagick.so, or GraphicsMagick.dll depending on your system.</p>\n<p>The API is divided into a number of categories. While reading this\ndocumentation, please reference the <a class=\"reference external\" href=\"types.html\">types</a> documentation as required:</p>\n<blockquote>\n<ul class=\"simple\">\n<li><a class=\"reference external\" href=\"animate.html\">Animate</a>: Interactively animate an image sequence</li>\n<li><a class=\"reference external\" href=\"annotate.html\">Annotate</a>: Annotate an image with text</li>\n<li><a class=\"reference external\" href=\"attribute.html\">Attribute</a>: Access key, value image attributes</li>\n<li><a class=\"reference external\" href=\"average.html\">Average</a>: Average several images together</li>\n<li><a class=\"reference external\" href=\"cdl.html\">ASC CDL</a> : Apply ASC CDL to image</li>\n<li><a class=\"reference external\" href=\"blob.html\">Blob</a>: Read and write images to memory</li>\n<li><a class=\"reference external\" href=\"channel.html\">Channel</a>: Import and export image channels as well as compute channel depth</li>\n<li><a class=\"reference external\" href=\"color.html\">Color</a>: Methods to deal with image colors</li>\n<li><a class=\"reference external\" href=\"colormap.html\">Colormap</a>: Methods to deal with image colormaps</li>\n<li><a class=\"reference external\" href=\"compare.html\">Compare</a>: Compare images</li>\n<li><a class=\"reference external\" href=\"composite.html\">Composite</a>: Composite images</li>\n<li><a class=\"reference external\" href=\"confirm_access.html\">Confirm Access</a> : Confirm access to files and URLs.</li>\n<li><a class=\"reference external\" href=\"constitute.html\">Constitute</a>: Read, write, import, and export images</li>\n<li><a class=\"reference external\" href=\"decorate.html\">Decorate</a>: Add fancy borders to images</li>\n<li><a class=\"reference external\" href=\"describe.html\">Describe</a>: Describe an image</li>\n<li><a class=\"reference external\" href=\"display.html\">Display</a>: Interactively display and edit an image</li>\n<li><a class=\"reference external\" href=\"draw.html\">Draw</a>: Convenient methods to draw vectors and text</li>\n<li><a class=\"reference external\" href=\"effect.html\">Effect</a>:Threshold (various), blur, despeckle, edge, emboss, enhance,\ngaussian blur ...</li>\n<li><a class=\"reference external\" href=\"enhance.html\">Enhance</a>: Contrast, equalize, gamma, level, level channel, modulate, negate,\nand normalize</li>\n<li><a class=\"reference external\" href=\"error.html\">Error</a>: Error reporting methods</li>\n<li><a class=\"reference external\" href=\"export.html\">Export</a> : Export image pixels to common representations</li>\n<li><a class=\"reference external\" href=\"fx.html\">FX</a>: Special effects methods</li>\n<li><a class=\"reference external\" href=\"hclut.html\">Hald CLUT</a> : Apply Hald CLUT to image</li>\n<li><a class=\"reference external\" href=\"image.html\">Image</a>: Miscellaneous image methods</li>\n<li><a class=\"reference external\" href=\"import.html\">Import</a> : Import image pixels from common representations</li>\n<li><a class=\"reference external\" href=\"list.html\">List</a>: Manage image lists</li>\n<li><a class=\"reference external\" href=\"magick.html\">Magick</a>: Image format support interfaces</li>\n<li><a class=\"reference external\" href=\"memory.html\">Memory</a>: Memory allocation methods</li>\n<li><a class=\"reference external\" href=\"monitor.html\">Monitor</a>: Progress monitor callbacks</li>\n<li><a class=\"reference external\" href=\"montage.html\">Montage</a>: Create a montage of image thumbnails</li>\n<li><a class=\"reference external\" href=\"operator.html\">Operator</a>: Methods to apply mathematic or boolean operators to pixels</li>\n<li><a class=\"reference external\" href=\"paint.html\">Paint</a>: Fill pixel regions</li>\n<li><a class=\"reference external\" href=\"pixel_cache.html\">Pixel Cache</a>: Low-level access to image pixels</li>\n<li><a class=\"reference external\" href=\"pixel_iterator.html\">Pixel Iterator</a>: Pixel iterator design pattern support functions</li>\n<li><a class=\"reference external\" href=\"plasma.html\">Plasma</a>: Plasma fractal image generator</li>\n<li><a class=\"reference external\" href=\"profile.html\">Profile</a>: Attached profile access</li>\n<li><a class=\"reference external\" href=\"quantize.html\">Quantize</a>: Reduce image colors or assign image colors from colormap</li>\n<li><a class=\"reference external\" href=\"registry.html\">Registry</a>: Store and retrieve images in memory by ID</li>\n<li><a class=\"reference external\" href=\"resize.html\">Resize</a>: Resize an Image</li>\n<li><a class=\"reference external\" href=\"resource.html\">Resource</a>: Set and get resource limits</li>\n<li><a class=\"reference external\" href=\"segment.html\">Segment</a>: Coalese similar image colors</li>\n<li><a class=\"reference external\" href=\"shear.html\">Shear</a>: Rotate image, shear image, or apply a 2D affine transformation</li>\n<li><a class=\"reference external\" href=\"signature.html\">Signature</a>: Compute an image signature (checksum)</li>\n<li><a class=\"reference external\" href=\"statistics.html\">Statistics</a>: Compute image statistics</li>\n<li><a class=\"reference external\" href=\"texture.html\">Texture</a>: Create a tiled texture image or tile an image with a texture.</li>\n<li><a class=\"reference external\" href=\"transform.html\">Transform</a>: Chop, coalesce, deconstruct, flatten, flip, flop, mosiac, roll,\nor shave image</li>\n</ul>\n</blockquote>\n<p>Here are a few sample programs to get you started.</p>\n<p>This example program (convert.c) simply converts from one file name to\nanother (and will automatically change formats based on file\nextension):</p>\n<pre class=\"literal-block\">\n#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include &lt;time.h&gt;\n#include &lt;sys/types.h&gt;\n#include &lt;magick/api.h&gt;\n\nint main ( int argc, char **argv )\n{\n  Image\n    *image = (Image *) NULL;\n\n  char\n    infile[MaxTextExtent],\n    outfile[MaxTextExtent];\n\n  int\n    arg = 1,\n    exit_status = 0;\n\n  ImageInfo\n    *imageInfo;\n\n  ExceptionInfo\n    exception;\n\n  InitializeMagick(NULL);\n  imageInfo=CloneImageInfo(0);\n  GetExceptionInfo(&amp;exception);\n\n  if (argc != 3)\n    {\n      (void) fprintf ( stderr, &quot;Usage: %s infile outfile\\n&quot;, argv[0] );\n      (void) fflush(stderr);\n      exit_status = 1;\n      goto program_exit;\n    }\n\n  (void) strncpy(infile, argv[arg], MaxTextExtent-1 );\n  arg++;\n  (void) strncpy(outfile, argv[arg], MaxTextExtent-1 );\n\n  (void) strcpy(imageInfo-&gt;filename, infile);\n  image = ReadImage(imageInfo, &amp;exception);\n  if (image == (Image *) NULL)\n    {\n      CatchException(&amp;exception);\n      exit_status = 1;\n      goto program_exit;\n    }\n\n  (void) strcpy(image-&gt;filename, outfile);\n  if (!WriteImage (imageInfo,image))\n    {\n      CatchException(&amp;image-&gt;exception);\n      exit_status = 1;\n      goto program_exit;\n    }\n\n program_exit:\n\n  if (image != (Image *) NULL)\n    DestroyImage(image);\n\n  if (imageInfo != (ImageInfo *) NULL)\n    DestroyImageInfo(imageInfo);\n  DestroyMagick();\n\n  return exit_status;\n}\n</pre>\n<p>This example program (demo.c) which reads multiple input files\n(possibly animation files) specified on the command line, resizes the\nimage frames to 106x80, and writes the resulting animation to disk:</p>\n<pre class=\"literal-block\">\n#include &lt;stdio.h&gt;\n#include &lt;string.h&gt;\n#include &lt;time.h&gt;\n#include &lt;sys/types.h&gt;\n#include &lt;magick/api.h&gt;\n\nint main(int argc,char **argv)\n{\n  ExceptionInfo\n    exception;\n\n  Image\n    *image,\n    *images,\n    *resize_image,\n    *thumbnails;\n\n  ImageInfo\n    *image_info;\n\n  int\n    i;\n\n  /*\n    Initialize the image info structure and read the list of files\n    provided by the user as a image sequence\n  */\n  InitializeMagick(*argv);\n  GetExceptionInfo(&amp;exception);\n  image_info=CloneImageInfo((ImageInfo *) NULL);\n  images=NewImageList();\n  for (i=1; i&lt; argc-1; i++)\n    {\n      (void) strcpy(image_info-&gt;filename,argv[i]);\n      printf(&quot;Reading %s ...&quot;, image_info-&gt;filename);\n      image=ReadImage(image_info,&amp;exception);\n      printf(&quot; %lu frames\\n&quot;, GetImageListLength(image));\n      if (exception.severity != UndefinedException)\n        CatchException(&amp;exception);\n      if (image)\n        (void) AppendImageToList(&amp;images,image);\n    }\n\n  if (!images)\n    {\n      printf(&quot;Failed to read any images!\\n&quot;);\n      exit(1);\n    }\n  /*\n    Create a thumbnail image sequence\n  */\n  thumbnails=NewImageList();\n  while ((image=RemoveFirstImageFromList(&amp;images)) != (Image *) NULL)\n    {\n      resize_image=ResizeImage(image,106,80,LanczosFilter,1.0,&amp;exception);\n      DestroyImage(image);\n      if (resize_image == (Image *) NULL)\n        {\n          CatchException(&amp;exception);\n          continue;\n        }\n      (void) AppendImageToList(&amp;thumbnails,resize_image);\n    }\n  /*\n    Write the thumbnail image sequence to file\n  */\n  if (thumbnails)\n    {\n      (void) strcpy(thumbnails-&gt;filename,argv[argc-1]);\n      image_info-&gt;adjoin=MagickTrue;\n      printf(&quot;Writing %s ... %lu frames\\n&quot;, thumbnails-&gt;filename,\n             GetImageListLength(thumbnails));\n      WriteImage(image_info,thumbnails);\n    }\n\n  /*\n    Release resources\n  */\n  DestroyImageList(thumbnails);\n  DestroyImageInfo(image_info);\n  DestroyExceptionInfo(&amp;exception);\n  DestroyMagick();\n  return(0);\n}\n</pre>\n<p>To compile on Unix, the command would look something like this:</p>\n<pre class=\"literal-block\">\ngcc -o demo demo.c -O `GraphicsMagick-config --cppflags --ldflags --libs`\n</pre>\n<p>As a usage example, with the input files in1.gif, in2.png, and in3.jpg, create\nthe animation file out.miff:</p>\n<pre class=\"literal-block\">\ndemo in1.gif in2.png in3.jpg out.miff\n</pre>\n<p>The resulting animation may be played on an X11 display using 'gm animate\nout.miff'.</p>\n<p>The GraphicsMagick-config script reproduces the options which were used to\ncompile the GraphicsMagick utilities. Using compatible options ensures that\nyour program will compile and run.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/attribute.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>attribute</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"attribute\">\n<h1 class=\"title\">attribute</h1>\n<h2 class=\"subtitle\" id=\"access-key-value-image-attributes\">Access key,value image attributes</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#cloneimageattributes\" id=\"id9\">CloneImageAttributes</a></li>\n<li><a class=\"reference internal\" href=\"#destroyimageattributes\" id=\"id10\">DestroyImageAttributes</a></li>\n<li><a class=\"reference internal\" href=\"#getimageattribute\" id=\"id11\">GetImageAttribute</a></li>\n<li><a class=\"reference internal\" href=\"#getimageclippingpathattribute\" id=\"id12\">GetImageClippingPathAttribute</a></li>\n<li><a class=\"reference internal\" href=\"#setimageattribute\" id=\"id13\">SetImageAttribute</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"cloneimageattributes\">\n<h1><a class=\"toc-backref\" href=\"#id9\">CloneImageAttributes</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail CloneImageAttributes( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *clone_image,\n                                     const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *original_image );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>CloneImageAttributes() copies the text attributes from one image to another.\nAny text attributes in the destination image are preserved.\nCloneImageAttributes returns MagickPass if all of the attribututes are\nsuccessfully cloned or MagickFail if there is a memory allocation error.</p>\n<p>The format of the CloneImageAttributes method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail CloneImageAttributes( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *clone_image,\n                                     const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *original_image );\n</pre>\n<dl class=\"docutils\">\n<dt>clone_image:</dt>\n<dd>The destination image.</dd>\n<dt>original_image:</dt>\n<dd>The source image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroyimageattributes\">\n<h1><a class=\"toc-backref\" href=\"#id10\">DestroyImageAttributes</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nDestroyImageAttributes( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>DestroyImageAttributes() deallocates memory associated with the image\nattribute list.</p>\n<p>The format of the DestroyImageAttributes method is:</p>\n<pre class=\"literal-block\">\nDestroyImageAttributes( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimageattribute\">\n<h1><a class=\"toc-backref\" href=\"#id11\">GetImageAttribute</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst ImageAttribute *GetImageAttribute( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *key );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>GetImageAttribute() searches the list of image attributes and returns\na pointer to the attribute if it exists otherwise NULL.</p>\n<p>The format of the GetImageAttribute method is:</p>\n<pre class=\"literal-block\">\nconst ImageAttribute *GetImageAttribute( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *key );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>key:</dt>\n<dd>These character strings are the name of an image attribute to\nreturn.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimageclippingpathattribute\">\n<h1><a class=\"toc-backref\" href=\"#id12\">GetImageClippingPathAttribute</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst ImageAttribute *GetImageClippingPathAttribute( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>Method GetImageClippingPathAttribute searches the list of image attributes\nand returns a pointer to a clipping path if it exists otherwise NULL.</p>\n<p>The format of the GetImageClippingPathAttribute method is:</p>\n<pre class=\"literal-block\">\nconst ImageAttribute *GetImageClippingPathAttribute( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>attribute:</dt>\n<dd>Method GetImageClippingPathAttribute returns the clipping\npath if it exists otherwise NULL.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimageattribute\">\n<h1><a class=\"toc-backref\" href=\"#id13\">SetImageAttribute</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int SetImageAttribute( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *key, const char *value );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>SetImageAttribute() searches the list of image attributes and replaces the\nattribute value.  If it is not found in the list, the attribute name\nand value is added to the list.   If the attribute exists in the list,\nthe value is concatenated to the attribute.  SetImageAttribute returns\nTrue if the attribute is successfully concatenated or added to the list,\notherwise False.  If the value is NULL, the matching key is deleted\nfrom the list.</p>\n<p>There is special handling for the EXIF:Orientation attribute. Setting this\nattribute will also update the EXIF tag in the image's EXIF profile to the\ngiven value provided an EXIF profile exists and has an existing EXIF\norientation tag and the attribute value is a valid orientation\n(see orientationType). The attribute value will be set regardless of\nwhether the EXIF profile was successfully updated. The new\nEXIF:Orientation attribute replaces the existing value rather than\nbeing concatenated to it as when setting other attributes.</p>\n<p>The 'comment' and 'label' attributes are treated specially in that\nembedded format specifications are translated according to the formatting\nrules of TranslateText().</p>\n<p>The format of the SetImageAttribute method is:</p>\n<pre class=\"literal-block\">\nunsigned int SetImageAttribute( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *key, const char *value );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>key,value:</dt>\n<dd>These character strings are the name and value of an image\nattribute to replace or add to the list.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/average.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>average</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"average\">\n<h1 class=\"title\">average</h1>\n<h2 class=\"subtitle\" id=\"image-averaging-functions\">Image averaging functions</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#averageimages\" id=\"id1\">AverageImages</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"averageimages\">\n<h1><a class=\"toc-backref\" href=\"#id1\">AverageImages</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AverageImages( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>The Average() method takes a set of images and averages them together.\nEach image in the set must have the same width and height.  Average()\nreturns a single image with each corresponding pixel component of\neach image averaged.   On failure, a NULL image is returned and\nexception describes the reason for the failure.</p>\n<p>The format of the AverageImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AverageImages( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image sequence.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/blob.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>blob</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"blob\">\n<h1 class=\"title\">blob</h1>\n<h2 class=\"subtitle\" id=\"read-or-write-formatted-images-in-memory-blobs\">Read or write formatted images in memory (BLOBs)</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#attachblob\" id=\"id45\">AttachBlob</a></li>\n<li><a class=\"reference internal\" href=\"#blobisseekable\" id=\"id46\">BlobIsSeekable</a></li>\n<li><a class=\"reference internal\" href=\"#blobreservesize\" id=\"id47\">BlobReserveSize</a></li>\n<li><a class=\"reference internal\" href=\"#blobtofile\" id=\"id48\">BlobToFile</a></li>\n<li><a class=\"reference internal\" href=\"#blobtoimage\" id=\"id49\">BlobToImage</a></li>\n<li><a class=\"reference internal\" href=\"#cloneblobinfo\" id=\"id50\">CloneBlobInfo</a></li>\n<li><a class=\"reference internal\" href=\"#destroyblob\" id=\"id51\">DestroyBlob</a></li>\n<li><a class=\"reference internal\" href=\"#destroyblobinfo\" id=\"id52\">DestroyBlobInfo</a></li>\n<li><a class=\"reference internal\" href=\"#detachblob\" id=\"id53\">DetachBlob</a></li>\n<li><a class=\"reference internal\" href=\"#filetoblob\" id=\"id54\">FileToBlob</a></li>\n<li><a class=\"reference internal\" href=\"#getblobfilehandle\" id=\"id55\">GetBlobFileHandle</a></li>\n<li><a class=\"reference internal\" href=\"#getblobinfo\" id=\"id56\">GetBlobInfo</a></li>\n<li><a class=\"reference internal\" href=\"#getblobstatus\" id=\"id57\">GetBlobStatus</a></li>\n<li><a class=\"reference internal\" href=\"#getblobfirsterrno\" id=\"id58\">GetBlobFirstErrno</a></li>\n<li><a class=\"reference internal\" href=\"#getblobstreamdata\" id=\"id59\">GetBlobStreamData</a></li>\n<li><a class=\"reference internal\" href=\"#getblobtemporary\" id=\"id60\">GetBlobTemporary</a></li>\n<li><a class=\"reference internal\" href=\"#getconfigureblob\" id=\"id61\">GetConfigureBlob</a></li>\n<li><a class=\"reference internal\" href=\"#imagetoblob\" id=\"id62\">ImageToBlob</a></li>\n<li><a class=\"reference internal\" href=\"#imagetofile\" id=\"id63\">ImageToFile</a></li>\n<li><a class=\"reference internal\" href=\"#pingblob\" id=\"id64\">PingBlob</a></li>\n<li><a class=\"reference internal\" href=\"#referenceblob\" id=\"id65\">ReferenceBlob</a></li>\n<li><a class=\"reference internal\" href=\"#setblobclosable\" id=\"id66\">SetBlobClosable</a></li>\n<li><a class=\"reference internal\" href=\"#setblobtemporary\" id=\"id67\">SetBlobTemporary</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"attachblob\">\n<h1><a class=\"toc-backref\" href=\"#id45\">AttachBlob</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid AttachBlob( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info, const void *blob, const size_t length );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>AttachBlob() attaches a blob to the BlobInfo structure.</p>\n<p>The format of the AttachBlob method is:</p>\n<pre class=\"literal-block\">\nvoid AttachBlob( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info, const void *blob, const size_t length );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>blob_info:</dt>\n<dd>Specifies a pointer to a BlobInfo structure.</dd>\n<dt>blob:</dt>\n<dd>The address of a character stream in one of the image formats\nunderstood by GraphicsMagick.</dd>\n<dt>length:</dt>\n<dd>This size_t integer reflects the length in bytes of the blob.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"blobisseekable\">\n<h1><a class=\"toc-backref\" href=\"#id46\">BlobIsSeekable</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickBool BlobIsSeekable( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>BlobIsSeekable() returns MagickTrue if the blob supports seeks\n(SeekBlob() is functional).</p>\n<p>The format of the BlobIsSeekable method is:</p>\n<pre class=\"literal-block\">\nMagickBool BlobIsSeekable( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Image to query</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"blobreservesize\">\n<h1><a class=\"toc-backref\" href=\"#id47\">BlobReserveSize</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail BlobReserveSize( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, magick_off_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>BlobReserveSize() sets the output size of the blob or file.  This is used\nas a means to minimize memory or filesystem fragmentation if the final\noutput size is known in advance.  While it is possible that file\nfragmentation is reduced, it is also possible that file write\nperformance is reduced by changing a write operation to a read, modify,\nwrite operation.</p>\n<p>The format of the BlobReserveSize method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail BlobReserveSize( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, magick_off_t size );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Image to update</dd>\n<dt>size:</dt>\n<dd>New output size.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"blobtofile\">\n<h1><a class=\"toc-backref\" href=\"#id48\">BlobToFile</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail BlobToFile( const char *filename, const void *blob, const size_t length,\n                           <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>BlobToFile() writes a blob to a file.  It returns MagickFail if an error\noccurs otherwise MagickPass.</p>\n<p>The format of the BlobToFile method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail BlobToFile( const char *filename, const void *blob, const size_t length,\n                           <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>BlobToFile returns MagickPass on success; otherwise,  it\nreturns MagickFail if an error occurs.</dd>\n<dt>filename:</dt>\n<dd>Write the blob to this file.</dd>\n<dt>blob:</dt>\n<dd>The address of a blob.</dd>\n<dt>length:</dt>\n<dd>This length in bytes of the blob.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"blobtoimage\">\n<h1><a class=\"toc-backref\" href=\"#id49\">BlobToImage</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *BlobToImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const void *blob,\n                    const size_t length, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>BlobToImage() implements direct to memory image formats.  It returns the\nblob as an image.</p>\n<p>The format of the BlobToImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *BlobToImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const void *blob,\n                    const size_t length, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>blob:</dt>\n<dd>The address of a character stream in one of the image formats\nunderstood by GraphicsMagick.</dd>\n<dt>length:</dt>\n<dd>This size_t integer reflects the length in bytes of the blob.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"cloneblobinfo\">\n<h1><a class=\"toc-backref\" href=\"#id50\">CloneBlobInfo</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *CloneBlobInfo( const <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>CloneBlobInfo() makes a duplicate of the given blob info structure, or if\nblob info is NULL, a new one.</p>\n<p>The format of the CloneBlobInfo method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *CloneBlobInfo( const <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>clone_info:</dt>\n<dd>Method CloneBlobInfo returns a duplicate of the given\nblob info, or if blob info is NULL a new one.</dd>\n<dt>quantize_info:</dt>\n<dd>a structure of type info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroyblob\">\n<h1><a class=\"toc-backref\" href=\"#id51\">DestroyBlob</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyBlob( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>DestroyBlob() deallocates memory associated with a blob.  The blob is\na reference counted object so the object is only destroyed once its\nreference count decreases to zero.</p>\n<p>The format of the DestroyBlob method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyBlob( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroyblobinfo\">\n<h1><a class=\"toc-backref\" href=\"#id52\">DestroyBlobInfo</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyBlobInfo( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>DestroyBlobInfo() deallocates memory associated with an BlobInfo structure.\nThe blob is a reference counted object so the object is only destroyed once\nits reference count decreases to zero. Use of DestroyBlob is preferred over\nthis function since it assures that the blob is closed prior to destruction.</p>\n<p>This function is no longer used within GraphicsMagick.</p>\n<p>The format of the DestroyBlobInfo method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyBlobInfo( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>blob:</dt>\n<dd>Specifies a pointer to a BlobInfo structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"detachblob\">\n<h1><a class=\"toc-backref\" href=\"#id53\">DetachBlob</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DetachBlob( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>DetachBlob() detaches a blob from the BlobInfo structure.</p>\n<p>The format of the DetachBlob method is:</p>\n<pre class=\"literal-block\">\nvoid DetachBlob( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>blob_info:</dt>\n<dd>Specifies a pointer to a BlobInfo structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"filetoblob\">\n<h1><a class=\"toc-backref\" href=\"#id54\">FileToBlob</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *FileToBlob( const char *filename, size_t *length, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>FileToBlob() returns the contents of a file in a buffer allocated via\nMagickMalloc() (which is equivalent to the system malloc() by default).\nThe character '0' is appended to the buffer in case the buffer will be\naccessed as a string.  The length of the buffer (not including the extra\nterminating '0' character) is returned via the 'length' parameter.\nIf an error occurs, a NULL pointer is returned.  The returned buffer\nmust be freed by the user in a matter compatible with MagickMalloc()\n(e.g. via MagickFree()).</p>\n<p>The format of the FileToBlob method is:</p>\n<pre class=\"literal-block\">\nvoid *FileToBlob( const char *filename, size_t *length, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>blob:</dt>\n<dd>FileToBlob() returns the contents of a file as a blob.  If\nan error occurs NULL is returned.</dd>\n<dt>filename:</dt>\n<dd>The filename.</dd>\n<dt>length:</dt>\n<dd>This pointer to a size_t integer sets the initial length of the\nblob.  On return, it reflects the actual length of the blob.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getblobfilehandle\">\n<h1><a class=\"toc-backref\" href=\"#id55\">GetBlobFileHandle</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nFILE *GetBlobFileHandle( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>GetBlobFileHandle() returns the stdio file handle associated with the\nimage blob.  If there is no associated file handle, then a null pointer\nis returned.</p>\n<p>The format of the GetBlobFileHandle method is:</p>\n<pre class=\"literal-block\">\nFILE *GetBlobFileHandle( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Image to query</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getblobinfo\">\n<h1><a class=\"toc-backref\" href=\"#id56\">GetBlobInfo</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid GetBlobInfo( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>GetBlobInfo() initializes the BlobInfo structure.</p>\n<p>The format of the GetBlobInfo method is:</p>\n<pre class=\"literal-block\">\nvoid GetBlobInfo( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>blob_info:</dt>\n<dd>Specifies a pointer to a BlobInfo structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getblobstatus\">\n<h1><a class=\"toc-backref\" href=\"#id57\">GetBlobStatus</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nint GetBlobStatus( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>GetBlobStatus() returns the blob error status.  For GraphicsMagick\n1.3.26 and earlier, this was only set by CloseBlob() but now it is\nset immediately upon error.</p>\n<p>The format of the GetBlobStatus method is:</p>\n<pre class=\"literal-block\">\nint GetBlobStatus( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getblobfirsterrno\">\n<h1><a class=\"toc-backref\" href=\"#id58\">GetBlobFirstErrno</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nint GetBlobFirstErrno( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>GetBlobFirstErrno() returns the errno present (if any) when the blob\nfirst encountered as error, as indicated by GetBlobStatus().  The\nthe purpose of this function is to help improve the quality of error\nreporting.</p>\n<p>The format of the GetBlobFirstErrno method is:</p>\n<pre class=\"literal-block\">\nint GetBlobFirstErrno( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getblobstreamdata\">\n<h1><a class=\"toc-backref\" href=\"#id59\">GetBlobStreamData</a></h1>\n<div class=\"section\" id=\"id27\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned char *GetBlobStreamData( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id28\">\n<h2>Description</h2>\n<p>GetBlobStreamData() returns the stream data for the image. The data is only\navailable if the data is stored on the heap, or is memory mapped.\nOtherwise a NULL value is returned.</p>\n<p>The format of the GetBlobStreamData method is:</p>\n<pre class=\"literal-block\">\nunsigned char *GetBlobStreamData( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getblobtemporary\">\n<h1><a class=\"toc-backref\" href=\"#id60\">GetBlobTemporary</a></h1>\n<div class=\"section\" id=\"id29\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickBool GetBlobTemporary( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id30\">\n<h2>Description</h2>\n<p>GetBlobTemporary() returns MagickTrue if the file associated with the blob\nis a temporary file and should be removed when the associated image is\ndestroyed.</p>\n<p>The format of the GetBlobTemporary method is:</p>\n<pre class=\"literal-block\">\nMagickBool GetBlobTemporary( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Image to query</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getconfigureblob\">\n<h1><a class=\"toc-backref\" href=\"#id61\">GetConfigureBlob</a></h1>\n<div class=\"section\" id=\"id31\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *GetConfigureBlob( const char *filename, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id32\">\n<h2>Description</h2>\n<p>GetConfigureBlob() returns the specified configure file as a blob.</p>\n<p>The format of the GetConfigureBlob method is:</p>\n<pre class=\"literal-block\">\nvoid *GetConfigureBlob( const char *filename, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>filename:</dt>\n<dd>The configure file name.</dd>\n<dt>path:</dt>\n<dd>return the full path information of the configure file.</dd>\n<dt>length:</dt>\n<dd>This pointer to a size_t integer sets the initial length of the\nblob.  On return, it reflects the actual length of the blob.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"imagetoblob\">\n<h1><a class=\"toc-backref\" href=\"#id62\">ImageToBlob</a></h1>\n<div class=\"section\" id=\"id33\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *ImageToBlob( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, size_t *length,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id34\">\n<h2>Description</h2>\n<p>ImageToBlob() implements direct to memory image formats.  It returns the\nimage as a formatted blob and its length.  The magick member of the Image\nstructure determines the format of the returned blob (GIF, JPEG, PNG,\netc.).  This function is the equivalent of WriteImage(), but writes the\nformatted &quot;file&quot; to a memory buffer rather than to an actual file.</p>\n<p>The format of the ImageToBlob method is:</p>\n<pre class=\"literal-block\">\nvoid *ImageToBlob( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, size_t *length,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>length:</dt>\n<dd>This pointer to a size_t integer sets the initial length of the\nblob.  On return, it reflects the actual length of the blob.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"imagetofile\">\n<h1><a class=\"toc-backref\" href=\"#id63\">ImageToFile</a></h1>\n<div class=\"section\" id=\"id35\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ImageToFile( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *filename,\n                            <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id36\">\n<h2>Description</h2>\n<p>ImageToFile() copies the input image from an open blob stream to a file.\nIt returns False if an error occurs otherwise True.  This function is used\nto handle coders which are unable to stream the data in using Blob I/O.\nInstead of streaming the data in, the data is streammed to a temporary\nfile, and the coder accesses the temorary file directly.</p>\n<p>The format of the ImageToFile method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ImageToFile( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *filename,\n                            <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>ImageToFile returns MagickPass on success; otherwise,  it\nreturns MagickFail if an error occurs.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>filename:</dt>\n<dd>Write the image to this file.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pingblob\">\n<h1><a class=\"toc-backref\" href=\"#id64\">PingBlob</a></h1>\n<div class=\"section\" id=\"id37\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *PingBlob( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const void *blob, const size_t length,\n                 <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id38\">\n<h2>Description</h2>\n<p>PingBlob() returns all the attributes of an image or image sequence except\nfor the pixels.  It is much faster and consumes far less memory than\nBlobToImage().  On failure, a NULL image is returned and exception\ndescribes the reason for the failure.</p>\n<p>The format of the PingBlob method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *PingBlob( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const void *blob, const size_t length,\n                 <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>blob:</dt>\n<dd>The address of a character stream in one of the image formats\nunderstood by GraphicsMagick.</dd>\n<dt>length:</dt>\n<dd>This size_t integer reflects the length in bytes of the blob.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"referenceblob\">\n<h1><a class=\"toc-backref\" href=\"#id65\">ReferenceBlob</a></h1>\n<div class=\"section\" id=\"id39\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> ReferenceBlob( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id40\">\n<h2>Description</h2>\n<p>ReferenceBlob() increments the reference count associated with the pixel\nblob, returning a pointer to the blob.</p>\n<p>The format of the ReferenceBlob method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> ReferenceBlob( <a class=\"reference external\" href=\"../api/types.html#blobinfo\">BlobInfo</a> *blob_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>blob_info:</dt>\n<dd>The blob_info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setblobclosable\">\n<h1><a class=\"toc-backref\" href=\"#id66\">SetBlobClosable</a></h1>\n<div class=\"section\" id=\"id41\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid SetBlobClosable( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, MagickBool closeable );\n</pre>\n</div>\n<div class=\"section\" id=\"id42\">\n<h2>Description</h2>\n<p>SetBlobClosable() enables closing the blob if MagickTrue is passed, and\nexempts the blob from being closed if False is passed.  Blobs are closable\nby default (default MagickTrue).</p>\n<p>The format of the SetBlobClosable method is:</p>\n<pre class=\"literal-block\">\nvoid SetBlobClosable( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, MagickBool closeable );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Image to update</dd>\n<dt>closeable:</dt>\n<dd>Set to FALSE in order to disable closing the blob.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setblobtemporary\">\n<h1><a class=\"toc-backref\" href=\"#id67\">SetBlobTemporary</a></h1>\n<div class=\"section\" id=\"id43\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid SetBlobTemporary( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, MagickBool isTemporary );\n</pre>\n</div>\n<div class=\"section\" id=\"id44\">\n<h2>Description</h2>\n<p>SetBlobTemporary() sets a boolean flag (default False) to specify if\nthe file associated with the blob is a temporary file and should be\nremoved when the associated image is destroyed.</p>\n<p>The format of the SetBlobTemporary method is:</p>\n<pre class=\"literal-block\">\nvoid SetBlobTemporary( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, MagickBool isTemporary );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Image to update</dd>\n<dt>isTemporary:</dt>\n<dd>Set to True to indicate that the file associated with\nthe blob is temporary.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/cdl.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>cdl</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"cdl\">\n<h1 class=\"title\">cdl</h1>\n<h2 class=\"subtitle\" id=\"apply-asc-cdl-transform-to-image\">Apply ASC CDL transform to image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#cdlimage\" id=\"id1\">CdlImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"cdlimage\">\n<h1><a class=\"toc-backref\" href=\"#id1\">CdlImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail CdlImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *cdl );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>The CdlImage() method applies (&quot;bakes in&quot;) the ASC-CDL which is a format\nfor the exchange of basic primary color grading information between\nequipment and software from different manufacturers. The format defines\nthe math for three functions: slope, offset and power. Each function uses\na number for the red, green, and blue color channels for a total of nine\nnumbers comprising a single color decision. A tenth number for chrominance\n(saturation) has been proposed but is not yet standardized.</p>\n<p>The cdl argument string is comma delimited and is in the form (but\nwithout invervening spaces or line breaks):</p>\n<p>redslope, redoffset, redpower :\ngreenslope, greenoffset, greenpower :\nblueslope, blueoffset, bluepower :\nsaturation</p>\n<p>with the unity (no change) specification being:</p>\n<p>&quot;1.0,0.0,1.0:1.0,0.0,1.0:1.0,0.0,1.0:0.0&quot;</p>\n<p>See <a class=\"reference external\" href=\"http://en.wikipedia.org/wiki/ASC_CDL\">http://en.wikipedia.org/wiki/ASC_CDL</a> for more information.</p>\n<p>The format of the CdlImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail CdlImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *cdl );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>cdl:</dt>\n<dd>Define the coefficients for slope offset and power in the\nred green and blue channels, plus saturation.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/channel.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>channel</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"channel\">\n<h1 class=\"title\">channel</h1>\n<h2 class=\"subtitle\" id=\"image-channel-functions\">Image channel functions</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#channelimage\" id=\"id11\">ChannelImage</a></li>\n<li><a class=\"reference internal\" href=\"#exportimagechannel\" id=\"id12\">ExportImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#getimagechanneldepth\" id=\"id13\">GetImageChannelDepth</a></li>\n<li><a class=\"reference internal\" href=\"#importimagechannel\" id=\"id14\">ImportImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#importimagechannelsmasked\" id=\"id15\">ImportImageChannelsMasked</a></li>\n<li><a class=\"reference internal\" href=\"#setimagechanneldepth\" id=\"id16\">SetImageChannelDepth</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"channelimage\">\n<h1><a class=\"toc-backref\" href=\"#id11\">ChannelImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int ChannelImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>Transform an image so that the resulting image is a grayscale image\nbased on a specified image channel. The resulting image is returned in\nthe RGB colorspace. This function does not force or assume an input\nimage colorspace so it may be used to extract channels from images in\ncolorspaces other than RGB or CMYK. For example, if the image is currently\ntransformed to the HWB colorspace, the 'B' channel may be extracted by\nspecifying RedChannel as the ChannelType argument.</p>\n<p>The format of the ChannelImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int ChannelImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to extract: Red, Cyan, Green, Magenta,\nBlue, Yellow, or Opacity.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"exportimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id12\">ExportImageChannel</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ExportImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                           <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>ExportImageChannel() exports a specified image channel as a new image.</p>\n<p>The format of the ExportImageChannel method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ExportImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                           <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The source image.</dd>\n<dt>channel:</dt>\n<dd>The image channel to export</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagechanneldepth\">\n<h1><a class=\"toc-backref\" href=\"#id13\">GetImageChannelDepth</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long GetImageChannelDepth( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>GetImageChannelDepth() returns the minimum bit depth required to store\nthe specified image channel without actual loss of color resolution.\nPixel components are stored in a Quantum, which is 8, 16, or 32 bits\ndepending on the QuantumDepth value set when the software is compiled.\nGetImageChannelDepth() returns the smallest modulus storage size which\nsupports the scale of the pixel within the range (i.e. no information is\nlost). As an example, the value one is returned for a bilevel channel\nsince only one bit of resolution is required to represent a bilevel channel.</p>\n<p>The format of the GetImageChannelDepth method is:</p>\n<pre class=\"literal-block\">\nunsigned long GetImageChannelDepth( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>channel:</dt>\n<dd>Channel to test.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"importimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id14\">ImportImageChannel</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ImportImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source_image, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *update_image,\n                                   const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>ImportImageChannel() imports an image into the specified image channel.</p>\n<p>The format of the ImportImageChannel method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ImportImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source_image, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *update_image,\n                                   const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel );\n</pre>\n<dl class=\"docutils\">\n<dt>source_image:</dt>\n<dd>The image to use as the replacement image channel.</dd>\n<dt>update_image:</dt>\n<dd>The image to import the channel into.</dd>\n<dt>channel:</dt>\n<dd>The image channel to import</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"importimagechannelsmasked\">\n<h1><a class=\"toc-backref\" href=\"#id15\">ImportImageChannelsMasked</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ImportImageChannelsMasked( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source_image,\n                                          <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *update_image,\n                                          const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channels );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>ImportImageChannelsMasked() imports all the channels from a source\nimage to an update image, except for the channels specified.</p>\n<p>The format of the ImportImageChannelsMasked method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ImportImageChannelsMasked( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source_image,\n                                          <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *update_image,\n                                          const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channels );\n</pre>\n<dl class=\"docutils\">\n<dt>source_image:</dt>\n<dd>The image from which to extract the replacement channels.</dd>\n<dt>update_image:</dt>\n<dd>The image to import the channels into.</dd>\n<dt>channel:</dt>\n<dd>The image channel to import</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimagechanneldepth\">\n<h1><a class=\"toc-backref\" href=\"#id16\">SetImageChannelDepth</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail SetImageChannelDepth( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                     const unsigned int depth );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>SetImageChannelDepth() translates the pixel quantums in the specified\nchannel so that if they are later divided to fit within the specified bit\ndepth, that no additional information is lost (i.e. no remainder resulting\nfrom the division). Note that any subsequent image processing is likely\nto increase the effective depth of the image channels. A non-zero\nvalue is returned if the operation is successful. Check the exception\nmember of image to determine the cause for any failure.</p>\n<p>The format of the SetImageChannelDepth method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail SetImageChannelDepth( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                     const unsigned int depth );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image to update.</dd>\n<dt>channel:</dt>\n<dd>Channel to modify.</dd>\n<dt>depth:</dt>\n<dd>Desired channel depth (range 1 to QuantumDepth)</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/color.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>color</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"color\">\n<h1 class=\"title\">color</h1>\n<h2 class=\"subtitle\" id=\"color-related-functions\">Color related functions</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#getcolorhistogram\" id=\"id5\">GetColorHistogram</a></li>\n<li><a class=\"reference internal\" href=\"#getnumbercolors\" id=\"id6\">GetNumberColors</a></li>\n<li><a class=\"reference internal\" href=\"#ispaletteimage\" id=\"id7\">IsPaletteImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"getcolorhistogram\">\n<h1><a class=\"toc-backref\" href=\"#id5\">GetColorHistogram</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nHistogramColorPacket *GetColorHistogram( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *, unsigned long *colors,\n                                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *);\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>Method GetColorHistogram returns an array of HistogramColorPacket structures\nwhich specify the number of times each unique color occurs in the image.\nThe referenced colors parameter is updated with the number of unique colors\nin the image. The returned array should be deallocated by the user once it\nis no longer ndded.</p>\n<p>The format of the GetColorHistogram method is:</p>\n<pre class=\"literal-block\">\nHistogramColorPacket *GetColorHistogram( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *, unsigned long *colors,\n                                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *);\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>colors:</dt>\n<dd>The referenced value is updated with the with the number of\nunique colors.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getnumbercolors\">\n<h1><a class=\"toc-backref\" href=\"#id6\">GetNumberColors</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long GetNumberColors( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, FILE *file,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>Method GetNumberColors returns the number of unique colors in an image.</p>\n<p>The format of the GetNumberColors method is:</p>\n<pre class=\"literal-block\">\nunsigned long GetNumberColors( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, FILE *file,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>file:</dt>\n<dd>Write a histogram of the color distribution to this file handle.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"ispaletteimage\">\n<h1><a class=\"toc-backref\" href=\"#id7\">IsPaletteImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickBool IsPaletteImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>Method IsPaletteImage returns True if the image is PseudoClass and has 256\nunique colors or less.</p>\n<p>The format of the IsPaletteImage method is:</p>\n<pre class=\"literal-block\">\nMagickBool IsPaletteImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows.</p>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method IsPaletteImage returns True is the image is\nPseudoClass or has 256 color or less.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/colormap.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>colormap</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"colormap\">\n<h1 class=\"title\">colormap</h1>\n<h2 class=\"subtitle\" id=\"colormap-related-functions\">Colormap related functions</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#allocateimagecolormap\" id=\"id5\">AllocateImageColormap</a></li>\n<li><a class=\"reference internal\" href=\"#cyclecolormapimage\" id=\"id6\">CycleColormapImage</a></li>\n<li><a class=\"reference internal\" href=\"#replaceimagecolormap\" id=\"id7\">ReplaceImageColormap</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"allocateimagecolormap\">\n<h1><a class=\"toc-backref\" href=\"#id5\">AllocateImageColormap</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail AllocateImageColormap( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long colors );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>AllocateImageColormap() allocates an image colormap and initializes\nit to a linear gray colorspace with increasing intensity.  If the image\nalready has a colormap, it is replaced.  AllocateImageColormap() returns\nMagickPass if successful, otherwise MagickFail if there is not enough memory.</p>\n<p>The format of the AllocateImageColormap method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail AllocateImageColormap( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long colors );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>colors:</dt>\n<dd>The number of colors in the image colormap.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"cyclecolormapimage\">\n<h1><a class=\"toc-backref\" href=\"#id6\">CycleColormapImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail CycleColormapImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const int amount );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>CycleColormap() displaces an image's colormap by a given number of\npositions.  If you cycle the colormap a number of times you can produce\na psychodelic effect.</p>\n<p>The format of the CycleColormapImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail CycleColormapImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const int amount );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>amount:</dt>\n<dd>Offset the colormap this much.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"replaceimagecolormap\">\n<h1><a class=\"toc-backref\" href=\"#id7\">ReplaceImageColormap</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ReplaceImageColormap( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *colormap,\n                                     const unsigned int colors );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>ReplaceImageColormap() replaces an existing image colormap with a new\nimage colormap. The new image colormap is expected to contain all of the\ncolors from the existing colormap. The existing colormap indexes are\nadjusted to conform with positions in the new colormap. If the new\ncolormap contains duplicate entries, then the associated colormap index\nwill point to the first entry found in the colormap and other matching\nentries will not be used. MagickPass is returned if the operation is\nsuccessful, otherwise MagickFail is returned, and image-&gt;exception is\nupdated with the cause of the failure.</p>\n<p>This function is useful in case colormap entries need to match across\nmultiple images or otherwise occupy specific locations.</p>\n<p>The format of the ReplaceImageColormap method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ReplaceImageColormap( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *colormap,\n                                     const unsigned int colors );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>image in which to replace colormap.</dd>\n<dt>colormap:</dt>\n<dd>new colormap.</dd>\n<dt>colors:</dt>\n<dd>number of colors in new colormap.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/compare.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>compare</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"compare\">\n<h1 class=\"title\">compare</h1>\n<h2 class=\"subtitle\" id=\"compare-images\">Compare images</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#differenceimage\" id=\"id13\">DifferenceImage</a></li>\n<li><a class=\"reference internal\" href=\"#getimagechanneldifference\" id=\"id14\">GetImageChannelDifference</a></li>\n<li><a class=\"reference internal\" href=\"#getimagechanneldistortion\" id=\"id15\">GetImageChannelDistortion</a></li>\n<li><a class=\"reference internal\" href=\"#getimagedistortion\" id=\"id16\">GetImageDistortion</a></li>\n<li><a class=\"reference internal\" href=\"#isimagesequal\" id=\"id17\">IsImagesEqual</a></li>\n<li><a class=\"reference internal\" href=\"#initializedifferenceimageoptions\" id=\"id18\">InitializeDifferenceImageOptions</a></li>\n<li><a class=\"reference internal\" href=\"#initializedifferencestatistics\" id=\"id19\">InitializeDifferenceStatistics</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"differenceimage\">\n<h1><a class=\"toc-backref\" href=\"#id13\">DifferenceImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *DifferenceImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference_image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *compare_image,\n                        const DifferenceImageOptions *difference_options,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>DifferenceImage() returns an annotated difference image based on the\nthe difference between a reference image and a compare image.</p>\n<p>The format of the DifferenceImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *DifferenceImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference_image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *compare_image,\n                        const DifferenceImageOptions *difference_options,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>reference_image:</dt>\n<dd>the reference image.</dd>\n<dt>compare_image:</dt>\n<dd>the comparison image.</dd>\n<dt>difference_options:</dt>\n<dd>options to use when differencing.</dd>\n<dt>channel:</dt>\n<dd>the channel(s) to compare.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagechanneldifference\">\n<h1><a class=\"toc-backref\" href=\"#id14\">GetImageChannelDifference</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail GetImageChannelDifference( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference_image,\n                                          const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *compare_image,\n                                          const MetricType metric,\n                                          DifferenceStatistics *statistics,\n                                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>GetImageChannelDifference() updates a user provided statistics structure\nwith per-channel, and totalized, difference statistics corresponding\nto a specified comparison metric.</p>\n<p>The format of the GetImageChannelDifference method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail GetImageChannelDifference( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference_image,\n                                          const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *compare_image,\n                                          const MetricType metric,\n                                          DifferenceStatistics *statistics,\n                                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>reference_image:</dt>\n<dd>the reference image.</dd>\n<dt>compare_image:</dt>\n<dd>the comparison image.</dd>\n<dt>metric:</dt>\n<dd>metric to use when differencing.</dd>\n<dt>statistics:</dt>\n<dd>the statistics structure to populate.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagechanneldistortion\">\n<h1><a class=\"toc-backref\" href=\"#id15\">GetImageChannelDistortion</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail GetImageChannelDistortion( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference_image,\n                                          const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *compare_image,\n                                          const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                          const MetricType metric, double *distortion,\n                                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>GetImageChannelDistortion() updates a distortion parameter with the\ndistortion (error) computed according to the specified comparison metric.\nThe value returned is only for the channel specified.</p>\n<p>The format of the GetImageChannelDistortion method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail GetImageChannelDistortion( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference_image,\n                                          const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *compare_image,\n                                          const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                          const MetricType metric, double *distortion,\n                                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>reference_image:</dt>\n<dd>the reference image.</dd>\n<dt>compare_image:</dt>\n<dd>the comparison image.</dd>\n<dt>channel:</dt>\n<dd>the channel to obtain error data for.</dd>\n<dt>metric:</dt>\n<dd>metric to use when differencing.</dd>\n<dt>distortion:</dt>\n<dd>updated with the computed distortion.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagedistortion\">\n<h1><a class=\"toc-backref\" href=\"#id16\">GetImageDistortion</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail GetImageDistortion( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference_image,\n                                   const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *compare_image, const MetricType metric,\n                                   double *distortion, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>GetImageDistortion() updates a distortion parameter with the distortion\n(error) computed according to the specified comparison metric.  The value\nreturned reflects all enabled channels.</p>\n<p>The format of the GetImageDistortion method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail GetImageDistortion( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference_image,\n                                   const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *compare_image, const MetricType metric,\n                                   double *distortion, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>reference_image:</dt>\n<dd>the reference image.</dd>\n<dt>compare_image:</dt>\n<dd>the comparison image.</dd>\n<dt>channel:</dt>\n<dd>the channel to obtain error data for.</dd>\n<dt>metric:</dt>\n<dd>metric to use when differencing.</dd>\n<dt>distortion:</dt>\n<dd>updated with the computed distortion.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"isimagesequal\">\n<h1><a class=\"toc-backref\" href=\"#id17\">IsImagesEqual</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickBool IsImagesEqual( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>IsImagesEqual() measures the difference between colors at each pixel\nlocation of two images.  A value other than 0 means the colors match\nexactly.  Otherwise an error measure is computed by summing over all\npixels in an image the distance squared in RGB space between each image\npixel and its corresponding pixel in the reference image.  The error\nmeasure is assigned to these image members:</p>\n<p>o mean_error_per_pixel:  The mean error for any single pixel in\nthe image.</p>\n<p>o normalized_mean_error:  The normalized mean quantization error for\nany single pixel in the image.  This distance measure is normalized to\na range between 0 and 1.  It is independent of the range of red, green,\nand blue values in the image.</p>\n<p>o normalized_maximum_error:  The normalized maximum quantization\nerror for any single pixel in the image.  This distance measure is\nnormalized to a range between 0 and 1.  It is independent of the range\nof red, green, and blue values in your image.</p>\n<p>A small normalized mean square error, accessed as\nimage-&gt;normalized_mean_error, suggests the images are very similiar in\nspatial layout and color.</p>\n<p>The format of the IsImagesEqual method is:</p>\n<pre class=\"literal-block\">\nMagickBool IsImagesEqual( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *reference );\n</pre>\n<p>A description of each parameter follows.</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>reference:</dt>\n<dd>The reference image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"initializedifferenceimageoptions\">\n<h1><a class=\"toc-backref\" href=\"#id18\">InitializeDifferenceImageOptions</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid InitializeDifferenceImageOptions( DifferenceImageOptions *options,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>InitializeDifferenceImageOptions() assigns default options to a user-provided\nDifferenceImageOptions structure.  This function should always be used\nto initialize the DifferenceImageOptions structure prior to making any\nchanges to it.</p>\n<p>The format of the InitializeDifferenceImageOptions method is:</p>\n<pre class=\"literal-block\">\nvoid InitializeDifferenceImageOptions( DifferenceImageOptions *options,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>options:</dt>\n<dd>pointer to DifferenceImageOptions structure to initialize.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"initializedifferencestatistics\">\n<h1><a class=\"toc-backref\" href=\"#id19\">InitializeDifferenceStatistics</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid InitializeDifferenceStatistics( DifferenceStatistics *options,\n                                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>InitializeDifferenceStatistics() assigns default options to a user-provided\nDifferenceStatistics structure.</p>\n<p>The format of the InitializeDifferenceStatistics method is:</p>\n<pre class=\"literal-block\">\nvoid InitializeDifferenceStatistics( DifferenceStatistics *options,\n                                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>options:</dt>\n<dd>pointer to DifferenceStatistics structure to initialize.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/composite.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>composite</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"composite\">\n<h1 class=\"title\">composite</h1>\n<h2 class=\"subtitle\" id=\"merge-image-pixels-using-a-specified-algorithm\">Merge image pixels using a specified algorithm</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#compositeimage\" id=\"id1\">CompositeImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"compositeimage\">\n<h1><a class=\"toc-backref\" href=\"#id1\">CompositeImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail CompositeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *canvas_image, const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> compose,\n                               const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *composite_image, const long x_offset,\n                               const long y_offset );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>CompositeImage() composites the second image (composite_image) onto the\nfirst (canvas_image) at the specified offsets.</p>\n<p>The format of the CompositeImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail CompositeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *canvas_image, const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> compose,\n                               const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *composite_image, const long x_offset,\n                               const long y_offset );\n</pre>\n<dl class=\"docutils\">\n<dt>canvas_image:</dt>\n<dd>The image to be updated.</dd>\n<dt>compose:</dt>\n<dd>This operator affects how the composite is applied to\nthe image.  Choose from one of these operators: AddCompositeOp,\nAtopCompositeOp, BumpmapCompositeOp, ClearCompositeOp,\nColorizeCompositeOp, CopyBlackCompositeOp, CopyBlueCompositeOp,\nCopyCompositeOp, CopyCyanCompositeOp,CopyGreenCompositeOp,\nCopyMagentaCompositeOp, CopyOpacityCompositeOp, CopyRedCompositeOp,\nCopyYellowCompositeOp, DarkenCompositeOp, DifferenceCompositeOp,\nDisplaceCompositeOp, DissolveCompositeOp, DivideCompositeOp,\nHueCompositeOp, InCompositeOp, LightenCompositeOp, LuminizeCompositeOp,\nMinusCompositeOp, ModulateCompositeOp, MultiplyCompositeOp,\nNoCompositeOp, OutCompositeOp, OverlayCompositeOp, PlusCompositeOp,\nSaturateCompositeOp, ScreenCompositeOp, SubtractCompositeOp,\nThresholdCompositeOp, XorCompositeOp, HardLightCompositeOp.</dd>\n<dt>composite_image:</dt>\n<dd>The composite image.</dd>\n<dt>x_offset:</dt>\n<dd>The column offset of the composited image.</dd>\n<dt>y_offset:</dt>\n<dd>The row offset of the composited image.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/confirm_access.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>confirm_access</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"confirm-access\">\n<h1 class=\"title\">confirm_access</h1>\n<h2 class=\"subtitle\" id=\"access-confirmation-functions\">Access confirmation functions</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#magickconfirmaccess\" id=\"id3\">MagickConfirmAccess</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetconfirmaccesshandler\" id=\"id4\">MagickSetConfirmAccessHandler</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"magickconfirmaccess\">\n<h1><a class=\"toc-backref\" href=\"#id3\">MagickConfirmAccess</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail MagickConfirmAccess( const ConfirmAccessMode mode, const char *path,\n                                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>MagickConfirmAccess() calls the access confirmation handler method with\nparameters which describe the requested access mode and path/URL, as well\nas an ExceptionInfo structure to update with any error information.  A\nuser-provided callback (set by MagickSetConfirmAccessHandler()) is\ninvoked.  If the callback returns MagickFail, then this function also\nreturns MagickFail, which is intended to determine if the operation may\ncontinue.  The callback is expected to report the reason access is denied\nby filling out the ExceptionInfo structure.  If the callback fails to do\nso, then a generic &quot;access denied&quot; error is reported.</p>\n<p>The format of the MagickConfirmAccess method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail MagickConfirmAccess( const ConfirmAccessMode mode, const char *path,\n                                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>mode:</dt>\n<dd>The type of access to be performed.</dd>\n<dt>path:</dt>\n<dd>The local path or URL requested to be accessed.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetconfirmaccesshandler\">\n<h1><a class=\"toc-backref\" href=\"#id4\">MagickSetConfirmAccessHandler</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nConfirmAccessHandler MagickSetConfirmAccessHandler( ConfirmAccessHandler handler );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>MagickSetConfirmAccessHandler() sets the access confirmation handler to\nthe specified method and returns the previous access confirmation handler.\nThis access confirmation handler is used to &quot;approve&quot; access to files and\nURLs.  If the handler returns MagickFalse, then access is denied.  This\nmechanism may be used to enforce security policies and/or may be used to\nmonitor file and URL accesses.</p>\n<p>The format of the MagickSetConfirmAccessHandler method is:</p>\n<pre class=\"literal-block\">\nConfirmAccessHandler MagickSetConfirmAccessHandler( ConfirmAccessHandler handler );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>handler:</dt>\n<dd>Specifies a pointer to a method to handle access confirmation.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/constitute.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>constitute</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"constitute\">\n<h1 class=\"title\">constitute</h1>\n<h2 class=\"subtitle\" id=\"read-or-write-an-image\">Read or write an image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#constituteimage\" id=\"id15\">ConstituteImage</a></li>\n<li><a class=\"reference internal\" href=\"#dispatchimage\" id=\"id16\">DispatchImage</a></li>\n<li><a class=\"reference internal\" href=\"#pingimage\" id=\"id17\">PingImage</a></li>\n<li><a class=\"reference internal\" href=\"#readimage\" id=\"id18\">ReadImage</a></li>\n<li><a class=\"reference internal\" href=\"#readinlineimage\" id=\"id19\">ReadInlineImage</a></li>\n<li><a class=\"reference internal\" href=\"#writeimage\" id=\"id20\">WriteImage</a></li>\n<li><a class=\"reference internal\" href=\"#writeimages\" id=\"id21\">WriteImages</a></li>\n<li><a class=\"reference internal\" href=\"#writeimagesfile\" id=\"id22\">WriteImagesFile</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"constituteimage\">\n<h1><a class=\"toc-backref\" href=\"#id15\">ConstituteImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ConstituteImage( const unsigned long width, const unsigned long height,\n                        const char *map, const <a class=\"reference external\" href=\"../api/types.html#storagetype\">StorageType</a> type, const void *pixels,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>ConstituteImage() returns an Image corresponding to an image stored\nin a raw memory array format. The pixel data must be in scanline order\ntop-to-bottom. The data can be unsigned char, unsigned short int, unsigned\nint, unsigned long, float, or double.  Float and double require the pixels\nto be normalized to the range [0..1], otherwise the range is [0..MaxVal]\nwhere MaxVal is the maximum possible value for that type.</p>\n<p>Note that for most 32-bit architectures the size of an unsigned long is\nthe same as unsigned int, but for 64-bit architectures observing the LP64\nstandard, an unsigned long is 64 bits, while an unsigned int remains 32\nbits. This should be considered when deciding if the data should be\ndescribed as &quot;Integer&quot; or &quot;Long&quot;.</p>\n<p>For example, to create a 640x480 image from unsigned red-green-blue\ncharacter data, use</p>\n<p>image=ConstituteImage(640,480,&quot;RGB&quot;,CharPixel,pixels,&amp;exception);</p>\n<p>The format of the Constitute method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ConstituteImage( const unsigned long width, const unsigned long height,\n                        const char *map, const <a class=\"reference external\" href=\"../api/types.html#storagetype\">StorageType</a> type, const void *pixels,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>width:</dt>\n<dd>width in pixels of the image.</dd>\n<dt>height:</dt>\n<dd>height in pixels of the image.</dd>\n<dt>map:</dt>\n<dd>This string reflects the expected ordering of the pixel array.\nIt can be any combination or order of R = red, G = green, B = blue,\nA = alpha (same as Transparency), O = Opacity, T = Transparency,\nC = cyan, Y = yellow, M = magenta, K = black, or I = intensity\n(for grayscale). Specify &quot;P&quot; = pad, to skip over a quantum which is\nintentionally ignored. Creation of an alpha channel for CMYK images\nis currently not supported.</dd>\n<dt>type:</dt>\n<dd>Define the data type of the pixels.  Float and double types are\nexpected to be normalized [0..1] otherwise [0..MaxRGB].  Choose from\nthese types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,\nor DoublePixel.</dd>\n<dt>pixels:</dt>\n<dd>This array of values contain the pixel components as defined by\nmap and type.  You must preallocate this array where the expected\nlength varies depending on the values of width, height, map, and type.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"dispatchimage\">\n<h1><a class=\"toc-backref\" href=\"#id16\">DispatchImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail DispatchImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x_offset, const long y_offset,\n                              const unsigned long columns, const unsigned long rows,\n                              const char *map, const <a class=\"reference external\" href=\"../api/types.html#storagetype\">StorageType</a> type, void *pixels,\n                              <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>DispatchImage() extracts pixel data from an Image into a raw memory array.\nThe pixel data is written in scanline order top-to-bottom using an\narbitrary quantum order specified by 'map', and with quantum size\nspecified by 'type'.</p>\n<p>The output array data may be unsigned char, unsigned short int, unsigned\nint, unsigned long, float, or double.  Float and double require the pixels\nto be normalized to the range [0..1], otherwise the range is [0..MaxVal]\nwhere MaxVal is the maximum possible value for that type.</p>\n<p>The method returns MagickPass on success or MagickFail if an error is\nencountered.</p>\n<p>Suppose we want want to extract the first scanline of a 640x480 image as\ncharacter data in red-green-blue order:</p>\n<p>DispatchImage(image,0,0,640,1,&quot;RGB&quot;,0,pixels,exception);</p>\n<p>The format of the DispatchImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail DispatchImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x_offset, const long y_offset,\n                              const unsigned long columns, const unsigned long rows,\n                              const char *map, const <a class=\"reference external\" href=\"../api/types.html#storagetype\">StorageType</a> type, void *pixels,\n                              <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>x_offset, y_offset, columns, rows:</dt>\n<dd>These values define the perimeter\nof a region of pixels you want to extract.</dd>\n<dt>map:</dt>\n<dd>This string reflects the expected ordering of the pixel array.\nIt can be any combination or order of R = red, G = green, B = blue,\nA = alpha  (same as Transparency), O = Opacity, T = Transparency,\nC = cyan, Y = yellow, M = magenta, K = black, I = intensity (for\ngrayscale). Specify &quot;P&quot; = pad, to output a pad quantum. Pad quantums\nare zero-value.</dd>\n<dt>type:</dt>\n<dd>Define the data type of the pixels.  Float and double types are\nexpected to be normalized [0..1] otherwise [0..MaxRGB].  Choose from\nthese types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,\nor DoublePixel.</dd>\n<dt>pixels:</dt>\n<dd>This array of values contain the pixel components as defined by\nmap and type.  You must preallocate this array where the expected\nlength varies depending on the values of width, height, map, and type.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pingimage\">\n<h1><a class=\"toc-backref\" href=\"#id17\">PingImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *PingImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>PingImage() returns all the attributes of an image or image sequence\nexcept for the pixels.  It is much faster and consumes far less memory\nthan ReadImage().  On failure, a NULL image is returned and exception\ndescribes the reason for the failure.</p>\n<p>The format of the PingImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *PingImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>Ping the image defined by the file or filename members of\nthis structure.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"readimage\">\n<h1><a class=\"toc-backref\" href=\"#id18\">ReadImage</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ReadImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>ReadImage() reads an image or image sequence from a file or file handle.\nThe method returns a NULL if there is a memory shortage or if the image\ncannot be read.  On failure, a NULL image is returned and exception\ndescribes the reason for the failure.</p>\n<p>The format of the ReadImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ReadImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>Read the image defined by the file or filename members of\nthis structure.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"readinlineimage\">\n<h1><a class=\"toc-backref\" href=\"#id19\">ReadInlineImage</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ReadInlineImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *content,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>ReadInlineImage() reads a Base64-encoded inline image or image sequence.\nThe method returns a NULL if there is a memory shortage or if the image\ncannot be read.  On failure, a NULL image is returned and exception\ndescribes the reason for the failure.</p>\n<p>The format of the ReadInlineImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ReadInlineImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *content,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>content:</dt>\n<dd>The image encoded in Base64.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"writeimage\">\n<h1><a class=\"toc-backref\" href=\"#id20\">WriteImage</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail WriteImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>Use WriteImage() to write an image or an image sequence to a file or\nfilehandle.  If writing to a file on disk, the name is defined by the\nfilename member of the image structure.  WriteImage() returns\nMagickFailure is there is a memory shortage or if the image cannot be\nwritten.  Check the exception member of image to determine the cause\nfor any failure.</p>\n<p>The format of the WriteImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail WriteImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"writeimages\">\n<h1><a class=\"toc-backref\" href=\"#id21\">WriteImages</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail WriteImages( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image,\n                            const char *filename, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>WriteImages() writes an image sequence into one or more files.  While\nWriteImage() will also write an image sequence, it is limited to writing\nthe sequence into a single file using a format which supports multiple\nframes.  WriteImages() does not have that limitation since it will\ngenerate multiple output files if necessary (or when requested).  When\nImageInfo's adjoin flag is set to MagickFalse, the file name is expected\nto include a printf-style formatting string for the frame number (e.g.\n&quot;image%02d.miff&quot;) so that the frames may be written.</p>\n<p>The format of the WriteImages method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail WriteImages( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image,\n                            const char *filename, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>images:</dt>\n<dd>The image list.</dd>\n<dt>filename:</dt>\n<dd>The image filename.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"writeimagesfile\">\n<h1><a class=\"toc-backref\" href=\"#id22\">WriteImagesFile</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int WriteImagesFile( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, FILE *file,\n                              <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>WriteImagesFile() writes an image or image sequence to a stdio\nFILE handle.  This may be used to append an encoded image to an already\nexisting appended image sequence if the file seek position is at the end\nof an existing file.</p>\n<p>The format of the WriteImagesFile method is:</p>\n<pre class=\"literal-block\">\nunsigned int WriteImagesFile( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, FILE *file,\n                              <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>images:</dt>\n<dd>The image list.</dd>\n<dt>file:</dt>\n<dd>The open (and positioned) file handle.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/decorate.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>decorate</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"decorate\">\n<h1 class=\"title\">decorate</h1>\n<h2 class=\"subtitle\" id=\"add-decorative-frames-and-borders\">Add decorative frames and borders</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#borderimage\" id=\"id5\">BorderImage</a></li>\n<li><a class=\"reference internal\" href=\"#frameimage\" id=\"id6\">FrameImage</a></li>\n<li><a class=\"reference internal\" href=\"#raiseimage\" id=\"id7\">RaiseImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"borderimage\">\n<h1><a class=\"toc-backref\" href=\"#id5\">BorderImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *BorderImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *border_info,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>BorderImage() surrounds the image with a border of the color defined by\nthe bordercolor member of the image structure.  The width and height\nof the border are defined by the corresponding members of the border_info\nstructure.</p>\n<p>The format of the BorderImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *BorderImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *border_info,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>border_info:</dt>\n<dd>Define the width and height of the border.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"frameimage\">\n<h1><a class=\"toc-backref\" href=\"#id6\">FrameImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *FrameImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#frameinfo\">FrameInfo</a> *frame_info,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>FrameImage() adds a simulated three-dimensional border around the image.\nThe color of the border is defined by the matte_color member of image.\nMembers width and height of frame_info specify the border width of the\nvertical and horizontal sides of the frame.  Members inner and outer\nindicate the width of the inner and outer shadows of the frame.</p>\n<p>The format of the FrameImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *FrameImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#frameinfo\">FrameInfo</a> *frame_info,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>frame_info:</dt>\n<dd>Define the width and height of the frame and its bevels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"raiseimage\">\n<h1><a class=\"toc-backref\" href=\"#id7\">RaiseImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int RaiseImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *raise_info,\n                         const int raise_flag );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>RaiseImage() creates a simulated three-dimensional button-like effect\nby lightening and darkening the edges of the image.  Members width and\nheight of raise_info define the width of the vertical and horizontal\nedge of the effect.</p>\n<p>The format of the RaiseImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int RaiseImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *raise_info,\n                         const int raise_flag );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>raise_info:</dt>\n<dd>Define the width and height of the raise area.</dd>\n<dt>raise_flag:</dt>\n<dd>A value other than zero creates a 3-D raise effect,\notherwise it has a lowered effect.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/deprecate.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>deprecate</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"deprecate\">\n<h1 class=\"title\">deprecate</h1>\n<h2 class=\"subtitle\" id=\"methods-which-should-no-longer-be-used\">Methods which should no longer be used</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#acquirecacheview\" id=\"id19\">AcquireCacheView</a></li>\n<li><a class=\"reference internal\" href=\"#acquirememory\" id=\"id20\">AcquireMemory</a></li>\n<li><a class=\"reference internal\" href=\"#clonememory\" id=\"id21\">CloneMemory</a></li>\n<li><a class=\"reference internal\" href=\"#getcacheview\" id=\"id22\">GetCacheView</a></li>\n<li><a class=\"reference internal\" href=\"#liberatememory\" id=\"id23\">LiberateMemory</a></li>\n<li><a class=\"reference internal\" href=\"#popimagepixels\" id=\"id24\">PopImagePixels</a></li>\n<li><a class=\"reference internal\" href=\"#pushimagepixels\" id=\"id25\">PushImagePixels</a></li>\n<li><a class=\"reference internal\" href=\"#reacquirememory\" id=\"id26\">ReacquireMemory</a></li>\n<li><a class=\"reference internal\" href=\"#setcacheview\" id=\"id27\">SetCacheView</a></li>\n<li><a class=\"reference internal\" href=\"#synccacheview\" id=\"id28\">SyncCacheView</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"acquirecacheview\">\n<h1><a class=\"toc-backref\" href=\"#id19\">AcquireCacheView</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AcquireCacheView( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                                     const unsigned long columns, const unsigned long rows,\n                                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>Method AcquireCacheView gets pixels from the in-memory or disk pixel cache\nas defined by the geometry parameters for read-only access.   A pointer to\nthe pixels is returned if the pixels are transferred, otherwise NULL is\nreturned.</p>\n<p>The format of the AcquireCacheView method is:</p>\n<pre class=\"literal-block\">\nconst <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AcquireCacheView( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                                     const unsigned long columns, const unsigned long rows,\n                                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>Method AcquireCacheView returns a null pointer if an error\noccurs, otherwise a pointer to the view pixels.</dd>\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"acquirememory\">\n<h1><a class=\"toc-backref\" href=\"#id20\">AcquireMemory</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *AcquireMemory( const size_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>AcquireMemory() returns a pointer to a block of memory of at least size\nbytes suitably aligned for any use.  NULL is returned if insufficient\nmemory is available or the requested size is zero.</p>\n<p>The format of the AcquireMemory method is:</p>\n<pre class=\"literal-block\">\nvoid *AcquireMemory( const size_t size );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>size:</dt>\n<dd>The size of the memory in bytes to allocate.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"clonememory\">\n<h1><a class=\"toc-backref\" href=\"#id21\">CloneMemory</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *CloneMemory( void *destination, const void *source, const size_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>CloneMemory() copies size bytes from memory area source to the\ndestination.  Copying between objects that overlap will take place\ncorrectly.  It returns destination.</p>\n<p>The format of the CloneMemory method is:</p>\n<pre class=\"literal-block\">\nvoid *CloneMemory( void *destination, const void *source, const size_t size );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>size:</dt>\n<dd>The size of the memory in bytes to allocate.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getcacheview\">\n<h1><a class=\"toc-backref\" href=\"#id22\">GetCacheView</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetCacheView( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                           const unsigned long columns, const unsigned long rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>GetCacheView() gets writeable pixels from the in-memory or disk pixel\ncache as defined by the geometry parameters.   A pointer to the pixels\nis returned if the pixels are transferred, otherwise a NULL is returned.</p>\n<p>The format of the GetCacheView method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetCacheView( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                           const unsigned long columns, const unsigned long rows );\n</pre>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>Method GetCacheView returns a null pointer if an error\noccurs, otherwise a pointer to the view pixels.</dd>\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"liberatememory\">\n<h1><a class=\"toc-backref\" href=\"#id23\">LiberateMemory</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid LiberateMemory( void ** memory );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>LiberateMemory() frees memory that has already been allocated, and\nNULLs the pointer to it.</p>\n<p>The format of the LiberateMemory method is:</p>\n<pre class=\"literal-block\">\nvoid LiberateMemory( void ** memory );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>memory:</dt>\n<dd>A pointer to a block of memory to free for reuse.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"popimagepixels\">\n<h1><a class=\"toc-backref\" href=\"#id24\">PopImagePixels</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PopImagePixels( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum,\n                             unsigned char *destination );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>PopImagePixels() transfers one or more pixel components from the image pixel\ncache to a user supplied buffer.   True is returned if the pixels are\nsuccessfully transferred, otherwise False.</p>\n<p>The format of the PopImagePixels method is:</p>\n<pre class=\"literal-block\">\nunsigned int PopImagePixels( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum,\n                             unsigned char *destination );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method PopImagePixels returns True if the pixels are\nsuccessfully transferred, otherwise False.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>quantum:</dt>\n<dd>Declare which pixel components to transfer (RGB, RGBA, etc).</dd>\n<dt>destination:</dt>\n<dd>The components are transferred to this buffer.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pushimagepixels\">\n<h1><a class=\"toc-backref\" href=\"#id25\">PushImagePixels</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PushImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                              const unsigned char *source );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>PushImagePixels() transfers one or more pixel components from a user\nsupplied buffer into the image pixel cache of an image.  It returns True if\nthe pixels are successfully transferred, otherwise False.</p>\n<p>The format of the PushImagePixels method is:</p>\n<pre class=\"literal-block\">\nunsigned int PushImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                              const unsigned char *source );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method PushImagePixels returns True if the pixels are\nsuccessfully transferred, otherwise False.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>quantum_type:</dt>\n<dd>Declare which pixel components to transfer (red, green,\nblue, opacity, RGB, or RGBA).</dd>\n<dt>source:</dt>\n<dd>The pixel components are transferred from this buffer.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"reacquirememory\">\n<h1><a class=\"toc-backref\" href=\"#id26\">ReacquireMemory</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid ReacquireMemory( void ** memory, const size_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>ReacquireMemory() changes the size of the memory and returns a\npointer to the (possibly moved) block.  The contents will be unchanged\nup to the lesser of the new and old sizes.</p>\n<p>The format of the ReacquireMemory method is:</p>\n<pre class=\"literal-block\">\nvoid ReacquireMemory( void ** memory, const size_t size );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>memory:</dt>\n<dd>A pointer to a memory allocation.  On return the pointer\nmay change but the contents of the original allocation will not.</dd>\n<dt>size:</dt>\n<dd>The new size of the allocated memory.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setcacheview\">\n<h1><a class=\"toc-backref\" href=\"#id27\">SetCacheView</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *SetCacheView( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                           const unsigned long columns, const unsigned long rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>SetCacheView() gets pixels from the in-memory or disk pixel cache as\ndefined by the geometry parameters.   A pointer to the pixels is returned\nif the pixels are transferred, otherwise a NULL is returned.</p>\n<p>The format of the SetCacheView method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *SetCacheView( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                           const unsigned long columns, const unsigned long rows );\n</pre>\n<dl class=\"docutils\">\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"synccacheview\">\n<h1><a class=\"toc-backref\" href=\"#id28\">SyncCacheView</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail SyncCacheView( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>SyncCacheView() saves the view pixels to the in-memory or disk cache.\nThe method returns MagickPass if the pixel region is synced, otherwise\nMagickFail.</p>\n<p>The format of the SyncCacheView method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail SyncCacheView( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/describe.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>describe</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"describe\">\n<h1 class=\"title\">describe</h1>\n<h2 class=\"subtitle\" id=\"methods-to-describe-an-image\">Methods to describe an image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#describeimage\" id=\"id1\">DescribeImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"describeimage\">\n<h1><a class=\"toc-backref\" href=\"#id1\">DescribeImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DescribeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, FILE *file, const MagickBool verbose );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>DescribeImage() describes an image by printing its attributes to the file.\nAttributes include the image width, height, size, and others.</p>\n<p>The format of the DescribeImage method is:</p>\n<pre class=\"literal-block\">\nvoid DescribeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, FILE *file, const MagickBool verbose );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>file:</dt>\n<dd>The file, typically stdout.</dd>\n<dt>verbose:</dt>\n<dd>A value other than zero prints more detailed information\nabout the image. Values greater than one enable counting the number of\ncolors in the image.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/display.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>display</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"display\">\n<h1 class=\"title\">display</h1>\n<h2 class=\"subtitle\" id=\"interactively-display-and-edit-an-image\">Interactively display and edit an image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#magickxdisplaybackgroundimage\" id=\"id3\">MagickXDisplayBackgroundImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickxdisplayimage\" id=\"id4\">MagickXDisplayImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"magickxdisplaybackgroundimage\">\n<h1><a class=\"toc-backref\" href=\"#id3\">MagickXDisplayBackgroundImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickXDisplayBackgroundImage( Display *display,\n                                            <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                                            <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>MagickXDisplayBackgroundImage() displays an image in the background of a window.</p>\n<p>The format of the MagickXDisplayBackgroundImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickXDisplayBackgroundImage( Display *display,\n                                            <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                                            <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>resource_info:</dt>\n<dd>Specifies a pointer to a X11 MagickXResourceInfo structure.</dd>\n<dt>image:</dt>\n<dd>Specifies a pointer to an Image structure; returned from\nReadImage.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickxdisplayimage\">\n<h1><a class=\"toc-backref\" href=\"#id4\">MagickXDisplayImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MagickXDisplayImage( Display *display, <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                            char ** argv, int argc, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** image,\n                            unsigned long *state );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>MagickXDisplayImage() displays an image via X11.  A new image is created and\nreturned if the user interactively transforms the displayed image.</p>\n<p>The format of the MagickXDisplayImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MagickXDisplayImage( Display *display, <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                            char ** argv, int argc, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** image,\n                            unsigned long *state );\n</pre>\n<dl class=\"docutils\">\n<dt>nexus:</dt>\n<dd>Method MagickXDisplayImage returns an image when the\nuser chooses 'Open Image' from the command menu or picks a tile\nfrom the image directory.  Otherwise a null image is returned.</dd>\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>resource_info:</dt>\n<dd>Specifies a pointer to a X11 MagickXResourceInfo structure.</dd>\n<dt>argv:</dt>\n<dd>Specifies the application's argument list.</dd>\n<dt>argc:</dt>\n<dd>Specifies the number of arguments.</dd>\n<dt>image:</dt>\n<dd>Specifies an address to an address of an Image structure;\nreturned from ReadImage.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/draw.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>draw</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"draw\">\n<h1 class=\"title\">draw</h1>\n<h2 class=\"subtitle\" id=\"user-friendly-methods-to-draw-on-an-image\">User-friendly methods to draw on an image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#drawannotation\" id=\"id225\">DrawAnnotation</a></li>\n<li><a class=\"reference internal\" href=\"#drawaffine\" id=\"id226\">DrawAffine</a></li>\n<li><a class=\"reference internal\" href=\"#drawallocatecontext\" id=\"id227\">DrawAllocateContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawarc\" id=\"id228\">DrawArc</a></li>\n<li><a class=\"reference internal\" href=\"#drawbezier\" id=\"id229\">DrawBezier</a></li>\n<li><a class=\"reference internal\" href=\"#drawcircle\" id=\"id230\">DrawCircle</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetclippath\" id=\"id231\">DrawGetClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetclippath\" id=\"id232\">DrawSetClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetcliprule\" id=\"id233\">DrawGetClipRule</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetcliprule\" id=\"id234\">DrawSetClipRule</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetclipunits\" id=\"id235\">DrawGetClipUnits</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetclipunits\" id=\"id236\">DrawSetClipUnits</a></li>\n<li><a class=\"reference internal\" href=\"#drawcolor\" id=\"id237\">DrawColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawcomment\" id=\"id238\">DrawComment</a></li>\n<li><a class=\"reference internal\" href=\"#drawdestroycontext\" id=\"id239\">DrawDestroyContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawellipse\" id=\"id240\">DrawEllipse</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfillcolor\" id=\"id241\">DrawGetFillColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfillcolor\" id=\"id242\">DrawSetFillColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfillcolorstring\" id=\"id243\">DrawSetFillColorString</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfillpatternurl\" id=\"id244\">DrawSetFillPatternURL</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfillopacity\" id=\"id245\">DrawGetFillOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfillopacity\" id=\"id246\">DrawSetFillOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfillrule\" id=\"id247\">DrawGetFillRule</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfillrule\" id=\"id248\">DrawSetFillRule</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfont\" id=\"id249\">DrawGetFont</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfont\" id=\"id250\">DrawSetFont</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontfamily\" id=\"id251\">DrawGetFontFamily</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontfamily\" id=\"id252\">DrawSetFontFamily</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontsize\" id=\"id253\">DrawGetFontSize</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontsize\" id=\"id254\">DrawSetFontSize</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontstretch\" id=\"id255\">DrawGetFontStretch</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontstretch\" id=\"id256\">DrawSetFontStretch</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontstyle\" id=\"id257\">DrawGetFontStyle</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontstyle\" id=\"id258\">DrawSetFontStyle</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontweight\" id=\"id259\">DrawGetFontWeight</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontweight\" id=\"id260\">DrawSetFontWeight</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetgravity\" id=\"id261\">DrawGetGravity</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetgravity\" id=\"id262\">DrawSetGravity</a></li>\n<li><a class=\"reference internal\" href=\"#drawcomposite\" id=\"id263\">DrawComposite</a></li>\n<li><a class=\"reference internal\" href=\"#drawline\" id=\"id264\">DrawLine</a></li>\n<li><a class=\"reference internal\" href=\"#drawmatte\" id=\"id265\">DrawMatte</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathclose\" id=\"id266\">DrawPathClose</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoabsolute\" id=\"id267\">DrawPathCurveToAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetorelative\" id=\"id268\">DrawPathCurveToRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoquadraticbezierabsolute\" id=\"id269\">DrawPathCurveToQuadraticBezierAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoquadraticbezierrelative\" id=\"id270\">DrawPathCurveToQuadraticBezierRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoquadraticbeziersmoothabsolute\" id=\"id271\">DrawPathCurveToQuadraticBezierSmoothAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoquadraticbeziersmoothrelative\" id=\"id272\">DrawPathCurveToQuadraticBezierSmoothRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetosmoothabsolute\" id=\"id273\">DrawPathCurveToSmoothAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetosmoothrelative\" id=\"id274\">DrawPathCurveToSmoothRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathellipticarcabsolute\" id=\"id275\">DrawPathEllipticArcAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathellipticarcrelative\" id=\"id276\">DrawPathEllipticArcRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathfinish\" id=\"id277\">DrawPathFinish</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetoabsolute\" id=\"id278\">DrawPathLineToAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetorelative\" id=\"id279\">DrawPathLineToRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetohorizontalabsolute\" id=\"id280\">DrawPathLineToHorizontalAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetohorizontalrelative\" id=\"id281\">DrawPathLineToHorizontalRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetoverticalabsolute\" id=\"id282\">DrawPathLineToVerticalAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetoverticalrelative\" id=\"id283\">DrawPathLineToVerticalRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathmovetoabsolute\" id=\"id284\">DrawPathMoveToAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathmovetorelative\" id=\"id285\">DrawPathMoveToRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathstart\" id=\"id286\">DrawPathStart</a></li>\n<li><a class=\"reference internal\" href=\"#drawpeekgraphiccontext\" id=\"id287\">DrawPeekGraphicContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawpoint\" id=\"id288\">DrawPoint</a></li>\n<li><a class=\"reference internal\" href=\"#drawpolygon\" id=\"id289\">DrawPolygon</a></li>\n<li><a class=\"reference internal\" href=\"#drawpolyline\" id=\"id290\">DrawPolyline</a></li>\n<li><a class=\"reference internal\" href=\"#drawpopclippath\" id=\"id291\">DrawPopClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawpopdefs\" id=\"id292\">DrawPopDefs</a></li>\n<li><a class=\"reference internal\" href=\"#drawpopgraphiccontext\" id=\"id293\">DrawPopGraphicContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawpoppattern\" id=\"id294\">DrawPopPattern</a></li>\n<li><a class=\"reference internal\" href=\"#drawpushclippath\" id=\"id295\">DrawPushClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawpushdefs\" id=\"id296\">DrawPushDefs</a></li>\n<li><a class=\"reference internal\" href=\"#drawpushgraphiccontext\" id=\"id297\">DrawPushGraphicContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawpushpattern\" id=\"id298\">DrawPushPattern</a></li>\n<li><a class=\"reference internal\" href=\"#drawrectangle\" id=\"id299\">DrawRectangle</a></li>\n<li><a class=\"reference internal\" href=\"#drawrender\" id=\"id300\">DrawRender</a></li>\n<li><a class=\"reference internal\" href=\"#drawrotate\" id=\"id301\">DrawRotate</a></li>\n<li><a class=\"reference internal\" href=\"#drawroundrectangle\" id=\"id302\">DrawRoundRectangle</a></li>\n<li><a class=\"reference internal\" href=\"#drawscale\" id=\"id303\">DrawScale</a></li>\n<li><a class=\"reference internal\" href=\"#drawskewx\" id=\"id304\">DrawSkewX</a></li>\n<li><a class=\"reference internal\" href=\"#drawskewy\" id=\"id305\">DrawSkewY</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstopcolor\" id=\"id306\">DrawSetStopColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokecolor\" id=\"id307\">DrawGetStrokeColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokecolor\" id=\"id308\">DrawSetStrokeColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokecolorstring\" id=\"id309\">DrawSetStrokeColorString</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokepatternurl\" id=\"id310\">DrawSetStrokePatternURL</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokeantialias\" id=\"id311\">DrawGetStrokeAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokeantialias\" id=\"id312\">DrawSetStrokeAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokedasharray\" id=\"id313\">DrawGetStrokeDashArray</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokedasharray\" id=\"id314\">DrawSetStrokeDashArray</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokedashoffset\" id=\"id315\">DrawGetStrokeDashOffset</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokedashoffset\" id=\"id316\">DrawSetStrokeDashOffset</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokelinecap\" id=\"id317\">DrawGetStrokeLineCap</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokelinecap\" id=\"id318\">DrawSetStrokeLineCap</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokelinejoin\" id=\"id319\">DrawGetStrokeLineJoin</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokelinejoin\" id=\"id320\">DrawSetStrokeLineJoin</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokemiterlimit\" id=\"id321\">DrawGetStrokeMiterLimit</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokemiterlimit\" id=\"id322\">DrawSetStrokeMiterLimit</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokeopacity\" id=\"id323\">DrawGetStrokeOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokeopacity\" id=\"id324\">DrawSetStrokeOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokewidth\" id=\"id325\">DrawGetStrokeWidth</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokewidth\" id=\"id326\">DrawSetStrokeWidth</a></li>\n<li><a class=\"reference internal\" href=\"#drawgettextantialias\" id=\"id327\">DrawGetTextAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawsettextantialias\" id=\"id328\">DrawSetTextAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawgettextdecoration\" id=\"id329\">DrawGetTextDecoration</a></li>\n<li><a class=\"reference internal\" href=\"#drawsettextdecoration\" id=\"id330\">DrawSetTextDecoration</a></li>\n<li><a class=\"reference internal\" href=\"#drawgettextencoding\" id=\"id331\">DrawGetTextEncoding</a></li>\n<li><a class=\"reference internal\" href=\"#drawsettextencoding\" id=\"id332\">DrawSetTextEncoding</a></li>\n<li><a class=\"reference internal\" href=\"#drawgettextundercolor\" id=\"id333\">DrawGetTextUnderColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsettextundercolor\" id=\"id334\">DrawSetTextUnderColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsettextundercolorstring\" id=\"id335\">DrawSetTextUnderColorString</a></li>\n<li><a class=\"reference internal\" href=\"#drawtranslate\" id=\"id336\">DrawTranslate</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetviewbox\" id=\"id337\">DrawSetViewbox</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"drawannotation\">\n<h1><a class=\"toc-backref\" href=\"#id225\">DrawAnnotation</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawAnnotation( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y,\n                     const unsigned char *text );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>DrawAnnotation() draws text on the image.</p>\n<p>The format of the DrawAnnotation method is:</p>\n<pre class=\"literal-block\">\nvoid DrawAnnotation( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y,\n                     const unsigned char *text );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>x ordinate to left of text</dd>\n<dt>y:</dt>\n<dd>y ordinate to text baseline</dd>\n<dt>text:</dt>\n<dd>text to draw</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawaffine\">\n<h1><a class=\"toc-backref\" href=\"#id226\">DrawAffine</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawAffine( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#affinematrix\">AffineMatrix</a> *affine );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>DrawAffine() adjusts the current affine transformation matrix with\nthe specified affine transformation matrix. Note that the current affine\ntransform is adjusted rather than replaced.</p>\n<p>The format of the DrawAffine method is:</p>\n<pre class=\"literal-block\">\nvoid DrawAffine( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#affinematrix\">AffineMatrix</a> *affine );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>Drawing context</dd>\n<dt>affine:</dt>\n<dd>Affine matrix parameters</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawallocatecontext\">\n<h1><a class=\"toc-backref\" href=\"#id227\">DrawAllocateContext</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> DrawAllocateContext( const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>DrawAllocateContext() allocates an initial drawing context which is an\nopaque handle required by the remaining drawing methods.</p>\n<p>The format of the DrawAllocateContext method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> DrawAllocateContext( const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<dl class=\"docutils\">\n<dt>draw_info:</dt>\n<dd>Initial drawing defaults. Set to NULL to use\nGraphicsMagick defaults.</dd>\n<dt>image:</dt>\n<dd>The image to draw on.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawarc\">\n<h1><a class=\"toc-backref\" href=\"#id228\">DrawArc</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawArc( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double sx, const double sy, const double ex,\n              const double ey, const double sd, const double ed );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>DrawArc() draws an arc falling within a specified bounding rectangle on the\nimage.</p>\n<p>The format of the DrawArc method is:</p>\n<pre class=\"literal-block\">\nvoid DrawArc( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double sx, const double sy, const double ex,\n              const double ey, const double sd, const double ed );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>sx:</dt>\n<dd>starting x ordinate of bounding rectangle</dd>\n<dt>sy:</dt>\n<dd>starting y ordinate of bounding rectangle</dd>\n<dt>ex:</dt>\n<dd>ending x ordinate of bounding rectangle</dd>\n<dt>ey:</dt>\n<dd>ending y ordinate of bounding rectangle</dd>\n<dt>sd:</dt>\n<dd>starting degrees of rotation</dd>\n<dt>ed:</dt>\n<dd>ending degrees of rotation</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawbezier\">\n<h1><a class=\"toc-backref\" href=\"#id229\">DrawBezier</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawBezier( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long num_coords,\n                 const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>DrawBezier() draws a bezier curve through a set of points on the image.</p>\n<p>The format of the DrawBezier method is:</p>\n<pre class=\"literal-block\">\nvoid DrawBezier( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long num_coords,\n                 const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>num_coords:</dt>\n<dd>number of coordinates</dd>\n<dt>coordinates:</dt>\n<dd>coordinates</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawcircle\">\n<h1><a class=\"toc-backref\" href=\"#id230\">DrawCircle</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawCircle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double ox, const double oy, const double px,\n                 const double py );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>DrawCircle() draws a circle on the image.</p>\n<p>The format of the DrawCircle method is:</p>\n<pre class=\"literal-block\">\nvoid DrawCircle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double ox, const double oy, const double px,\n                 const double py );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>ox:</dt>\n<dd>origin x ordinate</dd>\n<dt>oy:</dt>\n<dd>origin y ordinate</dd>\n<dt>px:</dt>\n<dd>perimeter x ordinate</dd>\n<dt>py:</dt>\n<dd>perimeter y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetclippath\">\n<h1><a class=\"toc-backref\" href=\"#id231\">DrawGetClipPath</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *DrawGetClipPath( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>DrawGetClipPath() obtains the current clipping path ID. The value returned\nmust be deallocated by the user when it is no longer needed.</p>\n<p>The format of the DrawGetClipPath method is:</p>\n<pre class=\"literal-block\">\nchar *DrawGetClipPath( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetclippath\">\n<h1><a class=\"toc-backref\" href=\"#id232\">DrawSetClipPath</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetClipPath( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *clip_path );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>DrawSetClipPath() associates a named clipping path with the image.  Only\nthe areas drawn on by the clipping path will be modified as long as it\nremains in effect.</p>\n<p>The format of the DrawSetClipPath method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetClipPath( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *clip_path );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>clip_path:</dt>\n<dd>name of clipping path to associate with image</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetcliprule\">\n<h1><a class=\"toc-backref\" href=\"#id233\">DrawGetClipRule</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> DrawGetClipRule( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>DrawGetClipRule() returns the current polygon fill rule to be used by the\nclipping path.</p>\n<p>The format of the DrawGetClipRule method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> DrawGetClipRule( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetcliprule\">\n<h1><a class=\"toc-backref\" href=\"#id234\">DrawSetClipRule</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetClipRule( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> fill_rule );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>DrawSetClipRule() set the polygon fill rule to be used by the clipping path.</p>\n<p>The format of the DrawSetClipRule method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetClipRule( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> fill_rule );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>fill_rule:</dt>\n<dd>fill rule (EvenOddRule or NonZeroRule)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetclipunits\">\n<h1><a class=\"toc-backref\" href=\"#id235\">DrawGetClipUnits</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#clippathunits\">ClipPathUnits</a> DrawGetClipUnits( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>DrawGetClipUnits() returns the interpretation of clip path units.</p>\n<p>The format of the DrawGetClipUnits method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#clippathunits\">ClipPathUnits</a> DrawGetClipUnits( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetclipunits\">\n<h1><a class=\"toc-backref\" href=\"#id236\">DrawSetClipUnits</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetClipUnits( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#clippathunits\">ClipPathUnits</a> clip_units );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>DrawSetClipUnits() sets the interpretation of clip path units.</p>\n<p>The format of the DrawSetClipUnits method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetClipUnits( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#clippathunits\">ClipPathUnits</a> clip_units );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>clip_units:</dt>\n<dd>units to use (UserSpace, UserSpaceOnUse, or ObjectBoundingBox)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawcolor\">\n<h1><a class=\"toc-backref\" href=\"#id237\">DrawColor</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y,\n                const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> paintMethod );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>DrawColor() draws color on image using the current fill color, starting at\nspecified position, and using specified paint method. The available paint\nmethods are:</p>\n<p>PointMethod: Recolors the target pixel\nReplaceMethod: Recolor any pixel that matches the target pixel.\nFloodfillMethod: Recolors target pixels and matching neighbors.\nFillToBorderMethod: Recolor target pixels and neighbors not matching border color.\nResetMethod: Recolor all pixels.</p>\n<p>The format of the DrawColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y,\n                const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> paintMethod );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>x ordinate</dd>\n<dt>y:</dt>\n<dd>y ordinate</dd>\n<dt>paintMethod:</dt>\n<dd>paint method</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawcomment\">\n<h1><a class=\"toc-backref\" href=\"#id238\">DrawComment</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawComment( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *comment );\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>DrawComment() adds a comment to a vector output stream.</p>\n<p>The format of the DrawComment method is:</p>\n<pre class=\"literal-block\">\nvoid DrawComment( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *comment );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>comment:</dt>\n<dd>comment text</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawdestroycontext\">\n<h1><a class=\"toc-backref\" href=\"#id239\">DrawDestroyContext</a></h1>\n<div class=\"section\" id=\"id27\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawDestroyContext( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id28\">\n<h2>Description</h2>\n<p>DrawDestroyContext() frees all resources associated with the drawing\ncontext. Once the drawing context has been freed, it should not be used\nany further unless it re-allocated.</p>\n<p>The format of the DrawDestroyContext method is:</p>\n<pre class=\"literal-block\">\nvoid DrawDestroyContext( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context to destroy</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawellipse\">\n<h1><a class=\"toc-backref\" href=\"#id240\">DrawEllipse</a></h1>\n<div class=\"section\" id=\"id29\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawEllipse( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double ox, const double oy, const double rx,\n                  const double ry, const double start, const double end );\n</pre>\n</div>\n<div class=\"section\" id=\"id30\">\n<h2>Description</h2>\n<p>DrawEllipse() draws an ellipse on the image.</p>\n<p>The format of the DrawEllipse method is:</p>\n<pre class=\"literal-block\">\nvoid DrawEllipse( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double ox, const double oy, const double rx,\n                  const double ry, const double start, const double end );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>ox:</dt>\n<dd>origin x ordinate</dd>\n<dt>oy:</dt>\n<dd>origin y ordinate</dd>\n<dt>rx:</dt>\n<dd>radius in x</dd>\n<dt>ry:</dt>\n<dd>radius in y</dd>\n<dt>start:</dt>\n<dd>starting rotation in degrees</dd>\n<dt>end:</dt>\n<dd>ending rotation in degrees</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfillcolor\">\n<h1><a class=\"toc-backref\" href=\"#id241\">DrawGetFillColor</a></h1>\n<div class=\"section\" id=\"id31\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> DrawGetFillColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id32\">\n<h2>Description</h2>\n<p>DrawGetFillColor() returns the fill color used for drawing filled objects.</p>\n<p>The format of the DrawGetFillColor method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> DrawGetFillColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfillcolor\">\n<h1><a class=\"toc-backref\" href=\"#id242\">DrawSetFillColor</a></h1>\n<div class=\"section\" id=\"id33\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFillColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *fill_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id34\">\n<h2>Description</h2>\n<p>DrawSetFillColor() sets the fill color to be used for drawing filled objects.</p>\n<p>The format of the DrawSetFillColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFillColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *fill_color );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>fill_color:</dt>\n<dd>fill color</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfillcolorstring\">\n<h1><a class=\"toc-backref\" href=\"#id243\">DrawSetFillColorString</a></h1>\n<div class=\"section\" id=\"id35\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFillColorString( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *fill_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id36\">\n<h2>Description</h2>\n<p>DrawSetFillColorString() sets the fill color to be used for drawing filled\nobjects.</p>\n<p>The format of the DrawSetFillColorString method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFillColorString( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *fill_color );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>fill_color:</dt>\n<dd>fill color</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfillpatternurl\">\n<h1><a class=\"toc-backref\" href=\"#id244\">DrawSetFillPatternURL</a></h1>\n<div class=\"section\" id=\"id37\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFillPatternURL( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *fill_url );\n</pre>\n</div>\n<div class=\"section\" id=\"id38\">\n<h2>Description</h2>\n<p>DrawSetFillPatternURL() sets the URL to use as a fill pattern for filling\nobjects. Only local URLs (&quot;#identifier&quot;) are supported at this time. These\nlocal URLs are normally created by defining a named fill pattern with\nDrawPushPattern/DrawPopPattern.</p>\n<p>The format of the DrawSetFillPatternURL method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFillPatternURL( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *fill_url );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>fill_url:</dt>\n<dd>URL to use to obtain fill pattern.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfillopacity\">\n<h1><a class=\"toc-backref\" href=\"#id245\">DrawGetFillOpacity</a></h1>\n<div class=\"section\" id=\"id39\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetFillOpacity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id40\">\n<h2>Description</h2>\n<p>DrawGetFillOpacity() returns the opacity used when drawing using the fill\ncolor or fill texture.  Fully opaque is 1.0.</p>\n<p>The format of the DrawGetFillOpacity method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetFillOpacity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfillopacity\">\n<h1><a class=\"toc-backref\" href=\"#id246\">DrawSetFillOpacity</a></h1>\n<div class=\"section\" id=\"id41\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFillOpacity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double fill_opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id42\">\n<h2>Description</h2>\n<p>DrawSetFillOpacity() sets the opacity to use when drawing using the fill\ncolor or fill texture.  Fully opaque is 1.0.</p>\n<p>The format of the DrawSetFillOpacity method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFillOpacity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double fill_opacity );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>fill_opacity:</dt>\n<dd>fill opacity</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfillrule\">\n<h1><a class=\"toc-backref\" href=\"#id247\">DrawGetFillRule</a></h1>\n<div class=\"section\" id=\"id43\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> DrawGetFillRule( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id44\">\n<h2>Description</h2>\n<p>DrawGetFillRule() returns the fill rule used while drawing polygons.</p>\n<p>The format of the DrawGetFillRule method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> DrawGetFillRule( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfillrule\">\n<h1><a class=\"toc-backref\" href=\"#id248\">DrawSetFillRule</a></h1>\n<div class=\"section\" id=\"id45\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFillRule( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> fill_rule );\n</pre>\n</div>\n<div class=\"section\" id=\"id46\">\n<h2>Description</h2>\n<p>DrawSetFillRule() sets the fill rule to use while drawing polygons.</p>\n<p>The format of the DrawSetFillRule method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFillRule( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> fill_rule );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>fill_rule:</dt>\n<dd>fill rule (EvenOddRule or NonZeroRule)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfont\">\n<h1><a class=\"toc-backref\" href=\"#id249\">DrawGetFont</a></h1>\n<div class=\"section\" id=\"id47\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *DrawGetFont( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id48\">\n<h2>Description</h2>\n<p>DrawGetFont() returns a null-terminaged string specifying the font used\nwhen annotating with text. The value returned must be freed by the user\nwhen no longer needed.</p>\n<p>The format of the DrawGetFont method is:</p>\n<pre class=\"literal-block\">\nchar *DrawGetFont( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfont\">\n<h1><a class=\"toc-backref\" href=\"#id250\">DrawSetFont</a></h1>\n<div class=\"section\" id=\"id49\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFont( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *font_name );\n</pre>\n</div>\n<div class=\"section\" id=\"id50\">\n<h2>Description</h2>\n<p>DrawSetFont() sets the fully-sepecified font to use when annotating with\ntext.</p>\n<p>The format of the DrawSetFont method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFont( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *font_name );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>font_name:</dt>\n<dd>font name</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontfamily\">\n<h1><a class=\"toc-backref\" href=\"#id251\">DrawGetFontFamily</a></h1>\n<div class=\"section\" id=\"id51\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *DrawGetFontFamily( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id52\">\n<h2>Description</h2>\n<p>DrawGetFontFamily() returns the font family to use when annotating with text.\nThe value returned must be freed by the user when it is no longer needed.</p>\n<p>The format of the DrawGetFontFamily method is:</p>\n<pre class=\"literal-block\">\nchar *DrawGetFontFamily( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontfamily\">\n<h1><a class=\"toc-backref\" href=\"#id252\">DrawSetFontFamily</a></h1>\n<div class=\"section\" id=\"id53\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontFamily( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *font_family );\n</pre>\n</div>\n<div class=\"section\" id=\"id54\">\n<h2>Description</h2>\n<p>DrawSetFontFamily() sets the font family to use when annotating with text.</p>\n<p>The format of the DrawSetFontFamily method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontFamily( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *font_family );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>font_family:</dt>\n<dd>font family</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontsize\">\n<h1><a class=\"toc-backref\" href=\"#id253\">DrawGetFontSize</a></h1>\n<div class=\"section\" id=\"id55\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetFontSize( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id56\">\n<h2>Description</h2>\n<p>DrawGetFontSize() returns the font pointsize used when annotating with text.</p>\n<p>The format of the DrawGetFontSize method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetFontSize( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontsize\">\n<h1><a class=\"toc-backref\" href=\"#id254\">DrawSetFontSize</a></h1>\n<div class=\"section\" id=\"id57\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontSize( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double pointsize );\n</pre>\n</div>\n<div class=\"section\" id=\"id58\">\n<h2>Description</h2>\n<p>DrawSetFontSize() sets the font pointsize to use when annotating with text.</p>\n<p>The format of the DrawSetFontSize method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontSize( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double pointsize );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>pointsize:</dt>\n<dd>text pointsize</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontstretch\">\n<h1><a class=\"toc-backref\" href=\"#id255\">DrawGetFontStretch</a></h1>\n<div class=\"section\" id=\"id59\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#stretchtype\">StretchType</a> DrawGetFontStretch( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id60\">\n<h2>Description</h2>\n<p>DrawGetFontStretch() returns the font stretch used when annotating with text.</p>\n<p>The format of the DrawGetFontStretch method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#stretchtype\">StretchType</a> DrawGetFontStretch( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontstretch\">\n<h1><a class=\"toc-backref\" href=\"#id256\">DrawSetFontStretch</a></h1>\n<div class=\"section\" id=\"id61\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontStretch( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#stretchtype\">StretchType</a> font_stretch );\n</pre>\n</div>\n<div class=\"section\" id=\"id62\">\n<h2>Description</h2>\n<p>DrawSetFontStretch() sets the font stretch to use when annotating with text.\nThe AnyStretch enumeration acts as a wild-card &quot;don't care&quot; option.</p>\n<p>The format of the DrawSetFontStretch method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontStretch( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#stretchtype\">StretchType</a> font_stretch );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>font_stretch:</dt>\n<dd>font stretch (NormalStretch, UltraCondensedStretch,\nCondensedStretch, SemiCondensedStretch,\nSemiExpandedStretch, ExpandedStretch,\nExtraExpandedStretch, UltraExpandedStretch, AnyStretch)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontstyle\">\n<h1><a class=\"toc-backref\" href=\"#id257\">DrawGetFontStyle</a></h1>\n<div class=\"section\" id=\"id63\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#styletype\">StyleType</a> DrawGetFontStyle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id64\">\n<h2>Description</h2>\n<p>DrawGetFontStyle() returns the font style used when annotating with text.</p>\n<p>The format of the DrawGetFontStyle method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#styletype\">StyleType</a> DrawGetFontStyle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontstyle\">\n<h1><a class=\"toc-backref\" href=\"#id258\">DrawSetFontStyle</a></h1>\n<div class=\"section\" id=\"id65\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontStyle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#styletype\">StyleType</a> style );\n</pre>\n</div>\n<div class=\"section\" id=\"id66\">\n<h2>Description</h2>\n<p>DrawSetFontStyle() sets the font style to use when annotating with text.\nThe AnyStyle enumeration acts as a wild-card &quot;don't care&quot; option.</p>\n<p>The format of the DrawSetFontStyle method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontStyle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#styletype\">StyleType</a> style );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>style:</dt>\n<dd>font style (NormalStyle, ItalicStyle, ObliqueStyle, AnyStyle)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontweight\">\n<h1><a class=\"toc-backref\" href=\"#id259\">DrawGetFontWeight</a></h1>\n<div class=\"section\" id=\"id67\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long DrawGetFontWeight( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id68\">\n<h2>Description</h2>\n<p>DrawGetFontWeight() returns the font weight used when annotating with text.</p>\n<p>The format of the DrawGetFontWeight method is:</p>\n<pre class=\"literal-block\">\nunsigned long DrawGetFontWeight( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontweight\">\n<h1><a class=\"toc-backref\" href=\"#id260\">DrawSetFontWeight</a></h1>\n<div class=\"section\" id=\"id69\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontWeight( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long font_weight );\n</pre>\n</div>\n<div class=\"section\" id=\"id70\">\n<h2>Description</h2>\n<p>DrawSetFontWeight() sets the font weight to use when annotating with text.</p>\n<p>The format of the DrawSetFontWeight method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontWeight( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long font_weight );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>font_weight:</dt>\n<dd>font weight (valid range 100-900)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetgravity\">\n<h1><a class=\"toc-backref\" href=\"#id261\">DrawGetGravity</a></h1>\n<div class=\"section\" id=\"id71\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> DrawGetGravity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id72\">\n<h2>Description</h2>\n<p>DrawGetGravity() returns the text placement gravity used when annotating\nwith text.</p>\n<p>The format of the DrawGetGravity method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> DrawGetGravity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetgravity\">\n<h1><a class=\"toc-backref\" href=\"#id262\">DrawSetGravity</a></h1>\n<div class=\"section\" id=\"id73\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetGravity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> gravity );\n</pre>\n</div>\n<div class=\"section\" id=\"id74\">\n<h2>Description</h2>\n<p>DrawSetGravity() sets the text placement gravity to use when annotating\nwith text.</p>\n<p>The format of the DrawSetGravity method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetGravity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> gravity );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>gravity:</dt>\n<dd>positioning gravity (NorthWestGravity, NorthGravity,\nNorthEastGravity, WestGravity, CenterGravity,\nEastGravity, SouthWestGravity, SouthGravity,\nSouthEastGravity)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawcomposite\">\n<h1><a class=\"toc-backref\" href=\"#id263\">DrawComposite</a></h1>\n<div class=\"section\" id=\"id75\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawComposite( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> composite_operator,\n                    const double x, const double y, const double width, const double height,\n                    const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id76\">\n<h2>Description</h2>\n<p>DrawComposite() composites an image onto the current image, using the\nspecified composition operator, specified position, and at the specified\nsize.</p>\n<p>The format of the DrawComposite method is:</p>\n<pre class=\"literal-block\">\nvoid DrawComposite( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> composite_operator,\n                    const double x, const double y, const double width, const double height,\n                    const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>composite_operator:</dt>\n<dd>composition operator</dd>\n<dt>x:</dt>\n<dd>x ordinate of top left corner</dd>\n<dt>y:</dt>\n<dd>y ordinate of top left corner</dd>\n<dt>width:</dt>\n<dd>Width to resize image to prior to compositing.  Specify zero to\nuse existing width.</dd>\n<dt>height:</dt>\n<dd>Height to resize image to prior to compositing.  Specify zero\nto use existing height.</dd>\n<dt>image:</dt>\n<dd>Image to composite</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawline\">\n<h1><a class=\"toc-backref\" href=\"#id264\">DrawLine</a></h1>\n<div class=\"section\" id=\"id77\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawLine( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double sx, const double sy, const double ex,\n               const double ey );\n</pre>\n</div>\n<div class=\"section\" id=\"id78\">\n<h2>Description</h2>\n<p>DrawLine() draws a line on the image using the current stroke color,\nstroke opacity, and stroke width.</p>\n<p>The format of the DrawLine method is:</p>\n<pre class=\"literal-block\">\nvoid DrawLine( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double sx, const double sy, const double ex,\n               const double ey );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>sx:</dt>\n<dd>starting x ordinate</dd>\n<dt>sy:</dt>\n<dd>starting y ordinate</dd>\n<dt>ex:</dt>\n<dd>ending x ordinate</dd>\n<dt>ey:</dt>\n<dd>ending y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawmatte\">\n<h1><a class=\"toc-backref\" href=\"#id265\">DrawMatte</a></h1>\n<div class=\"section\" id=\"id79\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawMatte( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y,\n                const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> paint_method );\n</pre>\n</div>\n<div class=\"section\" id=\"id80\">\n<h2>Description</h2>\n<p>DrawMatte() paints on the image's opacity channel in order to set effected\npixels to transparent.  The available paint methods are:</p>\n<p>PointMethod: Select the target pixel\nReplaceMethod: Select any pixel that matches the target pixel.\nFloodfillMethod: Select the target pixel and matching neighbors.\nFillToBorderMethod: Select the target pixel and neighbors not matching\nborder color.\nResetMethod: Select all pixels.</p>\n<p>The format of the DrawMatte method is:</p>\n<pre class=\"literal-block\">\nvoid DrawMatte( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y,\n                const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> paint_method );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>x ordinate</dd>\n<dt>y:</dt>\n<dd>y ordinate</dd>\n</dl>\n<p>o paint_method:</p>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathclose\">\n<h1><a class=\"toc-backref\" href=\"#id266\">DrawPathClose</a></h1>\n<div class=\"section\" id=\"id81\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathClose( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id82\">\n<h2>Description</h2>\n<p>DrawPathClose() adds a path element to the current path which closes the\ncurrent subpath by drawing a straight line from the current point to the\ncurrent subpath's most recent starting point (usually, the most recent\nmoveto point).</p>\n<p>The format of the DrawPathClose method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathClose( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id267\">DrawPathCurveToAbsolute</a></h1>\n<div class=\"section\" id=\"id83\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1, const double y1,\n                              const double x2, const double y2, const double x,\n                              const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id84\">\n<h2>Description</h2>\n<p>DrawPathCurveToAbsolute() draws a cubic Bezier curve from the current\npoint to (x,y) using (x1,y1) as the control point at the beginning of\nthe curve and (x2,y2) as the control point at the end of the curve using\nabsolute coordinates. At the end of the command, the new current point\nbecomes the final (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1, const double y1,\n                              const double x2, const double y2, const double x,\n                              const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x1:</dt>\n<dd>x ordinate of control point for curve beginning</dd>\n<dt>y1:</dt>\n<dd>y ordinate of control point for curve beginning</dd>\n<dt>x2:</dt>\n<dd>x ordinate of control point for curve ending</dd>\n<dt>y2:</dt>\n<dd>y ordinate of control point for curve ending</dd>\n<dt>x:</dt>\n<dd>x ordinate of the end of the curve</dd>\n<dt>y:</dt>\n<dd>y ordinate of the end of the curve</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetorelative\">\n<h1><a class=\"toc-backref\" href=\"#id268\">DrawPathCurveToRelative</a></h1>\n<div class=\"section\" id=\"id85\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1, const double y1,\n                              const double x2, const double y2, const double x,\n                              const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id86\">\n<h2>Description</h2>\n<p>DrawPathCurveToRelative() draws a cubic Bezier curve from the current\npoint to (x,y) using (x1,y1) as the control point at the beginning of\nthe curve and (x2,y2) as the control point at the end of the curve using\nrelative coordinates. At the end of the command, the new current point\nbecomes the final (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1, const double y1,\n                              const double x2, const double y2, const double x,\n                              const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x1:</dt>\n<dd>x ordinate of control point for curve beginning</dd>\n<dt>y1:</dt>\n<dd>y ordinate of control point for curve beginning</dd>\n<dt>x2:</dt>\n<dd>x ordinate of control point for curve ending</dd>\n<dt>y2:</dt>\n<dd>y ordinate of control point for curve ending</dd>\n<dt>x:</dt>\n<dd>x ordinate of the end of the curve</dd>\n<dt>y:</dt>\n<dd>y ordinate of the end of the curve</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoquadraticbezierabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id269\">DrawPathCurveToQuadraticBezierAbsolute</a></h1>\n<div class=\"section\" id=\"id87\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1,\n                                             const double y1, const double x,\n                                             const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id88\">\n<h2>Description</h2>\n<p>DrawPathCurveToQuadraticBezierAbsolute() draws a quadratic Bezier curve\nfrom the current point to (x,y) using (x1,y1) as the control point using\nabsolute coordinates. At the end of the command, the new current point\nbecomes the final (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToQuadraticBezierAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1,\n                                             const double y1, const double x,\n                                             const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x1:</dt>\n<dd>x ordinate of the control point</dd>\n<dt>y1:</dt>\n<dd>y ordinate of the control point</dd>\n<dt>x:</dt>\n<dd>x ordinate of final point</dd>\n<dt>y:</dt>\n<dd>y ordinate of final point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoquadraticbezierrelative\">\n<h1><a class=\"toc-backref\" href=\"#id270\">DrawPathCurveToQuadraticBezierRelative</a></h1>\n<div class=\"section\" id=\"id89\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1,\n                                             const double y1, const double x,\n                                             const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id90\">\n<h2>Description</h2>\n<p>DrawPathCurveToQuadraticBezierRelative() draws a quadratic Bezier curve\nfrom the current point to (x,y) using (x1,y1) as the control point using\nrelative coordinates. At the end of the command, the new current point\nbecomes the final (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToQuadraticBezierRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1,\n                                             const double y1, const double x,\n                                             const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x1:</dt>\n<dd>x ordinate of the control point</dd>\n<dt>y1:</dt>\n<dd>y ordinate of the control point</dd>\n<dt>x:</dt>\n<dd>x ordinate of final point</dd>\n<dt>y:</dt>\n<dd>y ordinate of final point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoquadraticbeziersmoothabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id271\">DrawPathCurveToQuadraticBezierSmoothAbsolute</a></h1>\n<div class=\"section\" id=\"id91\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierSmoothAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x,\n                                                   const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id92\">\n<h2>Description</h2>\n<p>DrawPathCurveToQuadraticBezierSmoothAbsolute() draws a quadratic\nBezier curve (using absolute coordinates) from the current point to\n(x,y). The control point is assumed to be the reflection of the\ncontrol point on the previous command relative to the current\npoint. (If there is no previous command or if the previous command was\nnot a DrawPathCurveToQuadraticBezierAbsolute,\nDrawPathCurveToQuadraticBezierRelative,\nDrawPathCurveToQuadraticBezierSmoothAbsolut or\nDrawPathCurveToQuadraticBezierSmoothRelative, assume the control point\nis coincident with the current point.). At the end of the command, the\nnew current point becomes the final (x,y) coordinate pair used in the\npolybezier.</p>\n<p>The format of the DrawPathCurveToQuadraticBezierSmoothAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierSmoothAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x,\n                                                   const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>x ordinate of final point</dd>\n<dt>y:</dt>\n<dd>y ordinate of final point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoquadraticbeziersmoothrelative\">\n<h1><a class=\"toc-backref\" href=\"#id272\">DrawPathCurveToQuadraticBezierSmoothRelative</a></h1>\n<div class=\"section\" id=\"id93\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierSmoothRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x,\n                                                   const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id94\">\n<h2>Description</h2>\n<p>DrawPathCurveToQuadraticBezierSmoothAbsolute() draws a quadratic\nBezier curve (using relative coordinates) from the current point to\n(x,y). The control point is assumed to be the reflection of the\ncontrol point on the previous command relative to the current\npoint. (If there is no previous command or if the previous command was\nnot a DrawPathCurveToQuadraticBezierAbsolute,\nDrawPathCurveToQuadraticBezierRelative,\nDrawPathCurveToQuadraticBezierSmoothAbsolut or\nDrawPathCurveToQuadraticBezierSmoothRelative, assume the control point\nis coincident with the current point.). At the end of the command, the\nnew current point becomes the final (x,y) coordinate pair used in the\npolybezier.</p>\n<p>The format of the DrawPathCurveToQuadraticBezierSmoothRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierSmoothRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x,\n                                                   const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>x ordinate of final point</dd>\n<dt>y:</dt>\n<dd>y ordinate of final point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetosmoothabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id273\">DrawPathCurveToSmoothAbsolute</a></h1>\n<div class=\"section\" id=\"id95\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToSmoothAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x2, const double y2,\n                                    const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id96\">\n<h2>Description</h2>\n<p>DrawPathCurveToSmoothAbsolute() draws a cubic Bezier curve from the\ncurrent point to (x,y) using absolute coordinates. The first control\npoint is assumed to be the reflection of the second control point on\nthe previous command relative to the current point. (If there is no\nprevious command or if the previous command was not an\nDrawPathCurveToAbsolute, DrawPathCurveToRelative,\nDrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume\nthe first control point is coincident with the current point.) (x2,y2)\nis the second control point (i.e., the control point at the end of the\ncurve). At the end of the command, the new current point becomes the\nfinal (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToSmoothAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToSmoothAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x2, const double y2,\n                                    const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x2:</dt>\n<dd>x ordinate of second control point</dd>\n<dt>y2:</dt>\n<dd>y ordinate of second control point</dd>\n<dt>x:</dt>\n<dd>x ordinate of termination point</dd>\n<dt>y:</dt>\n<dd>y ordinate of termination point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetosmoothrelative\">\n<h1><a class=\"toc-backref\" href=\"#id274\">DrawPathCurveToSmoothRelative</a></h1>\n<div class=\"section\" id=\"id97\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToSmoothRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x2, const double y2,\n                                    const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id98\">\n<h2>Description</h2>\n<p>DrawPathCurveToSmoothRelative() draws a cubic Bezier curve from the\ncurrent point to (x,y) using relative coordinates. The first control\npoint is assumed to be the reflection of the second control point on\nthe previous command relative to the current point. (If there is no\nprevious command or if the previous command was not an\nDrawPathCurveToAbsolute, DrawPathCurveToRelative,\nDrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume\nthe first control point is coincident with the current point.) (x2,y2)\nis the second control point (i.e., the control point at the end of the\ncurve). At the end of the command, the new current point becomes the\nfinal (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToSmoothRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToSmoothRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x2, const double y2,\n                                    const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x2:</dt>\n<dd>x ordinate of second control point</dd>\n<dt>y2:</dt>\n<dd>y ordinate of second control point</dd>\n<dt>x:</dt>\n<dd>x ordinate of termination point</dd>\n<dt>y:</dt>\n<dd>y ordinate of termination point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathellipticarcabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id275\">DrawPathEllipticArcAbsolute</a></h1>\n<div class=\"section\" id=\"id99\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathEllipticArcAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double rx, const double ry,\n                                  const double x_axis_rotation,\n                                  unsigned int large_arc_flag, unsigned int sweep_flag,\n                                  const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id100\">\n<h2>Description</h2>\n<p>DrawPathEllipticArcAbsolute() draws an elliptical arc from the current\npoint to (x, y) using absolute coordinates. The size and orientation\nof the ellipse are defined by two radii (rx, ry) and an\nxAxisRotation, which indicates how the ellipse as a whole is rotated\nrelative to the current coordinate system. The center (cx, cy) of the\nellipse is calculated automatically to satisfy the constraints imposed\nby the other parameters. largeArcFlag and sweepFlag contribute to the\nautomatic calculations and help determine how the arc is drawn. If\nlargeArcFlag is true then draw the larger of the available arcs. If\nsweepFlag is true, then draw the arc matching a clock-wise rotation.</p>\n<p>The format of the DrawPathEllipticArcAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathEllipticArcAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double rx, const double ry,\n                                  const double x_axis_rotation,\n                                  unsigned int large_arc_flag, unsigned int sweep_flag,\n                                  const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>rx:</dt>\n<dd>x radius</dd>\n<dt>ry:</dt>\n<dd>y radius</dd>\n<dt>x_axis_rotation:</dt>\n<dd>indicates how the ellipse as a whole is rotated\nrelative to the current coordinate system</dd>\n<dt>large_arc_flag:</dt>\n<dd>If non-zero (true) then draw the larger of the\navailable arcs</dd>\n<dt>sweep_flag:</dt>\n<dd>If non-zero (true) then draw the arc matching a\nclock-wise rotation</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathellipticarcrelative\">\n<h1><a class=\"toc-backref\" href=\"#id276\">DrawPathEllipticArcRelative</a></h1>\n<div class=\"section\" id=\"id101\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathEllipticArcRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double rx, const double ry,\n                                  const double x_axis_rotation,\n                                  unsigned int large_arc_flag, unsigned int sweep_flag,\n                                  const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id102\">\n<h2>Description</h2>\n<p>DrawPathEllipticArcRelative() draws an elliptical arc from the current\npoint to (x, y) using relative coordinates. The size and orientation\nof the ellipse are defined by two radii (rx, ry) and an\nxAxisRotation, which indicates how the ellipse as a whole is rotated\nrelative to the current coordinate system. The center (cx, cy) of the\nellipse is calculated automatically to satisfy the constraints imposed\nby the other parameters. largeArcFlag and sweepFlag contribute to the\nautomatic calculations and help determine how the arc is drawn. If\nlargeArcFlag is true then draw the larger of the available arcs. If\nsweepFlag is true, then draw the arc matching a clock-wise rotation.</p>\n<p>The format of the DrawPathEllipticArcRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathEllipticArcRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double rx, const double ry,\n                                  const double x_axis_rotation,\n                                  unsigned int large_arc_flag, unsigned int sweep_flag,\n                                  const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>rx:</dt>\n<dd>x radius</dd>\n<dt>ry:</dt>\n<dd>y radius</dd>\n<dt>x_axis_rotation:</dt>\n<dd>indicates how the ellipse as a whole is rotated\nrelative to the current coordinate system</dd>\n<dt>large_arc_flag:</dt>\n<dd>If non-zero (true) then draw the larger of the\navailable arcs</dd>\n<dt>sweep_flag:</dt>\n<dd>If non-zero (true) then draw the arc matching a\nclock-wise rotation</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathfinish\">\n<h1><a class=\"toc-backref\" href=\"#id277\">DrawPathFinish</a></h1>\n<div class=\"section\" id=\"id103\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathFinish( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id104\">\n<h2>Description</h2>\n<p>DrawPathFinish() terminates the current path.</p>\n<p>The format of the DrawPathFinish method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathFinish( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetoabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id278\">DrawPathLineToAbsolute</a></h1>\n<div class=\"section\" id=\"id105\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id106\">\n<h2>Description</h2>\n<p>DrawPathLineToAbsolute() draws a line path from the current point to the\ngiven coordinate using absolute coordinates. The coordinate then becomes\nthe new current point.</p>\n<p>The format of the DrawPathLineToAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetorelative\">\n<h1><a class=\"toc-backref\" href=\"#id279\">DrawPathLineToRelative</a></h1>\n<div class=\"section\" id=\"id107\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id108\">\n<h2>Description</h2>\n<p>DrawPathLineToRelative() draws a line path from the current point to the\ngiven coordinate using relative coordinates. The coordinate then becomes\nthe new current point.</p>\n<p>The format of the DrawPathLineToRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetohorizontalabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id280\">DrawPathLineToHorizontalAbsolute</a></h1>\n<div class=\"section\" id=\"id109\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToHorizontalAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x );\n</pre>\n</div>\n<div class=\"section\" id=\"id110\">\n<h2>Description</h2>\n<p>DrawPathLineToHorizontalAbsolute() draws a horizontal line path from the\ncurrent point to the target point using absolute coordinates.  The target\npoint then becomes the new current point.</p>\n<p>The format of the DrawPathLineToHorizontalAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToHorizontalAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetohorizontalrelative\">\n<h1><a class=\"toc-backref\" href=\"#id281\">DrawPathLineToHorizontalRelative</a></h1>\n<div class=\"section\" id=\"id111\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToHorizontalRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x );\n</pre>\n</div>\n<div class=\"section\" id=\"id112\">\n<h2>Description</h2>\n<p>DrawPathLineToHorizontalRelative() draws a horizontal line path from the\ncurrent point to the target point using relative coordinates.  The target\npoint then becomes the new current point.</p>\n<p>The format of the DrawPathLineToHorizontalRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToHorizontalRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetoverticalabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id282\">DrawPathLineToVerticalAbsolute</a></h1>\n<div class=\"section\" id=\"id113\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToVerticalAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id114\">\n<h2>Description</h2>\n<p>DrawPathLineToVerticalAbsolute() draws a vertical line path from the\ncurrent point to the target point using absolute coordinates.  The target\npoint then becomes the new current point.</p>\n<p>The format of the DrawPathLineToVerticalAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToVerticalAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetoverticalrelative\">\n<h1><a class=\"toc-backref\" href=\"#id283\">DrawPathLineToVerticalRelative</a></h1>\n<div class=\"section\" id=\"id115\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToVerticalRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id116\">\n<h2>Description</h2>\n<p>DrawPathLineToVerticalRelative() draws a vertical line path from the\ncurrent point to the target point using relative coordinates.  The target\npoint then becomes the new current point.</p>\n<p>The format of the DrawPathLineToVerticalRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToVerticalRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathmovetoabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id284\">DrawPathMoveToAbsolute</a></h1>\n<div class=\"section\" id=\"id117\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathMoveToAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id118\">\n<h2>Description</h2>\n<p>DrawPathMoveToAbsolute() starts a new sub-path at the given coordinate\nusing absolute coordinates. The current point then becomes the\nspecified coordinate.</p>\n<p>The format of the DrawPathMoveToAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathMoveToAbsolute( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathmovetorelative\">\n<h1><a class=\"toc-backref\" href=\"#id285\">DrawPathMoveToRelative</a></h1>\n<div class=\"section\" id=\"id119\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathMoveToRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id120\">\n<h2>Description</h2>\n<p>DrawPathMoveToRelative() starts a new sub-path at the given coordinate\nusing relative coordinates. The current point then becomes the\nspecified coordinate.</p>\n<p>The format of the DrawPathMoveToRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathMoveToRelative( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathstart\">\n<h1><a class=\"toc-backref\" href=\"#id286\">DrawPathStart</a></h1>\n<div class=\"section\" id=\"id121\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathStart( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id122\">\n<h2>Description</h2>\n<p>DrawPathStart() declares the start of a path drawing list which is terminated\nby a matching DrawPathFinish() command. All other DrawPath commands must\nbe enclosed between a DrawPathStart() and a DrawPathFinish() command. This\nis because path drawing commands are subordinate commands and they do not\nfunction by themselves.</p>\n<p>The format of the DrawPathStart method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathStart( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpeekgraphiccontext\">\n<h1><a class=\"toc-backref\" href=\"#id287\">DrawPeekGraphicContext</a></h1>\n<div class=\"section\" id=\"id123\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *DrawPeekGraphicContext( const <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id124\">\n<h2>Description</h2>\n<p>DrawPeekGraphicContext() returns a copy of the the DrawInfo structure at\nthe head of the drawing context stack. The user is responsible for\ndeallocating the returned object using DestroyDrawInfo.</p>\n<p>The format of the DrawPeekGraphicContext method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *DrawPeekGraphicContext( const <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpoint\">\n<h1><a class=\"toc-backref\" href=\"#id288\">DrawPoint</a></h1>\n<div class=\"section\" id=\"id125\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPoint( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id126\">\n<h2>Description</h2>\n<p>DrawPoint() draws a point using the current stroke color and stroke\nthickness at the specified coordinates.</p>\n<p>The format of the DrawPoint method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPoint( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>target x coordinate</dd>\n<dt>y:</dt>\n<dd>target y coordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpolygon\">\n<h1><a class=\"toc-backref\" href=\"#id289\">DrawPolygon</a></h1>\n<div class=\"section\" id=\"id127\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPolygon( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long num_coords,\n                  const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n</div>\n<div class=\"section\" id=\"id128\">\n<h2>Description</h2>\n<p>DrawPolygon() draws a polygon using the current stroke, stroke width, and\nfill color or texture, using the specified array of coordinates.</p>\n<p>The format of the DrawPolygon method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPolygon( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long num_coords,\n                  const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>num_coords:</dt>\n<dd>number of coordinates</dd>\n<dt>coordinates:</dt>\n<dd>coordinate array</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpolyline\">\n<h1><a class=\"toc-backref\" href=\"#id290\">DrawPolyline</a></h1>\n<div class=\"section\" id=\"id129\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPolyline( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long num_coords,\n                   const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n</div>\n<div class=\"section\" id=\"id130\">\n<h2>Description</h2>\n<p>DrawPolyline() draws a polyline using the current stroke, stroke width, and\nfill color or texture, using the specified array of coordinates.</p>\n<p>The format of the DrawPolyline method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPolyline( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long num_coords,\n                   const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>num_coords:</dt>\n<dd>number of coordinates</dd>\n<dt>coordinates:</dt>\n<dd>coordinate array</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpopclippath\">\n<h1><a class=\"toc-backref\" href=\"#id291\">DrawPopClipPath</a></h1>\n<div class=\"section\" id=\"id131\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPopClipPath( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id132\">\n<h2>Description</h2>\n<p>DrawPopClipPath() terminates a clip path definition.</p>\n<p>The format of the DrawPopClipPath method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPopClipPath( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpopdefs\">\n<h1><a class=\"toc-backref\" href=\"#id292\">DrawPopDefs</a></h1>\n<div class=\"section\" id=\"id133\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPopDefs( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id134\">\n<h2>Description</h2>\n<p>DrawPopDefs() terminates a definition list</p>\n<p>The format of the DrawPopDefs method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPopDefs( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpopgraphiccontext\">\n<h1><a class=\"toc-backref\" href=\"#id293\">DrawPopGraphicContext</a></h1>\n<div class=\"section\" id=\"id135\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPopGraphicContext( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id136\">\n<h2>Description</h2>\n<p>DrawPopGraphicContext() destroys the current context returning to the\npreviously pushed context. Multiple contexts may exist. It is an error\nto attempt to pop more contexts than have been pushed, and it is proper\nform to pop all contexts which have been pushed.</p>\n<p>The format of the DrawPopGraphicContext method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPopGraphicContext( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpoppattern\">\n<h1><a class=\"toc-backref\" href=\"#id294\">DrawPopPattern</a></h1>\n<div class=\"section\" id=\"id137\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPopPattern( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id138\">\n<h2>Description</h2>\n<p>DrawPopPattern() terminates a pattern definition.</p>\n<p>The format of the DrawPopPattern method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPopPattern( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpushclippath\">\n<h1><a class=\"toc-backref\" href=\"#id295\">DrawPushClipPath</a></h1>\n<div class=\"section\" id=\"id139\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPushClipPath( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *clip_path_id );\n</pre>\n</div>\n<div class=\"section\" id=\"id140\">\n<h2>Description</h2>\n<p>DrawPushClipPath() starts a clip path definition which is comprized of\nany number of drawing commands and terminated by a DrawPopClipPath()\ncommand.</p>\n<p>The format of the DrawPushClipPath method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPushClipPath( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *clip_path_id );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>clip_path_id:</dt>\n<dd>string identifier to associate with the clip path for\nlater use.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpushdefs\">\n<h1><a class=\"toc-backref\" href=\"#id296\">DrawPushDefs</a></h1>\n<div class=\"section\" id=\"id141\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPushDefs( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id142\">\n<h2>Description</h2>\n<p>DrawPushDefs() indicates that commands up to a terminating DrawPopDefs()\ncommand create named elements (e.g. clip-paths, textures, etc.) which\nmay safely be processed earlier for the sake of efficiency.</p>\n<p>The format of the DrawPushDefs method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPushDefs( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpushgraphiccontext\">\n<h1><a class=\"toc-backref\" href=\"#id297\">DrawPushGraphicContext</a></h1>\n<div class=\"section\" id=\"id143\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPushGraphicContext( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id144\">\n<h2>Description</h2>\n<p>DrawPushGraphicContext() clones the current drawing context to create a\nnew drawing context. The original drawing context(s) may be returned to\nby invoking DrawPopGraphicContext().  The contexts are stored on a context\nstack.  For every Pop there must have already been an equivalent Push.</p>\n<p>The format of the DrawPushGraphicContext method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPushGraphicContext( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpushpattern\">\n<h1><a class=\"toc-backref\" href=\"#id298\">DrawPushPattern</a></h1>\n<div class=\"section\" id=\"id145\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPushPattern( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *pattern_id, const double x,\n                      const double y, const double width, const double height );\n</pre>\n</div>\n<div class=\"section\" id=\"id146\">\n<h2>Description</h2>\n<p>DrawPushPattern() indicates that subsequent commands up to a\nDrawPopPattern() command comprise the definition of a named pattern.\nThe pattern space is assigned top left corner coordinates, a width\nand height, and becomes its own drawing space.  Anything which can\nbe drawn may be used in a pattern definition.\nNamed patterns may be used as stroke or brush definitions.</p>\n<p>The format of the DrawPushPattern method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPushPattern( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *pattern_id, const double x,\n                      const double y, const double width, const double height );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>pattern_id:</dt>\n<dd>pattern identification for later reference</dd>\n<dt>x:</dt>\n<dd>x ordinate of top left corner</dd>\n<dt>y:</dt>\n<dd>y ordinate of top left corner</dd>\n<dt>width:</dt>\n<dd>width of pattern space</dd>\n<dt>height:</dt>\n<dd>height of pattern space</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawrectangle\">\n<h1><a class=\"toc-backref\" href=\"#id299\">DrawRectangle</a></h1>\n<div class=\"section\" id=\"id147\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawRectangle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1, const double y1, const double x2,\n                    const double y2 );\n</pre>\n</div>\n<div class=\"section\" id=\"id148\">\n<h2>Description</h2>\n<p>DrawRectangle() draws a rectangle given two coordinates and using\nthe current stroke, stroke width, and fill settings.</p>\n<p>The format of the DrawRectangle method is:</p>\n<pre class=\"literal-block\">\nvoid DrawRectangle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x1, const double y1, const double x2,\n                    const double y2 );\n</pre>\n<dl class=\"docutils\">\n<dt>x1:</dt>\n<dd>x ordinate of first coordinate</dd>\n<dt>y1:</dt>\n<dd>y ordinate of first coordinate</dd>\n<dt>x2:</dt>\n<dd>x ordinate of second coordinate</dd>\n<dt>y2:</dt>\n<dd>y ordinate of second coordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawrender\">\n<h1><a class=\"toc-backref\" href=\"#id300\">DrawRender</a></h1>\n<div class=\"section\" id=\"id149\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nint DrawRender( const <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id150\">\n<h2>Description</h2>\n<p>DrawRender() renders all preceding drawing commands onto the image.</p>\n<p>The format of the DrawRender method is:</p>\n<pre class=\"literal-block\">\nint DrawRender( const <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawrotate\">\n<h1><a class=\"toc-backref\" href=\"#id301\">DrawRotate</a></h1>\n<div class=\"section\" id=\"id151\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawRotate( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double degrees );\n</pre>\n</div>\n<div class=\"section\" id=\"id152\">\n<h2>Description</h2>\n<p>DrawRotate() applies the specified rotation to the current coordinate\nspace.</p>\n<p>The format of the DrawRotate method is:</p>\n<pre class=\"literal-block\">\nvoid DrawRotate( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double degrees );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>degrees:</dt>\n<dd>degrees of rotation</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawroundrectangle\">\n<h1><a class=\"toc-backref\" href=\"#id302\">DrawRoundRectangle</a></h1>\n<div class=\"section\" id=\"id153\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawRoundRectangle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, double x1, double y1, double x2, double y2,\n                         double rx, double ry );\n</pre>\n</div>\n<div class=\"section\" id=\"id154\">\n<h2>Description</h2>\n<p>DrawRoundRectangle() draws a rounted rectangle given two coordinates,\nx &amp; y corner radiuses and using the current stroke, stroke width,\nand fill settings.</p>\n<p>The format of the DrawRoundRectangle method is:</p>\n<pre class=\"literal-block\">\nvoid DrawRoundRectangle( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, double x1, double y1, double x2, double y2,\n                         double rx, double ry );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x1:</dt>\n<dd>x ordinate of first coordinate</dd>\n<dt>y1:</dt>\n<dd>y ordinate of first coordinate</dd>\n<dt>x2:</dt>\n<dd>x ordinate of second coordinate</dd>\n<dt>y2:</dt>\n<dd>y ordinate of second coordinate</dd>\n<dt>rx:</dt>\n<dd>radius of corner in horizontal direction</dd>\n<dt>ry:</dt>\n<dd>radius of corner in vertical direction</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawscale\">\n<h1><a class=\"toc-backref\" href=\"#id303\">DrawScale</a></h1>\n<div class=\"section\" id=\"id155\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawScale( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id156\">\n<h2>Description</h2>\n<p>DrawScale() adjusts the scaling factor to apply in the horizontal and\nvertical directions to the current coordinate space.</p>\n<p>The format of the DrawScale method is:</p>\n<pre class=\"literal-block\">\nvoid DrawScale( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>horizontal scale factor</dd>\n<dt>y:</dt>\n<dd>vertical scale factor</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawskewx\">\n<h1><a class=\"toc-backref\" href=\"#id304\">DrawSkewX</a></h1>\n<div class=\"section\" id=\"id157\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSkewX( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double degrees );\n</pre>\n</div>\n<div class=\"section\" id=\"id158\">\n<h2>Description</h2>\n<p>DrawSkewX() skews the current coordinate system in the horizontal\ndirection.</p>\n<p>The format of the DrawSkewX method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSkewX( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double degrees );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>degrees:</dt>\n<dd>number of degrees to skew the coordinates</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawskewy\">\n<h1><a class=\"toc-backref\" href=\"#id305\">DrawSkewY</a></h1>\n<div class=\"section\" id=\"id159\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSkewY( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double degrees );\n</pre>\n</div>\n<div class=\"section\" id=\"id160\">\n<h2>Description</h2>\n<p>DrawSkewY() skews the current coordinate system in the vertical\ndirection.</p>\n<p>The format of the DrawSkewY method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSkewY( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double degrees );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>degrees:</dt>\n<dd>number of degrees to skew the coordinates</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstopcolor\">\n<h1><a class=\"toc-backref\" href=\"#id306\">DrawSetStopColor</a></h1>\n<div class=\"section\" id=\"id161\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStopColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *stop_color,\n                       const double offset );\n</pre>\n</div>\n<div class=\"section\" id=\"id162\">\n<h2>Description</h2>\n<p>DrawSetStopColor() sets the stop color and offset for gradients</p>\n<p>The format of the DrawSetStopColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStopColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *stop_color,\n                       const double offset );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n<p>o stop_color:</p>\n<p>o offset:</p>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokecolor\">\n<h1><a class=\"toc-backref\" href=\"#id307\">DrawGetStrokeColor</a></h1>\n<div class=\"section\" id=\"id163\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> DrawGetStrokeColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id164\">\n<h2>Description</h2>\n<p>DrawGetStrokeColor() returns the color used for stroking object outlines.</p>\n<p>The format of the DrawGetStrokeColor method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> DrawGetStrokeColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokecolor\">\n<h1><a class=\"toc-backref\" href=\"#id308\">DrawSetStrokeColor</a></h1>\n<div class=\"section\" id=\"id165\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *stroke_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id166\">\n<h2>Description</h2>\n<p>DrawSetStrokeColor() sets the color used for stroking object outlines.</p>\n<p>The format of the DrawSetStrokeColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *stroke_color );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>stroke_color:</dt>\n<dd>stroke color</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokecolorstring\">\n<h1><a class=\"toc-backref\" href=\"#id309\">DrawSetStrokeColorString</a></h1>\n<div class=\"section\" id=\"id167\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeColorString( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *stroke_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id168\">\n<h2>Description</h2>\n<p>DrawSetStrokeColorString() sets the color used for stroking object outlines.</p>\n<p>The format of the DrawSetStrokeColorString method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeColorString( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *stroke_color );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>stroke_color:</dt>\n<dd>stroke color</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokepatternurl\">\n<h1><a class=\"toc-backref\" href=\"#id310\">DrawSetStrokePatternURL</a></h1>\n<div class=\"section\" id=\"id169\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokePatternURL( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *stroke_url );\n</pre>\n</div>\n<div class=\"section\" id=\"id170\">\n<h2>Description</h2>\n<p>DrawSetStrokePatternURL() sets the pattern used for stroking object outlines.</p>\n<p>The format of the DrawSetStrokePatternURL method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokePatternURL( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *stroke_url );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>stroke_url:</dt>\n<dd>URL specifying pattern ID (e.g. &quot;#pattern_id&quot;)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokeantialias\">\n<h1><a class=\"toc-backref\" href=\"#id311\">DrawGetStrokeAntialias</a></h1>\n<div class=\"section\" id=\"id171\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int DrawGetStrokeAntialias( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id172\">\n<h2>Description</h2>\n<p>DrawGetStrokeAntialias() returns the current stroke antialias setting.\nStroked outlines are antialiased by default.  When antialiasing is disabled\nstroked pixels are thresholded to determine if the stroke color or\nunderlying canvas color should be used.</p>\n<p>The format of the DrawGetStrokeAntialias method is:</p>\n<pre class=\"literal-block\">\nunsigned int DrawGetStrokeAntialias( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokeantialias\">\n<h1><a class=\"toc-backref\" href=\"#id312\">DrawSetStrokeAntialias</a></h1>\n<div class=\"section\" id=\"id173\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeAntialias( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned int stroke_antialias );\n</pre>\n</div>\n<div class=\"section\" id=\"id174\">\n<h2>Description</h2>\n<p>DrawSetStrokeAntialias() controls whether stroked outlines are antialiased.\nStroked outlines are antialiased by default.  When antialiasing is disabled\nstroked pixels are thresholded to determine if the stroke color or\nunderlying canvas color should be used.</p>\n<p>The format of the DrawSetStrokeAntialias method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeAntialias( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned int stroke_antialias );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>stroke_antialias:</dt>\n<dd>set to false (zero) to disable antialiasing</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokedasharray\">\n<h1><a class=\"toc-backref\" href=\"#id313\">DrawGetStrokeDashArray</a></h1>\n<div class=\"section\" id=\"id175\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble *DrawGetStrokeDashArray( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, unsigned long *num_elems );\n</pre>\n</div>\n<div class=\"section\" id=\"id176\">\n<h2>Description</h2>\n<p>DrawGetStrokeDashArray() returns an array representing the pattern of\ndashes and gaps used to stroke paths (see DrawSetStrokeDashArray). The\narray must be freed once it is no longer required by the user.</p>\n<p>The format of the DrawGetStrokeDashArray method is:</p>\n<pre class=\"literal-block\">\ndouble *DrawGetStrokeDashArray( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, unsigned long *num_elems );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>num_elems:</dt>\n<dd>address to place number of elements in dash array</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokedasharray\">\n<h1><a class=\"toc-backref\" href=\"#id314\">DrawSetStrokeDashArray</a></h1>\n<div class=\"section\" id=\"id177\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeDashArray( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long num_elems,\n                             const double *dasharray );\n</pre>\n</div>\n<div class=\"section\" id=\"id178\">\n<h2>Description</h2>\n<p>DrawSetStrokeDashArray() specifies the pattern of dashes and gaps used to\nstroke paths. The strokeDashArray represents an array of numbers that\nspecify the lengths of alternating dashes and gaps in pixels. If an odd\nnumber of values is provided, then the list of values is repeated to yield\nan even number of values. To remove an existing dash array, pass a zero\nnum_elems argument and null dasharray. A typical stroke dash array might\ncontain the members 5 3 2.</p>\n<p>The format of the DrawSetStrokeDashArray method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeDashArray( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long num_elems,\n                             const double *dasharray );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>num_elems:</dt>\n<dd>number of elements in dash array</dd>\n<dt>dasharray:</dt>\n<dd>dash array values</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokedashoffset\">\n<h1><a class=\"toc-backref\" href=\"#id315\">DrawGetStrokeDashOffset</a></h1>\n<div class=\"section\" id=\"id179\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeDashOffset( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id180\">\n<h2>Description</h2>\n<p>DrawGetStrokeDashOffset() returns the offset into the dash pattern to\nstart the dash.</p>\n<p>The format of the DrawGetStrokeDashOffset method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeDashOffset( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokedashoffset\">\n<h1><a class=\"toc-backref\" href=\"#id316\">DrawSetStrokeDashOffset</a></h1>\n<div class=\"section\" id=\"id181\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeDashOffset( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double dash_offset );\n</pre>\n</div>\n<div class=\"section\" id=\"id182\">\n<h2>Description</h2>\n<p>DrawSetStrokeDashOffset() specifies the offset into the dash pattern to\nstart the dash.</p>\n<p>The format of the DrawSetStrokeDashOffset method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeDashOffset( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double dash_offset );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>dash_offset:</dt>\n<dd>dash offset</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokelinecap\">\n<h1><a class=\"toc-backref\" href=\"#id317\">DrawGetStrokeLineCap</a></h1>\n<div class=\"section\" id=\"id183\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nLineCap DrawGetStrokeLineCap( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id184\">\n<h2>Description</h2>\n<p>DrawGetStrokeLineCap() returns the shape to be used at the end of\nopen subpaths when they are stroked. Values of LineCap are\nUndefinedCap, ButtCap, RoundCap, and SquareCap.</p>\n<p>The format of the DrawGetStrokeLineCap method is:</p>\n<pre class=\"literal-block\">\nLineCap DrawGetStrokeLineCap( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokelinecap\">\n<h1><a class=\"toc-backref\" href=\"#id318\">DrawSetStrokeLineCap</a></h1>\n<div class=\"section\" id=\"id185\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeLineCap( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const LineCap linecap );\n</pre>\n</div>\n<div class=\"section\" id=\"id186\">\n<h2>Description</h2>\n<p>DrawSetStrokeLineCap() specifies the shape to be used at the end of\nopen subpaths when they are stroked. Values of LineCap are\nUndefinedCap, ButtCap, RoundCap, and SquareCap.</p>\n<p>The format of the DrawSetStrokeLineCap method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeLineCap( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const LineCap linecap );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>linecap:</dt>\n<dd>linecap style</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokelinejoin\">\n<h1><a class=\"toc-backref\" href=\"#id319\">DrawGetStrokeLineJoin</a></h1>\n<div class=\"section\" id=\"id187\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nLineJoin DrawGetStrokeLineJoin( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id188\">\n<h2>Description</h2>\n<p>DrawGetStrokeLineJoin() returns the shape to be used at the\ncorners of paths (or other vector shapes) when they are\nstroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin,\nand BevelJoin.</p>\n<p>The format of the DrawGetStrokeLineJoin method is:</p>\n<pre class=\"literal-block\">\nLineJoin DrawGetStrokeLineJoin( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokelinejoin\">\n<h1><a class=\"toc-backref\" href=\"#id320\">DrawSetStrokeLineJoin</a></h1>\n<div class=\"section\" id=\"id189\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeLineJoin( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const LineJoin linejoin );\n</pre>\n</div>\n<div class=\"section\" id=\"id190\">\n<h2>Description</h2>\n<p>DrawSetStrokeLineJoin() specifies the shape to be used at the\ncorners of paths (or other vector shapes) when they are\nstroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin,\nand BevelJoin.</p>\n<p>The format of the DrawSetStrokeLineJoin method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeLineJoin( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const LineJoin linejoin );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>linejoin:</dt>\n<dd>line join style</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokemiterlimit\">\n<h1><a class=\"toc-backref\" href=\"#id321\">DrawGetStrokeMiterLimit</a></h1>\n<div class=\"section\" id=\"id191\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long DrawGetStrokeMiterLimit( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id192\">\n<h2>Description</h2>\n<p>DrawGetStrokeMiterLimit() returns the miter limit. When two line\nsegments meet at a sharp angle and miter joins have been specified for\n'lineJoin', it is possible for the miter to extend far beyond the\nthickness of the line stroking the path. The miterLimit' imposes a\nlimit on the ratio of the miter length to the 'lineWidth'.</p>\n<p>The format of the DrawGetStrokeMiterLimit method is:</p>\n<pre class=\"literal-block\">\nunsigned long DrawGetStrokeMiterLimit( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokemiterlimit\">\n<h1><a class=\"toc-backref\" href=\"#id322\">DrawSetStrokeMiterLimit</a></h1>\n<div class=\"section\" id=\"id193\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeMiterLimit( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long miterlimit );\n</pre>\n</div>\n<div class=\"section\" id=\"id194\">\n<h2>Description</h2>\n<p>DrawSetStrokeMiterLimit() specifies the miter limit. When two line\nsegments meet at a sharp angle and miter joins have been specified for\n'lineJoin', it is possible for the miter to extend far beyond the\nthickness of the line stroking the path. The miterLimit' imposes a\nlimit on the ratio of the miter length to the 'lineWidth'.</p>\n<p>The format of the DrawSetStrokeMiterLimit method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeMiterLimit( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned long miterlimit );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>miterlimit:</dt>\n<dd>miter limit</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokeopacity\">\n<h1><a class=\"toc-backref\" href=\"#id323\">DrawGetStrokeOpacity</a></h1>\n<div class=\"section\" id=\"id195\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeOpacity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id196\">\n<h2>Description</h2>\n<p>DrawGetStrokeOpacity() returns the opacity of stroked object outlines.</p>\n<p>The format of the DrawGetStrokeOpacity method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeOpacity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokeopacity\">\n<h1><a class=\"toc-backref\" href=\"#id324\">DrawSetStrokeOpacity</a></h1>\n<div class=\"section\" id=\"id197\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeOpacity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double stroke_opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id198\">\n<h2>Description</h2>\n<p>DrawSetStrokeOpacity() specifies the opacity of stroked object outlines.</p>\n<p>The format of the DrawSetStrokeOpacity method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeOpacity( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double stroke_opacity );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>stroke_opacity:</dt>\n<dd>stroke opacity.  The value 1.0 is opaque.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokewidth\">\n<h1><a class=\"toc-backref\" href=\"#id325\">DrawGetStrokeWidth</a></h1>\n<div class=\"section\" id=\"id199\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeWidth( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id200\">\n<h2>Description</h2>\n<p>DrawGetStrokeWidth() returns the width of the stroke used to draw object\noutlines.</p>\n<p>The format of the DrawGetStrokeWidth method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeWidth( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokewidth\">\n<h1><a class=\"toc-backref\" href=\"#id326\">DrawSetStrokeWidth</a></h1>\n<div class=\"section\" id=\"id201\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeWidth( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double stroke_width );\n</pre>\n</div>\n<div class=\"section\" id=\"id202\">\n<h2>Description</h2>\n<p>DrawSetStrokeWidth() sets the width of the stroke used to draw object\noutlines.</p>\n<p>The format of the DrawSetStrokeWidth method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeWidth( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double stroke_width );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>stroke_width:</dt>\n<dd>stroke width</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgettextantialias\">\n<h1><a class=\"toc-backref\" href=\"#id327\">DrawGetTextAntialias</a></h1>\n<div class=\"section\" id=\"id203\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int DrawGetTextAntialias( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id204\">\n<h2>Description</h2>\n<p>DrawGetTextAntialias() returns the current text antialias setting, which\ndetermines whether text is antialiased.  Text is antialiased by default.</p>\n<p>The format of the DrawGetTextAntialias method is:</p>\n<pre class=\"literal-block\">\nunsigned int DrawGetTextAntialias( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsettextantialias\">\n<h1><a class=\"toc-backref\" href=\"#id328\">DrawSetTextAntialias</a></h1>\n<div class=\"section\" id=\"id205\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetTextAntialias( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned int text_antialias );\n</pre>\n</div>\n<div class=\"section\" id=\"id206\">\n<h2>Description</h2>\n<p>DrawSetTextAntialias() controls whether text is antialiased.  Text is\nantialiased by default.</p>\n<p>The format of the DrawSetTextAntialias method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetTextAntialias( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const unsigned int text_antialias );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>text_antialias:</dt>\n<dd>antialias boolean. Set to false (0) to disable\nantialiasing.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgettextdecoration\">\n<h1><a class=\"toc-backref\" href=\"#id329\">DrawGetTextDecoration</a></h1>\n<div class=\"section\" id=\"id207\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#decorationtype\">DecorationType</a> DrawGetTextDecoration( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id208\">\n<h2>Description</h2>\n<p>DrawGetTextDecoration() returns the decoration applied when annotating with\ntext.</p>\n<p>The format of the DrawGetTextDecoration method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#decorationtype\">DecorationType</a> DrawGetTextDecoration( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsettextdecoration\">\n<h1><a class=\"toc-backref\" href=\"#id330\">DrawSetTextDecoration</a></h1>\n<div class=\"section\" id=\"id209\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetTextDecoration( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#decorationtype\">DecorationType</a> decoration );\n</pre>\n</div>\n<div class=\"section\" id=\"id210\">\n<h2>Description</h2>\n<p>DrawSetTextDecoration() specifies a decoration to be applied when\nannotating with text.</p>\n<p>The format of the DrawSetTextDecoration method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetTextDecoration( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#decorationtype\">DecorationType</a> decoration );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>decoration:</dt>\n<dd>text decoration.  One of NoDecoration, UnderlineDecoration,\nOverlineDecoration, or LineThroughDecoration</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgettextencoding\">\n<h1><a class=\"toc-backref\" href=\"#id331\">DrawGetTextEncoding</a></h1>\n<div class=\"section\" id=\"id211\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *DrawGetTextEncoding( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id212\">\n<h2>Description</h2>\n<p>DrawGetTextEncoding() returns a null-terminated string which specifies the\ncode set used for text annotations. The string must be freed by the user\nonce it is no longer required.</p>\n<p>The format of the DrawGetTextEncoding method is:</p>\n<pre class=\"literal-block\">\nchar *DrawGetTextEncoding( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsettextencoding\">\n<h1><a class=\"toc-backref\" href=\"#id332\">DrawSetTextEncoding</a></h1>\n<div class=\"section\" id=\"id213\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetTextEncoding( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *encoding );\n</pre>\n</div>\n<div class=\"section\" id=\"id214\">\n<h2>Description</h2>\n<p>DrawSetTextEncoding() specifies specifies the code set to use for\ntext annotations. The only character encoding which may be specified\nat this time is &quot;UTF-8&quot; for representing Unicode as a sequence of\nbytes. Specify an empty string to set text encoding to the system's\ndefault. Successful text annotation using Unicode may require fonts\ndesigned to support Unicode.</p>\n<p>The format of the DrawSetTextEncoding method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetTextEncoding( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *encoding );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>encoding:</dt>\n<dd>character string specifying text encoding</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgettextundercolor\">\n<h1><a class=\"toc-backref\" href=\"#id333\">DrawGetTextUnderColor</a></h1>\n<div class=\"section\" id=\"id215\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> DrawGetTextUnderColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n</div>\n<div class=\"section\" id=\"id216\">\n<h2>Description</h2>\n<p>DrawGetTextUnderColor() returns the color of a background rectangle\nto place under text annotations.</p>\n<p>The format of the DrawGetTextUnderColor method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> DrawGetTextUnderColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsettextundercolor\">\n<h1><a class=\"toc-backref\" href=\"#id334\">DrawSetTextUnderColor</a></h1>\n<div class=\"section\" id=\"id217\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetTextUnderColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *under_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id218\">\n<h2>Description</h2>\n<p>DrawSetTextUnderColor() specifies the color of a background rectangle\nto place under text annotations.</p>\n<p>The format of the DrawSetTextUnderColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetTextUnderColor( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *under_color );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>under_color:</dt>\n<dd>text under color</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsettextundercolorstring\">\n<h1><a class=\"toc-backref\" href=\"#id335\">DrawSetTextUnderColorString</a></h1>\n<div class=\"section\" id=\"id219\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetTextUnderColorString( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *under_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id220\">\n<h2>Description</h2>\n<p>DrawSetTextUnderColorString() specifies the color of a background rectangle\nto place under text annotations.</p>\n<p>The format of the DrawSetTextUnderColorString method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetTextUnderColorString( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const char *under_color );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>under_color:</dt>\n<dd>text under color</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawtranslate\">\n<h1><a class=\"toc-backref\" href=\"#id336\">DrawTranslate</a></h1>\n<div class=\"section\" id=\"id221\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawTranslate( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id222\">\n<h2>Description</h2>\n<p>DrawTranslate() applies a translation to the current coordinate\nsystem which moves the coordinate system origin to the specified\ncoordinate.</p>\n<p>The format of the DrawTranslate method is:</p>\n<pre class=\"literal-block\">\nvoid DrawTranslate( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x:</dt>\n<dd>new x ordinate for coordinate system origin</dd>\n<dt>y:</dt>\n<dd>new y ordinate for coordinate system origin</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetviewbox\">\n<h1><a class=\"toc-backref\" href=\"#id337\">DrawSetViewbox</a></h1>\n<div class=\"section\" id=\"id223\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetViewbox( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, unsigned long x1, unsigned long y1,\n                     unsigned long x2, unsigned long y2 );\n</pre>\n</div>\n<div class=\"section\" id=\"id224\">\n<h2>Description</h2>\n<p>DrawSetViewbox() sets the overall canvas size to be recorded with the\ndrawing vector data.  Usually this will be specified using the same\nsize as the canvas image.  When the vector data is saved to SVG or MVG\nformats, the viewbox is use to specify the size of the canvas image that\na viewer will render the vector data on.</p>\n<p>The format of the DrawSetViewbox method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetViewbox( <a class=\"reference external\" href=\"../api/types.html#drawcontext\">DrawContext</a> context, unsigned long x1, unsigned long y1,\n                     unsigned long x2, unsigned long y2 );\n</pre>\n<dl class=\"docutils\">\n<dt>context:</dt>\n<dd>drawing context</dd>\n<dt>x1:</dt>\n<dd>left x ordinate</dd>\n<dt>y1:</dt>\n<dd>top y ordinate</dd>\n<dt>x2:</dt>\n<dd>right x ordinate</dd>\n<dt>y2:</dt>\n<dd>bottom y ordinate</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/effect.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>effect</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"effect\">\n<h1 class=\"title\">effect</h1>\n<h2 class=\"subtitle\" id=\"image-effects-methods\">Image effects methods</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#adaptivethresholdimage\" id=\"id51\">AdaptiveThresholdImage</a></li>\n<li><a class=\"reference internal\" href=\"#addnoiseimage\" id=\"id52\">AddNoiseImage</a></li>\n<li><a class=\"reference internal\" href=\"#addnoiseimagechannel\" id=\"id53\">AddNoiseImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#blackthresholdimage\" id=\"id54\">BlackThresholdImage</a></li>\n<li><a class=\"reference internal\" href=\"#blurimage\" id=\"id55\">BlurImage</a></li>\n<li><a class=\"reference internal\" href=\"#blurimagechannel\" id=\"id56\">BlurImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#channelthresholdimage\" id=\"id57\">ChannelThresholdImage</a></li>\n<li><a class=\"reference internal\" href=\"#convolveimage\" id=\"id58\">ConvolveImage</a></li>\n<li><a class=\"reference internal\" href=\"#despeckleimage\" id=\"id59\">DespeckleImage</a></li>\n<li><a class=\"reference internal\" href=\"#edgeimage\" id=\"id60\">EdgeImage</a></li>\n<li><a class=\"reference internal\" href=\"#embossimage\" id=\"id61\">EmbossImage</a></li>\n<li><a class=\"reference internal\" href=\"#enhanceimage\" id=\"id62\">EnhanceImage</a></li>\n<li><a class=\"reference internal\" href=\"#gaussianblurimage\" id=\"id63\">GaussianBlurImage</a></li>\n<li><a class=\"reference internal\" href=\"#gaussianblurimagechannel\" id=\"id64\">GaussianBlurImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#medianfilterimage\" id=\"id65\">MedianFilterImage</a></li>\n<li><a class=\"reference internal\" href=\"#motionblurimage\" id=\"id66\">MotionBlurImage</a></li>\n<li><a class=\"reference internal\" href=\"#randomchannelthresholdimage\" id=\"id67\">RandomChannelThresholdImage</a></li>\n<li><a class=\"reference internal\" href=\"#reducenoiseimage\" id=\"id68\">ReduceNoiseImage</a></li>\n<li><a class=\"reference internal\" href=\"#shadeimage\" id=\"id69\">ShadeImage</a></li>\n<li><a class=\"reference internal\" href=\"#sharpenimage\" id=\"id70\">SharpenImage</a></li>\n<li><a class=\"reference internal\" href=\"#sharpenimagechannel\" id=\"id71\">SharpenImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#spreadimage\" id=\"id72\">SpreadImage</a></li>\n<li><a class=\"reference internal\" href=\"#thresholdimage\" id=\"id73\">ThresholdImage</a></li>\n<li><a class=\"reference internal\" href=\"#unsharpmaskimage\" id=\"id74\">UnsharpMaskImage</a></li>\n<li><a class=\"reference internal\" href=\"#unsharpmaskimagechannel\" id=\"id75\">UnsharpMaskImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#whitethresholdimage\" id=\"id76\">WhiteThresholdImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"adaptivethresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id51\">AdaptiveThresholdImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AdaptiveThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long width,\n                               const unsigned long height, const unsigned long unsigned long,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>AdaptiveThresholdImage() selects an individual threshold for each pixel\nbased on the range of intensity values in its local neighborhood.  This\nallows for thresholding of an image whose global intensity histogram\ndoesn't contain distinctive peaks.</p>\n<p>The format of the AdaptiveThresholdImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AdaptiveThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long width,\n                               const unsigned long height, const unsigned long unsigned long,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>width:</dt>\n<dd>The width of the local neighborhood.</dd>\n<dt>height:</dt>\n<dd>The height of the local neighborhood.</dd>\n<dt>offset:</dt>\n<dd>The mean offset.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"addnoiseimage\">\n<h1><a class=\"toc-backref\" href=\"#id52\">AddNoiseImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AddNoiseImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#noisetype\">NoiseType</a> noise_type,\n                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>AddNoiseImage() adds random noise to the image.</p>\n<p>The format of the AddNoiseImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AddNoiseImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#noisetype\">NoiseType</a> noise_type,\n                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>noise_type:</dt>\n<dd>The type of noise: Uniform, Gaussian, Multiplicative,\nImpulse, Laplacian, Poisson, or Random.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"addnoiseimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id53\">AddNoiseImageChannel</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AddNoiseImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                             const <a class=\"reference external\" href=\"../api/types.html#noisetype\">NoiseType</a> noise_type, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>AddNoiseImageChannel() adds random noise to one image channel.</p>\n<p>The format of the AddNoiseImageChannel method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AddNoiseImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                             const <a class=\"reference external\" href=\"../api/types.html#noisetype\">NoiseType</a> noise_type, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>channel:</dt>\n<dd>The image channel to apply noise to.</dd>\n<dt>noise_type:</dt>\n<dd>The type of noise: Uniform, Gaussian, Multiplicative,\nImpulse, Laplacian, Poisson, or Random.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"blackthresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id54\">BlackThresholdImage</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail BlackThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *thresholds );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>BlackThresholdImage() adjusts the levels of image channels such that\nvalues below a specified threshold are set to the minimum value (black)\nwhile the remaining pixels are unchanged.</p>\n<p>The format of the BlackThresholdImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail BlackThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *thresholds );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>thresholds:</dt>\n<dd>Channel thresholds which are specified as a comma delimited\nlist containing the thresholds for red, green, blue, and opacity.  If\nthe list contains a percent symbol (%) then all values are treated as\na percentage of MaxRGB.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"blurimage\">\n<h1><a class=\"toc-backref\" href=\"#id55\">BlurImage</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *BlurImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>BlurImage() blurs an image.  We convolve the image with a Gaussian\noperator of the given radius and standard deviation (sigma).\nFor reasonable results, the radius should be larger than sigma.  Use a\nradius of 0 and BlurImage() selects a suitable radius for you.</p>\n<p>The format of the BlurImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *BlurImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"blurimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id56\">BlurImageChannel</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *BlurImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                         const double radius, const double sigma,\n                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>BlurImageChannel() blurs the specified image channel.  We convolve the\nimage channel with a Gaussian operator of the given radius and standard\ndeviation (sigma).  For reasonable results, the radius should be larger\nthan sigma.  Use a radius of 0 and BlurImageChannel() selects a suitable\nradius for you.</p>\n<p>The format of the BlurImageChannel method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *BlurImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                         const double radius, const double sigma,\n                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>channel:</dt>\n<dd>The channel to blur.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"channelthresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id57\">ChannelThresholdImage</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ChannelThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>ChannelThresholdImage() changes the value of individual pixels based on\nthe level of each pixel channel.  The result sets the affected channels\nto the minimum or maximum channel value. A negative threshold value\ndisables thresholding for that channel.  Append a percent symbol to\nhave threshold values automatically scaled from a percentage to MaxRGB.</p>\n<p>Invoked by the '-threshold' option.</p>\n<p>The format of the ChannelThresholdImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ChannelThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *threshold );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>threshold:</dt>\n<dd>define the threshold values, &lt;red&gt;{&lt;green&gt;,&lt;blue&gt;,&lt;opacity&gt;}{%}.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"convolveimage\">\n<h1><a class=\"toc-backref\" href=\"#id58\">ConvolveImage</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ConvolveImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int order,\n                      const double *kernel, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>ConvolveImage() applies a custom convolution kernel to the image.</p>\n<p>The format of the ConvolveImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ConvolveImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int order,\n                      const double *kernel, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>order:</dt>\n<dd>The number of columns and rows in the filter kernel.</dd>\n<dt>kernel:</dt>\n<dd>An array of double representing the convolution kernel.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"despeckleimage\">\n<h1><a class=\"toc-backref\" href=\"#id59\">DespeckleImage</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *DespeckleImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>Despeckle() reduces the speckle noise in an image while preserving the\nedges of the original image.</p>\n<p>The format of the DespeckleImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *DespeckleImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"edgeimage\">\n<h1><a class=\"toc-backref\" href=\"#id60\">EdgeImage</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *EdgeImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>EdgeImage() finds edges in an image.  Radius defines the radius of the\nconvolution filter.  Use a radius of 0 and Edge() selects a suitable\nradius for you.</p>\n<p>The format of the EdgeImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *EdgeImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>the radius of the pixel neighborhood.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"embossimage\">\n<h1><a class=\"toc-backref\" href=\"#id61\">EmbossImage</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *EmbossImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>EmbossImage() returns a grayscale image with a three-dimensional effect.\nWe convolve the image with a Gaussian operator of the given radius and\nstandard deviation (sigma).  For reasonable results, radius should be\nlarger than sigma.  Use a radius of 0 and Emboss() selects a suitable\nradius for you.</p>\n<p>The format of the EmbossImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *EmbossImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>the radius of the pixel neighborhood.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"enhanceimage\">\n<h1><a class=\"toc-backref\" href=\"#id62\">EnhanceImage</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *EnhanceImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>EnhanceImage() applies a digital filter to the image color channels that\nimproves the quality of a noisy image.  The opacity channel is preserved\nbut is otherwise ignored.</p>\n<p>The format of the EnhanceImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *EnhanceImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"gaussianblurimage\">\n<h1><a class=\"toc-backref\" href=\"#id63\">GaussianBlurImage</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GaussianBlurImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>GaussianBlurImage() blurs an image.  We convolve the image with a\nGaussian operator of the given radius and standard deviation (sigma).\nFor reasonable results, the radius should be larger than sigma.  Use a\nradius of 0 and GaussianBlurImage() selects a suitable radius for you</p>\n<p>The format of the GaussianBlurImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GaussianBlurImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>blur_image:</dt>\n<dd>Method GaussianBlurImage returns a pointer to the image\nafter it is blur.  A null image is returned if there is a memory\nshortage.</dd>\n<dt>image:</dt>\n<dd>Image to blur.</dd>\n<dt>radius:</dt>\n<dd>the radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>the standard deviation of the Gaussian, in pixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"gaussianblurimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id64\">GaussianBlurImageChannel</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GaussianBlurImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                 const double radius, const double sigma,\n                                 <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>GaussianBlurImageChannel() blurs an image channel.  We convolve the image\nwith a Gaussian operator of the given radius and standard deviation\n(sigma).  For reasonable results, the radius should be larger than sigma.\nUse a radius of 0 and GaussianBlurImage() selects a suitable radius for\nyou.</p>\n<p>The format of the GaussianBlurImageChannel method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GaussianBlurImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                 const double radius, const double sigma,\n                                 <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>blur_image:</dt>\n<dd>Method GaussianBlurImage returns a pointer to the image\nafter it is blur.  A null image is returned if there is a memory\nshortage.</dd>\n<dt>image:</dt>\n<dd>Image to blur.</dd>\n<dt>channel:</dt>\n<dd>Channel to blur in image.</dd>\n<dt>radius:</dt>\n<dd>the radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>the standard deviation of the Gaussian, in pixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"medianfilterimage\">\n<h1><a class=\"toc-backref\" href=\"#id65\">MedianFilterImage</a></h1>\n<div class=\"section\" id=\"id27\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MedianFilterImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius,\n                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id28\">\n<h2>Description</h2>\n<p>MedianFilterImage() applies a digital filter that improves the quality\nof a noisy image.  Each pixel is replaced by the median in a set of\nneighboring pixels as defined by radius.</p>\n<p>The algorithm was contributed by Mike Edmonds and implements an insertion\nsort for selecting median color-channel values.  For more on this algorithm\nsee &quot;Skip Lists: A probabilistic Alternative to Balanced Trees&quot; by William\nPugh in the June 1990 of Communications of the ACM.</p>\n<p>The format of the MedianFilterImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MedianFilterImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius,\n                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>The radius of the pixel neighborhood.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"motionblurimage\">\n<h1><a class=\"toc-backref\" href=\"#id66\">MotionBlurImage</a></h1>\n<div class=\"section\" id=\"id29\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MotionBlurImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                        const double angle, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id30\">\n<h2>Description</h2>\n<p>MotionBlurImage() simulates motion blur.  We convolve the image with a\nGaussian operator of the given radius and standard deviation (sigma).\nFor reasonable results, radius should be larger than sigma.  Use a\nradius of 0 and MotionBlurImage() selects a suitable radius for you.\nAngle gives the angle of the blurring motion (direction object appears\nto be coming from).</p>\n<p>Andrew Protano contributed this effect.</p>\n<p>The format of the MotionBlurImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MotionBlurImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                        const double angle, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting\nthe center pixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n<dt>angle:</dt>\n<dd>Apply the effect along this angle.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"randomchannelthresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id67\">RandomChannelThresholdImage</a></h1>\n<div class=\"section\" id=\"id31\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int RandomChannelThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *channel,\n                                          const char *thresholds,\n                                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id32\">\n<h2>Description</h2>\n<p>RandomChannelThresholdImage() changes the value of individual pixels based\non the intensity of each pixel compared to a random threshold.  The result\nis a low-contrast, two color image.</p>\n<p>The format of the RandomChannelThresholdImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int RandomChannelThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *channel,\n                                          const char *thresholds,\n                                          <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>channel:</dt>\n<dd>The channel or channels to be thresholded.</dd>\n<dt>thresholds:</dt>\n<dd>a geometry string containing LOWxHIGH thresholds.\nIf the string contains 2x2, 3x3, 4x4, 5x5, 6x6, or 7x7, then\nan ordered dither of order 2, 3, 4, 5, 6, or 7 will be performed\ninstead.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"reducenoiseimage\">\n<h1><a class=\"toc-backref\" href=\"#id68\">ReduceNoiseImage</a></h1>\n<div class=\"section\" id=\"id33\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ReduceNoiseImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius,\n                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id34\">\n<h2>Description</h2>\n<p>ReduceNoiseImage() smooths the contours of an image while still preserving\nedge information.  The algorithm works by replacing each pixel with its\nneighbor closest in value.  A neighbor is defined by radius.  Use a radius\nof 0 and ReduceNoise() selects a suitable radius for you.</p>\n<p>The format of the ReduceNoiseImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ReduceNoiseImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius,\n                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>The radius of the pixel neighborhood.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"shadeimage\">\n<h1><a class=\"toc-backref\" href=\"#id69\">ShadeImage</a></h1>\n<div class=\"section\" id=\"id35\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ShadeImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int gray, double azimuth,\n                   double elevation, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id36\">\n<h2>Description</h2>\n<p>ShadeImage() shines a distant light on an image to create a\nthree-dimensional effect. You control the positioning of the light with\nazimuth and elevation; azimuth is measured in degrees off the x axis\nand elevation is measured in pixels above the Z axis.</p>\n<p>The format of the ShadeImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ShadeImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int gray, double azimuth,\n                   double elevation, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>gray:</dt>\n<dd>A value other than zero shades the intensity of each pixel.</dd>\n<dt>azimuth, elevation:</dt>\n<dd>Define the light source direction.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"sharpenimage\">\n<h1><a class=\"toc-backref\" href=\"#id70\">SharpenImage</a></h1>\n<div class=\"section\" id=\"id37\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SharpenImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id38\">\n<h2>Description</h2>\n<p>SharpenImage() sharpens an image.  We convolve the image with a\nGaussian operator of the given radius and standard deviation (sigma).\nFor reasonable results, radius should be larger than sigma.  Use a\nradius of 0 and SharpenImage() selects a suitable radius for you.</p>\n<p>The format of the SharpenImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SharpenImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Laplacian, in pixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"sharpenimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id71\">SharpenImageChannel</a></h1>\n<div class=\"section\" id=\"id39\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SharpenImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                            const double radius, const double sigma,\n                            <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id40\">\n<h2>Description</h2>\n<p>SharpenImageChannel() sharpens an image channel.  We convolve the image\nchannel with a Gaussian operator of the given radius and standard\ndeviation (sigma). For reasonable results, radius should be larger than\nsigma.  Use a radius of 0 and SharpenImageChannel() selects a suitable\nradius for you.</p>\n<p>The format of the SharpenImageChannel method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SharpenImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                            const double radius, const double sigma,\n                            <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>channel:</dt>\n<dd>The channel to sharpen.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Laplacian, in pixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"spreadimage\">\n<h1><a class=\"toc-backref\" href=\"#id72\">SpreadImage</a></h1>\n<div class=\"section\" id=\"id41\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SpreadImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int radius,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id42\">\n<h2>Description</h2>\n<p>SpreadImage() is a special effects method that randomly displaces each\npixel in a block defined by the radius parameter.</p>\n<p>The format of the SpreadImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SpreadImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int radius,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>Choose a random pixel in a neighborhood of this extent.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"thresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id73\">ThresholdImage</a></h1>\n<div class=\"section\" id=\"id43\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"id44\">\n<h2>Description</h2>\n<p>ThresholdImage() changes the value of individual pixels based on\nthe intensity of each pixel compared to a specified threshold.  Values\ngreater than the threshold are set to the maximum quantum value, and\nvalues equal to or below the threshold are set to the minimum quantum\nvalue.  The result is a high-contrast, two color image.</p>\n<p>The format of the ThresholdImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double threshold );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>threshold:</dt>\n<dd>Define the threshold value</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"unsharpmaskimage\">\n<h1><a class=\"toc-backref\" href=\"#id74\">UnsharpMaskImage</a></h1>\n<div class=\"section\" id=\"id45\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *UnsharpMaskImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                         const double amount, const double threshold,\n                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id46\">\n<h2>Description</h2>\n<p>UnsharpMaskImage() sharpens an image.  We convolve the image with a\nGaussian operator of the given radius and standard deviation (sigma).\nFor reasonable results, radius should be larger than sigma.  Use a radius\nof 0 and UnsharpMaskImage() selects a suitable radius for you.</p>\n<p>The format of the UnsharpMaskImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *UnsharpMaskImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                         const double amount, const double threshold,\n                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n<dt>amount:</dt>\n<dd>The percentage of the difference between the original and the\nblur image that is added back into the original.</dd>\n<dt>threshold:</dt>\n<dd>The threshold in pixels needed to apply the diffence amount.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"unsharpmaskimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id75\">UnsharpMaskImageChannel</a></h1>\n<div class=\"section\" id=\"id47\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *UnsharpMaskImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                const double radius, const double sigma, const double amount,\n                                const double threshold, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id48\">\n<h2>Description</h2>\n<p>UnsharpMaskImageChannel() sharpens an image channel.  We convolve the\nimage channel with a Gaussian operator of the given radius and standard\ndeviation (sigma). For reasonable results, radius should be larger than\nsigma.  Use a radius of 0 and UnsharpMaskImage() selects a suitable\nradius for you.</p>\n<p>The format of the UnsharpMaskImageChannel method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *UnsharpMaskImageChannel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                const double radius, const double sigma, const double amount,\n                                const double threshold, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>channel:</dt>\n<dd>The channel to sharpen.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n<dt>amount:</dt>\n<dd>The percentage of the difference between the original and the\nblur image that is added back into the original.</dd>\n<dt>threshold:</dt>\n<dd>The threshold in pixels needed to apply the diffence amount.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"whitethresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id76\">WhiteThresholdImage</a></h1>\n<div class=\"section\" id=\"id49\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail WhiteThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *thresholds );\n</pre>\n</div>\n<div class=\"section\" id=\"id50\">\n<h2>Description</h2>\n<p>WhiteThresholdImage() adjusts the levels of image channels such that\nvalues above a specified threshold are set to the maximum value (white)\nwhile the remaining pixels are unchanged.</p>\n<p>The format of the WhiteThresholdImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail WhiteThresholdImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *thresholds );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>thresholds:</dt>\n<dd>Channel thresholds which are specified as a comma delimited\nlist containing the thresholds for red, green, blue, and opacity.  If\nthe list contains a percent symbol (%) then all values are treated as\na percentage of MaxRGB.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/enhance.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>enhance</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"enhance\">\n<h1 class=\"title\">enhance</h1>\n<h2 class=\"subtitle\" id=\"methods-to-enhance-or-adjust-an-image\">Methods to enhance or adjust an image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#contrastimage\" id=\"id15\">ContrastImage</a></li>\n<li><a class=\"reference internal\" href=\"#equalizeimage\" id=\"id16\">EqualizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#gammaimage\" id=\"id17\">GammaImage</a></li>\n<li><a class=\"reference internal\" href=\"#levelimage\" id=\"id18\">LevelImage</a></li>\n<li><a class=\"reference internal\" href=\"#levelimagechannel\" id=\"id19\">LevelImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#modulateimage\" id=\"id20\">ModulateImage</a></li>\n<li><a class=\"reference internal\" href=\"#negateimage\" id=\"id21\">NegateImage</a></li>\n<li><a class=\"reference internal\" href=\"#normalizeimage\" id=\"id22\">NormalizeImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"contrastimage\">\n<h1><a class=\"toc-backref\" href=\"#id15\">ContrastImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int ContrastImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int sharpen );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>ContrastImage() enhances the intensity differences between the lighter and\ndarker elements of the image.  Set sharpen to a value other than 0 to\nincrease the image contrast otherwise the contrast is reduced.</p>\n<p>The format of the ContrastImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int ContrastImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int sharpen );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>sharpen:</dt>\n<dd>Increase or decrease image contrast.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"equalizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id16\">EqualizeImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int EqualizeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>EqualizeImage() applies a histogram equalization to the image.</p>\n<p>The format of the EqualizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int EqualizeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"gammaimage\">\n<h1><a class=\"toc-backref\" href=\"#id17\">GammaImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail GammaImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *level );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>Use GammaImage() to gamma-correct an image.  The same image viewed on\ndifferent devices will have perceptual differences in the way the\nimage's intensities are represented on the screen.  Specify individual\ngamma levels for the red, green, and blue channels (e.g. &quot;1.0,2.2,0.45&quot;),\nor adjust all three with a single gamma parameter.  Values typically range\nfrom 0.45 to 2.6.</p>\n<p>You can also reduce the influence of a particular channel with a gamma\nvalue of 0.</p>\n<p>The format of the GammaImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail GammaImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *level );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>level:</dt>\n<dd>Define the level of gamma correction.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"levelimage\">\n<h1><a class=\"toc-backref\" href=\"#id18\">LevelImage</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int LevelImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *level );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>LevelImage() adjusts the levels of an image by scaling the colors falling\nbetween specified white and black points to the full available quantum\nrange. The parameters provided represent the black, mid (gamma), and white\npoints. The black point specifies the darkest color in the image. Colors\ndarker than the black point are set to zero. Mid point specifies a gamma\ncorrection to apply to the image.  White point specifies the lightest color\nin the image. Colors brighter than the white point are set to the maximum\nquantum value.</p>\n<p>The format of the LevelImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int LevelImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *level );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>levels:</dt>\n<dd>Specify the levels as a string of the form &quot;black/mid/white&quot;\n(e.g. &quot;10,1.0,65000) where black and white have the range of 0-MaxRGB,\nand mid has the range 0-10.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"levelimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id19\">LevelImageChannel</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail LevelImageChannel( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                  const double black_point, const double mid_point,\n                                  const double white_point );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>LevelImageChannel() adjusts the levels of one or more channels by\nscaling the colors falling between specified white and black points to\nthe full available quantum range. The parameters provided represent the\nblack, mid (gamma), and white points.  The black point specifies the\ndarkest color in the image. Colors darker than the black point are set to\nzero. Mid point specifies a gamma correction to apply to the image.\nWhite point specifies the lightest color in the image.  Colors brighter\nthan the white point are set to the maximum quantum value.</p>\n<p>The format of the LevelImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail LevelImageChannel( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                  const double black_point, const double mid_point,\n                                  const double white_point );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to level: Red, Cyan, Green, Magenta,\nBlue, Yellow, Opacity, or All.</dd>\n<dt>black_point, mid_point, white_point:</dt>\n<dd>Specify the levels where the black\nand white points have the range of 0-MaxRGB, and mid has the range 0-10.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"modulateimage\">\n<h1><a class=\"toc-backref\" href=\"#id20\">ModulateImage</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int ModulateImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *modulate );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>ModulateImage() lets you control the brightness, saturation, and hue\nof an image.  Modulate represents the brightness, saturation, and hue\nas one parameter (e.g. 90,150,100).</p>\n<p>The format of the ModulateImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int ModulateImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *modulate );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>modulate:</dt>\n<dd>Define the percent change in brightness, saturation, and\nhue.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"negateimage\">\n<h1><a class=\"toc-backref\" href=\"#id21\">NegateImage</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int NegateImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int grayscale );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>Method NegateImage negates the colors in the reference image.  The\nGrayscale option means that only grayscale values within the image are\nnegated.</p>\n<p>The format of the NegateImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int NegateImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int grayscale );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"normalizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id22\">NormalizeImage</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int NormalizeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>The NormalizeImage() method enhances the contrast of a color image by\nadjusting the pixels color to span the entire range of colors available.</p>\n<p>The format of the NormalizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int NormalizeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/error.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>error</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"error\">\n<h1 class=\"title\">error</h1>\n<h2 class=\"subtitle\" id=\"error-reporting-methods\">Error reporting methods</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#catchexception\" id=\"id27\">CatchException</a></li>\n<li><a class=\"reference internal\" href=\"#copyexception\" id=\"id28\">CopyException</a></li>\n<li><a class=\"reference internal\" href=\"#destroyexceptioninfo\" id=\"id29\">DestroyExceptionInfo</a></li>\n<li><a class=\"reference internal\" href=\"#getexceptioninfo\" id=\"id30\">GetExceptionInfo</a></li>\n<li><a class=\"reference internal\" href=\"#getlocaleexceptionmessage\" id=\"id31\">GetLocaleExceptionMessage</a></li>\n<li><a class=\"reference internal\" href=\"#magickerror\" id=\"id32\">MagickError</a></li>\n<li><a class=\"reference internal\" href=\"#magickfatalerror\" id=\"id33\">MagickFatalError</a></li>\n<li><a class=\"reference internal\" href=\"#magickwarning\" id=\"id34\">MagickWarning</a></li>\n<li><a class=\"reference internal\" href=\"#seterrorhandler\" id=\"id35\">SetErrorHandler</a></li>\n<li><a class=\"reference internal\" href=\"#setexceptioninfo\" id=\"id36\">SetExceptionInfo</a></li>\n<li><a class=\"reference internal\" href=\"#setfatalerrorhandler\" id=\"id37\">SetFatalErrorHandler</a></li>\n<li><a class=\"reference internal\" href=\"#setwarninghandler\" id=\"id38\">SetWarningHandler</a></li>\n<li><a class=\"reference internal\" href=\"#throwexception\" id=\"id39\">ThrowException</a></li>\n<li><a class=\"reference internal\" href=\"#throwloggedexception\" id=\"id40\">ThrowLoggedException</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"catchexception\">\n<h1><a class=\"toc-backref\" href=\"#id27\">CatchException</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nCatchException( const <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>CatchException() returns if no exceptions is found otherwise it reports\nthe exception as a warning, error, or fatal depending on the severity.</p>\n<p>The format of the CatchException method is:</p>\n<pre class=\"literal-block\">\nCatchException( const <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>exception:</dt>\n<dd>The exception info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"copyexception\">\n<h1><a class=\"toc-backref\" href=\"#id28\">CopyException</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid CopyException( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *copy, const <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *original );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>CopyException() copies exception data from one ExceptionInfo structure\nto another.</p>\n<p>The format of the CopyException method is:</p>\n<pre class=\"literal-block\">\nvoid CopyException( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *copy, const <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *original );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>copy:</dt>\n<dd>The exception to copy to.</dd>\n<dt>original:</dt>\n<dd>The exception to copy from.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroyexceptioninfo\">\n<h1><a class=\"toc-backref\" href=\"#id29\">DestroyExceptionInfo</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyExceptionInfo( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>DestroyExceptionInfo() deallocates memory associated with exception.</p>\n<p>The format of the DestroyExceptionInfo method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyExceptionInfo( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>exception:</dt>\n<dd>The exception info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getexceptioninfo\">\n<h1><a class=\"toc-backref\" href=\"#id30\">GetExceptionInfo</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nGetExceptionInfo( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>GetExceptionInfo() initializes an exception to default values.</p>\n<p>The format of the GetExceptionInfo method is:</p>\n<pre class=\"literal-block\">\nGetExceptionInfo( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>exception:</dt>\n<dd>The exception info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getlocaleexceptionmessage\">\n<h1><a class=\"toc-backref\" href=\"#id31\">GetLocaleExceptionMessage</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *GetLocaleExceptionMessage( const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> severity, const char *tag );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>GetLocaleExceptionMessage() converts a enumerated exception severity and tag\nto a message in the current locale.</p>\n<p>The format of the GetLocaleExceptionMessage method is:</p>\n<pre class=\"literal-block\">\nconst char *GetLocaleExceptionMessage( const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> severity, const char *tag );\n</pre>\n<dl class=\"docutils\">\n<dt>severity:</dt>\n<dd>the severity of the exception.</dd>\n<dt>tag:</dt>\n<dd>the message tag.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickerror\">\n<h1><a class=\"toc-backref\" href=\"#id32\">MagickError</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickError( const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> error, const char *reason, const char *description );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>Method MagickError calls the error handler methods with an error reason.</p>\n<p>The format of the MagickError method is:</p>\n<pre class=\"literal-block\">\nvoid MagickError( const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> error, const char *reason, const char *description );\n</pre>\n<dl class=\"docutils\">\n<dt>exception:</dt>\n<dd>Specifies the numeric error category.</dd>\n<dt>reason:</dt>\n<dd>Specifies the reason to display before terminating the\nprogram.</dd>\n<dt>description:</dt>\n<dd>Specifies any description to the reason.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickfatalerror\">\n<h1><a class=\"toc-backref\" href=\"#id33\">MagickFatalError</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickFatalError( const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> error, const char *reason,\n                       const char *description );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>MagickFatalError() calls the fatal error handler methods with an error\nreason.  The fatal error handler is not expected to return!</p>\n<p>The format of the MagickError method is:</p>\n<pre class=\"literal-block\">\nvoid MagickFatalError( const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> error, const char *reason,\n                       const char *description );\n</pre>\n<dl class=\"docutils\">\n<dt>exception:</dt>\n<dd>Specifies the numeric error category.</dd>\n<dt>reason:</dt>\n<dd>Specifies the reason to display before terminating the\nprogram.</dd>\n<dt>description:</dt>\n<dd>Specifies any description to the reason.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickwarning\">\n<h1><a class=\"toc-backref\" href=\"#id34\">MagickWarning</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickWarning( const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> warning, const char *reason,\n                    const char *description );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>Method MagickWarning calls the warning handler methods with a warning\nreason.</p>\n<p>The format of the MagickWarning method is:</p>\n<pre class=\"literal-block\">\nvoid MagickWarning( const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> warning, const char *reason,\n                    const char *description );\n</pre>\n<dl class=\"docutils\">\n<dt>warning:</dt>\n<dd>The warning severity.</dd>\n<dt>reason:</dt>\n<dd>Define the reason for the warning.</dd>\n<dt>description:</dt>\n<dd>Describe the warning.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"seterrorhandler\">\n<h1><a class=\"toc-backref\" href=\"#id35\">SetErrorHandler</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#errorhandler\">ErrorHandler</a> SetErrorHandler( <a class=\"reference external\" href=\"../api/types.html#errorhandler\">ErrorHandler</a> handler );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>SetErrorHandler() sets the error handler to the specified method\nand returns the previous error handler.</p>\n<p>The format of the SetErrorHandler method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#errorhandler\">ErrorHandler</a> SetErrorHandler( <a class=\"reference external\" href=\"../api/types.html#errorhandler\">ErrorHandler</a> handler );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>handler:</dt>\n<dd>The method to handle errors.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setexceptioninfo\">\n<h1><a class=\"toc-backref\" href=\"#id36\">SetExceptionInfo</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nSetExceptionInfo( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception, <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> severity );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>SetExceptionInfo() set the exception severity.</p>\n<p>The format of the SetExceptionInfo method is:</p>\n<pre class=\"literal-block\">\nSetExceptionInfo( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception, <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> severity );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>exception:</dt>\n<dd>The exception info.</dd>\n<dt>severity:</dt>\n<dd>The exception severity.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setfatalerrorhandler\">\n<h1><a class=\"toc-backref\" href=\"#id37\">SetFatalErrorHandler</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nFatalErrorHandler SetFatalErrorHandler( FatalErrorHandler handler );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>SetFatalErrorHandler() sets the fatal error handler to the specified method\nand returns the previous fatal error handler.</p>\n<p>The format of the SetFatalErrorHandler method is:</p>\n<pre class=\"literal-block\">\nFatalErrorHandler SetFatalErrorHandler( FatalErrorHandler handler );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>handler:</dt>\n<dd>The method to handle errors.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setwarninghandler\">\n<h1><a class=\"toc-backref\" href=\"#id38\">SetWarningHandler</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#errorhandler\">ErrorHandler</a> SetWarningHandler( <a class=\"reference external\" href=\"../api/types.html#errorhandler\">ErrorHandler</a> handler );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>SetWarningHandler() sets the warning handler to the specified method\nand returns the previous warning handler.</p>\n<p>The format of the SetWarningHandler method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#errorhandler\">ErrorHandler</a> SetWarningHandler( <a class=\"reference external\" href=\"../api/types.html#errorhandler\">ErrorHandler</a> handler );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>handler:</dt>\n<dd>The method to handle warnings.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"throwexception\">\n<h1><a class=\"toc-backref\" href=\"#id39\">ThrowException</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid ThrowException( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception, const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> severity,\n                     const char *reason, const char *description );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>ThrowException() throws an exception with the specified severity code,\nreason, and optional description.</p>\n<p>The format of the ThrowException method is:</p>\n<pre class=\"literal-block\">\nvoid ThrowException( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception, const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> severity,\n                     const char *reason, const char *description );\n</pre>\n<dl class=\"docutils\">\n<dt>exception:</dt>\n<dd>The exception.</dd>\n<dt>severity:</dt>\n<dd>The severity of the exception.</dd>\n<dt>reason:</dt>\n<dd>The reason of the exception.</dd>\n<dt>description:</dt>\n<dd>The exception description.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"throwloggedexception\">\n<h1><a class=\"toc-backref\" href=\"#id40\">ThrowLoggedException</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid ThrowLoggedException( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception, const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> severity,\n                           const char *reason, const char *description, const char *module,\n                           const char *function, const unsigned long line ;\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>ThrowLoggedException() throws an exception with the specified severity code,\nreason, optional description, source filename, function name, and line\nnumber. If logging is enabled, the exception is also logged.</p>\n<p>If the exception already contains an ErrorException (or greater) or the\nexisting exception is more severe, then it is ignored.</p>\n<p>The format of the ThrowLoggedException method is:</p>\n<pre class=\"literal-block\">\nvoid ThrowLoggedException( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception, const <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> severity,\n                           const char *reason, const char *description, const char *module,\n                           const char *function, const unsigned long line ;\n</pre>\n<dl class=\"docutils\">\n<dt>exception:</dt>\n<dd>The exception.</dd>\n<dt>severity:</dt>\n<dd>The severity of the exception.</dd>\n<dt>reason:</dt>\n<dd>The reason of the exception.</dd>\n<dt>description:</dt>\n<dd>The exception description.</dd>\n<dt>filename:</dt>\n<dd>The source module filename.</dd>\n<dt>function:</dt>\n<dd>The function name.</dd>\n<dt>line:</dt>\n<dd>The line number of the source module.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/export.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>export</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"export\">\n<h1 class=\"title\">export</h1>\n<h2 class=\"subtitle\" id=\"export-image-pixels-into-common-representations\">Export image pixels into common representations</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#exportimagepixelarea\" id=\"id5\">ExportImagePixelArea</a></li>\n<li><a class=\"reference internal\" href=\"#exportviewpixelarea\" id=\"id6\">ExportViewPixelArea</a></li>\n<li><a class=\"reference internal\" href=\"#exportpixelareaoptionsinit\" id=\"id7\">ExportPixelAreaOptionsInit</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"exportimagepixelarea\">\n<h1><a class=\"toc-backref\" href=\"#id5\">ExportImagePixelArea</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ExportImagePixelArea( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                                     unsigned int quantum_size, unsigned char *destination,\n                                     const ExportPixelAreaOptions *options,\n                                     ExportPixelAreaInfo *export_info );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>ExportImagePixelArea() transfers one or more pixel components from the\ndefault image pixel cache view to a user supplied buffer.  By default,\nvalues are written in network (big-endian) byte/bit order.  By setting\nthe 'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit values\nmay be output as little (LSBEndian), big (MSBEndian), or host native\n(NativeEndian) endian values.  This function is quite powerful in that\nbesides common native CPU type sizes, it can support any integer bit\ndepth from 1 to 32 (e.g. 13), 64-bits as well as 32 and 64-bit float.</p>\n<p>MagickPass is returned if the pixels are successfully transferred,\notherwise MagickFail.</p>\n<p>The format of the ExportImagePixelArea method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ExportImagePixelArea( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                                     unsigned int quantum_size, unsigned char *destination,\n                                     const ExportPixelAreaOptions *options,\n                                     ExportPixelAreaInfo *export_info );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Returns MagickPass if the pixels are successfully transferred,\notherwise MagickFail.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>quantum_type:</dt>\n<dd>Declare which pixel components to transfer (AlphaQuantum,\nBlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum,\nGrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum,\nIndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum,\nRedQuantum, YellowQuantum)</dd>\n<dt>quantum_size:</dt>\n<dd>Bits per quantum sample (range 1-32, and 64).</dd>\n<dt>destination:</dt>\n<dd>The components are transferred to this buffer.  The user\nis responsible for ensuring that the destination buffer is large\nenough.</dd>\n<dt>options:</dt>\n<dd>Additional options specific to quantum_type (may be NULL).</dd>\n<dt>export_info :</dt>\n<dd>Populated with information regarding the pixels\nexported (may be NULL)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"exportviewpixelarea\">\n<h1><a class=\"toc-backref\" href=\"#id6\">ExportViewPixelArea</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ExportViewPixelArea( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                                    unsigned int quantum_size, unsigned char *destination,\n                                    const ExportPixelAreaOptions *options,\n                                    ExportPixelAreaInfo *export_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>ExportViewPixelArea() transfers one or more pixel components from the\nspecified image pixel cache view to a user supplied buffer.  By default,\nvalues are written in network (big-endian) byte/bit order.  By setting the\n'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit values may be\noutput as little (LSBEndian), big (MSBEndian), or host native\n(NativeEndian) endian values.  This function is quite powerful in that\nbesides common native CPU type sizes, it can support any integer bit depth\nfrom 1 to 32 (e.g. 13), 64-bits as well as 32 and 64-bit float.</p>\n<p>MagickPass is returned if the pixels are successfully transferred,\notherwise MagickFail.</p>\n<p>The format of the ExportViewPixelArea method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ExportViewPixelArea( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                                    unsigned int quantum_size, unsigned char *destination,\n                                    const ExportPixelAreaOptions *options,\n                                    ExportPixelAreaInfo *export_info );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Returns MagickPass if the pixels are successfully transferred,\notherwise MagickFail.</dd>\n<dt>view:</dt>\n<dd>The image pixel cache view.</dd>\n<dt>quantum_type:</dt>\n<dd>Declare which pixel components to transfer (AlphaQuantum,\nBlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum,\nGrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum,\nIndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum,\nRedQuantum, YellowQuantum)</dd>\n<dt>quantum_size:</dt>\n<dd>Bits per quantum sample (range 1-32, and 64).</dd>\n<dt>destination:</dt>\n<dd>The components are transferred to this buffer.  The user\nis responsible for ensuring that the destination buffer is large\nenough.</dd>\n<dt>options:</dt>\n<dd>Additional options specific to quantum_type (may be NULL).</dd>\n<dt>export_info :</dt>\n<dd>Populated with information regarding the pixels\nexported (may be NULL)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"exportpixelareaoptionsinit\">\n<h1><a class=\"toc-backref\" href=\"#id7\">ExportPixelAreaOptionsInit</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid ExportPixelAreaOptionsInit( ExportPixelAreaOptions *options );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>ExportPixelAreaOptionsInit() initializes the options structure which is\noptionally passed to ExportPixelArea()</p>\n<p>The format of the ExportPixelAreaOptionsInit method is:</p>\n<pre class=\"literal-block\">\nvoid ExportPixelAreaOptionsInit( ExportPixelAreaOptions *options );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>options:</dt>\n<dd>Options structure to initialize.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/fx.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>fx</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"fx\">\n<h1 class=\"title\">fx</h1>\n<h2 class=\"subtitle\" id=\"image-special-effects-methods\">Image special effects methods</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#charcoalimage\" id=\"id21\">CharcoalImage</a></li>\n<li><a class=\"reference internal\" href=\"#colorizeimage\" id=\"id22\">ColorizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#colormatriximage\" id=\"id23\">ColorMatrixImage</a></li>\n<li><a class=\"reference internal\" href=\"#implodeimage\" id=\"id24\">ImplodeImage</a></li>\n<li><a class=\"reference internal\" href=\"#morphimages\" id=\"id25\">MorphImages</a></li>\n<li><a class=\"reference internal\" href=\"#oilpaintimage\" id=\"id26\">OilPaintImage</a></li>\n<li><a class=\"reference internal\" href=\"#solarizeimage\" id=\"id27\">SolarizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#steganoimage\" id=\"id28\">SteganoImage</a></li>\n<li><a class=\"reference internal\" href=\"#stereoimage\" id=\"id29\">StereoImage</a></li>\n<li><a class=\"reference internal\" href=\"#swirlimage\" id=\"id30\">SwirlImage</a></li>\n<li><a class=\"reference internal\" href=\"#waveimage\" id=\"id31\">WaveImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"charcoalimage\">\n<h1><a class=\"toc-backref\" href=\"#id21\">CharcoalImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CharcoalImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>Method CharcoalImage creates a new image that is a copy of an existing\none with the edge highlighted.  It allocates the memory necessary for the\nnew Image structure and returns a pointer to the new image.</p>\n<p>The format of the CharcoalImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CharcoalImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius, const double sigma,\n                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>charcoal_image:</dt>\n<dd>Method CharcoalImage returns a pointer to the image\nafter it is embossed.  A null image is returned if there is a memory\nshortage.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>the radius of the pixel neighborhood.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"colorizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id22\">ColorizeImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ColorizeImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *opacity,\n                      const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>ColorizeImage() blends the fill color with each pixel in the image.\nA percentage blend is specified with opacity.  Control the application\nof different color components by specifying a different percentage for\neach component (e.g. 90/100/10 is 90% red, 100% green, and 10% blue).</p>\n<p>The format of the ColorizeImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ColorizeImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *opacity,\n                      const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>opacity:</dt>\n<dd>A character string indicating the level of opacity as a\npercentage.</dd>\n<dt>target:</dt>\n<dd>A color value.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"colormatriximage\">\n<h1><a class=\"toc-backref\" href=\"#id23\">ColorMatrixImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ColorMatrixImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int order,\n                                 const double *color_matrix );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>ColorMatrixImage() applies a color matrix to the image channels.  The\nuser supplied matrix may be of order 1 to 5 (1x1 through 5x5) and is\nused to update the default identity matrix:</p>\n<p>1 0 0 0 0\n0 1 0 0 0\n0 0 1 0 0\n0 0 0 1 0\n0 0 0 0 1</p>\n<p>where the first four columns represent the ratio of the color (red,\ngreen, blue) and opacity components incorporated in the output summation.\nThe first four rows represent the summations for red, green, blue, and\nopacity.  The last row is a dummy row and is not used.  The last column\nrepresents a constant value (expressed as a ratio of MaxRGB) to be\nadded to the row summation.  The following is a summary of how the\nmatrix is applied:</p>\n<p>r' = r*m[0,0] + g*m[1,0] + b*m[2,0] + o*m[3,0] + MaxRGB*m[4,0]\ng' = r*m[0,1] + g*m[1,1] + b*m[2,1] + o*m[3,1] + MaxRGB*m[4,1]\nb' = r*m[0,2] + g*m[1,2] + b*m[2,2] + o*m[3,2] + MaxRGB*m[4,2]\no' = r*m[0,3] + g*m[1,3] + b*m[2,3] + o*m[3,3] + MaxRGB*m[4,3]</p>\n<p>The format of the ColorMatrixImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ColorMatrixImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int order,\n                                 const double *color_matrix );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>order:</dt>\n<dd>The number of columns and rows in the filter kernel.</dd>\n<dt>matrix:</dt>\n<dd>An array of double representing the matrix</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"implodeimage\">\n<h1><a class=\"toc-backref\" href=\"#id24\">ImplodeImage</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ImplodeImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double amount,\n                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>Method ImplodeImage creates a new image that is a copy of an existing\none with the image pixels &quot;implode&quot; by the specified percentage.  It\nallocates the memory necessary for the new Image structure and returns a\npointer to the new image.</p>\n<p>The format of the ImplodeImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ImplodeImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double amount,\n                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>implode_image:</dt>\n<dd>Method ImplodeImage returns a pointer to the image\nafter it is implode.  A null image is returned if there is a memory\nshortage.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>amount:</dt>\n<dd>Define the extent of the implosion.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"morphimages\">\n<h1><a class=\"toc-backref\" href=\"#id25\">MorphImages</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MorphImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long number_frames,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>The MorphImages() method requires a minimum of two images.  The first\nimage is transformed into the second by a number of intervening images\nas specified by frames.</p>\n<p>The format of the MorphImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MorphImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long number_frames,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>number_frames:</dt>\n<dd>Define the number of in-between image to generate.\nThe more in-between frames, the smoother the morph.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"oilpaintimage\">\n<h1><a class=\"toc-backref\" href=\"#id26\">OilPaintImage</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *OilPaintImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius,\n                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>OilPaintImage() applies a special effect filter that simulates an oil\npainting.  Each pixel is replaced by the most frequent color occurring\nin a circular region defined by radius.</p>\n<p>The format of the OilPaintImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *OilPaintImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double radius,\n                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>radius:</dt>\n<dd>The radius of the circular neighborhood.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"solarizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id27\">SolarizeImage</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int SolarizeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>SolarizeImage() applies a special effect to the image, similar to the effect\nachieved in a photo darkroom by selectively exposing areas of photo\nsensitive paper to light.  Threshold ranges from 0 to MaxRGB and is a\nmeasure of the extent of the solarization. False is returned if an error\nis encountered.</p>\n<p>The format of the SolarizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int SolarizeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double threshold );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>threshold:</dt>\n<dd>Define the extent of the solarization.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"steganoimage\">\n<h1><a class=\"toc-backref\" href=\"#id28\">SteganoImage</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SteganoImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *watermark,\n                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>Use SteganoImage() to hide a digital watermark within the image.\nRecover the hidden watermark later to prove that the authenticity of\nan image.  Offset defines the start position within the image to hide\nthe watermark.</p>\n<p>The format of the SteganoImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SteganoImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *watermark,\n                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>watermark:</dt>\n<dd>The watermark image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"stereoimage\">\n<h1><a class=\"toc-backref\" href=\"#id29\">StereoImage</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *StereoImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *offset_image,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>StereoImage() combines two images and produces a single image that is the\ncomposite of a left and right image of a stereo pair.  Special red-green\nstereo glasses are required to view this effect.</p>\n<p>The format of the StereoImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *StereoImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *offset_image,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>stereo_image:</dt>\n<dd>Method StereoImage returns a pointer to the stereo\nimage.  A null image is returned if there is a memory shortage.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>offset_image:</dt>\n<dd>Another image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"swirlimage\">\n<h1><a class=\"toc-backref\" href=\"#id30\">SwirlImage</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SwirlImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, double degrees, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>SwirlImage() swirls the pixels about the center of the image, where\ndegrees indicates the sweep of the arc through which each pixel is moved.\nYou get a more dramatic effect as the degrees move from 1 to 360.</p>\n<p>The format of the SwirlImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SwirlImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, double degrees, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>degrees:</dt>\n<dd>Define the tightness of the swirling effect.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"waveimage\">\n<h1><a class=\"toc-backref\" href=\"#id31\">WaveImage</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *WaveImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double amplitude, const double wave_length,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>The WaveImage() filter creates a &quot;ripple&quot; effect in the image by shifting\nthe pixels vertically along a sine wave whose amplitude and wavelength\nis specified by the given parameters.</p>\n<p>The format of the WaveImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *WaveImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double amplitude, const double wave_length,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>amplitude, frequency:</dt>\n<dd>Define the amplitude and wave_length of the\nsine wave.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/hclut.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>hclut</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"hclut\">\n<h1 class=\"title\">hclut</h1>\n<h2 class=\"subtitle\" id=\"apply-hald-clut-to-image\">Apply Hald CLUT to image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#haldclutimage\" id=\"id1\">HaldClutImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"haldclutimage\">\n<h1><a class=\"toc-backref\" href=\"#id1\">HaldClutImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail HaldClutImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *clut );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>The HaldClutImage() method apply a color lookup table (Hald CLUT) to the\nimage.  The fundamental principle of the Hald CLUT algorithm is that\napplication of an identity CLUT causes no change to the input image,\nbut an identity CLUT image which has had its colors transformed in\nsome way (e.g. in Adobe Photoshop) may be used to implement an identical\ntransform on any other image.</p>\n<p>The minimum CLUT level is 2, and the maximum depends on available memory\n(largest successfully tested is 24).  A CLUT image is required to have equal\nwidth and height. A CLUT of level 8 is an image of dimension 512x512, a CLUT\nof level 16 is an image of dimension 4096x4096.  Interpolation is used so\nextremely large CLUT images are not required.</p>\n<p>GraphicsMagick provides an 'identity' coder which may be used to generate\nidentity HLUTs.  For example, reading from &quot;identity:8&quot; creates an identity\nCLUT of order 8.</p>\n<p>The Hald CLUT algorithm has been developed by Eskil Steenberg as described\nat <a class=\"reference external\" href=\"http://www.quelsolaar.com/technology/clut.html\">http://www.quelsolaar.com/technology/clut.html</a>, and was adapted for\nGraphicsMagick by Clément Follet with support from Cédric Lejeune of\nWorkflowers.</p>\n<p>The format of the HaldClutImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail HaldClutImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *clut );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>clut:</dt>\n<dd>The color lookup table image</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/image.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>image</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"image\">\n<h1 class=\"title\">image</h1>\n<h2 class=\"subtitle\" id=\"miscellaneous-image-methods\">Miscellaneous image methods</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#accessdefinition\" id=\"id70\">AccessDefinition</a></li>\n<li><a class=\"reference internal\" href=\"#adddefinition\" id=\"id71\">AddDefinition</a></li>\n<li><a class=\"reference internal\" href=\"#adddefinitions\" id=\"id72\">AddDefinitions</a></li>\n<li><a class=\"reference internal\" href=\"#allocateimage\" id=\"id73\">AllocateImage</a></li>\n<li><a class=\"reference internal\" href=\"#allocatenextimage\" id=\"id74\">AllocateNextImage</a></li>\n<li><a class=\"reference internal\" href=\"#animateimages\" id=\"id75\">AnimateImages</a></li>\n<li><a class=\"reference internal\" href=\"#appendimages\" id=\"id76\">AppendImages</a></li>\n<li><a class=\"reference internal\" href=\"#catchimageexception\" id=\"id77\">CatchImageException</a></li>\n<li><a class=\"reference internal\" href=\"#clippathimage\" id=\"id78\">ClipPathImage</a></li>\n<li><a class=\"reference internal\" href=\"#compositepathimage\" id=\"id79\">CompositePathImage</a></li>\n<li><a class=\"reference internal\" href=\"#cloneimage\" id=\"id80\">CloneImage</a></li>\n<li><a class=\"reference internal\" href=\"#cloneimageinfo\" id=\"id81\">CloneImageInfo</a></li>\n<li><a class=\"reference internal\" href=\"#destroyimage\" id=\"id82\">DestroyImage</a></li>\n<li><a class=\"reference internal\" href=\"#destroyimageinfo\" id=\"id83\">DestroyImageInfo</a></li>\n<li><a class=\"reference internal\" href=\"#displayimages\" id=\"id84\">DisplayImages</a></li>\n<li><a class=\"reference internal\" href=\"#getimageclipmask\" id=\"id85\">GetImageClipMask</a></li>\n<li><a class=\"reference internal\" href=\"#getimagecompositemask\" id=\"id86\">GetImageCompositeMask</a></li>\n<li><a class=\"reference internal\" href=\"#getimageexception\" id=\"id87\">GetImageException</a></li>\n<li><a class=\"reference internal\" href=\"#getimagegeometry\" id=\"id88\">GetImageGeometry</a></li>\n<li><a class=\"reference internal\" href=\"#getimageinfo\" id=\"id89\">GetImageInfo</a></li>\n<li><a class=\"reference internal\" href=\"#istaintimage\" id=\"id90\">IsTaintImage</a></li>\n<li><a class=\"reference internal\" href=\"#modifyimage\" id=\"id91\">ModifyImage</a></li>\n<li><a class=\"reference internal\" href=\"#referenceimage\" id=\"id92\">ReferenceImage</a></li>\n<li><a class=\"reference internal\" href=\"#removedefinitions\" id=\"id93\">RemoveDefinitions</a></li>\n<li><a class=\"reference internal\" href=\"#resetimagepage\" id=\"id94\">ResetImagePage</a></li>\n<li><a class=\"reference internal\" href=\"#setimageex\" id=\"id95\">SetImageEx</a></li>\n<li><a class=\"reference internal\" href=\"#setimage\" id=\"id96\">SetImage</a></li>\n<li><a class=\"reference internal\" href=\"#setimagecolor\" id=\"id97\">SetImageColor</a></li>\n<li><a class=\"reference internal\" href=\"#setimagecolorregion\" id=\"id98\">SetImageColorRegion</a></li>\n<li><a class=\"reference internal\" href=\"#setimageclipmask\" id=\"id99\">SetImageClipMask</a></li>\n<li><a class=\"reference internal\" href=\"#setimagecompositemask\" id=\"id100\">SetImageCompositeMask</a></li>\n<li><a class=\"reference internal\" href=\"#setimagedepth\" id=\"id101\">SetImageDepth</a></li>\n<li><a class=\"reference internal\" href=\"#setimageopacity\" id=\"id102\">SetImageOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#setimagetype\" id=\"id103\">SetImageType</a></li>\n<li><a class=\"reference internal\" href=\"#stripimage\" id=\"id104\">StripImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"accessdefinition\">\n<h1><a class=\"toc-backref\" href=\"#id70\">AccessDefinition</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *AccessDefinition( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *magick,\n                              const char *key );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>AccessDefinition() searches the definitions for an entry matching the\nspecified magick and key. NULL is returned if no matching entry is found.</p>\n<p>The format of the AccessDefinition method is:</p>\n<pre class=\"literal-block\">\nconst char *AccessDefinition( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *magick,\n                              const char *key );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>magick:</dt>\n<dd>Format ID. This is usually the same as the coder name.</dd>\n<dt>key:</dt>\n<dd>Key to search for.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"adddefinition\">\n<h1><a class=\"toc-backref\" href=\"#id71\">AddDefinition</a></h1>\n<div class=\"section\" id=\"id2\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail AddDefinition( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *magick, const char *key,\n                              const char *value, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id3\">\n<h2>Description</h2>\n<p>AddDefinition() adds a key/value definition to the current map of\ndefinitions in ImageInfo. Definitions may be used by coders/decoders\nthat read and write images.</p>\n<p>The format of the AddDefinition method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail AddDefinition( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *magick, const char *key,\n                              const char *value, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>magick:</dt>\n<dd>format/classification identifier</dd>\n<dt>key:</dt>\n<dd>subidentifier within format/classification</dd>\n<dt>value:</dt>\n<dd>definition value</dd>\n<dt>exception:</dt>\n<dd>Errors result in updates to this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"adddefinitions\">\n<h1><a class=\"toc-backref\" href=\"#id72\">AddDefinitions</a></h1>\n<div class=\"section\" id=\"id4\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail AddDefinitions( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *options );\n</pre>\n</div>\n<div class=\"section\" id=\"id5\">\n<h2>Description</h2>\n<p>AddDefinitions() adds definitions from a key/value based string to the current\nmap of definitions in ImageInfo. Definitions may be used by coders/decoders\nthat read and write images.</p>\n<p>The format of the AddDefinitions method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail AddDefinitions( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *options );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>options:</dt>\n<dd>List of key/value pairs to put in the definitions map. The\nformat of the string is &quot;key1[=[value1]],key2[=[value2]],...&quot;. A missing\nvalue argument (with or without the equal sign) inserts an empty, zero\nlength string as value for a key.</dd>\n<dt>exception:</dt>\n<dd>Errors result in updates to this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"allocateimage\">\n<h1><a class=\"toc-backref\" href=\"#id73\">AllocateImage</a></h1>\n<div class=\"section\" id=\"id6\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AllocateImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id7\">\n<h2>Description</h2>\n<p>AllocateImage() returns a pointer to an image structure initialized to\ndefault values.</p>\n<p>The format of the AllocateImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AllocateImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>Many of the image default values are set from this\nstructure.  For example, filename, compression, depth, background color,\nand others.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"allocatenextimage\">\n<h1><a class=\"toc-backref\" href=\"#id74\">AllocateNextImage</a></h1>\n<div class=\"section\" id=\"id8\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid AllocateNextImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id9\">\n<h2>Description</h2>\n<p>Use AllocateNextImage() to initialize the next image in a sequence to\ndefault values.  The next member of image points to the newly allocated\nimage.  If there is a memory shortage, next is assigned NULL.</p>\n<p>The format of the AllocateNextImage method is:</p>\n<pre class=\"literal-block\">\nvoid AllocateNextImage( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>Many of the image default values are set from this\nstructure.  For example, filename, compression, depth, background color,\nand others.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"animateimages\">\n<h1><a class=\"toc-backref\" href=\"#id75\">AnimateImages</a></h1>\n<div class=\"section\" id=\"id10\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int AnimateImages( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id11\">\n<h2>Description</h2>\n<p>AnimateImages() repeatedly displays an image sequence to any X window\nscreen.  It returns a value other than 0 if successful.  Check the\nexception member of image to determine the reason for any failure.</p>\n<p>The format of the AnimateImages method is:</p>\n<pre class=\"literal-block\">\nunsigned int AnimateImages( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"appendimages\">\n<h1><a class=\"toc-backref\" href=\"#id76\">AppendImages</a></h1>\n<div class=\"section\" id=\"id12\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AppendImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int stack,\n                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id13\">\n<h2>Description</h2>\n<p>The AppendImages() method takes a set of images and appends them to each\nother top-to-bottom if the stack parameter is true, otherwise left-to-right.</p>\n<p>The format of the AppendImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AppendImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int stack,\n                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image sequence.</dd>\n<dt>stack:</dt>\n<dd>A value other than 0 stacks the images top-to-bottom.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"catchimageexception\">\n<h1><a class=\"toc-backref\" href=\"#id77\">CatchImageException</a></h1>\n<div class=\"section\" id=\"id14\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> CatchImageException( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id15\">\n<h2>Description</h2>\n<p>CatchImageException() returns if no exceptions are found in the image\nsequence, otherwise it determines the most severe exception and reports\nit as a warning or error depending on the severity.</p>\n<p>The format of the CatchImageException method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> CatchImageException( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>An image sequence.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"clippathimage\">\n<h1><a class=\"toc-backref\" href=\"#id78\">ClipPathImage</a></h1>\n<div class=\"section\" id=\"id16\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int ClipPathImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *pathname,\n                            const unsigned int inside );\n</pre>\n</div>\n<div class=\"section\" id=\"id17\">\n<h2>Description</h2>\n<p>ClipPathImage() sets the image clip mask based any clipping path information\nif it exists.</p>\n<p>The format of the ClipPathImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int ClipPathImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *pathname,\n                            const unsigned int inside );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>pathname:</dt>\n<dd>name of clipping path resource. If name is preceded by #, use\nclipping path numbered by name.</dd>\n<dt>inside:</dt>\n<dd>if non-zero, later operations take effect inside clipping path.\nOtherwise later operations take effect outside clipping path.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"compositepathimage\">\n<h1><a class=\"toc-backref\" href=\"#id79\">CompositePathImage</a></h1>\n<div class=\"section\" id=\"id18\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int CompositePathImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *pathname,\n                                 const unsigned int inside );\n</pre>\n</div>\n<div class=\"section\" id=\"id19\">\n<h2>Description</h2>\n<p>CompositePathImage() sets the image composite mask based any compositing path information\nif it exists.</p>\n<p>The format of the CompositePathImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int CompositePathImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *pathname,\n                                 const unsigned int inside );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>pathname:</dt>\n<dd>name of compositing path resource. If name is preceded by #, use\ncompositing path numbered by name.</dd>\n<dt>inside:</dt>\n<dd>if non-zero, later operations take effect inside compositing path.\nOtherwise later operations take effect outside compositing path.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"cloneimage\">\n<h1><a class=\"toc-backref\" href=\"#id80\">CloneImage</a></h1>\n<div class=\"section\" id=\"id20\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CloneImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns,\n                   const unsigned long rows, const unsigned int orphan,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id21\">\n<h2>Description</h2>\n<p>CloneImage() copies an image and returns the copy as a new image object.\nIf the specified columns and rows is 0, an exact copy of the image is\nreturned, otherwise the pixel data is undefined and must be initialized\nwith the SetImagePixels() and SyncImagePixels() methods.  On failure,\na NULL image is returned and exception describes the reason for the\nfailure.</p>\n<p>The format of the CloneImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CloneImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns,\n                   const unsigned long rows, const unsigned int orphan,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>columns:</dt>\n<dd>The number of columns in the cloned image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the cloned image.</dd>\n<dt>orphan:</dt>\n<dd>With a value other than 0, the cloned image is an orphan.  An\norphan is a stand-alone image that is not assocated with an image list.\nIn effect, the next and previous members of the cloned image is set to\nNULL.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"cloneimageinfo\">\n<h1><a class=\"toc-backref\" href=\"#id81\">CloneImageInfo</a></h1>\n<div class=\"section\" id=\"id22\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *CloneImageInfo( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id23\">\n<h2>Description</h2>\n<p>CloneImageInfo() makes a copy of the given image info structure.  If\nNULL is specified, a new image info structure is created initialized to\ndefault values.</p>\n<p>The format of the CloneImageInfo method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *CloneImageInfo( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroyimage\">\n<h1><a class=\"toc-backref\" href=\"#id82\">DestroyImage</a></h1>\n<div class=\"section\" id=\"id24\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id25\">\n<h2>Description</h2>\n<p>DestroyImage() dereferences an image, deallocating memory associated with\nthe image if the reference count becomes zero.  There is no effect if the\nimage pointer is null.</p>\n<p>The format of the DestroyImage method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroyimageinfo\">\n<h1><a class=\"toc-backref\" href=\"#id83\">DestroyImageInfo</a></h1>\n<div class=\"section\" id=\"id26\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyImageInfo( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id27\">\n<h2>Description</h2>\n<p>DestroyImageInfo() deallocates memory associated with a ImageInfo\nstructure.</p>\n<p>The format of the DestroyImageInfo method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyImageInfo( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"displayimages\">\n<h1><a class=\"toc-backref\" href=\"#id84\">DisplayImages</a></h1>\n<div class=\"section\" id=\"id28\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail DisplayImages( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id29\">\n<h2>Description</h2>\n<p>DisplayImages() displays an image sequence to any X window screen.  It\nreturns MagickPass if successful or MagickFail if not.  Check the\nexception member of image to determine the reason for any failure.</p>\n<p>The format of the DisplayImages method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail DisplayImages( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimageclipmask\">\n<h1><a class=\"toc-backref\" href=\"#id85\">GetImageClipMask</a></h1>\n<div class=\"section\" id=\"id30\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetImageClipMask( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id31\">\n<h2>Description</h2>\n<p>GetImageClipMask returns a reference-counted copy of the current image\nclip mask. This copy must be deallocated using DestroyImage() once it is\nno longer needed.  If the image does not have an associated clip mask,\nthen NULL is returned.  Use SetImageClipMask() to add a clip mask to an\nimage, or remove a clip mask.</p>\n<p>If a component of the clip mask is set to TransparentOpacity (maximum\nvalue) then the corresponding image pixel component will not be updated\nwhen SyncImagePixels() is applied. The clip mask may be used to constrain\nthe results of an image processing operation to a region of the image.\nRegions outside those allowed by the clip mask may be processed, but only\npixel quantums allowed by the clip mask will actually be updated.</p>\n<p>The clip mask protects the DirectClass pixels and PseudoClass pixel indexes\nfrom modification. The clip mask does <em>not</em> protect the image colormap since\nthe image colormap is globally shared by all pixels in a PseudoClass image.</p>\n<p>The format of the GetImageClipMask method is</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetImageClipMask( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A descripton of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Reason for failure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagecompositemask\">\n<h1><a class=\"toc-backref\" href=\"#id86\">GetImageCompositeMask</a></h1>\n<div class=\"section\" id=\"id32\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetImageCompositeMask( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id33\">\n<h2>Description</h2>\n<p>GetImageCompositeMask returns a reference-counted copy of the current image\ncomposite mask. This copy must be deallocated using DestroyImage() once it is\nno longer needed.  If the image does not have an associated composite mask,\nthen NULL is returned.  Use SetImageCompositeMask() to add a composite mask to an\nimage, or remove a composite mask.</p>\n<p>If a component of the composite mask is set to TransparentOpacity (maximum\nvalue) then the corresponding image pixel component will not be updated\nwhen SyncImagePixels() is applied. The composite mask may be used to constrain\nthe results of an image processing operation to a region of the image.\nRegions outside those allowed by the composite mask may be processed, but only\npixel quantums allowed by the composite mask will actually be updated.</p>\n<p>The composite mask protects the DirectClass pixels and PseudoClass pixel indexes\nfrom modification. The composite mask does <em>not</em> protect the image colormap since\nthe image colormap is globally shared by all pixels in a PseudoClass image.</p>\n<p>The format of the GetImageCompositeMask method is</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetImageCompositeMask( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A descripton of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Reason for failure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimageexception\">\n<h1><a class=\"toc-backref\" href=\"#id87\">GetImageException</a></h1>\n<div class=\"section\" id=\"id34\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid GetImageException( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id35\">\n<h2>Description</h2>\n<p>GetImageException() traverses an image sequence and returns any\nerror more severe than noted by the exception parameter.</p>\n<p>The format of the GetImageException method is:</p>\n<pre class=\"literal-block\">\nvoid GetImageException( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Specifies a pointer to a list of one or more images.</dd>\n<dt>exception:</dt>\n<dd>return the highest severity exception.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagegeometry\">\n<h1><a class=\"toc-backref\" href=\"#id88\">GetImageGeometry</a></h1>\n<div class=\"section\" id=\"id36\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nint GetImageGeometry( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *geometry,\n                      const unsigned int size_to_fit, <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *region_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id37\">\n<h2>Description</h2>\n<p>GetImageGeometry() returns a region as defined by the geometry string with\nrespect to the image and its gravity.</p>\n<p>The format of the GetImageGeometry method is:</p>\n<pre class=\"literal-block\">\nint GetImageGeometry( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *geometry,\n                      const unsigned int size_to_fit, <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *region_info );\n</pre>\n<dl class=\"docutils\">\n<dt>flags:</dt>\n<dd>Method GetImageGeometry returns a bitmask that indicates\nwhich of the four values were located in the geometry string.</dd>\n<dt>geometry:</dt>\n<dd>The geometry (e.g. 100x100+10+10).</dd>\n<dt>size_to_fit:</dt>\n<dd>A value other than 0 means to scale the region so it\nfits within the specified width and height.</dd>\n<dt>region_info:</dt>\n<dd>The region as defined by the geometry string with\nrespect to the image and its gravity.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimageinfo\">\n<h1><a class=\"toc-backref\" href=\"#id89\">GetImageInfo</a></h1>\n<div class=\"section\" id=\"id38\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid GetImageInfo( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id39\">\n<h2>Description</h2>\n<p>GetImageInfo() initializes image_info to default values.</p>\n<p>The format of the GetImageInfo method is:</p>\n<pre class=\"literal-block\">\nvoid GetImageInfo( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"istaintimage\">\n<h1><a class=\"toc-backref\" href=\"#id90\">IsTaintImage</a></h1>\n<div class=\"section\" id=\"id40\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int IsTaintImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id41\">\n<h2>Description</h2>\n<p>IsTaintImage() returns a value other than 0 if any pixel in the image\nhas been altered since it was first constituted.</p>\n<p>The format of the IsTaintImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int IsTaintImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"modifyimage\">\n<h1><a class=\"toc-backref\" href=\"#id91\">ModifyImage</a></h1>\n<div class=\"section\" id=\"id42\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nModifyImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id43\">\n<h2>Description</h2>\n<p>ModifyImage() ensures that there is only a single reference to the image\nto be modified, updating the provided image pointer to point to a clone of\nthe original image if necessary.</p>\n<p>The format of the ModifyImage method is:</p>\n<pre class=\"literal-block\">\nModifyImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"referenceimage\">\n<h1><a class=\"toc-backref\" href=\"#id92\">ReferenceImage</a></h1>\n<div class=\"section\" id=\"id44\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ReferenceImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id45\">\n<h2>Description</h2>\n<p>ReferenceImage() increments the reference count associated with an image\nreturning a pointer to the image.</p>\n<p>The format of the ReferenceImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ReferenceImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"removedefinitions\">\n<h1><a class=\"toc-backref\" href=\"#id93\">RemoveDefinitions</a></h1>\n<div class=\"section\" id=\"id46\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid RemoveDefinitions( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *options );\n</pre>\n</div>\n<div class=\"section\" id=\"id47\">\n<h2>Description</h2>\n<p>RemoveDefinitions() removes definitions from the current map of definitions\nin ImageInfo. Definitions may be used by coders/decoders that read and\nwrite images. RemoveDefinitions() returns true only if the specified keys\nare present in the map and are actually removed.</p>\n<p>The format of the RemoveDefinitions method is:</p>\n<pre class=\"literal-block\">\nvoid RemoveDefinitions( <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const char *options );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>keys:</dt>\n<dd>List of keys to remove from the definitions map. The\nformat of the string is &quot;key1,key2,...&quot;. A special key, '*', removes\nall the key/value pairs in the definitions map. This key always\nsucceeds.</dd>\n<dt>exception:</dt>\n<dd>Errors result in updates to this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"resetimagepage\">\n<h1><a class=\"toc-backref\" href=\"#id94\">ResetImagePage</a></h1>\n<div class=\"section\" id=\"id48\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ResetImagePage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *page );\n</pre>\n</div>\n<div class=\"section\" id=\"id49\">\n<h2>Description</h2>\n<p>ResetImagePage adjusts the current page canvas and position based on a\nrelative page specification.</p>\n<p>The format of the ResetImagePage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ResetImagePage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *page );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>page:</dt>\n<dd>Relative page offset adjustment</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimageex\">\n<h1><a class=\"toc-backref\" href=\"#id95\">SetImageEx</a></h1>\n<div class=\"section\" id=\"id50\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid SetImageEx( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> opacity, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id51\">\n<h2>Description</h2>\n<p>SetImageEx() sets the red, green, and blue components of each pixel to\nthe image background color and the opacity component to the specified\nlevel of transparency.  The background color is defined by the\nbackground_color member of the image.</p>\n<p>The format of the SetImageEx method is:</p>\n<pre class=\"literal-block\">\nvoid SetImageEx( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> opacity, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>opacity:</dt>\n<dd>Set each pixel to this level of transparency.</dd>\n<dt>exception:</dt>\n<dd>Report any exception here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimage\">\n<h1><a class=\"toc-backref\" href=\"#id96\">SetImage</a></h1>\n<div class=\"section\" id=\"id52\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid SetImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id53\">\n<h2>Description</h2>\n<p>SetImage() sets the red, green, and blue components of each pixel to\nthe image background color and the opacity component to the specified\nlevel of transparency.  The background color is defined by the\nbackground_color member of the image. Any exception is reported to\nthe image.</p>\n<p>The format of the SetImage method is:</p>\n<pre class=\"literal-block\">\nvoid SetImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> opacity );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>opacity:</dt>\n<dd>Set each pixel to this level of transparency.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimagecolor\">\n<h1><a class=\"toc-backref\" href=\"#id97\">SetImageColor</a></h1>\n<div class=\"section\" id=\"id54\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail SetImageColor( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *pixel );\n</pre>\n</div>\n<div class=\"section\" id=\"id55\">\n<h2>Description</h2>\n<p>SetImageColor() sets the red, green, blue and opacity components of each\npixel to those from a specified pixel value.</p>\n<p>The format of the SetImageColor method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail SetImageColor( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *pixel );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>pixel:</dt>\n<dd>Set each pixel in the image to this pixel's color and transparency.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimagecolorregion\">\n<h1><a class=\"toc-backref\" href=\"#id98\">SetImageColorRegion</a></h1>\n<div class=\"section\" id=\"id56\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail SetImageColorRegion( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, long x, long y, unsigned long width,\n                                    unsigned long height, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *pixel );\n</pre>\n</div>\n<div class=\"section\" id=\"id57\">\n<h2>Description</h2>\n<p>SetImageColorRegion() sets the red, green, blue and opacity components\nof each pixel in the specified region to those from a specified pixel\nvalue.  Please note that it is assumed that the pixel value is in\nthe same colorspace as the image.</p>\n<p>The format of the SetImageColorRegion method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail SetImageColorRegion( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, long x, long y, unsigned long width,\n                                    unsigned long height, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *pixel );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>pixel:</dt>\n<dd>Set each pixel in the image to this pixel's color and transparency.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimageclipmask\">\n<h1><a class=\"toc-backref\" href=\"#id99\">SetImageClipMask</a></h1>\n<div class=\"section\" id=\"id58\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int SetImageClipMask( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *clip_mask );\n</pre>\n</div>\n<div class=\"section\" id=\"id59\">\n<h2>Description</h2>\n<p>SetImageClipMask() associates a clip mask with the image.  The clip mask\nmust be the same dimensions as the image.</p>\n<p>If a component of the clip mask is set to TransparentOpacity (maximum\nvalue) then the corresponding image pixel component will not be updated\nwhen SyncImagePixels() is applied. The clip mask may be used to constrain\nthe results of an image processing operation to a region of the image.\nRegions outside those allowed by the clip mask may be processed, but only\npixel quantums allowed by the clip mask will actually be updated.</p>\n<p>The clip mask protects the DirectClass pixels and PseudoClass pixel indexes\nfrom modification. The clip mask does <em>not</em> protect the image colormap since\nthe image colormap is globally shared by all pixels in a PseudoClass image.</p>\n<p>The format of the SetImageClipMask method is:</p>\n<pre class=\"literal-block\">\nunsigned int SetImageClipMask( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *clip_mask );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>clip_mask:</dt>\n<dd>The image clip mask.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimagecompositemask\">\n<h1><a class=\"toc-backref\" href=\"#id100\">SetImageCompositeMask</a></h1>\n<div class=\"section\" id=\"id60\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int SetImageCompositeMask( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *composite_mask );\n</pre>\n</div>\n<div class=\"section\" id=\"id61\">\n<h2>Description</h2>\n<p>SetImageCompositeMask() associates a composite mask with the image.  The mask\nmust be the same dimensions as the image.</p>\n<p>If a component of the composite mask is set to TransparentOpacity (maximum\nvalue) then the corresponding image pixel component will not be updated\nwhen SyncImagePixels() is applied. The composite mask may be used to composite\nthe results of an image processing operation to a region of the image.\nRegions outside those allowed by the composite mask may be processed, but only\npixel quantums covered by the composite mask will actually be updated.</p>\n<p>The composite mask protects the DirectClass pixels and PseudoClass pixel indexes\nfrom modification. The composite mask does <em>not</em> protect the image colormap since\nthe image colormap is globally shared by all pixels in a PseudoClass image.</p>\n<p>The format of the SetImageCompositeMask method is:</p>\n<pre class=\"literal-block\">\nunsigned int SetImageCompositeMask( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *composite_mask );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>composite_mask:</dt>\n<dd>The image composite mask.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimagedepth\">\n<h1><a class=\"toc-backref\" href=\"#id101\">SetImageDepth</a></h1>\n<div class=\"section\" id=\"id62\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int SetImageDepth( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long depth );\n</pre>\n</div>\n<div class=\"section\" id=\"id63\">\n<h2>Description</h2>\n<p>SetImageDepth() translates the pixel quantums across all of the channels\nso that if they are later divided to fit within the specified bit\ndepth, that no additional information is lost (i.e. no remainder will\nresult from the division).  Note that any subsequent image processing is\nlikely to increase the effective depth of the image channels. A non-zero\nvalue is returned if the operation is successful. Check the exception\nmember of image to determine the cause for any failure.</p>\n<p>The format of the SetImageDepth method is:</p>\n<pre class=\"literal-block\">\nunsigned int SetImageDepth( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long depth );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image to update.</dd>\n<dt>depth:</dt>\n<dd>Desired image depth (range 1 to QuantumDepth)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimageopacity\">\n<h1><a class=\"toc-backref\" href=\"#id102\">SetImageOpacity</a></h1>\n<div class=\"section\" id=\"id64\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid SetImageOpacity( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id65\">\n<h2>Description</h2>\n<p>SetImageOpacity() attenuates the opacity channel of an image.  If the\nimage pixels are opaque, they are set to the specified opacity level.\nOtherwise, the pixel opacity values are blended with the supplied\ntransparency value.</p>\n<p>The format of the SetImageOpacity method is:</p>\n<pre class=\"literal-block\">\nvoid SetImageOpacity( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned int opacity );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>opacity:</dt>\n<dd>The level of transparency: 0 is fully opaque and MaxRGB is\nfully transparent.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimagetype\">\n<h1><a class=\"toc-backref\" href=\"#id103\">SetImageType</a></h1>\n<div class=\"section\" id=\"id66\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n( void )SetImageType( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> image_type );\n</pre>\n</div>\n<div class=\"section\" id=\"id67\">\n<h2>Description</h2>\n<p>(void) SetImageType() sets the type of image.  Choose from these types:</p>\n<p>BilevelType, GrayscaleType, GrayscaleMatteType, PaletteType,\nPaletteMatteType, TrueColorType, TrueColorMatteType,\nColorSeparationType, ColorSeparationMatteType, OptimizeType</p>\n<p>The format of the (void) SetImageType method is:</p>\n<pre class=\"literal-block\">\n( void )SetImageType( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> image_type );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>image_type:</dt>\n<dd>Image type.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"stripimage\">\n<h1><a class=\"toc-backref\" href=\"#id104\">StripImage</a></h1>\n<div class=\"section\" id=\"id68\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail StripImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id69\">\n<h2>Description</h2>\n<p>StripImage removes all profiles and text attributes from the image.</p>\n<p>The format of the StripImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail StripImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/import.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>import</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"import\">\n<h1 class=\"title\">import</h1>\n<h2 class=\"subtitle\" id=\"import-image-pixels-from-common-representations\">Import image pixels from common representations</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#importimagepixelarea\" id=\"id5\">ImportImagePixelArea</a></li>\n<li><a class=\"reference internal\" href=\"#importviewpixelarea\" id=\"id6\">ImportViewPixelArea</a></li>\n<li><a class=\"reference internal\" href=\"#importpixelareaoptionsinit\" id=\"id7\">ImportPixelAreaOptionsInit</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"importimagepixelarea\">\n<h1><a class=\"toc-backref\" href=\"#id5\">ImportImagePixelArea</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ImportImagePixelArea( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                                     const unsigned int quantum_size,\n                                     const unsigned char *source,\n                                     const ImportPixelAreaOptions *options,\n                                     ImportPixelAreaInfo *import_info );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>ImportImagePixelArea() transfers one or more pixel components from a user\nsupplied buffer into the default image pixel cache view. By default,\nvalues are read in network (big-endian) byte/bit order.  By setting the\n'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit values may\nbe output as little (LSBEndian), big (MSBEndian), or host native\n(NativeEndian) endian values.  This function is quite powerful in that\nbesides common native CPU type sizes, it can support any integer bit\ndepth from 1 to 32 (e.g. 13), 64-bits, as well as 32 and 64-bit float.</p>\n<p>MagickPass is returned if the pixels are successfully transferred,\notherwise MagickFail.</p>\n<p>The format of the ImportImagePixelArea method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ImportImagePixelArea( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                                     const unsigned int quantum_size,\n                                     const unsigned char *source,\n                                     const ImportPixelAreaOptions *options,\n                                     ImportPixelAreaInfo *import_info );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method PushImagePixels returns MagickPass if the pixels are\nsuccessfully transferred, otherwise MagickFail.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>quantum_type:</dt>\n<dd>Declare which pixel components to transfer (AlphaQuantum,\nBlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum,\nGrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum,\nIndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum,\nRedQuantum, YellowQuantum)</dd>\n<dt>quantum_size:</dt>\n<dd>Bits per quantum sample (range 1-32, and 64).</dd>\n<dt>source:</dt>\n<dd>The pixel components are transferred from this buffer.</dd>\n<dt>options:</dt>\n<dd>Additional options specific to quantum_type (may be NULL).</dd>\n<dt>import_info :</dt>\n<dd>Populated with information regarding the pixels\nimported (may be NULL)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"importviewpixelarea\">\n<h1><a class=\"toc-backref\" href=\"#id6\">ImportViewPixelArea</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ImportViewPixelArea( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                                    const unsigned int quantum_size,\n                                    const unsigned char *source,\n                                    const ImportPixelAreaOptions *options,\n                                    ImportPixelAreaInfo *import_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>ImportViewPixelArea() transfers one or more pixel components from a user\nsupplied buffer into the specified image pixel cache view of an image. By\ndefault, values are read in network (big-endian) byte/bit order.  By\nsetting the 'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit\nvalues may be output as little (LSBEndian), big (MSBEndian), or host\nnative (NativeEndian) endian values.  This function is quite powerful in\nthat besides common native CPU type sizes, it can support any integer bit\ndepth from 1 to 32 (e.g. 13), 64-bits, as well as 32 and 64-bit float.</p>\n<p>MagickPass is returned if the pixels are successfully transferred,\notherwise MagickFail.</p>\n<p>The format of the ImportViewPixelArea method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ImportViewPixelArea( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const <a class=\"reference external\" href=\"../api/types.html#quantumtype\">QuantumType</a> quantum_type,\n                                    const unsigned int quantum_size,\n                                    const unsigned char *source,\n                                    const ImportPixelAreaOptions *options,\n                                    ImportPixelAreaInfo *import_info );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method PushImagePixels returns MagickPass if the pixels are\nsuccessfully transferred, otherwise MagickFail.</dd>\n<dt>view:</dt>\n<dd>The pixel view to import pixels into.</dd>\n<dt>quantum_type:</dt>\n<dd>Declare which pixel components to transfer (AlphaQuantum,\nBlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum,\nGrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum,\nIndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum,\nRedQuantum, YellowQuantum)</dd>\n<dt>quantum_size:</dt>\n<dd>Bits per quantum sample (range 1-32, and 64).</dd>\n<dt>source:</dt>\n<dd>The pixel components are transferred from this buffer.</dd>\n<dt>options:</dt>\n<dd>Additional options specific to quantum_type (may be NULL).</dd>\n<dt>import_info :</dt>\n<dd>Populated with information regarding the pixels\nimported (may be NULL)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"importpixelareaoptionsinit\">\n<h1><a class=\"toc-backref\" href=\"#id7\">ImportPixelAreaOptionsInit</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid ImportPixelAreaOptionsInit( ImportPixelAreaOptions *options );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>ImportPixelAreaOptionsInit() initializes the options structure which is\noptionally passed to ImportPixelArea()</p>\n<p>The format of the ImportPixelAreaOptionsInit method is:</p>\n<pre class=\"literal-block\">\nvoid ImportPixelAreaOptionsInit( ImportPixelAreaOptions *options );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>options:</dt>\n<dd>Options structure to initialize.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/list.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>list</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"list\">\n<h1 class=\"title\">list</h1>\n<h2 class=\"subtitle\" id=\"image-list-support\">Image list support</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#appendimagetolist\" id=\"id41\">AppendImageToList</a></li>\n<li><a class=\"reference internal\" href=\"#cloneimagelist\" id=\"id42\">CloneImageList</a></li>\n<li><a class=\"reference internal\" href=\"#deleteimagefromlist\" id=\"id43\">DeleteImageFromList</a></li>\n<li><a class=\"reference internal\" href=\"#destroyimagelist\" id=\"id44\">DestroyImageList</a></li>\n<li><a class=\"reference internal\" href=\"#getfirstimageinlist\" id=\"id45\">GetFirstImageInList</a></li>\n<li><a class=\"reference internal\" href=\"#getimagefromlist\" id=\"id46\">GetImageFromList</a></li>\n<li><a class=\"reference internal\" href=\"#getimageindexinlist\" id=\"id47\">GetImageIndexInList</a></li>\n<li><a class=\"reference internal\" href=\"#getimagelistlength\" id=\"id48\">GetImageListLength</a></li>\n<li><a class=\"reference internal\" href=\"#getlastimageinlist\" id=\"id49\">GetLastImageInList</a></li>\n<li><a class=\"reference internal\" href=\"#getnextimageinlist\" id=\"id50\">GetNextImageInList</a></li>\n<li><a class=\"reference internal\" href=\"#getpreviousimageinlist\" id=\"id51\">GetPreviousImageInList</a></li>\n<li><a class=\"reference internal\" href=\"#imagelisttoarray\" id=\"id52\">ImageListToArray</a></li>\n<li><a class=\"reference internal\" href=\"#insertimageinlist\" id=\"id53\">InsertImageInList</a></li>\n<li><a class=\"reference internal\" href=\"#newimagelist\" id=\"id54\">NewImageList</a></li>\n<li><a class=\"reference internal\" href=\"#prependimagetolist\" id=\"id55\">PrependImageToList</a></li>\n<li><a class=\"reference internal\" href=\"#removefirstimagefromlist\" id=\"id56\">RemoveFirstImageFromList</a></li>\n<li><a class=\"reference internal\" href=\"#removelastimagefromlist\" id=\"id57\">RemoveLastImageFromList</a></li>\n<li><a class=\"reference internal\" href=\"#replaceimageinlist\" id=\"id58\">ReplaceImageInList</a></li>\n<li><a class=\"reference internal\" href=\"#reverseimagelist\" id=\"id59\">ReverseImageList</a></li>\n<li><a class=\"reference internal\" href=\"#spliceimageintolist\" id=\"id60\">SpliceImageIntoList</a></li>\n<li><a class=\"reference internal\" href=\"#splitimagelist\" id=\"id61\">SplitImageList</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"appendimagetolist\">\n<h1><a class=\"toc-backref\" href=\"#id41\">AppendImageToList</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nAppendImageToList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>AppendImageToList() appends an image to the end of the list.</p>\n<p>The format of the AppendImageToList method is:</p>\n<pre class=\"literal-block\">\nAppendImageToList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"cloneimagelist\">\n<h1><a class=\"toc-backref\" href=\"#id42\">CloneImageList</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CloneImageList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>CloneImageList() returns a duplicate of the image list.</p>\n<p>The format of the CloneImageList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CloneImageList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"deleteimagefromlist\">\n<h1><a class=\"toc-backref\" href=\"#id43\">DeleteImageFromList</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nDeleteImageFromList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>DeleteImageFromList() deletes an image from the list.</p>\n<p>The format of the DeleteImageFromList method is:</p>\n<pre class=\"literal-block\">\nDeleteImageFromList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroyimagelist\">\n<h1><a class=\"toc-backref\" href=\"#id44\">DestroyImageList</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyImageList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>DestroyImageList() destroys an image list.  There is no effect if the\nimage pointer is null.</p>\n<p>The format of the DestroyImageList method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyImageList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image sequence.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getfirstimageinlist\">\n<h1><a class=\"toc-backref\" href=\"#id45\">GetFirstImageInList</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetFirstImageInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>GetFirstImageInList() returns a pointer to the first image in the list</p>\n<p>The format of the GetFirstImageInList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetFirstImageInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagefromlist\">\n<h1><a class=\"toc-backref\" href=\"#id46\">GetImageFromList</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetImageFromList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, const long offset );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>GetImageFromList() returns an image at the specified offset from the list.</p>\n<p>The format of the GetImageFromList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetImageFromList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, const long offset );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n<dt>offset:</dt>\n<dd>The position within the list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimageindexinlist\">\n<h1><a class=\"toc-backref\" href=\"#id47\">GetImageIndexInList</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nlong GetImageIndexInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>GetImageIndexInList() returns the offset in the list of the specified image.</p>\n<p>The format of the GetImageIndexInList method is:</p>\n<pre class=\"literal-block\">\nlong GetImageIndexInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagelistlength\">\n<h1><a class=\"toc-backref\" href=\"#id48\">GetImageListLength</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long GetImageListLength( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>GetImageListLength() returns the length of the list (the number of images in\nthe list).</p>\n<p>The format of the GetImageListLength method is:</p>\n<pre class=\"literal-block\">\nunsigned long GetImageListLength( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getlastimageinlist\">\n<h1><a class=\"toc-backref\" href=\"#id49\">GetLastImageInList</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetLastImageInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>GetLastImageInList() returns a pointer to the last image in the list</p>\n<p>The format of the GetLastImageInList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetLastImageInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getnextimageinlist\">\n<h1><a class=\"toc-backref\" href=\"#id50\">GetNextImageInList</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetNextImageInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>GetNextImageInList() returns the next image in the list.</p>\n<p>The format of the GetNextImageInList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetNextImageInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getpreviousimageinlist\">\n<h1><a class=\"toc-backref\" href=\"#id51\">GetPreviousImageInList</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetPreviousImageInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>GetPreviousImageInList() returns the previous image in the list.</p>\n<p>The format of the GetPreviousImageInList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetPreviousImageInList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"imagelisttoarray\">\n<h1><a class=\"toc-backref\" href=\"#id52\">ImageListToArray</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** ImageListToArray( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>ImageListToArray() is a convenience method that converts an image list to\na sequential array.  For example,</p>\n<p>group = ImageListToArray(images, exception);\nfor (i = 0; i &lt; n; i++)\nputs(group[i]-&gt;filename);</p>\n<p>The format of the ImageListToArray method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** ImageListToArray( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image list.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"insertimageinlist\">\n<h1><a class=\"toc-backref\" href=\"#id53\">InsertImageInList</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nInsertImageInList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>InsertImageInList() inserts an image in the list.</p>\n<p>The format of the InsertImageInList method is:</p>\n<pre class=\"literal-block\">\nInsertImageInList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"newimagelist\">\n<h1><a class=\"toc-backref\" href=\"#id54\">NewImageList</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *NewImageList( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>NewImageList() creates an empty image list.</p>\n<p>The format of the NewImageList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *NewImageList( void );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"prependimagetolist\">\n<h1><a class=\"toc-backref\" href=\"#id55\">PrependImageToList</a></h1>\n<div class=\"section\" id=\"id27\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nPrependImageToList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id28\">\n<h2>Description</h2>\n<p>PrependImageToList() prepends the image to the beginning of the list.</p>\n<p>The format of the PrependImageToList method is:</p>\n<pre class=\"literal-block\">\nPrependImageToList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"removefirstimagefromlist\">\n<h1><a class=\"toc-backref\" href=\"#id56\">RemoveFirstImageFromList</a></h1>\n<div class=\"section\" id=\"id29\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *RemoveFirstImageFromList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images );\n</pre>\n</div>\n<div class=\"section\" id=\"id30\">\n<h2>Description</h2>\n<p>RemoveFirstImageFromList() removes an image from the beginning of the list.</p>\n<p>The format of the RemoveFirstImageFromList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *RemoveFirstImageFromList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"removelastimagefromlist\">\n<h1><a class=\"toc-backref\" href=\"#id57\">RemoveLastImageFromList</a></h1>\n<div class=\"section\" id=\"id31\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *RemoveLastImageFromList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images );\n</pre>\n</div>\n<div class=\"section\" id=\"id32\">\n<h2>Description</h2>\n<p>RemoveLastImageFromList() removes the last image from the list.</p>\n<p>The format of the RemoveLastImageFromList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *RemoveLastImageFromList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"replaceimageinlist\">\n<h1><a class=\"toc-backref\" href=\"#id58\">ReplaceImageInList</a></h1>\n<div class=\"section\" id=\"id33\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nReplaceImageInList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id34\">\n<h2>Description</h2>\n<p>ReplaceImageInList() replaces an image in the list.</p>\n<p>The format of the ReplaceImageInList method is:</p>\n<pre class=\"literal-block\">\nReplaceImageInList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"reverseimagelist\">\n<h1><a class=\"toc-backref\" href=\"#id59\">ReverseImageList</a></h1>\n<div class=\"section\" id=\"id35\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nReverseImageList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images );\n</pre>\n</div>\n<div class=\"section\" id=\"id36\">\n<h2>Description</h2>\n<p>ReverseImageList() reverses the image list.</p>\n<p>The format of the ReverseImageList method is:</p>\n<pre class=\"literal-block\">\nReverseImageList( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"spliceimageintolist\">\n<h1><a class=\"toc-backref\" href=\"#id60\">SpliceImageIntoList</a></h1>\n<div class=\"section\" id=\"id37\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nSpliceImageIntoList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images, const unsigned long length, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *splice );\n</pre>\n</div>\n<div class=\"section\" id=\"id38\">\n<h2>Description</h2>\n<p>SpliceImageIntoList() removes 'length' images from the list and replaces\nthem with the specified splice.</p>\n<p>The format of the SpliceImageIntoList method is:</p>\n<pre class=\"literal-block\">\nSpliceImageIntoList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** images, const unsigned long length, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *splice );\n</pre>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n<dt>length:</dt>\n<dd>The length of the image list to remove.</dd>\n<dt>splice:</dt>\n<dd>Replace the removed image list with this list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"splitimagelist\">\n<h1><a class=\"toc-backref\" href=\"#id61\">SplitImageList</a></h1>\n<div class=\"section\" id=\"id39\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SplitImageList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"id40\">\n<h2>Description</h2>\n<p>SplitImageList() splits an image into two lists.</p>\n<p>The format of the SplitImageList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SplitImageList( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>The image list.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/magick.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>magick</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick\">\n<h1 class=\"title\">magick</h1>\n<h2 class=\"subtitle\" id=\"image-format-support-interfaces\">Image format support interfaces</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#destroymagick\" id=\"id31\">DestroyMagick</a></li>\n<li><a class=\"reference internal\" href=\"#destroymagickinfo\" id=\"id32\">DestroyMagickInfo</a></li>\n<li><a class=\"reference internal\" href=\"#destroymagickinfolist\" id=\"id33\">DestroyMagickInfoList</a></li>\n<li><a class=\"reference internal\" href=\"#getimagemagick\" id=\"id34\">GetImageMagick</a></li>\n<li><a class=\"reference internal\" href=\"#getmagickinfo\" id=\"id35\">GetMagickInfo</a></li>\n<li><a class=\"reference internal\" href=\"#getmagickinfoarray\" id=\"id36\">GetMagickInfoArray</a></li>\n<li><a class=\"reference internal\" href=\"#initializemagick\" id=\"id37\">InitializeMagick</a></li>\n<li><a class=\"reference internal\" href=\"#initializemagickex\" id=\"id38\">InitializeMagickEx</a></li>\n<li><a class=\"reference internal\" href=\"#ismagickconflict\" id=\"id39\">IsMagickConflict</a></li>\n<li><a class=\"reference internal\" href=\"#listmagickinfo\" id=\"id40\">ListMagickInfo</a></li>\n<li><a class=\"reference internal\" href=\"#listmodulemap\" id=\"id41\">ListModuleMap</a></li>\n<li><a class=\"reference internal\" href=\"#magicktomime\" id=\"id42\">MagickToMime</a></li>\n<li><a class=\"reference internal\" href=\"#registermagickinfo\" id=\"id43\">RegisterMagickInfo</a></li>\n<li><a class=\"reference internal\" href=\"#panicdestroymagick\" id=\"id44\">PanicDestroyMagick</a></li>\n<li><a class=\"reference internal\" href=\"#setmagickinfo\" id=\"id45\">SetMagickInfo</a></li>\n<li><a class=\"reference internal\" href=\"#unregistermagickinfo\" id=\"id46\">UnregisterMagickInfo</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"destroymagick\">\n<h1><a class=\"toc-backref\" href=\"#id31\">DestroyMagick</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nDestroyMagick( void );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>DestroyMagick() destroys the GraphicsMagick environment, releasing all\nallocated semaphores, memory, and temporary files.  This function\nshould be invoked in the primary (original) thread of the application's\nprocess while shutting down, and only after any threads which might be\nusing GraphicsMagick functions have terminated.  Since GraphicsMagick\nuses threads internally via OpenMP, it is also necessary for any function\ncalls into GraphicsMagick to have already returned so that OpenMP worker\nthreads are quiesced and won't be accessing any semaphores or data\nstructures which are destroyed by this function.</p>\n<p>The format of the DestroyMagick function is:</p>\n<pre class=\"literal-block\">\nDestroyMagick( void );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"destroymagickinfo\">\n<h1><a class=\"toc-backref\" href=\"#id32\">DestroyMagickInfo</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyMagickInfo( <a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> ** magick_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>DestroyMagickInfo() destroys a MagickInfo structure.</p>\n<p>The format of the DestroyMagickInfoList method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyMagickInfo( <a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> ** magick_info );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"destroymagickinfolist\">\n<h1><a class=\"toc-backref\" href=\"#id33\">DestroyMagickInfoList</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyMagickInfoList( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>DestroyMagickInfo() deallocates memory associated with the MagickInfo list.</p>\n<p>The format of the DestroyMagickInfoList method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyMagickInfoList( void );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"getimagemagick\">\n<h1><a class=\"toc-backref\" href=\"#id34\">GetImageMagick</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *GetImageMagick( const unsigned char *magick, const size_t length );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>GetImageMagick() searches for an image format that matches the specified\nmagick string.  If one is found the name is returned otherwise NULL.</p>\n<p>The format of the GetImageMagick method is:</p>\n<pre class=\"literal-block\">\nconst char *GetImageMagick( const unsigned char *magick, const size_t length );\n</pre>\n<dl class=\"docutils\">\n<dt>magick:</dt>\n<dd>The image format we are searching for.</dd>\n<dt>length:</dt>\n<dd>The length of the binary string.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getmagickinfo\">\n<h1><a class=\"toc-backref\" href=\"#id35\">GetMagickInfo</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst <a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> *GetMagickInfo( const char *name, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>GetMagickInfo() returns a pointer MagickInfo structure that matches\nthe specified name.  If name is NULL, the head of the image format list\nis returned. It is not safe to traverse the list by using the previous and\nnext pointers in the MagickInfo structure since the list contents or order\nmay be altered while the list is being traversed. If the list must be\ntraversed, access it via the GetMagickInfoArray function instead.</p>\n<p>If GraphicsMagick has not been initialized via InitializeMagick()\nthen this function will not work.</p>\n<p>The format of the GetMagickInfo method is:</p>\n<pre class=\"literal-block\">\nconst <a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> *GetMagickInfo( const char *name, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>name:</dt>\n<dd>The image format we are looking for.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getmagickinfoarray\">\n<h1><a class=\"toc-backref\" href=\"#id36\">GetMagickInfoArray</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> ** GetMagickInfoArray( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>GetMagickInfoArray() returns a sorted null-terminated array of MagickInfo\npointers corresponding to the available format registrations. If necessarly\nall modules are loaded in order to return a complete list. This function\nshould be used to access the entire list rather than GetMagickInfo since\nthe list returned by GetMagickInfo may be re-ordered every time it is\ninvoked. Once the returned array is no longer needed, the allocated array\nshould be deallocated. Do not attempt to deallocate the MagickInfo\nstructures based on pointers in the array!</p>\n<p>The format of the GetMagickList method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> ** GetMagickInfoArray( <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"initializemagick\">\n<h1><a class=\"toc-backref\" href=\"#id37\">InitializeMagick</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nInitializeMagick( const char *path );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>InitializeMagick() initializes the GraphicsMagick environment.</p>\n<p>InitializeMagick() or InitializeMagickEx() MUST be invoked by the using\nprogram before making use of GraphicsMagick functions or else the library\nwill be unusable and any usage is likely to cause a crash.</p>\n<p>This function should be invoked in the primary (original) thread of the\napplication's process, and before starting any OpenMP threads, as part\nof program initialization.</p>\n<p>If alternate memory allocations are provided via MagickAllocFunctions()\nthen that function should be invoked before InitializeMagickEx() since\nthe memory allocation functions need to be consistent.</p>\n<p>The format of the InitializeMagick function is:</p>\n<pre class=\"literal-block\">\nInitializeMagick( const char *path );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>path:</dt>\n<dd>The execution path of the current GraphicsMagick client (or NULL)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"initializemagickex\">\n<h1><a class=\"toc-backref\" href=\"#id38\">InitializeMagickEx</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail InitializeMagickEx( const char *path, unsigned int options,\n                                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>InitializeMagickEx() initializes the GraphicsMagick environment,\nproviding a bit more more control and visibility over initialization\nthan the original InitializeMagick().</p>\n<p>InitializeMagick() or InitializeMagickEx() MUST be invoked by the using\nprogram before making use of GraphicsMagick functions or else the library\nwill be unusable and any usage is likely to cause a crash.</p>\n<p>This function should be invoked in the primary (original) thread of the\napplication's process, and before starting any OpenMP threads, as part\nof program initialization.</p>\n<p>If alternate memory allocations are provided via MagickAllocFunctions()\nthen that function should be invoked before InitializeMagickEx() since\nthe memory allocation functions need to be consistent.</p>\n<p>The format of the InitializeMagickEx function is:</p>\n<pre class=\"literal-block\">\nMagickPassFail InitializeMagickEx( const char *path, unsigned int options,\n                                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>path:</dt>\n<dd>The execution path of the current GraphicsMagick client (or NULL)</dd>\n<dt>options:</dt>\n<dd>Options flags tailoring initializations performed</dd>\n<dt>exception:</dt>\n<dd>Information about initialization failure is reported here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"ismagickconflict\">\n<h1><a class=\"toc-backref\" href=\"#id39\">IsMagickConflict</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickBool IsMagickConflict( const char *magick );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>Method IsMagickConflict returns true if the image format conflicts with\na logical drive (.e.g. X:).</p>\n<p>The format of the IsMagickConflict method is:</p>\n<pre class=\"literal-block\">\nMagickBool IsMagickConflict( const char *magick );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method IsMagickConflict returns true if the image format\nconflicts with a logical drive.</dd>\n<dt>magick:</dt>\n<dd>Specifies the image format.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"listmagickinfo\">\n<h1><a class=\"toc-backref\" href=\"#id40\">ListMagickInfo</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ListMagickInfo( FILE *file, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>ListMagickInfo() lists the image formats to a file.</p>\n<p>The format of the ListMagickInfo method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ListMagickInfo( FILE *file, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows.</p>\n<dl class=\"docutils\">\n<dt>file:</dt>\n<dd>A file handle.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"listmodulemap\">\n<h1><a class=\"toc-backref\" href=\"#id41\">ListModuleMap</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ListModuleMap( FILE *file, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>Method ListModuleMap lists the module alias info to a file in the XML\nformat used by modules.mgk. True is returned on success.</p>\n<p>The format of the ListModuleMap method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ListModuleMap( FILE *file, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows.</p>\n<dl class=\"docutils\">\n<dt>file:</dt>\n<dd>An pointer to a FILE.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicktomime\">\n<h1><a class=\"toc-backref\" href=\"#id42\">MagickToMime</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *MagickToMime( const char *magick );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>Method MagickToMime returns the officially registered (or de facto) MIME\nmedia-type corresponding to a magick string.  If there is no registered\nmedia-type, then the string &quot;image/x-magick&quot; (all lower case) is returned.\nThe returned string must be deallocated by the user.</p>\n<p>The format of the MagickToMime method is:</p>\n<pre class=\"literal-block\">\nchar *MagickToMime( const char *magick );\n</pre>\n<p>A description of each parameter follows.</p>\n<dl class=\"docutils\">\n<dt>magick:</dt>\n<dd>GraphicsMagick format specification &quot;magick&quot; tag.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"registermagickinfo\">\n<h1><a class=\"toc-backref\" href=\"#id43\">RegisterMagickInfo</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> *RegisterMagickInfo( <a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> *magick_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>RegisterMagickInfo() adds attributes for a particular image format to the\nlist of supported formats.  The attributes include the image format name,\na method to read and/or write the format, whether the format supports the\nsaving of more than one frame to the same file or blob, whether the format\nsupports native in-memory I/O, and a brief description of the format.</p>\n<p>The format of the RegisterMagickInfo method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> *RegisterMagickInfo( <a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> *magick_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>magick_info:</dt>\n<dd>The magick info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"panicdestroymagick\">\n<h1><a class=\"toc-backref\" href=\"#id44\">PanicDestroyMagick</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid PanicDestroyMagick( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>PanicDestroyMagick() destroys only persistent allocations such as\ntemporary files.  Other allocations (e.g. semaphores and heap memory)\nremain allocated.  This function is an alternative to DestroyMagick()\nwhich is async-safe so it may be invoked from signal handers, and\nmay be invoked from thread context.  No semaphores are taken and no\nadditional heap memory is allocated by this function.  The program\nmust quit immediately after invoking this function.</p>\n<p>The format of the PanicDestroyMagick function is:</p>\n<pre class=\"literal-block\">\nvoid PanicDestroyMagick( void );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"setmagickinfo\">\n<h1><a class=\"toc-backref\" href=\"#id45\">SetMagickInfo</a></h1>\n<div class=\"section\" id=\"id27\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> *SetMagickInfo( const char *name );\n</pre>\n</div>\n<div class=\"section\" id=\"id28\">\n<h2>Description</h2>\n<p>Method SetMagickInfo allocates a MagickInfo structure and initializes the\nmembers to default values.</p>\n<p>The format of the SetMagickInfo method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#magickinfo\">MagickInfo</a> *SetMagickInfo( const char *name );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>magick_info:</dt>\n<dd>Method SetMagickInfo returns the allocated and initialized\nMagickInfo structure.</dd>\n<dt>name:</dt>\n<dd>a character string that represents the image format associated\nwith the MagickInfo structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"unregistermagickinfo\">\n<h1><a class=\"toc-backref\" href=\"#id46\">UnregisterMagickInfo</a></h1>\n<div class=\"section\" id=\"id29\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int UnregisterMagickInfo( const char *name );\n</pre>\n</div>\n<div class=\"section\" id=\"id30\">\n<h2>Description</h2>\n<p>Method UnregisterMagickInfo removes a name from the magick info list.  It\nreturns MagickFail if the name does not exist in the list otherwise\nMagickPass.</p>\n<p>The format of the UnregisterMagickInfo method is:</p>\n<pre class=\"literal-block\">\nunsigned int UnregisterMagickInfo( const char *name );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method UnregisterMagickInfo returns False if the name does not\nexist in the list otherwise True.</dd>\n<dt>name:</dt>\n<dd>a character string that represents the image format we are\nlooking for.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/memory.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>memory</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"memory\">\n<h1 class=\"title\">memory</h1>\n<h2 class=\"subtitle\" id=\"memory-allocation-deallocation-functions\">Memory allocation/deallocation functions</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#magickallocfunctions\" id=\"id15\">MagickAllocFunctions</a></li>\n<li><a class=\"reference internal\" href=\"#magickmalloc\" id=\"id16\">MagickMalloc</a></li>\n<li><a class=\"reference internal\" href=\"#magickmallocaligned\" id=\"id17\">MagickMallocAligned</a></li>\n<li><a class=\"reference internal\" href=\"#magickmalloccleared\" id=\"id18\">MagickMallocCleared</a></li>\n<li><a class=\"reference internal\" href=\"#magickclonememory\" id=\"id19\">MagickCloneMemory</a></li>\n<li><a class=\"reference internal\" href=\"#magickrealloc\" id=\"id20\">MagickRealloc</a></li>\n<li><a class=\"reference internal\" href=\"#magickfree\" id=\"id21\">MagickFree</a></li>\n<li><a class=\"reference internal\" href=\"#magickfreealigned\" id=\"id22\">MagickFreeAligned</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"magickallocfunctions\">\n<h1><a class=\"toc-backref\" href=\"#id15\">MagickAllocFunctions</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickAllocFunctions( MagickFreeFunc free_func, MagickMallocFunc malloc_func,\n                           MagickReallocFunc realloc_func );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>MagickAllocFunctions() provides a way for the user to supply a preferred\nfree(), malloc(), and realloc() functions.  Otherwise the default system\nversions are used.  If an alternative allocator is to be used, this\nfunction should be invoked prior to invoking InitializeMagick().</p>\n<p>The format of the  MagickAllocFunctions method is:</p>\n<pre class=\"literal-block\">\nvoid MagickAllocFunctions( MagickFreeFunc free_func, MagickMallocFunc malloc_func,\n                           MagickReallocFunc realloc_func );\n</pre>\n<dl class=\"docutils\">\n<dt>free_func:</dt>\n<dd>Function to free memory.</dd>\n<dt>malloc_func:</dt>\n<dd>Function to allocate memory.</dd>\n<dt>realloc_func:</dt>\n<dd>Function to reallocate memory.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmalloc\">\n<h1><a class=\"toc-backref\" href=\"#id16\">MagickMalloc</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *MagickMalloc( const size_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>MagickMalloc() returns a pointer to a block of memory of at least size\nbytes suitably aligned for any use.  NULL is returned if insufficient\nmemory is available or the requested size is zero.</p>\n<p>The format of the  MagickMalloc method is:</p>\n<pre class=\"literal-block\">\nvoid *MagickMalloc( const size_t size );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>size:</dt>\n<dd>The size of the memory in bytes to allocate.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmallocaligned\">\n<h1><a class=\"toc-backref\" href=\"#id17\">MagickMallocAligned</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *MagickMallocAligned( size_t alignment, const size_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>MagickMallocAligned() allocates memory and returns a pointer to a\nblock of memory capable of storing at least size bytes with the\nallocation's base address being an even multiple of alignment.\nThe size of the buffer allocation is rounded up as required in\norder to consume a block of memory starting at least at the requested\nalignment and ending at at least the requested alignment.</p>\n<p>The requested alignment should be a power of 2 at least as large as\nsizeof a void pointer.</p>\n<p>NULL is returned if insufficient memory is available, the requested\nsize is zero, or integer overflow was detected.</p>\n<p>This function is intended for allocating special-purpose buffers\nwhich benefit from specific alignment.</p>\n<p>The allocated memory should only be freed using MagickFreeAligned()\nand may not be reallocated.</p>\n<p>The format of the  MagickMallocAligned method is:</p>\n<pre class=\"literal-block\">\nvoid *MagickMallocAligned( size_t alignment, const size_t size );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>alignment:</dt>\n<dd>The alignment of the base and size of the allocated\nmemory.</dd>\n<dt>size:</dt>\n<dd>The size of the memory in bytes to allocate.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmalloccleared\">\n<h1><a class=\"toc-backref\" href=\"#id18\">MagickMallocCleared</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *MagickMallocCleared( const size_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>MagickMallocCleared() returns a pointer to a block of memory of at least\nsize bytes suitably aligned for any use.  NULL is returned if insufficient\nmemory is available or the requested size is zero.  This version differs\nfrom MagickMalloc in that the allocated bytes are cleared to zero.</p>\n<p>The format of the  MagickMallocCleared method is:</p>\n<pre class=\"literal-block\">\nvoid *MagickMallocCleared( const size_t size );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>size:</dt>\n<dd>The size of the memory in bytes to allocate.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickclonememory\">\n<h1><a class=\"toc-backref\" href=\"#id19\">MagickCloneMemory</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *MagickCloneMemory( void *destination, const void *source, const size_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>MagickCloneMemory() copies size bytes from memory area source to the\ndestination.  Copying between objects that overlap will take place\ncorrectly.  It returns destination.</p>\n<p>The format of the MagickCloneMemory method is:</p>\n<pre class=\"literal-block\">\nvoid *MagickCloneMemory( void *destination, const void *source, const size_t size );\n</pre>\n<dl class=\"docutils\">\n<dt>size:</dt>\n<dd>The size of the memory in bytes to allocate.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickrealloc\">\n<h1><a class=\"toc-backref\" href=\"#id20\">MagickRealloc</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid *MagickRealloc( void *memory, const size_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>MagickRealloc() changes the size of the memory and returns a pointer to\nthe (possibly moved) block.  The contents will be unchanged up to the\nlesser of the new and old sizes.  If size is zero, then the memory is\nfreed and a NULL value is returned.  If the memory allocation fails, then\nthe existing memory is freed, and a NULL value is returned.</p>\n<p>Note that the behavior of this function is similar to BSD reallocf(3),\nsee <a class=\"reference external\" href=\"https://www.freebsd.org/cgi/man.cgi?query=reallocf\">https://www.freebsd.org/cgi/man.cgi?query=reallocf</a></p>\n<p>The format of the MagickRealloc method is:</p>\n<pre class=\"literal-block\">\nvoid *MagickRealloc( void *memory, const size_t size );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>memory:</dt>\n<dd>A pointer to a memory allocation.</dd>\n<dt>size:</dt>\n<dd>The new size of the allocated memory.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickfree\">\n<h1><a class=\"toc-backref\" href=\"#id21\">MagickFree</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickFree( void *memory );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>MagickFree() frees memory that has already been allocated by\nMagickMalloc() or other other other allocators directly compatible\nwith the currently defined memory allocator (which defaults to the\nsystem malloc()). For convenience, a NULL argument is ignored.</p>\n<p>The format of the MagickFree method is:</p>\n<pre class=\"literal-block\">\nvoid MagickFree( void *memory );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>memory:</dt>\n<dd>A pointer to a block of memory to free for reuse.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickfreealigned\">\n<h1><a class=\"toc-backref\" href=\"#id22\">MagickFreeAligned</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickFreeAligned( void *memory );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>MagickFreeAligned() frees aligned memory that has previously been\nallocated via MagickMallocAligned(). For convenience, a NULL argument is\nignored.</p>\n<p>This function exists in case the pointer allocated by\nMagickMallocAligned() can not be used directly with MagickFree().</p>\n<p>The format of the MagickFreeAligned method is:</p>\n<pre class=\"literal-block\">\nvoid MagickFreeAligned( void *memory );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>memory:</dt>\n<dd>A pointer to a block of memory to free for reuse.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/monitor.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>monitor</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"monitor\">\n<h1 class=\"title\">monitor</h1>\n<h2 class=\"subtitle\" id=\"progress-monitor-support\">Progress monitor support</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#magickmonitor\" id=\"id5\">MagickMonitor</a></li>\n<li><a class=\"reference internal\" href=\"#magickmonitorformatted\" id=\"id6\">MagickMonitorFormatted</a></li>\n<li><a class=\"reference internal\" href=\"#setmonitorhandler\" id=\"id7\">SetMonitorHandler</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"magickmonitor\">\n<h1><a class=\"toc-backref\" href=\"#id5\">MagickMonitor</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail MagickMonitor( const char *text, const magick_int64_t quantum,\n                              const magick_uint64_t span, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>MagickMonitor() calls the monitor handler method with a text string that\ndescribes the task and a measure of completion.  The method returns True\non success otherwise False if an error is encountered, e.g. if there was a\nuser interrupt.</p>\n<p>This function is deprecated.  Please use MagickMonitorFormatted() instead.</p>\n<p>The format of the MagickMonitor method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail MagickMonitor( const char *text, const magick_int64_t quantum,\n                              const magick_uint64_t span, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>text:</dt>\n<dd>Description of the task being performed.</dd>\n<dt>quantum:</dt>\n<dd>The position relative to the span parameter which represents\nhow much progress has been made toward completing a task.</dd>\n<dt>span:</dt>\n<dd>The span relative to completing a task.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmonitorformatted\">\n<h1><a class=\"toc-backref\" href=\"#id6\">MagickMonitorFormatted</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail MagickMonitorFormatted( const magick_int64_t quantum,\n                                       const magick_uint64_t span,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception, const char *format,\n                                       ... );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>MagickMonitorFormatted() calls the monitor handler method with a\nprintf type format specification and variable argument list.  Also\npassed are quantum and span values which provide a measure of\ncompletion.  The method returns MagickPass on success otherwise\nMagickFail if an error is encountered, e.g. if there was a user\ninterrupt.  If MagickFail is returned, the calling code is expected\nto terminate whatever is being monitored as soon as possible.</p>\n<p>Most callers of this function will use the QuantumTick() macro to\ndecide when it should be called.  The QuantumTick() macro is designed\nto deliver no more than 100 events in a span (representing 1-100%)\nand to distribute events as evenly as possible over the span so that\nevents are reported for every 1% of progress when possible.</p>\n<p>The format of the MagickMonitorFormatted method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail MagickMonitorFormatted( const magick_int64_t quantum,\n                                       const magick_uint64_t span,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception, const char *format,\n                                       ... );\n</pre>\n<dl class=\"docutils\">\n<dt>quantum:</dt>\n<dd>The position relative to the span parameter which represents\nhow much progress has been made toward completing a task.</dd>\n<dt>span:</dt>\n<dd>The span relative to completing a task.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n<dt>format:</dt>\n<dd>A string describing the format to use to write the remaining\narguments.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setmonitorhandler\">\n<h1><a class=\"toc-backref\" href=\"#id7\">SetMonitorHandler</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#monitorhandler\">MonitorHandler</a> SetMonitorHandler( <a class=\"reference external\" href=\"../api/types.html#monitorhandler\">MonitorHandler</a> handler );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>SetMonitorHandler() sets the monitor handler to the specified method\nand returns the previous monitor handler.</p>\n<p>The format of the SetMonitorHandler method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#monitorhandler\">MonitorHandler</a> SetMonitorHandler( <a class=\"reference external\" href=\"../api/types.html#monitorhandler\">MonitorHandler</a> handler );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>handler:</dt>\n<dd>Specifies a pointer to a method to handle monitors.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/montage.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>montage</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"montage\">\n<h1 class=\"title\">montage</h1>\n<h2 class=\"subtitle\" id=\"create-a-thumbnail-image-mosaic\">Create a thumbnail image mosaic</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#clonemontageinfo\" id=\"id7\">CloneMontageInfo</a></li>\n<li><a class=\"reference internal\" href=\"#destroymontageinfo\" id=\"id8\">DestroyMontageInfo</a></li>\n<li><a class=\"reference internal\" href=\"#getmontageinfo\" id=\"id9\">GetMontageInfo</a></li>\n<li><a class=\"reference internal\" href=\"#montageimages\" id=\"id10\">MontageImages</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"clonemontageinfo\">\n<h1><a class=\"toc-backref\" href=\"#id7\">CloneMontageInfo</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *CloneMontageInfo( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info,\n                               const <a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *montage_info );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>CloneMontageInfo() makes a copy of the given montage info structure.  If\nNULL is specified, a new image info structure is created initialized to\ndefault values.</p>\n<p>The format of the CloneMontageInfo method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *CloneMontageInfo( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info,\n                               const <a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *montage_info );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>montage_info:</dt>\n<dd>The montage info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroymontageinfo\">\n<h1><a class=\"toc-backref\" href=\"#id8\">DestroyMontageInfo</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyMontageInfo( <a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *montage_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>DestroyMontageInfo() deallocates memory associated with montage_info.</p>\n<p>The format of the DestroyMontageInfo method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyMontageInfo( <a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *montage_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>montage_info:</dt>\n<dd>Specifies a pointer to an MontageInfo structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getmontageinfo\">\n<h1><a class=\"toc-backref\" href=\"#id9\">GetMontageInfo</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid GetMontageInfo( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *montage_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>GetMontageInfo() initializes montage_info to default values.</p>\n<p>The format of the GetMontageInfo method is:</p>\n<pre class=\"literal-block\">\nvoid GetMontageInfo( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, <a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *montage_info );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>a structure of type ImageInfo.</dd>\n<dt>montage_info:</dt>\n<dd>Specifies a pointer to a MontageInfo structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"montageimages\">\n<h1><a class=\"toc-backref\" href=\"#id10\">MontageImages</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MontageImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, const <a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *montage_info,\n                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>Montageimages() is a layout manager that lets you tile one or more\nthumbnails across an image canvas.</p>\n<p>The format of the MontageImages method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MontageImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, const <a class=\"reference external\" href=\"../api/types.html#montageinfo\">MontageInfo</a> *montage_info,\n                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>images:</dt>\n<dd>Specifies a pointer to an array of Image structures.</dd>\n<dt>montage_info:</dt>\n<dd>Specifies a pointer to a MontageInfo structure.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/operator.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>operator</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"operator\">\n<h1 class=\"title\">operator</h1>\n<h2 class=\"subtitle\" id=\"methods-to-apply-mathematic-or-boolean-operators-to-pixels\">Methods to apply mathematic or boolean operators to pixels.</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#quantumoperatorimage\" id=\"id3\">QuantumOperatorImage</a></li>\n<li><a class=\"reference internal\" href=\"#quantumoperatorregionimage\" id=\"id4\">QuantumOperatorRegionImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"quantumoperatorimage\">\n<h1><a class=\"toc-backref\" href=\"#id3\">QuantumOperatorImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail QuantumOperatorImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                     QuantumOperator operator, double rvalue );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>QuantumOperatorImage() performs the requested arithmetic,\nbitwise-logical, or value operation on the selected channels of\nthe entire image.  The AllChannels channel option operates on all\ncolor channels whereas the GrayChannel channel option treats the\ncolor channels as a grayscale intensity.</p>\n<p>These operations are on the DirectClass pixels of the image and do not\nupdate pixel indexes or colormap.</p>\n<p>The format of the QuantumOperatorImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail QuantumOperatorImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                     QuantumOperator operator, double rvalue );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>channel:</dt>\n<dd>Channel to operate on (RedChannel, CyanChannel,\nGreenChannel, MagentaChannel, BlueChannel, YellowChannel,\nOpacityChannel, BlackChannel, MatteChannel, AllChannels,\nGrayChannel).  The AllChannels type only updates color\nchannels.  The GrayChannel type treats the color channels\nas if they represent an intensity.</dd>\n<dt>quantum_operator:</dt>\n<dd>Operator to use (AddQuantumOp, AndQuantumOp,\nAssignQuantumOp, DepthQuantumOp, DivideQuantumOp, GammaQuantumOp,\nLShiftQuantumOp, MultiplyQuantumOp,  NegateQuantumOp,\nNoiseGaussianQuantumOp, NoiseImpulseQuantumOp,\nNoiseLaplacianQuantumOp, NoiseMultiplicativeQuantumOp,\nNoisePoissonQuantumOp, NoiseRandomQuantumOp, NoiseUniformQuantumOp,\nOrQuantumOp, RShiftQuantumOp, SubtractQuantumOp,\nThresholdBlackQuantumOp, ThresholdQuantumOp, ThresholdWhiteQuantumOp,\nThresholdBlackNegateQuantumOp, ThresholdWhiteNegateQuantumOp,\nXorQuantumOp).</dd>\n<dt>rvalue:</dt>\n<dd>Operator argument.</dd>\n<dt>exception:</dt>\n<dd>Updated with error description.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"quantumoperatorregionimage\">\n<h1><a class=\"toc-backref\" href=\"#id4\">QuantumOperatorRegionImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail QuantumOperatorRegionImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, long x, long y,\n                                           unsigned long columns, unsigned long rows,\n                                           <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                           QuantumOperator quantum_operator, double rvalue );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>QuantumOperatorRegionImage() performs the requested arithmetic,\nbitwise-logical, or value operation on the selected channels of\nthe image over the specified region. The AllChannels channel option\noperates on all color channels whereas the GrayChannel channel option\ntreats the color channels as a grayscale intensity.</p>\n<p>These operations are on the DirectClass pixels of the image and do not\nupdate pixel indexes or colormap.</p>\n<p>The format of the QuantumOperatorRegionImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail QuantumOperatorRegionImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, long x, long y,\n                                           unsigned long columns, unsigned long rows,\n                                           <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                           QuantumOperator quantum_operator, double rvalue );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>channel:</dt>\n<dd>Channel to operate on (RedChannel, CyanChannel,\nGreenChannel, MagentaChannel, BlueChannel, YellowChannel,\nOpacityChannel, BlackChannel, MatteChannel, AllChannels,\nGrayChannel).  The AllChannels type only updates color\nchannels.  The GrayChannel type treats the color channels\nas if they represent an intensity.</dd>\n<dt>x:</dt>\n<dd>Ordinate of left row of region.</dd>\n<dt>y:</dt>\n<dd>Orginate of top column of region.</dd>\n<dt>columns:</dt>\n<dd>Width of region.</dd>\n<dt>rows:</dt>\n<dd>Height of region.</dd>\n<dt>quantum_operator:</dt>\n<dd>Operator to use (AddQuantumOp,AndQuantumOp,\nAssignQuantumOp, DepthQuantumOp, DivideQuantumOp, GammaQuantumOp,\nLShiftQuantumOp, MultiplyQuantumOp,  NegateQuantumOp,\nNoiseGaussianQuantumOp, NoiseImpulseQuantumOp,\nNoiseLaplacianQuantumOp, NoiseMultiplicativeQuantumOp,\nNoisePoissonQuantumOp, NoiseRandomQuantumOp, NoiseUniformQuantumOp,\nOrQuantumOp, RShiftQuantumOp, SubtractQuantumOp,\nThresholdBlackQuantumOp, ThresholdQuantumOp, ThresholdWhiteQuantumOp,\nXorQuantumOp).</dd>\n<dt>rvalue:</dt>\n<dd>Operator argument.</dd>\n<dt>exception:</dt>\n<dd>Updated with error description.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/paint.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>paint</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"paint\">\n<h1 class=\"title\">paint</h1>\n<h2 class=\"subtitle\" id=\"methods-to-fill-image-pixel-regions\">Methods to fill image pixel regions</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#colorfloodfillimage\" id=\"id7\">ColorFloodfillImage</a></li>\n<li><a class=\"reference internal\" href=\"#mattefloodfillimage\" id=\"id8\">MatteFloodfillImage</a></li>\n<li><a class=\"reference internal\" href=\"#opaqueimage\" id=\"id9\">OpaqueImage</a></li>\n<li><a class=\"reference internal\" href=\"#transparentimage\" id=\"id10\">TransparentImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"colorfloodfillimage\">\n<h1><a class=\"toc-backref\" href=\"#id7\">ColorFloodfillImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int ColorFloodfillImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                                  const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target, const long x_offset,\n                                  const long y_offset, const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> method );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>ColorFloodfill() changes the color value of any pixel that matches\ntarget and is an immediate neighbor.  If the method FillToBorderMethod is\nspecified, the color value is changed for any neighbor pixel that does not\nmatch the bordercolor member of image.</p>\n<p>By default target must match a particular pixel color exactly.\nHowever, in many cases two colors may differ by a small amount.  The\nfuzz member of image defines how much tolerance is acceptable to\nconsider two colors as the same.  For example, set fuzz to 10 and the\ncolor red at intensities of 100 and 102 respectively are now\ninterpreted as the same color for the purposes of the floodfill.</p>\n<p>The format of the ColorFloodfillImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int ColorFloodfillImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                                  const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target, const long x_offset,\n                                  const long y_offset, const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> method );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>draw_info:</dt>\n<dd>The draw info.</dd>\n<dt>target:</dt>\n<dd>The RGB value of the target color.</dd>\n<dt>x,y:</dt>\n<dd>The starting location of the operation.</dd>\n<dt>method:</dt>\n<dd>Choose either FloodfillMethod or FillToBorderMethod.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"mattefloodfillimage\">\n<h1><a class=\"toc-backref\" href=\"#id8\">MatteFloodfillImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MatteFloodfillImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target,\n                                  const unsigned int opacity, const long x_offset,\n                                  const long y_offset, const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> method );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>MatteFloodfill() changes the transparency value of any pixel that matches\ntarget and is an immediate neighbor.  If the method FillToBorderMethod\nis specified, the transparency value is changed for any neighbor pixel\nthat does not match the bordercolor member of image.</p>\n<p>By default target must match a particular pixel transparency exactly.\nHowever, in many cases two transparency values may differ by a\nsmall amount.  The fuzz member of image defines how much tolerance is\nacceptable to consider two transparency values as the same.  For example,\nset fuzz to 10 and the opacity values of 100 and 102 respectively are\nnow interpreted as the same value for the purposes of the floodfill.</p>\n<p>The format of the MatteFloodfillImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MatteFloodfillImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target,\n                                  const unsigned int opacity, const long x_offset,\n                                  const long y_offset, const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> method );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>target:</dt>\n<dd>The RGB value of the target color.</dd>\n<dt>opacity:</dt>\n<dd>The level of transparency: 0 is fully opaque and MaxRGB is\nfully transparent.</dd>\n<dt>x,y:</dt>\n<dd>The starting location of the operation.</dd>\n<dt>method:</dt>\n<dd>Choose either FloodfillMethod or FillToBorderMethod.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"opaqueimage\">\n<h1><a class=\"toc-backref\" href=\"#id9\">OpaqueImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int OpaqueImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target,\n                          const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> fill );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>OpaqueImage() changes any pixel that matches color with the color\ndefined by fill.</p>\n<p>By default color must match a particular pixel color exactly.  However,\nin many cases two colors may differ by a small amount.  Fuzz defines\nhow much tolerance is acceptable to consider two colors as the same.\nFor example, set fuzz to 10 and the color red at intensities of 100 and\n102 respectively are now interpreted as the same color.</p>\n<p>The format of the OpaqueImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int OpaqueImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target,\n                          const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> fill );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>target:</dt>\n<dd>The RGB value of the target color.</dd>\n<dt>fill:</dt>\n<dd>The replacement color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"transparentimage\">\n<h1><a class=\"toc-backref\" href=\"#id10\">TransparentImage</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int TransparentImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target,\n                               const unsigned int opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>TransparentImage() changes the opacity value associated with any pixel\nthat matches color to the value defined by opacity.</p>\n<p>By default color must match a particular pixel color exactly.  However,\nin many cases two colors may differ by a small amount.  Fuzz defines\nhow much tolerance is acceptable to consider two colors as the same.\nFor example, set fuzz to 10 and the color red at intensities of 100 and\n102 respectively are now interpreted as the same color.</p>\n<p>The format of the TransparentImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int TransparentImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> target,\n                               const unsigned int opacity );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>target:</dt>\n<dd>The RGB value of the target color.</dd>\n<dt>opacity:</dt>\n<dd>The replacement opacity value.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/pixel_cache.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>pixel_cache</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"pixel-cache\">\n<h1 class=\"title\">pixel_cache</h1>\n<h2 class=\"subtitle\" id=\"image-pixel-cache-working-pixels\">Image pixel cache (working pixels).</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#accesscacheviewpixels\" id=\"id63\">AccessCacheViewPixels</a></li>\n<li><a class=\"reference internal\" href=\"#accessimmutableindexes\" id=\"id64\">AccessImmutableIndexes</a></li>\n<li><a class=\"reference internal\" href=\"#accessmutableindexes\" id=\"id65\">AccessMutableIndexes</a></li>\n<li><a class=\"reference internal\" href=\"#accessmutablepixels\" id=\"id66\">AccessMutablePixels</a></li>\n<li><a class=\"reference internal\" href=\"#acquirecacheviewpixels\" id=\"id67\">AcquireCacheViewPixels</a></li>\n<li><a class=\"reference internal\" href=\"#acquirecacheviewindexes\" id=\"id68\">AcquireCacheViewIndexes</a></li>\n<li><a class=\"reference internal\" href=\"#acquireimagepixels\" id=\"id69\">AcquireImagePixels</a></li>\n<li><a class=\"reference internal\" href=\"#acquireonecacheviewpixel\" id=\"id70\">AcquireOneCacheViewPixel</a></li>\n<li><a class=\"reference internal\" href=\"#acquireonepixel\" id=\"id71\">AcquireOnePixel</a></li>\n<li><a class=\"reference internal\" href=\"#acquireonepixelbyreference\" id=\"id72\">AcquireOnePixelByReference</a></li>\n<li><a class=\"reference internal\" href=\"#checkimagepixellimits\" id=\"id73\">CheckImagePixelLimits</a></li>\n<li><a class=\"reference internal\" href=\"#destroycacheinfo\" id=\"id74\">DestroyCacheInfo</a></li>\n<li><a class=\"reference internal\" href=\"#destroyimagepixels\" id=\"id75\">DestroyImagePixels</a></li>\n<li><a class=\"reference internal\" href=\"#getcacheviewpixels\" id=\"id76\">GetCacheViewPixels</a></li>\n<li><a class=\"reference internal\" href=\"#getcacheviewimage\" id=\"id77\">GetCacheViewImage</a></li>\n<li><a class=\"reference internal\" href=\"#getcacheviewindexes\" id=\"id78\">GetCacheViewIndexes</a></li>\n<li><a class=\"reference internal\" href=\"#getimagepixels\" id=\"id79\">GetImagePixels</a></li>\n<li><a class=\"reference internal\" href=\"#getimagepixelsex\" id=\"id80\">GetImagePixelsEx</a></li>\n<li><a class=\"reference internal\" href=\"#getimagevirtualpixelmethod\" id=\"id81\">GetImageVirtualPixelMethod</a></li>\n<li><a class=\"reference internal\" href=\"#getindexes\" id=\"id82\">GetIndexes</a></li>\n<li><a class=\"reference internal\" href=\"#getonepixel\" id=\"id83\">GetOnePixel</a></li>\n<li><a class=\"reference internal\" href=\"#getpixels\" id=\"id84\">GetPixels</a></li>\n<li><a class=\"reference internal\" href=\"#modifycache\" id=\"id85\">ModifyCache</a></li>\n<li><a class=\"reference internal\" href=\"#opencacheview\" id=\"id86\">OpenCacheView</a></li>\n<li><a class=\"reference internal\" href=\"#referencecache\" id=\"id87\">ReferenceCache</a></li>\n<li><a class=\"reference internal\" href=\"#setcacheviewpixels\" id=\"id88\">SetCacheViewPixels</a></li>\n<li><a class=\"reference internal\" href=\"#setimagepixels\" id=\"id89\">SetImagePixels</a></li>\n<li><a class=\"reference internal\" href=\"#setimagepixelsex\" id=\"id90\">SetImagePixelsEx</a></li>\n<li><a class=\"reference internal\" href=\"#setimagevirtualpixelmethod\" id=\"id91\">SetImageVirtualPixelMethod</a></li>\n<li><a class=\"reference internal\" href=\"#synccacheviewpixels\" id=\"id92\">SyncCacheViewPixels</a></li>\n<li><a class=\"reference internal\" href=\"#syncimagepixels\" id=\"id93\">SyncImagePixels</a></li>\n<li><a class=\"reference internal\" href=\"#syncimagepixelsex\" id=\"id94\">SyncImagePixelsEx</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"accesscacheviewpixels\">\n<h1><a class=\"toc-backref\" href=\"#id63\">AccessCacheViewPixels</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AccessCacheViewPixels( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>Method AccessCacheViewPixels returns writeable pixels associated with\nthe specified view.</p>\n<p>The format of the AccessCacheViewPixels method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AccessCacheViewPixels( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>indexes:</dt>\n<dd>Method AccessCacheViewPixels returns the pixels associated with\nthe specified view.</dd>\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"accessimmutableindexes\">\n<h1><a class=\"toc-backref\" href=\"#id64\">AccessImmutableIndexes</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst IndexPacket *AccessImmutableIndexes( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>AccessImmutableIndexes() returns the colormap indexes associated with\nthe last call to AcquireImagePixels(). NULL is returned if colormap\nindexes are not available.</p>\n<p>The format of the AccessImmutableIndexes() method is:</p>\n<pre class=\"literal-block\">\nconst IndexPacket *AccessImmutableIndexes( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>indexes:</dt>\n<dd>The indexes associated with the last call to\nAcquireImagePixels().</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"accessmutableindexes\">\n<h1><a class=\"toc-backref\" href=\"#id65\">AccessMutableIndexes</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nIndexPacket *AccessMutableIndexes( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>AccessMutableIndexes() returns the colormap indexes associated with\nthe last call to SetImagePixels() or GetImagePixels(). NULL is returned\nif colormap indexes are not available.</p>\n<p>The format of the AccessMutagleIndexes() method is:</p>\n<pre class=\"literal-block\">\nIndexPacket *AccessMutableIndexes( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>indexes:</dt>\n<dd>The indexes associated with the last call to\nAcquireImagePixels().</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"accessmutablepixels\">\n<h1><a class=\"toc-backref\" href=\"#id66\">AccessMutablePixels</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AccessMutablePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> image );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>AccessMutablePixels() returns the pixels associated with the last call to\nSetImagePixels() or GetImagePixels(). This is useful in order to access\nan already selected region without passing the geometry of the region.</p>\n<p>The format of the GetPixels() method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AccessMutablePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>The pixels associated with the last call to SetImagePixels()\nor GetImagePixels().</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"acquirecacheviewpixels\">\n<h1><a class=\"toc-backref\" href=\"#id67\">AcquireCacheViewPixels</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AcquireCacheViewPixels( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                                           const unsigned long columns,\n                                           const unsigned long rows,\n                                           <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>Method AcquireCacheViewPixels gets pixels from the in-memory or disk pixel\ncache as defined by the geometry parameters for read-only access.   A\npointer to the pixels is returned if the pixels are transferred, otherwise\nNULL is returned.</p>\n<p>The format of the AcquireCacheViewPixels method is:</p>\n<pre class=\"literal-block\">\nconst <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AcquireCacheViewPixels( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                                           const unsigned long columns,\n                                           const unsigned long rows,\n                                           <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>Method AcquireCacheViewPixels returns a null pointer if an error\noccurs, otherwise a pointer to the view pixels.</dd>\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"acquirecacheviewindexes\">\n<h1><a class=\"toc-backref\" href=\"#id68\">AcquireCacheViewIndexes</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst IndexPacket *AcquireCacheViewIndexes( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>Method AcquireCacheViewIndexes returns read-only indexes associated with\nthe specified view.</p>\n<p>The format of the AcquireCacheViewIndexes method is:</p>\n<pre class=\"literal-block\">\nconst IndexPacket *AcquireCacheViewIndexes( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>indexes:</dt>\n<dd>Method AcquireCacheViewIndexes returns the indexes\nassociated with the specified view.</dd>\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"acquireimagepixels\">\n<h1><a class=\"toc-backref\" href=\"#id69\">AcquireImagePixels</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AcquireImagePixels( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                                       const unsigned long columns, const unsigned long rows,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>AcquireImagePixels() obtains a pixel region for read-only access. If the\nregion is successfully accessed, a pointer to it is returned, otherwise\nNULL is returned. The returned pointer may point to a temporary working\ncopy of the pixels or it may point to the original pixels in memory.\nPerformance is maximized if the selected area is part of one row, or one\nor more full rows, since then there is opportunity to access the pixels\nin-place (without a copy) if the image is in RAM, or in a memory-mapped\nfile. The returned pointer should <em>never</em> be deallocated by the user.</p>\n<p>Pixels accessed via the returned pointer represent a simple array of type\nPixelPacket. If the image storage class is PsudeoClass, call GetIndexes()\nafter invoking GetImagePixels() to obtain the colormap indexes (of type\nIndexPacket) corresponding to the region.</p>\n<p>If you plan to modify the pixels, use GetImagePixels() instead.</p>\n<p>The format of the AcquireImagePixels() method is:</p>\n<pre class=\"literal-block\">\nconst <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *AcquireImagePixels( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                                       const unsigned long columns, const unsigned long rows,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>AcquireImagePixels() returns a pointer to the pixels if they\nare transferred, otherwise a NULL is returned.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"acquireonecacheviewpixel\">\n<h1><a class=\"toc-backref\" href=\"#id70\">AcquireOneCacheViewPixel</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail AcquireOneCacheViewPixel( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *pixel,\n                                         const long x, const long y,\n                                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>Method AcquireOneCacheViewPixel gets one pixel from the in-memory or disk\npixel cache as defined by the geometry parameters for read-only access.\nThe image background color is returned if there is an error retrieving\nthe pixel.</p>\n<p>The format of the AcquireOneCacheViewPixel method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail AcquireOneCacheViewPixel( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *pixel,\n                                         const long x, const long y,\n                                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n<dt>pixel:</dt>\n<dd>Pointer to PixelPacket to update.</dd>\n<dt>x,y:</dt>\n<dd>Coordinate of pixel to retrieve</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"acquireonepixel\">\n<h1><a class=\"toc-backref\" href=\"#id71\">AcquireOnePixel</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> AcquireOnePixel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> image, const long x, const long y,\n                              <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>AcquireOnePixel() returns a single pixel at the specified (x,y) location.\nThe image background color is returned if an error occurs.  If errors\nare to be returned to the image, use GetOnePixel() instead. This function\nis convenient but performance will be poor if it is used too often.</p>\n<p>The format of the AcquireOnePixel() method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> AcquireOnePixel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> image, const long x, const long y,\n                              <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> exception );\n</pre>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>AcquireOnePixel() returns a pixel at the specified (x,y)\nlocation.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>x,y:</dt>\n<dd>These values define the location of the pixel to return.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"acquireonepixelbyreference\">\n<h1><a class=\"toc-backref\" href=\"#id72\">AcquireOnePixelByReference</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail AcquireOnePixelByReference( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *pixel,\n                                           const long x, const long y,\n                                           <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>AcquireOnePixelByReference() returns a single pixel at the specified (x,y)\nlocation. The image background color is returned if an error occurs. This\nfunction is convenient but performance will be poor if it is used too\noften.</p>\n<p>The format of the AcquireOnePixelByReference() method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail AcquireOnePixelByReference( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *pixel,\n                                           const long x, const long y,\n                                           <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>AcquireOnePixel() returns a pixel at the specified (x,y)\nlocation.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>pixel:</dt>\n<dd>A reference to the pixel to update.</dd>\n<dt>x,y:</dt>\n<dd>These values define the location of the pixel to return.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"checkimagepixellimits\">\n<h1><a class=\"toc-backref\" href=\"#id73\">CheckImagePixelLimits</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail CheckImagePixelLimits( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>CheckImagePixelLimits() verifies that image dimensions are within current\nlimits.  Returns MagickPass if image dimensions are within limits, or\nMagickFail (and updates exception) if dimensions exceed a limit.</p>\n<p>While this function is used within the pixel cache to prevent allocating\nan image which exceeds the limits, it may also be used to validate image\ndimensions obtained from file headers prior to allocating memory or doing\nfurther processing of the image.  Such additional limits should be after\nany 'ping' mode processing so that the image dimensions can still be\nshown by 'identify'.</p>\n<p>The format of the CheckImagePixelLimits() method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail CheckImagePixelLimits( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Image to verify rows/columns.</dd>\n<dt>exception:</dt>\n<dd>Throw exception into this ExceptionInfo structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroycacheinfo\">\n<h1><a class=\"toc-backref\" href=\"#id74\">DestroyCacheInfo</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyCacheInfo( <a class=\"reference external\" href=\"../api/types.html#cache\">Cache</a> cache );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>DestroyCacheInfo() deallocates memory associated with the pixel cache.</p>\n<p>The format of the DestroyCacheInfo() method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyCacheInfo( <a class=\"reference external\" href=\"../api/types.html#cache\">Cache</a> cache );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>cache:</dt>\n<dd>Specifies a pointer to a Cache structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroyimagepixels\">\n<h1><a class=\"toc-backref\" href=\"#id75\">DestroyImagePixels</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>DestroyImagePixels() deallocates memory associated with the pixel cache.</p>\n<p>The format of the DestroyImagePixels() method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getcacheviewpixels\">\n<h1><a class=\"toc-backref\" href=\"#id76\">GetCacheViewPixels</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetCacheViewPixels( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                                 const unsigned long columns, const unsigned long rows,\n                                 <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>GetCacheViewPixels() gets writeable pixels from the in-memory or disk pixel\ncache as defined by the geometry parameters.   A pointer to the pixels\nis returned if the pixels are transferred, otherwise a NULL is returned.</p>\n<p>The format of the GetCacheViewPixels method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetCacheViewPixels( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                                 const unsigned long columns, const unsigned long rows,\n                                 <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>Method GetCacheViewPixels returns a null pointer if an error\noccurs, otherwise a pointer to the view pixels.</dd>\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n<dt>exception:</dt>\n<dd>Any errors are reported here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getcacheviewimage\">\n<h1><a class=\"toc-backref\" href=\"#id77\">GetCacheViewImage</a></h1>\n<div class=\"section\" id=\"id27\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetCacheViewImage( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n</div>\n<div class=\"section\" id=\"id28\">\n<h2>Description</h2>\n<p>Method GetCacheViewImage returns the image which allocated the view.</p>\n<p>The format of the GetCacheViewImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetCacheViewImage( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Method GetCacheViewImage returns the image which allocated\nthe view.</dd>\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getcacheviewindexes\">\n<h1><a class=\"toc-backref\" href=\"#id78\">GetCacheViewIndexes</a></h1>\n<div class=\"section\" id=\"id29\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nIndexPacket *GetCacheViewIndexes( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n</div>\n<div class=\"section\" id=\"id30\">\n<h2>Description</h2>\n<p>Method GetCacheViewIndexes returns writeable indexes associated with\nthe specified view.</p>\n<p>The format of the GetCacheViewIndexes method is:</p>\n<pre class=\"literal-block\">\nIndexPacket *GetCacheViewIndexes( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>indexes:</dt>\n<dd>Method GetCacheViewIndexes returns the indexes associated with\nthe specified view.</dd>\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagepixels\">\n<h1><a class=\"toc-backref\" href=\"#id79\">GetImagePixels</a></h1>\n<div class=\"section\" id=\"id31\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                             const unsigned long columns, const unsigned long rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id32\">\n<h2>Description</h2>\n<p>GetImagePixels() obtains a pixel region for read/write access. If the\nregion is successfully accessed, a pointer to a PixelPacket array\nrepresenting the region is returned, otherwise NULL is returned.</p>\n<p>The returned pointer may point to a temporary working copy of the pixels\nor it may point to the original pixels in memory. Performance is maximized\nif the selected area is part of one row, or one or more full rows, since\nthen there is opportunity to access the pixels in-place (without a copy)\nif the image is in RAM, or in a memory-mapped file. The returned pointer\nshould <em>never</em> be deallocated by the user.</p>\n<p>Pixels accessed via the returned pointer represent a simple array of type\nPixelPacket. If the image storage class is PsudeoClass, call GetIndexes()\nafter invoking GetImagePixels() to obtain the colormap indexes (of type\nIndexPacket) corresponding to the region.  Once the PixelPacket (and/or\nIndexPacket) array has been updated, the changes must be saved back to\nthe underlying image using SyncImagePixels() or they may be lost.</p>\n<p>The format of the GetImagePixels() method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                             const unsigned long columns, const unsigned long rows );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>GetImagePixels() returns a pointer to the pixels if they are\ntransferred, otherwise a NULL is returned.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagepixelsex\">\n<h1><a class=\"toc-backref\" href=\"#id80\">GetImagePixelsEx</a></h1>\n<div class=\"section\" id=\"id33\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetImagePixelsEx( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                               const unsigned long columns, const unsigned long rows,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id34\">\n<h2>Description</h2>\n<p>GetImagePixelsEx() obtains a pixel region for read/write access.  It is\nsimilar to GetImagePixels() except that it reports any error information\nto a user provided exception structure.</p>\n<p>The format of the GetImagePixelsEx() method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetImagePixelsEx( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                               const unsigned long columns, const unsigned long rows,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>GetImagePixelsEx() returns a pointer to the pixels if they are\ntransferred, otherwise a NULL is returned.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n<dt>exception:</dt>\n<dd>Any error details are reported here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagevirtualpixelmethod\">\n<h1><a class=\"toc-backref\" href=\"#id81\">GetImageVirtualPixelMethod</a></h1>\n<div class=\"section\" id=\"id35\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#virtualpixelmethod\">VirtualPixelMethod</a> GetImageVirtualPixelMethod( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id36\">\n<h2>Description</h2>\n<p>GetImageVirtualPixelMethod() gets the &quot;virtual pixels&quot; method for the\nimage.  A virtual pixel is any pixel access that is outside the boundaries\nof the image cache.</p>\n<p>The format of the GetImageVirtualPixelMethod() method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#virtualpixelmethod\">VirtualPixelMethod</a> GetImageVirtualPixelMethod( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getindexes\">\n<h1><a class=\"toc-backref\" href=\"#id82\">GetIndexes</a></h1>\n<div class=\"section\" id=\"id37\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nIndexPacket *GetIndexes( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id38\">\n<h2>Description</h2>\n<p>GetIndexes() returns the colormap indexes associated with the last call to\nSetImagePixels() or GetImagePixels(). NULL is returned if colormap indexes\nare not available.</p>\n<p>The format of the GetIndexes() method is:</p>\n<pre class=\"literal-block\">\nIndexPacket *GetIndexes( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>indexes:</dt>\n<dd>GetIndexes() returns the indexes associated with the last\ncall to SetImagePixels() or GetImagePixels().</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getonepixel\">\n<h1><a class=\"toc-backref\" href=\"#id83\">GetOnePixel</a></h1>\n<div class=\"section\" id=\"id39\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> GetOnePixel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> image, const long x, const long y );\n</pre>\n</div>\n<div class=\"section\" id=\"id40\">\n<h2>Description</h2>\n<p>GetOnePixel() returns a single pixel at the specified (x,y) location.\nThe image background color is returned if an error occurs.  This function\nis convenient but performance will be poor if it is used too often.\nGetOnePixel() is identical to AcquireOnePixel() except that exceptions\nare implicitly delivered to the image.</p>\n<p>The format of the GetOnePixel() method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> GetOnePixel( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> image, const long x, const long y );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>x,y:</dt>\n<dd>These values define the location of the pixel to return.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getpixels\">\n<h1><a class=\"toc-backref\" href=\"#id84\">GetPixels</a></h1>\n<div class=\"section\" id=\"id41\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetPixels( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> image );\n</pre>\n</div>\n<div class=\"section\" id=\"id42\">\n<h2>Description</h2>\n<p>GetPixels() returns the pixels associated with the last call to\nSetImagePixels() or GetImagePixels(). This is useful in order to access\nan already selected region without passing the geometry of the region.</p>\n<p>The format of the GetPixels() method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *GetPixels( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>GetPixels() returns the pixels associated with the last call\nto SetImagePixels() or GetImagePixels().</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"modifycache\">\n<h1><a class=\"toc-backref\" href=\"#id85\">ModifyCache</a></h1>\n<div class=\"section\" id=\"id43\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail ModifyCache( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id44\">\n<h2>Description</h2>\n<p>ModifyCache() ensures that there is only a single reference to the pixel\ncache to be modified, updating the provided cache pointer to point to\na clone of the original pixel cache if necessary.  This is used to\nimplement copy on write.</p>\n<p>The format of the ModifyCache method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail ModifyCache( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Errors are reported here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"opencacheview\">\n<h1><a class=\"toc-backref\" href=\"#id86\">OpenCacheView</a></h1>\n<div class=\"section\" id=\"id45\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *OpenCacheView( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id46\">\n<h2>Description</h2>\n<p>OpenCacheView() opens a view into the pixel cache.</p>\n<p>The format of the OpenCacheView method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *OpenCacheView( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"referencecache\">\n<h1><a class=\"toc-backref\" href=\"#id87\">ReferenceCache</a></h1>\n<div class=\"section\" id=\"id47\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#cache\">Cache</a> ReferenceCache( <a class=\"reference external\" href=\"../api/types.html#cache\">Cache</a> cache_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id48\">\n<h2>Description</h2>\n<p>ReferenceCache() increments the reference count associated with the pixel\ncache returning a pointer to the cache.</p>\n<p>The format of the ReferenceCache method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#cache\">Cache</a> ReferenceCache( <a class=\"reference external\" href=\"../api/types.html#cache\">Cache</a> cache_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>cache_info:</dt>\n<dd>The cache_info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setcacheviewpixels\">\n<h1><a class=\"toc-backref\" href=\"#id88\">SetCacheViewPixels</a></h1>\n<div class=\"section\" id=\"id49\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *SetCacheViewPixels( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                                 const unsigned long columns, const unsigned long rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id50\">\n<h2>Description</h2>\n<p>SetCacheViewPixels() gets pixels from the in-memory or disk pixel cache as\ndefined by the geometry parameters.   A pointer to the pixels is returned\nif the pixels are transferred, otherwise a NULL is returned.</p>\n<p>The format of the SetCacheViewPixels method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *SetCacheViewPixels( <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, const long x, const long y,\n                                 const unsigned long columns, const unsigned long rows );\n</pre>\n<dl class=\"docutils\">\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n<dt>exception:</dt>\n<dd>Any errors are reported here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimagepixels\">\n<h1><a class=\"toc-backref\" href=\"#id89\">SetImagePixels</a></h1>\n<div class=\"section\" id=\"id51\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *SetImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                             const unsigned long columns, const unsigned long rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id52\">\n<h2>Description</h2>\n<p>SetImagePixels() initializes a pixel region for write-only access.\nIf the region is successfully intialized a pointer to a PixelPacket\narray representing the region is returned, otherwise NULL is returned.\nThe returned pointer may point to a temporary working buffer for the\npixels or it may point to the final location of the pixels in memory.</p>\n<p>Write-only access means that any existing pixel values corresponding to\nthe region are ignored.  This is useful while the initial image is being\ncreated from scratch, or if the existing pixel values are to be\ncompletely replaced without need to refer to their pre-existing values.\nThe application is free to read and write the pixel buffer returned by\nSetImagePixels() any way it pleases. SetImagePixels() does not initialize\nthe pixel array values. Initializing pixel array values is the\napplication's responsibility.</p>\n<p>Performance is maximized if the selected area is part of one row, or\none or more full rows, since then there is opportunity to access the\npixels in-place (without a copy) if the image is in RAM, or in a\nmemory-mapped file. The returned pointer should <em>never</em> be deallocated\nby the user.</p>\n<p>Pixels accessed via the returned pointer represent a simple array of type\nPixelPacket. If the image storage class is PsudeoClass, call GetIndexes()\nafter invoking GetImagePixels() to obtain the colormap indexes (of type\nIndexPacket) corresponding to the region.  Once the PixelPacket (and/or\nIndexPacket) array has been updated, the changes must be saved back to\nthe underlying image using SyncCacheNexus() or they may be lost.</p>\n<p>The format of the SetImagePixels() method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *SetImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                             const unsigned long columns, const unsigned long rows );\n</pre>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>SetImagePixels returns a pointer to the pixels if they are\ntransferred, otherwise a NULL is returned.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimagepixelsex\">\n<h1><a class=\"toc-backref\" href=\"#id90\">SetImagePixelsEx</a></h1>\n<div class=\"section\" id=\"id53\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *SetImagePixelsEx( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                               const unsigned long columns, const unsigned long rows,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id54\">\n<h2>Description</h2>\n<p>SetImagePixelsEx() initializes a pixel region for write-only access.\nIt is similar to SetImagePixels() except that any exception information\nis written to a user provided exception structure.</p>\n<p>The format of the SetImagePixelsEx() method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *SetImagePixelsEx( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x, const long y,\n                               const unsigned long columns, const unsigned long rows,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>pixels:</dt>\n<dd>SetImagePixelsEx returns a pointer to the pixels if they are\ntransferred, otherwise a NULL is returned.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>x,y,columns,rows:</dt>\n<dd>These values define the perimeter of a region of\npixels.</dd>\n<dt>exception:</dt>\n<dd>Any error details are reported here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimagevirtualpixelmethod\">\n<h1><a class=\"toc-backref\" href=\"#id91\">SetImageVirtualPixelMethod</a></h1>\n<div class=\"section\" id=\"id55\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nSetImageVirtualPixelMethod( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#virtualpixelmethod\">VirtualPixelMethod</a> method );\n</pre>\n</div>\n<div class=\"section\" id=\"id56\">\n<h2>Description</h2>\n<p>SetImageVirtualPixelMethod() sets the &quot;virtual pixels&quot; method for the\nimage.  A virtual pixel is any pixel access that is outside the boundaries\nof the image cache.</p>\n<p>The format of the SetImageVirtualPixelMethod() method is:</p>\n<pre class=\"literal-block\">\nSetImageVirtualPixelMethod( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#virtualpixelmethod\">VirtualPixelMethod</a> method );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>type:</dt>\n<dd>choose from these access types:</dd>\n</dl>\n<p>EdgeVPType:  the edge pixels of the image extend infinitely.\nAny pixel outside the image is assigned the same value as the\npixel at the edge closest to it.</p>\n<p>TileVPType:  the image extends periodically or tiled.  The pixels\nwrap around the edges of the image.</p>\n<p>MirrorVPType:  mirror the image at the boundaries.</p>\n<p>ConstantVPType:  every value outside the image is a constant as\ndefines by the pixel parameter.</p>\n</div>\n</div>\n<div class=\"section\" id=\"synccacheviewpixels\">\n<h1><a class=\"toc-backref\" href=\"#id92\">SyncCacheViewPixels</a></h1>\n<div class=\"section\" id=\"id57\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail SyncCacheViewPixels( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id58\">\n<h2>Description</h2>\n<p>SyncCacheViewPixels() saves the view pixels to the in-memory or disk cache.\nThe method returns MagickPass if the pixel region is synced, otherwise\nMagickFail.</p>\n<p>The format of the SyncCacheViewPixels method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail SyncCacheViewPixels( const <a class=\"reference external\" href=\"../api/types.html#viewinfo\">ViewInfo</a> *view, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>view:</dt>\n<dd>The address of a structure of type ViewInfo.</dd>\n<dt>exception:</dt>\n<dd>Any errors are reported here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"syncimagepixels\">\n<h1><a class=\"toc-backref\" href=\"#id93\">SyncImagePixels</a></h1>\n<div class=\"section\" id=\"id59\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail SyncImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id60\">\n<h2>Description</h2>\n<p>SyncImagePixels() saves the image pixels to the in-memory or disk cache.\nThe method returns MagickPass if the pixel region is synced, otherwise MagickFail.</p>\n<p>The format of the SyncImagePixels() method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail SyncImagePixels( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>SyncImagePixels() returns MagickPass if the image pixels are\ntransferred to the in-memory or disk cache otherwise MagickFail.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"syncimagepixelsex\">\n<h1><a class=\"toc-backref\" href=\"#id94\">SyncImagePixelsEx</a></h1>\n<div class=\"section\" id=\"id61\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail SyncImagePixelsEx( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id62\">\n<h2>Description</h2>\n<p>SyncImagePixelsEx() saves the image pixels to the in-memory or disk cache.\nThe method returns MagickPass if the pixel region is synced, otherwise\nMagickFail.</p>\n<p>The format of the SyncImagePixelsEx() method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail SyncImagePixelsEx( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>SyncImagePixelsEx() returns MagickPass if the image pixels are\ntransferred to the in-memory or disk cache otherwise MagickFail.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Any error details are reported here.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/pixel_iterator.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>pixel_iterator</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"pixel-iterator\">\n<h1 class=\"title\">pixel_iterator</h1>\n<h2 class=\"subtitle\" id=\"pixel-iterator-pattern-support-functions\">Pixel iterator pattern support functions</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#initializepixeliteratoroptions\" id=\"id17\">InitializePixelIteratorOptions</a></li>\n<li><a class=\"reference internal\" href=\"#pixeliteratemonoread\" id=\"id18\">PixelIterateMonoRead</a></li>\n<li><a class=\"reference internal\" href=\"#pixeliteratemonoset\" id=\"id19\">PixelIterateMonoSet</a></li>\n<li><a class=\"reference internal\" href=\"#pixeliteratemonomodify\" id=\"id20\">PixelIterateMonoModify</a></li>\n<li><a class=\"reference internal\" href=\"#pixeliteratedualread\" id=\"id21\">PixelIterateDualRead</a></li>\n<li><a class=\"reference internal\" href=\"#pixeliteratedualmodify\" id=\"id22\">PixelIterateDualModify</a></li>\n<li><a class=\"reference internal\" href=\"#pixeliteratedualnew\" id=\"id23\">PixelIterateDualNew</a></li>\n<li><a class=\"reference internal\" href=\"#pixeliteratetriplemodify\" id=\"id24\">PixelIterateTripleModify</a></li>\n<li><a class=\"reference internal\" href=\"#pixeliteratetriplenew\" id=\"id25\">PixelIterateTripleNew</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"initializepixeliteratoroptions\">\n<h1><a class=\"toc-backref\" href=\"#id17\">InitializePixelIteratorOptions</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid InitializePixelIteratorOptions( PixelIteratorOptions *options,\n                                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>InitializePixelIteratorOptions() assigns default options to a user-provided\nPixelIteratorOptions structure.  This function should always be used\nto initialize the PixelIteratorOptions structure prior to making any\nchanges to it.</p>\n<p>The format of the InitializePixelIteratorOptions method is:</p>\n<pre class=\"literal-block\">\nvoid InitializePixelIteratorOptions( PixelIteratorOptions *options,\n                                     <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>options:</dt>\n<dd>pointer to PixelIteratorOptions structure to initialize.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixeliteratemonoread\">\n<h1><a class=\"toc-backref\" href=\"#id18\">PixelIterateMonoRead</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateMonoRead( PixelIteratorMonoReadCallback call_back,\n                                     const PixelIteratorOptions *options,\n                                     const char *description, void *mutable_data,\n                                     const void *immutable_data, const long x, const long y,\n                                     const unsigned long columns, const unsigned long rows,\n                                     const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>PixelIterateMonoRead() iterates through a region of an image and invokes a\nuser-provided callback function (of type PixelRowIteratorMonoReadCallback)\nfor a row of pixels. This is useful to support simple operations such as\nstatistics computation.</p>\n<p>The format of the PixelIterateMonoRead method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateMonoRead( PixelIteratorMonoReadCallback call_back,\n                                     const PixelIteratorOptions *options,\n                                     const char *description, void *mutable_data,\n                                     const void *immutable_data, const long x, const long y,\n                                     const unsigned long columns, const unsigned long rows,\n                                     const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>call_back:</dt>\n<dd>A user-provided C callback function which is passed the\naddress of pixels from the image.</dd>\n<dt>options:</dt>\n<dd>Pixel iterator execution options (may be NULL).</dd>\n<dt>description:</dt>\n<dd>textual description of operation being performed.</dd>\n<dt>mutable_data:</dt>\n<dd>User-provided mutable context data.</dd>\n<dt>immutable_data:</dt>\n<dd>User-provided immutable context data.</dd>\n<dt>x:</dt>\n<dd>The horizontal ordinate of the top left corner of the region.</dd>\n<dt>y:</dt>\n<dd>The vertical ordinate of the top left corner of the region.</dd>\n<dt>columns:</dt>\n<dd>Width of pixel region</dd>\n<dt>rows:</dt>\n<dd>Height of pixel region</dd>\n<dt>image:</dt>\n<dd>The address of the Image.</dd>\n<dt>exception:</dt>\n<dd>If an error is reported, this argument is updated with the reason.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixeliteratemonoset\">\n<h1><a class=\"toc-backref\" href=\"#id19\">PixelIterateMonoSet</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateMonoSet( PixelIteratorMonoModifyback call_back,\n                                    const PixelIteratorOptions *options,\n                                    const char *description, void *mutable_data,\n                                    const void *immutable_data, const long x, const long y,\n                                    const unsigned long columns, const unsigned long rows,\n                                    <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>PixelIterateMonoSet() iterates through a region of an image and invokes\na user-provided callback function (of type PixelIteratorMonoModifyCallback)\nto initialize a region of pixels from scratch.   The difference from\nPixelIterateMonoModify() is that the output pixels are not initialized\nfrom the underlying store so it is more efficient when outputting a new\nimage or when the existing pixels are intentionally discarded.  This is\nuseful for operations such as setting the pixel color.</p>\n<p>The format of the PixelIterateMonoSet method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateMonoSet( PixelIteratorMonoModifyback call_back,\n                                    const PixelIteratorOptions *options,\n                                    const char *description, void *mutable_data,\n                                    const void *immutable_data, const long x, const long y,\n                                    const unsigned long columns, const unsigned long rows,\n                                    <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>call_back:</dt>\n<dd>A user-provided C callback function which is passed the\naddress of pixels to be initialized in the image.</dd>\n<dt>options:</dt>\n<dd>Pixel iterator execution options (may be NULL).</dd>\n<dt>description:</dt>\n<dd>textual description of operation being performed.</dd>\n<dt>mutable_data:</dt>\n<dd>User-provided mutable context data.</dd>\n<dt>immutable_data:</dt>\n<dd>User-provided immutable context data.</dd>\n<dt>x:</dt>\n<dd>The horizontal ordinate of the top left corner of the region.</dd>\n<dt>y:</dt>\n<dd>The vertical ordinate of the top left corner of the region.</dd>\n<dt>columns:</dt>\n<dd>Width of pixel region</dd>\n<dt>rows:</dt>\n<dd>Height of pixel region</dd>\n<dt>image:</dt>\n<dd>The address of the Image.</dd>\n<dt>exception:</dt>\n<dd>If an error is reported, this argument is updated with the reason.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixeliteratemonomodify\">\n<h1><a class=\"toc-backref\" href=\"#id20\">PixelIterateMonoModify</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateMonoModify( PixelIteratorMonoModifyCallback call_back,\n                                       const PixelIteratorOptions *options,\n                                       const char *description, void *mutable_data,\n                                       const void *immutable_data, const long x,\n                                       const long y, const unsigned long columns,\n                                       const unsigned long rows, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>PixelIterateMonoModify() iterates through a region of an image and invokes\na user-provided callback function (of type PixelIteratorMonoModifyCallback)\nto modify a region of pixels. This is useful to support simple operations\nsuch as level shifting, colorspace translation, or thresholding.</p>\n<p>The format of the PixelIterateMonoModify method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateMonoModify( PixelIteratorMonoModifyCallback call_back,\n                                       const PixelIteratorOptions *options,\n                                       const char *description, void *mutable_data,\n                                       const void *immutable_data, const long x,\n                                       const long y, const unsigned long columns,\n                                       const unsigned long rows, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>call_back:</dt>\n<dd>A user-provided C callback function which is passed the\naddress of pixels from the image.</dd>\n<dt>options:</dt>\n<dd>Pixel iterator execution options (may be NULL).</dd>\n<dt>description:</dt>\n<dd>textual description of operation being performed.</dd>\n<dt>mutable_data:</dt>\n<dd>User-provided mutable context data.</dd>\n<dt>immutable_data:</dt>\n<dd>User-provided immutable context data.</dd>\n<dt>x:</dt>\n<dd>The horizontal ordinate of the top left corner of the region.</dd>\n<dt>y:</dt>\n<dd>The vertical ordinate of the top left corner of the region.</dd>\n<dt>columns:</dt>\n<dd>Width of pixel region</dd>\n<dt>rows:</dt>\n<dd>Height of pixel region</dd>\n<dt>image:</dt>\n<dd>The address of the Image.</dd>\n<dt>exception:</dt>\n<dd>If an error is reported, this argument is updated with the reason.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixeliteratedualread\">\n<h1><a class=\"toc-backref\" href=\"#id21\">PixelIterateDualRead</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateDualRead( PixelIteratorDualReadCallback call_back,\n                                     const PixelIteratorOptions *options,\n                                     const char *description, void *mutable_data,\n                                     const void *immutable_data, const unsigned long columns,\n                                     const unsigned long rows, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *first_image,\n                                     const long first_x, const long first_y,\n                                     const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *second_image, const long second_x,\n                                     const long second_y, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception ); ;\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>PixelIterateDualRead() iterates through pixel regions of two images and\ninvokes a user-provided callback function (of type\nPixelIteratorDualReadCallback) for each row of pixels. This is useful to\nsupport operations such as image comparison.</p>\n<p>The format of the PixelIterateDualRead method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateDualRead( PixelIteratorDualReadCallback call_back,\n                                     const PixelIteratorOptions *options,\n                                     const char *description, void *mutable_data,\n                                     const void *immutable_data, const unsigned long columns,\n                                     const unsigned long rows, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *first_image,\n                                     const long first_x, const long first_y,\n                                     const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *second_image, const long second_x,\n                                     const long second_y, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception ); ;\n</pre>\n<dl class=\"docutils\">\n<dt>call_back:</dt>\n<dd>A user-provided C callback function which is passed the\naddress of pixels from each image.</dd>\n<dt>options:</dt>\n<dd>Pixel iterator execution options (may be NULL).</dd>\n<dt>description:</dt>\n<dd>textual description of operation being performed.</dd>\n<dt>mutable_data:</dt>\n<dd>User-provided mutable context data.</dd>\n<dt>immutable_data:</dt>\n<dd>User-provided immutable context data.</dd>\n<dt>columns:</dt>\n<dd>Width of pixel region</dd>\n<dt>rows:</dt>\n<dd>Height of pixel region</dd>\n<dt>first_image:</dt>\n<dd>The address of the first Image.</dd>\n<dt>first_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the first region.</dd>\n<dt>first_y:</dt>\n<dd>The vertical ordinate of the top left corner of the first region.</dd>\n<dt>second_image:</dt>\n<dd>The address of the second Image.</dd>\n<dt>second_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the second region.</dd>\n<dt>second_y:</dt>\n<dd>The vertical ordinate of the top left corner of the second region.</dd>\n<dt>exception:</dt>\n<dd>If an error is reported, this argument is updated with the reason.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixeliteratedualmodify\">\n<h1><a class=\"toc-backref\" href=\"#id22\">PixelIterateDualModify</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateDualModify( PixelIteratorDualModifyCallback call_back,\n                                       const PixelIteratorOptions *options,\n                                       const char *description, void *mutable_data,\n                                       const void *immutable_data,\n                                       const unsigned long columns, const unsigned long rows,\n                                       const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source_image, const long source_x,\n                                       const long source_y, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *update_image,\n                                       const long update_x, const long update_y,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>PixelIterateDualModify() iterates through pixel regions of two images and\ninvokes a user-provided callback function (of type\nPixelIteratorDualModifyCallback) for each row of pixels. This is useful to\nsupport operations such as composition.</p>\n<p>The format of the PixelIterateDualModify method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateDualModify( PixelIteratorDualModifyCallback call_back,\n                                       const PixelIteratorOptions *options,\n                                       const char *description, void *mutable_data,\n                                       const void *immutable_data,\n                                       const unsigned long columns, const unsigned long rows,\n                                       const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source_image, const long source_x,\n                                       const long source_y, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *update_image,\n                                       const long update_x, const long update_y,\n                                       <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>call_back:</dt>\n<dd>A user-provided C callback function which reads from\na region of source pixels and updates a region of destination pixels.</dd>\n<dt>options:</dt>\n<dd>Pixel iterator execution options (may be NULL).</dd>\n<dt>description:</dt>\n<dd>textual description of operation being performed.</dd>\n<dt>mutable_data:</dt>\n<dd>User-provided mutable context data.</dd>\n<dt>immutable_data:</dt>\n<dd>User-provided immutable context data.</dd>\n<dt>columns:</dt>\n<dd>Width of pixel region</dd>\n<dt>rows:</dt>\n<dd>Height of pixel region</dd>\n<dt>source_image:</dt>\n<dd>The address of the constant source Image.</dd>\n<dt>source_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the source region.</dd>\n<dt>source_y:</dt>\n<dd>The vertical ordinate of the top left corner of the source region.</dd>\n<dt>update_image:</dt>\n<dd>The address of the update Image.</dd>\n<dt>update_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the update region.</dd>\n<dt>update_y:</dt>\n<dd>The vertical ordinate of the top left corner of the update region.</dd>\n<dt>exception:</dt>\n<dd>If an error is reported, this argument is updated with the reason.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixeliteratedualnew\">\n<h1><a class=\"toc-backref\" href=\"#id23\">PixelIterateDualNew</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateDualNew( PixelIteratorDualNewCallback call_back,\n                                    const PixelIteratorOptions *options,\n                                    const char *description, void *mutable_data,\n                                    const void *immutable_data, const unsigned long columns,\n                                    const unsigned long rows, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source_image,\n                                    const long source_x, const long source_y,\n                                    <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *new_image, const long new_x,\n                                    const long new_y, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>PixelIterateDualNew() iterates through pixel regions of two images and\ninvokes a user-provided callback function (of type\nPixelIteratorDualNewCallback) for each row of pixels. This is used if a\nnew output image is created based on an input image.  The difference from\nPixelIterateDualModify() is that the output pixels are not initialized so\nit is more efficient when outputting a new image.</p>\n<p>The format of the PixelIterateDualNew method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateDualNew( PixelIteratorDualNewCallback call_back,\n                                    const PixelIteratorOptions *options,\n                                    const char *description, void *mutable_data,\n                                    const void *immutable_data, const unsigned long columns,\n                                    const unsigned long rows, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source_image,\n                                    const long source_x, const long source_y,\n                                    <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *new_image, const long new_x,\n                                    const long new_y, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>call_back:</dt>\n<dd>A user-provided C callback function which reads from\na region of source pixels and initializes a region of destination pixels.</dd>\n<dt>options:</dt>\n<dd>Pixel iterator execution options (may be NULL).</dd>\n<dt>description:</dt>\n<dd>textual description of operation being performed.</dd>\n<dt>mutable_data:</dt>\n<dd>User-provided mutable context data.</dd>\n<dt>immutable_data:</dt>\n<dd>User-provided immutable context data.</dd>\n<dt>columns:</dt>\n<dd>Width of pixel region</dd>\n<dt>rows:</dt>\n<dd>Height of pixel region</dd>\n<dt>source_image:</dt>\n<dd>The address of the constant source Image.</dd>\n<dt>source_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the source region.</dd>\n<dt>source_y:</dt>\n<dd>The vertical ordinate of the top left corner of the source region.</dd>\n<dt>new_image:</dt>\n<dd>The address of the new Image.</dd>\n<dt>new_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the new region.</dd>\n<dt>new_y:</dt>\n<dd>The vertical ordinate of the top left corner of the new region.</dd>\n<dt>exception:</dt>\n<dd>If an error is reported, this argument is updated with the reason.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixeliteratetriplemodify\">\n<h1><a class=\"toc-backref\" href=\"#id24\">PixelIterateTripleModify</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateTripleModify( PixelIteratorTripleModifyCallback call_back,\n                                         const PixelIteratorOptions *options,\n                                         const char *description, void *mutable_data,\n                                         const void *immutable_data,\n                                         const unsigned long columns, const unsigned long rows,\n                                         const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source1_image,\n                                         const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source2_image, const long source_x,\n                                         const long source_y, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *update_image,\n                                         const long update_x, const long update_y,\n                                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>PixelIterateTripleModify() iterates through pixel regions of three images\nand invokes a user-provided callback function (of type\nPixelIteratorTripleModifyCallback) for each row of pixels.  The first two\nimages are read-only, while the third image is read-write for update.\nAccess of the first two images is done lock-step using the same coordinates.\nThis is useful to support operations such as image differencing.</p>\n<p>The format of the PixelIterateTripleModify method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateTripleModify( PixelIteratorTripleModifyCallback call_back,\n                                         const PixelIteratorOptions *options,\n                                         const char *description, void *mutable_data,\n                                         const void *immutable_data,\n                                         const unsigned long columns, const unsigned long rows,\n                                         const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source1_image,\n                                         const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source2_image, const long source_x,\n                                         const long source_y, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *update_image,\n                                         const long update_x, const long update_y,\n                                         <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>call_back:</dt>\n<dd>A user-provided C callback function which reads from\na region of source pixels and updates a region of destination pixels.</dd>\n<dt>options:</dt>\n<dd>Pixel iterator execution options (may be NULL).</dd>\n<dt>description:</dt>\n<dd>textual description of operation being performed.</dd>\n<dt>mutable_data:</dt>\n<dd>User-provided mutable context data.</dd>\n<dt>immutable_data:</dt>\n<dd>User-provided immutable context data.</dd>\n<dt>columns:</dt>\n<dd>Width of pixel region</dd>\n<dt>rows:</dt>\n<dd>Height of pixel region</dd>\n<dt>source1_image:</dt>\n<dd>The address of the constant source 1 Image.</dd>\n<dt>source2_image:</dt>\n<dd>The address of the constant source 2 Image.</dd>\n<dt>source_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the source regions.</dd>\n<dt>source_y:</dt>\n<dd>The vertical ordinate of the top left corner of the source regions.</dd>\n<dt>update_image:</dt>\n<dd>The address of the update Image.</dd>\n<dt>update_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the update region.</dd>\n<dt>update_y:</dt>\n<dd>The vertical ordinate of the top left corner of the update region.</dd>\n<dt>exception:</dt>\n<dd>If an error is reported, this argument is updated with the reason.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixeliteratetriplenew\">\n<h1><a class=\"toc-backref\" href=\"#id25\">PixelIterateTripleNew</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateTripleNew( PixelIteratorTripleNewCallback call_back,\n                                      const PixelIteratorOptions *options,\n                                      const char *description, void *mutable_data,\n                                      const void *immutable_data,\n                                      const unsigned long columns, const unsigned long rows,\n                                      const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source1_image,\n                                      const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source2_image, const long source_x,\n                                      const long source_y, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *new_image,\n                                      const long new_x, const long new_y,\n                                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>PixelIterateTripleNew() iterates through pixel regions of three images\nand invokes a user-provided callback function (of type\nPixelIteratorTripleNewCallback) for each row of pixels. The first two\nimages are read-only, while the third image is read-write for update.\nAccess of the first two images is done lock-step using the same coordinates.\nThis is used if a new output image is created based on two input images.\nThe difference from PixelIterateTripleModify() is that the output pixels\nare not initialized so it is more efficient when outputting a new image.</p>\n<p>The format of the PixelIterateTripleNew method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail PixelIterateTripleNew( PixelIteratorTripleNewCallback call_back,\n                                      const PixelIteratorOptions *options,\n                                      const char *description, void *mutable_data,\n                                      const void *immutable_data,\n                                      const unsigned long columns, const unsigned long rows,\n                                      const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source1_image,\n                                      const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *source2_image, const long source_x,\n                                      const long source_y, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *new_image,\n                                      const long new_x, const long new_y,\n                                      <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>call_back:</dt>\n<dd>A user-provided C callback function which reads from\na region of source pixels and initializes a region of destination pixels.</dd>\n<dt>options:</dt>\n<dd>Pixel iterator execution options (may be NULL).</dd>\n<dt>description:</dt>\n<dd>textual description of operation being performed.</dd>\n<dt>mutable_data:</dt>\n<dd>User-provided mutable context data.</dd>\n<dt>immutable_data:</dt>\n<dd>User-provided immutable context data.</dd>\n<dt>columns:</dt>\n<dd>Width of pixel region</dd>\n<dt>rows:</dt>\n<dd>Height of pixel region</dd>\n<dt>source1_image:</dt>\n<dd>The address of the constant source 1 Image.</dd>\n<dt>source2_image:</dt>\n<dd>The address of the constant source 2 Image.</dd>\n<dt>source_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the source regions.</dd>\n<dt>source_y:</dt>\n<dd>The vertical ordinate of the top left corner of the source regions.</dd>\n<dt>new_image:</dt>\n<dd>The address of the new Image.</dd>\n<dt>new_x:</dt>\n<dd>The horizontal ordinate of the top left corner of the new region.</dd>\n<dt>new_y:</dt>\n<dd>The vertical ordinate of the top left corner of the new region.</dd>\n<dt>exception:</dt>\n<dd>If an error is reported, this argument is updated with the reason.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/plasma.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>plasma</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"plasma\">\n<h1 class=\"title\">plasma</h1>\n<h2 class=\"subtitle\" id=\"create-a-plasma-fractal-image\">Create a Plasma fractal image.</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#plasmaimage\" id=\"id1\">PlasmaImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"plasmaimage\">\n<h1><a class=\"toc-backref\" href=\"#id1\">PlasmaImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail PlasmaImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#segmentinfo\">SegmentInfo</a> *segment,\n                            unsigned long attenuate, unsigned long depth );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>PlasmaImage() initializes an image with plasma fractal values.  The image\nmust be initialized with a base color and the random number generator\nseeded before this method is called.</p>\n<p>The format of the PlasmaImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail PlasmaImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#segmentinfo\">SegmentInfo</a> *segment,\n                            unsigned long attenuate, unsigned long depth );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>segment:</dt>\n<dd>Define the region to apply plasma fractals values.</dd>\n<dt>attenuate:</dt>\n<dd>Define the plasma attenuation factor.</dd>\n<dt>depth:</dt>\n<dd>Limit the plasma recursion depth.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/profile.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>profile</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"profile\">\n<h1 class=\"title\">profile</h1>\n<h2 class=\"subtitle\" id=\"manipulate-embedded-profiles\">Manipulate embedded profiles</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#allocateimageprofileiterator\" id=\"id15\">AllocateImageProfileIterator</a></li>\n<li><a class=\"reference internal\" href=\"#appendimageprofile\" id=\"id16\">AppendImageProfile</a></li>\n<li><a class=\"reference internal\" href=\"#deallocateimageprofileiterator\" id=\"id17\">DeallocateImageProfileIterator</a></li>\n<li><a class=\"reference internal\" href=\"#deleteimageprofile\" id=\"id18\">DeleteImageProfile</a></li>\n<li><a class=\"reference internal\" href=\"#getimageprofile\" id=\"id19\">GetImageProfile</a></li>\n<li><a class=\"reference internal\" href=\"#nextimageprofile\" id=\"id20\">NextImageProfile</a></li>\n<li><a class=\"reference internal\" href=\"#profileimage\" id=\"id21\">ProfileImage</a></li>\n<li><a class=\"reference internal\" href=\"#setimageprofile\" id=\"id22\">SetImageProfile</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"allocateimageprofileiterator\">\n<h1><a class=\"toc-backref\" href=\"#id15\">AllocateImageProfileIterator</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nImageProfileIterator AllocateImageProfileIterator( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>AllocateImageProfileIterator allocates an iterator to traverse the\nimage profile list.  It is an error (i.e. will surely crash) to invoke\nDeleteImageProfile() on the profile that the iterator is currently\nreferencing.  However, it is safe to delete a profile that the iterator\nis not currently referencing. Inserting additional profiles does not\ninvalidate the current iterator.</p>\n<p>The format of the AllocateImageProfileIterator method is:</p>\n<pre class=\"literal-block\">\nImageProfileIterator AllocateImageProfileIterator( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"appendimageprofile\">\n<h1><a class=\"toc-backref\" href=\"#id16\">AppendImageProfile</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMaickPassFail AppendImageProfile( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name,\n                                  const unsigned char *profile_chunk,\n                                  const size_t chunk_length );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>AppendImageProfile adds a named profile to the image. If a profile with the\nsame name already exists, then the new profile data is appended to the\nexisting profile. If a null profile address is supplied, then an existing\nprofile is removed. The profile is copied into the image. Note that this\nfunction does not execute CMS color profiles. Any existing CMS color\nprofile is simply added/updated. Use the ProfileImage() function in order\nto execute a CMS color profile.</p>\n<p>The format of the AppendImageProfile method is:</p>\n<pre class=\"literal-block\">\nMaickPassFail AppendImageProfile( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name,\n                                  const unsigned char *profile_chunk,\n                                  const size_t chunk_length );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>name:</dt>\n<dd>Profile name. Valid names are &quot;8BIM&quot;, &quot;ICM&quot;, &quot;IPTC&quot;, XMP, or any\nunique text string.</dd>\n<dt>profile_chunk:</dt>\n<dd>Address of profile chunk to add or append. Pass zero\nto remove an existing profile.</dd>\n<dt>length:</dt>\n<dd>The length of the profile chunk to add or append.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"deallocateimageprofileiterator\">\n<h1><a class=\"toc-backref\" href=\"#id17\">DeallocateImageProfileIterator</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DeallocateImageProfileIterator( ImageProfileIterator profile_iterator );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>DeallocateImageProfileIterator deallocates an image profile iterator.</p>\n<p>The format of the DeallocateImageProfileIterator method is:</p>\n<pre class=\"literal-block\">\nvoid DeallocateImageProfileIterator( ImageProfileIterator profile_iterator );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>profile_iterator:</dt>\n<dd>Profile iterator to deallocate.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"deleteimageprofile\">\n<h1><a class=\"toc-backref\" href=\"#id18\">DeleteImageProfile</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int DeleteImageProfile( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>DeleteImageProfile removes a named profile from the image.</p>\n<p>The format of the DeleteImageProfile method is:</p>\n<pre class=\"literal-block\">\nunsigned int DeleteImageProfile( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>name:</dt>\n<dd>Profile name. Valid names are &quot;8BIM&quot;, &quot;ICM&quot;, &amp; &quot;IPTC&quot; or a\ngeneric profile name.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimageprofile\">\n<h1><a class=\"toc-backref\" href=\"#id19\">GetImageProfile</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst unsigned char *GetImageProfile( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name,\n                                      size_t *length );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>GetImageProfile returns a pointer to the named image profile if it is\npresent. A null pointer is returned if the named profile is not present.</p>\n<p>Older versions of this function stored profiles named &quot;8BIM&quot; and &quot;IPTC&quot;\nin the same storage location.  This is no longer the case.  However,\nGetImageProfile() will try the alternate name if the specifically\nrequested profile name is not available.</p>\n<p>The format of the GetImageProfile method is:</p>\n<pre class=\"literal-block\">\nconst unsigned char *GetImageProfile( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name,\n                                      size_t *length );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>name:</dt>\n<dd>Profile name. Valid names are &quot;8BIM&quot;, &quot;ICM&quot;, &quot;IPTC&quot;, &quot;XMP&quot; or any\nunique text string.</dd>\n<dt>length:</dt>\n<dd>Updated with profile length if profile is present.  Set to NULL\nif length is not needed.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"nextimageprofile\">\n<h1><a class=\"toc-backref\" href=\"#id20\">NextImageProfile</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail NextImageProfile( ImageProfileIterator profile_iterator, const char ** name,\n                                 const unsigned char ** profile, size_t *length );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>NextImageProfile iterates forward to the next image profile. The profile\nname is returned along with the profile data, and length.  If there are\nno more entries in the list, then MagickFail is returned.</p>\n<p>The format of the AllocateImageProfileIterator method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail NextImageProfile( ImageProfileIterator profile_iterator, const char ** name,\n                                 const unsigned char ** profile, size_t *length );\n</pre>\n<dl class=\"docutils\">\n<dt>profile_iterator:</dt>\n<dd>Profile iterator.</dd>\n<dt>name:</dt>\n<dd>Address of pointer to update with address of name.</dd>\n<dt>profile:</dt>\n<dd>Address of pointer to update with location of profile data.</dd>\n<dt>length:</dt>\n<dd>Address of parameter to update with profile length.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"profileimage\">\n<h1><a class=\"toc-backref\" href=\"#id21\">ProfileImage</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int ProfileImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name, unsigned char *profile,\n                           const size_t length, unsigned int clone );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>ProfileImage() adds, applies, or removes a ICM, IPTC, or generic profile\nfrom an image.  If the profile is NULL, it is removed from the image\notherwise added (or applied).  Use a name of '*' and a profile of NULL to\nremove all profiles from the image. Ownership of the profile is\ntransferred to GraphicsMagick (it should not be altered or deallocated)\nunless the clone option is set to True.</p>\n<p>ICC ICM profiles are a special case and are handled as follows:</p>\n<p>If there is no ICM profile currently associated with the image, then\nthe profile is simply associated with the image and the image pixels\nare not altered.</p>\n<p>If there is already a ICM profile associated with the image, then\nthe colorspace transform described by the existing and new profiles\nis applied to the image pixels, and the new profile is associated\nwith the image.</p>\n<p>The format of the ProfileImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int ProfileImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name, unsigned char *profile,\n                           const size_t length, unsigned int clone );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>name:</dt>\n<dd>Name of profile to add or remove: ICM, IPTC, or generic profile.</dd>\n<dt>profile:</dt>\n<dd>The profile.  Can not be 'const' due to 'clone' option but\nis treated as 'const' if 'clone' is set to MagickTrue.</dd>\n<dt>length:</dt>\n<dd>The length of the profile.</dd>\n<dt>clone:</dt>\n<dd>If set True, then copy the profile rather than taking\nownership of it.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setimageprofile\">\n<h1><a class=\"toc-backref\" href=\"#id22\">SetImageProfile</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int SetImageProfile( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name, const unsigned char *profile,\n                              const size_t length );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>SetImageProfile adds a named profile to the image. If a profile with the\nsame name already exists, then it is replaced. If a null profile address\nis supplied, then an existing profile is removed. The profile is copied\ninto the image. Note that this function does not execute CMS color\nprofiles. Any existing CMS color profile is simply replaced. Use the\nProfileImage() function in order to execute a CMS color profile.</p>\n<p>Older versions of this function stored profiles named &quot;8BIM&quot; and &quot;IPTC&quot;\nin the same storage location.  This is no longer the case.  However,\nGetImageProfile() will try the alternate name if the specifically\nrequested profile name is not available.  Note that when trying to remove\na profile, it may be necessary to remove both names in order for an\n&quot;IPTC&quot; profile to no longer be included in output file formats.</p>\n<p>The format of the SetImageProfile method is:</p>\n<pre class=\"literal-block\">\nunsigned int SetImageProfile( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const char *name, const unsigned char *profile,\n                              const size_t length );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>name:</dt>\n<dd>Profile name. Valid names are &quot;8BIM&quot;, &quot;ICM&quot;, &quot;IPTC&quot;, XMP, or any\nunique text string.</dd>\n<dt>profile:</dt>\n<dd>Address of profile to add. Pass zero to remove an existing\nprofile.</dd>\n<dt>length:</dt>\n<dd>The length of the profile.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/quantize.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>quantize</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"quantize\">\n<h1 class=\"title\">quantize</h1>\n<h2 class=\"subtitle\" id=\"reduce-the-number-of-colors-in-an-image\">Reduce the number of colors in an image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#clonequantizeinfo\" id=\"id21\">CloneQuantizeInfo</a></li>\n<li><a class=\"reference internal\" href=\"#compressimagecolormap\" id=\"id22\">CompressImageColormap</a></li>\n<li><a class=\"reference internal\" href=\"#destroyquantizeinfo\" id=\"id23\">DestroyQuantizeInfo</a></li>\n<li><a class=\"reference internal\" href=\"#getimagequantizeerror\" id=\"id24\">GetImageQuantizeError</a></li>\n<li><a class=\"reference internal\" href=\"#getquantizeinfo\" id=\"id25\">GetQuantizeInfo</a></li>\n<li><a class=\"reference internal\" href=\"#grayscalepseudoclassimage\" id=\"id26\">GrayscalePseudoClassImage</a></li>\n<li><a class=\"reference internal\" href=\"#mapimage\" id=\"id27\">MapImage</a></li>\n<li><a class=\"reference internal\" href=\"#mapimages\" id=\"id28\">MapImages</a></li>\n<li><a class=\"reference internal\" href=\"#orderedditherimage\" id=\"id29\">OrderedDitherImage</a></li>\n<li><a class=\"reference internal\" href=\"#quantizeimage\" id=\"id30\">QuantizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#quantizeimages\" id=\"id31\">QuantizeImages</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"clonequantizeinfo\">\n<h1><a class=\"toc-backref\" href=\"#id21\">CloneQuantizeInfo</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *CloneQuantizeInfo( const <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>CloneQuantizeInfo() makes a duplicate of the given quantize info structure,\nor if quantize info is NULL, a new one.</p>\n<p>The format of the CloneQuantizeInfo method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *CloneQuantizeInfo( const <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>clone_info:</dt>\n<dd>Method CloneQuantizeInfo returns a duplicate of the given\nquantize info, or if image info is NULL a new one.</dd>\n<dt>quantize_info:</dt>\n<dd>a structure of type info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"compressimagecolormap\">\n<h1><a class=\"toc-backref\" href=\"#id22\">CompressImageColormap</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid CompressImageColormap( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>CompressImageColormap() compresses an image colormap by removing any\nduplicate or unused color entries.</p>\n<p>The format of the CompressImageColormap method is:</p>\n<pre class=\"literal-block\">\nvoid CompressImageColormap( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroyquantizeinfo\">\n<h1><a class=\"toc-backref\" href=\"#id23\">DestroyQuantizeInfo</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nDestroyQuantizeInfo( <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>DestroyQuantizeInfo() deallocates memory associated with an QuantizeInfo\nstructure.</p>\n<p>The format of the DestroyQuantizeInfo method is:</p>\n<pre class=\"literal-block\">\nDestroyQuantizeInfo( <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>quantize_info:</dt>\n<dd>Specifies a pointer to an QuantizeInfo structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagequantizeerror\">\n<h1><a class=\"toc-backref\" href=\"#id24\">GetImageQuantizeError</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int GetImageQuantizeError( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>GetImageQuantizeError() measures the difference between the original\nand quantized images.  This difference is the total quantization error.\nThe error is computed by summing over all pixels in an image the distance\nsquared in RGB space between each reference pixel value and its quantized\nvalue.  These values are computed:</p>\n<p>o mean_error_per_pixel:  This value is the mean error for any single\npixel in the image.</p>\n<p>o normalized_mean_square_error:  This value is the normalized mean\nquantization error for any single pixel in the image.  This distance\nmeasure is normalized to a range between 0 and 1.  It is independent\nof the range of red, green, and blue values in the image.</p>\n<p>o normalized_maximum_square_error:  This value is the normalized\nmaximum quantization error for any single pixel in the image.  This\ndistance measure is normalized to a range between 0 and 1.  It is\nindependent of the range of red, green, and blue values in your image.</p>\n<p>The format of the GetImageQuantizeError method is:</p>\n<pre class=\"literal-block\">\nunsigned int GetImageQuantizeError( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows.</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Specifies a pointer to an Image structure;  returned from\nReadImage.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getquantizeinfo\">\n<h1><a class=\"toc-backref\" href=\"#id25\">GetQuantizeInfo</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nGetQuantizeInfo( <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>GetQuantizeInfo() initializes the QuantizeInfo structure.</p>\n<p>The format of the GetQuantizeInfo method is:</p>\n<pre class=\"literal-block\">\nGetQuantizeInfo( <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>quantize_info:</dt>\n<dd>Specifies a pointer to a QuantizeInfo structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"grayscalepseudoclassimage\">\n<h1><a class=\"toc-backref\" href=\"#id26\">GrayscalePseudoClassImage</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid GrayscalePseudoClassImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>GrayscalePseudoClassImage converts an image to a PseudoClass\ngrayscale representation with an (optionally) compressed and sorted\ncolormap. Colormap is ordered by increasing intensity.</p>\n<p>The format of the GrayscalePseudoClassImage method is:</p>\n<pre class=\"literal-block\">\nvoid GrayscalePseudoClassImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>optimize_colormap:</dt>\n<dd>If true, produce an optimimal (compact) colormap.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"mapimage\">\n<h1><a class=\"toc-backref\" href=\"#id27\">MapImage</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MapImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *map_image,\n                       const unsigned int dither );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>MapImage() replaces the colors of an image with the closest color from a\nreference image.</p>\n<p>The format of the MapImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MapImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *map_image,\n                       const unsigned int dither );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Specifies a pointer to an Image structure.</dd>\n<dt>map_image:</dt>\n<dd>Specifies a pointer to an Image structure.  Reduce\nimage to a set of colors represented by this image.</dd>\n<dt>dither:</dt>\n<dd>Set this integer value to something other than zero to\ndither the quantized image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"mapimages\">\n<h1><a class=\"toc-backref\" href=\"#id28\">MapImages</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MapImages( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *map_image, const unsigned int dither );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>MapImages() replaces the colors of a sequence of images with the closest\ncolor from a reference image. If the reference image does not contain a\ncolormap, then a colormap will be created based on existing colors in the\nreference image. The order and number of colormap entries does not match\nthe reference image.  If the order and number of colormap entries needs to\nmatch the reference image, then the ReplaceImageColormap() function may be\nused after invoking MapImages() in order to apply the reference colormap.</p>\n<p>The format of the MapImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MapImages( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *map_image, const unsigned int dither );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Specifies a pointer to a set of Image structures.</dd>\n<dt>map_image:</dt>\n<dd>Specifies a pointer to an Image structure.  Reduce\nimage to a set of colors represented by this image.</dd>\n<dt>dither:</dt>\n<dd>Set this integer value to something other than zero to\ndither the quantized image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"orderedditherimage\">\n<h1><a class=\"toc-backref\" href=\"#id29\">OrderedDitherImage</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int OrderedDitherImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>OrderedDitherImage() uses the ordered dithering technique of reducing color\nimages to monochrome using positional information to retain as much\ninformation as possible.</p>\n<p>The format of the OrderedDitherImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int OrderedDitherImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows.</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Specifies a pointer to an Image structure;  returned from\nReadImage.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"quantizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id30\">QuantizeImage</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int QuantizeImage( const <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>QuantizeImage() analyzes the colors within a reference image and chooses a\nfixed number of colors to represent the image.  The goal of the algorithm\nis to minimize the color difference between the input and output image while\nminimizing the processing time.</p>\n<p>The format of the QuantizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int QuantizeImage( const <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<dl class=\"docutils\">\n<dt>quantize_info:</dt>\n<dd>Specifies a pointer to an QuantizeInfo structure.</dd>\n<dt>image:</dt>\n<dd>Specifies a pointer to an Image structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"quantizeimages\">\n<h1><a class=\"toc-backref\" href=\"#id31\">QuantizeImages</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int QuantizeImages( const <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>QuantizeImages() analyzes the colors within a set of reference images and\nchooses a fixed number of colors to represent the set.  The goal of the\nalgorithm is to minimize the color difference between the input and output\nimages while minimizing the processing time.</p>\n<p>The format of the QuantizeImages method is:</p>\n<pre class=\"literal-block\">\nunsigned int QuantizeImages( const <a class=\"reference external\" href=\"../api/types.html#quantizeinfo\">QuantizeInfo</a> *quantize_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *images );\n</pre>\n<dl class=\"docutils\">\n<dt>quantize_info:</dt>\n<dd>Specifies a pointer to an QuantizeInfo structure.</dd>\n<dt>images:</dt>\n<dd>Specifies a pointer to a list of Image structures.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/registry.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>registry</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"registry\">\n<h1 class=\"title\">registry</h1>\n<h2 class=\"subtitle\" id=\"in-memory-image-registration-interface\">In-memory image registration interface</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#deletemagickregistry\" id=\"id7\">DeleteMagickRegistry</a></li>\n<li><a class=\"reference internal\" href=\"#getimagefrommagickregistry\" id=\"id8\">GetImageFromMagickRegistry</a></li>\n<li><a class=\"reference internal\" href=\"#getmagickregistry\" id=\"id9\">GetMagickRegistry</a></li>\n<li><a class=\"reference internal\" href=\"#setmagickregistry\" id=\"id10\">SetMagickRegistry</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"deletemagickregistry\">\n<h1><a class=\"toc-backref\" href=\"#id7\">DeleteMagickRegistry</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail DeleteMagickRegistry( const long id );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>DeleteMagickRegistry() deletes an entry in the registry as defined by the\nid.  It returns MagickPass if the entry is deleted otherwise MagickFail if\nno entry is found in the registry that matches the id.</p>\n<p>The format of the DeleteMagickRegistry method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail DeleteMagickRegistry( const long id );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>id:</dt>\n<dd>The registry id.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getimagefrommagickregistry\">\n<h1><a class=\"toc-backref\" href=\"#id8\">GetImageFromMagickRegistry</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetImageFromMagickRegistry( const char *name, long *id,\n                                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>GetImageFromMagickRegistry() gets an image from the registry as defined by\nits name.  If the blob that matches the name is not found, NULL is returned.</p>\n<p>The format of the GetImageFromMagickRegistry method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *GetImageFromMagickRegistry( const char *name, long *id,\n                                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>name:</dt>\n<dd>The name of the image to retrieve from the registry.</dd>\n<dt>id:</dt>\n<dd>The registry id.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getmagickregistry\">\n<h1><a class=\"toc-backref\" href=\"#id9\">GetMagickRegistry</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst void *GetMagickRegistry( const long id, <a class=\"reference external\" href=\"../api/types.html#registrytype\">RegistryType</a> *type, size_t *length,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>GetMagickRegistry() gets a blob from the registry as defined by the id.  If\nthe blob that matches the id is not found, NULL is returned.</p>\n<p>The format of the GetMagickRegistry method is:</p>\n<pre class=\"literal-block\">\nconst void *GetMagickRegistry( const long id, <a class=\"reference external\" href=\"../api/types.html#registrytype\">RegistryType</a> *type, size_t *length,\n                               <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>id:</dt>\n<dd>The registry id.</dd>\n<dt>type:</dt>\n<dd>The registry type.</dd>\n<dt>length:</dt>\n<dd>The blob length in number of bytes.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setmagickregistry\">\n<h1><a class=\"toc-backref\" href=\"#id10\">SetMagickRegistry</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nlong SetMagickRegistry( const <a class=\"reference external\" href=\"../api/types.html#registrytype\">RegistryType</a> type, const void *blob, const size_t length,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>SetMagickRegistry() sets a blob into the registry and returns a unique ID.\nIf an error occurs, -1 is returned.</p>\n<p>The format of the SetMagickRegistry method is:</p>\n<pre class=\"literal-block\">\nlong SetMagickRegistry( const <a class=\"reference external\" href=\"../api/types.html#registrytype\">RegistryType</a> type, const void *blob, const size_t length,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>type:</dt>\n<dd>The registry type.</dd>\n<dt>blob:</dt>\n<dd>The address of a Binary Large OBject.</dd>\n<dt>length:</dt>\n<dd>For a registry type of ImageRegistryType use sizeof(Image)\notherise the blob length in number of bytes.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/render.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>render</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"render\">\n<h1 class=\"title\">render</h1>\n<h2 class=\"subtitle\" id=\"low-level-methods-to-draw-on-an-image\">Low-level methods to draw on an image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#clonedrawinfo\" id=\"id13\">CloneDrawInfo</a></li>\n<li><a class=\"reference internal\" href=\"#destroydrawinfo\" id=\"id14\">DestroyDrawInfo</a></li>\n<li><a class=\"reference internal\" href=\"#drawaffineimage\" id=\"id15\">DrawAffineImage</a></li>\n<li><a class=\"reference internal\" href=\"#drawclippath\" id=\"id16\">DrawClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawcompositemask\" id=\"id17\">DrawCompositeMask</a></li>\n<li><a class=\"reference internal\" href=\"#drawimage\" id=\"id18\">DrawImage</a></li>\n<li><a class=\"reference internal\" href=\"#drawpatternpath\" id=\"id19\">DrawPatternPath</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"clonedrawinfo\">\n<h1><a class=\"toc-backref\" href=\"#id13\">CloneDrawInfo</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *CloneDrawInfo( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>CloneDrawInfo() makes a copy of the given draw info structure.  If NULL\nis specified, a new DrawInfo structure is created initialized to\ndefault values.</p>\n<p>The format of the CloneDrawInfo method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *CloneDrawInfo( const <a class=\"reference external\" href=\"../api/types.html#imageinfo\">ImageInfo</a> *image_info, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info );\n</pre>\n<dl class=\"docutils\">\n<dt>image_info:</dt>\n<dd>The image info.</dd>\n<dt>draw_info:</dt>\n<dd>The draw info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroydrawinfo\">\n<h1><a class=\"toc-backref\" href=\"#id14\">DestroyDrawInfo</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyDrawInfo( <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>DestroyDrawInfo() deallocates memory associated with an DrawInfo\nstructure.</p>\n<p>The format of the DestroyDrawInfo method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyDrawInfo( <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>draw_info:</dt>\n<dd>The draw info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawaffineimage\">\n<h1><a class=\"toc-backref\" href=\"#id15\">DrawAffineImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int DrawAffineImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *composite,\n                              const <a class=\"reference external\" href=\"../api/types.html#affinematrix\">AffineMatrix</a> *affine );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>DrawAffineImage() composites the source over the destination image as\ndictated by the affine transform.</p>\n<p>The format of the DrawAffineImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int DrawAffineImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *composite,\n                              const <a class=\"reference external\" href=\"../api/types.html#affinematrix\">AffineMatrix</a> *affine );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>image:</dt>\n<dd>The composite image.</dd>\n<dt>affine:</dt>\n<dd>The affine transform.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawclippath\">\n<h1><a class=\"toc-backref\" href=\"#id16\">DrawClipPath</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail DrawClipPath( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                             const char *name );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>DrawClipPath() draws the clip path on the image mask.</p>\n<p>The format of the DrawClipPath method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail DrawClipPath( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                             const char *name );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>draw_info:</dt>\n<dd>The draw info.</dd>\n<dt>name:</dt>\n<dd>The name of the clip path.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawcompositemask\">\n<h1><a class=\"toc-backref\" href=\"#id17\">DrawCompositeMask</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail DrawCompositeMask( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                                  const char *name );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>DrawCompositeMask() draws the composite mask on the image mask.</p>\n<p>The format of the DrawCompositeMask method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail DrawCompositeMask( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                                  const char *name );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>draw_info:</dt>\n<dd>The draw info.</dd>\n<dt>name:</dt>\n<dd>The name of the composite mask.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawimage\">\n<h1><a class=\"toc-backref\" href=\"#id18\">DrawImage</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail DrawImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>Use DrawImage() to draw a graphic primitive on your image.  The primitive\nmay be represented as a string or filename.  Precede the filename with an\n&quot;at&quot; sign (&#64;) and the contents of the file are drawn on the image.  You\ncan affect how text is drawn by setting one or more members of the draw\ninfo structure.</p>\n<p>The format of the drawing primitive text is known as &quot;MVG&quot; (&quot;Magick\nVector Graphics&quot;), which is a powerful yet simple drawing syntax fronted\nby the &quot;MVG&quot; coder, and substantially supporting W3C SVG 1.1\n(<a class=\"reference external\" href=\"https://www.w3.org/TR/SVG11/\">https://www.w3.org/TR/SVG11/</a>) rendering when fronted by the &quot;SVG&quot; coder\n(which translates SVG into MVG).  The parser is non-validating and in fact\nis designed to attempt to skip over unhandled textual elements which may be\npassed through from the SVG coder. While being used as the basis of a useful\nW3C SVG implementation and while SVG is commonly used on the &quot;web&quot; as an\nuntrusted input such as within web browsers, this implementation is not\ndesigned to handle arbitrary untrusted inputs delivered from the &quot;Internet&quot;.\nThe drawing capabilities are best used under controlled circumstances\nwhere drawing inputs can be reasonably trusted.</p>\n<p>Note that this is a legacy interface. Authors of new code should consider\nusing the Draw* methods defined by magick/draw.h since they are better\ndocumented and less error prone.</p>\n<p>The format of the DrawImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail DrawImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>draw_info:</dt>\n<dd>The draw info.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpatternpath\">\n<h1><a class=\"toc-backref\" href=\"#id19\">DrawPatternPath</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail DrawPatternPath( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                                const char *name, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** pattern );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>DrawPatternPath() draws a pattern.</p>\n<p>The format of the DrawPatternPath method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail DrawPatternPath( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info,\n                                const char *name, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** pattern );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>draw_info:</dt>\n<dd>The draw info.</dd>\n<dt>name:</dt>\n<dd>The pattern name.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/resize.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>resize</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"resize\">\n<h1 class=\"title\">resize</h1>\n<h2 class=\"subtitle\" id=\"resize-an-image\">Resize an image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#magnifyimage\" id=\"id11\">MagnifyImage</a></li>\n<li><a class=\"reference internal\" href=\"#minifyimage\" id=\"id12\">MinifyImage</a></li>\n<li><a class=\"reference internal\" href=\"#resizeimage\" id=\"id13\">ResizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#sampleimage\" id=\"id14\">SampleImage</a></li>\n<li><a class=\"reference internal\" href=\"#scaleimage\" id=\"id15\">ScaleImage</a></li>\n<li><a class=\"reference internal\" href=\"#thumbnailimage\" id=\"id16\">ThumbnailImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"magnifyimage\">\n<h1><a class=\"toc-backref\" href=\"#id11\">MagnifyImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MagnifyImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>MagnifyImage() is a convenience method that scales an image proportionally\nto twice its size.</p>\n<p>The format of the MagnifyImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MagnifyImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"minifyimage\">\n<h1><a class=\"toc-backref\" href=\"#id12\">MinifyImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MinifyImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>MinifyImage() is a convenience method that scales an image proportionally\nto half its size.</p>\n<p>The format of the MinifyImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MinifyImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"resizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id13\">ResizeImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ResizeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns, const unsigned long rows,\n                    const <a class=\"reference external\" href=\"../api/types.html#filtertype\">FilterTypes</a> filter, const double blur,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>ResizeImage() scales an image to the desired dimensions with one of these\nfilters:</p>\n<p>Bessel   Blackman   Box\nCatrom   Cubic      Gaussian\nHanning  Hermite    Lanczos\nMitchell Point      Quandratic\nSinc     Triangle</p>\n<p>Most of the filters are FIR (finite impulse response), however, Bessel,\nGaussian, and Sinc are IIR (infinite impulse response).  Bessel and Sinc\nare windowed (brought down to zero) with the Blackman filter.</p>\n<p>ResizeImage() was inspired by Paul Heckbert's zoom program.</p>\n<p>The format of the ResizeImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ResizeImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns, const unsigned long rows,\n                    const <a class=\"reference external\" href=\"../api/types.html#filtertype\">FilterTypes</a> filter, const double blur,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>columns:</dt>\n<dd>The number of columns in the scaled image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the scaled image.</dd>\n<dt>filter:</dt>\n<dd>Image filter to use.</dd>\n<dt>blur:</dt>\n<dd>The blur factor where &gt; 1 is blurry, &lt; 1 is sharp.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"sampleimage\">\n<h1><a class=\"toc-backref\" href=\"#id14\">SampleImage</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SampleImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns,\n                    const unsigned long rows, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>SampleImage() scales an image to the desired dimensions with pixel\nsampling.  Unlike other scaling methods, this method does not introduce\nany additional color into the scaled image.</p>\n<p>The format of the SampleImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *SampleImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns,\n                    const unsigned long rows, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>columns:</dt>\n<dd>The number of columns in the sampled image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the sampled image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"scaleimage\">\n<h1><a class=\"toc-backref\" href=\"#id15\">ScaleImage</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ScaleImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns,\n                   const unsigned long rows, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>ScaleImage() changes the size of an image to the given dimensions.</p>\n<p>The format of the ScaleImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ScaleImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns,\n                   const unsigned long rows, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>columns:</dt>\n<dd>The number of columns in the scaled image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the scaled image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"thumbnailimage\">\n<h1><a class=\"toc-backref\" href=\"#id16\">ThumbnailImage</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ThumbnailImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns,\n                       const unsigned long rows, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>ThumbnailImage() changes the size of an image to the given dimensions.\nThis method was designed by Bob Friesenhahn as a low cost thumbnail\ngenerator.</p>\n<p>The format of the ThumbnailImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ThumbnailImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const unsigned long columns,\n                       const unsigned long rows, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>columns:</dt>\n<dd>The number of columns in the scaled image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the scaled image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/resource.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>resource</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"resource\">\n<h1 class=\"title\">resource</h1>\n<h2 class=\"subtitle\" id=\"set-resource-consumption-limits-e-g-memory\">Set resource consumption limits (e.g. memory)</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#acquiremagickresource\" id=\"id11\">AcquireMagickResource</a></li>\n<li><a class=\"reference internal\" href=\"#getmagickresource\" id=\"id12\">GetMagickResource</a></li>\n<li><a class=\"reference internal\" href=\"#getmagickresourcelimit\" id=\"id13\">GetMagickResourceLimit</a></li>\n<li><a class=\"reference internal\" href=\"#liberatemagickresource\" id=\"id14\">LiberateMagickResource</a></li>\n<li><a class=\"reference internal\" href=\"#listmagickresourceinfo\" id=\"id15\">ListMagickResourceInfo</a></li>\n<li><a class=\"reference internal\" href=\"#setmagickresourcelimit\" id=\"id16\">SetMagickResourceLimit</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"acquiremagickresource\">\n<h1><a class=\"toc-backref\" href=\"#id11\">AcquireMagickResource</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail AcquireMagickResource( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type, const magick_int64_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>AcquireMagickResource() acquires resources of the specified type.  True is\nreturned if the specified resource is available otherwise False.</p>\n<p>The format of the AcquireMagickResource() method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail AcquireMagickResource( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type, const magick_int64_t size );\n</pre>\n<dl class=\"docutils\">\n<dt>type:</dt>\n<dd>The type of resource.</dd>\n<dt>size:</dt>\n<dd>The number of bytes needed from for this resource.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getmagickresource\">\n<h1><a class=\"toc-backref\" href=\"#id12\">GetMagickResource</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nmagick_uint64_t GetMagickResource( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>GetMagickResource() returns the current consumption level for the\nspecified resource type.</p>\n<p>The format of the GetMagickResource() method is:</p>\n<pre class=\"literal-block\">\nmagick_uint64_t GetMagickResource( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>type:</dt>\n<dd>The type of resource.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getmagickresourcelimit\">\n<h1><a class=\"toc-backref\" href=\"#id13\">GetMagickResourceLimit</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nmagick_int64_t GetMagickResourceLimit( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>GetMagickResourceLimit() returns the current maximum limit for the\nspecified resource type.  Returns a maximum 64-bit integer value if\nthe resource has not been limited.</p>\n<p>The format of the GetMagickResourceLimit() method is:</p>\n<pre class=\"literal-block\">\nmagick_int64_t GetMagickResourceLimit( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>type:</dt>\n<dd>The type of resource.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"liberatemagickresource\">\n<h1><a class=\"toc-backref\" href=\"#id14\">LiberateMagickResource</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid LiberateMagickResource( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type, const magick_int64_t size );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>LiberateMagickResource() liberates resources of the specified type.</p>\n<p>The format of the LiberateMagickResource() method is:</p>\n<pre class=\"literal-block\">\nvoid LiberateMagickResource( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type, const magick_int64_t size );\n</pre>\n<dl class=\"docutils\">\n<dt>type:</dt>\n<dd>The type of resource.</dd>\n<dt>size:</dt>\n<dd>The size of the resource.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"listmagickresourceinfo\">\n<h1><a class=\"toc-backref\" href=\"#id15\">ListMagickResourceInfo</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int ListMagickResourceInfo( FILE *file, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>Method ListMagickResourceInfo lists the resource info to a file.</p>\n<p>The format of the ListMagickResourceInfo method is:</p>\n<pre class=\"literal-block\">\nunsigned int ListMagickResourceInfo( FILE *file, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows.</p>\n<dl class=\"docutils\">\n<dt>file:</dt>\n<dd>An pointer to a FILE.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"setmagickresourcelimit\">\n<h1><a class=\"toc-backref\" href=\"#id16\">SetMagickResourceLimit</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid SetMagickResourceLimit( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type, const unsigned long limit );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>SetMagickResourceLimit() sets the limit for a particular resource.  The\nunits for resource types are as follows:</p>\n<p>DiskResource    -- Bytes\nFileResource    -- Open files\nMapResource     -- Bytes\nMemoryResource  -- Bytes\nPixelsResource  -- Pixels\nThreadsResource -- Threads\nWidthResource   -- Pixels\nHeightResource  -- Pixels</p>\n<p>The format of the SetMagickResourceLimit() method is:</p>\n<pre class=\"literal-block\">\nvoid SetMagickResourceLimit( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type, const unsigned long limit );\n</pre>\n<dl class=\"docutils\">\n<dt>type:</dt>\n<dd>The type of resource.</dd>\n<dt>limit:</dt>\n<dd>The maximum limit for the resource.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/segment.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>segment</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"segment\">\n<h1 class=\"title\">segment</h1>\n<h2 class=\"subtitle\" id=\"segment-and-image-with-thresholding-using-the-fuzzy-c-means-method\">Segment and image with thresholding using the fuzzy c-means method</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#segmentimage\" id=\"id1\">SegmentImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"segmentimage\">\n<h1><a class=\"toc-backref\" href=\"#id1\">SegmentImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail SegmentImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> colorspace,\n                             const unsigned int verbose, const double cluster_threshold,\n                             const double smoothing_threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>Method SegmentImage segment an image by analyzing the histograms of the\ncolor components and identifying units that are homogeneous with the fuzzy\nc-means technique.</p>\n<p>Specify cluster threshold as the number of pixels in each cluster must\nexceed the the cluster threshold to be considered valid.  Smoothing\nthreshold eliminates noise in the second derivative of the histogram.\nAs the value is increased, you can expect a smoother second derivative.\nThe default is 1.5.</p>\n<p>The format of the SegmentImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail SegmentImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> colorspace,\n                             const unsigned int verbose, const double cluster_threshold,\n                             const double smoothing_threshold );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>Specifies a pointer to an Image structure;  returned from\nReadImage.</dd>\n<dt>colorspace:</dt>\n<dd>An unsigned integer value that indicates the colorspace.\nEmpirical evidence suggests that distances in YUV or YIQ correspond to\nperceptual color differences more closely than do distances in RGB\nspace.  The image is then returned to RGB colorspace after color\nreduction.</dd>\n<dt>verbose:</dt>\n<dd>A value greater than zero prints detailed information about\nthe identified classes.</dd>\n<dt>cluster_threshold:</dt>\n<dd>The minimum number of total pixels contained\nin a hexahedra before it can be considered valid (expressed as a\npercentage of total pixels).  This is used to eliminate seldom\nused colors.</dd>\n<dt>smoothing_threshold:</dt>\n<dd>If the absolute value of a second derivative\npoint is less than smoothing_threshold then that derivative point\nis ignored (i.e. set to 0) while evaluating zero crossings.  This\ncauses small variations (could be noise) to be ignored.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/shear.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>shear</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"shear\">\n<h1 class=\"title\">shear</h1>\n<h2 class=\"subtitle\" id=\"rotate-image-shear-image-or-apply-a-2d-affine-transformation\">Rotate image, shear image, or apply a 2D affine transformation</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#affinetransformimage\" id=\"id7\">AffineTransformImage</a></li>\n<li><a class=\"reference internal\" href=\"#autoorientimage\" id=\"id8\">AutoOrientImage</a></li>\n<li><a class=\"reference internal\" href=\"#rotateimage\" id=\"id9\">RotateImage</a></li>\n<li><a class=\"reference internal\" href=\"#shearimage\" id=\"id10\">ShearImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"affinetransformimage\">\n<h1><a class=\"toc-backref\" href=\"#id7\">AffineTransformImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AffineTransformImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#affinematrix\">AffineMatrix</a> *affine,\n                             <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>AffineTransformImage() transforms an image as dictated by the affine matrix.\nIt allocates the memory necessary for the new Image structure and returns\na pointer to the new image.</p>\n<p>The format of the AffineTransformImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AffineTransformImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#affinematrix\">AffineMatrix</a> *affine,\n                             <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>affine:</dt>\n<dd>The affine transform.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"autoorientimage\">\n<h1><a class=\"toc-backref\" href=\"#id8\">AutoOrientImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AutoOrientImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const OrientationType current_orientation,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>AutoOrientImage() returns an image adjusted so that its orientation is\nsuitable for viewing (i.e. top-left orientation).</p>\n<p>The format of the AutoOrientImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *AutoOrientImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const OrientationType current_orientation,\n                        <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>current_orientation:</dt>\n<dd>Current image orientation (normally same as\nimage-&gt;orientation).</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"rotateimage\">\n<h1><a class=\"toc-backref\" href=\"#id9\">RotateImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *RotateImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double degrees,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>Method RotateImage creates a new image that is a rotated copy of an\nexisting one.  Positive angles rotate counter-clockwise (right-hand rule),\nwhile negative angles rotate clockwise.  Rotated images are usually larger\nthan the originals and have 'empty' triangular corners.  X axis.  Empty\ntriangles left over from shearing the image are filled with the color\nspecified by the image background_color.  RotateImage allocates the memory\nnecessary for the new Image structure and returns a pointer to the new\nimage.</p>\n<p>Method RotateImage is based on the paper &quot;A Fast Algorithm for General\nRaster Rotatation&quot; by Alan W. Paeth.  RotateImage is adapted from a similar\nmethod based on the Paeth paper written by Michael Halle of the Spatial\nImaging Group, MIT Media Lab.</p>\n<p>The format of the RotateImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *RotateImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double degrees,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method RotateImage returns a pointer to the image after\nrotating.  A null image is returned if there is a memory shortage.</dd>\n<dt>image:</dt>\n<dd>The image;  returned from\nReadImage.</dd>\n<dt>degrees:</dt>\n<dd>Specifies the number of degrees to rotate the image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"shearimage\">\n<h1><a class=\"toc-backref\" href=\"#id10\">ShearImage</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ShearImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double x_shear, const double y_shear,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>Method ShearImage creates a new image that is a shear_image copy of an\nexisting one.  Shearing slides one edge of an image along the X or Y\naxis, creating a parallelogram.  An X direction shear slides an edge\nalong the X axis, while a Y direction shear slides an edge along the Y\naxis.  The amount of the shear is controlled by a shear angle.  For X\ndirection shears, x_shear is measured relative to the Y axis, and\nsimilarly, for Y direction shears y_shear is measured relative to the\nX axis.  Empty triangles left over from shearing the image are filled\nwith the color defined by the pixel at location (0,0).  ShearImage\nallocates the memory necessary for the new Image structure and returns\na pointer to the new image.</p>\n<p>Method ShearImage is based on the paper &quot;A Fast Algorithm for General\nRaster Rotatation&quot; by Alan W. Paeth.</p>\n<p>The format of the ShearImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ShearImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const double x_shear, const double y_shear,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method ShearImage returns a pointer to the image after\nrotating.  A null image is returned if there is a memory shortage.</dd>\n<dt>image:</dt>\n<dd>The image;  returned from\nReadImage.</dd>\n<dt>x_shear, y_shear:</dt>\n<dd>Specifies the number of degrees to shear the image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/signature.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>signature</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"signature\">\n<h1 class=\"title\">signature</h1>\n<h2 class=\"subtitle\" id=\"add-a-digital-signature-to-the-image\">Add a digital signature to the image</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#finalizesignature\" id=\"id9\">FinalizeSignature</a></li>\n<li><a class=\"reference internal\" href=\"#getsignatureinfo\" id=\"id10\">GetSignatureInfo</a></li>\n<li><a class=\"reference internal\" href=\"#signatureimage\" id=\"id11\">SignatureImage</a></li>\n<li><a class=\"reference internal\" href=\"#transformsignature\" id=\"id12\">TransformSignature</a></li>\n<li><a class=\"reference internal\" href=\"#updatesignature\" id=\"id13\">UpdateSignature</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"finalizesignature\">\n<h1><a class=\"toc-backref\" href=\"#id9\">FinalizeSignature</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nFinalizeSignature( <a class=\"reference external\" href=\"../api/types.html#signatureinfo\">SignatureInfo</a> *signature_info );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>Method FinalizeSignature finalizes the SHA message digest computation.</p>\n<p>The format of the FinalizeSignature method is:</p>\n<pre class=\"literal-block\">\nFinalizeSignature( <a class=\"reference external\" href=\"../api/types.html#signatureinfo\">SignatureInfo</a> *signature_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>signature_info:</dt>\n<dd>The address of a structure of type SignatureInfo.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"getsignatureinfo\">\n<h1><a class=\"toc-backref\" href=\"#id10\">GetSignatureInfo</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nGetSignatureInfo( <a class=\"reference external\" href=\"../api/types.html#signatureinfo\">SignatureInfo</a> *signature_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>Method GetSignatureInfo initializes the SHA message digest structure.</p>\n<p>The format of the GetSignatureInfo method is:</p>\n<pre class=\"literal-block\">\nGetSignatureInfo( <a class=\"reference external\" href=\"../api/types.html#signatureinfo\">SignatureInfo</a> *signature_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>signature_info:</dt>\n<dd>The address of a structure of type SignatureInfo.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"signatureimage\">\n<h1><a class=\"toc-backref\" href=\"#id11\">SignatureImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int SignatureImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>SignatureImage() computes a message digest from an image pixel stream with\nan implementation of the NIST SHA-256 Message Digest algorithm.  This\nsignature uniquely identifies the image and is convenient for determining\nif an image has been modified or whether two images are identical.</p>\n<p>The format of the SignatureImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int SignatureImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"transformsignature\">\n<h1><a class=\"toc-backref\" href=\"#id12\">TransformSignature</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nTransformSignature( <a class=\"reference external\" href=\"../api/types.html#signatureinfo\">SignatureInfo</a> *signature_info );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>TransformSignature() transforms the SHA message digest.</p>\n<p>The format of the TransformSignature method is:</p>\n<pre class=\"literal-block\">\nTransformSignature( <a class=\"reference external\" href=\"../api/types.html#signatureinfo\">SignatureInfo</a> *signature_info );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>signature_info:</dt>\n<dd>The address of a structure of type SignatureInfo.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"updatesignature\">\n<h1><a class=\"toc-backref\" href=\"#id13\">UpdateSignature</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nUpdateSignature( <a class=\"reference external\" href=\"../api/types.html#signatureinfo\">SignatureInfo</a> *signature_info, const unsigned char *message,\n                 const size_t length );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>UpdateSignature() updates the SHA message digest.</p>\n<p>The format of the UpdateSignature method is:</p>\n<pre class=\"literal-block\">\nUpdateSignature( <a class=\"reference external\" href=\"../api/types.html#signatureinfo\">SignatureInfo</a> *signature_info, const unsigned char *message,\n                 const size_t length );\n</pre>\n<dl class=\"docutils\">\n<dt>signature_info:</dt>\n<dd>The address of a structure of type SignatureInfo.</dd>\n<dt>message:</dt>\n<dd>the message</dd>\n<dt>length:</dt>\n<dd>The length of the message.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/statistics.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>statistics</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"statistics\">\n<h1 class=\"title\">statistics</h1>\n<h2 class=\"subtitle\" id=\"compute-image-statistics\">Compute image statistics</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#getimagestatistics\" id=\"id1\">GetImageStatistics</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"getimagestatistics\">\n<h1><a class=\"toc-backref\" href=\"#id1\">GetImageStatistics</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail GetImageStatistics( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image,\n                                   ImageStatistics *statistics <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>GetImageStatistics computes common statistics (currently maximum, minimum,\nmean and standard deviation) for the available image channels. The\nper-channel values are returned in an ImageStatistics structure. Statistics\nare normalized to the range 0.0 to 1.0.  Multiply values by MaxRGB to obtain\nthe statistics in quantum units. Statistics for non-existent channels are\nset to zero.</p>\n<p>The format of the GetImageStatistics method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail GetImageStatistics( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image,\n                                   ImageStatistics *statistics <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>statistics:</dt>\n<dd>An ImageStatistics structure to update with statistics.</dd>\n<dt>exception:</dt>\n<dd>Any errors are reported here.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/texture.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>texture</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"texture\">\n<h1 class=\"title\">texture</h1>\n<h2 class=\"subtitle\" id=\"image-texture-functions\">Image texture functions</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#constitutetextureimage\" id=\"id3\">ConstituteTextureImage</a></li>\n<li><a class=\"reference internal\" href=\"#textureimage\" id=\"id4\">TextureImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"constitutetextureimage\">\n<h1><a class=\"toc-backref\" href=\"#id3\">ConstituteTextureImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ConstituteTextureImage( unsigned long columns, unsigned long rows,\n                               const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *texture, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>ConstituteTextureImage() returns a new image canvas based on repeatedly\ntiling the texture image across and down the new image canvas.  The\nreturned image properties are similar to the texture image properties.</p>\n<p>The format of the TextureImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ConstituteTextureImage( unsigned long columns, unsigned long rows,\n                               const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *texture, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>columns:</dt>\n<dd>The number of columns in the new image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the new image.</dd>\n<dt>texture:</dt>\n<dd>The texture image to layer on the background.</dd>\n<dt>exceptions:</dt>\n<dd>Any errors are reported here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"textureimage\">\n<h1><a class=\"toc-backref\" href=\"#id4\">TextureImage</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail TextureImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *texture );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>TextureImage() repeatedly tiles the texture image across and down the image\ncanvas. If the image canvas includes a matte channel, then the tile is\nalpha-composited &quot;under&quot; the image and the matte channel is removed.\nMagickFail is returned if an error is encountered.</p>\n<p>The format of the TextureImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail TextureImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *texture );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>texture:</dt>\n<dd>This image is the texture to layer on the background.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/transform.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>transform</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"transform\">\n<h1 class=\"title\">transform</h1>\n<h2 class=\"subtitle\" id=\"crop-flip-flop-roll-coalesce-etc\">Crop, flip, flop, roll, coalesce, etc.</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#chopimage\" id=\"id23\">ChopImage</a></li>\n<li><a class=\"reference internal\" href=\"#coalesceimages\" id=\"id24\">CoalesceImages</a></li>\n<li><a class=\"reference internal\" href=\"#cropimage\" id=\"id25\">CropImage</a></li>\n<li><a class=\"reference internal\" href=\"#deconstructimages\" id=\"id26\">DeconstructImages</a></li>\n<li><a class=\"reference internal\" href=\"#extentimage\" id=\"id27\">ExtentImage</a></li>\n<li><a class=\"reference internal\" href=\"#flattenimage\" id=\"id28\">FlattenImage</a></li>\n<li><a class=\"reference internal\" href=\"#flipimage\" id=\"id29\">FlipImage</a></li>\n<li><a class=\"reference internal\" href=\"#flopimage\" id=\"id30\">FlopImage</a></li>\n<li><a class=\"reference internal\" href=\"#mosaicimages\" id=\"id31\">MosaicImages</a></li>\n<li><a class=\"reference internal\" href=\"#rollimage\" id=\"id32\">RollImage</a></li>\n<li><a class=\"reference internal\" href=\"#shaveimage\" id=\"id33\">ShaveImage</a></li>\n<li><a class=\"reference internal\" href=\"#transformimage\" id=\"id34\">TransformImage</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"chopimage\">\n<h1><a class=\"toc-backref\" href=\"#id23\">ChopImage</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ChopImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image,\n                  const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *chop_info <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>Chop() removes a region of an image and collapses the image to occupy the\nremoved portion.</p>\n<p>The format of the ChopImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ChopImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image,\n                  const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *chop_info <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>chop_info:</dt>\n<dd>Define the region of the image to chop.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"coalesceimages\">\n<h1><a class=\"toc-backref\" href=\"#id24\">CoalesceImages</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CoalesceImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>CoalesceImages() composites a set of images while respecting any page\noffsets and disposal methods.  GIF, MIFF, and MNG animation sequences\ntypically start with an image background and each subsequent image\nvaries in size and offset.  CoalesceImages() returns a new sequence\nwhere each image in the sequence is the same size as the first and\ncomposited with the next image in the sequence.</p>\n<p>The format of the CoalesceImages method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CoalesceImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image sequence.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"cropimage\">\n<h1><a class=\"toc-backref\" href=\"#id25\">CropImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CropImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *geometry,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>Use CropImage() to extract a region of the image starting at the offset\ndefined by geometry.  As a special feature, if the geometry &quot;0x0&quot; is\nis passed, GetImageBoundingBox() is used to locate the edges of the\nimage and the image is cropped (&quot;trimmed&quot;) to that boundary.</p>\n<p>The format of the CropImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *CropImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *geometry,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>geometry:</dt>\n<dd>Define the region of the image to crop with members\nx, y, width, and height.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"deconstructimages\">\n<h1><a class=\"toc-backref\" href=\"#id26\">DeconstructImages</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *DeconstructImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>DeconstructImages() compares each image with the next in a sequence and\nreturns the maximum bounding region of any pixel differences it discovers.</p>\n<p>The format of the DeconstructImages method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *DeconstructImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"extentimage\">\n<h1><a class=\"toc-backref\" href=\"#id27\">ExtentImage</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ExtentImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *geometry,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>Use ExtentImage() to change the image dimensions as specified by geometry\nwidth and height.  The existing image content is composited at the position\nspecified by geometry x and y using the image compose method.  Existing\nimage content which falls outside the bounds of the new image dimensions\nis discarded.</p>\n<p>The format of the ExtentImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ExtentImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *geometry,\n                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>geometry:</dt>\n<dd>Define the new image dimension with width and height, and\nthe top left coordinate to place the existing image content with\nx and y.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"flattenimage\">\n<h1><a class=\"toc-backref\" href=\"#id28\">FlattenImage</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *FlattenImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>Method FlattenImage merges a sequence of images.  This is useful for\ncombining Photoshop layers into a single image.</p>\n<p>The format of the FlattenImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *FlattenImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image sequence.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"flipimage\">\n<h1><a class=\"toc-backref\" href=\"#id29\">FlipImage</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *FlipImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>FlipImage() creates a vertical mirror image by reflecting the pixels\naround the central x-axis.</p>\n<p>The format of the FlipImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *FlipImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"flopimage\">\n<h1><a class=\"toc-backref\" href=\"#id30\">FlopImage</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *FlopImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>FlopImage() creates a horizontal mirror image by reflecting the pixels\naround the central y-axis.</p>\n<p>The format of the FlopImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *FlopImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"mosaicimages\">\n<h1><a class=\"toc-backref\" href=\"#id31\">MosaicImages</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MosaicImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>MosaicImages() inlays an image sequence to form a single coherent picture.\nIt returns a single image with each image in the sequence composited at\nthe location defined by the page member of the image structure.</p>\n<p>The format of the MosaicImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *MosaicImages( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"rollimage\">\n<h1><a class=\"toc-backref\" href=\"#id32\">RollImage</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *RollImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x_offset, const long y_offset,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>RollImage() offsets an image as defined by x_offset and y_offset.</p>\n<p>The format of the RollImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *RollImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const long x_offset, const long y_offset,\n                  <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>x_offset:</dt>\n<dd>The number of columns to roll in the horizontal direction.</dd>\n<dt>y_offset:</dt>\n<dd>The number of rows to roll in the vertical direction.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"shaveimage\">\n<h1><a class=\"toc-backref\" href=\"#id33\">ShaveImage</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ShaveImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *shave_info,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>Method ShaveImage shaves pixels from the image edges.  It allocates the\nmemory necessary for the new Image structure and returns a pointer to the\nnew image.</p>\n<p>The format of the ShaveImage method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *ShaveImage( const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image, const <a class=\"reference external\" href=\"../api/types.html#rectangleinfo\">RectangleInfo</a> *shave_info,\n                   <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>shave_image:</dt>\n<dd>Method ShaveImage returns a pointer to the shaved\nimage.  A null image is returned if there is a memory shortage or\nif the image width or height is zero.</dd>\n<dt>image:</dt>\n<dd>The image.</dd>\n<dt>shave_info:</dt>\n<dd>Specifies a pointer to a RectangleInfo which defines the\nregion of the image to shave.</dd>\n<dt>exception:</dt>\n<dd>Return any errors or warnings in this structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"transformimage\">\n<h1><a class=\"toc-backref\" href=\"#id34\">TransformImage</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail TransformImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** image, const char *crop_geometry,\n                               const char *image_geometry );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>TransformImage() is a convenience method that behaves like ResizeImage() or\nCropImage() but accepts scaling and/or cropping information as a region\ngeometry specification.  If the operation fails, the original image handle\nis returned.</p>\n<p>The format of the TransformImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail TransformImage( <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> ** image, const char *crop_geometry,\n                               const char *image_geometry );\n</pre>\n<dl class=\"docutils\">\n<dt>image:</dt>\n<dd>The image The transformed image is returned as this parameter.</dd>\n<dt>crop_geometry:</dt>\n<dd>A crop geometry string.  This geometry defines a\nsubregion of the image to crop.</dd>\n<dt>image_geometry:</dt>\n<dd>An image geometry string.  This geometry defines the\nfinal size of the image.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/types.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Types</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-types\">\n<h1 class=\"title\">GraphicsMagick Types</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#affinematrix\" id=\"id1\">AffineMatrix</a></li>\n<li><a class=\"reference internal\" href=\"#blobinfo\" id=\"id2\">BlobInfo</a></li>\n<li><a class=\"reference internal\" href=\"#cache\" id=\"id3\">Cache</a></li>\n<li><a class=\"reference internal\" href=\"#channeltype\" id=\"id4\">ChannelType</a></li>\n<li><a class=\"reference internal\" href=\"#chromaticityinfo\" id=\"id5\">ChromaticityInfo</a></li>\n<li><a class=\"reference internal\" href=\"#classtype\" id=\"id6\">ClassType</a></li>\n<li><a class=\"reference internal\" href=\"#clippathunits\" id=\"id7\">ClipPathUnits</a></li>\n<li><a class=\"reference internal\" href=\"#colorpacket\" id=\"id8\">ColorPacket</a></li>\n<li><a class=\"reference internal\" href=\"#colorspacetype\" id=\"id9\">ColorspaceType</a></li>\n<li><a class=\"reference internal\" href=\"#compliancetype\" id=\"id10\">ComplianceType</a></li>\n<li><a class=\"reference internal\" href=\"#compositeoperator\" id=\"id11\">CompositeOperator</a></li>\n<li><a class=\"reference internal\" href=\"#compressiontype\" id=\"id12\">CompressionType</a></li>\n<li><a class=\"reference internal\" href=\"#decorationtype\" id=\"id13\">DecorationType</a></li>\n<li><a class=\"reference internal\" href=\"#drawcontext\" id=\"id14\">DrawContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawinfo\" id=\"id15\">DrawInfo</a></li>\n<li><a class=\"reference internal\" href=\"#endiantype\" id=\"id16\">EndianType</a></li>\n<li><a class=\"reference internal\" href=\"#errorhandler\" id=\"id17\">ErrorHandler</a></li>\n<li><a class=\"reference internal\" href=\"#exceptioninfo\" id=\"id18\">ExceptionInfo</a></li>\n<li><a class=\"reference internal\" href=\"#exceptiontype\" id=\"id19\">ExceptionType</a></li>\n<li><a class=\"reference internal\" href=\"#fillrule\" id=\"id20\">FillRule</a></li>\n<li><a class=\"reference internal\" href=\"#filtertypes\" id=\"id21\">FilterTypes</a></li>\n<li><a class=\"reference internal\" href=\"#frameinfo\" id=\"id22\">FrameInfo</a></li>\n<li><a class=\"reference internal\" href=\"#gravitytype\" id=\"id23\">GravityType</a></li>\n<li><a class=\"reference internal\" href=\"#image\" id=\"id24\">Image</a></li>\n<li><a class=\"reference internal\" href=\"#imageinfo\" id=\"id25\">ImageInfo</a></li>\n<li><a class=\"reference internal\" href=\"#imagetype\" id=\"id26\">ImageType</a></li>\n<li><a class=\"reference internal\" href=\"#indexpacket\" id=\"id27\">IndexPacket</a></li>\n<li><a class=\"reference internal\" href=\"#interlacetype\" id=\"id28\">InterlaceType</a></li>\n<li><a class=\"reference internal\" href=\"#layertype\" id=\"id29\">LayerType</a></li>\n<li><a class=\"reference internal\" href=\"#magickinfo\" id=\"id30\">MagickInfo</a></li>\n<li><a class=\"reference internal\" href=\"#monitorhandler\" id=\"id31\">MonitorHandler</a></li>\n<li><a class=\"reference internal\" href=\"#montageinfo\" id=\"id32\">MontageInfo</a></li>\n<li><a class=\"reference internal\" href=\"#noisetype\" id=\"id33\">NoiseType</a></li>\n<li><a class=\"reference internal\" href=\"#orientationtype\" id=\"id34\">OrientationType</a></li>\n<li><a class=\"reference internal\" href=\"#paintmethod\" id=\"id35\">PaintMethod</a></li>\n<li><a class=\"reference internal\" href=\"#pixelpacket\" id=\"id36\">PixelPacket</a></li>\n<li><a class=\"reference internal\" href=\"#pointinfo\" id=\"id37\">PointInfo</a></li>\n<li><a class=\"reference internal\" href=\"#profileinfo\" id=\"id38\">ProfileInfo</a></li>\n<li><a class=\"reference internal\" href=\"#quantizeinfo\" id=\"id39\">QuantizeInfo</a></li>\n<li><a class=\"reference internal\" href=\"#quantum\" id=\"id40\">Quantum</a></li>\n<li><a class=\"reference internal\" href=\"#quantumtype\" id=\"id41\">QuantumType</a></li>\n<li><a class=\"reference internal\" href=\"#rectangleinfo\" id=\"id42\">RectangleInfo</a></li>\n<li><a class=\"reference internal\" href=\"#registrytype\" id=\"id43\">RegistryType</a></li>\n<li><a class=\"reference internal\" href=\"#renderingintent\" id=\"id44\">RenderingIntent</a></li>\n<li><a class=\"reference internal\" href=\"#resolutiontype\" id=\"id45\">ResolutionType</a></li>\n<li><a class=\"reference internal\" href=\"#resourcetype\" id=\"id46\">ResourceType</a></li>\n<li><a class=\"reference internal\" href=\"#segmentinfo\" id=\"id47\">SegmentInfo</a></li>\n<li><a class=\"reference internal\" href=\"#signatureinfo\" id=\"id48\">SignatureInfo</a></li>\n<li><a class=\"reference internal\" href=\"#storagetype\" id=\"id49\">StorageType</a></li>\n<li><a class=\"reference internal\" href=\"#streamhandler\" id=\"id50\">StreamHandler</a></li>\n<li><a class=\"reference internal\" href=\"#stretchtype\" id=\"id51\">StretchType</a></li>\n<li><a class=\"reference internal\" href=\"#styletype\" id=\"id52\">StyleType</a></li>\n<li><a class=\"reference internal\" href=\"#typemetric\" id=\"id53\">TypeMetric</a></li>\n<li><a class=\"reference internal\" href=\"#viewinfo\" id=\"id54\">ViewInfo</a></li>\n<li><a class=\"reference internal\" href=\"#virtualpixelmethod\" id=\"id55\">VirtualPixelMethod</a></li>\n<li><a class=\"reference internal\" href=\"#magickxresourceinfo\" id=\"id56\">MagickXResourceInfo</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"affinematrix\">\n<h1><a class=\"toc-backref\" href=\"#id1\">AffineMatrix</a></h1>\n<p>AffineMatrix defines a 2D affine matrix transform.</p>\n<pre class=\"literal-block\">\ntypedef struct _AffineMatrix\n{\n  double\n    sx,\n    rx,\n    ry,\n    sy,\n    tx,\n    ty;\n} AffineMatrix;\n</pre>\n</div>\n<div class=\"section\" id=\"blobinfo\">\n<h1><a class=\"toc-backref\" href=\"#id2\">BlobInfo</a></h1>\n<p>BlobInfo is an opaque pointer reference to the internal structure of an\nI/O blob handle.</p>\n</div>\n<div class=\"section\" id=\"cache\">\n<h1><a class=\"toc-backref\" href=\"#id3\">Cache</a></h1>\n<pre class=\"literal-block\">\ntypedef void\n  *Cache;\n</pre>\n</div>\n<div class=\"section\" id=\"channeltype\">\n<h1><a class=\"toc-backref\" href=\"#id4\">ChannelType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  UndefinedChannel,\n  RedChannel,     /* RGB Red channel */\n  CyanChannel,    /* CMYK Cyan channel */\n  GreenChannel,   /* RGB Green channel */\n  MagentaChannel, /* CMYK Magenta channel */\n  BlueChannel,    /* RGB Blue channel */\n  YellowChannel,  /* CMYK Yellow channel */\n  OpacityChannel, /* Opacity channel */\n  BlackChannel,   /* CMYK Black (K) channel */\n  MatteChannel,   /* Same as Opacity channel (deprecated) */\n  AllChannels,    /* Color channels */\n  GrayChannel     /* Color channels represent an intensity. */\n} ChannelType;\n</pre>\n</div>\n<div class=\"section\" id=\"chromaticityinfo\">\n<h1><a class=\"toc-backref\" href=\"#id5\">ChromaticityInfo</a></h1>\n<p>The ChromaticityInfo structure is used to represent chromaticity\n(colorspace primary coordinates in xy space) values for images in\nGraphicsMagick.</p>\n<p>The members of the ChromaticityInfo structure are shown in the following\ntable:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ChromaticityInfo Structure Members</caption>\n<colgroup>\n<col width=\"20%\" />\n<col width=\"12%\" />\n<col width=\"68%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Member</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>red_primary</td>\n<td>PointInfo</td>\n<td>Chromaticity red primary point (e.g. x=0.64, y=0.33)</td>\n</tr>\n<tr><td>green_primary</td>\n<td>PointInfo</td>\n<td>Chromaticity green primary point (e.g. x=0.3, y=0.6)</td>\n</tr>\n<tr><td>blue_primary</td>\n<td>PointInfo</td>\n<td>Chromaticity blue primary point (e.g. x=0.15, y=0.06)</td>\n</tr>\n<tr><td>white_point</td>\n<td>PointInfo</td>\n<td>Chromaticity white point (e.g. x=0.3127, y=0.329)</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"classtype\">\n<h1><a class=\"toc-backref\" href=\"#id6\">ClassType</a></h1>\n<p>ClassType enumeration specifies the image storage class.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ClassType</caption>\n<colgroup>\n<col width=\"17%\" />\n<col width=\"83%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>UndefinedClass</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>DirectClass</td>\n<td>Image is composed of pixels which represent literal color values.</td>\n</tr>\n<tr><td>PseudoClass</td>\n<td>Image is composed of pixels which specify an index in a color palette.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"clippathunits\">\n<h1><a class=\"toc-backref\" href=\"#id7\">ClipPathUnits</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  UserSpace,\n  UserSpaceOnUse,\n  ObjectBoundingBox\n} ClipPathUnits;\n</pre>\n</div>\n<div class=\"section\" id=\"colorpacket\">\n<h1><a class=\"toc-backref\" href=\"#id8\">ColorPacket</a></h1>\n<pre class=\"literal-block\">\ntypedef struct _ColorPacket\n{\n  PixelPacket\n    pixel;\n\n  unsigned short\n    index;\n\n  unsigned long\n    count;\n} ColorPacket;\n</pre>\n</div>\n<div class=\"section\" id=\"colorspacetype\">\n<h1><a class=\"toc-backref\" href=\"#id9\">ColorspaceType</a></h1>\n<p>The ColorspaceType enumeration is used to specify the colorspace that\nquantization (color reduction and mapping) is done under or to specify\nthe colorspace when encoding an output image. Colorspaces are ways of\ndescribing colors to fit the requirements of a particular application\n(e.g. Television, offset printing, color monitors). Color reduction, by\ndefault, takes place in the RGBColorspace. Empirical evidence suggests\nthat distances in color spaces such as YUVColorspace or YIQColorspace\ncorrespond to perceptual color differences more closely han do distances\nin RGB space. These color spaces may give better results when color\nreducing an image. Refer to quantize for more details.</p>\n<p>When encoding an output image, the colorspaces RGBColorspace,\nCMYKColorspace, and GRAYColorspace may be specified. The CMYKColorspace\noption is only applicable when writing TIFF, JPEG, and Adobe Photoshop\nbitmap (PSD) files.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ColorspaceType</caption>\n<colgroup>\n<col width=\"32%\" />\n<col width=\"68%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedColorspace</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>RGBColorspace</td>\n<td>Red, Green, Blue colorspace.</td>\n</tr>\n<tr><td>GRAYColorspace</td>\n<td>Similar to Luma (Y) according to ITU-R 601</td>\n</tr>\n<tr><td>TransparentColorspace</td>\n<td>RGB which preserves the matte while quantizing colors.</td>\n</tr>\n<tr><td>OHTAColorspace</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>XYZColorspace</td>\n<td>CIE XYZ</td>\n</tr>\n<tr><td>YCCColorspace</td>\n<td>Kodak PhotoCD PhotoYCC</td>\n</tr>\n<tr><td>YIQColorspace</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>YPbPrColorspace</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>YUVColorspace</td>\n<td>YUV colorspace as used for computer video.</td>\n</tr>\n<tr><td>CMYKColorspace</td>\n<td>Cyan, Magenta, Yellow, Black colorspace.</td>\n</tr>\n<tr><td>sRGBColorspace</td>\n<td>Kodak PhotoCD sRGB</td>\n</tr>\n<tr><td>HSLColorspace</td>\n<td>Hue, saturation, luminosity</td>\n</tr>\n<tr><td>HWBColorspace</td>\n<td>Hue, whiteness, blackness</td>\n</tr>\n<tr><td>LABColorspace</td>\n<td>ITU LAB</td>\n</tr>\n<tr><td>CineonLogRGBColorspace</td>\n<td>RGB data with Cineon Log scaling, 2.048 density range</td>\n</tr>\n<tr><td>Rec601LumaColorspace</td>\n<td>Luma (Y) according to ITU-R 601</td>\n</tr>\n<tr><td>Rec601YCbCrColorspace</td>\n<td>YCbCr according to ITU-R 601</td>\n</tr>\n<tr><td>Rec709LumaColorspace</td>\n<td>Luma (Y) according to ITU-R 709</td>\n</tr>\n<tr><td>Rec709YCbCrColorspace</td>\n<td>YCbCr according to ITU-R 709</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"compliancetype\">\n<h1><a class=\"toc-backref\" href=\"#id10\">ComplianceType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  UndefinedCompliance = 0x0000,\n  NoCompliance = 0x0000,\n  SVGCompliance = 0x0001,\n  X11Compliance = 0x0002,\n  XPMCompliance = 0x0004,\n  AllCompliance = 0xffff\n} ComplianceType;\n</pre>\n</div>\n<div class=\"section\" id=\"compositeoperator\">\n<h1><a class=\"toc-backref\" href=\"#id11\">CompositeOperator</a></h1>\n<p>CompositeOperator is used to select the image composition algorithm used\nto compose a composite image with an image. By default, each of the\ncomposite image pixels are replaced by the corresponding image tile\npixel. Specify CompositeOperator to select a different algorithm.</p>\n<p>The image compositor requires a matte, or alpha channel in the image for\nsome operations. This extra channel usually defines a mask which\nrepresents a sort of a cookie-cutter for the image. This is the case when\nmatte is 255 (full coverage) for pixels inside the shape, zero outside,\nand between zero and 255 on the boundary. For certain operations, if\nimage does not have a matte channel, it is initialized with 0 for any\npixel matching in color to pixel location (0,0), otherwise 255 (to work\nproperly borderWidth must be 0).</p>\n<table border=\"1\" class=\"docutils\">\n<caption>CompositeOperator</caption>\n<colgroup>\n<col width=\"23%\" />\n<col width=\"77%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Enumeration</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>UndefinedCompositeOp</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>OverCompositeOp</td>\n<td>The result is the union of the the two image shapes with the composite\nimage obscuring image in the region of overlap.</td>\n</tr>\n<tr><td>InCompositeOp</td>\n<td>The result is a simply composite image cut by the shape of image. None of\nthe image data of image is included in the result.</td>\n</tr>\n<tr><td>OutCompositeOp</td>\n<td>The resulting image is composite image with the shape of image cut out.</td>\n</tr>\n<tr><td>AtopCompositeOp</td>\n<td>The result is the same shape as image image, with composite image\nobscuring image there the image shapes overlap. Note that this differs\nfrom OverCompositeOp because the portion of composite image outside of\nimage's shape does not appear in the result.</td>\n</tr>\n<tr><td>XorCompositeOp</td>\n<td>The result is the image data from both composite image and image that is\noutside the overlap region. The overlap region will be blank.</td>\n</tr>\n<tr><td>PlusCompositeOp</td>\n<td>The result is just the sum of the  image data. Output values are cropped\nto 255 (no overflow). This operation is independent of the matte channels.</td>\n</tr>\n<tr><td>MinusCompositeOp</td>\n<td>The result of composite image - image, with overflow cropped to zero. The\nmatte chanel is ignored (set to 255, full coverage).</td>\n</tr>\n<tr><td>AddCompositeOp</td>\n<td>The result of composite image + image, with overflow wrapping around (mod\n256).</td>\n</tr>\n<tr><td>SubtractCompositeOp</td>\n<td>The result of composite image - image, with underflow wrapping around (mod\n256). The add and subtract operators can be used to perform reversible\ntransformations.</td>\n</tr>\n<tr><td>DifferenceCompositeOp</td>\n<td>The result of abs(composite image - image). This is useful for comparing\ntwo very similar images.</td>\n</tr>\n<tr><td>BumpmapCompositeOp</td>\n<td>The result image shaded by composite image.</td>\n</tr>\n<tr><td>CopyCompositeOp</td>\n<td>The resulting image is image replaced with composite image. Here the matte\ninformation is ignored.</td>\n</tr>\n<tr><td>CopyRedCompositeOp</td>\n<td>The resulting image is the red layer in image replaced with the red layer\nin composite image. The other layers are copied untouched.</td>\n</tr>\n<tr><td>CopyGreenCompositeOp</td>\n<td>The resulting image is the green layer in image replaced with the green\nlayer in composite image. The other layers are copied untouched.</td>\n</tr>\n<tr><td>CopyBlueCompositeOp</td>\n<td>The resulting image is the blue layer in image replaced with the blue\nlayer in composite image. The other layers are copied untouched.</td>\n</tr>\n<tr><td>CopyOpacityCompositeOp</td>\n<td>The resulting image is the matte layer in image replaced with the matte\nlayer in composite image. The other layers are copied untouched.</td>\n</tr>\n<tr><td>ClearCompositeOp</td>\n<td>Pixels in the region are set to Transparent.</td>\n</tr>\n<tr><td>DissolveCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>DisplaceCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>ModulateCompositeOp</td>\n<td>Modulate brightness in HSL space.</td>\n</tr>\n<tr><td>ThresholdCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>NoCompositeOp</td>\n<td>Do nothing at all.</td>\n</tr>\n<tr><td>DarkenCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>LightenCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>HueCompositeOp</td>\n<td>Copy Hue channel (from HSL colorspace).</td>\n</tr>\n<tr><td>SaturateCompositeOp</td>\n<td>Copy Saturation channel (from HSL colorspace).</td>\n</tr>\n<tr><td>ColorizeCompositeOp</td>\n<td>Copy Hue and Saturation channels (from HSL colorspace).</td>\n</tr>\n<tr><td>LuminizeCompositeOp</td>\n<td>Copy Brightness channel (from HSL colorspace).</td>\n</tr>\n<tr><td>ScreenCompositeOp</td>\n<td>[Not yet implemented]</td>\n</tr>\n<tr><td>OverlayCompositeOp</td>\n<td>[Not yet implemented]</td>\n</tr>\n<tr><td>CopyCyanCompositeOp</td>\n<td>Copy the Cyan channel.</td>\n</tr>\n<tr><td>CopyMagentaCompositeOp</td>\n<td>Copy the Magenta channel.</td>\n</tr>\n<tr><td>CopyYellowCompositeOp</td>\n<td>Copy the Yellow channel.</td>\n</tr>\n<tr><td>CopyBlackCompositeOp</td>\n<td>Copy the Black channel.</td>\n</tr>\n<tr><td>DivideCompositeOp</td>\n<td>&nbsp;</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"compressiontype\">\n<h1><a class=\"toc-backref\" href=\"#id12\">CompressionType</a></h1>\n<p>CompressionType is used to express the desired compression type when\nencoding an image. Be aware that most image types only support a sub-set\nof the available compression types. If the compression type specified is\nincompatable with the image, GraphicsMagick selects a compression type\ncompatable with the image type.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>CompressionType</caption>\n<colgroup>\n<col width=\"28%\" />\n<col width=\"72%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>UndefinedCompression</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>NoCompression</td>\n<td>No compression</td>\n</tr>\n<tr><td>BZipCompression</td>\n<td>BZip (Burrows-Wheeler block-sorting text compression algorithm and\nHuffman coding)  as used by bzip2 utilities</td>\n</tr>\n<tr><td>FaxCompression</td>\n<td>CCITT Group 3 FAX compression</td>\n</tr>\n<tr><td>Group4Compression</td>\n<td>CCITT Group 4 FAX compression (used only for TIFF)</td>\n</tr>\n<tr><td>JPEGCompression</td>\n<td>JPEG compression</td>\n</tr>\n<tr><td>LosslessJPEGCompression</td>\n<td>Lossless JPEG compression</td>\n</tr>\n<tr><td>LZWCompression</td>\n<td>Lempel-Ziv-Welch (LZW) compression (caution, patented by Unisys)</td>\n</tr>\n<tr><td>RLECompression</td>\n<td>Run-Length encoded (RLE) compression</td>\n</tr>\n<tr><td>ZipCompression</td>\n<td>Lempel-Ziv compression (LZ77) as used in PKZIP and GNU gzip.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"decorationtype\">\n<h1><a class=\"toc-backref\" href=\"#id13\">DecorationType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  NoDecoration,\n  UnderlineDecoration,\n  OverlineDecoration,\n  LineThroughDecoration\n} DecorationType;\n</pre>\n</div>\n<div class=\"section\" id=\"drawcontext\">\n<h1><a class=\"toc-backref\" href=\"#id14\">DrawContext</a></h1>\n<pre class=\"literal-block\">\ntypedef struct _DrawContext *DrawContext;\n</pre>\n</div>\n<div class=\"section\" id=\"drawinfo\">\n<h1><a class=\"toc-backref\" href=\"#id15\">DrawInfo</a></h1>\n<p>The DrawInfo structure is used to support annotating an image using\ndrawing commands.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Methods Supporting DrawInfo</caption>\n<colgroup>\n<col width=\"23%\" />\n<col width=\"77%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Method</td>\n<td>Description</td>\n</tr>\n<tr><td>GetDrawInfo()</td>\n<td>Allocate new structure with defaults set.</td>\n</tr>\n<tr><td>CloneDrawInfo()</td>\n<td>Copy existing structure, allocating new structure in the process.</td>\n</tr>\n<tr><td>DestroyDrawInfo()</td>\n<td>Deallocate structure, including any members.</td>\n</tr>\n<tr><td>DrawImage()</td>\n<td>Render primitives to image.</td>\n</tr>\n</tbody>\n</table>\n<p>The members of the DrawInfo structure are shown in the following table.\nThe structure is initialized to reasonable defaults by first initializing\nthe equivalent members of ImageInfo, and then initializing the entire\nstructure using GetDrawInfo().</p>\n<table border=\"1\" class=\"docutils\">\n<caption>DrawInfo Structure Members Supporting DrawImage()</caption>\n<colgroup>\n<col width=\"16%\" />\n<col width=\"14%\" />\n<col width=\"69%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Member</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>affine</td>\n<td>AffineInfo</td>\n<td>Coordinate transformation (rotation, scaling, and translation).</td>\n</tr>\n<tr><td>border_color</td>\n<td>PixelPacket</td>\n<td>Border color</td>\n</tr>\n<tr><td>box</td>\n<td>PixelPacket</td>\n<td>Text solid background color.</td>\n</tr>\n<tr><td>decorate</td>\n<td>DecorationType</td>\n<td>Text decoration type.</td>\n</tr>\n<tr><td>density</td>\n<td>char *</td>\n<td>Text rendering density in DPI (effects scaling font according to\npointsize). E.g. &quot;72x72&quot;</td>\n</tr>\n<tr><td>fill</td>\n<td>PixelPacket</td>\n<td>Object internal fill (within outline) color.</td>\n</tr>\n<tr><td>font</td>\n<td>char *</td>\n<td>Font to use when rendering text.</td>\n</tr>\n<tr><td>gravity</td>\n<td>GravityType</td>\n<td>Text placement preference (e.g. NorthWestGravity).</td>\n</tr>\n<tr><td>linewidth</td>\n<td>double</td>\n<td>Stroke (outline) drawing width in pixels.</td>\n</tr>\n<tr><td>pointsize</td>\n<td>double</td>\n<td>Font size (also see density).</td>\n</tr>\n<tr><td>primitive</td>\n<td>char *</td>\n<td>Space or new-line delimited list of text drawing primitives (e.g\n&quot;text 100,100 Cockatoo&quot;). See the table Drawing Primitives for the\navailable drawing primitives.</td>\n</tr>\n<tr><td>stroke</td>\n<td>PixelPacket</td>\n<td>Object stroke (outline) color.</td>\n</tr>\n<tr><td>stroke_antialias</td>\n<td>unsigned int</td>\n<td>Set to True (non-zero) to obtain anti-aliased stroke rendering.</td>\n</tr>\n<tr><td>text_antialias</td>\n<td>unsigned int</td>\n<td>Set to True (non-zero) to obtain anti-aliased text rendering.</td>\n</tr>\n<tr><td>tile</td>\n<td>Image *</td>\n<td>Image texture to draw with. Use an image containing a single color\n(e.g. a 1x1 image) to draw in a solid color.</td>\n</tr>\n</tbody>\n</table>\n<p>Drawing Primitives</p>\n<p>The drawing primitives shown in the following table may be supplied as a\nspace or new-line delimited list to the primitive member. Primitives\nwhich set drawing options effect the results from subsequent drawing\noperations. See the 'push graphic-context' and 'pop graphic-context'\nprimitives for a way to control the propagation of drawing options.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Drawing Primitives</caption>\n<colgroup>\n<col width=\"16%\" />\n<col width=\"28%\" />\n<col width=\"56%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Primitive</td>\n<td>Arguments</td>\n<td>Purpose</td>\n</tr>\n<tr><td>affine</td>\n<td>sx,rx,ry,sy,tx,ty</td>\n<td>Apply coordinate transformations to support scaling\n(s), rotation (r), and translation (t). Angles are\nspecified in radians. Equivalent to SVG matrix command\nwhich supplies a transformation matrix.</td>\n</tr>\n<tr><td>angle</td>\n<td>angle</td>\n<td>Specify object drawing angle.</td>\n</tr>\n<tr><td>arc</td>\n<td>startX,startY endX,endY\nstartDegrees,endDegrees</td>\n<td>Draw an arc.</td>\n</tr>\n<tr><td>Bezier</td>\n<td>x1,y1, x2,y2, x3,y3, ...,\nxN,yN</td>\n<td>Draw a Bezier curve.</td>\n</tr>\n<tr><td>circle</td>\n<td>originX,originY\nperimX,perimY</td>\n<td>Draw a circle.</td>\n</tr>\n<tr><td>color</td>\n<td>x,y (point|replace|\nfloodfill|filltoborder|\nreset)</td>\n<td>Set color in image according to specified colorization\nrule.</td>\n</tr>\n<tr><td>decorate</td>\n<td>(none|underline|overline|\nline-through)</td>\n<td>Specify text decoration.</td>\n</tr>\n<tr><td>ellipse</td>\n<td>originX,originY\nwidth,height\narcStart,arcEnd</td>\n<td>Draw an ellipse.</td>\n</tr>\n<tr><td>fill</td>\n<td>colorspec</td>\n<td>Specifiy object filling color.</td>\n</tr>\n<tr><td>fill-opacity</td>\n<td>opacity</td>\n<td>Specify object fill opacity.</td>\n</tr>\n<tr><td>font</td>\n<td>fontname</td>\n<td>Specify text drawing font.</td>\n</tr>\n<tr><td>gravity</td>\n<td>(NorthWest,North,NorthEast,\nWest,Center,East,\nSouthWest,South,SouthEast)</td>\n<td>Specify text positioning gravity.</td>\n</tr>\n<tr><td>image</td>\n<td>x,y width,height filename</td>\n<td>Composite image at position, scaled to specified width\nand height, and specified filename. If width or height\nis zero, scaling is not performed.</td>\n</tr>\n<tr><td>line</td>\n<td>startX,startY endX,endY</td>\n<td>Draw a line.</td>\n</tr>\n<tr><td>matte</td>\n<td>x,y (point|replace|\nfloodfill|filltoborder|\nreset)</td>\n<td>Set matte in image according to specified colorization\nrule.</td>\n</tr>\n<tr><td>opacity</td>\n<td>fillOpacity strokeOpacity</td>\n<td>Specify drawing fill and stroke opacities.</td>\n</tr>\n<tr><td>path</td>\n<td>'SVG-compatible path\narguments'</td>\n<td>Draw using SVG-compatible path drawing commands.</td>\n</tr>\n<tr><td>point</td>\n<td>x,y</td>\n<td>Set point to fill color.</td>\n</tr>\n<tr><td>pointsize</td>\n<td>pointsize</td>\n<td>Specify text drawing pointsize (scaled to density).</td>\n</tr>\n<tr><td>polygon</td>\n<td>x1,y1, x2,y2, x3,y3, ...,\nxN,yN</td>\n<td>Draw a polygon.</td>\n</tr>\n<tr><td>polyline</td>\n<td>x1,y1, x2,y2, x3,y3, ...,\nxN,yN</td>\n<td>Draw a polyline.</td>\n</tr>\n<tr><td>pop</td>\n<td>graphic-context</td>\n<td>Remove options set since previous &quot;push\ngraphic-context&quot; command. Options revert to those in\neffect prior to pushing the graphic context.</td>\n</tr>\n<tr><td>push</td>\n<td>graphic-context</td>\n<td>Specify new graphic context.</td>\n</tr>\n<tr><td>rect</td>\n<td>upperLeftX,upperLeftY\nlowerRightX,lowerRightY</td>\n<td>Draw a rectangle.</td>\n</tr>\n<tr><td>rotate</td>\n<td>angle</td>\n<td>Specify coordiante space rotation. Subsequent objects\nare drawn with coordate space rotated by specified\nangle.</td>\n</tr>\n<tr><td>roundrectangle</td>\n<td>centerX,centerY\nwidth,hight\ncornerWidth,cornerHeight</td>\n<td>Draw a rectangle with rounded corners.</td>\n</tr>\n<tr><td>stroke</td>\n<td>colorspec</td>\n<td>Specify object stroke (outline) color.</td>\n</tr>\n<tr><td>stroke-antialias</td>\n<td>stroke_antialias (0 or 1)</td>\n<td>Specify if stroke should be antialiased or not.</td>\n</tr>\n<tr><td>stroke-dash</td>\n<td>value</td>\n<td>Specify pattern to be used when drawing stroke.</td>\n</tr>\n<tr><td>stroke-opacity</td>\n<td>opacity</td>\n<td>Specify opacity of stroke drawing color.</td>\n</tr>\n<tr><td>stroke-width</td>\n<td>linewidth</td>\n<td>Specify stroke (outline) width in pixels.</td>\n</tr>\n<tr><td>text</td>\n<td>x,y &quot;some text&quot;</td>\n<td>Draw text at position.</td>\n</tr>\n<tr><td>text-antialias</td>\n<td>text_antialias (0 or 1)</td>\n<td>Specify if rendered text is to be antialiased (blend\nedges).</td>\n</tr>\n<tr><td>scale</td>\n<td>x,y</td>\n<td>Specify scaling to be applied to coordintate space for\nsubsequent drawing commands.</td>\n</tr>\n<tr><td>translate</td>\n<td>x,y</td>\n<td>Specify center of coordinate space to use for\nsubsequent drawing commands.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"endiantype\">\n<h1><a class=\"toc-backref\" href=\"#id16\">EndianType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  UndefinedEndian,\n  LSBEndian,            /* &quot;little&quot; endian */\n  MSBEndian,            /* &quot;big&quot; endian */\n  NativeEndian          /* native endian */\n} EndianType;\n</pre>\n</div>\n<div class=\"section\" id=\"errorhandler\">\n<h1><a class=\"toc-backref\" href=\"#id17\">ErrorHandler</a></h1>\n<pre class=\"literal-block\">\ntypedef void\n  (*ErrorHandler)(const ExceptionType,const char *,const char *);\n</pre>\n</div>\n<div class=\"section\" id=\"exceptioninfo\">\n<h1><a class=\"toc-backref\" href=\"#id18\">ExceptionInfo</a></h1>\n<pre class=\"literal-block\">\ntypedef struct _ExceptionInfo\n{\n  char\n    *reason,\n    *description;\n\n  ExceptionType\n    severity;\n\n  unsigned long\n    signature;\n} ExceptionInfo;\n</pre>\n</div>\n<div class=\"section\" id=\"exceptiontype\">\n<h1><a class=\"toc-backref\" href=\"#id19\">ExceptionType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  UndefinedException,\n  WarningException = 300,\n  ResourceLimitWarning = 300,\n  TypeWarning = 305,\n  OptionWarning = 310,\n  DelegateWarning = 315,\n  MissingDelegateWarning = 320,\n  CorruptImageWarning = 325,\n  FileOpenWarning = 330,\n  BlobWarning = 335,\n  StreamWarning = 340,\n  CacheWarning = 345,\n  CoderWarning = 350,\n  ModuleWarning = 355,\n  DrawWarning = 360,\n  ImageWarning = 365,\n  XServerWarning = 380,\n  MonitorWarning = 385,\n  RegistryWarning = 390,\n  ConfigureWarning = 395,\n  ErrorException = 400,\n  ResourceLimitError = 400,\n  TypeError = 405,\n  OptionError = 410,\n  DelegateError = 415,\n  MissingDelegateError = 420,\n  CorruptImageError = 425,\n  FileOpenError = 430,\n  BlobError = 435,\n  StreamError = 440,\n  CacheError = 445,\n  CoderError = 450,\n  ModuleError = 455,\n  DrawError = 460,\n  ImageError = 465,\n  XServerError = 480,\n  MonitorError = 485,\n  RegistryError = 490,\n  ConfigureError = 495,\n  FatalErrorException = 700,\n  ResourceLimitFatalError = 700,\n  TypeFatalError = 705,\n  OptionFatalError = 710,\n  DelegateFatalError = 715,\n  MissingDelegateFatalError = 720,\n  CorruptImageFatalError = 725,\n  FileOpenFatalError = 730,\n  BlobFatalError = 735,\n  StreamFatalError = 740,\n  CacheFatalError = 745,\n  CoderFatalError = 750,\n  ModuleFatalError = 755,\n  DrawFatalError = 760,\n  ImageFatalError = 765,\n  XServerFatalError = 780,\n  MonitorFatalError = 785,\n  RegistryFatalError = 790,\n  ConfigureFatalError = 795\n} ExceptionType;\n</pre>\n</div>\n<div class=\"section\" id=\"fillrule\">\n<h1><a class=\"toc-backref\" href=\"#id20\">FillRule</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  UndefinedRule,\n  EvenOddRule,\n  NonZeroRule\n} FillRule;\n</pre>\n</div>\n<div class=\"section\" id=\"filtertypes\">\n<h1><a class=\"toc-backref\" href=\"#id21\">FilterTypes</a></h1>\n<p>FilterTypes is used to adjust the filter algorithm used when resizing\nimages. Different filters experience varying degrees of success with\nvarious images and can take significantly different amounts of processing\ntime. GraphicsMagick uses the LanczosFilter by default since this filter\nhas been shown to provide the best results for most images in a\nreasonable amount of time. Other filter types (e.g. TriangleFilter) may\nexecute much faster but may show artifacts when the image is re-sized or\naround diagonal lines. The only way to be sure is to test the filter with\nsample images.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>FilterTypes</caption>\n<colgroup>\n<col width=\"48%\" />\n<col width=\"52%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>UndefinedFilter</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>PointFilter</td>\n<td>Point Filter</td>\n</tr>\n<tr><td>BoxFilter</td>\n<td>Box Filter</td>\n</tr>\n<tr><td>TriangleFilter</td>\n<td>Triangle Filter</td>\n</tr>\n<tr><td>HermiteFilter</td>\n<td>Hermite Filter</td>\n</tr>\n<tr><td>HanningFilter</td>\n<td>Hanning Filter</td>\n</tr>\n<tr><td>HammingFilter</td>\n<td>Hamming Filter</td>\n</tr>\n<tr><td>BlackmanFilter</td>\n<td>Blackman Filter</td>\n</tr>\n<tr><td>GaussianFilter</td>\n<td>Gaussian Filter</td>\n</tr>\n<tr><td>QuadraticFilter</td>\n<td>Quadratic Filter</td>\n</tr>\n<tr><td>CubicFilter</td>\n<td>Cubic Filter</td>\n</tr>\n<tr><td>CatromFilter</td>\n<td>Catrom Filter</td>\n</tr>\n<tr><td>MitchellFilter</td>\n<td>Mitchell Filter</td>\n</tr>\n<tr><td>LanczosFilter</td>\n<td>Lanczos Filter</td>\n</tr>\n<tr><td>BesselFilter</td>\n<td>Bessel Filter</td>\n</tr>\n<tr><td>SincFilter</td>\n<td>Sinc Filter</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"frameinfo\">\n<h1><a class=\"toc-backref\" href=\"#id22\">FrameInfo</a></h1>\n<pre class=\"literal-block\">\ntypedef struct _FrameInfo\n{\n  unsigned long\n    width,\n    height;\n\n  long\n    x,\n    y,\n    inner_bevel,\n    outer_bevel;\n} FrameInfo;\n</pre>\n</div>\n<div class=\"section\" id=\"gravitytype\">\n<h1><a class=\"toc-backref\" href=\"#id23\">GravityType</a></h1>\n<p>GravityType specifies positioning of an object (e.g. text, image) within\na bounding region (e.g. an image). Gravity provides a convenient way to\nlocate objects irrespective of the size of the bounding region, in other\nwords, you don't need to provide absolute coordinates in order to\nposition an object. A common default for gravity is NorthWestGravity.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>GravityType</caption>\n<colgroup>\n<col width=\"27%\" />\n<col width=\"73%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>ForgetGravity</td>\n<td>Don't use gravity.</td>\n</tr>\n<tr><td>NorthWestGravity</td>\n<td>Position object at top-left of region.</td>\n</tr>\n<tr><td>NorthGravity</td>\n<td>Postiion object at top-center of region</td>\n</tr>\n<tr><td>NorthEastGravity</td>\n<td>Position object at top-right of region</td>\n</tr>\n<tr><td>WestGravity</td>\n<td>Position object at left-center of region</td>\n</tr>\n<tr><td>CenterGravity</td>\n<td>Position object at center of region</td>\n</tr>\n<tr><td>EastGravity</td>\n<td>Position object at right-center of region</td>\n</tr>\n<tr><td>SouthWestGravity</td>\n<td>Position object at left-bottom of region</td>\n</tr>\n<tr><td>SouthGravity</td>\n<td>Position object at bottom-center of region</td>\n</tr>\n<tr><td>SouthEastGravity</td>\n<td>Position object at bottom-right of region</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"image\">\n<h1><a class=\"toc-backref\" href=\"#id24\">Image</a></h1>\n<p>The Image structure represents an GraphicsMagick image. It is initially\nallocated by AllocateImage() and deallocated by DestroyImage(). The\nfunctions ReadImage(), ReadImages(), BlobToImage() and CreateImage()\nreturn a new image. Use CloneImage() to copy an image. An image consists\nof a structure containing image attributes as well as the image pixels.</p>\n<p>The image pixels are represented by the structure PixelPacket and are\ncached in-memory, or on disk, depending on the cache threshold setting.\nThis cache is known as the &quot;pixel cache&quot;. Pixels in the cache may not be\nedited directly. They must first be made visible from the cache via a\npixel view. A pixel view is a rectangular view of the pixels as defined\nby a starting coordinate, and a number of rows and columns. When\nconsidering the varying abilities of multiple platforms, the most\nreliably efficient pixel view is comprized of part, or all, of one image\nrow.</p>\n<p>There are two means of accessing pixel views. When using the default\nview, the pixels are made visible and accessable by using the\nGetImagePixels() method which provides access to a specified region of\nthe image. After the view has been updated, the pixels may be saved back\nto the cache in their original positions via SyncImagePixels(). In order\nto create an image with new contents, or to blindly overwrite existing\ncontents, the method SetImagePixels() is used to reserve a pixel view\ncorresponding to a region in the pixel cache. Once the pixel view has\nbeen updated, it may be written to the cache via SyncImagePixels(). The\nfunction GetIndexes() provides access to the image colormap, represented\nas an array of type IndexPacket.</p>\n<p>A more flexible interface to the image pixels is via the Cache View\ninterface. This interface supports multiple pixel cache views (limited by\nthe amount of available memory), each of which are identified by a handle\n(of type ViewInfo). Use OpenCacheView() to obtain a new cache view,\nCloseCacheView() to discard a cache view, GetCacheViewPixels() to access\nan existing pixel region, SetCacheView() to define a new pixel region,\nand SyncCacheViewPixels() to save the updated pixel region. The function\nGetCacheViewIndexes() provides access to the colormap indexes associated\nwith the pixel view.</p>\n<p>When writing encoders and decoders for new image formats, it is\nconvenient to have a high-level interface available which supports\nconverting between external pixel representations and GraphicsMagick's\nown representation. Pixel components (red, green, blue, opacity, RGB, or\nRGBA) may be transferred from a user-supplied buffer into the default\nview by using ImportImagePixelArea(), or from an allocated view via\nImportViewPixelArea(). Pixel components may be transferred from the\ndefault view into a user-supplied buffer by using ExportImagePixelArea(),\nor from an allocated view via ExportViewPixelArea(). Use of this\nhigh-level interface helps protect image coders from changes to\nGraphicsMagick's pixel representation and simplifies the implementation.</p>\n<p>The members of the Image structure are shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Image Structure Members</caption>\n<colgroup>\n<col width=\"31%\" />\n<col width=\"18%\" />\n<col width=\"51%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Member</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>background_color</td>\n<td>PixelPacket</td>\n<td>Image background color</td>\n</tr>\n<tr><td>blur</td>\n<td>double</td>\n<td>Blur factor to apply to the image when zooming</td>\n</tr>\n<tr><td>border_color</td>\n<td>PixelPacket</td>\n<td>Image border color</td>\n</tr>\n<tr><td>chromaticity</td>\n<td>ChromaticityInfo</td>\n<td>Red, green, blue, and white-point chromaticity\nvalues.</td>\n</tr>\n<tr><td>colormap</td>\n<td>PixelPacket *</td>\n<td>PseudoColor palette array.</td>\n</tr>\n<tr><td>colors</td>\n<td>unsigned int</td>\n<td>The desired number of colors. Used by\nQuantizeImage().</td>\n</tr>\n<tr><td>colorspace</td>\n<td>ColorspaceType</td>\n<td>Image pixel interpretation.If the colorspace is\nRGB the pixels are red, green, blue. If matte is\ntrue, then red, green, blue, and index. If it is\nCMYK, the pixels are cyan, yellow, magenta, black.\nOtherwise the colorspace is ignored.</td>\n</tr>\n<tr><td>columns</td>\n<td>unsigned int</td>\n<td>Image width</td>\n</tr>\n<tr><td>compression</td>\n<td>CompressionType</td>\n<td>Image compresion type. The default is the\ncompression type of the specified image file.</td>\n</tr>\n<tr><td>delay</td>\n<td>unsigned int</td>\n<td>Time in 1/100ths of a second (0 to 65535) which\nmust expire before displaying the next image in an\nanimated sequence. This option is useful for\nregulating the animation of a sequence of GIF\nimages within Netscape.</td>\n</tr>\n<tr><td>depth</td>\n<td>unsigned int</td>\n<td>Image depth.  Number of encoding bits per sample.\nUsually 8 or 16, but sometimes 10 or 12.</td>\n</tr>\n<tr><td>directory</td>\n<td>char *</td>\n<td>Tile names from within an image montage. Only\nvalid after calling MontageImages() or reading a\nMIFF file which contains a directory.</td>\n</tr>\n<tr><td>dispose</td>\n<td>unsigned int</td>\n<td>GIF disposal method. This option is used to\ncontrol how successive frames are rendered (how\nthe preceding frame is disposed of) when creating\na GIF animation.</td>\n</tr>\n<tr><td>exception</td>\n<td>ExceptionInfo</td>\n<td>Record of any error which occurred when updating\nimage.</td>\n</tr>\n<tr><td>filename</td>\n<td>char\n[MaxTextExtent]</td>\n<td>Image file name to read or write.</td>\n</tr>\n<tr><td>filter</td>\n<td>FilterTypes</td>\n<td>Filter to use when resizing image. The reduction\nfilter employed has a significant effect on the\ntime required to resize an image and the resulting\nquality. The default filter is Lanczos which has\nbeen shown to produce high quality results when\nreducing most images.</td>\n</tr>\n<tr><td>fuzz</td>\n<td>int</td>\n<td>Colors within this distance are considered equal.\nA number of algorithms search for a target color.\nBy default the color must be exact. Use this\noption to match colors that are close to the\ntarget color in RGB space.</td>\n</tr>\n<tr><td>gamma</td>\n<td>double</td>\n<td>Gamma level of the image. The same color image\ndisplayed on two different workstations may look\ndifferent due to differences in the display\nmonitor. Use gamma correction to adjust for this\ncolor difference.</td>\n</tr>\n<tr><td>geometry</td>\n<td>char *</td>\n<td>Preferred size of the image when encoding.</td>\n</tr>\n<tr><td>interlace</td>\n<td>InterlaceType</td>\n<td>The type of interlacing scheme (default\nNoInterlace). This option is used to specify the\ntype of interlacing scheme for raw image formats\nsuch as RGB or YUV. NoInterlace means do not\ninterlace, LineInterlace uses scanline\ninterlacing, and PlaneInterlace uses plane\ninterlacing. PartitionInterlace is like\nPlaneInterlace except the different planes are\nsaved to individual files (e.g. image.R, image.G,\nand image.B). Use LineInterlace or PlaneInterlace\nto create an interlaced GIF or progressive JPEG\nimage.</td>\n</tr>\n<tr><td>iterations</td>\n<td>unsigned int</td>\n<td>Number of iterations to loop an animation (e.g.\nNetscape loop extension) for.</td>\n</tr>\n<tr><td>magick</td>\n<td>char\n[MaxTextExtent]</td>\n<td>Image encoding format (e.g. &quot;GIF&quot;).</td>\n</tr>\n<tr><td>magick_columns</td>\n<td>unsigned int</td>\n<td>Base image width (before transformations)</td>\n</tr>\n<tr><td>magick_filename</td>\n<td>char\n[MaxTextExtent]</td>\n<td>Base image filename (before transformations)</td>\n</tr>\n<tr><td>magick_rows</td>\n<td>unsigned int</td>\n<td>Base image height (before transformations)</td>\n</tr>\n<tr><td>matte</td>\n<td>unsigned int</td>\n<td>If non-zero, then the index member of pixels\nrepresents the alpha channel.</td>\n</tr>\n<tr><td>matte_color</td>\n<td>PixelPacket</td>\n<td>Image matte (transparent) color</td>\n</tr>\n<tr><td>montage</td>\n<td>char *</td>\n<td>Tile size and offset within an image montage. Only\nvalid for montage images.</td>\n</tr>\n<tr><td>next</td>\n<td>struct _Image *</td>\n<td>Next image frame in sequence</td>\n</tr>\n<tr><td>offset</td>\n<td>int</td>\n<td>Number of initial bytes to skip over when reading\nraw image.</td>\n</tr>\n<tr><td>orientation</td>\n<td>OrientationType</td>\n<td>Orientation of the image. Specifies scanline\norientation and starting coordinate of image.</td>\n</tr>\n<tr><td>page</td>\n<td>RectangleInfo</td>\n<td>Equivalent size of Postscript page.</td>\n</tr>\n<tr><td>previous</td>\n<td>struct _Image *</td>\n<td>Previous image frame in sequence.</td>\n</tr>\n<tr><td>rendering_intent</td>\n<td>RenderingIntent</td>\n<td>The type of rendering intent.</td>\n</tr>\n<tr><td>rows</td>\n<td>unsigned int</td>\n<td>Image height</td>\n</tr>\n<tr><td>scene</td>\n<td>unsigned int</td>\n<td>Image frame scene number.</td>\n</tr>\n<tr><td>storage_class</td>\n<td>ClassType</td>\n<td>Image storage class. If DirectClass then the image\npackets contain valid RGB or CMYK colors. If\nPseudoClass then the image has a colormap\nreferenced by pixel's index member.</td>\n</tr>\n<tr><td>tile_info</td>\n<td>RectangleInfo</td>\n<td>Describes a tile within an image.  For example, if\nyour images is 640x480 you may only want 320x256\nwith an offset of +128+64. It is used for raw\nformats such as RGB and CMYK as well as for TIFF.</td>\n</tr>\n<tr><td>timer</td>\n<td>TimerInfo</td>\n<td>Support for measuring actual (user + system) and\nelapsed execution time.</td>\n</tr>\n<tr><td>total_colors</td>\n<td>unsigned long</td>\n<td>The number of colors in the image after\nQuantizeImage(), or QuantizeImages() if the\nverbose flag was set before the call. Calculated\nby GetNumberColors().</td>\n</tr>\n<tr><td>units</td>\n<td>ResolutionType</td>\n<td>Units of image resolution</td>\n</tr>\n<tr><td>x_resolution</td>\n<td>double</td>\n<td>Horizontal resolution of the image</td>\n</tr>\n<tr><td>y_resolution</td>\n<td>double</td>\n<td>Vertical resolution of the image</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"imageinfo\">\n<h1><a class=\"toc-backref\" href=\"#id25\">ImageInfo</a></h1>\n<p>The ImageInfo structure is used to supply option information to the\nfunctions AllocateImage(), AnimateImages(), BlobToImage(),\nCloneAnnotateInfo(), DisplayImages(), GetAnnotateInfo(), ImageToBlob(),\nPingImage(), ReadImage(), ReadImages(), and, WriteImage(). These\nfunctions update information in ImageInfo to reflect attributes of the\ncurrent image.</p>\n<p>Use CloneImageInfo() to duplicate an existing ImageInfo structure or\nallocate a new one. Use DestroyImageInfo() to deallocate memory\nassociated with an ImageInfo structure. Use GetImageInfo() to initialize\nan existing ImageInfo structure. Use SetImageInfo() to set image type\ninformation in the ImageInfo structure based on an existing image.</p>\n<p>The members of the ImageInfo structure are shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ImageInfo Structure Members</caption>\n<colgroup>\n<col width=\"16%\" />\n<col width=\"15%\" />\n<col width=\"68%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Member</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>adjoin</td>\n<td>unsigned int</td>\n<td>Join images into a single multi-image file.</td>\n</tr>\n<tr><td>antialias</td>\n<td>unsigned int</td>\n<td>Control antialiasing of rendered Postscript and Postscript or\nTrueType fonts. Enabled by default.</td>\n</tr>\n<tr><td>background_color</td>\n<td>PixelPacket</td>\n<td>Image background color.</td>\n</tr>\n<tr><td>border_color</td>\n<td>PixelPacket</td>\n<td>Image border color.</td>\n</tr>\n<tr><td>colorspace</td>\n<td>ColorspaceType</td>\n<td>Image pixel interpretation.If the colorspace is RGB the pixels are\nred, green, blue. If matte is true, then red, green, blue, and\nindex. If it is CMYK, the pixels are cyan, yellow, magenta, black.\nOtherwise the colorspace is ignored.</td>\n</tr>\n<tr><td>compression</td>\n<td>CompressionType</td>\n<td>Image compresion type. The default is the compression type of the\nspecified image file.</td>\n</tr>\n<tr><td>delay</td>\n<td>char *</td>\n<td>Time in 1/100ths of a second (0 to 65535) which must expire before\ndisplaying the next image in an animated sequence. This option is\nuseful for regulating the animation of a sequence of GIF images\nwithin Netscape.</td>\n</tr>\n<tr><td>density</td>\n<td>char *</td>\n<td>Vertical and horizontal resolution in pixels of the image. This\noption specifies an image density when decoding a Postscript or\nPortable Document page. Often used with page.</td>\n</tr>\n<tr><td>depth</td>\n<td>unsigned int</td>\n<td>Image depth (8 or 16). QuantumLeap must be defined before a depth\nof 16 is valid.</td>\n</tr>\n<tr><td>dispose</td>\n<td>char *</td>\n<td>GIF disposal method. This option is used to control how successive\nframes are rendered (how the preceding frame is disposed of) when\ncreating a GIF animation.</td>\n</tr>\n<tr><td>dither</td>\n<td>unsigned int</td>\n<td>Apply Floyd/Steinberg error diffusion to the image. The basic\nstrategy of dithering is to trade intensity resolution for spatial\nresolution by averaging the intensities of several neighboring\npixels. Images which suffer from severe contouring when reducing\ncolors can be improved with this option. The colors or monochrome\noption must be set for this option to take effect.</td>\n</tr>\n<tr><td>file</td>\n<td>FILE *</td>\n<td>Stdio stream to read image from or write image to. If set,\nImageMagick will read from or write to the stream rather than\nopening a file. Used by ReadImage() and WriteImage(). The stream is\nclosed when the operation completes.</td>\n</tr>\n<tr><td>filename</td>\n<td>char\n[MaxTextExtent]</td>\n<td>Image file name to read or write.</td>\n</tr>\n<tr><td>fill</td>\n<td>PixelPacket</td>\n<td>Drawing object fill color.</td>\n</tr>\n<tr><td>font</td>\n<td>char *</td>\n<td>Text rendering font. If the font is a fully qualified X server font\nname, the font is obtained from an X server. To use a TrueType\nfont, precede the TrueType filename with an &#64;. Otherwise, specify a\nPostscript font name (e.g. &quot;helvetica&quot;).</td>\n</tr>\n<tr><td>fuzz</td>\n<td>int</td>\n<td>Colors within this distance are considered equal. A number of\nalgorithms search for a target color. By default the color must be\nexact. Use this option to match colors that are close to the target\ncolor in RGB space.</td>\n</tr>\n<tr><td>interlace</td>\n<td>InterlaceType</td>\n<td>The type of interlacing scheme (default NoInterlace). This option\nis used to specify the type of interlacing scheme for raw image\nformats such as RGB or YUV. NoInterlace means do not interlace,\nLineInterlace uses scanline interlacing, and PlaneInterlace uses\nplane interlacing. PartitionInterlace is like PlaneInterlace except\nthe different planes are saved to individual files (e.g. image.R,\nimage.G, and image.B). Use LineInterlace or PlaneInterlace to\ncreate an interlaced GIF or progressive JPEG image.</td>\n</tr>\n<tr><td>iterations</td>\n<td>char *</td>\n<td>Number of iterations to loop an animation (e.g. Netscape loop\nextension) for.</td>\n</tr>\n<tr><td>linewidth</td>\n<td>unsigned int</td>\n<td>Line width for drawing lines, circles, ellipses, etc.</td>\n</tr>\n<tr><td>magick</td>\n<td>char\n[MaxTextExtent]</td>\n<td>Image encoding format (e.g. &quot;GIF&quot;).</td>\n</tr>\n<tr><td>matte_color</td>\n<td>PixelPacket</td>\n<td>Image matte (transparent) color.</td>\n</tr>\n<tr><td>monochrome</td>\n<td>unsigned int</td>\n<td>Transform the image to black and white.</td>\n</tr>\n<tr><td>page</td>\n<td>char *</td>\n<td>Equivalent size of Postscript page.</td>\n</tr>\n<tr><td>ping</td>\n<td>unsigned int</td>\n<td>Set to True to read enough of the image to determine the image\ncolumns, rows, and filesize. The columns, rows, and size attributes\nare valid after invoking ReadImage() while ping is set. The image\ndata is not valid after calling ReadImage() if ping is set.</td>\n</tr>\n<tr><td>pointsize</td>\n<td>double</td>\n<td>Text rendering font point size.</td>\n</tr>\n<tr><td>preview_type</td>\n<td>PreviewType</td>\n<td>Image manipulation preview option. Used by 'display'.</td>\n</tr>\n<tr><td>quality</td>\n<td>unsigned int</td>\n<td>JPEG/MIFF/PNG compression level (default 75).</td>\n</tr>\n<tr><td>server_name</td>\n<td>char *</td>\n<td>X11 display to display to obtain fonts from, or to capture image\nfrom.</td>\n</tr>\n<tr><td>size</td>\n<td>char *</td>\n<td>Width and height of a raw image (an image which does not support\nwidth and height information). Size may also be used to affect the\nimage size read from a multi-resolution format (e.g. Photo CD,\nJBIG, or JPEG.</td>\n</tr>\n<tr><td>stroke</td>\n<td>PixelPacket</td>\n<td>Drawing object outline color.</td>\n</tr>\n<tr><td>subimage</td>\n<td>unsigned int</td>\n<td>Subimage of an image sequence.</td>\n</tr>\n<tr><td>subrange</td>\n<td>unsigned int</td>\n<td>Number of images relative to the base image.</td>\n</tr>\n<tr><td>texture</td>\n<td>char *</td>\n<td>Image filename to use as background texture.</td>\n</tr>\n<tr><td>tile</td>\n<td>char *</td>\n<td>Tile name.</td>\n</tr>\n<tr><td>units</td>\n<td>ResolutionType</td>\n<td>Units of image resolution.</td>\n</tr>\n<tr><td>verbose</td>\n<td>unsigned int</td>\n<td>Print detailed information about the image if True.</td>\n</tr>\n<tr><td>view</td>\n<td>char *</td>\n<td>FlashPix viewing parameters.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"imagetype\">\n<h1><a class=\"toc-backref\" href=\"#id26\">ImageType</a></h1>\n<p>ImageType indicates the type classification of the image.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ImageType</caption>\n<colgroup>\n<col width=\"31%\" />\n<col width=\"69%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>UndefinedType</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>BilevelType</td>\n<td>Monochrome image</td>\n</tr>\n<tr><td>GrayscaleType</td>\n<td>Grayscale image</td>\n</tr>\n<tr><td>PaletteType</td>\n<td>Indexed color (palette) image</td>\n</tr>\n<tr><td>PaletteMatteType</td>\n<td>Indexed color (palette) image with opacity</td>\n</tr>\n<tr><td>TrueColorType</td>\n<td>Truecolor image</td>\n</tr>\n<tr><td>TrueColorMatteType</td>\n<td>Truecolor image with opacity</td>\n</tr>\n<tr><td>ColorSeparationType</td>\n<td>Cyan/Yellow/Magenta/Black (CYMK) image</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"indexpacket\">\n<h1><a class=\"toc-backref\" href=\"#id27\">IndexPacket</a></h1>\n<p>IndexPacket is the type used for a colormap index. An array of type\nIndexPacket is used to represent an image in PseudoClass type. Currently\nsupported IndexPacket underlying types are 'unsigned char' and 'unsigned\nshort'. The type is selected at build time according to the QuantumDepth\nsetting.</p>\n</div>\n<div class=\"section\" id=\"interlacetype\">\n<h1><a class=\"toc-backref\" href=\"#id28\">InterlaceType</a></h1>\n<p>InterlaceType specifies the ordering of the red, green, and blue pixel\ninformation in the image. Interlacing is usually used to make image\ninformation available to the user faster by taking advantage of the space\nvs time tradeoff. For example, interlacing allows images on the Web to be\nrecognizable sooner and satellite images to accumulate/render with image\nresolution increasing over time.</p>\n<p>Use LineInterlace or PlaneInterlace to create an interlaced GIF or\nprogressive JPEG image.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>InterlaceType</caption>\n<colgroup>\n<col width=\"19%\" />\n<col width=\"81%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>UndefinedInterlace</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>NoInterlace</td>\n<td>Don't interlace image (RGBRGBRGBRGBRGBRGB...)</td>\n</tr>\n<tr><td>LineInterlace</td>\n<td>Use scanline interlacing (RRR...GGG...BBB...RRR...GGG...BBB...)</td>\n</tr>\n<tr><td>PlaneInterlace</td>\n<td>Use plane interlacing (RRRRRR...GGGGGG...BBBBBB...)</td>\n</tr>\n<tr><td>PartitionInterlace</td>\n<td>Similar to plane interlaing except that the different planes are saved to\nindividual files (e.g. image.R, image.G, and image.B)</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"layertype\">\n<h1><a class=\"toc-backref\" href=\"#id29\">LayerType</a></h1>\n<p>LayerType is used as an argument when doing color separations. Use\nLayerType when extracting a layer from an image. MatteLayer is useful for\nextracting the opacity values from an image.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>LayerType</caption>\n<colgroup>\n<col width=\"28%\" />\n<col width=\"72%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>UndefinedLayer</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>RedLayer</td>\n<td>Select red layer</td>\n</tr>\n<tr><td>GreenLayer</td>\n<td>Select green layer</td>\n</tr>\n<tr><td>BlueLayer</td>\n<td>Select blue layer</td>\n</tr>\n<tr><td>MatteLayer</td>\n<td>Select matte (opacity values) layer</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"magickinfo\">\n<h1><a class=\"toc-backref\" href=\"#id30\">MagickInfo</a></h1>\n<p>The MagickInfo structure is used by GraphicsMagick to register support\nfor an image format. The MagickInfo structure is allocated with default\nparameters by calling SetMagickInfo(). Image formats are registered by\ncalling RegisterMagickInfo() which adds the initial structure to a linked\nlist (at which point it is owned by the list). A pointer to the structure\ndescribing a format may be obtained by calling GetMagickInfo(). Pass the\nargument NULL to obtain the first member of this list. A human-readable\nlist of registered image formats may be printed to a file descriptor by\ncalling ListMagickInfo().</p>\n<p>Support for formats may be provided as a module which is part of the\nGraphicsMagick library, provided by a module which is loaded dynamically\nat run-time, or directly by the linked program. Users of GraphicsMagick\nwill normally want to create a loadable-module, or support encode/decode\nof an image format directly from within their program.</p>\n<p>Sample Module:</p>\n<p>The following shows sample code for a module called &quot;GIF&quot; (gif.c). Note\nthat the names of the Register and Unregister call-back routines are\ncalculated at run-time, and therefore must follow the rigid naming scheme\nRegisterFORMATImage and UnregisterFORMATImage, respectively, where FORMAT\nis the upper-cased name of the module file:</p>\n<pre class=\"literal-block\">\n/* Read image */\nImage *ReadGIFImage(const ImageInfo *image_info)\n{\n  [ decode the image ... ]\n}\n\n/* Write image */\nunsigned int WriteGIFImage(const ImageInfo *image_info,Image *image)\n{\n  [ encode the image ... ]\n}\n\n/* Module call-back to register support for formats */\nvoid RegisterGIFImage(void)\n{\n  MagickInfo *entry;\n  entry=SetMagickInfo(&quot;GIF&quot;);\n  entry-&gt;decoder=ReadGIFImage;\n  entry-&gt;encoder=WriteGIFImage;\n  entry-&gt;description=&quot;CompuServe graphics interchange format&quot;;\n  entry-&gt;module=&quot;GIF&quot;;\n  RegisterMagickInfo(entry);\n\n  entry=SetMagickInfo(&quot;GIF87&quot;);\n  entry-&gt;decoder=ReadGIFImage;\n  entry-&gt;encoder=WriteGIFImage;\n  entry-&gt;adjoin=False;\n  entry-&gt;description=&quot;CompuServe graphics interchange format (version 87a)&quot;;\n  entry-&gt;module=&quot;GIF&quot;;\n  RegisterMagickInfo(entry);\n}\n\n/* Module call-back to unregister support for formats */\nExport void UnregisterGIFImage(void)\n{\n  UnregisterMagickInfo(&quot;GIF&quot;);\n  UnregisterMagickInfo(&quot;GIF87&quot;);\n}\n</pre>\n<p>Sample Application Code</p>\n<p>Image format support provided within the user's application does not need\nto implement the RegisterFORMATImage and UnregisterFORMATImage call-back\nroutines. Instead, the application takes responsibility for the\nregistration itself. An example follows:</p>\n<pre class=\"literal-block\">\n/* Read image */\nImage *ReadGIFImage(const ImageInfo *image_info)\n{\n  [ decode the image ... ]\n}\n/* Write image */\nunsigned int WriteGIFImage(const ImageInfo *image_info,Image *image)\n{\n  [ encode the image ... ]\n}\n#include &lt;stdio.h&gt;\nint main( void )\n{\n  struct MagickInfo* info;\n  info = SetMagickInfo(&quot;GIF&quot;);\n  if ( info == (MagickInfo*)NULL )\n  exit(1);\n  info-&gt;decoder = ReadGIFImage;\n  info-&gt;encoder = WriteGIFImage;\n  info-&gt;adjoin = False;\n  info-&gt;description = &quot;CompuServe graphics interchange format&quot;;\n  /* Add MagickInfo structure to list */\n  RegisterMagickInfo(info);\n  info = GetMagickInfo(&quot;GIF&quot;);\n  [ do something with info ... ]\n  ListMagickInfo( stdout );\n  return;\n}\n</pre>\n<p>MagickInfo Structure Definition</p>\n<p>The members of the MagickInfo structure are shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>MagickInfo Structure Members</caption>\n<colgroup>\n<col width=\"12%\" />\n<col width=\"20%\" />\n<col width=\"67%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Member</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>adjoin</td>\n<td>unsigned int</td>\n<td>Set to non-zero (True) if this file format supports multi-frame\nimages.</td>\n</tr>\n<tr><td>blob_support</td>\n<td>unsigned int</td>\n<td>Set to non-zero (True) if the encoder and decoder for this format\nsupports operating on arbitrary BLOBs (rather than only disk\nfiles).</td>\n</tr>\n<tr><td>data</td>\n<td>void *</td>\n<td>User specified data. A way to pass any sort of data structure to\nthe endoder/decoder. To set this, GetMagickInfo() must be called\nto first obtain a pointer to the registered structure since it can\nnot be set via a RegisterMagickInfo() parameter.</td>\n</tr>\n<tr><td>decoder</td>\n<td>Image *(*decoder)\n(const ImageInfo\n*)</td>\n<td>Function to decode image data and return GraphicsMagick Image.</td>\n</tr>\n<tr><td>description</td>\n<td>char *</td>\n<td>Long form image format description (e.g. &quot;CompuServe graphics\ninterchange format&quot;).</td>\n</tr>\n<tr><td>encoder</td>\n<td>unsigned int\n(*encoder)(const\nImageInfo *, Image\n*)</td>\n<td>Function to encode image data with options passed via ImageInfo\nand image represented by Image.</td>\n</tr>\n<tr><td>module</td>\n<td>char *</td>\n<td>Name of module (e.g. &quot;GIF&quot;) which registered this format. Set to\nNULL if format is not registered by a module.</td>\n</tr>\n<tr><td>name</td>\n<td>const char *</td>\n<td>Magick string (e.g. &quot;GIF&quot;) which identifies this format.</td>\n</tr>\n<tr><td>next</td>\n<td>MagickInfo</td>\n<td>Next MagickInfo struct in linked-list. NULL if none.</td>\n</tr>\n<tr><td>previous</td>\n<td>MagickInfo</td>\n<td>Previous MagickInfo struct in linked-list. NULL if none.</td>\n</tr>\n<tr><td>raw</td>\n<td>unsigned int</td>\n<td>Image format does not contain size (must be specified in\nImageInfo).</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"monitorhandler\">\n<h1><a class=\"toc-backref\" href=\"#id31\">MonitorHandler</a></h1>\n<p>MonitorHandler is the function type to be used for the progress monitor\ncallback. Its definition is as follows:</p>\n<pre class=\"literal-block\">\ntypedef unsigned int\n  (*MonitorHandler)(const char *text, const magick_int64_t quantum,\n    const magick_uint64_t span, ExceptionInfo *exception);\n</pre>\n<p>The operation of the monitor handler is described in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>MonitorHandler Parameters</caption>\n<colgroup>\n<col width=\"25%\" />\n<col width=\"25%\" />\n<col width=\"49%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Parameter</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>return status</td>\n<td>unsigned int</td>\n<td>The progress monitor should normally return\nTrue (a non-zero value) if the operation is\nto continue. If the progress monitor returns\nfalse, then the operation is will be aborted.\nThis mechanism allows a user to terminate a\nprocess which is taking too long to complete.</td>\n</tr>\n<tr><td>text</td>\n<td>const char *</td>\n<td>A description of the current operation being\nperformed.</td>\n</tr>\n<tr><td>quantum</td>\n<td>const magick_int64_t</td>\n<td>A value within the range of 0 to span which\nindicates the degree of progress.</td>\n</tr>\n<tr><td>span</td>\n<td>const magick_uint64_t</td>\n<td>The total range that quantum will span.</td>\n</tr>\n<tr><td>exception</td>\n<td>exceptionInfo *</td>\n<td>If the progress monitor returns False (abort\noperation), it should also update the\nstructure passed via the exception parameter\nso that an error message may be reported to\nthe user.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"montageinfo\">\n<h1><a class=\"toc-backref\" href=\"#id32\">MontageInfo</a></h1>\n<pre class=\"literal-block\">\ntypedef struct _MontageInfo\n{\n  char\n    *geometry,\n    *tile,\n    *title,\n    *frame,\n    *texture,\n    *font;\n\n  double\n    pointsize;\n\n  unsigned long\n    border_width;\n\n  unsigned int\n    shadow;\n\n  PixelPacket\n    fill,\n    stroke,\n    background_color,\n    border_color,\n    matte_color;\n\n  GravityType\n    gravity;\n\n  char\n    filename[MaxTextExtent];\n\n  unsigned long\n    signature;\n} MontageInfo;\n</pre>\n</div>\n<div class=\"section\" id=\"noisetype\">\n<h1><a class=\"toc-backref\" href=\"#id33\">NoiseType</a></h1>\n<p>NoiseType is used as an argument to select the type of noise to be added\nto the image.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>NoiseType</caption>\n<colgroup>\n<col width=\"48%\" />\n<col width=\"52%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>UniformNoise</td>\n<td>Uniform noise</td>\n</tr>\n<tr><td>GaussianNoise</td>\n<td>Gaussian noise</td>\n</tr>\n<tr><td>MultiplicativeGaussianNoise</td>\n<td>Multiplicative Gaussian noise</td>\n</tr>\n<tr><td>ImpulseNoise</td>\n<td>Impulse noise</td>\n</tr>\n<tr><td>LaplacianNoise</td>\n<td>Laplacian noise</td>\n</tr>\n<tr><td>PoissonNoise</td>\n<td>Poisson noise</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"orientationtype\">\n<h1><a class=\"toc-backref\" href=\"#id34\">OrientationType</a></h1>\n<p>OrientationType specifies the orientation of the image. Useful for when\nthe image is produced via a different ordinate system, the camera was\nturned on its side, or the page was scanned sideways.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>OrientationType</caption>\n<colgroup>\n<col width=\"25%\" />\n<col width=\"29%\" />\n<col width=\"45%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Scanline Direction</td>\n<td>Frame Direction</td>\n</tr>\n<tr><td>UndefinedOrientation</td>\n<td>Unknown</td>\n<td>Unknown</td>\n</tr>\n<tr><td>TopLeftOrientation</td>\n<td>Left to right</td>\n<td>Top to bottom</td>\n</tr>\n<tr><td>TopRightOrientation</td>\n<td>Right to left</td>\n<td>Top to bottom</td>\n</tr>\n<tr><td>BottomRightOrientation</td>\n<td>Right to left</td>\n<td>Bottom to top</td>\n</tr>\n<tr><td>BottomLeftOrientation</td>\n<td>Left to right</td>\n<td>Bottom to top</td>\n</tr>\n<tr><td>LeftTopOrientation</td>\n<td>Top to bottom</td>\n<td>Left to right</td>\n</tr>\n<tr><td>RightTopOrientation</td>\n<td>Top to bottom</td>\n<td>Right to left</td>\n</tr>\n<tr><td>RightBottomOrientation</td>\n<td>Bottom to top</td>\n<td>Right to left</td>\n</tr>\n<tr><td>LeftBottomOrientation</td>\n<td>Bottom to top</td>\n<td>Left to right</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"paintmethod\">\n<h1><a class=\"toc-backref\" href=\"#id35\">PaintMethod</a></h1>\n<p>PaintMethod specifies how pixel colors are to be replaced in the image.\nIt is used to select the pixel-filling algorithm employed.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>PaintMethod</caption>\n<colgroup>\n<col width=\"19%\" />\n<col width=\"81%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>PointMethod</td>\n<td>Replace pixel color at point.</td>\n</tr>\n<tr><td>ReplaceMethod</td>\n<td>Replace color for all image pixels matching color at point.</td>\n</tr>\n<tr><td>FloodfillMethod</td>\n<td>Replace color for pixels surrounding point until encountering pixel that fails\nto match color at point.</td>\n</tr>\n<tr><td>FillToBorderMethod</td>\n<td>Replace color for pixels surrounding point until encountering pixels matching\nborder color.</td>\n</tr>\n<tr><td>ResetMethod</td>\n<td>Replace colors for all pixels in image with pen color.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"pixelpacket\">\n<h1><a class=\"toc-backref\" href=\"#id36\">PixelPacket</a></h1>\n<p>The PixelPacket structure is used to represent DirectClass color pixels\nin GraphicsMagick. If the image is indicated as a PseudoClass image, its\nDirectClass representation is only valid immediately after calling\nSyncImage(). If an image is set as PseudoClass and the DirectClass\nrepresentation is modified, the image should then be set as DirectClass.\nUse QuantizeImage() to restore the PseudoClass colormap if the\nDirectClass representation is modified.</p>\n<p>The members of the PixelPacket structure are shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>PixelPacket Structure Members</caption>\n<colgroup>\n<col width=\"11%\" />\n<col width=\"10%\" />\n<col width=\"24%\" />\n<col width=\"33%\" />\n<col width=\"23%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td rowspan=\"2\">Member</td>\n<td rowspan=\"2\">Type</td>\n<td colspan=\"3\">Interpretation</td>\n</tr>\n<tr><td>RGBColorspace (3)</td>\n<td>RGBColorspace + matte(3)</td>\n<td>CMYKColorspace</td>\n</tr>\n<tr><td>red</td>\n<td>Quantum</td>\n<td>Red</td>\n<td>Red</td>\n<td>Cyan</td>\n</tr>\n<tr><td>green</td>\n<td>Quantum</td>\n<td>Green</td>\n<td>Green</td>\n<td>Magenta</td>\n</tr>\n<tr><td>blue</td>\n<td>Quantum</td>\n<td>Blue</td>\n<td>Blue</td>\n<td>Yellow</td>\n</tr>\n<tr><td>opacity</td>\n<td>Quantum</td>\n<td>Ignored</td>\n<td>Opacity</td>\n<td>Black</td>\n</tr>\n</tbody>\n</table>\n<p>Notes:</p>\n<blockquote>\n<ol class=\"arabic simple\">\n<li>Quantum is an unsigned short (MaxRGB=65535) if GraphicsMagick is\nbuilt using -DQuantumDepth=16 Otherwise it is an unsigned char\n(MaxRGB=255).</li>\n<li>SyncImage() may be used to synchronize the DirectClass color pixels\nto the current PseudoClass colormap.</li>\n<li>For pixel representation purposes, all colorspaces are treated like\nRGBColorspace except for CMYKColorspace.</li>\n</ol>\n</blockquote>\n</div>\n<div class=\"section\" id=\"pointinfo\">\n<h1><a class=\"toc-backref\" href=\"#id37\">PointInfo</a></h1>\n<p>The PointInfo structure is used by the ChromaticityInfo structure to\nspecify chromaticity point values. This defines the boundaries and gammut\n(range of included color) of the colorspace.</p>\n<p>The members of the PointInfo structure are shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>PointInfo Structure Members</caption>\n<colgroup>\n<col width=\"31%\" />\n<col width=\"25%\" />\n<col width=\"44%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Member</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>x</td>\n<td>double</td>\n<td>X ordinate</td>\n</tr>\n<tr><td>y</td>\n<td>double</td>\n<td>Y ordinate</td>\n</tr>\n<tr><td>z</td>\n<td>double</td>\n<td>Z ordinate</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"profileinfo\">\n<h1><a class=\"toc-backref\" href=\"#id38\">ProfileInfo</a></h1>\n<p>The ProfileInfo structure is used to represent ICC or IPCT profiles in\nGraphicsMagick (stored as an opaque BLOB).</p>\n<p>The members of the ProfileInfo structure are shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ProfileInfo Structure Members</caption>\n<colgroup>\n<col width=\"24%\" />\n<col width=\"40%\" />\n<col width=\"36%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Member</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>length</td>\n<td>unsigned int</td>\n<td>Profile length</td>\n</tr>\n<tr><td>info</td>\n<td>unsigned char *</td>\n<td>Profile data</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"quantizeinfo\">\n<h1><a class=\"toc-backref\" href=\"#id39\">QuantizeInfo</a></h1>\n<p>The QuantizeInfo structure is used to support passing parameters to\nGraphicsMagick's color quantization (reduction) functions. Color\nquantization is the process of analyzing one or more images, and\ncalculating a color palette which best approximates the image within a\nspecified colorspace, and then adjusting the image pixels to use the\ncalculated color palette. The maximum number of colors allowed in the\ncolor palette may be specified.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Methods Supporting QuantizeInfo</caption>\n<colgroup>\n<col width=\"20%\" />\n<col width=\"80%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Method</td>\n<td>Description</td>\n</tr>\n<tr><td>GetQuantizeInfo()</td>\n<td>Allocate new structure with defaults set.</td>\n</tr>\n<tr><td>CloneQuantizeInfo()</td>\n<td>Copy existing structure, allocating new structure in the process.</td>\n</tr>\n<tr><td>DestroyQuantizeInfo\n()</td>\n<td>Deallocate structure, including any members.</td>\n</tr>\n<tr><td>QuantizeImage</td>\n<td>Analyzes the colors within a reference image and chooses a fixed number of\ncolors to represent the image.</td>\n</tr>\n<tr><td>QuantizeImages</td>\n<td>Analyzes the colors within a set of reference images and chooses a fixed\nnumber of colors to represent the set.</td>\n</tr>\n</tbody>\n</table>\n<table border=\"1\" class=\"docutils\">\n<caption>QuantizeInfo Structure Members</caption>\n<colgroup>\n<col width=\"13%\" />\n<col width=\"14%\" />\n<col width=\"72%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Member</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>colorspace</td>\n<td>ColorspaceType</td>\n<td>The colorspace to quantize in. Color reduction, by default, takes\nplace in the RGB color space.  Empirical  evidence  suggests that\ndistances in color spaces such as YUV or YIQ  correspond  to\nperceptual  color differences more closely  than  do distances in RGB\nspace. The Transparent color space behaves uniquely in that it\npreserves the matte channel of the image if it exists.</td>\n</tr>\n<tr><td>dither</td>\n<td>unsigned int</td>\n<td>Set to True (non-zero) to apply Floyd/Steinberg error diffusion to the\nimage. When the size of the color palette is less than the image\ncolors, this trades off spacial resolution for color resolution by\ndithering to achieve a similar looking image.</td>\n</tr>\n<tr><td>measure_error</td>\n<td>unsigned int</td>\n<td>Set to True (non-zero) to calculate quantization errors when\nquantizing the image.</td>\n</tr>\n<tr><td>number_colors</td>\n<td>unsigned int</td>\n<td>Specify the maximum number of colors in the output image. Must be\nequal to, or less than MaxRGB, which is determined by the value of\nQuantumLeap when GraphicsMagick was compiled.</td>\n</tr>\n<tr><td>signature</td>\n<td>unsigned long</td>\n<td>???</td>\n</tr>\n<tr><td>tree_depth</td>\n<td>unsigned int</td>\n<td>Specify the tree depth to use while quantizing. The values zero and\none support automatic tree depth determination. The tree depth may be\nforced via values ranging from two to eight. The ideal tree depth\ndepends on the characteristics of the input image, and may be\ndetermined through experimentation.</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"quantum\">\n<h1><a class=\"toc-backref\" href=\"#id40\">Quantum</a></h1>\n<p>Quantum is the base type ('unsigned char', 'unsigned short', 'unsigned\nint') used to store a pixel component (e.g. 'R' is one pixel component of\nan RGB pixel).</p>\n</div>\n<div class=\"section\" id=\"quantumtype\">\n<h1><a class=\"toc-backref\" href=\"#id41\">QuantumType</a></h1>\n<p>QuantumType is used to indicate the source or destination format of\nentire pixels, or components of pixels (&quot;Quantums&quot;) while they are being\nread, or written to, a pixel cache. The validity of these format\nspecifications depends on whether the Image pixels are in RGB format,\nRGBA format, or CMYK format. The pixel Quantum size is determined by the\nImage depth (eight or sixteen bits).</p>\n<table border=\"1\" class=\"docutils\">\n<caption>RGB(A) Image Quantums</caption>\n<colgroup>\n<col width=\"18%\" />\n<col width=\"82%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>IndexQuantum</td>\n<td>PseudoColor colormap indices (valid only for image with colormap)</td>\n</tr>\n<tr><td>RedQuantum</td>\n<td>Red pixel Quantum</td>\n</tr>\n<tr><td>GreenQuantum</td>\n<td>Green pixel Quantum</td>\n</tr>\n<tr><td>BlueQuantum</td>\n<td>Blue pixel Quantum</td>\n</tr>\n<tr><td>OpacityQuantum</td>\n<td>Opacity (Alpha) Quantum</td>\n</tr>\n</tbody>\n</table>\n<table border=\"1\" class=\"docutils\">\n<caption>CMY(K) Image Quantum</caption>\n<colgroup>\n<col width=\"40%\" />\n<col width=\"60%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>CyanQuantum</td>\n<td>Cyan pixel Quantum</td>\n</tr>\n<tr><td>MagentaQuantum</td>\n<td>Magenta pixel Quantum</td>\n</tr>\n<tr><td>YellowQuantum</td>\n<td>Yellow pixel Quantum</td>\n</tr>\n<tr><td>BlackQuantum</td>\n<td>Black pixel Quantum</td>\n</tr>\n</tbody>\n</table>\n<table border=\"1\" class=\"docutils\">\n<caption>Grayscale Image Quantums</caption>\n<colgroup>\n<col width=\"58%\" />\n<col width=\"42%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>GrayQuantum</td>\n<td>Gray pixel</td>\n</tr>\n<tr><td>GrayOpacityQuantum</td>\n<td>Pixel opacity</td>\n</tr>\n</tbody>\n</table>\n<table border=\"1\" class=\"docutils\">\n<caption>Entire Pixels (Expressed in Byte Order)</caption>\n<colgroup>\n<col width=\"28%\" />\n<col width=\"72%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>RGBQuantum</td>\n<td>RGB pixel (24 or 48 octets)</td>\n</tr>\n<tr><td>RGBAQuantum</td>\n<td>RGBA pixel (32 or 64 octets)</td>\n</tr>\n<tr><td>CMYKQuantum</td>\n<td>CMYK pixel (32 or 64 octets)</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"rectangleinfo\">\n<h1><a class=\"toc-backref\" href=\"#id42\">RectangleInfo</a></h1>\n<p>The RectangleInfo structure is used to represent positioning information\nin GraphicsMagick.</p>\n<p>The members of the RectangleInfo structure are shown in the following\ntable:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>RectangleInfo Structure Members</caption>\n<colgroup>\n<col width=\"20%\" />\n<col width=\"25%\" />\n<col width=\"55%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Member</td>\n<td>Type</td>\n<td>Description</td>\n</tr>\n<tr><td>width</td>\n<td>unsigned int</td>\n<td>Rectangle width</td>\n</tr>\n<tr><td>height</td>\n<td>unsigned int</td>\n<td>Rectangle height</td>\n</tr>\n<tr><td>x</td>\n<td>int</td>\n<td>Rectangle horizontal offset</td>\n</tr>\n<tr><td>y</td>\n<td>int</td>\n<td>Rectangle vertical offset</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"registrytype\">\n<h1><a class=\"toc-backref\" href=\"#id43\">RegistryType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  UndefinedRegistryType,\n  ImageRegistryType,\n  ImageInfoRegistryType\n} RegistryType;\n</pre>\n</div>\n<div class=\"section\" id=\"renderingintent\">\n<h1><a class=\"toc-backref\" href=\"#id44\">RenderingIntent</a></h1>\n<p>Rendering intent is a concept defined by ICC Spec ICC.1:1998-09, &quot;File\nFormat for Color Profiles&quot;. GraphicsMagick uses RenderingIntent in order\nto support ICC Color Profiles.</p>\n<p>From the specification: &quot;Rendering intent specifies the style of\nreproduction to be used during the evaluation of this profile in a\nsequence of profiles. It applies specifically to that profile in the\nsequence and not to the entire sequence. Typically, the user or\napplication will set the rendering intent dynamically at runtime or\nembedding time.&quot;</p>\n<table border=\"1\" class=\"docutils\">\n<caption>RenderingIntent</caption>\n<colgroup>\n<col width=\"17%\" />\n<col width=\"83%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>UndefinedIntent</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>SaturationIntent</td>\n<td>A rendering intent that specifies the saturation of the pixels in the image is\npreserved perhaps at the expense of accuracy in hue and lightness.</td>\n</tr>\n<tr><td>PerceptualIntent</td>\n<td>A rendering intent that specifies the full gamut of the image is compressed or\nexpanded to fill the gamut of the destination device. Gray balance is preserved\nbut colorimetric accuracy might not be preserved.</td>\n</tr>\n<tr><td>AbsoluteIntent</td>\n<td>Absolute colorimetric</td>\n</tr>\n<tr><td>RelativeIntent</td>\n<td>Relative colorimetric</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"resolutiontype\">\n<h1><a class=\"toc-backref\" href=\"#id45\">ResolutionType</a></h1>\n<p>By default, GraphicsMagick defines resolutions in pixels per inch.\nResolutionType provides a means to adjust this.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>ResolutionType</caption>\n<colgroup>\n<col width=\"30%\" />\n<col width=\"70%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Enumeration</td>\n<td>Description</td>\n</tr>\n<tr><td>UndefinedResolution</td>\n<td>Unset value.</td>\n</tr>\n<tr><td>PixelsPerInchResolution</td>\n<td>Density specifications are specified in units of pixels per inch\n(english units).</td>\n</tr>\n<tr><td>PixelsPerCentimeterResolution</td>\n<td>Density specifications are specified in units of pixels per\ncentimeter (metric units).</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"resourcetype\">\n<h1><a class=\"toc-backref\" href=\"#id46\">ResourceType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  UndefinedResource,\n  FileResource,\n  MemoryResource,\n  MapResource,\n  DiskResource\n} ResourceType;\n</pre>\n</div>\n<div class=\"section\" id=\"segmentinfo\">\n<h1><a class=\"toc-backref\" href=\"#id47\">SegmentInfo</a></h1>\n<pre class=\"literal-block\">\ntypedef struct _SegmentInfo\n{\n  double\n    x1,\n    y1,\n    x2,\n    y2;\n} SegmentInfo;\n</pre>\n</div>\n<div class=\"section\" id=\"signatureinfo\">\n<h1><a class=\"toc-backref\" href=\"#id48\">SignatureInfo</a></h1>\n<pre class=\"literal-block\">\ntypedef struct _SignatureInfo\n{\n  unsigned long\n    digest[8],\n    low_order,\n    high_order;\n\n  long\n    offset;\n\n  unsigned char\n    message[SignatureSize];\n} SignatureInfo;\n</pre>\n</div>\n<div class=\"section\" id=\"storagetype\">\n<h1><a class=\"toc-backref\" href=\"#id49\">StorageType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  CharPixel,\n  ShortPixel,\n  IntegerPixel,\n  LongPixel,\n  FloatPixel,\n  DoublePixel\n} StorageType;\n</pre>\n</div>\n<div class=\"section\" id=\"streamhandler\">\n<h1><a class=\"toc-backref\" href=\"#id50\">StreamHandler</a></h1>\n<pre class=\"literal-block\">\ntypedef unsigned int\n  (*StreamHandler)(const Image *,const void *,const size_t);\n</pre>\n</div>\n<div class=\"section\" id=\"stretchtype\">\n<h1><a class=\"toc-backref\" href=\"#id51\">StretchType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  NormalStretch,\n  UltraCondensedStretch,\n  ExtraCondensedStretch,\n  CondensedStretch,\n  SemiCondensedStretch,\n  SemiExpandedStretch,\n  ExpandedStretch,\n  ExtraExpandedStretch,\n  UltraExpandedStretch,\n  AnyStretch\n} StretchType;\n</pre>\n</div>\n<div class=\"section\" id=\"styletype\">\n<h1><a class=\"toc-backref\" href=\"#id52\">StyleType</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  NormalStyle,\n  ItalicStyle,\n  ObliqueStyle,\n  AnyStyle\n} StyleType;\n</pre>\n</div>\n<div class=\"section\" id=\"typemetric\">\n<h1><a class=\"toc-backref\" href=\"#id53\">TypeMetric</a></h1>\n<pre class=\"literal-block\">\ntypedef struct _TypeMetric\n{\n  PointInfo\n    pixels_per_em;\n\n  double\n    ascent,\n    descent,\n    width,\n    height,\n    max_advance;\n\n  SegmentInfo\n    bounds;\n\n  double\n    underline_position,\n    underline_thickness;\n} TypeMetric;\n</pre>\n</div>\n<div class=\"section\" id=\"viewinfo\">\n<h1><a class=\"toc-backref\" href=\"#id54\">ViewInfo</a></h1>\n<p>ViewInfo represents a handle to a pixel view, which represents a uniquely\nselectable rectangular region of pixels. The only limit on the number of\nviews is the amount of available memory. Each Image contains a collection\nof default views (one view per thread) so that the image may be usefully\naccessed without needing to explicitly allocate pixel views.</p>\n<pre class=\"literal-block\">\ntypedef void *ViewInfo;\n</pre>\n</div>\n<div class=\"section\" id=\"virtualpixelmethod\">\n<h1><a class=\"toc-backref\" href=\"#id55\">VirtualPixelMethod</a></h1>\n<pre class=\"literal-block\">\ntypedef enum\n{\n  UndefinedVirtualPixelMethod,\n  ConstantVirtualPixelMethod,\n  EdgeVirtualPixelMethod,\n  MirrorVirtualPixelMethod,\n  TileVirtualPixelMethod\n} VirtualPixelMethod;\n</pre>\n</div>\n<div class=\"section\" id=\"magickxresourceinfo\">\n<h1><a class=\"toc-backref\" href=\"#id56\">MagickXResourceInfo</a></h1>\n<pre class=\"literal-block\">\ntypedef struct _XResourceInfo\n{\n  XrmDatabase\n    resource_database;\n\n  ImageInfo\n    *image_info;\n\n  QuantizeInfo\n    *quantize_info;\n\n  unsigned long\n    colors;\n\n  unsigned int\n    close_server,\n    backdrop;\n\n  char\n    *background_color,\n    *border_color;\n\n  char\n    *client_name;\n\n  XColormapType\n    colormap;\n\n  unsigned int\n    border_width,\n    color_recovery,\n    confirm_exit,\n    delay;\n\n  char\n    *display_gamma;\n\n  char\n    *font,\n    *font_name[MaxNumberFonts],\n    *foreground_color;\n\n  unsigned int\n    display_warnings,\n    gamma_correct;\n\n  char\n    *icon_geometry;\n\n  unsigned int\n    iconic,\n    immutable;\n\n  char\n    *image_geometry;\n\n  char\n    *map_type,\n    *matte_color,\n    *name;\n\n  unsigned int\n    magnify,\n    pause;  char\n    *pen_colors[MaxNumberPens];\n\n  char\n    *text_font,\n    *title;\n\n  int\n    quantum;\n\n  unsigned int\n    update,\n    use_pixmap,\n    use_shared_memory;\n\n  unsigned long\n    undo_cache;\n\n  char\n    *visual_type,\n    *window_group,\n    *window_id,\n    *write_filename;\n\n  Image\n    *copy_image;\n\n  int\n    gravity;\n\n  char\n    home_directory[MaxTextExtent];\n} XResourceInfo;\n</pre>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/api/widget.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>widget</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"widget\">\n<h1 class=\"title\">widget</h1>\n<h2 class=\"subtitle\" id=\"x11-widgets\">X11 Widgets</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#xcolorbrowserwidget\" id=\"id25\">XColorBrowserWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xcommandwidget\" id=\"id26\">XCommandWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xconfirmwidget\" id=\"id27\">XConfirmWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xdialogwidget\" id=\"id28\">XDialogWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xfilebrowserwidget\" id=\"id29\">XFileBrowserWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xfontbrowserwidget\" id=\"id30\">XFontBrowserWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xinfowidget\" id=\"id31\">XInfoWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xlistbrowserwidget\" id=\"id32\">XListBrowserWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xmenuwidget\" id=\"id33\">XMenuWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xmonitorwidget\" id=\"id34\">XMonitorWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xnoticewidget\" id=\"id35\">XNoticeWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xpreferenceswidget\" id=\"id36\">XPreferencesWidget</a></li>\n<li><a class=\"reference internal\" href=\"#xtextviewwidget\" id=\"id37\">XTextViewWidget</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"xcolorbrowserwidget\">\n<h1><a class=\"toc-backref\" href=\"#id25\">XColorBrowserWidget</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickXColorBrowserWidget( Display *display, MagickXWindows *windows, const char *action,\n                                char *reply );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>Method MagickXColorBrowserWidget displays a Color Browser widget with a color\nquery to the user.  The user keys a reply and presses the Action or Cancel\nbutton to exit.  The typed text is returned as the reply function parameter.</p>\n<p>The format of the MagickXColorBrowserWidget method is:</p>\n<pre class=\"literal-block\">\nvoid MagickXColorBrowserWidget( Display *display, MagickXWindows *windows, const char *action,\n                                char *reply );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>action:</dt>\n<dd>Specifies a pointer to the action of this widget.</dd>\n<dt>reply:</dt>\n<dd>The response from the user is returned in this parameter.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xcommandwidget\">\n<h1><a class=\"toc-backref\" href=\"#id26\">XCommandWidget</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nint MagickXCommandWidget( Display *display, MagickXWindows *windows,\n                          const char ** selections, XEvent *event );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>Method MagickXCommandWidget maps a menu and returns the command pointed to by\nthe user when the button is released.</p>\n<p>The format of the MagickXCommandWidget method is:</p>\n<pre class=\"literal-block\">\nint MagickXCommandWidget( Display *display, MagickXWindows *windows,\n                          const char ** selections, XEvent *event );\n</pre>\n<dl class=\"docutils\">\n<dt>selection_number:</dt>\n<dd>Specifies the number of the selection that the\nuser choose.</dd>\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>selections:</dt>\n<dd>Specifies a pointer to one or more strings that comprise\nthe choices in the menu.</dd>\n<dt>event:</dt>\n<dd>Specifies a pointer to a X11 XEvent structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xconfirmwidget\">\n<h1><a class=\"toc-backref\" href=\"#id27\">XConfirmWidget</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nint MagickXConfirmWidget( Display *display, MagickXWindows *windows, const char *reason,\n                          const char *description );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>Method MagickXConfirmWidget displays a Confirm widget with a notice to the user.\nThe function returns -1 if Dismiss is pressed, 0 for Cancel, and 1 for\nYes.</p>\n<p>The format of the MagickXConfirmWidget method is:</p>\n<pre class=\"literal-block\">\nint MagickXConfirmWidget( Display *display, MagickXWindows *windows, const char *reason,\n                          const char *description );\n</pre>\n<dl class=\"docutils\">\n<dt>status:</dt>\n<dd>Method MagickXConfirmWidget returns True if the user presses Yes\notherwise False is returned.</dd>\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>reason:</dt>\n<dd>Specifies the message to display before terminating the\nprogram.</dd>\n<dt>description:</dt>\n<dd>Specifies any description to the message.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xdialogwidget\">\n<h1><a class=\"toc-backref\" href=\"#id28\">XDialogWidget</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nint MagickXDialogWidget( Display *display, MagickXWindows *windows, const char *action,\n                         const char *query, char *reply );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>Method MagickXDialogWidget displays a Dialog widget with a query to the user.\nThe user keys a reply and presses the Ok or Cancel button to exit.  The\ntyped text is returned as the reply function parameter.</p>\n<p>The format of the MagickXDialogWidget method is:</p>\n<pre class=\"literal-block\">\nint MagickXDialogWidget( Display *display, MagickXWindows *windows, const char *action,\n                         const char *query, char *reply );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>action:</dt>\n<dd>Specifies a pointer to the action of this widget.</dd>\n<dt>query:</dt>\n<dd>Specifies a pointer to the query to present to the user.</dd>\n<dt>reply:</dt>\n<dd>The response from the user is returned in this parameter.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xfilebrowserwidget\">\n<h1><a class=\"toc-backref\" href=\"#id29\">XFileBrowserWidget</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickXFileBrowserWidget( Display *display, MagickXWindows *windows, const char *action,\n                               char *reply );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>Method MagickXFileBrowserWidget displays a File Browser widget with a file query\nto the user.  The user keys a reply and presses the Action or Cancel button\nto exit.  The typed text is returned as the reply function parameter.</p>\n<p>The format of the MagickXFileBrowserWidget method is:</p>\n<pre class=\"literal-block\">\nvoid MagickXFileBrowserWidget( Display *display, MagickXWindows *windows, const char *action,\n                               char *reply );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>action:</dt>\n<dd>Specifies a pointer to the action of this widget.</dd>\n<dt>reply:</dt>\n<dd>The response from the user is returned in this parameter.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xfontbrowserwidget\">\n<h1><a class=\"toc-backref\" href=\"#id30\">XFontBrowserWidget</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickXFontBrowserWidget( Display *display, MagickXWindows *windows, const char *action,\n                               char *reply );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>Method MagickXFontBrowserWidget displays a Font Browser widget with a font query\nto the user.  The user keys a reply and presses the Action or Cancel button\nto exit.  The typed text is returned as the reply function parameter.</p>\n<p>The format of the MagickXFontBrowserWidget method is:</p>\n<pre class=\"literal-block\">\nvoid MagickXFontBrowserWidget( Display *display, MagickXWindows *windows, const char *action,\n                               char *reply );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>action:</dt>\n<dd>Specifies a pointer to the action of this widget.</dd>\n<dt>reply:</dt>\n<dd>The response from the user is returned in this parameter.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xinfowidget\">\n<h1><a class=\"toc-backref\" href=\"#id31\">XInfoWidget</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickXInfoWidget( Display *display, MagickXWindows *windows, const char *activity );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>Method MagickXInfoWidget displays text in the Info widget.  The purpose is to\ninform the user that what activity is currently being performed (e.g.\nreading an image, rotating an image, etc.).</p>\n<p>The format of the MagickXInfoWidget method is:</p>\n<pre class=\"literal-block\">\nvoid MagickXInfoWidget( Display *display, MagickXWindows *windows, const char *activity );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>activity:</dt>\n<dd>This character string reflects the current activity and is\ndisplayed in the Info widget.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xlistbrowserwidget\">\n<h1><a class=\"toc-backref\" href=\"#id32\">XListBrowserWidget</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickXListBrowserWidget( Display *display, MagickXWindows *windows,\n                               MagickXWindowInfo *window_info, const char ** list,\n                               const char *action, const char *query, char *reply );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>Method MagickXListBrowserWidget displays a List Browser widget with a query to\nthe user.  The user keys a reply or select a reply from the list.  Finally,\nthe user presses the Action or Cancel button to exit.  The typed text is\nreturned as the reply function parameter.</p>\n<p>The format of the MagickXListBrowserWidget method is:</p>\n<pre class=\"literal-block\">\nvoid MagickXListBrowserWidget( Display *display, MagickXWindows *windows,\n                               MagickXWindowInfo *window_info, const char ** list,\n                               const char *action, const char *query, char *reply );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>list:</dt>\n<dd>Specifies a pointer to an array of strings.  The user can\nselect from these strings as a possible reply value.</dd>\n<dt>action:</dt>\n<dd>Specifies a pointer to the action of this widget.</dd>\n<dt>query:</dt>\n<dd>Specifies a pointer to the query to present to the user.</dd>\n<dt>reply:</dt>\n<dd>The response from the user is returned in this parameter.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xmenuwidget\">\n<h1><a class=\"toc-backref\" href=\"#id33\">XMenuWidget</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nint MagickXMenuWidget( Display *display, MagickXWindows *windows, const char *title,\n                       const char ** selections, char *item );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>Method MagickXMenuWidget maps a menu and returns the command pointed to by the\nuser when the button is released.</p>\n<p>The format of the MagickXMenuWidget method is:</p>\n<pre class=\"literal-block\">\nint MagickXMenuWidget( Display *display, MagickXWindows *windows, const char *title,\n                       const char ** selections, char *item );\n</pre>\n<dl class=\"docutils\">\n<dt>selection_number:</dt>\n<dd>Specifies the number of the selection that the\nuser choose.</dd>\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>title:</dt>\n<dd>Specifies a character string that describes the menu selections.</dd>\n<dt>selections:</dt>\n<dd>Specifies a pointer to one or more strings that comprise\nthe choices in the menu.</dd>\n<dt>item:</dt>\n<dd>Specifies a character array.  The item selected from the menu\nis returned here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xmonitorwidget\">\n<h1><a class=\"toc-backref\" href=\"#id34\">XMonitorWidget</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickXMonitorWidget( Display *display, MagickXWindows *windows, const char *task,\n                           const magick_int64_t quantum, const magick_uint64_t span );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>Method MagickXMonitorWidget displays the progress a task is making in\ncompleting a task.  A span of zero toggles the active status.  An inactive\nstate disables the progress monitor.</p>\n<p>The format of the MagickXMonitorWidget method is:</p>\n<pre class=\"literal-block\">\nvoid MagickXMonitorWidget( Display *display, MagickXWindows *windows, const char *task,\n                           const magick_int64_t quantum, const magick_uint64_t span );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>task:</dt>\n<dd>Identifies the task in progress.</dd>\n<dt>quantum:</dt>\n<dd>Specifies the quantum position within the span which represents\nhow much progress has been made in completing a task.</dd>\n<dt>span:</dt>\n<dd>Specifies the span relative to completing a task.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xnoticewidget\">\n<h1><a class=\"toc-backref\" href=\"#id35\">XNoticeWidget</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickXNoticeWidget( Display *display, MagickXWindows *windows, const char *reason,\n                          const char *description );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>Method MagickXNoticeWidget displays a Notice widget with a notice to the user.\nThe function returns when the user presses the &quot;Dismiss&quot; button.</p>\n<p>The format of the MagickXNoticeWidget method is:</p>\n<pre class=\"literal-block\">\nvoid MagickXNoticeWidget( Display *display, MagickXWindows *windows, const char *reason,\n                          const char *description );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>reason:</dt>\n<dd>Specifies the message to display before terminating the\nprogram.</dd>\n<dt>description:</dt>\n<dd>Specifies any description to the message.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xpreferenceswidget\">\n<h1><a class=\"toc-backref\" href=\"#id36\">XPreferencesWidget</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickXPreferencesWidget( Display *display,\n                                       <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                                       MagickXWindows *windows );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>Method MagickXPreferencesWidget displays a Preferences widget with program\npreferences.  If the user presses the Apply button, the preferences are\nstored in a configuration file in the users' home directory.</p>\n<p>The format of the MagickXPreferencesWidget method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickXPreferencesWidget( Display *display,\n                                       <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                                       MagickXWindows *windows );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>resource_info:</dt>\n<dd>Specifies a pointer to a X11 MagickXResourceInfo structure.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"xtextviewwidget\">\n<h1><a class=\"toc-backref\" href=\"#id37\">XTextViewWidget</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickXTextViewWidget( Display *display, const <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                            MagickXWindows *windows, const unsigned int mono,\n                            const char *title, const char ** textlist );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>Method MagickXTextViewWidget displays text in a Text View widget.</p>\n<p>The format of the MagickXTextViewWidget method is:</p>\n<pre class=\"literal-block\">\nvoid MagickXTextViewWidget( Display *display, const <a class=\"reference external\" href=\"../api/types.html#magickxresourceinfo\">MagickXResourceInfo</a> *resource_info,\n                            MagickXWindows *windows, const unsigned int mono,\n                            const char *title, const char ** textlist );\n</pre>\n<dl class=\"docutils\">\n<dt>display:</dt>\n<dd>Specifies a connection to an X server;  returned from\nXOpenDisplay.</dd>\n<dt>resource_info:</dt>\n<dd>Specifies a pointer to a X11 MagickXResourceInfo structure.</dd>\n<dt>window:</dt>\n<dd>Specifies a pointer to a MagickXWindows structure.</dd>\n<dt>mono:</dt>\n<dd>Use mono-spaced font when displaying text.</dd>\n<dt>title:</dt>\n<dd>This character string is displayed at the top of the widget\nwindow.</dd>\n<dt>textlist:</dt>\n<dd>This string list is displayed within the Text View widget.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/authors.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Authors</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-authors\">\n<h1 class=\"title\">GraphicsMagick Authors</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The following people have contributed substantially to the development\nof GraphicsMagick.  Please let us know if an author is missing, or a\nsignificant contribution was made and not recorded.</p>\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#active-graphicsmagick-contributors\" id=\"id1\">Active GraphicsMagick Contributors</a></li>\n<li><a class=\"reference internal\" href=\"#former-graphicsmagick-contributors\" id=\"id2\">Former GraphicsMagick Contributors</a></li>\n<li><a class=\"reference internal\" href=\"#other-contributors-via-imagemagick\" id=\"id3\">Other Contributors (via ImageMagick)</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"active-graphicsmagick-contributors\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Active GraphicsMagick Contributors</a></h1>\n<dl class=\"docutils\">\n<dt>Bob Friesenhahn</dt>\n<dd>Principal maintainer of GraphicsMagick. Author of\nMagick++ (C++ API to ImageMagick and GraphicsMagick).\nAuthor of module loader facility, automatic file\nidentification (magic) support, Unix/Cygwin/MinGW\nconfigure/make facility, Windows setup.exe style\ninstaller, WMF renderer, C API documentation formatter,\nand the C, C++, and Perl test suites used by ImageMagick\nand GraphicsMagick.</dd>\n<dt>Jaroslav Fojtik</dt>\n<dd>Authored the ART, CUT, HRZ, JNX, MAC, MATLAB, TOPOL,\nand WPG coder modules. Improved the FITS and TXT coder\nmodules.  VisualMagick 'configure' improvements and\nbuild testing/fixes for many versions of Microsoft\nVisual Studio.</dd>\n<dt>Troy Patteson</dt>\n<dd>Contributed a several significant patches to fix image\nrotation bugs and improve image rotation performance,\nas well as an improved bi-linear interpolation\nimplementation.</dd>\n</dl>\n</div>\n<div class=\"section\" id=\"former-graphicsmagick-contributors\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Former GraphicsMagick Contributors</a></h1>\n<dl class=\"docutils\">\n<dt>Glenn Randers-Pehrson</dt>\n<dd>Contributed significantly to the utilities, including\nwriting the 'gm' utility wrapper. Authored support for\nJNG, MNG, and PNG formats. Provided significant\nsupport for the BMP format. Significant improvements\nto the documentation, including creating a\ndocumentation authoring environment based on the\n&lt;imdoc&gt; format.  Maintained the SourceForge mailing\nlists.  GraphicsMagick would not be what it is today\nwithout Glenn and he will always be remembered.</dd>\n<dt>Gregory J Wolfe</dt>\n<dd>Contributed significant improvements to the SVG\nparsing and rendering code.</dd>\n<dt>Kenneth Xu</dt>\n<dd>Contributed the implementation of 'gm batch', a simple\nbatch mode for GraphicsMagick.</dd>\n<dt>Sara Shafaei</dt>\n<dd>Contributed a number of Wand API functions as well as\nfixes for several composition operators.</dd>\n<dt>Brendan Lane</dt>\n<dd>Contributed a large number of new Photoshop\ncomposition operators and alpha-channel fixes for\nexisting ones.</dd>\n<dt>Dirk Lemstra</dt>\n<dd>Contributed improvements to the VisualMagick configure\nprogram to support configuring more build options via\nthe GUI dialogs and to deal with similarly named\nfiles.</dd>\n<dt>Roman Hiestand</dt>\n<dd>Contributed WebP coder improvements.</dd>\n<dt>Mike Chiarappa</dt>\n<dd>Created and maintains the Borland C++ Builder 6.0 build\nenvironment for GraphicsMagick.</dd>\n<dt>Daniel Kobras</dt>\n<dd>Provided many security patches and fixes from the Debian\nproject.</dd>\n<dt>William Radcliffe</dt>\n<dd>Author of the VisualMagick project configure facility for\nVisual C++. Author of FlashPix module. Author of the\nImageMagickObject COM object for Windows. Author of the\nEMF, XTRN, and META coders. Significant contributions to\nthe MSL, JPEG, TIFF, SVG, and URL coders. Authored\n&quot;process&quot; module support. Wrote the micro-timer facility\nused by 'identify'. Ported module loader support to\nWindows. Significantly improved polygon rendering\nperformance.</dd>\n<dt>Leonard Rosenthol</dt>\n<dd>Authored the 'conjure' utility and associated MSL\nexecution environment. Provided MacOS support. Authored\nthe CLIPBOARD, XCF, and PSD coders. Postscript and PDF\nexpertise. Significant drawing enhancements including\nsupport for dash patterns, linecap stroking, clipping\nmasks and a mask image.</dd>\n<dt>Lars Ruben Skyum</dt>\n<dd>Contributed the -clippath functionality, added\n-define support, improved color profile support,\nand re-wrote the PS3 coder.</dd>\n<dt>Rolf Schroedter</dt>\n<dd>Principal author of TclMagick.</dd>\n<dt>David N. Welton</dt>\n<dd>Co-author of TclMagick, particularly in the Unix environment.</dd>\n<dt>Mark Mitchell</dt>\n<dd>Contributed a new design for the web pages, including the\nformatting scripts, and converted many pages to the new\nformat.</dd>\n<dt>Richard Nolde</dt>\n<dd>Contributed code for converting between native floating\npoint types, and short (16/24) bit float types.</dd>\n<dt>Clément Follet</dt>\n<dd>Contributed Hald CLUT and ASC-CDL implementations.</dd>\n<dt>John Sergeant</dt>\n<dd>Re-wrote the HP PCL writer to work much better,\nincluding support for compression.  Implemented\nsupport for CALS type 1 format.  Re-wrote the DICOM\nreader.</dd>\n<dt>Roberto de Deus Barbosa Murta</dt>\n<dd>Contributed the adaptive threshold implementation\n(-lat), which executes in linear rather than quadratic\ntime.</dd>\n<dt>Samuel Thibault</dt>\n<dd>Contributed support for the Braille image format.</dd>\n</dl>\n</div>\n<div class=\"section\" id=\"other-contributors-via-imagemagick\">\n<h1><a class=\"toc-backref\" href=\"#id3\">Other Contributors (via ImageMagick)</a></h1>\n<dl class=\"docutils\">\n<dt>John Cristy</dt>\n<dd>Creator, principal author, and principal maintainer of\nImageMagick, from which GraphicsMagick is originally\nderived (from ImageMagick 5.5.2).  Also the author of\nthe Wand API to ImageMagick which is incorporated as\na stand-alone library by GraphicsMagick.</dd>\n<dt>Kelly Bergougnoux</dt>\n<dd>Authored the initial Cineon coder (which has since been\nreplaced).</dd>\n<dt>Christopher R. Hawks</dt>\n<dd>Authored the PALM coder.</dd>\n<dt>Francis J. Franklin</dt>\n<dd>Ported the WMF coder to the libwmf 0.2 API.</dd>\n<dt>Rick Mabry</dt>\n<dd>Contributed code to support filling drawn objects using a\npattern image.</dd>\n<dt>Nathan Brown</dt>\n<dd>Original author of the JP2 coder.</dd>\n<dt>Kyle Shorter</dt>\n<dd>Original author of PerlMagick. Original author of the\nLOCALE coder.</dd>\n<dt>Markus Friedl</dt>\n<dd>Original author of Base64 encode/decode sources.</dd>\n<dt>David Harr</dt>\n<dd>Contributed (with Leonard Rosenthol) dash pattern,\nlinecap stroking algorithm, and minor rendering\nimprovements.</dd>\n<dt>Troy Edwards</dt>\n<dd>Authored the source RPM spec file for GraphicsMagick.</dd>\n<dt>Milan Votava</dt>\n<dd>Contributed support for Wireless BitMap, used in WAP -\nWireless Access Protocol.</dd>\n<dt>Mike Edmonds</dt>\n<dd>Contributed the median filter algorithm.</dd>\n</dl>\n<hr class=\"docutils\" />\n<div class=\"line-block\">\n<div class=\"line\">Copyright © GraphicsMagick Group 2002 - 2020</div>\n</div>\n<p>This program is covered by multiple licenses, which are described in\nCopyright.txt. You should have received a copy of Copyright.txt with this\npackage; otherwise see <a class=\"reference external\" href=\"http://www.graphicsmagick.org/Copyright.html\">http://www.graphicsmagick.org/Copyright.html</a>.</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/batch.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch\"></a>gm batch\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\nbatch - execute multiple gm commands as a script\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#batch-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#batch-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#batch-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#batch-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm batch</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <strong>[</strong> <em>script</em> <strong>]</strong>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>batch</strong> executes an arbitary number of the utility commands\n(e.g. <strong>convert</strong>) in the form of a simple linear batch script in\norder to improve execution efficiency, and/or to allow use as a\nsubordinate co-process under the control of an arbitrary script or\nprogram.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p> To drive <strong>'gm batch'</strong> using a shell script (or a program\nwritten in any language), have the script/program send commands to 'gm\nbatch' via its standard input.  Specify that standard input should be\nused by using <strong>'-'</strong> as the file name.  The following example\nconverts all files matching '*.jpg' to TIFF format while rotating each\nfile by 90 degrees and stripping all embedded profiles.  The shell\nscript syntax is standard Unix shell:\n<pre>\n  for file in *.jpg\n  do\n    outfile=`basename $file .jpg`.tiff\n    echo convert -verbose \"'$file'\" -rotate 90 \\\n    +profile \"'*'\" \"'$outfile'\"\n  done | gm batch -echo on -feedback on -\n</pre>\n<p>\nWe can accomplish the same as the previous example by putting all the\ncommands in a text file and then specifying the name of the text file\nas the script to execute:\n<pre>\n  for file in *.jpg\n  do\n    outfile=`basename $file .jpg`.tiff\n    echo convert -verbose \"'$file'\" -rotate 90 \\\n    +profile \"'*'\" \"'$outfile'\"\n  done &gt; script.txt\n  gm batch -echo on -feedback on script.txt\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed from left to right and must appear before any filename argument.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -echo <i>on|off</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>command echo on or off</td></tr></table>\n<p>\nSpecify <strong>on</strong> to enable echoing commands to standard output as\nthey are read or <strong>off</strong> to disable.  The default is\n<strong>off</strong>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -escape <i>unix|windows</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Parse using unix or windows syntax</td></tr></table>\n<p>\nCommands must be parsed from the input stream and escaping needs to be\nused to protect spaces or quoting characters in the input. Specify\n<strong>unix</strong> to use unix-style command line parsing or <strong>windows</strong>\nfor Microsoft Windows command shell style parsing. The default depends\non if the software is compiled for Microsoft Windows or for a\nUnix-type system (including Cygwin on Microsoft Windows).  It is\nrecommended to use unix syntax because it is more powerful and more\nportable.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -fail <i>text</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>text to print if a command fails</td></tr></table>\n<p>\nWhen feedback is enabled, this specifies the text to print when the\ncommand fails.  The default text is <strong>FAIL</strong>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -feedback <i>on|off</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable error feedback</td></tr></table>\n<p>\nPrint text (see -pass and -fail options) feedback after each\ncommand to indicate the result, the default is <strong>off</strong>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<p>\nPrints batch command help.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pass <i>text</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>text to print if a command passes</td></tr></table>\n<p>\nWhen feedback is enabled, this specifies the text to print when the\ncommand passes.  The default text is <strong>PASS</strong>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -prompt <i>text</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Prompt text to use for command line</td></tr></table>\n<p>\nIf no filename argument was specified, a simple command prompt appears\nwhere you may enter GraphicsMagick commands.  The default prompt is\n<strong>GM&gt;</strong>.  Use this option to change the prompt to something else.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -stop-on-error <i>on|off</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify if command processing stops on error</td></tr></table>\n<p>\nNormally command processing continues if a command encounters an\nerror.  Specify <strong>-stop-on-error on</strong> to cause processing to quit\nimmediately on error.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n</td></tr></table>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/benchmark.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"benchmark\"></a>gm benchmark\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"bench-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\nbenchmark - benchmark the execution of a gm command\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"bench-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#bench-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#bench-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#bench-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#bench-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"bench-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm benchmark</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>command</em>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"bench-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>benchmark</strong> executes an arbitrary <strong>gm</strong> utility command\n(e.g. <strong>convert</strong>) for one or more loops, and/or a specified\nexecution time, and reports many execution metrics.  For builds using\nOpenMP, a mode is provided to execute the benchmark with an increasing\nnumber of threads and provide a report of speedup and multi-thread\nexecution efficiency.  If <strong>benchmark</strong> is used to execute a\ncommand without any additional benchmark options, then the command is\nrun once.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"bench-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>To obtain benchmark information for a single execution of a\ncommand:\n<pre>\n  % gm benchmark convert input.ppm -gaussian 0x1 output.ppm\n  Results: 32 threads 1 iter 6.20s user 0.41s total 2.439 iter/s 0.161 iter/cpu\n</pre>\n<p>To obtain benchmark information from 100 iterations of the\ncommand:\n<pre>\n  % gm benchmark -iterations 100 convert input.ppm -gaussian 0x1 output.ppm\n  Results: 32 threads 100 iter 625.40s user 31.74s total 3.151 iter/s 0.160 iter/cpu\n</pre>\n<p>To obtain benchmark information by iterating the command until a\nspecified amount of time (in seconds) has been consumed:\n<pre>\n  % gm benchmark -duration 30 convert input.ppm -gaussian 0x1 output.ppm\n  Results: 32 threads 91 iter 587.33s user 30.30s total 3.003 iter/s 0.155 iter/cpu\n</pre>\n<p>To obtain a full performance report with an increasing number of\nthreads (1-32 threads, stepping the number of threads by four each\ntime):\n<pre>\n  % gm benchmark -duration 3 -stepthreads 4 convert input.ppm -gaussian 0x2 output.ppm\n  Results: 1 threads 1 iter 8.84s user 8.84s total 0.113 iter/s 0.113 iter/cpu 1.00 speedup 1.000 karp-flatt\n  Results: 4 threads 2 iter 18.37s user 4.89s total 0.409 iter/s 0.109 iter/cpu 3.62 speedup 0.035 karp-flatt\n  Results: 8 threads 3 iter 29.81s user 4.09s total 0.733 iter/s 0.101 iter/cpu 6.48 speedup 0.033 karp-flatt\n  Results: 12 threads 3 iter 30.81s user 3.14s total 0.955 iter/s 0.097 iter/cpu 8.45 speedup 0.038 karp-flatt\n  Results: 16 threads 3 iter 35.02s user 3.01s total 0.997 iter/s 0.086 iter/cpu 8.81 speedup 0.054 karp-flatt\n  Results: 20 threads 4 iter 52.92s user 3.53s total 1.133 iter/s 0.076 iter/cpu 10.02 speedup 0.052 karp-flatt\n  Results: 24 threads 4 iter 60.66s user 3.39s total 1.180 iter/s 0.066 iter/cpu 10.43 speedup 0.057 karp-flatt\n  Results: 28 threads 4 iter 73.10s user 3.35s total 1.194 iter/s 0.055 iter/cpu 10.56 speedup 0.061 karp-flatt\n  Results: 32 threads 4 iter 82.10s user 3.09s total 1.294 iter/s 0.049 iter/cpu 11.44 speedup 0.058 karp-flatt\n</pre>\n<p>Here is the interpretation of the output:\n<ul>\n<li><strong>threads</strong> - number of threads used.\n<li><strong>iter</strong> - number of command iterations executed.\n<li><strong>user</strong> - total user time consumed.\n<li><strong>total</strong> - total elapsed time consumed.\n<li><strong>iter/s</strong> - number of command iterations per second.\n<li><strong>iter/cpu</strong> - amount of CPU time consumed per iteration.\n<li><strong>speedup</strong> - speedup compared with one thread.\n<li><strong>karp-flatt</strong> - Karp-Flatt measure of speedup efficiency.\n</ul>\n<p><em>Please note that the reported \"speedup\" is based on the\nexecution time of just one thread.  A preliminary warm-up pass is used\nbefore timing the first loop in order to ensure that the CPU is\nbrought out of power-saving modes and that system caches are warmed\nup.  Most modern CPUs provide a \"turbo\" mode where the CPU clock speed\nis increased (e.g. by a factor of two) when only one or two cores are\nactive.  If the CPU grows excessively hot (due to insufficient\ncooling), then it may dial back its clock rates as a form of thermal\nmanagement.  These factors result in an under-reporting of speedup\ncompared to if \"turbo\" mode was disabled and the CPU does not need to\nworry about thermal management.  The <strong>powertop</strong> utility available\nunder Linux and Solaris provides a way to observe CPU core clock rates\nwhile a benchmark is running.</em>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"bench-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p> Options are processed from left to right and must appear before\nany argument.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -duration <i>duration</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>duration to run benchmark</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Specify the number of seconds to run the benchmark. The command is\nexecuted repeatedly until the specified amount of time has\nelapsed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPrints benchmark command help.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -iterations <i>loops</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>number of command iterations</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Specify the number of iterations to run the benchmark. The command\nis executed repeatedly until the specified number of iterations has\nbeen reached.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -rawcsv\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Print results in CSV format</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Print results in a comma-separated value (CSV) format which is easy\nto parse for plotting or importing into a spreadsheet or database.\nThe values reported are <strong>threads</strong>, <strong>iterations</strong>,\n<strong>user_time</strong>, and <strong>elapsed_time</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -stepthreads <i>step</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>execute a per-thread benchmark ramp</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"> Execute a per-thread benchmark ramp, incrementing the number of\nthreads at each step by the specified value.  The maximum number of\nthreads is taken from the standard <tt>OMP_NUM_THREADS</tt>\nenvironment variable.</font></td></tr></table>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n</td></tr></table>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/benchmarks.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick vs ImageMagick Benchmarks</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-vs-imagemagick-benchmarks\">\n<h1 class=\"title\">GraphicsMagick vs ImageMagick Benchmarks</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#foreword\" id=\"id1\">Foreword</a></li>\n<li><a class=\"reference internal\" href=\"#strategy\" id=\"id2\">Strategy</a></li>\n<li><a class=\"reference internal\" href=\"#the-benchmark\" id=\"id3\">The Benchmark</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"foreword\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Foreword</a></h1>\n<p>This page used to document benchmark results which compared\nGraphicsMagick 1.3.8 performance to ImageMagick 6.5.8-10 performance.\nWe found that GraphicsMagick was usually considerably faster at\nexecuting image processing operations from the command line than\nImageMagick 6.5.8-10 was. One ImageMagick algorithm ran as much as 770\ntimes slower.  GraphicsMagick clearly ran much more efficiently under\nMicrosoft Windows.</p>\n<p>We now find that a simple head to head performance comparison between\nGraphicsMagick and recent ImageMagick is no longer possible because\nImageMagick has changed the meanings of the existing arguments.  In\nparticular, we discovered that ImageMagick filter arguments producing\nconvolution matrices are now producing lower-order convolution\nmatrices representing perhaps an order of magnitude less work given\nthe same arguments.  The resulting images are visually substantially\nless filtered.  Using the same command-line filter arguments causes\nGraphicsMagick to appear slower when it is actually doing far more\nwork than ImageMagick.</p>\n<p>Due to it not being feasable to do a head to head performance\nmeasurement between GraphicsMagick and ImageMagick, we have decided to\nnot post results at the moment.  However, the strategy and a simple\nbenchmark driver script are still provided for those who want to do\ntheir own performance comparisons between GraphicsMagick and\nImageMagick.</p>\n</div>\n<div class=\"section\" id=\"strategy\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Strategy</a></h1>\n<p>The benchmark focuses on the ability to process many medium sized\nHD-resolution (1920x1080 pixels) images. In order to prevent disk I/O\nfrom being a factor, we use a small input image and tile it to create\na larger input image via the &quot;tile:&quot; coder. The processed image is\nsent to the &quot;null:&quot; coder so that file writes to a slow disk are also\nnot a factor.  Static executables are used and executed via full paths\nin order to minimize variability from the execution environment. In\norder to obtain accurate and useful timing, we use the bash shell to\nexecute the command 40 times and see how long it takes. This is a very\nsimple benchmark approach which is quite representative of the\nperformance that the typical user observes.</p>\n<p>This new benchmark reveals the following performance criteria:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Basic execution overhead of the software.</li>\n<li>Image processing algorithmic efficiency.</li>\n<li>Efficacy of OpenMP enhancements.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"the-benchmark\">\n<h1><a class=\"toc-backref\" href=\"#id3\">The Benchmark</a></h1>\n<p>The benchmark is quite simple. It reads a list of commands to execute\nfrom a file named &quot;commands.txt&quot; and times how long it takes to\nexecute each command 40 times using GraphicsMagick and ImageMagick.</p>\n<p>Here is the simple benchmark script:</p>\n<pre class=\"literal-block\">\n#!/usr/bin/env bash\n#\n# Measure the performance between two 'convert' commands by\n# executing a subcommand through many iterations and seeing\n# the total time that it takes.\n#\n# Written by Bob Friesenhahn, October 2008\n#\n\n# GraphicsMagick\nconvert1='/usr/local/bin/gm convert'\n#convert1='/c/Program\\ Files/GraphicsMagick-1.3.8-Q16/gm.exe convert'\n\n# ImageMagick\nconvert2='/usr/local/bin/convert'\n#convert2='/c/Program\\ Files/ImageMagick-6.5.9-Q16/convert.exe'\n\n# Input file specification\ninput_image='-size 1920x1080 tile:model.pnm'\n\n# Ouput file specification\noutput_image=&quot;null:&quot;\n\n# Should not need to change any of the rest\ntypeset -i iterations=40\necho &quot;Convert-1:   ${convert1}&quot;\necho &quot;Version:     `eval &quot;${convert1}&quot; -version | head -1`&quot;\necho &quot;Convert-2:   ${convert2}&quot;\necho &quot;Version:     `eval &quot;${convert2}&quot; -version | head -1`&quot;\necho &quot;Date:        `date`&quot;\necho &quot;Host:        `uname -n`&quot;\necho &quot;OS:          `uname -s`&quot;\necho &quot;Release:     `uname -r`&quot;\necho &quot;Arch:        `uname -p`&quot;\necho &quot;Input File:  ${input_image}&quot;\necho &quot;Output File: ${output_image}&quot;\necho &quot;Threads:     ${OMP_NUM_THREADS:-1}&quot;\necho &quot;Iterations:  ${iterations}&quot;\necho &quot;========================================================================================&quot;\necho\ntypeset -i count=0 i=0\ncat commands.txt | while read subcommand\ndo\n  echo ${subcommand}\n\n  command1=&quot;${convert1} ${input_image} ${subcommand} ${output_image}&quot;\n  i=0\n  count=$iterations\n  time while ((i &lt; count))\n  do\n    eval &quot;${command1}&quot;\n    let i=i+1\n  done\n  sleep 1\n\n  command2=&quot;${convert2} ${input_image} ${subcommand} ${output_image}&quot;\n  i=0\n  count=$iterations\n  time while ((i &lt; count))\n  do\n    eval &quot;${command2}&quot;\n    let i=i+1\n  done\n\n  echo\n  sleep 1\ndone 2&gt;&amp;1\n</pre>\n<hr class=\"docutils\" />\n<div class=\"line-block\">\n<div class=\"line\">Copyright (C) 2008 - 2020 GraphicsMagick Group</div>\n</div>\n<p>This program is covered by multiple licenses, which are described in\nCopyright.txt. You should have received a copy of Copyright.txt with this\npackage; otherwise see <a class=\"reference external\" href=\"http://www.graphicsmagick.org/Copyright.html\">http://www.graphicsmagick.org/Copyright.html</a>.</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/bugs.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Bugs</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-bugs\">\n<h1 class=\"title\">GraphicsMagick Bugs</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The following bugs are known to exist in GraphicsMagick. Please report\nany additional bugs to the GraphicsMagick <a class=\"reference external\" href=\"https://sourceforge.net/p/graphicsmagick/_list/tickets\">bug tracker</a> at SourceForge.</p>\n<blockquote>\n<ul class=\"simple\">\n<li>BMP reader is not working for some obscure low-color packed files.</li>\n<li>DPX reader/writer does not properly handle subformats where row\nsamples spill over the storage word boundary. This means that\nsingle-channel/grayscale 10-bit DPX files will only work for widths\nevenly divisible by three. (SF 1533184)</li>\n<li>The PSD reader is disabled by default because it does not work well\nenough and several man-years worth of dedicated volunteer time is\nrequired to make it work properly.</li>\n<li>Scitex reader is not working for some files.</li>\n<li>SVG writer works only if you are particularly luckly and so it is\nnot included in the build by default..</li>\n<li>SVG reader mishandles basic units and many other syntax elements (SF\n1231547, 1298606).</li>\n</ul>\n</blockquote>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/color.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<html>\n<head>\n\t<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">\n\t<title>GraphicsMagick Color Selections</title>\n\t<meta name=\"description\" content=\"GraphicsMagick is a robust collection of tools\nand libraries to read, write, and manipulate an image in any of the more\npopular image formats including GIF, JPEG, PNG, PDF, and Photo CD.  With\nGraphicsMagick you can create GIFs dynamically making it suitable for Web\napplications.  You can also resize, rotate, sharpen, color reduce, or add\nspecial effects to an image and save your completed work in the same or\ndiffering image format.\">\n    <meta name=\"keywords\" content=\"GraphicsMagick, Image Magick, Image\nMagic, PerlMagick, Perl Magick, Perl Magic, CineMagick, PixelMagick,\nPixel Magic, WebMagick, Web Magic, visualization, image processing,\nsoftware development, simulation, image, software, AniMagick, Animagic,\nMagick++\">\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n\t<style>\n\t<!--\n        body {font-family: sans-serif;}\n        table.named-colors th, table.named-colors td { padding : .5ex; }\n        table.named-colors th { background-color : #E0E0E0; }\n        table.named-colors td.dark { text-align : center; color : white; }\n        table.named-colors td.light { text-align : center; color : black; }\n\t-->\n\t</style>\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n\n<div class=\"document\" id=\"graphicsmagick-programming-interfaces\">\n<hr>\n<p>Here are some example color selections to choose from or define\nyour own. GraphicsMagick understands color names or hex values (.e.g.\nwhite or #ffffff). \n</p>\n<table class=\"named-colors\">\n<colgroup>\n<col width=\"20%\" />\n<col width=\"40%\" />\n<col width=\"20%\" />\n<col width=\"20%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Name</th>\n<th class=\"head\">Color</th>\n<th class=\"head\">RGB</th>\n<th class=\"head\">Hex</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n\n<tr><td>aliceblue</td><td class=\"light\" bgcolor=\"#f0f8ff\">aliceblue</td><td>240, 248, 255</td><td>#f0f8ff</td></tr>\n<tr><td>antiquewhite</td><td class=\"light\" bgcolor=\"#faebd7\">antiquewhite</td><td>250, 235, 215</td><td>#faebd7</td></tr>\n<tr><td>aqua</td><td class=\"light\" bgcolor=\"#00ffff\">aqua</td><td>0, 255, 255</td><td>#00ffff</td></tr>\n<tr><td>aquamarine</td><td class=\"light\" bgcolor=\"#7fffd4\">aquamarine</td><td>127, 255, 212</td><td>#7fffd4</td></tr>\n<tr><td>azure</td><td class=\"light\" bgcolor=\"#f0ffff\">azure</td><td>240, 255, 255</td><td>#f0ffff</td></tr>\n<tr><td>beige</td><td class=\"light\" bgcolor=\"#f5f5dc\">beige</td><td>245, 245, 220</td><td>#f5f5dc</td></tr>\n<tr><td>bisque</td><td class=\"light\" bgcolor=\"#ffe4c4\">bisque</td><td>255, 228, 196</td><td>#ffe4c4</td></tr>\n<tr><td>black</td><td class=\"dark\" bgcolor=\"#000000\">black</td><td>0, 0, 0</td><td>#000000</td></tr>\n<tr><td>blanchedalmond</td><td class=\"light\" bgcolor=\"#ffebcd\">blanchedalmond</td><td>255, 235, 205</td><td>#ffebcd</td></tr>\n<tr><td>blue</td><td class=\"dark\" bgcolor=\"#0000ff\">blue</td><td>0, 0, 255</td><td>#0000ff</td></tr>\n<tr><td>blueviolet</td><td class=\"light\" bgcolor=\"#8a2be2\">blueviolet</td><td>138, 43, 226</td><td>#8a2be2</td></tr>\n<tr><td>brown</td><td class=\"dark\" bgcolor=\"#a52a2a\">brown</td><td>165, 42, 42</td><td>#a52a2a</td></tr>\n<tr><td>burlywood</td><td class=\"light\" bgcolor=\"#deb887\">burlywood</td><td>222, 184, 135</td><td>#deb887</td></tr>\n<tr><td>cadetblue</td><td class=\"light\" bgcolor=\"#5f9ea0\">cadetblue</td><td>95, 158, 160</td><td>#5f9ea0</td></tr>\n<tr><td>chartreuse</td><td class=\"light\" bgcolor=\"#7fff00\">chartreuse</td><td>127, 255, 0</td><td>#7fff00</td></tr>\n<tr><td>chocolate</td><td class=\"light\" bgcolor=\"#d2691e\">chocolate</td><td>210, 105, 30</td><td>#d2691e</td></tr>\n<tr><td>coral</td><td class=\"light\" bgcolor=\"#ff7f50\">coral</td><td>255, 127, 80</td><td>#ff7f50</td></tr>\n<tr><td>cornflowerblue</td><td class=\"light\" bgcolor=\"#6495ed\">cornflowerblue</td><td>100, 149, 237</td><td>#6495ed</td></tr>\n<tr><td>cornsilk</td><td class=\"light\" bgcolor=\"#fff8dc\">cornsilk</td><td>255, 248, 220</td><td>#fff8dc</td></tr>\n<tr><td>crimson</td><td class=\"dark\" bgcolor=\"#dc143c\">crimson</td><td>220, 20, 60</td><td>#dc143c</td></tr>\n<tr><td>cyan</td><td class=\"light\" bgcolor=\"#00ffff\">cyan</td><td>0, 255, 255</td><td>#00ffff</td></tr>\n<tr><td>darkblue</td><td class=\"dark\" bgcolor=\"#00008b\">darkblue</td><td>0, 0, 139</td><td>#00008b</td></tr>\n<tr><td>darkcyan</td><td class=\"dark\" bgcolor=\"#008b8b\">darkcyan</td><td>0, 139, 139</td><td>#008b8b</td></tr>\n<tr><td>darkgoldenrod</td><td class=\"light\" bgcolor=\"#b8860b\">darkgoldenrod</td><td>184, 134, 11</td><td>#b8860b</td></tr>\n<tr><td>darkgray</td><td class=\"light\" bgcolor=\"#a9a9a9\">darkgray</td><td>169, 169, 169</td><td>#a9a9a9</td></tr>\n<tr><td>darkgreen</td><td class=\"dark\" bgcolor=\"#006400\">darkgreen</td><td>0, 100, 0</td><td>#006400</td></tr>\n<tr><td>darkgrey</td><td class=\"light\" bgcolor=\"#a9a9a9\">darkgrey</td><td>169, 169, 169</td><td>#a9a9a9</td></tr>\n<tr><td>darkkhaki</td><td class=\"light\" bgcolor=\"#bdb76b\">darkkhaki</td><td>189, 183, 107</td><td>#bdb76b</td></tr>\n<tr><td>darkmagenta</td><td class=\"dark\" bgcolor=\"#8b008b\">darkmagenta</td><td>139, 0, 139</td><td>#8b008b</td></tr>\n<tr><td>darkolivegreen</td><td class=\"dark\" bgcolor=\"#556b2f\">darkolivegreen</td><td>85, 107, 47</td><td>#556b2f</td></tr>\n<tr><td>darkorange</td><td class=\"light\" bgcolor=\"#ff8c00\">darkorange</td><td>255, 140, 0</td><td>#ff8c00</td></tr>\n<tr><td>darkorchid</td><td class=\"light\" bgcolor=\"#9932cc\">darkorchid</td><td>153, 50, 204</td><td>#9932cc</td></tr>\n<tr><td>darkred</td><td class=\"dark\" bgcolor=\"#8b0000\">darkred</td><td>139, 0, 0</td><td>#8b0000</td></tr>\n<tr><td>darksalmon</td><td class=\"light\" bgcolor=\"#e9967a\">darksalmon</td><td>233, 150, 122</td><td>#e9967a</td></tr>\n<tr><td>darkseagreen</td><td class=\"light\" bgcolor=\"#8fbc8f\">darkseagreen</td><td>143, 188, 143</td><td>#8fbc8f</td></tr>\n<tr><td>darkslateblue</td><td class=\"dark\" bgcolor=\"#483d8b\">darkslateblue</td><td>72, 61, 139</td><td>#483d8b</td></tr>\n<tr><td>darkslategray</td><td class=\"dark\" bgcolor=\"#2f4f4f\">darkslategray</td><td>47, 79, 79</td><td>#2f4f4f</td></tr>\n<tr><td>darkslategrey</td><td class=\"dark\" bgcolor=\"#2f4f4f\">darkslategrey</td><td>47, 79, 79</td><td>#2f4f4f</td></tr>\n<tr><td>darkturquoise</td><td class=\"light\" bgcolor=\"#00ced1\">darkturquoise</td><td>0, 206, 209</td><td>#00ced1</td></tr>\n<tr><td>darkviolet</td><td class=\"light\" bgcolor=\"#9400d3\">darkviolet</td><td>148, 0, 211</td><td>#9400d3</td></tr>\n<tr><td>deeppink</td><td class=\"light\" bgcolor=\"#ff1493\">deeppink</td><td>255, 20, 147</td><td>#ff1493</td></tr>\n<tr><td>deepskyblue</td><td class=\"light\" bgcolor=\"#00bfff\">deepskyblue</td><td>0, 191, 255</td><td>#00bfff</td></tr>\n<tr><td>dimgray</td><td class=\"dark\" bgcolor=\"#696969\">dimgray</td><td>105, 105, 105</td><td>#696969</td></tr>\n<tr><td>dimgrey</td><td class=\"dark\" bgcolor=\"#696969\">dimgrey</td><td>105, 105, 105</td><td>#696969</td></tr>\n<tr><td>dodgerblue</td><td class=\"light\" bgcolor=\"#1e90ff\">dodgerblue</td><td>30, 144, 255</td><td>#1e90ff</td></tr>\n<tr><td>firebrick</td><td class=\"dark\" bgcolor=\"#b22222\">firebrick</td><td>178, 34, 34</td><td>#b22222</td></tr>\n<tr><td>floralwhite</td><td class=\"light\" bgcolor=\"#fffaf0\">floralwhite</td><td>255, 250, 240</td><td>#fffaf0</td></tr>\n<tr><td>forestgreen</td><td class=\"dark\" bgcolor=\"#228b22\">forestgreen</td><td>34, 139, 34</td><td>#228b22</td></tr>\n<tr><td>fractal</td><td class=\"light\" bgcolor=\"#808080\">fractal</td><td>128, 128, 128</td><td>#808080</td></tr>\n<tr><td>fuchsia</td><td class=\"light\" bgcolor=\"#ff00ff\">fuchsia</td><td>255, 0, 255</td><td>#ff00ff</td></tr>\n<tr><td>gainsboro</td><td class=\"light\" bgcolor=\"#dcdcdc\">gainsboro</td><td>220, 220, 220</td><td>#dcdcdc</td></tr>\n<tr><td>ghostwhite</td><td class=\"light\" bgcolor=\"#f8f8ff\">ghostwhite</td><td>248, 248, 255</td><td>#f8f8ff</td></tr>\n<tr><td>gold</td><td class=\"light\" bgcolor=\"#ffd700\">gold</td><td>255, 215, 0</td><td>#ffd700</td></tr>\n<tr><td>goldenrod</td><td class=\"light\" bgcolor=\"#daa520\">goldenrod</td><td>218, 165, 32</td><td>#daa520</td></tr>\n<tr><td>gray0</td><td class=\"dark\" bgcolor=\"#000000\">gray0</td><td>0, 0, 0</td><td>#000000</td></tr>\n<tr><td>gray1</td><td class=\"dark\" bgcolor=\"#030303\">gray1</td><td>3, 3, 3</td><td>#030303</td></tr>\n<tr><td>gray2</td><td class=\"dark\" bgcolor=\"#050505\">gray2</td><td>5, 5, 5</td><td>#050505</td></tr>\n<tr><td>gray3</td><td class=\"dark\" bgcolor=\"#080808\">gray3</td><td>8, 8, 8</td><td>#080808</td></tr>\n<tr><td>gray4</td><td class=\"dark\" bgcolor=\"#0a0a0a\">gray4</td><td>10, 10, 10</td><td>#0a0a0a</td></tr>\n<tr><td>gray5</td><td class=\"dark\" bgcolor=\"#0d0d0d\">gray5</td><td>13, 13, 13</td><td>#0d0d0d</td></tr>\n<tr><td>gray6</td><td class=\"dark\" bgcolor=\"#0f0f0f\">gray6</td><td>15, 15, 15</td><td>#0f0f0f</td></tr>\n<tr><td>gray7</td><td class=\"dark\" bgcolor=\"#121212\">gray7</td><td>18, 18, 18</td><td>#121212</td></tr>\n<tr><td>gray8</td><td class=\"dark\" bgcolor=\"#141414\">gray8</td><td>20, 20, 20</td><td>#141414</td></tr>\n<tr><td>gray9</td><td class=\"dark\" bgcolor=\"#171717\">gray9</td><td>23, 23, 23</td><td>#171717</td></tr>\n<tr><td>gray10</td><td class=\"dark\" bgcolor=\"#1a1a1a\">gray10</td><td>26, 26, 26</td><td>#1a1a1a</td></tr>\n<tr><td>gray11</td><td class=\"dark\" bgcolor=\"#1c1c1c\">gray11</td><td>28, 28, 28</td><td>#1c1c1c</td></tr>\n<tr><td>gray12</td><td class=\"dark\" bgcolor=\"#1f1f1f\">gray12</td><td>31, 31, 31</td><td>#1f1f1f</td></tr>\n<tr><td>gray13</td><td class=\"dark\" bgcolor=\"#212121\">gray13</td><td>33, 33, 33</td><td>#212121</td></tr>\n<tr><td>gray14</td><td class=\"dark\" bgcolor=\"#242424\">gray14</td><td>36, 36, 36</td><td>#242424</td></tr>\n<tr><td>gray15</td><td class=\"dark\" bgcolor=\"#262626\">gray15</td><td>38, 38, 38</td><td>#262626</td></tr>\n<tr><td>gray16</td><td class=\"dark\" bgcolor=\"#292929\">gray16</td><td>41, 41, 41</td><td>#292929</td></tr>\n<tr><td>gray17</td><td class=\"dark\" bgcolor=\"#2b2b2b\">gray17</td><td>43, 43, 43</td><td>#2b2b2b</td></tr>\n<tr><td>gray18</td><td class=\"dark\" bgcolor=\"#2e2e2e\">gray18</td><td>46, 46, 46</td><td>#2e2e2e</td></tr>\n<tr><td>gray19</td><td class=\"dark\" bgcolor=\"#303030\">gray19</td><td>48, 48, 48</td><td>#303030</td></tr>\n<tr><td>gray20</td><td class=\"dark\" bgcolor=\"#333333\">gray20</td><td>51, 51, 51</td><td>#333333</td></tr>\n<tr><td>gray21</td><td class=\"dark\" bgcolor=\"#363636\">gray21</td><td>54, 54, 54</td><td>#363636</td></tr>\n<tr><td>gray22</td><td class=\"dark\" bgcolor=\"#383838\">gray22</td><td>56, 56, 56</td><td>#383838</td></tr>\n<tr><td>gray23</td><td class=\"dark\" bgcolor=\"#3b3b3b\">gray23</td><td>59, 59, 59</td><td>#3b3b3b</td></tr>\n<tr><td>gray24</td><td class=\"dark\" bgcolor=\"#3d3d3d\">gray24</td><td>61, 61, 61</td><td>#3d3d3d</td></tr>\n<tr><td>gray25</td><td class=\"dark\" bgcolor=\"#404040\">gray25</td><td>64, 64, 64</td><td>#404040</td></tr>\n<tr><td>gray26</td><td class=\"dark\" bgcolor=\"#424242\">gray26</td><td>66, 66, 66</td><td>#424242</td></tr>\n<tr><td>gray27</td><td class=\"dark\" bgcolor=\"#454545\">gray27</td><td>69, 69, 69</td><td>#454545</td></tr>\n<tr><td>gray28</td><td class=\"dark\" bgcolor=\"#474747\">gray28</td><td>71, 71, 71</td><td>#474747</td></tr>\n<tr><td>gray29</td><td class=\"dark\" bgcolor=\"#4a4a4a\">gray29</td><td>74, 74, 74</td><td>#4a4a4a</td></tr>\n<tr><td>gray30</td><td class=\"dark\" bgcolor=\"#4d4d4d\">gray30</td><td>77, 77, 77</td><td>#4d4d4d</td></tr>\n<tr><td>gray31</td><td class=\"dark\" bgcolor=\"#4f4f4f\">gray31</td><td>79, 79, 79</td><td>#4f4f4f</td></tr>\n<tr><td>gray32</td><td class=\"dark\" bgcolor=\"#525252\">gray32</td><td>82, 82, 82</td><td>#525252</td></tr>\n<tr><td>gray33</td><td class=\"dark\" bgcolor=\"#545454\">gray33</td><td>84, 84, 84</td><td>#545454</td></tr>\n<tr><td>gray34</td><td class=\"dark\" bgcolor=\"#575757\">gray34</td><td>87, 87, 87</td><td>#575757</td></tr>\n<tr><td>gray35</td><td class=\"dark\" bgcolor=\"#595959\">gray35</td><td>89, 89, 89</td><td>#595959</td></tr>\n<tr><td>gray36</td><td class=\"dark\" bgcolor=\"#5c5c5c\">gray36</td><td>92, 92, 92</td><td>#5c5c5c</td></tr>\n<tr><td>gray37</td><td class=\"dark\" bgcolor=\"#5e5e5e\">gray37</td><td>94, 94, 94</td><td>#5e5e5e</td></tr>\n<tr><td>gray38</td><td class=\"dark\" bgcolor=\"#616161\">gray38</td><td>97, 97, 97</td><td>#616161</td></tr>\n<tr><td>gray39</td><td class=\"dark\" bgcolor=\"#636363\">gray39</td><td>99, 99, 99</td><td>#636363</td></tr>\n<tr><td>gray40</td><td class=\"dark\" bgcolor=\"#666666\">gray40</td><td>102, 102, 102</td><td>#666666</td></tr>\n<tr><td>gray41</td><td class=\"dark\" bgcolor=\"#696969\">gray41</td><td>105, 105, 105</td><td>#696969</td></tr>\n<tr><td>gray42</td><td class=\"light\" bgcolor=\"#6b6b6b\">gray42</td><td>107, 107, 107</td><td>#6b6b6b</td></tr>\n<tr><td>gray43</td><td class=\"light\" bgcolor=\"#6e6e6e\">gray43</td><td>110, 110, 110</td><td>#6e6e6e</td></tr>\n<tr><td>gray44</td><td class=\"light\" bgcolor=\"#707070\">gray44</td><td>112, 112, 112</td><td>#707070</td></tr>\n<tr><td>gray45</td><td class=\"light\" bgcolor=\"#737373\">gray45</td><td>115, 115, 115</td><td>#737373</td></tr>\n<tr><td>gray46</td><td class=\"light\" bgcolor=\"#757575\">gray46</td><td>117, 117, 117</td><td>#757575</td></tr>\n<tr><td>gray47</td><td class=\"light\" bgcolor=\"#787878\">gray47</td><td>120, 120, 120</td><td>#787878</td></tr>\n<tr><td>gray48</td><td class=\"light\" bgcolor=\"#7a7a7a\">gray48</td><td>122, 122, 122</td><td>#7a7a7a</td></tr>\n<tr><td>gray49</td><td class=\"light\" bgcolor=\"#7d7d7d\">gray49</td><td>125, 125, 125</td><td>#7d7d7d</td></tr>\n<tr><td>gray50</td><td class=\"light\" bgcolor=\"#7f7f7f\">gray50</td><td>127, 127, 127</td><td>#7f7f7f</td></tr>\n<tr><td>gray51</td><td class=\"light\" bgcolor=\"#828282\">gray51</td><td>130, 130, 130</td><td>#828282</td></tr>\n<tr><td>gray52</td><td class=\"light\" bgcolor=\"#858585\">gray52</td><td>133, 133, 133</td><td>#858585</td></tr>\n<tr><td>gray53</td><td class=\"light\" bgcolor=\"#878787\">gray53</td><td>135, 135, 135</td><td>#878787</td></tr>\n<tr><td>gray54</td><td class=\"light\" bgcolor=\"#8a8a8a\">gray54</td><td>138, 138, 138</td><td>#8a8a8a</td></tr>\n<tr><td>gray55</td><td class=\"light\" bgcolor=\"#8c8c8c\">gray55</td><td>140, 140, 140</td><td>#8c8c8c</td></tr>\n<tr><td>gray56</td><td class=\"light\" bgcolor=\"#8f8f8f\">gray56</td><td>143, 143, 143</td><td>#8f8f8f</td></tr>\n<tr><td>gray57</td><td class=\"light\" bgcolor=\"#919191\">gray57</td><td>145, 145, 145</td><td>#919191</td></tr>\n<tr><td>gray58</td><td class=\"light\" bgcolor=\"#949494\">gray58</td><td>148, 148, 148</td><td>#949494</td></tr>\n<tr><td>gray59</td><td class=\"light\" bgcolor=\"#969696\">gray59</td><td>150, 150, 150</td><td>#969696</td></tr>\n<tr><td>gray60</td><td class=\"light\" bgcolor=\"#999999\">gray60</td><td>153, 153, 153</td><td>#999999</td></tr>\n<tr><td>gray61</td><td class=\"light\" bgcolor=\"#9c9c9c\">gray61</td><td>156, 156, 156</td><td>#9c9c9c</td></tr>\n<tr><td>gray62</td><td class=\"light\" bgcolor=\"#9e9e9e\">gray62</td><td>158, 158, 158</td><td>#9e9e9e</td></tr>\n<tr><td>gray63</td><td class=\"light\" bgcolor=\"#a1a1a1\">gray63</td><td>161, 161, 161</td><td>#a1a1a1</td></tr>\n<tr><td>gray64</td><td class=\"light\" bgcolor=\"#a3a3a3\">gray64</td><td>163, 163, 163</td><td>#a3a3a3</td></tr>\n<tr><td>gray65</td><td class=\"light\" bgcolor=\"#a6a6a6\">gray65</td><td>166, 166, 166</td><td>#a6a6a6</td></tr>\n<tr><td>gray66</td><td class=\"light\" bgcolor=\"#a8a8a8\">gray66</td><td>168, 168, 168</td><td>#a8a8a8</td></tr>\n<tr><td>gray67</td><td class=\"light\" bgcolor=\"#ababab\">gray67</td><td>171, 171, 171</td><td>#ababab</td></tr>\n<tr><td>gray68</td><td class=\"light\" bgcolor=\"#adadad\">gray68</td><td>173, 173, 173</td><td>#adadad</td></tr>\n<tr><td>gray69</td><td class=\"light\" bgcolor=\"#b0b0b0\">gray69</td><td>176, 176, 176</td><td>#b0b0b0</td></tr>\n<tr><td>gray70</td><td class=\"light\" bgcolor=\"#b3b3b3\">gray70</td><td>179, 179, 179</td><td>#b3b3b3</td></tr>\n<tr><td>gray71</td><td class=\"light\" bgcolor=\"#b5b5b5\">gray71</td><td>181, 181, 181</td><td>#b5b5b5</td></tr>\n<tr><td>gray72</td><td class=\"light\" bgcolor=\"#b8b8b8\">gray72</td><td>184, 184, 184</td><td>#b8b8b8</td></tr>\n<tr><td>gray73</td><td class=\"light\" bgcolor=\"#bababa\">gray73</td><td>186, 186, 186</td><td>#bababa</td></tr>\n<tr><td>gray74</td><td class=\"light\" bgcolor=\"#bdbdbd\">gray74</td><td>189, 189, 189</td><td>#bdbdbd</td></tr>\n<tr><td>gray75</td><td class=\"light\" bgcolor=\"#bfbfbf\">gray75</td><td>191, 191, 191</td><td>#bfbfbf</td></tr>\n<tr><td>gray76</td><td class=\"light\" bgcolor=\"#c2c2c2\">gray76</td><td>194, 194, 194</td><td>#c2c2c2</td></tr>\n<tr><td>gray77</td><td class=\"light\" bgcolor=\"#c4c4c4\">gray77</td><td>196, 196, 196</td><td>#c4c4c4</td></tr>\n<tr><td>gray78</td><td class=\"light\" bgcolor=\"#c7c7c7\">gray78</td><td>199, 199, 199</td><td>#c7c7c7</td></tr>\n<tr><td>gray79</td><td class=\"light\" bgcolor=\"#c9c9c9\">gray79</td><td>201, 201, 201</td><td>#c9c9c9</td></tr>\n<tr><td>gray80</td><td class=\"light\" bgcolor=\"#cccccc\">gray80</td><td>204, 204, 204</td><td>#cccccc</td></tr>\n<tr><td>gray81</td><td class=\"light\" bgcolor=\"#cfcfcf\">gray81</td><td>207, 207, 207</td><td>#cfcfcf</td></tr>\n<tr><td>gray82</td><td class=\"light\" bgcolor=\"#d1d1d1\">gray82</td><td>209, 209, 209</td><td>#d1d1d1</td></tr>\n<tr><td>gray83</td><td class=\"light\" bgcolor=\"#d4d4d4\">gray83</td><td>212, 212, 212</td><td>#d4d4d4</td></tr>\n<tr><td>gray84</td><td class=\"light\" bgcolor=\"#d6d6d6\">gray84</td><td>214, 214, 214</td><td>#d6d6d6</td></tr>\n<tr><td>gray85</td><td class=\"light\" bgcolor=\"#d9d9d9\">gray85</td><td>217, 217, 217</td><td>#d9d9d9</td></tr>\n<tr><td>gray86</td><td class=\"light\" bgcolor=\"#dbdbdb\">gray86</td><td>219, 219, 219</td><td>#dbdbdb</td></tr>\n<tr><td>gray87</td><td class=\"light\" bgcolor=\"#dedede\">gray87</td><td>222, 222, 222</td><td>#dedede</td></tr>\n<tr><td>gray88</td><td class=\"light\" bgcolor=\"#e0e0e0\">gray88</td><td>224, 224, 224</td><td>#e0e0e0</td></tr>\n<tr><td>gray89</td><td class=\"light\" bgcolor=\"#e3e3e3\">gray89</td><td>227, 227, 227</td><td>#e3e3e3</td></tr>\n<tr><td>gray90</td><td class=\"light\" bgcolor=\"#e5e5e5\">gray90</td><td>229, 229, 229</td><td>#e5e5e5</td></tr>\n<tr><td>gray91</td><td class=\"light\" bgcolor=\"#e8e8e8\">gray91</td><td>232, 232, 232</td><td>#e8e8e8</td></tr>\n<tr><td>gray92</td><td class=\"light\" bgcolor=\"#ebebeb\">gray92</td><td>235, 235, 235</td><td>#ebebeb</td></tr>\n<tr><td>gray93</td><td class=\"light\" bgcolor=\"#ededed\">gray93</td><td>237, 237, 237</td><td>#ededed</td></tr>\n<tr><td>gray94</td><td class=\"light\" bgcolor=\"#f0f0f0\">gray94</td><td>240, 240, 240</td><td>#f0f0f0</td></tr>\n<tr><td>gray95</td><td class=\"light\" bgcolor=\"#f2f2f2\">gray95</td><td>242, 242, 242</td><td>#f2f2f2</td></tr>\n<tr><td>gray96</td><td class=\"light\" bgcolor=\"#f5f5f5\">gray96</td><td>245, 245, 245</td><td>#f5f5f5</td></tr>\n<tr><td>gray97</td><td class=\"light\" bgcolor=\"#f7f7f7\">gray97</td><td>247, 247, 247</td><td>#f7f7f7</td></tr>\n<tr><td>gray98</td><td class=\"light\" bgcolor=\"#fafafa\">gray98</td><td>250, 250, 250</td><td>#fafafa</td></tr>\n<tr><td>gray99</td><td class=\"light\" bgcolor=\"#fcfcfc\">gray99</td><td>252, 252, 252</td><td>#fcfcfc</td></tr>\n<tr><td>gray100</td><td class=\"light\" bgcolor=\"#ffffff\">gray100</td><td>255, 255, 255</td><td>#ffffff</td></tr>\n<tr><td>gray</td><td class=\"light\" bgcolor=\"#7e7e7e\">gray</td><td>126, 126, 126</td><td>#7e7e7e</td></tr>\n<tr><td>green</td><td class=\"dark\" bgcolor=\"#008000\">green</td><td>0, 128, 0</td><td>#008000</td></tr>\n<tr><td>greenyellow</td><td class=\"light\" bgcolor=\"#adff2f\">greenyellow</td><td>173, 255, 47</td><td>#adff2f</td></tr>\n<tr><td>grey</td><td class=\"light\" bgcolor=\"#808080\">grey</td><td>128, 128, 128</td><td>#808080</td></tr>\n<tr><td>honeydew</td><td class=\"light\" bgcolor=\"#f0fff0\">honeydew</td><td>240, 255, 240</td><td>#f0fff0</td></tr>\n<tr><td>hotpink</td><td class=\"light\" bgcolor=\"#ff69b4\">hotpink</td><td>255, 105, 180</td><td>#ff69b4</td></tr>\n<tr><td>indianred</td><td class=\"light\" bgcolor=\"#cd5c5c\">indianred</td><td>205, 92, 92</td><td>#cd5c5c</td></tr>\n<tr><td>indigo</td><td class=\"dark\" bgcolor=\"#4b0082\">indigo</td><td>75, 0, 130</td><td>#4b0082</td></tr>\n<tr><td>ivory</td><td class=\"light\" bgcolor=\"#fffff0\">ivory</td><td>255, 255, 240</td><td>#fffff0</td></tr>\n<tr><td>khaki</td><td class=\"light\" bgcolor=\"#f0e68c\">khaki</td><td>240, 230, 140</td><td>#f0e68c</td></tr>\n<tr><td>lavender</td><td class=\"light\" bgcolor=\"#e6e6fa\">lavender</td><td>230, 230, 250</td><td>#e6e6fa</td></tr>\n<tr><td>lavenderblush</td><td class=\"light\" bgcolor=\"#fff0f5\">lavenderblush</td><td>255, 240, 245</td><td>#fff0f5</td></tr>\n<tr><td>lawngreen</td><td class=\"light\" bgcolor=\"#7cfc00\">lawngreen</td><td>124, 252, 0</td><td>#7cfc00</td></tr>\n<tr><td>lemonchiffon</td><td class=\"light\" bgcolor=\"#fffacd\">lemonchiffon</td><td>255, 250, 205</td><td>#fffacd</td></tr>\n<tr><td>lightblue</td><td class=\"light\" bgcolor=\"#add8e6\">lightblue</td><td>173, 216, 230</td><td>#add8e6</td></tr>\n<tr><td>lightcoral</td><td class=\"light\" bgcolor=\"#f08080\">lightcoral</td><td>240, 128, 128</td><td>#f08080</td></tr>\n<tr><td>lightcyan</td><td class=\"light\" bgcolor=\"#e0ffff\">lightcyan</td><td>224, 255, 255</td><td>#e0ffff</td></tr>\n<tr><td>lightgoldenrodyellow</td><td class=\"light\" bgcolor=\"#fafad2\">lightgoldenrodyellow</td><td>250, 250, 210</td><td>#fafad2</td></tr>\n<tr><td>lightgray</td><td class=\"light\" bgcolor=\"#d3d3d3\">lightgray</td><td>211, 211, 211</td><td>#d3d3d3</td></tr>\n<tr><td>lightgreen</td><td class=\"light\" bgcolor=\"#90ee90\">lightgreen</td><td>144, 238, 144</td><td>#90ee90</td></tr>\n<tr><td>lightgrey</td><td class=\"light\" bgcolor=\"#d3d3d3\">lightgrey</td><td>211, 211, 211</td><td>#d3d3d3</td></tr>\n<tr><td>lightpink</td><td class=\"light\" bgcolor=\"#ffb6c1\">lightpink</td><td>255, 182, 193</td><td>#ffb6c1</td></tr>\n<tr><td>lightsalmon</td><td class=\"light\" bgcolor=\"#ffa07a\">lightsalmon</td><td>255, 160, 122</td><td>#ffa07a</td></tr>\n<tr><td>lightseagreen</td><td class=\"light\" bgcolor=\"#20b2aa\">lightseagreen</td><td>32, 178, 170</td><td>#20b2aa</td></tr>\n<tr><td>lightskyblue</td><td class=\"light\" bgcolor=\"#87cefa\">lightskyblue</td><td>135, 206, 250</td><td>#87cefa</td></tr>\n<tr><td>lightslategray</td><td class=\"light\" bgcolor=\"#778899\">lightslategray</td><td>119, 136, 153</td><td>#778899</td></tr>\n<tr><td>lightslategrey</td><td class=\"light\" bgcolor=\"#778899\">lightslategrey</td><td>119, 136, 153</td><td>#778899</td></tr>\n<tr><td>lightsteelblue</td><td class=\"light\" bgcolor=\"#b0c4de\">lightsteelblue</td><td>176, 196, 222</td><td>#b0c4de</td></tr>\n<tr><td>lightyellow</td><td class=\"light\" bgcolor=\"#ffffe0\">lightyellow</td><td>255, 255, 224</td><td>#ffffe0</td></tr>\n<tr><td>lime</td><td class=\"dark\" bgcolor=\"#00ff00\">lime</td><td>0, 255, 0</td><td>#00ff00</td></tr>\n<tr><td>limegreen</td><td class=\"dark\" bgcolor=\"#32cd32\">limegreen</td><td>50, 205, 50</td><td>#32cd32</td></tr>\n<tr><td>linen</td><td class=\"light\" bgcolor=\"#faf0e6\">linen</td><td>250, 240, 230</td><td>#faf0e6</td></tr>\n<tr><td>magenta</td><td class=\"light\" bgcolor=\"#ff00ff\">magenta</td><td>255, 0, 255</td><td>#ff00ff</td></tr>\n<tr><td>maroon</td><td class=\"dark\" bgcolor=\"#800000\">maroon</td><td>128, 0, 0</td><td>#800000</td></tr>\n<tr><td>mediumaquamarine</td><td class=\"light\" bgcolor=\"#66cdaa\">mediumaquamarine</td><td>102, 205, 170</td><td>#66cdaa</td></tr>\n<tr><td>mediumblue</td><td class=\"dark\" bgcolor=\"#0000cd\">mediumblue</td><td>0, 0, 205</td><td>#0000cd</td></tr>\n<tr><td>mediumorchid</td><td class=\"light\" bgcolor=\"#ba55d3\">mediumorchid</td><td>186, 85, 211</td><td>#ba55d3</td></tr>\n<tr><td>mediumpurple</td><td class=\"light\" bgcolor=\"#9370db\">mediumpurple</td><td>147, 112, 219</td><td>#9370db</td></tr>\n<tr><td>mediumseagreen</td><td class=\"light\" bgcolor=\"#3cb371\">mediumseagreen</td><td>60, 179, 113</td><td>#3cb371</td></tr>\n<tr><td>mediumslateblue</td><td class=\"light\" bgcolor=\"#7b68ee\">mediumslateblue</td><td>123, 104, 238</td><td>#7b68ee</td></tr>\n<tr><td>mediumspringgreen</td><td class=\"light\" bgcolor=\"#00fa9a\">mediumspringgreen</td><td>0, 250, 154</td><td>#00fa9a</td></tr>\n<tr><td>mediumturquoise</td><td class=\"light\" bgcolor=\"#48d1cc\">mediumturquoise</td><td>72, 209, 204</td><td>#48d1cc</td></tr>\n<tr><td>mediumvioletred</td><td class=\"light\" bgcolor=\"#c71585\">mediumvioletred</td><td>199, 21, 133</td><td>#c71585</td></tr>\n<tr><td>midnightblue</td><td class=\"dark\" bgcolor=\"#191970\">midnightblue</td><td>25, 25, 112</td><td>#191970</td></tr>\n<tr><td>mintcream</td><td class=\"light\" bgcolor=\"#f5fffa\">mintcream</td><td>245, 255, 250</td><td>#f5fffa</td></tr>\n<tr><td>mistyrose</td><td class=\"light\" bgcolor=\"#ffe4e1\">mistyrose</td><td>255, 228, 225</td><td>#ffe4e1</td></tr>\n<tr><td>moccasin</td><td class=\"light\" bgcolor=\"#ffe4b5\">moccasin</td><td>255, 228, 181</td><td>#ffe4b5</td></tr>\n<tr><td>navajowhite</td><td class=\"light\" bgcolor=\"#ffdead\">navajowhite</td><td>255, 222, 173</td><td>#ffdead</td></tr>\n<tr><td>navy</td><td class=\"dark\" bgcolor=\"#000080\">navy</td><td>0, 0, 128</td><td>#000080</td></tr>\n<tr><td>none</td><td class=\"dark\" bgcolor=\"#000000\">none</td><td>0, 0, 0</td><td>#000000</td></tr>\n<tr><td>oldlace</td><td class=\"light\" bgcolor=\"#fdf5e6\">oldlace</td><td>253, 245, 230</td><td>#fdf5e6</td></tr>\n<tr><td>olive</td><td class=\"dark\" bgcolor=\"#808000\">olive</td><td>128, 128, 0</td><td>#808000</td></tr>\n<tr><td>olivedrab</td><td class=\"dark\" bgcolor=\"#6b8e23\">olivedrab</td><td>107, 142, 35</td><td>#6b8e23</td></tr>\n<tr><td>orange</td><td class=\"light\" bgcolor=\"#ffa500\">orange</td><td>255, 165, 0</td><td>#ffa500</td></tr>\n<tr><td>orangered</td><td class=\"light\" bgcolor=\"#ff4500\">orangered</td><td>255, 69, 0</td><td>#ff4500</td></tr>\n<tr><td>orchid</td><td class=\"light\" bgcolor=\"#da70d6\">orchid</td><td>218, 112, 214</td><td>#da70d6</td></tr>\n<tr><td>palegoldenrod</td><td class=\"light\" bgcolor=\"#eee8aa\">palegoldenrod</td><td>238, 232, 170</td><td>#eee8aa</td></tr>\n<tr><td>palegreen</td><td class=\"light\" bgcolor=\"#98fb98\">palegreen</td><td>152, 251, 152</td><td>#98fb98</td></tr>\n<tr><td>paleturquoise</td><td class=\"light\" bgcolor=\"#afeeee\">paleturquoise</td><td>175, 238, 238</td><td>#afeeee</td></tr>\n<tr><td>palevioletred</td><td class=\"light\" bgcolor=\"#db7093\">palevioletred</td><td>219, 112, 147</td><td>#db7093</td></tr>\n<tr><td>papayawhip</td><td class=\"light\" bgcolor=\"#ffefd5\">papayawhip</td><td>255, 239, 213</td><td>#ffefd5</td></tr>\n<tr><td>peachpuff</td><td class=\"light\" bgcolor=\"#ffdab9\">peachpuff</td><td>255, 218, 185</td><td>#ffdab9</td></tr>\n<tr><td>peru</td><td class=\"light\" bgcolor=\"#cd853f\">peru</td><td>205, 133, 63</td><td>#cd853f</td></tr>\n<tr><td>pink</td><td class=\"light\" bgcolor=\"#ffc0cb\">pink</td><td>255, 192, 203</td><td>#ffc0cb</td></tr>\n<tr><td>plum</td><td class=\"light\" bgcolor=\"#dda0dd\">plum</td><td>221, 160, 221</td><td>#dda0dd</td></tr>\n<tr><td>powderblue</td><td class=\"light\" bgcolor=\"#b0e0e6\">powderblue</td><td>176, 224, 230</td><td>#b0e0e6</td></tr>\n<tr><td>purple</td><td class=\"dark\" bgcolor=\"#800080\">purple</td><td>128, 0, 128</td><td>#800080</td></tr>\n<tr><td>red</td><td class=\"dark\" bgcolor=\"#ff0000\">red</td><td>255, 0, 0</td><td>#ff0000</td></tr>\n<tr><td>rosybrown</td><td class=\"light\" bgcolor=\"#bc8f8f\">rosybrown</td><td>188, 143, 143</td><td>#bc8f8f</td></tr>\n<tr><td>royalblue</td><td class=\"light\" bgcolor=\"#4169e1\">royalblue</td><td>65, 105, 225</td><td>#4169e1</td></tr>\n<tr><td>saddlebrown</td><td class=\"dark\" bgcolor=\"#8b4513\">saddlebrown</td><td>139, 69, 19</td><td>#8b4513</td></tr>\n<tr><td>salmon</td><td class=\"light\" bgcolor=\"#fa8072\">salmon</td><td>250, 128, 114</td><td>#fa8072</td></tr>\n<tr><td>sandybrown</td><td class=\"light\" bgcolor=\"#f4a460\">sandybrown</td><td>244, 164, 96</td><td>#f4a460</td></tr>\n<tr><td>seagreen</td><td class=\"dark\" bgcolor=\"#2e8b57\">seagreen</td><td>46, 139, 87</td><td>#2e8b57</td></tr>\n<tr><td>seashell</td><td class=\"light\" bgcolor=\"#fff5ee\">seashell</td><td>255, 245, 238</td><td>#fff5ee</td></tr>\n<tr><td>sienna</td><td class=\"dark\" bgcolor=\"#a0522d\">sienna</td><td>160, 82, 45</td><td>#a0522d</td></tr>\n<tr><td>silver</td><td class=\"light\" bgcolor=\"#c0c0c0\">silver</td><td>192, 192, 192</td><td>#c0c0c0</td></tr>\n<tr><td>skyblue</td><td class=\"light\" bgcolor=\"#87ceeb\">skyblue</td><td>135, 206, 235</td><td>#87ceeb</td></tr>\n<tr><td>slateblue</td><td class=\"light\" bgcolor=\"#6a5acd\">slateblue</td><td>106, 90, 205</td><td>#6a5acd</td></tr>\n<tr><td>slategray</td><td class=\"light\" bgcolor=\"#708090\">slategray</td><td>112, 128, 144</td><td>#708090</td></tr>\n<tr><td>slategrey</td><td class=\"light\" bgcolor=\"#708090\">slategrey</td><td>112, 128, 144</td><td>#708090</td></tr>\n<tr><td>snow</td><td class=\"light\" bgcolor=\"#fffafa\">snow</td><td>255, 250, 250</td><td>#fffafa</td></tr>\n<tr><td>springgreen</td><td class=\"light\" bgcolor=\"#00ff7f\">springgreen</td><td>0, 255, 127</td><td>#00ff7f</td></tr>\n<tr><td>steelblue</td><td class=\"light\" bgcolor=\"#4682b4\">steelblue</td><td>70, 130, 180</td><td>#4682b4</td></tr>\n<tr><td>tan</td><td class=\"light\" bgcolor=\"#d2b48c\">tan</td><td>210, 180, 140</td><td>#d2b48c</td></tr>\n<tr><td>teal</td><td class=\"dark\" bgcolor=\"#008080\">teal</td><td>0, 128, 128</td><td>#008080</td></tr>\n<tr><td>thistle</td><td class=\"light\" bgcolor=\"#d8bfd8\">thistle</td><td>216, 191, 216</td><td>#d8bfd8</td></tr>\n<tr><td>tomato</td><td class=\"light\" bgcolor=\"#ff6347\">tomato</td><td>255, 99, 71</td><td>#ff6347</td></tr>\n<tr><td>turquoise</td><td class=\"light\" bgcolor=\"#40e0d0\">turquoise</td><td>64, 224, 208</td><td>#40e0d0</td></tr>\n<tr><td>violet</td><td class=\"light\" bgcolor=\"#ee82ee\">violet</td><td>238, 130, 238</td><td>#ee82ee</td></tr>\n<tr><td>wheat</td><td class=\"light\" bgcolor=\"#f5deb3\">wheat</td><td>245, 222, 179</td><td>#f5deb3</td></tr>\n<tr><td>white</td><td class=\"light\" bgcolor=\"#ffffff\">white</td><td>255, 255, 255</td><td>#ffffff</td></tr>\n<tr><td>whitesmoke</td><td class=\"light\" bgcolor=\"#f5f5f5\">whitesmoke</td><td>245, 245, 245</td><td>#f5f5f5</td></tr>\n<tr><td>yellow</td><td class=\"light\" bgcolor=\"#ffff00\">yellow</td><td>255, 255, 0</td><td>#ffff00</td></tr>\n<tr><td>yellowgreen</td><td class=\"light\" bgcolor=\"#9acd32\">yellowgreen</td><td>154, 205, 50</td><td>#9acd32</td></tr>\n\n</tbody>\n</table>\n</div>\n</body>\n</html>\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/compare.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"compare\"></a>gm compare\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\ncompare - compare two images.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#comp-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#comp-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#comp-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#comp-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm compare</strong> <strong>[</strong> <em>options</em> <strong>... ]</strong> <em>reference-image</em>\n<strong>[</strong> <em>options</em> <strong>... ]</strong> <em>compare-image</em>\n<strong>[</strong> <em>options</em> <strong>... ]</strong>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>compare</strong> compares two similar images using a specified statistical\nmethod (see <strong>-metric</strong>) and/or by writing a difference image\n(<strong>-file</strong>), with the altered pixels annotated using a specified\nmethod (see <strong>-highlight-style</strong>) and color (see\n<strong>-highlight-color</strong>). <p><em>Reference-image</em> is the original\nimage and <em>compare-image</em> is the (possibly) altered version, which\nshould have the same dimensions as <em>reference-image</em>.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo compare two images using Mean Square Error (MSE) statistical analysis\nuse:\n<pre>\n    compare -metric mse original.miff compare.miff\n</pre>\n<p>\nTo create an annotated difference image use:\n<pre>\n    compare -highlight-style assign -highlight-color purple -file diff.miff original.miff compare.miff\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect only for the image that follows.  All\noptions are reset to their default values after each image is read.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-file\">-file</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write annotated difference image to file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-highlight-color\">-highlight-color</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixel annotation color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-highlight-style\">-highlight-style</a> <i>&lt;style&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixel annotation style</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-maximum-error\">-maximum-error</a> <i>&lt;limit&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the maximum amount of total image error</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -metric <i>&lt;metric&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>comparison metric (MAE, MSE, PAE, PSNR, RMSE)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/composite.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"composite\"></a>gm composite\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\ncomposite - composite images together.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#comp-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#comp-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#comp-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#comp-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm composite</strong> <strong>[</strong> <em>options</em> <strong>... ]</strong>\n<em>change-image base-image</em>\n<strong>[</strong> <em>mask-image</em> <strong>]</strong> <em>output-image</em>\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>composite</strong> composites (combines) images to create new images.\n<p><em>base-image</em> is the base image and <em>change-image</em> contains the changes.\n<em>ouput-image</em> is the result, and normally has the same dimensions\nas <em>base-image</em>.\n<br>&nbsp;<br>\n<p>\nThe optional <em>mask-image</em> can be used to provide opacity information\nfor <em>change-image</em> when it has none or if you want a different mask.\nA mask image is typically grayscale and the same size as\n<strong>base-image</strong>. If <em>mask-image</em> is not grayscale, it is converted\nto grayscale and the resulting intensities are used as opacity\ninformation.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo composite an image of a cockatoo with a perch, use:\n<pre>\n    gm composite cockatoo.miff perch.ras composite.miff\n</pre>\n<p>\nTo compute the difference between images in a series, use:\n<pre>\n    gm composite -compose difference series.2 series.1 difference.miff\n</pre>\n<p>\nTo composite an image of a cockatoo with a perch starting at location (100,150),\nuse:\n<pre>\n    gm composite -geometry +100+150 cockatoo.miff perch.ras composite.miff\n</pre>\n<p>\nTo tile a logo across your image of a cockatoo, use\n<pre>\n    gm convert +shade 30x60 cockatoo.miff mask.miff\n    gm composite -compose bumpmap -tile logo.png\n              cockatoo.miff mask.miff composite.miff\n</pre>\n<p>\nTo composite a red, green, and blue color plane into a single composite image,\ntry\n<pre>\n    gm composite -compose CopyGreen green.png red.png red-green.png\n    gm composite -compose CopyBlue blue.png red-green.png composite.png\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect only for the image that follows.  All\noptions are reset to their default values after each image is read.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blue-primary\">-blue-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compose\">-compose</a> <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-displace\">-displace</a> <i>&lt;horizontal scale&gt;x&lt;vertical scale&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shift image pixels as defined by a displacement map</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dissolve\">-dissolve</a> <i>&lt;percent&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>dissolve an image into another by the given percent</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gravity\">-gravity</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-green-primary\">-green-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-profile\">-profile</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add ICM, IPTC, or generic profile  to image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-recolor\">-recolor</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a color translation matrix to image channels</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-red-primary\">-red-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-render\">-render</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-repage\">-repage</a> <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scene\">-scene</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stegano\">-stegano</a> <i>&lt;offset&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>hide watermark within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stereo\">-stereo</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite two images to create a stereo anaglyph</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strip\">-strip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-units\">-units</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the units of image resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-unsharp\">-unsharp</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+&lt;amount&gt;</i>}<i></i>{<i>+&lt;threshold&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image with an unsharp mask operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -watermark <i>&lt;brightness&gt;x&lt;saturation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>percent brightness and saturation of a watermark</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-point\">-white-point</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-write\">-write</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write an intermediate image [<em>convert, composite</em>]</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/conjure.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conjure\"></a>gm conjure\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conj-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\nconjure - process a Magick Scripting Language (MSL) script\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conj-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#conj-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#conj-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#conj-opti\">Options</a>\n</dt>\n<dt>\n<a href=\"#conj-msl\">Magick Scripting Language</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conj-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm conjure</strong> <strong>[</strong> <em>options</em> <strong>]</strong> <em>script.msl</em>\n<strong>[ [</strong> <em>options</em> <strong>]</strong> <em>script.msl</em> <strong>]</strong>\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conj-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe Magick scripting language (MSL) will primarily benefit those that\nwant to accomplish custom image processing tasks but do not wish to\nprogram, or those that do not have access to a Perl interpreter or a\ncompiler.  The interpreter is called conjure and here is an example\nscript:\n<pre>\n    &lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n    &lt;image size=\"400x400\" &gt;\n      &lt;read filename=\"image.gif\" /&gt;\n      &lt;get width=\"base-width\" height=\"base-height\" /&gt;\n      &lt;resize geometry=\"%[dimensions]\" /&gt;\n      &lt;get width=\"width\" height=\"height\" /&gt;\n      &lt;print output=\n        \"Image sized from %[base-width]x%[base-height]\n         to %[width]x%[height].\\n\" /&gt;\n      &lt;write filename=\"image.png\" /&gt;\n    &lt;/image&gt;\n</pre>\n<p>\ninvoked with\n<pre>\n    gm conjure -dimensions 400x400 incantation.msl\n</pre>\n<p>\nAll operations will closely follow the key/value pairs defined in\nPerlMagick, unless otherwise noted.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conj-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect until it is explicitly changed by specifying\nthe option again with a different effect, or if it is changed by a statement\nin the scripting language.\n<p>\nYou can define your own keyword/value pairs on the command line.\nThe script can then use this information when setting values by including\n%[keyword] in the string.  For example, if you included\n\"-dimensions 400x400\" on the command line, as illustrated above,\nthen any string\ncontaining \"%[dimensions]\" would have 400x400 substituted.\nThe \"%[string]\" can be used either an entire string, such as\ngeometry=\"%[dimensions]\" or as a part of a string such as\nfilename=\"%[basename].png\".\n<p>\nThe keyword can be any string except for the following reserved\nstrings (in any upper, lower, or mixed case variant): <strong>debug</strong>,\n<strong>help</strong>, and <strong>verbose</strong>, whose usage is described below.\n<p>\nThe value can be any string.  If\neither the keyword or the value contains white space or any\nsymbols that have special meanings to your shell such as \"#\",\n\"|\",\nor\n\"%\", enclose the string in quotation marks or use \"\\\" to escape the white\nspace and special symbols.\n<p>\nKeywords and values are case dependent.  \"Key\",\n\"key\",\nand \"KEY\" would\nbe three different keywords.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conj-msl\"></a>Magick Scripting Language\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe Magick Scripting Language (MSL) presently defines the following\nelements and their attributes:\n<dl>\n<dt>&lt;image&gt;</dt>\n<dd>background, color, id, size</dd>\n<dd>\nDefine a new image object.  <strong>&lt;/image&gt;</strong> destroys it. Because of\nthis, if you wish to reference multiple \"subimages\" (aka pages or\nlayers), you can embed one <strong>image</strong> element inside of another. For\nexample:\n</dd>\n<dd>\n<pre>\n    &lt;image&gt;\n    &lt;read filename=\"input.png\" /&gt;\n    &lt;get width=\"base-width\" height=\"base-height\" /&gt;\n    &lt;image height=\"base-height\" width=\"base-width\"&gt;\n    &lt;image /&gt;\n    &lt;write filename=\"output.mng\" /&gt;\n    &lt;/image&gt;\n</pre>\n</dd>\n<dd>\n<pre>\n    &lt;image size=\"400x400\" /&gt;\n</pre>\n</dd>\n<dt>&lt;group&gt;</dt>\n<dd>\nDefine a new group of image objects.  By default, images are only\nvalid for the life of their <strong>&lt;image&gt;</strong>element.\n</dd>\n<dd>\n<pre>\n    &lt;image&gt;   -- creates the image\n    .....     -- do stuff with it\n    &lt;/image&gt;  -- dispose of the image\n</pre>\n</dd>\n<dd>\nHowever, in a group, all images in that group will stay around for the\nlife of the group:\n</dd>\n<dd>\n<pre>\n    &lt;group&gt;                           -- start a group\n        &lt;image&gt;                       -- create an image\n        ....                          -- do stuff\n        &lt;/image&gt;                      -- NOOP\n        &lt;image&gt;                       -- create another image\n        ....                          -- do more stuff\n        &lt;/image&gt;                      -- NOOP\n        &lt;write filename=\"image.mng\" /&gt;  -- output\n    &lt;/group&gt;                          -- dispose of both images\n</pre>\n</dd>\n<dt>&lt;read&gt;</dt>\n    <dd>filename</dd>\n<dd>\nRead a new image from a disk file.\n</dd>\n<dd>\n<pre>\n    &lt;read filename=\"image.gif\" /&gt;\n</pre>\n</dd>\n<dd>\nTo read two images use\n</dd>\n<dd>\n<pre>\n    &lt;read filename=\"image.gif\" /&gt;\n    &lt;read filename=\"image.png /&gt;\n</pre>\n</dd>\n<dt>&lt;write&gt;</dt>\n    <dd>filename</dd>\n<dd>Write the image(s) to disk, either as\na single multiple-image file or multiple ones if necessary.\n</dd>\n<dd>\n<pre>\n     &lt;write filename=image.tiff\" /&gt;\n</pre>\n<dt>&lt;get&gt;</dt>\n<dd>Get any attribute recognized by\nPerlMagick's GetAttribute() and stores it as an image attribute for later\nuse. Currently only <em>width</em> and <em>height</em> are supported.</dd>\n<dd>\n<pre>\n    &lt;get width=\"base-width\" height=\"base-height\" /&gt;\n    &lt;print output=\"Image size is %[base-width]x%[base-height].\\n\" /&gt;\n</pre>\n</dd>\n<dt>&lt;set&gt;</dt>\n<dd>background, bordercolor, clip-mask, colorspace, density,\nmagick, mattecolor, opacity.  Set an attribute recognized by\nPerlMagick's GetAttribute().</dd>\n<dt>&lt;profile&gt;</dt>\n    <dd>[profilename]</dd>\n<dd>\nRead one or more IPTC, ICC or generic profiles from file and assign to image\n</dd>\n<dd>\n<pre>\n    &lt;profile iptc=\"profile.iptc\" generic=\"generic.dat\" /&gt;\n</pre>\n</dd>\n<dd>\nTo remove a specified profile use \"!\" as the filename eg\n</dd>\n<dd>\n<pre>\n    &lt;profile icm=\"!\" iptc=\"profile.iptc\" /&gt;\n</pre>\n</dd>\n<dt>&lt;border&gt;</dt>\n    <dd>fill, geometry, height, width</dd>\n<dt>&lt;blur&gt;</dt>\n    <dd>radius, sigma</dd>\n<dt>&lt;charcoal&gt;</dt>\n    <dd>radius, sigma</dd>\n<dt>&lt;chop&gt;</dt>\n    <dd>geometry, height, width, x, y</dd>\n<dt>&lt;crop&gt;</dt>\n    <dd>geometry, height, width, x, y</dd>\n<dt>&lt;composite&gt;</dt>\n    <dd>compose, geometry, gravity, image, x, y</dd>\n<dd>\n<pre>\n    &lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n    &lt;group&gt;\n        &lt;image id=\"image_01\"&gt;\n            &lt;read filename=\"cloud3.gif\"/&gt;\n            &lt;resize geometry=\"250x90\"/&gt;\n        &lt;/image&gt;\n        &lt;image id=\"image_02\"&gt;\n            &lt;read filename=\"cloud4.gif\"/&gt;\n            &lt;resize geometry=\"190x100\"/&gt;\n        &lt;/image&gt;\n        &lt;image&gt;\n            &lt;read filename=\"background.jpg\"/&gt;\n            &lt;composite image=\"image_01\" geometry=\"+740+470\"/&gt;\n            &lt;composite image=\"image_02\" geometry=\"+390+415\"/&gt;\n        &lt;/image&gt;\n        &lt;write filename=\"result.png\"/&gt;\n    &lt;/group&gt;\n</pre>\n</dd>\n<dt>&lt;despeckle&gt;</dt>\n<dt>&lt;emboss&gt;</dt>\n    <dd>radius, sigma</dd>\n<dt>&lt;enhance&gt;</dt>\n<dt>&lt;equalize&gt;</dt>\n<dt>&lt;edge&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;flip&gt;</dt>\n<dt>&lt;flop&gt;</dt>\n<dt>&lt;frame&gt;</dt>\n    <dd>fill, geometry, height, width, x, y, inner, outer</dd>\n<dt>&lt;flatten&gt;</dt>\n<dt>&lt;get&gt;</dt>\n    <dd>height, width</dd>\n<dt>&lt;gamma&gt;</dt>\n    <dd>red, green, blue</dd>\n<dt>&lt;image&gt;</dt>\n    <dd>background, color, id, size</dd>\n<dt>&lt;implode&gt;</dt>\n    <dd>amount</dd>\n<dt>&lt;magnify&gt;</dt>\n<dt>&lt;minify&gt;</dt>\n<dt>&lt;medianfilter&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;normalize&gt;</dt>\n<dt>&lt;oilpaint&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;print&gt;</dt>\n    <dd>output</dd>\n<dt>&lt;profile&gt;</dt>\n    <dd>[profilename]</dd>\n<dt>&lt;read&gt;</dt>\n<dt>&lt;resize&gt;</dt>\n    <dd>blur, filter, geometry, height, width</dd>\n<dt>&lt;roll&gt;</dt>\n    <dd>geometry, x, y</dd>\n<dt>&lt;rotate&gt;</dt>\n    <dd>degrees</dd>\n<dt>&lt;reducenoise&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;sample&gt;</dt>\n    <dd>geometry, height, width</dd>\n<dt>&lt;scale&gt;</dt>\n    <dd>geometry, height, width</dd>\n<dt>&lt;sharpen&gt;</dt>\n    <dd>radius, sigma</dd>\n<dt>&lt;shave&gt;</dt>\n    <dd>geometry, height, width</dd>\n<dt>&lt;shear&gt;</dt>\n    <dd>x, y</dd>\n<dt>&lt;solarize&gt;</dt>\n    <dd>threshold</dd>\n<dt>&lt;spread&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;stegano&gt;</dt>\n    <dd>image</dd>\n<dt>&lt;stereo&gt;</dt>\n    <dd>image</dd>\n<dt>&lt;swirl&gt;</dt>\n    <dd>degrees</dd>\n<dt>&lt;texture&gt;</dt>\n    <dd>image</dd>\n<dt>&lt;threshold&gt;</dt>\n    <dd>threshold</dd>\n<dt>&lt;transparent&gt;</dt>\n    <dd>color</dd>\n<dt>&lt;trim&gt;</dt>\n</dl>\n</td></tr></table>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/contribute.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Contributing to GraphicsMagick</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"contributing-to-graphicsmagick\">\n<h1 class=\"title\">Contributing to GraphicsMagick</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The future and success of GraphicsMagick depends on your contributions.\nBy contributing to GraphicsMagick you will benefit from the\nfeatures/fixes you contribute, can take pride in taking part in the\ndevelopment of a quality product, and you can tell your friends that you\ncontribute to the GraphicsMagick project.</p>\n<p>There are a number of ways you can contribute:</p>\n<ul class=\"simple\">\n<li>Submit bug reports to the GraphicsMagick bug tracking system at\nSourceForge.</li>\n<li>Submit patches to the GraphicsMagick patch submission system at\nSourceForge.</li>\n<li>Perform test builds on unusual systems and report the results.</li>\n<li>Submit ideas and proposed designs to the graphicsmagick-core\nmailing list.</li>\n<li>Create a new language interface, dependent library, or application.</li>\n<li>Join the GraphicsMagick Group as a full-fledged developer with CVS\ncommit access.</li>\n</ul>\n<p>Regardless of how you choose to contribute, your contributions will be\ntreated with the respect and value that they deserve.</p>\n<p>Becoming a member of the GraphicsMagick Group requires a majority vote\nfrom existing members. Your chances of being admitted to the group are\nincreased significantly if you have a proven track-record of success on\nother open source projects, are a recognized expert in the field, or have\nalready demonstrated your capabilities and commitment by contributing to\nthe project in other ways. Please contact Bob Friesenhahn\n&lt;<a class=\"reference external\" href=\"mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us\">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt; in order to be considered for group\nmembership.</p>\n<div class=\"section\" id=\"areas-to-contribute\">\n<h1>Areas To Contribute</h1>\n<p>The following are areas where significant contributions may be made to\nthe GraphicsMagick project:</p>\n<ul class=\"simple\">\n<li>Support building and distributing GraphicsMagick RPMs for Linux.</li>\n<li>Act as formal maintainer for the Gentoo Linux GraphicsMagick ebuild so\nthat it is added back to Portage. This is not difficult since the\nebuild has been actively maintained via the Gentoo bug tracking system.\nAt the very least, registering a vote for the Gentoo bug may be helpful.\nSee <a class=\"reference external\" href=\"http://bugs.gentoo.org/show_bug.cgi?id=190372\">http://bugs.gentoo.org/show_bug.cgi?id=190372</a>.</li>\n<li>Set up an FTP mirror site for GraphicsMagick.</li>\n<li>Create a language interface using SWIG &lt;<a class=\"reference external\" href=\"http://www.swig.org/\">http://www.swig.org/</a>&gt; to\nsupport scripting in Perl, Python, TCL/TK, Guile, MzScheme, Ruby,\nJava, PHP, and CHICKEN, based on a common implementation.</li>\n<li>Create a new utility command parser based on a separate LALR or\nXML-based syntax definition, and using an approach suitable to\nreplace the existing error-prone command parsers in magick/command.c</li>\n<li>Create a vector encoder for EPS, Postscript, PDF, SVG\n&lt;<a class=\"reference external\" href=\"http://www.w3.org/Graphics/SVG/\">http://www.w3.org/Graphics/SVG/</a>&gt;, Macromedia Flash\n(SWF), WebCGM &lt;<a class=\"reference external\" href=\"http://www.w3.org/Graphics/WebCGM/\">http://www.w3.org/Graphics/WebCGM/</a>&gt;, or WMF.</li>\n<li>Create an OpenEXR coder based on the OpenEXR\n&lt;<a class=\"reference external\" href=\"http://www.openexr.com/\">http://www.openexr.com/</a>&gt; library from Industrial Light &amp; Magic.</li>\n<li>Create a <em>pstoedit</em> module to import Postscript, EPS, and PDF\nfiles as vector data using pstoedit &lt;<a class=\"reference external\" href=\"http://www.pstoedit.net/\">http://www.pstoedit.net/</a>&gt; which\nalready includes a high-quality driver to render Postscript vectors via\nGraphicsMagick. This module could also export vector data in many\nformats using pstoedit's output drivers.</li>\n<li>Work on adding EXIF profile writing support which works for JPEG and\nTIFF formats.</li>\n<li>Add integrated Adobe XMP\n&lt;<a class=\"reference external\" href=\"http://www.adobe.com/products/xmp/index.html\">http://www.adobe.com/products/xmp/index.html</a>&gt; profile support for\nTIFF, JPEG, PNG, PDF, EPS, and Postscript.</li>\n<li>Port Erik Reinhard's super-cool Parameter Estimation For\nPhotographic Tone Reproduction\n&lt;<a class=\"reference external\" href=\"http://www.cs.ucf.edu/~reinhard/Reinhard02/\">http://www.cs.ucf.edu/~reinhard/Reinhard02/</a>&gt; algorithm to\nGraphicsMagick.</li>\n<li>Create a replacement (using a portable Widget set such as FLTK) for the\nIMDisplay Windows GUI program and possibly the X11 'display' program.</li>\n<li>Create an interface between GraphicsMagick and OpenOffice.org.\n&lt;<a class=\"reference external\" href=\"http://www.openoffice.org/\">http://www.openoffice.org/</a>&gt; so that OpenOffice may load and save\nany format supported by GraphicsMagick. OpenOffice.org offers a\nseparate SDK so there may be a number of other opportunities to\nexplore.</li>\n<li>Complete the port of ralcgm to Windows so that it may be used as a\ndelegate under Windows.</li>\n</ul>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/convert.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a convert=\"top\"></a>gm convert\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conv-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nconvert - convert an image or sequence of images\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conv-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#conv-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#conv-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#conv-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#conv-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conv-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm convert</strong> <strong>[</strong> <em>options</em> <strong>... ]</strong>\n<em>input_file <strong>[</strong> <em>options</em> <strong>... ]</strong> <em>output_file</em>\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conv-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Convert</strong> converts an input file using one image format to an output\nfile with a differing image format. In addition, various types of image\nprocessing can be performed on the converted image during the conversion\nprocess. <strong>Convert</strong> recognizes the image formats listed in\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conv-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo make a thumbnail of a JPEG image, use:\n<pre>\n    gm convert -size 120x120 cockatoo.jpg -resize 120x120 +profile \"*\" thumbnail.jpg\n</pre>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn this example, <tt>'-size 120x120'</tt> gives a hint to the JPEG decoder\nthat the image is going to be downscaled to 120x120, allowing it to run\nfaster by avoiding returning full-resolution images to GraphicsMagick for\nthe subsequent resizing operation.  The\n<tt>'-resize 120x120'</tt> specifies the desired dimensions of the\noutput image.  It will be scaled so its largest dimension is 120 pixels.  The\n<tt>'+profile \"*\"'</tt> removes any ICM, EXIF, IPTC, or other profiles\nthat might be present in the input and aren't needed in the thumbnail.</font></td></tr></table>\n<p>\nTo convert a <em>MIFF</em> image of a cockatoo to a SUN raster image, use:\n<pre>\n    gm convert cockatoo.miff sun:cockatoo.ras\n</pre>\n<p>\nTo convert a multi-page <em>PostScript</em> document to individual FAX pages,\nuse:\n<pre>\n    gm convert -monochrome document.ps fax:page\n</pre>\n<p>\nTo convert a TIFF image to a <em>PostScript</em> A4 page with the image in\nthe lower left-hand corner, use:\n<pre>\n    gm convert -page A4+0+0 image.tiff document.ps\n</pre>\n<p>\nTo convert a raw Gray image with a 128 byte header to a portable graymap,\nuse:\n<pre>\n    gm convert -depth 8 -size 768x512+128 gray:raw image.pgm\n</pre>\n<p>\nIn this example, \"raw\" is the input file.  Its format is \"gray\" and it\nhas the dimensions and number of header bytes specified by the -size\noption and the sample depth specified by the\n-depth option.  The output file is \"image.pgm\".  The suffix \".pgm\"\nspecifies its format.\n<p>\nTo convert a Photo CD image to a TIFF image, use:\n<pre>\n    gm convert -size 1536x1024 img0009.pcd image.tiff\n    gm convert img0009.pcd[4] image.tiff\n</pre>\n<p>\nTo create a visual image directory of all your JPEG images, use:\n<pre>\n    gm convert 'vid:*.jpg' directory.miff\n</pre>\n<p>\nTo annotate an image with blue text using font 12x24 at position (100,100),\nuse:\n<pre>\n    gm convert -font helvetica -fill blue -draw \"text 100,100 Cockatoo\"\n            bird.jpg bird.miff\n</pre>\n<p>\nTo tile a 640x480 image with a JPEG texture with bumps use:\n<pre>\n    gm convert -size 640x480 tile:bumps.jpg tiled.png\n</pre>\n<p>\nTo surround an icon with an ornamental border to use with Mosaic(1), use:\n<pre>\n    gm convert -mattecolor \"#697B8F\" -frame 6x6 bird.jpg icon.png\n</pre>\n<p>\nTo create a MNG animation from a DNA molecule sequence, use:\n<pre>\n    gm convert -delay 20 dna.* dna.mng\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conv-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images that follows,\nuntil the set is terminated by the appearance of any option or <strong>-noop</strong>.\nSome options only affect the decoding of images and others only the encoding.\nThe latter can appear after the final group of input images.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-adjoin\">-adjoin</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>join images into a single multi-image file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-affine\">-affine</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>drawing transform matrix</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-antialias\">-antialias</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixel aliasing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-append\">-append</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>append a set of images</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details\"></a> <i>-asc-cdl &lt;spec&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply ASC CDL color transform</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-auto-orient\">-auto-orient</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>orient (rotate) image so it is upright</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-average\">-average</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>average a set of images</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-black-threshold\">-black-threshold</a> <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels below the threshold become black</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blue-primary\">-blue-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blur\">-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-border\">-border</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with a border of color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-box\">-box</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the color of the annotation bounding box</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-channel\">-channel</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of channel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -charcoal <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate a charcoal drawing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-chop\">-chop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixels from the interior of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-clip\">-clip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply the clipping path, if one is present</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-coalesce\">-coalesce</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>merge a sequence of images</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorize\">-colorize</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colorize the image with the pen color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compose\">-compose</a> <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-contrast\">-contrast</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enhance or reduce the image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-convolve\">-convolve</a> <i>&lt;kernel&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>convolve image with the specified convolution kernel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-cycle\">-cycle</a> <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image colormap by amount</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-deconstruct\">-deconstruct</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>break down an image sequence into constituent parts</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -despeckle\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>reduce the speckles within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-draw\">-draw</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with one or more graphic primitives</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -edge <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>detect edges within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -emboss <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>emboss an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -enhance\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a digital filter to enhance a noisy image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -equalize\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform histogram equalization to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-extent\">-extent</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite image on background color canvas image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fill\">-fill</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flatten\">-flatten</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>flatten a sequence of images</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flip\">-flip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flop\">-flop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-format\">-format</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output formatted image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-frame\">-frame</a> <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fuzz\">-fuzz</a> <i>&lt;distance&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colors within this Euclidean distance are considered equal</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gaussian\">-gaussian</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gravity\">-gravity</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-green-primary\">-green-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -hald-clut <i>&lt;clut&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a Hald CLUT to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -implode <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>implode image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-intent\">-intent</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of rendering intent when managing the image color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-lat\">-lat</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;offset&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform local adaptive thresholding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-level\">-level</a> <i>&lt;black_point&gt;</i>{<i>,&lt;gamma&gt;</i>}<i></i>{<i>,&lt;white_point&gt;</i>}<i></i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>adjust the level of image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-list\">-list</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of list</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-loop\">-loop</a> <i>&lt;iterations&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add Netscape loop extension to your GIF animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-map\">-map</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>choose a particular set of colors from this image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mask\">-mask</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify a clipping mask</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -median <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a median filter to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -minify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>minify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-modulate\">-modulate</a> <i>brightness[,saturation[,hue]]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>vary the brightness, saturation, and hue of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-morph\">-morph</a> <i>&lt;frames&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>morphs an image sequence</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mosaic\">-mosaic</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a mosaic from an image or an image sequence</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-motion-blur\">-motion-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+angle</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Simulate motion blur</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noise\">-noise</a> <i>&lt;radius|type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add or reduce noise in an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-normalize\">-normalize</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform image to span the full range of color values</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-opaque\">-opaque</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>change this color to the pen color within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-operator\">-operator</a> <i>channel operator rvalue[%]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a mathematical, bitwise, or value operator to an image channel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-ordered-dither\">-ordered-dither</a> <i>&lt;channeltype&gt; &lt;NxN&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>ordered dither the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-orient\">-orient</a> <i>&lt;orientation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Set the image orientation attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-paint\">-paint</a> <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate an oil painting</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pen\">-pen</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>(This option has been replaced by the -fill option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -ping\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>efficiently determine image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-preview\">-preview</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>image preview type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-process\">-process</a> <i>&lt;command&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>process a sequence of images using a process module</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-profile\">-profile</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add ICM, IPTC, or generic profile  to image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-raise\">-raise</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>lighten or darken image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-random-threshold\">-random-threshold</a> <i>&lt;channeltype&gt; &lt;LOWxHIGH&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>random threshold the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-recolor\">-recolor</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a color translation matrix to image channels</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-red-primary\">-red-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-region\">-region</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply options to a portion of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-render\">-render</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-repage\">-repage</a> <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resample\">-resample</a> <i>&lt;horizontal&gt;x&lt;vertical&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Resample image to specified horizontal and vertical resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-roll\">-roll</a> <i></i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>roll an image vertically or horizontally</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sample\">-sample</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale image using pixel sampling</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scale\">-scale</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scene\">-scene</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-segment\">-segment</a> <i>&lt;cluster threshold&gt;x&lt;smoothing threshold&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>segment an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shade\">-shade</a> <i>&lt;azimuth&gt;x&lt;elevation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shade the image using a distant light source</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shave\">-shave</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shave pixels from the image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shear\">-shear</a> <i>&lt;x degrees&gt;x&lt;y degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shear the image along the X or Y axis</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-solarize\">-solarize</a> <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>negate all pixels above the threshold level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-spread\">-spread</a> <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image pixels by a random amount</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strip\">-strip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stroke\">-stroke</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when stroking a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strokewidth\">-strokewidth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the stroke width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-swirl\">-swirl</a> <i>&lt;degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>swirl image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-threshold\">-threshold</a> <i>&lt;value&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>threshold the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tile image when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transform\">-transform</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transparent\">-transparent</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-units\">-units</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the units of image resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-unsharp\">-unsharp</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+&lt;amount&gt;</i>}<i></i>{<i>+&lt;threshold&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image with an unsharp mask operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -use-pixmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use the pixmap</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -view <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>FlashPix viewing parameters</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-virtual-pixel\">-virtual-pixel</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify contents of \"virtual pixels\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-wave\">-wave</a> <i>&lt;amplitude&gt;x&lt;wavelength&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>alter an image along a sine wave</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-point\">-white-point</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-threshold\">-white-threshold</a> <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels above the threshold become white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-write\">-write</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write an intermediate image [<em>convert, composite</em>]</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/display.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"display\"></a>gm display\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\ndisplay - display an image on any workstation running X\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<ul>\n<li>\n<a href=\"#disp-syno\">Synopsis</a>\n<li>\n<a href=\"#disp-desc\">Description</a>\n<li>\n<a href=\"#disp-exam\">Examples</a>\n<li>\n<a href=\"#disp-opti\">Options</a>\n<li>\n<a href=\"#disp-mous\">Mouse Buttons</a>\n<li>\n<a href=\"#disp-comm\">Command Widget</a>\n<li>\n<a href=\"#disp-keyb\">Keyboard Accelerators</a>\n<li>\n<a href=\"#disp-xres\">X Resources</a>\n<li>\n<a href=\"#disp-imlo\">Image Loading</a>\n<li>\n<a href=\"#disp-visu\">Visual Image Directory</a>\n<li>\n<a href=\"#disp-imcu\">Image Cutting</a>\n<li>\n<a href=\"#disp-imco\">Image Copying</a>\n<li>\n<a href=\"#disp-impas\">Image Pasting</a>\n<li>\n<a href=\"#disp-imcr\">Image Cropping</a>\n<li>\n<a href=\"#disp-imch\">Image Chopping</a>\n<li>\n<a href=\"#disp-imro\">Image Rotation</a>\n<li>\n<a href=\"#disp-segm\">Image Segmentation</a>\n<li>\n<a href=\"#disp-iman\">Image Annotation</a>\n<li>\n<a href=\"#disp-imcomp\">Image Compositing</a>\n<li>\n<a href=\"#disp-cole\">Color Editing</a>\n<li>\n<a href=\"#disp-matt\">Matte (Transparent Channel) Editing</a>\n<li>\n<a href=\"#disp-imdr\">Image Drawing</a>\n<li>\n<a href=\"#disp-regi\">Region of Interest</a>\n<li>\n<a href=\"#disp-impa\">Image Panning</a>\n<li>\n<a href=\"#disp-impa\">User Preferences</a>\n</ul>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm display</strong> <strong>[</strong> <em>options</em> <strong>...]</strong> <em>file</em>\n<strong>[</strong><em>options</em><strong>...]</strong><em>file</em>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nDisplay is a machine architecture independent\nimage processing and display program. It can display an image on any workstation\nscreen running an X server. <strong>Display</strong> can read and write\n<strong>many</strong>\nof the more popular image <a href=\"formats.html\">formats</a> (e.g. <strong>JPEG</strong>,\n<strong>TIFF</strong>,\n<strong>PNM</strong>,\n<strong>Photo\nCD</strong>, etc.).\n<p>\nWith <strong>display</strong>, you can perform these functions on an image:\n<dl>\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">load an image from a file\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display the next image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display the former image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display a sequence of images as a slide show\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">write the image to a file\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">print the image to a <em>PostScript</em> printer\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">delete the image file\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">create a Visual Image Directory\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">select the image to display by its thumbnail rather than name\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">undo last image transformation\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">copy a region of the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">paste a region to the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">restore the image to its original size\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">refresh the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">half the image size\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">double the image size\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">resize the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">crop the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">cut the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">flop image in the horizontal direction\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">flip image in the vertical direction\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">rotate the image 90 degrees clockwise\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">rotate the image 90 degrees counter-clockwise\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">rotate the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">shear the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">roll the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">trim the image edges\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">invert the colors of the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">vary the color brightness\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">vary the color saturation\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">vary the image hue\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">gamma correct the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">sharpen the image contrast\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">dull the image contrast\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">perform histogram equalization on the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">perform histogram normalization on the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">negate the image colors\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">convert the image to grayscale\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">set the maximum number of unique colors in the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">reduce the speckles within an image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">eliminate peak noise from an image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">detect edges within the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">emboss an image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">segment the image by color\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">simulate an oil painting\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">simulate a charcoal drawing\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">annotate the image with text\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">draw on the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">edit an image pixel color\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">edit the image matte information\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">composite an image with another\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">add a border to the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">surround image with an ornamental border\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">apply image processing techniques to a region of interest\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display information about the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">zoom a portion of the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">show a histogram of the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display image to background of a window\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">set user preferences\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display information about this program\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">discard all images and exit program\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">change the level of magnification\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display images specified by a World Wide Web (WWW) uniform resource locator (URL)\n</dl>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo scale an image of a cockatoo to exactly 640 pixels in width and 480\npixels in height and position the window at location (200,200), use:\n<pre>\n    gm display -geometry 640x480+200+200! cockatoo.miff\n</pre>\n<p>\nTo display an image of a cockatoo without a border centered on a backdrop,\nuse:\n<pre>\n    gm display +borderwidth -backdrop cockatoo.miff\n</pre>\n<p>\nTo tile a slate texture onto the root window, use:\n<pre>\n    gm display -size 1280x1024 -window root slate.png\n</pre>\n<p>\nTo display a visual image directory of all your JPEG images, use:\n<pre>\n    gm display 'vid:*.jpg'\n</pre>\n<p>\nTo display a MAP image that is 640 pixels in width and 480 pixels in height\nwith 256 colors, use:\n<pre>\n    gm display -size 640x480+256 cockatoo.map\n</pre>\n<p>\nTo display an image of a cockatoo specified with a <strong>World Wide Web (WWW)</strong>\nuniform resource locator <strong>(URL)</strong>, use:\n<pre>\n    gm display ftp://wizards.dupont.com/images/cockatoo.jpg\n</pre>\n<p>\nTo display histogram of an image, use:\n<pre>\n    gm gm convert file.jpg HISTOGRAM:- | gm display -\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect until it is explicitly changed by specifying\nthe option again with a different effect. For example to display three images,\nthe first with 32 colors, the second with an unlimited number of colors,\nand the third with only 16 colors, use:\n<pre>\n    gm display -colors 32 cockatoo.miff -noop duck.miff -colors 16 macaw.miff\n</pre>\n<p>\n<strong>Display</strong> options can appear on the command line or in your X resources\nfile. See <em>X(1)</em>. Options on the command line supersede values specified\nin your X resources file.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-backdrop\">-backdrop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the image centered on a backdrop.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-border\">-border</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with a border of color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -borderwidth <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colormap\">-colormap</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the colormap type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-contrast\">-contrast</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enhance or reduce the image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -despeckle\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>reduce the speckles within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -edge <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>detect edges within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -enhance\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a digital filter to enhance a noisy image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flip\">-flip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flop\">-flop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-foreground\">-foreground</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the foreground color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-frame\">-frame</a> <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-iconGeometry\">-iconGeometry</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the icon geometry</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -iconic\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>iconic animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -immutable\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image immutable</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-map\">-map</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display image using this type.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -name\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+progress\">+progress</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>disable progress monitor and busy cursor</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-raise\">-raise</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>lighten or darken image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-remote\">-remote</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform a X11 remote operation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-roll\">-roll</a> <i></i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>roll an image vertically or horizontally</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sample\">-sample</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale image using pixel sampling</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scenes\">-scenes</a> <i>&lt;value-value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>range of image scene numbers to read</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-segment\">-segment</a> <i>&lt;cluster threshold&gt;x&lt;smoothing threshold&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>segment an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shared-memory\">-shared-memory</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use shared memory</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-text-font\">-text-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>font for writing fixed-width text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-title\">-title</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign title to displayed image [<em>animate, display, montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-update\">-update</a> <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\ndetect when image file is modified and redisplay.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -use-pixmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use the pixmap</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-visual\">-visual</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>animate images using this X visual type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-window\">-window</a> <i>&lt;id&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image the background of a window</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -window-group\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the window group</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-write\">-write</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write the image to a file [<em>display</em>]</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-mous\"></a>Mouse Buttons\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe effects of each button press is described below. Three buttons are\nrequired. If you have a two button mouse, button 1 and 3 are returned.\nPress <strong>ALT</strong> and button 3 to simulate button 2.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    1\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nPress this button to map or unmap the <a href=\"#disp-comm\">Command\nwidget</a> . See the next section for more information about the Command\nwidget.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    2\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nPress and drag to define a region of the image to magnify.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    3\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nPress and drag to choose from a select set of <strong>display(1)</strong>\ncommands. This button behaves differently if the image being displayed\nis a visual image directory. Choose a particular tile of the directory\nand press this button and drag to select a command from a pop-up menu.\nChoose from these menu items:</td></tr></table>\n<ul>\n<li>Open\n<li>Next\n<li>Former\n<li>Delete\n<li>Update\n</ul>\n<p>\nIf you choose <strong>Open</strong>, the image represented by the tile is displayed.\nTo return to the visual image directory, choose <strong>Next</strong> from the Command\nwidget (refer to <a href=\"#disp-comm\">Command Widget</a>).\n<strong>Next</strong> and <strong>Former</strong>\nmoves to the next or former image respectively. Choose <strong>Delete</strong> to\ndelete a particular image tile. Finally, choose <strong>Update</strong> to synchronize\nall the image tiles with their respective images. See\n<a href=\"montage.html\">montage</a>\nand\n<a href=\"miff.html\">miff</a> for more details.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-comm\"></a>Command Widget\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe Command widget lists a number of sub-menus and commands. They are\n<ul>\n<li><strong>File</strong>\n<ul>\n<li>Open...\n<li>Next\n<li>Former\n<li>Select...\n<li>Save...\n<li>Print...\n<li>Delete...\n<li>Canvas...\n<li>Visual Directory...\n<li>Quit\n</ul>\n</ul>\n<ul>\n<li><strong>Edit</strong>\n<ul>\n<li>Undo\n<li>Redo\n<li>Cut\n<li>Copy\n<li>Paste\n</ul>\n</ul>\n<ul>\n<li><strong>View</strong>\n<ul>\n<li>Half Size\n<li>Original Size\n<li>Double Size\n<li>Resize...\n<li>Apply\n<li>Refresh\n<li>Restore\n</ul>\n</ul>\n<ul>\n<li><strong>Transform</strong>\n<ul>\n<li>Crop\n<li>Chop\n<li>Flop\n<li>Flip\n<li>Rotate Right\n<li>Rotate Left\n<li>Rotate...\n<li>Shear...\n<li>Roll...\n<li>Trim Edges\n</ul>\n</ul>\n<ul>\n<li><strong>Enhance</strong>\n<ul>\n<li>Hue...\n<li>Saturation...\n<li>Brightness...\n<li>Gamma...\n<li>Spiff...\n<li>Dull\n<li>Equalize\n<li>Normalize\n<li>Negate\n<li>GRAYscale\n<li>Quantize...\n</ul>\n</ul>\n<ul>\n<li><strong>Effects</strong>\n<ul>\n<li>Despeckle\n<li>Emboss\n<li>Reduce Noise\n<li>Add Noise\n<li>Sharpen...\n<li>Blur...\n<li>Threshold...\n<li>Edge Detect...\n<li>Spread...\n<li>Shade...\n<li>Raise...\n<li>Segment...\n</ul>\n</ul>\n<ul>\n<li><strong>F/X</strong>\n<ul>\n<li>Solarize...\n<li>Swirl...\n<li>Implode...\n<li>Wave...\n<li>Oil Paint...\n<li>Charcoal Draw...\n</ul>\n</ul>\n<ul>\n<li><strong>Image Edit</strong>\n<ul>\n<li>Annotate...\n<li>Draw...\n<li>Color...\n<li>Matte...\n<li>Composite...\n<li>Add Border...\n<li>Add Frame...\n<li>Comment...\n<li>Launch...\n<li>Region of Interest...\n</ul>\n</ul>\n<ul>\n<li><strong>Miscellany</strong>\n<ul>\n<li>Image Info\n<li>Zoom Image\n<li>Show Preview...\n<li>Show Histogram\n<li>Show Matte\n<li>Background...\n<li>Slide Show\n<li>Preferences...\n</ul>\n</ul>\n<ul>\n<li><strong>Help</strong>\n<ul>\n<li>Overview\n<li>Browse Documentation\n<li>About Display\n</ul>\n</ul>\n<p>\nMenu items with a indented triangle have a sub-menu. They are represented\nabove as the indented items. To access a sub-menu item, move the pointer\nto the appropriate menu and press button 1 and drag. When you find the\ndesired sub-menu item, release the button and the command is executed.\nMove the pointer away from the sub-menu if you decide not to execute a\nparticular command.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-keyb\"></a>Keyboard Accelerators\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAccelerators are one or two key presses that effect a particular command.\nThe keyboard accelerators that\n<strong>display</strong> understands is:\n<pre>\n    Ctl+O     Press to <a href=\"#disp-imlo\">load</a> an image from a file.\n    space     Press to display the next image.\n</pre>\n<p>\nIf the image is a multi-paged document such as a\n<em>PostScript</em> document,\nyou can skip ahead several pages by preceding this command with a number.\nFor example to display the fourth page beyond the current page,\npress <tt>4space</tt>.\n<pre>\n    backspace Press to display the former image.\n</pre>\n<p>\nIf the image is a multi-paged document such as a\n<em>PostScript</em> document,\nyou can skip behind several pages by preceding this command with a number.\nFor example to display the fourth page preceding the current page, press\n4n.\n<pre>\n    Ctl-S    Press to save the image to a file.\n    Ctl-P    Press to print the image to a\n             <em>PostScript</em> printer.\n    Ctl-D    Press to delete an image file.\n    Ctl-N    Press to create a blank canvas.\n    Ctl-Q    Press to discard all images and exit program.\n    Ctl+Z    Press to undo last image transformation.\n    Ctl+R    Press to redo last image transformation.\n    Ctl-X    Press to <a href=\"#disp-imcu\">cut</a> a region of\n             the image.\n    Ctl-C    Press to <a href=\"#disp-imco\">copy</a> a region of\n             the image.\n    Ctl-V    Press to <a href=\"#disp-impa\">paste</a> a region to\n             the image.\n    &lt;        Press to halve the image size.\n    .        Press to return to the original image size.\n    &gt;        Press to double the image size.\n    %        Press to resize the image to a width and height\n             you specify.\n    Cmd-A    Press to make any image transformations\n             permanent.\n             By default, any image size transformations are\n             applied to the original image to create the\n             image displayed on the X server.  However, the\n             transformations are not permanent (i.e. the\n             original image does not change size only the\n             X image does). For example, if you press \"&gt;\"\n             the X image will appear to double in size, but\n             the original image will in fact remain the same\n             size.  To force the original image to double in\n             size, press \"&gt;\" followed by \"Cmd-A\".\n    @        Press to refresh the image window.\n    C        Press to <a href=\"#disp-imcr\">crop</a> the image.\n    [        Press to <a href=\"#disp-imch\">chop</a> the image.\n    H        Press to flop image in the horizontal direction.\n    V        Press to flip image in the vertical direction.\n    /        Press to rotate the image 90 degrees clockwise.\n    \\        Press to rotate the image 90 degrees\n             counter-clockwise.\n    *        Press to <a href=\"#disp-imro\">rotate</a> the image\n             the number of degrees you specify.\n    S        Press to shear the image the number of degrees\n             you specify.\n    R        Press to roll the image.\n    T        Press to trim the image edges.\n    Shft-H   Press to vary the color hue.\n    Shft-S   Press to vary the color saturation.\n    Shft-L   Press to vary the image brightness.\n    Shft-G   Press to gamma correct the image.\n    Shft-C   Press to spiff up the image contrast.\n    Shft-Z   Press to dull the image contrast.\n    =        Press to perform histogram equalization on\n             the image.\n    Shft-N   Press to perform histogram normalization on\n             the image.\n    Shft-~   Press to negate the colors of the image.\n    .        Press to convert the image colors to gray.\n    Shft-#   Press to set the maximum number of unique\n             colors in the image.\n    F2       Press to reduce the speckles in an image.\n    F2       Press to emboss an image.\n    F4       Press to eliminate peak noise from an image.\n    F5       Press to add noise to an image.\n    F6       Press to sharpen an image.\n    F7       Press to blur image an image.\n    F8       Press to threshold the image.\n    F9       Press to detect edges within an image.\n    F10      Press to displace pixels by a random amount.\n    F11      Press to shade the image using a distant light\n             source.\n    F12      Press to lighten or darken image edges to\n             create a 3-D effect.\n    F13      Press to segment the image by color.\n    Meta-S   Press to swirl image pixels about the center.\n    Meta-I   Press to implode image pixels about the center.\n    Meta-W   Press to alter an image along a sine wave.\n    Meta-P   Press to simulate an oil painting.\n    Meta-C   Press to simulate a charcoal drawing.\n    Alt-X    Press to <a href=\"#disp-imcomp\">composite</a> the image\n             with another.\n    Alt-A    Press to <a href=\"#disp-iman\">annotate</a> the image with text.\n    Alt-D    Press to <a href=\"#disp-imdr\">draw</a> a line on the image.\n    Alt-P    Press to <a href=\"#disp-cole\">edit an image pixel color</a>.\n    Alt-M    Press to <a href=\"#disp-matt\">edit the image matte</a> information.\n    Alt-X    Press to <a href=\"#disp-imcomp\">composite</a> the image with another.\n    Alt-A    Press to add a border to the image.\n    Alt-F    Press to add a ornamental frame to the image.\n    Alt-Shft-!   Press to add an image comment.\n    Ctl-A    Press to apply image processing techniques to a\n             region of interest.\n    Shft-?   Press to display information about the image.\n    Shft-+   Press to map the zoom image window.\n    Shft-P   Press to preview an image enhancement, effect,\n             or f/x.\n    F1       Press to display helpful information about\n             the \"display\" utility.\n    Find     Press to browse documentation about\n             GraphicsMagick.\n    1-9      Press to change the level of magnification.\n</pre>\n<p>\nUse the arrow keys to move the image one pixel up, down, left, or right\nwithin the magnify window. Be sure to first map the magnify window by pressing\nbutton 2.\n<p>\nPress ALT and one of the arrow keys to trim off one pixel from any side\nof the image.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-xres\"></a>X Resources\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Display</strong> options can appear on the command line or in your X resource\nfile. Options on the command line supersede values specified in your X\nresource file. See <em>X(1)</em> for more information on X resources.\n<p>\nMost <strong>display</strong> options have a corresponding X resource. In addition,\n<strong>display</strong>\nuses the following X resources:\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    background <i>(class Background)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred color to use for the Image window background. The\ndefault is #ccc.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    borderColor <i>(class BorderColor)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred color to use for the Image window border. The default\nis #ccc.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    borderWidth <i>(class BorderWidth)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the width in pixels of the image window border. The default is\n2.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    browseCommand <i>(class browseCommand)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the name of the preferred browser when displaying GraphicsMagick\ndocumentation. The default is <tt>netscape %s</tt>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    confirmExit <i>(class ConfirmExit)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\n<strong>Display</strong> pops up a dialog box to confirm exiting the program when\nexiting the program. Set this resource to <tt>False</tt> to exit without\na confirmation.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    displayGamma <i>(class DisplayGamma)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the gamma of the X server.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nYou can apply separate gamma values to the red, green, and blue channels\nof the image with a gamma value list delineated with slashes (i.e. 1.7/2.3/1.2).</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe default is 2.2.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    displayWarnings <i>(class DisplayWarnings)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\n<strong>Display</strong> pops up a dialog box whenever a warning message occurs.\nSet this resource to <tt>False</tt> to ignore warning messages.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    font <i>(class FontList)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the name of the preferred font to use in normal formatted text.\nThe default is 14 point Helvetica.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    font[1-9] <i>(class Font[1-9])</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the name of the preferred font to use when\n<a href=\"#disp-iman\">annotating</a>\nthe image window with text. The default fonts are fixed, variable, 5x8,\n6x10, 7x13bold, 8x13bold, 9x15bold, 10x20, and 12x24.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    foreground <i>(class Foreground)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred color to use for text within the image window.\nThe default is black.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    gammaCorrect <i>(class gammaCorrect)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource, if true, will lighten or darken an image of known gamma\nto match the gamma of the display (see resource <strong>displayGamma</strong>). The\ndefault is True.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    geometry <i>(class Geometry)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred size and position of the image window. It is not\nnecessarily obeyed by all window managers.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nOffsets, if present, are handled in <em>X(1)</em> style.  A negative x offset is\nmeasured from the right edge of the screen to the right edge of the icon,\nand a negative y offset is measured from the bottom edge of the screen\nto the bottom edge of the icon.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    iconGeometry <i>(class IconGeometry)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred size and position of the application when iconified.\nIt is not necessarily obeyed by all window managers.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nOffsets, if present, are handled in the same manner as in class Geometry.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    iconic <i>(class Iconic)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource indicates that you would prefer that the application's windows\ninitially not be visible as if the windows had be immediately iconified\nby you. Window managers may choose not to honor the application's request.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    magnify <i>(class Magnify)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nspecifies an integral factor by which the image should be enlarged. The\ndefault is 3.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis value only affects the magnification window which is invoked with\n<a href=\"#disp-mous\">button</a>\nnumber 3 after the image is displayed.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    matteColor <i>(class MatteColor)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecify the color of windows. It is used for the backgrounds of windows,\nmenus, and notices. A 3D effect is achieved by using highlight and shadow\ncolors derived from this color. Default value: #697B8F.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    name <i>(class Name)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource specifies the name under which resources for the application\nshould be found. This resource is useful in shell aliases to distinguish\nbetween invocations of an application, without resorting to creating links\nto alter the executable file name. The default is the application name.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    pen[1-9] <i>(class Pen[1-9])</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the color of the preferred font to use when\n<a href=\"#disp-iman\">annotating</a>\nthe image window with text. The default colors are black, blue, green,\ncyan, gray, red, magenta, yellow, and white.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    printCommand <i>(class PrintCommand)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis command is executed whenever Print is issued.  In general, it is the\ncommand to print <em>PostScript</em> to your printer. Default value: <tt>lp\n-c -s %i</tt>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    sharedMemory <i>(class SharedMemory)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource specifies whether display should attempt use shared memory\nfor pixmaps. GraphicsMagick must be compiled with shared memory support,\nand the display must support the MIT-SHM extension. Otherwise, this\nresource is ignored. The default is True.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    textFont <i>(class textFont)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the name of the preferred font to use in fixed (typewriter style)\nformatted text. The default is 14 point Courier.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    title <i>(class Title)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource specifies the title to be used for the image window. This\ninformation is sometimes used by a window manager to provide a header identifying\nthe window. The default is the image file name.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    undoCache <i>(class UndoCache)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies, in mega-bytes, the amount of memory in the undo edit cache.\nEach time you modify the image it is saved in the undo edit cache as long\nas memory is available. You can subsequently <em>undo</em> one or more of\nthese transformations. The default is 16 Megabytes.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    usePixmap <i>(class UsePixmap)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nImages are maintained as a XImage by default. Set this resource to True\nto utilize a server Pixmap instead. This option is useful if your image\nexceeds the dimensions of your server screen and you intend to pan the\nimage. Panning is much faster with Pixmaps than with a XImage. Pixmaps\nare considered a precious resource, use them with discretion.</td></tr></table>\n<p>\nTo set the geometry of the Magnify or Pan or window, use the geometry resource.\nFor example, to set the Pan window geometry to 256x256, use:\n<pre>\n    gm display.pan.geometry: 256x256\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imlo\"></a>Image Loading\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo select an image to display, choose <strong>Open</strong> of the <strong>File</strong> sub-menu\nfrom the <a href=\"#disp-comm\">Command widget</a>. A file browser is displayed.\nTo choose a particular image file, move the pointer to the filename and\npress any button. The filename is copied to the text window. Next, press\n<strong>Open</strong>\nor press the <strong>RETURN</strong> key. Alternatively, you can type the image file\nname directly into the text window. To descend directories, choose a directory\nname and press the button twice quickly. A scrollbar allows a large list\nof filenames to be moved through the viewing area if it exceeds the size\nof the list area.\n<p>\nYou can trim the list of file names by using shell globbing characters.\nFor example, type <tt>*.jpg</tt> to list only files that end\nwith <tt>.jpg</tt>.\n<p>\nTo select your image from the X server screen instead of from a file, Choose\n<strong>Grab</strong> of the <strong>Open</strong> widget.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-visu\"></a>Visual Image Directory\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo create a Visual Image Directory, choose Visual Directory of the <strong>File</strong>\nsub-menu from the <a href=\"#disp-comm\">Command widget</a> . A file browser is\ndisplayed. To create a Visual Image Directory from all the images in the\ncurrent directory, press <strong>Directory</strong> or press the <strong>RETURN key</strong>.\nAlternatively, you can select a set of image names by using shell globbing\ncharacters. For example, type <tt>*.jpg</tt> to include only files that\nend with <tt>.jpg</tt>. To descend directories, choose a directory name\nand press the button twice quickly. A scrollbar allows a large list of\nfilenames to be moved through the viewing area if it exceeds the size of\nthe list area.\n<p>\nAfter you select a set of files, they are turned into thumbnails and tiled\nonto a single image. Now move the pointer to a particular thumbnail and\npress <strong>button 3</strong> and drag. Finally, select Open. The image represented\nby the thumbnail is displayed at its full size. Choose <strong>Next</strong> from\nthe <strong>File</strong> sub-menu of the Command widget to return to the Visual\nImage Directory.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imcu\"></a>Image Cutting\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nNote that cut information for image window is not retained for colormapped\nX server visuals (e.g. <em>StaticColor</em>,\n<em>StaticColor</em>, <em>GRAYScale</em>,\n<em>PseudoColor</em>).\nCorrect cutting behavior may require a <em>TrueColor</em> or <em>DirectColor</em>\nvisual or a <em>Standard Colormap</em>.\n<p>\nTo begin, press choose <strong>Cut</strong> of the <strong>Edit</strong> sub-menu from the\n<a href=\"#disp-comm\">Command\nwidget</a>. Alternatively, press\n<strong>F3</strong> in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in cut mode. In cut mode, the Command widget has these\noptions:\n<ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nTo define a cut region, press button 1 and drag. The cut region is defined\nby a highlighted rectangle that expands or contracts as it follows the\npointer. Once you are satisfied with the cut region, release the button.\nYou are now in rectify mode. In rectify mode, the Command widget has these\noptions:\n<ul>\n<li><strong>Cut</strong>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nYou can make adjustments by moving the pointer to one of the cut rectangle\ncorners, pressing a button, and dragging. Finally, press Cut to commit\nyour copy region. To exit without cutting the image, press Dismiss.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imco\"></a>Image Copying\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo begin, press choose <strong>Copy</strong> of the <strong>Edit</strong> sub-menu from the\n<a href=\"#disp-comm\">Command\nwidget</a>. Alternatively, press\n<strong>F4</strong> in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in copy mode. In copy mode, the Command widget has\nthese options:\n<ul>\n<li>Help\n<li>Dismiss\n</ul>\n<p>\nTo define a copy region, press button 1 and drag. The copy region is defined\nby a highlighted rectangle that expands or contracts as it follows the\npointer. Once you are satisfied with the copy region, release the button.\nYou are now in rectify mode. In rectify mode, the Command widget has these\noptions:\n<ul>\n<li>Copy\n<li>Help\n<li>Dismiss\n</ul>\n<p>\nYou can make adjustments by moving the pointer to one of the copy rectangle\ncorners, pressing a button, and dragging. Finally, press Copy to commit\nyour copy region. To exit without copying the image, press Dismiss.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-impas\"></a>Image Pasting\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo begin, press choose <strong>Paste</strong> of the <strong>Edit</strong> sub-menu from the\n<a href=\"#disp-comm\">Command\nwidget</a>. Alternatively, press\n<strong>F5</strong> in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in Paste mode. To exit immediately, press Dismiss.\nIn Paste mode, the Command widget has these options:\n<ul>\n<li><strong>Operators</strong>\n<ul>\n<li>over\n<li>in\n<li>out\n<li>atop\n<li>xor\n<li>plus\n<li>minus\n<li>add\n<li>subtract\n<li>difference\n<li>multiply\n<li>bumpmap\n<li>replace\n</ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nChoose a composite operation from the <strong>Operators</strong> sub-menu of the\n<a href=\"#disp-comm\">Command\nwidget</a>. How each operator behaves is described below. <em>image window</em>\nis the image currently displayed on your X server and <em>image</em> is the\nimage obtained with the File Browser widget.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    over\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the union of the two image shapes, with <em>image</em> obscuring\n<em>image\nwindow</em> in the region of overlap.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    in\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is simply <em>image</em> cut by the shape of\n<em>image window</em>.\nNone of the image data of image window is in the result.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    out\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe resulting image is <em>image</em> with the shape of\n<em>image window</em>\ncut out.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    atop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the same shape as <em>image window</em>, with\n<em>image</em>\nobscuring <em>image window</em> where the image shapes overlap. Note this\ndiffers from over because the portion of image outside\n<em>image window</em>'s\nshape does not appear in the result.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    xor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the image data from both <em>image</em> and\n<em>image window</em>\nthat is outside the overlap region. The overlap region is blank.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    plus\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is just the sum of the image data. Output values are cropped\nto the maximum value (no overflow). This operation is independent of the\nmatte channels.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    minus\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> - <em>image window</em>, with underflow cropped\nto zero. The matte channel is ignored (set to opaque, full coverage).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    add\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> + <em>image window</em>, with overflow wrapping\naround (mod MaxRGB+1).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    subtract\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> - <em>image window</em>, with underflow wrapping\naround (mod MaxRGB+1). The add and subtract operators can be used to perform\nreversible transformations.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    difference\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of abs(<em>image</em> - <em>image window</em>). This is useful for\ncomparing two very similar images.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    multiply\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> * <em>image window</em>. This is useful for\nthe creation of drop-shadows.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    bumpmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image window</em> shaded by <em>window</em>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    replace\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>The resulting image is <em>image window</em> replaced with\n<em>image</em>.\nHere the matte information is ignored.</td></tr></table>\n<p>\nThe image compositor requires a matte, or alpha channel in the image for\nsome operations. This extra channel usually defines a mask which represents\na sort of a cookie-cutter for the image. This is the case when matte is\n255 (full coverage) for pixels inside the shape, zero outside, and between\nzero and 255 on the boundary. If image does not have a matte channel, it\nis initialized with 0 for any pixel matching in color to pixel location\n(0,0), otherwise 255. See <a href=\"#disp-matt\">Matte Editing</a> for a method\nof defining a matte channel.\n<p>\nNote that matte information for image window is not retained for colormapped\nX server visuals (e.g. <em>StaticColor, StaticColor, GrayScale, PseudoColor</em>).\nCorrect compositing behavior may require a\n<em>TrueColor</em> or <em>DirectColor</em>\nvisual or a <em>Standard Colormap</em>.\n<p>\nChoosing a composite operator is optional. The default operator is replace.\nHowever, you must choose a location to composite your image and press button\n1. Press and hold the button before releasing and an outline of the image\nwill appear to help you identify your location.\n<p>\nThe actual colors of the pasted image is saved. However, the color that\nappears in image window may be different. For example, on a monochrome\nscreen image window will appear black or white even though your pasted\nimage may have many colors. If the image is saved to a file it is written\nwith the correct colors. To assure the correct colors are saved in the\nfinal image, any <em>PseudoClass</em> image is promoted to <em>DirectClass</em>.\nTo force a\n<em>PseudoClass</em> image to remain <em>PseudoClass</em>,\nuse <strong>-colors</strong>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imcr\"></a>Image Cropping\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo begin, press choose <strong>Crop</strong> of the <strong>Transform</strong> submenu from\nthe <a href=\"#disp-comm\">Command widget</a>. Alternatively,\n<a href=\"#disp-keyb\">press</a> C in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in crop mode. In crop mode, the Command widget has\nthese options:\n<ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nTo define a cropping region, press button 1 and drag. The cropping region\nis defined by a highlighted rectangle that expands or contracts as it follows\nthe pointer. Once you are satisfied with the cropping region, release the\nbutton. You are now in rectify mode. In rectify mode, the Command widget\nhas these options:\n<ul>\n<li><strong>Crop</strong>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nYou can make adjustments by moving the pointer to one of the cropping rectangle\ncorners, pressing a button, and dragging. Finally, press Crop to commit\nyour cropping region. To exit without cropping the image, press Dismiss.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imch\"></a>Image Chopping\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAn image is chopped interactively. There is no command line argument to\nchop an image. To begin, choose <strong>Chop</strong> of the <strong>Transform</strong> sub-menu\nfrom the <a href=\"#disp-comm\">Command widget</a>. Alternatively,\n<a href=\"#disp-keyb\">press</a> [ in the Image window.\n<p>\nYou are now in <strong>Chop</strong> mode. To exit immediately, press\n<strong>Dismiss</strong>.\nIn Chop mode, the Command widget has these options:\n<ul>\n<li><strong>Direction</strong>\n<ul>\n<li>horizontal\n<li>vertical\n</ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nIf the you choose the horizontal direction (this is the default), the area\nof the image between the two horizontal endpoints of the chop line is removed.\nOtherwise, the area of the image between the two vertical endpoints of\nthe chop line is removed.\n<p>\nSelect a location within the image window to begin your chop, press and\nhold any button. Next, move the pointer to another location in the image.\nAs you move a line will connect the initial location and the pointer. When\nyou release the button, the area within the image to chop is determined\nby which direction you choose from the Command widget.\n<p>\nTo cancel the image chopping, move the pointer back to the starting point\nof the line and release the button.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imro\"></a>Image Rotation\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nPress the / key to rotate the image 90 degrees or \\ to rotate -90 degrees.\nTo interactively choose the degree of rotation, choose\n<strong>Rotate...</strong>\nof the <strong>Transform</strong> submenu from the <a href=\"#disp-comm\">Command Widget</a>.\nAlternatively, <a href=\"#disp-keyb\">press</a> * in the image window.\n<p>\nA small horizontal line is drawn next to the pointer. You are now in rotate\nmode. To exit immediately, press Dismiss. In rotate mode, the Command widget\nhas these options:\n<ul>\n<li><strong>Pixel Color</strong>\n<ul>\n<li>black\n<li>blue\n<li>cyan\n<li>green\n<li>gray\n<li>red\n<li>magenta\n<li>yellow\n<li>white\n<li>Browser...\n</ul>\n<li><strong>Direction</strong>\n<ul>\n<li>horizontal\n<li>vertical\n</ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nChoose a background color from the Pixel Color sub-menu. Additional background\ncolors can be specified with the color browser. You can change the menu\ncolors by setting the <a href=\"#disp-xres\">X resources</a> pen1 through pen9.\n<p>\nIf you choose the color browser and press <strong>Grab</strong>, you can select the\nbackground color by moving the pointer to the desired color on the screen\nand press any button.\n<p>\nChoose a point in the image window and press this button and hold. Next,\nmove the pointer to another location in the image. As you move a line connects\nthe initial location and the pointer. When you release the button, the\ndegree of image rotation is determined by the slope of the line you just\ndrew. The slope is relative to the direction you choose from the Direction\nsub-menu of the Command widget.\n<p>\nTo cancel the image rotation, move the pointer back to the starting point\nof the line and release the button.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-segm\"></a>Image Segmentation\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nChoose <strong>Effects-&gt;Segment</strong> to segment an image by analyzing the histograms\nof the color components and identifying units that are homogeneous with\nthe fuzzy c-means technique. The scale-space filter analyzes the histograms\nof the three color components of the image and identifies a set of classes.\nThe extents of each class is used to coarsely segment the image with thresholding.\nThe color associated with each class is determined by the mean color of\nall pixels within the extents of a particular class. Finally, any unclassified\npixels are assigned to the closest class with the fuzzy c-means technique.\n<p>The fuzzy c-Means algorithm can be summarized as follows:\n<ul>\n<li>\nBuild a histogram, one for each color component of the image.\n<li>\nFor each histogram, successively apply the scale-space filter and build\nan interval tree of zero crossings in the second derivative at each scale.\nAnalyze this scale-space \"fingerprint\" to determine which peaks or valleys\nin the histogram are most predominant.\n<li>\nThe fingerprint defines intervals on the axis of the histogram. Each interval\ncontains either a minima or a maxima in the original signal. If each color\ncomponent lies within the maxima interval, that pixel is considered \"classified\"\nand is assigned an unique class number.\n<li>\nAny pixel that fails to be classified in the above thresholding pass is\nclassified using the fuzzy c-Means technique. It is assigned to one of\nthe classes discovered in the histogram analysis phase.\n</ul>\n<p>\nThe fuzzy c-Means technique attempts to cluster a pixel by finding the\nlocal minima of the generalized within group sum of squared error objective\nfunction. A pixel is assigned to the closest class of which the fuzzy membership\nhas a maximum value.\n<p>\nFor additional information see:\n<blockquote><em>Young Won Lim, Sang Uk Lee</em>, \"<strong>On The Color Image Segmentation\nAlgorithm Based on the Thresholding and the Fuzzy c-Means Techniques</strong>\",\nPattern Recognition, Volume 23, Number 9, pages 935-952, 1990.</blockquote>\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-iman\"></a>Image Annotation\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAn image is annotated interactively. There is no command line argument\nto annotate an image. To begin, choose\n<strong>Annotate</strong> of the <strong>Image\nEdit</strong> sub-menu from the <a href=\"#disp-comm\">Command widget</a>. Alternatively,\n<a href=\"#disp-keyb\">press</a> a in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in annotate mode. To exit immediately, press Dismiss.\nIn annotate mode, the Command widget has these options:\n<ul>\n<li>\n<strong>Font Name</strong>\n<ul>\n<li>\nfixed\n<li>\nvariable\n<li>\n5x8\n<li>\n6x10\n<li>\n7x13bold\n<li>\n8x13bold\n<li>\n9x15bold\n<li>\n10x20\n<li>\n12x24\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Font Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\ntransparent\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Box Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\ntransparent\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Rotate Text</strong>\n<ul>\n<li>\n-90\n<li>\n-45\n<li>\n-30\n<li>\n0\n<li>\n30\n<li>\n45\n<li>\n90\n<li>\n180\n<li>\nDialog...\n</ul>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nChoose a font name from the <strong>Font Name</strong> sub-menu. Additional font\nnames can be specified with the font browser. You can change the menu names\nby setting the <a href=\"#disp-xres\">X resources</a> font1 through font9.\n<p>\nChoose a font color from the <strong>Font Color</strong> sub-menu. Additional font\ncolors can be specified with the color browser. You can change the menu\ncolors by setting the <a href=\"#disp-xres\">X resources</a> pen1 through pen9.\n<p>\nIf you select the color browser and press <strong>Grab</strong>, you can choose the\nfont color by moving the pointer to the desired color on the screen and\npress any button.\n<p>\nIf you choose to rotate the text, choose <strong>Rotate Text</strong> from the menu\nand select an angle. Typically you will only want to rotate one line of\ntext at a time. Depending on the angle you choose, subsequent lines may\nend up overwriting each other.\n<p>\nChoosing a font and its color is optional. The default font is fixed and\nthe default color is black. However, you must choose a location to begin\nentering text and press a button. An underscore character will appear at\nthe location of the pointer. The cursor changes to a pencil to indicate\nyou are in text mode. To exit immediately, press Dismiss.\n<p>\nIn text mode, any key presses will display the character at the location\nof the underscore and advance the underscore cursor. Enter your text and\nonce completed press Apply to finish your image annotation. To correct\nerrors press <strong>BACK SPACE</strong>. To delete an entire line of text, press\n<strong>DELETE</strong>.\nAny text that exceeds the boundaries of the image window is automatically\ncontinued onto the next line.\n<p>\nThe actual color you request for the font is saved in the image. However,\nthe color that appears in your Image window may be different. For example,\non a monochrome screen the text will appear black or white even if you\nchoose the color red as the font color. However, the image saved to a file\nwith <strong>-write</strong> is written with red lettering. To assure the correct\ncolor text in the final image, any <em>PseudoClass</em> image is promoted\nto <em>DirectClass</em> (see miff(5)). To force a <em>PseudoClass</em> image\nto remain\n<em>PseudoClass</em>, use <strong>-colors</strong>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imcomp\"></a>Image Compositing\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAn image composite is created interactively. <strong>There is no command line\nargument to composite an image</strong>. To begin, choose <strong>Composite</strong> of\nthe <strong>Image Edit</strong> from the <a href=\"#disp-comm\">Command widget</a>. Alternatively,\n<a href=\"#disp-keyb\">press</a> x in the Image window.\n<p>\nFirst a popup window is displayed requesting you to enter an image name.\nPress <strong>Composite</strong>, <strong>Grab</strong> or type a file name. Press <strong>Cancel</strong>\nif you choose not to create a composite image. When you choose <strong>Grab</strong>,\nmove the pointer to the desired window and press any button.\n<p>\nIf the <strong>Composite</strong> image does not have any matte information, you\nare informed and the file browser is displayed again. Enter the name of\na mask image. The image is typically grayscale and the same size as the\ncomposite image. If the image is not grayscale, it is converted to grayscale\nand the resulting intensities are used as matte information.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in composite mode. To exit immediately, press Dismiss.\nIn composite mode, the Command widget has these options:\n<ul>\n<li>\n<strong>Operators</strong>\n<ul>\n<li>\nover\n<li>\nin\n<li>\nout\n<li>\natop\n<li>\nxor\n<li>\nplus\n<li>\nminus\n<li>\nadd\n<li>\nsubtract\n<li>\ndifference\n<li>\nbumpmap\n<li>\nreplace\n</ul>\n<li>\n<strong>Blend</strong>\n<li>\n<strong>Displace</strong>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nChoose a composite operation from the Operators sub-menu of the Command\nwidget. How each operator behaves is described below. image window is the\nimage currently displayed on your X server and image is the image obtained\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    over\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the union of the two image shapes, with <em>image</em> obscuring\n<em>image\nwindow</em> in the region of overlap.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    in\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is simply <em>image</em> cut by the shape of\n<em>image window</em>.\nNone of the image data of image window is in the result.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    out\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe resulting image is <em>image</em> with the shape of\n<em>image window</em>\ncut out.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    atop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the same shape as <em>image window</em>, with\n<em>image</em>\nobscuring <em>image window</em> where the image shapes overlap. Note this\ndiffers from over because the portion of image outside\n<em>image window</em>'s\nshape does not appear in the result.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    xor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the image data from both <em>image</em> and\n<em>image window</em>\nthat is outside the overlap region. The overlap region is blank.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    plus\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is just the sum of the image data. Output values are cropped\nto 255 (no overflow). This operation is independent of the matte channels.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    minus\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> - <em>image window</em>, with underflow cropped\nto zero. The matte channel is ignored (set to 255, full coverage).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    add\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> + <em>image window</em>, with overflow wrapping\naround (mod 256).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    subtract\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> - <em>image window</em>, with underflow wrapping\naround (mod 256). The add and subtract operators can be used to perform\nreversible transformations.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    difference\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of abs(<em>image</em> - <em>image window</em>). This is useful for\ncomparing two very similar images.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    bumpmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image window</em> shaded by <em>window</em>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    replace\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe resulting image is <em>image window</em> replaced with\n<em>image</em>.\nHere the matte information is ignored.</td></tr></table>\n<p>\nThe image compositor requires a matte, or alpha channel in the image for\nsome operations. This extra channel usually defines a mask which represents\na sort of a cookie-cutter for the image. This is the case when matte is\n255 (full coverage) for pixels inside the shape, zero outside, and between\nzero and 255 on the boundary. If image does not have a matte channel, it\nis initialized with 0 for any pixel matching in color to pixel location\n(0,0), otherwise 255. See <a href=\"#disp-matt\">Matte Editing</a> for a method\nof defining a matte channel.\n<p>\nIf you choose <strong>blend</strong>, the composite operator becomes <strong>over</strong>.\nThe image matte channel percent transparency is initialized to factor.\nThe image window is initialized to (100-factor). Where factor is the value\nyou specify in the Dialog widget.\n<p>\n<strong>Displace</strong> shifts the image pixels as defined by a displacement map.\nWith this option, <em>image</em> is used as a displacement map. Black, within\nthe displacement map, is a maximum positive displacement. White is a maximum\nnegative displacement and middle gray is neutral. The displacement is scaled\nto determine the pixel shift. By default, the displacement applies in both\nthe horizontal and vertical directions. However, if you specify\n<em>mask</em>,\n<em>image</em>\nis the horizontal X displacement and\n<em>mask</em> the vertical Y displacement.\n<p>\nNote that matte information for image window is not retained for colormapped\nX server visuals (e.g.\n<em>StaticColor, StaticColor, GrayScale, PseudoColor</em>).\nCorrect compositing behavior may require a <em>TrueColor</em> or\n<em>DirectColor</em>\nvisual or a <em>Standard Colormap</em>.\n<p>\nChoosing a composite operator is optional. The default operator is replace.\nHowever, you must choose a location to composite your image and press button\n1. Press and hold the button before releasing and an outline of the image\nwill appear to help you identify your location.\n<p>\nThe actual colors of the composite image is saved. However, the color that\nappears in image window may be different. For example, on a monochrome\nscreen Image window will appear black or white even though your composited\nimage may have many colors. If the image is saved to a file it is written\nwith the correct colors. To assure the correct colors are saved in the\nfinal image, any PseudoClass image is promoted to <em>DirectClass</em> (see\n<a href=\"miff.html\">miff</a>).\nTo force a <em>PseudoClass</em> image to remain <em>PseudoClass</em>,\nuse <strong>-colors</strong>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-cole\"></a>Color Editing\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nChanging the the color of a set of pixels is performed interactively. There\nis no command line argument to edit a pixel. To begin, choose <strong>Color</strong>\nfrom the <strong>Image Edit</strong> submenu of the <a href=\"#disp-comm\">Command widget</a>.\nAlternatively, <a href=\"#disp-keyb\">press</a> c in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in color edit mode. To exit immediately, press <strong>Dismiss</strong>.\nIn color edit mode, the\n<strong>Command widget</strong> has these options:\n<ul>\n<li>\n<strong>Method</strong>\n<ul>\n<li>\npoint\n<li>\nreplace\n<li>\nfloodfill\n<li>\nreset\n</ul>\n<li>\n<strong>Pixel Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Border Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Fuzz</strong>\n<ul>\n<li>\n0\n<li>\n2\n<li>\n4\n<li>\n8\n<li>\n16\n<li>Dialog...\n</ul>\n<li>\n<strong>Undo</strong>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nChoose a color editing method from the <strong>Method</strong> sub-menu of\nthe <a href=\"#disp-comm\">Command\nwidget</a>. The <strong>point method</strong> recolors any pixel selected with the\npointer unless the button is released. The <strong>replace method</strong> recolors\nany pixel that matches the color of the pixel you select with a button\npress. <strong>Floodfill</strong> recolors any pixel that matches the color of the\npixel you select with a button press and is a neighbor.\nWhereas <strong>filltoborder</strong>\nchanges the matte value of any neighbor pixel that is not the border color.\nFinally <strong>reset</strong> changes the entire image to the designated color.\n<p>\nNext, choose a pixel color from the <strong>Pixel Color</strong> sub-menu. Additional\npixel colors can be specified with the color browser. You can change the\nmenu colors by setting the <a href=\"#disp-xres\">X resources</a> pen1 through\npen9.\n<p>\nNow press button 1 to select a pixel within the Image window to change\nits color. Additional pixels may be recolored as prescribed by the method\nyou choose. additional pixels by increasing the Delta value.\n<p>\nIf the <strong>Magnify widget</strong> is mapped, it can be helpful in positioning\nyour pointer within the image (refer to button 2). Alternatively you can\nselect a pixel to recolor from within the <strong>Magnify widget</strong>. Move the\npointer to the <strong>Magnify widget</strong> and position the pixel with the cursor\ncontrol keys. Finally, press a button to recolor the selected pixel (or\npixels).\n<p>\nThe actual color you request for the pixels is saved in the image. However,\nthe color that appears in your Image window may be different. For example,\non a monochrome screen the pixel will appear black or white even if you\nchoose the color red as the pixel color. However, the image saved to a\nfile with -write is written with red pixels. To assure the correct color\ntext in the final image, any <em>PseudoClass</em> image is promoted\nto <em>DirectClass</em>\nTo force a <em>PseudoClass</em> image to remain\n<em>PseudoClass</em>, use <strong>-colors</strong>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-matt\"></a>Matte Editing\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nMatte information within an image is useful for some operations such as\nimage <a href=\"#disp-imcomp\">compositing</a>. This extra channel usually defines\na mask which represents a sort of a cookie-cutter for the image. This is\nthe case when matte is 255 (full coverage) for pixels inside the shape,\nzero outside, and between zero and 255 on the boundary.\n<p>\nSetting the matte information in an image is done interactively. There\nis no command line argument to edit a pixel. To begin, and choose <strong>Matte</strong>\nof the <strong>Image Edit</strong> sub-menu from the <a href=\"#disp-comm\">Command widget</a>.\n<p>\nAlternatively, <a href=\"#disp-keyb\">press</a> m in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in matte edit mode. To exit immediately, press Dismiss.\nIn matte edit mode, the Command widget has these options:\n<ul>\n<li>\n<strong>Method</strong>\n<ul>\n<li>\npoint\n<li>\nreplace\n<li>\nfloodfill\n<li>\nreset\n</ul>\n<li>\n<strong>Border Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Fuzz</strong>\n<ul>\n<li>\n0\n<li>\n2\n<li>\n4\n<li>\n8\n<li>\n16\n<li>Dialog...\n</ul>\n<li>\n<strong>Matte</strong>\n<li>\n<strong>Undo</strong>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\nChoose a matte editing method from the <strong>Method</strong> sub-menu of the <a href=\"#disp-comm\">Command\nwidget</a>. The <strong>point method</strong> changes the matte value of the any\npixel selected with the pointer until the button is released. The <strong>replace\nmethod</strong> changes the matte value of any pixel that matches the color\nof the pixel you select with a button press. <strong>Floodfill</strong> changes the\nmatte value of any pixel that matches the color of the pixel you select\nwith a button press and is a neighbor. Whereas\n<strong>filltoborder</strong> recolors\nany neighbor pixel that is not the border color. Finally <strong>reset</strong> changes\nthe entire image to the designated matte value.\n<p>Choose <strong>Matte Value</strong> and a dialog appears requesting a matte value.\nEnter a value between <strong>0 and 255</strong>. This value is assigned as the matte\nvalue of the selected pixel or pixels.\n<p>Now, press any button to select a pixel within the Image window to change\nits matte value. You can change the matte value of additional pixels by\nincreasing the Delta value. The Delta value is first added then subtracted\nfrom the red, green, and blue of the target color. Any pixels within the\nrange also have their matte value updated.\n<p>If the <strong>Magnify widget</strong> is mapped, it can be helpful in positioning\nyour pointer within the image (refer to button 2). Alternatively you can\nselect a pixel to change the matte value from within the\n<strong>Magnify widget</strong>.\nMove the pointer to the <strong>Magnify widget</strong> and position the pixel with\nthe cursor control keys. Finally, press a button to change the matte value\nof the selected pixel (or pixels).\n<p>Matte information is only valid in a <em>DirectClass image</em>. Therefore,\nany <em>PseudoClass</em> image is promoted to\n<em>DirectClass</em>. Note that\nmatte information for <em>PseudoClass</em> is not retained for colormapped\nX server visuals (e.g. <em>StaticColor, StaticColor, GrayScale, PseudoColor</em>)\nunless you immediately save your image to a file (refer to Write). Correct\nmatte editing behavior may require a <em>TrueColor</em> or <em>DirectColor</em>\nvisual or a <em>Standard Colormap</em>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imdr\"></a>Image Drawing\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAn image is drawn upon interactively. <strong>There is no command line argument\nto draw on an image</strong>. To begin, choose <strong>Draw</strong> of the Image <strong>Edit</strong>\nsub-menu from the <a href=\"#disp-comm\">Command widget</a>.\nAlternatively, <a href=\"#disp-keyb\">press</a> d in the image window.\n<p>\nThe cursor changes to a crosshair to indicate you are in draw mode. To\nexit immediately, press Dismiss. In draw mode, the Command widget has these\noptions:\n<ul>\n<li>\n<strong>Primitive</strong>\n<ul>\n<li>\npoint\n<li>\nline\n<li>\nrectangle\n<li>\nfill rectangle\n<li>\ncircle\n<li>\nfill circle\n<li>\nellipse\n<li>\nfill ellipse\n<li>\npolygon\n<li>\nfill polygon\n</ul>\n<li>\n<strong>Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\ntransparent\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Stipple</strong>\n<ul>\n<li>\nBrick\n<li>\nDiagonal\n<li>\nScales\n<li>\nVertical\n<li>\nWavy\n<li>\nTranslucent\n<li>\nOpaque\n<li>\nOpen...\n</ul>\n<li>\n<strong>Width</strong>\n<ul>\n<li>\n1\n<li>\n2\n<li>\n4\n<li>\n8\n<li>\n16\n<li>Dialog...\n</ul>\n<li>\n<strong>Undo</strong>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\nChoose a drawing primitive from the <strong>Primitive</strong> sub-menu.\n<p>\nNext, choose a color from the <strong>Color</strong> sub-menu. Additional colors\ncan be specified with the color browser. You can change the menu colors\nby setting the <a href=\"#disp-xres\">X resources</a> pen1 through pen9. The transparent\ncolor updates the image matte channel and is useful for image compositing.\n<p>\nIf you choose the color browser and press <strong>Grab</strong>, you can select the\nprimitive color by moving the pointer to the desired color on the screen\nand press any button. The transparent color updates the image matte channel\nand is useful for image compositing.\n<p>\nChoose a stipple, if appropriate, from the <strong>Stipple</strong> sub-menu. Additional\nstipples can be specified with the file browser. Stipples obtained from\nthe file browser must be on disk in the X11 bitmap format.\n<p>\nChoose a line width, if appropriate, from the <strong>Width</strong> sub-menu. To\nchoose a specific width select the <strong>Dialog</strong> widget.\n<p>\nChoose a point in the image window and press button 1 and hold. Next, move\nthe pointer to another location in the image. As you move, a line connects\nthe initial location and the pointer. When you release the button, the\nimage is updated with the primitive you just drew. For polygons, the image\nis updated when you press and release the button without moving the pointer.\n<p>\nTo cancel image drawing, move the pointer back to the starting point of\nthe line and release the button.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-regi\"></a>Region of Interest\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo begin, press choose Region of Interest of the Pixel Transform sub-menu\nfrom the <a href=\"#disp-comm\">Command widget</a>.\nAlternatively, <a href=\"#disp-keyb\">press</a> R in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in region of interest mode. In region of interest mode,\nthe Command widget has these options:\n<ul>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nTo define a region of interest, press button 1 and drag. The region of\ninterest is defined by a highlighted rectangle that expands or contracts\nas it follows the pointer. Once you are satisfied with the region of interest,\nrelease the button. You are now in apply mode. In apply mode the Command\nwidget has these options:\n<ul>\n<li>\n<strong>File</strong>\n<ul>\n<li>\nSave...\n<li>\nPrint...\n</ul>\n<li>\n<strong>Edit</strong>\n<ul>\n<li>\nUndo\n<li>\nRedo\n</ul>\n<li>\n<strong>Transform</strong>\n<ul>\n<li>\nFlip\n<li>\nFlop\n<li>\nRotate Right\n<li>\nRotate Left\n</ul>\n<li>\n<strong>Enhance</strong>\n<ul>\n<li>\nHue...\n<li>\nSaturation...\n<li>\nBrightness...\n<li>\nGamma...\n<li>\nSpiff\n<li>\nDull\n<li>\nEqualize\n<li>\nNormalize\n<li>\nNegate\n<li>\nGRAYscale\n<li>\nQuantize...\n</ul>\n<li>\n<strong>Effects</strong>\n<ul>\n<li>\nDespeckle\n<li>\nEmboss\n<li>\nReduce Noise\n<li>\nAdd Noise\n<li>\nSharpen...\n<li>\nBlur...\n<li>\nThreshold...\n<li>\nEdge Detect...\n<li>\nSpread...\n<li>\nShade...\n<li>\nRaise...\n<li>\nSegment...\n</ul>\n</ul>\n<ul>\n<li>\n<strong>F/X</strong>\n<ul>\n<li>\nSolarize...\n<li>\nSwirl...\n<li>\nImplode...\n<li>\nWave...\n<li>\nOil Paint\n<li>\nCharcoal Draw...\n</ul>\n</ul>\n<ul>\n<li>\n<strong>Miscellany</strong>\n<ul>\n<li>\nImage Info\n<li>\nZoom Image\n<li>\nShow Preview...\n<li>\nShow Histogram\n<li>\nShow Matte\n</ul>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nYou can make adjustments to the region of interest by moving the pointer\nto one of the rectangle corners, pressing a button, and dragging. Finally,\nchoose an image processing technique from the Command widget. You can choose\nmore than one image processing technique to apply to an area. Alternatively,\nyou can move the region of interest before applying another image processing\ntechnique. To exit, press Dismiss.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-impa\"></a>Image Panning\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nWhen an image exceeds the width or height of the X server screen, display\nmaps a small panning icon. The rectangle within the panning icon shows\nthe area that is currently displayed in the the image window. To pan about\nthe image, press any button and drag the pointer within the panning icon.\nThe pan rectangle moves with the pointer and the image window is updated\nto reflect the location of the rectangle within the panning icon. When\nyou have selected the area of the image you wish to view, release the button.\n<p>\nUse the arrow keys to pan the image one pixel up, down, left, or right\nwithin the image window.\n<p>\nThe panning icon is withdrawn if the image becomes smaller than the dimensions\nof the X server screen.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-pref\"></a>User Preferences\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nPreferences affect the default behavior of <strong>display(1)</strong>. The preferences\nare either true or false and are stored in your home directory\nas <tt>.displayrc</tt>:\n<dl>\n<dt>\n<strong>display image centered on a backdrop</strong></dt>\n<dd>\nThis backdrop covers the entire workstation screen and is useful for hiding\nother X window activity while viewing the image. The color of the backdrop\nis specified as the background color. Refer to <a href=\"#disp-xres\">X Resources</a>\nfor details.</dd>\n<dt>\n<strong>confirm on program exit</strong></dt>\n<dd>\nAsk for a confirmation before exiting the <strong>display(1)</strong> program.</dd>\n<dt>\n<strong>correct image for display gamma</strong></dt>\n<dd>\nIf the image has a known gamma, the gamma is corrected to match that of\nthe X server (see the <a href=\"#disp-xres\">X Resource</a><strong> displayGamma</strong>).</dd>\n<dt>\n<strong>display warning messages</strong></dt>\n<dd>\nDisplay any warning messages.</dd>\n<dt>\n<strong>apply Floyd/Steinberg error diffusion to image</strong></dt>\n<dd>\nThe basic strategy of dithering is to trade intensity resolution for spatial\nresolution by averaging the intensities of several neighboring pixels.\nImages which suffer from severe contouring when reducing colors can be\nimproved with this preference.</dd>\n<dt>\n<strong>use a shared colormap for colormapped X visuals</strong></dt>\n<dd>\nThis option only applies when the default X server visual is\n<em>PseudoColor</em>\nor <em>GRAYScale</em>. Refer to <strong>-visual</strong> for more details. By default,\na shared colormap is allocated. The image shares colors with other X clients.\nSome image colors could be approximated, therefore your image may look\nvery different than intended. Otherwise the image colors appear exactly\nas they are defined. However, other clients may go technicolor when the\nimage colormap is installed.</dd>\n<dt>\n<strong>display images as an X server pixmap</strong></dt>\n<dd>\nImages are maintained as a XImage by default. Set this resource to True\nto utilize a server Pixmap instead. This option is useful if your image\nexceeds the dimensions of your server screen and you intend to pan the\nimage. Panning is much faster with Pixmaps than with a XImage. Pixmaps\nare considered a precious resource, use them with discretion.</dd>\n</dl>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/docutils-api.css",
    "content": "body,\np,\ntd,\nth,\nul,\nol {\n\tfont-size : medium;\n\tfont-family : sans-serif;\n}\n\nbody {\n\tcolor : #000000;\n\ttext-align : left;\n\tmargin : 0;\n\tbackground-color : #FFFFFF;\n\tpadding-bottom : 20px;\n}\n\nh1 {\n\tfont-size : 120%;\n}\n\nh2 {\n\tfont-size : 110%;\n}\n\nh3,\nh4 {\n\tfont-size : 105%;\n}\n\na:link {\n\tcolor : #007F40;\n\ttext-decoration : underline;\n}\n\na:visited {\n\tcolor : #006030;\n\ttext-decoration : underline;\n}\n\na:hover {\n\tcolor : #006030;\n}\n\n.small {\n\tfont-size : smaller;\n}\n\n.tiny {\n\tfont-size : smaller;\n}\n\ndiv.banner {\n\tborder-bottom : 1px solid #3A4841;\n\tpadding : 2ex 0 1ex 5em;\n\tborder-top : 1px solid #3A4841;\n\tbackground : #75EFB2 url(images/banner_bg.png) repeat-x;\n\toverflow : hidden;\n\tmargin : 0;\n}\n\ndiv.banner img {\n\tvertical-align : middle;\n\tmargin-left : 0em;\n}\n\ndiv.banner form {\n\tmargin-left : 2em;\n\tdisplay : inline;\n\ttext-align : center;\n}\n\ndiv.banner .title {\n\tcolor : #002A15;\n\tfont-size : 2.2em;\n\tfont-weight : bold;\n}\n\ndiv.banner .subtitle {\n\tcolor : #002A15;\n\tfont-size : 1em;\n\tfont-weight : normal;\n\tmargin-left : 1em;\n}\n\ndiv.navmenu {\n\tfont-size : 90%;\n\tborder-bottom : 1px solid #75867E;\n\tpadding : 0;\n\tmargin : 0;\n\tbackground-color : #005C30;\n\ttext-align : center;\n}\n\ndiv.navmenu ul {\n\tpadding : 5px;\n\tmargin : 0;\n}\n\ndiv.navmenu ul li {\n\tpadding : 0 .5em 0 .5em;\n\tlist-style-type : none;\n\tmargin : 0 0 0 4px;\n\tdisplay : inline;\n\ttext-align : center;\n}\n\ndiv.navmenu ul li a {\n\tcolor : #FFFFFF;\n\ttext-decoration : none;\n}\n\ndiv.navmenu ul li a:hover {\n\tborder-bottom : 1px solid #FFFFFF;\n}\n\ndiv.document {\n\theight : auto;\n\tpadding : 1em;\n\twidth : auto;\n\tbackground : #FFFFFF;\n\tmax-width : 960px;\n\tmargin : 2ex 2em 1ex 2em;\n\tline-height : 140%;\n\ttext-align : left;\n}\n\ndiv.document h1.title {\n\tfont-size : 140%;\n\tpadding : 0;\n\tpadding-bottom : .4ex;\n\tfont-weight : bold;\n\tmargin : 0 0 0.5em 0;\n\ttext-align : center;\n}\n\ndiv.document hr.end {\n\tcolor : #808080;\n\twidth : 50%;\n\theight : 1px;\n}\n\nhr.divider {\n\tcolor : #A0A0A0;\n\tclear : both;\n\theight : 3px;\n\twidth : 62%;\n\tborder : none;\n\tbackground-color : #A0A0A0;\n}\n\ndiv.footer {\n\tcolor : #606060;\n\tclear : both;\n\twidth : 100%;\n\tbackground : #FFFFFF;\n\tmax-width : 960px;\n\tpadding-top : 1ex;\n\tfont-family : sans-serif;\n}\n\ndiv.footer p {\n\tfont-size : 9pt;\n\tmargin : .5ex 0 0 0;\n\ttext-align : left;\n}\n\ndiv.footer a {\n\tcolor : #000000;\n\tfont-size : 9pt;\n\tmargin : 0 .5em 0 .5em;\n\ttext-decoration : none;\n}\n\ndiv.footer a:hover {\n\ttext-decoration : underline;\n}\n\nh2 {\n\tfont-size : 14pt;\n}\n\nh3 {\n\tfont-size : 12pt;\n}\n\nh4 {\n\tfont-size : 11pt;\n}\n\nh5,\nh6 {\n\tfont-size : 10pt;\n}\n\na {\n\ttext-decoration : none;\n}\n\na:hover {\n\ttext-decoration : underline;\n}\n\nh1 a:hover {\n\tcolor : inherit;\n\tbackground-color : inherit;\n}\n\ntt {\n\tbackground-color : #C9EEDC;\n}\n\ndl.docutils dd {\n\tmargin-bottom : 1em;\n}\n\ndl.docutils dt {\n\tpadding-top : 0.1cm;\n\tfont-weight : bold;\n\tpadding-bottom : 0.1cm;\n}\n\ndl.docutils dt tt {\n\tfont-style : normal;\n}\n\ndl.docutils dt tt span {\n\tbackground-color : #FFFFFF;\n}\n\ndl.docutils dt span {\n\tpadding-top : 0.2ex;\n\tpadding-bottom : 0.2ex;\n}\n\nhr {\n\twidth : 75%;\n\tpage-break-after : always;\n}\n\nli {\n\tpadding-top : 0.5ex;\n\tpadding-bottom : 0.5ex;\n}\n\ndiv.document h1.title {\n\tfont-weight : bold;\n\tfont-size : 1.5em;\n\ttext-align : center;\n\tmargin-top : 1ex;\n\tpadding-bottom : 1ex;\n}\n\ndiv.section div.section {\n\tmargin-left : 3em;\n}\n\ndiv.section h1 {\n\tcolor : black;\n\tmargin-top : 3.5ex;\n\tfont-weight : bold;\n\tfont-size : 120%;\n\tmargin-bottom : 0.5ex;\n}\n\ndiv.section h1 a {\n\tcolor : #224433;\n\tfont-size : inherit;\n\ttext-decoration : none;\n}\n\ndiv.section h1 a.toc-backref {\n\tcolor : #104028;\n}\n\nh2.subtitle {\n\tpadding-top : 0cm;\n\tfont-size : 1.1em;\n\ttext-align : center;\n}\n\ndiv.section h2 {\n\tcolor : black;\n\tfont-size : 110%;\n\tmargin-top : 2ex;\n\tmargin-bottom : 1ex;\n}\n\ndiv.section h2 a {\n\tcolor : #426453;\n\tfont-size : inherit;\n\tbackground-color : #FFFFFF;\n\ttext-decoration : none;\n}\n\ndiv.section h3 {\n\tcolor : #224433;\n\tfont-size : inherit;\n}\n\ndiv.section h3 a {\n\tcolor : #608070;\n\tfont-size : inherit;\n\tbackground-color : #FFFFFF;\n\ttext-decoration : none;\n}\n\na.toc-backref {\n\tcolor : black;\n\ttext-decoration : none;\n}\n\ndiv.abstract {\n\tmargin : 2em 5em;\n}\n\ndiv.abstract p.topic-title {\n\tfont-weight : bold;\n\ttext-align : center;\n}\n\ndiv.admonition,\ndiv.attention,\ndiv.caution,\ndiv.danger,\ndiv.error,\ndiv.hint,\ndiv.important,\ndiv.note,\ndiv.tip,\ndiv.warning {\n\tpadding : 1em;\n\tmargin : 2em;\n\tborder : medium outset;\n}\n\ndiv.hint,\ndiv.note,\ndiv.tip {\n\tmargin : 1em;\n\tpadding-right : .5em;\n\tpadding-bottom : .5ex;\n\tpadding-top : .5ex;\n\tborder : 1pt solid #CCCCCC;\n\tbackground-color : #BFD5CA;\n\tpadding-left : .5em;\n}\n\ndiv.attention p.admonition-title,\ndiv.caution p.admonition-title,\ndiv.danger p.admonition-title,\ndiv.error p.admonition-title,\ndiv.warning p.admonition-title div.hint p.admonition-title,\ndiv.important p.admonition-title,\ndiv.note p.admonition-title,\ndiv.tip p.admonition-title {\n\tcolor : red;\n\tfont-size : 12pt;\n\tfont-weight : bold;\n\tfont-family : sans-serif;\n}\n\ndiv.hint p.admonition-title,\ndiv.important p.admonition-title,\ndiv.note p.admonition-title,\ndiv.tip p.admonition-title {\n\tcolor : #70AD8E;\n\tfont-size : 11pt;\n\tfont-weight : bold;\n\tfont-family : sans-serif;\n}\n\ndiv.dedication {\n\tmargin : 2em 5em;\n\tfont-style : italic;\n\ttext-align : center;\n}\n\ndiv.contents p.topic-title {\n\tcolor : black;\n\tfont-size : 16pt;\n\tfont-weight : bold;\n\tfont-style : normal;\n}\n\ndiv.dedication p.topic-title {\n\tfont-weight : bold;\n\tfont-style : normal;\n}\n\ndiv.figure {\n\tmargin-left : 2em;\n}\n\ndiv.footer,\ndiv.header {\n\tfont-size : smaller;\n\tmargin-bottom : 0.5ex;\n}\n\ndiv.system-messages {\n\tmargin : 5em;\n}\n\ndiv.system-messages h1 {\n\tcolor : red;\n\tfont-size : 1em;\n}\n\ndiv.system-message {\n\tpadding : 1em;\n\tborder : medium outset;\n}\n\ndiv.system-message p.system-message-title {\n\tcolor : red;\n\tfont-weight : bold;\n}\n\ndiv.topic {\n\tmargin : 2em;\n}\n\ndiv.line-block {\n\tmargin-top : 1ex;\n\tborder-left : 2pt solid #606060;\n\tpadding-left : .5em;\n\tbackground-color : #FFFFFF;\n\tmargin-bottom : 1ex;\n}\n\nul.simple {\n\tpadding-left : 0;\n\tmargin-left : 1.0em;\n\tmargin-bottom : 1em;\n}\n\nol.simple {\n\tmargin-left : 1.0em;\n\tmargin-bottom : 1em;\n}\n\nol.arabic {\n\tlist-style : decimal;\n}\n\nol.loweralpha {\n\tlist-style : lower-alpha;\n}\n\nol.upperalpha {\n\tlist-style : upper-alpha;\n}\n\nol.lowerroman {\n\tlist-style : lower-roman;\n}\n\nol.upperroman {\n\tlist-style : upper-roman;\n}\n\np.caption {\n\tfont-style : italic;\n}\n\np.credits {\n\tfont-size : smaller;\n\tfont-style : italic;\n}\n\np.label {\n\twhite-space : nowrap;\n}\n\np.topic-title {\n\tfont-weight : bold;\n}\n\npre.address {\n\tfont-size : 10pt;\n\tfont-family : serif;\n\tmargin-top : 0;\n\tmargin-bottom : 0;\n}\n\npre.line-block {\n\tfont-size : 10pt;\n\tfont-family : serif;\n}\n\npre.literal-block,\npre.doctest-block {\n\tfont-size : 10pt;\n\tcolor : #000000;\n\tborder-width : 1px;\n\tpadding : 2pt;\n\tborder-color : #E0E0E0;\n\tborder-style : solid;\n\tline-height : 13pt;\n\tbackground-color : #E8F8F0;\n}\n\npre.literal-block a\n{\n\ttext-decoration : none;\n}\n\nspan.classifier {\n\tfont-style : oblique;\n}\n\nspan.classifier-delimiter {\n\tfont-weight : bold;\n}\n\nspan.interpreted {\n\tfont-family : arial,helvetica,sans-serif;\n}\n\nspan.option-argument {\n\tfont-style : italic;\n}\n\nspan.pre {\n\twhite-space : pre;\n}\n\nspan.problematic {\n\tcolor : red;\n}\n\nspan.field-argument {\n\tfont-size : 10pt;\n}\n\ntable.docutils {\n\tfont-size : 100%;\n\tmargin-bottom : 1ex;\n\twidth : auto;\n\tmargin-top : 1ex;\n\tborder : none;\n\tbackground-color : #FFFFFF;\n}\n\ntable.docutils caption {\n\tfont-weight : bold;\n}\n\ntable.docutils th,\ntable.docutils td {\n\tpadding : 6px;\n\tborder-color : #C8C8C8;\n\tborder-style : solid;\n\tvertical-align : top;\n\ttext-align : left;\n}\n\ntable.docutils th {\n\tborder-top : 1px solid black;\n\tbackground-color : #80C6A3;\n\tborder-bottom : 1px solid black;\n}\n\ntable.docutils td {\n\tbackground-color : #F8F8F8;\n}\n\ntable.citation {\n\tborder-left : solid thin gray;\n\tpadding-left : 0.5ex;\n}\n\ntable.docinfo {\n\tfont-size : 90%;\n\tborder-right : none;\n\tborder-top : 1pt solid #DDDDDD;\n\tborder-bottom : 1pt solid #DDDDDD;\n\tmargin-top : 1em;\n\tmargin-left : 0em;\n\tborder-left : none;\n\tmargin-bottom : 2em;\n\tbackground-color : #EEEEEE;\n}\n\ntable.docinfo th,\ntable.docinfo td {\n\tborder-style : none;\n\tborder : none;\n\tbackground-color : #EEEEEE;\n\tpadding-left : 0.5em;\n}\n\ntable.footnote {\n\ttext-align : left;\n\tfont-size : smaller;\n\tborder-left : solid thin black;\n\tpadding-left : 0.5ex;\n}\n\ntable.footnote td {\n\tbackground-color : #F0F0F0;\n}\n\nth.docinfo-name,\nth.field-name {\n\twhite-space : nowrap;\n\tfont-weight : bold;\n\tbackground-color : #EEEEEE;\n\ttext-align : left;\n}\n\nh1 tt,\nh2 tt,\nh3 tt,\nh4 tt,\nh5 tt,\nh6 tt {\n\tfont-size : inherit;\n\tbackground-color : inherit;\n}\n\nul.auto-toc {\n\tlist-style-type : none;\n}\n\nimg.align-left {\n}\n\nimg.align-right {\n}\n\n/* Try to hide the page banner on portable devices */\n@media handheld\n{\n    div.banner {\n        display:none;\n    }\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/docutils-articles.css",
    "content": "body,\np,\ntd,\nth,\nul,\nol {\n    font-size : medium;\n    font-family : sans-serif;\n}\n\nbody {\n    color : #000000;\n    text-align : left;\n    margin : 0;\n    background-color : #FFFFFF;\n    padding-bottom : 20px;\n}\n\nh1 {\n    font-size : 120%;\n}\n\nh2 {\n    font-size : 110%;\n}\n\nh3,\nh4 {\n    font-size : 105%;\n}\n\na:link {\n    color : #007F40;\n    text-decoration : underline;\n}\n\na:visited {\n    color : #006030;\n    text-decoration : underline;\n}\n\na:hover {\n    color : #006030;\n}\n\n.small {\n    font-size : smaller;\n}\n\n.tiny {\n    font-size : smaller;\n}\n\ndiv.banner {\n    border-bottom : 1px solid #3A4841;\n    padding : 2ex 0 1ex 4%;\n    border-top : 1px solid #3A4841;\n    background : #fff url(images/banner_bg.png) repeat-x;\n    overflow : hidden;\n    margin : 0;\n}\n\nspan.nowrap {\n    white-space:nowrap;\n    margin: 2ex 2% 0 0;\n}\n\n.right {\n    float: right;\n    width: auto;\n}\n\ndiv.banner img {\n    vertical-align : middle;\n    margin-left : 0em;\n}\n\ndiv.banner form {\n    margin-left : 2em;\n    display : inline;\n    text-align : center;\n}\n\ndiv.banner .title {\n    color : #002A15;\n    font-size : 2.2em;\n    font-weight : bold;\n}\n\ndiv.banner .subtitle {\n    color : #002A15;\n    font-size : 1em;\n    font-weight : normal;\n    margin-left : 1em;\n}\n\ndiv.navmenu {\n    font-size : 90%;\n    border-bottom : 1px solid #75867E;\n    padding : 0;\n    margin : 0;\n    background-color : #005C30;\n    text-align : center;\n}\n\ndiv.navmenu ul {\n    max-width : 960px;\n    padding : 5px;\n    margin : 0;\n}\n\ndiv.navmenu ul li {\n    padding : 0 .5em 0 .5em;\n    list-style-type : none;\n    margin : 0 0 0 4px;\n    display : inline;\n    text-align : center;\n}\n\ndiv.navmenu ul li a {\n    color : #FFFFFF;\n    text-decoration : none;\n}\n\ndiv.navmenu ul li a:hover {\n    border-bottom : 1px solid #FFFFFF;\n}\n\ndiv.document {\n    height : auto;\n    padding : 1em 1% 1em 1%;\n    width : auto;\n    background : #FFFFFF;\n    max-width : 960px;\n    margin : 2ex 3% 1ex 3%;\n    line-height : 140%;\n    text-align : left;\n}\n\ndiv.document h1.title {\n    font-size : 140%;\n    padding : 0;\n    padding-bottom : .4ex;\n    font-weight : bold;\n    margin : 0 0 0.5em 0;\n    text-align : center;\n}\n\ndiv.document hr.end {\n    color : #808080;\n    width : 50%;\n    height : 1px;\n}\n\nhr.divider {\n    color : #A0A0A0;\n    clear : both;\n    height : 3px;\n    width : 62%;\n    border : none;\n    background-color : #A0A0A0;\n}\n\ndiv.footer {\n    color : #606060;\n    clear : both;\n    width : 100%;\n    background : #FFFFFF;\n    max-width : 960px;\n    padding-top : 1ex;\n    font-family : sans-serif;\n}\n\ndiv.footer p {\n    font-size : 9pt;\n    margin : .5ex 0 0 0;\n    text-align : left;\n}\n\ndiv.footer a {\n    color : #000000;\n    font-size : 9pt;\n    margin : 0 .5em 0 .5em;\n    text-decoration : none;\n}\n\ndiv.footer a:hover {\n    text-decoration : underline;\n}\n\nh2 {\n    font-size : 14pt;\n}\n\nh3 {\n    font-size : 12pt;\n}\n\nh4 {\n    font-size : 11pt;\n}\n\nh5,\nh6 {\n    font-size : 10pt;\n}\n\na {\n    text-decoration : none;\n}\n\na:hover {\n    text-decoration : underline;\n}\n\nh1 a:hover {\n    color : inherit;\n    background-color : inherit;\n}\n\ntt {\n    background-color : #C9EEDC;\n}\n\ndl.docutils dd {\n    margin-bottom : 1em;\n}\n\ndl.docutils dt {\n    padding-top : 0.1cm;\n    font-weight : bold;\n    padding-bottom : 0.1cm;\n}\n\ndl.docutils dt tt {\n    font-style : normal;\n}\n\ndl.docutils dt tt span {\n    background-color : #FFFFFF;\n}\n\ndl.docutils dt span {\n    padding-top : 0.2ex;\n    padding-bottom : 0.2ex;\n}\n\nhr {\n    width : 75%;\n    page-break-after : always;\n}\n\nli {\n    padding-top : 0.5ex;\n    padding-bottom : 0.5ex;\n}\n\ndiv.document h1.title {\n    font-weight : bold;\n    font-size : 1.5em;\n    text-align : center;\n    margin-top : 1ex;\n    padding-bottom : 1ex;\n}\n\ndiv.section h1 {\n    color : black;\n    margin-top : 3.5ex;\n    font-weight : bold;\n    font-size : 120%;\n    margin-bottom : 0.5ex;\n}\n\ndiv.section h1 a {\n    color : #224433;\n    font-size : inherit;\n    text-decoration : none;\n}\n\ndiv.section h1 a.toc-backref {\n    color : #104028;\n}\n\nh2.subtitle {\n    padding-top : 0cm;\n    font-size : 1.1em;\n    text-align : center;\n}\n\ndiv.section h2 {\n    color : black;\n    font-size : 110%;\n    margin-top : 2ex;\n    margin-bottom : 1ex;\n}\n\ndiv.section h2 a {\n    color : #426453;\n    font-size : inherit;\n    background-color : #FFFFFF;\n    text-decoration : none;\n}\n\ndiv.section h3 {\n    color : #224433;\n    font-size : inherit;\n}\n\ndiv.section h3 a {\n    color : #608070;\n    font-size : inherit;\n    background-color : #FFFFFF;\n    text-decoration : none;\n}\n\na.toc-backref {\n    color : black;\n    text-decoration : none;\n}\n\ndiv.abstract {\n    margin : 2em 5em;\n}\n\ndiv.abstract p.topic-title {\n    font-weight : bold;\n    text-align : center;\n}\n\ndiv.admonition,\ndiv.attention,\ndiv.caution,\ndiv.danger,\ndiv.error,\ndiv.hint,\ndiv.important,\ndiv.note,\ndiv.tip,\ndiv.warning {\n    padding : 1em;\n    margin : 2em;\n    border : medium outset;\n}\n\ndiv.hint,\ndiv.note,\ndiv.tip {\n    margin : 1em;\n    padding-right : .5em;\n    padding-bottom : .5ex;\n    padding-top : .5ex;\n    border : 1pt solid #CCCCCC;\n    background-color : #BFD5CA;\n    padding-left : .5em;\n}\n\ndiv.attention p.admonition-title,\ndiv.caution p.admonition-title,\ndiv.danger p.admonition-title,\ndiv.error p.admonition-title,\ndiv.warning p.admonition-title div.hint p.admonition-title,\ndiv.important p.admonition-title,\ndiv.note p.admonition-title,\ndiv.tip p.admonition-title {\n    color : red;\n    font-size : 12pt;\n    font-weight : bold;\n    font-family : sans-serif;\n}\n\ndiv.hint p.admonition-title,\ndiv.important p.admonition-title,\ndiv.note p.admonition-title,\ndiv.tip p.admonition-title {\n    color : #70AD8E;\n    font-size : 11pt;\n    font-weight : bold;\n    font-family : sans-serif;\n}\n\ndiv.dedication {\n    margin : 2em 5em;\n    font-style : italic;\n    text-align : center;\n}\n\ndiv.contents p.topic-title {\n    color : black;\n    font-size : 16pt;\n    font-weight : bold;\n    font-style : normal;\n}\n\ndiv.dedication p.topic-title {\n    font-weight : bold;\n    font-style : normal;\n}\n\ndiv.figure {\n    margin-left : 2em;\n}\n\ndiv.footer,\ndiv.header {\n\tfont-size : smaller;\n\tmargin-bottom : 0.5ex;\n}\n\ndiv.system-messages {\n    margin : 5em;\n}\n\ndiv.system-messages h1 {\n    color : red;\n    font-size : 1em;\n}\n\ndiv.system-message {\n    padding : 1em;\n    border : medium outset;\n}\n\ndiv.system-message p.system-message-title {\n    color : red;\n    font-weight : bold;\n}\n\ndiv.topic {\n    margin : 2em;\n}\n\ndiv.line-block {\n    margin-top : 1ex;\n    border-left : 2pt solid #606060;\n    padding-left : .5em;\n    background-color : #FFFFFF;\n    margin-bottom : 1ex;\n}\n\nul.simple {\n    padding-left : 0;\n    margin-left : 1.0em;\n    margin-bottom : 1em;\n}\n\nol.simple {\n    margin-left : 1.0em;\n    margin-bottom : 1em;\n}\n\nol.arabic {\n    list-style : decimal;\n}\n\nol.loweralpha {\n    list-style : lower-alpha;\n}\n\nol.upperalpha {\n    list-style : upper-alpha;\n}\n\nol.lowerroman {\n    list-style : lower-roman;\n}\n\nol.upperroman {\n    list-style : upper-roman;\n}\n\np.caption {\n    font-style : italic;\n}\n\np.credits {\n    font-size : smaller;\n    font-style : italic;\n}\n\np.label {\n    white-space : nowrap;\n}\n\np.topic-title {\n    font-weight : bold;\n}\n\npre.address {\n    font-size : 10pt;\n    font-family : serif;\n    margin-top : 0;\n    margin-bottom : 0;\n}\n\npre.line-block {\n    font-size : 10pt;\n    font-family : serif;\n}\n\npre.literal-block,\npre.doctest-block {\n    font-size : 10pt;\n    color : #000000;\n    border-width : 1px;\n    padding : 2pt;\n    border-color : #E0E0E0;\n    border-style : solid;\n    line-height : 13pt;\n    background-color : #E8F8F0;\n    overflow:auto; /* auto scroll */\n}\n\nspan.classifier {\n    font-style : oblique;\n}\n\nspan.classifier-delimiter {\n    font-weight : bold;\n}\n\nspan.interpreted {\n    font-family : arial,helvetica,sans-serif;\n}\n\nspan.option-argument {\n    font-style : italic;\n}\n\nspan.pre {\n    white-space : pre;\n}\n\nspan.problematic {\n    color : red;\n}\n\nspan.field-argument {\n    font-size : 10pt;\n}\n\ntable.docutils {\n    /*table-layout:fixed;*/\n    font-size : 100%;\n    margin-bottom : 1ex;\n    /*width : auto;*/\n    width: 98%;\n    margin-top : 1ex;\n    border : none;\n    background-color : #FFFFFF;\n}\n\ntable.docutils caption {\n    font-weight : bold;\n}\n\ntable.docutils th,\ntable.docutils td {\n    padding : 6px;\n    border-color : #C8C8C8;\n    border-style : solid;\n    vertical-align : top;\n}\n\n\ntable.docutils th {\n    border-top : 1px solid black;\n    background-color : #80C6A3;\n    border-bottom : 1px solid black;\n}\n\ntable.docutils td {\n    background-color : #F8F8F8;\n}\n\ntable.docutils td.decimal {\n    background-color : #F8F8F8;\n    text-align : right;\n}\n\ntable.citation {\n    border-left : solid thin gray;\n    padding-left : 0.5ex;\n}\n\ntable.docinfo {\n    font-size : 90%;\n    border-right : none;\n    border-top : 1pt solid #DDDDDD;\n    border-bottom : 1pt solid #DDDDDD;\n    margin-top : 1em;\n    margin-left : 0em;\n    border-left : none;\n    margin-bottom : 2em;\n    background-color : #EEEEEE;\n}\n\ntable.docinfo th,\ntable.docinfo td {\n    border : none;\n    background-color : #EEEEEE;\n    padding-left : 0.5em;\n}\n\ntable.footnote {\n    text-align : left;\n    font-size : smaller;\n    border-left : solid thin black;\n    padding-left : 0.5ex;\n}\n\ntable.footnote td {\n    background-color : #F0F0F0;\n}\n\nth.docinfo-name,\nth.field-name {\n    white-space : nowrap;\n    font-weight : bold;\n    background-color : #EEEEEE;\n    text-align : left;\n}\n\ntable.option-list {\n    border : none;\n    padding : 0;\n    background-color : #FFFFFF;\n    border-collapse : collapse;\n}\n\ntable.option-list tr {\n    border : none;\n    margin : 0;\n    padding : 0;\n}\n\ntable.option-list td {\n    border : none;\n    background-color : #FFFFFF;\n}\n\ntable.option-list td.option-group {\n    background-color : #FFFFFF;\n}\n\nspan.option {\n    font-weight : bold;\n    background-color : #E8F8F0;\n}\n\nkbd { font-family : monospace; }\n\nh1 tt,\nh2 tt,\nh3 tt,\nh4 tt,\nh5 tt,\nh6 tt {\n    font-size : inherit;\n    background-color : inherit;\n}\n\nul.auto-toc {\n    list-style-type : none;\n}\n\nimg.align-left {\n}\n\nimg.align-right {\n}\n\n/* Try to hide the page banner on portable devices */\n@media handheld\n{\n    div.banner {\n        display:none;\n    }\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/download.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Download</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-download\">\n<h1 class=\"title\">GraphicsMagick Download</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#ftp-site-organization\" id=\"id1\">Ftp Site Organization</a></li>\n<li><a class=\"reference internal\" href=\"#download-sites\" id=\"id2\">Download Sites</a></li>\n</ul>\n</div>\n<p>The source distribution of GraphicsMagick as well as pre-compiled\nbinaries are available at the sites listed here (unless otherwise\nnoted).  At the moment, the fastest way to obtain formal releases is\nfrom the <a class=\"reference external\" href=\"http://sourceforge.net/projects/graphicsmagick/files/\">SourceForge Download</a> page since SourceForge has lots of\nbandwidth, and many mirror sites. Snapshot packages should usually be\nretrieved from the <a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/\">GraphicsMagick FTP</a> site or one of its mirrors.\nThere are mirrors of the ftp site in Czechoslovakia and Poland.</p>\n<div class=\"section\" id=\"ftp-site-organization\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Ftp Site Organization</a></h1>\n<p>The organization of the GraphicsMagick directory on ftp sites is as\nfollows:</p>\n<p><a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/\">GraphicsMagick FTP</a></p>\n<blockquote>\nContains the core GraphicsMagick sources in a file named similar to\nGraphicsMagick-1.3.tar.bz2, GraphicsMagick-1.3.tar.gz, or\nGraphicsMagick-1.3.tar.xz. These core sources are sufficient to\ncompile a minimal GraphicsMagick on a Unix system (including\nMacOS-X), or under the Cygwin and MinGW environments for Windows.\nAdditional development packages need to be installed in advance to\nsupport formats like JPEG and PNG.</blockquote>\n<p><a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/delegates/\">delegates</a></p>\n<blockquote>\nAdd on third-party libraries and applications which extend the\nformats supported by GraphicsMagick may be obtained from this\ndirectory. Windows users can usually ignore the contents of this\ndirectory since all common delegates are included in the Windows\nsource and binaries packages.</blockquote>\n<p><a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/linux/\">linux</a></p>\n<blockquote>\nLinux source RPM (SRPM) packages for Red Hat Linux, other Linux\nsystems, or any system with RPM installed, may be found here.</blockquote>\n<p><a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/snapshots/\">snapshots</a></p>\n<blockquote>\nSnapshots (between releases) copies of GraphicsMagick may be found\nhere. New snapshots may be cut every few days as time\npermits. Quality may vary (but is usually excellent).</blockquote>\n<p><a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/windows/\">windows</a></p>\n<blockquote>\nInstallable binary packages and the extended source code package for\nuse with Microsoft Visual C++ (including configured delegates and a\nVisual C++ workspace) may be found here.</blockquote>\n</div>\n<div class=\"section\" id=\"download-sites\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Download Sites</a></h1>\n<p>Here are some known download sites for GraphicsMagick:</p>\n<blockquote>\n<p><a class=\"reference external\" href=\"https://sourceforge.net/projects/graphicsmagick/files/\">SourceForge file download</a> (http protocol)</p>\n<p><a class=\"reference external\" href=\"http://78.108.103.11/MIRROR/ftp/GraphicsMagick/\">Czech ftp mirror</a> (http protocol)</p>\n<p><a class=\"reference external\" href=\"ftp://ftp.icm.edu.pl/pub/unix/graphics/GraphicsMagick/\">Polish ftp mirror via ftp</a> (ftp protocol)</p>\n<p><a class=\"reference external\" href=\"http://ftp.icm.edu.pl/pub/unix/graphics/GraphicsMagick/\">Polish ftp mirror via http</a> (http protocol)</p>\n</blockquote>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/formats.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Supported Formats</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-supported-formats\">\n<h1 class=\"title\">GraphicsMagick Supported Formats</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>GraphicsMagick uses an ASCII string known as &quot;magick&quot; (e.g. &quot;GIF&quot;) to\nidentify file formats, algorithms acting as formats, built-in images, and\nembedded profile types. After a file has been read or &quot;pinged&quot;, the\nassociated magick string is stored in the &quot;magick&quot; member of the Image\nstructure, and is reported in the default output of 'gm identify'.</p>\n<p>GraphicsMagick supports reading over 88 major file formats (not including\nsub-formats). The following table provides a summary of the supported\nimage formats.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Supported Image Formats</caption>\n<colgroup>\n<col width=\"14%\" />\n<col width=\"6%\" />\n<col width=\"28%\" />\n<col width=\"52%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Format</td>\n<td>Mode</td>\n<td>Description</td>\n<td>Notes</td>\n</tr>\n<tr><td>ART</td>\n<td>RW</td>\n<td>PFS: 1st Publisher</td>\n<td>Format originally used on the Macintosh\n(MacPaint?) and later used for PFS: 1st\nPublisher clip art.</td>\n</tr>\n<tr><td>AVS</td>\n<td>RW</td>\n<td>AVS X image</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/bmp/egff.htm\">BMP</a></td>\n<td>RW</td>\n<td>Microsoft Windows bitmap</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/cals/egff.htm\">CALS</a></td>\n<td>R</td>\n<td>Continuous Acquisition\nand Life-cycle Support\nType 1 image</td>\n<td>Specified in MIL-R-28002 and MIL-PRF-28002.\nStandard blueprint archive format as used by the\nUS military to replace microfiche.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"motion-picture.html\">CIN</a></td>\n<td>R</td>\n<td>Kodak Cineon</td>\n<td>Kodak Cineon Log format (4.5 draft).\nPrecursor to SMPTE <a class=\"reference external\" href=\"motion-picture.html\">DPX</a></td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/cgm/egff.htm\">CGM</a></td>\n<td>R</td>\n<td>Computer Graphics\nMetafile</td>\n<td>Requires <a class=\"reference external\" href=\"http://www.agocg.ac.uk/train/cgm/ralcgm.htm\">ralcgm</a> to render CGM files.</td>\n</tr>\n<tr><td>CMYK</td>\n<td>RW</td>\n<td>Raw cyan, magenta,\nyellow, and black samples</td>\n<td>Use -size, -depth, -endian, and -interlace to\nspecify the image width, height, depth, byte\norder, and interlace.</td>\n</tr>\n<tr><td>CUR</td>\n<td>R</td>\n<td>Microsoft Cursor Icon</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>CUT</td>\n<td>R</td>\n<td>DR Halo</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>DCM</td>\n<td>R</td>\n<td>Digital Imaging and\nCommunications in\nMedicine (<a class=\"reference external\" href=\"http://dicom.nema.org/\">DICOM</a>) image</td>\n<td>Used by the medical community for images like\nX-rays. See the NEMA <a class=\"reference external\" href=\"http://dicom.nema.org/\">DICOM</a> web site for more\ninformation. <a class=\"reference external\" href=\"http://dicom.nema.org/\">DICOM</a> is the basis for the\n<a class=\"reference external\" href=\"http://www.geinspectiontechnologies.com/en/products/software/diconde.html\">DICONDE</a> format.</td>\n</tr>\n<tr><td>DCX</td>\n<td>RW</td>\n<td>ZSoft IBM PC multi-page\nPaintbrush image</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>DIB</td>\n<td>RW</td>\n<td>Microsoft Windows Device\nIndependent Bitmap</td>\n<td>DIB is a BMP file without the BMP header. Used\nto support embedded images in compound formats\nlike WMF.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"motion-picture.html\">DPX</a></td>\n<td>RW</td>\n<td>Digital Moving Picture\nExchange</td>\n<td>RGB and grayscale are fully supported at 1, 8,\n10, 12, and 16 bits as per the <a class=\"reference external\" href=\"http://www.smpte.org/\">SMPTE</a> 268M-2003\n(V2.0) specification. This includes support for\nimages stored in a planar (multi-element)\nconfiguration and Cineon Log RGB. Rec. 601 and\n709 YCbCr are fully supported with 4:4:4 and\n4:2:2 subsampling. <a class=\"reference external\" href=\"motion-picture.html\">DPX</a> is commonly used to\nstore image frames in film and HDTV production.</td>\n</tr>\n<tr><td>EMF</td>\n<td>R</td>\n<td>Microsoft Enhanced\nMetafile (32-bit)</td>\n<td>Only available under Microsoft Windows.</td>\n</tr>\n<tr><td>EPDF</td>\n<td>RW</td>\n<td>Encapsulated Portable\nDocument Format</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>EPI</td>\n<td>RW</td>\n<td>Adobe Encapsulated\nPostScript Interchange\nformat</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>EPS</td>\n<td>RW</td>\n<td>Adobe Encapsulated\nPostScript</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>EPS2</td>\n<td>W</td>\n<td>Adobe Level II\nEncapsulated PostScript</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>EPS3</td>\n<td>W</td>\n<td>Adobe Level III\nEncapsulated PostScript</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>EPSF</td>\n<td>RW</td>\n<td>Adobe Encapsulated\nPostScript</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>EPSI</td>\n<td>RW</td>\n<td>Adobe Encapsulated\nPostScript Interchange\nformat</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>EPT</td>\n<td>RW</td>\n<td>Adobe Encapsulated\nPostScript Interchange\nformat with <a class=\"reference external\" href=\"http://www.simplesystems.org/libtiff/\">TIFF</a> preview</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>FAX</td>\n<td>RW</td>\n<td>Group 3 FAX</td>\n<td>Note that FAX machines use non-square pixels\nwhich are 1.5 times wider than they are tall but\ncomputer displays use square pixels, so FAX\nimages may appear to be narrow unless they are\nexplicitly resized using a resize specification\nof &quot;150x100%&quot;. Please note that this is <em>not</em> a\n<a class=\"reference external\" href=\"http://www.simplesystems.org/libtiff/\">TIFF</a> format.</td>\n</tr>\n<tr><td>FIG</td>\n<td>R</td>\n<td>FIG graphics format</td>\n<td>Requires TransFig.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.cv.nrao.edu/fits/\">FITS</a></td>\n<td>RW</td>\n<td>Flexible Image Transport\nSystem</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>FPX</td>\n<td>RW</td>\n<td>FlashPix Format</td>\n<td>Requires FlashPix SDK.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/gif/egff.htm\">GIF</a></td>\n<td>RW</td>\n<td>CompuServe Graphics\nInterchange Format</td>\n<td><p class=\"first\">8-bit RGB PseudoColor with up to 256 palette\nentires. Specify the format &quot;GIF87&quot; to write the\nolder version 87a of the format.</p>\n<p class=\"last\">The PNG format provides a superior set of\nfeatures to GIF. Consider using PNG format\nrather than GIF if clients are able to read PNG.</p>\n</td>\n</tr>\n<tr><td>GRAY</td>\n<td>RW</td>\n<td>Raw gray samples</td>\n<td>Use -size, -depth, and -endian to specify the\nimage width, height, depth, and byte order.</td>\n</tr>\n<tr><td>GRAYA</td>\n<td>RW</td>\n<td>Raw gray samples + alpha</td>\n<td>Use -size, -depth, and -endian to specify the\nimage width, height, depth, and byte order.</td>\n</tr>\n<tr><td>HPGL</td>\n<td>R</td>\n<td>HP-GL plotter language</td>\n<td>Requires <a class=\"reference external\" href=\"http://www.gnu.org/software/hp2xx/hp2xx.html\">hp2xx</a> 3.2.0 or later</td>\n</tr>\n<tr><td>HTML</td>\n<td>RW</td>\n<td>Hypertext Markup Language\nwith a client-side image\nmap</td>\n<td>Also known as &quot;HTM&quot;. Requires html2ps to read.</td>\n</tr>\n<tr><td>ICO</td>\n<td>R</td>\n<td>Microsoft icon</td>\n<td>Also known as &quot;ICON&quot;.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.jpeg.org/\">JBIG</a></td>\n<td>RW</td>\n<td>Joint Bi-level Image\nexperts Group file\ninterchange format</td>\n<td>Also known as &quot;BIE&quot; and &quot;JBG&quot;. Requires\n<a class=\"reference external\" href=\"http://www.cl.cam.ac.uk/~mgk25/jbigkit/\">jbigkit</a> 1.0 or later</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.libmng.com/\">JNG</a></td>\n<td>RW</td>\n<td><a class=\"reference external\" href=\"http://www.jpeg.org/\">JPEG</a> Network Graphics</td>\n<td><a class=\"reference external\" href=\"http://www.jpeg.org/\">JPEG</a> in a PNG-style wrapper with transparency.\nRequires libjpeg and libpng-1.0.2 or later,\nlibpng-1.2.5 or later recommended.</td>\n</tr>\n<tr><td>JP2</td>\n<td>RW</td>\n<td>JPEG-2000 JP2 File Format\nSyntax</td>\n<td>Requires <a class=\"reference external\" href=\"http://www.ece.uvic.ca/~mdadams/jasper/\">jasper</a> 1.600.0 or later</td>\n</tr>\n<tr><td>JPC</td>\n<td>RW</td>\n<td>JPEG-2000 Code Stream\nSyntax</td>\n<td>Requires <a class=\"reference external\" href=\"http://www.ece.uvic.ca/~mdadams/jasper/\">jasper</a> 1.600.0 or later</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.jpeg.org/\">JPEG</a></td>\n<td>RW</td>\n<td>Joint Photographic\nExperts Group JFIF format</td>\n<td>Requires jpegsrc.v6b.tar.gz</td>\n</tr>\n<tr><td>MAN</td>\n<td>R</td>\n<td>Unix reference manual\npages</td>\n<td>Requires that GNU groff and Ghostcript are\ninstalled.</td>\n</tr>\n<tr><td>MAT</td>\n<td>RW</td>\n<td>MATLAB image format</td>\n<td>Coming from <a class=\"reference external\" href=\"http://www.mathworks.com/\">MathWorks</a> for storing matrices.\nCurrently supported types are 2D matrices: byte,\nword, double, complex and 3D matrices containing\nRGB [x*y*3] byte, word.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"miff.html\">MIFF</a></td>\n<td>RW</td>\n<td>Magick image file format</td>\n<td>ImageMagick's lossless image format (with\nASCII header) which ensures that no image\nattributes understood by ImageMagick or\nGraphicsMagick are lost.</td>\n</tr>\n<tr><td>MONO</td>\n<td>RW</td>\n<td>Bi-level bitmap in\nleast-significant-byte\nfirst order</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.libmng.com/\">MNG</a></td>\n<td>RW</td>\n<td>Multiple-image Network\nGraphics</td>\n<td>Requires libpng-1.0.2 or later, libpng-1.2.5 or\nlater recommended.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.mpeg.org/\">MPEG</a></td>\n<td>RW</td>\n<td>Motion Picture Experts\nGroup file interchange\nformat (version 1)</td>\n<td>Requires mpeg2vidcodec_v12.tar.gz.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.mpeg.org/\">M2V</a></td>\n<td>RW</td>\n<td>Motion Picture Experts\nGroup file interchange\nformat (version 2)</td>\n<td>Requires mpeg2vidcodec_v12.tar.gz.</td>\n</tr>\n<tr><td>MPC</td>\n<td>RW</td>\n<td>Magick Persistent Cache\nimage file format</td>\n<td><p class=\"first\">The native &quot;in-memory&quot; GraphicsMagick\nuncompressed file format. This file format is\nidentical to that used by Open ImageMagick to\nrepresent images in memory and is read in &quot;zero\ntime&quot; via memory mapping. The MPC format is not\nportable and is not suitable as an archive\nformat. It is suitable as an intermediate format\nfor high-performance image processing.</p>\n<p class=\"last\">The MPC format requires two files to support one\nimage. When writing the MPC format, a file with\nextension &quot;.mpc&quot; is used to store information\nabout the image, while a file with extension\n<tt class=\"docutils literal\">.cache</tt> stores the image pixels. The storage\nspace required by a MPC image (or an image in\nmemory) may be calculated by the equation\n(QuantumDepth*Rows*Columns*5)/8.</p>\n</td>\n</tr>\n<tr><td>MSL</td>\n<td>RW</td>\n<td>Magick Scripting Language</td>\n<td>MSL is the XML-based scripting language\nsupported by the conjure utility.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/mtv/egff.htm\">MTV</a></td>\n<td>RW</td>\n<td>MTV Raytracing image\nformat</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>MVG</td>\n<td>RW</td>\n<td>Magick Vector Graphics.</td>\n<td>The native GraphicsMagick vector metafile\nformat. A text file containing vector drawing\ncommands accepted by <a class=\"reference external\" href=\"convert.html\">convert</a>'s -draw option.</td>\n</tr>\n<tr><td>OTB</td>\n<td>RW</td>\n<td>On-the-air Bitmap</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>P7</td>\n<td>RW</td>\n<td>Xv's Visual Schnauzer\nthumbnail format</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>PALM</td>\n<td>RW</td>\n<td>Palm pixmap</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://netpbm.sourceforge.net/doc/pam.html\">PAM</a></td>\n<td>RW</td>\n<td>Portable Arbitrary Map\nformat</td>\n<td>Superset of PNM (PPM, PGM, PPM) raw type formats.\nSupports bilevel, gray, RGB, CMYK, alpha channel.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/pbm/egff.htm\">PBM</a></td>\n<td>RW</td>\n<td>Portable bitmap format\n(black and white)</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>PCD</td>\n<td>RW</td>\n<td>Photo CD</td>\n<td>The maximum resolution written is 768x512 pixels\nsince larger images require huffman compression\n(which is not supported).</td>\n</tr>\n<tr><td>PCDS</td>\n<td>RW</td>\n<td>Photo CD</td>\n<td>Decode with the sRGB color tables.</td>\n</tr>\n<tr><td>PCL</td>\n<td>W</td>\n<td>HP Page Control Language</td>\n<td>For output to HP laser printers.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/pcx/egff.htm\">PCX</a></td>\n<td>RW</td>\n<td>ZSoft IBM PC Paintbrush\nfile</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>PDB</td>\n<td>RW</td>\n<td>Palm Database ImageViewer\nFormat</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>PDF</td>\n<td>RW</td>\n<td>Portable Document Format</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>PFA</td>\n<td>R</td>\n<td>Postscript Type 1 font\n(ASCII)</td>\n<td>Opening as file returns a preview image.</td>\n</tr>\n<tr><td>PFB</td>\n<td>R</td>\n<td>Postscript Type 1 font\n(binary)</td>\n<td>Opening as file returns a preview image.</td>\n</tr>\n<tr><td>PGM</td>\n<td>RW</td>\n<td>Portable graymap format\n(gray scale)</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>PICON</td>\n<td>RW</td>\n<td>Personal Icon</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>PICT</td>\n<td>RW</td>\n<td>Apple Macintosh QuickDraw\n/PICT file</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>PIX</td>\n<td>R</td>\n<td>Alias/Wavefront RLE image\nformat</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>PNG</td>\n<td>RW</td>\n<td>Portable Network Graphics</td>\n<td>Requires libpng-1.0.2 or later, libpng-1.2.5 or\nlater recommended.</td>\n</tr>\n<tr><td>PNM</td>\n<td>RW</td>\n<td>Portable anymap</td>\n<td><p class=\"first\">PNM is a family of formats supporting portable\nbitmaps (PBM) , graymaps (PGM), and pixmaps\n(PPM). There is no file format associated with\npnm itself. If PNM is used as the output format\nspecifier, then GraphicsMagick automatically\nselects the most appropriate format to represent\nthe image.</p>\n<p class=\"last\">The default is to write the binary version of\nthe formats. Use '-quality 0' to write the\nASCII version of the formats.</p>\n</td>\n</tr>\n<tr><td>PPM</td>\n<td>RW</td>\n<td>Portable pixmap format\n(color)</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>PS</td>\n<td>RW</td>\n<td>Adobe PostScript file</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>PS2</td>\n<td>RW</td>\n<td>Adobe Level II PostScript\nfile</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>PS3</td>\n<td>RW</td>\n<td>Adobe Level III\nPostScript file</td>\n<td>Requires <a class=\"reference external\" href=\"http://pages.cs.wisc.edu/~ghost/\">Ghostscript</a> to read.</td>\n</tr>\n<tr><td>PSD</td>\n<td>RW</td>\n<td>Adobe Photoshop bitmap\nfile</td>\n<td>PSD format is no longer supported since the\n1.3.24 release.</td>\n</tr>\n<tr><td>PTIF</td>\n<td>RW</td>\n<td>Pyramid encoded <a class=\"reference external\" href=\"http://www.simplesystems.org/libtiff/\">TIFF</a></td>\n<td>Multi-resolution <a class=\"reference external\" href=\"http://www.simplesystems.org/libtiff/\">TIFF</a> containing successively\nsmaller versions of the image down to the size\nof an icon. The desired sub-image size may be\nspecified when reading via the -size option.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.photoworks.com/\">PWP</a></td>\n<td>R</td>\n<td>Seattle File Works\nmulti-image file</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>RAS</td>\n<td>R</td>\n<td><a class=\"reference external\" href=\"http://www.topol.cz/english/share/index.php3\">TopoL</a> (GIS)</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>RAD</td>\n<td>R</td>\n<td><a class=\"reference external\" href=\"http://radsite.lbl.gov/radiance/HOME.html\">Radiance</a> image file</td>\n<td>Requires that ra_ppm from the <a class=\"reference external\" href=\"http://radsite.lbl.gov/radiance/HOME.html\">Radiance</a> software\npackage be installed.</td>\n</tr>\n<tr><td>RGB</td>\n<td>RW</td>\n<td>Raw red, green, and blue\nsamples</td>\n<td>Use -size, -depth, -endian, and -interlace to\nspecify the image width, height, depth, byte\norder, and interlace.</td>\n</tr>\n<tr><td>RGBA</td>\n<td>RW</td>\n<td>Raw red, green, and blue\nand matte samples</td>\n<td>Use -size, -depth, -endian, and -interlace to\nspecify the image width, height, depth, byte\norder, and interlace.</td>\n</tr>\n<tr><td>RLA</td>\n<td>R</td>\n<td>Alias/Wavefront image\nfile</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>RLE</td>\n<td>R</td>\n<td>Utah Run length encoded\nimage file</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://oreilly.com/www/centers/gff/formats/scitex/\">SCT</a></td>\n<td>R</td>\n<td>Scitex Continuous Tone\nPicture</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.algonet.se/~cyren/sfw/\">SFW</a></td>\n<td>R</td>\n<td>Seattle File Works image</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>SGI</td>\n<td>RW</td>\n<td>Irix RGB image</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>SHTML</td>\n<td>W</td>\n<td>Hypertext Markup Language\nclient-side image map</td>\n<td>Used to write HTML clickable image maps based on\na the output of montage or a format which\nsupports tiled images such as <a class=\"reference external\" href=\"miff.html\">MIFF</a>.</td>\n</tr>\n<tr><td>SUN</td>\n<td>RW</td>\n<td>SUN Rasterfile</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.w3.org/Graphics/SVG/\">SVG</a></td>\n<td>RW</td>\n<td>Scalable Vector Graphics</td>\n<td>Requires <a class=\"reference external\" href=\"http://xmlsoft.org/\">libxml2</a> and <a class=\"reference external\" href=\"http://www.freetype.org/\">freetype2</a>. Note that <a class=\"reference external\" href=\"http://www.w3.org/Graphics/SVG/\">SVG</a>\nis a very complex specification so support is\nstill not complete.</td>\n</tr>\n<tr><td>TGA</td>\n<td>RW</td>\n<td>Truevision Targa image</td>\n<td>Also known as formats &quot;ICB&quot;, &quot;VDA&quot;, and &quot;VST&quot;.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.simplesystems.org/libtiff/\">TIFF</a></td>\n<td>RW</td>\n<td>Tagged Image File Format</td>\n<td>Also known as &quot;TIF&quot;. Requires tiff-v3.5.4.tar.gz\nor later. Note that since the Unisys LZW patent\nrecently expired, libtiff may still require a\nseparate LZW patch in order to support LZW. LZW\nis included in libtiff by default since v3.7.0.</td>\n</tr>\n<tr><td>TIM</td>\n<td>R</td>\n<td>PSX TIM file</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>TTF</td>\n<td>R</td>\n<td>TrueType font file</td>\n<td>Requires <a class=\"reference external\" href=\"http://www.freetype.org/\">freetype2</a>. Opening as file returns a\npreview image.</td>\n</tr>\n<tr><td>TXT</td>\n<td>RW</td>\n<td>Raw text file</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>UIL</td>\n<td>W</td>\n<td>X-Motif UIL table</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>UYVY</td>\n<td>RW</td>\n<td>Interleaved YUV raw image</td>\n<td>Use -size command line option to specify width\nand height.</td>\n</tr>\n<tr><td>VICAR</td>\n<td>RW</td>\n<td>VICAR rasterfile format</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/viff/egff.htm\">VIFF</a></td>\n<td>RW</td>\n<td>Khoros Visualization\nImage File Format</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.openmobilealliance.org/Technical/wapindex.aspx\">WBMP</a></td>\n<td>RW</td>\n<td>Wireless bitmap</td>\n<td>Support for uncompressed monochrome only.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/wmf/egff.htm\">WMF</a></td>\n<td>&nbsp;</td>\n<td>Windows Metafile</td>\n<td>Requires libwmf. By default, renders WMF files\nusing the dimensions specified by the metafile\nheader. Use the -density option to adjust the\noutput resolution, and thereby adjust the ouput\nsize. The default output resolution is 72DPI so\n&quot;-density 144&quot; results in an image twice as\nlarge as the default. Use -background <a class=\"reference external\" href=\"color.html\">color</a> to\nspecify the WMF background color (default white)\nor -texture filename to specify a background\ntexture image.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/wpg/egff.htm\">WPG</a></td>\n<td>R</td>\n<td>Word Perfect Graphics\nFile</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/xbm/egff.htm\">XBM</a></td>\n<td>RW</td>\n<td>X Windows system bitmap,\nblack and white only</td>\n<td>Used by the X Windows System to store monochrome\nicons.</td>\n</tr>\n<tr><td>XCF</td>\n<td>R</td>\n<td>GIMP image</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/xpm/egff.htm\">XPM</a></td>\n<td>RW</td>\n<td>X Windows system pixmap</td>\n<td>Also known as &quot;PM&quot;. Used by the X Windows System\nto store color icons.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.fileformat.info/format/xwd/egff.htm\">XWD</a></td>\n<td>RW</td>\n<td>X Windows system window\ndump</td>\n<td>Used by the X Windows System to save/display\nscreen dumps.</td>\n</tr>\n<tr><td>YUV</td>\n<td>RW</td>\n<td>CCIR 601 4:1:1</td>\n<td>Use -size command line option to specify width\nand height.</td>\n</tr>\n</tbody>\n</table>\n<p>GraphicsMagick supports a number of image format specifications which\nrefer to images prepared via an algorithm, or input/output targets. The\nfollowing table lists these pseudo image formats:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Pseudo Image Formats</caption>\n<colgroup>\n<col width=\"13%\" />\n<col width=\"6%\" />\n<col width=\"25%\" />\n<col width=\"56%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Tag</td>\n<td>Mode</td>\n<td>Description</td>\n<td>Notes</td>\n</tr>\n<tr><td>CAPTION</td>\n<td>R</td>\n<td>Image caption</td>\n<td>Draws text on a canvas image with size specified by <cite>-size</cite>\ncanvas color as specified by <cite>-background' (default white),\nand text stroke and fill colors as specified by `-stroke</cite>\nand <cite>-fill</cite>.  Capable of supporting multi-line text.</td>\n</tr>\n<tr><td>CLIPBOARD</td>\n<td>RW</td>\n<td>Windows Clipboard</td>\n<td>Only available under Microsoft Windows.</td>\n</tr>\n<tr><td>FRACTAL</td>\n<td>R</td>\n<td>Plasma fractal image</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>GRADIENT</td>\n<td>R</td>\n<td>Gradual passing from\none shade to another</td>\n<td><p class=\"first\">Returns a rendered gradient image using the\nspecified image size. Specify the desired\nshading as part of the filename.  For example:</p>\n<blockquote class=\"last\">\n<tt class=\"docutils literal\"><span class=\"pre\">gradient:red-blue</span></tt> or <tt class=\"docutils literal\"><span class=\"pre\">gradient:#F00-#00F</span></tt></blockquote>\n</td>\n</tr>\n<tr><td>HISTOGRAM</td>\n<td>W</td>\n<td>Histogram of the image</td>\n<td><p class=\"first\">Generate an RGB histogram of the input image.\nThe output format is always ImageMagick <a class=\"reference external\" href=\"miff.html\">MIFF</a>\n(regardless of file extension). For example:</p>\n<blockquote class=\"last\">\n<tt class=\"docutils literal\">gm convert file.tiff histogram:file.miff</tt></blockquote>\n</td>\n</tr>\n<tr><td>IDENTITY</td>\n<td>R</td>\n<td><a class=\"reference external\" href=\"http://www.quelsolaar.com/technology/clut.html\">Hald CLUT</a> identity\nimage</td>\n<td>Generate a Hald CLUT identity image of a specified order.\nThe order is specified as an argument like &quot;IDENTITY:8&quot;.\nThe default order is eight, producing a 512x512 image.</td>\n</tr>\n<tr><td>INFO</td>\n<td>W</td>\n<td>Image descriptive\ninformation and\nstatistics</td>\n<td>Writes descriptive information similar to 'identify'</td>\n</tr>\n<tr><td>LABEL</td>\n<td>R</td>\n<td>Text image format</td>\n<td>Specify the desired text as the filename (e.g.\n&quot;label:This is a label&quot;).</td>\n</tr>\n<tr><td>MAP</td>\n<td>RW</td>\n<td>Colormap intensities\nand indices</td>\n<td>Set -depth to set the sample size of the\nintensities; indices are 16-bit if colors &gt;\n256.</td>\n</tr>\n<tr><td>MATTE</td>\n<td>W</td>\n<td>MATTE format</td>\n<td>Write only.</td>\n</tr>\n<tr><td>NULL</td>\n<td>RW</td>\n<td>NULL image</td>\n<td>Useful for creating blank tiles with montage\n(use &quot;NULL:&quot;). Also useful as an output format\nwhen evaluating image read performance.</td>\n</tr>\n<tr><td>PLASMA</td>\n<td>R</td>\n<td>Plasma fractal image</td>\n<td><p class=\"first\">Creates an image using the plasma fractal. For\nexample:</p>\n<blockquote class=\"last\">\n<tt class=\"docutils literal\">gm convert <span class=\"pre\">-size</span> 640x480 plasma: file.miff</tt></blockquote>\n</td>\n</tr>\n<tr><td>PREVIEW</td>\n<td>W</td>\n<td>Show a preview an image\nenhancement, effect, or\nf/x</td>\n<td><p class=\"first\">Creates a preview montage of images prepared\nover a parameteric range in order to assist\nwith parameter selection. Specify the desired\npreview type via the -preview option). The\noutput file is always written in the\nImageMagick <a class=\"reference external\" href=\"miff.html\">MIFF</a> format.</p>\n<p>For example:</p>\n<blockquote class=\"last\">\n<tt class=\"docutils literal\">gm convert file.tiff <span class=\"pre\">-preview</span> gamma preview:file.miff</tt></blockquote>\n</td>\n</tr>\n<tr><td>PRINT</td>\n<td>W</td>\n<td>Send image to your\ncomputer printer</td>\n<td>Unix users may set the PRINTER (for 'lp') or\nLPDEST (for 'lpr') environment variables to\nselect the desired printer.</td>\n</tr>\n<tr><td>SCAN</td>\n<td>R</td>\n<td>Import image from a\nscanner device</td>\n<td>Requires <a class=\"reference external\" href=\"http://www.mostang.com/sane/\">SANE</a> Specify the device name and path\nas the filename (e.g. &quot;scan:mustek:/dev/scanner&quot;).</td>\n</tr>\n<tr><td>STEGANO</td>\n<td>R</td>\n<td>Steganographic image</td>\n<td>Use -size command line option to specify width,\nheight, and offset of the steganographic image</td>\n</tr>\n<tr><td>TILE</td>\n<td>R</td>\n<td>Tiled image</td>\n<td><p class=\"first\">Create a tiled version of an image at by tiling\na image. Use -size to specify the tiled image\nsize. The image is specified similar to\n&quot;TILE:image.miff&quot;.\nFor example:</p>\n<blockquote class=\"last\">\n<tt class=\"docutils literal\">gm convert <span class=\"pre\">-size</span> 800x600 tile:image.jpg out.jpg</tt></blockquote>\n</td>\n</tr>\n<tr><td>VID</td>\n<td>RW</td>\n<td>Visual Image Directory</td>\n<td><p class=\"first\">Used to create a thumbnailed directory (tiled\nthumbnails) of a set of images which may be\nused to select images to view via the display\nprogram, or saved to a <a class=\"reference external\" href=\"miff.html\">MIFF</a> or SHTML file.\nFor example:</p>\n<blockquote class=\"last\">\n<tt class=\"docutils literal\">gm convert <span class=\"pre\">vid:&quot;*.jpg&quot;</span> index.miff</tt></blockquote>\n</td>\n</tr>\n<tr><td>WIN</td>\n<td>RW</td>\n<td>Select image from or\ndisplay image to your\ncomputer screen</td>\n<td><p class=\"first\">Only supported under Microsoft Windows. For example:</p>\n<blockquote class=\"last\">\n<tt class=\"docutils literal\">gm convert file.jpg <span class=\"pre\">-rotate</span> 90 win:</tt></blockquote>\n</td>\n</tr>\n<tr><td>X</td>\n<td>RW</td>\n<td>Select image from or\ndisplay image to your X\nserver screen</td>\n<td><p class=\"first\">Also see the import and display programs. For example:</p>\n<blockquote class=\"last\">\n<tt class=\"docutils literal\">gm convert file.jpg <span class=\"pre\">-rotate</span> 90 x:</tt></blockquote>\n</td>\n</tr>\n<tr><td>XC</td>\n<td>R</td>\n<td>Canvas image of\nspecified color</td>\n<td><p class=\"first\">Useful to create solid color &quot;canvas&quot; images.\nUse -size and -depth to specify the image\nwidth, height, and depth. Example XC color\nspecifications include &quot;XC:red&quot; and &quot;XC:#\nFF0000&quot;.  See the <a class=\"reference external\" href=\"color.html\">color</a> reference for the\nnumeric values used for named colors.  For example:</p>\n<blockquote class=\"last\">\n<tt class=\"docutils literal\">gm convert <span class=\"pre\">-size</span> 640x480 xc:red red.jpg</tt></blockquote>\n</td>\n</tr>\n</tbody>\n</table>\n<p>GraphicsMagick includes a number of built-in (embedded) images which may\nbe referenced as if they were an image file. The <tt class=\"docutils literal\">IMAGE:</tt> format tag may\nbe used via the syntax &quot;IMAGE:name&quot; to request an embedded image (e.g.\n<tt class=\"docutils literal\">IMAGE:LOGO</tt>). For backwards compatibility, the image specifications\n<tt class=\"docutils literal\">GRANITE:</tt>, <tt class=\"docutils literal\">LOGO:</tt>, <tt class=\"docutils literal\">NETSCAPE:</tt>, and <tt class=\"docutils literal\">ROSE:</tt> may also be used to request\nimages with those names.</p>\n<p>A new canvas image of a specified size may be created using one of these pattern\nimages using a command similar to:</p>\n<pre class=\"literal-block\">\ngm convert -size 640x480 PATTERN:BRICKS bricks.miff\n</pre>\n<p>The TILE: virtual image type may also be used similar to:</p>\n<pre class=\"literal-block\">\ngm convert -size 640x480 TILE:IMAGE:BRICKS bricks.miff\n</pre>\n<table border=\"1\" class=\"docutils\">\n<caption>Built-In Images And Patterns</caption>\n<colgroup>\n<col width=\"22%\" />\n<col width=\"37%\" />\n<col width=\"41%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Name</td>\n<td>Description</td>\n<td>Notes/Sample</td>\n</tr>\n<tr><td>BRICKS</td>\n<td>16x16 brick pattern</td>\n<td><img alt=\"bricks\" src=\"images/patterns/bricks.png\" /></td>\n</tr>\n<tr><td>CHECKERBOARD</td>\n<td>30x30 checkerboard pattern</td>\n<td><img alt=\"checkerboard\" src=\"images/patterns/checkerboard.png\" /></td>\n</tr>\n<tr><td>CIRCLES</td>\n<td>16x16 circles pattern</td>\n<td><img alt=\"circles\" src=\"images/patterns/circles.png\" /></td>\n</tr>\n<tr><td>CROSSHATCH</td>\n<td>8x4 crosshatch pattern</td>\n<td><img alt=\"crosshatch\" src=\"images/patterns/crosshatch.png\" /></td>\n</tr>\n<tr><td>CROSSHATCH30</td>\n<td>8x4 crosshatch pattern with lines\nat 30 degrees.</td>\n<td><img alt=\"crosshatch30\" src=\"images/patterns/crosshatch30.png\" /></td>\n</tr>\n<tr><td>CROSSHATCH45</td>\n<td>8x4 crosshatch pattern with lines\nat 45 degrees.</td>\n<td><img alt=\"crosshatch45\" src=\"images/patterns/crosshatch45.png\" /></td>\n</tr>\n<tr><td>FISHSCALES</td>\n<td>16x8 fish scales pattern</td>\n<td><img alt=\"fishscales\" src=\"images/patterns/fishscales.png\" /></td>\n</tr>\n<tr><td>GRANITE</td>\n<td>128x128 granite texture pattern</td>\n<td><img alt=\"granite\" src=\"images/patterns/granite.png\" /></td>\n</tr>\n<tr><td>GRAY0</td>\n<td>32x32 0% intensity gray</td>\n<td><img alt=\"gray0\" src=\"images/patterns/gray0.png\" /></td>\n</tr>\n<tr><td>GRAY5</td>\n<td>32x32 5% intensity gray</td>\n<td><img alt=\"gray5\" src=\"images/patterns/gray5.png\" /></td>\n</tr>\n<tr><td>GRAY10</td>\n<td>32x32 10% intensity gray</td>\n<td><img alt=\"gray10\" src=\"images/patterns/gray10.png\" /></td>\n</tr>\n<tr><td>GRAY15</td>\n<td>32x32 15% intensity gray</td>\n<td><img alt=\"gray15\" src=\"images/patterns/gray15.png\" /></td>\n</tr>\n<tr><td>GRAY20</td>\n<td>32x32 20% intensity gray</td>\n<td><img alt=\"gray20\" src=\"images/patterns/gray20.png\" /></td>\n</tr>\n<tr><td>GRAY25</td>\n<td>32x32 25% intensity gray</td>\n<td><img alt=\"gray25\" src=\"images/patterns/gray25.png\" /></td>\n</tr>\n<tr><td>GRAY30</td>\n<td>32x32 30% intensity gray</td>\n<td><img alt=\"gray30\" src=\"images/patterns/gray30.png\" /></td>\n</tr>\n<tr><td>GRAY35</td>\n<td>32x32 35% intensity gray</td>\n<td><img alt=\"gray35\" src=\"images/patterns/gray35.png\" /></td>\n</tr>\n<tr><td>GRAY40</td>\n<td>32x32 40% intensity gray</td>\n<td><img alt=\"gray40\" src=\"images/patterns/gray40.png\" /></td>\n</tr>\n<tr><td>GRAY45</td>\n<td>32x32 45% intensity gray</td>\n<td><img alt=\"gray45\" src=\"images/patterns/gray45.png\" /></td>\n</tr>\n<tr><td>GRAY50</td>\n<td>32x32 50% intensity gray</td>\n<td><img alt=\"gray50\" src=\"images/patterns/gray50.png\" /></td>\n</tr>\n<tr><td>GRAY55</td>\n<td>32x32 55% intensity gray</td>\n<td><img alt=\"gray55\" src=\"images/patterns/gray55.png\" /></td>\n</tr>\n<tr><td>GRAY60</td>\n<td>32x32 60% intensity gray</td>\n<td><img alt=\"gray60\" src=\"images/patterns/gray60.png\" /></td>\n</tr>\n<tr><td>GRAY65</td>\n<td>32x32 65% intensity gray</td>\n<td><img alt=\"gray65\" src=\"images/patterns/gray65.png\" /></td>\n</tr>\n<tr><td>GRAY70</td>\n<td>32x32 70% intensity gray</td>\n<td><img alt=\"gray70\" src=\"images/patterns/gray70.png\" /></td>\n</tr>\n<tr><td>GRAY75</td>\n<td>32x32 75% intensity gray</td>\n<td><img alt=\"gray75\" src=\"images/patterns/gray75.png\" /></td>\n</tr>\n<tr><td>GRAY80</td>\n<td>32x32 80% intensity gray</td>\n<td><img alt=\"gray80\" src=\"images/patterns/gray80.png\" /></td>\n</tr>\n<tr><td>GRAY85</td>\n<td>32x32 85% intensity gray</td>\n<td><img alt=\"gray85\" src=\"images/patterns/gray85.png\" /></td>\n</tr>\n<tr><td>GRAY90</td>\n<td>32x32 90% intensity gray</td>\n<td><img alt=\"gray90\" src=\"images/patterns/gray90.png\" /></td>\n</tr>\n<tr><td>GRAY95</td>\n<td>32x32 95% intensity gray</td>\n<td><img alt=\"gray95\" src=\"images/patterns/gray95.png\" /></td>\n</tr>\n<tr><td>GRAY100</td>\n<td>32x32 100% intensity gray</td>\n<td><img alt=\"gray100\" src=\"images/patterns/gray100.png\" /></td>\n</tr>\n<tr><td>HEXAGONS</td>\n<td>30x18 hexagon pattern</td>\n<td><img alt=\"hexagons\" src=\"images/patterns/hexagons.png\" /></td>\n</tr>\n<tr><td>HORIZONTAL</td>\n<td>8x4 horizontal line pattern</td>\n<td><img alt=\"horizontal\" src=\"images/patterns/horizontal.png\" /></td>\n</tr>\n<tr><td>HORIZONTALSAW</td>\n<td>16x8 horizontal saw-tooth pattern</td>\n<td><img alt=\"horizontalsaw\" src=\"images/patterns/horizontalsaw.png\" /></td>\n</tr>\n<tr><td>HS_BDIAGONAL</td>\n<td>8x8 backward diagonal line pattern\n(45 degrees slope)</td>\n<td><img alt=\"hs_bdiagonal\" src=\"images/patterns/hs_bdiagonal.png\" /></td>\n</tr>\n<tr><td>HS_CROSS</td>\n<td>8x8 cross line pattern</td>\n<td><img alt=\"hs_cross\" src=\"images/patterns/hs_cross.png\" /></td>\n</tr>\n<tr><td>HS_DIAGCROSS</td>\n<td>8x8 diagonal line cross pattern\n(45 degrees slope)</td>\n<td><img alt=\"hs_diagcross\" src=\"images/patterns/hs_diagcross.png\" /></td>\n</tr>\n<tr><td>HS_FDIAGONAL</td>\n<td>8x8 forward diagonal line pattern\n(45 degrees slope)</td>\n<td><img alt=\"hs_fdiagonal\" src=\"images/patterns/hs_fdiagonal.png\" /></td>\n</tr>\n<tr><td>HS_HORIZONTAL</td>\n<td>8x8 horizontal line pattern</td>\n<td><img alt=\"hs_horizontal\" src=\"images/patterns/hs_horizontal.png\" /></td>\n</tr>\n<tr><td>HS_VERTICAL</td>\n<td>8x8 vertical line pattern</td>\n<td><img alt=\"hs_vertical\" src=\"images/patterns/hs_vertical.png\" /></td>\n</tr>\n<tr><td>LEFT30</td>\n<td>8x4 forward diagonal pattern (30\ndegrees slope)</td>\n<td><img alt=\"left30\" src=\"images/patterns/left30.png\" /></td>\n</tr>\n<tr><td>LEFT45</td>\n<td>8x8 forward diagonal line pattern\n(45 degrees slope)</td>\n<td><img alt=\"left45\" src=\"images/patterns/left45.png\" /></td>\n</tr>\n<tr><td>LEFTSHINGLE</td>\n<td>24x24 left shingle pattern</td>\n<td><img alt=\"leftshingle\" src=\"images/patterns/leftshingle.png\" /></td>\n</tr>\n<tr><td>LOGO</td>\n<td>640x480, GraphicsMagick Logo</td>\n<td><img alt=\"logo\" src=\"images/gm-125x80t.png\" /></td>\n</tr>\n<tr><td>NETSCAPE</td>\n<td>216x144 image using colors in\nNetscape 216 (6x6x6 ) color cube.</td>\n<td>Most commonly used with the\n<a class=\"reference external\" href=\"convert.html\">convert</a>/<a class=\"reference external\" href=\"mogrify.html\">mogrify</a> -map option to\ncreate <em>web safe</em> images.</td>\n</tr>\n<tr><td>OCTAGONS</td>\n<td>16x16 octagons pattern</td>\n<td><img alt=\"octagons\" src=\"images/patterns/octagons.png\" /></td>\n</tr>\n<tr><td>RIGHT30</td>\n<td>8x4 backward diagonal line pattern\n(30 degrees)</td>\n<td><img alt=\"right30\" src=\"images/patterns/right30.png\" /></td>\n</tr>\n<tr><td>RIGHT45</td>\n<td>8x8 backward diagonal line pattern\n(30 degrees)</td>\n<td><img alt=\"right45\" src=\"images/patterns/right45.png\" /></td>\n</tr>\n<tr><td>RIGHTSHINGLE</td>\n<td>24x24 right shingle pattern</td>\n<td><img alt=\"rightshingle\" src=\"images/patterns/rightshingle.png\" /></td>\n</tr>\n<tr><td>ROSE</td>\n<td>70x46, Picture of a rose.</td>\n<td><img alt=\"rose\" src=\"images/patterns/rose.png\" /></td>\n</tr>\n<tr><td>SMALLFISHSCALES</td>\n<td>8x8 small fish scales pattern</td>\n<td><img alt=\"smallfishscales\" src=\"images/patterns/smallfishscales.png\" /></td>\n</tr>\n<tr><td>VERTICAL</td>\n<td>8x8 vertical line pattern</td>\n<td><img alt=\"vertical\" src=\"images/patterns/vertical.png\" /></td>\n</tr>\n<tr><td>VERTICALBRICKS</td>\n<td>16x16 vertical brick pattern</td>\n<td><img alt=\"verticalbricks\" src=\"images/patterns/verticalbricks.png\" /></td>\n</tr>\n<tr><td>VERTICALLEFTSHINGLE</td>\n<td>24x24 vertical left shingle\npattern</td>\n<td><img alt=\"verticalleftshingle\" src=\"images/patterns/verticalleftshingle.png\" /></td>\n</tr>\n<tr><td>VERTICALRIGHTSHINGLE</td>\n<td>24x24 vertical right shingle\npattern</td>\n<td><img alt=\"verticalrightshingle\" src=\"images/patterns/verticalrightshingle.png\" /></td>\n</tr>\n<tr><td>VERTICALSAW</td>\n<td>8x16 vertical saw-tooth pattern</td>\n<td><img alt=\"verticalsaw\" src=\"images/patterns/verticalsaw.png\" /></td>\n</tr>\n</tbody>\n</table>\n<p>GraphicsMagick provides a number of format identifiers which are used\nto add, remove, and save embedded profiles for images which can\nsupport embedded profiles. Image types which may contain embedded\nprofiles are <a class=\"reference external\" href=\"http://www.simplesystems.org/libtiff/\">TIFF</a>, <a class=\"reference external\" href=\"http://www.jpeg.org/\">JPEG</a>, PDF, and PNG.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Supported Embedded Profile Formats</caption>\n<colgroup>\n<col width=\"19%\" />\n<col width=\"6%\" />\n<col width=\"27%\" />\n<col width=\"48%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Format</td>\n<td>Mode</td>\n<td>Description</td>\n<td>Notes</td>\n</tr>\n<tr><td>8BIM</td>\n<td>RW</td>\n<td>Photoshop resource format\n(binary)</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>8BIMTEXT</td>\n<td>RW</td>\n<td>Photoshop resource format\n(ASCII)</td>\n<td>An ASCII representation of the 8BIM format.</td>\n</tr>\n<tr><td>APP1</td>\n<td>RW</td>\n<td>Raw application\ninformation</td>\n<td>&nbsp;</td>\n</tr>\n<tr><td>APP1JPEG</td>\n<td>RW</td>\n<td>Raw <a class=\"reference external\" href=\"http://www.jpeg.org/\">JPEG</a> binary data</td>\n<td>Profile in <a class=\"reference external\" href=\"http://www.jpeg.org/\">JPEG</a> wrapper.</td>\n</tr>\n<tr><td>ICC</td>\n<td>RW</td>\n<td>International Color\nConsortium color profile</td>\n<td>Also known as &quot;ICM&quot;. To read, use -profile with\nconvert.</td>\n</tr>\n<tr><td>IPTC</td>\n<td>RW</td>\n<td>IPTC Newsphoto (binary)</td>\n<td>To read, use -profile with convert</td>\n</tr>\n<tr><td>IPTCTEXT</td>\n<td>RW</td>\n<td>IPTC Newsphoto (ASCII)</td>\n<td>An ASCII representation of the IPTC format.</td>\n</tr>\n</tbody>\n</table>\n<p>Support for some of the formats are delegated to libraries or external\nprograms. The README describes where to find these distributions and\nany special configuration options required.</p>\n<p>To get a complete listing of the image formats which are supported on\nyour system, type</p>\n<pre class=\"literal-block\">\ngm convert -list format\n</pre>\n<p>On some platforms, GraphicsMagick automatically processes these\nextensions: .gz for Zip compression, .Z for Unix compression, and .bz2\nfor block compression. For example, a PNM image called image.pnm.gz is\nautomatically uncompressed while the image is read.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/gm.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\ngm - command-line utility to create, edit, compare, convert, or display images\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm animate</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file</em> <strong>[ [</strong>\n<em>options ...</em> <strong>]</strong> <em>file ...</em> <strong>]</strong>\n<p>\n<strong>gm batch</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <strong>[</strong> <em>script</em> <strong>]</strong>\n<p>\n<strong>gm benchmark</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> subcommand\n<p>\n<strong>gm compare</strong> <strong>[</strong> <em>options</em> <strong>... ]</strong> <em>reference-image</em>\n<strong>[</strong> <em>options</em> <strong>... ]</strong> <em>compare-image</em>\n<strong>[</strong> <em>options</em> <strong>... ]</strong>\n<p>\n<strong>gm composite</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>change-image base-image</em>\n<strong>[</strong> <em>mask-image</em> <strong>]</strong> <em>output-image</em>\n<p>\n<strong>gm conjure</strong> <strong>[</strong> <em>options</em> <strong>]</strong> <em>script.msl</em>\n<strong>[ [</strong> <em>options</em> <strong>]</strong> <em>script.msl</em> <strong>]</strong>\n<p>\n<strong>gm convert</strong> <strong>[ [</strong> <em>options ...</em> <strong>] [</strong> <em>input-file ...</em>\n<strong>] [</strong> <em>options ...</em> <strong>] ]</strong> <em>output-file</em> \n<p>\n<strong>gm display</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file ...</em>\n<strong>[ [</strong><em>options ...</em> <strong>]</strong><em>file ...</em> <strong>]</strong>\n<p>\n<strong>gm identify</strong> <em>file</em> <strong>[</strong> <em>file ...</em> <strong>]</strong>\n<p>\n<strong>gm import</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file</em>\n<p>\n<strong>gm mogrify</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file ...</em>\n<p>\n<strong>gm montage</strong> <strong>[</strong> <em>options ...</em> <strong>]</strong> <em>file</em> <strong>[ [</strong>\n<em>options ...</em> <strong>]</strong> <em>file ...</em> <strong>]</strong> <em>output-file</em>\n<p>\n<strong>gm time</strong> subcommand\n<p>\n<strong>gm version</strong>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nGraphicsMagick's <strong>gm</strong> provides a suite of utilities for creating,\ncomparing, converting, editing, and displaying images.  All of the\nutilities are provided as sub-commands of a single <strong>gm</strong>\nexecutable.  The <strong>gm</strong> executable returns the exit code 0 to\nindicate success, or 1 to indicate failure:\n<p>\n<strong>animate</strong>\ndisplays an animation (e.g. a GIF file) on any workstation display\nrunning an <em>X</em> server.\n<p>\n<strong>batch</strong>\nexecutes an arbitary number of the utility commands\n(e.g. <strong>convert</strong>) in the form of a simple linear batch script in\norder to improve execution efficiency, and/or to allow use as a\nsubordinate co-process under the control of an arbitrary script or\nprogram.\n<p>\n<strong>benchmark</strong>\nexecutes one of the other utility commands (e.g. <strong>convert</strong>) for a\nspecified number of iterations, or execution time, and reports\nexecution time and other profiling information such as CPU\nutilization. <strong>Benchmark</strong> provides various operating modes\nincluding executing the command with a varying number of threads, and\nalternate reporting formats such as comma-separated value (CSV).\n<p>\n<strong>compare</strong>\ncompares two images and reports difference statistics according to\nspecified metrics and/or outputs an image with a visual representation\nof the differences.  It may also be used to test if images are similar\nwithin a particular range and specified metric, returning a truth\nvalue to the executing environment.\n<p>\n<strong>composite</strong>\ncomposites images (blends or merges images together) to create new images.\n<p>\n<strong>conjure</strong>\ninterprets and executes scripts in\nthe Magick Scripting Language (MSL).\n<p>\n<strong>convert</strong>\nconverts an input file using one image format to an output file with\nthe same or differing image format while applying an arbitrary number\nof image transformations.\n<p>\n<strong>display</strong>\nis a machine architecture independent image processing and display\nfacility. It can display an image on any workstation display running\nan <em>X</em> server.\n<p>\n<strong>identify</strong>\ndescribes the format and characteristics of one or more image\nfiles. It will also report if an image is incomplete or corrupt.\n<p>\n<strong>import</strong>\nreads an image from any visible window on an <em>X</em> server and\noutputs it as an image file. You can capture a single window, the\nentire screen, or any rectangular portion of the screen.\n<p>\n<strong>mogrify</strong>\ntransforms an image or a sequence of images. These transforms include\n<strong>image scaling</strong>, <strong>image rotation</strong>, <strong>color reduction</strong>,\nand others. The transmogrified image <strong>overwrites</strong> the original\nimage.\n<p>\n<strong>montage</strong>\ncreates a composite by combining several separate images. The images\nare tiled on the composite image with the name of the image optionally\nappearing just below the individual tile.\n<p>\n<strong>time</strong>\nexecutes a subcommand and reports the user, system, and total\nexecution time consumed.\n<p>\n<strong>version</strong>\nreports the GraphicsMagick release version, maximum sample-depth,\ncopyright notice, supported features, and the options used while\nbuilding the software.\n<p>\nThe <strong>GraphicsMagick</strong> utilities recognize the following image formats:\n<br>&nbsp;<br>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<p>\n<tr><td><strong>Name</strong> </td><td><strong>Mode</strong></td><td><strong>Description</strong></td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">3FR      </td><td>r--</td><td>Hasselblad Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">8BIM     </td><td>rw-</td><td>Photoshop resource format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">8BIMTEXT </td><td>rw-</td><td>Photoshop resource text format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">8BIMWTEXT</td><td>rw-</td><td>Photoshop resource wide text format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">APP1     </td><td>rw-</td><td>Raw application information</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">APP1JPEG </td><td>rw-</td><td>Raw JPEG binary data</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ART      </td><td>r--</td><td>PF1: 1st Publisher</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ARW      </td><td>r--</td><td>Sony Alpha DSLR RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">AVS      </td><td>rw+</td><td>AVS X image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">BIE      </td><td>rw-</td><td>Joint Bi-level Image experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">BMP      </td><td>rw+</td><td>Microsoft Windows bitmap image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">BMP2     </td><td>-w-</td><td>Microsoft Windows bitmap image v2</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">BMP3     </td><td>-w-</td><td>Microsoft Windows bitmap image v3</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CACHE    </td><td>---</td><td>Magick Persistent Cache image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CALS     </td><td>rw-</td><td>Continuous Acquisition and Life-cycle</td></tr>\n<tr><td>          </td><td>   </td><td>Support Type 1 image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CAPTION  </td><td>r--</td><td>Caption (requires separate size info)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CIN      </td><td>rw-</td><td>Kodak Cineon Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CMYK     </td><td>rw-</td><td>Raw cyan, magenta, yellow, and black</td></tr>\n<tr><td>          </td><td>   </td><td>samples (8 or 16 bits, depending on</td></tr>\n<tr><td>          </td><td>   </td><td>the image depth)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CMYKA    </td><td>rw-</td><td>Raw cyan, magenta, yellow, black, and</td></tr>\n<tr><td>          </td><td>   </td><td>matte samples (8 or 16 bits, depending</td></tr>\n<tr><td>          </td><td>   </td><td>on the image depth)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CR2      </td><td>r--</td><td>Canon Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CRW      </td><td>r--</td><td>Canon Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CUR      </td><td>r--</td><td>Microsoft Cursor Icon</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">CUT      </td><td>r--</td><td>DR Halo</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DCM      </td><td>r--</td><td>Digital Imaging and Communications in</td></tr>\n<tr><td>          </td><td>   </td><td>Medicine image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DCR      </td><td>r--</td><td>Kodak Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DCX      </td><td>rw+</td><td>ZSoft IBM PC multi-page Paintbrush</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DNG      </td><td>r--</td><td>Adobe Digital Negative</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DPS      </td><td>r--</td><td>Display PostScript Interpreter</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">DPX      </td><td>rw-</td><td>Digital Moving Picture Exchange</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPDF     </td><td>rw-</td><td>Encapsulated Portable Document Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPI      </td><td>rw-</td><td>Adobe Encapsulated PostScript</td></tr>\n<tr><td>          </td><td>   </td><td>Interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPS      </td><td>rw-</td><td>Adobe Encapsulated PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPS2     </td><td>-w-</td><td>Adobe Level II Encapsulated PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPS3     </td><td>-w-</td><td>Adobe Level III Encapsulated PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPSF     </td><td>rw-</td><td>Adobe Encapsulated PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPSI     </td><td>rw-</td><td>Adobe Encapsulated PostScript</td></tr>\n<tr><td>          </td><td>   </td><td>Interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPT      </td><td>rw-</td><td>Adobe Encapsulated PostScript with MS-DOS</td></tr>\n<tr><td>          </td><td>   </td><td>TIFF preview</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPT2     </td><td>rw-</td><td>Adobe Level II Encapsulated PostScript</td></tr>\n<tr><td>          </td><td>   </td><td>with MS-DOS TIFF preview</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EPT3     </td><td>rw-</td><td>Adobe Level III Encapsulated PostScript</td></tr>\n<tr><td>          </td><td>   </td><td>with MS-DOS TIFF preview</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">EXIF     </td><td>rw-</td><td>Exif digital camera binary data</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">FAX      </td><td>rw+</td><td>Group 3 FAX (Not TIFF Group3 FAX!)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">FITS     </td><td>rw-</td><td>Flexible Image Transport System</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">FRACTAL  </td><td>r--</td><td>Plasma fractal image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">FPX      </td><td>rw-</td><td>FlashPix Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">GIF      </td><td>rw+</td><td>CompuServe graphics interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">GIF87    </td><td>rw-</td><td>CompuServe graphics interchange format</td></tr>\n<tr><td>          </td><td>   </td><td>(version 87a)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">GRADIENT </td><td>r--</td><td>Gradual passing from one shade to</td></tr>\n<tr><td>          </td><td>   </td><td>another</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">GRAY     </td><td>rw+</td><td>Raw gray samples (8/16/32 bits,</td></tr>\n<tr><td>          </td><td>   </td><td>depending on the image depth)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">HISTOGRAM</td><td>-w-</td><td>Histogram of the image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">HRZ      </td><td>r--</td><td>HRZ: Slow scan TV</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">HTML     </td><td>-w-</td><td>Hypertext Markup Language and a</td></tr>\n<tr><td>          </td><td>   </td><td>client-side image map</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICB      </td><td>rw+</td><td>Truevision Targa image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICC      </td><td>rw-</td><td>ICC Color Profile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICM      </td><td>rw-</td><td>ICC Color Profile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICO      </td><td>r--</td><td>Microsoft icon</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">ICON     </td><td>r--</td><td>Microsoft icon</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IDENTITY </td><td>r--</td><td>Hald CLUT identity image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IMAGE    </td><td>r--</td><td>GraphicsMagick Embedded Image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">INFO     </td><td>-w+</td><td>Image descriptive information and</td></tr>\n<tr><td>          </td><td>   </td><td> statistics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IPTC     </td><td>rw-</td><td>IPTC Newsphoto</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IPTCTEXT </td><td>rw-</td><td>IPTC Newsphoto text format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">IPTCWTEXT</td><td>rw-</td><td>IPTC Newsphoto wide text format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JBG      </td><td>rw+</td><td>Joint Bi-level Image experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JBIG     </td><td>rw+</td><td>Joint Bi-level Image experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>interchange format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JNG      </td><td>rw-</td><td>JPEG Network Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JP2      </td><td>rw-</td><td>JPEG-2000 JP2 File Format Syntax</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JPC      </td><td>rw-</td><td>JPEG-2000 Code Stream Syntax</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JPEG     </td><td>rw-</td><td>Joint Photographic Experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>JFIF format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">JPG      </td><td>rw-</td><td>Joint Photographic Experts Group</td></tr>\n<tr><td>          </td><td>   </td><td>JFIF format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">K25      </td><td>r--</td><td>Kodak Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">KDC      </td><td>r--</td><td>Kodak Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">LABEL    </td><td>r--</td><td>Text image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">M2V      </td><td>rw+</td><td>MPEG-2 Video Stream</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MAP      </td><td>rw-</td><td>Colormap intensities and indices</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MAT      </td><td>r--</td><td>MATLAB image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MATTE    </td><td>-w+</td><td>MATTE format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MIFF     </td><td>rw+</td><td>Magick Image File Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MNG      </td><td>rw+</td><td>Multiple-image Network Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MONO     </td><td>rw-</td><td>Bi-level bitmap in least-significant-</td></tr>\n<tr><td>          </td><td>   </td><td>-byte-first order</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MPC      </td><td>rw+</td><td>Magick Persistent Cache image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MPEG     </td><td>rw+</td><td>MPEG-1 Video Stream</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MPG      </td><td>rw+</td><td>MPEG-1 Video Stream</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MRW      </td><td>r--</td><td>Minolta Photo Raw</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MSL      </td><td>r--</td><td>Magick Scripting Language</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MTV      </td><td>rw+</td><td>MTV Raytracing image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">MVG      </td><td>rw-</td><td>Magick Vector Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">NEF      </td><td>r--</td><td>Nikon Electronic Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">NULL     </td><td>r--</td><td>Constant image of uniform color</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">OTB      </td><td>rw-</td><td>On-the-air bitmap</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">P7       </td><td>rw+</td><td>Xv thumbnail format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PAL      </td><td>rw-</td><td>16bit/pixel interleaved YUV</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PALM     </td><td>rw-</td><td>Palm Pixmap</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PBM      </td><td>rw+</td><td>Portable bitmap format (black and white)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCD      </td><td>rw-</td><td>Photo CD</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCDS     </td><td>rw-</td><td>Photo CD</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCL      </td><td>-w-</td><td>Page Control Language</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCT      </td><td>rw-</td><td>Apple Macintosh QuickDraw/PICT</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PCX      </td><td>rw-</td><td>ZSoft IBM PC Paintbrush</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PDB      </td><td>rw+</td><td>Palm Database ImageViewer Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PDF      </td><td>rw+</td><td>Portable Document Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PEF      </td><td>r--</td><td>Pentax Electronic File</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PFA      </td><td>r--</td><td>TrueType font</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PFB      </td><td>r--</td><td>TrueType font</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PGM      </td><td>rw+</td><td>Portable graymap format (gray scale)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PGX      </td><td>r--</td><td>JPEG-2000 VM Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PICON    </td><td>rw-</td><td>Personal Icon</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PICT     </td><td>rw-</td><td>Apple Macintosh QuickDraw/PICT</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PIX      </td><td>r--</td><td>Alias/Wavefront RLE image format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PLASMA   </td><td>r--</td><td>Plasma fractal image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNG      </td><td>rw-</td><td>Portable Network Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNG24    </td><td>rw-</td><td>Portable Network Graphics, 24 bit RGB</td></tr>\n<tr><td>          </td><td>   </td><td>opaque only</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNG32    </td><td>rw-</td><td>Portable Network Graphics, 32 bit RGBA</td></tr>\n<tr><td>          </td><td>   </td><td>semitransparency OK</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNG8     </td><td>rw-</td><td>Portable Network Graphics, 8-bit</td></tr>\n<tr><td>          </td><td>   </td><td>indexed, binary transparency only</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PNM      </td><td>rw+</td><td>Portable anymap</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PPM      </td><td>rw+</td><td>Portable pixmap format (color)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PREVIEW  </td><td>-w-</td><td>Show a preview an image enhancement,</td></tr>\n<tr><td>          </td><td>   </td><td>effect, or f/x</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PS       </td><td>rw+</td><td>Adobe PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PS2      </td><td>-w+</td><td>Adobe Level II PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PS3      </td><td>-w+</td><td>Adobe Level III PostScript</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PSD      </td><td>rw-</td><td>Adobe Photoshop bitmap</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PTIF     </td><td>rw-</td><td>Pyramid encoded TIFF</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">PWP      </td><td>r--</td><td>Seattle Film Works</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RAF      </td><td>r--</td><td>Fuji Photo RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RAS      </td><td>rw+</td><td>SUN Rasterfile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RGB      </td><td>rw+</td><td>Raw red, green, and blue samples</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RGBA     </td><td>rw+</td><td>Raw red, green, blue, and matte samples</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RLA      </td><td>r--</td><td>Alias/Wavefront image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">RLE      </td><td>r--</td><td>Utah Run length encoded image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SCT      </td><td>r--</td><td>Scitex HandShake</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SFW      </td><td>r--</td><td>Seattle Film Works</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SGI      </td><td>rw+</td><td>Irix RGB image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SHTML    </td><td>-w-</td><td>Hypertext Markup Language and a</td></tr>\n<tr><td>          </td><td>   </td><td>client-side image map</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">STEGANO  </td><td>r--</td><td>Steganographic image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SUN      </td><td>rw+</td><td>SUN Rasterfile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">SVG      </td><td>rw+</td><td>Scalable Vector Gaphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TEXT     </td><td>rw+</td><td>Raw text</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TGA      </td><td>rw+</td><td>Truevision Targa image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TIFF     </td><td>rw+</td><td>Tagged Image File Format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TILE     </td><td>r--</td><td>Tile image with a texture</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TIM      </td><td>r--</td><td>PSX TIM</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TOPOL    </td><td>r--</td><td>TOPOL X Image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TTF      </td><td>r--</td><td>TrueType font</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">TXT      </td><td>rw+</td><td>Raw text</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">UIL      </td><td>-w-</td><td>X-Motif UIL table</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">UYVY     </td><td>rw-</td><td>16bit/pixel interleaved YUV</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VDA      </td><td>rw+</td><td>Truevision Targa image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VICAR    </td><td>rw-</td><td>VICAR rasterfile format</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VID      </td><td>rw+</td><td>Visual Image Directory</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VIFF     </td><td>rw+</td><td>Khoros Visualization image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">VST      </td><td>rw+</td><td>Truevision Targa image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">WBMP     </td><td>rw-</td><td>Wireless Bitmap (level 0) image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">WMF      </td><td>r--</td><td>Windows Metafile</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">WPG      </td><td>r--</td><td>Word Perfect Graphics</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">X        </td><td>rw-</td><td>X Image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">X3F      </td><td>r--</td><td>Foveon X3 (Sigma/Polaroid) RAW</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XBM      </td><td>rw-</td><td>X Windows system bitmap (black</td></tr>\n<tr><td>          </td><td>   </td><td>and white)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XC       </td><td>r--</td><td>Constant image uniform color</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XCF      </td><td>r--</td><td>GIMP image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XMP      </td><td>rw-</td><td>Adobe XML metadata</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XPM      </td><td>rw-</td><td>X Windows system pixmap (color)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XV       </td><td>rw+</td><td>Khoros Visualization image</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">XWD      </td><td>rw-</td><td>X Windows system window dump (color)</td></tr>\n<tr><td><dd><img SRC=\"images/ball.png\" ALT=\"*\">YUV      </td><td>rw-</td><td>CCIR 601 4:1:1 or 4:2:2 (8-bit only)</td></tr>\n<tr><td>          </td><td>   </td><td></td></tr>\n<tr><td> Modes:   </td><td>   </td><td></td></tr>\n<tr><td>          </td><td>r  </td><td>Read</td></tr>\n<tr><td>          </td><td>w  </td><td>Write</td></tr>\n<tr><td>          </td><td>+  </td><td>Multi-image</td></tr>\n<br>&nbsp;<br>\n</table>\n<p>\n<em>Support for some of these formats require additional programs or libraries.\nSee <a href=\"README.html\">README</a>\nin the source package for where to find optional additional software</em>.\n<p>\nNote, a format delineated with <tt>+</tt> means that if more than one\nimage is specified, frames are combined into a single multi-image\nfile. Use <strong>+adjoin</strong> if you want a single image produced for each\nframe.\n<p>\nYour installation might not support all of the formats in the list.\nTo get an accurate listing of the formats supported by your particular\nconfiguration, run <tt>\"gm convert -list format\"</tt>.\n<p>\nRaw images are expected to have one byte per pixel unless <strong>gm</strong> is\ncompiled in 16-bit quantum mode or in 32-bit quantum mode. Here, the\nraw data is expected to be stored two or four bytes per pixel,\nrespectively, in most-significant-byte-first order.  For example, you\ncan tell if <strong>gm</strong> was compiled in 16-bit mode by typing \"gm\nversion\" without any options, and looking for \"Q:16\" in the first line\nof output.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"files\"></a>Files and Formats\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nBy default, the image format is determined by its magic number, i.e., the\nfirst few bytes of the file. To specify\na particular image format, precede the filename with an image format name\nand a colon (<em>i.e.</em><strong>ps:image</strong>) or specify the image type as the\nfilename suffix (<em>i.e.</em><strong>image.ps</strong>).\nThe magic number takes precedence over the filename suffix\nand the prefix takes precedence over the magic number and the suffix\nin input files.\nWhen a file is read, its magic number is stored in the \"image-&gt;magick\"\nstring.\nIn output files, the prefix takes precedence over the filename suffix,\nand the filename suffix takes precedence over the\n\"image-&gt;magick\" string.\n<br>&nbsp;<br>\n<p>To read the \"built-in\" formats (GRANITE, H, LOGO,\nNETSCAPE, PLASMA, and ROSE) use a prefix (including the colon) without a\nfilename or suffix.  To read the XC format, follow the colon with a color\nspecification.  To read the CAPTION format, follow the colon with a text\nstring or with a filename prefixed with the at symbol (<strong>@</strong>).\n<br>&nbsp;<br>\n<p>\nWhen you specify <strong>X</strong> as your image type, the filename has special\nmeaning. It specifies an X window by <strong>id, name</strong>, or\n<strong>root</strong>. If\nno filename is specified, the window is selected by clicking the mouse\nin the desired window.\n<p>\nSpecify <em>input_file</em> as <strong>-</strong> for standard input,\n<em>output_file</em> as <strong>-</strong> for standard output.\nIf <em>input_file</em> has the extension <strong>.Z</strong> or <strong>.gz</strong>, the\nfile is uncompressed with <strong>uncompress</strong> or <strong>gunzip</strong>\nrespectively.\nIf <em>output_file</em> has the extension <strong>.Z</strong> or <strong>.gz</strong>,\nthe file is compressed using with <em>compress</em> or <em>gzip</em> respectively.\n<p>\nUse an optional index enclosed in brackets after an input file name to\nspecify a desired subimage of a multi-resolution image format like\nPhoto CD (e.g. <tt>\"img0001.pcd[4]\"</tt>) or a range for MPEG images\n(e.g. <tt>\"video.mpg[50-75]\"</tt>). A subimage specification can be\ndisjoint (e.g. <tt>\"image.tiff[2,7,4]\"</tt>). For raw images, specify\na subimage with a geometry (e.g. <tt>-size 640x512</tt>\n<tt>\"image.rgb[320x256+50+50]\"</tt>).  Surround the image name with\nquotation marks to prevent your shell from interpreting the square\nbrackets. <p>Single images are written with the filename you\nspecify. However, multi-part images (e.g., a multi-page PostScript\ndocument with <strong>+adjoin</strong> specified) may be written with the scene\nnumber included as part of the filename. In order to include the scene\nnumber in the filename, it is necessary to include a printf-style\n<tt>%d</tt> format specification in the file name and use the +adjoin\noption. For example,\n<pre>\n    image%02d.miff\n</pre>\n<p>\nwrites files <em>image00.miff, image01.miff,</em> etc. Only a single\nspecification is allowed within an output filename. If more than one\nspecification is present, it will be ignored. It is best to embed the\nscene number in the base part of the file name, not in the extension,\nbecause the extension will not be a recognizeable image type.\n<p>\nWhen running a commandline utility, you can\nprepend an at sign <tt>@</tt> to a filename to read a list of image\nfilenames from that file. This is convenient in the event you have too\nmany image filenames to fit on the command line.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images that follows,\nuntil the set is terminated by the appearance of any option or <strong>-noop</strong>.\nSome options only affect the decoding of images and others only the encoding.\nThe latter can appear after the final group of input images.\n<p>\nThis is a combined list of the command-line options used by the\nGraphicsMagick utilities (<em>animate</em>, <em>compare</em>,\n<em>composite</em>, <em>convert</em>, <em>display</em>, <em>identify</em>,\n<em>import</em>, <em>mogrify</em> and <em>montage</em>).\n<br>&nbsp;<br>\n<p>\nIn this document, angle brackets (\"&lt;&gt;\") enclose variables and curly\nbrackets (\"{}\") enclose optional parameters. For example,\n\"<strong>-fuzz &lt;distance&gt;{%}</strong>\" means you can use the\noption <tt>\"-fuzz 10\"</tt>\nor <tt>\"-fuzz 2%\"</tt>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-adjoin\"></a>-adjoin\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>join images into a single multi-image file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, all images of an image sequence are stored in the same\nfile. However, some formats (e.g. JPEG) do not support storing more\nthan one image per file and only the first frame in an image sequence\nwill be saved unless the result is saved to separate files. Use\n<strong>+adjoin</strong> to force saving multiple frames to multiple numbered\nfiles. If <strong>+adjoin</strong> is used, then the output filename must\ninclude a printf style formatting specification for the numeric part\nof the filename.  For example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    image%02d.miff\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-affine\"></a>-affine <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>drawing transform matrix</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option provides a transform matrix <tt>{sx,rx,ry,sy,tx,ty}</tt> for\nuse by subsequent <strong>-draw</strong> or <strong>-transform</strong> options.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-antialias\"></a>-antialias\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixel aliasing</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default antialiasing algorithms are used when drawing objects (e.g. lines)\nor rendering vector formats (e.g. WMF and Postscript). Use +antialias to\ndisable use of antialiasing algorithms. Reasons to disable antialiasing\ninclude avoiding increasing colors in the image, or improving rendering speed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-append\"></a>-append\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>append a set of images</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option creates a single image where the images in the original set\nare stacked top-to-bottom.  If they are not of the same width,\nany narrow images will be expanded to fit using the background color.\nUse <strong>+append</strong> to stack images left-to-right.  The set of images\nis terminated by the appearance of any option.\nIf the <strong>-append</strong>\noption appears after all of the input images, all images are appended.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details\"></a> <i>-asc-cdl &lt;spec&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply ASC CDL color transform</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nApplies (\"bakes in\") the ASC CDL, which is a format for the exchange\nof basic primary color grading information between equipment and\nsoftware from different manufacturers. The format defines the math for\nthree functions: slope, offset and power. Each function uses a number\nfor the red, green, and blue color channels for a total of nine\nnumbers comprising a single color decision. The tenth number\n(optional) is for chromiance (saturation) as specified by ASC CDL\n1.2.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe argument string is comma delimited and is in the following form\n(but without invervening spaces or line breaks)</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    redslope,redoffset,redpower:\n    greenslope,greenoffset,greenpower:\n    blueslope,blueoffset,bluepower:\n    saturation\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nwith the unity (no change) specification being:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    \"1.0,0.0,1.0:1.0,0.0,1.0:1.0,0.0,1.0:1.0\"\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-authenticate\"></a>-authenticate <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to supply a password for decrypting an image or an\nimage sequence, if it is being read from a format such as PDF that supports\nencryption.  Encrypting images being written is not supported.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-auto-orient\"></a>-auto-orient\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>orient (rotate) image so it is upright</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAdjusts the image orienation so that it is suitable for viewing.  Uses\nthe orientation tag obtained from the image file or as supplied by the\n<strong>-orient</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-average\"></a>-average\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>average a set of images</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe set of images\nis terminated by the appearance of any option.\nIf the <strong>-average</strong>\noption appears after all of the input images, all images are averaged.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-backdrop\"></a>-backdrop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the image centered on a backdrop.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis backdrop covers the entire workstation screen and is useful for hiding\nother X window activity while viewing the image. The color of the backdrop\nis specified as the foreground color (X11 default is black).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Refer to\n\"X Resources\", below,\nfor details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-background\"></a>-background <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-black-threshold\"></a>-black-threshold <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels below the threshold become black</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>-black-threshold</strong> to set pixels with values below the specified\nthreshold to minimum value (black). If only one value is supplied, or the\nred, green, and blue values are identical, then intensity thresholding is\nused. If the color threshold values are not identical then channel-based\nthresholding is used, and color distortion will occur. Specify a negative\nvalue (e.g. -1) if you want a channel to be ignored but you do want to\nthreshold a channel later in the list. If a percent (%) symbol is\nappended, then the values are treated as a percentage of maximum\nrange.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-blue-primary\"></a>-blue-primary <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-blur\"></a>-blur <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBlur with the given radius and\nstandard deviation (sigma).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-border\"></a>-border <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with a border of color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details\nabout the geometry specification.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-bordercolor\"></a>-bordercolor <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -borderwidth <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-box\"></a>-box <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the color of the annotation bounding box</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-draw</strong> for further\ndetails.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-channel\"></a>-channel <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of channel</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from: <strong>Red</strong>, <strong>Green</strong>, <strong>Blue</strong>, <strong>Opacity</strong>,\n<strong>Matte</strong>, <strong>Cyan</strong>, <strong>Magenta</strong>, <strong>Yellow</strong>, <strong>Black</strong>,\nor <strong>Gray</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to extract a particular <em>channel</em> from the image.\n<strong>Opacity</strong>,\nfor example, is useful for extracting the opacity values from an image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -charcoal <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate a charcoal drawing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-chop\"></a>-chop <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixels from the interior of an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>Width</em> and <em>height</em> give the number of columns and rows to remove,\nand <em>x</em> and <em>y</em> are offsets that give the location of the\nleftmost column and topmost row to remove.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <em>x</em> offset normally specifies the leftmost column to remove.\nIf the <strong>-gravity</strong> option is present with <em>NorthEast, East,</em>\nor <em>SouthEast</em>\ngravity, it gives the distance leftward from the right edge\nof the image to the rightmost column to remove.  Similarly, the <em>y</em> offset\nnormally specifies the topmost row to remove, but if\nthe <strong>-gravity</strong> option is present with <em>SouthWest, South,</em>\nor <em>SouthEast</em>\ngravity, it specifies the distance upward from the bottom edge of the\nimage to the bottom row to remove.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-chop</strong> option removes entire rows and columns,\nand moves the remaining corner blocks leftward and upward to close the gaps.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-clip\"></a>-clip\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply the clipping path, if one is present</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf a clipping path is present, it will be applied to subsequent operations.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, if you type the following command:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -clip -negate cockatoo.tif negated.tif\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nonly the pixels within the clipping path are negated.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-clip</strong> feature requires the XML library.  If the XML library\nis not present, the option is ignored.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-coalesce\"></a>-coalesce\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>merge a sequence of images</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEach image N in the sequence after Image 0 is replaced with the image\ncreated by flattening images 0 through N.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe set of images\nis terminated by the appearance of any option.\nIf the <strong>-coalesce</strong>\noption appears after all of the input images, all images are coalesced.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-colorize\"></a>-colorize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colorize the image with the pen color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify the amount of colorization as a percentage. You can apply separate\ncolorization values to the red, green, and blue channels of the image with\na colorization value list delimited with slashes (e.g. 0/0/50).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-colorize</strong> option may be used in conjunction with <strong>-modulate</strong>\nto produce a nice sepia toned image like:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert input.ppm -modulate 115,0,100 \\\n              -colorize 7,21,50 output.ppm.\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-colormap\"></a>-colormap <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the colormap type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose between <strong>shared</strong> or <strong>private</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option only applies when the default X server visual is <em>PseudoColor</em>\nor <em>GRAYScale</em>. Refer to <strong>-visual</strong> for more details. By default,\na shared colormap is allocated. The image shares colors with other X clients.\nSome image colors could be approximated, therefore your image may look\nvery different than intended. Choose <strong>Private</strong> and the image colors\nappear exactly as they are defined. However, other clients may\ngo <em>technicolor</em> when the image colormap is installed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-colors\"></a>-colors <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe actual number of colors in the image may be less than your request,\nbut never more. Note, this is a color reduction option. Images with less\nunique colors than specified with this option will have any duplicate or\nunused colors removed. The ordering of an existing color palette may be\naltered. When converting an image from color to grayscale, convert the\nimage to the gray colorspace before reducing the number of colors since\ndoing so is most efficient. Refer to &lt;a\nhref=\"quantize.html\"&gt;quantize</a> for more details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nNote, options <strong>-dither</strong>, <strong>-colorspace</strong>, and <strong>-treedepth</strong>\naffect the color reduction algorithm.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-colorspace\"></a>-colorspace <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are:\n<strong>CineonLog</strong>, <strong>CMYK</strong>, <strong>GRAY</strong>, <strong>HSL</strong>, <strong>HWB</strong>,\n<strong>OHTA</strong>, <strong>RGB</strong>, <strong>Rec601Luma</strong>, <strong>Rec709Luma</strong>,\n<strong>Rec601YCbCr</strong>, <strong>Rec709YCbCr</strong>, <strong>Transparent</strong>, <strong>XYZ</strong>,\n<strong>YCbCr</strong>, <strong>YIQ</strong>, <strong>YPbPr</strong>, or <strong>YUV</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nColor reduction, by default, takes place in the RGB color space. Empirical\nevidence suggests that distances in color spaces such as YUV or YIQ correspond\nto perceptual color differences more closely than do distances in RGB space.\nThese color spaces may give better results when color reducing an image.\nRefer to <a href=\"quantize.html\">quantize</a> for more details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Two gray colorspaces are supported. The <strong>Rec601Luma</strong> space is\nbased on the recommendations for legacy NTSC television (ITU-R\nBT.601-5).  The <strong>Rec709Luma</strong> space is based on the\nrecommendations for HDTV (Rec. ITU-R BT.709-5) and is suitable for use\nwith computer graphics, and for contemporary CRT displays. The\n<strong>GRAY</strong> colorspace currently selects the <strong>Rec601Luma</strong>\ncolorspace by default for backwards compatibly reasons. This default\nmay be re-considered in the future.\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Two YCbCr colorspaces are supported. The <strong>Rec601YCbCr</strong> space is\nbased on the recommendations for legacy NTSC television (ITU-R BT.601-5). The\n<strong>Rec709CbCr</strong> space is based on the recommendations for HDTV (Rec.\nITU-R BT.709-5) and is suitable for suitable for use with computer\ngraphics, and for contemporary CRT displays. The <strong>YCbCr</strong> colorspace\nspecification is equivalent to<strong>Rec601YCbCr</strong>.\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>Transparent</strong> color space behaves uniquely in that it preserves\nthe matte channel of the image if it exists.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-colors</strong> or <strong>-monochrome</strong> option, or saving to a file\nformat which requires color reduction, is required for this option to\ntake effect.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-comment\"></a>-comment <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to assign a specific comment to the image, when writing\nto an image format that supports comments. You can include the\nimage filename, type, width, height, or other image attribute by embedding\nspecial format characters listed under the <strong>-format</strong> option.\nThe comment is not drawn on the image, but is embedded in the image\ndatastream via a \"Comment\" tag or similar mechanism.  If you want the\ncomment to be visible on the image itself, use the <strong>-draw</strong> option\ninstead.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -comment \"%m:%f %wx%h\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nproduces an image comment of <strong>MIFF:bird.miff 512x480</strong> for an image\ntitled <strong>bird.miff</strong> and whose width is 512 and height is 480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the first character of <em>string</em> is <em>@</em>, the image comment\nis read from a file titled by the remaining characters in the string.\nPlease note that if the string comes from an untrusted source that it\nshould be sanitized before use since otherwise the content of an\narbitrary readable file could be incorporated in a comment in the\noutput file (a security risk).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the -comment option appears multiple times, only the last comment is\nstored.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn PNG images, the comment is stored in a <strong>tEXt</strong> or <strong>zTXt</strong> chunk\nwith the keyword \"comment\".</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-compose\"></a>-compose <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe description of composition uses abstract terminology in order to\nallow the the description to be more clear, while avoiding constant\nvalues which are specific to a particular build configuration. Each image\npixel is represented by red, green, and blue levels (which are equal for\na gray pixel). MaxRGB is the maximum integral value which may be stored\nin the red, green, or blue channels of the image. Each image pixel may\nalso optionally (if the image matte channel is enabled) have an\nassociated level of opacity (ranging from opaque to transparent), which\nmay be used to determine the influence of the pixel color when\ncompositing the pixel with another image pixel. If the image matte\nchannel is disabled, then all pixels in the image are treated as opaque.\nThe color of an <em>opaque</em> pixel is fully visible while the color of a\n<em>transparent</em> pixel color is entirely absent (pixel color is ignored).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy definition, raster images have a rectangular shape. All image rows are\nof equal length, and all image columns have the same number of rows. By\ntreating the opacity channel as a visual \"mask\" the rectangular image may\nbe given a \"shape\" by treating the opacity channel as a cookie-cutter for\nthe image. Pixels within the shape are opaque, while pixels outside the\nshape are transparent. Pixels on the boundary of the shape may be between\nopaque and transparent in order to provide antialiasing (visually smooth\nedges). The description of the composition operators use this concept of\nimage \"shape\" in order to make the description of the operators easier to\nunderstand. While it is convenient to describe the operators in terms of\n\"shapes\" they are by no means limited to mask-style operations since they\nare based on continuous floating-point mathematics rather than simple\nboolean operations.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, the <em>Over</em> composite operator is used. The following\ncomposite operators are available:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Over\n     In\n     Out\n     Atop\n     Xor\n     Plus\n     Minus\n     Add\n     Subtract\n     Difference\n     Divide\n     Multiply\n     Bumpmap\n     Copy\n     CopyRed\n     CopyGreen\n     CopyBlue\n     CopyOpacity\n     CopyCyan\n     CopyMagenta\n     CopyYellow\n     CopyBlack\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe behavior of each operator is described below.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>Over</dt>\n<dd>The result will be the union of the two image shapes, with opaque areas\nof <em>change-image</em> obscuring <em>base-image</em> in the region of\noverlap.\n</dd>\n<dt>In</dt>\n<dd>The result is simply <em>change-image</em> cut by the shape of\n<em>base-image</em>. None of the image data of <em>base-image</em> will be in\nthe result.\n</dd>\n<dt>Out</dt>\n<dd>The resulting image is <em>change-image</em> with the shape of\n<em>base-image</em> cut out.\n</dd>\n<dt>Atop</dt>\n<dd>The result is the same shape as <em>base-image</em>, with\n<em>change-image</em> obscuring <em>base-image</em> where the image shapes\noverlap. Note this differs from <strong>over</strong> because the portion of\n<em>change-image</em> outside <em>base-image</em>'s shape does not appear in\nthe result.\n</dd>\n<dt>Xor</dt>\n<dd>The result is the image data from both <em>change-image</em> and\n<em>base-image</em> that is outside the overlap region. The overlap region\nwill be blank.\n</dd>\n<dt>Plus</dt>\n<dd>The result is just the sum of the image data. Output values are cropped\nto MaxRGB (no overflow). This operation is independent of the matte\nchannels.\n</dd>\n<dt>Minus</dt>\n<dd>The result of <em>change-image</em> - <em>base-image</em>, with underflow\ncropped to zero. The matte channel is ignored (set to opaque, full\ncoverage).\n</dd>\n<dt>Add</dt>\n<dd>The result of <em>change-image</em> + <em>base-image</em>, with overflow\nwrapping around (<em>mod</em> MaxRGB+1).\n</dd>\n<dt>Subtract</dt>\n<dd>The result of <em>change-image</em> - <em>base-image</em>, with underflow\nwrapping around (<em>mod</em> MaxRGB+1). The <strong>add</strong> and <strong>subtract</strong>\noperators can be used to perform reversible transformations.\n</dd>\n<dt>Difference</dt>\n<dd>The result of abs(<em>change-image</em> - <em>base-image</em>). This is\nuseful for comparing two very similar images.\n</dd>\n<dt>Divide</dt>\n<dd>The result of <em>change-image</em> / <em>base-image</em>. This is useful\nfor improving the readability of text on unevenly illuminated photos (by\nusing a gaussian blurred copy of change-image as base-image).\n</dd>\n<dt>Multiply</dt>\n<dd>The result of <em>change-image</em> * <em>base-image</em>. This is useful for\nthe creation of drop-shadows.\n</dd>\n<dt>Bumpmap</dt>\n<dd>The result <em>base-image</em> shaded by <em>change-image</em>.\n</dd>\n<dt>Copy</dt>\n<dd>The resulting image is <em>base-image</em> replaced with\n<em>change-image</em>. Here the matte information is ignored.\n</dd>\n<dt>CopyRed</dt>\n<dd>The resulting image is the red channel in <em>base-image</em> replaced with\nthe red channel in <em>change-image</em>. The other channels are copied\nuntouched.\n</dd>\n<dt>CopyGreen</dt>\n<dd>The resulting image is the green channel in <em>base-image</em> replaced\nwith the green channel in <em>change-image</em>. The other channels are\ncopied untouched.\n</dd>\n<dt>CopyBlue</dt>\n<dd>The resulting image is the blue channel in <em>base-image</em> replaced\nwith the blue channel in <em>change-image</em>. The other channels are\ncopied untouched.\n</dd>\n<dt>CopyOpacity</dt>\n<dd>The resulting image is the opacity channel in <em>base-image</em> replaced\nwith the opacity channel in <em>change-image</em>. The other channels are\ncopied untouched.\n</dd>\n<dt>CopyCyan</dt>\n<dd>The resulting image is the cyan channel in <em>base-image</em> replaced\nwith the cyan channel in <em>change-image</em>. The other channels are\ncopied untouched. Use of this operator requires that base-image be in\nCMYK(A) colorspace.\n</dd>\n<dt>CopyMagenta</dt>\n<dd>The resulting image is the magenta channel in <em>base-image</em>\nreplaced with the magenta channel in <em>change-image</em>. The other\nchannels are copied untouched. Use of this operator requires that\nbase-image be in CMYK(A) colorspace.\n</dd>\n<dt>CopyYellow</dt>\n<dd>The resulting image is the yellow channel in <em>base-image</em>\nreplaced with the yellow channel in <em>change-image</em>. The other\nchannels are copied untouched. Use of this operator requires that\nbase-image be in CMYK(A) colorspace.\n</dd>\n<dt>CopyBlack</dt>\n<dd>The resulting image is the black channel in <em>base-image</em>\nreplaced with the black channel in <em>change-image</em>. The other\nchannels are copied untouched. Use of this operator requires that\nbase-image be in CMYK(A) colorspace. If change-image is not in CMYK\nspace, then the change-image pixel intensities are used.\n</dd>\n</dl>\n</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-compress\"></a>-compress <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are: <em>None</em>, <em>BZip</em>, <em>Fax</em>,\n<em>Group3</em>, <em>Group4</em>,\n<em>JPEG</em>, <em>Lossless</em>,\n<em>LZW</em>, <em>RLE</em>, <em>Zip</em>, <em>LZMA</em>, <em>JPEG2000</em>,\n<em>JPEG2000</em>, <em>JBIG</em>, <em>JBIG2</em>, <em>WebP</em>, or <em>ZSTD</em>.\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <strong>+compress</strong> to store the binary image in an uncompressed format.\nThe default is the compression type of the specified image file.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>\"Lossless\"</em> refers to lossless JPEG, which is only available if\nthe JPEG library has been patched to support it. Use of lossless JPEG is\ngenerally not recommended.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the <strong>-quality</strong> option to set the compression level to be used\nby the JPEG, JPEG-2000, PNG, MIFF, MPEG, and TIFF encoders. Use the\n<strong>-sampling-factor</strong> option to set the sampling factor to be used\nby the DPX, JPEG, MPEG, and YUV encoders for downsampling the chroma\nchannels.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-contrast\"></a>-contrast\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enhance or reduce the image contrast</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option enhances the intensity differences between the lighter and\ndarker elements of the image. Use <strong>-contrast</strong> to enhance\nthe image\nor <strong>+contrast</strong> to reduce the image contrast.\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor a more pronounced effect you can repeat the option:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert rose: -contrast -contrast rose_c2.png\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-convolve\"></a>-convolve <i>&lt;kernel&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>convolve image with the specified convolution kernel</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe kernel is specified as a comma-separated list of floating point\nvalues, ordered left-to right, starting with the top row. The order of\nthe kernel is determined by the square root of the number of entries.\nPresently only square kernels are supported.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-create-directories\"></a>-create-directories\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create output directory if required</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option with <strong>-output-directory</strong> if the input paths contain\nsubdirectories and it is desired to create similar subdirectories in the\noutput directory.  Without this option, <strong>mogrify</strong> will fail if the\nrequired output directory does not exist.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-crop\"></a>-crop <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details\nabout the geometry specification.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe width and height give the size of the image that remains after cropping,\nand <em>x</em> and <em>y</em> are offsets that give the location of the top left\ncorner of the cropped\nimage with respect to the original image.  To specify the amount to be\nremoved, use <strong>-shave</strong> instead.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the <em>x</em> and <em>y</em> offsets are present, a single image is\ngenerated, consisting of the pixels from the cropping region.\nThe offsets specify the location of the upper left corner of\nthe cropping region measured downward and rightward with respect to the\nupper left corner of the image.\nIf the <strong>-gravity</strong> option is present with <em>NorthEast, East,</em>\nor <em>SouthEast</em>\ngravity, it gives the distance leftward from the right edge\nof the image to the right edge of the cropping region.  Similarly, if\nthe <strong>-gravity</strong> option is present with <em>SouthWest, South,</em>\nor <em>SouthEast</em>\ngravity, the distance is measured upward between the bottom\nedges.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the <em>x</em> and <em>y</em> offsets are omitted, a set of tiles of the\nspecified geometry, covering the entire input image, is generated.  The\nrightmost tiles and the bottom tiles are smaller if the\nspecified geometry extends beyond the dimensions of the input image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-cycle\"></a>-cycle <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image colormap by amount</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>Amount</em> defines the number of positions each colormap entry isshifted.\n</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <tt>events</tt> parameter specifies which events are to be logged.  It\ncan be either <tt>None</tt>, <tt>All</tt>, or a comma-separated list\nconsisting of one or more of the following domains:\n<tt>Annotate</tt>,\n<tt>Blob</tt>,\n<tt>Cache</tt>,\n<tt>Coder</tt>,\n<tt>Configure</tt>,\n<tt>Deprecate</tt>,\n<tt>Error</tt>,\n<tt>Exception</tt>,\n<tt>FatalError</tt>,\n<tt>Information</tt>,\n<tt>Locale</tt>,\n<tt>Option</tt>,\n<tt>Render</tt>,\n<tt>Resource</tt>,\n<tt>TemporaryFile</tt>,\n<tt>Transform</tt>,\n<tt>User</tt>.\n<tt>Warning</tt>, or\n<tt>X11</tt>,\nFor example, to log cache and blob events, use</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -debug \"Cache,Blob\" rose: rose.png\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe \"User\" domain is normally empty, but developers can log \"User\" events\nin their private copy of GraphicsMagick.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the <strong>-log</strong> option to specify the format for debugging output.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+debug</strong> to turn off all logging.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAn alternative to using <strong>-debug</strong> is to use the <strong>MAGICK_DEBUG</strong>\nenvironment variable. The allowed values for the <strong>MAGICK_DEBUG</strong>\nenvironment variable are the same as for the <strong>-debug</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-deconstruct\"></a>-deconstruct\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>break down an image sequence into constituent parts</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option compares each image with the next in a sequence and\nreturns the maximum bounding region of any pixel differences it discovers.\nThis method can undo a coalesced sequence returned by the\n<strong>-coalesce</strong> option, and is useful for removing redundant information\nfrom a GIF or MNG animation.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images\nis terminated by the appearance of any option.\nIf the <strong>-deconstruct</strong>\noption appears after all of the input images, all images are deconstructed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-define\"></a>-define <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">This option creates one or more definitions for coders and\ndecoders to use while reading and writing image data. Definitions\nmay be passed to coders and decoders to control options that are\nspecific to certain image formats. If <em>value</em> is missing for a\ndefinition, an empty-valued definition of a flag will be created with\nthat name. This is used to control on/off options. Use <tt>+define\n&lt;key&gt;,...</tt> to remove definitions previously created. Use\n<tt>+define \"*\"</tt> to remove all existing definitions.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe following definitions may be created:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>cineon:colorspace={rgb|cineonlog}</dt>\n<dd>Use the cineon:colorspace option when reading a Cineon file to\nspecify the colorspace the Cineon file uses. This overrides the colorspace\ntype implied by the DPX header (if any).\n</dd>\n<dt>dpx:bits-per-sample=&lt;value&gt;</dt>\n<dd>If the dpx:bits-per-sample key is defined, GraphicsMagick will write\nDPX images with the specified bits per sample, overriding any existing\ndepth value. If this option is not specified, then the value is based on\nthe existing image depth value from the original image file. The DPX\nstandard supports bits per sample values of 1, 8, 10, 12, and 16. Many\nDPX readers demand a sample size of 10 bits with type A padding (see\nbelow).\n</dd>\n<dt>dpx:colorspace={rgb|cineonlog}</dt>\n<dd>Use the dpx:colorspace option when reading a DPX file to\nspecify the colorspace the DPX file uses. This overrides the colorspace\ntype implied by the DPX header (if any).\n</dd>\n<dt>dpx:packing-method={packed|a|b|lsbpad|msbpad}</dt>\n<dd>DPX samples are output within 32-bit words. They may be tightly\npacked end-to-end within the words (\"packed\"), padded with null bits to\nthe right of the sample (\"a\" or \"lsbpad\"), or padded with null bits to the\nleft of the sample (\"b\" or \"msbpad\"). This option only has an effect for\nsample sizes of 10 or 12 bits. If samples are not packed, the DPX\nstandard recommends type A padding. Many DPX readers demand a sample size\nof 10 bits with type A padding.\n</dd>\n<dt>dpx:pixel-endian={lsb|msb}</dt>\n<dd>Allows the user to specify the endian order of the pixels when\nreading or writing the DPX files. Sometimes this is useful if the file is\n(or must be) written incorrectly so that the file header and the pixels\nuse different endianness.\n</dd>\n<dt>dpx:swap-samples={true|false}</dt>\n<dd>GraphicsMagick strives to adhere to the DPX standard but certain\naspects of the standard can be quite confusing. As a result, some 10-bit\nDPX files have Red and Blue interchanged, or Cb and Cr interchanged due\nto an different interpretation of the standard, or getting the wires\ncrossed. The swap-samples option may be supplied when reading or writing\nin order to read or write using the necessary sample order.\n</dd>\n<dt>gradient:direction={South|North|West|East|NorthWest|NorthEast|SouthWest|SouthEast}</dt>\n<dd>By default, the gradient coder produces a gradient from top to\nbottom (\"South\").  Since GraphicsMagick 1.3.35, the gradient direction\nmay be specified to produce gradient vectors according to a\ngravity-like specification.  The arguments are <strong>South</strong> (Top to\nBottom), <strong>North</strong> (Bottom to Top), <strong>West</strong> (Right to Left),\n<strong>East</strong> (Left to Right), <strong>NorthWest</strong> (Bottom-Right to\nTop-Left), <strong>NorthEast</strong> (Bottom-Left to Top-Right),\n<strong>SouthWest</strong> (Top-Right Bottom-Left), and <strong>SouthEast</strong>\n(Top-Left to Bottom-Right).\n</dd>\n<dt>jp2:rate=&lt;value&gt;</dt>\n<dd>Specify the compression factor to use while writing JPEG-2000\nfiles. The compression factor is the reciprocal of the compression\nratio. The valid range is 0.0 to 1.0, with 1.0 indicating lossless\ncompression. If defined, this value overrides the -quality\nsetting. The default quality setting of 75 results in a rate value of\n0.06641.\n</dd>\n<dt>jpeg:block-smoothing={true|false}</dt>\n<dd>Enables or disables block smoothing when reading a JPEG file\n(default enabled).\n</dd>\n<dt>jpeg:dct-method=&lt;value&gt;</dt>\n<dd>Selects the IJG JPEG library DCT implementation to use. The\nencoding implementations vary in speed and encoding error. The\navailable choices for <strong>value</strong> are <strong>islow</strong>, <strong>ifast</strong>,\n<strong>float</strong>, <strong>default</strong> and <strong>fastest</strong>. Note that\n<strong>fastest</strong> might not necessarily be fastest on your CPU, depending\non the choices made when the JPEG library was built and how your CPU\nbehaves.\n</dd>\n<dt>jpeg:fancy-upsampling={true|false}</dt>\n<dd>Enables or disables fancy upsampling when reading a JPEG file\n(default enabled).\n</dd>\n<dt>jpeg:max-scan-number=&lt;value&gt;</dt>\n<dd>Specifies an integer value for the maximum number of progressive\nscans allowed in a JPEG file.  The default maximum is 100 scans.  This\nlimit is imposed due to a weakness in the JPEG standard which allows\nsmall JPEG files to take many minutes or hours to be read.\n</dd>\n<dt>jpeg:max-warnings=&lt;value&gt;</dt>\n<dd>Specifies an integer value for how many warnings are allowed for\nany given error type before being promoted to a hard error.  JPEG\nfiles producing excessive warnings indicate a problem with the file.\n</dd>\n<dt>jpeg:optimize-coding={true|false}</dt>\n<dd>Selects if huffman encoding should be used. Huffman encoding is enabled\nby default, but may be disabled for very large images since it encoding\nrequires that the entire image be buffered in memory. Huffman encoding\nproduces smaller JPEG files at the expense of added compression time and\nmemory consumption.\n</dd>\n<dt>jpeg:preserve-settings</dt>\n<dd>If the jpeg:preserve-settings flag is defined, the JPEG encoder will\nuse the same \"quality\" and \"sampling-factor\" settings that were found\nin the input file, if the input was in JPEG format. These settings are\nalso preserved if the input is a JPEG file and the output is a JNG\nfile.  If the colorspace of the output file differs from that of the\ninput file, the quality setting is preserved but the sampling-factors\nare not.\n</dd>\n<dt>pcl:fit-to-page</dt>\n<dd>If the pcl:fit-to-page flag is defined, then the printer is\nrequested to scale the image to fit the page size (width and/or\nheight).</dd>\n<dt>mng:maximum-loops=&lt;value&gt;</dt>\n<dd>mng:maximum-loops specifies the maximum number of loops allowed to\nbe specified by a MNG LOOP chunk. Without an imposed limit, a MNG file\ncould request up to 2147483647 loops, which could run for a very long\ntime.  The current default limit is 512 loops.\n</dd>\n<dt>pdf:use-cropbox={true|false}</dt>\n<dd>If the pdf:use-cropbox flag is set to <strong>true</strong>, then\nGhostscript is requested to apply the PDF crop box.\n</dd>\n<dt>pdf:stop-on-error={true|false}</dt>\n<dd>If the pdf:stop-on-error flag is set to <strong>true</strong>, then\nGhostscript is requested to stop processing the PDF when the first\nerror is encountered.  Otherwise it will attempt to process all\nrequested pages.\n</dd>\n<dt>ps:imagemask</dt>\n<dd>If the ps:imagemask flag is defined, the PS3 and EPS3 coders will\ncreate Postscript files that render bilevel images with the Postscript\nimagemask operator instead of the image operator.\n</dd>\n<dt>ptif:minimum-geometry=&lt;geometry&gt;</dt>\n<dd>If the ptif:minimum-geometry key is defined, GraphicsMagick will\nuse it to determine the minimum frame size to output when writing a\npyramid TIFF file (a TIFF file containing a succession of reduced\nversions of the first frame). The default minimum geometry is 32x32.\n</dd>\n<dt>tiff:alpha={unspecified|associated|unassociated}</dt>\n<dd>Specify the TIFF alpha channel type when reading or writing TIFF files,\noverriding the normal value. The default alpha channel type for new files\nis unspecified alpha. Existing alpha settings are preserved when\nconverting from one TIFF file to another. When a TIFF file uses\nassociated alpha, the image pixels are pre-multiplied (i.e. altered) with\nthe alpha channel. Files with \"associated\" alpha appear as if they were\nalpha composited on a black background when the matte channel is\ndisabled. If the unassociated alpha type is selected, then the alpha\nchannel is saved without altering the pixels. Photoshop recognizes\nassociated alpha as transparency information, if the file is saved with\nunassociated alpha, the alpha information is loaded as an independent\nchannel.  Note that for many years, ImageMagick and GraphicsMagick marked\nTIFF files as using associated alpha, without properly pre-multiplying\nthe pixels.\n</dd>\n<dt>tiff:fill-order={msb2lsb|lsb2msb}</dt>\n<dd>If the tiff:fill-order key is defined, GraphicsMagick will use it to\ndetermine the bit fill order used while writing TIFF files. The normal default\nis \"msb2lsb\", which matches the native bit order of all modern CPUs. The\nonly exception to this is when Group3 or Group4 FAX compression is\nrequested since FAX machines send data in bit-reversed order and\ntherefore RFC 2301 recommends using reverse order.\n</dd>\n<dt>tiff:group-three-options=&lt;value&gt;</dt>\n<dd>If the tiff:group-three-options key is defined, GraphicsMagick\nwill use it to set the group3 options tag when writing\ngroup3-compressed TIFF.  Please see the TIFF specification for the\nusage of this tag.  The default value is 4.\n</dd>\n<dt>tiff:ignore-tags=&lt;tags&gt;</dt>\n<dd>If the tiff:ignore-tags key is defined, then it is used as a list\nof comma-delimited integer TIFF tag values to ignore while reading the\nTIFF file.  This is useful in order to be able to read files which\nwhich otherwise fail to read due to problems with TIFF tags.  Note\nthat some TIFF tags are required in order to be able to read the image\ndata at all.\n</dd>\n<dt>tiff:report-warnings={false|true}</dt>\n<dd>If the tiff:report-warnings key is defined and set to <strong>true</strong>,\nthen TIFF warnings are reported as a warning exception rather than as\na coder log message.  Such warnings are reported after the image has\nbeen read or written.  Most TIFF warnings are benign but sometimes\nthey may help deduce problems with the TIFF file, or help detect that\nthe TIFF file requires a special application to read successfully due\nto the use of proprietary or specialized extensions.\n</dd>\n<dt>tiff:sample-format={unsigned|ieeefp}</dt>\n<dd>If the tiff:sample-format key is defined, GraphicsMagick will use it to\ndetermine the sample format used while writing TIFF files. The default is\n\"unsigned\". Specify \"ieeefp\" in order to write floating-point TIFF\nfiles with float (32-bit) or double (64-bit) values. Use the\ntiff:bits-per-sample define to determine the type of floating-point value\nto use.\n</dd>\n<dt>tiff:max-sample-value=&lt;value&gt;</dt>\n<dd>If the tiff:max-sample-value key is defined, GraphicsMagick will use the\nassigned value as the maximum floating point value while reading or\nwriting IEEE floating point TIFFs. Otherwise the maximum value is 1.0 or\nthe value obtained from the file's SMaxSampleValue tag (if present). The\nfloating point data is currently not scanned in advance to determine a\nbest maximum sample value so if the range is not 1.0, or the\nSMaxSampleValue tag is not present, it may be necessary to\n(intelligently) use this parameter to properly read a file.\n</dd>\n<dt>tiff:min-sample-value=&lt;value&gt;</dt>\n<dd>If the tiff:min-sample-value key is defined, GraphicsMagick will use\nthe assigned value as the minimum floating point value while reading or\nwriting IEEE floating point TIFFs. Otherwise the minimum value is 0.0 or\nthe value obtained from the file's SMinSampleValue tag (if present).\n</dd>\n<dt>tiff:bits-per-sample=&lt;value&gt;</dt>\n<dd>If the tiff:bits-per-sample key is defined, GraphicsMagick will write\nimages with the specified bits per sample, overriding any existing depth\nvalue. Value may be any in the range of 1 to 32, or 64 when the default\n'unsigned' format is written, or 16/32/24/64 if IEEEFP format is written.\nPlease note that the baseline TIFF 6.0 specification only requires\nreaders to handle certain powers of two, and the values to be handled\ndepend on the nature of the image (e.g. colormapped, grayscale, RGB, CMYK).\n</dd>\n<dt>tiff:samples-per-pixel=&lt;value&gt;</dt>\n<dd>If the tiff:samples-per-pixel key is defined to a value, the TIFF coder\nwill write TIFF images with the defined samples per pixel, overriding any\nvalue stored in the image. This option should not normally be used.\n</dd>\n<dt>tiff:rows-per-strip=&lt;value&gt;</dt>\n<dd>Allows the user to specify the number of rows per TIFF strip.\nRounded up to a multiple of 16 when using JPEG compression. Ignored when\nusing tiles.\n</dd>\n<dt>tiff:strip-per-page=true</dt>\n<dd>Requests that the image is written in a single TIFF strip. This is\nnormally the default when group3 or group4 compression is requested\nwithin reasonable limits. Requesting a single strip for large images may\nresult in failure due to resource consumption in the writer or reader.\n</dd>\n<dt>tiff:tile</dt>\n<dd>Enable writing tiled TIFF (rather than stripped) using the default tile\nsize. Tiled TIFF organizes the image as an array of smaller images\n(tiles) in order to enable random access.\n</dd>\n<dt>tiff:tile-geometry=&lt;width&gt;x&lt;height&gt;</dt>\n<dd>Specify the tile size to use while writing tiled TIFF. Width and\nheight should be a multiple of 16. If the value is not a multiple of 16,\nthen it will be rounded down. Enables tiled TIFF if it has not already\nbeen enabled. GraphicsMagick does not use tiled storage internally so\ntiles need to be converted back and forth from the internal\nscanline-oriented storage to tile-oriented storage. Testing with typical\nRGB images shows that useful square tile size values range from 128x128\nto 1024x1024. Large images which require using a disk-based pixel cache\nbenefit from large tile sizes while images which fit in memory work well\nwith smaller tile sizes.\n</dd>\n<dt>tiff:tile-width=&lt;width&gt;</dt>\n<dd>Specify the tile width to use while writing tiled TIFF. The tile height\nis then defaulted to an appropriate size. Width should be a multiple of\n16. If the value is not a multiple of 16, then it will be rounded down.\nEnables tiled TIFF if it has not already been enabled.\n</dd>\n<dt>tiff:tile-height=&lt;height&gt;</dt>\n<dd>Specify the tile height to use while writing tiled TIFF. The tile width\nis then defaulted to an appropriate size. Height should be a multiple of\n16. If the value is not a multiple of 16, then it will be rounded down.\nEnables tiled TIFF if it has not already been enabled.\n</dd>\n<dt>tiff:webp-lossless={TRUE|FALSE}</dt>\n<dd>Specify a value of <strong>TRUE</strong> to enable lossless mode while\nwriting WebP-compressed TIFF files. The WebP <strong>webp:lossless</strong>\noption may also be used.  The quality factor set by the\n<strong>-quality</strong> option may be used to influence the level of effort\nexpended while compressing.\n</dd>\n<dt>tiff:zstd-compress-level=&lt;value&gt;</dt>\n<dd>Specify the compression level to use while writing Zstd-compressed\nTIFF files. The valid range is 1 to 22. If this define is not\nspecified, then the 'quality' value is used such that the default\nquality setting of 75 is translated to a compress level of 9 such that\n'quality' has a useful range of 10-184 if used for this purpose.\n</dd>\n<dt>webp:lossless={true|false}</dt>\n<dd>Enable lossless encoding.\n</dd>\n<dt>webp:method={0-6}</dt>\n<dd>Quality/speed trade-off.\n</dd>\n<dt>webp:image-hint={default,graph,photo,picture}</dt>\n<dd>Hint for image type.\n</dd>\n<dt>webp:target-size=&lt;integer&gt;</dt>\n<dd>Target size in bytes.\n</dd>\n<dt>webp:target-psnr=&lt;float&gt;</dt>\n<dd>Minimal distortion to try to achieve.\n</dd>\n<dt>webp:segments={1-4}</dt>\n<dd>Maximum number of segments to use.\n</dd>\n<dt>webp:sns-strength={0-100}</dt>\n<dd>Spatial Noise Shaping.\n</dd>\n<dt>webp:filter-strength={0-100}</dt>\n<dd>Filter strength.\n</dd>\n<dt>webp:filter-sharpness={0-7}</dt>\n<dd>Filter sharpness.\n</dd>\n<dt>webp:filter-type={0,1}</dt>\n<dd>Filtering type. 0 = simple, 1 = strong (only used if\nfilter-strength &gt; 0 or autofilter is enabled).\n</dd>\n<dt>webp:auto-filter={true|false}</dt>\n<dd>Auto adjust filter's strength.\n</dd>\n<dt>webp:alpha-compression=&lt;integer&gt;</dt>\n<dd>Algorithm for encoding the alpha plane (0 = none, 1 = compressed\nwith WebP lossless). Default is 1.\n</dd>\n<dt>webp:alpha-filtering=&lt;integer&gt;</dt>\n<dd>Predictive filtering method for alpha plane. 0: none, 1: fast, 2:\nbest. Default is 1.\n</dd>\n<dt>webp:alpha-quality={0-100}</dt>\n<dd>Between 0 (smallest size) and 100 (lossless). Default is 100.\n</dd>\n<dt>webp:pass=[1..10]</dt>\n<dd>Number of entropy-analysis passes.\n</dd>\n<dt>webp:show-compressed={true|false}</dt>\n<dd>Export the compressed picture back.  In-loop filtering is not\napplied.\n</dd>\n<dt>webp:preprocessing=[0,1,2]</dt>\n<dd>0=none, 1=segment-smooth, 2=pseudo-random dithering\n</dd>\n<dt>webp:partitions=[0-3]</dt>\n<dd>log2(number of token partitions) in [0..3].  Default is 0 for\neasier progressive decoding.\n</dd>\n<dt>webp:partition-limit={0-100}</dt>\n<dd>Quality degradation allowed to fit the 512k limit on prediction\nmodes coding (0: no degradation, 100: maximum possible\ndegradation).\n</dd>\n<dt>webp:emulate-jpeg-size={true|false}</dt>\n<dd>If true, compression parameters will be remapped to better match\nthe expected output size from JPEG compression. Generally, the output\nsize will be similar but the degradation will be lower.\n</dd>\n<dt>webp:thread-level=&lt;integer&gt;</dt>\n<dd>If non-zero, try and use multi-threaded encoding.\n</dd>\n<dt>webp:low-memory={true|false}</dt>\n<dd>If set, reduce memory usage (but increase CPU use)\n</dd>\n<dt>webp:use-sharp-yuv={true|false}</dt>\n<dd>If set, if needed, use sharp (and slow) RGB-&gt;YUV conversion\n</dd>\n</dl>\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, to create a postscript file that will render only the black\npixels of a bilevel image, use:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert bilevel.tif -define ps:imagemask eps3:stencil.ps\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-delay\"></a>-delay <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is useful for regulating the animation of image sequences\n<em>Delay/100</em> seconds must expire before the display\nof the next image. The default is no delay between each showing of the\nimage sequence. The maximum delay is 65535.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can specify a delay range (e.g. <em>-delay 10-500</em>) which sets the\nminimum and maximum delay.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-density\"></a>-density <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">This option specifies the image resolution to store while encoding a\nraster image or the canvas resolution while rendering (reading) vector\nformats such as Postscript, PDF, WMF, and SVG into a raster image. Image\nresolution provides the unit of measure to apply when rendering to an\noutput device or raster image. The default unit of measure is in dots\nper inch (DPI). The <strong>-units</strong> option may be used to select dots per\ncentimeter instead.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"> The default resolution is 72 dots per inch, which is equivalent to\none point per pixel (Macintosh and Postscript standard). Computer\nscreens are normally 72 or 96 dots per inch while printers typically\nsupport 150, 300, 600, or 1200 dots per inch. To determine the\nresolution of your display, use a ruler to measure the width of your\nscreen in inches, and divide by the number of horizontal pixels (1024 on\na 1024x768 display).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">If the file format supports it, this option may be used to update\nthe stored image resolution. Note that Photoshop stores and obtains\nimage resolution from a proprietary embedded profile. If this profile is\nnot stripped from the image, then Photoshop will continue to treat the\nimage using its former resolution, ignoring the image resolution\nspecified in the standard file header.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">The density option is an attribute and does not alter the underlying\nraster image. It may be used to adjust the rendered size for desktop\npublishing purposes by adjusting the scale applied to the pixels. To\nresize the image so that it is the same size at a different resolution,\nuse the <strong>-resample</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-depth\"></a>-depth <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis is the number of bits of color to preserve in the image. Any value\nbetween 1 and <strong>QuantumDepth</strong> (build option) may be specified,\nalthough 8 or 16 are the most common values. Use this option to specify\nthe depth of raw images whose depth is unknown such as GRAY, RGB, or\nCMYK, or to change the depth of any image after it has been read.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">The depth option is applied to the pixels immediately so it may be\nused as a form of simple compression by discarding the least significant\nbits. Reducing the depth in advance may speed up color quantization, and\nhelp create smaller file sizes when using a compression algorithm like\nLZW or ZIP.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -descend\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>obtain image by descending window hierarchy</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -despeckle\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>reduce the speckles within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-displace\"></a>-displace <i>&lt;horizontal scale&gt;x&lt;vertical scale&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shift image pixels as defined by a displacement map</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWith this option, <em>composite image</em> is used as a displacement map.  Black,\nwithin the displacement map, is a maximum positive displacement.  White is a\nmaximum negative displacement and middle gray is neutral.  The displacement\nis scaled to determine the pixel shift.  By default, the displacement applies\nin both the horizontal and vertical directions.  However, if you specify\n<em>mask</em>, <em>composite image</em> is the horizontal X displacement and\n<em>mask</em> the vertical Y displacement.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-display\"></a>-display <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is used with convert for\nobtaining image or font from this X server.  See <em>X(1)</em>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-dispose\"></a>-dispose <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe Disposal Method indicates the way in which the graphic is to\nbe treated after being displayed.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nHere are the valid methods:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    Undefined       No disposal specified.\n    None            Do not dispose between frames.\n    Background      Overwrite the image area with\n                    the background color.\n    Previous        Overwrite the image area with\n                    what was there prior to rendering\n                    the image.\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-dissolve\"></a>-dissolve <i>&lt;percent&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>dissolve an image into another by the given percent</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe opacity of the composite image is multiplied by the given percent,\nthen it is composited over the main image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-dither\"></a>-dither\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe basic strategy of dithering is to trade intensity resolution for spatial\nresolution by averaging the intensities of several neighboring pixels.\nImages which suffer from severe contouring when reducing colors can be\nimproved with this option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-colors</strong> or <strong>-monochrome</strong> option is required for this option\nto take effect.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+dither</strong> to turn off dithering and to render PostScript\nwithout text or graphic aliasing. Disabling dithering often (but not\nalways) leads to decreased processing time.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-draw\"></a>-draw <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with one or more graphic primitives</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to annotate an image with one or more graphic primitives.\nThe primitives include shapes, text, transformations,\nand pixel operations.  The shape primitives are</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     point           x,y\n     line            x0,y0 x1,y1\n     rectangle       x0,y0 x1,y1\n     roundRectangle  x0,y0 x1,y1 wc,hc\n     arc             x0,y0 x1,y1 a0,a1\n     ellipse         x0,y0 rx,ry a0,a1\n     circle          x0,y0 x1,y1\n     polyline        x0,y0  ...  xn,yn\n     polygon         x0,y0  ...  xn,yn\n     Bezier          x0,y0  ...  xn,yn\n     path            path specification\n     image           operator x0,y0 w,h filename\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe text primitive is</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     text            x0,y0 string\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe text gravity primitive is</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     gravity         NorthWest, North, NorthEast, West, Center,\n                     East, SouthWest, South, or SouthEast\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe text gravity primitive only affects the placement of text and\ndoes not interact with the other primitives.  It is equivalent to\nusing the <strong>-gravity</strong> commandline option, except that it is\nlimited in scope to the <strong>-draw</strong> option in which it appears.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe transformation primitives are</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     rotate          degrees\n     translate       dx,dy\n     scale           sx,sy\n     skewX           degrees\n     skewY           degrees\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe pixel operation primitives are</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     color           x0,y0 method\n     matte           x0,y0 method\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe shape primitives are drawn in the color specified in the preceding\n<strong>-stroke</strong> option. Except for the <strong>line</strong> and <strong>point</strong>\nprimitives, they are filled with the color specified in the preceding\n<strong>-fill</strong> option.  For unfilled shapes, use <tt>-fill none</tt></font></td></tr></table>.\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Point</strong> requires a single coordinate.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Line</strong> requires a start and end coordinate.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Rectangle</strong>\nexpects an upper left and lower right coordinate.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>RoundRectangle</strong> has the upper left and lower right coordinates\nand the width and height of the corners.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Circle</strong> has a center coordinate and a coordinate for\nthe outer edge.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>Arc</strong> to inscribe an elliptical arc within\na rectangle.  Arcs require a start and end point as well as the degree\nof rotation (e.g. 130,30 200,100 45,90).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>Ellipse</strong> to draw a partial ellipse\ncentered at the given point with the x-axis and y-axis radius\nand start and end of arc in degrees (e.g. 100,100 100,150 0,360).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFinally, <strong>polyline</strong> and <strong>polygon</strong> require\nthree or more coordinates to define its boundaries.\nCoordinates are integers separated by an optional comma.  For example,\nto define a circle centered at 100,100\nthat extends to 150,150 use:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -draw 'circle 100,100 150,150'\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Paths</strong>\n(See <a href=\"http://www.w3.org/TR/SVG/paths.html\">Paths</a>)\nrepresent an outline of an object which is defined in terms of\nmoveto (set a new current point), lineto (draw a straight line),\ncurveto (draw a curve using a cubic Bezier), arc (elliptical or\ncircular arc) and closepath (close the current shape by drawing a line\nto the last moveto) elements. Compound paths (i.e., a path with\nsubpaths, each consisting of a single moveto followed by one or more\nline or curve operations) are possible to allow effects such as\n\"donut holes\" in objects.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>image</strong> to composite an image with another image. Follow the\nimage keyword with the composite operator, image location, image size,\nand filename:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -draw 'image Over 100,100 225,225 image.jpg'\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can use 0,0 for the image size, which means to use the actual\ndimensions found in the image header. Otherwise, it will\nbe scaled to the given dimensions.\nSee <strong>-compose</strong> for a description of the composite operators.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>text</strong> to annotate an image with text. Follow the text\ncoordinates with a string. If the string has embedded spaces, enclose it\nin single or double quotes. Optionally you can include the image\nfilename, type, width, height, or other image attribute by embedding\nspecial format character. See <strong>-comment</strong> for details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -draw 'text 100,100 \"%m:%f %wx%h\"'\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nannotates the image with <tt>MIFF:bird.miff 512x480</tt> for an image titled\n<tt>bird.miff</tt>\nand whose width is 512 and height is 480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the first character of <em>string</em> is <em>@</em>, the text is read\nfrom a file titled by the remaining characters in the string.  Please\nnote that if the string comes from an untrusted source that it should\nbe sanitized before use (a security risk).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Rotate</strong> rotates subsequent shape primitives and text primitives about\nthe origin of the main image. If the <strong>-region</strong> option precedes the\n<strong>-draw</strong> option, the origin for transformations is the upper left\ncorner of the region.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Translate</strong> translates them.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Scale</strong> scales them.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>SkewX</strong> and <strong>SkewY</strong> skew them with respect to the origin of\nthe main image or the region.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe transformations modify the current affine matrix, which is initialized\nfrom the initial affine matrix defined by the <strong>-affine</strong> option.\nTransformations are cumulative within the <strong>-draw</strong> option.\nThe initial affine matrix is not affected; that matrix is only changed by the\nappearance of another <strong>-affine</strong> option.  If another <strong>-draw</strong>\noption appears, the current affine matrix is reinitialized from\nthe initial affine matrix.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>color</strong> to change the color of a pixel to the fill color (see\n<strong>-fill</strong>). Follow the pixel coordinate\nwith a method:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     point\n     replace\n     floodfill\n     filltoborder\n     reset\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nConsider the target pixel as that specified by your coordinate. The\n<strong>point</strong>\nmethod recolors the target pixel. The <strong>replace</strong> method recolors any\npixel that matches the color of the target pixel.\n<strong>Floodfill</strong> recolors\nany pixel that matches the color of the target pixel and is a neighbor,\nwhereas <strong>filltoborder</strong> recolors any neighbor pixel that is not the\nborder color. Finally, <strong>reset</strong> recolors all pixels.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>matte</strong> to the change the pixel matte value to transparent. Follow\nthe pixel coordinate with a method (see the <strong>color</strong> primitive for\na description of methods). The <strong>point</strong> method changes the matte value\nof the target pixel. The <strong>replace</strong> method changes the matte value\nof any pixel that matches the color of the target pixel. <strong>Floodfill</strong>\nchanges the matte value of any pixel that matches the color of the target\npixel and is a neighbor, whereas\n<strong>filltoborder</strong> changes the matte\nvalue of any neighbor pixel that is not the border color (<strong>-bordercolor</strong>).\nFinally <strong>reset</strong> changes the matte value of all pixels.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can set the primitive color, font, and font bounding box\ncolor with\n<strong>-fill</strong>, <strong>-font</strong>, and <strong>-box</strong> respectively. Options\nare processed in command line order so be sure to use these\noptions <em>before</em> the <strong>-draw</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -edge <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>detect edges within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -emboss <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>emboss an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-encoding\"></a>-encoding <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from <em>AdobeCustom, AdobeExpert, AdobeStandard, AppleRoman,\nBIG5, GB2312, Latin 2, None, SJIScode, Symbol, Unicode, Wansung.</em></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-endian\"></a>-endian <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>MSB</em> indicates big-endian (e.g. SPARC, Motorola 68K) while\n<em>LSB</em> indicates little-endian (e.g. Intel 'x86, VAX) byte\nordering.  <em>Native</em> indicates to use the normal ordering for the\ncurrent CPU.  This option currently only influences the CMYK, DPX,\nGRAY, RGB, and TIFF, formats.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+endian</strong> to revert to unspecified endianness.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -enhance\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a digital filter to enhance a noisy image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -equalize\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform histogram equalization to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-extent\"></a>-extent <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite image on background color canvas image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option composites the image on a new background color\n(<strong>-background</strong>) canvas image of size &lt;width&gt;x&lt;height&gt;. The\nexisting image content is composited at the position specified by\ngeometry x and y offset and/or desired gravity (<strong>-gravity</strong>) using\nthe current image compose (<strong>-compose</strong>) method.  Image content\nwhich falls outside the bounds of the new image dimensions is\ndiscarded.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, this command creates a thumbnail of an image, and centers\nit on a red color backdrop image, offsetting the canvas ten pixels to\nthe left and five pixels up, with respect to the thumbnail:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert infile.jpg -thumbnail 120x80 -background red -gravity center \\\n              -extent 140x100-10-5 outfile.jpg\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis command reduces or expands a JPEG image to fit on an 800x600\ndisplay: </font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -size 800x600 input.jpg \\\n              -resize 800x600 -background black \\\n              -compose Copy -gravity center \\\n              -extent 800x600 \\\n              -quality 92 output.jpg\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the aspect ratio of the input image isn't exactly 4:3, then the\nimage is centered on an 800x600 black canvas. </font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-file\"></a>-file <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write annotated difference image to file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf <strong>-file</strong> is specified, then an annotated difference image is\ngenerated and written to the specified file. Pixels which differ between\nthe <strong>reference</strong> and <strong>compare</strong> images are modified from those in\nthe <strong>compare</strong> image so that the changed pixels become more obvious.\nSome images may require use of an alternative highlight style (see\n<strong>-highlight-style</strong>) or highlight color (see <strong>-highlight-color</strong>)\nbefore the changes are obvious.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-fill\"></a>-fill <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when filling a graphic primitive</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nColors are represented in GraphicsMagick in the same form used by SVG. Use \"gm convert -list color\" to list named colors:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    name               (named color)\n    #RGB               (hex numbers, 4 bits each)\n    #RRGGBB            (8 bits each)\n    #RRRGGGBBB         (12 bits each)\n    #RRRRGGGGBBBB      (16 bits each)\n    #RGBA              (4 bits each)\n    #RRGGBBAA          (8 bits each)\n    #RRRGGGBBBAAA      (12 bits each)\n    #RRRRGGGGBBBBAAAA  (16 bits each)\n    rgb(r,g,b)         (r,g,b are decimal numbers)\n    rgba(r,g,b,a)      (r,g,b,a are decimal numbers)\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEnclose the color specification in quotation marks to prevent the \"#\"\nor the parentheses from being interpreted by your shell.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -fill blue ...\n    gm convert -fill \"#ddddff\" ...\n    gm convert -fill \"rgb(65000,65000,65535)\" ...\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe shorter forms are scaled up, if necessary by replication.  For example, \n#3af, #33aaff, and #3333aaaaffff are all equivalent.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-draw</strong> for further details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-filter\"></a>-filter <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to affect the resizing operation of an image (see\n<strong>-geometry</strong>).\nChoose from these filters (ordered by approximate increasing CPU\ntime):</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Point\n     Box\n     Triangle\n     Hermite\n     Hanning\n     Hamming\n     Blackman\n     Gaussian\n     Quadratic\n     Cubic\n     Catrom\n     Mitchell\n     Lanczos\n     Bessel\n     Sinc\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default filter is automatically selected to provide the best quality\nwhile consuming a reasonable amount of time. The <strong>Mitchell</strong> filter\nis used if the image supports a palette, supports a matte channel, or is\nbeing enlarged, otherwise the <strong>Lanczos</strong> filter is used.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-flatten\"></a>-flatten\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>flatten a sequence of images</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn some file formats (e.g. Photoshop's PSD) complex images may be\nrepresented by \"layers\" (independent images) which must be composited\nin order to obtain the final rendition.  The <strong>-flatten</strong> option\naccomplishes this composition.  The sequence of images is replaced by\na single image created by compositing each image in turn, while\nrespecting composition operators and page offsets.  While\n<strong>-flatten</strong> is immediately useful for eliminating layers, it is\nalso useful as a general-purpose composition tool.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images is terminated by the appearance of any option.\nIf the <strong>-flatten</strong> option appears after all of the input images,\nall images are flattened.  Also see <strong>-mosaic</strong> which is similar to\n<strong>-flatten</strong> except that it adds a suitably-sized canvas base\nimage.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, this composites an image on top of a 640x400 transparent\nblack canvas image:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -size 640x300 xc:transparent \\\n              -compose over -page +0-100 \\\n              frame.png -flatten output.png\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nand this flattens a Photoshop PSD file:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert input.psd -flatten output.png\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-flip\"></a>-flip\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nreflect the scanlines in the vertical direction.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-flop\"></a>-flop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nreflect the scanlines in the horizontal direction.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-font\"></a>-font <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can tag a font to specify whether it is a PostScript, TrueType, or X11\nfont.  For example, <tt>Arial.ttf</tt> is a TrueType font, <tt>ps:helvetica</tt>\nis PostScript, and <tt>x:fixed</tt> is X11.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-foreground\"></a>-foreground <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the foreground color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-format\"></a>-format <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image format type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used with the <strong>mogrify</strong> utility,\nthis option will convert any image to the image format you specify.\nSee <em>GraphicsMagick(1)</em> for a list of image format types supported by\n<strong>GraphicsMagick</strong>, or see the output of 'gm -list format'.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default the file is written to its original name.  However, if the\nfilename extension matches a supported format, the extension is replaced\nwith the image format type specified with <strong>-format</strong>.  For example,\nif you specify <em>tiff</em> as the format type and the input image\nfilename is <em>image.gif</em>, the output image filename becomes\n<em>image.tiff</em>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-format\"></a>-format <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output formatted image characteristics</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used with the <strong>identify</strong> utility, or the <strong>convert</strong>\nutility with output written to the 'info:-' file specification, use\nthis option to print information about the image in a format of your\nchoosing.  You can include the image filename, type, width, height,\nExif data, or other image attributes by embedding special format\ncharacters:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     %b   file size\n     %c   comment\n     %d   directory\n     %e   filename extension\n     %f   filename\n     %g   page dimensions and offsets\n     %h   height\n     %i   input filename\n     %k   number of unique colors\n     %l   label\n     %m   magick\n     %n   number of scenes\n     %o   output filename\n     %p   page number\n     %q   image bit depth\n     %r   image type description\n     %s   scene number\n     %t   top of filename\n     %u   unique temporary filename\n     %w   width\n     %x   horizontal resolution\n     %y   vertical resolution\n     %A   transparency supported\n     %C   compression type\n     %D   GIF disposal method\n     %G   Original width and height\n     %H   page height\n     %M   original filename specification\n     %O   page offset (x,y)\n     %P   page dimensions (width,height)\n     %Q   compression quality\n     %T   time delay (in centi-seconds)\n     %U   resolution units\n     %W   page width\n     %X   page horizontal offset (x)\n     %Y   page vertical offset (y)\n     %@   trim bounding box\n     %#   signature\n     \\n   newline\n     \\r   carriage return\n     %%   %\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -format \"%m:%f %wx%h\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\ndisplays <strong>MIFF:bird.miff 512x480</strong> for an image\ntitled <strong>bird.miff</strong> and whose width is 512 and height is 480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the first character of <em>string</em> is <strong>@</strong>, the format is\nread from a file titled by the remaining characters in the string.\nPlease note that if the string comes from an untrusted source that it\nshould be sanitized before use since this may be used to incorporate\nany readable file on the system (a security risk).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe values of image type (<strong>%r</strong>) which may be returned include:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Bilevel\n     Grayscale\n     GrayscaleMatte\n     Palette\n     PaletteMatte\n     TrueColor\n     TrueColorMatte\n     ColorSeparation\n     ColorSeparationMatte\n     Optimize\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can also use the following special formatting syntax to print Exif\ninformation contained in the file:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     %[EXIF:&lt;tag&gt;]\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhere \"&lt;tag&gt;\" may be one of the following:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     *  (print all Exif tags, in keyword=data format)\n     !  (print all Exif tags, in tag_number format)\n     #hhhh (print data for Exif tag #hhhh)\n     ImageWidth\n     ImageLength\n     BitsPerSample\n     Compression\n     PhotometricInterpretation\n     FillOrder\n     DocumentName\n     ImageDescription\n     Make\n     Model\n     StripOffsets\n     Orientation\n     SamplesPerPixel\n     RowsPerStrip\n     StripByteCounts\n     XResolution\n     YResolution\n     PlanarConfiguration\n     ResolutionUnit\n     TransferFunction\n     Software\n     DateTime\n     Artist\n     WhitePoint\n     PrimaryChromaticities\n     TransferRange\n     JPEGProc\n     JPEGInterchangeFormat\n     JPEGInterchangeFormatLength\n     YCbCrCoefficients\n     YCbCrSubSampling\n     YCbCrPositioning\n     ReferenceBlackWhite\n     CFARepeatPatternDim\n     CFAPattern\n     BatteryLevel\n     Copyright\n     ExposureTime\n     FNumber\n     IPTC/NAA\n     ExifOffset\n     InterColorProfile\n     ExposureProgram\n     SpectralSensitivity\n     GPSInfo\n     ISOSpeedRatings\n     OECF\n     ExifVersion\n     DateTimeOriginal\n     DateTimeDigitized\n     ComponentsConfiguration\n     CompressedBitsPerPixel\n     ShutterSpeedValue\n     ApertureValue\n     BrightnessValue\n     ExposureBiasValue\n     MaxApertureValue\n     SubjectDistance\n     MeteringMode\n     LightSource\n     Flash\n     FocalLength\n     MakerNote\n     UserComment\n     SubSecTime\n     SubSecTimeOriginal\n     SubSecTimeDigitized\n     FlashPixVersion\n     ColorSpace\n     ExifImageWidth\n     ExifImageLength\n     InteroperabilityOffset\n     FlashEnergy\n     SpatialFrequencyResponse\n     FocalPlaneXResolution\n     FocalPlaneYResolution\n     FocalPlaneResolutionUnit\n     SubjectLocation\n     ExposureIndex\n     SensingMethod\n     FileSource\n     SceneType\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nJPEG specific information (from reading a JPEG file) may be obtained\nlike this:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     %[JPEG-&lt;tag&gt;]\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhere \"&lt;tag&gt;\" may be one of the following:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     *                 (all JPEG-related tags, in\n                        keyword=data format)\n     Quality           IJG JPEG \"quality\" estimate\n     Colorspace        JPEG colorspace numeric ID\n     Colorspace-Name   JPEG colorspace name\n     Sampling-factors  JPEG sampling factors\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPlease note that JPEG has no notion of \"quality\" and that the quality\nmetric used by, and estimated by the software is based on the quality\nmetric established by IJG JPEG 6b.  Other encoders (e.g. that used by\nAdobe Photoshop) use different encoding metrics.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSurround the format specification with quotation marks to prevent your shell\nfrom misinterpreting any spaces and square brackets.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-frame\"></a>-frame <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details about the geometry\nspecification.  The <strong>-frame</strong> option is not affected by the\n<strong>-gravity</strong> option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color of the border is specified with the <strong>-mattecolor</strong>\ncommand line option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -frame\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>include the X window frame in the imported image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-fuzz\"></a>-fuzz <i>&lt;distance&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colors within this Euclidean distance are considered equal</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA number of algorithms search for a target color. By default the color\nmust be exact. Use this option to match colors that are close (in\nEuclidean distance) to the target color in RGB 3D space. For example,\nif you want to automatically trim the edges of an image with\n<strong>-trim</strong> but the image was scanned and the target background color\nmay differ by a small amount. This option can account for these\ndifferences.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <em>distance</em> can be in absolute intensity units or, by appending\n<em>\"%\"</em>, as a percentage of the maximum possible intensity (255,\n65535, or 4294967295).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-gamma\"></a>-gamma <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe same color image displayed on two different workstations may look\ndifferent due to differences in the display monitor. Use gamma\ncorrection to adjust for this color difference. Reasonable values extend\nfrom <strong>0.8</strong> to <strong>2.3</strong>. Gamma less than 1.0 darkens the image and\ngamma greater than 1.0 lightens it. Large adjustments to image gamma may\nresult in the loss of some image information if the pixel quantum size\nis only eight bits (quantum range 0 to 255).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can apply separate gamma values to the red, green, and blue channels\nof the image with a gamma value list delimited with slashes\n(e.g., <strong>1.7</strong>/<strong>2.3</strong>/<strong>1.2</strong>).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+gamma</strong> <em>value</em>\nto set the image gamma level without actually adjusting\nthe image pixels. This option is useful if the image is of a known gamma\nbut not set as an image attribute (e.g. PNG images).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-gaussian\"></a>-gaussian <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the given radius and standard deviation (sigma).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-geometry\"></a>-geometry <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-geometry</strong> option is used for a number of different\npurposes, depending on the utility it is used with.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the X11 commands ('animate', 'display', and 'import'), it\nspecifies the preferred size and location of the Image window.  By\ndefault, the window size is the image size and the location is chosen\nby you (or your window manager) when it is mapped.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"> For the 'import', 'convert', 'mogrify' utility commands it may be\nused to specify the desired size when resizing an image.  In this\ncase, symbols representing resize options may be appended to the\ngeometry string to influence how the resize request is treated.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee later notes corresponding to usage by particular commands.  The\nfollowing notes apply to when <strong>-geometry</strong> is used to express a\nresize request, taking into account the current properties of the\nimage.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, the width and height are maximum values. That is, the\nimage is expanded or contracted to fit the width and height value\nwhile maintaining the aspect ratio of the image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAppend a ^ to the geometry so that the image aspect ratio is\nmaintained when the image is resized, but the resulting width or\nheight are treated as minimum values rather than maximum values.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAppend a ! (exclamation point) to the geometry to force the image size to\nexactly the size you specify. For example, if you specify\n<tt>640x480!</tt> the image width is set to 640 pixels and height to\n480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf only the width is specified, without the trailing 'x', then height\nis set to width (e.g., <tt>-geometry 100</tt> is the same as\n<tt>-geometry 100x100</tt>).  If only the width is specified but with\nthe trailing 'x', then width assumes the value and the height is\nchosen to maintain the aspect ratio of the image.  Similarly, if only\nthe height is specified prefixed by 'x' (e.g., <tt>-geometry\nx256</tt>), the width is chosen to maintain the aspect ratio.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nTo specify a percentage width or height instead, append %. The image size\nis multiplied by the width and height percentages to obtain the final image\ndimensions. To increase the size of an image, use a value greater than\n100 (e.g. 125%). To decrease an image's size, use a percentage less than\n100.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <tt>@</tt> to specify the maximum area in pixels of an image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <tt>&gt;</tt> to change the dimensions of the image <em>only</em> if\nits width or height exceeds the geometry specification. <tt>&lt;</tt> resizes\nthe image <em>only</em> if both of its dimensions are less than the geometry\nspecification. For example,\nif you specify <tt>'640x480&gt;'</tt> and the image size is 256x256, the image\nsize does not change. However, if the image is 512x512 or 1024x1024, it is\nresized to 480x480.  Enclose the geometry specification in quotation marks to\nprevent the <tt>&lt;</tt> or <tt>&gt;</tt> from being interpreted by your shell\nas a file redirection.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used with <em>animate</em> and <em>display</em>, offsets are handled in\nthe same manner as in <em>X(1)</em> and the <strong>-gravity</strong> option is not used.\nIf the <em>x</em> is negative, the offset is measured leftward\nfrom the right edge of the\nscreen to the right edge of the image being displayed.\nSimilarly, negative <em>y</em> is measured between the bottom edges.  The\noffsets are not affected by \"%\"; they are always measured in pixels.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>composite</em> option, <strong>-geometry</strong>\ngives the dimensions of the image and its location with respect\nto the composite image.  If the <strong>-gravity</strong> option is present\nwith <em>NorthEast, East,</em> or <em>SouthEast</em> gravity, the <em>x</em>\nrepresents the distance from the right edge of the image to the right edge of\nthe composite image.  Similarly, if the <strong>-gravity</strong> option is present\nwith <em>SouthWest, South,</em> or <em>SouthEast</em> gravity, <em>y</em>\nis measured between the bottom edges. Accordingly, a positive offset will\nnever point in the direction outside of the image.  The\noffsets are not affected by \"%\"; they are always measured in pixels.\nTo specify the dimensions of the composite image, use the <strong>-resize</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>convert</em>, <em>import</em> or <em>mogrify</em> option,\n<strong>-geometry</strong> is synonymous with <strong>-resize</strong> and\nspecifies the size of the output image.  The offsets, if present, are ignored.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>montage</em> option, <strong>-geometry</strong> specifies the image\nsize and border size for each tile; default is 256x256+0+0.  Negative\noffsets (border dimensions) are meaningless.  The <strong>-gravity</strong>\noption affects the placement of the image within the tile; the default\ngravity for this purpose is <em>Center</em>.  If the \"%\" sign appears in\nthe geometry specification, the tile size is the specified percentage of\nthe original dimensions of the first tile.\nTo specify the dimensions of the montage, use the <strong>-resize</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-gravity\"></a>-gravity <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are: NorthWest, North,\nNorthEast, West, Center, East, SouthWest, South, SouthEast.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe direction you choose specifies where to position the text \nwhen annotating\nthe image. For example <em>Center</em> gravity forces the text to be centered\nwithin the image. By default, the image gravity is <em>NorthWest</em>.\nSee <strong>-draw</strong> for more details about graphic primitives.  Only the\ntext primitive is affected by the <strong>-gravity</strong> option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-gravity</strong> option is also used in concert with the <strong>-geometry</strong>\noption and other options that take <strong>&lt;geometry&gt;</strong> as a parameter, such\nas the <strong>-crop</strong> option.  See <strong>-geometry</strong> for details of how the\n<strong>-gravity</strong> option interacts with the\n<strong>&lt;x&gt;</strong> and <strong>&lt;y&gt;</strong> parameters of a geometry\nspecification.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as an option to <em>composite</em>, <strong>-gravity</strong>\ngives the direction that the image gravitates within the composite.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as an option to <em>montage</em>, <strong>-gravity</strong> gives the direction\nthat an image gravitates within a tile.  The default gravity is <em>Center</em>\nfor this purpose.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-green-primary\"></a>-green-primary <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -hald-clut <i>&lt;clut&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a Hald CLUT to the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA Hald CLUT (\"Color Look-Up Table\") is a special square color image\nwhich contains a look-up table for red, green, and blue.  The size of\nthe Hald CLUT image is determined by its order.  The width (and\nheight) of a Hald CLUT is the cube of the order.  For example, a Hald\nCLUT of order 8 is 512x512 pixels (262,144 colors) and of order 16 is\n4096x4096 (16,777,216 colors).  A special CLUT is the identity CLUT\nwhich which causes no change to the input image.  In order to use the\nHald CLUT, one takes an identity CLUT and adjusts its colors in some\nway.  The modified CLUT can then be used to transform any number of\nimages in an identical way.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nGraphicsMagick contains a built-in identity CLUT generator via the\n<strong>IDENTITY</strong> coder.  For example reading from the file name\n</strong>IDENTITY:8</strong> returns an identity CLUT of order 8.  Typical Hald\nCLUT identity images have an order of between 8 and 16.  The default\norder for the <strong>IDENTITY</strong> CLUT generator is 8.  Interpolation is\nused so it is not usually necessary for CLUT images to be very large.\nThe PNG file format is ideal for storing Hald CLUT images because it\ncompresses them very well.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-highlight-color\"></a>-highlight-color <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixel annotation color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecifies the color to use when annotating difference pixels.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-highlight-style\"></a>-highlight-style <i>&lt;style&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixel annotation style</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecifies the pixel difference annotation style used to draw attention to\nchanged pixels. May be one of <strong>Assign</strong>, <strong>Threshold</strong>,\n<strong>Tint</strong>, or <strong>XOR</strong>; where <strong>Assign</strong> replaces the pixel with\nthe highlight color (see <strong>-highlight-color</strong>), <strong>Threshold</strong>\nreplaces the pixel with black or white based on the difference in\nintensity, <strong>Tint</strong> alpha tints the pixel with the highlight color,\nand <strong>XOR</strong> does an XOR between the pixel and the highlight color.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-iconGeometry\"></a>-iconGeometry <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the icon geometry</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nOffsets, if present in the geometry specification, are handled in\nthe same manner as the <strong>-geometry</strong> option, using X11 style to handle\nnegative offsets.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -iconic\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>iconic animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -immutable\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image immutable</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -implode <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>implode image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-intent\"></a>-intent <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of rendering intent when managing the image color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to affect the the color management operation of an image (see\n<strong>-profile</strong>).\nChoose from these intents:\n<strong>Absolute, Perceptual, Relative, Saturation</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default intent is undefined.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-interlace\"></a>-interlace <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are: <strong>None, Line, Plane,</strong>\nor <strong>Partition</strong>. The default is <strong>None</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is used to specify the type of interlacing scheme for raw image\nformats such as <strong>RGB</strong> or <strong>YUV</strong>.</font></td></tr></table><table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>None</strong> means do not interlace\n(RGBRGBRGBRGBRGBRGB...),</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Line</strong> uses scanline interlacing\n(RRR...GGG...BBB...RRR...GGG...BBB...),\nand</font></td></tr></table><table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Plane</strong> uses plane interlacing (RRRRRR...GGGGGG...BBBBBB...).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Partition</strong>\nis like plane except the different planes are saved to individual files\n(e.g. image.R, image.G, and image.B).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>Line</strong> to create an <strong>interlaced PNG</strong> or <strong> GIF</strong> or\n<strong>progressive JPEG</strong> image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-label\"></a>-label <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to assign a specific label to the image, when writing\nto an image format that supports labels, such as TIFF, PNG, MIFF, or\nPostScript. You can include the the image filename, type, width, height,\nor other image attribute by embedding special format character.  A label\nis not drawn on the image, but is embedded in the image datastream via\na \"Label\" tag or similar mechanism.  If you want the\nlabel to be visible on the image itself, use the <strong>-draw</strong> option.\nSee <strong>-comment</strong> for details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -label \"%m:%f %wx%h\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nproduces an image label of <strong>MIFF:bird.miff 512x480</strong> for an image titled\n<strong>bird.miff</strong>\nand whose width is 512 and height is 480.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the first character of <em>string</em> is <em>@</em>, the image label\nis read from a file titled by the remaining characters in the string.\nPlease note that if the string comes from an untrusted source that it\nshould be sanitized before use since otherwise the content of an\narbitrary readable file might be incorporated into the image\nlabel (a security risk).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the -label option appears multiple times, only the last label is\nstored.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn PNG images, the label is stored in a <strong>tEXt</strong> or <strong>zTXt</strong> chunk\nwith the keyword \"label\".</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen converting to <em>PostScript</em>, use this option to specify a header\nstring to print above the image. Specify the label font with\n<strong>-font</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen creating a montage, by default the label associated with an image\nis displayed with the corresponding tile in the montage.  Use the\n<strong>+label</strong> option to suppress this behavior.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-lat\"></a>-lat <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;offset&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform local adaptive thresholding</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPerform local adaptive thresholding using the specified width, height,\nand offset.  The offset is a distance in sample space from the mean,\nas an absolute integer ranging from 0 to the maximum sample value or\nas a percentage.  If the percent option is supplied, then the offset\nis computed as a percentage of the quantum range.  It is strongly\nrecommended to use the percent option so that results are not\nsensitive to pixel quantum depth.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -colorspace gray -lat \"10x10-5%\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nwill help clarify a scanned grayscale or color document, producing a\nbi-level equivalent.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-level\"></a>-level <i>&lt;black_point&gt;</i>{<i>,&lt;gamma&gt;</i>}<i></i>{<i>,&lt;white_point&gt;</i>}<i></i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>adjust the level of image contrast</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nGive one, two or three values delimited with commas: black-point, gamma,\nwhite-point (e.g. 10,1.0,250 or 2%,0.5,98%). The black and white\npoints range from 0 to MaxRGB or from 0 to 100%; if the white point is\nomitted it is set to MaxRGB-black_point. If a \"%\" sign is present\nanywhere in the string, the black and white points are percentages of\nMaxRGB. Gamma is an exponent that ranges from 0.1 to 10.; if it is\nomitted, the default of 1.0 (no gamma correction) is assumed. This\ninterface works similar to Photoshop's \"Image-&gt;Adjustments-&gt;Levels...\"\n\"Input Levels\" interface.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-limit\"></a>-limit <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, resource limits are estimated based on the available\nresources of the system. The resource limits are <strong>Disk</strong>, maximum\ntotal disk space consumed; <strong>File</strong>, maximum number of file\ndescriptors allowed to be open at once; <strong>Map</strong>, maximum total\nnumber of file bytes which may be memory mapped; <strong>Memory</strong>,\nmaximum total number of bytes of heap memory used for image storage;\n<strong>Pixels</strong>, maximum absolute image size (per image); <strong>Width</strong>,\nmaximum image pixels width; <strong>Height</strong>, maximum image pixels\nheight; and <strong>Threads</strong>, the maximum number of worker threads to\nuse per OpenMP thread team.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThese resource limits are used to decide if (for a given image) the\ndecoded image (\"pixel cache\") should be stored in heap memory (RAM),\nin a memory-mapped disk file, or in a disk file accessed via\nread/write I/O.  The number of total pixels in one image, and/or the\nwidth/height, may also be limited in order to force the reading, or\ncreation of images larger than the limit (in pixels) to intentionally\nfail. The disk limit establishes an overall limit since using the disk\nis the means of last resort. When the disk limit has been reached, no\nmore images may be read.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe value argument is an absolute value, but may have standard binary\nsuffix characters applied ('K', 'M', 'G', 'T', 'P', 'E') to apply a\nscaling to the value (based on a multiplier of 1024). Any additional\ncharacters are ignored. For example, <tt>'-limit Pixels 10MP'</tt> limits\nthe maximum image size to 10 megapixels and <tt>'-limit memory 32MB\n-limit map 64MB'</tt> limits memory and memory mapped files to 32\nmegabytes and 64 megabytes respectively.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nResource limits may also be set using environment variables. The\nenvironment variables <strong>MAGICK_LIMIT_DISK</strong>,\n<strong>MAGICK_LIMIT_FILES</strong>, <strong>MAGICK_LIMIT_MAP</strong>,\n<strong>MAGICK_LIMIT_MEMORY</strong>, <strong>MAGICK_LIMIT_PIXELS</strong>,\n<strong>MAGICK_LIMIT_WIDTH</strong>, <strong>MAGICK_LIMIT_HEIGHT</strong>,and\n<strong>OMP_NUM_THREADS</strong> may be used to set the limits for disk space,\nopen files, memory mapped size, heap memory, per-image pixels, image\nwidth, image height, and threads respectively.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the option <tt>-list resource</tt> list the current limits.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -linewidth\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the line width for subsequent draw operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-list\"></a>-list <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of list</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoices are: <strong>Color</strong>, <strong>Delegate</strong>, <strong>Format</strong>, <strong>Magic</strong>,\n<strong>Module</strong>, <strong>Resource</strong>, or <strong>Type</strong>. The <strong>Module</strong> option\nis only available if GraphicsMagick was built to support loadable modules.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option lists information about the GraphicsMagick configuration.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-log\"></a>-log <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option specifies the format for the log printed when the <strong>-debug</strong>\noption is active.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can display the following components by embedding\nspecial format characters:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     %d   domain\n     %e   event\n     %f   function\n     %l   line\n     %m   module\n     %p   process ID\n     %r   real CPU time\n     %t   wall clock time\n     %u   user CPU time\n     %%   percent sign\n     \\n   newline\n     \\r   carriage return\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -debug coders -log \"%u %m:%l %e\" in.gif out.png\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default behavior is to print all of the components.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-loop\"></a>-loop <i>&lt;iterations&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add Netscape loop extension to your GIF animation</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA value other than zero forces the animation to repeat itself up to\n<em>iterations</em>\ntimes.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe image size is doubled using linear interpolation.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe displayed image is magnified by <strong>factor</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-map\"></a>-map <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>choose a particular set of colors from this image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n[<em>convert</em> or <em>mogrify</em>]</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, color reduction chooses an optimal set of colors that best\nrepresent the original image. Alternatively, you can choose a particular\nset of colors from an image file with this option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse\n<strong>+map</strong> to reduce\nall images in the image sequence that follows to a single optimal set of colors\nthat best represent all the images.  The sequence of images\nis terminated by the appearance of any option.\nIf the <strong>+map</strong>\noption appears after all of the input images, all images are mapped.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-map\"></a>-map <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display image using this type.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n[<em>animate</em> or <em>display</em>]</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from these <em>Standard Colormap</em> types:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     best\n     default\n     gray\n     red\n     green\n     blue\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <em>X server</em> must support the <em>Standard Colormap</em> you choose,\notherwise an error occurs. Use <strong>list</strong> as the type and <strong>display</strong>\nsearches the list of colormap types in <strong>top-to-bottom</strong> order until\none is located. See <em>xstdcmap(1)</em> for one way of creating Standard\nColormaps.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-mask\"></a>-mask <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify a clipping mask</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe image read from the file is used as a clipping mask.  It must have\nthe same dimensions as the image being masked.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the mask image contains an opacity channel, the opacity of each\npixel is used to define the mask.  Otherwise, the intensity (gray\nlevel) of each pixel is used.  Unmasked (black) pixels are modified\nwhile masked pixels (not black) are protected from alteration.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+mask</strong> to remove the clipping mask.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIt is not necessary to use <strong>-clip</strong> to activate the mask; <strong>-clip</strong>\nis implied by <strong>-mask</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-matte\"></a>-matte\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the image does not have a matte channel, create an opaque one.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+matte</strong> to ignore the matte channel and to avoid writing a\nmatte channel in the output file.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-mattecolor\"></a>-mattecolor <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-maximum-error\"></a>-maximum-error <i>&lt;limit&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the maximum amount of total image error</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecifies the maximum amount of total image error (based on comparison\nusing a specified metric) before an error (\"image difference exceeds\nlimit\") is reported.  The error is reported via a non-zero command\nexecution return status.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -median <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a median filter to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -metric <i>&lt;metric&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>comparison metric (MAE, MSE, PAE, PSNR, RMSE)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -minify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>minify the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe image size is halved using linear interpolation.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -mode <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>mode of operation</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe available montage modes are <strong>frame</strong> to place the images in a\nrectangular grid while adding a decorative frame with dropshadow,\n<strong>unframe</strong> to place undecorated images in a rectangular grid, and\n<strong>concatenate</strong> to pack the images closely together without any\nwell-defined grid or decoration. </font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-modulate\"></a>-modulate <i>brightness[,saturation[,hue]]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>vary the brightness, saturation, and hue of an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify the percent change in brightness, color saturation, and\nhue separated by commas. Default argument values are 100 percent,\nresulting in no change. For example, to increase the color brightness\nby 20% and decrease the color saturation by 10% and leave the hue\nunchanged, use: <strong>-modulate 120,90</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nHue is the percentage of absolute rotation from the current\nposition. For example 50 results in a counter-clockwise rotation of 90\ndegrees, 150 results in a clockwise rotation of 90 degrees, with 0 and\n200 both resulting in a rotation of 180 degrees.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA simple command-line progress indication is shown while the command is\nrunning. The process indication shows the operation currently being\nperformed and the percent completed. Commands using X11 may replace the\ncommand line progress indication with a graphical one once an image has\nbeen displayed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-morph\"></a>-morph <i>&lt;frames&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>morphs an image sequence</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBoth the image pixels and size are linearly interpolated to give the appearance\nof a meta-morphosis from one image to the next.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images\nis terminated by the appearance of any option.\nIf the <strong>-morph</strong>\noption appears after all of the input images, all images are morphed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-mosaic\"></a>-mosaic\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a mosaic from an image or an image sequence</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-mosaic</strong> option provides a flexible way to composite one or\nmore images onto a solid-color canvas image. It works similar to\n<strong>-flatten</strong> except that a base canvas image is automatically\ncreated with a suitable size given the image size, page dimensions,\nand page offsets of images to be composited.  The color of the base\ncanvas image may be set via the <strong>-background</strong> option.  The\ndefault canvas color is 'white', but 'black' or 'transparent' may be\nmore suitable depending on the composition algorithm requested.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-compose</strong> option may be used to specify the composition\nalgorithm to use when compositing the subsequent image on the base\ncanvas.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-page</strong> option can be used to establish the dimensions of the\nmosaic and to position the subsequent image within the mosaic.  If the\n<strong>-page</strong> argument does not specify width and height, then the\ncanvas dimensions are evaluated based on the image sizes and\noffsets.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images is terminated by the appearance of any option.\nIf the <strong>-mosaic</strong> option appears after all of the input images,\nall images are included in the mosaic.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe following is an example of composing an image based on red, green,\nand blue layers extracted from a sequence of images and pasted on the\ncanvas image at specified offsets:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -background black \\\n              -compose CopyRed   -page +0-100 red.png \\\n              -compose CopyGreen -page +0+40  green.png \\\n              -compose CopyBlue  -page +0+180 blue.png \\\n              -mosaic output.png\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-motion-blur\"></a>-motion-blur <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+angle</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Simulate motion blur</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSimulate motion blur by convolving the image with a Gaussian operator of\nthe given radius and standard deviation (sigma). For reasonable results,\nradius should be larger than sigma. If radius is zero, then a suitable\nradius is automatically selected based on sigma. The angle specifies the\nangle that the object is coming from (side which is blurred).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -name\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-negate\"></a>-negate\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe red, green, and blue intensities of an image are negated.\nWhite becomes black,\nyellow becomes blue, etc.\nUse <strong>+negate</strong>\nto only negate the grayscale pixels of the image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-noise\"></a>-noise <i>&lt;radius|type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add or reduce noise in an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe principal function of noise peak elimination filter is to smooth the\nobjects within an image without losing edge information and without creating\nundesired structures. The central idea of the algorithm is to replace a\npixel with its next neighbor in value within a pixel window, if this pixel\nhas been found to be noise. A pixel is defined as noise if and only if\nthis pixel is a maximum or minimum within the pixel window.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>radius</strong> to specify the width of the neighborhood.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+noise</strong> followed by a noise type to add noise to an image.\nThe noise added modulates the existing image pixels. Choose from these\nnoise types:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Uniform\n     Gaussian\n     Multiplicative\n     Impulse\n     Laplacian\n     Poisson\n     Random (uniform distribution)\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-noop\"></a>-noop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-noop</strong> option can be used to terminate a group of images\nand reset all options to their default values, when no other option is\ndesired.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-normalize\"></a>-normalize\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform image to span the full range of color values</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis is a contrast enhancement technique based on the image histogram.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen computing the contrast enhancement values, the histogram edges\nare truncated so that the majority of the image pixels are considered\nin the constrast enhancement, and outliers (e.g. random noise or\nminute details) are ignored.  The default is that 0.1 percent of the\nhistogram entries are ignored.  The percentage of the histogram to\nignore may be specified by using the <strong>-set</strong> option with the\n<strong>histogram-threshold</strong> parameter similar to <strong>-set\nhistogram-threshold 0.01</strong> to specify 0.01 percent.  Use 0 percent\nto use the entire histogram, with possibly diminished contrast\nenhancement.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-opaque\"></a>-opaque <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>change this color to the pen color within the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the\n<strong>-fill</strong> option.  The color is replaced if it is identical to the\ntarget color, or close enough to the target color in a 3D space as\ndefined by the Euclidean distance specified by <strong>-fuzz</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-fill</strong> and <strong>-fuzz</strong> for more details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-operator\"></a>-operator <i>channel operator rvalue[%]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a mathematical, bitwise, or value operator to an image channel</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nApply a low-level mathematical, bitwise, or value operator to a selected\nimage channel or all image channels. Operations which result in negative\nresults are reset to zero, and operations which overflow the available\nrange are reset to the maximum possible value.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSelect a channel from: <strong>Red</strong>, <strong>Green</strong>, <strong>Blue</strong>,\n<strong>Opacity</strong>, <strong>Matte</strong>, <strong>Cyan</strong>, <strong>Magenta</strong>, <strong>Yellow</strong>,\n<strong>Black</strong>, <strong>All</strong>, or <strong>Gray</strong>. <strong>All</strong> only modifies the\ncolor channels and does not modify the <strong>Opacity</strong> channel. Except for\nthe threshold operators, <strong>All</strong> operates on each channel\nindependently so that operations are on a per-channel basis.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<strong>Gray</strong> treats the color channels as a grayscale intensity and\nperforms the requested operation on the equivalent pixel intensity so the\nresult is a gray image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Select an operator from <strong>Add</strong>, <strong>And</strong>, <strong>Assign</strong>,\n<strong>Depth</strong>, <strong>Divide</strong>, <strong>Gamma</strong>, <strong>Negate</strong>,\n<strong>LShift</strong>, <strong>Log</strong>, <strong>Max</strong>, <strong>Min</strong>, <strong>Multiply</strong>,\n<strong>Or</strong>, <strong>Pow</strong> <strong>RShift</strong>, <strong>Subtract</strong>,\n<strong>Threshold</strong>, <strong>Threshold-White</strong>,\n<strong>Threshold-White-Negate</strong>, <strong>Threshold-Black</strong>,\n<strong>Threshold-Black-Negate</strong>, <strong>Xor</strong>, <strong>Noise-Gaussian</strong>,\n<strong>Noise-Impulse</strong>, <strong>Noise-Laplacian</strong>,\n<strong>Noise-Multiplicative</strong>, <strong>Noise-Poisson</strong>,\n<strong>Noise-Random</strong>, and <strong>Noise-Uniform</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nRvalue may be any floating point or integer value. Normally rvalue will\nbe in the range of 0 to MaxRGB, where MaxRGB is the largest quantum value\nsupported by the GraphicsMagick build (255, 65535, or 4294967295) but\nvalues outside this range are useful for some arithmetic operations.\nArguments to logical or bit-wise operations are rounded to a positive\nintegral value prior to use. If a percent (<strong>%</strong>) symbol is appended\nto the argument, then the argument has a range of 0 to 100 percent.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe following is a description of the operators:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>Add</dt>\n<dd>Result is rvalue added to channel value.\n</dd>\n<dt>And</dt>\n<dd>Result is the logical AND of rvalue with channel value.\n</dd>\n<dt>Assign</dt>\n<dd>Result is rvalue.\n</dd>\n<dt>Depth</dt>\n<dd>Result is channel value adjusted so that it may be (approximately)\nstored in the specified number of bits without additional loss.\n</dd>\n<dt>Divide</dt>\n<dd>Result is channel value divided by rvalue.\n</dd>\n<dt>Gamma</dt>\n<dd>Result is channel value gamma adjusted by rvalue.\n</dd>\n<dt>LShift</dt>\n<dd>Result is channel value bitwise left shifted by rvalue bits.\n</dd>\n<dt>Log</dt>\n<dd>Result is computed as log(value*rvalue+1)/log(rvalue+1).\n</dd>\n<dt>Max</dt>\n<dd>Result is assigned to rvalue if rvalue is greater than value.\n</dd>\n<dt>Min</dt>\n<dd>Result is assigned to rvalue if rvalue is less than value.\n</dd>\n<dt>Multiply</dt>\n<dd>Result is channel value multiplied by rvalue.\n</dd>\n<dt>Negate</dt>\n<dd>Result is inverse of channel value (like a film negative). An rvalue\nmust be supplied but is currently not used. Inverting the image twice\nresults in the original image.\n</dd>\n<dt>Or</dt>\n<dd>Result is the logical OR of rvalue with channel value.\n</dd>\n<dt>Pow</dt>\n<dd>Result is computed as pow(value,rvalue). Similar to Gamma except that\nrvalue is not inverted.\n</dd>\n<dt>RShift</dt>\n<dd>Result is channel value bitwise right shifted by rvalue bits.\n</dd>\n<dt>Subtract</dt>\n<dd>Result is channel value minus rvalue.\n</dd>\n<dt>Threshold</dt>\n<dd>Result is maximum (white) if channel value is greater than rvalue,\nor minimum (black) if it is less than or equal to rvalue. If <strong>all</strong>\nchannels are specified, then thresholding is done based on computed pixel\nintensity.\n</dd>\n<dt>Threshold-white</dt>\n<dd>Result is maximum (white) if channel value is greater than rvalue and\nis unchanged if it is less than or equal to rvalue. This can be used to\nremove apparent noise from the bright parts of an image. If <strong>all</strong>\nchannels are specified, then thresholding is done based on computed pixel\nintensity.\n</dd>\n<dt>Threshold-White-Negate</dt>\n<dd>Result is set to black if channel value is greater than\nrvalue and is unchanged if it is less than or equal to rvalue. If\n<strong>all</strong> channels are specified, then thresholding is done based on\ncomputed pixel intensity.\n</dd>\n<dt>Threshold-black</dt>\n<dd>Result is minimum (black) if channel value is less than than rvalue\nand is unchanged if it is greater than or equal to rvalue. This can be\nused to remove apparent noise from the dark parts of an image. If\n<strong>all</strong> channels are specified, then thresholding is done based on\ncomputed pixel intensity.\n</dd>\n<dt>Threshold-Black-Negate</dt>\n<dd>Result is set to white if channel value is less than than\nrvalue and is unchanged if it is greater than or equal to rvalue. If\n<strong>all</strong> channels are specified, then thresholding is done based on\ncomputed pixel intensity.\n</dd>\n<dt>Xor</dt>\n<dd>Result is the logical XOR of rvalue with channel value. An\ninteresting property of XOR is that performing the same operation twice\nresults in the original value.\n</dd>\n<dt>Noise-Gaussian</dt>\n<dd>Result is the current channel value modulated with gaussian noise\naccording to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Impulse</dt>\n<dd>Result is the current channel value modulated with impulse noise\naccording to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Laplacian</dt>\n<dd>Result is the current channel value modulated with laplacian noise\naccording to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Multiplicative</dt>\n<dd>Result is the current channel value modulated with multiplicative\ngaussian noise according to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Poisson</dt>\n<dd>Result is the current channel value modulated with poisson noise\naccording to the intensity specified by rvalue.\n</dd>\n<dt>Noise-Random</dt>\n<dd>Result is the current channel value modulated with random (uniform\ndistribution) noise according to the intensity specified by rvalue.\nThe initial noise intensity (rvalue=1.0) is the range of one pixel\nquantum span.\n</dd>\n<dt>Noise-Uniform</dt>\n<dd>Result is the channel value with uniform noise applied according to\nthe intensity specified by rvalue.\n</dd>\n</dl>\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAs an example, the <strong>Assign</strong> operator assigns a fixed value to a\nchannel. For example, this command sets the red channel to the mid-range\nvalue:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert in.bmp -operator red assign \"50%\" out.bmp\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe following applies 50% thresholding to the image and returns a gray\nimage:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert in.bmp -operator gray threshold \"50%\" out.bmp\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-ordered-dither\"></a>-ordered-dither <i>&lt;channeltype&gt; &lt;NxN&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>ordered dither the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe channel or channels specified in the <strong>channeltype</strong> argument are\nreduced to binary, using an ordered dither method. The choices for\n<strong>channeltype</strong> are <strong>All</strong>, <strong>Intensity</strong>, <strong>Red</strong>,\n<strong>Green</strong>, <strong>Blue</strong>, <strong>Cyan</strong>, <strong>Magenta</strong>, <strong>Yellow</strong>,\n<strong>Black</strong>, and <strong>Opacity</strong></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen <strong>channeltype</strong> is \"All\", the color samples are dithered into\na gray level and then that gray level is stored in the three color\nchannels.  Separately, the opacity channel is dithered into a bilevel\nopacity value which is stored in the opacity channel.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen <strong>channeltype</strong> is \"Intensity\", only the color samples are\ndithered. When <strong>channeltype</strong> is \"opacity\" or \"matte\", only the\nopacity channel is dithered. When a color channel is specified, only that\nchannel is dithered.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe choices for N are 2 through 7. The image is divided into\nNxN pixel tiles.  In each tile, some or all pixels are turned to\nwhite depending on their intensity.  For each N, (N**2)+1 levels\nof gray can be represented.  For N == 2, 3, or 4, the pixels\nare turned to white in an order that maximizes dispersion (i.e.,\nreduces granularity), while\nfor N == 5, 6, and 7, they are turned to white in an order that\ncreates a roughly circular black blob in the middle of each tile.\nAn attractive \"half-tone\" looking image can be obtained by first\nrotating the image 45 degrees, performing a 5x5 ordered-dither\noperation, then rotating it back to the original orientation and\ncropping to the original image dimensions.  If the original image\nis gamma-encoded, it is adviseable to convert it to linear intensity\nfirst, e.g., with the \"-gamma 0.45455\" option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-output-directory\"></a>-output-directory <i>&lt;directory&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output files to directory</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse -output-directory to specify a directory under which to write the\noutput files. Normally mogrify overwrites the input files, but with\nthis option the output files may be written to a different directory\ntree so that the input files are preserved. The algorithm used\npreserves all of the input path specification in the output path so\nthat the user-specified input path (including any sub-directory part)\nis appended to the output path. If the input file lacks an extension,\nthen a suitable extension is automatically added to the output file.\nThe user is responsible for creating the output directory specified as\nan argument, but subdirectories will be created as needed if the\n<strong>-create-directories</strong> option is supplied.  This option may be\nused to apply transformations on files from one directory and write\nthe transformed files to a different directory.  In conjunction with\n<strong>-create-directories</strong>, this option is designed to support\ntransforming whole directory trees of files provided that the relative\npath of the input file is included as part the list of filenames.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-orient\"></a>-orient <i>&lt;orientation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Set the image orientation attribute</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSets the image orientation attribute.  The image orientation attribute\nis compatible with the TIFF orientation tag (and the EXIF orientation\ntag).  Accepted values are <strong>undefined</strong>, <strong>TopLeft</strong>,\n<strong>TopRight</strong>, <strong>BottomRight</strong>, <strong>BottomLeft</strong>,\n<strong>LeftTop</strong>, <strong>RightTop</strong>, <strong>RightBottom</strong>,\n<strong>LeftBottom</strong>, and hyphenated versions thereof\n(e.g. <strong>left-bottom</strong>).  Please note that GraphicsMagick does not\ninclude an EXIF editor so if an EXIF profile is written to the output\nimage, the value in the EXIF profile might not match the image.  It is\npossible for an image file to indicate its orientation in several\ndifferent ways simultaneously.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-page\"></a>-page <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to specify the dimensions of the\n<em>PostScript</em> page\nin dots per inch or a TEXT page in pixels. The choices for a PostScript\npage are:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     11x17         792  1224\n     Ledger       1224   792\n     Legal         612  1008\n     Letter        612   792\n     LetterSmall   612   792\n     ArchE        2592  3456\n     ArchD        1728  2592\n     ArchC        1296  1728\n     ArchB         864  1296\n     ArchA         648   864\n     A0           2380  3368\n     A1           1684  2380\n     A2           1190  1684\n     A3            842  1190\n     A4            595   842\n     A4Small       595   842\n     A5            421   595\n     A6            297   421\n     A7            210   297\n     A8            148   210\n     A9            105   148\n     A10            74   105\n     B0           2836  4008\n     B1           2004  2836\n     B2           1418  2004\n     B3           1002  1418\n     B4            709  1002\n     B5            501   709\n     C0           2600  3677\n     C1           1837  2600\n     C2           1298  1837\n     C3            918  1298\n     C4            649   918\n     C5            459   649\n     C6            323   459\n     Flsa          612   936\n     Flse          612   936\n     HalfLetter    396   612\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor convenience you can specify the page size by media (e.g. A4, Ledger,\netc.). Otherwise, <strong>-page</strong> behaves much like\n<strong>-geometry</strong> (e.g.  <tt>-page letter+43+43&gt;</tt>).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is also used to place subimages when writing to a multi-image\nformat that supports offsets, such as GIF89 and MNG.  When used for this\npurpose the offsets are always  measured from the\ntop left corner of the canvas and are not affected by the <strong>-gravity</strong>\noption.\nTo position a GIF or MNG image, use <strong>-page</strong><em>{+-}&lt;x&gt;{+-}&lt;y&gt;</em>\n(e.g. -page +100+200).  When writing to a MNG file, a <strong>-page</strong>\noption appearing ahead of the first image in the sequence with nonzero\nwidth and height defines the width and height values that are written in\nthe <strong>MHDR</strong> chunk.  Otherwise, the MNG width and height are computed\nfrom the bounding box that contains all images in the sequence.  When\nwriting a GIF89 file, only the bounding box method is used to determine its\ndimensions.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor a PostScript page, the image is sized as in <strong>-geometry</strong> and positioned\nrelative to the lower left hand corner of the page by\n{+-}&lt;<strong>x</strong><em>offset</em>&gt;{+-}&lt;<strong>y</strong>\n<em>offset&gt;</em>. Use\n<tt>-page 612x792&gt;</tt>, for example, to center the\nimage within the page. If the image size exceeds the PostScript page, it\nis reduced to fit the page.\nThe default gravity for the <strong>-page</strong>\noption is <em>NorthWest</em>, i.e., positive <strong>x</strong> and\n<strong>y</strong> <em>offset</em> are measured rightward and downward from the top\nleft corner of the page, unless the <strong>-gravity</strong> option is present with\na value other than <em>NorthWest</em>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default page dimensions for a TEXT image is 612x792.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option is used in concert with <strong>-density</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+page</strong> to remove the page settings for an image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-paint\"></a>-paint <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate an oil painting</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEach pixel is replaced by the most frequent color in a circular neighborhood\nwhose width is specified with <em>radius</em>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-pause\"></a>-pause <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pause between animation loops [animate]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPause for the specified number of seconds before repeating the\nanimation.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-pause\"></a>-pause <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pause between snapshots [import]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPause for the specified number of seconds before taking the next\nsnapshot.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-pen\"></a>-pen <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>(This option has been replaced by the -fill option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -ping\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>efficiently determine image characteristics</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to disable reading the image pixels so that image\ncharacteristics such as the image dimensions may be obtained very\nquickly. For identify, use +ping to force reading the image pixels so\nthat the pixel read rate may be included in the displayed information.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-preview\"></a>-preview <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>image preview type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to affect the preview operation of an image (e.g.\n<tt>convert file.png -preview Gamma Preview:gamma.png</tt>). Choose\nfrom these previews:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     Rotate\n     Shear\n     Roll\n     Hue\n     Saturation\n     Brightness\n     Gamma\n     Spiff\n     Dull\n     Grayscale\n     Quantize\n     Despeckle\n     ReduceNoise\n     AddNoise\n     Sharpen\n     Blur\n     Threshold\n     EdgeDetect\n     Spread\n     Shade\n     Raise\n     Segment\n     Solarize\n     Swirl\n     Implode\n     Wave\n     OilPaint\n     CharcoalDrawing\n     JPEG\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default preview is <strong>JPEG</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-process\"></a>-process <i>&lt;command&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>process a sequence of images using a process module</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe command argument has the form <strong>module=arg1,arg2,arg3,...,argN</strong>\nwhere <strong>module</strong> is the name of the module to invoke (e.g. \"analyze\")\nand arg1,arg2,arg3,...,argN are an arbitrary number of arguments to\npass to the process module.</font></td></tr></table><table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe sequence of images\nis terminated by the appearance of any option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf the <strong>-process</strong>\noption appears after all of the input images, all images are processed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-profile\"></a>-profile <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add ICM, IPTC, or generic profile  to image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<tt>-profile filename</tt> adds an ICM (ICC color management), IPTC\n(newswire information), or a generic (including Exif) profile to the image\n</font></td></tr></table>.\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <tt>+profile icm</tt>, <tt>+profile iptc</tt>, or\n<tt>+profile profile_name</tt> to remove the respective profile.\nMultiple profiles may be listed, separated by commas. Profiles may be\nexcluded from subsequent listed matches by preceding their name with\nan exclamation point.  For example, <tt>+profile '!icm,*'</tt> strips\nall profiles except for the ICM profile.  Use <tt>identify\n-verbose</tt> to find out what profiles are in the image file.  Use\n<tt>+profile \"*\"</tt> to remove all profiles.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Writing the image to a format that does not support profiles will\nof course also cause all profiles to be removed.  The JPEG and PNG\nformats will store any profiles that have been read and not removed.\nIn JPEG they are stored in APP1 markers, and in PNG they are stored\nas hex-coded binary in compressed zTXt chunks, except for the iCC\nchunk which is stored in the iCCP chunk.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nTo extract a profile, the <strong>-profile</strong> option is not used.  Instead,\nsimply write the file to an image\nformat such as <em>APP1, 8BIM, ICM,</em> or <em>IPTC</em>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example, to extract the Exif data (which is stored in JPEG files\nin the <em>APP1</em> profile), use\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert cockatoo.jpg exifdata.app1\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Note that GraphicsMagick does not attempt to update any profile to\nreflect changes made to the image, e.g., rotation from portrait to landscape\norientation, so it is possible that the preserved profile may contain\ninvalid data.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-preserve-timestamp\"></a>-preserve-timestamp\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preserve the original timestamps of the file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to preserve the original modification and access\ntimestamps of the file, even if it has been modified.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details+progress\"></a>+progress\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>disable progress monitor and busy cursor</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, when an image is displayed, a progress monitor bar is shown\nin the top left corner of an existing image display window, and the\ncurrent cursor is replaced with an hourglass cursor. Use <strong>+progress</strong>\nto disable the progress monitor and busy cursor during display operations.\nWhile the progress monitor is disabled for all operations, the busy\ncursor continues to be enabled for non-display operations such as image\nprocessing. This option is useful for non-interactive display operations,\nor when a \"clean\" look is desired.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-quality\"></a>-quality <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"> For the JPEG and MPEG image formats, quality is 0 (lowest image\nquality and highest compression) to 100 (best quality but least\neffective compression). The default quality is 75.  Use the\n<strong>-sampling-factor</strong> option to specify the factors for chroma\ndownsampling.  To use the same quality value as that found by the JPEG\ndecoder, use the <tt>-define jpeg:preserve-settings</tt> flag.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the MIFF image format, and the TIFF format while using ZIP\ncompression, quality/10 is the zlib compression level, which is 0 (worst\nbut fastest compression) to 9 (best but slowest). It has no effect on the\nimage appearance, since the compression is always lossless.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the JPEG-2000 image format, quality is mapped using a non-linear\nequation to the compression ratio required by the Jasper library. This\nnon-linear equation is intended to loosely approximate the quality\nprovided by the JPEG v1 format. The default quality value 75 results in\na request for 16:1 compression. The quality value 100 results in\na request for non-lossy compression.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the MNG and PNG image formats, the quality value sets the zlib compression\nlevel (quality / 10) and filter-type (quality % 10). Compression levels\nrange from 0 (fastest compression) to 100 (best but slowest). For compression\nlevel 0, the Huffman-only strategy is used, which is fastest but not\nnecessarily the worst compression.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf\nfilter-type is 4 or less, the specified filter-type is used for all scanlines:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     0: none\n     1: sub\n     2: up\n     3: average\n     4: Paeth\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf filter-type is 5, adaptive filtering is used when quality is greater\nthan 50 and the image does not have a color map, otherwise no filtering\nis used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf filter-type is 6, adaptive filtering\nwith <em>minimum-sum-of-absolute-values</em>\nis used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nOnly if the output is MNG, if filter-type is 7, the LOCO color transformation\nand adaptive filtering with <em>minimum-sum-of-absolute-values</em>\nare used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe default is quality is 75, which means nearly the best compression with\nadaptive filtering.  The quality setting has no effect on the appearance\nof PNG and MNG images, since the compression is always lossless.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor further information, see the <a href=\"http://www.w3.org/TR/\">PNG</a>\nspecification.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen writing a JNG image with transparency, two quality values are required,\none for the main image and one for the grayscale image that conveys the\nopacity channel.  These are written as a single integer equal to the main\nimage quality plus 1000 times the opacity quality.  For example, if you\nwant to use quality 75 for the main image and quality 90 to compress\nthe opacity data, use <tt>-quality 90075</tt>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the PNM family of formats (PNM, PGM, and PPM) specify a quality\nfactor of zero in order to obtain the ASCII variant of the format. Note\nthat -compress <em>none</em> used to be used to trigger ASCII output but\nprovided the opposite result of what was expected as compared with other\nformats.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor the TIFF format, the JPEG, WebP, Zip, and Zstd compression\nalgorithms are influenced by the quality value.  JPEG and WebP provide\nlossy compression so higher quality produces a larger file with less\ndegradation.  The Zip and Zstd compression algorithms (and WebP in\nlossless mode) are lossless and for these algorithms a higher\n'quality' means to work harder to produce a smaller file, but with no\ndifference in image quality.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-raise\"></a>-raise <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>lighten or darken image edges</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis will create a 3-D effect. See <strong>-geometry</strong> for details\ndetails about the geometry specification. Offsets are not used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>-raise</strong> to create a raised effect, otherwise use <strong>+raise</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-random-threshold\"></a>-random-threshold <i>&lt;channeltype&gt; &lt;LOWxHIGH&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>random threshold the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe channel or channels specified in the &lt;channeltype&gt; argument are\nreduced to binary, using an random-threshold method. The choices for\n<strong>channeltype</strong> are <strong>All</strong>, <strong>Intensity</strong>, <strong>Red</strong>,\n<strong>Green</strong>, <strong>Blue</strong>, <strong>Cyan</strong>, <strong>Magenta</strong>, <strong>Yellow</strong>,\n<strong>Black</strong>, and <strong>Opacity</strong></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen <strong>channeltype</strong> is \"All\", the color samples are thresholded into\na graylevel and then that gray level is stored in the three color\nchannels. Separately, the opacity channel is thresholded into a bilevel\nopacity value which is stored in the opacity channel. For each pixel, a\nnew random number is used to establish the threshold to be used. The\nthreshold never exceeds the specified maximum (HIGH) and is never less\nthan the specified minimum (LOW).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen <strong>channeltype</strong> is \"intensity\", only the color samples are\nthresholded. When <strong>channeltype</strong> is \"opacity\" or \"matte\", only the\nopacity channel is thresholded. The other named channels only threshold\nthe associated channel.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-recolor\"></a>-recolor <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a color translation matrix to image channels</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA user supplied color translation matrix (expressed as a text string)\nis used to translate/blend the image channels based on weightings in a\nsupplied matrix which may be of order 3 (color channels only), 4\n(color channels plus opacity), or 5 (color channels plus opacity and\noffset).  Values in the columns of the matrix (red, green, blue,\nopacity) are used as multipliers with the existing channel values and\nadded together according to the rows of the matrix.  Matrix values are\nfloating point and may be negative.  The offset column (column 5) is\npurely additive and is scaled such that 0.0 to 1.0 represents the\nmaximum quantum range (but values are not limited to this range). The\nmath for the color translation matrix is similar to that used by Adobe\nFlash except that the offset is scaled to 1.0 (divide Flash offset by\n255 for use with GraphicsMagick) so that the results are independent\nof quantum depth.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAn <strong>identity</strong> matrix exists for each matrix order which\nresults in no change to the image.  The translation matrix should be\nbased on an alteration of the identity matrix.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIdentity matrix of order 3</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  1 0 0\n  0 1 0\n  0 0 1\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nwhich may be formatted into a convenient matrix argument similar to\n(comma is treated as white space):</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  -recolor \"1 0 0, 0 1 0, 0 0 1\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIdentity matrix of order 4</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  1 0 0 0\n  0 1 0 0\n  0 0 1 0\n  0 0 0 1\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIdentity matrix of order 5.  The last row is required to exist\nfor the purpose of parsing, but is otherwise not used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  1 0 0 0 0\n  0 1 0 0 0\n  0 0 1 0 0\n  0 0 0 1 0\n  0 0 0 0 1\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAs an example, an image wrongly in BGR channel order may be converted\nto RGB using this matrix (blue-&gt;red, red-&gt;blue):</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  0 0 1\n  0 1 0\n  1 0 0\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nand an RGB image using standard Rec.709 primaries may be converted\nto grayscale using this matrix of standard weighting factors:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  0.2126 0.7152 0.0722\n  0.2126 0.7152 0.0722\n  0.2126 0.7152 0.0722\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nand contrast may be reduced by scaling down by 80% and adding a 10%\noffset:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  0.8 0.0 0.0 0.0 0.1\n  0.0 0.8 0.0 0.0 0.1\n  0.0 0.0 0.8 0.0 0.1\n  0.0 0.0 0.0 0.8 0.1\n  0.0 0.0 0.0 0.0 1.0\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-red-primary\"></a>-red-primary <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-region\"></a>-region <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply options to a portion of the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <em>x</em> and <em>y</em> offsets are treated in the same manner as in <strong>-crop</strong></font></td></tr></table>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-remote\"></a>-remote\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform a X11 remote operation</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-remote</strong> command sends a command to a \"gm display\" or \"gm\nanimate\" which is already running. The only command recognized at this\ntime is the name of an image file to load. This capability is very\nuseful to load new images without needing to restart GraphicsMagick\n(e.g. for a slide-show or to use GraphicsMagick as the display engine\nfor a different GUI). Also see the <strong>+progress</strong> option for a way\nto disable progress indication for a clean look while loading new images.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-render\"></a>-render\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>+render</strong> to turn off rendering vector operations. This is\nuseful when saving the result to vector formats such as MVG or SVG.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-repage\"></a>-repage <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAdjust the current image page canvas and position based on a relative\npage specification.  This option may be used to change the location of\na subframe (e.g. part of an animation) prior to composition.  If the\ngeometry specification is absolute (includes a '!'), then the offset\nadjustment is absolute and there is no adjustment to page width and\nheight, otherwise the page width and height values are also adjusted\nbased on the current image dimensions.  Use <strong>+repage</strong> to set the\nimage page offsets to default.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-resample\"></a>-resample <i>&lt;horizontal&gt;x&lt;vertical&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Resample image to specified horizontal and vertical resolution</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nResize the image so that its rendered size remains the same as the\noriginal at the specified target resolution. Either the current image\nresolution units or the previously set with <strong>-units</strong> are used to\ninterpret the argument. For example, if a 300 DPI image renders at 3\ninches by 2 inches on a 300 DPI device, when the image has been\nresampled to 72 DPI, it will render at 3 inches by 2 inches on a 72\nDPI device.  Note that only a small number of image formats\n(e.g. JPEG, PNG, and TIFF) are capable of storing the image\nresolution. For formats which do not support an image resolution, the\noriginal resolution of the image must be specified via <strong>-density</strong>\non the command line prior to specifying the resample resolution.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nNote that Photoshop stores and obtains image resolution from a\nproprietary embedded profile. If this profile exists in the image,\nthen Photoshop will continue to treat the image using its former\nresolution, ignoring the image resolution specified in the standard\nfile header.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSome image formats (e.g. PNG) require use of metric or english units\nso even if the original image used a particular unit system, if it is\nsaved to a different format prior to resampling, then it may be\nnecessary to specify the desired resolution units using <strong>-units</strong>\nsince the original units may have been lost. In other words, do not\nassume that the resolution units are restored if the image has been\nsaved to a file.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-resize\"></a>-resize <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis is an alias for the <strong>-geometry</strong> option and it behaves in the\nsame manner. If the <strong>-filter</strong> option precedes the <strong>-resize</strong>\noption, the specified filter is used.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThere are some exceptions:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>composite</em> option, <strong>-resize</strong> conveys the\npreferred size of the output image, while <strong>-geometry</strong> conveys the\nsize and placement of the <em>composite image</em> within the main\nimage.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nWhen used as a <em>montage</em> option, <strong>-resize</strong> conveys the preferred\nsize of the montage, while <strong>-geometry</strong> conveys\ninformation about the tiles.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-roll\"></a>-roll <i></i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>roll an image vertically or horizontally</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details the geometry specification.  The\n<em>x</em> and <em>y</em> offsets are not affected by the <strong>-gravity</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nA negative <em>x</em> offset rolls the image left-to-right. A negative\n<em>y</em> offset rolls the image top-to-bottom.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-rotate\"></a>-rotate <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPositive angles rotate the image in a clockwise direction while\nnegative angles rotate counter-clockwise.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <tt>&gt;</tt> to rotate the image only if its width exceeds the\nheight.  <tt>&lt;</tt> rotates the image <em>only</em> if its width is less\nthan the height. For example, if you specify <tt>-rotate \"-90&gt;\"</tt>\nand the image size is 480x640, the image is not rotated.  However, if\nthe image is 640x480, it is rotated by -90 degrees.  If you use\n<tt>&gt;</tt> or <tt>&lt;</tt>, enclose it in quotation marks to prevent it\nfrom being misinterpreted as a file redirection.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEmpty triangles left over from rotating the image are filled with the\ncolor defined as <strong>background</strong> (class <strong>backgroundColor</strong>).\nThe color is specified using the format described under the\n<strong>-fill</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-sample\"></a>-sample <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale image using pixel sampling</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details about\nthe geometry specification.\n<strong>-sample</strong> ignores the <strong>-filter</strong> selection if the <strong>-filter</strong> option\nis present.  Offsets, if present in the geometry string, are ignored, and\nthe <strong>-gravity</strong> option has no effect.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-sampling-factor\"></a>-sampling-factor <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option specifies the sampling factors to be used by the DPX, JPEG,\nMPEG, or YUV encoders for chroma downsampling. The sampling factor must\nbe specified while reading the raw YUV format since it is not preserved\nin the file header.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Industry-standard video subsampling notation such as \"4:2:2\" may also\nbe used to specify the sampling factors. \"4:2:2\" is equivalent to a\nspecification of \"2x1\"</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe JPEG decoder obtains the original sampling factors (and quality\nsettings) when a JPEG file is read. To re-use the original sampling\nfactors (and quality setting) when JPEG is output, use the <tt>-define\njpeg:preserve-settings</tt> flag.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-scale\"></a>-scale <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale the image.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-geometry</strong> for details about\nthe geometry specification.  <strong>-scale</strong> uses a simpler, faster algorithm,\nand it ignores the <strong>-filter</strong> selection if the <strong>-filter</strong> option\nis present.  Offsets, if present in the geometry string, are ignored, and\nthe <strong>-gravity</strong> option has no effect.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-scene\"></a>-scene <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option sets the scene number of an image or the first image in\nan image sequence.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-scenes\"></a>-scenes <i>&lt;value-value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>range of image scene numbers to read</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEach image in the range is read\nwith the filename followed by a period (<strong>.</strong>) and the decimal scene\nnumber.  You\ncan change this behavior by embedding a <strong>%d, %0Nd, %o, %0No, %x, or %0Nx\nprintf</strong> format specification in the file name. For example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm montage -scenes 5-7 image.miff montage.miff\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nmakes a montage of files image.miff.5, image.miff.6, and image.miff.7, and</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm animate -scenes 0-12 image%02d.miff\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nanimates files image00.miff, image01.miff, through image12.miff.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-screen\"></a>-screen\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the screen to capture</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option indicates that the GetImage request used to obtain the image\nshould be done on the root window, rather than directly on the specified\nwindow.  In this way, you can obtain pieces of other windows that overlap\nthe specified window, and more importantly, you can capture menus or other\npopups that are independent windows but appear over the specified window.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-set\"></a>-set <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSet a named image attribute.  The attribute is set on the current\n(previously specified on command line) image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details+set\"></a>+set <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUnset a named image attribute.  The attribute is removed from the current\n(previously specified on command line) image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-segment\"></a>-segment <i>&lt;cluster threshold&gt;x&lt;smoothing threshold&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>segment an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSegment an image by analyzing the histograms of the color components and\nidentifying units that are homogeneous with the fuzzy c-means technique.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSegmentation is a very useful fast and and approximate color quantization\nalgorithm for scanned printed pages or scanned cartoons. It may also be\nused as a special effect. Specify <em>cluster threshold</em> as the minimum\npercentage of total pixels in a cluster before it is considered valid.\nFor huge images containing small detail, this may need to be a tiny\nfraction of a percent (e.g. 0.015) so that important detail is not lost.\n<em>Smoothing threshold</em> eliminates noise in the second derivative of\nthe histogram. As the value is increased, you can expect a smoother\nsecond derivative. The default is 1.5. Add the <em>-verbose</em> option to\nsee a dump of cluster statistics given the parameters used. The\nstatistics may be used as a guide to help fine tune the options.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-shade\"></a>-shade <i>&lt;azimuth&gt;x&lt;elevation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shade the image using a distant light source</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <em>azimuth</em> and <em>elevation</em> as the position of the light\nsource. Use <strong>+shade</strong> to return the shading results as a grayscale\nimage.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -shadow <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shadow the montage</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-shared-memory\"></a>-shared-memory\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use shared memory</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option specifies whether the utility should attempt to use shared\nmemory for pixmaps.  GraphicsMagick must be compiled with shared\nmemory support, and the display must support the <em>MIT-SHM</em>\nextension.  Otherwise, this option is ignored.  The default is\n<strong>True</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-sharpen\"></a>-sharpen <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse a Gaussian operator of the given radius and standard deviation\n(sigma).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-shave\"></a>-shave <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shave pixels from the image edges</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify the width of the region to be removed from both\nsides of the image and the height of the regions to be removed from\ntop and bottom.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-shear\"></a>-shear <i>&lt;x degrees&gt;x&lt;y degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shear the image along the X or Y axis</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse the specified positive or negative shear angle.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nShearing slides one edge of an image along the X or Y axis, creating a\nparallelogram. An X direction shear slides an edge along the X axis,\nwhile a Y direction shear slides an edge along the Y axis. The amount\nof the shear is controlled by a shear angle. For X direction shears,\n<em>x degrees</em> is measured relative to the Y axis, and similarly,\nfor Y direction shears <em>y degrees</em> is measured relative to the X\naxis.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nEmpty triangles left over from shearing the image are filled with the\ncolor defined as <strong>background</strong> (class <strong>backgroundColor</strong>).\nThe color is specified using the format described under the\n<strong>-fill</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -silent\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>operate silently</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-size\"></a>-size <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to specify the width and height of raw images whose\ndimensions are unknown such as <strong>GRAY</strong>, <strong>RGB</strong>, or\n<strong>CMYK</strong>. In addition to width and height, use <strong>-size</strong> with an\noffset to skip any header information in the image or tell the number\nof colors in a <strong>MAP</strong> image file, (e.g. -size 640x512+256).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor Photo CD images, choose from these sizes:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     192x128\n     384x256\n     768x512\n     1536x1024\n     3072x2048\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFinally, use this option to choose a particular resolution layer of a JBIG\nor JPEG image (e.g. -size 1024x768).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-snaps\"></a>-snaps <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>number of screen snapshots</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option\nto grab more than one image from the X server screen, to create\nan animation sequence.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-solarize\"></a>-solarize <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>negate all pixels above the threshold level</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <em>factor</em> as the\npercent threshold of the intensity (0 - 99.9%).</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option produces a <em>solarization</em> effect seen when exposing a\nphotographic film to light during the development process.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-spread\"></a>-spread <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image pixels by a random amount</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>Amount</em> defines the size of the neighborhood around each pixel to\nchoose a candidate pixel to swap.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-stegano\"></a>-stegano <i>&lt;offset&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>hide watermark within an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse an offset to start the image hiding some number of pixels from the\nbeginning of the image.  Note this offset and the image size.  You will\nneed this information to recover the steganographic image\n(e.g. display -size 320x256+35 stegano:image.png).</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-stereo\"></a>-stereo\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite two images to create a stereo anaglyph</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe left side of the stereo pair is saved as the red channel of the output\nimage.  The right side is saved as the green channel.  Red-green stereo\nglasses are required to properly view the stereo image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-strip\"></a>-strip\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAll embedded profiles and text attributes are stripped from the image.\nThis is useful for images used for the web, or when output files need\nto be as small as possible</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBe careful not to use this option to remove author, copyright, and\nlicense information that you are required to retain when redistributing\nan image.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-stroke\"></a>-stroke <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when stroking a graphic primitive</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-draw</strong> for further details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-strokewidth\"></a>-strokewidth <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the stroke width</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSee <strong>-draw</strong> for further details.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-swirl\"></a>-swirl <i>&lt;degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>swirl image pixels about the center</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>Degrees</em> defines the tightness of the swirl.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-text-font\"></a>-text-font <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>font for writing fixed-width text</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecifies the name of the preferred font to use in fixed (typewriter style)\nformatted text.  The default is 14 point <em>Courier</em>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nYou can tag a font to specify whether it is a PostScript, TrueType, or\nX11 font.  For example, <tt>Courier.ttf</tt> is a TrueType font\nand <tt>x:fixed</tt> is X11.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-threshold\"></a>-threshold <i>&lt;value&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>threshold the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nModify the image such that any pixel sample with an intensity value\ngreater than the threshold is assigned the maximum intensity (white), or\notherwise is assigned the minimum intensity (black). If a percent prefix\nis applied, then the threshold is a percentage of the available range.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nTo efficiently create a black and white image from a color image, use</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -threshold 50% in.png out.png\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe optimum threshold value depends on the nature of the image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">In order to threshold individual channels, use the <strong>-operator</strong>\nsubcommand with it's <strong>Threshold</strong>, <strong>Threshold-White</strong>, or\n<strong>Threshold-Black</strong> options.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-thumbnail\"></a>-thumbnail <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-thumbnail</strong> command resizes the image as quickly as\npossible, with more concern for speed than resulting image quality.\nRegardless, resulting image quality should be acceptable for many\nuses.  It is primarily intended to be used to generate smaller\nversions of the image, but may also be used to enlarge the image.  The\n<strong>-thumbnail</strong> <strong>geometry</strong> argument observes the same syntax\nand rules as it does for <strong>-resize</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tile image when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>layout of images [<em>montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-title\"></a>-title <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign title to displayed image [<em>animate, display, montage</em>]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse this option to assign a specific title to the image. This is\nassigned to the image window and is typically displayed in the window\ntitle bar.  Optionally you can include the image filename, type,\nwidth, height, Exif data, or other image attribute by embedding\nspecial format characters described under the <strong>-format</strong>\noption.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nFor example,</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     -title \"%m:%f %wx%h\"\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nproduces an image title of <tt>MIFF:bird.miff 512x480</tt> for an image\ntitled <tt>bird.miff</tt> and whose width is 512 and height is 480.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-transform\"></a>-transform\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option applies the transformation matrix from a previous\n<strong>-affine</strong> option.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -affine 2,2,-2,2,0,0 -transform bird.ppm bird.jpg\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-transparent\"></a>-transparent <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe color is specified using the format described under the <strong>-fill</strong>\noption.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-treedepth\"></a>-treedepth <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nNormally, this integer value is zero or one. A value of zero or one\ncauses the use of an optimal tree depth for the color reduction\nalgorithm</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nAn optimal depth generally allows the best representation of the source\nimage with the fastest computational speed and the least amount of memory.\nHowever, the default depth is inappropriate for some images. To assure\nthe best representation, try values between 2 and 8 for this parameter.\nRefer to\n<a href=\"quantize.html\">quantize</a> for more details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-colors</strong> or <strong>-monochrome</strong> option, or writing to an image\nformat which requires color reduction, is required for this option to\ntake effect.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-trim\"></a>-trim\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option removes any edges that are exactly the same color as the\ncorner pixels.  Use <strong>-fuzz</strong> to make <strong>-trim</strong> remove edges that\nare nearly the same color as the corner pixels.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-type\"></a>-type <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from:\n<strong>Bilevel</strong>, <strong>Grayscale</strong>, <strong>Palette</strong>,\n<strong>PaletteMatte</strong>, <strong>TrueColor</strong>, <strong>TrueColorMatte</strong>,\n<strong>ColorSeparation</strong>, <strong>ColorSeparationMatte</strong>, or <strong>Optimize</strong>.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nNormally, when a format supports different subformats such as bilevel,\ngrayscale, palette, truecolor, and truecolor+alpha, the encoder will try\nto choose a suitable subformat based on the nature of the image. The\n<strong>-type</strong> option may be used to tailor the output subformat. By\ndefault the output subformat is based on readily available image\ninformation and is usually similar to the input format.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <tt>-type Optimize</tt> in order to enable inspecting all pixels\n(if necessary) in order to find the most efficient subformat. Inspecting\nall of the pixels may be slow for very large images, particularly if they\nare stored in a disk cache. If an RGB image contains only gray pixels,\nthen every pixel in the image must be inspected in order to decide that\nthe image is actually grayscale!</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSometimes a specific subformat is desired. For example, to force a JPEG\nimage to be written in TrueColor RGB format even though only gray pixels\nare present, use</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert bird.pgm -type TrueColor bird.jpg\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSimilarly, using <tt>-type TrueColorMatte</tt> will force the encoder to\nwrite an alpha channel even though the image is opaque, if the output\nformat supports transparency.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSome pseudo-formats (e.g. the XC format) will respect the requested\ntype if it occurs previously on the command line.  For example, to obtain\na DirectClass solid color canvas image rather than PsuedoClass, use</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert -size 640x480 -type TrueColor xc:red red.miff\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nLikewise, specify <strong>-type</strong> <strong>Bilevel</strong>, <strong>Grayscale</strong>,\n<strong>TrueColor</strong>, or <strong>TrueColorMatte</strong> prior to reading a Postscript\n(or PDF file) in order to influence the type of image that Ghostcript\nreturns. Reading performance will be dramatically improved for\nblack/white Postscript if <strong>Bilevel</strong> is specified, and will be\nconsiderably faster if <strong>Grayscale</strong> is specified.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-update\"></a>-update <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\ndetect when image file is modified and redisplay.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSuppose that while you are displaying an image the file that is currently\ndisplayed is over-written.\n<strong>display</strong> will automatically detect that\nthe input file has been changed and update the displayed image accordingly.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-units\"></a>-units <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the units of image resolution</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from: <strong>Undefined</strong>, <strong>PixelsPerInch</strong>, or\n<strong>PixelsPerCentimeter</strong>. This option is normally used in conjunction\nwith the <strong>-density</strong> option.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-unsharp\"></a>-unsharp <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+&lt;amount&gt;</i>}<i></i>{<i>+&lt;threshold&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image with an unsharp mask operator</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe <strong>-unsharp</strong> option sharpens an image. The image is convolved\nwith a Gaussian operator of the given radius and standard deviation\n(sigma). For reasonable results, radius should be larger than sigma. Use\na radius of 0 to have the method select a suitable radius.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe parameters are:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>radius</dt>\n<dd>\nThe radius of the Gaussian, in pixels, not counting the center pixel (default 0).\n</dd>\n<dt>sigma</dt>\n<dd>\nThe standard deviation of the Gaussian, in pixels (default 1.0).\n</dd>\n<dt>amount</dt>\n<dd>\nThe percentage of the difference between the original and the blur image that\nis added back into the original (default 1.0).\n</dd>\n<dt>threshold</dt>\n<dd>\nThe threshold, as a fraction of MaxRGB, needed to apply the difference\namount (default 0.05).\n</dd>\n</dl>\n</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -use-pixmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use the pixmap</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-verbose\"></a>-verbose\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis information is printed: image scene number; image name; image size;\nthe image class (<em>DirectClass</em> or <em>PseudoClass</em>); the total\nnumber of unique colors; and the number of seconds to read and transform\nthe image. If the image is <em>DirectClass</em>, the total number of unique\ncolors is not displayed unless <strong>-verbose</strong> is specified twice since\nit may take quite a long time to compute, particularly for deep images.\nIf the image is <em>PseudoClass</em> then its pixels are defined by indexes\ninto a colormap. If the image is <em>DirectClass</em> then each pixel\nincludes a complete and independent color specification.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf <strong>-colors</strong> is also specified, the total unique colors in the image\nand color reduction error values are printed. Refer to <a href=\"quantize.html\">quantize</a>\nfor a description of these values.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-version\"></a>-version\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -view <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>FlashPix viewing parameters</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-virtual-pixel\"></a>-virtual-pixel <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify contents of \"virtual pixels\"</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option \ndefines \"virtual pixels\" for use in operations that can access pixels outside\nthe boundaries of an image.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from these methods:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<dl>\n<dt>Constant</dt>\n<dd>\nUse the image background color.\n</dd>\n<dt>Edge</dt>\n<dd>\nExtend the edge pixel toward infinity (default).\n</dd>\n<dt>Mirror</dt>\n<dd>\nMirror the image.\n</dd>\n<dt>Tile</dt>\n<dd>\nTile the image.\n</dd>\n</dl>\n</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThis option affects operations that use\nvirtual pixels such as <strong>-blur</strong>, <strong>-sharpen</strong>, <strong>-wave</strong>, etc.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-visual\"></a>-visual <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>animate images using this X visual type</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nChoose from these visual classes:</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n     StaticGray\n     GrayScale\n     StaticColor\n     PseudoColor\n     TrueColor\n     DirectColor\n     default\n     visual id\n</pre></font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe X server must support the visual you choose, otherwise an error occurs.\nIf a visual is not specified, the visual class that can display the most\nsimultaneous colors on the default screen is chosen.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -watermark <i>&lt;brightness&gt;x&lt;saturation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>percent brightness and saturation of a watermark</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-wave\"></a>-wave <i>&lt;amplitude&gt;x&lt;wavelength&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>alter an image along a sine wave</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nSpecify <em>amplitude</em> and <em>wavelength</em>\nof the wave.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-white-point\"></a>-white-point <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-white-threshold\"></a>-white-threshold <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels above the threshold become white</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>-white-threshold</strong> to set pixels with values above the specified\nthreshold to maximum value (white). If only one value is supplied, or the\nred, green, and blue values are identical, then intensity thresholding is\nused. If the color threshold values are not identical then channel-based\nthresholding is used, and color distortion will occur. Specify a negative\nvalue (e.g. -1) if you want a channel to be ignored but you do want to\nthreshold a channel later in the list. If a percent (%) symbol is\nappended, then the values are treated as a percentage of maximum\nrange.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-window\"></a>-window <i>&lt;id&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image the background of a window</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\n<em>id</em> can be a window id or name.  Specify <strong>root</strong> to\nselect X's root window as the target window.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default the image is tiled onto the background of the target\nwindow.   If <strong>backdrop</strong> or <strong>-geometry</strong> are\nspecified, the image is surrounded by the background color.  Refer to\n<strong>X RESOURCES</strong> for details.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe image will not display on the root window if the image has more\nunique colors than the target window colormap allows.  Use\n<strong>-colors</strong> to reduce the number of colors.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -window-group\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the window group</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-write\"></a>-write <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write an intermediate image [<em>convert, composite</em>]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe current image is written to the specified filename and then\nprocessing continues using that image. The following is an example of how\nseveral sizes of an image may be generated in one command (repeat as\noften as needed):</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n    gm convert input.jpg -resize 50% -write input50.jpg \\\n              -resize 25% input25.jpg\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a name=\"details-write\"></a>-write <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write the image to a file [<em>display</em>]</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIf <em>filename</em> already exists, you will be prompted as to whether it should\nbe overwritten.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nBy default, the image is written in the format that it was read in as.\nTo specify a particular image format, prefix <em>filename</em> with the\nimage type and a colon (e.g., ps:image) or specify the image type as\nthe filename suffix (e.g., image.ps). Specify file as - for standard\noutput. If file has the extension <strong>.Z</strong> or <strong>.gz</strong>, the file\nsize is <strong>compressed</strong> using compress or <strong>gzip</strong>\nrespectively. Precede the image file name with | to pipe to a system\ncommand.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nUse <strong>-compress</strong> to specify the type of image compression.</font></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nThe equivalent X resource for this option is\n<strong>writeFilename</strong> (class <strong>WriteFilename</strong>).\nSee\n\"X Resources\", below,\nfor details.</font></td></tr></table>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"envi\"></a>Environment\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    COLUMNS\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Output screen width. Used when formatting text for the screen. Many\nUnix systems keep this shell variable up to date, but it may need to be\nexplicitly exported in order for GraphicsMagick to see it.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    DISPLAY\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>X11 display ID (host, display number, and screen in the form\nhostname:display.screen).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    HOME\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Location of user's home directory. For security reasons, now only\nobserved by \"uninstalled\" builds of GraphicsMagick which do not have\ntheir location hard-coded or set by an installer.  When supported,\nGraphicsMagick searches for configuration files in $HOME/.magick if\nthe directory exists. See <strong>MAGICK_CODER_MODULE_PATH</strong>,\n<strong>MAGICK_CONFIGURE_PATH</strong>, and <strong>MAGICK_FILTER_MODULE_PATH</strong> if\nmore flexibility is needed.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_ACCESS_MONITOR\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>When set to <strong>TRUE</strong>, command line monitor mode (enabled by\n<strong>-monitor</strong>) will also show files accessed (including temporary\nfiles) and any external commands which are executed. This is useful\nfor debugging, but also illustrates arguments made available to an\naccess handler registered by the\n<strong>MagickSetConfirmAccessHandler()</strong> C library function.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_CODER_STABILITY\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>The minimum coder stability level before it will be used. The\navailable levels are <strong>PRIMARY</strong>, <strong>STABLE</strong>, <strong>UNSTABLE</strong>,\nand <strong>BROKEN</strong>.  The default minimum level is <strong>UNSTABLE</strong>,\nwhich means that all available working coders will be used. The\npurpose of this option is to reduce the security exposure (or apparent\ncomplexity) due to the huge number of formats supported. Coders at the\n<strong>PRIMARY</strong> level are commonly used formats with very well\nmaintained implementations. Coders at the <strong>STABLE</strong> level are\nreasonably well maintained but represent less used formats. Coders at\nthe <strong>UNSTABLE</strong> level either have weak implementations, the file\nformat itself is weak, or the probability the coder will be needed is\nvanishingly small. Coders at the <strong>BROKEN</strong> level are known to\noften not work properly or might not be useful in their current state\nat all.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_CODER_MODULE_PATH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Search path to use when searching for image format coder modules.\nThis path allows the user to arbitrarily extend the image formats\nsupported by GraphicsMagick by adding loadable modules to an arbitrary\nlocation rather than copying them into the GraphicsMagick installation\ndirectory. The formatting of the search path is similar to operating\nsystem search paths (i.e. colon delimited for Unix, and semi-colon\ndelimited for Microsoft Windows). This user specified search path is used\nbefore trying the default search path.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_CONFIGURE_PATH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Search path to use when searching for configuration (.mgk) files.\nThe formatting of the search path is similar to operating system search\npaths (i.e. colon delimited for Unix, and semi-colon delimited for\nMicrosoft Windows). This user specified search path is used before trying\nthe default search path.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_DEBUG\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Debug options (see <strong>-debug</strong> for details).  Setting the\nconfigure debug option via an environment variable\n(e.g. <strong>MAGICK_DEBUG=configure</strong>) is necessary to see the complete\ninitialization process, which includes searching for configuration\nfiles.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_FILTER_MODULE_PATH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Search path to use when searching for filter process modules\n(invoked via <strong>-process</strong>). This path allows the user to arbitrarily\nextend GraphicsMagick's image processing functionality by adding loadable\nmodules to an arbitrary location rather than copying them into the\nGraphicsMagick installation directory. The formatting of the search path\nis similar to operating system search paths (i.e. colon delimited for\nUnix, and semi-colon delimited for Microsoft Windows). This user\nspecified search path is used before trying the default search path.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_GHOSTSCRIPT_PATH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>For Microsoft Windows, specify the path to the Ghostscript\ninstallation rather than searching for it via the Windows registry.\nThis helps in case Ghostscript is not installed via the Ghostscript\nWindows installer or the user wants more control over the Ghostscript\nused.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_HOME\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Path to top of GraphicsMagick installation directory. Only observed\nby \"uninstalled\" builds of GraphicsMagick which do not have their location\nhard-coded or set by an installer.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_MMAP_READ\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>If <strong>MAGICK_MMAP_READ</strong> is set to <strong>TRUE</strong>, GraphicsMagick\nwill attempt to memory-map the input file for reading. This usually\nsubstantially improves repeated read performance since the file is\nalready in memory after the first time it has been read. However,\ntesting shows that performance may be reduced for files accessed for\nthe first time since data is accessed via page-faults (upon first\naccess) and many operating systems fail to do sequential read-ahead of\nmemory mapped files, and particularly if those files are accessed over\na network.  If many large input files are read, then enabling this\noption may harm performance by overloading the operating system's VM\nsystem as it then needs to free unmapped pages and map new ones.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_IO_FSYNC\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>If <strong>MAGICK_IO_FSYNC</strong> is set to <strong>TRUE</strong>, then GraphicsMagick\nwill request that the output file is fully flushed and synchronized to\ndisk when it is closed. This incurs a performance penalty, but has the\nbenefit that if the power fails or the system crashes, the file should be\nvalid on disk. If image files are referenced from a database, then this\noption helps assure that the files referenced by the database are\nvalid.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_IOBUF_SIZE\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>The amount of I/O buffering (in bytes) to use when reading and\nwriting encoded files. The default is 16384, which is observed to work\nwell for many cases. The best value for a local filesystem is usually the\nthe native filesystem block size (e.g. 4096, 8192, or even 131,072 for\nZFS) in order to minimize the number of physical disk I/O operations.\nI/O performance to files accessed over a network may benefit\nsignificantly by tuning this option. Larger values are not necessarily\nbetter (they may be slower!), and there is rarely any benefit from using\nvalues larger than 32768. Use convert's <strong>-verbose</strong> option in order\nto evaluate read and write rates in pixels per second while keeping in\nmind that the operating system will try to cache files in RAM.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_DISK\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum amount of disk space allowed for use by the pixel cache.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_FILES\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum number of open files.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_MAP\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum size of a memory mapped file allocation.  A memory mapped\nfile consumes memory when the file is accessed, although the system\nmay reclaim such memory when needed.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_MEMORY\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum amount of memory to allocate from the heap.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_PIXELS\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum number of total pixels (image rows times image colums) to\nallow for any image which is requested to be created or read.  This is\nuseful to place a limit on how large an image may be.  If the input\nimage file has image dimensions larger than the pixel limit, then the\nimage memory allocation is denied and an error is returned\nimmediately.  This is a per-image limit and does not limit the total\nnumber of pixels due to multiple image frames/pages (e.g. multi-page\ndocument or an animation).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_WIDTH\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum pixel width of an image read, or created.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_LIMIT_HEIGHT\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Maximum pixel height of an image read, or created.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    MAGICK_TMPDIR\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Path to directory where GraphicsMagick should write temporary\nfiles. The default is to use the system default, or the location set by\n<strong>TMPDIR</strong>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    TMPDIR\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>For POSIX-compatible systems (Unix-compatible), the path to the\ndirectory where all applications should write temporary files.\nOverridden by <strong>MAGICK_TMPDIR</strong> if it is set.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    TMP <i>or TEMP</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>For Microsoft Windows, the path to the directory where applications\nshould write temporary files. Overridden by <strong>MAGICK_TMPDIR</strong> if it\nis set.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    OMP_NUM_THREADS\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>As per the OpenMP standard, this specifies the number of threads to\nuse in parallel regions. Some compilers default the number of threads to\nuse to the number of processor cores available while others default to\njust one thread. See the OpenMP specification for other standard\nadjustments and your compiler's manual for vendor-specific settings.</td></tr></table>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"file\"></a>Configuration Files\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>GraphicsMagick uses a number of XML format configuration files:\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    colors.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colors configuration file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  &lt;?xml version=\"1.0\"?&gt;\n  &lt;colormap&gt;\n    &lt;color name=\"AliceBlue\" red=\"240\" green=\"248\" blue=\"255\"\n           compliance=\"SVG, X11, XPM\" /&gt;\n  &lt;/colormap&gt;\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    delegates.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>delegates configuration file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    log.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>logging configuration file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  &lt;?xml version=\"1.0\"?&gt;\n  &lt;magicklog&gt;\n    &lt;log events=\"None\" /&gt;\n    &lt;log output=\"stdout\" /&gt;\n    &lt;log filename=\"Magick-%d.log\" /&gt;\n    &lt;log generations=\"3\" /&gt;\n    &lt;log limit=\"2000\" /&gt;\n    &lt;log format=\"%t %r %u %p %m/%f/%l/%d:\\n  %e\"  /&gt;\n  &lt;/magicklog&gt;\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    modules.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>loadable modules configuration file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  &lt;?xml version=\"1.0\"?&gt;\n  &lt;modulemap&gt;\n    &lt;module magick=\"8BIM\" name=\"META\" /&gt;\n  &lt;/modulemap&gt;\n</pre></font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    type.mgk\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>master type (fonts) configuration file</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"><pre>\n  &lt;?xml version=\"1.0\"?&gt;\n  &lt;typemap&gt;\n    &lt;<strong></strong>include file=\"type-windows.mgk\" /&gt;\n    &lt;type\n      name=\"AvantGarde-Book\"\n      fullname=\"AvantGarde Book\"\n      family=\"AvantGarde\"\n      foundry=\"URW\"\n      weight=\"400\"\n      style=\"normal\"\n      stretch=\"normal\"\n      format=\"type1\"\n      metrics=\"/usr/local/share/ghostscript/fonts/a010013l.afm\"\n      glyphs=\"/usr/local/share/ghostscript/fonts/a010013l.pfb\"\n    /&gt;\n  &lt;/typemap&gt;\n</pre></font></td></tr></table>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"animate\"></a>gm animate\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Animate</strong> displays a sequence of images on any workstation display\nrunning an X server. <strong>animate</strong> first determines the hardware capabilities\nof the workstation. If the number of unique colors in an image is less\nthan or equal to the number the workstation can support, the image is displayed\nin an X window. Otherwise the number of colors in the image is first reduced\nto match the color resolution of the workstation before it is displayed.\n<p>\nThis means that a continuous-tone 24 bits-per-pixel image can display on\na 8 bit pseudo-color device or monochrome device. In most instances the\nreduced color image closely resembles the original. Alternatively, a monochrome\nor pseudo-color image sequence can display on a continuous-tone 24 bits-per-pixel\ndevice.\n<p>\nTo help prevent color flashing on X server visuals that have colormaps,\n<strong>animate</strong>\ncreates a single colormap from the image sequence. This can be rather time\nconsuming. You can speed this operation up by reducing the colors in the\nimage before you \"animate\" them. Use <strong>mogrify</strong> to color reduce the\nimages to a single colormap. See <strong>mogrify(1)</strong> for details. Alternatively,\nyou can use a Standard Colormap; or a static, direct, or true color visual.\nYou can define a Standard Colormap with <em>xstdcmap</em>. See <strong>xstdcmap(1)</strong>\nfor details. This method is recommended for colormapped X server because\nit eliminates the need to compute a global colormap.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo animate a set of images of a cockatoo, use:\n<pre>\n    gm animate cockatoo.*\n</pre>\n<p>\nTo animate a cockatoo image sequence while using the Standard Colormap\n<em>best</em>, use:\n<pre>\n    xstdcmap -best\n    gm animate -map best cockatoo.*\n</pre>\n<p>\nTo animate an image of a cockatoo without a border centered on a backdrop,\nuse:\n<br>&nbsp;<br>\n<pre>\n    gm animate +borderwidth -backdrop cockatoo.*\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-backdrop\">-backdrop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the image centered on a backdrop.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -borderwidth <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-chop\">-chop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixels from the interior of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colormap\">-colormap</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the colormap type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-foreground\">-foreground</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the foreground color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-iconGeometry\">-iconGeometry</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the icon geometry</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -iconic\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>iconic animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-map\">-map</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display image using this type.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -name\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pause\">-pause</a> <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pause between animation loops [animate]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-remote\">-remote</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform a X11 remote operation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scenes\">-scenes</a> <i>&lt;value-value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>range of image scene numbers to read</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shared-memory\">-shared-memory</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use shared memory</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-text-font\">-text-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>font for writing fixed-width text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-title\">-title</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign title to displayed image [<em>animate, display, montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-visual\">-visual</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>animate images using this X visual type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-window\">-window</a> <i>&lt;id&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image the background of a window</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<p>\nAny option you specify on the command line remains in effect for the group\nof images following it, until the group is terminated by the appearance of\nany option or <strong>-noop</strong>.  For example, to animate three images, the first\nwith 32 colors, the second with an unlimited number of colors, and the\nthird with only 16 colors, use:\n<br>&nbsp;<br>\n<pre>\n    gm animate -colors 32 cockatoo.1 -noop cockatoo.2\n             -colors 16 cockatoo.3\n</pre>\n<p>\n<strong>Animate</strong> options can appear on the command line or in your X resources\nfile. See <em>X(1)</em>. Options on the command line supersede values specified\nin your X resources file.\n<p>Image filenames may appear in any order on the command line if the image\nformat is <em>MIFF</em> (refer to <strong>miff(5)</strong> and the\n<strong>scene</strong> keyword\nis specified in the image. Otherwise the images will display in the order\nthey appear on the command line.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mous\"></a>Mouse Buttons\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nPress any button to map or unmap the Command widget. See the next section\nfor more information about the Command widget.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comm\"></a>Command Widget\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe Command widget lists a number of sub-menus and commands. They are\n<ul>\n<li><strong>Animate</strong>\n<ul>\n<li>    Open\n<li>    Play\n<li>    Step\n<li>    Repeat\n<li>    Auto Reverse\n</ul>\n<li><strong>Speed</strong>\n<ul>\n<li>    Faster\n<li>    Slower\n</ul>\n<li><strong>Direction</strong>\n<ul>\n<li>    Forward\n<li>    Reverse\n</ul>\n<li><strong>Image Info</strong>\n<li><strong>Help</strong>\n<li><strong>Quit</strong>\n</ul>\n<p>\nMenu items with a indented triangle have a sub-menu. They are represented\nabove as the indented items. To access a sub-menu item, move the pointer\nto the appropriate menu and press a button and drag. When you find the\ndesired sub-menu item, release the button and the command is executed.\nMove the pointer away from the sub-menu if you decide not to execute a\nparticular command.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"keyb\"></a>Keyboard Accelerators\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt><strong>Ctl+O</strong></dt>\n<dd>Press to load an image from a file.</dd>\n<dt><strong>space</strong></dt>\n<dd>Press to display the next image in the sequence.</dd>\n<dt><strong>&lt;</strong></dt>\n<dd>Press to speed-up the display of the images.  Refer to\n<strong>-delay</strong> for more information.</dd>\n<dt><strong>&gt;</strong></dt>\n<dd>Press to slow the display of the images.  Refer to\n<strong>-delay</strong> for more information.</dd>\n<dt><strong>?</strong></dt>\n<dd>Press to display information about the image.  Press\nany key or button to erase the information.</dd>\n<dd>This information is printed: image name;  image size;\nand the total number of unique colors in the image.</dd>\n<dt><strong>F1</strong></dt>\n<dd>Press to display helpful information about <strong>animate(1)</strong>.</dd>\n<dt><strong>Ctl-q</strong></dt>\n<dd>Press to discard all images and exit program.</dd>\n</dl>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"xres\"></a>X Resources\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Animate</strong> options can appear on the command line or in your X resource\nfile. Options on the command line supersede values specified in your X\nresource file. See <strong>X(1)</strong> for more information on X resources.\n<p>\nAll <strong>animate</strong> options have a corresponding X resource. In addition,\nthe <strong>animate</strong> program uses the following X resources:\n<dl>\n<dt><strong>background</strong> <strong>(</strong><em>class</em> <strong>Background)</strong></dt>\n<dd>\nSpecifies the preferred color to use for the Image window background. The\ndefault is #ccc.</dd>\n<dt><strong>borderColor</strong> <strong>(</strong><em>class</em> <strong>BorderColor)</strong></dt>\n<dd>\nSpecifies the preferred color to use for the Image window border. The default\nis #ccc.</dd>\n<dt><strong>borderWidth</strong> <strong>(</strong><em>class</em> <strong>BorderWidth)</strong></dt>\n<dd>\nSpecifies the width in pixels of the Image window border. The default is\n2.</dd>\n<dt><strong>font</strong> <strong>(</strong><em>class</em> <strong>Font</strong> <strong>or</strong> <strong>FontList)</strong></dt>\n<dd>\nSpecifies the name of the preferred font to use in normal formatted text.\nThe default is 14 point <em>Helvetica</em>.</dd>\n<dt><strong>foreground</strong> <strong>(</strong><em>class</em> <strong>Foreground)</strong></dt>\n<dd>\nSpecifies the preferred color to use for text within the Image window.\nThe default is black.</dd>\n<dt><strong>geometry</strong> <strong>(</strong><em>class</em> <strong>geometry)</strong></dt>\n<dd>\nSpecifies the preferred size and position of the image window. It is not\nnecessarily obeyed by all window managers.\nOffsets, if present, are handled in <em>X(1)</em> style.  A negative x offset is\nmeasured from the right edge of the screen to the right edge of the icon,\nand a negative y offset is measured from the bottom edge of the screen\nto the bottom edge of the icon.</dd>\n<dt><strong>iconGeometry</strong> <strong>(</strong><em>class</em> <strong>IconGeometry)</strong></dt>\n<dd>\nSpecifies the preferred size and position of the application when iconified.\nIt is not necessarily obeyed by all window managers.\nOffsets, if present, are handled in the same manner as in class Geometry.</dd>\n<dt><strong>iconic</strong> <strong>(</strong><em>class</em> <strong>Iconic)</strong></dt>\n<dd>\nThis resource indicates that you would prefer that the application's windows\ninitially not be visible as if the windows had be immediately iconified\nby you. Window managers may choose not to honor the application's request.</dd>\n<dt><strong>matteColor</strong> <strong>(</strong><em>class</em> <strong>MatteColor)</strong></dt>\n<dd>\nSpecify the color of windows. It is used for the backgrounds of windows,\nmenus, and notices. A 3D effect is achieved by using highlight and shadow\ncolors derived from this color. Default value: #ddd.</dd>\n<dt><strong>name</strong> <strong>(</strong><em>class</em> <strong>Name)</strong></dt>\n<dd>\nThis resource specifies the name under which resources for the application\nshould be found. This resource is useful in shell aliases to distinguish\nbetween invocations of an application, without resorting to creating links\nto alter the executable file name. The default is the application name.</dd>\n<dt><strong>sharedMemory</strong> <strong>(</strong><em>class</em> <strong>SharedMemory)</strong></dt>\n<dd>\nThis resource specifies whether animate should attempt use shared memory\nfor pixmaps. ImageMagick must be compiled with shared memory support, and\nthe display must support the MIT-SHM extension. Otherwise, this resource\nis ignored. The default is True.</dd>\n<dt><strong>text_font</strong> <strong>(</strong><em>class</em> <strong>textFont)</strong></dt>\n<dd>\nSpecifies the name of the preferred font to use in fixed (typewriter style)\nformatted text. The default is 14 point <em>Courier</em>.</dd>\n<dt><strong>title</strong> <strong>(</strong><em>class</em> <strong>Title)</strong></dt>\n<dd>\nThis resource specifies the title to be used for the Image window. This\ninformation is sometimes used by a window manager to provide some sort\nof header identifying the window. The default is the image file name.</dd>\n</dl>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch\"></a>gm batch\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>batch</strong> executes an arbitary number of the utility commands\n(e.g. <strong>convert</strong>) in the form of a simple linear batch script in\norder to improve execution efficiency, and/or to allow use as a\nsubordinate co-process under the control of an arbitrary script or\nprogram.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p> To drive <strong>'gm batch'</strong> using a shell script (or a program\nwritten in any language), have the script/program send commands to 'gm\nbatch' via its standard input.  Specify that standard input should be\nused by using <strong>'-'</strong> as the file name.  The following example\nconverts all files matching '*.jpg' to TIFF format while rotating each\nfile by 90 degrees and stripping all embedded profiles.  The shell\nscript syntax is standard Unix shell:\n<pre>\n  for file in *.jpg\n  do\n    outfile=`basename $file .jpg`.tiff\n    echo convert -verbose \"'$file'\" -rotate 90 \\\n    +profile \"'*'\" \"'$outfile'\"\n  done | gm batch -echo on -feedback on -\n</pre>\n<p>\nWe can accomplish the same as the previous example by putting all the\ncommands in a text file and then specifying the name of the text file\nas the script to execute:\n<pre>\n  for file in *.jpg\n  do\n    outfile=`basename $file .jpg`.tiff\n    echo convert -verbose \"'$file'\" -rotate 90 \\\n    +profile \"'*'\" \"'$outfile'\"\n  done &gt; script.txt\n  gm batch -echo on -feedback on script.txt\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"batch-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed from left to right and must appear before any filename argument.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -echo <i>on|off</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>command echo on or off</td></tr></table>\n<p>\nSpecify <strong>on</strong> to enable echoing commands to standard output as\nthey are read or <strong>off</strong> to disable.  The default is\n<strong>off</strong>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -escape <i>unix|windows</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Parse using unix or windows syntax</td></tr></table>\n<p>\nCommands must be parsed from the input stream and escaping needs to be\nused to protect spaces or quoting characters in the input. Specify\n<strong>unix</strong> to use unix-style command line parsing or <strong>windows</strong>\nfor Microsoft Windows command shell style parsing. The default depends\non if the software is compiled for Microsoft Windows or for a\nUnix-type system (including Cygwin on Microsoft Windows).  It is\nrecommended to use unix syntax because it is more powerful and more\nportable.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -fail <i>text</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>text to print if a command fails</td></tr></table>\n<p>\nWhen feedback is enabled, this specifies the text to print when the\ncommand fails.  The default text is <strong>FAIL</strong>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -feedback <i>on|off</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable error feedback</td></tr></table>\n<p>\nPrint text (see -pass and -fail options) feedback after each\ncommand to indicate the result, the default is <strong>off</strong>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<p>\nPrints batch command help.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pass <i>text</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>text to print if a command passes</td></tr></table>\n<p>\nWhen feedback is enabled, this specifies the text to print when the\ncommand passes.  The default text is <strong>PASS</strong>.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -prompt <i>text</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Prompt text to use for command line</td></tr></table>\n<p>\nIf no filename argument was specified, a simple command prompt appears\nwhere you may enter GraphicsMagick commands.  The default prompt is\n<strong>GM&gt;</strong>.  Use this option to change the prompt to something else.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -stop-on-error <i>on|off</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify if command processing stops on error</td></tr></table>\n<p>\nNormally command processing continues if a command encounters an\nerror.  Specify <strong>-stop-on-error on</strong> to cause processing to quit\nimmediately on error.\n</td></tr></table>\n</td></tr></table>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"benchmark\"></a>gm benchmark\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"bench-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>benchmark</strong> executes an arbitrary <strong>gm</strong> utility command\n(e.g. <strong>convert</strong>) for one or more loops, and/or a specified\nexecution time, and reports many execution metrics.  For builds using\nOpenMP, a mode is provided to execute the benchmark with an increasing\nnumber of threads and provide a report of speedup and multi-thread\nexecution efficiency.  If <strong>benchmark</strong> is used to execute a\ncommand without any additional benchmark options, then the command is\nrun once.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"bench-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>To obtain benchmark information for a single execution of a\ncommand:\n<pre>\n    gm benchmark convert input.ppm -gaussian 0x1 output.ppm\n</pre>\n<p>To obtain benchmark information from 100 iterations of the\ncommand:\n<pre>\n    gm benchmark -iterations 100 convert input.ppm \\\n      -gaussian 0x1 output.ppm\n</pre>\n<p>To obtain benchmark information by iterating the command until a\nspecified amount of time (in seconds) has been consumed:\n<pre>\n    gm benchmark -duration 30 convert input.ppm \\\n      -gaussian 0x1 output.ppm\n</pre>\n<p>To obtain a full performance report with an increasing number of\nthreads (1-32 threads, stepping the number of threads by four each\ntime):\n<pre>\n    gm benchmark -duration 3 -stepthreads 4 convert \\\n      input.ppm -gaussian 0x2 output.ppm\n</pre>\n<p>Here is the interpretation of the output:\n<ul>\n<li><strong>threads</strong> - number of threads used.\n<li><strong>iter</strong> - number of command iterations executed.\n<li><strong>user</strong> - total user time consumed.\n<li><strong>total</strong> - total elapsed time consumed.\n<li><strong>iter/s</strong> - number of command iterations per second.\n<li><strong>iter/cpu</strong> - amount of CPU time consumed per iteration.\n<li><strong>speedup</strong> - speedup compared with one thread.\n<li><strong>karp-flatt</strong> - Karp-Flatt measure of speedup efficiency.\n</ul>\n<p><em>Please note that the reported \"speedup\" is based on the\nexecution time of just one thread.  A preliminary warm-up pass is used\nbefore timing the first loop in order to ensure that the CPU is\nbrought out of power-saving modes and that system caches are warmed\nup.  Most modern CPUs provide a \"turbo\" mode where the CPU clock speed\nis increased (e.g. by a factor of two) when only one or two cores are\nactive.  If the CPU grows excessively hot (due to insufficient\ncooling), then it may dial back its clock rates as a form of thermal\nmanagement.  These factors result in an under-reporting of speedup\ncompared to if \"turbo\" mode was disabled and the CPU does not need to\nworry about thermal management.  The <strong>powertop</strong> utility available\nunder Linux and Solaris provides a way to observe CPU core clock rates\nwhile a benchmark is running.</em>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"bench-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p> Options are processed from left to right and must appear before\nany argument.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -duration <i>duration</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>duration to run benchmark</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Specify the number of seconds to run the benchmark. The command is\nexecuted repeatedly until the specified amount of time has\nelapsed.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nPrints benchmark command help.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -iterations <i>loops</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>number of command iterations</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Specify the number of iterations to run the benchmark. The command\nis executed repeatedly until the specified number of iterations has\nbeen reached.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -rawcsv\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Print results in CSV format</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">Print results in a comma-separated value (CSV) format which is easy\nto parse for plotting or importing into a spreadsheet or database.\nThe values reported are <strong>threads</strong>, <strong>iterations</strong>,\n<strong>user_time</strong>, and <strong>elapsed_time</strong>.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -stepthreads <i>step</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>execute a per-thread benchmark ramp</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\"> Execute a per-thread benchmark ramp, incrementing the number of\nthreads at each step by the specified value.  The maximum number of\nthreads is taken from the standard <tt>OMP_NUM_THREADS</tt>\nenvironment variable.</font></td></tr></table>\n</td></tr></table>\n</td></tr></table>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"compare\"></a>gm compare\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>compare</strong> compares two similar images using a specified statistical\nmethod (see <strong>-metric</strong>) and/or by writing a difference image\n(<strong>-file</strong>), with the altered pixels annotated using a specified\nmethod (see <strong>-highlight-style</strong>) and color (see\n<strong>-highlight-color</strong>). <p><em>Reference-image</em> is the original\nimage and <em>compare-image</em> is the (possibly) altered version, which\nshould have the same dimensions as <em>reference-image</em>.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo compare two images using Mean Square Error (MSE) statistical analysis\nuse:\n<pre>\n    gm compare -metric mse original.miff compare.miff\n</pre>\n<p>\nTo create an annotated difference image use:\n<pre>\n    gm compare -highlight-style assign -highlight-color purple \\\n      -file diff.miff original.miff compare.miff\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect only for the image that follows.  All\noptions are reset to their default values after each image is read.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-file\">-file</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write annotated difference image to file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-highlight-color\">-highlight-color</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixel annotation color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-highlight-style\">-highlight-style</a> <i>&lt;style&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixel annotation style</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-maximum-error\">-maximum-error</a> <i>&lt;limit&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the maximum amount of total image error</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -metric <i>&lt;metric&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>comparison metric (MAE, MSE, PAE, PSNR, RMSE)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n</td></tr></table>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"composite\"></a>gm composite\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>composite</strong> composites (combines) images to create new images.\n<p><em>base-image</em> is the base image and <em>change-image</em> contains the changes.\n<em>ouput-image</em> is the result, and normally has the same dimensions\nas <em>base-image</em>.\n<br>&nbsp;<br>\n<p>\nThe optional <em>mask-image</em> can be used to provide opacity information\nfor <em>change-image</em> when it has none or if you want a different mask.\nA mask image is typically grayscale and the same size as\n<strong>base-image</strong>. If <em>mask-image</em> is not grayscale, it is converted\nto grayscale and the resulting intensities are used as opacity\ninformation.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo composite an image of a cockatoo with a perch, use:\n<pre>\n    gm composite cockatoo.miff perch.ras composite.miff\n</pre>\n<p>\nTo compute the difference between images in a series, use:\n<pre>\n    gm composite -compose difference series.2 series.1\n              difference.miff\n</pre>\n<p>\nTo composite an image of a cockatoo with a perch starting at location (100,150),\nuse:\n<pre>\n    gm composite -geometry +100+150 cockatoo.miff\n              perch.ras composite.miff\n</pre>\n<p>\nTo tile a logo across your image of a cockatoo, use\n<pre>\n    gm convert +shade 30x60 cockatoo.miff mask.miff\n    gm composite -compose bumpmap -tile logo.png\n              cockatoo.miff mask.miff composite.miff\n</pre>\n<p>\nTo composite a red, green, and blue color plane into a single composite image,\ntry\n<pre>\n    gm composite -compose CopyGreen green.png red.png\n              red-green.png\n    gm composite -compose CopyBlue blue.png red-green.png \n              gm composite.png\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"comp-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect only for the image that follows.  All\noptions are reset to their default values after each image is read.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blue-primary\">-blue-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compose\">-compose</a> <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-displace\">-displace</a> <i>&lt;horizontal scale&gt;x&lt;vertical scale&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shift image pixels as defined by a displacement map</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dissolve\">-dissolve</a> <i>&lt;percent&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>dissolve an image into another by the given percent</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gravity\">-gravity</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-green-primary\">-green-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-profile\">-profile</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add ICM, IPTC, or generic profile  to image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-recolor\">-recolor</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a color translation matrix to image channels</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-red-primary\">-red-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-render\">-render</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-repage\">-repage</a> <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scene\">-scene</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stegano\">-stegano</a> <i>&lt;offset&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>hide watermark within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stereo\">-stereo</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite two images to create a stereo anaglyph</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strip\">-strip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-units\">-units</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the units of image resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-unsharp\">-unsharp</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+&lt;amount&gt;</i>}<i></i>{<i>+&lt;threshold&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image with an unsharp mask operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -watermark <i>&lt;brightness&gt;x&lt;saturation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>percent brightness and saturation of a watermark</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-point\">-white-point</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-write\">-write</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write an intermediate image [<em>convert, composite</em>]</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n</td></tr></table>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conjure\"></a>gm conjure\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe Magick scripting language (MSL) will primarily benefit those that\nwant to accomplish custom image processing tasks but do not wish to\nprogram, or those that do not have access to a Perl interpreter or a\ncompiler.  The interpreter is called conjure and here is an example\nscript:\n<pre>\n    &lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n    &lt;image size=\"400x400\" &gt;\n      &lt;read filename=\"image.gif\" /&gt;\n      &lt;get width=\"base-width\" height=\"base-height\" /&gt;\n      &lt;resize geometry=\"%[dimensions]\" /&gt;\n      &lt;get width=\"width\" height=\"height\" /&gt;\n      &lt;print output=\n        \"Image sized from %[base-width]x%[base-height]\n         to %[width]x%[height].\\n\" /&gt;\n      &lt;write filename=\"image.png\" /&gt;\n    &lt;/image&gt;\n</pre>\n<p>\ninvoked with\n<pre>\n    gm conjure -dimensions 400x400 incantation.msl\n</pre>\n<p>\nAll operations will closely follow the key/value pairs defined in\nPerlMagick, unless otherwise noted.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conj-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect until it is explicitly changed by specifying\nthe option again with a different effect, or if it is changed by a statement\nin the scripting language.\n<p>\nYou can define your own keyword/value pairs on the command line.\nThe script can then use this information when setting values by including\n%[keyword] in the string.  For example, if you included\n\"-dimensions 400x400\" on the command line, as illustrated above,\nthen any string\ncontaining \"%[dimensions]\" would have 400x400 substituted.\nThe \"%[string]\" can be used either an entire string, such as\ngeometry=\"%[dimensions]\" or as a part of a string such as\nfilename=\"%[basename].png\".\n<p>\nThe keyword can be any string except for the following reserved\nstrings (in any upper, lower, or mixed case variant): <strong>debug</strong>,\n<strong>help</strong>, and <strong>verbose</strong>, whose usage is described below.\n<p>\nThe value can be any string.  If\neither the keyword or the value contains white space or any\nsymbols that have special meanings to your shell such as \"#\",\n\"|\",\nor\n\"%\", enclose the string in quotation marks or use \"\\\" to escape the white\nspace and special symbols.\n<p>\nKeywords and values are case dependent.  \"Key\",\n\"key\",\nand \"KEY\" would\nbe three different keywords.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conj-msl\"></a>Magick Scripting Language\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe Magick Scripting Language (MSL) presently defines the following\nelements and their attributes:\n<dl>\n<dt>&lt;image&gt;</dt>\n<dd>background, color, id, size</dd>\n<dd>\nDefine a new image object.  <strong>&lt;/image&gt;</strong> destroys it. Because of\nthis, if you wish to reference multiple \"subimages\" (aka pages or\nlayers), you can embed one <strong>image</strong> element inside of another. For\nexample:\n</dd>\n<dd>\n<pre>\n    &lt;image&gt;\n    &lt;read filename=\"input.png\" /&gt;\n    &lt;get width=\"base-width\" height=\"base-height\" /&gt;\n    &lt;image height=\"base-height\" width=\"base-width\"&gt;\n    &lt;image /&gt;\n    &lt;write filename=\"output.mng\" /&gt;\n    &lt;/image&gt;\n</pre>\n</dd>\n<dd>\n<pre>\n    &lt;image size=\"400x400\" /&gt;\n</pre>\n</dd>\n<dt>&lt;group&gt;</dt>\n<dd>\nDefine a new group of image objects.  By default, images are only\nvalid for the life of their <strong>&lt;image&gt;</strong>element.\n</dd>\n<dd>\n<pre>\n    &lt;image&gt;   -- creates the image\n    .....     -- do stuff with it\n    &lt;/image&gt;  -- dispose of the image\n</pre>\n</dd>\n<dd>\nHowever, in a group, all images in that group will stay around for the\nlife of the group:\n</dd>\n<dd>\n<pre>\n    &lt;group&gt;                           -- start a group\n        &lt;image&gt;                       -- create an image\n        ....                          -- do stuff\n        &lt;/image&gt;                      -- NOOP\n        &lt;image&gt;                       -- create another image\n        ....                          -- do more stuff\n        &lt;/image&gt;                      -- NOOP\n        &lt;write filename=\"image.mng\" /&gt;  -- output\n    &lt;/group&gt;                          -- dispose of both images\n</pre>\n</dd>\n<dt>&lt;read&gt;</dt>\n    <dd>filename</dd>\n<dd>\nRead a new image from a disk file.\n</dd>\n<dd>\n<pre>\n    &lt;read filename=\"image.gif\" /&gt;\n</pre>\n</dd>\n<dd>\nTo read two images use\n</dd>\n<dd>\n<pre>\n    &lt;read filename=\"image.gif\" /&gt;\n    &lt;read filename=\"image.png /&gt;\n</pre>\n</dd>\n<dt>&lt;write&gt;</dt>\n    <dd>filename</dd>\n<dd>Write the image(s) to disk, either as\na single multiple-image file or multiple ones if necessary.\n</dd>\n<dd>\n<pre>\n     &lt;write filename=image.tiff\" /&gt;\n</pre>\n<dt>&lt;get&gt;</dt>\n<dd>Get any attribute recognized by\nPerlMagick's GetAttribute() and stores it as an image attribute for later\nuse. Currently only <em>width</em> and <em>height</em> are supported.</dd>\n<dd>\n<pre>\n    &lt;get width=\"base-width\" height=\"base-height\" /&gt;\n    &lt;print output=\"Image size is %[base-width]x%[base-height].\\n\" /&gt;\n</pre>\n</dd>\n<dt>&lt;set&gt;</dt>\n<dd>background, bordercolor, clip-mask, colorspace, density,\nmagick, mattecolor, opacity.  Set an attribute recognized by\nPerlMagick's GetAttribute().</dd>\n<dt>&lt;profile&gt;</dt>\n    <dd>[profilename]</dd>\n<dd>\nRead one or more IPTC, ICC or generic profiles from file and assign to image\n</dd>\n<dd>\n<pre>\n    &lt;profile iptc=\"profile.iptc\" generic=\"generic.dat\" /&gt;\n</pre>\n</dd>\n<dd>\nTo remove a specified profile use \"!\" as the filename eg\n</dd>\n<dd>\n<pre>\n    &lt;profile icm=\"!\" iptc=\"profile.iptc\" /&gt;\n</pre>\n</dd>\n<dt>&lt;border&gt;</dt>\n    <dd>fill, geometry, height, width</dd>\n<dt>&lt;blur&gt;</dt>\n    <dd>radius, sigma</dd>\n<dt>&lt;charcoal&gt;</dt>\n    <dd>radius, sigma</dd>\n<dt>&lt;chop&gt;</dt>\n    <dd>geometry, height, width, x, y</dd>\n<dt>&lt;crop&gt;</dt>\n    <dd>geometry, height, width, x, y</dd>\n<dt>&lt;composite&gt;</dt>\n    <dd>compose, geometry, gravity, image, x, y</dd>\n<dd>\n<pre>\n    &lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n    &lt;group&gt;\n        &lt;image id=\"image_01\"&gt;\n            &lt;read filename=\"cloud3.gif\"/&gt;\n            &lt;resize geometry=\"250x90\"/&gt;\n        &lt;/image&gt;\n        &lt;image id=\"image_02\"&gt;\n            &lt;read filename=\"cloud4.gif\"/&gt;\n            &lt;resize geometry=\"190x100\"/&gt;\n        &lt;/image&gt;\n        &lt;image&gt;\n            &lt;read filename=\"background.jpg\"/&gt;\n            &lt;composite image=\"image_01\" geometry=\"+740+470\"/&gt;\n            &lt;composite image=\"image_02\" geometry=\"+390+415\"/&gt;\n        &lt;/image&gt;\n        &lt;write filename=\"result.png\"/&gt;\n    &lt;/group&gt;\n</pre>\n</dd>\n<dt>&lt;despeckle&gt;</dt>\n<dt>&lt;emboss&gt;</dt>\n    <dd>radius, sigma</dd>\n<dt>&lt;enhance&gt;</dt>\n<dt>&lt;equalize&gt;</dt>\n<dt>&lt;edge&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;flip&gt;</dt>\n<dt>&lt;flop&gt;</dt>\n<dt>&lt;frame&gt;</dt>\n    <dd>fill, geometry, height, width, x, y, inner, outer</dd>\n<dt>&lt;flatten&gt;</dt>\n<dt>&lt;get&gt;</dt>\n    <dd>height, width</dd>\n<dt>&lt;gamma&gt;</dt>\n    <dd>red, green, blue</dd>\n<dt>&lt;image&gt;</dt>\n    <dd>background, color, id, size</dd>\n<dt>&lt;implode&gt;</dt>\n    <dd>amount</dd>\n<dt>&lt;magnify&gt;</dt>\n<dt>&lt;minify&gt;</dt>\n<dt>&lt;medianfilter&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;normalize&gt;</dt>\n<dt>&lt;oilpaint&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;print&gt;</dt>\n    <dd>output</dd>\n<dt>&lt;profile&gt;</dt>\n    <dd>[profilename]</dd>\n<dt>&lt;read&gt;</dt>\n<dt>&lt;resize&gt;</dt>\n    <dd>blur, filter, geometry, height, width</dd>\n<dt>&lt;roll&gt;</dt>\n    <dd>geometry, x, y</dd>\n<dt>&lt;rotate&gt;</dt>\n    <dd>degrees</dd>\n<dt>&lt;reducenoise&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;sample&gt;</dt>\n    <dd>geometry, height, width</dd>\n<dt>&lt;scale&gt;</dt>\n    <dd>geometry, height, width</dd>\n<dt>&lt;sharpen&gt;</dt>\n    <dd>radius, sigma</dd>\n<dt>&lt;shave&gt;</dt>\n    <dd>geometry, height, width</dd>\n<dt>&lt;shear&gt;</dt>\n    <dd>x, y</dd>\n<dt>&lt;solarize&gt;</dt>\n    <dd>threshold</dd>\n<dt>&lt;spread&gt;</dt>\n    <dd>radius</dd>\n<dt>&lt;stegano&gt;</dt>\n    <dd>image</dd>\n<dt>&lt;stereo&gt;</dt>\n    <dd>image</dd>\n<dt>&lt;swirl&gt;</dt>\n    <dd>degrees</dd>\n<dt>&lt;texture&gt;</dt>\n    <dd>image</dd>\n<dt>&lt;threshold&gt;</dt>\n    <dd>threshold</dd>\n<dt>&lt;transparent&gt;</dt>\n    <dd>color</dd>\n<dt>&lt;trim&gt;</dt>\n</dl>\n</td></tr></table>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a convert=\"top\"></a>gm convert\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Convert</strong> converts an input file using one image format to an output\nfile with a differing image format. In addition, various types of image\nprocessing can be performed on the converted image during the conversion\nprocess. <strong>Convert</strong> recognizes the image formats listed in\n<em>GraphicsMagick(1)</em>.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conv-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo make a thumbnail of a JPEG image, use:\n<pre>\n    gm convert -size 120x120 cockatoo.jpg -resize 120x120\n            +profile \"*\" thumbnail.jpg\n</pre>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn this example, <tt>'-size 120x120'</tt> gives a hint to the JPEG decoder\nthat the image is going to be downscaled to 120x120, allowing it to run\nfaster by avoiding returning full-resolution images to GraphicsMagick for\nthe subsequent resizing operation.  The\n<tt>'-resize 120x120'</tt> specifies the desired dimensions of the\noutput image.  It will be scaled so its largest dimension is 120 pixels.  The\n<tt>'+profile \"*\"'</tt> removes any ICM, EXIF, IPTC, or other profiles\nthat might be present in the input and aren't needed in the thumbnail.</font></td></tr></table>\n<p>\nTo convert a <em>MIFF</em> image of a cockatoo to a SUN raster image, use:\n<pre>\n    gm convert cockatoo.miff sun:cockatoo.ras\n</pre>\n<p>\nTo convert a multi-page <em>PostScript</em> document to individual FAX pages,\nuse:\n<pre>\n    gm convert -monochrome document.ps fax:page\n</pre>\n<p>\nTo convert a TIFF image to a <em>PostScript</em> A4 page with the image in\nthe lower left-hand corner, use:\n<pre>\n    gm convert -page A4+0+0 image.tiff document.ps\n</pre>\n<p>\nTo convert a raw Gray image with a 128 byte header to a portable graymap,\nuse:\n<pre>\n    gm convert -depth 8 -size 768x512+128 gray:raw\n            image.pgm\n</pre>\n<p>\nIn this example, \"raw\" is the input file.  Its format is \"gray\" and it\nhas the dimensions and number of header bytes specified by the -size\noption and the sample depth specified by the\n-depth option.  The output file is \"image.pgm\".  The suffix \".pgm\"\nspecifies its format.\n<p>\nTo convert a Photo CD image to a TIFF image, use:\n<pre>\n    gm convert -size 1536x1024 img0009.pcd image.tiff\n    gm convert img0009.pcd[4] image.tiff\n</pre>\n<p>\nTo create a visual image directory of all your JPEG images, use:\n<pre>\n    gm convert 'vid:*.jpg' directory.miff\n</pre>\n<p>\nTo annotate an image with blue text using font 12x24 at position (100,100),\nuse:\n<pre>\n    gm convert -font helvetica -fill blue\n            -draw \"text 100,100 Cockatoo\"\n            bird.jpg bird.miff\n</pre>\n<p>\nTo tile a 640x480 image with a JPEG texture with bumps use:\n<pre>\n    gm convert -size 640x480 tile:bumps.jpg tiled.png\n</pre>\n<p>\nTo surround an icon with an ornamental border to use with Mosaic(1), use:\n<pre>\n    gm convert -mattecolor \"#697B8F\" -frame 6x6 bird.jpg\n            icon.png\n</pre>\n<p>\nTo create a MNG animation from a DNA molecule sequence, use:\n<pre>\n    gm convert -delay 20 dna.* dna.mng\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"conv-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images that follows,\nuntil the set is terminated by the appearance of any option or <strong>-noop</strong>.\nSome options only affect the decoding of images and others only the encoding.\nThe latter can appear after the final group of input images.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-adjoin\">-adjoin</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>join images into a single multi-image file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-affine\">-affine</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>drawing transform matrix</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-antialias\">-antialias</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixel aliasing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-append\">-append</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>append a set of images</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details\"></a> <i>-asc-cdl &lt;spec&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply ASC CDL color transform</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-auto-orient\">-auto-orient</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>orient (rotate) image so it is upright</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-average\">-average</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>average a set of images</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-black-threshold\">-black-threshold</a> <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels below the threshold become black</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blue-primary\">-blue-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blur\">-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-border\">-border</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with a border of color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-box\">-box</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the color of the annotation bounding box</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-channel\">-channel</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of channel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -charcoal <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate a charcoal drawing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-chop\">-chop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixels from the interior of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-clip\">-clip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply the clipping path, if one is present</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-coalesce\">-coalesce</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>merge a sequence of images</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorize\">-colorize</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colorize the image with the pen color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compose\">-compose</a> <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-contrast\">-contrast</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enhance or reduce the image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-convolve\">-convolve</a> <i>&lt;kernel&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>convolve image with the specified convolution kernel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-cycle\">-cycle</a> <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image colormap by amount</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-deconstruct\">-deconstruct</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>break down an image sequence into constituent parts</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -despeckle\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>reduce the speckles within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-draw\">-draw</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with one or more graphic primitives</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -edge <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>detect edges within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -emboss <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>emboss an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -enhance\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a digital filter to enhance a noisy image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -equalize\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform histogram equalization to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-extent\">-extent</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite image on background color canvas image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fill\">-fill</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flatten\">-flatten</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>flatten a sequence of images</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flip\">-flip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flop\">-flop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-format\">-format</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output formatted image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-frame\">-frame</a> <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fuzz\">-fuzz</a> <i>&lt;distance&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colors within this Euclidean distance are considered equal</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gaussian\">-gaussian</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gravity\">-gravity</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-green-primary\">-green-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -hald-clut <i>&lt;clut&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a Hald CLUT to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -implode <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>implode image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-intent\">-intent</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of rendering intent when managing the image color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-lat\">-lat</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;offset&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform local adaptive thresholding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-level\">-level</a> <i>&lt;black_point&gt;</i>{<i>,&lt;gamma&gt;</i>}<i></i>{<i>,&lt;white_point&gt;</i>}<i></i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>adjust the level of image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-list\">-list</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of list</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-loop\">-loop</a> <i>&lt;iterations&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add Netscape loop extension to your GIF animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-map\">-map</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>choose a particular set of colors from this image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mask\">-mask</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify a clipping mask</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -median <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a median filter to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -minify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>minify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-modulate\">-modulate</a> <i>brightness[,saturation[,hue]]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>vary the brightness, saturation, and hue of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-morph\">-morph</a> <i>&lt;frames&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>morphs an image sequence</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mosaic\">-mosaic</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a mosaic from an image or an image sequence</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-motion-blur\">-motion-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+angle</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Simulate motion blur</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noise\">-noise</a> <i>&lt;radius|type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add or reduce noise in an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-normalize\">-normalize</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform image to span the full range of color values</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-opaque\">-opaque</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>change this color to the pen color within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-operator\">-operator</a> <i>channel operator rvalue[%]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a mathematical, bitwise, or value operator to an image channel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-ordered-dither\">-ordered-dither</a> <i>&lt;channeltype&gt; &lt;NxN&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>ordered dither the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-orient\">-orient</a> <i>&lt;orientation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Set the image orientation attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-paint\">-paint</a> <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate an oil painting</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pen\">-pen</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>(This option has been replaced by the -fill option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -ping\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>efficiently determine image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-preview\">-preview</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>image preview type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-process\">-process</a> <i>&lt;command&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>process a sequence of images using a process module</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-profile\">-profile</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add ICM, IPTC, or generic profile  to image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-raise\">-raise</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>lighten or darken image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-random-threshold\">-random-threshold</a> <i>&lt;channeltype&gt; &lt;LOWxHIGH&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>random threshold the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-recolor\">-recolor</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a color translation matrix to image channels</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-red-primary\">-red-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-region\">-region</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply options to a portion of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-render\">-render</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-repage\">-repage</a> <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resample\">-resample</a> <i>&lt;horizontal&gt;x&lt;vertical&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Resample image to specified horizontal and vertical resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-roll\">-roll</a> <i></i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>roll an image vertically or horizontally</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sample\">-sample</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale image using pixel sampling</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scale\">-scale</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scene\">-scene</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-segment\">-segment</a> <i>&lt;cluster threshold&gt;x&lt;smoothing threshold&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>segment an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shade\">-shade</a> <i>&lt;azimuth&gt;x&lt;elevation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shade the image using a distant light source</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shave\">-shave</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shave pixels from the image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shear\">-shear</a> <i>&lt;x degrees&gt;x&lt;y degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shear the image along the X or Y axis</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-solarize\">-solarize</a> <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>negate all pixels above the threshold level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-spread\">-spread</a> <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image pixels by a random amount</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strip\">-strip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stroke\">-stroke</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when stroking a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strokewidth\">-strokewidth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the stroke width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-swirl\">-swirl</a> <i>&lt;degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>swirl image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-threshold\">-threshold</a> <i>&lt;value&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>threshold the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tile image when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transform\">-transform</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transparent\">-transparent</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-units\">-units</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the units of image resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-unsharp\">-unsharp</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+&lt;amount&gt;</i>}<i></i>{<i>+&lt;threshold&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image with an unsharp mask operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -use-pixmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use the pixmap</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -view <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>FlashPix viewing parameters</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-virtual-pixel\">-virtual-pixel</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify contents of \"virtual pixels\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-wave\">-wave</a> <i>&lt;amplitude&gt;x&lt;wavelength&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>alter an image along a sine wave</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-point\">-white-point</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-threshold\">-white-threshold</a> <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels above the threshold become white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-write\">-write</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write an intermediate image [<em>convert, composite</em>]</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"display\"></a>gm display\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nDisplay is a machine architecture independent\nimage processing and display program. It can display an image on any workstation\nscreen running an X server. <strong>Display</strong> can read and write\n<strong>many</strong>\nof the more popular image <a href=\"formats.html\">formats</a> (e.g. <strong>JPEG</strong>,\n<strong>TIFF</strong>,\n<strong>PNM</strong>,\n<strong>Photo\nCD</strong>, etc.).\n<p>\nWith <strong>display</strong>, you can perform these functions on an image:\n<dl>\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">load an image from a file\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display the next image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display the former image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display a sequence of images as a slide show\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">write the image to a file\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">print the image to a <em>PostScript</em> printer\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">delete the image file\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">create a Visual Image Directory\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">select the image to display by its thumbnail rather than name\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">undo last image transformation\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">copy a region of the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">paste a region to the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">restore the image to its original size\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">refresh the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">half the image size\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">double the image size\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">resize the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">crop the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">cut the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">flop image in the horizontal direction\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">flip image in the vertical direction\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">rotate the image 90 degrees clockwise\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">rotate the image 90 degrees counter-clockwise\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">rotate the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">shear the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">roll the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">trim the image edges\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">invert the colors of the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">vary the color brightness\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">vary the color saturation\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">vary the image hue\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">gamma correct the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">sharpen the image contrast\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">dull the image contrast\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">perform histogram equalization on the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">perform histogram normalization on the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">negate the image colors\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">convert the image to grayscale\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">set the maximum number of unique colors in the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">reduce the speckles within an image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">eliminate peak noise from an image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">detect edges within the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">emboss an image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">segment the image by color\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">simulate an oil painting\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">simulate a charcoal drawing\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">annotate the image with text\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">draw on the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">edit an image pixel color\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">edit the image matte information\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">composite an image with another\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">add a border to the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">surround image with an ornamental border\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">apply image processing techniques to a region of interest\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display information about the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">zoom a portion of the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">show a histogram of the image\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display image to background of a window\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">set user preferences\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display information about this program\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">discard all images and exit program\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">change the level of magnification\n<dd><img SRC=\"images/ball.png\" ALT=\"*\">display images specified by a World Wide Web (WWW) uniform resource locator (URL)\n</dl>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo scale an image of a cockatoo to exactly 640 pixels in width and 480\npixels in height and position the window at location (200,200), use:\n<pre>\n    gm display -geometry 640x480+200+200! cockatoo.miff\n</pre>\n<p>\nTo display an image of a cockatoo without a border centered on a backdrop,\nuse:\n<pre>\n    gm display +borderwidth -backdrop cockatoo.miff\n</pre>\n<p>\nTo tile a slate texture onto the root window, use:\n<pre>\n    gm display -size 1280x1024 -window root slate.png\n</pre>\n<p>\nTo display a visual image directory of all your JPEG images, use:\n<pre>\n    gm display 'vid:*.jpg'\n</pre>\n<p>\nTo display a MAP image that is 640 pixels in width and 480 pixels in height\nwith 256 colors, use:\n<pre>\n    gm display -size 640x480+256 cockatoo.map\n</pre>\n<p>\nTo display an image of a cockatoo specified with a <strong>World Wide Web (WWW)</strong>\nuniform resource locator <strong>(URL)</strong>, use:\n<pre>\n    gm display ftp://wizards.dupont.com/images/cockatoo.jpg\n</pre>\n<p>\nTo display histogram of an image, use:\n<pre>\n    gm gm convert file.jpg HISTOGRAM:- | gm display -\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect until it is explicitly changed by specifying\nthe option again with a different effect. For example to display three images,\nthe first with 32 colors, the second with an unlimited number of colors,\nand the third with only 16 colors, use:\n<pre>\n    gm display -colors 32 cockatoo.miff -noop duck.miff\n                 -colors 16 macaw.miff\n</pre>\n<p>\n<strong>Display</strong> options can appear on the command line or in your X resources\nfile. See <em>X(1)</em>. Options on the command line supersede values specified\nin your X resources file.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-backdrop\">-backdrop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the image centered on a backdrop.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-border\">-border</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with a border of color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -borderwidth <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colormap\">-colormap</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the colormap type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-contrast\">-contrast</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enhance or reduce the image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -despeckle\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>reduce the speckles within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -edge <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>detect edges within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -enhance\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a digital filter to enhance a noisy image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flip\">-flip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flop\">-flop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-foreground\">-foreground</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>define the foreground color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-frame\">-frame</a> <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-iconGeometry\">-iconGeometry</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the icon geometry</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -iconic\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>iconic animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -immutable\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image immutable</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-map\">-map</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display image using this type.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -name\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+progress\">+progress</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>disable progress monitor and busy cursor</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-raise\">-raise</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>lighten or darken image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-remote\">-remote</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform a X11 remote operation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-roll\">-roll</a> <i></i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>roll an image vertically or horizontally</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sample\">-sample</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale image using pixel sampling</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scenes\">-scenes</a> <i>&lt;value-value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>range of image scene numbers to read</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-segment\">-segment</a> <i>&lt;cluster threshold&gt;x&lt;smoothing threshold&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>segment an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shared-memory\">-shared-memory</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use shared memory</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-text-font\">-text-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>font for writing fixed-width text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-title\">-title</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign title to displayed image [<em>animate, display, montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-update\">-update</a> <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\ndetect when image file is modified and redisplay.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -use-pixmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use the pixmap</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-visual\">-visual</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>animate images using this X visual type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-window\">-window</a> <i>&lt;id&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make image the background of a window</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -window-group\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the window group</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-write\">-write</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>write the image to a file [<em>display</em>]</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-mous\"></a>Mouse Buttons\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe effects of each button press is described below. Three buttons are\nrequired. If you have a two button mouse, button 1 and 3 are returned.\nPress <strong>ALT</strong> and button 3 to simulate button 2.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    1\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nPress this button to map or unmap the <a href=\"#disp-comm\">Command\nwidget</a> . See the next section for more information about the Command\nwidget.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    2\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nPress and drag to define a region of the image to magnify.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    3\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nPress and drag to choose from a select set of <strong>display(1)</strong>\ncommands. This button behaves differently if the image being displayed\nis a visual image directory. Choose a particular tile of the directory\nand press this button and drag to select a command from a pop-up menu.\nChoose from these menu items:</td></tr></table>\n<ul>\n<li>Open\n<li>Next\n<li>Former\n<li>Delete\n<li>Update\n</ul>\n<p>\nIf you choose <strong>Open</strong>, the image represented by the tile is displayed.\nTo return to the visual image directory, choose <strong>Next</strong> from the Command\nwidget (refer to <a href=\"#disp-comm\">Command Widget</a>).\n<strong>Next</strong> and <strong>Former</strong>\nmoves to the next or former image respectively. Choose <strong>Delete</strong> to\ndelete a particular image tile. Finally, choose <strong>Update</strong> to synchronize\nall the image tiles with their respective images. See\n<a href=\"montage.html\">montage</a>\nand\n<a href=\"miff.html\">miff</a> for more details.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-comm\"></a>Command Widget\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nThe Command widget lists a number of sub-menus and commands. They are\n<ul>\n<li><strong>File</strong>\n<ul>\n<li>Open...\n<li>Next\n<li>Former\n<li>Select...\n<li>Save...\n<li>Print...\n<li>Delete...\n<li>Canvas...\n<li>Visual Directory...\n<li>Quit\n</ul>\n</ul>\n<ul>\n<li><strong>Edit</strong>\n<ul>\n<li>Undo\n<li>Redo\n<li>Cut\n<li>Copy\n<li>Paste\n</ul>\n</ul>\n<ul>\n<li><strong>View</strong>\n<ul>\n<li>Half Size\n<li>Original Size\n<li>Double Size\n<li>Resize...\n<li>Apply\n<li>Refresh\n<li>Restore\n</ul>\n</ul>\n<ul>\n<li><strong>Transform</strong>\n<ul>\n<li>Crop\n<li>Chop\n<li>Flop\n<li>Flip\n<li>Rotate Right\n<li>Rotate Left\n<li>Rotate...\n<li>Shear...\n<li>Roll...\n<li>Trim Edges\n</ul>\n</ul>\n<ul>\n<li><strong>Enhance</strong>\n<ul>\n<li>Hue...\n<li>Saturation...\n<li>Brightness...\n<li>Gamma...\n<li>Spiff...\n<li>Dull\n<li>Equalize\n<li>Normalize\n<li>Negate\n<li>GRAYscale\n<li>Quantize...\n</ul>\n</ul>\n<ul>\n<li><strong>Effects</strong>\n<ul>\n<li>Despeckle\n<li>Emboss\n<li>Reduce Noise\n<li>Add Noise\n<li>Sharpen...\n<li>Blur...\n<li>Threshold...\n<li>Edge Detect...\n<li>Spread...\n<li>Shade...\n<li>Raise...\n<li>Segment...\n</ul>\n</ul>\n<ul>\n<li><strong>F/X</strong>\n<ul>\n<li>Solarize...\n<li>Swirl...\n<li>Implode...\n<li>Wave...\n<li>Oil Paint...\n<li>Charcoal Draw...\n</ul>\n</ul>\n<ul>\n<li><strong>Image Edit</strong>\n<ul>\n<li>Annotate...\n<li>Draw...\n<li>Color...\n<li>Matte...\n<li>Composite...\n<li>Add Border...\n<li>Add Frame...\n<li>Comment...\n<li>Launch...\n<li>Region of Interest...\n</ul>\n</ul>\n<ul>\n<li><strong>Miscellany</strong>\n<ul>\n<li>Image Info\n<li>Zoom Image\n<li>Show Preview...\n<li>Show Histogram\n<li>Show Matte\n<li>Background...\n<li>Slide Show\n<li>Preferences...\n</ul>\n</ul>\n<ul>\n<li><strong>Help</strong>\n<ul>\n<li>Overview\n<li>Browse Documentation\n<li>About Display\n</ul>\n</ul>\n<p>\nMenu items with a indented triangle have a sub-menu. They are represented\nabove as the indented items. To access a sub-menu item, move the pointer\nto the appropriate menu and press button 1 and drag. When you find the\ndesired sub-menu item, release the button and the command is executed.\nMove the pointer away from the sub-menu if you decide not to execute a\nparticular command.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-keyb\"></a>Keyboard Accelerators\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAccelerators are one or two key presses that effect a particular command.\nThe keyboard accelerators that\n<strong>display</strong> understands is:\n<pre>\n    Ctl+O     Press to <a href=\"#disp-imlo\">load</a> an image from a file.\n    space     Press to display the next image.\n</pre>\n<p>\nIf the image is a multi-paged document such as a\n<em>PostScript</em> document,\nyou can skip ahead several pages by preceding this command with a number.\nFor example to display the fourth page beyond the current page,\npress <tt>4space</tt>.\n<pre>\n    backspace Press to display the former image.\n</pre>\n<p>\nIf the image is a multi-paged document such as a\n<em>PostScript</em> document,\nyou can skip behind several pages by preceding this command with a number.\nFor example to display the fourth page preceding the current page, press\n4n.\n<pre>\n    Ctl-S    Press to save the image to a file.\n    Ctl-P    Press to print the image to a\n             <em>PostScript</em> printer.\n    Ctl-D    Press to delete an image file.\n    Ctl-N    Press to create a blank canvas.\n    Ctl-Q    Press to discard all images and exit program.\n    Ctl+Z    Press to undo last image transformation.\n    Ctl+R    Press to redo last image transformation.\n    Ctl-X    Press to <a href=\"#disp-imcu\">cut</a> a region of\n             the image.\n    Ctl-C    Press to <a href=\"#disp-imco\">copy</a> a region of\n             the image.\n    Ctl-V    Press to <a href=\"#disp-impa\">paste</a> a region to\n             the image.\n    &lt;        Press to halve the image size.\n    .        Press to return to the original image size.\n    &gt;        Press to double the image size.\n    %        Press to resize the image to a width and height\n             you specify.\n    Cmd-A    Press to make any image transformations\n             permanent.\n             By default, any image size transformations are\n             applied to the original image to create the\n             image displayed on the X server.  However, the\n             transformations are not permanent (i.e. the\n             original image does not change size only the\n             X image does). For example, if you press \"&gt;\"\n             the X image will appear to double in size, but\n             the original image will in fact remain the same\n             size.  To force the original image to double in\n             size, press \"&gt;\" followed by \"Cmd-A\".\n    @        Press to refresh the image window.\n    C        Press to <a href=\"#disp-imcr\">crop</a> the image.\n    [        Press to <a href=\"#disp-imch\">chop</a> the image.\n    H        Press to flop image in the horizontal direction.\n    V        Press to flip image in the vertical direction.\n    /        Press to rotate the image 90 degrees clockwise.\n    \\        Press to rotate the image 90 degrees\n             counter-clockwise.\n    *        Press to <a href=\"#disp-imro\">rotate</a> the image\n             the number of degrees you specify.\n    S        Press to shear the image the number of degrees\n             you specify.\n    R        Press to roll the image.\n    T        Press to trim the image edges.\n    Shft-H   Press to vary the color hue.\n    Shft-S   Press to vary the color saturation.\n    Shft-L   Press to vary the image brightness.\n    Shft-G   Press to gamma correct the image.\n    Shft-C   Press to spiff up the image contrast.\n    Shft-Z   Press to dull the image contrast.\n    =        Press to perform histogram equalization on\n             the image.\n    Shft-N   Press to perform histogram normalization on\n             the image.\n    Shft-~   Press to negate the colors of the image.\n    .        Press to convert the image colors to gray.\n    Shft-#   Press to set the maximum number of unique\n             colors in the image.\n    F2       Press to reduce the speckles in an image.\n    F2       Press to emboss an image.\n    F4       Press to eliminate peak noise from an image.\n    F5       Press to add noise to an image.\n    F6       Press to sharpen an image.\n    F7       Press to blur image an image.\n    F8       Press to threshold the image.\n    F9       Press to detect edges within an image.\n    F10      Press to displace pixels by a random amount.\n    F11      Press to shade the image using a distant light\n             source.\n    F12      Press to lighten or darken image edges to\n             create a 3-D effect.\n    F13      Press to segment the image by color.\n    Meta-S   Press to swirl image pixels about the center.\n    Meta-I   Press to implode image pixels about the center.\n    Meta-W   Press to alter an image along a sine wave.\n    Meta-P   Press to simulate an oil painting.\n    Meta-C   Press to simulate a charcoal drawing.\n    Alt-X    Press to <a href=\"#disp-imcomp\">composite</a> the image\n             with another.\n    Alt-A    Press to <a href=\"#disp-iman\">annotate</a> the image with text.\n    Alt-D    Press to <a href=\"#disp-imdr\">draw</a> a line on the image.\n    Alt-P    Press to <a href=\"#disp-cole\">edit an image pixel color</a>.\n    Alt-M    Press to <a href=\"#disp-matt\">edit the image matte</a> information.\n    Alt-X    Press to <a href=\"#disp-imcomp\">composite</a> the image with another.\n    Alt-A    Press to add a border to the image.\n    Alt-F    Press to add a ornamental frame to the image.\n    Alt-Shft-!   Press to add an image comment.\n    Ctl-A    Press to apply image processing techniques to a\n             region of interest.\n    Shft-?   Press to display information about the image.\n    Shft-+   Press to map the zoom image window.\n    Shft-P   Press to preview an image enhancement, effect,\n             or f/x.\n    F1       Press to display helpful information about\n             the \"display\" utility.\n    Find     Press to browse documentation about\n             GraphicsMagick.\n    1-9      Press to change the level of magnification.\n</pre>\n<p>\nUse the arrow keys to move the image one pixel up, down, left, or right\nwithin the magnify window. Be sure to first map the magnify window by pressing\nbutton 2.\n<p>\nPress ALT and one of the arrow keys to trim off one pixel from any side\nof the image.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-xres\"></a>X Resources\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Display</strong> options can appear on the command line or in your X resource\nfile. Options on the command line supersede values specified in your X\nresource file. See <em>X(1)</em> for more information on X resources.\n<p>\nMost <strong>display</strong> options have a corresponding X resource. In addition,\n<strong>display</strong>\nuses the following X resources:\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    background <i>(class Background)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred color to use for the Image window background. The\ndefault is #ccc.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    borderColor <i>(class BorderColor)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred color to use for the Image window border. The default\nis #ccc.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    borderWidth <i>(class BorderWidth)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the width in pixels of the image window border. The default is\n2.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    browseCommand <i>(class browseCommand)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the name of the preferred browser when displaying GraphicsMagick\ndocumentation. The default is <tt>netscape %s</tt>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    confirmExit <i>(class ConfirmExit)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\n<strong>Display</strong> pops up a dialog box to confirm exiting the program when\nexiting the program. Set this resource to <tt>False</tt> to exit without\na confirmation.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    displayGamma <i>(class DisplayGamma)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the gamma of the X server.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nYou can apply separate gamma values to the red, green, and blue channels\nof the image with a gamma value list delineated with slashes (i.e. 1.7/2.3/1.2).</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe default is 2.2.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    displayWarnings <i>(class DisplayWarnings)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\n<strong>Display</strong> pops up a dialog box whenever a warning message occurs.\nSet this resource to <tt>False</tt> to ignore warning messages.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    font <i>(class FontList)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the name of the preferred font to use in normal formatted text.\nThe default is 14 point Helvetica.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    font[1-9] <i>(class Font[1-9])</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the name of the preferred font to use when\n<a href=\"#disp-iman\">annotating</a>\nthe image window with text. The default fonts are fixed, variable, 5x8,\n6x10, 7x13bold, 8x13bold, 9x15bold, 10x20, and 12x24.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    foreground <i>(class Foreground)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred color to use for text within the image window.\nThe default is black.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    gammaCorrect <i>(class gammaCorrect)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource, if true, will lighten or darken an image of known gamma\nto match the gamma of the display (see resource <strong>displayGamma</strong>). The\ndefault is True.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    geometry <i>(class Geometry)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred size and position of the image window. It is not\nnecessarily obeyed by all window managers.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nOffsets, if present, are handled in <em>X(1)</em> style.  A negative x offset is\nmeasured from the right edge of the screen to the right edge of the icon,\nand a negative y offset is measured from the bottom edge of the screen\nto the bottom edge of the icon.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    iconGeometry <i>(class IconGeometry)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the preferred size and position of the application when iconified.\nIt is not necessarily obeyed by all window managers.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nOffsets, if present, are handled in the same manner as in class Geometry.</font></td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    iconic <i>(class Iconic)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource indicates that you would prefer that the application's windows\ninitially not be visible as if the windows had be immediately iconified\nby you. Window managers may choose not to honor the application's request.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    magnify <i>(class Magnify)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nspecifies an integral factor by which the image should be enlarged. The\ndefault is 3.</td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis value only affects the magnification window which is invoked with\n<a href=\"#disp-mous\">button</a>\nnumber 3 after the image is displayed.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    matteColor <i>(class MatteColor)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecify the color of windows. It is used for the backgrounds of windows,\nmenus, and notices. A 3D effect is achieved by using highlight and shadow\ncolors derived from this color. Default value: #697B8F.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    name <i>(class Name)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource specifies the name under which resources for the application\nshould be found. This resource is useful in shell aliases to distinguish\nbetween invocations of an application, without resorting to creating links\nto alter the executable file name. The default is the application name.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    pen[1-9] <i>(class Pen[1-9])</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the color of the preferred font to use when\n<a href=\"#disp-iman\">annotating</a>\nthe image window with text. The default colors are black, blue, green,\ncyan, gray, red, magenta, yellow, and white.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    printCommand <i>(class PrintCommand)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis command is executed whenever Print is issued.  In general, it is the\ncommand to print <em>PostScript</em> to your printer. Default value: <tt>lp\n-c -s %i</tt>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    sharedMemory <i>(class SharedMemory)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource specifies whether display should attempt use shared memory\nfor pixmaps. GraphicsMagick must be compiled with shared memory support,\nand the display must support the MIT-SHM extension. Otherwise, this\nresource is ignored. The default is True.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    textFont <i>(class textFont)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies the name of the preferred font to use in fixed (typewriter style)\nformatted text. The default is 14 point Courier.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    title <i>(class Title)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThis resource specifies the title to be used for the image window. This\ninformation is sometimes used by a window manager to provide a header identifying\nthe window. The default is the image file name.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    undoCache <i>(class UndoCache)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nSpecifies, in mega-bytes, the amount of memory in the undo edit cache.\nEach time you modify the image it is saved in the undo edit cache as long\nas memory is available. You can subsequently <em>undo</em> one or more of\nthese transformations. The default is 16 Megabytes.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    usePixmap <i>(class UsePixmap)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nImages are maintained as a XImage by default. Set this resource to True\nto utilize a server Pixmap instead. This option is useful if your image\nexceeds the dimensions of your server screen and you intend to pan the\nimage. Panning is much faster with Pixmaps than with a XImage. Pixmaps\nare considered a precious resource, use them with discretion.</td></tr></table>\n<p>\nTo set the geometry of the Magnify or Pan or window, use the geometry resource.\nFor example, to set the Pan window geometry to 256x256, use:\n<pre>\n    gm display.pan.geometry: 256x256\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imlo\"></a>Image Loading\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo select an image to display, choose <strong>Open</strong> of the <strong>File</strong> sub-menu\nfrom the <a href=\"#disp-comm\">Command widget</a>. A file browser is displayed.\nTo choose a particular image file, move the pointer to the filename and\npress any button. The filename is copied to the text window. Next, press\n<strong>Open</strong>\nor press the <strong>RETURN</strong> key. Alternatively, you can type the image file\nname directly into the text window. To descend directories, choose a directory\nname and press the button twice quickly. A scrollbar allows a large list\nof filenames to be moved through the viewing area if it exceeds the size\nof the list area.\n<p>\nYou can trim the list of file names by using shell globbing characters.\nFor example, type <tt>*.jpg</tt> to list only files that end\nwith <tt>.jpg</tt>.\n<p>\nTo select your image from the X server screen instead of from a file, Choose\n<strong>Grab</strong> of the <strong>Open</strong> widget.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-visu\"></a>Visual Image Directory\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo create a Visual Image Directory, choose Visual Directory of the <strong>File</strong>\nsub-menu from the <a href=\"#disp-comm\">Command widget</a> . A file browser is\ndisplayed. To create a Visual Image Directory from all the images in the\ncurrent directory, press <strong>Directory</strong> or press the <strong>RETURN key</strong>.\nAlternatively, you can select a set of image names by using shell globbing\ncharacters. For example, type <tt>*.jpg</tt> to include only files that\nend with <tt>.jpg</tt>. To descend directories, choose a directory name\nand press the button twice quickly. A scrollbar allows a large list of\nfilenames to be moved through the viewing area if it exceeds the size of\nthe list area.\n<p>\nAfter you select a set of files, they are turned into thumbnails and tiled\nonto a single image. Now move the pointer to a particular thumbnail and\npress <strong>button 3</strong> and drag. Finally, select Open. The image represented\nby the thumbnail is displayed at its full size. Choose <strong>Next</strong> from\nthe <strong>File</strong> sub-menu of the Command widget to return to the Visual\nImage Directory.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imcu\"></a>Image Cutting\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nNote that cut information for image window is not retained for colormapped\nX server visuals (e.g. <em>StaticColor</em>,\n<em>StaticColor</em>, <em>GRAYScale</em>,\n<em>PseudoColor</em>).\nCorrect cutting behavior may require a <em>TrueColor</em> or <em>DirectColor</em>\nvisual or a <em>Standard Colormap</em>.\n<p>\nTo begin, press choose <strong>Cut</strong> of the <strong>Edit</strong> sub-menu from the\n<a href=\"#disp-comm\">Command\nwidget</a>. Alternatively, press\n<strong>F3</strong> in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in cut mode. In cut mode, the Command widget has these\noptions:\n<ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nTo define a cut region, press button 1 and drag. The cut region is defined\nby a highlighted rectangle that expands or contracts as it follows the\npointer. Once you are satisfied with the cut region, release the button.\nYou are now in rectify mode. In rectify mode, the Command widget has these\noptions:\n<ul>\n<li><strong>Cut</strong>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nYou can make adjustments by moving the pointer to one of the cut rectangle\ncorners, pressing a button, and dragging. Finally, press Cut to commit\nyour copy region. To exit without cutting the image, press Dismiss.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imco\"></a>Image Copying\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo begin, press choose <strong>Copy</strong> of the <strong>Edit</strong> sub-menu from the\n<a href=\"#disp-comm\">Command\nwidget</a>. Alternatively, press\n<strong>F4</strong> in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in copy mode. In copy mode, the Command widget has\nthese options:\n<ul>\n<li>Help\n<li>Dismiss\n</ul>\n<p>\nTo define a copy region, press button 1 and drag. The copy region is defined\nby a highlighted rectangle that expands or contracts as it follows the\npointer. Once you are satisfied with the copy region, release the button.\nYou are now in rectify mode. In rectify mode, the Command widget has these\noptions:\n<ul>\n<li>Copy\n<li>Help\n<li>Dismiss\n</ul>\n<p>\nYou can make adjustments by moving the pointer to one of the copy rectangle\ncorners, pressing a button, and dragging. Finally, press Copy to commit\nyour copy region. To exit without copying the image, press Dismiss.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-impas\"></a>Image Pasting\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo begin, press choose <strong>Paste</strong> of the <strong>Edit</strong> sub-menu from the\n<a href=\"#disp-comm\">Command\nwidget</a>. Alternatively, press\n<strong>F5</strong> in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in Paste mode. To exit immediately, press Dismiss.\nIn Paste mode, the Command widget has these options:\n<ul>\n<li><strong>Operators</strong>\n<ul>\n<li>over\n<li>in\n<li>out\n<li>atop\n<li>xor\n<li>plus\n<li>minus\n<li>add\n<li>subtract\n<li>difference\n<li>multiply\n<li>bumpmap\n<li>replace\n</ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nChoose a composite operation from the <strong>Operators</strong> sub-menu of the\n<a href=\"#disp-comm\">Command\nwidget</a>. How each operator behaves is described below. <em>image window</em>\nis the image currently displayed on your X server and <em>image</em> is the\nimage obtained with the File Browser widget.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    over\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the union of the two image shapes, with <em>image</em> obscuring\n<em>image\nwindow</em> in the region of overlap.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    in\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is simply <em>image</em> cut by the shape of\n<em>image window</em>.\nNone of the image data of image window is in the result.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    out\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe resulting image is <em>image</em> with the shape of\n<em>image window</em>\ncut out.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    atop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the same shape as <em>image window</em>, with\n<em>image</em>\nobscuring <em>image window</em> where the image shapes overlap. Note this\ndiffers from over because the portion of image outside\n<em>image window</em>'s\nshape does not appear in the result.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    xor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the image data from both <em>image</em> and\n<em>image window</em>\nthat is outside the overlap region. The overlap region is blank.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    plus\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is just the sum of the image data. Output values are cropped\nto the maximum value (no overflow). This operation is independent of the\nmatte channels.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    minus\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> - <em>image window</em>, with underflow cropped\nto zero. The matte channel is ignored (set to opaque, full coverage).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    add\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> + <em>image window</em>, with overflow wrapping\naround (mod MaxRGB+1).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    subtract\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> - <em>image window</em>, with underflow wrapping\naround (mod MaxRGB+1). The add and subtract operators can be used to perform\nreversible transformations.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    difference\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of abs(<em>image</em> - <em>image window</em>). This is useful for\ncomparing two very similar images.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    multiply\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> * <em>image window</em>. This is useful for\nthe creation of drop-shadows.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    bumpmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image window</em> shaded by <em>window</em>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    replace\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>The resulting image is <em>image window</em> replaced with\n<em>image</em>.\nHere the matte information is ignored.</td></tr></table>\n<p>\nThe image compositor requires a matte, or alpha channel in the image for\nsome operations. This extra channel usually defines a mask which represents\na sort of a cookie-cutter for the image. This is the case when matte is\n255 (full coverage) for pixels inside the shape, zero outside, and between\nzero and 255 on the boundary. If image does not have a matte channel, it\nis initialized with 0 for any pixel matching in color to pixel location\n(0,0), otherwise 255. See <a href=\"#disp-matt\">Matte Editing</a> for a method\nof defining a matte channel.\n<p>\nNote that matte information for image window is not retained for colormapped\nX server visuals (e.g. <em>StaticColor, StaticColor, GrayScale, PseudoColor</em>).\nCorrect compositing behavior may require a\n<em>TrueColor</em> or <em>DirectColor</em>\nvisual or a <em>Standard Colormap</em>.\n<p>\nChoosing a composite operator is optional. The default operator is replace.\nHowever, you must choose a location to composite your image and press button\n1. Press and hold the button before releasing and an outline of the image\nwill appear to help you identify your location.\n<p>\nThe actual colors of the pasted image is saved. However, the color that\nappears in image window may be different. For example, on a monochrome\nscreen image window will appear black or white even though your pasted\nimage may have many colors. If the image is saved to a file it is written\nwith the correct colors. To assure the correct colors are saved in the\nfinal image, any <em>PseudoClass</em> image is promoted to <em>DirectClass</em>.\nTo force a\n<em>PseudoClass</em> image to remain <em>PseudoClass</em>,\nuse <strong>-colors</strong>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imcr\"></a>Image Cropping\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo begin, press choose <strong>Crop</strong> of the <strong>Transform</strong> submenu from\nthe <a href=\"#disp-comm\">Command widget</a>. Alternatively,\n<a href=\"#disp-keyb\">press</a> C in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in crop mode. In crop mode, the Command widget has\nthese options:\n<ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nTo define a cropping region, press button 1 and drag. The cropping region\nis defined by a highlighted rectangle that expands or contracts as it follows\nthe pointer. Once you are satisfied with the cropping region, release the\nbutton. You are now in rectify mode. In rectify mode, the Command widget\nhas these options:\n<ul>\n<li><strong>Crop</strong>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nYou can make adjustments by moving the pointer to one of the cropping rectangle\ncorners, pressing a button, and dragging. Finally, press Crop to commit\nyour cropping region. To exit without cropping the image, press Dismiss.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imch\"></a>Image Chopping\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAn image is chopped interactively. There is no command line argument to\nchop an image. To begin, choose <strong>Chop</strong> of the <strong>Transform</strong> sub-menu\nfrom the <a href=\"#disp-comm\">Command widget</a>. Alternatively,\n<a href=\"#disp-keyb\">press</a> [ in the Image window.\n<p>\nYou are now in <strong>Chop</strong> mode. To exit immediately, press\n<strong>Dismiss</strong>.\nIn Chop mode, the Command widget has these options:\n<ul>\n<li><strong>Direction</strong>\n<ul>\n<li>horizontal\n<li>vertical\n</ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nIf the you choose the horizontal direction (this is the default), the area\nof the image between the two horizontal endpoints of the chop line is removed.\nOtherwise, the area of the image between the two vertical endpoints of\nthe chop line is removed.\n<p>\nSelect a location within the image window to begin your chop, press and\nhold any button. Next, move the pointer to another location in the image.\nAs you move a line will connect the initial location and the pointer. When\nyou release the button, the area within the image to chop is determined\nby which direction you choose from the Command widget.\n<p>\nTo cancel the image chopping, move the pointer back to the starting point\nof the line and release the button.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imro\"></a>Image Rotation\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nPress the / key to rotate the image 90 degrees or \\ to rotate -90 degrees.\nTo interactively choose the degree of rotation, choose\n<strong>Rotate...</strong>\nof the <strong>Transform</strong> submenu from the <a href=\"#disp-comm\">Command Widget</a>.\nAlternatively, <a href=\"#disp-keyb\">press</a> * in the image window.\n<p>\nA small horizontal line is drawn next to the pointer. You are now in rotate\nmode. To exit immediately, press Dismiss. In rotate mode, the Command widget\nhas these options:\n<ul>\n<li><strong>Pixel Color</strong>\n<ul>\n<li>black\n<li>blue\n<li>cyan\n<li>green\n<li>gray\n<li>red\n<li>magenta\n<li>yellow\n<li>white\n<li>Browser...\n</ul>\n<li><strong>Direction</strong>\n<ul>\n<li>horizontal\n<li>vertical\n</ul>\n<li><strong>Help</strong>\n<li><strong>Dismiss</strong>\n</ul>\n<p>\nChoose a background color from the Pixel Color sub-menu. Additional background\ncolors can be specified with the color browser. You can change the menu\ncolors by setting the <a href=\"#disp-xres\">X resources</a> pen1 through pen9.\n<p>\nIf you choose the color browser and press <strong>Grab</strong>, you can select the\nbackground color by moving the pointer to the desired color on the screen\nand press any button.\n<p>\nChoose a point in the image window and press this button and hold. Next,\nmove the pointer to another location in the image. As you move a line connects\nthe initial location and the pointer. When you release the button, the\ndegree of image rotation is determined by the slope of the line you just\ndrew. The slope is relative to the direction you choose from the Direction\nsub-menu of the Command widget.\n<p>\nTo cancel the image rotation, move the pointer back to the starting point\nof the line and release the button.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-iman\"></a>Image Annotation\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAn image is annotated interactively. There is no command line argument\nto annotate an image. To begin, choose\n<strong>Annotate</strong> of the <strong>Image\nEdit</strong> sub-menu from the <a href=\"#disp-comm\">Command widget</a>. Alternatively,\n<a href=\"#disp-keyb\">press</a> a in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in annotate mode. To exit immediately, press Dismiss.\nIn annotate mode, the Command widget has these options:\n<ul>\n<li>\n<strong>Font Name</strong>\n<ul>\n<li>\nfixed\n<li>\nvariable\n<li>\n5x8\n<li>\n6x10\n<li>\n7x13bold\n<li>\n8x13bold\n<li>\n9x15bold\n<li>\n10x20\n<li>\n12x24\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Font Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\ntransparent\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Box Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\ntransparent\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Rotate Text</strong>\n<ul>\n<li>\n-90\n<li>\n-45\n<li>\n-30\n<li>\n0\n<li>\n30\n<li>\n45\n<li>\n90\n<li>\n180\n<li>\nDialog...\n</ul>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nChoose a font name from the <strong>Font Name</strong> sub-menu. Additional font\nnames can be specified with the font browser. You can change the menu names\nby setting the <a href=\"#disp-xres\">X resources</a> font1 through font9.\n<p>\nChoose a font color from the <strong>Font Color</strong> sub-menu. Additional font\ncolors can be specified with the color browser. You can change the menu\ncolors by setting the <a href=\"#disp-xres\">X resources</a> pen1 through pen9.\n<p>\nIf you select the color browser and press <strong>Grab</strong>, you can choose the\nfont color by moving the pointer to the desired color on the screen and\npress any button.\n<p>\nIf you choose to rotate the text, choose <strong>Rotate Text</strong> from the menu\nand select an angle. Typically you will only want to rotate one line of\ntext at a time. Depending on the angle you choose, subsequent lines may\nend up overwriting each other.\n<p>\nChoosing a font and its color is optional. The default font is fixed and\nthe default color is black. However, you must choose a location to begin\nentering text and press a button. An underscore character will appear at\nthe location of the pointer. The cursor changes to a pencil to indicate\nyou are in text mode. To exit immediately, press Dismiss.\n<p>\nIn text mode, any key presses will display the character at the location\nof the underscore and advance the underscore cursor. Enter your text and\nonce completed press Apply to finish your image annotation. To correct\nerrors press <strong>BACK SPACE</strong>. To delete an entire line of text, press\n<strong>DELETE</strong>.\nAny text that exceeds the boundaries of the image window is automatically\ncontinued onto the next line.\n<p>\nThe actual color you request for the font is saved in the image. However,\nthe color that appears in your Image window may be different. For example,\non a monochrome screen the text will appear black or white even if you\nchoose the color red as the font color. However, the image saved to a file\nwith <strong>-write</strong> is written with red lettering. To assure the correct\ncolor text in the final image, any <em>PseudoClass</em> image is promoted\nto <em>DirectClass</em> (see miff(5)). To force a <em>PseudoClass</em> image\nto remain\n<em>PseudoClass</em>, use <strong>-colors</strong>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imcomp\"></a>Image Compositing\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAn image composite is created interactively. <strong>There is no command line\nargument to composite an image</strong>. To begin, choose <strong>Composite</strong> of\nthe <strong>Image Edit</strong> from the <a href=\"#disp-comm\">Command widget</a>. Alternatively,\n<a href=\"#disp-keyb\">press</a> x in the Image window.\n<p>\nFirst a popup window is displayed requesting you to enter an image name.\nPress <strong>Composite</strong>, <strong>Grab</strong> or type a file name. Press <strong>Cancel</strong>\nif you choose not to create a composite image. When you choose <strong>Grab</strong>,\nmove the pointer to the desired window and press any button.\n<p>\nIf the <strong>Composite</strong> image does not have any matte information, you\nare informed and the file browser is displayed again. Enter the name of\na mask image. The image is typically grayscale and the same size as the\ncomposite image. If the image is not grayscale, it is converted to grayscale\nand the resulting intensities are used as matte information.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in composite mode. To exit immediately, press Dismiss.\nIn composite mode, the Command widget has these options:\n<ul>\n<li>\n<strong>Operators</strong>\n<ul>\n<li>\nover\n<li>\nin\n<li>\nout\n<li>\natop\n<li>\nxor\n<li>\nplus\n<li>\nminus\n<li>\nadd\n<li>\nsubtract\n<li>\ndifference\n<li>\nbumpmap\n<li>\nreplace\n</ul>\n<li>\n<strong>Blend</strong>\n<li>\n<strong>Displace</strong>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nChoose a composite operation from the Operators sub-menu of the Command\nwidget. How each operator behaves is described below. image window is the\nimage currently displayed on your X server and image is the image obtained\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    over\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the union of the two image shapes, with <em>image</em> obscuring\n<em>image\nwindow</em> in the region of overlap.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    in\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is simply <em>image</em> cut by the shape of\n<em>image window</em>.\nNone of the image data of image window is in the result.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    out\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe resulting image is <em>image</em> with the shape of\n<em>image window</em>\ncut out.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    atop\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the same shape as <em>image window</em>, with\n<em>image</em>\nobscuring <em>image window</em> where the image shapes overlap. Note this\ndiffers from over because the portion of image outside\n<em>image window</em>'s\nshape does not appear in the result.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    xor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is the image data from both <em>image</em> and\n<em>image window</em>\nthat is outside the overlap region. The overlap region is blank.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    plus\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result is just the sum of the image data. Output values are cropped\nto 255 (no overflow). This operation is independent of the matte channels.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    minus\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> - <em>image window</em>, with underflow cropped\nto zero. The matte channel is ignored (set to 255, full coverage).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    add\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> + <em>image window</em>, with overflow wrapping\naround (mod 256).</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    subtract\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image</em> - <em>image window</em>, with underflow wrapping\naround (mod 256). The add and subtract operators can be used to perform\nreversible transformations.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    difference\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of abs(<em>image</em> - <em>image window</em>). This is useful for\ncomparing two very similar images.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    bumpmap\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe result of <em>image window</em> shaded by <em>window</em>.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    replace\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>\nThe resulting image is <em>image window</em> replaced with\n<em>image</em>.\nHere the matte information is ignored.</td></tr></table>\n<p>\nThe image compositor requires a matte, or alpha channel in the image for\nsome operations. This extra channel usually defines a mask which represents\na sort of a cookie-cutter for the image. This is the case when matte is\n255 (full coverage) for pixels inside the shape, zero outside, and between\nzero and 255 on the boundary. If image does not have a matte channel, it\nis initialized with 0 for any pixel matching in color to pixel location\n(0,0), otherwise 255. See <a href=\"#disp-matt\">Matte Editing</a> for a method\nof defining a matte channel.\n<p>\nIf you choose <strong>blend</strong>, the composite operator becomes <strong>over</strong>.\nThe image matte channel percent transparency is initialized to factor.\nThe image window is initialized to (100-factor). Where factor is the value\nyou specify in the Dialog widget.\n<p>\n<strong>Displace</strong> shifts the image pixels as defined by a displacement map.\nWith this option, <em>image</em> is used as a displacement map. Black, within\nthe displacement map, is a maximum positive displacement. White is a maximum\nnegative displacement and middle gray is neutral. The displacement is scaled\nto determine the pixel shift. By default, the displacement applies in both\nthe horizontal and vertical directions. However, if you specify\n<em>mask</em>,\n<em>image</em>\nis the horizontal X displacement and\n<em>mask</em> the vertical Y displacement.\n<p>\nNote that matte information for image window is not retained for colormapped\nX server visuals (e.g.\n<em>StaticColor, StaticColor, GrayScale, PseudoColor</em>).\nCorrect compositing behavior may require a <em>TrueColor</em> or\n<em>DirectColor</em>\nvisual or a <em>Standard Colormap</em>.\n<p>\nChoosing a composite operator is optional. The default operator is replace.\nHowever, you must choose a location to composite your image and press button\n1. Press and hold the button before releasing and an outline of the image\nwill appear to help you identify your location.\n<p>\nThe actual colors of the composite image is saved. However, the color that\nappears in image window may be different. For example, on a monochrome\nscreen Image window will appear black or white even though your composited\nimage may have many colors. If the image is saved to a file it is written\nwith the correct colors. To assure the correct colors are saved in the\nfinal image, any PseudoClass image is promoted to <em>DirectClass</em> (see\n<a href=\"miff.html\">miff</a>).\nTo force a <em>PseudoClass</em> image to remain <em>PseudoClass</em>,\nuse <strong>-colors</strong>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-cole\"></a>Color Editing\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nChanging the the color of a set of pixels is performed interactively. There\nis no command line argument to edit a pixel. To begin, choose <strong>Color</strong>\nfrom the <strong>Image Edit</strong> submenu of the <a href=\"#disp-comm\">Command widget</a>.\nAlternatively, <a href=\"#disp-keyb\">press</a> c in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in color edit mode. To exit immediately, press <strong>Dismiss</strong>.\nIn color edit mode, the\n<strong>Command widget</strong> has these options:\n<ul>\n<li>\n<strong>Method</strong>\n<ul>\n<li>\npoint\n<li>\nreplace\n<li>\nfloodfill\n<li>\nreset\n</ul>\n<li>\n<strong>Pixel Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Border Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Fuzz</strong>\n<ul>\n<li>\n0\n<li>\n2\n<li>\n4\n<li>\n8\n<li>\n16\n<li>Dialog...\n</ul>\n<li>\n<strong>Undo</strong>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nChoose a color editing method from the <strong>Method</strong> sub-menu of\nthe <a href=\"#disp-comm\">Command\nwidget</a>. The <strong>point method</strong> recolors any pixel selected with the\npointer unless the button is released. The <strong>replace method</strong> recolors\nany pixel that matches the color of the pixel you select with a button\npress. <strong>Floodfill</strong> recolors any pixel that matches the color of the\npixel you select with a button press and is a neighbor.\nWhereas <strong>filltoborder</strong>\nchanges the matte value of any neighbor pixel that is not the border color.\nFinally <strong>reset</strong> changes the entire image to the designated color.\n<p>\nNext, choose a pixel color from the <strong>Pixel Color</strong> sub-menu. Additional\npixel colors can be specified with the color browser. You can change the\nmenu colors by setting the <a href=\"#disp-xres\">X resources</a> pen1 through\npen9.\n<p>\nNow press button 1 to select a pixel within the Image window to change\nits color. Additional pixels may be recolored as prescribed by the method\nyou choose. additional pixels by increasing the Delta value.\n<p>\nIf the <strong>Magnify widget</strong> is mapped, it can be helpful in positioning\nyour pointer within the image (refer to button 2). Alternatively you can\nselect a pixel to recolor from within the <strong>Magnify widget</strong>. Move the\npointer to the <strong>Magnify widget</strong> and position the pixel with the cursor\ncontrol keys. Finally, press a button to recolor the selected pixel (or\npixels).\n<p>\nThe actual color you request for the pixels is saved in the image. However,\nthe color that appears in your Image window may be different. For example,\non a monochrome screen the pixel will appear black or white even if you\nchoose the color red as the pixel color. However, the image saved to a\nfile with -write is written with red pixels. To assure the correct color\ntext in the final image, any <em>PseudoClass</em> image is promoted\nto <em>DirectClass</em>\nTo force a <em>PseudoClass</em> image to remain\n<em>PseudoClass</em>, use <strong>-colors</strong>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-matt\"></a>Matte Editing\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nMatte information within an image is useful for some operations such as\nimage <a href=\"#disp-imcomp\">compositing</a>. This extra channel usually defines\na mask which represents a sort of a cookie-cutter for the image. This is\nthe case when matte is 255 (full coverage) for pixels inside the shape,\nzero outside, and between zero and 255 on the boundary.\n<p>\nSetting the matte information in an image is done interactively. There\nis no command line argument to edit a pixel. To begin, and choose <strong>Matte</strong>\nof the <strong>Image Edit</strong> sub-menu from the <a href=\"#disp-comm\">Command widget</a>.\n<p>\nAlternatively, <a href=\"#disp-keyb\">press</a> m in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in matte edit mode. To exit immediately, press Dismiss.\nIn matte edit mode, the Command widget has these options:\n<ul>\n<li>\n<strong>Method</strong>\n<ul>\n<li>\npoint\n<li>\nreplace\n<li>\nfloodfill\n<li>\nreset\n</ul>\n<li>\n<strong>Border Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Fuzz</strong>\n<ul>\n<li>\n0\n<li>\n2\n<li>\n4\n<li>\n8\n<li>\n16\n<li>Dialog...\n</ul>\n<li>\n<strong>Matte</strong>\n<li>\n<strong>Undo</strong>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\nChoose a matte editing method from the <strong>Method</strong> sub-menu of the <a href=\"#disp-comm\">Command\nwidget</a>. The <strong>point method</strong> changes the matte value of the any\npixel selected with the pointer until the button is released. The <strong>replace\nmethod</strong> changes the matte value of any pixel that matches the color\nof the pixel you select with a button press. <strong>Floodfill</strong> changes the\nmatte value of any pixel that matches the color of the pixel you select\nwith a button press and is a neighbor. Whereas\n<strong>filltoborder</strong> recolors\nany neighbor pixel that is not the border color. Finally <strong>reset</strong> changes\nthe entire image to the designated matte value.\n<p>Choose <strong>Matte Value</strong> and a dialog appears requesting a matte value.\nEnter a value between <strong>0 and 255</strong>. This value is assigned as the matte\nvalue of the selected pixel or pixels.\n<p>Now, press any button to select a pixel within the Image window to change\nits matte value. You can change the matte value of additional pixels by\nincreasing the Delta value. The Delta value is first added then subtracted\nfrom the red, green, and blue of the target color. Any pixels within the\nrange also have their matte value updated.\n<p>If the <strong>Magnify widget</strong> is mapped, it can be helpful in positioning\nyour pointer within the image (refer to button 2). Alternatively you can\nselect a pixel to change the matte value from within the\n<strong>Magnify widget</strong>.\nMove the pointer to the <strong>Magnify widget</strong> and position the pixel with\nthe cursor control keys. Finally, press a button to change the matte value\nof the selected pixel (or pixels).\n<p>Matte information is only valid in a <em>DirectClass image</em>. Therefore,\nany <em>PseudoClass</em> image is promoted to\n<em>DirectClass</em>. Note that\nmatte information for <em>PseudoClass</em> is not retained for colormapped\nX server visuals (e.g. <em>StaticColor, StaticColor, GrayScale, PseudoColor</em>)\nunless you immediately save your image to a file (refer to Write). Correct\nmatte editing behavior may require a <em>TrueColor</em> or <em>DirectColor</em>\nvisual or a <em>Standard Colormap</em>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-imdr\"></a>Image Drawing\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAn image is drawn upon interactively. <strong>There is no command line argument\nto draw on an image</strong>. To begin, choose <strong>Draw</strong> of the Image <strong>Edit</strong>\nsub-menu from the <a href=\"#disp-comm\">Command widget</a>.\nAlternatively, <a href=\"#disp-keyb\">press</a> d in the image window.\n<p>\nThe cursor changes to a crosshair to indicate you are in draw mode. To\nexit immediately, press Dismiss. In draw mode, the Command widget has these\noptions:\n<ul>\n<li>\n<strong>Primitive</strong>\n<ul>\n<li>\npoint\n<li>\nline\n<li>\nrectangle\n<li>\nfill rectangle\n<li>\ncircle\n<li>\nfill circle\n<li>\nellipse\n<li>\nfill ellipse\n<li>\npolygon\n<li>\nfill polygon\n</ul>\n<li>\n<strong>Color</strong>\n<ul>\n<li>\nblack\n<li>\nblue\n<li>\ncyan\n<li>\ngreen\n<li>\ngray\n<li>\nred\n<li>\nmagenta\n<li>\nyellow\n<li>\nwhite\n<li>\ntransparent\n<li>\nBrowser...\n</ul>\n<li>\n<strong>Stipple</strong>\n<ul>\n<li>\nBrick\n<li>\nDiagonal\n<li>\nScales\n<li>\nVertical\n<li>\nWavy\n<li>\nTranslucent\n<li>\nOpaque\n<li>\nOpen...\n</ul>\n<li>\n<strong>Width</strong>\n<ul>\n<li>\n1\n<li>\n2\n<li>\n4\n<li>\n8\n<li>\n16\n<li>Dialog...\n</ul>\n<li>\n<strong>Undo</strong>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\nChoose a drawing primitive from the <strong>Primitive</strong> sub-menu.\n<p>\nNext, choose a color from the <strong>Color</strong> sub-menu. Additional colors\ncan be specified with the color browser. You can change the menu colors\nby setting the <a href=\"#disp-xres\">X resources</a> pen1 through pen9. The transparent\ncolor updates the image matte channel and is useful for image compositing.\n<p>\nIf you choose the color browser and press <strong>Grab</strong>, you can select the\nprimitive color by moving the pointer to the desired color on the screen\nand press any button. The transparent color updates the image matte channel\nand is useful for image compositing.\n<p>\nChoose a stipple, if appropriate, from the <strong>Stipple</strong> sub-menu. Additional\nstipples can be specified with the file browser. Stipples obtained from\nthe file browser must be on disk in the X11 bitmap format.\n<p>\nChoose a line width, if appropriate, from the <strong>Width</strong> sub-menu. To\nchoose a specific width select the <strong>Dialog</strong> widget.\n<p>\nChoose a point in the image window and press button 1 and hold. Next, move\nthe pointer to another location in the image. As you move, a line connects\nthe initial location and the pointer. When you release the button, the\nimage is updated with the primitive you just drew. For polygons, the image\nis updated when you press and release the button without moving the pointer.\n<p>\nTo cancel image drawing, move the pointer back to the starting point of\nthe line and release the button.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-regi\"></a>Region of Interest\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo begin, press choose Region of Interest of the Pixel Transform sub-menu\nfrom the <a href=\"#disp-comm\">Command widget</a>.\nAlternatively, <a href=\"#disp-keyb\">press</a> R in the image window.\n<p>\nA small window appears showing the location of the cursor in the image\nwindow. You are now in region of interest mode. In region of interest mode,\nthe Command widget has these options:\n<ul>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nTo define a region of interest, press button 1 and drag. The region of\ninterest is defined by a highlighted rectangle that expands or contracts\nas it follows the pointer. Once you are satisfied with the region of interest,\nrelease the button. You are now in apply mode. In apply mode the Command\nwidget has these options:\n<ul>\n<li>\n<strong>File</strong>\n<ul>\n<li>\nSave...\n<li>\nPrint...\n</ul>\n<li>\n<strong>Edit</strong>\n<ul>\n<li>\nUndo\n<li>\nRedo\n</ul>\n<li>\n<strong>Transform</strong>\n<ul>\n<li>\nFlip\n<li>\nFlop\n<li>\nRotate Right\n<li>\nRotate Left\n</ul>\n<li>\n<strong>Enhance</strong>\n<ul>\n<li>\nHue...\n<li>\nSaturation...\n<li>\nBrightness...\n<li>\nGamma...\n<li>\nSpiff\n<li>\nDull\n<li>\nEqualize\n<li>\nNormalize\n<li>\nNegate\n<li>\nGRAYscale\n<li>\nQuantize...\n</ul>\n<li>\n<strong>Effects</strong>\n<ul>\n<li>\nDespeckle\n<li>\nEmboss\n<li>\nReduce Noise\n<li>\nAdd Noise\n<li>\nSharpen...\n<li>\nBlur...\n<li>\nThreshold...\n<li>\nEdge Detect...\n<li>\nSpread...\n<li>\nShade...\n<li>\nRaise...\n<li>\nSegment...\n</ul>\n</ul>\n<ul>\n<li>\n<strong>F/X</strong>\n<ul>\n<li>\nSolarize...\n<li>\nSwirl...\n<li>\nImplode...\n<li>\nWave...\n<li>\nOil Paint\n<li>\nCharcoal Draw...\n</ul>\n</ul>\n<ul>\n<li>\n<strong>Miscellany</strong>\n<ul>\n<li>\nImage Info\n<li>\nZoom Image\n<li>\nShow Preview...\n<li>\nShow Histogram\n<li>\nShow Matte\n</ul>\n<li>\n<strong>Help</strong>\n<li>\n<strong>Dismiss</strong>\n</ul>\n<p>\nYou can make adjustments to the region of interest by moving the pointer\nto one of the rectangle corners, pressing a button, and dragging. Finally,\nchoose an image processing technique from the Command widget. You can choose\nmore than one image processing technique to apply to an area. Alternatively,\nyou can move the region of interest before applying another image processing\ntechnique. To exit, press Dismiss.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-impa\"></a>Image Panning\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nWhen an image exceeds the width or height of the X server screen, display\nmaps a small panning icon. The rectangle within the panning icon shows\nthe area that is currently displayed in the the image window. To pan about\nthe image, press any button and drag the pointer within the panning icon.\nThe pan rectangle moves with the pointer and the image window is updated\nto reflect the location of the rectangle within the panning icon. When\nyou have selected the area of the image you wish to view, release the button.\n<p>\nUse the arrow keys to pan the image one pixel up, down, left, or right\nwithin the image window.\n<p>\nThe panning icon is withdrawn if the image becomes smaller than the dimensions\nof the X server screen.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"disp-pref\"></a>User Preferences\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nPreferences affect the default behavior of <strong>display(1)</strong>. The preferences\nare either true or false and are stored in your home directory\nas <tt>.displayrc</tt>:\n<dl>\n<dt>\n<strong>display image centered on a backdrop</strong></dt>\n<dd>\nThis backdrop covers the entire workstation screen and is useful for hiding\nother X window activity while viewing the image. The color of the backdrop\nis specified as the background color. Refer to <a href=\"#disp-xres\">X Resources</a>\nfor details.</dd>\n<dt>\n<strong>confirm on program exit</strong></dt>\n<dd>\nAsk for a confirmation before exiting the <strong>display(1)</strong> program.</dd>\n<dt>\n<strong>correct image for display gamma</strong></dt>\n<dd>\nIf the image has a known gamma, the gamma is corrected to match that of\nthe X server (see the <a href=\"#disp-xres\">X Resource</a><strong> displayGamma</strong>).</dd>\n<dt>\n<strong>display warning messages</strong></dt>\n<dd>\nDisplay any warning messages.</dd>\n<dt>\n<strong>apply Floyd/Steinberg error diffusion to image</strong></dt>\n<dd>\nThe basic strategy of dithering is to trade intensity resolution for spatial\nresolution by averaging the intensities of several neighboring pixels.\nImages which suffer from severe contouring when reducing colors can be\nimproved with this preference.</dd>\n<dt>\n<strong>use a shared colormap for colormapped X visuals</strong></dt>\n<dd>\nThis option only applies when the default X server visual is\n<em>PseudoColor</em>\nor <em>GRAYScale</em>. Refer to <strong>-visual</strong> for more details. By default,\na shared colormap is allocated. The image shares colors with other X clients.\nSome image colors could be approximated, therefore your image may look\nvery different than intended. Otherwise the image colors appear exactly\nas they are defined. However, other clients may go technicolor when the\nimage colormap is installed.</dd>\n<dt>\n<strong>display images as an X server pixmap</strong></dt>\n<dd>\nImages are maintained as a XImage by default. Set this resource to True\nto utilize a server Pixmap instead. This option is useful if your image\nexceeds the dimensions of your server screen and you intend to pan the\nimage. Panning is much faster with Pixmaps than with a XImage. Pixmaps\nare considered a precious resource, use them with discretion.</dd>\n</dl>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"gm identify\"></a>gm identify\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Identify</strong> describes the format and characteristics of one or\nmore image files as internally supported by the software. It will also\nreport if an image is incomplete or corrupt.  The information\ndisplayed includes the scene number, the file name, the width and\nheight of the image, whether the image is colormapped or not, the\nnumber of colors in the image, the number of bytes in the image, the\nformat of the image (JPEG, PNM, etc.), and finally the number of\nseconds in both user time and elapsed time it took to read and process\nthe image.  If -verbose or +ping are provided as an option, the pixel\nread rate is also displayed. An example line output from\n<strong>identify</strong> follows:\n<pre>\n    images/aquarium.miff 640x480 PseudoClass 256c\n           308135b MIFF 0.000u 0:01\n</pre>\n<p>\nIf <tt>-verbose</tt> is set, expect additional output including any image\ncomment:\n<br>&nbsp;<br>\n<pre>\n    Image: images/aquarium.miff\n    class: PseudoClass\n    colors: 256\n    signature: eb5dca81dd93ae7e6ffae99a527eb5dca8...\n    matte: False\n    geometry: 640x480\n       depth: 8\n    bytes: 308135\n    format: MIFF\n    comments:\n    Imported from MTV raster image: aquarium.mtv\n</pre>\n<p>\nFor some formats, additional format-specific information about the file\nwill be written if the <tt>-debug coder</tt> or <tt>-debug all</tt> option\nis used.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"ident-opti\"></a>Identify options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images immediately\nfollowing, until the set is terminated by the appearance of any option\nor <strong>-noop</strong>.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-format\">-format</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output formatted image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -ping\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>efficiently determine image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"import\"></a>gm import\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Import</strong> reads an image from any visible window on an X server and\noutputs it as an image file. You can capture a single window, the entire\nscreen, or any rectangular portion of the screen.\nUse <em><a href=\"display.html\">display</a></em>\nfor redisplay, printing, editing, formatting, archiving, image processing,\netc. of the captured image.\n<p>\nThe target window can be specified by id, name, or may be selected\nby clicking the mouse in the desired window. If you press a button and\nthen drag, a rectangle will form which expands and contracts as the mouse\nmoves. To save the portion of the screen defined by the rectangle, just\nrelease the button. The keyboard bell is rung once at the beginning of\nthe screen capture and twice when it completes.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"imp-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo select an X window or an area of the screen with the mouse and save it\nin the MIFF image format to a file entitled window.miff, use:\n<pre>\n    gm import window.miff\n</pre>\n<p>\nTo select an X window or an area of the screen with the mouse and save it\nin the Encapsulated PostScript format to include in another document, use:\n<pre>\n    gm import figure.eps\n</pre>\n<p>\nTo capture the entire X server screen in the JPEG image format in a file\nentitled root.jpeg, without using the mouse, use:\n<pre>\n    gm import -window root root.jpeg\n</pre>\n<p>\nTo capture the 512x256 area at the upper right corner of the X server\nscreen in the PNG image format in a well-compressed file entitled corner.png,\nwithout using the mouse,  use:\n<pre>\n    gm import -window root -crop 512x256-0+0 -quality 90\n           corner.png\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"imp-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect until it is explicitly changed by specifying\nthe option again with a different effect.\n<p>\n<strong>Import</strong> options can appear on the command line or in your\nX resources file. See <em>X(1)</em>. Options on the command line supersede\nvalues specified in your X resources file.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -descend\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>obtain image by descending window hierarchy</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -frame\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>include the X window frame in the imported image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pause\">-pause</a> <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pause between snapshots [import]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -ping\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>efficiently determine image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scene\">-scene</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-screen\">-screen</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the screen to capture</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -silent\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>operate silently</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-snaps\">-snaps</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>number of screen snapshots</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transparent\">-transparent</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n</td></tr></table>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mogrify\"></a>gm mogrify\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Mogrify</strong> transforms an image or a sequence of images. These transforms\ninclude image scaling, image rotation, color reduction, and others. Each\ntransmogrified image overwrites the corresponding original image, unless an\noption such as\n<strong>-format</strong> causes the output filename to be different from the input\nfilename.\n<br>&nbsp;<br>\nThe graphics formats supported by <strong>mogrify</strong> are listed in\n<em>GraphicsMagick(1)</em>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mog-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo convert all the TIFF files in a particular directory to JPEG, use:\n<pre>\n    gm mogrify -format jpeg *.tiff\n</pre>\n<p>\nTo convert a directory full of JPEG images to thumbnails, use:\n<pre>\n    gm mogrify -size 120x120 *.jpg -resize 120x120 +profile \"*\"\n</pre>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn this example, <tt>'-size 120x120'</tt> gives a hint to the JPEG decoder\nthat the images are going to be downscaled to 120x120, allowing it to run\nfaster by avoiding returning full-resolution images to GraphicsMagick for\nthe subsequent resizing operation.  The\n<tt>'-resize 120x120'</tt> specifies the desired dimensions of the\noutput images.  It will be scaled so its largest dimension is 120 pixels.  The\n<tt>'+profile \"*\"'</tt> removes any ICM, EXIF, IPTC, or other profiles\nthat might be present in the input and aren't needed in the thumbnails.</font></td></tr></table>\n<p>\nTo scale an image of a cockatoo to exactly 640 pixels in width and 480\npixels in height, use: \n<pre>\n    gm mogrify -resize 640x480! cockatoo.miff\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mog-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images that follows,\nuntil the set is terminated by the appearance of any option or <strong>-noop</strong>.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-affine\">-affine</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>drawing transform matrix</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-antialias\">-antialias</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixel aliasing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details\"></a> <i>-asc-cdl &lt;spec&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply ASC CDL color transform</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-auto-orient\">-auto-orient</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>orient (rotate) image so it is upright</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-black-threshold\">-black-threshold</a> <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels below the threshold become black</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blue-primary\">-blue-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blur\">-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-border\">-border</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with a border of color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-channel\">-channel</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of channel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -charcoal <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate a charcoal drawing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorize\">-colorize</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colorize the image with the pen color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compose\">-compose</a> <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-contrast\">-contrast</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enhance or reduce the image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-convolve\">-convolve</a> <i>&lt;kernel&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>convolve image with the specified convolution kernel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-create-directories\">-create-directories</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create output directory if required</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-cycle\">-cycle</a> <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image colormap by amount</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -despeckle\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>reduce the speckles within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-draw\">-draw</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with one or more graphic primitives</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -edge <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>detect edges within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -emboss <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>emboss an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -enhance\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a digital filter to enhance a noisy image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -equalize\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform histogram equalization to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-extent\">-extent</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite image on background color canvas image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fill\">-fill</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flip\">-flip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flop\">-flop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-format\">-format</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image format type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-frame\">-frame</a> <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fuzz\">-fuzz</a> <i>&lt;distance&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colors within this Euclidean distance are considered equal</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gaussian\">-gaussian</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gravity\">-gravity</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-green-primary\">-green-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -hald-clut <i>&lt;clut&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a Hald CLUT to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -implode <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>implode image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-lat\">-lat</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;offset&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform local adaptive thresholding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-level\">-level</a> <i>&lt;black_point&gt;</i>{<i>,&lt;gamma&gt;</i>}<i></i>{<i>,&lt;white_point&gt;</i>}<i></i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>adjust the level of image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -linewidth\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the line width for subsequent draw operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-list\">-list</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of list</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-loop\">-loop</a> <i>&lt;iterations&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add Netscape loop extension to your GIF animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-map\">-map</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>choose a particular set of colors from this image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mask\">-mask</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify a clipping mask</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -median <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a median filter to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -minify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>minify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-modulate\">-modulate</a> <i>brightness[,saturation[,hue]]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>vary the brightness, saturation, and hue of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-motion-blur\">-motion-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+angle</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Simulate motion blur</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noise\">-noise</a> <i>&lt;radius|type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add or reduce noise in an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-normalize\">-normalize</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform image to span the full range of color values</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-opaque\">-opaque</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>change this color to the pen color within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-operator\">-operator</a> <i>channel operator rvalue[%]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a mathematical, bitwise, or value operator to an image channel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-ordered-dither\">-ordered-dither</a> <i>&lt;channeltype&gt; &lt;NxN&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>ordered dither the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-output-directory\">-output-directory</a> <i>&lt;directory&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output files to directory</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-orient\">-orient</a> <i>&lt;orientation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Set the image orientation attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-paint\">-paint</a> <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate an oil painting</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pen\">-pen</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>(This option has been replaced by the -fill option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-profile\">-profile</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add ICM, IPTC, or generic profile  to image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-preserve-timestamp\">-preserve-timestamp</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preserve the original timestamps of the file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-raise\">-raise</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>lighten or darken image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-random-threshold\">-random-threshold</a> <i>&lt;channeltype&gt; &lt;LOWxHIGH&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>random threshold the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-recolor\">-recolor</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a color translation matrix to image channels</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-red-primary\">-red-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-region\">-region</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply options to a portion of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-render\">-render</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-repage\">-repage</a> <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resample\">-resample</a> <i>&lt;horizontal&gt;x&lt;vertical&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Resample image to specified horizontal and vertical resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-roll\">-roll</a> <i></i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>roll an image vertically or horizontally</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sample\">-sample</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale image using pixel sampling</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scale\">-scale</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scene\">-scene</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-segment\">-segment</a> <i>&lt;cluster threshold&gt;x&lt;smoothing threshold&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>segment an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shade\">-shade</a> <i>&lt;azimuth&gt;x&lt;elevation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shade the image using a distant light source</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shave\">-shave</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shave pixels from the image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shear\">-shear</a> <i>&lt;x degrees&gt;x&lt;y degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shear the image along the X or Y axis</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-solarize\">-solarize</a> <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>negate all pixels above the threshold level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-spread\">-spread</a> <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image pixels by a random amount</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strip\">-strip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stroke\">-stroke</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when stroking a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strokewidth\">-strokewidth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the stroke width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-swirl\">-swirl</a> <i>&lt;degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>swirl image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-threshold\">-threshold</a> <i>&lt;value&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>threshold the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tile image when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transform\">-transform</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transparent\">-transparent</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-units\">-units</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the units of image resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-unsharp\">-unsharp</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+&lt;amount&gt;</i>}<i></i>{<i>+&lt;threshold&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image with an unsharp mask operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -view <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>FlashPix viewing parameters</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-virtual-pixel\">-virtual-pixel</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify contents of \"virtual pixels\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-wave\">-wave</a> <i>&lt;amplitude&gt;x&lt;wavelength&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>alter an image along a sine wave</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-point\">-white-point</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-threshold\">-white-threshold</a> <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels above the threshold become white</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"montage\"></a>gm montage\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>montage</strong> creates a composite image by combining several separate\nimages. The images are tiled on the composite image with the name of the\nimage optionally appearing just below the individual tile.\n<p>\nThe composite image is constructed in the following manner. First, each\nimage specified on the command line, except for the last, is scaled to\nfit the maximum tile size. The maximum tile size by default is 120x120.\nIt can be modified with the <strong>-geometry</strong> command line argument or X\nresource. See\n<strong>Options</strong>\nfor more information on command line arguments. See\n<strong>X(1)</strong> for more information on X resources.\nNote that the maximum tile size need not be a square.\n<p>\nNext the composite image is initialized with the color specified by the\n<strong>-background</strong>\ncommand line argument or X resource. The width and height of the composite\nimage is determined by the title specified, the maximum tile size, the\nnumber of tiles per row, the tile border width and height, the image border\nwidth, and the label height. The number of tiles per row specifies how\nmany images are to appear in each row of the composite image. The default\nis to have 5 tiles in each row and 4 tiles in each column of the composite.\nA specific value is specified with <strong>-tile</strong>. The tile border width\nand height, and the image border width defaults to the value of the X resource\n<strong>-borderwidth</strong>. It can be changed with the <strong>-borderwidth</strong> or\n<strong>-geometry</strong> command line argument or X resource. The label height\nis determined by the font you specify with the <strong>-font</strong> command line\nargument or X resource. If you do not specify a font, a font is chosen\nthat allows the name of the image to fit the maximum width of a tiled area.\nThe label colors is determined by the <strong>-background</strong> and <strong>-fill</strong>\ncommand line argument or X resource. Note, that if the background and pen\ncolors are the same, labels will not appear.\n<p>\nInitially, the composite image title is placed at the top if one is specified\n(refer to <strong>-fill</strong>). Next, each image is set onto the composite image,\nsurrounded by its border color, with its name centered just below it. The\nindividual images are left-justified within the width of the tiled area.\nThe order of the images is the same as they appear on the command line\nunless the images have a scene keyword. If a scene number is specified\nin each image, then the images are tiled onto the composite in the order\nof their scene number. Finally, the last argument on the command line is\nthe name assigned to the composite image. By default, the image is written\nin the <strong>MIFF</strong> format and can be viewed or printed with\n<em>display(1)</em>.\n<br>&nbsp;<br>\n<p>\nNote, that if the number of tiles exceeds the default number of 20 (5 per\nrow, 4 per column), more than one composite image is created. To ensure\na single image is produced, use <strong>-tile</strong> to increase the number of\ntiles to meet or exceed the number of input images.\n<p>\nFinally, to create one or more empty spaces in the sequence of tiles, use\nthe <strong>\"NULL:\"</strong> image format.\n<p>\nNote, a composite MIFF image displayed to an X server with\n<strong>display</strong>\nbehaves differently than other images. You can think of the composite as\na visual image directory. Choose a particular tile of the composite and\npress a button to display it. See <strong>display(1)</strong> and <strong>miff(5)</strong>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo create a montage of a cockatoo, a parrot, and a hummingbird and write\nit to a file called birds, use:\n<pre>\n    gm montage cockatoo.miff parrot.miff hummingbird.miff\n            birds.miff\n</pre>\n<p>\nTo tile several bird images so that they are at most 256 pixels in width\nand 192 pixels in height, surrounded by a red border, and separated by\n10 pixels of background color, use:\n<pre>\n    gm montage -geometry 256x192+10+10 -bordercolor red\n            birds.* montage.miff\n</pre>\n<p>\nTo create an unlabeled parrot image, 640 by 480 pixels, and surrounded\nby a border of black, use:\n<pre>\n    gm montage -geometry 640x480 -bordercolor black\n            -label \"\" parrot.miff bird.miff\n</pre>\n<p>\nTo create an image of an eagle with a textured background, use:\n<pre>\n    gm montage -texture bumps.jpg eagle.jpg eagle.png\n</pre>\n<p>\nTo join several GIF images together without any extraneous graphics (e.g.\nno label, no shadowing, no surrounding tile frame), use:\n<pre>\n    gm montage +frame +shadow +label -tile 5x1\n            -geometry 50x50+0+0 *.png joined.png\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAny option you specify on the command line remains in effect for the group\nof images following it, until the group is terminated by the appearance of\nany option or <strong>-noop</strong>.  For example, to make a montage of three images,\nthe first with 32 colors, the second with an unlimited number of colors, and\nthe third with only 16 colors, use:\n<br>&nbsp;<br>\n<pre>\n    gm montage -colors 32 cockatoo.1 -noop cockatoo.2\n             -colors 16 cockatoo.3 cockatoos.miff\n</pre>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-adjoin\">-adjoin</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>join images into a single multi-image file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-affine\">-affine</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>drawing transform matrix</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blue-primary\">-blue-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blur\">-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -borderwidth <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-chop\">-chop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixels from the interior of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compose\">-compose</a> <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-draw\">-draw</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with one or more graphic primitives</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fill\">-fill</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-frame\">-frame</a> <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gravity\">-gravity</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-green-primary\">-green-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -mode <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>mode of operation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pen\">-pen</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>(This option has been replaced by the -fill option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-red-primary\">-red-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-render\">-render</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-repage\">-repage</a> <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scenes\">-scenes</a> <i>&lt;value-value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>range of image scene numbers to read</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -shadow <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shadow the montage</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strip\">-strip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stroke\">-stroke</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when stroking a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strokewidth\">-strokewidth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the stroke width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>layout of images [<em>montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-title\">-title</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign title to displayed image [<em>animate, display, montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transform\">-transform</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transparent\">-transparent</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-point\">-white-point</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-xres\"></a>X Resources\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Montage</strong> options can appear on the command line or in your X resource\nfile. Options on the command line supersede values specified in your X\nresource file. See <strong>X(1)</strong> for more information on X resources.\n<p>\nAll <strong>montage</strong> options have a corresponding X resource. In addition,\n<strong>montage</strong>\nuses the following X resources:\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    background <i>(class Background)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>background color</td></tr></table>\n<p>\nSpecifies the preferred color to use for the composite image background.\nThe default is #ccc.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    borderColor <i>(class BorderColor)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>border color</td></tr></table>\n<p>\nSpecifies the preferred color to use for the composite image border. The\ndefault is #ccc.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    borderWidth <i>(class BorderWidth)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>border width</td></tr></table>\n<p>\nSpecifies the width in pixels of the composite image border. The default\nis 2.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    font <i>(class Font)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>font to use</td></tr></table>\n<p>\nSpecifies the name of the preferred font to use when displaying text within\nthe composite image. The default is 9x15, fixed, or 5x8 determined by the\ncomposite image size.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    matteColor <i>(class MatteColor)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color of the frame</td></tr></table>\n<p>\nSpecify the color of an image frame. A 3D effect is achieved by using highlight\nand shadow colors derived from this color. The default value is #697B8F.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    pen <i>(class Pen)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>text color</td></tr></table>\n<p>\nSpecifies the preferred color to use for text within the composite image.\nThe default is black.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    title <i>(class Title)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite image title</td></tr></table>\n<p>\nThis resource specifies the title to be placed at the top of the composite\nimage. The default is not to place a title at the top of the composite\nimage.\n</td></tr></table>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time\"></a>gm time\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>time</strong> executes an arbitrary <strong>gm</strong> utility command\n(e.g. <strong>convert</strong>) and reports the user and elapsed time.  This\nprovides way to measure command execution times similar to the Unix\n'time' command but in a portable and consistent way.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>To obtain time information for the execution of a\ncommand:\n<pre>\n% gm time convert input.ppm -gaussian 0x2 output.ppm\nconvert input.ppm -gaussian 0x2 output.ppm    22.60s user 0.00s system 2354% cpu 0.960 total\n</pre>\n<p>Here is the interpretation of the above output:\n<ul>\n<li><strong>user</strong> - the total user time consumed.\n<li><strong>system</strong> - the total system time consumed.\n<li><strong>total</strong> - the total elapsed time consumed.\n</ul>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>The time command reqires no options other than the gm command to\nexecute.\n</td></tr></table>\n</td></tr></table>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version\"></a>gm version\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>version</strong> displays the software release version, build quantum\n(pixel sample) depth, web site URL, copyright notice, enabled features\nsupport, configuration parameters, and final build options used to\nbuild the software.  The available information depends on how the\nsoftware was configured and the host system.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>To display the version information:\n<pre>\n  GraphicsMagick 1.3.27a 2017-12-11 Q16 http://www.GraphicsMagick.org/\n  Copyright (C) 2002-2020 GraphicsMagick Group.\n  Additional copyrights and licenses apply to this software.\n  See http://www.GraphicsMagick.org/www/Copyright.html for details.\n  Feature Support:\n    Native Thread Safe       yes\n    Large Files (&gt; 32 bit)   yes\n    Large Memory (&gt; 32 bit)  yes\n    BZIP                     yes\n    DPS                      no\n    FlashPix                 no\n    FreeType                 yes\n    Ghostscript (Library)    no\n    JBIG                     yes\n    JPEG-2000                yes\n    JPEG                     yes\n    Little CMS               yes\n    Loadable Modules         no\n    OpenMP                   yes (201307)\n    PNG                      yes\n    TIFF                     yes\n    TRIO                     no\n    UMEM                     no\n    WebP                     yes\n    WMF                      yes\n    X11                      yes\n    XML                      yes\n    ZLIB                     yes\n  Host type: x86_64-unknown-linux-gnu\n  Configured using the command:\n    ./configure  ...\n  Final Build Parameters:\n    CC       = ...\n    CFLAGS   = ...\n    CPPFLAGS = ...\n    CXX      = ...\n    CXXFLAGS = ...\n    LDFLAGS  = ...\n    LIBS     = ...\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>The version command does not currently support any options.\n</td></tr></table>\n</td></tr></table>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/identify.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"gm identify\"></a>gm identify\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"ident-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\nidentify - describe an image or image sequence.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"ident-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#ident-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#ident-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#ident-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"ident-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm identify</strong> <em>file</em> [ <em>file</em> ... ]\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"ident-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Identify</strong> describes the format and characteristics of one or\nmore image files as internally supported by the software. It will also\nreport if an image is incomplete or corrupt.  The information\ndisplayed includes the scene number, the file name, the width and\nheight of the image, whether the image is colormapped or not, the\nnumber of colors in the image, the number of bytes in the image, the\nformat of the image (JPEG, PNM, etc.), and finally the number of\nseconds in both user time and elapsed time it took to read and process\nthe image.  If -verbose or +ping are provided as an option, the pixel\nread rate is also displayed. An example line output from\n<strong>identify</strong> follows:\n<pre>\n    images/aquarium.miff 640x480 PseudoClass 256c\n           308135b MIFF 0.000u 0:01\n</pre>\n<p>\nIf <tt>-verbose</tt> is set, expect additional output including any image\ncomment:\n<br>&nbsp;<br>\n<pre>\n    Image: images/aquarium.miff\n    class: PseudoClass\n    colors: 256\n    signature: eb5dca81dd93ae7e6ffae99a527eb5dca8...\n    matte: False\n    geometry: 640x480\n       depth: 8\n    bytes: 308135\n    format: MIFF\n    comments:\n    Imported from MTV raster image: aquarium.mtv\n</pre>\n<p>\nFor some formats, additional format-specific information about the file\nwill be written if the <tt>-debug coder</tt> or <tt>-debug all</tt> option\nis used.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"ident-opti\"></a>Identify options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images immediately\nfollowing, until the set is terminated by the appearance of any option\nor <strong>-noop</strong>.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-format\">-format</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output formatted image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -ping\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>efficiently determine image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/import.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"import\"></a>gm import\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"imp-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\nimport - capture some or all of an X server screen and save the image to\na file.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"imp-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#imp-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#imp-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#imp-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"imp-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm import</strong> <strong>[</strong> <em>options</em> <strong>... ]</strong> <em>file</em>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"imp-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Import</strong> reads an image from any visible window on an X server and\noutputs it as an image file. You can capture a single window, the entire\nscreen, or any rectangular portion of the screen.\nUse <em><a href=\"display.html\">display</a></em>\nfor redisplay, printing, editing, formatting, archiving, image processing,\netc. of the captured image.\n<p>\nThe target window can be specified by id, name, or may be selected\nby clicking the mouse in the desired window. If you press a button and\nthen drag, a rectangle will form which expands and contracts as the mouse\nmoves. To save the portion of the screen defined by the rectangle, just\nrelease the button. The keyboard bell is rung once at the beginning of\nthe screen capture and twice when it completes.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"imp-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo select an X window or an area of the screen with the mouse and save it\nin the MIFF image format to a file entitled window.miff, use:\n<pre>\n    gm import window.miff\n</pre>\n<p>\nTo select an X window or an area of the screen with the mouse and save it\nin the Encapsulated PostScript format to include in another document, use:\n<pre>\n    gm import figure.eps\n</pre>\n<p>\nTo capture the entire X server screen in the JPEG image format in a file\nentitled root.jpeg, without using the mouse, use:\n<pre>\n    gm import -window root root.jpeg\n</pre>\n<p>\nTo capture the 512x256 area at the upper right corner of the X server\nscreen in the PNG image format in a well-compressed file entitled corner.png,\nwithout using the mouse,  use:\n<pre>\n    gm import -window root -crop 512x256-0+0 -quality 90\n           corner.png\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"imp-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect until it is explicitly changed by specifying\nthe option again with a different effect.\n<p>\n<strong>Import</strong> options can appear on the command line or in your\nX resources file. See <em>X(1)</em>. Options on the command line supersede\nvalues specified in your X resources file.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -descend\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>obtain image by descending window hierarchy</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -frame\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>include the X window frame in the imported image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pause\">-pause</a> <i>&lt;seconds&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pause between snapshots [import]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -ping\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>efficiently determine image characteristics</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scene\">-scene</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-screen\">-screen</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the screen to capture</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -silent\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>operate silently</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-snaps\">-snaps</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>number of screen snapshots</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transparent\">-transparent</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n</td></tr></table>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/index.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Image Processing System</title>\n<meta content=\"GraphicsMagick is a robust collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats including GIF, JPEG, PNG, PDF, and WebP. With GraphicsMagick you can create GIFs dynamically making it suitable for Web applications. You can also resize, rotate, sharpen, color reduce, or add special effects to an image and save your completed work in the same or differing image format. \" name=\"description\" />\n<meta content=\"GraphicsMagick, GM, PerlMagick, Perl Magick, Perl Magic, image processing, software development, TclMagick, Magick++\" name=\"keywords\" />\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-image-processing-system\">\n<h1 class=\"title\">GraphicsMagick Image Processing System</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"33%\" />\n<col width=\"67%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Current Release</td>\n<td>1.3.35 (Released February 23, 2020) <a class=\"reference external\" href=\"http://sourceforge.net/projects/graphicsmagick/files/\">download release</a></td>\n</tr>\n<tr><td>Development Snapshots</td>\n<td>(Updated frequently) <a class=\"reference external\" href=\"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/snapshots/\">download development snapshots</a></td>\n</tr>\n<tr><td>Mercurial Repository</td>\n<td>(Updated frequently) <a class=\"reference external\" href=\"http://sourceforge.net/p/graphicsmagick/code/\">visit Mercurial repository</a></td>\n</tr>\n</tbody>\n</table>\n<p>Check <a class=\"reference external\" href=\"http://www.GraphicsMagick.org/\">http://www.GraphicsMagick.org/</a> for the latest version of this page.</p>\n<p>GraphicsMagick is the swiss army knife of image processing. Comprised\nof 267K physical lines (according to David A. Wheeler's <a class=\"reference external\" href=\"http://www.dwheeler.com/sloccount/\">SLOCCount</a>)\nof source code in the base package (or 1,225K including 3rd party\nlibraries) it provides a robust and efficient collection of tools and\nlibraries which support reading, writing, and manipulating an image in\nover 89 major formats including important formats like DPX, GIF, JPEG,\nJPEG-2000, PNG, PDF, PNM, TIFF, and WebP.</p>\n<p>Image processing is multi-threaded using <a class=\"reference external\" href=\"http://www.openmp.org/\">OpenMP</a> (<a class=\"reference external\" href=\"OpenMP.html\">read about OpenMP\nin GraphicsMagick</a>) so that CPU-bound tasks scale linearly as\nprocessor cores are added. <a class=\"reference external\" href=\"http://www.openmp.org/\">OpenMP</a> support requires compilation with\nGCC 4.2 (or later), or use of any C compiler supporting at least the\n<a class=\"reference external\" href=\"http://www.openmp.org/\">OpenMP</a> 2.0 specification.</p>\n<p>GraphicsMagick is quite portable, and compiles under almost every general\npurpose operating system that runs on 32-bit or 64-bit CPUs.\nGraphicsMagick is available for virtually any Unix or Unix-like system,\nincluding Linux. It also runs under <a class=\"reference external\" href=\"INSTALL-windows.html\">Windows</a>\n2000 and later (Windows 2000, XP, Vista, 7, 8.X, 10), and MacOS-X.</p>\n<p>GraphicsMagick supports huge images and has been tested with\ngigapixel-size images. GraphicsMagick can create new images on the\nfly, making it suitable for building dynamic Web\napplications. GraphicsMagick may be used to resize, rotate, sharpen,\ncolor reduce, or add special effects to an image and save the result\nin the same or different image format. Image processing operations are\navailable from the command line, as well as through C, C++, Lua, Perl,\nPHP, Python, Tcl, Ruby, Windows .NET, or Windows COM programming\ninterfaces. With some modification, language extensions for\nImageMagick may be used.</p>\n<p>GraphicsMagick is originally derived from <a class=\"reference external\" href=\"http://www.imagemagick.org/\">ImageMagick</a> 5.5.2 as of\nNovember 2002 but has been completely independent of the ImageMagick\nproject since then. Since the fork from ImageMagick many improvements\nhave been made (see <a class=\"reference external\" href=\"NEWS.html\">NEWS</a>) by many <a class=\"reference external\" href=\"authors.html\">authors</a> using an open\ndevelopment model but without breaking the API or utilities operation.</p>\n<p>Here are some reasons to prefer GraphicsMagick over ImageMagick or\nother popular software:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>GM is more efficient than ImageMagick so it gets the job done\nfaster using fewer resources.</li>\n<li>GM is much smaller and lighter than ImageMagick (3-5X smaller\ninstallation footprint).</li>\n<li>GM is used to process billions of files at the world's largest photo\nsites (e.g. <a class=\"reference external\" href=\"http://www.kitchensoap.com/2009/04/03/slides-from-web20-expo-2009-and-somethin-else-interestin/\">Flickr</a> and <a class=\"reference external\" href=\"http://codeascraft.etsy.com/2010/07/09/batch-processing-millions-of-images/\">Etsy</a>).</li>\n<li>GM does not conflict with other installed software.</li>\n<li>GM suffers from fewer security issues and exploits than ImageMagick.</li>\n<li>GM participates in Google's <a class=\"reference external\" href=\"https://github.com/google/oss-fuzz\">oss-fuzz</a> project (since February, 2018).</li>\n<li>GM <a class=\"reference external\" href=\"http://www.valgrind.org/\">valgrind</a>'s 100% clean (memcheck and helgrind).</li>\n<li>GM passes rigorous memory error testing using <a class=\"reference external\" href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\">ASan</a>.</li>\n<li>GM passes undefined behavior testing using <a class=\"reference external\" href=\"https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html\">UBSan</a>.</li>\n<li>GM comes with a comprehensive <a class=\"reference external\" href=\"GraphicsMagick.html\">manual page</a>.</li>\n<li>GM provides API and ABI stability and managed releases that you can\ncount on (ImageMagick does not).</li>\n<li>GM provides detailed yet comprehensible <a class=\"reference external\" href=\"Changelog.html\">ChangeLog</a> and <a class=\"reference external\" href=\"NEWS.html\">NEWS</a>\nfiles (ImageMagick does not).</li>\n<li>GM is available for free, and may be used to support both open and\nproprietary applications.</li>\n<li>GM is distributed under an X11-style license (<a class=\"reference external\" href=\"http://opensource.org/licenses/MIT\">MIT License</a>),\napproved by the <a class=\"reference external\" href=\"http://www.opensource.org/\">Open Source Initiative</a>, recommended for use by\nthe <a class=\"reference external\" href=\"http://www.osscc.net/en/index.html\">OSSCC</a>, and compatible with the <a class=\"reference external\" href=\"http://www.fsf.org/licenses/licenses.html\">GNU GPL</a>.</li>\n<li>GM source code is managed in <a class=\"reference external\" href=\"https://www.mercurial-scm.org/\">Mercurial</a>, a distributed source\ncontrol management tool which supports management of local\nchanges.  The repository history goes back to 1998.</li>\n<li>GM has 0.00 (zero) defects per 1000 lines of code (293,341 total\nlines included) according to Coverity analysis on May 25, 2015.</li>\n<li>GM developers contribute to other free projects for the public good.</li>\n</ul>\n</blockquote>\n<p>GraphicsMagick is <a class=\"reference external\" href=\"Copyright.html\">copyrighted</a> by the GraphicsMagick\nGroup as well as many others.</p>\n<p>Here are just a few examples of what GraphicsMagick can do:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Convert an image from one format to another (e.g. TIFF to JPEG)</li>\n<li>Resize, rotate, sharpen, color reduce, or add special effects to an\nimage</li>\n<li>Create a montage of image thumbnails</li>\n<li>Create a transparent image suitable for use on the Web</li>\n<li>Compare two images</li>\n<li>Turn a group of images into a GIF animation sequence</li>\n<li>Create a composite image by combining several separate images</li>\n<li>Draw shapes or text on an image</li>\n<li>Decorate an image with a border or frame</li>\n<li>Describe the format and characteristics of an image</li>\n</ul>\n</blockquote>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/links.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Related Links</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"related-links\">\n<h1 class=\"title\">Related Links</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#graphicsmagick-topics\" id=\"id8\">GraphicsMagick Topics</a></li>\n<li><a class=\"reference internal\" href=\"#graphicsmagick-vulnerabilities\" id=\"id9\">GraphicsMagick Vulnerabilities</a></li>\n<li><a class=\"reference internal\" href=\"#image-processing-topics\" id=\"id10\">Image Processing Topics</a></li>\n<li><a class=\"reference internal\" href=\"#color-technology-related-topics\" id=\"id11\">Color Technology Related Topics</a></li>\n<li><a class=\"reference internal\" href=\"#gamma-related-topics\" id=\"id12\">Gamma Related Topics</a></li>\n<li><a class=\"reference internal\" href=\"#tiff-related-topics\" id=\"id13\">TIFF Related Topics</a></li>\n<li><a class=\"reference internal\" href=\"#jpeg-related-topics\" id=\"id14\">JPEG Related Topics</a></li>\n<li><a class=\"reference internal\" href=\"#dicom-related-topics\" id=\"id15\">DICOM Related Topics</a></li>\n<li><a class=\"reference internal\" href=\"#metadata-associated-data-topics\" id=\"id16\">Metadata (Associated Data) Topics</a></li>\n<li><a class=\"reference internal\" href=\"#high-dynamic-range-topics\" id=\"id17\">High Dynamic Range Topics</a></li>\n<li><a class=\"reference internal\" href=\"#motion-picture-links\" id=\"id18\">Motion Picture Links</a></li>\n<li><a class=\"reference internal\" href=\"#video-topics\" id=\"id19\">Video Topics</a></li>\n<li><a class=\"reference internal\" href=\"#other-software-packages\" id=\"id20\">Other Software Packages</a></li>\n<li><a class=\"reference internal\" href=\"#stock-photos\" id=\"id21\">Stock Photos</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"graphicsmagick-topics\">\n<h1><a class=\"toc-backref\" href=\"#id8\">GraphicsMagick Topics</a></h1>\n<p><a class=\"reference external\" href=\"http://directory.fsf.org/project/GraphicsMagick/\">Free Software Foundation</a> GraphicsMagick Entry.</p>\n<p><a class=\"reference external\" href=\"https://www.freshports.org/graphics/GraphicsMagick/\">FreeBSD port</a> for GraphicsMagick.</p>\n<p><a class=\"reference external\" href=\"http://pkgsrc.se/graphics/GraphicsMagick/\">NetBSD/pkgsrc port</a> for GraphicsMagick.</p>\n<p><a class=\"reference external\" href=\"http://bugs.gentoo.org/show_bug.cgi?id=190372\">Gentoo Sunrise</a> Bug Tracker Entry.</p>\n<p><a class=\"reference external\" href=\"https://bugzilla.redhat.com/buglist.cgi?component=GraphicsMagick&amp;product=Fedora\">Red Hat Linux</a> GraphicsMagick related bugs.</p>\n<p>Debian <a class=\"reference external\" href=\"http://packages.debian.org/search?keywords=GraphicsMagick&amp;amp;searchon=names&amp;amp;suite=all&amp;amp;section=main\">GraphicsMagick packages</a>.</p>\n<p><a class=\"reference external\" href=\"http://en.wikipedia.org/wiki/GraphicsMagick\">WikiPedia</a> GraphicsMagick Entry.</p>\n<p><a class=\"reference external\" href=\"https://www.openhub.net/p/graphics_magick\">Black Duck | Open HUB</a> GraphicsMagick Entry.</p>\n<p><a class=\"reference external\" href=\"http://sourceforge.net/projects/graphicsmagick/\">SourceForge</a> GraphicsMagick Entry.</p>\n<p><a class=\"reference external\" href=\"http://stackoverflow.com/questions/tagged/graphicsmagick?\">GraphicsMagick questions on StackOverflow</a>.</p>\n<p><a class=\"reference external\" href=\"https://abi-laboratory.pro/tracker/timeline/graphicsmagick/\">GraphicsMagick ABI/API Changes</a>.</p>\n</div>\n<div class=\"section\" id=\"graphicsmagick-vulnerabilities\">\n<h1><a class=\"toc-backref\" href=\"#id9\">GraphicsMagick Vulnerabilities</a></h1>\n<p>Search for <a class=\"reference external\" href=\"https://www.cvedetails.com/vulnerability-list/vendor_id-2802/Graphicsmagick.html\">GraphicsMagick</a> CVEs.</p>\n<p>Seach SecurityFocus Bugtraq for <a class=\"reference external\" href=\"http://www.securityfocus.com/bid\">GraphicsMagick</a> vulnerabilities (select Vendor 'GraphicsMagick').</p>\n<p>Debian vulnerabilities in <a class=\"reference external\" href=\"https://security-tracker.debian.org/tracker/source-package/graphicsmagick\">GraphicsMagick</a>.</p>\n<p>Oss-fuzz issues pertaining to <a class=\"reference external\" href=\"https://bugs.chromium.org/p/oss-fuzz/issues/list?q=graphicsmagick\">GraphicsMagick</a>.</p>\n<p>Oss-fuzz build status for <a class=\"reference external\" href=\"https://oss-fuzz-build-logs.storage.googleapis.com/index.html#graphicsmagick\">GraphicsMagick</a>.</p>\n</div>\n<div class=\"section\" id=\"image-processing-topics\">\n<h1><a class=\"toc-backref\" href=\"#id10\">Image Processing Topics</a></h1>\n<p><a class=\"reference external\" href=\"http://homepages.inf.ed.ac.uk/rbf/HIPR2/\">HyperMedia Image Processing Reference</a>,\nA guide to image processing algorithms, many of which are supported by GraphicsMagick.</p>\n</div>\n<div class=\"section\" id=\"color-technology-related-topics\">\n<h1><a class=\"toc-backref\" href=\"#id11\">Color Technology Related Topics</a></h1>\n<p>Charles Poynton's <a class=\"reference external\" href=\"http://www.poynton.com/Poynton-color.html\">Color technology FAQs</a>,\nvery useful documentation on color technologies.</p>\n<p><a class=\"reference external\" href=\"http://www.color.org/\">International Color Consortium</a>,\nthe organization responsible for color profile standards.</p>\n<p><a class=\"reference external\" href=\"http://www.argyllcms.com/\">Argyll Color Management System</a>,\na free experimental color management system.</p>\n<p><a class=\"reference external\" href=\"http://www.littlecms.com/\">Littlecms</a>,\na free commercial-grade colormanagement engine in 100K (and used by GraphicsMagick).</p>\n<p><a class=\"reference external\" href=\"http://www.brucelindbloom.com/\">Bruce Lindbloom's Web Site</a>,\noffering interesting information related to color science and working spaces.</p>\n<p><a class=\"reference external\" href=\"http://www.w3.org/Graphics/Color/sRGB.html\">sRGB</a>,\nA standard default color space for the Internet.</p>\n<p><a class=\"reference external\" href=\"http://www.anyhere.com/gward/hdrenc/hdr_encodings.html\">High Dynamic Range Image Encodings</a>,\nan analysis by Greg Ward of various HDR encodings.</p>\n</div>\n<div class=\"section\" id=\"gamma-related-topics\">\n<h1><a class=\"toc-backref\" href=\"#id12\">Gamma Related Topics</a></h1>\n<p>While most computer images are encoded with a gamma of 2.2 (really 2.2\nto 2.6), GraphicsMagick does not attempt to convert images to\nlinear-light before applying image processing operations since it is\nnot possible to know for sure to know how to do so.  Some algorithms\nsuch as resize, blur, and composition, will produce more accurate\nresults when performed on images encoded in a linear-light scaled\nspace.</p>\n<p>For a typical sRGB image encoded in a gamma-corrected space with gamma\n2.2, the option <tt class=\"docutils literal\"><span class=\"pre\">-gamma</span> 0.45</tt> (1/2.2 = 0.45) will remove that\nencoding for subsequent algorithms so that they are done in\nlinear-light space.  When processing is completed, then <tt class=\"docutils literal\"><span class=\"pre\">-gamma</span> 2.2</tt>\nwill restore gamma-correction for viewing.  It is recommended to use a\nQ16 or Q32 build of GraphicsMagick when doing this since linear-light\nspace encoding is not efficient and will lose accuracy if stored with\nless than 14 bits per sample.</p>\n<p>The following documents and pages provide interesting information on\ngamma-related topics:</p>\n<p><a class=\"reference external\" href=\"http://www.poynton.com/GammaFAQ.html\">Charles Poynton's Gamma FAQ</a>,\nprovides an excellent description of what gamma is, why it is good,\nand when you don't want it.</p>\n</div>\n<div class=\"section\" id=\"tiff-related-topics\">\n<h1><a class=\"toc-backref\" href=\"#id13\">TIFF Related Topics</a></h1>\n<p><a class=\"reference external\" href=\"http://www.simplesystems.org/libtiff/\">LibTIFF</a>,\nLibtiff library and TIFF format mailing list.</p>\n<p>AWare Systems <a class=\"reference external\" href=\"http://www.awaresystems.be/imaging/tiff.html\">TIFF</a> site.\nDetailed TIFF-related information which goes beyond the TIFF specification,\nlist archives for the libtiff mailing list, and information regarding the emerging Big TIFF format.</p>\n<p><a class=\"reference external\" href=\"http://www.adobe.com/products/dng/index.html\">Digital Negative (DNG)</a>,\nAdobe TIFF specification for digital camera raw images.</p>\n<p><a class=\"reference external\" href=\"http://www.anyhere.com/gward/pixformat/tiffluv.html\">LogLuv Encoding for TIFF Images</a>,\nA way to store HDR images using TIFF.</p>\n</div>\n<div class=\"section\" id=\"jpeg-related-topics\">\n<h1><a class=\"toc-backref\" href=\"#id14\">JPEG Related Topics</a></h1>\n<p><a class=\"reference external\" href=\"http://www.ijg.org/\">Independent JPEG Group</a> (home of IJG JPEG library).</p>\n<p><a class=\"reference external\" href=\"http://jpegclub.org/\">Guido Vollbeding's JPEG site</a>, including various patches to IJG JPEG release 6b.</p>\n</div>\n<div class=\"section\" id=\"dicom-related-topics\">\n<h1><a class=\"toc-backref\" href=\"#id15\">DICOM Related Topics</a></h1>\n<p><a class=\"reference external\" href=\"http://www.dclunie.com/\">David Clunie's Medical Image Format Site</a>,\ninformation about medical images.</p>\n</div>\n<div class=\"section\" id=\"metadata-associated-data-topics\">\n<h1><a class=\"toc-backref\" href=\"#id16\">Metadata (Associated Data) Topics</a></h1>\n<p><a class=\"reference external\" href=\"http://www.adobe.com/products/xmp/index.html\">Extensible Metadata Platform (XMP)</a>,\nAdobe's XML-based embedded metadata format.</p>\n<p><a class=\"reference external\" href=\"http://www.exif.org/\">EXIF</a>,\nFormat for metadata in images, particularly JPEG files from digital cameras.</p>\n</div>\n<div class=\"section\" id=\"high-dynamic-range-topics\">\n<h1><a class=\"toc-backref\" href=\"#id17\">High Dynamic Range Topics</a></h1>\n<p><a class=\"reference external\" href=\"http://www.anyhere.com/gward/hdrenc/hdr_encodings.html\">High Dynamic Range Image Encodings</a>,\nAn analsys by Greg Ward of various HDR encodings.</p>\n<p><a class=\"reference external\" href=\"http://www.anyhere.com/gward/pixformat/tiffluv.html\">LogLuv Encoding for TIFF Images</a>,\nA way to store HDR images using TIFF.</p>\n<p><a class=\"reference external\" href=\"http://www.openexr.com/\">OpenEXR</a>,\nlibrary and sample tools for dealing with high dynamic-range (HDR) images.</p>\n</div>\n<div class=\"section\" id=\"motion-picture-links\">\n<h1><a class=\"toc-backref\" href=\"#id18\">Motion Picture Links</a></h1>\n<p><a class=\"reference external\" href=\"http://www.dcimovies.com/\">Digital Cinema Initiatives</a>,\nDCI offers the first complete specification for digital cinema delivery.</p>\n<p><a class=\"reference external\" href=\"http://ingex.sourceforge.net/index.html\">Ingex</a> Tapeless video &amp;\naudio capture, transcoding and network file serving.  From the BBC.</p>\n</div>\n<div class=\"section\" id=\"video-topics\">\n<h1><a class=\"toc-backref\" href=\"#id19\">Video Topics</a></h1>\n<p><a class=\"reference external\" href=\"http://www.fourcc.org/\">Video Codecs and Pixel Formats</a>, offers a summary of YUV encoding formats.</p>\n</div>\n<div class=\"section\" id=\"other-software-packages\">\n<h1><a class=\"toc-backref\" href=\"#id20\">Other Software Packages</a></h1>\n<p><a class=\"reference external\" href=\"http://dmmd.net/main_wp/visere/\">DMMD Visere</a>,\ntruly outstanding image viewing/browsing software for Microsoft Windows.\nVisere is based on GraphicsMagick.</p>\n<p><a class=\"reference external\" href=\"http://elynxlab.free.fr/en/index.html\">eLynx lab</a> High resolution image processing tool.</p>\n<p>The <a class=\"reference external\" href=\"http://www.gimp.org/\">GIMP</a>, interactive image editing software (like Photoshop).</p>\n<p><a class=\"reference external\" href=\"http://www.imagemagick.org/\">ImageMagick</a>, the ancestor of GraphicsMagick.</p>\n<p><a class=\"reference external\" href=\"https://github.com/libvips/\">VIPS</a>, an image processing system also useful with\nlarge images, and which comes with an unusual GUI.</p>\n<p><a class=\"reference external\" href=\"http://freeimage.sourceforge.net/index.html\">FreeImage</a>,\na free image processing library.</p>\n<p><a class=\"reference external\" href=\"http://rsbweb.nih.gov/ij/\">ImageJ</a> Image Processing and Analysis in Java.</p>\n<p><a class=\"reference external\" href=\"http://www.pstoedit.net/\">Pstoedit</a>,\nA Postscript to editable vector translation utility.</p>\n<p><a class=\"reference external\" href=\"http://ufraw.sourceforge.net/\">UFRaw</a>,\na utility to read and manipulate raw images from digital cameras.</p>\n<p><a class=\"reference external\" href=\"http://lprof.sourceforge.net/index.html\">LPROF</a>,\nan open source ICC profiler with graphical user interface.</p>\n<p><a class=\"reference external\" href=\"http://gallery.menalto.com/\">Gallery</a>,\na facinating web-based photo album organizer.  Works with GraphicsMagick!.</p>\n<p><a class=\"reference external\" href=\"http://djv.sourceforge.net/\">DJV Imaging</a>, professional movie\nplayback and image processing software for the film and computer\nanimation industries.</p>\n<p><a class=\"reference external\" href=\"https://sites.google.com/site/openimageio/\">OpenImageIO</a> library\nfor reading and writing images, and a bunch of related classes,\nutilities, and applications.</p>\n</div>\n<div class=\"section\" id=\"stock-photos\">\n<h1><a class=\"toc-backref\" href=\"#id21\">Stock Photos</a></h1>\n<p><a class=\"reference external\" href=\"http://www.morguefile.com/\">MorgueFile</a>, Free high-resolution stock photo images.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/magick.css",
    "content": "/* magick.css -- standard style sheet */\nbody, p, td, th, ul, ol  {\n\tfont-family : sans-serif;\n\tfont-size : medium;\n}\n\nbody {\n\tcolor : #000000;\n\tpadding-bottom : 20px;\n\tmargin : 0;\n\tbackground-color : #FFFFFF;\n\ttext-align : left;\n}\n\n\nh1  {\n\tfont-size : 120%;\n}\n\nh2  {\n\tfont-size : 110%;\n}\n\nh3, h4  {\n\tfont-size : 105%;\n}\n\na:link  {\n\ttext-decoration : underline;\n\tcolor : #007F39;\n}\n\na:visited  {\n\ttext-decoration : underline;\n\tcolor : #00602B;\n}\n\na:hover  {\n\tcolor : #007F39;\n}\n\n.small  {\n\tfont-size : smaller;\n}\n\n.tiny  {\n\tfont-size : smaller;\n}\n\ndiv.banner {\n\tpadding : 2ex 0 1ex 5em;\n\toverflow : hidden;\n\tmargin : 0;\n\tbackground-color : #DFFFED;\n\tborder-bottom : 1px solid #3A4840;\n\tborder-top : 1px solid #3A4840;\n}\n\ndiv.banner img {\n\tvertical-align : middle;\n\tmargin-left: 0em;\n}\n\ndiv.banner form {\n\tmargin-left: 2em;\n\ttext-align : center;\n\tdisplay : inline;\n}\n\ndiv.banner .title {\n\tcolor : #3A604B;\n\tfont-size : 2.2em;\n\tfont-weight : bold;\n}\n\ndiv.banner .subtitle {\n\tcolor : #023100;\n\tfont-size : 1em;\n\tfont-weight : normal;\n\tmargin-left : 1em;\n}\n\ndiv.navmenu {\n\tfont-size : 90%;\n\tbackground-color : #3A604B;\n\tborder-bottom : 1px solid #75867D;\n\tpadding : 0;\n\tmargin : 0;\n\ttext-align : center;\n}\n\ndiv.navmenu ul {\n\tpadding : 5px;\n\tmargin : 0;\n}\n\ndiv.navmenu ul li {\n\tpadding : 0 .5em 0 .5em;\n\tlist-style-type : none;\n\tmargin : 0 0 0 4px;\n\tdisplay : inline;\n\ttext-align : center;\n}\n\ndiv.navmenu ul li a {\n\tcolor : #FFFFFF;\n\ttext-decoration : none;\n}\n\ndiv.navmenu ul li a:hover {\n\tborder-bottom : 1px solid #FFFFFF;\n}\n\ndiv.main {\n\theight : auto;\n\tpadding : 1em;\n\twidth : auto;\n\tbackground : #FFFFFF;\n\tmax-width : 960px;\n\tmargin : 2ex 2em 1ex 3em;\n\ttext-align : left;\n\tline-height: 140%;\n}\n\ndiv.main h1.title {\n\tfont-size : 140%;\n\ttext-align: center;\n\tpadding : 0;\n\tpadding-bottom : .4ex;\n\tfont-weight : bold;\n\tmargin : 0 0 0.5em 0;\n}\n\ndiv.main hr.end {\n\tcolor : #808080;\n\twidth : 50%;\n\theight : 1px;\n}\n\nhr.divider {\n\tcolor : #A0A0A0;\n\tborder : none;\n\tclear : both;\n\theight : 3px;\n\twidth : 62%;\n\tbackground-color : #A0A0A0;\n}\n\ndiv.footer {\n\tcolor : #606060;\n\tclear : both;\n\twidth : 100%;\n\tbackground : #FFFFFF;\n\tmax-width : 960px;\n\tpadding-top : 1ex;\n\tfont-family : sans-serif;\n}\n\ndiv.footer p {\n\tfont-size : 9pt;\n\tmargin : .5ex 0 0 0;\n\ttext-align : left;\n}\n\ndiv.footer a {\n\tcolor : #000000;\n\tfont-size : 9pt;\n\tmargin : 0 .5em 0 .5em;\n\ttext-decoration : none;\n}\n\ndiv.footer a:hover {\n\ttext-decoration : underline;\n}\n\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/miff.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>Magick Image File Format (version 1.0)</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-image-file-format-version-1-0\">\n<h1 class=\"title\">Magick Image File Format (version 1.0)</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>Magick Image File Format (MIFF) is a platform-independent format for\nstoring bitmap images. MIFF was originally invented by John Cristy for\nImageMagick, but is also a native format of GraphicsMagick. It is\nuseful as an efficient lossless working file format which assures that\nall of the image attributes used by ImageMagick and GraphicsMagick are\npreserved. Several lossless compression algorithms are available in\norder to save space.</p>\n<div class=\"section\" id=\"description\">\n<h1>Description</h1>\n<p>A MIFF image file consist of two sections. The first section is a header\ncomposed of keywords describing the image in text form. The next section\nis the binary image data. The header is separated from the image data by\na : character immediately followed by a ctrl-Z.</p>\n<p>The MIFF header is composed entirely of LATIN-1 characters. The fields in\nthe header are keyword and value combination in the keyword=value format,\nwith each keyword and value separated by an equal sign (=). Each\nkeyword=value combination is delimited by at least one control or\nwhitespace character. Comments may appear in the header section and are\nalways delimited by braces. The MIFF header always ends with a colon (:)\ncharacter, followed by a ctrl-Z character. It is also common to precede\nthe colon with a formfeed and a newline character. The formfeed prevents\nthe listing of binary data when using more(1) under Unix where the ctrl-Z\nhas the same effect with the type command on the Win32 command line.</p>\n<p>It is required that the 'id' keyword be present with the value\n'ImageMagick' (id=ImageMagick) and be the first keyword listed in the\nMIFF header.  Files not starting with this keyword/value may be\nrejected.  The 'version' keyword must always be emitted for all new\nfiles with the value '1.0' (version=1.0).</p>\n<p>The MIFF header supports arbitrary LATIN-1 keyword strings.  Some\nkeyword strings have special interpretation while others are merely\nstored as image attributes.  The following is a list of keyword=value\ncombinations with special interpretation that may be found in a MIFF\nfile:</p>\n<p>background-color=color</p>\n<p>border-color=color</p>\n<p>matte-color=color</p>\n<blockquote>\nthese optional keywords reflects the image background, border, and\nmatte colors respectively. A color can be a name (e.g. white) or a hex\nvalue (e.g. #ccc).</blockquote>\n<p>class=DirectClass</p>\n<p>class=PseudoClass</p>\n<blockquote>\nthe type of binary image data stored in the MIFF file. If this keyword\nis not present, DirectClass image data is assumed.</blockquote>\n<p>colors=value</p>\n<blockquote>\nthe number of colors in a DirectClass image. For a PseudoClass image,\nthis keyword specifies the size of the colormap. If this keyword is not\npresent in the header, and the image is PseudoClass, a linear 256 color\ngrayscale colormap is used with the image data. The maximum number of\ncolormap entries is 65535.</blockquote>\n<p>columns=value</p>\n<blockquote>\nthe width of the image in pixels. This is a required keyword and has no\ndefault.</blockquote>\n<p>colorspace=RGB</p>\n<p>colorspace=CMYK</p>\n<blockquote>\nthe colorspace of the pixel data. The default is RGB.</blockquote>\n<p>comment={text}</p>\n<blockquote>\ncomment text.  Note that extremely old MIFF files used a different\nmeans to indicate comment text.</blockquote>\n<p>compression=BZip</p>\n<p>compression=None</p>\n<p>compression=RLE</p>\n<p>compression=Zip</p>\n<blockquote>\nthe type of algorithm used to compress the image data. If this keyword\nis not present, the image data is assumed to be uncompressed.</blockquote>\n<p>delay &lt;1/100ths of a second&gt;</p>\n<blockquote>\nthe interframe delay in an image sequence. The maximum delay is 65535.</blockquote>\n<p>depth=8</p>\n<p>depth=16</p>\n<p>depth=32</p>\n<blockquote>\ndepth of a single color value representing values from 0 to 255\n(depth 8), 65535 (depth 16), or 4294967295 (depth 32). If this\nkeyword is absent, a depth of 8 is assumed.  Depth values of 1 to 32\nare accepted, with the storage depth being rounded up to 8, 16,\nor 32.</blockquote>\n<p>dispose value</p>\n<blockquote>\n<p>GIF disposal method. Here are the valid methods:</p>\n<blockquote>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"19%\" />\n<col width=\"81%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Disposal</td>\n<td>Description</td>\n</tr>\n<tr><td>0</td>\n<td>No disposal specified.</td>\n</tr>\n<tr><td>1</td>\n<td>Do not dispose between frames.</td>\n</tr>\n<tr><td>2</td>\n<td>Overwrite frame with background color from\nheader.</td>\n</tr>\n<tr><td>3</td>\n<td>Overwrite with previous frame.</td>\n</tr>\n</tbody>\n</table>\n</blockquote>\n</blockquote>\n<p>gamma=value</p>\n<blockquote>\ngamma of the image. If it is not specified, a gamma value of\n.45454545 (linear-intensity gamma &quot;2.2&quot; as used by NTSC, sRGB, and\nRec.709) is assumed.  A gamma value of 1.0 indicates linear-light.</blockquote>\n<p>id=ImageMagick</p>\n<blockquote>\nidentify the file as a MIFF-format image file. This keyword is required\nand has no default. Although this keyword can appear anywhere in the\nheader, it should start as the first keyword of the header in column 1.\nThis will allow programs like file(1) to easily identify the file as\nMIFF.</blockquote>\n<p>iterations value</p>\n<blockquote>\nthe number of times an image sequence loops before stopping.</blockquote>\n<p>label={value}</p>\n<blockquote>\nthis optional keyword defines a short title or caption for the image.\nIf any whitespace appears in the label, it must be enclosed within\ndouble quotes.</blockquote>\n<p>matte=True</p>\n<p>matte=False</p>\n<blockquote>\nspecifies whether a DirectClass image has matte data. Matte data is\ngenerally useful for image compositing. This keyword has no meaning for\npseudocolor images.</blockquote>\n<p>montage=&lt;width&gt;x&lt;height&gt;{+-}&lt;xoffset&gt;{+-}&lt;yoffset&gt;</p>\n<blockquote>\nsize and location of the individual tiles of a composite image. See\nX(1) for details about the geometry specification. Use this keyword\nwhen the image is a composite of a number of different tiles. A tile\nconsists of an image and optionally a border and a label. &lt; width&gt; is\nthe size in pixels of each individual tile in the horizontal direction\nand &lt;height&gt; is the size in the vertical direction. Each tile must have\nan equal number of pixels in width and equal in height. However, the\nwidth can differ from the height. &lt;xoffset&gt; is the offset in number of\npixels from the vertical edge of the composite image where the first\ntile of a row begins and &lt;yoffset&gt; is the offset from the horizontal\nedge where the first tile of a column begins. If this keyword is\nspecified, a directory of tile names must follow the image header. The\nformat of the directory is explained below.</blockquote>\n<p>page=&lt;width&gt;x&lt;height&gt;{+-}&lt;xoffset&gt;{+-}&lt;yoffset&gt;</p>\n<blockquote>\npreferred size and location of an image canvas.</blockquote>\n<p>profile-icc=value</p>\n<blockquote>\nthe number of bytes in the International Color Consortium color\nprofile. The profile is defined by the ICC profile specification.</blockquote>\n<p>profile-iptc=value</p>\n<blockquote>\nthe number of bytes in the IPTC Newsphoto profile. The profile is\ndefined by the IPTC specification.</blockquote>\n<p>profile-name=value</p>\n<blockquote>\nthe number of bytes in the generic profile name where name identifies\nthe profile. Name is substituted with any LATIN-1 string to form a\nunique generic profile identifier.</blockquote>\n<p>profile:name=value</p>\n<blockquote>\nthe number of bytes in the generic profile name where name identifies\nthe profile. Name is substituted with any LATIN-1 string to form a\nunique generic profile identifier.</blockquote>\n<p>red-primary=x,y</p>\n<p>green-primary=x,y</p>\n<p>blue-primary=x,y</p>\n<p>white-point=x,y</p>\n<blockquote>\nthese optional keywords reflect the chromaticity primaries and white point.</blockquote>\n<p>rendering-intent=saturation</p>\n<p>rendering-intent=perceptual</p>\n<p>rendering-intent=absolute</p>\n<p>rendering-intent=relative</p>\n<blockquote>\nRendering intent is the CSS-1 property that has been defined by the\nInternational Color Consortium.</blockquote>\n<p>resolution=&lt;x-resolution&gt;x&lt;y-resolution&gt;</p>\n<blockquote>\nvertical and horizontal resolution of the image. See units for the\nspecific resolution units (e.g. pixels per inch).</blockquote>\n<p>rows=value</p>\n<blockquote>\nthe height of the image in pixels. This is a required keyword and has\nno default.</blockquote>\n<p>orientation=value</p>\n<blockquote>\nspecifies the orientation of the image as an attribute (does not\neffect pixel storage).  Supported values are TopLeft, TopRight,\nBottomRight, BottomLeft, LeftTop, RightTop, RightBottom, LeftBottom\nas specified by the TIFF and EXIF standards.</blockquote>\n<p>scene=value</p>\n<blockquote>\nthe sequence number for this MIFF image file. This optional keyword is\nused when a MIFF image file is one in a sequence of files used in an\nanimation.</blockquote>\n<p>signature=value</p>\n<blockquote>\nthis optional keyword contains a string that uniquely identifies the\nimage pixel contents. NIST's SHA-256 message digest algorithm is\nrecommended.</blockquote>\n<p>units=pixels-per-inch</p>\n<p>units=pixels-per-centimeter</p>\n<blockquote>\nimage resolution units.</blockquote>\n<p>version=1.0</p>\n<blockquote>\nIdentifies the MIFF version used, which is 1.0 for the purpose of\nthis specification.  If version is omitted, then certain MIFF\nfeatures (e.g. compressed rows) are assumed to be encoded using a\ndefunct MIFF format.</blockquote>\n<p>Other key value pairs are permitted. If a value contains whitespace it must be\nenclosed with braces as illustrated here:</p>\n<pre class=\"literal-block\">\nid=ImageMagick  version=1.0\nclass=PseudoClass colors=256\ncompression=RLE\ncolumns=1280 rows=1024\nscene=1\nsignature=d79e1c308aa5bbcdeea8ed63df412da9\ncopyright={Copyright (c) 2000 Mortimer Snerd}\n&lt;FF&gt;\n:\n</pre>\n<p>Note that keyword=value combinations may be separated by newlines or\nspaces and may occur in any order within the header. Comments (within\nbraces) may appear anywhere before the colon.</p>\n<p>The elements shown in the following table may appear after the header and\nbefore the image data. These elements appear in the order described in\nthe following table if the keyword indicates that they exist.</p>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"21%\" />\n<col width=\"21%\" />\n<col width=\"57%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Element</td>\n<td>Keyword</td>\n<td>Description</td>\n</tr>\n<tr><td>Image\ndirectory</td>\n<td>montage</td>\n<td>The directory consists of a name for each\ntile of the composite image separated by\na newline character. The list is\nterminated with a NULL character.</td>\n</tr>\n<tr><td>ICC Profile</td>\n<td>profile-icc</td>\n<td>Binary color profile.</td>\n</tr>\n<tr><td>IPTC Profile</td>\n<td>profile-iptc</td>\n<td>Binary IPTC Newsphoto profile.</td>\n</tr>\n<tr><td>Generic\nProfiles</td>\n<td>profile-&lt;name&gt;</td>\n<td>Binary generic profile. Multiple named\ngeneric profiles may exist.</td>\n</tr>\n</tbody>\n</table>\n<p>Next comes the binary image data itself. How the image data is formatted\ndepends upon the class of the image as specified (or not specified) by\nthe value of the class keyword in the header. All numeric values in the\nbinary section are written with the most significant bytes occuring first\n(big-endian ordering).</p>\n<p>DirectClass images (class=DirectClass) are continuous-tone, images stored\nas RGB (red, green, blue), RGBA (red, green, blue, alpha), CMYK (cyan,\nyellow, magenta, black), and CMYKA (cyan, yellow, magenta, black, alpha)\nintensity values as defined by the colorspace and matte keywords. The\nsize of each intensity value depends on the depth of the image. The\ndepth, number of bytes, and numeric range of each value are shown in the\nfollowing table:</p>\n<blockquote>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"21%\" />\n<col width=\"41%\" />\n<col width=\"38%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Depth</td>\n<td>Bytes Per\nValue</td>\n<td>Value Range</td>\n</tr>\n<tr><td>8</td>\n<td>1</td>\n<td>0..255</td>\n</tr>\n<tr><td>16</td>\n<td>2</td>\n<td>0..65535</td>\n</tr>\n<tr><td>32</td>\n<td>4</td>\n<td>0..4294967295</td>\n</tr>\n</tbody>\n</table>\n</blockquote>\n<p>The alpha value (if it occurs) represents the degree of pixel opacity\n(zero is totally transparent).</p>\n<p>PseudoClass images (class=PseudoClass) are colormapped RGB images. The\ncolormap is stored as a series of red, green, and blue pixel values. The\nsize of each colormap value depends on the image depth, as shown in the\nfollowing table:</p>\n<blockquote>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"19%\" />\n<col width=\"22%\" />\n<col width=\"31%\" />\n<col width=\"28%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Depth</td>\n<td>Bytes Per\nValue</td>\n<td>Value Range</td>\n<td>Bytes Per\nColormap Entry</td>\n</tr>\n<tr><td>8</td>\n<td>1</td>\n<td>0..255</td>\n<td>3</td>\n</tr>\n<tr><td>16</td>\n<td>2</td>\n<td>0..65535</td>\n<td>6</td>\n</tr>\n<tr><td>32</td>\n<td>4</td>\n<td>0..4294967295</td>\n<td>12</td>\n</tr>\n</tbody>\n</table>\n</blockquote>\n<p>The number of colormap entries is defined by the colors keyword. The\ncolormap data occurs immediately following the header (or image directory\nif the montage keyword is in the header). Immediately following the\ncolormap data is the PseudoClass image data. PseudoClass image data is an\narray of index values into the color map. The number of bytes comprising\nthe index value depends on the number of colors in the image. The\nfollowing table shows the number of bytes in each colormap index as\ndetermined by the colors keyword:</p>\n<blockquote>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"31%\" />\n<col width=\"31%\" />\n<col width=\"38%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Colors</td>\n<td>Bytes Per\nIndex</td>\n<td>Index Range</td>\n</tr>\n<tr><td>&lt;=256</td>\n<td>1</td>\n<td>0..255</td>\n</tr>\n<tr><td>&lt;=65535</td>\n<td>2</td>\n<td>0..65535</td>\n</tr>\n<tr><td>&lt;=4294967295</td>\n<td>4</td>\n<td>0..4294967295</td>\n</tr>\n</tbody>\n</table>\n</blockquote>\n<p>If matte is true, each colormap index is immediately followed by an\nequally-sized alpha value. The alpha value represents the degree of pixel\nopacity (zero is totally transparent).</p>\n<p>The image data in a MIFF file may be uncompressed, runlength encoded,\nZip compressed, or BZip compressed. The compression keyword in the\nheader defines how the image data is compressed. Uncompressed pixels\nare stored one scanline at a time in row order. Runlength encoded\ncompression counts runs of identical adjacent pixels and stores the\npixels followed by a length byte (the number of identical pixels minus\n1). Zip and BZip compression for version 1.0 compresses each row of an\nimage and precedes the compressed row with the length of compressed\npixel bytes as a 32-bit unsigned value in most significant byte first\norder. If the version tag is not present (indicating a virtually\nunused legacy format) then Zip and BZip omit this length value and the\nreader must incrementally decode each row and restart compression at\nthe point where decoding completed for the previous row.</p>\n<p>Note that compression in MIFF is scanline-based without any\nspecialized pre-processing as is found in the PNG and TIFF file\nformats.  As a result, available compression levels are likely to be\nless than some other file formats given the same compression algorithm.</p>\n<p>MIFF files may contain more than one image. Simply concatenate each\nindividual image (composed of a header and image data) into one file.</p>\n</div>\n<div class=\"section\" id=\"authors\">\n<h1>Authors</h1>\n<p>John Cristy, <a class=\"reference external\" href=\"mailto:magick-users&#37;&#52;&#48;imagemagick&#46;org\">magick-users<span>&#64;</span>imagemagick<span>&#46;</span>org</a> ImageMagick Studio LLC.</p>\n<p>Maintained since 2002 by Bob Friesenhahn, GraphicsMagick Group.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/mission.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Mission Statement</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-mission-statement\">\n<h1 class=\"title\">GraphicsMagick Mission Statement</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>In November, 2002, the GraphicsMagick project was formed as a branch from\nImageMagick 5.5.2. The project was formed in order to develop a more\n&quot;stable&quot; form of ImageMagick which is suitable to be use as a base for\nother open source (and proprietary) applications. It was perceived that\nImageMagick provided tremendous value, but also proved to be difficult to\nrely on as a stable application component since the ImageMagick\ninterfaces often changed between releases, and there was no concept of\nshared library ABI stability. GraphicsMagick intends to resolve these\nissues while providing an appealing development environment to attract\nthe best available developers.</p>\n<p>The objectives of the GraphicsMagick project are to:</p>\n<ul class=\"simple\">\n<li>Use an open development model.</li>\n<li>Encourage new developers to join the project.</li>\n<li>Avoid unnecessary source code &quot;churn&quot;.</li>\n<li>Establish and preserve both a stable API, and stable ABI, making\nGraphicsMagick a stable component in Linux and BSD distributions.</li>\n<li>Use efficient coding practices which result in fast code.</li>\n<li>Improve memory efficiency.</li>\n<li>Use a release process which assures a working product.</li>\n<li>Prioritize bug-fixes over new feature enhancements.</li>\n<li>Maintain an accurate change log.</li>\n<li>Value, and respect the contributions of developers, and observe and\nrespect the copyrights of other projects.</li>\n</ul>\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/mogrify.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mogrify\"></a>gm mogrify\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mog-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\nmogrify - mogrify an image\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mog-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#mog-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#mog-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#mog-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#mog-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mog-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm mogrify</strong> <strong>[</strong> <em>options</em> <strong>... ]</strong> <em>file ...</em>\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mog-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Mogrify</strong> transforms an image or a sequence of images. These transforms\ninclude image scaling, image rotation, color reduction, and others. Each\ntransmogrified image overwrites the corresponding original image, unless an\noption such as\n<strong>-format</strong> causes the output filename to be different from the input\nfilename.\n<br>&nbsp;<br>\nThe graphics formats supported by <strong>mogrify</strong> are listed in\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mog-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo convert all the TIFF files in a particular directory to JPEG, use:\n<pre>\n    gm mogrify -format jpeg *.tiff\n</pre>\n<p>\nTo convert a directory full of JPEG images to thumbnails, use:\n<pre>\n    gm mogrify -size 120x120 *.jpg -resize 120x120 +profile \"*\"\n</pre>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"             cellpadding=\"8\">             <tr><td width=\"6%\"><br></td><td><font size=\"-1\">\nIn this example, <tt>'-size 120x120'</tt> gives a hint to the JPEG decoder\nthat the images are going to be downscaled to 120x120, allowing it to run\nfaster by avoiding returning full-resolution images to GraphicsMagick for\nthe subsequent resizing operation.  The\n<tt>'-resize 120x120'</tt> specifies the desired dimensions of the\noutput images.  It will be scaled so its largest dimension is 120 pixels.  The\n<tt>'+profile \"*\"'</tt> removes any ICM, EXIF, IPTC, or other profiles\nthat might be present in the input and aren't needed in the thumbnails.</font></td></tr></table>\n<p>\nTo scale an image of a cockatoo to exactly 640 pixels in width and 480\npixels in height, use: \n<pre>\n    gm mogrify -resize 640x480! cockatoo.miff\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mog-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images that follows,\nuntil the set is terminated by the appearance of any option or <strong>-noop</strong>.\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-affine\">-affine</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>drawing transform matrix</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-antialias\">-antialias</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixel aliasing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details\"></a> <i>-asc-cdl &lt;spec&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply ASC CDL color transform</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-auto-orient\">-auto-orient</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>orient (rotate) image so it is upright</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-black-threshold\">-black-threshold</a> <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels below the threshold become black</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blue-primary\">-blue-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blur\">-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-border\">-border</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with a border of color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-channel\">-channel</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of channel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -charcoal <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate a charcoal drawing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorize\">-colorize</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colorize the image with the pen color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compose\">-compose</a> <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-contrast\">-contrast</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enhance or reduce the image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-convolve\">-convolve</a> <i>&lt;kernel&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>convolve image with the specified convolution kernel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-create-directories\">-create-directories</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create output directory if required</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-cycle\">-cycle</a> <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image colormap by amount</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-delay\">-delay</a> <i>&lt;1/100ths of a second&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>display the next image after pausing</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -despeckle\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>reduce the speckles within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-draw\">-draw</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with one or more graphic primitives</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -edge <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>detect edges within an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -emboss <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>emboss an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -enhance\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a digital filter to enhance a noisy image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -equalize\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform histogram equalization to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-extent\">-extent</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite image on background color canvas image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fill\">-fill</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flip\">-flip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-flop\">-flop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>create a \"mirror image\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-format\">-format</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image format type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-frame\">-frame</a> <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fuzz\">-fuzz</a> <i>&lt;distance&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>colors within this Euclidean distance are considered equal</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gaussian\">-gaussian</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gravity\">-gravity</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-green-primary\">-green-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -hald-clut <i>&lt;clut&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a Hald CLUT to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -implode <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>implode image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-lat\">-lat</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;offset&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>perform local adaptive thresholding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-level\">-level</a> <i>&lt;black_point&gt;</i>{<i>,&lt;gamma&gt;</i>}<i></i>{<i>,&lt;white_point&gt;</i>}<i></i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>adjust the level of image contrast</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -linewidth\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the line width for subsequent draw operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-list\">-list</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of list</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-loop\">-loop</a> <i>&lt;iterations&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add Netscape loop extension to your GIF animation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -magnify\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>magnify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-map\">-map</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>choose a particular set of colors from this image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mask\">-mask</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify a clipping mask</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -median <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a median filter to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -minify <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>minify the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-modulate\">-modulate</a> <i>brightness[,saturation[,hue]]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>vary the brightness, saturation, and hue of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-motion-blur\">-motion-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+angle</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Simulate motion blur</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-negate\">-negate</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>replace every pixel with its complementary color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noise\">-noise</a> <i>&lt;radius|type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add or reduce noise in an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-normalize\">-normalize</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform image to span the full range of color values</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-opaque\">-opaque</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>change this color to the pen color within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-operator\">-operator</a> <i>channel operator rvalue[%]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a mathematical, bitwise, or value operator to an image channel</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-ordered-dither\">-ordered-dither</a> <i>&lt;channeltype&gt; &lt;NxN&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>ordered dither the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-output-directory\">-output-directory</a> <i>&lt;directory&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>output files to directory</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-orient\">-orient</a> <i>&lt;orientation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Set the image orientation attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-paint\">-paint</a> <i>&lt;radius&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>simulate an oil painting</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pen\">-pen</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>(This option has been replaced by the -fill option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-profile\">-profile</a> <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add ICM, IPTC, or generic profile  to image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-preserve-timestamp\">-preserve-timestamp</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preserve the original timestamps of the file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-raise\">-raise</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>lighten or darken image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-random-threshold\">-random-threshold</a> <i>&lt;channeltype&gt; &lt;LOWxHIGH&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>random threshold the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-recolor\">-recolor</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply a color translation matrix to image channels</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-red-primary\">-red-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-region\">-region</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply options to a portion of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-render\">-render</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-repage\">-repage</a> <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resample\">-resample</a> <i>&lt;horizontal&gt;x&lt;vertical&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Resample image to specified horizontal and vertical resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-roll\">-roll</a> <i></i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>roll an image vertically or horizontally</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sample\">-sample</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale image using pixel sampling</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scale\">-scale</a> <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>scale the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scene\">-scene</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set scene number</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-set\">-set</a> <i>&lt;attribute&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details+set\">+set</a> <i>&lt;attribute&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>unset an image attribute</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-segment\">-segment</a> <i>&lt;cluster threshold&gt;x&lt;smoothing threshold&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>segment an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shade\">-shade</a> <i>&lt;azimuth&gt;x&lt;elevation&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shade the image using a distant light source</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shave\">-shave</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shave pixels from the image edges</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-shear\">-shear</a> <i>&lt;x degrees&gt;x&lt;y degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shear the image along the X or Y axis</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-solarize\">-solarize</a> <i>&lt;factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>negate all pixels above the threshold level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-spread\">-spread</a> <i>&lt;amount&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>displace image pixels by a random amount</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strip\">-strip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stroke\">-stroke</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when stroking a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strokewidth\">-strokewidth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the stroke width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-swirl\">-swirl</a> <i>&lt;degrees&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>swirl image pixels about the center</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-threshold\">-threshold</a> <i>&lt;value&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>threshold the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tile image when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transform\">-transform</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transparent\">-transparent</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-units\">-units</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the units of image resolution</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-unsharp\">-unsharp</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>{<i>+&lt;amount&gt;</i>}<i></i>{<i>+&lt;threshold&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image with an unsharp mask operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -view <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>FlashPix viewing parameters</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-virtual-pixel\">-virtual-pixel</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify contents of \"virtual pixels\"</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-wave\">-wave</a> <i>&lt;amplitude&gt;x&lt;wavelength&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>alter an image along a sine wave</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-point\">-white-point</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-threshold\">-white-threshold</a> <i>red[,green][,blue][,opacity]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pixels above the threshold become white</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/montage.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"montage\"></a>gm montage\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nmontage - create a composite image by combining several separate images\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#mont-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#mont-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#mont-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#mont-opti\">Options</a>\n</dt>\n<dt>\n<a href=\"#mont-xres\">X Resources</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm montage</strong> <strong>[</strong> <em>options</em> <strong>...]</strong> <em>file</em> <strong>[ [</strong>\n<em>options</em> <strong>...]</strong> <em>file</em> <strong>...]</strong> <em>output_file</em>\n<br>&nbsp;<br>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>montage</strong> creates a composite image by combining several separate\nimages. The images are tiled on the composite image with the name of the\nimage optionally appearing just below the individual tile.\n<p>\nThe composite image is constructed in the following manner. First, each\nimage specified on the command line, except for the last, is scaled to\nfit the maximum tile size. The maximum tile size by default is 120x120.\nIt can be modified with the <strong>-geometry</strong> command line argument or X\nresource. See\n<strong><a href=\"#mont-opti\">Options</a></strong>\nfor more information on command line arguments. See\n<strong>X(1)</strong> for more information on X resources.\nNote that the maximum tile size need not be a square.\n<p>\nNext the composite image is initialized with the color specified by the\n<strong>-background</strong>\ncommand line argument or X resource. The width and height of the composite\nimage is determined by the title specified, the maximum tile size, the\nnumber of tiles per row, the tile border width and height, the image border\nwidth, and the label height. The number of tiles per row specifies how\nmany images are to appear in each row of the composite image. The default\nis to have 5 tiles in each row and 4 tiles in each column of the composite.\nA specific value is specified with <strong>-tile</strong>. The tile border width\nand height, and the image border width defaults to the value of the X resource\n<strong>-borderwidth</strong>. It can be changed with the <strong>-borderwidth</strong> or\n<strong>-geometry</strong> command line argument or X resource. The label height\nis determined by the font you specify with the <strong>-font</strong> command line\nargument or X resource. If you do not specify a font, a font is chosen\nthat allows the name of the image to fit the maximum width of a tiled area.\nThe label colors is determined by the <strong>-background</strong> and <strong>-fill</strong>\ncommand line argument or X resource. Note, that if the background and pen\ncolors are the same, labels will not appear.\n<p>\nInitially, the composite image title is placed at the top if one is specified\n(refer to <strong>-fill</strong>). Next, each image is set onto the composite image,\nsurrounded by its border color, with its name centered just below it. The\nindividual images are left-justified within the width of the tiled area.\nThe order of the images is the same as they appear on the command line\nunless the images have a scene keyword. If a scene number is specified\nin each image, then the images are tiled onto the composite in the order\nof their scene number. Finally, the last argument on the command line is\nthe name assigned to the composite image. By default, the image is written\nin the <strong>MIFF</strong> format and can be viewed or printed with\n<a href=\"display.html\"><em>display(1)</em></a>.\n<br>&nbsp;<br>\n<p>\nNote, that if the number of tiles exceeds the default number of 20 (5 per\nrow, 4 per column), more than one composite image is created. To ensure\na single image is produced, use <strong>-tile</strong> to increase the number of\ntiles to meet or exceed the number of input images.\n<p>\nFinally, to create one or more empty spaces in the sequence of tiles, use\nthe <strong>\"NULL:\"</strong> image format.\n<p>\nNote, a composite MIFF image displayed to an X server with\n<strong>display</strong>\nbehaves differently than other images. You can think of the composite as\na visual image directory. Choose a particular tile of the composite and\npress a button to display it. See <strong>display(1)</strong> and <strong>miff(5)</strong>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nTo create a montage of a cockatoo, a parrot, and a hummingbird and write\nit to a file called birds, use:\n<pre>\n    gm montage cockatoo.miff parrot.miff hummingbird.miff birds.miff\n</pre>\n<p>\nTo tile several bird images so that they are at most 256 pixels in width\nand 192 pixels in height, surrounded by a red border, and separated by\n10 pixels of background color, use:\n<pre>\n    gm montage -geometry 256x192+10+10 -bordercolor red birds.* montage.miff\n</pre>\n<p>\nTo create an unlabeled parrot image, 640 by 480 pixels, and surrounded\nby a border of black, use:\n<pre>\n    gm montage -geometry 640x480 -bordercolor black -label \"\" parrot.miff\nbird.miff\n</pre>\n<p>\nTo create an image of an eagle with a textured background, use:\n<pre>\n    gm montage -texture bumps.jpg eagle.jpg eagle.png\n</pre>\n<p>\nTo join several GIF images together without any extraneous graphics (e.g.\nno label, no shadowing, no surrounding tile frame), use:\n<pre>\n    gm montage +frame +shadow +label -tile 5x1 -geometry 50x50+0+0 *.png joined.png\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\nAny option you specify on the command line remains in effect for the group\nof images following it, until the group is terminated by the appearance of\nany option or <strong>-noop</strong>.  For example, to make a montage of three images,\nthe first with 32 colors, the second with an unlimited number of colors, and\nthe third with only 16 colors, use:\n<br>&nbsp;<br>\n<pre>\n    gm montage -colors 32 cockatoo.1 -noop cockatoo.2 -colors 16 cockatoo.3\ncockatoos.miff\n</pre>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-adjoin\">-adjoin</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>join images into a single multi-image file</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-affine\">-affine</a> <i>&lt;matrix&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>drawing transform matrix</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-authenticate\">-authenticate</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>decrypt image with this password</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-background\">-background</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the background color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blue-primary\">-blue-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blue chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-blur\">-blur</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>blur the image with a Gaussian operator</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-bordercolor\">-bordercolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border color</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -borderwidth <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the border width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-chop\">-chop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove pixels from the interior of an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colors\">-colors</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred number of colors in the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-colorspace\">-colorspace</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of colorspace</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-comment\">-comment</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with a comment</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compose\">-compose</a> <i>&lt;operator&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image composition</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-compress\">-compress</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of image compression</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-crop\">-crop</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>preferred size and location of the cropped image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -debug <i>&lt;events&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>enable debug printout</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-define\">-define</a> <i>&lt;key&gt;</i>{<i>=&lt;value&gt;</i>}<i>,...</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>add coder/decoder specific options</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-density\">-density</a> <i>&lt;width&gt;x&lt;height&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>horizontal and vertical resolution in pixels of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-depth\">-depth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>depth of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-display\">-display</a> <i>&lt;host:display[.screen]&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specifies the X server to contact</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dispose\">-dispose</a> <i>&lt;method&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>GIF disposal method</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-dither\">-dither</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>apply Floyd/Steinberg error diffusion to the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-draw\">-draw</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>annotate an image with one or more graphic primitives</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-encoding\">-encoding</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the text encoding</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-endian\">-endian</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify endianness (MSB, LSB, or Native) of image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-fill\">-fill</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when filling a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-filter\">-filter</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this type of filter when resizing an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-font\">-font</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>use this font when annotating the image with text</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-frame\">-frame</a> <i>&lt;width&gt;x&lt;height&gt;+&lt;outer bevel width&gt;+&lt;inner bevel width&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>surround the image with an ornamental border</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gamma\">-gamma</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>level of gamma correction</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-geometry\">-geometry</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>^</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify dimension, offset, and resize options.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-gravity\">-gravity</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>direction primitive  gravitates to when annotating the image.</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-green-primary\">-green-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>green chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -help\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print usage instructions</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-interlace\">-interlace</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the type of interlacing scheme</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-label\">-label</a> <i>&lt;name&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign a label to an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-limit\">-limit</a> <i>&lt;type&gt; &lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Disk, File, Map, Memory, Pixels, Width, Height or Threads resource limit</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-log\">-log</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Specify format for debug log</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-matte\">-matte</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>store matte channel if the image has one</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-mattecolor\">-mattecolor</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>specify the color to be used with the <strong>-frame</strong> option</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -mode <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>mode of operation</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monitor\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>show progress indication</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -monochrome\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image to black and white</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-noop\">-noop</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>NOOP (no option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-page\">-page</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+-</i>}<i>&lt;x&gt;</i>{<i>+-</i>}<i>&lt;y&gt;</i>{<i>%</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>size and location of an image canvas</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-pen\">-pen</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>(This option has been replaced by the -fill option)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -pointsize <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>pointsize of the PostScript, X11, or TrueType font</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-quality\">-quality</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>JPEG/MIFF/PNG/TIFF compression level</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-red-primary\">-red-primary</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>red chromaticity primary point</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-render\">-render</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>render vector operations</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-repage\">-repage</a> <i> &lt;width&gt;x&lt;height&gt;+xoff+yoff[!]</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>Adjust image page offsets</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-resize\">-resize</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-rotate\">-rotate</a> <i>&lt;degrees&gt;</i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>rotate the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sampling-factor\">-sampling-factor</a> <i>&lt;horizontal_factor&gt;x&lt;vertical_factor&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chroma subsampling factors</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-scenes\">-scenes</a> <i>&lt;value-value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>range of image scene numbers to read</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -shadow <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>shadow the montage</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-sharpen\">-sharpen</a> <i>&lt;radius&gt;</i>{<i>x&lt;sigma&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>sharpen the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-size\">-size</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>+offset</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>width and height of the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strip\">-strip</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>remove all profiles and text attributes from the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-stroke\">-stroke</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color to use when stroking a graphic primitive</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-strokewidth\">-strokewidth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>set the stroke width</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -texture <i>&lt;filename&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>name of texture to tile onto the image background</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-thumbnail\">-thumbnail</a> <i>&lt;width&gt;x&lt;height&gt;</i>{<i>%</i>}<i></i>{<i>@</i>}<i></i>{<i>!</i>}<i></i>{<i>&lt;</i>}<i></i>{<i>&gt;</i>}<i></i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>resize an image (quickly)</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    -tile <i>&lt;geometry&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>layout of images [<em>montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-title\">-title</a> <i>&lt;string&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>assign title to displayed image [<em>animate, display, montage</em>]</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transform\">-transform</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>transform the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-transparent\">-transparent</a> <i>&lt;color&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>make this color transparent within the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-treedepth\">-treedepth</a> <i>&lt;value&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>tree depth for the color reduction algorithm</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-trim\">-trim</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>trim an image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-type\">-type</a> <i>&lt;type&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>the image type</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-verbose\">-verbose</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print detailed information about the image</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-version\">-version</a>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>print GraphicsMagick version string</td></tr></table>\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    <a href=\"GraphicsMagick.html#details-white-point\">-white-point</a> <i>&lt;x&gt;,&lt;y&gt;</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>chromaticity white point</td></tr></table>\n<p>\nFor a more detailed description of each option, see\nOptions, above.\n<a href=\"GraphicsMagick.html\"><em>GraphicsMagick(1)</em></a>.\n<br>&nbsp;<br>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"mont-xres\"></a>X Resources\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>Montage</strong> options can appear on the command line or in your X resource\nfile. Options on the command line supersede values specified in your X\nresource file. See <strong>X(1)</strong> for more information on X resources.\n<p>\nAll <strong>montage</strong> options have a corresponding X resource. In addition,\n<strong>montage</strong>\nuses the following X resources:\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    background <i>(class Background)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>background color</td></tr></table>\n<p>\nSpecifies the preferred color to use for the composite image background.\nThe default is #ccc.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    borderColor <i>(class BorderColor)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>border color</td></tr></table>\n<p>\nSpecifies the preferred color to use for the composite image border. The\ndefault is #ccc.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    borderWidth <i>(class BorderWidth)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>border width</td></tr></table>\n<p>\nSpecifies the width in pixels of the composite image border. The default\nis 2.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    font <i>(class Font)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>font to use</td></tr></table>\n<p>\nSpecifies the name of the preferred font to use when displaying text within\nthe composite image. The default is 9x15, fixed, or 5x8 determined by the\ncomposite image size.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    matteColor <i>(class MatteColor)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>color of the frame</td></tr></table>\n<p>\nSpecify the color of an image frame. A 3D effect is achieved by using highlight\nand shadow colors derived from this color. The default value is #697B8F.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    pen <i>(class Pen)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>text color</td></tr></table>\n<p>\nSpecifies the preferred color to use for text within the composite image.\nThe default is black.\n<table BORDER=0 WIDTH=\"94%\">\n<tr>\n<td width=\"3%\"><br></td> \n<td ALIGN=LEFT BGCOLOR=\"#FFFFFF\">\n<img SRC=\"images/right_triangle_option.png\"\nALT=\">\" BORDER=0 height=14\nwidth=15><b><font face=\"Helvetica, Arial\"\n><font color=\"#00B04F\"><font size=\"+1\">\n    title <i>(class Title)</i>\n</font></font></font></b></td></tr></table>\n<table width=\"90%\" border=\"0\" cellspacing=\"0\"              cellpadding=\"8\">              <tr><td width=\"6%\"><br></td><td>composite image title</td></tr></table>\n<p>\nThis resource specifies the title to be placed at the top of the composite\nimage. The default is not to place a title at the top of the composite\nimage.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/motion-picture.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Cineon and SMTPE DPX Support</title>\n<meta content=\"Describes GraphicsMagick's support for Cineon and SMPTE DPX formats. \" name=\"description\" />\n<meta content=\"GraphicsMagick, Cineon, DPX, SMPTE 268M, Motion Picture\" name=\"keywords\" />\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-cineon-and-smtpe-dpx-support\">\n<h1 class=\"title\">GraphicsMagick Cineon and SMTPE DPX Support</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#introduction\" id=\"id1\">Introduction</a></li>\n<li><a class=\"reference internal\" href=\"#applications\" id=\"id2\">Applications</a></li>\n<li><a class=\"reference internal\" href=\"#dpx-features\" id=\"id3\">DPX features</a><ul>\n<li><a class=\"reference internal\" href=\"#basic\" id=\"id4\">Basic</a></li>\n<li><a class=\"reference internal\" href=\"#colorspaces\" id=\"id5\">Colorspaces</a></li>\n<li><a class=\"reference internal\" href=\"#storage\" id=\"id6\">Storage</a></li>\n<li><a class=\"reference internal\" href=\"#yet-to-be-supported\" id=\"id7\">Yet to be supported</a></li>\n</ul>\n</li>\n<li><a class=\"reference internal\" href=\"#using-graphicsmagick\" id=\"id8\">Using GraphicsMagick</a><ul>\n<li><a class=\"reference internal\" href=\"#image-resize\" id=\"id9\">Image Resize</a></li>\n<li><a class=\"reference internal\" href=\"#annotate-image\" id=\"id10\">Annotate Image</a></li>\n<li><a class=\"reference internal\" href=\"#colorspace-transformation\" id=\"id11\">Colorspace Transformation</a></li>\n<li><a class=\"reference internal\" href=\"#modifying-an-image-in-place\" id=\"id12\">Modifying An Image In-Place</a></li>\n<li><a class=\"reference internal\" href=\"#creating-a-contact-sheet\" id=\"id13\">Creating A Contact Sheet</a></li>\n<li><a class=\"reference internal\" href=\"#animating-a-sequence\" id=\"id14\">Animating A Sequence</a></li>\n<li><a class=\"reference internal\" href=\"#displaying-one-image-frame\" id=\"id15\">Displaying One Image Frame</a></li>\n<li><a class=\"reference internal\" href=\"#viewing-a-sequence\" id=\"id16\">Viewing A Sequence</a></li>\n<li><a class=\"reference internal\" href=\"#using-the-batch-capability\" id=\"id17\">Using the Batch capability</a></li>\n</ul>\n</li>\n<li><a class=\"reference internal\" href=\"#options-and-attributes\" id=\"id18\">Options And Attributes</a><ul>\n<li><a class=\"reference internal\" href=\"#command-options\" id=\"id19\">Command options</a></li>\n<li><a class=\"reference internal\" href=\"#dpx-attributes\" id=\"id20\">DPX Attributes</a></li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"section\" id=\"introduction\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Introduction</a></h1>\n<p>GraphicsMagick supports legacy Legacy 10-bit Kodak Cineon format as\nwell as high-grade support for <a class=\"reference external\" href=\"http://www.smpte.org/\">SMPTE</a> DPX Version 2.0 (<a class=\"reference external\" href=\"http://www.smpte.org/\">SMPTE</a>\n268M-2003).  SMPTE DPX RGB and YCbCr colorspaces are supported.  The\nDPX implementation supports 8, 10, 12, and 16 bits/sample and any\narbitrary image pixel size.  The Cineon implementation supports 8 and\n10 bits/sample.</p>\n<p>Film images are usually captured at <em>2K</em> resolution (82 pixels/mm),\n<em>4K</em> resolution (164 pixels/mm), or even <em>8K</em> resolution (328\npixels/mm), where the actual resolution values approximate the\nhorizontal dimension of the image. A table of <a class=\"reference external\" href=\"http://www.surrealroad.com/digital/index.php/archives/2005/standard-data-resolutions/\">typical pixel\nresolutions</a> for various film sizes may be found on the <a class=\"reference external\" href=\"http://blog.surrealroad.com//\">Surreal\nRoad</a> site (table reproduced here for convenience). File sizes may be\nquite large and range in size from 8MB to as much as 180MB. The common\n10-bit <em>2K</em> format consumes 12MB of disk while a 10-bit <em>4K</em> scan\nconsumes 50MB of disk.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Standard data resolutions</caption>\n<colgroup>\n<col width=\"57%\" />\n<col width=\"13%\" />\n<col width=\"18%\" />\n<col width=\"13%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Format</th>\n<th class=\"head\">Picture\naspect\nratio</th>\n<th class=\"head\">Standard\npixel\nresolution</th>\n<th class=\"head\">Pixel\naspect\nratio</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td>Apple iPod video</td>\n<td class=\"decimal\">1.33</td>\n<td>320×240</td>\n<td class=\"decimal\">1.0</td>\n</tr>\n<tr><td>Apple iPhone video</td>\n<td class=\"decimal\">1.5</td>\n<td>480×320</td>\n<td class=\"decimal\">1.0</td>\n</tr>\n<tr><td>Sony PlayStationPortable</td>\n<td class=\"decimal\">1.76</td>\n<td>480×272</td>\n<td class=\"decimal\">1.0</td>\n</tr>\n<tr><td>SD video (PAL, DV)</td>\n<td class=\"decimal\">1.33</td>\n<td>720×576</td>\n<td class=\"decimal\">1.067</td>\n</tr>\n<tr><td>SD video (NTSC, DV)</td>\n<td class=\"decimal\">1.33</td>\n<td>720×486</td>\n<td class=\"decimal\">0.9</td>\n</tr>\n<tr><td>SD video (PAL, square pixels)</td>\n<td class=\"decimal\">1.33</td>\n<td>768×576</td>\n<td class=\"decimal\">1.0</td>\n</tr>\n<tr><td>SD video (NTSC, square pixels)</td>\n<td class=\"decimal\">1.33</td>\n<td>648×486</td>\n<td class=\"decimal\">1.0</td>\n</tr>\n<tr><td>DVD video (NTSC, 4:3)</td>\n<td class=\"decimal\">1.33</td>\n<td>720×480</td>\n<td class=\"decimal\">0.9</td>\n</tr>\n<tr><td>DVD video (PAL, 4:3)</td>\n<td class=\"decimal\">1.33</td>\n<td>720×576</td>\n<td class=\"decimal\">1.067</td>\n</tr>\n<tr><td>DVD video (NTSC, 16:9)</td>\n<td class=\"decimal\">1.78</td>\n<td>720×480</td>\n<td class=\"decimal\">1.185</td>\n</tr>\n<tr><td>DVD video (PAL, 16:9)</td>\n<td class=\"decimal\">1.78</td>\n<td>720×576</td>\n<td class=\"decimal\">1.69</td>\n</tr>\n<tr><td>Blu-ray</td>\n<td class=\"decimal\">1.78</td>\n<td>1920×1080</td>\n<td class=\"decimal\">1.0</td>\n</tr>\n<tr><td>HD video &#64;720</td>\n<td class=\"decimal\">1.78</td>\n<td>1280×720</td>\n<td class=\"decimal\">1.0</td>\n</tr>\n<tr><td>HD video &#64;1080 (certain types)</td>\n<td class=\"decimal\">1.78</td>\n<td>1440×1080</td>\n<td class=\"decimal\">1.33</td>\n</tr>\n<tr><td>HD video &#64;1080</td>\n<td class=\"decimal\">1.78</td>\n<td>1920×1080</td>\n<td class=\"decimal\">1.0</td>\n</tr>\n<tr><td>DVC Pro HD &#64;59.94i</td>\n<td class=\"decimal\">1.78</td>\n<td>1280×1080</td>\n<td class=\"decimal\">1.5</td>\n</tr>\n<tr><td>16mm</td>\n<td class=\"decimal\">1.37</td>\n<td>1712×1240</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>Super-16</td>\n<td class=\"decimal\">1.65</td>\n<td>2048×1240</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>“Academy” aperture (2k)</td>\n<td class=\"decimal\">1.37</td>\n<td>1828×1332</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>“Academy” aperture (4k)</td>\n<td class=\"decimal\">1.37</td>\n<td>3656×2664</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>Cinemascope (Squeezed, 2k)</td>\n<td class=\"decimal\">2.35</td>\n<td>1828×1556</td>\n<td class=\"decimal\">2.00</td>\n</tr>\n<tr><td>Cinemascope (Squeezed, 4k)</td>\n<td class=\"decimal\">2.35</td>\n<td>3656×2664</td>\n<td class=\"decimal\">2.00</td>\n</tr>\n<tr><td>Cinemascope (Unsqueezed, 2k)</td>\n<td class=\"decimal\">2.35</td>\n<td>2048×872</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>Cinemascope (Unsqueezed, 4k)</td>\n<td class=\"decimal\">2.35</td>\n<td>3656×1556</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>Full Aperture (2k)</td>\n<td class=\"decimal\">1.33</td>\n<td>2048×1556</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>Full Aperture (4k)</td>\n<td class=\"decimal\">1.33</td>\n<td>4096×3112</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>8-perf “VistaVision” (3k)</td>\n<td class=\"decimal\">1.5</td>\n<td>3072×2048</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>8-perf “VistaVision” (6k)</td>\n<td class=\"decimal\">1.5</td>\n<td>6144×4096</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>Red (16:9, 4k)</td>\n<td class=\"decimal\">1.78</td>\n<td>4096×2304</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>Red (2:1, 4k)</td>\n<td class=\"decimal\">2.0</td>\n<td>4096×2048</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>Digital Cinema (2k)</td>\n<td class=\"decimal\">1.9</td>\n<td>2048×1080</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>Digital Cinema (4k)</td>\n<td class=\"decimal\">1.9</td>\n<td>4096×2160</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>UHDTV (&quot;4k&quot;)</td>\n<td class=\"decimal\">1.78</td>\n<td>3840×2160</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n<tr><td>UHDTV (&quot;8k&quot;)</td>\n<td class=\"decimal\">1.78</td>\n<td>7860×4320</td>\n<td class=\"decimal\">1.00</td>\n</tr>\n</tbody>\n</table>\n</div>\n<div class=\"section\" id=\"applications\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Applications</a></h1>\n<p>The strength of GraphicsMagick versus specialized proprietary software\nare its cost (absolutely free!), open source availability (user is\nable to fix software flaws or tailor software to meet specific needs),\ngeneral purpose image processing capabilities, deep image capabilities\n(up to 32-bits per sample), excellent performance, platform\nindependence, lack of encumbering usage licenses, and robust\nimplementation. Examples of areas where GraphicsMagick may be used\nare:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>View the image on a display.</li>\n<li>Scaling (for example, <em>4K</em> to <em>2K</em> or 1920x1080 HD with excellent quality)</li>\n<li>Cropping</li>\n<li>Rotation</li>\n<li>Filtering</li>\n<li>ICC ICM profile-based color management and transformations</li>\n<li>Gamma adjustment</li>\n<li>Color adjustment</li>\n<li>Conversion to grayscale</li>\n<li>Text annotations</li>\n<li>Compositions</li>\n<li>Drawing on images (for example drawing markers on image)</li>\n<li>Conversion to and from other formats (e.g. Kodak Cineon, TIFF, JPEG, SGI,\nPostscript, PNG, and PNM)</li>\n</ul>\n</blockquote>\n<p>GraphicsMagick's DPX file format support is very comprehensive. It\ngoes beyond the DPX format support in other applications by striving\nto implement the complete DPX specification rather than just a few\ncommonly used sub-formats. The capabilities of GraphicsMagick's DPX\nsupport are as follows:</p>\n</div>\n<div class=\"section\" id=\"dpx-features\">\n<h1><a class=\"toc-backref\" href=\"#id3\">DPX features</a></h1>\n<div class=\"section\" id=\"basic\">\n<h2><a class=\"toc-backref\" href=\"#id4\">Basic</a></h2>\n<blockquote>\n<ul class=\"simple\">\n<li>Anything which can be read, can also be written.</li>\n<li>All DPX header information (including the user specific area) are\nstored as image attributes and restored when the image is written.</li>\n<li>Image source header information is updated appropriately.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"colorspaces\">\n<h2><a class=\"toc-backref\" href=\"#id5\">Colorspaces</a></h2>\n<blockquote>\n<ul class=\"simple\">\n<li>Linear RGB</li>\n<li>Cineon Log RGB (default density range = 2.048)</li>\n<li>Grayscale (Luma)</li>\n<li>Rec. 601 and Rec. 709 YCbCr (4:4:4 and 4:2:2). Below-black and\nabove-white values are clipped.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"storage\">\n<h2><a class=\"toc-backref\" href=\"#id6\">Storage</a></h2>\n<blockquote>\n<ul class=\"simple\">\n<li>Bits per sample of 1, 8, 10, 12, and 16.</li>\n<li>Packed, or fill type A or B for 10/12 bits.</li>\n<li>All RGB-oriented element types (R, G, B, A, RGB, RGBA, ABGR).</li>\n<li>YCbCr</li>\n<li>Planar (multi-element) storage fully supported.</li>\n<li>Alpha may be stored in a separate element.</li>\n<li>Big and little endian storage.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"yet-to-be-supported\">\n<h2><a class=\"toc-backref\" href=\"#id7\">Yet to be supported</a></h2>\n<blockquote>\n<ul class=\"simple\">\n<li>Composite video.</li>\n<li>Floating point formats (32 and 64 bits)</li>\n<li>Depth channel (not supportable within GraphicsMagick).</li>\n<li>Studio (reduced range) YCbCr and RGB.</li>\n</ul>\n</blockquote>\n<p>The software is written efficiently so the performance when reading\nand writing files is limited by the performance of the file I/O\nsubsystem.  The software is designed to avoid seeking while reading\nand writing so that files may be read and written over pipes, or via a\nuser provided file descriptor.</p>\n</div>\n</div>\n<div class=\"section\" id=\"using-graphicsmagick\">\n<h1><a class=\"toc-backref\" href=\"#id8\">Using GraphicsMagick</a></h1>\n<div class=\"section\" id=\"image-resize\">\n<h2><a class=\"toc-backref\" href=\"#id9\">Image Resize</a></h2>\n<p>GraphicsMagick is easy to use. The following is an example of scaling\na <em>4K</em> 16 bit scan to a <em>2K</em> <em>Academy</em> 10 bit image using the <a class=\"reference external\" href=\"convert.html\">convert</a>\ncommand:</p>\n<pre class=\"literal-block\">\ngm convert 4k.dpx -resize 1828x1556 -depth 10 2k.dpx\n</pre>\n<p>The above example uses the default resizing filters which are\noptimized for quality, but take longer than some other filters. The\n<em>box</em> resize filter provides reasonably good scaling in a reasonable\namount of time:</p>\n<pre class=\"literal-block\">\ngm convert 4k.dpx -filter box -resize 1828x1556 -depth 10 2k.dpx\n</pre>\n<p>The above example command takes about 4 seconds (on an Apple 2.5GHz G5\nPowerMac or Intel 2.4GHz Xeon) to down-convert from a 131MB <em>5K</em>\n(5232x4376) original 16-bit scan from a NorthLight scanner to a 11MB\n<em>2K</em> 10-bit working image. Operations on more typical <em>2K</em> images take\nabout a quarter of a second.</p>\n</div>\n<div class=\"section\" id=\"annotate-image\">\n<h2><a class=\"toc-backref\" href=\"#id10\">Annotate Image</a></h2>\n<p>The following example shows how GraphicsMagick's resize capability may\nbe combined with its powerful drawing capability to take a full size\nsource image and produce a smaller (720x576) version which includes\nthe image filename and timecode at the top of the image, and a logo\n<em>bug</em> image in the bottom right corner:</p>\n<pre class=\"literal-block\">\ngm convert infile.dpx -resize '720x576!' \\\n  -draw 'fill &quot;white&quot;;text-undercolor &quot;Blue&quot;;font &quot;Helvetica&quot;;font-size 18;\\\n     text 10,20 &quot;%f (%[DPX:tv.time.code])&quot;;image atop 500,400 0,0 &quot;gm-125x80t.png&quot;' \\\n  outfile.dpx\n</pre>\n<p>As may be seen, the argument to -draw can become extremely long, so to\nmake things easy, the drawing commands may be placed in a simple text\nfile and passed by reference to the draw comand:</p>\n<p>First lets check what we edited into our drawing command file:</p>\n<pre class=\"literal-block\">\n% cat drawcmd.txt\nfill &quot;white&quot;\ntext-undercolor &quot;Blue&quot;\nfont &quot;Helvetica&quot;\nfont-size 18\ntext 10,20 &quot;%f (%[DPX:tv.time.code])&quot;\nimage atop 500,400 &quot;0,0 &quot;gm-125x80t.png&quot;\n</pre>\n<p>and now we can apply it by passing the filename prefixed with a '&#64;' to the\n-draw command:</p>\n<pre class=\"literal-block\">\ngm convert infile.dpx -resize '720x576!' -draw '&#64;drawcmd.txt' outfile.dpx\n</pre>\n<p>The <tt class=\"docutils literal\">0,0</tt> in the image composition command argument says to use the\nimage as is. If the composited image should be automatically resized,\nthen simply replace the <tt class=\"docutils literal\">0,0</tt> with the desired size.</p>\n<p>There are a number of powerful scripting environments for\nGraphicsMagick. One of these is RMagick (Ruby language interface to\nGraphicsMagick). In Ruby, the same effect may be obtained via a script\nthat looks like:</p>\n<pre class=\"literal-block\">\n#! /usr/local/bin/ruby -w\nrequire 'RMagick'\ninclude Magick\nimg = Image.read('infile.dpx')[0]\nfrog = Image.read('gm-125x80t.png')[0]\ngc = Draw.new\ngc.fill('white')\ngc.text_undercolor(&quot;Blue&quot;)\ngc.font(&quot;Helvetica&quot;)\ngc.font_size(18)\ngc.text(10, 20, &quot;%f (%[DPX:tv.time.code])&quot;)\ngc.composite(500, 400, 0, 0, frog, AtopCompositeOp)\ngc.draw(img)\nimg.write('outfile.dpx')\n</pre>\n<p>In addition to Ruby, there are scripting interfaces for Perl, Python,\nTcl, and Ch (C-like scripting language).</p>\n</div>\n<div class=\"section\" id=\"colorspace-transformation\">\n<h2><a class=\"toc-backref\" href=\"#id11\">Colorspace Transformation</a></h2>\n<p>To convert an RGB file to a 4:2:2 YCbCr file in Rec 709 space:</p>\n<pre class=\"literal-block\">\ngm convert 2k.dpx -depth 10 -colorspace Rec709YCbCr -sampling-factor 4:2:2 2k-ycbcr.dpx\n</pre>\n</div>\n<div class=\"section\" id=\"modifying-an-image-in-place\">\n<h2><a class=\"toc-backref\" href=\"#id12\">Modifying An Image In-Place</a></h2>\n<p>Besides convert, which converts from one file to another, there is\n<a class=\"reference external\" href=\"mogrify.html\">mogrify</a> which transforms the file in place. A temporary file is used\n(if necessary) to ensure that the existing image file is not damaged\nif something goes wrong (e.g., not enough disk space). Note that\nunlike some applications supporting DPX/Cineon, when a file is modifed\n<em>in-place</em> , it is completely re-written.  While GraphicsMagick makes\nevery attempt to preserve header information, some previously existing\nfeatures of the file (such as the offset to the pixel data) may\nchange.</p>\n<p>A typical mogrify command is</p>\n<pre class=\"literal-block\">\ngm mogrify -resize 1828x1556 -depth 10 file-0001.dpx file-0002.dpx\n</pre>\n<p>Multiple files may be specified on the command line so the same\ncommand may process hundreds of files in one invocation.</p>\n<p>Unix users can use the find and xargs programs to perform operations\non any number of files:</p>\n<pre class=\"literal-block\">\nfind /assets/001 -name '*.dpx' -print | \\\n  xargs gm mogrify -resize 1828x1556 -depth 10\n</pre>\n<p>Xargs works by pasting as many file names as possible on the end of\nthe command provided to it.</p>\n<p>The GNU version of xargs provides an added benefit. It is able to run\nseveral commands in the background. This means that if your system has\nmultiple CPUs, it can take advantage of all the CPUs while still using\none command:</p>\n<pre class=\"literal-block\">\nfind /assets/001 -name '*.dpx' -print | \\\n  xargs --max-procs 3 --max-args 25 gm mogrify -resize 1828x1556 -depth 10\n</pre>\n<p>The mogrify command supports the -output-directory option to sent\nfiles to a different directory than the input files. This allows\nprocessing a large number of files without overwriting the input\nfiles:</p>\n<pre class=\"literal-block\">\nmkdir dest\ncd source\ngm mogrify -output-directory ../dest -resize 1828x1556 -depth 10 '*.dpx'\n</pre>\n<p>Note that the entire input file path specification is preserved when\ncomposing the output path so that the input file path is simply\nappended to the output directory path. Also, unless the\n-create-directories option is added, the user is responsible for\ncreating any necessary destination directories. As an example of the\npath composition algorithm, if the input file name is specified as\nsource/file.dpx and the output directory is specified as dest, then\nthe output file path will be dest/source/file.dpx.</p>\n<p>Here is an incantation which recursively processes all DPX files under\nsource and sends the result to a similar directory tree under dest.</p>\n<pre class=\"literal-block\">\nmkdir dest\ncd source\nfind . name '*.dpx' -print | xargs gm mogrify -output-directory ../dest \\\n  -create-directories -resize 1828x1556 -depth 10\n</pre>\n</div>\n<div class=\"section\" id=\"creating-a-contact-sheet\">\n<h2><a class=\"toc-backref\" href=\"#id13\">Creating A Contact Sheet</a></h2>\n<p>GraphicsMagick may be used to create a contact sheet (grid of\nthumbnails with name and size) by using the <em>VID</em> pseudoformat which\naccepts a wildcarded argument of files (protected by quotes!) to\nread. The output files are buffered while files are being read so\nthere is a practical limit to the number of files which may be\nprocessed at once. To output to a Postscript file:</p>\n<pre class=\"literal-block\">\ngm convert &quot;vid:*.dpx&quot; &quot;contact-sheet.ps&quot;\n</pre>\n<p>or to a PDF file:</p>\n<pre class=\"literal-block\">\ngm convert &quot;vid:*.dpx&quot; &quot;contact-sheet.pdf&quot;\n</pre>\n<p>or to a sequence of JPEG files ranging from contact-sheet-000.jpg to\ncontact-sheet-999.jpg:</p>\n<pre class=\"literal-block\">\ngm convert &quot;vid:*.dpx&quot; &quot;contact-sheet-%03d.jpg&quot;\n</pre>\n<p>or to a MIFF file which may be used to interactively browse the\noriginal files using 'gm display':</p>\n<pre class=\"literal-block\">\ngm convert &quot;vid:*.dpx&quot; &quot;contact-sheet.miff&quot;\n</pre>\n</div>\n<div class=\"section\" id=\"animating-a-sequence\">\n<h2><a class=\"toc-backref\" href=\"#id14\">Animating A Sequence</a></h2>\n<p>GraphicsMagick may be used to animate an image sequence on an X11\ndisplay using the <a class=\"reference external\" href=\"animate.html\">animate</a> subcommand. Frames are buffered in memory\n(pre-loaded into the X11 server) so the number of frames which may be\nanimated at once is limited. GraphicsMagick has been used to animate\n1080P (1920x1080) images at 24 frames per second with at least 300\nframes in the sequence.More frames may be buffered on 64-bit\nsystems. Many more frames may be animated by preparing a reduced set\nof frames in advance.</p>\n<p>To visualize an animation at 24 frames per second (delay (1/24)*100) use</p>\n<pre class=\"literal-block\">\ngm animate -delay 4.17 'Frame_*.dpx'\n</pre>\n<p>In order to obtain a preview of a larger sequence, and if the frames\nare numbered, a broader span of time may be animated by selecting\nevery 10^th frame (terminating with zero) to animate at 2.4 frames per\nsecond:</p>\n<pre class=\"literal-block\">\ngm animate -delay 41.7 'Frame_*0.dpx'\n</pre>\n</div>\n<div class=\"section\" id=\"displaying-one-image-frame\">\n<h2><a class=\"toc-backref\" href=\"#id15\">Displaying One Image Frame</a></h2>\n<p>An image frame may be displayed on an X11 server using the <a class=\"reference external\" href=\"display.html\">display</a>\nsubcommand. By default the name of the image file is displayed in the\ntitle bar. By specifying the format of the title, other useful\ninformation such as the time code (see the DPX Attributes section for\nmore details) may be included in the window title:</p>\n<pre class=\"literal-block\">\ngm display -title '%f (%[DPX:tv.time.code])' foo.dpx\n</pre>\n</div>\n<div class=\"section\" id=\"viewing-a-sequence\">\n<h2><a class=\"toc-backref\" href=\"#id16\">Viewing A Sequence</a></h2>\n<p>A sequence of images may be displayed on an X11 server using the\n<a class=\"reference external\" href=\"display.html\">display</a> subcommand. Unlike 'gm animate' there are no arbitrary limits\nwhen displaying a sequence this way. Unlike 'gm animate' the\ninter-frame delay can not be set to less than a second (100 ticks is\none second).</p>\n<pre class=\"literal-block\">\ngm display +progress -delay 100 'Frame_*.dpx'\n</pre>\n</div>\n<div class=\"section\" id=\"using-the-batch-capability\">\n<h2><a class=\"toc-backref\" href=\"#id17\">Using the Batch capability</a></h2>\n<p>A 'batch' command is provided (starting with the GraphicsMagick 1.3.18\nrelease) which supports executing an arbitrary number of\nGraphicsMagick commands from a file, or provided via standard input,\nwhile executing just one instance of GraphicsMagick.  This provides\nfor more efficiency and for use of GraphicsMagick as a co-process.  An\narbitrary script which produces the commands may continue to produce\nthe commands as GraphicsMagick executes them.  For example (Bourne\nshell script):</p>\n<pre class=\"literal-block\">\noutdir=outdir\nmkdir $outdir\nfind fromdir -name '*.dpx'| sort |\nwhile read infile\ndo\n    outfile=$outdir/`basename $infile`\n    echo time convert $infile -gaussian 0x1 $outfile\ndone | gm batch -\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"options-and-attributes\">\n<h1><a class=\"toc-backref\" href=\"#id18\">Options And Attributes</a></h1>\n<div class=\"section\" id=\"command-options\">\n<h2><a class=\"toc-backref\" href=\"#id19\">Command options</a></h2>\n<p>The following command options are particularly useful when dealing with\nDPX files:</p>\n<dl class=\"docutils\">\n<dt>-colorspace {CineonLog|RGB|Gray|Rec601Luma|Rec709Luma|Rec601YCbCr|Rec709YCbCr}</dt>\n<dd>Specifies the colorspace to be used when saving the DPX\nfile. CineonLog selects log encoding according to Kodak Cineon\nspecifications. RGB selects linear RGB encoding. Gray selects\nlinear gray encoding similar to RGB, but with a single\nchannel. Rec601Luma requests that RGB is converted to a gray image\nusing Rec601 Luma. Rec709Luma requests that RGB is converted to a\ngray image using Rec709Luma. Rec601YCbCr requests that the image\nis saved as YCbCr according to Rec601 (SDTV)\nspecifications. Rec709CbCr requests that the image is saved as\nYCbCr according to Rec709 (HDTV) specifications.</dd>\n<dt>-endian {lsb|msb}</dt>\n<dd>Specifies the endian order to use when writing the DPX\nfile. GraphicsMagick writes big-endian DPX files by default since\nthey are the most portable.  Other implementations may use the\nnative order of the host CPU (e.g.  little-endian when using an\nIntel 'x86 CPU).</dd>\n<dt>-depth &lt;value&gt;</dt>\n<dd>Specifies the number of bits to preserve in a color sample. By\ndefault the output file is written with the same number of bits as\nthe input file. For example, if the input file is 16 bits, it may\nbe reduced to 10 bits via '-depth 10'.</dd>\n<dt>-define dpx:bits-per-sample=&lt;value&gt;</dt>\n<dd>If the dpx:bits-per-sample key is defined, GraphicsMagick will\nwrite DPX images with the specified bits per sample, overriding\nany existing depth value. If this option is not specified, then\nthe value is based on the existing image depth value from the\noriginal image file. The DPX standard supports bits per sample\nvalues of 1, 8, 10, 12, and 16. Many DPX readers demand a sample\nsize of 10 bits with type A padding (see below).</dd>\n<dt>-define dpx:colorspace={rgb|cineonlog}</dt>\n<dd>Use the dpx:colorspace option when reading a DPX file to specify\nthe colorspace the DPX file uses. This overrides the colorspace\ntype implied by the DPX header (if any). Currently files with the\ntransfer characteristic Printing Density are assumed to be log\nencoded density while files marked as Linear are assumed to be\nlinear. Hint: use <tt class=\"docutils literal\"><span class=\"pre\">-define</span> dpx:colorspace=rgb</tt> in order to avoid\nthe log to linear transformation for DPX files which use Printing\nDensity.</dd>\n<dt>-define dpx:packing-method={packed|a|b|lsbpad|msbpad}</dt>\n<dd>DPX samples may be output within 32-bit words. They may be tightly\npacked end-to-end within the words (&quot;packed&quot;), padded with null\nbits to the right of the sample (&quot;a&quot; or &quot;lsbpad&quot;), or padded with\nnull bits to the left of the sample (&quot;b&quot; or &quot;msbpad&quot;). This option\nonly has an effect for sample sizes of 10 or 12 bits. If samples\nare not packed, the DPX standard recommends type A padding. Many\nDPX readers demand a sample size of 10 bits with type A padding.</dd>\n<dt>-define dpx:pixel-endian={lsb|msb}</dt>\n<dd>DPX pixels should use the endian order that the DPX header\nspecifies.  Sometimes there is a mis-match and the pixels use a\ndifferent endian order than the file header specifies. For\nexample, the file header may specify little endian, but the pixels\nare in big-endian order. To work around that use -define\ndpx-pixel-endian=msb when reading the file. Likewise, this option\nmay be used to intentionally write the pixels using a different\norder than the header.</dd>\n<dt>-define dpx:swap-samples={true|false}</dt>\n<dd>GraphicsMagick strives to adhere to the DPX standard but certain\naspects of the standard can be quite confusing. As a result, some\n10-bit DPX files have Red and Blue interchanged, or Cb and Cr\ninterchanged due to an different interpretation of the standard,\nor getting the wires crossed. The swap-samples option may be\nsupplied when reading or writing in order to read or write using\nthe necessary sample order.</dd>\n<dt>-interlace plane</dt>\n<dd>By default, samples are stored contiguously in a single element\nwhen possible. Specifying '-interlace plane' causes each sample\ntype (e.g.  'red') to be stored in its own image element. Planar\nstorage is fully supported for grayscale (with alpha) and RGB. For\nYCbCr, chroma must be 4:2:2 subsampled in order to use planar\nstorage. While planar storage offers a number of benefits, it\nseems that very few DPX-supporting applications support it.</dd>\n<dt>-sampling-factor 4:2:2</dt>\n<dd>Select 4:2:2subsampling when saving an image in YCbCr\nformat. Subsampling is handled via a general-purpose image resize\nalgorithm (lanczos) rather than a dedicated filter so subsampling\nis slow (but good).</dd>\n<dt>-set reference-white &lt;value&gt;</dt>\n<dd>Set the 90% white card level (default 685) for Cineon Log.</dd>\n<dt>-set reference-black &lt;value&gt;</dt>\n<dd>Set the 1% black card level (default 95) for Cineon Log.</dd>\n<dt>-set display-gamma &lt;value&gt;</dt>\n<dd>Set the display gamma (default 1.7) for Cineon Log.</dd>\n<dt>-set film-gamma &lt;value&gt;</dt>\n<dd>Set the film gamma (default 0.6) for Cineon Log.</dd>\n<dt>-set soft-clip-offset &lt;value&gt;</dt>\n<dd>Set the soft clip offset (default 0) when converting to <em>computer</em> RGB from\nCineon Log.</dd>\n</dl>\n</div>\n<div class=\"section\" id=\"dpx-attributes\">\n<h2><a class=\"toc-backref\" href=\"#id20\">DPX Attributes</a></h2>\n<p>GraphicsMagick provides almost full access to DPX header\nattributes. DPX header attributes are shown in the output of 'gm\nidentify -verbose' and may be set using the -define syntax\n(e.g. '-define dpx:mp.frame.position=2000') on the command line in\norder to add a value, or override an existing value. The attributes in\nthe list below may be viewed or updated. The names are similar to the\nattribute descriptions from the DPX standard.</p>\n<pre class=\"literal-block\">\ndpx:file.copyright\ndpx:file.creation.datetime\ndpx:file.creator\ndpx:file.encryption.key\ndpx:file.filename\ndpx:file.project.name\ndpx:file.version\ndpx:image.orientation\ndpx:mp.count\ndpx:mp.film.manufacturer.id\ndpx:mp.film.type\ndpx:mp.format\ndpx:mp.frame.id\ndpx:mp.frame.position\ndpx:mp.frame.rate\ndpx:mp.held.count\ndpx:mp.perfs.offset\ndpx:mp.prefix\ndpx:mp.sequence.length\ndpx:mp.shutter.angle\ndpx:mp.slate.info\ndpx:source.aspect.ratio.horizontal\ndpx:source.aspect.ratio.vertical\ndpx:source.border.validity.bottom\ndpx:source.border.validity.left\ndpx:source.border.validity.right\ndpx:source.border.validity.top\ndpx:source.creation.datetime\ndpx:source.device.name\ndpx:source.device.serialnumber\ndpx:source.filename\ndpx:source.scanned.size.x\ndpx:source.scanned.size.y\ndpx:source.x-center\ndpx:source.x-offset\ndpx:source.x-original-size\ndpx:source.y-center\ndpx:source.y-offset\ndpx:source.y-original-size\ndpx:tv.black.gain\ndpx:tv.black.level\ndpx:tv.breakpoint\ndpx:tv.field.number\ndpx:tv.gama\ndpx:tv.horizontal.sampling.rate\ndpx:tv.integration.time\ndpx:tv.interlace\ndpx:tv.sync.time\ndpx:tv.temporal.sampling.rate\ndpx:tv.time.code\ndpx:tv.user.bits\ndpx:tv.video.signal\ndpx:tv.white.level\ndpx:user.data.id\n</pre>\n<p>Specific header values from a DPX file may be displayed quickly using a command\nsimilar to:</p>\n<pre class=\"literal-block\">\ngm identify -format '%[DPX:tv.time.code]' foo.dpx\n</pre>\n<p>Use</p>\n<pre class=\"literal-block\">\ngm identify -format '%[dpx:*]' foo.dpx\n</pre>\n<p>to list all DPX header attributes.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/perl.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Perl API -- PerlMagick</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-perl-api-perlmagick\">\n<h1 class=\"title\">GraphicsMagick Perl API -- PerlMagick</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#introduction\" id=\"id1\">Introduction</a></li>\n<li><a class=\"reference internal\" href=\"#installation\" id=\"id2\">Installation</a><ul>\n<li><a class=\"reference internal\" href=\"#unix\" id=\"id3\">UNIX</a></li>\n<li><a class=\"reference internal\" href=\"#windows-xp-windows-8\" id=\"id4\">Windows XP - Windows 8</a></li>\n<li><a class=\"reference internal\" href=\"#running-the-regression-tests\" id=\"id5\">Running the Regression Tests</a></li>\n</ul>\n</li>\n<li><a class=\"reference internal\" href=\"#overview\" id=\"id6\">Overview</a></li>\n<li><a class=\"reference internal\" href=\"#example-script\" id=\"id7\">Example Script</a></li>\n<li><a class=\"reference internal\" href=\"#read-or-write-an-image\" id=\"id8\">Read or Write an Image</a></li>\n<li><a class=\"reference internal\" href=\"#manipulate-an-image\" id=\"id9\">Manipulate an Image</a></li>\n<li><a class=\"reference internal\" href=\"#set-an-image-attribute\" id=\"id10\">Set an Image Attribute</a></li>\n<li><a class=\"reference internal\" href=\"#get-an-image-attribute\" id=\"id11\">Get an Image Attribute</a></li>\n<li><a class=\"reference internal\" href=\"#create-an-image-montage\" id=\"id12\">Create an Image Montage</a></li>\n<li><a class=\"reference internal\" href=\"#working-with-blobs\" id=\"id13\">Working with Blobs</a></li>\n<li><a class=\"reference internal\" href=\"#miscellaneous-methods\" id=\"id14\">Miscellaneous Methods</a></li>\n<li><a class=\"reference internal\" href=\"#handling-errors\" id=\"id15\">Handling Errors</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"introduction\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Introduction</a></h1>\n<p>PerlMagick is an objected-oriented Perl interface to GraphicsMagick. Use\nthe module to read, manipulate, or write an image or image sequence from\nwithin a Perl script. This makes it very suitable for Web CGI scripts.\nYou must have GraphicsMagick 1.0.0 or above and Perl version 5.005_02 or\ngreater installed on your system for either of these utilities to work.\nThere are a number of useful scripts available to show you the value of\nPerlMagick. The PerlMagick demo directory provides a number of sample\ndemos.</p>\n</div>\n<div class=\"section\" id=\"installation\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Installation</a></h1>\n<div class=\"section\" id=\"unix\">\n<h2><a class=\"toc-backref\" href=\"#id3\">UNIX</a></h2>\n<p>PerlMagick is installed by default by installing GraphicsMagick.\nInstalling PerlMagick as a subordinate package of GraphicsMagick is the\nbest way to avoid problems.</p>\n<p>For Unix, you typically need to be root to install the software. There\nare ways around this. Consult the Perl manual pages for more information.</p>\n</div>\n<div class=\"section\" id=\"windows-xp-windows-8\">\n<h2><a class=\"toc-backref\" href=\"#id4\">Windows XP - Windows 8</a></h2>\n<p>Please note that a nice GUI installer is available for GraphicsMagick.\nPerlMagick is included in this installer. If you are using the installer,\nthen there is no need to compile PerlMagick.</p>\n<p>After GraphicsMagick has been compiled from the GraphicsMagick Windows\nsource distribution using Microsoft Visual C++, PerlMagick may be\nmanually built and installed by opening a CLI window and performing the\nfollowing steps:</p>\n<pre class=\"literal-block\">\ncd PerlMagick\ncopy Makefile.nt Makefile.PL\nperl Makefile.PL\nnmake\nnmake install\n</pre>\n<p>See the PerlMagick Windows HowTo page for further installation\ninstructions.</p>\n</div>\n<div class=\"section\" id=\"running-the-regression-tests\">\n<h2><a class=\"toc-backref\" href=\"#id5\">Running the Regression Tests</a></h2>\n<p>To verify a correct installation, type:</p>\n<pre class=\"literal-block\">\nmake test\n</pre>\n<p>Use nmake test under Windows. There are a few demonstration scripts\navailable to exercise many of the functions PerlMagick can perform. Type</p>\n<pre class=\"literal-block\">\ncd demo\nmake\n</pre>\n<p>You are now ready to utilize the PerlMagick methods from within your Perl\nscripts.</p>\n</div>\n</div>\n<div class=\"section\" id=\"overview\">\n<h1><a class=\"toc-backref\" href=\"#id6\">Overview</a></h1>\n<p>Any script that wants to use PerlMagick methods must first define the\nmethods within its namespace and instantiate an image object. Do this\nwith</p>\n<pre class=\"literal-block\">\nuse Graphics::Magick;\n$image=Graphics::Magick-&gt;new;\n</pre>\n<p>Note that this differs from the ImageMagick version of PerlMagick which\nuses the namespace Image::Magick. Any PerlMagick code written for the\nImageMagick version of PerlMagick requires a global substition of\nImage::Magick to Graphics::Magick in order to work with the\nGraphicsMagick version.</p>\n<p>The new() method takes the same parameters as SetAttribute . For example:</p>\n<pre class=\"literal-block\">\n$image=Graphics::Magick-&gt;new(size=&gt;'384x256');\n</pre>\n<p>Next you will want to read an image or image sequence, manipulate it, and\nthen display or write it. The input and output methods for PerlMagick are\ndefined in Read or Write an Image. See Set an Image Attribute for methods\nthat affect the way an image is read or written. Refer to Manipulate an\nImage for a list of methods to transform an image. Get an Image Attribute\ndescribes how to retrieve an attribute for an image. Refer to Create an\nImage Montage for details about tiling your images as thumbnails on a\nbackground. Finally, some methods do not neatly fit into any of the\ncategories just mentioned. Review Miscellaneous Methods for a list of\nthese methods.</p>\n<p>Once you are finished with a PerlMagick object you should consider\ndestroying it. Each image in an image sequence is stored in either\nvirtual memory or as a file in the system's temporary file directory.\nThis can potentially add up to megabytes of memory or disk. Upon\ndestroying a PerlMagick object, the memory is returned for use by other\nPerl methods. The recommended way to destroy an object is with undef</p>\n<pre class=\"literal-block\">\nundef $image;\n</pre>\n<p>To delete all the images but retain the Graphics::Magick object use</p>\n<pre class=\"literal-block\">\n&#64;$image = ();\n</pre>\n<p>and finally, to delete a single image from a multi-image sequence, use</p>\n<pre class=\"literal-block\">\nundef $image-&gt;[x];\n</pre>\n<p>The next section illustrates how to use various PerlMagick methods to\nmanipulate an image sequence.</p>\n<p>Some of the PerlMagick methods require external programs such as\nGhostscript. This may require an explicit path in your PATH environment\nvariable to work properly. For example,</p>\n<pre class=\"literal-block\">\n$ENV{PATH}='/bin:/usr/bin:/usr/local/bin';\n</pre>\n</div>\n<div class=\"section\" id=\"example-script\">\n<h1><a class=\"toc-backref\" href=\"#id7\">Example Script</a></h1>\n<p>Here is an example script to get you started:</p>\n<pre class=\"literal-block\">\n#!/usr/local/bin/perl\nuse Graphics::Magick;\nmy($image, $status);\n$image = Graphics::Magick-&gt;new;\n$status = $image-&gt;Read('girl.png', 'logo.png', 'rose.png');\nwarn &quot;$status&quot; if &quot;$status&quot;;\n$status = $image-&gt;Crop(geometry=&gt;'100x100+100+100');\nwarn &quot;$status&quot; if &quot;$status&quot;;\n$status = $image-&gt;Write('x.gif');\nwarn &quot;$status&quot; if &quot;$status&quot;;\n</pre>\n<p>The script reads three images, crops them, and writes a single image as a\nGIF animation sequence. In many cases you may want to access individual\nimages of a sequence. The next example illustrates how this is done:</p>\n<pre class=\"literal-block\">\n#!/usr/local/bin/perl\nuse Graphics::Magick;\nmy($image, $p, $q);\n$image = new Graphics::Magick;\n$image-&gt;Read('x1.png');\n$image-&gt;Read('j*.jpg');\n$image-&gt;Read('k.miff[1, 5, 3]');\n$image-&gt;Contrast();\nfor ($x = 0; $image-&gt;[x]; $x++)\n{\n  $image-&gt;[x]-&gt;Frame('100x200') if $image-&gt;[x]-&gt;Get('magick') eq 'GIF';\n  undef $image-&gt;[x] if $image-&gt;[x]-&gt;Get('columns') &lt; 100;\n}\n$p = $image-&gt;[1];\n$p-&gt;Draw(stroke=&gt;'red', primitive=&gt;'rectangle', points=&gt;'20,20 100,100');\n$q = $p-&gt;Montage();\nundef $image;\n$q-&gt;Write('x.miff');\n</pre>\n<p>Suppose you want to start out with a 100 by 100 pixel white canvas with a\nred pixel in the center. Try</p>\n<pre class=\"literal-block\">\n$image = Graphics::Magick-&gt;new;\n$image-&gt;Set(size=&gt;'100x100');\n$image-&gt;ReadImage('xc:white');\n$image-&gt;Set('pixel[49,49]'=&gt;'red');\n</pre>\n<p>Or suppose you want to convert your color image to grayscale:</p>\n<pre class=\"literal-block\">\n$image-&gt;Quantize(colorspace=&gt;'gray');\n</pre>\n<p>Here we annotate an image with a Taipai TrueType font:</p>\n<pre class=\"literal-block\">\n$text = 'Works like magick!';\n$image-&gt;Annotate(font=&gt;'kai.ttf', pointsize=&gt;40, fill=&gt;'green', text=&gt;$text);\n</pre>\n<p>Other clever things you can do with a PerlMagick objects include</p>\n<pre class=\"literal-block\">\n$i = $#$p&quot;+1&quot;; # return the number of images associated with object p\npush(&#64;$q, &#64;$p); # push the images from object p onto object q\n&#64;$p = (); # delete the images but not the object p\n$p-&gt;Convolve([1, 2, 1, 2, 4, 2, 1, 2, 1]); # 3x3 Gaussian kernel\n</pre>\n</div>\n<div class=\"section\" id=\"read-or-write-an-image\">\n<h1><a class=\"toc-backref\" href=\"#id8\">Read or Write an Image</a></h1>\n<p>Use the methods listed below to either read, write, or display an image\nor image sequence.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Read or Write Methods</caption>\n<colgroup>\n<col width=\"10%\" />\n<col width=\"19%\" />\n<col width=\"27%\" />\n<col width=\"44%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Method</td>\n<td>Parameters</td>\n<td>Return Value</td>\n<td>Description</td>\n</tr>\n<tr><td>Read</td>\n<td>one or more\nfilenames</td>\n<td>the number of\nimages read</td>\n<td>read an image or image sequence</td>\n</tr>\n<tr><td>Write</td>\n<td>filename</td>\n<td>the number of\nimages written</td>\n<td>write an image or image\nsequence</td>\n</tr>\n<tr><td>Display</td>\n<td>server name</td>\n<td>the number of\nimages displayed</td>\n<td>display the image or image\nsequence to an X server</td>\n</tr>\n<tr><td>Animate</td>\n<td>server name</td>\n<td>the number of\nimages animated</td>\n<td>animate image sequence to an X\nserver</td>\n</tr>\n</tbody>\n</table>\n<p>For convenience, methods Write(), Display(), and Animate() can take any\nparameter that SetAttribute knows about. For example,</p>\n<pre class=\"literal-block\">\n$image-&gt;Write(filename=&gt;'image.png', compression=&gt;'None');\n</pre>\n<p>Use - as the filename to method Read() to read from standard in or to\nmethod Write() to write to standard out:</p>\n<pre class=\"literal-block\">\nbinmode STDOUT;\n$image-&gt;Write('png:-');\n</pre>\n<dl class=\"docutils\">\n<dt>To read an image from a disk file, use::</dt>\n<dd>$image = Graphics::Magick-&gt;new;\n$filename = 'test.gif';\n$status = $image-&gt;Read ($filename);</dd>\n</dl>\n<p>and to write the image back to the disk file, use:</p>\n<pre class=\"literal-block\">\n$status = $image-&gt;Write($filename);\n</pre>\n<p>To read an image in the GIF format from a PERL filehandle, use:</p>\n<pre class=\"literal-block\">\n$image = Graphics::Magick-&gt;new;\nopen(IMAGE, 'image.gif');\n$status = $image-&gt;Read(file=&gt;\\*IMAGE);\nclose(IMAGE);\n</pre>\n<p>To write an image in the PNG format to a PERL filehandle, use:</p>\n<pre class=\"literal-block\">\n$filename = &quot;image.png&quot;;\nopen(IMAGE, &quot;&gt;$filename&quot;);\n$status = $image-&gt;Write(file=&gt;\\*IMAGE, filename=&gt;$filename);\nclose(IMAGE);\n</pre>\n<p>If %0Nd appears in the filename, it is interpreted as a printf format\nspecification and the specification is replaced with the specified\ndecimal encoding of the scene number. For example,</p>\n<pre class=\"literal-block\">\nimage%03d.miff\n</pre>\n<p>converts files image000.miff, image001.miff, etc.</p>\n<p>You can optionally add Image to any method name. For example, ReadImage()\nis an alias for method Read().</p>\n</div>\n<div class=\"section\" id=\"manipulate-an-image\">\n<h1><a class=\"toc-backref\" href=\"#id9\">Manipulate an Image</a></h1>\n<p>Once you create an image with, for example, method ReadImage() you may want\nto operate on it. Below is a list of all the image manipulations methods\navailable to you with PerlMagick. There are examples of select PerlMagick\nmethods. Here is an example call to an image manipulation method:</p>\n<pre class=\"literal-block\">\n$image-&gt;Crop(geometry=&gt;'100x100&quot;+1&quot;0+20');\n$image-&gt;[x]-&gt;Frame(&quot;100x200&quot;);\n</pre>\n<p>Image method parameters are often redundant. For example, a 'geometry'\nstring parameter (e.g. 800x600+10+20) is equivalent to the explicit use of\nwidth, height, x, and y, parameters.</p>\n<p>The following image manipulation methods are available:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Image Manipulation Methods</caption>\n<colgroup>\n<col width=\"24%\" />\n<col width=\"46%\" />\n<col width=\"30%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Method</td>\n<td>Parameters</td>\n<td>Description</td>\n</tr>\n<tr><td>AdaptiveThreshold</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer, offset\n=&gt;integer</td>\n<td>Local adaptive\nthresholding. Width\nand height specify\nthe size of the local\nregion while offset\nspecifies the amount\nto subtract from the\naverage of the\nregion.</td>\n</tr>\n<tr><td>AddNoise</td>\n<td>noise=&gt;{Uniform, Gaussian,\nMultiplicative, Impulse,\nLaplacian, Poisson, Random}</td>\n<td>Add noise to an image\nacross the red,\ngreen, and blue,\nchannels. Set the\nimage colorspace to\nGRAY to obtain\nintensity noise.</td>\n</tr>\n<tr><td>AffineTransform</td>\n<td>affine=&gt;array of float values,\ntranslate=&gt;float, float, scale=&gt;\nfloat, float, rotate=&gt;float,\nskewX=&gt;float, skewY=&gt;float</td>\n<td>Affine transform\nimage</td>\n</tr>\n<tr><td>Annotate</td>\n<td>text=&gt;string, font=&gt;string,\nfamily=&gt;string, style=&gt;{Normal,\nItalic, Oblique, Any}, stretch=&gt;\n{Normal, UltraCondensed,\nExtraCondensed, Condensed,\nSemiCondensed, SemiExpanded,\nExpanded, ExtraExpanded,\nUltraExpanded}, weight=&gt;integer,\npointsize=&gt;integer, density=&gt;\ngeometry, stroke=&gt; color name,\nstrokewidth=&gt;integer, fill=&gt;color\nname, undercolor=&gt;color name,\ngeometry=&gt;geometry, gravity=&gt;\n{NorthWest, North, NorthEast,\nWest, Center, East, SouthWest,\nSouth, SouthEast}, antialias=&gt;\n{true, false}, x=&gt;integer, y=&gt;\ninteger, affine=&gt;array of float\nvalues, translate=&gt;float, float,\nscale=&gt;float, float, rotate=&gt;\nfloat. skewX=&gt;float, skewY=&gt;\nfloat, align=&gt;{Left, Center,\nRight}, encoding=&gt;{UTF-8}</td>\n<td>annotate an image\nwith text. See\nQueryFontMetrics to\nget font metrics\nwithout rendering any\ntext.</td>\n</tr>\n<tr><td>Blur</td>\n<td>geometry=&gt;geometry, radius=&gt;\ndouble, sigma=&gt; double</td>\n<td>blur the image with a\nGaussian operator of\nthe given radius and\nstandard deviation\n(sigma).</td>\n</tr>\n<tr><td>Border</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer, fill=&gt;\ncolor name</td>\n<td>surround the image\nwith a border of\ncolor</td>\n</tr>\n<tr><td>Channel</td>\n<td>channel=&gt;{Red, Cyan, Green,\nMagenta, Blue, Yellow, Opacity,\nBlack, Matte, All, Gray}</td>\n<td>extract a channel\nfrom the image</td>\n</tr>\n<tr><td>Charcoal</td>\n<td>order=&gt;integer</td>\n<td>simulate a charcoal\ndrawing</td>\n</tr>\n<tr><td>Chop</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer, x=&gt;\ninteger, y=&gt;integer</td>\n<td>chop an image</td>\n</tr>\n<tr><td>Coalesce</td>\n<td>&nbsp;</td>\n<td>merge a sequence of\nimages</td>\n</tr>\n<tr><td>Clip</td>\n<td>&nbsp;</td>\n<td>apply any clipping\npath information as\nan image clip mask.</td>\n</tr>\n<tr><td>ColorFloodfill</td>\n<td>geometry=&gt;geometry, x=&gt;integer, y\n=&gt;integer , fill=&gt;color name,\nbordercolor=&gt; color name</td>\n<td>changes the color\nvalue of any pixel\nthat matches the\ncolor of the target\npixel and is a\nneighbor. If you\nspecify a border\ncolor, the color\nvalue is changed for\nany neighbor pixel\nthat is not that\ncolor.</td>\n</tr>\n<tr><td>Colorize</td>\n<td>fill=&gt;color name, opacity=&gt;string</td>\n<td>colorize the image\nwith the fill color</td>\n</tr>\n<tr><td>Comment</td>\n<td>string</td>\n<td>add a comment to your\nimage</td>\n</tr>\n<tr><td>Compare</td>\n<td>image=&gt;image-handle</td>\n<td>compare image to a\nreference image</td>\n</tr>\n<tr><td>Composite</td>\n<td>image=&gt;image-handle, compose=&gt;{\nOver, In, Out, Atop, Xor, Plus,\nMinus, Add, Subtract,\nDifference, Multiply, Bumpmap,\nCopy, CopyRed, CopyGreen,\nCopyBlue, CopyOpacity,\nClear, Dissolve, Displace,\nModulate, Threshold, No, Darken,\nLighten, Hue, Saturate,\nColorize, Luminize, Screen,\nOverlay, CopyCyan, CopyMagenta,\nCopyYellow, CopyBlack, Divide,\nHardLight},\nmask=&gt;\nimage-handle, geometry=&gt;geometry,\nx=&gt;integer, y=&gt;integer, gravity=&gt;\n{NorthWest, North, NorthEast,\nWest, Center, East, SouthWest,\nSouth, SouthEast}, opacity=&gt;\ninteger, tile=&gt;{True, False},\nrotate=&gt;double, color=&gt;color name</td>\n<td>composite one image\nonto another</td>\n</tr>\n<tr><td>Contrast</td>\n<td>sharpen=&gt;{True, False}</td>\n<td>enhance or reduce the\nimage contrast</td>\n</tr>\n<tr><td>Convolve</td>\n<td>coefficients=&gt;array of float\nvalues</td>\n<td>apply a convolution\nkernel to the image.\nGiven a kernel order\n, you would supply\norder*order float\nvalues (e.g. 3x3\nimplies 9 values).</td>\n</tr>\n<tr><td>Crop</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer, x=&gt;\ninteger, y=&gt;integer</td>\n<td>crop an image</td>\n</tr>\n<tr><td>CycleColormap</td>\n<td>amount=&gt;integer</td>\n<td>displace image\ncolormap by amount</td>\n</tr>\n<tr><td>Deconstruct</td>\n<td>&nbsp;</td>\n<td>break down an image\nsequence into\nconstituent parts</td>\n</tr>\n<tr><td>Despeckle</td>\n<td>&nbsp;</td>\n<td>reduce the speckles\nwithin an image</td>\n</tr>\n<tr><td>Draw</td>\n<td>primitive=&gt;{point, line,\nrectangle, roundRectangle, arc,\nellipse, circle, polyline,\npolygon, ,bezier, path, color,\nmatte, text, image, &#64;filename},\npoints=&gt;string , method=&gt;{Point,\nReplace, Floodfill, FillToBorder,\nReset}, stroke=&gt; color name, fill\n=&gt;color name, tile=&gt;image-handle,\nstrokewidth=&gt;float, antialias=&gt;\n{true, false}, bordercolor=&gt;color\nname, x=&gt; float, y=&gt;float, affine\n=&gt;array of float values,\ntranslate=&gt;float, float, scale=&gt;\nfloat, float, rotate=&gt;float.\nskewX=&gt;float, skewY=&gt; float</td>\n<td>annotate an image\nwith one or more\ngraphic primitives</td>\n</tr>\n<tr><td>Edge</td>\n<td>radius=&gt;double</td>\n<td>enhance edges within\nthe image with a\nconvolution filter of\nthe given radius.</td>\n</tr>\n<tr><td>Emboss</td>\n<td>geometry=&gt;geometry, radius=&gt;\ndouble, sigma=&gt; double</td>\n<td>emboss the image with\na convolution filter\nof the given radius\nand standard\ndeviation (sigma).</td>\n</tr>\n<tr><td>Enhance</td>\n<td>&nbsp;</td>\n<td>apply a digital\nfilter to enhance a\nnoisy image</td>\n</tr>\n<tr><td>Equalize</td>\n<td>&nbsp;</td>\n<td>perform histogram\nequalization to the\nimage</td>\n</tr>\n<tr><td>Flatten</td>\n<td>&nbsp;</td>\n<td>flatten a sequence of\nimages</td>\n</tr>\n<tr><td>Flip</td>\n<td>&nbsp;</td>\n<td>create a mirror image\nby reflecting the\nimage scanlines in\nthe vertical\ndirection</td>\n</tr>\n<tr><td>Flop</td>\n<td>&nbsp;</td>\n<td>create a mirror image\nby reflecting the\nimage scanlines in\nthe horizontal\ndirection</td>\n</tr>\n<tr><td>Frame</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer, inner\n=&gt;integer, outer=&gt;integer, fill=&gt;\ncolor name</td>\n<td>surround the image\nwith an ornamental\nborder</td>\n</tr>\n<tr><td>Gamma</td>\n<td>gamma=&gt;string, red=&gt;double, green\n=&gt;double , blue=&gt;double</td>\n<td>gamma correct the\nimage</td>\n</tr>\n<tr><td>Implode</td>\n<td>amount=&gt;double</td>\n<td>implode image pixels\nabout the center</td>\n</tr>\n<tr><td>Label</td>\n<td>string</td>\n<td>assign a label to an\nimage</td>\n</tr>\n<tr><td>Level</td>\n<td>level=&gt;string, 'black-point'=&gt;\ndouble, 'mid-point'=&gt;double,\n'white-point'=&gt;double</td>\n<td>adjust the level of\nimage contrast</td>\n</tr>\n<tr><td>Magnify</td>\n<td>&nbsp;</td>\n<td>double the size of an\nimage</td>\n</tr>\n<tr><td>Map</td>\n<td>image=&gt;image-handle, dither=&gt;\n{True, False}</td>\n<td>choose a particular\nset of colors from\nthis image</td>\n</tr>\n<tr><td>MatteFloodfill</td>\n<td>geometry=&gt;geometry, x=&gt;integer, y\n=&gt;integer , matte=&gt;integer,\nbordercolor=&gt;color name</td>\n<td>changes the matte\nvalue of any pixel\nthat matches the\ncolor of the target\npixel and is a\nneighbor. If you\nspecify a border\ncolor, the matte\nvalue is changed for\nany neighbor pixel\nthat is not that\ncolor.</td>\n</tr>\n<tr><td>MedianFilter</td>\n<td>radius=&gt;double</td>\n<td>replace each pixel\nwith the median\nintensity pixel of a\nneighborhood.</td>\n</tr>\n<tr><td>Minify</td>\n<td>&nbsp;</td>\n<td>half the size of an\nimage</td>\n</tr>\n<tr><td>Modulate</td>\n<td>brightness=&gt;double, saturation=&gt;\ndouble, hue=&gt; double</td>\n<td>vary the brightness,\nsaturation, and hue\nof an image by the\nspecified percentage</td>\n</tr>\n<tr><td>MotionBlur</td>\n<td>geometry=&gt;geometry, radius=&gt;\ndouble, sigma=&gt; double, angle=&gt;\ndouble</td>\n<td>blur the image with a\nGaussian operator of\nthe given radius and\nstandard deviation\n(sigma) at the given\nangle to simulate the\neffect of motion</td>\n</tr>\n<tr><td>Negate</td>\n<td>gray=&gt;{True, False}</td>\n<td>replace every pixel\nwith its\ncomplementary color\n(white becomes black,\nyellow becomes blue,\netc.)</td>\n</tr>\n<tr><td>Normalize</td>\n<td>&nbsp;</td>\n<td>transform image to\nspan the full range\nof color values</td>\n</tr>\n<tr><td>OilPaint</td>\n<td>radius=&gt;integer</td>\n<td>simulate an oil\npainting</td>\n</tr>\n<tr><td>Opaque</td>\n<td>color=&gt;color name, fill=&gt; color\nname</td>\n<td>change this color to\nthe fill color within\nthe image</td>\n</tr>\n<tr><td>Quantize</td>\n<td>colors=&gt;integer, colorspace=&gt;\n{RGB, Gray, Transparent, OHTA,\nXYZ, YCbCr, YIQ, YPbPr, YUV,\nCMYK}, treedepth=&gt; integer,\ndither=&gt;{True, False},\nmeasure_error=&gt;{True, False},\nglobal_colormap=&gt;{True, False}</td>\n<td>preferred number of\ncolors in the image</td>\n</tr>\n<tr><td>Profile</td>\n<td>name=&gt;{ICM, IPTC}, profile=&gt;blob</td>\n<td>add or remove ICC or\nIPTC image profile</td>\n</tr>\n<tr><td>Raise</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer, x=&gt;\ninteger, y=&gt;integer, raise=&gt;\n{True, False}</td>\n<td>lighten or darken\nimage edges to create\na 3-D effect</td>\n</tr>\n<tr><td>ReduceNoise</td>\n<td>radius=&gt;double</td>\n<td>reduce noise in the\nimage with a noise\npeak elimination\nfilter</td>\n</tr>\n<tr><td>Resize</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer, filter\n=&gt;{Point, Box, Triangle, Hermite,\nHanning, Hamming, Blackman,\nGaussian, Quadratic, Cubic,\nCatrom, Mitchell, Lanczos,\nBessel, Sinc}, blur=&gt;double</td>\n<td>scale image to\ndesired size. Specify\nblur &gt; 1 for blurry\nor &lt; 1 for sharp</td>\n</tr>\n<tr><td>Roll</td>\n<td>geometry=&gt;geometry, x=&gt;integer, y\n=&gt;integer</td>\n<td>roll an image\nvertically or\nhorizontally</td>\n</tr>\n<tr><td>Rotate</td>\n<td>degrees=&gt;double, color=&gt;color\nname</td>\n<td>rotate an image</td>\n</tr>\n<tr><td>Sample</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer</td>\n<td>scale image with\npixel sampling</td>\n</tr>\n<tr><td>Scale</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer</td>\n<td>scale image to\ndesired size</td>\n</tr>\n<tr><td>Segment</td>\n<td>colorspace=&gt;{RGB, Gray,\nTransparent, OHTA, XYZ, YCbCr,\nYCC, YIQ, YPbPr, YUV, CMYK},\nverbose={True, False}, cluster=&gt;\ndouble, smooth= double</td>\n<td>segment an image by\nanalyzing the\nhistograms of the\ncolor components and\nidentifying units\nthat are homogeneous</td>\n</tr>\n<tr><td>Shade</td>\n<td>geometry=&gt;geometry, azimuth=&gt;\ndouble, elevation=&gt; double, gray\n=&gt;{true, false}</td>\n<td>shade the image using\na distant light\nsource</td>\n</tr>\n<tr><td>Sharpen</td>\n<td>geometry=&gt;geometry, radius=&gt;\ndouble, sigma=&gt; double</td>\n<td>sharpen the image\nwith a Gaussian\noperator of the given\nradius and standard\ndeviation (sigma).</td>\n</tr>\n<tr><td>Shave</td>\n<td>geometry=&gt;geometry, width=&gt;\ninteger, height=&gt; integer</td>\n<td>shave pixels from the\nimage edges</td>\n</tr>\n<tr><td>Shear</td>\n<td>geometry=&gt;geometry, x=&gt;double, y\n=&gt;double color=&gt;color name</td>\n<td>shear the image along\nthe X or Y axis by a\npositive or negative\nshear angle</td>\n</tr>\n<tr><td>Signature</td>\n<td>&nbsp;</td>\n<td>generate an SHA-256\nmessage digest for\nthe image pixel\nstream</td>\n</tr>\n<tr><td>Solarize</td>\n<td>threshold=&gt;integer</td>\n<td>negate all pixels\nabove the threshold\nlevel</td>\n</tr>\n<tr><td>Spread</td>\n<td>amount=&gt;integer</td>\n<td>displace image pixels\nby a random amount</td>\n</tr>\n<tr><td>Stereo</td>\n<td>image=&gt;image-handle</td>\n<td>composites two images\nand produces a single\nimage that is the\ncomposite of a left\nand right image of a\nstereo pair</td>\n</tr>\n<tr><td>Stegano</td>\n<td>image=&gt;image-handle, offset=&gt;\ninteger</td>\n<td>hide a digital\nwatermark within the\nimage</td>\n</tr>\n<tr><td>Swirl</td>\n<td>degrees=&gt;double</td>\n<td>swirl image pixels\nabout the center</td>\n</tr>\n<tr><td>Texture</td>\n<td>texture=&gt;image-handle</td>\n<td>name of texture to\ntile onto the image\nbackground</td>\n</tr>\n<tr><td>Threshold</td>\n<td>threshold=&gt;string</td>\n<td>threshold the image</td>\n</tr>\n<tr><td>Transparent</td>\n<td>color=&gt;color name</td>\n<td>make this color\ntransparent within\nthe image</td>\n</tr>\n<tr><td>Trim</td>\n<td>&nbsp;</td>\n<td>remove edges that are\nthe background color\nfrom the image</td>\n</tr>\n<tr><td>UnsharpMask</td>\n<td>geometry=&gt;geometry, radius=&gt;\ndouble, sigma=&gt; double, amount=&gt;\ndouble, threshold=&gt;double</td>\n<td>sharpen the image\nwith the unsharp mask\nalgorithm.</td>\n</tr>\n<tr><td>Wave</td>\n<td>geometry=&gt;geometry, amplitude=&gt;\ndouble, wavelength=&gt; double</td>\n<td>alter an image along\na sine wave</td>\n</tr>\n</tbody>\n</table>\n<p>Note, that the geometry parameter is a short cut for the width and height\nparameters (e.g. geometry=&gt;'106x80' is equivalent to width=&gt;106,\nheight=&gt;80).</p>\n<p>You can specify &#64;filename in both Annotate() and Draw(). This reads the\ntext or graphic primitive instructions from a file on disk. For example,</p>\n<pre class=\"literal-block\">\n$image-&gt;Draw(fill=&gt;'red', primitive=&gt;'rectangle',\npoints=&gt;'20,20 100,100 40,40 200,200 60,60 300,300');\n</pre>\n<p>Is equivalent to</p>\n<pre class=\"literal-block\">\n$image-&gt;Draw(fill=&gt;'red', primitive=&gt;'&#64;draw.txt');\n</pre>\n<p>Where draw.txt is a file on disk that contains this:</p>\n<pre class=\"literal-block\">\nrectangle 20, 20 100, 100\nrectangle 40, 40 200, 200\nrectangle 60, 60 300, 300\n</pre>\n<p>The text parameter for methods, Annotate(), Comment(), Draw(), and\nLabel() can include the image filename, type, width, height, or other\nimage attribute by embedding these special format characters:</p>\n<pre class=\"literal-block\">\n%b file size\n%d comment\n%d directory\n%e filename extension\n%f filename\n%h height\n%m magick\n%p page number\n%s scene number\n%t top of filename\n%w width\n%x x resolution\n%y y resolution\n\\n newline\n\\r carriage return\n</pre>\n<p>For example,</p>\n<pre class=\"literal-block\">\ntext=&gt;&quot;%m:%f %wx%h&quot;\n</pre>\n<p>produces an annotation of MIFF:bird.miff 512x480 for an image titled\nbird.miff and whose width is 512 and height is 480.</p>\n<p>You can optionally add Image to any method name. For example, TrimImage()\nis an alias for method Trim().</p>\n<p>Most of the attributes listed above have an analog in convert. See the\ndocumentation for a more detailed description of these attributes.</p>\n</div>\n<div class=\"section\" id=\"set-an-image-attribute\">\n<h1><a class=\"toc-backref\" href=\"#id10\">Set an Image Attribute</a></h1>\n<p>Use method Set() to set an image attribute. For example,</p>\n<pre class=\"literal-block\">\n$image-&gt;Set(dither=&gt;'True');\n$image-&gt;[$x]-&gt;Set(delay=&gt;3);\n</pre>\n<p>And here is a list of all the image attributes you can set:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Image Attributes</caption>\n<colgroup>\n<col width=\"23%\" />\n<col width=\"51%\" />\n<col width=\"27%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Attribute</td>\n<td>Values</td>\n<td>Description</td>\n</tr>\n<tr><td>adjoin</td>\n<td>{True, False}</td>\n<td>join images into a\nsingle multi-image\nfile</td>\n</tr>\n<tr><td>antialias</td>\n<td>{True, False}</td>\n<td>remove pixel\naliasing</td>\n</tr>\n<tr><td>authenticate</td>\n<td>string</td>\n<td>decrypt image with\nthis password.</td>\n</tr>\n<tr><td>background</td>\n<td>color name</td>\n<td>image background\ncolor</td>\n</tr>\n<tr><td>blue-primary</td>\n<td>x-value, y-value</td>\n<td>chromaticity blue\nprimary point (e.g.\n0.15, 0.06)</td>\n</tr>\n<tr><td>bordercolor</td>\n<td>color name</td>\n<td>set the image\nborder color</td>\n</tr>\n<tr><td>clip-mask</td>\n<td>image</td>\n<td>Associate a clip\nmask with the\nimage.</td>\n</tr>\n<tr><td>colormap[i]</td>\n<td>color name</td>\n<td>color name (e.g.\nred) or hex value\n(e.g. #ccc) at\nposition i</td>\n</tr>\n<tr><td>colorspace</td>\n<td>{RGB, CMYK}</td>\n<td>type of colorspace</td>\n</tr>\n<tr><td>comment</td>\n<td>string</td>\n<td>Append to the image\ncomment.</td>\n</tr>\n<tr><td>compression</td>\n<td>{None, BZip, Fax, Group4, JPEG,\nLosslessJPEG, LZW, RLE, Zip, LZMA\nJPEG2000, JBIG1, JBIG2}</td>\n<td>type of image\ncompression</td>\n</tr>\n<tr><td>debug</td>\n<td>{No, Configure, Annotate, Render,\nTransform, Locale, Coder, X11,\nCache, Blob, Deprecate, User,\nResource, TemporaryFile,\nException,All}</td>\n<td>log copious\ndebugging\ninformation  for\none or more event\ntypes</td>\n</tr>\n<tr><td>delay</td>\n<td>integer</td>\n<td>this many 1/100ths\nof a second must\nexpire before\ndisplaying the next\nimage in a sequence</td>\n</tr>\n<tr><td>density</td>\n<td>geometry</td>\n<td>vertical and\nhorizontal\nresolution in\npixels of the image</td>\n</tr>\n<tr><td>disk-limit</td>\n<td>integer</td>\n<td>set disk resource\nlimit in megabytes</td>\n</tr>\n<tr><td>dispose</td>\n<td>{Undefined, None, Background,\nPrevious}</td>\n<td>GIF disposal method</td>\n</tr>\n<tr><td>dither</td>\n<td>{True, False}</td>\n<td>apply error\ndiffusion to the\nimage</td>\n</tr>\n<tr><td>display</td>\n<td>string</td>\n<td>specifies the X\nserver to contact</td>\n</tr>\n<tr><td>endian</td>\n<td>{Undefined, LSB, MSB, Native}</td>\n<td>specifies the\nordering of bytes\nin a multi-byte\nword. MSB is\nbig-endian, LSB is\nlittle-endian, and\nNative is whatever\nthe current host\nuses by default.</td>\n</tr>\n<tr><td>file</td>\n<td>filehandle</td>\n<td>set the image\nfilehandle</td>\n</tr>\n<tr><td>filename</td>\n<td>string</td>\n<td>set the image\nfilename</td>\n</tr>\n<tr><td>fill</td>\n<td>color</td>\n<td>The fill color\npaints any areas\ninside the outline\nof drawn shape.</td>\n</tr>\n<tr><td>font</td>\n<td>string</td>\n<td>use this font when\nannotating the\nimage with text</td>\n</tr>\n<tr><td>fuzz</td>\n<td>integer</td>\n<td>colors within this\ndistance are\nconsidered equal</td>\n</tr>\n<tr><td>gamma</td>\n<td>double</td>\n<td>gamma level of the\nimage</td>\n</tr>\n<tr><td>Gravity</td>\n<td>{Forget, NorthWest, North,\nNorthEast, West, Center, East,\nSouthWest, South, SouthEast}</td>\n<td>type of image\ngravity</td>\n</tr>\n<tr><td>green-primary</td>\n<td>x-value, y-value</td>\n<td>chromaticity green\nprimary point (e.g.\n0.3, 0.6)</td>\n</tr>\n<tr><td>index[x, y]</td>\n<td>string</td>\n<td>colormap index at\nposition (x, y)</td>\n</tr>\n<tr><td>interlace</td>\n<td>{None, Line, Plane, Partition}</td>\n<td>the type of\ninterlacing scheme</td>\n</tr>\n<tr><td>iterations</td>\n<td>integer</td>\n<td>add Netscape loop\nextension to your\nGIF animation</td>\n</tr>\n<tr><td>label</td>\n<td>string</td>\n<td>Append to the image\nlabel.</td>\n</tr>\n<tr><td>loop</td>\n<td>integer</td>\n<td>add Netscape loop\nextension to your\nGIF animation</td>\n</tr>\n<tr><td>magick</td>\n<td>string</td>\n<td>set the image\nformat</td>\n</tr>\n<tr><td>matte</td>\n<td>{True, False}</td>\n<td>True if the image\nhas transparency</td>\n</tr>\n<tr><td>mattecolor</td>\n<td>color name</td>\n<td>set the image matte\ncolor</td>\n</tr>\n<tr><td>map-limit</td>\n<td>integer</td>\n<td>set map resource\nlimit in megabytes</td>\n</tr>\n<tr><td>memory-limit</td>\n<td>integer</td>\n<td>set memory resource\nlimit in megabytes</td>\n</tr>\n<tr><td>monochrome</td>\n<td>{True, False}</td>\n<td>transform the image\nto black and white</td>\n</tr>\n<tr><td>page</td>\n<td>{ Letter, Tabloid, Ledger, Legal,\nStatement, Executive, A3, A4, A5,\nB4, B5, Folio, Quarto, 10x14} or\ngeometry</td>\n<td>preferred size and\nlocation of an\nimage canvas</td>\n</tr>\n<tr><td>pixel[x, y]</td>\n<td>string</td>\n<td>hex value (e.g. #\nccc) at position (x\n, y)</td>\n</tr>\n<tr><td>pointsize</td>\n<td>integer</td>\n<td>pointsize of the\nPostscript or\nTrueType font</td>\n</tr>\n<tr><td>preview</td>\n<td>{ Rotate, Shear, Roll, Hue,\nSaturation, Brightness, Gamma,\nSpiff, Dull, Grayscale, Quantize,\nDespeckle, ReduceNoise, AddNoise,\nSharpen, Blur, Threshold,\nEdgeDetect, Spread, Solarize, Shade,\nRaise, Segment, Swirl, Implode,\nWave, OilPaint, Charcoal,\nJPEG}</td>\n<td>type of preview for\nthe Preview image\nformat</td>\n</tr>\n<tr><td>quality</td>\n<td>integer</td>\n<td>JPEG/MIFF/PNG\ncompression level</td>\n</tr>\n<tr><td>red-primary</td>\n<td>x-value, y-value</td>\n<td>chromaticity red\nprimary point (e.g.\n0.64, 0.33)</td>\n</tr>\n<tr><td>rendering-intent</td>\n<td>{Undefined, Saturation, Perceptual,\nAbsolute, Relative}</td>\n<td>the type of\nrendering intent</td>\n</tr>\n<tr><td>sampling-factor</td>\n<td>geometry</td>\n<td>horizontal and\nvertical sampling\nfactor</td>\n</tr>\n<tr><td>scene</td>\n<td>integer</td>\n<td>image scene number</td>\n</tr>\n<tr><td>subimage</td>\n<td>integer</td>\n<td>subimage of an\nimage sequence</td>\n</tr>\n<tr><td>subrange</td>\n<td>integer</td>\n<td>number of images\nrelative to the\nbase image</td>\n</tr>\n<tr><td>server</td>\n<td>string</td>\n<td>specifies the X\nserver to contact</td>\n</tr>\n<tr><td>size</td>\n<td>string</td>\n<td>width and height of\na raw image</td>\n</tr>\n<tr><td>stroke</td>\n<td>color</td>\n<td>The stroke color\npaints along the\noutline of a shape.</td>\n</tr>\n<tr><td>tile</td>\n<td>string</td>\n<td>tile name</td>\n</tr>\n<tr><td>texture</td>\n<td>string</td>\n<td>name of texture to\ntile onto the image\nbackground</td>\n</tr>\n<tr><td>type</td>\n<td>{Bilevel, Grayscale, GrayscaleMatte,\nPalette, PaletteMatte, TrueColor,\nTrueColorMatte, ColorSeparation,\nColorSeparationMatte, Optimize }</td>\n<td>image type</td>\n</tr>\n<tr><td>units</td>\n<td>{ Undefined, PixelsPerInch,\nPixelsPerCentimeters}</td>\n<td>units of image\nresolution</td>\n</tr>\n<tr><td>verbose</td>\n<td>{True, False}</td>\n<td>print detailed\ninformation about\nthe image</td>\n</tr>\n<tr><td>virtual-pixel</td>\n<td>{Constant, Edge, Mirror, Tile}</td>\n<td>the virtual pixel\nmethod</td>\n</tr>\n<tr><td>white-point</td>\n<td>x-value, y-value</td>\n<td>chromaticity white\npoint (e.g. 0.3127,\n0.329)</td>\n</tr>\n</tbody>\n</table>\n<p>Note, that the geometry parameter is a short cut for the width and height\nparameters (e.g. geometry=&gt;'106x80' is equivalent to width=&gt;106, height=&gt;\n80).</p>\n<p>SetAttribute() is an alias for method Set().</p>\n<p>Most of the attributes listed above have an analog in gm convert. See the\ngm documentation for a more detailed description of these attributes.</p>\n</div>\n<div class=\"section\" id=\"get-an-image-attribute\">\n<h1><a class=\"toc-backref\" href=\"#id11\">Get an Image Attribute</a></h1>\n<p>Use method Get() to get an image attribute. For example,</p>\n<pre class=\"literal-block\">\n($a, $b, $c) = $image-&gt;Get('colorspace', 'magick', 'adjoin');\n$width = $image-&gt;[3]-&gt;Get('columns');\n</pre>\n<p>In addition to all the attributes listed in Set an Image Attribute , you\ncan get these additional attributes:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Image Attributes</caption>\n<colgroup>\n<col width=\"18%\" />\n<col width=\"14%\" />\n<col width=\"68%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Attribute</td>\n<td>Values</td>\n<td>Description</td>\n</tr>\n<tr><td>base-columns</td>\n<td>integer</td>\n<td>base image width (before transformations)</td>\n</tr>\n<tr><td>base-filename</td>\n<td>string</td>\n<td>base image filename (before transformations)</td>\n</tr>\n<tr><td>base-rows</td>\n<td>integer</td>\n<td>base image height (before transformations)</td>\n</tr>\n<tr><td>class</td>\n<td>{Direct,\nPseudo}</td>\n<td>image class</td>\n</tr>\n<tr><td>colors</td>\n<td>integer</td>\n<td>number of unique colors in the image</td>\n</tr>\n<tr><td>comment</td>\n<td>string</td>\n<td>image comment</td>\n</tr>\n<tr><td>columns</td>\n<td>integer</td>\n<td>image width</td>\n</tr>\n<tr><td>depth</td>\n<td>integer</td>\n<td>image depth</td>\n</tr>\n<tr><td>directory</td>\n<td>string</td>\n<td>tile names from within an image montage</td>\n</tr>\n<tr><td>error</td>\n<td>double</td>\n<td>the mean error per pixel computed with methods\nCompare() or Quantize()</td>\n</tr>\n<tr><td>filesize</td>\n<td>integer</td>\n<td>number of bytes of the image on disk</td>\n</tr>\n<tr><td>format</td>\n<td>string</td>\n<td>get the descriptive image format</td>\n</tr>\n<tr><td>geometry</td>\n<td>string</td>\n<td>image geometry</td>\n</tr>\n<tr><td>height</td>\n<td>integer</td>\n<td>the number of rows or height of an image</td>\n</tr>\n<tr><td>id</td>\n<td>integer</td>\n<td>GraphicsMagick registry id</td>\n</tr>\n<tr><td>label</td>\n<td>string</td>\n<td>image label</td>\n</tr>\n<tr><td>maximum-error</td>\n<td>double</td>\n<td>the normalized max error per pixel computed with\nmethods Compare() or Quantize()</td>\n</tr>\n<tr><td>mean-error</td>\n<td>double</td>\n<td>the normalized mean error per pixel computed\nwith methods Compare() or Quantize()</td>\n</tr>\n<tr><td>montage</td>\n<td>geometry</td>\n<td>tile size and offset within an image montage</td>\n</tr>\n<tr><td>rows</td>\n<td>integer</td>\n<td>the number of rows or height of an image</td>\n</tr>\n<tr><td>signature</td>\n<td>string</td>\n<td>SHA-256 message digest associated with the image\npixel stream</td>\n</tr>\n<tr><td>taint</td>\n<td>{True,\nFalse}</td>\n<td>True if the image has been modified</td>\n</tr>\n<tr><td>width</td>\n<td>integer</td>\n<td>the number of columns or width of an image</td>\n</tr>\n<tr><td>x-resolution</td>\n<td>integer</td>\n<td>x resolution of the image</td>\n</tr>\n<tr><td>y-resolution</td>\n<td>integer</td>\n<td>y resolution of the image</td>\n</tr>\n</tbody>\n</table>\n<p>GetAttribute() is an alias for method Get().</p>\n<p>Most of the attributes listed above have an analog in convert. See the\ndocumentation for a more detailed description of these attributes.</p>\n</div>\n<div class=\"section\" id=\"create-an-image-montage\">\n<h1><a class=\"toc-backref\" href=\"#id12\">Create an Image Montage</a></h1>\n<p>Use method Montage() to create a composite image by combining several\nseparate images. The images are tiled on the composite image with the\nname of the image optionally appearing just below the individual tile.\nFor example,</p>\n<pre class=\"literal-block\">\n$image-&gt;Montage(geometry=&gt;'160x160', tile=&gt;'2x2', texture=&gt;'granite:');\n</pre>\n<p>And here is a list of Montage() parameters you can set:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Montage Parameters</caption>\n<colgroup>\n<col width=\"15%\" />\n<col width=\"52%\" />\n<col width=\"32%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Parameter</td>\n<td>Values</td>\n<td>Description</td>\n</tr>\n<tr><td>background</td>\n<td>color name</td>\n<td>background color name</td>\n</tr>\n<tr><td>borderwidth</td>\n<td>integer</td>\n<td>image border width</td>\n</tr>\n<tr><td>compose</td>\n<td>{Over, In, Out, Atop, Xor, Plus,\nMinus, Add, Subtract, Difference,\nBumpmap, Copy, Mask, Dissolve, Clear,\nDisplace}</td>\n<td>composite operator</td>\n</tr>\n<tr><td>filename</td>\n<td>string</td>\n<td>name of montage image</td>\n</tr>\n<tr><td>fill</td>\n<td>color name</td>\n<td>fill color for\nannotations</td>\n</tr>\n<tr><td>font</td>\n<td>string</td>\n<td>X11 font name</td>\n</tr>\n<tr><td>frame</td>\n<td>geometry</td>\n<td>surround the image with\nan ornamental border</td>\n</tr>\n<tr><td>geometry</td>\n<td>geometry</td>\n<td>preferred tile and\nborder size of each\ntile of the composite\nimage</td>\n</tr>\n<tr><td>gravity</td>\n<td>{NorthWest, North, NorthEast, West,\nCenter, East, SouthWest, South,\nSouthEast}</td>\n<td>direction image\ngravitates to within a\ntile</td>\n</tr>\n<tr><td>ICM</td>\n<td>blob</td>\n<td>color information\nprofile</td>\n</tr>\n<tr><td>IPTC</td>\n<td>blob</td>\n<td>newswire information\nprofile</td>\n</tr>\n<tr><td>label</td>\n<td>string</td>\n<td>assign a label to an\nimage</td>\n</tr>\n<tr><td>mode</td>\n<td>{Frame, Unframe, Concatenate}</td>\n<td>thumbnail framing\noptions</td>\n</tr>\n<tr><td>pointsize</td>\n<td>integer</td>\n<td>pointsize of the\nPostscript or TrueType\nfont</td>\n</tr>\n<tr><td>shadow</td>\n<td>{True, False}</td>\n<td>add a shadow beneath a\ntile to simulate depth</td>\n</tr>\n<tr><td>stroke</td>\n<td>color name</td>\n<td>stroke color for\nannotations</td>\n</tr>\n<tr><td>texture</td>\n<td>string</td>\n<td>name of texture to tile\nonto the image\nbackground</td>\n</tr>\n<tr><td>tile</td>\n<td>geometry</td>\n<td>number of tiles per row\nand column</td>\n</tr>\n<tr><td>title</td>\n<td>string</td>\n<td>assign a title to the\nimage montage</td>\n</tr>\n<tr><td>transparent</td>\n<td>string</td>\n<td>make this color\ntransparent within the\nimage</td>\n</tr>\n</tbody>\n</table>\n<p>Note, that the geometry parameter is a short cut for the width and height\nparameters (e.g. geometry=&gt;'106x80' is equivalent to width=&gt;106, height=&gt;\n80).</p>\n<p>MontageImage() is an alias for method Montage().</p>\n<p>Most of the attributes listed above have an analog in montage. See the\ndocumentation for a more detailed description of these attributes.</p>\n</div>\n<div class=\"section\" id=\"working-with-blobs\">\n<h1><a class=\"toc-backref\" href=\"#id13\">Working with Blobs</a></h1>\n<p>A blob contains data that directly represent a particular image format in\nmemory instead of on disk. PerlMagick supports blobs in any of these\nimage formats and provides methods to convert a blob to or from a\nparticular image format.</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Blob Methods</caption>\n<colgroup>\n<col width=\"16%\" />\n<col width=\"14%\" />\n<col width=\"34%\" />\n<col width=\"36%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Method</td>\n<td>Parameters</td>\n<td>Return Value</td>\n<td>Description</td>\n</tr>\n<tr><td>ImageToBlob</td>\n<td>any image\nattribute</td>\n<td>an array of image data\nin the respective image\nformat</td>\n<td>convert an image or image\nsequence to an array of\nblobs</td>\n</tr>\n<tr><td>BlobToImage</td>\n<td>one or\nmore blobs</td>\n<td>the number of blobs\nconverted to an image</td>\n<td>convert one or more blobs\nto an image</td>\n</tr>\n</tbody>\n</table>\n<p>ImageToBlob() returns the image data in their respective formats. You can\nthen print it, save it to an ODBC database, write it to a file, or pipe\nit to a display program:</p>\n<pre class=\"literal-block\">\n&#64;blobs = $image-&gt;ImageToBlob();\nopen(DISPLAY,&quot;| display -&quot;) || die;\nbinmode DISPLAY;\nprint DISPLAY $blobs[0];\nclose DISPLAY;\n</pre>\n<p>Method BlobToImage() returns an image or image sequence converted from\nthe supplied blob:</p>\n<pre class=\"literal-block\">\n&#64;blob=$db-&gt;GetImage();\n$image=Graphics::Magick-&gt;new(magick=&gt;'jpg');\n$image-&gt;BlobToImage(&#64;blob);\n</pre>\n</div>\n<div class=\"section\" id=\"miscellaneous-methods\">\n<h1><a class=\"toc-backref\" href=\"#id14\">Miscellaneous Methods</a></h1>\n<p>The Append() method append a set of images. For example,</p>\n<pre class=\"literal-block\">\n$p = $image-&gt;Append(stack=&gt;{true,false});\n</pre>\n<p>appends all the images associated with object $image. By default, images\nare stacked left-to-right. Set stack to True to stack them top-to-bottom.</p>\n<p>The Average() method averages a set of images. For example,</p>\n<pre class=\"literal-block\">\n$p = $image-&gt;Average();\n</pre>\n<p>averages all the images associated with object $image.</p>\n<p>The Clone() method copies a set of images. For example,</p>\n<pre class=\"literal-block\">\n$p = $image-&gt;Clone();\n</pre>\n<p>copies all the images from object $q to $p. You can use this method for\nsingle or multi-image sequences.</p>\n<p>The Morph() method morphs a set of images. Both the image pixels and size\nare linearly interpolated to give the appearance of a meta-morphosis from\none image to the next:</p>\n<pre class=\"literal-block\">\n$p = $image-&gt;Morph(frames=&gt;integer);\n</pre>\n<p>where frames is the number of in-between images to generate. The default\nis 1.</p>\n<p>Mosaic() creates an mosaic from an image sequence.</p>\n<p>Method Mogrify() is a single entry point for the image manipulation\nmethods (Manipulate an Image). The parameters are the name of a method\nfollowed by any parameters the method may require. For example, these\ncalls are equivalent:</p>\n<pre class=\"literal-block\">\n$image-&gt;Crop('340x256+0+0');\n$image-&gt;Mogrify('crop', '340x256+0+0');\n</pre>\n<p>Method MogrifyRegion() applies a transform to a region of the image. It\nis similar to Mogrify() but begins with the region geometry. For example,\nsuppose you want to brighten a 100x100 region of your image at location\n(40, 50):</p>\n<pre class=\"literal-block\">\n$image-&gt;MogrifyRegion('100x100+40+50', 'modulate', brightness=&gt;50);\n</pre>\n<p>Ping() is a convenience method that returns information about an image\nwithout having to read the image into memory. It returns the width,\nheight, file size in bytes, and the file format of the image. You can\nspecify more than one filename but only one filehandle:</p>\n<pre class=\"literal-block\">\n($width, $height, $size, $format) = $image-&gt;Ping('logo.png');\n($width, $height, $size, $format) = $image-&gt;Ping(file=&gt;\\*IMAGE);\n($width, $height, $size, $format) = $image-&gt;Ping(blob=&gt;&#64;blob);\n</pre>\n<p>This is a more efficient and less memory intensive way to query if an\nimage exists and what its characteristics are.</p>\n<p>To have full control over text positioning you need font metric\ninformation. Use</p>\n<pre class=\"literal-block\">\n($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) =\n$image-&gt;QueryFontMetrics(parameters);\n\nWhere parameters is any parameter of the Annotate method.  The\n'text' parameter must be specified since there can be no default for\nthe text to render. The return values are\n\n* character width\n* character height\n* ascender\n* descender\n* text width\n* text height\n* maximum horizontal advance\n</pre>\n<p>Call QueryColor() with no parameters to return a list of known colors\nnames or specify one or more color names to get these attributes: red,\ngreen, blue, and opacity value.</p>\n<pre class=\"literal-block\">\n&#64;colors = $image-&gt;QueryColor();\n($red, $green, $blue, $opacity) = $image-&gt;QueryColor('cyan');\n($red, $green, $blue, $opacity) = $image-&gt;QueryColor('#716bae');\n</pre>\n<p>QueryColorname() accepts a color value and returns its respective name or\nhex value;</p>\n<pre class=\"literal-block\">\n$name = $image-&gt;QueryColorname('rgba(80,60,0,0)');\n</pre>\n<p>Call QueryFont() with no parameters to return a list of known fonts or\nspecify one or more font names to get these attributes: font name,\ndescription, family, style, stretch, weight, encoding, foundry, format,\nmetrics, and glyphs values.</p>\n<pre class=\"literal-block\">\n&#64;fonts = $image-&gt;QueryFont();\n$weight = ($image-&gt;QueryFont('Helvetica'))[5];\n</pre>\n<p>Call QueryFormat() with no parameters to return a list of known image\nformats or specify one or more format names to get these attributes:\nadjoin, blob support, raw, decoder, encoder, description, and module.</p>\n<pre class=\"literal-block\">\n&#64;formats = $image-&gt;QueryFormat();\n($adjoin, $blob_support, $raw, $decoder, $encoder, $description, $module) = $image-&gt;QueryFormat('gif');\n</pre>\n<p>Use RemoteCommand() to send a command to an already running display or\nanimate application. The only parameter is the name of the image file to\ndisplay or animate.</p>\n<p>Finally, the Transform() method accepts a fully-qualified geometry\nspecification for cropping or resizing one or more images. For example,</p>\n<pre class=\"literal-block\">\n$p = $image-&gt;Transform(crop=&gt;'100x100');\n</pre>\n<p>You can optionally add Image to any method name above. For example,\nPingImage() is an alias for method Ping().</p>\n</div>\n<div class=\"section\" id=\"handling-errors\">\n<h1><a class=\"toc-backref\" href=\"#id15\">Handling Errors</a></h1>\n<p>All PerlMagick methods return an undefined string context upon success. If\nany problems occur, the error is returned as a string with an embedded\nnumeric status code. A status code less than 400 is a warning. This means\nthat the operation did not complete but was recoverable to some degree. A\nnumeric code greater or equal to 400 is an error and indicates the\noperation failed completely. Here is how errors are returned for the\ndifferent methods:</p>\n<blockquote>\n<ul>\n<li><p class=\"first\">Methods which return a number (e.g. Read(), Write()):</p>\n<pre class=\"literal-block\">\n$status = $image-&gt;Read(...);\nwarn &quot;$status&quot; if &quot;$status&quot;; # print the error message\n$status =~ /(\\d+)/;\nprint $1; # print the error number\nprint 0+$status; # print the number of images read\n</pre>\n</li>\n<li><p class=\"first\">Methods which operate on an image (e.g. Resize(), Crop()):</p>\n<pre class=\"literal-block\">\n$status = $image-&gt;Crop(...);\nwarn &quot;$status&quot; if &quot;$status&quot;; # print the error message\n$status =~ /(\\d+)/;\nprint $1; # print the error number\n</pre>\n</li>\n<li><p class=\"first\">Methods which return images (Average(), Montage(), Clone()) should be\nchecked for errors this way:</p>\n<pre class=\"literal-block\">\n$status = $image-&gt;Montage(...);\nwarn &quot;$status&quot; if !ref($status); # print the error message\n$status =~ /(\\d+)/;\nprint $1; # print the error number\n</pre>\n</li>\n</ul>\n</blockquote>\n<p>Here is an example error message:</p>\n<pre class=\"literal-block\">\nError 400: Memory allocation failed\n</pre>\n<p>Below is a list of error and warning codes:</p>\n<table border=\"1\" class=\"docutils\">\n<caption>Error and Warning Codes</caption>\n<colgroup>\n<col width=\"6%\" />\n<col width=\"31%\" />\n<col width=\"63%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td>Code</td>\n<td>Mnemonic</td>\n<td>Description</td>\n</tr>\n<tr><td>0</td>\n<td>Success</td>\n<td>method completed without an error or warning</td>\n</tr>\n<tr><td>300</td>\n<td>ResourceLimitWarning</td>\n<td>a program resource is exhausted (e.g. not\nenough memory)</td>\n</tr>\n<tr><td>305</td>\n<td>TypeWarning</td>\n<td>A font is unavailable; a substitution may\nhave occurred</td>\n</tr>\n<tr><td>310</td>\n<td>OptionWarning</td>\n<td>a command-line option was malformed</td>\n</tr>\n<tr><td>315</td>\n<td>DelegateWarning</td>\n<td>an GraphicsMagick delegate returned a warning</td>\n</tr>\n<tr><td>320</td>\n<td>MissingDelegateWarning</td>\n<td>the image type can not be read or written\nbecause the appropriate Delegate is missing</td>\n</tr>\n<tr><td>325</td>\n<td>CorruptImageWarning</td>\n<td>the image file may be corrupt</td>\n</tr>\n<tr><td>330</td>\n<td>FileOpenWarning</td>\n<td>the image file could not be opened</td>\n</tr>\n<tr><td>335</td>\n<td>BlobWarning</td>\n<td>a binary large object could not be allocated</td>\n</tr>\n<tr><td>340</td>\n<td>StreamWarning</td>\n<td>there was a problem reading or writing from a\nstream</td>\n</tr>\n<tr><td>345</td>\n<td>CacheWarning</td>\n<td>pixels could not be saved to the pixel cache</td>\n</tr>\n<tr><td>350</td>\n<td>CoderWarning</td>\n<td>there was a problem with an image coder</td>\n</tr>\n<tr><td>355</td>\n<td>ModuleWarning</td>\n<td>there was a problem with an image module</td>\n</tr>\n<tr><td>360</td>\n<td>DrawWarning</td>\n<td>a drawing operation failed</td>\n</tr>\n<tr><td>365</td>\n<td>ImageWarning</td>\n<td>the operation could not complete due to an\nincompatible image</td>\n</tr>\n<tr><td>380</td>\n<td>XServerWarning</td>\n<td>an X resource is unavailable</td>\n</tr>\n<tr><td>385</td>\n<td>MonitorWarning</td>\n<td>there was a problem with prgress monitor</td>\n</tr>\n<tr><td>390</td>\n<td>RegistryWarning</td>\n<td>there was a problem getting or setting the\nregistry</td>\n</tr>\n<tr><td>395</td>\n<td>ConfigureWarning</td>\n<td>there was a problem getting a configuration\nfile</td>\n</tr>\n<tr><td>400</td>\n<td>ResourceLimitError</td>\n<td>a program resource is exhausted (e.g. not\nenough memory)</td>\n</tr>\n<tr><td>405</td>\n<td>TypeError</td>\n<td>A font is unavailable; a substitution may\nhave occurred</td>\n</tr>\n<tr><td>410</td>\n<td>OptionError</td>\n<td>a command-line option was malformed</td>\n</tr>\n<tr><td>415</td>\n<td>DelegateError</td>\n<td>an GraphicsMagick delegate returned a warning</td>\n</tr>\n<tr><td>420</td>\n<td>MissingDelegateError</td>\n<td>the image type can not be read or written\nbecause the appropriate Delegate is missing</td>\n</tr>\n<tr><td>425</td>\n<td>CorruptImageError</td>\n<td>the image file may be corrupt</td>\n</tr>\n<tr><td>430</td>\n<td>FileOpenError</td>\n<td>the image file could not be opened</td>\n</tr>\n<tr><td>435</td>\n<td>BlobError</td>\n<td>a binary large object could not be allocated</td>\n</tr>\n<tr><td>440</td>\n<td>StreamError</td>\n<td>there was a problem reading or writing from a\nstream</td>\n</tr>\n<tr><td>445</td>\n<td>CacheError</td>\n<td>pixels could not be saved to the pixel cache</td>\n</tr>\n<tr><td>450</td>\n<td>CoderError</td>\n<td>there was a problem with an image coder</td>\n</tr>\n<tr><td>455</td>\n<td>ModuleError</td>\n<td>there was a problem with an image module</td>\n</tr>\n<tr><td>460</td>\n<td>DrawError</td>\n<td>a drawing operation failed</td>\n</tr>\n<tr><td>465</td>\n<td>ImageError</td>\n<td>the operation could not complete due to an\nincompatible image</td>\n</tr>\n<tr><td>480</td>\n<td>XServerError</td>\n<td>an X resource is unavailable</td>\n</tr>\n<tr><td>480</td>\n<td>MonitorError</td>\n<td>there was a progress monitor error</td>\n</tr>\n<tr><td>490</td>\n<td>RegistryError</td>\n<td>there was a problem getting or setting the\nregistry</td>\n</tr>\n<tr><td>495</td>\n<td>ConfigureError</td>\n<td>there was a problem getting a configuration\nfile</td>\n</tr>\n</tbody>\n</table>\n<p>The following illustrates how you can use a numeric status code:</p>\n<pre class=\"literal-block\">\n$status = $image-&gt;Read('rose.png');\n$status =~ /(\\d+)/;\ndie &quot;unable to continue&quot; if ($1 == ResourceLimitError);\n</pre>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/process.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Development Process</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-development-process\">\n<h1 class=\"title\">GraphicsMagick Development Process</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>In order to ensure an orderly development process, and assure the highest\nquality releases, a development process has been established for\nGraphicsMagick.</p>\n<div class=\"section\" id=\"phases-of-development\">\n<h1>Phases of Development</h1>\n<p>Four major development phases have been identified. These are the\nfeature development phase, snapshot phase, beta phase, and release\nphase.  The phases used depend on the nature of preceding development.\nThe Beta phase is usually skipped. The descriptions of these phases\nare as follows:</p>\n<div class=\"section\" id=\"feature-development-phase\">\n<h2>Feature Development Phase</h2>\n<blockquote>\n<p>The feature development phase is a time of rapid development and\ninnovation. Work is normally done on Mercurial 'tip'.  During the\nfeature development phase, Mercurial is the only way to access the\nwork in progress. Before updates are committed to Mercurial, they\nshould be proven to compile on at least one architecture and pass\nthe test suite ('make distcheck').</p>\n<p>Entry Criteria: There is a plan for feature development.</p>\n<p>Exit Criteria: Test suite passes on at least one machine.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"snapshot-phase\">\n<h2>Snapshot Phase</h2>\n<blockquote>\n<p>The snapshot phase is entered when it is decided that the work is\nstable enough for non-developers to test. API and user interfaces\nshould be stable before the snapshot phase begins in order to avoid\nconfusion. Snapshot development is done on Mercurial 'tip'. Snapshot\npackages are identified by the date of the snapshot, and no Mercurial\nbranching or tagging is performed to support the snapshot.</p>\n<p>Entry Criteria: Interfaces are stable, and code compiles and runs on\nmultiple architectures.</p>\n<p>Exit Criteria: Code is release quality. The test suite must show\n100% completion for Q:8 and Q:16 quantum depths on at least three\noperating environments.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"beta-phase\">\n<h2>Beta Phase</h2>\n<blockquote>\n<p>The Beta phase (usually only occuring at the beginning of a major\nrelease cycle) is entered when the work is feature complete, the\npackage passes all tests, and it is considered time for versioned\nreleases. As the first step of entering the beta phase, a release\nbranch is created off of the trunk to support change sets for the\nrelease. The purpose of the beta phase is to wring out any remaining\nbugs prior to release. When a beta package is prepared, a release\ntag is applied to the associated release branch in Mercurial.</p>\n<p>Entry Criteria: Code is release quality.. The test suite must show\n100% completion for Q:8 and Q:16 quantum depths on at least three\noperating environments.</p>\n<p>Exit Criteria: The test suite must show 100% completion for Q:8, Q:16,\nand Q:32 quantum depths on at least three operating environments. The\ncurrent beta package is determined to be sufficiently flawless for a\nfinal release.</p>\n</blockquote>\n</div>\n<div class=\"section\" id=\"release-phase\">\n<h2>Release Phase</h2>\n<blockquote>\n<p>The release phase is entered when the most recent Beta (or snapshot)\nis considered to be of acceptable quality for a release or bug-fixes\nhave been prepared based on a previous release. At this time, a\nformal release tag is applied to the release branch, and release\npackages are created. Once a release tag has been applied to a\nrelease branch, that release branch is considered to be in release\nstate and may only be used to prepare additional releases intended\nto correct bugs found in preceding releases. The initial release on\na release branch has a two-digit (i.e.  X.X) release\ndesignation. Bug-fix releases have a three-digit (i.e.  X.X.X)\nrelease designation. A release designation may only be used once. If\na problem is discovered with the release package, a new release\nnumber is assigned to support the corrected release package.</p>\n<p>Entry Criteria: The test suite must show 100% completion for Q:8, Q:16,\nand Q:32 quantum depths on at least three operating environments. The\ncurrent beta package is determined to be sufficiently flawless for a\nfinal release.</p>\n<p>Exit Criteria: None</p>\n</blockquote>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/programming.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Programming Interfaces</title>\n<meta content=\"GraphicsMagick is a robust collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats including GIF, JPEG, PNG, PDF, and Photo CD. With GraphicsMagick you can create GIFs dynamically making it suitable for Web applications.  You can also resize, rotate, sharpen, color reduce, or add special effects to an image and save your completed work in the same or differing image format. \" name=\"description\" />\n<meta content=\"GraphicsMagick, Image Magick, Image Magic, PerlMagick, Perl Magick, Perl Magic, image processing, software development, image, software, Magick++\" name=\"keywords\" />\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-programming-interfaces\">\n<h1 class=\"title\">GraphicsMagick Programming Interfaces</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>GraphicsMagick capabilities may be accessed from many languages and scripting\nenvironments via programming APIs as shown in the following table:</p>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"23%\" />\n<col width=\"77%\" />\n</colgroup>\n<thead valign=\"bottom\">\n<tr><th class=\"head\">Language</th>\n<th class=\"head\">Description</th>\n</tr>\n</thead>\n<tbody valign=\"top\">\n<tr><td><a class=\"reference external\" href=\"api/api.html\">C Core</a></td>\n<td>C language API for the lowest-level core programming interface.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"wand/wand.html\">C Wand</a></td>\n<td>C language API for the mid-level Wand API programming interface.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"Magick++/index.html\">C++</a></td>\n<td>Magick++ provides an abstract object-oriented C++ interface.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"https://github.com/arcapos/luagraphicsmagick\">Lua</a></td>\n<td>GraphicsMagick for Lua interfaces to GraphicsMagick's Wand API.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://aheckmann.github.com/gm/\">node.js</a></td>\n<td>Graphicsmagick for node.js provides server-side support for\nJavascript programming with node.js.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://pecl.php.net/package/gmagick\">PHP</a></td>\n<td>Gmagick provides a small and fast extension for PHP.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"perl.html\">Perl</a></td>\n<td>PerlMagick provides an object-oriented Perl interface.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"https://github.com/hhatto/pgmagick\">Python</a></td>\n<td>PgMagick provides the power and ease of the C++ API, but in Python.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"https://github.com/RedisLabsModules/graphicsmagick\">Redis Module</a></td>\n<td>Image processing via redis APIs</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://rmagick.rubyforge.org/\">Ruby (RMagick)</a></td>\n<td>RMagick provides a native Ruby language extension</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"https://github.com/minimagick/minimagick\">Ruby (MiniMagick)</a></td>\n<td>MiniMagick provides a Ruby language extension via a command line\nwrapper.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"http://www.graphicsmagick.org/TclMagick/doc/\">Tcl/Tk</a></td>\n<td>TclMagick provides a scripting environment based on Tcl or Tcl/Tk.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"https://graphicsmagick.codeplex.com/\">Windows .NET</a></td>\n<td>GraphicsMagick.NET provides a Windows .NET programming interface,\nallowing use of GraphicsMagick features via a stand-alone package.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"ImageMagickObject.html\">Windows OLE</a></td>\n<td>The ImageMagickObject OLE control supports utility-style access via\na COM+ object.</td>\n</tr>\n</tbody>\n</table>\n<p><em>Some of these languages and scripting environments are supported by the\nGraphicsMagick Group while others are developed and supported by third parties.</em></p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/project.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Project Information</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-project-information\">\n<h1 class=\"title\">GraphicsMagick Project Information</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p><a class=\"reference external\" href=\"security.html\">Security</a> - GraphicsMagick security (and how to report issues).</p>\n<p><a class=\"reference external\" href=\"Changes.html\">Change Logs</a> - Read the detailed change logs to see what changed.</p>\n<p><a class=\"reference external\" href=\"Copyright.html\">License</a> - Copyrights and usage terms for GraphicsMagick.</p>\n<p><a class=\"reference external\" href=\"contribute.html\">Contribute</a> - Contribute your work to the project.</p>\n<p><a class=\"reference external\" href=\"https://sourceforge.net/p/graphicsmagick/_list/tickets\">Bugs</a> - Report a bug via the tracker at SourceForge.</p>\n<p><a class=\"reference external\" href=\"process.html\">Development Process</a> - Read about the project development process.</p>\n<p><a class=\"reference external\" href=\"download.html\">Download</a> - Download the source code or binaries.</p>\n<p><a class=\"reference external\" href=\"FAQ.html\">FAQ</a> - Answers for the questions asked the most often.</p>\n<p><a class=\"reference external\" href=\"README.html\">Install</a> - Read about how to install the software.</p>\n<p><a class=\"reference external\" href=\"links.html\">Links</a> - Some links we find useful.</p>\n<p><a class=\"reference external\" href=\"https://sourceforge.net/p/graphicsmagick/mailman/\">Mailing Lists</a> - Participate in discussions on our mailing lists.</p>\n<p><a class=\"reference external\" href=\"mission.html\">Mission</a> - Every project needs a mission statement.</p>\n<p><a class=\"reference external\" href=\"NEWS.html\">News</a> - Read the project news and release notes.</p>\n<p><a class=\"reference external\" href=\"authors.html\">Authors</a> - Read about those who provided source code or algorithms.</p>\n<p><a class=\"reference external\" href=\"thanks.html\">Thanks</a> - Read about those who helped in ways other than contributing code.</p>\n<p><a class=\"reference external\" href=\"Hg.html\">Source Control</a> - Source control is important.  We use Mercurial.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2012 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/quantize.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Color Quantization</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-color-quantization\">\n<h1 class=\"title\">GraphicsMagick Color Quantization</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<blockquote>\nThis document describes how GraphicsMagick performs color\nreduction on an image. To fully understand this document,\nyou should have a knowledge of basic imaging techniques and\nthe tree data structure and terminology.</blockquote>\n<div class=\"section\" id=\"description\">\n<h1>Description</h1>\n<p>For purposes of color allocation, an image is a set of n pixels, where\neach pixel is a point in RGB space. RGB space is a 3-dimensional vector\nspace, and each pixel, p(i), is defined by an ordered triple of red,\ngreen, and blue coordinates, (r(i),g(i),b(i)).</p>\n<p>Each primary color component (red, green, or blue) represents an\nintensity which varies linearly from 0 to a maximum value, Cmax, which\ncorresponds to full saturation of that color. Color allocation is defined\nover a domain consisting of the cube in RGB space with opposite vertices\nat (0,0,0) and (Cmax ,Cmax,Cmax). GraphicsMagick requires Cmax= 255.</p>\n<p>The algorithm maps this domain onto a tree in which each node represents\na cube within that domain. In the following discussion, these cubes are\ndefined by the coordinate of two opposite vertices: The vertex nearest\nthe origin in RGB space and the vertex farthest from the origin.</p>\n<p>The tree's root node represents the the entire domain, (0,0,0) through\n(Cmax, Cmax,Cmax). Each lower level in the tree is generated by\nsubdividing one node's cube into eight smaller cubes of equal size. This\ncorresponds to bisecting the parent cube with planes passing through the\nmidpoints of each edge.</p>\n<p>The basic algorithm operates in three phases:</p>\n<blockquote>\n<ul class=\"simple\">\n<li>Classification,</li>\n<li>Reduction, and</li>\n<li>Assignment.</li>\n</ul>\n</blockquote>\n<p>Classification builds a color description tree for the image. Reduction\ncollapses the tree until the number it represents, at most, is the number\nof colors desired in the output image. Assignment defines the output\nimage's color map and sets each pixel's color by reclassification in the\nreduced tree. Our goal is to minimize the numerical discrepancies between\nthe original colors and quantized colors. To learn more about\nquantization error, see Measuring Color Reduction Error later in this\ndocument.</p>\n<p>Classification begins by initializing a color description tree of\nsufficient depth to represent each possible input color in a leaf.\nHowever, it is impractical to generate a fully-formed color description\ntree in the classification phase for realistic values of Cmax. If color\ncomponents in the input image are quantized to k-bit precision, so that\nCmax = 2^k-1, the tree would need k levels below the root node to allow\nrepresenting each possible input color in a leaf. This becomes\nprohibitive because the tree's:</p>\n<pre class=\"literal-block\">\ntotal number of nodes = 1+Sum(8^i), i=1,k\n\nFor k=8,\nNumber of nodes= 1 + (8^1+8^2+....+8^8)\n8^8 - 1\n= 1 + 8.-----------\n8 - 1\n= 19,173,961\n</pre>\n<p>Therefore, to avoid building a fully populated tree, GraphicsMagick:</p>\n<ol class=\"arabic simple\">\n<li>Initializes data structures for nodes only as they are needed;</li>\n<li>Chooses a maximum depth for the tree as a function of the desired\nnumber of colors in the output image (currently based-two logarithm\nof Cmax).</li>\n</ol>\n<p>For Cmax=255,</p>\n<pre class=\"literal-block\">\nMaximum tree depth = log (256)\n2\n\n= log (256) / log (2)\ne e\n\n= 8\n</pre>\n<p>A tree of this depth generally allows the best representation of the\nsource image with the fastest computational speed and the least amount of\nmemory. However, the default depth is inappropriate for some images.\nTherefore, the caller can request a specific tree depth.</p>\n<p>For each pixel in the input image, classification scans downward from the\nroot of the color description tree. At each level of the tree, it\nidentifies the single node which represents a cube in RGB space\ncontaining the pixel's color. It updates the following data for each such\nnode:</p>\n<blockquote>\n<dl class=\"docutils\">\n<dt>n1:</dt>\n<dd>Number of pixels whose color is contained in the RGB cube which\nthis node represents;</dd>\n<dt>n2:</dt>\n<dd>Number of pixels whose color is not represented in a node at lower\ndepth in the tree; initially, n2=0 for all nodes except leaves of\nthe tree.</dd>\n<dt>Sr,Sg,Sb:</dt>\n<dd>Sums of the red, green, and blue component values for all pixels\nnot classified at a lower depth. The combination of these sums and\nn2 will ultimately characterize the mean color of a set of pixels\nrepresented by this node.</dd>\n<dt>E:</dt>\n<dd>The distance squared in RGB space between each pixel contained\nwithin a node and the nodes' center. This represents the\nquantization error for a node.</dd>\n</dl>\n</blockquote>\n<p>Reduction repeatedly prunes the tree until the number of nodes with n2 &gt;\n0 is less than or equal to the maximum number of colors allowed in the\noutput image. On any given iteration over the tree, it selects those\nnodes whose E value is minimal for pruning and merges their color\nstatistics upward. It uses a pruning threshold, Ep, to govern node\nselection as follows:</p>\n<pre class=\"literal-block\">\nEp = 0\nwhile number of nodes with (n2 &gt; 0) &gt; required maximum number of colors\nprune all nodes such that E &lt;= Ep\nSet Ep to minimum E in remaining nodes\n</pre>\n<p>This has the effect of minimizing any quantization error when merging two\nnodes together.</p>\n<p>When a node to be pruned has offspring, the pruning procedure invokes\nitself recursively in order to prune the tree from the leaves upward. The\nvalues of n2 ,Sr, Sg and Sb in a node being pruned are always added to\nthe corresponding data in that node's parent. This retains the pruned\nnode's color characteristics for later averaging.</p>\n<p>For each node, n2 pixels exist for which that node represents the\nsmallest volume in RGB space containing those pixel's colors. When n2 &gt; 0\nthe node will uniquely define a color in the output image. At the\nbeginning of reduction, n2 = 0 for all nodes except the leaves of the\ntree which represent colors present in the input image.</p>\n<p>The other pixel count, n1, indicates the total number of colors within\nthe cubic volume which the node represents. This includes n1 - n2 pixels\nwhose colors should be defined by nodes at a lower level in the tree.</p>\n<p>Assignment generates the output image from the pruned tree. The output\nimage consists of two parts:</p>\n<ol class=\"arabic simple\">\n<li>A color map, which is an array of color descriptions (RGB triples)\nfor each color present in the output image.</li>\n<li>A pixel array, which represents each pixel as an index into the\ncolor map array.</li>\n</ol>\n<p>First, the assignment phase makes one pass over the pruned color\ndescription tree to establish the image's color map. For each node with\nn2 &gt; 0, it divides Sr, Sg, and Sb by n2. This produces the mean color of\nall pixels that classify no lower than this node. Each of these colors\nbecomes an entry in the color map.</p>\n<p>Finally, the assignment phase reclassifies each pixel in the pruned tree\nto identify the deepest node containing the pixel's color. The pixel's\nvalue in the pixel array becomes the index of this node's mean color in\nthe color map.</p>\n<p>Empirical evidence suggests that the distances in color spaces such as\nYUV, or YIQ correspond to perceptual color differences more closely than\ndo distances in RGB space. These color spaces may give better results\nwhen color reducing an image. Here the algorithm is as described except\neach pixel is a point in the alternate color space. For convenience, the\ncolor components are normalized to the range 0 to a maximum value, Cmax.\nThe color reduction can then proceed as described.</p>\n</div>\n<div class=\"section\" id=\"measuring-color-reduction-error\">\n<h1>Measuring Color Reduction Error</h1>\n<p>Depending on the image, the color reduction error may be obvious or\ninvisible. Images with high spatial frequencies (such as hair or grass)\nwill show error much less than pictures with large smoothly shaded areas\n(such as faces). This is because the high-frequency contour edges\nintroduced by the color reduction process are masked by the high\nfrequencies in the image.</p>\n<p>To measure the difference between the original and color reduced images\n(the total color reduction error), GraphicsMagick sums over all pixels in\nan image the distance squared in RGB space between each original pixel\nvalue and its color reduced value. GraphicsMagick prints several error\nmeasurements including the mean error per pixel, the normalized mean\nerror, and the normalized maximum error.</p>\n<p>The normalized error measurement can be used to compare images. In\ngeneral, the closer the mean error is to zero the more the quantized\nimage resembles the source image. Ideally, the error should be\nperceptually-based, since the human eye is the final judge of\nquantization quality.</p>\n<p>These errors are measured and printed when -verbose and -colorsare\nspecified on the command line:</p>\n<blockquote>\n<dl class=\"docutils\">\n<dt>mean error per pixel:</dt>\n<dd>is the mean error for any single pixel in the image.</dd>\n<dt>normalized mean square error:</dt>\n<dd>is the normalized mean square quantization error for any single\npixel in the image.\nThis distance measure is normalized to a range between 0 and 1. It\nis independent of the range of red, green, and blue values in the\nimage.</dd>\n<dt>normalized maximum square error:</dt>\n<dd>is the largest normalized square quantization error for any single\npixel in the image.\nThis distance measure is normalized to a range between and blue\nvalues in the image.</dd>\n</dl>\n</blockquote>\n</div>\n<div class=\"section\" id=\"authors\">\n<h1>Authors</h1>\n<p>John Cristy, <a class=\"reference external\" href=\"mailto:magick&#37;&#52;&#48;imagemagick&#46;org\">magick<span>&#64;</span>imagemagick<span>&#46;</span>org</a>, ImageMagick Studio.</p>\n</div>\n<div class=\"section\" id=\"acknowledgements\">\n<h1>Acknowledgements</h1>\n<p>Paul Raveling, USC Information Sciences Institute, for the original idea\nof using space subdivision for the color reduction algorithm. With Paul's\npermission, this document is an adaptation from a document he wrote.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/reference.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Reference Information</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-reference-information\">\n<h1 class=\"title\">GraphicsMagick Reference Information</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p><a class=\"reference external\" href=\"color.html\">Colors</a> - Reference of colors known by GraphicsMagick.</p>\n<p><a class=\"reference external\" href=\"FAQ.html\">FAQ</a> - Answers for the questions asked the most often.</p>\n<p><a class=\"reference external\" href=\"formats.html\">Formats</a> - File formats supported by GraphicsMagick.</p>\n<p><a class=\"reference external\" href=\"miff.html\">MIFF</a> - Magick Image File Format.</p>\n<p><a class=\"reference external\" href=\"links.html\">Links</a> - Some links we find useful.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2012 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/security.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Security</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-security\">\n<h1 class=\"title\">GraphicsMagick Security</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"section\" id=\"background\">\n<h1>Background</h1>\n<p>Although GraphicsMagick is image processing software, security is a\nvery important consideration for GraphicsMagick.  GraphicsMagick may\nbe used to open files and URLs produced by an untrusted party.  Given\na suitable weakness (which we make every effort to prevent), an\nintentionally constructed file might be able to cause the software to\ncrash, leak memory, request huge amounts of memory, run forever, or in\nthe worst case execute arbitrary code, including shell code.\nGraphicsMagick is very powerful and complex software supporting many\ncapabilities and so untrusted parties should never be allowed to\nsubmit arbitrary requests into it.</p>\n<p>GraphicsMagick includes the ability to access arbitrary http and ftp\nURLs as well as local image, font, and SVG files.  The SVG renderer\nsupports read access to http and ftp URLs as well as local files\naccording to the SVG specification.  Since URLs and local file paths\nmay be included in SVG files, untrusted SVG files may create a Server\nSide Request Forgery (<a class=\"reference external\" href=\"https://cwe.mitre.org/data/definitions/918.html\">SSRF</a>) vulnerability since URL requests are\ndone by the computer executing the SVG, which may be in a realm of\ntrust (e.g. inside the firewall and able to access &quot;localhost&quot;\naddresses).</p>\n<p>The <cite>-comment</cite>, <cite>-draw</cite>, <cite>-format</cite>, and <cite>-label</cite> utility options\nsupport a <cite>&#64;filename</cite> syntax to incorporate any readable file on the\nsystem as a convenience to the user.  If text from an untrusted source\n(e.g. a web page) is allowed to supply these options, then they may be\nused to read arbitrary files, creating a potential security hazard.</p>\n<p>The GraphicsMagick project is continually striving to eliminate\nconditions in the software which might pose a risk for its users while\nnot constraining what its users may do with the software.</p>\n</div>\n<div class=\"section\" id=\"reporting-issues\">\n<h1>Reporting Issues</h1>\n<p>If you become aware of a serious security issue with GraphicsMagick,\nthen it may be addressed by email directly to the GraphicsMagick\nmaintainers or to the <a class=\"reference external\" href=\"mailto:graphicsmagick-security&#37;&#52;&#48;graphicsmagick&#46;org\">GraphicsMagick Security</a> mail address.  More\nminor issues are best addressed via the <a class=\"reference external\" href=\"https://sourceforge.net/p/graphicsmagick/bugs/\">GraphicsMagick Bug Tracker</a>\nat SourceForge.  Please remember to set the bug to 'private' if you\nuse the bug tracker or else someone may aquire a zero-day exploit from\nyour report.  We will set the bug to 'public' as soon as a remedy has\nbeen made available.</p>\n<p>Reporting an issue will allow us to fix it so that future releases of\nthe software won't suffer from the problem.</p>\n<p>The current state of free software is that security-sensitive free\nsoftware projects have been undergoing automated testing by machines\n(and sometimes what might be hundreds of machines).  Machines do not\nneed to work at a day job, take care of families, rest, or eat, but we\ndo.  Any bug report which comes with a patch or changeset to fix the\nproblem is greatly appreciated and helps to move the project forward.</p>\n<p>The remedy available to us is to submit a changeset to the\nGraphicsMagick Mercurial repository, and include the changes in the\nnext release.  Regardless of how an issue becomes known to us, the\nissue will become public knowledge as soon as we commit a fix to the\nsource code repository.  Only in exceedingly rare and dire\ncircumstances (e.g a previously-unknown zero-day shell exploit) might\nwe do anything different.</p>\n</div>\n<div class=\"section\" id=\"safe-use-of-the-software\">\n<h1>Safe Use Of The Software</h1>\n<p>You are the first line of defense when it comes to GraphicsMagick\nsecurity!</p>\n<p>If you are operating a server which supports file uploads from\nuntrusted users, or delivered via a network protocol such as http,\nftp, or email, then you should take steps to assure that a problem\nwith opening/processing the file does not place the whole server at\nrisk.  These are steps which can be taken:</p>\n<ol class=\"arabic\">\n<li><p class=\"first\">Subscribe to the <a class=\"reference external\" href=\"https://lists.sourceforge.net/lists/listinfo/graphicsmagick-announce\">graphicsmagick-announce</a> mailing list so that\nyou are informed about new GraphicsMagick releases or special\nsecurity bulletins.</p>\n</li>\n<li><p class=\"first\">Make sure that GraphicsMagick is up to date as reported on the\nGraphicsMagick web site.  Don't simply trust that packages from\nyour operating system vendor are kept up to date or are updated to\ninclude security fixes.  Keeping GraphicsMagick up to date might\nrequire that you compile GraphicsMagick yourself from source code.</p>\n</li>\n<li><p class=\"first\">Execute the software in a <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Operating-system-level_virtualization\">Container</a>, <a class=\"reference external\" href=\"https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html\">FreeBSD Jail</a>, <a class=\"reference external\" href=\"https://illumos.org/man/5/zones\">Solaris\nZone</a>, or <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Chroot\">chrooted</a> environment such that it can not cause harm\nto the system running it.</p>\n</li>\n<li><p class=\"first\">Execute the software as a least-privileged user (e.g. 'nobody').</p>\n</li>\n<li><p class=\"first\">Normalize input file names or any other external inputs so that\nthey are under your control and not controlled by an untrusted\nparty.  This should include any file name specifications, which may\ninclude arbitrary 'glob' patterns (wildcards) (requiring hours or\ndays to complete if sufficiently close long file names exist), and\noptions supporting a <cite>&#64;filename</cite> syntax.</p>\n</li>\n<li><p class=\"first\">Enforce that uploaded files are passed to the expected reader.  For\nexample, the uploaded file &quot;file.jpg&quot; is forced to be read by the\nJPEG reader (rather than a reader selected based on header magic\ntesting) by using the file name &quot;jpg:file.jpg&quot;.  If the file is not\nreally what was indicated, then an error is reported.</p>\n<p>GraphicsMagick supports a great many file types and auto-detects\nmany file types based on their content rather than file extension.\nThe file which pretends to be an ordinary PNG or JPEG file might be\nsomething else entirely.  Note that even using independent file\nheader testing may not be sufficient since it is possible to\nconstruct valid files with a header which appears to be several\ndifferent types, but the first type which matches while testing the\nheader will be selected.</p>\n</li>\n<li><p class=\"first\">Apply resource limits via the <cite>-limit</cite> option or the\n<cite>MAGICK_LIMIT_*</cite> environment variables (e.g. <cite>export\nMAGICK_LIMIT_PIXELS=30Mp</cite>, <cite>export MAGICK_LIMIT_MEMORY=500Mb</cite>).\nAlso consider setting resource limits using the <cite>ulimit</cite> command.</p>\n</li>\n<li><p class=\"first\">Consider using the <cite>MAGICK_CODER_STABILITY</cite> environment variable to\nconstrain the supported file formats to the subsets selected by\n<cite>PRIMARY</cite> or <cite>STABLE</cite>.  After setting this environment variable\n(e.g. <cite>export MAGICK_CODER_STABILITY=PRIMARY</cite>), use <cite>gm\nconvert -list format</cite> and verify that the format support you need\nis enabled.  Selecting the <cite>PRIMARY</cite> or <cite>STABLE</cite> options blocks\naccess of http and ftp URLs (<a class=\"reference external\" href=\"https://cwe.mitre.org/data/definitions/918.html\">SSRF</a> vulnerability), but does not\nblock SVG renderer access to read local image files.</p>\n</li>\n</ol>\n</div>\n<div class=\"section\" id=\"pgp-public-key\">\n<h1>PGP Public Key</h1>\n<p>The following PGP public key (belonging to Bob Friesenhahn) is used to\nsign release files on the ftp site and may be used for private\ncorrespondence:</p>\n<pre class=\"literal-block\">\n-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQMuBFvWDmMRCACvO+aWyRPlp7jezY8m4t8q+MkLQXczLCoC8sUVQ5qd5T28HsfD\nrUVzrFYY6pWT1K3AgTTKZnVcBO5lyZtLLS6HQI41FESp1Gp/FtyisYbOlQAeOvfG\nyJVCQe16QoaHye0UIC8rs2VqH055nSewk7YOpEg9PNdHce0/Mvajkxyj2Eb6C4jp\nmZuvcPhU4MaEqo9yAlSnRztwqmmDwvO60LPEoS7WRUB3oEqDGGR8wnMARbCwjlVn\nkMHd5BqgOnFDhqxxGnQzq+dv9C4RKGZtpIFl+jVpx9m5DszF9ZYEDtNMwxAoCIia\nmZE0DkxTwI5lbwe9Pc3HZSK/wEF7Df1HC/U7AQDoVpk/g33Tllvsd52UYUZM1aca\n3qaPM6orhVLXysaI+Qf+LoRoQgTlQX4IP19Z2t8MIx7VP08SOsrZdNAwIgHO4fhs\ndOX6okfwpiYOl1bGqnakprit4HarAhtSM0Xd8JPtXImPqzHN07yz6jhCKZBIFWGC\nkJSzPFar+P/jCmCWArL7DfBelBw0aHiV7HmSqEQJsyKVZBYjgHmXzjLkp3zsFRaR\ntAj3TnB+nN4uXCchv63bVmYd3Cv55AZyugJb49Kl5PHqHarcle39Gbhg/UPPiduo\nzIQKqtsKZcLckxZWi5f3XF/BnIY+uKdbOssTY0u8hyCqj904KdUl50GtYEb274EZ\na7ZepmcSp6a3aTtQmmHMf1MP/5U7Z6c6fNha4N3Xwwf+O1Zhc0Y11JSEV8G/2gAC\nrjwYCIQ17w6/KDUe4nflxZpCsTP7+YOwmaXRSBqBoCz5N3ZH9jTp0xu73l6hK5wY\nLodkfYHRhIMSyRCrW4T7yalUlpcuJy0NhFUnCDALgkjAhLUi4goJ+nsnOIJWC1dp\n5DhZtClRTWNIHWK1AmIrWAUBuodpcp6K1NouJFenQB/NtwHS71J+ILli9LTxt6jM\nCvaOAseRjvOs8JxG3pBm2LPOvZDyvQQFvfrTgqOlcMgqVp4mIqTKeEtXa2AQWrCG\nQK5Ig3ZxfiQuNYIYNRsbag8Xyo8/udvbMDXVOAWQlmQz2B/Ge23rTGQZPMixoA+e\nJrQuQm9iIEZyaWVzZW5oYWhuIDxiZnJpZXNlbkBzaW1wbGUuZGFsbGFzLnR4LnVz\nPoiZBBMRCABBAhsDBQkSzAMABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEE69/b\nIbAg7o/RUaiN4wEEfeEZiXUFAlvWDvECGQEACgkQ4wEEfeEZiXXLpgEAqPfOR6nD\niq8o/5RZ57f8UFNSPBiLTFbi/FTHhn9FV/oA/14uiKfpWhhKib3INfOZweDC0sHX\nGdULE2Nrbx54Rn/otCxCb2IgRnJpZXNlbmhhaG4gPGJmcmllc2VuQHNpbXBsZXN5\nc3RlbXMub3JnPoiWBBMRCAA+FiEE69/bIbAg7o/RUaiN4wEEfeEZiXUFAlvWDskC\nGwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ4wEEfeEZiXWxkwD8\nDK9I1UeGW8TIQQ5zzyk9Ue2+0C3RP5R45Dg3cg9W01oA+gIELZMu+15wCOG22dRO\nNAvZUjNS8TrGIWtGvQNE5IYctC1Cb2IgRnJpZXNlbmhhaG4gPGJmcmllc2VuQGdy\nYXBoaWNzbWFnaWNrLm9yZz6IlgQTEQgAPhYhBOvf2yGwIO6P0VGojeMBBH3hGYl1\nBQJb1g7jAhsDBQkSzAMABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEOMBBH3h\nGYl1RekA/2UUHeqkrePzLtI10VfprqAgjYYRIb4Ue/Y18hzSHYEyAP4+LBt/y6CS\n5kq5G7RtM072ujLm4LMRu+KKGmSVQz1u2LQrQm9iIEZyaWVzZW5oYWhuIDxib2Jq\nZnJpZXNlbmhhaG5AZ21haWwuY29tPoiWBBMRCAA+FiEE69/bIbAg7o/RUaiN4wEE\nfeEZiXUFAlvWIvsCGwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ\n4wEEfeEZiXWYugEAv6hEjxqDR2pZu6/2qrG642OMk0lHVlFjla3F8hpMabIBALNd\npWvc+nb/HbZTWT5cebhA8Z/dExYTjB9jUIdNYAbU0dKI0oYBEAABAQAAAAAAAAAA\nAAAAAP/Y/+AAEEpGSUYAAQEBAEgASAAA/9sAQwAUDg8SDw0UEhASFxUUGB4yIR4c\nHB49LC4kMklATEtHQEZFUFpzYlBVbVZFRmSIZW13e4GCgU5gjZeMfZZzfoF8/9sA\nQwEVFxceGh47ISE7fFNGU3x8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8\nfHx8fHx8fHx8fHx8fHx8fHx8/8AAEQgBBQDEAwEiAAIRAQMRAf/EABoAAAIDAQEA\nAAAAAAAAAAAAAAABAwQFAgb/xAA1EAABBAAFAgQEBQQDAQEAAAABAAIDEQQSITFB\nBVETImFxIzKBkRRCUqHBBrHR8CRy4VPx/8QAGQEAAwEBAQAAAAAAAAAAAAAAAAEC\nAwQF/8QAIBEBAQACAgMAAwEAAAAAAAAAAAECERIhAzFBFDJRcf/aAAwDAQACEQMR\nAD8A9MmkmmgJoQmDQhCQNCEJgJoQgBChfiWtdlaM55rYKE44NP5SeaKQ0uoConqL\nQdRp6FdjHMcQMzWj1KNjS4hQiYH8wPsVK0gj0QDTQhACEIQAhCaASaEJGEIQglZN\nCYVAIQmkAmhNACFHNNHBGXyvDWjkrCxfW5Z3+Dg2lpPNalAk228RiocMLleAeByV\nhdQ67mOSG+xA3/ZRswMkvmxMpBO4adT7lWoMLDh21FG1oUXJrMGZHJ1DEnWIhg2B\n8oVhuFxjmgOdG0e5K02hdAJbaTBnfgZq0kafbRP8JiAKDz9Fo0utktjgyM0+HdYF\nfRXML1YWGygtPcK0Q1wIcL91Tn6bHJrGSw71xacqbg2sPiGTMBa4G+ymXlRJicBJ\nrY107Fa3TerxYs5H3HJtR2JVysrjpqpICaaQhCEAIQhIwhCEwrppBNBBNJNANRYn\nENw8ZcdTsB3K7cQBrovO9Z6sG3HCC52wQNKWOkxvUcaIswaOa2aFo4TDRYSPJENe\nXHd3uocLF4MWvzu1ee5VtgtZ2t8cdJAuwEmhdtClqAF1SNF0AkZUhd0kgOU6QnSA\n5dG2RpY8AtPBWH1LAOw5EjLLBs69R7rfASexsjCxwBaRRBTlRZtmdK6zKwtixJL2\nHQOO4Xo2PbIwOYQWnYheHxMBwGLfEbyEW0ntwtro+Py0x7hlO/v3WkrDLF6BCN0K\nkBCEIMIQhIK6a5TTI00knGmknhAZfWcb4bPBjdT3D7DuvN4MHEYwvqo4/wBypMXi\nXYnETSa+c0PZWcHEIcO0VqdSprTGLrNQpmLiIeVdtWbeJ2KVoChYpm6pKMjZABXR\nGyKQBRQbQUAoBhMhIFdboIkIQgMzrmFM+E8WNtyRa1+ochY+EmEbWk2WO0BPHofV\neqdq0grzpwrRPPh3aNJtp7K8WWT1PT5fGwcbr1Aoqysb+nZiYJIX6PYdVtLRjSQm\nkgBCEICradri07SDu1V6nJ4XT53XRy0FYtZ3XnV0yQDckD90B5iMgkWTZND0C1I9\naWTCfi2BY2WzBVWpya4rLRQXbVwx7CaDh90zLGzXMFDVO1WGBZoxsPiZQ4WrsMzX\nmgUHtMQlei6cQHNHcII8pSNxVrsNSZRFrtppAKkFPMLSKZBCSaROSsrGDLjWkfmF\nLVKzce23NPY/ZVPaMvSfpALcWTW4ylbqxeln/lHs4X9VtLVhSQhCAEIQgKNp2uLT\nCRurWT/UcmXAtHd9/YKx1PqLenQskdE6QOdXl4WTNjGdadFC1ro3B1lpB2re0QMv\nCOLpAaJA9F3iJ5nGg6OMcHxAD9la69HHh3RQxU1gZfue5WWMGHZRkKSoCZLP/Miv\nuHKF7cQbAlbIPR4/ytODpTHfN9lbHRoDu0JbiuNYMMkkcgE7HjsSKXpOm4gkgA7L\nlvTGZXZSAGiyCd0mxtwoYQCHXr29KSt2qTTXM2ado9FZcaiJWTA/PPm4AWpYdGaI\nOilr8V/xGRt/dU39Re3K0aOOps1SeJJaSwDlVHYbO5zpDZIqhsE5EZVHP158DnBu\nR3uaXcX9SsLR4jCL5GyryYPENPwGRtHfIFxLh+pvykyE0KALQaH2VaiO2tF1yB58\npDh2vVaWHxcOIAyPAJ4O68m6PFRn4kMT/eMD+ynwxLZB5fCdwWmwfoUuJ8q9Udln\nYt2Ug+qs4fEGQZJBlkq/Rw7hVMfpde6J7F9LfSac8G9iVsLB6K4+O5vG63lowoQh\nCAEIQgM5MJJhSpFisNHi8O6GUeV3bceqzWfisFQxERxAhGWN8ernt9u4/dXsTjRC\n7K0Znc9gqb8cXzxOc0AMu6PCNq43W2L1iZmM6lD4Ts8bwKKslrImhzjoOUY0RzdV\nbNGwCm+Z1VZTdEZt9ApyqsIrnqDi7LG0l36Rx7lVD1jEFxADQB3ctiHBxsbo0A9w\nqj+hwPmLjI5oOtCkTSrMvjnD46RznNf8KRhymzmaT7qeWd0rSx7HAkfk1P0XYwMU\nEJjiILXGzm3KpY1skdRRE+cZRR2vc/b+6OtjvisdJwgxbc80kjh2ugtg9Oa2KoJZ\nYqN+V3P1UfTomxQNa3QAK8HdlO6vj0ycOZfFlbNL4hj2NV/pUj5mMbZIACrYvxIc\nc4Rg1I5poC7Gx/hdy4enEtIIGluKdTHbMW0nRjj76KwMYx7ySyu+TWvosHHskjlH\nntuW96srnARfiMZGGZ2fMXAPuv8AdE5iVy1XpS1k7aaQ4Kv+CLHG2HKPTZRQmWHE\nhshzEEVIBv6OW9IGyREtcNtdUr0VZ2KbL4DPw+UTAjIXbLOkxM4kP4uB7DYAIAyg\nHueVrv8AmjB4dazuqPANO0BBBVQrFzpDSzFubd0KK3Fh9Ft09uGoYL96C3FcZX2a\nEIQQQhCAzkwkmFKnmcU/EPnd4ZoXa4OctIkAtwG3ZX8RHlne0dyFWxDalib62foF\nM9ujP1NOWktpsu36uPr2V6JrXNGWj7KvCddiphDC45sgB7jT+yVTFlsY5T8JlWVA\n2Ng2dKB2zlN0UVate/8A7OJSaK+JkYDkiGd/YbD3PCqMjLpc7zmLef8AHorkoOXK\n0BjewUIAAIQFvDSHQBXm7WVRwjL1V9tbIUrYuMuyyNoOadCos4l/LRG4PBV1zbBB\n5UEmHsB2ocNnD+U0a7Rsa2sr42lvqF3Fh4Y3EsjDeNBS5D5GkAta760rDJHf/B59\ni0/ygWQNaL2UwBaw1suAZSfLAR/2cAuvDlefiva1v6Wc+5KNFa5Z8WW26sZoD3Kp\n45oc9xrYi/RabGhgDQKA4VHGNqU38sjKKcqMp0v9MhbDDmLgZH6nXYdlfCzGECJl\n18o3VrDSX5bscaqpl8Tl4+trKEIVMjQhCAzkwuUwpUz8c0NxLT31WdibGJbppS1e\nos0jkH5TSysa4eNC6xRtR9bzvBZw40Vto0VSA6BWwdLCRwz2pRuPCkvRRlJcQTaN\nVbeh6qxLqCoZAI47JArkpwq0sOwBgpTtjJdfCp9PxQljFEEjkG1fbJqnobJzK1Qw\nA6cIkkFgWBabRWyVDh+HadQFy1mUiiVYCKHZAJgJ5K7DAEAUmChNjl26p4s3LG29\nCDatuPmIWfijnxbQD8oTib30vvY2SLVunCjwTGxYtwYTltSQOaWZfRPBsJlc/gFE\n9rvWNX0JJrVyBCaEBmphJNSpzMzxInN53C851T4Yjygb3/lemWB1pmWUNrRwJCWu\n1S9acYV9sDuFfD7CxMDMdWna91psfbjSmtcatNdaHBcRFSOdQUtIrzGmk9lR6phn\nY3Dhsb6G/ur0725aOqpRNklcRH5GcknhOSllZ9VukwzYAeeqcbIBsLdje5xvhcQw\nHIM2ulFdyOc1lMGwGytH+MjDx4t/Vn4rEkhpcWMHGXhejjdY0WdHIS5zHjQa3Wy0\nImgN02U1eNmkoXYXC6UmLpLNok86KJ7twE00y7c9lVgp0ksjt/l912ZBIQBzofRT\nQYcZibHsq+Il7EIy2eFoQMyRAcnUqsxpfLVeUH7q4njC82Xw00k1bAIQhAZqaSal\nRrI64wlraGpBC11Q6nHnaK7FEDzTSYbaBbgaF+ivYeexRNqji7YGyaeTUqOCcNkA\nHJ0SsaS6egErWNtxpVZcc296UTneNJlGrWts+/CrFzTiBoSAaHb3SmKrn/E7ZjPI\nQbAHqruGDYcwNOOVun3A/hZ2Ghe3ERmVvlPblabXND3Ea63/AIVRnbatRSF0Ugde\nhoouwATR0B9FA2VrXObqc2ug5Xcbmud5tB8pKD7jp7PzaZxYschd4fEtbe9Hj91F\nLMDbjoAwnTdUnYjMyMtNOePlHFIolsb7XtdsV2CsSLEB5zG8xOlaa+qvYfFEnI/R\n1WPVZ2NZktvIrVUZJhZYDr3UuImHgmjqs2I+JJbtDv8A+pyJtWMI7MTffRbDQAL5\nWbhoqnAO1rVijsAnbgKtI3Jd1JGzKL5K7QhX6ZW7uzCaSaAEIQgM0JpIUKNQ4ttx\nX2UyT252FvdM3kuoRfDu9CdlR8PLK0uFNvfst7FQZnlrhq02FRmhysLq0bdE+qDP\nDuAwbnEAEmw30vS/suIp4g03Ys73qVSfO4wsDXZW0AQe4U7Mr21ltu59UWiTa67F\nRuBLi0nvey6in8RtMzEDaguIRFuYmj6LSiEeW7LfdTttJFOOZ7Xi2kV6Ky97nNrK\n6uNFbbC0nyuFrsQkncE+6e1ajOLixpu6OtEKIRxHKYyAW3QWx4RHDQqs+Fhf53AE\nj9OiNpsjL8Tw3hwNg7g8lW2yuzMNgDVwJ40Uc+AY0Zm2Ne9rqDD5mPr5kts6c2Iz\nOaRdEbKaOIuexxGlVf7qsxpMoBAFG233W3HBUbB20KqQrRGLksC/MFpMFNAKqYaE\ntdbtVcTZ0JpJpkaaSEgaEIQGahJNSo0wkmg1PHRA+YDcarzmNmtkrR5gR27L1szP\nEiI5XnJoWsxZz2WuFaDdUGPgsE7FSuLh5Wmr4Wo+BkDQ2MXQ0FLRw8LI4sopjBtl\n1v8A9XMsVyBxbduAq1NVjYrQQuOYvdmIFG9gVaw7GeEC46uK5ja510QBZvTSu391\nwHRweGXmg11C+AnBdrD/AJ5Xg5ctAWp35hqDu0G/2KqR4qN7HuLSA55FuG9jT/fZ\nTjENcMgIOawD/CeoXKos73ucMxB0+65aHaG/RdNzid7OTlN/79FbDAS5vqVOlckD\n2ktoV6qCAmKUHSgav0WjHCxwNGtPsoMVhHPBLBrzXdKQWqFEvAPzBxP0tbuCOaNz\nSSaNi1jx+WVjng+ITRJ5W5hIso13O6uIqxEKGqkXIFBNNBppJpA0IQgGhCEBmJpI\nUqNNJCDdcLHxI82bkHstdYeLxELZ/Bc8ZydAnCaOGa3L5tXFtk9go3NzyNNO9PQJ\nwvDi4N9zamyB7zuTaoRAGBpNN04pRmIOcKs9waVp7fLTSA0bmlAb8IAD5jeqixrL\ntCYBK5zKto3ICkiw4I20F/dON1AtbppqfqVLC7LGe5KQcxsBc11eZhrbcKWhmIH0\n+6cDT+IBrQ3f0XToyXuGxHyn90y6d4YuzBrxRHNbqyYhR9eFxDTmBx0J0KlJNU5X\nIzyrMlhBkAduTuB6/wB1oYY39lBLXzVvpqpMGbkefRK3s9dbW00kIQaaSaAaEIQD\nQhCAy01nP6o0HyRkjuTSgl6nK8VG0R+u5UbjaeLKtaSVkTc0jg0dys6Tq4LqhZYH\nLlmyOe+3PcXHuSowKAStbY+GfV6TqM8gIz0D2FKiyFrfinWV+uZMLsaxt9giU88Z\nJ0u4Kf5g7QVS1mWBodatedIc0B7SR7LTwWLa/IzMb222WkrmyxXg24DfJJUZFAkg\nVltqkJDRpyVG7zUAf97J6TtXaKlDBp5QSiEF2dw+UaV90nSZJiSNtR9f/wAUkJIj\nJA1ddUlo9rTfJzsAfupqtmY6ktUbMpaTuC0BSBwzDsdE9Fak0aRtqkX2wncqOaQE\nV2XG+vdO3QmOyldXl4CgzOaSWuLT3C7fqVGNzysbW8nWleXFdQwzi9jzOz9JAsf5\nVrB9Y8ePMWA8GtCEZbVANEeJmrSyL96RuqmMy6sehgxMc/yHXsd1MvOxyEPsGloY\nHqQcfCnPmGzj/KqZIz8NncaaEgbTVOc0IQgPE7hACGbJhYvSIjRcOFKalwQg0QUk\nY+Dr7LghOF/mew+4REeT0sxAFhB4UbmOifnZpym05JG9ireXM2+FW2FiGLGTM3dp\n6q14zZAasGvuoBC0k1SnjhA11VyouJkGQEHbddMaWM0qq0U0cYI7Fd+BYT2nTiKS\nmhrj7qbOKAC48Dm1IG0jkOLkMvfZdONBdcKJ5oKLWkmnPdyTBaZ0aiMeW0jDnBjS\n47ALLa4yFz/1G1Zx8t1C3d2/sq7RQUtvHPqRpoEqOJxyl252Se7yn9l3EKbXYIaL\ncONlhAyutvYq5H1iO8srHA9wLCyeKKVJy2M8vHjl7egb1DCuF+KB7hCwLpCrkj8f\nFRYu0IUtjCCEISNG4KJxyzMI5tpQhETn+q05vw77K9hzcYtCE4wFZXabFStOtUhC\nok7ApWuIQhNNMnZG6EJAHZQu+coQkopRTVy55jgLhqUIQGVGS8ukcbc4qW9EIUuq\nenG8jRxuu2H4lIQg3ZCChCCcOOqEITD/2YiWBBMRCAA+FiEE69/bIbAg7o/RUaiN\n4wEEfeEZiXUFAlvWLooCGwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA\nCgkQ4wEEfeEZiXUcvgD8Dd3c9PMFe8l36YcKLs1ubSEF30mu3b/s8oG7CgeBdOcA\n/062qY6F+Hy0GK/kc5WN9pr5rvFcdS/Tz8wDq5d1shjYuQINBFvWDmMQCAC0JHbI\npX4rz6HzifXiVvPKKgOFdxRs4xZkOA8/sPcK3rB34waMuOgBme6jL7iJNfbC60eo\nTIMv75i0C1MWxQReoR+UA+mQctuvpcrkzzceEYH2JWFf0NZZtT5wYoJ8JNfW1ngi\nr/QhPRWC4fNfJQiJhWdf4sdP2BnW0hi5IIPnmkHQ44G0xBQpOqPrv7A8F97ROGYD\noS3LNmKmfLV9nKRBH+NmQ+zdaToNcQTOlSbMVZ/hag1F9LSmAUFcqXr9bKKk/qKj\nRBkEweAsYppTgn0N7StNtcT9aR5zZkqJ9FBgls6LSr2H6QPiaGZeixZrywjxz2ku\nxz5C1D92ZVAe0qhTAAMFCACyCRhU7YmWUdC3D5rMna97JhFu2fQygn5FQEuHOFao\nabaUicXCxlW3IKQqBjOcpN6rZl+crapYVKGCGM4nMvmxEqqRBYAHLw8vc3Nfys/O\nAXWxI6kiZlVAIX/Q0IZveFejRCoEo6bBabGSfDHWH7QqZXEo2TNWiGJ6oLOyIISl\nx1MM4e9jRSufukrtTfsU8HDoWKycRSnaxtYOz4FAAofrCeQ6/Nf3Vf887NXXD1I6\nxMp9vyuYqx68SrqtmX9FauagsHzmLylYI42JciTCvje09D9kAHFaidkR58DVgzPW\nxFQCGBDO8Rrk1lVjO2gX2bVzKW1J+67ENM1YdWjiVzt9iH4EGBEIACYWIQTr39sh\nsCDuj9FRqI3jAQR94RmJdQUCW9YOYwIbDAUJEswDAAAKCRDjAQR94RmJdRzqAQCZ\nKJFm7j0Zug7NN+IPTqnIrPCioJkt1iGbec6SbBHh5AEAy5JEbI2ugQEePaIMGWVV\nakWaTz0WKIOiD9Lm2ylI9J0=\n=UAq2\n-----END PGP PUBLIC KEY BLOCK-----\n</pre>\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/smile.c",
    "content": "/*\n  Display a smiley on your X server.\n*/\n#include <stdio.h>\n#include <time.h>\n#include <sys/types.h>\n#include <magick/api.h>\n\n#if defined(__cplusplus) || defined(c_plusplus)\n#undef class\n#endif\n\n#define smile_width 48\n#define smile_height 48\nstatic unsigned char\n  smile_bits[]=\n  {\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,\n    1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,\n    1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0,\n    0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,\n    0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,\n    0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,\n    0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1,\n    1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,\n    1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,\n    1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,\n    0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0\n  };\n\nint main(int argc,char **argv)\n{\n  Image\n    *image;\n\n  ImageInfo\n    *image_info;\n\n  int\n    y;\n\n  register int\n    x;\n\n  register PixelPacket\n    *q;\n\n  register unsigned char\n    *p;\n\n  /*\n    Allocate image structure.\n  */\n  InitializeMagick(*argv);\n  image_info=CloneImageInfo((ImageInfo *) NULL);\n  image=AllocateImage(image_info);\n  if (image == (Image *) NULL)\n    MagickError(ResourceLimitError,\"Unable to display image\",\n      \"MemoryAllocationFailed\");\n  /*\n    Initialize smiley image.\n  */\n  image->columns=smile_width;\n  image->rows=smile_height;\n  p=smile_bits;\n  for (y=0; y < image->rows; y++)\n  {\n    q=SetImagePixels(image,0,y,image->columns,1);\n    if (q == (PixelPacket *) NULL)\n      break;\n    for (x=0; x < image->columns; x++)\n    {\n      q->red=MaxRGB*(*p);\n      q->green=MaxRGB*(*p);\n      q->blue=MaxRGB*(*p);\n      p++;\n      q++;\n    }\n    if (!SyncImagePixels(image))\n      break;\n  }\n  /*\n    Display smilely image.\n  */\n  DisplayImages(image_info,image);\n  /*\n    Free resources.\n  */\n  DestroyImage(image);\n  DestroyImageInfo(image_info);\n  DestroyMagick();\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/thanks.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Thanks</title>\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-thanks\">\n<h1 class=\"title\">GraphicsMagick Thanks</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>We would like to thank the following organizations or individuals who\nmay have not contributed code but contributed substantially in other\nways:</p>\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#fuzz-testing\" id=\"id1\">Fuzz Testing</a></li>\n<li><a class=\"reference internal\" href=\"#security-analysis-reports\" id=\"id2\">Security Analysis/Reports</a></li>\n<li><a class=\"reference internal\" href=\"#static-code-analysis\" id=\"id3\">Static Code Analysis</a></li>\n<li><a class=\"reference internal\" href=\"#software-analysis-tools\" id=\"id4\">Software Analysis Tools</a></li>\n<li><a class=\"reference internal\" href=\"#additional-acknowledgements\" id=\"id5\">Additional Acknowledgements</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"fuzz-testing\">\n<h1><a class=\"toc-backref\" href=\"#id1\">Fuzz Testing</a></h1>\n<blockquote>\n<ul class=\"simple\">\n<li>Gustavo Grieco</li>\n<li>Agostino Sarubbo</li>\n<li>Jodie Cunningham</li>\n<li>Gynvael Coldwind and Mateusz Jurczyk of the Google Security Team</li>\n<li>Hanno Böck</li>\n<li>Tobias Ospelt</li>\n<li>Michal Zalewski</li>\n<li>Moshe Kaplan</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"security-analysis-reports\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Security Analysis/Reports</a></h1>\n<blockquote>\n<ul class=\"simple\">\n<li>John Lightsey</li>\n<li>David Chan</li>\n<li>Federico Larumbe</li>\n<li>Petr Gajdos</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"static-code-analysis\">\n<h1><a class=\"toc-backref\" href=\"#id3\">Static Code Analysis</a></h1>\n<blockquote>\n<ul class=\"simple\">\n<li><a class=\"reference external\" href=\"http://www.synopsys.com/software/coverity/\">Coverity</a> was used (free of charge) to perform static code\nanalysis of the software.  After resolving many issues, there are\nnow zero reported defects per 1000 lines of code.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"software-analysis-tools\">\n<h1><a class=\"toc-backref\" href=\"#id4\">Software Analysis Tools</a></h1>\n<blockquote>\n<ul class=\"simple\">\n<li><a class=\"reference external\" href=\"http://lcamtuf.coredump.cx/afl/\">American fuzzy lop</a> was used (by many) to produce and discover\nmany of the files which caused problems for the software.</li>\n<li><a class=\"reference external\" href=\"http://quickfuzz.org/\">QuickFuzz</a> was used (by Gustavo Grieco) to discover issues in the\nSVG renderer.  <a class=\"reference external\" href=\"http://quickfuzz.org/\">QuickFuzz</a> provides specific support for a set of\nfile formats and is very good at chasing down and isolating\nweaknesses.</li>\n<li><a class=\"reference external\" href=\"https://code.google.com/p/address-sanitizer/\">AddressSanitizer</a> (ASan) was used to detect and isolate memory\naccess issues.</li>\n<li><a class=\"reference external\" href=\"http://www.valgrind.org/\">Valgrind</a> was used to detect and isolate memory access issues as\nwell as memory leaks.</li>\n</ul>\n</blockquote>\n</div>\n<div class=\"section\" id=\"additional-acknowledgements\">\n<h1><a class=\"toc-backref\" href=\"#id5\">Additional Acknowledgements</a></h1>\n<dl class=\"docutils\">\n<dt>David Pensak, E. I. du Pont de Nemours and Company</dt>\n<dd>For providing the computing environment that made\ndeveloping ImageMagick possible.</dd>\n<dt>Alexander Zimmermann</dt>\n<dd>Responsible for the ImageMagick Linux binary\ndistributions for many years. His efforts are very much\nappreciated.</dd>\n<dt>Paul Heckbert, Carnegie Mellon University</dt>\n<dd>Image resizing is based on Paul Heckbert's Zoom program.</dd>\n<dt>Paul Raveling, USC Information Sciences Institute</dt>\n<dd>The spatial subdivision color reduction algorithm is\nbased on his Img software.</dd>\n<dt>Michael Halle, Spatial Imaging Group at MIT</dt>\n<dd>For the initial implementation of Alan Paeth's image\nrotation algorithm.</dd>\n<dt>Peder Langlo, Hewlett Packard</dt>\n<dd>Made hundreds of suggestions and bug reports. Without\nPeder, this software would not be nearly as useful as it\nis today.</dd>\n<dt>Rod Bogart and John W. Peterson, University of Utah</dt>\n<dd>Image compositing is loosely based on rlecomp of the\nUtah Raster Toolkit.</dd>\n<dt>Alvy Ray Smith and Eric Ray Lyons</dt>\n<dd>HWB color transform and algorithm.</dd>\n<dt>Thomas R Crimmins</dt>\n<dd>Inventor of the eight hull algorithm used for speckle\nreduction.</dd>\n</dl>\n<hr class=\"docutils\" />\n<div class=\"line-block\">\n<div class=\"line\">Copyright © GraphicsMagick Group 2002 - 2020</div>\n</div>\n<p>This program is covered by multiple licenses, which are described in\nCopyright.txt. You should have received a copy of Copyright.txt with this\npackage; otherwise see <a class=\"reference external\" href=\"http://www.graphicsmagick.org/Copyright.html\">http://www.graphicsmagick.org/Copyright.html</a>.</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/time.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time\"></a>gm time\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\ntime - time the execution of a gm command\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#time-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#time-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#time-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#time-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm time</strong> <em>command</em>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>time</strong> executes an arbitrary <strong>gm</strong> utility command\n(e.g. <strong>convert</strong>) and reports the user and elapsed time.  This\nprovides way to measure command execution times similar to the Unix\n'time' command but in a portable and consistent way.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>To obtain time information for the execution of a\ncommand:\n<pre>\n% gm time convert input.ppm -gaussian 0x2 output.ppm\nconvert input.ppm -gaussian 0x2 output.ppm    22.60s user 0.00s system 2354% cpu 0.960 total\n</pre>\n<p>Here is the interpretation of the above output:\n<ul>\n<li><strong>user</strong> - the total user time consumed.\n<li><strong>system</strong> - the total system time consumed.\n<li><strong>total</strong> - the total elapsed time consumed.\n</ul>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"time-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>The time command reqires no options other than the gm command to\nexecute.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n</td></tr></table>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/tools.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Tools</title>\n<meta content=\"GraphicsMagick is a robust collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats including GIF, JPEG, PNG, PDF, and Photo CD. With GraphicsMagick you can create GIFs dynamically making it suitable for Web applications.  You can also resize, rotate, sharpen, color reduce, or add special effects to an image and save your completed work in the same or differing image format. \" name=\"description\" />\n<meta content=\"GraphicsMagick, Image Magick, Image Magic, PerlMagick, Perl Magick, Perl Magic, image processing, software development, image, software, Magick++\" name=\"keywords\" />\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-tools\">\n<h1 class=\"title\">GraphicsMagick Tools</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<div class=\"contents local topic\" id=\"contents\">\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#animate-animate-a-sequence-of-images\" id=\"id2\">Animate: animate a sequence of images</a></li>\n<li><a class=\"reference internal\" href=\"#compare-compare-two-images-using-statistics-and-or-visual-differencing\" id=\"id3\">Compare: compare two images using statistics and/or visual differencing</a></li>\n<li><a class=\"reference internal\" href=\"#composite-composite-images-together\" id=\"id4\">Composite: composite images together</a></li>\n<li><a class=\"reference internal\" href=\"#conjure-execute-a-magick-scripting-language-msl-xml-script\" id=\"id5\">Conjure: execute a Magick Scripting Language (MSL) XML script</a></li>\n<li><a class=\"reference internal\" href=\"#convert-convert-an-image-or-sequence-of-images\" id=\"id6\">Convert: convert an image or sequence of images</a></li>\n<li><a class=\"reference internal\" href=\"#display-display-an-image-on-a-workstation-running-x\" id=\"id7\">Display: display an image on a workstation running X</a></li>\n<li><a class=\"reference internal\" href=\"#identify-describe-an-image-or-image-sequence\" id=\"id8\">Identify: describe an image or image sequence</a></li>\n<li><a class=\"reference internal\" href=\"#import-capture-an-application-or-x-server-screen\" id=\"id9\">Import: capture an application or X server screen</a></li>\n<li><a class=\"reference internal\" href=\"#mogrify-transform-an-image-or-sequence-of-images\" id=\"id10\">Mogrify: transform an image or sequence of images</a></li>\n<li><a class=\"reference internal\" href=\"#montage-create-a-composite-image-in-a-grid-from-separate-images\" id=\"id11\">Montage: create a composite image (in a grid) from separate images</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"animate-animate-a-sequence-of-images\">\n<h1><a class=\"toc-backref\" href=\"#id2\">Animate: animate a sequence of images</a></h1>\n<p><a class=\"reference external\" href=\"animate.html\">Animate</a> displays a sequence of images or an animation on any display\nrunning an X server.</p>\n</div>\n<div class=\"section\" id=\"compare-compare-two-images-using-statistics-and-or-visual-differencing\">\n<h1><a class=\"toc-backref\" href=\"#id3\">Compare: compare two images using statistics and/or visual differencing</a></h1>\n<p><a class=\"reference external\" href=\"compare.html\">Compare</a> compares two images using either a specified standard\nstatistical metric (MAE, MSE, PAE, PSNR, RMSE), or a specified visual\ndifferencing method (assign, threshold, tint, xor). The statistical\ncomparison produces a textual display of metric values while the visual\ndifferencing method writes a difference image with the differences\nannotated using the specified algorithm.  For example:</p>\n<pre class=\"literal-block\">\n% gm convert input.jpg -blur 0x1.5 output.jpg\n% gm compare -metric MSE input.jpg output.jpg\nImage Difference (MeanSquaredError):\n           Normalized    Absolute\n          ============  ==========\n     Red: 0.0014374614       94.2\n   Green: 0.0014396270       94.3\n    Blue: 0.0014464548       94.8\n   Total: 0.0014411811       94.4\n</pre>\n</div>\n<div class=\"section\" id=\"composite-composite-images-together\">\n<h1><a class=\"toc-backref\" href=\"#id4\">Composite: composite images together</a></h1>\n<p><a class=\"reference external\" href=\"composite.html\">Composite</a> blends and merges images to create new images.</p>\n</div>\n<div class=\"section\" id=\"conjure-execute-a-magick-scripting-language-msl-xml-script\">\n<h1><a class=\"toc-backref\" href=\"#id5\">Conjure: execute a Magick Scripting Language (MSL) XML script</a></h1>\n<p><a class=\"reference external\" href=\"conjure.html\">Conjure</a> interprets and executes scripts in the Magick Scripting Language\n(MSL). The interpreter is called conjure and here is an example script:</p>\n<pre class=\"literal-block\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;image size=&quot;400x400&quot; &gt;\n  &lt;read filename=&quot;image.gif&quot; /&gt;\n  &lt;get width=&quot;base-width&quot; height=&quot;base-height&quot; /&gt;\n  &lt;resize geometry=&quot;%[dimensions]&quot; /&gt;\n  &lt;get width=&quot;width&quot; height=&quot;height&quot; /&gt;\n  &lt;print output=\n    &quot;Image sized from %[base-width]x%[base-height]\n     to %[width]x%[height].\\n&quot; /&gt;\n  &lt;write filename=&quot;image.png&quot; /&gt;\n&lt;/image&gt;\n</pre>\n<p>which is invoked like</p>\n<pre class=\"literal-block\">\nconjure -dimensions 400x400 incantation.msl\n</pre>\n<p>All operations closely follow the key/value pairs defined in the\n<a class=\"reference external\" href=\"perl.html\">PerlMagick</a> documentation, unless otherwise noted.</p>\n</div>\n<div class=\"section\" id=\"convert-convert-an-image-or-sequence-of-images\">\n<h1><a class=\"toc-backref\" href=\"#id6\">Convert: convert an image or sequence of images</a></h1>\n<p><a class=\"reference external\" href=\"convert.html\">Convert</a> converts an input file using one image format to an output file\nwith using any of the supported writeable image formats. A large number\nof image processing operations may be performed on the image before it is\nwritten. By default, the input image format is determined by its magic\nnumber. To specify a particular image format, precede the filename with\nan image format name and a colon (i.e. ps:image) or specify the image\ntype as the filename suffix (i.e. image.ps). Specify file as - for\nstandard input or output. If file has the extension .Z, the file is\ndecoded with uncompress.  For example:</p>\n<pre class=\"literal-block\">\n% gm convert input.jpg -rotate 90 rotated.tiff\n</pre>\n</div>\n<div class=\"section\" id=\"display-display-an-image-on-a-workstation-running-x\">\n<h1><a class=\"toc-backref\" href=\"#id7\">Display: display an image on a workstation running X</a></h1>\n<p><a class=\"reference external\" href=\"display.html\">Display</a> is a machine architecture independent image processing and\ndisplay program. It can display an image on any workstation display\nrunning an X server. The image can be displayed as background image of\nany window.</p>\n</div>\n<div class=\"section\" id=\"identify-describe-an-image-or-image-sequence\">\n<h1><a class=\"toc-backref\" href=\"#id8\">Identify: describe an image or image sequence</a></h1>\n<p><a class=\"reference external\" href=\"identify.html\">Identify</a> describes the format and characteristics of one or more image\nfiles. It will also report if an image is incomplete or corrupt. The\ninformation displayed includes the scene number, the file name, the width\nand height of the image, whether the image is colormapped or not, the\nnumber of colors in the image, the number of bytes in the image, the\nformat of the image (JPEG, PNM, etc.), and finally the number of seconds\nit took to read and process the image.  For example:</p>\n<pre class=\"literal-block\">\n% gm identify tiger-1200-rgb16.tiff\ntiger-1200-rgb16.tiff TIFF 9083x9450+0+0 DirectClass 16-bit 491.2M 0.000u 0:01\n</pre>\n</div>\n<div class=\"section\" id=\"import-capture-an-application-or-x-server-screen\">\n<h1><a class=\"toc-backref\" href=\"#id9\">Import: capture an application or X server screen</a></h1>\n<p><a class=\"reference external\" href=\"import.html\">Import</a> reads an image from any visible window on an X server and outputs\nit as an image file. You can capture a single window, the entire screen,\nor any rectangular portion of the screen.</p>\n<p>The target window can be specified by id, name, or may be selected by\nclicking the mouse in the desired window. If you press a button and then\ndrag, a rectangle will form which expands and contracts as the mouse\nmoves. To save the portion of the screen defined by the rectangle, just\nrelease the button. The keyboard bell is rung once at the beginning of\nthe screen capture and twice when it completes.  For example:</p>\n<pre class=\"literal-block\">\n% gm import capture.tiff\n</pre>\n</div>\n<div class=\"section\" id=\"mogrify-transform-an-image-or-sequence-of-images\">\n<h1><a class=\"toc-backref\" href=\"#id10\">Mogrify: transform an image or sequence of images</a></h1>\n<p><a class=\"reference external\" href=\"mogrify.html\">Mogrify</a> transforms an image or a sequence of images &quot;in place&quot;. These\ntransforms include image scaling, image rotation, color reduction, and\nothers. The transmogrified image overwrites the original image. <a class=\"reference external\" href=\"mogrify.html\">Mogrify</a>\nis very similar to <a class=\"reference external\" href=\"convert.html\">Convert</a> except that it can operate on many images at\nonce, and overwrites the input files by default. However, <a class=\"reference external\" href=\"mogrify.html\">Mogrify</a> may\nalso be used to convert file formats, and send modified files to another\ndirectory. For example, the following reads several JPEG files and writes\na rotated version of them in TIFF format:</p>\n<pre class=\"literal-block\">\n% gm mogrify -rotate 90 -format tiff image1.jpg image2.jpg image3.jpg\n</pre>\n</div>\n<div class=\"section\" id=\"montage-create-a-composite-image-in-a-grid-from-separate-images\">\n<h1><a class=\"toc-backref\" href=\"#id11\">Montage: create a composite image (in a grid) from separate images</a></h1>\n<p><a class=\"reference external\" href=\"montage.html\">Montage</a> creates a composite by combining several separate images. The\nimages are tiled on a composite image with the name of the image and its\nproperties optionally appearing just below the individual tile.</p>\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/utilities.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Utilities</title>\n<meta content=\"GraphicsMagick is a robust collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats including GIF, JPEG, PNG, PDF, and Photo CD. With GraphicsMagick you can create GIFs dynamically making it suitable for Web applications.  You can also resize, rotate, sharpen, color reduce, or add special effects to an image and save your completed work in the same or differing image format. \" name=\"description\" />\n<meta content=\"GraphicsMagick, Image Magick, Image Magic, PerlMagick, Perl Magick, Perl Magic, image processing, software development, image, software, Magick++\" name=\"keywords\" />\n<link rel=\"stylesheet\" href=\"docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"index.html\">Home</a></li>\n<li><a href=\"project.html\">Project</a></li>\n<li><a href=\"download.html\">Download</a></li>\n<li><a href=\"README.html\">Install</a></li>\n<li><a href=\"Hg.html\">Source</a></li>\n<li><a href=\"NEWS.html\">News</a> </li>\n<li><a href=\"utilities.html\">Utilities</a></li>\n<li><a href=\"programming.html\">Programming</a></li>\n<li><a href=\"reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-utilities\">\n<h1 class=\"title\">GraphicsMagick Utilities</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>GraphicsMagick provides a powerful command line utility <cite>gm</cite>, which\nmay be used to access all GraphicsMagick functions. Gm uses a\nconsistent set of options (<a class=\"reference external\" href=\"GraphicsMagick.html\">see options documentation</a>).  GraphicsMagick provides access to major\ncommands via a single executable command-line program; for example, to\nuse the &quot;convert&quot; sub-command, type <tt class=\"docutils literal\">gm convert ...</tt>. The available\ncommands are as follows:</p>\n<table border=\"1\" class=\"docutils\">\n<colgroup>\n<col width=\"17%\" />\n<col width=\"83%\" />\n</colgroup>\n<tbody valign=\"top\">\n<tr><td><a class=\"reference external\" href=\"animate.html\">animate</a></td>\n<td>Animate a sequence of images</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"batch.html\">batch</a></td>\n<td>Executes an arbitary number of utility commands</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"benchmark.html\">benchmark</a></td>\n<td>Measure and report utility command performance.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"compare.html\">compare</a></td>\n<td>Compare two images using statistics and/or visual differencing</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"composite.html\">composite</a></td>\n<td>Composite images together</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"conjure.html\">conjure</a></td>\n<td>Execute a Magick Scripting Language (MSL) XML script</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"convert.html\">convert</a></td>\n<td>Convert an image or sequence of images</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"display.html\">display</a></td>\n<td>Display an image on a workstation running X</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"identify.html\">identify</a></td>\n<td>Describe an image or image sequence</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"import.html\">import</a></td>\n<td>Capture an application or X server screen</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"mogrify.html\">mogrify</a></td>\n<td>Transform an image or sequence of images</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"montage.html\">montage</a></td>\n<td>Create a composite image (in a grid) from separate images</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"time.html\">time</a></td>\n<td>Time the execution of a utility command.</td>\n</tr>\n<tr><td><a class=\"reference external\" href=\"version.html\">version</a></td>\n<td>Report GraphicsMagick version, features, and build options.</td>\n</tr>\n</tbody>\n</table>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2002 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/version.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n\t<meta HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=us-ascii\">\n\t<title>GraphicsMagick GM Utility</title>\n\t<style type=text/css>\n\t<!--\n\t\t@page { size: 8.5in 11in }\n\t\tTD P { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tP { color: #000000; font-family: \"Verdana\", \"Arial\", \"Helvetica\", sans-serif; font-size: 12pt }\n\t\tA:link { color: #00B04F }\n\t\tA:visited { color: #007B37 }\n\t-->\n\t</style>\n\n</head>\n<body LANG=\"en-US\" TEXT=\"#000000\" LINK=\"#00B04F\" VLINK=\"#007B37\" BGCOLOR=\"#ffffff\">\n<a name=\"top\"></a>\n<table border=0 cellpadding=10 cellspacing=0 style=\"margin-top:-17px\" width=\"100%\"><tr><td>\n<br>&nbsp;<br>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version\"></a>gm version\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version-top\"></a>NAME\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\nversion - display software version, feature, and build information\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version-contents\"></a>Contents\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<dl>\n<dt>\n<a href=\"#version-syno\">Synopsis</a>\n</dt>\n<dt>\n<a href=\"#version-desc\">Description</a>\n</dt>\n<dt>\n<a href=\"#version-exam\">Examples</a>\n</dt>\n<dt>\n<a href=\"#version-opti\">Options</a>\n</dt>\n</dl>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version-syno\"></a>Synopsis\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>gm version</strong>\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version-desc\"></a>Description\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>\n<strong>version</strong> displays the software release version, build quantum\n(pixel sample) depth, web site URL, copyright notice, enabled features\nsupport, configuration parameters, and final build options used to\nbuild the software.  The available information depends on how the\nsoftware was configured and the host system.\n</td></tr></table>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version-exam\"></a>Examples\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>To display the version information:\n<pre>\n  GraphicsMagick 1.3.27a 2017-12-11 Q16 http://www.GraphicsMagick.org/\n  Copyright (C) 2002-2020 GraphicsMagick Group.\n  Additional copyrights and licenses apply to this software.\n  See http://www.GraphicsMagick.org/www/Copyright.html for details.\n  Feature Support:\n    Native Thread Safe       yes\n    Large Files (&gt; 32 bit)   yes\n    Large Memory (&gt; 32 bit)  yes\n    BZIP                     yes\n    DPS                      no\n    FlashPix                 no\n    FreeType                 yes\n    Ghostscript (Library)    no\n    JBIG                     yes\n    JPEG-2000                yes\n    JPEG                     yes\n    Little CMS               yes\n    Loadable Modules         no\n    OpenMP                   yes (201307)\n    PNG                      yes\n    TIFF                     yes\n    TRIO                     no\n    UMEM                     no\n    WebP                     yes\n    WMF                      yes\n    X11                      yes\n    XML                      yes\n    ZLIB                     yes\n  Host type: x86_64-unknown-linux-gnu\n  Configured using the command:\n    ./configure  ...\n  Final Build Parameters:\n    CC       = ...\n    CFLAGS   = ...\n    CPPFLAGS = ...\n    CXX      = ...\n    CXXFLAGS = ...\n    LDFLAGS  = ...\n    LIBS     = ...\n</pre>\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n<table BORDER=0 WIDTH=\"100%\"> \n<tr> \n<td ALIGN=LEFT bgcolor=\"#FFFFFF\"><img \nSRC=\"images/right_triangle.png\"  ALT=\">\" BORDER=0 \nheight=14 width=15><b><font face=\"Helvetica, Arial\"><font \ncolor=\"#00B04F\"><font size=\"+1\">\n<a NAME=\"version-opti\"></a>Options\n</font></font></font></b></td></tr></table>\n<table width=\"94%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n<tr><td width=\"3%\"><br></td><td>\n<p>The version command does not currently support any options.\n</td></tr></table>\n     <p>\n<i><a href=\"#top\">Back to Contents</a></i> \n&nbsp;</p>\n</td></tr></table>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/wand/drawing_wand.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>drawing_wand</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"drawing-wand\">\n<h1 class=\"title\">drawing_wand</h1>\n<h2 class=\"subtitle\" id=\"wand-vector-drawing-interfaces\">Wand vector drawing interfaces</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#clonedrawingwand\" id=\"id227\">CloneDrawingWand</a></li>\n<li><a class=\"reference internal\" href=\"#destroydrawingwand\" id=\"id228\">DestroyDrawingWand</a></li>\n<li><a class=\"reference internal\" href=\"#drawannotation\" id=\"id229\">DrawAnnotation</a></li>\n<li><a class=\"reference internal\" href=\"#drawaffine\" id=\"id230\">DrawAffine</a></li>\n<li><a class=\"reference internal\" href=\"#drawallocatewand\" id=\"id231\">DrawAllocateWand</a></li>\n<li><a class=\"reference internal\" href=\"#drawarc\" id=\"id232\">DrawArc</a></li>\n<li><a class=\"reference internal\" href=\"#drawbezier\" id=\"id233\">DrawBezier</a></li>\n<li><a class=\"reference internal\" href=\"#drawcircle\" id=\"id234\">DrawCircle</a></li>\n<li><a class=\"reference internal\" href=\"#drawclearexception\" id=\"id235\">DrawClearException</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetclippath\" id=\"id236\">DrawGetClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetclippath\" id=\"id237\">DrawSetClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetcliprule\" id=\"id238\">DrawGetClipRule</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetcliprule\" id=\"id239\">DrawSetClipRule</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetclipunits\" id=\"id240\">DrawGetClipUnits</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetexception\" id=\"id241\">DrawGetException</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetclipunits\" id=\"id242\">DrawSetClipUnits</a></li>\n<li><a class=\"reference internal\" href=\"#drawcolor\" id=\"id243\">DrawColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawcomment\" id=\"id244\">DrawComment</a></li>\n<li><a class=\"reference internal\" href=\"#drawellipse\" id=\"id245\">DrawEllipse</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfillcolor\" id=\"id246\">DrawGetFillColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfillcolor\" id=\"id247\">DrawSetFillColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfillpatternurl\" id=\"id248\">DrawSetFillPatternURL</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfillopacity\" id=\"id249\">DrawGetFillOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfillopacity\" id=\"id250\">DrawSetFillOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfillrule\" id=\"id251\">DrawGetFillRule</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfillrule\" id=\"id252\">DrawSetFillRule</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfont\" id=\"id253\">DrawGetFont</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfont\" id=\"id254\">DrawSetFont</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontfamily\" id=\"id255\">DrawGetFontFamily</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontfamily\" id=\"id256\">DrawSetFontFamily</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontsize\" id=\"id257\">DrawGetFontSize</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontsize\" id=\"id258\">DrawSetFontSize</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontstretch\" id=\"id259\">DrawGetFontStretch</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontstretch\" id=\"id260\">DrawSetFontStretch</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontstyle\" id=\"id261\">DrawGetFontStyle</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontstyle\" id=\"id262\">DrawSetFontStyle</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetfontweight\" id=\"id263\">DrawGetFontWeight</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetfontweight\" id=\"id264\">DrawSetFontWeight</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetgravity\" id=\"id265\">DrawGetGravity</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetgravity\" id=\"id266\">DrawSetGravity</a></li>\n<li><a class=\"reference internal\" href=\"#drawcomposite\" id=\"id267\">DrawComposite</a></li>\n<li><a class=\"reference internal\" href=\"#drawline\" id=\"id268\">DrawLine</a></li>\n<li><a class=\"reference internal\" href=\"#drawmatte\" id=\"id269\">DrawMatte</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathclose\" id=\"id270\">DrawPathClose</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoabsolute\" id=\"id271\">DrawPathCurveToAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetorelative\" id=\"id272\">DrawPathCurveToRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoquadraticbezierabsolute\" id=\"id273\">DrawPathCurveToQuadraticBezierAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoquadraticbezierrelative\" id=\"id274\">DrawPathCurveToQuadraticBezierRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoquadraticbeziersmoothabsolute\" id=\"id275\">DrawPathCurveToQuadraticBezierSmoothAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetoquadraticbeziersmoothrelative\" id=\"id276\">DrawPathCurveToQuadraticBezierSmoothRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetosmoothabsolute\" id=\"id277\">DrawPathCurveToSmoothAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathcurvetosmoothrelative\" id=\"id278\">DrawPathCurveToSmoothRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathellipticarcabsolute\" id=\"id279\">DrawPathEllipticArcAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathellipticarcrelative\" id=\"id280\">DrawPathEllipticArcRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathfinish\" id=\"id281\">DrawPathFinish</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetoabsolute\" id=\"id282\">DrawPathLineToAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetorelative\" id=\"id283\">DrawPathLineToRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetohorizontalabsolute\" id=\"id284\">DrawPathLineToHorizontalAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetohorizontalrelative\" id=\"id285\">DrawPathLineToHorizontalRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetoverticalabsolute\" id=\"id286\">DrawPathLineToVerticalAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathlinetoverticalrelative\" id=\"id287\">DrawPathLineToVerticalRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathmovetoabsolute\" id=\"id288\">DrawPathMoveToAbsolute</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathmovetorelative\" id=\"id289\">DrawPathMoveToRelative</a></li>\n<li><a class=\"reference internal\" href=\"#drawpathstart\" id=\"id290\">DrawPathStart</a></li>\n<li><a class=\"reference internal\" href=\"#drawpeekgraphiccontext\" id=\"id291\">DrawPeekGraphicContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawpoint\" id=\"id292\">DrawPoint</a></li>\n<li><a class=\"reference internal\" href=\"#drawpolygon\" id=\"id293\">DrawPolygon</a></li>\n<li><a class=\"reference internal\" href=\"#drawpolyline\" id=\"id294\">DrawPolyline</a></li>\n<li><a class=\"reference internal\" href=\"#drawpopclippath\" id=\"id295\">DrawPopClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawpopdefs\" id=\"id296\">DrawPopDefs</a></li>\n<li><a class=\"reference internal\" href=\"#drawpopgraphiccontext\" id=\"id297\">DrawPopGraphicContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawpoppattern\" id=\"id298\">DrawPopPattern</a></li>\n<li><a class=\"reference internal\" href=\"#drawpushclippath\" id=\"id299\">DrawPushClipPath</a></li>\n<li><a class=\"reference internal\" href=\"#drawpushdefs\" id=\"id300\">DrawPushDefs</a></li>\n<li><a class=\"reference internal\" href=\"#drawpushgraphiccontext\" id=\"id301\">DrawPushGraphicContext</a></li>\n<li><a class=\"reference internal\" href=\"#drawpushpattern\" id=\"id302\">DrawPushPattern</a></li>\n<li><a class=\"reference internal\" href=\"#drawrectangle\" id=\"id303\">DrawRectangle</a></li>\n<li><a class=\"reference internal\" href=\"#drawrender\" id=\"id304\">DrawRender</a></li>\n<li><a class=\"reference internal\" href=\"#drawrotate\" id=\"id305\">DrawRotate</a></li>\n<li><a class=\"reference internal\" href=\"#drawroundrectangle\" id=\"id306\">DrawRoundRectangle</a></li>\n<li><a class=\"reference internal\" href=\"#drawscale\" id=\"id307\">DrawScale</a></li>\n<li><a class=\"reference internal\" href=\"#drawskewx\" id=\"id308\">DrawSkewX</a></li>\n<li><a class=\"reference internal\" href=\"#drawskewy\" id=\"id309\">DrawSkewY</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstopcolor\" id=\"id310\">DrawSetStopColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokecolor\" id=\"id311\">DrawGetStrokeColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokecolor\" id=\"id312\">DrawSetStrokeColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokepatternurl\" id=\"id313\">DrawSetStrokePatternURL</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokeantialias\" id=\"id314\">DrawGetStrokeAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokeantialias\" id=\"id315\">DrawSetStrokeAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokedasharray\" id=\"id316\">DrawGetStrokeDashArray</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokedasharray\" id=\"id317\">DrawSetStrokeDashArray</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokedashoffset\" id=\"id318\">DrawGetStrokeDashOffset</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokedashoffset\" id=\"id319\">DrawSetStrokeDashOffset</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokelinecap\" id=\"id320\">DrawGetStrokeLineCap</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokelinecap\" id=\"id321\">DrawSetStrokeLineCap</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokelinejoin\" id=\"id322\">DrawGetStrokeLineJoin</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokelinejoin\" id=\"id323\">DrawSetStrokeLineJoin</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokemiterlimit\" id=\"id324\">DrawGetStrokeMiterLimit</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokemiterlimit\" id=\"id325\">DrawSetStrokeMiterLimit</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokeopacity\" id=\"id326\">DrawGetStrokeOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokeopacity\" id=\"id327\">DrawSetStrokeOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#drawgetstrokewidth\" id=\"id328\">DrawGetStrokeWidth</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetstrokewidth\" id=\"id329\">DrawSetStrokeWidth</a></li>\n<li><a class=\"reference internal\" href=\"#drawgettextantialias\" id=\"id330\">DrawGetTextAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawsettextantialias\" id=\"id331\">DrawSetTextAntialias</a></li>\n<li><a class=\"reference internal\" href=\"#drawgettextdecoration\" id=\"id332\">DrawGetTextDecoration</a></li>\n<li><a class=\"reference internal\" href=\"#drawsettextdecoration\" id=\"id333\">DrawSetTextDecoration</a></li>\n<li><a class=\"reference internal\" href=\"#drawgettextencoding\" id=\"id334\">DrawGetTextEncoding</a></li>\n<li><a class=\"reference internal\" href=\"#drawsettextencoding\" id=\"id335\">DrawSetTextEncoding</a></li>\n<li><a class=\"reference internal\" href=\"#drawgettextundercolor\" id=\"id336\">DrawGetTextUnderColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawsettextundercolor\" id=\"id337\">DrawSetTextUnderColor</a></li>\n<li><a class=\"reference internal\" href=\"#drawtranslate\" id=\"id338\">DrawTranslate</a></li>\n<li><a class=\"reference internal\" href=\"#drawsetviewbox\" id=\"id339\">DrawSetViewbox</a></li>\n<li><a class=\"reference internal\" href=\"#newdrawingwand\" id=\"id340\">NewDrawingWand</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"clonedrawingwand\">\n<h1><a class=\"toc-backref\" href=\"#id227\">CloneDrawingWand</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nDrawingWand *CloneDrawingWand( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>CloneDrawingWand() returns a new drawing wand which is a full (deep) copy\nof an existing drawing wand.</p>\n<p>The format of the  CloneDrawingWand method is:</p>\n<pre class=\"literal-block\">\nDrawingWand *CloneDrawingWand( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand to copy</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroydrawingwand\">\n<h1><a class=\"toc-backref\" href=\"#id228\">DestroyDrawingWand</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyDrawingWand( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>DestroyDrawingWand() frees all resources associated with the drawing\nwand. Once the drawing wand has been freed, it should not be used\nany further unless it re-allocated.</p>\n<p>The format of the  DestroyDrawingWand method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyDrawingWand( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand to destroy.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawannotation\">\n<h1><a class=\"toc-backref\" href=\"#id229\">DrawAnnotation</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawAnnotation( DrawingWand *drawing_wand, const double x, const double y,\n                     const unsigned char *text );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>DrawAnnotation() draws text on the image.</p>\n<p>The format of the DrawAnnotation method is:</p>\n<pre class=\"literal-block\">\nvoid DrawAnnotation( DrawingWand *drawing_wand, const double x, const double y,\n                     const unsigned char *text );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>x ordinate to left of text</dd>\n<dt>y:</dt>\n<dd>y ordinate to text baseline</dd>\n<dt>text:</dt>\n<dd>text to draw</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawaffine\">\n<h1><a class=\"toc-backref\" href=\"#id230\">DrawAffine</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawAffine( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#affinematrix\">AffineMatrix</a> *affine );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>DrawAffine() adjusts the current affine transformation matrix with\nthe specified affine transformation matrix. Note that the current affine\ntransform is adjusted rather than replaced.</p>\n<p>The format of the DrawAffine method is:</p>\n<pre class=\"literal-block\">\nvoid DrawAffine( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#affinematrix\">AffineMatrix</a> *affine );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>Drawing drawing_wand</dd>\n<dt>affine:</dt>\n<dd>Affine matrix parameters</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawallocatewand\">\n<h1><a class=\"toc-backref\" href=\"#id231\">DrawAllocateWand</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nDrawingWand DrawAllocateWand( const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>DrawAllocateWand() allocates an initial drawing wand which is an\nopaque handle required by the remaining drawing methods.</p>\n<p>The format of the DrawAllocateWand method is:</p>\n<pre class=\"literal-block\">\nDrawingWand DrawAllocateWand( const <a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *draw_info, <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>draw_info:</dt>\n<dd>Initial drawing defaults. Set to NULL to use\nImageMagick defaults.</dd>\n<dt>image:</dt>\n<dd>The image to draw on.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawarc\">\n<h1><a class=\"toc-backref\" href=\"#id232\">DrawArc</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawArc( DrawingWand *drawing_wand, const double sx, const double sy, const double ex,\n              const double ey, const double sd, const double ed );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>DrawArc() draws an arc falling within a specified bounding rectangle on the\nimage.</p>\n<p>The format of the DrawArc method is:</p>\n<pre class=\"literal-block\">\nvoid DrawArc( DrawingWand *drawing_wand, const double sx, const double sy, const double ex,\n              const double ey, const double sd, const double ed );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>sx:</dt>\n<dd>starting x ordinate of bounding rectangle</dd>\n<dt>sy:</dt>\n<dd>starting y ordinate of bounding rectangle</dd>\n<dt>ex:</dt>\n<dd>ending x ordinate of bounding rectangle</dd>\n<dt>ey:</dt>\n<dd>ending y ordinate of bounding rectangle</dd>\n<dt>sd:</dt>\n<dd>starting degrees of rotation</dd>\n<dt>ed:</dt>\n<dd>ending degrees of rotation</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawbezier\">\n<h1><a class=\"toc-backref\" href=\"#id233\">DrawBezier</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawBezier( DrawingWand *drawing_wand, const unsigned long number_coordinates,\n                 const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>DrawBezier() draws a bezier curve through a set of points on the image.</p>\n<p>The format of the DrawBezier method is:</p>\n<pre class=\"literal-block\">\nvoid DrawBezier( DrawingWand *drawing_wand, const unsigned long number_coordinates,\n                 const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>number_coordinates:</dt>\n<dd>number of coordinates</dd>\n<dt>coordinates:</dt>\n<dd>coordinates</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawcircle\">\n<h1><a class=\"toc-backref\" href=\"#id234\">DrawCircle</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawCircle( DrawingWand *drawing_wand, const double ox, const double oy, const double px,\n                 const double py );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>DrawCircle() draws a circle on the image.</p>\n<p>The format of the DrawCircle method is:</p>\n<pre class=\"literal-block\">\nvoid DrawCircle( DrawingWand *drawing_wand, const double ox, const double oy, const double px,\n                 const double py );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>ox:</dt>\n<dd>origin x ordinate</dd>\n<dt>oy:</dt>\n<dd>origin y ordinate</dd>\n<dt>px:</dt>\n<dd>perimeter x ordinate</dd>\n<dt>py:</dt>\n<dd>perimeter y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawclearexception\">\n<h1><a class=\"toc-backref\" href=\"#id235\">DrawClearException</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail DrawClearException( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>DrawClearException() clears any existing exception from the drawing wand.</p>\n<p>The format of the DrawGetException method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail DrawClearException( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetclippath\">\n<h1><a class=\"toc-backref\" href=\"#id236\">DrawGetClipPath</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *DrawGetClipPath( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>DrawGetClipPath() obtains the current clipping path ID. The value returned\nmust be deallocated by the user when it is no longer needed.</p>\n<p>The format of the DrawGetClipPath method is:</p>\n<pre class=\"literal-block\">\nchar *DrawGetClipPath( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetclippath\">\n<h1><a class=\"toc-backref\" href=\"#id237\">DrawSetClipPath</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetClipPath( DrawingWand *drawing_wand, const char *clip_path );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>DrawSetClipPath() associates a named clipping path with the image.  Only\nthe areas drawn on by the clipping path will be modified as long as it\nremains in effect.</p>\n<p>The format of the DrawSetClipPath method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetClipPath( DrawingWand *drawing_wand, const char *clip_path );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>clip_path:</dt>\n<dd>name of clipping path to associate with image</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetcliprule\">\n<h1><a class=\"toc-backref\" href=\"#id238\">DrawGetClipRule</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> DrawGetClipRule( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>DrawGetClipRule() returns the current polygon fill rule to be used by the\nclipping path.</p>\n<p>The format of the DrawGetClipRule method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> DrawGetClipRule( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetcliprule\">\n<h1><a class=\"toc-backref\" href=\"#id239\">DrawSetClipRule</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetClipRule( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> fill_rule );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>DrawSetClipRule() set the polygon fill rule to be used by the clipping path.</p>\n<p>The format of the DrawSetClipRule method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetClipRule( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> fill_rule );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>fill_rule:</dt>\n<dd>fill rule (EvenOddRule or NonZeroRule)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetclipunits\">\n<h1><a class=\"toc-backref\" href=\"#id240\">DrawGetClipUnits</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#clippathunits\">ClipPathUnits</a> DrawGetClipUnits( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>DrawGetClipUnits() returns the interpretation of clip path units.</p>\n<p>The format of the DrawGetClipUnits method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#clippathunits\">ClipPathUnits</a> DrawGetClipUnits( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetexception\">\n<h1><a class=\"toc-backref\" href=\"#id241\">DrawGetException</a></h1>\n<div class=\"section\" id=\"id27\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *DrawGetException( const DrawingWand *drawing_wand, <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> *severity );\n</pre>\n</div>\n<div class=\"section\" id=\"id28\">\n<h2>Description</h2>\n<p>DrawGetException() obtains error information associated with the last\nexception (if any).  If an exception did occur, an allocated text string\nis returned which contains a detailed description of the exception.  This\nstring must be deallocated by the user once it is no longer needed.</p>\n<p>The format of the DrawGetException method is:</p>\n<pre class=\"literal-block\">\nchar *DrawGetException( const DrawingWand *drawing_wand, <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> *severity );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>severity:</dt>\n<dd>Enumeration corresponding to last thrown exception.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetclipunits\">\n<h1><a class=\"toc-backref\" href=\"#id242\">DrawSetClipUnits</a></h1>\n<div class=\"section\" id=\"id29\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetClipUnits( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#clippathunits\">ClipPathUnits</a> clip_units );\n</pre>\n</div>\n<div class=\"section\" id=\"id30\">\n<h2>Description</h2>\n<p>DrawSetClipUnits() sets the interpretation of clip path units.</p>\n<p>The format of the DrawSetClipUnits method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetClipUnits( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#clippathunits\">ClipPathUnits</a> clip_units );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>clip_units:</dt>\n<dd>units to use (UserSpace, UserSpaceOnUse, or ObjectBoundingBox)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawcolor\">\n<h1><a class=\"toc-backref\" href=\"#id243\">DrawColor</a></h1>\n<div class=\"section\" id=\"id31\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawColor( DrawingWand *drawing_wand, const double x, const double y,\n                const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> paintMethod );\n</pre>\n</div>\n<div class=\"section\" id=\"id32\">\n<h2>Description</h2>\n<p>DrawColor() draws color on image using the current fill color, starting at\nspecified position, and using specified paint method. The available paint\nmethods are:</p>\n<p>PointMethod: Recolors the target pixel\nReplaceMethod: Recolor any pixel that matches the target pixel.\nFloodfillMethod: Recolors target pixels and matching neighbors.\nFillToBorderMethod: Recolor target pixels and neighbors not matching\nResetMethod: Recolor all pixels.</p>\n<p>The format of the DrawColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawColor( DrawingWand *drawing_wand, const double x, const double y,\n                const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> paintMethod );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>x ordinate</dd>\n<dt>y:</dt>\n<dd>y ordinate</dd>\n<dt>paintMethod:</dt>\n<dd>paint method</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawcomment\">\n<h1><a class=\"toc-backref\" href=\"#id244\">DrawComment</a></h1>\n<div class=\"section\" id=\"id33\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawComment( DrawingWand *drawing_wand, const char *comment );\n</pre>\n</div>\n<div class=\"section\" id=\"id34\">\n<h2>Description</h2>\n<p>DrawComment() adds a comment to a vector output stream.</p>\n<p>The format of the DrawComment method is:</p>\n<pre class=\"literal-block\">\nvoid DrawComment( DrawingWand *drawing_wand, const char *comment );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>comment:</dt>\n<dd>comment text</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawellipse\">\n<h1><a class=\"toc-backref\" href=\"#id245\">DrawEllipse</a></h1>\n<div class=\"section\" id=\"id35\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawEllipse( DrawingWand *drawing_wand, const double ox, const double oy, const double rx,\n                  const double ry, const double start, const double end );\n</pre>\n</div>\n<div class=\"section\" id=\"id36\">\n<h2>Description</h2>\n<p>DrawEllipse() draws an ellipse on the image.</p>\n<p>The format of the DrawEllipse method is:</p>\n<pre class=\"literal-block\">\nvoid DrawEllipse( DrawingWand *drawing_wand, const double ox, const double oy, const double rx,\n                  const double ry, const double start, const double end );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>ox:</dt>\n<dd>origin x ordinate</dd>\n<dt>oy:</dt>\n<dd>origin y ordinate</dd>\n<dt>rx:</dt>\n<dd>radius in x</dd>\n<dt>ry:</dt>\n<dd>radius in y</dd>\n<dt>start:</dt>\n<dd>starting rotation in degrees</dd>\n<dt>end:</dt>\n<dd>ending rotation in degrees</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfillcolor\">\n<h1><a class=\"toc-backref\" href=\"#id246\">DrawGetFillColor</a></h1>\n<div class=\"section\" id=\"id37\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawGetFillColor( const DrawingWand *drawing_wand, PixelWand *fill_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id38\">\n<h2>Description</h2>\n<p>DrawGetFillColor() returns the fill color used for drawing filled objects.</p>\n<p>The format of the DrawGetFillColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawGetFillColor( const DrawingWand *drawing_wand, PixelWand *fill_color );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>fill_color:</dt>\n<dd>Return the fill color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfillcolor\">\n<h1><a class=\"toc-backref\" href=\"#id247\">DrawSetFillColor</a></h1>\n<div class=\"section\" id=\"id39\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFillColor( DrawingWand *drawing_wand, const PixelWand *fill_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id40\">\n<h2>Description</h2>\n<p>DrawSetFillColor() sets the fill color to be used for drawing filled objects.</p>\n<p>The format of the DrawSetFillColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFillColor( DrawingWand *drawing_wand, const PixelWand *fill_wand );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>fill_wand:</dt>\n<dd>fill wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfillpatternurl\">\n<h1><a class=\"toc-backref\" href=\"#id248\">DrawSetFillPatternURL</a></h1>\n<div class=\"section\" id=\"id41\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFillPatternURL( DrawingWand *drawing_wand, const char *fill_url );\n</pre>\n</div>\n<div class=\"section\" id=\"id42\">\n<h2>Description</h2>\n<p>DrawSetFillPatternURL() sets the URL to use as a fill pattern for filling\nobjects. Only local URLs (&quot;#identifier&quot;) are supported at this time. These\nlocal URLs are normally created by defining a named fill pattern with\nDrawPushPattern/DrawPopPattern.</p>\n<p>The format of the DrawSetFillPatternURL method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFillPatternURL( DrawingWand *drawing_wand, const char *fill_url );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>fill_url:</dt>\n<dd>URL to use to obtain fill pattern.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfillopacity\">\n<h1><a class=\"toc-backref\" href=\"#id249\">DrawGetFillOpacity</a></h1>\n<div class=\"section\" id=\"id43\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetFillOpacity( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id44\">\n<h2>Description</h2>\n<p>DrawGetFillOpacity() returns the opacity used when drawing using the fill\ncolor or fill texture.  Fully opaque is 1.0.</p>\n<p>The format of the DrawGetFillOpacity method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetFillOpacity( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfillopacity\">\n<h1><a class=\"toc-backref\" href=\"#id250\">DrawSetFillOpacity</a></h1>\n<div class=\"section\" id=\"id45\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFillOpacity( DrawingWand *drawing_wand, const double fill_opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id46\">\n<h2>Description</h2>\n<p>DrawSetFillOpacity() sets the opacity to use when drawing using the fill\ncolor or fill texture.  Fully opaque is 1.0.</p>\n<p>The format of the DrawSetFillOpacity method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFillOpacity( DrawingWand *drawing_wand, const double fill_opacity );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>fill_opacity:</dt>\n<dd>fill opacity</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfillrule\">\n<h1><a class=\"toc-backref\" href=\"#id251\">DrawGetFillRule</a></h1>\n<div class=\"section\" id=\"id47\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> DrawGetFillRule( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id48\">\n<h2>Description</h2>\n<p>DrawGetFillRule() returns the fill rule used while drawing polygons.</p>\n<p>The format of the DrawGetFillRule method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> DrawGetFillRule( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfillrule\">\n<h1><a class=\"toc-backref\" href=\"#id252\">DrawSetFillRule</a></h1>\n<div class=\"section\" id=\"id49\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFillRule( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> fill_rule );\n</pre>\n</div>\n<div class=\"section\" id=\"id50\">\n<h2>Description</h2>\n<p>DrawSetFillRule() sets the fill rule to use while drawing polygons.</p>\n<p>The format of the DrawSetFillRule method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFillRule( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#fillrule\">FillRule</a> fill_rule );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>fill_rule:</dt>\n<dd>fill rule (EvenOddRule or NonZeroRule)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfont\">\n<h1><a class=\"toc-backref\" href=\"#id253\">DrawGetFont</a></h1>\n<div class=\"section\" id=\"id51\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *DrawGetFont( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id52\">\n<h2>Description</h2>\n<p>DrawGetFont() returns a null-terminaged string specifying the font used\nwhen annotating with text. The value returned must be freed by the user\nwhen no longer needed.</p>\n<p>The format of the DrawGetFont method is:</p>\n<pre class=\"literal-block\">\nchar *DrawGetFont( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfont\">\n<h1><a class=\"toc-backref\" href=\"#id254\">DrawSetFont</a></h1>\n<div class=\"section\" id=\"id53\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFont( DrawingWand *drawing_wand, const char *font_name );\n</pre>\n</div>\n<div class=\"section\" id=\"id54\">\n<h2>Description</h2>\n<p>DrawSetFont() sets the fully-sepecified font to use when annotating with\ntext.</p>\n<p>The format of the DrawSetFont method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFont( DrawingWand *drawing_wand, const char *font_name );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>font_name:</dt>\n<dd>font name</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontfamily\">\n<h1><a class=\"toc-backref\" href=\"#id255\">DrawGetFontFamily</a></h1>\n<div class=\"section\" id=\"id55\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *DrawGetFontFamily( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id56\">\n<h2>Description</h2>\n<p>DrawGetFontFamily() returns the font family to use when annotating with text.\nThe value returned must be freed by the user when it is no longer needed.</p>\n<p>The format of the DrawGetFontFamily method is:</p>\n<pre class=\"literal-block\">\nchar *DrawGetFontFamily( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontfamily\">\n<h1><a class=\"toc-backref\" href=\"#id256\">DrawSetFontFamily</a></h1>\n<div class=\"section\" id=\"id57\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontFamily( DrawingWand *drawing_wand, const char *font_family );\n</pre>\n</div>\n<div class=\"section\" id=\"id58\">\n<h2>Description</h2>\n<p>DrawSetFontFamily() sets the font family to use when annotating with text.</p>\n<p>The format of the DrawSetFontFamily method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontFamily( DrawingWand *drawing_wand, const char *font_family );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>font_family:</dt>\n<dd>font family</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontsize\">\n<h1><a class=\"toc-backref\" href=\"#id257\">DrawGetFontSize</a></h1>\n<div class=\"section\" id=\"id59\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetFontSize( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id60\">\n<h2>Description</h2>\n<p>DrawGetFontSize() returns the font pointsize used when annotating with text.</p>\n<p>The format of the DrawGetFontSize method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetFontSize( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontsize\">\n<h1><a class=\"toc-backref\" href=\"#id258\">DrawSetFontSize</a></h1>\n<div class=\"section\" id=\"id61\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontSize( DrawingWand *drawing_wand, const double pointsize );\n</pre>\n</div>\n<div class=\"section\" id=\"id62\">\n<h2>Description</h2>\n<p>DrawSetFontSize() sets the font pointsize to use when annotating with text.</p>\n<p>The format of the DrawSetFontSize method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontSize( DrawingWand *drawing_wand, const double pointsize );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>pointsize:</dt>\n<dd>text pointsize</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontstretch\">\n<h1><a class=\"toc-backref\" href=\"#id259\">DrawGetFontStretch</a></h1>\n<div class=\"section\" id=\"id63\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#stretchtype\">StretchType</a> DrawGetFontStretch( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id64\">\n<h2>Description</h2>\n<p>DrawGetFontStretch() returns the font stretch used when annotating with text.</p>\n<p>The format of the DrawGetFontStretch method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#stretchtype\">StretchType</a> DrawGetFontStretch( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontstretch\">\n<h1><a class=\"toc-backref\" href=\"#id260\">DrawSetFontStretch</a></h1>\n<div class=\"section\" id=\"id65\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontStretch( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#stretchtype\">StretchType</a> font_stretch );\n</pre>\n</div>\n<div class=\"section\" id=\"id66\">\n<h2>Description</h2>\n<p>DrawSetFontStretch() sets the font stretch to use when annotating with text.\nThe AnyStretch enumeration acts as a wild-card &quot;don't care&quot; option.</p>\n<p>The format of the DrawSetFontStretch method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontStretch( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#stretchtype\">StretchType</a> font_stretch );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>font_stretch:</dt>\n<dd>font stretch (NormalStretch, UltraCondensedStretch,\nCondensedStretch, SemiCondensedStretch,\nSemiExpandedStretch, ExpandedStretch,\nExtraExpandedStretch, UltraExpandedStretch, AnyStretch)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontstyle\">\n<h1><a class=\"toc-backref\" href=\"#id261\">DrawGetFontStyle</a></h1>\n<div class=\"section\" id=\"id67\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#styletype\">StyleType</a> DrawGetFontStyle( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id68\">\n<h2>Description</h2>\n<p>DrawGetFontStyle() returns the font style used when annotating with text.</p>\n<p>The format of the DrawGetFontStyle method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#styletype\">StyleType</a> DrawGetFontStyle( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontstyle\">\n<h1><a class=\"toc-backref\" href=\"#id262\">DrawSetFontStyle</a></h1>\n<div class=\"section\" id=\"id69\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontStyle( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#styletype\">StyleType</a> style );\n</pre>\n</div>\n<div class=\"section\" id=\"id70\">\n<h2>Description</h2>\n<p>DrawSetFontStyle() sets the font style to use when annotating with text.\nThe AnyStyle enumeration acts as a wild-card &quot;don't care&quot; option.</p>\n<p>The format of the DrawSetFontStyle method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontStyle( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#styletype\">StyleType</a> style );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>style:</dt>\n<dd>font style (NormalStyle, ItalicStyle, ObliqueStyle, AnyStyle)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetfontweight\">\n<h1><a class=\"toc-backref\" href=\"#id263\">DrawGetFontWeight</a></h1>\n<div class=\"section\" id=\"id71\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long DrawGetFontWeight( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id72\">\n<h2>Description</h2>\n<p>DrawGetFontWeight() returns the font weight used when annotating with text.</p>\n<p>The format of the DrawGetFontWeight method is:</p>\n<pre class=\"literal-block\">\nunsigned long DrawGetFontWeight( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetfontweight\">\n<h1><a class=\"toc-backref\" href=\"#id264\">DrawSetFontWeight</a></h1>\n<div class=\"section\" id=\"id73\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetFontWeight( DrawingWand *drawing_wand, const unsigned long font_weight );\n</pre>\n</div>\n<div class=\"section\" id=\"id74\">\n<h2>Description</h2>\n<p>DrawSetFontWeight() sets the font weight to use when annotating with text.</p>\n<p>The format of the DrawSetFontWeight method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetFontWeight( DrawingWand *drawing_wand, const unsigned long font_weight );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>font_weight:</dt>\n<dd>font weight (valid range 100-900)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetgravity\">\n<h1><a class=\"toc-backref\" href=\"#id265\">DrawGetGravity</a></h1>\n<div class=\"section\" id=\"id75\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> DrawGetGravity( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id76\">\n<h2>Description</h2>\n<p>DrawGetGravity() returns the text placement gravity used when annotating\nwith text.</p>\n<p>The format of the DrawGetGravity method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> DrawGetGravity( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetgravity\">\n<h1><a class=\"toc-backref\" href=\"#id266\">DrawSetGravity</a></h1>\n<div class=\"section\" id=\"id77\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetGravity( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> gravity );\n</pre>\n</div>\n<div class=\"section\" id=\"id78\">\n<h2>Description</h2>\n<p>DrawSetGravity() sets the text placement gravity to use when annotating\nwith text.</p>\n<p>The format of the DrawSetGravity method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetGravity( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> gravity );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>gravity:</dt>\n<dd>positioning gravity (NorthWestGravity, NorthGravity,\nNorthEastGravity, WestGravity, CenterGravity,\nEastGravity, SouthWestGravity, SouthGravity,\nSouthEastGravity)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawcomposite\">\n<h1><a class=\"toc-backref\" href=\"#id267\">DrawComposite</a></h1>\n<div class=\"section\" id=\"id79\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawComposite( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> composite_operator,\n                    const double x, const double y, const double width, const double height,\n                    const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n</div>\n<div class=\"section\" id=\"id80\">\n<h2>Description</h2>\n<p>DrawComposite() composites an image onto the current image, using the\nspecified composition operator, specified position, and at the specified\nsize.</p>\n<p>The format of the DrawComposite method is:</p>\n<pre class=\"literal-block\">\nvoid DrawComposite( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> composite_operator,\n                    const double x, const double y, const double width, const double height,\n                    const <a class=\"reference external\" href=\"../api/types.html#image\">Image</a> *image );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>composite_operator:</dt>\n<dd>composition operator</dd>\n<dt>x:</dt>\n<dd>x ordinate of top left corner</dd>\n<dt>y:</dt>\n<dd>y ordinate of top left corner</dd>\n<dt>width:</dt>\n<dd>Width to resize image to prior to compositing.  Specify zero to\nuse existing width.</dd>\n<dt>height:</dt>\n<dd>Height to resize image to prior to compositing.  Specify zero\nto use existing height.</dd>\n<dt>image:</dt>\n<dd>Image to composite</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawline\">\n<h1><a class=\"toc-backref\" href=\"#id268\">DrawLine</a></h1>\n<div class=\"section\" id=\"id81\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawLine( DrawingWand *drawing_wand, const double sx, const double sy, const double ex,\n               const double ey );\n</pre>\n</div>\n<div class=\"section\" id=\"id82\">\n<h2>Description</h2>\n<p>DrawLine() draws a line on the image using the current stroke color,\nstroke opacity, and stroke width.</p>\n<p>The format of the DrawLine method is:</p>\n<pre class=\"literal-block\">\nvoid DrawLine( DrawingWand *drawing_wand, const double sx, const double sy, const double ex,\n               const double ey );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>sx:</dt>\n<dd>starting x ordinate</dd>\n<dt>sy:</dt>\n<dd>starting y ordinate</dd>\n<dt>ex:</dt>\n<dd>ending x ordinate</dd>\n<dt>ey:</dt>\n<dd>ending y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawmatte\">\n<h1><a class=\"toc-backref\" href=\"#id269\">DrawMatte</a></h1>\n<div class=\"section\" id=\"id83\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawMatte( DrawingWand *drawing_wand, const double x, const double y,\n                const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> paint_method );\n</pre>\n</div>\n<div class=\"section\" id=\"id84\">\n<h2>Description</h2>\n<p>DrawMatte() paints on the image's opacity channel in order to set effected\npixels to transparent.\nto influence the opacity of pixels. The available paint\nmethods are:</p>\n<p>PointMethod: Select the target pixel\nReplaceMethod: Select any pixel that matches the target pixel.\nFloodfillMethod: Select the target pixel and matching neighbors.\nFillToBorderMethod: Select the target pixel and neighbors not matching\nborder color.\nResetMethod: Select all pixels.</p>\n<p>The format of the DrawMatte method is:</p>\n<pre class=\"literal-block\">\nvoid DrawMatte( DrawingWand *drawing_wand, const double x, const double y,\n                const <a class=\"reference external\" href=\"../api/types.html#paintmethod\">PaintMethod</a> paint_method );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>x ordinate</dd>\n<dt>y:</dt>\n<dd>y ordinate</dd>\n</dl>\n<p>o paint_method:</p>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathclose\">\n<h1><a class=\"toc-backref\" href=\"#id270\">DrawPathClose</a></h1>\n<div class=\"section\" id=\"id85\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathClose( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id86\">\n<h2>Description</h2>\n<p>DrawPathClose() adds a path element to the current path which closes the\ncurrent subpath by drawing a straight line from the current point to the\ncurrent subpath's most recent starting point (usually, the most recent\nmoveto point).</p>\n<p>The format of the DrawPathClose method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathClose( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id271\">DrawPathCurveToAbsolute</a></h1>\n<div class=\"section\" id=\"id87\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToAbsolute( DrawingWand *drawing_wand, const double x1, const double y1,\n                              const double x2, const double y2, const double x,\n                              const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id88\">\n<h2>Description</h2>\n<p>DrawPathCurveToAbsolute() draws a cubic Bezier curve from the current\npoint to (x,y) using (x1,y1) as the control point at the beginning of\nthe curve and (x2,y2) as the control point at the end of the curve using\nabsolute coordinates. At the end of the command, the new current point\nbecomes the final (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToAbsolute( DrawingWand *drawing_wand, const double x1, const double y1,\n                              const double x2, const double y2, const double x,\n                              const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x1:</dt>\n<dd>x ordinate of control point for curve beginning</dd>\n<dt>y1:</dt>\n<dd>y ordinate of control point for curve beginning</dd>\n<dt>x2:</dt>\n<dd>x ordinate of control point for curve ending</dd>\n<dt>y2:</dt>\n<dd>y ordinate of control point for curve ending</dd>\n<dt>x:</dt>\n<dd>x ordinate of the end of the curve</dd>\n<dt>y:</dt>\n<dd>y ordinate of the end of the curve</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetorelative\">\n<h1><a class=\"toc-backref\" href=\"#id272\">DrawPathCurveToRelative</a></h1>\n<div class=\"section\" id=\"id89\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToRelative( DrawingWand *drawing_wand, const double x1, const double y1,\n                              const double x2, const double y2, const double x,\n                              const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id90\">\n<h2>Description</h2>\n<p>DrawPathCurveToRelative() draws a cubic Bezier curve from the current\npoint to (x,y) using (x1,y1) as the control point at the beginning of\nthe curve and (x2,y2) as the control point at the end of the curve using\nrelative coordinates. At the end of the command, the new current point\nbecomes the final (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToRelative( DrawingWand *drawing_wand, const double x1, const double y1,\n                              const double x2, const double y2, const double x,\n                              const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x1:</dt>\n<dd>x ordinate of control point for curve beginning</dd>\n<dt>y1:</dt>\n<dd>y ordinate of control point for curve beginning</dd>\n<dt>x2:</dt>\n<dd>x ordinate of control point for curve ending</dd>\n<dt>y2:</dt>\n<dd>y ordinate of control point for curve ending</dd>\n<dt>x:</dt>\n<dd>x ordinate of the end of the curve</dd>\n<dt>y:</dt>\n<dd>y ordinate of the end of the curve</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoquadraticbezierabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id273\">DrawPathCurveToQuadraticBezierAbsolute</a></h1>\n<div class=\"section\" id=\"id91\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierAbsolute( DrawingWand *drawing_wand, const double x1,\n                                             const double y1, onst double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id92\">\n<h2>Description</h2>\n<p>DrawPathCurveToQuadraticBezierAbsolute() draws a quadratic Bezier curve\nfrom the current point to (x,y) using (x1,y1) as the control point using\nabsolute coordinates. At the end of the command, the new current point\nbecomes the final (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToQuadraticBezierAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierAbsolute( DrawingWand *drawing_wand, const double x1,\n                                             const double y1, onst double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x1:</dt>\n<dd>x ordinate of the control point</dd>\n<dt>y1:</dt>\n<dd>y ordinate of the control point</dd>\n<dt>x:</dt>\n<dd>x ordinate of final point</dd>\n<dt>y:</dt>\n<dd>y ordinate of final point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoquadraticbezierrelative\">\n<h1><a class=\"toc-backref\" href=\"#id274\">DrawPathCurveToQuadraticBezierRelative</a></h1>\n<div class=\"section\" id=\"id93\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierRelative( DrawingWand *drawing_wand, const double x1,\n                                             const double y1, const double x,\n                                             const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id94\">\n<h2>Description</h2>\n<p>DrawPathCurveToQuadraticBezierRelative() draws a quadratic Bezier curve\nfrom the current point to (x,y) using (x1,y1) as the control point using\nrelative coordinates. At the end of the command, the new current point\nbecomes the final (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToQuadraticBezierRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierRelative( DrawingWand *drawing_wand, const double x1,\n                                             const double y1, const double x,\n                                             const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x1:</dt>\n<dd>x ordinate of the control point</dd>\n<dt>y1:</dt>\n<dd>y ordinate of the control point</dd>\n<dt>x:</dt>\n<dd>x ordinate of final point</dd>\n<dt>y:</dt>\n<dd>y ordinate of final point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoquadraticbeziersmoothabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id275\">DrawPathCurveToQuadraticBezierSmoothAbsolute</a></h1>\n<div class=\"section\" id=\"id95\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierSmoothAbsolute( DrawingWand *drawing_wand, const double x,\n                                                   const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id96\">\n<h2>Description</h2>\n<p>DrawPathCurveToQuadraticBezierSmoothAbsolute() draws a quadratic\nBezier curve (using absolute coordinates) from the current point to\n(x,y). The control point is assumed to be the reflection of the\ncontrol point on the previous command relative to the current\npoint. (If there is no previous command or if the previous command was\nnot a DrawPathCurveToQuadraticBezierAbsolute,\nDrawPathCurveToQuadraticBezierRelative,\nDrawPathCurveToQuadraticBezierSmoothAbsolute or\nDrawPathCurveToQuadraticBezierSmoothRelative, assume the control point\nis coincident with the current point.). At the end of the command, the\nnew current point becomes the final (x,y) coordinate pair used in the\npolybezier.</p>\n<p>The format of the DrawPathCurveToQuadraticBezierSmoothAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierSmoothAbsolute( DrawingWand *drawing_wand, const double x,\n                                                   const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>x ordinate of final point</dd>\n<dt>y:</dt>\n<dd>y ordinate of final point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetoquadraticbeziersmoothrelative\">\n<h1><a class=\"toc-backref\" href=\"#id276\">DrawPathCurveToQuadraticBezierSmoothRelative</a></h1>\n<div class=\"section\" id=\"id97\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierSmoothRelative( DrawingWand *drawing_wand, const double x,\n                                                   const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id98\">\n<h2>Description</h2>\n<p>DrawPathCurveToQuadraticBezierSmoothRelative() draws a quadratic\nBezier curve (using relative coordinates) from the current point to\n(x,y). The control point is assumed to be the reflection of the\ncontrol point on the previous command relative to the current\npoint. (If there is no previous command or if the previous command was\nnot a DrawPathCurveToQuadraticBezierAbsolute,\nDrawPathCurveToQuadraticBezierRelative,\nDrawPathCurveToQuadraticBezierSmoothAbsolute or\nDrawPathCurveToQuadraticBezierSmoothRelative, assume the control point\nis coincident with the current point.). At the end of the command, the\nnew current point becomes the final (x,y) coordinate pair used in the\npolybezier.</p>\n<p>The format of the DrawPathCurveToQuadraticBezierSmoothRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToQuadraticBezierSmoothRelative( DrawingWand *drawing_wand, const double x,\n                                                   const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>x ordinate of final point</dd>\n<dt>y:</dt>\n<dd>y ordinate of final point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetosmoothabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id277\">DrawPathCurveToSmoothAbsolute</a></h1>\n<div class=\"section\" id=\"id99\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToSmoothAbsolute( DrawingWand *drawing_wand, const double x2const double y2,\n                                    const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id100\">\n<h2>Description</h2>\n<p>DrawPathCurveToSmoothAbsolute() draws a cubic Bezier curve from the\ncurrent point to (x,y) using absolute coordinates. The first control\npoint is assumed to be the reflection of the second control point on\nthe previous command relative to the current point. (If there is no\nprevious command or if the previous command was not an\nDrawPathCurveToAbsolute, DrawPathCurveToRelative,\nDrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume\nthe first control point is coincident with the current point.) (x2,y2)\nis the second control point (i.e., the control point at the end of the\ncurve). At the end of the command, the new current point becomes the\nfinal (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToSmoothAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToSmoothAbsolute( DrawingWand *drawing_wand, const double x2const double y2,\n                                    const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x2:</dt>\n<dd>x ordinate of second control point</dd>\n<dt>y2:</dt>\n<dd>y ordinate of second control point</dd>\n<dt>x:</dt>\n<dd>x ordinate of termination point</dd>\n<dt>y:</dt>\n<dd>y ordinate of termination point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathcurvetosmoothrelative\">\n<h1><a class=\"toc-backref\" href=\"#id278\">DrawPathCurveToSmoothRelative</a></h1>\n<div class=\"section\" id=\"id101\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToSmoothRelative( DrawingWand *drawing_wand, const double x2,\n                                    const double y2, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id102\">\n<h2>Description</h2>\n<p>DrawPathCurveToSmoothRelative() draws a cubic Bezier curve from the\ncurrent point to (x,y) using relative coordinates. The first control\npoint is assumed to be the reflection of the second control point on\nthe previous command relative to the current point. (If there is no\nprevious command or if the previous command was not an\nDrawPathCurveToAbsolute, DrawPathCurveToRelative,\nDrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume\nthe first control point is coincident with the current point.) (x2,y2)\nis the second control point (i.e., the control point at the end of the\ncurve). At the end of the command, the new current point becomes the\nfinal (x,y) coordinate pair used in the polybezier.</p>\n<p>The format of the DrawPathCurveToSmoothRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathCurveToSmoothRelative( DrawingWand *drawing_wand, const double x2,\n                                    const double y2, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x2:</dt>\n<dd>x ordinate of second control point</dd>\n<dt>y2:</dt>\n<dd>y ordinate of second control point</dd>\n<dt>x:</dt>\n<dd>x ordinate of termination point</dd>\n<dt>y:</dt>\n<dd>y ordinate of termination point</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathellipticarcabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id279\">DrawPathEllipticArcAbsolute</a></h1>\n<div class=\"section\" id=\"id103\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathEllipticArcAbsolute( DrawingWand *drawing_wand, const double rx, const double ry,\n                                  const double x_axis_rotation,\n                                  unsigned int large_arc_flag, unsigned int sweep_flag,\n                                  const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id104\">\n<h2>Description</h2>\n<p>DrawPathEllipticArcAbsolute() draws an elliptical arc from the current\npoint to (x, y) using absolute coordinates. The size and orientation\nof the ellipse are defined by two radii (rx, ry) and an\nxAxisRotation, which indicates how the ellipse as a whole is rotated\nrelative to the current coordinate system. The center (cx, cy) of the\nellipse is calculated automatically to satisfy the constraints imposed\nby the other parameters. largeArcFlag and sweepFlag contribute to the\nautomatic calculations and help determine how the arc is drawn. If\nlargeArcFlag is true then draw the larger of the available arcs. If\nsweepFlag is true, then draw the arc matching a clock-wise rotation.</p>\n<p>The format of the DrawPathEllipticArcAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathEllipticArcAbsolute( DrawingWand *drawing_wand, const double rx, const double ry,\n                                  const double x_axis_rotation,\n                                  unsigned int large_arc_flag, unsigned int sweep_flag,\n                                  const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>rx:</dt>\n<dd>x radius</dd>\n<dt>ry:</dt>\n<dd>y radius</dd>\n<dt>x_axis_rotation:</dt>\n<dd>indicates how the ellipse as a whole is rotated\nrelative to the current coordinate system</dd>\n<dt>large_arc_flag:</dt>\n<dd>If non-zero (true) then draw the larger of the\navailable arcs</dd>\n<dt>sweep_flag:</dt>\n<dd>If non-zero (true) then draw the arc matching a\nclock-wise rotation</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathellipticarcrelative\">\n<h1><a class=\"toc-backref\" href=\"#id280\">DrawPathEllipticArcRelative</a></h1>\n<div class=\"section\" id=\"id105\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathEllipticArcRelative( DrawingWand *drawing_wand, const double rx, const double ry,\n                                  const double x_axis_rotation,\n                                  unsigned int large_arc_flag, unsigned int sweep_flag,\n                                  const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id106\">\n<h2>Description</h2>\n<p>DrawPathEllipticArcRelative() draws an elliptical arc from the current\npoint to (x, y) using relative coordinates. The size and orientation\nof the ellipse are defined by two radii (rx, ry) and an\nxAxisRotation, which indicates how the ellipse as a whole is rotated\nrelative to the current coordinate system. The center (cx, cy) of the\nellipse is calculated automatically to satisfy the constraints imposed\nby the other parameters. largeArcFlag and sweepFlag contribute to the\nautomatic calculations and help determine how the arc is drawn. If\nlargeArcFlag is true then draw the larger of the available arcs. If\nsweepFlag is true, then draw the arc matching a clock-wise rotation.</p>\n<p>The format of the DrawPathEllipticArcRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathEllipticArcRelative( DrawingWand *drawing_wand, const double rx, const double ry,\n                                  const double x_axis_rotation,\n                                  unsigned int large_arc_flag, unsigned int sweep_flag,\n                                  const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>rx:</dt>\n<dd>x radius</dd>\n<dt>ry:</dt>\n<dd>y radius</dd>\n<dt>x_axis_rotation:</dt>\n<dd>indicates how the ellipse as a whole is rotated\nrelative to the current coordinate system</dd>\n<dt>large_arc_flag:</dt>\n<dd>If non-zero (true) then draw the larger of the\navailable arcs</dd>\n<dt>sweep_flag:</dt>\n<dd>If non-zero (true) then draw the arc matching a\nclock-wise rotation</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathfinish\">\n<h1><a class=\"toc-backref\" href=\"#id281\">DrawPathFinish</a></h1>\n<div class=\"section\" id=\"id107\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathFinish( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id108\">\n<h2>Description</h2>\n<p>DrawPathFinish() terminates the current path.</p>\n<p>The format of the DrawPathFinish method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathFinish( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetoabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id282\">DrawPathLineToAbsolute</a></h1>\n<div class=\"section\" id=\"id109\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToAbsolute( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id110\">\n<h2>Description</h2>\n<p>DrawPathLineToAbsolute() draws a line path from the current point to the\ngiven coordinate using absolute coordinates. The coordinate then becomes\nthe new current point.</p>\n<p>The format of the DrawPathLineToAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToAbsolute( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetorelative\">\n<h1><a class=\"toc-backref\" href=\"#id283\">DrawPathLineToRelative</a></h1>\n<div class=\"section\" id=\"id111\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToRelative( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id112\">\n<h2>Description</h2>\n<p>DrawPathLineToRelative() draws a line path from the current point to the\ngiven coordinate using relative coordinates. The coordinate then becomes\nthe new current point.</p>\n<p>The format of the DrawPathLineToRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToRelative( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetohorizontalabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id284\">DrawPathLineToHorizontalAbsolute</a></h1>\n<div class=\"section\" id=\"id113\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToHorizontalAbsolute( DrawingWand *drawing_wand, const PathMode mode,\n                                       const double x );\n</pre>\n</div>\n<div class=\"section\" id=\"id114\">\n<h2>Description</h2>\n<p>DrawPathLineToHorizontalAbsolute() draws a horizontal line path from the\ncurrent point to the target point using absolute coordinates.  The target\npoint then becomes the new current point.</p>\n<p>The format of the DrawPathLineToHorizontalAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToHorizontalAbsolute( DrawingWand *drawing_wand, const PathMode mode,\n                                       const double x );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetohorizontalrelative\">\n<h1><a class=\"toc-backref\" href=\"#id285\">DrawPathLineToHorizontalRelative</a></h1>\n<div class=\"section\" id=\"id115\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToHorizontalRelative( DrawingWand *drawing_wand, const double x );\n</pre>\n</div>\n<div class=\"section\" id=\"id116\">\n<h2>Description</h2>\n<p>DrawPathLineToHorizontalRelative() draws a horizontal line path from the\ncurrent point to the target point using relative coordinates.  The target\npoint then becomes the new current point.</p>\n<p>The format of the DrawPathLineToHorizontalRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToHorizontalRelative( DrawingWand *drawing_wand, const double x );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetoverticalabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id286\">DrawPathLineToVerticalAbsolute</a></h1>\n<div class=\"section\" id=\"id117\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToVerticalAbsolute( DrawingWand *drawing_wand, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id118\">\n<h2>Description</h2>\n<p>DrawPathLineToVerticalAbsolute() draws a vertical line path from the\ncurrent point to the target point using absolute coordinates.  The target\npoint then becomes the new current point.</p>\n<p>The format of the DrawPathLineToVerticalAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToVerticalAbsolute( DrawingWand *drawing_wand, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathlinetoverticalrelative\">\n<h1><a class=\"toc-backref\" href=\"#id287\">DrawPathLineToVerticalRelative</a></h1>\n<div class=\"section\" id=\"id119\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathLineToVerticalRelative( DrawingWand *drawing_wand, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id120\">\n<h2>Description</h2>\n<p>DrawPathLineToVerticalRelative() draws a vertical line path from the\ncurrent point to the target point using relative coordinates.  The target\npoint then becomes the new current point.</p>\n<p>The format of the DrawPathLineToVerticalRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathLineToVerticalRelative( DrawingWand *drawing_wand, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathmovetoabsolute\">\n<h1><a class=\"toc-backref\" href=\"#id288\">DrawPathMoveToAbsolute</a></h1>\n<div class=\"section\" id=\"id121\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathMoveToAbsolute( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id122\">\n<h2>Description</h2>\n<p>DrawPathMoveToAbsolute() starts a new sub-path at the given coordinate\nusing absolute coordinates. The current point then becomes the\nspecified coordinate.</p>\n<p>The format of the DrawPathMoveToAbsolute method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathMoveToAbsolute( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathmovetorelative\">\n<h1><a class=\"toc-backref\" href=\"#id289\">DrawPathMoveToRelative</a></h1>\n<div class=\"section\" id=\"id123\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathMoveToRelative( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id124\">\n<h2>Description</h2>\n<p>DrawPathMoveToRelative() starts a new sub-path at the given coordinate\nusing relative coordinates. The current point then becomes the\nspecified coordinate.</p>\n<p>The format of the DrawPathMoveToRelative method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathMoveToRelative( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>target x ordinate</dd>\n<dt>y:</dt>\n<dd>target y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpathstart\">\n<h1><a class=\"toc-backref\" href=\"#id290\">DrawPathStart</a></h1>\n<div class=\"section\" id=\"id125\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPathStart( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id126\">\n<h2>Description</h2>\n<p>DrawPathStart() declares the start of a path drawing list which is terminated\nby a matching DrawPathFinish() command. All other DrawPath commands must\nbe enclosed between a DrawPathStart() and a DrawPathFinish() command. This\nis because path drawing commands are subordinate commands and they do not\nfunction by themselves.</p>\n<p>The format of the DrawPathStart method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPathStart( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpeekgraphiccontext\">\n<h1><a class=\"toc-backref\" href=\"#id291\">DrawPeekGraphicContext</a></h1>\n<div class=\"section\" id=\"id127\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *DrawPeekGraphicContext( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id128\">\n<h2>Description</h2>\n<p>DrawPeekGraphicContext() returns the current graphic drawing_wand.</p>\n<p>The format of the DrawPeekGraphicContext method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#drawinfo\">DrawInfo</a> *DrawPeekGraphicContext( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpoint\">\n<h1><a class=\"toc-backref\" href=\"#id292\">DrawPoint</a></h1>\n<div class=\"section\" id=\"id129\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPoint( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id130\">\n<h2>Description</h2>\n<p>DrawPoint() draws a point using the current stroke color and stroke\nthickness at the specified coordinates.</p>\n<p>The format of the DrawPoint method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPoint( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>target x coordinate</dd>\n<dt>y:</dt>\n<dd>target y coordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpolygon\">\n<h1><a class=\"toc-backref\" href=\"#id293\">DrawPolygon</a></h1>\n<div class=\"section\" id=\"id131\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPolygon( DrawingWand *drawing_wand, const unsigned long number_coordinates,\n                  const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n</div>\n<div class=\"section\" id=\"id132\">\n<h2>Description</h2>\n<p>DrawPolygon() draws a polygon using the current stroke, stroke width, and\nfill color or texture, using the specified array of coordinates.</p>\n<p>The format of the DrawPolygon method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPolygon( DrawingWand *drawing_wand, const unsigned long number_coordinates,\n                  const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>number_coordinates:</dt>\n<dd>number of coordinates</dd>\n<dt>coordinates:</dt>\n<dd>coordinate array</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpolyline\">\n<h1><a class=\"toc-backref\" href=\"#id294\">DrawPolyline</a></h1>\n<div class=\"section\" id=\"id133\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPolyline( DrawingWand *drawing_wand, const unsigned long number_coordinates,\n                   const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n</div>\n<div class=\"section\" id=\"id134\">\n<h2>Description</h2>\n<p>DrawPolyline() draws a polyline using the current stroke, stroke width, and\nfill color or texture, using the specified array of coordinates.</p>\n<p>The format of the DrawPolyline method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPolyline( DrawingWand *drawing_wand, const unsigned long number_coordinates,\n                   const <a class=\"reference external\" href=\"../api/types.html#pointinfo\">PointInfo</a> *coordinates );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>number_coordinates:</dt>\n<dd>number of coordinates</dd>\n<dt>coordinates:</dt>\n<dd>coordinate array</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpopclippath\">\n<h1><a class=\"toc-backref\" href=\"#id295\">DrawPopClipPath</a></h1>\n<div class=\"section\" id=\"id135\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPopClipPath( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id136\">\n<h2>Description</h2>\n<p>DrawPopClipPath() terminates a clip path definition.</p>\n<p>The format of the DrawPopClipPath method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPopClipPath( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpopdefs\">\n<h1><a class=\"toc-backref\" href=\"#id296\">DrawPopDefs</a></h1>\n<div class=\"section\" id=\"id137\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPopDefs( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id138\">\n<h2>Description</h2>\n<p>DrawPopDefs() terminates a definition list</p>\n<p>The format of the DrawPopDefs method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPopDefs( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpopgraphiccontext\">\n<h1><a class=\"toc-backref\" href=\"#id297\">DrawPopGraphicContext</a></h1>\n<div class=\"section\" id=\"id139\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPopGraphicContext( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id140\">\n<h2>Description</h2>\n<p>DrawPopGraphicContext() destroys the current drawing_wand returning to the\npreviously pushed drawing wand. Multiple drawing wand  may exist. It is an\nerror to attempt to pop more drawing_wands than have been pushed, and it is\nproper form to pop all drawing_wands which have been pushed.</p>\n<p>The format of the DrawPopGraphicContext method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPopGraphicContext( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpoppattern\">\n<h1><a class=\"toc-backref\" href=\"#id298\">DrawPopPattern</a></h1>\n<div class=\"section\" id=\"id141\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPopPattern( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id142\">\n<h2>Description</h2>\n<p>DrawPopPattern() terminates a pattern definition.</p>\n<p>The format of the DrawPopPattern method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPopPattern( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpushclippath\">\n<h1><a class=\"toc-backref\" href=\"#id299\">DrawPushClipPath</a></h1>\n<div class=\"section\" id=\"id143\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPushClipPath( DrawingWand *drawing_wand, const char *clip_path_id );\n</pre>\n</div>\n<div class=\"section\" id=\"id144\">\n<h2>Description</h2>\n<p>DrawPushClipPath() starts a clip path definition which is comprized of\nany number of drawing commands and terminated by a DrawPopClipPath()\ncommand.</p>\n<p>The format of the DrawPushClipPath method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPushClipPath( DrawingWand *drawing_wand, const char *clip_path_id );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>clip_path_id:</dt>\n<dd>string identifier to associate with the clip path for\nlater use.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpushdefs\">\n<h1><a class=\"toc-backref\" href=\"#id300\">DrawPushDefs</a></h1>\n<div class=\"section\" id=\"id145\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPushDefs( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id146\">\n<h2>Description</h2>\n<p>DrawPushDefs() indicates that commands up to a terminating DrawPopDefs()\ncommand create named elements (e.g. clip-paths, textures, etc.) which\nmay safely be processed earlier for the sake of efficiency.</p>\n<p>The format of the DrawPushDefs method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPushDefs( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpushgraphiccontext\">\n<h1><a class=\"toc-backref\" href=\"#id301\">DrawPushGraphicContext</a></h1>\n<div class=\"section\" id=\"id147\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPushGraphicContext( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id148\">\n<h2>Description</h2>\n<p>DrawPushGraphicContext() clones the current drawing wand to create a\nnew drawing wand. The original drawing drawing_wand(s) may be returned to\nby invoking DrawPopGraphicContext().  The drawing wands are stored on a\ndrawing wand stack.  For every Pop there must have already been an\nequivalent Push.</p>\n<p>The format of the DrawPushGraphicContext method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPushGraphicContext( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawpushpattern\">\n<h1><a class=\"toc-backref\" href=\"#id302\">DrawPushPattern</a></h1>\n<div class=\"section\" id=\"id149\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawPushPattern( DrawingWand *drawing_wand, const char *pattern_id, const double x,\n                      const double y, const double width, const double height );\n</pre>\n</div>\n<div class=\"section\" id=\"id150\">\n<h2>Description</h2>\n<p>DrawPushPattern() indicates that subsequent commands up to a\nDrawPopPattern() command comprise the definition of a named pattern.\nThe pattern space is assigned top left corner coordinates, a width\nand height, and becomes its own drawing space.  Anything which can\nbe drawn may be used in a pattern definition.\nNamed patterns may be used as stroke or brush definitions.</p>\n<p>The format of the DrawPushPattern method is:</p>\n<pre class=\"literal-block\">\nvoid DrawPushPattern( DrawingWand *drawing_wand, const char *pattern_id, const double x,\n                      const double y, const double width, const double height );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>pattern_id:</dt>\n<dd>pattern identification for later reference</dd>\n<dt>x:</dt>\n<dd>x ordinate of top left corner</dd>\n<dt>y:</dt>\n<dd>y ordinate of top left corner</dd>\n<dt>width:</dt>\n<dd>width of pattern space</dd>\n<dt>height:</dt>\n<dd>height of pattern space</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawrectangle\">\n<h1><a class=\"toc-backref\" href=\"#id303\">DrawRectangle</a></h1>\n<div class=\"section\" id=\"id151\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawRectangle( DrawingWand *drawing_wand, const double x1, const double y1,\n                    const double x2, const double y2 );\n</pre>\n</div>\n<div class=\"section\" id=\"id152\">\n<h2>Description</h2>\n<p>DrawRectangle() draws a rectangle given two coordinates and using\nthe current stroke, stroke width, and fill settings.</p>\n<p>The format of the DrawRectangle method is:</p>\n<pre class=\"literal-block\">\nvoid DrawRectangle( DrawingWand *drawing_wand, const double x1, const double y1,\n                    const double x2, const double y2 );\n</pre>\n<dl class=\"docutils\">\n<dt>x1:</dt>\n<dd>x ordinate of first coordinate</dd>\n<dt>y1:</dt>\n<dd>y ordinate of first coordinate</dd>\n<dt>x2:</dt>\n<dd>x ordinate of second coordinate</dd>\n<dt>y2:</dt>\n<dd>y ordinate of second coordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawrender\">\n<h1><a class=\"toc-backref\" href=\"#id304\">DrawRender</a></h1>\n<div class=\"section\" id=\"id153\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int DrawRender( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id154\">\n<h2>Description</h2>\n<p>DrawRender() renders all preceding drawing commands onto the image.\nThis function is deprecated.  Use MagickDrawImage() instead.</p>\n<p>The format of the DrawRender method is:</p>\n<pre class=\"literal-block\">\nunsigned int DrawRender( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawrotate\">\n<h1><a class=\"toc-backref\" href=\"#id305\">DrawRotate</a></h1>\n<div class=\"section\" id=\"id155\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawRotate( DrawingWand *drawing_wand, const double degrees );\n</pre>\n</div>\n<div class=\"section\" id=\"id156\">\n<h2>Description</h2>\n<p>DrawRotate() applies the specified rotation to the current coordinate space.</p>\n<p>The format of the DrawRotate method is:</p>\n<pre class=\"literal-block\">\nvoid DrawRotate( DrawingWand *drawing_wand, const double degrees );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>degrees:</dt>\n<dd>degrees of rotation</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawroundrectangle\">\n<h1><a class=\"toc-backref\" href=\"#id306\">DrawRoundRectangle</a></h1>\n<div class=\"section\" id=\"id157\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawRoundRectangle( DrawingWand *drawing_wand, double x1, double y1, double x2, double y2,\n                         double rx, double ry );\n</pre>\n</div>\n<div class=\"section\" id=\"id158\">\n<h2>Description</h2>\n<p>DrawRoundRectangle() draws a rounted rectangle given two coordinates,\nx &amp; y corner radiuses and using the current stroke, stroke width,\nand fill settings.</p>\n<p>The format of the DrawRoundRectangle method is:</p>\n<pre class=\"literal-block\">\nvoid DrawRoundRectangle( DrawingWand *drawing_wand, double x1, double y1, double x2, double y2,\n                         double rx, double ry );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x1:</dt>\n<dd>x ordinate of first coordinate</dd>\n<dt>y1:</dt>\n<dd>y ordinate of first coordinate</dd>\n<dt>x2:</dt>\n<dd>x ordinate of second coordinate</dd>\n<dt>y2:</dt>\n<dd>y ordinate of second coordinate</dd>\n<dt>rx:</dt>\n<dd>radius of corner in horizontal direction</dd>\n<dt>ry:</dt>\n<dd>radius of corner in vertical direction</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawscale\">\n<h1><a class=\"toc-backref\" href=\"#id307\">DrawScale</a></h1>\n<div class=\"section\" id=\"id159\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawScale( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id160\">\n<h2>Description</h2>\n<p>DrawScale() adjusts the scaling factor to apply in the horizontal and\nvertical directions to the current coordinate space.</p>\n<p>The format of the DrawScale method is:</p>\n<pre class=\"literal-block\">\nvoid DrawScale( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>horizontal scale factor</dd>\n<dt>y:</dt>\n<dd>vertical scale factor</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawskewx\">\n<h1><a class=\"toc-backref\" href=\"#id308\">DrawSkewX</a></h1>\n<div class=\"section\" id=\"id161\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSkewX( DrawingWand *drawing_wand, const double degrees );\n</pre>\n</div>\n<div class=\"section\" id=\"id162\">\n<h2>Description</h2>\n<p>DrawSkewX() skews the current coordinate system in the horizontal\ndirection.</p>\n<p>The format of the DrawSkewX method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSkewX( DrawingWand *drawing_wand, const double degrees );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>degrees:</dt>\n<dd>number of degrees to skew the coordinates</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawskewy\">\n<h1><a class=\"toc-backref\" href=\"#id309\">DrawSkewY</a></h1>\n<div class=\"section\" id=\"id163\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSkewY( DrawingWand *drawing_wand, const double degrees );\n</pre>\n</div>\n<div class=\"section\" id=\"id164\">\n<h2>Description</h2>\n<p>DrawSkewY() skews the current coordinate system in the vertical\ndirection.</p>\n<p>The format of the DrawSkewY method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSkewY( DrawingWand *drawing_wand, const double degrees );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>degrees:</dt>\n<dd>number of degrees to skew the coordinates</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstopcolor\">\n<h1><a class=\"toc-backref\" href=\"#id310\">DrawSetStopColor</a></h1>\n<div class=\"section\" id=\"id165\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStopColor( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *stop_color,\n                       const double offset );\n</pre>\n</div>\n<div class=\"section\" id=\"id166\">\n<h2>Description</h2>\n<p>DrawSetStopColor() sets the stop color and offset for gradients</p>\n<p>The format of the DrawSetStopColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStopColor( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *stop_color,\n                       const double offset );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n<p>o stop_color:</p>\n<p>o offset:</p>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokecolor\">\n<h1><a class=\"toc-backref\" href=\"#id311\">DrawGetStrokeColor</a></h1>\n<div class=\"section\" id=\"id167\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawGetStrokeColor( const DrawingWand *drawing_wand, ;\n</pre>\n</div>\n<div class=\"section\" id=\"id168\">\n<h2>Description</h2>\n<p>DrawGetStrokeColor() returns the color used for stroking object outlines.</p>\n<p>The format of the DrawGetStrokeColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawGetStrokeColor( const DrawingWand *drawing_wand, ;\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>stroke_color:</dt>\n<dd>Return the stroke color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokecolor\">\n<h1><a class=\"toc-backref\" href=\"#id312\">DrawSetStrokeColor</a></h1>\n<div class=\"section\" id=\"id169\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeColor( DrawingWand *drawing_wand, const PixelWand *stroke_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id170\">\n<h2>Description</h2>\n<p>DrawSetStrokeColor() sets the color used for stroking object outlines.</p>\n<p>The format of the DrawSetStrokeColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeColor( DrawingWand *drawing_wand, const PixelWand *stroke_wand );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>stroke_wand:</dt>\n<dd>stroke wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokepatternurl\">\n<h1><a class=\"toc-backref\" href=\"#id313\">DrawSetStrokePatternURL</a></h1>\n<div class=\"section\" id=\"id171\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokePatternURL( DrawingWand *drawing_wand, const char *stroke_url );\n</pre>\n</div>\n<div class=\"section\" id=\"id172\">\n<h2>Description</h2>\n<p>DrawSetStrokePatternURL() sets the pattern used for stroking object outlines.</p>\n<p>The format of the DrawSetStrokePatternURL method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokePatternURL( DrawingWand *drawing_wand, const char *stroke_url );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>stroke_url:</dt>\n<dd>URL specifying pattern ID (e.g. &quot;#pattern_id&quot;)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokeantialias\">\n<h1><a class=\"toc-backref\" href=\"#id314\">DrawGetStrokeAntialias</a></h1>\n<div class=\"section\" id=\"id173\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int DrawGetStrokeAntialias( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id174\">\n<h2>Description</h2>\n<p>DrawGetStrokeAntialias() returns the current stroke antialias setting.\nStroked outlines are antialiased by default.  When antialiasing is disabled\nstroked pixels are thresholded to determine if the stroke color or\nunderlying canvas color should be used.</p>\n<p>The format of the DrawGetStrokeAntialias method is:</p>\n<pre class=\"literal-block\">\nunsigned int DrawGetStrokeAntialias( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokeantialias\">\n<h1><a class=\"toc-backref\" href=\"#id315\">DrawSetStrokeAntialias</a></h1>\n<div class=\"section\" id=\"id175\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeAntialias( DrawingWand *drawing_wand,\n                             const unsigned int stroke_antialias );\n</pre>\n</div>\n<div class=\"section\" id=\"id176\">\n<h2>Description</h2>\n<p>DrawSetStrokeAntialias() controls whether stroked outlines are antialiased.\nStroked outlines are antialiased by default.  When antialiasing is disabled\nstroked pixels are thresholded to determine if the stroke color or\nunderlying canvas color should be used.</p>\n<p>The format of the DrawSetStrokeAntialias method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeAntialias( DrawingWand *drawing_wand,\n                             const unsigned int stroke_antialias );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>stroke_antialias:</dt>\n<dd>set to false (zero) to disable antialiasing</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokedasharray\">\n<h1><a class=\"toc-backref\" href=\"#id316\">DrawGetStrokeDashArray</a></h1>\n<div class=\"section\" id=\"id177\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble *DrawGetStrokeDashArray( const DrawingWand *drawing_wand,\n                                unsigned long *number_elements );\n</pre>\n</div>\n<div class=\"section\" id=\"id178\">\n<h2>Description</h2>\n<p>DrawGetStrokeDashArray() returns an array representing the pattern of\ndashes and gaps used to stroke paths (see DrawSetStrokeDashArray). The\narray must be freed once it is no longer required by the user.</p>\n<p>The format of the DrawGetStrokeDashArray method is:</p>\n<pre class=\"literal-block\">\ndouble *DrawGetStrokeDashArray( const DrawingWand *drawing_wand,\n                                unsigned long *number_elements );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>number_elements:</dt>\n<dd>address to place number of elements in dash array</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokedasharray\">\n<h1><a class=\"toc-backref\" href=\"#id317\">DrawSetStrokeDashArray</a></h1>\n<div class=\"section\" id=\"id179\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeDashArray( DrawingWand *drawing_wand, const unsigned long number_elements,\n                             const double *dash_array );\n</pre>\n</div>\n<div class=\"section\" id=\"id180\">\n<h2>Description</h2>\n<p>DrawSetStrokeDashArray() specifies the pattern of dashes and gaps used to\nstroke paths. The stroke dash array represents an array of numbers that\nspecify the lengths of alternating dashes and gaps in pixels. If an odd\nnumber of values is provided, then the list of values is repeated to yield\nan even number of values. To remove an existing dash array, pass a zero\nnumber_elements argument and null dash_array.\nA typical stroke dash array might contain the members 5 3 2.</p>\n<p>The format of the DrawSetStrokeDashArray method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeDashArray( DrawingWand *drawing_wand, const unsigned long number_elements,\n                             const double *dash_array );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>number_elements:</dt>\n<dd>number of elements in dash array</dd>\n<dt>dash_array:</dt>\n<dd>dash array values</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokedashoffset\">\n<h1><a class=\"toc-backref\" href=\"#id318\">DrawGetStrokeDashOffset</a></h1>\n<div class=\"section\" id=\"id181\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeDashOffset( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id182\">\n<h2>Description</h2>\n<p>DrawGetStrokeDashOffset() returns the offset into the dash pattern to\nstart the dash.</p>\n<p>The format of the DrawGetStrokeDashOffset method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeDashOffset( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokedashoffset\">\n<h1><a class=\"toc-backref\" href=\"#id319\">DrawSetStrokeDashOffset</a></h1>\n<div class=\"section\" id=\"id183\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeDashOffset( DrawingWand *drawing_wand, const double dash_offset );\n</pre>\n</div>\n<div class=\"section\" id=\"id184\">\n<h2>Description</h2>\n<p>DrawSetStrokeDashOffset() specifies the offset into the dash pattern to\nstart the dash.</p>\n<p>The format of the DrawSetStrokeDashOffset method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeDashOffset( DrawingWand *drawing_wand, const double dash_offset );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>dash_offset:</dt>\n<dd>dash offset</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokelinecap\">\n<h1><a class=\"toc-backref\" href=\"#id320\">DrawGetStrokeLineCap</a></h1>\n<div class=\"section\" id=\"id185\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nLineCap DrawGetStrokeLineCap( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id186\">\n<h2>Description</h2>\n<p>DrawGetStrokeLineCap() returns the shape to be used at the end of\nopen subpaths when they are stroked. Values of LineCap are\nUndefinedCap, ButtCap, RoundCap, and SquareCap.</p>\n<p>The format of the DrawGetStrokeLineCap method is:</p>\n<pre class=\"literal-block\">\nLineCap DrawGetStrokeLineCap( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokelinecap\">\n<h1><a class=\"toc-backref\" href=\"#id321\">DrawSetStrokeLineCap</a></h1>\n<div class=\"section\" id=\"id187\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeLineCap( DrawingWand *drawing_wand, const LineCap linecap );\n</pre>\n</div>\n<div class=\"section\" id=\"id188\">\n<h2>Description</h2>\n<p>DrawSetStrokeLineCap() specifies the shape to be used at the end of\nopen subpaths when they are stroked. Values of LineCap are\nUndefinedCap, ButtCap, RoundCap, and SquareCap.</p>\n<p>The format of the DrawSetStrokeLineCap method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeLineCap( DrawingWand *drawing_wand, const LineCap linecap );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>linecap:</dt>\n<dd>linecap style</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokelinejoin\">\n<h1><a class=\"toc-backref\" href=\"#id322\">DrawGetStrokeLineJoin</a></h1>\n<div class=\"section\" id=\"id189\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nLineJoin DrawGetStrokeLineJoin( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id190\">\n<h2>Description</h2>\n<p>DrawGetStrokeLineJoin() returns the shape to be used at the\ncorners of paths (or other vector shapes) when they are\nstroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin,\nand BevelJoin.</p>\n<p>The format of the DrawGetStrokeLineJoin method is:</p>\n<pre class=\"literal-block\">\nLineJoin DrawGetStrokeLineJoin( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokelinejoin\">\n<h1><a class=\"toc-backref\" href=\"#id323\">DrawSetStrokeLineJoin</a></h1>\n<div class=\"section\" id=\"id191\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeLineJoin( DrawingWand *drawing_wand, const LineJoin linejoin );\n</pre>\n</div>\n<div class=\"section\" id=\"id192\">\n<h2>Description</h2>\n<p>DrawSetStrokeLineJoin() specifies the shape to be used at the\ncorners of paths (or other vector shapes) when they are\nstroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin,\nand BevelJoin.</p>\n<p>The format of the DrawSetStrokeLineJoin method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeLineJoin( DrawingWand *drawing_wand, const LineJoin linejoin );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>linejoin:</dt>\n<dd>line join style</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokemiterlimit\">\n<h1><a class=\"toc-backref\" href=\"#id324\">DrawGetStrokeMiterLimit</a></h1>\n<div class=\"section\" id=\"id193\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long DrawGetStrokeMiterLimit( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id194\">\n<h2>Description</h2>\n<p>DrawGetStrokeMiterLimit() returns the miter limit. When two line\nsegments meet at a sharp angle and miter joins have been specified for\n'lineJoin', it is possible for the miter to extend far beyond the\nthickness of the line stroking the path. The miterLimit' imposes a\nlimit on the ratio of the miter length to the 'lineWidth'.</p>\n<p>The format of the DrawGetStrokeMiterLimit method is:</p>\n<pre class=\"literal-block\">\nunsigned long DrawGetStrokeMiterLimit( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokemiterlimit\">\n<h1><a class=\"toc-backref\" href=\"#id325\">DrawSetStrokeMiterLimit</a></h1>\n<div class=\"section\" id=\"id195\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeMiterLimit( DrawingWand *drawing_wand, const unsigned long miterlimit );\n</pre>\n</div>\n<div class=\"section\" id=\"id196\">\n<h2>Description</h2>\n<p>DrawSetStrokeMiterLimit() specifies the miter limit. When two line\nsegments meet at a sharp angle and miter joins have been specified for\n'lineJoin', it is possible for the miter to extend far beyond the\nthickness of the line stroking the path. The miterLimit' imposes a\nlimit on the ratio of the miter length to the 'lineWidth'.</p>\n<p>The format of the DrawSetStrokeMiterLimit method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeMiterLimit( DrawingWand *drawing_wand, const unsigned long miterlimit );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>miterlimit:</dt>\n<dd>miter limit</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokeopacity\">\n<h1><a class=\"toc-backref\" href=\"#id326\">DrawGetStrokeOpacity</a></h1>\n<div class=\"section\" id=\"id197\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeOpacity( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id198\">\n<h2>Description</h2>\n<p>DrawGetStrokeOpacity() returns the opacity of stroked object outlines.</p>\n<p>The format of the DrawGetStrokeOpacity method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeOpacity( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokeopacity\">\n<h1><a class=\"toc-backref\" href=\"#id327\">DrawSetStrokeOpacity</a></h1>\n<div class=\"section\" id=\"id199\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeOpacity( DrawingWand *drawing_wand, const double stroke_opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id200\">\n<h2>Description</h2>\n<p>DrawSetStrokeOpacity() specifies the opacity of stroked object outlines.</p>\n<p>The format of the DrawSetStrokeOpacity method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeOpacity( DrawingWand *drawing_wand, const double stroke_opacity );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>stroke_opacity:</dt>\n<dd>stroke opacity.  The value 1.0 is opaque.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgetstrokewidth\">\n<h1><a class=\"toc-backref\" href=\"#id328\">DrawGetStrokeWidth</a></h1>\n<div class=\"section\" id=\"id201\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeWidth( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id202\">\n<h2>Description</h2>\n<p>DrawGetStrokeWidth() returns the width of the stroke used to draw object\noutlines.</p>\n<p>The format of the DrawGetStrokeWidth method is:</p>\n<pre class=\"literal-block\">\ndouble DrawGetStrokeWidth( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetstrokewidth\">\n<h1><a class=\"toc-backref\" href=\"#id329\">DrawSetStrokeWidth</a></h1>\n<div class=\"section\" id=\"id203\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeWidth( DrawingWand *drawing_wand, const double stroke_width );\n</pre>\n</div>\n<div class=\"section\" id=\"id204\">\n<h2>Description</h2>\n<p>DrawSetStrokeWidth() sets the width of the stroke used to draw object\noutlines.</p>\n<p>The format of the DrawSetStrokeWidth method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetStrokeWidth( DrawingWand *drawing_wand, const double stroke_width );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>stroke_width:</dt>\n<dd>stroke width</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgettextantialias\">\n<h1><a class=\"toc-backref\" href=\"#id330\">DrawGetTextAntialias</a></h1>\n<div class=\"section\" id=\"id205\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int DrawGetTextAntialias( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id206\">\n<h2>Description</h2>\n<p>DrawGetTextAntialias() returns the current text antialias setting, which\ndetermines whether text is antialiased.  Text is antialiased by default.</p>\n<p>The format of the DrawGetTextAntialias method is:</p>\n<pre class=\"literal-block\">\nunsigned int DrawGetTextAntialias( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsettextantialias\">\n<h1><a class=\"toc-backref\" href=\"#id331\">DrawSetTextAntialias</a></h1>\n<div class=\"section\" id=\"id207\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetTextAntialias( DrawingWand *drawing_wand, const unsigned int text_antialias );\n</pre>\n</div>\n<div class=\"section\" id=\"id208\">\n<h2>Description</h2>\n<p>DrawSetTextAntialias() controls whether text is antialiased.  Text is\nantialiased by default.</p>\n<p>The format of the DrawSetTextAntialias method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetTextAntialias( DrawingWand *drawing_wand, const unsigned int text_antialias );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>text_antialias:</dt>\n<dd>antialias boolean. Set to false (0) to disable\nantialiasing.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgettextdecoration\">\n<h1><a class=\"toc-backref\" href=\"#id332\">DrawGetTextDecoration</a></h1>\n<div class=\"section\" id=\"id209\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#decorationtype\">DecorationType</a> DrawGetTextDecoration( DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id210\">\n<h2>Description</h2>\n<p>DrawGetTextDecoration() returns the decoration applied when annotating with\ntext.</p>\n<p>The format of the DrawGetTextDecoration method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#decorationtype\">DecorationType</a> DrawGetTextDecoration( DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsettextdecoration\">\n<h1><a class=\"toc-backref\" href=\"#id333\">DrawSetTextDecoration</a></h1>\n<div class=\"section\" id=\"id211\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetTextDecoration( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#decorationtype\">DecorationType</a> decoration );\n</pre>\n</div>\n<div class=\"section\" id=\"id212\">\n<h2>Description</h2>\n<p>DrawSetTextDecoration() specifies a decoration to be applied when\nannotating with text.</p>\n<p>The format of the DrawSetTextDecoration method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetTextDecoration( DrawingWand *drawing_wand, const <a class=\"reference external\" href=\"../api/types.html#decorationtype\">DecorationType</a> decoration );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>decoration:</dt>\n<dd>text decoration.  One of NoDecoration, UnderlineDecoration,\nOverlineDecoration, or LineThroughDecoration</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgettextencoding\">\n<h1><a class=\"toc-backref\" href=\"#id334\">DrawGetTextEncoding</a></h1>\n<div class=\"section\" id=\"id213\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *DrawGetTextEncoding( const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id214\">\n<h2>Description</h2>\n<p>DrawGetTextEncoding() returns a null-terminated string which specifies the\ncode set used for text annotations. The string must be freed by the user\nonce it is no longer required.</p>\n<p>The format of the DrawGetTextEncoding method is:</p>\n<pre class=\"literal-block\">\nchar *DrawGetTextEncoding( const DrawingWand *drawing_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsettextencoding\">\n<h1><a class=\"toc-backref\" href=\"#id335\">DrawSetTextEncoding</a></h1>\n<div class=\"section\" id=\"id215\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetTextEncoding( DrawingWand *drawing_wand, const char *encoding );\n</pre>\n</div>\n<div class=\"section\" id=\"id216\">\n<h2>Description</h2>\n<p>DrawSetTextEncoding() specifies specifies the code set to use for\ntext annotations. The only character encoding which may be specified\nat this time is &quot;UTF-8&quot; for representing Unicode as a sequence of\nbytes. Specify an empty string to set text encoding to the system's\ndefault. Successful text annotation using Unicode may require fonts\ndesigned to support Unicode.</p>\n<p>The format of the DrawSetTextEncoding method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetTextEncoding( DrawingWand *drawing_wand, const char *encoding );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>encoding:</dt>\n<dd>character string specifying text encoding</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawgettextundercolor\">\n<h1><a class=\"toc-backref\" href=\"#id336\">DrawGetTextUnderColor</a></h1>\n<div class=\"section\" id=\"id217\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawGetTextUnderColor( const DrawingWand *drawing_wand, PixelWand *under_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id218\">\n<h2>Description</h2>\n<p>DrawGetTextUnderColor() returns the color of a background rectangle\nto place under text annotations.</p>\n<p>The format of the DrawGetTextUnderColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawGetTextUnderColor( const DrawingWand *drawing_wand, PixelWand *under_color );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>under_color:</dt>\n<dd>Return the under color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsettextundercolor\">\n<h1><a class=\"toc-backref\" href=\"#id337\">DrawSetTextUnderColor</a></h1>\n<div class=\"section\" id=\"id219\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetTextUnderColor( DrawingWand *drawing_wand, const PixelWand *under_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id220\">\n<h2>Description</h2>\n<p>DrawSetTextUnderColor() specifies the color of a background rectangle\nto place under text annotations.</p>\n<p>The format of the DrawSetTextUnderColor method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetTextUnderColor( DrawingWand *drawing_wand, const PixelWand *under_wand );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>under_wand.:</dt>\n<dd>text under wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawtranslate\">\n<h1><a class=\"toc-backref\" href=\"#id338\">DrawTranslate</a></h1>\n<div class=\"section\" id=\"id221\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawTranslate( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id222\">\n<h2>Description</h2>\n<p>DrawTranslate() applies a translation to the current coordinate\nsystem which moves the coordinate system origin to the specified\ncoordinate.</p>\n<p>The format of the DrawTranslate method is:</p>\n<pre class=\"literal-block\">\nvoid DrawTranslate( DrawingWand *drawing_wand, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x:</dt>\n<dd>new x ordinate for coordinate system origin</dd>\n<dt>y:</dt>\n<dd>new y ordinate for coordinate system origin</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"drawsetviewbox\">\n<h1><a class=\"toc-backref\" href=\"#id339\">DrawSetViewbox</a></h1>\n<div class=\"section\" id=\"id223\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DrawSetViewbox( DrawingWand *drawing_wand, unsigned long x1, unsigned long y1,\n                     unsigned long x2, unsigned long y2 );\n</pre>\n</div>\n<div class=\"section\" id=\"id224\">\n<h2>Description</h2>\n<p>DrawSetViewbox() sets the overall canvas size to be recorded with the\ndrawing vector data.  Usually this will be specified using the same\nsize as the canvas image.  When the vector data is saved to SVG or MVG\nformats, the viewbox is use to specify the size of the canvas image that\na viewer will render the vector data on.</p>\n<p>The format of the DrawSetViewbox method is:</p>\n<pre class=\"literal-block\">\nvoid DrawSetViewbox( DrawingWand *drawing_wand, unsigned long x1, unsigned long y1,\n                     unsigned long x2, unsigned long y2 );\n</pre>\n<dl class=\"docutils\">\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>x1:</dt>\n<dd>left x ordinate</dd>\n<dt>y1:</dt>\n<dd>top y ordinate</dd>\n<dt>x2:</dt>\n<dd>right x ordinate</dd>\n<dt>y2:</dt>\n<dd>bottom y ordinate</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"newdrawingwand\">\n<h1><a class=\"toc-backref\" href=\"#id340\">NewDrawingWand</a></h1>\n<div class=\"section\" id=\"id225\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nDrawingWand *NewDrawingWand( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id226\">\n<h2>Description</h2>\n<p>NewDrawingWand() returns a drawing wand required for all other methods in\nthe API.</p>\n<p>The format of the NewDrawingWand method is:</p>\n<pre class=\"literal-block\">\nDrawingWand *NewDrawingWand( void );\n</pre>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/wand/magick_wand.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>magick_wand</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"magick-wand\">\n<h1 class=\"title\">magick_wand</h1>\n<h2 class=\"subtitle\" id=\"wand-image-processing-interfaces\">Wand image processing interfaces</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#clonemagickwand\" id=\"id473\">CloneMagickWand</a></li>\n<li><a class=\"reference internal\" href=\"#destroymagickwand\" id=\"id474\">DestroyMagickWand</a></li>\n<li><a class=\"reference internal\" href=\"#magickadaptivethresholdimage\" id=\"id475\">MagickAdaptiveThresholdImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickaddimage\" id=\"id476\">MagickAddImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickaddnoiseimage\" id=\"id477\">MagickAddNoiseImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickaffinetransformimage\" id=\"id478\">MagickAffineTransformImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickannotateimage\" id=\"id479\">MagickAnnotateImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickanimateimages\" id=\"id480\">MagickAnimateImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickappendimages\" id=\"id481\">MagickAppendImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickautoorientimage\" id=\"id482\">MagickAutoOrientImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickaverageimages\" id=\"id483\">MagickAverageImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickblackthresholdimage\" id=\"id484\">MagickBlackThresholdImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickblurimage\" id=\"id485\">MagickBlurImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickborderimage\" id=\"id486\">MagickBorderImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickcdlimage\" id=\"id487\">MagickCdlImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickcharcoalimage\" id=\"id488\">MagickCharcoalImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickchopimage\" id=\"id489\">MagickChopImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickclearexception\" id=\"id490\">MagickClearException</a></li>\n<li><a class=\"reference internal\" href=\"#magickclipimage\" id=\"id491\">MagickClipImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickclippathimage\" id=\"id492\">MagickClipPathImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickcoalesceimages\" id=\"id493\">MagickCoalesceImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickcolorfloodfillimage\" id=\"id494\">MagickColorFloodfillImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickcolorizeimage\" id=\"id495\">MagickColorizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickcommentimage\" id=\"id496\">MagickCommentImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickcompareimagechannels\" id=\"id497\">MagickCompareImageChannels</a></li>\n<li><a class=\"reference internal\" href=\"#magickcompareimages\" id=\"id498\">MagickCompareImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickcompositeimage\" id=\"id499\">MagickCompositeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickcontrastimage\" id=\"id500\">MagickContrastImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickconvolveimage\" id=\"id501\">MagickConvolveImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickcropimage\" id=\"id502\">MagickCropImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickcyclecolormapimage\" id=\"id503\">MagickCycleColormapImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickdeconstructimages\" id=\"id504\">MagickDeconstructImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickdescribeimage\" id=\"id505\">MagickDescribeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickdespeckleimage\" id=\"id506\">MagickDespeckleImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickdisplayimage\" id=\"id507\">MagickDisplayImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickdisplayimages\" id=\"id508\">MagickDisplayImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickdrawimage\" id=\"id509\">MagickDrawImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickedgeimage\" id=\"id510\">MagickEdgeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickembossimage\" id=\"id511\">MagickEmbossImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickenhanceimage\" id=\"id512\">MagickEnhanceImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickequalizeimage\" id=\"id513\">MagickEqualizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickextentimage\" id=\"id514\">MagickExtentImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickflattenimages\" id=\"id515\">MagickFlattenImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickflipimage\" id=\"id516\">MagickFlipImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickflopimage\" id=\"id517\">MagickFlopImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickframeimage\" id=\"id518\">MagickFrameImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickfximage\" id=\"id519\">MagickFxImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickfximagechannel\" id=\"id520\">MagickFxImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#magickgammaimage\" id=\"id521\">MagickGammaImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickgammaimagechannel\" id=\"id522\">MagickGammaImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetconfigureinfo\" id=\"id523\">MagickGetConfigureInfo</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetcopyright\" id=\"id524\">MagickGetCopyright</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetexception\" id=\"id525\">MagickGetException</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetfilename\" id=\"id526\">MagickGetFilename</a></li>\n<li><a class=\"reference internal\" href=\"#magickgethomeurl\" id=\"id527\">MagickGetHomeURL</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimage\" id=\"id528\">MagickGetImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageattribute\" id=\"id529\">MagickGetImageAttribute</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagebackgroundcolor\" id=\"id530\">MagickGetImageBackgroundColor</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageblueprimary\" id=\"id531\">MagickGetImageBluePrimary</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagebordercolor\" id=\"id532\">MagickGetImageBorderColor</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageboundingbox\" id=\"id533\">MagickGetImageBoundingBox</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagechanneldepth\" id=\"id534\">MagickGetImageChannelDepth</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagechannelextrema\" id=\"id535\">MagickGetImageChannelExtrema</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagechannelmean\" id=\"id536\">MagickGetImageChannelMean</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagecolormapcolor\" id=\"id537\">MagickGetImageColormapColor</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagecolors\" id=\"id538\">MagickGetImageColors</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagecolorspace\" id=\"id539\">MagickGetImageColorspace</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagecompose\" id=\"id540\">MagickGetImageCompose</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagecompression\" id=\"id541\">MagickGetImageCompression</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagedelay\" id=\"id542\">MagickGetImageDelay</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagedepth\" id=\"id543\">MagickGetImageDepth</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageextrema\" id=\"id544\">MagickGetImageExtrema</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagedispose\" id=\"id545\">MagickGetImageDispose</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagefilename\" id=\"id546\">MagickGetImageFilename</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageformat\" id=\"id547\">MagickGetImageFormat</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagefuzz\" id=\"id548\">MagickGetImageFuzz</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagegamma\" id=\"id549\">MagickGetImageGamma</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagegravity\" id=\"id550\">MagickGetImageGravity</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagegreenprimary\" id=\"id551\">MagickGetImageGreenPrimary</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageheight\" id=\"id552\">MagickGetImageHeight</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagehistogram\" id=\"id553\">MagickGetImageHistogram</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageindex\" id=\"id554\">MagickGetImageIndex</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageinterlacescheme\" id=\"id555\">MagickGetImageInterlaceScheme</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageiterations\" id=\"id556\">MagickGetImageIterations</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagemattecolor\" id=\"id557\">MagickGetImageMatteColor</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageorientation\" id=\"id558\">MagickGetImageOrientation</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagepage\" id=\"id559\">MagickGetImagePage</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagepixels\" id=\"id560\">MagickGetImagePixels</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageprofile\" id=\"id561\">MagickGetImageProfile</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageredprimary\" id=\"id562\">MagickGetImageRedPrimary</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagerenderingintent\" id=\"id563\">MagickGetImageRenderingIntent</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageresolution\" id=\"id564\">MagickGetImageResolution</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagescene\" id=\"id565\">MagickGetImageScene</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagesignature\" id=\"id566\">MagickGetImageSignature</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagesize\" id=\"id567\">MagickGetImageSize</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagetype\" id=\"id568\">MagickGetImageType</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagesavedtype\" id=\"id569\">MagickGetImageSavedType</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimageunits\" id=\"id570\">MagickGetImageUnits</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagevirtualpixelmethod\" id=\"id571\">MagickGetImageVirtualPixelMethod</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagewhitepoint\" id=\"id572\">MagickGetImageWhitePoint</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetimagewidth\" id=\"id573\">MagickGetImageWidth</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetnumberimages\" id=\"id574\">MagickGetNumberImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetpackagename\" id=\"id575\">MagickGetPackageName</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetquantumdepth\" id=\"id576\">MagickGetQuantumDepth</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetreleasedate\" id=\"id577\">MagickGetReleaseDate</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetresourcelimit\" id=\"id578\">MagickGetResourceLimit</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetsamplingfactors\" id=\"id579\">MagickGetSamplingFactors</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetsize\" id=\"id580\">MagickGetSize</a></li>\n<li><a class=\"reference internal\" href=\"#magickgetversion\" id=\"id581\">MagickGetVersion</a></li>\n<li><a class=\"reference internal\" href=\"#magickhaldclutimage\" id=\"id582\">MagickHaldClutImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickhascolormap\" id=\"id583\">MagickHasColormap</a></li>\n<li><a class=\"reference internal\" href=\"#magickhasnextimage\" id=\"id584\">MagickHasNextImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickhaspreviousimage\" id=\"id585\">MagickHasPreviousImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickimplodeimage\" id=\"id586\">MagickImplodeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickisgrayimage\" id=\"id587\">MagickIsGrayImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickismonochromeimage\" id=\"id588\">MagickIsMonochromeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickisopaqueimage\" id=\"id589\">MagickIsOpaqueImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickispaletteimage\" id=\"id590\">MagickIsPaletteImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicklabelimage\" id=\"id591\">MagickLabelImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicklevelimage\" id=\"id592\">MagickLevelImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicklevelimagechannel\" id=\"id593\">MagickLevelImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#magickmagnifyimage\" id=\"id594\">MagickMagnifyImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickmapimage\" id=\"id595\">MagickMapImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickmattefloodfillimage\" id=\"id596\">MagickMatteFloodfillImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickmedianfilterimage\" id=\"id597\">MagickMedianFilterImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickminifyimage\" id=\"id598\">MagickMinifyImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickmodulateimage\" id=\"id599\">MagickModulateImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickmontageimage\" id=\"id600\">MagickMontageImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickmorphimages\" id=\"id601\">MagickMorphImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickmosaicimages\" id=\"id602\">MagickMosaicImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickmotionblurimage\" id=\"id603\">MagickMotionBlurImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicknegateimage\" id=\"id604\">MagickNegateImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicknegateimagechannel\" id=\"id605\">MagickNegateImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#magicknextimage\" id=\"id606\">MagickNextImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicknormalizeimage\" id=\"id607\">MagickNormalizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickoilpaintimage\" id=\"id608\">MagickOilPaintImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickopaqueimage\" id=\"id609\">MagickOpaqueImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickpingimage\" id=\"id610\">MagickPingImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickpreviewimages\" id=\"id611\">MagickPreviewImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickpreviousimage\" id=\"id612\">MagickPreviousImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickprofileimage\" id=\"id613\">MagickProfileImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickquantizeimage\" id=\"id614\">MagickQuantizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickquantizeimages\" id=\"id615\">MagickQuantizeImages</a></li>\n<li><a class=\"reference internal\" href=\"#magickqueryfontmetrics\" id=\"id616\">MagickQueryFontMetrics</a></li>\n<li><a class=\"reference internal\" href=\"#magickqueryfonts\" id=\"id617\">MagickQueryFonts</a></li>\n<li><a class=\"reference internal\" href=\"#magickqueryformats\" id=\"id618\">MagickQueryFormats</a></li>\n<li><a class=\"reference internal\" href=\"#magickradialblurimage\" id=\"id619\">MagickRadialBlurImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickraiseimage\" id=\"id620\">MagickRaiseImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickreadimage\" id=\"id621\">MagickReadImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickreadimageblob\" id=\"id622\">MagickReadImageBlob</a></li>\n<li><a class=\"reference internal\" href=\"#magickreadimagefile\" id=\"id623\">MagickReadImageFile</a></li>\n<li><a class=\"reference internal\" href=\"#magickreducenoiseimage\" id=\"id624\">MagickReduceNoiseImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickrelinquishmemory\" id=\"id625\">MagickRelinquishMemory</a></li>\n<li><a class=\"reference internal\" href=\"#magickremoveimage\" id=\"id626\">MagickRemoveImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickremoveimageoption\" id=\"id627\">MagickRemoveImageOption</a></li>\n<li><a class=\"reference internal\" href=\"#magickremoveimageprofile\" id=\"id628\">MagickRemoveImageProfile</a></li>\n<li><a class=\"reference internal\" href=\"#magickresetiterator\" id=\"id629\">MagickResetIterator</a></li>\n<li><a class=\"reference internal\" href=\"#magickresampleimage\" id=\"id630\">MagickResampleImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickresizeimage\" id=\"id631\">MagickResizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickrollimage\" id=\"id632\">MagickRollImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickrotateimage\" id=\"id633\">MagickRotateImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicksampleimage\" id=\"id634\">MagickSampleImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickscaleimage\" id=\"id635\">MagickScaleImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickseparateimagechannel\" id=\"id636\">MagickSeparateImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetcompressionquality\" id=\"id637\">MagickSetCompressionQuality</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetdepth\" id=\"id638\">MagickSetDepth</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetfilename\" id=\"id639\">MagickSetFilename</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetformat\" id=\"id640\">MagickSetFormat</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimage\" id=\"id641\">MagickSetImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageattribute\" id=\"id642\">MagickSetImageAttribute</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagebackgroundcolor\" id=\"id643\">MagickSetImageBackgroundColor</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageblueprimary\" id=\"id644\">MagickSetImageBluePrimary</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagebordercolor\" id=\"id645\">MagickSetImageBorderColor</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagecolormapcolor\" id=\"id646\">MagickSetImageColormapColor</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagecolorspace\" id=\"id647\">MagickSetImageColorspace</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagecompose\" id=\"id648\">MagickSetImageCompose</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagecompression\" id=\"id649\">MagickSetImageCompression</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagedelay\" id=\"id650\">MagickSetImageDelay</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagechanneldepth\" id=\"id651\">MagickSetImageChannelDepth</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagedepth\" id=\"id652\">MagickSetImageDepth</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagedispose\" id=\"id653\">MagickSetImageDispose</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagefilename\" id=\"id654\">MagickSetImageFilename</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageformat\" id=\"id655\">MagickSetImageFormat</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagefuzz\" id=\"id656\">MagickSetImageFuzz</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagegamma\" id=\"id657\">MagickSetImageGamma</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagegravity\" id=\"id658\">MagickSetImageGravity</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagegreenprimary\" id=\"id659\">MagickSetImageGreenPrimary</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageindex\" id=\"id660\">MagickSetImageIndex</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageinterlacescheme\" id=\"id661\">MagickSetImageInterlaceScheme</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageiterations\" id=\"id662\">MagickSetImageIterations</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagemattecolor\" id=\"id663\">MagickSetImageMatteColor</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageoption\" id=\"id664\">MagickSetImageOption</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageorientation\" id=\"id665\">MagickSetImageOrientation</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagepage\" id=\"id666\">MagickSetImagePage</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagepixels\" id=\"id667\">MagickSetImagePixels</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageprofile\" id=\"id668\">MagickSetImageProfile</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageredprimary\" id=\"id669\">MagickSetImageRedPrimary</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagerenderingintent\" id=\"id670\">MagickSetImageRenderingIntent</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageresolution\" id=\"id671\">MagickSetImageResolution</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagescene\" id=\"id672\">MagickSetImageScene</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagetype\" id=\"id673\">MagickSetImageType</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagesavedtype\" id=\"id674\">MagickSetImageSavedType</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimageunits\" id=\"id675\">MagickSetImageUnits</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagevirtualpixelmethod\" id=\"id676\">MagickSetImageVirtualPixelMethod</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetinterlacescheme\" id=\"id677\">MagickSetInterlaceScheme</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetresolution\" id=\"id678\">MagickSetResolution</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetresolutionunits\" id=\"id679\">MagickSetResolutionUnits</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetresourcelimit\" id=\"id680\">MagickSetResourceLimit</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetsamplingfactors\" id=\"id681\">MagickSetSamplingFactors</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetsize\" id=\"id682\">MagickSetSize</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetimagewhitepoint\" id=\"id683\">MagickSetImageWhitePoint</a></li>\n<li><a class=\"reference internal\" href=\"#magicksetpassphrase\" id=\"id684\">MagickSetPassphrase</a></li>\n<li><a class=\"reference internal\" href=\"#magicksharpenimage\" id=\"id685\">MagickSharpenImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickshaveimage\" id=\"id686\">MagickShaveImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickshearimage\" id=\"id687\">MagickShearImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicksolarizeimage\" id=\"id688\">MagickSolarizeImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickspreadimage\" id=\"id689\">MagickSpreadImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicksteganoimage\" id=\"id690\">MagickSteganoImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickstereoimage\" id=\"id691\">MagickStereoImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickstripimage\" id=\"id692\">MagickStripImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickswirlimage\" id=\"id693\">MagickSwirlImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicktextureimage\" id=\"id694\">MagickTextureImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickthresholdimage\" id=\"id695\">MagickThresholdImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickthresholdimagechannel\" id=\"id696\">MagickThresholdImageChannel</a></li>\n<li><a class=\"reference internal\" href=\"#magicktintimage\" id=\"id697\">MagickTintImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicktransformimage\" id=\"id698\">MagickTransformImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicktransparentimage\" id=\"id699\">MagickTransparentImage</a></li>\n<li><a class=\"reference internal\" href=\"#magicktrimimage\" id=\"id700\">MagickTrimImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickunsharpmaskimage\" id=\"id701\">MagickUnsharpMaskImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickwaveimage\" id=\"id702\">MagickWaveImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickwhitethresholdimage\" id=\"id703\">MagickWhiteThresholdImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickwriteimage\" id=\"id704\">MagickWriteImage</a></li>\n<li><a class=\"reference internal\" href=\"#magickwriteimagesfile\" id=\"id705\">MagickWriteImagesFile</a></li>\n<li><a class=\"reference internal\" href=\"#magickwriteimageblob\" id=\"id706\">MagickWriteImageBlob</a></li>\n<li><a class=\"reference internal\" href=\"#magickwriteimagefile\" id=\"id707\">MagickWriteImageFile</a></li>\n<li><a class=\"reference internal\" href=\"#magickwriteimages\" id=\"id708\">MagickWriteImages</a></li>\n<li><a class=\"reference internal\" href=\"#newmagickwand\" id=\"id709\">NewMagickWand</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"clonemagickwand\">\n<h1><a class=\"toc-backref\" href=\"#id473\">CloneMagickWand</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *CloneMagickWand( const MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>CloneMagickWand() makes an exact copy of the specified wand.</p>\n<p>The format of the CloneMagickWand method is:</p>\n<pre class=\"literal-block\">\nMagickWand *CloneMagickWand( const MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand to clone.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroymagickwand\">\n<h1><a class=\"toc-backref\" href=\"#id474\">DestroyMagickWand</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid DestroyMagickWand( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>DestroyMagickWand() deallocates memory associated with an MagickWand.</p>\n<p>The format of the DestroyMagickWand method is:</p>\n<pre class=\"literal-block\">\nvoid DestroyMagickWand( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickadaptivethresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id475\">MagickAdaptiveThresholdImage</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickAdaptiveThresholdImage( MagickWand *wand, const unsigned long width,\n                                           const unsigned long height, const long offset );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>MagickAdaptiveThresholdImage() selects an individual threshold for each pixel\nbased on the range of intensity values in its local neighborhood.  This\nallows for thresholding of an image whose global intensity histogram\ndoesn't contain distinctive peaks.</p>\n<p>The format of the MagickAdaptiveThresholdImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickAdaptiveThresholdImage( MagickWand *wand, const unsigned long width,\n                                           const unsigned long height, const long offset );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>width:</dt>\n<dd>The width of the local neighborhood.</dd>\n<dt>height:</dt>\n<dd>The height of the local neighborhood.</dd>\n<dt>offset:</dt>\n<dd>The mean offset.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickaddimage\">\n<h1><a class=\"toc-backref\" href=\"#id476\">MagickAddImage</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickAddImage( MagickWand *wand, const MagickWand *add_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>MagickAddImage() adds the specified images at the current image location.</p>\n<p>The format of the MagickAddImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickAddImage( MagickWand *wand, const MagickWand *add_wand );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>insert:</dt>\n<dd>The splice wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickaddnoiseimage\">\n<h1><a class=\"toc-backref\" href=\"#id477\">MagickAddNoiseImage</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickAddNoiseImage( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#noisetype\">NoiseType</a> noise_type );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>MagickAddNoiseImage() adds random noise to the image.</p>\n<p>The format of the MagickAddNoiseImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickAddNoiseImage( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#noisetype\">NoiseType</a> noise_type );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>noise_type:</dt>\n<dd>The type of noise: Uniform, Gaussian, Multiplicative,\nImpulse, Laplacian, Poisson, or Random.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickaffinetransformimage\">\n<h1><a class=\"toc-backref\" href=\"#id478\">MagickAffineTransformImage</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickAffineTransformImage( MagickWand *wand, const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>MagickAffineTransformImage() transforms an image as dictated by the affine\nmatrix of the drawing wand.</p>\n<p>The format of the MagickAffineTransformImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickAffineTransformImage( MagickWand *wand, const DrawingWand *drawing_wand );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>drawing_wand:</dt>\n<dd>The draw wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickannotateimage\">\n<h1><a class=\"toc-backref\" href=\"#id479\">MagickAnnotateImage</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickAnnotateImage( MagickWand *wand, const DrawingWand *drawing_wand,\n                                  const double x, const double y, const double angle,\n                                  const char *text );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>MagickAnnotateImage() annotates an image with text.</p>\n<p>The format of the MagickAnnotateImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickAnnotateImage( MagickWand *wand, const DrawingWand *drawing_wand,\n                                  const double x, const double y, const double angle,\n                                  const char *text );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>drawing_wand:</dt>\n<dd>The draw wand.</dd>\n<dt>x:</dt>\n<dd>x ordinate to left of text</dd>\n<dt>y:</dt>\n<dd>y ordinate to text baseline</dd>\n<dt>angle:</dt>\n<dd>rotate text relative to this angle.</dd>\n<dt>text:</dt>\n<dd>text to draw</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickanimateimages\">\n<h1><a class=\"toc-backref\" href=\"#id480\">MagickAnimateImages</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickAnimateImages( MagickWand *wand, const char *server_name );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>MagickAnimateImages() animates an image or image sequence.</p>\n<p>The format of the MagickAnimateImages method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickAnimateImages( MagickWand *wand, const char *server_name );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>server_name:</dt>\n<dd>The X server name.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickappendimages\">\n<h1><a class=\"toc-backref\" href=\"#id481\">MagickAppendImages</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickAppendImages( MagickWand *wand, const unsigned int stack );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>MagickAppendImages() append a set of images.</p>\n<p>The format of the MagickAppendImages method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickAppendImages( MagickWand *wand, const unsigned int stack );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>stack:</dt>\n<dd>By default, images are stacked left-to-right. Set stack to True\nto stack them top-to-bottom.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickautoorientimage\">\n<h1><a class=\"toc-backref\" href=\"#id482\">MagickAutoOrientImage</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickAutoOrientImage( MagickWand *wand,\n                                    const OrientationType current_orientation,\n                                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>MagickAutoOrientImage() adjusts the current image so that its orientation\nis suitable for viewing (i.e. top-left orientation).</p>\n<p>The format of the MagickAutoOrientImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickAutoOrientImage( MagickWand *wand,\n                                    const OrientationType current_orientation,\n                                    <a class=\"reference external\" href=\"../api/types.html#exceptioninfo\">ExceptionInfo</a> *exception );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>current_orientation:</dt>\n<dd>Current image orientation. May be one of:\nTopLeftOrientation      Left to right and Top to bottom\nTopRightOrientation     Right to left  and Top to bottom\nBottomRightOrientation  Right to left and Bottom to top\nBottomLeftOrientation   Left to right and Bottom to top\nLeftTopOrientation      Top to bottom and Left to right\nRightTopOrientation     Top to bottom and Right to left\nRightBottomOrientation  Bottom to top and Right to left\nLeftBottomOrientation   Bottom to top and Left to right\nUndefinedOrientation    Current orientation is not known.\nUse orientation defined by the\ncurrent image if any. Equivalent\nto MagickGetImageOrientation().</dd>\n</dl>\n<p>Returns True on success, False otherwise.</p>\n<p>Note that after successful auto-orientation the internal orientation will\nbe set to TopLeftOrientation. However this internal value is only written\nto TIFF files. For JPEG files, there is currently no support for resetting\nthe EXIF orientation tag to TopLeft so the JPEG should be stripped or EXIF\nprofile removed if present to prevent saved auto-oriented images from being\nincorrectly rotated a second time by follow-on viewers that understand the\nEXIF orientation tag.</p>\n</div>\n</div>\n<div class=\"section\" id=\"magickaverageimages\">\n<h1><a class=\"toc-backref\" href=\"#id483\">MagickAverageImages</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickAverageImages( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>MagickAverageImages() average a set of images.</p>\n<p>The format of the MagickAverageImages method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickAverageImages( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickblackthresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id484\">MagickBlackThresholdImage</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickBlackThresholdImage( MagickWand *wand, const PixelWand *threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>MagickBlackThresholdImage() is like MagickThresholdImage() but  forces all\npixels below the threshold into black while leaving all pixels above the\nthreshold unchanged.</p>\n<p>The format of the MagickBlackThresholdImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickBlackThresholdImage( MagickWand *wand, const PixelWand *threshold );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>threshold:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickblurimage\">\n<h1><a class=\"toc-backref\" href=\"#id485\">MagickBlurImage</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickBlurImage( MagickWand *wand, const double radius, const double sigma );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>MagickBlurImage() blurs an image.  We convolve the image with a Gaussian\noperator of the given radius and standard deviation (sigma).\nFor reasonable results, the radius should be larger than sigma.  Use a\nradius of 0 and BlurImage() selects a suitable radius for you.</p>\n<p>The format of the MagickBlurImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickBlurImage( MagickWand *wand, const double radius, const double sigma );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickborderimage\">\n<h1><a class=\"toc-backref\" href=\"#id486\">MagickBorderImage</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickBorderImage( MagickWand *wand, const PixelWand *bordercolor,\n                                const unsigned long width, const unsigned long height );\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>MagickBorderImage() surrounds the image with a border of the color defined\nby the bordercolor pixel wand.</p>\n<p>The format of the MagickBorderImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickBorderImage( MagickWand *wand, const PixelWand *bordercolor,\n                                const unsigned long width, const unsigned long height );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>bordercolor:</dt>\n<dd>The border color pixel wand.</dd>\n<dt>width:</dt>\n<dd>The border width.</dd>\n<dt>height:</dt>\n<dd>The border height.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcdlimage\">\n<h1><a class=\"toc-backref\" href=\"#id487\">MagickCdlImage</a></h1>\n<div class=\"section\" id=\"id27\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail MagickCdlImage( MagickWand *wand, const char *cdl );\n</pre>\n</div>\n<div class=\"section\" id=\"id28\">\n<h2>Description</h2>\n<p>The MagickCdlImage() method applies (&quot;bakes in&quot;) the ASC-CDL which is a\nformat for the exchange of basic primary color grading information between\nequipment and software from different manufacturers. The format defines\nthe math for three functions: slope, offset and power. Each function uses\na number for the red, green, and blue color channels for a total of nine\nnumbers comprising a single color decision. A tenth number for chrominance\n(saturation) has been proposed but is not yet standardized.</p>\n<p>The cdl argument string is comma delimited and is in the form (but\nwithout invervening spaces or line breaks):</p>\n<p>redslope, redoffset, redpower :\ngreenslope, greenoffset, greenpower :\nblueslope, blueoffset, bluepower :\nsaturation</p>\n<p>with the unity (no change) specification being:</p>\n<p>&quot;1.0,0.0,1.0:1.0,0.0,1.0:1.0,0.0,1.0:0.0&quot;</p>\n<p>See <a class=\"reference external\" href=\"http://en.wikipedia.org/wiki/ASC_CDL\">http://en.wikipedia.org/wiki/ASC_CDL</a> for more information.</p>\n<p>The format of the MagickCdlImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail MagickCdlImage( MagickWand *wand, const char *cdl );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The image wand.</dd>\n<dt>cdl:</dt>\n<dd>Define the coefficients for slope offset and power in the\nred green and blue channels, plus saturation.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcharcoalimage\">\n<h1><a class=\"toc-backref\" href=\"#id488\">MagickCharcoalImage</a></h1>\n<div class=\"section\" id=\"id29\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickCharcoalImage( MagickWand *wand, const double radius, const double sigma );\n</pre>\n</div>\n<div class=\"section\" id=\"id30\">\n<h2>Description</h2>\n<p>MagickCharcoalImage() simulates a charcoal drawing.</p>\n<p>The format of the MagickCharcoalImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickCharcoalImage( MagickWand *wand, const double radius, const double sigma );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickchopimage\">\n<h1><a class=\"toc-backref\" href=\"#id489\">MagickChopImage</a></h1>\n<div class=\"section\" id=\"id31\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickChopImage( MagickWand *wand, const unsigned long width,\n                              const unsigned long height, const long x, const long y );\n</pre>\n</div>\n<div class=\"section\" id=\"id32\">\n<h2>Description</h2>\n<p>MagickChopImage() removes a region of an image and collapses the image to\noccupy the removed portion</p>\n<p>The format of the MagickChopImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickChopImage( MagickWand *wand, const unsigned long width,\n                              const unsigned long height, const long x, const long y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>width:</dt>\n<dd>The region width.</dd>\n<dt>height:</dt>\n<dd>The region height.</dd>\n<dt>x:</dt>\n<dd>The region x offset.</dd>\n<dt>y:</dt>\n<dd>The region y offset.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickclearexception\">\n<h1><a class=\"toc-backref\" href=\"#id490\">MagickClearException</a></h1>\n<div class=\"section\" id=\"id33\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickClearException( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id34\">\n<h2>Description</h2>\n<p>MagickClearException() clears the last wand exception.</p>\n<p>The format of the MagickClearException method is:</p>\n<pre class=\"literal-block\">\nvoid MagickClearException( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickclipimage\">\n<h1><a class=\"toc-backref\" href=\"#id491\">MagickClipImage</a></h1>\n<div class=\"section\" id=\"id35\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickClipImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id36\">\n<h2>Description</h2>\n<p>MagickClipImage() clips along the first path from the 8BIM profile, if\npresent.</p>\n<p>The format of the MagickClipImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickClipImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickclippathimage\">\n<h1><a class=\"toc-backref\" href=\"#id492\">MagickClipPathImage</a></h1>\n<div class=\"section\" id=\"id37\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickClipPathImage( MagickWand *wand, const char *pathname,\n                                  const unsigned int inside );\n</pre>\n</div>\n<div class=\"section\" id=\"id38\">\n<h2>Description</h2>\n<p>MagickClipPathImage() clips along the named paths from the 8BIM profile, if\npresent. Later operations take effect inside the path.  Id may be a number\nif preceded with #, to work on a numbered path, e.g., &quot;#1&quot; to use the first\npath.</p>\n<p>The format of the MagickClipPathImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickClipPathImage( MagickWand *wand, const char *pathname,\n                                  const unsigned int inside );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>pathname:</dt>\n<dd>name of clipping path resource. If name is preceded by #, use\nclipping path numbered by name.</dd>\n<dt>inside:</dt>\n<dd>if non-zero, later operations take effect inside clipping path.\nOtherwise later operations take effect outside clipping path.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcoalesceimages\">\n<h1><a class=\"toc-backref\" href=\"#id493\">MagickCoalesceImages</a></h1>\n<div class=\"section\" id=\"id39\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickCoalesceImages( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id40\">\n<h2>Description</h2>\n<p>MagickCoalesceImages() composites a set of images while respecting any page\noffsets and disposal methods.  GIF, MIFF, and MNG animation sequences\ntypically start with an image background and each subsequent image\nvaries in size and offset.  MagickCoalesceImages() returns a new sequence\nwhere each image in the sequence is the same size as the first and\ncomposited with the next image in the sequence.</p>\n<p>The format of the MagickCoalesceImages method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickCoalesceImages( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcolorfloodfillimage\">\n<h1><a class=\"toc-backref\" href=\"#id494\">MagickColorFloodfillImage</a></h1>\n<div class=\"section\" id=\"id41\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickColorFloodfillImage( MagickWand *wand, const PixelWand *fill,\n                                        const double fuzz, const PixelWand *bordercolor,\n                                        const long x, const long y );\n</pre>\n</div>\n<div class=\"section\" id=\"id42\">\n<h2>Description</h2>\n<p>MagickColorFloodfillImage() changes the color value of any pixel that matches\ntarget and is an immediate neighbor.  If the method FillToBorderMethod is\nspecified, the color value is changed for any neighbor pixel that does not\nmatch the bordercolor member of image.</p>\n<p>The format of the MagickColorFloodfillImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickColorFloodfillImage( MagickWand *wand, const PixelWand *fill,\n                                        const double fuzz, const PixelWand *bordercolor,\n                                        const long x, const long y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>fill:</dt>\n<dd>The floodfill color pixel wand.</dd>\n<dt>fuzz:</dt>\n<dd>By default target must match a particular pixel color\nexactly.  However, in many cases two colors may differ by a small amount.\nThe fuzz member of image defines how much tolerance is acceptable to\nconsider two colors as the same.  For example, set fuzz to 10 and the\ncolor red at intensities of 100 and 102 respectively are now interpreted\nas the same color for the purposes of the floodfill.</dd>\n<dt>bordercolor:</dt>\n<dd>The border color pixel wand.</dd>\n<dt>x,y:</dt>\n<dd>The starting location of the operation.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcolorizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id495\">MagickColorizeImage</a></h1>\n<div class=\"section\" id=\"id43\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickColorizeImage( MagickWand *wand, const PixelWand *colorize,\n                                  const PixelWand *opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id44\">\n<h2>Description</h2>\n<p>MagickColorizeImage() blends the fill color with each pixel in the image.</p>\n<p>The format of the MagickColorizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickColorizeImage( MagickWand *wand, const PixelWand *colorize,\n                                  const PixelWand *opacity );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>colorize:</dt>\n<dd>The colorize pixel wand.</dd>\n<dt>opacity:</dt>\n<dd>The opacity pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcommentimage\">\n<h1><a class=\"toc-backref\" href=\"#id496\">MagickCommentImage</a></h1>\n<div class=\"section\" id=\"id45\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickCommentImage( MagickWand *wand, const char *comment );\n</pre>\n</div>\n<div class=\"section\" id=\"id46\">\n<h2>Description</h2>\n<p>MagickCommentImage() adds a comment to your image.</p>\n<p>The format of the MagickCommentImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickCommentImage( MagickWand *wand, const char *comment );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>comment:</dt>\n<dd>The image comment.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcompareimagechannels\">\n<h1><a class=\"toc-backref\" href=\"#id497\">MagickCompareImageChannels</a></h1>\n<div class=\"section\" id=\"id47\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickCompareImageChannels( MagickWand *wand, const MagickWand *reference,\n                                        const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel, const MetricType metric,\n                                        double *distortion );\n</pre>\n</div>\n<div class=\"section\" id=\"id48\">\n<h2>Description</h2>\n<p>MagickCompareImageChannels() compares one or more image channels and\nreturns the specified distortion metric.</p>\n<p>The format of the MagickCompareImageChannels method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickCompareImageChannels( MagickWand *wand, const MagickWand *reference,\n                                        const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel, const MetricType metric,\n                                        double *distortion );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>reference:</dt>\n<dd>The reference wand.</dd>\n<dt>channel:</dt>\n<dd>The channel.</dd>\n<dt>metric:</dt>\n<dd>The metric.</dd>\n<dt>distortion:</dt>\n<dd>The computed distortion between the images.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcompareimages\">\n<h1><a class=\"toc-backref\" href=\"#id498\">MagickCompareImages</a></h1>\n<div class=\"section\" id=\"id49\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickCompareImages( MagickWand *wand, const MagickWand *reference,\n                                 const MetricType metric, double *distortion );\n</pre>\n</div>\n<div class=\"section\" id=\"id50\">\n<h2>Description</h2>\n<p>MagickCompareImage() compares one or more images and returns the specified\ndistortion metric.</p>\n<p>The format of the MagickCompareImages method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickCompareImages( MagickWand *wand, const MagickWand *reference,\n                                 const MetricType metric, double *distortion );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>reference:</dt>\n<dd>The reference wand.</dd>\n<dt>metric:</dt>\n<dd>The metric.</dd>\n<dt>distortion:</dt>\n<dd>The computed distortion between the images.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcompositeimage\">\n<h1><a class=\"toc-backref\" href=\"#id499\">MagickCompositeImage</a></h1>\n<div class=\"section\" id=\"id51\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickCompositeImage( MagickWand *wand, const MagickWand *composite_wand,\n                                   const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> compose, const long x,\n                                   const long y );\n</pre>\n</div>\n<div class=\"section\" id=\"id52\">\n<h2>Description</h2>\n<p>MagickCompositeImage() composite one image onto another at the specified\noffset.</p>\n<p>The format of the MagickCompositeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickCompositeImage( MagickWand *wand, const MagickWand *composite_wand,\n                                   const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> compose, const long x,\n                                   const long y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>composite_image:</dt>\n<dd>The composite image.</dd>\n<dt>compose:</dt>\n<dd>This operator affects how the composite is applied to the\nimage.  The default is Over.  Choose from these operators:</dd>\n</dl>\n<p>OverCompositeOp       InCompositeOp         OutCompositeOP\nAtopCompositeOP       XorCompositeOP        PlusCompositeOP\nMinusCompositeOP      AddCompositeOP        SubtractCompositeOP\nDifferenceCompositeOP BumpmapCompositeOP    CopyCompositeOP\nDisplaceCompositeOP</p>\n<dl class=\"docutils\">\n<dt>x_offset:</dt>\n<dd>The column offset of the composited image.</dd>\n<dt>y_offset:</dt>\n<dd>The row offset of the composited image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcontrastimage\">\n<h1><a class=\"toc-backref\" href=\"#id500\">MagickContrastImage</a></h1>\n<div class=\"section\" id=\"id53\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickContrastImage( MagickWand *wand, const unsigned int sharpen );\n</pre>\n</div>\n<div class=\"section\" id=\"id54\">\n<h2>Description</h2>\n<p>MagickContrastImage() enhances the intensity differences between the lighter\nand darker elements of the image.  Set sharpen to a value other than 0 to\nincrease the image contrast otherwise the contrast is reduced.</p>\n<p>The format of the MagickContrastImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickContrastImage( MagickWand *wand, const unsigned int sharpen );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>sharpen:</dt>\n<dd>Increase or decrease image contrast.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickconvolveimage\">\n<h1><a class=\"toc-backref\" href=\"#id501\">MagickConvolveImage</a></h1>\n<div class=\"section\" id=\"id55\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickConvolveImage( MagickWand *wand, const unsigned long order,\n                                  const double *kernel );\n</pre>\n</div>\n<div class=\"section\" id=\"id56\">\n<h2>Description</h2>\n<p>MagickConvolveImage() applies a custom convolution kernel to the image.</p>\n<p>The format of the MagickConvolveImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickConvolveImage( MagickWand *wand, const unsigned long order,\n                                  const double *kernel );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>order:</dt>\n<dd>The number of columns and rows in the filter kernel.</dd>\n<dt>kernel:</dt>\n<dd>An array of doubles representing the convolution kernel.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcropimage\">\n<h1><a class=\"toc-backref\" href=\"#id502\">MagickCropImage</a></h1>\n<div class=\"section\" id=\"id57\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickCropImage( MagickWand *wand, const unsigned long width,\n                              const unsigned long height, const long x, const long y );\n</pre>\n</div>\n<div class=\"section\" id=\"id58\">\n<h2>Description</h2>\n<p>MagickCropImage() extracts a region of the image.</p>\n<p>The format of the MagickCropImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickCropImage( MagickWand *wand, const unsigned long width,\n                              const unsigned long height, const long x, const long y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>width:</dt>\n<dd>The region width.</dd>\n<dt>height:</dt>\n<dd>The region height.</dd>\n<dt>x:</dt>\n<dd>The region x offset.</dd>\n<dt>y:</dt>\n<dd>The region y offset.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickcyclecolormapimage\">\n<h1><a class=\"toc-backref\" href=\"#id503\">MagickCycleColormapImage</a></h1>\n<div class=\"section\" id=\"id59\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickCycleColormapImage( MagickWand *wand, const long displace );\n</pre>\n</div>\n<div class=\"section\" id=\"id60\">\n<h2>Description</h2>\n<p>MagickCycleColormapImage() displaces an image's colormap by a given number\nof positions.  If you cycle the colormap a number of times you can produce\na psychodelic effect.</p>\n<p>The format of the MagickCycleColormapImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickCycleColormapImage( MagickWand *wand, const long displace );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>pixel_wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickdeconstructimages\">\n<h1><a class=\"toc-backref\" href=\"#id504\">MagickDeconstructImages</a></h1>\n<div class=\"section\" id=\"id61\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickDeconstructImages( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id62\">\n<h2>Description</h2>\n<p>MagickDeconstructImages() compares each image with the next in a sequence\nand returns the maximum bounding region of any pixel differences it\ndiscovers.</p>\n<p>The format of the MagickDeconstructImages method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickDeconstructImages( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickdescribeimage\">\n<h1><a class=\"toc-backref\" href=\"#id505\">MagickDescribeImage</a></h1>\n<div class=\"section\" id=\"id63\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *MagickDescribeImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id64\">\n<h2>Description</h2>\n<p>MagickDescribeImage()  describes an image by formatting its attributes\nto an allocated string which must be freed by the user.  Attributes\ninclude the image width, height, size, and others.  The string is\nsimilar to the output of 'identify -verbose'.</p>\n<p>The format of the MagickDescribeImage method is:</p>\n<pre class=\"literal-block\">\nconst char *MagickDescribeImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickdespeckleimage\">\n<h1><a class=\"toc-backref\" href=\"#id506\">MagickDespeckleImage</a></h1>\n<div class=\"section\" id=\"id65\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickDespeckleImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id66\">\n<h2>Description</h2>\n<p>MagickDespeckleImage() reduces the speckle noise in an image while\nperserving the edges of the original image.</p>\n<p>The format of the MagickDespeckleImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickDespeckleImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickdisplayimage\">\n<h1><a class=\"toc-backref\" href=\"#id507\">MagickDisplayImage</a></h1>\n<div class=\"section\" id=\"id67\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickDisplayImage( MagickWand *wand, const char *server_name );\n</pre>\n</div>\n<div class=\"section\" id=\"id68\">\n<h2>Description</h2>\n<p>MagickDisplayImage() displays an image.</p>\n<p>The format of the MagickDisplayImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickDisplayImage( MagickWand *wand, const char *server_name );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>server_name:</dt>\n<dd>The X server name.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickdisplayimages\">\n<h1><a class=\"toc-backref\" href=\"#id508\">MagickDisplayImages</a></h1>\n<div class=\"section\" id=\"id69\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickDisplayImages( MagickWand *wand, const char *server_name );\n</pre>\n</div>\n<div class=\"section\" id=\"id70\">\n<h2>Description</h2>\n<p>MagickDisplayImages() displays an image or image sequence.</p>\n<p>The format of the MagickDisplayImages method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickDisplayImages( MagickWand *wand, const char *server_name );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>server_name:</dt>\n<dd>The X server name.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickdrawimage\">\n<h1><a class=\"toc-backref\" href=\"#id509\">MagickDrawImage</a></h1>\n<div class=\"section\" id=\"id71\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickDrawImage( MagickWand *wand, const DrawingWand *drawing_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id72\">\n<h2>Description</h2>\n<p>MagickDrawImage() draws vectors on the image as described by DrawingWand.</p>\n<p>The format of the MagickDrawImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickDrawImage( MagickWand *wand, const DrawingWand *drawing_wand );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>drawing_wand:</dt>\n<dd>The draw wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickedgeimage\">\n<h1><a class=\"toc-backref\" href=\"#id510\">MagickEdgeImage</a></h1>\n<div class=\"section\" id=\"id73\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickEdgeImage( MagickWand *wand, const double radius );\n</pre>\n</div>\n<div class=\"section\" id=\"id74\">\n<h2>Description</h2>\n<p>MagickEdgeImage() enhance edges within the image with a convolution filter\nof the given radius.  Use a radius of 0 and Edge() selects a suitable\nradius for you.</p>\n<p>The format of the MagickEdgeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickEdgeImage( MagickWand *wand, const double radius );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>the radius of the pixel neighborhood.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickembossimage\">\n<h1><a class=\"toc-backref\" href=\"#id511\">MagickEmbossImage</a></h1>\n<div class=\"section\" id=\"id75\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickEmbossImage( MagickWand *wand, const double radius, const double sigma );\n</pre>\n</div>\n<div class=\"section\" id=\"id76\">\n<h2>Description</h2>\n<p>MagickEmbossImage() returns a grayscale image with a three-dimensional\neffect.  We convolve the image with a Gaussian operator of the given radius\nand standard deviation (sigma).  For reasonable results, radius should be\nlarger than sigma.  Use a radius of 0 and Emboss() selects a suitable\nradius for you.</p>\n<p>The format of the MagickEmbossImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickEmbossImage( MagickWand *wand, const double radius, const double sigma );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickenhanceimage\">\n<h1><a class=\"toc-backref\" href=\"#id512\">MagickEnhanceImage</a></h1>\n<div class=\"section\" id=\"id77\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickEnhanceImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id78\">\n<h2>Description</h2>\n<p>MagickEnhanceImage() applies a digital filter that improves the quality of a\nnoisy image.</p>\n<p>The format of the MagickEnhanceImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickEnhanceImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickequalizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id513\">MagickEqualizeImage</a></h1>\n<div class=\"section\" id=\"id79\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickEqualizeImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id80\">\n<h2>Description</h2>\n<p>MagickEqualizeImage() equalizes the image histogram.</p>\n<p>The format of the MagickEqualizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickEqualizeImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickextentimage\">\n<h1><a class=\"toc-backref\" href=\"#id514\">MagickExtentImage</a></h1>\n<div class=\"section\" id=\"id81\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickExtentImage( MagickWand *wand, const size_t width, const size_t height,\n                                const ssize_t x, const ssize_t y );\n</pre>\n</div>\n<div class=\"section\" id=\"id82\">\n<h2>Description</h2>\n<p>Use MagickExtentImage() to change the image dimensions as specified by\ngeometry width and height.  The existing image content is composited at\nthe position specified by geometry x and y using the image compose method.\nExisting image content which falls outside the bounds of the new image\ndimensions is discarded.</p>\n<p>The format of the MagickExtentImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickExtentImage( MagickWand *wand, const size_t width, const size_t height,\n                                const ssize_t x, const ssize_t y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>width:</dt>\n<dd>New image width</dd>\n<dt>height:</dt>\n<dd>New image height</dd>\n<dt>x, y:</dt>\n<dd>Top left composition coordinate to place existing image content\non the new image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickflattenimages\">\n<h1><a class=\"toc-backref\" href=\"#id515\">MagickFlattenImages</a></h1>\n<div class=\"section\" id=\"id83\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickFlattenImages( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id84\">\n<h2>Description</h2>\n<p>MagickFlattenImages() merges a sequence of images.  This is useful for\ncombining Photoshop layers into a single image.</p>\n<p>The format of the MagickFlattenImages method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickFlattenImages( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickflipimage\">\n<h1><a class=\"toc-backref\" href=\"#id516\">MagickFlipImage</a></h1>\n<div class=\"section\" id=\"id85\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickFlipImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id86\">\n<h2>Description</h2>\n<p>MagickFlipImage() creates a vertical mirror image by reflecting the pixels\naround the central x-axis.</p>\n<p>The format of the MagickFlipImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickFlipImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickflopimage\">\n<h1><a class=\"toc-backref\" href=\"#id517\">MagickFlopImage</a></h1>\n<div class=\"section\" id=\"id87\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickFlopImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id88\">\n<h2>Description</h2>\n<p>MagickFlopImage() creates a horizontal mirror image by reflecting the pixels\naround the central y-axis.</p>\n<p>The format of the MagickFlopImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickFlopImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickframeimage\">\n<h1><a class=\"toc-backref\" href=\"#id518\">MagickFrameImage</a></h1>\n<div class=\"section\" id=\"id89\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickFrameImage( MagickWand *wand, const PixelWand *matte_color,\n                               const unsigned long width, const unsigned long height,\n                               const long inner_bevel, const long outer_bevel );\n</pre>\n</div>\n<div class=\"section\" id=\"id90\">\n<h2>Description</h2>\n<p>MagickFrameImage() adds a simulated three-dimensional border around the\nimage.  The width and height specify the border width of the vertical and\nhorizontal sides of the frame.  The inner and outer bevels indicate the\nwidth of the inner and outer shadows of the frame.</p>\n<p>The format of the MagickFrameImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickFrameImage( MagickWand *wand, const PixelWand *matte_color,\n                               const unsigned long width, const unsigned long height,\n                               const long inner_bevel, const long outer_bevel );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>matte_color:</dt>\n<dd>The frame color pixel wand.</dd>\n<dt>width:</dt>\n<dd>The border width.</dd>\n<dt>height:</dt>\n<dd>The border height.</dd>\n<dt>inner_bevel:</dt>\n<dd>The inner bevel width.</dd>\n<dt>outer_bevel:</dt>\n<dd>The outer bevel width.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickfximage\">\n<h1><a class=\"toc-backref\" href=\"#id519\">MagickFxImage</a></h1>\n<div class=\"section\" id=\"id91\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickFxImage( MagickWand *wand, const char *expression );\n</pre>\n</div>\n<div class=\"section\" id=\"id92\">\n<h2>Description</h2>\n<p>MagickFxImage() evaluate expression for each pixel in the image.</p>\n<p>The format of the MagickFxImage method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickFxImage( MagickWand *wand, const char *expression );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>expression:</dt>\n<dd>The expression.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickfximagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id520\">MagickFxImageChannel</a></h1>\n<div class=\"section\" id=\"id93\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickFxImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                  const char *expression );\n</pre>\n</div>\n<div class=\"section\" id=\"id94\">\n<h2>Description</h2>\n<p>MagickFxImageChannel() evaluate expression for each pixel in the specified\nchannel.</p>\n<p>The format of the MagickFxImageChannel method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickFxImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                  const char *expression );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to level: RedChannel, GreenChannel,\nBlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel,\nBlackChannel.</dd>\n<dt>expression:</dt>\n<dd>The expression.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgammaimage\">\n<h1><a class=\"toc-backref\" href=\"#id521\">MagickGammaImage</a></h1>\n<div class=\"section\" id=\"id95\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGammaImage( MagickWand *wand, const double gamma );\n</pre>\n</div>\n<div class=\"section\" id=\"id96\">\n<h2>Description</h2>\n<p>Use MagickGammaImage() to gamma-correct an image.  The same image viewed on\ndifferent devices will have perceptual differences in the way the\nimage's intensities are represented on the screen.  Specify individual\ngamma levels for the red, green, and blue channels, or adjust all three\nwith the gamma parameter.  Values typically range from 0.8 to 2.3.</p>\n<p>You can also reduce the influence of a particular channel with a gamma\nvalue of 0.</p>\n<p>The format of the MagickGammaImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGammaImage( MagickWand *wand, const double gamma );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>gamme:</dt>\n<dd>Define the level of gamma correction.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgammaimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id522\">MagickGammaImageChannel</a></h1>\n<div class=\"section\" id=\"id97\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGammaImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                      const double gamma );\n</pre>\n</div>\n<div class=\"section\" id=\"id98\">\n<h2>Description</h2>\n<p>Use MagickGammaImageChannel() to gamma-correct a particular image channel.\nThe same image viewed on different devices will have perceptual differences\nin the way the image's intensities are represented on the screen.  Specify\nindividual gamma levels for the red, green, and blue channels, or adjust all\nthree with the gamma parameter.  Values typically range from 0.8 to 2.3.</p>\n<p>You can also reduce the influence of a particular channel with a gamma\nvalue of 0.</p>\n<p>The format of the MagickGammaImageChannel method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGammaImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                      const double gamma );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>The channel.</dd>\n<dt>level:</dt>\n<dd>Define the level of gamma correction.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetconfigureinfo\">\n<h1><a class=\"toc-backref\" href=\"#id523\">MagickGetConfigureInfo</a></h1>\n<div class=\"section\" id=\"id99\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *MagickGetConfigureInfo( MagickWand *wand, const char *name );\n</pre>\n</div>\n<div class=\"section\" id=\"id100\">\n<h2>Description</h2>\n<p>MagickGetConfigureInfo() returns ImageMagick configure attributes such as\nNAME, VERSION, LIB_VERSION, COPYRIGHT, etc.</p>\n<p>The format of the MagickGetConfigureInfo() method is:</p>\n<pre class=\"literal-block\">\nchar *MagickGetConfigureInfo( MagickWand *wand, const char *name );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>name:</dt>\n<dd>Return the attribute associated with this name.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetcopyright\">\n<h1><a class=\"toc-backref\" href=\"#id524\">MagickGetCopyright</a></h1>\n<div class=\"section\" id=\"id101\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *MagickGetCopyright( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id102\">\n<h2>Description</h2>\n<p>MagickGetCopyright() returns the ImageMagick API copyright as a string.</p>\n<p>The format of the MagickGetCopyright method is:</p>\n<pre class=\"literal-block\">\nconst char *MagickGetCopyright( void );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetexception\">\n<h1><a class=\"toc-backref\" href=\"#id525\">MagickGetException</a></h1>\n<div class=\"section\" id=\"id103\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *MagickGetException( const MagickWand *wand, <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> *severity );\n</pre>\n</div>\n<div class=\"section\" id=\"id104\">\n<h2>Description</h2>\n<p>MagickGetException() returns the severity, reason, and description of any\nerror that occurs when using other methods in this API.</p>\n<p>The format of the MagickGetException method is:</p>\n<pre class=\"literal-block\">\nchar *MagickGetException( const MagickWand *wand, <a class=\"reference external\" href=\"../api/types.html#exceptiontype\">ExceptionType</a> *severity );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>severity:</dt>\n<dd>The severity of the error is returned here.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetfilename\">\n<h1><a class=\"toc-backref\" href=\"#id526\">MagickGetFilename</a></h1>\n<div class=\"section\" id=\"id105\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *MagickGetFilename( const MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id106\">\n<h2>Description</h2>\n<p>MagickGetFilename() returns the filename associated with an image sequence.</p>\n<p>The format of the MagickGetFilename method is:</p>\n<pre class=\"literal-block\">\nconst char *MagickGetFilename( const MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgethomeurl\">\n<h1><a class=\"toc-backref\" href=\"#id527\">MagickGetHomeURL</a></h1>\n<div class=\"section\" id=\"id107\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *MagickGetHomeURL( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id108\">\n<h2>Description</h2>\n<p>MagickGetHomeURL() returns the ImageMagick home URL.</p>\n<p>The format of the MagickGetHomeURL method is:</p>\n<pre class=\"literal-block\">\nconst char *MagickGetHomeURL( void );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimage\">\n<h1><a class=\"toc-backref\" href=\"#id528\">MagickGetImage</a></h1>\n<div class=\"section\" id=\"id109\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickGetImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id110\">\n<h2>Description</h2>\n<p>MagickGetImage() clones the image at the current image index.</p>\n<p>The format of the MagickGetImage method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickGetImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageattribute\">\n<h1><a class=\"toc-backref\" href=\"#id529\">MagickGetImageAttribute</a></h1>\n<div class=\"section\" id=\"id111\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *MagickGetImageAttribute( MagickWand *wand, const char *name );\n</pre>\n</div>\n<div class=\"section\" id=\"id112\">\n<h2>Description</h2>\n<p>MagickGetImageAttribute returns an image attribute as a string</p>\n<p>The format of the MagickGetImageAttribute method is:</p>\n<pre class=\"literal-block\">\nchar *MagickGetImageAttribute( MagickWand *wand, const char *name );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>name:</dt>\n<dd>The name of the attribute</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagebackgroundcolor\">\n<h1><a class=\"toc-backref\" href=\"#id530\">MagickGetImageBackgroundColor</a></h1>\n<div class=\"section\" id=\"id113\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageBackgroundColor( MagickWand *wand, PixelWand *background_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id114\">\n<h2>Description</h2>\n<p>MagickGetImageBackgroundColor() returns the image background color.</p>\n<p>The format of the MagickGetImageBackgroundColor method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageBackgroundColor( MagickWand *wand, PixelWand *background_color );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>background_color:</dt>\n<dd>Return the background color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageblueprimary\">\n<h1><a class=\"toc-backref\" href=\"#id531\">MagickGetImageBluePrimary</a></h1>\n<div class=\"section\" id=\"id115\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageBluePrimary( MagickWand *wand, double *x, double *y );\n</pre>\n</div>\n<div class=\"section\" id=\"id116\">\n<h2>Description</h2>\n<p>MagickGetImageBluePrimary() returns the chromaticy blue primary point for the\nimage.</p>\n<p>The format of the MagickGetImageBluePrimary method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageBluePrimary( MagickWand *wand, double *x, double *y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x:</dt>\n<dd>The chromaticity blue primary x-point.</dd>\n<dt>y:</dt>\n<dd>The chromaticity blue primary y-point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagebordercolor\">\n<h1><a class=\"toc-backref\" href=\"#id532\">MagickGetImageBorderColor</a></h1>\n<div class=\"section\" id=\"id117\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageBorderColor( MagickWand *wand, PixelWand *border_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id118\">\n<h2>Description</h2>\n<p>MagickGetImageBorderColor() returns the image border color.</p>\n<p>The format of the MagickGetImageBorderColor method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageBorderColor( MagickWand *wand, PixelWand *border_color );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>border_color:</dt>\n<dd>Return the border color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageboundingbox\">\n<h1><a class=\"toc-backref\" href=\"#id533\">MagickGetImageBoundingBox</a></h1>\n<div class=\"section\" id=\"id119\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageBoundingBox( MagickWand *wand, const double fuzz,\n                                        unsigned long *width, unsigned long *height,\n                                        long *x, long *y );\n</pre>\n</div>\n<div class=\"section\" id=\"id120\">\n<h2>Description</h2>\n<p>MagickGetImageBoundingBox() obtains the crop bounding box required to\nremove a solid-color border from the image.  Color quantums which differ\nless than the fuzz setting are considered to be the same.  If a border is\nnot detected, then the the original image dimensions are returned.  The\ncrop bounding box estimation uses the same algorithm as MagickTrimImage().</p>\n<p>The format of the MagickGetImageBoundingBox method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageBoundingBox( MagickWand *wand, const double fuzz,\n                                        unsigned long *width, unsigned long *height,\n                                        long *x, long *y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>fuzz:</dt>\n<dd>Color comparison fuzz factor.  Use 0.0 for exact match.</dd>\n<dt>width:</dt>\n<dd>The crop width</dd>\n<dt>height:</dt>\n<dd>The crop height</dd>\n<dt>x:</dt>\n<dd>The crop x offset</dd>\n<dt>y:</dt>\n<dd>The crop y offset</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagechanneldepth\">\n<h1><a class=\"toc-backref\" href=\"#id534\">MagickGetImageChannelDepth</a></h1>\n<div class=\"section\" id=\"id121\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageChannelDepth( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel );\n</pre>\n</div>\n<div class=\"section\" id=\"id122\">\n<h2>Description</h2>\n<p>MagickGetImageChannelDepth() gets the depth for a particular image channel.</p>\n<p>The format of the MagickGetImageChannelDepth method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageChannelDepth( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to extract: RedChannel, GreenChannel,\nBlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel,\nBlackChannel.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagechannelextrema\">\n<h1><a class=\"toc-backref\" href=\"#id535\">MagickGetImageChannelExtrema</a></h1>\n<div class=\"section\" id=\"id123\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageChannelExtrema( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                           unsigned long *minima, unsigned long *maxima );\n</pre>\n</div>\n<div class=\"section\" id=\"id124\">\n<h2>Description</h2>\n<p>MagickGetImageChannelExtrema() gets the extrema for one or more image\nchannels.</p>\n<p>The format of the MagickGetImageChannelExtrema method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageChannelExtrema( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                           unsigned long *minima, unsigned long *maxima );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to extract: RedChannel, GreenChannel,\nBlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel,\nor BlackChannel.</dd>\n<dt>minima:</dt>\n<dd>The minimum pixel value for the specified channel(s).</dd>\n<dt>maxima:</dt>\n<dd>The maximum pixel value for the specified channel(s).</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagechannelmean\">\n<h1><a class=\"toc-backref\" href=\"#id536\">MagickGetImageChannelMean</a></h1>\n<div class=\"section\" id=\"id125\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageChannelMean( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                        double *mean, double *standard_deviation );\n</pre>\n</div>\n<div class=\"section\" id=\"id126\">\n<h2>Description</h2>\n<p>MagickGetImageChannelMean() gets the mean and standard deviation of one or\nmore image channels.</p>\n<p>The format of the MagickGetImageChannelMean method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageChannelMean( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                        double *mean, double *standard_deviation );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to extract: RedChannel, GreenChannel,\nBlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel,\nor BlackChannel.</dd>\n<dt>mean:</dt>\n<dd>The mean pixel value for the specified channel(s).</dd>\n<dt>standard_deviation:</dt>\n<dd>The standard deviation for the specified channel(s).</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagecolormapcolor\">\n<h1><a class=\"toc-backref\" href=\"#id537\">MagickGetImageColormapColor</a></h1>\n<div class=\"section\" id=\"id127\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageColormapColor( MagickWand *wand, const unsigned long index,\n                                          PixelWand *color );\n</pre>\n</div>\n<div class=\"section\" id=\"id128\">\n<h2>Description</h2>\n<p>MagickGetImageColormapColor() returns the color of the specified colormap\nindex.</p>\n<p>The format of the MagickGetImageColormapColor method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageColormapColor( MagickWand *wand, const unsigned long index,\n                                          PixelWand *color );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>index:</dt>\n<dd>The offset into the image colormap.</dd>\n<dt>color:</dt>\n<dd>Return the colormap color in this wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagecolors\">\n<h1><a class=\"toc-backref\" href=\"#id538\">MagickGetImageColors</a></h1>\n<div class=\"section\" id=\"id129\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageColors( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id130\">\n<h2>Description</h2>\n<p>MagickGetImageColors() gets the number of unique colors in the image.</p>\n<p>The format of the MagickGetImageColors method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageColors( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagecolorspace\">\n<h1><a class=\"toc-backref\" href=\"#id539\">MagickGetImageColorspace</a></h1>\n<div class=\"section\" id=\"id131\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> MagickGetImageColorspace( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id132\">\n<h2>Description</h2>\n<p>MagickGetImageColorspace() gets the image colorspace.</p>\n<p>The format of the MagickGetImageColorspace method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> MagickGetImageColorspace( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagecompose\">\n<h1><a class=\"toc-backref\" href=\"#id540\">MagickGetImageCompose</a></h1>\n<div class=\"section\" id=\"id133\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> MagickGetImageCompose( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id134\">\n<h2>Description</h2>\n<p>MagickGetImageCompose() returns the composite operator associated with the\nimage.</p>\n<p>The format of the MagickGetImageCompose method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> MagickGetImageCompose( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagecompression\">\n<h1><a class=\"toc-backref\" href=\"#id541\">MagickGetImageCompression</a></h1>\n<div class=\"section\" id=\"id135\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#compressiontype\">CompressionType</a> MagickGetImageCompression( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id136\">\n<h2>Description</h2>\n<p>MagickGetImageCompression() gets the image compression.</p>\n<p>The format of the MagickGetImageCompression method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#compressiontype\">CompressionType</a> MagickGetImageCompression( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagedelay\">\n<h1><a class=\"toc-backref\" href=\"#id542\">MagickGetImageDelay</a></h1>\n<div class=\"section\" id=\"id137\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageDelay( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id138\">\n<h2>Description</h2>\n<p>MagickGetImageDelay() gets the image delay.</p>\n<p>The format of the MagickGetImageDelay method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageDelay( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagedepth\">\n<h1><a class=\"toc-backref\" href=\"#id543\">MagickGetImageDepth</a></h1>\n<div class=\"section\" id=\"id139\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageDepth( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id140\">\n<h2>Description</h2>\n<p>MagickGetImageDepth() gets the image depth.</p>\n<p>The format of the MagickGetImageDepth method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageDepth( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageextrema\">\n<h1><a class=\"toc-backref\" href=\"#id544\">MagickGetImageExtrema</a></h1>\n<div class=\"section\" id=\"id141\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageExtrema( MagickWand *wand, unsigned long *min,\n                                    unsigned long *max );\n</pre>\n</div>\n<div class=\"section\" id=\"id142\">\n<h2>Description</h2>\n<p>MagickGetImageExtrema() gets the extrema for the image.</p>\n<p>The format of the MagickGetImageExtrema method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageExtrema( MagickWand *wand, unsigned long *min,\n                                    unsigned long *max );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>min:</dt>\n<dd>The minimum pixel value for the specified channel(s).</dd>\n<dt>max:</dt>\n<dd>The maximum pixel value for the specified channel(s).</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagedispose\">\n<h1><a class=\"toc-backref\" href=\"#id545\">MagickGetImageDispose</a></h1>\n<div class=\"section\" id=\"id143\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nDisposeType MagickGetImageDispose( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id144\">\n<h2>Description</h2>\n<p>MagickGetImageDispose() gets the image disposal method.</p>\n<p>The format of the MagickGetImageDispose method is:</p>\n<pre class=\"literal-block\">\nDisposeType MagickGetImageDispose( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagefilename\">\n<h1><a class=\"toc-backref\" href=\"#id546\">MagickGetImageFilename</a></h1>\n<div class=\"section\" id=\"id145\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char MagickGetImageFilename( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id146\">\n<h2>Description</h2>\n<p>MagickGetImageFilename() returns the filename of a particular image in a\nsequence.</p>\n<p>The format of the MagickGetImageFilename method is:</p>\n<pre class=\"literal-block\">\nconst char MagickGetImageFilename( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageformat\">\n<h1><a class=\"toc-backref\" href=\"#id547\">MagickGetImageFormat</a></h1>\n<div class=\"section\" id=\"id147\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char MagickGetImageFormat( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id148\">\n<h2>Description</h2>\n<p>MagickGetImageFormat() returns the format of a particular image in a\nsequence.</p>\n<p>The format of the MagickGetImageFormat method is:</p>\n<pre class=\"literal-block\">\nconst char MagickGetImageFormat( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagefuzz\">\n<h1><a class=\"toc-backref\" href=\"#id548\">MagickGetImageFuzz</a></h1>\n<div class=\"section\" id=\"id149\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble MagickGetImageFuzz( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id150\">\n<h2>Description</h2>\n<p>MagickGetImageFuzz() returns the color comparison fuzz factor. Colors\ncloser than the fuzz factor are considered to be the same when comparing\ncolors.  Note that some other functions such as MagickColorFloodfillImage()\nimplicitly set this value.</p>\n<p>The format of the MagickGetImageFuzz method is:</p>\n<pre class=\"literal-block\">\ndouble MagickGetImageFuzz( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagegamma\">\n<h1><a class=\"toc-backref\" href=\"#id549\">MagickGetImageGamma</a></h1>\n<div class=\"section\" id=\"id151\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble MagickGetImageGamma( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id152\">\n<h2>Description</h2>\n<p>MagickGetImageGamma() gets the image gamma.</p>\n<p>The format of the MagickGetImageGamma method is:</p>\n<pre class=\"literal-block\">\ndouble MagickGetImageGamma( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagegravity\">\n<h1><a class=\"toc-backref\" href=\"#id550\">MagickGetImageGravity</a></h1>\n<div class=\"section\" id=\"id153\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> MagickGetImageGravity( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id154\">\n<h2>Description</h2>\n<p>MagickGetImageGravity() gets the image gravity.</p>\n<p>The format of the MagickGetImageGravity method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> MagickGetImageGravity( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagegreenprimary\">\n<h1><a class=\"toc-backref\" href=\"#id551\">MagickGetImageGreenPrimary</a></h1>\n<div class=\"section\" id=\"id155\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageGreenPrimary( MagickWand *wand, double *x, double *y );\n</pre>\n</div>\n<div class=\"section\" id=\"id156\">\n<h2>Description</h2>\n<p>MagickGetImageGreenPrimary() returns the chromaticy green primary point.</p>\n<p>The format of the MagickGetImageGreenPrimary method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageGreenPrimary( MagickWand *wand, double *x, double *y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x:</dt>\n<dd>The chromaticity green primary x-point.</dd>\n<dt>y:</dt>\n<dd>The chromaticity green primary y-point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageheight\">\n<h1><a class=\"toc-backref\" href=\"#id552\">MagickGetImageHeight</a></h1>\n<div class=\"section\" id=\"id157\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageHeight( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id158\">\n<h2>Description</h2>\n<p>MagickGetImageHeight() returns the image height.</p>\n<p>The format of the MagickGetImageHeight method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageHeight( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagehistogram\">\n<h1><a class=\"toc-backref\" href=\"#id553\">MagickGetImageHistogram</a></h1>\n<div class=\"section\" id=\"id159\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nPixelWand *MagickGetImageHistogram( MagickWand *wand, unsigned long *number_colors );\n</pre>\n</div>\n<div class=\"section\" id=\"id160\">\n<h2>Description</h2>\n<p>MagickGetImageHistogram() returns the image histogram as an array of\nPixelWand wands.</p>\n<p>The format of the MagickGetImageHistogram method is:</p>\n<pre class=\"literal-block\">\nPixelWand *MagickGetImageHistogram( MagickWand *wand, unsigned long *number_colors );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>number_colors:</dt>\n<dd>The number of unique colors in the image and the number\nof pixel wands returned.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageindex\">\n<h1><a class=\"toc-backref\" href=\"#id554\">MagickGetImageIndex</a></h1>\n<div class=\"section\" id=\"id161\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageIndex( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id162\">\n<h2>Description</h2>\n<p>MagickGetImageIndex() returns the index of the current image.</p>\n<p>The format of the MagickGetImageIndex method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageIndex( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageinterlacescheme\">\n<h1><a class=\"toc-backref\" href=\"#id555\">MagickGetImageInterlaceScheme</a></h1>\n<div class=\"section\" id=\"id163\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#interlacetype\">InterlaceType</a> MagickGetImageInterlaceScheme( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id164\">\n<h2>Description</h2>\n<p>MagickGetImageInterlaceScheme() gets the image interlace scheme.</p>\n<p>The format of the MagickGetImageInterlaceScheme method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#interlacetype\">InterlaceType</a> MagickGetImageInterlaceScheme( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageiterations\">\n<h1><a class=\"toc-backref\" href=\"#id556\">MagickGetImageIterations</a></h1>\n<div class=\"section\" id=\"id165\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageIterations( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id166\">\n<h2>Description</h2>\n<p>MagickGetImageIterations() gets the image iterations.</p>\n<p>The format of the MagickGetImageIterations method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageIterations( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagemattecolor\">\n<h1><a class=\"toc-backref\" href=\"#id557\">MagickGetImageMatteColor</a></h1>\n<div class=\"section\" id=\"id167\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageMatteColor( MagickWand *wand, PixelWand *matte_color );\n</pre>\n</div>\n<div class=\"section\" id=\"id168\">\n<h2>Description</h2>\n<p>MagickGetImageMatteColor() returns the image matte color.</p>\n<p>The format of the MagickGetImageMatteColor method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageMatteColor( MagickWand *wand, PixelWand *matte_color );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>matte_color:</dt>\n<dd>Return the matte color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageorientation\">\n<h1><a class=\"toc-backref\" href=\"#id558\">MagickGetImageOrientation</a></h1>\n<div class=\"section\" id=\"id169\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nOrientationType MagickGetImageOrientation( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id170\">\n<h2>Description</h2>\n<p>MagickGetImageOrientation() gets the image orientation type. May be one of:</p>\n<p>UndefinedOrientation    Image orientation not specified or error.\nTopLeftOrientation      Left to right and Top to bottom.\nTopRightOrientation     Right to left  and Top to bottom.\nBottomRightOrientation  Right to left and Bottom to top.\nBottomLeftOrientation   Left to right and Bottom to top.\nLeftTopOrientation      Top to bottom and Left to right.\nRightTopOrientation     Top to bottom and Right to left.\nRightBottomOrientation  Bottom to top and Right to left.\nLeftBottomOrientation   Bottom to top and Left to right.</p>\n<p>The format of the MagickGetImageOrientation method is:</p>\n<pre class=\"literal-block\">\nOrientationType MagickGetImageOrientation( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagepage\">\n<h1><a class=\"toc-backref\" href=\"#id559\">MagickGetImagePage</a></h1>\n<div class=\"section\" id=\"id171\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickGetImagePage( MagickWand *wand, unsigned long *width, unsigned long *height, long *x,\n                    long *y );\n</pre>\n</div>\n<div class=\"section\" id=\"id172\">\n<h2>Description</h2>\n<p>MagickGetImagePage() retrieves the image page size and offset used when\nplacing (e.g. compositing) the image.</p>\n<p>The format of the MagickGetImagePage method is:</p>\n<pre class=\"literal-block\">\nMagickGetImagePage( MagickWand *wand, unsigned long *width, unsigned long *height, long *x,\n                    long *y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>width, height:</dt>\n<dd>The region size.</dd>\n<dt>x, y:</dt>\n<dd>Offset (from top left) on base canvas image on\nwhich to composite image data.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagepixels\">\n<h1><a class=\"toc-backref\" href=\"#id560\">MagickGetImagePixels</a></h1>\n<div class=\"section\" id=\"id173\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImagePixels( MagickWand *wand, const long x_offset, const long y_offset,\n                                   const unsigned long columns, const unsigned long rows,\n                                   const char *map, const <a class=\"reference external\" href=\"../api/types.html#storagetype\">StorageType</a> storage,\n                                   unsigned char *pixels );\n</pre>\n</div>\n<div class=\"section\" id=\"id174\">\n<h2>Description</h2>\n<p>MagickGetImagePixels() extracts pixel data from an image and returns it to\nyou.  The method returns False on success otherwise True if an error is\nencountered.  The data is returned as char, short int, int, long, float,\nor double in the order specified by map.</p>\n<p>Suppose you want to extract the first scanline of a 640x480 image as\ncharacter data in red-green-blue order:</p>\n<p>MagickGetImagePixels(wand,0,0,640,1,&quot;RGB&quot;,CharPixel,pixels);</p>\n<p>The format of the MagickGetImagePixels method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImagePixels( MagickWand *wand, const long x_offset, const long y_offset,\n                                   const unsigned long columns, const unsigned long rows,\n                                   const char *map, const <a class=\"reference external\" href=\"../api/types.html#storagetype\">StorageType</a> storage,\n                                   unsigned char *pixels );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x_offset, y_offset, columns, rows:</dt>\n<dd>These values define the perimeter\nof a region of pixels you want to extract.</dd>\n<dt>map:</dt>\n<dd>This string reflects the expected ordering of the pixel array.\nIt can be any combination or order of R = red, G = green, B = blue,\nA = alpha, C = cyan, Y = yellow, M = magenta, K = black, or\nI = intensity (for grayscale).</dd>\n<dt>storage:</dt>\n<dd>Define the data type of the pixels.  Float and double types are\nexpected to be normalized [0..1] otherwise [0..MaxRGB].  Choose from\nthese types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,\nor DoublePixel.</dd>\n<dt>pixels:</dt>\n<dd>This array of values contain the pixel components as defined by\nmap and type.  You must preallocate this array where the expected\nlength varies depending on the values of width, height, map, and type.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageprofile\">\n<h1><a class=\"toc-backref\" href=\"#id561\">MagickGetImageProfile</a></h1>\n<div class=\"section\" id=\"id175\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned char *MagickGetImageProfile( MagickWand *wand, const char *name,\n                                      unsigned long *length );\n</pre>\n</div>\n<div class=\"section\" id=\"id176\">\n<h2>Description</h2>\n<p>MagickGetImageProfile() returns the named image profile.</p>\n<p>The format of the MagickGetImageProfile method is:</p>\n<pre class=\"literal-block\">\nunsigned char *MagickGetImageProfile( MagickWand *wand, const char *name,\n                                      unsigned long *length );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>name:</dt>\n<dd>Name of profile to return: ICC, IPTC, or generic profile.</dd>\n<dt>length:</dt>\n<dd>The length of the profile.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageredprimary\">\n<h1><a class=\"toc-backref\" href=\"#id562\">MagickGetImageRedPrimary</a></h1>\n<div class=\"section\" id=\"id177\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageRedPrimary( MagickWand *wand, double *x, double *y );\n</pre>\n</div>\n<div class=\"section\" id=\"id178\">\n<h2>Description</h2>\n<p>MagickGetImageRedPrimary() returns the chromaticy red primary point.</p>\n<p>The format of the MagickGetImageRedPrimary method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageRedPrimary( MagickWand *wand, double *x, double *y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x:</dt>\n<dd>The chromaticity red primary x-point.</dd>\n<dt>y:</dt>\n<dd>The chromaticity red primary y-point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagerenderingintent\">\n<h1><a class=\"toc-backref\" href=\"#id563\">MagickGetImageRenderingIntent</a></h1>\n<div class=\"section\" id=\"id179\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#renderingintent\">RenderingIntent</a> MagickGetImageRenderingIntent( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id180\">\n<h2>Description</h2>\n<p>MagickGetImageRenderingIntent() gets the image rendering intent.</p>\n<p>The format of the MagickGetImageRenderingIntent method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#renderingintent\">RenderingIntent</a> MagickGetImageRenderingIntent( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageresolution\">\n<h1><a class=\"toc-backref\" href=\"#id564\">MagickGetImageResolution</a></h1>\n<div class=\"section\" id=\"id181\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageResolution( MagickWand *wand, double *x, double *y );\n</pre>\n</div>\n<div class=\"section\" id=\"id182\">\n<h2>Description</h2>\n<p>MagickGetImageResolution() gets the image X &amp; Y resolution.</p>\n<p>The format of the  MagickGetImageResolution method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageResolution( MagickWand *wand, double *x, double *y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x:</dt>\n<dd>The image x-resolution.</dd>\n<dt>y:</dt>\n<dd>The image y-resolution.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagescene\">\n<h1><a class=\"toc-backref\" href=\"#id565\">MagickGetImageScene</a></h1>\n<div class=\"section\" id=\"id183\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageScene( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id184\">\n<h2>Description</h2>\n<p>MagickGetImageScene() gets the image scene.</p>\n<p>The format of the MagickGetImageScene method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageScene( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagesignature\">\n<h1><a class=\"toc-backref\" href=\"#id566\">MagickGetImageSignature</a></h1>\n<div class=\"section\" id=\"id185\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char MagickGetImageSignature( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id186\">\n<h2>Description</h2>\n<p>MagickGetImageSignature() generates an SHA-256 message digest for the image\npixel stream.</p>\n<p>The format of the MagickGetImageSignature method is:</p>\n<pre class=\"literal-block\">\nconst char MagickGetImageSignature( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagesize\">\n<h1><a class=\"toc-backref\" href=\"#id567\">MagickGetImageSize</a></h1>\n<div class=\"section\" id=\"id187\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickSizeType MagickGetImageSize( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id188\">\n<h2>Description</h2>\n<p>MagickGetImageSize() returns the image size.</p>\n<p>The format of the MagickGetImageSize method is:</p>\n<pre class=\"literal-block\">\nMagickSizeType MagickGetImageSize( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagetype\">\n<h1><a class=\"toc-backref\" href=\"#id568\">MagickGetImageType</a></h1>\n<div class=\"section\" id=\"id189\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> MagickGetImageType( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id190\">\n<h2>Description</h2>\n<p>MagickGetImageType() gets the image type.</p>\n<p>The format of the MagickGetImageType method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> MagickGetImageType( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagesavedtype\">\n<h1><a class=\"toc-backref\" href=\"#id569\">MagickGetImageSavedType</a></h1>\n<div class=\"section\" id=\"id191\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> MagickGetImageSavedType( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id192\">\n<h2>Description</h2>\n<p>MagickGetImageSavedType() gets the image type that will be used when the\nimage is saved. This may be different to the current image type, returned\nby MagickGetImageType().</p>\n<p>The format of the MagickGetImageSavedType method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> MagickGetImageSavedType( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimageunits\">\n<h1><a class=\"toc-backref\" href=\"#id570\">MagickGetImageUnits</a></h1>\n<div class=\"section\" id=\"id193\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#resolutiontype\">ResolutionType</a> MagickGetImageUnits( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id194\">\n<h2>Description</h2>\n<p>MagickGetImageUnits() gets the image units of resolution.</p>\n<p>The format of the MagickGetImageUnits method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#resolutiontype\">ResolutionType</a> MagickGetImageUnits( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagevirtualpixelmethod\">\n<h1><a class=\"toc-backref\" href=\"#id571\">MagickGetImageVirtualPixelMethod</a></h1>\n<div class=\"section\" id=\"id195\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#virtualpixelmethod\">VirtualPixelMethod</a> MagickGetImageVirtualPixelMethod( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id196\">\n<h2>Description</h2>\n<p>MagickGetImageVirtualPixelMethod() returns the virtual pixel method for the\nsepcified image.</p>\n<p>The format of the MagickGetImageVirtualPixelMethod method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#virtualpixelmethod\">VirtualPixelMethod</a> MagickGetImageVirtualPixelMethod( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagewhitepoint\">\n<h1><a class=\"toc-backref\" href=\"#id572\">MagickGetImageWhitePoint</a></h1>\n<div class=\"section\" id=\"id197\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageWhitePoint( MagickWand *wand, double *x, double *y );\n</pre>\n</div>\n<div class=\"section\" id=\"id198\">\n<h2>Description</h2>\n<p>MagickGetImageWhitePoint() returns the chromaticy white point.</p>\n<p>The format of the MagickGetImageWhitePoint method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetImageWhitePoint( MagickWand *wand, double *x, double *y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x:</dt>\n<dd>The chromaticity white x-point.</dd>\n<dt>y:</dt>\n<dd>The chromaticity white y-point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetimagewidth\">\n<h1><a class=\"toc-backref\" href=\"#id573\">MagickGetImageWidth</a></h1>\n<div class=\"section\" id=\"id199\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageWidth( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id200\">\n<h2>Description</h2>\n<p>MagickGetImageWidth() returns the image width.</p>\n<p>The format of the MagickGetImageWidth method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetImageWidth( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetnumberimages\">\n<h1><a class=\"toc-backref\" href=\"#id574\">MagickGetNumberImages</a></h1>\n<div class=\"section\" id=\"id201\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetNumberImages( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id202\">\n<h2>Description</h2>\n<p>MagickGetNumberOfImages() returns the number of images associated with a\nmagick wand.</p>\n<p>The format of the MagickGetNumberImages method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetNumberImages( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetpackagename\">\n<h1><a class=\"toc-backref\" href=\"#id575\">MagickGetPackageName</a></h1>\n<div class=\"section\" id=\"id203\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *MagickGetPackageName( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id204\">\n<h2>Description</h2>\n<p>MagickGetPackageName() returns the ImageMagick package name.</p>\n<p>The format of the MagickGetPackageName method is:</p>\n<pre class=\"literal-block\">\nconst char *MagickGetPackageName( void );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetquantumdepth\">\n<h1><a class=\"toc-backref\" href=\"#id576\">MagickGetQuantumDepth</a></h1>\n<div class=\"section\" id=\"id205\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *MagickGetQuantumDepth( unsigned long *depth );\n</pre>\n</div>\n<div class=\"section\" id=\"id206\">\n<h2>Description</h2>\n<p>MagickGetQuantumDepth() returns the ImageMagick quantum depth.</p>\n<p>The format of the MagickGetQuantumDepth method is:</p>\n<pre class=\"literal-block\">\nconst char *MagickGetQuantumDepth( unsigned long *depth );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>depth:</dt>\n<dd>The quantum depth is returned as a number.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetreleasedate\">\n<h1><a class=\"toc-backref\" href=\"#id577\">MagickGetReleaseDate</a></h1>\n<div class=\"section\" id=\"id207\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *MagickGetReleaseDate( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id208\">\n<h2>Description</h2>\n<p>MagickGetReleaseDate() returns the ImageMagick release date.</p>\n<p>The format of the MagickGetReleaseDate method is:</p>\n<pre class=\"literal-block\">\nconst char *MagickGetReleaseDate( void );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetresourcelimit\">\n<h1><a class=\"toc-backref\" href=\"#id578\">MagickGetResourceLimit</a></h1>\n<div class=\"section\" id=\"id209\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long MagickGetResourceLimit( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type );\n</pre>\n</div>\n<div class=\"section\" id=\"id210\">\n<h2>Description</h2>\n<p>MagickGetResourceLimit() returns the the specified resource in megabytes.</p>\n<p>The format of the MagickGetResourceLimit method is:</p>\n<pre class=\"literal-block\">\nunsigned long MagickGetResourceLimit( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetsamplingfactors\">\n<h1><a class=\"toc-backref\" href=\"#id579\">MagickGetSamplingFactors</a></h1>\n<div class=\"section\" id=\"id211\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble *MagickGetSamplingFactors( MagickWand *wand, unsigned long *number_factors );\n</pre>\n</div>\n<div class=\"section\" id=\"id212\">\n<h2>Description</h2>\n<p>MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.</p>\n<p>The format of the MagickGetSamplingFactors method is:</p>\n<pre class=\"literal-block\">\ndouble *MagickGetSamplingFactors( MagickWand *wand, unsigned long *number_factors );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>number_factors:</dt>\n<dd>The number of factors in the returned array.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetsize\">\n<h1><a class=\"toc-backref\" href=\"#id580\">MagickGetSize</a></h1>\n<div class=\"section\" id=\"id213\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickGetSize( const MagickWand *wand, unsigned long *columns,\n                            unsigned long *rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id214\">\n<h2>Description</h2>\n<p>MagickGetSize() returns the size associated with the magick wand.</p>\n<p>The format of the MagickGetSize method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickGetSize( const MagickWand *wand, unsigned long *columns,\n                            unsigned long *rows );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>columns:</dt>\n<dd>The width in pixels.</dd>\n<dt>height:</dt>\n<dd>The height in pixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickgetversion\">\n<h1><a class=\"toc-backref\" href=\"#id581\">MagickGetVersion</a></h1>\n<div class=\"section\" id=\"id215\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nconst char *MagickGetVersion( unsigned long *version );\n</pre>\n</div>\n<div class=\"section\" id=\"id216\">\n<h2>Description</h2>\n<p>MagickGetVersion() returns the ImageMagick API version as a string and\nas a number.</p>\n<p>The format of the MagickGetVersion method is:</p>\n<pre class=\"literal-block\">\nconst char *MagickGetVersion( unsigned long *version );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>version:</dt>\n<dd>The ImageMagick version is returned as a number.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickhaldclutimage\">\n<h1><a class=\"toc-backref\" href=\"#id582\">MagickHaldClutImage</a></h1>\n<div class=\"section\" id=\"id217\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickPassFail MagickHaldClutImage( MagickWand *wand, const MagickWand *clut_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id218\">\n<h2>Description</h2>\n<p>The MagickHaldClutImage() method apply a color lookup table (Hald CLUT) to\nthe image.  The fundamental principle of the Hald CLUT algorithm is that\napplication of an identity CLUT causes no change to the input image,\nbut an identity CLUT image which has had its colors transformed in\nsome way (e.g. in Adobe Photoshop) may be used to implement an identical\ntransform on any other image.</p>\n<p>The minimum CLUT level is 2, and the maximum depends on available memory\n(largest successfully tested is 24).  A CLUT image is required to have equal\nwidth and height. A CLUT of level 8 is an image of dimension 512x512, a CLUT\nof level 16 is an image of dimension 4096x4096.  Interpolation is used so\nextremely large CLUT images are not required.</p>\n<p>GraphicsMagick provides an 'identity' coder which may be used to generate\nidentity HLUTs.  For example, reading from &quot;identity:8&quot; creates an identity\nCLUT of order 8.</p>\n<p>The Hald CLUT algorithm has been developed by Eskil Steenberg as described\nat <a class=\"reference external\" href=\"http://www.quelsolaar.com/technology/clut.html\">http://www.quelsolaar.com/technology/clut.html</a>, and was adapted for\nGraphicsMagick by Clément Follet with support from Cédric Lejeune of\nWorkflowers.</p>\n<p>The format of the HaldClutImage method is:</p>\n<pre class=\"literal-block\">\nMagickPassFail MagickHaldClutImage( MagickWand *wand, const MagickWand *clut_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The image wand.</dd>\n<dt>clut_wand:</dt>\n<dd>The color lookup table image wand</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickhascolormap\">\n<h1><a class=\"toc-backref\" href=\"#id583\">MagickHasColormap</a></h1>\n<div class=\"section\" id=\"id219\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickHasColormap( MagickWand *wand, unsigned int *colormap );\n</pre>\n</div>\n<div class=\"section\" id=\"id220\">\n<h2>Description</h2>\n<p>MagickHasColormap() returns True if the check was successful with the\ncolormap parameter set to a boolean value indicating whether the current\nwand image uses a color map or not. Returns False if there are no wand\nimages available.</p>\n<p>The format of the MagickHasColormap method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickHasColormap( MagickWand *wand, unsigned int *colormap );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>colormap:</dt>\n<dd>Set to True if current image uses a color map, False if not.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickhasnextimage\">\n<h1><a class=\"toc-backref\" href=\"#id584\">MagickHasNextImage</a></h1>\n<div class=\"section\" id=\"id221\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickHasNextImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id222\">\n<h2>Description</h2>\n<p>MagickHasNextImage() returns True if the wand has more images when\ntraversing the list in the forward direction</p>\n<p>The format of the MagickHasNextImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickHasNextImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickhaspreviousimage\">\n<h1><a class=\"toc-backref\" href=\"#id585\">MagickHasPreviousImage</a></h1>\n<div class=\"section\" id=\"id223\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickHasPreviousImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id224\">\n<h2>Description</h2>\n<p>MagickHasPreviousImage() returns True if the wand has more images when\ntraversing the list in the reverse direction</p>\n<p>The format of the MagickHasPreviousImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickHasPreviousImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickimplodeimage\">\n<h1><a class=\"toc-backref\" href=\"#id586\">MagickImplodeImage</a></h1>\n<div class=\"section\" id=\"id225\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickImplodeImage( MagickWand *wand, const double radius );\n</pre>\n</div>\n<div class=\"section\" id=\"id226\">\n<h2>Description</h2>\n<p>MagickImplodeImage() creates a new image that is a copy of an existing\none with the image pixels &quot;implode&quot; by the specified percentage.  It\nallocates the memory necessary for the new Image structure and returns a\npointer to the new image.</p>\n<p>The format of the MagickImplodeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickImplodeImage( MagickWand *wand, const double radius );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>amount:</dt>\n<dd>Define the extent of the implosion.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickisgrayimage\">\n<h1><a class=\"toc-backref\" href=\"#id587\">MagickIsGrayImage</a></h1>\n<div class=\"section\" id=\"id227\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickIsGrayImage( MagickWand *wand, unsigned int *grayimage );\n</pre>\n</div>\n<div class=\"section\" id=\"id228\">\n<h2>Description</h2>\n<p>MagickIsGrayImage() returns True if the check was successful with the\ngrayimage parameter set to a boolean value indicating whether the current\nwand image is a gray-scale image or not. Returns False if there was\nan error.</p>\n<p>The format of the MagickIsGrayImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickIsGrayImage( MagickWand *wand, unsigned int *grayimage );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>grayimage:</dt>\n<dd>Set to True if current image is a gray-scale image,\nFalse if not.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickismonochromeimage\">\n<h1><a class=\"toc-backref\" href=\"#id588\">MagickIsMonochromeImage</a></h1>\n<div class=\"section\" id=\"id229\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickIsMonochromeImage( MagickWand *wand, unsigned int *monochrome );\n</pre>\n</div>\n<div class=\"section\" id=\"id230\">\n<h2>Description</h2>\n<p>MagickIsMonochromeImage() returns True if the check was successful with the\nmonochrome parameter set to a boolean value indicating whether the current\nwand image is a monochrome image or not. Returns False if there was\nan error.</p>\n<p>The format of the MagickIsMonochromeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickIsMonochromeImage( MagickWand *wand, unsigned int *monochrome );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>monochrome:</dt>\n<dd>Set to True if current image is a monochrome image,\nFalse if not.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickisopaqueimage\">\n<h1><a class=\"toc-backref\" href=\"#id589\">MagickIsOpaqueImage</a></h1>\n<div class=\"section\" id=\"id231\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickIsOpaqueImage( MagickWand *wand, unsigned int *opaque );\n</pre>\n</div>\n<div class=\"section\" id=\"id232\">\n<h2>Description</h2>\n<p>MagickIsOpaqueImage() returns True if the check was successful with the\nopaque parameter set to a boolean value indicating whether the current\nwand image is entirely opaque or not. Returns False if there was\nan error.</p>\n<p>The format of the MagickIsOpaqueImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickIsOpaqueImage( MagickWand *wand, unsigned int *opaque );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>opaque:</dt>\n<dd>Set to True if current image is entirely opaque,\nFalse if not.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickispaletteimage\">\n<h1><a class=\"toc-backref\" href=\"#id590\">MagickIsPaletteImage</a></h1>\n<div class=\"section\" id=\"id233\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickIsPaletteImage( MagickWand *wand, unsigned int *palette );\n</pre>\n</div>\n<div class=\"section\" id=\"id234\">\n<h2>Description</h2>\n<p>MagickIsPaletteImage() returns True if the check was successful with the\npalette parameter set to a boolean value indicating whether the current\nwand image is an image with 256 unique colors or less. Returns False if\nthere was an error. Note that a palette image does not necessarily use a\ncolormap. See MagickHasColormap() if needing to determine whether a\ncolormap is in use.</p>\n<p>The format of the MagickIsPaletteImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickIsPaletteImage( MagickWand *wand, unsigned int *palette );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>palette:</dt>\n<dd>Set to True if current image is 256 colors or less,\nFalse if not.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicklabelimage\">\n<h1><a class=\"toc-backref\" href=\"#id591\">MagickLabelImage</a></h1>\n<div class=\"section\" id=\"id235\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickLabelImage( MagickWand *wand, const char *label );\n</pre>\n</div>\n<div class=\"section\" id=\"id236\">\n<h2>Description</h2>\n<p>MagickLabelImage() adds a label to your image.</p>\n<p>The format of the MagickLabelImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickLabelImage( MagickWand *wand, const char *label );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>label:</dt>\n<dd>The image label.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicklevelimage\">\n<h1><a class=\"toc-backref\" href=\"#id592\">MagickLevelImage</a></h1>\n<div class=\"section\" id=\"id237\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickLevelImage( MagickWand *wand, const double black_point, const double gamma,\n                               const double white_point );\n</pre>\n</div>\n<div class=\"section\" id=\"id238\">\n<h2>Description</h2>\n<p>MagickLevelImage() adjusts the levels of an image by scaling the colors\nfalling between specified white and black points to the full available\nquantum range. The parameters provided represent the black, mid, and white\npoints. The black point specifies the darkest color in the image. Colors\ndarker than the black point are set to zero. Mid point specifies a gamma\ncorrection to apply to the image.  White point specifies the lightest color\nin the image. Colors brighter than the white point are set to the maximum\nquantum value.</p>\n<p>The format of the MagickLevelImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickLevelImage( MagickWand *wand, const double black_point, const double gamma,\n                               const double white_point );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>black_point:</dt>\n<dd>The black point.</dd>\n<dt>gamma:</dt>\n<dd>The gamma.</dd>\n<dt>white_point:</dt>\n<dd>The white point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicklevelimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id593\">MagickLevelImageChannel</a></h1>\n<div class=\"section\" id=\"id239\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickLevelImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                      const double black_point, const double gamma,\n                                      const double white_point );\n</pre>\n</div>\n<div class=\"section\" id=\"id240\">\n<h2>Description</h2>\n<p>MagickLevelImageChannel() adjusts the levels of the specified channel of\nthe reference image by scaling the colors falling between specified white\nand black points to the full available quantum range. The parameters\nprovided represent the black, mid, and white points. The black point\nspecifies the darkest color in the image. Colors darker than the black\npoint are set to zero.  Mid point specifies a gamma correction to apply\nto the image.  White point specifies the lightest color in the image.\nColors brighter than the white point are set to the maximum quantum value.</p>\n<p>The format of the MagickLevelImageChannel method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickLevelImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                      const double black_point, const double gamma,\n                                      const double white_point );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to level: RedChannel, GreenChannel,\nBlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel,\nBlackChannel.</dd>\n<dt>black_point:</dt>\n<dd>The black point.</dd>\n<dt>gamma:</dt>\n<dd>The gamma.</dd>\n<dt>white_point:</dt>\n<dd>The white point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmagnifyimage\">\n<h1><a class=\"toc-backref\" href=\"#id594\">MagickMagnifyImage</a></h1>\n<div class=\"section\" id=\"id241\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickMagnifyImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id242\">\n<h2>Description</h2>\n<p>MagickMagnifyImage() is a convenience method that scales an image\nproportionally to twice its original size.</p>\n<p>The format of the MagickMagnifyImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickMagnifyImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmapimage\">\n<h1><a class=\"toc-backref\" href=\"#id595\">MagickMapImage</a></h1>\n<div class=\"section\" id=\"id243\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickMapImage( MagickWand *wand, const MagickWand *map_wand,\n                             const unsigned int dither );\n</pre>\n</div>\n<div class=\"section\" id=\"id244\">\n<h2>Description</h2>\n<p>MagickMapImage() replaces the colors of an image with the closest color\nfrom a reference image.</p>\n<p>The format of the MagickMapImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickMapImage( MagickWand *wand, const MagickWand *map_wand,\n                             const unsigned int dither );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>map:</dt>\n<dd>The map wand.</dd>\n<dt>dither:</dt>\n<dd>Set this integer value to something other than zero to dither\nthe mapped image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmattefloodfillimage\">\n<h1><a class=\"toc-backref\" href=\"#id596\">MagickMatteFloodfillImage</a></h1>\n<div class=\"section\" id=\"id245\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickMatteFloodfillImage( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> opacity,\n                                        const double fuzz, const PixelWand *bordercolor,\n                                        const long x, const long y );\n</pre>\n</div>\n<div class=\"section\" id=\"id246\">\n<h2>Description</h2>\n<p>MagickMatteFloodfillImage() changes the transparency value of any pixel that\nmatches target and is an immediate neighbor.  If the method\nFillToBorderMethod is specified, the transparency value is changed for any\nneighbor pixel that does not match the bordercolor member of image.</p>\n<p>The format of the MagickMatteFloodfillImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickMatteFloodfillImage( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> opacity,\n                                        const double fuzz, const PixelWand *bordercolor,\n                                        const long x, const long y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>opacity:</dt>\n<dd>The opacity.</dd>\n<dt>fuzz:</dt>\n<dd>By default target must match a particular pixel color\nexactly.  However, in many cases two colors may differ by a small amount.\nThe fuzz member of image defines how much tolerance is acceptable to\nconsider two colors as the same.  For example, set fuzz to 10 and the\ncolor red at intensities of 100 and 102 respectively are now interpreted\nas the same color for the purposes of the floodfill.</dd>\n<dt>bordercolor:</dt>\n<dd>The border color pixel wand.</dd>\n<dt>x,y:</dt>\n<dd>The starting location of the operation.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmedianfilterimage\">\n<h1><a class=\"toc-backref\" href=\"#id597\">MagickMedianFilterImage</a></h1>\n<div class=\"section\" id=\"id247\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickMedianFilterImage( MagickWand *wand, const double radius );\n</pre>\n</div>\n<div class=\"section\" id=\"id248\">\n<h2>Description</h2>\n<p>MagickMedianFilterImage() applies a digital filter that improves the quality\nof a noisy image.  Each pixel is replaced by the median in a set of\nneighboring pixels as defined by radius.</p>\n<p>The format of the MagickMedianFilterImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickMedianFilterImage( MagickWand *wand, const double radius );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>The radius of the pixel neighborhood.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickminifyimage\">\n<h1><a class=\"toc-backref\" href=\"#id598\">MagickMinifyImage</a></h1>\n<div class=\"section\" id=\"id249\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickMinifyImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id250\">\n<h2>Description</h2>\n<p>MagickMinifyImage() is a convenience method that scales an image\nproportionally to one-half its original size</p>\n<p>The format of the MagickMinifyImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickMinifyImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmodulateimage\">\n<h1><a class=\"toc-backref\" href=\"#id599\">MagickModulateImage</a></h1>\n<div class=\"section\" id=\"id251\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickModulateImage( MagickWand *wand, const double brightness,\n                                  const double saturation, const double hue );\n</pre>\n</div>\n<div class=\"section\" id=\"id252\">\n<h2>Description</h2>\n<p>MagickModulateImage() lets you control the brightness, saturation, and hue\nof an image.</p>\n<p>The format of the MagickModulateImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickModulateImage( MagickWand *wand, const double brightness,\n                                  const double saturation, const double hue );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>brightness:</dt>\n<dd>The percent change in brighness (-100 thru +100).</dd>\n<dt>saturation:</dt>\n<dd>The percent change in saturation (-100 thru +100)</dd>\n<dt>hue:</dt>\n<dd>The percent change in hue (-100 thru +100)</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmontageimage\">\n<h1><a class=\"toc-backref\" href=\"#id600\">MagickMontageImage</a></h1>\n<div class=\"section\" id=\"id253\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand MagickMontageImage( MagickWand *wand, const DrawingWand drawing_wand,\n                               const char *tile_geometry, const char *thumbnail_geometry,\n                               const MontageMode mode, const char *frame );\n</pre>\n</div>\n<div class=\"section\" id=\"id254\">\n<h2>Description</h2>\n<p>Use MagickMontageImage() to create a composite image by combining several\nseparate images. The images are tiled on the composite image with the name\nof the image optionally appearing just below the individual tile.</p>\n<p>The format of the MagickMontageImage method is:</p>\n<pre class=\"literal-block\">\nMagickWand MagickMontageImage( MagickWand *wand, const DrawingWand drawing_wand,\n                               const char *tile_geometry, const char *thumbnail_geometry,\n                               const MontageMode mode, const char *frame );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.  The font name, size, and color are\nobtained from this wand.</dd>\n<dt>tile_geometry:</dt>\n<dd>the number of tiles per row and page (e.g. 6x4+0+0).</dd>\n<dt>thumbnail_geometry:</dt>\n<dd>Preferred image size and border size of each\nthumbnail (e.g. 120x120+4+3&gt;).</dd>\n<dt>mode:</dt>\n<dd>Thumbnail framing mode: Frame, Unframe, or Concatenate.</dd>\n<dt>frame:</dt>\n<dd>Surround the image with an ornamental border (e.g. 15x15+3+3).\nThe frame color is that of the thumbnail's matte color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmorphimages\">\n<h1><a class=\"toc-backref\" href=\"#id601\">MagickMorphImages</a></h1>\n<div class=\"section\" id=\"id255\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickMorphImages( MagickWand *wand, const unsigned long number_frames );\n</pre>\n</div>\n<div class=\"section\" id=\"id256\">\n<h2>Description</h2>\n<p>MagickMorphImages() method morphs a set of images.  Both the image pixels\nand size are linearly interpolated to give the appearance of a\nmeta-morphosis from one image to the next.</p>\n<p>The format of the MagickMorphImages method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickMorphImages( MagickWand *wand, const unsigned long number_frames );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>number_frames:</dt>\n<dd>The number of in-between images to generate.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmosaicimages\">\n<h1><a class=\"toc-backref\" href=\"#id602\">MagickMosaicImages</a></h1>\n<div class=\"section\" id=\"id257\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickMosaicImages( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id258\">\n<h2>Description</h2>\n<p>MagickMosaicImages() inlays an image sequence to form a single coherent\npicture.  It returns a wand with each image in the sequence composited at\nthe location defined by the page offset of the image.</p>\n<p>The format of the MagickMosaicImages method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickMosaicImages( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickmotionblurimage\">\n<h1><a class=\"toc-backref\" href=\"#id603\">MagickMotionBlurImage</a></h1>\n<div class=\"section\" id=\"id259\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickMotionBlurImage( MagickWand *wand, const double radius, const double sigma,\n                                    const double angle );\n</pre>\n</div>\n<div class=\"section\" id=\"id260\">\n<h2>Description</h2>\n<p>MagickMotionBlurImage() simulates motion blur.  We convolve the image with a\nGaussian operator of the given radius and standard deviation (sigma).\nFor reasonable results, radius should be larger than sigma.  Use a\nradius of 0 and MotionBlurImage() selects a suitable radius for you.\nAngle gives the angle of the blurring motion.</p>\n<p>The format of the MagickMotionBlurImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickMotionBlurImage( MagickWand *wand, const double radius, const double sigma,\n                                    const double angle );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting\nthe center pixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n<dt>angle:</dt>\n<dd>Apply the effect along this angle.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicknegateimage\">\n<h1><a class=\"toc-backref\" href=\"#id604\">MagickNegateImage</a></h1>\n<div class=\"section\" id=\"id261\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickNegateImage( MagickWand *wand, const unsigned int gray );\n</pre>\n</div>\n<div class=\"section\" id=\"id262\">\n<h2>Description</h2>\n<p>MagickNegateImage() negates the colors in the reference image.  The\nGrayscale option means that only grayscale values within the image are\nnegated.</p>\n<p>You can also reduce the influence of a particular channel with a gamma\nvalue of 0.</p>\n<p>The format of the MagickNegateImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickNegateImage( MagickWand *wand, const unsigned int gray );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>gray:</dt>\n<dd>If True, only negate grayscale pixels within the image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicknegateimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id605\">MagickNegateImageChannel</a></h1>\n<div class=\"section\" id=\"id263\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickNegateImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                       const unsigned int gray );\n</pre>\n</div>\n<div class=\"section\" id=\"id264\">\n<h2>Description</h2>\n<p>MagickNegateImageChannel() negates the colors in the specified channel of the\nreference image.  The Grayscale option means that only grayscale values\nwithin the image are negated.  Note that the Grayscale option has no\neffect for GraphicsMagick.</p>\n<p>You can also reduce the influence of a particular channel with a gamma\nvalue of 0.</p>\n<p>The format of the MagickNegateImageChannel method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickNegateImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                       const unsigned int gray );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to extract: RedChannel, GreenChannel,\nBlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel,\nBlackChannel.</dd>\n<dt>gray:</dt>\n<dd>If True, only negate grayscale pixels within the image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicknextimage\">\n<h1><a class=\"toc-backref\" href=\"#id606\">MagickNextImage</a></h1>\n<div class=\"section\" id=\"id265\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickNextImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id266\">\n<h2>Description</h2>\n<p>MagickNextImage() associates the next image in the image list with a magick\nwand.  True is returned if the Wand iterated to a next image, or False is\nreturned if the wand did not iterate to a next image.</p>\n<p>The format of the MagickNextImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickNextImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicknormalizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id607\">MagickNormalizeImage</a></h1>\n<div class=\"section\" id=\"id267\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickNormalizeImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id268\">\n<h2>Description</h2>\n<p>MagickNormalizeImage() enhances the contrast of a color image by adjusting\nthe pixels color to span the entire range of colors available</p>\n<p>You can also reduce the influence of a particular channel with a gamma\nvalue of 0.</p>\n<p>The format of the MagickNormalizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickNormalizeImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickoilpaintimage\">\n<h1><a class=\"toc-backref\" href=\"#id608\">MagickOilPaintImage</a></h1>\n<div class=\"section\" id=\"id269\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickOilPaintImage( MagickWand *wand, const double radius );\n</pre>\n</div>\n<div class=\"section\" id=\"id270\">\n<h2>Description</h2>\n<p>MagickOilPaintImage() applies a special effect filter that simulates an oil\npainting.  Each pixel is replaced by the most frequent color occurring\nin a circular region defined by radius.</p>\n<p>The format of the MagickOilPaintImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickOilPaintImage( MagickWand *wand, const double radius );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>The radius of the circular neighborhood.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickopaqueimage\">\n<h1><a class=\"toc-backref\" href=\"#id609\">MagickOpaqueImage</a></h1>\n<div class=\"section\" id=\"id271\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickOpaqueImage( MagickWand *wand, const PixelWand *target,\n                                const PixelWand *fill, const double fuzz );\n</pre>\n</div>\n<div class=\"section\" id=\"id272\">\n<h2>Description</h2>\n<p>MagickOpaqueImage() changes any pixel that matches color with the color\ndefined by fill.</p>\n<p>The format of the MagickOpaqueImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickOpaqueImage( MagickWand *wand, const PixelWand *target,\n                                const PixelWand *fill, const double fuzz );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>target:</dt>\n<dd>Change this target color to the fill color within the image.</dd>\n<dt>fill:</dt>\n<dd>The fill pixel wand.</dd>\n<dt>fuzz:</dt>\n<dd>By default target must match a particular pixel color\nexactly.  However, in many cases two colors may differ by a small amount.\nThe fuzz member of image defines how much tolerance is acceptable to\nconsider two colors as the same.  For example, set fuzz to 10 and the\ncolor red at intensities of 100 and 102 respectively are now interpreted\nas the same color for the purposes of the floodfill.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickpingimage\">\n<h1><a class=\"toc-backref\" href=\"#id610\">MagickPingImage</a></h1>\n<div class=\"section\" id=\"id273\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickPingImage( MagickWand *wand, const char *filename );\n</pre>\n</div>\n<div class=\"section\" id=\"id274\">\n<h2>Description</h2>\n<p>MagickPingImage() is like MagickReadImage() except the only valid\ninformation returned is the image width, height, size, and format.  It\nis designed to efficiently obtain this information from a file without\nreading the entire image sequence into memory.</p>\n<p>The format of the MagickPingImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickPingImage( MagickWand *wand, const char *filename );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>filename:</dt>\n<dd>The image filename.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickpreviewimages\">\n<h1><a class=\"toc-backref\" href=\"#id611\">MagickPreviewImages</a></h1>\n<div class=\"section\" id=\"id275\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickPreviewImages( MagickWand *wand, const PreviewType preview );\n</pre>\n</div>\n<div class=\"section\" id=\"id276\">\n<h2>Description</h2>\n<p>MagickPreviewImages() tiles 9 thumbnails of the specified image with an\nimage processing operation applied at varying strengths.  This is helpful\nto quickly pin-point an appropriate parameter for an image processing\noperation.</p>\n<p>The format of the MagickPreviewImages method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickPreviewImages( MagickWand *wand, const PreviewType preview );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>preview:</dt>\n<dd>The preview type.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickpreviousimage\">\n<h1><a class=\"toc-backref\" href=\"#id612\">MagickPreviousImage</a></h1>\n<div class=\"section\" id=\"id277\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickPreviousImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id278\">\n<h2>Description</h2>\n<p>MagickPreviousImage() selects the previous image associated with a magick\nwand.</p>\n<p>The format of the MagickPreviousImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickPreviousImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickprofileimage\">\n<h1><a class=\"toc-backref\" href=\"#id613\">MagickProfileImage</a></h1>\n<div class=\"section\" id=\"id279\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickProfileImage( MagickWand *wand, const char *name,\n                                 const unsigned char *profile, const size_t length );\n</pre>\n</div>\n<div class=\"section\" id=\"id280\">\n<h2>Description</h2>\n<p>Use MagickProfileImage() to add or remove a ICC, IPTC, or generic profile\nfrom an image.  If the profile is NULL, it is removed from the image\notherwise added.  Use a name of '*' and a profile of NULL to remove all\nprofiles from the image.</p>\n<p>The format of the MagickProfileImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickProfileImage( MagickWand *wand, const char *name,\n                                 const unsigned char *profile, const size_t length );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>name:</dt>\n<dd>Name of profile to add or remove: ICC, IPTC, or generic profile.</dd>\n<dt>profile:</dt>\n<dd>The profile.</dd>\n<dt>length:</dt>\n<dd>The length of the profile.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickquantizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id614\">MagickQuantizeImage</a></h1>\n<div class=\"section\" id=\"id281\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickQuantizeImage( MagickWand *wand, const unsigned long number_colors,\n                                  const <a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> colorspace,\n                                  const unsigned long treedepth, const unsigned int dither,\n                                  const unsigned int measure_error );\n</pre>\n</div>\n<div class=\"section\" id=\"id282\">\n<h2>Description</h2>\n<p>MagickQuantizeImage() analyzes the colors within a reference image and\nchooses a fixed number of colors to represent the image.  The goal of the\nalgorithm is to minimize the color difference between the input and output\nimage while minimizing the processing time.</p>\n<p>The format of the MagickQuantizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickQuantizeImage( MagickWand *wand, const unsigned long number_colors,\n                                  const <a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> colorspace,\n                                  const unsigned long treedepth, const unsigned int dither,\n                                  const unsigned int measure_error );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>number_colors:</dt>\n<dd>The number of colors.</dd>\n<dt>colorspace:</dt>\n<dd>Perform color reduction in this colorspace, typically\nRGBColorspace.</dd>\n<dt>treedepth:</dt>\n<dd>Normally, this integer value is zero or one.  A zero or\none tells Quantize to choose a optimal tree depth of Log4(number_colors).%      A tree of this depth generally allows the best representation of the\nreference image with the least amount of memory and the fastest\ncomputational speed.  In some cases, such as an image with low color\ndispersion (a few number of colors), a value other than\nLog4(number_colors) is required.  To expand the color tree completely,\nuse a value of 8.</dd>\n<dt>dither:</dt>\n<dd>A value other than zero distributes the difference between an\noriginal image and the corresponding color reduced algorithm to\nneighboring pixels along a Hilbert curve.</dd>\n<dt>measure_error:</dt>\n<dd>A value other than zero measures the difference between\nthe original and quantized images.  This difference is the total\nquantization error.  The error is computed by summing over all pixels\nin an image the distance squared in RGB space between each reference\npixel value and its quantized value.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickquantizeimages\">\n<h1><a class=\"toc-backref\" href=\"#id615\">MagickQuantizeImages</a></h1>\n<div class=\"section\" id=\"id283\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickQuantizeImages( MagickWand *wand, const unsigned long number_colors,\n                                   const <a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> colorspace,\n                                   const unsigned long treedepth, const unsigned int dither,\n                                   const unsigned int measure_error );\n</pre>\n</div>\n<div class=\"section\" id=\"id284\">\n<h2>Description</h2>\n<p>MagickQuantizeImage() analyzes the colors within a sequence of images and\nchooses a fixed number of colors to represent the image.  The goal of the\nalgorithm is to minimize the color difference between the input and output\nimage while minimizing the processing time.</p>\n<p>The format of the MagickQuantizeImages method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickQuantizeImages( MagickWand *wand, const unsigned long number_colors,\n                                   const <a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> colorspace,\n                                   const unsigned long treedepth, const unsigned int dither,\n                                   const unsigned int measure_error );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>number_colors:</dt>\n<dd>The number of colors.</dd>\n<dt>colorspace:</dt>\n<dd>Perform color reduction in this colorspace, typically\nRGBColorspace.</dd>\n<dt>treedepth:</dt>\n<dd>Normally, this integer value is zero or one.  A zero or\none tells Quantize to choose a optimal tree depth of Log4(number_colors).%      A tree of this depth generally allows the best representation of the\nreference image with the least amount of memory and the fastest\ncomputational speed.  In some cases, such as an image with low color\ndispersion (a few number of colors), a value other than\nLog4(number_colors) is required.  To expand the color tree completely,\nuse a value of 8.</dd>\n<dt>dither:</dt>\n<dd>A value other than zero distributes the difference between an\noriginal image and the corresponding color reduced algorithm to\nneighboring pixels along a Hilbert curve.</dd>\n<dt>measure_error:</dt>\n<dd>A value other than zero measures the difference between\nthe original and quantized images.  This difference is the total\nquantization error.  The error is computed by summing over all pixels\nin an image the distance squared in RGB space between each reference\npixel value and its quantized value.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickqueryfontmetrics\">\n<h1><a class=\"toc-backref\" href=\"#id616\">MagickQueryFontMetrics</a></h1>\n<div class=\"section\" id=\"id285\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble *MagickQueryFontMetrics( MagickWand *wand, const DrawingWand *drawing_wand,\n                                const char *text );\n</pre>\n</div>\n<div class=\"section\" id=\"id286\">\n<h2>Description</h2>\n<p>MagickQueryFontMetrics() returns a 7 element array representing the\nfollowing font metrics:</p>\n</div>\n<div class=\"section\" id=\"element-description\">\n<h2>Element Description</h2>\n<p>0 character width\n1 character height\n2 ascender\n3 descender\n4 text width\n5 text height\n6 maximum horizontal advance</p>\n<p>The format of the MagickQueryFontMetrics method is:</p>\n<pre class=\"literal-block\">\ndouble *MagickQueryFontMetrics( MagickWand *wand, const DrawingWand *drawing_wand,\n                                const char *text );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The Magick wand.</dd>\n<dt>drawing_wand:</dt>\n<dd>The drawing wand.</dd>\n<dt>text:</dt>\n<dd>The text.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickqueryfonts\">\n<h1><a class=\"toc-backref\" href=\"#id617\">MagickQueryFonts</a></h1>\n<div class=\"section\" id=\"id287\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar ** MagickQueryFonts( const char *pattern, unsigned long *number_fonts );\n</pre>\n</div>\n<div class=\"section\" id=\"id288\">\n<h2>Description</h2>\n<p>MagickQueryFonts() returns any font that match the specified pattern.</p>\n<p>The format of the MagickQueryFonts function is:</p>\n<pre class=\"literal-block\">\nchar ** MagickQueryFonts( const char *pattern, unsigned long *number_fonts );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>pattern:</dt>\n<dd>Specifies a pointer to a text string containing a pattern.</dd>\n<dt>number_fonts:</dt>\n<dd>This integer returns the number of fonts in the list.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickqueryformats\">\n<h1><a class=\"toc-backref\" href=\"#id618\">MagickQueryFormats</a></h1>\n<div class=\"section\" id=\"id289\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar ** MagickQueryFormats( const char *pattern, unsigned long *number_formats );\n</pre>\n</div>\n<div class=\"section\" id=\"id290\">\n<h2>Description</h2>\n<p>MagickQueryFormats() returns any image formats that match the specified\npattern.</p>\n<p>The format of the MagickQueryFormats function is:</p>\n<pre class=\"literal-block\">\nchar ** MagickQueryFormats( const char *pattern, unsigned long *number_formats );\n</pre>\n<dl class=\"docutils\">\n<dt>pattern:</dt>\n<dd>Specifies a pointer to a text string containing a pattern.</dd>\n<dt>number_formats:</dt>\n<dd>This integer returns the number of image formats in the\nlist.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickradialblurimage\">\n<h1><a class=\"toc-backref\" href=\"#id619\">MagickRadialBlurImage</a></h1>\n<div class=\"section\" id=\"id291\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickRadialBlurImage( MagickWand *wand, const double angle );\n</pre>\n</div>\n<div class=\"section\" id=\"id292\">\n<h2>Description</h2>\n<p>MagickRadialBlurImage() radial blurs an image.</p>\n<p>The format of the MagickRadialBlurImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickRadialBlurImage( MagickWand *wand, const double angle );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>angle:</dt>\n<dd>The angle of the blur in degrees.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickraiseimage\">\n<h1><a class=\"toc-backref\" href=\"#id620\">MagickRaiseImage</a></h1>\n<div class=\"section\" id=\"id293\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickRaiseImage( MagickWand *wand, const unsigned long width,\n                               const unsigned long height, const long x, const long y,\n                               const unsigned int raise_flag );\n</pre>\n</div>\n<div class=\"section\" id=\"id294\">\n<h2>Description</h2>\n<p>MagickRaiseImage() creates a simulated three-dimensional button-like effect\nby lightening and darkening the edges of the image.  Members width and\nheight of raise_info define the width of the vertical and horizontal\nedge of the effect.</p>\n<p>The format of the MagickRaiseImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickRaiseImage( MagickWand *wand, const unsigned long width,\n                               const unsigned long height, const long x, const long y,\n                               const unsigned int raise_flag );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>width,height,x,y:</dt>\n<dd>Define the dimensions of the area to raise.</dd>\n<dt>raise_flag:</dt>\n<dd>A value other than zero creates a 3-D raise effect,\notherwise it has a lowered effect.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickreadimage\">\n<h1><a class=\"toc-backref\" href=\"#id621\">MagickReadImage</a></h1>\n<div class=\"section\" id=\"id295\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickReadImage( MagickWand *wand, const char *filename );\n</pre>\n</div>\n<div class=\"section\" id=\"id296\">\n<h2>Description</h2>\n<p>MagickReadImage() reads an image or image sequence.</p>\n<p>The format of the MagickReadImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickReadImage( MagickWand *wand, const char *filename );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>filename:</dt>\n<dd>The image filename.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickreadimageblob\">\n<h1><a class=\"toc-backref\" href=\"#id622\">MagickReadImageBlob</a></h1>\n<div class=\"section\" id=\"id297\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickReadImageBlob( MagickWand *wand, const unsigned char *blob,\n                                  const size_t length );\n</pre>\n</div>\n<div class=\"section\" id=\"id298\">\n<h2>Description</h2>\n<p>MagickReadImageBlob() reads an image or image sequence from a blob.</p>\n<p>The format of the MagickReadImageBlob method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickReadImageBlob( MagickWand *wand, const unsigned char *blob,\n                                  const size_t length );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>blob:</dt>\n<dd>The blob.</dd>\n<dt>length:</dt>\n<dd>The blob length.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickreadimagefile\">\n<h1><a class=\"toc-backref\" href=\"#id623\">MagickReadImageFile</a></h1>\n<div class=\"section\" id=\"id299\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickReadImageFile( MagickWand *wand, FILE *file );\n</pre>\n</div>\n<div class=\"section\" id=\"id300\">\n<h2>Description</h2>\n<p>MagickReadImageFile() reads an image or image sequence from an open file\ndescriptor.</p>\n<p>The format of the MagickReadImageFile method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickReadImageFile( MagickWand *wand, FILE *file );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>file:</dt>\n<dd>The file descriptor.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickreducenoiseimage\">\n<h1><a class=\"toc-backref\" href=\"#id624\">MagickReduceNoiseImage</a></h1>\n<div class=\"section\" id=\"id301\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickReduceNoiseImage( MagickWand *wand, const double radius );\n</pre>\n</div>\n<div class=\"section\" id=\"id302\">\n<h2>Description</h2>\n<p>MagickReduceNoiseImage() smooths the contours of an image while still\npreserving edge information.  The algorithm works by replacing each pixel\nwith its neighbor closest in value.  A neighbor is defined by radius.  Use\na radius of 0 and ReduceNoise() selects a suitable radius for you.</p>\n<p>The format of the MagickReduceNoiseImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickReduceNoiseImage( MagickWand *wand, const double radius );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>The radius of the pixel neighborhood.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickrelinquishmemory\">\n<h1><a class=\"toc-backref\" href=\"#id625\">MagickRelinquishMemory</a></h1>\n<div class=\"section\" id=\"id303\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickRelinquishMemory( void *resource );\n</pre>\n</div>\n<div class=\"section\" id=\"id304\">\n<h2>Description</h2>\n<p>MagickRelinquishMemory() relinquishes memory resources returned by such\nmethods as MagickDescribeImage(), MagickGetException(), etc.</p>\n<p>The format of the MagickRelinquishMemory method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickRelinquishMemory( void *resource );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>resource:</dt>\n<dd>Relinquish the memory associated with this resource.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickremoveimage\">\n<h1><a class=\"toc-backref\" href=\"#id626\">MagickRemoveImage</a></h1>\n<div class=\"section\" id=\"id305\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickRemoveImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id306\">\n<h2>Description</h2>\n<p>MagickRemoveImage() removes an image from the image list.</p>\n<p>The format of the MagickRemoveImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickRemoveImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickremoveimageoption\">\n<h1><a class=\"toc-backref\" href=\"#id627\">MagickRemoveImageOption</a></h1>\n<div class=\"section\" id=\"id307\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickRemoveImageOption( MagickWand *wand, const char *format,\n                                      const char *key );\n</pre>\n</div>\n<div class=\"section\" id=\"id308\">\n<h2>Description</h2>\n<p>MagickRemoveImageOption() removes an image format-specific option from the\nthe image (.e.g MagickRemoveImageOption(wand,&quot;jpeg&quot;,&quot;preserve-settings&quot;).</p>\n<p>The format of the MagickRemoveImageOption method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickRemoveImageOption( MagickWand *wand, const char *format,\n                                      const char *key );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>format:</dt>\n<dd>The image format.</dd>\n<dt>key:</dt>\n<dd>The key.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickremoveimageprofile\">\n<h1><a class=\"toc-backref\" href=\"#id628\">MagickRemoveImageProfile</a></h1>\n<div class=\"section\" id=\"id309\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned char *MagickRemoveImageProfile( MagickWand *wand, const char *name,\n                                         unsigned long *length );\n</pre>\n</div>\n<div class=\"section\" id=\"id310\">\n<h2>Description</h2>\n<p>MagickRemoveImageProfile() removes the named image profile and returns it.</p>\n<p>The format of the MagickRemoveImageProfile method is:</p>\n<pre class=\"literal-block\">\nunsigned char *MagickRemoveImageProfile( MagickWand *wand, const char *name,\n                                         unsigned long *length );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>name:</dt>\n<dd>Name of profile to return: ICC, IPTC, or generic profile.</dd>\n<dt>length:</dt>\n<dd>The length of the profile.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickresetiterator\">\n<h1><a class=\"toc-backref\" href=\"#id629\">MagickResetIterator</a></h1>\n<div class=\"section\" id=\"id311\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nvoid MagickResetIterator( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id312\">\n<h2>Description</h2>\n<p>MagickReset() resets the wand iterator.  Use it in conjunction\nwith MagickNextImage() to iterate over all the images in a wand\ncontainer.</p>\n<p>The format of the MagickReset method is:</p>\n<pre class=\"literal-block\">\nvoid MagickResetIterator( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickresampleimage\">\n<h1><a class=\"toc-backref\" href=\"#id630\">MagickResampleImage</a></h1>\n<div class=\"section\" id=\"id313\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickResampleImage( MagickWand *wand, const double x_resolution,\n                                  const double y_resolution, const <a class=\"reference external\" href=\"../api/types.html#filtertype\">FilterTypes</a> filter,\n                                  const double blur );\n</pre>\n</div>\n<div class=\"section\" id=\"id314\">\n<h2>Description</h2>\n<p>MagickResampleImage() resample image to desired resolution.</p>\n<p>Bessel   Blackman   Box\nCatrom   Cubic      Gaussian\nHanning  Hermite    Lanczos\nMitchell Point      Quandratic\nSinc     Triangle</p>\n<p>Most of the filters are FIR (finite impulse response), however, Bessel,\nGaussian, and Sinc are IIR (infinite impulse response).  Bessel and Sinc\nare windowed (brought down to zero) with the Blackman filter.</p>\n<p>The format of the MagickResampleImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickResampleImage( MagickWand *wand, const double x_resolution,\n                                  const double y_resolution, const <a class=\"reference external\" href=\"../api/types.html#filtertype\">FilterTypes</a> filter,\n                                  const double blur );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x_resolution:</dt>\n<dd>The new image x resolution.</dd>\n<dt>y_resolution:</dt>\n<dd>The new image y resolution.</dd>\n<dt>filter:</dt>\n<dd>Image filter to use.</dd>\n<dt>blur:</dt>\n<dd>The blur factor where &gt; 1 is blurry, &lt; 1 is sharp.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickresizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id631\">MagickResizeImage</a></h1>\n<div class=\"section\" id=\"id315\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickResizeImage( MagickWand *wand, const unsigned long columns,\n                                const unsigned long rows, const <a class=\"reference external\" href=\"../api/types.html#filtertype\">FilterTypes</a> filter,\n                                const double blur );\n</pre>\n</div>\n<div class=\"section\" id=\"id316\">\n<h2>Description</h2>\n<p>MagickResizeImage() scales an image to the desired dimensions with one of\nthese filters:</p>\n<p>Bessel   Blackman   Box\nCatrom   Cubic      Gaussian\nHanning  Hermite    Lanczos\nMitchell Point      Quandratic\nSinc     Triangle</p>\n<p>Most of the filters are FIR (finite impulse response), however, Bessel,\nGaussian, and Sinc are IIR (infinite impulse response).  Bessel and Sinc\nare windowed (brought down to zero) with the Blackman filter.</p>\n<p>The format of the MagickResizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickResizeImage( MagickWand *wand, const unsigned long columns,\n                                const unsigned long rows, const <a class=\"reference external\" href=\"../api/types.html#filtertype\">FilterTypes</a> filter,\n                                const double blur );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>columns:</dt>\n<dd>The number of columns in the scaled image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the scaled image.</dd>\n<dt>filter:</dt>\n<dd>Image filter to use.</dd>\n<dt>blur:</dt>\n<dd>The blur factor where &gt; 1 is blurry, &lt; 1 is sharp.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickrollimage\">\n<h1><a class=\"toc-backref\" href=\"#id632\">MagickRollImage</a></h1>\n<div class=\"section\" id=\"id317\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickRollImage( MagickWand *wand, const long x_offset,\n                              const unsigned long y_offset );\n</pre>\n</div>\n<div class=\"section\" id=\"id318\">\n<h2>Description</h2>\n<p>MagickRollImage() offsets an image as defined by x_offset and y_offset.</p>\n<p>The format of the MagickRollImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickRollImage( MagickWand *wand, const long x_offset,\n                              const unsigned long y_offset );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x_offset:</dt>\n<dd>The x offset.</dd>\n<dt>y_offset:</dt>\n<dd>The y offset.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickrotateimage\">\n<h1><a class=\"toc-backref\" href=\"#id633\">MagickRotateImage</a></h1>\n<div class=\"section\" id=\"id319\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickRotateImage( MagickWand *wand, const PixelWand *background,\n                                const double degrees );\n</pre>\n</div>\n<div class=\"section\" id=\"id320\">\n<h2>Description</h2>\n<p>MagickRotateImage() rotates an image the specified number of degrees. Empty\ntriangles left over from rotating the image are filled with the\nbackground color.</p>\n<p>The format of the MagickRotateImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickRotateImage( MagickWand *wand, const PixelWand *background,\n                                const double degrees );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>background:</dt>\n<dd>The background pixel wand.</dd>\n<dt>degrees:</dt>\n<dd>The number of degrees to rotate the image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksampleimage\">\n<h1><a class=\"toc-backref\" href=\"#id634\">MagickSampleImage</a></h1>\n<div class=\"section\" id=\"id321\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSampleImage( MagickWand *wand, const unsigned long columns,\n                                const unsigned long rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id322\">\n<h2>Description</h2>\n<p>MagickSampleImage() scales an image to the desired dimensions with pixel\nsampling.  Unlike other scaling methods, this method does not introduce\nany additional color into the scaled image.</p>\n<p>The format of the MagickSampleImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSampleImage( MagickWand *wand, const unsigned long columns,\n                                const unsigned long rows );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>columns:</dt>\n<dd>The number of columns in the scaled image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the scaled image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickscaleimage\">\n<h1><a class=\"toc-backref\" href=\"#id635\">MagickScaleImage</a></h1>\n<div class=\"section\" id=\"id323\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickScaleImage( MagickWand *wand, const unsigned long columns,\n                               const unsigned long rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id324\">\n<h2>Description</h2>\n<p>MagickScaleImage() scales the size of an image to the given dimensions.</p>\n<p>The format of the MagickScaleImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickScaleImage( MagickWand *wand, const unsigned long columns,\n                               const unsigned long rows );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>columns:</dt>\n<dd>The number of columns in the scaled image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the scaled image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickseparateimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id636\">MagickSeparateImageChannel</a></h1>\n<div class=\"section\" id=\"id325\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSeparateImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel );\n</pre>\n</div>\n<div class=\"section\" id=\"id326\">\n<h2>Description</h2>\n<p>MagickChannelImage() separates a channel from the image and returns a\ngrayscale image.  A channel is a particular color component of each pixel\nin the image.</p>\n<p>The format of the MagickChannelImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSeparateImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to extract: RedChannel, GreenChannel,\nBlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel,\nBlackChannel.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetcompressionquality\">\n<h1><a class=\"toc-backref\" href=\"#id637\">MagickSetCompressionQuality</a></h1>\n<div class=\"section\" id=\"id327\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetCompressionQuality( MagickWand *wand, const unsigned long quality );\n</pre>\n</div>\n<div class=\"section\" id=\"id328\">\n<h2>Description</h2>\n<p>MagickSetCompressionQuality() sets the image quality factor, which\ndetermines compression options when saving the file.</p>\n<p>For the JPEG and MPEG image formats, quality is 0 (lowest image\nquality and highest compression) to 100 (best quality but least\neffective compression).  The default quality is 75.  Use the\n-sampling-factor option to specify the factors for chroma\ndownsampling.  To use the same quality value as that found by the\nJPEG decoder, use the -define jpeg:preserve-settings flag.</p>\n<p>For the MIFF image format, and the TIFF format while using ZIP\ncompression, quality/10 is the zlib compres- sion level, which is 0\n(worst but fastest compression) to 9 (best but slowest). It has no\neffect on the image appearance, since the compression is always\nlossless.</p>\n<p>For the JPEG-2000 image format, quality is mapped using a non-linear\nequation to the compression ratio required by the Jasper library.\nThis non-linear equation is intended to loosely approximate the\nquality provided by the JPEG v1 format.  The default quality value 75\nresults in a request for 16:1 compression. The quality value 100\nresults in a request for non-lossy compres- sion.</p>\n<p>For the MNG and PNG image formats, the quality value sets the zlib\ncompression level (quality / 10) and filter-type (quality % 10).\nCompression levels range from 0 (fastest compression) to 100 (best\nbut slowest).  For compression level 0, the Huffman-only strategy is\nused, which is fastest but not necessarily the worst compression.  If\nfilter-type is 4 or less, the specified filter-type is used for all\nscanlines:</p>\n<ol class=\"arabic simple\" start=\"0\">\n<li>none</li>\n<li>sub</li>\n<li>up</li>\n<li>average</li>\n<li>Paeth</li>\n</ol>\n<p>If filter-type is 5, adaptive filtering is used when quality is\ngreater than 50 and the image does not have a color map, otherwise no\nfiltering is used.</p>\n<p>If filter-type is 6, adaptive filtering with minimum-\nsum-of-absolute-values is used.</p>\n<p>Only if the output is MNG, if filter-type is 7, the LOCO color\ntransformation and adaptive filtering with\nminimum-sum-of-absolute-values are used.</p>\n<p>The default is quality is 75, which means nearly the best compression\nwith adaptive filtering.  The quality setting has no effect on the\nappearance of PNG and MNG images, since the compression is always\nlossless.</p>\n<p>For further information, see the PNG specification.</p>\n<p>When writing a JNG image with transparency, two quality values are\nrequired, one for the main image and one for the grayscale image that\nconveys the opacity channel.  These are written as a single integer\nequal to the main image quality plus 1000 times the opacity quality.\nFor example, if you want to use quality 75 for the main image and\nquality 90 to compress the opacity data, use -quality 90075.</p>\n<p>For the PNM family of formats (PNM, PGM, and PPM) specify a quality\nfactor of zero in order to obtain the ASCII variant of the\nformat. Note that -compress none used to be used to trigger ASCII\noutput but provided the opposite result of what was expected as\ncompared with other formats.</p>\n<p>The format of the MagickSetCompressionQuality method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetCompressionQuality( MagickWand *wand, const unsigned long quality );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>delay:</dt>\n<dd>The image quality.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetdepth\">\n<h1><a class=\"toc-backref\" href=\"#id638\">MagickSetDepth</a></h1>\n<div class=\"section\" id=\"id329\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetDepth( MagickWand *wand, const size_t depth );\n</pre>\n</div>\n<div class=\"section\" id=\"id330\">\n<h2>Description</h2>\n<p>MagickSetDepth() sets the sample depth to be used when reading from a\nraw image or a format which requires that the depth be specified in\nadvance by the user.</p>\n<p>The format of the MagickSetDepth method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetDepth( MagickWand *wand, const size_t depth );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>depth:</dt>\n<dd>The sample depth.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetfilename\">\n<h1><a class=\"toc-backref\" href=\"#id639\">MagickSetFilename</a></h1>\n<div class=\"section\" id=\"id331\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetFilename( MagickWand *wand, const char *filename );\n</pre>\n</div>\n<div class=\"section\" id=\"id332\">\n<h2>Description</h2>\n<p>MagickSetFilename() sets the filename before you read or write an image file.</p>\n<p>The format of the MagickSetFilename method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetFilename( MagickWand *wand, const char *filename );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>filename:</dt>\n<dd>The image filename.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetformat\">\n<h1><a class=\"toc-backref\" href=\"#id640\">MagickSetFormat</a></h1>\n<div class=\"section\" id=\"id333\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetFormat( MagickWand *wand, const char *format );\n</pre>\n</div>\n<div class=\"section\" id=\"id334\">\n<h2>Description</h2>\n<p>MagickSetFormat() sets the file or blob format (e.g. &quot;BMP&quot;) to be used\nwhen a file or blob is read.  Usually this is not necessary because\nGraphicsMagick is able to auto-detect the format based on the file\nheader (or the file extension), but some formats do not use a unique\nheader or the selection may be ambigious. Use MagickSetImageFormat()\nto set the format to be used when a file or blob is to be written.</p>\n<p>The format of the MagickSetFormat method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetFormat( MagickWand *wand, const char *format );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>filename:</dt>\n<dd>The file or blob format.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimage\">\n<h1><a class=\"toc-backref\" href=\"#id641\">MagickSetImage</a></h1>\n<div class=\"section\" id=\"id335\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImage( MagickWand *wand, const MagickWand *set_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id336\">\n<h2>Description</h2>\n<p>MagickSetImage() replaces the last image returned by MagickSetImageIndex(),\nMagickNextImage(), MagickPreviousImage() with the images from the specified\nwand.</p>\n<p>The format of the MagickSetImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImage( MagickWand *wand, const MagickWand *set_wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>set_wand:</dt>\n<dd>The set_wand wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageattribute\">\n<h1><a class=\"toc-backref\" href=\"#id642\">MagickSetImageAttribute</a></h1>\n<div class=\"section\" id=\"id337\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageAttribute( MagickWand *wand, const char *name,\n                                      const char *value );\n</pre>\n</div>\n<div class=\"section\" id=\"id338\">\n<h2>Description</h2>\n<p>MagickSetImageAttribute sets an image attribute</p>\n<p>The format of the MagickSetImageAttribute method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageAttribute( MagickWand *wand, const char *name,\n                                      const char *value );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>name:</dt>\n<dd>The name of the attribute</dd>\n<dt>value:</dt>\n<dd>The value of the attribute</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagebackgroundcolor\">\n<h1><a class=\"toc-backref\" href=\"#id643\">MagickSetImageBackgroundColor</a></h1>\n<div class=\"section\" id=\"id339\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageBackgroundColor( MagickWand *wand, const PixelWand *background );\n</pre>\n</div>\n<div class=\"section\" id=\"id340\">\n<h2>Description</h2>\n<p>MagickSetImageBackgroundColor() sets the image background color.</p>\n<p>The format of the MagickSetImageBackgroundColor method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageBackgroundColor( MagickWand *wand, const PixelWand *background );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>background:</dt>\n<dd>The background pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageblueprimary\">\n<h1><a class=\"toc-backref\" href=\"#id644\">MagickSetImageBluePrimary</a></h1>\n<div class=\"section\" id=\"id341\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageBluePrimary( MagickWand *wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id342\">\n<h2>Description</h2>\n<p>MagickSetImageBluePrimary() sets the image chromaticity blue primary point.</p>\n<p>The format of the MagickSetImageBluePrimary method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageBluePrimary( MagickWand *wand, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x:</dt>\n<dd>The blue primary x-point.</dd>\n<dt>y:</dt>\n<dd>The blue primary y-point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagebordercolor\">\n<h1><a class=\"toc-backref\" href=\"#id645\">MagickSetImageBorderColor</a></h1>\n<div class=\"section\" id=\"id343\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageBorderColor( MagickWand *wand, const PixelWand *border );\n</pre>\n</div>\n<div class=\"section\" id=\"id344\">\n<h2>Description</h2>\n<p>MagickSetImageBorderColor() sets the image border color.</p>\n<p>The format of the MagickSetImageBorderColor method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageBorderColor( MagickWand *wand, const PixelWand *border );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>border:</dt>\n<dd>The border pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagecolormapcolor\">\n<h1><a class=\"toc-backref\" href=\"#id646\">MagickSetImageColormapColor</a></h1>\n<div class=\"section\" id=\"id345\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageColormapColor( MagickWand *wand, const unsigned long index,\n                                          const PixelWand *color );\n</pre>\n</div>\n<div class=\"section\" id=\"id346\">\n<h2>Description</h2>\n<p>MagickSetImageColormapColor() sets the color of the specified colormap\nindex.</p>\n<p>The format of the MagickSetImageColormapColor method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageColormapColor( MagickWand *wand, const unsigned long index,\n                                          const PixelWand *color );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>index:</dt>\n<dd>The offset into the image colormap.</dd>\n<dt>color:</dt>\n<dd>Return the colormap color in this wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagecolorspace\">\n<h1><a class=\"toc-backref\" href=\"#id647\">MagickSetImageColorspace</a></h1>\n<div class=\"section\" id=\"id347\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageColorspace( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> colorspace );\n</pre>\n</div>\n<div class=\"section\" id=\"id348\">\n<h2>Description</h2>\n<p>MagickSetImageColorspace() sets the image colorspace.</p>\n<p>The format of the MagickSetImageColorspace method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageColorspace( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#colorspacetype\">ColorspaceType</a> colorspace );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>colorspace:</dt>\n<dd>The image colorspace:   UndefinedColorspace, RGBColorspace,\nGRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace,\nYCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace,\nYPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace,\nHSLColorspace, or HWBColorspace.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagecompose\">\n<h1><a class=\"toc-backref\" href=\"#id648\">MagickSetImageCompose</a></h1>\n<div class=\"section\" id=\"id349\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageCompose( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> compose );\n</pre>\n</div>\n<div class=\"section\" id=\"id350\">\n<h2>Description</h2>\n<p>MagickSetImageCompose() sets the image composite operator, useful for\nspecifying how to composite the image thumbnail when using the\nMagickMontageImage() method.</p>\n<p>The format of the MagickSetImageCompose method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageCompose( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#compositeoperator\">CompositeOperator</a> compose );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>compose:</dt>\n<dd>The image composite operator.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagecompression\">\n<h1><a class=\"toc-backref\" href=\"#id649\">MagickSetImageCompression</a></h1>\n<div class=\"section\" id=\"id351\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageCompression( MagickWand *wand,\n                                        const <a class=\"reference external\" href=\"../api/types.html#compressiontype\">CompressionType</a> compression );\n</pre>\n</div>\n<div class=\"section\" id=\"id352\">\n<h2>Description</h2>\n<p>MagickSetImageCompression() sets the image compression.</p>\n<p>The format of the MagickSetImageCompression method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageCompression( MagickWand *wand,\n                                        const <a class=\"reference external\" href=\"../api/types.html#compressiontype\">CompressionType</a> compression );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>compression:</dt>\n<dd>The image compression type.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagedelay\">\n<h1><a class=\"toc-backref\" href=\"#id650\">MagickSetImageDelay</a></h1>\n<div class=\"section\" id=\"id353\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageDelay( MagickWand *wand, const unsigned long delay );\n</pre>\n</div>\n<div class=\"section\" id=\"id354\">\n<h2>Description</h2>\n<p>MagickSetImageDelay() sets the image delay.</p>\n<p>The format of the MagickSetImageDelay method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageDelay( MagickWand *wand, const unsigned long delay );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>delay:</dt>\n<dd>The image delay in 1/100th of a second.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagechanneldepth\">\n<h1><a class=\"toc-backref\" href=\"#id651\">MagickSetImageChannelDepth</a></h1>\n<div class=\"section\" id=\"id355\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageChannelDepth( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                         const unsigned long depth );\n</pre>\n</div>\n<div class=\"section\" id=\"id356\">\n<h2>Description</h2>\n<p>MagickSetImageChannelDepth() sets the depth of a particular image channel.</p>\n<p>The format of the MagickSetImageChannelDepth method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageChannelDepth( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                         const unsigned long depth );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>Identify which channel to extract: RedChannel, GreenChannel,\nBlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel,\nBlackChannel.</dd>\n<dt>depth:</dt>\n<dd>The image depth in bits.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagedepth\">\n<h1><a class=\"toc-backref\" href=\"#id652\">MagickSetImageDepth</a></h1>\n<div class=\"section\" id=\"id357\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageDepth( MagickWand *wand, const unsigned long depth );\n</pre>\n</div>\n<div class=\"section\" id=\"id358\">\n<h2>Description</h2>\n<p>MagickSetImageDepth() sets the image depth.</p>\n<p>The format of the MagickSetImageDepth method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageDepth( MagickWand *wand, const unsigned long depth );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>depth:</dt>\n<dd>The image depth in bits: 8, 16, or 32.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagedispose\">\n<h1><a class=\"toc-backref\" href=\"#id653\">MagickSetImageDispose</a></h1>\n<div class=\"section\" id=\"id359\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageDispose( MagickWand *wand, const DisposeType dispose );\n</pre>\n</div>\n<div class=\"section\" id=\"id360\">\n<h2>Description</h2>\n<p>MagickSetImageDispose() sets the image disposal method.</p>\n<p>The format of the MagickSetImageDispose method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageDispose( MagickWand *wand, const DisposeType dispose );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>dispose:</dt>\n<dd>The image disposeal type.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagefilename\">\n<h1><a class=\"toc-backref\" href=\"#id654\">MagickSetImageFilename</a></h1>\n<div class=\"section\" id=\"id361\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageFilename( MagickWand *wand, const char *filename );\n</pre>\n</div>\n<div class=\"section\" id=\"id362\">\n<h2>Description</h2>\n<p>MagickSetImageFilename() sets the filename of a particular image in a\nsequence.</p>\n<p>The format of the MagickSetImageFilename method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageFilename( MagickWand *wand, const char *filename );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>filename:</dt>\n<dd>The image filename.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageformat\">\n<h1><a class=\"toc-backref\" href=\"#id655\">MagickSetImageFormat</a></h1>\n<div class=\"section\" id=\"id363\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageFormat( MagickWand *wand, const char *format );\n</pre>\n</div>\n<div class=\"section\" id=\"id364\">\n<h2>Description</h2>\n<p>MagickSetImageFormat() sets the format of a particular image in a\nsequence.  The format is designated by a magick string (e.g. &quot;GIF&quot;).</p>\n<p>The format of the MagickSetImageFormat method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageFormat( MagickWand *wand, const char *format );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>magick:</dt>\n<dd>The image format.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagefuzz\">\n<h1><a class=\"toc-backref\" href=\"#id656\">MagickSetImageFuzz</a></h1>\n<div class=\"section\" id=\"id365\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageFuzz( MagickWand *wand, const double fuzz );\n</pre>\n</div>\n<div class=\"section\" id=\"id366\">\n<h2>Description</h2>\n<p>MagickSetImageFuzz() sets the color comparison fuzz factor.  Colors\ncloser than the fuzz factor are considered to be the same when comparing\ncolors.  Note that some other functions such as MagickColorFloodfillImage()\nimplicitly set this value.</p>\n<p>The format of the MagickSetImageFuzz method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageFuzz( MagickWand *wand, const double fuzz );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>fuzz:</dt>\n<dd>The color comparison fuzz factor</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagegamma\">\n<h1><a class=\"toc-backref\" href=\"#id657\">MagickSetImageGamma</a></h1>\n<div class=\"section\" id=\"id367\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageGamma( MagickWand *wand, const double gamma );\n</pre>\n</div>\n<div class=\"section\" id=\"id368\">\n<h2>Description</h2>\n<p>MagickSetImageGamma() sets the image gamma.</p>\n<p>The format of the MagickSetImageGamma method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageGamma( MagickWand *wand, const double gamma );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>gamma:</dt>\n<dd>The image gamma.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagegravity\">\n<h1><a class=\"toc-backref\" href=\"#id658\">MagickSetImageGravity</a></h1>\n<div class=\"section\" id=\"id369\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageGravity( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> );\n</pre>\n</div>\n<div class=\"section\" id=\"id370\">\n<h2>Description</h2>\n<p>MagickSetImageGravity() sets the image gravity.  This is used\nwhen evaluating regions defined by a geometry and the image\ndimensions.  It may be used in conjunction with operations which\nuse a geometry parameter to adjust the x, y parameters of the\nfinal operation. Gravity is used in composition to determine where\nthe image should be placed within the defined geometry region.\nIt may be used with montage to effect placement of the image within\nthe tile.</p>\n<p>The format of the MagickSetImageGravity method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageGravity( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#gravitytype\">GravityType</a> );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>gravity:</dt>\n<dd>The image gravity.  Available values are ForgetGravity,\nNorthWestGravity, NorthGravity, NorthEastGravity, WestGravity,\nCenterGravity, EastGravity, SouthWestGravity, SouthGravity,\nSouthEastGravity, and StaticGravity</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagegreenprimary\">\n<h1><a class=\"toc-backref\" href=\"#id659\">MagickSetImageGreenPrimary</a></h1>\n<div class=\"section\" id=\"id371\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageGreenPrimary( MagickWand *wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id372\">\n<h2>Description</h2>\n<p>MagickSetImageGreenPrimary() sets the image chromaticity green primary\npoint.</p>\n<p>The format of the MagickSetImageGreenPrimary method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageGreenPrimary( MagickWand *wand, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x:</dt>\n<dd>The green primary x-point.</dd>\n<dt>y:</dt>\n<dd>The green primary y-point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageindex\">\n<h1><a class=\"toc-backref\" href=\"#id660\">MagickSetImageIndex</a></h1>\n<div class=\"section\" id=\"id373\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageIndex( MagickWand *wand, const long index );\n</pre>\n</div>\n<div class=\"section\" id=\"id374\">\n<h2>Description</h2>\n<p>MagickSetImageIndex() set the current image to the position of the list\nspecified with the index parameter.</p>\n<p>The format of the MagickSetImageIndex method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageIndex( MagickWand *wand, const long index );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>index:</dt>\n<dd>The scene number.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageinterlacescheme\">\n<h1><a class=\"toc-backref\" href=\"#id661\">MagickSetImageInterlaceScheme</a></h1>\n<div class=\"section\" id=\"id375\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageInterlaceScheme( MagickWand *wand,\n                                            const <a class=\"reference external\" href=\"../api/types.html#interlacetype\">InterlaceType</a> interlace_scheme );\n</pre>\n</div>\n<div class=\"section\" id=\"id376\">\n<h2>Description</h2>\n<p>MagickSetImageInterlaceScheme() sets the image interlace scheme.  Please\nuse SetInterlaceScheme() instead to change the interlace scheme used when\nwriting the image.</p>\n<p>The format of the MagickSetImageInterlaceScheme method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageInterlaceScheme( MagickWand *wand,\n                                            const <a class=\"reference external\" href=\"../api/types.html#interlacetype\">InterlaceType</a> interlace_scheme );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>interlace_scheme:</dt>\n<dd>The image interlace scheme: NoInterlace, LineInterlace,\nPlaneInterlace, PartitionInterlace.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageiterations\">\n<h1><a class=\"toc-backref\" href=\"#id662\">MagickSetImageIterations</a></h1>\n<div class=\"section\" id=\"id377\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageIterations( MagickWand *wand, const unsigned long iterations );\n</pre>\n</div>\n<div class=\"section\" id=\"id378\">\n<h2>Description</h2>\n<p>MagickSetImageIterations() sets the image iterations.</p>\n<p>The format of the MagickSetImageIterations method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageIterations( MagickWand *wand, const unsigned long iterations );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>delay:</dt>\n<dd>The image delay in 1/100th of a second.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagemattecolor\">\n<h1><a class=\"toc-backref\" href=\"#id663\">MagickSetImageMatteColor</a></h1>\n<div class=\"section\" id=\"id379\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageMatteColor( MagickWand *wand, const PixelWand *matte );\n</pre>\n</div>\n<div class=\"section\" id=\"id380\">\n<h2>Description</h2>\n<p>MagickSetImageMatteColor() sets the image matte color.</p>\n<p>The format of the MagickSetImageMatteColor method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageMatteColor( MagickWand *wand, const PixelWand *matte );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>matte:</dt>\n<dd>The matte pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageoption\">\n<h1><a class=\"toc-backref\" href=\"#id664\">MagickSetImageOption</a></h1>\n<div class=\"section\" id=\"id381\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageOption( MagickWand *wand, const char *format, const char *key,\n                                   const char *value );\n</pre>\n</div>\n<div class=\"section\" id=\"id382\">\n<h2>Description</h2>\n<p>MagickSetImageOption() associates one or options with a particular image\nformat (.e.g MagickSetImageOption(wand,&quot;jpeg&quot;,&quot;preserve-settings&quot;,&quot;true&quot;).</p>\n<p>The format of the MagickSetImageOption method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageOption( MagickWand *wand, const char *format, const char *key,\n                                   const char *value );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>format:</dt>\n<dd>The image format.</dd>\n<dt>key:</dt>\n<dd>The key.</dd>\n<dt>value:</dt>\n<dd>The value.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageorientation\">\n<h1><a class=\"toc-backref\" href=\"#id665\">MagickSetImageOrientation</a></h1>\n<div class=\"section\" id=\"id383\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickSetImageOrientation( MagickWand *wand, OrientationType new_orientation );\n</pre>\n</div>\n<div class=\"section\" id=\"id384\">\n<h2>Description</h2>\n<p>MagickSetImageOrientation() sets the internal image orientation type.\nThe EXIF orientation tag will be updated if present.</p>\n<p>The format of the MagickSetImageOrientation method is:</p>\n<pre class=\"literal-block\">\nMagickSetImageOrientation( MagickWand *wand, OrientationType new_orientation );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>new_orientation:</dt>\n<dd>The new orientation of the image. One of:</dd>\n</dl>\n<p>UndefinedOrientation    Image orientation not specified.\nTopLeftOrientation      Left to right and Top to bottom.\nTopRightOrientation     Right to left  and Top to bottom.\nBottomRightOrientation  Right to left and Bottom to top.\nBottomLeftOrientation   Left to right and Bottom to top.\nLeftTopOrientation      Top to bottom and Left to right.\nRightTopOrientation     Top to bottom and Right to left.\nRightBottomOrientation  Bottom to top and Right to left.\nLeftBottomOrientation   Bottom to top and Left to right.</p>\n<p>Returns True on success, False otherwise.</p>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagepage\">\n<h1><a class=\"toc-backref\" href=\"#id666\">MagickSetImagePage</a></h1>\n<div class=\"section\" id=\"id385\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImagePage( MagickWand *wand, const unsigned long width,\n                                 const unsigned long height, const long x, const long y );\n</pre>\n</div>\n<div class=\"section\" id=\"id386\">\n<h2>Description</h2>\n<p>MagickSetImagePage() sets the image page size and offset used when\nplacing (e.g. compositing) the image.  Pass all zeros for the\ndefault placement.</p>\n<p>The format of the MagickSetImagePage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImagePage( MagickWand *wand, const unsigned long width,\n                                 const unsigned long height, const long x, const long y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>width, height:</dt>\n<dd>The region size.</dd>\n<dt>x, y:</dt>\n<dd>Offset (from top left) on base canvas image on\nwhich to composite image data.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagepixels\">\n<h1><a class=\"toc-backref\" href=\"#id667\">MagickSetImagePixels</a></h1>\n<div class=\"section\" id=\"id387\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImagePixels( MagickWand *wand, const long x_offset, const long y_offset,\n                                   const unsigned long columns, const unsigned long rows,\n                                   const char *map, const <a class=\"reference external\" href=\"../api/types.html#storagetype\">StorageType</a> storage,\n                                   unsigned char *pixels );\n</pre>\n</div>\n<div class=\"section\" id=\"id388\">\n<h2>Description</h2>\n<p>MagickSetImagePixels() accepts pixel data and stores it in the image at the\nlocation you specify.  The method returns False on success otherwise True\nif an error is encountered.  The pixel data can be either char, short int,\nint, long, float, or double in the order specified by map.</p>\n<p>Suppose your want want to upload the first scanline of a 640x480 image from\ncharacter data in red-green-blue order:</p>\n<p>MagickSetImagePixels(wand,0,0,0,640,1,&quot;RGB&quot;,CharPixel,pixels);</p>\n<p>The format of the MagickSetImagePixels method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImagePixels( MagickWand *wand, const long x_offset, const long y_offset,\n                                   const unsigned long columns, const unsigned long rows,\n                                   const char *map, const <a class=\"reference external\" href=\"../api/types.html#storagetype\">StorageType</a> storage,\n                                   unsigned char *pixels );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x_offset, y_offset:</dt>\n<dd>Offset (from top left) on base canvas image on\nwhich to composite image data.</dd>\n<dt>columns, rows:</dt>\n<dd>Dimensions of image.</dd>\n<dt>map:</dt>\n<dd>This string reflects the expected ordering of the pixel array.\nIt can be any combination or order of R = red, G = green, B = blue,\nA = alpha (same as Transparency), O = Opacity, T = Transparency,\nC = cyan, Y = yellow, M = magenta, K = black, or I = intensity\n(for grayscale). Specify &quot;P&quot; = pad, to skip over a quantum which is\nintentionally ignored. Creation of an alpha channel for CMYK images\nis currently not supported.</dd>\n<dt>storage:</dt>\n<dd>Define the data type of the pixels.  Float and double types are\nexpected to be normalized [0..1] otherwise [0..MaxRGB].  Choose from\nthese types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,\nor DoublePixel.</dd>\n<dt>pixels:</dt>\n<dd>This array of values contain the pixel components as defined by\nmap and type.  You must preallocate this array where the expected\nlength varies depending on the values of width, height, map, and type.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageprofile\">\n<h1><a class=\"toc-backref\" href=\"#id668\">MagickSetImageProfile</a></h1>\n<div class=\"section\" id=\"id389\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageProfile( MagickWand *wand, const char *name,\n                                    const unsigned char *profile,\n                                    const unsigned long length );\n</pre>\n</div>\n<div class=\"section\" id=\"id390\">\n<h2>Description</h2>\n<p>MagickSetImageProfile() adds a named profile to the magick wand.  If a\nprofile with the same name already exists, it is replaced.  This method\ndiffers from the MagickProfileImage() method in that it does not apply any\nCMS color profiles.</p>\n<p>The format of the MagickSetImageProfile method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageProfile( MagickWand *wand, const char *name,\n                                    const unsigned char *profile,\n                                    const unsigned long length );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>name:</dt>\n<dd>Name of profile to add or remove: ICC, IPTC, or generic profile.</dd>\n<dt>profile:</dt>\n<dd>The profile.</dd>\n<dt>length:</dt>\n<dd>The length of the profile.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageredprimary\">\n<h1><a class=\"toc-backref\" href=\"#id669\">MagickSetImageRedPrimary</a></h1>\n<div class=\"section\" id=\"id391\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageRedPrimary( MagickWand *wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id392\">\n<h2>Description</h2>\n<p>MagickSetImageRedPrimary() sets the image chromaticity red primary point.</p>\n<p>The format of the MagickSetImageRedPrimary method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageRedPrimary( MagickWand *wand, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x:</dt>\n<dd>The red primary x-point.</dd>\n<dt>y:</dt>\n<dd>The red primary y-point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagerenderingintent\">\n<h1><a class=\"toc-backref\" href=\"#id670\">MagickSetImageRenderingIntent</a></h1>\n<div class=\"section\" id=\"id393\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageRenderingIntent( MagickWand *wand,\n                                            const <a class=\"reference external\" href=\"../api/types.html#renderingintent\">RenderingIntent</a> rendering_intent );\n</pre>\n</div>\n<div class=\"section\" id=\"id394\">\n<h2>Description</h2>\n<p>MagickSetImageRenderingIntent() sets the image rendering intent.</p>\n<p>The format of the MagickSetImageRenderingIntent method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageRenderingIntent( MagickWand *wand,\n                                            const <a class=\"reference external\" href=\"../api/types.html#renderingintent\">RenderingIntent</a> rendering_intent );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>rendering_intent:</dt>\n<dd>The image rendering intent: UndefinedIntent,\nSaturationIntent, PerceptualIntent, AbsoluteIntent, or RelativeIntent.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageresolution\">\n<h1><a class=\"toc-backref\" href=\"#id671\">MagickSetImageResolution</a></h1>\n<div class=\"section\" id=\"id395\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageResolution( MagickWand *wand, const double x_resolution,\n                                       const doubtl y_resolution );\n</pre>\n</div>\n<div class=\"section\" id=\"id396\">\n<h2>Description</h2>\n<p>MagickSetImageResolution() sets the image resolution.</p>\n<p>The format of the MagickSetImageResolution method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageResolution( MagickWand *wand, const double x_resolution,\n                                       const doubtl y_resolution );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x_resolution:</dt>\n<dd>The image x resolution.</dd>\n<dt>y_resolution:</dt>\n<dd>The image y resolution.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagescene\">\n<h1><a class=\"toc-backref\" href=\"#id672\">MagickSetImageScene</a></h1>\n<div class=\"section\" id=\"id397\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageScene( MagickWand *wand, const unsigned long scene );\n</pre>\n</div>\n<div class=\"section\" id=\"id398\">\n<h2>Description</h2>\n<p>MagickSetImageScene() sets the image scene.</p>\n<p>The format of the MagickSetImageScene method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageScene( MagickWand *wand, const unsigned long scene );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>delay:</dt>\n<dd>The image scene number.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagetype\">\n<h1><a class=\"toc-backref\" href=\"#id673\">MagickSetImageType</a></h1>\n<div class=\"section\" id=\"id399\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageType( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> image_type );\n</pre>\n</div>\n<div class=\"section\" id=\"id400\">\n<h2>Description</h2>\n<p>MagickSetImageType() sets the image type.</p>\n<p>The format of the MagickSetImageType method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageType( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> image_type );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>image_type:</dt>\n<dd>The image type:   UndefinedType, BilevelType, GrayscaleType,\nGrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,\nTrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,\nor OptimizeType.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagesavedtype\">\n<h1><a class=\"toc-backref\" href=\"#id674\">MagickSetImageSavedType</a></h1>\n<div class=\"section\" id=\"id401\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageSavedType( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> image_type );\n</pre>\n</div>\n<div class=\"section\" id=\"id402\">\n<h2>Description</h2>\n<p>MagickSetImageSavedType() sets the image type that will be used when the\nimage is saved.</p>\n<p>The format of the MagickSetImageSavedType method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageSavedType( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#imagetype\">ImageType</a> image_type );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>image_type:</dt>\n<dd>The image type:   UndefinedType, BilevelType, GrayscaleType,\nGrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,\nTrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,\nor OptimizeType.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimageunits\">\n<h1><a class=\"toc-backref\" href=\"#id675\">MagickSetImageUnits</a></h1>\n<div class=\"section\" id=\"id403\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageUnits( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#resolutiontype\">ResolutionType</a> units );\n</pre>\n</div>\n<div class=\"section\" id=\"id404\">\n<h2>Description</h2>\n<p>MagickSetImageUnits() sets the image units of resolution.</p>\n<p>The format of the MagickSetImageUnits method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageUnits( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#resolutiontype\">ResolutionType</a> units );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>units:</dt>\n<dd>The image units of resolution : Undefinedresolution,\nPixelsPerInchResolution, or PixelsPerCentimeterResolution.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagevirtualpixelmethod\">\n<h1><a class=\"toc-backref\" href=\"#id676\">MagickSetImageVirtualPixelMethod</a></h1>\n<div class=\"section\" id=\"id405\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageVirtualPixelMethod( MagickWand *wand,\n                                               const <a class=\"reference external\" href=\"../api/types.html#virtualpixelmethod\">VirtualPixelMethod</a> method );\n</pre>\n</div>\n<div class=\"section\" id=\"id406\">\n<h2>Description</h2>\n<p>MagickSetImageVirtualPixelMethod() sets the image virtual pixel method.</p>\n<p>The format of the MagickSetImageVirtualPixelMethod method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageVirtualPixelMethod( MagickWand *wand,\n                                               const <a class=\"reference external\" href=\"../api/types.html#virtualpixelmethod\">VirtualPixelMethod</a> method );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>method:</dt>\n<dd>The image virtual pixel method : UndefinedVirtualPixelMethod,\nConstantVirtualPixelMethod,  EdgeVirtualPixelMethod,\nMirrorVirtualPixelMethod, or TileVirtualPixelMethod.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetinterlacescheme\">\n<h1><a class=\"toc-backref\" href=\"#id677\">MagickSetInterlaceScheme</a></h1>\n<div class=\"section\" id=\"id407\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetInterlaceScheme( MagickWand *wand,\n                                       const <a class=\"reference external\" href=\"../api/types.html#interlacetype\">InterlaceType</a> interlace_scheme );\n</pre>\n</div>\n<div class=\"section\" id=\"id408\">\n<h2>Description</h2>\n<p>MagickSetInterlaceScheme() sets the interlace scheme used when writing\nthe image.</p>\n<p>The format of the MagickSetInterlaceScheme method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetInterlaceScheme( MagickWand *wand,\n                                       const <a class=\"reference external\" href=\"../api/types.html#interlacetype\">InterlaceType</a> interlace_scheme );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>interlace_scheme:</dt>\n<dd>The image interlace scheme: NoInterlace, LineInterlace,\nPlaneInterlace, PartitionInterlace.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetresolution\">\n<h1><a class=\"toc-backref\" href=\"#id678\">MagickSetResolution</a></h1>\n<div class=\"section\" id=\"id409\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetResolution( MagickWand *wand, const double x_resolution,\n                                  const double y_resolution );\n</pre>\n</div>\n<div class=\"section\" id=\"id410\">\n<h2>Description</h2>\n<p>MagickSetResolution() sets the resolution (density) of the magick wand.\nSet it before you read an EPS, PDF, or Postscript file in order to\ninfluence the size of the returned image, or after an image has already\nbeen created to influence the rendered image size when used with\ntypesetting software.</p>\n<p>Also see MagickSetResolutionUnits() which specifies the units to use for\nthe image resolution.</p>\n<p>The format of the MagickSetResolution method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetResolution( MagickWand *wand, const double x_resolution,\n                                  const double y_resolution );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x_resolution:</dt>\n<dd>The horizontal resolution</dd>\n<dt>y_resolution:</dt>\n<dd>The vertical reesolution</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetresolutionunits\">\n<h1><a class=\"toc-backref\" href=\"#id679\">MagickSetResolutionUnits</a></h1>\n<div class=\"section\" id=\"id411\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetResolutionUnits( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#resolutiontype\">ResolutionType</a> units );\n</pre>\n</div>\n<div class=\"section\" id=\"id412\">\n<h2>Description</h2>\n<p>MagickSetResolutionUnits() sets the resolution units of the magick wand.\nIt should be used in conjunction with MagickSetResolution().\nThis method works both before and after an image has been read.</p>\n<p>Also see MagickSetImageUnits() which specifies the units which apply to\nthe image resolution setting after an image has been read.</p>\n<p>The format of the MagickSetResolutionUnits method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetResolutionUnits( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#resolutiontype\">ResolutionType</a> units );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>units:</dt>\n<dd>The image units of resolution : Undefinedresolution,\nPixelsPerInchResolution, or PixelsPerCentimeterResolution.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetresourcelimit\">\n<h1><a class=\"toc-backref\" href=\"#id680\">MagickSetResourceLimit</a></h1>\n<div class=\"section\" id=\"id413\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetResourceLimit( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type, const unsigned long *limit );\n</pre>\n</div>\n<div class=\"section\" id=\"id414\">\n<h2>Description</h2>\n<p>MagickSetResourceLimit() sets the limit for a particular resource in\nmegabytes.</p>\n<p>The format of the MagickSetResourceLimit method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetResourceLimit( const <a class=\"reference external\" href=\"../api/types.html#resourcetype\">ResourceType</a> type, const unsigned long *limit );\n</pre>\n<dl class=\"docutils\">\n<dt>type:</dt>\n<dd>The type of resource: DiskResource, FileResource, MapResource,\nMemoryResource, PixelsResource, ThreadsResource, WidthResource,\nHeightResource.</dd>\n</dl>\n<p>o The maximum limit for the resource.</p>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetsamplingfactors\">\n<h1><a class=\"toc-backref\" href=\"#id681\">MagickSetSamplingFactors</a></h1>\n<div class=\"section\" id=\"id415\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetSamplingFactors( MagickWand *wand, const unsigned long number_factors,\n                                       const double *sampling_factors );\n</pre>\n</div>\n<div class=\"section\" id=\"id416\">\n<h2>Description</h2>\n<p>MagickSetSamplingFactors() sets the image sampling factors.</p>\n<p>The format of the MagickSetSamplingFactors method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetSamplingFactors( MagickWand *wand, const unsigned long number_factors,\n                                       const double *sampling_factors );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>number_factoes:</dt>\n<dd>The number of factors.</dd>\n<dt>sampling_factors:</dt>\n<dd>An array of doubles representing the sampling factor\nfor each color component (in RGB order).</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetsize\">\n<h1><a class=\"toc-backref\" href=\"#id682\">MagickSetSize</a></h1>\n<div class=\"section\" id=\"id417\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetSize( MagickWand *wand, const unsigned long columns,\n                            const unsigned long rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id418\">\n<h2>Description</h2>\n<p>MagickSetSize() sets the size of the magick wand.  Set it before you\nread a raw image format such as RGB, GRAY, or CMYK.</p>\n<p>The format of the MagickSetSize method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetSize( MagickWand *wand, const unsigned long columns,\n                            const unsigned long rows );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>columns:</dt>\n<dd>The width in pixels.</dd>\n<dt>height:</dt>\n<dd>The height in pixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetimagewhitepoint\">\n<h1><a class=\"toc-backref\" href=\"#id683\">MagickSetImageWhitePoint</a></h1>\n<div class=\"section\" id=\"id419\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageWhitePoint( MagickWand *wand, const double x, const double y );\n</pre>\n</div>\n<div class=\"section\" id=\"id420\">\n<h2>Description</h2>\n<p>MagickSetImageWhitePoint() sets the image chromaticity white point.</p>\n<p>The format of the MagickSetImageWhitePoint method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetImageWhitePoint( MagickWand *wand, const double x, const double y );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>x:</dt>\n<dd>The white x-point.</dd>\n<dt>y:</dt>\n<dd>The white y-point.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksetpassphrase\">\n<h1><a class=\"toc-backref\" href=\"#id684\">MagickSetPassphrase</a></h1>\n<div class=\"section\" id=\"id421\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSetPassphrase( MagickWand *wand, const char *passphrase );\n</pre>\n</div>\n<div class=\"section\" id=\"id422\">\n<h2>Description</h2>\n<p>MagickSetPassphrase() sets the passphrase.</p>\n<p>The format of the MagickSetPassphrase method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSetPassphrase( MagickWand *wand, const char *passphrase );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>passphrase:</dt>\n<dd>The passphrase.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksharpenimage\">\n<h1><a class=\"toc-backref\" href=\"#id685\">MagickSharpenImage</a></h1>\n<div class=\"section\" id=\"id423\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSharpenImage( MagickWand *wand, const double radius, const double sigma );\n</pre>\n</div>\n<div class=\"section\" id=\"id424\">\n<h2>Description</h2>\n<p>MagickSharpenImage() sharpens an image.  We convolve the image with a Gaussian\noperator of the given radius and standard deviation (sigma).\nFor reasonable results, the radius should be larger than sigma.  Use a\nradius of 0 and SharpenImage() selects a suitable radius for you.</p>\n<p>The format of the MagickSharpenImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSharpenImage( MagickWand *wand, const double radius, const double sigma );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickshaveimage\">\n<h1><a class=\"toc-backref\" href=\"#id686\">MagickShaveImage</a></h1>\n<div class=\"section\" id=\"id425\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickShaveImage( MagickWand *wand, const unsigned long columns,\n                               const unsigned long rows );\n</pre>\n</div>\n<div class=\"section\" id=\"id426\">\n<h2>Description</h2>\n<p>MagickShaveImage() shaves pixels from the image edges.  It allocates the\nmemory necessary for the new Image structure and returns a pointer to the\nnew image.</p>\n<p>The format of the MagickShaveImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickShaveImage( MagickWand *wand, const unsigned long columns,\n                               const unsigned long rows );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>columns:</dt>\n<dd>The number of columns in the scaled image.</dd>\n<dt>rows:</dt>\n<dd>The number of rows in the scaled image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickshearimage\">\n<h1><a class=\"toc-backref\" href=\"#id687\">MagickShearImage</a></h1>\n<div class=\"section\" id=\"id427\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickShearImage( MagickWand *wand, const PixelWand *background,\n                               const double x_shear, onst double y_shear );\n</pre>\n</div>\n<div class=\"section\" id=\"id428\">\n<h2>Description</h2>\n<p>MagickShearImage() slides one edge of an image along the X or Y axis,\ncreating a parallelogram.  An X direction shear slides an edge along the X\naxis, while a Y direction shear slides an edge along the Y axis.  The amount\nof the shear is controlled by a shear angle.  For X direction shears, x_shear\nis measured relative to the Y axis, and similarly, for Y direction shears\ny_shear is measured relative to the X axis.  Empty triangles left over from\nshearing the image are filled with the background color.</p>\n<p>The format of the MagickShearImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickShearImage( MagickWand *wand, const PixelWand *background,\n                               const double x_shear, onst double y_shear );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>background:</dt>\n<dd>The background pixel wand.</dd>\n<dt>x_shear:</dt>\n<dd>The number of degrees to shear the image.</dd>\n<dt>y_shear:</dt>\n<dd>The number of degrees to shear the image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksolarizeimage\">\n<h1><a class=\"toc-backref\" href=\"#id688\">MagickSolarizeImage</a></h1>\n<div class=\"section\" id=\"id429\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSolarizeImage( MagickWand *wand, const double threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"id430\">\n<h2>Description</h2>\n<p>MagickSolarizeImage() applies a special effect to the image, similar to the\neffect achieved in a photo darkroom by selectively exposing areas of photo\nsensitive paper to light.  Threshold ranges from 0 to MaxRGB and is a\nmeasure of the extent of the solarization.</p>\n<p>The format of the MagickSolarizeImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSolarizeImage( MagickWand *wand, const double threshold );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>threshold:</dt>\n<dd>Define the extent of the solarization.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickspreadimage\">\n<h1><a class=\"toc-backref\" href=\"#id689\">MagickSpreadImage</a></h1>\n<div class=\"section\" id=\"id431\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSpreadImage( MagickWand *wand, const double radius );\n</pre>\n</div>\n<div class=\"section\" id=\"id432\">\n<h2>Description</h2>\n<p>MagickSpreadImage() is a special effects method that randomly displaces each\npixel in a block defined by the radius parameter.</p>\n<p>The format of the MagickSpreadImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSpreadImage( MagickWand *wand, const double radius );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>Choose a random pixel in a neighborhood of this extent.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicksteganoimage\">\n<h1><a class=\"toc-backref\" href=\"#id690\">MagickSteganoImage</a></h1>\n<div class=\"section\" id=\"id433\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickSteganoImage( MagickWand *wand, const MagickWand *watermark_wand,\n                                const long offset );\n</pre>\n</div>\n<div class=\"section\" id=\"id434\">\n<h2>Description</h2>\n<p>Use MagickSteganoImage() to hide a digital watermark within the image.\nRecover the hidden watermark later to prove that the authenticity of\nan image.  Offset defines the start position within the image to hide\nthe watermark.</p>\n<p>The format of the MagickSteganoImage method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickSteganoImage( MagickWand *wand, const MagickWand *watermark_wand,\n                                const long offset );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>watermark_wand:</dt>\n<dd>The watermark wand.</dd>\n<dt>offset:</dt>\n<dd>Start hiding at this offset into the image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickstereoimage\">\n<h1><a class=\"toc-backref\" href=\"#id691\">MagickStereoImage</a></h1>\n<div class=\"section\" id=\"id435\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickStereoImage( MagickWand *wand, const MagickWand *offset_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id436\">\n<h2>Description</h2>\n<p>MagickStereoImage() composites two images and produces a single image that\nis the composite of a left and right image of a stereo pair</p>\n<p>The format of the MagickStereoImage method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickStereoImage( MagickWand *wand, const MagickWand *offset_wand );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>offset_wand:</dt>\n<dd>Another image wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickstripimage\">\n<h1><a class=\"toc-backref\" href=\"#id692\">MagickStripImage</a></h1>\n<div class=\"section\" id=\"id437\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickStripImage( MagickWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id438\">\n<h2>Description</h2>\n<p>MagickStripImage() removes all profiles and text attributes from the image.</p>\n<p>The format of the MagickStripImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickStripImage( MagickWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickswirlimage\">\n<h1><a class=\"toc-backref\" href=\"#id693\">MagickSwirlImage</a></h1>\n<div class=\"section\" id=\"id439\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickSwirlImage( MagickWand *wand, const double degrees );\n</pre>\n</div>\n<div class=\"section\" id=\"id440\">\n<h2>Description</h2>\n<p>MagickSwirlImage() swirls the pixels about the center of the image, where\ndegrees indicates the sweep of the arc through which each pixel is moved.\nYou get a more dramatic effect as the degrees move from 1 to 360.</p>\n<p>The format of the MagickSwirlImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickSwirlImage( MagickWand *wand, const double degrees );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>degrees:</dt>\n<dd>Define the tightness of the swirling effect.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicktextureimage\">\n<h1><a class=\"toc-backref\" href=\"#id694\">MagickTextureImage</a></h1>\n<div class=\"section\" id=\"id441\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickTextureImage( MagickWand *wand, const MagickWand *texture_wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id442\">\n<h2>Description</h2>\n<p>MagickTextureImage() repeatedly tiles the texture image across and down the\nimage canvas.</p>\n<p>The format of the MagickTextureImage method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickTextureImage( MagickWand *wand, const MagickWand *texture_wand );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>texture_wand:</dt>\n<dd>The texture wand</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickthresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id695\">MagickThresholdImage</a></h1>\n<div class=\"section\" id=\"id443\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickThresholdImage( MagickWand *wand, const double threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"id444\">\n<h2>Description</h2>\n<p>MagickThresholdImage() changes the value of individual pixels based on\nthe intensity of each pixel compared to threshold.  The result is a\nhigh-contrast, two color image.</p>\n<p>The format of the MagickThresholdImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickThresholdImage( MagickWand *wand, const double threshold );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>threshold:</dt>\n<dd>Define the threshold value.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickthresholdimagechannel\">\n<h1><a class=\"toc-backref\" href=\"#id696\">MagickThresholdImageChannel</a></h1>\n<div class=\"section\" id=\"id445\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickThresholdImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                          const double threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"id446\">\n<h2>Description</h2>\n<p>MagickThresholdImageChannel() changes the value of individual pixel\ncomponent based on the intensity of each pixel compared to threshold.  The\nresult is a high-contrast, two color image.</p>\n<p>The format of the MagickThresholdImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickThresholdImageChannel( MagickWand *wand, const <a class=\"reference external\" href=\"../api/types.html#channeltype\">ChannelType</a> channel,\n                                          const double threshold );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>channel:</dt>\n<dd>The channel.</dd>\n<dt>threshold:</dt>\n<dd>Define the threshold value.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicktintimage\">\n<h1><a class=\"toc-backref\" href=\"#id697\">MagickTintImage</a></h1>\n<div class=\"section\" id=\"id447\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickTintImage( MagickWand *wand, const PixelWand *tint,\n                              const PixelWand *opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id448\">\n<h2>Description</h2>\n<p>MagickTintImage() applies a color vector to each pixel in the image.  The\nlength of the vector is 0 for black and white and at its maximum for the\nmidtones.  The vector weighting function is\nf(x)=(1-(4.0*((x-0.5)*(x-0.5)))).</p>\n<p>The format of the MagickTintImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickTintImage( MagickWand *wand, const PixelWand *tint,\n                              const PixelWand *opacity );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>tint:</dt>\n<dd>The tint pixel wand.</dd>\n<dt>opacity:</dt>\n<dd>The opacity pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicktransformimage\">\n<h1><a class=\"toc-backref\" href=\"#id698\">MagickTransformImage</a></h1>\n<div class=\"section\" id=\"id449\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand *MagickTransformImage( MagickWand *wand, const char *crop,\n                                  const char *geometry );\n</pre>\n</div>\n<div class=\"section\" id=\"id450\">\n<h2>Description</h2>\n<p>MagickTransformImage() is a convenience method that behaves like\nMagickResizeImage() or MagickCropImage() but accepts scaling and/or cropping\ninformation as a region geometry specification.  If the operation fails, the\noriginal image handle is returned.</p>\n<p>The format of the MagickTransformImage method is:</p>\n<pre class=\"literal-block\">\nMagickWand *MagickTransformImage( MagickWand *wand, const char *crop,\n                                  const char *geometry );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>crop:</dt>\n<dd>A crop geometry string.  This geometry defines a subregion of the\nimage to crop.</dd>\n<dt>geometry:</dt>\n<dd>An image geometry string.  This geometry defines the final\nsize of the image.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicktransparentimage\">\n<h1><a class=\"toc-backref\" href=\"#id699\">MagickTransparentImage</a></h1>\n<div class=\"section\" id=\"id451\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickTransparentImage( MagickWand *wand, const PixelWand *target,\n                                     const unsigned int opacity, const double fuzz );\n</pre>\n</div>\n<div class=\"section\" id=\"id452\">\n<h2>Description</h2>\n<p>MagickTransparentImage() changes any pixel that matches color with the color\ndefined by fill.</p>\n<p>The format of the MagickTransparentImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickTransparentImage( MagickWand *wand, const PixelWand *target,\n                                     const unsigned int opacity, const double fuzz );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>target:</dt>\n<dd>Change this target color to specified opacity value within\nthe image.</dd>\n<dt>opacity:</dt>\n<dd>The replacement opacity value.</dd>\n<dt>fuzz:</dt>\n<dd>By default target must match a particular pixel color\nexactly.  However, in many cases two colors may differ by a small amount.\nThe fuzz member of image defines how much tolerance is acceptable to\nconsider two colors as the same.  For example, set fuzz to 10 and the\ncolor red at intensities of 100 and 102 respectively are now interpreted\nas the same color for the purposes of the floodfill.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magicktrimimage\">\n<h1><a class=\"toc-backref\" href=\"#id700\">MagickTrimImage</a></h1>\n<div class=\"section\" id=\"id453\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickTrimImage( MagickWand *wand, const double fuzz );\n</pre>\n</div>\n<div class=\"section\" id=\"id454\">\n<h2>Description</h2>\n<p>MagickTrimImage() remove edges that are the background color from the image.</p>\n<p>The format of the MagickTrimImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickTrimImage( MagickWand *wand, const double fuzz );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>fuzz:</dt>\n<dd>By default target must match a particular pixel color\nexactly.  However, in many cases two colors may differ by a small amount.\nThe fuzz member of image defines how much tolerance is acceptable to\nconsider two colors as the same.  For example, set fuzz to 10 and the\ncolor red at intensities of 100 and 102 respectively are now interpreted\nas the same color for the purposes of the floodfill.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickunsharpmaskimage\">\n<h1><a class=\"toc-backref\" href=\"#id701\">MagickUnsharpMaskImage</a></h1>\n<div class=\"section\" id=\"id455\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickUnsharpMaskImage( MagickWand *wand, const double radius, const double sigma,\n                                     const double amount, const double threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"id456\">\n<h2>Description</h2>\n<p>MagickUnsharpMaskImage() sharpens an image.  We convolve the image with a\nGaussian operator of the given radius and standard deviation (sigma).\nFor reasonable results, radius should be larger than sigma.  Use a radius\nof 0 and UnsharpMaskImage() selects a suitable radius for you.</p>\n<p>The format of the MagickUnsharpMaskImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickUnsharpMaskImage( MagickWand *wand, const double radius, const double sigma,\n                                     const double amount, const double threshold );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>radius:</dt>\n<dd>The radius of the Gaussian, in pixels, not counting the center\npixel.</dd>\n<dt>sigma:</dt>\n<dd>The standard deviation of the Gaussian, in pixels.</dd>\n<dt>amount:</dt>\n<dd>The percentage of the difference between the original and the\nblur image that is added back into the original.</dd>\n<dt>threshold:</dt>\n<dd>The threshold in pixels needed to apply the diffence amount.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickwaveimage\">\n<h1><a class=\"toc-backref\" href=\"#id702\">MagickWaveImage</a></h1>\n<div class=\"section\" id=\"id457\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickWaveImage( MagickWand *wand, const double amplitude,\n                              const double wave_length );\n</pre>\n</div>\n<div class=\"section\" id=\"id458\">\n<h2>Description</h2>\n<p>MagickWaveImage()  creates a &quot;ripple&quot; effect in the image by shifting\nthe pixels vertically along a sine wave whose amplitude and wavelength\nis specified by the given parameters.</p>\n<p>The format of the MagickWaveImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickWaveImage( MagickWand *wand, const double amplitude,\n                              const double wave_length );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>amplitude, wave_length:</dt>\n<dd>Define the amplitude and wave length of the\nsine wave.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickwhitethresholdimage\">\n<h1><a class=\"toc-backref\" href=\"#id703\">MagickWhiteThresholdImage</a></h1>\n<div class=\"section\" id=\"id459\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickWhiteThresholdImage( MagickWand *wand, const PixelWand *threshold );\n</pre>\n</div>\n<div class=\"section\" id=\"id460\">\n<h2>Description</h2>\n<p>MagickWhiteThresholdImage() is like ThresholdImage() but  forces all pixels\nabove the threshold into white while leaving all pixels below the threshold\nunchanged.</p>\n<p>The format of the MagickWhiteThresholdImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickWhiteThresholdImage( MagickWand *wand, const PixelWand *threshold );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>threshold:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickwriteimage\">\n<h1><a class=\"toc-backref\" href=\"#id704\">MagickWriteImage</a></h1>\n<div class=\"section\" id=\"id461\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickWriteImage( MagickWand *wand, const char *filename );\n</pre>\n</div>\n<div class=\"section\" id=\"id462\">\n<h2>Description</h2>\n<p>MagickWriteImage() writes an image.</p>\n<p>The format of the MagickWriteImage method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickWriteImage( MagickWand *wand, const char *filename );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>filename:</dt>\n<dd>The image filename.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickwriteimagesfile\">\n<h1><a class=\"toc-backref\" href=\"#id705\">MagickWriteImagesFile</a></h1>\n<div class=\"section\" id=\"id463\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickWriteImagesFile( MagickWand *wand, FILE *file, const unsigned int adjoin );\n</pre>\n</div>\n<div class=\"section\" id=\"id464\">\n<h2>Description</h2>\n<p>MagickWriteImagesFile() writes an image or image sequence to a stdio\nFILE handle.  This may be used to append an encoded image to an already\nexisting appended image sequence if the file seek position is at the end\nof an existing file.</p>\n<p>The format of the MagickWriteImages method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickWriteImagesFile( MagickWand *wand, FILE *file, const unsigned int adjoin );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>file:</dt>\n<dd>The open (and positioned) file handle.</dd>\n<dt>adjoin:</dt>\n<dd>join images into a single multi-image file.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickwriteimageblob\">\n<h1><a class=\"toc-backref\" href=\"#id706\">MagickWriteImageBlob</a></h1>\n<div class=\"section\" id=\"id465\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned char *MagickWriteImageBlob( MagickWand *wand, size_t *length );\n</pre>\n</div>\n<div class=\"section\" id=\"id466\">\n<h2>Description</h2>\n<p>MagickWriteImageBlob() implements direct to memory image formats.  It\nreturns the image as a blob (a formatted &quot;file&quot; in memory) and its\nlength, starting from the current position in the image sequence.\nUse MagickSetImageFormat() to set the format to write to the blob\n(GIF, JPEG,  PNG, etc.).</p>\n<p>Use MagickResetIterator() on the wand if it is desired to write\na sequence from the beginning and the iterator is not currently\nat the beginning.</p>\n<p>The format of the MagickWriteImageBlob method is:</p>\n<pre class=\"literal-block\">\nunsigned char *MagickWriteImageBlob( MagickWand *wand, size_t *length );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>length:</dt>\n<dd>The length of the blob.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickwriteimagefile\">\n<h1><a class=\"toc-backref\" href=\"#id707\">MagickWriteImageFile</a></h1>\n<div class=\"section\" id=\"id467\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickWriteImageFile( MagickWand *wand, FILE *file );\n</pre>\n</div>\n<div class=\"section\" id=\"id468\">\n<h2>Description</h2>\n<p>MagickWriteImageFile() writes an image to an open file descriptor.</p>\n<p>The format of the MagickWandToFile method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickWriteImageFile( MagickWand *wand, FILE *file );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>file:</dt>\n<dd>The file descriptor.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"magickwriteimages\">\n<h1><a class=\"toc-backref\" href=\"#id708\">MagickWriteImages</a></h1>\n<div class=\"section\" id=\"id469\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int MagickWriteImages( MagickWand *wand, const char *filename,\n                                const unsigned int adjoin );\n</pre>\n</div>\n<div class=\"section\" id=\"id470\">\n<h2>Description</h2>\n<p>MagickWriteImages() writes an image or image sequence.  If the wand\nrepresents an image sequence, then it is written starting at the first\nframe in the sequence.</p>\n<p>The format of the MagickWriteImages method is:</p>\n<pre class=\"literal-block\">\nunsigned int MagickWriteImages( MagickWand *wand, const char *filename,\n                                const unsigned int adjoin );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The magick wand.</dd>\n<dt>filename:</dt>\n<dd>The image filename.</dd>\n<dt>adjoin:</dt>\n<dd>join images into a single multi-image file.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"newmagickwand\">\n<h1><a class=\"toc-backref\" href=\"#id709\">NewMagickWand</a></h1>\n<div class=\"section\" id=\"id471\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nMagickWand NewMagickWand( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id472\">\n<h2>Description</h2>\n<p>NewMagickWand() returns a wand required for all other methods in the API.</p>\n<p>The format of the NewMagickWand method is:</p>\n<pre class=\"literal-block\">\nMagickWand NewMagickWand( void );\n</pre>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/wand/pixel_wand.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>pixel_wand</title>\n<link rel=\"stylesheet\" href=\"../docutils-api.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"pixel-wand\">\n<h1 class=\"title\">pixel_wand</h1>\n<h2 class=\"subtitle\" id=\"wand-pixel-access-interfaces\">Wand pixel access interfaces</h2>\n\n<div class=\"contents topic\" id=\"contents\">\n<p class=\"topic-title first\">Contents</p>\n<ul class=\"simple\">\n<li><a class=\"reference internal\" href=\"#clonepixelwand\" id=\"id85\">ClonePixelWand</a></li>\n<li><a class=\"reference internal\" href=\"#clonepixelwands\" id=\"id86\">ClonePixelWands</a></li>\n<li><a class=\"reference internal\" href=\"#destroypixelwand\" id=\"id87\">DestroyPixelWand</a></li>\n<li><a class=\"reference internal\" href=\"#newpixelwand\" id=\"id88\">NewPixelWand</a></li>\n<li><a class=\"reference internal\" href=\"#newpixelwands\" id=\"id89\">NewPixelWands</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetexception\" id=\"id90\">PixelGetException</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetblack\" id=\"id91\">PixelGetBlack</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetblackquantum\" id=\"id92\">PixelGetBlackQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetblue\" id=\"id93\">PixelGetBlue</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetbluequantum\" id=\"id94\">PixelGetBlueQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetcolorasstring\" id=\"id95\">PixelGetColorAsString</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetcolorcount\" id=\"id96\">PixelGetColorCount</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetcyan\" id=\"id97\">PixelGetCyan</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetcyanquantum\" id=\"id98\">PixelGetCyanQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetgreen\" id=\"id99\">PixelGetGreen</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetgreenquantum\" id=\"id100\">PixelGetGreenQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetmagenta\" id=\"id101\">PixelGetMagenta</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetmagentaquantum\" id=\"id102\">PixelGetMagentaQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetopacity\" id=\"id103\">PixelGetOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetopacityquantum\" id=\"id104\">PixelGetOpacityQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetred\" id=\"id105\">PixelGetRed</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetredquantum\" id=\"id106\">PixelGetRedQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetyellow\" id=\"id107\">PixelGetYellow</a></li>\n<li><a class=\"reference internal\" href=\"#pixelgetyellowquantum\" id=\"id108\">PixelGetYellowQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetblack\" id=\"id109\">PixelSetBlack</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetblackquantum\" id=\"id110\">PixelSetBlackQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetblue\" id=\"id111\">PixelSetBlue</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetbluequantum\" id=\"id112\">PixelSetBlueQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetcolor\" id=\"id113\">PixelSetColor</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetcolorcount\" id=\"id114\">PixelSetColorCount</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetcyan\" id=\"id115\">PixelSetCyan</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetcyanquantum\" id=\"id116\">PixelSetCyanQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetgreen\" id=\"id117\">PixelSetGreen</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetgreenquantum\" id=\"id118\">PixelSetGreenQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetmagenta\" id=\"id119\">PixelSetMagenta</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetmagentaquantum\" id=\"id120\">PixelSetMagentaQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetopacity\" id=\"id121\">PixelSetOpacity</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetopacityquantum\" id=\"id122\">PixelSetOpacityQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetquantumcolor\" id=\"id123\">PixelSetQuantumColor</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetred\" id=\"id124\">PixelSetRed</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetredquantum\" id=\"id125\">PixelSetRedQuantum</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetyellow\" id=\"id126\">PixelSetYellow</a></li>\n<li><a class=\"reference internal\" href=\"#pixelsetyellowquantum\" id=\"id127\">PixelSetYellowQuantum</a></li>\n</ul>\n</div>\n<div class=\"section\" id=\"clonepixelwand\">\n<h1><a class=\"toc-backref\" href=\"#id85\">ClonePixelWand</a></h1>\n<div class=\"section\" id=\"synopsis\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nPixelWand *ClonePixelWand( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"description\">\n<h2>Description</h2>\n<p>ClonePixelWand() creates an exact copy of a PixelWand. PixelWand may not be\na null pointer.</p>\n<p>The format of the ClonePixelWand method is:</p>\n<pre class=\"literal-block\">\nPixelWand *ClonePixelWand( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand to clone.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"clonepixelwands\">\n<h1><a class=\"toc-backref\" href=\"#id86\">ClonePixelWands</a></h1>\n<div class=\"section\" id=\"id1\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nPixelWand ** ClonePixelWands( const PixelWand ** wands, const unsigned long number_wands );\n</pre>\n</div>\n<div class=\"section\" id=\"id2\">\n<h2>Description</h2>\n<p>ClonePixelWands creates a deep-copy an array of PixelWands.</p>\n<p>The format of the ClonePixelWands method is:</p>\n<pre class=\"literal-block\">\nPixelWand ** ClonePixelWands( const PixelWand ** wands, const unsigned long number_wands );\n</pre>\n<dl class=\"docutils\">\n<dt>wands:</dt>\n<dd>The pixel wands to clone.</dd>\n<dt>number_wands:</dt>\n<dd>The number of wands in the array</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"destroypixelwand\">\n<h1><a class=\"toc-backref\" href=\"#id87\">DestroyPixelWand</a></h1>\n<div class=\"section\" id=\"id3\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int DestroyPixelWand( PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id4\">\n<h2>Description</h2>\n<p>DestroyPixelWand() deallocates resources associated with a PixelWand.</p>\n<p>The format of the DestroyPixelWand method is:</p>\n<pre class=\"literal-block\">\nunsigned int DestroyPixelWand( PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"newpixelwand\">\n<h1><a class=\"toc-backref\" href=\"#id88\">NewPixelWand</a></h1>\n<div class=\"section\" id=\"id5\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nPixelWand NewPixelWand( void );\n</pre>\n</div>\n<div class=\"section\" id=\"id6\">\n<h2>Description</h2>\n<p>NewPixelWand() returns a new pixel wand.</p>\n<p>The format of the NewPixelWand method is:</p>\n<pre class=\"literal-block\">\nPixelWand NewPixelWand( void );\n</pre>\n</div>\n</div>\n<div class=\"section\" id=\"newpixelwands\">\n<h1><a class=\"toc-backref\" href=\"#id89\">NewPixelWands</a></h1>\n<div class=\"section\" id=\"id7\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nPixelWand NewPixelWands( const unsigned long number_wands );\n</pre>\n</div>\n<div class=\"section\" id=\"id8\">\n<h2>Description</h2>\n<p>NewPixelWands() returns an array of pixel wands.</p>\n<p>The format of the NewPixelWand method is:</p>\n<pre class=\"literal-block\">\nPixelWand NewPixelWands( const unsigned long number_wands );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>number_wands:</dt>\n<dd>The number of wands.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetexception\">\n<h1><a class=\"toc-backref\" href=\"#id90\">PixelGetException</a></h1>\n<div class=\"section\" id=\"id9\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelGetException( PixelWand *wand, char ** description );\n</pre>\n</div>\n<div class=\"section\" id=\"id10\">\n<h2>Description</h2>\n<p>PixelGetException() returns the severity, reason, and description of any\nerror that occurs when using the pixel wand methods.</p>\n<p>The format of the PixelGetException method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelGetException( PixelWand *wand, char ** description );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>description:</dt>\n<dd>A description of the error.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetblack\">\n<h1><a class=\"toc-backref\" href=\"#id91\">PixelGetBlack</a></h1>\n<div class=\"section\" id=\"id11\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble PixelGetBlack( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id12\">\n<h2>Description</h2>\n<p>PixelGetBlack() returns the normalized black color of the pixel wand.</p>\n<p>The format of the PixelGetBlack method is:</p>\n<pre class=\"literal-block\">\ndouble PixelGetBlack( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetblackquantum\">\n<h1><a class=\"toc-backref\" href=\"#id92\">PixelGetBlackQuantum</a></h1>\n<div class=\"section\" id=\"id13\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetBlackQuantum( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id14\">\n<h2>Description</h2>\n<p>PixelGetBlackQuantum() returns the black color of the pixel wand.  The\ncolor is in the range of [0..MaxRGB]</p>\n<p>The format of the PixelGetBlackQuantum method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetBlackQuantum( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetblue\">\n<h1><a class=\"toc-backref\" href=\"#id93\">PixelGetBlue</a></h1>\n<div class=\"section\" id=\"id15\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble PixelGetBlue( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id16\">\n<h2>Description</h2>\n<p>PixelGetBlue(const) returns the normalized blue color of the pixel wand.</p>\n<p>The format of the PixelGetBlue method is:</p>\n<pre class=\"literal-block\">\ndouble PixelGetBlue( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetbluequantum\">\n<h1><a class=\"toc-backref\" href=\"#id94\">PixelGetBlueQuantum</a></h1>\n<div class=\"section\" id=\"id17\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetBlueQuantum( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id18\">\n<h2>Description</h2>\n<p>PixelGetBlueQuantum(const ) returns the blue color of the pixel wand.  The\ncolor is in the range of [0..MaxRGB]</p>\n<p>The format of the PixelGetBlueQuantum method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetBlueQuantum( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetcolorasstring\">\n<h1><a class=\"toc-backref\" href=\"#id95\">PixelGetColorAsString</a></h1>\n<div class=\"section\" id=\"id19\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nchar *PixelGetColorAsString( PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id20\">\n<h2>Description</h2>\n<p>PixelGetColorAsString() gets the color of the pixel wand.</p>\n<p>The format of the PixelGetColorAsString method is:</p>\n<pre class=\"literal-block\">\nchar *PixelGetColorAsString( PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetcolorcount\">\n<h1><a class=\"toc-backref\" href=\"#id96\">PixelGetColorCount</a></h1>\n<div class=\"section\" id=\"id21\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned long PixelGetColorCount( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id22\">\n<h2>Description</h2>\n<p>PixelGetColorCount() returns the color count associated with this color.</p>\n<p>The format of the PixelGetColorCount method is:</p>\n<pre class=\"literal-block\">\nunsigned long PixelGetColorCount( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetcyan\">\n<h1><a class=\"toc-backref\" href=\"#id97\">PixelGetCyan</a></h1>\n<div class=\"section\" id=\"id23\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble PixelGetCyan( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id24\">\n<h2>Description</h2>\n<p>PixelGetCyan() returns the normalized cyan color of the pixel wand.</p>\n<p>The format of the PixelGetCyan method is:</p>\n<pre class=\"literal-block\">\ndouble PixelGetCyan( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetcyanquantum\">\n<h1><a class=\"toc-backref\" href=\"#id98\">PixelGetCyanQuantum</a></h1>\n<div class=\"section\" id=\"id25\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetCyanQuantum( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id26\">\n<h2>Description</h2>\n<p>PixelGetCyanQuantum() returns the cyan color of the pixel wand.  The color\nis in the range of [0..MaxRGB]</p>\n<p>The format of the PixelGetCyanQuantum method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetCyanQuantum( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetgreen\">\n<h1><a class=\"toc-backref\" href=\"#id99\">PixelGetGreen</a></h1>\n<div class=\"section\" id=\"id27\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble PixelGetGreen( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id28\">\n<h2>Description</h2>\n<p>PixelGetGreen(const ) returns the normalized green color of the pixel wand.</p>\n<p>The format of the PixelGetGreen method is:</p>\n<pre class=\"literal-block\">\ndouble PixelGetGreen( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetgreenquantum\">\n<h1><a class=\"toc-backref\" href=\"#id100\">PixelGetGreenQuantum</a></h1>\n<div class=\"section\" id=\"id29\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetGreenQuantum( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id30\">\n<h2>Description</h2>\n<p>PixelGetGreenQuantum(const ) returns the green color of the pixel wand.  The\ncolor is in the range of [0..MaxRGB]</p>\n<p>The format of the PixelGetGreenQuantum method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetGreenQuantum( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetmagenta\">\n<h1><a class=\"toc-backref\" href=\"#id101\">PixelGetMagenta</a></h1>\n<div class=\"section\" id=\"id31\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble PixelGetMagenta( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id32\">\n<h2>Description</h2>\n<p>PixelGetMagenta() returns the normalized magenta color of the pixel wand.</p>\n<p>The format of the PixelGetMagenta method is:</p>\n<pre class=\"literal-block\">\ndouble PixelGetMagenta( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetmagentaquantum\">\n<h1><a class=\"toc-backref\" href=\"#id102\">PixelGetMagentaQuantum</a></h1>\n<div class=\"section\" id=\"id33\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetMagentaQuantum( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id34\">\n<h2>Description</h2>\n<p>PixelGetMagentaQuantum() returns the magenta color of the pixel wand.  The\ncolor is in the range of [0..MaxRGB]</p>\n<p>The format of the PixelGetMagentaQuantum method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetMagentaQuantum( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetopacity\">\n<h1><a class=\"toc-backref\" href=\"#id103\">PixelGetOpacity</a></h1>\n<div class=\"section\" id=\"id35\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble PixelGetOpacity( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id36\">\n<h2>Description</h2>\n<p>PixelGetOpacity(const ) returns the normalized opacity color of the pixel\nwand.</p>\n<p>The format of the PixelGetOpacity method is:</p>\n<pre class=\"literal-block\">\ndouble PixelGetOpacity( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetopacityquantum\">\n<h1><a class=\"toc-backref\" href=\"#id104\">PixelGetOpacityQuantum</a></h1>\n<div class=\"section\" id=\"id37\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetOpacityQuantum( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id38\">\n<h2>Description</h2>\n<p>PixelGetOpacityQuantum(const ) returns the opacity color of the pixel wand.\nThe color is in the range of [0..MaxRGB]</p>\n<p>The format of the PixelGetOpacityQuantum method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetOpacityQuantum( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetred\">\n<h1><a class=\"toc-backref\" href=\"#id105\">PixelGetRed</a></h1>\n<div class=\"section\" id=\"id39\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble PixelGetRed( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id40\">\n<h2>Description</h2>\n<p>PixelGetRed(const ) returns the normalized red color of the pixel wand.</p>\n<p>The format of the PixelGetRed method is:</p>\n<pre class=\"literal-block\">\ndouble PixelGetRed( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetredquantum\">\n<h1><a class=\"toc-backref\" href=\"#id106\">PixelGetRedQuantum</a></h1>\n<div class=\"section\" id=\"id41\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetRedQuantum( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id42\">\n<h2>Description</h2>\n<p>PixelGetRedQuantum(const ) returns the red color of the pixel wand.  The\ncolor is in the range of [0..MaxRGB]</p>\n<p>The format of the PixelGetRedQuantum method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetRedQuantum( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetyellow\">\n<h1><a class=\"toc-backref\" href=\"#id107\">PixelGetYellow</a></h1>\n<div class=\"section\" id=\"id43\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\ndouble PixelGetYellow( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id44\">\n<h2>Description</h2>\n<p>PixelGetYellow() returns the normalized yellow color of the pixel wand.</p>\n<p>The format of the PixelGetYellow method is:</p>\n<pre class=\"literal-block\">\ndouble PixelGetYellow( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelgetyellowquantum\">\n<h1><a class=\"toc-backref\" href=\"#id108\">PixelGetYellowQuantum</a></h1>\n<div class=\"section\" id=\"id45\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetYellowQuantum( const PixelWand *wand );\n</pre>\n</div>\n<div class=\"section\" id=\"id46\">\n<h2>Description</h2>\n<p>PixelGetYellowQuantum() returns the yellow color of the pixel wand.  The\ncolor is in the range of [0..MaxRGB]</p>\n<p>The format of the PixelGetYellowQuantum method is:</p>\n<pre class=\"literal-block\">\n<a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> PixelGetYellowQuantum( const PixelWand *wand );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetblack\">\n<h1><a class=\"toc-backref\" href=\"#id109\">PixelSetBlack</a></h1>\n<div class=\"section\" id=\"id47\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetBlack( PixelWand *wand, const double black );\n</pre>\n</div>\n<div class=\"section\" id=\"id48\">\n<h2>Description</h2>\n<p>PixelSetBlack() sets the normalized black color of the pixel wand.</p>\n<p>The format of the PixelSetBlack method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetBlack( PixelWand *wand, const double black );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>black:</dt>\n<dd>The black color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetblackquantum\">\n<h1><a class=\"toc-backref\" href=\"#id110\">PixelSetBlackQuantum</a></h1>\n<div class=\"section\" id=\"id49\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetBlackQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> black );\n</pre>\n</div>\n<div class=\"section\" id=\"id50\">\n<h2>Description</h2>\n<p>PixelSetBlackQuantum() sets the black color of the pixel wand.  The color\nmust be in the range of [0..MaxRGB]</p>\n<p>The format of the PixelSetBlackQuantum method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetBlackQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> black );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>black:</dt>\n<dd>The black color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetblue\">\n<h1><a class=\"toc-backref\" href=\"#id111\">PixelSetBlue</a></h1>\n<div class=\"section\" id=\"id51\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetBlue( PixelWand *wand, const double blue );\n</pre>\n</div>\n<div class=\"section\" id=\"id52\">\n<h2>Description</h2>\n<p>PixelSetBlue() sets the normalized blue color of the pixel wand.</p>\n<p>The format of the PixelSetBlue method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetBlue( PixelWand *wand, const double blue );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>blue:</dt>\n<dd>The blue color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetbluequantum\">\n<h1><a class=\"toc-backref\" href=\"#id112\">PixelSetBlueQuantum</a></h1>\n<div class=\"section\" id=\"id53\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetBlueQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> blue );\n</pre>\n</div>\n<div class=\"section\" id=\"id54\">\n<h2>Description</h2>\n<p>PixelSetBlueQuantum() sets the blue color of the pixel wand.  The color must\nbe in the range of [0..MaxRGB]</p>\n<p>The format of the PixelSetBlueQuantum method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetBlueQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> blue );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>blue:</dt>\n<dd>The blue color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetcolor\">\n<h1><a class=\"toc-backref\" href=\"#id113\">PixelSetColor</a></h1>\n<div class=\"section\" id=\"id55\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetColor( PixelWand *wand, const char *color );\n</pre>\n</div>\n<div class=\"section\" id=\"id56\">\n<h2>Description</h2>\n<p>PixelSetColor() sets the color of the pixel wand with a string (e.g.\n&quot;blue&quot;, &quot;#0000ff&quot;, &quot;rgb(0,0,255)&quot;, etc.).</p>\n<p>The format of the PixelSetColor method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetColor( PixelWand *wand, const char *color );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>color:</dt>\n<dd>The pixel wand color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetcolorcount\">\n<h1><a class=\"toc-backref\" href=\"#id114\">PixelSetColorCount</a></h1>\n<div class=\"section\" id=\"id57\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetColorCount( PixelWand *wand, const unsigned long count );\n</pre>\n</div>\n<div class=\"section\" id=\"id58\">\n<h2>Description</h2>\n<p>PixelSetColorCount() sets the color count of the pixel wand.</p>\n<p>The format of the PixelSetColorCount method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetColorCount( PixelWand *wand, const unsigned long count );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>count:</dt>\n<dd>The number of this particular color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetcyan\">\n<h1><a class=\"toc-backref\" href=\"#id115\">PixelSetCyan</a></h1>\n<div class=\"section\" id=\"id59\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetCyan( PixelWand *wand, const double cyan );\n</pre>\n</div>\n<div class=\"section\" id=\"id60\">\n<h2>Description</h2>\n<p>PixelSetCyan() sets the normalized cyan color of the pixel wand.</p>\n<p>The format of the PixelSetCyan method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetCyan( PixelWand *wand, const double cyan );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>cyan:</dt>\n<dd>The cyan color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetcyanquantum\">\n<h1><a class=\"toc-backref\" href=\"#id116\">PixelSetCyanQuantum</a></h1>\n<div class=\"section\" id=\"id61\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetCyanQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> cyan );\n</pre>\n</div>\n<div class=\"section\" id=\"id62\">\n<h2>Description</h2>\n<p>PixelSetCyanQuantum() sets the cyan color of the pixel wand.  The color must\nbe in the range of [0..MaxRGB]</p>\n<p>The format of the PixelSetCyanQuantum method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetCyanQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> cyan );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>cyan:</dt>\n<dd>The cyan color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetgreen\">\n<h1><a class=\"toc-backref\" href=\"#id117\">PixelSetGreen</a></h1>\n<div class=\"section\" id=\"id63\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetGreen( PixelWand *wand, const double green );\n</pre>\n</div>\n<div class=\"section\" id=\"id64\">\n<h2>Description</h2>\n<p>PixelSetGreen() sets the normalized green color of the pixel wand.</p>\n<p>The format of the PixelSetGreen method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetGreen( PixelWand *wand, const double green );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>green:</dt>\n<dd>The green color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetgreenquantum\">\n<h1><a class=\"toc-backref\" href=\"#id118\">PixelSetGreenQuantum</a></h1>\n<div class=\"section\" id=\"id65\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetGreenQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> green );\n</pre>\n</div>\n<div class=\"section\" id=\"id66\">\n<h2>Description</h2>\n<p>PixelSetGreenQuantum() sets the green color of the pixel wand.  The color must\nbe in the range of [0..MaxRGB]</p>\n<p>The format of the PixelSetGreenQuantum method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetGreenQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> green );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>green:</dt>\n<dd>The green color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetmagenta\">\n<h1><a class=\"toc-backref\" href=\"#id119\">PixelSetMagenta</a></h1>\n<div class=\"section\" id=\"id67\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetMagenta( PixelWand *wand, const double magenta );\n</pre>\n</div>\n<div class=\"section\" id=\"id68\">\n<h2>Description</h2>\n<p>PixelSetMagenta() sets the normalized magenta color of the pixel wand.</p>\n<p>The format of the PixelSetMagenta method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetMagenta( PixelWand *wand, const double magenta );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>magenta:</dt>\n<dd>The magenta color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetmagentaquantum\">\n<h1><a class=\"toc-backref\" href=\"#id120\">PixelSetMagentaQuantum</a></h1>\n<div class=\"section\" id=\"id69\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetMagentaQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> magenta );\n</pre>\n</div>\n<div class=\"section\" id=\"id70\">\n<h2>Description</h2>\n<p>PixelSetMagentaQuantum() sets the magenta color of the pixel wand.  The\ncolor must be in the range of [0..MaxRGB]</p>\n<p>The format of the PixelSetMagentaQuantum method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetMagentaQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> magenta );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>magenta:</dt>\n<dd>The magenta color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetopacity\">\n<h1><a class=\"toc-backref\" href=\"#id121\">PixelSetOpacity</a></h1>\n<div class=\"section\" id=\"id71\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetOpacity( PixelWand *wand, const double opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id72\">\n<h2>Description</h2>\n<p>PixelSetOpacity() sets the normalized opacity color of the pixel wand.</p>\n<p>The format of the PixelSetOpacity method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetOpacity( PixelWand *wand, const double opacity );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>opacity:</dt>\n<dd>The opacity value.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetopacityquantum\">\n<h1><a class=\"toc-backref\" href=\"#id122\">PixelSetOpacityQuantum</a></h1>\n<div class=\"section\" id=\"id73\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetOpacityQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> opacity );\n</pre>\n</div>\n<div class=\"section\" id=\"id74\">\n<h2>Description</h2>\n<p>PixelSetOpacityQuantum() sets the opacity color of the pixel wand.  The\ncolor must be in the range of [0..MaxRGB]</p>\n<p>The format of the PixelSetOpacityQuantum method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetOpacityQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> opacity );\n</pre>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>opacity:</dt>\n<dd>The opacity value.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetquantumcolor\">\n<h1><a class=\"toc-backref\" href=\"#id123\">PixelSetQuantumColor</a></h1>\n<div class=\"section\" id=\"id75\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nPixelSetQuantumColor( PixelWand *wand, <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *color );\n</pre>\n</div>\n<div class=\"section\" id=\"id76\">\n<h2>Description</h2>\n<p>PixelSetQuantumColor() sets the color of the pixel wand.</p>\n<p>The format of the PixelSetQuantumColor method is:</p>\n<pre class=\"literal-block\">\nPixelSetQuantumColor( PixelWand *wand, <a class=\"reference external\" href=\"../api/types.html#pixelpacket\">PixelPacket</a> *color );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>color:</dt>\n<dd>The pixel wand color (expressed as a PixelPacket).</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetred\">\n<h1><a class=\"toc-backref\" href=\"#id124\">PixelSetRed</a></h1>\n<div class=\"section\" id=\"id77\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetRed( PixelWand *wand, const double red );\n</pre>\n</div>\n<div class=\"section\" id=\"id78\">\n<h2>Description</h2>\n<p>PixelSetRed() sets the normalized red color of the pixel wand.</p>\n<p>The format of the PixelSetRed method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetRed( PixelWand *wand, const double red );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>red:</dt>\n<dd>The red color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetredquantum\">\n<h1><a class=\"toc-backref\" href=\"#id125\">PixelSetRedQuantum</a></h1>\n<div class=\"section\" id=\"id79\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetRedQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> red );\n</pre>\n</div>\n<div class=\"section\" id=\"id80\">\n<h2>Description</h2>\n<p>PixelSetRedQuantum() sets the red color of the pixel wand.  The color must\nbe in the range of [0..MaxRGB]</p>\n<p>The format of the PixelSetRedQuantum method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetRedQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> red );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>red:</dt>\n<dd>The red color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetyellow\">\n<h1><a class=\"toc-backref\" href=\"#id126\">PixelSetYellow</a></h1>\n<div class=\"section\" id=\"id81\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetYellow( PixelWand *wand, const double yellow );\n</pre>\n</div>\n<div class=\"section\" id=\"id82\">\n<h2>Description</h2>\n<p>PixelSetYellow() sets the normalized yellow color of the pixel wand.</p>\n<p>The format of the PixelSetYellow method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetYellow( PixelWand *wand, const double yellow );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>yellow:</dt>\n<dd>The yellow color.</dd>\n</dl>\n</div>\n</div>\n<div class=\"section\" id=\"pixelsetyellowquantum\">\n<h1><a class=\"toc-backref\" href=\"#id127\">PixelSetYellowQuantum</a></h1>\n<div class=\"section\" id=\"id83\">\n<h2>Synopsis</h2>\n<pre class=\"literal-block\">\nunsigned int PixelSetYellowQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> yellow );\n</pre>\n</div>\n<div class=\"section\" id=\"id84\">\n<h2>Description</h2>\n<p>PixelSetYellowQuantum() sets the yellow color of the pixel wand.  The color\nmust be in the range of [0..MaxRGB]</p>\n<p>The format of the PixelSetYellowQuantum method is:</p>\n<pre class=\"literal-block\">\nunsigned int PixelSetYellowQuantum( PixelWand *wand, const <a class=\"reference external\" href=\"../api/types.html#quantum\">Quantum</a> yellow );\n</pre>\n<p>A description of each parameter follows:</p>\n<dl class=\"docutils\">\n<dt>wand:</dt>\n<dd>The pixel wand.</dd>\n<dt>yellow:</dt>\n<dd>The yellow color.</dd>\n</dl>\n</div>\n</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/wand/wand.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta name=\"generator\" content=\"Docutils 0.15.2: http://docutils.sourceforge.net/\" />\n<title>GraphicsMagick Wand C API</title>\n<link rel=\"stylesheet\" href=\"../docutils-articles.css\" type=\"text/css\" />\n</head>\n<body>\n\n<div class=\"banner\">\n<img src=\"../images/gm-107x76.png\" alt=\"GraphicMagick logo\" width=\"107\" height=\"76\" />\n<span class=\"title\">GraphicsMagick</span>\n<form action=\"http://www.google.com/search\">\n\t<input type=\"hidden\" name=\"domains\" value=\"www.graphicsmagick.org\" />\n\t<input type=\"hidden\" name=\"sitesearch\" value=\"www.graphicsmagick.org\" />\n    <span class=\"nowrap\"><input type=\"text\" name=\"q\" size=\"25\" maxlength=\"255\" />&nbsp;<input type=\"submit\" name=\"sa\" value=\"Search\" /></span>\n</form>\n</div>\n\n<div class=\"navmenu\">\n<ul>\n<li><a href=\"../index.html\">Home</a></li>\n<li><a href=\"../project.html\">Project</a></li>\n<li><a href=\"../download.html\">Download</a></li>\n<li><a href=\"../README.html\">Install</a></li>\n<li><a href=\"../Hg.html\">Source</a></li>\n<li><a href=\"../NEWS.html\">News</a> </li>\n<li><a href=\"../utilities.html\">Utilities</a></li>\n<li><a href=\"../programming.html\">Programming</a></li>\n<li><a href=\"../reference.html\">Reference</a></li>\n</ul>\n</div>\n<div class=\"document\" id=\"graphicsmagick-wand-c-api\">\n<h1 class=\"title\">GraphicsMagick Wand C API</h1>\n\n<!-- -*- mode: rst -*- -->\n<!-- This text is in reStucturedText format, so it may look a bit odd. -->\n<!-- See http://docutils.sourceforge.net/rst.html for details. -->\n<p>The GraphicsMagick Wand C library provides a mid-level abstract C\nlanguage programming interface for GraphicsMagick.  It is originally\nbased on the Wand API provided in ImageMagick as of August 2003.\nAfter August 2003, ImageMagick changed its license to one unusable by\nGraphicsMagick so this version of the Wand library is not completely\nin sync with the current ImageMagick version.</p>\n<p>The API is divided into a number of categories. While reading this\ndocumentation, please reference the <a class=\"reference external\" href=\"../api/types.html\">types</a> documentation as required:</p>\n<blockquote>\n<ul class=\"simple\">\n<li><a class=\"reference external\" href=\"drawing_wand.html\">Drawing</a>: Wand vector drawing interfaces.</li>\n<li><a class=\"reference external\" href=\"magick_wand.html\">Magick</a>: Wand image processing interfaces</li>\n<li><a class=\"reference external\" href=\"pixel_wand.html\">Pixel</a>: Wand pixel access/update interfaces</li>\n</ul>\n</blockquote>\n<p>The following is a simple example program which (assuming the program\nname is <cite>rotate</cite>) is executed similar to <cite>rotate infile outfile</cite>.  It\nreads from file <cite>infile</cite>, rotates the image 30 degrees using a black\nbackground, and writes the result to file <cite>outfile</cite>:</p>\n<pre class=\"literal-block\">\n#include &lt;stdlib.h&gt;\n#include &lt;stdio.h&gt;\n#include &lt;string.h&gt;\n#include &lt;wand/magick_wand.h&gt;\n\nint main(int argc,char **argv)\n{\n  MagickWand *magick_wand;\n  MagickPassFail status = MagickPass;\n  const char *infile, *outfile;\n\n  if (argc != 3)\n    {\n      fprintf(stderr,&quot;Usage: %s: infile outfile\\n&quot;,argv[0]);\n      return 1;\n    }\n\n  infile=argv[1];\n  outfile=argv[2];\n\n  // Initialize GraphicsMagick API\n  InitializeMagick(*argv);\n\n  // Allocate Wand handle\n  magick_wand=NewMagickWand();\n\n  // Read input image file\n  if (status == MagickPass)\n    {\n      status = MagickReadImage(magick_wand,infile);\n    }\n\n  // Rotate image clockwise 30 degrees with black background\n  if (status == MagickPass)\n    {\n      PixelWand *background;\n      background=NewPixelWand();\n      PixelSetColor(background,&quot;#000000&quot;);\n      status = MagickRotateImage(magick_wand,background,30);\n      DestroyPixelWand(background);\n    }\n\n  // Write output file\n  if (status == MagickPass)\n    {\n      status = MagickWriteImage(magick_wand,outfile);\n    }\n\n  // Diagnose any error\n  if (status != MagickPass)\n    {\n      char *description;\n      ExceptionType severity;\n\n      description=MagickGetException(magick_wand,&amp;severity);\n      (void) fprintf(stderr,&quot;%.1024s (severity %d)\\n&quot;,\n                     description,severity);\n    }\n\n  // Release Wand handle\n  DestroyMagickWand(magick_wand);\n\n  // Destroy GraphicsMagick API\n  DestroyMagick();\n\n  return (status == MagickPass ? 0 : 1);\n}\n</pre>\n<p>To compile on Unix, the command looks something like this:</p>\n<pre class=\"literal-block\">\ngcc -o demo demo.c -O `GraphicsMagickWand-config --cppflags --ldflags --libs`\n</pre>\n<p>The GraphicsMagickWand-config script reproduces the options which were used to\ncompile the GraphicsMagick wand library. Using compatible options ensures that\nyour program will compile and run.</p>\n<hr class=\"docutils\" />\n<p>Copyright © GraphicsMagick Group 2009 - 2020</p>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/man/man1/GraphicsMagick++-config.1",
    "content": ".ad l\n.nh\n.TH Magick++-Config 1 \"2 May 2002\" \"GraphicsMagick\"\n.SH NAME\nGraphicsMagick++-config \\- get information about the installed version of Magick++\n.SH SYNOPSIS\n.B GraphicsMagick++-config \n.B [--cppflags]\n.B [--cxxflags]\n.B [--exec-prefix]\n.B [--ldflags]\n.B [--libs]\n.B [--prefix]\n.B [--version]\n.SH DESCRIPTION\n.B GraphicsMagick++-config\nprints the compiler and linker flags required to compile and link programs\nthat use the\n.BR GraphicsMagick\nC++ Application Programmer Interface (known as\n.BR Magick++\n).\n.SH EXAMPLES\nTo print the version of the installed distribution of\n.BR Magick++ ,\nuse:\n\n.nf\n  GraphicsMagick++-config --version\n.fi\n  \nTo compile a program that calls the \n.BR GraphicsMagick\nC++ Application Programmer Interface, use:\n\n.nf\n  c++ `GraphicsMagick++-config --cxxflags --cppflags --ldflags --libs` program.cpp\n.fi\n\n.SH OPTIONS\n.TP\n.B --cppflags\nPrint the preprocessor flags that are needed to find the\n.B GraphicsMagick\nC and C++ include files and defines to ensures that the GraphicsMagick data structures match between\nyour program and the installed libraries.\n.TP\n.B --cxxflags\nPrint the compiler flags that were used to compile \n.BR libMagick++ .\n.TP\n.B --exec-prefix\nPrint the directory under which target specific binaries and executables are installed.\n.TP\n.B --ldflags\nPrint the linker flags that are needed to link with the\n.B libMagick++\nlibrary.\n.TP\n.B --libs\nPrint the linker flags that are needed to link a program with\n.BR libMagick++ .\n.TP\n.B --prefix\nPrint the directory under which the package is installed.\n.TP\n.B --version\nPrint the version of the\n.B GraphicsMagick\ndistribution to standard output.\n.SH COPYRIGHT\nCopyright (C) 2002 GraphicsMagick Group\nCopyright (C) 2000 ImageMagick Studio\n.SH AUTHORS\nBob Friesenhahn, ImageMagick Studio\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/man/man1/GraphicsMagick-config.1",
    "content": ".ad l\n.nh\n.TH GraphicsMagick-Config 1 \"4 December 2002\" \"GraphicsMagick\"\n.SH NAME\nGraphicsMagick-config \\- get information about the installed version of GraphicsMagick\n.SH SYNOPSIS\n.B GraphicsMagick-config \n.B [--cflags]\n.B [--cppflags]\n.B [--exec-prefix]\n.B [--ldflags]\n.B [--libs]\n.B [--prefix]\n.B [--version]\n.SH DESCRIPTION\n.B GraphicsMagick-config\nprints the compiler and linker flags required to compile and link programs\nthat use the\n.BR GraphicsMagick\nApplication Programmer Interface.\n.SH EXAMPLES\nTo print the version of the installed distribution of\n.BR GraphicsMagick ,\nuse:\n\n.nf\n  GraphicsMagick-config --version\n.fi\n  \nTo compile a program that calls the \n.BR GraphicsMagick\nApplication Programmer Interface, use:\n\n.nf\n  cc `GraphicsMagick-config --cflags --cppflags --ldflags --libs` program.c\n.fi\n\n.SH OPTIONS\n.TP\n.B --cflags\nPrint the compiler flags that were used to compile \n.BR libMagick .\n.TP\n.B --cppflags\nPrint the preprocessor flags that are needed to find the\n.B GraphicsMagick\nC include files and defines to ensure that the GraphicsMagick data structures match between\nyour program and the installed libraries.\n.TP\n.B --exec-prefix\nPrint the directory under which target specific binaries and executables are installed.\n.TP\n.B --ldflags\nPrint the linker flags that are needed to link with the\n.B GraphicsMagick\nlibrary.\n.TP\n.B --libs\nPrint the linker flags that are needed to link a program with\n.BR libGraphicsMagick .\n.TP\n.B --version\nPrint the version of the\n.B GraphicsMagick\ndistribution to standard output.\n.SH COPYRIGHT\nCopyright (C) 2002 GraphicsMagick Group\n\nCopyright (C) 2002 ImageMagick Studio\n.SH AUTHORS\nBob Friesenhahn\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/man/man1/GraphicsMagickWand-config.1",
    "content": ".ad l\n.nh\n.TH GraphicsMagick-Config 1 \"15 June 2003\" \"GraphicsMagick\"\n.SH NAME\nGraphicsMagickWand-config \\- get information about the installed version of GraphicsMagick\n.SH SYNOPSIS\n.B GraphicsMagickWand-config\n.B [--cflags]\n.B [--cppflags]\n.B [--exec-prefix]\n.B [--ldflags]\n.B [--libs]\n.B [--prefix]\n.B [--version]\n.SH DESCRIPTION\n.B GraphicsMagickWand-config\nprints the compiler and linker flags required to compile and link programs\nthat use the\n.B GraphicsMagick Wand\nApplication Programmer Interface.\n.SH EXAMPLES\nTo print the version of the installed distribution of\n.BR GraphicsMagick ,\nuse:\n\n.nf\n  GraphicsMagickWand-config --version\n.fi\n\nTo compile a program that calls the\n.B GraphicsMagick Wand\nApplication Programmer Interface, use:\n\n.nf\n  cc `GraphicsMagickWand-config --cflags --cppflags --ldflags --libs` program.c\n.fi\n\n.SH OPTIONS\n.TP\n.B --cflags\nPrint the compiler flags that were used to compile\n.BR libGraphicsMagick .\n.TP\n.B --cppflags\nPrint the preprocessor flags that are needed to find the\n.B GraphicsMagick\nC include files and defines to ensure that the GraphicsMagick data structures match between\nyour program and the installed libraries.\n.TP\n.B --exec-prefix\nPrint the directory under which target specific binaries and executables are installed.\n.TP\n.B --ldflags\nPrint the linker flags that are needed to link with the\n.B GraphicsMagickWand\nlibrary.\n.TP\n.B --libs\nPrint the linker flags that are needed to link a program with\n.BR libMagick .\n.TP\n.B --version\nPrint the version of the\n.B GraphicsMagick\ndistribution to standard output.\n.SH COPYRIGHT\nCopyright (C) 2003 GraphicsMagick Group\n\nCopyright (C) 2002 ImageMagick Studio\n.SH AUTHORS\nBob Friesenhahn\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/man/man1/gm.1",
    "content": ".TH gm 1 \"2019/12/29\" \"GraphicsMagick\"\n.TP\n.in 15\n.in 15\n.in 20\n.SH NAME\n\ngm - command-line utility to create, edit, compare, convert, or display images\n\n.SH SYNOPSIS\n\n\\fBgm animate\\fP \\fB[\\fP \\fIoptions ...\\fP \\fB]\\fP \\fIfile\\fP \\fB[ [\\fP\n\\fIoptions ...\\fP \\fB]\\fP \\fIfile ...\\fP \\fB]\\fP\n\n\\fBgm batch\\fP \\fB[\\fP \\fIoptions ...\\fP \\fB]\\fP \\fB[\\fP \\fIscript\\fP \\fB]\\fP\n\n\\fBgm benchmark\\fP \\fB[\\fP \\fIoptions ...\\fP \\fB]\\fP subcommand\n\n\\fBgm compare\\fP \\fB[\\fP \\fIoptions\\fP \\fB... ]\\fP \\fIreference-image\\fP\n\\fB[\\fP \\fIoptions\\fP \\fB... ]\\fP \\fIcompare-image\\fP\n\\fB[\\fP \\fIoptions\\fP \\fB... ]\\fP\n\n\\fBgm composite\\fP \\fB[\\fP \\fIoptions ...\\fP \\fB]\\fP \\fIchange-image base-image\\fP\n\\fB[\\fP \\fImask-image\\fP \\fB]\\fP \\fIoutput-image\\fP\n\n\\fBgm conjure\\fP \\fB[\\fP \\fIoptions\\fP \\fB]\\fP \\fIscript.msl\\fP\n\\fB[ [\\fP \\fIoptions\\fP \\fB]\\fP \\fIscript.msl\\fP \\fB]\\fP\n\n\\fBgm convert\\fP \\fB[ [\\fP \\fIoptions ...\\fP \\fB] [\\fP \\fIinput-file ...\\fP\n\\fB] [\\fP \\fIoptions ...\\fP \\fB] ]\\fP \\fIoutput-file\\fP \n\n\\fBgm display\\fP \\fB[\\fP \\fIoptions ...\\fP \\fB]\\fP \\fIfile ...\\fP\n\\fB[ [\\fP\\fIoptions ...\\fP \\fB]\\fP\\fIfile ...\\fP \\fB]\\fP\n\n\\fBgm identify\\fP \\fIfile\\fP \\fB[\\fP \\fIfile ...\\fP \\fB]\\fP\n\n\\fBgm import\\fP \\fB[\\fP \\fIoptions ...\\fP \\fB]\\fP \\fIfile\\fP\n\n\\fBgm mogrify\\fP \\fB[\\fP \\fIoptions ...\\fP \\fB]\\fP \\fIfile ...\\fP\n\n\\fBgm montage\\fP \\fB[\\fP \\fIoptions ...\\fP \\fB]\\fP \\fIfile\\fP \\fB[ [\\fP\n\\fIoptions ...\\fP \\fB]\\fP \\fIfile ...\\fP \\fB]\\fP \\fIoutput-file\\fP\n\n\\fBgm time\\fP subcommand\n\n\\fBgm version\\fP\n.SH DESCRIPTION\n\nGraphicsMagick's \\fBgm\\fP provides a suite of utilities for creating,\ncomparing, converting, editing, and displaying images.  All of the\nutilities are provided as sub-commands of a single \\fBgm\\fP\nexecutable.  The \\fBgm\\fP executable returns the exit code 0 to\nindicate success, or 1 to indicate failure:\n\n\\fBanimate\\fP\ndisplays an animation (e.g. a GIF file) on any workstation display\nrunning an \\fIX\\fP server.\n\n\\fBbatch\\fP\nexecutes an arbitary number of the utility commands\n(e.g. \\fBconvert\\fP) in the form of a simple linear batch script in\norder to improve execution efficiency, and/or to allow use as a\nsubordinate co-process under the control of an arbitrary script or\nprogram.\n\n\\fBbenchmark\\fP\nexecutes one of the other utility commands (e.g. \\fBconvert\\fP) for a\nspecified number of iterations, or execution time, and reports\nexecution time and other profiling information such as CPU\nutilization. \\fBBenchmark\\fP provides various operating modes\nincluding executing the command with a varying number of threads, and\nalternate reporting formats such as comma-separated value (CSV).\n\n\\fBcompare\\fP\ncompares two images and reports difference statistics according to\nspecified metrics and/or outputs an image with a visual representation\nof the differences.  It may also be used to test if images are similar\nwithin a particular range and specified metric, returning a truth\nvalue to the executing environment.\n\n\\fBcomposite\\fP\ncomposites images (blends or merges images together) to create new images.\n\n\\fBconjure\\fP\ninterprets and executes scripts in\nthe Magick Scripting Language (MSL).\n\n\\fBconvert\\fP\nconverts an input file using one image format to an output file with\nthe same or differing image format while applying an arbitrary number\nof image transformations.\n\n\\fBdisplay\\fP\nis a machine architecture independent image processing and display\nfacility. It can display an image on any workstation display running\nan \\fIX\\fP server.\n\n\\fBidentify\\fP\ndescribes the format and characteristics of one or more image\nfiles. It will also report if an image is incomplete or corrupt.\n\n\\fBimport\\fP\nreads an image from any visible window on an \\fIX\\fP server and\noutputs it as an image file. You can capture a single window, the\nentire screen, or any rectangular portion of the screen.\n\n\\fBmogrify\\fP\ntransforms an image or a sequence of images. These transforms include\n\\fBimage scaling\\fP, \\fBimage rotation\\fP, \\fBcolor reduction\\fP,\nand others. The transmogrified image \\fBoverwrites\\fP the original\nimage.\n\n\\fBmontage\\fP\ncreates a composite by combining several separate images. The images\nare tiled on the composite image with the name of the image optionally\nappearing just below the individual tile.\n\n\\fBtime\\fP\nexecutes a subcommand and reports the user, system, and total\nexecution time consumed.\n\n\\fBversion\\fP\nreports the GraphicsMagick release version, maximum sample-depth,\ncopyright notice, supported features, and the options used while\nbuilding the software.\n\nThe \\fBGraphicsMagick\\fP utilities recognize the following image formats:\n\n\n\\fBName\\fP  \\fBMode\\fP \\fBDescription\\fP\n o  3FR       r-- Hasselblad Photo RAW\n o  8BIM      rw- Photoshop resource format\n o  8BIMTEXT  rw- Photoshop resource text format\n o  8BIMWTEXT rw- Photoshop resource wide text format\n o  APP1      rw- Raw application information\n o  APP1JPEG  rw- Raw JPEG binary data\n o  ART       r-- PF1: 1st Publisher\n o  ARW       r-- Sony Alpha DSLR RAW\n o  AVS       rw+ AVS X image\n o  BIE       rw- Joint Bi-level Image experts Group\n                  interchange format\n o  BMP       rw+ Microsoft Windows bitmap image\n o  BMP2      -w- Microsoft Windows bitmap image v2\n o  BMP3      -w- Microsoft Windows bitmap image v3\n o  CACHE     --- Magick Persistent Cache image format\n o  CALS      rw- Continuous Acquisition and Life-cycle\n                  Support Type 1 image\n o  CAPTION   r-- Caption (requires separate size info)\n o  CIN       rw- Kodak Cineon Format\n o  CMYK      rw- Raw cyan, magenta, yellow, and black\n                  samples (8 or 16 bits, depending on\n                  the image depth)\n o  CMYKA     rw- Raw cyan, magenta, yellow, black, and\n                  matte samples (8 or 16 bits, depending\n                  on the image depth)\n o  CR2       r-- Canon Photo RAW\n o  CRW       r-- Canon Photo RAW\n o  CUR       r-- Microsoft Cursor Icon\n o  CUT       r-- DR Halo\n o  DCM       r-- Digital Imaging and Communications in\n                  Medicine image\n o  DCR       r-- Kodak Photo RAW\n o  DCX       rw+ ZSoft IBM PC multi-page Paintbrush\n o  DNG       r-- Adobe Digital Negative\n o  DPS       r-- Display PostScript Interpreter\n o  DPX       rw- Digital Moving Picture Exchange\n o  EPDF      rw- Encapsulated Portable Document Format\n o  EPI       rw- Adobe Encapsulated PostScript\n                  Interchange format\n o  EPS       rw- Adobe Encapsulated PostScript\n o  EPS2      -w- Adobe Level II Encapsulated PostScript\n o  EPS3      -w- Adobe Level III Encapsulated PostScript\n o  EPSF      rw- Adobe Encapsulated PostScript\n o  EPSI      rw- Adobe Encapsulated PostScript\n                  Interchange format\n o  EPT       rw- Adobe Encapsulated PostScript with MS-DOS\n                  TIFF preview\n o  EPT2      rw- Adobe Level II Encapsulated PostScript\n                  with MS-DOS TIFF preview\n o  EPT3      rw- Adobe Level III Encapsulated PostScript\n                  with MS-DOS TIFF preview\n o  EXIF      rw- Exif digital camera binary data\n o  FAX       rw+ Group 3 FAX (Not TIFF Group3 FAX!)\n o  FITS      rw- Flexible Image Transport System\n o  FRACTAL   r-- Plasma fractal image\n o  FPX       rw- FlashPix Format\n o  GIF       rw+ CompuServe graphics interchange format\n o  GIF87     rw- CompuServe graphics interchange format\n                  (version 87a)\n o  GRADIENT  r-- Gradual passing from one shade to\n                  another\n o  GRAY      rw+ Raw gray samples (8/16/32 bits,\n                  depending on the image depth)\n o  HISTOGRAM -w- Histogram of the image\n o  HRZ       r-- HRZ: Slow scan TV\n o  HTML      -w- Hypertext Markup Language and a\n                  client-side image map\n o  ICB       rw+ Truevision Targa image\n o  ICC       rw- ICC Color Profile\n o  ICM       rw- ICC Color Profile\n o  ICO       r-- Microsoft icon\n o  ICON      r-- Microsoft icon\n o  IDENTITY  r-- Hald CLUT identity image\n o  IMAGE     r-- GraphicsMagick Embedded Image\n o  INFO      -w+ Image descriptive information and\n                   statistics\n o  IPTC      rw- IPTC Newsphoto\n o  IPTCTEXT  rw- IPTC Newsphoto text format\n o  IPTCWTEXT rw- IPTC Newsphoto wide text format\n o  JBG       rw+ Joint Bi-level Image experts Group\n                  interchange format\n o  JBIG      rw+ Joint Bi-level Image experts Group\n                  interchange format\n o  JNG       rw- JPEG Network Graphics\n o  JP2       rw- JPEG-2000 JP2 File Format Syntax\n o  JPC       rw- JPEG-2000 Code Stream Syntax\n o  JPEG      rw- Joint Photographic Experts Group\n                  JFIF format\n o  JPG       rw- Joint Photographic Experts Group\n                  JFIF format\n o  K25       r-- Kodak Photo RAW\n o  KDC       r-- Kodak Photo RAW\n o  LABEL     r-- Text image format\n o  M2V       rw+ MPEG-2 Video Stream\n o  MAP       rw- Colormap intensities and indices\n o  MAT       r-- MATLAB image format\n o  MATTE     -w+ MATTE format\n o  MIFF      rw+ Magick Image File Format\n o  MNG       rw+ Multiple-image Network Graphics\n o  MONO      rw- Bi-level bitmap in least-significant-\n                  -byte-first order\n o  MPC       rw+ Magick Persistent Cache image format\n o  MPEG      rw+ MPEG-1 Video Stream\n o  MPG       rw+ MPEG-1 Video Stream\n o  MRW       r-- Minolta Photo Raw\n o  MSL       r-- Magick Scripting Language\n o  MTV       rw+ MTV Raytracing image format\n o  MVG       rw- Magick Vector Graphics\n o  NEF       r-- Nikon Electronic Format\n o  NULL      r-- Constant image of uniform color\n o  OTB       rw- On-the-air bitmap\n o  P7        rw+ Xv thumbnail format\n o  PAL       rw- 16bit/pixel interleaved YUV\n o  PALM      rw- Palm Pixmap\n o  PBM       rw+ Portable bitmap format (black and white)\n o  PCD       rw- Photo CD\n o  PCDS      rw- Photo CD\n o  PCL       -w- Page Control Language\n o  PCT       rw- Apple Macintosh QuickDraw/PICT\n o  PCX       rw- ZSoft IBM PC Paintbrush\n o  PDB       rw+ Palm Database ImageViewer Format\n o  PDF       rw+ Portable Document Format\n o  PEF       r-- Pentax Electronic File\n o  PFA       r-- TrueType font\n o  PFB       r-- TrueType font\n o  PGM       rw+ Portable graymap format (gray scale)\n o  PGX       r-- JPEG-2000 VM Format\n o  PICON     rw- Personal Icon\n o  PICT      rw- Apple Macintosh QuickDraw/PICT\n o  PIX       r-- Alias/Wavefront RLE image format\n o  PLASMA    r-- Plasma fractal image\n o  PNG       rw- Portable Network Graphics\n o  PNG24     rw- Portable Network Graphics, 24 bit RGB\n                  opaque only\n o  PNG32     rw- Portable Network Graphics, 32 bit RGBA\n                  semitransparency OK\n o  PNG8      rw- Portable Network Graphics, 8-bit\n                  indexed, binary transparency only\n o  PNM       rw+ Portable anymap\n o  PPM       rw+ Portable pixmap format (color)\n o  PREVIEW   -w- Show a preview an image enhancement,\n                  effect, or f/x\n o  PS        rw+ Adobe PostScript\n o  PS2       -w+ Adobe Level II PostScript\n o  PS3       -w+ Adobe Level III PostScript\n o  PSD       rw- Adobe Photoshop bitmap\n o  PTIF      rw- Pyramid encoded TIFF\n o  PWP       r-- Seattle Film Works\n o  RAF       r-- Fuji Photo RAW\n o  RAS       rw+ SUN Rasterfile\n o  RGB       rw+ Raw red, green, and blue samples\n o  RGBA      rw+ Raw red, green, blue, and matte samples\n o  RLA       r-- Alias/Wavefront image\n o  RLE       r-- Utah Run length encoded image\n o  SCT       r-- Scitex HandShake\n o  SFW       r-- Seattle Film Works\n o  SGI       rw+ Irix RGB image\n o  SHTML     -w- Hypertext Markup Language and a\n                  client-side image map\n o  STEGANO   r-- Steganographic image\n o  SUN       rw+ SUN Rasterfile\n o  SVG       rw+ Scalable Vector Gaphics\n o  TEXT      rw+ Raw text\n o  TGA       rw+ Truevision Targa image\n o  TIFF      rw+ Tagged Image File Format\n o  TILE      r-- Tile image with a texture\n o  TIM       r-- PSX TIM\n o  TOPOL     r-- TOPOL X Image\n o  TTF       r-- TrueType font\n o  TXT       rw+ Raw text\n o  UIL       -w- X-Motif UIL table\n o  UYVY      rw- 16bit/pixel interleaved YUV\n o  VDA       rw+ Truevision Targa image\n o  VICAR     rw- VICAR rasterfile format\n o  VID       rw+ Visual Image Directory\n o  VIFF      rw+ Khoros Visualization image\n o  VST       rw+ Truevision Targa image\n o  WBMP      rw- Wireless Bitmap (level 0) image\n o  WMF       r-- Windows Metafile\n o  WPG       r-- Word Perfect Graphics\n o  X         rw- X Image\n o  X3F       r-- Foveon X3 (Sigma/Polaroid) RAW\n o  XBM       rw- X Windows system bitmap (black\n                  and white)\n o  XC        r-- Constant image uniform color\n o  XCF       r-- GIMP image\n o  XMP       rw- Adobe XML metadata\n o  XPM       rw- X Windows system pixmap (color)\n o  XV        rw+ Khoros Visualization image\n o  XWD       rw- X Windows system window dump (color)\n o  YUV       rw- CCIR 601 4:1:1 or 4:2:2 (8-bit only)\n                  \n    Modes:        \n              r   Read\n              w   Write\n              +   Multi-image\n\n\n\\fISupport for some of these formats require additional programs or libraries.\nSee README\nin the source package for where to find optional additional software\\fP.\n\nNote, a format delineated with + means that if more than one\nimage is specified, frames are combined into a single multi-image\nfile. Use \\fB+adjoin\\fP if you want a single image produced for each\nframe.\n\nYour installation might not support all of the formats in the list.\nTo get an accurate listing of the formats supported by your particular\nconfiguration, run \"gm convert -list format\".\n\nRaw images are expected to have one byte per pixel unless \\fBgm\\fP is\ncompiled in 16-bit quantum mode or in 32-bit quantum mode. Here, the\nraw data is expected to be stored two or four bytes per pixel,\nrespectively, in most-significant-byte-first order.  For example, you\ncan tell if \\fBgm\\fP was compiled in 16-bit mode by typing \"gm\nversion\" without any options, and looking for \"Q:16\" in the first line\nof output.\n.SH FILES AND FORMATS\n\nBy default, the image format is determined by its magic number, i.e., the\nfirst few bytes of the file. To specify\na particular image format, precede the filename with an image format name\nand a colon (\\fIi.e.\\fP\\fBps:image\\fP) or specify the image type as the\nfilename suffix (\\fIi.e.\\fP\\fBimage.ps\\fP).\nThe magic number takes precedence over the filename suffix\nand the prefix takes precedence over the magic number and the suffix\nin input files.\nWhen a file is read, its magic number is stored in the \"image->magick\"\nstring.\nIn output files, the prefix takes precedence over the filename suffix,\nand the filename suffix takes precedence over the\n\"image->magick\" string.\n\nTo read the \"built-in\" formats (GRANITE, H, LOGO,\nNETSCAPE, PLASMA, and ROSE) use a prefix (including the colon) without a\nfilename or suffix.  To read the XC format, follow the colon with a color\nspecification.  To read the CAPTION format, follow the colon with a text\nstring or with a filename prefixed with the at symbol (\\fB@\\fP).\n\n\nWhen you specify \\fBX\\fP as your image type, the filename has special\nmeaning. It specifies an X window by \\fBid, name\\fP, or\n\\fBroot\\fP. If\nno filename is specified, the window is selected by clicking the mouse\nin the desired window.\n\nSpecify \\fIinput_file\\fP as \\fB-\\fP for standard input,\n\\fIoutput_file\\fP as \\fB-\\fP for standard output.\nIf \\fIinput_file\\fP has the extension \\fB.Z\\fP or \\fB.gz\\fP, the\nfile is uncompressed with \\fBuncompress\\fP or \\fBgunzip\\fP\nrespectively.\nIf \\fIoutput_file\\fP has the extension \\fB.Z\\fP or \\fB.gz\\fP,\nthe file is compressed using with \\fIcompress\\fP or \\fIgzip\\fP respectively.\n\nUse an optional index enclosed in brackets after an input file name to\nspecify a desired subimage of a multi-resolution image format like\nPhoto CD (e.g. \"img0001.pcd[4]\") or a range for MPEG images\n(e.g. \"video.mpg[50-75]\"). A subimage specification can be\ndisjoint (e.g. \"image.tiff[2,7,4]\"). For raw images, specify\na subimage with a geometry (e.g. -size 640x512\n\"image.rgb[320x256+50+50]\").  Surround the image name with\nquotation marks to prevent your shell from interpreting the square\nbrackets. Single images are written with the filename you\nspecify. However, multi-part images (e.g., a multi-page PostScript\ndocument with \\fB+adjoin\\fP specified) may be written with the scene\nnumber included as part of the filename. In order to include the scene\nnumber in the filename, it is necessary to include a printf-style\n%d format specification in the file name and use the +adjoin\noption. For example,\n\n    image%02d.miff\n\n\nwrites files \\fIimage00.miff, image01.miff,\\fP etc. Only a single\nspecification is allowed within an output filename. If more than one\nspecification is present, it will be ignored. It is best to embed the\nscene number in the base part of the file name, not in the extension,\nbecause the extension will not be a recognizeable image type.\n\nWhen running a commandline utility, you can\nprepend an at sign @ to a filename to read a list of image\nfilenames from that file. This is convenient in the event you have too\nmany image filenames to fit on the command line.\n.SH OPTIONS\n\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images that follows,\nuntil the set is terminated by the appearance of any option or \\fB-noop\\fP.\nSome options only affect the decoding of images and others only the encoding.\nThe latter can appear after the final group of input images.\n\nThis is a combined list of the command-line options used by the\nGraphicsMagick utilities (\\fIanimate\\fP, \\fIcompare\\fP,\n\\fIcomposite\\fP, \\fIconvert\\fP, \\fIdisplay\\fP, \\fIidentify\\fP,\n\\fIimport\\fP, \\fImogrify\\fP and \\fImontage\\fP).\n\n\nIn this document, angle brackets (\"<>\") enclose variables and curly\nbrackets (\"{}\") enclose optional parameters. For example,\n\"\\fB-fuzz <distance>{%}\\fP\" means you can use the\noption \"-fuzz 10\"\nor \"-fuzz 2%\".\n\n.TP\n.B \"-adjoin\"\n\\fRjoin images into a single multi-image file\n\nBy default, all images of an image sequence are stored in the same\nfile. However, some formats (e.g. JPEG) do not support storing more\nthan one image per file and only the first frame in an image sequence\nwill be saved unless the result is saved to separate files. Use\n\\fB+adjoin\\fP to force saving multiple frames to multiple numbered\nfiles. If \\fB+adjoin\\fP is used, then the output filename must\ninclude a printf style formatting specification for the numeric part\nof the filename.  For example,\n\n    image%02d.miff\n\n.TP\n.B \"-affine \\fI<matrix>\"\\fP\n\\fRdrawing transform matrix\n\nThis option provides a transform matrix {sx,rx,ry,sy,tx,ty} for\nuse by subsequent \\fB-draw\\fP or \\fB-transform\\fP options.\n.TP\n.B \"-antialias\"\n\\fRremove pixel aliasing\n\nBy default antialiasing algorithms are used when drawing objects (e.g. lines)\nor rendering vector formats (e.g. WMF and Postscript). Use +antialias to\ndisable use of antialiasing algorithms. Reasons to disable antialiasing\ninclude avoiding increasing colors in the image, or improving rendering speed.\n.TP\n.B \"-append\"\n\\fRappend a set of images\n\nThis option creates a single image where the images in the original set\nare stacked top-to-bottom.  If they are not of the same width,\nany narrow images will be expanded to fit using the background color.\nUse \\fB+append\\fP to stack images left-to-right.  The set of images\nis terminated by the appearance of any option.\nIf the \\fB-append\\fP\noption appears after all of the input images, all images are appended.\n.TP\n.B \" \\fI-asc-cdl <spec>\"\\fP\n\\fRapply ASC CDL color transform\n\nApplies (\"bakes in\") the ASC CDL, which is a format for the exchange\nof basic primary color grading information between equipment and\nsoftware from different manufacturers. The format defines the math for\nthree functions: slope, offset and power. Each function uses a number\nfor the red, green, and blue color channels for a total of nine\nnumbers comprising a single color decision. The tenth number\n(optional) is for chromiance (saturation) as specified by ASC CDL\n1.2.\n\nThe argument string is comma delimited and is in the following form\n(but without invervening spaces or line breaks)\n\n    redslope,redoffset,redpower:\n    greenslope,greenoffset,greenpower:\n    blueslope,blueoffset,bluepower:\n    saturation\n\n\nwith the unity (no change) specification being:\n\n    \"1.0,0.0,1.0:1.0,0.0,1.0:1.0,0.0,1.0:1.0\"\n\n.TP\n.B \"-authenticate \\fI<string>\"\\fP\n\\fRdecrypt image with this password\n\nUse this option to supply a password for decrypting an image or an\nimage sequence, if it is being read from a format such as PDF that supports\nencryption.  Encrypting images being written is not supported.\n.TP\n.B \"-auto-orient\"\n\\fRorient (rotate) image so it is upright\n\nAdjusts the image orienation so that it is suitable for viewing.  Uses\nthe orientation tag obtained from the image file or as supplied by the\n\\fB-orient\\fP option.\n.TP\n.B \"-average\"\n\\fRaverage a set of images\n\nThe set of images\nis terminated by the appearance of any option.\nIf the \\fB-average\\fP\noption appears after all of the input images, all images are averaged.\n.TP\n.B \"-backdrop\"\n\\fRdisplay the image centered on a backdrop.\n\nThis backdrop covers the entire workstation screen and is useful for hiding\nother X window activity while viewing the image. The color of the backdrop\nis specified as the foreground color (X11 default is black).\nRefer to\n\"X Resources\", below,\nfor details.\n.TP\n.B \"-background \\fI<color>\"\\fP\n\\fRthe background color\n\nThe color is specified using the format described under the \\fB-fill\\fP\noption.\n.TP\n.B \"-black-threshold \\fIred[,green][,blue][,opacity]\"\\fP\n\\fRpixels below the threshold become black\n\nUse \\fB-black-threshold\\fP to set pixels with values below the specified\nthreshold to minimum value (black). If only one value is supplied, or the\nred, green, and blue values are identical, then intensity thresholding is\nused. If the color threshold values are not identical then channel-based\nthresholding is used, and color distortion will occur. Specify a negative\nvalue (e.g. -1) if you want a channel to be ignored but you do want to\nthreshold a channel later in the list. If a percent (%) symbol is\nappended, then the values are treated as a percentage of maximum\nrange.\n.TP\n.B \"-blue-primary \\fI<x>,<y>\"\\fP\n\\fRblue chromaticity primary point\n.TP\n.B \"-blur \\fI<radius>{x<sigma>}\"\\fP\n\\fRblur the image with a Gaussian operator\n\nBlur with the given radius and\nstandard deviation (sigma).\n.TP\n.B \"-border \\fI<width>x<height>\"\\fP\n\\fRsurround the image with a border of color\n\nSee \\fB-geometry\\fP for details\nabout the geometry specification.\n.TP\n.B \"-bordercolor \\fI<color>\"\\fP\n\\fRthe border color\n\nThe color is specified using the format described under the \\fB-fill\\fP\noption.\n.TP\n.B \"-borderwidth \\fI<geometry>\"\\fP\n\\fRthe border width\n.TP\n.B \"-box \\fI<color>\"\\fP\n\\fRset the color of the annotation bounding box\n\nThe color is specified using the format described under the \\fB-fill\\fP\noption.\n\nSee \\fB-draw\\fP for further\ndetails.\n.TP\n.B \"-channel \\fI<type>\"\\fP\n\\fRthe type of channel\n\nChoose from: \\fBRed\\fP, \\fBGreen\\fP, \\fBBlue\\fP, \\fBOpacity\\fP,\n\\fBMatte\\fP, \\fBCyan\\fP, \\fBMagenta\\fP, \\fBYellow\\fP, \\fBBlack\\fP,\nor \\fBGray\\fP.\n\nUse this option to extract a particular \\fIchannel\\fP from the image.\n\\fBOpacity\\fP,\nfor example, is useful for extracting the opacity values from an image.\n.TP\n.B \"-charcoal \\fI<factor>\"\\fP\n\\fRsimulate a charcoal drawing\n.TP\n.B \"-chop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRremove pixels from the interior of an image\n\n\\fIWidth\\fP and \\fIheight\\fP give the number of columns and rows to remove,\nand \\fIx\\fP and \\fIy\\fP are offsets that give the location of the\nleftmost column and topmost row to remove.\n\nThe \\fIx\\fP offset normally specifies the leftmost column to remove.\nIf the \\fB-gravity\\fP option is present with \\fINorthEast, East,\\fP\nor \\fISouthEast\\fP\ngravity, it gives the distance leftward from the right edge\nof the image to the rightmost column to remove.  Similarly, the \\fIy\\fP offset\nnormally specifies the topmost row to remove, but if\nthe \\fB-gravity\\fP option is present with \\fISouthWest, South,\\fP\nor \\fISouthEast\\fP\ngravity, it specifies the distance upward from the bottom edge of the\nimage to the bottom row to remove.\n\nThe \\fB-chop\\fP option removes entire rows and columns,\nand moves the remaining corner blocks leftward and upward to close the gaps.\n.TP\n.B \"-clip\"\n\\fRapply the clipping path, if one is present\n\nIf a clipping path is present, it will be applied to subsequent operations.\n\nFor example, if you type the following command:\n\n    gm convert -clip -negate cockatoo.tif negated.tif\n\n\nonly the pixels within the clipping path are negated.\n\nThe \\fB-clip\\fP feature requires the XML library.  If the XML library\nis not present, the option is ignored.\n.TP\n.B \"-coalesce\"\n\\fRmerge a sequence of images\n\nEach image N in the sequence after Image 0 is replaced with the image\ncreated by flattening images 0 through N.\n\nThe set of images\nis terminated by the appearance of any option.\nIf the \\fB-coalesce\\fP\noption appears after all of the input images, all images are coalesced.\n.TP\n.B \"-colorize \\fI<value>\"\\fP\n\\fRcolorize the image with the pen color\n\nSpecify the amount of colorization as a percentage. You can apply separate\ncolorization values to the red, green, and blue channels of the image with\na colorization value list delimited with slashes (e.g. 0/0/50).\n\nThe \\fB-colorize\\fP option may be used in conjunction with \\fB-modulate\\fP\nto produce a nice sepia toned image like:\n\n    gm convert input.ppm -modulate 115,0,100 \\\\\n              -colorize 7,21,50 output.ppm.\n\n.TP\n.B \"-colormap \\fI<type>\"\\fP\n\\fRdefine the colormap type\n\nChoose between \\fBshared\\fP or \\fBprivate\\fP.\n\nThis option only applies when the default X server visual is \\fIPseudoColor\\fP\nor \\fIGRAYScale\\fP. Refer to \\fB-visual\\fP for more details. By default,\na shared colormap is allocated. The image shares colors with other X clients.\nSome image colors could be approximated, therefore your image may look\nvery different than intended. Choose \\fBPrivate\\fP and the image colors\nappear exactly as they are defined. However, other clients may\ngo \\fItechnicolor\\fP when the image colormap is installed.\n.TP\n.B \"-colors \\fI<value>\"\\fP\n\\fRpreferred number of colors in the image\n\nThe actual number of colors in the image may be less than your request,\nbut never more. Note, this is a color reduction option. Images with less\nunique colors than specified with this option will have any duplicate or\nunused colors removed. The ordering of an existing color palette may be\naltered. When converting an image from color to grayscale, convert the\nimage to the gray colorspace before reducing the number of colors since\ndoing so is most efficient. Refer to <a\nhref=\"quantize.html\">quantize for more details.\n\nNote, options \\fB-dither\\fP, \\fB-colorspace\\fP, and \\fB-treedepth\\fP\naffect the color reduction algorithm.\n.TP\n.B \"-colorspace \\fI<value>\"\\fP\n\\fRthe type of colorspace\n\nChoices are:\n\\fBCineonLog\\fP, \\fBCMYK\\fP, \\fBGRAY\\fP, \\fBHSL\\fP, \\fBHWB\\fP,\n\\fBOHTA\\fP, \\fBRGB\\fP, \\fBRec601Luma\\fP, \\fBRec709Luma\\fP,\n\\fBRec601YCbCr\\fP, \\fBRec709YCbCr\\fP, \\fBTransparent\\fP, \\fBXYZ\\fP,\n\\fBYCbCr\\fP, \\fBYIQ\\fP, \\fBYPbPr\\fP, or \\fBYUV\\fP.\n\nColor reduction, by default, takes place in the RGB color space. Empirical\nevidence suggests that distances in color spaces such as YUV or YIQ correspond\nto perceptual color differences more closely than do distances in RGB space.\nThese color spaces may give better results when color reducing an image.\nRefer to quantize for more details.\nTwo gray colorspaces are supported. The \\fBRec601Luma\\fP space is\nbased on the recommendations for legacy NTSC television (ITU-R\nBT.601-5).  The \\fBRec709Luma\\fP space is based on the\nrecommendations for HDTV (Rec. ITU-R BT.709-5) and is suitable for use\nwith computer graphics, and for contemporary CRT displays. The\n\\fBGRAY\\fP colorspace currently selects the \\fBRec601Luma\\fP\ncolorspace by default for backwards compatibly reasons. This default\nmay be re-considered in the future.\n\nTwo YCbCr colorspaces are supported. The \\fBRec601YCbCr\\fP space is\nbased on the recommendations for legacy NTSC television (ITU-R BT.601-5). The\n\\fBRec709CbCr\\fP space is based on the recommendations for HDTV (Rec.\nITU-R BT.709-5) and is suitable for suitable for use with computer\ngraphics, and for contemporary CRT displays. The \\fBYCbCr\\fP colorspace\nspecification is equivalent to\\fBRec601YCbCr\\fP.\n\n\nThe \\fBTransparent\\fP color space behaves uniquely in that it preserves\nthe matte channel of the image if it exists.\n\nThe \\fB-colors\\fP or \\fB-monochrome\\fP option, or saving to a file\nformat which requires color reduction, is required for this option to\ntake effect.\n.TP\n.B \"-comment \\fI<string>\"\\fP\n\\fRannotate an image with a comment\n\nUse this option to assign a specific comment to the image, when writing\nto an image format that supports comments. You can include the\nimage filename, type, width, height, or other image attribute by embedding\nspecial format characters listed under the \\fB-format\\fP option.\nThe comment is not drawn on the image, but is embedded in the image\ndatastream via a \"Comment\" tag or similar mechanism.  If you want the\ncomment to be visible on the image itself, use the \\fB-draw\\fP option\ninstead.\n\nFor example,\n\n     -comment \"%m:%f %wx%h\"\n\n\nproduces an image comment of \\fBMIFF:bird.miff 512x480\\fP for an image\ntitled \\fBbird.miff\\fP and whose width is 512 and height is 480.\n\nIf the first character of \\fIstring\\fP is \\fI@\\fP, the image comment\nis read from a file titled by the remaining characters in the string.\nPlease note that if the string comes from an untrusted source that it\nshould be sanitized before use since otherwise the content of an\narbitrary readable file could be incorporated in a comment in the\noutput file (a security risk).\n\nIf the -comment option appears multiple times, only the last comment is\nstored.\n\nIn PNG images, the comment is stored in a \\fBtEXt\\fP or \\fBzTXt\\fP chunk\nwith the keyword \"comment\".\n.TP\n.B \"-compose \\fI<operator>\"\\fP\n\\fRthe type of image composition\n\nThe description of composition uses abstract terminology in order to\nallow the the description to be more clear, while avoiding constant\nvalues which are specific to a particular build configuration. Each image\npixel is represented by red, green, and blue levels (which are equal for\na gray pixel). MaxRGB is the maximum integral value which may be stored\nin the red, green, or blue channels of the image. Each image pixel may\nalso optionally (if the image matte channel is enabled) have an\nassociated level of opacity (ranging from opaque to transparent), which\nmay be used to determine the influence of the pixel color when\ncompositing the pixel with another image pixel. If the image matte\nchannel is disabled, then all pixels in the image are treated as opaque.\nThe color of an \\fIopaque\\fP pixel is fully visible while the color of a\n\\fItransparent\\fP pixel color is entirely absent (pixel color is ignored).\n\nBy definition, raster images have a rectangular shape. All image rows are\nof equal length, and all image columns have the same number of rows. By\ntreating the opacity channel as a visual \"mask\" the rectangular image may\nbe given a \"shape\" by treating the opacity channel as a cookie-cutter for\nthe image. Pixels within the shape are opaque, while pixels outside the\nshape are transparent. Pixels on the boundary of the shape may be between\nopaque and transparent in order to provide antialiasing (visually smooth\nedges). The description of the composition operators use this concept of\nimage \"shape\" in order to make the description of the operators easier to\nunderstand. While it is convenient to describe the operators in terms of\n\"shapes\" they are by no means limited to mask-style operations since they\nare based on continuous floating-point mathematics rather than simple\nboolean operations.\n\nBy default, the \\fIOver\\fP composite operator is used. The following\ncomposite operators are available:\n\n     Over\n     In\n     Out\n     Atop\n     Xor\n     Plus\n     Minus\n     Add\n     Subtract\n     Difference\n     Divide\n     Multiply\n     Bumpmap\n     Copy\n     CopyRed\n     CopyGreen\n     CopyBlue\n     CopyOpacity\n     CopyCyan\n     CopyMagenta\n     CopyYellow\n     CopyBlack\n\n\nThe behavior of each operator is described below.\n\n.in 15\n\n.in 15\n.B \"Over\"\n.in 20\n \\fR\n.in 20\nThe result will be the union of the two image shapes, with opaque areas\nof \\fIchange-image\\fP obscuring \\fIbase-image\\fP in the region of\noverlap.\n\n.in 15\n.in 15\n.B \"In\"\n.in 20\n \\fR\n.in 20\nThe result is simply \\fIchange-image\\fP cut by the shape of\n\\fIbase-image\\fP. None of the image data of \\fIbase-image\\fP will be in\nthe result.\n\n.in 15\n.in 15\n.B \"Out\"\n.in 20\n \\fR\n.in 20\nThe resulting image is \\fIchange-image\\fP with the shape of\n\\fIbase-image\\fP cut out.\n\n.in 15\n.in 15\n.B \"Atop\"\n.in 20\n \\fR\n.in 20\nThe result is the same shape as \\fIbase-image\\fP, with\n\\fIchange-image\\fP obscuring \\fIbase-image\\fP where the image shapes\noverlap. Note this differs from \\fBover\\fP because the portion of\n\\fIchange-image\\fP outside \\fIbase-image\\fP's shape does not appear in\nthe result.\n\n.in 15\n.in 15\n.B \"Xor\"\n.in 20\n \\fR\n.in 20\nThe result is the image data from both \\fIchange-image\\fP and\n\\fIbase-image\\fP that is outside the overlap region. The overlap region\nwill be blank.\n\n.in 15\n.in 15\n.B \"Plus\"\n.in 20\n \\fR\n.in 20\nThe result is just the sum of the image data. Output values are cropped\nto MaxRGB (no overflow). This operation is independent of the matte\nchannels.\n\n.in 15\n.in 15\n.B \"Minus\"\n.in 20\n \\fR\n.in 20\nThe result of \\fIchange-image\\fP - \\fIbase-image\\fP, with underflow\ncropped to zero. The matte channel is ignored (set to opaque, full\ncoverage).\n\n.in 15\n.in 15\n.B \"Add\"\n.in 20\n \\fR\n.in 20\nThe result of \\fIchange-image\\fP + \\fIbase-image\\fP, with overflow\nwrapping around (\\fImod\\fP MaxRGB+1).\n\n.in 15\n.in 15\n.B \"Subtract\"\n.in 20\n \\fR\n.in 20\nThe result of \\fIchange-image\\fP - \\fIbase-image\\fP, with underflow\nwrapping around (\\fImod\\fP MaxRGB+1). The \\fBadd\\fP and \\fBsubtract\\fP\noperators can be used to perform reversible transformations.\n\n.in 15\n.in 15\n.B \"Difference\"\n.in 20\n \\fR\n.in 20\nThe result of abs(\\fIchange-image\\fP - \\fIbase-image\\fP). This is\nuseful for comparing two very similar images.\n\n.in 15\n.in 15\n.B \"Divide\"\n.in 20\n \\fR\n.in 20\nThe result of \\fIchange-image\\fP / \\fIbase-image\\fP. This is useful\nfor improving the readability of text on unevenly illuminated photos (by\nusing a gaussian blurred copy of change-image as base-image).\n\n.in 15\n.in 15\n.B \"Multiply\"\n.in 20\n \\fR\n.in 20\nThe result of \\fIchange-image\\fP * \\fIbase-image\\fP. This is useful for\nthe creation of drop-shadows.\n\n.in 15\n.in 15\n.B \"Bumpmap\"\n.in 20\n \\fR\n.in 20\nThe result \\fIbase-image\\fP shaded by \\fIchange-image\\fP.\n\n.in 15\n.in 15\n.B \"Copy\"\n.in 20\n \\fR\n.in 20\nThe resulting image is \\fIbase-image\\fP replaced with\n\\fIchange-image\\fP. Here the matte information is ignored.\n\n.in 15\n.in 15\n.B \"CopyRed\"\n.in 20\n \\fR\n.in 20\nThe resulting image is the red channel in \\fIbase-image\\fP replaced with\nthe red channel in \\fIchange-image\\fP. The other channels are copied\nuntouched.\n\n.in 15\n.in 15\n.B \"CopyGreen\"\n.in 20\n \\fR\n.in 20\nThe resulting image is the green channel in \\fIbase-image\\fP replaced\nwith the green channel in \\fIchange-image\\fP. The other channels are\ncopied untouched.\n\n.in 15\n.in 15\n.B \"CopyBlue\"\n.in 20\n \\fR\n.in 20\nThe resulting image is the blue channel in \\fIbase-image\\fP replaced\nwith the blue channel in \\fIchange-image\\fP. The other channels are\ncopied untouched.\n\n.in 15\n.in 15\n.B \"CopyOpacity\"\n.in 20\n \\fR\n.in 20\nThe resulting image is the opacity channel in \\fIbase-image\\fP replaced\nwith the opacity channel in \\fIchange-image\\fP. The other channels are\ncopied untouched.\n\n.in 15\n.in 15\n.B \"CopyCyan\"\n.in 20\n \\fR\n.in 20\nThe resulting image is the cyan channel in \\fIbase-image\\fP replaced\nwith the cyan channel in \\fIchange-image\\fP. The other channels are\ncopied untouched. Use of this operator requires that base-image be in\nCMYK(A) colorspace.\n\n.in 15\n.in 15\n.B \"CopyMagenta\"\n.in 20\n \\fR\n.in 20\nThe resulting image is the magenta channel in \\fIbase-image\\fP\nreplaced with the magenta channel in \\fIchange-image\\fP. The other\nchannels are copied untouched. Use of this operator requires that\nbase-image be in CMYK(A) colorspace.\n\n.in 15\n.in 15\n.B \"CopyYellow\"\n.in 20\n \\fR\n.in 20\nThe resulting image is the yellow channel in \\fIbase-image\\fP\nreplaced with the yellow channel in \\fIchange-image\\fP. The other\nchannels are copied untouched. Use of this operator requires that\nbase-image be in CMYK(A) colorspace.\n\n.in 15\n.in 15\n.B \"CopyBlack\"\n.in 20\n \\fR\n.in 20\nThe resulting image is the black channel in \\fIbase-image\\fP\nreplaced with the black channel in \\fIchange-image\\fP. The other\nchannels are copied untouched. Use of this operator requires that\nbase-image be in CMYK(A) colorspace. If change-image is not in CMYK\nspace, then the change-image pixel intensities are used.\n\n.in 15\n\n\n.TP\n.B \"-compress \\fI<type>\"\\fP\n\\fRthe type of image compression\n\nChoices are: \\fINone\\fP, \\fIBZip\\fP, \\fIFax\\fP,\n\\fIGroup3\\fP, \\fIGroup4\\fP,\n\\fIJPEG\\fP, \\fILossless\\fP,\n\\fILZW\\fP, \\fIRLE\\fP, \\fIZip\\fP, \\fILZMA\\fP, \\fIJPEG2000\\fP,\n\\fIJPEG2000\\fP, \\fIJBIG\\fP, \\fIJBIG2\\fP, \\fIWebP\\fP, or \\fIZSTD\\fP.\n\n\nSpecify \\fB+compress\\fP to store the binary image in an uncompressed format.\nThe default is the compression type of the specified image file.\n\n\\fI\"Lossless\"\\fP refers to lossless JPEG, which is only available if\nthe JPEG library has been patched to support it. Use of lossless JPEG is\ngenerally not recommended.\n\nUse the \\fB-quality\\fP option to set the compression level to be used\nby the JPEG, JPEG-2000, PNG, MIFF, MPEG, and TIFF encoders. Use the\n\\fB-sampling-factor\\fP option to set the sampling factor to be used\nby the DPX, JPEG, MPEG, and YUV encoders for downsampling the chroma\nchannels.\n.TP\n.B \"-contrast\"\n\\fRenhance or reduce the image contrast\n\nThis option enhances the intensity differences between the lighter and\ndarker elements of the image. Use \\fB-contrast\\fP to enhance\nthe image\nor \\fB+contrast\\fP to reduce the image contrast.\n\n\nFor a more pronounced effect you can repeat the option:\n\n    gm convert rose: -contrast -contrast rose_c2.png\n\n.TP\n.B \"-convolve \\fI<kernel>\"\\fP\n\\fRconvolve image with the specified convolution kernel\n\nThe kernel is specified as a comma-separated list of floating point\nvalues, ordered left-to right, starting with the top row. The order of\nthe kernel is determined by the square root of the number of entries.\nPresently only square kernels are supported.\n.TP\n.B \"-create-directories\"\n\\fRcreate output directory if required\n\nUse this option with \\fB-output-directory\\fP if the input paths contain\nsubdirectories and it is desired to create similar subdirectories in the\noutput directory.  Without this option, \\fBmogrify\\fP will fail if the\nrequired output directory does not exist.\n.TP\n.B \"-crop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRpreferred size and location of the cropped image\n\nSee \\fB-geometry\\fP for details\nabout the geometry specification.\n\nThe width and height give the size of the image that remains after cropping,\nand \\fIx\\fP and \\fIy\\fP are offsets that give the location of the top left\ncorner of the cropped\nimage with respect to the original image.  To specify the amount to be\nremoved, use \\fB-shave\\fP instead.\n\nIf the \\fIx\\fP and \\fIy\\fP offsets are present, a single image is\ngenerated, consisting of the pixels from the cropping region.\nThe offsets specify the location of the upper left corner of\nthe cropping region measured downward and rightward with respect to the\nupper left corner of the image.\nIf the \\fB-gravity\\fP option is present with \\fINorthEast, East,\\fP\nor \\fISouthEast\\fP\ngravity, it gives the distance leftward from the right edge\nof the image to the right edge of the cropping region.  Similarly, if\nthe \\fB-gravity\\fP option is present with \\fISouthWest, South,\\fP\nor \\fISouthEast\\fP\ngravity, the distance is measured upward between the bottom\nedges.\n\nIf the \\fIx\\fP and \\fIy\\fP offsets are omitted, a set of tiles of the\nspecified geometry, covering the entire input image, is generated.  The\nrightmost tiles and the bottom tiles are smaller if the\nspecified geometry extends beyond the dimensions of the input image.\n.TP\n.B \"-cycle \\fI<amount>\"\\fP\n\\fRdisplace image colormap by amount\n\n\\fIAmount\\fP defines the number of positions each colormap entry isshifted.\n\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n\nThe events parameter specifies which events are to be logged.  It\ncan be either None, All, or a comma-separated list\nconsisting of one or more of the following domains:\nAnnotate,\nBlob,\nCache,\nCoder,\nConfigure,\nDeprecate,\nError,\nException,\nFatalError,\nInformation,\nLocale,\nOption,\nRender,\nResource,\nTemporaryFile,\nTransform,\nUser.\nWarning, or\nX11,\nFor example, to log cache and blob events, use\n\n    gm convert -debug \"Cache,Blob\" rose: rose.png\n\n\nThe \"User\" domain is normally empty, but developers can log \"User\" events\nin their private copy of GraphicsMagick.\n\nUse the \\fB-log\\fP option to specify the format for debugging output.\n\nUse \\fB+debug\\fP to turn off all logging.\n\nAn alternative to using \\fB-debug\\fP is to use the \\fBMAGICK_DEBUG\\fP\nenvironment variable. The allowed values for the \\fBMAGICK_DEBUG\\fP\nenvironment variable are the same as for the \\fB-debug\\fP option.\n.TP\n.B \"-deconstruct\"\n\\fRbreak down an image sequence into constituent parts\n\nThis option compares each image with the next in a sequence and\nreturns the maximum bounding region of any pixel differences it discovers.\nThis method can undo a coalesced sequence returned by the\n\\fB-coalesce\\fP option, and is useful for removing redundant information\nfrom a GIF or MNG animation.\n\nThe sequence of images\nis terminated by the appearance of any option.\nIf the \\fB-deconstruct\\fP\noption appears after all of the input images, all images are deconstructed.\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\nThis option creates one or more definitions for coders and\ndecoders to use while reading and writing image data. Definitions\nmay be passed to coders and decoders to control options that are\nspecific to certain image formats. If \\fIvalue\\fP is missing for a\ndefinition, an empty-valued definition of a flag will be created with\nthat name. This is used to control on/off options. Use +define\n<key>,... to remove definitions previously created. Use\n+define \"*\" to remove all existing definitions.\n\nThe following definitions may be created:\n\n.in 15\n\n.in 15\n.B \"cineon:colorspace={rgb|cineonlog}\"\n.in 20\n \\fR\n.in 20\nUse the cineon:colorspace option when reading a Cineon file to\nspecify the colorspace the Cineon file uses. This overrides the colorspace\ntype implied by the DPX header (if any).\n\n.in 15\n.in 15\n.B \"dpx:bits-per-sample=<value>\"\n.in 20\n \\fR\n.in 20\nIf the dpx:bits-per-sample key is defined, GraphicsMagick will write\nDPX images with the specified bits per sample, overriding any existing\ndepth value. If this option is not specified, then the value is based on\nthe existing image depth value from the original image file. The DPX\nstandard supports bits per sample values of 1, 8, 10, 12, and 16. Many\nDPX readers demand a sample size of 10 bits with type A padding (see\nbelow).\n\n.in 15\n.in 15\n.B \"dpx:colorspace={rgb|cineonlog}\"\n.in 20\n \\fR\n.in 20\nUse the dpx:colorspace option when reading a DPX file to\nspecify the colorspace the DPX file uses. This overrides the colorspace\ntype implied by the DPX header (if any).\n\n.in 15\n.in 15\n.B \"dpx:packing-method={packed|a|b|lsbpad|msbpad}\"\n.in 20\n \\fR\n.in 20\nDPX samples are output within 32-bit words. They may be tightly\npacked end-to-end within the words (\"packed\"), padded with null bits to\nthe right of the sample (\"a\" or \"lsbpad\"), or padded with null bits to the\nleft of the sample (\"b\" or \"msbpad\"). This option only has an effect for\nsample sizes of 10 or 12 bits. If samples are not packed, the DPX\nstandard recommends type A padding. Many DPX readers demand a sample size\nof 10 bits with type A padding.\n\n.in 15\n.in 15\n.B \"dpx:pixel-endian={lsb|msb}\"\n.in 20\n \\fR\n.in 20\nAllows the user to specify the endian order of the pixels when\nreading or writing the DPX files. Sometimes this is useful if the file is\n(or must be) written incorrectly so that the file header and the pixels\nuse different endianness.\n\n.in 15\n.in 15\n.B \"dpx:swap-samples={true|false}\"\n.in 20\n \\fR\n.in 20\nGraphicsMagick strives to adhere to the DPX standard but certain\naspects of the standard can be quite confusing. As a result, some 10-bit\nDPX files have Red and Blue interchanged, or Cb and Cr interchanged due\nto an different interpretation of the standard, or getting the wires\ncrossed. The swap-samples option may be supplied when reading or writing\nin order to read or write using the necessary sample order.\n\n.in 15\n.in 15\n.B \"gradient:direction={South|North|West|East|NorthWest|NorthEast|SouthWest|SouthEast}\"\n.in 20\n \\fR\n.in 20\nBy default, the gradient coder produces a gradient from top to\nbottom (\"South\").  Since GraphicsMagick 1.3.35, the gradient direction\nmay be specified to produce gradient vectors according to a\ngravity-like specification.  The arguments are \\fBSouth\\fP (Top to\nBottom), \\fBNorth\\fP (Bottom to Top), \\fBWest\\fP (Right to Left),\n\\fBEast\\fP (Left to Right), \\fBNorthWest\\fP (Bottom-Right to\nTop-Left), \\fBNorthEast\\fP (Bottom-Left to Top-Right),\n\\fBSouthWest\\fP (Top-Right Bottom-Left), and \\fBSouthEast\\fP\n(Top-Left to Bottom-Right).\n\n.in 15\n.in 15\n.B \"jp2:rate=<value>\"\n.in 20\n \\fR\n.in 20\nSpecify the compression factor to use while writing JPEG-2000\nfiles. The compression factor is the reciprocal of the compression\nratio. The valid range is 0.0 to 1.0, with 1.0 indicating lossless\ncompression. If defined, this value overrides the -quality\nsetting. The default quality setting of 75 results in a rate value of\n0.06641.\n\n.in 15\n.in 15\n.B \"jpeg:block-smoothing={true|false}\"\n.in 20\n \\fR\n.in 20\nEnables or disables block smoothing when reading a JPEG file\n(default enabled).\n\n.in 15\n.in 15\n.B \"jpeg:dct-method=<value>\"\n.in 20\n \\fR\n.in 20\nSelects the IJG JPEG library DCT implementation to use. The\nencoding implementations vary in speed and encoding error. The\navailable choices for \\fBvalue\\fP are \\fBislow\\fP, \\fBifast\\fP,\n\\fBfloat\\fP, \\fBdefault\\fP and \\fBfastest\\fP. Note that\n\\fBfastest\\fP might not necessarily be fastest on your CPU, depending\non the choices made when the JPEG library was built and how your CPU\nbehaves.\n\n.in 15\n.in 15\n.B \"jpeg:fancy-upsampling={true|false}\"\n.in 20\n \\fR\n.in 20\nEnables or disables fancy upsampling when reading a JPEG file\n(default enabled).\n\n.in 15\n.in 15\n.B \"jpeg:max-scan-number=<value>\"\n.in 20\n \\fR\n.in 20\nSpecifies an integer value for the maximum number of progressive\nscans allowed in a JPEG file.  The default maximum is 100 scans.  This\nlimit is imposed due to a weakness in the JPEG standard which allows\nsmall JPEG files to take many minutes or hours to be read.\n\n.in 15\n.in 15\n.B \"jpeg:max-warnings=<value>\"\n.in 20\n \\fR\n.in 20\nSpecifies an integer value for how many warnings are allowed for\nany given error type before being promoted to a hard error.  JPEG\nfiles producing excessive warnings indicate a problem with the file.\n\n.in 15\n.in 15\n.B \"jpeg:optimize-coding={true|false}\"\n.in 20\n \\fR\n.in 20\nSelects if huffman encoding should be used. Huffman encoding is enabled\nby default, but may be disabled for very large images since it encoding\nrequires that the entire image be buffered in memory. Huffman encoding\nproduces smaller JPEG files at the expense of added compression time and\nmemory consumption.\n\n.in 15\n.in 15\n.B \"jpeg:preserve-settings\"\n.in 20\n \\fR\n.in 20\nIf the jpeg:preserve-settings flag is defined, the JPEG encoder will\nuse the same \"quality\" and \"sampling-factor\" settings that were found\nin the input file, if the input was in JPEG format. These settings are\nalso preserved if the input is a JPEG file and the output is a JNG\nfile.  If the colorspace of the output file differs from that of the\ninput file, the quality setting is preserved but the sampling-factors\nare not.\n\n.in 15\n.in 15\n.B \"pcl:fit-to-page\"\n.in 20\n \\fR\n.in 20\nIf the pcl:fit-to-page flag is defined, then the printer is\nrequested to scale the image to fit the page size (width and/or\nheight).\n.in 15\n.in 15\n.B \"mng:maximum-loops=<value>\"\n.in 20\n \\fR\n.in 20\nmng:maximum-loops specifies the maximum number of loops allowed to\nbe specified by a MNG LOOP chunk. Without an imposed limit, a MNG file\ncould request up to 2147483647 loops, which could run for a very long\ntime.  The current default limit is 512 loops.\n\n.in 15\n.in 15\n.B \"pdf:use-cropbox={true|false}\"\n.in 20\n \\fR\n.in 20\nIf the pdf:use-cropbox flag is set to \\fBtrue\\fP, then\nGhostscript is requested to apply the PDF crop box.\n\n.in 15\n.in 15\n.B \"pdf:stop-on-error={true|false}\"\n.in 20\n \\fR\n.in 20\nIf the pdf:stop-on-error flag is set to \\fBtrue\\fP, then\nGhostscript is requested to stop processing the PDF when the first\nerror is encountered.  Otherwise it will attempt to process all\nrequested pages.\n\n.in 15\n.in 15\n.B \"ps:imagemask\"\n.in 20\n \\fR\n.in 20\nIf the ps:imagemask flag is defined, the PS3 and EPS3 coders will\ncreate Postscript files that render bilevel images with the Postscript\nimagemask operator instead of the image operator.\n\n.in 15\n.in 15\n.B \"ptif:minimum-geometry=<geometry>\"\n.in 20\n \\fR\n.in 20\nIf the ptif:minimum-geometry key is defined, GraphicsMagick will\nuse it to determine the minimum frame size to output when writing a\npyramid TIFF file (a TIFF file containing a succession of reduced\nversions of the first frame). The default minimum geometry is 32x32.\n\n.in 15\n.in 15\n.B \"tiff:alpha={unspecified|associated|unassociated}\"\n.in 20\n \\fR\n.in 20\nSpecify the TIFF alpha channel type when reading or writing TIFF files,\noverriding the normal value. The default alpha channel type for new files\nis unspecified alpha. Existing alpha settings are preserved when\nconverting from one TIFF file to another. When a TIFF file uses\nassociated alpha, the image pixels are pre-multiplied (i.e. altered) with\nthe alpha channel. Files with \"associated\" alpha appear as if they were\nalpha composited on a black background when the matte channel is\ndisabled. If the unassociated alpha type is selected, then the alpha\nchannel is saved without altering the pixels. Photoshop recognizes\nassociated alpha as transparency information, if the file is saved with\nunassociated alpha, the alpha information is loaded as an independent\nchannel.  Note that for many years, ImageMagick and GraphicsMagick marked\nTIFF files as using associated alpha, without properly pre-multiplying\nthe pixels.\n\n.in 15\n.in 15\n.B \"tiff:fill-order={msb2lsb|lsb2msb}\"\n.in 20\n \\fR\n.in 20\nIf the tiff:fill-order key is defined, GraphicsMagick will use it to\ndetermine the bit fill order used while writing TIFF files. The normal default\nis \"msb2lsb\", which matches the native bit order of all modern CPUs. The\nonly exception to this is when Group3 or Group4 FAX compression is\nrequested since FAX machines send data in bit-reversed order and\ntherefore RFC 2301 recommends using reverse order.\n\n.in 15\n.in 15\n.B \"tiff:group-three-options=<value>\"\n.in 20\n \\fR\n.in 20\nIf the tiff:group-three-options key is defined, GraphicsMagick\nwill use it to set the group3 options tag when writing\ngroup3-compressed TIFF.  Please see the TIFF specification for the\nusage of this tag.  The default value is 4.\n\n.in 15\n.in 15\n.B \"tiff:ignore-tags=<tags>\"\n.in 20\n \\fR\n.in 20\nIf the tiff:ignore-tags key is defined, then it is used as a list\nof comma-delimited integer TIFF tag values to ignore while reading the\nTIFF file.  This is useful in order to be able to read files which\nwhich otherwise fail to read due to problems with TIFF tags.  Note\nthat some TIFF tags are required in order to be able to read the image\ndata at all.\n\n.in 15\n.in 15\n.B \"tiff:report-warnings={false|true}\"\n.in 20\n \\fR\n.in 20\nIf the tiff:report-warnings key is defined and set to \\fBtrue\\fP,\nthen TIFF warnings are reported as a warning exception rather than as\na coder log message.  Such warnings are reported after the image has\nbeen read or written.  Most TIFF warnings are benign but sometimes\nthey may help deduce problems with the TIFF file, or help detect that\nthe TIFF file requires a special application to read successfully due\nto the use of proprietary or specialized extensions.\n\n.in 15\n.in 15\n.B \"tiff:sample-format={unsigned|ieeefp}\"\n.in 20\n \\fR\n.in 20\nIf the tiff:sample-format key is defined, GraphicsMagick will use it to\ndetermine the sample format used while writing TIFF files. The default is\n\"unsigned\". Specify \"ieeefp\" in order to write floating-point TIFF\nfiles with float (32-bit) or double (64-bit) values. Use the\ntiff:bits-per-sample define to determine the type of floating-point value\nto use.\n\n.in 15\n.in 15\n.B \"tiff:max-sample-value=<value>\"\n.in 20\n \\fR\n.in 20\nIf the tiff:max-sample-value key is defined, GraphicsMagick will use the\nassigned value as the maximum floating point value while reading or\nwriting IEEE floating point TIFFs. Otherwise the maximum value is 1.0 or\nthe value obtained from the file's SMaxSampleValue tag (if present). The\nfloating point data is currently not scanned in advance to determine a\nbest maximum sample value so if the range is not 1.0, or the\nSMaxSampleValue tag is not present, it may be necessary to\n(intelligently) use this parameter to properly read a file.\n\n.in 15\n.in 15\n.B \"tiff:min-sample-value=<value>\"\n.in 20\n \\fR\n.in 20\nIf the tiff:min-sample-value key is defined, GraphicsMagick will use\nthe assigned value as the minimum floating point value while reading or\nwriting IEEE floating point TIFFs. Otherwise the minimum value is 0.0 or\nthe value obtained from the file's SMinSampleValue tag (if present).\n\n.in 15\n.in 15\n.B \"tiff:bits-per-sample=<value>\"\n.in 20\n \\fR\n.in 20\nIf the tiff:bits-per-sample key is defined, GraphicsMagick will write\nimages with the specified bits per sample, overriding any existing depth\nvalue. Value may be any in the range of 1 to 32, or 64 when the default\n\\'unsigned' format is written, or 16/32/24/64 if IEEEFP format is written.\nPlease note that the baseline TIFF 6.0 specification only requires\nreaders to handle certain powers of two, and the values to be handled\ndepend on the nature of the image (e.g. colormapped, grayscale, RGB, CMYK).\n\n.in 15\n.in 15\n.B \"tiff:samples-per-pixel=<value>\"\n.in 20\n \\fR\n.in 20\nIf the tiff:samples-per-pixel key is defined to a value, the TIFF coder\nwill write TIFF images with the defined samples per pixel, overriding any\nvalue stored in the image. This option should not normally be used.\n\n.in 15\n.in 15\n.B \"tiff:rows-per-strip=<value>\"\n.in 20\n \\fR\n.in 20\nAllows the user to specify the number of rows per TIFF strip.\nRounded up to a multiple of 16 when using JPEG compression. Ignored when\nusing tiles.\n\n.in 15\n.in 15\n.B \"tiff:strip-per-page=true\"\n.in 20\n \\fR\n.in 20\nRequests that the image is written in a single TIFF strip. This is\nnormally the default when group3 or group4 compression is requested\nwithin reasonable limits. Requesting a single strip for large images may\nresult in failure due to resource consumption in the writer or reader.\n\n.in 15\n.in 15\n.B \"tiff:tile\"\n.in 20\n \\fR\n.in 20\nEnable writing tiled TIFF (rather than stripped) using the default tile\nsize. Tiled TIFF organizes the image as an array of smaller images\n(tiles) in order to enable random access.\n\n.in 15\n.in 15\n.B \"tiff:tile-geometry=<width>x<height>\"\n.in 20\n \\fR\n.in 20\nSpecify the tile size to use while writing tiled TIFF. Width and\nheight should be a multiple of 16. If the value is not a multiple of 16,\nthen it will be rounded down. Enables tiled TIFF if it has not already\nbeen enabled. GraphicsMagick does not use tiled storage internally so\ntiles need to be converted back and forth from the internal\nscanline-oriented storage to tile-oriented storage. Testing with typical\nRGB images shows that useful square tile size values range from 128x128\nto 1024x1024. Large images which require using a disk-based pixel cache\nbenefit from large tile sizes while images which fit in memory work well\nwith smaller tile sizes.\n\n.in 15\n.in 15\n.B \"tiff:tile-width=<width>\"\n.in 20\n \\fR\n.in 20\nSpecify the tile width to use while writing tiled TIFF. The tile height\nis then defaulted to an appropriate size. Width should be a multiple of\n16. If the value is not a multiple of 16, then it will be rounded down.\nEnables tiled TIFF if it has not already been enabled.\n\n.in 15\n.in 15\n.B \"tiff:tile-height=<height>\"\n.in 20\n \\fR\n.in 20\nSpecify the tile height to use while writing tiled TIFF. The tile width\nis then defaulted to an appropriate size. Height should be a multiple of\n16. If the value is not a multiple of 16, then it will be rounded down.\nEnables tiled TIFF if it has not already been enabled.\n\n.in 15\n.in 15\n.B \"tiff:webp-lossless={TRUE|FALSE}\"\n.in 20\n \\fR\n.in 20\nSpecify a value of \\fBTRUE\\fP to enable lossless mode while\nwriting WebP-compressed TIFF files. The WebP \\fBwebp:lossless\\fP\noption may also be used.  The quality factor set by the\n\\fB-quality\\fP option may be used to influence the level of effort\nexpended while compressing.\n\n.in 15\n.in 15\n.B \"tiff:zstd-compress-level=<value>\"\n.in 20\n \\fR\n.in 20\nSpecify the compression level to use while writing Zstd-compressed\nTIFF files. The valid range is 1 to 22. If this define is not\nspecified, then the 'quality' value is used such that the default\nquality setting of 75 is translated to a compress level of 9 such that\n\\'quality' has a useful range of 10-184 if used for this purpose.\n\n.in 15\n.in 15\n.B \"webp:lossless={true|false}\"\n.in 20\n \\fR\n.in 20\nEnable lossless encoding.\n\n.in 15\n.in 15\n.B \"webp:method={0-6}\"\n.in 20\n \\fR\n.in 20\nQuality/speed trade-off.\n\n.in 15\n.in 15\n.B \"webp:image-hint={default,graph,photo,picture}\"\n.in 20\n \\fR\n.in 20\nHint for image type.\n\n.in 15\n.in 15\n.B \"webp:target-size=<integer>\"\n.in 20\n \\fR\n.in 20\nTarget size in bytes.\n\n.in 15\n.in 15\n.B \"webp:target-psnr=<float>\"\n.in 20\n \\fR\n.in 20\nMinimal distortion to try to achieve.\n\n.in 15\n.in 15\n.B \"webp:segments={1-4}\"\n.in 20\n \\fR\n.in 20\nMaximum number of segments to use.\n\n.in 15\n.in 15\n.B \"webp:sns-strength={0-100}\"\n.in 20\n \\fR\n.in 20\nSpatial Noise Shaping.\n\n.in 15\n.in 15\n.B \"webp:filter-strength={0-100}\"\n.in 20\n \\fR\n.in 20\nFilter strength.\n\n.in 15\n.in 15\n.B \"webp:filter-sharpness={0-7}\"\n.in 20\n \\fR\n.in 20\nFilter sharpness.\n\n.in 15\n.in 15\n.B \"webp:filter-type={0,1}\"\n.in 20\n \\fR\n.in 20\nFiltering type. 0 = simple, 1 = strong (only used if\nfilter-strength > 0 or autofilter is enabled).\n\n.in 15\n.in 15\n.B \"webp:auto-filter={true|false}\"\n.in 20\n \\fR\n.in 20\nAuto adjust filter's strength.\n\n.in 15\n.in 15\n.B \"webp:alpha-compression=<integer>\"\n.in 20\n \\fR\n.in 20\nAlgorithm for encoding the alpha plane (0 = none, 1 = compressed\nwith WebP lossless). Default is 1.\n\n.in 15\n.in 15\n.B \"webp:alpha-filtering=<integer>\"\n.in 20\n \\fR\n.in 20\nPredictive filtering method for alpha plane. 0: none, 1: fast, 2:\nbest. Default is 1.\n\n.in 15\n.in 15\n.B \"webp:alpha-quality={0-100}\"\n.in 20\n \\fR\n.in 20\nBetween 0 (smallest size) and 100 (lossless). Default is 100.\n\n.in 15\n.in 15\n.B \"webp:pass=[1..10]\"\n.in 20\n \\fR\n.in 20\nNumber of entropy-analysis passes.\n\n.in 15\n.in 15\n.B \"webp:show-compressed={true|false}\"\n.in 20\n \\fR\n.in 20\nExport the compressed picture back.  In-loop filtering is not\napplied.\n\n.in 15\n.in 15\n.B \"webp:preprocessing=[0,1,2]\"\n.in 20\n \\fR\n.in 20\n0=none, 1=segment-smooth, 2=pseudo-random dithering\n\n.in 15\n.in 15\n.B \"webp:partitions=[0-3]\"\n.in 20\n \\fR\n.in 20\nlog2(number of token partitions) in [0..3].  Default is 0 for\neasier progressive decoding.\n\n.in 15\n.in 15\n.B \"webp:partition-limit={0-100}\"\n.in 20\n \\fR\n.in 20\nQuality degradation allowed to fit the 512k limit on prediction\nmodes coding (0: no degradation, 100: maximum possible\ndegradation).\n\n.in 15\n.in 15\n.B \"webp:emulate-jpeg-size={true|false}\"\n.in 20\n \\fR\n.in 20\nIf true, compression parameters will be remapped to better match\nthe expected output size from JPEG compression. Generally, the output\nsize will be similar but the degradation will be lower.\n\n.in 15\n.in 15\n.B \"webp:thread-level=<integer>\"\n.in 20\n \\fR\n.in 20\nIf non-zero, try and use multi-threaded encoding.\n\n.in 15\n.in 15\n.B \"webp:low-memory={true|false}\"\n.in 20\n \\fR\n.in 20\nIf set, reduce memory usage (but increase CPU use)\n\n.in 15\n.in 15\n.B \"webp:use-sharp-yuv={true|false}\"\n.in 20\n \\fR\n.in 20\nIf set, if needed, use sharp (and slow) RGB->YUV conversion\n\n.in 15\n\n\n\nFor example, to create a postscript file that will render only the black\npixels of a bilevel image, use:\n\n    gm convert bilevel.tif -define ps:imagemask eps3:stencil.ps\n\n.TP\n.B \"-delay \\fI<1/100ths of a second>\"\\fP\n\\fRdisplay the next image after pausing\n\nThis option is useful for regulating the animation of image sequences\n\\fIDelay/100\\fP seconds must expire before the display\nof the next image. The default is no delay between each showing of the\nimage sequence. The maximum delay is 65535.\n\nYou can specify a delay range (e.g. \\fI-delay 10-500\\fP) which sets the\nminimum and maximum delay.\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\nThis option specifies the image resolution to store while encoding a\nraster image or the canvas resolution while rendering (reading) vector\nformats such as Postscript, PDF, WMF, and SVG into a raster image. Image\nresolution provides the unit of measure to apply when rendering to an\noutput device or raster image. The default unit of measure is in dots\nper inch (DPI). The \\fB-units\\fP option may be used to select dots per\ncentimeter instead.\n The default resolution is 72 dots per inch, which is equivalent to\none point per pixel (Macintosh and Postscript standard). Computer\nscreens are normally 72 or 96 dots per inch while printers typically\nsupport 150, 300, 600, or 1200 dots per inch. To determine the\nresolution of your display, use a ruler to measure the width of your\nscreen in inches, and divide by the number of horizontal pixels (1024 on\na 1024x768 display).\nIf the file format supports it, this option may be used to update\nthe stored image resolution. Note that Photoshop stores and obtains\nimage resolution from a proprietary embedded profile. If this profile is\nnot stripped from the image, then Photoshop will continue to treat the\nimage using its former resolution, ignoring the image resolution\nspecified in the standard file header.\nThe density option is an attribute and does not alter the underlying\nraster image. It may be used to adjust the rendered size for desktop\npublishing purposes by adjusting the scale applied to the pixels. To\nresize the image so that it is the same size at a different resolution,\nuse the \\fB-resample\\fP option.\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n\nThis is the number of bits of color to preserve in the image. Any value\nbetween 1 and \\fBQuantumDepth\\fP (build option) may be specified,\nalthough 8 or 16 are the most common values. Use this option to specify\nthe depth of raw images whose depth is unknown such as GRAY, RGB, or\nCMYK, or to change the depth of any image after it has been read.\nThe depth option is applied to the pixels immediately so it may be\nused as a form of simple compression by discarding the least significant\nbits. Reducing the depth in advance may speed up color quantization, and\nhelp create smaller file sizes when using a compression algorithm like\nLZW or ZIP.\n.TP\n.B \"-descend\"\n\\fRobtain image by descending window hierarchy\n.TP\n.B \"-despeckle\"\n\\fRreduce the speckles within an image\n.TP\n.B \"-displace \\fI<horizontal scale>x<vertical scale>\"\\fP\n\\fRshift image pixels as defined by a displacement map\n\nWith this option, \\fIcomposite image\\fP is used as a displacement map.  Black,\nwithin the displacement map, is a maximum positive displacement.  White is a\nmaximum negative displacement and middle gray is neutral.  The displacement\nis scaled to determine the pixel shift.  By default, the displacement applies\nin both the horizontal and vertical directions.  However, if you specify\n\\fImask\\fP, \\fIcomposite image\\fP is the horizontal X displacement and\n\\fImask\\fP the vertical Y displacement.\n.TP\n.B \"-display \\fI<host:display[.screen]>\"\\fP\n\\fRspecifies the X server to contact\n\nThis option is used with convert for\nobtaining image or font from this X server.  See \\fIX(1)\\fP.\n.TP\n.B \"-dispose \\fI<method>\"\\fP\n\\fRGIF disposal method\n\nThe Disposal Method indicates the way in which the graphic is to\nbe treated after being displayed.\n\nHere are the valid methods:\n\n    Undefined       No disposal specified.\n    None            Do not dispose between frames.\n    Background      Overwrite the image area with\n                    the background color.\n    Previous        Overwrite the image area with\n                    what was there prior to rendering\n                    the image.\n\n.TP\n.B \"-dissolve \\fI<percent>\"\\fP\n\\fRdissolve an image into another by the given percent\n\nThe opacity of the composite image is multiplied by the given percent,\nthen it is composited over the main image.\n.TP\n.B \"-dither\"\n\\fRapply Floyd/Steinberg error diffusion to the image\n\nThe basic strategy of dithering is to trade intensity resolution for spatial\nresolution by averaging the intensities of several neighboring pixels.\nImages which suffer from severe contouring when reducing colors can be\nimproved with this option.\n\nThe \\fB-colors\\fP or \\fB-monochrome\\fP option is required for this option\nto take effect.\n\nUse \\fB+dither\\fP to turn off dithering and to render PostScript\nwithout text or graphic aliasing. Disabling dithering often (but not\nalways) leads to decreased processing time.\n.TP\n.B \"-draw \\fI<string>\"\\fP\n\\fRannotate an image with one or more graphic primitives\n\nUse this option to annotate an image with one or more graphic primitives.\nThe primitives include shapes, text, transformations,\nand pixel operations.  The shape primitives are\n\n     point           x,y\n     line            x0,y0 x1,y1\n     rectangle       x0,y0 x1,y1\n     roundRectangle  x0,y0 x1,y1 wc,hc\n     arc             x0,y0 x1,y1 a0,a1\n     ellipse         x0,y0 rx,ry a0,a1\n     circle          x0,y0 x1,y1\n     polyline        x0,y0  ...  xn,yn\n     polygon         x0,y0  ...  xn,yn\n     Bezier          x0,y0  ...  xn,yn\n     path            path specification\n     image           operator x0,y0 w,h filename\n\n\nThe text primitive is\n\n     text            x0,y0 string\n\n\nThe text gravity primitive is\n\n     gravity         NorthWest, North, NorthEast, West, Center,\n                     East, SouthWest, South, or SouthEast\n\n\nThe text gravity primitive only affects the placement of text and\ndoes not interact with the other primitives.  It is equivalent to\nusing the \\fB-gravity\\fP commandline option, except that it is\nlimited in scope to the \\fB-draw\\fP option in which it appears.\n\nThe transformation primitives are\n\n     rotate          degrees\n     translate       dx,dy\n     scale           sx,sy\n     skewX           degrees\n     skewY           degrees\n\n\nThe pixel operation primitives are\n\n     color           x0,y0 method\n     matte           x0,y0 method\n\n\nThe shape primitives are drawn in the color specified in the preceding\n\\fB-stroke\\fP option. Except for the \\fBline\\fP and \\fBpoint\\fP\nprimitives, they are filled with the color specified in the preceding\n\\fB-fill\\fP option.  For unfilled shapes, use -fill none.\n\n\\fBPoint\\fP requires a single coordinate.\n\n\\fBLine\\fP requires a start and end coordinate.\n\n\\fBRectangle\\fP\nexpects an upper left and lower right coordinate.\n\n\\fBRoundRectangle\\fP has the upper left and lower right coordinates\nand the width and height of the corners.\n\n\\fBCircle\\fP has a center coordinate and a coordinate for\nthe outer edge.\n\nUse \\fBArc\\fP to inscribe an elliptical arc within\na rectangle.  Arcs require a start and end point as well as the degree\nof rotation (e.g. 130,30 200,100 45,90).\n\nUse \\fBEllipse\\fP to draw a partial ellipse\ncentered at the given point with the x-axis and y-axis radius\nand start and end of arc in degrees (e.g. 100,100 100,150 0,360).\n\nFinally, \\fBpolyline\\fP and \\fBpolygon\\fP require\nthree or more coordinates to define its boundaries.\nCoordinates are integers separated by an optional comma.  For example,\nto define a circle centered at 100,100\nthat extends to 150,150 use:\n\n     -draw 'circle 100,100 150,150'\n\n\n\\fBPaths\\fP\n(See Paths)\nrepresent an outline of an object which is defined in terms of\nmoveto (set a new current point), lineto (draw a straight line),\ncurveto (draw a curve using a cubic Bezier), arc (elliptical or\ncircular arc) and closepath (close the current shape by drawing a line\nto the last moveto) elements. Compound paths (i.e., a path with\nsubpaths, each consisting of a single moveto followed by one or more\nline or curve operations) are possible to allow effects such as\n\"donut holes\" in objects.\n\nUse \\fBimage\\fP to composite an image with another image. Follow the\nimage keyword with the composite operator, image location, image size,\nand filename:\n\n     -draw 'image Over 100,100 225,225 image.jpg'\n\n\nYou can use 0,0 for the image size, which means to use the actual\ndimensions found in the image header. Otherwise, it will\nbe scaled to the given dimensions.\nSee \\fB-compose\\fP for a description of the composite operators.\n\nUse \\fBtext\\fP to annotate an image with text. Follow the text\ncoordinates with a string. If the string has embedded spaces, enclose it\nin single or double quotes. Optionally you can include the image\nfilename, type, width, height, or other image attribute by embedding\nspecial format character. See \\fB-comment\\fP for details.\n\nFor example,\n\n\n     -draw 'text 100,100 \"%m:%f %wx%h\"'\n\n\nannotates the image with MIFF:bird.miff 512x480 for an image titled\nbird.miff\nand whose width is 512 and height is 480.\n\nIf the first character of \\fIstring\\fP is \\fI@\\fP, the text is read\nfrom a file titled by the remaining characters in the string.  Please\nnote that if the string comes from an untrusted source that it should\nbe sanitized before use (a security risk).\n\n\\fBRotate\\fP rotates subsequent shape primitives and text primitives about\nthe origin of the main image. If the \\fB-region\\fP option precedes the\n\\fB-draw\\fP option, the origin for transformations is the upper left\ncorner of the region.\n\n\\fBTranslate\\fP translates them.\n\n\\fBScale\\fP scales them.\n\n\\fBSkewX\\fP and \\fBSkewY\\fP skew them with respect to the origin of\nthe main image or the region.\n\nThe transformations modify the current affine matrix, which is initialized\nfrom the initial affine matrix defined by the \\fB-affine\\fP option.\nTransformations are cumulative within the \\fB-draw\\fP option.\nThe initial affine matrix is not affected; that matrix is only changed by the\nappearance of another \\fB-affine\\fP option.  If another \\fB-draw\\fP\noption appears, the current affine matrix is reinitialized from\nthe initial affine matrix.\n\nUse \\fBcolor\\fP to change the color of a pixel to the fill color (see\n\\fB-fill\\fP). Follow the pixel coordinate\nwith a method:\n\n     point\n     replace\n     floodfill\n     filltoborder\n     reset\n\n\nConsider the target pixel as that specified by your coordinate. The\n\\fBpoint\\fP\nmethod recolors the target pixel. The \\fBreplace\\fP method recolors any\npixel that matches the color of the target pixel.\n\\fBFloodfill\\fP recolors\nany pixel that matches the color of the target pixel and is a neighbor,\nwhereas \\fBfilltoborder\\fP recolors any neighbor pixel that is not the\nborder color. Finally, \\fBreset\\fP recolors all pixels.\n\nUse \\fBmatte\\fP to the change the pixel matte value to transparent. Follow\nthe pixel coordinate with a method (see the \\fBcolor\\fP primitive for\na description of methods). The \\fBpoint\\fP method changes the matte value\nof the target pixel. The \\fBreplace\\fP method changes the matte value\nof any pixel that matches the color of the target pixel. \\fBFloodfill\\fP\nchanges the matte value of any pixel that matches the color of the target\npixel and is a neighbor, whereas\n\\fBfilltoborder\\fP changes the matte\nvalue of any neighbor pixel that is not the border color (\\fB-bordercolor\\fP).\nFinally \\fBreset\\fP changes the matte value of all pixels.\n\nYou can set the primitive color, font, and font bounding box\ncolor with\n\\fB-fill\\fP, \\fB-font\\fP, and \\fB-box\\fP respectively. Options\nare processed in command line order so be sure to use these\noptions \\fIbefore\\fP the \\fB-draw\\fP option.\n.TP\n.B \"-edge \\fI<radius>\"\\fP\n\\fRdetect edges within an image\n.TP\n.B \"-emboss \\fI<radius>\"\\fP\n\\fRemboss an image\n.TP\n.B \"-encoding \\fI<type>\"\\fP\n\\fRspecify the text encoding\n\nChoose from \\fIAdobeCustom, AdobeExpert, AdobeStandard, AppleRoman,\nBIG5, GB2312, Latin 2, None, SJIScode, Symbol, Unicode, Wansung.\\fP\n.TP\n.B \"-endian \\fI<type>\"\\fP\n\\fRspecify endianness (MSB, LSB, or Native) of image\n\n\\fIMSB\\fP indicates big-endian (e.g. SPARC, Motorola 68K) while\n\\fILSB\\fP indicates little-endian (e.g. Intel 'x86, VAX) byte\nordering.  \\fINative\\fP indicates to use the normal ordering for the\ncurrent CPU.  This option currently only influences the CMYK, DPX,\nGRAY, RGB, and TIFF, formats.\n\nUse \\fB+endian\\fP to revert to unspecified endianness.\n.TP\n.B \"-enhance\"\n\\fRapply a digital filter to enhance a noisy image\n.TP\n.B \"-equalize\"\n\\fRperform histogram equalization to the image\n.TP\n.B \"-extent \\fI<width>x<height>{+-}<x>{+-}<y>\"\\fP\n\\fRcomposite image on background color canvas image\n\nThis option composites the image on a new background color\n(\\fB-background\\fP) canvas image of size <width>x<height>. The\nexisting image content is composited at the position specified by\ngeometry x and y offset and/or desired gravity (\\fB-gravity\\fP) using\nthe current image compose (\\fB-compose\\fP) method.  Image content\nwhich falls outside the bounds of the new image dimensions is\ndiscarded.\n\nFor example, this command creates a thumbnail of an image, and centers\nit on a red color backdrop image, offsetting the canvas ten pixels to\nthe left and five pixels up, with respect to the thumbnail:\n\n    gm convert infile.jpg -thumbnail 120x80 -background red -gravity center \\\\\n              -extent 140x100-10-5 outfile.jpg\n\n\nThis command reduces or expands a JPEG image to fit on an 800x600\ndisplay: \n\n    gm convert -size 800x600 input.jpg \\\\\n              -resize 800x600 -background black \\\\\n              -compose Copy -gravity center \\\\\n              -extent 800x600 \\\\\n              -quality 92 output.jpg\n\n\nIf the aspect ratio of the input image isn't exactly 4:3, then the\nimage is centered on an 800x600 black canvas. \n.TP\n.B \"-file \\fI<filename>\"\\fP\n\\fRwrite annotated difference image to file\n\nIf \\fB-file\\fP is specified, then an annotated difference image is\ngenerated and written to the specified file. Pixels which differ between\nthe \\fBreference\\fP and \\fBcompare\\fP images are modified from those in\nthe \\fBcompare\\fP image so that the changed pixels become more obvious.\nSome images may require use of an alternative highlight style (see\n\\fB-highlight-style\\fP) or highlight color (see \\fB-highlight-color\\fP)\nbefore the changes are obvious.\n.TP\n.B \"-fill \\fI<color>\"\\fP\n\\fRcolor to use when filling a graphic primitive\n\nColors are represented in GraphicsMagick in the same form used by SVG. Use \"gm convert -list color\" to list named colors:\n\n    name               (named color)\n    #RGB               (hex numbers, 4 bits each)\n    #RRGGBB            (8 bits each)\n    #RRRGGGBBB         (12 bits each)\n    #RRRRGGGGBBBB      (16 bits each)\n    #RGBA              (4 bits each)\n    #RRGGBBAA          (8 bits each)\n    #RRRGGGBBBAAA      (12 bits each)\n    #RRRRGGGGBBBBAAAA  (16 bits each)\n    rgb(r,g,b)         (r,g,b are decimal numbers)\n    rgba(r,g,b,a)      (r,g,b,a are decimal numbers)\n\n\nEnclose the color specification in quotation marks to prevent the \"#\"\nor the parentheses from being interpreted by your shell.\n\nFor example,\n\n    gm convert -fill blue ...\n    gm convert -fill \"#ddddff\" ...\n    gm convert -fill \"rgb(65000,65000,65535)\" ...\n\n\nThe shorter forms are scaled up, if necessary by replication.  For example, \n#3af, #33aaff, and #3333aaaaffff are all equivalent.\n\nSee \\fB-draw\\fP for further details.\n.TP\n.B \"-filter \\fI<type>\"\\fP\n\\fRuse this type of filter when resizing an image\n\nUse this option to affect the resizing operation of an image (see\n\\fB-geometry\\fP).\nChoose from these filters (ordered by approximate increasing CPU\ntime):\n\n     Point\n     Box\n     Triangle\n     Hermite\n     Hanning\n     Hamming\n     Blackman\n     Gaussian\n     Quadratic\n     Cubic\n     Catrom\n     Mitchell\n     Lanczos\n     Bessel\n     Sinc\n\n\nThe default filter is automatically selected to provide the best quality\nwhile consuming a reasonable amount of time. The \\fBMitchell\\fP filter\nis used if the image supports a palette, supports a matte channel, or is\nbeing enlarged, otherwise the \\fBLanczos\\fP filter is used.\n.TP\n.B \"-flatten\"\n\\fRflatten a sequence of images\n\nIn some file formats (e.g. Photoshop's PSD) complex images may be\nrepresented by \"layers\" (independent images) which must be composited\nin order to obtain the final rendition.  The \\fB-flatten\\fP option\naccomplishes this composition.  The sequence of images is replaced by\na single image created by compositing each image in turn, while\nrespecting composition operators and page offsets.  While\n\\fB-flatten\\fP is immediately useful for eliminating layers, it is\nalso useful as a general-purpose composition tool.\n\nThe sequence of images is terminated by the appearance of any option.\nIf the \\fB-flatten\\fP option appears after all of the input images,\nall images are flattened.  Also see \\fB-mosaic\\fP which is similar to\n\\fB-flatten\\fP except that it adds a suitably-sized canvas base\nimage.\n\nFor example, this composites an image on top of a 640x400 transparent\nblack canvas image:\n\n    gm convert -size 640x300 xc:transparent \\\\\n              -compose over -page +0-100 \\\\\n              frame.png -flatten output.png\n\n\nand this flattens a Photoshop PSD file:\n\n    gm convert input.psd -flatten output.png\n\n.TP\n.B \"-flip\"\n\\fRcreate a \"mirror image\"\n\nreflect the scanlines in the vertical direction.\n.TP\n.B \"-flop\"\n\\fRcreate a \"mirror image\"\n\nreflect the scanlines in the horizontal direction.\n.TP\n.B \"-font \\fI<name>\"\\fP\n\\fRuse this font when annotating the image with text\n\nYou can tag a font to specify whether it is a PostScript, TrueType, or X11\nfont.  For example, Arial.ttf is a TrueType font, ps:helvetica\nis PostScript, and x:fixed is X11.\n.TP\n.B \"-foreground \\fI<color>\"\\fP\n\\fRdefine the foreground color\n\nThe color is specified using the format described under the \\fB-fill\\fP\noption.\n.TP\n.B \"-format \\fI<type>\"\\fP\n\\fRthe image format type\n\nWhen used with the \\fBmogrify\\fP utility,\nthis option will convert any image to the image format you specify.\nSee \\fIGraphicsMagick(1)\\fP for a list of image format types supported by\n\\fBGraphicsMagick\\fP, or see the output of 'gm -list format'.\n\nBy default the file is written to its original name.  However, if the\nfilename extension matches a supported format, the extension is replaced\nwith the image format type specified with \\fB-format\\fP.  For example,\nif you specify \\fItiff\\fP as the format type and the input image\nfilename is \\fIimage.gif\\fP, the output image filename becomes\n\\fIimage.tiff\\fP.\n.TP\n.B \"-format \\fI<string>\"\\fP\n\\fRoutput formatted image characteristics\n\nWhen used with the \\fBidentify\\fP utility, or the \\fBconvert\\fP\nutility with output written to the 'info:-' file specification, use\nthis option to print information about the image in a format of your\nchoosing.  You can include the image filename, type, width, height,\nExif data, or other image attributes by embedding special format\ncharacters:\n\n     %b   file size\n     %c   comment\n     %d   directory\n     %e   filename extension\n     %f   filename\n     %g   page dimensions and offsets\n     %h   height\n     %i   input filename\n     %k   number of unique colors\n     %l   label\n     %m   magick\n     %n   number of scenes\n     %o   output filename\n     %p   page number\n     %q   image bit depth\n     %r   image type description\n     %s   scene number\n     %t   top of filename\n     %u   unique temporary filename\n     %w   width\n     %x   horizontal resolution\n     %y   vertical resolution\n     %A   transparency supported\n     %C   compression type\n     %D   GIF disposal method\n     %G   Original width and height\n     %H   page height\n     %M   original filename specification\n     %O   page offset (x,y)\n     %P   page dimensions (width,height)\n     %Q   compression quality\n     %T   time delay (in centi-seconds)\n     %U   resolution units\n     %W   page width\n     %X   page horizontal offset (x)\n     %Y   page vertical offset (y)\n     %@   trim bounding box\n     %#   signature\n     \\\\n   newline\n     \\\\r   carriage return\n     %%   %\n\n\nFor example,\n\n     -format \"%m:%f %wx%h\"\n\n\ndisplays \\fBMIFF:bird.miff 512x480\\fP for an image\ntitled \\fBbird.miff\\fP and whose width is 512 and height is 480.\n\nIf the first character of \\fIstring\\fP is \\fB@\\fP, the format is\nread from a file titled by the remaining characters in the string.\nPlease note that if the string comes from an untrusted source that it\nshould be sanitized before use since this may be used to incorporate\nany readable file on the system (a security risk).\n\nThe values of image type (\\fB%r\\fP) which may be returned include:\n\n     Bilevel\n     Grayscale\n     GrayscaleMatte\n     Palette\n     PaletteMatte\n     TrueColor\n     TrueColorMatte\n     ColorSeparation\n     ColorSeparationMatte\n     Optimize\n\n\nYou can also use the following special formatting syntax to print Exif\ninformation contained in the file:\n\n     %[EXIF:<tag>]\n\n\nWhere \"<tag>\" may be one of the following:\n\n     *  (print all Exif tags, in keyword=data format)\n     !  (print all Exif tags, in tag_number format)\n     #hhhh (print data for Exif tag #hhhh)\n     ImageWidth\n     ImageLength\n     BitsPerSample\n     Compression\n     PhotometricInterpretation\n     FillOrder\n     DocumentName\n     ImageDescription\n     Make\n     Model\n     StripOffsets\n     Orientation\n     SamplesPerPixel\n     RowsPerStrip\n     StripByteCounts\n     XResolution\n     YResolution\n     PlanarConfiguration\n     ResolutionUnit\n     TransferFunction\n     Software\n     DateTime\n     Artist\n     WhitePoint\n     PrimaryChromaticities\n     TransferRange\n     JPEGProc\n     JPEGInterchangeFormat\n     JPEGInterchangeFormatLength\n     YCbCrCoefficients\n     YCbCrSubSampling\n     YCbCrPositioning\n     ReferenceBlackWhite\n     CFARepeatPatternDim\n     CFAPattern\n     BatteryLevel\n     Copyright\n     ExposureTime\n     FNumber\n     IPTC/NAA\n     ExifOffset\n     InterColorProfile\n     ExposureProgram\n     SpectralSensitivity\n     GPSInfo\n     ISOSpeedRatings\n     OECF\n     ExifVersion\n     DateTimeOriginal\n     DateTimeDigitized\n     ComponentsConfiguration\n     CompressedBitsPerPixel\n     ShutterSpeedValue\n     ApertureValue\n     BrightnessValue\n     ExposureBiasValue\n     MaxApertureValue\n     SubjectDistance\n     MeteringMode\n     LightSource\n     Flash\n     FocalLength\n     MakerNote\n     UserComment\n     SubSecTime\n     SubSecTimeOriginal\n     SubSecTimeDigitized\n     FlashPixVersion\n     ColorSpace\n     ExifImageWidth\n     ExifImageLength\n     InteroperabilityOffset\n     FlashEnergy\n     SpatialFrequencyResponse\n     FocalPlaneXResolution\n     FocalPlaneYResolution\n     FocalPlaneResolutionUnit\n     SubjectLocation\n     ExposureIndex\n     SensingMethod\n     FileSource\n     SceneType\n\n\nJPEG specific information (from reading a JPEG file) may be obtained\nlike this:\n\n     %[JPEG-<tag>]\n\n\nWhere \"<tag>\" may be one of the following:\n\n     *                 (all JPEG-related tags, in\n                        keyword=data format)\n     Quality           IJG JPEG \"quality\" estimate\n     Colorspace        JPEG colorspace numeric ID\n     Colorspace-Name   JPEG colorspace name\n     Sampling-factors  JPEG sampling factors\n\n\nPlease note that JPEG has no notion of \"quality\" and that the quality\nmetric used by, and estimated by the software is based on the quality\nmetric established by IJG JPEG 6b.  Other encoders (e.g. that used by\nAdobe Photoshop) use different encoding metrics.\n\nSurround the format specification with quotation marks to prevent your shell\nfrom misinterpreting any spaces and square brackets.\n.TP\n.B \"-frame \\fI<width>x<height>+<outer bevel width>+<inner bevel width>\"\\fP\n\\fRsurround the image with an ornamental border\n\nSee \\fB-geometry\\fP for details about the geometry\nspecification.  The \\fB-frame\\fP option is not affected by the\n\\fB-gravity\\fP option.\n\nThe color of the border is specified with the \\fB-mattecolor\\fP\ncommand line option.\n.TP\n.B \"-frame\"\n\\fRinclude the X window frame in the imported image\n.TP\n.B \"-fuzz \\fI<distance>{%}\"\\fP\n\\fRcolors within this Euclidean distance are considered equal\n\nA number of algorithms search for a target color. By default the color\nmust be exact. Use this option to match colors that are close (in\nEuclidean distance) to the target color in RGB 3D space. For example,\nif you want to automatically trim the edges of an image with\n\\fB-trim\\fP but the image was scanned and the target background color\nmay differ by a small amount. This option can account for these\ndifferences.\n\nThe \\fIdistance\\fP can be in absolute intensity units or, by appending\n\\fI\"%\"\\fP, as a percentage of the maximum possible intensity (255,\n65535, or 4294967295).\n.TP\n.B \"-gamma \\fI<value>\"\\fP\n\\fRlevel of gamma correction\n\nThe same color image displayed on two different workstations may look\ndifferent due to differences in the display monitor. Use gamma\ncorrection to adjust for this color difference. Reasonable values extend\nfrom \\fB0.8\\fP to \\fB2.3\\fP. Gamma less than 1.0 darkens the image and\ngamma greater than 1.0 lightens it. Large adjustments to image gamma may\nresult in the loss of some image information if the pixel quantum size\nis only eight bits (quantum range 0 to 255).\n\nYou can apply separate gamma values to the red, green, and blue channels\nof the image with a gamma value list delimited with slashes\n(e.g., \\fB1.7\\fP/\\fB2.3\\fP/\\fB1.2\\fP).\n\nUse \\fB+gamma\\fP \\fIvalue\\fP\nto set the image gamma level without actually adjusting\nthe image pixels. This option is useful if the image is of a known gamma\nbut not set as an image attribute (e.g. PNG images).\n.TP\n.B \"-gaussian \\fI<radius>{x<sigma>}\"\\fP\n\\fRblur the image with a Gaussian operator\n\nUse the given radius and standard deviation (sigma).\n.TP\n.B \"-geometry \\fI<width>x<height>{+-}<x>{+-}<y>{%}{@}{!}{^}{<}{>}\"\\fP\n\\fRSpecify dimension, offset, and resize options.\n\nThe \\fB-geometry\\fP option is used for a number of different\npurposes, depending on the utility it is used with.\n\nFor the X11 commands ('animate', 'display', and 'import'), it\nspecifies the preferred size and location of the Image window.  By\ndefault, the window size is the image size and the location is chosen\nby you (or your window manager) when it is mapped.\n For the 'import', 'convert', 'mogrify' utility commands it may be\nused to specify the desired size when resizing an image.  In this\ncase, symbols representing resize options may be appended to the\ngeometry string to influence how the resize request is treated.\n\nSee later notes corresponding to usage by particular commands.  The\nfollowing notes apply to when \\fB-geometry\\fP is used to express a\nresize request, taking into account the current properties of the\nimage.\n\nBy default, the width and height are maximum values. That is, the\nimage is expanded or contracted to fit the width and height value\nwhile maintaining the aspect ratio of the image.\n\nAppend a ^ to the geometry so that the image aspect ratio is\nmaintained when the image is resized, but the resulting width or\nheight are treated as minimum values rather than maximum values.\n\nAppend a ! (exclamation point) to the geometry to force the image size to\nexactly the size you specify. For example, if you specify\n640x480! the image width is set to 640 pixels and height to\n480.\n\nIf only the width is specified, without the trailing 'x', then height\nis set to width (e.g., -geometry 100 is the same as\n-geometry 100x100).  If only the width is specified but with\nthe trailing 'x', then width assumes the value and the height is\nchosen to maintain the aspect ratio of the image.  Similarly, if only\nthe height is specified prefixed by 'x' (e.g., -geometry\nx256), the width is chosen to maintain the aspect ratio.\n\nTo specify a percentage width or height instead, append %. The image size\nis multiplied by the width and height percentages to obtain the final image\ndimensions. To increase the size of an image, use a value greater than\n100 (e.g. 125%). To decrease an image's size, use a percentage less than\n100.\n\nUse @ to specify the maximum area in pixels of an image.\n\nUse > to change the dimensions of the image \\fIonly\\fP if\nits width or height exceeds the geometry specification. < resizes\nthe image \\fIonly\\fP if both of its dimensions are less than the geometry\nspecification. For example,\nif you specify '640x480>' and the image size is 256x256, the image\nsize does not change. However, if the image is 512x512 or 1024x1024, it is\nresized to 480x480.  Enclose the geometry specification in quotation marks to\nprevent the < or > from being interpreted by your shell\nas a file redirection.\n\nWhen used with \\fIanimate\\fP and \\fIdisplay\\fP, offsets are handled in\nthe same manner as in \\fIX(1)\\fP and the \\fB-gravity\\fP option is not used.\nIf the \\fIx\\fP is negative, the offset is measured leftward\nfrom the right edge of the\nscreen to the right edge of the image being displayed.\nSimilarly, negative \\fIy\\fP is measured between the bottom edges.  The\noffsets are not affected by \"%\"; they are always measured in pixels.\n\nWhen used as a \\fIcomposite\\fP option, \\fB-geometry\\fP\ngives the dimensions of the image and its location with respect\nto the composite image.  If the \\fB-gravity\\fP option is present\nwith \\fINorthEast, East,\\fP or \\fISouthEast\\fP gravity, the \\fIx\\fP\nrepresents the distance from the right edge of the image to the right edge of\nthe composite image.  Similarly, if the \\fB-gravity\\fP option is present\nwith \\fISouthWest, South,\\fP or \\fISouthEast\\fP gravity, \\fIy\\fP\nis measured between the bottom edges. Accordingly, a positive offset will\nnever point in the direction outside of the image.  The\noffsets are not affected by \"%\"; they are always measured in pixels.\nTo specify the dimensions of the composite image, use the \\fB-resize\\fP\noption.\n\nWhen used as a \\fIconvert\\fP, \\fIimport\\fP or \\fImogrify\\fP option,\n\\fB-geometry\\fP is synonymous with \\fB-resize\\fP and\nspecifies the size of the output image.  The offsets, if present, are ignored.\n\nWhen used as a \\fImontage\\fP option, \\fB-geometry\\fP specifies the image\nsize and border size for each tile; default is 256x256+0+0.  Negative\noffsets (border dimensions) are meaningless.  The \\fB-gravity\\fP\noption affects the placement of the image within the tile; the default\ngravity for this purpose is \\fICenter\\fP.  If the \"%\" sign appears in\nthe geometry specification, the tile size is the specified percentage of\nthe original dimensions of the first tile.\nTo specify the dimensions of the montage, use the \\fB-resize\\fP\noption.\n.TP\n.B \"-gravity \\fI<type>\"\\fP\n\\fRdirection primitive  gravitates to when annotating the image.\n\nChoices are: NorthWest, North,\nNorthEast, West, Center, East, SouthWest, South, SouthEast.\n\nThe direction you choose specifies where to position the text \nwhen annotating\nthe image. For example \\fICenter\\fP gravity forces the text to be centered\nwithin the image. By default, the image gravity is \\fINorthWest\\fP.\nSee \\fB-draw\\fP for more details about graphic primitives.  Only the\ntext primitive is affected by the \\fB-gravity\\fP option.\n\nThe \\fB-gravity\\fP option is also used in concert with the \\fB-geometry\\fP\noption and other options that take \\fB<geometry>\\fP as a parameter, such\nas the \\fB-crop\\fP option.  See \\fB-geometry\\fP for details of how the\n\\fB-gravity\\fP option interacts with the\n\\fB<x>\\fP and \\fB<y>\\fP parameters of a geometry\nspecification.\n\nWhen used as an option to \\fIcomposite\\fP, \\fB-gravity\\fP\ngives the direction that the image gravitates within the composite.\n\nWhen used as an option to \\fImontage\\fP, \\fB-gravity\\fP gives the direction\nthat an image gravitates within a tile.  The default gravity is \\fICenter\\fP\nfor this purpose.\n.TP\n.B \"-green-primary \\fI<x>,<y>\"\\fP\n\\fRgreen chromaticity primary point\n.TP\n.B \"-hald-clut \\fI<clut>\"\\fP\n\\fRapply a Hald CLUT to the image\n\nA Hald CLUT (\"Color Look-Up Table\") is a special square color image\nwhich contains a look-up table for red, green, and blue.  The size of\nthe Hald CLUT image is determined by its order.  The width (and\nheight) of a Hald CLUT is the cube of the order.  For example, a Hald\nCLUT of order 8 is 512x512 pixels (262,144 colors) and of order 16 is\n4096x4096 (16,777,216 colors).  A special CLUT is the identity CLUT\nwhich which causes no change to the input image.  In order to use the\nHald CLUT, one takes an identity CLUT and adjusts its colors in some\nway.  The modified CLUT can then be used to transform any number of\nimages in an identical way.\n\nGraphicsMagick contains a built-in identity CLUT generator via the\n\\fBIDENTITY\\fP coder.  For example reading from the file name\n\\fPIDENTITY:8\\fP returns an identity CLUT of order 8.  Typical Hald\nCLUT identity images have an order of between 8 and 16.  The default\norder for the \\fBIDENTITY\\fP CLUT generator is 8.  Interpolation is\nused so it is not usually necessary for CLUT images to be very large.\nThe PNG file format is ideal for storing Hald CLUT images because it\ncompresses them very well.\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-highlight-color \\fI<color>\"\\fP\n\\fRpixel annotation color\n\nSpecifies the color to use when annotating difference pixels.\n.TP\n.B \"-highlight-style \\fI<style>\"\\fP\n\\fRpixel annotation style\n\nSpecifies the pixel difference annotation style used to draw attention to\nchanged pixels. May be one of \\fBAssign\\fP, \\fBThreshold\\fP,\n\\fBTint\\fP, or \\fBXOR\\fP; where \\fBAssign\\fP replaces the pixel with\nthe highlight color (see \\fB-highlight-color\\fP), \\fBThreshold\\fP\nreplaces the pixel with black or white based on the difference in\nintensity, \\fBTint\\fP alpha tints the pixel with the highlight color,\nand \\fBXOR\\fP does an XOR between the pixel and the highlight color.\n.TP\n.B \"-iconGeometry \\fI<geometry>\"\\fP\n\\fRspecify the icon geometry\n\nOffsets, if present in the geometry specification, are handled in\nthe same manner as the \\fB-geometry\\fP option, using X11 style to handle\nnegative offsets.\n.TP\n.B \"-iconic\"\n\\fRiconic animation\n.TP\n.B \"-immutable\"\n\\fRmake image immutable\n.TP\n.B \"-implode \\fI<factor>\"\\fP\n\\fRimplode image pixels about the center\n.TP\n.B \"-intent \\fI<type>\"\\fP\n\\fRuse this type of rendering intent when managing the image color\n\nUse this option to affect the the color management operation of an image (see\n\\fB-profile\\fP).\nChoose from these intents:\n\\fBAbsolute, Perceptual, Relative, Saturation\\fP.\n\nThe default intent is undefined.\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n\nChoices are: \\fBNone, Line, Plane,\\fP\nor \\fBPartition\\fP. The default is \\fBNone\\fP.\n\nThis option is used to specify the type of interlacing scheme for raw image\nformats such as \\fBRGB\\fP or \\fBYUV\\fP.\n\\fBNone\\fP means do not interlace\n(RGBRGBRGBRGBRGBRGB...),\n\n\\fBLine\\fP uses scanline interlacing\n(RRR...GGG...BBB...RRR...GGG...BBB...),\nand\n\\fBPlane\\fP uses plane interlacing (RRRRRR...GGGGGG...BBBBBB...).\n\n\\fBPartition\\fP\nis like plane except the different planes are saved to individual files\n(e.g. image.R, image.G, and image.B).\n\nUse \\fBLine\\fP to create an \\fBinterlaced PNG\\fP or \\fB GIF\\fP or\n\\fBprogressive JPEG\\fP image.\n.TP\n.B \"-label \\fI<name>\"\\fP\n\\fRassign a label to an image\n\nUse this option to assign a specific label to the image, when writing\nto an image format that supports labels, such as TIFF, PNG, MIFF, or\nPostScript. You can include the the image filename, type, width, height,\nor other image attribute by embedding special format character.  A label\nis not drawn on the image, but is embedded in the image datastream via\na \"Label\" tag or similar mechanism.  If you want the\nlabel to be visible on the image itself, use the \\fB-draw\\fP option.\nSee \\fB-comment\\fP for details.\n\nFor example,\n\n     -label \"%m:%f %wx%h\"\n\n\nproduces an image label of \\fBMIFF:bird.miff 512x480\\fP for an image titled\n\\fBbird.miff\\fP\nand whose width is 512 and height is 480.\n\nIf the first character of \\fIstring\\fP is \\fI@\\fP, the image label\nis read from a file titled by the remaining characters in the string.\nPlease note that if the string comes from an untrusted source that it\nshould be sanitized before use since otherwise the content of an\narbitrary readable file might be incorporated into the image\nlabel (a security risk).\n\nIf the -label option appears multiple times, only the last label is\nstored.\n\nIn PNG images, the label is stored in a \\fBtEXt\\fP or \\fBzTXt\\fP chunk\nwith the keyword \"label\".\n\nWhen converting to \\fIPostScript\\fP, use this option to specify a header\nstring to print above the image. Specify the label font with\n\\fB-font\\fP.\n\nWhen creating a montage, by default the label associated with an image\nis displayed with the corresponding tile in the montage.  Use the\n\\fB+label\\fP option to suppress this behavior.\n\n\n.TP\n.B \"-lat \\fI<width>x<height>{+-}<offset>{%}\"\\fP\n\\fRperform local adaptive thresholding\n\nPerform local adaptive thresholding using the specified width, height,\nand offset.  The offset is a distance in sample space from the mean,\nas an absolute integer ranging from 0 to the maximum sample value or\nas a percentage.  If the percent option is supplied, then the offset\nis computed as a percentage of the quantum range.  It is strongly\nrecommended to use the percent option so that results are not\nsensitive to pixel quantum depth.\n\nFor example,\n\n     -colorspace gray -lat \"10x10-5%\"\n\n\nwill help clarify a scanned grayscale or color document, producing a\nbi-level equivalent.\n.TP\n.B \"-level \\fI<black_point>{,<gamma>}{,<white_point>}{%}\"\\fP\n\\fRadjust the level of image contrast\n\nGive one, two or three values delimited with commas: black-point, gamma,\nwhite-point (e.g. 10,1.0,250 or 2%,0.5,98%). The black and white\npoints range from 0 to MaxRGB or from 0 to 100%; if the white point is\nomitted it is set to MaxRGB-black_point. If a \"%\" sign is present\nanywhere in the string, the black and white points are percentages of\nMaxRGB. Gamma is an exponent that ranges from 0.1 to 10.; if it is\nomitted, the default of 1.0 (no gamma correction) is assumed. This\ninterface works similar to Photoshop's \"Image->Adjustments->Levels...\"\n\"Input Levels\" interface.\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n\nBy default, resource limits are estimated based on the available\nresources of the system. The resource limits are \\fBDisk\\fP, maximum\ntotal disk space consumed; \\fBFile\\fP, maximum number of file\ndescriptors allowed to be open at once; \\fBMap\\fP, maximum total\nnumber of file bytes which may be memory mapped; \\fBMemory\\fP,\nmaximum total number of bytes of heap memory used for image storage;\n\\fBPixels\\fP, maximum absolute image size (per image); \\fBWidth\\fP,\nmaximum image pixels width; \\fBHeight\\fP, maximum image pixels\nheight; and \\fBThreads\\fP, the maximum number of worker threads to\nuse per OpenMP thread team.\n\nThese resource limits are used to decide if (for a given image) the\ndecoded image (\"pixel cache\") should be stored in heap memory (RAM),\nin a memory-mapped disk file, or in a disk file accessed via\nread/write I/O.  The number of total pixels in one image, and/or the\nwidth/height, may also be limited in order to force the reading, or\ncreation of images larger than the limit (in pixels) to intentionally\nfail. The disk limit establishes an overall limit since using the disk\nis the means of last resort. When the disk limit has been reached, no\nmore images may be read.\n\nThe value argument is an absolute value, but may have standard binary\nsuffix characters applied ('K', 'M', 'G', 'T', 'P', 'E') to apply a\nscaling to the value (based on a multiplier of 1024). Any additional\ncharacters are ignored. For example, '-limit Pixels 10MP' limits\nthe maximum image size to 10 megapixels and '-limit memory 32MB\n-limit map 64MB' limits memory and memory mapped files to 32\nmegabytes and 64 megabytes respectively.\n\nResource limits may also be set using environment variables. The\nenvironment variables \\fBMAGICK_LIMIT_DISK\\fP,\n\\fBMAGICK_LIMIT_FILES\\fP, \\fBMAGICK_LIMIT_MAP\\fP,\n\\fBMAGICK_LIMIT_MEMORY\\fP, \\fBMAGICK_LIMIT_PIXELS\\fP,\n\\fBMAGICK_LIMIT_WIDTH\\fP, \\fBMAGICK_LIMIT_HEIGHT\\fP,and\n\\fBOMP_NUM_THREADS\\fP may be used to set the limits for disk space,\nopen files, memory mapped size, heap memory, per-image pixels, image\nwidth, image height, and threads respectively.\n\nUse the option -list resource list the current limits.\n.TP\n.B \"-linewidth\"\n\\fRthe line width for subsequent draw operations\n.TP\n.B \"-list \\fI<type>\"\\fP\n\\fRthe type of list\n\nChoices are: \\fBColor\\fP, \\fBDelegate\\fP, \\fBFormat\\fP, \\fBMagic\\fP,\n\\fBModule\\fP, \\fBResource\\fP, or \\fBType\\fP. The \\fBModule\\fP option\nis only available if GraphicsMagick was built to support loadable modules.\n\nThis option lists information about the GraphicsMagick configuration.\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n\nThis option specifies the format for the log printed when the \\fB-debug\\fP\noption is active.\n\nYou can display the following components by embedding\nspecial format characters:\n\n     %d   domain\n     %e   event\n     %f   function\n     %l   line\n     %m   module\n     %p   process ID\n     %r   real CPU time\n     %t   wall clock time\n     %u   user CPU time\n     %%   percent sign\n     \\\\n   newline\n     \\\\r   carriage return\n\n\nFor example:\n\n    gm convert -debug coders -log \"%u %m:%l %e\" in.gif out.png\n\n\nThe default behavior is to print all of the components.\n.TP\n.B \"-loop \\fI<iterations>\"\\fP\n\\fRadd Netscape loop extension to your GIF animation\n\nA value other than zero forces the animation to repeat itself up to\n\\fIiterations\\fP\ntimes.\n.TP\n.B \"-magnify\"\n\\fRmagnify the image\n\nThe image size is doubled using linear interpolation.\n.TP\n.B \"-magnify \\fI<factor>\"\\fP\n\\fRmagnify the image\n\nThe displayed image is magnified by \\fBfactor\\fP.\n.TP\n.B \"-map \\fI<filename>\"\\fP\n\\fRchoose a particular set of colors from this image\n\n[\\fIconvert\\fP or \\fImogrify\\fP]\n\nBy default, color reduction chooses an optimal set of colors that best\nrepresent the original image. Alternatively, you can choose a particular\nset of colors from an image file with this option.\n\nUse\n\\fB+map\\fP to reduce\nall images in the image sequence that follows to a single optimal set of colors\nthat best represent all the images.  The sequence of images\nis terminated by the appearance of any option.\nIf the \\fB+map\\fP\noption appears after all of the input images, all images are mapped.\n.TP\n.B \"-map \\fI<type>\"\\fP\n\\fRdisplay image using this type.\n\n[\\fIanimate\\fP or \\fIdisplay\\fP]\n\nChoose from these \\fIStandard Colormap\\fP types:\n\n     best\n     default\n     gray\n     red\n     green\n     blue\n\n\nThe \\fIX server\\fP must support the \\fIStandard Colormap\\fP you choose,\notherwise an error occurs. Use \\fBlist\\fP as the type and \\fBdisplay\\fP\nsearches the list of colormap types in \\fBtop-to-bottom\\fP order until\none is located. See \\fIxstdcmap(1)\\fP for one way of creating Standard\nColormaps.\n.TP\n.B \"-mask \\fI<filename>\"\\fP\n\\fRSpecify a clipping mask\n\nThe image read from the file is used as a clipping mask.  It must have\nthe same dimensions as the image being masked.\n\nIf the mask image contains an opacity channel, the opacity of each\npixel is used to define the mask.  Otherwise, the intensity (gray\nlevel) of each pixel is used.  Unmasked (black) pixels are modified\nwhile masked pixels (not black) are protected from alteration.\n\nUse \\fB+mask\\fP to remove the clipping mask.\n\nIt is not necessary to use \\fB-clip\\fP to activate the mask; \\fB-clip\\fP\nis implied by \\fB-mask\\fP.\n.TP\n.B \"-matte\"\n\\fRstore matte channel if the image has one\n\nIf the image does not have a matte channel, create an opaque one.\n\nUse \\fB+matte\\fP to ignore the matte channel and to avoid writing a\nmatte channel in the output file.\n.TP\n.B \"-mattecolor \\fI<color>\"\\fP\n\\fRspecify the color to be used with the \\fB-frame\\fP option\n\nThe color is specified using the format described under the \\fB-fill\\fP\noption.\n.TP\n.B \"-maximum-error \\fI<limit>\"\\fP\n\\fRspecifies the maximum amount of total image error\n\nSpecifies the maximum amount of total image error (based on comparison\nusing a specified metric) before an error (\"image difference exceeds\nlimit\") is reported.  The error is reported via a non-zero command\nexecution return status.\n.TP\n.B \"-median \\fI<radius>\"\\fP\n\\fRapply a median filter to the image\n.TP\n.B \"-metric \\fI<metric>\"\\fP\n\\fRcomparison metric (MAE, MSE, PAE, PSNR, RMSE)\n.TP\n.B \"-minify \\fI<factor>\"\\fP\n\\fRminify the image\n\nThe image size is halved using linear interpolation.\n.TP\n.B \"-mode \\fI<value>\"\\fP\n\\fRmode of operation\n\nThe available montage modes are \\fBframe\\fP to place the images in a\nrectangular grid while adding a decorative frame with dropshadow,\n\\fBunframe\\fP to place undecorated images in a rectangular grid, and\n\\fBconcatenate\\fP to pack the images closely together without any\nwell-defined grid or decoration. \n.TP\n.B \"-modulate \\fIbrightness[,saturation[,hue]]\"\\fP\n\\fRvary the brightness, saturation, and hue of an image\n\nSpecify the percent change in brightness, color saturation, and\nhue separated by commas. Default argument values are 100 percent,\nresulting in no change. For example, to increase the color brightness\nby 20% and decrease the color saturation by 10% and leave the hue\nunchanged, use: \\fB-modulate 120,90\\fP.\n\nHue is the percentage of absolute rotation from the current\nposition. For example 50 results in a counter-clockwise rotation of 90\ndegrees, 150 results in a clockwise rotation of 90 degrees, with 0 and\n200 both resulting in a rotation of 180 degrees.\n.TP\n.B \"-monitor\"\n\\fRshow progress indication\n\nA simple command-line progress indication is shown while the command is\nrunning. The process indication shows the operation currently being\nperformed and the percent completed. Commands using X11 may replace the\ncommand line progress indication with a graphical one once an image has\nbeen displayed.\n.TP\n.B \"-monochrome\"\n\\fRtransform the image to black and white\n.TP\n.B \"-morph \\fI<frames>\"\\fP\n\\fRmorphs an image sequence\n\nBoth the image pixels and size are linearly interpolated to give the appearance\nof a meta-morphosis from one image to the next.\n\nThe sequence of images\nis terminated by the appearance of any option.\nIf the \\fB-morph\\fP\noption appears after all of the input images, all images are morphed.\n.TP\n.B \"-mosaic\"\n\\fRcreate a mosaic from an image or an image sequence\n\nThe \\fB-mosaic\\fP option provides a flexible way to composite one or\nmore images onto a solid-color canvas image. It works similar to\n\\fB-flatten\\fP except that a base canvas image is automatically\ncreated with a suitable size given the image size, page dimensions,\nand page offsets of images to be composited.  The color of the base\ncanvas image may be set via the \\fB-background\\fP option.  The\ndefault canvas color is 'white', but 'black' or 'transparent' may be\nmore suitable depending on the composition algorithm requested.\n\nThe \\fB-compose\\fP option may be used to specify the composition\nalgorithm to use when compositing the subsequent image on the base\ncanvas.\n\nThe \\fB-page\\fP option can be used to establish the dimensions of the\nmosaic and to position the subsequent image within the mosaic.  If the\n\\fB-page\\fP argument does not specify width and height, then the\ncanvas dimensions are evaluated based on the image sizes and\noffsets.\n\nThe sequence of images is terminated by the appearance of any option.\nIf the \\fB-mosaic\\fP option appears after all of the input images,\nall images are included in the mosaic.\n\nThe following is an example of composing an image based on red, green,\nand blue layers extracted from a sequence of images and pasted on the\ncanvas image at specified offsets:\n\n    gm convert -background black \\\\\n              -compose CopyRed   -page +0-100 red.png \\\\\n              -compose CopyGreen -page +0+40  green.png \\\\\n              -compose CopyBlue  -page +0+180 blue.png \\\\\n              -mosaic output.png\n\n.TP\n.B \"-motion-blur \\fI<radius>{x<sigma>}{+angle}\"\\fP\n\\fRSimulate motion blur\n\nSimulate motion blur by convolving the image with a Gaussian operator of\nthe given radius and standard deviation (sigma). For reasonable results,\nradius should be larger than sigma. If radius is zero, then a suitable\nradius is automatically selected based on sigma. The angle specifies the\nangle that the object is coming from (side which is blurred).\n.TP\n.B \"-name\"\n\\fRname an image\n.TP\n.B \"-negate\"\n\\fRreplace every pixel with its complementary color\n\nThe red, green, and blue intensities of an image are negated.\nWhite becomes black,\nyellow becomes blue, etc.\nUse \\fB+negate\\fP\nto only negate the grayscale pixels of the image.\n.TP\n.B \"-noise \\fI<radius|type>\"\\fP\n\\fRadd or reduce noise in an image\n\nThe principal function of noise peak elimination filter is to smooth the\nobjects within an image without losing edge information and without creating\nundesired structures. The central idea of the algorithm is to replace a\npixel with its next neighbor in value within a pixel window, if this pixel\nhas been found to be noise. A pixel is defined as noise if and only if\nthis pixel is a maximum or minimum within the pixel window.\n\nUse \\fBradius\\fP to specify the width of the neighborhood.\n\nUse \\fB+noise\\fP followed by a noise type to add noise to an image.\nThe noise added modulates the existing image pixels. Choose from these\nnoise types:\n\n     Uniform\n     Gaussian\n     Multiplicative\n     Impulse\n     Laplacian\n     Poisson\n     Random (uniform distribution)\n\n.TP\n.B \"-noop\"\n\\fRNOOP (no option)\n\nThe \\fB-noop\\fP option can be used to terminate a group of images\nand reset all options to their default values, when no other option is\ndesired.\n.TP\n.B \"-normalize\"\n\\fRtransform image to span the full range of color values\n\nThis is a contrast enhancement technique based on the image histogram.\n\nWhen computing the contrast enhancement values, the histogram edges\nare truncated so that the majority of the image pixels are considered\nin the constrast enhancement, and outliers (e.g. random noise or\nminute details) are ignored.  The default is that 0.1 percent of the\nhistogram entries are ignored.  The percentage of the histogram to\nignore may be specified by using the \\fB-set\\fP option with the\n\\fBhistogram-threshold\\fP parameter similar to \\fB-set\nhistogram-threshold 0.01\\fP to specify 0.01 percent.  Use 0 percent\nto use the entire histogram, with possibly diminished contrast\nenhancement.\n.TP\n.B \"-opaque \\fI<color>\"\\fP\n\\fRchange this color to the pen color within the image\n\nThe color is specified using the format described under the\n\\fB-fill\\fP option.  The color is replaced if it is identical to the\ntarget color, or close enough to the target color in a 3D space as\ndefined by the Euclidean distance specified by \\fB-fuzz\\fP.\n\nSee \\fB-fill\\fP and \\fB-fuzz\\fP for more details.\n.TP\n.B \"-operator \\fIchannel operator rvalue[%]\"\\fP\n\\fRapply a mathematical, bitwise, or value operator to an image channel\n\nApply a low-level mathematical, bitwise, or value operator to a selected\nimage channel or all image channels. Operations which result in negative\nresults are reset to zero, and operations which overflow the available\nrange are reset to the maximum possible value.\n\nSelect a channel from: \\fBRed\\fP, \\fBGreen\\fP, \\fBBlue\\fP,\n\\fBOpacity\\fP, \\fBMatte\\fP, \\fBCyan\\fP, \\fBMagenta\\fP, \\fBYellow\\fP,\n\\fBBlack\\fP, \\fBAll\\fP, or \\fBGray\\fP. \\fBAll\\fP only modifies the\ncolor channels and does not modify the \\fBOpacity\\fP channel. Except for\nthe threshold operators, \\fBAll\\fP operates on each channel\nindependently so that operations are on a per-channel basis.\n\n\\fBGray\\fP treats the color channels as a grayscale intensity and\nperforms the requested operation on the equivalent pixel intensity so the\nresult is a gray image.\nSelect an operator from \\fBAdd\\fP, \\fBAnd\\fP, \\fBAssign\\fP,\n\\fBDepth\\fP, \\fBDivide\\fP, \\fBGamma\\fP, \\fBNegate\\fP,\n\\fBLShift\\fP, \\fBLog\\fP, \\fBMax\\fP, \\fBMin\\fP, \\fBMultiply\\fP,\n\\fBOr\\fP, \\fBPow\\fP \\fBRShift\\fP, \\fBSubtract\\fP,\n\\fBThreshold\\fP, \\fBThreshold-White\\fP,\n\\fBThreshold-White-Negate\\fP, \\fBThreshold-Black\\fP,\n\\fBThreshold-Black-Negate\\fP, \\fBXor\\fP, \\fBNoise-Gaussian\\fP,\n\\fBNoise-Impulse\\fP, \\fBNoise-Laplacian\\fP,\n\\fBNoise-Multiplicative\\fP, \\fBNoise-Poisson\\fP,\n\\fBNoise-Random\\fP, and \\fBNoise-Uniform\\fP.\n\nRvalue may be any floating point or integer value. Normally rvalue will\nbe in the range of 0 to MaxRGB, where MaxRGB is the largest quantum value\nsupported by the GraphicsMagick build (255, 65535, or 4294967295) but\nvalues outside this range are useful for some arithmetic operations.\nArguments to logical or bit-wise operations are rounded to a positive\nintegral value prior to use. If a percent (\\fB%\\fP) symbol is appended\nto the argument, then the argument has a range of 0 to 100 percent.\n\nThe following is a description of the operators:\n\n.in 15\n\n.in 15\n.B \"Add\"\n.in 20\n \\fR\n.in 20\nResult is rvalue added to channel value.\n\n.in 15\n.in 15\n.B \"And\"\n.in 20\n \\fR\n.in 20\nResult is the logical AND of rvalue with channel value.\n\n.in 15\n.in 15\n.B \"Assign\"\n.in 20\n \\fR\n.in 20\nResult is rvalue.\n\n.in 15\n.in 15\n.B \"Depth\"\n.in 20\n \\fR\n.in 20\nResult is channel value adjusted so that it may be (approximately)\nstored in the specified number of bits without additional loss.\n\n.in 15\n.in 15\n.B \"Divide\"\n.in 20\n \\fR\n.in 20\nResult is channel value divided by rvalue.\n\n.in 15\n.in 15\n.B \"Gamma\"\n.in 20\n \\fR\n.in 20\nResult is channel value gamma adjusted by rvalue.\n\n.in 15\n.in 15\n.B \"LShift\"\n.in 20\n \\fR\n.in 20\nResult is channel value bitwise left shifted by rvalue bits.\n\n.in 15\n.in 15\n.B \"Log\"\n.in 20\n \\fR\n.in 20\nResult is computed as log(value*rvalue+1)/log(rvalue+1).\n\n.in 15\n.in 15\n.B \"Max\"\n.in 20\n \\fR\n.in 20\nResult is assigned to rvalue if rvalue is greater than value.\n\n.in 15\n.in 15\n.B \"Min\"\n.in 20\n \\fR\n.in 20\nResult is assigned to rvalue if rvalue is less than value.\n\n.in 15\n.in 15\n.B \"Multiply\"\n.in 20\n \\fR\n.in 20\nResult is channel value multiplied by rvalue.\n\n.in 15\n.in 15\n.B \"Negate\"\n.in 20\n \\fR\n.in 20\nResult is inverse of channel value (like a film negative). An rvalue\nmust be supplied but is currently not used. Inverting the image twice\nresults in the original image.\n\n.in 15\n.in 15\n.B \"Or\"\n.in 20\n \\fR\n.in 20\nResult is the logical OR of rvalue with channel value.\n\n.in 15\n.in 15\n.B \"Pow\"\n.in 20\n \\fR\n.in 20\nResult is computed as pow(value,rvalue). Similar to Gamma except that\nrvalue is not inverted.\n\n.in 15\n.in 15\n.B \"RShift\"\n.in 20\n \\fR\n.in 20\nResult is channel value bitwise right shifted by rvalue bits.\n\n.in 15\n.in 15\n.B \"Subtract\"\n.in 20\n \\fR\n.in 20\nResult is channel value minus rvalue.\n\n.in 15\n.in 15\n.B \"Threshold\"\n.in 20\n \\fR\n.in 20\nResult is maximum (white) if channel value is greater than rvalue,\nor minimum (black) if it is less than or equal to rvalue. If \\fBall\\fP\nchannels are specified, then thresholding is done based on computed pixel\nintensity.\n\n.in 15\n.in 15\n.B \"Threshold-white\"\n.in 20\n \\fR\n.in 20\nResult is maximum (white) if channel value is greater than rvalue and\nis unchanged if it is less than or equal to rvalue. This can be used to\nremove apparent noise from the bright parts of an image. If \\fBall\\fP\nchannels are specified, then thresholding is done based on computed pixel\nintensity.\n\n.in 15\n.in 15\n.B \"Threshold-White-Negate\"\n.in 20\n \\fR\n.in 20\nResult is set to black if channel value is greater than\nrvalue and is unchanged if it is less than or equal to rvalue. If\n\\fBall\\fP channels are specified, then thresholding is done based on\ncomputed pixel intensity.\n\n.in 15\n.in 15\n.B \"Threshold-black\"\n.in 20\n \\fR\n.in 20\nResult is minimum (black) if channel value is less than than rvalue\nand is unchanged if it is greater than or equal to rvalue. This can be\nused to remove apparent noise from the dark parts of an image. If\n\\fBall\\fP channels are specified, then thresholding is done based on\ncomputed pixel intensity.\n\n.in 15\n.in 15\n.B \"Threshold-Black-Negate\"\n.in 20\n \\fR\n.in 20\nResult is set to white if channel value is less than than\nrvalue and is unchanged if it is greater than or equal to rvalue. If\n\\fBall\\fP channels are specified, then thresholding is done based on\ncomputed pixel intensity.\n\n.in 15\n.in 15\n.B \"Xor\"\n.in 20\n \\fR\n.in 20\nResult is the logical XOR of rvalue with channel value. An\ninteresting property of XOR is that performing the same operation twice\nresults in the original value.\n\n.in 15\n.in 15\n.B \"Noise-Gaussian\"\n.in 20\n \\fR\n.in 20\nResult is the current channel value modulated with gaussian noise\naccording to the intensity specified by rvalue.\n\n.in 15\n.in 15\n.B \"Noise-Impulse\"\n.in 20\n \\fR\n.in 20\nResult is the current channel value modulated with impulse noise\naccording to the intensity specified by rvalue.\n\n.in 15\n.in 15\n.B \"Noise-Laplacian\"\n.in 20\n \\fR\n.in 20\nResult is the current channel value modulated with laplacian noise\naccording to the intensity specified by rvalue.\n\n.in 15\n.in 15\n.B \"Noise-Multiplicative\"\n.in 20\n \\fR\n.in 20\nResult is the current channel value modulated with multiplicative\ngaussian noise according to the intensity specified by rvalue.\n\n.in 15\n.in 15\n.B \"Noise-Poisson\"\n.in 20\n \\fR\n.in 20\nResult is the current channel value modulated with poisson noise\naccording to the intensity specified by rvalue.\n\n.in 15\n.in 15\n.B \"Noise-Random\"\n.in 20\n \\fR\n.in 20\nResult is the current channel value modulated with random (uniform\ndistribution) noise according to the intensity specified by rvalue.\nThe initial noise intensity (rvalue=1.0) is the range of one pixel\nquantum span.\n\n.in 15\n.in 15\n.B \"Noise-Uniform\"\n.in 20\n \\fR\n.in 20\nResult is the channel value with uniform noise applied according to\nthe intensity specified by rvalue.\n\n.in 15\n\n\n\nAs an example, the \\fBAssign\\fP operator assigns a fixed value to a\nchannel. For example, this command sets the red channel to the mid-range\nvalue:\n\n    gm convert in.bmp -operator red assign \"50%\" out.bmp\n\n\nThe following applies 50% thresholding to the image and returns a gray\nimage:\n\n    gm convert in.bmp -operator gray threshold \"50%\" out.bmp\n\n.TP\n.B \"-ordered-dither \\fI<channeltype> <NxN>\"\\fP\n\\fRordered dither the image\n\nThe channel or channels specified in the \\fBchanneltype\\fP argument are\nreduced to binary, using an ordered dither method. The choices for\n\\fBchanneltype\\fP are \\fBAll\\fP, \\fBIntensity\\fP, \\fBRed\\fP,\n\\fBGreen\\fP, \\fBBlue\\fP, \\fBCyan\\fP, \\fBMagenta\\fP, \\fBYellow\\fP,\n\\fBBlack\\fP, and \\fBOpacity\\fP\n\nWhen \\fBchanneltype\\fP is \"All\", the color samples are dithered into\na gray level and then that gray level is stored in the three color\nchannels.  Separately, the opacity channel is dithered into a bilevel\nopacity value which is stored in the opacity channel.\n\nWhen \\fBchanneltype\\fP is \"Intensity\", only the color samples are\ndithered. When \\fBchanneltype\\fP is \"opacity\" or \"matte\", only the\nopacity channel is dithered. When a color channel is specified, only that\nchannel is dithered.\n\nThe choices for N are 2 through 7. The image is divided into\nNxN pixel tiles.  In each tile, some or all pixels are turned to\nwhite depending on their intensity.  For each N, (N**2)+1 levels\nof gray can be represented.  For N == 2, 3, or 4, the pixels\nare turned to white in an order that maximizes dispersion (i.e.,\nreduces granularity), while\nfor N == 5, 6, and 7, they are turned to white in an order that\ncreates a roughly circular black blob in the middle of each tile.\nAn attractive \"half-tone\" looking image can be obtained by first\nrotating the image 45 degrees, performing a 5x5 ordered-dither\noperation, then rotating it back to the original orientation and\ncropping to the original image dimensions.  If the original image\nis gamma-encoded, it is adviseable to convert it to linear intensity\nfirst, e.g., with the \"-gamma 0.45455\" option.\n.TP\n.B \"-output-directory \\fI<directory>\"\\fP\n\\fRoutput files to directory\n\nUse -output-directory to specify a directory under which to write the\noutput files. Normally mogrify overwrites the input files, but with\nthis option the output files may be written to a different directory\ntree so that the input files are preserved. The algorithm used\npreserves all of the input path specification in the output path so\nthat the user-specified input path (including any sub-directory part)\nis appended to the output path. If the input file lacks an extension,\nthen a suitable extension is automatically added to the output file.\nThe user is responsible for creating the output directory specified as\nan argument, but subdirectories will be created as needed if the\n\\fB-create-directories\\fP option is supplied.  This option may be\nused to apply transformations on files from one directory and write\nthe transformed files to a different directory.  In conjunction with\n\\fB-create-directories\\fP, this option is designed to support\ntransforming whole directory trees of files provided that the relative\npath of the input file is included as part the list of filenames.\n.TP\n.B \"-orient \\fI<orientation>\"\\fP\n\\fRSet the image orientation attribute\n\nSets the image orientation attribute.  The image orientation attribute\nis compatible with the TIFF orientation tag (and the EXIF orientation\ntag).  Accepted values are \\fBundefined\\fP, \\fBTopLeft\\fP,\n\\fBTopRight\\fP, \\fBBottomRight\\fP, \\fBBottomLeft\\fP,\n\\fBLeftTop\\fP, \\fBRightTop\\fP, \\fBRightBottom\\fP,\n\\fBLeftBottom\\fP, and hyphenated versions thereof\n(e.g. \\fBleft-bottom\\fP).  Please note that GraphicsMagick does not\ninclude an EXIF editor so if an EXIF profile is written to the output\nimage, the value in the EXIF profile might not match the image.  It is\npossible for an image file to indicate its orientation in several\ndifferent ways simultaneously.\n.TP\n.B \"-page \\fI<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}\"\\fP\n\\fRsize and location of an image canvas\n\nUse this option to specify the dimensions of the\n\\fIPostScript\\fP page\nin dots per inch or a TEXT page in pixels. The choices for a PostScript\npage are:\n\n     11x17         792  1224\n     Ledger       1224   792\n     Legal         612  1008\n     Letter        612   792\n     LetterSmall   612   792\n     ArchE        2592  3456\n     ArchD        1728  2592\n     ArchC        1296  1728\n     ArchB         864  1296\n     ArchA         648   864\n     A0           2380  3368\n     A1           1684  2380\n     A2           1190  1684\n     A3            842  1190\n     A4            595   842\n     A4Small       595   842\n     A5            421   595\n     A6            297   421\n     A7            210   297\n     A8            148   210\n     A9            105   148\n     A10            74   105\n     B0           2836  4008\n     B1           2004  2836\n     B2           1418  2004\n     B3           1002  1418\n     B4            709  1002\n     B5            501   709\n     C0           2600  3677\n     C1           1837  2600\n     C2           1298  1837\n     C3            918  1298\n     C4            649   918\n     C5            459   649\n     C6            323   459\n     Flsa          612   936\n     Flse          612   936\n     HalfLetter    396   612\n\n\nFor convenience you can specify the page size by media (e.g. A4, Ledger,\netc.). Otherwise, \\fB-page\\fP behaves much like\n\\fB-geometry\\fP (e.g.  -page letter+43+43>).\n\nThis option is also used to place subimages when writing to a multi-image\nformat that supports offsets, such as GIF89 and MNG.  When used for this\npurpose the offsets are always  measured from the\ntop left corner of the canvas and are not affected by the \\fB-gravity\\fP\noption.\nTo position a GIF or MNG image, use \\fB-page\\fP\\fI{+-}<x>{+-}<y>\\fP\n(e.g. -page +100+200).  When writing to a MNG file, a \\fB-page\\fP\noption appearing ahead of the first image in the sequence with nonzero\nwidth and height defines the width and height values that are written in\nthe \\fBMHDR\\fP chunk.  Otherwise, the MNG width and height are computed\nfrom the bounding box that contains all images in the sequence.  When\nwriting a GIF89 file, only the bounding box method is used to determine its\ndimensions.\n\nFor a PostScript page, the image is sized as in \\fB-geometry\\fP and positioned\nrelative to the lower left hand corner of the page by\n{+-}<\\fBx\\fP\\fIoffset\\fP>{+-}<\\fBy\\fP\n\\fIoffset>\\fP. Use\n-page 612x792>, for example, to center the\nimage within the page. If the image size exceeds the PostScript page, it\nis reduced to fit the page.\nThe default gravity for the \\fB-page\\fP\noption is \\fINorthWest\\fP, i.e., positive \\fBx\\fP and\n\\fBy\\fP \\fIoffset\\fP are measured rightward and downward from the top\nleft corner of the page, unless the \\fB-gravity\\fP option is present with\na value other than \\fINorthWest\\fP.\n\nThe default page dimensions for a TEXT image is 612x792.\n\nThis option is used in concert with \\fB-density\\fP.\n\nUse \\fB+page\\fP to remove the page settings for an image.\n.TP\n.B \"-paint \\fI<radius>\"\\fP\n\\fRsimulate an oil painting\n\nEach pixel is replaced by the most frequent color in a circular neighborhood\nwhose width is specified with \\fIradius\\fP.\n.TP\n.B \"-pause \\fI<seconds>\"\\fP\n\\fRpause between animation loops [animate]\n\nPause for the specified number of seconds before repeating the\nanimation.\n.TP\n.B \"-pause \\fI<seconds>\"\\fP\n\\fRpause between snapshots [import]\n\nPause for the specified number of seconds before taking the next\nsnapshot.\n.TP\n.B \"-pen \\fI<color>\"\\fP\n\\fR(This option has been replaced by the -fill option)\n.TP\n.B \"-ping\"\n\\fRefficiently determine image characteristics\n\nUse this option to disable reading the image pixels so that image\ncharacteristics such as the image dimensions may be obtained very\nquickly. For identify, use +ping to force reading the image pixels so\nthat the pixel read rate may be included in the displayed information.\n.TP\n.B \"-pointsize \\fI<value>\"\\fP\n\\fRpointsize of the PostScript, X11, or TrueType font\n.TP\n.B \"-preview \\fI<type>\"\\fP\n\\fRimage preview type\n\nUse this option to affect the preview operation of an image (e.g.\nconvert file.png -preview Gamma Preview:gamma.png). Choose\nfrom these previews:\n\n     Rotate\n     Shear\n     Roll\n     Hue\n     Saturation\n     Brightness\n     Gamma\n     Spiff\n     Dull\n     Grayscale\n     Quantize\n     Despeckle\n     ReduceNoise\n     AddNoise\n     Sharpen\n     Blur\n     Threshold\n     EdgeDetect\n     Spread\n     Shade\n     Raise\n     Segment\n     Solarize\n     Swirl\n     Implode\n     Wave\n     OilPaint\n     CharcoalDrawing\n     JPEG\n\n\nThe default preview is \\fBJPEG\\fP.\n.TP\n.B \"-process \\fI<command>\"\\fP\n\\fRprocess a sequence of images using a process module\n\nThe command argument has the form \\fBmodule=arg1,arg2,arg3,...,argN\\fP\nwhere \\fBmodule\\fP is the name of the module to invoke (e.g. \"analyze\")\nand arg1,arg2,arg3,...,argN are an arbitrary number of arguments to\npass to the process module.\nThe sequence of images\nis terminated by the appearance of any option.\n\nIf the \\fB-process\\fP\noption appears after all of the input images, all images are processed.\n.TP\n.B \"-profile \\fI<filename>\"\\fP\n\\fRadd ICM, IPTC, or generic profile  to image\n\n-profile filename adds an ICM (ICC color management), IPTC\n(newswire information), or a generic (including Exif) profile to the image\n.\n\nUse +profile icm, +profile iptc, or\n+profile profile_name to remove the respective profile.\nMultiple profiles may be listed, separated by commas. Profiles may be\nexcluded from subsequent listed matches by preceding their name with\nan exclamation point.  For example, +profile '!icm,*' strips\nall profiles except for the ICM profile.  Use identify\n-verbose to find out what profiles are in the image file.  Use\n+profile \"*\" to remove all profiles.\nWriting the image to a format that does not support profiles will\nof course also cause all profiles to be removed.  The JPEG and PNG\nformats will store any profiles that have been read and not removed.\nIn JPEG they are stored in APP1 markers, and in PNG they are stored\nas hex-coded binary in compressed zTXt chunks, except for the iCC\nchunk which is stored in the iCCP chunk.\n\nTo extract a profile, the \\fB-profile\\fP option is not used.  Instead,\nsimply write the file to an image\nformat such as \\fIAPP1, 8BIM, ICM,\\fP or \\fIIPTC\\fP.\n\nFor example, to extract the Exif data (which is stored in JPEG files\nin the \\fIAPP1\\fP profile), use\n\n\n    gm convert cockatoo.jpg exifdata.app1\n\nNote that GraphicsMagick does not attempt to update any profile to\nreflect changes made to the image, e.g., rotation from portrait to landscape\norientation, so it is possible that the preserved profile may contain\ninvalid data.\n.TP\n.B \"-preserve-timestamp\"\n\\fRpreserve the original timestamps of the file\n\nUse this option to preserve the original modification and access\ntimestamps of the file, even if it has been modified.\n.TP\n.B \"+progress\"\n\\fRdisable progress monitor and busy cursor\n\nBy default, when an image is displayed, a progress monitor bar is shown\nin the top left corner of an existing image display window, and the\ncurrent cursor is replaced with an hourglass cursor. Use \\fB+progress\\fP\nto disable the progress monitor and busy cursor during display operations.\nWhile the progress monitor is disabled for all operations, the busy\ncursor continues to be enabled for non-display operations such as image\nprocessing. This option is useful for non-interactive display operations,\nor when a \"clean\" look is desired.\n.TP\n.B \"-quality \\fI<value>\"\\fP\n\\fRJPEG/MIFF/PNG/TIFF compression level\n For the JPEG and MPEG image formats, quality is 0 (lowest image\nquality and highest compression) to 100 (best quality but least\neffective compression). The default quality is 75.  Use the\n\\fB-sampling-factor\\fP option to specify the factors for chroma\ndownsampling.  To use the same quality value as that found by the JPEG\ndecoder, use the -define jpeg:preserve-settings flag.\n\nFor the MIFF image format, and the TIFF format while using ZIP\ncompression, quality/10 is the zlib compression level, which is 0 (worst\nbut fastest compression) to 9 (best but slowest). It has no effect on the\nimage appearance, since the compression is always lossless.\n\nFor the JPEG-2000 image format, quality is mapped using a non-linear\nequation to the compression ratio required by the Jasper library. This\nnon-linear equation is intended to loosely approximate the quality\nprovided by the JPEG v1 format. The default quality value 75 results in\na request for 16:1 compression. The quality value 100 results in\na request for non-lossy compression.\n\nFor the MNG and PNG image formats, the quality value sets the zlib compression\nlevel (quality / 10) and filter-type (quality % 10). Compression levels\nrange from 0 (fastest compression) to 100 (best but slowest). For compression\nlevel 0, the Huffman-only strategy is used, which is fastest but not\nnecessarily the worst compression.\n\nIf\nfilter-type is 4 or less, the specified filter-type is used for all scanlines:\n\n     0: none\n     1: sub\n     2: up\n     3: average\n     4: Paeth\n\n\nIf filter-type is 5, adaptive filtering is used when quality is greater\nthan 50 and the image does not have a color map, otherwise no filtering\nis used.\n\nIf filter-type is 6, adaptive filtering\nwith \\fIminimum-sum-of-absolute-values\\fP\nis used.\n\nOnly if the output is MNG, if filter-type is 7, the LOCO color transformation\nand adaptive filtering with \\fIminimum-sum-of-absolute-values\\fP\nare used.\n\nThe default is quality is 75, which means nearly the best compression with\nadaptive filtering.  The quality setting has no effect on the appearance\nof PNG and MNG images, since the compression is always lossless.\n\nFor further information, see the PNG\nspecification.\n\nWhen writing a JNG image with transparency, two quality values are required,\none for the main image and one for the grayscale image that conveys the\nopacity channel.  These are written as a single integer equal to the main\nimage quality plus 1000 times the opacity quality.  For example, if you\nwant to use quality 75 for the main image and quality 90 to compress\nthe opacity data, use -quality 90075.\n\nFor the PNM family of formats (PNM, PGM, and PPM) specify a quality\nfactor of zero in order to obtain the ASCII variant of the format. Note\nthat -compress \\fInone\\fP used to be used to trigger ASCII output but\nprovided the opposite result of what was expected as compared with other\nformats.\n\nFor the TIFF format, the JPEG, WebP, Zip, and Zstd compression\nalgorithms are influenced by the quality value.  JPEG and WebP provide\nlossy compression so higher quality produces a larger file with less\ndegradation.  The Zip and Zstd compression algorithms (and WebP in\nlossless mode) are lossless and for these algorithms a higher\n\\'quality' means to work harder to produce a smaller file, but with no\ndifference in image quality.\n.TP\n.B \"-raise \\fI<width>x<height>\"\\fP\n\\fRlighten or darken image edges\n\nThis will create a 3-D effect. See \\fB-geometry\\fP for details\ndetails about the geometry specification. Offsets are not used.\n\nUse \\fB-raise\\fP to create a raised effect, otherwise use \\fB+raise\\fP.\n.TP\n.B \"-random-threshold \\fI<channeltype> <LOWxHIGH>\"\\fP\n\\fRrandom threshold the image\n\nThe channel or channels specified in the <channeltype> argument are\nreduced to binary, using an random-threshold method. The choices for\n\\fBchanneltype\\fP are \\fBAll\\fP, \\fBIntensity\\fP, \\fBRed\\fP,\n\\fBGreen\\fP, \\fBBlue\\fP, \\fBCyan\\fP, \\fBMagenta\\fP, \\fBYellow\\fP,\n\\fBBlack\\fP, and \\fBOpacity\\fP\n\nWhen \\fBchanneltype\\fP is \"All\", the color samples are thresholded into\na graylevel and then that gray level is stored in the three color\nchannels. Separately, the opacity channel is thresholded into a bilevel\nopacity value which is stored in the opacity channel. For each pixel, a\nnew random number is used to establish the threshold to be used. The\nthreshold never exceeds the specified maximum (HIGH) and is never less\nthan the specified minimum (LOW).\n\nWhen \\fBchanneltype\\fP is \"intensity\", only the color samples are\nthresholded. When \\fBchanneltype\\fP is \"opacity\" or \"matte\", only the\nopacity channel is thresholded. The other named channels only threshold\nthe associated channel.\n.TP\n.B \"-recolor \\fI<matrix>\"\\fP\n\\fRapply a color translation matrix to image channels\n\nA user supplied color translation matrix (expressed as a text string)\nis used to translate/blend the image channels based on weightings in a\nsupplied matrix which may be of order 3 (color channels only), 4\n(color channels plus opacity), or 5 (color channels plus opacity and\noffset).  Values in the columns of the matrix (red, green, blue,\nopacity) are used as multipliers with the existing channel values and\nadded together according to the rows of the matrix.  Matrix values are\nfloating point and may be negative.  The offset column (column 5) is\npurely additive and is scaled such that 0.0 to 1.0 represents the\nmaximum quantum range (but values are not limited to this range). The\nmath for the color translation matrix is similar to that used by Adobe\nFlash except that the offset is scaled to 1.0 (divide Flash offset by\n255 for use with GraphicsMagick) so that the results are independent\nof quantum depth.\n\nAn \\fBidentity\\fP matrix exists for each matrix order which\nresults in no change to the image.  The translation matrix should be\nbased on an alteration of the identity matrix.\n\nIdentity matrix of order 3\n\n  1 0 0\n  0 1 0\n  0 0 1\n\n\nwhich may be formatted into a convenient matrix argument similar to\n(comma is treated as white space):\n\n  -recolor \"1 0 0, 0 1 0, 0 0 1\"\n\n\nIdentity matrix of order 4\n\n  1 0 0 0\n  0 1 0 0\n  0 0 1 0\n  0 0 0 1\n\n\nIdentity matrix of order 5.  The last row is required to exist\nfor the purpose of parsing, but is otherwise not used.\n\n  1 0 0 0 0\n  0 1 0 0 0\n  0 0 1 0 0\n  0 0 0 1 0\n  0 0 0 0 1\n\n\nAs an example, an image wrongly in BGR channel order may be converted\nto RGB using this matrix (blue->red, red->blue):\n\n  0 0 1\n  0 1 0\n  1 0 0\n\n\nand an RGB image using standard Rec.709 primaries may be converted\nto grayscale using this matrix of standard weighting factors:\n\n  0.2126 0.7152 0.0722\n  0.2126 0.7152 0.0722\n  0.2126 0.7152 0.0722\n\n\nand contrast may be reduced by scaling down by 80% and adding a 10%\noffset:\n\n  0.8 0.0 0.0 0.0 0.1\n  0.0 0.8 0.0 0.0 0.1\n  0.0 0.0 0.8 0.0 0.1\n  0.0 0.0 0.0 0.8 0.1\n  0.0 0.0 0.0 0.0 1.0\n\n.TP\n.B \"-red-primary \\fI<x>,<y>\"\\fP\n\\fRred chromaticity primary point\n.TP\n.B \"-region \\fI<width>x<height>{+-}<x>{+-}<y>\"\\fP\n\\fRapply options to a portion of the image\n\nThe \\fIx\\fP and \\fIy\\fP offsets are treated in the same manner as in \\fB-crop\\fP.\n.TP\n.B \"-remote\"\n\\fRperform a X11 remote operation\n\nThe \\fB-remote\\fP command sends a command to a \"gm display\" or \"gm\nanimate\" which is already running. The only command recognized at this\ntime is the name of an image file to load. This capability is very\nuseful to load new images without needing to restart GraphicsMagick\n(e.g. for a slide-show or to use GraphicsMagick as the display engine\nfor a different GUI). Also see the \\fB+progress\\fP option for a way\nto disable progress indication for a clean look while loading new images.\n.TP\n.B \"-render\"\n\\fRrender vector operations\n\nUse \\fB+render\\fP to turn off rendering vector operations. This is\nuseful when saving the result to vector formats such as MVG or SVG.\n.TP\n.B \"-repage \\fI <width>x<height>+xoff+yoff[!]\"\\fP\n\\fRAdjust image page offsets\n\nAdjust the current image page canvas and position based on a relative\npage specification.  This option may be used to change the location of\na subframe (e.g. part of an animation) prior to composition.  If the\ngeometry specification is absolute (includes a '!'), then the offset\nadjustment is absolute and there is no adjustment to page width and\nheight, otherwise the page width and height values are also adjusted\nbased on the current image dimensions.  Use \\fB+repage\\fP to set the\nimage page offsets to default.\n.TP\n.B \"-resample \\fI<horizontal>x<vertical>\"\\fP\n\\fRResample image to specified horizontal and vertical resolution\n\nResize the image so that its rendered size remains the same as the\noriginal at the specified target resolution. Either the current image\nresolution units or the previously set with \\fB-units\\fP are used to\ninterpret the argument. For example, if a 300 DPI image renders at 3\ninches by 2 inches on a 300 DPI device, when the image has been\nresampled to 72 DPI, it will render at 3 inches by 2 inches on a 72\nDPI device.  Note that only a small number of image formats\n(e.g. JPEG, PNG, and TIFF) are capable of storing the image\nresolution. For formats which do not support an image resolution, the\noriginal resolution of the image must be specified via \\fB-density\\fP\non the command line prior to specifying the resample resolution.\n\nNote that Photoshop stores and obtains image resolution from a\nproprietary embedded profile. If this profile exists in the image,\nthen Photoshop will continue to treat the image using its former\nresolution, ignoring the image resolution specified in the standard\nfile header.\n\nSome image formats (e.g. PNG) require use of metric or english units\nso even if the original image used a particular unit system, if it is\nsaved to a different format prior to resampling, then it may be\nnecessary to specify the desired resolution units using \\fB-units\\fP\nsince the original units may have been lost. In other words, do not\nassume that the resolution units are restored if the image has been\nsaved to a file.\n.TP\n.B \"-resize \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image\n\nThis is an alias for the \\fB-geometry\\fP option and it behaves in the\nsame manner. If the \\fB-filter\\fP option precedes the \\fB-resize\\fP\noption, the specified filter is used.\n\nThere are some exceptions:\n\nWhen used as a \\fIcomposite\\fP option, \\fB-resize\\fP conveys the\npreferred size of the output image, while \\fB-geometry\\fP conveys the\nsize and placement of the \\fIcomposite image\\fP within the main\nimage.\n\nWhen used as a \\fImontage\\fP option, \\fB-resize\\fP conveys the preferred\nsize of the montage, while \\fB-geometry\\fP conveys\ninformation about the tiles.\n.TP\n.B \"-roll \\fI{+-}<x>{+-}<y>\"\\fP\n\\fRroll an image vertically or horizontally\n\nSee \\fB-geometry\\fP for details the geometry specification.  The\n\\fIx\\fP and \\fIy\\fP offsets are not affected by the \\fB-gravity\\fP\noption.\n\nA negative \\fIx\\fP offset rolls the image left-to-right. A negative\n\\fIy\\fP offset rolls the image top-to-bottom.\n.TP\n.B \"-rotate \\fI<degrees>{<}{>}\"\\fP\n\\fRrotate the image\n\nPositive angles rotate the image in a clockwise direction while\nnegative angles rotate counter-clockwise.\n\nUse > to rotate the image only if its width exceeds the\nheight.  < rotates the image \\fIonly\\fP if its width is less\nthan the height. For example, if you specify -rotate \"-90>\"\nand the image size is 480x640, the image is not rotated.  However, if\nthe image is 640x480, it is rotated by -90 degrees.  If you use\n> or <, enclose it in quotation marks to prevent it\nfrom being misinterpreted as a file redirection.\n\nEmpty triangles left over from rotating the image are filled with the\ncolor defined as \\fBbackground\\fP (class \\fBbackgroundColor\\fP).\nThe color is specified using the format described under the\n\\fB-fill\\fP option.\n.TP\n.B \"-sample \\fI<geometry>\"\\fP\n\\fRscale image using pixel sampling\n\nSee \\fB-geometry\\fP for details about\nthe geometry specification.\n\\fB-sample\\fP ignores the \\fB-filter\\fP selection if the \\fB-filter\\fP option\nis present.  Offsets, if present in the geometry string, are ignored, and\nthe \\fB-gravity\\fP option has no effect.\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n\nThis option specifies the sampling factors to be used by the DPX, JPEG,\nMPEG, or YUV encoders for chroma downsampling. The sampling factor must\nbe specified while reading the raw YUV format since it is not preserved\nin the file header.\nIndustry-standard video subsampling notation such as \"4:2:2\" may also\nbe used to specify the sampling factors. \"4:2:2\" is equivalent to a\nspecification of \"2x1\"\n\nThe JPEG decoder obtains the original sampling factors (and quality\nsettings) when a JPEG file is read. To re-use the original sampling\nfactors (and quality setting) when JPEG is output, use the -define\njpeg:preserve-settings flag.\n.TP\n.B \"-scale \\fI<geometry>\"\\fP\n\\fRscale the image.\n\nSee \\fB-geometry\\fP for details about\nthe geometry specification.  \\fB-scale\\fP uses a simpler, faster algorithm,\nand it ignores the \\fB-filter\\fP selection if the \\fB-filter\\fP option\nis present.  Offsets, if present in the geometry string, are ignored, and\nthe \\fB-gravity\\fP option has no effect.\n.TP\n.B \"-scene \\fI<value>\"\\fP\n\\fRset scene number\n\nThis option sets the scene number of an image or the first image in\nan image sequence.\n.TP\n.B \"-scenes \\fI<value-value>\"\\fP\n\\fRrange of image scene numbers to read\n\nEach image in the range is read\nwith the filename followed by a period (\\fB.\\fP) and the decimal scene\nnumber.  You\ncan change this behavior by embedding a \\fB%d, %0Nd, %o, %0No, %x, or %0Nx\nprintf\\fP format specification in the file name. For example,\n\n    gm montage -scenes 5-7 image.miff montage.miff\n\n\nmakes a montage of files image.miff.5, image.miff.6, and image.miff.7, and\n\n    gm animate -scenes 0-12 image%02d.miff\n\n\nanimates files image00.miff, image01.miff, through image12.miff.\n.TP\n.B \"-screen\"\n\\fRspecify the screen to capture\n\nThis option indicates that the GetImage request used to obtain the image\nshould be done on the root window, rather than directly on the specified\nwindow.  In this way, you can obtain pieces of other windows that overlap\nthe specified window, and more importantly, you can capture menus or other\npopups that are independent windows but appear over the specified window.\n.TP\n.B \"-set \\fI<attribute> <value>\"\\fP\n\\fRset an image attribute\n\nSet a named image attribute.  The attribute is set on the current\n(previously specified on command line) image.\n.TP\n.B \"+set \\fI<attribute>\"\\fP\n\\fRunset an image attribute\n\nUnset a named image attribute.  The attribute is removed from the current\n(previously specified on command line) image.\n.TP\n.B \"-segment \\fI<cluster threshold>x<smoothing threshold>\"\\fP\n\\fRsegment an image\n\nSegment an image by analyzing the histograms of the color components and\nidentifying units that are homogeneous with the fuzzy c-means technique.\n\nSegmentation is a very useful fast and and approximate color quantization\nalgorithm for scanned printed pages or scanned cartoons. It may also be\nused as a special effect. Specify \\fIcluster threshold\\fP as the minimum\npercentage of total pixels in a cluster before it is considered valid.\nFor huge images containing small detail, this may need to be a tiny\nfraction of a percent (e.g. 0.015) so that important detail is not lost.\n\\fISmoothing threshold\\fP eliminates noise in the second derivative of\nthe histogram. As the value is increased, you can expect a smoother\nsecond derivative. The default is 1.5. Add the \\fI-verbose\\fP option to\nsee a dump of cluster statistics given the parameters used. The\nstatistics may be used as a guide to help fine tune the options.\n.TP\n.B \"-shade \\fI<azimuth>x<elevation>\"\\fP\n\\fRshade the image using a distant light source\n\nSpecify \\fIazimuth\\fP and \\fIelevation\\fP as the position of the light\nsource. Use \\fB+shade\\fP to return the shading results as a grayscale\nimage.\n.TP\n.B \"-shadow \\fI<radius>{x<sigma>}\"\\fP\n\\fRshadow the montage\n.TP\n.B \"-shared-memory\"\n\\fRuse shared memory\n\nThis option specifies whether the utility should attempt to use shared\nmemory for pixmaps.  GraphicsMagick must be compiled with shared\nmemory support, and the display must support the \\fIMIT-SHM\\fP\nextension.  Otherwise, this option is ignored.  The default is\n\\fBTrue\\fP.\n.TP\n.B \"-sharpen \\fI<radius>{x<sigma>}\"\\fP\n\\fRsharpen the image\n\nUse a Gaussian operator of the given radius and standard deviation\n(sigma).\n.TP\n.B \"-shave \\fI<width>x<height>{%}\"\\fP\n\\fRshave pixels from the image edges\n\nSpecify the width of the region to be removed from both\nsides of the image and the height of the regions to be removed from\ntop and bottom.\n.TP\n.B \"-shear \\fI<x degrees>x<y degrees>\"\\fP\n\\fRshear the image along the X or Y axis\n\nUse the specified positive or negative shear angle.\n\nShearing slides one edge of an image along the X or Y axis, creating a\nparallelogram. An X direction shear slides an edge along the X axis,\nwhile a Y direction shear slides an edge along the Y axis. The amount\nof the shear is controlled by a shear angle. For X direction shears,\n\\fIx degrees\\fP is measured relative to the Y axis, and similarly,\nfor Y direction shears \\fIy degrees\\fP is measured relative to the X\naxis.\n\nEmpty triangles left over from shearing the image are filled with the\ncolor defined as \\fBbackground\\fP (class \\fBbackgroundColor\\fP).\nThe color is specified using the format described under the\n\\fB-fill\\fP option.\n.TP\n.B \"-silent\"\n\\fRoperate silently\n.TP\n.B \"-size \\fI<width>x<height>{+offset}\"\\fP\n\\fRwidth and height of the image\n\nUse this option to specify the width and height of raw images whose\ndimensions are unknown such as \\fBGRAY\\fP, \\fBRGB\\fP, or\n\\fBCMYK\\fP. In addition to width and height, use \\fB-size\\fP with an\noffset to skip any header information in the image or tell the number\nof colors in a \\fBMAP\\fP image file, (e.g. -size 640x512+256).\n\nFor Photo CD images, choose from these sizes:\n\n     192x128\n     384x256\n     768x512\n     1536x1024\n     3072x2048\n\n\nFinally, use this option to choose a particular resolution layer of a JBIG\nor JPEG image (e.g. -size 1024x768).\n.TP\n.B \"-snaps \\fI<value>\"\\fP\n\\fRnumber of screen snapshots\n\nUse this option\nto grab more than one image from the X server screen, to create\nan animation sequence.\n.TP\n.B \"-solarize \\fI<factor>\"\\fP\n\\fRnegate all pixels above the threshold level\n\nSpecify \\fIfactor\\fP as the\npercent threshold of the intensity (0 - 99.9%).\n\nThis option produces a \\fIsolarization\\fP effect seen when exposing a\nphotographic film to light during the development process.\n.TP\n.B \"-spread \\fI<amount>\"\\fP\n\\fRdisplace image pixels by a random amount\n\n\\fIAmount\\fP defines the size of the neighborhood around each pixel to\nchoose a candidate pixel to swap.\n.TP\n.B \"-stegano \\fI<offset>\"\\fP\n\\fRhide watermark within an image\n\nUse an offset to start the image hiding some number of pixels from the\nbeginning of the image.  Note this offset and the image size.  You will\nneed this information to recover the steganographic image\n(e.g. display -size 320x256+35 stegano:image.png).\n.TP\n.B \"-stereo\"\n\\fRcomposite two images to create a stereo anaglyph\n\nThe left side of the stereo pair is saved as the red channel of the output\nimage.  The right side is saved as the green channel.  Red-green stereo\nglasses are required to properly view the stereo image.\n.TP\n.B \"-strip\"\n\\fRremove all profiles and text attributes from the image\n\nAll embedded profiles and text attributes are stripped from the image.\nThis is useful for images used for the web, or when output files need\nto be as small as possible\n\nBe careful not to use this option to remove author, copyright, and\nlicense information that you are required to retain when redistributing\nan image.\n.TP\n.B \"-stroke \\fI<color>\"\\fP\n\\fRcolor to use when stroking a graphic primitive\n\nThe color is specified using the format described under the \\fB-fill\\fP\noption.\n\nSee \\fB-draw\\fP for further details.\n.TP\n.B \"-strokewidth \\fI<value>\"\\fP\n\\fRset the stroke width\n\nSee \\fB-draw\\fP for further details.\n.TP\n.B \"-swirl \\fI<degrees>\"\\fP\n\\fRswirl image pixels about the center\n\n\\fIDegrees\\fP defines the tightness of the swirl.\n.TP\n.B \"-text-font \\fI<name>\"\\fP\n\\fRfont for writing fixed-width text\n\nSpecifies the name of the preferred font to use in fixed (typewriter style)\nformatted text.  The default is 14 point \\fICourier\\fP.\n\nYou can tag a font to specify whether it is a PostScript, TrueType, or\nX11 font.  For example, Courier.ttf is a TrueType font\nand x:fixed is X11.\n.TP\n.B \"-texture \\fI<filename>\"\\fP\n\\fRname of texture to tile onto the image background\n.TP\n.B \"-threshold \\fI<value>{%}\"\\fP\n\\fRthreshold the image\n\nModify the image such that any pixel sample with an intensity value\ngreater than the threshold is assigned the maximum intensity (white), or\notherwise is assigned the minimum intensity (black). If a percent prefix\nis applied, then the threshold is a percentage of the available range.\n\nTo efficiently create a black and white image from a color image, use\n\n    gm convert -threshold 50% in.png out.png\n\n\nThe optimum threshold value depends on the nature of the image.\nIn order to threshold individual channels, use the \\fB-operator\\fP\nsubcommand with it's \\fBThreshold\\fP, \\fBThreshold-White\\fP, or\n\\fBThreshold-Black\\fP options.\n.TP\n.B \"-thumbnail \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image (quickly)\n\nThe \\fB-thumbnail\\fP command resizes the image as quickly as\npossible, with more concern for speed than resulting image quality.\nRegardless, resulting image quality should be acceptable for many\nuses.  It is primarily intended to be used to generate smaller\nversions of the image, but may also be used to enlarge the image.  The\n\\fB-thumbnail\\fP \\fBgeometry\\fP argument observes the same syntax\nand rules as it does for \\fB-resize\\fP.\n.TP\n.B \"-tile \\fI<filename>\"\\fP\n\\fRtile image when filling a graphic primitive\n.TP\n.B \"-tile \\fI<geometry>\"\\fP\n\\fRlayout of images [\\fImontage\\fP]\n.TP\n.B \"-title \\fI<string>\"\\fP\n\\fRassign title to displayed image [\\fIanimate, display, montage\\fP]\n\nUse this option to assign a specific title to the image. This is\nassigned to the image window and is typically displayed in the window\ntitle bar.  Optionally you can include the image filename, type,\nwidth, height, Exif data, or other image attribute by embedding\nspecial format characters described under the \\fB-format\\fP\noption.\n\nFor example,\n\n     -title \"%m:%f %wx%h\"\n\n\nproduces an image title of MIFF:bird.miff 512x480 for an image\ntitled bird.miff and whose width is 512 and height is 480.\n.TP\n.B \"-transform\"\n\\fRtransform the image\n\nThis option applies the transformation matrix from a previous\n\\fB-affine\\fP option.\n\n    gm convert -affine 2,2,-2,2,0,0 -transform bird.ppm bird.jpg\n\n.TP\n.B \"-transparent \\fI<color>\"\\fP\n\\fRmake this color transparent within the image\n\nThe color is specified using the format described under the \\fB-fill\\fP\noption.\n.TP\n.B \"-treedepth \\fI<value>\"\\fP\n\\fRtree depth for the color reduction algorithm\n\nNormally, this integer value is zero or one. A value of zero or one\ncauses the use of an optimal tree depth for the color reduction\nalgorithm\n\nAn optimal depth generally allows the best representation of the source\nimage with the fastest computational speed and the least amount of memory.\nHowever, the default depth is inappropriate for some images. To assure\nthe best representation, try values between 2 and 8 for this parameter.\nRefer to\nquantize for more details.\n\nThe \\fB-colors\\fP or \\fB-monochrome\\fP option, or writing to an image\nformat which requires color reduction, is required for this option to\ntake effect.\n.TP\n.B \"-trim\"\n\\fRtrim an image\n\nThis option removes any edges that are exactly the same color as the\ncorner pixels.  Use \\fB-fuzz\\fP to make \\fB-trim\\fP remove edges that\nare nearly the same color as the corner pixels.\n.TP\n.B \"-type \\fI<type>\"\\fP\n\\fRthe image type\n\nChoose from:\n\\fBBilevel\\fP, \\fBGrayscale\\fP, \\fBPalette\\fP,\n\\fBPaletteMatte\\fP, \\fBTrueColor\\fP, \\fBTrueColorMatte\\fP,\n\\fBColorSeparation\\fP, \\fBColorSeparationMatte\\fP, or \\fBOptimize\\fP.\n\nNormally, when a format supports different subformats such as bilevel,\ngrayscale, palette, truecolor, and truecolor+alpha, the encoder will try\nto choose a suitable subformat based on the nature of the image. The\n\\fB-type\\fP option may be used to tailor the output subformat. By\ndefault the output subformat is based on readily available image\ninformation and is usually similar to the input format.\n\nSpecify -type Optimize in order to enable inspecting all pixels\n(if necessary) in order to find the most efficient subformat. Inspecting\nall of the pixels may be slow for very large images, particularly if they\nare stored in a disk cache. If an RGB image contains only gray pixels,\nthen every pixel in the image must be inspected in order to decide that\nthe image is actually grayscale!\n\nSometimes a specific subformat is desired. For example, to force a JPEG\nimage to be written in TrueColor RGB format even though only gray pixels\nare present, use\n\n    gm convert bird.pgm -type TrueColor bird.jpg\n\n\nSimilarly, using -type TrueColorMatte will force the encoder to\nwrite an alpha channel even though the image is opaque, if the output\nformat supports transparency.\n\nSome pseudo-formats (e.g. the XC format) will respect the requested\ntype if it occurs previously on the command line.  For example, to obtain\na DirectClass solid color canvas image rather than PsuedoClass, use\n\n    gm convert -size 640x480 -type TrueColor xc:red red.miff\n\n\nLikewise, specify \\fB-type\\fP \\fBBilevel\\fP, \\fBGrayscale\\fP,\n\\fBTrueColor\\fP, or \\fBTrueColorMatte\\fP prior to reading a Postscript\n(or PDF file) in order to influence the type of image that Ghostcript\nreturns. Reading performance will be dramatically improved for\nblack/white Postscript if \\fBBilevel\\fP is specified, and will be\nconsiderably faster if \\fBGrayscale\\fP is specified.\n.TP\n.B \"-update \\fI<seconds>\"\\fP\n\\fR\ndetect when image file is modified and redisplay.\n\nSuppose that while you are displaying an image the file that is currently\ndisplayed is over-written.\n\\fBdisplay\\fP will automatically detect that\nthe input file has been changed and update the displayed image accordingly.\n.TP\n.B \"-units \\fI<type>\"\\fP\n\\fRthe units of image resolution\n\nChoose from: \\fBUndefined\\fP, \\fBPixelsPerInch\\fP, or\n\\fBPixelsPerCentimeter\\fP. This option is normally used in conjunction\nwith the \\fB-density\\fP option.\n.TP\n.B \"-unsharp \\fI<radius>{x<sigma>}{+<amount>}{+<threshold>}\"\\fP\n\\fRsharpen the image with an unsharp mask operator\n\nThe \\fB-unsharp\\fP option sharpens an image. The image is convolved\nwith a Gaussian operator of the given radius and standard deviation\n(sigma). For reasonable results, radius should be larger than sigma. Use\na radius of 0 to have the method select a suitable radius.\n\nThe parameters are:\n\n.in 15\n\n.in 15\n.B \"radius\"\n.in 20\n \\fR\n.in 20\n\nThe radius of the Gaussian, in pixels, not counting the center pixel (default 0).\n\n.in 15\n.in 15\n.B \"sigma\"\n.in 20\n \\fR\n.in 20\n\nThe standard deviation of the Gaussian, in pixels (default 1.0).\n\n.in 15\n.in 15\n.B \"amount\"\n.in 20\n \\fR\n.in 20\n\nThe percentage of the difference between the original and the blur image that\nis added back into the original (default 1.0).\n\n.in 15\n.in 15\n.B \"threshold\"\n.in 20\n \\fR\n.in 20\n\nThe threshold, as a fraction of MaxRGB, needed to apply the difference\namount (default 0.05).\n\n.in 15\n\n\n.TP\n.B \"-use-pixmap\"\n\\fRuse the pixmap\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n\nThis information is printed: image scene number; image name; image size;\nthe image class (\\fIDirectClass\\fP or \\fIPseudoClass\\fP); the total\nnumber of unique colors; and the number of seconds to read and transform\nthe image. If the image is \\fIDirectClass\\fP, the total number of unique\ncolors is not displayed unless \\fB-verbose\\fP is specified twice since\nit may take quite a long time to compute, particularly for deep images.\nIf the image is \\fIPseudoClass\\fP then its pixels are defined by indexes\ninto a colormap. If the image is \\fIDirectClass\\fP then each pixel\nincludes a complete and independent color specification.\n\nIf \\fB-colors\\fP is also specified, the total unique colors in the image\nand color reduction error values are printed. Refer to quantize\nfor a description of these values.\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n.TP\n.B \"-view \\fI<string>\"\\fP\n\\fRFlashPix viewing parameters\n.TP\n.B \"-virtual-pixel \\fI<method>\"\\fP\n\\fRspecify contents of \"virtual pixels\"\n\nThis option \ndefines \"virtual pixels\" for use in operations that can access pixels outside\nthe boundaries of an image.\n\nChoose from these methods:\n\n.in 15\n\n.in 15\n.B \"Constant\"\n.in 20\n \\fR\n.in 20\n\nUse the image background color.\n\n.in 15\n.in 15\n.B \"Edge\"\n.in 20\n \\fR\n.in 20\n\nExtend the edge pixel toward infinity (default).\n\n.in 15\n.in 15\n.B \"Mirror\"\n.in 20\n \\fR\n.in 20\n\nMirror the image.\n\n.in 15\n.in 15\n.B \"Tile\"\n.in 20\n \\fR\n.in 20\n\nTile the image.\n\n.in 15\n\n\n\nThis option affects operations that use\nvirtual pixels such as \\fB-blur\\fP, \\fB-sharpen\\fP, \\fB-wave\\fP, etc.\n.TP\n.B \"-visual \\fI<type>\"\\fP\n\\fRanimate images using this X visual type\n\nChoose from these visual classes:\n\n     StaticGray\n     GrayScale\n     StaticColor\n     PseudoColor\n     TrueColor\n     DirectColor\n     default\n     visual id\n\n\nThe X server must support the visual you choose, otherwise an error occurs.\nIf a visual is not specified, the visual class that can display the most\nsimultaneous colors on the default screen is chosen.\n.TP\n.B \"-watermark \\fI<brightness>x<saturation>\"\\fP\n\\fRpercent brightness and saturation of a watermark\n.TP\n.B \"-wave \\fI<amplitude>x<wavelength>\"\\fP\n\\fRalter an image along a sine wave\n\nSpecify \\fIamplitude\\fP and \\fIwavelength\\fP\nof the wave.\n.TP\n.B \"-white-point \\fI<x>,<y>\"\\fP\n\\fRchromaticity white point\n.TP\n.B \"-white-threshold \\fIred[,green][,blue][,opacity]\"\\fP\n\\fRpixels above the threshold become white\n\nUse \\fB-white-threshold\\fP to set pixels with values above the specified\nthreshold to maximum value (white). If only one value is supplied, or the\nred, green, and blue values are identical, then intensity thresholding is\nused. If the color threshold values are not identical then channel-based\nthresholding is used, and color distortion will occur. Specify a negative\nvalue (e.g. -1) if you want a channel to be ignored but you do want to\nthreshold a channel later in the list. If a percent (%) symbol is\nappended, then the values are treated as a percentage of maximum\nrange.\n.TP\n.B \"-window \\fI<id>\"\\fP\n\\fRmake image the background of a window\n\n\\fIid\\fP can be a window id or name.  Specify \\fBroot\\fP to\nselect X's root window as the target window.\n\nBy default the image is tiled onto the background of the target\nwindow.   If \\fBbackdrop\\fP or \\fB-geometry\\fP are\nspecified, the image is surrounded by the background color.  Refer to\n\\fBX RESOURCES\\fP for details.\n\nThe image will not display on the root window if the image has more\nunique colors than the target window colormap allows.  Use\n\\fB-colors\\fP to reduce the number of colors.\n.TP\n.B \"-window-group\"\n\\fRspecify the window group\n.TP\n.B \"-write \\fI<filename>\"\\fP\n\\fRwrite an intermediate image [\\fIconvert, composite\\fP]\n\nThe current image is written to the specified filename and then\nprocessing continues using that image. The following is an example of how\nseveral sizes of an image may be generated in one command (repeat as\noften as needed):\n\n    gm convert input.jpg -resize 50% -write input50.jpg \\\\\n              -resize 25% input25.jpg\n\n.TP\n.B \"-write \\fI<filename>\"\\fP\n\\fRwrite the image to a file [\\fIdisplay\\fP]\n\nIf \\fIfilename\\fP already exists, you will be prompted as to whether it should\nbe overwritten.\n\nBy default, the image is written in the format that it was read in as.\nTo specify a particular image format, prefix \\fIfilename\\fP with the\nimage type and a colon (e.g., ps:image) or specify the image type as\nthe filename suffix (e.g., image.ps). Specify file as - for standard\noutput. If file has the extension \\fB.Z\\fP or \\fB.gz\\fP, the file\nsize is \\fBcompressed\\fP using compress or \\fBgzip\\fP\nrespectively. Precede the image file name with | to pipe to a system\ncommand.\n\nUse \\fB-compress\\fP to specify the type of image compression.\n\nThe equivalent X resource for this option is\n\\fBwriteFilename\\fP (class \\fBWriteFilename\\fP).\nSee\n\"X Resources\", below,\nfor details.\n.SH ENVIRONMENT\n.TP\n.B \"COLUMNS\"\n\\fROutput screen width. Used when formatting text for the screen. Many\nUnix systems keep this shell variable up to date, but it may need to be\nexplicitly exported in order for GraphicsMagick to see it.\n.TP\n.B \"DISPLAY\"\n\\fRX11 display ID (host, display number, and screen in the form\nhostname:display.screen).\n.TP\n.B \"HOME\"\n\\fRLocation of user's home directory. For security reasons, now only\nobserved by \"uninstalled\" builds of GraphicsMagick which do not have\ntheir location hard-coded or set by an installer.  When supported,\nGraphicsMagick searches for configuration files in $HOME/.magick if\nthe directory exists. See \\fBMAGICK_CODER_MODULE_PATH\\fP,\n\\fBMAGICK_CONFIGURE_PATH\\fP, and \\fBMAGICK_FILTER_MODULE_PATH\\fP if\nmore flexibility is needed.\n.TP\n.B \"MAGICK_ACCESS_MONITOR\"\n\\fRWhen set to \\fBTRUE\\fP, command line monitor mode (enabled by\n\\fB-monitor\\fP) will also show files accessed (including temporary\nfiles) and any external commands which are executed. This is useful\nfor debugging, but also illustrates arguments made available to an\naccess handler registered by the\n\\fBMagickSetConfirmAccessHandler()\\fP C library function.\n.TP\n.B \"MAGICK_CODER_STABILITY\"\n\\fRThe minimum coder stability level before it will be used. The\navailable levels are \\fBPRIMARY\\fP, \\fBSTABLE\\fP, \\fBUNSTABLE\\fP,\nand \\fBBROKEN\\fP.  The default minimum level is \\fBUNSTABLE\\fP,\nwhich means that all available working coders will be used. The\npurpose of this option is to reduce the security exposure (or apparent\ncomplexity) due to the huge number of formats supported. Coders at the\n\\fBPRIMARY\\fP level are commonly used formats with very well\nmaintained implementations. Coders at the \\fBSTABLE\\fP level are\nreasonably well maintained but represent less used formats. Coders at\nthe \\fBUNSTABLE\\fP level either have weak implementations, the file\nformat itself is weak, or the probability the coder will be needed is\nvanishingly small. Coders at the \\fBBROKEN\\fP level are known to\noften not work properly or might not be useful in their current state\nat all.\n.TP\n.B \"MAGICK_CODER_MODULE_PATH\"\n\\fRSearch path to use when searching for image format coder modules.\nThis path allows the user to arbitrarily extend the image formats\nsupported by GraphicsMagick by adding loadable modules to an arbitrary\nlocation rather than copying them into the GraphicsMagick installation\ndirectory. The formatting of the search path is similar to operating\nsystem search paths (i.e. colon delimited for Unix, and semi-colon\ndelimited for Microsoft Windows). This user specified search path is used\nbefore trying the default search path.\n.TP\n.B \"MAGICK_CONFIGURE_PATH\"\n\\fRSearch path to use when searching for configuration (.mgk) files.\nThe formatting of the search path is similar to operating system search\npaths (i.e. colon delimited for Unix, and semi-colon delimited for\nMicrosoft Windows). This user specified search path is used before trying\nthe default search path.\n.TP\n.B \"MAGICK_DEBUG\"\n\\fRDebug options (see \\fB-debug\\fP for details).  Setting the\nconfigure debug option via an environment variable\n(e.g. \\fBMAGICK_DEBUG=configure\\fP) is necessary to see the complete\ninitialization process, which includes searching for configuration\nfiles.\n.TP\n.B \"MAGICK_FILTER_MODULE_PATH\"\n\\fRSearch path to use when searching for filter process modules\n(invoked via \\fB-process\\fP). This path allows the user to arbitrarily\nextend GraphicsMagick's image processing functionality by adding loadable\nmodules to an arbitrary location rather than copying them into the\nGraphicsMagick installation directory. The formatting of the search path\nis similar to operating system search paths (i.e. colon delimited for\nUnix, and semi-colon delimited for Microsoft Windows). This user\nspecified search path is used before trying the default search path.\n.TP\n.B \"MAGICK_GHOSTSCRIPT_PATH\"\n\\fRFor Microsoft Windows, specify the path to the Ghostscript\ninstallation rather than searching for it via the Windows registry.\nThis helps in case Ghostscript is not installed via the Ghostscript\nWindows installer or the user wants more control over the Ghostscript\nused.\n.TP\n.B \"MAGICK_HOME\"\n\\fRPath to top of GraphicsMagick installation directory. Only observed\nby \"uninstalled\" builds of GraphicsMagick which do not have their location\nhard-coded or set by an installer.\n.TP\n.B \"MAGICK_MMAP_READ\"\n\\fRIf \\fBMAGICK_MMAP_READ\\fP is set to \\fBTRUE\\fP, GraphicsMagick\nwill attempt to memory-map the input file for reading. This usually\nsubstantially improves repeated read performance since the file is\nalready in memory after the first time it has been read. However,\ntesting shows that performance may be reduced for files accessed for\nthe first time since data is accessed via page-faults (upon first\naccess) and many operating systems fail to do sequential read-ahead of\nmemory mapped files, and particularly if those files are accessed over\na network.  If many large input files are read, then enabling this\noption may harm performance by overloading the operating system's VM\nsystem as it then needs to free unmapped pages and map new ones.\n.TP\n.B \"MAGICK_IO_FSYNC\"\n\\fRIf \\fBMAGICK_IO_FSYNC\\fP is set to \\fBTRUE\\fP, then GraphicsMagick\nwill request that the output file is fully flushed and synchronized to\ndisk when it is closed. This incurs a performance penalty, but has the\nbenefit that if the power fails or the system crashes, the file should be\nvalid on disk. If image files are referenced from a database, then this\noption helps assure that the files referenced by the database are\nvalid.\n.TP\n.B \"MAGICK_IOBUF_SIZE\"\n\\fRThe amount of I/O buffering (in bytes) to use when reading and\nwriting encoded files. The default is 16384, which is observed to work\nwell for many cases. The best value for a local filesystem is usually the\nthe native filesystem block size (e.g. 4096, 8192, or even 131,072 for\nZFS) in order to minimize the number of physical disk I/O operations.\nI/O performance to files accessed over a network may benefit\nsignificantly by tuning this option. Larger values are not necessarily\nbetter (they may be slower!), and there is rarely any benefit from using\nvalues larger than 32768. Use convert's \\fB-verbose\\fP option in order\nto evaluate read and write rates in pixels per second while keeping in\nmind that the operating system will try to cache files in RAM.\n.TP\n.B \"MAGICK_LIMIT_DISK\"\n\\fRMaximum amount of disk space allowed for use by the pixel cache.\n.TP\n.B \"MAGICK_LIMIT_FILES\"\n\\fRMaximum number of open files.\n.TP\n.B \"MAGICK_LIMIT_MAP\"\n\\fRMaximum size of a memory mapped file allocation.  A memory mapped\nfile consumes memory when the file is accessed, although the system\nmay reclaim such memory when needed.\n.TP\n.B \"MAGICK_LIMIT_MEMORY\"\n\\fRMaximum amount of memory to allocate from the heap.\n.TP\n.B \"MAGICK_LIMIT_PIXELS\"\n\\fRMaximum number of total pixels (image rows times image colums) to\nallow for any image which is requested to be created or read.  This is\nuseful to place a limit on how large an image may be.  If the input\nimage file has image dimensions larger than the pixel limit, then the\nimage memory allocation is denied and an error is returned\nimmediately.  This is a per-image limit and does not limit the total\nnumber of pixels due to multiple image frames/pages (e.g. multi-page\ndocument or an animation).\n.TP\n.B \"MAGICK_LIMIT_WIDTH\"\n\\fRMaximum pixel width of an image read, or created.\n.TP\n.B \"MAGICK_LIMIT_HEIGHT\"\n\\fRMaximum pixel height of an image read, or created.\n.TP\n.B \"MAGICK_TMPDIR\"\n\\fRPath to directory where GraphicsMagick should write temporary\nfiles. The default is to use the system default, or the location set by\n\\fBTMPDIR\\fP.\n.TP\n.B \"TMPDIR\"\n\\fRFor POSIX-compatible systems (Unix-compatible), the path to the\ndirectory where all applications should write temporary files.\nOverridden by \\fBMAGICK_TMPDIR\\fP if it is set.\n.TP\n.B \"TMP \\fIor TEMP\"\\fP\n\\fRFor Microsoft Windows, the path to the directory where applications\nshould write temporary files. Overridden by \\fBMAGICK_TMPDIR\\fP if it\nis set.\n.TP\n.B \"OMP_NUM_THREADS\"\n\\fRAs per the OpenMP standard, this specifies the number of threads to\nuse in parallel regions. Some compilers default the number of threads to\nuse to the number of processor cores available while others default to\njust one thread. See the OpenMP specification for other standard\nadjustments and your compiler's manual for vendor-specific settings.\n.SH CONFIGURATION FILES\nGraphicsMagick uses a number of XML format configuration files:\n.TP\n.B \"colors.mgk\"\n\\fRcolors configuration file\n\n  <?xml version=\"1.0\"?>\n  <colormap>\n    <color name=\"AliceBlue\" red=\"240\" green=\"248\" blue=\"255\"\n           compliance=\"SVG, X11, XPM\" />\n  </colormap>\n\n.TP\n.B \"delegates.mgk\"\n\\fRdelegates configuration file\n.TP\n.B \"log.mgk\"\n\\fRlogging configuration file\n\n  <?xml version=\"1.0\"?>\n  <magicklog>\n    <log events=\"None\" />\n    <log output=\"stdout\" />\n    <log filename=\"Magick-%d.log\" />\n    <log generations=\"3\" />\n    <log limit=\"2000\" />\n    <log format=\"%t %r %u %p %m/%f/%l/%d:\\\\n  %e\"  />\n  </magicklog>\n\n.TP\n.B \"modules.mgk\"\n\\fRloadable modules configuration file\n\n  <?xml version=\"1.0\"?>\n  <modulemap>\n    <module magick=\"8BIM\" name=\"META\" />\n  </modulemap>\n\n.TP\n.B \"type.mgk\"\n\\fRmaster type (fonts) configuration file\n\n  <?xml version=\"1.0\"?>\n  <typemap>\n    <\\fB\\fPinclude file=\"type-windows.mgk\" />\n    <type\n      name=\"AvantGarde-Book\"\n      fullname=\"AvantGarde Book\"\n      family=\"AvantGarde\"\n      foundry=\"URW\"\n      weight=\"400\"\n      style=\"normal\"\n      stretch=\"normal\"\n      format=\"type1\"\n      metrics=\"/usr/local/share/ghostscript/fonts/a010013l.afm\"\n      glyphs=\"/usr/local/share/ghostscript/fonts/a010013l.pfb\"\n    />\n  </typemap>\n\n.SH GM ANIMATE\n\n\\fBAnimate\\fP displays a sequence of images on any workstation display\nrunning an X server. \\fBanimate\\fP first determines the hardware capabilities\nof the workstation. If the number of unique colors in an image is less\nthan or equal to the number the workstation can support, the image is displayed\nin an X window. Otherwise the number of colors in the image is first reduced\nto match the color resolution of the workstation before it is displayed.\n\nThis means that a continuous-tone 24 bits-per-pixel image can display on\na 8 bit pseudo-color device or monochrome device. In most instances the\nreduced color image closely resembles the original. Alternatively, a monochrome\nor pseudo-color image sequence can display on a continuous-tone 24 bits-per-pixel\ndevice.\n\nTo help prevent color flashing on X server visuals that have colormaps,\n\\fBanimate\\fP\ncreates a single colormap from the image sequence. This can be rather time\nconsuming. You can speed this operation up by reducing the colors in the\nimage before you \"animate\" them. Use \\fBmogrify\\fP to color reduce the\nimages to a single colormap. See \\fBmogrify(1)\\fP for details. Alternatively,\nyou can use a Standard Colormap; or a static, direct, or true color visual.\nYou can define a Standard Colormap with \\fIxstdcmap\\fP. See \\fBxstdcmap(1)\\fP\nfor details. This method is recommended for colormapped X server because\nit eliminates the need to compute a global colormap.\n.SH EXAMPLES\n\nTo animate a set of images of a cockatoo, use:\n\n    gm animate cockatoo.*\n\n\nTo animate a cockatoo image sequence while using the Standard Colormap\n\\fIbest\\fP, use:\n\n    xstdcmap -best\n    gm animate -map best cockatoo.*\n\n\nTo animate an image of a cockatoo without a border centered on a backdrop,\nuse:\n\n\n    gm animate +borderwidth -backdrop cockatoo.*\n\n.SH OPTIONS\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-authenticate \\fI<string>\"\\fP\n\\fRdecrypt image with this password\n.TP\n.B \"-backdrop\"\n\\fRdisplay the image centered on a backdrop.\n.TP\n.B \"-background \\fI<color>\"\\fP\n\\fRthe background color\n.TP\n.B \"-bordercolor \\fI<color>\"\\fP\n\\fRthe border color\n.TP\n.B \"-borderwidth \\fI<geometry>\"\\fP\n\\fRthe border width\n.TP\n.B \"-chop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRremove pixels from the interior of an image\n.TP\n.B \"-colormap \\fI<type>\"\\fP\n\\fRdefine the colormap type\n.TP\n.B \"-colors \\fI<value>\"\\fP\n\\fRpreferred number of colors in the image\n.TP\n.B \"-colorspace \\fI<value>\"\\fP\n\\fRthe type of colorspace\n.TP\n.B \"-crop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRpreferred size and location of the cropped image\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-delay \\fI<1/100ths of a second>\"\\fP\n\\fRdisplay the next image after pausing\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n.TP\n.B \"-display \\fI<host:display[.screen]>\"\\fP\n\\fRspecifies the X server to contact\n.TP\n.B \"-dispose \\fI<method>\"\\fP\n\\fRGIF disposal method\n.TP\n.B \"-dither\"\n\\fRapply Floyd/Steinberg error diffusion to the image\n.TP\n.B \"-font \\fI<name>\"\\fP\n\\fRuse this font when annotating the image with text\n.TP\n.B \"-foreground \\fI<color>\"\\fP\n\\fRdefine the foreground color\n.TP\n.B \"-gamma \\fI<value>\"\\fP\n\\fRlevel of gamma correction\n.TP\n.B \"-geometry \\fI<width>x<height>{+-}<x>{+-}<y>{%}{@}{!}{^}{<}{>}\"\\fP\n\\fRSpecify dimension, offset, and resize options.\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-iconGeometry \\fI<geometry>\"\\fP\n\\fRspecify the icon geometry\n.TP\n.B \"-iconic\"\n\\fRiconic animation\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-map \\fI<type>\"\\fP\n\\fRdisplay image using this type.\n.TP\n.B \"-matte\"\n\\fRstore matte channel if the image has one\n.TP\n.B \"-mattecolor \\fI<color>\"\\fP\n\\fRspecify the color to be used with the \\fB-frame\\fP option\n.TP\n.B \"-monitor\"\n\\fRshow progress indication\n.TP\n.B \"-monochrome\"\n\\fRtransform the image to black and white\n.TP\n.B \"-name\"\n\\fRname an image\n.TP\n.B \"-noop\"\n\\fRNOOP (no option)\n.TP\n.B \"-pause \\fI<seconds>\"\\fP\n\\fRpause between animation loops [animate]\n.TP\n.B \"-remote\"\n\\fRperform a X11 remote operation\n.TP\n.B \"-rotate \\fI<degrees>{<}{>}\"\\fP\n\\fRrotate the image\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n.TP\n.B \"-scenes \\fI<value-value>\"\\fP\n\\fRrange of image scene numbers to read\n.TP\n.B \"-shared-memory\"\n\\fRuse shared memory\n.TP\n.B \"-size \\fI<width>x<height>{+offset}\"\\fP\n\\fRwidth and height of the image\n.TP\n.B \"-text-font \\fI<name>\"\\fP\n\\fRfont for writing fixed-width text\n.TP\n.B \"-title \\fI<string>\"\\fP\n\\fRassign title to displayed image [\\fIanimate, display, montage\\fP]\n.TP\n.B \"-treedepth \\fI<value>\"\\fP\n\\fRtree depth for the color reduction algorithm\n.TP\n.B \"-trim\"\n\\fRtrim an image\n.TP\n.B \"-type \\fI<type>\"\\fP\n\\fRthe image type\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n.TP\n.B \"-visual \\fI<type>\"\\fP\n\\fRanimate images using this X visual type\n.TP\n.B \"-window \\fI<id>\"\\fP\n\\fRmake image the background of a window\n\nFor a more detailed description of each option, see\nOptions, above.\n\n\nAny option you specify on the command line remains in effect for the group\nof images following it, until the group is terminated by the appearance of\nany option or \\fB-noop\\fP.  For example, to animate three images, the first\nwith 32 colors, the second with an unlimited number of colors, and the\nthird with only 16 colors, use:\n\n\n    gm animate -colors 32 cockatoo.1 -noop cockatoo.2\n             -colors 16 cockatoo.3\n\n\n\\fBAnimate\\fP options can appear on the command line or in your X resources\nfile. See \\fIX(1)\\fP. Options on the command line supersede values specified\nin your X resources file.\nImage filenames may appear in any order on the command line if the image\nformat is \\fIMIFF\\fP (refer to \\fBmiff(5)\\fP and the\n\\fBscene\\fP keyword\nis specified in the image. Otherwise the images will display in the order\nthey appear on the command line.\n.SH MOUSE BUTTONS\n\nPress any button to map or unmap the Command widget. See the next section\nfor more information about the Command widget.\n.SH COMMAND WIDGET\n\nThe Command widget lists a number of sub-menus and commands. They are\n\n    \\fBAnimate\\fP\n\n        Open\n        Play\n        Step\n        Repeat\n        Auto Reverse\n\n    \\fBSpeed\\fP\n\n        Faster\n        Slower\n\n    \\fBDirection\\fP\n\n        Forward\n        Reverse\n\n    \\fBImage Info\\fP\n    \\fBHelp\\fP\n    \\fBQuit\\fP\n\n\nMenu items with a indented triangle have a sub-menu. They are represented\nabove as the indented items. To access a sub-menu item, move the pointer\nto the appropriate menu and press a button and drag. When you find the\ndesired sub-menu item, release the button and the command is executed.\nMove the pointer away from the sub-menu if you decide not to execute a\nparticular command.\n.SH KEYBOARD ACCELERATORS\n.in 15\n\n.in 15\n.B \"\\fBCtl+O\\fP\"\n.in 20\n \\fR\n.in 20\nPress to load an image from a file.\n.in 15\n.in 15\n.B \"\\fBspace\\fP\"\n.in 20\n \\fR\n.in 20\nPress to display the next image in the sequence.\n.in 15\n.in 15\n.B \"\\fB<\\fP\"\n.in 20\n \\fR\n.in 20\nPress to speed-up the display of the images.  Refer to\n\\fB-delay\\fP for more information.\n.in 15\n.in 15\n.B \"\\fB>\\fP\"\n.in 20\n \\fR\n.in 20\nPress to slow the display of the images.  Refer to\n\\fB-delay\\fP for more information.\n.in 15\n.in 15\n.B \"\\fB?\\fP\"\n.in 20\n \\fR\n.in 20\nPress to display information about the image.  Press\nany key or button to erase the information.\n.in 15\n.in 20\nThis information is printed: image name;  image size;\nand the total number of unique colors in the image.\n.in 15\n.in 15\n.B \"\\fBF1\\fP\"\n.in 20\n \\fR\n.in 20\nPress to display helpful information about \\fBanimate(1)\\fP.\n.in 15\n.in 15\n.B \"\\fBCtl-q\\fP\"\n.in 20\n \\fR\n.in 20\nPress to discard all images and exit program.\n.in 15\n\n.SH X RESOURCES\n\n\\fBAnimate\\fP options can appear on the command line or in your X resource\nfile. Options on the command line supersede values specified in your X\nresource file. See \\fBX(1)\\fP for more information on X resources.\n\nAll \\fBanimate\\fP options have a corresponding X resource. In addition,\nthe \\fBanimate\\fP program uses the following X resources:\n.in 15\n\n.in 15\n.B \"\\fBbackground\\fP \\fB(\\fP\\fIclass\\fP \\fBBackground)\\fP\"\n.in 20\n \\fR\n.in 20\n\nSpecifies the preferred color to use for the Image window background. The\ndefault is #ccc.\n.in 15\n.in 15\n.B \"\\fBborderColor\\fP \\fB(\\fP\\fIclass\\fP \\fBBorderColor)\\fP\"\n.in 20\n \\fR\n.in 20\n\nSpecifies the preferred color to use for the Image window border. The default\nis #ccc.\n.in 15\n.in 15\n.B \"\\fBborderWidth\\fP \\fB(\\fP\\fIclass\\fP \\fBBorderWidth)\\fP\"\n.in 20\n \\fR\n.in 20\n\nSpecifies the width in pixels of the Image window border. The default is\n2.\n.in 15\n.in 15\n.B \"\\fBfont\\fP \\fB(\\fP\\fIclass\\fP \\fBFont\\fP \\fBor\\fP \\fBFontList)\\fP\"\n.in 20\n \\fR\n.in 20\n\nSpecifies the name of the preferred font to use in normal formatted text.\nThe default is 14 point \\fIHelvetica\\fP.\n.in 15\n.in 15\n.B \"\\fBforeground\\fP \\fB(\\fP\\fIclass\\fP \\fBForeground)\\fP\"\n.in 20\n \\fR\n.in 20\n\nSpecifies the preferred color to use for text within the Image window.\nThe default is black.\n.in 15\n.in 15\n.B \"\\fBgeometry\\fP \\fB(\\fP\\fIclass\\fP \\fBgeometry)\\fP\"\n.in 20\n \\fR\n.in 20\n\nSpecifies the preferred size and position of the image window. It is not\nnecessarily obeyed by all window managers.\nOffsets, if present, are handled in \\fIX(1)\\fP style.  A negative x offset is\nmeasured from the right edge of the screen to the right edge of the icon,\nand a negative y offset is measured from the bottom edge of the screen\nto the bottom edge of the icon.\n.in 15\n.in 15\n.B \"\\fBiconGeometry\\fP \\fB(\\fP\\fIclass\\fP \\fBIconGeometry)\\fP\"\n.in 20\n \\fR\n.in 20\n\nSpecifies the preferred size and position of the application when iconified.\nIt is not necessarily obeyed by all window managers.\nOffsets, if present, are handled in the same manner as in class Geometry.\n.in 15\n.in 15\n.B \"\\fBiconic\\fP \\fB(\\fP\\fIclass\\fP \\fBIconic)\\fP\"\n.in 20\n \\fR\n.in 20\n\nThis resource indicates that you would prefer that the application's windows\ninitially not be visible as if the windows had be immediately iconified\nby you. Window managers may choose not to honor the application's request.\n.in 15\n.in 15\n.B \"\\fBmatteColor\\fP \\fB(\\fP\\fIclass\\fP \\fBMatteColor)\\fP\"\n.in 20\n \\fR\n.in 20\n\nSpecify the color of windows. It is used for the backgrounds of windows,\nmenus, and notices. A 3D effect is achieved by using highlight and shadow\ncolors derived from this color. Default value: #ddd.\n.in 15\n.in 15\n.B \"\\fBname\\fP \\fB(\\fP\\fIclass\\fP \\fBName)\\fP\"\n.in 20\n \\fR\n.in 20\n\nThis resource specifies the name under which resources for the application\nshould be found. This resource is useful in shell aliases to distinguish\nbetween invocations of an application, without resorting to creating links\nto alter the executable file name. The default is the application name.\n.in 15\n.in 15\n.B \"\\fBsharedMemory\\fP \\fB(\\fP\\fIclass\\fP \\fBSharedMemory)\\fP\"\n.in 20\n \\fR\n.in 20\n\nThis resource specifies whether animate should attempt use shared memory\nfor pixmaps. ImageMagick must be compiled with shared memory support, and\nthe display must support the MIT-SHM extension. Otherwise, this resource\nis ignored. The default is True.\n.in 15\n.in 15\n.B \"\\fBtext_font\\fP \\fB(\\fP\\fIclass\\fP \\fBtextFont)\\fP\"\n.in 20\n \\fR\n.in 20\n\nSpecifies the name of the preferred font to use in fixed (typewriter style)\nformatted text. The default is 14 point \\fICourier\\fP.\n.in 15\n.in 15\n.B \"\\fBtitle\\fP \\fB(\\fP\\fIclass\\fP \\fBTitle)\\fP\"\n.in 20\n \\fR\n.in 20\n\nThis resource specifies the title to be used for the Image window. This\ninformation is sometimes used by a window manager to provide some sort\nof header identifying the window. The default is the image file name.\n.in 15\n\n.SH GM BATCH\n.SH DESCRIPTION\n\n\\fBbatch\\fP executes an arbitary number of the utility commands\n(e.g. \\fBconvert\\fP) in the form of a simple linear batch script in\norder to improve execution efficiency, and/or to allow use as a\nsubordinate co-process under the control of an arbitrary script or\nprogram.\n.SH EXAMPLES\n To drive \\fB'gm batch'\\fP using a shell script (or a program\nwritten in any language), have the script/program send commands to 'gm\nbatch' via its standard input.  Specify that standard input should be\nused by using \\fB'-'\\fP as the file name.  The following example\nconverts all files matching '*.jpg' to TIFF format while rotating each\nfile by 90 degrees and stripping all embedded profiles.  The shell\nscript syntax is standard Unix shell:\n\n  for file in *.jpg\n  do\n    outfile=`basename $file .jpg`.tiff\n    echo convert -verbose \"'$file'\" -rotate 90 \\\\\n    +profile \"'*'\" \"'$outfile'\"\n  done | gm batch -echo on -feedback on -\n\n\nWe can accomplish the same as the previous example by putting all the\ncommands in a text file and then specifying the name of the text file\nas the script to execute:\n\n  for file in *.jpg\n  do\n    outfile=`basename $file .jpg`.tiff\n    echo convert -verbose \"'$file'\" -rotate 90 \\\\\n    +profile \"'*'\" \"'$outfile'\"\n  done > script.txt\n  gm batch -echo on -feedback on script.txt\n\n.SH OPTIONS\n\nOptions are processed from left to right and must appear before any filename argument.\n.TP\n.B \"-echo \\fIon|off\"\\fP\n\\fRcommand echo on or off\n\nSpecify \\fBon\\fP to enable echoing commands to standard output as\nthey are read or \\fBoff\\fP to disable.  The default is\n\\fBoff\\fP.\n.TP\n.B \"-escape \\fIunix|windows\"\\fP\n\\fRParse using unix or windows syntax\n\nCommands must be parsed from the input stream and escaping needs to be\nused to protect spaces or quoting characters in the input. Specify\n\\fBunix\\fP to use unix-style command line parsing or \\fBwindows\\fP\nfor Microsoft Windows command shell style parsing. The default depends\non if the software is compiled for Microsoft Windows or for a\nUnix-type system (including Cygwin on Microsoft Windows).  It is\nrecommended to use unix syntax because it is more powerful and more\nportable.\n.TP\n.B \"-fail \\fItext\"\\fP\n\\fRtext to print if a command fails\n\nWhen feedback is enabled, this specifies the text to print when the\ncommand fails.  The default text is \\fBFAIL\\fP.\n.TP\n.B \"-feedback \\fIon|off\"\\fP\n\\fRenable error feedback\n\nPrint text (see -pass and -fail options) feedback after each\ncommand to indicate the result, the default is \\fBoff\\fP.\n.TP\n.B \"-help\"\n\nPrints batch command help.\n.TP\n.B \"-pass \\fItext\"\\fP\n\\fRtext to print if a command passes\n\nWhen feedback is enabled, this specifies the text to print when the\ncommand passes.  The default text is \\fBPASS\\fP.\n.TP\n.B \"-prompt \\fItext\"\\fP\n\\fRPrompt text to use for command line\n\nIf no filename argument was specified, a simple command prompt appears\nwhere you may enter GraphicsMagick commands.  The default prompt is\n\\fBGM>\\fP.  Use this option to change the prompt to something else.\n.TP\n.B \"-stop-on-error \\fIon|off\"\\fP\n\\fRSpecify if command processing stops on error\n\nNormally command processing continues if a command encounters an\nerror.  Specify \\fB-stop-on-error on\\fP to cause processing to quit\nimmediately on error.\n.SH GM BENCHMARK\n.SH DESCRIPTION\n\n\\fBbenchmark\\fP executes an arbitrary \\fBgm\\fP utility command\n(e.g. \\fBconvert\\fP) for one or more loops, and/or a specified\nexecution time, and reports many execution metrics.  For builds using\nOpenMP, a mode is provided to execute the benchmark with an increasing\nnumber of threads and provide a report of speedup and multi-thread\nexecution efficiency.  If \\fBbenchmark\\fP is used to execute a\ncommand without any additional benchmark options, then the command is\nrun once.\n.SH EXAMPLES\nTo obtain benchmark information for a single execution of a\ncommand:\n\n    gm benchmark convert input.ppm -gaussian 0x1 output.ppm\n\nTo obtain benchmark information from 100 iterations of the\ncommand:\n\n    gm benchmark -iterations 100 convert input.ppm \\\\\n      -gaussian 0x1 output.ppm\n\nTo obtain benchmark information by iterating the command until a\nspecified amount of time (in seconds) has been consumed:\n\n    gm benchmark -duration 30 convert input.ppm \\\\\n      -gaussian 0x1 output.ppm\n\nTo obtain a full performance report with an increasing number of\nthreads (1-32 threads, stepping the number of threads by four each\ntime):\n\n    gm benchmark -duration 3 -stepthreads 4 convert \\\\\n      input.ppm -gaussian 0x2 output.ppm\n\nHere is the interpretation of the output:\n\n    \\fBthreads\\fP - number of threads used.\n    \\fBiter\\fP - number of command iterations executed.\n    \\fBuser\\fP - total user time consumed.\n    \\fBtotal\\fP - total elapsed time consumed.\n    \\fBiter/s\\fP - number of command iterations per second.\n    \\fBiter/cpu\\fP - amount of CPU time consumed per iteration.\n    \\fBspeedup\\fP - speedup compared with one thread.\n    \\fBkarp-flatt\\fP - Karp-Flatt measure of speedup efficiency.\n\n\\fIPlease note that the reported \"speedup\" is based on the\nexecution time of just one thread.  A preliminary warm-up pass is used\nbefore timing the first loop in order to ensure that the CPU is\nbrought out of power-saving modes and that system caches are warmed\nup.  Most modern CPUs provide a \"turbo\" mode where the CPU clock speed\nis increased (e.g. by a factor of two) when only one or two cores are\nactive.  If the CPU grows excessively hot (due to insufficient\ncooling), then it may dial back its clock rates as a form of thermal\nmanagement.  These factors result in an under-reporting of speedup\ncompared to if \"turbo\" mode was disabled and the CPU does not need to\nworry about thermal management.  The \\fBpowertop\\fP utility available\nunder Linux and Solaris provides a way to observe CPU core clock rates\nwhile a benchmark is running.\\fP\n.SH OPTIONS\n Options are processed from left to right and must appear before\nany argument.\n.TP\n.B \"-duration \\fIduration\"\\fP\n\\fRduration to run benchmark\nSpecify the number of seconds to run the benchmark. The command is\nexecuted repeatedly until the specified amount of time has\nelapsed.\n.TP\n.B \"-help\"\n\nPrints benchmark command help.\n.TP\n.B \"-iterations \\fIloops\"\\fP\n\\fRnumber of command iterations\nSpecify the number of iterations to run the benchmark. The command\nis executed repeatedly until the specified number of iterations has\nbeen reached.\n.TP\n.B \"-rawcsv\"\n\\fRPrint results in CSV format\nPrint results in a comma-separated value (CSV) format which is easy\nto parse for plotting or importing into a spreadsheet or database.\nThe values reported are \\fBthreads\\fP, \\fBiterations\\fP,\n\\fBuser_time\\fP, and \\fBelapsed_time\\fP.\n.TP\n.B \"-stepthreads \\fIstep\"\\fP\n\\fRexecute a per-thread benchmark ramp\n Execute a per-thread benchmark ramp, incrementing the number of\nthreads at each step by the specified value.  The maximum number of\nthreads is taken from the standard OMP_NUM_THREADS\nenvironment variable.\n.SH GM COMPARE\n\n\\fBcompare\\fP compares two similar images using a specified statistical\nmethod (see \\fB-metric\\fP) and/or by writing a difference image\n(\\fB-file\\fP), with the altered pixels annotated using a specified\nmethod (see \\fB-highlight-style\\fP) and color (see\n\\fB-highlight-color\\fP). \\fIReference-image\\fP is the original\nimage and \\fIcompare-image\\fP is the (possibly) altered version, which\nshould have the same dimensions as \\fIreference-image\\fP.\n.SH EXAMPLES\n\nTo compare two images using Mean Square Error (MSE) statistical analysis\nuse:\n\n    gm compare -metric mse original.miff compare.miff\n\n\nTo create an annotated difference image use:\n\n    gm compare -highlight-style assign -highlight-color purple \\\\\n      -file diff.miff original.miff compare.miff\n\n.SH OPTIONS\n\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect only for the image that follows.  All\noptions are reset to their default values after each image is read.\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-authenticate \\fI<string>\"\\fP\n\\fRdecrypt image with this password\n.TP\n.B \"-colorspace \\fI<value>\"\\fP\n\\fRthe type of colorspace\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n.TP\n.B \"-display \\fI<host:display[.screen]>\"\\fP\n\\fRspecifies the X server to contact\n.TP\n.B \"-endian \\fI<type>\"\\fP\n\\fRspecify endianness (MSB, LSB, or Native) of image\n.TP\n.B \"-file \\fI<filename>\"\\fP\n\\fRwrite annotated difference image to file\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-highlight-color \\fI<color>\"\\fP\n\\fRpixel annotation color\n.TP\n.B \"-highlight-style \\fI<style>\"\\fP\n\\fRpixel annotation style\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-matte\"\n\\fRstore matte channel if the image has one\n.TP\n.B \"-maximum-error \\fI<limit>\"\\fP\n\\fRspecifies the maximum amount of total image error\n.TP\n.B \"-metric \\fI<metric>\"\\fP\n\\fRcomparison metric (MAE, MSE, PAE, PSNR, RMSE)\n.TP\n.B \"-monitor\"\n\\fRshow progress indication\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n.TP\n.B \"-size \\fI<width>x<height>{+offset}\"\\fP\n\\fRwidth and height of the image\n.TP\n.B \"-type \\fI<type>\"\\fP\n\\fRthe image type\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.SH GM COMPOSITE\n\n\\fBcomposite\\fP composites (combines) images to create new images.\n\\fIbase-image\\fP is the base image and \\fIchange-image\\fP contains the changes.\n\\fIouput-image\\fP is the result, and normally has the same dimensions\nas \\fIbase-image\\fP.\n\n\nThe optional \\fImask-image\\fP can be used to provide opacity information\nfor \\fIchange-image\\fP when it has none or if you want a different mask.\nA mask image is typically grayscale and the same size as\n\\fBbase-image\\fP. If \\fImask-image\\fP is not grayscale, it is converted\nto grayscale and the resulting intensities are used as opacity\ninformation.\n.SH EXAMPLES\n\nTo composite an image of a cockatoo with a perch, use:\n\n    gm composite cockatoo.miff perch.ras composite.miff\n\n\nTo compute the difference between images in a series, use:\n\n    gm composite -compose difference series.2 series.1\n              difference.miff\n\n\nTo composite an image of a cockatoo with a perch starting at location (100,150),\nuse:\n\n    gm composite -geometry +100+150 cockatoo.miff\n              perch.ras composite.miff\n\n\nTo tile a logo across your image of a cockatoo, use\n\n    gm convert +shade 30x60 cockatoo.miff mask.miff\n    gm composite -compose bumpmap -tile logo.png\n              cockatoo.miff mask.miff composite.miff\n\n\nTo composite a red, green, and blue color plane into a single composite image,\ntry\n\n    gm composite -compose CopyGreen green.png red.png\n              red-green.png\n    gm composite -compose CopyBlue blue.png red-green.png \n              gm composite.png\n\n.SH OPTIONS\n\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect only for the image that follows.  All\noptions are reset to their default values after each image is read.\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-authenticate \\fI<string>\"\\fP\n\\fRdecrypt image with this password\n.TP\n.B \"-background \\fI<color>\"\\fP\n\\fRthe background color\n.TP\n.B \"-blue-primary \\fI<x>,<y>\"\\fP\n\\fRblue chromaticity primary point\n.TP\n.B \"-colors \\fI<value>\"\\fP\n\\fRpreferred number of colors in the image\n.TP\n.B \"-colorspace \\fI<value>\"\\fP\n\\fRthe type of colorspace\n.TP\n.B \"-comment \\fI<string>\"\\fP\n\\fRannotate an image with a comment\n.TP\n.B \"-compose \\fI<operator>\"\\fP\n\\fRthe type of image composition\n.TP\n.B \"-compress \\fI<type>\"\\fP\n\\fRthe type of image compression\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n.TP\n.B \"-displace \\fI<horizontal scale>x<vertical scale>\"\\fP\n\\fRshift image pixels as defined by a displacement map\n.TP\n.B \"-display \\fI<host:display[.screen]>\"\\fP\n\\fRspecifies the X server to contact\n.TP\n.B \"-dispose \\fI<method>\"\\fP\n\\fRGIF disposal method\n.TP\n.B \"-dissolve \\fI<percent>\"\\fP\n\\fRdissolve an image into another by the given percent\n.TP\n.B \"-dither\"\n\\fRapply Floyd/Steinberg error diffusion to the image\n.TP\n.B \"-encoding \\fI<type>\"\\fP\n\\fRspecify the text encoding\n.TP\n.B \"-endian \\fI<type>\"\\fP\n\\fRspecify endianness (MSB, LSB, or Native) of image\n.TP\n.B \"-filter \\fI<type>\"\\fP\n\\fRuse this type of filter when resizing an image\n.TP\n.B \"-font \\fI<name>\"\\fP\n\\fRuse this font when annotating the image with text\n.TP\n.B \"-geometry \\fI<width>x<height>{+-}<x>{+-}<y>{%}{@}{!}{^}{<}{>}\"\\fP\n\\fRSpecify dimension, offset, and resize options.\n.TP\n.B \"-gravity \\fI<type>\"\\fP\n\\fRdirection primitive  gravitates to when annotating the image.\n.TP\n.B \"-green-primary \\fI<x>,<y>\"\\fP\n\\fRgreen chromaticity primary point\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n.TP\n.B \"-label \\fI<name>\"\\fP\n\\fRassign a label to an image\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-matte\"\n\\fRstore matte channel if the image has one\n.TP\n.B \"-monitor\"\n\\fRshow progress indication\n.TP\n.B \"-monochrome\"\n\\fRtransform the image to black and white\n.TP\n.B \"-negate\"\n\\fRreplace every pixel with its complementary color\n.TP\n.B \"-page \\fI<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}\"\\fP\n\\fRsize and location of an image canvas\n.TP\n.B \"-profile \\fI<filename>\"\\fP\n\\fRadd ICM, IPTC, or generic profile  to image\n.TP\n.B \"-quality \\fI<value>\"\\fP\n\\fRJPEG/MIFF/PNG/TIFF compression level\n.TP\n.B \"-recolor \\fI<matrix>\"\\fP\n\\fRapply a color translation matrix to image channels\n.TP\n.B \"-red-primary \\fI<x>,<y>\"\\fP\n\\fRred chromaticity primary point\n.TP\n.B \"-render\"\n\\fRrender vector operations\n.TP\n.B \"-repage \\fI <width>x<height>+xoff+yoff[!]\"\\fP\n\\fRAdjust image page offsets\n.TP\n.B \"-resize \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image\n.TP\n.B \"-rotate \\fI<degrees>{<}{>}\"\\fP\n\\fRrotate the image\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n.TP\n.B \"-scene \\fI<value>\"\\fP\n\\fRset scene number\n.TP\n.B \"-set \\fI<attribute> <value>\"\\fP\n\\fRset an image attribute\n.TP\n.B \"+set \\fI<attribute>\"\\fP\n\\fRunset an image attribute\n.TP\n.B \"-sharpen \\fI<radius>{x<sigma>}\"\\fP\n\\fRsharpen the image\n.TP\n.B \"-size \\fI<width>x<height>{+offset}\"\\fP\n\\fRwidth and height of the image\n.TP\n.B \"-stegano \\fI<offset>\"\\fP\n\\fRhide watermark within an image\n.TP\n.B \"-stereo\"\n\\fRcomposite two images to create a stereo anaglyph\n.TP\n.B \"-strip\"\n\\fRremove all profiles and text attributes from the image\n.TP\n.B \"-thumbnail \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image (quickly)\n.TP\n.B \"-treedepth \\fI<value>\"\\fP\n\\fRtree depth for the color reduction algorithm\n.TP\n.B \"-trim\"\n\\fRtrim an image\n.TP\n.B \"-type \\fI<type>\"\\fP\n\\fRthe image type\n.TP\n.B \"-units \\fI<type>\"\\fP\n\\fRthe units of image resolution\n.TP\n.B \"-unsharp \\fI<radius>{x<sigma>}{+<amount>}{+<threshold>}\"\\fP\n\\fRsharpen the image with an unsharp mask operator\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n.TP\n.B \"-watermark \\fI<brightness>x<saturation>\"\\fP\n\\fRpercent brightness and saturation of a watermark\n.TP\n.B \"-white-point \\fI<x>,<y>\"\\fP\n\\fRchromaticity white point\n.TP\n.B \"-write \\fI<filename>\"\\fP\n\\fRwrite an intermediate image [\\fIconvert, composite\\fP]\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.SH GM CONJURE\n\nThe Magick scripting language (MSL) will primarily benefit those that\nwant to accomplish custom image processing tasks but do not wish to\nprogram, or those that do not have access to a Perl interpreter or a\ncompiler.  The interpreter is called conjure and here is an example\nscript:\n\n    <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    <image size=\"400x400\" >\n      <read filename=\"image.gif\" />\n      <get width=\"base-width\" height=\"base-height\" />\n      <resize geometry=\"%[dimensions]\" />\n      <get width=\"width\" height=\"height\" />\n      <print output=\n        \"Image sized from %[base-width]x%[base-height]\n         to %[width]x%[height].\\\\n\" />\n      <write filename=\"image.png\" />\n    </image>\n\n\ninvoked with\n\n    gm conjure -dimensions 400x400 incantation.msl\n\n\nAll operations will closely follow the key/value pairs defined in\nPerlMagick, unless otherwise noted.\n.SH OPTIONS\n\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect until it is explicitly changed by specifying\nthe option again with a different effect, or if it is changed by a statement\nin the scripting language.\n\nYou can define your own keyword/value pairs on the command line.\nThe script can then use this information when setting values by including\n%[keyword] in the string.  For example, if you included\n\"-dimensions 400x400\" on the command line, as illustrated above,\nthen any string\ncontaining \"%[dimensions]\" would have 400x400 substituted.\nThe \"%[string]\" can be used either an entire string, such as\ngeometry=\"%[dimensions]\" or as a part of a string such as\nfilename=\"%[basename].png\".\n\nThe keyword can be any string except for the following reserved\nstrings (in any upper, lower, or mixed case variant): \\fBdebug\\fP,\n\\fBhelp\\fP, and \\fBverbose\\fP, whose usage is described below.\n\nThe value can be any string.  If\neither the keyword or the value contains white space or any\nsymbols that have special meanings to your shell such as \"#\",\n\"|\",\nor\n\"%\", enclose the string in quotation marks or use \"\\\\\" to escape the white\nspace and special symbols.\n\nKeywords and values are case dependent.  \"Key\",\n\"key\",\nand \"KEY\" would\nbe three different keywords.\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n.SH MAGICK SCRIPTING LANGUAGE\n\nThe Magick Scripting Language (MSL) presently defines the following\nelements and their attributes:\n.in 15\n\n.in 15\n.B \"<image>\"\n.in 20\n \\fR\n.in 20\nbackground, color, id, size\n.in 15\n.in 20\n\nDefine a new image object.  \\fB</image>\\fP destroys it. Because of\nthis, if you wish to reference multiple \"subimages\" (aka pages or\nlayers), you can embed one \\fBimage\\fP element inside of another. For\nexample:\n\n.in 15\n.in 20\n\n\n    <image>\n    <read filename=\"input.png\" />\n    <get width=\"base-width\" height=\"base-height\" />\n    <image height=\"base-height\" width=\"base-width\">\n    <image />\n    <write filename=\"output.mng\" />\n    </image>\n\n\n.in 15\n.in 20\n\n\n    <image size=\"400x400\" />\n\n\n.in 15\n.in 15\n.B \"<group>\"\n.in 20\n \\fR\n.in 20\n\nDefine a new group of image objects.  By default, images are only\nvalid for the life of their \\fB<image>\\fPelement.\n\n.in 15\n.in 20\n\n\n    <image>   -- creates the image\n    .....     -- do stuff with it\n    </image>  -- dispose of the image\n\n\n.in 15\n.in 20\n\nHowever, in a group, all images in that group will stay around for the\nlife of the group:\n\n.in 15\n.in 20\n\n\n    <group>                           -- start a group\n        <image>                       -- create an image\n        ....                          -- do stuff\n        </image>                      -- NOOP\n        <image>                       -- create another image\n        ....                          -- do more stuff\n        </image>                      -- NOOP\n        <write filename=\"image.mng\" />  -- output\n    </group>                          -- dispose of both images\n\n\n.in 15\n.in 15\n.B \"<read>\"\n.in 20\n \\fR\n.in 20\n    filename\n.in 15\n.in 20\n\nRead a new image from a disk file.\n\n.in 15\n.in 20\n\n\n    <read filename=\"image.gif\" />\n\n\n.in 15\n.in 20\n\nTo read two images use\n\n.in 15\n.in 20\n\n\n    <read filename=\"image.gif\" />\n    <read filename=\"image.png />\n\n\n.in 15\n.in 15\n.B \"<write>\"\n.in 20\n \\fR\n.in 20\n    filename\n.in 15\n.in 20\nWrite the image(s) to disk, either as\na single multiple-image file or multiple ones if necessary.\n\n.in 15\n.in 20\n\n\n     <write filename=image.tiff\" />\n\n.in 15\n.B \"<get>\"\n.in 20\n \\fR\n.in 20\nGet any attribute recognized by\nPerlMagick's GetAttribute() and stores it as an image attribute for later\nuse. Currently only \\fIwidth\\fP and \\fIheight\\fP are supported.\n.in 15\n.in 20\n\n\n    <get width=\"base-width\" height=\"base-height\" />\n    <print output=\"Image size is %[base-width]x%[base-height].\\\\n\" />\n\n\n.in 15\n.in 15\n.B \"<set>\"\n.in 20\n \\fR\n.in 20\nbackground, bordercolor, clip-mask, colorspace, density,\nmagick, mattecolor, opacity.  Set an attribute recognized by\nPerlMagick's GetAttribute().\n.in 15\n.in 15\n.B \"<profile>\"\n.in 20\n \\fR\n.in 20\n    [profilename]\n.in 15\n.in 20\n\nRead one or more IPTC, ICC or generic profiles from file and assign to image\n\n.in 15\n.in 20\n\n\n    <profile iptc=\"profile.iptc\" generic=\"generic.dat\" />\n\n\n.in 15\n.in 20\n\nTo remove a specified profile use \"!\" as the filename eg\n\n.in 15\n.in 20\n\n\n    <profile icm=\"!\" iptc=\"profile.iptc\" />\n\n\n.in 15\n.in 15\n.B \"<border>\"\n.in 20\n \\fR\n.in 20\n    fill, geometry, height, width\n.in 15\n.in 15\n.B \"<blur>\"\n.in 20\n \\fR\n.in 20\n    radius, sigma\n.in 15\n.in 15\n.B \"<charcoal>\"\n.in 20\n \\fR\n.in 20\n    radius, sigma\n.in 15\n.in 15\n.B \"<chop>\"\n.in 20\n \\fR\n.in 20\n    geometry, height, width, x, y\n.in 15\n.in 15\n.B \"<crop>\"\n.in 20\n \\fR\n.in 20\n    geometry, height, width, x, y\n.in 15\n.in 15\n.B \"<composite>\"\n.in 20\n \\fR\n.in 20\n    compose, geometry, gravity, image, x, y\n.in 15\n.in 20\n\n\n    <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    <group>\n        <image id=\"image_01\">\n            <read filename=\"cloud3.gif\"/>\n            <resize geometry=\"250x90\"/>\n        </image>\n        <image id=\"image_02\">\n            <read filename=\"cloud4.gif\"/>\n            <resize geometry=\"190x100\"/>\n        </image>\n        <image>\n            <read filename=\"background.jpg\"/>\n            <composite image=\"image_01\" geometry=\"+740+470\"/>\n            <composite image=\"image_02\" geometry=\"+390+415\"/>\n        </image>\n        <write filename=\"result.png\"/>\n    </group>\n\n\n.in 15\n.in 15\n.B \"<despeckle>\"\n.in 20\n \\fR\n.in 15\n.B \"<emboss>\"\n.in 20\n \\fR\n.in 20\n    radius, sigma\n.in 15\n.in 15\n.B \"<enhance>\"\n.in 20\n \\fR\n.in 15\n.B \"<equalize>\"\n.in 20\n \\fR\n.in 15\n.B \"<edge>\"\n.in 20\n \\fR\n.in 20\n    radius\n.in 15\n.in 15\n.B \"<flip>\"\n.in 20\n \\fR\n.in 15\n.B \"<flop>\"\n.in 20\n \\fR\n.in 15\n.B \"<frame>\"\n.in 20\n \\fR\n.in 20\n    fill, geometry, height, width, x, y, inner, outer\n.in 15\n.in 15\n.B \"<flatten>\"\n.in 20\n \\fR\n.in 15\n.B \"<get>\"\n.in 20\n \\fR\n.in 20\n    height, width\n.in 15\n.in 15\n.B \"<gamma>\"\n.in 20\n \\fR\n.in 20\n    red, green, blue\n.in 15\n.in 15\n.B \"<image>\"\n.in 20\n \\fR\n.in 20\n    background, color, id, size\n.in 15\n.in 15\n.B \"<implode>\"\n.in 20\n \\fR\n.in 20\n    amount\n.in 15\n.in 15\n.B \"<magnify>\"\n.in 20\n \\fR\n.in 15\n.B \"<minify>\"\n.in 20\n \\fR\n.in 15\n.B \"<medianfilter>\"\n.in 20\n \\fR\n.in 20\n    radius\n.in 15\n.in 15\n.B \"<normalize>\"\n.in 20\n \\fR\n.in 15\n.B \"<oilpaint>\"\n.in 20\n \\fR\n.in 20\n    radius\n.in 15\n.in 15\n.B \"<print>\"\n.in 20\n \\fR\n.in 20\n    output\n.in 15\n.in 15\n.B \"<profile>\"\n.in 20\n \\fR\n.in 20\n    [profilename]\n.in 15\n.in 15\n.B \"<read>\"\n.in 20\n \\fR\n.in 15\n.B \"<resize>\"\n.in 20\n \\fR\n.in 20\n    blur, filter, geometry, height, width\n.in 15\n.in 15\n.B \"<roll>\"\n.in 20\n \\fR\n.in 20\n    geometry, x, y\n.in 15\n.in 15\n.B \"<rotate>\"\n.in 20\n \\fR\n.in 20\n    degrees\n.in 15\n.in 15\n.B \"<reducenoise>\"\n.in 20\n \\fR\n.in 20\n    radius\n.in 15\n.in 15\n.B \"<sample>\"\n.in 20\n \\fR\n.in 20\n    geometry, height, width\n.in 15\n.in 15\n.B \"<scale>\"\n.in 20\n \\fR\n.in 20\n    geometry, height, width\n.in 15\n.in 15\n.B \"<sharpen>\"\n.in 20\n \\fR\n.in 20\n    radius, sigma\n.in 15\n.in 15\n.B \"<shave>\"\n.in 20\n \\fR\n.in 20\n    geometry, height, width\n.in 15\n.in 15\n.B \"<shear>\"\n.in 20\n \\fR\n.in 20\n    x, y\n.in 15\n.in 15\n.B \"<solarize>\"\n.in 20\n \\fR\n.in 20\n    threshold\n.in 15\n.in 15\n.B \"<spread>\"\n.in 20\n \\fR\n.in 20\n    radius\n.in 15\n.in 15\n.B \"<stegano>\"\n.in 20\n \\fR\n.in 20\n    image\n.in 15\n.in 15\n.B \"<stereo>\"\n.in 20\n \\fR\n.in 20\n    image\n.in 15\n.in 15\n.B \"<swirl>\"\n.in 20\n \\fR\n.in 20\n    degrees\n.in 15\n.in 15\n.B \"<texture>\"\n.in 20\n \\fR\n.in 20\n    image\n.in 15\n.in 15\n.B \"<threshold>\"\n.in 20\n \\fR\n.in 20\n    threshold\n.in 15\n.in 15\n.B \"<transparent>\"\n.in 20\n \\fR\n.in 20\n    color\n.in 15\n.in 15\n.B \"<trim>\"\n.in 20\n \\fR\n\n.SH GM CONVERT\n\n\\fBConvert\\fP converts an input file using one image format to an output\nfile with a differing image format. In addition, various types of image\nprocessing can be performed on the converted image during the conversion\nprocess. \\fBConvert\\fP recognizes the image formats listed in\n\\fIGraphicsMagick(1)\\fP.\n\n.SH EXAMPLES\n\nTo make a thumbnail of a JPEG image, use:\n\n    gm convert -size 120x120 cockatoo.jpg -resize 120x120\n            +profile \"*\" thumbnail.jpg\n\n\nIn this example, '-size 120x120' gives a hint to the JPEG decoder\nthat the image is going to be downscaled to 120x120, allowing it to run\nfaster by avoiding returning full-resolution images to GraphicsMagick for\nthe subsequent resizing operation.  The\n\\'-resize 120x120' specifies the desired dimensions of the\noutput image.  It will be scaled so its largest dimension is 120 pixels.  The\n\\'+profile \"*\"' removes any ICM, EXIF, IPTC, or other profiles\nthat might be present in the input and aren't needed in the thumbnail.\n\nTo convert a \\fIMIFF\\fP image of a cockatoo to a SUN raster image, use:\n\n    gm convert cockatoo.miff sun:cockatoo.ras\n\n\nTo convert a multi-page \\fIPostScript\\fP document to individual FAX pages,\nuse:\n\n    gm convert -monochrome document.ps fax:page\n\n\nTo convert a TIFF image to a \\fIPostScript\\fP A4 page with the image in\nthe lower left-hand corner, use:\n\n    gm convert -page A4+0+0 image.tiff document.ps\n\n\nTo convert a raw Gray image with a 128 byte header to a portable graymap,\nuse:\n\n    gm convert -depth 8 -size 768x512+128 gray:raw\n            image.pgm\n\n\nIn this example, \"raw\" is the input file.  Its format is \"gray\" and it\nhas the dimensions and number of header bytes specified by the -size\noption and the sample depth specified by the\n-depth option.  The output file is \"image.pgm\".  The suffix \".pgm\"\nspecifies its format.\n\nTo convert a Photo CD image to a TIFF image, use:\n\n    gm convert -size 1536x1024 img0009.pcd image.tiff\n    gm convert img0009.pcd[4] image.tiff\n\n\nTo create a visual image directory of all your JPEG images, use:\n\n    gm convert 'vid:*.jpg' directory.miff\n\n\nTo annotate an image with blue text using font 12x24 at position (100,100),\nuse:\n\n    gm convert -font helvetica -fill blue\n            -draw \"text 100,100 Cockatoo\"\n            bird.jpg bird.miff\n\n\nTo tile a 640x480 image with a JPEG texture with bumps use:\n\n    gm convert -size 640x480 tile:bumps.jpg tiled.png\n\n\nTo surround an icon with an ornamental border to use with Mosaic(1), use:\n\n    gm convert -mattecolor \"#697B8F\" -frame 6x6 bird.jpg\n            icon.png\n\n\nTo create a MNG animation from a DNA molecule sequence, use:\n\n    gm convert -delay 20 dna.* dna.mng\n\n.SH OPTIONS\n\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images that follows,\nuntil the set is terminated by the appearance of any option or \\fB-noop\\fP.\nSome options only affect the decoding of images and others only the encoding.\nThe latter can appear after the final group of input images.\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-adjoin\"\n\\fRjoin images into a single multi-image file\n.TP\n.B \"-affine \\fI<matrix>\"\\fP\n\\fRdrawing transform matrix\n.TP\n.B \"-antialias\"\n\\fRremove pixel aliasing\n.TP\n.B \"-append\"\n\\fRappend a set of images\n.TP\n.B \" \\fI-asc-cdl <spec>\"\\fP\n\\fRapply ASC CDL color transform\n.TP\n.B \"-authenticate \\fI<string>\"\\fP\n\\fRdecrypt image with this password\n.TP\n.B \"-auto-orient\"\n\\fRorient (rotate) image so it is upright\n.TP\n.B \"-average\"\n\\fRaverage a set of images\n.TP\n.B \"-background \\fI<color>\"\\fP\n\\fRthe background color\n.TP\n.B \"-black-threshold \\fIred[,green][,blue][,opacity]\"\\fP\n\\fRpixels below the threshold become black\n.TP\n.B \"-blue-primary \\fI<x>,<y>\"\\fP\n\\fRblue chromaticity primary point\n.TP\n.B \"-blur \\fI<radius>{x<sigma>}\"\\fP\n\\fRblur the image with a Gaussian operator\n.TP\n.B \"-border \\fI<width>x<height>\"\\fP\n\\fRsurround the image with a border of color\n.TP\n.B \"-bordercolor \\fI<color>\"\\fP\n\\fRthe border color\n.TP\n.B \"-box \\fI<color>\"\\fP\n\\fRset the color of the annotation bounding box\n.TP\n.B \"-channel \\fI<type>\"\\fP\n\\fRthe type of channel\n.TP\n.B \"-charcoal \\fI<factor>\"\\fP\n\\fRsimulate a charcoal drawing\n.TP\n.B \"-chop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRremove pixels from the interior of an image\n.TP\n.B \"-clip\"\n\\fRapply the clipping path, if one is present\n.TP\n.B \"-coalesce\"\n\\fRmerge a sequence of images\n.TP\n.B \"-colorize \\fI<value>\"\\fP\n\\fRcolorize the image with the pen color\n.TP\n.B \"-colors \\fI<value>\"\\fP\n\\fRpreferred number of colors in the image\n.TP\n.B \"-colorspace \\fI<value>\"\\fP\n\\fRthe type of colorspace\n.TP\n.B \"-comment \\fI<string>\"\\fP\n\\fRannotate an image with a comment\n.TP\n.B \"-compose \\fI<operator>\"\\fP\n\\fRthe type of image composition\n.TP\n.B \"-compress \\fI<type>\"\\fP\n\\fRthe type of image compression\n.TP\n.B \"-contrast\"\n\\fRenhance or reduce the image contrast\n.TP\n.B \"-convolve \\fI<kernel>\"\\fP\n\\fRconvolve image with the specified convolution kernel\n.TP\n.B \"-crop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRpreferred size and location of the cropped image\n.TP\n.B \"-cycle \\fI<amount>\"\\fP\n\\fRdisplace image colormap by amount\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-deconstruct\"\n\\fRbreak down an image sequence into constituent parts\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-delay \\fI<1/100ths of a second>\"\\fP\n\\fRdisplay the next image after pausing\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n.TP\n.B \"-despeckle\"\n\\fRreduce the speckles within an image\n.TP\n.B \"-display \\fI<host:display[.screen]>\"\\fP\n\\fRspecifies the X server to contact\n.TP\n.B \"-dispose \\fI<method>\"\\fP\n\\fRGIF disposal method\n.TP\n.B \"-dither\"\n\\fRapply Floyd/Steinberg error diffusion to the image\n.TP\n.B \"-draw \\fI<string>\"\\fP\n\\fRannotate an image with one or more graphic primitives\n.TP\n.B \"-edge \\fI<radius>\"\\fP\n\\fRdetect edges within an image\n.TP\n.B \"-emboss \\fI<radius>\"\\fP\n\\fRemboss an image\n.TP\n.B \"-encoding \\fI<type>\"\\fP\n\\fRspecify the text encoding\n.TP\n.B \"-endian \\fI<type>\"\\fP\n\\fRspecify endianness (MSB, LSB, or Native) of image\n.TP\n.B \"-enhance\"\n\\fRapply a digital filter to enhance a noisy image\n.TP\n.B \"-equalize\"\n\\fRperform histogram equalization to the image\n.TP\n.B \"-extent \\fI<width>x<height>{+-}<x>{+-}<y>\"\\fP\n\\fRcomposite image on background color canvas image\n.TP\n.B \"-fill \\fI<color>\"\\fP\n\\fRcolor to use when filling a graphic primitive\n.TP\n.B \"-filter \\fI<type>\"\\fP\n\\fRuse this type of filter when resizing an image\n.TP\n.B \"-flatten\"\n\\fRflatten a sequence of images\n.TP\n.B \"-flip\"\n\\fRcreate a \"mirror image\"\n.TP\n.B \"-flop\"\n\\fRcreate a \"mirror image\"\n.TP\n.B \"-font \\fI<name>\"\\fP\n\\fRuse this font when annotating the image with text\n.TP\n.B \"-format \\fI<string>\"\\fP\n\\fRoutput formatted image characteristics\n.TP\n.B \"-frame \\fI<width>x<height>+<outer bevel width>+<inner bevel width>\"\\fP\n\\fRsurround the image with an ornamental border\n.TP\n.B \"-fuzz \\fI<distance>{%}\"\\fP\n\\fRcolors within this Euclidean distance are considered equal\n.TP\n.B \"-gamma \\fI<value>\"\\fP\n\\fRlevel of gamma correction\n.TP\n.B \"-gaussian \\fI<radius>{x<sigma>}\"\\fP\n\\fRblur the image with a Gaussian operator\n.TP\n.B \"-geometry \\fI<width>x<height>{+-}<x>{+-}<y>{%}{@}{!}{^}{<}{>}\"\\fP\n\\fRSpecify dimension, offset, and resize options.\n.TP\n.B \"-gravity \\fI<type>\"\\fP\n\\fRdirection primitive  gravitates to when annotating the image.\n.TP\n.B \"-green-primary \\fI<x>,<y>\"\\fP\n\\fRgreen chromaticity primary point\n.TP\n.B \"-hald-clut \\fI<clut>\"\\fP\n\\fRapply a Hald CLUT to the image\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-implode \\fI<factor>\"\\fP\n\\fRimplode image pixels about the center\n.TP\n.B \"-intent \\fI<type>\"\\fP\n\\fRuse this type of rendering intent when managing the image color\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n.TP\n.B \"-label \\fI<name>\"\\fP\n\\fRassign a label to an image\n.TP\n.B \"-lat \\fI<width>x<height>{+-}<offset>{%}\"\\fP\n\\fRperform local adaptive thresholding\n.TP\n.B \"-level \\fI<black_point>{,<gamma>}{,<white_point>}{%}\"\\fP\n\\fRadjust the level of image contrast\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n.TP\n.B \"-list \\fI<type>\"\\fP\n\\fRthe type of list\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-loop \\fI<iterations>\"\\fP\n\\fRadd Netscape loop extension to your GIF animation\n.TP\n.B \"-magnify\"\n\\fRmagnify the image\n.TP\n.B \"-map \\fI<filename>\"\\fP\n\\fRchoose a particular set of colors from this image\n.TP\n.B \"-mask \\fI<filename>\"\\fP\n\\fRSpecify a clipping mask\n.TP\n.B \"-matte\"\n\\fRstore matte channel if the image has one\n.TP\n.B \"-mattecolor \\fI<color>\"\\fP\n\\fRspecify the color to be used with the \\fB-frame\\fP option\n.TP\n.B \"-median \\fI<radius>\"\\fP\n\\fRapply a median filter to the image\n.TP\n.B \"-minify \\fI<factor>\"\\fP\n\\fRminify the image\n.TP\n.B \"-modulate \\fIbrightness[,saturation[,hue]]\"\\fP\n\\fRvary the brightness, saturation, and hue of an image\n.TP\n.B \"-monitor\"\n\\fRshow progress indication\n.TP\n.B \"-monochrome\"\n\\fRtransform the image to black and white\n.TP\n.B \"-morph \\fI<frames>\"\\fP\n\\fRmorphs an image sequence\n.TP\n.B \"-mosaic\"\n\\fRcreate a mosaic from an image or an image sequence\n.TP\n.B \"-motion-blur \\fI<radius>{x<sigma>}{+angle}\"\\fP\n\\fRSimulate motion blur\n.TP\n.B \"-negate\"\n\\fRreplace every pixel with its complementary color\n.TP\n.B \"-noise \\fI<radius|type>\"\\fP\n\\fRadd or reduce noise in an image\n.TP\n.B \"-noop\"\n\\fRNOOP (no option)\n.TP\n.B \"-normalize\"\n\\fRtransform image to span the full range of color values\n.TP\n.B \"-opaque \\fI<color>\"\\fP\n\\fRchange this color to the pen color within the image\n.TP\n.B \"-operator \\fIchannel operator rvalue[%]\"\\fP\n\\fRapply a mathematical, bitwise, or value operator to an image channel\n.TP\n.B \"-ordered-dither \\fI<channeltype> <NxN>\"\\fP\n\\fRordered dither the image\n.TP\n.B \"-orient \\fI<orientation>\"\\fP\n\\fRSet the image orientation attribute\n.TP\n.B \"-page \\fI<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}\"\\fP\n\\fRsize and location of an image canvas\n.TP\n.B \"-paint \\fI<radius>\"\\fP\n\\fRsimulate an oil painting\n.TP\n.B \"-pen \\fI<color>\"\\fP\n\\fR(This option has been replaced by the -fill option)\n.TP\n.B \"-ping\"\n\\fRefficiently determine image characteristics\n.TP\n.B \"-pointsize \\fI<value>\"\\fP\n\\fRpointsize of the PostScript, X11, or TrueType font\n.TP\n.B \"-preview \\fI<type>\"\\fP\n\\fRimage preview type\n.TP\n.B \"-process \\fI<command>\"\\fP\n\\fRprocess a sequence of images using a process module\n.TP\n.B \"-profile \\fI<filename>\"\\fP\n\\fRadd ICM, IPTC, or generic profile  to image\n.TP\n.B \"-quality \\fI<value>\"\\fP\n\\fRJPEG/MIFF/PNG/TIFF compression level\n.TP\n.B \"-raise \\fI<width>x<height>\"\\fP\n\\fRlighten or darken image edges\n.TP\n.B \"-random-threshold \\fI<channeltype> <LOWxHIGH>\"\\fP\n\\fRrandom threshold the image\n.TP\n.B \"-recolor \\fI<matrix>\"\\fP\n\\fRapply a color translation matrix to image channels\n.TP\n.B \"-red-primary \\fI<x>,<y>\"\\fP\n\\fRred chromaticity primary point\n.TP\n.B \"-region \\fI<width>x<height>{+-}<x>{+-}<y>\"\\fP\n\\fRapply options to a portion of the image\n.TP\n.B \"-render\"\n\\fRrender vector operations\n.TP\n.B \"-repage \\fI <width>x<height>+xoff+yoff[!]\"\\fP\n\\fRAdjust image page offsets\n.TP\n.B \"-resample \\fI<horizontal>x<vertical>\"\\fP\n\\fRResample image to specified horizontal and vertical resolution\n.TP\n.B \"-resize \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image\n.TP\n.B \"-roll \\fI{+-}<x>{+-}<y>\"\\fP\n\\fRroll an image vertically or horizontally\n.TP\n.B \"-rotate \\fI<degrees>{<}{>}\"\\fP\n\\fRrotate the image\n.TP\n.B \"-sample \\fI<geometry>\"\\fP\n\\fRscale image using pixel sampling\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n.TP\n.B \"-scale \\fI<geometry>\"\\fP\n\\fRscale the image.\n.TP\n.B \"-scene \\fI<value>\"\\fP\n\\fRset scene number\n.TP\n.B \"-set \\fI<attribute> <value>\"\\fP\n\\fRset an image attribute\n.TP\n.B \"+set \\fI<attribute>\"\\fP\n\\fRunset an image attribute\n.TP\n.B \"-segment \\fI<cluster threshold>x<smoothing threshold>\"\\fP\n\\fRsegment an image\n.TP\n.B \"-shade \\fI<azimuth>x<elevation>\"\\fP\n\\fRshade the image using a distant light source\n.TP\n.B \"-sharpen \\fI<radius>{x<sigma>}\"\\fP\n\\fRsharpen the image\n.TP\n.B \"-shave \\fI<width>x<height>{%}\"\\fP\n\\fRshave pixels from the image edges\n.TP\n.B \"-shear \\fI<x degrees>x<y degrees>\"\\fP\n\\fRshear the image along the X or Y axis\n.TP\n.B \"-size \\fI<width>x<height>{+offset}\"\\fP\n\\fRwidth and height of the image\n.TP\n.B \"-solarize \\fI<factor>\"\\fP\n\\fRnegate all pixels above the threshold level\n.TP\n.B \"-spread \\fI<amount>\"\\fP\n\\fRdisplace image pixels by a random amount\n.TP\n.B \"-strip\"\n\\fRremove all profiles and text attributes from the image\n.TP\n.B \"-stroke \\fI<color>\"\\fP\n\\fRcolor to use when stroking a graphic primitive\n.TP\n.B \"-strokewidth \\fI<value>\"\\fP\n\\fRset the stroke width\n.TP\n.B \"-swirl \\fI<degrees>\"\\fP\n\\fRswirl image pixels about the center\n.TP\n.B \"-texture \\fI<filename>\"\\fP\n\\fRname of texture to tile onto the image background\n.TP\n.B \"-threshold \\fI<value>{%}\"\\fP\n\\fRthreshold the image\n.TP\n.B \"-thumbnail \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image (quickly)\n.TP\n.B \"-tile \\fI<filename>\"\\fP\n\\fRtile image when filling a graphic primitive\n.TP\n.B \"-transform\"\n\\fRtransform the image\n.TP\n.B \"-transparent \\fI<color>\"\\fP\n\\fRmake this color transparent within the image\n.TP\n.B \"-treedepth \\fI<value>\"\\fP\n\\fRtree depth for the color reduction algorithm\n.TP\n.B \"-trim\"\n\\fRtrim an image\n.TP\n.B \"-type \\fI<type>\"\\fP\n\\fRthe image type\n.TP\n.B \"-units \\fI<type>\"\\fP\n\\fRthe units of image resolution\n.TP\n.B \"-unsharp \\fI<radius>{x<sigma>}{+<amount>}{+<threshold>}\"\\fP\n\\fRsharpen the image with an unsharp mask operator\n.TP\n.B \"-use-pixmap\"\n\\fRuse the pixmap\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n.TP\n.B \"-view \\fI<string>\"\\fP\n\\fRFlashPix viewing parameters\n.TP\n.B \"-virtual-pixel \\fI<method>\"\\fP\n\\fRspecify contents of \"virtual pixels\"\n.TP\n.B \"-wave \\fI<amplitude>x<wavelength>\"\\fP\n\\fRalter an image along a sine wave\n.TP\n.B \"-white-point \\fI<x>,<y>\"\\fP\n\\fRchromaticity white point\n.TP\n.B \"-white-threshold \\fIred[,green][,blue][,opacity]\"\\fP\n\\fRpixels above the threshold become white\n.TP\n.B \"-write \\fI<filename>\"\\fP\n\\fRwrite an intermediate image [\\fIconvert, composite\\fP]\n\nFor a more detailed description of each option, see\nOptions, above.\n.SH GM DISPLAY\n\nDisplay is a machine architecture independent\nimage processing and display program. It can display an image on any workstation\nscreen running an X server. \\fBDisplay\\fP can read and write\n\\fBmany\\fP\nof the more popular image formats (e.g. \\fBJPEG\\fP,\n\\fBTIFF\\fP,\n\\fBPNM\\fP,\n\\fBPhoto\nCD\\fP, etc.).\n\nWith \\fBdisplay\\fP, you can perform these functions on an image:\n.in 15\n\n o  load an image from a file\n o  display the next image\n o  display the former image\n o  display a sequence of images as a slide show\n o  write the image to a file\n o  print the image to a \\fIPostScript\\fP printer\n o  delete the image file\n o  create a Visual Image Directory\n o  select the image to display by its thumbnail rather than name\n o  undo last image transformation\n o  copy a region of the image\n o  paste a region to the image\n o  restore the image to its original size\n o  refresh the image\n o  half the image size\n o  double the image size\n o  resize the image\n o  crop the image\n o  cut the image\n o  flop image in the horizontal direction\n o  flip image in the vertical direction\n o  rotate the image 90 degrees clockwise\n o  rotate the image 90 degrees counter-clockwise\n o  rotate the image\n o  shear the image\n o  roll the image\n o  trim the image edges\n o  invert the colors of the image\n o  vary the color brightness\n o  vary the color saturation\n o  vary the image hue\n o  gamma correct the image\n o  sharpen the image contrast\n o  dull the image contrast\n o  perform histogram equalization on the image\n o  perform histogram normalization on the image\n o  negate the image colors\n o  convert the image to grayscale\n o  set the maximum number of unique colors in the image\n o  reduce the speckles within an image\n o  eliminate peak noise from an image\n o  detect edges within the image\n o  emboss an image\n o  segment the image by color\n o  simulate an oil painting\n o  simulate a charcoal drawing\n o  annotate the image with text\n o  draw on the image\n o  edit an image pixel color\n o  edit the image matte information\n o  composite an image with another\n o  add a border to the image\n o  surround image with an ornamental border\n o  apply image processing techniques to a region of interest\n o  display information about the image\n o  zoom a portion of the image\n o  show a histogram of the image\n o  display image to background of a window\n o  set user preferences\n o  display information about this program\n o  discard all images and exit program\n o  change the level of magnification\n o  display images specified by a World Wide Web (WWW) uniform resource locator (URL)\n\n.SH EXAMPLES\n\nTo scale an image of a cockatoo to exactly 640 pixels in width and 480\npixels in height and position the window at location (200,200), use:\n\n    gm display -geometry 640x480+200+200! cockatoo.miff\n\n\nTo display an image of a cockatoo without a border centered on a backdrop,\nuse:\n\n    gm display +borderwidth -backdrop cockatoo.miff\n\n\nTo tile a slate texture onto the root window, use:\n\n    gm display -size 1280x1024 -window root slate.png\n\n\nTo display a visual image directory of all your JPEG images, use:\n\n    gm display 'vid:*.jpg'\n\n\nTo display a MAP image that is 640 pixels in width and 480 pixels in height\nwith 256 colors, use:\n\n    gm display -size 640x480+256 cockatoo.map\n\n\nTo display an image of a cockatoo specified with a \\fBWorld Wide Web (WWW)\\fP\nuniform resource locator \\fB(URL)\\fP, use:\n\n    gm display ftp://wizards.dupont.com/images/cockatoo.jpg\n\n\nTo display histogram of an image, use:\n\n    gm gm convert file.jpg HISTOGRAM:- | gm display -\n\n.SH OPTIONS\n\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect until it is explicitly changed by specifying\nthe option again with a different effect. For example to display three images,\nthe first with 32 colors, the second with an unlimited number of colors,\nand the third with only 16 colors, use:\n\n    gm display -colors 32 cockatoo.miff -noop duck.miff\n                 -colors 16 macaw.miff\n\n\n\\fBDisplay\\fP options can appear on the command line or in your X resources\nfile. See \\fIX(1)\\fP. Options on the command line supersede values specified\nin your X resources file.\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-authenticate \\fI<string>\"\\fP\n\\fRdecrypt image with this password\n.TP\n.B \"-backdrop\"\n\\fRdisplay the image centered on a backdrop.\n.TP\n.B \"-background \\fI<color>\"\\fP\n\\fRthe background color\n.TP\n.B \"-border \\fI<width>x<height>\"\\fP\n\\fRsurround the image with a border of color\n.TP\n.B \"-bordercolor \\fI<color>\"\\fP\n\\fRthe border color\n.TP\n.B \"-borderwidth \\fI<geometry>\"\\fP\n\\fRthe border width\n.TP\n.B \"-colormap \\fI<type>\"\\fP\n\\fRdefine the colormap type\n.TP\n.B \"-colors \\fI<value>\"\\fP\n\\fRpreferred number of colors in the image\n.TP\n.B \"-colorspace \\fI<value>\"\\fP\n\\fRthe type of colorspace\n.TP\n.B \"-comment \\fI<string>\"\\fP\n\\fRannotate an image with a comment\n.TP\n.B \"-compress \\fI<type>\"\\fP\n\\fRthe type of image compression\n.TP\n.B \"-contrast\"\n\\fRenhance or reduce the image contrast\n.TP\n.B \"-crop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRpreferred size and location of the cropped image\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-delay \\fI<1/100ths of a second>\"\\fP\n\\fRdisplay the next image after pausing\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n.TP\n.B \"-despeckle\"\n\\fRreduce the speckles within an image\n.TP\n.B \"-display \\fI<host:display[.screen]>\"\\fP\n\\fRspecifies the X server to contact\n.TP\n.B \"-dispose \\fI<method>\"\\fP\n\\fRGIF disposal method\n.TP\n.B \"-dither\"\n\\fRapply Floyd/Steinberg error diffusion to the image\n.TP\n.B \"-edge \\fI<radius>\"\\fP\n\\fRdetect edges within an image\n.TP\n.B \"-endian \\fI<type>\"\\fP\n\\fRspecify endianness (MSB, LSB, or Native) of image\n.TP\n.B \"-enhance\"\n\\fRapply a digital filter to enhance a noisy image\n.TP\n.B \"-filter \\fI<type>\"\\fP\n\\fRuse this type of filter when resizing an image\n.TP\n.B \"-flip\"\n\\fRcreate a \"mirror image\"\n.TP\n.B \"-flop\"\n\\fRcreate a \"mirror image\"\n.TP\n.B \"-font \\fI<name>\"\\fP\n\\fRuse this font when annotating the image with text\n.TP\n.B \"-foreground \\fI<color>\"\\fP\n\\fRdefine the foreground color\n.TP\n.B \"-frame \\fI<width>x<height>+<outer bevel width>+<inner bevel width>\"\\fP\n\\fRsurround the image with an ornamental border\n.TP\n.B \"-gamma \\fI<value>\"\\fP\n\\fRlevel of gamma correction\n.TP\n.B \"-geometry \\fI<width>x<height>{+-}<x>{+-}<y>{%}{@}{!}{^}{<}{>}\"\\fP\n\\fRSpecify dimension, offset, and resize options.\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-iconGeometry \\fI<geometry>\"\\fP\n\\fRspecify the icon geometry\n.TP\n.B \"-iconic\"\n\\fRiconic animation\n.TP\n.B \"-immutable\"\n\\fRmake image immutable\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n.TP\n.B \"-label \\fI<name>\"\\fP\n\\fRassign a label to an image\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-magnify \\fI<factor>\"\\fP\n\\fRmagnify the image\n.TP\n.B \"-map \\fI<type>\"\\fP\n\\fRdisplay image using this type.\n.TP\n.B \"-matte\"\n\\fRstore matte channel if the image has one\n.TP\n.B \"-mattecolor \\fI<color>\"\\fP\n\\fRspecify the color to be used with the \\fB-frame\\fP option\n.TP\n.B \"-monitor\"\n\\fRshow progress indication\n.TP\n.B \"-monochrome\"\n\\fRtransform the image to black and white\n.TP\n.B \"-name\"\n\\fRname an image\n.TP\n.B \"-negate\"\n\\fRreplace every pixel with its complementary color\n.TP\n.B \"-noop\"\n\\fRNOOP (no option)\n.TP\n.B \"-page \\fI<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}\"\\fP\n\\fRsize and location of an image canvas\n.TP\n.B \"+progress\"\n\\fRdisable progress monitor and busy cursor\n.TP\n.B \"-quality \\fI<value>\"\\fP\n\\fRJPEG/MIFF/PNG/TIFF compression level\n.TP\n.B \"-raise \\fI<width>x<height>\"\\fP\n\\fRlighten or darken image edges\n.TP\n.B \"-remote\"\n\\fRperform a X11 remote operation\n.TP\n.B \"-roll \\fI{+-}<x>{+-}<y>\"\\fP\n\\fRroll an image vertically or horizontally\n.TP\n.B \"-rotate \\fI<degrees>{<}{>}\"\\fP\n\\fRrotate the image\n.TP\n.B \"-sample \\fI<geometry>\"\\fP\n\\fRscale image using pixel sampling\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n.TP\n.B \"-scenes \\fI<value-value>\"\\fP\n\\fRrange of image scene numbers to read\n.TP\n.B \"-set \\fI<attribute> <value>\"\\fP\n\\fRset an image attribute\n.TP\n.B \"+set \\fI<attribute>\"\\fP\n\\fRunset an image attribute\n.TP\n.B \"-segment \\fI<cluster threshold>x<smoothing threshold>\"\\fP\n\\fRsegment an image\n.TP\n.B \"-shared-memory\"\n\\fRuse shared memory\n.TP\n.B \"-sharpen \\fI<radius>{x<sigma>}\"\\fP\n\\fRsharpen the image\n.TP\n.B \"-size \\fI<width>x<height>{+offset}\"\\fP\n\\fRwidth and height of the image\n.TP\n.B \"-text-font \\fI<name>\"\\fP\n\\fRfont for writing fixed-width text\n.TP\n.B \"-texture \\fI<filename>\"\\fP\n\\fRname of texture to tile onto the image background\n.TP\n.B \"-title \\fI<string>\"\\fP\n\\fRassign title to displayed image [\\fIanimate, display, montage\\fP]\n.TP\n.B \"-treedepth \\fI<value>\"\\fP\n\\fRtree depth for the color reduction algorithm\n.TP\n.B \"-trim\"\n\\fRtrim an image\n.TP\n.B \"-type \\fI<type>\"\\fP\n\\fRthe image type\n.TP\n.B \"-update \\fI<seconds>\"\\fP\n\\fR\ndetect when image file is modified and redisplay.\n.TP\n.B \"-use-pixmap\"\n\\fRuse the pixmap\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n.TP\n.B \"-visual \\fI<type>\"\\fP\n\\fRanimate images using this X visual type\n.TP\n.B \"-window \\fI<id>\"\\fP\n\\fRmake image the background of a window\n.TP\n.B \"-window-group\"\n\\fRspecify the window group\n.TP\n.B \"-write \\fI<filename>\"\\fP\n\\fRwrite the image to a file [\\fIdisplay\\fP]\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.SH MOUSE BUTTONS\n\nThe effects of each button press is described below. Three buttons are\nrequired. If you have a two button mouse, button 1 and 3 are returned.\nPress \\fBALT\\fP and button 3 to simulate button 2.\n.TP\n.B \"1\"\n\\fR\nPress this button to map or unmap the Command\nwidget . See the next section for more information about the Command\nwidget.\n.TP\n.B \"2\"\n\\fR\nPress and drag to define a region of the image to magnify.\n.TP\n.B \"3\"\n\\fR\nPress and drag to choose from a select set of \\fBdisplay(1)\\fP\ncommands. This button behaves differently if the image being displayed\nis a visual image directory. Choose a particular tile of the directory\nand press this button and drag to select a command from a pop-up menu.\nChoose from these menu items:\n\n    Open\n    Next\n    Former\n    Delete\n    Update\n\n\nIf you choose \\fBOpen\\fP, the image represented by the tile is displayed.\nTo return to the visual image directory, choose \\fBNext\\fP from the Command\nwidget (refer to Command Widget).\n\\fBNext\\fP and \\fBFormer\\fP\nmoves to the next or former image respectively. Choose \\fBDelete\\fP to\ndelete a particular image tile. Finally, choose \\fBUpdate\\fP to synchronize\nall the image tiles with their respective images. See\nmontage\nand\nmiff for more details.\n.SH COMMAND WIDGET\n\nThe Command widget lists a number of sub-menus and commands. They are\n\n    \\fBFile\\fP\n\n    Open...\n    Next\n    Former\n    Select...\n    Save...\n    Print...\n    Delete...\n    Canvas...\n    Visual Directory...\n    Quit\n\n\n\n    \\fBEdit\\fP\n\n    Undo\n    Redo\n    Cut\n    Copy\n    Paste\n\n\n\n    \\fBView\\fP\n\n    Half Size\n    Original Size\n    Double Size\n    Resize...\n    Apply\n    Refresh\n    Restore\n\n\n\n    \\fBTransform\\fP\n\n    Crop\n    Chop\n    Flop\n    Flip\n    Rotate Right\n    Rotate Left\n    Rotate...\n    Shear...\n    Roll...\n    Trim Edges\n\n\n\n    \\fBEnhance\\fP\n\n    Hue...\n    Saturation...\n    Brightness...\n    Gamma...\n    Spiff...\n    Dull\n    Equalize\n    Normalize\n    Negate\n    GRAYscale\n    Quantize...\n\n\n\n    \\fBEffects\\fP\n\n    Despeckle\n    Emboss\n    Reduce Noise\n    Add Noise\n    Sharpen...\n    Blur...\n    Threshold...\n    Edge Detect...\n    Spread...\n    Shade...\n    Raise...\n    Segment...\n\n\n\n    \\fBF/X\\fP\n\n    Solarize...\n    Swirl...\n    Implode...\n    Wave...\n    Oil Paint...\n    Charcoal Draw...\n\n\n\n    \\fBImage Edit\\fP\n\n    Annotate...\n    Draw...\n    Color...\n    Matte...\n    Composite...\n    Add Border...\n    Add Frame...\n    Comment...\n    Launch...\n    Region of Interest...\n\n\n\n    \\fBMiscellany\\fP\n\n    Image Info\n    Zoom Image\n    Show Preview...\n    Show Histogram\n    Show Matte\n    Background...\n    Slide Show\n    Preferences...\n\n\n\n    \\fBHelp\\fP\n\n    Overview\n    Browse Documentation\n    About Display\n\n\n\nMenu items with a indented triangle have a sub-menu. They are represented\nabove as the indented items. To access a sub-menu item, move the pointer\nto the appropriate menu and press button 1 and drag. When you find the\ndesired sub-menu item, release the button and the command is executed.\nMove the pointer away from the sub-menu if you decide not to execute a\nparticular command.\n.SH KEYBOARD ACCELERATORS\n\nAccelerators are one or two key presses that effect a particular command.\nThe keyboard accelerators that\n\\fBdisplay\\fP understands is:\n\n    Ctl+O     Press to load an image from a file.\n    space     Press to display the next image.\n\n\nIf the image is a multi-paged document such as a\n\\fIPostScript\\fP document,\nyou can skip ahead several pages by preceding this command with a number.\nFor example to display the fourth page beyond the current page,\npress 4space.\n\n    backspace Press to display the former image.\n\n\nIf the image is a multi-paged document such as a\n\\fIPostScript\\fP document,\nyou can skip behind several pages by preceding this command with a number.\nFor example to display the fourth page preceding the current page, press\n4n.\n\n    Ctl-S    Press to save the image to a file.\n    Ctl-P    Press to print the image to a\n             \\fIPostScript\\fP printer.\n    Ctl-D    Press to delete an image file.\n    Ctl-N    Press to create a blank canvas.\n    Ctl-Q    Press to discard all images and exit program.\n    Ctl+Z    Press to undo last image transformation.\n    Ctl+R    Press to redo last image transformation.\n    Ctl-X    Press to cut a region of\n             the image.\n    Ctl-C    Press to copy a region of\n             the image.\n    Ctl-V    Press to paste a region to\n             the image.\n    <        Press to halve the image size.\n    .        Press to return to the original image size.\n    >        Press to double the image size.\n    %        Press to resize the image to a width and height\n             you specify.\n    Cmd-A    Press to make any image transformations\n             permanent.\n             By default, any image size transformations are\n             applied to the original image to create the\n             image displayed on the X server.  However, the\n             transformations are not permanent (i.e. the\n             original image does not change size only the\n             X image does). For example, if you press \">\"\n             the X image will appear to double in size, but\n             the original image will in fact remain the same\n             size.  To force the original image to double in\n             size, press \">\" followed by \"Cmd-A\".\n    @        Press to refresh the image window.\n    C        Press to crop the image.\n    [        Press to chop the image.\n    H        Press to flop image in the horizontal direction.\n    V        Press to flip image in the vertical direction.\n    /        Press to rotate the image 90 degrees clockwise.\n    \\\\        Press to rotate the image 90 degrees\n             counter-clockwise.\n    *        Press to rotate the image\n             the number of degrees you specify.\n    S        Press to shear the image the number of degrees\n             you specify.\n    R        Press to roll the image.\n    T        Press to trim the image edges.\n    Shft-H   Press to vary the color hue.\n    Shft-S   Press to vary the color saturation.\n    Shft-L   Press to vary the image brightness.\n    Shft-G   Press to gamma correct the image.\n    Shft-C   Press to spiff up the image contrast.\n    Shft-Z   Press to dull the image contrast.\n    =        Press to perform histogram equalization on\n             the image.\n    Shft-N   Press to perform histogram normalization on\n             the image.\n    Shft-~   Press to negate the colors of the image.\n    .        Press to convert the image colors to gray.\n    Shft-#   Press to set the maximum number of unique\n             colors in the image.\n    F2       Press to reduce the speckles in an image.\n    F2       Press to emboss an image.\n    F4       Press to eliminate peak noise from an image.\n    F5       Press to add noise to an image.\n    F6       Press to sharpen an image.\n    F7       Press to blur image an image.\n    F8       Press to threshold the image.\n    F9       Press to detect edges within an image.\n    F10      Press to displace pixels by a random amount.\n    F11      Press to shade the image using a distant light\n             source.\n    F12      Press to lighten or darken image edges to\n             create a 3-D effect.\n    F13      Press to segment the image by color.\n    Meta-S   Press to swirl image pixels about the center.\n    Meta-I   Press to implode image pixels about the center.\n    Meta-W   Press to alter an image along a sine wave.\n    Meta-P   Press to simulate an oil painting.\n    Meta-C   Press to simulate a charcoal drawing.\n    Alt-X    Press to composite the image\n             with another.\n    Alt-A    Press to annotate the image with text.\n    Alt-D    Press to draw a line on the image.\n    Alt-P    Press to edit an image pixel color.\n    Alt-M    Press to edit the image matte information.\n    Alt-X    Press to composite the image with another.\n    Alt-A    Press to add a border to the image.\n    Alt-F    Press to add a ornamental frame to the image.\n    Alt-Shft-!   Press to add an image comment.\n    Ctl-A    Press to apply image processing techniques to a\n             region of interest.\n    Shft-?   Press to display information about the image.\n    Shft-+   Press to map the zoom image window.\n    Shft-P   Press to preview an image enhancement, effect,\n             or f/x.\n    F1       Press to display helpful information about\n             the \"display\" utility.\n    Find     Press to browse documentation about\n             GraphicsMagick.\n    1-9      Press to change the level of magnification.\n\n\nUse the arrow keys to move the image one pixel up, down, left, or right\nwithin the magnify window. Be sure to first map the magnify window by pressing\nbutton 2.\n\nPress ALT and one of the arrow keys to trim off one pixel from any side\nof the image.\n.SH X RESOURCES\n\n\\fBDisplay\\fP options can appear on the command line or in your X resource\nfile. Options on the command line supersede values specified in your X\nresource file. See \\fIX(1)\\fP for more information on X resources.\n\nMost \\fBdisplay\\fP options have a corresponding X resource. In addition,\n\\fBdisplay\\fP\nuses the following X resources:\n.TP\n.B \"background \\fI(class Background)\"\\fP\n\\fR\nSpecifies the preferred color to use for the Image window background. The\ndefault is #ccc.\n.TP\n.B \"borderColor \\fI(class BorderColor)\"\\fP\n\\fR\nSpecifies the preferred color to use for the Image window border. The default\nis #ccc.\n.TP\n.B \"borderWidth \\fI(class BorderWidth)\"\\fP\n\\fR\nSpecifies the width in pixels of the image window border. The default is\n2.\n.TP\n.B \"browseCommand \\fI(class browseCommand)\"\\fP\n\\fR\nSpecifies the name of the preferred browser when displaying GraphicsMagick\ndocumentation. The default is netscape %s.\n.TP\n.B \"confirmExit \\fI(class ConfirmExit)\"\\fP\n\\fR\n\\fBDisplay\\fP pops up a dialog box to confirm exiting the program when\nexiting the program. Set this resource to False to exit without\na confirmation.\n.TP\n.B \"displayGamma \\fI(class DisplayGamma)\"\\fP\n\\fR\nSpecifies the gamma of the X server.\n\\fR\nYou can apply separate gamma values to the red, green, and blue channels\nof the image with a gamma value list delineated with slashes (i.e. 1.7/2.3/1.2).\n\\fR\nThe default is 2.2.\n.TP\n.B \"displayWarnings \\fI(class DisplayWarnings)\"\\fP\n\\fR\n\\fBDisplay\\fP pops up a dialog box whenever a warning message occurs.\nSet this resource to False to ignore warning messages.\n.TP\n.B \"font \\fI(class FontList)\"\\fP\n\\fR\nSpecifies the name of the preferred font to use in normal formatted text.\nThe default is 14 point Helvetica.\n.TP\n.B \"font[1-9] \\fI(class Font[1-9])\"\\fP\n\\fR\nSpecifies the name of the preferred font to use when\nannotating\nthe image window with text. The default fonts are fixed, variable, 5x8,\n6x10, 7x13bold, 8x13bold, 9x15bold, 10x20, and 12x24.\n.TP\n.B \"foreground \\fI(class Foreground)\"\\fP\n\\fR\nSpecifies the preferred color to use for text within the image window.\nThe default is black.\n.TP\n.B \"gammaCorrect \\fI(class gammaCorrect)\"\\fP\n\\fR\nThis resource, if true, will lighten or darken an image of known gamma\nto match the gamma of the display (see resource \\fBdisplayGamma\\fP). The\ndefault is True.\n.TP\n.B \"geometry \\fI(class Geometry)\"\\fP\n\\fR\nSpecifies the preferred size and position of the image window. It is not\nnecessarily obeyed by all window managers.\n\nOffsets, if present, are handled in \\fIX(1)\\fP style.  A negative x offset is\nmeasured from the right edge of the screen to the right edge of the icon,\nand a negative y offset is measured from the bottom edge of the screen\nto the bottom edge of the icon.\n.TP\n.B \"iconGeometry \\fI(class IconGeometry)\"\\fP\n\\fR\nSpecifies the preferred size and position of the application when iconified.\nIt is not necessarily obeyed by all window managers.\n\nOffsets, if present, are handled in the same manner as in class Geometry.\n.TP\n.B \"iconic \\fI(class Iconic)\"\\fP\n\\fR\nThis resource indicates that you would prefer that the application's windows\ninitially not be visible as if the windows had be immediately iconified\nby you. Window managers may choose not to honor the application's request.\n.TP\n.B \"magnify \\fI(class Magnify)\"\\fP\n\\fR\nspecifies an integral factor by which the image should be enlarged. The\ndefault is 3.\n\\fR\nThis value only affects the magnification window which is invoked with\nbutton\nnumber 3 after the image is displayed.\n.TP\n.B \"matteColor \\fI(class MatteColor)\"\\fP\n\\fR\nSpecify the color of windows. It is used for the backgrounds of windows,\nmenus, and notices. A 3D effect is achieved by using highlight and shadow\ncolors derived from this color. Default value: #697B8F.\n.TP\n.B \"name \\fI(class Name)\"\\fP\n\\fR\nThis resource specifies the name under which resources for the application\nshould be found. This resource is useful in shell aliases to distinguish\nbetween invocations of an application, without resorting to creating links\nto alter the executable file name. The default is the application name.\n.TP\n.B \"pen[1-9] \\fI(class Pen[1-9])\"\\fP\n\\fR\nSpecifies the color of the preferred font to use when\nannotating\nthe image window with text. The default colors are black, blue, green,\ncyan, gray, red, magenta, yellow, and white.\n.TP\n.B \"printCommand \\fI(class PrintCommand)\"\\fP\n\\fR\nThis command is executed whenever Print is issued.  In general, it is the\ncommand to print \\fIPostScript\\fP to your printer. Default value: lp\n-c -s %i.\n.TP\n.B \"sharedMemory \\fI(class SharedMemory)\"\\fP\n\\fR\nThis resource specifies whether display should attempt use shared memory\nfor pixmaps. GraphicsMagick must be compiled with shared memory support,\nand the display must support the MIT-SHM extension. Otherwise, this\nresource is ignored. The default is True.\n.TP\n.B \"textFont \\fI(class textFont)\"\\fP\n\\fR\nSpecifies the name of the preferred font to use in fixed (typewriter style)\nformatted text. The default is 14 point Courier.\n.TP\n.B \"title \\fI(class Title)\"\\fP\n\\fR\nThis resource specifies the title to be used for the image window. This\ninformation is sometimes used by a window manager to provide a header identifying\nthe window. The default is the image file name.\n.TP\n.B \"undoCache \\fI(class UndoCache)\"\\fP\n\\fR\nSpecifies, in mega-bytes, the amount of memory in the undo edit cache.\nEach time you modify the image it is saved in the undo edit cache as long\nas memory is available. You can subsequently \\fIundo\\fP one or more of\nthese transformations. The default is 16 Megabytes.\n.TP\n.B \"usePixmap \\fI(class UsePixmap)\"\\fP\n\\fR\nImages are maintained as a XImage by default. Set this resource to True\nto utilize a server Pixmap instead. This option is useful if your image\nexceeds the dimensions of your server screen and you intend to pan the\nimage. Panning is much faster with Pixmaps than with a XImage. Pixmaps\nare considered a precious resource, use them with discretion.\n\nTo set the geometry of the Magnify or Pan or window, use the geometry resource.\nFor example, to set the Pan window geometry to 256x256, use:\n\n    gm display.pan.geometry: 256x256\n\n.SH IMAGE LOADING\n\nTo select an image to display, choose \\fBOpen\\fP of the \\fBFile\\fP sub-menu\nfrom the Command widget. A file browser is displayed.\nTo choose a particular image file, move the pointer to the filename and\npress any button. The filename is copied to the text window. Next, press\n\\fBOpen\\fP\nor press the \\fBRETURN\\fP key. Alternatively, you can type the image file\nname directly into the text window. To descend directories, choose a directory\nname and press the button twice quickly. A scrollbar allows a large list\nof filenames to be moved through the viewing area if it exceeds the size\nof the list area.\n\nYou can trim the list of file names by using shell globbing characters.\nFor example, type *.jpg to list only files that end\nwith .jpg.\n\nTo select your image from the X server screen instead of from a file, Choose\n\\fBGrab\\fP of the \\fBOpen\\fP widget.\n.SH VISUAL IMAGE DIRECTORY\n\nTo create a Visual Image Directory, choose Visual Directory of the \\fBFile\\fP\nsub-menu from the Command widget . A file browser is\ndisplayed. To create a Visual Image Directory from all the images in the\ncurrent directory, press \\fBDirectory\\fP or press the \\fBRETURN key\\fP.\nAlternatively, you can select a set of image names by using shell globbing\ncharacters. For example, type *.jpg to include only files that\nend with .jpg. To descend directories, choose a directory name\nand press the button twice quickly. A scrollbar allows a large list of\nfilenames to be moved through the viewing area if it exceeds the size of\nthe list area.\n\nAfter you select a set of files, they are turned into thumbnails and tiled\nonto a single image. Now move the pointer to a particular thumbnail and\npress \\fBbutton 3\\fP and drag. Finally, select Open. The image represented\nby the thumbnail is displayed at its full size. Choose \\fBNext\\fP from\nthe \\fBFile\\fP sub-menu of the Command widget to return to the Visual\nImage Directory.\n.SH IMAGE CUTTING\n\nNote that cut information for image window is not retained for colormapped\nX server visuals (e.g. \\fIStaticColor\\fP,\n\\fIStaticColor\\fP, \\fIGRAYScale\\fP,\n\\fIPseudoColor\\fP).\nCorrect cutting behavior may require a \\fITrueColor\\fP or \\fIDirectColor\\fP\nvisual or a \\fIStandard Colormap\\fP.\n\nTo begin, press choose \\fBCut\\fP of the \\fBEdit\\fP sub-menu from the\nCommand\nwidget. Alternatively, press\n\\fBF3\\fP in the image window.\n\nA small window appears showing the location of the cursor in the image\nwindow. You are now in cut mode. In cut mode, the Command widget has these\noptions:\n\n    \\fBHelp\\fP\n    \\fBDismiss\\fP\n\n\nTo define a cut region, press button 1 and drag. The cut region is defined\nby a highlighted rectangle that expands or contracts as it follows the\npointer. Once you are satisfied with the cut region, release the button.\nYou are now in rectify mode. In rectify mode, the Command widget has these\noptions:\n\n    \\fBCut\\fP\n    \\fBHelp\\fP\n    \\fBDismiss\\fP\n\n\nYou can make adjustments by moving the pointer to one of the cut rectangle\ncorners, pressing a button, and dragging. Finally, press Cut to commit\nyour copy region. To exit without cutting the image, press Dismiss.\n.SH IMAGE COPYING\n\nTo begin, press choose \\fBCopy\\fP of the \\fBEdit\\fP sub-menu from the\nCommand\nwidget. Alternatively, press\n\\fBF4\\fP in the image window.\n\nA small window appears showing the location of the cursor in the image\nwindow. You are now in copy mode. In copy mode, the Command widget has\nthese options:\n\n    Help\n    Dismiss\n\n\nTo define a copy region, press button 1 and drag. The copy region is defined\nby a highlighted rectangle that expands or contracts as it follows the\npointer. Once you are satisfied with the copy region, release the button.\nYou are now in rectify mode. In rectify mode, the Command widget has these\noptions:\n\n    Copy\n    Help\n    Dismiss\n\n\nYou can make adjustments by moving the pointer to one of the copy rectangle\ncorners, pressing a button, and dragging. Finally, press Copy to commit\nyour copy region. To exit without copying the image, press Dismiss.\n.SH IMAGE PASTING\n\nTo begin, press choose \\fBPaste\\fP of the \\fBEdit\\fP sub-menu from the\nCommand\nwidget. Alternatively, press\n\\fBF5\\fP in the image window.\n\nA small window appears showing the location of the cursor in the image\nwindow. You are now in Paste mode. To exit immediately, press Dismiss.\nIn Paste mode, the Command widget has these options:\n\n    \\fBOperators\\fP\n\n    over\n    in\n    out\n    atop\n    xor\n    plus\n    minus\n    add\n    subtract\n    difference\n    multiply\n    bumpmap\n    replace\n\n    \\fBHelp\\fP\n    \\fBDismiss\\fP\n\n\nChoose a composite operation from the \\fBOperators\\fP sub-menu of the\nCommand\nwidget. How each operator behaves is described below. \\fIimage window\\fP\nis the image currently displayed on your X server and \\fIimage\\fP is the\nimage obtained with the File Browser widget.\n.TP\n.B \"over\"\n\\fR\nThe result is the union of the two image shapes, with \\fIimage\\fP obscuring\n\\fIimage\nwindow\\fP in the region of overlap.\n.TP\n.B \"in\"\n\\fR\nThe result is simply \\fIimage\\fP cut by the shape of\n\\fIimage window\\fP.\nNone of the image data of image window is in the result.\n.TP\n.B \"out\"\n\\fR\nThe resulting image is \\fIimage\\fP with the shape of\n\\fIimage window\\fP\ncut out.\n.TP\n.B \"atop\"\n\\fR\nThe result is the same shape as \\fIimage window\\fP, with\n\\fIimage\\fP\nobscuring \\fIimage window\\fP where the image shapes overlap. Note this\ndiffers from over because the portion of image outside\n\\fIimage window\\fP's\nshape does not appear in the result.\n.TP\n.B \"xor\"\n\\fR\nThe result is the image data from both \\fIimage\\fP and\n\\fIimage window\\fP\nthat is outside the overlap region. The overlap region is blank.\n.TP\n.B \"plus\"\n\\fR\nThe result is just the sum of the image data. Output values are cropped\nto the maximum value (no overflow). This operation is independent of the\nmatte channels.\n.TP\n.B \"minus\"\n\\fR\nThe result of \\fIimage\\fP - \\fIimage window\\fP, with underflow cropped\nto zero. The matte channel is ignored (set to opaque, full coverage).\n.TP\n.B \"add\"\n\\fR\nThe result of \\fIimage\\fP + \\fIimage window\\fP, with overflow wrapping\naround (mod MaxRGB+1).\n.TP\n.B \"subtract\"\n\\fR\nThe result of \\fIimage\\fP - \\fIimage window\\fP, with underflow wrapping\naround (mod MaxRGB+1). The add and subtract operators can be used to perform\nreversible transformations.\n.TP\n.B \"difference\"\n\\fR\nThe result of abs(\\fIimage\\fP - \\fIimage window\\fP). This is useful for\ncomparing two very similar images.\n.TP\n.B \"multiply\"\n\\fR\nThe result of \\fIimage\\fP * \\fIimage window\\fP. This is useful for\nthe creation of drop-shadows.\n.TP\n.B \"bumpmap\"\n\\fR\nThe result of \\fIimage window\\fP shaded by \\fIwindow\\fP.\n.TP\n.B \"replace\"\n\\fRThe resulting image is \\fIimage window\\fP replaced with\n\\fIimage\\fP.\nHere the matte information is ignored.\n\nThe image compositor requires a matte, or alpha channel in the image for\nsome operations. This extra channel usually defines a mask which represents\na sort of a cookie-cutter for the image. This is the case when matte is\n255 (full coverage) for pixels inside the shape, zero outside, and between\nzero and 255 on the boundary. If image does not have a matte channel, it\nis initialized with 0 for any pixel matching in color to pixel location\n(0,0), otherwise 255. See Matte Editing for a method\nof defining a matte channel.\n\nNote that matte information for image window is not retained for colormapped\nX server visuals (e.g. \\fIStaticColor, StaticColor, GrayScale, PseudoColor\\fP).\nCorrect compositing behavior may require a\n\\fITrueColor\\fP or \\fIDirectColor\\fP\nvisual or a \\fIStandard Colormap\\fP.\n\nChoosing a composite operator is optional. The default operator is replace.\nHowever, you must choose a location to composite your image and press button\n1. Press and hold the button before releasing and an outline of the image\nwill appear to help you identify your location.\n\nThe actual colors of the pasted image is saved. However, the color that\nappears in image window may be different. For example, on a monochrome\nscreen image window will appear black or white even though your pasted\nimage may have many colors. If the image is saved to a file it is written\nwith the correct colors. To assure the correct colors are saved in the\nfinal image, any \\fIPseudoClass\\fP image is promoted to \\fIDirectClass\\fP.\nTo force a\n\\fIPseudoClass\\fP image to remain \\fIPseudoClass\\fP,\nuse \\fB-colors\\fP.\n.SH IMAGE CROPPING\n\nTo begin, press choose \\fBCrop\\fP of the \\fBTransform\\fP submenu from\nthe Command widget. Alternatively,\npress C in the image window.\n\nA small window appears showing the location of the cursor in the image\nwindow. You are now in crop mode. In crop mode, the Command widget has\nthese options:\n\n    \\fBHelp\\fP\n    \\fBDismiss\\fP\n\n\nTo define a cropping region, press button 1 and drag. The cropping region\nis defined by a highlighted rectangle that expands or contracts as it follows\nthe pointer. Once you are satisfied with the cropping region, release the\nbutton. You are now in rectify mode. In rectify mode, the Command widget\nhas these options:\n\n    \\fBCrop\\fP\n    \\fBHelp\\fP\n    \\fBDismiss\\fP\n\n\nYou can make adjustments by moving the pointer to one of the cropping rectangle\ncorners, pressing a button, and dragging. Finally, press Crop to commit\nyour cropping region. To exit without cropping the image, press Dismiss.\n.SH IMAGE CHOPPING\n\nAn image is chopped interactively. There is no command line argument to\nchop an image. To begin, choose \\fBChop\\fP of the \\fBTransform\\fP sub-menu\nfrom the Command widget. Alternatively,\npress [ in the Image window.\n\nYou are now in \\fBChop\\fP mode. To exit immediately, press\n\\fBDismiss\\fP.\nIn Chop mode, the Command widget has these options:\n\n    \\fBDirection\\fP\n\n    horizontal\n    vertical\n\n    \\fBHelp\\fP\n    \\fBDismiss\\fP\n\n\nIf the you choose the horizontal direction (this is the default), the area\nof the image between the two horizontal endpoints of the chop line is removed.\nOtherwise, the area of the image between the two vertical endpoints of\nthe chop line is removed.\n\nSelect a location within the image window to begin your chop, press and\nhold any button. Next, move the pointer to another location in the image.\nAs you move a line will connect the initial location and the pointer. When\nyou release the button, the area within the image to chop is determined\nby which direction you choose from the Command widget.\n\nTo cancel the image chopping, move the pointer back to the starting point\nof the line and release the button.\n.SH IMAGE ROTATION\n\nPress the / key to rotate the image 90 degrees or \\\\ to rotate -90 degrees.\nTo interactively choose the degree of rotation, choose\n\\fBRotate...\\fP\nof the \\fBTransform\\fP submenu from the Command Widget.\nAlternatively, press * in the image window.\n\nA small horizontal line is drawn next to the pointer. You are now in rotate\nmode. To exit immediately, press Dismiss. In rotate mode, the Command widget\nhas these options:\n\n    \\fBPixel Color\\fP\n\n    black\n    blue\n    cyan\n    green\n    gray\n    red\n    magenta\n    yellow\n    white\n    Browser...\n\n    \\fBDirection\\fP\n\n    horizontal\n    vertical\n\n    \\fBHelp\\fP\n    \\fBDismiss\\fP\n\n\nChoose a background color from the Pixel Color sub-menu. Additional background\ncolors can be specified with the color browser. You can change the menu\ncolors by setting the X resources pen1 through pen9.\n\nIf you choose the color browser and press \\fBGrab\\fP, you can select the\nbackground color by moving the pointer to the desired color on the screen\nand press any button.\n\nChoose a point in the image window and press this button and hold. Next,\nmove the pointer to another location in the image. As you move a line connects\nthe initial location and the pointer. When you release the button, the\ndegree of image rotation is determined by the slope of the line you just\ndrew. The slope is relative to the direction you choose from the Direction\nsub-menu of the Command widget.\n\nTo cancel the image rotation, move the pointer back to the starting point\nof the line and release the button.\n.SH IMAGE ANNOTATION\n\nAn image is annotated interactively. There is no command line argument\nto annotate an image. To begin, choose\n\\fBAnnotate\\fP of the \\fBImage\nEdit\\fP sub-menu from the Command widget. Alternatively,\npress a in the image window.\n\nA small window appears showing the location of the cursor in the image\nwindow. You are now in annotate mode. To exit immediately, press Dismiss.\nIn annotate mode, the Command widget has these options:\n\n    \n\\fBFont Name\\fP\n\n    \nfixed\n    \nvariable\n    \n5x8\n    \n6x10\n    \n7x13bold\n    \n8x13bold\n    \n9x15bold\n    \n10x20\n    \n12x24\n    \nBrowser...\n\n    \n\\fBFont Color\\fP\n\n    \nblack\n    \nblue\n    \ncyan\n    \ngreen\n    \ngray\n    \nred\n    \nmagenta\n    \nyellow\n    \nwhite\n    \ntransparent\n    \nBrowser...\n\n    \n\\fBBox Color\\fP\n\n    \nblack\n    \nblue\n    \ncyan\n    \ngreen\n    \ngray\n    \nred\n    \nmagenta\n    \nyellow\n    \nwhite\n    \ntransparent\n    \nBrowser...\n\n    \n\\fBRotate Text\\fP\n\n    \n-90\n    \n-45\n    \n-30\n    \n0\n    \n30\n    \n45\n    \n90\n    \n180\n    \nDialog...\n\n    \n\\fBHelp\\fP\n    \n\\fBDismiss\\fP\n\n\nChoose a font name from the \\fBFont Name\\fP sub-menu. Additional font\nnames can be specified with the font browser. You can change the menu names\nby setting the X resources font1 through font9.\n\nChoose a font color from the \\fBFont Color\\fP sub-menu. Additional font\ncolors can be specified with the color browser. You can change the menu\ncolors by setting the X resources pen1 through pen9.\n\nIf you select the color browser and press \\fBGrab\\fP, you can choose the\nfont color by moving the pointer to the desired color on the screen and\npress any button.\n\nIf you choose to rotate the text, choose \\fBRotate Text\\fP from the menu\nand select an angle. Typically you will only want to rotate one line of\ntext at a time. Depending on the angle you choose, subsequent lines may\nend up overwriting each other.\n\nChoosing a font and its color is optional. The default font is fixed and\nthe default color is black. However, you must choose a location to begin\nentering text and press a button. An underscore character will appear at\nthe location of the pointer. The cursor changes to a pencil to indicate\nyou are in text mode. To exit immediately, press Dismiss.\n\nIn text mode, any key presses will display the character at the location\nof the underscore and advance the underscore cursor. Enter your text and\nonce completed press Apply to finish your image annotation. To correct\nerrors press \\fBBACK SPACE\\fP. To delete an entire line of text, press\n\\fBDELETE\\fP.\nAny text that exceeds the boundaries of the image window is automatically\ncontinued onto the next line.\n\nThe actual color you request for the font is saved in the image. However,\nthe color that appears in your Image window may be different. For example,\non a monochrome screen the text will appear black or white even if you\nchoose the color red as the font color. However, the image saved to a file\nwith \\fB-write\\fP is written with red lettering. To assure the correct\ncolor text in the final image, any \\fIPseudoClass\\fP image is promoted\nto \\fIDirectClass\\fP (see miff(5)). To force a \\fIPseudoClass\\fP image\nto remain\n\\fIPseudoClass\\fP, use \\fB-colors\\fP.\n.SH IMAGE COMPOSITING\n\nAn image composite is created interactively. \\fBThere is no command line\nargument to composite an image\\fP. To begin, choose \\fBComposite\\fP of\nthe \\fBImage Edit\\fP from the Command widget. Alternatively,\npress x in the Image window.\n\nFirst a popup window is displayed requesting you to enter an image name.\nPress \\fBComposite\\fP, \\fBGrab\\fP or type a file name. Press \\fBCancel\\fP\nif you choose not to create a composite image. When you choose \\fBGrab\\fP,\nmove the pointer to the desired window and press any button.\n\nIf the \\fBComposite\\fP image does not have any matte information, you\nare informed and the file browser is displayed again. Enter the name of\na mask image. The image is typically grayscale and the same size as the\ncomposite image. If the image is not grayscale, it is converted to grayscale\nand the resulting intensities are used as matte information.\n\nA small window appears showing the location of the cursor in the image\nwindow. You are now in composite mode. To exit immediately, press Dismiss.\nIn composite mode, the Command widget has these options:\n\n    \n\\fBOperators\\fP\n\n    \nover\n    \nin\n    \nout\n    \natop\n    \nxor\n    \nplus\n    \nminus\n    \nadd\n    \nsubtract\n    \ndifference\n    \nbumpmap\n    \nreplace\n\n    \n\\fBBlend\\fP\n    \n\\fBDisplace\\fP\n    \n\\fBHelp\\fP\n    \n\\fBDismiss\\fP\n\n\nChoose a composite operation from the Operators sub-menu of the Command\nwidget. How each operator behaves is described below. image window is the\nimage currently displayed on your X server and image is the image obtained\n.TP\n.B \"over\"\n\\fR\nThe result is the union of the two image shapes, with \\fIimage\\fP obscuring\n\\fIimage\nwindow\\fP in the region of overlap.\n.TP\n.B \"in\"\n\\fR\nThe result is simply \\fIimage\\fP cut by the shape of\n\\fIimage window\\fP.\nNone of the image data of image window is in the result.\n.TP\n.B \"out\"\n\\fR\nThe resulting image is \\fIimage\\fP with the shape of\n\\fIimage window\\fP\ncut out.\n.TP\n.B \"atop\"\n\\fR\nThe result is the same shape as \\fIimage window\\fP, with\n\\fIimage\\fP\nobscuring \\fIimage window\\fP where the image shapes overlap. Note this\ndiffers from over because the portion of image outside\n\\fIimage window\\fP's\nshape does not appear in the result.\n.TP\n.B \"xor\"\n\\fR\nThe result is the image data from both \\fIimage\\fP and\n\\fIimage window\\fP\nthat is outside the overlap region. The overlap region is blank.\n.TP\n.B \"plus\"\n\\fR\nThe result is just the sum of the image data. Output values are cropped\nto 255 (no overflow). This operation is independent of the matte channels.\n.TP\n.B \"minus\"\n\\fR\nThe result of \\fIimage\\fP - \\fIimage window\\fP, with underflow cropped\nto zero. The matte channel is ignored (set to 255, full coverage).\n.TP\n.B \"add\"\n\\fR\nThe result of \\fIimage\\fP + \\fIimage window\\fP, with overflow wrapping\naround (mod 256).\n.TP\n.B \"subtract\"\n\\fR\nThe result of \\fIimage\\fP - \\fIimage window\\fP, with underflow wrapping\naround (mod 256). The add and subtract operators can be used to perform\nreversible transformations.\n.TP\n.B \"difference\"\n\\fR\nThe result of abs(\\fIimage\\fP - \\fIimage window\\fP). This is useful for\ncomparing two very similar images.\n.TP\n.B \"bumpmap\"\n\\fR\nThe result of \\fIimage window\\fP shaded by \\fIwindow\\fP.\n.TP\n.B \"replace\"\n\\fR\nThe resulting image is \\fIimage window\\fP replaced with\n\\fIimage\\fP.\nHere the matte information is ignored.\n\nThe image compositor requires a matte, or alpha channel in the image for\nsome operations. This extra channel usually defines a mask which represents\na sort of a cookie-cutter for the image. This is the case when matte is\n255 (full coverage) for pixels inside the shape, zero outside, and between\nzero and 255 on the boundary. If image does not have a matte channel, it\nis initialized with 0 for any pixel matching in color to pixel location\n(0,0), otherwise 255. See Matte Editing for a method\nof defining a matte channel.\n\nIf you choose \\fBblend\\fP, the composite operator becomes \\fBover\\fP.\nThe image matte channel percent transparency is initialized to factor.\nThe image window is initialized to (100-factor). Where factor is the value\nyou specify in the Dialog widget.\n\n\\fBDisplace\\fP shifts the image pixels as defined by a displacement map.\nWith this option, \\fIimage\\fP is used as a displacement map. Black, within\nthe displacement map, is a maximum positive displacement. White is a maximum\nnegative displacement and middle gray is neutral. The displacement is scaled\nto determine the pixel shift. By default, the displacement applies in both\nthe horizontal and vertical directions. However, if you specify\n\\fImask\\fP,\n\\fIimage\\fP\nis the horizontal X displacement and\n\\fImask\\fP the vertical Y displacement.\n\nNote that matte information for image window is not retained for colormapped\nX server visuals (e.g.\n\\fIStaticColor, StaticColor, GrayScale, PseudoColor\\fP).\nCorrect compositing behavior may require a \\fITrueColor\\fP or\n\\fIDirectColor\\fP\nvisual or a \\fIStandard Colormap\\fP.\n\nChoosing a composite operator is optional. The default operator is replace.\nHowever, you must choose a location to composite your image and press button\n1. Press and hold the button before releasing and an outline of the image\nwill appear to help you identify your location.\n\nThe actual colors of the composite image is saved. However, the color that\nappears in image window may be different. For example, on a monochrome\nscreen Image window will appear black or white even though your composited\nimage may have many colors. If the image is saved to a file it is written\nwith the correct colors. To assure the correct colors are saved in the\nfinal image, any PseudoClass image is promoted to \\fIDirectClass\\fP (see\nmiff).\nTo force a \\fIPseudoClass\\fP image to remain \\fIPseudoClass\\fP,\nuse \\fB-colors\\fP.\n.SH COLOR EDITING\n\nChanging the the color of a set of pixels is performed interactively. There\nis no command line argument to edit a pixel. To begin, choose \\fBColor\\fP\nfrom the \\fBImage Edit\\fP submenu of the Command widget.\nAlternatively, press c in the image window.\n\nA small window appears showing the location of the cursor in the image\nwindow. You are now in color edit mode. To exit immediately, press \\fBDismiss\\fP.\nIn color edit mode, the\n\\fBCommand widget\\fP has these options:\n\n    \n\\fBMethod\\fP\n\n    \npoint\n    \nreplace\n    \nfloodfill\n    \nreset\n\n    \n\\fBPixel Color\\fP\n\n    \nblack\n    \nblue\n    \ncyan\n    \ngreen\n    \ngray\n    \nred\n    \nmagenta\n    \nyellow\n    \nwhite\n    \nBrowser...\n\n    \n\\fBBorder Color\\fP\n\n    \nblack\n    \nblue\n    \ncyan\n    \ngreen\n    \ngray\n    \nred\n    \nmagenta\n    \nyellow\n    \nwhite\n    \nBrowser...\n\n    \n\\fBFuzz\\fP\n\n    \n0\n    \n2\n    \n4\n    \n8\n    \n16\n    Dialog...\n\n    \n\\fBUndo\\fP\n    \n\\fBHelp\\fP\n    \n\\fBDismiss\\fP\n\n\nChoose a color editing method from the \\fBMethod\\fP sub-menu of\nthe Command\nwidget. The \\fBpoint method\\fP recolors any pixel selected with the\npointer unless the button is released. The \\fBreplace method\\fP recolors\nany pixel that matches the color of the pixel you select with a button\npress. \\fBFloodfill\\fP recolors any pixel that matches the color of the\npixel you select with a button press and is a neighbor.\nWhereas \\fBfilltoborder\\fP\nchanges the matte value of any neighbor pixel that is not the border color.\nFinally \\fBreset\\fP changes the entire image to the designated color.\n\nNext, choose a pixel color from the \\fBPixel Color\\fP sub-menu. Additional\npixel colors can be specified with the color browser. You can change the\nmenu colors by setting the X resources pen1 through\npen9.\n\nNow press button 1 to select a pixel within the Image window to change\nits color. Additional pixels may be recolored as prescribed by the method\nyou choose. additional pixels by increasing the Delta value.\n\nIf the \\fBMagnify widget\\fP is mapped, it can be helpful in positioning\nyour pointer within the image (refer to button 2). Alternatively you can\nselect a pixel to recolor from within the \\fBMagnify widget\\fP. Move the\npointer to the \\fBMagnify widget\\fP and position the pixel with the cursor\ncontrol keys. Finally, press a button to recolor the selected pixel (or\npixels).\n\nThe actual color you request for the pixels is saved in the image. However,\nthe color that appears in your Image window may be different. For example,\non a monochrome screen the pixel will appear black or white even if you\nchoose the color red as the pixel color. However, the image saved to a\nfile with -write is written with red pixels. To assure the correct color\ntext in the final image, any \\fIPseudoClass\\fP image is promoted\nto \\fIDirectClass\\fP\nTo force a \\fIPseudoClass\\fP image to remain\n\\fIPseudoClass\\fP, use \\fB-colors\\fP.\n.SH MATTE EDITING\n\nMatte information within an image is useful for some operations such as\nimage compositing. This extra channel usually defines\na mask which represents a sort of a cookie-cutter for the image. This is\nthe case when matte is 255 (full coverage) for pixels inside the shape,\nzero outside, and between zero and 255 on the boundary.\n\nSetting the matte information in an image is done interactively. There\nis no command line argument to edit a pixel. To begin, and choose \\fBMatte\\fP\nof the \\fBImage Edit\\fP sub-menu from the Command widget.\n\nAlternatively, press m in the image window.\n\nA small window appears showing the location of the cursor in the image\nwindow. You are now in matte edit mode. To exit immediately, press Dismiss.\nIn matte edit mode, the Command widget has these options:\n\n    \n\\fBMethod\\fP\n\n    \npoint\n    \nreplace\n    \nfloodfill\n    \nreset\n\n    \n\\fBBorder Color\\fP\n\n    \nblack\n    \nblue\n    \ncyan\n    \ngreen\n    \ngray\n    \nred\n    \nmagenta\n    \nyellow\n    \nwhite\n    \nBrowser...\n\n    \n\\fBFuzz\\fP\n\n    \n0\n    \n2\n    \n4\n    \n8\n    \n16\n    Dialog...\n\n    \n\\fBMatte\\fP\n    \n\\fBUndo\\fP\n    \n\\fBHelp\\fP\n    \n\\fBDismiss\\fP\n\nChoose a matte editing method from the \\fBMethod\\fP sub-menu of the Command\nwidget. The \\fBpoint method\\fP changes the matte value of the any\npixel selected with the pointer until the button is released. The \\fBreplace\nmethod\\fP changes the matte value of any pixel that matches the color\nof the pixel you select with a button press. \\fBFloodfill\\fP changes the\nmatte value of any pixel that matches the color of the pixel you select\nwith a button press and is a neighbor. Whereas\n\\fBfilltoborder\\fP recolors\nany neighbor pixel that is not the border color. Finally \\fBreset\\fP changes\nthe entire image to the designated matte value.\nChoose \\fBMatte Value\\fP and a dialog appears requesting a matte value.\nEnter a value between \\fB0 and 255\\fP. This value is assigned as the matte\nvalue of the selected pixel or pixels.\nNow, press any button to select a pixel within the Image window to change\nits matte value. You can change the matte value of additional pixels by\nincreasing the Delta value. The Delta value is first added then subtracted\nfrom the red, green, and blue of the target color. Any pixels within the\nrange also have their matte value updated.\nIf the \\fBMagnify widget\\fP is mapped, it can be helpful in positioning\nyour pointer within the image (refer to button 2). Alternatively you can\nselect a pixel to change the matte value from within the\n\\fBMagnify widget\\fP.\nMove the pointer to the \\fBMagnify widget\\fP and position the pixel with\nthe cursor control keys. Finally, press a button to change the matte value\nof the selected pixel (or pixels).\nMatte information is only valid in a \\fIDirectClass image\\fP. Therefore,\nany \\fIPseudoClass\\fP image is promoted to\n\\fIDirectClass\\fP. Note that\nmatte information for \\fIPseudoClass\\fP is not retained for colormapped\nX server visuals (e.g. \\fIStaticColor, StaticColor, GrayScale, PseudoColor\\fP)\nunless you immediately save your image to a file (refer to Write). Correct\nmatte editing behavior may require a \\fITrueColor\\fP or \\fIDirectColor\\fP\nvisual or a \\fIStandard Colormap\\fP.\n.SH IMAGE DRAWING\n\nAn image is drawn upon interactively. \\fBThere is no command line argument\nto draw on an image\\fP. To begin, choose \\fBDraw\\fP of the Image \\fBEdit\\fP\nsub-menu from the Command widget.\nAlternatively, press d in the image window.\n\nThe cursor changes to a crosshair to indicate you are in draw mode. To\nexit immediately, press Dismiss. In draw mode, the Command widget has these\noptions:\n\n    \n\\fBPrimitive\\fP\n\n    \npoint\n    \nline\n    \nrectangle\n    \nfill rectangle\n    \ncircle\n    \nfill circle\n    \nellipse\n    \nfill ellipse\n    \npolygon\n    \nfill polygon\n\n    \n\\fBColor\\fP\n\n    \nblack\n    \nblue\n    \ncyan\n    \ngreen\n    \ngray\n    \nred\n    \nmagenta\n    \nyellow\n    \nwhite\n    \ntransparent\n    \nBrowser...\n\n    \n\\fBStipple\\fP\n\n    \nBrick\n    \nDiagonal\n    \nScales\n    \nVertical\n    \nWavy\n    \nTranslucent\n    \nOpaque\n    \nOpen...\n\n    \n\\fBWidth\\fP\n\n    \n1\n    \n2\n    \n4\n    \n8\n    \n16\n    Dialog...\n\n    \n\\fBUndo\\fP\n    \n\\fBHelp\\fP\n    \n\\fBDismiss\\fP\n\nChoose a drawing primitive from the \\fBPrimitive\\fP sub-menu.\n\nNext, choose a color from the \\fBColor\\fP sub-menu. Additional colors\ncan be specified with the color browser. You can change the menu colors\nby setting the X resources pen1 through pen9. The transparent\ncolor updates the image matte channel and is useful for image compositing.\n\nIf you choose the color browser and press \\fBGrab\\fP, you can select the\nprimitive color by moving the pointer to the desired color on the screen\nand press any button. The transparent color updates the image matte channel\nand is useful for image compositing.\n\nChoose a stipple, if appropriate, from the \\fBStipple\\fP sub-menu. Additional\nstipples can be specified with the file browser. Stipples obtained from\nthe file browser must be on disk in the X11 bitmap format.\n\nChoose a line width, if appropriate, from the \\fBWidth\\fP sub-menu. To\nchoose a specific width select the \\fBDialog\\fP widget.\n\nChoose a point in the image window and press button 1 and hold. Next, move\nthe pointer to another location in the image. As you move, a line connects\nthe initial location and the pointer. When you release the button, the\nimage is updated with the primitive you just drew. For polygons, the image\nis updated when you press and release the button without moving the pointer.\n\nTo cancel image drawing, move the pointer back to the starting point of\nthe line and release the button.\n.SH REGION OF INTEREST\n\nTo begin, press choose Region of Interest of the Pixel Transform sub-menu\nfrom the Command widget.\nAlternatively, press R in the image window.\n\nA small window appears showing the location of the cursor in the image\nwindow. You are now in region of interest mode. In region of interest mode,\nthe Command widget has these options:\n\n    \n\\fBHelp\\fP\n    \n\\fBDismiss\\fP\n\n\nTo define a region of interest, press button 1 and drag. The region of\ninterest is defined by a highlighted rectangle that expands or contracts\nas it follows the pointer. Once you are satisfied with the region of interest,\nrelease the button. You are now in apply mode. In apply mode the Command\nwidget has these options:\n\n    \n\\fBFile\\fP\n\n    \nSave...\n    \nPrint...\n\n    \n\\fBEdit\\fP\n\n    \nUndo\n    \nRedo\n\n    \n\\fBTransform\\fP\n\n    \nFlip\n    \nFlop\n    \nRotate Right\n    \nRotate Left\n\n    \n\\fBEnhance\\fP\n\n    \nHue...\n    \nSaturation...\n    \nBrightness...\n    \nGamma...\n    \nSpiff\n    \nDull\n    \nEqualize\n    \nNormalize\n    \nNegate\n    \nGRAYscale\n    \nQuantize...\n\n    \n\\fBEffects\\fP\n\n    \nDespeckle\n    \nEmboss\n    \nReduce Noise\n    \nAdd Noise\n    \nSharpen...\n    \nBlur...\n    \nThreshold...\n    \nEdge Detect...\n    \nSpread...\n    \nShade...\n    \nRaise...\n    \nSegment...\n\n\n\n    \n\\fBF/X\\fP\n\n    \nSolarize...\n    \nSwirl...\n    \nImplode...\n    \nWave...\n    \nOil Paint\n    \nCharcoal Draw...\n\n\n\n    \n\\fBMiscellany\\fP\n\n    \nImage Info\n    \nZoom Image\n    \nShow Preview...\n    \nShow Histogram\n    \nShow Matte\n\n    \n\\fBHelp\\fP\n    \n\\fBDismiss\\fP\n\n\nYou can make adjustments to the region of interest by moving the pointer\nto one of the rectangle corners, pressing a button, and dragging. Finally,\nchoose an image processing technique from the Command widget. You can choose\nmore than one image processing technique to apply to an area. Alternatively,\nyou can move the region of interest before applying another image processing\ntechnique. To exit, press Dismiss.\n.SH IMAGE PANNING\n\nWhen an image exceeds the width or height of the X server screen, display\nmaps a small panning icon. The rectangle within the panning icon shows\nthe area that is currently displayed in the the image window. To pan about\nthe image, press any button and drag the pointer within the panning icon.\nThe pan rectangle moves with the pointer and the image window is updated\nto reflect the location of the rectangle within the panning icon. When\nyou have selected the area of the image you wish to view, release the button.\n\nUse the arrow keys to pan the image one pixel up, down, left, or right\nwithin the image window.\n\nThe panning icon is withdrawn if the image becomes smaller than the dimensions\nof the X server screen.\n.SH USER PREFERENCES\n\nPreferences affect the default behavior of \\fBdisplay(1)\\fP. The preferences\nare either true or false and are stored in your home directory\nas .displayrc:\n.in 15\n\n.in 15\n.B \"\n\\fBdisplay image centered on a backdrop\\fP\"\n.in 20\n \\fR\n.in 20\n\nThis backdrop covers the entire workstation screen and is useful for hiding\nother X window activity while viewing the image. The color of the backdrop\nis specified as the background color. Refer to X Resources\nfor details.\n.in 15\n.in 15\n.B \"\n\\fBconfirm on program exit\\fP\"\n.in 20\n \\fR\n.in 20\n\nAsk for a confirmation before exiting the \\fBdisplay(1)\\fP program.\n.in 15\n.in 15\n.B \"\n\\fBcorrect image for display gamma\\fP\"\n.in 20\n \\fR\n.in 20\n\nIf the image has a known gamma, the gamma is corrected to match that of\nthe X server (see the X Resource\\fB displayGamma\\fP).\n.in 15\n.in 15\n.B \"\n\\fBdisplay warning messages\\fP\"\n.in 20\n \\fR\n.in 20\n\nDisplay any warning messages.\n.in 15\n.in 15\n.B \"\n\\fBapply Floyd/Steinberg error diffusion to image\\fP\"\n.in 20\n \\fR\n.in 20\n\nThe basic strategy of dithering is to trade intensity resolution for spatial\nresolution by averaging the intensities of several neighboring pixels.\nImages which suffer from severe contouring when reducing colors can be\nimproved with this preference.\n.in 15\n.in 15\n.B \"\n\\fBuse a shared colormap for colormapped X visuals\\fP\"\n.in 20\n \\fR\n.in 20\n\nThis option only applies when the default X server visual is\n\\fIPseudoColor\\fP\nor \\fIGRAYScale\\fP. Refer to \\fB-visual\\fP for more details. By default,\na shared colormap is allocated. The image shares colors with other X clients.\nSome image colors could be approximated, therefore your image may look\nvery different than intended. Otherwise the image colors appear exactly\nas they are defined. However, other clients may go technicolor when the\nimage colormap is installed.\n.in 15\n.in 15\n.B \"\n\\fBdisplay images as an X server pixmap\\fP\"\n.in 20\n \\fR\n.in 20\n\nImages are maintained as a XImage by default. Set this resource to True\nto utilize a server Pixmap instead. This option is useful if your image\nexceeds the dimensions of your server screen and you intend to pan the\nimage. Panning is much faster with Pixmaps than with a XImage. Pixmaps\nare considered a precious resource, use them with discretion.\n.in 15\n\n.TP\n.in 15\n.in 15\n.in 20\n.SH GM IDENTIFY\n\n\\fBIdentify\\fP describes the format and characteristics of one or\nmore image files as internally supported by the software. It will also\nreport if an image is incomplete or corrupt.  The information\ndisplayed includes the scene number, the file name, the width and\nheight of the image, whether the image is colormapped or not, the\nnumber of colors in the image, the number of bytes in the image, the\nformat of the image (JPEG, PNM, etc.), and finally the number of\nseconds in both user time and elapsed time it took to read and process\nthe image.  If -verbose or +ping are provided as an option, the pixel\nread rate is also displayed. An example line output from\n\\fBidentify\\fP follows:\n\n    images/aquarium.miff 640x480 PseudoClass 256c\n           308135b MIFF 0.000u 0:01\n\n\nIf -verbose is set, expect additional output including any image\ncomment:\n\n\n    Image: images/aquarium.miff\n    class: PseudoClass\n    colors: 256\n    signature: eb5dca81dd93ae7e6ffae99a527eb5dca8...\n    matte: False\n    geometry: 640x480\n       depth: 8\n    bytes: 308135\n    format: MIFF\n    comments:\n    Imported from MTV raster image: aquarium.mtv\n\n\nFor some formats, additional format-specific information about the file\nwill be written if the -debug coder or -debug all option\nis used.\n.SH IDENTIFY OPTIONS\n\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images immediately\nfollowing, until the set is terminated by the appearance of any option\nor \\fB-noop\\fP.\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-authenticate \\fI<string>\"\\fP\n\\fRdecrypt image with this password\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n.TP\n.B \"-format \\fI<string>\"\\fP\n\\fRoutput formatted image characteristics\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-ping\"\n\\fRefficiently determine image characteristics\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n.TP\n.B \"-size \\fI<width>x<height>{+offset}\"\\fP\n\\fRwidth and height of the image\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.SH GM IMPORT\n\n\\fBImport\\fP reads an image from any visible window on an X server and\noutputs it as an image file. You can capture a single window, the entire\nscreen, or any rectangular portion of the screen.\nUse \\fIdisplay\\fP\nfor redisplay, printing, editing, formatting, archiving, image processing,\netc. of the captured image.\n\nThe target window can be specified by id, name, or may be selected\nby clicking the mouse in the desired window. If you press a button and\nthen drag, a rectangle will form which expands and contracts as the mouse\nmoves. To save the portion of the screen defined by the rectangle, just\nrelease the button. The keyboard bell is rung once at the beginning of\nthe screen capture and twice when it completes.\n.SH EXAMPLES\n\nTo select an X window or an area of the screen with the mouse and save it\nin the MIFF image format to a file entitled window.miff, use:\n\n    gm import window.miff\n\n\nTo select an X window or an area of the screen with the mouse and save it\nin the Encapsulated PostScript format to include in another document, use:\n\n    gm import figure.eps\n\n\nTo capture the entire X server screen in the JPEG image format in a file\nentitled root.jpeg, without using the mouse, use:\n\n    gm import -window root root.jpeg\n\n\nTo capture the 512x256 area at the upper right corner of the X server\nscreen in the PNG image format in a well-compressed file entitled corner.png,\nwithout using the mouse,  use:\n\n    gm import -window root -crop 512x256-0+0 -quality 90\n           corner.png\n\n.SH OPTIONS\n\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect until it is explicitly changed by specifying\nthe option again with a different effect.\n\n\\fBImport\\fP options can appear on the command line or in your\nX resources file. See \\fIX(1)\\fP. Options on the command line supersede\nvalues specified in your X resources file.\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-bordercolor \\fI<color>\"\\fP\n\\fRthe border color\n.TP\n.B \"-colors \\fI<value>\"\\fP\n\\fRpreferred number of colors in the image\n.TP\n.B \"-colorspace \\fI<value>\"\\fP\n\\fRthe type of colorspace\n.TP\n.B \"-comment \\fI<string>\"\\fP\n\\fRannotate an image with a comment\n.TP\n.B \"-crop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRpreferred size and location of the cropped image\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-delay \\fI<1/100ths of a second>\"\\fP\n\\fRdisplay the next image after pausing\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n.TP\n.B \"-descend\"\n\\fRobtain image by descending window hierarchy\n.TP\n.B \"-display \\fI<host:display[.screen]>\"\\fP\n\\fRspecifies the X server to contact\n.TP\n.B \"-dispose \\fI<method>\"\\fP\n\\fRGIF disposal method\n.TP\n.B \"-dither\"\n\\fRapply Floyd/Steinberg error diffusion to the image\n.TP\n.B \"-encoding \\fI<type>\"\\fP\n\\fRspecify the text encoding\n.TP\n.B \"-endian \\fI<type>\"\\fP\n\\fRspecify endianness (MSB, LSB, or Native) of image\n.TP\n.B \"-frame\"\n\\fRinclude the X window frame in the imported image\n.TP\n.B \"-geometry \\fI<width>x<height>{+-}<x>{+-}<y>{%}{@}{!}{^}{<}{>}\"\\fP\n\\fRSpecify dimension, offset, and resize options.\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n.TP\n.B \"-label \\fI<name>\"\\fP\n\\fRassign a label to an image\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-monitor\"\n\\fRshow progress indication\n.TP\n.B \"-monochrome\"\n\\fRtransform the image to black and white\n.TP\n.B \"-negate\"\n\\fRreplace every pixel with its complementary color\n.TP\n.B \"-page \\fI<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}\"\\fP\n\\fRsize and location of an image canvas\n.TP\n.B \"-pause \\fI<seconds>\"\\fP\n\\fRpause between snapshots [import]\n.TP\n.B \"-ping\"\n\\fRefficiently determine image characteristics\n.TP\n.B \"-pointsize \\fI<value>\"\\fP\n\\fRpointsize of the PostScript, X11, or TrueType font\n.TP\n.B \"-quality \\fI<value>\"\\fP\n\\fRJPEG/MIFF/PNG/TIFF compression level\n.TP\n.B \"-resize \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image\n.TP\n.B \"-rotate \\fI<degrees>{<}{>}\"\\fP\n\\fRrotate the image\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n.TP\n.B \"-scene \\fI<value>\"\\fP\n\\fRset scene number\n.TP\n.B \"-screen\"\n\\fRspecify the screen to capture\n.TP\n.B \"-set \\fI<attribute> <value>\"\\fP\n\\fRset an image attribute\n.TP\n.B \"+set \\fI<attribute>\"\\fP\n\\fRunset an image attribute\n.TP\n.B \"-silent\"\n\\fRoperate silently\n.TP\n.B \"-snaps \\fI<value>\"\\fP\n\\fRnumber of screen snapshots\n.TP\n.B \"-thumbnail \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image (quickly)\n.TP\n.B \"-transparent \\fI<color>\"\\fP\n\\fRmake this color transparent within the image\n.TP\n.B \"-trim\"\n\\fRtrim an image\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.SH GM MOGRIFY\n\n\\fBMogrify\\fP transforms an image or a sequence of images. These transforms\ninclude image scaling, image rotation, color reduction, and others. Each\ntransmogrified image overwrites the corresponding original image, unless an\noption such as\n\\fB-format\\fP causes the output filename to be different from the input\nfilename.\n\nThe graphics formats supported by \\fBmogrify\\fP are listed in\n\\fIGraphicsMagick(1)\\fP.\n.SH EXAMPLES\n\nTo convert all the TIFF files in a particular directory to JPEG, use:\n\n    gm mogrify -format jpeg *.tiff\n\n\nTo convert a directory full of JPEG images to thumbnails, use:\n\n    gm mogrify -size 120x120 *.jpg -resize 120x120 +profile \"*\"\n\n\nIn this example, '-size 120x120' gives a hint to the JPEG decoder\nthat the images are going to be downscaled to 120x120, allowing it to run\nfaster by avoiding returning full-resolution images to GraphicsMagick for\nthe subsequent resizing operation.  The\n\\'-resize 120x120' specifies the desired dimensions of the\noutput images.  It will be scaled so its largest dimension is 120 pixels.  The\n\\'+profile \"*\"' removes any ICM, EXIF, IPTC, or other profiles\nthat might be present in the input and aren't needed in the thumbnails.\n\nTo scale an image of a cockatoo to exactly 640 pixels in width and 480\npixels in height, use: \n\n    gm mogrify -resize 640x480! cockatoo.miff\n\n.SH OPTIONS\n\nOptions are processed in command line order. Any option you specify on\nthe command line remains in effect for the set of images that follows,\nuntil the set is terminated by the appearance of any option or \\fB-noop\\fP.\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-affine \\fI<matrix>\"\\fP\n\\fRdrawing transform matrix\n.TP\n.B \"-antialias\"\n\\fRremove pixel aliasing\n.TP\n.B \" \\fI-asc-cdl <spec>\"\\fP\n\\fRapply ASC CDL color transform\n.TP\n.B \"-authenticate \\fI<string>\"\\fP\n\\fRdecrypt image with this password\n.TP\n.B \"-auto-orient\"\n\\fRorient (rotate) image so it is upright\n.TP\n.B \"-background \\fI<color>\"\\fP\n\\fRthe background color\n.TP\n.B \"-black-threshold \\fIred[,green][,blue][,opacity]\"\\fP\n\\fRpixels below the threshold become black\n.TP\n.B \"-blue-primary \\fI<x>,<y>\"\\fP\n\\fRblue chromaticity primary point\n.TP\n.B \"-blur \\fI<radius>{x<sigma>}\"\\fP\n\\fRblur the image with a Gaussian operator\n.TP\n.B \"-border \\fI<width>x<height>\"\\fP\n\\fRsurround the image with a border of color\n.TP\n.B \"-bordercolor \\fI<color>\"\\fP\n\\fRthe border color\n.TP\n.B \"-channel \\fI<type>\"\\fP\n\\fRthe type of channel\n.TP\n.B \"-charcoal \\fI<factor>\"\\fP\n\\fRsimulate a charcoal drawing\n.TP\n.B \"-colorize \\fI<value>\"\\fP\n\\fRcolorize the image with the pen color\n.TP\n.B \"-colors \\fI<value>\"\\fP\n\\fRpreferred number of colors in the image\n.TP\n.B \"-colorspace \\fI<value>\"\\fP\n\\fRthe type of colorspace\n.TP\n.B \"-comment \\fI<string>\"\\fP\n\\fRannotate an image with a comment\n.TP\n.B \"-compose \\fI<operator>\"\\fP\n\\fRthe type of image composition\n.TP\n.B \"-compress \\fI<type>\"\\fP\n\\fRthe type of image compression\n.TP\n.B \"-contrast\"\n\\fRenhance or reduce the image contrast\n.TP\n.B \"-convolve \\fI<kernel>\"\\fP\n\\fRconvolve image with the specified convolution kernel\n.TP\n.B \"-create-directories\"\n\\fRcreate output directory if required\n.TP\n.B \"-crop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRpreferred size and location of the cropped image\n.TP\n.B \"-cycle \\fI<amount>\"\\fP\n\\fRdisplace image colormap by amount\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-delay \\fI<1/100ths of a second>\"\\fP\n\\fRdisplay the next image after pausing\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n.TP\n.B \"-despeckle\"\n\\fRreduce the speckles within an image\n.TP\n.B \"-display \\fI<host:display[.screen]>\"\\fP\n\\fRspecifies the X server to contact\n.TP\n.B \"-dispose \\fI<method>\"\\fP\n\\fRGIF disposal method\n.TP\n.B \"-dither\"\n\\fRapply Floyd/Steinberg error diffusion to the image\n.TP\n.B \"-draw \\fI<string>\"\\fP\n\\fRannotate an image with one or more graphic primitives\n.TP\n.B \"-edge \\fI<radius>\"\\fP\n\\fRdetect edges within an image\n.TP\n.B \"-emboss \\fI<radius>\"\\fP\n\\fRemboss an image\n.TP\n.B \"-encoding \\fI<type>\"\\fP\n\\fRspecify the text encoding\n.TP\n.B \"-endian \\fI<type>\"\\fP\n\\fRspecify endianness (MSB, LSB, or Native) of image\n.TP\n.B \"-enhance\"\n\\fRapply a digital filter to enhance a noisy image\n.TP\n.B \"-equalize\"\n\\fRperform histogram equalization to the image\n.TP\n.B \"-extent \\fI<width>x<height>{+-}<x>{+-}<y>\"\\fP\n\\fRcomposite image on background color canvas image\n.TP\n.B \"-fill \\fI<color>\"\\fP\n\\fRcolor to use when filling a graphic primitive\n.TP\n.B \"-filter \\fI<type>\"\\fP\n\\fRuse this type of filter when resizing an image\n.TP\n.B \"-flip\"\n\\fRcreate a \"mirror image\"\n.TP\n.B \"-flop\"\n\\fRcreate a \"mirror image\"\n.TP\n.B \"-font \\fI<name>\"\\fP\n\\fRuse this font when annotating the image with text\n.TP\n.B \"-format \\fI<type>\"\\fP\n\\fRthe image format type\n.TP\n.B \"-frame \\fI<width>x<height>+<outer bevel width>+<inner bevel width>\"\\fP\n\\fRsurround the image with an ornamental border\n.TP\n.B \"-fuzz \\fI<distance>{%}\"\\fP\n\\fRcolors within this Euclidean distance are considered equal\n.TP\n.B \"-gamma \\fI<value>\"\\fP\n\\fRlevel of gamma correction\n.TP\n.B \"-gaussian \\fI<radius>{x<sigma>}\"\\fP\n\\fRblur the image with a Gaussian operator\n.TP\n.B \"-geometry \\fI<width>x<height>{+-}<x>{+-}<y>{%}{@}{!}{^}{<}{>}\"\\fP\n\\fRSpecify dimension, offset, and resize options.\n.TP\n.B \"-gravity \\fI<type>\"\\fP\n\\fRdirection primitive  gravitates to when annotating the image.\n.TP\n.B \"-green-primary \\fI<x>,<y>\"\\fP\n\\fRgreen chromaticity primary point\n.TP\n.B \"-hald-clut \\fI<clut>\"\\fP\n\\fRapply a Hald CLUT to the image\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-implode \\fI<factor>\"\\fP\n\\fRimplode image pixels about the center\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n.TP\n.B \"-label \\fI<name>\"\\fP\n\\fRassign a label to an image\n.TP\n.B \"-lat \\fI<width>x<height>{+-}<offset>{%}\"\\fP\n\\fRperform local adaptive thresholding\n.TP\n.B \"-level \\fI<black_point>{,<gamma>}{,<white_point>}{%}\"\\fP\n\\fRadjust the level of image contrast\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n.TP\n.B \"-linewidth\"\n\\fRthe line width for subsequent draw operations\n.TP\n.B \"-list \\fI<type>\"\\fP\n\\fRthe type of list\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-loop \\fI<iterations>\"\\fP\n\\fRadd Netscape loop extension to your GIF animation\n.TP\n.B \"-magnify\"\n\\fRmagnify the image\n.TP\n.B \"-map \\fI<filename>\"\\fP\n\\fRchoose a particular set of colors from this image\n.TP\n.B \"-mask \\fI<filename>\"\\fP\n\\fRSpecify a clipping mask\n.TP\n.B \"-matte\"\n\\fRstore matte channel if the image has one\n.TP\n.B \"-mattecolor \\fI<color>\"\\fP\n\\fRspecify the color to be used with the \\fB-frame\\fP option\n.TP\n.B \"-median \\fI<radius>\"\\fP\n\\fRapply a median filter to the image\n.TP\n.B \"-minify \\fI<factor>\"\\fP\n\\fRminify the image\n.TP\n.B \"-modulate \\fIbrightness[,saturation[,hue]]\"\\fP\n\\fRvary the brightness, saturation, and hue of an image\n.TP\n.B \"-monitor\"\n\\fRshow progress indication\n.TP\n.B \"-monochrome\"\n\\fRtransform the image to black and white\n.TP\n.B \"-motion-blur \\fI<radius>{x<sigma>}{+angle}\"\\fP\n\\fRSimulate motion blur\n.TP\n.B \"-negate\"\n\\fRreplace every pixel with its complementary color\n.TP\n.B \"-noise \\fI<radius|type>\"\\fP\n\\fRadd or reduce noise in an image\n.TP\n.B \"-noop\"\n\\fRNOOP (no option)\n.TP\n.B \"-normalize\"\n\\fRtransform image to span the full range of color values\n.TP\n.B \"-opaque \\fI<color>\"\\fP\n\\fRchange this color to the pen color within the image\n.TP\n.B \"-operator \\fIchannel operator rvalue[%]\"\\fP\n\\fRapply a mathematical, bitwise, or value operator to an image channel\n.TP\n.B \"-ordered-dither \\fI<channeltype> <NxN>\"\\fP\n\\fRordered dither the image\n.TP\n.B \"-output-directory \\fI<directory>\"\\fP\n\\fRoutput files to directory\n.TP\n.B \"-orient \\fI<orientation>\"\\fP\n\\fRSet the image orientation attribute\n.TP\n.B \"-page \\fI<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}\"\\fP\n\\fRsize and location of an image canvas\n.TP\n.B \"-paint \\fI<radius>\"\\fP\n\\fRsimulate an oil painting\n.TP\n.B \"-pen \\fI<color>\"\\fP\n\\fR(This option has been replaced by the -fill option)\n.TP\n.B \"-pointsize \\fI<value>\"\\fP\n\\fRpointsize of the PostScript, X11, or TrueType font\n.TP\n.B \"-profile \\fI<filename>\"\\fP\n\\fRadd ICM, IPTC, or generic profile  to image\n.TP\n.B \"-preserve-timestamp\"\n\\fRpreserve the original timestamps of the file\n.TP\n.B \"-quality \\fI<value>\"\\fP\n\\fRJPEG/MIFF/PNG/TIFF compression level\n.TP\n.B \"-raise \\fI<width>x<height>\"\\fP\n\\fRlighten or darken image edges\n.TP\n.B \"-random-threshold \\fI<channeltype> <LOWxHIGH>\"\\fP\n\\fRrandom threshold the image\n.TP\n.B \"-recolor \\fI<matrix>\"\\fP\n\\fRapply a color translation matrix to image channels\n.TP\n.B \"-red-primary \\fI<x>,<y>\"\\fP\n\\fRred chromaticity primary point\n.TP\n.B \"-region \\fI<width>x<height>{+-}<x>{+-}<y>\"\\fP\n\\fRapply options to a portion of the image\n.TP\n.B \"-render\"\n\\fRrender vector operations\n.TP\n.B \"-repage \\fI <width>x<height>+xoff+yoff[!]\"\\fP\n\\fRAdjust image page offsets\n.TP\n.B \"-resample \\fI<horizontal>x<vertical>\"\\fP\n\\fRResample image to specified horizontal and vertical resolution\n.TP\n.B \"-resize \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image\n.TP\n.B \"-roll \\fI{+-}<x>{+-}<y>\"\\fP\n\\fRroll an image vertically or horizontally\n.TP\n.B \"-rotate \\fI<degrees>{<}{>}\"\\fP\n\\fRrotate the image\n.TP\n.B \"-sample \\fI<geometry>\"\\fP\n\\fRscale image using pixel sampling\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n.TP\n.B \"-scale \\fI<geometry>\"\\fP\n\\fRscale the image.\n.TP\n.B \"-scene \\fI<value>\"\\fP\n\\fRset scene number\n.TP\n.B \"-set \\fI<attribute> <value>\"\\fP\n\\fRset an image attribute\n.TP\n.B \"+set \\fI<attribute>\"\\fP\n\\fRunset an image attribute\n.TP\n.B \"-segment \\fI<cluster threshold>x<smoothing threshold>\"\\fP\n\\fRsegment an image\n.TP\n.B \"-shade \\fI<azimuth>x<elevation>\"\\fP\n\\fRshade the image using a distant light source\n.TP\n.B \"-sharpen \\fI<radius>{x<sigma>}\"\\fP\n\\fRsharpen the image\n.TP\n.B \"-shave \\fI<width>x<height>{%}\"\\fP\n\\fRshave pixels from the image edges\n.TP\n.B \"-shear \\fI<x degrees>x<y degrees>\"\\fP\n\\fRshear the image along the X or Y axis\n.TP\n.B \"-size \\fI<width>x<height>{+offset}\"\\fP\n\\fRwidth and height of the image\n.TP\n.B \"-solarize \\fI<factor>\"\\fP\n\\fRnegate all pixels above the threshold level\n.TP\n.B \"-spread \\fI<amount>\"\\fP\n\\fRdisplace image pixels by a random amount\n.TP\n.B \"-strip\"\n\\fRremove all profiles and text attributes from the image\n.TP\n.B \"-stroke \\fI<color>\"\\fP\n\\fRcolor to use when stroking a graphic primitive\n.TP\n.B \"-strokewidth \\fI<value>\"\\fP\n\\fRset the stroke width\n.TP\n.B \"-swirl \\fI<degrees>\"\\fP\n\\fRswirl image pixels about the center\n.TP\n.B \"-texture \\fI<filename>\"\\fP\n\\fRname of texture to tile onto the image background\n.TP\n.B \"-threshold \\fI<value>{%}\"\\fP\n\\fRthreshold the image\n.TP\n.B \"-thumbnail \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image (quickly)\n.TP\n.B \"-tile \\fI<filename>\"\\fP\n\\fRtile image when filling a graphic primitive\n.TP\n.B \"-transform\"\n\\fRtransform the image\n.TP\n.B \"-transparent \\fI<color>\"\\fP\n\\fRmake this color transparent within the image\n.TP\n.B \"-treedepth \\fI<value>\"\\fP\n\\fRtree depth for the color reduction algorithm\n.TP\n.B \"-trim\"\n\\fRtrim an image\n.TP\n.B \"-type \\fI<type>\"\\fP\n\\fRthe image type\n.TP\n.B \"-units \\fI<type>\"\\fP\n\\fRthe units of image resolution\n.TP\n.B \"-unsharp \\fI<radius>{x<sigma>}{+<amount>}{+<threshold>}\"\\fP\n\\fRsharpen the image with an unsharp mask operator\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n.TP\n.B \"-view \\fI<string>\"\\fP\n\\fRFlashPix viewing parameters\n.TP\n.B \"-virtual-pixel \\fI<method>\"\\fP\n\\fRspecify contents of \"virtual pixels\"\n.TP\n.B \"-wave \\fI<amplitude>x<wavelength>\"\\fP\n\\fRalter an image along a sine wave\n.TP\n.B \"-white-point \\fI<x>,<y>\"\\fP\n\\fRchromaticity white point\n.TP\n.B \"-white-threshold \\fIred[,green][,blue][,opacity]\"\\fP\n\\fRpixels above the threshold become white\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.SH GM MONTAGE\n\n\\fBmontage\\fP creates a composite image by combining several separate\nimages. The images are tiled on the composite image with the name of the\nimage optionally appearing just below the individual tile.\n\nThe composite image is constructed in the following manner. First, each\nimage specified on the command line, except for the last, is scaled to\nfit the maximum tile size. The maximum tile size by default is 120x120.\nIt can be modified with the \\fB-geometry\\fP command line argument or X\nresource. See\n\\fBOptions\\fP\nfor more information on command line arguments. See\n\\fBX(1)\\fP for more information on X resources.\nNote that the maximum tile size need not be a square.\n\nNext the composite image is initialized with the color specified by the\n\\fB-background\\fP\ncommand line argument or X resource. The width and height of the composite\nimage is determined by the title specified, the maximum tile size, the\nnumber of tiles per row, the tile border width and height, the image border\nwidth, and the label height. The number of tiles per row specifies how\nmany images are to appear in each row of the composite image. The default\nis to have 5 tiles in each row and 4 tiles in each column of the composite.\nA specific value is specified with \\fB-tile\\fP. The tile border width\nand height, and the image border width defaults to the value of the X resource\n\\fB-borderwidth\\fP. It can be changed with the \\fB-borderwidth\\fP or\n\\fB-geometry\\fP command line argument or X resource. The label height\nis determined by the font you specify with the \\fB-font\\fP command line\nargument or X resource. If you do not specify a font, a font is chosen\nthat allows the name of the image to fit the maximum width of a tiled area.\nThe label colors is determined by the \\fB-background\\fP and \\fB-fill\\fP\ncommand line argument or X resource. Note, that if the background and pen\ncolors are the same, labels will not appear.\n\nInitially, the composite image title is placed at the top if one is specified\n(refer to \\fB-fill\\fP). Next, each image is set onto the composite image,\nsurrounded by its border color, with its name centered just below it. The\nindividual images are left-justified within the width of the tiled area.\nThe order of the images is the same as they appear on the command line\nunless the images have a scene keyword. If a scene number is specified\nin each image, then the images are tiled onto the composite in the order\nof their scene number. Finally, the last argument on the command line is\nthe name assigned to the composite image. By default, the image is written\nin the \\fBMIFF\\fP format and can be viewed or printed with\n\\fIdisplay(1)\\fP.\n\n\nNote, that if the number of tiles exceeds the default number of 20 (5 per\nrow, 4 per column), more than one composite image is created. To ensure\na single image is produced, use \\fB-tile\\fP to increase the number of\ntiles to meet or exceed the number of input images.\n\nFinally, to create one or more empty spaces in the sequence of tiles, use\nthe \\fB\"NULL:\"\\fP image format.\n\nNote, a composite MIFF image displayed to an X server with\n\\fBdisplay\\fP\nbehaves differently than other images. You can think of the composite as\na visual image directory. Choose a particular tile of the composite and\npress a button to display it. See \\fBdisplay(1)\\fP and \\fBmiff(5)\\fP\n.SH EXAMPLES\n\nTo create a montage of a cockatoo, a parrot, and a hummingbird and write\nit to a file called birds, use:\n\n    gm montage cockatoo.miff parrot.miff hummingbird.miff\n            birds.miff\n\n\nTo tile several bird images so that they are at most 256 pixels in width\nand 192 pixels in height, surrounded by a red border, and separated by\n10 pixels of background color, use:\n\n    gm montage -geometry 256x192+10+10 -bordercolor red\n            birds.* montage.miff\n\n\nTo create an unlabeled parrot image, 640 by 480 pixels, and surrounded\nby a border of black, use:\n\n    gm montage -geometry 640x480 -bordercolor black\n            -label \"\" parrot.miff bird.miff\n\n\nTo create an image of an eagle with a textured background, use:\n\n    gm montage -texture bumps.jpg eagle.jpg eagle.png\n\n\nTo join several GIF images together without any extraneous graphics (e.g.\nno label, no shadowing, no surrounding tile frame), use:\n\n    gm montage +frame +shadow +label -tile 5x1\n            -geometry 50x50+0+0 *.png joined.png\n\n.SH OPTIONS\n\nAny option you specify on the command line remains in effect for the group\nof images following it, until the group is terminated by the appearance of\nany option or \\fB-noop\\fP.  For example, to make a montage of three images,\nthe first with 32 colors, the second with an unlimited number of colors, and\nthe third with only 16 colors, use:\n\n\n    gm montage -colors 32 cockatoo.1 -noop cockatoo.2\n             -colors 16 cockatoo.3 cockatoos.miff\n\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.TP\n.B \"-adjoin\"\n\\fRjoin images into a single multi-image file\n.TP\n.B \"-affine \\fI<matrix>\"\\fP\n\\fRdrawing transform matrix\n.TP\n.B \"-authenticate \\fI<string>\"\\fP\n\\fRdecrypt image with this password\n.TP\n.B \"-background \\fI<color>\"\\fP\n\\fRthe background color\n.TP\n.B \"-blue-primary \\fI<x>,<y>\"\\fP\n\\fRblue chromaticity primary point\n.TP\n.B \"-blur \\fI<radius>{x<sigma>}\"\\fP\n\\fRblur the image with a Gaussian operator\n.TP\n.B \"-bordercolor \\fI<color>\"\\fP\n\\fRthe border color\n.TP\n.B \"-borderwidth \\fI<geometry>\"\\fP\n\\fRthe border width\n.TP\n.B \"-chop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRremove pixels from the interior of an image\n.TP\n.B \"-colors \\fI<value>\"\\fP\n\\fRpreferred number of colors in the image\n.TP\n.B \"-colorspace \\fI<value>\"\\fP\n\\fRthe type of colorspace\n.TP\n.B \"-comment \\fI<string>\"\\fP\n\\fRannotate an image with a comment\n.TP\n.B \"-compose \\fI<operator>\"\\fP\n\\fRthe type of image composition\n.TP\n.B \"-compress \\fI<type>\"\\fP\n\\fRthe type of image compression\n.TP\n.B \"-crop \\fI<width>x<height>{+-}<x>{+-}<y>{%}\"\\fP\n\\fRpreferred size and location of the cropped image\n.TP\n.B \"-debug \\fI<events>\"\\fP\n\\fRenable debug printout\n.TP\n.B \"-define \\fI<key>{=<value>},...\"\\fP\n\\fRadd coder/decoder specific options\n.TP\n.B \"-density \\fI<width>x<height>\"\\fP\n\\fRhorizontal and vertical resolution in pixels of the image\n.TP\n.B \"-depth \\fI<value>\"\\fP\n\\fRdepth of the image\n.TP\n.B \"-display \\fI<host:display[.screen]>\"\\fP\n\\fRspecifies the X server to contact\n.TP\n.B \"-dispose \\fI<method>\"\\fP\n\\fRGIF disposal method\n.TP\n.B \"-dither\"\n\\fRapply Floyd/Steinberg error diffusion to the image\n.TP\n.B \"-draw \\fI<string>\"\\fP\n\\fRannotate an image with one or more graphic primitives\n.TP\n.B \"-encoding \\fI<type>\"\\fP\n\\fRspecify the text encoding\n.TP\n.B \"-endian \\fI<type>\"\\fP\n\\fRspecify endianness (MSB, LSB, or Native) of image\n.TP\n.B \"-fill \\fI<color>\"\\fP\n\\fRcolor to use when filling a graphic primitive\n.TP\n.B \"-filter \\fI<type>\"\\fP\n\\fRuse this type of filter when resizing an image\n.TP\n.B \"-font \\fI<name>\"\\fP\n\\fRuse this font when annotating the image with text\n.TP\n.B \"-frame \\fI<width>x<height>+<outer bevel width>+<inner bevel width>\"\\fP\n\\fRsurround the image with an ornamental border\n.TP\n.B \"-gamma \\fI<value>\"\\fP\n\\fRlevel of gamma correction\n.TP\n.B \"-geometry \\fI<width>x<height>{+-}<x>{+-}<y>{%}{@}{!}{^}{<}{>}\"\\fP\n\\fRSpecify dimension, offset, and resize options.\n.TP\n.B \"-gravity \\fI<type>\"\\fP\n\\fRdirection primitive  gravitates to when annotating the image.\n.TP\n.B \"-green-primary \\fI<x>,<y>\"\\fP\n\\fRgreen chromaticity primary point\n.TP\n.B \"-help\"\n\\fRprint usage instructions\n.TP\n.B \"-interlace \\fI<type>\"\\fP\n\\fRthe type of interlacing scheme\n.TP\n.B \"-label \\fI<name>\"\\fP\n\\fRassign a label to an image\n.TP\n.B \"-limit \\fI<type> <value>\"\\fP\n\\fRDisk, File, Map, Memory, Pixels, Width, Height or Threads resource limit\n.TP\n.B \"-log \\fI<string>\"\\fP\n\\fRSpecify format for debug log\n.TP\n.B \"-matte\"\n\\fRstore matte channel if the image has one\n.TP\n.B \"-mattecolor \\fI<color>\"\\fP\n\\fRspecify the color to be used with the \\fB-frame\\fP option\n.TP\n.B \"-mode \\fI<value>\"\\fP\n\\fRmode of operation\n.TP\n.B \"-monitor\"\n\\fRshow progress indication\n.TP\n.B \"-monochrome\"\n\\fRtransform the image to black and white\n.TP\n.B \"-noop\"\n\\fRNOOP (no option)\n.TP\n.B \"-page \\fI<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}\"\\fP\n\\fRsize and location of an image canvas\n.TP\n.B \"-pen \\fI<color>\"\\fP\n\\fR(This option has been replaced by the -fill option)\n.TP\n.B \"-pointsize \\fI<value>\"\\fP\n\\fRpointsize of the PostScript, X11, or TrueType font\n.TP\n.B \"-quality \\fI<value>\"\\fP\n\\fRJPEG/MIFF/PNG/TIFF compression level\n.TP\n.B \"-red-primary \\fI<x>,<y>\"\\fP\n\\fRred chromaticity primary point\n.TP\n.B \"-render\"\n\\fRrender vector operations\n.TP\n.B \"-repage \\fI <width>x<height>+xoff+yoff[!]\"\\fP\n\\fRAdjust image page offsets\n.TP\n.B \"-resize \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image\n.TP\n.B \"-rotate \\fI<degrees>{<}{>}\"\\fP\n\\fRrotate the image\n.TP\n.B \"-sampling-factor \\fI<horizontal_factor>x<vertical_factor>\"\\fP\n\\fRchroma subsampling factors\n.TP\n.B \"-scenes \\fI<value-value>\"\\fP\n\\fRrange of image scene numbers to read\n.TP\n.B \"-shadow \\fI<radius>{x<sigma>}\"\\fP\n\\fRshadow the montage\n.TP\n.B \"-sharpen \\fI<radius>{x<sigma>}\"\\fP\n\\fRsharpen the image\n.TP\n.B \"-size \\fI<width>x<height>{+offset}\"\\fP\n\\fRwidth and height of the image\n.TP\n.B \"-strip\"\n\\fRremove all profiles and text attributes from the image\n.TP\n.B \"-stroke \\fI<color>\"\\fP\n\\fRcolor to use when stroking a graphic primitive\n.TP\n.B \"-strokewidth \\fI<value>\"\\fP\n\\fRset the stroke width\n.TP\n.B \"-texture \\fI<filename>\"\\fP\n\\fRname of texture to tile onto the image background\n.TP\n.B \"-thumbnail \\fI<width>x<height>{%}{@}{!}{<}{>}\"\\fP\n\\fRresize an image (quickly)\n.TP\n.B \"-tile \\fI<geometry>\"\\fP\n\\fRlayout of images [\\fImontage\\fP]\n.TP\n.B \"-title \\fI<string>\"\\fP\n\\fRassign title to displayed image [\\fIanimate, display, montage\\fP]\n.TP\n.B \"-transform\"\n\\fRtransform the image\n.TP\n.B \"-transparent \\fI<color>\"\\fP\n\\fRmake this color transparent within the image\n.TP\n.B \"-treedepth \\fI<value>\"\\fP\n\\fRtree depth for the color reduction algorithm\n.TP\n.B \"-trim\"\n\\fRtrim an image\n.TP\n.B \"-type \\fI<type>\"\\fP\n\\fRthe image type\n.TP\n.B \"-verbose\"\n\\fRprint detailed information about the image\n.TP\n.B \"-version\"\n\\fRprint GraphicsMagick version string\n.TP\n.B \"-white-point \\fI<x>,<y>\"\\fP\n\\fRchromaticity white point\n\nFor a more detailed description of each option, see\nOptions, above.\n\n.SH X RESOURCES\n\n\\fBMontage\\fP options can appear on the command line or in your X resource\nfile. Options on the command line supersede values specified in your X\nresource file. See \\fBX(1)\\fP for more information on X resources.\n\nAll \\fBmontage\\fP options have a corresponding X resource. In addition,\n\\fBmontage\\fP\nuses the following X resources:\n.TP\n.B \"background \\fI(class Background)\"\\fP\n\\fRbackground color\n\nSpecifies the preferred color to use for the composite image background.\nThe default is #ccc.\n.TP\n.B \"borderColor \\fI(class BorderColor)\"\\fP\n\\fRborder color\n\nSpecifies the preferred color to use for the composite image border. The\ndefault is #ccc.\n.TP\n.B \"borderWidth \\fI(class BorderWidth)\"\\fP\n\\fRborder width\n\nSpecifies the width in pixels of the composite image border. The default\nis 2.\n.TP\n.B \"font \\fI(class Font)\"\\fP\n\\fRfont to use\n\nSpecifies the name of the preferred font to use when displaying text within\nthe composite image. The default is 9x15, fixed, or 5x8 determined by the\ncomposite image size.\n.TP\n.B \"matteColor \\fI(class MatteColor)\"\\fP\n\\fRcolor of the frame\n\nSpecify the color of an image frame. A 3D effect is achieved by using highlight\nand shadow colors derived from this color. The default value is #697B8F.\n.TP\n.B \"pen \\fI(class Pen)\"\\fP\n\\fRtext color\n\nSpecifies the preferred color to use for text within the composite image.\nThe default is black.\n.TP\n.B \"title \\fI(class Title)\"\\fP\n\\fRcomposite image title\n\nThis resource specifies the title to be placed at the top of the composite\nimage. The default is not to place a title at the top of the composite\nimage.\n.SH GM TIME\n.SH DESCRIPTION\n\n\\fBtime\\fP executes an arbitrary \\fBgm\\fP utility command\n(e.g. \\fBconvert\\fP) and reports the user and elapsed time.  This\nprovides way to measure command execution times similar to the Unix\n\\'time' command but in a portable and consistent way.\n.SH EXAMPLES\nTo obtain time information for the execution of a\ncommand:\n\n% gm time convert input.ppm -gaussian 0x2 output.ppm\nconvert input.ppm -gaussian 0x2 output.ppm    22.60s user 0.00s system 2354% cpu 0.960 total\n\nHere is the interpretation of the above output:\n\n    \\fBuser\\fP - the total user time consumed.\n    \\fBsystem\\fP - the total system time consumed.\n    \\fBtotal\\fP - the total elapsed time consumed.\n\n.SH OPTIONS\nThe time command reqires no options other than the gm command to\nexecute.\n.SH GM VERSION\n.SH DESCRIPTION\n\n\\fBversion\\fP displays the software release version, build quantum\n(pixel sample) depth, web site URL, copyright notice, enabled features\nsupport, configuration parameters, and final build options used to\nbuild the software.  The available information depends on how the\nsoftware was configured and the host system.\n.SH EXAMPLES\nTo display the version information:\n\n  GraphicsMagick 1.3.27a 2017-12-11 Q16 http://www.GraphicsMagick.org/\n  Copyright (C) 2002-2020 GraphicsMagick Group.\n  Additional copyrights and licenses apply to this software.\n  See http://www.GraphicsMagick.org/www/Copyright.html for details.\n  Feature Support:\n    Native Thread Safe       yes\n    Large Files (> 32 bit)   yes\n    Large Memory (> 32 bit)  yes\n    BZIP                     yes\n    DPS                      no\n    FlashPix                 no\n    FreeType                 yes\n    Ghostscript (Library)    no\n    JBIG                     yes\n    JPEG-2000                yes\n    JPEG                     yes\n    Little CMS               yes\n    Loadable Modules         no\n    OpenMP                   yes (201307)\n    PNG                      yes\n    TIFF                     yes\n    TRIO                     no\n    UMEM                     no\n    WebP                     yes\n    WMF                      yes\n    X11                      yes\n    XML                      yes\n    ZLIB                     yes\n  Host type: x86_64-unknown-linux-gnu\n  Configured using the command:\n    ./configure  ...\n  Final Build Parameters:\n    CC       = ...\n    CFLAGS   = ...\n    CPPFLAGS = ...\n    CXX      = ...\n    CXXFLAGS = ...\n    LDFLAGS  = ...\n    LIBS     = ...\n\n.SH OPTIONS\nThe version command does not currently support any options.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/man/man4/miff.4",
    "content": ".ad l\n.nh\n.TH MIFF 4 \"$Date$\" \"ImageMagick\"\n.SH NAME\nMIFF - Magick Image File Format\n.SH SYNOPSIS\n.B #include <image.h>\n.SH DESCRIPTION\nThe Magick Image File Format (MIFF) is a platform-independent format for\nstoring bitmap images.  MIFF is a part of the ImageMagick toolkit of\nimage manipulation utilities for the X Window System.  ImageMagick is\ncapable of converting many different image file formats to and from MIFF\n(e.g. JPEG, XPM, TIFF, etc.).\n\nA MIFF image file consist of two sections.  The first section is a\nheader composed of keys describing the image in text form.  The\nnext section is the binary image data.  The header is separated from\nthe image data by a \\fB:\\fP character immediately followed by a\n\\fBnewline\\fP.\n\nThe MIFF header is composed entirely of LATIN-1 characters.  The fields\nin the header are key and value combination in the\n\\fIkey=value\\fP format, with each key and value separated by an\nequal sign (=).  Each \\fIkey=value\\fP combination is delimited by\nat least one control or whitespace character.  Comments may appear in\nthe header section and are always delimited by braces.  The MIFF header\nalways ends with a colon (:) character, followed by a \\fBctrl-Z\\fP\ncharacter.  It is also common to proceed the colon with a \\fBformfeed\\fP\nand a \\fBnewline\\fP character.  The \\fBformfeed\\fP prevents the listing\nof binary data when using \\fBmore(1)\\fP under Unix where the \\fBctrl-Z\\fP\nhas the same effect with the \\fBtype\\fP command on the Win32 command line.\n\nThe following is a list of \\fIkey=value\\fP combinations that may be\nfound in a MIFF file:\n.TP\n.B \"background-color=\\fIcolor\\fP\"\n.B \"border-color=\\fIcolor\\fP\"\n.B \"matte-color=\\fIcolor\\fP\"\nthese optional keys reflects the image background, border, and matte\ncolors respectively. A color can be a name (e.g. white) or a\nhex value (e.g. #ccc).\n.TP\n.B \"class=\\fIDirectClass\\fP\"\n.B \"class=\\fBPseudoClass\\fP\"\nthe type of binary image data stored in the MIFF file.  If\nthis key is not present, \\fBDirectClass\\fP image data is assumed.\n.TP\n.B \"colors=\\fIvalue\\fP\"\nthe number of colors in a \\fBDirectClass\\fP image. For a\n\\fBPseudoClass\\fP image, this key specifies the size of the\ncolormap.  If this key is not present in the header, and the image\nis \\fBPseudoClass\\fP, a linear 256 color grayscale colormap is used\nwith the image data.  The maximum number of colormap entries is 65535. \n.B \"colorspace=\\fBCMYK\\fP\"\nthe colorspace of the pixel data.  The default is RGB.\n.TP\n.B \"columns=\\fIvalue\\fP\"\nthe width of the image in pixels.  This is a required key and\nhas no default.\n.TP\n.B \"compression=\\fBBZip\\fP\"\n.B \"compression=\\fBFax\\fP\"\n.B \"compression=\\fBJPEG\\fP\"\n.B \"compression=\\fBLZW\\fP\"\n.B \"compression=\\fBRLE\\fP\"\n.B \"compression=\\fBZip\\fP\"\nthe type of algorithm used to compress the image data.  If this\nkey is not present, the image data is assumed to be uncompressed.\n.TP\n.B \"delay \\fI<1/100ths of a second>\\fP\"\nthe interframe delay in an image sequence.  The maximum delay is 65535.\n.TP\n.B \"depth=\\fB8\\fP\"\n.B \"depth=\\fB16\\fP\"\nthe depth of a single color value representing values from 0 to 255\n(depth 8) or 65535 (depth 16).  If this key is absent, a depth of 8 is\nassumed.\n.TP\n.B \"dispose \\fIvalue\\fP\"\nGIF disposal method.\n\nHere are the valid methods:\n\n.nf\n     0  No disposal specified.\n     1  Do not dispose between frames.\n     2  Overwrite frame with background color from header.\n     3  Overwrite with previous frame.\n.fi\n.TP\n.B \"gamma=\\fIvalue\\fP\"\nthe gamma of the image.  If it is not specified, a gamma of 1.0\n(linear brightness response) is assumed,\n.TP\n.B \"id=\\fBImageMagick\\fP\"\nidentifies the file as a MIFF-format image file.  This key\nis required and has no default.  Although this key can appear anywhere\nin the header, it should start as the first key of the header in column\n1.  This will allow programs like \\fBfile\\fP(1) to easily identify the file\nas MIFF.\n.TP\n.B \"iterations \\fIvalue\\fP\"\nthe number of times an image sequence loops before stopping.\n.TP\n.B \"label=\\fI{value}\\fP\"\ndefines a short title or caption for the image.  If\nany whitespace appears in the label, it must be enclosed within braces.\n.TP\n.B \"matte=\\fBTrue\\fP\"\n.B \"matte=\\fBFalse\\fP\"\nspecifies whether a \\fBDirectClass\\fP image has matte data.  Matte data\nis generally useful for image compositing.  This key has no meaning\nfor pseudo-color images.\n.TP\n.B \"montage=\\fI<width>x<height>{\\+-}<x offset>{\\+-}<y offset>\\fP\nsize and location of the individual tiles of a composite image.  See\n\\fBX(1)\\fP for details about the geometry specification.\n\nUse this key when the image is a composite of a number of different\ntiles.  A tile consists of an image and optionally a border and a\nlabel.  \\fI<width>\\fP is the size in pixels of each individual tile in\nthe horizontal direction and \\fI<height>\\fP is the size in the vertical\ndirection.  Each tile must have an equal number of pixels in width and\nequal in height.  However, the width can differ from the height.  \\fI<x\noffset>\\fP is the offset in number of pixels from the vertical edge of\nthe composite image where the first tile of a row begins and \\fI<y\noffset>\\fP is the offset from the horizontal edge where the first tile\nof a column begins.\n\nIf this key is specified, a directory of tile names must follow the\nimage header.  The format of the directory is explained below.\n.TP\n.B \"page=\\fIvalue\\fP\"\npreferred size and location of an image canvas.\n.TP\n.B \"profile-icc=\\fIvalue\\fP\"\nthe number of bytes in the International Color Consortium color profile.\nThe profile is defined by the ICC profile specification located at\nftp://sgigate.sgi.com/pub/icc/icc34.ps.\n.TP\n.B \"colorspace=\\fBRGB\\fP\"\n.TP\n.B \"red-primary=\\fIx,y\\fP\"\n.B \"green-primary=\\fIx,y\\fP\"\n.B \"blue-primary=\\fIx,y\\fP\"\n.B \"white-point=\\fIx,y\\fP\"\nthis optional key reflects the chromaticity primaries and white point.\n.TP\n.B \"rendering-intent=\\fBsaturation\\fP\"\n.B \"rendering-intent=\\fBperceptual\\fP\"\n.B \"rendering-intent=\\fBabsolute\\fP\"\n.B \"rendering-intent=\\fBrelative\\fP\"\nRendering intent is the CSS-1 property that has been defined by the\nInternational Color Consortium (http://www.color.org).\n.TP\n.B \"resolution=\\fI<x-resolution>x<y-resolution>\\fP\"\nvertical and horizontal resolution of the image.  See \\fBunits\\fP\nfor the specific resolution units (e.g. pixels per inch).\n.TP\n.B \"rows=\\fIvalue\\fP\"\nthe height of the image in pixels.  This is a required key\nand has no default.\n.TP\n.B \"scene=\\fIvalue\\fP\"\nthe sequence number for this MIFF image file.  This optional\nkey is used when a MIFF image file is one in a sequence of files\nused in an animation.\n.TP\n.B \"signature=\\fIvalue\\fP\"\nthis optional key contains a string that uniquely identifies\nthe image pixel contents.  NIST's SHA-256 message digest algorithm is\nrecommended.\n.TP\n.B \"units=\\fBpixels-per-inch\\fP\"\n.B \"units=\\fBpixels-per-centimeter\\fP\"\nimage resolution units.\n\nOther key value pairs are permitted.  If a value contains whitespace it\nmust be enclosed with braces as illustrated here:\n\n    id=ImageMagick\n    class=PseudoClass  colors=256\n    compression=RunlengthEncoded  packets=27601\n    columns=1280  rows=1024\n    signature=d79e1c308aa5bbcdeea8ed63df412da9\n    copyright={Copyright (c) 2001 ImageMagick Studio}\n    <FF>\n    :\n\n.PP\nNote that \\fIkey=value\\fP combinations may be separated by newlines or\nspaces and may occur in any order within the header.  Comments (within\nbraces) may appear anywhere before the colon.\n\nIf you specify the \\fBmontage\\fP key in the header, follow\nthe header with a directory of image tiles.  This directory consists of\na name for each tile of the composite image separated by a\n\\fBnewline\\fP character.  The list is terminated with a NULL character.\n\nIf you specify the \\fBcolor-profile\\fP key in the header, follow\nthe header (or montage directory if the \\fBmontage\\fP key is in the\nheader) with the binary color profile.\n\nNext comes the binary image data itself.  How the image\ndata is formatted depends upon the class of the image as specified (or\nnot specified) by the value of the \\fBclass\\fP key in the header.\n\nDirectClass images (class=DirectClass) are continuous-tone, images\nstored as RGB (red, green, blue), RGBA (red, green, blue, alpha), or\nCMYK (cyan, yellow, magenta, black) intensity values as defined by the\ncolorspace key. Each intensity value is one byte in length for\nimages of depth 8 (0..255), whereas, images of depth 16 (0..65535)\nrequire two bytes in most significant byte first order.\n\nPseudoClass images (class=PseudoClass) are colormapped RGB images. The\ncolormap is stored as a series of red, green, and blue pixel values,\neach value being a byte in size. If the image depth is 16, each\ncolormap entry consumes two bytes with the most significant byte being\nfirst. The number of colormap entries is defined by the colors key.\nThe colormap data occurs immediately following the header (or image\ndirectory if the montage key is in the header). PseudoClass image\ndata is an array of index values into the color map. If there are 256\nor fewer colors in the image, each byte of image data contains an index\nvalue. If the image contains more than 256 colors or the image depth is\n16, the index value is stored as two contiguous bytes with the most\nsignificant byte being first. If matte is true, each\ncolormap index is followed by a 1 or 2-byte alpha value.\n\nThe image data in a MIFF file may be uncompressed, runlength encoded,\nZip compressed, or BZip compressed. The compression key in the\nheader defines how the image data is compressed. Uncompressed pixels\nare just stored one scanline at a time in row order. Runlength encoded\ncompression counts runs of identical adjacent pixels and stores the\npixels followed by a length byte (the number of identical pixels minus\n1). Zip and BZip compression compresses each row of an image and\npreceeds the compressed row with the length of compressed pixel bytes\nas a word in most significant byte first order.\n\nMIFF files may contain more than one image.  Simply concatenate each\nindividual image (composed of a header and image data) into one file.\n.SH SEE ALSO\n.B\ndisplay(1), animate(1), import(1), montage(1), mogrify(1), convert(1), more(1), compress(1)\n.SH COPYRIGHT\nCopyright (C) 2000 ImageMagick Studio, a non-profit organization dedicated\nto making software imaging solutions freely available.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (\"ImageMagick\"),\nto deal in ImageMagick without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of ImageMagick, and to permit persons to whom the\nImageMagick is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of ImageMagick.\n\nThe software is provided \"as is\", without warranty of any kind, express or\nimplied, including but not limited to the warranties of merchantability,\nfitness for a particular purpose and noninfringement.  In no event shall\nImageMagick Studio be liable for any claim, damages or other liability,\nwhether in an action of contract, tort or otherwise, arising from, out of\nor in connection with ImageMagick or the use or other dealings in\nImageMagick.\n\nExcept as contained in this notice, the name of the ImageMagick Studio\nshall not be used in advertising or otherwise to promote the sale, use or\nother dealings in ImageMagick without prior written authorization from the\nImageMagick Studio.\n.SH AUTHORS\nJohn Cristy, ImageMagick Studio\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/graphics-magick/share/man/man5/quantize.5",
    "content": ".ad l\n.nh\n.TH quantize 5 \"$Date$\" \"ImageMagick\"\n.SH NAME\nQuantize - ImageMagick's color reduction algorithm.\n.SH SYNOPSIS\n.B #include <magick.h>\n.SH DESCRIPTION\nThis document describes how \\fBImageMagick\\fP performs color reduction on an\nimage.  To fully understand this document, you should have a knowledge\nof basic imaging techniques and the tree data structure and terminology.\n\nFor purposes of color allocation, an image is a set of \\fIn\\fP pixels,\nwhere each pixel is a point in RGB space.  RGB space is a 3-dimensional\nvector space, and each pixel, \\fIp\\d\\s-3i\\s0\\u\\fP,  is defined by an\nordered triple of red, green, and blue coordinates, (\\fIr\\d\\s-3i\\s0\\u,\ng\\d\\s-3i\\s0\\u, b\\d\\s-3i\\s0\\u\\fP).\n\nEach primary color component (red, green, or blue) represents an\nintensity which varies linearly from 0 to a maximum value,\n\\fIc\\d\\s-3max\\s0\\u\\fP, which corresponds to full saturation of that\ncolor.  Color allocation is defined over a domain consisting of the\ncube in RGB space with opposite vertices at (0,0,0) and\n(\\fIc\\d\\s-3max\\s0\\u,c\\d\\s-3max\\s0\\u,c\\d\\s-3max\\s0\\u\\fP).  \\fBImageMagick\\fP\nrequires \\fIc\\d\\s-3max\\s0\\u = 255\\fP.\n\nThe algorithm maps this domain onto a tree in which each node\nrepresents a cube within that domain.  In the following discussion,\nthese cubes are defined by the coordinate of two opposite vertices: The\nvertex nearest the origin in RGB space and the vertex farthest from the\norigin.\n\nThe tree's root node represents the the entire domain, (0,0,0) through\n(\\fIc\\d\\s-3max\\s0\\u,c\\d\\s-3max\\s0\\u,c\\d\\s-3max\\s0\\u\\fP).  Each lower level in\nthe tree is generated by subdividing one node's cube into eight smaller\ncubes of equal size.  This corresponds to bisecting the parent cube\nwith planes passing through the midpoints of each edge.\n\nThe basic algorithm operates in three phases:  \\fBClassification,\nReduction\\fP, and \\fBAssignment\\fP.  \\fBClassification\\fP builds a\ncolor description tree for the image.  \\fBReduction\\fP collapses the\ntree until the number it represents, at most, is the number of colors\ndesired in the output image.  \\fBAssignment\\fP defines the output\nimage's color map and sets each pixel's color by reclassification in\nthe reduced tree. Our goal is to minimize the numerical discrepancies\nbetween the original colors and quantized colors.  To learn more about\nquantization error, see MEASURING COLOR REDUCTION ERROR later in this\ndocument.\n\n\\fBClassification\\fP begins by initializing a color description tree of\nsufficient depth to represent each possible input color in a leaf.\nHowever, it is impractical to generate a fully-formed color description\ntree in the classification phase for realistic values of\n\\fIc\\d\\s-3max\\s0\\u\\fP.  If color components in the input image are\nquantized to \\fIk\\fP-bit precision, so that \\fIc\\d\\s-3max\\s0\\u =\n2\\u\\s-3k\\s0\\d-1\\fP, the tree would need \\fIk\\fP levels below the root\nnode to allow representing each possible input color in a leaf.  This\nbecomes prohibitive because the tree's total number of nodes is\n\n.nf\n        \\s+6\\(*S\\u\\s-9 k\\d\\di=1\\s0 8k\\fP\\s0\\u\n.fi\n.PP\nA complete tree would require 19,173,961 nodes for \\fIk = 8,\nc\\d\\s-3max\\s0\\u = 255\\fP.  Therefore, to avoid building a fully\npopulated tree, \\fBImageMagick\\fP: (1) Initializes data structures for\nnodes only as they are needed; (2) Chooses a maximum depth for the tree\nas a function of the desired number of colors in the output image\n(currently \\fIlog\\d\\s-34\\s0\\u(colormap size)\\+2\\fP).  A tree of this\ndepth generally allows the best representation of the source image with\nthe fastest computational speed and the least amount of memory.\nHowever, the default depth is inappropriate for some images.\nTherefore, the caller can request a specific tree depth.\n\nFor each pixel in the input image, classification scans downward from\nthe root of the color description tree.  At each level of the tree, it\nidentifies the single node which represents a cube in RGB space\ncontaining the pixel's color.  It updates the following data for each\nsuch node:\n.TP\n.B n\\d\\s-31\\s0\\u:\nNumber of pixels whose color is contained in the RGB cube which this\nnode represents;\n.TP\n.B n\\d\\s-32\\s0\\u:\nNumber of pixels whose color is not represented in a node at lower\ndepth in the tree;  initially,  \\fIn\\d\\s-32\\s0\\u = 0\\fP for all nodes\nexcept leaves of the tree.\n.TP\n.B S\\d\\s-3r\\s0\\u, S\\d\\s-3g\\s0\\u, S\\d\\s-3b\\s0\\u:\nSums of the red, green, and blue component values for all pixels not\nclassified at a lower depth.  The combination of these sums and\n\\fIn\\d\\s-32\\s0\\u\\fP will ultimately characterize the mean color of a\nset of pixels represented by this node.\n.TP\n.B E:\nThe distance squared in RGB space between each pixel contained within a\nnode and the nodes' center.  This represents the quantization error for\na node.\n.PP\n\\fBReduction\\fP repeatedly prunes the tree until the number of nodes with\n\\fIn\\d\\s-32\\s0\\u  > 0\\fP is less than or equal to the maximum number of colors\nallowed in the output image.  On any given iteration over the tree, it\nselects those nodes whose \\fIE\\fP value is minimal for pruning and\nmerges their color statistics upward.  It uses a pruning threshold,\n\\fIE\\d\\s-3p\\s0\\u\\fP, to govern node selection as follows:\n\n  E\\d\\s-3p\\s0\\u = 0\n  while number of nodes with (n\\d\\s-32\\s0\\u > 0) > required maximum number of colors\n      prune all nodes such that E <= E\\d\\s-3p\\s0\\u\n      Set E\\d\\s-3p\\s0\\u  to minimum E in remaining nodes\n\nThis has the effect of minimizing any quantization error when\nmerging two nodes together.\n\nWhen a node to be pruned has offspring, the pruning procedure invokes\nitself recursively in order to prune the tree from the leaves upward.\nThe values of \\fIn\\d\\s-32\\s0\\u  S\\d\\s-3r\\s0\\u, S\\d\\s-3g\\s0\\u,\\fP  and\n\\fIS\\d\\s-3b\\s0\\u\\fP in a node being pruned are always added to the\ncorresponding data in that node's parent.  This retains the pruned\nnode's color characteristics for later averaging.\n\nFor each node,  \\fIn\\d\\s-32\\s0\\u\\fP pixels exist for which that node\nrepresents the smallest volume in RGB space containing those pixel's\ncolors.  When \\fIn\\d\\s-32\\s0\\u  > 0\\fP the node will uniquely define a\ncolor in the output image.  At the beginning of reduction,\n\\fIn\\d\\s-32\\s0\\u = 0\\fP  for all nodes except the leaves of the tree\nwhich represent colors present in the input image.\n\nThe other pixel count, \\fIn\\d\\s-31\\s0\\u\\fP,  indicates the total\nnumber of colors within the cubic volume which the node represents.\nThis includes \\fIn\\d\\s-31\\s0\\u - n\\d\\s-32\\s0\\u\\fP pixels whose colors\nshould be defined by nodes at a lower level in the tree.\n\n\\fBAssignment\\fP generates the output image from the pruned tree.  The\noutput image consists of two parts:  (1)  A color map, which is an\narray of color descriptions (RGB triples) for each color present in the\noutput image; (2)  A pixel array, which represents each pixel as an\nindex into the color map array.\n\nFirst, the assignment phase makes one pass over the pruned color\ndescription tree to establish the image's color map.  For each node\nwith \\fIn\\d\\s-32\\s0\\u > 0\\fP, it divides \\fIS\\d\\s-3r\\s0\\u,\nS\\d\\s-3g\\s0\\u\\fP, and \\fPS\\d\\s-3b\\s0\\u\\fP by \\fIn\\d\\s-32\\s0\\u\\fP.  This\nproduces the mean color of all pixels that classify no lower than this\nnode.  Each of these colors becomes an entry in the color map.\n\nFinally, the assignment phase reclassifies each pixel in the pruned\ntree to identify the deepest node containing the pixel's color.  The\npixel's value in the pixel array becomes the index of this node's mean\ncolor in the color map.\n\nEmpirical evidence suggests that distances in color spaces such as\nYUV, or YIQ correspond to perceptual color differences more closely\nthan do distances in RGB space.  These color spaces may give better\nresults when color reducing an image.  Here the algorithm is as described\nexcept each pixel is a point in the alternate color space.  For convenience,\nthe color components are normalized to the range 0 to a maximum value,\n\\fIc\\d\\s-3max\\s0\\u\\fP.  The color reduction can then proceed as described.\n.SH \"MEASURING COLOR REDUCTION ERROR\"\n\nDepending on the image, the color reduction error may be obvious or\ninvisible.  Images with high spatial frequencies (such as hair or\ngrass) will show error much less than pictures with large smoothly\nshaded areas (such as faces).  This is because the high-frequency\ncontour edges introduced by the color reduction process are masked by\nthe high frequencies in the image.\n\nTo measure the difference between the original and color reduced images\n(the total color reduction error), \\fBImageMagick\\fP sums over all pixels\nin an image the distance squared in RGB space between each original\npixel value and its color reduced value. \\fBImageMagick\\fP prints several error\nmeasurements including the mean error per pixel, the normalized mean error,\nand the normalized maximum error.\n\nThe normalized error measurement can be used to compare images.  In\ngeneral, the closer the mean error is to zero the more the quantized\nimage resembles the source image.  Ideally, the error should be\nperceptually-based, since the human eye is the final judge of\nquantization quality.\n\nThese errors are measured and printed when \\fB-verbose\\fP and \\fB-colors\\fI\nare specified on the command line:\n.TP\n.B mean error per pixel:\nis the mean error for any single pixel in the image.\n.TP\n.B normalized mean square error:\nis the normalized mean square quantization error for any single pixel in the\nimage.\n\nThis distance measure is normalized to a range between 0 and 1.  It is\nindependent of the range of red, green, and blue values in the image.\n.TP\n.B normalized maximum square error:\nis the largest normalized square quantization error for any single\npixel in the image.\n\nThis distance measure is normalized to a range between 0 and 1.  It is\nindependent of the range of red, green, and blue values in the image.\n.SH SEE ALSO\n.B\ndisplay(1), animate(1), mogrify(1), import(1), miff(5)\n.SH COPYRIGHT\nCopyright (C) 2002 ImageMagick Studio, a non-profit organization dedicated\nto making software imaging solutions freely available.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (\"ImageMagick\"),\nto deal in ImageMagick without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of ImageMagick, and to permit persons to whom the\nImageMagick is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of ImageMagick.\n\nThe software is provided \"as is\", without warranty of any kind, express or\nimplied, including but not limited to the warranties of merchantability,\nfitness for a particular purpose and noninfringement.  In no event shall\nImageMagick Studio be liable for any claim, damages or other liability,\nwhether in an action of contract, tort or otherwise, arising from, out of\nor in connection with ImageMagick or the use or other dealings in\nImageMagick.\n\nExcept as contained in this notice, the name of the ImageMagick Studio\nshall not be used in advertising or otherwise to promote the sale, use or\nother dealings in ImageMagick without prior written authorization from the\nImageMagick Studio.\n.SH ACKNOWLEDGEMENTS\nPaul Raveling, USC Information Sciences Institute, for the original\nidea of using space subdivision for the color reduction algorithm.\nWith Paul's permission, this document is an adaptation from a document he\nwrote.\n.SH AUTHORS\nJohn Cristy, ImageMagick Studio\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/cv.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OLD_CV_H__\n#define __OPENCV_OLD_CV_H__\n\n#if defined(_MSC_VER)\n    #define CV_DO_PRAGMA(x) __pragma(x)\n    #define __CVSTR2__(x) #x\n    #define __CVSTR1__(x) __CVSTR2__(x)\n    #define __CVMSVCLOC__ __FILE__ \"(\"__CVSTR1__(__LINE__)\") : \"\n    #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (__CVMSVCLOC__ _msg))\n#elif defined(__GNUC__)\n    #define CV_DO_PRAGMA(x) _Pragma (#x)\n    #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (_msg))\n#else\n    #define CV_DO_PRAGMA(x)\n    #define CV_MSG_PRAGMA(_msg)\n#endif\n#define CV_WARNING(x) CV_MSG_PRAGMA(\"Warning: \" #x)\n\n//CV_WARNING(\"This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module\")\n\n#include \"opencv2/core/core_c.h\"\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/imgproc/imgproc_c.h\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/video/tracking.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/flann/flann.hpp\"\n#include \"opencv2/calib3d/calib3d.hpp\"\n#include \"opencv2/objdetect/objdetect.hpp\"\n#include \"opencv2/legacy/compat.hpp\"\n\n#if !defined(CV_IMPL)\n#define CV_IMPL extern \"C\"\n#endif //CV_IMPL\n\n#if defined(__cplusplus)\n#include \"opencv2/core/internal.hpp\"\n#endif //__cplusplus\n\n#endif // __OPENCV_OLD_CV_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/cv.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OLD_CV_HPP__\n#define __OPENCV_OLD_CV_HPP__\n\n//#if defined(__GNUC__)\n//#warning \"This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module\"\n//#endif\n\n#include <cv.h>\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/cvaux.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OLD_AUX_H__\n#define __OPENCV_OLD_AUX_H__\n\n//#if defined(__GNUC__)\n//#warning \"This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module\"\n//#endif\n\n#include \"opencv2/core/core_c.h\"\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/imgproc/imgproc_c.h\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/video/tracking.hpp\"\n#include \"opencv2/video/background_segm.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/calib3d/calib3d.hpp\"\n#include \"opencv2/objdetect/objdetect.hpp\"\n#include \"opencv2/legacy/legacy.hpp\"\n#include \"opencv2/legacy/compat.hpp\"\n#include \"opencv2/legacy/blobtrack.hpp\"\n#include \"opencv2/contrib/contrib.hpp\"\n\n#endif\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/cvaux.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OLD_AUX_HPP__\n#define __OPENCV_OLD_AUX_HPP__\n\n//#if defined(__GNUC__)\n//#warning \"This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module\"\n//#endif\n\n#include <cvaux.h>\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/cvwimage.h",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to\n//  this license.  If you do not agree to this license, do not download,\n//  install, copy or use the software.\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2008, Google, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n//  * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//  * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//  * The name of Intel Corporation or contributors may not be used to endorse\n//     or promote products derived from this software without specific\n//     prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\"\n// and any express or implied warranties, including, but not limited to, the\n// implied warranties of merchantability and fitness for a particular purpose\n// are disclaimed. In no event shall the Intel Corporation or contributors be\n// liable for any direct, indirect, incidental, special, exemplary, or\n// consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n\n\n#ifndef __OPENCV_OLD_WIMAGE_HPP__\n#define __OPENCV_OLD_WIMAGE_HPP__\n\n#include \"opencv2/core/wimage.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/cxcore.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OLD_CXCORE_H__\n#define __OPENCV_OLD_CXCORE_H__\n\n//#if defined(__GNUC__)\n//#warning \"This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module\"\n//#endif\n\n#include \"opencv2/core/core_c.h\"\n#include \"opencv2/core/core.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/cxcore.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OLD_CXCORE_HPP__\n#define __OPENCV_OLD_CXCORE_HPP__\n\n//#if defined(__GNUC__)\n//#warning \"This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module\"\n//#endif\n\n#include <cxcore.h>\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/cxeigen.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OLD_EIGEN_HPP__\n#define __OPENCV_OLD_EIGEN_HPP__\n\n#include \"opencv2/core/eigen.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/cxmisc.h",
    "content": "#ifndef __OPENCV_OLD_CXMISC_H__\n#define __OPENCV_OLD_CXMISC_H__\n\n#include \"opencv2/core/internal.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/highgui.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OLD_HIGHGUI_H__\n#define __OPENCV_OLD_HIGHGUI_H__\n\n#include \"opencv2/core/core_c.h\"\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/highgui/highgui_c.h\"\n#include \"opencv2/highgui/highgui.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv/ml.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OLD_ML_H__\n#define __OPENCV_OLD_ML_H__\n\n#include \"opencv2/core/core_c.h\"\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/ml/ml.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/calib3d/calib3d.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_CALIB3D_HPP__\n#define __OPENCV_CALIB3D_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/core/affine.hpp\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/****************************************************************************************\\\n*                      Camera Calibration, Pose Estimation and Stereo                    *\n\\****************************************************************************************/\n\ntypedef struct CvPOSITObject CvPOSITObject;\n\n/* Allocates and initializes CvPOSITObject structure before doing cvPOSIT */\nCVAPI(CvPOSITObject*)  cvCreatePOSITObject( CvPoint3D32f* points, int point_count );\n\n\n/* Runs POSIT (POSe from ITeration) algorithm for determining 3d position of\n   an object given its model and projection in a weak-perspective case */\nCVAPI(void)  cvPOSIT(  CvPOSITObject* posit_object, CvPoint2D32f* image_points,\n                       double focal_length, CvTermCriteria criteria,\n                       float* rotation_matrix, float* translation_vector);\n\n/* Releases CvPOSITObject structure */\nCVAPI(void)  cvReleasePOSITObject( CvPOSITObject**  posit_object );\n\n/* updates the number of RANSAC iterations */\nCVAPI(int) cvRANSACUpdateNumIters( double p, double err_prob,\n                                   int model_points, int max_iters );\n\nCVAPI(void) cvConvertPointsHomogeneous( const CvMat* src, CvMat* dst );\n\n/* Calculates fundamental matrix given a set of corresponding points */\n#define CV_FM_7POINT 1\n#define CV_FM_8POINT 2\n\n#define CV_LMEDS 4\n#define CV_RANSAC 8\n\n#define CV_FM_LMEDS_ONLY  CV_LMEDS\n#define CV_FM_RANSAC_ONLY CV_RANSAC\n#define CV_FM_LMEDS CV_LMEDS\n#define CV_FM_RANSAC CV_RANSAC\n\nenum\n{\n    CV_ITERATIVE = 0,\n    CV_EPNP = 1, // F.Moreno-Noguer, V.Lepetit and P.Fua \"EPnP: Efficient Perspective-n-Point Camera Pose Estimation\"\n    CV_P3P = 2 // X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang; \"Complete Solution Classification for the Perspective-Three-Point Problem\"\n};\n\nCVAPI(int) cvFindFundamentalMat( const CvMat* points1, const CvMat* points2,\n                                 CvMat* fundamental_matrix,\n                                 int method CV_DEFAULT(CV_FM_RANSAC),\n                                 double param1 CV_DEFAULT(3.), double param2 CV_DEFAULT(0.99),\n                                 CvMat* status CV_DEFAULT(NULL) );\n\n/* For each input point on one of images\n   computes parameters of the corresponding\n   epipolar line on the other image */\nCVAPI(void) cvComputeCorrespondEpilines( const CvMat* points,\n                                         int which_image,\n                                         const CvMat* fundamental_matrix,\n                                         CvMat* correspondent_lines );\n\n/* Triangulation functions */\n\nCVAPI(void) cvTriangulatePoints(CvMat* projMatr1, CvMat* projMatr2,\n                                CvMat* projPoints1, CvMat* projPoints2,\n                                CvMat* points4D);\n\nCVAPI(void) cvCorrectMatches(CvMat* F, CvMat* points1, CvMat* points2,\n                             CvMat* new_points1, CvMat* new_points2);\n\n\n/* Computes the optimal new camera matrix according to the free scaling parameter alpha:\n   alpha=0 - only valid pixels will be retained in the undistorted image\n   alpha=1 - all the source image pixels will be retained in the undistorted image\n*/\nCVAPI(void) cvGetOptimalNewCameraMatrix( const CvMat* camera_matrix,\n                                         const CvMat* dist_coeffs,\n                                         CvSize image_size, double alpha,\n                                         CvMat* new_camera_matrix,\n                                         CvSize new_imag_size CV_DEFAULT(cvSize(0,0)),\n                                         CvRect* valid_pixel_ROI CV_DEFAULT(0),\n                                         int center_principal_point CV_DEFAULT(0));\n\n/* Converts rotation vector to rotation matrix or vice versa */\nCVAPI(int) cvRodrigues2( const CvMat* src, CvMat* dst,\n                         CvMat* jacobian CV_DEFAULT(0) );\n\n/* Finds perspective transformation between the object plane and image (view) plane */\nCVAPI(int) cvFindHomography( const CvMat* src_points,\n                             const CvMat* dst_points,\n                             CvMat* homography,\n                             int method CV_DEFAULT(0),\n                             double ransacReprojThreshold CV_DEFAULT(3),\n                             CvMat* mask CV_DEFAULT(0));\n\n/* Computes RQ decomposition for 3x3 matrices */\nCVAPI(void) cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ,\n                           CvMat *matrixQx CV_DEFAULT(NULL),\n                           CvMat *matrixQy CV_DEFAULT(NULL),\n                           CvMat *matrixQz CV_DEFAULT(NULL),\n                           CvPoint3D64f *eulerAngles CV_DEFAULT(NULL));\n\n/* Computes projection matrix decomposition */\nCVAPI(void) cvDecomposeProjectionMatrix( const CvMat *projMatr, CvMat *calibMatr,\n                                         CvMat *rotMatr, CvMat *posVect,\n                                         CvMat *rotMatrX CV_DEFAULT(NULL),\n                                         CvMat *rotMatrY CV_DEFAULT(NULL),\n                                         CvMat *rotMatrZ CV_DEFAULT(NULL),\n                                         CvPoint3D64f *eulerAngles CV_DEFAULT(NULL));\n\n/* Computes d(AB)/dA and d(AB)/dB */\nCVAPI(void) cvCalcMatMulDeriv( const CvMat* A, const CvMat* B, CvMat* dABdA, CvMat* dABdB );\n\n/* Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)),\n   t3 = rodrigues(r2)*t1 + t2 and the respective derivatives */\nCVAPI(void) cvComposeRT( const CvMat* _rvec1, const CvMat* _tvec1,\n                         const CvMat* _rvec2, const CvMat* _tvec2,\n                         CvMat* _rvec3, CvMat* _tvec3,\n                         CvMat* dr3dr1 CV_DEFAULT(0), CvMat* dr3dt1 CV_DEFAULT(0),\n                         CvMat* dr3dr2 CV_DEFAULT(0), CvMat* dr3dt2 CV_DEFAULT(0),\n                         CvMat* dt3dr1 CV_DEFAULT(0), CvMat* dt3dt1 CV_DEFAULT(0),\n                         CvMat* dt3dr2 CV_DEFAULT(0), CvMat* dt3dt2 CV_DEFAULT(0) );\n\n/* Projects object points to the view plane using\n   the specified extrinsic and intrinsic camera parameters */\nCVAPI(void) cvProjectPoints2( const CvMat* object_points, const CvMat* rotation_vector,\n                              const CvMat* translation_vector, const CvMat* camera_matrix,\n                              const CvMat* distortion_coeffs, CvMat* image_points,\n                              CvMat* dpdrot CV_DEFAULT(NULL), CvMat* dpdt CV_DEFAULT(NULL),\n                              CvMat* dpdf CV_DEFAULT(NULL), CvMat* dpdc CV_DEFAULT(NULL),\n                              CvMat* dpddist CV_DEFAULT(NULL),\n                              double aspect_ratio CV_DEFAULT(0));\n\n/* Finds extrinsic camera parameters from\n   a few known corresponding point pairs and intrinsic parameters */\nCVAPI(void) cvFindExtrinsicCameraParams2( const CvMat* object_points,\n                                          const CvMat* image_points,\n                                          const CvMat* camera_matrix,\n                                          const CvMat* distortion_coeffs,\n                                          CvMat* rotation_vector,\n                                          CvMat* translation_vector,\n                                          int use_extrinsic_guess CV_DEFAULT(0) );\n\n/* Computes initial estimate of the intrinsic camera parameters\n   in case of planar calibration target (e.g. chessboard) */\nCVAPI(void) cvInitIntrinsicParams2D( const CvMat* object_points,\n                                     const CvMat* image_points,\n                                     const CvMat* npoints, CvSize image_size,\n                                     CvMat* camera_matrix,\n                                     double aspect_ratio CV_DEFAULT(1.) );\n\n#define CV_CALIB_CB_ADAPTIVE_THRESH  1\n#define CV_CALIB_CB_NORMALIZE_IMAGE  2\n#define CV_CALIB_CB_FILTER_QUADS     4\n#define CV_CALIB_CB_FAST_CHECK       8\n\n// Performs a fast check if a chessboard is in the input image. This is a workaround to\n// a problem of cvFindChessboardCorners being slow on images with no chessboard\n// - src: input image\n// - size: chessboard size\n// Returns 1 if a chessboard can be in this image and findChessboardCorners should be called,\n// 0 if there is no chessboard, -1 in case of error\nCVAPI(int) cvCheckChessboard(IplImage* src, CvSize size);\n\n    /* Detects corners on a chessboard calibration pattern */\nCVAPI(int) cvFindChessboardCorners( const void* image, CvSize pattern_size,\n                                    CvPoint2D32f* corners,\n                                    int* corner_count CV_DEFAULT(NULL),\n                                    int flags CV_DEFAULT(CV_CALIB_CB_ADAPTIVE_THRESH+CV_CALIB_CB_NORMALIZE_IMAGE) );\n\n/* Draws individual chessboard corners or the whole chessboard detected */\nCVAPI(void) cvDrawChessboardCorners( CvArr* image, CvSize pattern_size,\n                                     CvPoint2D32f* corners,\n                                     int count, int pattern_was_found );\n\n#define CV_CALIB_USE_INTRINSIC_GUESS  1\n#define CV_CALIB_FIX_ASPECT_RATIO     2\n#define CV_CALIB_FIX_PRINCIPAL_POINT  4\n#define CV_CALIB_ZERO_TANGENT_DIST    8\n#define CV_CALIB_FIX_FOCAL_LENGTH 16\n#define CV_CALIB_FIX_K1  32\n#define CV_CALIB_FIX_K2  64\n#define CV_CALIB_FIX_K3  128\n#define CV_CALIB_FIX_K4  2048\n#define CV_CALIB_FIX_K5  4096\n#define CV_CALIB_FIX_K6  8192\n#define CV_CALIB_RATIONAL_MODEL 16384\n\n/* Finds intrinsic and extrinsic camera parameters\n   from a few views of known calibration pattern */\nCVAPI(double) cvCalibrateCamera2( const CvMat* object_points,\n                                const CvMat* image_points,\n                                const CvMat* point_counts,\n                                CvSize image_size,\n                                CvMat* camera_matrix,\n                                CvMat* distortion_coeffs,\n                                CvMat* rotation_vectors CV_DEFAULT(NULL),\n                                CvMat* translation_vectors CV_DEFAULT(NULL),\n                                int flags CV_DEFAULT(0),\n                                CvTermCriteria term_crit CV_DEFAULT(cvTermCriteria(\n                                    CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,DBL_EPSILON)) );\n\n/* Computes various useful characteristics of the camera from the data computed by\n   cvCalibrateCamera2 */\nCVAPI(void) cvCalibrationMatrixValues( const CvMat *camera_matrix,\n                                CvSize image_size,\n                                double aperture_width CV_DEFAULT(0),\n                                double aperture_height CV_DEFAULT(0),\n                                double *fovx CV_DEFAULT(NULL),\n                                double *fovy CV_DEFAULT(NULL),\n                                double *focal_length CV_DEFAULT(NULL),\n                                CvPoint2D64f *principal_point CV_DEFAULT(NULL),\n                                double *pixel_aspect_ratio CV_DEFAULT(NULL));\n\n#define CV_CALIB_FIX_INTRINSIC  256\n#define CV_CALIB_SAME_FOCAL_LENGTH 512\n\n/* Computes the transformation from one camera coordinate system to another one\n   from a few correspondent views of the same calibration target. Optionally, calibrates\n   both cameras */\nCVAPI(double) cvStereoCalibrate( const CvMat* object_points, const CvMat* image_points1,\n                               const CvMat* image_points2, const CvMat* npoints,\n                               CvMat* camera_matrix1, CvMat* dist_coeffs1,\n                               CvMat* camera_matrix2, CvMat* dist_coeffs2,\n                               CvSize image_size, CvMat* R, CvMat* T,\n                               CvMat* E CV_DEFAULT(0), CvMat* F CV_DEFAULT(0),\n                               CvTermCriteria term_crit CV_DEFAULT(cvTermCriteria(\n                                   CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,1e-6)),\n                               int flags CV_DEFAULT(CV_CALIB_FIX_INTRINSIC));\n\n#define CV_CALIB_ZERO_DISPARITY 1024\n\n/* Computes 3D rotations (+ optional shift) for each camera coordinate system to make both\n   views parallel (=> to make all the epipolar lines horizontal or vertical) */\nCVAPI(void) cvStereoRectify( const CvMat* camera_matrix1, const CvMat* camera_matrix2,\n                             const CvMat* dist_coeffs1, const CvMat* dist_coeffs2,\n                             CvSize image_size, const CvMat* R, const CvMat* T,\n                             CvMat* R1, CvMat* R2, CvMat* P1, CvMat* P2,\n                             CvMat* Q CV_DEFAULT(0),\n                             int flags CV_DEFAULT(CV_CALIB_ZERO_DISPARITY),\n                             double alpha CV_DEFAULT(-1),\n                             CvSize new_image_size CV_DEFAULT(cvSize(0,0)),\n                             CvRect* valid_pix_ROI1 CV_DEFAULT(0),\n                             CvRect* valid_pix_ROI2 CV_DEFAULT(0));\n\n/* Computes rectification transformations for uncalibrated pair of images using a set\n   of point correspondences */\nCVAPI(int) cvStereoRectifyUncalibrated( const CvMat* points1, const CvMat* points2,\n                                        const CvMat* F, CvSize img_size,\n                                        CvMat* H1, CvMat* H2,\n                                        double threshold CV_DEFAULT(5));\n\n\n\n/* stereo correspondence parameters and functions */\n\n#define CV_STEREO_BM_NORMALIZED_RESPONSE  0\n#define CV_STEREO_BM_XSOBEL               1\n\n/* Block matching algorithm structure */\ntypedef struct CvStereoBMState\n{\n    // pre-filtering (normalization of input images)\n    int preFilterType; // =CV_STEREO_BM_NORMALIZED_RESPONSE now\n    int preFilterSize; // averaging window size: ~5x5..21x21\n    int preFilterCap; // the output of pre-filtering is clipped by [-preFilterCap,preFilterCap]\n\n    // correspondence using Sum of Absolute Difference (SAD)\n    int SADWindowSize; // ~5x5..21x21\n    int minDisparity;  // minimum disparity (can be negative)\n    int numberOfDisparities; // maximum disparity - minimum disparity (> 0)\n\n    // post-filtering\n    int textureThreshold;  // the disparity is only computed for pixels\n                           // with textured enough neighborhood\n    int uniquenessRatio;   // accept the computed disparity d* only if\n                           // SAD(d) >= SAD(d*)*(1 + uniquenessRatio/100.)\n                           // for any d != d*+/-1 within the search range.\n    int speckleWindowSize; // disparity variation window\n    int speckleRange; // acceptable range of variation in window\n\n    int trySmallerWindows; // if 1, the results may be more accurate,\n                           // at the expense of slower processing\n    CvRect roi1, roi2;\n    int disp12MaxDiff;\n\n    // temporary buffers\n    CvMat* preFilteredImg0;\n    CvMat* preFilteredImg1;\n    CvMat* slidingSumBuf;\n    CvMat* cost;\n    CvMat* disp;\n} CvStereoBMState;\n\n#define CV_STEREO_BM_BASIC 0\n#define CV_STEREO_BM_FISH_EYE 1\n#define CV_STEREO_BM_NARROW 2\n\nCVAPI(CvStereoBMState*) cvCreateStereoBMState(int preset CV_DEFAULT(CV_STEREO_BM_BASIC),\n                                              int numberOfDisparities CV_DEFAULT(0));\n\nCVAPI(void) cvReleaseStereoBMState( CvStereoBMState** state );\n\nCVAPI(void) cvFindStereoCorrespondenceBM( const CvArr* left, const CvArr* right,\n                                          CvArr* disparity, CvStereoBMState* state );\n\nCVAPI(CvRect) cvGetValidDisparityROI( CvRect roi1, CvRect roi2, int minDisparity,\n                                      int numberOfDisparities, int SADWindowSize );\n\nCVAPI(void) cvValidateDisparity( CvArr* disparity, const CvArr* cost,\n                                 int minDisparity, int numberOfDisparities,\n                                 int disp12MaxDiff CV_DEFAULT(1) );\n\n/* Reprojects the computed disparity image to the 3D space using the specified 4x4 matrix */\nCVAPI(void)  cvReprojectImageTo3D( const CvArr* disparityImage,\n                                   CvArr* _3dImage, const CvMat* Q,\n                                   int handleMissingValues CV_DEFAULT(0) );\n\n\n#ifdef __cplusplus\n}\n\n//////////////////////////////////////////////////////////////////////////////////////////\nclass CV_EXPORTS CvLevMarq\n{\npublic:\n    CvLevMarq();\n    CvLevMarq( int nparams, int nerrs, CvTermCriteria criteria=\n              cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON),\n              bool completeSymmFlag=false );\n    ~CvLevMarq();\n    void init( int nparams, int nerrs, CvTermCriteria criteria=\n              cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON),\n              bool completeSymmFlag=false );\n    bool update( const CvMat*& param, CvMat*& J, CvMat*& err );\n    bool updateAlt( const CvMat*& param, CvMat*& JtJ, CvMat*& JtErr, double*& errNorm );\n\n    void clear();\n    void step();\n    enum { DONE=0, STARTED=1, CALC_J=2, CHECK_ERR=3 };\n\n    cv::Ptr<CvMat> mask;\n    cv::Ptr<CvMat> prevParam;\n    cv::Ptr<CvMat> param;\n    cv::Ptr<CvMat> J;\n    cv::Ptr<CvMat> err;\n    cv::Ptr<CvMat> JtJ;\n    cv::Ptr<CvMat> JtJN;\n    cv::Ptr<CvMat> JtErr;\n    cv::Ptr<CvMat> JtJV;\n    cv::Ptr<CvMat> JtJW;\n    double prevErrNorm, errNorm;\n    int lambdaLg10;\n    CvTermCriteria criteria;\n    int state;\n    int iters;\n    bool completeSymmFlag;\n};\n\nnamespace cv\n{\n//! converts rotation vector to rotation matrix or vice versa using Rodrigues transformation\nCV_EXPORTS_W void Rodrigues(InputArray src, OutputArray dst, OutputArray jacobian=noArray());\n\n//! type of the robust estimation algorithm\nenum\n{\n    LMEDS=CV_LMEDS, //!< least-median algorithm\n    RANSAC=CV_RANSAC //!< RANSAC algorithm\n};\n\n//! computes the best-fit perspective transformation mapping srcPoints to dstPoints.\nCV_EXPORTS_W Mat findHomography( InputArray srcPoints, InputArray dstPoints,\n                                 int method=0, double ransacReprojThreshold=3,\n                                 OutputArray mask=noArray());\n\n//! variant of findHomography for backward compatibility\nCV_EXPORTS Mat findHomography( InputArray srcPoints, InputArray dstPoints,\n                               OutputArray mask, int method=0, double ransacReprojThreshold=3);\n\n//! Computes RQ decomposition of 3x3 matrix\nCV_EXPORTS_W Vec3d RQDecomp3x3( InputArray src, OutputArray mtxR, OutputArray mtxQ,\n                                OutputArray Qx=noArray(),\n                                OutputArray Qy=noArray(),\n                                OutputArray Qz=noArray());\n\n//! Decomposes the projection matrix into camera matrix and the rotation martix and the translation vector\nCV_EXPORTS_W void decomposeProjectionMatrix( InputArray projMatrix, OutputArray cameraMatrix,\n                                             OutputArray rotMatrix, OutputArray transVect,\n                                             OutputArray rotMatrixX=noArray(),\n                                             OutputArray rotMatrixY=noArray(),\n                                             OutputArray rotMatrixZ=noArray(),\n                                             OutputArray eulerAngles=noArray() );\n\n//! computes derivatives of the matrix product w.r.t each of the multiplied matrix coefficients\nCV_EXPORTS_W void matMulDeriv( InputArray A, InputArray B,\n                               OutputArray dABdA,\n                               OutputArray dABdB );\n\n//! composes 2 [R|t] transformations together. Also computes the derivatives of the result w.r.t the arguments\nCV_EXPORTS_W void composeRT( InputArray rvec1, InputArray tvec1,\n                             InputArray rvec2, InputArray tvec2,\n                             OutputArray rvec3, OutputArray tvec3,\n                             OutputArray dr3dr1=noArray(), OutputArray dr3dt1=noArray(),\n                             OutputArray dr3dr2=noArray(), OutputArray dr3dt2=noArray(),\n                             OutputArray dt3dr1=noArray(), OutputArray dt3dt1=noArray(),\n                             OutputArray dt3dr2=noArray(), OutputArray dt3dt2=noArray() );\n\n//! projects points from the model coordinate space to the image coordinates. Also computes derivatives of the image coordinates w.r.t the intrinsic and extrinsic camera parameters\nCV_EXPORTS_W void projectPoints( InputArray objectPoints,\n                                 InputArray rvec, InputArray tvec,\n                                 InputArray cameraMatrix, InputArray distCoeffs,\n                                 OutputArray imagePoints,\n                                 OutputArray jacobian=noArray(),\n                                 double aspectRatio=0 );\n\n//! computes the camera pose from a few 3D points and the corresponding projections. The outliers are not handled.\nenum\n{\n    ITERATIVE=CV_ITERATIVE,\n    EPNP=CV_EPNP,\n    P3P=CV_P3P\n};\nCV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints,\n                            InputArray cameraMatrix, InputArray distCoeffs,\n                            OutputArray rvec, OutputArray tvec,\n                            bool useExtrinsicGuess=false, int flags=ITERATIVE);\n\n//! computes the camera pose from a few 3D points and the corresponding projections. The outliers are possible.\nCV_EXPORTS_W void solvePnPRansac( InputArray objectPoints,\n                                  InputArray imagePoints,\n                                  InputArray cameraMatrix,\n                                  InputArray distCoeffs,\n                                  OutputArray rvec,\n                                  OutputArray tvec,\n                                  bool useExtrinsicGuess = false,\n                                  int iterationsCount = 100,\n                                  float reprojectionError = 8.0,\n                                  int minInliersCount = 100,\n                                  OutputArray inliers = noArray(),\n                                  int flags = ITERATIVE);\n\n//! initializes camera matrix from a few 3D points and the corresponding projections.\nCV_EXPORTS_W Mat initCameraMatrix2D( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints,\n                                     Size imageSize, double aspectRatio=1. );\n\nenum { CALIB_CB_ADAPTIVE_THRESH = 1, CALIB_CB_NORMALIZE_IMAGE = 2,\n       CALIB_CB_FILTER_QUADS = 4, CALIB_CB_FAST_CHECK = 8 };\n\n//! finds checkerboard pattern of the specified size in the image\nCV_EXPORTS_W bool findChessboardCorners( InputArray image, Size patternSize,\n                                         OutputArray corners,\n                                         int flags=CALIB_CB_ADAPTIVE_THRESH+CALIB_CB_NORMALIZE_IMAGE );\n\n//! finds subpixel-accurate positions of the chessboard corners\nCV_EXPORTS bool find4QuadCornerSubpix(InputArray img, InputOutputArray corners, Size region_size);\n\n//! draws the checkerboard pattern (found or partly found) in the image\nCV_EXPORTS_W void drawChessboardCorners( InputOutputArray image, Size patternSize,\n                                         InputArray corners, bool patternWasFound );\n\nenum { CALIB_CB_SYMMETRIC_GRID = 1, CALIB_CB_ASYMMETRIC_GRID = 2,\n       CALIB_CB_CLUSTERING = 4 };\n\n//! finds circles' grid pattern of the specified size in the image\nCV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize,\n                                 OutputArray centers, int flags=CALIB_CB_SYMMETRIC_GRID,\n                                 const Ptr<FeatureDetector> &blobDetector = new SimpleBlobDetector());\n\n//! the deprecated function. Use findCirclesGrid() instead of it.\nCV_EXPORTS_W bool findCirclesGridDefault( InputArray image, Size patternSize,\n                                          OutputArray centers, int flags=CALIB_CB_SYMMETRIC_GRID );\nenum\n{\n    CALIB_USE_INTRINSIC_GUESS = CV_CALIB_USE_INTRINSIC_GUESS,\n    CALIB_FIX_ASPECT_RATIO = CV_CALIB_FIX_ASPECT_RATIO,\n    CALIB_FIX_PRINCIPAL_POINT = CV_CALIB_FIX_PRINCIPAL_POINT,\n    CALIB_ZERO_TANGENT_DIST = CV_CALIB_ZERO_TANGENT_DIST,\n    CALIB_FIX_FOCAL_LENGTH = CV_CALIB_FIX_FOCAL_LENGTH,\n    CALIB_FIX_K1 = CV_CALIB_FIX_K1,\n    CALIB_FIX_K2 = CV_CALIB_FIX_K2,\n    CALIB_FIX_K3 = CV_CALIB_FIX_K3,\n    CALIB_FIX_K4 = CV_CALIB_FIX_K4,\n    CALIB_FIX_K5 = CV_CALIB_FIX_K5,\n    CALIB_FIX_K6 = CV_CALIB_FIX_K6,\n    CALIB_RATIONAL_MODEL = CV_CALIB_RATIONAL_MODEL,\n    // only for stereo\n    CALIB_FIX_INTRINSIC = CV_CALIB_FIX_INTRINSIC,\n    CALIB_SAME_FOCAL_LENGTH = CV_CALIB_SAME_FOCAL_LENGTH,\n    // for stereo rectification\n    CALIB_ZERO_DISPARITY = CV_CALIB_ZERO_DISPARITY\n};\n\n//! finds intrinsic and extrinsic camera parameters from several fews of a known calibration pattern.\nCV_EXPORTS_W double calibrateCamera( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints,\n                                     Size imageSize,\n                                     CV_OUT InputOutputArray cameraMatrix,\n                                     CV_OUT InputOutputArray distCoeffs,\n                                     OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,\n                                     int flags=0, TermCriteria criteria = TermCriteria(\n                                         TermCriteria::COUNT+TermCriteria::EPS, 30, DBL_EPSILON) );\n\n//! computes several useful camera characteristics from the camera matrix, camera frame resolution and the physical sensor size.\nCV_EXPORTS_W void calibrationMatrixValues( InputArray cameraMatrix,\n                                Size imageSize,\n                                double apertureWidth,\n                                double apertureHeight,\n                                CV_OUT double& fovx,\n                                CV_OUT double& fovy,\n                                CV_OUT double& focalLength,\n                                CV_OUT Point2d& principalPoint,\n                                CV_OUT double& aspectRatio );\n\n//! finds intrinsic and extrinsic parameters of a stereo camera\nCV_EXPORTS_W double stereoCalibrate( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints1,\n                                     InputArrayOfArrays imagePoints2,\n                                     CV_OUT InputOutputArray cameraMatrix1,\n                                     CV_OUT InputOutputArray distCoeffs1,\n                                     CV_OUT InputOutputArray cameraMatrix2,\n                                     CV_OUT InputOutputArray distCoeffs2,\n                                     Size imageSize, OutputArray R,\n                                     OutputArray T, OutputArray E, OutputArray F,\n                                     TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6),\n                                     int flags=CALIB_FIX_INTRINSIC );\n\n\n//! computes the rectification transformation for a stereo camera from its intrinsic and extrinsic parameters\nCV_EXPORTS_W void stereoRectify( InputArray cameraMatrix1, InputArray distCoeffs1,\n                               InputArray cameraMatrix2, InputArray distCoeffs2,\n                               Size imageSize, InputArray R, InputArray T,\n                               OutputArray R1, OutputArray R2,\n                               OutputArray P1, OutputArray P2,\n                               OutputArray Q, int flags=CALIB_ZERO_DISPARITY,\n                               double alpha=-1, Size newImageSize=Size(),\n                               CV_OUT Rect* validPixROI1=0, CV_OUT Rect* validPixROI2=0 );\n\n//! computes the rectification transformation for an uncalibrated stereo camera (zero distortion is assumed)\nCV_EXPORTS_W bool stereoRectifyUncalibrated( InputArray points1, InputArray points2,\n                                             InputArray F, Size imgSize,\n                                             OutputArray H1, OutputArray H2,\n                                             double threshold=5 );\n\n//! computes the rectification transformations for 3-head camera, where all the heads are on the same line.\nCV_EXPORTS_W float rectify3Collinear( InputArray cameraMatrix1, InputArray distCoeffs1,\n                                      InputArray cameraMatrix2, InputArray distCoeffs2,\n                                      InputArray cameraMatrix3, InputArray distCoeffs3,\n                                      InputArrayOfArrays imgpt1, InputArrayOfArrays imgpt3,\n                                      Size imageSize, InputArray R12, InputArray T12,\n                                      InputArray R13, InputArray T13,\n                                      OutputArray R1, OutputArray R2, OutputArray R3,\n                                      OutputArray P1, OutputArray P2, OutputArray P3,\n                                      OutputArray Q, double alpha, Size newImgSize,\n                                      CV_OUT Rect* roi1, CV_OUT Rect* roi2, int flags );\n\n//! returns the optimal new camera matrix\nCV_EXPORTS_W Mat getOptimalNewCameraMatrix( InputArray cameraMatrix, InputArray distCoeffs,\n                                            Size imageSize, double alpha, Size newImgSize=Size(),\n                                            CV_OUT Rect* validPixROI=0, bool centerPrincipalPoint=false);\n\n//! converts point coordinates from normal pixel coordinates to homogeneous coordinates ((x,y)->(x,y,1))\nCV_EXPORTS_W void convertPointsToHomogeneous( InputArray src, OutputArray dst );\n\n//! converts point coordinates from homogeneous to normal pixel coordinates ((x,y,z)->(x/z, y/z))\nCV_EXPORTS_W void convertPointsFromHomogeneous( InputArray src, OutputArray dst );\n\n//! for backward compatibility\nCV_EXPORTS void convertPointsHomogeneous( InputArray src, OutputArray dst );\n\n//! the algorithm for finding fundamental matrix\nenum\n{\n    FM_7POINT = CV_FM_7POINT, //!< 7-point algorithm\n    FM_8POINT = CV_FM_8POINT, //!< 8-point algorithm\n    FM_LMEDS = CV_FM_LMEDS,  //!< least-median algorithm\n    FM_RANSAC = CV_FM_RANSAC  //!< RANSAC algorithm\n};\n\n//! finds fundamental matrix from a set of corresponding 2D points\nCV_EXPORTS_W Mat findFundamentalMat( InputArray points1, InputArray points2,\n                                     int method=FM_RANSAC,\n                                     double param1=3., double param2=0.99,\n                                     OutputArray mask=noArray());\n\n//! variant of findFundamentalMat for backward compatibility\nCV_EXPORTS Mat findFundamentalMat( InputArray points1, InputArray points2,\n                                   OutputArray mask, int method=FM_RANSAC,\n                                   double param1=3., double param2=0.99);\n\n//! finds coordinates of epipolar lines corresponding the specified points\nCV_EXPORTS_W void computeCorrespondEpilines( InputArray points,\n                                             int whichImage, InputArray F,\n                                             OutputArray lines );\n\nCV_EXPORTS_W void triangulatePoints( InputArray projMatr1, InputArray projMatr2,\n                                     InputArray projPoints1, InputArray projPoints2,\n                                     OutputArray points4D );\n\nCV_EXPORTS_W void correctMatches( InputArray F, InputArray points1, InputArray points2,\n                                  OutputArray newPoints1, OutputArray newPoints2 );\n\ntemplate<> CV_EXPORTS void Ptr<CvStereoBMState>::delete_obj();\n\n/*!\n Block Matching Stereo Correspondence Algorithm\n\n The class implements BM stereo correspondence algorithm by K. Konolige.\n*/\nclass CV_EXPORTS_W StereoBM\n{\npublic:\n    enum { PREFILTER_NORMALIZED_RESPONSE = 0, PREFILTER_XSOBEL = 1,\n        BASIC_PRESET=0, FISH_EYE_PRESET=1, NARROW_PRESET=2 };\n\n    //! the default constructor\n    CV_WRAP StereoBM();\n    //! the full constructor taking the camera-specific preset, number of disparities and the SAD window size\n    CV_WRAP StereoBM(int preset, int ndisparities=0, int SADWindowSize=21);\n    //! the method that reinitializes the state. The previous content is destroyed\n    void init(int preset, int ndisparities=0, int SADWindowSize=21);\n    //! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair\n    CV_WRAP_AS(compute) void operator()( InputArray left, InputArray right,\n                                         OutputArray disparity, int disptype=CV_16S );\n\n    //! pointer to the underlying CvStereoBMState\n    Ptr<CvStereoBMState> state;\n};\n\n\n/*!\n Semi-Global Block Matching Stereo Correspondence Algorithm\n\n The class implements the original SGBM stereo correspondence algorithm by H. Hirschmuller and some its modification.\n */\nclass CV_EXPORTS_W StereoSGBM\n{\npublic:\n    enum { DISP_SHIFT=4, DISP_SCALE = (1<<DISP_SHIFT) };\n\n    //! the default constructor\n    CV_WRAP StereoSGBM();\n\n    //! the full constructor taking all the necessary algorithm parameters\n    CV_WRAP StereoSGBM(int minDisparity, int numDisparities, int SADWindowSize,\n               int P1=0, int P2=0, int disp12MaxDiff=0,\n               int preFilterCap=0, int uniquenessRatio=0,\n               int speckleWindowSize=0, int speckleRange=0,\n               bool fullDP=false);\n    //! the destructor\n    virtual ~StereoSGBM();\n\n    //! the stereo correspondence operator that computes disparity map for the specified rectified stereo pair\n    CV_WRAP_AS(compute) virtual void operator()(InputArray left, InputArray right,\n                                                OutputArray disp);\n\n    CV_PROP_RW int minDisparity;\n    CV_PROP_RW int numberOfDisparities;\n    CV_PROP_RW int SADWindowSize;\n    CV_PROP_RW int preFilterCap;\n    CV_PROP_RW int uniquenessRatio;\n    CV_PROP_RW int P1;\n    CV_PROP_RW int P2;\n    CV_PROP_RW int speckleWindowSize;\n    CV_PROP_RW int speckleRange;\n    CV_PROP_RW int disp12MaxDiff;\n    CV_PROP_RW bool fullDP;\n\nprotected:\n    Mat buffer;\n};\n\n//! filters off speckles (small regions of incorrectly computed disparity)\nCV_EXPORTS_W void filterSpeckles( InputOutputArray img, double newVal, int maxSpeckleSize, double maxDiff,\n                                  InputOutputArray buf=noArray() );\n\n//! computes valid disparity ROI from the valid ROIs of the rectified images (that are returned by cv::stereoRectify())\nCV_EXPORTS_W Rect getValidDisparityROI( Rect roi1, Rect roi2,\n                                        int minDisparity, int numberOfDisparities,\n                                        int SADWindowSize );\n\n//! validates disparity using the left-right check. The matrix \"cost\" should be computed by the stereo correspondence algorithm\nCV_EXPORTS_W void validateDisparity( InputOutputArray disparity, InputArray cost,\n                                     int minDisparity, int numberOfDisparities,\n                                     int disp12MaxDisp=1 );\n\n//! reprojects disparity image to 3D: (x,y,d)->(X,Y,Z) using the matrix Q returned by cv::stereoRectify\nCV_EXPORTS_W void reprojectImageTo3D( InputArray disparity,\n                                      OutputArray _3dImage, InputArray Q,\n                                      bool handleMissingValues=false,\n                                      int ddepth=-1 );\n\nCV_EXPORTS_W  int estimateAffine3D(InputArray src, InputArray dst,\n                                   OutputArray out, OutputArray inliers,\n                                   double ransacThreshold=3, double confidence=0.99);\n\nnamespace fisheye\n{\n    enum{\n        CALIB_USE_INTRINSIC_GUESS   = 1,\n        CALIB_RECOMPUTE_EXTRINSIC   = 2,\n        CALIB_CHECK_COND            = 4,\n        CALIB_FIX_SKEW              = 8,\n        CALIB_FIX_K1                = 16,\n        CALIB_FIX_K2                = 32,\n        CALIB_FIX_K3                = 64,\n        CALIB_FIX_K4                = 128,\n        CALIB_FIX_INTRINSIC         = 256\n    };\n\n    //! projects 3D points using fisheye model\n    CV_EXPORTS void projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine,\n        InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray());\n\n    //! projects points using fisheye model\n    CV_EXPORTS void projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec,\n        InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray());\n\n    //! distorts 2D points using fisheye model\n    CV_EXPORTS void distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0);\n\n    //! undistorts 2D points using fisheye model\n    CV_EXPORTS void undistortPoints(InputArray distorted, OutputArray undistorted,\n        InputArray K, InputArray D, InputArray R = noArray(), InputArray P  = noArray());\n\n    //! computing undistortion and rectification maps for image transform by cv::remap()\n    //! If D is empty zero distortion is used, if R or P is empty identity matrixes are used\n    CV_EXPORTS void initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P,\n        const cv::Size& size, int m1type, OutputArray map1, OutputArray map2);\n\n    //! undistorts image, optionally changes resolution and camera matrix. If Knew zero identity matrix is used\n    CV_EXPORTS void undistortImage(InputArray distorted, OutputArray undistorted,\n        InputArray K, InputArray D, InputArray Knew = cv::noArray(), const Size& new_size = Size());\n\n    //! estimates new camera matrix for undistortion or rectification\n    CV_EXPORTS void estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R,\n        OutputArray P, double balance = 0.0, const Size& new_size = Size(), double fov_scale = 1.0);\n\n    //! performs camera calibaration\n    CV_EXPORTS double calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size,\n        InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags = 0,\n            TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON));\n\n    //! stereo rectification estimation\n    CV_EXPORTS void stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec,\n        OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize = Size(),\n        double balance = 0.0, double fov_scale = 1.0);\n\n    //! performs stereo calibaration\n    CV_EXPORTS double stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2,\n                                  InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize,\n                                  OutputArray R, OutputArray T, int flags = CALIB_FIX_INTRINSIC,\n                                  TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON));\n\n}\n\n}\n\n#endif\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/contrib/contrib.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_CONTRIB_HPP__\n#define __OPENCV_CONTRIB_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/objdetect/objdetect.hpp\"\n\n#ifdef __cplusplus\n\n/****************************************************************************************\\\n*                                   Adaptive Skin Detector                               *\n\\****************************************************************************************/\n\nclass CV_EXPORTS CvAdaptiveSkinDetector\n{\nprivate:\n    enum {\n        GSD_HUE_LT = 3,\n        GSD_HUE_UT = 33,\n        GSD_INTENSITY_LT = 15,\n        GSD_INTENSITY_UT = 250\n    };\n\n    class CV_EXPORTS Histogram\n    {\n    private:\n        enum {\n            HistogramSize = (GSD_HUE_UT - GSD_HUE_LT + 1)\n        };\n\n    protected:\n        int findCoverageIndex(double surfaceToCover, int defaultValue = 0);\n\n    public:\n        CvHistogram *fHistogram;\n        Histogram();\n        virtual ~Histogram();\n\n        void findCurveThresholds(int &x1, int &x2, double percent = 0.05);\n        void mergeWith(Histogram *source, double weight);\n    };\n\n    int nStartCounter, nFrameCount, nSkinHueLowerBound, nSkinHueUpperBound, nMorphingMethod, nSamplingDivider;\n    double fHistogramMergeFactor, fHuePercentCovered;\n    Histogram histogramHueMotion, skinHueHistogram;\n    IplImage *imgHueFrame, *imgSaturationFrame, *imgLastGrayFrame, *imgMotionFrame, *imgFilteredFrame;\n    IplImage *imgShrinked, *imgTemp, *imgGrayFrame, *imgHSVFrame;\n\nprotected:\n    void initData(IplImage *src, int widthDivider, int heightDivider);\n    void adaptiveFilter();\n\npublic:\n\n    enum {\n        MORPHING_METHOD_NONE = 0,\n        MORPHING_METHOD_ERODE = 1,\n        MORPHING_METHOD_ERODE_ERODE = 2,\n        MORPHING_METHOD_ERODE_DILATE = 3\n    };\n\n    CvAdaptiveSkinDetector(int samplingDivider = 1, int morphingMethod = MORPHING_METHOD_NONE);\n    virtual ~CvAdaptiveSkinDetector();\n\n    virtual void process(IplImage *inputBGRImage, IplImage *outputHueMask);\n};\n\n\n/****************************************************************************************\\\n *                                  Fuzzy MeanShift Tracker                               *\n \\****************************************************************************************/\n\nclass CV_EXPORTS CvFuzzyPoint {\npublic:\n    double x, y, value;\n\n    CvFuzzyPoint(double _x, double _y);\n};\n\nclass CV_EXPORTS CvFuzzyCurve {\nprivate:\n    std::vector<CvFuzzyPoint> points;\n    double value, centre;\n\n    bool between(double x, double x1, double x2);\n\npublic:\n    CvFuzzyCurve();\n    ~CvFuzzyCurve();\n\n    void setCentre(double _centre);\n    double getCentre();\n    void clear();\n    void addPoint(double x, double y);\n    double calcValue(double param);\n    double getValue();\n    void setValue(double _value);\n};\n\nclass CV_EXPORTS CvFuzzyFunction {\npublic:\n    std::vector<CvFuzzyCurve> curves;\n\n    CvFuzzyFunction();\n    ~CvFuzzyFunction();\n    void addCurve(CvFuzzyCurve *curve, double value = 0);\n    void resetValues();\n    double calcValue();\n    CvFuzzyCurve *newCurve();\n};\n\nclass CV_EXPORTS CvFuzzyRule {\nprivate:\n    CvFuzzyCurve *fuzzyInput1, *fuzzyInput2;\n    CvFuzzyCurve *fuzzyOutput;\npublic:\n    CvFuzzyRule();\n    ~CvFuzzyRule();\n    void setRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1);\n    double calcValue(double param1, double param2);\n    CvFuzzyCurve *getOutputCurve();\n};\n\nclass CV_EXPORTS CvFuzzyController {\nprivate:\n    std::vector<CvFuzzyRule*> rules;\npublic:\n    CvFuzzyController();\n    ~CvFuzzyController();\n    void addRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1);\n    double calcOutput(double param1, double param2);\n};\n\nclass CV_EXPORTS CvFuzzyMeanShiftTracker\n{\nprivate:\n    class FuzzyResizer\n    {\n    private:\n        CvFuzzyFunction iInput, iOutput;\n        CvFuzzyController fuzzyController;\n    public:\n        FuzzyResizer();\n        int calcOutput(double edgeDensity, double density);\n    };\n\n    class SearchWindow\n    {\n    public:\n        FuzzyResizer *fuzzyResizer;\n        int x, y;\n        int width, height, maxWidth, maxHeight, ellipseHeight, ellipseWidth;\n        int ldx, ldy, ldw, ldh, numShifts, numIters;\n        int xGc, yGc;\n        long m00, m01, m10, m11, m02, m20;\n        double ellipseAngle;\n        double density;\n        unsigned int depthLow, depthHigh;\n        int verticalEdgeLeft, verticalEdgeRight, horizontalEdgeTop, horizontalEdgeBottom;\n\n        SearchWindow();\n        ~SearchWindow();\n        void setSize(int _x, int _y, int _width, int _height);\n        void initDepthValues(IplImage *maskImage, IplImage *depthMap);\n        bool shift();\n        void extractInfo(IplImage *maskImage, IplImage *depthMap, bool initDepth);\n        void getResizeAttribsEdgeDensityLinear(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh);\n        void getResizeAttribsInnerDensity(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh);\n        void getResizeAttribsEdgeDensityFuzzy(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh);\n        bool meanShift(IplImage *maskImage, IplImage *depthMap, int maxIteration, bool initDepth);\n    };\n\npublic:\n    enum TrackingState\n    {\n        tsNone          = 0,\n        tsSearching     = 1,\n        tsTracking      = 2,\n        tsSetWindow     = 3,\n        tsDisabled      = 10\n    };\n\n    enum ResizeMethod {\n        rmEdgeDensityLinear     = 0,\n        rmEdgeDensityFuzzy      = 1,\n        rmInnerDensity          = 2\n    };\n\n    enum {\n        MinKernelMass           = 1000\n    };\n\n    SearchWindow kernel;\n    int searchMode;\n\nprivate:\n    enum\n    {\n        MaxMeanShiftIteration   = 5,\n        MaxSetSizeIteration     = 5\n    };\n\n    void findOptimumSearchWindow(SearchWindow &searchWindow, IplImage *maskImage, IplImage *depthMap, int maxIteration, int resizeMethod, bool initDepth);\n\npublic:\n    CvFuzzyMeanShiftTracker();\n    ~CvFuzzyMeanShiftTracker();\n\n    void track(IplImage *maskImage, IplImage *depthMap, int resizeMethod, bool resetSearch, int minKernelMass = MinKernelMass);\n};\n\n\nnamespace cv\n{\n\n    class CV_EXPORTS Octree\n    {\n    public:\n        struct Node\n        {\n            Node() {}\n            int begin, end;\n            float x_min, x_max, y_min, y_max, z_min, z_max;\n            int maxLevels;\n            bool isLeaf;\n            int children[8];\n        };\n\n        Octree();\n        Octree( const vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );\n        virtual ~Octree();\n\n        virtual void buildTree( const vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );\n        virtual void getPointsWithinSphere( const Point3f& center, float radius,\n                                           vector<Point3f>& points ) const;\n        const vector<Node>& getNodes() const { return nodes; }\n    private:\n        int minPoints;\n        vector<Point3f> points;\n        vector<Node> nodes;\n\n        virtual void buildNext(size_t node_ind);\n    };\n\n\n    class CV_EXPORTS Mesh3D\n    {\n    public:\n        struct EmptyMeshException {};\n\n        Mesh3D();\n        Mesh3D(const vector<Point3f>& vtx);\n        ~Mesh3D();\n\n        void buildOctree();\n        void clearOctree();\n        float estimateResolution(float tryRatio = 0.1f);\n        void computeNormals(float normalRadius, int minNeighbors = 20);\n        void computeNormals(const vector<int>& subset, float normalRadius, int minNeighbors = 20);\n\n        void writeAsVrml(const String& file, const vector<Scalar>& colors = vector<Scalar>()) const;\n\n        vector<Point3f> vtx;\n        vector<Point3f> normals;\n        float resolution;\n        Octree octree;\n\n        const static Point3f allzero;\n    };\n\n    class CV_EXPORTS SpinImageModel\n    {\n    public:\n\n        /* model parameters, leave unset for default or auto estimate */\n        float normalRadius;\n        int minNeighbors;\n\n        float binSize;\n        int imageWidth;\n\n        float lambda;\n        float gamma;\n\n        float T_GeometriccConsistency;\n        float T_GroupingCorespondances;\n\n        /* public interface */\n        SpinImageModel();\n        explicit SpinImageModel(const Mesh3D& mesh);\n        ~SpinImageModel();\n\n        void setLogger(std::ostream* log);\n        void selectRandomSubset(float ratio);\n        void setSubset(const vector<int>& subset);\n        void compute();\n\n        void match(const SpinImageModel& scene, vector< vector<Vec2i> >& result);\n\n        Mat packRandomScaledSpins(bool separateScale = false, size_t xCount = 10, size_t yCount = 10) const;\n\n        size_t getSpinCount() const { return spinImages.rows; }\n        Mat getSpinImage(size_t index) const { return spinImages.row((int)index); }\n        const Point3f& getSpinVertex(size_t index) const { return mesh.vtx[subset[index]]; }\n        const Point3f& getSpinNormal(size_t index) const { return mesh.normals[subset[index]]; }\n\n        const Mesh3D& getMesh() const { return mesh; }\n        Mesh3D& getMesh() { return mesh; }\n\n        /* static utility functions */\n        static bool spinCorrelation(const Mat& spin1, const Mat& spin2, float lambda, float& result);\n\n        static Point2f calcSpinMapCoo(const Point3f& point, const Point3f& vertex, const Point3f& normal);\n\n        static float geometricConsistency(const Point3f& pointScene1, const Point3f& normalScene1,\n                                          const Point3f& pointModel1, const Point3f& normalModel1,\n                                          const Point3f& pointScene2, const Point3f& normalScene2,\n                                          const Point3f& pointModel2, const Point3f& normalModel2);\n\n        static float groupingCreteria(const Point3f& pointScene1, const Point3f& normalScene1,\n                                      const Point3f& pointModel1, const Point3f& normalModel1,\n                                      const Point3f& pointScene2, const Point3f& normalScene2,\n                                      const Point3f& pointModel2, const Point3f& normalModel2,\n                                      float gamma);\n    protected:\n        void defaultParams();\n\n        void matchSpinToModel(const Mat& spin, vector<int>& indeces,\n                              vector<float>& corrCoeffs, bool useExtremeOutliers = true) const;\n\n        void repackSpinImages(const vector<uchar>& mask, Mat& spinImages, bool reAlloc = true) const;\n\n        vector<int> subset;\n        Mesh3D mesh;\n        Mat spinImages;\n        std::ostream* out;\n    };\n\n    class CV_EXPORTS TickMeter\n    {\n    public:\n        TickMeter();\n        void start();\n        void stop();\n\n        int64 getTimeTicks() const;\n        double getTimeMicro() const;\n        double getTimeMilli() const;\n        double getTimeSec()   const;\n        int64 getCounter() const;\n\n        void reset();\n    private:\n        int64 counter;\n        int64 sumTime;\n        int64 startTime;\n    };\n\n    CV_EXPORTS std::ostream& operator<<(std::ostream& out, const TickMeter& tm);\n\n    class CV_EXPORTS SelfSimDescriptor\n    {\n    public:\n        SelfSimDescriptor();\n        SelfSimDescriptor(int _ssize, int _lsize,\n                          int _startDistanceBucket=DEFAULT_START_DISTANCE_BUCKET,\n                          int _numberOfDistanceBuckets=DEFAULT_NUM_DISTANCE_BUCKETS,\n                          int _nangles=DEFAULT_NUM_ANGLES);\n        SelfSimDescriptor(const SelfSimDescriptor& ss);\n        virtual ~SelfSimDescriptor();\n        SelfSimDescriptor& operator = (const SelfSimDescriptor& ss);\n\n        size_t getDescriptorSize() const;\n        Size getGridSize( Size imgsize, Size winStride ) const;\n\n        virtual void compute(const Mat& img, vector<float>& descriptors, Size winStride=Size(),\n                             const vector<Point>& locations=vector<Point>()) const;\n        virtual void computeLogPolarMapping(Mat& mappingMask) const;\n        virtual void SSD(const Mat& img, Point pt, Mat& ssd) const;\n\n        int smallSize;\n        int largeSize;\n        int startDistanceBucket;\n        int numberOfDistanceBuckets;\n        int numberOfAngles;\n\n        enum { DEFAULT_SMALL_SIZE = 5, DEFAULT_LARGE_SIZE = 41,\n            DEFAULT_NUM_ANGLES = 20, DEFAULT_START_DISTANCE_BUCKET = 3,\n            DEFAULT_NUM_DISTANCE_BUCKETS = 7 };\n    };\n\n\n    typedef bool (*BundleAdjustCallback)(int iteration, double norm_error, void* user_data);\n\n    class CV_EXPORTS LevMarqSparse {\n    public:\n        LevMarqSparse();\n        LevMarqSparse(int npoints, // number of points\n                      int ncameras, // number of cameras\n                      int nPointParams, // number of params per one point  (3 in case of 3D points)\n                      int nCameraParams, // number of parameters per one camera\n                      int nErrParams, // number of parameters in measurement vector\n                      // for 1 point at one camera (2 in case of 2D projections)\n                      Mat& visibility, // visibility matrix. rows correspond to points, columns correspond to cameras\n                      // 1 - point is visible for the camera, 0 - invisible\n                      Mat& P0, // starting vector of parameters, first cameras then points\n                      Mat& X, // measurements, in order of visibility. non visible cases are skipped\n                      TermCriteria criteria, // termination criteria\n\n                      // callback for estimation of Jacobian matrices\n                      void (CV_CDECL * fjac)(int i, int j, Mat& point_params,\n                                             Mat& cam_params, Mat& A, Mat& B, void* data),\n                      // callback for estimation of backprojection errors\n                      void (CV_CDECL * func)(int i, int j, Mat& point_params,\n                                             Mat& cam_params, Mat& estim, void* data),\n                      void* data, // user-specific data passed to the callbacks\n                      BundleAdjustCallback cb, void* user_data\n                      );\n\n        virtual ~LevMarqSparse();\n\n        virtual void run( int npoints, // number of points\n                         int ncameras, // number of cameras\n                         int nPointParams, // number of params per one point  (3 in case of 3D points)\n                         int nCameraParams, // number of parameters per one camera\n                         int nErrParams, // number of parameters in measurement vector\n                         // for 1 point at one camera (2 in case of 2D projections)\n                         Mat& visibility, // visibility matrix. rows correspond to points, columns correspond to cameras\n                         // 1 - point is visible for the camera, 0 - invisible\n                         Mat& P0, // starting vector of parameters, first cameras then points\n                         Mat& X, // measurements, in order of visibility. non visible cases are skipped\n                         TermCriteria criteria, // termination criteria\n\n                         // callback for estimation of Jacobian matrices\n                         void (CV_CDECL * fjac)(int i, int j, Mat& point_params,\n                                                Mat& cam_params, Mat& A, Mat& B, void* data),\n                         // callback for estimation of backprojection errors\n                         void (CV_CDECL * func)(int i, int j, Mat& point_params,\n                                                Mat& cam_params, Mat& estim, void* data),\n                         void* data // user-specific data passed to the callbacks\n                         );\n\n        virtual void clear();\n\n        // useful function to do simple bundle adjustment tasks\n        static void bundleAdjust(vector<Point3d>& points, // positions of points in global coordinate system (input and output)\n                                 const vector<vector<Point2d> >& imagePoints, // projections of 3d points for every camera\n                                 const vector<vector<int> >& visibility, // visibility of 3d points for every camera\n                                 vector<Mat>& cameraMatrix, // intrinsic matrices of all cameras (input and output)\n                                 vector<Mat>& R, // rotation matrices of all cameras (input and output)\n                                 vector<Mat>& T, // translation vector of all cameras (input and output)\n                                 vector<Mat>& distCoeffs, // distortion coefficients of all cameras (input and output)\n                                 const TermCriteria& criteria=\n                                 TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, DBL_EPSILON),\n                                 BundleAdjustCallback cb = 0, void* user_data = 0);\n\n    public:\n        virtual void optimize(CvMat &_vis); //main function that runs minimization\n\n        //iteratively asks for measurement for visible camera-point pairs\n        void ask_for_proj(CvMat &_vis,bool once=false);\n        //iteratively asks for Jacobians for every camera_point pair\n        void ask_for_projac(CvMat &_vis);\n\n        CvMat* err; //error X-hX\n        double prevErrNorm, errNorm;\n        double lambda;\n        CvTermCriteria criteria;\n        int iters;\n\n        CvMat** U; //size of array is equal to number of cameras\n        CvMat** V; //size of array is equal to number of points\n        CvMat** inv_V_star; //inverse of V*\n\n        CvMat** A;\n        CvMat** B;\n        CvMat** W;\n\n        CvMat* X; //measurement\n        CvMat* hX; //current measurement extimation given new parameter vector\n\n        CvMat* prevP; //current already accepted parameter.\n        CvMat* P; // parameters used to evaluate function with new params\n        // this parameters may be rejected\n\n        CvMat* deltaP; //computed increase of parameters (result of normal system solution )\n\n        CvMat** ea; // sum_i  AijT * e_ij , used as right part of normal equation\n        // length of array is j = number of cameras\n        CvMat** eb; // sum_j  BijT * e_ij , used as right part of normal equation\n        // length of array is i = number of points\n\n        CvMat** Yj; //length of array is i = num_points\n\n        CvMat* S; //big matrix of block Sjk  , each block has size num_cam_params x num_cam_params\n\n        CvMat* JtJ_diag; //diagonal of JtJ,  used to backup diagonal elements before augmentation\n\n        CvMat* Vis_index; // matrix which element is index of measurement for point i and camera j\n\n        int num_cams;\n        int num_points;\n        int num_err_param;\n        int num_cam_param;\n        int num_point_param;\n\n        //target function and jacobian pointers, which needs to be initialized\n        void (*fjac)(int i, int j, Mat& point_params, Mat& cam_params, Mat& A, Mat& B, void* data);\n        void (*func)(int i, int j, Mat& point_params, Mat& cam_params, Mat& estim, void* data);\n\n        void* data;\n\n        BundleAdjustCallback cb;\n        void* user_data;\n    };\n\n    CV_EXPORTS_W int chamerMatching( Mat& img, Mat& templ,\n                                  CV_OUT vector<vector<Point> >& results, CV_OUT vector<float>& cost,\n                                  double templScale=1, int maxMatches = 20,\n                                  double minMatchDistance = 1.0, int padX = 3,\n                                  int padY = 3, int scales = 5, double minScale = 0.6, double maxScale = 1.6,\n                                  double orientationWeight = 0.5, double truncate = 20);\n\n\n    class CV_EXPORTS_W StereoVar\n    {\n    public:\n        // Flags\n        enum {USE_INITIAL_DISPARITY = 1, USE_EQUALIZE_HIST = 2, USE_SMART_ID = 4, USE_AUTO_PARAMS = 8, USE_MEDIAN_FILTERING = 16};\n        enum {CYCLE_O, CYCLE_V};\n        enum {PENALIZATION_TICHONOV, PENALIZATION_CHARBONNIER, PENALIZATION_PERONA_MALIK};\n\n        //! the default constructor\n        CV_WRAP StereoVar();\n\n        //! the full constructor taking all the necessary algorithm parameters\n        CV_WRAP StereoVar(int levels, double pyrScale, int nIt, int minDisp, int maxDisp, int poly_n, double poly_sigma, float fi, float lambda, int penalization, int cycle, int flags);\n\n        //! the destructor\n        virtual ~StereoVar();\n\n        //! the stereo correspondence operator that computes disparity map for the specified rectified stereo pair\n        CV_WRAP_AS(compute) virtual void operator()(const Mat& left, const Mat& right, CV_OUT Mat& disp);\n\n        CV_PROP_RW int      levels;\n        CV_PROP_RW double   pyrScale;\n        CV_PROP_RW int      nIt;\n        CV_PROP_RW int      minDisp;\n        CV_PROP_RW int      maxDisp;\n        CV_PROP_RW int      poly_n;\n        CV_PROP_RW double   poly_sigma;\n        CV_PROP_RW float    fi;\n        CV_PROP_RW float    lambda;\n        CV_PROP_RW int      penalization;\n        CV_PROP_RW int      cycle;\n        CV_PROP_RW int      flags;\n\n    private:\n        void autoParams();\n        void FMG(Mat &I1, Mat &I2, Mat &I2x, Mat &u, int level);\n        void VCycle_MyFAS(Mat &I1_h, Mat &I2_h, Mat &I2x_h, Mat &u_h, int level);\n        void VariationalSolver(Mat &I1_h, Mat &I2_h, Mat &I2x_h, Mat &u_h, int level);\n    };\n\n    CV_EXPORTS void polyfit(const Mat& srcx, const Mat& srcy, Mat& dst, int order);\n\n    class CV_EXPORTS Directory\n    {\n        public:\n            static std::vector<std::string> GetListFiles  ( const std::string& path, const std::string & exten = \"*\", bool addPath = true );\n            static std::vector<std::string> GetListFilesR ( const std::string& path, const std::string & exten = \"*\", bool addPath = true );\n            static std::vector<std::string> GetListFolders( const std::string& path, const std::string & exten = \"*\", bool addPath = true );\n    };\n\n    /*\n     * Generation of a set of different colors by the following way:\n     * 1) generate more then need colors (in \"factor\" times) in RGB,\n     * 2) convert them to Lab,\n     * 3) choose the needed count of colors from the set that are more different from\n     *    each other,\n     * 4) convert the colors back to RGB\n     */\n    CV_EXPORTS void generateColors( std::vector<Scalar>& colors, size_t count, size_t factor=100 );\n\n\n    /*\n     *  Estimate the rigid body motion from frame0 to frame1. The method is based on the paper\n     *  \"Real-Time Visual Odometry from Dense RGB-D Images\", F. Steinbucker, J. Strum, D. Cremers, ICCV, 2011.\n     */\n    enum { ROTATION          = 1,\n           TRANSLATION       = 2,\n           RIGID_BODY_MOTION = 4\n         };\n    CV_EXPORTS bool RGBDOdometry( Mat& Rt, const Mat& initRt,\n                                  const Mat& image0, const Mat& depth0, const Mat& mask0,\n                                  const Mat& image1, const Mat& depth1, const Mat& mask1,\n                                  const Mat& cameraMatrix, float minDepth=0.f, float maxDepth=4.f, float maxDepthDiff=0.07f,\n                                  const std::vector<int>& iterCounts=std::vector<int>(),\n                                  const std::vector<float>& minGradientMagnitudes=std::vector<float>(),\n                                  int transformType=RIGID_BODY_MOTION );\n\n    /**\n    *Bilinear interpolation technique.\n    *\n    *The value of a desired cortical pixel is obtained through a bilinear interpolation of the values\n    *of the four nearest neighbouring Cartesian pixels to the center of the RF.\n    *The same principle is applied to the inverse transformation.\n    *\n    *More details can be found in http://dx.doi.org/10.1007/978-3-642-23968-7_5\n    */\n    class CV_EXPORTS LogPolar_Interp\n    {\n    public:\n\n        LogPolar_Interp() {}\n\n        /**\n        *Constructor\n        *\\param w the width of the input image\n        *\\param h the height of the input image\n        *\\param center the transformation center: where the output precision is maximal\n        *\\param R the number of rings of the cortical image (default value 70 pixel)\n        *\\param ro0 the radius of the blind spot (default value 3 pixel)\n        *\\param interp interpolation algorithm\n        *\\param full \\a 1 (default value) means that the retinal image (the inverse transform) is computed within the circumscribing circle.\n        *            \\a 0 means that the retinal image is computed within the inscribed circle.\n        *\\param S the number of sectors of the cortical image (default value 70 pixel).\n        *         Its value is usually internally computed to obtain a pixel aspect ratio equals to 1.\n        *\\param sp \\a 1 (default value) means that the parameter \\a S is internally computed.\n        *          \\a 0 means that the parameter \\a S is provided by the user.\n        */\n        LogPolar_Interp(int w, int h, Point2i center, int R=70, double ro0=3.0,\n                        int interp=INTER_LINEAR, int full=1, int S=117, int sp=1);\n        /**\n        *Transformation from Cartesian image to cortical (log-polar) image.\n        *\\param source the Cartesian image\n        *\\return the transformed image (cortical image)\n        */\n        const Mat to_cortical(const Mat &source);\n        /**\n        *Transformation from cortical image to retinal (inverse log-polar) image.\n        *\\param source the cortical image\n        *\\return the transformed image (retinal image)\n        */\n        const Mat to_cartesian(const Mat &source);\n        /**\n        *Destructor\n        */\n        ~LogPolar_Interp();\n\n    protected:\n\n        Mat Rsri;\n        Mat Csri;\n\n        int S, R, M, N;\n        int top, bottom,left,right;\n        double ro0, romax, a, q;\n        int interp;\n\n        Mat ETAyx;\n        Mat CSIyx;\n\n        void create_map(int M, int N, int R, int S, double ro0);\n    };\n\n    /**\n    *Overlapping circular receptive fields technique\n    *\n    *The Cartesian plane is divided in two regions: the fovea and the periphery.\n    *The fovea (oversampling) is handled by using the bilinear interpolation technique described above, whereas in\n    *the periphery we use the overlapping Gaussian circular RFs.\n    *\n    *More details can be found in http://dx.doi.org/10.1007/978-3-642-23968-7_5\n    */\n    class CV_EXPORTS LogPolar_Overlapping\n    {\n    public:\n        LogPolar_Overlapping() {}\n\n        /**\n        *Constructor\n        *\\param w the width of the input image\n        *\\param h the height of the input image\n        *\\param center the transformation center: where the output precision is maximal\n        *\\param R the number of rings of the cortical image (default value 70 pixel)\n        *\\param ro0 the radius of the blind spot (default value 3 pixel)\n        *\\param full \\a 1 (default value) means that the retinal image (the inverse transform) is computed within the circumscribing circle.\n        *            \\a 0 means that the retinal image is computed within the inscribed circle.\n        *\\param S the number of sectors of the cortical image (default value 70 pixel).\n        *         Its value is usually internally computed to obtain a pixel aspect ratio equals to 1.\n        *\\param sp \\a 1 (default value) means that the parameter \\a S is internally computed.\n        *          \\a 0 means that the parameter \\a S is provided by the user.\n        */\n        LogPolar_Overlapping(int w, int h, Point2i center, int R=70,\n                             double ro0=3.0, int full=1, int S=117, int sp=1);\n        /**\n        *Transformation from Cartesian image to cortical (log-polar) image.\n        *\\param source the Cartesian image\n        *\\return the transformed image (cortical image)\n        */\n        const Mat to_cortical(const Mat &source);\n        /**\n        *Transformation from cortical image to retinal (inverse log-polar) image.\n        *\\param source the cortical image\n        *\\return the transformed image (retinal image)\n        */\n        const Mat to_cartesian(const Mat &source);\n        /**\n        *Destructor\n        */\n        ~LogPolar_Overlapping();\n\n    protected:\n\n        Mat Rsri;\n        Mat Csri;\n        vector<int> Rsr;\n        vector<int> Csr;\n        vector<double> Wsr;\n\n        int S, R, M, N, ind1;\n        int top, bottom,left,right;\n        double ro0, romax, a, q;\n\n        struct kernel\n        {\n            kernel() { w = 0; }\n            vector<double> weights;\n            int w;\n        };\n\n        Mat ETAyx;\n        Mat CSIyx;\n        vector<kernel> w_ker_2D;\n\n        void create_map(int M, int N, int R, int S, double ro0);\n    };\n\n    /**\n    * Adjacent receptive fields technique\n    *\n    *All the Cartesian pixels, whose coordinates in the cortical domain share the same integer part, are assigned to the same RF.\n    *The precision of the boundaries of the RF can be improved by breaking each pixel into subpixels and assigning each of them to the correct RF.\n    *This technique is implemented from: Traver, V., Pla, F.: Log-polar mapping template design: From task-level requirements\n    *to geometry parameters. Image Vision Comput. 26(10) (2008) 1354-1370\n    *\n    *More details can be found in http://dx.doi.org/10.1007/978-3-642-23968-7_5\n    */\n    class CV_EXPORTS LogPolar_Adjacent\n    {\n    public:\n        LogPolar_Adjacent() {}\n\n        /**\n         *Constructor\n         *\\param w the width of the input image\n         *\\param h the height of the input image\n         *\\param center the transformation center: where the output precision is maximal\n         *\\param R the number of rings of the cortical image (default value 70 pixel)\n         *\\param ro0 the radius of the blind spot (default value 3 pixel)\n         *\\param smin the size of the subpixel (default value 0.25 pixel)\n         *\\param full \\a 1 (default value) means that the retinal image (the inverse transform) is computed within the circumscribing circle.\n         *            \\a 0 means that the retinal image is computed within the inscribed circle.\n         *\\param S the number of sectors of the cortical image (default value 70 pixel).\n         *         Its value is usually internally computed to obtain a pixel aspect ratio equals to 1.\n         *\\param sp \\a 1 (default value) means that the parameter \\a S is internally computed.\n         *          \\a 0 means that the parameter \\a S is provided by the user.\n         */\n        LogPolar_Adjacent(int w, int h, Point2i center, int R=70, double ro0=3.0, double smin=0.25, int full=1, int S=117, int sp=1);\n        /**\n         *Transformation from Cartesian image to cortical (log-polar) image.\n         *\\param source the Cartesian image\n         *\\return the transformed image (cortical image)\n         */\n        const Mat to_cortical(const Mat &source);\n        /**\n         *Transformation from cortical image to retinal (inverse log-polar) image.\n         *\\param source the cortical image\n         *\\return the transformed image (retinal image)\n         */\n        const Mat to_cartesian(const Mat &source);\n        /**\n         *Destructor\n         */\n        ~LogPolar_Adjacent();\n\n    protected:\n        struct pixel\n        {\n            pixel() { u = v = 0; a = 0.; }\n            int u;\n            int v;\n            double a;\n        };\n        int S, R, M, N;\n        int top, bottom,left,right;\n        double ro0, romax, a, q;\n        vector<vector<pixel> > L;\n        vector<double> A;\n\n        void subdivide_recursively(double x, double y, int i, int j, double length, double smin);\n        bool get_uv(double x, double y, int&u, int&v);\n        void create_map(int M, int N, int R, int S, double ro0, double smin);\n    };\n\n    CV_EXPORTS Mat subspaceProject(InputArray W, InputArray mean, InputArray src);\n    CV_EXPORTS Mat subspaceReconstruct(InputArray W, InputArray mean, InputArray src);\n\n    class CV_EXPORTS LDA\n    {\n    public:\n        // Initializes a LDA with num_components (default 0) and specifies how\n        // samples are aligned (default dataAsRow=true).\n        LDA(int num_components = 0) :\n            _num_components(num_components) {};\n\n        // Initializes and performs a Discriminant Analysis with Fisher's\n        // Optimization Criterion on given data in src and corresponding labels\n        // in labels. If 0 (or less) number of components are given, they are\n        // automatically determined for given data in computation.\n        LDA(const Mat& src, vector<int> labels,\n                int num_components = 0) :\n                    _num_components(num_components)\n        {\n            this->compute(src, labels); //! compute eigenvectors and eigenvalues\n        }\n\n        // Initializes and performs a Discriminant Analysis with Fisher's\n        // Optimization Criterion on given data in src and corresponding labels\n        // in labels. If 0 (or less) number of components are given, they are\n        // automatically determined for given data in computation.\n        LDA(InputArrayOfArrays src, InputArray labels,\n                int num_components = 0) :\n                    _num_components(num_components)\n        {\n            this->compute(src, labels); //! compute eigenvectors and eigenvalues\n        }\n\n        // Serializes this object to a given filename.\n        void save(const string& filename) const;\n\n        // Deserializes this object from a given filename.\n        void load(const string& filename);\n\n        // Serializes this object to a given cv::FileStorage.\n        void save(FileStorage& fs) const;\n\n            // Deserializes this object from a given cv::FileStorage.\n        void load(const FileStorage& node);\n\n        // Destructor.\n        ~LDA() {}\n\n        //! Compute the discriminants for data in src and labels.\n        void compute(InputArrayOfArrays src, InputArray labels);\n\n        // Projects samples into the LDA subspace.\n        Mat project(InputArray src);\n\n        // Reconstructs projections from the LDA subspace.\n        Mat reconstruct(InputArray src);\n\n        // Returns the eigenvectors of this LDA.\n        Mat eigenvectors() const { return _eigenvectors; };\n\n        // Returns the eigenvalues of this LDA.\n        Mat eigenvalues() const { return _eigenvalues; }\n\n    protected:\n        bool _dataAsRow;\n        int _num_components;\n        Mat _eigenvectors;\n        Mat _eigenvalues;\n\n        void lda(InputArrayOfArrays src, InputArray labels);\n    };\n\n    class CV_EXPORTS_W FaceRecognizer : public Algorithm\n    {\n    public:\n        //! virtual destructor\n        virtual ~FaceRecognizer() {}\n\n        // Trains a FaceRecognizer.\n        CV_WRAP virtual void train(InputArrayOfArrays src, InputArray labels) = 0;\n\n        // Updates a FaceRecognizer.\n        CV_WRAP void update(InputArrayOfArrays src, InputArray labels);\n\n        // Gets a prediction from a FaceRecognizer.\n        virtual int predict(InputArray src) const = 0;\n\n        // Predicts the label and confidence for a given sample.\n        CV_WRAP virtual void predict(InputArray src, CV_OUT int &label, CV_OUT double &confidence) const = 0;\n\n        // Serializes this object to a given filename.\n        CV_WRAP virtual void save(const string& filename) const;\n\n        // Deserializes this object from a given filename.\n        CV_WRAP virtual void load(const string& filename);\n\n        // Serializes this object to a given cv::FileStorage.\n        virtual void save(FileStorage& fs) const = 0;\n\n        // Deserializes this object from a given cv::FileStorage.\n        virtual void load(const FileStorage& fs) = 0;\n\n        // Sets additional information as pairs label - info.\n        void setLabelsInfo(const std::map<int, string>& labelsInfo);\n\n        // Gets string information by label\n        string getLabelInfo(const int &label);\n\n        // Gets labels by string\n        vector<int> getLabelsByString(const string& str);\n    };\n\n    CV_EXPORTS_W Ptr<FaceRecognizer> createEigenFaceRecognizer(int num_components = 0, double threshold = DBL_MAX);\n    CV_EXPORTS_W Ptr<FaceRecognizer> createFisherFaceRecognizer(int num_components = 0, double threshold = DBL_MAX);\n    CV_EXPORTS_W Ptr<FaceRecognizer> createLBPHFaceRecognizer(int radius=1, int neighbors=8,\n                                                            int grid_x=8, int grid_y=8, double threshold = DBL_MAX);\n\n    enum\n    {\n        COLORMAP_AUTUMN = 0,\n        COLORMAP_BONE = 1,\n        COLORMAP_JET = 2,\n        COLORMAP_WINTER = 3,\n        COLORMAP_RAINBOW = 4,\n        COLORMAP_OCEAN = 5,\n        COLORMAP_SUMMER = 6,\n        COLORMAP_SPRING = 7,\n        COLORMAP_COOL = 8,\n        COLORMAP_HSV = 9,\n        COLORMAP_PINK = 10,\n        COLORMAP_HOT = 11\n    };\n\n    CV_EXPORTS_W void applyColorMap(InputArray src, OutputArray dst, int colormap);\n\n    CV_EXPORTS bool initModule_contrib();\n}\n\n#include \"opencv2/contrib/retina.hpp\"\n\n#include \"opencv2/contrib/openfabmap.hpp\"\n\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/contrib/detection_based_tracker.hpp",
    "content": "#pragma once\n\n#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)\n\n#include <opencv2/core/core.hpp>\n#include <opencv2/objdetect/objdetect.hpp>\n\n#include <vector>\n\nclass DetectionBasedTracker\n{\n    public:\n        struct Parameters\n        {\n            int minObjectSize;\n            int maxObjectSize;\n            double scaleFactor;\n            int maxTrackLifetime;\n            int minNeighbors;\n            int minDetectionPeriod; //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0\n\n            Parameters();\n        };\n\n        DetectionBasedTracker(const std::string& cascadeFilename, const Parameters& params);\n        virtual ~DetectionBasedTracker();\n\n        virtual bool run();\n        virtual void stop();\n        virtual void resetTracking();\n\n        virtual void process(const cv::Mat& imageGray);\n\n        bool setParameters(const Parameters& params);\n        const Parameters& getParameters();\n\n\n        typedef std::pair<cv::Rect, int> Object;\n        virtual void getObjects(std::vector<cv::Rect>& result) const;\n        virtual void getObjects(std::vector<Object>& result) const;\n\n    protected:\n        class SeparateDetectionWork;\n        cv::Ptr<SeparateDetectionWork> separateDetectionWork;\n        friend void* workcycleObjectDetectorFunction(void* p);\n\n\n        struct InnerParameters\n        {\n            int numLastPositionsToTrack;\n            int numStepsToWaitBeforeFirstShow;\n            int numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown;\n            int numStepsToShowWithoutDetecting;\n\n            float coeffTrackingWindowSize;\n            float coeffObjectSizeToTrack;\n            float coeffObjectSpeedUsingInPrediction;\n\n            InnerParameters();\n        };\n        Parameters parameters;\n        InnerParameters innerParameters;\n\n        struct TrackedObject\n        {\n            typedef std::vector<cv::Rect> PositionsVector;\n\n            PositionsVector lastPositions;\n\n            int numDetectedFrames;\n            int numFramesNotDetected;\n            int id;\n\n            TrackedObject(const cv::Rect& rect):numDetectedFrames(1), numFramesNotDetected(0)\n            {\n                lastPositions.push_back(rect);\n                id=getNextId();\n            };\n\n            static int getNextId()\n            {\n                static int _id=0;\n                return _id++;\n            }\n        };\n\n        int numTrackedSteps;\n        std::vector<TrackedObject> trackedObjects;\n\n        std::vector<float> weightsPositionsSmoothing;\n        std::vector<float> weightsSizesSmoothing;\n\n        cv::CascadeClassifier cascadeForTracking;\n\n\n        void updateTrackedObjects(const std::vector<cv::Rect>& detectedObjects);\n        cv::Rect calcTrackedObjectPositionToShow(int i) const;\n        void detectInRegion(const cv::Mat& img, const cv::Rect& r, std::vector<cv::Rect>& detectedObjectsInRegions);\n};\n\nnamespace cv\n{\n    using ::DetectionBasedTracker;\n} //end of cv namespace\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/contrib/hybridtracker.hpp",
    "content": "//*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                                License Agreement\n//                       For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_HYBRIDTRACKER_H_\n#define __OPENCV_HYBRIDTRACKER_H_\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/core/operations.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/video/tracking.hpp\"\n#include \"opencv2/ml/ml.hpp\"\n\n#ifdef __cplusplus\n\nnamespace cv\n{\n\n// Motion model for tracking algorithm. Currently supports objects that do not move much.\n// To add Kalman filter\nstruct CV_EXPORTS CvMotionModel\n{\n    enum {LOW_PASS_FILTER = 0, KALMAN_FILTER = 1, EM = 2};\n\n    CvMotionModel()\n    {\n    }\n\n    float low_pass_gain;    // low pass gain\n};\n\n// Mean Shift Tracker parameters for specifying use of HSV channel and CamShift parameters.\nstruct CV_EXPORTS CvMeanShiftTrackerParams\n{\n    enum {  H = 0, HS = 1, HSV = 2  };\n    CvMeanShiftTrackerParams(int tracking_type = CvMeanShiftTrackerParams::HS,\n            CvTermCriteria term_crit = CvTermCriteria());\n\n    int tracking_type;\n    vector<float> h_range;\n    vector<float> s_range;\n    vector<float> v_range;\n    CvTermCriteria term_crit;\n};\n\n// Feature tracking parameters\nstruct CV_EXPORTS CvFeatureTrackerParams\n{\n    enum {  SIFT = 0, SURF = 1, OPTICAL_FLOW = 2 };\n    CvFeatureTrackerParams(int featureType = 0, int windowSize = 0)\n    {\n        feature_type = featureType;\n        window_size = windowSize;\n    }\n\n    int feature_type; // Feature type to use\n    int window_size; // Window size in pixels around which to search for new window\n};\n\n// Hybrid Tracking parameters for specifying weights of individual trackers and motion model.\nstruct CV_EXPORTS CvHybridTrackerParams\n{\n    CvHybridTrackerParams(float ft_tracker_weight = 0.5, float ms_tracker_weight = 0.5,\n            CvFeatureTrackerParams ft_params = CvFeatureTrackerParams(),\n            CvMeanShiftTrackerParams ms_params = CvMeanShiftTrackerParams(),\n            CvMotionModel model = CvMotionModel());\n\n    float ft_tracker_weight;\n    float ms_tracker_weight;\n    CvFeatureTrackerParams ft_params;\n    CvMeanShiftTrackerParams ms_params;\n    int motion_model;\n    float low_pass_gain;\n};\n\n// Performs Camshift using parameters from MeanShiftTrackerParams\nclass CV_EXPORTS CvMeanShiftTracker\n{\nprivate:\n    Mat hsv, hue;\n    Mat backproj;\n    Mat mask, maskroi;\n    MatND hist;\n    Rect prev_trackwindow;\n    RotatedRect prev_trackbox;\n    Point2f prev_center;\n\npublic:\n    CvMeanShiftTrackerParams params;\n\n    CvMeanShiftTracker();\n    explicit CvMeanShiftTracker(CvMeanShiftTrackerParams _params);\n    ~CvMeanShiftTracker();\n    void newTrackingWindow(Mat image, Rect selection);\n    RotatedRect updateTrackingWindow(Mat image);\n    Mat getHistogramProjection(int type);\n    void setTrackingWindow(Rect _window);\n    Rect getTrackingWindow();\n    RotatedRect getTrackingEllipse();\n    Point2f getTrackingCenter();\n};\n\n// Performs SIFT/SURF feature tracking using parameters from FeatureTrackerParams\nclass CV_EXPORTS CvFeatureTracker\n{\nprivate:\n    Ptr<Feature2D> dd;\n    Ptr<DescriptorMatcher> matcher;\n    vector<DMatch> matches;\n\n    Mat prev_image;\n    Mat prev_image_bw;\n    Rect prev_trackwindow;\n    Point2d prev_center;\n\n    int ittr;\n    vector<Point2f> features[2];\n\npublic:\n    Mat disp_matches;\n    CvFeatureTrackerParams params;\n\n    CvFeatureTracker();\n    explicit CvFeatureTracker(CvFeatureTrackerParams params);\n    ~CvFeatureTracker();\n    void newTrackingWindow(Mat image, Rect selection);\n    Rect updateTrackingWindow(Mat image);\n    Rect updateTrackingWindowWithSIFT(Mat image);\n    Rect updateTrackingWindowWithFlow(Mat image);\n    void setTrackingWindow(Rect _window);\n    Rect getTrackingWindow();\n    Point2f getTrackingCenter();\n};\n\n// Performs Hybrid Tracking and combines individual trackers using EM or filters\nclass CV_EXPORTS CvHybridTracker\n{\nprivate:\n    CvMeanShiftTracker* mstracker;\n    CvFeatureTracker* fttracker;\n\n    CvMat* samples;\n    CvMat* labels;\n\n    Rect prev_window;\n    Point2f prev_center;\n    Mat prev_proj;\n    RotatedRect trackbox;\n\n    int ittr;\n    Point2f curr_center;\n\n    inline float getL2Norm(Point2f p1, Point2f p2);\n    Mat getDistanceProjection(Mat image, Point2f center);\n    Mat getGaussianProjection(Mat image, int ksize, double sigma, Point2f center);\n    void updateTrackerWithEM(Mat image);\n    void updateTrackerWithLowPassFilter(Mat image);\n\npublic:\n    CvHybridTrackerParams params;\n    CvHybridTracker();\n    explicit CvHybridTracker(CvHybridTrackerParams params);\n    ~CvHybridTracker();\n\n    void newTracker(Mat image, Rect selection);\n    void updateTracker(Mat image);\n    Rect getTrackingWindow();\n};\n\ntypedef CvMotionModel MotionModel;\ntypedef CvMeanShiftTrackerParams MeanShiftTrackerParams;\ntypedef CvFeatureTrackerParams FeatureTrackerParams;\ntypedef CvHybridTrackerParams HybridTrackerParams;\ntypedef CvMeanShiftTracker MeanShiftTracker;\ntypedef CvFeatureTracker FeatureTracker;\ntypedef CvHybridTracker HybridTracker;\n}\n\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/contrib/openfabmap.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n// This file originates from the openFABMAP project:\n// [http://code.google.com/p/openfabmap/]\n//\n// For published work which uses all or part of OpenFABMAP, please cite:\n// [http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6224843]\n//\n// Original Algorithm by Mark Cummins and Paul Newman:\n// [http://ijr.sagepub.com/content/27/6/647.short]\n// [http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=5613942]\n// [http://ijr.sagepub.com/content/30/9/1100.abstract]\n//\n//                           License Agreement\n//\n// Copyright (C) 2012 Arren Glover [aj.glover@qut.edu.au] and\n//                    Will Maddern [w.maddern@qut.edu.au], all rights reserved.\n//\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OPENFABMAP_H_\n#define __OPENCV_OPENFABMAP_H_\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n\n#include <vector>\n#include <list>\n#include <map>\n#include <set>\n#include <valarray>\n\nnamespace cv {\n\nnamespace of2 {\n\nusing std::list;\nusing std::map;\nusing std::multiset;\n\n/*\n    Return data format of a FABMAP compare call\n*/\nstruct CV_EXPORTS IMatch {\n\n    IMatch() :\n        queryIdx(-1), imgIdx(-1), likelihood(-DBL_MAX), match(-DBL_MAX) {\n    }\n    IMatch(int _queryIdx, int _imgIdx, double _likelihood, double _match) :\n        queryIdx(_queryIdx), imgIdx(_imgIdx), likelihood(_likelihood), match(\n                _match) {\n    }\n\n    int queryIdx;    //query index\n    int imgIdx;      //test index\n\n    double likelihood;  //raw loglikelihood\n    double match;      //normalised probability\n\n    bool operator<(const IMatch& m) const {\n        return match < m.match;\n    }\n\n};\n\n/*\n    Base FabMap class. Each FabMap method inherits from this class.\n*/\nclass CV_EXPORTS FabMap {\npublic:\n\n    //FabMap options\n    enum {\n        MEAN_FIELD = 1,\n        SAMPLED = 2,\n        NAIVE_BAYES = 4,\n        CHOW_LIU = 8,\n        MOTION_MODEL = 16\n    };\n\n    FabMap(const Mat& clTree, double PzGe, double PzGNe, int flags,\n            int numSamples = 0);\n    virtual ~FabMap();\n\n    //methods to add training data for sampling method\n    virtual void addTraining(const Mat& queryImgDescriptor);\n    virtual void addTraining(const vector<Mat>& queryImgDescriptors);\n\n    //methods to add to the test data\n    virtual void add(const Mat& queryImgDescriptor);\n    virtual void add(const vector<Mat>& queryImgDescriptors);\n\n    //accessors\n    const vector<Mat>& getTrainingImgDescriptors() const;\n    const vector<Mat>& getTestImgDescriptors() const;\n\n    //Main FabMap image comparison\n    void compare(const Mat& queryImgDescriptor,\n            vector<IMatch>& matches, bool addQuery = false,\n            const Mat& mask = Mat());\n    void compare(const Mat& queryImgDescriptor,\n            const Mat& testImgDescriptors, vector<IMatch>& matches,\n            const Mat& mask = Mat());\n    void compare(const Mat& queryImgDescriptor,\n            const vector<Mat>& testImgDescriptors,\n            vector<IMatch>& matches, const Mat& mask = Mat());\n    void compare(const vector<Mat>& queryImgDescriptors, vector<\n            IMatch>& matches, bool addQuery = false, const Mat& mask =\n            Mat());\n    void compare(const vector<Mat>& queryImgDescriptors,\n            const vector<Mat>& testImgDescriptors,\n            vector<IMatch>& matches, const Mat& mask = Mat());\n\nprotected:\n\n    void compareImgDescriptor(const Mat& queryImgDescriptor,\n            int queryIndex, const vector<Mat>& testImgDescriptors,\n            vector<IMatch>& matches);\n\n    void addImgDescriptor(const Mat& queryImgDescriptor);\n\n    //the getLikelihoods method is overwritten for each different FabMap\n    //method.\n    virtual void getLikelihoods(const Mat& queryImgDescriptor,\n            const vector<Mat>& testImgDescriptors,\n            vector<IMatch>& matches);\n    virtual double getNewPlaceLikelihood(const Mat& queryImgDescriptor);\n\n    //turn likelihoods into probabilities (also add in motion model if used)\n    void normaliseDistribution(vector<IMatch>& matches);\n\n    //Chow-Liu Tree\n    int pq(int q);\n    double Pzq(int q, bool zq);\n    double PzqGzpq(int q, bool zq, bool zpq);\n\n    //FAB-MAP Core\n    double PzqGeq(bool zq, bool eq);\n    double PeqGL(int q, bool Lzq, bool eq);\n    double PzqGL(int q, bool zq, bool zpq, bool Lzq);\n    double PzqGzpqL(int q, bool zq, bool zpq, bool Lzq);\n    double (FabMap::*PzGL)(int q, bool zq, bool zpq, bool Lzq);\n\n    //data\n    Mat clTree;\n    vector<Mat> trainingImgDescriptors;\n    vector<Mat> testImgDescriptors;\n    vector<IMatch> priorMatches;\n\n    //parameters\n    double PzGe;\n    double PzGNe;\n    double Pnew;\n\n    double mBias;\n    double sFactor;\n\n    int flags;\n    int numSamples;\n\n};\n\n/*\n    The original FAB-MAP algorithm, developed based on:\n    http://ijr.sagepub.com/content/27/6/647.short\n*/\nclass CV_EXPORTS FabMap1: public FabMap {\npublic:\n    FabMap1(const Mat& clTree, double PzGe, double PzGNe, int flags,\n            int numSamples = 0);\n    virtual ~FabMap1();\nprotected:\n\n    //FabMap1 implementation of likelihood comparison\n    void getLikelihoods(const Mat& queryImgDescriptor, const vector<\n            Mat>& testImgDescriptors, vector<IMatch>& matches);\n};\n\n/*\n    A computationally faster version of the original FAB-MAP algorithm. A look-\n    up-table is used to precompute many of the reoccuring calculations\n*/\nclass CV_EXPORTS FabMapLUT: public FabMap {\npublic:\n    FabMapLUT(const Mat& clTree, double PzGe, double PzGNe,\n            int flags, int numSamples = 0, int precision = 6);\n    virtual ~FabMapLUT();\nprotected:\n\n    //FabMap look-up-table implementation of the likelihood comparison\n    void getLikelihoods(const Mat& queryImgDescriptor, const vector<\n            Mat>& testImgDescriptors, vector<IMatch>& matches);\n\n    //precomputed data\n    int (*table)[8];\n\n    //data precision\n    int precision;\n};\n\n/*\n    The Accelerated FAB-MAP algorithm, developed based on:\n    http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=5613942\n*/\nclass CV_EXPORTS FabMapFBO: public FabMap {\npublic:\n    FabMapFBO(const Mat& clTree, double PzGe, double PzGNe, int flags,\n            int numSamples = 0, double rejectionThreshold = 1e-8, double PsGd =\n                    1e-8, int bisectionStart = 512, int bisectionIts = 9);\n    virtual ~FabMapFBO();\n\nprotected:\n\n    //FabMap Fast Bail-out implementation of the likelihood comparison\n    void getLikelihoods(const Mat& queryImgDescriptor, const vector<\n            Mat>& testImgDescriptors, vector<IMatch>& matches);\n\n    //stucture used to determine word comparison order\n    struct WordStats {\n        WordStats() :\n            q(0), info(0), V(0), M(0) {\n        }\n\n        WordStats(int _q, double _info) :\n            q(_q), info(_info), V(0), M(0) {\n        }\n\n        int q;\n        double info;\n        mutable double V;\n        mutable double M;\n\n        bool operator<(const WordStats& w) const {\n            return info < w.info;\n        }\n\n    };\n\n    //private fast bail-out necessary functions\n    void setWordStatistics(const Mat& queryImgDescriptor, multiset<WordStats>& wordData);\n    double limitbisection(double v, double m);\n    double bennettInequality(double v, double m, double delta);\n    static bool compInfo(const WordStats& first, const WordStats& second);\n\n    //parameters\n    double PsGd;\n    double rejectionThreshold;\n    int bisectionStart;\n    int bisectionIts;\n};\n\n/*\n    The FAB-MAP2.0 algorithm, developed based on:\n    http://ijr.sagepub.com/content/30/9/1100.abstract\n*/\nclass CV_EXPORTS FabMap2: public FabMap {\npublic:\n\n    FabMap2(const Mat& clTree, double PzGe, double PzGNe, int flags);\n    virtual ~FabMap2();\n\n    //FabMap2 builds the inverted index and requires an additional training/test\n    //add function\n    void addTraining(const Mat& queryImgDescriptors) {\n        FabMap::addTraining(queryImgDescriptors);\n    }\n    void addTraining(const vector<Mat>& queryImgDescriptors);\n\n    void add(const Mat& queryImgDescriptors) {\n        FabMap::add(queryImgDescriptors);\n    }\n    void add(const vector<Mat>& queryImgDescriptors);\n\nprotected:\n\n    //FabMap2 implementation of the likelihood comparison\n    void getLikelihoods(const Mat& queryImgDescriptor, const vector<\n            Mat>& testImgDescriptors, vector<IMatch>& matches);\n    double getNewPlaceLikelihood(const Mat& queryImgDescriptor);\n\n    //the likelihood function using the inverted index\n    void getIndexLikelihoods(const Mat& queryImgDescriptor, vector<\n                             double>& defaults, map<int, vector<int> >& invertedMap,\n            vector<IMatch>& matches);\n    void addToIndex(const Mat& queryImgDescriptor,\n            vector<double>& defaults,\n            map<int, vector<int> >& invertedMap);\n\n    //data\n    vector<double> d1, d2, d3, d4;\n    vector<vector<int> > children;\n\n    // TODO: inverted map a vector?\n\n    vector<double> trainingDefaults;\n    map<int, vector<int> > trainingInvertedMap;\n\n    vector<double> testDefaults;\n    map<int, vector<int> > testInvertedMap;\n\n};\n/*\n    A Chow-Liu tree is required by FAB-MAP. The Chow-Liu tree provides an\n    estimate of the full distribution of visual words using a minimum spanning\n    tree. The tree is generated through training data.\n*/\nclass CV_EXPORTS ChowLiuTree {\npublic:\n    ChowLiuTree();\n    virtual ~ChowLiuTree();\n\n    //add data to the chow-liu tree before calling make\n    void add(const Mat& imgDescriptor);\n    void add(const vector<Mat>& imgDescriptors);\n\n    const vector<Mat>& getImgDescriptors() const;\n\n    Mat make(double infoThreshold = 0.0);\n\nprivate:\n    vector<Mat> imgDescriptors;\n    Mat mergedImgDescriptors;\n\n    typedef struct info {\n        float score;\n        short word1;\n        short word2;\n    } info;\n\n    //probabilities extracted from mergedImgDescriptors\n    double P(int a, bool za);\n    double JP(int a, bool za, int b, bool zb); //a & b\n    double CP(int a, bool za, int b, bool zb); // a | b\n\n    //calculating mutual information of all edges\n    void createBaseEdges(list<info>& edges, double infoThreshold);\n    double calcMutInfo(int word1, int word2);\n    static bool sortInfoScores(const info& first, const info& second);\n\n    //selecting minimum spanning egdges with maximum information\n    bool reduceEdgesToMinSpan(list<info>& edges);\n\n    //building the tree sctructure\n    Mat buildTree(int root_word, list<info> &edges);\n    void recAddToTree(Mat &cltree, int q, int pq,\n        list<info> &remaining_edges);\n    vector<int> extractChildren(list<info> &remaining_edges, int q);\n\n};\n\n/*\n    A custom vocabulary training method based on:\n    http://www.springerlink.com/content/d1h6j8x552532003/\n*/\nclass CV_EXPORTS BOWMSCTrainer: public BOWTrainer {\npublic:\n    BOWMSCTrainer(double clusterSize = 0.4);\n    virtual ~BOWMSCTrainer();\n\n    // Returns trained vocabulary (i.e. cluster centers).\n    virtual Mat cluster() const;\n    virtual Mat cluster(const Mat& descriptors) const;\n\nprotected:\n\n    double clusterSize;\n\n};\n\n}\n\n}\n\n#endif /* OPENFABMAP_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/contrib/retina.hpp",
    "content": "/*#******************************************************************************\n ** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n **\n ** By downloading, copying, installing or using the software you agree to this license.\n ** If you do not agree to this license, do not download, install,\n ** copy or use the software.\n **\n **\n ** HVStools : interfaces allowing OpenCV users to integrate Human Vision System models. Presented models originate from Jeanny Herault's original research and have been reused and adapted by the author&collaborators for computed vision applications since his thesis with Alice Caplier at Gipsa-Lab.\n ** Use: extract still images & image sequences features, from contours details to motion spatio-temporal features, etc. for high level visual scene analysis. Also contribute to image enhancement/compression such as tone mapping.\n **\n ** Maintainers : Listic lab (code author current affiliation & applications) and Gipsa Lab (original research origins & applications)\n **\n **  Creation - enhancement process 2007-2011\n **      Author: Alexandre Benoit (benoit.alexandre.vision@gmail.com), LISTIC lab, Annecy le vieux, France\n **\n ** Theses algorithm have been developped by Alexandre BENOIT since his thesis with Alice Caplier at Gipsa-Lab (www.gipsa-lab.inpg.fr) and the research he pursues at LISTIC Lab (www.listic.univ-savoie.fr).\n ** Refer to the following research paper for more information:\n ** Benoit A., Caplier A., Durette B., Herault, J., \"USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING\", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011\n ** This work have been carried out thanks to Jeanny Herault who's research and great discussions are the basis of all this work, please take a look at his book:\n ** Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.\n **\n ** The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author :\n ** _take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper:\n ** ====> B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). \"Efficient demosaicing through recursive filtering\", IEEE International Conference on Image Processing ICIP 2007\n ** _take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions.\n ** ====> more informations in the above cited Jeanny Heraults's book.\n **\n **                          License Agreement\n **               For Open Source Computer Vision Library\n **\n ** Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n ** Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.\n **\n **               For Human Visual System tools (hvstools)\n ** Copyright (C) 2007-2011, LISTIC Lab, Annecy le Vieux and GIPSA Lab, Grenoble, France, all rights reserved.\n **\n ** Third party copyrights are property of their respective owners.\n **\n ** Redistribution and use in source and binary forms, with or without modification,\n ** are permitted provided that the following conditions are met:\n **\n ** * Redistributions of source code must retain the above copyright notice,\n **    this list of conditions and the following disclaimer.\n **\n ** * Redistributions in binary form must reproduce the above copyright notice,\n **    this list of conditions and the following disclaimer in the documentation\n **    and/or other materials provided with the distribution.\n **\n ** * The name of the copyright holders may not be used to endorse or promote products\n **    derived from this software without specific prior written permission.\n **\n ** This software is provided by the copyright holders and contributors \"as is\" and\n ** any express or implied warranties, including, but not limited to, the implied\n ** warranties of merchantability and fitness for a particular purpose are disclaimed.\n ** In no event shall the Intel Corporation or contributors be liable for any direct,\n ** indirect, incidental, special, exemplary, or consequential damages\n ** (including, but not limited to, procurement of substitute goods or services;\n ** loss of use, data, or profits; or business interruption) however caused\n ** and on any theory of liability, whether in contract, strict liability,\n ** or tort (including negligence or otherwise) arising in any way out of\n ** the use of this software, even if advised of the possibility of such damage.\n *******************************************************************************/\n\n#ifndef __OPENCV_CONTRIB_RETINA_HPP__\n#define __OPENCV_CONTRIB_RETINA_HPP__\n\n/*\n * Retina.hpp\n *\n *  Created on: Jul 19, 2011\n *      Author: Alexandre Benoit\n */\n\n#include \"opencv2/core/core.hpp\" // for all OpenCV core functionalities access, including cv::Exception support\n#include <valarray>\n\nnamespace cv\n{\n\nenum RETINA_COLORSAMPLINGMETHOD\n{\n    RETINA_COLOR_RANDOM, //!< each pixel position is either R, G or B in a random choice\n    RETINA_COLOR_DIAGONAL,//!< color sampling is RGBRGBRGB..., line 2 BRGBRGBRG..., line 3, GBRGBRGBR...\n    RETINA_COLOR_BAYER//!< standard bayer sampling\n};\n\nclass RetinaFilter;\n\n/**\n * a wrapper class which allows the Gipsa/Listic Labs model to be used.\n * This retina model allows spatio-temporal image processing (applied on still images, video sequences).\n * As a summary, these are the retina model properties:\n * => It applies a spectral whithening (mid-frequency details enhancement)\n * => high frequency spatio-temporal noise reduction\n * => low frequency luminance to be reduced (luminance range compression)\n * => local logarithmic luminance compression allows details to be enhanced in low light conditions\n *\n * USE : this model can be used basically for spatio-temporal video effects but also for :\n *      _using the getParvo method output matrix : texture analysiswith enhanced signal to noise ratio and enhanced details robust against input images luminance ranges\n *      _using the getMagno method output matrix : motion analysis also with the previously cited properties\n *\n * for more information, reer to the following papers :\n * Benoit A., Caplier A., Durette B., Herault, J., \"USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING\", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011\n * Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.\n *\n * The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author :\n * _take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper:\n * ====> B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). \"Efficient demosaicing through recursive filtering\", IEEE International Conference on Image Processing ICIP 2007\n * _take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions.\n * ====> more informations in the above cited Jeanny Heraults's book.\n */\nclass CV_EXPORTS Retina {\n\npublic:\n\n    // parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel\n    struct RetinaParameters{\n        struct OPLandIplParvoParameters{ // Outer Plexiform Layer (OPL) and Inner Plexiform Layer Parvocellular (IplParvo) parameters\n               OPLandIplParvoParameters():colorMode(true),\n                                 normaliseOutput(true),\n                                 photoreceptorsLocalAdaptationSensitivity(0.7f),\n                                 photoreceptorsTemporalConstant(0.5f),\n                                 photoreceptorsSpatialConstant(0.53f),\n                                 horizontalCellsGain(0.0f),\n                                 hcellsTemporalConstant(1.f),\n                                 hcellsSpatialConstant(7.f),\n                                 ganglionCellsSensitivity(0.7f){};// default setup\n               bool colorMode, normaliseOutput;\n               float photoreceptorsLocalAdaptationSensitivity, photoreceptorsTemporalConstant, photoreceptorsSpatialConstant, horizontalCellsGain, hcellsTemporalConstant, hcellsSpatialConstant, ganglionCellsSensitivity;\n           };\n           struct IplMagnoParameters{ // Inner Plexiform Layer Magnocellular channel (IplMagno)\n               IplMagnoParameters():\n                          normaliseOutput(true),\n                          parasolCells_beta(0.f),\n                          parasolCells_tau(0.f),\n                          parasolCells_k(7.f),\n                          amacrinCellsTemporalCutFrequency(1.2f),\n                          V0CompressionParameter(0.95f),\n                          localAdaptintegration_tau(0.f),\n                          localAdaptintegration_k(7.f){};// default setup\n               bool normaliseOutput;\n               float parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, V0CompressionParameter, localAdaptintegration_tau, localAdaptintegration_k;\n           };\n            struct OPLandIplParvoParameters OPLandIplParvo;\n            struct IplMagnoParameters IplMagno;\n    };\n\n    /**\n     * Main constructor with most commun use setup : create an instance of color ready retina model\n     * @param inputSize : the input frame size\n     */\n    Retina(Size inputSize);\n\n    /**\n     * Complete Retina filter constructor which allows all basic structural parameters definition\n         * @param inputSize : the input frame size\n     * @param colorMode : the chosen processing mode : with or without color processing\n     * @param colorSamplingMethod: specifies which kind of color sampling will be used\n     * @param useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used\n     * @param reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak\n     * @param samplingStrenght: only usefull if param useRetinaLogSampling=true, specifies the strenght of the log scale that is applied\n     */\n    Retina(Size inputSize, const bool colorMode, RETINA_COLORSAMPLINGMETHOD colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);\n\n    virtual ~Retina();\n\n    /**\n    * retreive retina input buffer size\n    */\n    Size inputSize();\n\n    /**\n    * retreive retina output buffer size\n    */\n    Size outputSize();\n\n    /**\n     * try to open an XML retina parameters file to adjust current retina instance setup\n     * => if the xml file does not exist, then default setup is applied\n     * => warning, Exceptions are thrown if read XML file is not valid\n     * @param retinaParameterFile : the parameters filename\n         * @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error\n     */\n    void setup(std::string retinaParameterFile=\"\", const bool applyDefaultSetupOnFailure=true);\n\n\n    /**\n     * try to open an XML retina parameters file to adjust current retina instance setup\n     * => if the xml file does not exist, then default setup is applied\n     * => warning, Exceptions are thrown if read XML file is not valid\n     * @param fs : the open Filestorage which contains retina parameters\n     * @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error\n     */\n    void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true);\n\n    /**\n     * try to open an XML retina parameters file to adjust current retina instance setup\n     * => if the xml file does not exist, then default setup is applied\n     * => warning, Exceptions are thrown if read XML file is not valid\n     * @param newParameters : a parameters structures updated with the new target configuration\n     */\n    void setup(RetinaParameters newParameters);\n\n    /**\n     * @return the current parameters setup\n     */\n    Retina::RetinaParameters getParameters();\n\n    /**\n     * parameters setup display method\n     * @return a string which contains formatted parameters information\n     */\n    const std::string printSetup();\n\n    /**\n     * write xml/yml formated parameters information\n     * @param fs : the filename of the xml file that will be open and writen with formatted parameters information\n     */\n    virtual void write( std::string fs ) const;\n\n\n    /**\n     * write xml/yml formated parameters information\n     * @param fs : a cv::Filestorage object ready to be filled\n         */\n    virtual void write( FileStorage& fs ) const;\n\n    /**\n     * setup the OPL and IPL parvo channels (see biologocal model)\n     * OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance (low frequency energy)\n     * IPL parvo is the OPL next processing stage, it refers to Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision.\n     * for more informations, please have a look at the paper Benoit A., Caplier A., Durette B., Herault, J., \"USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING\", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011\n     * @param colorMode : specifies if (true) color is processed of not (false) to then processing gray level image\n     * @param normaliseOutput : specifies if (true) output is rescaled between 0 and 255 of not (false)\n     * @param photoreceptorsLocalAdaptationSensitivity: the photoreceptors sensitivity renage is 0-1 (more log compression effect when value increases)\n     * @param photoreceptorsTemporalConstant: the time constant of the first order low pass filter of the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is frames, typical value is 1 frame\n     * @param photoreceptorsSpatialConstant: the spatial constant of the first order low pass filter of the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is pixels, typical value is 1 pixel\n     * @param horizontalCellsGain: gain of the horizontal cells network, if 0, then the mean value of the output is zero, if the parameter is near 1, then, the luminance is not filtered and is still reachable at the output, typicall value is 0\n     * @param HcellsTemporalConstant: the time constant of the first order low pass filter of the horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is frames, typical value is 1 frame, as the photoreceptors\n     * @param HcellsSpatialConstant: the spatial constant of the first order low pass filter of the horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels, typical value is 5 pixel, this value is also used for local contrast computing when computing the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular channel model)\n     * @param ganglionCellsSensitivity: the compression strengh of the ganglion cells local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 230\n     */\n    void setupOPLandIPLParvoChannel(const bool colorMode=true, const bool normaliseOutput = true, const float photoreceptorsLocalAdaptationSensitivity=0.7f, const float photoreceptorsTemporalConstant=0.5f, const float photoreceptorsSpatialConstant=0.53f, const float horizontalCellsGain=0, const float HcellsTemporalConstant=1, const float HcellsSpatialConstant=7, const float ganglionCellsSensitivity=0.7f);\n\n    /**\n     * set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel\n     * this channel processes signals outpint from OPL processing stage in peripheral vision, it allows motion information enhancement. It is decorrelated from the details channel. See reference paper for more details.\n     * @param normaliseOutput : specifies if (true) output is rescaled between 0 and 255 of not (false)\n     * @param parasolCells_beta: the low pass filter gain used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), typical value is 0\n     * @param parasolCells_tau: the low pass filter time constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical value is 0 (immediate response)\n     * @param parasolCells_k: the low pass filter spatial constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical value is 5\n     * @param amacrinCellsTemporalCutFrequency: the time constant of the first order high pass fiter of the magnocellular way (motion information channel), unit is frames, tipicall value is 5\n     * @param V0CompressionParameter: the compression strengh of the ganglion cells local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 200\n     * @param localAdaptintegration_tau: specifies the temporal constant of the low pas filter involved in the computation of the local \"motion mean\" for the local adaptation computation\n     * @param localAdaptintegration_k: specifies the spatial constant of the low pas filter involved in the computation of the local \"motion mean\" for the local adaptation computation\n     */\n    void setupIPLMagnoChannel(const bool normaliseOutput = true, const float parasolCells_beta=0, const float parasolCells_tau=0, const float parasolCells_k=7, const float amacrinCellsTemporalCutFrequency=1.2f, const float V0CompressionParameter=0.95f, const float localAdaptintegration_tau=0, const float localAdaptintegration_k=7);\n\n    /**\n     * method which allows retina to be applied on an input image, after run, encapsulated retina module is ready to deliver its outputs using dedicated acccessors, see getParvo and getMagno methods\n     * @param inputImage : the input cv::Mat image to be processed, can be gray level or BGR coded in any format (from 8bit to 16bits)\n     */\n    void run(const Mat &inputImage);\n\n    /**\n     * accessor of the details channel of the retina (models foveal vision)\n     * @param retinaOutput_parvo : the output buffer (reallocated if necessary), this output is rescaled for standard 8bits image processing use in OpenCV\n     */\n    void getParvo(Mat &retinaOutput_parvo);\n\n    /**\n     * accessor of the details channel of the retina (models foveal vision)\n     * @param retinaOutput_parvo : the output buffer (reallocated if necessary), this output is the original retina filter model output, without any quantification or rescaling\n     */\n    void getParvo(std::valarray<float> &retinaOutput_parvo);\n\n    /**\n     * accessor of the motion channel of the retina (models peripheral vision)\n     * @param retinaOutput_magno : the output buffer (reallocated if necessary), this output is rescaled for standard 8bits image processing use in OpenCV\n     */\n    void getMagno(Mat &retinaOutput_magno);\n\n    /**\n     * accessor of the motion channel of the retina (models peripheral vision)\n     * @param retinaOutput_magno : the output buffer (reallocated if necessary), this output is the original retina filter model output, without any quantification or rescaling\n     */\n    void getMagno(std::valarray<float> &retinaOutput_magno);\n\n    // original API level data accessors : get buffers addresses...\n    const std::valarray<float> & getMagno() const;\n    const std::valarray<float> & getParvo() const;\n\n    /**\n     * activate color saturation as the final step of the color demultiplexing process\n     * -> this saturation is a sigmoide function applied to each channel of the demultiplexed image.\n     * @param saturateColors: boolean that activates color saturation (if true) or desactivate (if false)\n     * @param colorSaturationValue: the saturation factor\n     */\n    void setColorSaturation(const bool saturateColors=true, const float colorSaturationValue=4.0);\n\n    /**\n     * clear all retina buffers (equivalent to opening the eyes after a long period of eye close ;o)\n     */\n    void clearBuffers();\n\n    /**\n    * Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated\n    * @param activate: true if Magnocellular output should be activated, false if not\n    */\n    void activateMovingContoursProcessing(const bool activate);\n\n    /**\n    * Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated\n    * @param activate: true if Parvocellular (contours information extraction) output should be activated, false if not\n    */\n    void activateContoursProcessing(const bool activate);\n\nprotected:\n    // Parameteres setup members\n    RetinaParameters _retinaParameters; // structure of parameters\n\n        // Retina model related modules\n    std::valarray<float> _inputBuffer; //!< buffer used to convert input cv::Mat to internal retina buffers format (valarrays)\n\n    // pointer to retina model\n    RetinaFilter* _retinaFilter; //!< the pointer to the retina module, allocated with instance construction\n\n    /**\n     * exports a valarray buffer outing from HVStools objects to a cv::Mat in CV_8UC1 (gray level picture) or CV_8UC3 (color) format\n     * @param grayMatrixToConvert the valarray to export to OpenCV\n     * @param nbRows : the number of rows of the valarray flatten matrix\n     * @param nbColumns : the number of rows of the valarray flatten matrix\n     * @param colorMode : a flag which mentions if matrix is color (true) or graylevel (false)\n     * @param outBuffer : the output matrix which is reallocated to satisfy Retina output buffer dimensions\n     */\n    void _convertValarrayBuffer2cvMat(const std::valarray<float> &grayMatrixToConvert, const unsigned int nbRows, const unsigned int nbColumns, const bool colorMode, Mat &outBuffer);\n\n    /**\n     *\n     * @param inputMatToConvert : the OpenCV cv::Mat that has to be converted to gray or RGB valarray buffer that will be processed by the retina model\n     * @param outputValarrayMatrix : the output valarray\n     * @return the input image color mode (color=true, gray levels=false)\n     */\n        bool _convertCvMat2ValarrayBuffer(const cv::Mat inputMatToConvert, std::valarray<float> &outputValarrayMatrix);\n\n    //! private method called by constructors, gathers their parameters and use them in a unified way\n    void _init(const Size inputSize, const bool colorMode, RETINA_COLORSAMPLINGMETHOD colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);\n\n\n};\n\n}\n#endif /* __OPENCV_CONTRIB_RETINA_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/features2d/features2d.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_FEATURES_2D_HPP__\n#define __OPENCV_FEATURES_2D_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/flann/miniflann.hpp\"\n\n#ifdef __cplusplus\n#include <limits>\n\nnamespace cv\n{\n\nCV_EXPORTS bool initModule_features2d();\n\n/*!\n The Keypoint Class\n\n The class instance stores a keypoint, i.e. a point feature found by one of many available keypoint detectors, such as\n Harris corner detector, cv::FAST, cv::StarDetector, cv::SURF, cv::SIFT, cv::LDetector etc.\n\n The keypoint is characterized by the 2D position, scale\n (proportional to the diameter of the neighborhood that needs to be taken into account),\n orientation and some other parameters. The keypoint neighborhood is then analyzed by another algorithm that builds a descriptor\n (usually represented as a feature vector). The keypoints representing the same object in different images can then be matched using\n cv::KDTree or another method.\n*/\nclass CV_EXPORTS_W_SIMPLE KeyPoint\n{\npublic:\n    //! the default constructor\n    CV_WRAP KeyPoint() : pt(0,0), size(0), angle(-1), response(0), octave(0), class_id(-1) {}\n    //! the full constructor\n    KeyPoint(Point2f _pt, float _size, float _angle=-1,\n            float _response=0, int _octave=0, int _class_id=-1)\n            : pt(_pt), size(_size), angle(_angle),\n            response(_response), octave(_octave), class_id(_class_id) {}\n    //! another form of the full constructor\n    CV_WRAP KeyPoint(float x, float y, float _size, float _angle=-1,\n            float _response=0, int _octave=0, int _class_id=-1)\n            : pt(x, y), size(_size), angle(_angle),\n            response(_response), octave(_octave), class_id(_class_id) {}\n\n    size_t hash() const;\n\n    //! converts vector of keypoints to vector of points\n    static void convert(const vector<KeyPoint>& keypoints,\n                        CV_OUT vector<Point2f>& points2f,\n                        const vector<int>& keypointIndexes=vector<int>());\n    //! converts vector of points to the vector of keypoints, where each keypoint is assigned the same size and the same orientation\n    static void convert(const vector<Point2f>& points2f,\n                        CV_OUT vector<KeyPoint>& keypoints,\n                        float size=1, float response=1, int octave=0, int class_id=-1);\n\n    //! computes overlap for pair of keypoints;\n    //! overlap is a ratio between area of keypoint regions intersection and\n    //! area of keypoint regions union (now keypoint region is circle)\n    static float overlap(const KeyPoint& kp1, const KeyPoint& kp2);\n\n    CV_PROP_RW Point2f pt; //!< coordinates of the keypoints\n    CV_PROP_RW float size; //!< diameter of the meaningful keypoint neighborhood\n    CV_PROP_RW float angle; //!< computed orientation of the keypoint (-1 if not applicable);\n                            //!< it's in [0,360) degrees and measured relative to\n                            //!< image coordinate system, ie in clockwise.\n    CV_PROP_RW float response; //!< the response by which the most strong keypoints have been selected. Can be used for the further sorting or subsampling\n    CV_PROP_RW int octave; //!< octave (pyramid layer) from which the keypoint has been extracted\n    CV_PROP_RW int class_id; //!< object class (if the keypoints need to be clustered by an object they belong to)\n};\n\n//! writes vector of keypoints to the file storage\nCV_EXPORTS void write(FileStorage& fs, const string& name, const vector<KeyPoint>& keypoints);\n//! reads vector of keypoints from the specified file storage node\nCV_EXPORTS void read(const FileNode& node, CV_OUT vector<KeyPoint>& keypoints);\n\n/*\n * A class filters a vector of keypoints.\n * Because now it is difficult to provide a convenient interface for all usage scenarios of the keypoints filter class,\n * it has only several needed by now static methods.\n */\nclass CV_EXPORTS KeyPointsFilter\n{\npublic:\n    KeyPointsFilter(){}\n\n    /*\n     * Remove keypoints within borderPixels of an image edge.\n     */\n    static void runByImageBorder( vector<KeyPoint>& keypoints, Size imageSize, int borderSize );\n    /*\n     * Remove keypoints of sizes out of range.\n     */\n    static void runByKeypointSize( vector<KeyPoint>& keypoints, float minSize,\n                                   float maxSize=FLT_MAX );\n    /*\n     * Remove keypoints from some image by mask for pixels of this image.\n     */\n    static void runByPixelsMask( vector<KeyPoint>& keypoints, const Mat& mask );\n    /*\n     * Remove duplicated keypoints.\n     */\n    static void removeDuplicated( vector<KeyPoint>& keypoints );\n\n    /*\n     * Retain the specified number of the best keypoints (according to the response)\n     */\n    static void retainBest( vector<KeyPoint>& keypoints, int npoints );\n};\n\n\n/************************************ Base Classes ************************************/\n\n/*\n * Abstract base class for 2D image feature detectors.\n */\nclass CV_EXPORTS_W FeatureDetector : public virtual Algorithm\n{\npublic:\n    virtual ~FeatureDetector();\n\n    /*\n     * Detect keypoints in an image.\n     * image        The image.\n     * keypoints    The detected keypoints.\n     * mask         Mask specifying where to look for keypoints (optional). Must be a char\n     *              matrix with non-zero values in the region of interest.\n     */\n    CV_WRAP void detect( const Mat& image, CV_OUT vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    /*\n     * Detect keypoints in an image set.\n     * images       Image collection.\n     * keypoints    Collection of keypoints detected in an input images. keypoints[i] is a set of keypoints detected in an images[i].\n     * masks        Masks for image set. masks[i] is a mask for images[i].\n     */\n    void detect( const vector<Mat>& images, vector<vector<KeyPoint> >& keypoints, const vector<Mat>& masks=vector<Mat>() ) const;\n\n    // Return true if detector object is empty\n    CV_WRAP virtual bool empty() const;\n\n    // Create feature detector by detector name.\n    CV_WRAP static Ptr<FeatureDetector> create( const string& detectorType );\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const = 0;\n\n    /*\n     * Remove keypoints that are not in the mask.\n     * Helper function, useful when wrapping a library call for keypoint detection that\n     * does not support a mask argument.\n     */\n    static void removeInvalidPoints( const Mat& mask, vector<KeyPoint>& keypoints );\n};\n\n\n/*\n * Abstract base class for computing descriptors for image keypoints.\n *\n * In this interface we assume a keypoint descriptor can be represented as a\n * dense, fixed-dimensional vector of some basic type. Most descriptors used\n * in practice follow this pattern, as it makes it very easy to compute\n * distances between descriptors. Therefore we represent a collection of\n * descriptors as a Mat, where each row is one keypoint descriptor.\n */\nclass CV_EXPORTS_W DescriptorExtractor : public virtual Algorithm\n{\npublic:\n    virtual ~DescriptorExtractor();\n\n    /*\n     * Compute the descriptors for a set of keypoints in an image.\n     * image        The image.\n     * keypoints    The input keypoints. Keypoints for which a descriptor cannot be computed are removed.\n     * descriptors  Copmputed descriptors. Row i is the descriptor for keypoint i.\n     */\n    CV_WRAP void compute( const Mat& image, CV_OUT CV_IN_OUT vector<KeyPoint>& keypoints, CV_OUT Mat& descriptors ) const;\n\n    /*\n     * Compute the descriptors for a keypoints collection detected in image collection.\n     * images       Image collection.\n     * keypoints    Input keypoints collection. keypoints[i] is keypoints detected in images[i].\n     *              Keypoints for which a descriptor cannot be computed are removed.\n     * descriptors  Descriptor collection. descriptors[i] are descriptors computed for set keypoints[i].\n     */\n    void compute( const vector<Mat>& images, vector<vector<KeyPoint> >& keypoints, vector<Mat>& descriptors ) const;\n\n    CV_WRAP virtual int descriptorSize() const = 0;\n    CV_WRAP virtual int descriptorType() const = 0;\n\n    CV_WRAP virtual bool empty() const;\n\n    CV_WRAP static Ptr<DescriptorExtractor> create( const string& descriptorExtractorType );\n\nprotected:\n    virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const = 0;\n\n    /*\n     * Remove keypoints within borderPixels of an image edge.\n     */\n    static void removeBorderKeypoints( vector<KeyPoint>& keypoints,\n                                      Size imageSize, int borderSize );\n};\n\n\n\n/*\n * Abstract base class for simultaneous 2D feature detection descriptor extraction.\n */\nclass CV_EXPORTS_W Feature2D : public FeatureDetector, public DescriptorExtractor\n{\npublic:\n    /*\n     * Detect keypoints in an image.\n     * image        The image.\n     * keypoints    The detected keypoints.\n     * mask         Mask specifying where to look for keypoints (optional). Must be a char\n     *              matrix with non-zero values in the region of interest.\n     * useProvidedKeypoints If true, the method will skip the detection phase and will compute\n     *                      descriptors for the provided keypoints\n     */\n    CV_WRAP_AS(detectAndCompute) virtual void operator()( InputArray image, InputArray mask,\n                                     CV_OUT vector<KeyPoint>& keypoints,\n                                     OutputArray descriptors,\n                                     bool useProvidedKeypoints=false ) const = 0;\n\n    CV_WRAP void compute( const Mat& image, CV_OUT CV_IN_OUT std::vector<KeyPoint>& keypoints, CV_OUT Mat& descriptors ) const;\n\n    // Create feature detector and descriptor extractor by name.\n    CV_WRAP static Ptr<Feature2D> create( const string& name );\n};\n\n/*!\n  BRISK implementation\n*/\nclass CV_EXPORTS_W BRISK : public Feature2D\n{\npublic:\n    CV_WRAP explicit BRISK(int thresh=30, int octaves=3, float patternScale=1.0f);\n\n    virtual ~BRISK();\n\n    // returns the descriptor size in bytes\n    int descriptorSize() const;\n    // returns the descriptor type\n    int descriptorType() const;\n\n    // Compute the BRISK features on an image\n    void operator()(InputArray image, InputArray mask, vector<KeyPoint>& keypoints) const;\n\n    // Compute the BRISK features and descriptors on an image\n    void operator()( InputArray image, InputArray mask, vector<KeyPoint>& keypoints,\n                      OutputArray descriptors, bool useProvidedKeypoints=false ) const;\n\n    AlgorithmInfo* info() const;\n\n    // custom setup\n    CV_WRAP explicit BRISK(std::vector<float> &radiusList, std::vector<int> &numberList,\n        float dMax=5.85f, float dMin=8.2f, std::vector<int> indexChange=std::vector<int>());\n\n    // call this to generate the kernel:\n    // circle of radius r (pixels), with n points;\n    // short pairings with dMax, long pairings with dMin\n    CV_WRAP void generateKernel(std::vector<float> &radiusList,\n        std::vector<int> &numberList, float dMax=5.85f, float dMin=8.2f,\n        std::vector<int> indexChange=std::vector<int>());\n\nprotected:\n\n    void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;\n    void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    void computeKeypointsNoOrientation(InputArray image, InputArray mask, vector<KeyPoint>& keypoints) const;\n    void computeDescriptorsAndOrOrientation(InputArray image, InputArray mask, vector<KeyPoint>& keypoints,\n                                       OutputArray descriptors, bool doDescriptors, bool doOrientation,\n                                       bool useProvidedKeypoints) const;\n\n    // Feature parameters\n    CV_PROP_RW int threshold;\n    CV_PROP_RW int octaves;\n\n    // some helper structures for the Brisk pattern representation\n    struct BriskPatternPoint{\n        float x;         // x coordinate relative to center\n        float y;         // x coordinate relative to center\n        float sigma;     // Gaussian smoothing sigma\n    };\n    struct BriskShortPair{\n        unsigned int i;  // index of the first pattern point\n        unsigned int j;  // index of other pattern point\n    };\n    struct BriskLongPair{\n        unsigned int i;  // index of the first pattern point\n        unsigned int j;  // index of other pattern point\n        int weighted_dx; // 1024.0/dx\n        int weighted_dy; // 1024.0/dy\n    };\n    inline int smoothedIntensity(const cv::Mat& image,\n                const cv::Mat& integral,const float key_x,\n                const float key_y, const unsigned int scale,\n                const unsigned int rot, const unsigned int point) const;\n    // pattern properties\n    BriskPatternPoint* patternPoints_;     //[i][rotation][scale]\n    unsigned int points_;                 // total number of collocation points\n    float* scaleList_;                     // lists the scaling per scale index [scale]\n    unsigned int* sizeList_;             // lists the total pattern size per scale index [scale]\n    static const unsigned int scales_;    // scales discretization\n    static const float scalerange_;     // span of sizes 40->4 Octaves - else, this needs to be adjusted...\n    static const unsigned int n_rot_;    // discretization of the rotation look-up\n\n    // pairs\n    int strings_;                        // number of uchars the descriptor consists of\n    float dMax_;                         // short pair maximum distance\n    float dMin_;                         // long pair maximum distance\n    BriskShortPair* shortPairs_;         // d<_dMax\n    BriskLongPair* longPairs_;             // d>_dMin\n    unsigned int noShortPairs_;         // number of shortParis\n    unsigned int noLongPairs_;             // number of longParis\n\n    // general\n    static const float basicSize_;\n};\n\n\n/*!\n ORB implementation.\n*/\nclass CV_EXPORTS_W ORB : public Feature2D\n{\npublic:\n    // the size of the signature in bytes\n    enum { kBytes = 32, HARRIS_SCORE=0, FAST_SCORE=1 };\n\n    CV_WRAP explicit ORB(int nfeatures = 500, float scaleFactor = 1.2f, int nlevels = 8, int edgeThreshold = 31,\n        int firstLevel = 0, int WTA_K=2, int scoreType=ORB::HARRIS_SCORE, int patchSize=31 );\n\n    // returns the descriptor size in bytes\n    int descriptorSize() const;\n    // returns the descriptor type\n    int descriptorType() const;\n\n    // Compute the ORB features and descriptors on an image\n    void operator()(InputArray image, InputArray mask, vector<KeyPoint>& keypoints) const;\n\n    // Compute the ORB features and descriptors on an image\n    void operator()( InputArray image, InputArray mask, vector<KeyPoint>& keypoints,\n                     OutputArray descriptors, bool useProvidedKeypoints=false ) const;\n\n    AlgorithmInfo* info() const;\n\nprotected:\n\n    void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;\n    void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    CV_PROP_RW int nfeatures;\n    CV_PROP_RW double scaleFactor;\n    CV_PROP_RW int nlevels;\n    CV_PROP_RW int edgeThreshold;\n    CV_PROP_RW int firstLevel;\n    CV_PROP_RW int WTA_K;\n    CV_PROP_RW int scoreType;\n    CV_PROP_RW int patchSize;\n};\n\ntypedef ORB OrbFeatureDetector;\ntypedef ORB OrbDescriptorExtractor;\n\n/*!\n  FREAK implementation\n*/\nclass CV_EXPORTS FREAK : public DescriptorExtractor\n{\npublic:\n    /** Constructor\n         * @param orientationNormalized enable orientation normalization\n         * @param scaleNormalized enable scale normalization\n         * @param patternScale scaling of the description pattern\n         * @param nOctaves number of octaves covered by the detected keypoints\n         * @param selectedPairs (optional) user defined selected pairs\n    */\n    explicit FREAK( bool orientationNormalized = true,\n           bool scaleNormalized = true,\n           float patternScale = 22.0f,\n           int nOctaves = 4,\n           const vector<int>& selectedPairs = vector<int>());\n    FREAK( const FREAK& rhs );\n    FREAK& operator=( const FREAK& );\n\n    virtual ~FREAK();\n\n    /** returns the descriptor length in bytes */\n    virtual int descriptorSize() const;\n\n    /** returns the descriptor type */\n    virtual int descriptorType() const;\n\n    /** select the 512 \"best description pairs\"\n         * @param images grayscale images set\n         * @param keypoints set of detected keypoints\n         * @param corrThresh correlation threshold\n         * @param verbose print construction information\n         * @return list of best pair indexes\n    */\n    vector<int> selectPairs( const vector<Mat>& images, vector<vector<KeyPoint> >& keypoints,\n                      const double corrThresh = 0.7, bool verbose = true );\n\n    AlgorithmInfo* info() const;\n\n    enum\n    {\n        NB_SCALES = 64, NB_PAIRS = 512, NB_ORIENPAIRS = 45\n    };\n\nprotected:\n    virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;\n    void buildPattern();\n    uchar meanIntensity( const Mat& image, const Mat& integral, const float kp_x, const float kp_y,\n                         const unsigned int scale, const unsigned int rot, const unsigned int point ) const;\n\n    bool orientationNormalized; //true if the orientation is normalized, false otherwise\n    bool scaleNormalized; //true if the scale is normalized, false otherwise\n    double patternScale; //scaling of the pattern\n    int nOctaves; //number of octaves\n    bool extAll; // true if all pairs need to be extracted for pairs selection\n\n    double patternScale0;\n    int nOctaves0;\n    vector<int> selectedPairs0;\n\n    struct PatternPoint\n    {\n        float x; // x coordinate relative to center\n        float y; // x coordinate relative to center\n        float sigma; // Gaussian smoothing sigma\n    };\n\n    struct DescriptionPair\n    {\n        uchar i; // index of the first point\n        uchar j; // index of the second point\n    };\n\n    struct OrientationPair\n    {\n        uchar i; // index of the first point\n        uchar j; // index of the second point\n        int weight_dx; // dx/(norm_sq))*4096\n        int weight_dy; // dy/(norm_sq))*4096\n    };\n\n    vector<PatternPoint> patternLookup; // look-up table for the pattern points (position+sigma of all points at all scales and orientation)\n    int patternSizes[NB_SCALES]; // size of the pattern at a specific scale (used to check if a point is within image boundaries)\n    DescriptionPair descriptionPairs[NB_PAIRS];\n    OrientationPair orientationPairs[NB_ORIENPAIRS];\n};\n\n\n/*!\n Maximal Stable Extremal Regions class.\n\n The class implements MSER algorithm introduced by J. Matas.\n Unlike SIFT, SURF and many other detectors in OpenCV, this is salient region detector,\n not the salient point detector.\n\n It returns the regions, each of those is encoded as a contour.\n*/\nclass CV_EXPORTS_W MSER : public FeatureDetector\n{\npublic:\n    //! the full constructor\n    CV_WRAP explicit MSER( int _delta=5, int _min_area=60, int _max_area=14400,\n          double _max_variation=0.25, double _min_diversity=.2,\n          int _max_evolution=200, double _area_threshold=1.01,\n          double _min_margin=0.003, int _edge_blur_size=5 );\n\n    //! the operator that extracts the MSERs from the image or the specific part of it\n    CV_WRAP_AS(detect) void operator()( const Mat& image, CV_OUT vector<vector<Point> >& msers,\n                                        const Mat& mask=Mat() ) const;\n    AlgorithmInfo* info() const;\n\nprotected:\n    void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    int delta;\n    int minArea;\n    int maxArea;\n    double maxVariation;\n    double minDiversity;\n    int maxEvolution;\n    double areaThreshold;\n    double minMargin;\n    int edgeBlurSize;\n};\n\ntypedef MSER MserFeatureDetector;\n\n/*!\n The \"Star\" Detector.\n\n The class implements the keypoint detector introduced by K. Konolige.\n*/\nclass CV_EXPORTS_W StarDetector : public FeatureDetector\n{\npublic:\n    //! the full constructor\n    CV_WRAP StarDetector(int _maxSize=45, int _responseThreshold=30,\n                 int _lineThresholdProjected=10,\n                 int _lineThresholdBinarized=8,\n                 int _suppressNonmaxSize=5);\n\n    //! finds the keypoints in the image\n    CV_WRAP_AS(detect) void operator()(const Mat& image,\n                CV_OUT vector<KeyPoint>& keypoints) const;\n\n    AlgorithmInfo* info() const;\n\nprotected:\n    void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    int maxSize;\n    int responseThreshold;\n    int lineThresholdProjected;\n    int lineThresholdBinarized;\n    int suppressNonmaxSize;\n};\n\n//! detects corners using FAST algorithm by E. Rosten\nCV_EXPORTS void FAST( InputArray image, CV_OUT vector<KeyPoint>& keypoints,\n                      int threshold, bool nonmaxSuppression=true );\n\nCV_EXPORTS void FASTX( InputArray image, CV_OUT vector<KeyPoint>& keypoints,\n                      int threshold, bool nonmaxSuppression, int type );\n\nclass CV_EXPORTS_W FastFeatureDetector : public FeatureDetector\n{\npublic:\n\n    enum\n    { // Define it in old class to simplify migration to 2.5\n      TYPE_5_8 = 0, TYPE_7_12 = 1, TYPE_9_16 = 2\n    };\n\n    CV_WRAP FastFeatureDetector( int threshold=10, bool nonmaxSuppression=true );\n    AlgorithmInfo* info() const;\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    int threshold;\n    bool nonmaxSuppression;\n};\n\n\nclass CV_EXPORTS_W GFTTDetector : public FeatureDetector\n{\npublic:\n    CV_WRAP GFTTDetector( int maxCorners=1000, double qualityLevel=0.01, double minDistance=1,\n                          int blockSize=3, bool useHarrisDetector=false, double k=0.04 );\n    AlgorithmInfo* info() const;\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    int nfeatures;\n    double qualityLevel;\n    double minDistance;\n    int blockSize;\n    bool useHarrisDetector;\n    double k;\n};\n\ntypedef GFTTDetector GoodFeaturesToTrackDetector;\ntypedef StarDetector StarFeatureDetector;\n\nclass CV_EXPORTS_W SimpleBlobDetector : public FeatureDetector\n{\npublic:\n  struct CV_EXPORTS_W_SIMPLE Params\n  {\n      CV_WRAP Params();\n      CV_PROP_RW float thresholdStep;\n      CV_PROP_RW float minThreshold;\n      CV_PROP_RW float maxThreshold;\n      CV_PROP_RW size_t minRepeatability;\n      CV_PROP_RW float minDistBetweenBlobs;\n\n      CV_PROP_RW bool filterByColor;\n      CV_PROP_RW uchar blobColor;\n\n      CV_PROP_RW bool filterByArea;\n      CV_PROP_RW float minArea, maxArea;\n\n      CV_PROP_RW bool filterByCircularity;\n      CV_PROP_RW float minCircularity, maxCircularity;\n\n      CV_PROP_RW bool filterByInertia;\n      CV_PROP_RW float minInertiaRatio, maxInertiaRatio;\n\n      CV_PROP_RW bool filterByConvexity;\n      CV_PROP_RW float minConvexity, maxConvexity;\n\n      void read( const FileNode& fn );\n      void write( FileStorage& fs ) const;\n  };\n\n  CV_WRAP SimpleBlobDetector(const SimpleBlobDetector::Params &parameters = SimpleBlobDetector::Params());\n\n  virtual void read( const FileNode& fn );\n  virtual void write( FileStorage& fs ) const;\n\nprotected:\n  struct CV_EXPORTS Center\n  {\n      Point2d location;\n      double radius;\n      double confidence;\n  };\n\n  virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n  virtual void findBlobs(const Mat &image, const Mat &binaryImage, vector<Center> &centers) const;\n\n  Params params;\n  AlgorithmInfo* info() const;\n};\n\n\nclass CV_EXPORTS DenseFeatureDetector : public FeatureDetector\n{\npublic:\n    explicit DenseFeatureDetector( float initFeatureScale=1.f, int featureScaleLevels=1,\n                                   float featureScaleMul=0.1f,\n                                   int initXyStep=6, int initImgBound=0,\n                                   bool varyXyStepWithScale=true,\n                                   bool varyImgBoundWithScale=false );\n    AlgorithmInfo* info() const;\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    double initFeatureScale;\n    int featureScaleLevels;\n    double featureScaleMul;\n\n    int initXyStep;\n    int initImgBound;\n\n    bool varyXyStepWithScale;\n    bool varyImgBoundWithScale;\n};\n\n/*\n * Adapts a detector to partition the source image into a grid and detect\n * points in each cell.\n */\nclass CV_EXPORTS_W GridAdaptedFeatureDetector : public FeatureDetector\n{\npublic:\n    /*\n     * detector            Detector that will be adapted.\n     * maxTotalKeypoints   Maximum count of keypoints detected on the image. Only the strongest keypoints\n     *                      will be keeped.\n     * gridRows            Grid rows count.\n     * gridCols            Grid column count.\n     */\n    CV_WRAP GridAdaptedFeatureDetector( const Ptr<FeatureDetector>& detector=0,\n                                        int maxTotalKeypoints=1000,\n                                        int gridRows=4, int gridCols=4 );\n\n    // TODO implement read/write\n    virtual bool empty() const;\n\n    AlgorithmInfo* info() const;\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    Ptr<FeatureDetector> detector;\n    int maxTotalKeypoints;\n    int gridRows;\n    int gridCols;\n};\n\n/*\n * Adapts a detector to detect points over multiple levels of a Gaussian\n * pyramid. Useful for detectors that are not inherently scaled.\n */\nclass CV_EXPORTS_W PyramidAdaptedFeatureDetector : public FeatureDetector\n{\npublic:\n    // maxLevel - The 0-based index of the last pyramid layer\n    CV_WRAP PyramidAdaptedFeatureDetector( const Ptr<FeatureDetector>& detector, int maxLevel=2 );\n\n    // TODO implement read/write\n    virtual bool empty() const;\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    Ptr<FeatureDetector> detector;\n    int maxLevel;\n};\n\n/** \\brief A feature detector parameter adjuster, this is used by the DynamicAdaptedFeatureDetector\n *  and is a wrapper for FeatureDetector that allow them to be adjusted after a detection\n */\nclass CV_EXPORTS AdjusterAdapter: public FeatureDetector\n{\npublic:\n    /** pure virtual interface\n     */\n    virtual ~AdjusterAdapter() {}\n    /** too few features were detected so, adjust the detector params accordingly\n     * \\param min the minimum number of desired features\n     * \\param n_detected the number previously detected\n     */\n    virtual void tooFew(int min, int n_detected) = 0;\n    /** too many features were detected so, adjust the detector params accordingly\n     * \\param max the maximum number of desired features\n     * \\param n_detected the number previously detected\n     */\n    virtual void tooMany(int max, int n_detected) = 0;\n    /** are params maxed out or still valid?\n     * \\return false if the parameters can't be adjusted any more\n     */\n    virtual bool good() const = 0;\n\n    virtual Ptr<AdjusterAdapter> clone() const = 0;\n\n    static Ptr<AdjusterAdapter> create( const string& detectorType );\n};\n/** \\brief an adaptively adjusting detector that iteratively detects until the desired number\n * of features are detected.\n *  Beware that this is not thread safe - as the adjustment of parameters breaks the const\n *  of the detection routine...\n *  /TODO Make this const correct and thread safe\n *\n *  sample usage:\n //will create a detector that attempts to find 100 - 110 FAST Keypoints, and will at most run\n //FAST feature detection 10 times until that number of keypoints are found\n Ptr<FeatureDetector> detector(new DynamicAdaptedFeatureDetector(new FastAdjuster(20,true),100, 110, 10));\n\n */\nclass CV_EXPORTS DynamicAdaptedFeatureDetector: public FeatureDetector\n{\npublic:\n\n    /** \\param adjuster an AdjusterAdapter that will do the detection and parameter adjustment\n     *  \\param max_features the maximum desired number of features\n     *  \\param max_iters the maximum number of times to try to adjust the feature detector params\n     *          for the FastAdjuster this can be high, but with Star or Surf this can get time consuming\n     *  \\param min_features the minimum desired features\n     */\n    DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>& adjuster, int min_features=400, int max_features=500, int max_iters=5 );\n\n    virtual bool empty() const;\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\nprivate:\n    DynamicAdaptedFeatureDetector& operator=(const DynamicAdaptedFeatureDetector&);\n    DynamicAdaptedFeatureDetector(const DynamicAdaptedFeatureDetector&);\n\n    int escape_iters_;\n    int min_features_, max_features_;\n    const Ptr<AdjusterAdapter> adjuster_;\n};\n\n/**\\brief an adjust for the FAST detector. This will basically decrement or increment the\n * threshold by 1\n */\nclass CV_EXPORTS FastAdjuster: public AdjusterAdapter\n{\npublic:\n    /**\\param init_thresh the initial threshold to start with, default = 20\n     * \\param nonmax whether to use non max or not for fast feature detection\n     * \\param min_thresh\n     * \\param max_thresh\n     */\n    FastAdjuster(int init_thresh=20, bool nonmax=true, int min_thresh=1, int max_thresh=200);\n\n    virtual void tooFew(int minv, int n_detected);\n    virtual void tooMany(int maxv, int n_detected);\n    virtual bool good() const;\n\n    virtual Ptr<AdjusterAdapter> clone() const;\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    int thresh_;\n    bool nonmax_;\n    int init_thresh_, min_thresh_, max_thresh_;\n};\n\n\n/** An adjuster for StarFeatureDetector, this one adjusts the responseThreshold for now\n * TODO find a faster way to converge the parameters for Star - use CvStarDetectorParams\n */\nclass CV_EXPORTS StarAdjuster: public AdjusterAdapter\n{\npublic:\n    StarAdjuster(double initial_thresh=30.0, double min_thresh=2., double max_thresh=200.);\n\n    virtual void tooFew(int minv, int n_detected);\n    virtual void tooMany(int maxv, int n_detected);\n    virtual bool good() const;\n\n    virtual Ptr<AdjusterAdapter> clone() const;\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    double thresh_, init_thresh_, min_thresh_, max_thresh_;\n};\n\nclass CV_EXPORTS SurfAdjuster: public AdjusterAdapter\n{\npublic:\n    SurfAdjuster( double initial_thresh=400.f, double min_thresh=2, double max_thresh=1000 );\n\n    virtual void tooFew(int minv, int n_detected);\n    virtual void tooMany(int maxv, int n_detected);\n    virtual bool good() const;\n\n    virtual Ptr<AdjusterAdapter> clone() const;\n\nprotected:\n    virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n\n    double thresh_, init_thresh_, min_thresh_, max_thresh_;\n};\n\nCV_EXPORTS Mat windowedMatchingMask( const vector<KeyPoint>& keypoints1, const vector<KeyPoint>& keypoints2,\n                                     float maxDeltaX, float maxDeltaY );\n\n\n\n/*\n * OpponentColorDescriptorExtractor\n *\n * Adapts a descriptor extractor to compute descriptors in Opponent Color Space\n * (refer to van de Sande et al., CGIV 2008 \"Color Descriptors for Object Category Recognition\").\n * Input RGB image is transformed in Opponent Color Space. Then unadapted descriptor extractor\n * (set in constructor) computes descriptors on each of the three channel and concatenate\n * them into a single color descriptor.\n */\nclass CV_EXPORTS OpponentColorDescriptorExtractor : public DescriptorExtractor\n{\npublic:\n    OpponentColorDescriptorExtractor( const Ptr<DescriptorExtractor>& descriptorExtractor );\n\n    virtual void read( const FileNode& );\n    virtual void write( FileStorage& ) const;\n\n    virtual int descriptorSize() const;\n    virtual int descriptorType() const;\n\n    virtual bool empty() const;\n\nprotected:\n    virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;\n\n    Ptr<DescriptorExtractor> descriptorExtractor;\n};\n\n/*\n * BRIEF Descriptor\n */\nclass CV_EXPORTS BriefDescriptorExtractor : public DescriptorExtractor\n{\npublic:\n    static const int PATCH_SIZE = 48;\n    static const int KERNEL_SIZE = 9;\n\n    // bytes is a length of descriptor in bytes. It can be equal 16, 32 or 64 bytes.\n    BriefDescriptorExtractor( int bytes = 32 );\n\n    virtual void read( const FileNode& );\n    virtual void write( FileStorage& ) const;\n\n    virtual int descriptorSize() const;\n    virtual int descriptorType() const;\n\n    /// @todo read and write for brief\n\n    AlgorithmInfo* info() const;\n\nprotected:\n    virtual void computeImpl(const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors) const;\n\n    typedef void(*PixelTestFn)(const Mat&, const vector<KeyPoint>&, Mat&);\n\n    int bytes_;\n    PixelTestFn test_fn_;\n};\n\n\n/****************************************************************************************\\\n*                                      Distance                                          *\n\\****************************************************************************************/\n\ntemplate<typename T>\nstruct CV_EXPORTS Accumulator\n{\n    typedef T Type;\n};\n\ntemplate<> struct Accumulator<unsigned char>  { typedef float Type; };\ntemplate<> struct Accumulator<unsigned short> { typedef float Type; };\ntemplate<> struct Accumulator<char>   { typedef float Type; };\ntemplate<> struct Accumulator<short>  { typedef float Type; };\n\n/*\n * Squared Euclidean distance functor\n */\ntemplate<class T>\nstruct CV_EXPORTS SL2\n{\n    enum { normType = NORM_L2SQR };\n    typedef T ValueType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    ResultType operator()( const T* a, const T* b, int size ) const\n    {\n        return normL2Sqr<ValueType, ResultType>(a, b, size);\n    }\n};\n\n/*\n * Euclidean distance functor\n */\ntemplate<class T>\nstruct CV_EXPORTS L2\n{\n    enum { normType = NORM_L2 };\n    typedef T ValueType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    ResultType operator()( const T* a, const T* b, int size ) const\n    {\n        return (ResultType)sqrt((double)normL2Sqr<ValueType, ResultType>(a, b, size));\n    }\n};\n\n/*\n * Manhattan distance (city block distance) functor\n */\ntemplate<class T>\nstruct CV_EXPORTS L1\n{\n    enum { normType = NORM_L1 };\n    typedef T ValueType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    ResultType operator()( const T* a, const T* b, int size ) const\n    {\n        return normL1<ValueType, ResultType>(a, b, size);\n    }\n};\n\n/*\n * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor\n * bit count of A exclusive XOR'ed with B\n */\nstruct CV_EXPORTS Hamming\n{\n    enum { normType = NORM_HAMMING };\n    typedef unsigned char ValueType;\n    typedef int ResultType;\n\n    /** this will count the bits in a ^ b\n     */\n    ResultType operator()( const unsigned char* a, const unsigned char* b, int size ) const\n    {\n        return normHamming(a, b, size);\n    }\n};\n\ntypedef Hamming HammingLUT;\n\ntemplate<int cellsize> struct HammingMultilevel\n{\n    enum { normType = NORM_HAMMING + (cellsize>1) };\n    typedef unsigned char ValueType;\n    typedef int ResultType;\n\n    ResultType operator()( const unsigned char* a, const unsigned char* b, int size ) const\n    {\n        return normHamming(a, b, size, cellsize);\n    }\n};\n\n/****************************************************************************************\\\n*                                      DMatch                                            *\n\\****************************************************************************************/\n/*\n * Struct for matching: query descriptor index, train descriptor index, train image index and distance between descriptors.\n */\nstruct CV_EXPORTS_W_SIMPLE DMatch\n{\n    CV_WRAP DMatch() : queryIdx(-1), trainIdx(-1), imgIdx(-1), distance(FLT_MAX) {}\n    CV_WRAP DMatch( int _queryIdx, int _trainIdx, float _distance ) :\n            queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(-1), distance(_distance) {}\n    CV_WRAP DMatch( int _queryIdx, int _trainIdx, int _imgIdx, float _distance ) :\n            queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(_imgIdx), distance(_distance) {}\n\n    CV_PROP_RW int queryIdx; // query descriptor index\n    CV_PROP_RW int trainIdx; // train descriptor index\n    CV_PROP_RW int imgIdx;   // train image index\n\n    CV_PROP_RW float distance;\n\n    // less is better\n    bool operator<( const DMatch &m ) const\n    {\n        return distance < m.distance;\n    }\n};\n\n/****************************************************************************************\\\n*                                  DescriptorMatcher                                     *\n\\****************************************************************************************/\n/*\n * Abstract base class for matching two sets of descriptors.\n */\nclass CV_EXPORTS_W DescriptorMatcher : public Algorithm\n{\npublic:\n    virtual ~DescriptorMatcher();\n\n    /*\n     * Add descriptors to train descriptor collection.\n     * descriptors      Descriptors to add. Each descriptors[i] is a descriptors set from one image.\n     */\n    CV_WRAP virtual void add( const vector<Mat>& descriptors );\n    /*\n     * Get train descriptors collection.\n     */\n    CV_WRAP const vector<Mat>& getTrainDescriptors() const;\n    /*\n     * Clear train descriptors collection.\n     */\n    CV_WRAP virtual void clear();\n\n    /*\n     * Return true if there are not train descriptors in collection.\n     */\n    CV_WRAP virtual bool empty() const;\n    /*\n     * Return true if the matcher supports mask in match methods.\n     */\n    CV_WRAP virtual bool isMaskSupported() const = 0;\n\n    /*\n     * Train matcher (e.g. train flann index).\n     * In all methods to match the method train() is run every time before matching.\n     * Some descriptor matchers (e.g. BruteForceMatcher) have empty implementation\n     * of this method, other matchers really train their inner structures\n     * (e.g. FlannBasedMatcher trains flann::Index). So nonempty implementation\n     * of train() should check the class object state and do traing/retraining\n     * only if the state requires that (e.g. FlannBasedMatcher trains flann::Index\n     * if it has not trained yet or if new descriptors have been added to the train\n     * collection).\n     */\n    CV_WRAP virtual void train();\n    /*\n     * Group of methods to match descriptors from image pair.\n     * Method train() is run in this methods.\n     */\n    // Find one best match for each query descriptor (if mask is empty).\n    CV_WRAP void match( const Mat& queryDescriptors, const Mat& trainDescriptors,\n                CV_OUT vector<DMatch>& matches, const Mat& mask=Mat() ) const;\n    // Find k best matches for each query descriptor (in increasing order of distances).\n    // compactResult is used when mask is not empty. If compactResult is false matches\n    // vector will have the same size as queryDescriptors rows. If compactResult is true\n    // matches vector will not contain matches for fully masked out query descriptors.\n    CV_WRAP void knnMatch( const Mat& queryDescriptors, const Mat& trainDescriptors,\n                   CV_OUT vector<vector<DMatch> >& matches, int k,\n                   const Mat& mask=Mat(), bool compactResult=false ) const;\n    // Find best matches for each query descriptor which have distance less than\n    // maxDistance (in increasing order of distances).\n    void radiusMatch( const Mat& queryDescriptors, const Mat& trainDescriptors,\n                      vector<vector<DMatch> >& matches, float maxDistance,\n                      const Mat& mask=Mat(), bool compactResult=false ) const;\n    /*\n     * Group of methods to match descriptors from one image to image set.\n     * See description of similar methods for matching image pair above.\n     */\n    CV_WRAP void match( const Mat& queryDescriptors, CV_OUT vector<DMatch>& matches,\n                const vector<Mat>& masks=vector<Mat>() );\n    CV_WRAP void knnMatch( const Mat& queryDescriptors, CV_OUT vector<vector<DMatch> >& matches, int k,\n           const vector<Mat>& masks=vector<Mat>(), bool compactResult=false );\n    void radiusMatch( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance,\n                   const vector<Mat>& masks=vector<Mat>(), bool compactResult=false );\n\n    // Reads matcher object from a file node\n    virtual void read( const FileNode& );\n    // Writes matcher object to a file storage\n    virtual void write( FileStorage& ) const;\n\n    // Clone the matcher. If emptyTrainData is false the method create deep copy of the object, i.e. copies\n    // both parameters and train data. If emptyTrainData is true the method create object copy with current parameters\n    // but with empty train data.\n    virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;\n\n    CV_WRAP static Ptr<DescriptorMatcher> create( const string& descriptorMatcherType );\nprotected:\n    /*\n     * Class to work with descriptors from several images as with one merged matrix.\n     * It is used e.g. in FlannBasedMatcher.\n     */\n    class CV_EXPORTS DescriptorCollection\n    {\n    public:\n        DescriptorCollection();\n        DescriptorCollection( const DescriptorCollection& collection );\n        virtual ~DescriptorCollection();\n\n        // Vector of matrices \"descriptors\" will be merged to one matrix \"mergedDescriptors\" here.\n        void set( const vector<Mat>& descriptors );\n        virtual void clear();\n\n        const Mat& getDescriptors() const;\n        const Mat getDescriptor( int imgIdx, int localDescIdx ) const;\n        const Mat getDescriptor( int globalDescIdx ) const;\n        void getLocalIdx( int globalDescIdx, int& imgIdx, int& localDescIdx ) const;\n\n        int size() const;\n\n    protected:\n        Mat mergedDescriptors;\n        vector<int> startIdxs;\n    };\n\n    // In fact the matching is implemented only by the following two methods. These methods suppose\n    // that the class object has been trained already. Public match methods call these methods\n    // after calling train().\n    virtual void knnMatchImpl( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, int k,\n           const vector<Mat>& masks=vector<Mat>(), bool compactResult=false ) = 0;\n    virtual void radiusMatchImpl( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance,\n           const vector<Mat>& masks=vector<Mat>(), bool compactResult=false ) = 0;\n\n    static bool isPossibleMatch( const Mat& mask, int queryIdx, int trainIdx );\n    static bool isMaskedOut( const vector<Mat>& masks, int queryIdx );\n\n    static Mat clone_op( Mat m ) { return m.clone(); }\n    void checkMasks( const vector<Mat>& masks, int queryDescriptorsCount ) const;\n\n    // Collection of descriptors from train images.\n    vector<Mat> trainDescCollection;\n};\n\n/*\n * Brute-force descriptor matcher.\n *\n * For each descriptor in the first set, this matcher finds the closest\n * descriptor in the second set by trying each one.\n *\n * For efficiency, BruteForceMatcher is templated on the distance metric.\n * For float descriptors, a common choice would be cv::L2<float>.\n */\nclass CV_EXPORTS_W BFMatcher : public DescriptorMatcher\n{\npublic:\n    CV_WRAP BFMatcher( int normType=NORM_L2, bool crossCheck=false );\n    virtual ~BFMatcher() {}\n\n    virtual bool isMaskSupported() const { return true; }\n\n    virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const;\n\n    AlgorithmInfo* info() const;\nprotected:\n    virtual void knnMatchImpl( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, int k,\n           const vector<Mat>& masks=vector<Mat>(), bool compactResult=false );\n    virtual void radiusMatchImpl( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance,\n           const vector<Mat>& masks=vector<Mat>(), bool compactResult=false );\n\n    int normType;\n    bool crossCheck;\n};\n\n\n/*\n * Flann based matcher\n */\nclass CV_EXPORTS_W FlannBasedMatcher : public DescriptorMatcher\n{\npublic:\n    CV_WRAP FlannBasedMatcher( const Ptr<flann::IndexParams>& indexParams=new flann::KDTreeIndexParams(),\n                       const Ptr<flann::SearchParams>& searchParams=new flann::SearchParams() );\n\n    virtual void add( const vector<Mat>& descriptors );\n    virtual void clear();\n\n    // Reads matcher object from a file node\n    virtual void read( const FileNode& );\n    // Writes matcher object to a file storage\n    virtual void write( FileStorage& ) const;\n\n    virtual void train();\n    virtual bool isMaskSupported() const;\n\n    virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const;\n\n    AlgorithmInfo* info() const;\nprotected:\n    static void convertToDMatches( const DescriptorCollection& descriptors,\n                                   const Mat& indices, const Mat& distances,\n                                   vector<vector<DMatch> >& matches );\n\n    virtual void knnMatchImpl( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, int k,\n                   const vector<Mat>& masks=vector<Mat>(), bool compactResult=false );\n    virtual void radiusMatchImpl( const Mat& queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance,\n                   const vector<Mat>& masks=vector<Mat>(), bool compactResult=false );\n\n    Ptr<flann::IndexParams> indexParams;\n    Ptr<flann::SearchParams> searchParams;\n    Ptr<flann::Index> flannIndex;\n\n    DescriptorCollection mergedDescriptors;\n    int addedDescCount;\n};\n\n/****************************************************************************************\\\n*                                GenericDescriptorMatcher                                *\n\\****************************************************************************************/\n/*\n *   Abstract interface for a keypoint descriptor and matcher\n */\nclass GenericDescriptorMatcher;\ntypedef GenericDescriptorMatcher GenericDescriptorMatch;\n\nclass CV_EXPORTS GenericDescriptorMatcher\n{\npublic:\n    GenericDescriptorMatcher();\n    virtual ~GenericDescriptorMatcher();\n\n    /*\n     * Add train collection: images and keypoints from them.\n     * images       A set of train images.\n     * ketpoints    Keypoint collection that have been detected on train images.\n     *\n     * Keypoints for which a descriptor cannot be computed are removed. Such keypoints\n     * must be filtered in this method befor adding keypoints to train collection \"trainPointCollection\".\n     * If inheritor class need perform such prefiltering the method add() must be overloaded.\n     * In the other class methods programmer has access to the train keypoints by a constant link.\n     */\n    virtual void add( const vector<Mat>& images,\n                      vector<vector<KeyPoint> >& keypoints );\n\n    const vector<Mat>& getTrainImages() const;\n    const vector<vector<KeyPoint> >& getTrainKeypoints() const;\n\n    /*\n     * Clear images and keypoints storing in train collection.\n     */\n    virtual void clear();\n    /*\n     * Returns true if matcher supports mask to match descriptors.\n     */\n    virtual bool isMaskSupported() = 0;\n    /*\n     * Train some inner structures (e.g. flann index or decision trees).\n     * train() methods is run every time in matching methods. So the method implementation\n     * should has a check whether these inner structures need be trained/retrained or not.\n     */\n    virtual void train();\n\n    /*\n     * Classifies query keypoints.\n     * queryImage    The query image\n     * queryKeypoints   Keypoints from the query image\n     * trainImage    The train image\n     * trainKeypoints   Keypoints from the train image\n     */\n    // Classify keypoints from query image under one train image.\n    void classify( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                           const Mat& trainImage, vector<KeyPoint>& trainKeypoints ) const;\n    // Classify keypoints from query image under train image collection.\n    void classify( const Mat& queryImage, vector<KeyPoint>& queryKeypoints );\n\n    /*\n     * Group of methods to match keypoints from image pair.\n     * Keypoints for which a descriptor cannot be computed are removed.\n     * train() method is called here.\n     */\n    // Find one best match for each query descriptor (if mask is empty).\n    void match( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                const Mat& trainImage, vector<KeyPoint>& trainKeypoints,\n                vector<DMatch>& matches, const Mat& mask=Mat() ) const;\n    // Find k best matches for each query keypoint (in increasing order of distances).\n    // compactResult is used when mask is not empty. If compactResult is false matches\n    // vector will have the same size as queryDescriptors rows.\n    // If compactResult is true matches vector will not contain matches for fully masked out query descriptors.\n    void knnMatch( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                   const Mat& trainImage, vector<KeyPoint>& trainKeypoints,\n                   vector<vector<DMatch> >& matches, int k,\n                   const Mat& mask=Mat(), bool compactResult=false ) const;\n    // Find best matches for each query descriptor which have distance less than maxDistance (in increasing order of distances).\n    void radiusMatch( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                      const Mat& trainImage, vector<KeyPoint>& trainKeypoints,\n                      vector<vector<DMatch> >& matches, float maxDistance,\n                      const Mat& mask=Mat(), bool compactResult=false ) const;\n    /*\n     * Group of methods to match keypoints from one image to image set.\n     * See description of similar methods for matching image pair above.\n     */\n    void match( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                vector<DMatch>& matches, const vector<Mat>& masks=vector<Mat>() );\n    void knnMatch( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                   vector<vector<DMatch> >& matches, int k,\n                   const vector<Mat>& masks=vector<Mat>(), bool compactResult=false );\n    void radiusMatch( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                      vector<vector<DMatch> >& matches, float maxDistance,\n                      const vector<Mat>& masks=vector<Mat>(), bool compactResult=false );\n\n    // Reads matcher object from a file node\n    virtual void read( const FileNode& fn );\n    // Writes matcher object to a file storage\n    virtual void write( FileStorage& fs ) const;\n\n    // Return true if matching object is empty (e.g. feature detector or descriptor matcher are empty)\n    virtual bool empty() const;\n\n    // Clone the matcher. If emptyTrainData is false the method create deep copy of the object, i.e. copies\n    // both parameters and train data. If emptyTrainData is true the method create object copy with current parameters\n    // but with empty train data.\n    virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;\n\n    static Ptr<GenericDescriptorMatcher> create( const string& genericDescritptorMatcherType,\n                                                 const string &paramsFilename=string() );\n\nprotected:\n    // In fact the matching is implemented only by the following two methods. These methods suppose\n    // that the class object has been trained already. Public match methods call these methods\n    // after calling train().\n    virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                               vector<vector<DMatch> >& matches, int k,\n                               const vector<Mat>& masks, bool compactResult ) = 0;\n    virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                                  vector<vector<DMatch> >& matches, float maxDistance,\n                                  const vector<Mat>& masks, bool compactResult ) = 0;\n    /*\n     * A storage for sets of keypoints together with corresponding images and class IDs\n     */\n    class CV_EXPORTS KeyPointCollection\n    {\n    public:\n        KeyPointCollection();\n        KeyPointCollection( const KeyPointCollection& collection );\n        void add( const vector<Mat>& images, const vector<vector<KeyPoint> >& keypoints );\n        void clear();\n\n        // Returns the total number of keypoints in the collection\n        size_t keypointCount() const;\n        size_t imageCount() const;\n\n        const vector<vector<KeyPoint> >& getKeypoints() const;\n        const vector<KeyPoint>& getKeypoints( int imgIdx ) const;\n        const KeyPoint& getKeyPoint( int imgIdx, int localPointIdx ) const;\n        const KeyPoint& getKeyPoint( int globalPointIdx ) const;\n        void getLocalIdx( int globalPointIdx, int& imgIdx, int& localPointIdx ) const;\n\n        const vector<Mat>& getImages() const;\n        const Mat& getImage( int imgIdx ) const;\n\n    protected:\n        int pointCount;\n\n        vector<Mat> images;\n        vector<vector<KeyPoint> > keypoints;\n        // global indices of the first points in each image, startIndices.size() = keypoints.size()\n        vector<int> startIndices;\n\n    private:\n        static Mat clone_op( Mat m ) { return m.clone(); }\n    };\n\n    KeyPointCollection trainPointCollection;\n};\n\n\n/****************************************************************************************\\\n*                                VectorDescriptorMatcher                                 *\n\\****************************************************************************************/\n\n/*\n *  A class used for matching descriptors that can be described as vectors in a finite-dimensional space\n */\nclass VectorDescriptorMatcher;\ntypedef VectorDescriptorMatcher VectorDescriptorMatch;\n\nclass CV_EXPORTS VectorDescriptorMatcher : public GenericDescriptorMatcher\n{\npublic:\n    VectorDescriptorMatcher( const Ptr<DescriptorExtractor>& extractor, const Ptr<DescriptorMatcher>& matcher );\n    virtual ~VectorDescriptorMatcher();\n\n    virtual void add( const vector<Mat>& imgCollection,\n                      vector<vector<KeyPoint> >& pointCollection );\n\n    virtual void clear();\n\n    virtual void train();\n\n    virtual bool isMaskSupported();\n\n    virtual void read( const FileNode& fn );\n    virtual void write( FileStorage& fs ) const;\n    virtual bool empty() const;\n\n    virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const;\n\nprotected:\n    virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                               vector<vector<DMatch> >& matches, int k,\n                               const vector<Mat>& masks, bool compactResult );\n    virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                                  vector<vector<DMatch> >& matches, float maxDistance,\n                                  const vector<Mat>& masks, bool compactResult );\n\n    Ptr<DescriptorExtractor> extractor;\n    Ptr<DescriptorMatcher> matcher;\n};\n\n/****************************************************************************************\\\n*                                   Drawing functions                                    *\n\\****************************************************************************************/\nstruct CV_EXPORTS DrawMatchesFlags\n{\n    enum{ DEFAULT = 0, // Output image matrix will be created (Mat::create),\n                       // i.e. existing memory of output image may be reused.\n                       // Two source image, matches and single keypoints will be drawn.\n                       // For each keypoint only the center point will be drawn (without\n                       // the circle around keypoint with keypoint size and orientation).\n          DRAW_OVER_OUTIMG = 1, // Output image matrix will not be created (Mat::create).\n                                // Matches will be drawn on existing content of output image.\n          NOT_DRAW_SINGLE_POINTS = 2, // Single keypoints will not be drawn.\n          DRAW_RICH_KEYPOINTS = 4 // For each keypoint the circle around keypoint with keypoint size and\n                                  // orientation will be drawn.\n        };\n};\n\n// Draw keypoints.\nCV_EXPORTS_W void drawKeypoints( const Mat& image, const vector<KeyPoint>& keypoints, CV_OUT Mat& outImage,\n                               const Scalar& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT );\n\n// Draws matches of keypints from two images on output image.\nCV_EXPORTS void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1,\n                             const Mat& img2, const vector<KeyPoint>& keypoints2,\n                             const vector<DMatch>& matches1to2, Mat& outImg,\n                             const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1),\n                             const vector<char>& matchesMask=vector<char>(), int flags=DrawMatchesFlags::DEFAULT );\n\nCV_EXPORTS void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1,\n                             const Mat& img2, const vector<KeyPoint>& keypoints2,\n                             const vector<vector<DMatch> >& matches1to2, Mat& outImg,\n                             const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1),\n                             const vector<vector<char> >& matchesMask=vector<vector<char> >(), int flags=DrawMatchesFlags::DEFAULT );\n\n/****************************************************************************************\\\n*   Functions to evaluate the feature detectors and [generic] descriptor extractors      *\n\\****************************************************************************************/\n\nCV_EXPORTS void evaluateFeatureDetector( const Mat& img1, const Mat& img2, const Mat& H1to2,\n                                         vector<KeyPoint>* keypoints1, vector<KeyPoint>* keypoints2,\n                                         float& repeatability, int& correspCount,\n                                         const Ptr<FeatureDetector>& fdetector=Ptr<FeatureDetector>() );\n\nCV_EXPORTS void computeRecallPrecisionCurve( const vector<vector<DMatch> >& matches1to2,\n                                             const vector<vector<uchar> >& correctMatches1to2Mask,\n                                             vector<Point2f>& recallPrecisionCurve );\n\nCV_EXPORTS float getRecall( const vector<Point2f>& recallPrecisionCurve, float l_precision );\nCV_EXPORTS int getNearestPoint( const vector<Point2f>& recallPrecisionCurve, float l_precision );\n\nCV_EXPORTS void evaluateGenericDescriptorMatcher( const Mat& img1, const Mat& img2, const Mat& H1to2,\n                                                  vector<KeyPoint>& keypoints1, vector<KeyPoint>& keypoints2,\n                                                  vector<vector<DMatch> >* matches1to2, vector<vector<uchar> >* correctMatches1to2Mask,\n                                                  vector<Point2f>& recallPrecisionCurve,\n                                                  const Ptr<GenericDescriptorMatcher>& dmatch=Ptr<GenericDescriptorMatcher>() );\n\n\n/****************************************************************************************\\\n*                                     Bag of visual words                                *\n\\****************************************************************************************/\n/*\n * Abstract base class for training of a 'bag of visual words' vocabulary from a set of descriptors\n */\nclass CV_EXPORTS_W BOWTrainer\n{\npublic:\n    BOWTrainer();\n    virtual ~BOWTrainer();\n\n    CV_WRAP void add( const Mat& descriptors );\n    CV_WRAP const vector<Mat>& getDescriptors() const;\n    CV_WRAP int descripotorsCount() const;\n\n    CV_WRAP virtual void clear();\n\n    /*\n     * Train visual words vocabulary, that is cluster training descriptors and\n     * compute cluster centers.\n     * Returns cluster centers.\n     *\n     * descriptors      Training descriptors computed on images keypoints.\n     */\n    CV_WRAP virtual Mat cluster() const = 0;\n    CV_WRAP virtual Mat cluster( const Mat& descriptors ) const = 0;\n\nprotected:\n    vector<Mat> descriptors;\n    int size;\n};\n\n/*\n * This is BOWTrainer using cv::kmeans to get vocabulary.\n */\nclass CV_EXPORTS_W BOWKMeansTrainer : public BOWTrainer\n{\npublic:\n    CV_WRAP BOWKMeansTrainer( int clusterCount, const TermCriteria& termcrit=TermCriteria(),\n                      int attempts=3, int flags=KMEANS_PP_CENTERS );\n    virtual ~BOWKMeansTrainer();\n\n    // Returns trained vocabulary (i.e. cluster centers).\n    CV_WRAP virtual Mat cluster() const;\n    CV_WRAP virtual Mat cluster( const Mat& descriptors ) const;\n\nprotected:\n\n    int clusterCount;\n    TermCriteria termcrit;\n    int attempts;\n    int flags;\n};\n\n/*\n * Class to compute image descriptor using bag of visual words.\n */\nclass CV_EXPORTS_W BOWImgDescriptorExtractor\n{\npublic:\n    CV_WRAP BOWImgDescriptorExtractor( const Ptr<DescriptorExtractor>& dextractor,\n                               const Ptr<DescriptorMatcher>& dmatcher );\n    virtual ~BOWImgDescriptorExtractor();\n\n    CV_WRAP void setVocabulary( const Mat& vocabulary );\n    CV_WRAP const Mat& getVocabulary() const;\n    void compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& imgDescriptor,\n                  vector<vector<int> >* pointIdxsOfClusters=0, Mat* descriptors=0 );\n    // compute() is not constant because DescriptorMatcher::match is not constant\n\n    CV_WRAP_AS(compute) void compute2( const Mat& image, vector<KeyPoint>& keypoints, CV_OUT Mat& imgDescriptor )\n    { compute(image,keypoints,imgDescriptor); }\n\n    CV_WRAP int descriptorSize() const;\n    CV_WRAP int descriptorType() const;\n\nprotected:\n    Mat vocabulary;\n    Ptr<DescriptorExtractor> dextractor;\n    Ptr<DescriptorMatcher> dmatcher;\n};\n\n} /* namespace cv */\n\n#endif /* __cplusplus */\n\n#endif\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/all_indices.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_ALL_INDICES_H_\n#define OPENCV_FLANN_ALL_INDICES_H_\n\n#include \"general.h\"\n\n#include \"nn_index.h\"\n#include \"kdtree_index.h\"\n#include \"kdtree_single_index.h\"\n#include \"kmeans_index.h\"\n#include \"composite_index.h\"\n#include \"linear_index.h\"\n#include \"hierarchical_clustering_index.h\"\n#include \"lsh_index.h\"\n#include \"autotuned_index.h\"\n\n\nnamespace cvflann\n{\n\ntemplate<typename KDTreeCapability, typename VectorSpace, typename Distance>\nstruct index_creator\n{\n    static NNIndex<Distance>* create(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance)\n    {\n        flann_algorithm_t index_type = get_param<flann_algorithm_t>(params, \"algorithm\");\n\n        NNIndex<Distance>* nnIndex;\n        switch (index_type) {\n        case FLANN_INDEX_LINEAR:\n            nnIndex = new LinearIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_KDTREE_SINGLE:\n            nnIndex = new KDTreeSingleIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_KDTREE:\n            nnIndex = new KDTreeIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_KMEANS:\n            nnIndex = new KMeansIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_COMPOSITE:\n            nnIndex = new CompositeIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_AUTOTUNED:\n            nnIndex = new AutotunedIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_HIERARCHICAL:\n            nnIndex = new HierarchicalClusteringIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_LSH:\n            nnIndex = new LshIndex<Distance>(dataset, params, distance);\n            break;\n        default:\n            throw FLANNException(\"Unknown index type\");\n        }\n\n        return nnIndex;\n    }\n};\n\ntemplate<typename VectorSpace, typename Distance>\nstruct index_creator<False,VectorSpace,Distance>\n{\n    static NNIndex<Distance>* create(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance)\n    {\n        flann_algorithm_t index_type = get_param<flann_algorithm_t>(params, \"algorithm\");\n\n        NNIndex<Distance>* nnIndex;\n        switch (index_type) {\n        case FLANN_INDEX_LINEAR:\n            nnIndex = new LinearIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_KMEANS:\n            nnIndex = new KMeansIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_HIERARCHICAL:\n            nnIndex = new HierarchicalClusteringIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_LSH:\n            nnIndex = new LshIndex<Distance>(dataset, params, distance);\n            break;\n        default:\n            throw FLANNException(\"Unknown index type\");\n        }\n\n        return nnIndex;\n    }\n};\n\ntemplate<typename Distance>\nstruct index_creator<False,False,Distance>\n{\n    static NNIndex<Distance>* create(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance)\n    {\n        flann_algorithm_t index_type = get_param<flann_algorithm_t>(params, \"algorithm\");\n\n        NNIndex<Distance>* nnIndex;\n        switch (index_type) {\n        case FLANN_INDEX_LINEAR:\n            nnIndex = new LinearIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_HIERARCHICAL:\n            nnIndex = new HierarchicalClusteringIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_LSH:\n            nnIndex = new LshIndex<Distance>(dataset, params, distance);\n            break;\n        default:\n            throw FLANNException(\"Unknown index type\");\n        }\n\n        return nnIndex;\n    }\n};\n\ntemplate<typename Distance>\nNNIndex<Distance>* create_index_by_type(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance)\n{\n    return index_creator<typename Distance::is_kdtree_distance,\n                         typename Distance::is_vector_space_distance,\n                         Distance>::create(dataset, params,distance);\n}\n\n}\n\n#endif /* OPENCV_FLANN_ALL_INDICES_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/allocator.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_ALLOCATOR_H_\n#define OPENCV_FLANN_ALLOCATOR_H_\n\n#include <stdlib.h>\n#include <stdio.h>\n\n\nnamespace cvflann\n{\n\n/**\n * Allocates (using C's malloc) a generic type T.\n *\n * Params:\n *     count = number of instances to allocate.\n * Returns: pointer (of type T*) to memory buffer\n */\ntemplate <typename T>\nT* allocate(size_t count = 1)\n{\n    T* mem = (T*) ::malloc(sizeof(T)*count);\n    return mem;\n}\n\n\n/**\n * Pooled storage allocator\n *\n * The following routines allow for the efficient allocation of storage in\n * small chunks from a specified pool.  Rather than allowing each structure\n * to be freed individually, an entire pool of storage is freed at once.\n * This method has two advantages over just using malloc() and free().  First,\n * it is far more efficient for allocating small objects, as there is\n * no overhead for remembering all the information needed to free each\n * object or consolidating fragmented memory.  Second, the decision about\n * how long to keep an object is made at the time of allocation, and there\n * is no need to track down all the objects to free them.\n *\n */\n\nconst size_t     WORDSIZE=16;\nconst  size_t     BLOCKSIZE=8192;\n\nclass PooledAllocator\n{\n    /* We maintain memory alignment to word boundaries by requiring that all\n        allocations be in multiples of the machine wordsize.  */\n    /* Size of machine word in bytes.  Must be power of 2. */\n    /* Minimum number of bytes requested at a time from\tthe system.  Must be multiple of WORDSIZE. */\n\n\n    int     remaining;  /* Number of bytes left in current block of storage. */\n    void*   base;     /* Pointer to base of current block of storage. */\n    void*   loc;      /* Current location in block to next allocate memory. */\n    int     blocksize;\n\n\npublic:\n    int     usedMemory;\n    int     wastedMemory;\n\n    /**\n        Default constructor. Initializes a new pool.\n     */\n    PooledAllocator(int blockSize = BLOCKSIZE)\n    {\n        blocksize = blockSize;\n        remaining = 0;\n        base = NULL;\n\n        usedMemory = 0;\n        wastedMemory = 0;\n    }\n\n    /**\n     * Destructor. Frees all the memory allocated in this pool.\n     */\n    ~PooledAllocator()\n    {\n        void* prev;\n\n        while (base != NULL) {\n            prev = *((void**) base); /* Get pointer to prev block. */\n            ::free(base);\n            base = prev;\n        }\n    }\n\n    /**\n     * Returns a pointer to a piece of new memory of the given size in bytes\n     * allocated from the pool.\n     */\n    void* allocateMemory(int size)\n    {\n        int blockSize;\n\n        /* Round size up to a multiple of wordsize.  The following expression\n            only works for WORDSIZE that is a power of 2, by masking last bits of\n            incremented size to zero.\n         */\n        size = (size + (WORDSIZE - 1)) & ~(WORDSIZE - 1);\n\n        /* Check whether a new block must be allocated.  Note that the first word\n            of a block is reserved for a pointer to the previous block.\n         */\n        if (size > remaining) {\n\n            wastedMemory += remaining;\n\n            /* Allocate new storage. */\n            blockSize = (size + sizeof(void*) + (WORDSIZE-1) > BLOCKSIZE) ?\n                        size + sizeof(void*) + (WORDSIZE-1) : BLOCKSIZE;\n\n            // use the standard C malloc to allocate memory\n            void* m = ::malloc(blockSize);\n            if (!m) {\n                fprintf(stderr,\"Failed to allocate memory.\\n\");\n                return NULL;\n            }\n\n            /* Fill first word of new block with pointer to previous block. */\n            ((void**) m)[0] = base;\n            base = m;\n\n            int shift = 0;\n            //int shift = (WORDSIZE - ( (((size_t)m) + sizeof(void*)) & (WORDSIZE-1))) & (WORDSIZE-1);\n\n            remaining = blockSize - sizeof(void*) - shift;\n            loc = ((char*)m + sizeof(void*) + shift);\n        }\n        void* rloc = loc;\n        loc = (char*)loc + size;\n        remaining -= size;\n\n        usedMemory += size;\n\n        return rloc;\n    }\n\n    /**\n     * Allocates (using this pool) a generic type T.\n     *\n     * Params:\n     *     count = number of instances to allocate.\n     * Returns: pointer (of type T*) to memory buffer\n     */\n    template <typename T>\n    T* allocate(size_t count = 1)\n    {\n        T* mem = (T*) this->allocateMemory((int)(sizeof(T)*count));\n        return mem;\n    }\n\n};\n\n}\n\n#endif //OPENCV_FLANN_ALLOCATOR_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/any.h",
    "content": "#ifndef OPENCV_FLANN_ANY_H_\n#define OPENCV_FLANN_ANY_H_\n/*\n * (C) Copyright Christopher Diggins 2005-2011\n * (C) Copyright Pablo Aguilar 2005\n * (C) Copyright Kevlin Henney 2001\n *\n * Distributed under the Boost Software License, Version 1.0. (See\n * accompanying file LICENSE_1_0.txt or copy at\n * http://www.boost.org/LICENSE_1_0.txt\n *\n * Adapted for FLANN by Marius Muja\n */\n\n#include \"defines.h\"\n#include <stdexcept>\n#include <ostream>\n#include <typeinfo>\n\nnamespace cvflann\n{\n\nnamespace anyimpl\n{\n\nstruct bad_any_cast\n{\n};\n\nstruct empty_any\n{\n};\n\ninline std::ostream& operator <<(std::ostream& out, const empty_any&)\n{\n    out << \"[empty_any]\";\n    return out;\n}\n\nstruct base_any_policy\n{\n    virtual void static_delete(void** x) = 0;\n    virtual void copy_from_value(void const* src, void** dest) = 0;\n    virtual void clone(void* const* src, void** dest) = 0;\n    virtual void move(void* const* src, void** dest) = 0;\n    virtual void* get_value(void** src) = 0;\n    virtual ::size_t get_size() = 0;\n    virtual const std::type_info& type() = 0;\n    virtual void print(std::ostream& out, void* const* src) = 0;\n\n#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY\n    virtual ~base_any_policy() {}\n#endif\n};\n\ntemplate<typename T>\nstruct typed_base_any_policy : base_any_policy\n{\n    virtual ::size_t get_size() { return sizeof(T); }\n    virtual const std::type_info& type() { return typeid(T); }\n\n};\n\ntemplate<typename T>\nstruct small_any_policy : typed_base_any_policy<T>\n{\n    virtual void static_delete(void**) { }\n    virtual void copy_from_value(void const* src, void** dest)\n    {\n        new (dest) T(* reinterpret_cast<T const*>(src));\n    }\n    virtual void clone(void* const* src, void** dest) { *dest = *src; }\n    virtual void move(void* const* src, void** dest) { *dest = *src; }\n    virtual void* get_value(void** src) { return reinterpret_cast<void*>(src); }\n    virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast<T const*>(src); }\n};\n\ntemplate<typename T>\nstruct big_any_policy : typed_base_any_policy<T>\n{\n    virtual void static_delete(void** x)\n    {\n        if (* x) delete (* reinterpret_cast<T**>(x)); *x = NULL;\n    }\n    virtual void copy_from_value(void const* src, void** dest)\n    {\n        *dest = new T(*reinterpret_cast<T const*>(src));\n    }\n    virtual void clone(void* const* src, void** dest)\n    {\n        *dest = new T(**reinterpret_cast<T* const*>(src));\n    }\n    virtual void move(void* const* src, void** dest)\n    {\n        (*reinterpret_cast<T**>(dest))->~T();\n        **reinterpret_cast<T**>(dest) = **reinterpret_cast<T* const*>(src);\n    }\n    virtual void* get_value(void** src) { return *src; }\n    virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast<T const*>(*src); }\n};\n\ntemplate<> inline void big_any_policy<flann_centers_init_t>::print(std::ostream& out, void* const* src)\n{\n    out << int(*reinterpret_cast<flann_centers_init_t const*>(*src));\n}\n\ntemplate<> inline void big_any_policy<flann_algorithm_t>::print(std::ostream& out, void* const* src)\n{\n    out << int(*reinterpret_cast<flann_algorithm_t const*>(*src));\n}\n\ntemplate<typename T>\nstruct choose_policy\n{\n    typedef big_any_policy<T> type;\n};\n\ntemplate<typename T>\nstruct choose_policy<T*>\n{\n    typedef small_any_policy<T*> type;\n};\n\nstruct any;\n\n/// Choosing the policy for an any type is illegal, but should never happen.\n/// This is designed to throw a compiler error.\ntemplate<>\nstruct choose_policy<any>\n{\n    typedef void type;\n};\n\n/// Specializations for small types.\n#define SMALL_POLICY(TYPE) \\\n    template<> \\\n    struct choose_policy<TYPE> { typedef small_any_policy<TYPE> type; \\\n    }\n\nSMALL_POLICY(signed char);\nSMALL_POLICY(unsigned char);\nSMALL_POLICY(signed short);\nSMALL_POLICY(unsigned short);\nSMALL_POLICY(signed int);\nSMALL_POLICY(unsigned int);\nSMALL_POLICY(signed long);\nSMALL_POLICY(unsigned long);\nSMALL_POLICY(float);\nSMALL_POLICY(bool);\n\n#undef SMALL_POLICY\n\ntemplate <typename T>\nclass SinglePolicy\n{\n    SinglePolicy();\n    SinglePolicy(const SinglePolicy& other);\n    SinglePolicy& operator=(const SinglePolicy& other);\n\npublic:\n    static base_any_policy* get_policy();\n\nprivate:\n    static typename choose_policy<T>::type policy;\n};\n\ntemplate <typename T>\ntypename choose_policy<T>::type SinglePolicy<T>::policy;\n\n/// This function will return a different policy for each type.\ntemplate <typename T>\ninline base_any_policy* SinglePolicy<T>::get_policy() { return &policy; }\n\n} // namespace anyimpl\n\nstruct any\n{\nprivate:\n    // fields\n    anyimpl::base_any_policy* policy;\n    void* object;\n\npublic:\n    /// Initializing constructor.\n    template <typename T>\n    any(const T& x)\n        : policy(anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy()), object(NULL)\n    {\n        assign(x);\n    }\n\n    /// Empty constructor.\n    any()\n        : policy(anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy()), object(NULL)\n    { }\n\n    /// Special initializing constructor for string literals.\n    any(const char* x)\n        : policy(anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy()), object(NULL)\n    {\n        assign(x);\n    }\n\n    /// Copy constructor.\n    any(const any& x)\n        : policy(anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy()), object(NULL)\n    {\n        assign(x);\n    }\n\n    /// Destructor.\n    ~any()\n    {\n        policy->static_delete(&object);\n    }\n\n    /// Assignment function from another any.\n    any& assign(const any& x)\n    {\n        reset();\n        policy = x.policy;\n        policy->clone(&x.object, &object);\n        return *this;\n    }\n\n    /// Assignment function.\n    template <typename T>\n    any& assign(const T& x)\n    {\n        reset();\n        policy = anyimpl::SinglePolicy<T>::get_policy();\n        policy->copy_from_value(&x, &object);\n        return *this;\n    }\n\n    /// Assignment operator.\n    template<typename T>\n    any& operator=(const T& x)\n    {\n        return assign(x);\n    }\n\n    /// Assignment operator, specialed for literal strings.\n    /// They have types like const char [6] which don't work as expected.\n    any& operator=(const char* x)\n    {\n        return assign(x);\n    }\n\n    /// Utility functions\n    any& swap(any& x)\n    {\n        std::swap(policy, x.policy);\n        std::swap(object, x.object);\n        return *this;\n    }\n\n    /// Cast operator. You can only cast to the original type.\n    template<typename T>\n    T& cast()\n    {\n        if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast();\n        T* r = reinterpret_cast<T*>(policy->get_value(&object));\n        return *r;\n    }\n\n    /// Cast operator. You can only cast to the original type.\n    template<typename T>\n    const T& cast() const\n    {\n        if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast();\n        T* r = reinterpret_cast<T*>(policy->get_value(const_cast<void **>(&object)));\n        return *r;\n    }\n\n    /// Returns true if the any contains no value.\n    bool empty() const\n    {\n        return policy->type() == typeid(anyimpl::empty_any);\n    }\n\n    /// Frees any allocated memory, and sets the value to NULL.\n    void reset()\n    {\n        policy->static_delete(&object);\n        policy = anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy();\n    }\n\n    /// Returns true if the two types are the same.\n    bool compatible(const any& x) const\n    {\n        return policy->type() == x.policy->type();\n    }\n\n    /// Returns if the type is compatible with the policy\n    template<typename T>\n    bool has_type()\n    {\n        return policy->type() == typeid(T);\n    }\n\n    const std::type_info& type() const\n    {\n        return policy->type();\n    }\n\n    friend std::ostream& operator <<(std::ostream& out, const any& any_val);\n};\n\ninline std::ostream& operator <<(std::ostream& out, const any& any_val)\n{\n    any_val.policy->print(out,&any_val.object);\n    return out;\n}\n\n}\n\n#endif // OPENCV_FLANN_ANY_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/autotuned_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n#ifndef OPENCV_FLANN_AUTOTUNED_INDEX_H_\n#define OPENCV_FLANN_AUTOTUNED_INDEX_H_\n\n#include \"general.h\"\n#include \"nn_index.h\"\n#include \"ground_truth.h\"\n#include \"index_testing.h\"\n#include \"sampling.h\"\n#include \"kdtree_index.h\"\n#include \"kdtree_single_index.h\"\n#include \"kmeans_index.h\"\n#include \"composite_index.h\"\n#include \"linear_index.h\"\n#include \"logger.h\"\n\nnamespace cvflann\n{\n\ntemplate<typename Distance>\nNNIndex<Distance>* create_index_by_type(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance);\n\n\nstruct AutotunedIndexParams : public IndexParams\n{\n    AutotunedIndexParams(float target_precision = 0.8, float build_weight = 0.01, float memory_weight = 0, float sample_fraction = 0.1)\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_AUTOTUNED;\n        // precision desired (used for autotuning, -1 otherwise)\n        (*this)[\"target_precision\"] = target_precision;\n        // build tree time weighting factor\n        (*this)[\"build_weight\"] = build_weight;\n        // index memory weighting factor\n        (*this)[\"memory_weight\"] = memory_weight;\n        // what fraction of the dataset to use for autotuning\n        (*this)[\"sample_fraction\"] = sample_fraction;\n    }\n};\n\n\ntemplate <typename Distance>\nclass AutotunedIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n    AutotunedIndex(const Matrix<ElementType>& inputData, const IndexParams& params = AutotunedIndexParams(), Distance d = Distance()) :\n        dataset_(inputData), distance_(d)\n    {\n        target_precision_ = get_param(params, \"target_precision\",0.8f);\n        build_weight_ =  get_param(params,\"build_weight\", 0.01f);\n        memory_weight_ = get_param(params, \"memory_weight\", 0.0f);\n        sample_fraction_ = get_param(params,\"sample_fraction\", 0.1f);\n        bestIndex_ = NULL;\n    }\n\n    AutotunedIndex(const AutotunedIndex&);\n    AutotunedIndex& operator=(const AutotunedIndex&);\n\n    virtual ~AutotunedIndex()\n    {\n        if (bestIndex_ != NULL) {\n            delete bestIndex_;\n            bestIndex_ = NULL;\n        }\n    }\n\n    /**\n     * Dummy implementation for other algorithms of addable indexes after that.\n     */\n    void addIndex(const Matrix<ElementType>& /*wholeData*/, const Matrix<ElementType>& /*additionalData*/)\n    {\n    }\n\n    /**\n     *          Method responsible with building the index.\n     */\n    virtual void buildIndex()\n    {\n        std::ostringstream stream;\n        bestParams_ = estimateBuildParams();\n        print_params(bestParams_, stream);\n        Logger::info(\"----------------------------------------------------\\n\");\n        Logger::info(\"Autotuned parameters:\\n\");\n        Logger::info(\"%s\", stream.str().c_str());\n        Logger::info(\"----------------------------------------------------\\n\");\n\n        bestIndex_ = create_index_by_type(dataset_, bestParams_, distance_);\n        bestIndex_->buildIndex();\n        speedup_ = estimateSearchParams(bestSearchParams_);\n        stream.str(std::string());\n        print_params(bestSearchParams_, stream);\n        Logger::info(\"----------------------------------------------------\\n\");\n        Logger::info(\"Search parameters:\\n\");\n        Logger::info(\"%s\", stream.str().c_str());\n        Logger::info(\"----------------------------------------------------\\n\");\n    }\n\n    /**\n     *  Saves the index to a stream\n     */\n    virtual void saveIndex(FILE* stream)\n    {\n        save_value(stream, (int)bestIndex_->getType());\n        bestIndex_->saveIndex(stream);\n        save_value(stream, get_param<int>(bestSearchParams_, \"checks\"));\n    }\n\n    /**\n     *  Loads the index from a stream\n     */\n    virtual void loadIndex(FILE* stream)\n    {\n        int index_type;\n\n        load_value(stream, index_type);\n        IndexParams params;\n        params[\"algorithm\"] = (flann_algorithm_t)index_type;\n        bestIndex_ = create_index_by_type<Distance>(dataset_, params, distance_);\n        bestIndex_->loadIndex(stream);\n        int checks;\n        load_value(stream, checks);\n        bestSearchParams_[\"checks\"] = checks;\n    }\n\n    /**\n     *      Method that searches for nearest-neighbors\n     */\n    virtual void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams)\n    {\n        int checks = get_param<int>(searchParams,\"checks\",FLANN_CHECKS_AUTOTUNED);\n        if (checks == FLANN_CHECKS_AUTOTUNED) {\n            bestIndex_->findNeighbors(result, vec, bestSearchParams_);\n        }\n        else {\n            bestIndex_->findNeighbors(result, vec, searchParams);\n        }\n    }\n\n\n    IndexParams getParameters() const\n    {\n        return bestIndex_->getParameters();\n    }\n\n    SearchParams getSearchParameters() const\n    {\n        return bestSearchParams_;\n    }\n\n    float getSpeedup() const\n    {\n        return speedup_;\n    }\n\n\n    /**\n     *      Number of features in this index.\n     */\n    virtual size_t size() const\n    {\n        return bestIndex_->size();\n    }\n\n    /**\n     *  The length of each vector in this index.\n     */\n    virtual size_t veclen() const\n    {\n        return bestIndex_->veclen();\n    }\n\n    /**\n     * The amount of memory (in bytes) this index uses.\n     */\n    virtual int usedMemory() const\n    {\n        return bestIndex_->usedMemory();\n    }\n\n    /**\n     * Algorithm name\n     */\n    virtual flann_algorithm_t getType() const\n    {\n        return FLANN_INDEX_AUTOTUNED;\n    }\n\nprivate:\n\n    struct CostData\n    {\n        float searchTimeCost;\n        float buildTimeCost;\n        float memoryCost;\n        float totalCost;\n        IndexParams params;\n    };\n\n    void evaluate_kmeans(CostData& cost)\n    {\n        StartStopTimer t;\n        int checks;\n        const int nn = 1;\n\n        Logger::info(\"KMeansTree using params: max_iterations=%d, branching=%d\\n\",\n                     get_param<int>(cost.params,\"iterations\"),\n                     get_param<int>(cost.params,\"branching\"));\n        KMeansIndex<Distance> kmeans(sampledDataset_, cost.params, distance_);\n        // measure index build time\n        t.start();\n        kmeans.buildIndex();\n        t.stop();\n        float buildTime = (float)t.value;\n\n        // measure search time\n        float searchTime = test_index_precision(kmeans, sampledDataset_, testDataset_, gt_matches_, target_precision_, checks, distance_, nn);\n\n        float datasetMemory = float(sampledDataset_.rows * sampledDataset_.cols * sizeof(float));\n        cost.memoryCost = (kmeans.usedMemory() + datasetMemory) / datasetMemory;\n        cost.searchTimeCost = searchTime;\n        cost.buildTimeCost = buildTime;\n        Logger::info(\"KMeansTree buildTime=%g, searchTime=%g, build_weight=%g\\n\", buildTime, searchTime, build_weight_);\n    }\n\n\n    void evaluate_kdtree(CostData& cost)\n    {\n        StartStopTimer t;\n        int checks;\n        const int nn = 1;\n\n        Logger::info(\"KDTree using params: trees=%d\\n\", get_param<int>(cost.params,\"trees\"));\n        KDTreeIndex<Distance> kdtree(sampledDataset_, cost.params, distance_);\n\n        t.start();\n        kdtree.buildIndex();\n        t.stop();\n        float buildTime = (float)t.value;\n\n        //measure search time\n        float searchTime = test_index_precision(kdtree, sampledDataset_, testDataset_, gt_matches_, target_precision_, checks, distance_, nn);\n\n        float datasetMemory = float(sampledDataset_.rows * sampledDataset_.cols * sizeof(float));\n        cost.memoryCost = (kdtree.usedMemory() + datasetMemory) / datasetMemory;\n        cost.searchTimeCost = searchTime;\n        cost.buildTimeCost = buildTime;\n        Logger::info(\"KDTree buildTime=%g, searchTime=%g\\n\", buildTime, searchTime);\n    }\n\n\n    //    struct KMeansSimpleDownhillFunctor {\n    //\n    //        Autotune& autotuner;\n    //        KMeansSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {};\n    //\n    //        float operator()(int* params) {\n    //\n    //            float maxFloat = numeric_limits<float>::max();\n    //\n    //            if (params[0]<2) return maxFloat;\n    //            if (params[1]<0) return maxFloat;\n    //\n    //            CostData c;\n    //            c.params[\"algorithm\"] = KMEANS;\n    //            c.params[\"centers-init\"] = CENTERS_RANDOM;\n    //            c.params[\"branching\"] = params[0];\n    //            c.params[\"max-iterations\"] = params[1];\n    //\n    //            autotuner.evaluate_kmeans(c);\n    //\n    //            return c.timeCost;\n    //\n    //        }\n    //    };\n    //\n    //    struct KDTreeSimpleDownhillFunctor {\n    //\n    //        Autotune& autotuner;\n    //        KDTreeSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {};\n    //\n    //        float operator()(int* params) {\n    //            float maxFloat = numeric_limits<float>::max();\n    //\n    //            if (params[0]<1) return maxFloat;\n    //\n    //            CostData c;\n    //            c.params[\"algorithm\"] = KDTREE;\n    //            c.params[\"trees\"] = params[0];\n    //\n    //            autotuner.evaluate_kdtree(c);\n    //\n    //            return c.timeCost;\n    //\n    //        }\n    //    };\n\n\n\n    void optimizeKMeans(std::vector<CostData>& costs)\n    {\n        Logger::info(\"KMEANS, Step 1: Exploring parameter space\\n\");\n\n        // explore kmeans parameters space using combinations of the parameters below\n        int maxIterations[] = { 1, 5, 10, 15 };\n        int branchingFactors[] = { 16, 32, 64, 128, 256 };\n\n        int kmeansParamSpaceSize = FLANN_ARRAY_LEN(maxIterations) * FLANN_ARRAY_LEN(branchingFactors);\n        costs.reserve(costs.size() + kmeansParamSpaceSize);\n\n        // evaluate kmeans for all parameter combinations\n        for (size_t i = 0; i < FLANN_ARRAY_LEN(maxIterations); ++i) {\n            for (size_t j = 0; j < FLANN_ARRAY_LEN(branchingFactors); ++j) {\n                CostData cost;\n                cost.params[\"algorithm\"] = FLANN_INDEX_KMEANS;\n                cost.params[\"centers_init\"] = FLANN_CENTERS_RANDOM;\n                cost.params[\"iterations\"] = maxIterations[i];\n                cost.params[\"branching\"] = branchingFactors[j];\n\n                evaluate_kmeans(cost);\n                costs.push_back(cost);\n            }\n        }\n\n        //         Logger::info(\"KMEANS, Step 2: simplex-downhill optimization\\n\");\n        //\n        //         const int n = 2;\n        //         // choose initial simplex points as the best parameters so far\n        //         int kmeansNMPoints[n*(n+1)];\n        //         float kmeansVals[n+1];\n        //         for (int i=0;i<n+1;++i) {\n        //             kmeansNMPoints[i*n] = (int)kmeansCosts[i].params[\"branching\"];\n        //             kmeansNMPoints[i*n+1] = (int)kmeansCosts[i].params[\"max-iterations\"];\n        //             kmeansVals[i] = kmeansCosts[i].timeCost;\n        //         }\n        //         KMeansSimpleDownhillFunctor kmeans_cost_func(*this);\n        //         // run optimization\n        //         optimizeSimplexDownhill(kmeansNMPoints,n,kmeans_cost_func,kmeansVals);\n        //         // store results\n        //         for (int i=0;i<n+1;++i) {\n        //             kmeansCosts[i].params[\"branching\"] = kmeansNMPoints[i*2];\n        //             kmeansCosts[i].params[\"max-iterations\"] = kmeansNMPoints[i*2+1];\n        //             kmeansCosts[i].timeCost = kmeansVals[i];\n        //         }\n    }\n\n\n    void optimizeKDTree(std::vector<CostData>& costs)\n    {\n        Logger::info(\"KD-TREE, Step 1: Exploring parameter space\\n\");\n\n        // explore kd-tree parameters space using the parameters below\n        int testTrees[] = { 1, 4, 8, 16, 32 };\n\n        // evaluate kdtree for all parameter combinations\n        for (size_t i = 0; i < FLANN_ARRAY_LEN(testTrees); ++i) {\n            CostData cost;\n            cost.params[\"algorithm\"] = FLANN_INDEX_KDTREE;\n            cost.params[\"trees\"] = testTrees[i];\n\n            evaluate_kdtree(cost);\n            costs.push_back(cost);\n        }\n\n        //         Logger::info(\"KD-TREE, Step 2: simplex-downhill optimization\\n\");\n        //\n        //         const int n = 1;\n        //         // choose initial simplex points as the best parameters so far\n        //         int kdtreeNMPoints[n*(n+1)];\n        //         float kdtreeVals[n+1];\n        //         for (int i=0;i<n+1;++i) {\n        //             kdtreeNMPoints[i] = (int)kdtreeCosts[i].params[\"trees\"];\n        //             kdtreeVals[i] = kdtreeCosts[i].timeCost;\n        //         }\n        //         KDTreeSimpleDownhillFunctor kdtree_cost_func(*this);\n        //         // run optimization\n        //         optimizeSimplexDownhill(kdtreeNMPoints,n,kdtree_cost_func,kdtreeVals);\n        //         // store results\n        //         for (int i=0;i<n+1;++i) {\n        //             kdtreeCosts[i].params[\"trees\"] = kdtreeNMPoints[i];\n        //             kdtreeCosts[i].timeCost = kdtreeVals[i];\n        //         }\n    }\n\n    /**\n     *  Chooses the best nearest-neighbor algorithm and estimates the optimal\n     *  parameters to use when building the index (for a given precision).\n     *  Returns a dictionary with the optimal parameters.\n     */\n    IndexParams estimateBuildParams()\n    {\n        std::vector<CostData> costs;\n\n        int sampleSize = int(sample_fraction_ * dataset_.rows);\n        int testSampleSize = std::min(sampleSize / 10, 1000);\n\n        Logger::info(\"Entering autotuning, dataset size: %d, sampleSize: %d, testSampleSize: %d, target precision: %g\\n\", dataset_.rows, sampleSize, testSampleSize, target_precision_);\n\n        // For a very small dataset, it makes no sense to build any fancy index, just\n        // use linear search\n        if (testSampleSize < 10) {\n            Logger::info(\"Choosing linear, dataset too small\\n\");\n            return LinearIndexParams();\n        }\n\n        // We use a fraction of the original dataset to speedup the autotune algorithm\n        sampledDataset_ = random_sample(dataset_, sampleSize);\n        // We use a cross-validation approach, first we sample a testset from the dataset\n        testDataset_ = random_sample(sampledDataset_, testSampleSize, true);\n\n        // We compute the ground truth using linear search\n        Logger::info(\"Computing ground truth... \\n\");\n        gt_matches_ = Matrix<int>(new int[testDataset_.rows], testDataset_.rows, 1);\n        StartStopTimer t;\n        t.start();\n        compute_ground_truth<Distance>(sampledDataset_, testDataset_, gt_matches_, 0, distance_);\n        t.stop();\n\n        CostData linear_cost;\n        linear_cost.searchTimeCost = (float)t.value;\n        linear_cost.buildTimeCost = 0;\n        linear_cost.memoryCost = 0;\n        linear_cost.params[\"algorithm\"] = FLANN_INDEX_LINEAR;\n\n        costs.push_back(linear_cost);\n\n        // Start parameter autotune process\n        Logger::info(\"Autotuning parameters...\\n\");\n\n        optimizeKMeans(costs);\n        optimizeKDTree(costs);\n\n        float bestTimeCost = costs[0].searchTimeCost;\n        for (size_t i = 0; i < costs.size(); ++i) {\n            float timeCost = costs[i].buildTimeCost * build_weight_ + costs[i].searchTimeCost;\n            if (timeCost < bestTimeCost) {\n                bestTimeCost = timeCost;\n            }\n        }\n\n        float bestCost = costs[0].searchTimeCost / bestTimeCost;\n        IndexParams bestParams = costs[0].params;\n        if (bestTimeCost > 0) {\n            for (size_t i = 0; i < costs.size(); ++i) {\n                float crtCost = (costs[i].buildTimeCost * build_weight_ + costs[i].searchTimeCost) / bestTimeCost +\n                                memory_weight_ * costs[i].memoryCost;\n                if (crtCost < bestCost) {\n                    bestCost = crtCost;\n                    bestParams = costs[i].params;\n                }\n            }\n        }\n\n        delete[] gt_matches_.data;\n        delete[] testDataset_.data;\n        delete[] sampledDataset_.data;\n\n        return bestParams;\n    }\n\n\n\n    /**\n     *  Estimates the search time parameters needed to get the desired precision.\n     *  Precondition: the index is built\n     *  Postcondition: the searchParams will have the optimum params set, also the speedup obtained over linear search.\n     */\n    float estimateSearchParams(SearchParams& searchParams)\n    {\n        const int nn = 1;\n        const size_t SAMPLE_COUNT = 1000;\n\n        assert(bestIndex_ != NULL); // must have a valid index\n\n        float speedup = 0;\n\n        int samples = (int)std::min(dataset_.rows / 10, SAMPLE_COUNT);\n        if (samples > 0) {\n            Matrix<ElementType> testDataset = random_sample(dataset_, samples);\n\n            Logger::info(\"Computing ground truth\\n\");\n\n            // we need to compute the ground truth first\n            Matrix<int> gt_matches(new int[testDataset.rows], testDataset.rows, 1);\n            StartStopTimer t;\n            t.start();\n            compute_ground_truth<Distance>(dataset_, testDataset, gt_matches, 1, distance_);\n            t.stop();\n            float linear = (float)t.value;\n\n            int checks;\n            Logger::info(\"Estimating number of checks\\n\");\n\n            float searchTime;\n            float cb_index;\n            if (bestIndex_->getType() == FLANN_INDEX_KMEANS) {\n                Logger::info(\"KMeans algorithm, estimating cluster border factor\\n\");\n                KMeansIndex<Distance>* kmeans = (KMeansIndex<Distance>*)bestIndex_;\n                float bestSearchTime = -1;\n                float best_cb_index = -1;\n                int best_checks = -1;\n                for (cb_index = 0; cb_index < 1.1f; cb_index += 0.2f) {\n                    kmeans->set_cb_index(cb_index);\n                    searchTime = test_index_precision(*kmeans, dataset_, testDataset, gt_matches, target_precision_, checks, distance_, nn, 1);\n                    if ((searchTime < bestSearchTime) || (bestSearchTime == -1)) {\n                        bestSearchTime = searchTime;\n                        best_cb_index = cb_index;\n                        best_checks = checks;\n                    }\n                }\n                searchTime = bestSearchTime;\n                cb_index = best_cb_index;\n                checks = best_checks;\n\n                kmeans->set_cb_index(best_cb_index);\n                Logger::info(\"Optimum cb_index: %g\\n\", cb_index);\n                bestParams_[\"cb_index\"] = cb_index;\n            }\n            else {\n                searchTime = test_index_precision(*bestIndex_, dataset_, testDataset, gt_matches, target_precision_, checks, distance_, nn, 1);\n            }\n\n            Logger::info(\"Required number of checks: %d \\n\", checks);\n            searchParams[\"checks\"] = checks;\n\n            speedup = linear / searchTime;\n\n            delete[] gt_matches.data;\n            delete[] testDataset.data;\n        }\n\n        return speedup;\n    }\n\nprivate:\n    NNIndex<Distance>* bestIndex_;\n\n    IndexParams bestParams_;\n    SearchParams bestSearchParams_;\n\n    Matrix<ElementType> sampledDataset_;\n    Matrix<ElementType> testDataset_;\n    Matrix<int> gt_matches_;\n\n    float speedup_;\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset_;\n\n    /**\n     * Index parameters\n     */\n    float target_precision_;\n    float build_weight_;\n    float memory_weight_;\n    float sample_fraction_;\n\n    Distance distance_;\n\n\n};\n}\n\n#endif /* OPENCV_FLANN_AUTOTUNED_INDEX_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/composite_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_COMPOSITE_INDEX_H_\n#define OPENCV_FLANN_COMPOSITE_INDEX_H_\n\n#include \"general.h\"\n#include \"nn_index.h\"\n#include \"kdtree_index.h\"\n#include \"kmeans_index.h\"\n\nnamespace cvflann\n{\n\n/**\n * Index parameters for the CompositeIndex.\n */\nstruct CompositeIndexParams : public IndexParams\n{\n    CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11,\n                         flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 )\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_KMEANS;\n        // number of randomized trees to use (for kdtree)\n        (*this)[\"trees\"] = trees;\n        // branching factor\n        (*this)[\"branching\"] = branching;\n        // max iterations to perform in one kmeans clustering (kmeans tree)\n        (*this)[\"iterations\"] = iterations;\n        // algorithm used for picking the initial cluster centers for kmeans tree\n        (*this)[\"centers_init\"] = centers_init;\n        // cluster boundary index. Used when searching the kmeans tree\n        (*this)[\"cb_index\"] = cb_index;\n    }\n};\n\n\n/**\n * This index builds a kd-tree index and a k-means index and performs nearest\n * neighbour search both indexes. This gives a slight boost in search performance\n * as some of the neighbours that are missed by one index are found by the other.\n */\ntemplate <typename Distance>\nclass CompositeIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n    /**\n     * Index constructor\n     * @param inputData dataset containing the points to index\n     * @param params Index parameters\n     * @param d Distance functor\n     * @return\n     */\n    CompositeIndex(const Matrix<ElementType>& inputData, const IndexParams& params = CompositeIndexParams(),\n                   Distance d = Distance()) : index_params_(params)\n    {\n        kdtree_index_ = new KDTreeIndex<Distance>(inputData, params, d);\n        kmeans_index_ = new KMeansIndex<Distance>(inputData, params, d);\n\n    }\n\n    CompositeIndex(const CompositeIndex&);\n    CompositeIndex& operator=(const CompositeIndex&);\n\n    virtual ~CompositeIndex()\n    {\n        delete kdtree_index_;\n        delete kmeans_index_;\n    }\n\n    /**\n     * @return The index type\n     */\n    flann_algorithm_t getType() const\n    {\n        return FLANN_INDEX_COMPOSITE;\n    }\n\n    /**\n     * @return Size of the index\n     */\n    size_t size() const\n    {\n        return kdtree_index_->size();\n    }\n\n    /**\n     * \\returns The dimensionality of the features in this index.\n     */\n    size_t veclen() const\n    {\n        return kdtree_index_->veclen();\n    }\n\n    /**\n     * \\returns The amount of memory (in bytes) used by the index.\n     */\n    int usedMemory() const\n    {\n        return kmeans_index_->usedMemory() + kdtree_index_->usedMemory();\n    }\n\n    /**\n     * Dummy implementation for other algorithms of addable indexes after that.\n     */\n    void addIndex(const Matrix<ElementType>& /*wholeData*/, const Matrix<ElementType>& /*additionalData*/)\n    {\n    }\n\n    /**\n     * \\brief Builds the index\n     */\n    void buildIndex()\n    {\n        Logger::info(\"Building kmeans tree...\\n\");\n        kmeans_index_->buildIndex();\n        Logger::info(\"Building kdtree tree...\\n\");\n        kdtree_index_->buildIndex();\n    }\n\n    /**\n     * \\brief Saves the index to a stream\n     * \\param stream The stream to save the index to\n     */\n    void saveIndex(FILE* stream)\n    {\n        kmeans_index_->saveIndex(stream);\n        kdtree_index_->saveIndex(stream);\n    }\n\n    /**\n     * \\brief Loads the index from a stream\n     * \\param stream The stream from which the index is loaded\n     */\n    void loadIndex(FILE* stream)\n    {\n        kmeans_index_->loadIndex(stream);\n        kdtree_index_->loadIndex(stream);\n    }\n\n    /**\n     * \\returns The index parameters\n     */\n    IndexParams getParameters() const\n    {\n        return index_params_;\n    }\n\n    /**\n     * \\brief Method that searches for nearest-neighbours\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams)\n    {\n        kmeans_index_->findNeighbors(result, vec, searchParams);\n        kdtree_index_->findNeighbors(result, vec, searchParams);\n    }\n\nprivate:\n    /** The k-means index */\n    KMeansIndex<Distance>* kmeans_index_;\n\n    /** The kd-tree index */\n    KDTreeIndex<Distance>* kdtree_index_;\n\n    /** The index parameters */\n    const IndexParams index_params_;\n};\n\n}\n\n#endif //OPENCV_FLANN_COMPOSITE_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/config.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2011  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2011  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_CONFIG_H_\n#define OPENCV_FLANN_CONFIG_H_\n\n#ifdef FLANN_VERSION_\n#undef FLANN_VERSION_\n#endif\n#define FLANN_VERSION_ \"1.6.10\"\n\n#endif /* OPENCV_FLANN_CONFIG_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/defines.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2011  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2011  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_DEFINES_H_\n#define OPENCV_FLANN_DEFINES_H_\n\n#include \"config.h\"\n\n#ifdef FLANN_EXPORT\n#undef FLANN_EXPORT\n#endif\n#ifdef WIN32\n/* win32 dll export/import directives */\n #ifdef FLANN_EXPORTS\n  #define FLANN_EXPORT __declspec(dllexport)\n #elif defined(FLANN_STATIC)\n  #define FLANN_EXPORT\n #else\n  #define FLANN_EXPORT __declspec(dllimport)\n #endif\n#else\n/* unix needs nothing */\n #define FLANN_EXPORT\n#endif\n\n\n#ifdef FLANN_DEPRECATED\n#undef FLANN_DEPRECATED\n#endif\n#ifdef __GNUC__\n#define FLANN_DEPRECATED __attribute__ ((deprecated))\n#elif defined(_MSC_VER)\n#define FLANN_DEPRECATED __declspec(deprecated)\n#else\n#pragma message(\"WARNING: You need to implement FLANN_DEPRECATED for this compiler\")\n#define FLANN_DEPRECATED\n#endif\n\n\n#undef FLANN_PLATFORM_32_BIT\n#undef FLANN_PLATFORM_64_BIT\n#if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64\n#define FLANN_PLATFORM_64_BIT\n#else\n#define FLANN_PLATFORM_32_BIT\n#endif\n\n\n#undef FLANN_ARRAY_LEN\n#define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0]))\n\nnamespace cvflann {\n\n/* Nearest neighbour index algorithms */\nenum flann_algorithm_t\n{\n    FLANN_INDEX_LINEAR = 0,\n    FLANN_INDEX_KDTREE = 1,\n    FLANN_INDEX_KMEANS = 2,\n    FLANN_INDEX_COMPOSITE = 3,\n    FLANN_INDEX_KDTREE_SINGLE = 4,\n    FLANN_INDEX_HIERARCHICAL = 5,\n    FLANN_INDEX_LSH = 6,\n    FLANN_INDEX_SAVED = 254,\n    FLANN_INDEX_AUTOTUNED = 255,\n\n    // deprecated constants, should use the FLANN_INDEX_* ones instead\n    LINEAR = 0,\n    KDTREE = 1,\n    KMEANS = 2,\n    COMPOSITE = 3,\n    KDTREE_SINGLE = 4,\n    SAVED = 254,\n    AUTOTUNED = 255\n};\n\n\n\nenum flann_centers_init_t\n{\n    FLANN_CENTERS_RANDOM = 0,\n    FLANN_CENTERS_GONZALES = 1,\n    FLANN_CENTERS_KMEANSPP = 2,\n\n    // deprecated constants, should use the FLANN_CENTERS_* ones instead\n    CENTERS_RANDOM = 0,\n    CENTERS_GONZALES = 1,\n    CENTERS_KMEANSPP = 2\n};\n\nenum flann_log_level_t\n{\n    FLANN_LOG_NONE = 0,\n    FLANN_LOG_FATAL = 1,\n    FLANN_LOG_ERROR = 2,\n    FLANN_LOG_WARN = 3,\n    FLANN_LOG_INFO = 4\n};\n\nenum flann_distance_t\n{\n    FLANN_DIST_EUCLIDEAN = 1,\n    FLANN_DIST_L2 = 1,\n    FLANN_DIST_MANHATTAN = 2,\n    FLANN_DIST_L1 = 2,\n    FLANN_DIST_MINKOWSKI = 3,\n    FLANN_DIST_MAX   = 4,\n    FLANN_DIST_HIST_INTERSECT   = 5,\n    FLANN_DIST_HELLINGER = 6,\n    FLANN_DIST_CHI_SQUARE = 7,\n    FLANN_DIST_CS         = 7,\n    FLANN_DIST_KULLBACK_LEIBLER  = 8,\n    FLANN_DIST_KL                = 8,\n    FLANN_DIST_HAMMING          = 9,\n\n    // deprecated constants, should use the FLANN_DIST_* ones instead\n    EUCLIDEAN = 1,\n    MANHATTAN = 2,\n    MINKOWSKI = 3,\n    MAX_DIST   = 4,\n    HIST_INTERSECT   = 5,\n    HELLINGER = 6,\n    CS         = 7,\n    KL         = 8,\n    KULLBACK_LEIBLER  = 8\n};\n\nenum flann_datatype_t\n{\n    FLANN_INT8 = 0,\n    FLANN_INT16 = 1,\n    FLANN_INT32 = 2,\n    FLANN_INT64 = 3,\n    FLANN_UINT8 = 4,\n    FLANN_UINT16 = 5,\n    FLANN_UINT32 = 6,\n    FLANN_UINT64 = 7,\n    FLANN_FLOAT32 = 8,\n    FLANN_FLOAT64 = 9\n};\n\nenum\n{\n    FLANN_CHECKS_UNLIMITED = -1,\n    FLANN_CHECKS_AUTOTUNED = -2\n};\n\n}\n\n#endif /* OPENCV_FLANN_DEFINES_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/dist.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_DIST_H_\n#define OPENCV_FLANN_DIST_H_\n\n#include <cmath>\n#include <cstdlib>\n#include <string.h>\n#ifdef _MSC_VER\ntypedef unsigned __int32 uint32_t;\ntypedef unsigned __int64 uint64_t;\n#else\n#include <stdint.h>\n#endif\n\n#include \"defines.h\"\n\n#if (defined WIN32 || defined _WIN32) && defined(_M_ARM)\n# include <Intrin.h>\n#endif\n\n#if defined(__ARM_NEON__) || defined(__ARM_NEON)\n# include \"arm_neon.h\"\n#endif\n\nnamespace cvflann\n{\n\ntemplate<typename T>\ninline T abs(T x) { return (x<0) ? -x : x; }\n\ntemplate<>\ninline int abs<int>(int x) { return ::abs(x); }\n\ntemplate<>\ninline float abs<float>(float x) { return fabsf(x); }\n\ntemplate<>\ninline double abs<double>(double x) { return fabs(x); }\n\ntemplate<typename T>\nstruct Accumulator { typedef T Type; };\ntemplate<>\nstruct Accumulator<unsigned char>  { typedef float Type; };\ntemplate<>\nstruct Accumulator<unsigned short> { typedef float Type; };\ntemplate<>\nstruct Accumulator<unsigned int> { typedef float Type; };\ntemplate<>\nstruct Accumulator<char>   { typedef float Type; };\ntemplate<>\nstruct Accumulator<short>  { typedef float Type; };\ntemplate<>\nstruct Accumulator<int> { typedef float Type; };\n\n#undef True\n#undef False\n\nclass True\n{\n};\n\nclass False\n{\n};\n\n\n/**\n * Squared Euclidean distance functor.\n *\n * This is the simpler, unrolled version. This is preferable for\n * very low dimensionality data (eg 3D points)\n */\ntemplate<class T>\nstruct L2_Simple\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff;\n        for(size_t i = 0; i < size; ++i ) {\n            diff = *a++ - *b++;\n            result += diff*diff;\n        }\n        return result;\n    }\n\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return (a-b)*(a-b);\n    }\n};\n\n\n\n/**\n * Squared Euclidean distance functor, optimized version\n */\ntemplate<class T>\nstruct L2\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    /**\n     *  Compute the squared Euclidean distance between two vectors.\n     *\n     *\tThis is highly optimised, with loop unrolling, as it is one\n     *\tof the most expensive inner loops.\n     *\n     *\tThe computation of squared root at the end is omitted for\n     *\tefficiency.\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = (ResultType)(a[0] - b[0]);\n            diff1 = (ResultType)(a[1] - b[1]);\n            diff2 = (ResultType)(a[2] - b[2]);\n            diff3 = (ResultType)(a[3] - b[3]);\n            result += diff0 * diff0 + diff1 * diff1 + diff2 * diff2 + diff3 * diff3;\n            a += 4;\n            b += 4;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            diff0 = (ResultType)(*a++ - *b++);\n            result += diff0 * diff0;\n        }\n        return result;\n    }\n\n    /**\n     *\tPartial euclidean distance, using just one dimension. This is used by the\n     *\tkd-tree when computing partial distances while traversing the tree.\n     *\n     *\tSquared root is omitted for efficiency.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return (a-b)*(a-b);\n    }\n};\n\n\n/*\n * Manhattan distance functor, optimized version\n */\ntemplate<class T>\nstruct L1\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    /**\n     *  Compute the Manhattan (L_1) distance between two vectors.\n     *\n     *\tThis is highly optimised, with loop unrolling, as it is one\n     *\tof the most expensive inner loops.\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = (ResultType)abs(a[0] - b[0]);\n            diff1 = (ResultType)abs(a[1] - b[1]);\n            diff2 = (ResultType)abs(a[2] - b[2]);\n            diff3 = (ResultType)abs(a[3] - b[3]);\n            result += diff0 + diff1 + diff2 + diff3;\n            a += 4;\n            b += 4;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            diff0 = (ResultType)abs(*a++ - *b++);\n            result += diff0;\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return abs(a-b);\n    }\n};\n\n\n\ntemplate<class T>\nstruct MinkowskiDistance\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    int order;\n\n    MinkowskiDistance(int order_) : order(order_) {}\n\n    /**\n     *  Compute the Minkowsky (L_p) distance between two vectors.\n     *\n     *\tThis is highly optimised, with loop unrolling, as it is one\n     *\tof the most expensive inner loops.\n     *\n     *\tThe computation of squared root at the end is omitted for\n     *\tefficiency.\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = (ResultType)abs(a[0] - b[0]);\n            diff1 = (ResultType)abs(a[1] - b[1]);\n            diff2 = (ResultType)abs(a[2] - b[2]);\n            diff3 = (ResultType)abs(a[3] - b[3]);\n            result += pow(diff0,order) + pow(diff1,order) + pow(diff2,order) + pow(diff3,order);\n            a += 4;\n            b += 4;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            diff0 = (ResultType)abs(*a++ - *b++);\n            result += pow(diff0,order);\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return pow(static_cast<ResultType>(abs(a-b)),order);\n    }\n};\n\n\n\ntemplate<class T>\nstruct MaxDistance\n{\n    typedef False is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    /**\n     *  Compute the max distance (L_infinity) between two vectors.\n     *\n     *  This distance is not a valid kdtree distance, it's not dimensionwise additive.\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = abs(a[0] - b[0]);\n            diff1 = abs(a[1] - b[1]);\n            diff2 = abs(a[2] - b[2]);\n            diff3 = abs(a[3] - b[3]);\n            if (diff0>result) {result = diff0; }\n            if (diff1>result) {result = diff1; }\n            if (diff2>result) {result = diff2; }\n            if (diff3>result) {result = diff3; }\n            a += 4;\n            b += 4;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            diff0 = abs(*a++ - *b++);\n            result = (diff0>result) ? diff0 : result;\n        }\n        return result;\n    }\n\n    /* This distance functor is not dimension-wise additive, which\n     * makes it an invalid kd-tree distance, not implementing the accum_dist method */\n\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor\n * bit count of A exclusive XOR'ed with B\n */\nstruct HammingLUT\n{\n    typedef False is_kdtree_distance;\n    typedef False is_vector_space_distance;\n\n    typedef unsigned char ElementType;\n    typedef int ResultType;\n\n    /** this will count the bits in a ^ b\n     */\n    ResultType operator()(const unsigned char* a, const unsigned char* b, int size) const\n    {\n        static const uchar popCountTable[] =\n        {\n            0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8\n        };\n        ResultType result = 0;\n        for (int i = 0; i < size; i++) {\n            result += popCountTable[a[i] ^ b[i]];\n        }\n        return result;\n    }\n};\n\n/**\n * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor\n * bit count of A exclusive XOR'ed with B\n */\nstruct HammingLUT2\n{\n    typedef False is_kdtree_distance;\n    typedef False is_vector_space_distance;\n\n    typedef unsigned char ElementType;\n    typedef int ResultType;\n\n    /** this will count the bits in a ^ b\n     */\n    ResultType operator()(const unsigned char* a, const unsigned char* b, size_t size) const\n    {\n        static const uchar popCountTable[] =\n        {\n            0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8\n        };\n        ResultType result = 0;\n        for (size_t i = 0; i < size; i++) {\n            result += popCountTable[a[i] ^ b[i]];\n        }\n        return result;\n    }\n};\n\n/**\n * Hamming distance functor (pop count between two binary vectors, i.e. xor them and count the number of bits set)\n * That code was taken from brief.cpp in OpenCV\n */\ntemplate<class T>\nstruct Hamming\n{\n    typedef False is_kdtree_distance;\n    typedef False is_vector_space_distance;\n\n\n    typedef T ElementType;\n    typedef int ResultType;\n\n    template<typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        ResultType result = 0;\n#if defined(__ARM_NEON__) || defined(__ARM_NEON)\n        {\n            uint32x4_t bits = vmovq_n_u32(0);\n            for (size_t i = 0; i < size; i += 16) {\n                uint8x16_t A_vec = vld1q_u8 (a + i);\n                uint8x16_t B_vec = vld1q_u8 (b + i);\n                uint8x16_t AxorB = veorq_u8 (A_vec, B_vec);\n                uint8x16_t bitsSet = vcntq_u8 (AxorB);\n                uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet);\n                uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8);\n                bits = vaddq_u32(bits, bitSet4);\n            }\n            uint64x2_t bitSet2 = vpaddlq_u32 (bits);\n            result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);\n            result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);\n        }\n#elif __GNUC__\n        {\n            //for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)\n            typedef unsigned long long pop_t;\n            const size_t modulo = size % sizeof(pop_t);\n            const pop_t* a2 = reinterpret_cast<const pop_t*> (a);\n            const pop_t* b2 = reinterpret_cast<const pop_t*> (b);\n            const pop_t* a2_end = a2 + (size / sizeof(pop_t));\n\n            for (; a2 != a2_end; ++a2, ++b2) result += __builtin_popcountll((*a2) ^ (*b2));\n\n            if (modulo) {\n                //in the case where size is not dividable by sizeof(size_t)\n                //need to mask off the bits at the end\n                pop_t a_final = 0, b_final = 0;\n                memcpy(&a_final, a2, modulo);\n                memcpy(&b_final, b2, modulo);\n                result += __builtin_popcountll(a_final ^ b_final);\n            }\n        }\n#else // NO NEON and NOT GNUC\n        typedef unsigned long long pop_t;\n        HammingLUT lut;\n        result = lut(reinterpret_cast<const unsigned char*> (a),\n                     reinterpret_cast<const unsigned char*> (b), size * sizeof(pop_t));\n#endif\n        return result;\n    }\n};\n\ntemplate<typename T>\nstruct Hamming2\n{\n    typedef False is_kdtree_distance;\n    typedef False is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef int ResultType;\n\n    /** This is popcount_3() from:\n     * http://en.wikipedia.org/wiki/Hamming_weight */\n    unsigned int popcnt32(uint32_t n) const\n    {\n        n -= ((n >> 1) & 0x55555555);\n        n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n        return (((n + (n >> 4))& 0xF0F0F0F)* 0x1010101) >> 24;\n    }\n\n#ifdef FLANN_PLATFORM_64_BIT\n    unsigned int popcnt64(uint64_t n) const\n    {\n        n -= ((n >> 1) & 0x5555555555555555);\n        n = (n & 0x3333333333333333) + ((n >> 2) & 0x3333333333333333);\n        return (((n + (n >> 4))& 0x0f0f0f0f0f0f0f0f)* 0x0101010101010101) >> 56;\n    }\n#endif\n\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n#ifdef FLANN_PLATFORM_64_BIT\n        const uint64_t* pa = reinterpret_cast<const uint64_t*>(a);\n        const uint64_t* pb = reinterpret_cast<const uint64_t*>(b);\n        ResultType result = 0;\n        size /= (sizeof(uint64_t)/sizeof(unsigned char));\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt64(*pa ^ *pb);\n            ++pa;\n            ++pb;\n        }\n#else\n        const uint32_t* pa = reinterpret_cast<const uint32_t*>(a);\n        const uint32_t* pb = reinterpret_cast<const uint32_t*>(b);\n        ResultType result = 0;\n        size /= (sizeof(uint32_t)/sizeof(unsigned char));\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt32(*pa ^ *pb);\n            ++pa;\n            ++pb;\n        }\n#endif\n        return result;\n    }\n};\n\n\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\ntemplate<class T>\nstruct HistIntersectionDistance\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    /**\n     *  Compute the histogram intersection distance\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType min0, min1, min2, min3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            min0 = (ResultType)(a[0] < b[0] ? a[0] : b[0]);\n            min1 = (ResultType)(a[1] < b[1] ? a[1] : b[1]);\n            min2 = (ResultType)(a[2] < b[2] ? a[2] : b[2]);\n            min3 = (ResultType)(a[3] < b[3] ? a[3] : b[3]);\n            result += min0 + min1 + min2 + min3;\n            a += 4;\n            b += 4;\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            min0 = (ResultType)(*a < *b ? *a : *b);\n            result += min0;\n            ++a;\n            ++b;\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return a<b ? a : b;\n    }\n};\n\n\n\ntemplate<class T>\nstruct HellingerDistance\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    /**\n     *  Compute the histogram intersection distance\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = sqrt(static_cast<ResultType>(a[0])) - sqrt(static_cast<ResultType>(b[0]));\n            diff1 = sqrt(static_cast<ResultType>(a[1])) - sqrt(static_cast<ResultType>(b[1]));\n            diff2 = sqrt(static_cast<ResultType>(a[2])) - sqrt(static_cast<ResultType>(b[2]));\n            diff3 = sqrt(static_cast<ResultType>(a[3])) - sqrt(static_cast<ResultType>(b[3]));\n            result += diff0 * diff0 + diff1 * diff1 + diff2 * diff2 + diff3 * diff3;\n            a += 4;\n            b += 4;\n        }\n        while (a < last) {\n            diff0 = sqrt(static_cast<ResultType>(*a++)) - sqrt(static_cast<ResultType>(*b++));\n            result += diff0 * diff0;\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return sqrt(static_cast<ResultType>(a)) - sqrt(static_cast<ResultType>(b));\n    }\n};\n\n\ntemplate<class T>\nstruct ChiSquareDistance\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    /**\n     *  Compute the chi-square distance\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType sum, diff;\n        Iterator1 last = a + size;\n\n        while (a < last) {\n            sum = (ResultType)(*a + *b);\n            if (sum>0) {\n                diff = (ResultType)(*a - *b);\n                result += diff*diff/sum;\n            }\n            ++a;\n            ++b;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        ResultType result = ResultType();\n        ResultType sum, diff;\n\n        sum = (ResultType)(a+b);\n        if (sum>0) {\n            diff = (ResultType)(a-b);\n            result = diff*diff/sum;\n        }\n        return result;\n    }\n};\n\n\ntemplate<class T>\nstruct KL_Divergence\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    /**\n     *  Compute the Kullback–Leibler divergence\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        Iterator1 last = a + size;\n\n        while (a < last) {\n            if (* a != 0) {\n                ResultType ratio = (ResultType)(*a / *b);\n                if (ratio>0) {\n                    result += *a * log(ratio);\n                }\n            }\n            ++a;\n            ++b;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        ResultType result = ResultType();\n        ResultType ratio = (ResultType)(a / b);\n        if (ratio>0) {\n            result = a * log(ratio);\n        }\n        return result;\n    }\n};\n\n\n\n/*\n * This is a \"zero iterator\". It basically behaves like a zero filled\n * array to all algorithms that use arrays as iterators (STL style).\n * It's useful when there's a need to compute the distance between feature\n * and origin it and allows for better compiler optimisation than using a\n * zero-filled array.\n */\ntemplate <typename T>\nstruct ZeroIterator\n{\n\n    T operator*()\n    {\n        return 0;\n    }\n\n    T operator[](int)\n    {\n        return 0;\n    }\n\n    const ZeroIterator<T>& operator ++()\n    {\n        return *this;\n    }\n\n    ZeroIterator<T> operator ++(int)\n    {\n        return *this;\n    }\n\n    ZeroIterator<T>& operator+=(int)\n    {\n        return *this;\n    }\n\n};\n\n\n/*\n * Depending on processed distances, some of them are already squared (e.g. L2)\n * and some are not (e.g.Hamming). In KMeans++ for instance we want to be sure\n * we are working on ^2 distances, thus following templates to ensure that.\n */\ntemplate <typename Distance, typename ElementType>\nstruct squareDistance\n{\n    typedef typename Distance::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist*dist; }\n};\n\n\ntemplate <typename ElementType>\nstruct squareDistance<L2_Simple<ElementType>, ElementType>\n{\n    typedef typename L2_Simple<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\ntemplate <typename ElementType>\nstruct squareDistance<L2<ElementType>, ElementType>\n{\n    typedef typename L2<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\n\ntemplate <typename ElementType>\nstruct squareDistance<MinkowskiDistance<ElementType>, ElementType>\n{\n    typedef typename MinkowskiDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\ntemplate <typename ElementType>\nstruct squareDistance<HellingerDistance<ElementType>, ElementType>\n{\n    typedef typename HellingerDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\ntemplate <typename ElementType>\nstruct squareDistance<ChiSquareDistance<ElementType>, ElementType>\n{\n    typedef typename ChiSquareDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\n\ntemplate <typename Distance>\ntypename Distance::ResultType ensureSquareDistance( typename Distance::ResultType dist )\n{\n    typedef typename Distance::ElementType ElementType;\n\n    squareDistance<Distance, ElementType> dummy;\n    return dummy( dist );\n}\n\n\n/*\n * ...and a template to ensure the user that he will process the normal distance,\n * and not squared distance, without loosing processing time calling sqrt(ensureSquareDistance)\n * that will result in doing actually sqrt(dist*dist) for L1 distance for instance.\n */\ntemplate <typename Distance, typename ElementType>\nstruct simpleDistance\n{\n    typedef typename Distance::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\n\ntemplate <typename ElementType>\nstruct simpleDistance<L2_Simple<ElementType>, ElementType>\n{\n    typedef typename L2_Simple<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\ntemplate <typename ElementType>\nstruct simpleDistance<L2<ElementType>, ElementType>\n{\n    typedef typename L2<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\n\ntemplate <typename ElementType>\nstruct simpleDistance<MinkowskiDistance<ElementType>, ElementType>\n{\n    typedef typename MinkowskiDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\ntemplate <typename ElementType>\nstruct simpleDistance<HellingerDistance<ElementType>, ElementType>\n{\n    typedef typename HellingerDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\ntemplate <typename ElementType>\nstruct simpleDistance<ChiSquareDistance<ElementType>, ElementType>\n{\n    typedef typename ChiSquareDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\n\ntemplate <typename Distance>\ntypename Distance::ResultType ensureSimpleDistance( typename Distance::ResultType dist )\n{\n    typedef typename Distance::ElementType ElementType;\n\n    simpleDistance<Distance, ElementType> dummy;\n    return dummy( dist );\n}\n\n}\n\n#endif //OPENCV_FLANN_DIST_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/dummy.h",
    "content": "\n#ifndef OPENCV_FLANN_DUMMY_H_\n#define OPENCV_FLANN_DUMMY_H_\n\nnamespace cvflann\n{\n\n#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS\n__declspec(dllexport)\n#endif\nvoid dummyfunc();\n\n}\n\n\n#endif  /* OPENCV_FLANN_DUMMY_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/dynamic_bitset.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n/***********************************************************************\n * Author: Vincent Rabaud\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_DYNAMIC_BITSET_H_\n#define OPENCV_FLANN_DYNAMIC_BITSET_H_\n\n#ifndef FLANN_USE_BOOST\n#  define FLANN_USE_BOOST 0\n#endif\n//#define FLANN_USE_BOOST 1\n#if FLANN_USE_BOOST\n#include <boost/dynamic_bitset.hpp>\ntypedef boost::dynamic_bitset<> DynamicBitset;\n#else\n\n#include <limits.h>\n\n#include \"dist.h\"\n\nnamespace cvflann {\n\n/** Class re-implementing the boost version of it\n * This helps not depending on boost, it also does not do the bound checks\n * and has a way to reset a block for speed\n */\nclass DynamicBitset\n{\npublic:\n    /** default constructor\n     */\n    DynamicBitset()\n    {\n    }\n\n    /** only constructor we use in our code\n     * @param sz the size of the bitset (in bits)\n     */\n    DynamicBitset(size_t sz)\n    {\n        resize(sz);\n        reset();\n    }\n\n    /** Sets all the bits to 0\n     */\n    void clear()\n    {\n        std::fill(bitset_.begin(), bitset_.end(), 0);\n    }\n\n    /** @brief checks if the bitset is empty\n     * @return true if the bitset is empty\n     */\n    bool empty() const\n    {\n        return bitset_.empty();\n    }\n\n    /** set all the bits to 0\n     */\n    void reset()\n    {\n        std::fill(bitset_.begin(), bitset_.end(), 0);\n    }\n\n    /** @brief set one bit to 0\n     * @param index\n     */\n    void reset(size_t index)\n    {\n        bitset_[index / cell_bit_size_] &= ~(size_t(1) << (index % cell_bit_size_));\n    }\n\n    /** @brief sets a specific bit to 0, and more bits too\n     * This function is useful when resetting a given set of bits so that the\n     * whole bitset ends up being 0: if that's the case, we don't care about setting\n     * other bits to 0\n     * @param index\n     */\n    void reset_block(size_t index)\n    {\n        bitset_[index / cell_bit_size_] = 0;\n    }\n\n    /** resize the bitset so that it contains at least sz bits\n     * @param sz\n     */\n    void resize(size_t sz)\n    {\n        size_ = sz;\n        bitset_.resize(sz / cell_bit_size_ + 1);\n    }\n\n    /** set a bit to true\n     * @param index the index of the bit to set to 1\n     */\n    void set(size_t index)\n    {\n        bitset_[index / cell_bit_size_] |= size_t(1) << (index % cell_bit_size_);\n    }\n\n    /** gives the number of contained bits\n     */\n    size_t size() const\n    {\n        return size_;\n    }\n\n    /** check if a bit is set\n     * @param index the index of the bit to check\n     * @return true if the bit is set\n     */\n    bool test(size_t index) const\n    {\n        return (bitset_[index / cell_bit_size_] & (size_t(1) << (index % cell_bit_size_))) != 0;\n    }\n\nprivate:\n    std::vector<size_t> bitset_;\n    size_t size_;\n    static const unsigned int cell_bit_size_ = CHAR_BIT * sizeof(size_t);\n};\n\n} // namespace cvflann\n\n#endif\n\n#endif // OPENCV_FLANN_DYNAMIC_BITSET_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/flann.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef _OPENCV_FLANN_HPP_\n#define _OPENCV_FLANN_HPP_\n\n#ifdef __cplusplus\n\n#include \"opencv2/core/types_c.h\"\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/flann/flann_base.hpp\"\n#include \"opencv2/flann/miniflann.hpp\"\n\nnamespace cvflann\n{\n    CV_EXPORTS flann_distance_t flann_distance_type();\n    FLANN_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order);\n}\n\n\nnamespace cv\n{\nnamespace flann\n{\n\ntemplate <typename T> struct CvType {};\ntemplate <> struct CvType<unsigned char> { static int type() { return CV_8U; } };\ntemplate <> struct CvType<char> { static int type() { return CV_8S; } };\ntemplate <> struct CvType<unsigned short> { static int type() { return CV_16U; } };\ntemplate <> struct CvType<short> { static int type() { return CV_16S; } };\ntemplate <> struct CvType<int> { static int type() { return CV_32S; } };\ntemplate <> struct CvType<float> { static int type() { return CV_32F; } };\ntemplate <> struct CvType<double> { static int type() { return CV_64F; } };\n\n\n// bring the flann parameters into this namespace\nusing ::cvflann::get_param;\nusing ::cvflann::print_params;\n\n// bring the flann distances into this namespace\nusing ::cvflann::L2_Simple;\nusing ::cvflann::L2;\nusing ::cvflann::L1;\nusing ::cvflann::MinkowskiDistance;\nusing ::cvflann::MaxDistance;\nusing ::cvflann::HammingLUT;\nusing ::cvflann::Hamming;\nusing ::cvflann::Hamming2;\nusing ::cvflann::HistIntersectionDistance;\nusing ::cvflann::HellingerDistance;\nusing ::cvflann::ChiSquareDistance;\nusing ::cvflann::KL_Divergence;\n\n\n\ntemplate <typename Distance>\nclass GenericIndex\n{\npublic:\n        typedef typename Distance::ElementType ElementType;\n        typedef typename Distance::ResultType DistanceType;\n\n        GenericIndex(const Mat& features, const ::cvflann::IndexParams& params, Distance distance = Distance());\n\n        ~GenericIndex();\n\n        void knnSearch(const vector<ElementType>& query, vector<int>& indices,\n                       vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& params);\n        void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& params);\n\n        int radiusSearch(const vector<ElementType>& query, vector<int>& indices,\n                         vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& params);\n        int radiusSearch(const Mat& query, Mat& indices, Mat& dists,\n                         DistanceType radius, const ::cvflann::SearchParams& params);\n\n        void save(std::string filename) { nnIndex->save(filename); }\n\n        int veclen() const { return nnIndex->veclen(); }\n\n        int size() const { return nnIndex->size(); }\n\n        ::cvflann::IndexParams getParameters() { return nnIndex->getParameters(); }\n\n        FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); }\n\nprivate:\n        ::cvflann::Index<Distance>* nnIndex;\n};\n\n\n#define FLANN_DISTANCE_CHECK \\\n    if ( ::cvflann::flann_distance_type() != cvflann::FLANN_DIST_L2) { \\\n        printf(\"[WARNING] You are using cv::flann::Index (or cv::flann::GenericIndex) and have also changed \"\\\n        \"the distance using cvflann::set_distance_type. This is no longer working as expected \"\\\n        \"(cv::flann::Index always uses L2). You should create the index templated on the distance, \"\\\n        \"for example for L1 distance use: GenericIndex< L1<float> > \\n\"); \\\n    }\n\n\ntemplate <typename Distance>\nGenericIndex<Distance>::GenericIndex(const Mat& dataset, const ::cvflann::IndexParams& params, Distance distance)\n{\n    CV_Assert(dataset.type() == CvType<ElementType>::type());\n    CV_Assert(dataset.isContinuous());\n    ::cvflann::Matrix<ElementType> m_dataset((ElementType*)dataset.ptr<ElementType>(0), dataset.rows, dataset.cols);\n\n    nnIndex = new ::cvflann::Index<Distance>(m_dataset, params, distance);\n\n    FLANN_DISTANCE_CHECK\n\n    nnIndex->buildIndex();\n}\n\ntemplate <typename Distance>\nGenericIndex<Distance>::~GenericIndex()\n{\n    delete nnIndex;\n}\n\ntemplate <typename Distance>\nvoid GenericIndex<Distance>::knnSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& searchParams)\n{\n    ::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());\n    ::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());\n    ::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());\n\n    FLANN_DISTANCE_CHECK\n\n    nnIndex->knnSearch(m_query,m_indices,m_dists,knn,searchParams);\n}\n\n\ntemplate <typename Distance>\nvoid GenericIndex<Distance>::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams)\n{\n    CV_Assert(queries.type() == CvType<ElementType>::type());\n    CV_Assert(queries.isContinuous());\n    ::cvflann::Matrix<ElementType> m_queries((ElementType*)queries.ptr<ElementType>(0), queries.rows, queries.cols);\n\n    CV_Assert(indices.type() == CV_32S);\n    CV_Assert(indices.isContinuous());\n    ::cvflann::Matrix<int> m_indices((int*)indices.ptr<int>(0), indices.rows, indices.cols);\n\n    CV_Assert(dists.type() == CvType<DistanceType>::type());\n    CV_Assert(dists.isContinuous());\n    ::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);\n\n    FLANN_DISTANCE_CHECK\n\n    nnIndex->knnSearch(m_queries,m_indices,m_dists,knn, searchParams);\n}\n\ntemplate <typename Distance>\nint GenericIndex<Distance>::radiusSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)\n{\n    ::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());\n    ::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());\n    ::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());\n\n    FLANN_DISTANCE_CHECK\n\n    return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n}\n\ntemplate <typename Distance>\nint GenericIndex<Distance>::radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)\n{\n    CV_Assert(query.type() == CvType<ElementType>::type());\n    CV_Assert(query.isContinuous());\n    ::cvflann::Matrix<ElementType> m_query((ElementType*)query.ptr<ElementType>(0), query.rows, query.cols);\n\n    CV_Assert(indices.type() == CV_32S);\n    CV_Assert(indices.isContinuous());\n    ::cvflann::Matrix<int> m_indices((int*)indices.ptr<int>(0), indices.rows, indices.cols);\n\n    CV_Assert(dists.type() == CvType<DistanceType>::type());\n    CV_Assert(dists.isContinuous());\n    ::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);\n\n    FLANN_DISTANCE_CHECK\n\n    return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n}\n\n/**\n * @deprecated Use GenericIndex class instead\n */\ntemplate <typename T>\nclass\n#ifndef _MSC_VER\n FLANN_DEPRECATED\n#endif\n Index_ {\npublic:\n        typedef typename L2<T>::ElementType ElementType;\n        typedef typename L2<T>::ResultType DistanceType;\n\n    Index_(const Mat& features, const ::cvflann::IndexParams& params);\n\n    ~Index_();\n\n    void knnSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& params);\n    void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& params);\n\n    int radiusSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& params);\n    int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& params);\n\n    void save(std::string filename)\n        {\n            if (nnIndex_L1) nnIndex_L1->save(filename);\n            if (nnIndex_L2) nnIndex_L2->save(filename);\n        }\n\n    int veclen() const\n    {\n            if (nnIndex_L1) return nnIndex_L1->veclen();\n            if (nnIndex_L2) return nnIndex_L2->veclen();\n        }\n\n    int size() const\n    {\n            if (nnIndex_L1) return nnIndex_L1->size();\n            if (nnIndex_L2) return nnIndex_L2->size();\n        }\n\n        ::cvflann::IndexParams getParameters()\n        {\n            if (nnIndex_L1) return nnIndex_L1->getParameters();\n            if (nnIndex_L2) return nnIndex_L2->getParameters();\n\n        }\n\n        FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters()\n        {\n            if (nnIndex_L1) return nnIndex_L1->getIndexParameters();\n            if (nnIndex_L2) return nnIndex_L2->getIndexParameters();\n        }\n\nprivate:\n        // providing backwards compatibility for L2 and L1 distances (most common)\n        ::cvflann::Index< L2<ElementType> >* nnIndex_L2;\n        ::cvflann::Index< L1<ElementType> >* nnIndex_L1;\n};\n\n#ifdef _MSC_VER\ntemplate <typename T>\nclass FLANN_DEPRECATED Index_;\n#endif\n\ntemplate <typename T>\nIndex_<T>::Index_(const Mat& dataset, const ::cvflann::IndexParams& params)\n{\n    printf(\"[WARNING] The cv::flann::Index_<T> class is deperecated, use cv::flann::GenericIndex<Distance> instead\\n\");\n\n    CV_Assert(dataset.type() == CvType<ElementType>::type());\n    CV_Assert(dataset.isContinuous());\n    ::cvflann::Matrix<ElementType> m_dataset((ElementType*)dataset.ptr<ElementType>(0), dataset.rows, dataset.cols);\n\n    if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) {\n        nnIndex_L1 = NULL;\n        nnIndex_L2 = new ::cvflann::Index< L2<ElementType> >(m_dataset, params);\n    }\n    else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) {\n        nnIndex_L1 = new ::cvflann::Index< L1<ElementType> >(m_dataset, params);\n        nnIndex_L2 = NULL;\n    }\n    else {\n        printf(\"[ERROR] cv::flann::Index_<T> only provides backwards compatibility for the L1 and L2 distances. \"\n        \"For other distance types you must use cv::flann::GenericIndex<Distance>\\n\");\n        CV_Assert(0);\n    }\n    if (nnIndex_L1) nnIndex_L1->buildIndex();\n    if (nnIndex_L2) nnIndex_L2->buildIndex();\n}\n\ntemplate <typename T>\nIndex_<T>::~Index_()\n{\n    if (nnIndex_L1) delete nnIndex_L1;\n    if (nnIndex_L2) delete nnIndex_L2;\n}\n\ntemplate <typename T>\nvoid Index_<T>::knnSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& searchParams)\n{\n    ::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());\n    ::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());\n    ::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());\n\n    if (nnIndex_L1) nnIndex_L1->knnSearch(m_query,m_indices,m_dists,knn,searchParams);\n    if (nnIndex_L2) nnIndex_L2->knnSearch(m_query,m_indices,m_dists,knn,searchParams);\n}\n\n\ntemplate <typename T>\nvoid Index_<T>::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams)\n{\n    CV_Assert(queries.type() == CvType<ElementType>::type());\n    CV_Assert(queries.isContinuous());\n    ::cvflann::Matrix<ElementType> m_queries((ElementType*)queries.ptr<ElementType>(0), queries.rows, queries.cols);\n\n    CV_Assert(indices.type() == CV_32S);\n    CV_Assert(indices.isContinuous());\n    ::cvflann::Matrix<int> m_indices((int*)indices.ptr<int>(0), indices.rows, indices.cols);\n\n    CV_Assert(dists.type() == CvType<DistanceType>::type());\n    CV_Assert(dists.isContinuous());\n    ::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);\n\n    if (nnIndex_L1) nnIndex_L1->knnSearch(m_queries,m_indices,m_dists,knn, searchParams);\n    if (nnIndex_L2) nnIndex_L2->knnSearch(m_queries,m_indices,m_dists,knn, searchParams);\n}\n\ntemplate <typename T>\nint Index_<T>::radiusSearch(const vector<ElementType>& query, vector<int>& indices, vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)\n{\n    ::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());\n    ::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());\n    ::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());\n\n    if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n    if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n}\n\ntemplate <typename T>\nint Index_<T>::radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)\n{\n    CV_Assert(query.type() == CvType<ElementType>::type());\n    CV_Assert(query.isContinuous());\n    ::cvflann::Matrix<ElementType> m_query((ElementType*)query.ptr<ElementType>(0), query.rows, query.cols);\n\n    CV_Assert(indices.type() == CV_32S);\n    CV_Assert(indices.isContinuous());\n    ::cvflann::Matrix<int> m_indices((int*)indices.ptr<int>(0), indices.rows, indices.cols);\n\n    CV_Assert(dists.type() == CvType<DistanceType>::type());\n    CV_Assert(dists.isContinuous());\n    ::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);\n\n    if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n    if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n}\n\n\ntemplate <typename Distance>\nint hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params,\n                           Distance d = Distance())\n{\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n    CV_Assert(features.type() == CvType<ElementType>::type());\n    CV_Assert(features.isContinuous());\n    ::cvflann::Matrix<ElementType> m_features((ElementType*)features.ptr<ElementType>(0), features.rows, features.cols);\n\n    CV_Assert(centers.type() == CvType<DistanceType>::type());\n    CV_Assert(centers.isContinuous());\n    ::cvflann::Matrix<DistanceType> m_centers((DistanceType*)centers.ptr<DistanceType>(0), centers.rows, centers.cols);\n\n    return ::cvflann::hierarchicalClustering<Distance>(m_features, m_centers, params, d);\n}\n\n\ntemplate <typename ELEM_TYPE, typename DIST_TYPE>\nFLANN_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params)\n{\n    printf(\"[WARNING] cv::flann::hierarchicalClustering<ELEM_TYPE,DIST_TYPE> is deprecated, use \"\n        \"cv::flann::hierarchicalClustering<Distance> instead\\n\");\n\n    if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) {\n        return hierarchicalClustering< L2<ELEM_TYPE> >(features, centers, params);\n    }\n    else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) {\n        return hierarchicalClustering< L1<ELEM_TYPE> >(features, centers, params);\n    }\n    else {\n        printf(\"[ERROR] cv::flann::hierarchicalClustering<ELEM_TYPE,DIST_TYPE> only provides backwards \"\n        \"compatibility for the L1 and L2 distances. \"\n        \"For other distance types you must use cv::flann::hierarchicalClustering<Distance>\\n\");\n        CV_Assert(0);\n    }\n}\n\n} } // namespace cv::flann\n\n#endif // __cplusplus\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/flann_base.hpp",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_BASE_HPP_\n#define OPENCV_FLANN_BASE_HPP_\n\n#include <vector>\n#include <string>\n#include <cassert>\n#include <cstdio>\n\n#include \"general.h\"\n#include \"matrix.h\"\n#include \"params.h\"\n#include \"saving.h\"\n\n#include \"all_indices.h\"\n\nnamespace cvflann\n{\n\n/**\n * Sets the log level used for all flann functions\n * @param level Verbosity level\n */\ninline void log_verbosity(int level)\n{\n    if (level >= 0) {\n        Logger::setLevel(level);\n    }\n}\n\n/**\n * (Deprecated) Index parameters for creating a saved index.\n */\nstruct SavedIndexParams : public IndexParams\n{\n    SavedIndexParams(std::string filename)\n    {\n        (* this)[\"algorithm\"] = FLANN_INDEX_SAVED;\n        (*this)[\"filename\"] = filename;\n    }\n};\n\n\ntemplate<typename Distance>\nNNIndex<Distance>* load_saved_index(const Matrix<typename Distance::ElementType>& dataset, const std::string& filename, Distance distance)\n{\n    typedef typename Distance::ElementType ElementType;\n\n    FILE* fin = fopen(filename.c_str(), \"rb\");\n    if (fin == NULL) {\n        return NULL;\n    }\n    IndexHeader header = load_header(fin);\n    if (header.data_type != Datatype<ElementType>::type()) {\n        throw FLANNException(\"Datatype of saved index is different than of the one to be created.\");\n    }\n    if ((size_t(header.rows) != dataset.rows)||(size_t(header.cols) != dataset.cols)) {\n        throw FLANNException(\"The index saved belongs to a different dataset\");\n    }\n\n    IndexParams params;\n    params[\"algorithm\"] = header.index_type;\n    NNIndex<Distance>* nnIndex = create_index_by_type<Distance>(dataset, params, distance);\n    nnIndex->loadIndex(fin);\n    fclose(fin);\n\n    return nnIndex;\n}\n\n\ntemplate<typename Distance>\nclass Index : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n    Index(const Matrix<ElementType>& features, const IndexParams& params, Distance distance = Distance() )\n        : index_params_(params)\n    {\n        flann_algorithm_t index_type = get_param<flann_algorithm_t>(params,\"algorithm\");\n        loaded_ = false;\n\n        if (index_type == FLANN_INDEX_SAVED) {\n            nnIndex_ = load_saved_index<Distance>(features, get_param<std::string>(params,\"filename\"), distance);\n            loaded_ = true;\n        }\n        else {\n            nnIndex_ = create_index_by_type<Distance>(features, params, distance);\n        }\n    }\n\n    ~Index()\n    {\n        delete nnIndex_;\n    }\n\n    /**\n    * implementation for algorithms of addable indexes after that.\n    */\n    void addIndex(const Matrix<ElementType>& wholeData, const Matrix<ElementType>& additionalData)\n    {\n        if (!loaded_) {\n            nnIndex_->addIndex(wholeData, additionalData);\n        }\n    }\n\n    /**\n     * Builds the index.\n     */\n    void buildIndex()\n    {\n        if (!loaded_) {\n            nnIndex_->buildIndex();\n        }\n    }\n\n    void save(std::string filename)\n    {\n        FILE* fout = fopen(filename.c_str(), \"wb\");\n        if (fout == NULL) {\n            throw FLANNException(\"Cannot open file\");\n        }\n        save_header(fout, *nnIndex_);\n        saveIndex(fout);\n        fclose(fout);\n    }\n\n    /**\n     * \\brief Saves the index to a stream\n     * \\param stream The stream to save the index to\n     */\n    virtual void saveIndex(FILE* stream)\n    {\n        nnIndex_->saveIndex(stream);\n    }\n\n    /**\n     * \\brief Loads the index from a stream\n     * \\param stream The stream from which the index is loaded\n     */\n    virtual void loadIndex(FILE* stream)\n    {\n        nnIndex_->loadIndex(stream);\n    }\n\n    /**\n     * \\returns number of features in this index.\n     */\n    size_t veclen() const\n    {\n        return nnIndex_->veclen();\n    }\n\n    /**\n     * \\returns The dimensionality of the features in this index.\n     */\n    size_t size() const\n    {\n        return nnIndex_->size();\n    }\n\n    /**\n     * \\returns The index type (kdtree, kmeans,...)\n     */\n    flann_algorithm_t getType() const\n    {\n        return nnIndex_->getType();\n    }\n\n    /**\n     * \\returns The amount of memory (in bytes) used by the index.\n     */\n    virtual int usedMemory() const\n    {\n        return nnIndex_->usedMemory();\n    }\n\n\n    /**\n     * \\returns The index parameters\n     */\n    IndexParams getParameters() const\n    {\n        return nnIndex_->getParameters();\n    }\n\n    /**\n     * \\brief Perform k-nearest neighbor search\n     * \\param[in] queries The query points for which to find the nearest neighbors\n     * \\param[out] indices The indices of the nearest neighbors found\n     * \\param[out] dists Distances to the nearest neighbors found\n     * \\param[in] knn Number of nearest neighbors to return\n     * \\param[in] params Search parameters\n     */\n    void knnSearch(const Matrix<ElementType>& queries, Matrix<int>& indices, Matrix<DistanceType>& dists, int knn, const SearchParams& params)\n    {\n        nnIndex_->knnSearch(queries, indices, dists, knn, params);\n    }\n\n    /**\n     * \\brief Perform radius search\n     * \\param[in] query The query point\n     * \\param[out] indices The indinces of the neighbors found within the given radius\n     * \\param[out] dists The distances to the nearest neighbors found\n     * \\param[in] radius The radius used for search\n     * \\param[in] params Search parameters\n     * \\returns Number of neighbors found\n     */\n    int radiusSearch(const Matrix<ElementType>& query, Matrix<int>& indices, Matrix<DistanceType>& dists, float radius, const SearchParams& params)\n    {\n        return nnIndex_->radiusSearch(query, indices, dists, radius, params);\n    }\n\n    /**\n     * \\brief Method that searches for nearest-neighbours\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams)\n    {\n        nnIndex_->findNeighbors(result, vec, searchParams);\n    }\n\n    /**\n     * \\brief Returns actual index\n     */\n    FLANN_DEPRECATED NNIndex<Distance>* getIndex()\n    {\n        return nnIndex_;\n    }\n\n    /**\n     * \\brief Returns index parameters.\n     * \\deprecated use getParameters() instead.\n     */\n    FLANN_DEPRECATED  const IndexParams* getIndexParameters()\n    {\n        return &index_params_;\n    }\n\nprivate:\n    /** Pointer to actual index class */\n    NNIndex<Distance>* nnIndex_;\n    /** Indices if the index was loaded from a file */\n    bool loaded_;\n    /** Parameters passed to the index */\n    IndexParams index_params_;\n};\n\n/**\n * Performs a hierarchical clustering of the points passed as argument and then takes a cut in the\n * the clustering tree to return a flat clustering.\n * @param[in] points Points to be clustered\n * @param centers The computed cluster centres. Matrix should be preallocated and centers.rows is the\n *  number of clusters requested.\n * @param params Clustering parameters (The same as for cvflann::KMeansIndex)\n * @param d Distance to be used for clustering (eg: cvflann::L2)\n * @return number of clusters computed (can be different than clusters.rows and is the highest number\n * of the form (branching-1)*K+1 smaller than clusters.rows).\n */\ntemplate <typename Distance>\nint hierarchicalClustering(const Matrix<typename Distance::ElementType>& points, Matrix<typename Distance::ResultType>& centers,\n                           const KMeansIndexParams& params, Distance d = Distance())\n{\n    KMeansIndex<Distance> kmeans(points, params, d);\n    kmeans.buildIndex();\n\n    int clusterNum = kmeans.getClusterCenters(centers);\n    return clusterNum;\n}\n\n}\n#endif /* OPENCV_FLANN_BASE_HPP_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/general.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_GENERAL_H_\n#define OPENCV_FLANN_GENERAL_H_\n\n#include \"defines.h\"\n#include <stdexcept>\n#include <cassert>\n\nnamespace cvflann\n{\n\nclass FLANNException : public std::runtime_error\n{\npublic:\n    FLANNException(const char* message) : std::runtime_error(message) { }\n\n    FLANNException(const std::string& message) : std::runtime_error(message) { }\n};\n\n}\n\n\n#endif  /* OPENCV_FLANN_GENERAL_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/ground_truth.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_GROUND_TRUTH_H_\n#define OPENCV_FLANN_GROUND_TRUTH_H_\n\n#include \"dist.h\"\n#include \"matrix.h\"\n\n\nnamespace cvflann\n{\n\ntemplate <typename Distance>\nvoid find_nearest(const Matrix<typename Distance::ElementType>& dataset, typename Distance::ElementType* query, int* matches, int nn,\n                  int skip = 0, Distance distance = Distance())\n{\n    typedef typename Distance::ResultType DistanceType;\n    int n = nn + skip;\n\n    std::vector<int> match(n);\n    std::vector<DistanceType> dists(n);\n\n    dists[0] = distance(dataset[0], query, dataset.cols);\n    match[0] = 0;\n    int dcnt = 1;\n\n    for (size_t i=1; i<dataset.rows; ++i) {\n        DistanceType tmp = distance(dataset[i], query, dataset.cols);\n\n        if (dcnt<n) {\n            match[dcnt] = (int)i;\n            dists[dcnt++] = tmp;\n        }\n        else if (tmp < dists[dcnt-1]) {\n            dists[dcnt-1] = tmp;\n            match[dcnt-1] = (int)i;\n        }\n\n        int j = dcnt-1;\n        // bubble up\n        while (j>=1 && dists[j]<dists[j-1]) {\n            std::swap(dists[j],dists[j-1]);\n            std::swap(match[j],match[j-1]);\n            j--;\n        }\n    }\n\n    for (int i=0; i<nn; ++i) {\n        matches[i] = match[i+skip];\n    }\n}\n\n\ntemplate <typename Distance>\nvoid compute_ground_truth(const Matrix<typename Distance::ElementType>& dataset, const Matrix<typename Distance::ElementType>& testset, Matrix<int>& matches,\n                          int skip=0, Distance d = Distance())\n{\n    for (size_t i=0; i<testset.rows; ++i) {\n        find_nearest<Distance>(dataset, testset[i], matches[i], (int)matches.cols, skip, d);\n    }\n}\n\n\n}\n\n#endif //OPENCV_FLANN_GROUND_TRUTH_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/hdf5.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_HDF5_H_\n#define OPENCV_FLANN_HDF5_H_\n\n#include <hdf5.h>\n\n#include \"matrix.h\"\n\n\nnamespace cvflann\n{\n\nnamespace\n{\n\ntemplate<typename T>\nhid_t get_hdf5_type()\n{\n    throw FLANNException(\"Unsupported type for IO operations\");\n}\n\ntemplate<>\nhid_t get_hdf5_type<char>() { return H5T_NATIVE_CHAR; }\ntemplate<>\nhid_t get_hdf5_type<unsigned char>() { return H5T_NATIVE_UCHAR; }\ntemplate<>\nhid_t get_hdf5_type<short int>() { return H5T_NATIVE_SHORT; }\ntemplate<>\nhid_t get_hdf5_type<unsigned short int>() { return H5T_NATIVE_USHORT; }\ntemplate<>\nhid_t get_hdf5_type<int>() { return H5T_NATIVE_INT; }\ntemplate<>\nhid_t get_hdf5_type<unsigned int>() { return H5T_NATIVE_UINT; }\ntemplate<>\nhid_t get_hdf5_type<long>() { return H5T_NATIVE_LONG; }\ntemplate<>\nhid_t get_hdf5_type<unsigned long>() { return H5T_NATIVE_ULONG; }\ntemplate<>\nhid_t get_hdf5_type<float>() { return H5T_NATIVE_FLOAT; }\ntemplate<>\nhid_t get_hdf5_type<double>() { return H5T_NATIVE_DOUBLE; }\n}\n\n\n#define CHECK_ERROR(x,y) if ((x)<0) throw FLANNException((y));\n\ntemplate<typename T>\nvoid save_to_file(const cvflann::Matrix<T>& dataset, const std::string& filename, const std::string& name)\n{\n\n#if H5Eset_auto_vers == 2\n    H5Eset_auto( H5E_DEFAULT, NULL, NULL );\n#else\n    H5Eset_auto( NULL, NULL );\n#endif\n\n    herr_t status;\n    hid_t file_id;\n    file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, H5P_DEFAULT);\n    if (file_id < 0) {\n        file_id = H5Fcreate(filename.c_str(), H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT);\n    }\n    CHECK_ERROR(file_id,\"Error creating hdf5 file.\");\n\n    hsize_t     dimsf[2];              // dataset dimensions\n    dimsf[0] = dataset.rows;\n    dimsf[1] = dataset.cols;\n\n    hid_t space_id = H5Screate_simple(2, dimsf, NULL);\n    hid_t memspace_id = H5Screate_simple(2, dimsf, NULL);\n\n    hid_t dataset_id;\n#if H5Dcreate_vers == 2\n    dataset_id = H5Dcreate2(file_id, name.c_str(), get_hdf5_type<T>(), space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);\n#else\n    dataset_id = H5Dcreate(file_id, name.c_str(), get_hdf5_type<T>(), space_id, H5P_DEFAULT);\n#endif\n\n    if (dataset_id<0) {\n#if H5Dopen_vers == 2\n        dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT);\n#else\n        dataset_id = H5Dopen(file_id, name.c_str());\n#endif\n    }\n    CHECK_ERROR(dataset_id,\"Error creating or opening dataset in file.\");\n\n    status = H5Dwrite(dataset_id, get_hdf5_type<T>(), memspace_id, space_id, H5P_DEFAULT, dataset.data );\n    CHECK_ERROR(status, \"Error writing to dataset\");\n\n    H5Sclose(memspace_id);\n    H5Sclose(space_id);\n    H5Dclose(dataset_id);\n    H5Fclose(file_id);\n\n}\n\n\ntemplate<typename T>\nvoid load_from_file(cvflann::Matrix<T>& dataset, const std::string& filename, const std::string& name)\n{\n    herr_t status;\n    hid_t file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, H5P_DEFAULT);\n    CHECK_ERROR(file_id,\"Error opening hdf5 file.\");\n\n    hid_t dataset_id;\n#if H5Dopen_vers == 2\n    dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT);\n#else\n    dataset_id = H5Dopen(file_id, name.c_str());\n#endif\n    CHECK_ERROR(dataset_id,\"Error opening dataset in file.\");\n\n    hid_t space_id = H5Dget_space(dataset_id);\n\n    hsize_t dims_out[2];\n    H5Sget_simple_extent_dims(space_id, dims_out, NULL);\n\n    dataset = cvflann::Matrix<T>(new T[dims_out[0]*dims_out[1]], dims_out[0], dims_out[1]);\n\n    status = H5Dread(dataset_id, get_hdf5_type<T>(), H5S_ALL, H5S_ALL, H5P_DEFAULT, dataset[0]);\n    CHECK_ERROR(status, \"Error reading dataset\");\n\n    H5Sclose(space_id);\n    H5Dclose(dataset_id);\n    H5Fclose(file_id);\n}\n\n\n#ifdef HAVE_MPI\n\nnamespace mpi\n{\n/**\n * Loads a the hyperslice corresponding to this processor from a hdf5 file.\n * @param flann_dataset Dataset where the data is loaded\n * @param filename HDF5 file name\n * @param name Name of dataset inside file\n */\ntemplate<typename T>\nvoid load_from_file(cvflann::Matrix<T>& dataset, const std::string& filename, const std::string& name)\n{\n    MPI_Comm comm  = MPI_COMM_WORLD;\n    MPI_Info info  = MPI_INFO_NULL;\n\n    int mpi_size, mpi_rank;\n    MPI_Comm_size(comm, &mpi_size);\n    MPI_Comm_rank(comm, &mpi_rank);\n\n    herr_t status;\n\n    hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS);\n    H5Pset_fapl_mpio(plist_id, comm, info);\n    hid_t file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, plist_id);\n    CHECK_ERROR(file_id,\"Error opening hdf5 file.\");\n    H5Pclose(plist_id);\n    hid_t dataset_id;\n#if H5Dopen_vers == 2\n    dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT);\n#else\n    dataset_id = H5Dopen(file_id, name.c_str());\n#endif\n    CHECK_ERROR(dataset_id,\"Error opening dataset in file.\");\n\n    hid_t space_id = H5Dget_space(dataset_id);\n    hsize_t dims[2];\n    H5Sget_simple_extent_dims(space_id, dims, NULL);\n\n    hsize_t count[2];\n    hsize_t offset[2];\n\n    hsize_t item_cnt = dims[0]/mpi_size+(dims[0]%mpi_size==0 ? 0 : 1);\n    hsize_t cnt = (mpi_rank<mpi_size-1 ? item_cnt : dims[0]-item_cnt*(mpi_size-1));\n\n    count[0] = cnt;\n    count[1] = dims[1];\n    offset[0] = mpi_rank*item_cnt;\n    offset[1] = 0;\n\n    hid_t memspace_id = H5Screate_simple(2,count,NULL);\n\n    H5Sselect_hyperslab(space_id, H5S_SELECT_SET, offset, NULL, count, NULL);\n\n    dataset.rows = count[0];\n    dataset.cols = count[1];\n    dataset.data = new T[dataset.rows*dataset.cols];\n\n    plist_id = H5Pcreate(H5P_DATASET_XFER);\n    H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE);\n    status = H5Dread(dataset_id, get_hdf5_type<T>(), memspace_id, space_id, plist_id, dataset.data);\n    CHECK_ERROR(status, \"Error reading dataset\");\n\n    H5Pclose(plist_id);\n    H5Sclose(space_id);\n    H5Sclose(memspace_id);\n    H5Dclose(dataset_id);\n    H5Fclose(file_id);\n}\n}\n#endif // HAVE_MPI\n} // namespace cvflann::mpi\n\n#endif /* OPENCV_FLANN_HDF5_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/heap.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_HEAP_H_\n#define OPENCV_FLANN_HEAP_H_\n\n#include <algorithm>\n#include <vector>\n\nnamespace cvflann\n{\n\n/**\n * Priority Queue Implementation\n *\n * The priority queue is implemented with a heap.  A heap is a complete\n * (full) binary tree in which each parent is less than both of its\n * children, but the order of the children is unspecified.\n */\ntemplate <typename T>\nclass Heap\n{\n\n    /**\n     * Storage array for the heap.\n     * Type T must be comparable.\n     */\n    std::vector<T> heap;\n    int length;\n\n    /**\n     * Number of element in the heap\n     */\n    int count;\n\n\n\npublic:\n    /**\n     * Constructor.\n     *\n     * Params:\n     *     sz = heap size\n     */\n\n    Heap(int sz)\n    {\n        length = sz;\n        heap.reserve(length);\n        count = 0;\n    }\n\n    /**\n     *\n     * Returns: heap size\n     */\n    int size()\n    {\n        return count;\n    }\n\n    /**\n     * Tests if the heap is empty\n     *\n     * Returns: true is heap empty, false otherwise\n     */\n    bool empty()\n    {\n        return size()==0;\n    }\n\n    /**\n     * Clears the heap.\n     */\n    void clear()\n    {\n        heap.clear();\n        count = 0;\n    }\n\n    struct CompareT\n    {\n        bool operator()(const T& t_1, const T& t_2) const\n        {\n            return t_2 < t_1;\n        }\n    };\n\n    /**\n     * Insert a new element in the heap.\n     *\n     * We select the next empty leaf node, and then keep moving any larger\n     * parents down until the right location is found to store this element.\n     *\n     * Params:\n     *     value = the new element to be inserted in the heap\n     */\n    void insert(T value)\n    {\n        /* If heap is full, then return without adding this element. */\n        if (count == length) {\n            return;\n        }\n\n        heap.push_back(value);\n        static CompareT compareT;\n        std::push_heap(heap.begin(), heap.end(), compareT);\n        ++count;\n    }\n\n\n\n    /**\n     * Returns the node of minimum value from the heap (top of the heap).\n     *\n     * Params:\n     *     value = out parameter used to return the min element\n     * Returns: false if heap empty\n     */\n    bool popMin(T& value)\n    {\n        if (count == 0) {\n            return false;\n        }\n\n        value = heap[0];\n        static CompareT compareT;\n        std::pop_heap(heap.begin(), heap.end(), compareT);\n        heap.pop_back();\n        --count;\n\n        return true;  /* Return old last node. */\n    }\n};\n\n}\n\n#endif //OPENCV_FLANN_HEAP_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/hierarchical_clustering_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2011  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2011  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_\n#define OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_\n\n#include <algorithm>\n#include <string>\n#include <map>\n#include <cassert>\n#include <limits>\n#include <cmath>\n\n#include \"general.h\"\n#include \"nn_index.h\"\n#include \"dist.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n\n\nnamespace cvflann\n{\n\nstruct HierarchicalClusteringIndexParams : public IndexParams\n{\n    HierarchicalClusteringIndexParams(int branching = 32,\n                                      flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM,\n                                      int trees = 4, int leaf_size = 100)\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_HIERARCHICAL;\n        // The branching factor used in the hierarchical clustering\n        (*this)[\"branching\"] = branching;\n        // Algorithm used for picking the initial cluster centers\n        (*this)[\"centers_init\"] = centers_init;\n        // number of parallel trees to build\n        (*this)[\"trees\"] = trees;\n        // maximum leaf size\n        (*this)[\"leaf_size\"] = leaf_size;\n    }\n};\n\n\n/**\n * Hierarchical index\n *\n * Contains a tree constructed through a hierarchical clustering\n * and other information for indexing a set of points for nearest-neighbour matching.\n */\ntemplate <typename Distance>\nclass HierarchicalClusteringIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\nprivate:\n\n\n    typedef void (HierarchicalClusteringIndex::* centersAlgFunction)(int, int*, int, int*, int&);\n\n    /**\n     * The function used for choosing the cluster centers.\n     */\n    centersAlgFunction chooseCenters;\n\n\n\n    /**\n     * Chooses the initial centers in the k-means clustering in a random manner.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     *     indices_length = length of indices vector\n     *\n     */\n    void chooseCentersRandom(int k, int* dsindices, int indices_length, int* centers, int& centers_length)\n    {\n        UniqueRandom r(indices_length);\n\n        int index;\n        for (index=0; index<k; ++index) {\n            bool duplicate = true;\n            int rnd;\n            while (duplicate) {\n                duplicate = false;\n                rnd = r.next();\n                if (rnd<0) {\n                    centers_length = index;\n                    return;\n                }\n\n                centers[index] = dsindices[rnd];\n\n                for (int j=0; j<index; ++j) {\n                    DistanceType sq = distance(dataset[centers[index]], dataset[centers[j]], dataset.cols);\n                    if (sq<1e-16) {\n                        duplicate = true;\n                    }\n                }\n            }\n        }\n\n        centers_length = index;\n    }\n\n\n    /**\n     * Chooses the initial centers in the k-means using Gonzales' algorithm\n     * so that the centers are spaced apart from each other.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     * Returns:\n     */\n    void chooseCentersGonzales(int k, int* dsindices, int indices_length, int* centers, int& centers_length)\n    {\n        int n = indices_length;\n\n        int rnd = rand_int(n);\n        assert(rnd >=0 && rnd < n);\n\n        centers[0] = dsindices[rnd];\n\n        int index;\n        for (index=1; index<k; ++index) {\n\n            int best_index = -1;\n            DistanceType best_val = 0;\n            for (int j=0; j<n; ++j) {\n                DistanceType dist = distance(dataset[centers[0]],dataset[dsindices[j]],dataset.cols);\n                for (int i=1; i<index; ++i) {\n                    DistanceType tmp_dist = distance(dataset[centers[i]],dataset[dsindices[j]],dataset.cols);\n                    if (tmp_dist<dist) {\n                        dist = tmp_dist;\n                    }\n                }\n                if (dist>best_val) {\n                    best_val = dist;\n                    best_index = j;\n                }\n            }\n            if (best_index!=-1) {\n                centers[index] = dsindices[best_index];\n            }\n            else {\n                break;\n            }\n        }\n        centers_length = index;\n    }\n\n\n    /**\n     * Chooses the initial centers in the k-means using the algorithm\n     * proposed in the KMeans++ paper:\n     * Arthur, David; Vassilvitskii, Sergei - k-means++: The Advantages of Careful Seeding\n     *\n     * Implementation of this function was converted from the one provided in Arthur's code.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     * Returns:\n     */\n    void chooseCentersKMeanspp(int k, int* dsindices, int indices_length, int* centers, int& centers_length)\n    {\n        int n = indices_length;\n\n        double currentPot = 0;\n        DistanceType* closestDistSq = new DistanceType[n];\n\n        // Choose one random center and set the closestDistSq values\n        int index = rand_int(n);\n        assert(index >=0 && index < n);\n        centers[0] = dsindices[index];\n\n        // Computing distance^2 will have the advantage of even higher probability further to pick new centers\n        // far from previous centers (and this complies to \"k-means++: the advantages of careful seeding\" article)\n        for (int i = 0; i < n; i++) {\n            closestDistSq[i] = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols);\n            closestDistSq[i] = ensureSquareDistance<Distance>( closestDistSq[i] );\n            currentPot += closestDistSq[i];\n        }\n\n\n        const int numLocalTries = 1;\n\n        // Choose each center\n        int centerCount;\n        for (centerCount = 1; centerCount < k; centerCount++) {\n\n            // Repeat several trials\n            double bestNewPot = -1;\n            int bestNewIndex = 0;\n            for (int localTrial = 0; localTrial < numLocalTries; localTrial++) {\n\n                // Choose our center - have to be slightly careful to return a valid answer even accounting\n                // for possible rounding errors\n                double randVal = rand_double(currentPot);\n                for (index = 0; index < n-1; index++) {\n                    if (randVal <= closestDistSq[index]) break;\n                    else randVal -= closestDistSq[index];\n                }\n\n                // Compute the new potential\n                double newPot = 0;\n                for (int i = 0; i < n; i++) {\n                    DistanceType dist = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols);\n                    newPot += std::min( ensureSquareDistance<Distance>(dist), closestDistSq[i] );\n                }\n\n                // Store the best result\n                if ((bestNewPot < 0)||(newPot < bestNewPot)) {\n                    bestNewPot = newPot;\n                    bestNewIndex = index;\n                }\n            }\n\n            // Add the appropriate center\n            centers[centerCount] = dsindices[bestNewIndex];\n            currentPot = bestNewPot;\n            for (int i = 0; i < n; i++) {\n                DistanceType dist = distance(dataset[dsindices[i]], dataset[dsindices[bestNewIndex]], dataset.cols);\n                closestDistSq[i] = std::min( ensureSquareDistance<Distance>(dist), closestDistSq[i] );\n            }\n        }\n\n        centers_length = centerCount;\n\n        delete[] closestDistSq;\n    }\n\n\npublic:\n\n\n    /**\n     * Index constructor\n     *\n     * Params:\n     *          inputData = dataset with the input features\n     *          params = parameters passed to the hierarchical k-means algorithm\n     */\n    HierarchicalClusteringIndex(const Matrix<ElementType>& inputData, const IndexParams& index_params = HierarchicalClusteringIndexParams(),\n                                Distance d = Distance())\n        : dataset(inputData), params(index_params), root(NULL), indices(NULL), distance(d)\n    {\n        memoryCounter = 0;\n\n        size_ = dataset.rows;\n        veclen_ = dataset.cols;\n\n        branching_ = get_param(params,\"branching\",32);\n        centers_init_ = get_param(params,\"centers_init\", FLANN_CENTERS_RANDOM);\n        trees_ = get_param(params,\"trees\",4);\n        leaf_size_ = get_param(params,\"leaf_size\",100);\n\n        if (centers_init_==FLANN_CENTERS_RANDOM) {\n            chooseCenters = &HierarchicalClusteringIndex::chooseCentersRandom;\n        }\n        else if (centers_init_==FLANN_CENTERS_GONZALES) {\n            chooseCenters = &HierarchicalClusteringIndex::chooseCentersGonzales;\n        }\n        else if (centers_init_==FLANN_CENTERS_KMEANSPP) {\n            chooseCenters = &HierarchicalClusteringIndex::chooseCentersKMeanspp;\n        }\n        else {\n            throw FLANNException(\"Unknown algorithm for choosing initial centers.\");\n        }\n\n        trees_ = get_param(params,\"trees\",4);\n        root = new NodePtr[trees_];\n        indices = new int*[trees_];\n\n        for (int i=0; i<trees_; ++i) {\n            root[i] = NULL;\n            indices[i] = NULL;\n        }\n    }\n\n    HierarchicalClusteringIndex(const HierarchicalClusteringIndex&);\n    HierarchicalClusteringIndex& operator=(const HierarchicalClusteringIndex&);\n\n    /**\n     * Index destructor.\n     *\n     * Release the memory used by the index.\n     */\n    virtual ~HierarchicalClusteringIndex()\n    {\n        free_elements();\n\n        if (root!=NULL) {\n            delete[] root;\n        }\n\n        if (indices!=NULL) {\n            delete[] indices;\n        }\n    }\n\n\n    /**\n     * Release the inner elements of indices[]\n     */\n    void free_elements()\n    {\n        if (indices!=NULL) {\n            for(int i=0; i<trees_; ++i) {\n                if (indices[i]!=NULL) {\n                    delete[] indices[i];\n                    indices[i] = NULL;\n                }\n            }\n        }\n    }\n\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const\n    {\n        return size_;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const\n    {\n        return veclen_;\n    }\n\n\n    /**\n     * Computes the inde memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const\n    {\n        return pool.usedMemory+pool.wastedMemory+memoryCounter;\n    }\n\n\n    /**\n     * Dummy implementation for other algorithms of addable indexes after that.\n     */\n    void addIndex(const Matrix<ElementType>& /*wholeData*/, const Matrix<ElementType>& /*additionalData*/)\n    {\n    }\n\n    /**\n     * Builds the index\n     */\n    void buildIndex()\n    {\n        if (branching_<2) {\n            throw FLANNException(\"Branching factor must be at least 2\");\n        }\n\n        free_elements();\n\n        for (int i=0; i<trees_; ++i) {\n            indices[i] = new int[size_];\n            for (size_t j=0; j<size_; ++j) {\n                indices[i][j] = (int)j;\n            }\n            root[i] = pool.allocate<Node>();\n            computeClustering(root[i], indices[i], (int)size_, branching_,0);\n        }\n    }\n\n\n    flann_algorithm_t getType() const\n    {\n        return FLANN_INDEX_HIERARCHICAL;\n    }\n\n\n    void saveIndex(FILE* stream)\n    {\n        save_value(stream, branching_);\n        save_value(stream, trees_);\n        save_value(stream, centers_init_);\n        save_value(stream, leaf_size_);\n        save_value(stream, memoryCounter);\n        for (int i=0; i<trees_; ++i) {\n            save_value(stream, *indices[i], size_);\n            save_tree(stream, root[i], i);\n        }\n\n    }\n\n\n    void loadIndex(FILE* stream)\n    {\n        free_elements();\n\n        if (root!=NULL) {\n            delete[] root;\n        }\n\n        if (indices!=NULL) {\n            delete[] indices;\n        }\n\n        load_value(stream, branching_);\n        load_value(stream, trees_);\n        load_value(stream, centers_init_);\n        load_value(stream, leaf_size_);\n        load_value(stream, memoryCounter);\n\n        indices = new int*[trees_];\n        root = new NodePtr[trees_];\n        for (int i=0; i<trees_; ++i) {\n            indices[i] = new int[size_];\n            load_value(stream, *indices[i], size_);\n            load_tree(stream, root[i], i);\n        }\n\n        params[\"algorithm\"] = getType();\n        params[\"branching\"] = branching_;\n        params[\"trees\"] = trees_;\n        params[\"centers_init\"] = centers_init_;\n        params[\"leaf_size\"] = leaf_size_;\n    }\n\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     searchParams = parameters that influence the search algorithm (checks)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams)\n    {\n\n        int maxChecks = get_param(searchParams,\"checks\",32);\n\n        // Priority queue storing intermediate branches in the best-bin-first search\n        Heap<BranchSt>* heap = new Heap<BranchSt>((int)size_);\n\n        std::vector<bool> checked(size_,false);\n        int checks = 0;\n        for (int i=0; i<trees_; ++i) {\n            findNN(root[i], result, vec, checks, maxChecks, heap, checked);\n        }\n\n        BranchSt branch;\n        while (heap->popMin(branch) && (checks<maxChecks || !result.full())) {\n            NodePtr node = branch.node;\n            findNN(node, result, vec, checks, maxChecks, heap, checked);\n        }\n        assert(result.full());\n\n        delete heap;\n\n    }\n\n    IndexParams getParameters() const\n    {\n        return params;\n    }\n\n\nprivate:\n\n    /**\n     * Struture representing a node in the hierarchical k-means tree.\n     */\n    struct Node\n    {\n        /**\n         * The cluster center index\n         */\n        int pivot;\n        /**\n         * The cluster size (number of points in the cluster)\n         */\n        int size;\n        /**\n         * Child nodes (only for non-terminal nodes)\n         */\n        Node** childs;\n        /**\n         * Node points (only for terminal nodes)\n         */\n        int* indices;\n        /**\n         * Level\n         */\n        int level;\n    };\n    typedef Node* NodePtr;\n\n\n\n    /**\n     * Alias definition for a nicer syntax.\n     */\n    typedef BranchStruct<NodePtr, DistanceType> BranchSt;\n\n\n\n    void save_tree(FILE* stream, NodePtr node, int num)\n    {\n        save_value(stream, *node);\n        if (node->childs==NULL) {\n            int indices_offset = (int)(node->indices - indices[num]);\n            save_value(stream, indices_offset);\n        }\n        else {\n            for(int i=0; i<branching_; ++i) {\n                save_tree(stream, node->childs[i], num);\n            }\n        }\n    }\n\n\n    void load_tree(FILE* stream, NodePtr& node, int num)\n    {\n        node = pool.allocate<Node>();\n        load_value(stream, *node);\n        if (node->childs==NULL) {\n            int indices_offset;\n            load_value(stream, indices_offset);\n            node->indices = indices[num] + indices_offset;\n        }\n        else {\n            node->childs = pool.allocate<NodePtr>(branching_);\n            for(int i=0; i<branching_; ++i) {\n                load_tree(stream, node->childs[i], num);\n            }\n        }\n    }\n\n\n\n\n    void computeLabels(int* dsindices, int indices_length,  int* centers, int centers_length, int* labels, DistanceType& cost)\n    {\n        cost = 0;\n        for (int i=0; i<indices_length; ++i) {\n            ElementType* point = dataset[dsindices[i]];\n            DistanceType dist = distance(point, dataset[centers[0]], veclen_);\n            labels[i] = 0;\n            for (int j=1; j<centers_length; ++j) {\n                DistanceType new_dist = distance(point, dataset[centers[j]], veclen_);\n                if (dist>new_dist) {\n                    labels[i] = j;\n                    dist = new_dist;\n                }\n            }\n            cost += dist;\n        }\n    }\n\n    /**\n     * The method responsible with actually doing the recursive hierarchical\n     * clustering\n     *\n     * Params:\n     *     node = the node to cluster\n     *     indices = indices of the points belonging to the current node\n     *     branching = the branching factor to use in the clustering\n     *\n     * TODO: for 1-sized clusters don't store a cluster center (it's the same as the single cluster point)\n     */\n    void computeClustering(NodePtr node, int* dsindices, int indices_length, int branching, int level)\n    {\n        node->size = indices_length;\n        node->level = level;\n\n        if (indices_length < leaf_size_) { // leaf node\n            node->indices = dsindices;\n            std::sort(node->indices,node->indices+indices_length);\n            node->childs = NULL;\n            return;\n        }\n\n        std::vector<int> centers(branching);\n        std::vector<int> labels(indices_length);\n\n        int centers_length;\n        (this->*chooseCenters)(branching, dsindices, indices_length, &centers[0], centers_length);\n\n        if (centers_length<branching) {\n            node->indices = dsindices;\n            std::sort(node->indices,node->indices+indices_length);\n            node->childs = NULL;\n            return;\n        }\n\n\n        //\tassign points to clusters\n        DistanceType cost;\n        computeLabels(dsindices, indices_length, &centers[0], centers_length, &labels[0], cost);\n\n        node->childs = pool.allocate<NodePtr>(branching);\n        int start = 0;\n        int end = start;\n        for (int i=0; i<branching; ++i) {\n            for (int j=0; j<indices_length; ++j) {\n                if (labels[j]==i) {\n                    std::swap(dsindices[j],dsindices[end]);\n                    std::swap(labels[j],labels[end]);\n                    end++;\n                }\n            }\n\n            node->childs[i] = pool.allocate<Node>();\n            node->childs[i]->pivot = centers[i];\n            node->childs[i]->indices = NULL;\n            computeClustering(node->childs[i],dsindices+start, end-start, branching, level+1);\n            start=end;\n        }\n    }\n\n\n\n    /**\n     * Performs one descent in the hierarchical k-means tree. The branches not\n     * visited are stored in a priority queue.\n     *\n     * Params:\n     *      node = node to explore\n     *      result = container for the k-nearest neighbors found\n     *      vec = query points\n     *      checks = how many points in the dataset have been checked so far\n     *      maxChecks = maximum dataset points to checks\n     */\n\n\n    void findNN(NodePtr node, ResultSet<DistanceType>& result, const ElementType* vec, int& checks, int maxChecks,\n                Heap<BranchSt>* heap, std::vector<bool>& checked)\n    {\n        if (node->childs==NULL) {\n            if (checks>=maxChecks) {\n                if (result.full()) return;\n            }\n            for (int i=0; i<node->size; ++i) {\n                int index = node->indices[i];\n                if (!checked[index]) {\n                    DistanceType dist = distance(dataset[index], vec, veclen_);\n                    result.addPoint(dist, index);\n                    checked[index] = true;\n                    ++checks;\n                }\n            }\n        }\n        else {\n            DistanceType* domain_distances = new DistanceType[branching_];\n            int best_index = 0;\n            domain_distances[best_index] = distance(vec, dataset[node->childs[best_index]->pivot], veclen_);\n            for (int i=1; i<branching_; ++i) {\n                domain_distances[i] = distance(vec, dataset[node->childs[i]->pivot], veclen_);\n                if (domain_distances[i]<domain_distances[best_index]) {\n                    best_index = i;\n                }\n            }\n            for (int i=0; i<branching_; ++i) {\n                if (i!=best_index) {\n                    heap->insert(BranchSt(node->childs[i],domain_distances[i]));\n                }\n            }\n            delete[] domain_distances;\n            findNN(node->childs[best_index],result,vec, checks, maxChecks, heap, checked);\n        }\n    }\n\nprivate:\n\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset;\n\n    /**\n     * Parameters used by this index\n     */\n    IndexParams params;\n\n\n    /**\n     * Number of features in the dataset.\n     */\n    size_t size_;\n\n    /**\n     * Length of each feature.\n     */\n    size_t veclen_;\n\n    /**\n     * The root node in the tree.\n     */\n    NodePtr* root;\n\n    /**\n     *  Array of indices to vectors in the dataset.\n     */\n    int** indices;\n\n\n    /**\n     * The distance\n     */\n    Distance distance;\n\n    /**\n     * Pooled memory allocator.\n     *\n     * Using a pooled memory allocator is more efficient\n     * than allocating memory directly when there is a large\n     * number small of memory allocations.\n     */\n    PooledAllocator pool;\n\n    /**\n     * Memory occupied by the index.\n     */\n    int memoryCounter;\n\n    /** index parameters */\n    int branching_;\n    int trees_;\n    flann_centers_init_t centers_init_;\n    int leaf_size_;\n\n\n};\n\n}\n\n#endif /* OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/index_testing.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_INDEX_TESTING_H_\n#define OPENCV_FLANN_INDEX_TESTING_H_\n\n#include <cstring>\n#include <cassert>\n#include <cmath>\n\n#include \"matrix.h\"\n#include \"nn_index.h\"\n#include \"result_set.h\"\n#include \"logger.h\"\n#include \"timer.h\"\n\n\nnamespace cvflann\n{\n\ninline int countCorrectMatches(int* neighbors, int* groundTruth, int n)\n{\n    int count = 0;\n    for (int i=0; i<n; ++i) {\n        for (int k=0; k<n; ++k) {\n            if (neighbors[i]==groundTruth[k]) {\n                count++;\n                break;\n            }\n        }\n    }\n    return count;\n}\n\n\ntemplate <typename Distance>\ntypename Distance::ResultType computeDistanceRaport(const Matrix<typename Distance::ElementType>& inputData, typename Distance::ElementType* target,\n                                                    int* neighbors, int* groundTruth, int veclen, int n, const Distance& distance)\n{\n    typedef typename Distance::ResultType DistanceType;\n\n    DistanceType ret = 0;\n    for (int i=0; i<n; ++i) {\n        DistanceType den = distance(inputData[groundTruth[i]], target, veclen);\n        DistanceType num = distance(inputData[neighbors[i]], target, veclen);\n\n        if ((den==0)&&(num==0)) {\n            ret += 1;\n        }\n        else {\n            ret += num/den;\n        }\n    }\n\n    return ret;\n}\n\ntemplate <typename Distance>\nfloat search_with_ground_truth(NNIndex<Distance>& index, const Matrix<typename Distance::ElementType>& inputData,\n                               const Matrix<typename Distance::ElementType>& testData, const Matrix<int>& matches, int nn, int checks,\n                               float& time, typename Distance::ResultType& dist, const Distance& distance, int skipMatches)\n{\n    typedef typename Distance::ResultType DistanceType;\n\n    if (matches.cols<size_t(nn)) {\n        Logger::info(\"matches.cols=%d, nn=%d\\n\",matches.cols,nn);\n\n        throw FLANNException(\"Ground truth is not computed for as many neighbors as requested\");\n    }\n\n    KNNResultSet<DistanceType> resultSet(nn+skipMatches);\n    SearchParams searchParams(checks);\n\n    std::vector<int> indices(nn+skipMatches);\n    std::vector<DistanceType> dists(nn+skipMatches);\n    int* neighbors = &indices[skipMatches];\n\n    int correct = 0;\n    DistanceType distR = 0;\n    StartStopTimer t;\n    int repeats = 0;\n    while (t.value<0.2) {\n        repeats++;\n        t.start();\n        correct = 0;\n        distR = 0;\n        for (size_t i = 0; i < testData.rows; i++) {\n            resultSet.init(&indices[0], &dists[0]);\n            index.findNeighbors(resultSet, testData[i], searchParams);\n\n            correct += countCorrectMatches(neighbors,matches[i], nn);\n            distR += computeDistanceRaport<Distance>(inputData, testData[i], neighbors, matches[i], (int)testData.cols, nn, distance);\n        }\n        t.stop();\n    }\n    time = float(t.value/repeats);\n\n    float precicion = (float)correct/(nn*testData.rows);\n\n    dist = distR/(testData.rows*nn);\n\n    Logger::info(\"%8d %10.4g %10.5g %10.5g %10.5g\\n\",\n                 checks, precicion, time, 1000.0 * time / testData.rows, dist);\n\n    return precicion;\n}\n\n\ntemplate <typename Distance>\nfloat test_index_checks(NNIndex<Distance>& index, const Matrix<typename Distance::ElementType>& inputData,\n                        const Matrix<typename Distance::ElementType>& testData, const Matrix<int>& matches,\n                        int checks, float& precision, const Distance& distance, int nn = 1, int skipMatches = 0)\n{\n    typedef typename Distance::ResultType DistanceType;\n\n    Logger::info(\"  Nodes  Precision(%)   Time(s)   Time/vec(ms)  Mean dist\\n\");\n    Logger::info(\"---------------------------------------------------------\\n\");\n\n    float time = 0;\n    DistanceType dist = 0;\n    precision = search_with_ground_truth(index, inputData, testData, matches, nn, checks, time, dist, distance, skipMatches);\n\n    return time;\n}\n\ntemplate <typename Distance>\nfloat test_index_precision(NNIndex<Distance>& index, const Matrix<typename Distance::ElementType>& inputData,\n                           const Matrix<typename Distance::ElementType>& testData, const Matrix<int>& matches,\n                           float precision, int& checks, const Distance& distance, int nn = 1, int skipMatches = 0)\n{\n    typedef typename Distance::ResultType DistanceType;\n    const float SEARCH_EPS = 0.001f;\n\n    Logger::info(\"  Nodes  Precision(%)   Time(s)   Time/vec(ms)  Mean dist\\n\");\n    Logger::info(\"---------------------------------------------------------\\n\");\n\n    int c2 = 1;\n    float p2;\n    int c1 = 1;\n    //float p1;\n    float time;\n    DistanceType dist;\n\n    p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches);\n\n    if (p2>precision) {\n        Logger::info(\"Got as close as I can\\n\");\n        checks = c2;\n        return time;\n    }\n\n    while (p2<precision) {\n        c1 = c2;\n        //p1 = p2;\n        c2 *=2;\n        p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches);\n    }\n\n    int cx;\n    float realPrecision;\n    if (fabs(p2-precision)>SEARCH_EPS) {\n        Logger::info(\"Start linear estimation\\n\");\n        // after we got to values in the vecinity of the desired precision\n        // use linear approximation get a better estimation\n\n        cx = (c1+c2)/2;\n        realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches);\n        while (fabs(realPrecision-precision)>SEARCH_EPS) {\n\n            if (realPrecision<precision) {\n                c1 = cx;\n            }\n            else {\n                c2 = cx;\n            }\n            cx = (c1+c2)/2;\n            if (cx==c1) {\n                Logger::info(\"Got as close as I can\\n\");\n                break;\n            }\n            realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches);\n        }\n\n        c2 = cx;\n        p2 = realPrecision;\n\n    }\n    else {\n        Logger::info(\"No need for linear estimation\\n\");\n        cx = c2;\n        realPrecision = p2;\n    }\n\n    checks = cx;\n    return time;\n}\n\n\ntemplate <typename Distance>\nvoid test_index_precisions(NNIndex<Distance>& index, const Matrix<typename Distance::ElementType>& inputData,\n                           const Matrix<typename Distance::ElementType>& testData, const Matrix<int>& matches,\n                           float* precisions, int precisions_length, const Distance& distance, int nn = 1, int skipMatches = 0, float maxTime = 0)\n{\n    typedef typename Distance::ResultType DistanceType;\n\n    const float SEARCH_EPS = 0.001;\n\n    // make sure precisions array is sorted\n    std::sort(precisions, precisions+precisions_length);\n\n    int pindex = 0;\n    float precision = precisions[pindex];\n\n    Logger::info(\"  Nodes  Precision(%)   Time(s)   Time/vec(ms)  Mean dist\\n\");\n    Logger::info(\"---------------------------------------------------------\\n\");\n\n    int c2 = 1;\n    float p2;\n\n    int c1 = 1;\n    float p1;\n\n    float time;\n    DistanceType dist;\n\n    p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches);\n\n    // if precision for 1 run down the tree is already\n    // better then some of the requested precisions, then\n    // skip those\n    while (precisions[pindex]<p2 && pindex<precisions_length) {\n        pindex++;\n    }\n\n    if (pindex==precisions_length) {\n        Logger::info(\"Got as close as I can\\n\");\n        return;\n    }\n\n    for (int i=pindex; i<precisions_length; ++i) {\n\n        precision = precisions[i];\n        while (p2<precision) {\n            c1 = c2;\n            p1 = p2;\n            c2 *=2;\n            p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches);\n            if ((maxTime> 0)&&(time > maxTime)&&(p2<precision)) return;\n        }\n\n        int cx;\n        float realPrecision;\n        if (fabs(p2-precision)>SEARCH_EPS) {\n            Logger::info(\"Start linear estimation\\n\");\n            // after we got to values in the vecinity of the desired precision\n            // use linear approximation get a better estimation\n\n            cx = (c1+c2)/2;\n            realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches);\n            while (fabs(realPrecision-precision)>SEARCH_EPS) {\n\n                if (realPrecision<precision) {\n                    c1 = cx;\n                }\n                else {\n                    c2 = cx;\n                }\n                cx = (c1+c2)/2;\n                if (cx==c1) {\n                    Logger::info(\"Got as close as I can\\n\");\n                    break;\n                }\n                realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches);\n            }\n\n            c2 = cx;\n            p2 = realPrecision;\n\n        }\n        else {\n            Logger::info(\"No need for linear estimation\\n\");\n            cx = c2;\n            realPrecision = p2;\n        }\n\n    }\n}\n\n}\n\n#endif //OPENCV_FLANN_INDEX_TESTING_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/kdtree_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_KDTREE_INDEX_H_\n#define OPENCV_FLANN_KDTREE_INDEX_H_\n\n#include <algorithm>\n#include <map>\n#include <cassert>\n#include <cstring>\n\n#include \"general.h\"\n#include \"nn_index.h\"\n#include \"dynamic_bitset.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n\n\nnamespace cvflann\n{\n\nstruct KDTreeIndexParams : public IndexParams\n{\n    KDTreeIndexParams(int trees = 4)\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_KDTREE;\n        (*this)[\"trees\"] = trees;\n    }\n};\n\n\n/**\n * Randomized kd-tree index\n *\n * Contains the k-d trees and other information for indexing a set of points\n * for nearest-neighbor matching.\n */\ntemplate <typename Distance>\nclass KDTreeIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n\n    /**\n     * KDTree constructor\n     *\n     * Params:\n     *          inputData = dataset with the input features\n     *          params = parameters passed to the kdtree algorithm\n     */\n    KDTreeIndex(const Matrix<ElementType>& inputData, const IndexParams& params = KDTreeIndexParams(),\n                Distance d = Distance() ) :\n        dataset_(inputData), index_params_(params), distance_(d)\n    {\n        size_ = dataset_.rows;\n        veclen_ = dataset_.cols;\n\n        trees_ = get_param(index_params_,\"trees\",4);\n        tree_roots_ = new NodePtr[trees_];\n\n        // Create a permutable array of indices to the input vectors.\n        vind_.resize(size_);\n        for (size_t i = 0; i < size_; ++i) {\n            vind_[i] = int(i);\n        }\n\n        mean_ = new DistanceType[veclen_];\n        var_ = new DistanceType[veclen_];\n    }\n\n\n    KDTreeIndex(const KDTreeIndex&);\n    KDTreeIndex& operator=(const KDTreeIndex&);\n\n    /**\n     * Standard destructor\n     */\n    ~KDTreeIndex()\n    {\n        if (tree_roots_!=NULL) {\n            delete[] tree_roots_;\n        }\n        delete[] mean_;\n        delete[] var_;\n    }\n\n    /**\n     * Dummy implementation for other algorithms of addable indexes after that.\n     */\n    void addIndex(const Matrix<ElementType>& /*wholeData*/, const Matrix<ElementType>& /*additionalData*/)\n    {\n    }\n\n    /**\n     * Builds the index\n     */\n    void buildIndex()\n    {\n        /* Construct the randomized trees. */\n        for (int i = 0; i < trees_; i++) {\n            /* Randomize the order of vectors to allow for unbiased sampling. */\n            std::random_shuffle(vind_.begin(), vind_.end());\n            tree_roots_[i] = divideTree(&vind_[0], int(size_) );\n        }\n    }\n\n\n    flann_algorithm_t getType() const\n    {\n        return FLANN_INDEX_KDTREE;\n    }\n\n\n    void saveIndex(FILE* stream)\n    {\n        save_value(stream, trees_);\n        for (int i=0; i<trees_; ++i) {\n            save_tree(stream, tree_roots_[i]);\n        }\n    }\n\n\n\n    void loadIndex(FILE* stream)\n    {\n        load_value(stream, trees_);\n        if (tree_roots_!=NULL) {\n            delete[] tree_roots_;\n        }\n        tree_roots_ = new NodePtr[trees_];\n        for (int i=0; i<trees_; ++i) {\n            load_tree(stream,tree_roots_[i]);\n        }\n\n        index_params_[\"algorithm\"] = getType();\n        index_params_[\"trees\"] = tree_roots_;\n    }\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const\n    {\n        return size_;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const\n    {\n        return veclen_;\n    }\n\n    /**\n     * Computes the inde memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const\n    {\n        return int(pool_.usedMemory+pool_.wastedMemory+dataset_.rows*sizeof(int));  // pool memory and vind array memory\n    }\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     maxCheck = the maximum number of restarts (in a best-bin-first manner)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams)\n    {\n        int maxChecks = get_param(searchParams,\"checks\", 32);\n        float epsError = 1+get_param(searchParams,\"eps\",0.0f);\n\n        if (maxChecks==FLANN_CHECKS_UNLIMITED) {\n            getExactNeighbors(result, vec, epsError);\n        }\n        else {\n            getNeighbors(result, vec, maxChecks, epsError);\n        }\n    }\n\n    IndexParams getParameters() const\n    {\n        return index_params_;\n    }\n\nprivate:\n\n\n    /*--------------------- Internal Data Structures --------------------------*/\n    struct Node\n    {\n        /**\n         * Dimension used for subdivision.\n         */\n        int divfeat;\n        /**\n         * The values used for subdivision.\n         */\n        DistanceType divval;\n        /**\n         * The child nodes.\n         */\n        Node* child1, * child2;\n    };\n    typedef Node* NodePtr;\n    typedef BranchStruct<NodePtr, DistanceType> BranchSt;\n    typedef BranchSt* Branch;\n\n\n\n    void save_tree(FILE* stream, NodePtr tree)\n    {\n        save_value(stream, *tree);\n        if (tree->child1!=NULL) {\n            save_tree(stream, tree->child1);\n        }\n        if (tree->child2!=NULL) {\n            save_tree(stream, tree->child2);\n        }\n    }\n\n\n    void load_tree(FILE* stream, NodePtr& tree)\n    {\n        tree = pool_.allocate<Node>();\n        load_value(stream, *tree);\n        if (tree->child1!=NULL) {\n            load_tree(stream, tree->child1);\n        }\n        if (tree->child2!=NULL) {\n            load_tree(stream, tree->child2);\n        }\n    }\n\n\n    /**\n     * Create a tree node that subdivides the list of vecs from vind[first]\n     * to vind[last].  The routine is called recursively on each sublist.\n     * Place a pointer to this new tree node in the location pTree.\n     *\n     * Params: pTree = the new node to create\n     *                  first = index of the first vector\n     *                  last = index of the last vector\n     */\n    NodePtr divideTree(int* ind, int count)\n    {\n        NodePtr node = pool_.allocate<Node>(); // allocate memory\n\n        /* If too few exemplars remain, then make this a leaf node. */\n        if ( count == 1) {\n            node->child1 = node->child2 = NULL;    /* Mark as leaf node. */\n            node->divfeat = *ind;    /* Store index of this vec. */\n        }\n        else {\n            int idx;\n            int cutfeat;\n            DistanceType cutval;\n            meanSplit(ind, count, idx, cutfeat, cutval);\n\n            node->divfeat = cutfeat;\n            node->divval = cutval;\n            node->child1 = divideTree(ind, idx);\n            node->child2 = divideTree(ind+idx, count-idx);\n        }\n\n        return node;\n    }\n\n\n    /**\n     * Choose which feature to use in order to subdivide this set of vectors.\n     * Make a random choice among those with the highest variance, and use\n     * its variance as the threshold value.\n     */\n    void meanSplit(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval)\n    {\n        memset(mean_,0,veclen_*sizeof(DistanceType));\n        memset(var_,0,veclen_*sizeof(DistanceType));\n\n        /* Compute mean values.  Only the first SAMPLE_MEAN values need to be\n            sampled to get a good estimate.\n         */\n        int cnt = std::min((int)SAMPLE_MEAN+1, count);\n        for (int j = 0; j < cnt; ++j) {\n            ElementType* v = dataset_[ind[j]];\n            for (size_t k=0; k<veclen_; ++k) {\n                mean_[k] += v[k];\n            }\n        }\n        for (size_t k=0; k<veclen_; ++k) {\n            mean_[k] /= cnt;\n        }\n\n        /* Compute variances (no need to divide by count). */\n        for (int j = 0; j < cnt; ++j) {\n            ElementType* v = dataset_[ind[j]];\n            for (size_t k=0; k<veclen_; ++k) {\n                DistanceType dist = v[k] - mean_[k];\n                var_[k] += dist * dist;\n            }\n        }\n        /* Select one of the highest variance indices at random. */\n        cutfeat = selectDivision(var_);\n        cutval = mean_[cutfeat];\n\n        int lim1, lim2;\n        planeSplit(ind, count, cutfeat, cutval, lim1, lim2);\n\n        if (lim1>count/2) index = lim1;\n        else if (lim2<count/2) index = lim2;\n        else index = count/2;\n\n        /* If either list is empty, it means that all remaining features\n         * are identical. Split in the middle to maintain a balanced tree.\n         */\n        if ((lim1==count)||(lim2==0)) index = count/2;\n    }\n\n\n    /**\n     * Select the top RAND_DIM largest values from v and return the index of\n     * one of these selected at random.\n     */\n    int selectDivision(DistanceType* v)\n    {\n        int num = 0;\n        size_t topind[RAND_DIM];\n\n        /* Create a list of the indices of the top RAND_DIM values. */\n        for (size_t i = 0; i < veclen_; ++i) {\n            if ((num < RAND_DIM)||(v[i] > v[topind[num-1]])) {\n                /* Put this element at end of topind. */\n                if (num < RAND_DIM) {\n                    topind[num++] = i;            /* Add to list. */\n                }\n                else {\n                    topind[num-1] = i;         /* Replace last element. */\n                }\n                /* Bubble end value down to right location by repeated swapping. */\n                int j = num - 1;\n                while (j > 0  &&  v[topind[j]] > v[topind[j-1]]) {\n                    std::swap(topind[j], topind[j-1]);\n                    --j;\n                }\n            }\n        }\n        /* Select a random integer in range [0,num-1], and return that index. */\n        int rnd = rand_int(num);\n        return (int)topind[rnd];\n    }\n\n\n    /**\n     *  Subdivide the list of points by a plane perpendicular on axe corresponding\n     *  to the 'cutfeat' dimension at 'cutval' position.\n     *\n     *  On return:\n     *  dataset[ind[0..lim1-1]][cutfeat]<cutval\n     *  dataset[ind[lim1..lim2-1]][cutfeat]==cutval\n     *  dataset[ind[lim2..count]][cutfeat]>cutval\n     */\n    void planeSplit(int* ind, int count, int cutfeat, DistanceType cutval, int& lim1, int& lim2)\n    {\n        /* Move vector indices for left subtree to front of list. */\n        int left = 0;\n        int right = count-1;\n        for (;; ) {\n            while (left<=right && dataset_[ind[left]][cutfeat]<cutval) ++left;\n            while (left<=right && dataset_[ind[right]][cutfeat]>=cutval) --right;\n            if (left>right) break;\n            std::swap(ind[left], ind[right]); ++left; --right;\n        }\n        lim1 = left;\n        right = count-1;\n        for (;; ) {\n            while (left<=right && dataset_[ind[left]][cutfeat]<=cutval) ++left;\n            while (left<=right && dataset_[ind[right]][cutfeat]>cutval) --right;\n            if (left>right) break;\n            std::swap(ind[left], ind[right]); ++left; --right;\n        }\n        lim2 = left;\n    }\n\n    /**\n     * Performs an exact nearest neighbor search. The exact search performs a full\n     * traversal of the tree.\n     */\n    void getExactNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, float epsError)\n    {\n        //\t\tcheckID -= 1;  /* Set a different unique ID for each search. */\n\n        if (trees_ > 1) {\n            fprintf(stderr,\"It doesn't make any sense to use more than one tree for exact search\");\n        }\n        if (trees_>0) {\n            searchLevelExact(result, vec, tree_roots_[0], 0.0, epsError);\n        }\n        assert(result.full());\n    }\n\n    /**\n     * Performs the approximate nearest-neighbor search. The search is approximate\n     * because the tree traversal is abandoned after a given number of descends in\n     * the tree.\n     */\n    void getNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, int maxCheck, float epsError)\n    {\n        int i;\n        BranchSt branch;\n\n        int checkCount = 0;\n        Heap<BranchSt>* heap = new Heap<BranchSt>((int)size_);\n        DynamicBitset checked(size_);\n\n        /* Search once through each tree down to root. */\n        for (i = 0; i < trees_; ++i) {\n            searchLevel(result, vec, tree_roots_[i], 0, checkCount, maxCheck, epsError, heap, checked);\n        }\n\n        /* Keep searching other branches from heap until finished. */\n        while ( heap->popMin(branch) && (checkCount < maxCheck || !result.full() )) {\n            searchLevel(result, vec, branch.node, branch.mindist, checkCount, maxCheck, epsError, heap, checked);\n        }\n\n        delete heap;\n\n        assert(result.full());\n    }\n\n\n    /**\n     *  Search starting from a given node of the tree.  Based on any mismatches at\n     *  higher levels, all exemplars below this level must have a distance of\n     *  at least \"mindistsq\".\n     */\n    void searchLevel(ResultSet<DistanceType>& result_set, const ElementType* vec, NodePtr node, DistanceType mindist, int& checkCount, int maxCheck,\n                     float epsError, Heap<BranchSt>* heap, DynamicBitset& checked)\n    {\n        if (result_set.worstDist()<mindist) {\n            //\t\t\tprintf(\"Ignoring branch, too far\\n\");\n            return;\n        }\n\n        /* If this is a leaf node, then do check and return. */\n        if ((node->child1 == NULL)&&(node->child2 == NULL)) {\n            /*  Do not check same node more than once when searching multiple trees.\n                Once a vector is checked, we set its location in vind to the\n                current checkID.\n             */\n            int index = node->divfeat;\n            if ( checked.test(index) || ((checkCount>=maxCheck)&& result_set.full()) ) return;\n            checked.set(index);\n            checkCount++;\n\n            DistanceType dist = distance_(dataset_[index], vec, veclen_);\n            result_set.addPoint(dist,index);\n\n            return;\n        }\n\n        /* Which child branch should be taken first? */\n        ElementType val = vec[node->divfeat];\n        DistanceType diff = val - node->divval;\n        NodePtr bestChild = (diff < 0) ? node->child1 : node->child2;\n        NodePtr otherChild = (diff < 0) ? node->child2 : node->child1;\n\n        /* Create a branch record for the branch not taken.  Add distance\n            of this feature boundary (we don't attempt to correct for any\n            use of this feature in a parent node, which is unlikely to\n            happen and would have only a small effect).  Don't bother\n            adding more branches to heap after halfway point, as cost of\n            adding exceeds their value.\n         */\n\n        DistanceType new_distsq = mindist + distance_.accum_dist(val, node->divval, node->divfeat);\n        //\t\tif (2 * checkCount < maxCheck  ||  !result.full()) {\n        if ((new_distsq*epsError < result_set.worstDist())||  !result_set.full()) {\n            heap->insert( BranchSt(otherChild, new_distsq) );\n        }\n\n        /* Call recursively to search next level down. */\n        searchLevel(result_set, vec, bestChild, mindist, checkCount, maxCheck, epsError, heap, checked);\n    }\n\n    /**\n     * Performs an exact search in the tree starting from a node.\n     */\n    void searchLevelExact(ResultSet<DistanceType>& result_set, const ElementType* vec, const NodePtr node, DistanceType mindist, const float epsError)\n    {\n        /* If this is a leaf node, then do check and return. */\n        if ((node->child1 == NULL)&&(node->child2 == NULL)) {\n            int index = node->divfeat;\n            DistanceType dist = distance_(dataset_[index], vec, veclen_);\n            result_set.addPoint(dist,index);\n            return;\n        }\n\n        /* Which child branch should be taken first? */\n        ElementType val = vec[node->divfeat];\n        DistanceType diff = val - node->divval;\n        NodePtr bestChild = (diff < 0) ? node->child1 : node->child2;\n        NodePtr otherChild = (diff < 0) ? node->child2 : node->child1;\n\n        /* Create a branch record for the branch not taken.  Add distance\n            of this feature boundary (we don't attempt to correct for any\n            use of this feature in a parent node, which is unlikely to\n            happen and would have only a small effect).  Don't bother\n            adding more branches to heap after halfway point, as cost of\n            adding exceeds their value.\n         */\n\n        DistanceType new_distsq = mindist + distance_.accum_dist(val, node->divval, node->divfeat);\n\n        /* Call recursively to search next level down. */\n        searchLevelExact(result_set, vec, bestChild, mindist, epsError);\n\n        if (new_distsq*epsError<=result_set.worstDist()) {\n            searchLevelExact(result_set, vec, otherChild, new_distsq, epsError);\n        }\n    }\n\n\nprivate:\n\n    enum\n    {\n        /**\n         * To improve efficiency, only SAMPLE_MEAN random values are used to\n         * compute the mean and variance at each level when building a tree.\n         * A value of 100 seems to perform as well as using all values.\n         */\n        SAMPLE_MEAN = 100,\n        /**\n         * Top random dimensions to consider\n         *\n         * When creating random trees, the dimension on which to subdivide is\n         * selected at random from among the top RAND_DIM dimensions with the\n         * highest variance.  A value of 5 works well.\n         */\n        RAND_DIM=5\n    };\n\n\n    /**\n     * Number of randomized trees that are used\n     */\n    int trees_;\n\n    /**\n     *  Array of indices to vectors in the dataset.\n     */\n    std::vector<int> vind_;\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset_;\n\n    IndexParams index_params_;\n\n    size_t size_;\n    size_t veclen_;\n\n\n    DistanceType* mean_;\n    DistanceType* var_;\n\n\n    /**\n     * Array of k-d trees used to find neighbours.\n     */\n    NodePtr* tree_roots_;\n\n    /**\n     * Pooled memory allocator.\n     *\n     * Using a pooled memory allocator is more efficient\n     * than allocating memory directly when there is a large\n     * number small of memory allocations.\n     */\n    PooledAllocator pool_;\n\n    Distance distance_;\n\n\n};   // class KDTreeForest\n\n}\n\n#endif //OPENCV_FLANN_KDTREE_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/kdtree_single_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_\n#define OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_\n\n#include <algorithm>\n#include <map>\n#include <cassert>\n#include <cstring>\n\n#include \"general.h\"\n#include \"nn_index.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n\nnamespace cvflann\n{\n\nstruct KDTreeSingleIndexParams : public IndexParams\n{\n    KDTreeSingleIndexParams(int leaf_max_size = 10, bool reorder = true, int dim = -1)\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_KDTREE_SINGLE;\n        (*this)[\"leaf_max_size\"] = leaf_max_size;\n        (*this)[\"reorder\"] = reorder;\n        (*this)[\"dim\"] = dim;\n    }\n};\n\n\n/**\n * Randomized kd-tree index\n *\n * Contains the k-d trees and other information for indexing a set of points\n * for nearest-neighbor matching.\n */\ntemplate <typename Distance>\nclass KDTreeSingleIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n\n    /**\n     * KDTree constructor\n     *\n     * Params:\n     *          inputData = dataset with the input features\n     *          params = parameters passed to the kdtree algorithm\n     */\n    KDTreeSingleIndex(const Matrix<ElementType>& inputData, const IndexParams& params = KDTreeSingleIndexParams(),\n                      Distance d = Distance() ) :\n        dataset_(inputData), index_params_(params), distance_(d)\n    {\n        size_ = dataset_.rows;\n        dim_ = dataset_.cols;\n        int dim_param = get_param(params,\"dim\",-1);\n        if (dim_param>0) dim_ = dim_param;\n        leaf_max_size_ = get_param(params,\"leaf_max_size\",10);\n        reorder_ = get_param(params,\"reorder\",true);\n\n        // Create a permutable array of indices to the input vectors.\n        vind_.resize(size_);\n        for (size_t i = 0; i < size_; i++) {\n            vind_[i] = (int)i;\n        }\n    }\n\n    KDTreeSingleIndex(const KDTreeSingleIndex&);\n    KDTreeSingleIndex& operator=(const KDTreeSingleIndex&);\n\n    /**\n     * Standard destructor\n     */\n    ~KDTreeSingleIndex()\n    {\n        if (reorder_) delete[] data_.data;\n    }\n\n    /**\n     * Dummy implementation for other algorithms of addable indexes after that.\n     */\n    void addIndex(const Matrix<ElementType>& /*wholeData*/, const Matrix<ElementType>& /*additionalData*/)\n    {\n    }\n\n    /**\n     * Builds the index\n     */\n    void buildIndex()\n    {\n        computeBoundingBox(root_bbox_);\n        root_node_ = divideTree(0, (int)size_, root_bbox_ );   // construct the tree\n\n        if (reorder_) {\n            delete[] data_.data;\n            data_ = cvflann::Matrix<ElementType>(new ElementType[size_*dim_], size_, dim_);\n            for (size_t i=0; i<size_; ++i) {\n                for (size_t j=0; j<dim_; ++j) {\n                    data_[i][j] = dataset_[vind_[i]][j];\n                }\n            }\n        }\n        else {\n            data_ = dataset_;\n        }\n    }\n\n    flann_algorithm_t getType() const\n    {\n        return FLANN_INDEX_KDTREE_SINGLE;\n    }\n\n\n    void saveIndex(FILE* stream)\n    {\n        save_value(stream, size_);\n        save_value(stream, dim_);\n        save_value(stream, root_bbox_);\n        save_value(stream, reorder_);\n        save_value(stream, leaf_max_size_);\n        save_value(stream, vind_);\n        if (reorder_) {\n            save_value(stream, data_);\n        }\n        save_tree(stream, root_node_);\n    }\n\n\n    void loadIndex(FILE* stream)\n    {\n        load_value(stream, size_);\n        load_value(stream, dim_);\n        load_value(stream, root_bbox_);\n        load_value(stream, reorder_);\n        load_value(stream, leaf_max_size_);\n        load_value(stream, vind_);\n        if (reorder_) {\n            load_value(stream, data_);\n        }\n        else {\n            data_ = dataset_;\n        }\n        load_tree(stream, root_node_);\n\n\n        index_params_[\"algorithm\"] = getType();\n        index_params_[\"leaf_max_size\"] = leaf_max_size_;\n        index_params_[\"reorder\"] = reorder_;\n    }\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const\n    {\n        return size_;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const\n    {\n        return dim_;\n    }\n\n    /**\n     * Computes the inde memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const\n    {\n        return (int)(pool_.usedMemory+pool_.wastedMemory+dataset_.rows*sizeof(int));  // pool memory and vind array memory\n    }\n\n\n    /**\n     * \\brief Perform k-nearest neighbor search\n     * \\param[in] queries The query points for which to find the nearest neighbors\n     * \\param[out] indices The indices of the nearest neighbors found\n     * \\param[out] dists Distances to the nearest neighbors found\n     * \\param[in] knn Number of nearest neighbors to return\n     * \\param[in] params Search parameters\n     */\n    void knnSearch(const Matrix<ElementType>& queries, Matrix<int>& indices, Matrix<DistanceType>& dists, int knn, const SearchParams& params)\n    {\n        assert(queries.cols == veclen());\n        assert(indices.rows >= queries.rows);\n        assert(dists.rows >= queries.rows);\n        assert(int(indices.cols) >= knn);\n        assert(int(dists.cols) >= knn);\n\n        KNNSimpleResultSet<DistanceType> resultSet(knn);\n        for (size_t i = 0; i < queries.rows; i++) {\n            resultSet.init(indices[i], dists[i]);\n            findNeighbors(resultSet, queries[i], params);\n        }\n    }\n\n    IndexParams getParameters() const\n    {\n        return index_params_;\n    }\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     maxCheck = the maximum number of restarts (in a best-bin-first manner)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams)\n    {\n        float epsError = 1+get_param(searchParams,\"eps\",0.0f);\n\n        std::vector<DistanceType> dists(dim_,0);\n        DistanceType distsq = computeInitialDistances(vec, dists);\n        searchLevel(result, vec, root_node_, distsq, dists, epsError);\n    }\n\nprivate:\n\n\n    /*--------------------- Internal Data Structures --------------------------*/\n    struct Node\n    {\n        /**\n         * Indices of points in leaf node\n         */\n        int left, right;\n        /**\n         * Dimension used for subdivision.\n         */\n        int divfeat;\n        /**\n         * The values used for subdivision.\n         */\n        DistanceType divlow, divhigh;\n        /**\n         * The child nodes.\n         */\n        Node* child1, * child2;\n    };\n    typedef Node* NodePtr;\n\n\n    struct Interval\n    {\n        DistanceType low, high;\n    };\n\n    typedef std::vector<Interval> BoundingBox;\n\n    typedef BranchStruct<NodePtr, DistanceType> BranchSt;\n    typedef BranchSt* Branch;\n\n\n\n\n    void save_tree(FILE* stream, NodePtr tree)\n    {\n        save_value(stream, *tree);\n        if (tree->child1!=NULL) {\n            save_tree(stream, tree->child1);\n        }\n        if (tree->child2!=NULL) {\n            save_tree(stream, tree->child2);\n        }\n    }\n\n\n    void load_tree(FILE* stream, NodePtr& tree)\n    {\n        tree = pool_.allocate<Node>();\n        load_value(stream, *tree);\n        if (tree->child1!=NULL) {\n            load_tree(stream, tree->child1);\n        }\n        if (tree->child2!=NULL) {\n            load_tree(stream, tree->child2);\n        }\n    }\n\n\n    void computeBoundingBox(BoundingBox& bbox)\n    {\n        bbox.resize(dim_);\n        for (size_t i=0; i<dim_; ++i) {\n            bbox[i].low = (DistanceType)dataset_[0][i];\n            bbox[i].high = (DistanceType)dataset_[0][i];\n        }\n        for (size_t k=1; k<dataset_.rows; ++k) {\n            for (size_t i=0; i<dim_; ++i) {\n                if (dataset_[k][i]<bbox[i].low) bbox[i].low = (DistanceType)dataset_[k][i];\n                if (dataset_[k][i]>bbox[i].high) bbox[i].high = (DistanceType)dataset_[k][i];\n            }\n        }\n    }\n\n\n    /**\n     * Create a tree node that subdivides the list of vecs from vind[first]\n     * to vind[last].  The routine is called recursively on each sublist.\n     * Place a pointer to this new tree node in the location pTree.\n     *\n     * Params: pTree = the new node to create\n     *                  first = index of the first vector\n     *                  last = index of the last vector\n     */\n    NodePtr divideTree(int left, int right, BoundingBox& bbox)\n    {\n        NodePtr node = pool_.allocate<Node>(); // allocate memory\n\n        /* If too few exemplars remain, then make this a leaf node. */\n        if ( (right-left) <= leaf_max_size_) {\n            node->child1 = node->child2 = NULL;    /* Mark as leaf node. */\n            node->left = left;\n            node->right = right;\n\n            // compute bounding-box of leaf points\n            for (size_t i=0; i<dim_; ++i) {\n                bbox[i].low = (DistanceType)dataset_[vind_[left]][i];\n                bbox[i].high = (DistanceType)dataset_[vind_[left]][i];\n            }\n            for (int k=left+1; k<right; ++k) {\n                for (size_t i=0; i<dim_; ++i) {\n                    if (bbox[i].low>dataset_[vind_[k]][i]) bbox[i].low=(DistanceType)dataset_[vind_[k]][i];\n                    if (bbox[i].high<dataset_[vind_[k]][i]) bbox[i].high=(DistanceType)dataset_[vind_[k]][i];\n                }\n            }\n        }\n        else {\n            int idx;\n            int cutfeat;\n            DistanceType cutval;\n            middleSplit_(&vind_[0]+left, right-left, idx, cutfeat, cutval, bbox);\n\n            node->divfeat = cutfeat;\n\n            BoundingBox left_bbox(bbox);\n            left_bbox[cutfeat].high = cutval;\n            node->child1 = divideTree(left, left+idx, left_bbox);\n\n            BoundingBox right_bbox(bbox);\n            right_bbox[cutfeat].low = cutval;\n            node->child2 = divideTree(left+idx, right, right_bbox);\n\n            node->divlow = left_bbox[cutfeat].high;\n            node->divhigh = right_bbox[cutfeat].low;\n\n            for (size_t i=0; i<dim_; ++i) {\n                bbox[i].low = std::min(left_bbox[i].low, right_bbox[i].low);\n                bbox[i].high = std::max(left_bbox[i].high, right_bbox[i].high);\n            }\n        }\n\n        return node;\n    }\n\n    void computeMinMax(int* ind, int count, int dim, ElementType& min_elem, ElementType& max_elem)\n    {\n        min_elem = dataset_[ind[0]][dim];\n        max_elem = dataset_[ind[0]][dim];\n        for (int i=1; i<count; ++i) {\n            ElementType val = dataset_[ind[i]][dim];\n            if (val<min_elem) min_elem = val;\n            if (val>max_elem) max_elem = val;\n        }\n    }\n\n    void middleSplit(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval, const BoundingBox& bbox)\n    {\n        // find the largest span from the approximate bounding box\n        ElementType max_span = bbox[0].high-bbox[0].low;\n        cutfeat = 0;\n        cutval = (bbox[0].high+bbox[0].low)/2;\n        for (size_t i=1; i<dim_; ++i) {\n            ElementType span = bbox[i].high-bbox[i].low;\n            if (span>max_span) {\n                max_span = span;\n                cutfeat = i;\n                cutval = (bbox[i].high+bbox[i].low)/2;\n            }\n        }\n\n        // compute exact span on the found dimension\n        ElementType min_elem, max_elem;\n        computeMinMax(ind, count, cutfeat, min_elem, max_elem);\n        cutval = (min_elem+max_elem)/2;\n        max_span = max_elem - min_elem;\n\n        // check if a dimension of a largest span exists\n        size_t k = cutfeat;\n        for (size_t i=0; i<dim_; ++i) {\n            if (i==k) continue;\n            ElementType span = bbox[i].high-bbox[i].low;\n            if (span>max_span) {\n                computeMinMax(ind, count, i, min_elem, max_elem);\n                span = max_elem - min_elem;\n                if (span>max_span) {\n                    max_span = span;\n                    cutfeat = i;\n                    cutval = (min_elem+max_elem)/2;\n                }\n            }\n        }\n        int lim1, lim2;\n        planeSplit(ind, count, cutfeat, cutval, lim1, lim2);\n\n        if (lim1>count/2) index = lim1;\n        else if (lim2<count/2) index = lim2;\n        else index = count/2;\n    }\n\n\n    void middleSplit_(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval, const BoundingBox& bbox)\n    {\n        const float EPS=0.00001f;\n        DistanceType max_span = bbox[0].high-bbox[0].low;\n        for (size_t i=1; i<dim_; ++i) {\n            DistanceType span = bbox[i].high-bbox[i].low;\n            if (span>max_span) {\n                max_span = span;\n            }\n        }\n        DistanceType max_spread = -1;\n        cutfeat = 0;\n        for (size_t i=0; i<dim_; ++i) {\n            DistanceType span = bbox[i].high-bbox[i].low;\n            if (span>(DistanceType)((1-EPS)*max_span)) {\n                ElementType min_elem, max_elem;\n                computeMinMax(ind, count, cutfeat, min_elem, max_elem);\n                DistanceType spread = (DistanceType)(max_elem-min_elem);\n                if (spread>max_spread) {\n                    cutfeat = (int)i;\n                    max_spread = spread;\n                }\n            }\n        }\n        // split in the middle\n        DistanceType split_val = (bbox[cutfeat].low+bbox[cutfeat].high)/2;\n        ElementType min_elem, max_elem;\n        computeMinMax(ind, count, cutfeat, min_elem, max_elem);\n\n        if (split_val<min_elem) cutval = (DistanceType)min_elem;\n        else if (split_val>max_elem) cutval = (DistanceType)max_elem;\n        else cutval = split_val;\n\n        int lim1, lim2;\n        planeSplit(ind, count, cutfeat, cutval, lim1, lim2);\n\n        if (lim1>count/2) index = lim1;\n        else if (lim2<count/2) index = lim2;\n        else index = count/2;\n    }\n\n\n    /**\n     *  Subdivide the list of points by a plane perpendicular on axe corresponding\n     *  to the 'cutfeat' dimension at 'cutval' position.\n     *\n     *  On return:\n     *  dataset[ind[0..lim1-1]][cutfeat]<cutval\n     *  dataset[ind[lim1..lim2-1]][cutfeat]==cutval\n     *  dataset[ind[lim2..count]][cutfeat]>cutval\n     */\n    void planeSplit(int* ind, int count, int cutfeat, DistanceType cutval, int& lim1, int& lim2)\n    {\n        /* Move vector indices for left subtree to front of list. */\n        int left = 0;\n        int right = count-1;\n        for (;; ) {\n            while (left<=right && dataset_[ind[left]][cutfeat]<cutval) ++left;\n            while (left<=right && dataset_[ind[right]][cutfeat]>=cutval) --right;\n            if (left>right) break;\n            std::swap(ind[left], ind[right]); ++left; --right;\n        }\n        /* If either list is empty, it means that all remaining features\n         * are identical. Split in the middle to maintain a balanced tree.\n         */\n        lim1 = left;\n        right = count-1;\n        for (;; ) {\n            while (left<=right && dataset_[ind[left]][cutfeat]<=cutval) ++left;\n            while (left<=right && dataset_[ind[right]][cutfeat]>cutval) --right;\n            if (left>right) break;\n            std::swap(ind[left], ind[right]); ++left; --right;\n        }\n        lim2 = left;\n    }\n\n    DistanceType computeInitialDistances(const ElementType* vec, std::vector<DistanceType>& dists)\n    {\n        DistanceType distsq = 0.0;\n\n        for (size_t i = 0; i < dim_; ++i) {\n            if (vec[i] < root_bbox_[i].low) {\n                dists[i] = distance_.accum_dist(vec[i], root_bbox_[i].low, (int)i);\n                distsq += dists[i];\n            }\n            if (vec[i] > root_bbox_[i].high) {\n                dists[i] = distance_.accum_dist(vec[i], root_bbox_[i].high, (int)i);\n                distsq += dists[i];\n            }\n        }\n\n        return distsq;\n    }\n\n    /**\n     * Performs an exact search in the tree starting from a node.\n     */\n    void searchLevel(ResultSet<DistanceType>& result_set, const ElementType* vec, const NodePtr node, DistanceType mindistsq,\n                     std::vector<DistanceType>& dists, const float epsError)\n    {\n        /* If this is a leaf node, then do check and return. */\n        if ((node->child1 == NULL)&&(node->child2 == NULL)) {\n            DistanceType worst_dist = result_set.worstDist();\n            for (int i=node->left; i<node->right; ++i) {\n                int index = reorder_ ? i : vind_[i];\n                DistanceType dist = distance_(vec, data_[index], dim_, worst_dist);\n                if (dist<worst_dist) {\n                    result_set.addPoint(dist,vind_[i]);\n                }\n            }\n            return;\n        }\n\n        /* Which child branch should be taken first? */\n        int idx = node->divfeat;\n        ElementType val = vec[idx];\n        DistanceType diff1 = val - node->divlow;\n        DistanceType diff2 = val - node->divhigh;\n\n        NodePtr bestChild;\n        NodePtr otherChild;\n        DistanceType cut_dist;\n        if ((diff1+diff2)<0) {\n            bestChild = node->child1;\n            otherChild = node->child2;\n            cut_dist = distance_.accum_dist(val, node->divhigh, idx);\n        }\n        else {\n            bestChild = node->child2;\n            otherChild = node->child1;\n            cut_dist = distance_.accum_dist( val, node->divlow, idx);\n        }\n\n        /* Call recursively to search next level down. */\n        searchLevel(result_set, vec, bestChild, mindistsq, dists, epsError);\n\n        DistanceType dst = dists[idx];\n        mindistsq = mindistsq + cut_dist - dst;\n        dists[idx] = cut_dist;\n        if (mindistsq*epsError<=result_set.worstDist()) {\n            searchLevel(result_set, vec, otherChild, mindistsq, dists, epsError);\n        }\n        dists[idx] = dst;\n    }\n\nprivate:\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset_;\n\n    IndexParams index_params_;\n\n    int leaf_max_size_;\n    bool reorder_;\n\n\n    /**\n     *  Array of indices to vectors in the dataset.\n     */\n    std::vector<int> vind_;\n\n    Matrix<ElementType> data_;\n\n    size_t size_;\n    size_t dim_;\n\n    /**\n     * Array of k-d trees used to find neighbours.\n     */\n    NodePtr root_node_;\n\n    BoundingBox root_bbox_;\n\n    /**\n     * Pooled memory allocator.\n     *\n     * Using a pooled memory allocator is more efficient\n     * than allocating memory directly when there is a large\n     * number small of memory allocations.\n     */\n    PooledAllocator pool_;\n\n    Distance distance_;\n};   // class KDTree\n\n}\n\n#endif //OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/kmeans_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_KMEANS_INDEX_H_\n#define OPENCV_FLANN_KMEANS_INDEX_H_\n\n#include <algorithm>\n#include <string>\n#include <map>\n#include <cassert>\n#include <limits>\n#include <cmath>\n\n#include \"general.h\"\n#include \"nn_index.h\"\n#include \"dist.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n#include \"logger.h\"\n\n\nnamespace cvflann\n{\n\nstruct KMeansIndexParams : public IndexParams\n{\n    KMeansIndexParams(int branching = 32, int iterations = 11,\n                      flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 )\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_KMEANS;\n        // branching factor\n        (*this)[\"branching\"] = branching;\n        // max iterations to perform in one kmeans clustering (kmeans tree)\n        (*this)[\"iterations\"] = iterations;\n        // algorithm used for picking the initial cluster centers for kmeans tree\n        (*this)[\"centers_init\"] = centers_init;\n        // cluster boundary index. Used when searching the kmeans tree\n        (*this)[\"cb_index\"] = cb_index;\n    }\n};\n\n\n/**\n * Hierarchical kmeans index\n *\n * Contains a tree constructed through a hierarchical kmeans clustering\n * and other information for indexing a set of points for nearest-neighbour matching.\n */\ntemplate <typename Distance>\nclass KMeansIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n\n\n    typedef void (KMeansIndex::* centersAlgFunction)(int, int*, int, int*, int&);\n\n    /**\n     * The function used for choosing the cluster centers.\n     */\n    centersAlgFunction chooseCenters;\n\n\n\n    /**\n     * Chooses the initial centers in the k-means clustering in a random manner.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     *     indices_length = length of indices vector\n     *\n     */\n    void chooseCentersRandom(int k, int* indices, int indices_length, int* centers, int& centers_length)\n    {\n        UniqueRandom r(indices_length);\n\n        int index;\n        for (index=0; index<k; ++index) {\n            bool duplicate = true;\n            int rnd;\n            while (duplicate) {\n                duplicate = false;\n                rnd = r.next();\n                if (rnd<0) {\n                    centers_length = index;\n                    return;\n                }\n\n                centers[index] = indices[rnd];\n\n                for (int j=0; j<index; ++j) {\n                    DistanceType sq = distance_(dataset_[centers[index]], dataset_[centers[j]], dataset_.cols);\n                    if (sq<1e-16) {\n                        duplicate = true;\n                    }\n                }\n            }\n        }\n\n        centers_length = index;\n    }\n\n\n    /**\n     * Chooses the initial centers in the k-means using Gonzales' algorithm\n     * so that the centers are spaced apart from each other.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     * Returns:\n     */\n    void chooseCentersGonzales(int k, int* indices, int indices_length, int* centers, int& centers_length)\n    {\n        int n = indices_length;\n\n        int rnd = rand_int(n);\n        assert(rnd >=0 && rnd < n);\n\n        centers[0] = indices[rnd];\n\n        int index;\n        for (index=1; index<k; ++index) {\n\n            int best_index = -1;\n            DistanceType best_val = 0;\n            for (int j=0; j<n; ++j) {\n                DistanceType dist = distance_(dataset_[centers[0]],dataset_[indices[j]],dataset_.cols);\n                for (int i=1; i<index; ++i) {\n                    DistanceType tmp_dist = distance_(dataset_[centers[i]],dataset_[indices[j]],dataset_.cols);\n                    if (tmp_dist<dist) {\n                        dist = tmp_dist;\n                    }\n                }\n                if (dist>best_val) {\n                    best_val = dist;\n                    best_index = j;\n                }\n            }\n            if (best_index!=-1) {\n                centers[index] = indices[best_index];\n            }\n            else {\n                break;\n            }\n        }\n        centers_length = index;\n    }\n\n\n    /**\n     * Chooses the initial centers in the k-means using the algorithm\n     * proposed in the KMeans++ paper:\n     * Arthur, David; Vassilvitskii, Sergei - k-means++: The Advantages of Careful Seeding\n     *\n     * Implementation of this function was converted from the one provided in Arthur's code.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     * Returns:\n     */\n    void chooseCentersKMeanspp(int k, int* indices, int indices_length, int* centers, int& centers_length)\n    {\n        int n = indices_length;\n\n        double currentPot = 0;\n        DistanceType* closestDistSq = new DistanceType[n];\n\n        // Choose one random center and set the closestDistSq values\n        int index = rand_int(n);\n        assert(index >=0 && index < n);\n        centers[0] = indices[index];\n\n        for (int i = 0; i < n; i++) {\n            closestDistSq[i] = distance_(dataset_[indices[i]], dataset_[indices[index]], dataset_.cols);\n            closestDistSq[i] = ensureSquareDistance<Distance>( closestDistSq[i] );\n            currentPot += closestDistSq[i];\n        }\n\n\n        const int numLocalTries = 1;\n\n        // Choose each center\n        int centerCount;\n        for (centerCount = 1; centerCount < k; centerCount++) {\n\n            // Repeat several trials\n            double bestNewPot = -1;\n            int bestNewIndex = -1;\n            for (int localTrial = 0; localTrial < numLocalTries; localTrial++) {\n\n                // Choose our center - have to be slightly careful to return a valid answer even accounting\n                // for possible rounding errors\n                double randVal = rand_double(currentPot);\n                for (index = 0; index < n-1; index++) {\n                    if (randVal <= closestDistSq[index]) break;\n                    else randVal -= closestDistSq[index];\n                }\n\n                // Compute the new potential\n                double newPot = 0;\n                for (int i = 0; i < n; i++) {\n                    DistanceType dist = distance_(dataset_[indices[i]], dataset_[indices[index]], dataset_.cols);\n                    newPot += std::min( ensureSquareDistance<Distance>(dist), closestDistSq[i] );\n                }\n\n                // Store the best result\n                if ((bestNewPot < 0)||(newPot < bestNewPot)) {\n                    bestNewPot = newPot;\n                    bestNewIndex = index;\n                }\n            }\n\n            // Add the appropriate center\n            centers[centerCount] = indices[bestNewIndex];\n            currentPot = bestNewPot;\n            for (int i = 0; i < n; i++) {\n                DistanceType dist = distance_(dataset_[indices[i]], dataset_[indices[bestNewIndex]], dataset_.cols);\n                closestDistSq[i] = std::min( ensureSquareDistance<Distance>(dist), closestDistSq[i] );\n            }\n        }\n\n        centers_length = centerCount;\n\n        delete[] closestDistSq;\n    }\n\n\n\npublic:\n\n    flann_algorithm_t getType() const\n    {\n        return FLANN_INDEX_KMEANS;\n    }\n\n    /**\n     * Index constructor\n     *\n     * Params:\n     *          inputData = dataset with the input features\n     *          params = parameters passed to the hierarchical k-means algorithm\n     */\n    KMeansIndex(const Matrix<ElementType>& inputData, const IndexParams& params = KMeansIndexParams(),\n                Distance d = Distance())\n        : dataset_(inputData), index_params_(params), root_(NULL), indices_(NULL), distance_(d)\n    {\n        memoryCounter_ = 0;\n\n        size_ = dataset_.rows;\n        veclen_ = dataset_.cols;\n\n        branching_ = get_param(params,\"branching\",32);\n        iterations_ = get_param(params,\"iterations\",11);\n        if (iterations_<0) {\n            iterations_ = (std::numeric_limits<int>::max)();\n        }\n        centers_init_  = get_param(params,\"centers_init\",FLANN_CENTERS_RANDOM);\n\n        if (centers_init_==FLANN_CENTERS_RANDOM) {\n            chooseCenters = &KMeansIndex::chooseCentersRandom;\n        }\n        else if (centers_init_==FLANN_CENTERS_GONZALES) {\n            chooseCenters = &KMeansIndex::chooseCentersGonzales;\n        }\n        else if (centers_init_==FLANN_CENTERS_KMEANSPP) {\n            chooseCenters = &KMeansIndex::chooseCentersKMeanspp;\n        }\n        else {\n            throw FLANNException(\"Unknown algorithm for choosing initial centers.\");\n        }\n        cb_index_ = 0.4f;\n\n    }\n\n\n    KMeansIndex(const KMeansIndex&);\n    KMeansIndex& operator=(const KMeansIndex&);\n\n\n    /**\n     * Index destructor.\n     *\n     * Release the memory used by the index.\n     */\n    virtual ~KMeansIndex()\n    {\n        if (root_ != NULL) {\n            free_centers(root_);\n        }\n        if (indices_!=NULL) {\n            delete[] indices_;\n        }\n    }\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const\n    {\n        return size_;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const\n    {\n        return veclen_;\n    }\n\n\n    void set_cb_index( float index)\n    {\n        cb_index_ = index;\n    }\n\n    /**\n     * Computes the inde memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const\n    {\n        return pool_.usedMemory+pool_.wastedMemory+memoryCounter_;\n    }\n\n    /**\n     * Dummy implementation for other algorithms of addable indexes after that.\n     */\n    void addIndex(const Matrix<ElementType>& /*wholeData*/, const Matrix<ElementType>& /*additionalData*/)\n    {\n    }\n\n    /**\n     * Builds the index\n     */\n    void buildIndex()\n    {\n        if (branching_<2) {\n            throw FLANNException(\"Branching factor must be at least 2\");\n        }\n\n        indices_ = new int[size_];\n        for (size_t i=0; i<size_; ++i) {\n            indices_[i] = int(i);\n        }\n\n        root_ = pool_.allocate<KMeansNode>();\n        computeNodeStatistics(root_, indices_, (int)size_);\n        computeClustering(root_, indices_, (int)size_, branching_,0);\n    }\n\n\n    void saveIndex(FILE* stream)\n    {\n        save_value(stream, branching_);\n        save_value(stream, iterations_);\n        save_value(stream, memoryCounter_);\n        save_value(stream, cb_index_);\n        save_value(stream, *indices_, (int)size_);\n\n        save_tree(stream, root_);\n    }\n\n\n    void loadIndex(FILE* stream)\n    {\n        load_value(stream, branching_);\n        load_value(stream, iterations_);\n        load_value(stream, memoryCounter_);\n        load_value(stream, cb_index_);\n        if (indices_!=NULL) {\n            delete[] indices_;\n        }\n        indices_ = new int[size_];\n        load_value(stream, *indices_, size_);\n\n        if (root_!=NULL) {\n            free_centers(root_);\n        }\n        load_tree(stream, root_);\n\n        index_params_[\"algorithm\"] = getType();\n        index_params_[\"branching\"] = branching_;\n        index_params_[\"iterations\"] = iterations_;\n        index_params_[\"centers_init\"] = centers_init_;\n        index_params_[\"cb_index\"] = cb_index_;\n\n    }\n\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     searchParams = parameters that influence the search algorithm (checks, cb_index)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams)\n    {\n\n        int maxChecks = get_param(searchParams,\"checks\",32);\n\n        if (maxChecks==FLANN_CHECKS_UNLIMITED) {\n            findExactNN(root_, result, vec);\n        }\n        else {\n            // Priority queue storing intermediate branches in the best-bin-first search\n            Heap<BranchSt>* heap = new Heap<BranchSt>((int)size_);\n\n            int checks = 0;\n            findNN(root_, result, vec, checks, maxChecks, heap);\n\n            BranchSt branch;\n            while (heap->popMin(branch) && (checks<maxChecks || !result.full())) {\n                KMeansNodePtr node = branch.node;\n                findNN(node, result, vec, checks, maxChecks, heap);\n            }\n            assert(result.full());\n\n            delete heap;\n        }\n\n    }\n\n    /**\n     * Clustering function that takes a cut in the hierarchical k-means\n     * tree and return the clusters centers of that clustering.\n     * Params:\n     *     numClusters = number of clusters to have in the clustering computed\n     * Returns: number of cluster centers\n     */\n    int getClusterCenters(Matrix<DistanceType>& centers)\n    {\n        int numClusters = centers.rows;\n        if (numClusters<1) {\n            throw FLANNException(\"Number of clusters must be at least 1\");\n        }\n\n        DistanceType variance;\n        KMeansNodePtr* clusters = new KMeansNodePtr[numClusters];\n\n        int clusterCount = getMinVarianceClusters(root_, clusters, numClusters, variance);\n\n        Logger::info(\"Clusters requested: %d, returning %d\\n\",numClusters, clusterCount);\n\n        for (int i=0; i<clusterCount; ++i) {\n            DistanceType* center = clusters[i]->pivot;\n            for (size_t j=0; j<veclen_; ++j) {\n                centers[i][j] = center[j];\n            }\n        }\n        delete[] clusters;\n\n        return clusterCount;\n    }\n\n    IndexParams getParameters() const\n    {\n        return index_params_;\n    }\n\n\nprivate:\n    /**\n     * Struture representing a node in the hierarchical k-means tree.\n     */\n    struct KMeansNode\n    {\n        /**\n         * The cluster center.\n         */\n        DistanceType* pivot;\n        /**\n         * The cluster radius.\n         */\n        DistanceType radius;\n        /**\n         * The cluster mean radius.\n         */\n        DistanceType mean_radius;\n        /**\n         * The cluster variance.\n         */\n        DistanceType variance;\n        /**\n         * The cluster size (number of points in the cluster)\n         */\n        int size;\n        /**\n         * Child nodes (only for non-terminal nodes)\n         */\n        KMeansNode** childs;\n        /**\n         * Node points (only for terminal nodes)\n         */\n        int* indices;\n        /**\n         * Level\n         */\n        int level;\n    };\n    typedef KMeansNode* KMeansNodePtr;\n\n    /**\n     * Alias definition for a nicer syntax.\n     */\n    typedef BranchStruct<KMeansNodePtr, DistanceType> BranchSt;\n\n\n\n\n    void save_tree(FILE* stream, KMeansNodePtr node)\n    {\n        save_value(stream, *node);\n        save_value(stream, *(node->pivot), (int)veclen_);\n        if (node->childs==NULL) {\n            int indices_offset = (int)(node->indices - indices_);\n            save_value(stream, indices_offset);\n        }\n        else {\n            for(int i=0; i<branching_; ++i) {\n                save_tree(stream, node->childs[i]);\n            }\n        }\n    }\n\n\n    void load_tree(FILE* stream, KMeansNodePtr& node)\n    {\n        node = pool_.allocate<KMeansNode>();\n        load_value(stream, *node);\n        node->pivot = new DistanceType[veclen_];\n        load_value(stream, *(node->pivot), (int)veclen_);\n        if (node->childs==NULL) {\n            int indices_offset;\n            load_value(stream, indices_offset);\n            node->indices = indices_ + indices_offset;\n        }\n        else {\n            node->childs = pool_.allocate<KMeansNodePtr>(branching_);\n            for(int i=0; i<branching_; ++i) {\n                load_tree(stream, node->childs[i]);\n            }\n        }\n    }\n\n\n    /**\n     * Helper function\n     */\n    void free_centers(KMeansNodePtr node)\n    {\n        delete[] node->pivot;\n        if (node->childs!=NULL) {\n            for (int k=0; k<branching_; ++k) {\n                free_centers(node->childs[k]);\n            }\n        }\n    }\n\n    /**\n     * Computes the statistics of a node (mean, radius, variance).\n     *\n     * Params:\n     *     node = the node to use\n     *     indices = the indices of the points belonging to the node\n     */\n    void computeNodeStatistics(KMeansNodePtr node, int* indices, int indices_length)\n    {\n\n        DistanceType radius = 0;\n        DistanceType variance = 0;\n        DistanceType* mean = new DistanceType[veclen_];\n        memoryCounter_ += int(veclen_*sizeof(DistanceType));\n\n        memset(mean,0,veclen_*sizeof(DistanceType));\n\n        for (size_t i=0; i<size_; ++i) {\n            ElementType* vec = dataset_[indices[i]];\n            for (size_t j=0; j<veclen_; ++j) {\n                mean[j] += vec[j];\n            }\n            variance += distance_(vec, ZeroIterator<ElementType>(), veclen_);\n        }\n        for (size_t j=0; j<veclen_; ++j) {\n            mean[j] /= size_;\n        }\n        variance /= size_;\n        variance -= distance_(mean, ZeroIterator<ElementType>(), veclen_);\n\n        DistanceType tmp = 0;\n        for (int i=0; i<indices_length; ++i) {\n            tmp = distance_(mean, dataset_[indices[i]], veclen_);\n            if (tmp>radius) {\n                radius = tmp;\n            }\n        }\n\n        node->variance = variance;\n        node->radius = radius;\n        node->pivot = mean;\n    }\n\n\n    /**\n     * The method responsible with actually doing the recursive hierarchical\n     * clustering\n     *\n     * Params:\n     *     node = the node to cluster\n     *     indices = indices of the points belonging to the current node\n     *     branching = the branching factor to use in the clustering\n     *\n     * TODO: for 1-sized clusters don't store a cluster center (it's the same as the single cluster point)\n     */\n    void computeClustering(KMeansNodePtr node, int* indices, int indices_length, int branching, int level)\n    {\n        node->size = indices_length;\n        node->level = level;\n\n        if (indices_length < branching) {\n            node->indices = indices;\n            std::sort(node->indices,node->indices+indices_length);\n            node->childs = NULL;\n            return;\n        }\n\n        int* centers_idx = new int[branching];\n        int centers_length;\n        (this->*chooseCenters)(branching, indices, indices_length, centers_idx, centers_length);\n\n        if (centers_length<branching) {\n            node->indices = indices;\n            std::sort(node->indices,node->indices+indices_length);\n            node->childs = NULL;\n            delete [] centers_idx;\n            return;\n        }\n\n\n        Matrix<double> dcenters(new double[branching*veclen_],branching,veclen_);\n        for (int i=0; i<centers_length; ++i) {\n            ElementType* vec = dataset_[centers_idx[i]];\n            for (size_t k=0; k<veclen_; ++k) {\n                dcenters[i][k] = double(vec[k]);\n            }\n        }\n        delete[] centers_idx;\n\n        std::vector<DistanceType> radiuses(branching);\n        int* count = new int[branching];\n        for (int i=0; i<branching; ++i) {\n            radiuses[i] = 0;\n            count[i] = 0;\n        }\n\n        //\tassign points to clusters\n        int* belongs_to = new int[indices_length];\n        for (int i=0; i<indices_length; ++i) {\n\n            DistanceType sq_dist = distance_(dataset_[indices[i]], dcenters[0], veclen_);\n            belongs_to[i] = 0;\n            for (int j=1; j<branching; ++j) {\n                DistanceType new_sq_dist = distance_(dataset_[indices[i]], dcenters[j], veclen_);\n                if (sq_dist>new_sq_dist) {\n                    belongs_to[i] = j;\n                    sq_dist = new_sq_dist;\n                }\n            }\n            if (sq_dist>radiuses[belongs_to[i]]) {\n                radiuses[belongs_to[i]] = sq_dist;\n            }\n            count[belongs_to[i]]++;\n        }\n\n        bool converged = false;\n        int iteration = 0;\n        while (!converged && iteration<iterations_) {\n            converged = true;\n            iteration++;\n\n            // compute the new cluster centers\n            for (int i=0; i<branching; ++i) {\n                memset(dcenters[i],0,sizeof(double)*veclen_);\n                radiuses[i] = 0;\n            }\n            for (int i=0; i<indices_length; ++i) {\n                ElementType* vec = dataset_[indices[i]];\n                double* center = dcenters[belongs_to[i]];\n                for (size_t k=0; k<veclen_; ++k) {\n                    center[k] += vec[k];\n                }\n            }\n            for (int i=0; i<branching; ++i) {\n                int cnt = count[i];\n                for (size_t k=0; k<veclen_; ++k) {\n                    dcenters[i][k] /= cnt;\n                }\n            }\n\n            // reassign points to clusters\n            for (int i=0; i<indices_length; ++i) {\n                DistanceType sq_dist = distance_(dataset_[indices[i]], dcenters[0], veclen_);\n                int new_centroid = 0;\n                for (int j=1; j<branching; ++j) {\n                    DistanceType new_sq_dist = distance_(dataset_[indices[i]], dcenters[j], veclen_);\n                    if (sq_dist>new_sq_dist) {\n                        new_centroid = j;\n                        sq_dist = new_sq_dist;\n                    }\n                }\n                if (sq_dist>radiuses[new_centroid]) {\n                    radiuses[new_centroid] = sq_dist;\n                }\n                if (new_centroid != belongs_to[i]) {\n                    count[belongs_to[i]]--;\n                    count[new_centroid]++;\n                    belongs_to[i] = new_centroid;\n\n                    converged = false;\n                }\n            }\n\n            for (int i=0; i<branching; ++i) {\n                // if one cluster converges to an empty cluster,\n                // move an element into that cluster\n                if (count[i]==0) {\n                    int j = (i+1)%branching;\n                    while (count[j]<=1) {\n                        j = (j+1)%branching;\n                    }\n\n                    for (int k=0; k<indices_length; ++k) {\n                        if (belongs_to[k]==j) {\n                            // for cluster j, we move the furthest element from the center to the empty cluster i\n                            if ( distance_(dataset_[indices[k]], dcenters[j], veclen_) == radiuses[j] ) {\n                                belongs_to[k] = i;\n                                count[j]--;\n                                count[i]++;\n                                break;\n                            }\n                        }\n                    }\n                    converged = false;\n                }\n            }\n\n        }\n\n        DistanceType** centers = new DistanceType*[branching];\n\n        for (int i=0; i<branching; ++i) {\n            centers[i] = new DistanceType[veclen_];\n            memoryCounter_ += (int)(veclen_*sizeof(DistanceType));\n            for (size_t k=0; k<veclen_; ++k) {\n                centers[i][k] = (DistanceType)dcenters[i][k];\n            }\n        }\n\n\n        // compute kmeans clustering for each of the resulting clusters\n        node->childs = pool_.allocate<KMeansNodePtr>(branching);\n        int start = 0;\n        int end = start;\n        for (int c=0; c<branching; ++c) {\n            int s = count[c];\n\n            DistanceType variance = 0;\n            DistanceType mean_radius =0;\n            for (int i=0; i<indices_length; ++i) {\n                if (belongs_to[i]==c) {\n                    DistanceType d = distance_(dataset_[indices[i]], ZeroIterator<ElementType>(), veclen_);\n                    variance += d;\n                    mean_radius += sqrt(d);\n                    std::swap(indices[i],indices[end]);\n                    std::swap(belongs_to[i],belongs_to[end]);\n                    end++;\n                }\n            }\n            variance /= s;\n            mean_radius /= s;\n            variance -= distance_(centers[c], ZeroIterator<ElementType>(), veclen_);\n\n            node->childs[c] = pool_.allocate<KMeansNode>();\n            node->childs[c]->radius = radiuses[c];\n            node->childs[c]->pivot = centers[c];\n            node->childs[c]->variance = variance;\n            node->childs[c]->mean_radius = mean_radius;\n            node->childs[c]->indices = NULL;\n            computeClustering(node->childs[c],indices+start, end-start, branching, level+1);\n            start=end;\n        }\n\n        delete[] dcenters.data;\n        delete[] centers;\n        delete[] count;\n        delete[] belongs_to;\n    }\n\n\n\n    /**\n     * Performs one descent in the hierarchical k-means tree. The branches not\n     * visited are stored in a priority queue.\n     *\n     * Params:\n     *      node = node to explore\n     *      result = container for the k-nearest neighbors found\n     *      vec = query points\n     *      checks = how many points in the dataset have been checked so far\n     *      maxChecks = maximum dataset points to checks\n     */\n\n\n    void findNN(KMeansNodePtr node, ResultSet<DistanceType>& result, const ElementType* vec, int& checks, int maxChecks,\n                Heap<BranchSt>* heap)\n    {\n        // Ignore those clusters that are too far away\n        {\n            DistanceType bsq = distance_(vec, node->pivot, veclen_);\n            DistanceType rsq = node->radius;\n            DistanceType wsq = result.worstDist();\n\n            DistanceType val = bsq-rsq-wsq;\n            DistanceType val2 = val*val-4*rsq*wsq;\n\n            //if (val>0) {\n            if ((val>0)&&(val2>0)) {\n                return;\n            }\n        }\n\n        if (node->childs==NULL) {\n            if (checks>=maxChecks) {\n                if (result.full()) return;\n            }\n            checks += node->size;\n            for (int i=0; i<node->size; ++i) {\n                int index = node->indices[i];\n                DistanceType dist = distance_(dataset_[index], vec, veclen_);\n                result.addPoint(dist, index);\n            }\n        }\n        else {\n            DistanceType* domain_distances = new DistanceType[branching_];\n            int closest_center = exploreNodeBranches(node, vec, domain_distances, heap);\n            delete[] domain_distances;\n            findNN(node->childs[closest_center],result,vec, checks, maxChecks, heap);\n        }\n    }\n\n    /**\n     * Helper function that computes the nearest childs of a node to a given query point.\n     * Params:\n     *     node = the node\n     *     q = the query point\n     *     distances = array with the distances to each child node.\n     * Returns:\n     */\n    int exploreNodeBranches(KMeansNodePtr node, const ElementType* q, DistanceType* domain_distances, Heap<BranchSt>* heap)\n    {\n\n        int best_index = 0;\n        domain_distances[best_index] = distance_(q, node->childs[best_index]->pivot, veclen_);\n        for (int i=1; i<branching_; ++i) {\n            domain_distances[i] = distance_(q, node->childs[i]->pivot, veclen_);\n            if (domain_distances[i]<domain_distances[best_index]) {\n                best_index = i;\n            }\n        }\n\n        //\t\tfloat* best_center = node->childs[best_index]->pivot;\n        for (int i=0; i<branching_; ++i) {\n            if (i != best_index) {\n                domain_distances[i] -= cb_index_*node->childs[i]->variance;\n\n                //\t\t\t\tfloat dist_to_border = getDistanceToBorder(node.childs[i].pivot,best_center,q);\n                //\t\t\t\tif (domain_distances[i]<dist_to_border) {\n                //\t\t\t\t\tdomain_distances[i] = dist_to_border;\n                //\t\t\t\t}\n                heap->insert(BranchSt(node->childs[i],domain_distances[i]));\n            }\n        }\n\n        return best_index;\n    }\n\n\n    /**\n     * Function the performs exact nearest neighbor search by traversing the entire tree.\n     */\n    void findExactNN(KMeansNodePtr node, ResultSet<DistanceType>& result, const ElementType* vec)\n    {\n        // Ignore those clusters that are too far away\n        {\n            DistanceType bsq = distance_(vec, node->pivot, veclen_);\n            DistanceType rsq = node->radius;\n            DistanceType wsq = result.worstDist();\n\n            DistanceType val = bsq-rsq-wsq;\n            DistanceType val2 = val*val-4*rsq*wsq;\n\n            //                  if (val>0) {\n            if ((val>0)&&(val2>0)) {\n                return;\n            }\n        }\n\n\n        if (node->childs==NULL) {\n            for (int i=0; i<node->size; ++i) {\n                int index = node->indices[i];\n                DistanceType dist = distance_(dataset_[index], vec, veclen_);\n                result.addPoint(dist, index);\n            }\n        }\n        else {\n            int* sort_indices = new int[branching_];\n\n            getCenterOrdering(node, vec, sort_indices);\n\n            for (int i=0; i<branching_; ++i) {\n                findExactNN(node->childs[sort_indices[i]],result,vec);\n            }\n\n            delete[] sort_indices;\n        }\n    }\n\n\n    /**\n     * Helper function.\n     *\n     * I computes the order in which to traverse the child nodes of a particular node.\n     */\n    void getCenterOrdering(KMeansNodePtr node, const ElementType* q, int* sort_indices)\n    {\n        DistanceType* domain_distances = new DistanceType[branching_];\n        for (int i=0; i<branching_; ++i) {\n            DistanceType dist = distance_(q, node->childs[i]->pivot, veclen_);\n\n            int j=0;\n            while (domain_distances[j]<dist && j<i) j++;\n            for (int k=i; k>j; --k) {\n                domain_distances[k] = domain_distances[k-1];\n                sort_indices[k] = sort_indices[k-1];\n            }\n            domain_distances[j] = dist;\n            sort_indices[j] = i;\n        }\n        delete[] domain_distances;\n    }\n\n    /**\n     * Method that computes the squared distance from the query point q\n     * from inside region with center c to the border between this\n     * region and the region with center p\n     */\n    DistanceType getDistanceToBorder(DistanceType* p, DistanceType* c, DistanceType* q)\n    {\n        DistanceType sum = 0;\n        DistanceType sum2 = 0;\n\n        for (int i=0; i<veclen_; ++i) {\n            DistanceType t = c[i]-p[i];\n            sum += t*(q[i]-(c[i]+p[i])/2);\n            sum2 += t*t;\n        }\n\n        return sum*sum/sum2;\n    }\n\n\n    /**\n     * Helper function the descends in the hierarchical k-means tree by spliting those clusters that minimize\n     * the overall variance of the clustering.\n     * Params:\n     *     root = root node\n     *     clusters = array with clusters centers (return value)\n     *     varianceValue = variance of the clustering (return value)\n     * Returns:\n     */\n    int getMinVarianceClusters(KMeansNodePtr root, KMeansNodePtr* clusters, int clusters_length, DistanceType& varianceValue)\n    {\n        int clusterCount = 1;\n        clusters[0] = root;\n\n        DistanceType meanVariance = root->variance*root->size;\n\n        while (clusterCount<clusters_length) {\n            DistanceType minVariance = (std::numeric_limits<DistanceType>::max)();\n            int splitIndex = -1;\n\n            for (int i=0; i<clusterCount; ++i) {\n                if (clusters[i]->childs != NULL) {\n\n                    DistanceType variance = meanVariance - clusters[i]->variance*clusters[i]->size;\n\n                    for (int j=0; j<branching_; ++j) {\n                        variance += clusters[i]->childs[j]->variance*clusters[i]->childs[j]->size;\n                    }\n                    if (variance<minVariance) {\n                        minVariance = variance;\n                        splitIndex = i;\n                    }\n                }\n            }\n\n            if (splitIndex==-1) break;\n            if ( (branching_+clusterCount-1) > clusters_length) break;\n\n            meanVariance = minVariance;\n\n            // split node\n            KMeansNodePtr toSplit = clusters[splitIndex];\n            clusters[splitIndex] = toSplit->childs[0];\n            for (int i=1; i<branching_; ++i) {\n                clusters[clusterCount++] = toSplit->childs[i];\n            }\n        }\n\n        varianceValue = meanVariance/root->size;\n        return clusterCount;\n    }\n\nprivate:\n    /** The branching factor used in the hierarchical k-means clustering */\n    int branching_;\n\n    /** Maximum number of iterations to use when performing k-means clustering */\n    int iterations_;\n\n    /** Algorithm for choosing the cluster centers */\n    flann_centers_init_t centers_init_;\n\n    /**\n     * Cluster border index. This is used in the tree search phase when determining\n     * the closest cluster to explore next. A zero value takes into account only\n     * the cluster centres, a value greater then zero also take into account the size\n     * of the cluster.\n     */\n    float cb_index_;\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset_;\n\n    /** Index parameters */\n    IndexParams index_params_;\n\n    /**\n     * Number of features in the dataset.\n     */\n    size_t size_;\n\n    /**\n     * Length of each feature.\n     */\n    size_t veclen_;\n\n    /**\n     * The root node in the tree.\n     */\n    KMeansNodePtr root_;\n\n    /**\n     *  Array of indices to vectors in the dataset.\n     */\n    int* indices_;\n\n    /**\n     * The distance\n     */\n    Distance distance_;\n\n    /**\n     * Pooled memory allocator.\n     */\n    PooledAllocator pool_;\n\n    /**\n     * Memory occupied by the index.\n     */\n    int memoryCounter_;\n};\n\n}\n\n#endif //OPENCV_FLANN_KMEANS_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/linear_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_LINEAR_INDEX_H_\n#define OPENCV_FLANN_LINEAR_INDEX_H_\n\n#include \"general.h\"\n#include \"nn_index.h\"\n\nnamespace cvflann\n{\n\nstruct LinearIndexParams : public IndexParams\n{\n    LinearIndexParams()\n    {\n        (* this)[\"algorithm\"] = FLANN_INDEX_LINEAR;\n    }\n};\n\ntemplate <typename Distance>\nclass LinearIndex : public NNIndex<Distance>\n{\npublic:\n\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n\n    LinearIndex(const Matrix<ElementType>& inputData, const IndexParams& params = LinearIndexParams(),\n                Distance d = Distance()) :\n        dataset_(inputData), index_params_(params), distance_(d)\n    {\n    }\n\n    LinearIndex(const LinearIndex&);\n    LinearIndex& operator=(const LinearIndex&);\n\n    flann_algorithm_t getType() const\n    {\n        return FLANN_INDEX_LINEAR;\n    }\n\n\n    size_t size() const\n    {\n        return dataset_.rows;\n    }\n\n    size_t veclen() const\n    {\n        return dataset_.cols;\n    }\n\n\n    int usedMemory() const\n    {\n        return 0;\n    }\n\n    /**\n     * Dummy implementation for other algorithms of addable indexes after that.\n     */\n    void addIndex(const Matrix<ElementType>& /*wholeData*/, const Matrix<ElementType>& /*additionalData*/)\n    {\n    }\n\n    void buildIndex()\n    {\n        /* nothing to do here for linear search */\n    }\n\n    void saveIndex(FILE*)\n    {\n        /* nothing to do here for linear search */\n    }\n\n\n    void loadIndex(FILE*)\n    {\n        /* nothing to do here for linear search */\n\n        index_params_[\"algorithm\"] = getType();\n    }\n\n    void findNeighbors(ResultSet<DistanceType>& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/)\n    {\n        ElementType* data = dataset_.data;\n        for (size_t i = 0; i < dataset_.rows; ++i, data += dataset_.cols) {\n            DistanceType dist = distance_(data, vec, dataset_.cols);\n            resultSet.addPoint(dist, (int)i);\n        }\n    }\n\n    IndexParams getParameters() const\n    {\n        return index_params_;\n    }\n\nprivate:\n    /** The dataset */\n    const Matrix<ElementType> dataset_;\n    /** Index parameters */\n    IndexParams index_params_;\n    /** Index distance */\n    Distance distance_;\n\n};\n\n}\n\n#endif // OPENCV_FLANN_LINEAR_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/logger.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_LOGGER_H\n#define OPENCV_FLANN_LOGGER_H\n\n#include <stdio.h>\n#include <stdarg.h>\n\n#include \"defines.h\"\n\n\nnamespace cvflann\n{\n\nclass Logger\n{\n    Logger() : stream(stdout), logLevel(FLANN_LOG_WARN) {}\n\n    ~Logger()\n    {\n        if ((stream!=NULL)&&(stream!=stdout)) {\n            fclose(stream);\n        }\n    }\n\n    static Logger& instance()\n    {\n        static Logger logger;\n        return logger;\n    }\n\n    void _setDestination(const char* name)\n    {\n        if (name==NULL) {\n            stream = stdout;\n        }\n        else {\n            stream = fopen(name,\"w\");\n            if (stream == NULL) {\n                stream = stdout;\n            }\n        }\n    }\n\n    int _log(int level, const char* fmt, va_list arglist)\n    {\n        if (level > logLevel ) return -1;\n        int ret = vfprintf(stream, fmt, arglist);\n        return ret;\n    }\n\npublic:\n    /**\n     * Sets the logging level. All messages with lower priority will be ignored.\n     * @param level Logging level\n     */\n    static void setLevel(int level) { instance().logLevel = level; }\n\n    /**\n     * Sets the logging destination\n     * @param name Filename or NULL for console\n     */\n    static void setDestination(const char* name) { instance()._setDestination(name); }\n\n    /**\n     * Print log message\n     * @param level Log level\n     * @param fmt Message format\n     * @return\n     */\n    static int log(int level, const char* fmt, ...)\n    {\n        va_list arglist;\n        va_start(arglist, fmt);\n        int ret = instance()._log(level,fmt,arglist);\n        va_end(arglist);\n        return ret;\n    }\n\n#define LOG_METHOD(NAME,LEVEL) \\\n    static int NAME(const char* fmt, ...) \\\n    { \\\n        va_list ap; \\\n        va_start(ap, fmt); \\\n        int ret = instance()._log(LEVEL, fmt, ap); \\\n        va_end(ap); \\\n        return ret; \\\n    }\n\n    LOG_METHOD(fatal, FLANN_LOG_FATAL)\n    LOG_METHOD(error, FLANN_LOG_ERROR)\n    LOG_METHOD(warn, FLANN_LOG_WARN)\n    LOG_METHOD(info, FLANN_LOG_INFO)\n\nprivate:\n    FILE* stream;\n    int logLevel;\n};\n\n}\n\n#endif //OPENCV_FLANN_LOGGER_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/lsh_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n/***********************************************************************\n * Author: Vincent Rabaud\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_LSH_INDEX_H_\n#define OPENCV_FLANN_LSH_INDEX_H_\n\n#include <algorithm>\n#include <cassert>\n#include <cstring>\n#include <map>\n#include <vector>\n\n#include \"general.h\"\n#include \"nn_index.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"lsh_table.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n\nnamespace cvflann\n{\n\nstruct LshIndexParams : public IndexParams\n{\n    LshIndexParams(unsigned int table_number = 12, unsigned int key_size = 20, unsigned int multi_probe_level = 2)\n    {\n        (* this)[\"algorithm\"] = FLANN_INDEX_LSH;\n        // The number of hash tables to use\n        (*this)[\"table_number\"] = table_number;\n        // The length of the key in the hash tables\n        (*this)[\"key_size\"] = key_size;\n        // Number of levels to use in multi-probe (0 for standard LSH)\n        (*this)[\"multi_probe_level\"] = multi_probe_level;\n    }\n};\n\n/**\n * Randomized kd-tree index\n *\n * Contains the k-d trees and other information for indexing a set of points\n * for nearest-neighbor matching.\n */\ntemplate<typename Distance>\nclass LshIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n    /** Constructor\n     * @param input_data dataset with the input features\n     * @param params parameters passed to the LSH algorithm\n     * @param d the distance used\n     */\n    LshIndex(const Matrix<ElementType>& input_data, const IndexParams& params = LshIndexParams(),\n             Distance d = Distance()) :\n        dataset_(input_data), index_params_(params), distance_(d)\n    {\n        // cv::flann::IndexParams sets integer params as 'int', so it is used with get_param\n        // in place of 'unsigned int'\n        table_number_ = (unsigned int)get_param<int>(index_params_,\"table_number\",12);\n        key_size_ = (unsigned int)get_param<int>(index_params_,\"key_size\",20);\n        multi_probe_level_ = (unsigned int)get_param<int>(index_params_,\"multi_probe_level\",2);\n\n        feature_size_ = (unsigned)dataset_.cols;\n        fill_xor_mask(0, key_size_, multi_probe_level_, xor_masks_);\n    }\n\n\n    LshIndex(const LshIndex&);\n    LshIndex& operator=(const LshIndex&);\n\n    /**\n    * Implementation for the LSH addable indexes after that.\n    * @param wholeData whole dataset with the input features\n    * @param additionalData additional dataset with the input features\n    */\n    void addIndex(const Matrix<ElementType>& wholeData, const Matrix<ElementType>& additionalData)\n    {\n        tables_.resize(table_number_);\n        for (unsigned int i = 0; i < table_number_; ++i) {\n            lsh::LshTable<ElementType>& table = tables_[i];\n            // Add the features to the table with indexed offset\n            table.add((int)(wholeData.rows - additionalData.rows), additionalData);\n        }\n        dataset_ = wholeData;\n    }\n\n    /**\n     * Builds the index\n     */\n    void buildIndex()\n    {\n        std::vector<size_t> indices(feature_size_ * CHAR_BIT);\n\n        tables_.resize(table_number_);\n        for (unsigned int i = 0; i < table_number_; ++i) {\n\n            //re-initialize the random indices table that the LshTable will use to pick its sub-dimensions\n            if( (indices.size() == feature_size_ * CHAR_BIT) || (indices.size() < key_size_) )\n            {\n              indices.resize( feature_size_ * CHAR_BIT );\n              for (size_t j = 0; j < feature_size_ * CHAR_BIT; ++j)\n                  indices[j] = j;\n              std::random_shuffle(indices.begin(), indices.end());\n            }\n\n            lsh::LshTable<ElementType>& table = tables_[i];\n            table = lsh::LshTable<ElementType>(feature_size_, key_size_, indices);\n\n            // Add the features to the table with offset 0\n            table.add(0, dataset_);\n        }\n    }\n\n    flann_algorithm_t getType() const\n    {\n        return FLANN_INDEX_LSH;\n    }\n\n\n    void saveIndex(FILE* stream)\n    {\n        save_value(stream,table_number_);\n        save_value(stream,key_size_);\n        save_value(stream,multi_probe_level_);\n        save_value(stream, dataset_);\n    }\n\n    void loadIndex(FILE* stream)\n    {\n        load_value(stream, table_number_);\n        load_value(stream, key_size_);\n        load_value(stream, multi_probe_level_);\n        load_value(stream, dataset_);\n        // Building the index is so fast we can afford not storing it\n        buildIndex();\n\n        index_params_[\"algorithm\"] = getType();\n        index_params_[\"table_number\"] = table_number_;\n        index_params_[\"key_size\"] = key_size_;\n        index_params_[\"multi_probe_level\"] = multi_probe_level_;\n    }\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const\n    {\n        return dataset_.rows;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const\n    {\n        return feature_size_;\n    }\n\n    /**\n     * Computes the index memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const\n    {\n        return (int)(dataset_.rows * sizeof(int));\n    }\n\n\n    IndexParams getParameters() const\n    {\n        return index_params_;\n    }\n\n    /**\n     * \\brief Perform k-nearest neighbor search\n     * \\param[in] queries The query points for which to find the nearest neighbors\n     * \\param[out] indices The indices of the nearest neighbors found\n     * \\param[out] dists Distances to the nearest neighbors found\n     * \\param[in] knn Number of nearest neighbors to return\n     * \\param[in] params Search parameters\n     */\n    virtual void knnSearch(const Matrix<ElementType>& queries, Matrix<int>& indices, Matrix<DistanceType>& dists, int knn, const SearchParams& params)\n    {\n        assert(queries.cols == veclen());\n        assert(indices.rows >= queries.rows);\n        assert(dists.rows >= queries.rows);\n        assert(int(indices.cols) >= knn);\n        assert(int(dists.cols) >= knn);\n\n\n        KNNUniqueResultSet<DistanceType> resultSet(knn);\n        for (size_t i = 0; i < queries.rows; i++) {\n            resultSet.clear();\n            std::fill_n(indices[i], knn, -1);\n            std::fill_n(dists[i], knn, std::numeric_limits<DistanceType>::max());\n            findNeighbors(resultSet, queries[i], params);\n            if (get_param(params,\"sorted\",true)) resultSet.sortAndCopy(indices[i], dists[i], knn);\n            else resultSet.copy(indices[i], dists[i], knn);\n        }\n    }\n\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     maxCheck = the maximum number of restarts (in a best-bin-first manner)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& /*searchParams*/)\n    {\n        getNeighbors(vec, result);\n    }\n\nprivate:\n    /** Defines the comparator on score and index\n     */\n    typedef std::pair<float, unsigned int> ScoreIndexPair;\n    struct SortScoreIndexPairOnSecond\n    {\n        bool operator()(const ScoreIndexPair& left, const ScoreIndexPair& right) const\n        {\n            return left.second < right.second;\n        }\n    };\n\n    /** Fills the different xor masks to use when getting the neighbors in multi-probe LSH\n     * @param key the key we build neighbors from\n     * @param lowest_index the lowest index of the bit set\n     * @param level the multi-probe level we are at\n     * @param xor_masks all the xor mask\n     */\n    void fill_xor_mask(lsh::BucketKey key, int lowest_index, unsigned int level,\n                       std::vector<lsh::BucketKey>& xor_masks)\n    {\n        xor_masks.push_back(key);\n        if (level == 0) return;\n        for (int index = lowest_index - 1; index >= 0; --index) {\n            // Create a new key\n            lsh::BucketKey new_key = key | (1 << index);\n            fill_xor_mask(new_key, index, level - 1, xor_masks);\n        }\n    }\n\n    /** Performs the approximate nearest-neighbor search.\n     * @param vec the feature to analyze\n     * @param do_radius flag indicating if we check the radius too\n     * @param radius the radius if it is a radius search\n     * @param do_k flag indicating if we limit the number of nn\n     * @param k_nn the number of nearest neighbors\n     * @param checked_average used for debugging\n     */\n    void getNeighbors(const ElementType* vec, bool /*do_radius*/, float radius, bool do_k, unsigned int k_nn,\n                      float& /*checked_average*/)\n    {\n        static std::vector<ScoreIndexPair> score_index_heap;\n\n        if (do_k) {\n            unsigned int worst_score = std::numeric_limits<unsigned int>::max();\n            typename std::vector<lsh::LshTable<ElementType> >::const_iterator table = tables_.begin();\n            typename std::vector<lsh::LshTable<ElementType> >::const_iterator table_end = tables_.end();\n            for (; table != table_end; ++table) {\n                size_t key = table->getKey(vec);\n                std::vector<lsh::BucketKey>::const_iterator xor_mask = xor_masks_.begin();\n                std::vector<lsh::BucketKey>::const_iterator xor_mask_end = xor_masks_.end();\n                for (; xor_mask != xor_mask_end; ++xor_mask) {\n                    size_t sub_key = key ^ (*xor_mask);\n                    const lsh::Bucket* bucket = table->getBucketFromKey(sub_key);\n                    if (bucket == 0) continue;\n\n                    // Go over each descriptor index\n                    std::vector<lsh::FeatureIndex>::const_iterator training_index = bucket->begin();\n                    std::vector<lsh::FeatureIndex>::const_iterator last_training_index = bucket->end();\n                    DistanceType hamming_distance;\n\n                    // Process the rest of the candidates\n                    for (; training_index < last_training_index; ++training_index) {\n                        hamming_distance = distance_(vec, dataset_[*training_index], dataset_.cols);\n\n                        if (hamming_distance < worst_score) {\n                            // Insert the new element\n                            score_index_heap.push_back(ScoreIndexPair(hamming_distance, training_index));\n                            std::push_heap(score_index_heap.begin(), score_index_heap.end());\n\n                            if (score_index_heap.size() > (unsigned int)k_nn) {\n                                // Remove the highest distance value as we have too many elements\n                                std::pop_heap(score_index_heap.begin(), score_index_heap.end());\n                                score_index_heap.pop_back();\n                                // Keep track of the worst score\n                                worst_score = score_index_heap.front().first;\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        else {\n            typename std::vector<lsh::LshTable<ElementType> >::const_iterator table = tables_.begin();\n            typename std::vector<lsh::LshTable<ElementType> >::const_iterator table_end = tables_.end();\n            for (; table != table_end; ++table) {\n                size_t key = table->getKey(vec);\n                std::vector<lsh::BucketKey>::const_iterator xor_mask = xor_masks_.begin();\n                std::vector<lsh::BucketKey>::const_iterator xor_mask_end = xor_masks_.end();\n                for (; xor_mask != xor_mask_end; ++xor_mask) {\n                    size_t sub_key = key ^ (*xor_mask);\n                    const lsh::Bucket* bucket = table->getBucketFromKey(sub_key);\n                    if (bucket == 0) continue;\n\n                    // Go over each descriptor index\n                    std::vector<lsh::FeatureIndex>::const_iterator training_index = bucket->begin();\n                    std::vector<lsh::FeatureIndex>::const_iterator last_training_index = bucket->end();\n                    DistanceType hamming_distance;\n\n                    // Process the rest of the candidates\n                    for (; training_index < last_training_index; ++training_index) {\n                        // Compute the Hamming distance\n                        hamming_distance = distance_(vec, dataset_[*training_index], dataset_.cols);\n                        if (hamming_distance < radius) score_index_heap.push_back(ScoreIndexPair(hamming_distance, training_index));\n                    }\n                }\n            }\n        }\n    }\n\n    /** Performs the approximate nearest-neighbor search.\n     * This is a slower version than the above as it uses the ResultSet\n     * @param vec the feature to analyze\n     */\n    void getNeighbors(const ElementType* vec, ResultSet<DistanceType>& result)\n    {\n        typename std::vector<lsh::LshTable<ElementType> >::const_iterator table = tables_.begin();\n        typename std::vector<lsh::LshTable<ElementType> >::const_iterator table_end = tables_.end();\n        for (; table != table_end; ++table) {\n            size_t key = table->getKey(vec);\n            std::vector<lsh::BucketKey>::const_iterator xor_mask = xor_masks_.begin();\n            std::vector<lsh::BucketKey>::const_iterator xor_mask_end = xor_masks_.end();\n            for (; xor_mask != xor_mask_end; ++xor_mask) {\n                size_t sub_key = key ^ (*xor_mask);\n                const lsh::Bucket* bucket = table->getBucketFromKey((lsh::BucketKey)sub_key);\n                if (bucket == 0) continue;\n\n                // Go over each descriptor index\n                std::vector<lsh::FeatureIndex>::const_iterator training_index = bucket->begin();\n                std::vector<lsh::FeatureIndex>::const_iterator last_training_index = bucket->end();\n                DistanceType hamming_distance;\n\n                // Process the rest of the candidates\n                for (; training_index < last_training_index; ++training_index) {\n                    // Compute the Hamming distance\n                    hamming_distance = distance_(vec, dataset_[*training_index], (int)dataset_.cols);\n                    result.addPoint(hamming_distance, *training_index);\n                }\n            }\n        }\n    }\n\n    /** The different hash tables */\n    std::vector<lsh::LshTable<ElementType> > tables_;\n\n    /** The data the LSH tables where built from */\n    Matrix<ElementType> dataset_;\n\n    /** The size of the features (as ElementType[]) */\n    unsigned int feature_size_;\n\n    IndexParams index_params_;\n\n    /** table number */\n    unsigned int table_number_;\n    /** key size */\n    unsigned int key_size_;\n    /** How far should we look for neighbors in multi-probe LSH */\n    unsigned int multi_probe_level_;\n\n    /** The XOR masks to apply to a key to get the neighboring buckets */\n    std::vector<lsh::BucketKey> xor_masks_;\n\n    Distance distance_;\n};\n}\n\n#endif //OPENCV_FLANN_LSH_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/lsh_table.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n/***********************************************************************\n * Author: Vincent Rabaud\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_LSH_TABLE_H_\n#define OPENCV_FLANN_LSH_TABLE_H_\n\n#include <algorithm>\n#include <iostream>\n#include <iomanip>\n#include <limits.h>\n// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP\n#ifdef __GXX_EXPERIMENTAL_CXX0X__\n#  define USE_UNORDERED_MAP 1\n#else\n#  define USE_UNORDERED_MAP 0\n#endif\n#if USE_UNORDERED_MAP\n#include <unordered_map>\n#else\n#include <map>\n#endif\n#include <math.h>\n#include <stddef.h>\n\n#include \"dynamic_bitset.h\"\n#include \"matrix.h\"\n\nnamespace cvflann\n{\n\nnamespace lsh\n{\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** What is stored in an LSH bucket\n */\ntypedef uint32_t FeatureIndex;\n/** The id from which we can get a bucket back in an LSH table\n */\ntypedef unsigned int BucketKey;\n\n/** A bucket in an LSH table\n */\ntypedef std::vector<FeatureIndex> Bucket;\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** POD for stats about an LSH table\n */\nstruct LshStats\n{\n    std::vector<unsigned int> bucket_sizes_;\n    size_t n_buckets_;\n    size_t bucket_size_mean_;\n    size_t bucket_size_median_;\n    size_t bucket_size_min_;\n    size_t bucket_size_max_;\n    size_t bucket_size_std_dev;\n    /** Each contained vector contains three value: beginning/end for interval, number of elements in the bin\n     */\n    std::vector<std::vector<unsigned int> > size_histogram_;\n};\n\n/** Overload the << operator for LshStats\n * @param out the streams\n * @param stats the stats to display\n * @return the streams\n */\ninline std::ostream& operator <<(std::ostream& out, const LshStats& stats)\n{\n    int w = 20;\n    out << \"Lsh Table Stats:\\n\" << std::setw(w) << std::setiosflags(std::ios::right) << \"N buckets : \"\n    << stats.n_buckets_ << \"\\n\" << std::setw(w) << std::setiosflags(std::ios::right) << \"mean size : \"\n    << std::setiosflags(std::ios::left) << stats.bucket_size_mean_ << \"\\n\" << std::setw(w)\n    << std::setiosflags(std::ios::right) << \"median size : \" << stats.bucket_size_median_ << \"\\n\" << std::setw(w)\n    << std::setiosflags(std::ios::right) << \"min size : \" << std::setiosflags(std::ios::left)\n    << stats.bucket_size_min_ << \"\\n\" << std::setw(w) << std::setiosflags(std::ios::right) << \"max size : \"\n    << std::setiosflags(std::ios::left) << stats.bucket_size_max_;\n\n    // Display the histogram\n    out << std::endl << std::setw(w) << std::setiosflags(std::ios::right) << \"histogram : \"\n    << std::setiosflags(std::ios::left);\n    for (std::vector<std::vector<unsigned int> >::const_iterator iterator = stats.size_histogram_.begin(), end =\n             stats.size_histogram_.end(); iterator != end; ++iterator) out << (*iterator)[0] << \"-\" << (*iterator)[1] << \": \" << (*iterator)[2] << \",  \";\n\n    return out;\n}\n\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Lsh hash table. As its key is a sub-feature, and as usually\n * the size of it is pretty small, we keep it as a continuous memory array.\n * The value is an index in the corpus of features (we keep it as an unsigned\n * int for pure memory reasons, it could be a size_t)\n */\ntemplate<typename ElementType>\nclass LshTable\n{\npublic:\n    /** A container of all the feature indices. Optimized for space\n     */\n#if USE_UNORDERED_MAP\n    typedef std::unordered_map<BucketKey, Bucket> BucketsSpace;\n#else\n    typedef std::map<BucketKey, Bucket> BucketsSpace;\n#endif\n\n    /** A container of all the feature indices. Optimized for speed\n     */\n    typedef std::vector<Bucket> BucketsSpeed;\n\n    /** Default constructor\n     */\n    LshTable()\n    {\n    }\n\n    /** Default constructor\n     * Create the mask and allocate the memory\n     * @param feature_size is the size of the feature (considered as a ElementType[])\n     * @param key_size is the number of bits that are turned on in the feature\n     * @param indices\n     */\n    LshTable(unsigned int feature_size, unsigned int key_size, std::vector<size_t> & indices)\n    {\n        (void)feature_size;\n        (void)key_size;\n        (void)indices;\n        std::cerr << \"LSH is not implemented for that type\" << std::endl;\n        assert(0);\n    }\n\n    /** Add a feature to the table\n     * @param value the value to store for that feature\n     * @param feature the feature itself\n     */\n    void add(unsigned int value, const ElementType* feature)\n    {\n        // Add the value to the corresponding bucket\n        BucketKey key = (lsh::BucketKey)getKey(feature);\n\n        switch (speed_level_) {\n        case kArray:\n            // That means we get the buckets from an array\n            buckets_speed_[key].push_back(value);\n            break;\n        case kBitsetHash:\n            // That means we can check the bitset for the presence of a key\n            key_bitset_.set(key);\n            buckets_space_[key].push_back(value);\n            break;\n        case kHash:\n        {\n            // That means we have to check for the hash table for the presence of a key\n            buckets_space_[key].push_back(value);\n            break;\n        }\n        }\n    }\n\n    /** Add a set of features to the table\n     * @param indexed_ofst previous indexed offset\n     * @param dataset the values to store\n     */\n    void add(int indexed_ofst, Matrix<ElementType> dataset)\n    {\n#if USE_UNORDERED_MAP\n        buckets_space_.rehash((buckets_space_.size() + dataset.rows) * 1.2);\n#endif\n        // Add the features to the table\n        for (unsigned int i = 0; i < dataset.rows; ++i) add(i + indexed_ofst, dataset[i]);\n        // Now that the table is full, optimize it for speed/space\n        optimize();\n    }\n\n    /** Get a bucket given the key\n     * @param key\n     * @return\n     */\n    inline const Bucket* getBucketFromKey(BucketKey key) const\n    {\n        // Generate other buckets\n        switch (speed_level_) {\n        case kArray:\n            // That means we get the buckets from an array\n            return &buckets_speed_[key];\n            break;\n        case kBitsetHash:\n            // That means we can check the bitset for the presence of a key\n            if (key_bitset_.test(key)) return &buckets_space_.find(key)->second;\n            else return 0;\n            break;\n        case kHash:\n        {\n            // That means we have to check for the hash table for the presence of a key\n            BucketsSpace::const_iterator bucket_it, bucket_end = buckets_space_.end();\n            bucket_it = buckets_space_.find(key);\n            // Stop here if that bucket does not exist\n            if (bucket_it == bucket_end) return 0;\n            else return &bucket_it->second;\n            break;\n        }\n        }\n        return 0;\n    }\n\n    /** Compute the sub-signature of a feature\n     */\n    size_t getKey(const ElementType* /*feature*/) const\n    {\n        std::cerr << \"LSH is not implemented for that type\" << std::endl;\n        assert(0);\n        return 1;\n    }\n\n    /** Get statistics about the table\n     * @return\n     */\n    LshStats getStats() const;\n\nprivate:\n    /** defines the speed fo the implementation\n     * kArray uses a vector for storing data\n     * kBitsetHash uses a hash map but checks for the validity of a key with a bitset\n     * kHash uses a hash map only\n     */\n    enum SpeedLevel\n    {\n        kArray, kBitsetHash, kHash\n    };\n\n    /** Initialize some variables\n     */\n    void initialize(size_t key_size)\n    {\n        const size_t key_size_lower_bound = 1;\n        //a value (size_t(1) << key_size) must fit the size_t type so key_size has to be strictly less than size of size_t\n        const size_t key_size_upper_bound = std::min(sizeof(BucketKey) * CHAR_BIT + 1, sizeof(size_t) * CHAR_BIT);\n        if (key_size < key_size_lower_bound || key_size >= key_size_upper_bound)\n        {\n            std::stringstream errorMessage;\n            errorMessage << \"Invalid key_size (=\" << key_size << \"). Valid values for your system are \" << key_size_lower_bound << \" <= key_size < \" << key_size_upper_bound << \".\";\n            CV_Error(CV_StsBadArg, errorMessage.str());\n        }\n\n        speed_level_ = kHash;\n        key_size_ = (unsigned)key_size;\n    }\n\n    /** Optimize the table for speed/space\n     */\n    void optimize()\n    {\n        // If we are already using the fast storage, no need to do anything\n        if (speed_level_ == kArray) return;\n\n        // Use an array if it will be more than half full\n        if (buckets_space_.size() > ((size_t(1) << key_size_) / 2)) {\n            speed_level_ = kArray;\n            // Fill the array version of it\n            buckets_speed_.resize(size_t(1) << key_size_);\n            for (BucketsSpace::const_iterator key_bucket = buckets_space_.begin(); key_bucket != buckets_space_.end(); ++key_bucket) buckets_speed_[key_bucket->first] = key_bucket->second;\n\n            // Empty the hash table\n            buckets_space_.clear();\n            return;\n        }\n\n        // If the bitset is going to use less than 10% of the RAM of the hash map (at least 1 size_t for the key and two\n        // for the vector) or less than 512MB (key_size_ <= 30)\n        if (((std::max(buckets_space_.size(), buckets_speed_.size()) * CHAR_BIT * 3 * sizeof(BucketKey)) / 10\n             >= (size_t(1) << key_size_)) || (key_size_ <= 32)) {\n            speed_level_ = kBitsetHash;\n            key_bitset_.resize(size_t(1) << key_size_);\n            key_bitset_.reset();\n            // Try with the BucketsSpace\n            for (BucketsSpace::const_iterator key_bucket = buckets_space_.begin(); key_bucket != buckets_space_.end(); ++key_bucket) key_bitset_.set(key_bucket->first);\n        }\n        else {\n            speed_level_ = kHash;\n            key_bitset_.clear();\n        }\n    }\n\n    /** The vector of all the buckets if they are held for speed\n     */\n    BucketsSpeed buckets_speed_;\n\n    /** The hash table of all the buckets in case we cannot use the speed version\n     */\n    BucketsSpace buckets_space_;\n\n    /** What is used to store the data */\n    SpeedLevel speed_level_;\n\n    /** If the subkey is small enough, it will keep track of which subkeys are set through that bitset\n     * That is just a speedup so that we don't look in the hash table (which can be mush slower that checking a bitset)\n     */\n    DynamicBitset key_bitset_;\n\n    /** The size of the sub-signature in bits\n     */\n    unsigned int key_size_;\n\n    // Members only used for the unsigned char specialization\n    /** The mask to apply to a feature to get the hash key\n     * Only used in the unsigned char case\n     */\n    std::vector<size_t> mask_;\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Specialization for unsigned char\n\ntemplate<>\ninline LshTable<unsigned char>::LshTable( unsigned int feature_size,\n                                          unsigned int subsignature_size,\n                                          std::vector<size_t> & indices  )\n{\n    initialize(subsignature_size);\n    // Allocate the mask\n    mask_ = std::vector<size_t>((size_t)ceil((float)(feature_size * sizeof(char)) / (float)sizeof(size_t)), 0);\n\n    // Generate a random set of order of subsignature_size_ bits\n    for (unsigned int i = 0; i < key_size_; ++i) {\n        //Ensure the Nth bit will be selected only once among the different LshTables\n        //to avoid having two different tables with signatures sharing many dimensions/many bits\n        size_t index = indices[0];\n        indices.erase( indices.begin() );\n\n        // Set that bit in the mask\n        size_t divisor = CHAR_BIT * sizeof(size_t);\n        size_t idx = index / divisor; //pick the right size_t index\n        mask_[idx] |= size_t(1) << (index % divisor); //use modulo to find the bit offset\n    }\n\n    // Set to 1 if you want to display the mask for debug\n#if 0\n    {\n        size_t bcount = 0;\n        BOOST_FOREACH(size_t mask_block, mask_){\n            out << std::setw(sizeof(size_t) * CHAR_BIT / 4) << std::setfill('0') << std::hex << mask_block\n                << std::endl;\n            bcount += __builtin_popcountll(mask_block);\n        }\n        out << \"bit count : \" << std::dec << bcount << std::endl;\n        out << \"mask size : \" << mask_.size() << std::endl;\n        return out;\n    }\n#endif\n}\n\n/** Return the Subsignature of a feature\n * @param feature the feature to analyze\n */\ntemplate<>\ninline size_t LshTable<unsigned char>::getKey(const unsigned char* feature) const\n{\n    // no need to check if T is dividable by sizeof(size_t) like in the Hamming\n    // distance computation as we have a mask\n    const size_t* feature_block_ptr = reinterpret_cast<const size_t*> ((const void*)feature);\n\n    // Figure out the subsignature of the feature\n    // Given the feature ABCDEF, and the mask 001011, the output will be\n    // 000CEF\n    size_t subsignature = 0;\n    size_t bit_index = 1;\n\n    for (std::vector<size_t>::const_iterator pmask_block = mask_.begin(); pmask_block != mask_.end(); ++pmask_block) {\n        // get the mask and signature blocks\n        size_t feature_block = *feature_block_ptr;\n        size_t mask_block = *pmask_block;\n        while (mask_block) {\n            // Get the lowest set bit in the mask block\n            size_t lowest_bit = mask_block & (-(ptrdiff_t)mask_block);\n            // Add it to the current subsignature if necessary\n            subsignature += (feature_block & lowest_bit) ? bit_index : 0;\n            // Reset the bit in the mask block\n            mask_block ^= lowest_bit;\n            // increment the bit index for the subsignature\n            bit_index <<= 1;\n        }\n        // Check the next feature block\n        ++feature_block_ptr;\n    }\n    return subsignature;\n}\n\ntemplate<>\ninline LshStats LshTable<unsigned char>::getStats() const\n{\n    LshStats stats;\n    stats.bucket_size_mean_ = 0;\n    if ((buckets_speed_.empty()) && (buckets_space_.empty())) {\n        stats.n_buckets_ = 0;\n        stats.bucket_size_median_ = 0;\n        stats.bucket_size_min_ = 0;\n        stats.bucket_size_max_ = 0;\n        return stats;\n    }\n\n    if (!buckets_speed_.empty()) {\n        for (BucketsSpeed::const_iterator pbucket = buckets_speed_.begin(); pbucket != buckets_speed_.end(); ++pbucket) {\n            stats.bucket_sizes_.push_back((lsh::FeatureIndex)pbucket->size());\n            stats.bucket_size_mean_ += pbucket->size();\n        }\n        stats.bucket_size_mean_ /= buckets_speed_.size();\n        stats.n_buckets_ = buckets_speed_.size();\n    }\n    else {\n        for (BucketsSpace::const_iterator x = buckets_space_.begin(); x != buckets_space_.end(); ++x) {\n            stats.bucket_sizes_.push_back((lsh::FeatureIndex)x->second.size());\n            stats.bucket_size_mean_ += x->second.size();\n        }\n        stats.bucket_size_mean_ /= buckets_space_.size();\n        stats.n_buckets_ = buckets_space_.size();\n    }\n\n    std::sort(stats.bucket_sizes_.begin(), stats.bucket_sizes_.end());\n\n    //  BOOST_FOREACH(int size, stats.bucket_sizes_)\n    //          std::cout << size << \" \";\n    //  std::cout << std::endl;\n    stats.bucket_size_median_ = stats.bucket_sizes_[stats.bucket_sizes_.size() / 2];\n    stats.bucket_size_min_ = stats.bucket_sizes_.front();\n    stats.bucket_size_max_ = stats.bucket_sizes_.back();\n\n    // TODO compute mean and std\n    /*float mean, stddev;\n       stats.bucket_size_mean_ = mean;\n       stats.bucket_size_std_dev = stddev;*/\n\n    // Include a histogram of the buckets\n    unsigned int bin_start = 0;\n    unsigned int bin_end = 20;\n    bool is_new_bin = true;\n    for (std::vector<unsigned int>::iterator iterator = stats.bucket_sizes_.begin(), end = stats.bucket_sizes_.end(); iterator\n         != end; )\n        if (*iterator < bin_end) {\n            if (is_new_bin) {\n                stats.size_histogram_.push_back(std::vector<unsigned int>(3, 0));\n                stats.size_histogram_.back()[0] = bin_start;\n                stats.size_histogram_.back()[1] = bin_end - 1;\n                is_new_bin = false;\n            }\n            ++stats.size_histogram_.back()[2];\n            ++iterator;\n        }\n        else {\n            bin_start += 20;\n            bin_end += 20;\n            is_new_bin = true;\n        }\n\n    return stats;\n}\n\n// End the two namespaces\n}\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n#endif /* OPENCV_FLANN_LSH_TABLE_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/matrix.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_DATASET_H_\n#define OPENCV_FLANN_DATASET_H_\n\n#include <stdio.h>\n\n#include \"general.h\"\n\nnamespace cvflann\n{\n\n/**\n * Class that implements a simple rectangular matrix stored in a memory buffer and\n * provides convenient matrix-like access using the [] operators.\n */\ntemplate <typename T>\nclass Matrix\n{\npublic:\n    typedef T type;\n\n    size_t rows;\n    size_t cols;\n    size_t stride;\n    T* data;\n\n    Matrix() : rows(0), cols(0), stride(0), data(NULL)\n    {\n    }\n\n    Matrix(T* data_, size_t rows_, size_t cols_, size_t stride_ = 0) :\n        rows(rows_), cols(cols_),  stride(stride_), data(data_)\n    {\n        if (stride==0) stride = cols;\n    }\n\n    /**\n     * Convenience function for deallocating the storage data.\n     */\n    FLANN_DEPRECATED void free()\n    {\n        fprintf(stderr, \"The cvflann::Matrix<T>::free() method is deprecated \"\n                \"and it does not do any memory deallocation any more.  You are\"\n                \"responsible for deallocating the matrix memory (by doing\"\n                \"'delete[] matrix.data' for example)\");\n    }\n\n    /**\n     * Operator that return a (pointer to a) row of the data.\n     */\n    T* operator[](size_t index) const\n    {\n        return data+index*stride;\n    }\n};\n\n\nclass UntypedMatrix\n{\npublic:\n    size_t rows;\n    size_t cols;\n    void* data;\n    flann_datatype_t type;\n\n    UntypedMatrix(void* data_, long rows_, long cols_) :\n        rows(rows_), cols(cols_), data(data_)\n    {\n    }\n\n    ~UntypedMatrix()\n    {\n    }\n\n\n    template<typename T>\n    Matrix<T> as()\n    {\n        return Matrix<T>((T*)data, rows, cols);\n    }\n};\n\n\n\n}\n\n#endif //OPENCV_FLANN_DATASET_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/miniflann.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef _OPENCV_MINIFLANN_HPP_\n#define _OPENCV_MINIFLANN_HPP_\n\n#ifdef __cplusplus\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/flann/defines.h\"\n\nnamespace cv\n{\n\nnamespace flann\n{\n\nstruct CV_EXPORTS IndexParams\n{\n    IndexParams();\n    ~IndexParams();\n\n    std::string getString(const std::string& key, const std::string& defaultVal=std::string()) const;\n    int getInt(const std::string& key, int defaultVal=-1) const;\n    double getDouble(const std::string& key, double defaultVal=-1) const;\n\n    void setString(const std::string& key, const std::string& value);\n    void setInt(const std::string& key, int value);\n    void setDouble(const std::string& key, double value);\n    void setFloat(const std::string& key, float value);\n    void setBool(const std::string& key, bool value);\n    void setAlgorithm(int value);\n\n    void getAll(std::vector<std::string>& names,\n                std::vector<int>& types,\n                std::vector<std::string>& strValues,\n                std::vector<double>& numValues) const;\n\n    void* params;\n};\n\nstruct CV_EXPORTS KDTreeIndexParams : public IndexParams\n{\n    KDTreeIndexParams(int trees=4);\n};\n\nstruct CV_EXPORTS LinearIndexParams : public IndexParams\n{\n    LinearIndexParams();\n};\n\nstruct CV_EXPORTS CompositeIndexParams : public IndexParams\n{\n    CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11,\n                         cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f );\n};\n\nstruct CV_EXPORTS AutotunedIndexParams : public IndexParams\n{\n    AutotunedIndexParams(float target_precision = 0.8f, float build_weight = 0.01f,\n                         float memory_weight = 0, float sample_fraction = 0.1f);\n};\n\nstruct CV_EXPORTS HierarchicalClusteringIndexParams : public IndexParams\n{\n    HierarchicalClusteringIndexParams(int branching = 32,\n                      cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, int trees = 4, int leaf_size = 100 );\n};\n\nstruct CV_EXPORTS KMeansIndexParams : public IndexParams\n{\n    KMeansIndexParams(int branching = 32, int iterations = 11,\n                      cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f );\n};\n\nstruct CV_EXPORTS LshIndexParams : public IndexParams\n{\n    LshIndexParams(int table_number, int key_size, int multi_probe_level);\n};\n\nstruct CV_EXPORTS SavedIndexParams : public IndexParams\n{\n    SavedIndexParams(const std::string& filename);\n};\n\nstruct CV_EXPORTS SearchParams : public IndexParams\n{\n    SearchParams( int checks = 32, float eps = 0, bool sorted = true );\n};\n\nclass CV_EXPORTS_W Index\n{\npublic:\n    CV_WRAP Index();\n    CV_WRAP Index(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);\n    virtual ~Index();\n\n    CV_WRAP virtual void build(InputArray wholefeatures, InputArray additionalfeatures, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);\n\n    CV_WRAP virtual void knnSearch(InputArray query, OutputArray indices,\n                   OutputArray dists, int knn, const SearchParams& params=SearchParams());\n\n    CV_WRAP virtual int radiusSearch(InputArray query, OutputArray indices,\n                             OutputArray dists, double radius, int maxResults,\n                             const SearchParams& params=SearchParams());\n\n    CV_WRAP virtual void save(const std::string& filename) const;\n    CV_WRAP virtual bool load(InputArray features, const std::string& filename);\n    CV_WRAP virtual void release();\n    CV_WRAP cvflann::flann_distance_t getDistance() const;\n    CV_WRAP cvflann::flann_algorithm_t getAlgorithm() const;\n\nprotected:\n    cvflann::flann_distance_t distType;\n    cvflann::flann_algorithm_t algo;\n    int featureType;\n    void* index;\n};\n\n} } // namespace cv::flann\n\n#endif // __cplusplus\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/nn_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_NNINDEX_H\n#define OPENCV_FLANN_NNINDEX_H\n\n#include <string>\n\n#include \"general.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"params.h\"\n\nnamespace cvflann\n{\n\n/**\n * Nearest-neighbour index base class\n */\ntemplate <typename Distance>\nclass NNIndex\n{\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\npublic:\n\n    virtual ~NNIndex() {}\n\n    /**\n     * \\brief Builds the index\n     */\n    virtual void buildIndex() = 0;\n\n    /**\n     * \\brief implementation for algorithms of addable indexes after that.\n     */\n    virtual void addIndex(const Matrix<ElementType>& wholeData, const Matrix<ElementType>& additionalData) = 0;\n\n    /**\n     * \\brief Perform k-nearest neighbor search\n     * \\param[in] queries The query points for which to find the nearest neighbors\n     * \\param[out] indices The indices of the nearest neighbors found\n     * \\param[out] dists Distances to the nearest neighbors found\n     * \\param[in] knn Number of nearest neighbors to return\n     * \\param[in] params Search parameters\n     */\n    virtual void knnSearch(const Matrix<ElementType>& queries, Matrix<int>& indices, Matrix<DistanceType>& dists, int knn, const SearchParams& params)\n    {\n        assert(queries.cols == veclen());\n        assert(indices.rows >= queries.rows);\n        assert(dists.rows >= queries.rows);\n        assert(int(indices.cols) >= knn);\n        assert(int(dists.cols) >= knn);\n\n#if 0\n        KNNResultSet<DistanceType> resultSet(knn);\n        for (size_t i = 0; i < queries.rows; i++) {\n            resultSet.init(indices[i], dists[i]);\n            findNeighbors(resultSet, queries[i], params);\n        }\n#else\n        KNNUniqueResultSet<DistanceType> resultSet(knn);\n        for (size_t i = 0; i < queries.rows; i++) {\n            resultSet.clear();\n            findNeighbors(resultSet, queries[i], params);\n            if (get_param(params,\"sorted\",true)) resultSet.sortAndCopy(indices[i], dists[i], knn);\n            else resultSet.copy(indices[i], dists[i], knn);\n        }\n#endif\n    }\n\n    /**\n     * \\brief Perform radius search\n     * \\param[in] query The query point\n     * \\param[out] indices The indinces of the neighbors found within the given radius\n     * \\param[out] dists The distances to the nearest neighbors found\n     * \\param[in] radius The radius used for search\n     * \\param[in] params Search parameters\n     * \\returns Number of neighbors found\n     */\n    virtual int radiusSearch(const Matrix<ElementType>& query, Matrix<int>& indices, Matrix<DistanceType>& dists, float radius, const SearchParams& params)\n    {\n        if (query.rows != 1) {\n            fprintf(stderr, \"I can only search one feature at a time for range search\\n\");\n            return -1;\n        }\n        assert(query.cols == veclen());\n        assert(indices.cols == dists.cols);\n\n        int n = 0;\n        int* indices_ptr = NULL;\n        DistanceType* dists_ptr = NULL;\n        if (indices.cols > 0) {\n            n = (int)indices.cols;\n            indices_ptr = indices[0];\n            dists_ptr = dists[0];\n        }\n\n        RadiusUniqueResultSet<DistanceType> resultSet((DistanceType)radius);\n        resultSet.clear();\n        findNeighbors(resultSet, query[0], params);\n        if (n>0) {\n            if (get_param(params,\"sorted\",true)) resultSet.sortAndCopy(indices_ptr, dists_ptr, n);\n            else resultSet.copy(indices_ptr, dists_ptr, n);\n        }\n\n        return (int)resultSet.size();\n    }\n\n    /**\n     * \\brief Saves the index to a stream\n     * \\param stream The stream to save the index to\n     */\n    virtual void saveIndex(FILE* stream) = 0;\n\n    /**\n     * \\brief Loads the index from a stream\n     * \\param stream The stream from which the index is loaded\n     */\n    virtual void loadIndex(FILE* stream) = 0;\n\n    /**\n     * \\returns number of features in this index.\n     */\n    virtual size_t size() const = 0;\n\n    /**\n     * \\returns The dimensionality of the features in this index.\n     */\n    virtual size_t veclen() const = 0;\n\n    /**\n     * \\returns The amount of memory (in bytes) used by the index.\n     */\n    virtual int usedMemory() const = 0;\n\n    /**\n     * \\returns The index type (kdtree, kmeans,...)\n     */\n    virtual flann_algorithm_t getType() const = 0;\n\n    /**\n     * \\returns The index parameters\n     */\n    virtual IndexParams getParameters() const = 0;\n\n\n    /**\n     * \\brief Method that searches for nearest-neighbours\n     */\n    virtual void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) = 0;\n};\n\n}\n\n#endif //OPENCV_FLANN_NNINDEX_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/object_factory.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_OBJECT_FACTORY_H_\n#define OPENCV_FLANN_OBJECT_FACTORY_H_\n\n#include <map>\n\nnamespace cvflann\n{\n\nclass CreatorNotFound\n{\n};\n\ntemplate<typename BaseClass,\n         typename UniqueIdType,\n         typename ObjectCreator = BaseClass* (*)()>\nclass ObjectFactory\n{\n    typedef ObjectFactory<BaseClass,UniqueIdType,ObjectCreator> ThisClass;\n    typedef std::map<UniqueIdType, ObjectCreator> ObjectRegistry;\n\n    // singleton class, private constructor\n    ObjectFactory() {}\n\npublic:\n\n    bool subscribe(UniqueIdType id, ObjectCreator creator)\n    {\n        if (object_registry.find(id) != object_registry.end()) return false;\n\n        object_registry[id] = creator;\n        return true;\n    }\n\n    bool unregister(UniqueIdType id)\n    {\n        return object_registry.erase(id) == 1;\n    }\n\n    ObjectCreator create(UniqueIdType id)\n    {\n        typename ObjectRegistry::const_iterator iter = object_registry.find(id);\n\n        if (iter == object_registry.end()) {\n            throw CreatorNotFound();\n        }\n\n        return iter->second;\n    }\n\n    static ThisClass& instance()\n    {\n        static ThisClass the_factory;\n        return the_factory;\n    }\nprivate:\n    ObjectRegistry object_registry;\n};\n\n}\n\n#endif /* OPENCV_FLANN_OBJECT_FACTORY_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/params.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2011  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2011  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_PARAMS_H_\n#define OPENCV_FLANN_PARAMS_H_\n\n#include \"any.h\"\n#include \"general.h\"\n#include <iostream>\n#include <map>\n\n\nnamespace cvflann\n{\n\ntypedef std::map<std::string, any> IndexParams;\n\nstruct SearchParams : public IndexParams\n{\n    SearchParams(int checks = 32, float eps = 0, bool sorted = true )\n    {\n        // how many leafs to visit when searching for neighbours (-1 for unlimited)\n        (*this)[\"checks\"] = checks;\n        // search for eps-approximate neighbours (default: 0)\n        (*this)[\"eps\"] = eps;\n        // only for radius search, require neighbours sorted by distance (default: true)\n        (*this)[\"sorted\"] = sorted;\n    }\n};\n\n\ntemplate<typename T>\nT get_param(const IndexParams& params, std::string name, const T& default_value)\n{\n    IndexParams::const_iterator it = params.find(name);\n    if (it != params.end()) {\n        return it->second.cast<T>();\n    }\n    else {\n        return default_value;\n    }\n}\n\ntemplate<typename T>\nT get_param(const IndexParams& params, std::string name)\n{\n    IndexParams::const_iterator it = params.find(name);\n    if (it != params.end()) {\n        return it->second.cast<T>();\n    }\n    else {\n        throw FLANNException(std::string(\"Missing parameter '\")+name+std::string(\"' in the parameters given\"));\n    }\n}\n\ninline void print_params(const IndexParams& params, std::ostream& stream)\n{\n    IndexParams::const_iterator it;\n\n    for(it=params.begin(); it!=params.end(); ++it) {\n        stream << it->first << \" : \" << it->second << std::endl;\n    }\n}\n\ninline void print_params(const IndexParams& params)\n{\n    print_params(params, std::cout);\n}\n\n}\n\n\n#endif /* OPENCV_FLANN_PARAMS_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/random.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_RANDOM_H\n#define OPENCV_FLANN_RANDOM_H\n\n#include <algorithm>\n#include <cstdlib>\n#include <vector>\n\n#include \"general.h\"\n\nnamespace cvflann\n{\n\n/**\n * Seeds the random number generator\n *  @param seed Random seed\n */\ninline void seed_random(unsigned int seed)\n{\n    srand(seed);\n}\n\n/*\n * Generates a random double value.\n */\n/**\n * Generates a random double value.\n * @param high Upper limit\n * @param low Lower limit\n * @return Random double value\n */\ninline double rand_double(double high = 1.0, double low = 0)\n{\n    return low + ((high-low) * (std::rand() / (RAND_MAX + 1.0)));\n}\n\n/**\n * Generates a random integer value.\n * @param high Upper limit\n * @param low Lower limit\n * @return Random integer value\n */\ninline int rand_int(int high = RAND_MAX, int low = 0)\n{\n    return low + (int) ( double(high-low) * (std::rand() / (RAND_MAX + 1.0)));\n}\n\n/**\n * Random number generator that returns a distinct number from\n * the [0,n) interval each time.\n */\nclass UniqueRandom\n{\n    std::vector<int> vals_;\n    int size_;\n    int counter_;\n\npublic:\n    /**\n     * Constructor.\n     * @param n Size of the interval from which to generate\n     * @return\n     */\n    UniqueRandom(int n)\n    {\n        init(n);\n    }\n\n    /**\n     * Initializes the number generator.\n     * @param n the size of the interval from which to generate random numbers.\n     */\n    void init(int n)\n    {\n        // create and initialize an array of size n\n        vals_.resize(n);\n        size_ = n;\n        for (int i = 0; i < size_; ++i) vals_[i] = i;\n\n        // shuffle the elements in the array\n        std::random_shuffle(vals_.begin(), vals_.end());\n\n        counter_ = 0;\n    }\n\n    /**\n     * Return a distinct random integer in greater or equal to 0 and less\n     * than 'n' on each call. It should be called maximum 'n' times.\n     * Returns: a random integer\n     */\n    int next()\n    {\n        if (counter_ == size_) {\n            return -1;\n        }\n        else {\n            return vals_[counter_++];\n        }\n    }\n};\n\n}\n\n#endif //OPENCV_FLANN_RANDOM_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/result_set.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_RESULTSET_H\n#define OPENCV_FLANN_RESULTSET_H\n\n#include <algorithm>\n#include <cstring>\n#include <iostream>\n#include <limits>\n#include <set>\n#include <vector>\n\nnamespace cvflann\n{\n\n/* This record represents a branch point when finding neighbors in\n    the tree.  It contains a record of the minimum distance to the query\n    point, as well as the node at which the search resumes.\n */\n\ntemplate <typename T, typename DistanceType>\nstruct BranchStruct\n{\n    T node;           /* Tree node at which search resumes */\n    DistanceType mindist;     /* Minimum distance to query for all nodes below. */\n\n    BranchStruct() {}\n    BranchStruct(const T& aNode, DistanceType dist) : node(aNode), mindist(dist) {}\n\n    bool operator<(const BranchStruct<T, DistanceType>& rhs) const\n    {\n        return mindist<rhs.mindist;\n    }\n};\n\n\ntemplate <typename DistanceType>\nclass ResultSet\n{\npublic:\n    virtual ~ResultSet() {}\n\n    virtual bool full() const = 0;\n\n    virtual void addPoint(DistanceType dist, int index) = 0;\n\n    virtual DistanceType worstDist() const = 0;\n\n};\n\n/**\n * KNNSimpleResultSet does not ensure that the element it holds are unique.\n * Is used in those cases where the nearest neighbour algorithm used does not\n * attempt to insert the same element multiple times.\n */\ntemplate <typename DistanceType>\nclass KNNSimpleResultSet : public ResultSet<DistanceType>\n{\n    int* indices;\n    DistanceType* dists;\n    int capacity;\n    int count;\n    DistanceType worst_distance_;\n\npublic:\n    KNNSimpleResultSet(int capacity_) : capacity(capacity_), count(0)\n    {\n    }\n\n    void init(int* indices_, DistanceType* dists_)\n    {\n        indices = indices_;\n        dists = dists_;\n        count = 0;\n        worst_distance_ = (std::numeric_limits<DistanceType>::max)();\n        dists[capacity-1] = worst_distance_;\n    }\n\n    size_t size() const\n    {\n        return count;\n    }\n\n    bool full() const\n    {\n        return count == capacity;\n    }\n\n\n    void addPoint(DistanceType dist, int index)\n    {\n        if (dist >= worst_distance_) return;\n        int i;\n        for (i=count; i>0; --i) {\n#ifdef FLANN_FIRST_MATCH\n            if ( (dists[i-1]>dist) || ((dist==dists[i-1])&&(indices[i-1]>index)) )\n#else\n            if (dists[i-1]>dist)\n#endif\n            {\n                if (i<capacity) {\n                    dists[i] = dists[i-1];\n                    indices[i] = indices[i-1];\n                }\n            }\n            else break;\n        }\n        if (count < capacity) ++count;\n        dists[i] = dist;\n        indices[i] = index;\n        worst_distance_ = dists[capacity-1];\n    }\n\n    DistanceType worstDist() const\n    {\n        return worst_distance_;\n    }\n};\n\n/**\n * K-Nearest neighbour result set. Ensures that the elements inserted are unique\n */\ntemplate <typename DistanceType>\nclass KNNResultSet : public ResultSet<DistanceType>\n{\n    int* indices;\n    DistanceType* dists;\n    int capacity;\n    int count;\n    DistanceType worst_distance_;\n\npublic:\n    KNNResultSet(int capacity_) : capacity(capacity_), count(0)\n    {\n    }\n\n    void init(int* indices_, DistanceType* dists_)\n    {\n        indices = indices_;\n        dists = dists_;\n        count = 0;\n        worst_distance_ = (std::numeric_limits<DistanceType>::max)();\n        dists[capacity-1] = worst_distance_;\n    }\n\n    size_t size() const\n    {\n        return count;\n    }\n\n    bool full() const\n    {\n        return count == capacity;\n    }\n\n\n    void addPoint(DistanceType dist, int index)\n    {\n        if (dist >= worst_distance_) return;\n        int i;\n        for (i = count; i > 0; --i) {\n#ifdef FLANN_FIRST_MATCH\n            if ( (dists[i-1]<=dist) && ((dist!=dists[i-1])||(indices[i-1]<=index)) )\n#else\n            if (dists[i-1]<=dist)\n#endif\n            {\n                // Check for duplicate indices\n                int j = i - 1;\n                while ((j >= 0) && (dists[j] == dist)) {\n                    if (indices[j] == index) {\n                        return;\n                    }\n                    --j;\n                }\n                break;\n            }\n        }\n\n        if (count < capacity) ++count;\n        for (int j = count-1; j > i; --j) {\n            dists[j] = dists[j-1];\n            indices[j] = indices[j-1];\n        }\n        dists[i] = dist;\n        indices[i] = index;\n        worst_distance_ = dists[capacity-1];\n    }\n\n    DistanceType worstDist() const\n    {\n        return worst_distance_;\n    }\n};\n\n\n/**\n * A result-set class used when performing a radius based search.\n */\ntemplate <typename DistanceType>\nclass RadiusResultSet : public ResultSet<DistanceType>\n{\n    DistanceType radius;\n    int* indices;\n    DistanceType* dists;\n    size_t capacity;\n    size_t count;\n\npublic:\n    RadiusResultSet(DistanceType radius_, int* indices_, DistanceType* dists_, int capacity_) :\n        radius(radius_), indices(indices_), dists(dists_), capacity(capacity_)\n    {\n        init();\n    }\n\n    ~RadiusResultSet()\n    {\n    }\n\n    void init()\n    {\n        count = 0;\n    }\n\n    size_t size() const\n    {\n        return count;\n    }\n\n    bool full() const\n    {\n        return true;\n    }\n\n    void addPoint(DistanceType dist, int index)\n    {\n        if (dist<radius) {\n            if ((capacity>0)&&(count < capacity)) {\n                dists[count] = dist;\n                indices[count] = index;\n            }\n            count++;\n        }\n    }\n\n    DistanceType worstDist() const\n    {\n        return radius;\n    }\n\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Class that holds the k NN neighbors\n * Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays\n */\ntemplate<typename DistanceType>\nclass UniqueResultSet : public ResultSet<DistanceType>\n{\npublic:\n    struct DistIndex\n    {\n        DistIndex(DistanceType dist, unsigned int index) :\n            dist_(dist), index_(index)\n        {\n        }\n        bool operator<(const DistIndex dist_index) const\n        {\n            return (dist_ < dist_index.dist_) || ((dist_ == dist_index.dist_) && index_ < dist_index.index_);\n        }\n        DistanceType dist_;\n        unsigned int index_;\n    };\n\n    /** Default cosntructor */\n    UniqueResultSet() :\n        worst_distance_(std::numeric_limits<DistanceType>::max())\n    {\n    }\n\n    /** Check the status of the set\n     * @return true if we have k NN\n     */\n    inline bool full() const\n    {\n        return is_full_;\n    }\n\n    /** Remove all elements in the set\n     */\n    virtual void clear() = 0;\n\n    /** Copy the set to two C arrays\n     * @param indices pointer to a C array of indices\n     * @param dist pointer to a C array of distances\n     * @param n_neighbors the number of neighbors to copy\n     */\n    virtual void copy(int* indices, DistanceType* dist, int n_neighbors = -1) const\n    {\n        if (n_neighbors < 0) {\n            for (typename std::set<DistIndex>::const_iterator dist_index = dist_indices_.begin(), dist_index_end =\n                     dist_indices_.end(); dist_index != dist_index_end; ++dist_index, ++indices, ++dist) {\n                *indices = dist_index->index_;\n                *dist = dist_index->dist_;\n            }\n        }\n        else {\n            int i = 0;\n            for (typename std::set<DistIndex>::const_iterator dist_index = dist_indices_.begin(), dist_index_end =\n                     dist_indices_.end(); (dist_index != dist_index_end) && (i < n_neighbors); ++dist_index, ++indices, ++dist, ++i) {\n                *indices = dist_index->index_;\n                *dist = dist_index->dist_;\n            }\n        }\n    }\n\n    /** Copy the set to two C arrays but sort it according to the distance first\n     * @param indices pointer to a C array of indices\n     * @param dist pointer to a C array of distances\n     * @param n_neighbors the number of neighbors to copy\n     */\n    virtual void sortAndCopy(int* indices, DistanceType* dist, int n_neighbors = -1) const\n    {\n        copy(indices, dist, n_neighbors);\n    }\n\n    /** The number of neighbors in the set\n     * @return\n     */\n    size_t size() const\n    {\n        return dist_indices_.size();\n    }\n\n    /** The distance of the furthest neighbor\n     * If we don't have enough neighbors, it returns the max possible value\n     * @return\n     */\n    inline DistanceType worstDist() const\n    {\n        return worst_distance_;\n    }\nprotected:\n    /** Flag to say if the set is full */\n    bool is_full_;\n\n    /** The worst distance found so far */\n    DistanceType worst_distance_;\n\n    /** The best candidates so far */\n    std::set<DistIndex> dist_indices_;\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Class that holds the k NN neighbors\n * Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays\n */\ntemplate<typename DistanceType>\nclass KNNUniqueResultSet : public UniqueResultSet<DistanceType>\n{\npublic:\n    /** Constructor\n     * @param capacity the number of neighbors to store at max\n     */\n    KNNUniqueResultSet(unsigned int capacity) : capacity_(capacity)\n    {\n        this->is_full_ = false;\n        this->clear();\n    }\n\n    /** Add a possible candidate to the best neighbors\n     * @param dist distance for that neighbor\n     * @param index index of that neighbor\n     */\n    inline void addPoint(DistanceType dist, int index)\n    {\n        // Don't do anything if we are worse than the worst\n        if (dist >= worst_distance_) return;\n        dist_indices_.insert(DistIndex(dist, index));\n\n        if (is_full_) {\n            if (dist_indices_.size() > capacity_) {\n                dist_indices_.erase(*dist_indices_.rbegin());\n                worst_distance_ = dist_indices_.rbegin()->dist_;\n            }\n        }\n        else if (dist_indices_.size() == capacity_) {\n            is_full_ = true;\n            worst_distance_ = dist_indices_.rbegin()->dist_;\n        }\n    }\n\n    /** Remove all elements in the set\n     */\n    void clear()\n    {\n        dist_indices_.clear();\n        worst_distance_ = std::numeric_limits<DistanceType>::max();\n        is_full_ = false;\n    }\n\nprotected:\n    typedef typename UniqueResultSet<DistanceType>::DistIndex DistIndex;\n    using UniqueResultSet<DistanceType>::is_full_;\n    using UniqueResultSet<DistanceType>::worst_distance_;\n    using UniqueResultSet<DistanceType>::dist_indices_;\n\n    /** The number of neighbors to keep */\n    unsigned int capacity_;\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Class that holds the radius nearest neighbors\n * It is more accurate than RadiusResult as it is not limited in the number of neighbors\n */\ntemplate<typename DistanceType>\nclass RadiusUniqueResultSet : public UniqueResultSet<DistanceType>\n{\npublic:\n    /** Constructor\n     * @param radius the maximum distance of a neighbor\n     */\n    RadiusUniqueResultSet(DistanceType radius) :\n        radius_(radius)\n    {\n        is_full_ = true;\n    }\n\n    /** Add a possible candidate to the best neighbors\n     * @param dist distance for that neighbor\n     * @param index index of that neighbor\n     */\n    void addPoint(DistanceType dist, int index)\n    {\n        if (dist <= radius_) dist_indices_.insert(DistIndex(dist, index));\n    }\n\n    /** Remove all elements in the set\n     */\n    inline void clear()\n    {\n        dist_indices_.clear();\n    }\n\n\n    /** Check the status of the set\n     * @return alwys false\n     */\n    inline bool full() const\n    {\n        return true;\n    }\n\n    /** The distance of the furthest neighbor\n     * If we don't have enough neighbors, it returns the max possible value\n     * @return\n     */\n    inline DistanceType worstDist() const\n    {\n        return radius_;\n    }\nprivate:\n    typedef typename UniqueResultSet<DistanceType>::DistIndex DistIndex;\n    using UniqueResultSet<DistanceType>::dist_indices_;\n    using UniqueResultSet<DistanceType>::is_full_;\n\n    /** The furthest distance a neighbor can be */\n    DistanceType radius_;\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Class that holds the k NN neighbors within a radius distance\n */\ntemplate<typename DistanceType>\nclass KNNRadiusUniqueResultSet : public KNNUniqueResultSet<DistanceType>\n{\npublic:\n    /** Constructor\n     * @param capacity the number of neighbors to store at max\n     * @param radius the maximum distance of a neighbor\n     */\n    KNNRadiusUniqueResultSet(unsigned int capacity, DistanceType radius)\n    {\n        this->capacity_ = capacity;\n        this->radius_ = radius;\n        this->dist_indices_.reserve(capacity_);\n        this->clear();\n    }\n\n    /** Remove all elements in the set\n     */\n    void clear()\n    {\n        dist_indices_.clear();\n        worst_distance_ = radius_;\n        is_full_ = false;\n    }\nprivate:\n    using KNNUniqueResultSet<DistanceType>::dist_indices_;\n    using KNNUniqueResultSet<DistanceType>::is_full_;\n    using KNNUniqueResultSet<DistanceType>::worst_distance_;\n\n    /** The maximum number of neighbors to consider */\n    unsigned int capacity_;\n\n    /** The maximum distance of a neighbor */\n    DistanceType radius_;\n};\n}\n\n#endif //OPENCV_FLANN_RESULTSET_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/sampling.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_SAMPLING_H_\n#define OPENCV_FLANN_SAMPLING_H_\n\n#include \"matrix.h\"\n#include \"random.h\"\n\nnamespace cvflann\n{\n\ntemplate<typename T>\nMatrix<T> random_sample(Matrix<T>& srcMatrix, long size, bool remove = false)\n{\n    Matrix<T> newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols);\n\n    T* src,* dest;\n    for (long i=0; i<size; ++i) {\n        long r = rand_int((int)(srcMatrix.rows-i));\n        dest = newSet[i];\n        src = srcMatrix[r];\n        std::copy(src, src+srcMatrix.cols, dest);\n        if (remove) {\n            src = srcMatrix[srcMatrix.rows-i-1];\n            dest = srcMatrix[r];\n            std::copy(src, src+srcMatrix.cols, dest);\n        }\n    }\n    if (remove) {\n        srcMatrix.rows -= size;\n    }\n    return newSet;\n}\n\ntemplate<typename T>\nMatrix<T> random_sample(const Matrix<T>& srcMatrix, size_t size)\n{\n    UniqueRandom rand((int)srcMatrix.rows);\n    Matrix<T> newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols);\n\n    T* src,* dest;\n    for (size_t i=0; i<size; ++i) {\n        long r = rand.next();\n        dest = newSet[i];\n        src = srcMatrix[r];\n        std::copy(src, src+srcMatrix.cols, dest);\n    }\n    return newSet;\n}\n\n} // namespace\n\n\n#endif /* OPENCV_FLANN_SAMPLING_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/saving.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE NNIndexGOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_SAVING_H_\n#define OPENCV_FLANN_SAVING_H_\n\n#include <cstring>\n#include <vector>\n\n#include \"general.h\"\n#include \"nn_index.h\"\n\n#ifdef FLANN_SIGNATURE_\n#undef FLANN_SIGNATURE_\n#endif\n#define FLANN_SIGNATURE_ \"FLANN_INDEX\"\n\nnamespace cvflann\n{\n\ntemplate <typename T>\nstruct Datatype {};\ntemplate<>\nstruct Datatype<char> { static flann_datatype_t type() { return FLANN_INT8; } };\ntemplate<>\nstruct Datatype<short> { static flann_datatype_t type() { return FLANN_INT16; } };\ntemplate<>\nstruct Datatype<int> { static flann_datatype_t type() { return FLANN_INT32; } };\ntemplate<>\nstruct Datatype<unsigned char> { static flann_datatype_t type() { return FLANN_UINT8; } };\ntemplate<>\nstruct Datatype<unsigned short> { static flann_datatype_t type() { return FLANN_UINT16; } };\ntemplate<>\nstruct Datatype<unsigned int> { static flann_datatype_t type() { return FLANN_UINT32; } };\ntemplate<>\nstruct Datatype<float> { static flann_datatype_t type() { return FLANN_FLOAT32; } };\ntemplate<>\nstruct Datatype<double> { static flann_datatype_t type() { return FLANN_FLOAT64; } };\n\n\n/**\n * Structure representing the index header.\n */\nstruct IndexHeader\n{\n    char signature[16];\n    char version[16];\n    flann_datatype_t data_type;\n    flann_algorithm_t index_type;\n    size_t rows;\n    size_t cols;\n};\n\n/**\n * Saves index header to stream\n *\n * @param stream - Stream to save to\n * @param index - The index to save\n */\ntemplate<typename Distance>\nvoid save_header(FILE* stream, const NNIndex<Distance>& index)\n{\n    IndexHeader header;\n    memset(header.signature, 0, sizeof(header.signature));\n    strcpy(header.signature, FLANN_SIGNATURE_);\n    memset(header.version, 0, sizeof(header.version));\n    strcpy(header.version, FLANN_VERSION_);\n    header.data_type = Datatype<typename Distance::ElementType>::type();\n    header.index_type = index.getType();\n    header.rows = index.size();\n    header.cols = index.veclen();\n\n    std::fwrite(&header, sizeof(header),1,stream);\n}\n\n\n/**\n *\n * @param stream - Stream to load from\n * @return Index header\n */\ninline IndexHeader load_header(FILE* stream)\n{\n    IndexHeader header;\n    size_t read_size = fread(&header,sizeof(header),1,stream);\n\n    if (read_size!=(size_t)1) {\n        throw FLANNException(\"Invalid index file, cannot read\");\n    }\n\n    if (strcmp(header.signature,FLANN_SIGNATURE_)!=0) {\n        throw FLANNException(\"Invalid index file, wrong signature\");\n    }\n\n    return header;\n\n}\n\n\ntemplate<typename T>\nvoid save_value(FILE* stream, const T& value, size_t count = 1)\n{\n    fwrite(&value, sizeof(value),count, stream);\n}\n\ntemplate<typename T>\nvoid save_value(FILE* stream, const cvflann::Matrix<T>& value)\n{\n    fwrite(&value, sizeof(value),1, stream);\n    fwrite(value.data, sizeof(T),value.rows*value.cols, stream);\n}\n\ntemplate<typename T>\nvoid save_value(FILE* stream, const std::vector<T>& value)\n{\n    size_t size = value.size();\n    fwrite(&size, sizeof(size_t), 1, stream);\n    fwrite(&value[0], sizeof(T), size, stream);\n}\n\ntemplate<typename T>\nvoid load_value(FILE* stream, T& value, size_t count = 1)\n{\n    size_t read_cnt = fread(&value, sizeof(value), count, stream);\n    if (read_cnt != count) {\n        throw FLANNException(\"Cannot read from file\");\n    }\n}\n\ntemplate<typename T>\nvoid load_value(FILE* stream, cvflann::Matrix<T>& value)\n{\n    size_t read_cnt = fread(&value, sizeof(value), 1, stream);\n    if (read_cnt != 1) {\n        throw FLANNException(\"Cannot read from file\");\n    }\n    value.data = new T[value.rows*value.cols];\n    read_cnt = fread(value.data, sizeof(T), value.rows*value.cols, stream);\n    if (read_cnt != (size_t)(value.rows*value.cols)) {\n        throw FLANNException(\"Cannot read from file\");\n    }\n}\n\n\ntemplate<typename T>\nvoid load_value(FILE* stream, std::vector<T>& value)\n{\n    size_t size;\n    size_t read_cnt = fread(&size, sizeof(size_t), 1, stream);\n    if (read_cnt!=1) {\n        throw FLANNException(\"Cannot read from file\");\n    }\n    value.resize(size);\n    read_cnt = fread(&value[0], sizeof(T), size, stream);\n    if (read_cnt != size) {\n        throw FLANNException(\"Cannot read from file\");\n    }\n}\n\n}\n\n#endif /* OPENCV_FLANN_SAVING_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/simplex_downhill.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_SIMPLEX_DOWNHILL_H_\n#define OPENCV_FLANN_SIMPLEX_DOWNHILL_H_\n\nnamespace cvflann\n{\n\n/**\n    Adds val to array vals (and point to array points) and keeping the arrays sorted by vals.\n */\ntemplate <typename T>\nvoid addValue(int pos, float val, float* vals, T* point, T* points, int n)\n{\n    vals[pos] = val;\n    for (int i=0; i<n; ++i) {\n        points[pos*n+i] = point[i];\n    }\n\n    // bubble down\n    int j=pos;\n    while (j>0 && vals[j]<vals[j-1]) {\n        swap(vals[j],vals[j-1]);\n        for (int i=0; i<n; ++i) {\n            swap(points[j*n+i],points[(j-1)*n+i]);\n        }\n        --j;\n    }\n}\n\n\n/**\n    Simplex downhill optimization function.\n    Preconditions: points is a 2D mattrix of size (n+1) x n\n                    func is the cost function taking n an array of n params and returning float\n                    vals is the cost function in the n+1 simplex points, if NULL it will be computed\n\n    Postcondition: returns optimum value and points[0..n] are the optimum parameters\n */\ntemplate <typename T, typename F>\nfloat optimizeSimplexDownhill(T* points, int n, F func, float* vals = NULL )\n{\n    const int MAX_ITERATIONS = 10;\n\n    assert(n>0);\n\n    T* p_o = new T[n];\n    T* p_r = new T[n];\n    T* p_e = new T[n];\n\n    int alpha = 1;\n\n    int iterations = 0;\n\n    bool ownVals = false;\n    if (vals == NULL) {\n        ownVals = true;\n        vals = new float[n+1];\n        for (int i=0; i<n+1; ++i) {\n            float val = func(points+i*n);\n            addValue(i, val, vals, points+i*n, points, n);\n        }\n    }\n    int nn = n*n;\n\n    while (true) {\n\n        if (iterations++ > MAX_ITERATIONS) break;\n\n        // compute average of simplex points (except the highest point)\n        for (int j=0; j<n; ++j) {\n            p_o[j] = 0;\n            for (int i=0; i<n; ++i) {\n                p_o[i] += points[j*n+i];\n            }\n        }\n        for (int i=0; i<n; ++i) {\n            p_o[i] /= n;\n        }\n\n        bool converged = true;\n        for (int i=0; i<n; ++i) {\n            if (p_o[i] != points[nn+i]) {\n                converged = false;\n            }\n        }\n        if (converged) break;\n\n        // trying a reflection\n        for (int i=0; i<n; ++i) {\n            p_r[i] = p_o[i] + alpha*(p_o[i]-points[nn+i]);\n        }\n        float val_r = func(p_r);\n\n        if ((val_r>=vals[0])&&(val_r<vals[n])) {\n            // reflection between second highest and lowest\n            // add it to the simplex\n            Logger::info(\"Choosing reflection\\n\");\n            addValue(n, val_r,vals, p_r, points, n);\n            continue;\n        }\n\n        if (val_r<vals[0]) {\n            // value is smaller than smalest in simplex\n\n            // expand some more to see if it drops further\n            for (int i=0; i<n; ++i) {\n                p_e[i] = 2*p_r[i]-p_o[i];\n            }\n            float val_e = func(p_e);\n\n            if (val_e<val_r) {\n                Logger::info(\"Choosing reflection and expansion\\n\");\n                addValue(n, val_e,vals,p_e,points,n);\n            }\n            else {\n                Logger::info(\"Choosing reflection\\n\");\n                addValue(n, val_r,vals,p_r,points,n);\n            }\n            continue;\n        }\n        if (val_r>=vals[n]) {\n            for (int i=0; i<n; ++i) {\n                p_e[i] = (p_o[i]+points[nn+i])/2;\n            }\n            float val_e = func(p_e);\n\n            if (val_e<vals[n]) {\n                Logger::info(\"Choosing contraction\\n\");\n                addValue(n,val_e,vals,p_e,points,n);\n                continue;\n            }\n        }\n        {\n            Logger::info(\"Full contraction\\n\");\n            for (int j=1; j<=n; ++j) {\n                for (int i=0; i<n; ++i) {\n                    points[j*n+i] = (points[j*n+i]+points[i])/2;\n                }\n                float val = func(points+j*n);\n                addValue(j,val,vals,points+j*n,points,n);\n            }\n        }\n    }\n\n    float bestVal = vals[0];\n\n    delete[] p_r;\n    delete[] p_o;\n    delete[] p_e;\n    if (ownVals) delete[] vals;\n\n    return bestVal;\n}\n\n}\n\n#endif //OPENCV_FLANN_SIMPLEX_DOWNHILL_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/flann/timer.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_TIMER_H\n#define OPENCV_FLANN_TIMER_H\n\n#include <time.h>\n\n\nnamespace cvflann\n{\n\n/**\n * A start-stop timer class.\n *\n * Can be used to time portions of code.\n */\nclass StartStopTimer\n{\n    clock_t startTime;\n\npublic:\n    /**\n     * Value of the timer.\n     */\n    double value;\n\n\n    /**\n     * Constructor.\n     */\n    StartStopTimer()\n    {\n        reset();\n    }\n\n    /**\n     * Starts the timer.\n     */\n    void start()\n    {\n        startTime = clock();\n    }\n\n    /**\n     * Stops the timer and updates timer value.\n     */\n    void stop()\n    {\n        clock_t stopTime = clock();\n        value += ( (double)stopTime - startTime) / CLOCKS_PER_SEC;\n    }\n\n    /**\n     * Resets the timer value to 0.\n     */\n    void reset()\n    {\n        value = 0;\n    }\n\n};\n\n}\n\n#endif // FLANN_TIMER_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/block.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_DEVICE_BLOCK_HPP__\n#define __OPENCV_GPU_DEVICE_BLOCK_HPP__\n\nnamespace cv { namespace gpu { namespace device\n{\n    struct Block\n    {\n        static __device__ __forceinline__ unsigned int id()\n        {\n            return blockIdx.x;\n        }\n\n        static __device__ __forceinline__ unsigned int stride()\n        {\n            return blockDim.x * blockDim.y * blockDim.z;\n        }\n\n        static __device__ __forceinline__ void sync()\n        {\n            __syncthreads();\n        }\n\n        static __device__ __forceinline__ int flattenedThreadId()\n        {\n            return threadIdx.z * blockDim.x * blockDim.y + threadIdx.y * blockDim.x + threadIdx.x;\n        }\n\n        template<typename It, typename T>\n        static __device__ __forceinline__ void fill(It beg, It end, const T& value)\n        {\n            int STRIDE = stride();\n            It t = beg + flattenedThreadId();\n\n            for(; t < end; t += STRIDE)\n                *t = value;\n        }\n\n        template<typename OutIt, typename T>\n        static __device__ __forceinline__ void yota(OutIt beg, OutIt end, T value)\n        {\n            int STRIDE = stride();\n            int tid = flattenedThreadId();\n            value += tid;\n\n            for(OutIt t = beg + tid; t < end; t += STRIDE, value += STRIDE)\n                *t = value;\n        }\n\n        template<typename InIt, typename OutIt>\n        static __device__ __forceinline__ void copy(InIt beg, InIt end, OutIt out)\n        {\n            int STRIDE = stride();\n            InIt  t = beg + flattenedThreadId();\n            OutIt o = out + (t - beg);\n\n            for(; t < end; t += STRIDE, o += STRIDE)\n                *o = *t;\n        }\n\n        template<typename InIt, typename OutIt, class UnOp>\n        static __device__ __forceinline__ void transfrom(InIt beg, InIt end, OutIt out, UnOp op)\n        {\n            int STRIDE = stride();\n            InIt  t = beg + flattenedThreadId();\n            OutIt o = out + (t - beg);\n\n            for(; t < end; t += STRIDE, o += STRIDE)\n                *o = op(*t);\n        }\n\n        template<typename InIt1, typename InIt2, typename OutIt, class BinOp>\n        static __device__ __forceinline__ void transfrom(InIt1 beg1, InIt1 end1, InIt2 beg2, OutIt out, BinOp op)\n        {\n            int STRIDE = stride();\n            InIt1 t1 = beg1 + flattenedThreadId();\n            InIt2 t2 = beg2 + flattenedThreadId();\n            OutIt o  = out + (t1 - beg1);\n\n            for(; t1 < end1; t1 += STRIDE, t2 += STRIDE, o += STRIDE)\n                *o = op(*t1, *t2);\n        }\n\n        template<int CTA_SIZE, typename T, class BinOp>\n        static __device__ __forceinline__ void reduce(volatile T* buffer, BinOp op)\n        {\n            int tid = flattenedThreadId();\n            T val =  buffer[tid];\n\n            if (CTA_SIZE >= 1024) { if (tid < 512) buffer[tid] = val = op(val, buffer[tid + 512]); __syncthreads(); }\n            if (CTA_SIZE >=  512) { if (tid < 256) buffer[tid] = val = op(val, buffer[tid + 256]); __syncthreads(); }\n            if (CTA_SIZE >=  256) { if (tid < 128) buffer[tid] = val = op(val, buffer[tid + 128]); __syncthreads(); }\n            if (CTA_SIZE >=  128) { if (tid <  64) buffer[tid] = val = op(val, buffer[tid +  64]); __syncthreads(); }\n\n            if (tid < 32)\n            {\n                if (CTA_SIZE >=   64) { buffer[tid] = val = op(val, buffer[tid +  32]); }\n                if (CTA_SIZE >=   32) { buffer[tid] = val = op(val, buffer[tid +  16]); }\n                if (CTA_SIZE >=   16) { buffer[tid] = val = op(val, buffer[tid +   8]); }\n                if (CTA_SIZE >=    8) { buffer[tid] = val = op(val, buffer[tid +   4]); }\n                if (CTA_SIZE >=    4) { buffer[tid] = val = op(val, buffer[tid +   2]); }\n                if (CTA_SIZE >=    2) { buffer[tid] = val = op(val, buffer[tid +   1]); }\n            }\n        }\n\n        template<int CTA_SIZE, typename T, class BinOp>\n        static __device__ __forceinline__ T reduce(volatile T* buffer, T init, BinOp op)\n        {\n            int tid = flattenedThreadId();\n            T val =  buffer[tid] = init;\n            __syncthreads();\n\n            if (CTA_SIZE >= 1024) { if (tid < 512) buffer[tid] = val = op(val, buffer[tid + 512]); __syncthreads(); }\n            if (CTA_SIZE >=  512) { if (tid < 256) buffer[tid] = val = op(val, buffer[tid + 256]); __syncthreads(); }\n            if (CTA_SIZE >=  256) { if (tid < 128) buffer[tid] = val = op(val, buffer[tid + 128]); __syncthreads(); }\n            if (CTA_SIZE >=  128) { if (tid <  64) buffer[tid] = val = op(val, buffer[tid +  64]); __syncthreads(); }\n\n            if (tid < 32)\n            {\n                if (CTA_SIZE >=   64) { buffer[tid] = val = op(val, buffer[tid +  32]); }\n                if (CTA_SIZE >=   32) { buffer[tid] = val = op(val, buffer[tid +  16]); }\n                if (CTA_SIZE >=   16) { buffer[tid] = val = op(val, buffer[tid +   8]); }\n                if (CTA_SIZE >=    8) { buffer[tid] = val = op(val, buffer[tid +   4]); }\n                if (CTA_SIZE >=    4) { buffer[tid] = val = op(val, buffer[tid +   2]); }\n                if (CTA_SIZE >=    2) { buffer[tid] = val = op(val, buffer[tid +   1]); }\n            }\n            __syncthreads();\n            return buffer[0];\n        }\n\n        template <typename T, class BinOp>\n        static __device__ __forceinline__ void reduce_n(T* data, unsigned int n, BinOp op)\n        {\n            int ftid = flattenedThreadId();\n            int sft = stride();\n\n            if (sft < n)\n            {\n                for (unsigned int i = sft + ftid; i < n; i += sft)\n                    data[ftid] = op(data[ftid], data[i]);\n\n                __syncthreads();\n\n                n = sft;\n            }\n\n            while (n > 1)\n            {\n                unsigned int half = n/2;\n\n                if (ftid < half)\n                    data[ftid] = op(data[ftid], data[n - ftid - 1]);\n\n                __syncthreads();\n\n                n = n - half;\n            }\n        }\n    };\n}}}\n\n#endif /* __OPENCV_GPU_DEVICE_BLOCK_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/border_interpolate.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_BORDER_INTERPOLATE_HPP__\n#define __OPENCV_GPU_BORDER_INTERPOLATE_HPP__\n\n#include \"saturate_cast.hpp\"\n#include \"vec_traits.hpp\"\n#include \"vec_math.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    //////////////////////////////////////////////////////////////\n    // BrdConstant\n\n    template <typename D> struct BrdRowConstant\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowConstant(int width_, const D& val_ = VecTraits<D>::all(0)) : width(width_), val(val_) {}\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return x >= 0 ? saturate_cast<D>(data[x]) : val;\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return x < width ? saturate_cast<D>(data[x]) : val;\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return (x >= 0 && x < width) ? saturate_cast<D>(data[x]) : val;\n        }\n\n        const int width;\n        const D val;\n    };\n\n    template <typename D> struct BrdColConstant\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColConstant(int height_, const D& val_ = VecTraits<D>::all(0)) : height(height_), val(val_) {}\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return y >= 0 ? saturate_cast<D>(*(const T*)((const char*)data + y * step)) : val;\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return y < height ? saturate_cast<D>(*(const T*)((const char*)data + y * step)) : val;\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return (y >= 0 && y < height) ? saturate_cast<D>(*(const T*)((const char*)data + y * step)) : val;\n        }\n\n        const int height;\n        const D val;\n    };\n\n    template <typename D> struct BrdConstant\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdConstant(int height_, int width_, const D& val_ = VecTraits<D>::all(0)) : height(height_), width(width_), val(val_)\n        {\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast<D>(((const T*)((const uchar*)data + y * step))[x]) : val;\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast<D>(src(y, x)) : val;\n        }\n\n        const int height;\n        const int width;\n        const D val;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BrdReplicate\n\n    template <typename D> struct BrdRowReplicate\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowReplicate(int width) : last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdRowReplicate(int width, U) : last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return ::max(x, 0);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::min(x, last_col);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_low(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_high(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col(x)]);\n        }\n\n        const int last_col;\n    };\n\n    template <typename D> struct BrdColReplicate\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColReplicate(int height) : last_row(height - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdColReplicate(int height, U) : last_row(height - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return ::max(y, 0);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::min(y, last_row);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const T*)((const char*)data + idx_row_low(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const T*)((const char*)data + idx_row_high(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const T*)((const char*)data + idx_row(y) * step));\n        }\n\n        const int last_row;\n    };\n\n    template <typename D> struct BrdReplicate\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdReplicate(int height, int width) : last_row(height - 1), last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdReplicate(int height, int width, U) : last_row(height - 1), last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return ::max(y, 0);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::min(y, last_row);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return ::max(x, 0);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::min(x, last_col);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return saturate_cast<D>(src(idx_row(y), idx_col(x)));\n        }\n\n        const int last_row;\n        const int last_col;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BrdReflect101\n\n    template <typename D> struct BrdRowReflect101\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowReflect101(int width) : last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdRowReflect101(int width, U) : last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return ::abs(x) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::abs(last_col - ::abs(last_col - x)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_low(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_high(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col(x)]);\n        }\n\n        const int last_col;\n    };\n\n    template <typename D> struct BrdColReflect101\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColReflect101(int height) : last_row(height - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdColReflect101(int height, U) : last_row(height - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return ::abs(y) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::abs(last_row - ::abs(last_row - y)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_low(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_high(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row(y) * step));\n        }\n\n        const int last_row;\n    };\n\n    template <typename D> struct BrdReflect101\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdReflect101(int height, int width) : last_row(height - 1), last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdReflect101(int height, int width, U) : last_row(height - 1), last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return ::abs(y) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::abs(last_row - ::abs(last_row - y)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return ::abs(x) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::abs(last_col - ::abs(last_col - x)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return saturate_cast<D>(src(idx_row(y), idx_col(x)));\n        }\n\n        const int last_row;\n        const int last_col;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BrdReflect\n\n    template <typename D> struct BrdRowReflect\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowReflect(int width) : last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdRowReflect(int width, U) : last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return (::abs(x) - (x < 0)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::abs(last_col - ::abs(last_col - x) + (x > last_col)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_high(::abs(x) - (x < 0));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_low(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_high(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col(x)]);\n        }\n\n        const int last_col;\n    };\n\n    template <typename D> struct BrdColReflect\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColReflect(int height) : last_row(height - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdColReflect(int height, U) : last_row(height - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return (::abs(y) - (y < 0)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::abs(last_row - ::abs(last_row - y) + (y > last_row)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_high(::abs(y) - (y < 0));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_low(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_high(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row(y) * step));\n        }\n\n        const int last_row;\n    };\n\n    template <typename D> struct BrdReflect\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdReflect(int height, int width) : last_row(height - 1), last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdReflect(int height, int width, U) : last_row(height - 1), last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return (::abs(y) - (y < 0)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return /*::abs*/(last_row - ::abs(last_row - y) + (y > last_row)) /*% (last_row + 1)*/;\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return (::abs(x) - (x < 0)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return (last_col - ::abs(last_col - x) + (x > last_col));\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return saturate_cast<D>(src(idx_row(y), idx_col(x)));\n        }\n\n        const int last_row;\n        const int last_col;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BrdWrap\n\n    template <typename D> struct BrdRowWrap\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowWrap(int width_) : width(width_) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdRowWrap(int width_, U) : width(width_) {}\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return (x >= 0) * x + (x < 0) * (x - ((x - width + 1) / width) * width);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return (x < width) * x + (x >= width) * (x % width);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_high(idx_col_low(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_low(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_high(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col(x)]);\n        }\n\n        const int width;\n    };\n\n    template <typename D> struct BrdColWrap\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColWrap(int height_) : height(height_) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdColWrap(int height_, U) : height(height_) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return (y >= 0) * y + (y < 0) * (y - ((y - height + 1) / height) * height);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return (y < height) * y + (y >= height) * (y % height);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_high(idx_row_low(y));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_low(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_high(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row(y) * step));\n        }\n\n        const int height;\n    };\n\n    template <typename D> struct BrdWrap\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdWrap(int height_, int width_) :\n            height(height_), width(width_)\n        {\n        }\n        template <typename U>\n        __host__ __device__ __forceinline__ BrdWrap(int height_, int width_, U) :\n            height(height_), width(width_)\n        {\n        }\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return (y >= 0) ? y : (y - ((y - height + 1) / height) * height);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return (y < height) ? y : (y % height);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_high(idx_row_low(y));\n        }\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return (x >= 0) ? x : (x - ((x - width + 1) / width) * width);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return (x < width) ? x : (x % width);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_high(idx_col_low(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return saturate_cast<D>(src(idx_row(y), idx_col(x)));\n        }\n\n        const int height;\n        const int width;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BorderReader\n\n    template <typename Ptr2D, typename B> struct BorderReader\n    {\n        typedef typename B::result_type elem_type;\n        typedef typename Ptr2D::index_type index_type;\n\n        __host__ __device__ __forceinline__ BorderReader(const Ptr2D& ptr_, const B& b_) : ptr(ptr_), b(b_) {}\n\n        __device__ __forceinline__ elem_type operator ()(index_type y, index_type x) const\n        {\n            return b.at(y, x, ptr);\n        }\n\n        const Ptr2D ptr;\n        const B b;\n    };\n\n    // under win32 there is some bug with templated types that passed as kernel parameters\n    // with this specialization all works fine\n    template <typename Ptr2D, typename D> struct BorderReader< Ptr2D, BrdConstant<D> >\n    {\n        typedef typename BrdConstant<D>::result_type elem_type;\n        typedef typename Ptr2D::index_type index_type;\n\n        __host__ __device__ __forceinline__ BorderReader(const Ptr2D& src_, const BrdConstant<D>& b) :\n            src(src_), height(b.height), width(b.width), val(b.val)\n        {\n        }\n\n        __device__ __forceinline__ D operator ()(index_type y, index_type x) const\n        {\n            return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast<D>(src(y, x)) : val;\n        }\n\n        const Ptr2D src;\n        const int height;\n        const int width;\n        const D val;\n    };\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_BORDER_INTERPOLATE_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/color.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_COLOR_HPP__\n#define __OPENCV_GPU_COLOR_HPP__\n\n#include \"detail/color_detail.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    // All OPENCV_GPU_IMPLEMENT_*_TRAITS(ColorSpace1_to_ColorSpace2, ...) macros implements\n    // template <typename T> class ColorSpace1_to_ColorSpace2_traits\n    // {\n    //     typedef ... functor_type;\n    //     static __host__ __device__ functor_type create_functor();\n    // };\n\n    OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS(bgr_to_rgb, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS(bgr_to_bgra, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS(bgr_to_rgba, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS(bgra_to_bgr, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS(bgra_to_rgb, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS(bgra_to_rgba, 4, 4, 2)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(bgr_to_bgr555, 3, 0, 5)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(bgr_to_bgr565, 3, 0, 6)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(rgb_to_bgr555, 3, 2, 5)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(rgb_to_bgr565, 3, 2, 6)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(bgra_to_bgr555, 4, 0, 5)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(bgra_to_bgr565, 4, 0, 6)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(rgba_to_bgr555, 4, 2, 5)\n    OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(rgba_to_bgr565, 4, 2, 6)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(bgr555_to_rgb, 3, 2, 5)\n    OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(bgr565_to_rgb, 3, 2, 6)\n    OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(bgr555_to_bgr, 3, 0, 5)\n    OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(bgr565_to_bgr, 3, 0, 6)\n    OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(bgr555_to_rgba, 4, 2, 5)\n    OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(bgr565_to_rgba, 4, 2, 6)\n    OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(bgr555_to_bgra, 4, 0, 5)\n    OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(bgr565_to_bgra, 4, 0, 6)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_GRAY2RGB_TRAITS(gray_to_bgr, 3)\n    OPENCV_GPU_IMPLEMENT_GRAY2RGB_TRAITS(gray_to_bgra, 4)\n\n    #undef OPENCV_GPU_IMPLEMENT_GRAY2RGB_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_GRAY2RGB5x5_TRAITS(gray_to_bgr555, 5)\n    OPENCV_GPU_IMPLEMENT_GRAY2RGB5x5_TRAITS(gray_to_bgr565, 6)\n\n    #undef OPENCV_GPU_IMPLEMENT_GRAY2RGB5x5_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB5x52GRAY_TRAITS(bgr555_to_gray, 5)\n    OPENCV_GPU_IMPLEMENT_RGB5x52GRAY_TRAITS(bgr565_to_gray, 6)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB5x52GRAY_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB2GRAY_TRAITS(rgb_to_gray, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2GRAY_TRAITS(bgr_to_gray, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2GRAY_TRAITS(rgba_to_gray, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2GRAY_TRAITS(bgra_to_gray, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2GRAY_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgb_to_yuv, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgba_to_yuv, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgb_to_yuv4, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgba_to_yuv4, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgr_to_yuv, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgra_to_yuv, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgr_to_yuv4, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgra_to_yuv4, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_rgb, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_rgba, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_rgb, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_rgba, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_bgr, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_bgra, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_bgr, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(rgb_to_YCrCb, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(rgba_to_YCrCb, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(rgb_to_YCrCb4, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(rgba_to_YCrCb4, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(bgr_to_YCrCb, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(bgra_to_YCrCb, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(bgr_to_YCrCb4, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(bgra_to_YCrCb4, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb_to_rgb, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb_to_rgba, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb4_to_rgb, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb4_to_rgba, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb_to_bgr, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb_to_bgra, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb4_to_bgr, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(rgb_to_xyz, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(rgba_to_xyz, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(rgb_to_xyz4, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(rgba_to_xyz4, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(bgr_to_xyz, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(bgra_to_xyz, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(bgr_to_xyz4, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(bgra_to_xyz4, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(xyz_to_rgb, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(xyz4_to_rgb, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(xyz_to_rgba, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(xyz4_to_rgba, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(xyz_to_bgr, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(xyz4_to_bgr, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(xyz_to_bgra, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(xyz4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(rgb_to_hsv, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(rgba_to_hsv, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(rgb_to_hsv4, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(rgba_to_hsv4, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(bgr_to_hsv, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(bgra_to_hsv, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(bgr_to_hsv4, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(bgra_to_hsv4, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(hsv_to_rgb, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(hsv_to_rgba, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(hsv4_to_rgb, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(hsv4_to_rgba, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(hsv_to_bgr, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(hsv_to_bgra, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(hsv4_to_bgr, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(hsv4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(rgb_to_hls, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(rgba_to_hls, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(rgb_to_hls4, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(rgba_to_hls4, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(bgr_to_hls, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(bgra_to_hls, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(bgr_to_hls4, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(bgra_to_hls4, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(hls_to_rgb, 3, 3, 2)\n    OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(hls_to_rgba, 3, 4, 2)\n    OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(hls4_to_rgb, 4, 3, 2)\n    OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(hls4_to_rgba, 4, 4, 2)\n    OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(hls_to_bgr, 3, 3, 0)\n    OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(hls_to_bgra, 3, 4, 0)\n    OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(hls4_to_bgr, 4, 3, 0)\n    OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(hls4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(rgb_to_lab, 3, 3, true, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(rgba_to_lab, 4, 3, true, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(rgb_to_lab4, 3, 4, true, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(rgba_to_lab4, 4, 4, true, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(bgr_to_lab, 3, 3, true, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(bgra_to_lab, 4, 3, true, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(bgr_to_lab4, 3, 4, true, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(bgra_to_lab4, 4, 4, true, 0)\n\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(lrgb_to_lab, 3, 3, false, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(lrgba_to_lab, 4, 3, false, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(lrgb_to_lab4, 3, 4, false, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(lrgba_to_lab4, 4, 4, false, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(lbgr_to_lab, 3, 3, false, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(lbgra_to_lab, 4, 3, false, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(lbgr_to_lab4, 3, 4, false, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(lbgra_to_lab4, 4, 4, false, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab_to_rgb, 3, 3, true, 2)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_rgb, 4, 3, true, 2)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab_to_rgba, 3, 4, true, 2)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_rgba, 4, 4, true, 2)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab_to_bgr, 3, 3, true, 0)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_bgr, 4, 3, true, 0)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab_to_bgra, 3, 4, true, 0)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_bgra, 4, 4, true, 0)\n\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab_to_lrgb, 3, 3, false, 2)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_lrgb, 4, 3, false, 2)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab_to_lrgba, 3, 4, false, 2)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_lrgba, 4, 4, false, 2)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab_to_lbgr, 3, 3, false, 0)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_lbgr, 4, 3, false, 0)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab_to_lbgra, 3, 4, false, 0)\n    OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_lbgra, 4, 4, false, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(rgb_to_luv, 3, 3, true, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(rgba_to_luv, 4, 3, true, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(rgb_to_luv4, 3, 4, true, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(rgba_to_luv4, 4, 4, true, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(bgr_to_luv, 3, 3, true, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(bgra_to_luv, 4, 3, true, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(bgr_to_luv4, 3, 4, true, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(bgra_to_luv4, 4, 4, true, 0)\n\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(lrgb_to_luv, 3, 3, false, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(lrgba_to_luv, 4, 3, false, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(lrgb_to_luv4, 3, 4, false, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(lrgba_to_luv4, 4, 4, false, 2)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(lbgr_to_luv, 3, 3, false, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(lbgra_to_luv, 4, 3, false, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(lbgr_to_luv4, 3, 4, false, 0)\n    OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(lbgra_to_luv4, 4, 4, false, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS\n\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv_to_rgb, 3, 3, true, 2)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_rgb, 4, 3, true, 2)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv_to_rgba, 3, 4, true, 2)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_rgba, 4, 4, true, 2)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv_to_bgr, 3, 3, true, 0)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_bgr, 4, 3, true, 0)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv_to_bgra, 3, 4, true, 0)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_bgra, 4, 4, true, 0)\n\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv_to_lrgb, 3, 3, false, 2)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_lrgb, 4, 3, false, 2)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv_to_lrgba, 3, 4, false, 2)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_lrgba, 4, 4, false, 2)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv_to_lbgr, 3, 3, false, 0)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_lbgr, 4, 3, false, 0)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv_to_lbgra, 3, 4, false, 0)\n    OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_lbgra, 4, 4, false, 0)\n\n    #undef OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_BORDER_INTERPOLATE_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/common.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_COMMON_HPP__\n#define __OPENCV_GPU_COMMON_HPP__\n\n#include <cuda_runtime.h>\n#include \"opencv2/core/cuda_devptrs.hpp\"\n\n#ifndef CV_PI\n    #define CV_PI   3.1415926535897932384626433832795\n#endif\n\n#ifndef CV_PI_F\n    #ifndef CV_PI\n        #define CV_PI_F 3.14159265f\n    #else\n        #define CV_PI_F ((float)CV_PI)\n    #endif\n#endif\n\n#if defined(__GNUC__)\n    #define cudaSafeCall(expr)  ___cudaSafeCall(expr, __FILE__, __LINE__, __func__)\n#else /* defined(__CUDACC__) || defined(__MSVC__) */\n    #define cudaSafeCall(expr)  ___cudaSafeCall(expr, __FILE__, __LINE__)\n#endif\n\nnamespace cv { namespace gpu\n{\n    void error(const char *error_string, const char *file, const int line, const char *func);\n\n    template <typename T> static inline bool isAligned(const T* ptr, size_t size)\n    {\n        return reinterpret_cast<size_t>(ptr) % size == 0;\n    }\n\n    static inline bool isAligned(size_t step, size_t size)\n    {\n        return step % size == 0;\n    }\n}}\n\nstatic inline void ___cudaSafeCall(cudaError_t err, const char *file, const int line, const char *func = \"\")\n{\n    if (cudaSuccess != err)\n        cv::gpu::error(cudaGetErrorString(err), file, line, func);\n}\n\nnamespace cv { namespace gpu\n{\n    __host__ __device__ __forceinline__ int divUp(int total, int grain)\n    {\n        return (total + grain - 1) / grain;\n    }\n\n    namespace device\n    {\n        using cv::gpu::divUp;\n\n#ifdef __CUDACC__\n        typedef unsigned char uchar;\n        typedef unsigned short ushort;\n        typedef signed char schar;\n        #if defined (_WIN32) || defined (__APPLE__)\n            typedef unsigned int uint;\n        #endif\n\n        template<class T> inline void bindTexture(const textureReference* tex, const PtrStepSz<T>& img)\n        {\n            cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();\n            cudaSafeCall( cudaBindTexture2D(0, tex, img.ptr(), &desc, img.cols, img.rows, img.step) );\n        }\n#endif // __CUDACC__\n    }\n}}\n\n\n\n#endif // __OPENCV_GPU_COMMON_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/datamov_utils.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_DATAMOV_UTILS_HPP__\n#define __OPENCV_GPU_DATAMOV_UTILS_HPP__\n\n#include \"common.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 200\n\n        // for Fermi memory space is detected automatically\n        template <typename T> struct ForceGlob\n        {\n            __device__ __forceinline__ static void Load(const T* ptr, int offset, T& val)  { val = ptr[offset];  }\n        };\n\n    #else // __CUDA_ARCH__ >= 200\n\n        #if defined(_WIN64) || defined(__LP64__)\n            // 64-bit register modifier for inlined asm\n            #define OPENCV_GPU_ASM_PTR \"l\"\n        #else\n            // 32-bit register modifier for inlined asm\n            #define OPENCV_GPU_ASM_PTR \"r\"\n        #endif\n\n        template<class T> struct ForceGlob;\n\n        #define OPENCV_GPU_DEFINE_FORCE_GLOB(base_type, ptx_type, reg_mod) \\\n            template <> struct ForceGlob<base_type> \\\n            { \\\n                __device__ __forceinline__ static void Load(const base_type* ptr, int offset, base_type& val) \\\n                { \\\n                    asm(\"ld.global.\"#ptx_type\" %0, [%1];\" : \"=\"#reg_mod(val) : OPENCV_GPU_ASM_PTR(ptr + offset)); \\\n                } \\\n            };\n\n        #define OPENCV_GPU_DEFINE_FORCE_GLOB_B(base_type, ptx_type) \\\n            template <> struct ForceGlob<base_type> \\\n            { \\\n                __device__ __forceinline__ static void Load(const base_type* ptr, int offset, base_type& val) \\\n                { \\\n                    asm(\"ld.global.\"#ptx_type\" %0, [%1];\" : \"=r\"(*reinterpret_cast<uint*>(&val)) : OPENCV_GPU_ASM_PTR(ptr + offset)); \\\n                } \\\n            };\n\n            OPENCV_GPU_DEFINE_FORCE_GLOB_B(uchar,  u8)\n            OPENCV_GPU_DEFINE_FORCE_GLOB_B(schar,  s8)\n            OPENCV_GPU_DEFINE_FORCE_GLOB_B(char,   b8)\n            OPENCV_GPU_DEFINE_FORCE_GLOB  (ushort, u16, h)\n            OPENCV_GPU_DEFINE_FORCE_GLOB  (short,  s16, h)\n            OPENCV_GPU_DEFINE_FORCE_GLOB  (uint,   u32, r)\n            OPENCV_GPU_DEFINE_FORCE_GLOB  (int,    s32, r)\n            OPENCV_GPU_DEFINE_FORCE_GLOB  (float,  f32, f)\n            OPENCV_GPU_DEFINE_FORCE_GLOB  (double, f64, d)\n\n        #undef OPENCV_GPU_DEFINE_FORCE_GLOB\n        #undef OPENCV_GPU_DEFINE_FORCE_GLOB_B\n        #undef OPENCV_GPU_ASM_PTR\n\n    #endif // __CUDA_ARCH__ >= 200\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_DATAMOV_UTILS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/detail/color_detail.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_COLOR_DETAIL_HPP__\n#define __OPENCV_GPU_COLOR_DETAIL_HPP__\n\n#include \"../common.hpp\"\n#include \"../vec_traits.hpp\"\n#include \"../saturate_cast.hpp\"\n#include \"../limits.hpp\"\n#include \"../functional.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    #ifndef CV_DESCALE\n        #define CV_DESCALE(x, n) (((x) + (1 << ((n)-1))) >> (n))\n    #endif\n\n    namespace color_detail\n    {\n        template<typename T> struct ColorChannel\n        {\n            typedef float worktype_f;\n            static __device__ __forceinline__ T max() { return numeric_limits<T>::max(); }\n            static __device__ __forceinline__ T half() { return (T)(max()/2 + 1); }\n        };\n\n        template<> struct ColorChannel<float>\n        {\n            typedef float worktype_f;\n            static __device__ __forceinline__ float max() { return 1.f; }\n            static __device__ __forceinline__ float half() { return 0.5f; }\n        };\n\n        template <typename T> static __device__ __forceinline__ void setAlpha(typename TypeVec<T, 3>::vec_type& vec, T val)\n        {\n        }\n\n        template <typename T> static __device__ __forceinline__ void setAlpha(typename TypeVec<T, 4>::vec_type& vec, T val)\n        {\n            vec.w = val;\n        }\n\n        template <typename T> static __device__ __forceinline__ T getAlpha(const typename TypeVec<T, 3>::vec_type& vec)\n        {\n            return ColorChannel<T>::max();\n        }\n\n        template <typename T> static __device__ __forceinline__ T getAlpha(const typename TypeVec<T, 4>::vec_type& vec)\n        {\n            return vec.w;\n        }\n\n        enum\n        {\n            yuv_shift  = 14,\n            xyz_shift  = 12,\n            R2Y        = 4899,\n            G2Y        = 9617,\n            B2Y        = 1868,\n            BLOCK_SIZE = 256\n        };\n    }\n\n////////////////// Various 3/4-channel to 3/4-channel RGB transformations /////////////////\n\n    namespace color_detail\n    {\n        template <typename T, int scn, int dcn, int bidx> struct RGB2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                dst.x = bidx == 0 ? src.x : src.z;\n                dst.y = src.y;\n                dst.z = bidx == 0 ? src.z : src.x;\n                setAlpha(dst, getAlpha<T>(src));\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2RGB() {}\n            __host__ __device__ __forceinline__ RGB2RGB(const RGB2RGB&) {}\n        };\n\n        template <> struct RGB2RGB<uchar, 4, 4, 2> : unary_function<uint, uint>\n        {\n            __device__ uint operator()(uint src) const\n            {\n                uint dst = 0;\n\n                dst |= (0xffu & (src >> 16));\n                dst |= (0xffu & (src >> 8)) << 8;\n                dst |= (0xffu & (src)) << 16;\n                dst |= (0xffu & (src >> 24)) << 24;\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2RGB() {}\n            __host__ __device__ __forceinline__ RGB2RGB(const RGB2RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2RGB<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n/////////// Transforming 16-bit (565 or 555) RGB to/from 24/32-bit (888[8]) RGB //////////\n\n    namespace color_detail\n    {\n        template <int green_bits, int bidx> struct RGB2RGB5x5Converter;\n\n        template<int bidx> struct RGB2RGB5x5Converter<6, bidx>\n        {\n            template <typename T>\n            static __device__ __forceinline__ ushort cvt(const T& src)\n            {\n                uint b = bidx == 0 ? src.x : src.z;\n                uint g = src.y;\n                uint r = bidx == 0 ? src.z : src.x;\n                return (ushort)((b >> 3) | ((g & ~3) << 3) | ((r & ~7) << 8));\n            }\n        };\n\n        template<int bidx> struct RGB2RGB5x5Converter<5, bidx>\n        {\n            static __device__ __forceinline__ ushort cvt(const uchar3& src)\n            {\n                uint b = bidx == 0 ? src.x : src.z;\n                uint g = src.y;\n                uint r = bidx == 0 ? src.z : src.x;\n                return (ushort)((b >> 3) | ((g & ~7) << 2) | ((r & ~7) << 7));\n            }\n\n            static __device__ __forceinline__ ushort cvt(const uchar4& src)\n            {\n                uint b = bidx == 0 ? src.x : src.z;\n                uint g = src.y;\n                uint r = bidx == 0 ? src.z : src.x;\n                uint a = src.w;\n                return (ushort)((b >> 3) | ((g & ~7) << 2) | ((r & ~7) << 7) | (a * 0x8000));\n            }\n        };\n\n        template<int scn, int bidx, int green_bits> struct RGB2RGB5x5:\n            unary_function<typename TypeVec<uchar, scn>::vec_type, ushort>\n        {\n            __device__ __forceinline__ ushort operator()(const typename TypeVec<uchar, scn>::vec_type& src) const\n            {\n                return RGB2RGB5x5Converter<green_bits, bidx>::cvt(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2RGB5x5() {}\n            __host__ __device__ __forceinline__ RGB2RGB5x5(const RGB2RGB5x5&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2RGB5x5_TRAITS(name, scn, bidx, green_bits) \\\n    struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2RGB5x5<scn, bidx, green_bits> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        template <int green_bits, int bidx> struct RGB5x52RGBConverter;\n\n        template <int bidx> struct RGB5x52RGBConverter<5, bidx>\n        {\n            static __device__ __forceinline__ void cvt(uint src, uchar3& dst)\n            {\n                (bidx == 0 ? dst.x : dst.z) = src << 3;\n                dst.y                       = (src >> 2) & ~7;\n                (bidx == 0 ? dst.z : dst.x) = (src >> 7) & ~7;\n            }\n\n            static __device__ __forceinline__ void cvt(uint src, uint& dst)\n            {\n                dst = 0;\n\n                dst |= (0xffu & (src << 3)) << (bidx * 8);\n                dst |= (0xffu & ((src >> 2) & ~7)) << 8;\n                dst |= (0xffu & ((src >> 7) & ~7)) << ((bidx ^ 2) * 8);\n                dst |= ((src & 0x8000) * 0xffu) << 24;\n            }\n        };\n\n        template <int bidx> struct RGB5x52RGBConverter<6, bidx>\n        {\n            static __device__ __forceinline__ void cvt(uint src, uchar3& dst)\n            {\n                (bidx == 0 ? dst.x : dst.z) = src << 3;\n                dst.y                       = (src >> 3) & ~3;\n                (bidx == 0 ? dst.z : dst.x) = (src >> 8) & ~7;\n            }\n\n            static __device__ __forceinline__ void cvt(uint src, uint& dst)\n            {\n                dst = 0xffu << 24;\n\n                dst |= (0xffu & (src << 3)) << (bidx * 8);\n                dst |= (0xffu &((src >> 3) & ~3)) << 8;\n                dst |= (0xffu & ((src >> 8) & ~7)) << ((bidx ^ 2) * 8);\n            }\n        };\n\n        template <int dcn, int bidx, int green_bits> struct RGB5x52RGB;\n\n        template <int bidx, int green_bits> struct RGB5x52RGB<3, bidx, green_bits> : unary_function<ushort, uchar3>\n        {\n            __device__ __forceinline__ uchar3 operator()(ushort src) const\n            {\n                uchar3 dst;\n                RGB5x52RGBConverter<green_bits, bidx>::cvt(src, dst);\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB5x52RGB() {}\n            __host__ __device__ __forceinline__ RGB5x52RGB(const RGB5x52RGB&) {}\n        };\n\n        template <int bidx, int green_bits> struct RGB5x52RGB<4, bidx, green_bits> : unary_function<ushort, uint>\n        {\n            __device__ __forceinline__ uint operator()(ushort src) const\n            {\n                uint dst;\n                RGB5x52RGBConverter<green_bits, bidx>::cvt(src, dst);\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB5x52RGB() {}\n            __host__ __device__ __forceinline__ RGB5x52RGB(const RGB5x52RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB5x52RGB_TRAITS(name, dcn, bidx, green_bits) \\\n    struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB5x52RGB<dcn, bidx, green_bits> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////// Grayscale to Color ////////////////////////////////\n\n    namespace color_detail\n    {\n        template <typename T, int dcn> struct Gray2RGB : unary_function<T, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(T src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                dst.z = dst.y = dst.x = src;\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ Gray2RGB() {}\n            __host__ __device__ __forceinline__ Gray2RGB(const Gray2RGB&) {}\n        };\n\n        template <> struct Gray2RGB<uchar, 4> : unary_function<uchar, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                uint dst = 0xffu << 24;\n\n                dst |= src;\n                dst |= src << 8;\n                dst |= src << 16;\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ Gray2RGB() {}\n            __host__ __device__ __forceinline__ Gray2RGB(const Gray2RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_GRAY2RGB_TRAITS(name, dcn) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::Gray2RGB<T, dcn> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        template <int green_bits> struct Gray2RGB5x5Converter;\n\n        template<> struct Gray2RGB5x5Converter<6>\n        {\n            static __device__ __forceinline__ ushort cvt(uint t)\n            {\n                return (ushort)((t >> 3) | ((t & ~3) << 3) | ((t & ~7) << 8));\n            }\n        };\n\n        template<> struct Gray2RGB5x5Converter<5>\n        {\n            static __device__ __forceinline__ ushort cvt(uint t)\n            {\n                t >>= 3;\n                return (ushort)(t | (t << 5) | (t << 10));\n            }\n        };\n\n        template<int green_bits> struct Gray2RGB5x5 : unary_function<uchar, ushort>\n        {\n            __device__ __forceinline__ ushort operator()(uint src) const\n            {\n                return Gray2RGB5x5Converter<green_bits>::cvt(src);\n            }\n\n            __host__ __device__ __forceinline__ Gray2RGB5x5() {}\n            __host__ __device__ __forceinline__ Gray2RGB5x5(const Gray2RGB5x5&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_GRAY2RGB5x5_TRAITS(name, green_bits) \\\n    struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::Gray2RGB5x5<green_bits> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////// Color to Grayscale ////////////////////////////////\n\n    namespace color_detail\n    {\n        template <int green_bits> struct RGB5x52GrayConverter;\n\n        template <> struct RGB5x52GrayConverter<6>\n        {\n            static __device__ __forceinline__ uchar cvt(uint t)\n            {\n                return (uchar)CV_DESCALE(((t << 3) & 0xf8) * B2Y + ((t >> 3) & 0xfc) * G2Y + ((t >> 8) & 0xf8) * R2Y, yuv_shift);\n            }\n        };\n\n        template <> struct RGB5x52GrayConverter<5>\n        {\n            static __device__ __forceinline__ uchar cvt(uint t)\n            {\n                return (uchar)CV_DESCALE(((t << 3) & 0xf8) * B2Y + ((t >> 2) & 0xf8) * G2Y + ((t >> 7) & 0xf8) * R2Y, yuv_shift);\n            }\n        };\n\n        template<int green_bits> struct RGB5x52Gray : unary_function<ushort, uchar>\n        {\n            __device__ __forceinline__ uchar operator()(uint src) const\n            {\n                return RGB5x52GrayConverter<green_bits>::cvt(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB5x52Gray() {}\n            __host__ __device__ __forceinline__ RGB5x52Gray(const RGB5x52Gray&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB5x52GRAY_TRAITS(name, green_bits) \\\n    struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB5x52Gray<green_bits> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        template <int bidx, typename T> static __device__ __forceinline__ uint RGB2GrayConvert_8U(const T& src)\n        {\n            uint b = bidx == 0 ? src.x : src.z;\n            uint g = src.y;\n            uint r = bidx == 0 ? src.z : src.x;\n            return CV_DESCALE((uint)(b * B2Y + g * G2Y + r * R2Y), yuv_shift);\n        }\n\n        template <int bidx> static __device__ __forceinline__ uchar RGB2GrayConvert_8UC4(uint src)\n        {\n            uint b = 0xffu & (src >> (bidx * 8));\n            uint g = 0xffu & (src >> 8);\n            uint r = 0xffu & (src >> ((bidx ^ 2) * 8));\n            return CV_DESCALE((uint)(b * B2Y + g * G2Y + r * R2Y), yuv_shift);\n        }\n\n        template <int bidx, typename T> static __device__ __forceinline__ float RGB2GrayConvert_32F(const T& src)\n        {\n            float b = bidx == 0 ? src.x : src.z;\n            float g = src.y;\n            float r = bidx == 0 ? src.z : src.x;\n            return b * 0.114f + g * 0.587f + r * 0.299f;\n        }\n\n        template <typename T, int scn, int bidx> struct RGB2Gray : unary_function<typename TypeVec<T, scn>::vec_type, T>\n        {\n            __device__ __forceinline__ T operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                return RGB2GrayConvert_8U<bidx>(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2Gray() {}\n            __host__ __device__ __forceinline__ RGB2Gray(const RGB2Gray&) {}\n        };\n\n        template <int scn, int bidx> struct RGB2Gray<float, scn, bidx> :\n            unary_function<typename TypeVec<float, scn>::vec_type, float>\n        {\n            __device__ __forceinline__ float operator()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                return RGB2GrayConvert_32F<bidx>(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2Gray() {}\n            __host__ __device__ __forceinline__ RGB2Gray(const RGB2Gray&) {}\n        };\n\n        template <int bidx> struct RGB2Gray<uchar, 4, bidx> : unary_function<uint, uchar>\n        {\n            __device__ __forceinline__ uchar operator()(uint src) const\n            {\n                return RGB2GrayConvert_8UC4<bidx>(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2Gray() {}\n            __host__ __device__ __forceinline__ RGB2Gray(const RGB2Gray&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2GRAY_TRAITS(name, scn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2Gray<T, scn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////////// RGB <-> YUV //////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ float c_RGB2YUVCoeffs_f[5] = { 0.114f, 0.587f, 0.299f, 0.492f, 0.877f };\n        __constant__ int   c_RGB2YUVCoeffs_i[5] = { B2Y, G2Y, R2Y, 8061, 14369 };\n\n        template <int bidx, typename T, typename D> static __device__ void RGB2YUVConvert(const T& src, D& dst)\n        {\n            const int delta = ColorChannel<typename VecTraits<T>::elem_type>::half() * (1 << yuv_shift);\n\n            const int b = bidx == 0 ? src.x : src.z;\n            const int g = src.y;\n            const int r = bidx == 0 ? src.z : src.x;\n\n            const int Y = CV_DESCALE(b * c_RGB2YUVCoeffs_i[2] + g * c_RGB2YUVCoeffs_i[1] + r * c_RGB2YUVCoeffs_i[0], yuv_shift);\n            const int Cr = CV_DESCALE((r - Y) * c_RGB2YUVCoeffs_i[3] + delta, yuv_shift);\n            const int Cb = CV_DESCALE((b - Y) * c_RGB2YUVCoeffs_i[4] + delta, yuv_shift);\n\n            dst.x = saturate_cast<typename VecTraits<T>::elem_type>(Y);\n            dst.y = saturate_cast<typename VecTraits<T>::elem_type>(Cr);\n            dst.z = saturate_cast<typename VecTraits<T>::elem_type>(Cb);\n        }\n\n        template <int bidx, typename T, typename D> static __device__ __forceinline__ void RGB2YUVConvert_32F(const T& src, D& dst)\n        {\n            const float b = bidx == 0 ? src.x : src.z;\n            const float g = src.y;\n            const float r = bidx == 0 ? src.z : src.x;\n\n            dst.x = b * c_RGB2YUVCoeffs_f[2] + g * c_RGB2YUVCoeffs_f[1] + r * c_RGB2YUVCoeffs_f[0];\n            dst.y = (r - dst.x) * c_RGB2YUVCoeffs_f[3] + ColorChannel<float>::half();\n            dst.z = (b - dst.x) * c_RGB2YUVCoeffs_f[4] + ColorChannel<float>::half();\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct RGB2YUV\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator ()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n                RGB2YUVConvert<bidx>(src, dst);\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2YUV() {}\n            __host__ __device__ __forceinline__ RGB2YUV(const RGB2YUV&) {}\n        };\n\n        template <int scn, int dcn, int bidx> struct RGB2YUV<float, scn, dcn, bidx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n                RGB2YUVConvert_32F<bidx>(src, dst);\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2YUV() {}\n            __host__ __device__ __forceinline__ RGB2YUV(const RGB2YUV&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2YUV<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ float c_YUV2RGBCoeffs_f[5] = { 2.032f, -0.395f, -0.581f, 1.140f };\n        __constant__ int   c_YUV2RGBCoeffs_i[5] = { 33292, -6472, -9519, 18678 };\n\n        template <int bidx, typename T, typename D> static __device__ void YUV2RGBConvert(const T& src, D& dst)\n        {\n            const int b = src.x + CV_DESCALE((src.z - ColorChannel<typename VecTraits<D>::elem_type>::half()) * c_YUV2RGBCoeffs_i[3], yuv_shift);\n\n            const int g = src.x + CV_DESCALE((src.z - ColorChannel<typename VecTraits<D>::elem_type>::half()) * c_YUV2RGBCoeffs_i[2]\n                                             + (src.y - ColorChannel<typename VecTraits<D>::elem_type>::half()) * c_YUV2RGBCoeffs_i[1], yuv_shift);\n\n            const int r = src.x + CV_DESCALE((src.y - ColorChannel<typename VecTraits<D>::elem_type>::half()) * c_YUV2RGBCoeffs_i[0], yuv_shift);\n\n            (bidx == 0 ? dst.x : dst.z) = saturate_cast<typename VecTraits<D>::elem_type>(b);\n            dst.y                       = saturate_cast<typename VecTraits<D>::elem_type>(g);\n            (bidx == 0 ? dst.z : dst.x) = saturate_cast<typename VecTraits<D>::elem_type>(r);\n        }\n\n        template <int bidx> static __device__ uint YUV2RGBConvert_8UC4(uint src)\n        {\n            const int x = 0xff & (src);\n            const int y = 0xff & (src >> 8);\n            const int z = 0xff & (src >> 16);\n\n            const int b = x + CV_DESCALE((z - ColorChannel<uchar>::half()) * c_YUV2RGBCoeffs_i[3], yuv_shift);\n\n            const int g = x + CV_DESCALE((z - ColorChannel<uchar>::half()) * c_YUV2RGBCoeffs_i[2]\n                                         + (y - ColorChannel<uchar>::half()) * c_YUV2RGBCoeffs_i[1], yuv_shift);\n\n            const int r = x + CV_DESCALE((y - ColorChannel<uchar>::half()) * c_YUV2RGBCoeffs_i[0], yuv_shift);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(b) << (bidx * 8);\n            dst |= saturate_cast<uchar>(g) << 8;\n            dst |= saturate_cast<uchar>(r) << ((bidx ^ 2) * 8);\n\n            return dst;\n        }\n\n        template <int bidx, typename T, typename D> static __device__ __forceinline__ void YUV2RGBConvert_32F(const T& src, D& dst)\n        {\n            (bidx == 0 ? dst.x : dst.z) = src.x + (src.z - ColorChannel<float>::half()) * c_YUV2RGBCoeffs_f[3];\n\n            dst.y                       = src.x + (src.z - ColorChannel<float>::half()) * c_YUV2RGBCoeffs_f[2]\n                                          + (src.y - ColorChannel<float>::half()) * c_YUV2RGBCoeffs_f[1];\n\n            (bidx == 0 ? dst.z : dst.x) = src.x + (src.y - ColorChannel<float>::half()) * c_YUV2RGBCoeffs_f[0];\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct YUV2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator ()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                YUV2RGBConvert<bidx>(src, dst);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ YUV2RGB() {}\n            __host__ __device__ __forceinline__ YUV2RGB(const YUV2RGB&) {}\n        };\n\n        template <int scn, int dcn, int bidx> struct YUV2RGB<float, scn, dcn, bidx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                YUV2RGBConvert_32F<bidx>(src, dst);\n                setAlpha(dst, ColorChannel<float>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ YUV2RGB() {}\n            __host__ __device__ __forceinline__ YUV2RGB(const YUV2RGB&) {}\n        };\n\n        template <int bidx> struct YUV2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator ()(uint src) const\n            {\n                return YUV2RGBConvert_8UC4<bidx>(src);\n            }\n\n            __host__ __device__ __forceinline__ YUV2RGB() {}\n            __host__ __device__ __forceinline__ YUV2RGB(const YUV2RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::YUV2RGB<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////////// RGB <-> YCrCb //////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ float c_RGB2YCrCbCoeffs_f[5] = {0.299f, 0.587f, 0.114f, 0.713f, 0.564f};\n        __constant__ int   c_RGB2YCrCbCoeffs_i[5] = {R2Y, G2Y, B2Y, 11682, 9241};\n\n        template <int bidx, typename T, typename D> static __device__ void RGB2YCrCbConvert(const T& src, D& dst)\n        {\n            const int delta = ColorChannel<typename VecTraits<T>::elem_type>::half() * (1 << yuv_shift);\n\n            const int b = bidx == 0 ? src.x : src.z;\n            const int g = src.y;\n            const int r = bidx == 0 ? src.z : src.x;\n\n            const int Y = CV_DESCALE(b * c_RGB2YCrCbCoeffs_i[2] + g * c_RGB2YCrCbCoeffs_i[1] + r * c_RGB2YCrCbCoeffs_i[0], yuv_shift);\n            const int Cr = CV_DESCALE((r - Y) * c_RGB2YCrCbCoeffs_i[3] + delta, yuv_shift);\n            const int Cb = CV_DESCALE((b - Y) * c_RGB2YCrCbCoeffs_i[4] + delta, yuv_shift);\n\n            dst.x = saturate_cast<typename VecTraits<T>::elem_type>(Y);\n            dst.y = saturate_cast<typename VecTraits<T>::elem_type>(Cr);\n            dst.z = saturate_cast<typename VecTraits<T>::elem_type>(Cb);\n        }\n\n        template <int bidx> static __device__ uint RGB2YCrCbConvert_8UC4(uint src)\n        {\n            const int delta = ColorChannel<uchar>::half() * (1 << yuv_shift);\n\n            const int Y = CV_DESCALE((0xffu & src) * c_RGB2YCrCbCoeffs_i[bidx^2] + (0xffu & (src >> 8)) * c_RGB2YCrCbCoeffs_i[1] + (0xffu & (src >> 16)) * c_RGB2YCrCbCoeffs_i[bidx], yuv_shift);\n            const int Cr = CV_DESCALE(((0xffu & (src >> ((bidx ^ 2) * 8))) - Y) * c_RGB2YCrCbCoeffs_i[3] + delta, yuv_shift);\n            const int Cb = CV_DESCALE(((0xffu & (src >> (bidx * 8))) - Y) * c_RGB2YCrCbCoeffs_i[4] + delta, yuv_shift);\n\n            uint dst = 0;\n\n            dst |= saturate_cast<uchar>(Y);\n            dst |= saturate_cast<uchar>(Cr) << 8;\n            dst |= saturate_cast<uchar>(Cb) << 16;\n\n            return dst;\n        }\n\n        template <int bidx, typename T, typename D> static __device__ __forceinline__ void RGB2YCrCbConvert_32F(const T& src, D& dst)\n        {\n            const float b = bidx == 0 ? src.x : src.z;\n            const float g = src.y;\n            const float r = bidx == 0 ? src.z : src.x;\n\n            dst.x = b * c_RGB2YCrCbCoeffs_f[2] + g * c_RGB2YCrCbCoeffs_f[1] + r * c_RGB2YCrCbCoeffs_f[0];\n            dst.y = (r - dst.x) * c_RGB2YCrCbCoeffs_f[3] + ColorChannel<float>::half();\n            dst.z = (b - dst.x) * c_RGB2YCrCbCoeffs_f[4] + ColorChannel<float>::half();\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct RGB2YCrCb\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator ()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n                RGB2YCrCbConvert<bidx>(src, dst);\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2YCrCb() {}\n            __host__ __device__ __forceinline__ RGB2YCrCb(const RGB2YCrCb&) {}\n        };\n\n        template <int scn, int dcn, int bidx> struct RGB2YCrCb<float, scn, dcn, bidx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n                RGB2YCrCbConvert_32F<bidx>(src, dst);\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2YCrCb() {}\n            __host__ __device__ __forceinline__ RGB2YCrCb(const RGB2YCrCb&) {}\n        };\n\n        template <int bidx> struct RGB2YCrCb<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator ()(uint src) const\n            {\n                return RGB2YCrCbConvert_8UC4<bidx>(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2YCrCb() {}\n            __host__ __device__ __forceinline__ RGB2YCrCb(const RGB2YCrCb&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2YCrCb_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2YCrCb<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ float c_YCrCb2RGBCoeffs_f[5] = {1.403f, -0.714f, -0.344f, 1.773f};\n        __constant__ int   c_YCrCb2RGBCoeffs_i[5] = {22987, -11698, -5636, 29049};\n\n        template <int bidx, typename T, typename D> static __device__ void YCrCb2RGBConvert(const T& src, D& dst)\n        {\n            const int b = src.x + CV_DESCALE((src.z - ColorChannel<typename VecTraits<D>::elem_type>::half()) * c_YCrCb2RGBCoeffs_i[3], yuv_shift);\n            const int g = src.x + CV_DESCALE((src.z - ColorChannel<typename VecTraits<D>::elem_type>::half()) * c_YCrCb2RGBCoeffs_i[2] +\n                    (src.y - ColorChannel<typename VecTraits<D>::elem_type>::half()) * c_YCrCb2RGBCoeffs_i[1], yuv_shift);\n            const int r = src.x + CV_DESCALE((src.y - ColorChannel<typename VecTraits<D>::elem_type>::half()) * c_YCrCb2RGBCoeffs_i[0], yuv_shift);\n\n            (bidx == 0 ? dst.x : dst.z) = saturate_cast<typename VecTraits<D>::elem_type>(b);\n            dst.y                       = saturate_cast<typename VecTraits<D>::elem_type>(g);\n            (bidx == 0 ? dst.z : dst.x) = saturate_cast<typename VecTraits<D>::elem_type>(r);\n        }\n\n        template <int bidx> static __device__ uint YCrCb2RGBConvert_8UC4(uint src)\n        {\n            const int x = 0xff & (src);\n            const int y = 0xff & (src >> 8);\n            const int z = 0xff & (src >> 16);\n\n            const int b = x + CV_DESCALE((z - ColorChannel<uchar>::half()) * c_YCrCb2RGBCoeffs_i[3], yuv_shift);\n            const int g = x + CV_DESCALE((z - ColorChannel<uchar>::half()) * c_YCrCb2RGBCoeffs_i[2] + (y - ColorChannel<uchar>::half()) * c_YCrCb2RGBCoeffs_i[1], yuv_shift);\n            const int r = x + CV_DESCALE((y - ColorChannel<uchar>::half()) * c_YCrCb2RGBCoeffs_i[0], yuv_shift);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(b) << (bidx * 8);\n            dst |= saturate_cast<uchar>(g) << 8;\n            dst |= saturate_cast<uchar>(r) << ((bidx ^ 2) * 8);\n\n            return dst;\n        }\n\n        template <int bidx, typename T, typename D> __device__ __forceinline__ void YCrCb2RGBConvert_32F(const T& src, D& dst)\n        {\n            (bidx == 0 ? dst.x : dst.z) = src.x + (src.z - ColorChannel<float>::half()) * c_YCrCb2RGBCoeffs_f[3];\n            dst.y                       = src.x + (src.z - ColorChannel<float>::half()) * c_YCrCb2RGBCoeffs_f[2] + (src.y - ColorChannel<float>::half()) * c_YCrCb2RGBCoeffs_f[1];\n            (bidx == 0 ? dst.z : dst.x) = src.x + (src.y - ColorChannel<float>::half()) * c_YCrCb2RGBCoeffs_f[0];\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct YCrCb2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator ()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                YCrCb2RGBConvert<bidx>(src, dst);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ YCrCb2RGB() {}\n            __host__ __device__ __forceinline__ YCrCb2RGB(const YCrCb2RGB&) {}\n        };\n\n        template <int scn, int dcn, int bidx> struct YCrCb2RGB<float, scn, dcn, bidx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                YCrCb2RGBConvert_32F<bidx>(src, dst);\n                setAlpha(dst, ColorChannel<float>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ YCrCb2RGB() {}\n            __host__ __device__ __forceinline__ YCrCb2RGB(const YCrCb2RGB&) {}\n        };\n\n        template <int bidx> struct YCrCb2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator ()(uint src) const\n            {\n                return YCrCb2RGBConvert_8UC4<bidx>(src);\n            }\n\n            __host__ __device__ __forceinline__ YCrCb2RGB() {}\n            __host__ __device__ __forceinline__ YCrCb2RGB(const YCrCb2RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_YCrCb2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::YCrCb2RGB<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n////////////////////////////////////// RGB <-> XYZ ///////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ float c_RGB2XYZ_D65f[9] = { 0.412453f, 0.357580f, 0.180423f, 0.212671f, 0.715160f, 0.072169f, 0.019334f, 0.119193f, 0.950227f };\n        __constant__ int   c_RGB2XYZ_D65i[9] = { 1689, 1465, 739, 871, 2929, 296, 79, 488, 3892 };\n\n        template <int bidx, typename T, typename D> static __device__ __forceinline__ void RGB2XYZConvert_8U(const T& src, D& dst)\n        {\n            const uint b = bidx == 0 ? src.x : src.z;\n            const uint g = src.y;\n            const uint r = bidx == 0 ? src.z : src.x;\n\n            dst.x = saturate_cast<typename VecTraits<D>::elem_type>(CV_DESCALE(r * c_RGB2XYZ_D65i[0] + g * c_RGB2XYZ_D65i[1] + b * c_RGB2XYZ_D65i[2], xyz_shift));\n            dst.y = saturate_cast<typename VecTraits<D>::elem_type>(CV_DESCALE(r * c_RGB2XYZ_D65i[3] + g * c_RGB2XYZ_D65i[4] + b * c_RGB2XYZ_D65i[5], xyz_shift));\n            dst.z = saturate_cast<typename VecTraits<D>::elem_type>(CV_DESCALE(r * c_RGB2XYZ_D65i[6] + g * c_RGB2XYZ_D65i[7] + b * c_RGB2XYZ_D65i[8], xyz_shift));\n        }\n\n        template <int bidx> static __device__ __forceinline__ uint RGB2XYZConvert_8UC4(uint src)\n        {\n            const uint b = 0xffu & (src >> (bidx * 8));\n            const uint g = 0xffu & (src >> 8);\n            const uint r = 0xffu & (src >> ((bidx ^ 2) * 8));\n\n            const uint x = saturate_cast<uchar>(CV_DESCALE(r * c_RGB2XYZ_D65i[0] + g * c_RGB2XYZ_D65i[1] + b * c_RGB2XYZ_D65i[2], xyz_shift));\n            const uint y = saturate_cast<uchar>(CV_DESCALE(r * c_RGB2XYZ_D65i[3] + g * c_RGB2XYZ_D65i[4] + b * c_RGB2XYZ_D65i[5], xyz_shift));\n            const uint z = saturate_cast<uchar>(CV_DESCALE(r * c_RGB2XYZ_D65i[6] + g * c_RGB2XYZ_D65i[7] + b * c_RGB2XYZ_D65i[8], xyz_shift));\n\n            uint dst = 0;\n\n            dst |= x;\n            dst |= y << 8;\n            dst |= z << 16;\n\n            return dst;\n        }\n\n        template <int bidx, typename T, typename D> static __device__ __forceinline__ void RGB2XYZConvert_32F(const T& src, D& dst)\n        {\n            const float b = bidx == 0 ? src.x : src.z;\n            const float g = src.y;\n            const float r = bidx == 0 ? src.z : src.x;\n\n            dst.x = r * c_RGB2XYZ_D65f[0] + g * c_RGB2XYZ_D65f[1] + b * c_RGB2XYZ_D65f[2];\n            dst.y = r * c_RGB2XYZ_D65f[3] + g * c_RGB2XYZ_D65f[4] + b * c_RGB2XYZ_D65f[5];\n            dst.z = r * c_RGB2XYZ_D65f[6] + g * c_RGB2XYZ_D65f[7] + b * c_RGB2XYZ_D65f[8];\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct RGB2XYZ\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                RGB2XYZConvert_8U<bidx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2XYZ() {}\n            __host__ __device__ __forceinline__ RGB2XYZ(const RGB2XYZ&) {}\n        };\n\n        template <int scn, int dcn, int bidx> struct RGB2XYZ<float, scn, dcn, bidx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                RGB2XYZConvert_32F<bidx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2XYZ() {}\n            __host__ __device__ __forceinline__ RGB2XYZ(const RGB2XYZ&) {}\n        };\n\n        template <int bidx> struct RGB2XYZ<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return RGB2XYZConvert_8UC4<bidx>(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2XYZ() {}\n            __host__ __device__ __forceinline__ RGB2XYZ(const RGB2XYZ&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2XYZ_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2XYZ<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ float c_XYZ2sRGB_D65f[9] = { 3.240479f, -1.53715f, -0.498535f, -0.969256f, 1.875991f, 0.041556f, 0.055648f, -0.204043f, 1.057311f };\n        __constant__ int   c_XYZ2sRGB_D65i[9] = { 13273, -6296, -2042, -3970, 7684, 170, 228, -836, 4331 };\n\n        template <int bidx, typename T, typename D> static __device__ __forceinline__ void XYZ2RGBConvert_8U(const T& src, D& dst)\n        {\n            (bidx == 0 ? dst.z : dst.x) = saturate_cast<typename VecTraits<D>::elem_type>(CV_DESCALE(src.x * c_XYZ2sRGB_D65i[0] + src.y * c_XYZ2sRGB_D65i[1] + src.z * c_XYZ2sRGB_D65i[2], xyz_shift));\n            dst.y                       = saturate_cast<typename VecTraits<D>::elem_type>(CV_DESCALE(src.x * c_XYZ2sRGB_D65i[3] + src.y * c_XYZ2sRGB_D65i[4] + src.z * c_XYZ2sRGB_D65i[5], xyz_shift));\n            (bidx == 0 ? dst.x : dst.z) = saturate_cast<typename VecTraits<D>::elem_type>(CV_DESCALE(src.x * c_XYZ2sRGB_D65i[6] + src.y * c_XYZ2sRGB_D65i[7] + src.z * c_XYZ2sRGB_D65i[8], xyz_shift));\n        }\n\n        template <int bidx> static __device__ __forceinline__ uint XYZ2RGBConvert_8UC4(uint src)\n        {\n            const int x = 0xff & src;\n            const int y = 0xff & (src >> 8);\n            const int z = 0xff & (src >> 16);\n\n            const uint r = saturate_cast<uchar>(CV_DESCALE(x * c_XYZ2sRGB_D65i[0] + y * c_XYZ2sRGB_D65i[1] + z * c_XYZ2sRGB_D65i[2], xyz_shift));\n            const uint g = saturate_cast<uchar>(CV_DESCALE(x * c_XYZ2sRGB_D65i[3] + y * c_XYZ2sRGB_D65i[4] + z * c_XYZ2sRGB_D65i[5], xyz_shift));\n            const uint b = saturate_cast<uchar>(CV_DESCALE(x * c_XYZ2sRGB_D65i[6] + y * c_XYZ2sRGB_D65i[7] + z * c_XYZ2sRGB_D65i[8], xyz_shift));\n\n            uint dst = 0xffu << 24;\n\n            dst |= b << (bidx * 8);\n            dst |= g << 8;\n            dst |= r << ((bidx ^ 2) * 8);\n\n            return dst;\n        }\n\n        template <int bidx, typename T, typename D> static __device__ __forceinline__ void XYZ2RGBConvert_32F(const T& src, D& dst)\n        {\n            (bidx == 0 ? dst.z : dst.x) = src.x * c_XYZ2sRGB_D65f[0] + src.y * c_XYZ2sRGB_D65f[1] + src.z * c_XYZ2sRGB_D65f[2];\n            dst.y                       = src.x * c_XYZ2sRGB_D65f[3] + src.y * c_XYZ2sRGB_D65f[4] + src.z * c_XYZ2sRGB_D65f[5];\n            (bidx == 0 ? dst.x : dst.z) = src.x * c_XYZ2sRGB_D65f[6] + src.y * c_XYZ2sRGB_D65f[7] + src.z * c_XYZ2sRGB_D65f[8];\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct XYZ2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                XYZ2RGBConvert_8U<bidx>(src, dst);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ XYZ2RGB() {}\n            __host__ __device__ __forceinline__ XYZ2RGB(const XYZ2RGB&) {}\n        };\n\n        template <int scn, int dcn, int bidx> struct XYZ2RGB<float, scn, dcn, bidx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                XYZ2RGBConvert_32F<bidx>(src, dst);\n                setAlpha(dst, ColorChannel<float>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ XYZ2RGB() {}\n            __host__ __device__ __forceinline__ XYZ2RGB(const XYZ2RGB&) {}\n        };\n\n        template <int bidx> struct XYZ2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return XYZ2RGBConvert_8UC4<bidx>(src);\n            }\n\n            __host__ __device__ __forceinline__ XYZ2RGB() {}\n            __host__ __device__ __forceinline__ XYZ2RGB(const XYZ2RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_XYZ2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::XYZ2RGB<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n////////////////////////////////////// RGB <-> HSV ///////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ int c_HsvDivTable   [256] = {0, 1044480, 522240, 348160, 261120, 208896, 174080, 149211, 130560, 116053, 104448, 94953, 87040, 80345, 74606, 69632, 65280, 61440, 58027, 54973, 52224, 49737, 47476, 45412, 43520, 41779, 40172, 38684, 37303, 36017, 34816, 33693, 32640, 31651, 30720, 29842, 29013, 28229, 27486, 26782, 26112, 25475, 24869, 24290, 23738, 23211, 22706, 22223, 21760, 21316, 20890, 20480, 20086, 19707, 19342, 18991, 18651, 18324, 18008, 17703, 17408, 17123, 16846, 16579, 16320, 16069, 15825, 15589, 15360, 15137, 14921, 14711, 14507, 14308, 14115, 13926, 13743, 13565, 13391, 13221, 13056, 12895, 12738, 12584, 12434, 12288, 12145, 12006, 11869, 11736, 11605, 11478, 11353, 11231, 11111, 10995, 10880, 10768, 10658, 10550, 10445, 10341, 10240, 10141, 10043, 9947, 9854, 9761, 9671, 9582, 9495, 9410, 9326, 9243, 9162, 9082, 9004, 8927, 8852, 8777, 8704, 8632, 8561, 8492, 8423, 8356, 8290, 8224, 8160, 8097, 8034, 7973, 7913, 7853, 7795, 7737, 7680, 7624, 7569, 7514, 7461, 7408, 7355, 7304, 7253, 7203, 7154, 7105, 7057, 7010, 6963, 6917, 6872, 6827, 6782, 6739, 6695, 6653, 6611, 6569, 6528, 6487, 6447, 6408, 6369, 6330, 6292, 6254, 6217, 6180, 6144, 6108, 6073, 6037, 6003, 5968, 5935, 5901, 5868, 5835, 5803, 5771, 5739, 5708, 5677, 5646, 5615, 5585, 5556, 5526, 5497, 5468, 5440, 5412, 5384, 5356, 5329, 5302, 5275, 5249, 5222, 5196, 5171, 5145, 5120, 5095, 5070, 5046, 5022, 4998, 4974, 4950, 4927, 4904, 4881, 4858, 4836, 4813, 4791, 4769, 4748, 4726, 4705, 4684, 4663, 4642, 4622, 4601, 4581, 4561, 4541, 4522, 4502, 4483, 4464, 4445, 4426, 4407, 4389, 4370, 4352, 4334, 4316, 4298, 4281, 4263, 4246, 4229, 4212, 4195, 4178, 4161, 4145, 4128, 4112, 4096};\n        __constant__ int c_HsvDivTable180[256] = {0, 122880, 61440, 40960, 30720, 24576, 20480, 17554, 15360, 13653, 12288, 11171, 10240, 9452, 8777, 8192, 7680, 7228, 6827, 6467, 6144, 5851, 5585, 5343, 5120, 4915, 4726, 4551, 4389, 4237, 4096, 3964, 3840, 3724, 3614, 3511, 3413, 3321, 3234, 3151, 3072, 2997, 2926, 2858, 2793, 2731, 2671, 2614, 2560, 2508, 2458, 2409, 2363, 2318, 2276, 2234, 2194, 2156, 2119, 2083, 2048, 2014, 1982, 1950, 1920, 1890, 1862, 1834, 1807, 1781, 1755, 1731, 1707, 1683, 1661, 1638, 1617, 1596, 1575, 1555, 1536, 1517, 1499, 1480, 1463, 1446, 1429, 1412, 1396, 1381, 1365, 1350, 1336, 1321, 1307, 1293, 1280, 1267, 1254, 1241, 1229, 1217, 1205, 1193, 1182, 1170, 1159, 1148, 1138, 1127, 1117, 1107, 1097, 1087, 1078, 1069, 1059, 1050, 1041, 1033, 1024, 1016, 1007, 999, 991, 983, 975, 968, 960, 953, 945, 938, 931, 924, 917, 910, 904, 897, 890, 884, 878, 871, 865, 859, 853, 847, 842, 836, 830, 825, 819, 814, 808, 803, 798, 793, 788, 783, 778, 773, 768, 763, 759, 754, 749, 745, 740, 736, 731, 727, 723, 719, 714, 710, 706, 702, 698, 694, 690, 686, 683, 679, 675, 671, 668, 664, 661, 657, 654, 650, 647, 643, 640, 637, 633, 630, 627, 624, 621, 617, 614, 611, 608, 605, 602, 599, 597, 594, 591, 588, 585, 582, 580, 577, 574, 572, 569, 566, 564, 561, 559, 556, 554, 551, 549, 546, 544, 541, 539, 537, 534, 532, 530, 527, 525, 523, 521, 518, 516, 514, 512, 510, 508, 506, 504, 502, 500, 497, 495, 493, 492, 490, 488, 486, 484, 482};\n        __constant__ int c_HsvDivTable256[256] = {0, 174763, 87381, 58254, 43691, 34953, 29127, 24966, 21845, 19418, 17476, 15888, 14564, 13443, 12483, 11651, 10923, 10280, 9709, 9198, 8738, 8322, 7944, 7598, 7282, 6991, 6722, 6473, 6242, 6026, 5825, 5638, 5461, 5296, 5140, 4993, 4855, 4723, 4599, 4481, 4369, 4263, 4161, 4064, 3972, 3884, 3799, 3718, 3641, 3567, 3495, 3427, 3361, 3297, 3236, 3178, 3121, 3066, 3013, 2962, 2913, 2865, 2819, 2774, 2731, 2689, 2648, 2608, 2570, 2533, 2497, 2461, 2427, 2394, 2362, 2330, 2300, 2270, 2241, 2212, 2185, 2158, 2131, 2106, 2081, 2056, 2032, 2009, 1986, 1964, 1942, 1920, 1900, 1879, 1859, 1840, 1820, 1802, 1783, 1765, 1748, 1730, 1713, 1697, 1680, 1664, 1649, 1633, 1618, 1603, 1589, 1574, 1560, 1547, 1533, 1520, 1507, 1494, 1481, 1469, 1456, 1444, 1432, 1421, 1409, 1398, 1387, 1376, 1365, 1355, 1344, 1334, 1324, 1314, 1304, 1295, 1285, 1276, 1266, 1257, 1248, 1239, 1231, 1222, 1214, 1205, 1197, 1189, 1181, 1173, 1165, 1157, 1150, 1142, 1135, 1128, 1120, 1113, 1106, 1099, 1092, 1085, 1079, 1072, 1066, 1059, 1053, 1046, 1040, 1034, 1028, 1022, 1016, 1010, 1004, 999, 993, 987, 982, 976, 971, 966, 960, 955, 950, 945, 940, 935, 930, 925, 920, 915, 910, 906, 901, 896, 892, 887, 883, 878, 874, 869, 865, 861, 857, 853, 848, 844, 840, 836, 832, 828, 824, 820, 817, 813, 809, 805, 802, 798, 794, 791, 787, 784, 780, 777, 773, 770, 767, 763, 760, 757, 753, 750, 747, 744, 741, 737, 734, 731, 728, 725, 722, 719, 716, 713, 710, 708, 705, 702, 699, 696, 694, 691, 688, 685};\n\n        template <int bidx, int hr, typename T, typename D> static __device__ void RGB2HSVConvert_8U(const T& src, D& dst)\n        {\n            const int hsv_shift = 12;\n            const int* hdiv_table = hr == 180 ? c_HsvDivTable180 : c_HsvDivTable256;\n\n            int b = bidx == 0 ? src.x : src.z;\n            int g = src.y;\n            int r = bidx == 0 ? src.z : src.x;\n\n            int h, s, v = b;\n            int vmin = b, diff;\n            int vr, vg;\n\n            v = ::max(v, g);\n            v = ::max(v, r);\n            vmin = ::min(vmin, g);\n            vmin = ::min(vmin, r);\n\n            diff = v - vmin;\n            vr = (v == r) * -1;\n            vg = (v == g) * -1;\n\n            s = (diff * c_HsvDivTable[v] + (1 << (hsv_shift-1))) >> hsv_shift;\n            h = (vr & (g - b)) + (~vr & ((vg & (b - r + 2 * diff)) + ((~vg) & (r - g + 4 * diff))));\n            h = (h * hdiv_table[diff] + (1 << (hsv_shift-1))) >> hsv_shift;\n            h += (h < 0) * hr;\n\n            dst.x = saturate_cast<uchar>(h);\n            dst.y = (uchar)s;\n            dst.z = (uchar)v;\n        }\n\n        template <int bidx, int hr> static __device__ uint RGB2HSVConvert_8UC4(uint src)\n        {\n            const int hsv_shift = 12;\n            const int* hdiv_table = hr == 180 ? c_HsvDivTable180 : c_HsvDivTable256;\n\n            const int b = 0xff & (src >> (bidx * 8));\n            const int g = 0xff & (src >> 8);\n            const int r = 0xff & (src >> ((bidx ^ 2) * 8));\n\n            int h, s, v = b;\n            int vmin = b, diff;\n            int vr, vg;\n\n            v = ::max(v, g);\n            v = ::max(v, r);\n            vmin = ::min(vmin, g);\n            vmin = ::min(vmin, r);\n\n            diff = v - vmin;\n            vr = (v == r) * -1;\n            vg = (v == g) * -1;\n\n            s = (diff * c_HsvDivTable[v] + (1 << (hsv_shift-1))) >> hsv_shift;\n            h = (vr & (g - b)) + (~vr & ((vg & (b - r + 2 * diff)) + ((~vg) & (r - g + 4 * diff))));\n            h = (h * hdiv_table[diff] + (1 << (hsv_shift-1))) >> hsv_shift;\n            h += (h < 0) * hr;\n\n            uint dst = 0;\n\n            dst |= saturate_cast<uchar>(h);\n            dst |= (0xffu & s) << 8;\n            dst |= (0xffu & v) << 16;\n\n            return dst;\n        }\n\n        template <int bidx, int hr, typename T, typename D> static __device__ void RGB2HSVConvert_32F(const T& src, D& dst)\n        {\n            const float hscale = hr * (1.f / 360.f);\n\n            float b = bidx == 0 ? src.x : src.z;\n            float g = src.y;\n            float r = bidx == 0 ? src.z : src.x;\n\n            float h, s, v;\n\n            float vmin, diff;\n\n            v = vmin = r;\n            v = fmax(v, g);\n            v = fmax(v, b);\n            vmin = fmin(vmin, g);\n            vmin = fmin(vmin, b);\n\n            diff = v - vmin;\n            s = diff / (float)(::fabs(v) + numeric_limits<float>::epsilon());\n            diff = (float)(60. / (diff + numeric_limits<float>::epsilon()));\n\n            h  = (v == r) * (g - b) * diff;\n            h += (v != r && v == g) * ((b - r) * diff + 120.f);\n            h += (v != r && v != g) * ((r - g) * diff + 240.f);\n            h += (h < 0) * 360.f;\n\n            dst.x = h * hscale;\n            dst.y = s;\n            dst.z = v;\n        }\n\n        template <typename T, int scn, int dcn, int bidx, int hr> struct RGB2HSV\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                RGB2HSVConvert_8U<bidx, hr>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2HSV() {}\n            __host__ __device__ __forceinline__ RGB2HSV(const RGB2HSV&) {}\n        };\n\n        template <int scn, int dcn, int bidx, int hr> struct RGB2HSV<float, scn, dcn, bidx, hr>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                RGB2HSVConvert_32F<bidx, hr>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2HSV() {}\n            __host__ __device__ __forceinline__ RGB2HSV(const RGB2HSV&) {}\n        };\n\n        template <int bidx, int hr> struct RGB2HSV<uchar, 4, 4, bidx, hr> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return RGB2HSVConvert_8UC4<bidx, hr>(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2HSV() {}\n            __host__ __device__ __forceinline__ RGB2HSV(const RGB2HSV&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2HSV_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2HSV<T, scn, dcn, bidx, 180> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <typename T> struct name ## _full_traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2HSV<T, scn, dcn, bidx, 256> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _traits<float> \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2HSV<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _full_traits<float> \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2HSV<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ int c_HsvSectorData[6][3] = { {1,3,0}, {1,0,2}, {3,0,1}, {0,2,1}, {0,1,3}, {2,1,0} };\n\n        template <int bidx, int hr, typename T, typename D> static __device__ void HSV2RGBConvert_32F(const T& src, D& dst)\n        {\n            const float hscale = 6.f / hr;\n\n            float h = src.x, s = src.y, v = src.z;\n            float b = v, g = v, r = v;\n\n            if (s != 0)\n            {\n                h *= hscale;\n\n                if( h < 0 )\n                    do h += 6; while( h < 0 );\n                else if( h >= 6 )\n                    do h -= 6; while( h >= 6 );\n\n                int sector = __float2int_rd(h);\n                h -= sector;\n\n                if ( (unsigned)sector >= 6u )\n                {\n                    sector = 0;\n                    h = 0.f;\n                }\n\n                float tab[4];\n                tab[0] = v;\n                tab[1] = v * (1.f - s);\n                tab[2] = v * (1.f - s * h);\n                tab[3] = v * (1.f - s * (1.f - h));\n\n                b = tab[c_HsvSectorData[sector][0]];\n                g = tab[c_HsvSectorData[sector][1]];\n                r = tab[c_HsvSectorData[sector][2]];\n            }\n\n            dst.x = (bidx == 0 ? b : r);\n            dst.y = g;\n            dst.z = (bidx == 0 ? r : b);\n        }\n\n        template <int bidx, int HR, typename T, typename D> static __device__ void HSV2RGBConvert_8U(const T& src, D& dst)\n        {\n            float3 buf;\n\n            buf.x = src.x;\n            buf.y = src.y * (1.f / 255.f);\n            buf.z = src.z * (1.f / 255.f);\n\n            HSV2RGBConvert_32F<bidx, HR>(buf, buf);\n\n            dst.x = saturate_cast<uchar>(buf.x * 255.f);\n            dst.y = saturate_cast<uchar>(buf.y * 255.f);\n            dst.z = saturate_cast<uchar>(buf.z * 255.f);\n        }\n\n        template <int bidx, int hr> static __device__ uint HSV2RGBConvert_8UC4(uint src)\n        {\n            float3 buf;\n\n            buf.x = src & 0xff;\n            buf.y = ((src >> 8) & 0xff) * (1.f/255.f);\n            buf.z = ((src >> 16) & 0xff) * (1.f/255.f);\n\n            HSV2RGBConvert_32F<bidx, hr>(buf, buf);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(buf.x * 255.f);\n            dst |= saturate_cast<uchar>(buf.y * 255.f) << 8;\n            dst |= saturate_cast<uchar>(buf.z * 255.f) << 16;\n\n            return dst;\n        }\n\n        template <typename T, int scn, int dcn, int bidx, int hr> struct HSV2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                HSV2RGBConvert_8U<bidx, hr>(src, dst);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ HSV2RGB() {}\n            __host__ __device__ __forceinline__ HSV2RGB(const HSV2RGB&) {}\n        };\n\n        template <int scn, int dcn, int bidx, int hr> struct HSV2RGB<float, scn, dcn, bidx, hr>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                HSV2RGBConvert_32F<bidx, hr>(src, dst);\n                setAlpha(dst, ColorChannel<float>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ HSV2RGB() {}\n            __host__ __device__ __forceinline__ HSV2RGB(const HSV2RGB&) {}\n        };\n\n        template <int bidx, int hr> struct HSV2RGB<uchar, 4, 4, bidx, hr> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return HSV2RGBConvert_8UC4<bidx, hr>(src);\n            }\n\n            __host__ __device__ __forceinline__ HSV2RGB() {}\n            __host__ __device__ __forceinline__ HSV2RGB(const HSV2RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_HSV2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::HSV2RGB<T, scn, dcn, bidx, 180> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <typename T> struct name ## _full_traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::HSV2RGB<T, scn, dcn, bidx, 255> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _traits<float> \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::HSV2RGB<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _full_traits<float> \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::HSV2RGB<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n/////////////////////////////////////// RGB <-> HLS ////////////////////////////////////////\n\n    namespace color_detail\n    {\n        template <int bidx, int hr, typename T, typename D> static __device__ void RGB2HLSConvert_32F(const T& src, D& dst)\n        {\n            const float hscale = hr * (1.f / 360.f);\n\n            float b = bidx == 0 ? src.x : src.z;\n            float g = src.y;\n            float r = bidx == 0 ? src.z : src.x;\n\n            float h = 0.f, s = 0.f, l;\n            float vmin, vmax, diff;\n\n            vmax = vmin = r;\n            vmax = fmax(vmax, g);\n            vmax = fmax(vmax, b);\n            vmin = fmin(vmin, g);\n            vmin = fmin(vmin, b);\n\n            diff = vmax - vmin;\n            l = (vmax + vmin) * 0.5f;\n\n            if (diff > numeric_limits<float>::epsilon())\n            {\n                s = (l < 0.5f) * diff / (vmax + vmin);\n                s += (l >= 0.5f) * diff / (2.0f - vmax - vmin);\n\n                diff = 60.f / diff;\n\n                h  = (vmax == r) * (g - b) * diff;\n                h += (vmax != r && vmax == g) * ((b - r) * diff + 120.f);\n                h += (vmax != r && vmax != g) * ((r - g) * diff + 240.f);\n                h += (h < 0.f) * 360.f;\n            }\n\n            dst.x = h * hscale;\n            dst.y = l;\n            dst.z = s;\n        }\n\n        template <int bidx, int hr, typename T, typename D> static __device__ void RGB2HLSConvert_8U(const T& src, D& dst)\n        {\n            float3 buf;\n\n            buf.x = src.x * (1.f / 255.f);\n            buf.y = src.y * (1.f / 255.f);\n            buf.z = src.z * (1.f / 255.f);\n\n            RGB2HLSConvert_32F<bidx, hr>(buf, buf);\n\n            dst.x = saturate_cast<uchar>(buf.x);\n            dst.y = saturate_cast<uchar>(buf.y*255.f);\n            dst.z = saturate_cast<uchar>(buf.z*255.f);\n        }\n\n        template <int bidx, int hr> static __device__ uint RGB2HLSConvert_8UC4(uint src)\n        {\n            float3 buf;\n\n            buf.x = (0xff & src) * (1.f / 255.f);\n            buf.y = (0xff & (src >> 8)) * (1.f / 255.f);\n            buf.z = (0xff & (src >> 16)) * (1.f / 255.f);\n\n            RGB2HLSConvert_32F<bidx, hr>(buf, buf);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(buf.x);\n            dst |= saturate_cast<uchar>(buf.y * 255.f) << 8;\n            dst |= saturate_cast<uchar>(buf.z * 255.f) << 16;\n\n            return dst;\n        }\n\n        template <typename T, int scn, int dcn, int bidx, int hr> struct RGB2HLS\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                RGB2HLSConvert_8U<bidx, hr>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2HLS() {}\n            __host__ __device__ __forceinline__ RGB2HLS(const RGB2HLS&) {}\n        };\n\n        template <int scn, int dcn, int bidx, int hr> struct RGB2HLS<float, scn, dcn, bidx, hr>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                RGB2HLSConvert_32F<bidx, hr>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2HLS() {}\n            __host__ __device__ __forceinline__ RGB2HLS(const RGB2HLS&) {}\n        };\n\n        template <int bidx, int hr> struct RGB2HLS<uchar, 4, 4, bidx, hr> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return RGB2HLSConvert_8UC4<bidx, hr>(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2HLS() {}\n            __host__ __device__ __forceinline__ RGB2HLS(const RGB2HLS&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2HLS_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2HLS<T, scn, dcn, bidx, 180> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <typename T> struct name ## _full_traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2HLS<T, scn, dcn, bidx, 256> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _traits<float> \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2HLS<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _full_traits<float> \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2HLS<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ int c_HlsSectorData[6][3] = { {1,3,0}, {1,0,2}, {3,0,1}, {0,2,1}, {0,1,3}, {2,1,0} };\n\n        template <int bidx, int hr, typename T, typename D> static __device__ void HLS2RGBConvert_32F(const T& src, D& dst)\n        {\n            const float hscale = 6.0f / hr;\n\n            float h = src.x, l = src.y, s = src.z;\n            float b = l, g = l, r = l;\n\n            if (s != 0)\n            {\n                float p2  = (l <= 0.5f) * l * (1 + s);\n                      p2 += (l > 0.5f) * (l + s - l * s);\n                float p1 = 2 * l - p2;\n\n                h *= hscale;\n\n                if( h < 0 )\n                    do h += 6; while( h < 0 );\n                else if( h >= 6 )\n                    do h -= 6; while( h >= 6 );\n\n                int sector;\n                sector = __float2int_rd(h);\n\n                h -= sector;\n\n                float tab[4];\n                tab[0] = p2;\n                tab[1] = p1;\n                tab[2] = p1 + (p2 - p1) * (1 - h);\n                tab[3] = p1 + (p2 - p1) * h;\n\n                b = tab[c_HlsSectorData[sector][0]];\n                g = tab[c_HlsSectorData[sector][1]];\n                r = tab[c_HlsSectorData[sector][2]];\n            }\n\n            dst.x = bidx == 0 ? b : r;\n            dst.y = g;\n            dst.z = bidx == 0 ? r : b;\n        }\n\n        template <int bidx, int hr, typename T, typename D> static __device__ void HLS2RGBConvert_8U(const T& src, D& dst)\n        {\n            float3 buf;\n\n            buf.x = src.x;\n            buf.y = src.y * (1.f / 255.f);\n            buf.z = src.z * (1.f / 255.f);\n\n            HLS2RGBConvert_32F<bidx, hr>(buf, buf);\n\n            dst.x = saturate_cast<uchar>(buf.x * 255.f);\n            dst.y = saturate_cast<uchar>(buf.y * 255.f);\n            dst.z = saturate_cast<uchar>(buf.z * 255.f);\n        }\n\n        template <int bidx, int hr> static __device__ uint HLS2RGBConvert_8UC4(uint src)\n        {\n            float3 buf;\n\n            buf.x = 0xff & src;\n            buf.y = (0xff & (src >> 8)) * (1.f / 255.f);\n            buf.z = (0xff & (src >> 16)) * (1.f / 255.f);\n\n            HLS2RGBConvert_32F<bidx, hr>(buf, buf);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(buf.x * 255.f);\n            dst |= saturate_cast<uchar>(buf.y * 255.f) << 8;\n            dst |= saturate_cast<uchar>(buf.z * 255.f) << 16;\n\n            return dst;\n        }\n\n        template <typename T, int scn, int dcn, int bidx, int hr> struct HLS2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                HLS2RGBConvert_8U<bidx, hr>(src, dst);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ HLS2RGB() {}\n            __host__ __device__ __forceinline__ HLS2RGB(const HLS2RGB&) {}\n        };\n\n        template <int scn, int dcn, int bidx, int hr> struct HLS2RGB<float, scn, dcn, bidx, hr>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                HLS2RGBConvert_32F<bidx, hr>(src, dst);\n                setAlpha(dst, ColorChannel<float>::max());\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ HLS2RGB() {}\n            __host__ __device__ __forceinline__ HLS2RGB(const HLS2RGB&) {}\n        };\n\n        template <int bidx, int hr> struct HLS2RGB<uchar, 4, 4, bidx, hr> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return HLS2RGBConvert_8UC4<bidx, hr>(src);\n            }\n\n            __host__ __device__ __forceinline__ HLS2RGB() {}\n            __host__ __device__ __forceinline__ HLS2RGB(const HLS2RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_HLS2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::HLS2RGB<T, scn, dcn, bidx, 180> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <typename T> struct name ## _full_traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::HLS2RGB<T, scn, dcn, bidx, 255> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _traits<float> \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::HLS2RGB<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _full_traits<float> \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::HLS2RGB<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////////// RGB <-> Lab /////////////////////////////////////\n\n    namespace color_detail\n    {\n        enum\n        {\n            LAB_CBRT_TAB_SIZE = 1024,\n            GAMMA_TAB_SIZE = 1024,\n            lab_shift = xyz_shift,\n            gamma_shift = 3,\n            lab_shift2 = (lab_shift + gamma_shift),\n            LAB_CBRT_TAB_SIZE_B = (256 * 3 / 2 * (1 << gamma_shift))\n        };\n\n        __constant__ ushort c_sRGBGammaTab_b[] = {0,1,1,2,2,3,4,4,5,6,6,7,8,8,9,10,11,11,12,13,14,15,16,17,19,20,21,22,24,25,26,28,29,31,33,34,36,38,40,41,43,45,47,49,51,54,56,58,60,63,65,68,70,73,75,78,81,83,86,89,92,95,98,101,105,108,111,115,118,121,125,129,132,136,140,144,147,151,155,160,164,168,172,176,181,185,190,194,199,204,209,213,218,223,228,233,239,244,249,255,260,265,271,277,282,288,294,300,306,312,318,324,331,337,343,350,356,363,370,376,383,390,397,404,411,418,426,433,440,448,455,463,471,478,486,494,502,510,518,527,535,543,552,560,569,578,586,595,604,613,622,631,641,650,659,669,678,688,698,707,717,727,737,747,757,768,778,788,799,809,820,831,842,852,863,875,886,897,908,920,931,943,954,966,978,990,1002,1014,1026,1038,1050,1063,1075,1088,1101,1113,1126,1139,1152,1165,1178,1192,1205,1218,1232,1245,1259,1273,1287,1301,1315,1329,1343,1357,1372,1386,1401,1415,1430,1445,1460,1475,1490,1505,1521,1536,1551,1567,1583,1598,1614,1630,1646,1662,1678,1695,1711,1728,1744,1761,1778,1794,1811,1828,1846,1863,1880,1897,1915,1933,1950,1968,1986,2004,2022,2040};\n\n        __device__ __forceinline__ int LabCbrt_b(int i)\n        {\n            float x = i * (1.f / (255.f * (1 << gamma_shift)));\n            return (1 << lab_shift2) * (x < 0.008856f ? x * 7.787f + 0.13793103448275862f : ::cbrtf(x));\n        }\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void RGB2LabConvert_8U(const T& src, D& dst)\n        {\n            const int Lscale = (116 * 255 + 50) / 100;\n            const int Lshift = -((16 * 255 * (1 << lab_shift2) + 50) / 100);\n\n            int B = blueIdx == 0 ? src.x : src.z;\n            int G = src.y;\n            int R = blueIdx == 0 ? src.z : src.x;\n\n            if (srgb)\n            {\n                B = c_sRGBGammaTab_b[B];\n                G = c_sRGBGammaTab_b[G];\n                R = c_sRGBGammaTab_b[R];\n            }\n            else\n            {\n                B <<= 3;\n                G <<= 3;\n                R <<= 3;\n            }\n\n            int fX = LabCbrt_b(CV_DESCALE(B * 778 + G * 1541 + R * 1777, lab_shift));\n            int fY = LabCbrt_b(CV_DESCALE(B * 296 + G * 2929 + R * 871, lab_shift));\n            int fZ = LabCbrt_b(CV_DESCALE(B * 3575 + G * 448 + R * 73, lab_shift));\n\n            int L = CV_DESCALE(Lscale * fY + Lshift, lab_shift2);\n            int a = CV_DESCALE(500 * (fX - fY) + 128 * (1 << lab_shift2), lab_shift2);\n            int b = CV_DESCALE(200 * (fY - fZ) + 128 * (1 << lab_shift2), lab_shift2);\n\n            dst.x = saturate_cast<uchar>(L);\n            dst.y = saturate_cast<uchar>(a);\n            dst.z = saturate_cast<uchar>(b);\n        }\n\n        __device__ __forceinline__ float splineInterpolate(float x, const float* tab, int n)\n        {\n            int ix = ::min(::max(int(x), 0), n-1);\n            x -= ix;\n            tab += ix * 4;\n            return ((tab[3] * x + tab[2]) * x + tab[1]) * x + tab[0];\n        }\n\n        __constant__ float c_sRGBGammaTab[] = {0,7.55853e-05,0.,-7.51331e-13,7.55853e-05,7.55853e-05,-2.25399e-12,3.75665e-12,0.000151171,7.55853e-05,9.01597e-12,-6.99932e-12,0.000226756,7.55853e-05,-1.1982e-11,2.41277e-12,0.000302341,7.55853e-05,-4.74369e-12,1.19001e-11,0.000377927,7.55853e-05,3.09568e-11,-2.09095e-11,0.000453512,7.55853e-05,-3.17718e-11,1.35303e-11,0.000529097,7.55853e-05,8.81905e-12,-4.10782e-12,0.000604683,7.55853e-05,-3.50439e-12,2.90097e-12,0.000680268,7.55853e-05,5.19852e-12,-7.49607e-12,0.000755853,7.55853e-05,-1.72897e-11,2.70833e-11,0.000831439,7.55854e-05,6.39602e-11,-4.26295e-11,0.000907024,7.55854e-05,-6.39282e-11,2.70193e-11,0.000982609,7.55853e-05,1.71298e-11,-7.24017e-12,0.00105819,7.55853e-05,-4.59077e-12,1.94137e-12,0.00113378,7.55853e-05,1.23333e-12,-5.25291e-13,0.00120937,7.55853e-05,-3.42545e-13,1.59799e-13,0.00128495,7.55853e-05,1.36852e-13,-1.13904e-13,0.00136054,7.55853e-05,-2.04861e-13,2.95818e-13,0.00143612,7.55853e-05,6.82594e-13,-1.06937e-12,0.00151171,7.55853e-05,-2.52551e-12,3.98166e-12,0.00158729,7.55853e-05,9.41946e-12,-1.48573e-11,0.00166288,7.55853e-05,-3.51523e-11,5.54474e-11,0.00173846,7.55854e-05,1.3119e-10,-9.0517e-11,0.00181405,7.55854e-05,-1.40361e-10,7.37899e-11,0.00188963,7.55853e-05,8.10085e-11,-8.82272e-11,0.00196522,7.55852e-05,-1.83673e-10,1.62704e-10,0.0020408,7.55853e-05,3.04438e-10,-2.13341e-10,0.00211639,7.55853e-05,-3.35586e-10,2.25e-10,0.00219197,7.55853e-05,3.39414e-10,-2.20997e-10,0.00226756,7.55853e-05,-3.23576e-10,1.93326e-10,0.00234315,7.55853e-05,2.564e-10,-8.66446e-11,0.00241873,7.55855e-05,-3.53328e-12,-7.9578e-11,0.00249432,7.55853e-05,-2.42267e-10,1.72126e-10,0.0025699,7.55853e-05,2.74111e-10,-1.43265e-10,0.00264549,7.55854e-05,-1.55683e-10,-6.47292e-11,0.00272107,7.55849e-05,-3.4987e-10,8.67842e-10,0.00279666,7.55868e-05,2.25366e-09,-3.8723e-09,0.00287224,7.55797e-05,-9.36325e-09,1.5087e-08,0.00294783,7.56063e-05,3.58978e-08,-5.69415e-08,0.00302341,7.55072e-05,-1.34927e-07,2.13144e-07,0.003099,7.58768e-05,5.04507e-07,1.38713e-07,0.00317552,7.7302e-05,9.20646e-07,-1.55186e-07,0.00325359,7.86777e-05,4.55087e-07,4.26813e-08,0.00333276,7.97159e-05,5.83131e-07,-1.06495e-08,0.00341305,8.08502e-05,5.51182e-07,3.87467e-09,0.00349446,8.19642e-05,5.62806e-07,-1.92586e-10,0.00357698,8.30892e-05,5.62228e-07,1.0866e-09,0.00366063,8.4217e-05,5.65488e-07,5.02818e-10,0.00374542,8.53494e-05,5.66997e-07,8.60211e-10,0.00383133,8.6486e-05,5.69577e-07,7.13044e-10,0.00391839,8.76273e-05,5.71716e-07,4.78527e-10,0.00400659,8.87722e-05,5.73152e-07,1.09818e-09,0.00409594,8.99218e-05,5.76447e-07,2.50964e-10,0.00418644,9.10754e-05,5.772e-07,1.15762e-09,0.00427809,9.22333e-05,5.80672e-07,2.40865e-10,0.0043709,9.33954e-05,5.81395e-07,1.13854e-09,0.00446488,9.45616e-05,5.84811e-07,3.27267e-10,0.00456003,9.57322e-05,5.85792e-07,8.1197e-10,0.00465635,9.69062e-05,5.88228e-07,6.15823e-10,0.00475384,9.80845e-05,5.90076e-07,9.15747e-10,0.00485252,9.92674e-05,5.92823e-07,3.778e-10,0.00495238,0.000100454,5.93956e-07,8.32623e-10,0.00505343,0.000101645,5.96454e-07,4.82695e-10,0.00515567,0.000102839,5.97902e-07,9.61904e-10,0.00525911,0.000104038,6.00788e-07,3.26281e-10,0.00536375,0.00010524,6.01767e-07,9.926e-10,0.00546959,0.000106447,6.04745e-07,3.59933e-10,0.00557664,0.000107657,6.05824e-07,8.2728e-10,0.0056849,0.000108871,6.08306e-07,5.21898e-10,0.00579438,0.00011009,6.09872e-07,8.10492e-10,0.00590508,0.000111312,6.12303e-07,4.27046e-10,0.00601701,0.000112538,6.13585e-07,7.40878e-10,0.00613016,0.000113767,6.15807e-07,8.00469e-10,0.00624454,0.000115001,6.18209e-07,2.48178e-10,0.00636016,0.000116238,6.18953e-07,1.00073e-09,0.00647702,0.000117479,6.21955e-07,4.05654e-10,0.00659512,0.000118724,6.23172e-07,6.36192e-10,0.00671447,0.000119973,6.25081e-07,7.74927e-10,0.00683507,0.000121225,6.27406e-07,4.54975e-10,0.00695692,0.000122481,6.28771e-07,6.64841e-10,0.00708003,0.000123741,6.30765e-07,6.10972e-10,0.00720441,0.000125004,6.32598e-07,6.16543e-10,0.00733004,0.000126271,6.34448e-07,6.48204e-10,0.00745695,0.000127542,6.36392e-07,5.15835e-10,0.00758513,0.000128816,6.3794e-07,5.48103e-10,0.00771458,0.000130094,6.39584e-07,1.01706e-09,0.00784532,0.000131376,6.42635e-07,4.0283e-11,0.00797734,0.000132661,6.42756e-07,6.84471e-10,0.00811064,0.000133949,6.4481e-07,9.47144e-10,0.00824524,0.000135241,6.47651e-07,1.83472e-10,0.00838112,0.000136537,6.48201e-07,1.11296e-09,0.00851831,0.000137837,6.5154e-07,2.13163e-11,0.0086568,0.00013914,6.51604e-07,6.64462e-10,0.00879659,0.000140445,6.53598e-07,1.04613e-09,0.00893769,0.000141756,6.56736e-07,-1.92377e-10,0.0090801,0.000143069,6.56159e-07,1.58601e-09,0.00922383,0.000144386,6.60917e-07,-5.63754e-10,0.00936888,0.000145706,6.59226e-07,1.60033e-09,0.00951524,0.000147029,6.64027e-07,-2.49543e-10,0.00966294,0.000148356,6.63278e-07,1.26043e-09,0.00981196,0.000149687,6.67059e-07,-1.35572e-10,0.00996231,0.00015102,6.66653e-07,1.14458e-09,0.010114,0.000152357,6.70086e-07,2.13864e-10,0.010267,0.000153698,6.70728e-07,7.93856e-10,0.0104214,0.000155042,6.73109e-07,3.36077e-10,0.0105771,0.000156389,6.74118e-07,6.55765e-10,0.0107342,0.000157739,6.76085e-07,7.66211e-10,0.0108926,0.000159094,6.78384e-07,4.66116e-12,0.0110524,0.000160451,6.78398e-07,1.07775e-09,0.0112135,0.000161811,6.81631e-07,3.41023e-10,0.011376,0.000163175,6.82654e-07,3.5205e-10,0.0115398,0.000164541,6.8371e-07,1.04473e-09,0.0117051,0.000165912,6.86844e-07,1.25757e-10,0.0118717,0.000167286,6.87222e-07,3.14818e-10,0.0120396,0.000168661,6.88166e-07,1.40886e-09,0.012209,0.000170042,6.92393e-07,-3.62244e-10,0.0123797,0.000171425,6.91306e-07,9.71397e-10,0.0125518,0.000172811,6.9422e-07,2.02003e-10,0.0127253,0.0001742,6.94826e-07,1.01448e-09,0.0129002,0.000175593,6.97869e-07,3.96653e-10,0.0130765,0.00017699,6.99059e-07,1.92927e-10,0.0132542,0.000178388,6.99638e-07,6.94305e-10,0.0134333,0.00017979,7.01721e-07,7.55108e-10,0.0136138,0.000181195,7.03986e-07,1.05918e-11,0.0137957,0.000182603,7.04018e-07,1.06513e-09,0.013979,0.000184015,7.07214e-07,3.85512e-10,0.0141637,0.00018543,7.0837e-07,1.86769e-10,0.0143499,0.000186848,7.0893e-07,7.30116e-10,0.0145374,0.000188268,7.11121e-07,6.17983e-10,0.0147264,0.000189692,7.12975e-07,5.23282e-10,0.0149168,0.000191119,7.14545e-07,8.28398e-11,0.0151087,0.000192549,7.14793e-07,1.0081e-09,0.0153019,0.000193981,7.17817e-07,5.41244e-10,0.0154966,0.000195418,7.19441e-07,-3.7907e-10,0.0156928,0.000196856,7.18304e-07,1.90641e-09,0.0158903,0.000198298,7.24023e-07,-7.27387e-10,0.0160893,0.000199744,7.21841e-07,1.00317e-09,0.0162898,0.000201191,7.24851e-07,4.39949e-10,0.0164917,0.000202642,7.2617e-07,9.6234e-10,0.0166951,0.000204097,7.29057e-07,-5.64019e-10,0.0168999,0.000205554,7.27365e-07,1.29374e-09,0.0171062,0.000207012,7.31247e-07,9.77025e-10,0.017314,0.000208478,7.34178e-07,-1.47651e-09,0.0175232,0.000209942,7.29748e-07,3.06636e-09,0.0177338,0.00021141,7.38947e-07,-1.47573e-09,0.017946,0.000212884,7.3452e-07,9.7386e-10,0.0181596,0.000214356,7.37442e-07,1.30562e-09,0.0183747,0.000215835,7.41358e-07,-6.08376e-10,0.0185913,0.000217315,7.39533e-07,1.12785e-09,0.0188093,0.000218798,7.42917e-07,-1.77711e-10,0.0190289,0.000220283,7.42384e-07,1.44562e-09,0.0192499,0.000221772,7.46721e-07,-1.68825e-11,0.0194724,0.000223266,7.4667e-07,4.84533e-10,0.0196964,0.000224761,7.48124e-07,-5.85298e-11,0.0199219,0.000226257,7.47948e-07,1.61217e-09,0.0201489,0.000227757,7.52785e-07,-8.02136e-10,0.0203775,0.00022926,7.50378e-07,1.59637e-09,0.0206075,0.000230766,7.55167e-07,4.47168e-12,0.020839,0.000232276,7.55181e-07,2.48387e-10,0.021072,0.000233787,7.55926e-07,8.6474e-10,0.0213066,0.000235302,7.5852e-07,1.78299e-11,0.0215426,0.000236819,7.58573e-07,9.26567e-10,0.0217802,0.000238339,7.61353e-07,1.34529e-12,0.0220193,0.000239862,7.61357e-07,9.30659e-10,0.0222599,0.000241387,7.64149e-07,1.34529e-12,0.0225021,0.000242915,7.64153e-07,9.26567e-10,0.0227458,0.000244447,7.66933e-07,1.76215e-11,0.022991,0.00024598,7.66986e-07,8.65536e-10,0.0232377,0.000247517,7.69582e-07,2.45677e-10,0.023486,0.000249057,7.70319e-07,1.44193e-11,0.0237358,0.000250598,7.70363e-07,1.55918e-09,0.0239872,0.000252143,7.7504e-07,-6.63173e-10,0.0242401,0.000253691,7.73051e-07,1.09357e-09,0.0244946,0.000255241,7.76331e-07,1.41919e-11,0.0247506,0.000256793,7.76374e-07,7.12248e-10,0.0250082,0.000258348,7.78511e-07,8.62049e-10,0.0252673,0.000259908,7.81097e-07,-4.35061e-10,0.025528,0.000261469,7.79792e-07,8.7825e-10,0.0257902,0.000263031,7.82426e-07,6.47181e-10,0.0260541,0.000264598,7.84368e-07,2.58448e-10,0.0263194,0.000266167,7.85143e-07,1.81558e-10,0.0265864,0.000267738,7.85688e-07,8.78041e-10,0.0268549,0.000269312,7.88322e-07,3.15102e-11,0.027125,0.000270889,7.88417e-07,8.58525e-10,0.0273967,0.000272468,7.90992e-07,2.59812e-10,0.02767,0.000274051,7.91772e-07,-3.5224e-11,0.0279448,0.000275634,7.91666e-07,1.74377e-09,0.0282212,0.000277223,7.96897e-07,-1.35196e-09,0.0284992,0.000278813,7.92841e-07,1.80141e-09,0.0287788,0.000280404,7.98246e-07,-2.65629e-10,0.0290601,0.000281999,7.97449e-07,1.12374e-09,0.0293428,0.000283598,8.0082e-07,-5.04106e-10,0.0296272,0.000285198,7.99308e-07,8.92764e-10,0.0299132,0.000286799,8.01986e-07,6.58379e-10,0.0302008,0.000288405,8.03961e-07,1.98971e-10,0.0304901,0.000290014,8.04558e-07,4.08382e-10,0.0307809,0.000291624,8.05783e-07,3.01839e-11,0.0310733,0.000293236,8.05874e-07,1.33343e-09,0.0313673,0.000294851,8.09874e-07,2.2419e-10,0.031663,0.000296472,8.10547e-07,-3.67606e-10,0.0319603,0.000298092,8.09444e-07,1.24624e-09,0.0322592,0.000299714,8.13182e-07,-8.92025e-10,0.0325597,0.000301338,8.10506e-07,2.32183e-09,0.0328619,0.000302966,8.17472e-07,-9.44719e-10,0.0331657,0.000304598,8.14638e-07,1.45703e-09,0.0334711,0.000306232,8.19009e-07,-1.15805e-09,0.0337781,0.000307866,8.15535e-07,3.17507e-09,0.0340868,0.000309507,8.2506e-07,-4.09161e-09,0.0343971,0.000311145,8.12785e-07,5.74079e-09,0.0347091,0.000312788,8.30007e-07,-3.97034e-09,0.0350227,0.000314436,8.18096e-07,2.68985e-09,0.035338,0.00031608,8.26166e-07,6.61676e-10,0.0356549,0.000317734,8.28151e-07,-1.61123e-09,0.0359734,0.000319386,8.23317e-07,2.05786e-09,0.0362936,0.000321038,8.29491e-07,8.30388e-10,0.0366155,0.0003227,8.31982e-07,-1.65424e-09,0.036939,0.000324359,8.27019e-07,2.06129e-09,0.0372642,0.000326019,8.33203e-07,8.59719e-10,0.0375911,0.000327688,8.35782e-07,-1.77488e-09,0.0379196,0.000329354,8.30458e-07,2.51464e-09,0.0382498,0.000331023,8.38002e-07,-8.33135e-10,0.0385817,0.000332696,8.35502e-07,8.17825e-10,0.0389152,0.00033437,8.37956e-07,1.28718e-09,0.0392504,0.00033605,8.41817e-07,-2.2413e-09,0.0395873,0.000337727,8.35093e-07,3.95265e-09,0.0399258,0.000339409,8.46951e-07,-2.39332e-09,0.0402661,0.000341095,8.39771e-07,1.89533e-09,0.040608,0.000342781,8.45457e-07,-1.46271e-09,0.0409517,0.000344467,8.41069e-07,3.95554e-09,0.041297,0.000346161,8.52936e-07,-3.18369e-09,0.041644,0.000347857,8.43385e-07,1.32873e-09,0.0419927,0.000349548,8.47371e-07,1.59402e-09,0.0423431,0.000351248,8.52153e-07,-2.54336e-10,0.0426952,0.000352951,8.5139e-07,-5.76676e-10,0.043049,0.000354652,8.4966e-07,2.56114e-09,0.0434045,0.000356359,8.57343e-07,-2.21744e-09,0.0437617,0.000358067,8.50691e-07,2.58344e-09,0.0441206,0.000359776,8.58441e-07,-6.65826e-10,0.0444813,0.000361491,8.56444e-07,7.99218e-11,0.0448436,0.000363204,8.56684e-07,3.46063e-10,0.0452077,0.000364919,8.57722e-07,2.26116e-09,0.0455734,0.000366641,8.64505e-07,-1.94005e-09,0.045941,0.000368364,8.58685e-07,1.77384e-09,0.0463102,0.000370087,8.64007e-07,-1.43005e-09,0.0466811,0.000371811,8.59717e-07,3.94634e-09,0.0470538,0.000373542,8.71556e-07,-3.17946e-09,0.0474282,0.000375276,8.62017e-07,1.32104e-09,0.0478043,0.000377003,8.6598e-07,1.62045e-09,0.0481822,0.00037874,8.70842e-07,-3.52297e-10,0.0485618,0.000380481,8.69785e-07,-2.11211e-10,0.0489432,0.00038222,8.69151e-07,1.19716e-09,0.0493263,0.000383962,8.72743e-07,-8.52026e-10,0.0497111,0.000385705,8.70187e-07,2.21092e-09,0.0500977,0.000387452,8.76819e-07,-5.41339e-10,0.050486,0.000389204,8.75195e-07,-4.5361e-11,0.0508761,0.000390954,8.75059e-07,7.22669e-10,0.0512679,0.000392706,8.77227e-07,8.79936e-10,0.0516615,0.000394463,8.79867e-07,-5.17048e-10,0.0520568,0.000396222,8.78316e-07,1.18833e-09,0.0524539,0.000397982,8.81881e-07,-5.11022e-10,0.0528528,0.000399744,8.80348e-07,8.55683e-10,0.0532534,0.000401507,8.82915e-07,8.13562e-10,0.0536558,0.000403276,8.85356e-07,-3.84603e-10,0.05406,0.000405045,8.84202e-07,7.24962e-10,0.0544659,0.000406816,8.86377e-07,1.20986e-09,0.0548736,0.000408592,8.90006e-07,-1.83896e-09,0.0552831,0.000410367,8.84489e-07,2.42071e-09,0.0556944,0.000412143,8.91751e-07,-3.93413e-10,0.0561074,0.000413925,8.90571e-07,-8.46967e-10,0.0565222,0.000415704,8.8803e-07,3.78122e-09,0.0569388,0.000417491,8.99374e-07,-3.1021e-09,0.0573572,0.000419281,8.90068e-07,1.17658e-09,0.0577774,0.000421064,8.93597e-07,2.12117e-09,0.0581993,0.000422858,8.99961e-07,-2.21068e-09,0.0586231,0.000424651,8.93329e-07,2.9961e-09,0.0590486,0.000426447,9.02317e-07,-2.32311e-09,0.059476,0.000428244,8.95348e-07,2.57122e-09,0.0599051,0.000430043,9.03062e-07,-5.11098e-10,0.0603361,0.000431847,9.01528e-07,-5.27166e-10,0.0607688,0.000433649,8.99947e-07,2.61984e-09,0.0612034,0.000435457,9.07806e-07,-2.50141e-09,0.0616397,0.000437265,9.00302e-07,3.66045e-09,0.0620779,0.000439076,9.11283e-07,-4.68977e-09,0.0625179,0.000440885,8.97214e-07,7.64783e-09,0.0629597,0.000442702,9.20158e-07,-7.27499e-09,0.0634033,0.000444521,8.98333e-07,6.55113e-09,0.0638487,0.000446337,9.17986e-07,-4.02844e-09,0.0642959,0.000448161,9.05901e-07,2.11196e-09,0.064745,0.000449979,9.12236e-07,3.03125e-09,0.0651959,0.000451813,9.2133e-07,-6.78648e-09,0.0656486,0.000453635,9.00971e-07,9.21375e-09,0.0661032,0.000455464,9.28612e-07,-7.71684e-09,0.0665596,0.000457299,9.05462e-07,6.7522e-09,0.0670178,0.00045913,9.25718e-07,-4.3907e-09,0.0674778,0.000460968,9.12546e-07,3.36e-09,0.0679397,0.000462803,9.22626e-07,-1.59876e-09,0.0684034,0.000464644,9.1783e-07,3.0351e-09,0.068869,0.000466488,9.26935e-07,-3.09101e-09,0.0693364,0.000468333,9.17662e-07,1.8785e-09,0.0698057,0.000470174,9.23298e-07,3.02733e-09,0.0702768,0.00047203,9.3238e-07,-6.53722e-09,0.0707497,0.000473875,9.12768e-07,8.22054e-09,0.0712245,0.000475725,9.37429e-07,-3.99325e-09,0.0717012,0.000477588,9.2545e-07,3.01839e-10,0.0721797,0.00047944,9.26355e-07,2.78597e-09,0.0726601,0.000481301,9.34713e-07,-3.99507e-09,0.0731423,0.000483158,9.22728e-07,5.7435e-09,0.0736264,0.000485021,9.39958e-07,-4.07776e-09,0.0741123,0.000486888,9.27725e-07,3.11695e-09,0.0746002,0.000488753,9.37076e-07,-9.39394e-10,0.0750898,0.000490625,9.34258e-07,6.4055e-10,0.0755814,0.000492495,9.3618e-07,-1.62265e-09,0.0760748,0.000494363,9.31312e-07,5.84995e-09,0.0765701,0.000496243,9.48861e-07,-6.87601e-09,0.0770673,0.00049812,9.28233e-07,6.75296e-09,0.0775664,0.000499997,9.48492e-07,-5.23467e-09,0.0780673,0.000501878,9.32788e-07,6.73523e-09,0.0785701,0.000503764,9.52994e-07,-6.80514e-09,0.0790748,0.000505649,9.32578e-07,5.5842e-09,0.0795814,0.000507531,9.49331e-07,-6.30583e-10,0.0800899,0.000509428,9.47439e-07,-3.0618e-09,0.0806003,0.000511314,9.38254e-07,5.4273e-09,0.0811125,0.000513206,9.54536e-07,-3.74627e-09,0.0816267,0.000515104,9.43297e-07,2.10713e-09,0.0821427,0.000516997,9.49618e-07,2.76839e-09,0.0826607,0.000518905,9.57924e-07,-5.73006e-09,0.0831805,0.000520803,9.40733e-07,5.25072e-09,0.0837023,0.0005227,9.56486e-07,-3.71718e-10,0.084226,0.000524612,9.5537e-07,-3.76404e-09,0.0847515,0.000526512,9.44078e-07,7.97735e-09,0.085279,0.000528424,9.6801e-07,-5.79367e-09,0.0858084,0.000530343,9.50629e-07,2.96268e-10,0.0863397,0.000532245,9.51518e-07,4.6086e-09,0.0868729,0.000534162,9.65344e-07,-3.82947e-09,0.087408,0.000536081,9.53856e-07,3.25861e-09,0.087945,0.000537998,9.63631e-07,-1.7543e-09,0.088484,0.00053992,9.58368e-07,3.75849e-09,0.0890249,0.000541848,9.69644e-07,-5.82891e-09,0.0895677,0.00054377,9.52157e-07,4.65593e-09,0.0901124,0.000545688,9.66125e-07,2.10643e-09,0.0906591,0.000547627,9.72444e-07,-5.63099e-09,0.0912077,0.000549555,9.55551e-07,5.51627e-09,0.0917582,0.000551483,9.721e-07,-1.53292e-09,0.0923106,0.000553422,9.67501e-07,6.15311e-10,0.092865,0.000555359,9.69347e-07,-9.28291e-10,0.0934213,0.000557295,9.66562e-07,3.09774e-09,0.0939796,0.000559237,9.75856e-07,-4.01186e-09,0.0945398,0.000561177,9.6382e-07,5.49892e-09,0.095102,0.000563121,9.80317e-07,-3.08258e-09,0.0956661,0.000565073,9.71069e-07,-6.19176e-10,0.0962321,0.000567013,9.69212e-07,5.55932e-09,0.0968001,0.000568968,9.8589e-07,-6.71704e-09,0.09737,0.00057092,9.65738e-07,6.40762e-09,0.0979419,0.00057287,9.84961e-07,-4.0122e-09,0.0985158,0.000574828,9.72925e-07,2.19059e-09,0.0990916,0.000576781,9.79496e-07,2.70048e-09,0.0996693,0.000578748,9.87598e-07,-5.54193e-09,0.100249,0.000580706,9.70972e-07,4.56597e-09,0.100831,0.000582662,9.8467e-07,2.17923e-09,0.101414,0.000584638,9.91208e-07,-5.83232e-09,0.102,0.000586603,9.73711e-07,6.24884e-09,0.102588,0.000588569,9.92457e-07,-4.26178e-09,0.103177,0.000590541,9.79672e-07,3.34781e-09,0.103769,0.00059251,9.89715e-07,-1.67904e-09,0.104362,0.000594485,9.84678e-07,3.36839e-09,0.104958,0.000596464,9.94783e-07,-4.34397e-09,0.105555,0.000598441,9.81751e-07,6.55696e-09,0.106155,0.000600424,1.00142e-06,-6.98272e-09,0.106756,0.000602406,9.80474e-07,6.4728e-09,0.107359,0.000604386,9.99893e-07,-4.00742e-09,0.107965,0.000606374,9.8787e-07,2.10654e-09,0.108572,0.000608356,9.9419e-07,3.0318e-09,0.109181,0.000610353,1.00329e-06,-6.7832e-09,0.109793,0.00061234,9.82936e-07,9.1998e-09,0.110406,0.000614333,1.01054e-06,-7.6642e-09,0.111021,0.000616331,9.87543e-07,6.55579e-09,0.111639,0.000618326,1.00721e-06,-3.65791e-09,0.112258,0.000620329,9.96236e-07,6.25467e-10,0.112879,0.000622324,9.98113e-07,1.15593e-09,0.113503,0.000624323,1.00158e-06,2.20158e-09,0.114128,0.000626333,1.00819e-06,-2.51191e-09,0.114755,0.000628342,1.00065e-06,3.95517e-10,0.115385,0.000630345,1.00184e-06,9.29807e-10,0.116016,0.000632351,1.00463e-06,3.33599e-09,0.116649,0.00063437,1.01463e-06,-6.82329e-09,0.117285,0.000636379,9.94163e-07,9.05595e-09,0.117922,0.000638395,1.02133e-06,-7.04862e-09,0.118562,0.000640416,1.00019e-06,4.23737e-09,0.119203,0.000642429,1.0129e-06,-2.45033e-09,0.119847,0.000644448,1.00555e-06,5.56395e-09,0.120492,0.000646475,1.02224e-06,-4.9043e-09,0.121139,0.000648505,1.00753e-06,-8.47952e-10,0.121789,0.000650518,1.00498e-06,8.29622e-09,0.122441,0.000652553,1.02987e-06,-9.98538e-09,0.123094,0.000654582,9.99914e-07,9.2936e-09,0.12375,0.00065661,1.02779e-06,-4.83707e-09,0.124407,0.000658651,1.01328e-06,2.60411e-09,0.125067,0.000660685,1.0211e-06,-5.57945e-09,0.125729,0.000662711,1.00436e-06,1.22631e-08,0.126392,0.000664756,1.04115e-06,-1.36704e-08,0.127058,0.000666798,1.00014e-06,1.26161e-08,0.127726,0.000668836,1.03798e-06,-6.99155e-09,0.128396,0.000670891,1.01701e-06,4.48836e-10,0.129068,0.000672926,1.01836e-06,5.19606e-09,0.129742,0.000674978,1.03394e-06,-6.3319e-09,0.130418,0.000677027,1.01495e-06,5.2305e-09,0.131096,0.000679073,1.03064e-06,3.11123e-10,0.131776,0.000681135,1.03157e-06,-6.47511e-09,0.132458,0.000683179,1.01215e-06,1.06882e-08,0.133142,0.000685235,1.04421e-06,-6.47519e-09,0.133829,0.000687304,1.02479e-06,3.11237e-10,0.134517,0.000689355,1.02572e-06,5.23035e-09,0.135207,0.000691422,1.04141e-06,-6.3316e-09,0.1359,0.000693486,1.02242e-06,5.19484e-09,0.136594,0.000695546,1.038e-06,4.53497e-10,0.137291,0.000697623,1.03936e-06,-7.00891e-09,0.137989,0.000699681,1.01834e-06,1.2681e-08,0.13869,0.000701756,1.05638e-06,-1.39128e-08,0.139393,0.000703827,1.01464e-06,1.31679e-08,0.140098,0.000705896,1.05414e-06,-8.95659e-09,0.140805,0.000707977,1.02727e-06,7.75742e-09,0.141514,0.000710055,1.05055e-06,-7.17182e-09,0.142225,0.000712135,1.02903e-06,6.02862e-09,0.142938,0.000714211,1.04712e-06,-2.04163e-09,0.143653,0.000716299,1.04099e-06,2.13792e-09,0.144371,0.000718387,1.04741e-06,-6.51009e-09,0.14509,0.000720462,1.02787e-06,9.00123e-09,0.145812,0.000722545,1.05488e-06,3.07523e-10,0.146535,0.000724656,1.0558e-06,-1.02312e-08,0.147261,0.000726737,1.02511e-06,1.0815e-08,0.147989,0.000728819,1.05755e-06,-3.22681e-09,0.148719,0.000730925,1.04787e-06,2.09244e-09,0.14945,0.000733027,1.05415e-06,-5.143e-09,0.150185,0.00073512,1.03872e-06,3.57844e-09,0.150921,0.000737208,1.04946e-06,5.73027e-09,0.151659,0.000739324,1.06665e-06,-1.15983e-08,0.152399,0.000741423,1.03185e-06,1.08605e-08,0.153142,0.000743519,1.06443e-06,-2.04106e-09,0.153886,0.000745642,1.05831e-06,-2.69642e-09,0.154633,0.00074775,1.05022e-06,-2.07425e-09,0.155382,0.000749844,1.044e-06,1.09934e-08,0.156133,0.000751965,1.07698e-06,-1.20972e-08,0.156886,0.000754083,1.04069e-06,7.59288e-09,0.157641,0.000756187,1.06347e-06,-3.37305e-09,0.158398,0.000758304,1.05335e-06,5.89921e-09,0.159158,0.000760428,1.07104e-06,-5.32248e-09,0.159919,0.000762554,1.05508e-06,4.8927e-10,0.160683,0.000764666,1.05654e-06,3.36547e-09,0.161448,0.000766789,1.06664e-06,9.50081e-10,0.162216,0.000768925,1.06949e-06,-7.16568e-09,0.162986,0.000771043,1.04799e-06,1.28114e-08,0.163758,0.000773177,1.08643e-06,-1.42774e-08,0.164533,0.000775307,1.0436e-06,1.44956e-08,0.165309,0.000777438,1.08708e-06,-1.39025e-08,0.166087,0.00077957,1.04538e-06,1.13118e-08,0.166868,0.000781695,1.07931e-06,-1.54224e-09,0.167651,0.000783849,1.07468e-06,-5.14312e-09,0.168436,0.000785983,1.05925e-06,7.21381e-09,0.169223,0.000788123,1.0809e-06,-8.81096e-09,0.170012,0.000790259,1.05446e-06,1.31289e-08,0.170803,0.000792407,1.09385e-06,-1.39022e-08,0.171597,0.000794553,1.05214e-06,1.26775e-08,0.172392,0.000796695,1.09018e-06,-7.00557e-09,0.17319,0.000798855,1.06916e-06,4.43796e-10,0.17399,0.000800994,1.07049e-06,5.23031e-09,0.174792,0.000803151,1.08618e-06,-6.46397e-09,0.175596,0.000805304,1.06679e-06,5.72444e-09,0.176403,0.000807455,1.08396e-06,-1.53254e-09,0.177211,0.000809618,1.07937e-06,4.05673e-10,0.178022,0.000811778,1.08058e-06,-9.01916e-11,0.178835,0.000813939,1.08031e-06,-4.49821e-11,0.17965,0.000816099,1.08018e-06,2.70234e-10,0.180467,0.00081826,1.08099e-06,-1.03603e-09,0.181286,0.000820419,1.07788e-06,3.87392e-09,0.182108,0.000822587,1.0895e-06,4.41522e-10,0.182932,0.000824767,1.09083e-06,-5.63997e-09,0.183758,0.000826932,1.07391e-06,7.21707e-09,0.184586,0.000829101,1.09556e-06,-8.32718e-09,0.185416,0.000831267,1.07058e-06,1.11907e-08,0.186248,0.000833442,1.10415e-06,-6.63336e-09,0.187083,0.00083563,1.08425e-06,4.41484e-10,0.187919,0.0008378,1.08557e-06,4.86754e-09,0.188758,0.000839986,1.10017e-06,-5.01041e-09,0.189599,0.000842171,1.08514e-06,2.72811e-10,0.190443,0.000844342,1.08596e-06,3.91916e-09,0.191288,0.000846526,1.09772e-06,-1.04819e-09,0.192136,0.000848718,1.09457e-06,2.73531e-10,0.192985,0.000850908,1.0954e-06,-4.58916e-11,0.193837,0.000853099,1.09526e-06,-9.01158e-11,0.194692,0.000855289,1.09499e-06,4.06506e-10,0.195548,0.00085748,1.09621e-06,-1.53595e-09,0.196407,0.000859668,1.0916e-06,5.73717e-09,0.197267,0.000861869,1.10881e-06,-6.51164e-09,0.19813,0.000864067,1.08928e-06,5.40831e-09,0.198995,0.000866261,1.1055e-06,-2.20401e-10,0.199863,0.000868472,1.10484e-06,-4.52652e-09,0.200732,0.000870668,1.09126e-06,3.42508e-09,0.201604,0.000872861,1.10153e-06,5.72762e-09,0.202478,0.000875081,1.11872e-06,-1.14344e-08,0.203354,0.000877284,1.08441e-06,1.02076e-08,0.204233,0.000879484,1.11504e-06,4.06355e-10,0.205113,0.000881715,1.11626e-06,-1.18329e-08,0.205996,0.000883912,1.08076e-06,1.71227e-08,0.206881,0.000886125,1.13213e-06,-1.19546e-08,0.207768,0.000888353,1.09626e-06,8.93465e-10,0.208658,0.000890548,1.09894e-06,8.38062e-09,0.209549,0.000892771,1.12408e-06,-4.61353e-09,0.210443,0.000895006,1.11024e-06,-4.82756e-09,0.211339,0.000897212,1.09576e-06,9.02245e-09,0.212238,0.00089943,1.12283e-06,-1.45997e-09,0.213138,0.000901672,1.11845e-06,-3.18255e-09,0.214041,0.000903899,1.1089e-06,-7.11073e-10,0.214946,0.000906115,1.10677e-06,6.02692e-09,0.215853,0.000908346,1.12485e-06,-8.49548e-09,0.216763,0.00091057,1.09936e-06,1.30537e-08,0.217675,0.000912808,1.13852e-06,-1.3917e-08,0.218588,0.000915044,1.09677e-06,1.28121e-08,0.219505,0.000917276,1.13521e-06,-7.5288e-09,0.220423,0.000919523,1.11262e-06,2.40205e-09,0.221344,0.000921756,1.11983e-06,-2.07941e-09,0.222267,0.000923989,1.11359e-06,5.91551e-09,0.223192,0.000926234,1.13134e-06,-6.68149e-09,0.224119,0.000928477,1.11129e-06,5.90929e-09,0.225049,0.000930717,1.12902e-06,-2.05436e-09,0.22598,0.000932969,1.12286e-06,2.30807e-09,0.226915,0.000935222,1.12978e-06,-7.17796e-09,0.227851,0.00093746,1.10825e-06,1.15028e-08,0.228789,0.000939711,1.14276e-06,-9.03083e-09,0.22973,0.000941969,1.11566e-06,9.71932e-09,0.230673,0.00094423,1.14482e-06,-1.49452e-08,0.231619,0.000946474,1.09998e-06,2.02591e-08,0.232566,0.000948735,1.16076e-06,-2.13879e-08,0.233516,0.000950993,1.0966e-06,2.05888e-08,0.234468,0.000953247,1.15837e-06,-1.62642e-08,0.235423,0.000955515,1.10957e-06,1.46658e-08,0.236379,0.000957779,1.15357e-06,-1.25966e-08,0.237338,0.000960048,1.11578e-06,5.91793e-09,0.238299,0.000962297,1.13353e-06,3.82602e-09,0.239263,0.000964576,1.14501e-06,-6.3208e-09,0.240229,0.000966847,1.12605e-06,6.55613e-09,0.241197,0.000969119,1.14572e-06,-5.00268e-09,0.242167,0.000971395,1.13071e-06,-1.44659e-09,0.243139,0.000973652,1.12637e-06,1.07891e-08,0.244114,0.000975937,1.15874e-06,-1.19073e-08,0.245091,0.000978219,1.12302e-06,7.03782e-09,0.246071,0.000980486,1.14413e-06,-1.34276e-09,0.247052,0.00098277,1.1401e-06,-1.66669e-09,0.248036,0.000985046,1.1351e-06,8.00935e-09,0.249022,0.00098734,1.15913e-06,-1.54694e-08,0.250011,0.000989612,1.11272e-06,2.4066e-08,0.251002,0.000991909,1.18492e-06,-2.11901e-08,0.251995,0.000994215,1.12135e-06,1.08973e-09,0.25299,0.000996461,1.12462e-06,1.68311e-08,0.253988,0.000998761,1.17511e-06,-8.8094e-09,0.254987,0.00100109,1.14868e-06,-1.13958e-08,0.25599,0.00100335,1.1145e-06,2.45902e-08,0.256994,0.00100565,1.18827e-06,-2.73603e-08,0.258001,0.00100795,1.10618e-06,2.52464e-08,0.25901,0.00101023,1.18192e-06,-1.40207e-08,0.260021,0.00101256,1.13986e-06,1.03387e-09,0.261035,0.00101484,1.14296e-06,9.8853e-09,0.262051,0.00101715,1.17262e-06,-1.07726e-08,0.263069,0.00101947,1.1403e-06,3.40272e-09,0.26409,0.00102176,1.15051e-06,-2.83827e-09,0.265113,0.00102405,1.142e-06,7.95039e-09,0.266138,0.00102636,1.16585e-06,8.39047e-10,0.267166,0.00102869,1.16836e-06,-1.13066e-08,0.268196,0.00103099,1.13444e-06,1.4585e-08,0.269228,0.00103331,1.1782e-06,-1.72314e-08,0.270262,0.00103561,1.1265e-06,2.45382e-08,0.271299,0.00103794,1.20012e-06,-2.13166e-08,0.272338,0.00104028,1.13617e-06,1.12364e-09,0.273379,0.00104255,1.13954e-06,1.68221e-08,0.274423,0.00104488,1.19001e-06,-8.80736e-09,0.275469,0.00104723,1.16358e-06,-1.13948e-08,0.276518,0.00104953,1.1294e-06,2.45839e-08,0.277568,0.00105186,1.20315e-06,-2.73361e-08,0.278621,0.00105418,1.12114e-06,2.51559e-08,0.279677,0.0010565,1.19661e-06,-1.36832e-08,0.280734,0.00105885,1.15556e-06,-2.25706e-10,0.281794,0.00106116,1.15488e-06,1.45862e-08,0.282857,0.00106352,1.19864e-06,-2.83167e-08,0.283921,0.00106583,1.11369e-06,3.90759e-08,0.284988,0.00106817,1.23092e-06,-3.85801e-08,0.286058,0.00107052,1.11518e-06,2.58375e-08,0.287129,0.00107283,1.19269e-06,-5.16498e-09,0.288203,0.0010752,1.1772e-06,-5.17768e-09,0.28928,0.00107754,1.16167e-06,-3.92671e-09,0.290358,0.00107985,1.14988e-06,2.08846e-08,0.29144,0.00108221,1.21254e-06,-2.00072e-08,0.292523,0.00108458,1.15252e-06,-4.60659e-10,0.293609,0.00108688,1.15114e-06,2.18499e-08,0.294697,0.00108925,1.21669e-06,-2.73343e-08,0.295787,0.0010916,1.13468e-06,2.78826e-08,0.29688,0.00109395,1.21833e-06,-2.45915e-08,0.297975,0.00109632,1.14456e-06,1.08787e-08,0.299073,0.00109864,1.17719e-06,1.08788e-08,0.300172,0.00110102,1.20983e-06,-2.45915e-08,0.301275,0.00110337,1.13605e-06,2.78828e-08,0.302379,0.00110573,1.2197e-06,-2.73348e-08,0.303486,0.00110808,1.1377e-06,2.18518e-08,0.304595,0.00111042,1.20325e-06,-4.67556e-10,0.305707,0.00111283,1.20185e-06,-1.99816e-08,0.306821,0.00111517,1.14191e-06,2.07891e-08,0.307937,0.00111752,1.20427e-06,-3.57026e-09,0.309056,0.00111992,1.19356e-06,-6.50797e-09,0.310177,0.00112228,1.17404e-06,-2.00165e-10,0.3113,0.00112463,1.17344e-06,7.30874e-09,0.312426,0.001127,1.19536e-06,7.67424e-10,0.313554,0.00112939,1.19767e-06,-1.03784e-08,0.314685,0.00113176,1.16653e-06,1.09437e-08,0.315818,0.00113412,1.19936e-06,-3.59406e-09,0.316953,0.00113651,1.18858e-06,3.43251e-09,0.318091,0.0011389,1.19888e-06,-1.0136e-08,0.319231,0.00114127,1.16847e-06,7.30915e-09,0.320374,0.00114363,1.1904e-06,1.07018e-08,0.321518,0.00114604,1.2225e-06,-2.03137e-08,0.322666,0.00114842,1.16156e-06,1.09484e-08,0.323815,0.00115078,1.19441e-06,6.32224e-09,0.324967,0.00115319,1.21337e-06,-6.43509e-09,0.326122,0.00115559,1.19407e-06,-1.03842e-08,0.327278,0.00115795,1.16291e-06,1.81697e-08,0.328438,0.00116033,1.21742e-06,-2.6901e-09,0.329599,0.00116276,1.20935e-06,-7.40939e-09,0.330763,0.00116515,1.18713e-06,2.52533e-09,0.331929,0.00116754,1.1947e-06,-2.69191e-09,0.333098,0.00116992,1.18663e-06,8.24218e-09,0.334269,0.00117232,1.21135e-06,-4.74377e-10,0.335443,0.00117474,1.20993e-06,-6.34471e-09,0.336619,0.00117714,1.1909e-06,-3.94922e-09,0.337797,0.00117951,1.17905e-06,2.21417e-08,0.338978,0.00118193,1.24547e-06,-2.50128e-08,0.340161,0.00118435,1.17043e-06,1.8305e-08,0.341346,0.00118674,1.22535e-06,-1.84048e-08,0.342534,0.00118914,1.17013e-06,2.55121e-08,0.343725,0.00119156,1.24667e-06,-2.40389e-08,0.344917,0.00119398,1.17455e-06,1.10389e-08,0.346113,0.00119636,1.20767e-06,9.68574e-09,0.34731,0.0011988,1.23673e-06,-1.99797e-08,0.34851,0.00120122,1.17679e-06,1.06284e-08,0.349713,0.0012036,1.20867e-06,7.26868e-09,0.350917,0.00120604,1.23048e-06,-9.90072e-09,0.352125,0.00120847,1.20078e-06,2.53177e-09,0.353334,0.00121088,1.20837e-06,-2.26199e-10,0.354546,0.0012133,1.20769e-06,-1.62705e-09,0.355761,0.00121571,1.20281e-06,6.73435e-09,0.356978,0.00121813,1.22302e-06,4.49207e-09,0.358197,0.00122059,1.23649e-06,-2.47027e-08,0.359419,0.00122299,1.16238e-06,3.47142e-08,0.360643,0.00122542,1.26653e-06,-2.47472e-08,0.36187,0.00122788,1.19229e-06,4.66965e-09,0.363099,0.00123028,1.20629e-06,6.06872e-09,0.36433,0.00123271,1.2245e-06,8.57729e-10,0.365564,0.00123516,1.22707e-06,-9.49952e-09,0.366801,0.00123759,1.19858e-06,7.33792e-09,0.36804,0.00124001,1.22059e-06,9.95025e-09,0.369281,0.00124248,1.25044e-06,-1.73366e-08,0.370525,0.00124493,1.19843e-06,-2.08464e-10,0.371771,0.00124732,1.1978e-06,1.81704e-08,0.373019,0.00124977,1.25232e-06,-1.28683e-08,0.37427,0.00125224,1.21371e-06,3.50042e-09,0.375524,0.00125468,1.22421e-06,-1.1335e-09,0.37678,0.00125712,1.22081e-06,1.03345e-09,0.378038,0.00125957,1.22391e-06,-3.00023e-09,0.379299,0.00126201,1.21491e-06,1.09676e-08,0.380562,0.00126447,1.24781e-06,-1.10676e-08,0.381828,0.00126693,1.21461e-06,3.50042e-09,0.383096,0.00126937,1.22511e-06,-2.93403e-09,0.384366,0.00127181,1.21631e-06,8.23574e-09,0.385639,0.00127427,1.24102e-06,-2.06607e-10,0.386915,0.00127675,1.2404e-06,-7.40935e-09,0.388193,0.00127921,1.21817e-06,4.1761e-11,0.389473,0.00128165,1.21829e-06,7.24223e-09,0.390756,0.0012841,1.24002e-06,7.91564e-10,0.392042,0.00128659,1.2424e-06,-1.04086e-08,0.393329,0.00128904,1.21117e-06,1.10405e-08,0.39462,0.0012915,1.24429e-06,-3.951e-09,0.395912,0.00129397,1.23244e-06,4.7634e-09,0.397208,0.00129645,1.24673e-06,-1.51025e-08,0.398505,0.0012989,1.20142e-06,2.58443e-08,0.399805,0.00130138,1.27895e-06,-2.86702e-08,0.401108,0.00130385,1.19294e-06,2.92318e-08,0.402413,0.00130632,1.28064e-06,-2.86524e-08,0.403721,0.0013088,1.19468e-06,2.57731e-08,0.405031,0.00131127,1.272e-06,-1.48355e-08,0.406343,0.00131377,1.2275e-06,3.76652e-09,0.407658,0.00131623,1.23879e-06,-2.30784e-10,0.408976,0.00131871,1.2381e-06,-2.84331e-09,0.410296,0.00132118,1.22957e-06,1.16041e-08,0.411618,0.00132367,1.26438e-06,-1.37708e-08,0.412943,0.00132616,1.22307e-06,1.36768e-08,0.41427,0.00132865,1.2641e-06,-1.1134e-08,0.4156,0.00133114,1.2307e-06,1.05714e-09,0.416933,0.00133361,1.23387e-06,6.90538e-09,0.418267,0.00133609,1.25459e-06,1.12372e-09,0.419605,0.00133861,1.25796e-06,-1.14002e-08,0.420945,0.00134109,1.22376e-06,1.46747e-08,0.422287,0.00134358,1.26778e-06,-1.7496e-08,0.423632,0.00134606,1.21529e-06,2.5507e-08,0.424979,0.00134857,1.29182e-06,-2.49272e-08,0.426329,0.00135108,1.21703e-06,1.45972e-08,0.427681,0.00135356,1.26083e-06,-3.65935e-09,0.429036,0.00135607,1.24985e-06,4.00178e-11,0.430393,0.00135857,1.24997e-06,3.49917e-09,0.431753,0.00136108,1.26047e-06,-1.40366e-08,0.433116,0.00136356,1.21836e-06,2.28448e-08,0.43448,0.00136606,1.28689e-06,-1.77378e-08,0.435848,0.00136858,1.23368e-06,1.83043e-08,0.437218,0.0013711,1.28859e-06,-2.56769e-08,0.43859,0.0013736,1.21156e-06,2.47987e-08,0.439965,0.0013761,1.28595e-06,-1.39133e-08,0.441342,0.00137863,1.24421e-06,1.05202e-09,0.442722,0.00138112,1.24737e-06,9.70507e-09,0.444104,0.00138365,1.27649e-06,-1.00698e-08,0.445489,0.00138617,1.24628e-06,7.72123e-10,0.446877,0.00138867,1.24859e-06,6.98132e-09,0.448267,0.00139118,1.26954e-06,1.10477e-09,0.449659,0.00139373,1.27285e-06,-1.14003e-08,0.451054,0.00139624,1.23865e-06,1.4694e-08,0.452452,0.00139876,1.28273e-06,-1.75734e-08,0.453852,0.00140127,1.23001e-06,2.5797e-08,0.455254,0.00140381,1.3074e-06,-2.60097e-08,0.456659,0.00140635,1.22937e-06,1.86371e-08,0.458067,0.00140886,1.28529e-06,-1.8736e-08,0.459477,0.00141137,1.22908e-06,2.65048e-08,0.46089,0.00141391,1.30859e-06,-2.76784e-08,0.462305,0.00141645,1.22556e-06,2.46043e-08,0.463722,0.00141897,1.29937e-06,-1.11341e-08,0.465143,0.00142154,1.26597e-06,-9.87033e-09,0.466565,0.00142404,1.23636e-06,2.08131e-08,0.467991,0.00142657,1.2988e-06,-1.37773e-08,0.469419,0.00142913,1.25746e-06,4.49378e-09,0.470849,0.00143166,1.27094e-06,-4.19781e-09,0.472282,0.00143419,1.25835e-06,1.22975e-08,0.473717,0.00143674,1.29524e-06,-1.51902e-08,0.475155,0.00143929,1.24967e-06,1.86608e-08,0.476596,0.00144184,1.30566e-06,-2.96506e-08,0.478039,0.00144436,1.2167e-06,4.03368e-08,0.479485,0.00144692,1.33771e-06,-4.22896e-08,0.480933,0.00144947,1.21085e-06,3.94148e-08,0.482384,0.00145201,1.32909e-06,-2.59626e-08,0.483837,0.00145459,1.2512e-06,4.83124e-09,0.485293,0.0014571,1.2657e-06,6.63757e-09,0.486751,0.00145966,1.28561e-06,-1.57911e-09,0.488212,0.00146222,1.28087e-06,-3.21468e-10,0.489676,0.00146478,1.27991e-06,2.86517e-09,0.491142,0.00146735,1.2885e-06,-1.11392e-08,0.49261,0.00146989,1.25508e-06,1.18893e-08,0.494081,0.00147244,1.29075e-06,-6.61574e-09,0.495555,0.001475,1.27091e-06,1.45736e-08,0.497031,0.00147759,1.31463e-06,-2.18759e-08,0.49851,0.00148015,1.249e-06,1.33252e-08,0.499992,0.00148269,1.28897e-06,-1.62277e-09,0.501476,0.00148526,1.28411e-06,-6.83421e-09,0.502962,0.00148781,1.2636e-06,2.89596e-08,0.504451,0.00149042,1.35048e-06,-4.93997e-08,0.505943,0.00149298,1.20228e-06,4.94299e-08,0.507437,0.00149553,1.35057e-06,-2.91107e-08,0.508934,0.00149814,1.26324e-06,7.40848e-09,0.510434,0.00150069,1.28547e-06,-5.23187e-10,0.511936,0.00150326,1.2839e-06,-5.31585e-09,0.51344,0.00150581,1.26795e-06,2.17866e-08,0.514947,0.00150841,1.33331e-06,-2.22257e-08,0.516457,0.00151101,1.26663e-06,7.51178e-09,0.517969,0.00151357,1.28917e-06,-7.82128e-09,0.519484,0.00151613,1.2657e-06,2.37733e-08,0.521002,0.00151873,1.33702e-06,-2.76674e-08,0.522522,0.00152132,1.25402e-06,2.72917e-08,0.524044,0.00152391,1.3359e-06,-2.18949e-08,0.525569,0.00152652,1.27021e-06,6.83372e-10,0.527097,0.00152906,1.27226e-06,1.91613e-08,0.528628,0.00153166,1.32974e-06,-1.77241e-08,0.53016,0.00153427,1.27657e-06,-7.86963e-09,0.531696,0.0015368,1.25296e-06,4.92027e-08,0.533234,0.00153945,1.40057e-06,-6.9732e-08,0.534775,0.00154204,1.19138e-06,5.09114e-08,0.536318,0.00154458,1.34411e-06,-1.4704e-08,0.537864,0.00154722,1.3e-06,7.9048e-09,0.539413,0.00154984,1.32371e-06,-1.69152e-08,0.540964,0.00155244,1.27297e-06,1.51355e-10,0.542517,0.00155499,1.27342e-06,1.63099e-08,0.544074,0.00155758,1.32235e-06,-5.78647e-09,0.545633,0.00156021,1.30499e-06,6.83599e-09,0.547194,0.00156284,1.3255e-06,-2.15575e-08,0.548758,0.00156543,1.26083e-06,1.97892e-08,0.550325,0.00156801,1.32019e-06,2.00525e-09,0.551894,0.00157065,1.32621e-06,-2.78103e-08,0.553466,0.00157322,1.24278e-06,4.96314e-08,0.555041,0.00157586,1.39167e-06,-5.1506e-08,0.556618,0.00157849,1.23716e-06,3.71835e-08,0.558198,0.00158107,1.34871e-06,-3.76233e-08,0.55978,0.00158366,1.23584e-06,5.37052e-08,0.561365,0.00158629,1.39695e-06,-5.79884e-08,0.562953,0.00158891,1.22299e-06,5.90392e-08,0.564543,0.00159153,1.4001e-06,-5.89592e-08,0.566136,0.00159416,1.22323e-06,5.7588e-08,0.567731,0.00159678,1.39599e-06,-5.21835e-08,0.569329,0.00159941,1.23944e-06,3.19369e-08,0.57093,0.00160199,1.33525e-06,-1.59594e-08,0.572533,0.00160461,1.28737e-06,3.19006e-08,0.574139,0.00160728,1.38307e-06,-5.20383e-08,0.575748,0.00160989,1.22696e-06,5.70431e-08,0.577359,0.00161251,1.39809e-06,-5.69247e-08,0.578973,0.00161514,1.22731e-06,5.14463e-08,0.580589,0.00161775,1.38165e-06,-2.9651e-08,0.582208,0.00162042,1.2927e-06,7.55339e-09,0.58383,0.00162303,1.31536e-06,-5.62636e-10,0.585455,0.00162566,1.31367e-06,-5.30281e-09,0.587081,0.00162827,1.29776e-06,2.17738e-08,0.588711,0.00163093,1.36309e-06,-2.21875e-08,0.590343,0.00163359,1.29652e-06,7.37164e-09,0.591978,0.00163621,1.31864e-06,-7.29907e-09,0.593616,0.00163882,1.29674e-06,2.18247e-08,0.595256,0.00164148,1.36221e-06,-2.03952e-08,0.596899,0.00164414,1.30103e-06,1.51241e-10,0.598544,0.00164675,1.30148e-06,1.97902e-08,0.600192,0.00164941,1.36085e-06,-1.97074e-08,0.601843,0.00165207,1.30173e-06,-5.65175e-10,0.603496,0.00165467,1.30004e-06,2.1968e-08,0.605152,0.00165734,1.36594e-06,-2.77024e-08,0.606811,0.00165999,1.28283e-06,2.92369e-08,0.608472,0.00166264,1.37054e-06,-2.96407e-08,0.610136,0.00166529,1.28162e-06,2.97215e-08,0.611803,0.00166795,1.37079e-06,-2.96408e-08,0.613472,0.0016706,1.28186e-06,2.92371e-08,0.615144,0.00167325,1.36957e-06,-2.77031e-08,0.616819,0.00167591,1.28647e-06,2.19708e-08,0.618496,0.00167855,1.35238e-06,-5.75407e-10,0.620176,0.00168125,1.35065e-06,-1.9669e-08,0.621858,0.00168389,1.29164e-06,1.96468e-08,0.623544,0.00168653,1.35058e-06,6.86403e-10,0.625232,0.00168924,1.35264e-06,-2.23924e-08,0.626922,0.00169187,1.28547e-06,2.92788e-08,0.628615,0.00169453,1.3733e-06,-3.51181e-08,0.630311,0.00169717,1.26795e-06,5.15889e-08,0.63201,0.00169987,1.42272e-06,-5.2028e-08,0.633711,0.00170255,1.26663e-06,3.73139e-08,0.635415,0.0017052,1.37857e-06,-3.76227e-08,0.637121,0.00170784,1.2657e-06,5.35722e-08,0.63883,0.00171054,1.42642e-06,-5.74567e-08,0.640542,0.00171322,1.25405e-06,5.70456e-08,0.642257,0.0017159,1.42519e-06,-5.15163e-08,0.643974,0.00171859,1.27064e-06,2.98103e-08,0.645694,0.00172122,1.36007e-06,-8.12016e-09,0.647417,0.00172392,1.33571e-06,2.67039e-09,0.649142,0.0017266,1.34372e-06,-2.56152e-09,0.65087,0.00172928,1.33604e-06,7.57571e-09,0.6526,0.00173197,1.35876e-06,-2.77413e-08,0.654334,0.00173461,1.27554e-06,4.3785e-08,0.65607,0.00173729,1.40689e-06,-2.81896e-08,0.657808,0.00174002,1.32233e-06,9.36893e-09,0.65955,0.00174269,1.35043e-06,-9.28617e-09,0.661294,0.00174536,1.32257e-06,2.77757e-08,0.66304,0.00174809,1.4059e-06,-4.2212e-08,0.66479,0.00175078,1.27926e-06,2.1863e-08,0.666542,0.0017534,1.34485e-06,1.43648e-08,0.668297,0.00175613,1.38795e-06,-1.97177e-08,0.670054,0.00175885,1.3288e-06,4.90115e-09,0.671814,0.00176152,1.3435e-06,1.13232e-10,0.673577,0.00176421,1.34384e-06,-5.3542e-09,0.675343,0.00176688,1.32778e-06,2.13035e-08,0.677111,0.0017696,1.39169e-06,-2.02553e-08,0.678882,0.00177232,1.33092e-06,1.13005e-10,0.680656,0.00177499,1.33126e-06,1.98031e-08,0.682432,0.00177771,1.39067e-06,-1.97211e-08,0.684211,0.00178043,1.33151e-06,-5.2349e-10,0.685993,0.00178309,1.32994e-06,2.18151e-08,0.687777,0.00178582,1.39538e-06,-2.71325e-08,0.689564,0.00178853,1.31398e-06,2.71101e-08,0.691354,0.00179124,1.39531e-06,-2.17035e-08,0.693147,0.00179396,1.3302e-06,9.92865e-11,0.694942,0.00179662,1.3305e-06,2.13063e-08,0.69674,0.00179935,1.39442e-06,-2.57198e-08,0.698541,0.00180206,1.31726e-06,2.19682e-08,0.700344,0.00180476,1.38317e-06,-2.54852e-09,0.70215,0.00180752,1.37552e-06,-1.17741e-08,0.703959,0.00181023,1.3402e-06,-9.95999e-09,0.705771,0.00181288,1.31032e-06,5.16141e-08,0.707585,0.00181566,1.46516e-06,-7.72869e-08,0.709402,0.00181836,1.2333e-06,7.87197e-08,0.711222,0.00182106,1.46946e-06,-5.87781e-08,0.713044,0.00182382,1.29312e-06,3.71834e-08,0.714869,0.00182652,1.40467e-06,-3.03511e-08,0.716697,0.00182924,1.31362e-06,2.46161e-08,0.718528,0.00183194,1.38747e-06,-8.5087e-09,0.720361,0.00183469,1.36194e-06,9.41892e-09,0.722197,0.00183744,1.3902e-06,-2.91671e-08,0.724036,0.00184014,1.3027e-06,4.76448e-08,0.725878,0.00184288,1.44563e-06,-4.22028e-08,0.727722,0.00184565,1.31902e-06,1.95682e-09,0.729569,0.00184829,1.3249e-06,3.43754e-08,0.731419,0.00185104,1.42802e-06,-2.0249e-08,0.733271,0.00185384,1.36727e-06,-1.29838e-08,0.735126,0.00185654,1.32832e-06,1.25794e-08,0.736984,0.00185923,1.36606e-06,2.22711e-08,0.738845,0.00186203,1.43287e-06,-4.20594e-08,0.740708,0.00186477,1.3067e-06,2.67571e-08,0.742574,0.00186746,1.38697e-06,-5.36424e-09,0.744443,0.00187022,1.37087e-06,-5.30023e-09,0.746315,0.00187295,1.35497e-06,2.65653e-08,0.748189,0.00187574,1.43467e-06,-4.13564e-08,0.750066,0.00187848,1.3106e-06,1.9651e-08,0.751946,0.00188116,1.36955e-06,2.23572e-08,0.753828,0.00188397,1.43663e-06,-4.9475e-08,0.755714,0.00188669,1.2882e-06,5.63335e-08,0.757602,0.00188944,1.4572e-06,-5.66499e-08,0.759493,0.00189218,1.28725e-06,5.10567e-08,0.761386,0.00189491,1.44042e-06,-2.83677e-08,0.763283,0.00189771,1.35532e-06,2.80962e-09,0.765182,0.00190042,1.36375e-06,1.71293e-08,0.767083,0.0019032,1.41513e-06,-1.17221e-08,0.768988,0.001906,1.37997e-06,-2.98453e-08,0.770895,0.00190867,1.29043e-06,7.14987e-08,0.772805,0.00191146,1.50493e-06,-7.73354e-08,0.774718,0.00191424,1.27292e-06,5.90292e-08,0.776634,0.00191697,1.45001e-06,-3.9572e-08,0.778552,0.00191975,1.33129e-06,3.9654e-08,0.780473,0.00192253,1.45026e-06,-5.94395e-08,0.782397,0.00192525,1.27194e-06,7.88945e-08,0.784324,0.00192803,1.50862e-06,-7.73249e-08,0.786253,0.00193082,1.27665e-06,5.15913e-08,0.788185,0.00193352,1.43142e-06,-9.83099e-09,0.79012,0.00193636,1.40193e-06,-1.22672e-08,0.792058,0.00193912,1.36513e-06,-7.05275e-10,0.793999,0.00194185,1.36301e-06,1.50883e-08,0.795942,0.00194462,1.40828e-06,-4.33147e-11,0.797888,0.00194744,1.40815e-06,-1.49151e-08,0.799837,0.00195021,1.3634e-06,9.93244e-11,0.801788,0.00195294,1.3637e-06,1.45179e-08,0.803743,0.00195571,1.40725e-06,1.43363e-09,0.8057,0.00195853,1.41155e-06,-2.02525e-08,0.80766,0.00196129,1.35079e-06,1.99718e-08,0.809622,0.00196405,1.41071e-06,-3.01649e-11,0.811588,0.00196687,1.41062e-06,-1.9851e-08,0.813556,0.00196964,1.35107e-06,1.98296e-08,0.815527,0.0019724,1.41056e-06,1.37485e-10,0.817501,0.00197522,1.41097e-06,-2.03796e-08,0.819477,0.00197798,1.34983e-06,2.17763e-08,0.821457,0.00198074,1.41516e-06,-7.12085e-09,0.823439,0.00198355,1.3938e-06,6.70707e-09,0.825424,0.00198636,1.41392e-06,-1.97074e-08,0.827412,0.00198913,1.35479e-06,1.25179e-08,0.829402,0.00199188,1.39235e-06,2.92405e-08,0.831396,0.00199475,1.48007e-06,-6.98755e-08,0.833392,0.0019975,1.27044e-06,7.14477e-08,0.835391,0.00200026,1.48479e-06,-3.71014e-08,0.837392,0.00200311,1.37348e-06,1.73533e-08,0.839397,0.00200591,1.42554e-06,-3.23118e-08,0.841404,0.00200867,1.32861e-06,5.2289e-08,0.843414,0.00201148,1.48547e-06,-5.76348e-08,0.845427,0.00201428,1.31257e-06,5.9041e-08,0.847443,0.00201708,1.48969e-06,-5.93197e-08,0.849461,0.00201988,1.31173e-06,5.90289e-08,0.851482,0.00202268,1.48882e-06,-5.75864e-08,0.853507,0.00202549,1.31606e-06,5.21075e-08,0.855533,0.00202828,1.47238e-06,-3.16344e-08,0.857563,0.00203113,1.37748e-06,1.48257e-08,0.859596,0.00203393,1.42196e-06,-2.76684e-08,0.861631,0.00203669,1.33895e-06,3.62433e-08,0.863669,0.00203947,1.44768e-06,1.90463e-09,0.86571,0.00204237,1.45339e-06,-4.38617e-08,0.867754,0.00204515,1.32181e-06,5.43328e-08,0.8698,0.00204796,1.48481e-06,-5.42603e-08,0.87185,0.00205076,1.32203e-06,4.34989e-08,0.873902,0.00205354,1.45252e-06,-5.26029e-10,0.875957,0.00205644,1.45095e-06,-4.13949e-08,0.878015,0.00205922,1.32676e-06,4.68962e-08,0.880075,0.00206201,1.46745e-06,-2.69807e-08,0.882139,0.00206487,1.38651e-06,1.42181e-09,0.884205,0.00206764,1.39077e-06,2.12935e-08,0.886274,0.00207049,1.45465e-06,-2.69912e-08,0.888346,0.00207332,1.37368e-06,2.70664e-08,0.890421,0.00207615,1.45488e-06,-2.16698e-08,0.892498,0.00207899,1.38987e-06,8.14756e-12,0.894579,0.00208177,1.38989e-06,2.16371e-08,0.896662,0.00208462,1.45481e-06,-2.6952e-08,0.898748,0.00208744,1.37395e-06,2.65663e-08,0.900837,0.00209027,1.45365e-06,-1.97084e-08,0.902928,0.00209312,1.39452e-06,-7.33731e-09,0.905023,0.00209589,1.37251e-06,4.90578e-08,0.90712,0.00209878,1.51968e-06,-6.96845e-08,0.90922,0.00210161,1.31063e-06,5.08664e-08,0.911323,0.00210438,1.46323e-06,-1.45717e-08,0.913429,0.00210727,1.41952e-06,7.42038e-09,0.915538,0.00211013,1.44178e-06,-1.51097e-08,0.917649,0.00211297,1.39645e-06,-6.58618e-09,0.919764,0.00211574,1.37669e-06,4.14545e-08,0.921881,0.00211862,1.50105e-06,-4.00222e-08,0.924001,0.0021215,1.38099e-06,-5.7518e-10,0.926124,0.00212426,1.37926e-06,4.23229e-08,0.92825,0.00212714,1.50623e-06,-4.9507e-08,0.930378,0.00213001,1.35771e-06,3.64958e-08,0.93251,0.00213283,1.4672e-06,-3.68713e-08,0.934644,0.00213566,1.35658e-06,5.13848e-08,0.936781,0.00213852,1.51074e-06,-4.94585e-08,0.938921,0.0021414,1.36236e-06,2.72399e-08,0.941064,0.0021442,1.44408e-06,1.0372e-10,0.943209,0.00214709,1.44439e-06,-2.76547e-08,0.945358,0.0021499,1.36143e-06,5.09106e-08,0.947509,0.00215277,1.51416e-06,-5.67784e-08,0.949663,0.00215563,1.34382e-06,5.69935e-08,0.95182,0.00215849,1.5148e-06,-5.19861e-08,0.95398,0.00216136,1.35885e-06,3.17417e-08,0.956143,0.00216418,1.45407e-06,-1.53758e-08,0.958309,0.00216704,1.40794e-06,2.97615e-08,0.960477,0.00216994,1.49723e-06,-4.40657e-08,0.962649,0.00217281,1.36503e-06,2.72919e-08,0.964823,0.00217562,1.44691e-06,-5.49729e-09,0.967,0.0021785,1.43041e-06,-5.30273e-09,0.96918,0.00218134,1.41451e-06,2.67084e-08,0.971363,0.00218425,1.49463e-06,-4.19265e-08,0.973548,0.00218711,1.36885e-06,2.17881e-08,0.975737,0.00218992,1.43422e-06,1.43789e-08,0.977928,0.00219283,1.47735e-06,-1.96989e-08,0.980122,0.00219572,1.41826e-06,4.81221e-09,0.98232,0.00219857,1.43269e-06,4.50048e-10,0.98452,0.00220144,1.43404e-06,-6.61237e-09,0.986722,0.00220429,1.41421e-06,2.59993e-08,0.988928,0.0022072,1.4922e-06,-3.77803e-08,0.991137,0.00221007,1.37886e-06,5.9127e-09,0.993348,0.00221284,1.3966e-06,1.33339e-07,0.995563,0.00221604,1.79662e-06,-5.98872e-07,0.99778,0.00222015,0.,0.};\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void RGB2LabConvert_32F(const T& src, D& dst)\n        {\n            const float _1_3 = 1.0f / 3.0f;\n            const float _a = 16.0f / 116.0f;\n\n            float B = blueIdx == 0 ? src.x : src.z;\n            float G = src.y;\n            float R = blueIdx == 0 ? src.z : src.x;\n\n            if (srgb)\n            {\n                B = splineInterpolate(B * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n                G = splineInterpolate(G * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n                R = splineInterpolate(R * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n            }\n\n            float X = B * 0.189828f + G * 0.376219f + R * 0.433953f;\n            float Y = B * 0.072169f + G * 0.715160f + R * 0.212671f;\n            float Z = B * 0.872766f + G * 0.109477f + R * 0.017758f;\n\n            float FX = X > 0.008856f ? ::powf(X, _1_3) : (7.787f * X + _a);\n            float FY = Y > 0.008856f ? ::powf(Y, _1_3) : (7.787f * Y + _a);\n            float FZ = Z > 0.008856f ? ::powf(Z, _1_3) : (7.787f * Z + _a);\n\n            float L = Y > 0.008856f ? (116.f * FY - 16.f) : (903.3f * Y);\n            float a = 500.f * (FX - FY);\n            float b = 200.f * (FY - FZ);\n\n            dst.x = L;\n            dst.y = a;\n            dst.z = b;\n        }\n\n        template <typename T, int scn, int dcn, bool srgb, int blueIdx> struct RGB2Lab;\n\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct RGB2Lab<uchar, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<uchar, scn>::vec_type, typename TypeVec<uchar, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<uchar, dcn>::vec_type operator ()(const typename TypeVec<uchar, scn>::vec_type& src) const\n            {\n                typename TypeVec<uchar, dcn>::vec_type dst;\n\n                RGB2LabConvert_8U<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2Lab() {}\n            __host__ __device__ __forceinline__ RGB2Lab(const RGB2Lab&) {}\n        };\n\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct RGB2Lab<float, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                RGB2LabConvert_32F<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2Lab() {}\n            __host__ __device__ __forceinline__ RGB2Lab(const RGB2Lab&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2Lab_TRAITS(name, scn, dcn, srgb, blueIdx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2Lab<T, scn, dcn, srgb, blueIdx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ float c_sRGBInvGammaTab[] = {0,0.0126255,0.,-8.33961e-06,0.0126172,0.0126005,-2.50188e-05,4.1698e-05,0.0252344,0.0126756,0.000100075,-0.000158451,0.0378516,0.0124004,-0.000375277,-0.000207393,0.0496693,0.0110276,-0.000997456,0.00016837,0.0598678,0.00953783,-0.000492346,2.07235e-05,0.068934,0.00861531,-0.000430176,3.62876e-05,0.0771554,0.00786382,-0.000321313,1.87625e-05,0.0847167,0.00727748,-0.000265025,1.53594e-05,0.0917445,0.00679351,-0.000218947,1.10545e-05,0.0983301,0.00638877,-0.000185784,8.66984e-06,0.104542,0.00604322,-0.000159774,6.82996e-06,0.110432,0.00574416,-0.000139284,5.51008e-06,0.116042,0.00548212,-0.000122754,4.52322e-06,0.121406,0.00525018,-0.000109184,3.75557e-06,0.126551,0.00504308,-9.79177e-05,3.17134e-06,0.131499,0.00485676,-8.84037e-05,2.68469e-06,0.13627,0.004688,-8.03496e-05,2.31725e-06,0.14088,0.00453426,-7.33978e-05,2.00868e-06,0.145343,0.00439349,-6.73718e-05,1.74775e-06,0.149671,0.00426399,-6.21286e-05,1.53547e-06,0.153875,0.00414434,-5.75222e-05,1.364e-06,0.157963,0.00403338,-5.34301e-05,1.20416e-06,0.161944,0.00393014,-4.98177e-05,1.09114e-06,0.165825,0.00383377,-4.65443e-05,9.57987e-07,0.169613,0.00374356,-4.36703e-05,8.88359e-07,0.173314,0.00365888,-4.10052e-05,7.7849e-07,0.176933,0.00357921,-3.86697e-05,7.36254e-07,0.180474,0.00350408,-3.6461e-05,6.42534e-07,0.183942,0.00343308,-3.45334e-05,6.12614e-07,0.187342,0.00336586,-3.26955e-05,5.42894e-07,0.190675,0.00330209,-3.10669e-05,5.08967e-07,0.193947,0.00324149,-2.954e-05,4.75977e-07,0.197159,0.00318383,-2.8112e-05,4.18343e-07,0.200315,0.00312887,-2.6857e-05,4.13651e-07,0.203418,0.00307639,-2.5616e-05,3.70847e-07,0.206469,0.00302627,-2.45035e-05,3.3813e-07,0.209471,0.00297828,-2.34891e-05,3.32999e-07,0.212426,0.0029323,-2.24901e-05,2.96826e-07,0.215336,0.00288821,-2.15996e-05,2.82736e-07,0.218203,0.00284586,-2.07514e-05,2.70961e-07,0.221029,0.00280517,-1.99385e-05,2.42744e-07,0.223814,0.00276602,-1.92103e-05,2.33277e-07,0.226561,0.0027283,-1.85105e-05,2.2486e-07,0.229271,0.00269195,-1.78359e-05,2.08383e-07,0.231945,0.00265691,-1.72108e-05,1.93305e-07,0.234585,0.00262307,-1.66308e-05,1.80687e-07,0.237192,0.00259035,-1.60888e-05,1.86632e-07,0.239766,0.00255873,-1.55289e-05,1.60569e-07,0.24231,0.00252815,-1.50472e-05,1.54566e-07,0.244823,0.00249852,-1.45835e-05,1.59939e-07,0.247307,0.00246983,-1.41037e-05,1.29549e-07,0.249763,0.00244202,-1.3715e-05,1.41429e-07,0.252191,0.00241501,-1.32907e-05,1.39198e-07,0.254593,0.00238885,-1.28731e-05,1.06444e-07,0.256969,0.00236342,-1.25538e-05,1.2048e-07,0.25932,0.00233867,-1.21924e-05,1.26892e-07,0.261647,0.00231467,-1.18117e-05,8.72084e-08,0.26395,0.00229131,-1.15501e-05,1.20323e-07,0.26623,0.00226857,-1.11891e-05,8.71514e-08,0.268487,0.00224645,-1.09276e-05,9.73165e-08,0.270723,0.00222489,-1.06357e-05,8.98259e-08,0.272937,0.00220389,-1.03662e-05,7.98218e-08,0.275131,0.00218339,-1.01267e-05,9.75254e-08,0.277304,0.00216343,-9.83416e-06,6.65195e-08,0.279458,0.00214396,-9.63461e-06,8.34313e-08,0.281592,0.00212494,-9.38431e-06,7.65919e-08,0.283708,0.00210641,-9.15454e-06,5.7236e-08,0.285805,0.00208827,-8.98283e-06,8.18939e-08,0.287885,0.00207055,-8.73715e-06,6.2224e-08,0.289946,0.00205326,-8.55047e-06,5.66388e-08,0.291991,0.00203633,-8.38056e-06,6.88491e-08,0.294019,0.00201978,-8.17401e-06,5.53955e-08,0.296031,0.00200359,-8.00782e-06,6.71971e-08,0.298027,0.00198778,-7.80623e-06,3.34439e-08,0.300007,0.00197227,-7.7059e-06,6.7248e-08,0.301971,0.00195706,-7.50416e-06,5.51915e-08,0.303921,0.00194221,-7.33858e-06,3.98124e-08,0.305856,0.00192766,-7.21915e-06,5.37795e-08,0.307776,0.00191338,-7.05781e-06,4.30919e-08,0.309683,0.00189939,-6.92853e-06,4.20744e-08,0.311575,0.00188566,-6.80231e-06,5.68321e-08,0.313454,0.00187223,-6.63181e-06,2.86195e-08,0.31532,0.00185905,-6.54595e-06,3.73075e-08,0.317172,0.00184607,-6.43403e-06,6.05684e-08,0.319012,0.00183338,-6.25233e-06,1.84426e-08,0.320839,0.00182094,-6.197e-06,4.44757e-08,0.322654,0.00180867,-6.06357e-06,4.20729e-08,0.324456,0.00179667,-5.93735e-06,2.56511e-08,0.326247,0.00178488,-5.8604e-06,3.41368e-08,0.328026,0.00177326,-5.75799e-06,4.64177e-08,0.329794,0.00176188,-5.61874e-06,1.86107e-08,0.33155,0.0017507,-5.5629e-06,2.81511e-08,0.333295,0.00173966,-5.47845e-06,4.75987e-08,0.335029,0.00172884,-5.33565e-06,1.98726e-08,0.336753,0.00171823,-5.27604e-06,2.19226e-08,0.338466,0.00170775,-5.21027e-06,4.14483e-08,0.340169,0.00169745,-5.08592e-06,2.09017e-08,0.341861,0.00168734,-5.02322e-06,2.39561e-08,0.343543,0.00167737,-4.95135e-06,3.22852e-08,0.345216,0.00166756,-4.85449e-06,2.57173e-08,0.346878,0.00165793,-4.77734e-06,1.38569e-08,0.348532,0.00164841,-4.73577e-06,3.80634e-08,0.350175,0.00163906,-4.62158e-06,1.27043e-08,0.35181,0.00162985,-4.58347e-06,3.03279e-08,0.353435,0.00162078,-4.49249e-06,1.49961e-08,0.355051,0.00161184,-4.4475e-06,2.88977e-08,0.356659,0.00160303,-4.3608e-06,1.84241e-08,0.358257,0.00159436,-4.30553e-06,1.6616e-08,0.359848,0.0015858,-4.25568e-06,3.43218e-08,0.361429,0.00157739,-4.15272e-06,-4.89172e-09,0.363002,0.00156907,-4.16739e-06,4.48498e-08,0.364567,0.00156087,-4.03284e-06,4.30676e-09,0.366124,0.00155282,-4.01992e-06,2.73303e-08,0.367673,0.00154486,-3.93793e-06,5.58036e-09,0.369214,0.001537,-3.92119e-06,3.97554e-08,0.370747,0.00152928,-3.80193e-06,-1.55904e-08,0.372272,0.00152163,-3.8487e-06,5.24081e-08,0.37379,0.00151409,-3.69147e-06,-1.52272e-08,0.375301,0.00150666,-3.73715e-06,3.83028e-08,0.376804,0.0014993,-3.62225e-06,1.10278e-08,0.378299,0.00149209,-3.58916e-06,6.99326e-09,0.379788,0.00148493,-3.56818e-06,2.06038e-08,0.381269,0.00147786,-3.50637e-06,2.98009e-08,0.382744,0.00147093,-3.41697e-06,-2.05978e-08,0.384211,0.00146404,-3.47876e-06,5.25899e-08,0.385672,0.00145724,-3.32099e-06,-1.09471e-08,0.387126,0.00145056,-3.35383e-06,2.10009e-08,0.388573,0.00144392,-3.29083e-06,1.63501e-08,0.390014,0.00143739,-3.24178e-06,3.00641e-09,0.391448,0.00143091,-3.23276e-06,3.12282e-08,0.392875,0.00142454,-3.13908e-06,-8.70932e-09,0.394297,0.00141824,-3.16521e-06,3.34114e-08,0.395712,0.00141201,-3.06497e-06,-5.72754e-09,0.397121,0.00140586,-3.08215e-06,1.9301e-08,0.398524,0.00139975,-3.02425e-06,1.7931e-08,0.39992,0.00139376,-2.97046e-06,-1.61822e-09,0.401311,0.00138781,-2.97531e-06,1.83442e-08,0.402696,0.00138192,-2.92028e-06,1.76485e-08,0.404075,0.00137613,-2.86733e-06,4.68617e-10,0.405448,0.00137039,-2.86593e-06,1.02794e-08,0.406816,0.00136469,-2.83509e-06,1.80179e-08,0.408178,0.00135908,-2.78104e-06,7.05594e-09,0.409534,0.00135354,-2.75987e-06,1.33633e-08,0.410885,0.00134806,-2.71978e-06,-9.04568e-10,0.41223,0.00134261,-2.72249e-06,2.0057e-08,0.41357,0.00133723,-2.66232e-06,1.00841e-08,0.414905,0.00133194,-2.63207e-06,-7.88835e-10,0.416234,0.00132667,-2.63444e-06,2.28734e-08,0.417558,0.00132147,-2.56582e-06,-1.29785e-09,0.418877,0.00131633,-2.56971e-06,1.21205e-08,0.420191,0.00131123,-2.53335e-06,1.24202e-08,0.421499,0.0013062,-2.49609e-06,-2.19681e-09,0.422803,0.0013012,-2.50268e-06,2.61696e-08,0.424102,0.00129628,-2.42417e-06,-1.30747e-08,0.425396,0.00129139,-2.46339e-06,2.6129e-08,0.426685,0.00128654,-2.38501e-06,-2.03454e-09,0.427969,0.00128176,-2.39111e-06,1.18115e-08,0.429248,0.00127702,-2.35567e-06,1.43932e-08,0.430523,0.00127235,-2.31249e-06,-9.77965e-09,0.431793,0.00126769,-2.34183e-06,2.47253e-08,0.433058,0.00126308,-2.26766e-06,2.85278e-10,0.434319,0.00125855,-2.2668e-06,3.93614e-09,0.435575,0.00125403,-2.25499e-06,1.37722e-08,0.436827,0.00124956,-2.21368e-06,5.79803e-10,0.438074,0.00124513,-2.21194e-06,1.37112e-08,0.439317,0.00124075,-2.1708e-06,4.17973e-09,0.440556,0.00123642,-2.15826e-06,-6.27703e-10,0.44179,0.0012321,-2.16015e-06,2.81332e-08,0.44302,0.00122787,-2.07575e-06,-2.24985e-08,0.444246,0.00122365,-2.14324e-06,3.20586e-08,0.445467,0.00121946,-2.04707e-06,-1.6329e-08,0.446685,0.00121532,-2.09605e-06,3.32573e-08,0.447898,0.00121122,-1.99628e-06,-2.72927e-08,0.449107,0.00120715,-2.07816e-06,4.6111e-08,0.450312,0.00120313,-1.93983e-06,-3.79416e-08,0.451514,0.00119914,-2.05365e-06,4.60507e-08,0.452711,0.00119517,-1.9155e-06,-2.7052e-08,0.453904,0.00119126,-1.99666e-06,3.23551e-08,0.455093,0.00118736,-1.89959e-06,-1.29613e-08,0.456279,0.00118352,-1.93848e-06,1.94905e-08,0.45746,0.0011797,-1.88e-06,-5.39588e-09,0.458638,0.00117593,-1.89619e-06,2.09282e-09,0.459812,0.00117214,-1.88991e-06,2.68267e-08,0.460982,0.00116844,-1.80943e-06,-1.99925e-08,0.462149,0.00116476,-1.86941e-06,2.3341e-08,0.463312,0.00116109,-1.79939e-06,-1.37674e-08,0.464471,0.00115745,-1.84069e-06,3.17287e-08,0.465627,0.00115387,-1.7455e-06,-2.37407e-08,0.466779,0.00115031,-1.81673e-06,3.34315e-08,0.467927,0.00114677,-1.71643e-06,-2.05786e-08,0.469073,0.00114328,-1.77817e-06,1.90802e-08,0.470214,0.00113978,-1.72093e-06,3.86247e-09,0.471352,0.00113635,-1.70934e-06,-4.72759e-09,0.472487,0.00113292,-1.72352e-06,1.50478e-08,0.473618,0.00112951,-1.67838e-06,4.14108e-09,0.474746,0.00112617,-1.66595e-06,-1.80986e-09,0.47587,0.00112283,-1.67138e-06,3.09816e-09,0.476991,0.0011195,-1.66209e-06,1.92198e-08,0.478109,0.00111623,-1.60443e-06,-2.03726e-08,0.479224,0.00111296,-1.66555e-06,3.2468e-08,0.480335,0.00110973,-1.56814e-06,-2.00922e-08,0.481443,0.00110653,-1.62842e-06,1.80983e-08,0.482548,0.00110333,-1.57413e-06,7.30362e-09,0.48365,0.0011002,-1.55221e-06,-1.75107e-08,0.484749,0.00109705,-1.60475e-06,3.29373e-08,0.485844,0.00109393,-1.50594e-06,-2.48315e-08,0.486937,0.00109085,-1.58043e-06,3.65865e-08,0.488026,0.0010878,-1.47067e-06,-3.21078e-08,0.489112,0.00108476,-1.56699e-06,3.22397e-08,0.490195,0.00108172,-1.47027e-06,-7.44391e-09,0.491276,0.00107876,-1.49261e-06,-2.46428e-09,0.492353,0.00107577,-1.5e-06,1.73011e-08,0.493427,0.00107282,-1.4481e-06,-7.13552e-09,0.494499,0.0010699,-1.4695e-06,1.1241e-08,0.495567,0.001067,-1.43578e-06,-8.02637e-09,0.496633,0.0010641,-1.45986e-06,2.08645e-08,0.497695,0.00106124,-1.39726e-06,-1.58271e-08,0.498755,0.0010584,-1.44475e-06,1.26415e-08,0.499812,0.00105555,-1.40682e-06,2.48655e-08,0.500866,0.00105281,-1.33222e-06,-5.24988e-08,0.501918,0.00104999,-1.48972e-06,6.59206e-08,0.502966,0.00104721,-1.29196e-06,-3.237e-08,0.504012,0.00104453,-1.38907e-06,3.95479e-09,0.505055,0.00104176,-1.3772e-06,1.65509e-08,0.506096,0.00103905,-1.32755e-06,-1.05539e-08,0.507133,0.00103637,-1.35921e-06,2.56648e-08,0.508168,0.00103373,-1.28222e-06,-3.25007e-08,0.509201,0.00103106,-1.37972e-06,4.47336e-08,0.51023,0.00102844,-1.24552e-06,-2.72245e-08,0.511258,0.00102587,-1.32719e-06,4.55952e-09,0.512282,0.00102323,-1.31352e-06,8.98645e-09,0.513304,0.00102063,-1.28656e-06,1.90992e-08,0.514323,0.00101811,-1.22926e-06,-2.57786e-08,0.51534,0.00101557,-1.30659e-06,2.44104e-08,0.516355,0.00101303,-1.23336e-06,-1.22581e-08,0.517366,0.00101053,-1.27014e-06,2.4622e-08,0.518376,0.00100806,-1.19627e-06,-2.66253e-08,0.519383,0.00100559,-1.27615e-06,2.22744e-08,0.520387,0.00100311,-1.20932e-06,-2.8679e-09,0.521389,0.00100068,-1.21793e-06,-1.08029e-08,0.522388,0.000998211,-1.25034e-06,4.60795e-08,0.523385,0.000995849,-1.1121e-06,-5.4306e-08,0.52438,0.000993462,-1.27502e-06,5.19354e-08,0.525372,0.000991067,-1.11921e-06,-3.42262e-08,0.526362,0.000988726,-1.22189e-06,2.53646e-08,0.52735,0.000986359,-1.14579e-06,-7.62782e-09,0.528335,0.000984044,-1.16868e-06,5.14668e-09,0.529318,0.000981722,-1.15324e-06,-1.29589e-08,0.530298,0.000979377,-1.19211e-06,4.66888e-08,0.531276,0.000977133,-1.05205e-06,-5.45868e-08,0.532252,0.000974865,-1.21581e-06,5.24495e-08,0.533226,0.000972591,-1.05846e-06,-3.60019e-08,0.534198,0.000970366,-1.16647e-06,3.19537e-08,0.535167,0.000968129,-1.07061e-06,-3.2208e-08,0.536134,0.000965891,-1.16723e-06,3.72738e-08,0.537099,0.000963668,-1.05541e-06,2.32205e-09,0.538061,0.000961564,-1.04844e-06,-4.65618e-08,0.539022,0.000959328,-1.18813e-06,6.47159e-08,0.53998,0.000957146,-9.93979e-07,-3.3488e-08,0.540936,0.000955057,-1.09444e-06,9.63166e-09,0.54189,0.000952897,-1.06555e-06,-5.03871e-09,0.542842,0.000950751,-1.08066e-06,1.05232e-08,0.543792,0.000948621,-1.04909e-06,2.25503e-08,0.544739,0.000946591,-9.81444e-07,-4.11195e-08,0.545685,0.000944504,-1.1048e-06,2.27182e-08,0.546628,0.000942363,-1.03665e-06,9.85146e-09,0.54757,0.000940319,-1.00709e-06,-2.51938e-09,0.548509,0.000938297,-1.01465e-06,2.25858e-10,0.549446,0.000936269,-1.01397e-06,1.61598e-09,0.550381,0.000934246,-1.00913e-06,-6.68983e-09,0.551315,0.000932207,-1.0292e-06,2.51434e-08,0.552246,0.000930224,-9.53765e-07,-3.42793e-08,0.553175,0.000928214,-1.0566e-06,5.23688e-08,0.554102,0.000926258,-8.99497e-07,-5.59865e-08,0.555028,0.000924291,-1.06746e-06,5.23679e-08,0.555951,0.000922313,-9.10352e-07,-3.42763e-08,0.556872,0.00092039,-1.01318e-06,2.51326e-08,0.557792,0.000918439,-9.37783e-07,-6.64954e-09,0.558709,0.000916543,-9.57732e-07,1.46554e-09,0.559625,0.000914632,-9.53335e-07,7.87281e-10,0.560538,0.000912728,-9.50973e-07,-4.61466e-09,0.56145,0.000910812,-9.64817e-07,1.76713e-08,0.56236,0.000908935,-9.11804e-07,-6.46564e-09,0.563268,0.000907092,-9.312e-07,8.19121e-09,0.564174,0.000905255,-9.06627e-07,-2.62992e-08,0.565078,0.000903362,-9.85524e-07,3.74007e-08,0.565981,0.000901504,-8.73322e-07,-4.0942e-09,0.566882,0.000899745,-8.85605e-07,-2.1024e-08,0.56778,0.00089791,-9.48677e-07,2.85854e-08,0.568677,0.000896099,-8.62921e-07,-3.3713e-08,0.569573,0.000894272,-9.64059e-07,4.6662e-08,0.570466,0.000892484,-8.24073e-07,-3.37258e-08,0.571358,0.000890734,-9.25251e-07,2.86365e-08,0.572247,0.00088897,-8.39341e-07,-2.12155e-08,0.573135,0.000887227,-9.02988e-07,-3.37913e-09,0.574022,0.000885411,-9.13125e-07,3.47319e-08,0.574906,0.000883689,-8.08929e-07,-1.63394e-08,0.575789,0.000882022,-8.57947e-07,-2.8979e-08,0.57667,0.00088022,-9.44885e-07,7.26509e-08,0.57755,0.000878548,-7.26932e-07,-8.28106e-08,0.578427,0.000876845,-9.75364e-07,7.97774e-08,0.579303,0.000875134,-7.36032e-07,-5.74849e-08,0.580178,0.00087349,-9.08486e-07,3.09529e-08,0.58105,0.000871765,-8.15628e-07,-6.72206e-09,0.581921,0.000870114,-8.35794e-07,-4.06451e-09,0.582791,0.00086843,-8.47987e-07,2.29799e-08,0.583658,0.000866803,-7.79048e-07,-2.82503e-08,0.584524,0.00086516,-8.63799e-07,3.04167e-08,0.585388,0.000863524,-7.72548e-07,-3.38119e-08,0.586251,0.000861877,-8.73984e-07,4.52264e-08,0.587112,0.000860265,-7.38305e-07,-2.78842e-08,0.587972,0.000858705,-8.21958e-07,6.70567e-09,0.58883,0.000857081,-8.01841e-07,1.06161e-09,0.589686,0.000855481,-7.98656e-07,-1.09521e-08,0.590541,0.00085385,-8.31512e-07,4.27468e-08,0.591394,0.000852316,-7.03272e-07,-4.08257e-08,0.592245,0.000850787,-8.25749e-07,1.34677e-09,0.593095,0.000849139,-8.21709e-07,3.54387e-08,0.593944,0.000847602,-7.15393e-07,-2.38924e-08,0.59479,0.0008461,-7.8707e-07,5.26143e-10,0.595636,0.000844527,-7.85491e-07,2.17879e-08,0.596479,0.000843021,-7.20127e-07,-2.80733e-08,0.597322,0.000841497,-8.04347e-07,3.09005e-08,0.598162,0.000839981,-7.11646e-07,-3.5924e-08,0.599002,0.00083845,-8.19418e-07,5.3191e-08,0.599839,0.000836971,-6.59845e-07,-5.76307e-08,0.600676,0.000835478,-8.32737e-07,5.81227e-08,0.60151,0.000833987,-6.58369e-07,-5.56507e-08,0.602344,0.000832503,-8.25321e-07,4.52706e-08,0.603175,0.000830988,-6.89509e-07,-6.22236e-09,0.604006,0.000829591,-7.08176e-07,-2.03811e-08,0.604834,0.000828113,-7.6932e-07,2.8142e-08,0.605662,0.000826659,-6.84894e-07,-3.25822e-08,0.606488,0.000825191,-7.8264e-07,4.25823e-08,0.607312,0.000823754,-6.54893e-07,-1.85376e-08,0.608135,0.000822389,-7.10506e-07,-2.80365e-08,0.608957,0.000820883,-7.94616e-07,7.1079e-08,0.609777,0.000819507,-5.81379e-07,-7.74655e-08,0.610596,0.000818112,-8.13775e-07,5.9969e-08,0.611413,0.000816665,-6.33868e-07,-4.32013e-08,0.612229,0.000815267,-7.63472e-07,5.32313e-08,0.613044,0.0008139,-6.03778e-07,-5.05148e-08,0.613857,0.000812541,-7.55323e-07,2.96187e-08,0.614669,0.000811119,-6.66466e-07,-8.35545e-09,0.615479,0.000809761,-6.91533e-07,3.80301e-09,0.616288,0.00080839,-6.80124e-07,-6.85666e-09,0.617096,0.000807009,-7.00694e-07,2.36237e-08,0.617903,0.000805678,-6.29822e-07,-2.80336e-08,0.618708,0.000804334,-7.13923e-07,2.8906e-08,0.619511,0.000802993,-6.27205e-07,-2.79859e-08,0.620314,0.000801655,-7.11163e-07,2.34329e-08,0.621114,0.000800303,-6.40864e-07,-6.14108e-09,0.621914,0.000799003,-6.59287e-07,1.13151e-09,0.622712,0.000797688,-6.55893e-07,1.61507e-09,0.62351,0.000796381,-6.51048e-07,-7.59186e-09,0.624305,0.000795056,-6.73823e-07,2.87524e-08,0.6251,0.000793794,-5.87566e-07,-4.7813e-08,0.625893,0.000792476,-7.31005e-07,4.32901e-08,0.626685,0.000791144,-6.01135e-07,-6.13814e-09,0.627475,0.000789923,-6.19549e-07,-1.87376e-08,0.628264,0.000788628,-6.75762e-07,2.14837e-08,0.629052,0.000787341,-6.11311e-07,-7.59265e-09,0.629839,0.000786095,-6.34089e-07,8.88692e-09,0.630625,0.000784854,-6.07428e-07,-2.7955e-08,0.631409,0.000783555,-6.91293e-07,4.33285e-08,0.632192,0.000782302,-5.61307e-07,-2.61497e-08,0.632973,0.000781101,-6.39757e-07,1.6658e-09,0.633754,0.000779827,-6.34759e-07,1.94866e-08,0.634533,0.000778616,-5.76299e-07,-2.00076e-08,0.635311,0.000777403,-6.36322e-07,9.39091e-10,0.636088,0.000776133,-6.33505e-07,1.62512e-08,0.636863,0.000774915,-5.84751e-07,-6.33937e-09,0.637638,0.000773726,-6.03769e-07,9.10609e-09,0.638411,0.000772546,-5.76451e-07,-3.00849e-08,0.639183,0.000771303,-6.66706e-07,5.1629e-08,0.639953,0.000770125,-5.11819e-07,-5.7222e-08,0.640723,0.000768929,-6.83485e-07,5.80497e-08,0.641491,0.000767736,-5.09336e-07,-5.57674e-08,0.642259,0.000766551,-6.76638e-07,4.58105e-08,0.643024,0.000765335,-5.39206e-07,-8.26541e-09,0.643789,0.000764231,-5.64002e-07,-1.27488e-08,0.644553,0.000763065,-6.02249e-07,-3.44168e-10,0.645315,0.00076186,-6.03281e-07,1.41254e-08,0.646077,0.000760695,-5.60905e-07,3.44727e-09,0.646837,0.000759584,-5.50563e-07,-2.79144e-08,0.647596,0.000758399,-6.34307e-07,4.86057e-08,0.648354,0.000757276,-4.88489e-07,-4.72989e-08,0.64911,0.000756158,-6.30386e-07,2.13807e-08,0.649866,0.000754961,-5.66244e-07,2.13808e-08,0.65062,0.000753893,-5.02102e-07,-4.7299e-08,0.651374,0.000752746,-6.43999e-07,4.86059e-08,0.652126,0.000751604,-4.98181e-07,-2.79154e-08,0.652877,0.000750524,-5.81927e-07,3.45089e-09,0.653627,0.000749371,-5.71575e-07,1.41119e-08,0.654376,0.00074827,-5.29239e-07,-2.93748e-10,0.655123,0.00074721,-5.3012e-07,-1.29368e-08,0.65587,0.000746111,-5.68931e-07,-7.56355e-09,0.656616,0.000744951,-5.91621e-07,4.3191e-08,0.65736,0.000743897,-4.62048e-07,-4.59911e-08,0.658103,0.000742835,-6.00022e-07,2.15642e-08,0.658846,0.0007417,-5.35329e-07,1.93389e-08,0.659587,0.000740687,-4.77312e-07,-3.93152e-08,0.660327,0.000739615,-5.95258e-07,1.87126e-08,0.661066,0.00073848,-5.3912e-07,2.40695e-08,0.661804,0.000737474,-4.66912e-07,-5.53859e-08,0.662541,0.000736374,-6.33069e-07,7.82648e-08,0.663277,0.000735343,-3.98275e-07,-7.88593e-08,0.664012,0.00073431,-6.34853e-07,5.83585e-08,0.664745,0.000733215,-4.59777e-07,-3.53656e-08,0.665478,0.000732189,-5.65874e-07,2.34994e-08,0.66621,0.000731128,-4.95376e-07,9.72743e-10,0.66694,0.00073014,-4.92458e-07,-2.73903e-08,0.66767,0.000729073,-5.74629e-07,4.89839e-08,0.668398,0.000728071,-4.27677e-07,-4.93359e-08,0.669126,0.000727068,-5.75685e-07,2.91504e-08,0.669853,0.000726004,-4.88234e-07,-7.66109e-09,0.670578,0.000725004,-5.11217e-07,1.49392e-09,0.671303,0.000723986,-5.06735e-07,1.68533e-09,0.672026,0.000722978,-5.01679e-07,-8.23525e-09,0.672749,0.00072195,-5.26385e-07,3.12556e-08,0.67347,0.000720991,-4.32618e-07,-5.71825e-08,0.674191,0.000719954,-6.04166e-07,7.8265e-08,0.67491,0.00071898,-3.69371e-07,-7.70634e-08,0.675628,0.00071801,-6.00561e-07,5.11747e-08,0.676346,0.000716963,-4.47037e-07,-8.42615e-09,0.677062,0.000716044,-4.72315e-07,-1.747e-08,0.677778,0.000715046,-5.24725e-07,1.87015e-08,0.678493,0.000714053,-4.68621e-07,2.26856e-09,0.679206,0.000713123,-4.61815e-07,-2.77758e-08,0.679919,0.000712116,-5.45142e-07,4.92298e-08,0.68063,0.000711173,-3.97453e-07,-4.99339e-08,0.681341,0.000710228,-5.47255e-07,3.12967e-08,0.682051,0.000709228,-4.53365e-07,-1.56481e-08,0.68276,0.000708274,-5.00309e-07,3.12958e-08,0.683467,0.000707367,-4.06422e-07,-4.99303e-08,0.684174,0.000706405,-5.56213e-07,4.9216e-08,0.68488,0.00070544,-4.08565e-07,-2.77245e-08,0.685585,0.00070454,-4.91738e-07,2.07748e-09,0.686289,0.000703562,-4.85506e-07,1.94146e-08,0.686992,0.00070265,-4.27262e-07,-2.01314e-08,0.687695,0.000701735,-4.87656e-07,1.50616e-09,0.688396,0.000700764,-4.83137e-07,1.41067e-08,0.689096,0.00069984,-4.40817e-07,1.67168e-09,0.689795,0.000698963,-4.35802e-07,-2.07934e-08,0.690494,0.000698029,-4.98182e-07,2.18972e-08,0.691192,0.000697099,-4.32491e-07,-7.19092e-09,0.691888,0.000696212,-4.54064e-07,6.86642e-09,0.692584,0.000695325,-4.33464e-07,-2.02747e-08,0.693279,0.000694397,-4.94288e-07,1.46279e-08,0.693973,0.000693452,-4.50405e-07,2.13678e-08,0.694666,0.000692616,-3.86301e-07,-4.04945e-08,0.695358,0.000691721,-5.07785e-07,2.14009e-08,0.696049,0.00069077,-4.43582e-07,1.44955e-08,0.69674,0.000689926,-4.00096e-07,-1.97783e-08,0.697429,0.000689067,-4.5943e-07,5.01296e-09,0.698118,0.000688163,-4.44392e-07,-2.73521e-10,0.698805,0.000687273,-4.45212e-07,-3.91893e-09,0.699492,0.000686371,-4.56969e-07,1.59493e-08,0.700178,0.000685505,-4.09121e-07,-2.73351e-10,0.700863,0.000684686,-4.09941e-07,-1.4856e-08,0.701548,0.000683822,-4.54509e-07,9.25979e-11,0.702231,0.000682913,-4.54231e-07,1.44855e-08,0.702913,0.000682048,-4.10775e-07,1.56992e-09,0.703595,0.000681231,-4.06065e-07,-2.07652e-08,0.704276,0.000680357,-4.68361e-07,2.18864e-08,0.704956,0.000679486,-4.02701e-07,-7.17595e-09,0.705635,0.000678659,-4.24229e-07,6.81748e-09,0.706313,0.000677831,-4.03777e-07,-2.0094e-08,0.70699,0.000676963,-4.64059e-07,1.39538e-08,0.707667,0.000676077,-4.22197e-07,2.38835e-08,0.708343,0.000675304,-3.50547e-07,-4.98831e-08,0.709018,0.000674453,-5.00196e-07,5.64395e-08,0.709692,0.000673622,-3.30878e-07,-5.66657e-08,0.710365,0.00067279,-5.00875e-07,5.1014e-08,0.711037,0.000671942,-3.47833e-07,-2.81809e-08,0.711709,0.000671161,-4.32376e-07,2.10513e-09,0.712379,0.000670303,-4.2606e-07,1.97604e-08,0.713049,0.00066951,-3.66779e-07,-2.15422e-08,0.713718,0.000668712,-4.31406e-07,6.8038e-09,0.714387,0.000667869,-4.10994e-07,-5.67295e-09,0.715054,0.00066703,-4.28013e-07,1.5888e-08,0.715721,0.000666222,-3.80349e-07,1.72576e-09,0.716387,0.000665467,-3.75172e-07,-2.27911e-08,0.717052,0.000664648,-4.43545e-07,2.9834e-08,0.717716,0.00066385,-3.54043e-07,-3.69401e-08,0.718379,0.000663031,-4.64864e-07,5.83219e-08,0.719042,0.000662277,-2.89898e-07,-7.71382e-08,0.719704,0.000661465,-5.21313e-07,7.14171e-08,0.720365,0.000660637,-3.07061e-07,-2.97161e-08,0.721025,0.000659934,-3.96209e-07,-1.21575e-08,0.721685,0.000659105,-4.32682e-07,1.87412e-08,0.722343,0.000658296,-3.76458e-07,-3.2029e-09,0.723001,0.000657533,-3.86067e-07,-5.9296e-09,0.723659,0.000656743,-4.03856e-07,2.69213e-08,0.724315,0.000656016,-3.23092e-07,-4.21511e-08,0.724971,0.000655244,-4.49545e-07,2.24737e-08,0.725625,0.000654412,-3.82124e-07,1.18611e-08,0.726279,0.000653683,-3.46541e-07,-1.03132e-08,0.726933,0.000652959,-3.7748e-07,-3.02128e-08,0.727585,0.000652114,-4.68119e-07,7.15597e-08,0.728237,0.000651392,-2.5344e-07,-7.72119e-08,0.728888,0.000650654,-4.85075e-07,5.8474e-08,0.729538,0.000649859,-3.09654e-07,-3.74746e-08,0.730188,0.000649127,-4.22077e-07,3.18197e-08,0.730837,0.000648379,-3.26618e-07,-3.01997e-08,0.731485,0.000647635,-4.17217e-07,2.93747e-08,0.732132,0.000646888,-3.29093e-07,-2.76943e-08,0.732778,0.000646147,-4.12176e-07,2.17979e-08,0.733424,0.000645388,-3.46783e-07,1.07292e-10,0.734069,0.000644695,-3.46461e-07,-2.22271e-08,0.734713,0.000643935,-4.13142e-07,2.91963e-08,0.735357,0.000643197,-3.25553e-07,-3.49536e-08,0.736,0.000642441,-4.30414e-07,5.10133e-08,0.736642,0.000641733,-2.77374e-07,-4.98904e-08,0.737283,0.000641028,-4.27045e-07,2.93392e-08,0.737924,0.000640262,-3.39028e-07,-7.86156e-09,0.738564,0.000639561,-3.62612e-07,2.10703e-09,0.739203,0.000638842,-3.56291e-07,-5.6653e-10,0.739842,0.000638128,-3.57991e-07,1.59086e-10,0.740479,0.000637412,-3.57513e-07,-6.98321e-11,0.741116,0.000636697,-3.57723e-07,1.20214e-10,0.741753,0.000635982,-3.57362e-07,-4.10987e-10,0.742388,0.000635266,-3.58595e-07,1.5237e-09,0.743023,0.000634553,-3.54024e-07,-5.68376e-09,0.743657,0.000633828,-3.71075e-07,2.12113e-08,0.744291,0.00063315,-3.07441e-07,-1.95569e-08,0.744924,0.000632476,-3.66112e-07,-2.58816e-09,0.745556,0.000631736,-3.73877e-07,2.99096e-08,0.746187,0.000631078,-2.84148e-07,-5.74454e-08,0.746818,0.000630337,-4.56484e-07,8.06629e-08,0.747448,0.000629666,-2.14496e-07,-8.63922e-08,0.748077,0.000628978,-4.73672e-07,8.60918e-08,0.748706,0.000628289,-2.15397e-07,-7.91613e-08,0.749334,0.000627621,-4.5288e-07,5.17393e-08,0.749961,0.00062687,-2.97663e-07,-8.58662e-09,0.750588,0.000626249,-3.23422e-07,-1.73928e-08,0.751214,0.00062555,-3.75601e-07,1.85532e-08,0.751839,0.000624855,-3.19941e-07,2.78479e-09,0.752463,0.000624223,-3.11587e-07,-2.96923e-08,0.753087,0.000623511,-4.00664e-07,5.63799e-08,0.75371,0.000622879,-2.31524e-07,-7.66179e-08,0.754333,0.000622186,-4.61378e-07,7.12778e-08,0.754955,0.000621477,-2.47545e-07,-2.96794e-08,0.755576,0.000620893,-3.36583e-07,-1.21648e-08,0.756196,0.000620183,-3.73077e-07,1.87339e-08,0.756816,0.000619493,-3.16875e-07,-3.16622e-09,0.757435,0.00061885,-3.26374e-07,-6.0691e-09,0.758054,0.000618179,-3.44581e-07,2.74426e-08,0.758672,0.000617572,-2.62254e-07,-4.40968e-08,0.759289,0.000616915,-3.94544e-07,2.97352e-08,0.759906,0.000616215,-3.05338e-07,-1.52393e-08,0.760522,0.000615559,-3.51056e-07,3.12221e-08,0.761137,0.000614951,-2.5739e-07,-5.00443e-08,0.761751,0.000614286,-4.07523e-07,4.9746e-08,0.762365,0.00061362,-2.58285e-07,-2.97303e-08,0.762979,0.000613014,-3.47476e-07,9.57079e-09,0.763591,0.000612348,-3.18764e-07,-8.55287e-09,0.764203,0.000611685,-3.44422e-07,2.46407e-08,0.764815,0.00061107,-2.705e-07,-3.04053e-08,0.765426,0.000610437,-3.61716e-07,3.73759e-08,0.766036,0.000609826,-2.49589e-07,-5.94935e-08,0.766645,0.000609149,-4.28069e-07,8.13889e-08,0.767254,0.000608537,-1.83902e-07,-8.72483e-08,0.767862,0.000607907,-4.45647e-07,8.87901e-08,0.76847,0.000607282,-1.79277e-07,-8.90983e-08,0.769077,0.000606656,-4.46572e-07,8.87892e-08,0.769683,0.000606029,-1.80204e-07,-8.72446e-08,0.770289,0.000605407,-4.41938e-07,8.13752e-08,0.770894,0.000604768,-1.97812e-07,-5.94423e-08,0.771498,0.000604194,-3.76139e-07,3.71848e-08,0.772102,0.000603553,-2.64585e-07,-2.96922e-08,0.772705,0.000602935,-3.53661e-07,2.19793e-08,0.773308,0.000602293,-2.87723e-07,1.37955e-09,0.77391,0.000601722,-2.83585e-07,-2.74976e-08,0.774512,0.000601072,-3.66077e-07,4.9006e-08,0.775112,0.000600487,-2.19059e-07,-4.93171e-08,0.775712,0.000599901,-3.67011e-07,2.90531e-08,0.776312,0.000599254,-2.79851e-07,-7.29081e-09,0.776911,0.000598673,-3.01724e-07,1.10077e-10,0.777509,0.00059807,-3.01393e-07,6.85053e-09,0.778107,0.000597487,-2.80842e-07,-2.75123e-08,0.778704,0.000596843,-3.63379e-07,4.35939e-08,0.779301,0.000596247,-2.32597e-07,-2.7654e-08,0.779897,0.000595699,-3.15559e-07,7.41741e-09,0.780492,0.00059509,-2.93307e-07,-2.01562e-09,0.781087,0.000594497,-2.99354e-07,6.45059e-10,0.781681,0.000593901,-2.97418e-07,-5.64635e-10,0.782275,0.000593304,-2.99112e-07,1.61347e-09,0.782868,0.000592711,-2.94272e-07,-5.88926e-09,0.78346,0.000592105,-3.1194e-07,2.19436e-08,0.784052,0.000591546,-2.46109e-07,-2.22805e-08,0.784643,0.000590987,-3.1295e-07,7.57368e-09,0.785234,0.000590384,-2.90229e-07,-8.01428e-09,0.785824,0.00058978,-3.14272e-07,2.44834e-08,0.786414,0.000589225,-2.40822e-07,-3.03148e-08,0.787003,0.000588652,-3.31766e-07,3.7171e-08,0.787591,0.0005881,-2.20253e-07,-5.87646e-08,0.788179,0.000587483,-3.96547e-07,7.86782e-08,0.788766,0.000586926,-1.60512e-07,-7.71342e-08,0.789353,0.000586374,-3.91915e-07,5.10444e-08,0.789939,0.000585743,-2.38782e-07,-7.83422e-09,0.790524,0.000585242,-2.62284e-07,-1.97076e-08,0.791109,0.000584658,-3.21407e-07,2.70598e-08,0.791693,0.000584097,-2.40228e-07,-2.89269e-08,0.792277,0.000583529,-3.27008e-07,2.90431e-08,0.792861,0.000582963,-2.39879e-07,-2.76409e-08,0.793443,0.0005824,-3.22802e-07,2.1916e-08,0.794025,0.00058182,-2.57054e-07,-4.18368e-10,0.794607,0.000581305,-2.58309e-07,-2.02425e-08,0.795188,0.000580727,-3.19036e-07,2.17838e-08,0.795768,0.000580155,-2.53685e-07,-7.28814e-09,0.796348,0.000579625,-2.75549e-07,7.36871e-09,0.796928,0.000579096,-2.53443e-07,-2.21867e-08,0.797506,0.000578523,-3.20003e-07,2.17736e-08,0.798085,0.000577948,-2.54683e-07,-5.30296e-09,0.798662,0.000577423,-2.70592e-07,-5.61698e-10,0.799239,0.00057688,-2.72277e-07,7.54977e-09,0.799816,0.000576358,-2.49627e-07,-2.96374e-08,0.800392,0.00057577,-3.38539e-07,5.1395e-08,0.800968,0.000575247,-1.84354e-07,-5.67335e-08,0.801543,0.000574708,-3.54555e-07,5.63297e-08,0.802117,0.000574168,-1.85566e-07,-4.93759e-08,0.802691,0.000573649,-3.33693e-07,2.19646e-08,0.803264,0.000573047,-2.678e-07,2.1122e-08,0.803837,0.000572575,-2.04433e-07,-4.68482e-08,0.804409,0.000572026,-3.44978e-07,4.70613e-08,0.804981,0.000571477,-2.03794e-07,-2.21877e-08,0.805552,0.000571003,-2.70357e-07,-1.79153e-08,0.806123,0.000570408,-3.24103e-07,3.42443e-08,0.806693,0.000569863,-2.2137e-07,1.47556e-10,0.807263,0.000569421,-2.20928e-07,-3.48345e-08,0.807832,0.000568874,-3.25431e-07,1.99812e-08,0.808401,0.000568283,-2.65487e-07,1.45143e-08,0.808969,0.000567796,-2.21945e-07,-1.84338e-08,0.809536,0.000567297,-2.77246e-07,-3.83608e-10,0.810103,0.000566741,-2.78397e-07,1.99683e-08,0.81067,0.000566244,-2.18492e-07,-1.98848e-08,0.811236,0.000565747,-2.78146e-07,-3.38976e-11,0.811801,0.000565191,-2.78248e-07,2.00204e-08,0.812366,0.000564695,-2.18187e-07,-2.04429e-08,0.812931,0.000564197,-2.79516e-07,2.1467e-09,0.813495,0.000563644,-2.73076e-07,1.18561e-08,0.814058,0.000563134,-2.37507e-07,1.00334e-08,0.814621,0.000562689,-2.07407e-07,-5.19898e-08,0.815183,0.000562118,-3.63376e-07,7.87163e-08,0.815745,0.000561627,-1.27227e-07,-8.40616e-08,0.816306,0.000561121,-3.79412e-07,7.87163e-08,0.816867,0.000560598,-1.43263e-07,-5.19898e-08,0.817428,0.000560156,-2.99233e-07,1.00335e-08,0.817988,0.000559587,-2.69132e-07,1.18559e-08,0.818547,0.000559085,-2.33564e-07,2.14764e-09,0.819106,0.000558624,-2.27122e-07,-2.04464e-08,0.819664,0.000558108,-2.88461e-07,2.00334e-08,0.820222,0.000557591,-2.28361e-07,-8.24277e-11,0.820779,0.000557135,-2.28608e-07,-1.97037e-08,0.821336,0.000556618,-2.87719e-07,1.92925e-08,0.821893,0.000556101,-2.29841e-07,2.13831e-09,0.822448,0.000555647,-2.23427e-07,-2.78458e-08,0.823004,0.000555117,-3.06964e-07,4.96402e-08,0.823559,0.000554652,-1.58043e-07,-5.15058e-08,0.824113,0.000554181,-3.12561e-07,3.71737e-08,0.824667,0.000553668,-2.0104e-07,-3.75844e-08,0.82522,0.000553153,-3.13793e-07,5.35592e-08,0.825773,0.000552686,-1.53115e-07,-5.74431e-08,0.826326,0.000552207,-3.25444e-07,5.7004e-08,0.826878,0.000551728,-1.54433e-07,-5.13635e-08,0.827429,0.000551265,-3.08523e-07,2.92406e-08,0.82798,0.000550735,-2.20801e-07,-5.99424e-09,0.828531,0.000550276,-2.38784e-07,-5.26363e-09,0.829081,0.000549782,-2.54575e-07,2.70488e-08,0.82963,0.000549354,-1.73429e-07,-4.33268e-08,0.83018,0.000548878,-3.03409e-07,2.7049e-08,0.830728,0.000548352,-2.22262e-07,-5.26461e-09,0.831276,0.000547892,-2.38056e-07,-5.99057e-09,0.831824,0.000547397,-2.56027e-07,2.92269e-08,0.832371,0.000546973,-1.68347e-07,-5.13125e-08,0.832918,0.000546482,-3.22284e-07,5.68139e-08,0.833464,0.000546008,-1.51843e-07,-5.67336e-08,0.83401,0.000545534,-3.22043e-07,5.09113e-08,0.834555,0.000545043,-1.6931e-07,-2.77022e-08,0.8351,0.000544621,-2.52416e-07,2.92924e-10,0.835644,0.000544117,-2.51537e-07,2.65305e-08,0.836188,0.000543694,-1.71946e-07,-4.68105e-08,0.836732,0.00054321,-3.12377e-07,4.15021e-08,0.837275,0.000542709,-1.87871e-07,1.13355e-11,0.837817,0.000542334,-1.87837e-07,-4.15474e-08,0.838359,0.000541833,-3.12479e-07,4.69691e-08,0.838901,0.000541349,-1.71572e-07,-2.71196e-08,0.839442,0.000540925,-2.52931e-07,1.90462e-09,0.839983,0.000540425,-2.47217e-07,1.95011e-08,0.840523,0.000539989,-1.88713e-07,-2.03045e-08,0.841063,0.00053955,-2.49627e-07,2.11216e-09,0.841602,0.000539057,-2.4329e-07,1.18558e-08,0.842141,0.000538606,-2.07723e-07,1.00691e-08,0.842679,0.000538221,-1.77516e-07,-5.21324e-08,0.843217,0.00053771,-3.33913e-07,7.92513e-08,0.843755,0.00053728,-9.6159e-08,-8.60587e-08,0.844292,0.000536829,-3.54335e-07,8.61696e-08,0.844828,0.000536379,-9.58263e-08,-7.98057e-08,0.845364,0.000535948,-3.35243e-07,5.42394e-08,0.8459,0.00053544,-1.72525e-07,-1.79426e-08,0.846435,0.000535041,-2.26353e-07,1.75308e-08,0.84697,0.000534641,-1.73761e-07,-5.21806e-08,0.847505,0.000534137,-3.30302e-07,7.19824e-08,0.848038,0.000533692,-1.14355e-07,-5.69349e-08,0.848572,0.000533293,-2.8516e-07,3.65479e-08,0.849105,0.000532832,-1.75516e-07,-2.96519e-08,0.849638,0.000532392,-2.64472e-07,2.2455e-08,0.85017,0.000531931,-1.97107e-07,-5.63451e-10,0.850702,0.000531535,-1.98797e-07,-2.02011e-08,0.851233,0.000531077,-2.59401e-07,2.17634e-08,0.851764,0.000530623,-1.94111e-07,-7.24794e-09,0.852294,0.000530213,-2.15854e-07,7.22832e-09,0.852824,0.000529803,-1.94169e-07,-2.16653e-08,0.853354,0.00052935,-2.59165e-07,1.98283e-08,0.853883,0.000528891,-1.9968e-07,1.95678e-09,0.854412,0.000528497,-1.9381e-07,-2.76554e-08,0.85494,0.000528027,-2.76776e-07,4.90603e-08,0.855468,0.00052762,-1.29596e-07,-4.93764e-08,0.855995,0.000527213,-2.77725e-07,2.92361e-08,0.856522,0.000526745,-1.90016e-07,-7.96341e-09,0.857049,0.000526341,-2.13907e-07,2.61752e-09,0.857575,0.000525922,-2.06054e-07,-2.50665e-09,0.8581,0.000525502,-2.13574e-07,7.40906e-09,0.858626,0.000525097,-1.91347e-07,-2.71296e-08,0.859151,0.000524633,-2.72736e-07,4.15048e-08,0.859675,0.000524212,-1.48221e-07,-1.96802e-08,0.860199,0.000523856,-2.07262e-07,-2.23886e-08,0.860723,0.000523375,-2.74428e-07,4.96299e-08,0.861246,0.000522975,-1.25538e-07,-5.69216e-08,0.861769,0.000522553,-2.96303e-07,5.88473e-08,0.862291,0.000522137,-1.19761e-07,-5.92584e-08,0.862813,0.00052172,-2.97536e-07,5.8977e-08,0.863334,0.000521301,-1.20605e-07,-5.74403e-08,0.863855,0.000520888,-2.92926e-07,5.15751e-08,0.864376,0.000520457,-1.38201e-07,-2.96506e-08,0.864896,0.000520091,-2.27153e-07,7.42277e-09,0.865416,0.000519659,-2.04885e-07,-4.05057e-11,0.865936,0.00051925,-2.05006e-07,-7.26074e-09,0.866455,0.000518818,-2.26788e-07,2.90835e-08,0.866973,0.000518451,-1.39538e-07,-4.94686e-08,0.867492,0.000518024,-2.87944e-07,4.95814e-08,0.868009,0.000517597,-1.39199e-07,-2.96479e-08,0.868527,0.000517229,-2.28143e-07,9.40539e-09,0.869044,0.000516801,-1.99927e-07,-7.9737e-09,0.86956,0.000516378,-2.23848e-07,2.24894e-08,0.870077,0.000515997,-1.5638e-07,-2.23793e-08,0.870592,0.000515617,-2.23517e-07,7.42302e-09,0.871108,0.000515193,-2.01248e-07,-7.31283e-09,0.871623,0.000514768,-2.23187e-07,2.18283e-08,0.872137,0.000514387,-1.57702e-07,-2.03959e-08,0.872652,0.000514011,-2.1889e-07,1.50711e-10,0.873165,0.000513573,-2.18437e-07,1.97931e-08,0.873679,0.000513196,-1.59058e-07,-1.97183e-08,0.874192,0.000512819,-2.18213e-07,-5.24324e-10,0.874704,0.000512381,-2.19786e-07,2.18156e-08,0.875217,0.000512007,-1.54339e-07,-2.71336e-08,0.875728,0.000511616,-2.3574e-07,2.71141e-08,0.87624,0.000511226,-1.54398e-07,-2.17182e-08,0.876751,0.000510852,-2.19552e-07,1.54131e-10,0.877262,0.000510414,-2.1909e-07,2.11017e-08,0.877772,0.000510039,-1.55785e-07,-2.49562e-08,0.878282,0.000509652,-2.30654e-07,1.91183e-08,0.878791,0.000509248,-1.73299e-07,8.08751e-09,0.8793,0.000508926,-1.49036e-07,-5.14684e-08,0.879809,0.000508474,-3.03441e-07,7.85766e-08,0.880317,0.000508103,-6.77112e-08,-8.40242e-08,0.880825,0.000507715,-3.19784e-07,7.87063e-08,0.881333,0.000507312,-8.36649e-08,-5.19871e-08,0.88184,0.000506988,-2.39626e-07,1.00327e-08,0.882346,0.000506539,-2.09528e-07,1.18562e-08,0.882853,0.000506156,-1.73959e-07,2.14703e-09,0.883359,0.000505814,-1.67518e-07,-2.04444e-08,0.883864,0.000505418,-2.28851e-07,2.00258e-08,0.88437,0.00050502,-1.68774e-07,-5.42855e-11,0.884874,0.000504682,-1.68937e-07,-1.98087e-08,0.885379,0.000504285,-2.28363e-07,1.96842e-08,0.885883,0.000503887,-1.6931e-07,6.76342e-10,0.886387,0.000503551,-1.67281e-07,-2.23896e-08,0.88689,0.000503149,-2.3445e-07,2.92774e-08,0.887393,0.000502768,-1.46618e-07,-3.51152e-08,0.887896,0.00050237,-2.51963e-07,5.15787e-08,0.888398,0.00050202,-9.72271e-08,-5.19903e-08,0.8889,0.00050167,-2.53198e-07,3.71732e-08,0.889401,0.000501275,-1.41678e-07,-3.70978e-08,0.889902,0.00050088,-2.52972e-07,5.16132e-08,0.890403,0.000500529,-9.81321e-08,-5.01459e-08,0.890903,0.000500183,-2.4857e-07,2.9761e-08,0.891403,0.000499775,-1.59287e-07,-9.29351e-09,0.891903,0.000499428,-1.87167e-07,7.41301e-09,0.892402,0.000499076,-1.64928e-07,-2.03585e-08,0.892901,0.000498685,-2.26004e-07,1.44165e-08,0.893399,0.000498276,-1.82754e-07,2.22974e-08,0.893898,0.000497978,-1.15862e-07,-4.40013e-08,0.894395,0.000497614,-2.47866e-07,3.44985e-08,0.894893,0.000497222,-1.44371e-07,-3.43882e-08,0.89539,0.00049683,-2.47535e-07,4.34497e-08,0.895886,0.000496465,-1.17186e-07,-2.02012e-08,0.896383,0.00049617,-1.7779e-07,-2.22497e-08,0.896879,0.000495748,-2.44539e-07,4.95952e-08,0.897374,0.000495408,-9.57532e-08,-5.69217e-08,0.89787,0.000495045,-2.66518e-07,5.88823e-08,0.898364,0.000494689,-8.98713e-08,-5.93983e-08,0.898859,0.000494331,-2.68066e-07,5.95017e-08,0.899353,0.000493973,-8.95613e-08,-5.9399e-08,0.899847,0.000493616,-2.67758e-07,5.8885e-08,0.90034,0.000493257,-9.11033e-08,-5.69317e-08,0.900833,0.000492904,-2.61898e-07,4.96326e-08,0.901326,0.000492529,-1.13001e-07,-2.23893e-08,0.901819,0.000492236,-1.80169e-07,-1.968e-08,0.902311,0.000491817,-2.39209e-07,4.15047e-08,0.902802,0.000491463,-1.14694e-07,-2.71296e-08,0.903293,0.000491152,-1.96083e-07,7.409e-09,0.903784,0.000490782,-1.73856e-07,-2.50645e-09,0.904275,0.000490427,-1.81376e-07,2.61679e-09,0.904765,0.000490072,-1.73525e-07,-7.96072e-09,0.905255,0.000489701,-1.97407e-07,2.92261e-08,0.905745,0.000489394,-1.09729e-07,-4.93389e-08,0.906234,0.000489027,-2.57746e-07,4.89204e-08,0.906723,0.000488658,-1.10985e-07,-2.71333e-08,0.907211,0.000488354,-1.92385e-07,8.30861e-12,0.907699,0.00048797,-1.9236e-07,2.71001e-08,0.908187,0.000487666,-1.1106e-07,-4.88041e-08,0.908675,0.000487298,-2.57472e-07,4.89069e-08,0.909162,0.000486929,-1.10751e-07,-2.76143e-08,0.909649,0.000486625,-1.93594e-07,1.9457e-09,0.910135,0.000486244,-1.87757e-07,1.98315e-08,0.910621,0.000485928,-1.28262e-07,-2.16671e-08,0.911107,0.000485606,-1.93264e-07,7.23216e-09,0.911592,0.000485241,-1.71567e-07,-7.26152e-09,0.912077,0.000484877,-1.93352e-07,2.18139e-08,0.912562,0.000484555,-1.2791e-07,-2.03895e-08,0.913047,0.000484238,-1.89078e-07,1.39494e-10,0.913531,0.000483861,-1.8866e-07,1.98315e-08,0.914014,0.000483543,-1.29165e-07,-1.98609e-08,0.914498,0.000483225,-1.88748e-07,7.39912e-12,0.914981,0.000482847,-1.88726e-07,1.98313e-08,0.915463,0.000482529,-1.29232e-07,-1.9728e-08,0.915946,0.000482212,-1.88416e-07,-5.24035e-10,0.916428,0.000481833,-1.89988e-07,2.18241e-08,0.916909,0.000481519,-1.24516e-07,-2.71679e-08,0.917391,0.000481188,-2.06019e-07,2.72427e-08,0.917872,0.000480858,-1.24291e-07,-2.21985e-08,0.918353,0.000480543,-1.90886e-07,1.94644e-09,0.918833,0.000480167,-1.85047e-07,1.44127e-08,0.919313,0.00047984,-1.41809e-07,7.39438e-12,0.919793,0.000479556,-1.41787e-07,-1.44423e-08,0.920272,0.000479229,-1.85114e-07,-1.84291e-09,0.920751,0.000478854,-1.90642e-07,2.18139e-08,0.92123,0.000478538,-1.25201e-07,-2.58081e-08,0.921708,0.00047821,-2.02625e-07,2.18139e-08,0.922186,0.00047787,-1.37183e-07,-1.84291e-09,0.922664,0.00047759,-1.42712e-07,-1.44423e-08,0.923141,0.000477262,-1.86039e-07,7.34701e-12,0.923618,0.00047689,-1.86017e-07,1.44129e-08,0.924095,0.000476561,-1.42778e-07,1.94572e-09,0.924572,0.000476281,-1.36941e-07,-2.21958e-08,0.925048,0.000475941,-2.03528e-07,2.72327e-08,0.925523,0.000475615,-1.2183e-07,-2.71304e-08,0.925999,0.00047529,-2.03221e-07,2.16843e-08,0.926474,0.000474949,-1.38168e-07,-2.16005e-12,0.926949,0.000474672,-1.38175e-07,-2.16756e-08,0.927423,0.000474331,-2.03202e-07,2.71001e-08,0.927897,0.000474006,-1.21902e-07,-2.71201e-08,0.928371,0.000473681,-2.03262e-07,2.17757e-08,0.928845,0.00047334,-1.37935e-07,-3.78028e-10,0.929318,0.000473063,-1.39069e-07,-2.02636e-08,0.929791,0.000472724,-1.9986e-07,2.18276e-08,0.930263,0.000472389,-1.34377e-07,-7.44231e-09,0.930736,0.000472098,-1.56704e-07,7.94165e-09,0.931208,0.000471809,-1.32879e-07,-2.43243e-08,0.931679,0.00047147,-2.05851e-07,2.97508e-08,0.932151,0.000471148,-1.16599e-07,-3.50742e-08,0.932622,0.000470809,-2.21822e-07,5.09414e-08,0.933092,0.000470518,-6.89976e-08,-4.94821e-08,0.933563,0.000470232,-2.17444e-07,2.77775e-08,0.934033,0.00046988,-1.34111e-07,-2.02351e-09,0.934502,0.000469606,-1.40182e-07,-1.96835e-08,0.934972,0.000469267,-1.99232e-07,2.11529e-08,0.935441,0.000468932,-1.35774e-07,-5.32332e-09,0.93591,0.000468644,-1.51743e-07,1.40413e-10,0.936378,0.000468341,-1.51322e-07,4.76166e-09,0.936846,0.000468053,-1.37037e-07,-1.9187e-08,0.937314,0.000467721,-1.94598e-07,1.23819e-08,0.937782,0.000467369,-1.57453e-07,2.92642e-08,0.938249,0.000467142,-6.96601e-08,-6.98342e-08,0.938716,0.000466793,-2.79163e-07,7.12586e-08,0.939183,0.000466449,-6.53869e-08,-3.63863e-08,0.939649,0.000466209,-1.74546e-07,1.46818e-08,0.940115,0.000465904,-1.305e-07,-2.2341e-08,0.940581,0.000465576,-1.97523e-07,1.50774e-08,0.941046,0.000465226,-1.52291e-07,2.16359e-08,0.941511,0.000464986,-8.73832e-08,-4.20162e-08,0.941976,0.000464685,-2.13432e-07,2.72198e-08,0.942441,0.00046434,-1.31773e-07,-7.2581e-09,0.942905,0.000464055,-1.53547e-07,1.81263e-09,0.943369,0.000463753,-1.48109e-07,7.58386e-12,0.943832,0.000463457,-1.48086e-07,-1.84298e-09,0.944296,0.000463155,-1.53615e-07,7.36433e-09,0.944759,0.00046287,-1.31522e-07,-2.76143e-08,0.945221,0.000462524,-2.14365e-07,4.34883e-08,0.945684,0.000462226,-8.39003e-08,-2.71297e-08,0.946146,0.000461977,-1.65289e-07,5.42595e-09,0.946608,0.000461662,-1.49012e-07,5.42593e-09,0.947069,0.000461381,-1.32734e-07,-2.71297e-08,0.94753,0.000461034,-2.14123e-07,4.34881e-08,0.947991,0.000460736,-8.36585e-08,-2.76134e-08,0.948452,0.000460486,-1.66499e-07,7.36083e-09,0.948912,0.000460175,-1.44416e-07,-1.82993e-09,0.949372,0.000459881,-1.49906e-07,-4.11073e-11,0.949832,0.000459581,-1.50029e-07,1.99434e-09,0.950291,0.000459287,-1.44046e-07,-7.93627e-09,0.950751,0.000458975,-1.67855e-07,2.97507e-08,0.951209,0.000458728,-7.86029e-08,-5.1462e-08,0.951668,0.000458417,-2.32989e-07,5.6888e-08,0.952126,0.000458121,-6.2325e-08,-5.68806e-08,0.952584,0.000457826,-2.32967e-07,5.14251e-08,0.953042,0.000457514,-7.86914e-08,-2.96107e-08,0.953499,0.000457268,-1.67523e-07,7.41296e-09,0.953956,0.000456955,-1.45285e-07,-4.11262e-11,0.954413,0.000456665,-1.45408e-07,-7.24847e-09,0.95487,0.000456352,-1.67153e-07,2.9035e-08,0.955326,0.000456105,-8.00484e-08,-4.92869e-08,0.955782,0.000455797,-2.27909e-07,4.89032e-08,0.956238,0.000455488,-8.11994e-08,-2.71166e-08,0.956693,0.000455244,-1.62549e-07,-4.13678e-11,0.957148,0.000454919,-1.62673e-07,2.72821e-08,0.957603,0.000454675,-8.0827e-08,-4.94824e-08,0.958057,0.000454365,-2.29274e-07,5.14382e-08,0.958512,0.000454061,-7.49597e-08,-3.7061e-08,0.958965,0.0004538,-1.86143e-07,3.72013e-08,0.959419,0.000453539,-7.45389e-08,-5.21396e-08,0.959873,0.000453234,-2.30958e-07,5.21476e-08,0.960326,0.000452928,-7.45146e-08,-3.72416e-08,0.960778,0.000452667,-1.8624e-07,3.72143e-08,0.961231,0.000452407,-7.45967e-08,-5.20109e-08,0.961683,0.000452101,-2.30629e-07,5.16199e-08,0.962135,0.000451795,-7.57696e-08,-3.52595e-08,0.962587,0.000451538,-1.81548e-07,2.98133e-08,0.963038,0.000451264,-9.2108e-08,-2.43892e-08,0.963489,0.000451007,-1.65276e-07,8.13892e-09,0.96394,0.000450701,-1.40859e-07,-8.16647e-09,0.964391,0.000450394,-1.65358e-07,2.45269e-08,0.964841,0.000450137,-9.17775e-08,-3.03367e-08,0.965291,0.000449863,-1.82787e-07,3.7215e-08,0.965741,0.000449609,-7.11424e-08,-5.89188e-08,0.96619,0.00044929,-2.47899e-07,7.92509e-08,0.966639,0.000449032,-1.01462e-08,-7.92707e-08,0.967088,0.000448773,-2.47958e-07,5.90181e-08,0.967537,0.000448455,-7.0904e-08,-3.75925e-08,0.967985,0.0004482,-1.83681e-07,3.17471e-08,0.968433,0.000447928,-8.84401e-08,-2.97913e-08,0.968881,0.000447662,-1.77814e-07,2.78133e-08,0.969329,0.000447389,-9.4374e-08,-2.18572e-08,0.969776,0.000447135,-1.59946e-07,1.10134e-11,0.970223,0.000446815,-1.59913e-07,2.18132e-08,0.97067,0.000446561,-9.44732e-08,-2.76591e-08,0.971116,0.000446289,-1.7745e-07,2.92185e-08,0.971562,0.000446022,-8.97948e-08,-2.96104e-08,0.972008,0.000445753,-1.78626e-07,2.96185e-08,0.972454,0.000445485,-8.97706e-08,-2.92588e-08,0.972899,0.000445218,-1.77547e-07,2.78123e-08,0.973344,0.000444946,-9.41103e-08,-2.23856e-08,0.973789,0.000444691,-1.61267e-07,2.12559e-09,0.974233,0.000444374,-1.5489e-07,1.38833e-08,0.974678,0.000444106,-1.13241e-07,1.94591e-09,0.975122,0.000443886,-1.07403e-07,-2.16669e-08,0.975565,0.000443606,-1.72404e-07,2.5117e-08,0.976009,0.000443336,-9.70526e-08,-1.91963e-08,0.976452,0.000443085,-1.54642e-07,-7.93627e-09,0.976895,0.000442752,-1.7845e-07,5.09414e-08,0.977338,0.000442548,-2.56262e-08,-7.66201e-08,0.97778,0.000442266,-2.55486e-07,7.67249e-08,0.978222,0.000441986,-2.53118e-08,-5.14655e-08,0.978664,0.000441781,-1.79708e-07,9.92773e-09,0.979106,0.000441451,-1.49925e-07,1.17546e-08,0.979547,0.000441186,-1.14661e-07,2.65868e-09,0.979988,0.000440965,-1.06685e-07,-2.23893e-08,0.980429,0.000440684,-1.73853e-07,2.72939e-08,0.980869,0.000440419,-9.19716e-08,-2.71816e-08,0.98131,0.000440153,-1.73516e-07,2.18278e-08,0.98175,0.000439872,-1.08033e-07,-5.24833e-10,0.982189,0.000439654,-1.09607e-07,-1.97284e-08,0.982629,0.000439376,-1.68793e-07,1.98339e-08,0.983068,0.000439097,-1.09291e-07,-2.62901e-12,0.983507,0.000438879,-1.09299e-07,-1.98234e-08,0.983946,0.000438601,-1.68769e-07,1.96916e-08,0.984384,0.000438322,-1.09694e-07,6.6157e-10,0.984823,0.000438105,-1.0771e-07,-2.23379e-08,0.985261,0.000437823,-1.74723e-07,2.90855e-08,0.985698,0.00043756,-8.74669e-08,-3.43992e-08,0.986136,0.000437282,-1.90665e-07,4.89068e-08,0.986573,0.000437048,-4.39442e-08,-4.20188e-08,0.98701,0.000436834,-1.7e-07,-4.11073e-11,0.987446,0.000436494,-1.70124e-07,4.21832e-08,0.987883,0.00043628,-4.35742e-08,-4.94824e-08,0.988319,0.000436044,-1.92021e-07,3.6537e-08,0.988755,0.00043577,-8.24102e-08,-3.70611e-08,0.989191,0.000435494,-1.93593e-07,5.21026e-08,0.989626,0.000435263,-3.72855e-08,-5.21402e-08,0.990061,0.000435032,-1.93706e-07,3.7249e-08,0.990496,0.000434756,-8.19592e-08,-3.72512e-08,0.990931,0.000434481,-1.93713e-07,5.21511e-08,0.991365,0.00043425,-3.72595e-08,-5.21439e-08,0.991799,0.000434019,-1.93691e-07,3.72152e-08,0.992233,0.000433743,-8.20456e-08,-3.71123e-08,0.992667,0.000433468,-1.93382e-07,5.16292e-08,0.9931,0.000433236,-3.84947e-08,-5.01953e-08,0.993533,0.000433008,-1.89081e-07,2.99427e-08,0.993966,0.00043272,-9.92525e-08,-9.9708e-09,0.994399,0.000432491,-1.29165e-07,9.94051e-09,0.994831,0.000432263,-9.93434e-08,-2.97912e-08,0.995263,0.000431975,-1.88717e-07,4.96198e-08,0.995695,0.000431746,-3.98578e-08,-4.94785e-08,0.996127,0.000431518,-1.88293e-07,2.9085e-08,0.996558,0.000431229,-1.01038e-07,-7.25675e-09,0.996989,0.000431005,-1.22809e-07,-5.79945e-11,0.99742,0.000430759,-1.22983e-07,7.48873e-09,0.997851,0.000430536,-1.00516e-07,-2.98969e-08,0.998281,0.000430245,-1.90207e-07,5.24942e-08,0.998711,0.000430022,-3.27246e-08,-6.08706e-08,0.999141,0.000429774,-2.15336e-07,7.17788e-08,0.999571,0.000429392,0.,0.};\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void Lab2RGBConvert_32F(const T& src, D& dst)\n        {\n            const float lThresh = 0.008856f * 903.3f;\n            const float fThresh = 7.787f * 0.008856f + 16.0f / 116.0f;\n\n            float Y, fy;\n\n            if (src.x <= lThresh)\n            {\n                Y = src.x / 903.3f;\n                fy = 7.787f * Y + 16.0f / 116.0f;\n            }\n            else\n            {\n                fy = (src.x + 16.0f) / 116.0f;\n                Y = fy * fy * fy;\n            }\n\n            float X = src.y / 500.0f + fy;\n            float Z = fy - src.z / 200.0f;\n\n            if (X <= fThresh)\n                X = (X - 16.0f / 116.0f) / 7.787f;\n            else\n                X = X * X * X;\n\n            if (Z <= fThresh)\n                Z = (Z - 16.0f / 116.0f) / 7.787f;\n            else\n                Z = Z * Z * Z;\n\n            float B = 0.052891f * X - 0.204043f * Y + 1.151152f * Z;\n            float G = -0.921235f * X + 1.875991f * Y + 0.045244f * Z;\n            float R = 3.079933f * X - 1.537150f * Y - 0.542782f * Z;\n\n            if (srgb)\n            {\n                B = splineInterpolate(B * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n                G = splineInterpolate(G * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n                R = splineInterpolate(R * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n            }\n\n            dst.x = blueIdx == 0 ? B : R;\n            dst.y = G;\n            dst.z = blueIdx == 0 ? R : B;\n            setAlpha(dst, ColorChannel<float>::max());\n        }\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void Lab2RGBConvert_8U(const T& src, D& dst)\n        {\n            float3 srcf, dstf;\n\n            srcf.x = src.x * (100.f / 255.f);\n            srcf.y = src.y - 128;\n            srcf.z = src.z - 128;\n\n            Lab2RGBConvert_32F<srgb, blueIdx>(srcf, dstf);\n\n            dst.x = saturate_cast<uchar>(dstf.x * 255.f);\n            dst.y = saturate_cast<uchar>(dstf.y * 255.f);\n            dst.z = saturate_cast<uchar>(dstf.z * 255.f);\n            setAlpha(dst, ColorChannel<uchar>::max());\n        }\n\n        template <typename T, int scn, int dcn, bool srgb, int blueIdx> struct Lab2RGB;\n\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct Lab2RGB<uchar, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<uchar, scn>::vec_type, typename TypeVec<uchar, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<uchar, dcn>::vec_type operator ()(const typename TypeVec<uchar, scn>::vec_type& src) const\n            {\n                typename TypeVec<uchar, dcn>::vec_type dst;\n\n                Lab2RGBConvert_8U<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ Lab2RGB() {}\n            __host__ __device__ __forceinline__ Lab2RGB(const Lab2RGB&) {}\n        };\n\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct Lab2RGB<float, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                Lab2RGBConvert_32F<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ Lab2RGB() {}\n            __host__ __device__ __forceinline__ Lab2RGB(const Lab2RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_Lab2RGB_TRAITS(name, scn, dcn, srgb, blueIdx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::Lab2RGB<T, scn, dcn, srgb, blueIdx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////////// RGB <-> Luv /////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ float c_LabCbrtTab[] = {0.137931,0.0114066,0.,1.18859e-07,0.149338,0.011407,3.56578e-07,-5.79396e-07,0.160745,0.0114059,-1.38161e-06,2.16892e-06,0.172151,0.0114097,5.12516e-06,-8.0814e-06,0.183558,0.0113957,-1.9119e-05,3.01567e-05,0.194965,0.0114479,7.13509e-05,-0.000112545,0.206371,0.011253,-0.000266285,-0.000106493,0.217252,0.0104009,-0.000585765,7.32149e-05,0.22714,0.00944906,-0.00036612,1.21917e-05,0.236235,0.0087534,-0.000329545,2.01753e-05,0.244679,0.00815483,-0.000269019,1.24435e-05,0.252577,0.00765412,-0.000231689,1.05618e-05,0.26001,0.00722243,-0.000200003,8.26662e-06,0.267041,0.00684723,-0.000175203,6.76746e-06,0.27372,0.00651712,-0.000154901,5.61192e-06,0.280088,0.00622416,-0.000138065,4.67009e-06,0.286179,0.00596204,-0.000124055,3.99012e-06,0.292021,0.0057259,-0.000112085,3.36032e-06,0.297638,0.00551181,-0.000102004,2.95338e-06,0.30305,0.00531666,-9.31435e-05,2.52875e-06,0.308277,0.00513796,-8.55572e-05,2.22022e-06,0.313331,0.00497351,-7.88966e-05,1.97163e-06,0.318228,0.00482163,-7.29817e-05,1.7248e-06,0.322978,0.00468084,-6.78073e-05,1.55998e-06,0.327593,0.0045499,-6.31274e-05,1.36343e-06,0.332081,0.00442774,-5.90371e-05,1.27136e-06,0.336451,0.00431348,-5.5223e-05,1.09111e-06,0.34071,0.00420631,-5.19496e-05,1.0399e-06,0.344866,0.00410553,-4.88299e-05,9.18347e-07,0.348923,0.00401062,-4.60749e-05,8.29942e-07,0.352889,0.00392096,-4.35851e-05,7.98478e-07,0.356767,0.00383619,-4.11896e-05,6.84917e-07,0.360562,0.00375586,-3.91349e-05,6.63976e-07,0.36428,0.00367959,-3.7143e-05,5.93086e-07,0.367923,0.00360708,-3.53637e-05,5.6976e-07,0.371495,0.00353806,-3.36544e-05,4.95533e-07,0.375,0.00347224,-3.21678e-05,4.87951e-07,0.378441,0.00340937,-3.0704e-05,4.4349e-07,0.38182,0.00334929,-2.93735e-05,4.20297e-07,0.38514,0.0032918,-2.81126e-05,3.7872e-07,0.388404,0.00323671,-2.69764e-05,3.596e-07,0.391614,0.00318384,-2.58976e-05,3.5845e-07,0.394772,0.00313312,-2.48223e-05,2.92765e-07,0.397881,0.00308435,-2.3944e-05,3.18232e-07,0.400942,0.00303742,-2.29893e-05,2.82046e-07,0.403957,0.00299229,-2.21432e-05,2.52315e-07,0.406927,0.00294876,-2.13862e-05,2.58416e-07,0.409855,0.00290676,-2.0611e-05,2.33939e-07,0.412741,0.00286624,-1.99092e-05,2.36342e-07,0.415587,0.00282713,-1.92001e-05,1.916e-07,0.418396,0.00278931,-1.86253e-05,2.1915e-07,0.421167,0.00275271,-1.79679e-05,1.83498e-07,0.423901,0.00271733,-1.74174e-05,1.79343e-07,0.426602,0.00268303,-1.68794e-05,1.72013e-07,0.429268,0.00264979,-1.63633e-05,1.75686e-07,0.431901,0.00261759,-1.58363e-05,1.3852e-07,0.434503,0.00258633,-1.54207e-05,1.64304e-07,0.437074,0.00255598,-1.49278e-05,1.28136e-07,0.439616,0.00252651,-1.45434e-05,1.57618e-07,0.442128,0.0024979,-1.40705e-05,1.0566e-07,0.444612,0.00247007,-1.37535e-05,1.34998e-07,0.447068,0.00244297,-1.33485e-05,1.29207e-07,0.449498,0.00241666,-1.29609e-05,9.32347e-08,0.451902,0.00239102,-1.26812e-05,1.23703e-07,0.45428,0.00236603,-1.23101e-05,9.74072e-08,0.456634,0.0023417,-1.20179e-05,1.12518e-07,0.458964,0.002318,-1.16803e-05,7.83681e-08,0.46127,0.00229488,-1.14452e-05,1.10452e-07,0.463554,0.00227232,-1.11139e-05,7.58719e-08,0.465815,0.00225032,-1.08863e-05,9.2699e-08,0.468055,0.00222882,-1.06082e-05,8.97738e-08,0.470273,0.00220788,-1.03388e-05,5.4845e-08,0.47247,0.00218736,-1.01743e-05,1.0808e-07,0.474648,0.00216734,-9.85007e-06,4.9277e-08,0.476805,0.00214779,-9.70224e-06,8.22408e-08,0.478943,0.00212863,-9.45551e-06,6.87942e-08,0.481063,0.00210993,-9.24913e-06,5.98144e-08,0.483163,0.00209161,-9.06969e-06,7.93789e-08,0.485246,0.00207371,-8.83155e-06,3.99032e-08,0.487311,0.00205616,-8.71184e-06,8.88325e-08,0.489358,0.002039,-8.44534e-06,2.20004e-08,0.491389,0.00202218,-8.37934e-06,9.13872e-08,0.493403,0.0020057,-8.10518e-06,2.96829e-08,0.495401,0.00198957,-8.01613e-06,5.81028e-08,0.497382,0.00197372,-7.84183e-06,6.5731e-08,0.499348,0.00195823,-7.64463e-06,3.66019e-08,0.501299,0.00194305,-7.53483e-06,2.62811e-08,0.503234,0.00192806,-7.45598e-06,9.66907e-08,0.505155,0.00191344,-7.16591e-06,4.18928e-09,0.507061,0.00189912,-7.15334e-06,6.53665e-08,0.508953,0.00188501,-6.95724e-06,3.23686e-08,0.510831,0.00187119,-6.86014e-06,4.35774e-08,0.512696,0.0018576,-6.72941e-06,3.17406e-08,0.514547,0.00184424,-6.63418e-06,6.78785e-08,0.516384,0.00183117,-6.43055e-06,-5.23126e-09,0.518209,0.0018183,-6.44624e-06,7.22562e-08,0.520021,0.00180562,-6.22947e-06,1.42292e-08,0.52182,0.0017932,-6.18679e-06,4.9641e-08,0.523607,0.00178098,-6.03786e-06,2.56259e-08,0.525382,0.00176898,-5.96099e-06,2.66696e-08,0.527145,0.00175714,-5.88098e-06,4.65094e-08,0.528897,0.00174552,-5.74145e-06,2.57114e-08,0.530637,0.00173411,-5.66431e-06,2.94588e-08,0.532365,0.00172287,-5.57594e-06,3.52667e-08,0.534082,0.00171182,-5.47014e-06,8.28868e-09,0.535789,0.00170091,-5.44527e-06,5.07871e-08,0.537484,0.00169017,-5.29291e-06,2.69817e-08,0.539169,0.00167967,-5.21197e-06,2.01009e-08,0.540844,0.0016693,-5.15166e-06,1.18237e-08,0.542508,0.00165903,-5.11619e-06,5.18135e-08,0.544162,0.00164896,-4.96075e-06,1.9341e-08,0.545806,0.00163909,-4.90273e-06,-9.96867e-09,0.54744,0.00162926,-4.93263e-06,8.01382e-08,0.549064,0.00161963,-4.69222e-06,-1.25601e-08,0.550679,0.00161021,-4.7299e-06,2.97067e-08,0.552285,0.00160084,-4.64078e-06,1.29426e-08,0.553881,0.0015916,-4.60195e-06,3.77327e-08,0.555468,0.00158251,-4.48875e-06,1.49412e-08,0.557046,0.00157357,-4.44393e-06,2.17118e-08,0.558615,0.00156475,-4.3788e-06,1.74206e-08,0.560176,0.00155605,-4.32653e-06,2.78152e-08,0.561727,0.00154748,-4.24309e-06,-9.47239e-09,0.563271,0.00153896,-4.27151e-06,6.9679e-08,0.564805,0.00153063,-4.06247e-06,-3.08246e-08,0.566332,0.00152241,-4.15494e-06,5.36188e-08,0.56785,0.00151426,-3.99409e-06,-4.83594e-09,0.56936,0.00150626,-4.00859e-06,2.53293e-08,0.570863,0.00149832,-3.93261e-06,2.27286e-08,0.572357,0.00149052,-3.86442e-06,2.96541e-09,0.573844,0.0014828,-3.85552e-06,2.50147e-08,0.575323,0.00147516,-3.78048e-06,1.61842e-08,0.576794,0.00146765,-3.73193e-06,2.94582e-08,0.578258,0.00146028,-3.64355e-06,-1.48076e-08,0.579715,0.00145295,-3.68798e-06,2.97724e-08,0.581164,0.00144566,-3.59866e-06,1.49272e-08,0.582606,0.00143851,-3.55388e-06,2.97285e-08,0.584041,0.00143149,-3.46469e-06,-1.46323e-08,0.585469,0.00142451,-3.50859e-06,2.88004e-08,0.58689,0.00141758,-3.42219e-06,1.864e-08,0.588304,0.00141079,-3.36627e-06,1.58482e-08,0.589712,0.00140411,-3.31872e-06,-2.24279e-08,0.591112,0.00139741,-3.38601e-06,7.38639e-08,0.592507,0.00139085,-3.16441e-06,-3.46088e-08,0.593894,0.00138442,-3.26824e-06,4.96675e-09,0.595275,0.0013779,-3.25334e-06,7.4346e-08,0.59665,0.00137162,-3.0303e-06,-6.39319e-08,0.598019,0.00136536,-3.2221e-06,6.21725e-08,0.599381,0.00135911,-3.03558e-06,-5.94423e-09,0.600737,0.00135302,-3.05341e-06,2.12091e-08,0.602087,0.00134697,-2.98979e-06,-1.92876e-08,0.603431,0.00134094,-3.04765e-06,5.5941e-08,0.604769,0.00133501,-2.87983e-06,-2.56622e-08,0.606101,0.00132917,-2.95681e-06,4.67078e-08,0.607427,0.0013234,-2.81669e-06,-4.19592e-08,0.608748,0.00131764,-2.94257e-06,6.15243e-08,0.610062,0.00131194,-2.75799e-06,-2.53244e-08,0.611372,0.00130635,-2.83397e-06,3.97739e-08,0.612675,0.0013008,-2.71465e-06,-1.45618e-08,0.613973,0.00129533,-2.75833e-06,1.84733e-08,0.615266,0.00128986,-2.70291e-06,2.73606e-10,0.616553,0.00128446,-2.70209e-06,4.00367e-08,0.617835,0.00127918,-2.58198e-06,-4.12113e-08,0.619111,0.00127389,-2.70561e-06,6.52039e-08,0.620383,0.00126867,-2.51e-06,-4.07901e-08,0.621649,0.00126353,-2.63237e-06,3.83516e-08,0.62291,0.00125838,-2.51732e-06,6.59315e-09,0.624166,0.00125337,-2.49754e-06,-5.11939e-09,0.625416,0.00124836,-2.5129e-06,1.38846e-08,0.626662,0.00124337,-2.47124e-06,9.18514e-09,0.627903,0.00123846,-2.44369e-06,8.97952e-09,0.629139,0.0012336,-2.41675e-06,1.45012e-08,0.63037,0.00122881,-2.37325e-06,-7.37949e-09,0.631597,0.00122404,-2.39538e-06,1.50169e-08,0.632818,0.00121929,-2.35033e-06,6.91648e-09,0.634035,0.00121461,-2.32958e-06,1.69219e-08,0.635248,0.00121,-2.27882e-06,-1.49997e-08,0.636455,0.0012054,-2.32382e-06,4.30769e-08,0.637659,0.00120088,-2.19459e-06,-3.80986e-08,0.638857,0.00119638,-2.30888e-06,4.97134e-08,0.640051,0.00119191,-2.15974e-06,-4.15463e-08,0.641241,0.00118747,-2.28438e-06,5.68667e-08,0.642426,0.00118307,-2.11378e-06,-7.10641e-09,0.643607,0.00117882,-2.1351e-06,-2.8441e-08,0.644784,0.00117446,-2.22042e-06,6.12658e-08,0.645956,0.00117021,-2.03663e-06,-3.78083e-08,0.647124,0.00116602,-2.15005e-06,3.03627e-08,0.648288,0.00116181,-2.05896e-06,-2.40379e-08,0.649448,0.00115762,-2.13108e-06,6.57887e-08,0.650603,0.00115356,-1.93371e-06,-6.03028e-08,0.651755,0.00114951,-2.11462e-06,5.62134e-08,0.652902,0.00114545,-1.94598e-06,-4.53417e-08,0.654046,0.00114142,-2.082e-06,6.55489e-08,0.655185,0.00113745,-1.88536e-06,-3.80396e-08,0.656321,0.00113357,-1.99948e-06,2.70049e-08,0.657452,0.00112965,-1.91846e-06,-1.03755e-08,0.65858,0.00112578,-1.94959e-06,1.44973e-08,0.659704,0.00112192,-1.9061e-06,1.1991e-08,0.660824,0.00111815,-1.87012e-06,-2.85634e-09,0.66194,0.0011144,-1.87869e-06,-5.65782e-10,0.663053,0.00111064,-1.88039e-06,5.11947e-09,0.664162,0.0011069,-1.86503e-06,3.96924e-08,0.665267,0.00110328,-1.74595e-06,-4.46795e-08,0.666368,0.00109966,-1.87999e-06,1.98161e-08,0.667466,0.00109596,-1.82054e-06,2.502e-08,0.66856,0.00109239,-1.74548e-06,-6.86593e-10,0.669651,0.0010889,-1.74754e-06,-2.22739e-08,0.670738,0.00108534,-1.81437e-06,3.01776e-08,0.671821,0.0010818,-1.72383e-06,2.07732e-08,0.672902,0.00107841,-1.66151e-06,-5.36658e-08,0.673978,0.00107493,-1.82251e-06,7.46802e-08,0.675051,0.00107151,-1.59847e-06,-6.62411e-08,0.676121,0.00106811,-1.79719e-06,7.10748e-08,0.677188,0.00106473,-1.58397e-06,-3.92441e-08,0.678251,0.00106145,-1.7017e-06,2.62973e-08,0.679311,0.00105812,-1.62281e-06,-6.34035e-09,0.680367,0.00105486,-1.64183e-06,-9.36249e-10,0.68142,0.00105157,-1.64464e-06,1.00854e-08,0.68247,0.00104831,-1.61438e-06,2.01995e-08,0.683517,0.00104514,-1.55378e-06,-3.1279e-08,0.68456,0.00104194,-1.64762e-06,4.53114e-08,0.685601,0.00103878,-1.51169e-06,-3.07573e-08,0.686638,0.00103567,-1.60396e-06,1.81133e-08,0.687672,0.00103251,-1.54962e-06,1.79085e-08,0.688703,0.00102947,-1.49589e-06,-3.01428e-08,0.689731,0.00102639,-1.58632e-06,4.30583e-08,0.690756,0.00102334,-1.45715e-06,-2.28814e-08,0.691778,0.00102036,-1.52579e-06,-1.11373e-08,0.692797,0.00101727,-1.5592e-06,6.74305e-08,0.693812,0.00101436,-1.35691e-06,-7.97709e-08,0.694825,0.0010114,-1.59622e-06,7.28391e-08,0.695835,0.00100843,-1.37771e-06,-3.27715e-08,0.696842,0.00100558,-1.47602e-06,-1.35807e-09,0.697846,0.00100262,-1.48009e-06,3.82037e-08,0.698847,0.000999775,-1.36548e-06,-3.22474e-08,0.699846,0.000996948,-1.46223e-06,3.11809e-08,0.700841,0.000994117,-1.36868e-06,-3.28714e-08,0.701834,0.000991281,-1.4673e-06,4.07001e-08,0.702824,0.000988468,-1.3452e-06,-1.07197e-08,0.703811,0.000985746,-1.37736e-06,2.17866e-09,0.704795,0.000982998,-1.37082e-06,2.00521e-09,0.705777,0.000980262,-1.3648e-06,-1.01996e-08,0.706756,0.000977502,-1.3954e-06,3.87931e-08,0.707732,0.000974827,-1.27902e-06,-2.57632e-08,0.708706,0.000972192,-1.35631e-06,4.65513e-09,0.709676,0.000969493,-1.34235e-06,7.14257e-09,0.710645,0.00096683,-1.32092e-06,2.63791e-08,0.71161,0.000964267,-1.24178e-06,-5.30543e-08,0.712573,0.000961625,-1.40095e-06,6.66289e-08,0.713533,0.000959023,-1.20106e-06,-3.46474e-08,0.714491,0.000956517,-1.305e-06,1.23559e-08,0.715446,0.000953944,-1.26793e-06,-1.47763e-08,0.716399,0.000951364,-1.31226e-06,4.67494e-08,0.717349,0.000948879,-1.17201e-06,-5.3012e-08,0.718297,0.000946376,-1.33105e-06,4.60894e-08,0.719242,0.000943852,-1.19278e-06,-1.21366e-08,0.720185,0.00094143,-1.22919e-06,2.45673e-09,0.721125,0.000938979,-1.22182e-06,2.30966e-09,0.722063,0.000936543,-1.21489e-06,-1.16954e-08,0.722998,0.000934078,-1.24998e-06,4.44718e-08,0.723931,0.000931711,-1.11656e-06,-4.69823e-08,0.724861,0.000929337,-1.25751e-06,2.4248e-08,0.725789,0.000926895,-1.18477e-06,9.5949e-09,0.726715,0.000924554,-1.15598e-06,-3.02286e-09,0.727638,0.000922233,-1.16505e-06,2.49649e-09,0.72856,0.00091991,-1.15756e-06,-6.96321e-09,0.729478,0.000917575,-1.17845e-06,2.53564e-08,0.730395,0.000915294,-1.10238e-06,-3.48578e-08,0.731309,0.000912984,-1.20695e-06,5.44704e-08,0.732221,0.000910734,-1.04354e-06,-6.38144e-08,0.73313,0.000908455,-1.23499e-06,8.15781e-08,0.734038,0.00090623,-9.90253e-07,-8.3684e-08,0.734943,0.000903999,-1.2413e-06,7.43441e-08,0.735846,0.000901739,-1.01827e-06,-3.48787e-08,0.736746,0.000899598,-1.12291e-06,5.56596e-09,0.737645,0.000897369,-1.10621e-06,1.26148e-08,0.738541,0.000895194,-1.06837e-06,3.57935e-09,0.739435,0.000893068,-1.05763e-06,-2.69322e-08,0.740327,0.000890872,-1.13842e-06,4.45448e-08,0.741217,0.000888729,-1.00479e-06,-3.20376e-08,0.742105,0.000886623,-1.1009e-06,2.40011e-08,0.74299,0.000884493,-1.0289e-06,-4.36209e-09,0.743874,0.000882422,-1.04199e-06,-6.55268e-09,0.744755,0.000880319,-1.06164e-06,3.05728e-08,0.745634,0.000878287,-9.69926e-07,-5.61338e-08,0.746512,0.000876179,-1.13833e-06,7.4753e-08,0.747387,0.000874127,-9.14068e-07,-6.40644e-08,0.74826,0.000872106,-1.10626e-06,6.22955e-08,0.749131,0.000870081,-9.19375e-07,-6.59083e-08,0.75,0.000868044,-1.1171e-06,8.21284e-08,0.750867,0.000866056,-8.70714e-07,-8.37915e-08,0.751732,0.000864064,-1.12209e-06,7.42237e-08,0.752595,0.000862042,-8.99418e-07,-3.42894e-08,0.753456,0.00086014,-1.00229e-06,3.32955e-09,0.754315,0.000858146,-9.92297e-07,2.09712e-08,0.755173,0.000856224,-9.29384e-07,-2.76096e-08,0.756028,0.000854282,-1.01221e-06,2.98627e-08,0.756881,0.000852348,-9.22625e-07,-3.22365e-08,0.757733,0.000850406,-1.01933e-06,3.94786e-08,0.758582,0.000848485,-9.00898e-07,-6.46833e-09,0.75943,0.000846664,-9.20303e-07,-1.36052e-08,0.760275,0.000844783,-9.61119e-07,1.28447e-09,0.761119,0.000842864,-9.57266e-07,8.4674e-09,0.761961,0.000840975,-9.31864e-07,2.44506e-08,0.762801,0.000839185,-8.58512e-07,-4.6665e-08,0.763639,0.000837328,-9.98507e-07,4.30001e-08,0.764476,0.00083546,-8.69507e-07,-6.12609e-09,0.76531,0.000833703,-8.87885e-07,-1.84959e-08,0.766143,0.000831871,-9.43372e-07,2.05052e-08,0.766974,0.000830046,-8.81857e-07,-3.92026e-09,0.767803,0.000828271,-8.93618e-07,-4.82426e-09,0.768631,0.000826469,-9.0809e-07,2.32172e-08,0.769456,0.000824722,-8.38439e-07,-2.84401e-08,0.77028,0.00082296,-9.23759e-07,3.09386e-08,0.771102,0.000821205,-8.30943e-07,-3.57099e-08,0.771922,0.000819436,-9.38073e-07,5.22963e-08,0.772741,0.000817717,-7.81184e-07,-5.42658e-08,0.773558,0.000815992,-9.43981e-07,4.55579e-08,0.774373,0.000814241,-8.07308e-07,-8.75656e-09,0.775186,0.0008126,-8.33578e-07,-1.05315e-08,0.775998,0.000810901,-8.65172e-07,-8.72188e-09,0.776808,0.000809145,-8.91338e-07,4.54191e-08,0.777616,0.000807498,-7.5508e-07,-5.37454e-08,0.778423,0.000805827,-9.16317e-07,5.03532e-08,0.779228,0.000804145,-7.65257e-07,-2.84584e-08,0.780031,0.000802529,-8.50632e-07,3.87579e-09,0.780833,0.00080084,-8.39005e-07,1.29552e-08,0.781633,0.0007992,-8.00139e-07,3.90804e-09,0.782432,0.000797612,-7.88415e-07,-2.85874e-08,0.783228,0.000795949,-8.74177e-07,5.0837e-08,0.784023,0.000794353,-7.21666e-07,-5.55513e-08,0.784817,0.000792743,-8.8832e-07,5.21587e-08,0.785609,0.000791123,-7.31844e-07,-3.38744e-08,0.786399,0.000789558,-8.33467e-07,2.37342e-08,0.787188,0.000787962,-7.62264e-07,-1.45775e-09,0.787975,0.000786433,-7.66638e-07,-1.79034e-08,0.788761,0.000784846,-8.20348e-07,1.34665e-08,0.789545,0.000783246,-7.79948e-07,2.3642e-08,0.790327,0.000781757,-7.09022e-07,-4.84297e-08,0.791108,0.000780194,-8.54311e-07,5.08674e-08,0.791888,0.000778638,-7.01709e-07,-3.58303e-08,0.792666,0.000777127,-8.092e-07,3.28493e-08,0.793442,0.000775607,-7.10652e-07,-3.59624e-08,0.794217,0.000774078,-8.1854e-07,5.13959e-08,0.79499,0.000772595,-6.64352e-07,-5.04121e-08,0.795762,0.000771115,-8.15588e-07,3.10431e-08,0.796532,0.000769577,-7.22459e-07,-1.41557e-08,0.797301,0.00076809,-7.64926e-07,2.55795e-08,0.798069,0.000766636,-6.88187e-07,-2.85578e-08,0.798835,0.000765174,-7.73861e-07,2.90472e-08,0.799599,0.000763714,-6.86719e-07,-2.80262e-08,0.800362,0.000762256,-7.70798e-07,2.34531e-08,0.801123,0.000760785,-7.00438e-07,-6.18144e-09,0.801884,0.000759366,-7.18983e-07,1.27263e-09,0.802642,0.000757931,-7.15165e-07,1.09101e-09,0.803399,0.000756504,-7.11892e-07,-5.63675e-09,0.804155,0.000755064,-7.28802e-07,2.14559e-08,0.80491,0.00075367,-6.64434e-07,-2.05821e-08,0.805663,0.00075228,-7.26181e-07,1.26812e-09,0.806414,0.000750831,-7.22377e-07,1.55097e-08,0.807164,0.000749433,-6.75848e-07,-3.70216e-09,0.807913,0.00074807,-6.86954e-07,-7.0105e-10,0.80866,0.000746694,-6.89057e-07,6.5063e-09,0.809406,0.000745336,-6.69538e-07,-2.53242e-08,0.810151,0.000743921,-7.45511e-07,3.51858e-08,0.810894,0.000742535,-6.39953e-07,3.79034e-09,0.811636,0.000741267,-6.28582e-07,-5.03471e-08,0.812377,0.000739858,-7.79624e-07,7.83886e-08,0.813116,0.000738534,-5.44458e-07,-8.43935e-08,0.813854,0.000737192,-7.97638e-07,8.03714e-08,0.81459,0.000735838,-5.56524e-07,-5.82784e-08,0.815325,0.00073455,-7.31359e-07,3.35329e-08,0.816059,0.000733188,-6.3076e-07,-1.62486e-08,0.816792,0.000731878,-6.79506e-07,3.14614e-08,0.817523,0.000730613,-5.85122e-07,-4.99925e-08,0.818253,0.000729293,-7.35099e-07,4.92994e-08,0.818982,0.000727971,-5.87201e-07,-2.79959e-08,0.819709,0.000726712,-6.71189e-07,3.07959e-09,0.820435,0.000725379,-6.6195e-07,1.56777e-08,0.82116,0.000724102,-6.14917e-07,-6.18564e-09,0.821883,0.000722854,-6.33474e-07,9.06488e-09,0.822606,0.000721614,-6.06279e-07,-3.00739e-08,0.823327,0.000720311,-6.96501e-07,5.16262e-08,0.824046,0.000719073,-5.41623e-07,-5.72214e-08,0.824765,0.000717818,-7.13287e-07,5.80503e-08,0.825482,0.000716566,-5.39136e-07,-5.57703e-08,0.826198,0.00071532,-7.06447e-07,4.58215e-08,0.826912,0.000714045,-5.68983e-07,-8.30636e-09,0.827626,0.000712882,-5.93902e-07,-1.25961e-08,0.828338,0.000711656,-6.3169e-07,-9.13985e-10,0.829049,0.00071039,-6.34432e-07,1.62519e-08,0.829759,0.00070917,-5.85676e-07,-4.48904e-09,0.830468,0.000707985,-5.99143e-07,1.70418e-09,0.831175,0.000706792,-5.9403e-07,-2.32768e-09,0.831881,0.000705597,-6.01014e-07,7.60648e-09,0.832586,0.000704418,-5.78194e-07,-2.80982e-08,0.83329,0.000703177,-6.62489e-07,4.51817e-08,0.833993,0.000701988,-5.26944e-07,-3.34192e-08,0.834694,0.000700834,-6.27201e-07,2.88904e-08,0.835394,0.000699666,-5.4053e-07,-2.25378e-08,0.836093,0.000698517,-6.08143e-07,1.65589e-09,0.836791,0.000697306,-6.03176e-07,1.59142e-08,0.837488,0.000696147,-5.55433e-07,-5.70801e-09,0.838184,0.000695019,-5.72557e-07,6.91792e-09,0.838878,0.000693895,-5.51803e-07,-2.19637e-08,0.839571,0.000692725,-6.17694e-07,2.13321e-08,0.840263,0.000691554,-5.53698e-07,-3.75996e-09,0.840954,0.000690435,-5.64978e-07,-6.29219e-09,0.841644,0.000689287,-5.83855e-07,2.89287e-08,0.842333,0.000688206,-4.97068e-07,-4.98181e-08,0.843021,0.000687062,-6.46523e-07,5.11344e-08,0.843707,0.000685922,-4.9312e-07,-3.55102e-08,0.844393,0.00068483,-5.9965e-07,3.13019e-08,0.845077,0.000683724,-5.05745e-07,-3.00925e-08,0.84576,0.000682622,-5.96022e-07,2.94636e-08,0.846442,0.000681519,-5.07631e-07,-2.81572e-08,0.847123,0.000680419,-5.92103e-07,2.35606e-08,0.847803,0.000679306,-5.21421e-07,-6.48045e-09,0.848482,0.000678243,-5.40863e-07,2.36124e-09,0.849159,0.000677169,-5.33779e-07,-2.96461e-09,0.849836,0.000676092,-5.42673e-07,9.49728e-09,0.850512,0.000675035,-5.14181e-07,-3.50245e-08,0.851186,0.000673902,-6.19254e-07,7.09959e-08,0.851859,0.000672876,-4.06267e-07,-7.01453e-08,0.852532,0.000671853,-6.16703e-07,3.07714e-08,0.853203,0.000670712,-5.24388e-07,6.66423e-09,0.853873,0.000669684,-5.04396e-07,2.17629e-09,0.854542,0.000668681,-4.97867e-07,-1.53693e-08,0.855211,0.000667639,-5.43975e-07,-3.03752e-10,0.855878,0.000666551,-5.44886e-07,1.65844e-08,0.856544,0.000665511,-4.95133e-07,-6.42907e-09,0.857209,0.000664501,-5.1442e-07,9.13195e-09,0.857873,0.0006635,-4.87024e-07,-3.00987e-08,0.858536,0.000662435,-5.7732e-07,5.16584e-08,0.859198,0.000661436,-4.22345e-07,-5.73255e-08,0.859859,0.000660419,-5.94322e-07,5.84343e-08,0.860518,0.000659406,-4.19019e-07,-5.72022e-08,0.861177,0.000658396,-5.90626e-07,5.11653e-08,0.861835,0.000657368,-4.3713e-07,-2.82495e-08,0.862492,0.000656409,-5.21878e-07,2.22788e-09,0.863148,0.000655372,-5.15195e-07,1.9338e-08,0.863803,0.0006544,-4.5718e-07,-1.99754e-08,0.864457,0.000653425,-5.17107e-07,9.59024e-10,0.86511,0.000652394,-5.1423e-07,1.61393e-08,0.865762,0.000651414,-4.65812e-07,-5.91149e-09,0.866413,0.000650465,-4.83546e-07,7.50665e-09,0.867063,0.00064952,-4.61026e-07,-2.4115e-08,0.867712,0.000648526,-5.33371e-07,2.93486e-08,0.86836,0.000647547,-4.45325e-07,-3.36748e-08,0.869007,0.000646555,-5.4635e-07,4.57461e-08,0.869653,0.0006456,-4.09112e-07,-3.01002e-08,0.870298,0.000644691,-4.99412e-07,1.50501e-08,0.870942,0.000643738,-4.54262e-07,-3.01002e-08,0.871585,0.000642739,-5.44563e-07,4.57461e-08,0.872228,0.000641787,-4.07324e-07,-3.36748e-08,0.872869,0.000640871,-5.08349e-07,2.93486e-08,0.873509,0.000639943,-4.20303e-07,-2.4115e-08,0.874149,0.00063903,-4.92648e-07,7.50655e-09,0.874787,0.000638067,-4.70128e-07,-5.91126e-09,0.875425,0.000637109,-4.87862e-07,1.61385e-08,0.876062,0.000636182,-4.39447e-07,9.61961e-10,0.876697,0.000635306,-4.36561e-07,-1.99863e-08,0.877332,0.000634373,-4.9652e-07,1.93785e-08,0.877966,0.000633438,-4.38384e-07,2.07697e-09,0.878599,0.000632567,-4.32153e-07,-2.76864e-08,0.879231,0.00063162,-5.15212e-07,4.90641e-08,0.879862,0.000630737,-3.6802e-07,-4.93606e-08,0.880493,0.000629852,-5.16102e-07,2.9169e-08,0.881122,0.000628908,-4.28595e-07,-7.71083e-09,0.881751,0.000628027,-4.51727e-07,1.6744e-09,0.882378,0.000627129,-4.46704e-07,1.01317e-09,0.883005,0.000626239,-4.43665e-07,-5.72703e-09,0.883631,0.000625334,-4.60846e-07,2.1895e-08,0.884255,0.000624478,-3.95161e-07,-2.22481e-08,0.88488,0.000623621,-4.61905e-07,7.4928e-09,0.885503,0.00062272,-4.39427e-07,-7.72306e-09,0.886125,0.000621818,-4.62596e-07,2.33995e-08,0.886746,0.000620963,-3.92398e-07,-2.62704e-08,0.887367,0.000620099,-4.71209e-07,2.20775e-08,0.887987,0.000619223,-4.04976e-07,-2.43496e-09,0.888605,0.000618406,-4.12281e-07,-1.23377e-08,0.889223,0.000617544,-4.49294e-07,-7.81876e-09,0.88984,0.000616622,-4.72751e-07,4.36128e-08,0.890457,0.000615807,-3.41912e-07,-4.7423e-08,0.891072,0.000614981,-4.84181e-07,2.68698e-08,0.891687,0.000614093,-4.03572e-07,-4.51384e-10,0.8923,0.000613285,-4.04926e-07,-2.50643e-08,0.892913,0.0006124,-4.80119e-07,4.11038e-08,0.893525,0.000611563,-3.56808e-07,-2.01414e-08,0.894136,0.000610789,-4.17232e-07,-2.01426e-08,0.894747,0.000609894,-4.7766e-07,4.11073e-08,0.895356,0.000609062,-3.54338e-07,-2.50773e-08,0.895965,0.000608278,-4.2957e-07,-4.02954e-10,0.896573,0.000607418,-4.30779e-07,2.66891e-08,0.89718,0.000606636,-3.50711e-07,-4.67489e-08,0.897786,0.000605795,-4.90958e-07,4.10972e-08,0.898391,0.000604936,-3.67666e-07,1.56948e-09,0.898996,0.000604205,-3.62958e-07,-4.73751e-08,0.8996,0.000603337,-5.05083e-07,6.87214e-08,0.900202,0.000602533,-2.98919e-07,-4.86966e-08,0.900805,0.000601789,-4.45009e-07,6.85589e-09,0.901406,0.00060092,-4.24441e-07,2.1273e-08,0.902007,0.000600135,-3.60622e-07,-3.23434e-08,0.902606,0.000599317,-4.57652e-07,4.84959e-08,0.903205,0.000598547,-3.12164e-07,-4.24309e-08,0.903803,0.000597795,-4.39457e-07,2.01844e-09,0.904401,0.000596922,-4.33402e-07,3.43571e-08,0.904997,0.000596159,-3.30331e-07,-2.02374e-08,0.905593,0.000595437,-3.91043e-07,-1.30123e-08,0.906188,0.000594616,-4.3008e-07,1.26819e-08,0.906782,0.000593794,-3.92034e-07,2.18894e-08,0.907376,0.000593076,-3.26366e-07,-4.06349e-08,0.907968,0.000592301,-4.4827e-07,2.1441e-08,0.90856,0.000591469,-3.83947e-07,1.44754e-08,0.909151,0.000590744,-3.40521e-07,-1.97379e-08,0.909742,0.000590004,-3.99735e-07,4.87161e-09,0.910331,0.000589219,-3.8512e-07,2.51532e-10,0.91092,0.00058845,-3.84366e-07,-5.87776e-09,0.911508,0.000587663,-4.01999e-07,2.32595e-08,0.912096,0.000586929,-3.3222e-07,-2.75554e-08,0.912682,0.000586182,-4.14887e-07,2.73573e-08,0.913268,0.000585434,-3.32815e-07,-2.22692e-08,0.913853,0.000584702,-3.99622e-07,2.11486e-09,0.914437,0.000583909,-3.93278e-07,1.38098e-08,0.915021,0.000583164,-3.51848e-07,2.25042e-09,0.915604,0.000582467,-3.45097e-07,-2.28115e-08,0.916186,0.000581708,-4.13531e-07,2.93911e-08,0.916767,0.000580969,-3.25358e-07,-3.51481e-08,0.917348,0.000580213,-4.30803e-07,5.15967e-08,0.917928,0.000579506,-2.76012e-07,-5.20296e-08,0.918507,0.000578798,-4.32101e-07,3.73124e-08,0.919085,0.000578046,-3.20164e-07,-3.76154e-08,0.919663,0.000577293,-4.3301e-07,5.35447e-08,0.92024,0.000576587,-2.72376e-07,-5.7354e-08,0.920816,0.000575871,-4.44438e-07,5.66621e-08,0.921391,0.000575152,-2.74452e-07,-5.00851e-08,0.921966,0.000574453,-4.24707e-07,2.4469e-08,0.92254,0.000573677,-3.513e-07,1.18138e-08,0.923114,0.000573009,-3.15859e-07,-1.21195e-08,0.923686,0.000572341,-3.52217e-07,-2.29403e-08,0.924258,0.000571568,-4.21038e-07,4.4276e-08,0.924829,0.000570859,-2.8821e-07,-3.49546e-08,0.9254,0.000570178,-3.93074e-07,3.59377e-08,0.92597,0.000569499,-2.85261e-07,-4.91915e-08,0.926539,0.000568781,-4.32835e-07,4.16189e-08,0.927107,0.00056804,-3.07979e-07,1.92523e-09,0.927675,0.00056743,-3.02203e-07,-4.93198e-08,0.928242,0.000566678,-4.50162e-07,7.61447e-08,0.928809,0.000566006,-2.21728e-07,-7.6445e-08,0.929374,0.000565333,-4.51063e-07,5.08216e-08,0.929939,0.000564583,-2.98599e-07,-7.63212e-09,0.930503,0.000563963,-3.21495e-07,-2.02931e-08,0.931067,0.000563259,-3.82374e-07,2.92001e-08,0.93163,0.000562582,-2.94774e-07,-3.69025e-08,0.932192,0.000561882,-4.05482e-07,5.88053e-08,0.932754,0.000561247,-2.29066e-07,-7.91094e-08,0.933315,0.000560552,-4.66394e-07,7.88184e-08,0.933875,0.000559856,-2.29939e-07,-5.73501e-08,0.934434,0.000559224,-4.01989e-07,3.13727e-08,0.934993,0.000558514,-3.07871e-07,-8.53611e-09,0.935551,0.000557873,-3.33479e-07,2.77175e-09,0.936109,0.000557214,-3.25164e-07,-2.55091e-09,0.936666,0.000556556,-3.32817e-07,7.43188e-09,0.937222,0.000555913,-3.10521e-07,-2.71766e-08,0.937778,0.00055521,-3.92051e-07,4.167e-08,0.938333,0.000554551,-2.67041e-07,-2.02941e-08,0.938887,0.000553956,-3.27923e-07,-2.00984e-08,0.93944,0.00055324,-3.88218e-07,4.10828e-08,0.939993,0.000552587,-2.6497e-07,-2.50237e-08,0.940546,0.000551982,-3.40041e-07,-5.92583e-10,0.941097,0.0005513,-3.41819e-07,2.7394e-08,0.941648,0.000550698,-2.59637e-07,-4.93788e-08,0.942199,0.000550031,-4.07773e-07,5.09119e-08,0.942748,0.000549368,-2.55038e-07,-3.50595e-08,0.943297,0.000548753,-3.60216e-07,2.97214e-08,0.943846,0.000548122,-2.71052e-07,-2.42215e-08,0.944394,0.000547507,-3.43716e-07,7.55985e-09,0.944941,0.000546842,-3.21037e-07,-6.01796e-09,0.945487,0.000546182,-3.3909e-07,1.65119e-08,0.946033,0.000545553,-2.89555e-07,-4.2498e-10,0.946578,0.000544973,-2.9083e-07,-1.4812e-08,0.947123,0.000544347,-3.35266e-07,6.83068e-11,0.947667,0.000543676,-3.35061e-07,1.45388e-08,0.94821,0.00054305,-2.91444e-07,1.38123e-09,0.948753,0.000542471,-2.87301e-07,-2.00637e-08,0.949295,0.000541836,-3.47492e-07,1.92688e-08,0.949837,0.000541199,-2.89685e-07,2.59298e-09,0.950378,0.000540628,-2.81906e-07,-2.96407e-08,0.950918,0.000539975,-3.70829e-07,5.63652e-08,0.951458,0.000539402,-2.01733e-07,-7.66107e-08,0.951997,0.000538769,-4.31565e-07,7.12638e-08,0.952535,0.00053812,-2.17774e-07,-2.96305e-08,0.953073,0.000537595,-3.06665e-07,-1.23464e-08,0.95361,0.000536945,-3.43704e-07,1.94114e-08,0.954147,0.000536316,-2.8547e-07,-5.69451e-09,0.954683,0.000535728,-3.02554e-07,3.36666e-09,0.955219,0.000535133,-2.92454e-07,-7.77208e-09,0.955753,0.000534525,-3.1577e-07,2.77216e-08,0.956288,0.000533976,-2.32605e-07,-4.35097e-08,0.956821,0.00053338,-3.63134e-07,2.7108e-08,0.957354,0.000532735,-2.8181e-07,-5.31772e-09,0.957887,0.000532156,-2.97764e-07,-5.83718e-09,0.958419,0.000531543,-3.15275e-07,2.86664e-08,0.95895,0.000530998,-2.29276e-07,-4.9224e-08,0.959481,0.000530392,-3.76948e-07,4.90201e-08,0.960011,0.000529785,-2.29887e-07,-2.76471e-08,0.96054,0.000529243,-3.12829e-07,1.96385e-09,0.961069,0.000528623,-3.06937e-07,1.97917e-08,0.961598,0.000528068,-2.47562e-07,-2.15261e-08,0.962125,0.000527508,-3.1214e-07,6.70795e-09,0.962653,0.000526904,-2.92016e-07,-5.30573e-09,0.963179,0.000526304,-3.07934e-07,1.4515e-08,0.963705,0.000525732,-2.64389e-07,6.85048e-09,0.964231,0.000525224,-2.43837e-07,-4.19169e-08,0.964756,0.00052461,-3.69588e-07,4.1608e-08,0.96528,0.000523996,-2.44764e-07,-5.30598e-09,0.965804,0.000523491,-2.60682e-07,-2.03841e-08,0.966327,0.000522908,-3.21834e-07,2.72378e-08,0.966849,0.000522346,-2.40121e-07,-2.89625e-08,0.967371,0.000521779,-3.27008e-07,2.90075e-08,0.967893,0.000521212,-2.39986e-07,-2.74629e-08,0.968414,0.00052065,-3.22374e-07,2.12396e-08,0.968934,0.000520069,-2.58656e-07,2.10922e-09,0.969454,0.000519558,-2.52328e-07,-2.96765e-08,0.969973,0.000518964,-3.41357e-07,5.6992e-08,0.970492,0.000518452,-1.70382e-07,-7.90821e-08,0.97101,0.000517874,-4.07628e-07,8.05224e-08,0.971528,0.000517301,-1.66061e-07,-6.41937e-08,0.972045,0.000516776,-3.58642e-07,5.70429e-08,0.972561,0.00051623,-1.87513e-07,-4.47686e-08,0.973077,0.00051572,-3.21819e-07,2.82237e-09,0.973593,0.000515085,-3.13352e-07,3.34792e-08,0.974108,0.000514559,-2.12914e-07,-1.75298e-08,0.974622,0.000514081,-2.65503e-07,-2.29648e-08,0.975136,0.000513481,-3.34398e-07,4.97843e-08,0.975649,0.000512961,-1.85045e-07,-5.6963e-08,0.976162,0.00051242,-3.55934e-07,5.88585e-08,0.976674,0.000511885,-1.79359e-07,-5.92616e-08,0.977185,0.000511348,-3.57143e-07,5.89785e-08,0.977696,0.000510811,-1.80208e-07,-5.74433e-08,0.978207,0.000510278,-3.52538e-07,5.15854e-08,0.978717,0.000509728,-1.97781e-07,-2.9689e-08,0.979226,0.000509243,-2.86848e-07,7.56591e-09,0.979735,0.000508692,-2.64151e-07,-5.74649e-10,0.980244,0.000508162,-2.65875e-07,-5.26732e-09,0.980752,0.000507615,-2.81677e-07,2.16439e-08,0.981259,0.000507116,-2.16745e-07,-2.17037e-08,0.981766,0.000506618,-2.81856e-07,5.56636e-09,0.982272,0.000506071,-2.65157e-07,-5.61689e-10,0.982778,0.000505539,-2.66842e-07,-3.31963e-09,0.983283,0.000504995,-2.76801e-07,1.38402e-08,0.983788,0.000504483,-2.3528e-07,7.56339e-09,0.984292,0.000504035,-2.1259e-07,-4.40938e-08,0.984796,0.000503478,-3.44871e-07,4.96026e-08,0.985299,0.000502937,-1.96064e-07,-3.51071e-08,0.985802,0.000502439,-3.01385e-07,3.12212e-08,0.986304,0.00050193,-2.07721e-07,-3.0173e-08,0.986806,0.000501424,-2.9824e-07,2.9866e-08,0.987307,0.000500917,-2.08642e-07,-2.96865e-08,0.987808,0.000500411,-2.97702e-07,2.92753e-08,0.988308,0.000499903,-2.09876e-07,-2.78101e-08,0.988807,0.0004994,-2.93306e-07,2.23604e-08,0.989307,0.000498881,-2.26225e-07,-2.02681e-09,0.989805,0.000498422,-2.32305e-07,-1.42531e-08,0.990303,0.000497915,-2.75065e-07,-5.65232e-10,0.990801,0.000497363,-2.76761e-07,1.65141e-08,0.991298,0.000496859,-2.27218e-07,-5.88639e-09,0.991795,0.000496387,-2.44878e-07,7.0315e-09,0.992291,0.000495918,-2.23783e-07,-2.22396e-08,0.992787,0.000495404,-2.90502e-07,2.23224e-08,0.993282,0.00049489,-2.23535e-07,-7.44543e-09,0.993776,0.000494421,-2.45871e-07,7.45924e-09,0.994271,0.000493951,-2.23493e-07,-2.23915e-08,0.994764,0.000493437,-2.90668e-07,2.25021e-08,0.995257,0.000492923,-2.23161e-07,-8.01218e-09,0.99575,0.000492453,-2.47198e-07,9.54669e-09,0.996242,0.000491987,-2.18558e-07,-3.01746e-08,0.996734,0.000491459,-3.09082e-07,5.1547e-08,0.997225,0.000490996,-1.54441e-07,-5.68039e-08,0.997716,0.000490517,-3.24853e-07,5.64594e-08,0.998206,0.000490036,-1.55474e-07,-4.98245e-08,0.998696,0.000489576,-3.04948e-07,2.36292e-08,0.999186,0.000489037,-2.3406e-07,1.49121e-08,0.999674,0.000488613,-1.89324e-07,-2.3673e-08,1.00016,0.000488164,-2.60343e-07,2.01754e-08,1.00065,0.000487704,-1.99816e-07,-5.70288e-08,1.00114,0.000487133,-3.70903e-07,8.87303e-08,1.00162,0.000486657,-1.04712e-07,-5.94737e-08,1.00211,0.000486269,-2.83133e-07,2.99553e-08,1.0026,0.000485793,-1.93267e-07,-6.03474e-08,1.00308,0.000485225,-3.74309e-07,9.2225e-08,1.00357,0.000484754,-9.76345e-08,-7.0134e-08,1.00405,0.000484348,-3.08036e-07,6.91016e-08,1.00454,0.000483939,-1.00731e-07,-8.70633e-08,1.00502,0.000483476,-3.61921e-07,4.07328e-08,1.0055,0.000482875,-2.39723e-07,4.33413e-08,1.00599,0.000482525,-1.09699e-07,-9.48886e-08,1.00647,0.000482021,-3.94365e-07,9.77947e-08,1.00695,0.000481526,-1.00981e-07,-5.78713e-08,1.00743,0.00048115,-2.74595e-07,1.44814e-08,1.00791,0.000480645,-2.31151e-07,-5.42665e-11,1.00839,0.000480182,-2.31314e-07,-1.42643e-08,1.00887,0.000479677,-2.74106e-07,5.71115e-08,1.00935,0.0004793,-1.02772e-07,-9.49724e-08,1.00983,0.000478809,-3.87689e-07,8.43596e-08,1.01031,0.000478287,-1.3461e-07,-4.04755e-09,1.01079,0.000478006,-1.46753e-07,-6.81694e-08,1.01127,0.000477508,-3.51261e-07,3.83067e-08,1.01174,0.00047692,-2.36341e-07,3.41521e-08,1.01222,0.00047655,-1.33885e-07,-5.57058e-08,1.0127,0.000476115,-3.01002e-07,6.94616e-08,1.01317,0.000475721,-9.26174e-08,-1.02931e-07,1.01365,0.000475227,-4.01412e-07,1.03846e-07,1.01412,0.000474736,-8.98751e-08,-7.40321e-08,1.0146,0.000474334,-3.11971e-07,7.30735e-08,1.01507,0.00047393,-9.27508e-08,-9.90527e-08,1.01554,0.000473447,-3.89909e-07,8.47188e-08,1.01602,0.000472921,-1.35753e-07,-1.40381e-09,1.01649,0.000472645,-1.39964e-07,-7.91035e-08,1.01696,0.000472128,-3.77275e-07,7.93993e-08,1.01744,0.000471612,-1.39077e-07,-7.52607e-11,1.01791,0.000471334,-1.39302e-07,-7.90983e-08,1.01838,0.000470818,-3.76597e-07,7.80499e-08,1.01885,0.000470299,-1.42448e-07,5.31733e-09,1.01932,0.00047003,-1.26496e-07,-9.93193e-08,1.01979,0.000469479,-4.24453e-07,1.53541e-07,1.02026,0.00046909,3.617e-08,-1.57217e-07,1.02073,0.000468691,-4.35482e-07,1.177e-07,1.02119,0.000468173,-8.23808e-08,-7.51659e-08,1.02166,0.000467783,-3.07878e-07,6.37538e-08,1.02213,0.000467358,-1.16617e-07,-6.064e-08,1.0226,0.000466943,-2.98537e-07,5.9597e-08,1.02306,0.000466525,-1.19746e-07,-5.85386e-08,1.02353,0.00046611,-2.95362e-07,5.53482e-08,1.024,0.000465685,-1.29317e-07,-4.36449e-08,1.02446,0.000465296,-2.60252e-07,2.20268e-11,1.02493,0.000464775,-2.60186e-07,4.35568e-08,1.02539,0.000464386,-1.29516e-07,-5.50398e-08,1.02586,0.000463961,-2.94635e-07,5.73932e-08,1.02632,0.000463544,-1.22456e-07,-5.53236e-08,1.02678,0.000463133,-2.88426e-07,4.46921e-08,1.02725,0.000462691,-1.5435e-07,-4.23534e-09,1.02771,0.000462369,-1.67056e-07,-2.77507e-08,1.02817,0.000461952,-2.50308e-07,-3.97101e-09,1.02863,0.000461439,-2.62221e-07,4.36348e-08,1.02909,0.000461046,-1.31317e-07,-5.13589e-08,1.02955,0.000460629,-2.85394e-07,4.25913e-08,1.03001,0.000460186,-1.5762e-07,2.0285e-10,1.03047,0.000459871,-1.57011e-07,-4.34027e-08,1.03093,0.000459427,-2.87219e-07,5.41987e-08,1.03139,0.000459015,-1.24623e-07,-5.4183e-08,1.03185,0.000458604,-2.87172e-07,4.33239e-08,1.03231,0.000458159,-1.572e-07,9.65817e-11,1.03277,0.000457845,-1.56911e-07,-4.37103e-08,1.03323,0.0004574,-2.88041e-07,5.55351e-08,1.03368,0.000456991,-1.21436e-07,-5.9221e-08,1.03414,0.00045657,-2.99099e-07,6.21394e-08,1.0346,0.000456158,-1.1268e-07,-7.01275e-08,1.03505,0.000455723,-3.23063e-07,9.91614e-08,1.03551,0.000455374,-2.55788e-08,-8.80996e-08,1.03596,0.000455058,-2.89878e-07,1.48184e-08,1.03642,0.000454523,-2.45422e-07,2.88258e-08,1.03687,0.000454119,-1.58945e-07,-1.09125e-08,1.03733,0.000453768,-1.91682e-07,1.48241e-08,1.03778,0.000453429,-1.4721e-07,-4.83838e-08,1.03823,0.00045299,-2.92361e-07,5.95019e-08,1.03869,0.000452584,-1.13856e-07,-7.04146e-08,1.03914,0.000452145,-3.25099e-07,1.02947e-07,1.03959,0.000451803,-1.62583e-08,-1.02955e-07,1.04004,0.000451462,-3.25123e-07,7.04544e-08,1.04049,0.000451023,-1.1376e-07,-5.96534e-08,1.04094,0.000450616,-2.9272e-07,4.89499e-08,1.04139,0.000450178,-1.45871e-07,-1.69369e-08,1.04184,0.000449835,-1.96681e-07,1.87977e-08,1.04229,0.000449498,-1.40288e-07,-5.82539e-08,1.04274,0.000449043,-3.1505e-07,9.50087e-08,1.04319,0.000448698,-3.00238e-08,-8.33623e-08,1.04364,0.000448388,-2.80111e-07,2.20363e-11,1.04409,0.000447828,-2.80045e-07,8.32742e-08,1.04454,0.000447517,-3.02221e-08,-9.47002e-08,1.04498,0.000447173,-3.14323e-07,5.7108e-08,1.04543,0.000446716,-1.42999e-07,-1.45225e-08,1.04588,0.000446386,-1.86566e-07,9.82022e-10,1.04632,0.000446016,-1.8362e-07,1.05944e-08,1.04677,0.00044568,-1.51837e-07,-4.33597e-08,1.04721,0.000445247,-2.81916e-07,4.36352e-08,1.04766,0.000444814,-1.51011e-07,-1.19717e-08,1.0481,0.000444476,-1.86926e-07,4.25158e-09,1.04855,0.000444115,-1.74171e-07,-5.03461e-09,1.04899,0.000443751,-1.89275e-07,1.58868e-08,1.04944,0.00044342,-1.41614e-07,-5.85127e-08,1.04988,0.000442961,-3.17152e-07,9.89548e-08,1.05032,0.000442624,-2.0288e-08,-9.88878e-08,1.05076,0.000442287,-3.16951e-07,5.81779e-08,1.05121,0.000441827,-1.42418e-07,-1.46144e-08,1.05165,0.000441499,-1.86261e-07,2.79892e-10,1.05209,0.000441127,-1.85421e-07,1.34949e-08,1.05253,0.000440797,-1.44937e-07,-5.42594e-08,1.05297,0.000440344,-3.07715e-07,8.43335e-08,1.05341,0.000439982,-5.47146e-08,-4.46558e-08,1.05385,0.000439738,-1.88682e-07,-2.49193e-08,1.05429,0.000439286,-2.6344e-07,2.5124e-08,1.05473,0.000438835,-1.88068e-07,4.36328e-08,1.05517,0.000438589,-5.71699e-08,-8.04459e-08,1.05561,0.000438234,-2.98508e-07,3.97324e-08,1.05605,0.000437756,-1.79311e-07,4.07258e-08,1.05648,0.000437519,-5.71332e-08,-8.34263e-08,1.05692,0.000437155,-3.07412e-07,5.45608e-08,1.05736,0.000436704,-1.4373e-07,-1.56078e-08,1.05779,0.000436369,-1.90553e-07,7.87043e-09,1.05823,0.000436012,-1.66942e-07,-1.58739e-08,1.05867,0.00043563,-2.14563e-07,5.56251e-08,1.0591,0.000435368,-4.76881e-08,-8.74172e-08,1.05954,0.000435011,-3.0994e-07,5.56251e-08,1.05997,0.000434558,-1.43064e-07,-1.58739e-08,1.06041,0.000434224,-1.90686e-07,7.87042e-09,1.06084,0.000433866,-1.67075e-07,-1.56078e-08,1.06127,0.000433485,-2.13898e-07,5.45609e-08,1.06171,0.000433221,-5.02157e-08,-8.34263e-08,1.06214,0.00043287,-3.00495e-07,4.07258e-08,1.06257,0.000432391,-1.78317e-07,3.97325e-08,1.063,0.000432154,-5.91198e-08,-8.04464e-08,1.06344,0.000431794,-3.00459e-07,4.36347e-08,1.06387,0.000431324,-1.69555e-07,2.5117e-08,1.0643,0.000431061,-9.42041e-08,-2.48934e-08,1.06473,0.000430798,-1.68884e-07,-4.47527e-08,1.06516,0.000430326,-3.03142e-07,8.46951e-08,1.06559,0.000429973,-4.90573e-08,-5.56089e-08,1.06602,0.000429708,-2.15884e-07,1.85314e-08,1.06645,0.000429332,-1.6029e-07,-1.85166e-08,1.06688,0.000428956,-2.1584e-07,5.5535e-08,1.06731,0.000428691,-4.92347e-08,-8.44142e-08,1.06774,0.000428339,-3.02477e-07,4.37032e-08,1.06816,0.000427865,-1.71368e-07,2.88107e-08,1.06859,0.000427609,-8.49356e-08,-3.97367e-08,1.06902,0.00042732,-2.04146e-07,1.09267e-08,1.06945,0.000426945,-1.71365e-07,-3.97023e-09,1.06987,0.00042659,-1.83276e-07,4.9542e-09,1.0703,0.000426238,-1.68414e-07,-1.58466e-08,1.07073,0.000425854,-2.15953e-07,5.84321e-08,1.07115,0.000425597,-4.0657e-08,-9.86725e-08,1.07158,0.00042522,-3.36674e-07,9.78392e-08,1.072,0.00042484,-4.31568e-08,-5.42658e-08,1.07243,0.000424591,-2.05954e-07,1.45377e-11,1.07285,0.000424179,-2.0591e-07,5.42076e-08,1.07328,0.00042393,-4.32877e-08,-9.76357e-08,1.0737,0.00042355,-3.36195e-07,9.79165e-08,1.07412,0.000423172,-4.24451e-08,-5.56118e-08,1.07455,0.00042292,-2.09281e-07,5.32143e-09,1.07497,0.000422518,-1.93316e-07,3.43261e-08,1.07539,0.000422234,-9.0338e-08,-2.34165e-08,1.07581,0.000421983,-1.60588e-07,-5.98692e-08,1.07623,0.000421482,-3.40195e-07,1.43684e-07,1.07666,0.000421233,9.08574e-08,-1.5724e-07,1.07708,0.000420943,-3.80862e-07,1.27647e-07,1.0775,0.000420564,2.0791e-09,-1.1493e-07,1.07792,0.000420223,-3.4271e-07,9.36534e-08,1.07834,0.000419819,-6.17499e-08,-2.12653e-08,1.07876,0.000419632,-1.25546e-07,-8.59219e-09,1.07918,0.000419355,-1.51322e-07,-6.35752e-08,1.0796,0.000418861,-3.42048e-07,1.43684e-07,1.08002,0.000418608,8.90034e-08,-1.53532e-07,1.08043,0.000418326,-3.71593e-07,1.12817e-07,1.08085,0.000417921,-3.31414e-08,-5.93184e-08,1.08127,0.000417677,-2.11097e-07,5.24697e-09,1.08169,0.00041727,-1.95356e-07,3.83305e-08,1.0821,0.000416995,-8.03642e-08,-3.93597e-08,1.08252,0.000416716,-1.98443e-07,-1.0094e-10,1.08294,0.000416319,-1.98746e-07,3.97635e-08,1.08335,0.00041604,-7.94557e-08,-3.97437e-08,1.08377,0.000415762,-1.98687e-07,1.94215e-12,1.08419,0.000415365,-1.98681e-07,3.97359e-08,1.0846,0.000415087,-7.94732e-08,-3.97362e-08,1.08502,0.000414809,-1.98682e-07,-4.31063e-13,1.08543,0.000414411,-1.98683e-07,3.97379e-08,1.08584,0.000414133,-7.94694e-08,-3.97418e-08,1.08626,0.000413855,-1.98695e-07,2.00563e-11,1.08667,0.000413458,-1.98635e-07,3.96616e-08,1.08709,0.000413179,-7.965e-08,-3.9457e-08,1.0875,0.000412902,-1.98021e-07,-1.04281e-09,1.08791,0.000412502,-2.01149e-07,4.36282e-08,1.08832,0.000412231,-7.02648e-08,-5.42608e-08,1.08874,0.000411928,-2.33047e-07,5.42057e-08,1.08915,0.000411624,-7.04301e-08,-4.33527e-08,1.08956,0.000411353,-2.00488e-07,-4.07378e-12,1.08997,0.000410952,-2.005e-07,4.3369e-08,1.09038,0.000410681,-7.03934e-08,-5.42627e-08,1.09079,0.000410378,-2.33182e-07,5.44726e-08,1.0912,0.000410075,-6.97637e-08,-4.44186e-08,1.09161,0.000409802,-2.03019e-07,3.99235e-09,1.09202,0.000409408,-1.91042e-07,2.84491e-08,1.09243,0.000409111,-1.05695e-07,1.42043e-09,1.09284,0.000408904,-1.01434e-07,-3.41308e-08,1.09325,0.000408599,-2.03826e-07,1.58937e-08,1.09366,0.000408239,-1.56145e-07,-2.94438e-08,1.09406,0.000407838,-2.44476e-07,1.01881e-07,1.09447,0.000407655,6.11676e-08,-1.39663e-07,1.09488,0.000407358,-3.57822e-07,9.91432e-08,1.09529,0.00040694,-6.03921e-08,-1.84912e-08,1.09569,0.000406764,-1.15866e-07,-2.51785e-08,1.0961,0.000406457,-1.91401e-07,-4.03115e-12,1.09651,0.000406074,-1.91413e-07,2.51947e-08,1.09691,0.000405767,-1.15829e-07,1.84346e-08,1.09732,0.00040559,-6.05254e-08,-9.89332e-08,1.09772,0.000405172,-3.57325e-07,1.3888e-07,1.09813,0.000404874,5.93136e-08,-9.8957e-08,1.09853,0.000404696,-2.37557e-07,1.853e-08,1.09894,0.000404277,-1.81968e-07,2.48372e-08,1.09934,0.000403987,-1.07456e-07,1.33047e-09,1.09975,0.000403776,-1.03465e-07,-3.01591e-08,1.10015,0.000403479,-1.93942e-07,9.66054e-11,1.10055,0.000403091,-1.93652e-07,2.97727e-08,1.10096,0.000402793,-1.04334e-07,2.19273e-11,1.10136,0.000402585,-1.04268e-07,-2.98604e-08,1.10176,0.000402287,-1.93849e-07,2.10325e-10,1.10216,0.0004019,-1.93218e-07,2.90191e-08,1.10256,0.0004016,-1.06161e-07,2.92264e-09,1.10297,0.000401397,-9.73931e-08,-4.07096e-08,1.10337,0.00040108,-2.19522e-07,4.07067e-08,1.10377,0.000400763,-9.7402e-08,-2.90783e-09,1.10417,0.000400559,-1.06126e-07,-2.90754e-08,1.10457,0.00040026,-1.93352e-07,9.00021e-14,1.10497,0.000399873,-1.93351e-07,2.9075e-08,1.10537,0.000399574,-1.06126e-07,2.90902e-09,1.10577,0.00039937,-9.73992e-08,-4.07111e-08,1.10617,0.000399053,-2.19533e-07,4.07262e-08,1.10657,0.000398736,-9.73541e-08,-2.98424e-09,1.10697,0.000398533,-1.06307e-07,-2.87892e-08,1.10736,0.000398234,-1.92674e-07,-1.06824e-09,1.10776,0.000397845,-1.95879e-07,3.30622e-08,1.10816,0.000397552,-9.66926e-08,-1.19712e-08,1.10856,0.000397323,-1.32606e-07,1.48225e-08,1.10895,0.000397102,-8.81387e-08,-4.73187e-08,1.10935,0.000396784,-2.30095e-07,5.52429e-08,1.10975,0.00039649,-6.4366e-08,-5.44437e-08,1.11014,0.000396198,-2.27697e-07,4.33226e-08,1.11054,0.000395872,-9.77293e-08,3.62656e-10,1.11094,0.000395678,-9.66414e-08,-4.47732e-08,1.11133,0.00039535,-2.30961e-07,5.95208e-08,1.11173,0.000395067,-5.23985e-08,-7.41008e-08,1.11212,0.00039474,-2.74701e-07,1.17673e-07,1.11252,0.000394543,7.83181e-08,-1.58172e-07,1.11291,0.000394225,-3.96199e-07,1.57389e-07,1.1133,0.000393905,7.59679e-08,-1.13756e-07,1.1137,0.000393716,-2.653e-07,5.92165e-08,1.11409,0.000393363,-8.76507e-08,-3.90074e-09,1.11449,0.000393176,-9.93529e-08,-4.36136e-08,1.11488,0.000392846,-2.30194e-07,5.91457e-08,1.11527,0.000392563,-5.27564e-08,-7.376e-08,1.11566,0.000392237,-2.74037e-07,1.16685e-07,1.11606,0.000392039,7.60189e-08,-1.54562e-07,1.11645,0.000391727,-3.87667e-07,1.43935e-07,1.11684,0.000391384,4.4137e-08,-6.35487e-08,1.11723,0.000391281,-1.46509e-07,-8.94896e-09,1.11762,0.000390961,-1.73356e-07,-1.98647e-08,1.11801,0.000390555,-2.3295e-07,8.8408e-08,1.1184,0.000390354,3.22736e-08,-9.53486e-08,1.11879,0.000390133,-2.53772e-07,5.45677e-08,1.11918,0.000389789,-9.0069e-08,-3.71296e-09,1.11957,0.000389598,-1.01208e-07,-3.97159e-08,1.11996,0.000389276,-2.20355e-07,4.33671e-08,1.12035,0.000388966,-9.02542e-08,-1.45431e-08,1.12074,0.000388741,-1.33883e-07,1.48052e-08,1.12113,0.000388518,-8.94678e-08,-4.46778e-08,1.12152,0.000388205,-2.23501e-07,4.46966e-08,1.12191,0.000387892,-8.94114e-08,-1.48992e-08,1.12229,0.000387669,-1.34109e-07,1.49003e-08,1.12268,0.000387445,-8.94082e-08,-4.47019e-08,1.12307,0.000387132,-2.23514e-07,4.4698e-08,1.12345,0.000386819,-8.942e-08,-1.48806e-08,1.12384,0.000386596,-1.34062e-07,1.48245e-08,1.12423,0.000386372,-8.95885e-08,-4.44172e-08,1.12461,0.00038606,-2.2284e-07,4.36351e-08,1.125,0.000385745,-9.19348e-08,-1.09139e-08,1.12539,0.000385528,-1.24677e-07,2.05584e-11,1.12577,0.000385279,-1.24615e-07,1.08317e-08,1.12616,0.000385062,-9.21198e-08,-4.33473e-08,1.12654,0.000384748,-2.22162e-07,4.33481e-08,1.12693,0.000384434,-9.21174e-08,-1.08356e-08,1.12731,0.000384217,-1.24624e-07,-5.50907e-12,1.12769,0.000383968,-1.24641e-07,1.08577e-08,1.12808,0.000383751,-9.20679e-08,-4.34252e-08,1.12846,0.000383437,-2.22343e-07,4.36337e-08,1.12884,0.000383123,-9.14422e-08,-1.19005e-08,1.12923,0.000382904,-1.27144e-07,3.96813e-09,1.12961,0.000382662,-1.15239e-07,-3.97207e-09,1.12999,0.000382419,-1.27155e-07,1.19201e-08,1.13038,0.000382201,-9.1395e-08,-4.37085e-08,1.13076,0.000381887,-2.2252e-07,4.37046e-08,1.13114,0.000381573,-9.14068e-08,-1.19005e-08,1.13152,0.000381355,-1.27108e-07,3.89734e-09,1.1319,0.000381112,-1.15416e-07,-3.68887e-09,1.13228,0.00038087,-1.26483e-07,1.08582e-08,1.13266,0.00038065,-9.39083e-08,-3.97438e-08,1.13304,0.000380343,-2.1314e-07,2.89076e-08,1.13342,0.000380003,-1.26417e-07,4.33225e-08,1.1338,0.00037988,3.55072e-09,-8.29883e-08,1.13418,0.000379638,-2.45414e-07,5.0212e-08,1.13456,0.000379298,-9.47781e-08,1.34964e-09,1.13494,0.000379113,-9.07292e-08,-5.56105e-08,1.13532,0.000378764,-2.57561e-07,1.01883e-07,1.1357,0.000378555,4.80889e-08,-1.13504e-07,1.13608,0.000378311,-2.92423e-07,1.13713e-07,1.13646,0.000378067,4.87176e-08,-1.02931e-07,1.13683,0.000377856,-2.60076e-07,5.95923e-08,1.13721,0.000377514,-8.12988e-08,-1.62288e-08,1.13759,0.000377303,-1.29985e-07,5.32278e-09,1.13797,0.000377059,-1.14017e-07,-5.06237e-09,1.13834,0.000376816,-1.29204e-07,1.49267e-08,1.13872,0.000376602,-8.44237e-08,-5.46444e-08,1.1391,0.000376269,-2.48357e-07,8.44417e-08,1.13947,0.000376026,4.96815e-09,-4.47039e-08,1.13985,0.000375902,-1.29143e-07,-2.48355e-08,1.14023,0.000375569,-2.0365e-07,2.48368e-08,1.1406,0.000375236,-1.2914e-07,4.46977e-08,1.14098,0.000375112,4.95341e-09,-8.44184e-08,1.14135,0.000374869,-2.48302e-07,5.45572e-08,1.14173,0.000374536,-8.463e-08,-1.46013e-08,1.1421,0.000374323,-1.28434e-07,3.8478e-09,1.14247,0.000374077,-1.1689e-07,-7.89941e-10,1.14285,0.000373841,-1.1926e-07,-6.88042e-10,1.14322,0.0003736,-1.21324e-07,3.54213e-09,1.1436,0.000373368,-1.10698e-07,-1.34805e-08,1.14397,0.000373107,-1.51139e-07,5.03798e-08,1.14434,0.000372767,0.,0.};\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void RGB2LuvConvert_32F(const T& src, D& dst)\n        {\n            const float _d = 1.f / (0.950456f + 15 + 1.088754f * 3);\n            const float _un = 13 * (4 * 0.950456f * _d);\n            const float _vn = 13 * (9 * _d);\n\n            float B = blueIdx == 0 ? src.x : src.z;\n            float G = src.y;\n            float R = blueIdx == 0 ? src.z : src.x;\n\n            if (srgb)\n            {\n                B = splineInterpolate(B * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n                G = splineInterpolate(G * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n                R = splineInterpolate(R * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n            }\n\n            float X = R * 0.412453f + G * 0.357580f + B * 0.180423f;\n            float Y = R * 0.212671f + G * 0.715160f + B * 0.072169f;\n            float Z = R * 0.019334f + G * 0.119193f + B * 0.950227f;\n\n            float L = splineInterpolate(Y * (LAB_CBRT_TAB_SIZE / 1.5f), c_LabCbrtTab, LAB_CBRT_TAB_SIZE);\n            L = 116.f * L - 16.f;\n\n            const float d = (4 * 13) / ::fmaxf(X + 15 * Y + 3 * Z, numeric_limits<float>::epsilon());\n            float u = L * (X * d - _un);\n            float v = L * ((9 * 0.25f) * Y * d - _vn);\n\n            dst.x = L;\n            dst.y = u;\n            dst.z = v;\n        }\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void RGB2LuvConvert_8U(const T& src, D& dst)\n        {\n            float3 srcf, dstf;\n\n            srcf.x = src.x * (1.f / 255.f);\n            srcf.y = src.y * (1.f / 255.f);\n            srcf.z = src.z * (1.f / 255.f);\n\n            RGB2LuvConvert_32F<srgb, blueIdx>(srcf, dstf);\n\n            dst.x = saturate_cast<uchar>(dstf.x * 2.55f);\n            dst.y = saturate_cast<uchar>(dstf.y * 0.72033898305084743f + 96.525423728813564f);\n            dst.z = saturate_cast<uchar>(dstf.z * 0.9732824427480916f + 136.259541984732824f);\n        }\n\n        template <typename T, int scn, int dcn, bool srgb, int blueIdx> struct RGB2Luv;\n\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct RGB2Luv<uchar, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<uchar, scn>::vec_type, typename TypeVec<uchar, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<uchar, dcn>::vec_type operator ()(const typename TypeVec<uchar, scn>::vec_type& src) const\n            {\n                typename TypeVec<uchar, dcn>::vec_type dst;\n\n                RGB2LuvConvert_8U<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2Luv() {}\n            __host__ __device__ __forceinline__ RGB2Luv(const RGB2Luv&) {}\n        };\n\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct RGB2Luv<float, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                RGB2LuvConvert_32F<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2Luv() {}\n            __host__ __device__ __forceinline__ RGB2Luv(const RGB2Luv&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_RGB2Luv_TRAITS(name, scn, dcn, srgb, blueIdx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::RGB2Luv<T, scn, dcn, srgb, blueIdx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void Luv2RGBConvert_32F(const T& src, D& dst)\n        {\n            const float _d = 1.f / (0.950456f + 15 + 1.088754f * 3);\n            const float _un = 4 * 0.950456f * _d;\n            const float _vn = 9 * _d;\n\n            float L = src.x;\n            float u = src.y;\n            float v = src.z;\n\n            float Y = (L + 16.f) * (1.f / 116.f);\n            Y = Y * Y * Y;\n\n            float d = (1.f / 13.f) / L;\n            u = u * d + _un;\n            v = v * d + _vn;\n\n            float iv = 1.f / v;\n            float X = 2.25f * u * Y * iv;\n            float Z = (12 - 3 * u - 20 * v) * Y * 0.25f * iv;\n\n            float B = 0.055648f * X - 0.204043f * Y + 1.057311f * Z;\n            float G = -0.969256f * X + 1.875991f * Y + 0.041556f * Z;\n            float R = 3.240479f * X - 1.537150f * Y - 0.498535f * Z;\n\n            if (srgb)\n            {\n                B = splineInterpolate(B * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n                G = splineInterpolate(G * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n                R = splineInterpolate(R * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n            }\n\n            dst.x = blueIdx == 0 ? B : R;\n            dst.y = G;\n            dst.z = blueIdx == 0 ? R : B;\n            setAlpha(dst, ColorChannel<float>::max());\n        }\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void Luv2RGBConvert_8U(const T& src, D& dst)\n        {\n            float3 srcf, dstf;\n\n            srcf.x = src.x * (100.f / 255.f);\n            srcf.y = src.y * 1.388235294117647f - 134.f;\n            srcf.z = src.z * 1.027450980392157f - 140.f;\n\n            Luv2RGBConvert_32F<srgb, blueIdx>(srcf, dstf);\n\n            dst.x = saturate_cast<uchar>(dstf.x * 255.f);\n            dst.y = saturate_cast<uchar>(dstf.y * 255.f);\n            dst.z = saturate_cast<uchar>(dstf.z * 255.f);\n            setAlpha(dst, ColorChannel<uchar>::max());\n        }\n\n        template <typename T, int scn, int dcn, bool srgb, int blueIdx> struct Luv2RGB;\n\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct Luv2RGB<uchar, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<uchar, scn>::vec_type, typename TypeVec<uchar, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<uchar, dcn>::vec_type operator ()(const typename TypeVec<uchar, scn>::vec_type& src) const\n            {\n                typename TypeVec<uchar, dcn>::vec_type dst;\n\n                Luv2RGBConvert_8U<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ Luv2RGB() {}\n            __host__ __device__ __forceinline__ Luv2RGB(const Luv2RGB&) {}\n        };\n\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct Luv2RGB<float, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                Luv2RGBConvert_32F<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ Luv2RGB() {}\n            __host__ __device__ __forceinline__ Luv2RGB(const Luv2RGB&) {}\n        };\n    }\n\n#define OPENCV_GPU_IMPLEMENT_Luv2RGB_TRAITS(name, scn, dcn, srgb, blueIdx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::gpu::device::color_detail::Luv2RGB<T, scn, dcn, srgb, blueIdx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    #undef CV_DESCALE\n\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_COLOR_DETAIL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/detail/reduce.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_REDUCE_DETAIL_HPP__\n#define __OPENCV_GPU_REDUCE_DETAIL_HPP__\n\n#include <thrust/tuple.h>\n#include \"../warp.hpp\"\n#include \"../warp_shuffle.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    namespace reduce_detail\n    {\n        template <typename T> struct GetType;\n        template <typename T> struct GetType<T*>\n        {\n            typedef T type;\n        };\n        template <typename T> struct GetType<volatile T*>\n        {\n            typedef T type;\n        };\n        template <typename T> struct GetType<T&>\n        {\n            typedef T type;\n        };\n\n        template <unsigned int I, unsigned int N>\n        struct For\n        {\n            template <class PointerTuple, class ValTuple>\n            static __device__ void loadToSmem(const PointerTuple& smem, const ValTuple& val, unsigned int tid)\n            {\n                thrust::get<I>(smem)[tid] = thrust::get<I>(val);\n\n                For<I + 1, N>::loadToSmem(smem, val, tid);\n            }\n            template <class PointerTuple, class ValTuple>\n            static __device__ void loadFromSmem(const PointerTuple& smem, const ValTuple& val, unsigned int tid)\n            {\n                thrust::get<I>(val) = thrust::get<I>(smem)[tid];\n\n                For<I + 1, N>::loadFromSmem(smem, val, tid);\n            }\n\n            template <class PointerTuple, class ValTuple, class OpTuple>\n            static __device__ void merge(const PointerTuple& smem, const ValTuple& val, unsigned int tid, unsigned int delta, const OpTuple& op)\n            {\n                typename GetType<typename thrust::tuple_element<I, PointerTuple>::type>::type reg = thrust::get<I>(smem)[tid + delta];\n                thrust::get<I>(smem)[tid] = thrust::get<I>(val) = thrust::get<I>(op)(thrust::get<I>(val), reg);\n\n                For<I + 1, N>::merge(smem, val, tid, delta, op);\n            }\n            template <class ValTuple, class OpTuple>\n            static __device__ void mergeShfl(const ValTuple& val, unsigned int delta, unsigned int width, const OpTuple& op)\n            {\n                typename GetType<typename thrust::tuple_element<I, ValTuple>::type>::type reg = shfl_down(thrust::get<I>(val), delta, width);\n                thrust::get<I>(val) = thrust::get<I>(op)(thrust::get<I>(val), reg);\n\n                For<I + 1, N>::mergeShfl(val, delta, width, op);\n            }\n        };\n        template <unsigned int N>\n        struct For<N, N>\n        {\n            template <class PointerTuple, class ValTuple>\n            static __device__ void loadToSmem(const PointerTuple&, const ValTuple&, unsigned int)\n            {\n            }\n            template <class PointerTuple, class ValTuple>\n            static __device__ void loadFromSmem(const PointerTuple&, const ValTuple&, unsigned int)\n            {\n            }\n\n            template <class PointerTuple, class ValTuple, class OpTuple>\n            static __device__ void merge(const PointerTuple&, const ValTuple&, unsigned int, unsigned int, const OpTuple&)\n            {\n            }\n            template <class ValTuple, class OpTuple>\n            static __device__ void mergeShfl(const ValTuple&, unsigned int, unsigned int, const OpTuple&)\n            {\n            }\n        };\n\n        template <typename T>\n        __device__ __forceinline__ void loadToSmem(volatile T* smem, T& val, unsigned int tid)\n        {\n            smem[tid] = val;\n        }\n        template <typename T>\n        __device__ __forceinline__ void loadFromSmem(volatile T* smem, T& val, unsigned int tid)\n        {\n            val = smem[tid];\n        }\n        template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9,\n                  typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9>\n        __device__ __forceinline__ void loadToSmem(const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>& smem,\n                                                       const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                                       unsigned int tid)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9> >::value>::loadToSmem(smem, val, tid);\n        }\n        template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9,\n                  typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9>\n        __device__ __forceinline__ void loadFromSmem(const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>& smem,\n                                                         const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                                         unsigned int tid)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9> >::value>::loadFromSmem(smem, val, tid);\n        }\n\n        template <typename T, class Op>\n        __device__ __forceinline__ void merge(volatile T* smem, T& val, unsigned int tid, unsigned int delta, const Op& op)\n        {\n            T reg = smem[tid + delta];\n            smem[tid] = val = op(val, reg);\n        }\n        template <typename T, class Op>\n        __device__ __forceinline__ void mergeShfl(T& val, unsigned int delta, unsigned int width, const Op& op)\n        {\n            T reg = shfl_down(val, delta, width);\n            val = op(val, reg);\n        }\n        template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9,\n                  typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9,\n                  class Op0, class Op1, class Op2, class Op3, class Op4, class Op5, class Op6, class Op7, class Op8, class Op9>\n        __device__ __forceinline__ void merge(const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>& smem,\n                                              const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                              unsigned int tid,\n                                              unsigned int delta,\n                                              const thrust::tuple<Op0, Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, Op9>& op)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9> >::value>::merge(smem, val, tid, delta, op);\n        }\n        template <typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9,\n                  class Op0, class Op1, class Op2, class Op3, class Op4, class Op5, class Op6, class Op7, class Op8, class Op9>\n        __device__ __forceinline__ void mergeShfl(const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                                  unsigned int delta,\n                                                  unsigned int width,\n                                                  const thrust::tuple<Op0, Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, Op9>& op)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9> >::value>::mergeShfl(val, delta, width, op);\n        }\n\n        template <unsigned int N> struct Generic\n        {\n            template <typename Pointer, typename Reference, class Op>\n            static __device__ void reduce(Pointer smem, Reference val, unsigned int tid, Op op)\n            {\n                loadToSmem(smem, val, tid);\n                if (N >= 32)\n                    __syncthreads();\n\n                if (N >= 2048)\n                {\n                    if (tid < 1024)\n                        merge(smem, val, tid, 1024, op);\n\n                    __syncthreads();\n                }\n                if (N >= 1024)\n                {\n                    if (tid < 512)\n                        merge(smem, val, tid, 512, op);\n\n                    __syncthreads();\n                }\n                if (N >= 512)\n                {\n                    if (tid < 256)\n                        merge(smem, val, tid, 256, op);\n\n                    __syncthreads();\n                }\n                if (N >= 256)\n                {\n                    if (tid < 128)\n                        merge(smem, val, tid, 128, op);\n\n                    __syncthreads();\n                }\n                if (N >= 128)\n                {\n                    if (tid < 64)\n                        merge(smem, val, tid, 64, op);\n\n                    __syncthreads();\n                }\n                if (N >= 64)\n                {\n                    if (tid < 32)\n                        merge(smem, val, tid, 32, op);\n                }\n\n                if (tid < 16)\n                {\n                    merge(smem, val, tid, 16, op);\n                    merge(smem, val, tid, 8, op);\n                    merge(smem, val, tid, 4, op);\n                    merge(smem, val, tid, 2, op);\n                    merge(smem, val, tid, 1, op);\n                }\n            }\n        };\n\n        template <unsigned int I, typename Pointer, typename Reference, class Op>\n        struct Unroll\n        {\n            static __device__ void loopShfl(Reference val, Op op, unsigned int N)\n            {\n                mergeShfl(val, I, N, op);\n                Unroll<I / 2, Pointer, Reference, Op>::loopShfl(val, op, N);\n            }\n            static __device__ void loop(Pointer smem, Reference val, unsigned int tid, Op op)\n            {\n                merge(smem, val, tid, I, op);\n                Unroll<I / 2, Pointer, Reference, Op>::loop(smem, val, tid, op);\n            }\n        };\n        template <typename Pointer, typename Reference, class Op>\n        struct Unroll<0, Pointer, Reference, Op>\n        {\n            static __device__ void loopShfl(Reference, Op, unsigned int)\n            {\n            }\n            static __device__ void loop(Pointer, Reference, unsigned int, Op)\n            {\n            }\n        };\n\n        template <unsigned int N> struct WarpOptimized\n        {\n            template <typename Pointer, typename Reference, class Op>\n            static __device__ void reduce(Pointer smem, Reference val, unsigned int tid, Op op)\n            {\n            #if __CUDA_ARCH__ >= 300\n                (void) smem;\n                (void) tid;\n\n                Unroll<N / 2, Pointer, Reference, Op>::loopShfl(val, op, N);\n            #else\n                loadToSmem(smem, val, tid);\n\n                if (tid < N / 2)\n                    Unroll<N / 2, Pointer, Reference, Op>::loop(smem, val, tid, op);\n            #endif\n            }\n        };\n\n        template <unsigned int N> struct GenericOptimized32\n        {\n            enum { M = N / 32 };\n\n            template <typename Pointer, typename Reference, class Op>\n            static __device__ void reduce(Pointer smem, Reference val, unsigned int tid, Op op)\n            {\n                const unsigned int laneId = Warp::laneId();\n\n            #if __CUDA_ARCH__ >= 300\n                Unroll<16, Pointer, Reference, Op>::loopShfl(val, op, warpSize);\n\n                if (laneId == 0)\n                    loadToSmem(smem, val, tid / 32);\n            #else\n                loadToSmem(smem, val, tid);\n\n                if (laneId < 16)\n                    Unroll<16, Pointer, Reference, Op>::loop(smem, val, tid, op);\n\n                __syncthreads();\n\n                if (laneId == 0)\n                    loadToSmem(smem, val, tid / 32);\n            #endif\n\n                __syncthreads();\n\n                loadFromSmem(smem, val, tid);\n\n                if (tid < 32)\n                {\n                #if __CUDA_ARCH__ >= 300\n                    Unroll<M / 2, Pointer, Reference, Op>::loopShfl(val, op, M);\n                #else\n                    Unroll<M / 2, Pointer, Reference, Op>::loop(smem, val, tid, op);\n                #endif\n                }\n            }\n        };\n\n        template <bool val, class T1, class T2> struct StaticIf;\n        template <class T1, class T2> struct StaticIf<true, T1, T2>\n        {\n            typedef T1 type;\n        };\n        template <class T1, class T2> struct StaticIf<false, T1, T2>\n        {\n            typedef T2 type;\n        };\n\n        template <unsigned int N> struct IsPowerOf2\n        {\n            enum { value = ((N != 0) && !(N & (N - 1))) };\n        };\n\n        template <unsigned int N> struct Dispatcher\n        {\n            typedef typename StaticIf<\n                (N <= 32) && IsPowerOf2<N>::value,\n                WarpOptimized<N>,\n                typename StaticIf<\n                    (N <= 1024) && IsPowerOf2<N>::value,\n                    GenericOptimized32<N>,\n                    Generic<N>\n                >::type\n            >::type reductor;\n        };\n    }\n}}}\n\n#endif // __OPENCV_GPU_REDUCE_DETAIL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/detail/reduce_key_val.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_PRED_VAL_REDUCE_DETAIL_HPP__\n#define __OPENCV_GPU_PRED_VAL_REDUCE_DETAIL_HPP__\n\n#include <thrust/tuple.h>\n#include \"../warp.hpp\"\n#include \"../warp_shuffle.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    namespace reduce_key_val_detail\n    {\n        template <typename T> struct GetType;\n        template <typename T> struct GetType<T*>\n        {\n            typedef T type;\n        };\n        template <typename T> struct GetType<volatile T*>\n        {\n            typedef T type;\n        };\n        template <typename T> struct GetType<T&>\n        {\n            typedef T type;\n        };\n\n        template <unsigned int I, unsigned int N>\n        struct For\n        {\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void loadToSmem(const PointerTuple& smem, const ReferenceTuple& data, unsigned int tid)\n            {\n                thrust::get<I>(smem)[tid] = thrust::get<I>(data);\n\n                For<I + 1, N>::loadToSmem(smem, data, tid);\n            }\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void loadFromSmem(const PointerTuple& smem, const ReferenceTuple& data, unsigned int tid)\n            {\n                thrust::get<I>(data) = thrust::get<I>(smem)[tid];\n\n                For<I + 1, N>::loadFromSmem(smem, data, tid);\n            }\n\n            template <class ReferenceTuple>\n            static __device__ void copyShfl(const ReferenceTuple& val, unsigned int delta, int width)\n            {\n                thrust::get<I>(val) = shfl_down(thrust::get<I>(val), delta, width);\n\n                For<I + 1, N>::copyShfl(val, delta, width);\n            }\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void copy(const PointerTuple& svals, const ReferenceTuple& val, unsigned int tid, unsigned int delta)\n            {\n                thrust::get<I>(svals)[tid] = thrust::get<I>(val) = thrust::get<I>(svals)[tid + delta];\n\n                For<I + 1, N>::copy(svals, val, tid, delta);\n            }\n\n            template <class KeyReferenceTuple, class ValReferenceTuple, class CmpTuple>\n            static __device__ void mergeShfl(const KeyReferenceTuple& key, const ValReferenceTuple& val, const CmpTuple& cmp, unsigned int delta, int width)\n            {\n                typename GetType<typename thrust::tuple_element<I, KeyReferenceTuple>::type>::type reg = shfl_down(thrust::get<I>(key), delta, width);\n\n                if (thrust::get<I>(cmp)(reg, thrust::get<I>(key)))\n                {\n                    thrust::get<I>(key) = reg;\n                    thrust::get<I>(val) = shfl_down(thrust::get<I>(val), delta, width);\n                }\n\n                For<I + 1, N>::mergeShfl(key, val, cmp, delta, width);\n            }\n            template <class KeyPointerTuple, class KeyReferenceTuple, class ValPointerTuple, class ValReferenceTuple, class CmpTuple>\n            static __device__ void merge(const KeyPointerTuple& skeys, const KeyReferenceTuple& key,\n                                         const ValPointerTuple& svals, const ValReferenceTuple& val,\n                                         const CmpTuple& cmp,\n                                         unsigned int tid, unsigned int delta)\n            {\n                typename GetType<typename thrust::tuple_element<I, KeyPointerTuple>::type>::type reg = thrust::get<I>(skeys)[tid + delta];\n\n                if (thrust::get<I>(cmp)(reg, thrust::get<I>(key)))\n                {\n                    thrust::get<I>(skeys)[tid] = thrust::get<I>(key) = reg;\n                    thrust::get<I>(svals)[tid] = thrust::get<I>(val) = thrust::get<I>(svals)[tid + delta];\n                }\n\n                For<I + 1, N>::merge(skeys, key, svals, val, cmp, tid, delta);\n            }\n        };\n        template <unsigned int N>\n        struct For<N, N>\n        {\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void loadToSmem(const PointerTuple&, const ReferenceTuple&, unsigned int)\n            {\n            }\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void loadFromSmem(const PointerTuple&, const ReferenceTuple&, unsigned int)\n            {\n            }\n\n            template <class ReferenceTuple>\n            static __device__ void copyShfl(const ReferenceTuple&, unsigned int, int)\n            {\n            }\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void copy(const PointerTuple&, const ReferenceTuple&, unsigned int, unsigned int)\n            {\n            }\n\n            template <class KeyReferenceTuple, class ValReferenceTuple, class CmpTuple>\n            static __device__ void mergeShfl(const KeyReferenceTuple&, const ValReferenceTuple&, const CmpTuple&, unsigned int, int)\n            {\n            }\n            template <class KeyPointerTuple, class KeyReferenceTuple, class ValPointerTuple, class ValReferenceTuple, class CmpTuple>\n            static __device__ void merge(const KeyPointerTuple&, const KeyReferenceTuple&,\n                                         const ValPointerTuple&, const ValReferenceTuple&,\n                                         const CmpTuple&,\n                                         unsigned int, unsigned int)\n            {\n            }\n        };\n\n        //////////////////////////////////////////////////////\n        // loadToSmem\n\n        template <typename T>\n        __device__ __forceinline__ void loadToSmem(volatile T* smem, T& data, unsigned int tid)\n        {\n            smem[tid] = data;\n        }\n        template <typename T>\n        __device__ __forceinline__ void loadFromSmem(volatile T* smem, T& data, unsigned int tid)\n        {\n            data = smem[tid];\n        }\n        template <typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9>\n        __device__ __forceinline__ void loadToSmem(const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& smem,\n                                                   const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& data,\n                                                   unsigned int tid)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9> >::value>::loadToSmem(smem, data, tid);\n        }\n        template <typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9>\n        __device__ __forceinline__ void loadFromSmem(const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& smem,\n                                                     const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& data,\n                                                     unsigned int tid)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9> >::value>::loadFromSmem(smem, data, tid);\n        }\n\n        //////////////////////////////////////////////////////\n        // copyVals\n\n        template <typename V>\n        __device__ __forceinline__ void copyValsShfl(V& val, unsigned int delta, int width)\n        {\n            val = shfl_down(val, delta, width);\n        }\n        template <typename V>\n        __device__ __forceinline__ void copyVals(volatile V* svals, V& val, unsigned int tid, unsigned int delta)\n        {\n            svals[tid] = val = svals[tid + delta];\n        }\n        template <typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9>\n        __device__ __forceinline__ void copyValsShfl(const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                     unsigned int delta,\n                                                     int width)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9> >::value>::copyShfl(val, delta, width);\n        }\n        template <typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9>\n        __device__ __forceinline__ void copyVals(const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                                 const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                 unsigned int tid, unsigned int delta)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9> >::value>::copy(svals, val, tid, delta);\n        }\n\n        //////////////////////////////////////////////////////\n        // merge\n\n        template <typename K, typename V, class Cmp>\n        __device__ __forceinline__ void mergeShfl(K& key, V& val, const Cmp& cmp, unsigned int delta, int width)\n        {\n            K reg = shfl_down(key, delta, width);\n\n            if (cmp(reg, key))\n            {\n                key = reg;\n                copyValsShfl(val, delta, width);\n            }\n        }\n        template <typename K, typename V, class Cmp>\n        __device__ __forceinline__ void merge(volatile K* skeys, K& key, volatile V* svals, V& val, const Cmp& cmp, unsigned int tid, unsigned int delta)\n        {\n            K reg = skeys[tid + delta];\n\n            if (cmp(reg, key))\n            {\n                skeys[tid] = key = reg;\n                copyVals(svals, val, tid, delta);\n            }\n        }\n        template <typename K,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n                  class Cmp>\n        __device__ __forceinline__ void mergeShfl(K& key,\n                                                  const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                  const Cmp& cmp,\n                                                  unsigned int delta, int width)\n        {\n            K reg = shfl_down(key, delta, width);\n\n            if (cmp(reg, key))\n            {\n                key = reg;\n                copyValsShfl(val, delta, width);\n            }\n        }\n        template <typename K,\n                  typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n                  class Cmp>\n        __device__ __forceinline__ void merge(volatile K* skeys, K& key,\n                                              const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                              const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                              const Cmp& cmp, unsigned int tid, unsigned int delta)\n        {\n            K reg = skeys[tid + delta];\n\n            if (cmp(reg, key))\n            {\n                skeys[tid] = key = reg;\n                copyVals(svals, val, tid, delta);\n            }\n        }\n        template <typename KR0, typename KR1, typename KR2, typename KR3, typename KR4, typename KR5, typename KR6, typename KR7, typename KR8, typename KR9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n                  class Cmp0, class Cmp1, class Cmp2, class Cmp3, class Cmp4, class Cmp5, class Cmp6, class Cmp7, class Cmp8, class Cmp9>\n        __device__ __forceinline__ void mergeShfl(const thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9>& key,\n                                                  const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                  const thrust::tuple<Cmp0, Cmp1, Cmp2, Cmp3, Cmp4, Cmp5, Cmp6, Cmp7, Cmp8, Cmp9>& cmp,\n                                                  unsigned int delta, int width)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9> >::value>::mergeShfl(key, val, cmp, delta, width);\n        }\n        template <typename KP0, typename KP1, typename KP2, typename KP3, typename KP4, typename KP5, typename KP6, typename KP7, typename KP8, typename KP9,\n                  typename KR0, typename KR1, typename KR2, typename KR3, typename KR4, typename KR5, typename KR6, typename KR7, typename KR8, typename KR9,\n                  typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n                  class Cmp0, class Cmp1, class Cmp2, class Cmp3, class Cmp4, class Cmp5, class Cmp6, class Cmp7, class Cmp8, class Cmp9>\n        __device__ __forceinline__ void merge(const thrust::tuple<KP0, KP1, KP2, KP3, KP4, KP5, KP6, KP7, KP8, KP9>& skeys,\n                                              const thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9>& key,\n                                              const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                              const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                              const thrust::tuple<Cmp0, Cmp1, Cmp2, Cmp3, Cmp4, Cmp5, Cmp6, Cmp7, Cmp8, Cmp9>& cmp,\n                                              unsigned int tid, unsigned int delta)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9> >::value>::merge(skeys, key, svals, val, cmp, tid, delta);\n        }\n\n        //////////////////////////////////////////////////////\n        // Generic\n\n        template <unsigned int N> struct Generic\n        {\n            template <class KP, class KR, class VP, class VR, class Cmp>\n            static __device__ void reduce(KP skeys, KR key, VP svals, VR val, unsigned int tid, Cmp cmp)\n            {\n                loadToSmem(skeys, key, tid);\n                loadValsToSmem(svals, val, tid);\n                if (N >= 32)\n                    __syncthreads();\n\n                if (N >= 2048)\n                {\n                    if (tid < 1024)\n                        merge(skeys, key, svals, val, cmp, tid, 1024);\n\n                    __syncthreads();\n                }\n                if (N >= 1024)\n                {\n                    if (tid < 512)\n                        merge(skeys, key, svals, val, cmp, tid, 512);\n\n                    __syncthreads();\n                }\n                if (N >= 512)\n                {\n                    if (tid < 256)\n                        merge(skeys, key, svals, val, cmp, tid, 256);\n\n                    __syncthreads();\n                }\n                if (N >= 256)\n                {\n                    if (tid < 128)\n                        merge(skeys, key, svals, val, cmp, tid, 128);\n\n                    __syncthreads();\n                }\n                if (N >= 128)\n                {\n                    if (tid < 64)\n                        merge(skeys, key, svals, val, cmp, tid, 64);\n\n                    __syncthreads();\n                }\n                if (N >= 64)\n                {\n                    if (tid < 32)\n                        merge(skeys, key, svals, val, cmp, tid, 32);\n                }\n\n                if (tid < 16)\n                {\n                    merge(skeys, key, svals, val, cmp, tid, 16);\n                    merge(skeys, key, svals, val, cmp, tid, 8);\n                    merge(skeys, key, svals, val, cmp, tid, 4);\n                    merge(skeys, key, svals, val, cmp, tid, 2);\n                    merge(skeys, key, svals, val, cmp, tid, 1);\n                }\n            }\n        };\n\n        template <unsigned int I, class KP, class KR, class VP, class VR, class Cmp>\n        struct Unroll\n        {\n            static __device__ void loopShfl(KR key, VR val, Cmp cmp, unsigned int N)\n            {\n                mergeShfl(key, val, cmp, I, N);\n                Unroll<I / 2, KP, KR, VP, VR, Cmp>::loopShfl(key, val, cmp, N);\n            }\n            static __device__ void loop(KP skeys, KR key, VP svals, VR val, unsigned int tid, Cmp cmp)\n            {\n                merge(skeys, key, svals, val, cmp, tid, I);\n                Unroll<I / 2, KP, KR, VP, VR, Cmp>::loop(skeys, key, svals, val, tid, cmp);\n            }\n        };\n        template <class KP, class KR, class VP, class VR, class Cmp>\n        struct Unroll<0, KP, KR, VP, VR, Cmp>\n        {\n            static __device__ void loopShfl(KR, VR, Cmp, unsigned int)\n            {\n            }\n            static __device__ void loop(KP, KR, VP, VR, unsigned int, Cmp)\n            {\n            }\n        };\n\n        template <unsigned int N> struct WarpOptimized\n        {\n            template <class KP, class KR, class VP, class VR, class Cmp>\n            static __device__ void reduce(KP skeys, KR key, VP svals, VR val, unsigned int tid, Cmp cmp)\n            {\n            #if 0 // __CUDA_ARCH__ >= 300\n                (void) skeys;\n                (void) svals;\n                (void) tid;\n\n                Unroll<N / 2, KP, KR, VP, VR, Cmp>::loopShfl(key, val, cmp, N);\n            #else\n                loadToSmem(skeys, key, tid);\n                loadToSmem(svals, val, tid);\n\n                if (tid < N / 2)\n                    Unroll<N / 2, KP, KR, VP, VR, Cmp>::loop(skeys, key, svals, val, tid, cmp);\n            #endif\n            }\n        };\n\n        template <unsigned int N> struct GenericOptimized32\n        {\n            enum { M = N / 32 };\n\n            template <class KP, class KR, class VP, class VR, class Cmp>\n            static __device__ void reduce(KP skeys, KR key, VP svals, VR val, unsigned int tid, Cmp cmp)\n            {\n                const unsigned int laneId = Warp::laneId();\n\n            #if 0 // __CUDA_ARCH__ >= 300\n                Unroll<16, KP, KR, VP, VR, Cmp>::loopShfl(key, val, cmp, warpSize);\n\n                if (laneId == 0)\n                {\n                    loadToSmem(skeys, key, tid / 32);\n                    loadToSmem(svals, val, tid / 32);\n                }\n            #else\n                loadToSmem(skeys, key, tid);\n                loadToSmem(svals, val, tid);\n\n                if (laneId < 16)\n                    Unroll<16, KP, KR, VP, VR, Cmp>::loop(skeys, key, svals, val, tid, cmp);\n\n                __syncthreads();\n\n                if (laneId == 0)\n                {\n                    loadToSmem(skeys, key, tid / 32);\n                    loadToSmem(svals, val, tid / 32);\n                }\n            #endif\n\n                __syncthreads();\n\n                loadFromSmem(skeys, key, tid);\n\n                if (tid < 32)\n                {\n                #if 0 // __CUDA_ARCH__ >= 300\n                    loadFromSmem(svals, val, tid);\n\n                    Unroll<M / 2, KP, KR, VP, VR, Cmp>::loopShfl(key, val, cmp, M);\n                #else\n                    Unroll<M / 2, KP, KR, VP, VR, Cmp>::loop(skeys, key, svals, val, tid, cmp);\n                #endif\n                }\n            }\n        };\n\n        template <bool val, class T1, class T2> struct StaticIf;\n        template <class T1, class T2> struct StaticIf<true, T1, T2>\n        {\n            typedef T1 type;\n        };\n        template <class T1, class T2> struct StaticIf<false, T1, T2>\n        {\n            typedef T2 type;\n        };\n\n        template <unsigned int N> struct IsPowerOf2\n        {\n            enum { value = ((N != 0) && !(N & (N - 1))) };\n        };\n\n        template <unsigned int N> struct Dispatcher\n        {\n            typedef typename StaticIf<\n                (N <= 32) && IsPowerOf2<N>::value,\n                WarpOptimized<N>,\n                typename StaticIf<\n                    (N <= 1024) && IsPowerOf2<N>::value,\n                    GenericOptimized32<N>,\n                    Generic<N>\n                >::type\n            >::type reductor;\n        };\n    }\n}}}\n\n#endif // __OPENCV_GPU_PRED_VAL_REDUCE_DETAIL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/detail/transform_detail.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_TRANSFORM_DETAIL_HPP__\n#define __OPENCV_GPU_TRANSFORM_DETAIL_HPP__\n\n#include \"../common.hpp\"\n#include \"../vec_traits.hpp\"\n#include \"../functional.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    namespace transform_detail\n    {\n        //! Read Write Traits\n\n        template <typename T, typename D, int shift> struct UnaryReadWriteTraits\n        {\n            typedef typename TypeVec<T, shift>::vec_type read_type;\n            typedef typename TypeVec<D, shift>::vec_type write_type;\n        };\n\n        template <typename T1, typename T2, typename D, int shift> struct BinaryReadWriteTraits\n        {\n            typedef typename TypeVec<T1, shift>::vec_type read_type1;\n            typedef typename TypeVec<T2, shift>::vec_type read_type2;\n            typedef typename TypeVec<D, shift>::vec_type write_type;\n        };\n\n        //! Transform kernels\n\n        template <int shift> struct OpUnroller;\n        template <> struct OpUnroller<1>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src.x);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src1.x, src2.x);\n            }\n        };\n        template <> struct OpUnroller<2>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src.y);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src1.x, src2.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src1.y, src2.y);\n            }\n        };\n        template <> struct OpUnroller<3>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, const UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src.y);\n                if (mask(y, x_shifted + 2))\n                    dst.z = op(src.z);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, const BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src1.x, src2.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src1.y, src2.y);\n                if (mask(y, x_shifted + 2))\n                    dst.z = op(src1.z, src2.z);\n            }\n        };\n        template <> struct OpUnroller<4>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, const UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src.y);\n                if (mask(y, x_shifted + 2))\n                    dst.z = op(src.z);\n                if (mask(y, x_shifted + 3))\n                    dst.w = op(src.w);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, const BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src1.x, src2.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src1.y, src2.y);\n                if (mask(y, x_shifted + 2))\n                    dst.z = op(src1.z, src2.z);\n                if (mask(y, x_shifted + 3))\n                    dst.w = op(src1.w, src2.w);\n            }\n        };\n        template <> struct OpUnroller<8>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, const UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.a0 = op(src.a0);\n                if (mask(y, x_shifted + 1))\n                    dst.a1 = op(src.a1);\n                if (mask(y, x_shifted + 2))\n                    dst.a2 = op(src.a2);\n                if (mask(y, x_shifted + 3))\n                    dst.a3 = op(src.a3);\n                if (mask(y, x_shifted + 4))\n                    dst.a4 = op(src.a4);\n                if (mask(y, x_shifted + 5))\n                    dst.a5 = op(src.a5);\n                if (mask(y, x_shifted + 6))\n                    dst.a6 = op(src.a6);\n                if (mask(y, x_shifted + 7))\n                    dst.a7 = op(src.a7);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, const BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.a0 = op(src1.a0, src2.a0);\n                if (mask(y, x_shifted + 1))\n                    dst.a1 = op(src1.a1, src2.a1);\n                if (mask(y, x_shifted + 2))\n                    dst.a2 = op(src1.a2, src2.a2);\n                if (mask(y, x_shifted + 3))\n                    dst.a3 = op(src1.a3, src2.a3);\n                if (mask(y, x_shifted + 4))\n                    dst.a4 = op(src1.a4, src2.a4);\n                if (mask(y, x_shifted + 5))\n                    dst.a5 = op(src1.a5, src2.a5);\n                if (mask(y, x_shifted + 6))\n                    dst.a6 = op(src1.a6, src2.a6);\n                if (mask(y, x_shifted + 7))\n                    dst.a7 = op(src1.a7, src2.a7);\n            }\n        };\n\n        template <typename T, typename D, typename UnOp, typename Mask>\n        static __global__ void transformSmart(const PtrStepSz<T> src_, PtrStep<D> dst_, const Mask mask, const UnOp op)\n        {\n            typedef TransformFunctorTraits<UnOp> ft;\n            typedef typename UnaryReadWriteTraits<T, D, ft::smart_shift>::read_type read_type;\n            typedef typename UnaryReadWriteTraits<T, D, ft::smart_shift>::write_type write_type;\n\n            const int x = threadIdx.x + blockIdx.x * blockDim.x;\n            const int y = threadIdx.y + blockIdx.y * blockDim.y;\n            const int x_shifted = x * ft::smart_shift;\n\n            if (y < src_.rows)\n            {\n                const T* src = src_.ptr(y);\n                D* dst = dst_.ptr(y);\n\n                if (x_shifted + ft::smart_shift - 1 < src_.cols)\n                {\n                    const read_type src_n_el = ((const read_type*)src)[x];\n                    write_type dst_n_el = ((const write_type*)dst)[x];\n\n                    OpUnroller<ft::smart_shift>::unroll(src_n_el, dst_n_el, mask, op, x_shifted, y);\n\n                    ((write_type*)dst)[x] = dst_n_el;\n                }\n                else\n                {\n                    for (int real_x = x_shifted; real_x < src_.cols; ++real_x)\n                    {\n                        if (mask(y, real_x))\n                            dst[real_x] = op(src[real_x]);\n                    }\n                }\n            }\n        }\n\n        template <typename T, typename D, typename UnOp, typename Mask>\n        __global__ static void transformSimple(const PtrStepSz<T> src, PtrStep<D> dst, const Mask mask, const UnOp op)\n        {\n            const int x = blockDim.x * blockIdx.x + threadIdx.x;\n            const int y = blockDim.y * blockIdx.y + threadIdx.y;\n\n            if (x < src.cols && y < src.rows && mask(y, x))\n            {\n                dst.ptr(y)[x] = op(src.ptr(y)[x]);\n            }\n        }\n\n        template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n        static __global__ void transformSmart(const PtrStepSz<T1> src1_, const PtrStep<T2> src2_, PtrStep<D> dst_,\n            const Mask mask, const BinOp op)\n        {\n            typedef TransformFunctorTraits<BinOp> ft;\n            typedef typename BinaryReadWriteTraits<T1, T2, D, ft::smart_shift>::read_type1 read_type1;\n            typedef typename BinaryReadWriteTraits<T1, T2, D, ft::smart_shift>::read_type2 read_type2;\n            typedef typename BinaryReadWriteTraits<T1, T2, D, ft::smart_shift>::write_type write_type;\n\n            const int x = threadIdx.x + blockIdx.x * blockDim.x;\n            const int y = threadIdx.y + blockIdx.y * blockDim.y;\n            const int x_shifted = x * ft::smart_shift;\n\n            if (y < src1_.rows)\n            {\n                const T1* src1 = src1_.ptr(y);\n                const T2* src2 = src2_.ptr(y);\n                D* dst = dst_.ptr(y);\n\n                if (x_shifted + ft::smart_shift - 1 < src1_.cols)\n                {\n                    const read_type1 src1_n_el = ((const read_type1*)src1)[x];\n                    const read_type2 src2_n_el = ((const read_type2*)src2)[x];\n                    write_type dst_n_el = ((const write_type*)dst)[x];\n\n                    OpUnroller<ft::smart_shift>::unroll(src1_n_el, src2_n_el, dst_n_el, mask, op, x_shifted, y);\n\n                    ((write_type*)dst)[x] = dst_n_el;\n                }\n                else\n                {\n                    for (int real_x = x_shifted; real_x < src1_.cols; ++real_x)\n                    {\n                        if (mask(y, real_x))\n                            dst[real_x] = op(src1[real_x], src2[real_x]);\n                    }\n                }\n            }\n        }\n\n        template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n        static __global__ void transformSimple(const PtrStepSz<T1> src1, const PtrStep<T2> src2, PtrStep<D> dst,\n            const Mask mask, const BinOp op)\n        {\n            const int x = blockDim.x * blockIdx.x + threadIdx.x;\n            const int y = blockDim.y * blockIdx.y + threadIdx.y;\n\n            if (x < src1.cols && y < src1.rows && mask(y, x))\n            {\n                const T1 src1_data = src1.ptr(y)[x];\n                const T2 src2_data = src2.ptr(y)[x];\n                dst.ptr(y)[x] = op(src1_data, src2_data);\n            }\n        }\n\n        template <bool UseSmart> struct TransformDispatcher;\n        template<> struct TransformDispatcher<false>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static void call(PtrStepSz<T> src, PtrStepSz<D> dst, UnOp op, Mask mask, cudaStream_t stream)\n            {\n                typedef TransformFunctorTraits<UnOp> ft;\n\n                const dim3 threads(ft::simple_block_dim_x, ft::simple_block_dim_y, 1);\n                const dim3 grid(divUp(src.cols, threads.x), divUp(src.rows, threads.y), 1);\n\n                transformSimple<T, D><<<grid, threads, 0, stream>>>(src, dst, mask, op);\n                cudaSafeCall( cudaGetLastError() );\n\n                if (stream == 0)\n                    cudaSafeCall( cudaDeviceSynchronize() );\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static void call(PtrStepSz<T1> src1, PtrStepSz<T2> src2, PtrStepSz<D> dst, BinOp op, Mask mask, cudaStream_t stream)\n            {\n                typedef TransformFunctorTraits<BinOp> ft;\n\n                const dim3 threads(ft::simple_block_dim_x, ft::simple_block_dim_y, 1);\n                const dim3 grid(divUp(src1.cols, threads.x), divUp(src1.rows, threads.y), 1);\n\n                transformSimple<T1, T2, D><<<grid, threads, 0, stream>>>(src1, src2, dst, mask, op);\n                cudaSafeCall( cudaGetLastError() );\n\n                if (stream == 0)\n                    cudaSafeCall( cudaDeviceSynchronize() );\n            }\n        };\n        template<> struct TransformDispatcher<true>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static void call(PtrStepSz<T> src, PtrStepSz<D> dst, UnOp op, Mask mask, cudaStream_t stream)\n            {\n                typedef TransformFunctorTraits<UnOp> ft;\n\n                StaticAssert<ft::smart_shift != 1>::check();\n\n                if (!isAligned(src.data, ft::smart_shift * sizeof(T)) || !isAligned(src.step, ft::smart_shift * sizeof(T)) ||\n                    !isAligned(dst.data, ft::smart_shift * sizeof(D)) || !isAligned(dst.step, ft::smart_shift * sizeof(D)))\n                {\n                    TransformDispatcher<false>::call(src, dst, op, mask, stream);\n                    return;\n                }\n\n                const dim3 threads(ft::smart_block_dim_x, ft::smart_block_dim_y, 1);\n                const dim3 grid(divUp(src.cols, threads.x * ft::smart_shift), divUp(src.rows, threads.y), 1);\n\n                transformSmart<T, D><<<grid, threads, 0, stream>>>(src, dst, mask, op);\n                cudaSafeCall( cudaGetLastError() );\n\n                if (stream == 0)\n                    cudaSafeCall( cudaDeviceSynchronize() );\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static void call(PtrStepSz<T1> src1, PtrStepSz<T2> src2, PtrStepSz<D> dst, BinOp op, Mask mask, cudaStream_t stream)\n            {\n                typedef TransformFunctorTraits<BinOp> ft;\n\n                StaticAssert<ft::smart_shift != 1>::check();\n\n                if (!isAligned(src1.data, ft::smart_shift * sizeof(T1)) || !isAligned(src1.step, ft::smart_shift * sizeof(T1)) ||\n                    !isAligned(src2.data, ft::smart_shift * sizeof(T2)) || !isAligned(src2.step, ft::smart_shift * sizeof(T2)) ||\n                    !isAligned(dst.data, ft::smart_shift * sizeof(D)) || !isAligned(dst.step, ft::smart_shift * sizeof(D)))\n                {\n                    TransformDispatcher<false>::call(src1, src2, dst, op, mask, stream);\n                    return;\n                }\n\n                const dim3 threads(ft::smart_block_dim_x, ft::smart_block_dim_y, 1);\n                const dim3 grid(divUp(src1.cols, threads.x * ft::smart_shift), divUp(src1.rows, threads.y), 1);\n\n                transformSmart<T1, T2, D><<<grid, threads, 0, stream>>>(src1, src2, dst, mask, op);\n                cudaSafeCall( cudaGetLastError() );\n\n                if (stream == 0)\n                    cudaSafeCall( cudaDeviceSynchronize() );\n            }\n        };\n    } // namespace transform_detail\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_TRANSFORM_DETAIL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/detail/type_traits_detail.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_TYPE_TRAITS_DETAIL_HPP__\n#define __OPENCV_GPU_TYPE_TRAITS_DETAIL_HPP__\n\n#include \"../common.hpp\"\n#include \"../vec_traits.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    namespace type_traits_detail\n    {\n        template <bool, typename T1, typename T2> struct Select { typedef T1 type; };\n        template <typename T1, typename T2> struct Select<false, T1, T2> { typedef T2 type; };\n\n        template <typename T> struct IsSignedIntergral { enum {value = 0}; };\n        template <> struct IsSignedIntergral<schar> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<char1> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<short> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<short1> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<int> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<int1> { enum {value = 1}; };\n\n        template <typename T> struct IsUnsignedIntegral { enum {value = 0}; };\n        template <> struct IsUnsignedIntegral<uchar> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<uchar1> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<ushort> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<ushort1> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<uint> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<uint1> { enum {value = 1}; };\n\n        template <typename T> struct IsIntegral { enum {value = IsSignedIntergral<T>::value || IsUnsignedIntegral<T>::value}; };\n        template <> struct IsIntegral<char> { enum {value = 1}; };\n        template <> struct IsIntegral<bool> { enum {value = 1}; };\n\n        template <typename T> struct IsFloat { enum {value = 0}; };\n        template <> struct IsFloat<float> { enum {value = 1}; };\n        template <> struct IsFloat<double> { enum {value = 1}; };\n\n        template <typename T> struct IsVec { enum {value = 0}; };\n        template <> struct IsVec<uchar1> { enum {value = 1}; };\n        template <> struct IsVec<uchar2> { enum {value = 1}; };\n        template <> struct IsVec<uchar3> { enum {value = 1}; };\n        template <> struct IsVec<uchar4> { enum {value = 1}; };\n        template <> struct IsVec<uchar8> { enum {value = 1}; };\n        template <> struct IsVec<char1> { enum {value = 1}; };\n        template <> struct IsVec<char2> { enum {value = 1}; };\n        template <> struct IsVec<char3> { enum {value = 1}; };\n        template <> struct IsVec<char4> { enum {value = 1}; };\n        template <> struct IsVec<char8> { enum {value = 1}; };\n        template <> struct IsVec<ushort1> { enum {value = 1}; };\n        template <> struct IsVec<ushort2> { enum {value = 1}; };\n        template <> struct IsVec<ushort3> { enum {value = 1}; };\n        template <> struct IsVec<ushort4> { enum {value = 1}; };\n        template <> struct IsVec<ushort8> { enum {value = 1}; };\n        template <> struct IsVec<short1> { enum {value = 1}; };\n        template <> struct IsVec<short2> { enum {value = 1}; };\n        template <> struct IsVec<short3> { enum {value = 1}; };\n        template <> struct IsVec<short4> { enum {value = 1}; };\n        template <> struct IsVec<short8> { enum {value = 1}; };\n        template <> struct IsVec<uint1> { enum {value = 1}; };\n        template <> struct IsVec<uint2> { enum {value = 1}; };\n        template <> struct IsVec<uint3> { enum {value = 1}; };\n        template <> struct IsVec<uint4> { enum {value = 1}; };\n        template <> struct IsVec<uint8> { enum {value = 1}; };\n        template <> struct IsVec<int1> { enum {value = 1}; };\n        template <> struct IsVec<int2> { enum {value = 1}; };\n        template <> struct IsVec<int3> { enum {value = 1}; };\n        template <> struct IsVec<int4> { enum {value = 1}; };\n        template <> struct IsVec<int8> { enum {value = 1}; };\n        template <> struct IsVec<float1> { enum {value = 1}; };\n        template <> struct IsVec<float2> { enum {value = 1}; };\n        template <> struct IsVec<float3> { enum {value = 1}; };\n        template <> struct IsVec<float4> { enum {value = 1}; };\n        template <> struct IsVec<float8> { enum {value = 1}; };\n        template <> struct IsVec<double1> { enum {value = 1}; };\n        template <> struct IsVec<double2> { enum {value = 1}; };\n        template <> struct IsVec<double3> { enum {value = 1}; };\n        template <> struct IsVec<double4> { enum {value = 1}; };\n        template <> struct IsVec<double8> { enum {value = 1}; };\n\n        template <class U> struct AddParameterType { typedef const U& type; };\n        template <class U> struct AddParameterType<U&> { typedef U& type; };\n        template <> struct AddParameterType<void> { typedef void type; };\n\n        template <class U> struct ReferenceTraits\n        {\n            enum { value = false };\n            typedef U type;\n        };\n        template <class U> struct ReferenceTraits<U&>\n        {\n            enum { value = true };\n            typedef U type;\n        };\n\n        template <class U> struct PointerTraits\n        {\n            enum { value = false };\n            typedef void type;\n        };\n        template <class U> struct PointerTraits<U*>\n        {\n            enum { value = true };\n            typedef U type;\n        };\n        template <class U> struct PointerTraits<U*&>\n        {\n            enum { value = true };\n            typedef U type;\n        };\n\n        template <class U> struct UnConst\n        {\n            typedef U type;\n            enum { value = 0 };\n        };\n        template <class U> struct UnConst<const U>\n        {\n            typedef U type;\n            enum { value = 1 };\n        };\n        template <class U> struct UnConst<const U&>\n        {\n            typedef U& type;\n            enum { value = 1 };\n        };\n\n        template <class U> struct UnVolatile\n        {\n            typedef U type;\n            enum { value = 0 };\n        };\n        template <class U> struct UnVolatile<volatile U>\n        {\n            typedef U type;\n            enum { value = 1 };\n        };\n        template <class U> struct UnVolatile<volatile U&>\n        {\n            typedef U& type;\n            enum { value = 1 };\n        };\n    } // namespace type_traits_detail\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_TYPE_TRAITS_DETAIL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/detail/vec_distance_detail.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_VEC_DISTANCE_DETAIL_HPP__\n#define __OPENCV_GPU_VEC_DISTANCE_DETAIL_HPP__\n\n#include \"../datamov_utils.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    namespace vec_distance_detail\n    {\n        template <int THREAD_DIM, int N> struct UnrollVecDiffCached\n        {\n            template <typename Dist, typename T1, typename T2>\n            static __device__ void calcCheck(const T1* vecCached, const T2* vecGlob, int len, Dist& dist, int ind)\n            {\n                if (ind < len)\n                {\n                    T1 val1 = *vecCached++;\n\n                    T2 val2;\n                    ForceGlob<T2>::Load(vecGlob, ind, val2);\n\n                    dist.reduceIter(val1, val2);\n\n                    UnrollVecDiffCached<THREAD_DIM, N - 1>::calcCheck(vecCached, vecGlob, len, dist, ind + THREAD_DIM);\n                }\n            }\n\n            template <typename Dist, typename T1, typename T2>\n            static __device__ void calcWithoutCheck(const T1* vecCached, const T2* vecGlob, Dist& dist)\n            {\n                T1 val1 = *vecCached++;\n\n                T2 val2;\n                ForceGlob<T2>::Load(vecGlob, 0, val2);\n                vecGlob += THREAD_DIM;\n\n                dist.reduceIter(val1, val2);\n\n                UnrollVecDiffCached<THREAD_DIM, N - 1>::calcWithoutCheck(vecCached, vecGlob, dist);\n            }\n        };\n        template <int THREAD_DIM> struct UnrollVecDiffCached<THREAD_DIM, 0>\n        {\n            template <typename Dist, typename T1, typename T2>\n            static __device__ __forceinline__ void calcCheck(const T1*, const T2*, int, Dist&, int)\n            {\n            }\n\n            template <typename Dist, typename T1, typename T2>\n            static __device__ __forceinline__ void calcWithoutCheck(const T1*, const T2*, Dist&)\n            {\n            }\n        };\n\n        template <int THREAD_DIM, int MAX_LEN, bool LEN_EQ_MAX_LEN> struct VecDiffCachedCalculator;\n        template <int THREAD_DIM, int MAX_LEN> struct VecDiffCachedCalculator<THREAD_DIM, MAX_LEN, false>\n        {\n            template <typename Dist, typename T1, typename T2>\n            static __device__ __forceinline__ void calc(const T1* vecCached, const T2* vecGlob, int len, Dist& dist, int tid)\n            {\n                UnrollVecDiffCached<THREAD_DIM, MAX_LEN / THREAD_DIM>::calcCheck(vecCached, vecGlob, len, dist, tid);\n            }\n        };\n        template <int THREAD_DIM, int MAX_LEN> struct VecDiffCachedCalculator<THREAD_DIM, MAX_LEN, true>\n        {\n            template <typename Dist, typename T1, typename T2>\n            static __device__ __forceinline__ void calc(const T1* vecCached, const T2* vecGlob, int len, Dist& dist, int tid)\n            {\n                UnrollVecDiffCached<THREAD_DIM, MAX_LEN / THREAD_DIM>::calcWithoutCheck(vecCached, vecGlob + tid, dist);\n            }\n        };\n    } // namespace vec_distance_detail\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_VEC_DISTANCE_DETAIL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/dynamic_smem.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_DYNAMIC_SMEM_HPP__\n#define __OPENCV_GPU_DYNAMIC_SMEM_HPP__\n\nnamespace cv { namespace gpu { namespace device\n{\n    template<class T> struct DynamicSharedMem\n    {\n        __device__ __forceinline__ operator T*()\n        {\n            extern __shared__ int __smem[];\n            return (T*)__smem;\n        }\n\n        __device__ __forceinline__ operator const T*() const\n        {\n            extern __shared__ int __smem[];\n            return (T*)__smem;\n        }\n    };\n\n    // specialize for double to avoid unaligned memory access compile errors\n    template<> struct DynamicSharedMem<double>\n    {\n        __device__ __forceinline__ operator double*()\n        {\n            extern __shared__ double __smem_d[];\n            return (double*)__smem_d;\n        }\n\n        __device__ __forceinline__ operator const double*() const\n        {\n            extern __shared__ double __smem_d[];\n            return (double*)__smem_d;\n        }\n    };\n}}}\n\n#endif // __OPENCV_GPU_DYNAMIC_SMEM_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/emulation.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_GPU_EMULATION_HPP_\n#define OPENCV_GPU_EMULATION_HPP_\n\n#include \"warp_reduce.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    struct Emulation\n    {\n\n        static __device__ __forceinline__ int syncthreadsOr(int pred)\n        {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ < 200)\n                // just campilation stab\n                return 0;\n#else\n                return __syncthreads_or(pred);\n#endif\n        }\n\n        template<int CTA_SIZE>\n        static __forceinline__ __device__ int Ballot(int predicate)\n        {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ >= 200)\n            return __ballot(predicate);\n#else\n            __shared__ volatile int cta_buffer[CTA_SIZE];\n\n            int tid = threadIdx.x;\n            cta_buffer[tid] = predicate ? (1 << (tid & 31)) : 0;\n            return warp_reduce(cta_buffer);\n#endif\n        }\n\n        struct smem\n        {\n            enum { TAG_MASK = (1U << ( (sizeof(unsigned int) << 3) - 5U)) - 1U };\n\n            template<typename T>\n            static __device__ __forceinline__ T atomicInc(T* address, T val)\n            {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ < 120)\n                T count;\n                unsigned int tag = threadIdx.x << ( (sizeof(unsigned int) << 3) - 5U);\n                do\n                {\n                    count = *address & TAG_MASK;\n                    count = tag | (count + 1);\n                    *address = count;\n                } while (*address != count);\n\n                return (count & TAG_MASK) - 1;\n#else\n                return ::atomicInc(address, val);\n#endif\n            }\n\n            template<typename T>\n            static __device__ __forceinline__ T atomicAdd(T* address, T val)\n            {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ < 120)\n                T count;\n                unsigned int tag = threadIdx.x << ( (sizeof(unsigned int) << 3) - 5U);\n                do\n                {\n                    count = *address & TAG_MASK;\n                    count = tag | (count + val);\n                    *address = count;\n                } while (*address != count);\n\n                return (count & TAG_MASK) - val;\n#else\n                return ::atomicAdd(address, val);\n#endif\n            }\n\n            template<typename T>\n            static __device__ __forceinline__ T atomicMin(T* address, T val)\n            {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ < 120)\n                T count = ::min(*address, val);\n                do\n                {\n                    *address = count;\n                } while (*address > count);\n\n                return count;\n#else\n                return ::atomicMin(address, val);\n#endif\n            }\n        };\n    };\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif /* OPENCV_GPU_EMULATION_HPP_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/filters.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_FILTERS_HPP__\n#define __OPENCV_GPU_FILTERS_HPP__\n\n#include \"saturate_cast.hpp\"\n#include \"vec_traits.hpp\"\n#include \"vec_math.hpp\"\n#include \"type_traits.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    template <typename Ptr2D> struct PointFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n\n        explicit __host__ __device__ __forceinline__ PointFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)\n        : src(src_)\n        {\n            (void)fx;\n            (void)fy;\n        }\n\n        __device__ __forceinline__ elem_type operator ()(float y, float x) const\n        {\n            return src(__float2int_rz(y), __float2int_rz(x));\n        }\n\n        const Ptr2D src;\n    };\n\n    template <typename Ptr2D> struct LinearFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n\n        explicit __host__ __device__ __forceinline__ LinearFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)\n        : src(src_)\n        {\n            (void)fx;\n            (void)fy;\n        }\n        __device__ __forceinline__ elem_type operator ()(float y, float x) const\n        {\n            typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\n\n            work_type out = VecTraits<work_type>::all(0);\n\n            const int x1 = __float2int_rd(x);\n            const int y1 = __float2int_rd(y);\n            const int x2 = x1 + 1;\n            const int y2 = y1 + 1;\n\n            elem_type src_reg = src(y1, x1);\n            out = out + src_reg * ((x2 - x) * (y2 - y));\n\n            src_reg = src(y1, x2);\n            out = out + src_reg * ((x - x1) * (y2 - y));\n\n            src_reg = src(y2, x1);\n            out = out + src_reg * ((x2 - x) * (y - y1));\n\n            src_reg = src(y2, x2);\n            out = out + src_reg * ((x - x1) * (y - y1));\n\n            return saturate_cast<elem_type>(out);\n        }\n\n        const Ptr2D src;\n    };\n\n    template <typename Ptr2D> struct CubicFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n        typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\n\n        explicit __host__ __device__ __forceinline__ CubicFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)\n        : src(src_)\n        {\n            (void)fx;\n            (void)fy;\n        }\n\n        static __device__ __forceinline__ float bicubicCoeff(float x_)\n        {\n            float x = fabsf(x_);\n            if (x <= 1.0f)\n            {\n                return x * x * (1.5f * x - 2.5f) + 1.0f;\n            }\n            else if (x < 2.0f)\n            {\n                return x * (x * (-0.5f * x + 2.5f) - 4.0f) + 2.0f;\n            }\n            else\n            {\n                return 0.0f;\n            }\n        }\n\n        __device__ elem_type operator ()(float y, float x) const\n        {\n            const float xmin = ::ceilf(x - 2.0f);\n            const float xmax = ::floorf(x + 2.0f);\n\n            const float ymin = ::ceilf(y - 2.0f);\n            const float ymax = ::floorf(y + 2.0f);\n\n            work_type sum = VecTraits<work_type>::all(0);\n            float wsum = 0.0f;\n\n            for (float cy = ymin; cy <= ymax; cy += 1.0f)\n            {\n                for (float cx = xmin; cx <= xmax; cx += 1.0f)\n                {\n                    const float w = bicubicCoeff(x - cx) * bicubicCoeff(y - cy);\n                    sum = sum + w * src(__float2int_rd(cy), __float2int_rd(cx));\n                    wsum += w;\n                }\n            }\n\n            work_type res = (!wsum)? VecTraits<work_type>::all(0) : sum / wsum;\n\n            return saturate_cast<elem_type>(res);\n        }\n\n        const Ptr2D src;\n    };\n    // for integer scaling\n    template <typename Ptr2D> struct IntegerAreaFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n\n        explicit __host__ __device__ __forceinline__ IntegerAreaFilter(const Ptr2D& src_, float scale_x_, float scale_y_)\n            : src(src_), scale_x(scale_x_), scale_y(scale_y_), scale(1.f / (scale_x * scale_y)) {}\n\n        __device__ __forceinline__ elem_type operator ()(float y, float x) const\n        {\n            float fsx1 = x * scale_x;\n            float fsx2 = fsx1 + scale_x;\n\n            int sx1 = __float2int_ru(fsx1);\n            int sx2 = __float2int_rd(fsx2);\n\n            float fsy1 = y * scale_y;\n            float fsy2 = fsy1 + scale_y;\n\n            int sy1 = __float2int_ru(fsy1);\n            int sy2 = __float2int_rd(fsy2);\n\n            typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\n            work_type out = VecTraits<work_type>::all(0.f);\n\n            for(int dy = sy1; dy < sy2; ++dy)\n                for(int dx = sx1; dx < sx2; ++dx)\n                {\n                    out = out + src(dy, dx) * scale;\n                }\n\n            return saturate_cast<elem_type>(out);\n        }\n\n        const Ptr2D src;\n        float scale_x, scale_y ,scale;\n    };\n\n    template <typename Ptr2D> struct AreaFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n\n        explicit __host__ __device__ __forceinline__ AreaFilter(const Ptr2D& src_, float scale_x_, float scale_y_)\n            : src(src_), scale_x(scale_x_), scale_y(scale_y_){}\n\n        __device__ __forceinline__ elem_type operator ()(float y, float x) const\n        {\n            float fsx1 = x * scale_x;\n            float fsx2 = fsx1 + scale_x;\n\n            int sx1 = __float2int_ru(fsx1);\n            int sx2 = __float2int_rd(fsx2);\n\n            float fsy1 = y * scale_y;\n            float fsy2 = fsy1 + scale_y;\n\n            int sy1 = __float2int_ru(fsy1);\n            int sy2 = __float2int_rd(fsy2);\n\n            float scale = 1.f / (fminf(scale_x, src.width - fsx1) * fminf(scale_y, src.height - fsy1));\n\n            typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\n            work_type out = VecTraits<work_type>::all(0.f);\n\n            for (int dy = sy1; dy < sy2; ++dy)\n            {\n                for (int dx = sx1; dx < sx2; ++dx)\n                    out = out + src(dy, dx) * scale;\n\n                if (sx1 > fsx1)\n                    out = out + src(dy, (sx1 -1) ) * ((sx1 - fsx1) * scale);\n\n                if (sx2 < fsx2)\n                    out = out + src(dy, sx2) * ((fsx2 -sx2) * scale);\n            }\n\n            if (sy1 > fsy1)\n                for (int dx = sx1; dx < sx2; ++dx)\n                    out = out + src( (sy1 - 1) , dx) * ((sy1 -fsy1) * scale);\n\n            if (sy2 < fsy2)\n                for (int dx = sx1; dx < sx2; ++dx)\n                    out = out + src(sy2, dx) * ((fsy2 -sy2) * scale);\n\n            if ((sy1 > fsy1) &&  (sx1 > fsx1))\n                out = out + src( (sy1 - 1) , (sx1 - 1)) * ((sy1 -fsy1) * (sx1 -fsx1) * scale);\n\n            if ((sy1 > fsy1) &&  (sx2 < fsx2))\n                out = out + src( (sy1 - 1) , sx2) * ((sy1 -fsy1) * (fsx2 -sx2) * scale);\n\n            if ((sy2 < fsy2) &&  (sx2 < fsx2))\n                out = out + src(sy2, sx2) * ((fsy2 -sy2) * (fsx2 -sx2) * scale);\n\n            if ((sy2 < fsy2) &&  (sx1 > fsx1))\n                out = out + src(sy2, (sx1 - 1)) * ((fsy2 -sy2) * (sx1 -fsx1) * scale);\n\n            return saturate_cast<elem_type>(out);\n        }\n\n        const Ptr2D src;\n        float scale_x, scale_y;\n        int width, haight;\n    };\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_FILTERS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/funcattrib.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_\n#define __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_\n\n#include <cstdio>\n\nnamespace cv { namespace gpu { namespace device\n{\n    template<class Func>\n    void printFuncAttrib(Func& func)\n    {\n\n        cudaFuncAttributes attrs;\n        cudaFuncGetAttributes(&attrs, func);\n\n        printf(\"=== Function stats ===\\n\");\n        printf(\"Name: \\n\");\n        printf(\"sharedSizeBytes    = %d\\n\", attrs.sharedSizeBytes);\n        printf(\"constSizeBytes     = %d\\n\", attrs.constSizeBytes);\n        printf(\"localSizeBytes     = %d\\n\", attrs.localSizeBytes);\n        printf(\"maxThreadsPerBlock = %d\\n\", attrs.maxThreadsPerBlock);\n        printf(\"numRegs            = %d\\n\", attrs.numRegs);\n        printf(\"ptxVersion         = %d\\n\", attrs.ptxVersion);\n        printf(\"binaryVersion      = %d\\n\", attrs.binaryVersion);\n        printf(\"\\n\");\n        fflush(stdout);\n    }\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif  /* __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/functional.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_FUNCTIONAL_HPP__\n#define __OPENCV_GPU_FUNCTIONAL_HPP__\n\n#include <functional>\n#include \"saturate_cast.hpp\"\n#include \"vec_traits.hpp\"\n#include \"type_traits.hpp\"\n#include \"device_functions.h\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    // Function Objects\n    template<typename Argument, typename Result> struct unary_function : public std::unary_function<Argument, Result> {};\n    template<typename Argument1, typename Argument2, typename Result> struct binary_function : public std::binary_function<Argument1, Argument2, Result> {};\n\n    // Arithmetic Operations\n    template <typename T> struct plus : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a + b;\n        }\n        __host__ __device__ __forceinline__ plus() {}\n        __host__ __device__ __forceinline__ plus(const plus&) {}\n    };\n\n    template <typename T> struct minus : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a - b;\n        }\n        __host__ __device__ __forceinline__ minus() {}\n        __host__ __device__ __forceinline__ minus(const minus&) {}\n    };\n\n    template <typename T> struct multiplies : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a * b;\n        }\n        __host__ __device__ __forceinline__ multiplies() {}\n        __host__ __device__ __forceinline__ multiplies(const multiplies&) {}\n    };\n\n    template <typename T> struct divides : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a / b;\n        }\n        __host__ __device__ __forceinline__ divides() {}\n        __host__ __device__ __forceinline__ divides(const divides&) {}\n    };\n\n    template <typename T> struct modulus : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a % b;\n        }\n        __host__ __device__ __forceinline__ modulus() {}\n        __host__ __device__ __forceinline__ modulus(const modulus&) {}\n    };\n\n    template <typename T> struct negate : unary_function<T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a) const\n        {\n            return -a;\n        }\n        __host__ __device__ __forceinline__ negate() {}\n        __host__ __device__ __forceinline__ negate(const negate&) {}\n    };\n\n    // Comparison Operations\n    template <typename T> struct equal_to : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a == b;\n        }\n        __host__ __device__ __forceinline__ equal_to() {}\n        __host__ __device__ __forceinline__ equal_to(const equal_to&) {}\n    };\n\n    template <typename T> struct not_equal_to : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a != b;\n        }\n        __host__ __device__ __forceinline__ not_equal_to() {}\n        __host__ __device__ __forceinline__ not_equal_to(const not_equal_to&) {}\n    };\n\n    template <typename T> struct greater : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a > b;\n        }\n        __host__ __device__ __forceinline__ greater() {}\n        __host__ __device__ __forceinline__ greater(const greater&) {}\n    };\n\n    template <typename T> struct less : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a < b;\n        }\n        __host__ __device__ __forceinline__ less() {}\n        __host__ __device__ __forceinline__ less(const less&) {}\n    };\n\n    template <typename T> struct greater_equal : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a >= b;\n        }\n        __host__ __device__ __forceinline__ greater_equal() {}\n        __host__ __device__ __forceinline__ greater_equal(const greater_equal&) {}\n    };\n\n    template <typename T> struct less_equal : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a <= b;\n        }\n        __host__ __device__ __forceinline__ less_equal() {}\n        __host__ __device__ __forceinline__ less_equal(const less_equal&) {}\n    };\n\n    // Logical Operations\n    template <typename T> struct logical_and : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a && b;\n        }\n        __host__ __device__ __forceinline__ logical_and() {}\n        __host__ __device__ __forceinline__ logical_and(const logical_and&) {}\n    };\n\n    template <typename T> struct logical_or : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a || b;\n        }\n        __host__ __device__ __forceinline__ logical_or() {}\n        __host__ __device__ __forceinline__ logical_or(const logical_or&) {}\n    };\n\n    template <typename T> struct logical_not : unary_function<T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a) const\n        {\n            return !a;\n        }\n        __host__ __device__ __forceinline__ logical_not() {}\n        __host__ __device__ __forceinline__ logical_not(const logical_not&) {}\n    };\n\n    // Bitwise Operations\n    template <typename T> struct bit_and : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a & b;\n        }\n        __host__ __device__ __forceinline__ bit_and() {}\n        __host__ __device__ __forceinline__ bit_and(const bit_and&) {}\n    };\n\n    template <typename T> struct bit_or : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a | b;\n        }\n        __host__ __device__ __forceinline__ bit_or() {}\n        __host__ __device__ __forceinline__ bit_or(const bit_or&) {}\n    };\n\n    template <typename T> struct bit_xor : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a ^ b;\n        }\n        __host__ __device__ __forceinline__ bit_xor() {}\n        __host__ __device__ __forceinline__ bit_xor(const bit_xor&) {}\n    };\n\n    template <typename T> struct bit_not : unary_function<T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType v) const\n        {\n            return ~v;\n        }\n        __host__ __device__ __forceinline__ bit_not() {}\n        __host__ __device__ __forceinline__ bit_not(const bit_not&) {}\n    };\n\n    // Generalized Identity Operations\n    template <typename T> struct identity : unary_function<T, T>\n    {\n        __device__ __forceinline__ typename TypeTraits<T>::ParameterType operator()(typename TypeTraits<T>::ParameterType x) const\n        {\n            return x;\n        }\n        __host__ __device__ __forceinline__ identity() {}\n        __host__ __device__ __forceinline__ identity(const identity&) {}\n    };\n\n    template <typename T1, typename T2> struct project1st : binary_function<T1, T2, T1>\n    {\n        __device__ __forceinline__ typename TypeTraits<T1>::ParameterType operator()(typename TypeTraits<T1>::ParameterType lhs, typename TypeTraits<T2>::ParameterType rhs) const\n        {\n            return lhs;\n        }\n        __host__ __device__ __forceinline__ project1st() {}\n        __host__ __device__ __forceinline__ project1st(const project1st&) {}\n    };\n\n    template <typename T1, typename T2> struct project2nd : binary_function<T1, T2, T2>\n    {\n        __device__ __forceinline__ typename TypeTraits<T2>::ParameterType operator()(typename TypeTraits<T1>::ParameterType lhs, typename TypeTraits<T2>::ParameterType rhs) const\n        {\n            return rhs;\n        }\n        __host__ __device__ __forceinline__ project2nd() {}\n        __host__ __device__ __forceinline__ project2nd(const project2nd&) {}\n    };\n\n    // Min/Max Operations\n\n#define OPENCV_GPU_IMPLEMENT_MINMAX(name, type, op) \\\n    template <> struct name<type> : binary_function<type, type, type> \\\n    { \\\n        __device__ __forceinline__ type operator()(type lhs, type rhs) const {return op(lhs, rhs);} \\\n        __host__ __device__ __forceinline__ name() {}\\\n        __host__ __device__ __forceinline__ name(const name&) {}\\\n    };\n\n    template <typename T> struct maximum : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType lhs, typename TypeTraits<T>::ParameterType rhs) const\n        {\n            return max(lhs, rhs);\n        }\n        __host__ __device__ __forceinline__ maximum() {}\n        __host__ __device__ __forceinline__ maximum(const maximum&) {}\n    };\n\n    OPENCV_GPU_IMPLEMENT_MINMAX(maximum, uchar, ::max)\n    OPENCV_GPU_IMPLEMENT_MINMAX(maximum, schar, ::max)\n    OPENCV_GPU_IMPLEMENT_MINMAX(maximum, char, ::max)\n    OPENCV_GPU_IMPLEMENT_MINMAX(maximum, ushort, ::max)\n    OPENCV_GPU_IMPLEMENT_MINMAX(maximum, short, ::max)\n    OPENCV_GPU_IMPLEMENT_MINMAX(maximum, int, ::max)\n    OPENCV_GPU_IMPLEMENT_MINMAX(maximum, uint, ::max)\n    OPENCV_GPU_IMPLEMENT_MINMAX(maximum, float, ::fmax)\n    OPENCV_GPU_IMPLEMENT_MINMAX(maximum, double, ::fmax)\n\n    template <typename T> struct minimum : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType lhs, typename TypeTraits<T>::ParameterType rhs) const\n        {\n            return min(lhs, rhs);\n        }\n        __host__ __device__ __forceinline__ minimum() {}\n        __host__ __device__ __forceinline__ minimum(const minimum&) {}\n    };\n\n    OPENCV_GPU_IMPLEMENT_MINMAX(minimum, uchar, ::min)\n    OPENCV_GPU_IMPLEMENT_MINMAX(minimum, schar, ::min)\n    OPENCV_GPU_IMPLEMENT_MINMAX(minimum, char, ::min)\n    OPENCV_GPU_IMPLEMENT_MINMAX(minimum, ushort, ::min)\n    OPENCV_GPU_IMPLEMENT_MINMAX(minimum, short, ::min)\n    OPENCV_GPU_IMPLEMENT_MINMAX(minimum, int, ::min)\n    OPENCV_GPU_IMPLEMENT_MINMAX(minimum, uint, ::min)\n    OPENCV_GPU_IMPLEMENT_MINMAX(minimum, float, ::fmin)\n    OPENCV_GPU_IMPLEMENT_MINMAX(minimum, double, ::fmin)\n\n#undef OPENCV_GPU_IMPLEMENT_MINMAX\n\n    // Math functions\n\n    template <typename T> struct abs_func : unary_function<T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType x) const\n        {\n            return abs(x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<unsigned char> : unary_function<unsigned char, unsigned char>\n    {\n        __device__ __forceinline__ unsigned char operator ()(unsigned char x) const\n        {\n            return x;\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<signed char> : unary_function<signed char, signed char>\n    {\n        __device__ __forceinline__ signed char operator ()(signed char x) const\n        {\n            return ::abs((int)x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<char> : unary_function<char, char>\n    {\n        __device__ __forceinline__ char operator ()(char x) const\n        {\n            return ::abs((int)x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<unsigned short> : unary_function<unsigned short, unsigned short>\n    {\n        __device__ __forceinline__ unsigned short operator ()(unsigned short x) const\n        {\n            return x;\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<short> : unary_function<short, short>\n    {\n        __device__ __forceinline__ short operator ()(short x) const\n        {\n            return ::abs((int)x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<unsigned int> : unary_function<unsigned int, unsigned int>\n    {\n        __device__ __forceinline__ unsigned int operator ()(unsigned int x) const\n        {\n            return x;\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<int> : unary_function<int, int>\n    {\n        __device__ __forceinline__ int operator ()(int x) const\n        {\n            return ::abs(x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<float> : unary_function<float, float>\n    {\n        __device__ __forceinline__ float operator ()(float x) const\n        {\n            return ::fabsf(x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<double> : unary_function<double, double>\n    {\n        __device__ __forceinline__ double operator ()(double x) const\n        {\n            return ::fabs(x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n\n#define OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(name, func) \\\n    template <typename T> struct name ## _func : unary_function<T, float> \\\n    { \\\n        __device__ __forceinline__ float operator ()(typename TypeTraits<T>::ParameterType v) const \\\n        { \\\n            return func ## f(v); \\\n        } \\\n        __host__ __device__ __forceinline__ name ## _func() {} \\\n        __host__ __device__ __forceinline__ name ## _func(const name ## _func&) {} \\\n    }; \\\n    template <> struct name ## _func<double> : unary_function<double, double> \\\n    { \\\n        __device__ __forceinline__ double operator ()(double v) const \\\n        { \\\n            return func(v); \\\n        } \\\n        __host__ __device__ __forceinline__ name ## _func() {} \\\n        __host__ __device__ __forceinline__ name ## _func(const name ## _func&) {} \\\n    };\n\n#define OPENCV_GPU_IMPLEMENT_BIN_FUNCTOR(name, func) \\\n    template <typename T> struct name ## _func : binary_function<T, T, float> \\\n    { \\\n        __device__ __forceinline__ float operator ()(typename TypeTraits<T>::ParameterType v1, typename TypeTraits<T>::ParameterType v2) const \\\n        { \\\n            return func ## f(v1, v2); \\\n        } \\\n        __host__ __device__ __forceinline__ name ## _func() {} \\\n        __host__ __device__ __forceinline__ name ## _func(const name ## _func&) {} \\\n    }; \\\n    template <> struct name ## _func<double> : binary_function<double, double, double> \\\n    { \\\n        __device__ __forceinline__ double operator ()(double v1, double v2) const \\\n        { \\\n            return func(v1, v2); \\\n        } \\\n        __host__ __device__ __forceinline__ name ## _func() {} \\\n        __host__ __device__ __forceinline__ name ## _func(const name ## _func&) {} \\\n    };\n\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(sqrt, ::sqrt)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(exp, ::exp)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(exp2, ::exp2)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(exp10, ::exp10)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(log, ::log)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(log2, ::log2)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(log10, ::log10)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(sin, ::sin)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(cos, ::cos)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(tan, ::tan)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(asin, ::asin)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(acos, ::acos)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(atan, ::atan)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(sinh, ::sinh)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(cosh, ::cosh)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(tanh, ::tanh)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(asinh, ::asinh)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(acosh, ::acosh)\n    OPENCV_GPU_IMPLEMENT_UN_FUNCTOR(atanh, ::atanh)\n\n    OPENCV_GPU_IMPLEMENT_BIN_FUNCTOR(hypot, ::hypot)\n    OPENCV_GPU_IMPLEMENT_BIN_FUNCTOR(atan2, ::atan2)\n    OPENCV_GPU_IMPLEMENT_BIN_FUNCTOR(pow, ::pow)\n\n    #undef OPENCV_GPU_IMPLEMENT_UN_FUNCTOR\n    #undef OPENCV_GPU_IMPLEMENT_UN_FUNCTOR_NO_DOUBLE\n    #undef OPENCV_GPU_IMPLEMENT_BIN_FUNCTOR\n\n    template<typename T> struct hypot_sqr_func : binary_function<T, T, float>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType src1, typename TypeTraits<T>::ParameterType src2) const\n        {\n            return src1 * src1 + src2 * src2;\n        }\n        __host__ __device__ __forceinline__ hypot_sqr_func() {}\n        __host__ __device__ __forceinline__ hypot_sqr_func(const hypot_sqr_func&) {}\n    };\n\n    // Saturate Cast Functor\n    template <typename T, typename D> struct saturate_cast_func : unary_function<T, D>\n    {\n        __device__ __forceinline__ D operator ()(typename TypeTraits<T>::ParameterType v) const\n        {\n            return saturate_cast<D>(v);\n        }\n        __host__ __device__ __forceinline__ saturate_cast_func() {}\n        __host__ __device__ __forceinline__ saturate_cast_func(const saturate_cast_func&) {}\n    };\n\n    // Threshold Functors\n    template <typename T> struct thresh_binary_func : unary_function<T, T>\n    {\n        __host__ __device__ __forceinline__ thresh_binary_func(T thresh_, T maxVal_) : thresh(thresh_), maxVal(maxVal_) {}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return (src > thresh) * maxVal;\n        }\n\n        __host__ __device__ __forceinline__ thresh_binary_func() {}\n        __host__ __device__ __forceinline__ thresh_binary_func(const thresh_binary_func& other)\n            : thresh(other.thresh), maxVal(other.maxVal) {}\n\n        const T thresh;\n        const T maxVal;\n    };\n\n    template <typename T> struct thresh_binary_inv_func : unary_function<T, T>\n    {\n        __host__ __device__ __forceinline__ thresh_binary_inv_func(T thresh_, T maxVal_) : thresh(thresh_), maxVal(maxVal_) {}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return (src <= thresh) * maxVal;\n        }\n\n        __host__ __device__ __forceinline__ thresh_binary_inv_func() {}\n        __host__ __device__ __forceinline__ thresh_binary_inv_func(const thresh_binary_inv_func& other)\n            : thresh(other.thresh), maxVal(other.maxVal) {}\n\n        const T thresh;\n        const T maxVal;\n    };\n\n    template <typename T> struct thresh_trunc_func : unary_function<T, T>\n    {\n        explicit __host__ __device__ __forceinline__ thresh_trunc_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return minimum<T>()(src, thresh);\n        }\n\n        __host__ __device__ __forceinline__ thresh_trunc_func() {}\n        __host__ __device__ __forceinline__ thresh_trunc_func(const thresh_trunc_func& other)\n            : thresh(other.thresh) {}\n\n        const T thresh;\n    };\n\n    template <typename T> struct thresh_to_zero_func : unary_function<T, T>\n    {\n        explicit __host__ __device__ __forceinline__ thresh_to_zero_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return (src > thresh) * src;\n        }\n\n        __host__ __device__ __forceinline__ thresh_to_zero_func() {}\n       __host__  __device__ __forceinline__ thresh_to_zero_func(const thresh_to_zero_func& other)\n            : thresh(other.thresh) {}\n\n        const T thresh;\n    };\n\n    template <typename T> struct thresh_to_zero_inv_func : unary_function<T, T>\n    {\n        explicit __host__ __device__ __forceinline__ thresh_to_zero_inv_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return (src <= thresh) * src;\n        }\n\n        __host__ __device__ __forceinline__ thresh_to_zero_inv_func() {}\n        __host__ __device__ __forceinline__ thresh_to_zero_inv_func(const thresh_to_zero_inv_func& other)\n            : thresh(other.thresh) {}\n\n        const T thresh;\n    };\n\n    // Function Object Adaptors\n    template <typename Predicate> struct unary_negate : unary_function<typename Predicate::argument_type, bool>\n    {\n      explicit __host__ __device__ __forceinline__ unary_negate(const Predicate& p) : pred(p) {}\n\n      __device__ __forceinline__ bool operator()(typename TypeTraits<typename Predicate::argument_type>::ParameterType x) const\n      {\n          return !pred(x);\n      }\n\n      __host__ __device__ __forceinline__ unary_negate() {}\n      __host__ __device__ __forceinline__ unary_negate(const unary_negate& other) : pred(other.pred) {}\n\n      const Predicate pred;\n    };\n\n    template <typename Predicate> __host__ __device__ __forceinline__ unary_negate<Predicate> not1(const Predicate& pred)\n    {\n        return unary_negate<Predicate>(pred);\n    }\n\n    template <typename Predicate> struct binary_negate : binary_function<typename Predicate::first_argument_type, typename Predicate::second_argument_type, bool>\n    {\n        explicit __host__ __device__ __forceinline__ binary_negate(const Predicate& p) : pred(p) {}\n\n        __device__ __forceinline__ bool operator()(typename TypeTraits<typename Predicate::first_argument_type>::ParameterType x,\n                                                   typename TypeTraits<typename Predicate::second_argument_type>::ParameterType y) const\n        {\n            return !pred(x,y);\n        }\n\n        __host__ __device__ __forceinline__ binary_negate() {}\n        __host__ __device__ __forceinline__ binary_negate(const binary_negate& other) : pred(other.pred) {}\n\n        const Predicate pred;\n    };\n\n    template <typename BinaryPredicate> __host__ __device__ __forceinline__ binary_negate<BinaryPredicate> not2(const BinaryPredicate& pred)\n    {\n        return binary_negate<BinaryPredicate>(pred);\n    }\n\n    template <typename Op> struct binder1st : unary_function<typename Op::second_argument_type, typename Op::result_type>\n    {\n        __host__ __device__ __forceinline__ binder1st(const Op& op_, const typename Op::first_argument_type& arg1_) : op(op_), arg1(arg1_) {}\n\n        __device__ __forceinline__ typename Op::result_type operator ()(typename TypeTraits<typename Op::second_argument_type>::ParameterType a) const\n        {\n            return op(arg1, a);\n        }\n\n        __host__ __device__ __forceinline__ binder1st() {}\n        __host__ __device__ __forceinline__ binder1st(const binder1st& other) : op(other.op), arg1(other.arg1) {}\n\n        const Op op;\n        const typename Op::first_argument_type arg1;\n    };\n\n    template <typename Op, typename T> __host__ __device__ __forceinline__ binder1st<Op> bind1st(const Op& op, const T& x)\n    {\n        return binder1st<Op>(op, typename Op::first_argument_type(x));\n    }\n\n    template <typename Op> struct binder2nd : unary_function<typename Op::first_argument_type, typename Op::result_type>\n    {\n        __host__ __device__ __forceinline__ binder2nd(const Op& op_, const typename Op::second_argument_type& arg2_) : op(op_), arg2(arg2_) {}\n\n        __forceinline__ __device__ typename Op::result_type operator ()(typename TypeTraits<typename Op::first_argument_type>::ParameterType a) const\n        {\n            return op(a, arg2);\n        }\n\n        __host__ __device__ __forceinline__ binder2nd() {}\n        __host__ __device__ __forceinline__ binder2nd(const binder2nd& other) : op(other.op), arg2(other.arg2) {}\n\n        const Op op;\n        const typename Op::second_argument_type arg2;\n    };\n\n    template <typename Op, typename T> __host__ __device__ __forceinline__ binder2nd<Op> bind2nd(const Op& op, const T& x)\n    {\n        return binder2nd<Op>(op, typename Op::second_argument_type(x));\n    }\n\n    // Functor Traits\n    template <typename F> struct IsUnaryFunction\n    {\n        typedef char Yes;\n        struct No {Yes a[2];};\n\n        template <typename T, typename D> static Yes check(unary_function<T, D>);\n        static No check(...);\n\n        static F makeF();\n\n        enum { value = (sizeof(check(makeF())) == sizeof(Yes)) };\n    };\n\n    template <typename F> struct IsBinaryFunction\n    {\n        typedef char Yes;\n        struct No {Yes a[2];};\n\n        template <typename T1, typename T2, typename D> static Yes check(binary_function<T1, T2, D>);\n        static No check(...);\n\n        static F makeF();\n\n        enum { value = (sizeof(check(makeF())) == sizeof(Yes)) };\n    };\n\n    namespace functional_detail\n    {\n        template <size_t src_elem_size, size_t dst_elem_size> struct UnOpShift { enum { shift = 1 }; };\n        template <size_t src_elem_size> struct UnOpShift<src_elem_size, 1> { enum { shift = 4 }; };\n        template <size_t src_elem_size> struct UnOpShift<src_elem_size, 2> { enum { shift = 2 }; };\n\n        template <typename T, typename D> struct DefaultUnaryShift\n        {\n            enum { shift = UnOpShift<sizeof(T), sizeof(D)>::shift };\n        };\n\n        template <size_t src_elem_size1, size_t src_elem_size2, size_t dst_elem_size> struct BinOpShift { enum { shift = 1 }; };\n        template <size_t src_elem_size1, size_t src_elem_size2> struct BinOpShift<src_elem_size1, src_elem_size2, 1> { enum { shift = 4 }; };\n        template <size_t src_elem_size1, size_t src_elem_size2> struct BinOpShift<src_elem_size1, src_elem_size2, 2> { enum { shift = 2 }; };\n\n        template <typename T1, typename T2, typename D> struct DefaultBinaryShift\n        {\n            enum { shift = BinOpShift<sizeof(T1), sizeof(T2), sizeof(D)>::shift };\n        };\n\n        template <typename Func, bool unary = IsUnaryFunction<Func>::value> struct ShiftDispatcher;\n        template <typename Func> struct ShiftDispatcher<Func, true>\n        {\n            enum { shift = DefaultUnaryShift<typename Func::argument_type, typename Func::result_type>::shift };\n        };\n        template <typename Func> struct ShiftDispatcher<Func, false>\n        {\n            enum { shift = DefaultBinaryShift<typename Func::first_argument_type, typename Func::second_argument_type, typename Func::result_type>::shift };\n        };\n    }\n\n    template <typename Func> struct DefaultTransformShift\n    {\n        enum { shift = functional_detail::ShiftDispatcher<Func>::shift };\n    };\n\n    template <typename Func> struct DefaultTransformFunctorTraits\n    {\n        enum { simple_block_dim_x = 16 };\n        enum { simple_block_dim_y = 16 };\n\n        enum { smart_block_dim_x = 16 };\n        enum { smart_block_dim_y = 16 };\n        enum { smart_shift = DefaultTransformShift<Func>::shift };\n    };\n\n    template <typename Func> struct TransformFunctorTraits : DefaultTransformFunctorTraits<Func> {};\n\n#define OPENCV_GPU_TRANSFORM_FUNCTOR_TRAITS(type) \\\n    template <> struct TransformFunctorTraits< type > : DefaultTransformFunctorTraits< type >\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_FUNCTIONAL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/limits.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_LIMITS_GPU_HPP__\n#define __OPENCV_GPU_LIMITS_GPU_HPP__\n\n#include <limits.h>\n#include <float.h>\n#include \"common.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n\ntemplate <class T> struct numeric_limits;\n\ntemplate <> struct numeric_limits<bool>\n{\n    __device__ __forceinline__ static bool min() { return false; }\n    __device__ __forceinline__ static bool max() { return true;  }\n    static const bool is_signed = false;\n};\n\ntemplate <> struct numeric_limits<signed char>\n{\n    __device__ __forceinline__ static signed char min() { return SCHAR_MIN; }\n    __device__ __forceinline__ static signed char max() { return SCHAR_MAX; }\n    static const bool is_signed = true;\n};\n\ntemplate <> struct numeric_limits<unsigned char>\n{\n    __device__ __forceinline__ static unsigned char min() { return 0; }\n    __device__ __forceinline__ static unsigned char max() { return UCHAR_MAX; }\n    static const bool is_signed = false;\n};\n\ntemplate <> struct numeric_limits<short>\n{\n    __device__ __forceinline__ static short min() { return SHRT_MIN; }\n    __device__ __forceinline__ static short max() { return SHRT_MAX; }\n    static const bool is_signed = true;\n};\n\ntemplate <> struct numeric_limits<unsigned short>\n{\n    __device__ __forceinline__ static unsigned short min() { return 0; }\n    __device__ __forceinline__ static unsigned short max() { return USHRT_MAX; }\n    static const bool is_signed = false;\n};\n\ntemplate <> struct numeric_limits<int>\n{\n    __device__ __forceinline__ static int min() { return INT_MIN; }\n    __device__ __forceinline__ static int max() { return INT_MAX; }\n    static const bool is_signed = true;\n};\n\ntemplate <> struct numeric_limits<unsigned int>\n{\n    __device__ __forceinline__ static unsigned int min() { return 0; }\n    __device__ __forceinline__ static unsigned int max() { return UINT_MAX; }\n    static const bool is_signed = false;\n};\n\ntemplate <> struct numeric_limits<float>\n{\n    __device__ __forceinline__ static float min() { return FLT_MIN; }\n    __device__ __forceinline__ static float max() { return FLT_MAX; }\n    __device__ __forceinline__ static float epsilon() { return FLT_EPSILON; }\n    static const bool is_signed = true;\n};\n\ntemplate <> struct numeric_limits<double>\n{\n    __device__ __forceinline__ static double min() { return DBL_MIN; }\n    __device__ __forceinline__ static double max() { return DBL_MAX; }\n    __device__ __forceinline__ static double epsilon() { return DBL_EPSILON; }\n    static const bool is_signed = true;\n};\n\n}}} // namespace cv { namespace gpu { namespace device {\n\n#endif // __OPENCV_GPU_LIMITS_GPU_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/reduce.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_REDUCE_HPP__\n#define __OPENCV_GPU_REDUCE_HPP__\n\n#include <thrust/tuple.h>\n#include \"detail/reduce.hpp\"\n#include \"detail/reduce_key_val.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    template <int N, typename T, class Op>\n    __device__ __forceinline__ void reduce(volatile T* smem, T& val, unsigned int tid, const Op& op)\n    {\n        reduce_detail::Dispatcher<N>::reductor::template reduce<volatile T*, T&, const Op&>(smem, val, tid, op);\n    }\n    template <int N,\n              typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9,\n              typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9,\n              class Op0, class Op1, class Op2, class Op3, class Op4, class Op5, class Op6, class Op7, class Op8, class Op9>\n    __device__ __forceinline__ void reduce(const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>& smem,\n                                           const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                           unsigned int tid,\n                                           const thrust::tuple<Op0, Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, Op9>& op)\n    {\n        reduce_detail::Dispatcher<N>::reductor::template reduce<\n                const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>&,\n                const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>&,\n                const thrust::tuple<Op0, Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, Op9>&>(smem, val, tid, op);\n    }\n\n    template <unsigned int N, typename K, typename V, class Cmp>\n    __device__ __forceinline__ void reduceKeyVal(volatile K* skeys, K& key, volatile V* svals, V& val, unsigned int tid, const Cmp& cmp)\n    {\n        reduce_key_val_detail::Dispatcher<N>::reductor::template reduce<volatile K*, K&, volatile V*, V&, const Cmp&>(skeys, key, svals, val, tid, cmp);\n    }\n    template <unsigned int N,\n              typename K,\n              typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n              typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n              class Cmp>\n    __device__ __forceinline__ void reduceKeyVal(volatile K* skeys, K& key,\n                                                 const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                                 const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                 unsigned int tid, const Cmp& cmp)\n    {\n        reduce_key_val_detail::Dispatcher<N>::reductor::template reduce<volatile K*, K&,\n                const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>&,\n                const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>&,\n                const Cmp&>(skeys, key, svals, val, tid, cmp);\n    }\n    template <unsigned int N,\n              typename KP0, typename KP1, typename KP2, typename KP3, typename KP4, typename KP5, typename KP6, typename KP7, typename KP8, typename KP9,\n              typename KR0, typename KR1, typename KR2, typename KR3, typename KR4, typename KR5, typename KR6, typename KR7, typename KR8, typename KR9,\n              typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n              typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n              class Cmp0, class Cmp1, class Cmp2, class Cmp3, class Cmp4, class Cmp5, class Cmp6, class Cmp7, class Cmp8, class Cmp9>\n    __device__ __forceinline__ void reduceKeyVal(const thrust::tuple<KP0, KP1, KP2, KP3, KP4, KP5, KP6, KP7, KP8, KP9>& skeys,\n                                                 const thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9>& key,\n                                                 const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                                 const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                 unsigned int tid,\n                                                 const thrust::tuple<Cmp0, Cmp1, Cmp2, Cmp3, Cmp4, Cmp5, Cmp6, Cmp7, Cmp8, Cmp9>& cmp)\n    {\n        reduce_key_val_detail::Dispatcher<N>::reductor::template reduce<\n                const thrust::tuple<KP0, KP1, KP2, KP3, KP4, KP5, KP6, KP7, KP8, KP9>&,\n                const thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9>&,\n                const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>&,\n                const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>&,\n                const thrust::tuple<Cmp0, Cmp1, Cmp2, Cmp3, Cmp4, Cmp5, Cmp6, Cmp7, Cmp8, Cmp9>&\n                >(skeys, key, svals, val, tid, cmp);\n    }\n\n    // smem_tuple\n\n    template <typename T0>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*>\n    smem_tuple(T0* t0)\n    {\n        return thrust::make_tuple((volatile T0*) t0);\n    }\n\n    template <typename T0, typename T1>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*>\n    smem_tuple(T0* t0, T1* t1)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1);\n    }\n\n    template <typename T0, typename T1, typename T2>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*>\n    smem_tuple(T0* t0, T1* t1, T2* t2)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*, volatile T6*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5, T6* t6)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5, (volatile T6*) t6);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*, volatile T6*, volatile T7*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5, T6* t6, T7* t7)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5, (volatile T6*) t6, (volatile T7*) t7);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*, volatile T6*, volatile T7*, volatile T8*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5, T6* t6, T7* t7, T8* t8)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5, (volatile T6*) t6, (volatile T7*) t7, (volatile T8*) t8);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*, volatile T6*, volatile T7*, volatile T8*, volatile T9*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5, T6* t6, T7* t7, T8* t8, T9* t9)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5, (volatile T6*) t6, (volatile T7*) t7, (volatile T8*) t8, (volatile T9*) t9);\n    }\n}}}\n\n#endif // __OPENCV_GPU_UTILITY_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/saturate_cast.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_SATURATE_CAST_HPP__\n#define __OPENCV_GPU_SATURATE_CAST_HPP__\n\n#include \"common.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(uchar v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(schar v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(ushort v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(short v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(uint v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(int v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(float v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(double v) { return _Tp(v); }\n\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(schar v)\n    {\n        uint res = 0;\n        int vi = v;\n        asm(\"cvt.sat.u8.s8 %0, %1;\" : \"=r\"(res) : \"r\"(vi));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(short v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u8.s16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(ushort v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u8.u16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(int v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u8.s32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(uint v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u8.u32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(float v)\n    {\n        uint res = 0;\n        asm(\"cvt.rni.sat.u8.f32 %0, %1;\" : \"=r\"(res) : \"f\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(double v)\n    {\n    #if __CUDA_ARCH__ >= 130\n        uint res = 0;\n        asm(\"cvt.rni.sat.u8.f64 %0, %1;\" : \"=r\"(res) : \"d\"(v));\n        return res;\n    #else\n        return saturate_cast<uchar>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(uchar v)\n    {\n        uint res = 0;\n        uint vi = v;\n        asm(\"cvt.sat.s8.u8 %0, %1;\" : \"=r\"(res) : \"r\"(vi));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(short v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.s8.s16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(ushort v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.s8.u16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(int v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.s8.s32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(uint v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.s8.u32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(float v)\n    {\n        uint res = 0;\n        asm(\"cvt.rni.sat.s8.f32 %0, %1;\" : \"=r\"(res) : \"f\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(double v)\n    {\n    #if __CUDA_ARCH__ >= 130\n        uint res = 0;\n        asm(\"cvt.rni.sat.s8.f64 %0, %1;\" : \"=r\"(res) : \"d\"(v));\n        return res;\n    #else\n        return saturate_cast<schar>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(schar v)\n    {\n        ushort res = 0;\n        int vi = v;\n        asm(\"cvt.sat.u16.s8 %0, %1;\" : \"=h\"(res) : \"r\"(vi));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(short v)\n    {\n        ushort res = 0;\n        asm(\"cvt.sat.u16.s16 %0, %1;\" : \"=h\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(int v)\n    {\n        ushort res = 0;\n        asm(\"cvt.sat.u16.s32 %0, %1;\" : \"=h\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(uint v)\n    {\n        ushort res = 0;\n        asm(\"cvt.sat.u16.u32 %0, %1;\" : \"=h\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(float v)\n    {\n        ushort res = 0;\n        asm(\"cvt.rni.sat.u16.f32 %0, %1;\" : \"=h\"(res) : \"f\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(double v)\n    {\n    #if __CUDA_ARCH__ >= 130\n        ushort res = 0;\n        asm(\"cvt.rni.sat.u16.f64 %0, %1;\" : \"=h\"(res) : \"d\"(v));\n        return res;\n    #else\n        return saturate_cast<ushort>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ short saturate_cast<short>(ushort v)\n    {\n        short res = 0;\n        asm(\"cvt.sat.s16.u16 %0, %1;\" : \"=h\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ short saturate_cast<short>(int v)\n    {\n        short res = 0;\n        asm(\"cvt.sat.s16.s32 %0, %1;\" : \"=h\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ short saturate_cast<short>(uint v)\n    {\n        short res = 0;\n        asm(\"cvt.sat.s16.u32 %0, %1;\" : \"=h\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ short saturate_cast<short>(float v)\n    {\n        short res = 0;\n        asm(\"cvt.rni.sat.s16.f32 %0, %1;\" : \"=h\"(res) : \"f\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ short saturate_cast<short>(double v)\n    {\n    #if __CUDA_ARCH__ >= 130\n        short res = 0;\n        asm(\"cvt.rni.sat.s16.f64 %0, %1;\" : \"=h\"(res) : \"d\"(v));\n        return res;\n    #else\n        return saturate_cast<short>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ int saturate_cast<int>(uint v)\n    {\n        int res = 0;\n        asm(\"cvt.sat.s32.u32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ int saturate_cast<int>(float v)\n    {\n        return __float2int_rn(v);\n    }\n    template<> __device__ __forceinline__ int saturate_cast<int>(double v)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130\n        return __double2int_rn(v);\n    #else\n        return saturate_cast<int>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(schar v)\n    {\n        uint res = 0;\n        int vi = v;\n        asm(\"cvt.sat.u32.s8 %0, %1;\" : \"=r\"(res) : \"r\"(vi));\n        return res;\n    }\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(short v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u32.s16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(int v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u32.s32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(float v)\n    {\n        return __float2uint_rn(v);\n    }\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(double v)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130\n        return __double2uint_rn(v);\n    #else\n        return saturate_cast<uint>((float)v);\n    #endif\n    }\n}}}\n\n#endif /* __OPENCV_GPU_SATURATE_CAST_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/scan.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_SCAN_HPP__\n#define __OPENCV_GPU_SCAN_HPP__\n\n#include \"opencv2/gpu/device/common.hpp\"\n#include \"opencv2/gpu/device/utility.hpp\"\n#include \"opencv2/gpu/device/warp.hpp\"\n#include \"opencv2/gpu/device/warp_shuffle.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    enum ScanKind { EXCLUSIVE = 0,  INCLUSIVE = 1 };\n\n    template <ScanKind Kind, typename T, typename F> struct WarpScan\n    {\n        __device__ __forceinline__ WarpScan() {}\n        __device__ __forceinline__ WarpScan(const WarpScan& other) { (void)other; }\n\n        __device__ __forceinline__ T operator()( volatile T *ptr , const unsigned int idx)\n        {\n            const unsigned int lane = idx & 31;\n            F op;\n\n            if ( lane >=  1) ptr [idx ] = op(ptr [idx -  1], ptr [idx]);\n            if ( lane >=  2) ptr [idx ] = op(ptr [idx -  2], ptr [idx]);\n            if ( lane >=  4) ptr [idx ] = op(ptr [idx -  4], ptr [idx]);\n            if ( lane >=  8) ptr [idx ] = op(ptr [idx -  8], ptr [idx]);\n            if ( lane >= 16) ptr [idx ] = op(ptr [idx - 16], ptr [idx]);\n\n            if( Kind == INCLUSIVE )\n                return ptr [idx];\n            else\n                return (lane > 0) ? ptr [idx - 1] : 0;\n        }\n\n        __device__ __forceinline__ unsigned int index(const unsigned int tid)\n        {\n            return tid;\n        }\n\n        __device__ __forceinline__ void init(volatile T *ptr){}\n\n        static const int warp_offset      = 0;\n\n        typedef WarpScan<INCLUSIVE, T, F>  merge;\n    };\n\n    template <ScanKind Kind , typename T, typename F> struct WarpScanNoComp\n    {\n        __device__ __forceinline__ WarpScanNoComp() {}\n        __device__ __forceinline__ WarpScanNoComp(const WarpScanNoComp& other) { (void)other; }\n\n        __device__ __forceinline__ T operator()( volatile T *ptr , const unsigned int idx)\n        {\n            const unsigned int lane = threadIdx.x & 31;\n            F op;\n\n            ptr [idx ] = op(ptr [idx -  1], ptr [idx]);\n            ptr [idx ] = op(ptr [idx -  2], ptr [idx]);\n            ptr [idx ] = op(ptr [idx -  4], ptr [idx]);\n            ptr [idx ] = op(ptr [idx -  8], ptr [idx]);\n            ptr [idx ] = op(ptr [idx - 16], ptr [idx]);\n\n            if( Kind == INCLUSIVE )\n                return ptr [idx];\n            else\n                return (lane > 0) ? ptr [idx - 1] : 0;\n        }\n\n        __device__ __forceinline__ unsigned int index(const unsigned int tid)\n        {\n            return (tid >> warp_log) * warp_smem_stride + 16 + (tid & warp_mask);\n        }\n\n        __device__ __forceinline__ void init(volatile T *ptr)\n        {\n            ptr[threadIdx.x] = 0;\n        }\n\n        static const int warp_smem_stride = 32 + 16 + 1;\n        static const int warp_offset      = 16;\n        static const int warp_log         = 5;\n        static const int warp_mask        = 31;\n\n        typedef WarpScanNoComp<INCLUSIVE, T, F> merge;\n    };\n\n    template <ScanKind Kind , typename T, typename Sc, typename F> struct BlockScan\n    {\n        __device__ __forceinline__ BlockScan() {}\n        __device__ __forceinline__ BlockScan(const BlockScan& other) { (void)other; }\n\n        __device__ __forceinline__ T operator()(volatile T *ptr)\n        {\n            const unsigned int tid  = threadIdx.x;\n            const unsigned int lane = tid & warp_mask;\n            const unsigned int warp = tid >> warp_log;\n\n            Sc scan;\n            typename Sc::merge merge_scan;\n            const unsigned int idx = scan.index(tid);\n\n            T val = scan(ptr, idx);\n            __syncthreads ();\n\n            if( warp == 0)\n                scan.init(ptr);\n            __syncthreads ();\n\n            if( lane == 31 )\n                ptr [scan.warp_offset + warp ] = (Kind == INCLUSIVE) ? val : ptr [idx];\n            __syncthreads ();\n\n            if( warp == 0 )\n                merge_scan(ptr, idx);\n            __syncthreads();\n\n            if ( warp > 0)\n                val = ptr [scan.warp_offset + warp - 1] + val;\n            __syncthreads ();\n\n            ptr[idx] = val;\n            __syncthreads ();\n\n            return val ;\n        }\n\n        static const int warp_log  = 5;\n        static const int warp_mask = 31;\n    };\n\n    template <typename T>\n    __device__ T warpScanInclusive(T idata, volatile T* s_Data, unsigned int tid)\n    {\n    #if __CUDA_ARCH__ >= 300\n        const unsigned int laneId = cv::gpu::device::Warp::laneId();\n\n        // scan on shuffl functions\n        #pragma unroll\n        for (int i = 1; i <= (OPENCV_GPU_WARP_SIZE / 2); i *= 2)\n        {\n            const T n = cv::gpu::device::shfl_up(idata, i);\n            if (laneId >= i)\n                  idata += n;\n        }\n\n        return idata;\n    #else\n        unsigned int pos = 2 * tid - (tid & (OPENCV_GPU_WARP_SIZE - 1));\n        s_Data[pos] = 0;\n        pos += OPENCV_GPU_WARP_SIZE;\n        s_Data[pos] = idata;\n\n        s_Data[pos] += s_Data[pos - 1];\n        s_Data[pos] += s_Data[pos - 2];\n        s_Data[pos] += s_Data[pos - 4];\n        s_Data[pos] += s_Data[pos - 8];\n        s_Data[pos] += s_Data[pos - 16];\n\n        return s_Data[pos];\n    #endif\n    }\n\n    template <typename T>\n    __device__ __forceinline__ T warpScanExclusive(T idata, volatile T* s_Data, unsigned int tid)\n    {\n        return warpScanInclusive(idata, s_Data, tid) - idata;\n    }\n\n    template <int tiNumScanThreads, typename T>\n    __device__ T blockScanInclusive(T idata, volatile T* s_Data, unsigned int tid)\n    {\n        if (tiNumScanThreads > OPENCV_GPU_WARP_SIZE)\n        {\n            //Bottom-level inclusive warp scan\n            T warpResult = warpScanInclusive(idata, s_Data, tid);\n\n            //Save top elements of each warp for exclusive warp scan\n            //sync to wait for warp scans to complete (because s_Data is being overwritten)\n            __syncthreads();\n            if ((tid & (OPENCV_GPU_WARP_SIZE - 1)) == (OPENCV_GPU_WARP_SIZE - 1))\n            {\n                s_Data[tid >> OPENCV_GPU_LOG_WARP_SIZE] = warpResult;\n            }\n\n            //wait for warp scans to complete\n            __syncthreads();\n\n            if (tid < (tiNumScanThreads / OPENCV_GPU_WARP_SIZE) )\n            {\n                //grab top warp elements\n                T val = s_Data[tid];\n                //calculate exclusive scan and write back to shared memory\n                s_Data[tid] = warpScanExclusive(val, s_Data, tid);\n            }\n\n            //return updated warp scans with exclusive scan results\n            __syncthreads();\n\n            return warpResult + s_Data[tid >> OPENCV_GPU_LOG_WARP_SIZE];\n        }\n        else\n        {\n            return warpScanInclusive(idata, s_Data, tid);\n        }\n    }\n}}}\n\n#endif // __OPENCV_GPU_SCAN_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/simd_functions.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n/*\n * Copyright (c) 2013 NVIDIA Corporation. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n *   Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n *\n *   Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n *\n *   Neither the name of NVIDIA Corporation nor the names of its contributors\n *   may be used to endorse or promote products derived from this software\n *   without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __OPENCV_GPU_SIMD_FUNCTIONS_HPP__\n#define __OPENCV_GPU_SIMD_FUNCTIONS_HPP__\n\n#include \"common.hpp\"\n\n/*\n  This header file contains inline functions that implement intra-word SIMD\n  operations, that are hardware accelerated on sm_3x (Kepler) GPUs. Efficient\n  emulation code paths are provided for earlier architectures (sm_1x, sm_2x)\n  to make the code portable across all GPUs supported by CUDA. The following\n  functions are currently implemented:\n\n  vadd2(a,b)      per-halfword unsigned addition, with wrap-around: a + b\n  vsub2(a,b)      per-halfword unsigned subtraction, with wrap-around: a - b\n  vabsdiff2(a,b)  per-halfword unsigned absolute difference: |a - b|\n  vavg2(a,b)      per-halfword unsigned average: (a + b) / 2\n  vavrg2(a,b)     per-halfword unsigned rounded average: (a + b + 1) / 2\n  vseteq2(a,b)    per-halfword unsigned comparison: a == b ? 1 : 0\n  vcmpeq2(a,b)    per-halfword unsigned comparison: a == b ? 0xffff : 0\n  vsetge2(a,b)    per-halfword unsigned comparison: a >= b ? 1 : 0\n  vcmpge2(a,b)    per-halfword unsigned comparison: a >= b ? 0xffff : 0\n  vsetgt2(a,b)    per-halfword unsigned comparison: a > b ? 1 : 0\n  vcmpgt2(a,b)    per-halfword unsigned comparison: a > b ? 0xffff : 0\n  vsetle2(a,b)    per-halfword unsigned comparison: a <= b ? 1 : 0\n  vcmple2(a,b)    per-halfword unsigned comparison: a <= b ? 0xffff : 0\n  vsetlt2(a,b)    per-halfword unsigned comparison: a < b ? 1 : 0\n  vcmplt2(a,b)    per-halfword unsigned comparison: a < b ? 0xffff : 0\n  vsetne2(a,b)    per-halfword unsigned comparison: a != b ? 1 : 0\n  vcmpne2(a,b)    per-halfword unsigned comparison: a != b ? 0xffff : 0\n  vmax2(a,b)      per-halfword unsigned maximum: max(a, b)\n  vmin2(a,b)      per-halfword unsigned minimum: min(a, b)\n\n  vadd4(a,b)      per-byte unsigned addition, with wrap-around: a + b\n  vsub4(a,b)      per-byte unsigned subtraction, with wrap-around: a - b\n  vabsdiff4(a,b)  per-byte unsigned absolute difference: |a - b|\n  vavg4(a,b)      per-byte unsigned average: (a + b) / 2\n  vavrg4(a,b)     per-byte unsigned rounded average: (a + b + 1) / 2\n  vseteq4(a,b)    per-byte unsigned comparison: a == b ? 1 : 0\n  vcmpeq4(a,b)    per-byte unsigned comparison: a == b ? 0xff : 0\n  vsetge4(a,b)    per-byte unsigned comparison: a >= b ? 1 : 0\n  vcmpge4(a,b)    per-byte unsigned comparison: a >= b ? 0xff : 0\n  vsetgt4(a,b)    per-byte unsigned comparison: a > b ? 1 : 0\n  vcmpgt4(a,b)    per-byte unsigned comparison: a > b ? 0xff : 0\n  vsetle4(a,b)    per-byte unsigned comparison: a <= b ? 1 : 0\n  vcmple4(a,b)    per-byte unsigned comparison: a <= b ? 0xff : 0\n  vsetlt4(a,b)    per-byte unsigned comparison: a < b ? 1 : 0\n  vcmplt4(a,b)    per-byte unsigned comparison: a < b ? 0xff : 0\n  vsetne4(a,b)    per-byte unsigned comparison: a != b ? 1: 0\n  vcmpne4(a,b)    per-byte unsigned comparison: a != b ? 0xff: 0\n  vmax4(a,b)      per-byte unsigned maximum: max(a, b)\n  vmin4(a,b)      per-byte unsigned minimum: min(a, b)\n*/\n\nnamespace cv { namespace gpu { namespace device\n{\n    // 2\n\n    static __device__ __forceinline__ unsigned int vadd2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vadd2.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vadd.u32.u32.u32.sat %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vadd.u32.u32.u32.sat %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = a ^ b;          // sum bits\n        r = a + b;          // actual sum\n        s = s ^ r;          // determine carry-ins for each bit position\n        s = s & 0x00010000; // carry-in to high word (= carry-out from low word)\n        r = r - s;          // subtract out carry-out from low word\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsub2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vsub2.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vsub.u32.u32.u32.sat %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vsub.u32.u32.u32.sat %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = a ^ b;          // sum bits\n        r = a - b;          // actual sum\n        s = s ^ r;          // determine carry-ins for each bit position\n        s = s & 0x00010000; // borrow to high word\n        r = r + s;          // compensate for borrow from low word\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vabsdiff2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vabsdiff2.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vabsdiff.u32.u32.u32.sat %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vabsdiff.u32.u32.u32.sat %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t, u, v;\n        s = a & 0x0000ffff; // extract low halfword\n        r = b & 0x0000ffff; // extract low halfword\n        u = ::max(r, s);    // maximum of low halfwords\n        v = ::min(r, s);    // minimum of low halfwords\n        s = a & 0xffff0000; // extract high halfword\n        r = b & 0xffff0000; // extract high halfword\n        t = ::max(r, s);    // maximum of high halfwords\n        s = ::min(r, s);    // minimum of high halfwords\n        r = u | t;          // maximum of both halfwords\n        s = v | s;          // minimum of both halfwords\n        r = r - s;          // |a - b| = max(a,b) - min(a,b);\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vavg2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, s;\n\n        // HAKMEM #23: a + b = 2 * (a & b) + (a ^ b) ==>\n        // (a + b) / 2 = (a & b) + ((a ^ b) >> 1)\n        s = a ^ b;\n        r = a & b;\n        s = s & 0xfffefffe; // ensure shift doesn't cross halfword boundaries\n        s = s >> 1;\n        s = r + s;\n\n        return s;\n    }\n\n    static __device__ __forceinline__ unsigned int vavrg2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vavrg2.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // HAKMEM #23: a + b = 2 * (a | b) - (a ^ b) ==>\n        // (a + b + 1) / 2 = (a | b) - ((a ^ b) >> 1)\n        unsigned int s;\n        s = a ^ b;\n        r = a | b;\n        s = s & 0xfffefffe; // ensure shift doesn't cross half-word boundaries\n        s = s >> 1;\n        r = r - s;\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vseteq2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.eq %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        unsigned int c;\n        r = a ^ b;          // 0x0000 if a == b\n        c = r | 0x80008000; // set msbs, to catch carry out\n        r = r ^ c;          // extract msbs, msb = 1 if r < 0x8000\n        c = c - 0x00010001; // msb = 0, if r was 0x0000 or 0x8000\n        c = r & ~c;         // msb = 1, if r was 0x0000\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpeq2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vseteq2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        r = a ^ b;          // 0x0000 if a == b\n        c = r | 0x80008000; // set msbs, to catch carry out\n        r = r ^ c;          // extract msbs, msb = 1 if r < 0x8000\n        c = c - 0x00010001; // msb = 0, if r was 0x0000 or 0x8000\n        c = r & ~c;         // msb = 1, if r was 0x0000\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetge2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.ge %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavrg2(a, b);   // (a + ~b + 1) / 2 = (a - b) / 2\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpge2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetge2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavrg2(a, b);   // (a + ~b + 1) / 2 = (a - b) / 2\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetgt2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.gt %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavg2(a, b);    // (a + ~b) / 2 = (a - b) / 2 [rounded down]\n        c = c & 0x80008000; // msbs = carry-outs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpgt2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetgt2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavg2(a, b);    // (a + ~b) / 2 = (a - b) / 2 [rounded down]\n        c = c & 0x80008000; // msbs = carry-outs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetle2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.le %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavrg2(a, b);   // (b + ~a + 1) / 2 = (b - a) / 2\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmple2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetle2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavrg2(a, b);   // (b + ~a + 1) / 2 = (b - a) / 2\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetlt2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.lt %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavg2(a, b);    // (b + ~a) / 2 = (b - a) / 2 [rounded down]\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmplt2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetlt2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavg2(a, b);    // (b + ~a) / 2 = (b - a) / 2 [rounded down]\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetne2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm (\"vset2.u32.u32.ne %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        unsigned int c;\n        r = a ^ b;          // 0x0000 if a == b\n        c = r | 0x80008000; // set msbs, to catch carry out\n        c = c - 0x00010001; // msb = 0, if r was 0x0000 or 0x8000\n        c = r | c;          // msb = 1, if r was not 0x0000\n        c = c & 0x80008000; // extract msbs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpne2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetne2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        r = a ^ b;          // 0x0000 if a == b\n        c = r | 0x80008000; // set msbs, to catch carry out\n        c = c - 0x00010001; // msb = 0, if r was 0x0000 or 0x8000\n        c = r | c;          // msb = 1, if r was not 0x0000\n        c = c & 0x80008000; // extract msbs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vmax2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vmax2.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vmax.u32.u32.u32 %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmax.u32.u32.u32 %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t, u;\n        r = a & 0x0000ffff; // extract low halfword\n        s = b & 0x0000ffff; // extract low halfword\n        t = ::max(r, s);    // maximum of low halfwords\n        r = a & 0xffff0000; // extract high halfword\n        s = b & 0xffff0000; // extract high halfword\n        u = ::max(r, s);    // maximum of high halfwords\n        r = t | u;          // combine halfword maximums\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vmin2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vmin2.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vmin.u32.u32.u32 %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmin.u32.u32.u32 %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t, u;\n        r = a & 0x0000ffff; // extract low halfword\n        s = b & 0x0000ffff; // extract low halfword\n        t = ::min(r, s);    // minimum of low halfwords\n        r = a & 0xffff0000; // extract high halfword\n        s = b & 0xffff0000; // extract high halfword\n        u = ::min(r, s);    // minimum of high halfwords\n        r = t | u;          // combine halfword minimums\n    #endif\n\n        return r;\n    }\n\n    // 4\n\n    static __device__ __forceinline__ unsigned int vadd4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vadd4.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vadd.u32.u32.u32.sat %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vadd.u32.u32.u32.sat %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vadd.u32.u32.u32.sat %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vadd.u32.u32.u32.sat %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t;\n        s = a ^ b;          // sum bits\n        r = a & 0x7f7f7f7f; // clear msbs\n        t = b & 0x7f7f7f7f; // clear msbs\n        s = s & 0x80808080; // msb sum bits\n        r = r + t;          // add without msbs, record carry-out in msbs\n        r = r ^ s;          // sum of msb sum and carry-in bits, w/o carry-out\n    #endif /* __CUDA_ARCH__ >= 300 */\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsub4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vsub4.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vsub.u32.u32.u32.sat %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vsub.u32.u32.u32.sat %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vsub.u32.u32.u32.sat %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vsub.u32.u32.u32.sat %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t;\n        s = a ^ ~b;         // inverted sum bits\n        r = a | 0x80808080; // set msbs\n        t = b & 0x7f7f7f7f; // clear msbs\n        s = s & 0x80808080; // inverted msb sum bits\n        r = r - t;          // subtract w/o msbs, record inverted borrows in msb\n        r = r ^ s;          // combine inverted msb sum bits and borrows\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vavg4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, s;\n\n        // HAKMEM #23: a + b = 2 * (a & b) + (a ^ b) ==>\n        // (a + b) / 2 = (a & b) + ((a ^ b) >> 1)\n        s = a ^ b;\n        r = a & b;\n        s = s & 0xfefefefe; // ensure following shift doesn't cross byte boundaries\n        s = s >> 1;\n        s = r + s;\n\n        return s;\n    }\n\n    static __device__ __forceinline__ unsigned int vavrg4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vavrg4.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // HAKMEM #23: a + b = 2 * (a | b) - (a ^ b) ==>\n        // (a + b + 1) / 2 = (a | b) - ((a ^ b) >> 1)\n        unsigned int c;\n        c = a ^ b;\n        r = a | b;\n        c = c & 0xfefefefe; // ensure following shift doesn't cross byte boundaries\n        c = c >> 1;\n        r = r - c;\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vseteq4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.eq %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        unsigned int c;\n        r = a ^ b;          // 0x00 if a == b\n        c = r | 0x80808080; // set msbs, to catch carry out\n        r = r ^ c;          // extract msbs, msb = 1 if r < 0x80\n        c = c - 0x01010101; // msb = 0, if r was 0x00 or 0x80\n        c = r & ~c;         // msb = 1, if r was 0x00\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpeq4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, t;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vseteq4(a, b);\n        t = r << 8;         // convert bool\n        r = t - r;          //  to mask\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        t = a ^ b;          // 0x00 if a == b\n        r = t | 0x80808080; // set msbs, to catch carry out\n        t = t ^ r;          // extract msbs, msb = 1 if t < 0x80\n        r = r - 0x01010101; // msb = 0, if t was 0x00 or 0x80\n        r = t & ~r;         // msb = 1, if t was 0x00\n        t = r >> 7;         // build mask\n        t = r - t;          //  from\n        r = t | r;          //   msbs\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetle4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.le %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavrg4(a, b);   // (b + ~a + 1) / 2 = (b - a) / 2\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmple4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetle4(a, b);\n        c = r << 8;         // convert bool\n        r = c - r;          //  to mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavrg4(a, b);   // (b + ~a + 1) / 2 = (b - a) / 2\n        c = c & 0x80808080; // msbs = carry-outs\n        r = c >> 7;         // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetlt4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.lt %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavg4(a, b);    // (b + ~a) / 2 = (b - a) / 2 [rounded down]\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmplt4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetlt4(a, b);\n        c = r << 8;         // convert bool\n        r = c - r;          //  to mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavg4(a, b);    // (b + ~a) / 2 = (b - a) / 2 [rounded down]\n        c = c & 0x80808080; // msbs = carry-outs\n        r = c >> 7;         // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetge4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.ge %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavrg4(a, b);   // (a + ~b + 1) / 2 = (a - b) / 2\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpge4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, s;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetge4(a, b);\n        s = r << 8;         // convert bool\n        r = s - r;          //  to mask\n    #else\n        asm (\"not.b32 %0,%0;\" : \"+r\"(b));\n        r = vavrg4 (a, b);  // (a + ~b + 1) / 2 = (a - b) / 2\n        r = r & 0x80808080; // msb = carry-outs\n        s = r >> 7;         // build mask\n        s = r - s;          //  from\n        r = s | r;          //   msbs\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetgt4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.gt %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavg4(a, b);    // (a + ~b) / 2 = (a - b) / 2 [rounded down]\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpgt4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetgt4(a, b);\n        c = r << 8;         // convert bool\n        r = c - r;          //  to mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavg4(a, b);    // (a + ~b) / 2 = (a - b) / 2 [rounded down]\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetne4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.ne %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        unsigned int c;\n        r = a ^ b;          // 0x00 if a == b\n        c = r | 0x80808080; // set msbs, to catch carry out\n        c = c - 0x01010101; // msb = 0, if r was 0x00 or 0x80\n        c = r | c;          // msb = 1, if r was not 0x00\n        c = c & 0x80808080; // extract msbs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpne4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetne4(a, b);\n        c = r << 8;         // convert bool\n        r = c - r;          //  to mask\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        r = a ^ b;          // 0x00 if a == b\n        c = r | 0x80808080; // set msbs, to catch carry out\n        c = c - 0x01010101; // msb = 0, if r was 0x00 or 0x80\n        c = r | c;          // msb = 1, if r was not 0x00\n        c = c & 0x80808080; // extract msbs\n        r = c >> 7;         // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vabsdiff4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vabsdiff4.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vabsdiff.u32.u32.u32.sat %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vabsdiff.u32.u32.u32.sat %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vabsdiff.u32.u32.u32.sat %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vabsdiff.u32.u32.u32.sat %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = vcmpge4(a, b);  // mask = 0xff if a >= b\n        r = a ^ b;          //\n        s = (r &  s) ^ b;   // select a when a >= b, else select b => max(a,b)\n        r = s ^ r;          // select a when b >= a, else select b => min(a,b)\n        r = s - r;          // |a - b| = max(a,b) - min(a,b);\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vmax4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vmax4.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vmax.u32.u32.u32 %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmax.u32.u32.u32 %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmax.u32.u32.u32 %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmax.u32.u32.u32 %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = vcmpge4(a, b);  // mask = 0xff if a >= b\n        r = a & s;          // select a when b >= a\n        s = b & ~s;         // select b when b < a\n        r = r | s;          // combine byte selections\n    #endif\n\n        return r;           // byte-wise unsigned maximum\n    }\n\n    static __device__ __forceinline__ unsigned int vmin4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vmin4.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vmin.u32.u32.u32 %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmin.u32.u32.u32 %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmin.u32.u32.u32 %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmin.u32.u32.u32 %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = vcmpge4(b, a);  // mask = 0xff if a >= b\n        r = a & s;          // select a when b >= a\n        s = b & ~s;         // select b when b < a\n        r = r | s;          // combine byte selections\n    #endif\n\n        return r;\n    }\n}}}\n\n#endif // __OPENCV_GPU_SIMD_FUNCTIONS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/static_check.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_GPU_DEVICE_STATIC_CHECK_HPP__\n#define __OPENCV_GPU_GPU_DEVICE_STATIC_CHECK_HPP__\n\n#if defined(__CUDACC__)\n    #define __OPENCV_GPU_HOST_DEVICE__ __host__ __device__ __forceinline__\n#else\n    #define __OPENCV_GPU_HOST_DEVICE__\n#endif\n\nnamespace cv { namespace gpu\n{\n    namespace device\n    {\n        template<bool expr> struct Static {};\n\n        template<> struct Static<true>\n        {\n            __OPENCV_GPU_HOST_DEVICE__ static void check() {};\n        };\n    }\n}}\n\n#undef __OPENCV_GPU_HOST_DEVICE__\n\n#endif /* __OPENCV_GPU_GPU_DEVICE_STATIC_CHECK_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/transform.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_TRANSFORM_HPP__\n#define __OPENCV_GPU_TRANSFORM_HPP__\n\n#include \"common.hpp\"\n#include \"utility.hpp\"\n#include \"detail/transform_detail.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    template <typename T, typename D, typename UnOp, typename Mask>\n    static inline void transform(PtrStepSz<T> src, PtrStepSz<D> dst, UnOp op, const Mask& mask, cudaStream_t stream)\n    {\n        typedef TransformFunctorTraits<UnOp> ft;\n        transform_detail::TransformDispatcher<VecTraits<T>::cn == 1 && VecTraits<D>::cn == 1 && ft::smart_shift != 1>::call(src, dst, op, mask, stream);\n    }\n\n    template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n    static inline void transform(PtrStepSz<T1> src1, PtrStepSz<T2> src2, PtrStepSz<D> dst, BinOp op, const Mask& mask, cudaStream_t stream)\n    {\n        typedef TransformFunctorTraits<BinOp> ft;\n        transform_detail::TransformDispatcher<VecTraits<T1>::cn == 1 && VecTraits<T2>::cn == 1 && VecTraits<D>::cn == 1 && ft::smart_shift != 1>::call(src1, src2, dst, op, mask, stream);\n    }\n}}}\n\n#endif // __OPENCV_GPU_TRANSFORM_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/type_traits.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_TYPE_TRAITS_HPP__\n#define __OPENCV_GPU_TYPE_TRAITS_HPP__\n\n#include \"detail/type_traits_detail.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    template <typename T> struct IsSimpleParameter\n    {\n        enum {value = type_traits_detail::IsIntegral<T>::value || type_traits_detail::IsFloat<T>::value ||\n            type_traits_detail::PointerTraits<typename type_traits_detail::ReferenceTraits<T>::type>::value};\n    };\n\n    template <typename T> struct TypeTraits\n    {\n        typedef typename type_traits_detail::UnConst<T>::type                                                NonConstType;\n        typedef typename type_traits_detail::UnVolatile<T>::type                                             NonVolatileType;\n        typedef typename type_traits_detail::UnVolatile<typename type_traits_detail::UnConst<T>::type>::type UnqualifiedType;\n        typedef typename type_traits_detail::PointerTraits<UnqualifiedType>::type                            PointeeType;\n        typedef typename type_traits_detail::ReferenceTraits<T>::type                                        ReferredType;\n\n        enum { isConst          = type_traits_detail::UnConst<T>::value };\n        enum { isVolatile       = type_traits_detail::UnVolatile<T>::value };\n\n        enum { isReference      = type_traits_detail::ReferenceTraits<UnqualifiedType>::value };\n        enum { isPointer        = type_traits_detail::PointerTraits<typename type_traits_detail::ReferenceTraits<UnqualifiedType>::type>::value };\n\n        enum { isUnsignedInt    = type_traits_detail::IsUnsignedIntegral<UnqualifiedType>::value };\n        enum { isSignedInt      = type_traits_detail::IsSignedIntergral<UnqualifiedType>::value };\n        enum { isIntegral       = type_traits_detail::IsIntegral<UnqualifiedType>::value };\n        enum { isFloat          = type_traits_detail::IsFloat<UnqualifiedType>::value };\n        enum { isArith          = isIntegral || isFloat };\n        enum { isVec            = type_traits_detail::IsVec<UnqualifiedType>::value };\n\n        typedef typename type_traits_detail::Select<IsSimpleParameter<UnqualifiedType>::value,\n            T, typename type_traits_detail::AddParameterType<T>::type>::type ParameterType;\n    };\n}}}\n\n#endif // __OPENCV_GPU_TYPE_TRAITS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/utility.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_UTILITY_HPP__\n#define __OPENCV_GPU_UTILITY_HPP__\n\n#include \"saturate_cast.hpp\"\n#include \"datamov_utils.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    #define OPENCV_GPU_LOG_WARP_SIZE        (5)\n    #define OPENCV_GPU_WARP_SIZE            (1 << OPENCV_GPU_LOG_WARP_SIZE)\n    #define OPENCV_GPU_LOG_MEM_BANKS        ((__CUDA_ARCH__ >= 200) ? 5 : 4) // 32 banks on fermi, 16 on tesla\n    #define OPENCV_GPU_MEM_BANKS            (1 << OPENCV_GPU_LOG_MEM_BANKS)\n\n    ///////////////////////////////////////////////////////////////////////////////\n    // swap\n\n    template <typename T> void __device__ __host__ __forceinline__ swap(T& a, T& b)\n    {\n        const T temp = a;\n        a = b;\n        b = temp;\n    }\n\n    ///////////////////////////////////////////////////////////////////////////////\n    // Mask Reader\n\n    struct SingleMask\n    {\n        explicit __host__ __device__ __forceinline__ SingleMask(PtrStepb mask_) : mask(mask_) {}\n        __host__ __device__ __forceinline__ SingleMask(const SingleMask& mask_): mask(mask_.mask){}\n\n        __device__ __forceinline__ bool operator()(int y, int x) const\n        {\n            return mask.ptr(y)[x] != 0;\n        }\n\n        PtrStepb mask;\n    };\n\n    struct SingleMaskChannels\n    {\n        __host__ __device__ __forceinline__ SingleMaskChannels(PtrStepb mask_, int channels_)\n        : mask(mask_), channels(channels_) {}\n        __host__ __device__ __forceinline__ SingleMaskChannels(const SingleMaskChannels& mask_)\n            :mask(mask_.mask), channels(mask_.channels){}\n\n        __device__ __forceinline__ bool operator()(int y, int x) const\n        {\n            return mask.ptr(y)[x / channels] != 0;\n        }\n\n        PtrStepb mask;\n        int channels;\n    };\n\n    struct MaskCollection\n    {\n        explicit __host__ __device__ __forceinline__ MaskCollection(PtrStepb* maskCollection_)\n            : maskCollection(maskCollection_) {}\n\n        __device__ __forceinline__ MaskCollection(const MaskCollection& masks_)\n            : maskCollection(masks_.maskCollection), curMask(masks_.curMask){}\n\n        __device__ __forceinline__ void next()\n        {\n            curMask = *maskCollection++;\n        }\n        __device__ __forceinline__ void setMask(int z)\n        {\n            curMask = maskCollection[z];\n        }\n\n        __device__ __forceinline__ bool operator()(int y, int x) const\n        {\n            uchar val;\n            return curMask.data == 0 || (ForceGlob<uchar>::Load(curMask.ptr(y), x, val), (val != 0));\n        }\n\n        const PtrStepb* maskCollection;\n        PtrStepb curMask;\n    };\n\n    struct WithOutMask\n    {\n        __host__ __device__ __forceinline__ WithOutMask(){}\n        __host__ __device__ __forceinline__ WithOutMask(const WithOutMask&){}\n\n        __device__ __forceinline__ void next() const\n        {\n        }\n        __device__ __forceinline__ void setMask(int) const\n        {\n        }\n\n        __device__ __forceinline__ bool operator()(int, int) const\n        {\n            return true;\n        }\n\n        __device__ __forceinline__ bool operator()(int, int, int) const\n        {\n            return true;\n        }\n\n        static __device__ __forceinline__ bool check(int, int)\n        {\n            return true;\n        }\n\n        static __device__ __forceinline__ bool check(int, int, int)\n        {\n            return true;\n        }\n    };\n\n    ///////////////////////////////////////////////////////////////////////////////\n    // Solve linear system\n\n    // solve 2x2 linear system Ax=b\n    template <typename T> __device__ __forceinline__ bool solve2x2(const T A[2][2], const T b[2], T x[2])\n    {\n        T det = A[0][0] * A[1][1] - A[1][0] * A[0][1];\n\n        if (det != 0)\n        {\n            double invdet = 1.0 / det;\n\n            x[0] = saturate_cast<T>(invdet * (b[0] * A[1][1] - b[1] * A[0][1]));\n\n            x[1] = saturate_cast<T>(invdet * (A[0][0] * b[1] - A[1][0] * b[0]));\n\n            return true;\n        }\n\n        return false;\n    }\n\n    // solve 3x3 linear system Ax=b\n    template <typename T> __device__ __forceinline__ bool solve3x3(const T A[3][3], const T b[3], T x[3])\n    {\n        T det = A[0][0] * (A[1][1] * A[2][2] - A[1][2] * A[2][1])\n              - A[0][1] * (A[1][0] * A[2][2] - A[1][2] * A[2][0])\n              + A[0][2] * (A[1][0] * A[2][1] - A[1][1] * A[2][0]);\n\n        if (det != 0)\n        {\n            double invdet = 1.0 / det;\n\n            x[0] = saturate_cast<T>(invdet *\n                (b[0]    * (A[1][1] * A[2][2] - A[1][2] * A[2][1]) -\n                 A[0][1] * (b[1]    * A[2][2] - A[1][2] * b[2]   ) +\n                 A[0][2] * (b[1]    * A[2][1] - A[1][1] * b[2]   )));\n\n            x[1] = saturate_cast<T>(invdet *\n                (A[0][0] * (b[1]    * A[2][2] - A[1][2] * b[2]   ) -\n                 b[0]    * (A[1][0] * A[2][2] - A[1][2] * A[2][0]) +\n                 A[0][2] * (A[1][0] * b[2]    - b[1]    * A[2][0])));\n\n            x[2] = saturate_cast<T>(invdet *\n                (A[0][0] * (A[1][1] * b[2]    - b[1]    * A[2][1]) -\n                 A[0][1] * (A[1][0] * b[2]    - b[1]    * A[2][0]) +\n                 b[0]    * (A[1][0] * A[2][1] - A[1][1] * A[2][0])));\n\n            return true;\n        }\n\n        return false;\n    }\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_UTILITY_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/vec_distance.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_VEC_DISTANCE_HPP__\n#define __OPENCV_GPU_VEC_DISTANCE_HPP__\n\n#include \"reduce.hpp\"\n#include \"functional.hpp\"\n#include \"detail/vec_distance_detail.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    template <typename T> struct L1Dist\n    {\n        typedef int value_type;\n        typedef int result_type;\n\n        __device__ __forceinline__ L1Dist() : mySum(0) {}\n\n        __device__ __forceinline__ void reduceIter(int val1, int val2)\n        {\n            mySum = __sad(val1, val2, mySum);\n        }\n\n        template <int THREAD_DIM> __device__ __forceinline__ void reduceAll(int* smem, int tid)\n        {\n            reduce<THREAD_DIM>(smem, mySum, tid, plus<int>());\n        }\n\n        __device__ __forceinline__ operator int() const\n        {\n            return mySum;\n        }\n\n        int mySum;\n    };\n    template <> struct L1Dist<float>\n    {\n        typedef float value_type;\n        typedef float result_type;\n\n        __device__ __forceinline__ L1Dist() : mySum(0.0f) {}\n\n        __device__ __forceinline__ void reduceIter(float val1, float val2)\n        {\n            mySum += ::fabs(val1 - val2);\n        }\n\n        template <int THREAD_DIM> __device__ __forceinline__ void reduceAll(float* smem, int tid)\n        {\n            reduce<THREAD_DIM>(smem, mySum, tid, plus<float>());\n        }\n\n        __device__ __forceinline__ operator float() const\n        {\n            return mySum;\n        }\n\n        float mySum;\n    };\n\n    struct L2Dist\n    {\n        typedef float value_type;\n        typedef float result_type;\n\n        __device__ __forceinline__ L2Dist() : mySum(0.0f) {}\n\n        __device__ __forceinline__ void reduceIter(float val1, float val2)\n        {\n            float reg = val1 - val2;\n            mySum += reg * reg;\n        }\n\n        template <int THREAD_DIM> __device__ __forceinline__ void reduceAll(float* smem, int tid)\n        {\n            reduce<THREAD_DIM>(smem, mySum, tid, plus<float>());\n        }\n\n        __device__ __forceinline__ operator float() const\n        {\n            return sqrtf(mySum);\n        }\n\n        float mySum;\n    };\n\n    struct HammingDist\n    {\n        typedef int value_type;\n        typedef int result_type;\n\n        __device__ __forceinline__ HammingDist() : mySum(0) {}\n\n        __device__ __forceinline__ void reduceIter(int val1, int val2)\n        {\n            mySum += __popc(val1 ^ val2);\n        }\n\n        template <int THREAD_DIM> __device__ __forceinline__ void reduceAll(int* smem, int tid)\n        {\n            reduce<THREAD_DIM>(smem, mySum, tid, plus<int>());\n        }\n\n        __device__ __forceinline__ operator int() const\n        {\n            return mySum;\n        }\n\n        int mySum;\n    };\n\n    // calc distance between two vectors in global memory\n    template <int THREAD_DIM, typename Dist, typename T1, typename T2>\n    __device__ void calcVecDiffGlobal(const T1* vec1, const T2* vec2, int len, Dist& dist, typename Dist::result_type* smem, int tid)\n    {\n        for (int i = tid; i < len; i += THREAD_DIM)\n        {\n            T1 val1;\n            ForceGlob<T1>::Load(vec1, i, val1);\n\n            T2 val2;\n            ForceGlob<T2>::Load(vec2, i, val2);\n\n            dist.reduceIter(val1, val2);\n        }\n\n        dist.reduceAll<THREAD_DIM>(smem, tid);\n    }\n\n    // calc distance between two vectors, first vector is cached in register or shared memory, second vector is in global memory\n    template <int THREAD_DIM, int MAX_LEN, bool LEN_EQ_MAX_LEN, typename Dist, typename T1, typename T2>\n    __device__ __forceinline__ void calcVecDiffCached(const T1* vecCached, const T2* vecGlob, int len, Dist& dist, typename Dist::result_type* smem, int tid)\n    {\n        vec_distance_detail::VecDiffCachedCalculator<THREAD_DIM, MAX_LEN, LEN_EQ_MAX_LEN>::calc(vecCached, vecGlob, len, dist, tid);\n\n        dist.reduceAll<THREAD_DIM>(smem, tid);\n    }\n\n    // calc distance between two vectors in global memory\n    template <int THREAD_DIM, typename T1> struct VecDiffGlobal\n    {\n        explicit __device__ __forceinline__ VecDiffGlobal(const T1* vec1_, int = 0, void* = 0, int = 0, int = 0)\n        {\n            vec1 = vec1_;\n        }\n\n        template <typename T2, typename Dist>\n        __device__ __forceinline__ void calc(const T2* vec2, int len, Dist& dist, typename Dist::result_type* smem, int tid) const\n        {\n            calcVecDiffGlobal<THREAD_DIM>(vec1, vec2, len, dist, smem, tid);\n        }\n\n        const T1* vec1;\n    };\n\n    // calc distance between two vectors, first vector is cached in register memory, second vector is in global memory\n    template <int THREAD_DIM, int MAX_LEN, bool LEN_EQ_MAX_LEN, typename U> struct VecDiffCachedRegister\n    {\n        template <typename T1> __device__ __forceinline__ VecDiffCachedRegister(const T1* vec1, int len, U* smem, int glob_tid, int tid)\n        {\n            if (glob_tid < len)\n                smem[glob_tid] = vec1[glob_tid];\n            __syncthreads();\n\n            U* vec1ValsPtr = vec1Vals;\n\n            #pragma unroll\n            for (int i = tid; i < MAX_LEN; i += THREAD_DIM)\n                *vec1ValsPtr++ = smem[i];\n\n            __syncthreads();\n        }\n\n        template <typename T2, typename Dist>\n        __device__ __forceinline__ void calc(const T2* vec2, int len, Dist& dist, typename Dist::result_type* smem, int tid) const\n        {\n            calcVecDiffCached<THREAD_DIM, MAX_LEN, LEN_EQ_MAX_LEN>(vec1Vals, vec2, len, dist, smem, tid);\n        }\n\n        U vec1Vals[MAX_LEN / THREAD_DIM];\n    };\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_VEC_DISTANCE_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/vec_math.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_VECMATH_HPP__\n#define __OPENCV_GPU_VECMATH_HPP__\n\n#include \"vec_traits.hpp\"\n#include \"saturate_cast.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n\n// saturate_cast\n\nnamespace vec_math_detail\n{\n    template <int cn, typename VecD> struct SatCastHelper;\n    template <typename VecD> struct SatCastHelper<1, VecD>\n    {\n        template <typename VecS> static __device__ __forceinline__ VecD cast(const VecS& v)\n        {\n            typedef typename VecTraits<VecD>::elem_type D;\n            return VecTraits<VecD>::make(saturate_cast<D>(v.x));\n        }\n    };\n    template <typename VecD> struct SatCastHelper<2, VecD>\n    {\n        template <typename VecS> static __device__ __forceinline__ VecD cast(const VecS& v)\n        {\n            typedef typename VecTraits<VecD>::elem_type D;\n            return VecTraits<VecD>::make(saturate_cast<D>(v.x), saturate_cast<D>(v.y));\n        }\n    };\n    template <typename VecD> struct SatCastHelper<3, VecD>\n    {\n        template <typename VecS> static __device__ __forceinline__ VecD cast(const VecS& v)\n        {\n            typedef typename VecTraits<VecD>::elem_type D;\n            return VecTraits<VecD>::make(saturate_cast<D>(v.x), saturate_cast<D>(v.y), saturate_cast<D>(v.z));\n        }\n    };\n    template <typename VecD> struct SatCastHelper<4, VecD>\n    {\n        template <typename VecS> static __device__ __forceinline__ VecD cast(const VecS& v)\n        {\n            typedef typename VecTraits<VecD>::elem_type D;\n            return VecTraits<VecD>::make(saturate_cast<D>(v.x), saturate_cast<D>(v.y), saturate_cast<D>(v.z), saturate_cast<D>(v.w));\n        }\n    };\n\n    template <typename VecD, typename VecS> static __device__ __forceinline__ VecD saturate_cast_helper(const VecS& v)\n    {\n        return SatCastHelper<VecTraits<VecD>::cn, VecD>::cast(v);\n    }\n}\n\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uchar1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const char1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const ushort1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const short1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uint1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const int1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const float1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const double1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\n\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uchar2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const char2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const ushort2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const short2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uint2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const int2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const float2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const double2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\n\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uchar3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const char3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const ushort3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const short3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uint3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const int3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const float3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const double3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\n\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uchar4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const char4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const ushort4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const short4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uint4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const int4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const float4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const double4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\n\n// unary operators\n\n#define CV_CUDEV_IMPLEMENT_VEC_UNARY_OP(op, input_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 operator op(const input_type ## 1 & a) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(op (a.x)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 operator op(const input_type ## 2 & a) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(op (a.x), op (a.y)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 operator op(const input_type ## 3 & a) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(op (a.x), op (a.y), op (a.z)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 operator op(const input_type ## 4 & a) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(op (a.x), op (a.y), op (a.z), op (a.w)); \\\n    }\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, char, char)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, short, short)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, int, int)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, char, char)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, short, short)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, int, int)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, uint, uint)\n\n#undef CV_CUDEV_IMPLEMENT_VEC_UNARY_OP\n\n// unary functions\n\n#define CV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(func_name, func, input_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 func_name(const input_type ## 1 & a) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(func (a.x)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 func_name(const input_type ## 2 & a) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(func (a.x), func (a.y)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 func_name(const input_type ## 3 & a) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(func (a.x), func (a.y), func (a.z)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 func_name(const input_type ## 4 & a) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(func (a.x), func (a.y), func (a.z), func (a.w)); \\\n    }\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(abs, /*::abs*/, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(abs, ::abs, char, char)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(abs, /*::abs*/, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(abs, ::abs, short, short)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(abs, ::abs, int, int)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(abs, /*::abs*/, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(abs, ::fabsf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(abs, ::fabs, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrt, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::exp, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::log, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sin, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cos, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tan, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asin, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acos, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atan, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::cosh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acosh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanh, double, double)\n\n#undef CV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC\n\n// binary operators (vec & vec)\n\n#define CV_CUDEV_IMPLEMENT_VEC_BINARY_OP(op, input_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 operator op(const input_type ## 1 & a, const input_type ## 1 & b) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(a.x op b.x); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 operator op(const input_type ## 2 & a, const input_type ## 2 & b) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(a.x op b.x, a.y op b.y); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 operator op(const input_type ## 3 & a, const input_type ## 3 & b) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(a.x op b.x, a.y op b.y, a.z op b.z); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 operator op(const input_type ## 4 & a, const input_type ## 4 & b) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(a.x op b.x, a.y op b.y, a.z op b.z, a.w op b.w); \\\n    }\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, uchar, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, char, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, ushort, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, short, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, uchar, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, char, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, ushort, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, short, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, uchar, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, char, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, ushort, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, short, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, uchar, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, char, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, ushort, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, short, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, uint, uint)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, uint, uint)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, uint, uint)\n\n#undef CV_CUDEV_IMPLEMENT_VEC_BINARY_OP\n\n// binary operators (vec & scalar)\n\n#define CV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(op, input_type, scalar_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 operator op(const input_type ## 1 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(a.x op s); \\\n    } \\\n    __device__ __forceinline__ output_type ## 1 operator op(scalar_type s, const input_type ## 1 & b) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(s op b.x); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 operator op(const input_type ## 2 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(a.x op s, a.y op s); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 operator op(scalar_type s, const input_type ## 2 & b) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(s op b.x, s op b.y); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 operator op(const input_type ## 3 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(a.x op s, a.y op s, a.z op s); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 operator op(scalar_type s, const input_type ## 3 & b) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(s op b.x, s op b.y, s op b.z); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 operator op(const input_type ## 4 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(a.x op s, a.y op s, a.z op s, a.w op s); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 operator op(scalar_type s, const input_type ## 4 & b) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(s op b.x, s op b.y, s op b.z, s op b.w); \\\n    }\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uchar, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, char, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, ushort, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, short, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uchar, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, char, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, ushort, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, short, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uchar, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, char, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, ushort, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, short, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uchar, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, char, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, ushort, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, short, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, uint, uint, uint)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, uint, uint, uint)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, uint, uint, uint)\n\n#undef CV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP\n\n// binary function (vec & vec)\n\n#define CV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(func_name, func, input_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 func_name(const input_type ## 1 & a, const input_type ## 1 & b) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(func (a.x, b.x)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 func_name(const input_type ## 2 & a, const input_type ## 2 & b) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(func (a.x, b.x), func (a.y, b.y)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 func_name(const input_type ## 3 & a, const input_type ## 3 & b) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(func (a.x, b.x), func (a.y, b.y), func (a.z, b.z)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 func_name(const input_type ## 4 & a, const input_type ## 4 & b) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(func (a.x, b.x), func (a.y, b.y), func (a.z, b.z), func (a.w, b.w)); \\\n    }\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::fmaxf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::fmax, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::fminf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::fmin, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypot, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2, double, double)\n\n#undef CV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC\n\n// binary function (vec & scalar)\n\n#define CV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(func_name, func, input_type, scalar_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 func_name(const input_type ## 1 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(func ((output_type) a.x, (output_type) s)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 1 func_name(scalar_type s, const input_type ## 1 & b) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(func ((output_type) s, (output_type) b.x)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 func_name(const input_type ## 2 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(func ((output_type) a.x, (output_type) s), func ((output_type) a.y, (output_type) s)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 func_name(scalar_type s, const input_type ## 2 & b) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(func ((output_type) s, (output_type) b.x), func ((output_type) s, (output_type) b.y)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 func_name(const input_type ## 3 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(func ((output_type) a.x, (output_type) s), func ((output_type) a.y, (output_type) s), func ((output_type) a.z, (output_type) s)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 func_name(scalar_type s, const input_type ## 3 & b) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(func ((output_type) s, (output_type) b.x), func ((output_type) s, (output_type) b.y), func ((output_type) s, (output_type) b.z)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 func_name(const input_type ## 4 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(func ((output_type) a.x, (output_type) s), func ((output_type) a.y, (output_type) s), func ((output_type) a.z, (output_type) s), func ((output_type) a.w, (output_type) s)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 func_name(scalar_type s, const input_type ## 4 & b) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(func ((output_type) s, (output_type) b.x), func ((output_type) s, (output_type) b.y), func ((output_type) s, (output_type) b.z), func ((output_type) s, (output_type) b.w)); \\\n    }\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, double, double, double)\n\n#undef CV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC\n\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_VECMATH_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/vec_traits.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_VEC_TRAITS_HPP__\n#define __OPENCV_GPU_VEC_TRAITS_HPP__\n\n#include \"common.hpp\"\n\nnamespace cv { namespace gpu { namespace device\n{\n    template<typename T, int N> struct TypeVec;\n\n    struct __align__(8) uchar8\n    {\n        uchar a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ uchar8 make_uchar8(uchar a0, uchar a1, uchar a2, uchar a3, uchar a4, uchar a5, uchar a6, uchar a7)\n    {\n        uchar8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(8) char8\n    {\n        schar a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ char8 make_char8(schar a0, schar a1, schar a2, schar a3, schar a4, schar a5, schar a6, schar a7)\n    {\n        char8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(16) ushort8\n    {\n        ushort a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ ushort8 make_ushort8(ushort a0, ushort a1, ushort a2, ushort a3, ushort a4, ushort a5, ushort a6, ushort a7)\n    {\n        ushort8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(16) short8\n    {\n        short a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ short8 make_short8(short a0, short a1, short a2, short a3, short a4, short a5, short a6, short a7)\n    {\n        short8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(32) uint8\n    {\n        uint a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ uint8 make_uint8(uint a0, uint a1, uint a2, uint a3, uint a4, uint a5, uint a6, uint a7)\n    {\n        uint8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(32) int8\n    {\n        int a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ int8 make_int8(int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7)\n    {\n        int8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(32) float8\n    {\n        float a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ float8 make_float8(float a0, float a1, float a2, float a3, float a4, float a5, float a6, float a7)\n    {\n        float8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct double8\n    {\n        double a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ double8 make_double8(double a0, double a1, double a2, double a3, double a4, double a5, double a6, double a7)\n    {\n        double8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n\n#define OPENCV_GPU_IMPLEMENT_TYPE_VEC(type) \\\n    template<> struct TypeVec<type, 1> { typedef type vec_type; }; \\\n    template<> struct TypeVec<type ## 1, 1> { typedef type ## 1 vec_type; }; \\\n    template<> struct TypeVec<type, 2> { typedef type ## 2 vec_type; }; \\\n    template<> struct TypeVec<type ## 2, 2> { typedef type ## 2 vec_type; }; \\\n    template<> struct TypeVec<type, 3> { typedef type ## 3 vec_type; }; \\\n    template<> struct TypeVec<type ## 3, 3> { typedef type ## 3 vec_type; }; \\\n    template<> struct TypeVec<type, 4> { typedef type ## 4 vec_type; }; \\\n    template<> struct TypeVec<type ## 4, 4> { typedef type ## 4 vec_type; }; \\\n    template<> struct TypeVec<type, 8> { typedef type ## 8 vec_type; }; \\\n    template<> struct TypeVec<type ## 8, 8> { typedef type ## 8 vec_type; };\n\n    OPENCV_GPU_IMPLEMENT_TYPE_VEC(uchar)\n    OPENCV_GPU_IMPLEMENT_TYPE_VEC(char)\n    OPENCV_GPU_IMPLEMENT_TYPE_VEC(ushort)\n    OPENCV_GPU_IMPLEMENT_TYPE_VEC(short)\n    OPENCV_GPU_IMPLEMENT_TYPE_VEC(int)\n    OPENCV_GPU_IMPLEMENT_TYPE_VEC(uint)\n    OPENCV_GPU_IMPLEMENT_TYPE_VEC(float)\n    OPENCV_GPU_IMPLEMENT_TYPE_VEC(double)\n\n    #undef OPENCV_GPU_IMPLEMENT_TYPE_VEC\n\n    template<> struct TypeVec<schar, 1> { typedef schar vec_type; };\n    template<> struct TypeVec<schar, 2> { typedef char2 vec_type; };\n    template<> struct TypeVec<schar, 3> { typedef char3 vec_type; };\n    template<> struct TypeVec<schar, 4> { typedef char4 vec_type; };\n    template<> struct TypeVec<schar, 8> { typedef char8 vec_type; };\n\n    template<> struct TypeVec<bool, 1> { typedef uchar vec_type; };\n    template<> struct TypeVec<bool, 2> { typedef uchar2 vec_type; };\n    template<> struct TypeVec<bool, 3> { typedef uchar3 vec_type; };\n    template<> struct TypeVec<bool, 4> { typedef uchar4 vec_type; };\n    template<> struct TypeVec<bool, 8> { typedef uchar8 vec_type; };\n\n    template<typename T> struct VecTraits;\n\n#define OPENCV_GPU_IMPLEMENT_VEC_TRAITS(type) \\\n    template<> struct VecTraits<type> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=1}; \\\n        static __device__ __host__ __forceinline__ type all(type v) {return v;} \\\n        static __device__ __host__ __forceinline__ type make(type x) {return x;} \\\n        static __device__ __host__ __forceinline__ type make(const type* v) {return *v;} \\\n    }; \\\n    template<> struct VecTraits<type ## 1> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=1}; \\\n        static __device__ __host__ __forceinline__ type ## 1 all(type v) {return make_ ## type ## 1(v);} \\\n        static __device__ __host__ __forceinline__ type ## 1 make(type x) {return make_ ## type ## 1(x);} \\\n        static __device__ __host__ __forceinline__ type ## 1 make(const type* v) {return make_ ## type ## 1(*v);} \\\n    }; \\\n    template<> struct VecTraits<type ## 2> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=2}; \\\n        static __device__ __host__ __forceinline__ type ## 2 all(type v) {return make_ ## type ## 2(v, v);} \\\n        static __device__ __host__ __forceinline__ type ## 2 make(type x, type y) {return make_ ## type ## 2(x, y);} \\\n        static __device__ __host__ __forceinline__ type ## 2 make(const type* v) {return make_ ## type ## 2(v[0], v[1]);} \\\n    }; \\\n    template<> struct VecTraits<type ## 3> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=3}; \\\n        static __device__ __host__ __forceinline__ type ## 3 all(type v) {return make_ ## type ## 3(v, v, v);} \\\n        static __device__ __host__ __forceinline__ type ## 3 make(type x, type y, type z) {return make_ ## type ## 3(x, y, z);} \\\n        static __device__ __host__ __forceinline__ type ## 3 make(const type* v) {return make_ ## type ## 3(v[0], v[1], v[2]);} \\\n    }; \\\n    template<> struct VecTraits<type ## 4> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=4}; \\\n        static __device__ __host__ __forceinline__ type ## 4 all(type v) {return make_ ## type ## 4(v, v, v, v);} \\\n        static __device__ __host__ __forceinline__ type ## 4 make(type x, type y, type z, type w) {return make_ ## type ## 4(x, y, z, w);} \\\n        static __device__ __host__ __forceinline__ type ## 4 make(const type* v) {return make_ ## type ## 4(v[0], v[1], v[2], v[3]);} \\\n    }; \\\n    template<> struct VecTraits<type ## 8> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=8}; \\\n        static __device__ __host__ __forceinline__ type ## 8 all(type v) {return make_ ## type ## 8(v, v, v, v, v, v, v, v);} \\\n        static __device__ __host__ __forceinline__ type ## 8 make(type a0, type a1, type a2, type a3, type a4, type a5, type a6, type a7) {return make_ ## type ## 8(a0, a1, a2, a3, a4, a5, a6, a7);} \\\n        static __device__ __host__ __forceinline__ type ## 8 make(const type* v) {return make_ ## type ## 8(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);} \\\n    };\n\n    OPENCV_GPU_IMPLEMENT_VEC_TRAITS(uchar)\n    OPENCV_GPU_IMPLEMENT_VEC_TRAITS(ushort)\n    OPENCV_GPU_IMPLEMENT_VEC_TRAITS(short)\n    OPENCV_GPU_IMPLEMENT_VEC_TRAITS(int)\n    OPENCV_GPU_IMPLEMENT_VEC_TRAITS(uint)\n    OPENCV_GPU_IMPLEMENT_VEC_TRAITS(float)\n    OPENCV_GPU_IMPLEMENT_VEC_TRAITS(double)\n\n    #undef OPENCV_GPU_IMPLEMENT_VEC_TRAITS\n\n    template<> struct VecTraits<char>\n    {\n        typedef char elem_type;\n        enum {cn=1};\n        static __device__ __host__ __forceinline__ char all(char v) {return v;}\n        static __device__ __host__ __forceinline__ char make(char x) {return x;}\n        static __device__ __host__ __forceinline__ char make(const char* x) {return *x;}\n    };\n    template<> struct VecTraits<schar>\n    {\n        typedef schar elem_type;\n        enum {cn=1};\n        static __device__ __host__ __forceinline__ schar all(schar v) {return v;}\n        static __device__ __host__ __forceinline__ schar make(schar x) {return x;}\n        static __device__ __host__ __forceinline__ schar make(const schar* x) {return *x;}\n    };\n    template<> struct VecTraits<char1>\n    {\n        typedef schar elem_type;\n        enum {cn=1};\n        static __device__ __host__ __forceinline__ char1 all(schar v) {return make_char1(v);}\n        static __device__ __host__ __forceinline__ char1 make(schar x) {return make_char1(x);}\n        static __device__ __host__ __forceinline__ char1 make(const schar* v) {return make_char1(v[0]);}\n    };\n    template<> struct VecTraits<char2>\n    {\n        typedef schar elem_type;\n        enum {cn=2};\n        static __device__ __host__ __forceinline__ char2 all(schar v) {return make_char2(v, v);}\n        static __device__ __host__ __forceinline__ char2 make(schar x, schar y) {return make_char2(x, y);}\n        static __device__ __host__ __forceinline__ char2 make(const schar* v) {return make_char2(v[0], v[1]);}\n    };\n    template<> struct VecTraits<char3>\n    {\n        typedef schar elem_type;\n        enum {cn=3};\n        static __device__ __host__ __forceinline__ char3 all(schar v) {return make_char3(v, v, v);}\n        static __device__ __host__ __forceinline__ char3 make(schar x, schar y, schar z) {return make_char3(x, y, z);}\n        static __device__ __host__ __forceinline__ char3 make(const schar* v) {return make_char3(v[0], v[1], v[2]);}\n    };\n    template<> struct VecTraits<char4>\n    {\n        typedef schar elem_type;\n        enum {cn=4};\n        static __device__ __host__ __forceinline__ char4 all(schar v) {return make_char4(v, v, v, v);}\n        static __device__ __host__ __forceinline__ char4 make(schar x, schar y, schar z, schar w) {return make_char4(x, y, z, w);}\n        static __device__ __host__ __forceinline__ char4 make(const schar* v) {return make_char4(v[0], v[1], v[2], v[3]);}\n    };\n    template<> struct VecTraits<char8>\n    {\n        typedef schar elem_type;\n        enum {cn=8};\n        static __device__ __host__ __forceinline__ char8 all(schar v) {return make_char8(v, v, v, v, v, v, v, v);}\n        static __device__ __host__ __forceinline__ char8 make(schar a0, schar a1, schar a2, schar a3, schar a4, schar a5, schar a6, schar a7) {return make_char8(a0, a1, a2, a3, a4, a5, a6, a7);}\n        static __device__ __host__ __forceinline__ char8 make(const schar* v) {return make_char8(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);}\n    };\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif // __OPENCV_GPU_VEC_TRAITS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/warp.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_DEVICE_WARP_HPP__\n#define __OPENCV_GPU_DEVICE_WARP_HPP__\n\nnamespace cv { namespace gpu { namespace device\n{\n    struct Warp\n    {\n        enum\n        {\n            LOG_WARP_SIZE = 5,\n            WARP_SIZE     = 1 << LOG_WARP_SIZE,\n            STRIDE        = WARP_SIZE\n        };\n\n        /** \\brief Returns the warp lane ID of the calling thread. */\n        static __device__ __forceinline__ unsigned int laneId()\n        {\n            unsigned int ret;\n            asm(\"mov.u32 %0, %laneid;\" : \"=r\"(ret) );\n            return ret;\n        }\n\n        template<typename It, typename T>\n        static __device__ __forceinline__ void fill(It beg, It end, const T& value)\n        {\n            for(It t = beg + laneId(); t < end; t += STRIDE)\n                *t = value;\n        }\n\n        template<typename InIt, typename OutIt>\n        static __device__ __forceinline__ OutIt copy(InIt beg, InIt end, OutIt out)\n        {\n            for(InIt t = beg + laneId(); t < end; t += STRIDE, out += STRIDE)\n                *out = *t;\n            return out;\n        }\n\n        template<typename InIt, typename OutIt, class UnOp>\n        static __device__ __forceinline__ OutIt transform(InIt beg, InIt end, OutIt out, UnOp op)\n        {\n            for(InIt t = beg + laneId(); t < end; t += STRIDE, out += STRIDE)\n                *out = op(*t);\n            return out;\n        }\n\n        template<typename InIt1, typename InIt2, typename OutIt, class BinOp>\n        static __device__ __forceinline__ OutIt transform(InIt1 beg1, InIt1 end1, InIt2 beg2, OutIt out, BinOp op)\n        {\n            unsigned int lane = laneId();\n\n            InIt1 t1 = beg1 + lane;\n            InIt2 t2 = beg2 + lane;\n            for(; t1 < end1; t1 += STRIDE, t2 += STRIDE, out += STRIDE)\n                *out = op(*t1, *t2);\n            return out;\n        }\n\n        template <class T, class BinOp>\n        static __device__ __forceinline__ T reduce(volatile T *ptr, BinOp op)\n        {\n            const unsigned int lane = laneId();\n\n            if (lane < 16)\n            {\n                T partial = ptr[lane];\n\n                ptr[lane] = partial = op(partial, ptr[lane + 16]);\n                ptr[lane] = partial = op(partial, ptr[lane + 8]);\n                ptr[lane] = partial = op(partial, ptr[lane + 4]);\n                ptr[lane] = partial = op(partial, ptr[lane + 2]);\n                ptr[lane] = partial = op(partial, ptr[lane + 1]);\n            }\n\n            return *ptr;\n        }\n\n        template<typename OutIt, typename T>\n        static __device__ __forceinline__ void yota(OutIt beg, OutIt end, T value)\n        {\n            unsigned int lane = laneId();\n            value += lane;\n\n            for(OutIt t = beg + lane; t < end; t += STRIDE, value += STRIDE)\n                *t = value;\n        }\n    };\n}}} // namespace cv { namespace gpu { namespace device\n\n#endif /* __OPENCV_GPU_DEVICE_WARP_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/warp_reduce.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_GPU_WARP_REDUCE_HPP__\n#define OPENCV_GPU_WARP_REDUCE_HPP__\n\nnamespace cv { namespace gpu { namespace device\n{\n    template <class T>\n    __device__ __forceinline__ T warp_reduce(volatile T *ptr , const unsigned int tid = threadIdx.x)\n    {\n        const unsigned int lane = tid & 31; // index of thread in warp (0..31)\n\n        if (lane < 16)\n        {\n            T partial = ptr[tid];\n\n            ptr[tid] = partial = partial + ptr[tid + 16];\n            ptr[tid] = partial = partial + ptr[tid + 8];\n            ptr[tid] = partial = partial + ptr[tid + 4];\n            ptr[tid] = partial = partial + ptr[tid + 2];\n            ptr[tid] = partial = partial + ptr[tid + 1];\n        }\n\n        return ptr[tid - lane];\n    }\n}}} // namespace cv { namespace gpu { namespace device {\n\n#endif /* OPENCV_GPU_WARP_REDUCE_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/device/warp_shuffle.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_WARP_SHUFFLE_HPP__\n#define __OPENCV_GPU_WARP_SHUFFLE_HPP__\n\nnamespace cv { namespace gpu { namespace device\n{\n    template <typename T>\n    __device__ __forceinline__ T shfl(T val, int srcLane, int width = warpSize)\n    {\n    #if __CUDA_ARCH__ >= 300\n        return __shfl(val, srcLane, width);\n    #else\n        return T();\n    #endif\n    }\n    __device__ __forceinline__ unsigned int shfl(unsigned int val, int srcLane, int width = warpSize)\n    {\n    #if __CUDA_ARCH__ >= 300\n        return (unsigned int) __shfl((int) val, srcLane, width);\n    #else\n        return 0;\n    #endif\n    }\n    __device__ __forceinline__ double shfl(double val, int srcLane, int width = warpSize)\n    {\n    #if __CUDA_ARCH__ >= 300\n        int lo = __double2loint(val);\n        int hi = __double2hiint(val);\n\n        lo = __shfl(lo, srcLane, width);\n        hi = __shfl(hi, srcLane, width);\n\n        return __hiloint2double(hi, lo);\n    #else\n        return 0.0;\n    #endif\n    }\n\n    template <typename T>\n    __device__ __forceinline__ T shfl_down(T val, unsigned int delta, int width = warpSize)\n    {\n    #if __CUDA_ARCH__ >= 300\n        return __shfl_down(val, delta, width);\n    #else\n        return T();\n    #endif\n    }\n    __device__ __forceinline__ unsigned int shfl_down(unsigned int val, unsigned int delta, int width = warpSize)\n    {\n    #if __CUDA_ARCH__ >= 300\n        return (unsigned int) __shfl_down((int) val, delta, width);\n    #else\n        return 0;\n    #endif\n    }\n    __device__ __forceinline__ double shfl_down(double val, unsigned int delta, int width = warpSize)\n    {\n    #if __CUDA_ARCH__ >= 300\n        int lo = __double2loint(val);\n        int hi = __double2hiint(val);\n\n        lo = __shfl_down(lo, delta, width);\n        hi = __shfl_down(hi, delta, width);\n\n        return __hiloint2double(hi, lo);\n    #else\n        return 0.0;\n    #endif\n    }\n\n    template <typename T>\n    __device__ __forceinline__ T shfl_up(T val, unsigned int delta, int width = warpSize)\n    {\n    #if __CUDA_ARCH__ >= 300\n        return __shfl_up(val, delta, width);\n    #else\n        return T();\n    #endif\n    }\n    __device__ __forceinline__ unsigned int shfl_up(unsigned int val, unsigned int delta, int width = warpSize)\n    {\n    #if __CUDA_ARCH__ >= 300\n        return (unsigned int) __shfl_up((int) val, delta, width);\n    #else\n        return 0;\n    #endif\n    }\n    __device__ __forceinline__ double shfl_up(double val, unsigned int delta, int width = warpSize)\n    {\n    #if __CUDA_ARCH__ >= 300\n        int lo = __double2loint(val);\n        int hi = __double2hiint(val);\n\n        lo = __shfl_up(lo, delta, width);\n        hi = __shfl_up(hi, delta, width);\n\n        return __hiloint2double(hi, lo);\n    #else\n        return 0.0;\n    #endif\n    }\n}}}\n\n#endif // __OPENCV_GPU_WARP_SHUFFLE_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/devmem2d.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#include \"opencv2/core/cuda_devptrs.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/gpu.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_HPP__\n#define __OPENCV_GPU_HPP__\n\n#ifndef SKIP_INCLUDES\n#include <vector>\n#include <memory>\n#include <iosfwd>\n#endif\n\n#include \"opencv2/core/gpumat.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/objdetect/objdetect.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n\nnamespace cv { namespace gpu {\n\n//////////////////////////////// CudaMem ////////////////////////////////\n// CudaMem is limited cv::Mat with page locked memory allocation.\n// Page locked memory is only needed for async and faster coping to GPU.\n// It is convertable to cv::Mat header without reference counting\n// so you can use it with other opencv functions.\n\n// Page-locks the matrix m memory and maps it for the device(s)\nCV_EXPORTS void registerPageLocked(Mat& m);\n// Unmaps the memory of matrix m, and makes it pageable again.\nCV_EXPORTS void unregisterPageLocked(Mat& m);\n\nclass CV_EXPORTS CudaMem\n{\npublic:\n    enum  { ALLOC_PAGE_LOCKED = 1, ALLOC_ZEROCOPY = 2, ALLOC_WRITE_COMBINED = 4 };\n\n    CudaMem();\n    CudaMem(const CudaMem& m);\n\n    CudaMem(int rows, int cols, int type, int _alloc_type = ALLOC_PAGE_LOCKED);\n    CudaMem(Size size, int type, int alloc_type = ALLOC_PAGE_LOCKED);\n\n\n    //! creates from cv::Mat with coping data\n    explicit CudaMem(const Mat& m, int alloc_type = ALLOC_PAGE_LOCKED);\n\n    ~CudaMem();\n\n    CudaMem& operator = (const CudaMem& m);\n\n    //! returns deep copy of the matrix, i.e. the data is copied\n    CudaMem clone() const;\n\n    //! allocates new matrix data unless the matrix already has specified size and type.\n    void create(int rows, int cols, int type, int alloc_type = ALLOC_PAGE_LOCKED);\n    void create(Size size, int type, int alloc_type = ALLOC_PAGE_LOCKED);\n\n    //! decrements reference counter and released memory if needed.\n    void release();\n\n    //! returns matrix header with disabled reference counting for CudaMem data.\n    Mat createMatHeader() const;\n    operator Mat() const;\n\n    //! maps host memory into device address space and returns GpuMat header for it. Throws exception if not supported by hardware.\n    GpuMat createGpuMatHeader() const;\n    operator GpuMat() const;\n\n    //returns if host memory can be mapperd to gpu address space;\n    static bool canMapHostMemory();\n\n    // Please see cv::Mat for descriptions\n    bool isContinuous() const;\n    size_t elemSize() const;\n    size_t elemSize1() const;\n    int type() const;\n    int depth() const;\n    int channels() const;\n    size_t step1() const;\n    Size size() const;\n    bool empty() const;\n\n\n    // Please see cv::Mat for descriptions\n    int flags;\n    int rows, cols;\n    size_t step;\n\n    uchar* data;\n    int* refcount;\n\n    uchar* datastart;\n    uchar* dataend;\n\n    int alloc_type;\n};\n\n//////////////////////////////// CudaStream ////////////////////////////////\n// Encapculates Cuda Stream. Provides interface for async coping.\n// Passed to each function that supports async kernel execution.\n// Reference counting is enabled\n\nclass CV_EXPORTS Stream\n{\npublic:\n    Stream();\n    ~Stream();\n\n    Stream(const Stream&);\n    Stream& operator =(const Stream&);\n\n    bool queryIfComplete();\n    void waitForCompletion();\n\n    //! downloads asynchronously\n    // Warning! cv::Mat must point to page locked memory (i.e. to CudaMem data or to its subMat)\n    void enqueueDownload(const GpuMat& src, CudaMem& dst);\n    void enqueueDownload(const GpuMat& src, Mat& dst);\n\n    //! uploads asynchronously\n    // Warning! cv::Mat must point to page locked memory (i.e. to CudaMem data or to its ROI)\n    void enqueueUpload(const CudaMem& src, GpuMat& dst);\n    void enqueueUpload(const Mat& src, GpuMat& dst);\n\n    //! copy asynchronously\n    void enqueueCopy(const GpuMat& src, GpuMat& dst);\n\n    //! memory set asynchronously\n    void enqueueMemSet(GpuMat& src, Scalar val);\n    void enqueueMemSet(GpuMat& src, Scalar val, const GpuMat& mask);\n\n    //! converts matrix type, ex from float to uchar depending on type\n    void enqueueConvert(const GpuMat& src, GpuMat& dst, int dtype, double a = 1, double b = 0);\n\n    //! adds a callback to be called on the host after all currently enqueued items in the stream have completed\n    typedef void (*StreamCallback)(Stream& stream, int status, void* userData);\n    void enqueueHostCallback(StreamCallback callback, void* userData);\n\n    static Stream& Null();\n\n    operator bool() const;\n\nprivate:\n    struct Impl;\n\n    explicit Stream(Impl* impl);\n    void create();\n    void release();\n\n    Impl *impl;\n\n    friend struct StreamAccessor;\n};\n\n\n//////////////////////////////// Filter Engine ////////////////////////////////\n\n/*!\nThe Base Class for 1D or Row-wise Filters\n\nThis is the base class for linear or non-linear filters that process 1D data.\nIn particular, such filters are used for the \"horizontal\" filtering parts in separable filters.\n*/\nclass CV_EXPORTS BaseRowFilter_GPU\n{\npublic:\n    BaseRowFilter_GPU(int ksize_, int anchor_) : ksize(ksize_), anchor(anchor_) {}\n    virtual ~BaseRowFilter_GPU() {}\n    virtual void operator()(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null()) = 0;\n    int ksize, anchor;\n};\n\n/*!\nThe Base Class for Column-wise Filters\n\nThis is the base class for linear or non-linear filters that process columns of 2D arrays.\nSuch filters are used for the \"vertical\" filtering parts in separable filters.\n*/\nclass CV_EXPORTS BaseColumnFilter_GPU\n{\npublic:\n    BaseColumnFilter_GPU(int ksize_, int anchor_) : ksize(ksize_), anchor(anchor_) {}\n    virtual ~BaseColumnFilter_GPU() {}\n    virtual void operator()(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null()) = 0;\n    int ksize, anchor;\n};\n\n/*!\nThe Base Class for Non-Separable 2D Filters.\n\nThis is the base class for linear or non-linear 2D filters.\n*/\nclass CV_EXPORTS BaseFilter_GPU\n{\npublic:\n    BaseFilter_GPU(const Size& ksize_, const Point& anchor_) : ksize(ksize_), anchor(anchor_) {}\n    virtual ~BaseFilter_GPU() {}\n    virtual void operator()(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null()) = 0;\n    Size ksize;\n    Point anchor;\n};\n\n/*!\nThe Base Class for Filter Engine.\n\nThe class can be used to apply an arbitrary filtering operation to an image.\nIt contains all the necessary intermediate buffers.\n*/\nclass CV_EXPORTS FilterEngine_GPU\n{\npublic:\n    virtual ~FilterEngine_GPU() {}\n\n    virtual void apply(const GpuMat& src, GpuMat& dst, Rect roi = Rect(0,0,-1,-1), Stream& stream = Stream::Null()) = 0;\n};\n\n//! returns the non-separable filter engine with the specified filter\nCV_EXPORTS Ptr<FilterEngine_GPU> createFilter2D_GPU(const Ptr<BaseFilter_GPU>& filter2D, int srcType, int dstType);\n\n//! returns the separable filter engine with the specified filters\nCV_EXPORTS Ptr<FilterEngine_GPU> createSeparableFilter_GPU(const Ptr<BaseRowFilter_GPU>& rowFilter,\n    const Ptr<BaseColumnFilter_GPU>& columnFilter, int srcType, int bufType, int dstType);\nCV_EXPORTS Ptr<FilterEngine_GPU> createSeparableFilter_GPU(const Ptr<BaseRowFilter_GPU>& rowFilter,\n    const Ptr<BaseColumnFilter_GPU>& columnFilter, int srcType, int bufType, int dstType, GpuMat& buf);\n\n//! returns horizontal 1D box filter\n//! supports only CV_8UC1 source type and CV_32FC1 sum type\nCV_EXPORTS Ptr<BaseRowFilter_GPU> getRowSumFilter_GPU(int srcType, int sumType, int ksize, int anchor = -1);\n\n//! returns vertical 1D box filter\n//! supports only CV_8UC1 sum type and CV_32FC1 dst type\nCV_EXPORTS Ptr<BaseColumnFilter_GPU> getColumnSumFilter_GPU(int sumType, int dstType, int ksize, int anchor = -1);\n\n//! returns 2D box filter\n//! supports CV_8UC1 and CV_8UC4 source type, dst type must be the same as source type\nCV_EXPORTS Ptr<BaseFilter_GPU> getBoxFilter_GPU(int srcType, int dstType, const Size& ksize, Point anchor = Point(-1, -1));\n\n//! returns box filter engine\nCV_EXPORTS Ptr<FilterEngine_GPU> createBoxFilter_GPU(int srcType, int dstType, const Size& ksize,\n    const Point& anchor = Point(-1,-1));\n\n//! returns 2D morphological filter\n//! only MORPH_ERODE and MORPH_DILATE are supported\n//! supports CV_8UC1 and CV_8UC4 types\n//! kernel must have CV_8UC1 type, one rows and cols == ksize.width * ksize.height\nCV_EXPORTS Ptr<BaseFilter_GPU> getMorphologyFilter_GPU(int op, int type, const Mat& kernel, const Size& ksize,\n    Point anchor=Point(-1,-1));\n\n//! returns morphological filter engine. Only MORPH_ERODE and MORPH_DILATE are supported.\nCV_EXPORTS Ptr<FilterEngine_GPU> createMorphologyFilter_GPU(int op, int type, const Mat& kernel,\n    const Point& anchor = Point(-1,-1), int iterations = 1);\nCV_EXPORTS Ptr<FilterEngine_GPU> createMorphologyFilter_GPU(int op, int type, const Mat& kernel, GpuMat& buf,\n    const Point& anchor = Point(-1,-1), int iterations = 1);\n\n//! returns 2D filter with the specified kernel\n//! supports CV_8U, CV_16U and CV_32F one and four channel image\nCV_EXPORTS Ptr<BaseFilter_GPU> getLinearFilter_GPU(int srcType, int dstType, const Mat& kernel, Point anchor = Point(-1, -1), int borderType = BORDER_DEFAULT);\n\n//! returns the non-separable linear filter engine\nCV_EXPORTS Ptr<FilterEngine_GPU> createLinearFilter_GPU(int srcType, int dstType, const Mat& kernel,\n    Point anchor = Point(-1,-1), int borderType = BORDER_DEFAULT);\n\n//! returns the primitive row filter with the specified kernel.\n//! supports only CV_8UC1, CV_8UC4, CV_16SC1, CV_16SC2, CV_32SC1, CV_32FC1 source type.\n//! there are two version of algorithm: NPP and OpenCV.\n//! NPP calls when srcType == CV_8UC1 or srcType == CV_8UC4 and bufType == srcType,\n//! otherwise calls OpenCV version.\n//! NPP supports only BORDER_CONSTANT border type.\n//! OpenCV version supports only CV_32F as buffer depth and\n//! BORDER_REFLECT101, BORDER_REPLICATE and BORDER_CONSTANT border types.\nCV_EXPORTS Ptr<BaseRowFilter_GPU> getLinearRowFilter_GPU(int srcType, int bufType, const Mat& rowKernel,\n    int anchor = -1, int borderType = BORDER_DEFAULT);\n\n//! returns the primitive column filter with the specified kernel.\n//! supports only CV_8UC1, CV_8UC4, CV_16SC1, CV_16SC2, CV_32SC1, CV_32FC1 dst type.\n//! there are two version of algorithm: NPP and OpenCV.\n//! NPP calls when dstType == CV_8UC1 or dstType == CV_8UC4 and bufType == dstType,\n//! otherwise calls OpenCV version.\n//! NPP supports only BORDER_CONSTANT border type.\n//! OpenCV version supports only CV_32F as buffer depth and\n//! BORDER_REFLECT101, BORDER_REPLICATE and BORDER_CONSTANT border types.\nCV_EXPORTS Ptr<BaseColumnFilter_GPU> getLinearColumnFilter_GPU(int bufType, int dstType, const Mat& columnKernel,\n    int anchor = -1, int borderType = BORDER_DEFAULT);\n\n//! returns the separable linear filter engine\nCV_EXPORTS Ptr<FilterEngine_GPU> createSeparableLinearFilter_GPU(int srcType, int dstType, const Mat& rowKernel,\n    const Mat& columnKernel, const Point& anchor = Point(-1,-1), int rowBorderType = BORDER_DEFAULT,\n    int columnBorderType = -1);\nCV_EXPORTS Ptr<FilterEngine_GPU> createSeparableLinearFilter_GPU(int srcType, int dstType, const Mat& rowKernel,\n    const Mat& columnKernel, GpuMat& buf, const Point& anchor = Point(-1,-1), int rowBorderType = BORDER_DEFAULT,\n    int columnBorderType = -1);\n\n//! returns filter engine for the generalized Sobel operator\nCV_EXPORTS Ptr<FilterEngine_GPU> createDerivFilter_GPU(int srcType, int dstType, int dx, int dy, int ksize,\n                                                       int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1);\nCV_EXPORTS Ptr<FilterEngine_GPU> createDerivFilter_GPU(int srcType, int dstType, int dx, int dy, int ksize, GpuMat& buf,\n                                                       int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1);\n\n//! returns the Gaussian filter engine\nCV_EXPORTS Ptr<FilterEngine_GPU> createGaussianFilter_GPU(int type, Size ksize, double sigma1, double sigma2 = 0,\n                                                          int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1);\nCV_EXPORTS Ptr<FilterEngine_GPU> createGaussianFilter_GPU(int type, Size ksize, GpuMat& buf, double sigma1, double sigma2 = 0,\n                                                          int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1);\n\n//! returns maximum filter\nCV_EXPORTS Ptr<BaseFilter_GPU> getMaxFilter_GPU(int srcType, int dstType, const Size& ksize, Point anchor = Point(-1,-1));\n\n//! returns minimum filter\nCV_EXPORTS Ptr<BaseFilter_GPU> getMinFilter_GPU(int srcType, int dstType, const Size& ksize, Point anchor = Point(-1,-1));\n\n//! smooths the image using the normalized box filter\n//! supports CV_8UC1, CV_8UC4 types\nCV_EXPORTS void boxFilter(const GpuMat& src, GpuMat& dst, int ddepth, Size ksize, Point anchor = Point(-1,-1), Stream& stream = Stream::Null());\n\n//! a synonym for normalized box filter\nstatic inline void blur(const GpuMat& src, GpuMat& dst, Size ksize, Point anchor = Point(-1,-1), Stream& stream = Stream::Null())\n{\n    boxFilter(src, dst, -1, ksize, anchor, stream);\n}\n\n//! erodes the image (applies the local minimum operator)\nCV_EXPORTS void erode(const GpuMat& src, GpuMat& dst, const Mat& kernel, Point anchor = Point(-1, -1), int iterations = 1);\nCV_EXPORTS void erode(const GpuMat& src, GpuMat& dst, const Mat& kernel, GpuMat& buf,\n                      Point anchor = Point(-1, -1), int iterations = 1,\n                      Stream& stream = Stream::Null());\n\n//! dilates the image (applies the local maximum operator)\nCV_EXPORTS void dilate(const GpuMat& src, GpuMat& dst, const Mat& kernel, Point anchor = Point(-1, -1), int iterations = 1);\nCV_EXPORTS void dilate(const GpuMat& src, GpuMat& dst, const Mat& kernel, GpuMat& buf,\n                       Point anchor = Point(-1, -1), int iterations = 1,\n                       Stream& stream = Stream::Null());\n\n//! applies an advanced morphological operation to the image\nCV_EXPORTS void morphologyEx(const GpuMat& src, GpuMat& dst, int op, const Mat& kernel, Point anchor = Point(-1, -1), int iterations = 1);\nCV_EXPORTS void morphologyEx(const GpuMat& src, GpuMat& dst, int op, const Mat& kernel, GpuMat& buf1, GpuMat& buf2,\n                             Point anchor = Point(-1, -1), int iterations = 1, Stream& stream = Stream::Null());\n\n//! applies non-separable 2D linear filter to the image\nCV_EXPORTS void filter2D(const GpuMat& src, GpuMat& dst, int ddepth, const Mat& kernel, Point anchor=Point(-1,-1), int borderType = BORDER_DEFAULT, Stream& stream = Stream::Null());\n\n//! applies separable 2D linear filter to the image\nCV_EXPORTS void sepFilter2D(const GpuMat& src, GpuMat& dst, int ddepth, const Mat& kernelX, const Mat& kernelY,\n                            Point anchor = Point(-1,-1), int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1);\nCV_EXPORTS void sepFilter2D(const GpuMat& src, GpuMat& dst, int ddepth, const Mat& kernelX, const Mat& kernelY, GpuMat& buf,\n                            Point anchor = Point(-1,-1), int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1,\n                            Stream& stream = Stream::Null());\n\n//! applies generalized Sobel operator to the image\nCV_EXPORTS void Sobel(const GpuMat& src, GpuMat& dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1,\n                      int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1);\nCV_EXPORTS void Sobel(const GpuMat& src, GpuMat& dst, int ddepth, int dx, int dy, GpuMat& buf, int ksize = 3, double scale = 1,\n                      int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1, Stream& stream = Stream::Null());\n\n//! applies the vertical or horizontal Scharr operator to the image\nCV_EXPORTS void Scharr(const GpuMat& src, GpuMat& dst, int ddepth, int dx, int dy, double scale = 1,\n                       int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1);\nCV_EXPORTS void Scharr(const GpuMat& src, GpuMat& dst, int ddepth, int dx, int dy, GpuMat& buf, double scale = 1,\n                       int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1, Stream& stream = Stream::Null());\n\n//! smooths the image using Gaussian filter.\nCV_EXPORTS void GaussianBlur(const GpuMat& src, GpuMat& dst, Size ksize, double sigma1, double sigma2 = 0,\n                             int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1);\nCV_EXPORTS void GaussianBlur(const GpuMat& src, GpuMat& dst, Size ksize, GpuMat& buf, double sigma1, double sigma2 = 0,\n                             int rowBorderType = BORDER_DEFAULT, int columnBorderType = -1, Stream& stream = Stream::Null());\n\n//! applies Laplacian operator to the image\n//! supports only ksize = 1 and ksize = 3\nCV_EXPORTS void Laplacian(const GpuMat& src, GpuMat& dst, int ddepth, int ksize = 1, double scale = 1, int borderType = BORDER_DEFAULT, Stream& stream = Stream::Null());\n\n\n////////////////////////////// Arithmetics ///////////////////////////////////\n\n//! implements generalized matrix product algorithm GEMM from BLAS\nCV_EXPORTS void gemm(const GpuMat& src1, const GpuMat& src2, double alpha,\n    const GpuMat& src3, double beta, GpuMat& dst, int flags = 0, Stream& stream = Stream::Null());\n\n//! transposes the matrix\n//! supports matrix with element size = 1, 4 and 8 bytes (CV_8UC1, CV_8UC4, CV_16UC2, CV_32FC1, etc)\nCV_EXPORTS void transpose(const GpuMat& src1, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! reverses the order of the rows, columns or both in a matrix\n//! supports 1, 3 and 4 channels images with CV_8U, CV_16U, CV_32S or CV_32F depth\nCV_EXPORTS void flip(const GpuMat& a, GpuMat& b, int flipCode, Stream& stream = Stream::Null());\n\n//! transforms 8-bit unsigned integers using lookup table: dst(i)=lut(src(i))\n//! destination array will have the depth type as lut and the same channels number as source\n//! supports CV_8UC1, CV_8UC3 types\nCV_EXPORTS void LUT(const GpuMat& src, const Mat& lut, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! makes multi-channel array out of several single-channel arrays\nCV_EXPORTS void merge(const GpuMat* src, size_t n, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! makes multi-channel array out of several single-channel arrays\nCV_EXPORTS void merge(const vector<GpuMat>& src, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! copies each plane of a multi-channel array to a dedicated array\nCV_EXPORTS void split(const GpuMat& src, GpuMat* dst, Stream& stream = Stream::Null());\n\n//! copies each plane of a multi-channel array to a dedicated array\nCV_EXPORTS void split(const GpuMat& src, vector<GpuMat>& dst, Stream& stream = Stream::Null());\n\n//! computes magnitude of complex (x(i).re, x(i).im) vector\n//! supports only CV_32FC2 type\nCV_EXPORTS void magnitude(const GpuMat& xy, GpuMat& magnitude, Stream& stream = Stream::Null());\n\n//! computes squared magnitude of complex (x(i).re, x(i).im) vector\n//! supports only CV_32FC2 type\nCV_EXPORTS void magnitudeSqr(const GpuMat& xy, GpuMat& magnitude, Stream& stream = Stream::Null());\n\n//! computes magnitude of each (x(i), y(i)) vector\n//! supports only floating-point source\nCV_EXPORTS void magnitude(const GpuMat& x, const GpuMat& y, GpuMat& magnitude, Stream& stream = Stream::Null());\n\n//! computes squared magnitude of each (x(i), y(i)) vector\n//! supports only floating-point source\nCV_EXPORTS void magnitudeSqr(const GpuMat& x, const GpuMat& y, GpuMat& magnitude, Stream& stream = Stream::Null());\n\n//! computes angle (angle(i)) of each (x(i), y(i)) vector\n//! supports only floating-point source\nCV_EXPORTS void phase(const GpuMat& x, const GpuMat& y, GpuMat& angle, bool angleInDegrees = false, Stream& stream = Stream::Null());\n\n//! converts Cartesian coordinates to polar\n//! supports only floating-point source\nCV_EXPORTS void cartToPolar(const GpuMat& x, const GpuMat& y, GpuMat& magnitude, GpuMat& angle, bool angleInDegrees = false, Stream& stream = Stream::Null());\n\n//! converts polar coordinates to Cartesian\n//! supports only floating-point source\nCV_EXPORTS void polarToCart(const GpuMat& magnitude, const GpuMat& angle, GpuMat& x, GpuMat& y, bool angleInDegrees = false, Stream& stream = Stream::Null());\n\n//! scales and shifts array elements so that either the specified norm (alpha) or the minimum (alpha) and maximum (beta) array values get the specified values\nCV_EXPORTS void normalize(const GpuMat& src, GpuMat& dst, double alpha = 1, double beta = 0,\n                          int norm_type = NORM_L2, int dtype = -1, const GpuMat& mask = GpuMat());\nCV_EXPORTS void normalize(const GpuMat& src, GpuMat& dst, double a, double b,\n                          int norm_type, int dtype, const GpuMat& mask, GpuMat& norm_buf, GpuMat& cvt_buf);\n\n\n//////////////////////////// Per-element operations ////////////////////////////////////\n\n//! adds one matrix to another (c = a + b)\nCV_EXPORTS void add(const GpuMat& a, const GpuMat& b, GpuMat& c, const GpuMat& mask = GpuMat(), int dtype = -1, Stream& stream = Stream::Null());\n//! adds scalar to a matrix (c = a + s)\nCV_EXPORTS void add(const GpuMat& a, const Scalar& sc, GpuMat& c, const GpuMat& mask = GpuMat(), int dtype = -1, Stream& stream = Stream::Null());\n\n//! subtracts one matrix from another (c = a - b)\nCV_EXPORTS void subtract(const GpuMat& a, const GpuMat& b, GpuMat& c, const GpuMat& mask = GpuMat(), int dtype = -1, Stream& stream = Stream::Null());\n//! subtracts scalar from a matrix (c = a - s)\nCV_EXPORTS void subtract(const GpuMat& a, const Scalar& sc, GpuMat& c, const GpuMat& mask = GpuMat(), int dtype = -1, Stream& stream = Stream::Null());\n\n//! computes element-wise weighted product of the two arrays (c = scale * a * b)\nCV_EXPORTS void multiply(const GpuMat& a, const GpuMat& b, GpuMat& c, double scale = 1, int dtype = -1, Stream& stream = Stream::Null());\n//! weighted multiplies matrix to a scalar (c = scale * a * s)\nCV_EXPORTS void multiply(const GpuMat& a, const Scalar& sc, GpuMat& c, double scale = 1, int dtype = -1, Stream& stream = Stream::Null());\n\n//! computes element-wise weighted quotient of the two arrays (c = a / b)\nCV_EXPORTS void divide(const GpuMat& a, const GpuMat& b, GpuMat& c, double scale = 1, int dtype = -1, Stream& stream = Stream::Null());\n//! computes element-wise weighted quotient of matrix and scalar (c = a / s)\nCV_EXPORTS void divide(const GpuMat& a, const Scalar& sc, GpuMat& c, double scale = 1, int dtype = -1, Stream& stream = Stream::Null());\n//! computes element-wise weighted reciprocal of an array (dst = scale/src2)\nCV_EXPORTS void divide(double scale, const GpuMat& b, GpuMat& c, int dtype = -1, Stream& stream = Stream::Null());\n\n//! computes the weighted sum of two arrays (dst = alpha*src1 + beta*src2 + gamma)\nCV_EXPORTS void addWeighted(const GpuMat& src1, double alpha, const GpuMat& src2, double beta, double gamma, GpuMat& dst,\n                            int dtype = -1, Stream& stream = Stream::Null());\n\n//! adds scaled array to another one (dst = alpha*src1 + src2)\nstatic inline void scaleAdd(const GpuMat& src1, double alpha, const GpuMat& src2, GpuMat& dst, Stream& stream = Stream::Null())\n{\n    addWeighted(src1, alpha, src2, 1.0, 0.0, dst, -1, stream);\n}\n\n//! computes element-wise absolute difference of two arrays (c = abs(a - b))\nCV_EXPORTS void absdiff(const GpuMat& a, const GpuMat& b, GpuMat& c, Stream& stream = Stream::Null());\n//! computes element-wise absolute difference of array and scalar (c = abs(a - s))\nCV_EXPORTS void absdiff(const GpuMat& a, const Scalar& s, GpuMat& c, Stream& stream = Stream::Null());\n\n//! computes absolute value of each matrix element\n//! supports CV_16S and CV_32F depth\nCV_EXPORTS void abs(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! computes square of each pixel in an image\n//! supports CV_8U, CV_16U, CV_16S and CV_32F depth\nCV_EXPORTS void sqr(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! computes square root of each pixel in an image\n//! supports CV_8U, CV_16U, CV_16S and CV_32F depth\nCV_EXPORTS void sqrt(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! computes exponent of each matrix element (b = e**a)\n//! supports CV_8U, CV_16U, CV_16S and CV_32F depth\nCV_EXPORTS void exp(const GpuMat& a, GpuMat& b, Stream& stream = Stream::Null());\n\n//! computes natural logarithm of absolute value of each matrix element: b = log(abs(a))\n//! supports CV_8U, CV_16U, CV_16S and CV_32F depth\nCV_EXPORTS void log(const GpuMat& a, GpuMat& b, Stream& stream = Stream::Null());\n\n//! computes power of each matrix element:\n//    (dst(i,j) = pow(     src(i,j) , power), if src.type() is integer\n//    (dst(i,j) = pow(fabs(src(i,j)), power), otherwise\n//! supports all, except depth == CV_64F\nCV_EXPORTS void pow(const GpuMat& src, double power, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! compares elements of two arrays (c = a \\<cmpop\\> b)\nCV_EXPORTS void compare(const GpuMat& a, const GpuMat& b, GpuMat& c, int cmpop, Stream& stream = Stream::Null());\nCV_EXPORTS void compare(const GpuMat& a, Scalar sc, GpuMat& c, int cmpop, Stream& stream = Stream::Null());\n\n//! performs per-elements bit-wise inversion\nCV_EXPORTS void bitwise_not(const GpuMat& src, GpuMat& dst, const GpuMat& mask=GpuMat(), Stream& stream = Stream::Null());\n\n//! calculates per-element bit-wise disjunction of two arrays\nCV_EXPORTS void bitwise_or(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask=GpuMat(), Stream& stream = Stream::Null());\n//! calculates per-element bit-wise disjunction of array and scalar\n//! supports 1, 3 and 4 channels images with CV_8U, CV_16U or CV_32S depth\nCV_EXPORTS void bitwise_or(const GpuMat& src1, const Scalar& sc, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! calculates per-element bit-wise conjunction of two arrays\nCV_EXPORTS void bitwise_and(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask=GpuMat(), Stream& stream = Stream::Null());\n//! calculates per-element bit-wise conjunction of array and scalar\n//! supports 1, 3 and 4 channels images with CV_8U, CV_16U or CV_32S depth\nCV_EXPORTS void bitwise_and(const GpuMat& src1, const Scalar& sc, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! calculates per-element bit-wise \"exclusive or\" operation\nCV_EXPORTS void bitwise_xor(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat& mask=GpuMat(), Stream& stream = Stream::Null());\n//! calculates per-element bit-wise \"exclusive or\" of array and scalar\n//! supports 1, 3 and 4 channels images with CV_8U, CV_16U or CV_32S depth\nCV_EXPORTS void bitwise_xor(const GpuMat& src1, const Scalar& sc, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! pixel by pixel right shift of an image by a constant value\n//! supports 1, 3 and 4 channels images with integers elements\nCV_EXPORTS void rshift(const GpuMat& src, Scalar_<int> sc, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! pixel by pixel left shift of an image by a constant value\n//! supports 1, 3 and 4 channels images with CV_8U, CV_16U or CV_32S depth\nCV_EXPORTS void lshift(const GpuMat& src, Scalar_<int> sc, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! computes per-element minimum of two arrays (dst = min(src1, src2))\nCV_EXPORTS void min(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! computes per-element minimum of array and scalar (dst = min(src1, src2))\nCV_EXPORTS void min(const GpuMat& src1, double src2, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! computes per-element maximum of two arrays (dst = max(src1, src2))\nCV_EXPORTS void max(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! computes per-element maximum of array and scalar (dst = max(src1, src2))\nCV_EXPORTS void max(const GpuMat& src1, double src2, GpuMat& dst, Stream& stream = Stream::Null());\n\nenum { ALPHA_OVER, ALPHA_IN, ALPHA_OUT, ALPHA_ATOP, ALPHA_XOR, ALPHA_PLUS, ALPHA_OVER_PREMUL, ALPHA_IN_PREMUL, ALPHA_OUT_PREMUL,\n       ALPHA_ATOP_PREMUL, ALPHA_XOR_PREMUL, ALPHA_PLUS_PREMUL, ALPHA_PREMUL};\n\n//! Composite two images using alpha opacity values contained in each image\n//! Supports CV_8UC4, CV_16UC4, CV_32SC4 and CV_32FC4 types\nCV_EXPORTS void alphaComp(const GpuMat& img1, const GpuMat& img2, GpuMat& dst, int alpha_op, Stream& stream = Stream::Null());\n\n\n////////////////////////////// Image processing //////////////////////////////\n\n//! DST[x,y] = SRC[xmap[x,y],ymap[x,y]]\n//! supports only CV_32FC1 map type\nCV_EXPORTS void remap(const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const GpuMat& ymap,\n                      int interpolation, int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar(),\n                      Stream& stream = Stream::Null());\n\n//! Does mean shift filtering on GPU.\nCV_EXPORTS void meanShiftFiltering(const GpuMat& src, GpuMat& dst, int sp, int sr,\n                                   TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1),\n                                   Stream& stream = Stream::Null());\n\n//! Does mean shift procedure on GPU.\nCV_EXPORTS void meanShiftProc(const GpuMat& src, GpuMat& dstr, GpuMat& dstsp, int sp, int sr,\n                              TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1),\n                              Stream& stream = Stream::Null());\n\n//! Does mean shift segmentation with elimination of small regions.\nCV_EXPORTS void meanShiftSegmentation(const GpuMat& src, Mat& dst, int sp, int sr, int minsize,\n                                      TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1));\n\n//! Does coloring of disparity image: [0..ndisp) -> [0..240, 1, 1] in HSV.\n//! Supported types of input disparity: CV_8U, CV_16S.\n//! Output disparity has CV_8UC4 type in BGRA format (alpha = 255).\nCV_EXPORTS void drawColorDisp(const GpuMat& src_disp, GpuMat& dst_disp, int ndisp, Stream& stream = Stream::Null());\n\n//! Reprojects disparity image to 3D space.\n//! Supports CV_8U and CV_16S types of input disparity.\n//! The output is a 3- or 4-channel floating-point matrix.\n//! Each element of this matrix will contain the 3D coordinates of the point (x,y,z,1), computed from the disparity map.\n//! Q is the 4x4 perspective transformation matrix that can be obtained with cvStereoRectify.\nCV_EXPORTS void reprojectImageTo3D(const GpuMat& disp, GpuMat& xyzw, const Mat& Q, int dst_cn = 4, Stream& stream = Stream::Null());\n\n//! converts image from one color space to another\nCV_EXPORTS void cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn = 0, Stream& stream = Stream::Null());\n\nenum\n{\n    // Bayer Demosaicing (Malvar, He, and Cutler)\n    COLOR_BayerBG2BGR_MHT = 256,\n    COLOR_BayerGB2BGR_MHT = 257,\n    COLOR_BayerRG2BGR_MHT = 258,\n    COLOR_BayerGR2BGR_MHT = 259,\n\n    COLOR_BayerBG2RGB_MHT = COLOR_BayerRG2BGR_MHT,\n    COLOR_BayerGB2RGB_MHT = COLOR_BayerGR2BGR_MHT,\n    COLOR_BayerRG2RGB_MHT = COLOR_BayerBG2BGR_MHT,\n    COLOR_BayerGR2RGB_MHT = COLOR_BayerGB2BGR_MHT,\n\n    COLOR_BayerBG2GRAY_MHT = 260,\n    COLOR_BayerGB2GRAY_MHT = 261,\n    COLOR_BayerRG2GRAY_MHT = 262,\n    COLOR_BayerGR2GRAY_MHT = 263\n};\nCV_EXPORTS void demosaicing(const GpuMat& src, GpuMat& dst, int code, int dcn = -1, Stream& stream = Stream::Null());\n\n//! swap channels\n//! dstOrder - Integer array describing how channel values are permutated. The n-th entry\n//!            of the array contains the number of the channel that is stored in the n-th channel of\n//!            the output image. E.g. Given an RGBA image, aDstOrder = [3,2,1,0] converts this to ABGR\n//!            channel order.\nCV_EXPORTS void swapChannels(GpuMat& image, const int dstOrder[4], Stream& stream = Stream::Null());\n\n//! Routines for correcting image color gamma\nCV_EXPORTS void gammaCorrection(const GpuMat& src, GpuMat& dst, bool forward = true, Stream& stream = Stream::Null());\n\n//! applies fixed threshold to the image\nCV_EXPORTS double threshold(const GpuMat& src, GpuMat& dst, double thresh, double maxval, int type, Stream& stream = Stream::Null());\n\n//! resizes the image\n//! Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, INTER_AREA\nCV_EXPORTS void resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx=0, double fy=0, int interpolation = INTER_LINEAR, Stream& stream = Stream::Null());\n\n//! warps the image using affine transformation\n//! Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC\nCV_EXPORTS void warpAffine(const GpuMat& src, GpuMat& dst, const Mat& M, Size dsize, int flags = INTER_LINEAR,\n    int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar(), Stream& stream = Stream::Null());\n\nCV_EXPORTS void buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, GpuMat& xmap, GpuMat& ymap, Stream& stream = Stream::Null());\n\n//! warps the image using perspective transformation\n//! Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC\nCV_EXPORTS void warpPerspective(const GpuMat& src, GpuMat& dst, const Mat& M, Size dsize, int flags = INTER_LINEAR,\n    int borderMode = BORDER_CONSTANT, Scalar borderValue = Scalar(), Stream& stream = Stream::Null());\n\nCV_EXPORTS void buildWarpPerspectiveMaps(const Mat& M, bool inverse, Size dsize, GpuMat& xmap, GpuMat& ymap, Stream& stream = Stream::Null());\n\n//! builds plane warping maps\nCV_EXPORTS void buildWarpPlaneMaps(Size src_size, Rect dst_roi, const Mat &K, const Mat& R, const Mat &T, float scale,\n                                   GpuMat& map_x, GpuMat& map_y, Stream& stream = Stream::Null());\n\n//! builds cylindrical warping maps\nCV_EXPORTS void buildWarpCylindricalMaps(Size src_size, Rect dst_roi, const Mat &K, const Mat& R, float scale,\n                                         GpuMat& map_x, GpuMat& map_y, Stream& stream = Stream::Null());\n\n//! builds spherical warping maps\nCV_EXPORTS void buildWarpSphericalMaps(Size src_size, Rect dst_roi, const Mat &K, const Mat& R, float scale,\n                                       GpuMat& map_x, GpuMat& map_y, Stream& stream = Stream::Null());\n\n//! rotates an image around the origin (0,0) and then shifts it\n//! supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC\n//! supports 1, 3 or 4 channels images with CV_8U, CV_16U or CV_32F depth\nCV_EXPORTS void rotate(const GpuMat& src, GpuMat& dst, Size dsize, double angle, double xShift = 0, double yShift = 0,\n                       int interpolation = INTER_LINEAR, Stream& stream = Stream::Null());\n\n//! copies 2D array to a larger destination array and pads borders with user-specifiable constant\nCV_EXPORTS void copyMakeBorder(const GpuMat& src, GpuMat& dst, int top, int bottom, int left, int right, int borderType,\n                               const Scalar& value = Scalar(), Stream& stream = Stream::Null());\n\n//! computes the integral image\n//! sum will have CV_32S type, but will contain unsigned int values\n//! supports only CV_8UC1 source type\nCV_EXPORTS void integral(const GpuMat& src, GpuMat& sum, Stream& stream = Stream::Null());\n//! buffered version\nCV_EXPORTS void integralBuffered(const GpuMat& src, GpuMat& sum, GpuMat& buffer, Stream& stream = Stream::Null());\n\n//! computes squared integral image\n//! result matrix will have 64F type, but will contain 64U values\n//! supports source images of 8UC1 type only\nCV_EXPORTS void sqrIntegral(const GpuMat& src, GpuMat& sqsum, Stream& stream = Stream::Null());\n\n//! computes vertical sum, supports only CV_32FC1 images\nCV_EXPORTS void columnSum(const GpuMat& src, GpuMat& sum);\n\n//! computes the standard deviation of integral images\n//! supports only CV_32SC1 source type and CV_32FC1 sqr type\n//! output will have CV_32FC1 type\nCV_EXPORTS void rectStdDev(const GpuMat& src, const GpuMat& sqr, GpuMat& dst, const Rect& rect, Stream& stream = Stream::Null());\n\n//! computes Harris cornerness criteria at each image pixel\nCV_EXPORTS void cornerHarris(const GpuMat& src, GpuMat& dst, int blockSize, int ksize, double k, int borderType = BORDER_REFLECT101);\nCV_EXPORTS void cornerHarris(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuMat& Dy, int blockSize, int ksize, double k, int borderType = BORDER_REFLECT101);\nCV_EXPORTS void cornerHarris(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuMat& Dy, GpuMat& buf, int blockSize, int ksize, double k,\n                             int borderType = BORDER_REFLECT101, Stream& stream = Stream::Null());\n\n//! computes minimum eigen value of 2x2 derivative covariation matrix at each pixel - the cornerness criteria\nCV_EXPORTS void cornerMinEigenVal(const GpuMat& src, GpuMat& dst, int blockSize, int ksize, int borderType=BORDER_REFLECT101);\nCV_EXPORTS void cornerMinEigenVal(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuMat& Dy, int blockSize, int ksize, int borderType=BORDER_REFLECT101);\nCV_EXPORTS void cornerMinEigenVal(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuMat& Dy, GpuMat& buf, int blockSize, int ksize,\n    int borderType=BORDER_REFLECT101, Stream& stream = Stream::Null());\n\n//! performs per-element multiplication of two full (not packed) Fourier spectrums\n//! supports 32FC2 matrices only (interleaved format)\nCV_EXPORTS void mulSpectrums(const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, bool conjB=false, Stream& stream = Stream::Null());\n\n//! performs per-element multiplication of two full (not packed) Fourier spectrums\n//! supports 32FC2 matrices only (interleaved format)\nCV_EXPORTS void mulAndScaleSpectrums(const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, float scale, bool conjB=false, Stream& stream = Stream::Null());\n\n//! Performs a forward or inverse discrete Fourier transform (1D or 2D) of floating point matrix.\n//! Param dft_size is the size of DFT transform.\n//!\n//! If the source matrix is not continous, then additional copy will be done,\n//! so to avoid copying ensure the source matrix is continous one. If you want to use\n//! preallocated output ensure it is continuous too, otherwise it will be reallocated.\n//!\n//! Being implemented via CUFFT real-to-complex transform result contains only non-redundant values\n//! in CUFFT's format. Result as full complex matrix for such kind of transform cannot be retrieved.\n//!\n//! For complex-to-real transform it is assumed that the source matrix is packed in CUFFT's format.\nCV_EXPORTS void dft(const GpuMat& src, GpuMat& dst, Size dft_size, int flags=0, Stream& stream = Stream::Null());\n\nstruct CV_EXPORTS ConvolveBuf\n{\n    Size result_size;\n    Size block_size;\n    Size user_block_size;\n    Size dft_size;\n    int spect_len;\n\n    GpuMat image_spect, templ_spect, result_spect;\n    GpuMat image_block, templ_block, result_data;\n\n    void create(Size image_size, Size templ_size);\n    static Size estimateBlockSize(Size result_size, Size templ_size);\n};\n\n\n//! computes convolution (or cross-correlation) of two images using discrete Fourier transform\n//! supports source images of 32FC1 type only\n//! result matrix will have 32FC1 type\nCV_EXPORTS void convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result, bool ccorr = false);\nCV_EXPORTS void convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result, bool ccorr, ConvolveBuf& buf, Stream& stream = Stream::Null());\n\nstruct CV_EXPORTS MatchTemplateBuf\n{\n    Size user_block_size;\n    GpuMat imagef, templf;\n    std::vector<GpuMat> images;\n    std::vector<GpuMat> image_sums;\n    std::vector<GpuMat> image_sqsums;\n};\n\n//! computes the proximity map for the raster template and the image where the template is searched for\nCV_EXPORTS void matchTemplate(const GpuMat& image, const GpuMat& templ, GpuMat& result, int method, Stream &stream = Stream::Null());\n\n//! computes the proximity map for the raster template and the image where the template is searched for\nCV_EXPORTS void matchTemplate(const GpuMat& image, const GpuMat& templ, GpuMat& result, int method, MatchTemplateBuf &buf, Stream& stream = Stream::Null());\n\n//! smoothes the source image and downsamples it\nCV_EXPORTS void pyrDown(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! upsamples the source image and then smoothes it\nCV_EXPORTS void pyrUp(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null());\n\n//! performs linear blending of two images\n//! to avoid accuracy errors sum of weigths shouldn't be very close to zero\nCV_EXPORTS void blendLinear(const GpuMat& img1, const GpuMat& img2, const GpuMat& weights1, const GpuMat& weights2,\n                            GpuMat& result, Stream& stream = Stream::Null());\n\n//! Performa bilateral filtering of passsed image\nCV_EXPORTS void bilateralFilter(const GpuMat& src, GpuMat& dst, int kernel_size, float sigma_color, float sigma_spatial,\n                                int borderMode = BORDER_DEFAULT, Stream& stream = Stream::Null());\n\n//! Brute force non-local means algorith (slow but universal)\nCV_EXPORTS void nonLocalMeans(const GpuMat& src, GpuMat& dst, float h, int search_window = 21, int block_size = 7, int borderMode = BORDER_DEFAULT, Stream& s = Stream::Null());\n\n//! Fast (but approximate)version of non-local means algorith similar to CPU function (running sums technique)\nclass CV_EXPORTS FastNonLocalMeansDenoising\n{\npublic:\n    //! Simple method, recommended for grayscale images (though it supports multichannel images)\n    void simpleMethod(const GpuMat& src, GpuMat& dst, float h, int search_window = 21, int block_size = 7, Stream& s = Stream::Null());\n\n    //! Processes luminance and color components separatelly\n    void labMethod(const GpuMat& src, GpuMat& dst, float h_luminance, float h_color, int search_window = 21, int block_size = 7, Stream& s = Stream::Null());\n\nprivate:\n\n    GpuMat buffer, extended_src_buffer;\n    GpuMat lab, l, ab;\n};\n\nstruct CV_EXPORTS CannyBuf\n{\n    void create(const Size& image_size, int apperture_size = 3);\n    void release();\n\n    GpuMat dx, dy;\n    GpuMat mag;\n    GpuMat map;\n    GpuMat st1, st2;\n    GpuMat unused;\n    Ptr<FilterEngine_GPU> filterDX, filterDY;\n\n    CannyBuf() {}\n    explicit CannyBuf(const Size& image_size, int apperture_size = 3) {create(image_size, apperture_size);}\n    CannyBuf(const GpuMat& dx_, const GpuMat& dy_);\n};\n\nCV_EXPORTS void Canny(const GpuMat& image, GpuMat& edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false);\nCV_EXPORTS void Canny(const GpuMat& image, CannyBuf& buf, GpuMat& edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false);\nCV_EXPORTS void Canny(const GpuMat& dx, const GpuMat& dy, GpuMat& edges, double low_thresh, double high_thresh, bool L2gradient = false);\nCV_EXPORTS void Canny(const GpuMat& dx, const GpuMat& dy, CannyBuf& buf, GpuMat& edges, double low_thresh, double high_thresh, bool L2gradient = false);\n\nclass CV_EXPORTS ImagePyramid\n{\npublic:\n    inline ImagePyramid() : nLayers_(0) {}\n    inline ImagePyramid(const GpuMat& img, int nLayers, Stream& stream = Stream::Null())\n    {\n        build(img, nLayers, stream);\n    }\n\n    void build(const GpuMat& img, int nLayers, Stream& stream = Stream::Null());\n\n    void getLayer(GpuMat& outImg, Size outRoi, Stream& stream = Stream::Null()) const;\n\n    inline void release()\n    {\n        layer0_.release();\n        pyramid_.clear();\n        nLayers_ = 0;\n    }\n\nprivate:\n    GpuMat layer0_;\n    std::vector<GpuMat> pyramid_;\n    int nLayers_;\n};\n\n//! HoughLines\n\nstruct HoughLinesBuf\n{\n    GpuMat accum;\n    GpuMat list;\n};\n\nCV_EXPORTS void HoughLines(const GpuMat& src, GpuMat& lines, float rho, float theta, int threshold, bool doSort = false, int maxLines = 4096);\nCV_EXPORTS void HoughLines(const GpuMat& src, GpuMat& lines, HoughLinesBuf& buf, float rho, float theta, int threshold, bool doSort = false, int maxLines = 4096);\nCV_EXPORTS void HoughLinesDownload(const GpuMat& d_lines, OutputArray h_lines, OutputArray h_votes = noArray());\n\n//! HoughLinesP\n\n//! finds line segments in the black-n-white image using probabalistic Hough transform\nCV_EXPORTS void HoughLinesP(const GpuMat& image, GpuMat& lines, HoughLinesBuf& buf, float rho, float theta, int minLineLength, int maxLineGap, int maxLines = 4096);\n\n//! HoughCircles\n\nstruct HoughCirclesBuf\n{\n    GpuMat edges;\n    GpuMat accum;\n    GpuMat list;\n    CannyBuf cannyBuf;\n};\n\nCV_EXPORTS void HoughCircles(const GpuMat& src, GpuMat& circles, int method, float dp, float minDist, int cannyThreshold, int votesThreshold, int minRadius, int maxRadius, int maxCircles = 4096);\nCV_EXPORTS void HoughCircles(const GpuMat& src, GpuMat& circles, HoughCirclesBuf& buf, int method, float dp, float minDist, int cannyThreshold, int votesThreshold, int minRadius, int maxRadius, int maxCircles = 4096);\nCV_EXPORTS void HoughCirclesDownload(const GpuMat& d_circles, OutputArray h_circles);\n\n//! finds arbitrary template in the grayscale image using Generalized Hough Transform\n//! Ballard, D.H. (1981). Generalizing the Hough transform to detect arbitrary shapes. Pattern Recognition 13 (2): 111-122.\n//! Guil, N., González-Linares, J.M. and Zapata, E.L. (1999). Bidimensional shape detection using an invariant approach. Pattern Recognition 32 (6): 1025-1038.\nclass CV_EXPORTS GeneralizedHough_GPU : public Algorithm\n{\npublic:\n    static Ptr<GeneralizedHough_GPU> create(int method);\n\n    virtual ~GeneralizedHough_GPU();\n\n    //! set template to search\n    void setTemplate(const GpuMat& templ, int cannyThreshold = 100, Point templCenter = Point(-1, -1));\n    void setTemplate(const GpuMat& edges, const GpuMat& dx, const GpuMat& dy, Point templCenter = Point(-1, -1));\n\n    //! find template on image\n    void detect(const GpuMat& image, GpuMat& positions, int cannyThreshold = 100);\n    void detect(const GpuMat& edges, const GpuMat& dx, const GpuMat& dy, GpuMat& positions);\n\n    void download(const GpuMat& d_positions, OutputArray h_positions, OutputArray h_votes = noArray());\n\n    void release();\n\nprotected:\n    virtual void setTemplateImpl(const GpuMat& edges, const GpuMat& dx, const GpuMat& dy, Point templCenter) = 0;\n    virtual void detectImpl(const GpuMat& edges, const GpuMat& dx, const GpuMat& dy, GpuMat& positions) = 0;\n    virtual void releaseImpl() = 0;\n\nprivate:\n    GpuMat edges_;\n    CannyBuf cannyBuf_;\n};\n\n////////////////////////////// Matrix reductions //////////////////////////////\n\n//! computes mean value and standard deviation of all or selected array elements\n//! supports only CV_8UC1 type\nCV_EXPORTS void meanStdDev(const GpuMat& mtx, Scalar& mean, Scalar& stddev);\n//! buffered version\nCV_EXPORTS void meanStdDev(const GpuMat& mtx, Scalar& mean, Scalar& stddev, GpuMat& buf);\n\n//! computes norm of array\n//! supports NORM_INF, NORM_L1, NORM_L2\n//! supports all matrices except 64F\nCV_EXPORTS double norm(const GpuMat& src1, int normType=NORM_L2);\nCV_EXPORTS double norm(const GpuMat& src1, int normType, GpuMat& buf);\nCV_EXPORTS double norm(const GpuMat& src1, int normType, const GpuMat& mask, GpuMat& buf);\n\n//! computes norm of the difference between two arrays\n//! supports NORM_INF, NORM_L1, NORM_L2\n//! supports only CV_8UC1 type\nCV_EXPORTS double norm(const GpuMat& src1, const GpuMat& src2, int normType=NORM_L2);\n\n//! computes sum of array elements\n//! supports only single channel images\nCV_EXPORTS Scalar sum(const GpuMat& src);\nCV_EXPORTS Scalar sum(const GpuMat& src, GpuMat& buf);\nCV_EXPORTS Scalar sum(const GpuMat& src, const GpuMat& mask, GpuMat& buf);\n\n//! computes sum of array elements absolute values\n//! supports only single channel images\nCV_EXPORTS Scalar absSum(const GpuMat& src);\nCV_EXPORTS Scalar absSum(const GpuMat& src, GpuMat& buf);\nCV_EXPORTS Scalar absSum(const GpuMat& src, const GpuMat& mask, GpuMat& buf);\n\n//! computes squared sum of array elements\n//! supports only single channel images\nCV_EXPORTS Scalar sqrSum(const GpuMat& src);\nCV_EXPORTS Scalar sqrSum(const GpuMat& src, GpuMat& buf);\nCV_EXPORTS Scalar sqrSum(const GpuMat& src, const GpuMat& mask, GpuMat& buf);\n\n//! finds global minimum and maximum array elements and returns their values\nCV_EXPORTS void minMax(const GpuMat& src, double* minVal, double* maxVal=0, const GpuMat& mask=GpuMat());\nCV_EXPORTS void minMax(const GpuMat& src, double* minVal, double* maxVal, const GpuMat& mask, GpuMat& buf);\n\n//! finds global minimum and maximum array elements and returns their values with locations\nCV_EXPORTS void minMaxLoc(const GpuMat& src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0,\n                          const GpuMat& mask=GpuMat());\nCV_EXPORTS void minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point* minLoc, Point* maxLoc,\n                          const GpuMat& mask, GpuMat& valbuf, GpuMat& locbuf);\n\n//! counts non-zero array elements\nCV_EXPORTS int countNonZero(const GpuMat& src);\nCV_EXPORTS int countNonZero(const GpuMat& src, GpuMat& buf);\n\n//! reduces a matrix to a vector\nCV_EXPORTS void reduce(const GpuMat& mtx, GpuMat& vec, int dim, int reduceOp, int dtype = -1, Stream& stream = Stream::Null());\n\n\n///////////////////////////// Calibration 3D //////////////////////////////////\n\nCV_EXPORTS void transformPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec,\n                                GpuMat& dst, Stream& stream = Stream::Null());\n\nCV_EXPORTS void projectPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec,\n                              const Mat& camera_mat, const Mat& dist_coef, GpuMat& dst,\n                              Stream& stream = Stream::Null());\n\nCV_EXPORTS void solvePnPRansac(const Mat& object, const Mat& image, const Mat& camera_mat,\n                               const Mat& dist_coef, Mat& rvec, Mat& tvec, bool use_extrinsic_guess=false,\n                               int num_iters=100, float max_dist=8.0, int min_inlier_count=100,\n                               std::vector<int>* inliers=NULL);\n\n//////////////////////////////// Image Labeling ////////////////////////////////\n\n//!performs labeling via graph cuts of a 2D regular 4-connected graph.\nCV_EXPORTS void graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& bottom, GpuMat& labels,\n                         GpuMat& buf, Stream& stream = Stream::Null());\n\n//!performs labeling via graph cuts of a 2D regular 8-connected graph.\nCV_EXPORTS void graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& topLeft, GpuMat& topRight,\n                         GpuMat& bottom, GpuMat& bottomLeft, GpuMat& bottomRight,\n                         GpuMat& labels,\n                         GpuMat& buf, Stream& stream = Stream::Null());\n\n//! compute mask for Generalized Flood fill componetns labeling.\nCV_EXPORTS void connectivityMask(const GpuMat& image, GpuMat& mask, const cv::Scalar& lo, const cv::Scalar& hi, Stream& stream = Stream::Null());\n\n//! performs connected componnents labeling.\nCV_EXPORTS void labelComponents(const GpuMat& mask, GpuMat& components, int flags = 0, Stream& stream = Stream::Null());\n\n////////////////////////////////// Histograms //////////////////////////////////\n\n//! Compute levels with even distribution. levels will have 1 row and nLevels cols and CV_32SC1 type.\nCV_EXPORTS void evenLevels(GpuMat& levels, int nLevels, int lowerLevel, int upperLevel);\n//! Calculates histogram with evenly distributed bins for signle channel source.\n//! Supports CV_8UC1, CV_16UC1 and CV_16SC1 source types.\n//! Output hist will have one row and histSize cols and CV_32SC1 type.\nCV_EXPORTS void histEven(const GpuMat& src, GpuMat& hist, int histSize, int lowerLevel, int upperLevel, Stream& stream = Stream::Null());\nCV_EXPORTS void histEven(const GpuMat& src, GpuMat& hist, GpuMat& buf, int histSize, int lowerLevel, int upperLevel, Stream& stream = Stream::Null());\n//! Calculates histogram with evenly distributed bins for four-channel source.\n//! All channels of source are processed separately.\n//! Supports CV_8UC4, CV_16UC4 and CV_16SC4 source types.\n//! Output hist[i] will have one row and histSize[i] cols and CV_32SC1 type.\nCV_EXPORTS void histEven(const GpuMat& src, GpuMat hist[4], int histSize[4], int lowerLevel[4], int upperLevel[4], Stream& stream = Stream::Null());\nCV_EXPORTS void histEven(const GpuMat& src, GpuMat hist[4], GpuMat& buf, int histSize[4], int lowerLevel[4], int upperLevel[4], Stream& stream = Stream::Null());\n//! Calculates histogram with bins determined by levels array.\n//! levels must have one row and CV_32SC1 type if source has integer type or CV_32FC1 otherwise.\n//! Supports CV_8UC1, CV_16UC1, CV_16SC1 and CV_32FC1 source types.\n//! Output hist will have one row and (levels.cols-1) cols and CV_32SC1 type.\nCV_EXPORTS void histRange(const GpuMat& src, GpuMat& hist, const GpuMat& levels, Stream& stream = Stream::Null());\nCV_EXPORTS void histRange(const GpuMat& src, GpuMat& hist, const GpuMat& levels, GpuMat& buf, Stream& stream = Stream::Null());\n//! Calculates histogram with bins determined by levels array.\n//! All levels must have one row and CV_32SC1 type if source has integer type or CV_32FC1 otherwise.\n//! All channels of source are processed separately.\n//! Supports CV_8UC4, CV_16UC4, CV_16SC4 and CV_32FC4 source types.\n//! Output hist[i] will have one row and (levels[i].cols-1) cols and CV_32SC1 type.\nCV_EXPORTS void histRange(const GpuMat& src, GpuMat hist[4], const GpuMat levels[4], Stream& stream = Stream::Null());\nCV_EXPORTS void histRange(const GpuMat& src, GpuMat hist[4], const GpuMat levels[4], GpuMat& buf, Stream& stream = Stream::Null());\n\n//! Calculates histogram for 8u one channel image\n//! Output hist will have one row, 256 cols and CV32SC1 type.\nCV_EXPORTS void calcHist(const GpuMat& src, GpuMat& hist, Stream& stream = Stream::Null());\nCV_EXPORTS void calcHist(const GpuMat& src, GpuMat& hist, GpuMat& buf, Stream& stream = Stream::Null());\n\n//! normalizes the grayscale image brightness and contrast by normalizing its histogram\nCV_EXPORTS void equalizeHist(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null());\nCV_EXPORTS void equalizeHist(const GpuMat& src, GpuMat& dst, GpuMat& hist, Stream& stream = Stream::Null());\nCV_EXPORTS void equalizeHist(const GpuMat& src, GpuMat& dst, GpuMat& hist, GpuMat& buf, Stream& stream = Stream::Null());\n\nclass CV_EXPORTS CLAHE : public cv::CLAHE\n{\npublic:\n    using cv::CLAHE::apply;\n    virtual void apply(InputArray src, OutputArray dst, Stream& stream) = 0;\n};\nCV_EXPORTS Ptr<cv::gpu::CLAHE> createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8));\n\n//////////////////////////////// StereoBM_GPU ////////////////////////////////\n\nclass CV_EXPORTS StereoBM_GPU\n{\npublic:\n    enum { BASIC_PRESET = 0, PREFILTER_XSOBEL = 1 };\n\n    enum { DEFAULT_NDISP = 64, DEFAULT_WINSZ = 19 };\n\n    //! the default constructor\n    StereoBM_GPU();\n    //! the full constructor taking the camera-specific preset, number of disparities and the SAD window size. ndisparities must be multiple of 8.\n    StereoBM_GPU(int preset, int ndisparities = DEFAULT_NDISP, int winSize = DEFAULT_WINSZ);\n\n    //! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair\n    //! Output disparity has CV_8U type.\n    void operator()(const GpuMat& left, const GpuMat& right, GpuMat& disparity, Stream& stream = Stream::Null());\n\n    //! Some heuristics that tries to estmate\n    // if current GPU will be faster than CPU in this algorithm.\n    // It queries current active device.\n    static bool checkIfGpuCallReasonable();\n\n    int preset;\n    int ndisp;\n    int winSize;\n\n    // If avergeTexThreshold  == 0 => post procesing is disabled\n    // If avergeTexThreshold != 0 then disparity is set 0 in each point (x,y) where for left image\n    // SumOfHorizontalGradiensInWindow(x, y, winSize) < (winSize * winSize) * avergeTexThreshold\n    // i.e. input left image is low textured.\n    float avergeTexThreshold;\n\nprivate:\n    GpuMat minSSD, leBuf, riBuf;\n};\n\n////////////////////////// StereoBeliefPropagation ///////////////////////////\n// \"Efficient Belief Propagation for Early Vision\"\n// P.Felzenszwalb\n\nclass CV_EXPORTS StereoBeliefPropagation\n{\npublic:\n    enum { DEFAULT_NDISP  = 64 };\n    enum { DEFAULT_ITERS  = 5  };\n    enum { DEFAULT_LEVELS = 5  };\n\n    static void estimateRecommendedParams(int width, int height, int& ndisp, int& iters, int& levels);\n\n    //! the default constructor\n    explicit StereoBeliefPropagation(int ndisp  = DEFAULT_NDISP,\n                                     int iters  = DEFAULT_ITERS,\n                                     int levels = DEFAULT_LEVELS,\n                                     int msg_type = CV_32F);\n\n    //! the full constructor taking the number of disparities, number of BP iterations on each level,\n    //! number of levels, truncation of data cost, data weight,\n    //! truncation of discontinuity cost and discontinuity single jump\n    //! DataTerm = data_weight * min(fabs(I2-I1), max_data_term)\n    //! DiscTerm = min(disc_single_jump * fabs(f1-f2), max_disc_term)\n    //! please see paper for more details\n    StereoBeliefPropagation(int ndisp, int iters, int levels,\n        float max_data_term, float data_weight,\n        float max_disc_term, float disc_single_jump,\n        int msg_type = CV_32F);\n\n    //! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair,\n    //! if disparity is empty output type will be CV_16S else output type will be disparity.type().\n    void operator()(const GpuMat& left, const GpuMat& right, GpuMat& disparity, Stream& stream = Stream::Null());\n\n\n    //! version for user specified data term\n    void operator()(const GpuMat& data, GpuMat& disparity, Stream& stream = Stream::Null());\n\n    int ndisp;\n\n    int iters;\n    int levels;\n\n    float max_data_term;\n    float data_weight;\n    float max_disc_term;\n    float disc_single_jump;\n\n    int msg_type;\nprivate:\n    GpuMat u, d, l, r, u2, d2, l2, r2;\n    std::vector<GpuMat> datas;\n    GpuMat out;\n};\n\n/////////////////////////// StereoConstantSpaceBP ///////////////////////////\n// \"A Constant-Space Belief Propagation Algorithm for Stereo Matching\"\n// Qingxiong Yang, Liang Wang, Narendra Ahuja\n// http://vision.ai.uiuc.edu/~qyang6/\n\nclass CV_EXPORTS StereoConstantSpaceBP\n{\npublic:\n    enum { DEFAULT_NDISP    = 128 };\n    enum { DEFAULT_ITERS    = 8   };\n    enum { DEFAULT_LEVELS   = 4   };\n    enum { DEFAULT_NR_PLANE = 4   };\n\n    static void estimateRecommendedParams(int width, int height, int& ndisp, int& iters, int& levels, int& nr_plane);\n\n    //! the default constructor\n    explicit StereoConstantSpaceBP(int ndisp    = DEFAULT_NDISP,\n                                   int iters    = DEFAULT_ITERS,\n                                   int levels   = DEFAULT_LEVELS,\n                                   int nr_plane = DEFAULT_NR_PLANE,\n                                   int msg_type = CV_32F);\n\n    //! the full constructor taking the number of disparities, number of BP iterations on each level,\n    //! number of levels, number of active disparity on the first level, truncation of data cost, data weight,\n    //! truncation of discontinuity cost, discontinuity single jump and minimum disparity threshold\n    StereoConstantSpaceBP(int ndisp, int iters, int levels, int nr_plane,\n        float max_data_term, float data_weight, float max_disc_term, float disc_single_jump,\n        int min_disp_th = 0,\n        int msg_type = CV_32F);\n\n    //! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair,\n    //! if disparity is empty output type will be CV_16S else output type will be disparity.type().\n    void operator()(const GpuMat& left, const GpuMat& right, GpuMat& disparity, Stream& stream = Stream::Null());\n\n    int ndisp;\n\n    int iters;\n    int levels;\n\n    int nr_plane;\n\n    float max_data_term;\n    float data_weight;\n    float max_disc_term;\n    float disc_single_jump;\n\n    int min_disp_th;\n\n    int msg_type;\n\n    bool use_local_init_data_cost;\nprivate:\n    GpuMat messages_buffers;\n\n    GpuMat temp;\n    GpuMat out;\n};\n\n/////////////////////////// DisparityBilateralFilter ///////////////////////////\n// Disparity map refinement using joint bilateral filtering given a single color image.\n// Qingxiong Yang, Liang Wang, Narendra Ahuja\n// http://vision.ai.uiuc.edu/~qyang6/\n\nclass CV_EXPORTS DisparityBilateralFilter\n{\npublic:\n    enum { DEFAULT_NDISP  = 64 };\n    enum { DEFAULT_RADIUS = 3 };\n    enum { DEFAULT_ITERS  = 1 };\n\n    //! the default constructor\n    explicit DisparityBilateralFilter(int ndisp = DEFAULT_NDISP, int radius = DEFAULT_RADIUS, int iters = DEFAULT_ITERS);\n\n    //! the full constructor taking the number of disparities, filter radius,\n    //! number of iterations, truncation of data continuity, truncation of disparity continuity\n    //! and filter range sigma\n    DisparityBilateralFilter(int ndisp, int radius, int iters, float edge_threshold, float max_disc_threshold, float sigma_range);\n\n    //! the disparity map refinement operator. Refine disparity map using joint bilateral filtering given a single color image.\n    //! disparity must have CV_8U or CV_16S type, image must have CV_8UC1 or CV_8UC3 type.\n    void operator()(const GpuMat& disparity, const GpuMat& image, GpuMat& dst, Stream& stream = Stream::Null());\n\nprivate:\n    int ndisp;\n    int radius;\n    int iters;\n\n    float edge_threshold;\n    float max_disc_threshold;\n    float sigma_range;\n\n    GpuMat table_color;\n    GpuMat table_space;\n};\n\n\n//////////////// HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector //////////////\nstruct CV_EXPORTS HOGConfidence\n{\n   double scale;\n   vector<Point> locations;\n   vector<double> confidences;\n   vector<double> part_scores[4];\n};\n\nstruct CV_EXPORTS HOGDescriptor\n{\n    enum { DEFAULT_WIN_SIGMA = -1 };\n    enum { DEFAULT_NLEVELS = 64 };\n    enum { DESCR_FORMAT_ROW_BY_ROW, DESCR_FORMAT_COL_BY_COL };\n\n    HOGDescriptor(Size win_size=Size(64, 128), Size block_size=Size(16, 16),\n                  Size block_stride=Size(8, 8), Size cell_size=Size(8, 8),\n                  int nbins=9, double win_sigma=DEFAULT_WIN_SIGMA,\n                  double threshold_L2hys=0.2, bool gamma_correction=true,\n                  int nlevels=DEFAULT_NLEVELS);\n\n    size_t getDescriptorSize() const;\n    size_t getBlockHistogramSize() const;\n\n    void setSVMDetector(const vector<float>& detector);\n\n    static vector<float> getDefaultPeopleDetector();\n    static vector<float> getPeopleDetector48x96();\n    static vector<float> getPeopleDetector64x128();\n\n    void detect(const GpuMat& img, vector<Point>& found_locations,\n                double hit_threshold=0, Size win_stride=Size(),\n                Size padding=Size());\n\n    void detectMultiScale(const GpuMat& img, vector<Rect>& found_locations,\n                          double hit_threshold=0, Size win_stride=Size(),\n                          Size padding=Size(), double scale0=1.05,\n                          int group_threshold=2);\n\n    void computeConfidence(const GpuMat& img, vector<Point>& hits, double hit_threshold,\n                                                Size win_stride, Size padding, vector<Point>& locations, vector<double>& confidences);\n\n    void computeConfidenceMultiScale(const GpuMat& img, vector<Rect>& found_locations,\n                                                                    double hit_threshold, Size win_stride, Size padding,\n                                                                    vector<HOGConfidence> &conf_out, int group_threshold);\n\n    void getDescriptors(const GpuMat& img, Size win_stride,\n                        GpuMat& descriptors,\n                        int descr_format=DESCR_FORMAT_COL_BY_COL);\n\n    Size win_size;\n    Size block_size;\n    Size block_stride;\n    Size cell_size;\n    int nbins;\n    double win_sigma;\n    double threshold_L2hys;\n    bool gamma_correction;\n    int nlevels;\n\nprotected:\n    void computeBlockHistograms(const GpuMat& img);\n    void computeGradient(const GpuMat& img, GpuMat& grad, GpuMat& qangle);\n\n    double getWinSigma() const;\n    bool checkDetectorSize() const;\n\n    static int numPartsWithin(int size, int part_size, int stride);\n    static Size numPartsWithin(Size size, Size part_size, Size stride);\n\n    // Coefficients of the separating plane\n    float free_coef;\n    GpuMat detector;\n\n    // Results of the last classification step\n    GpuMat labels, labels_buf;\n    Mat labels_host;\n\n    // Results of the last histogram evaluation step\n    GpuMat block_hists, block_hists_buf;\n\n    // Gradients conputation results\n    GpuMat grad, qangle, grad_buf, qangle_buf;\n\n    // returns subbuffer with required size, reallocates buffer if nessesary.\n    static GpuMat getBuffer(const Size& sz, int type, GpuMat& buf);\n    static GpuMat getBuffer(int rows, int cols, int type, GpuMat& buf);\n\n    std::vector<GpuMat> image_scales;\n};\n\n\n////////////////////////////////// BruteForceMatcher //////////////////////////////////\n\nclass CV_EXPORTS BruteForceMatcher_GPU_base\n{\npublic:\n    enum DistType {L1Dist = 0, L2Dist, HammingDist};\n\n    explicit BruteForceMatcher_GPU_base(DistType distType = L2Dist);\n\n    // Add descriptors to train descriptor collection\n    void add(const std::vector<GpuMat>& descCollection);\n\n    // Get train descriptors collection\n    const std::vector<GpuMat>& getTrainDescriptors() const;\n\n    // Clear train descriptors collection\n    void clear();\n\n    // Return true if there are not train descriptors in collection\n    bool empty() const;\n\n    // Return true if the matcher supports mask in match methods\n    bool isMaskSupported() const;\n\n    // Find one best match for each query descriptor\n    void matchSingle(const GpuMat& query, const GpuMat& train,\n        GpuMat& trainIdx, GpuMat& distance,\n        const GpuMat& mask = GpuMat(), Stream& stream = Stream::Null());\n\n    // Download trainIdx and distance and convert it to CPU vector with DMatch\n    static void matchDownload(const GpuMat& trainIdx, const GpuMat& distance, std::vector<DMatch>& matches);\n    // Convert trainIdx and distance to vector with DMatch\n    static void matchConvert(const Mat& trainIdx, const Mat& distance, std::vector<DMatch>& matches);\n\n    // Find one best match for each query descriptor\n    void match(const GpuMat& query, const GpuMat& train, std::vector<DMatch>& matches, const GpuMat& mask = GpuMat());\n\n    // Make gpu collection of trains and masks in suitable format for matchCollection function\n    void makeGpuCollection(GpuMat& trainCollection, GpuMat& maskCollection, const std::vector<GpuMat>& masks = std::vector<GpuMat>());\n\n    // Find one best match from train collection for each query descriptor\n    void matchCollection(const GpuMat& query, const GpuMat& trainCollection,\n        GpuMat& trainIdx, GpuMat& imgIdx, GpuMat& distance,\n        const GpuMat& masks = GpuMat(), Stream& stream = Stream::Null());\n\n    // Download trainIdx, imgIdx and distance and convert it to vector with DMatch\n    static void matchDownload(const GpuMat& trainIdx, const GpuMat& imgIdx, const GpuMat& distance, std::vector<DMatch>& matches);\n    // Convert trainIdx, imgIdx and distance to vector with DMatch\n    static void matchConvert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, std::vector<DMatch>& matches);\n\n    // Find one best match from train collection for each query descriptor.\n    void match(const GpuMat& query, std::vector<DMatch>& matches, const std::vector<GpuMat>& masks = std::vector<GpuMat>());\n\n    // Find k best matches for each query descriptor (in increasing order of distances)\n    void knnMatchSingle(const GpuMat& query, const GpuMat& train,\n        GpuMat& trainIdx, GpuMat& distance, GpuMat& allDist, int k,\n        const GpuMat& mask = GpuMat(), Stream& stream = Stream::Null());\n\n    // Download trainIdx and distance and convert it to vector with DMatch\n    // compactResult is used when mask is not empty. If compactResult is false matches\n    // vector will have the same size as queryDescriptors rows. If compactResult is true\n    // matches vector will not contain matches for fully masked out query descriptors.\n    static void knnMatchDownload(const GpuMat& trainIdx, const GpuMat& distance,\n        std::vector< std::vector<DMatch> >& matches, bool compactResult = false);\n    // Convert trainIdx and distance to vector with DMatch\n    static void knnMatchConvert(const Mat& trainIdx, const Mat& distance,\n        std::vector< std::vector<DMatch> >& matches, bool compactResult = false);\n\n    // Find k best matches for each query descriptor (in increasing order of distances).\n    // compactResult is used when mask is not empty. If compactResult is false matches\n    // vector will have the same size as queryDescriptors rows. If compactResult is true\n    // matches vector will not contain matches for fully masked out query descriptors.\n    void knnMatch(const GpuMat& query, const GpuMat& train,\n        std::vector< std::vector<DMatch> >& matches, int k, const GpuMat& mask = GpuMat(),\n        bool compactResult = false);\n\n    // Find k best matches from train collection for each query descriptor (in increasing order of distances)\n    void knnMatch2Collection(const GpuMat& query, const GpuMat& trainCollection,\n        GpuMat& trainIdx, GpuMat& imgIdx, GpuMat& distance,\n        const GpuMat& maskCollection = GpuMat(), Stream& stream = Stream::Null());\n\n    // Download trainIdx and distance and convert it to vector with DMatch\n    // compactResult is used when mask is not empty. If compactResult is false matches\n    // vector will have the same size as queryDescriptors rows. If compactResult is true\n    // matches vector will not contain matches for fully masked out query descriptors.\n    static void knnMatch2Download(const GpuMat& trainIdx, const GpuMat& imgIdx, const GpuMat& distance,\n        std::vector< std::vector<DMatch> >& matches, bool compactResult = false);\n    // Convert trainIdx and distance to vector with DMatch\n    static void knnMatch2Convert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance,\n        std::vector< std::vector<DMatch> >& matches, bool compactResult = false);\n\n    // Find k best matches  for each query descriptor (in increasing order of distances).\n    // compactResult is used when mask is not empty. If compactResult is false matches\n    // vector will have the same size as queryDescriptors rows. If compactResult is true\n    // matches vector will not contain matches for fully masked out query descriptors.\n    void knnMatch(const GpuMat& query, std::vector< std::vector<DMatch> >& matches, int k,\n        const std::vector<GpuMat>& masks = std::vector<GpuMat>(), bool compactResult = false);\n\n    // Find best matches for each query descriptor which have distance less than maxDistance.\n    // nMatches.at<int>(0, queryIdx) will contain matches count for queryIdx.\n    // carefully nMatches can be greater than trainIdx.cols - it means that matcher didn't find all matches,\n    // because it didn't have enough memory.\n    // If trainIdx is empty, then trainIdx and distance will be created with size nQuery x max((nTrain / 100), 10),\n    // otherwize user can pass own allocated trainIdx and distance with size nQuery x nMaxMatches\n    // Matches doesn't sorted.\n    void radiusMatchSingle(const GpuMat& query, const GpuMat& train,\n        GpuMat& trainIdx, GpuMat& distance, GpuMat& nMatches, float maxDistance,\n        const GpuMat& mask = GpuMat(), Stream& stream = Stream::Null());\n\n    // Download trainIdx, nMatches and distance and convert it to vector with DMatch.\n    // matches will be sorted in increasing order of distances.\n    // compactResult is used when mask is not empty. If compactResult is false matches\n    // vector will have the same size as queryDescriptors rows. If compactResult is true\n    // matches vector will not contain matches for fully masked out query descriptors.\n    static void radiusMatchDownload(const GpuMat& trainIdx, const GpuMat& distance, const GpuMat& nMatches,\n        std::vector< std::vector<DMatch> >& matches, bool compactResult = false);\n    // Convert trainIdx, nMatches and distance to vector with DMatch.\n    static void radiusMatchConvert(const Mat& trainIdx, const Mat& distance, const Mat& nMatches,\n        std::vector< std::vector<DMatch> >& matches, bool compactResult = false);\n\n    // Find best matches for each query descriptor which have distance less than maxDistance\n    // in increasing order of distances).\n    void radiusMatch(const GpuMat& query, const GpuMat& train,\n        std::vector< std::vector<DMatch> >& matches, float maxDistance,\n        const GpuMat& mask = GpuMat(), bool compactResult = false);\n\n    // Find best matches for each query descriptor which have distance less than maxDistance.\n    // If trainIdx is empty, then trainIdx and distance will be created with size nQuery x max((nQuery / 100), 10),\n    // otherwize user can pass own allocated trainIdx and distance with size nQuery x nMaxMatches\n    // Matches doesn't sorted.\n    void radiusMatchCollection(const GpuMat& query, GpuMat& trainIdx, GpuMat& imgIdx, GpuMat& distance, GpuMat& nMatches, float maxDistance,\n        const std::vector<GpuMat>& masks = std::vector<GpuMat>(), Stream& stream = Stream::Null());\n\n    // Download trainIdx, imgIdx, nMatches and distance and convert it to vector with DMatch.\n    // matches will be sorted in increasing order of distances.\n    // compactResult is used when mask is not empty. If compactResult is false matches\n    // vector will have the same size as queryDescriptors rows. If compactResult is true\n    // matches vector will not contain matches for fully masked out query descriptors.\n    static void radiusMatchDownload(const GpuMat& trainIdx, const GpuMat& imgIdx, const GpuMat& distance, const GpuMat& nMatches,\n        std::vector< std::vector<DMatch> >& matches, bool compactResult = false);\n    // Convert trainIdx, nMatches and distance to vector with DMatch.\n    static void radiusMatchConvert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, const Mat& nMatches,\n        std::vector< std::vector<DMatch> >& matches, bool compactResult = false);\n\n    // Find best matches from train collection for each query descriptor which have distance less than\n    // maxDistance (in increasing order of distances).\n    void radiusMatch(const GpuMat& query, std::vector< std::vector<DMatch> >& matches, float maxDistance,\n        const std::vector<GpuMat>& masks = std::vector<GpuMat>(), bool compactResult = false);\n\n    DistType distType;\n\nprivate:\n    std::vector<GpuMat> trainDescCollection;\n};\n\ntemplate <class Distance>\nclass CV_EXPORTS BruteForceMatcher_GPU;\n\ntemplate <typename T>\nclass CV_EXPORTS BruteForceMatcher_GPU< L1<T> > : public BruteForceMatcher_GPU_base\n{\npublic:\n    explicit BruteForceMatcher_GPU() : BruteForceMatcher_GPU_base(L1Dist) {}\n    explicit BruteForceMatcher_GPU(L1<T> /*d*/) : BruteForceMatcher_GPU_base(L1Dist) {}\n};\ntemplate <typename T>\nclass CV_EXPORTS BruteForceMatcher_GPU< L2<T> > : public BruteForceMatcher_GPU_base\n{\npublic:\n    explicit BruteForceMatcher_GPU() : BruteForceMatcher_GPU_base(L2Dist) {}\n    explicit BruteForceMatcher_GPU(L2<T> /*d*/) : BruteForceMatcher_GPU_base(L2Dist) {}\n};\ntemplate <> class CV_EXPORTS BruteForceMatcher_GPU< Hamming > : public BruteForceMatcher_GPU_base\n{\npublic:\n    explicit BruteForceMatcher_GPU() : BruteForceMatcher_GPU_base(HammingDist) {}\n    explicit BruteForceMatcher_GPU(Hamming /*d*/) : BruteForceMatcher_GPU_base(HammingDist) {}\n};\n\nclass CV_EXPORTS BFMatcher_GPU : public BruteForceMatcher_GPU_base\n{\npublic:\n    explicit BFMatcher_GPU(int norm = NORM_L2) : BruteForceMatcher_GPU_base(norm == NORM_L1 ? L1Dist : norm == NORM_L2 ? L2Dist : HammingDist) {}\n};\n\n////////////////////////////////// CascadeClassifier_GPU //////////////////////////////////////////\n// The cascade classifier class for object detection: supports old haar and new lbp xlm formats and nvbin for haar cascades olny.\nclass CV_EXPORTS CascadeClassifier_GPU\n{\npublic:\n    CascadeClassifier_GPU();\n    CascadeClassifier_GPU(const std::string& filename);\n    ~CascadeClassifier_GPU();\n\n    bool empty() const;\n    bool load(const std::string& filename);\n    void release();\n\n    /* returns number of detected objects */\n    int detectMultiScale(const GpuMat& image, GpuMat& objectsBuf, double scaleFactor = 1.2, int minNeighbors = 4, Size minSize = Size());\n    int detectMultiScale(const GpuMat& image, GpuMat& objectsBuf, Size maxObjectSize, Size minSize = Size(), double scaleFactor = 1.1, int minNeighbors = 4);\n\n    bool findLargestObject;\n    bool visualizeInPlace;\n\n    Size getClassifierSize() const;\n\nprivate:\n    struct CascadeClassifierImpl;\n    CascadeClassifierImpl* impl;\n    struct HaarCascade;\n    struct LbpCascade;\n    friend class CascadeClassifier_GPU_LBP;\n};\n\n////////////////////////////////// FAST //////////////////////////////////////////\n\nclass CV_EXPORTS FAST_GPU\n{\npublic:\n    enum\n    {\n        LOCATION_ROW = 0,\n        RESPONSE_ROW,\n        ROWS_COUNT\n    };\n\n    // all features have same size\n    static const int FEATURE_SIZE = 7;\n\n    explicit FAST_GPU(int threshold, bool nonmaxSuppression = true, double keypointsRatio = 0.05);\n\n    //! finds the keypoints using FAST detector\n    //! supports only CV_8UC1 images\n    void operator ()(const GpuMat& image, const GpuMat& mask, GpuMat& keypoints);\n    void operator ()(const GpuMat& image, const GpuMat& mask, std::vector<KeyPoint>& keypoints);\n\n    //! download keypoints from device to host memory\n    void downloadKeypoints(const GpuMat& d_keypoints, std::vector<KeyPoint>& keypoints);\n\n    //! convert keypoints to KeyPoint vector\n    void convertKeypoints(const Mat& h_keypoints, std::vector<KeyPoint>& keypoints);\n\n    //! release temporary buffer's memory\n    void release();\n\n    bool nonmaxSuppression;\n\n    int threshold;\n\n    //! max keypoints = keypointsRatio * img.size().area()\n    double keypointsRatio;\n\n    //! find keypoints and compute it's response if nonmaxSuppression is true\n    //! return count of detected keypoints\n    int calcKeyPointsLocation(const GpuMat& image, const GpuMat& mask);\n\n    //! get final array of keypoints\n    //! performs nonmax suppression if needed\n    //! return final count of keypoints\n    int getKeyPoints(GpuMat& keypoints);\n\nprivate:\n    GpuMat kpLoc_;\n    int count_;\n\n    GpuMat score_;\n\n    GpuMat d_keypoints_;\n};\n\n////////////////////////////////// ORB //////////////////////////////////////////\n\nclass CV_EXPORTS ORB_GPU\n{\npublic:\n    enum\n    {\n        X_ROW = 0,\n        Y_ROW,\n        RESPONSE_ROW,\n        ANGLE_ROW,\n        OCTAVE_ROW,\n        SIZE_ROW,\n        ROWS_COUNT\n    };\n\n    enum\n    {\n        DEFAULT_FAST_THRESHOLD = 20\n    };\n\n    //! Constructor\n    explicit ORB_GPU(int nFeatures = 500, float scaleFactor = 1.2f, int nLevels = 8, int edgeThreshold = 31,\n                     int firstLevel = 0, int WTA_K = 2, int scoreType = 0, int patchSize = 31);\n\n    //! Compute the ORB features on an image\n    //! image - the image to compute the features (supports only CV_8UC1 images)\n    //! mask - the mask to apply\n    //! keypoints - the resulting keypoints\n    void operator()(const GpuMat& image, const GpuMat& mask, std::vector<KeyPoint>& keypoints);\n    void operator()(const GpuMat& image, const GpuMat& mask, GpuMat& keypoints);\n\n    //! Compute the ORB features and descriptors on an image\n    //! image - the image to compute the features (supports only CV_8UC1 images)\n    //! mask - the mask to apply\n    //! keypoints - the resulting keypoints\n    //! descriptors - descriptors array\n    void operator()(const GpuMat& image, const GpuMat& mask, std::vector<KeyPoint>& keypoints, GpuMat& descriptors);\n    void operator()(const GpuMat& image, const GpuMat& mask, GpuMat& keypoints, GpuMat& descriptors);\n\n    //! download keypoints from device to host memory\n    void downloadKeyPoints(GpuMat& d_keypoints, std::vector<KeyPoint>& keypoints);\n\n    //! convert keypoints to KeyPoint vector\n    void convertKeyPoints(Mat& d_keypoints, std::vector<KeyPoint>& keypoints);\n\n    //! returns the descriptor size in bytes\n    inline int descriptorSize() const { return kBytes; }\n\n    inline void setFastParams(int threshold, bool nonmaxSuppression = true)\n    {\n        fastDetector_.threshold = threshold;\n        fastDetector_.nonmaxSuppression = nonmaxSuppression;\n    }\n\n    //! release temporary buffer's memory\n    void release();\n\n    //! if true, image will be blurred before descriptors calculation\n    bool blurForDescriptor;\n\nprivate:\n    enum { kBytes = 32 };\n\n    void buildScalePyramids(const GpuMat& image, const GpuMat& mask);\n\n    void computeKeyPointsPyramid();\n\n    void computeDescriptors(GpuMat& descriptors);\n\n    void mergeKeyPoints(GpuMat& keypoints);\n\n    int nFeatures_;\n    float scaleFactor_;\n    int nLevels_;\n    int edgeThreshold_;\n    int firstLevel_;\n    int WTA_K_;\n    int scoreType_;\n    int patchSize_;\n\n    // The number of desired features per scale\n    std::vector<size_t> n_features_per_level_;\n\n    // Points to compute BRIEF descriptors from\n    GpuMat pattern_;\n\n    std::vector<GpuMat> imagePyr_;\n    std::vector<GpuMat> maskPyr_;\n\n    GpuMat buf_;\n\n    std::vector<GpuMat> keyPointsPyr_;\n    std::vector<int> keyPointsCount_;\n\n    FAST_GPU fastDetector_;\n\n    Ptr<FilterEngine_GPU> blurFilter;\n\n    GpuMat d_keypoints_;\n};\n\n////////////////////////////////// Optical Flow //////////////////////////////////////////\n\nclass CV_EXPORTS BroxOpticalFlow\n{\npublic:\n    BroxOpticalFlow(float alpha_, float gamma_, float scale_factor_, int inner_iterations_, int outer_iterations_, int solver_iterations_) :\n        alpha(alpha_), gamma(gamma_), scale_factor(scale_factor_),\n        inner_iterations(inner_iterations_), outer_iterations(outer_iterations_), solver_iterations(solver_iterations_)\n    {\n    }\n\n    //! Compute optical flow\n    //! frame0 - source frame (supports only CV_32FC1 type)\n    //! frame1 - frame to track (with the same size and type as frame0)\n    //! u      - flow horizontal component (along x axis)\n    //! v      - flow vertical component (along y axis)\n    void operator ()(const GpuMat& frame0, const GpuMat& frame1, GpuMat& u, GpuMat& v, Stream& stream = Stream::Null());\n\n    //! flow smoothness\n    float alpha;\n\n    //! gradient constancy importance\n    float gamma;\n\n    //! pyramid scale factor\n    float scale_factor;\n\n    //! number of lagged non-linearity iterations (inner loop)\n    int inner_iterations;\n\n    //! number of warping iterations (number of pyramid levels)\n    int outer_iterations;\n\n    //! number of linear system solver iterations\n    int solver_iterations;\n\n    GpuMat buf;\n};\n\nclass CV_EXPORTS GoodFeaturesToTrackDetector_GPU\n{\npublic:\n    explicit GoodFeaturesToTrackDetector_GPU(int maxCorners = 1000, double qualityLevel = 0.01, double minDistance = 0.0,\n        int blockSize = 3, bool useHarrisDetector = false, double harrisK = 0.04);\n\n    //! return 1 rows matrix with CV_32FC2 type\n    void operator ()(const GpuMat& image, GpuMat& corners, const GpuMat& mask = GpuMat());\n\n    int maxCorners;\n    double qualityLevel;\n    double minDistance;\n\n    int blockSize;\n    bool useHarrisDetector;\n    double harrisK;\n\n    void releaseMemory()\n    {\n        Dx_.release();\n        Dy_.release();\n        buf_.release();\n        eig_.release();\n        minMaxbuf_.release();\n        tmpCorners_.release();\n    }\n\nprivate:\n    GpuMat Dx_;\n    GpuMat Dy_;\n    GpuMat buf_;\n    GpuMat eig_;\n    GpuMat minMaxbuf_;\n    GpuMat tmpCorners_;\n};\n\ninline GoodFeaturesToTrackDetector_GPU::GoodFeaturesToTrackDetector_GPU(int maxCorners_, double qualityLevel_, double minDistance_,\n        int blockSize_, bool useHarrisDetector_, double harrisK_)\n{\n    maxCorners = maxCorners_;\n    qualityLevel = qualityLevel_;\n    minDistance = minDistance_;\n    blockSize = blockSize_;\n    useHarrisDetector = useHarrisDetector_;\n    harrisK = harrisK_;\n}\n\n\nclass CV_EXPORTS PyrLKOpticalFlow\n{\npublic:\n    PyrLKOpticalFlow();\n\n    void sparse(const GpuMat& prevImg, const GpuMat& nextImg, const GpuMat& prevPts, GpuMat& nextPts,\n        GpuMat& status, GpuMat* err = 0);\n\n    void dense(const GpuMat& prevImg, const GpuMat& nextImg, GpuMat& u, GpuMat& v, GpuMat* err = 0);\n\n    void releaseMemory();\n\n    Size winSize;\n    int maxLevel;\n    int iters;\n    double derivLambda; //unused\n    bool useInitialFlow;\n    float minEigThreshold; //unused\n    bool getMinEigenVals;  //unused\n\nprivate:\n    GpuMat uPyr_[2];\n    vector<GpuMat> prevPyr_;\n    vector<GpuMat> nextPyr_;\n    GpuMat vPyr_[2];\n    vector<GpuMat> buf_;\n    vector<GpuMat> unused;\n    bool isDeviceArch11_;\n};\n\n\nclass CV_EXPORTS FarnebackOpticalFlow\n{\npublic:\n    FarnebackOpticalFlow()\n    {\n        numLevels = 5;\n        pyrScale = 0.5;\n        fastPyramids = false;\n        winSize = 13;\n        numIters = 10;\n        polyN = 5;\n        polySigma = 1.1;\n        flags = 0;\n        isDeviceArch11_ = !DeviceInfo().supports(FEATURE_SET_COMPUTE_12);\n    }\n\n    int numLevels;\n    double pyrScale;\n    bool fastPyramids;\n    int winSize;\n    int numIters;\n    int polyN;\n    double polySigma;\n    int flags;\n\n    void operator ()(const GpuMat &frame0, const GpuMat &frame1, GpuMat &flowx, GpuMat &flowy, Stream &s = Stream::Null());\n\n    void releaseMemory()\n    {\n        frames_[0].release();\n        frames_[1].release();\n        pyrLevel_[0].release();\n        pyrLevel_[1].release();\n        M_.release();\n        bufM_.release();\n        R_[0].release();\n        R_[1].release();\n        blurredFrame_[0].release();\n        blurredFrame_[1].release();\n        pyramid0_.clear();\n        pyramid1_.clear();\n    }\n\nprivate:\n    void prepareGaussian(\n            int n, double sigma, float *g, float *xg, float *xxg,\n            double &ig11, double &ig03, double &ig33, double &ig55);\n\n    void setPolynomialExpansionConsts(int n, double sigma);\n\n    void updateFlow_boxFilter(\n            const GpuMat& R0, const GpuMat& R1, GpuMat& flowx, GpuMat &flowy,\n            GpuMat& M, GpuMat &bufM, int blockSize, bool updateMatrices, Stream streams[]);\n\n    void updateFlow_gaussianBlur(\n            const GpuMat& R0, const GpuMat& R1, GpuMat& flowx, GpuMat& flowy,\n            GpuMat& M, GpuMat &bufM, int blockSize, bool updateMatrices, Stream streams[]);\n\n    GpuMat frames_[2];\n    GpuMat pyrLevel_[2], M_, bufM_, R_[2], blurredFrame_[2];\n    std::vector<GpuMat> pyramid0_, pyramid1_;\n\n    bool isDeviceArch11_;\n};\n\n\n// Implementation of the Zach, Pock and Bischof Dual TV-L1 Optical Flow method\n//\n// see reference:\n//   [1] C. Zach, T. Pock and H. Bischof, \"A Duality Based Approach for Realtime TV-L1 Optical Flow\".\n//   [2] Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. \"TV-L1 Optical Flow Estimation\".\nclass CV_EXPORTS OpticalFlowDual_TVL1_GPU\n{\npublic:\n    OpticalFlowDual_TVL1_GPU();\n\n    void operator ()(const GpuMat& I0, const GpuMat& I1, GpuMat& flowx, GpuMat& flowy);\n\n    void collectGarbage();\n\n    /**\n     * Time step of the numerical scheme.\n     */\n    double tau;\n\n    /**\n     * Weight parameter for the data term, attachment parameter.\n     * This is the most relevant parameter, which determines the smoothness of the output.\n     * The smaller this parameter is, the smoother the solutions we obtain.\n     * It depends on the range of motions of the images, so its value should be adapted to each image sequence.\n     */\n    double lambda;\n\n    /**\n     * Weight parameter for (u - v)^2, tightness parameter.\n     * It serves as a link between the attachment and the regularization terms.\n     * In theory, it should have a small value in order to maintain both parts in correspondence.\n     * The method is stable for a large range of values of this parameter.\n     */\n    double theta;\n\n    /**\n     * Number of scales used to create the pyramid of images.\n     */\n    int nscales;\n\n    /**\n     * Number of warpings per scale.\n     * Represents the number of times that I1(x+u0) and grad( I1(x+u0) ) are computed per scale.\n     * This is a parameter that assures the stability of the method.\n     * It also affects the running time, so it is a compromise between speed and accuracy.\n     */\n    int warps;\n\n    /**\n     * Stopping criterion threshold used in the numerical scheme, which is a trade-off between precision and running time.\n     * A small value will yield more accurate solutions at the expense of a slower convergence.\n     */\n    double epsilon;\n\n    /**\n     * Stopping criterion iterations number used in the numerical scheme.\n     */\n    int iterations;\n\n    bool useInitialFlow;\n\nprivate:\n    void procOneScale(const GpuMat& I0, const GpuMat& I1, GpuMat& u1, GpuMat& u2);\n\n    std::vector<GpuMat> I0s;\n    std::vector<GpuMat> I1s;\n    std::vector<GpuMat> u1s;\n    std::vector<GpuMat> u2s;\n\n    GpuMat I1x_buf;\n    GpuMat I1y_buf;\n\n    GpuMat I1w_buf;\n    GpuMat I1wx_buf;\n    GpuMat I1wy_buf;\n\n    GpuMat grad_buf;\n    GpuMat rho_c_buf;\n\n    GpuMat p11_buf;\n    GpuMat p12_buf;\n    GpuMat p21_buf;\n    GpuMat p22_buf;\n\n    GpuMat diff_buf;\n    GpuMat norm_buf;\n};\n\n\n//! Calculates optical flow for 2 images using block matching algorithm */\nCV_EXPORTS void calcOpticalFlowBM(const GpuMat& prev, const GpuMat& curr,\n                                  Size block_size, Size shift_size, Size max_range, bool use_previous,\n                                  GpuMat& velx, GpuMat& vely, GpuMat& buf,\n                                  Stream& stream = Stream::Null());\n\nclass CV_EXPORTS FastOpticalFlowBM\n{\npublic:\n    void operator ()(const GpuMat& I0, const GpuMat& I1, GpuMat& flowx, GpuMat& flowy, int search_window = 21, int block_window = 7, Stream& s = Stream::Null());\n\nprivate:\n    GpuMat buffer;\n    GpuMat extended_I0;\n    GpuMat extended_I1;\n};\n\n\n//! Interpolate frames (images) using provided optical flow (displacement field).\n//! frame0   - frame 0 (32-bit floating point images, single channel)\n//! frame1   - frame 1 (the same type and size)\n//! fu       - forward horizontal displacement\n//! fv       - forward vertical displacement\n//! bu       - backward horizontal displacement\n//! bv       - backward vertical displacement\n//! pos      - new frame position\n//! newFrame - new frame\n//! buf      - temporary buffer, will have width x 6*height size, CV_32FC1 type and contain 6 GpuMat;\n//!            occlusion masks            0, occlusion masks            1,\n//!            interpolated forward flow  0, interpolated forward flow  1,\n//!            interpolated backward flow 0, interpolated backward flow 1\n//!\nCV_EXPORTS void interpolateFrames(const GpuMat& frame0, const GpuMat& frame1,\n                                  const GpuMat& fu, const GpuMat& fv,\n                                  const GpuMat& bu, const GpuMat& bv,\n                                  float pos, GpuMat& newFrame, GpuMat& buf,\n                                  Stream& stream = Stream::Null());\n\nCV_EXPORTS void createOpticalFlowNeedleMap(const GpuMat& u, const GpuMat& v, GpuMat& vertex, GpuMat& colors);\n\n\n//////////////////////// Background/foreground segmentation ////////////////////////\n\n// Foreground Object Detection from Videos Containing Complex Background.\n// Liyuan Li, Weimin Huang, Irene Y.H. Gu, and Qi Tian.\n// ACM MM2003 9p\nclass CV_EXPORTS FGDStatModel\n{\npublic:\n    struct CV_EXPORTS Params\n    {\n        int Lc;  // Quantized levels per 'color' component. Power of two, typically 32, 64 or 128.\n        int N1c; // Number of color vectors used to model normal background color variation at a given pixel.\n        int N2c; // Number of color vectors retained at given pixel.  Must be > N1c, typically ~ 5/3 of N1c.\n        // Used to allow the first N1c vectors to adapt over time to changing background.\n\n        int Lcc;  // Quantized levels per 'color co-occurrence' component.  Power of two, typically 16, 32 or 64.\n        int N1cc; // Number of color co-occurrence vectors used to model normal background color variation at a given pixel.\n        int N2cc; // Number of color co-occurrence vectors retained at given pixel.  Must be > N1cc, typically ~ 5/3 of N1cc.\n        // Used to allow the first N1cc vectors to adapt over time to changing background.\n\n        bool is_obj_without_holes; // If TRUE we ignore holes within foreground blobs. Defaults to TRUE.\n        int perform_morphing;     // Number of erode-dilate-erode foreground-blob cleanup iterations.\n        // These erase one-pixel junk blobs and merge almost-touching blobs. Default value is 1.\n\n        float alpha1; // How quickly we forget old background pixel values seen. Typically set to 0.1.\n        float alpha2; // \"Controls speed of feature learning\". Depends on T. Typical value circa 0.005.\n        float alpha3; // Alternate to alpha2, used (e.g.) for quicker initial convergence. Typical value 0.1.\n\n        float delta;   // Affects color and color co-occurrence quantization, typically set to 2.\n        float T;       // A percentage value which determines when new features can be recognized as new background. (Typically 0.9).\n        float minArea; // Discard foreground blobs whose bounding box is smaller than this threshold.\n\n        // default Params\n        Params();\n    };\n\n    // out_cn - channels count in output result (can be 3 or 4)\n    // 4-channels require more memory, but a bit faster\n    explicit FGDStatModel(int out_cn = 3);\n    explicit FGDStatModel(const cv::gpu::GpuMat& firstFrame, const Params& params = Params(), int out_cn = 3);\n\n    ~FGDStatModel();\n\n    void create(const cv::gpu::GpuMat& firstFrame, const Params& params = Params());\n    void release();\n\n    int update(const cv::gpu::GpuMat& curFrame);\n\n    //8UC3 or 8UC4 reference background image\n    cv::gpu::GpuMat background;\n\n    //8UC1 foreground image\n    cv::gpu::GpuMat foreground;\n\n    std::vector< std::vector<cv::Point> > foreground_regions;\n\nprivate:\n    FGDStatModel(const FGDStatModel&);\n    FGDStatModel& operator=(const FGDStatModel&);\n\n    class Impl;\n    std::auto_ptr<Impl> impl_;\n};\n\n/*!\n Gaussian Mixture-based Backbround/Foreground Segmentation Algorithm\n\n The class implements the following algorithm:\n \"An improved adaptive background mixture model for real-time tracking with shadow detection\"\n P. KadewTraKuPong and R. Bowden,\n Proc. 2nd European Workshp on Advanced Video-Based Surveillance Systems, 2001.\"\n http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf\n*/\nclass CV_EXPORTS MOG_GPU\n{\npublic:\n    //! the default constructor\n    MOG_GPU(int nmixtures = -1);\n\n    //! re-initiaization method\n    void initialize(Size frameSize, int frameType);\n\n    //! the update operator\n    void operator()(const GpuMat& frame, GpuMat& fgmask, float learningRate = 0.0f, Stream& stream = Stream::Null());\n\n    //! computes a background image which are the mean of all background gaussians\n    void getBackgroundImage(GpuMat& backgroundImage, Stream& stream = Stream::Null()) const;\n\n    //! releases all inner buffers\n    void release();\n\n    int history;\n    float varThreshold;\n    float backgroundRatio;\n    float noiseSigma;\n\nprivate:\n    int nmixtures_;\n\n    Size frameSize_;\n    int frameType_;\n    int nframes_;\n\n    GpuMat weight_;\n    GpuMat sortKey_;\n    GpuMat mean_;\n    GpuMat var_;\n};\n\n/*!\n The class implements the following algorithm:\n \"Improved adaptive Gausian mixture model for background subtraction\"\n Z.Zivkovic\n International Conference Pattern Recognition, UK, August, 2004.\n http://www.zoranz.net/Publications/zivkovic2004ICPR.pdf\n*/\nclass CV_EXPORTS MOG2_GPU\n{\npublic:\n    //! the default constructor\n    MOG2_GPU(int nmixtures = -1);\n\n    //! re-initiaization method\n    void initialize(Size frameSize, int frameType);\n\n    //! the update operator\n    void operator()(const GpuMat& frame, GpuMat& fgmask, float learningRate = -1.0f, Stream& stream = Stream::Null());\n\n    //! computes a background image which are the mean of all background gaussians\n    void getBackgroundImage(GpuMat& backgroundImage, Stream& stream = Stream::Null()) const;\n\n    //! releases all inner buffers\n    void release();\n\n    // parameters\n    // you should call initialize after parameters changes\n\n    int history;\n\n    //! here it is the maximum allowed number of mixture components.\n    //! Actual number is determined dynamically per pixel\n    float varThreshold;\n    // threshold on the squared Mahalanobis distance to decide if it is well described\n    // by the background model or not. Related to Cthr from the paper.\n    // This does not influence the update of the background. A typical value could be 4 sigma\n    // and that is varThreshold=4*4=16; Corresponds to Tb in the paper.\n\n    /////////////////////////\n    // less important parameters - things you might change but be carefull\n    ////////////////////////\n\n    float backgroundRatio;\n    // corresponds to fTB=1-cf from the paper\n    // TB - threshold when the component becomes significant enough to be included into\n    // the background model. It is the TB=1-cf from the paper. So I use cf=0.1 => TB=0.\n    // For alpha=0.001 it means that the mode should exist for approximately 105 frames before\n    // it is considered foreground\n    // float noiseSigma;\n    float varThresholdGen;\n\n    //correspondts to Tg - threshold on the squared Mahalan. dist. to decide\n    //when a sample is close to the existing components. If it is not close\n    //to any a new component will be generated. I use 3 sigma => Tg=3*3=9.\n    //Smaller Tg leads to more generated components and higher Tg might make\n    //lead to small number of components but they can grow too large\n    float fVarInit;\n    float fVarMin;\n    float fVarMax;\n\n    //initial variance  for the newly generated components.\n    //It will will influence the speed of adaptation. A good guess should be made.\n    //A simple way is to estimate the typical standard deviation from the images.\n    //I used here 10 as a reasonable value\n    // min and max can be used to further control the variance\n    float fCT; //CT - complexity reduction prior\n    //this is related to the number of samples needed to accept that a component\n    //actually exists. We use CT=0.05 of all the samples. By setting CT=0 you get\n    //the standard Stauffer&Grimson algorithm (maybe not exact but very similar)\n\n    //shadow detection parameters\n    bool bShadowDetection; //default 1 - do shadow detection\n    unsigned char nShadowDetection; //do shadow detection - insert this value as the detection result - 127 default value\n    float fTau;\n    // Tau - shadow threshold. The shadow is detected if the pixel is darker\n    //version of the background. Tau is a threshold on how much darker the shadow can be.\n    //Tau= 0.5 means that if pixel is more than 2 times darker then it is not shadow\n    //See: Prati,Mikic,Trivedi,Cucchiarra,\"Detecting Moving Shadows...\",IEEE PAMI,2003.\n\nprivate:\n    int nmixtures_;\n\n    Size frameSize_;\n    int frameType_;\n    int nframes_;\n\n    GpuMat weight_;\n    GpuMat variance_;\n    GpuMat mean_;\n\n    GpuMat bgmodelUsedModes_; //keep track of number of modes per pixel\n};\n\n/**\n * Background Subtractor module. Takes a series of images and returns a sequence of mask (8UC1)\n * images of the same size, where 255 indicates Foreground and 0 represents Background.\n * This class implements an algorithm described in \"Visual Tracking of Human Visitors under\n * Variable-Lighting Conditions for a Responsive Audio Art Installation,\" A. Godbehere,\n * A. Matsukawa, K. Goldberg, American Control Conference, Montreal, June 2012.\n */\nclass CV_EXPORTS GMG_GPU\n{\npublic:\n    GMG_GPU();\n\n    /**\n     * Validate parameters and set up data structures for appropriate frame size.\n     * @param frameSize Input frame size\n     * @param min       Minimum value taken on by pixels in image sequence. Usually 0\n     * @param max       Maximum value taken on by pixels in image sequence. e.g. 1.0 or 255\n     */\n    void initialize(Size frameSize, float min = 0.0f, float max = 255.0f);\n\n    /**\n     * Performs single-frame background subtraction and builds up a statistical background image\n     * model.\n     * @param frame        Input frame\n     * @param fgmask       Output mask image representing foreground and background pixels\n     * @param learningRate determines how quickly features are “forgotten” from histograms\n     * @param stream       Stream for the asynchronous version\n     */\n    void operator ()(const GpuMat& frame, GpuMat& fgmask, float learningRate = -1.0f, Stream& stream = Stream::Null());\n\n    //! Releases all inner buffers\n    void release();\n\n    //! Total number of distinct colors to maintain in histogram.\n    int maxFeatures;\n\n    //! Set between 0.0 and 1.0, determines how quickly features are \"forgotten\" from histograms.\n    float learningRate;\n\n    //! Number of frames of video to use to initialize histograms.\n    int numInitializationFrames;\n\n    //! Number of discrete levels in each channel to be used in histograms.\n    int quantizationLevels;\n\n    //! Prior probability that any given pixel is a background pixel. A sensitivity parameter.\n    float backgroundPrior;\n\n    //! Value above which pixel is determined to be FG.\n    float decisionThreshold;\n\n    //! Smoothing radius, in pixels, for cleaning up FG image.\n    int smoothingRadius;\n\n    //! Perform background model update.\n    bool updateBackgroundModel;\n\nprivate:\n    float maxVal_, minVal_;\n\n    Size frameSize_;\n\n    int frameNum_;\n\n    GpuMat nfeatures_;\n    GpuMat colors_;\n    GpuMat weights_;\n\n    Ptr<FilterEngine_GPU> boxFilter_;\n    GpuMat buf_;\n};\n\n////////////////////////////////// Video Encoding //////////////////////////////////\n\n// Works only under Windows\n// Supports olny H264 video codec and AVI files\nclass CV_EXPORTS VideoWriter_GPU\n{\npublic:\n    struct EncoderParams;\n\n    // Callbacks for video encoder, use it if you want to work with raw video stream\n    class EncoderCallBack;\n\n    enum SurfaceFormat\n    {\n        SF_UYVY = 0,\n        SF_YUY2,\n        SF_YV12,\n        SF_NV12,\n        SF_IYUV,\n        SF_BGR,\n        SF_GRAY = SF_BGR\n    };\n\n    VideoWriter_GPU();\n    VideoWriter_GPU(const std::string& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);\n    VideoWriter_GPU(const std::string& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);\n    VideoWriter_GPU(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);\n    VideoWriter_GPU(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);\n    ~VideoWriter_GPU();\n\n    // all methods throws cv::Exception if error occurs\n    void open(const std::string& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);\n    void open(const std::string& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);\n    void open(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);\n    void open(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);\n\n    bool isOpened() const;\n    void close();\n\n    void write(const cv::gpu::GpuMat& image, bool lastFrame = false);\n\n    struct CV_EXPORTS EncoderParams\n    {\n        int       P_Interval;      //    NVVE_P_INTERVAL,\n        int       IDR_Period;      //    NVVE_IDR_PERIOD,\n        int       DynamicGOP;      //    NVVE_DYNAMIC_GOP,\n        int       RCType;          //    NVVE_RC_TYPE,\n        int       AvgBitrate;      //    NVVE_AVG_BITRATE,\n        int       PeakBitrate;     //    NVVE_PEAK_BITRATE,\n        int       QP_Level_Intra;  //    NVVE_QP_LEVEL_INTRA,\n        int       QP_Level_InterP; //    NVVE_QP_LEVEL_INTER_P,\n        int       QP_Level_InterB; //    NVVE_QP_LEVEL_INTER_B,\n        int       DeblockMode;     //    NVVE_DEBLOCK_MODE,\n        int       ProfileLevel;    //    NVVE_PROFILE_LEVEL,\n        int       ForceIntra;      //    NVVE_FORCE_INTRA,\n        int       ForceIDR;        //    NVVE_FORCE_IDR,\n        int       ClearStat;       //    NVVE_CLEAR_STAT,\n        int       DIMode;          //    NVVE_SET_DEINTERLACE,\n        int       Presets;         //    NVVE_PRESETS,\n        int       DisableCabac;    //    NVVE_DISABLE_CABAC,\n        int       NaluFramingType; //    NVVE_CONFIGURE_NALU_FRAMING_TYPE\n        int       DisableSPSPPS;   //    NVVE_DISABLE_SPS_PPS\n\n        EncoderParams();\n        explicit EncoderParams(const std::string& configFile);\n\n        void load(const std::string& configFile);\n        void save(const std::string& configFile) const;\n    };\n\n    EncoderParams getParams() const;\n\n    class CV_EXPORTS EncoderCallBack\n    {\n    public:\n        enum PicType\n        {\n            IFRAME = 1,\n            PFRAME = 2,\n            BFRAME = 3\n        };\n\n        virtual ~EncoderCallBack() {}\n\n        // callback function to signal the start of bitstream that is to be encoded\n        // must return pointer to buffer\n        virtual uchar* acquireBitStream(int* bufferSize) = 0;\n\n        // callback function to signal that the encoded bitstream is ready to be written to file\n        virtual void releaseBitStream(unsigned char* data, int size) = 0;\n\n        // callback function to signal that the encoding operation on the frame has started\n        virtual void onBeginFrame(int frameNumber, PicType picType) = 0;\n\n        // callback function signals that the encoding operation on the frame has finished\n        virtual void onEndFrame(int frameNumber, PicType picType) = 0;\n    };\n\nprivate:\n    VideoWriter_GPU(const VideoWriter_GPU&);\n    VideoWriter_GPU& operator=(const VideoWriter_GPU&);\n\n    class Impl;\n    std::auto_ptr<Impl> impl_;\n};\n\n\n////////////////////////////////// Video Decoding //////////////////////////////////////////\n\nnamespace detail\n{\n    class FrameQueue;\n    class VideoParser;\n}\n\nclass CV_EXPORTS VideoReader_GPU\n{\npublic:\n    enum Codec\n    {\n        MPEG1 = 0,\n        MPEG2,\n        MPEG4,\n        VC1,\n        H264,\n        JPEG,\n        H264_SVC,\n        H264_MVC,\n\n        Uncompressed_YUV420 = (('I'<<24)|('Y'<<16)|('U'<<8)|('V')),   // Y,U,V (4:2:0)\n        Uncompressed_YV12   = (('Y'<<24)|('V'<<16)|('1'<<8)|('2')),   // Y,V,U (4:2:0)\n        Uncompressed_NV12   = (('N'<<24)|('V'<<16)|('1'<<8)|('2')),   // Y,UV  (4:2:0)\n        Uncompressed_YUYV   = (('Y'<<24)|('U'<<16)|('Y'<<8)|('V')),   // YUYV/YUY2 (4:2:2)\n        Uncompressed_UYVY   = (('U'<<24)|('Y'<<16)|('V'<<8)|('Y'))    // UYVY (4:2:2)\n    };\n\n    enum ChromaFormat\n    {\n        Monochrome=0,\n        YUV420,\n        YUV422,\n        YUV444\n    };\n\n    struct FormatInfo\n    {\n        Codec codec;\n        ChromaFormat chromaFormat;\n        int width;\n        int height;\n    };\n\n    class VideoSource;\n\n    VideoReader_GPU();\n    explicit VideoReader_GPU(const std::string& filename);\n    explicit VideoReader_GPU(const cv::Ptr<VideoSource>& source);\n\n    ~VideoReader_GPU();\n\n    void open(const std::string& filename);\n    void open(const cv::Ptr<VideoSource>& source);\n    bool isOpened() const;\n\n    void close();\n\n    bool read(GpuMat& image);\n\n    FormatInfo format() const;\n    void dumpFormat(std::ostream& st);\n\n    class CV_EXPORTS VideoSource\n    {\n    public:\n        VideoSource() : frameQueue_(0), videoParser_(0) {}\n        virtual ~VideoSource() {}\n\n        virtual FormatInfo format() const = 0;\n        virtual void start() = 0;\n        virtual void stop() = 0;\n        virtual bool isStarted() const = 0;\n        virtual bool hasError() const = 0;\n\n        void setFrameQueue(detail::FrameQueue* frameQueue) { frameQueue_ = frameQueue; }\n        void setVideoParser(detail::VideoParser* videoParser) { videoParser_ = videoParser; }\n\n    protected:\n        bool parseVideoData(const uchar* data, size_t size, bool endOfStream = false);\n\n    private:\n        VideoSource(const VideoSource&);\n        VideoSource& operator =(const VideoSource&);\n\n        detail::FrameQueue* frameQueue_;\n        detail::VideoParser* videoParser_;\n    };\n\nprivate:\n    VideoReader_GPU(const VideoReader_GPU&);\n    VideoReader_GPU& operator =(const VideoReader_GPU&);\n\n    class Impl;\n    std::auto_ptr<Impl> impl_;\n};\n\n//! removes points (CV_32FC2, single row matrix) with zero mask value\nCV_EXPORTS void compactPoints(GpuMat &points0, GpuMat &points1, const GpuMat &mask);\n\nCV_EXPORTS void calcWobbleSuppressionMaps(\n        int left, int idx, int right, Size size, const Mat &ml, const Mat &mr,\n        GpuMat &mapx, GpuMat &mapy);\n\n} // namespace gpu\n\n} // namespace cv\n\n#endif /* __OPENCV_GPU_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/gpumat.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#include \"opencv2/core/gpumat.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/gpu/stream_accessor.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_STREAM_ACCESSOR_HPP__\n#define __OPENCV_GPU_STREAM_ACCESSOR_HPP__\n\n#include \"opencv2/gpu/gpu.hpp\"\n#include \"cuda_runtime_api.h\"\n\nnamespace cv\n{\n    namespace gpu\n    {\n        // This is only header file that depends on Cuda. All other headers are independent.\n        // So if you use OpenCV binaries you do noot need to install Cuda Toolkit.\n        // But of you wanna use GPU by yourself, may get cuda stream instance using the class below.\n        // In this case you have to install Cuda Toolkit.\n        struct StreamAccessor\n        {\n            CV_EXPORTS static cudaStream_t getStream(const Stream& stream);\n        };\n    }\n}\n\n#endif /* __OPENCV_GPU_STREAM_ACCESSOR_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/highgui/cap_ios.h",
    "content": "/*  For iOS video I/O\n *  by Eduard Feicho on 29/07/12\n *  Copyright 2012. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n *    this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the documentation\n *    and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n *    derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\n * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n */\n\n#import <UIKit/UIKit.h>\n#import <Accelerate/Accelerate.h>\n#import <AVFoundation/AVFoundation.h>\n#import <ImageIO/ImageIO.h>\n#include \"opencv2/core/core.hpp\"\n\n/////////////////////////////////////// CvAbstractCamera /////////////////////////////////////\n\n@class CvAbstractCamera;\n\n@interface CvAbstractCamera : NSObject\n{\n    AVCaptureSession* captureSession;\n    AVCaptureConnection* videoCaptureConnection;\n    AVCaptureVideoPreviewLayer *captureVideoPreviewLayer;\n\n    UIDeviceOrientation currentDeviceOrientation;\n\n    BOOL cameraAvailable;\n    BOOL captureSessionLoaded;\n    BOOL running;\n    BOOL useAVCaptureVideoPreviewLayer;\n\n    AVCaptureDevicePosition defaultAVCaptureDevicePosition;\n    AVCaptureVideoOrientation defaultAVCaptureVideoOrientation;\n    NSString *const defaultAVCaptureSessionPreset;\n\n    int defaultFPS;\n\n    UIView* parentView;\n\n    int imageWidth;\n    int imageHeight;\n}\n\n@property (nonatomic, retain) AVCaptureSession* captureSession;\n@property (nonatomic, retain) AVCaptureConnection* videoCaptureConnection;\n\n@property (nonatomic, readonly) BOOL running;\n@property (nonatomic, readonly) BOOL captureSessionLoaded;\n\n@property (nonatomic, assign) int defaultFPS;\n@property (nonatomic, readonly) AVCaptureVideoPreviewLayer *captureVideoPreviewLayer;\n@property (nonatomic, assign) AVCaptureDevicePosition defaultAVCaptureDevicePosition;\n@property (nonatomic, assign) AVCaptureVideoOrientation defaultAVCaptureVideoOrientation;\n@property (nonatomic, assign) BOOL useAVCaptureVideoPreviewLayer;\n@property (nonatomic, strong) NSString *const defaultAVCaptureSessionPreset;\n\n@property (nonatomic, assign) int imageWidth;\n@property (nonatomic, assign) int imageHeight;\n\n@property (nonatomic, retain) UIView* parentView;\n\n- (void)start;\n- (void)stop;\n- (void)switchCameras;\n\n- (id)initWithParentView:(UIView*)parent;\n\n- (void)createCaptureOutput;\n- (void)createVideoPreviewLayer;\n- (void)updateOrientation;\n\n- (void)lockFocus;\n- (void)unlockFocus;\n- (void)lockExposure;\n- (void)unlockExposure;\n- (void)lockBalance;\n- (void)unlockBalance;\n\n@end\n\n///////////////////////////////// CvVideoCamera ///////////////////////////////////////////\n\n@class CvVideoCamera;\n\n@protocol CvVideoCameraDelegate <NSObject>\n\n#ifdef __cplusplus\n// delegate method for processing image frames\n- (void)processImage:(cv::Mat&)image;\n#endif\n\n@end\n\n@interface CvVideoCamera : CvAbstractCamera<AVCaptureVideoDataOutputSampleBufferDelegate>\n{\n    AVCaptureVideoDataOutput *videoDataOutput;\n\n    dispatch_queue_t videoDataOutputQueue;\n    CALayer *customPreviewLayer;\n\n    BOOL grayscaleMode;\n\n    BOOL recordVideo;\n    BOOL rotateVideo;\n    AVAssetWriterInput* recordAssetWriterInput;\n    AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor;\n    AVAssetWriter* recordAssetWriter;\n\n    CMTime lastSampleTime;\n\n}\n\n@property (nonatomic, assign) id<CvVideoCameraDelegate> delegate;\n@property (nonatomic, assign) BOOL grayscaleMode;\n\n@property (nonatomic, assign) BOOL recordVideo;\n@property (nonatomic, assign) BOOL rotateVideo;\n@property (nonatomic, retain) AVAssetWriterInput* recordAssetWriterInput;\n@property (nonatomic, retain) AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor;\n@property (nonatomic, retain) AVAssetWriter* recordAssetWriter;\n\n- (void)adjustLayoutToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;\n- (void)layoutPreviewLayer;\n- (void)saveVideo;\n- (NSURL *)videoFileURL;\n- (NSString *)videoFileString;\n\n\n@end\n\n///////////////////////////////// CvPhotoCamera ///////////////////////////////////////////\n\n@class CvPhotoCamera;\n\n@protocol CvPhotoCameraDelegate <NSObject>\n\n- (void)photoCamera:(CvPhotoCamera*)photoCamera capturedImage:(UIImage *)image;\n- (void)photoCameraCancel:(CvPhotoCamera*)photoCamera;\n\n@end\n\n@interface CvPhotoCamera : CvAbstractCamera\n{\n    AVCaptureStillImageOutput *stillImageOutput;\n}\n\n@property (nonatomic, assign) id<CvPhotoCameraDelegate> delegate;\n\n- (void)takePicture;\n\n@end\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/highgui/highgui.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_HIGHGUI_HPP__\n#define __OPENCV_HIGHGUI_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/highgui/highgui_c.h\"\n\n#ifdef __cplusplus\n\nstruct CvCapture;\nstruct CvVideoWriter;\n\nnamespace cv\n{\n\nenum {\n    // Flags for namedWindow\n    WINDOW_NORMAL   = CV_WINDOW_NORMAL,   // the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size\n    WINDOW_AUTOSIZE = CV_WINDOW_AUTOSIZE, // the user cannot resize the window, the size is constrainted by the image displayed\n    WINDOW_OPENGL   = CV_WINDOW_OPENGL,   // window with opengl support\n\n    // Flags for set / getWindowProperty\n    WND_PROP_FULLSCREEN   = CV_WND_PROP_FULLSCREEN,  // fullscreen property\n    WND_PROP_AUTOSIZE     = CV_WND_PROP_AUTOSIZE,    // autosize property\n    WND_PROP_ASPECT_RATIO = CV_WND_PROP_ASPECTRATIO, // window's aspect ration\n    WND_PROP_OPENGL       = CV_WND_PROP_OPENGL       // opengl support\n};\n\nCV_EXPORTS_W void namedWindow(const string& winname, int flags = WINDOW_AUTOSIZE);\nCV_EXPORTS_W void destroyWindow(const string& winname);\nCV_EXPORTS_W void destroyAllWindows();\n\nCV_EXPORTS_W int startWindowThread();\n\nCV_EXPORTS_W int waitKey(int delay = 0);\n\nCV_EXPORTS_W void imshow(const string& winname, InputArray mat);\n\nCV_EXPORTS_W void resizeWindow(const string& winname, int width, int height);\nCV_EXPORTS_W void moveWindow(const string& winname, int x, int y);\n\nCV_EXPORTS_W void setWindowProperty(const string& winname, int prop_id, double prop_value);//YV\nCV_EXPORTS_W double getWindowProperty(const string& winname, int prop_id);//YV\n\nenum\n{\n    EVENT_MOUSEMOVE      =0,\n    EVENT_LBUTTONDOWN    =1,\n    EVENT_RBUTTONDOWN    =2,\n    EVENT_MBUTTONDOWN    =3,\n    EVENT_LBUTTONUP      =4,\n    EVENT_RBUTTONUP      =5,\n    EVENT_MBUTTONUP      =6,\n    EVENT_LBUTTONDBLCLK  =7,\n    EVENT_RBUTTONDBLCLK  =8,\n    EVENT_MBUTTONDBLCLK  =9\n};\n\nenum\n{\n    EVENT_FLAG_LBUTTON   =1,\n    EVENT_FLAG_RBUTTON   =2,\n    EVENT_FLAG_MBUTTON   =4,\n    EVENT_FLAG_CTRLKEY   =8,\n    EVENT_FLAG_SHIFTKEY  =16,\n    EVENT_FLAG_ALTKEY    =32\n};\n\ntypedef void (*MouseCallback)(int event, int x, int y, int flags, void* userdata);\n\n//! assigns callback for mouse events\nCV_EXPORTS void setMouseCallback(const string& winname, MouseCallback onMouse, void* userdata = 0);\n\n\ntypedef void (CV_CDECL *TrackbarCallback)(int pos, void* userdata);\n\nCV_EXPORTS int createTrackbar(const string& trackbarname, const string& winname,\n                              int* value, int count,\n                              TrackbarCallback onChange = 0,\n                              void* userdata = 0);\n\nCV_EXPORTS_W int getTrackbarPos(const string& trackbarname, const string& winname);\nCV_EXPORTS_W void setTrackbarPos(const string& trackbarname, const string& winname, int pos);\n\n// OpenGL support\n\ntypedef void (*OpenGlDrawCallback)(void* userdata);\nCV_EXPORTS void setOpenGlDrawCallback(const string& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata = 0);\n\nCV_EXPORTS void setOpenGlContext(const string& winname);\n\nCV_EXPORTS void updateWindow(const string& winname);\n\n// < Deperecated\nCV_EXPORTS void pointCloudShow(const string& winname, const GlCamera& camera, const GlArrays& arr);\nCV_EXPORTS void pointCloudShow(const string& winname, const GlCamera& camera, InputArray points, InputArray colors = noArray());\n// >\n\n//Only for Qt\n\nCV_EXPORTS CvFont fontQt(const string& nameFont, int pointSize=-1,\n                         Scalar color=Scalar::all(0), int weight=CV_FONT_NORMAL,\n                         int style=CV_STYLE_NORMAL, int spacing=0);\nCV_EXPORTS void addText( const Mat& img, const string& text, Point org, CvFont font);\n\nCV_EXPORTS void displayOverlay(const string& winname, const string& text, int delayms CV_DEFAULT(0));\nCV_EXPORTS void displayStatusBar(const string& winname, const string& text, int delayms CV_DEFAULT(0));\n\nCV_EXPORTS void saveWindowParameters(const string& windowName);\nCV_EXPORTS void loadWindowParameters(const string& windowName);\nCV_EXPORTS  int startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);\nCV_EXPORTS  void stopLoop();\n\ntypedef void (CV_CDECL *ButtonCallback)(int state, void* userdata);\nCV_EXPORTS int createButton( const string& bar_name, ButtonCallback on_change,\n                             void* userdata=NULL, int type=CV_PUSH_BUTTON,\n                             bool initial_button_state=0);\n\n//-------------------------\n\nenum\n{\n    // 8bit, color or not\n    IMREAD_UNCHANGED  =-1,\n    // 8bit, gray\n    IMREAD_GRAYSCALE  =0,\n    // ?, color\n    IMREAD_COLOR      =1,\n    // any depth, ?\n    IMREAD_ANYDEPTH   =2,\n    // ?, any color\n    IMREAD_ANYCOLOR   =4\n};\n\nenum\n{\n    IMWRITE_JPEG_QUALITY =1,\n    IMWRITE_PNG_COMPRESSION =16,\n    IMWRITE_PNG_STRATEGY =17,\n    IMWRITE_PNG_BILEVEL =18,\n    IMWRITE_PNG_STRATEGY_DEFAULT =0,\n    IMWRITE_PNG_STRATEGY_FILTERED =1,\n    IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,\n    IMWRITE_PNG_STRATEGY_RLE =3,\n    IMWRITE_PNG_STRATEGY_FIXED =4,\n    IMWRITE_PXM_BINARY =32\n};\n\nCV_EXPORTS_W Mat imread( const string& filename, int flags=1 );\nCV_EXPORTS_W bool imwrite( const string& filename, InputArray img,\n              const vector<int>& params=vector<int>());\nCV_EXPORTS_W Mat imdecode( InputArray buf, int flags );\nCV_EXPORTS Mat imdecode( InputArray buf, int flags, Mat* dst );\nCV_EXPORTS_W bool imencode( const string& ext, InputArray img,\n                            CV_OUT vector<uchar>& buf,\n                            const vector<int>& params=vector<int>());\n\n#ifndef CV_NO_VIDEO_CAPTURE_CPP_API\n\ntemplate<> void CV_EXPORTS Ptr<CvCapture>::delete_obj();\ntemplate<> void CV_EXPORTS Ptr<CvVideoWriter>::delete_obj();\n\nclass CV_EXPORTS_W VideoCapture\n{\npublic:\n    CV_WRAP VideoCapture();\n    CV_WRAP VideoCapture(const string& filename);\n    CV_WRAP VideoCapture(int device);\n\n    virtual ~VideoCapture();\n    CV_WRAP virtual bool open(const string& filename);\n    CV_WRAP virtual bool open(int device);\n    CV_WRAP virtual bool isOpened() const;\n    CV_WRAP virtual void release();\n\n    CV_WRAP virtual bool grab();\n    CV_WRAP virtual bool retrieve(CV_OUT Mat& image, int channel=0);\n    virtual VideoCapture& operator >> (CV_OUT Mat& image);\n    CV_WRAP virtual bool read(CV_OUT Mat& image);\n\n    CV_WRAP virtual bool set(int propId, double value);\n    CV_WRAP virtual double get(int propId);\n\nprotected:\n    Ptr<CvCapture> cap;\n};\n\n\nclass CV_EXPORTS_W VideoWriter\n{\npublic:\n    CV_WRAP VideoWriter();\n    CV_WRAP VideoWriter(const string& filename, int fourcc, double fps,\n                Size frameSize, bool isColor=true);\n\n    virtual ~VideoWriter();\n    CV_WRAP virtual bool open(const string& filename, int fourcc, double fps,\n                      Size frameSize, bool isColor=true);\n    CV_WRAP virtual bool isOpened() const;\n    CV_WRAP virtual void release();\n    virtual VideoWriter& operator << (const Mat& image);\n    CV_WRAP virtual void write(const Mat& image);\n\nprotected:\n    Ptr<CvVideoWriter> writer;\n};\n\n#endif\n\n}\n\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/highgui/highgui_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_HIGHGUI_H__\n#define __OPENCV_HIGHGUI_H__\n\n#include \"opencv2/core/core_c.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/****************************************************************************************\\\n*                                  Basic GUI functions                                   *\n\\****************************************************************************************/\n//YV\n//-----------New for Qt\n/* For font */\nenum {  CV_FONT_LIGHT           = 25,//QFont::Light,\n        CV_FONT_NORMAL          = 50,//QFont::Normal,\n        CV_FONT_DEMIBOLD        = 63,//QFont::DemiBold,\n        CV_FONT_BOLD            = 75,//QFont::Bold,\n        CV_FONT_BLACK           = 87 //QFont::Black\n};\n\nenum {  CV_STYLE_NORMAL         = 0,//QFont::StyleNormal,\n        CV_STYLE_ITALIC         = 1,//QFont::StyleItalic,\n        CV_STYLE_OBLIQUE        = 2 //QFont::StyleOblique\n};\n/* ---------*/\n\n//for color cvScalar(blue_component, green_component, red\\_component[, alpha_component])\n//and alpha= 0 <-> 0xFF (not transparent <-> transparent)\nCVAPI(CvFont) cvFontQt(const char* nameFont, int pointSize CV_DEFAULT(-1), CvScalar color CV_DEFAULT(cvScalarAll(0)), int weight CV_DEFAULT(CV_FONT_NORMAL),  int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0));\n\nCVAPI(void) cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont *arg2);\n\nCVAPI(void) cvDisplayOverlay(const char* name, const char* text, int delayms CV_DEFAULT(0));\nCVAPI(void) cvDisplayStatusBar(const char* name, const char* text, int delayms CV_DEFAULT(0));\n\nCVAPI(void) cvSaveWindowParameters(const char* name);\nCVAPI(void) cvLoadWindowParameters(const char* name);\nCVAPI(int) cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);\nCVAPI(void) cvStopLoop( void );\n\ntypedef void (CV_CDECL *CvButtonCallback)(int state, void* userdata);\nenum {CV_PUSH_BUTTON = 0, CV_CHECKBOX = 1, CV_RADIOBOX = 2};\nCVAPI(int) cvCreateButton( const char* button_name CV_DEFAULT(NULL),CvButtonCallback on_change CV_DEFAULT(NULL), void* userdata CV_DEFAULT(NULL) , int button_type CV_DEFAULT(CV_PUSH_BUTTON), int initial_button_state CV_DEFAULT(0));\n//----------------------\n\n\n/* this function is used to set some external parameters in case of X Window */\nCVAPI(int) cvInitSystem( int argc, char** argv );\n\nCVAPI(int) cvStartWindowThread( void );\n\n// ---------  YV ---------\nenum\n{\n    //These 3 flags are used by cvSet/GetWindowProperty\n    CV_WND_PROP_FULLSCREEN = 0, //to change/get window's fullscreen property\n    CV_WND_PROP_AUTOSIZE   = 1, //to change/get window's autosize property\n    CV_WND_PROP_ASPECTRATIO= 2, //to change/get window's aspectratio property\n    CV_WND_PROP_OPENGL     = 3, //to change/get window's opengl support\n\n    //These 2 flags are used by cvNamedWindow and cvSet/GetWindowProperty\n    CV_WINDOW_NORMAL       = 0x00000000, //the user can resize the window (no constraint)  / also use to switch a fullscreen window to a normal size\n    CV_WINDOW_AUTOSIZE     = 0x00000001, //the user cannot resize the window, the size is constrainted by the image displayed\n    CV_WINDOW_OPENGL       = 0x00001000, //window with opengl support\n\n    //Those flags are only for Qt\n    CV_GUI_EXPANDED         = 0x00000000, //status bar and tool bar\n    CV_GUI_NORMAL           = 0x00000010, //old fashious way\n\n    //These 3 flags are used by cvNamedWindow and cvSet/GetWindowProperty\n    CV_WINDOW_FULLSCREEN   = 1,//change the window to fullscreen\n    CV_WINDOW_FREERATIO    = 0x00000100,//the image expends as much as it can (no ratio constraint)\n    CV_WINDOW_KEEPRATIO    = 0x00000000//the ration image is respected.\n};\n\n/* create window */\nCVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOSIZE) );\n\n/* Set and Get Property of the window */\nCVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value);\nCVAPI(double) cvGetWindowProperty(const char* name, int prop_id);\n\n/* display image within window (highgui windows remember their content) */\nCVAPI(void) cvShowImage( const char* name, const CvArr* image );\n\n/* resize/move window */\nCVAPI(void) cvResizeWindow( const char* name, int width, int height );\nCVAPI(void) cvMoveWindow( const char* name, int x, int y );\n\n\n/* destroy window and all the trackers associated with it */\nCVAPI(void) cvDestroyWindow( const char* name );\n\nCVAPI(void) cvDestroyAllWindows(void);\n\n/* get native window handle (HWND in case of Win32 and Widget in case of X Window) */\nCVAPI(void*) cvGetWindowHandle( const char* name );\n\n/* get name of highgui window given its native handle */\nCVAPI(const char*) cvGetWindowName( void* window_handle );\n\n\ntypedef void (CV_CDECL *CvTrackbarCallback)(int pos);\n\n/* create trackbar and display it on top of given window, set callback */\nCVAPI(int) cvCreateTrackbar( const char* trackbar_name, const char* window_name,\n                             int* value, int count, CvTrackbarCallback on_change CV_DEFAULT(NULL));\n\ntypedef void (CV_CDECL *CvTrackbarCallback2)(int pos, void* userdata);\n\nCVAPI(int) cvCreateTrackbar2( const char* trackbar_name, const char* window_name,\n                              int* value, int count, CvTrackbarCallback2 on_change,\n                              void* userdata CV_DEFAULT(0));\n\n/* retrieve or set trackbar position */\nCVAPI(int) cvGetTrackbarPos( const char* trackbar_name, const char* window_name );\nCVAPI(void) cvSetTrackbarPos( const char* trackbar_name, const char* window_name, int pos );\nCVAPI(void) cvSetTrackbarMax(const char* trackbar_name, const char* window_name, int maxval);\n\nenum\n{\n    CV_EVENT_MOUSEMOVE      =0,\n    CV_EVENT_LBUTTONDOWN    =1,\n    CV_EVENT_RBUTTONDOWN    =2,\n    CV_EVENT_MBUTTONDOWN    =3,\n    CV_EVENT_LBUTTONUP      =4,\n    CV_EVENT_RBUTTONUP      =5,\n    CV_EVENT_MBUTTONUP      =6,\n    CV_EVENT_LBUTTONDBLCLK  =7,\n    CV_EVENT_RBUTTONDBLCLK  =8,\n    CV_EVENT_MBUTTONDBLCLK  =9\n};\n\nenum\n{\n    CV_EVENT_FLAG_LBUTTON   =1,\n    CV_EVENT_FLAG_RBUTTON   =2,\n    CV_EVENT_FLAG_MBUTTON   =4,\n    CV_EVENT_FLAG_CTRLKEY   =8,\n    CV_EVENT_FLAG_SHIFTKEY  =16,\n    CV_EVENT_FLAG_ALTKEY    =32\n};\n\ntypedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, void* param);\n\n/* assign callback for mouse events */\nCVAPI(void) cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse,\n                                void* param CV_DEFAULT(NULL));\n\nenum\n{\n/* 8bit, color or not */\n    CV_LOAD_IMAGE_UNCHANGED  =-1,\n/* 8bit, gray */\n    CV_LOAD_IMAGE_GRAYSCALE  =0,\n/* ?, color */\n    CV_LOAD_IMAGE_COLOR      =1,\n/* any depth, ? */\n    CV_LOAD_IMAGE_ANYDEPTH   =2,\n/* ?, any color */\n    CV_LOAD_IMAGE_ANYCOLOR   =4\n};\n\n/* load image from file\n  iscolor can be a combination of above flags where CV_LOAD_IMAGE_UNCHANGED\n  overrides the other flags\n  using CV_LOAD_IMAGE_ANYCOLOR alone is equivalent to CV_LOAD_IMAGE_UNCHANGED\n  unless CV_LOAD_IMAGE_ANYDEPTH is specified images are converted to 8bit\n*/\nCVAPI(IplImage*) cvLoadImage( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));\nCVAPI(CvMat*) cvLoadImageM( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));\n\nenum\n{\n    CV_IMWRITE_JPEG_QUALITY =1,\n    CV_IMWRITE_PNG_COMPRESSION =16,\n    CV_IMWRITE_PNG_STRATEGY =17,\n    CV_IMWRITE_PNG_BILEVEL =18,\n    CV_IMWRITE_PNG_STRATEGY_DEFAULT =0,\n    CV_IMWRITE_PNG_STRATEGY_FILTERED =1,\n    CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,\n    CV_IMWRITE_PNG_STRATEGY_RLE =3,\n    CV_IMWRITE_PNG_STRATEGY_FIXED =4,\n    CV_IMWRITE_PXM_BINARY =32\n};\n\n/* save image to file */\nCVAPI(int) cvSaveImage( const char* filename, const CvArr* image,\n                        const int* params CV_DEFAULT(0) );\n\n/* decode image stored in the buffer */\nCVAPI(IplImage*) cvDecodeImage( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));\nCVAPI(CvMat*) cvDecodeImageM( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));\n\n/* encode image and store the result as a byte vector (single-row 8uC1 matrix) */\nCVAPI(CvMat*) cvEncodeImage( const char* ext, const CvArr* image,\n                             const int* params CV_DEFAULT(0) );\n\nenum\n{\n    CV_CVTIMG_FLIP      =1,\n    CV_CVTIMG_SWAP_RB   =2\n};\n\n/* utility function: convert one image to another with optional vertical flip */\nCVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0));\n\n/* wait for key event infinitely (delay<=0) or for \"delay\" milliseconds */\nCVAPI(int) cvWaitKey(int delay CV_DEFAULT(0));\n\n// OpenGL support\n\ntypedef void (CV_CDECL *CvOpenGlDrawCallback)(void* userdata);\nCVAPI(void) cvSetOpenGlDrawCallback(const char* window_name, CvOpenGlDrawCallback callback, void* userdata CV_DEFAULT(NULL));\n\nCVAPI(void) cvSetOpenGlContext(const char* window_name);\nCVAPI(void) cvUpdateWindow(const char* window_name);\n\n\n/****************************************************************************************\\\n*                         Working with Video Files and Cameras                           *\n\\****************************************************************************************/\n\n/* \"black box\" capture structure */\ntypedef struct CvCapture CvCapture;\n\n/* start capturing frames from video file */\nCVAPI(CvCapture*) cvCreateFileCapture( const char* filename );\n\nenum\n{\n    CV_CAP_ANY      =0,     // autodetect\n\n    CV_CAP_MIL      =100,   // MIL proprietary drivers\n\n    CV_CAP_VFW      =200,   // platform native\n    CV_CAP_V4L      =200,\n    CV_CAP_V4L2     =200,\n\n    CV_CAP_FIREWARE =300,   // IEEE 1394 drivers\n    CV_CAP_FIREWIRE =300,\n    CV_CAP_IEEE1394 =300,\n    CV_CAP_DC1394   =300,\n    CV_CAP_CMU1394  =300,\n\n    CV_CAP_STEREO   =400,   // TYZX proprietary drivers\n    CV_CAP_TYZX     =400,\n    CV_TYZX_LEFT    =400,\n    CV_TYZX_RIGHT   =401,\n    CV_TYZX_COLOR   =402,\n    CV_TYZX_Z       =403,\n\n    CV_CAP_QT       =500,   // QuickTime\n\n    CV_CAP_UNICAP   =600,   // Unicap drivers\n\n    CV_CAP_DSHOW    =700,   // DirectShow (via videoInput)\n    CV_CAP_MSMF     =1400,  // Microsoft Media Foundation (via videoInput)\n\n    CV_CAP_PVAPI    =800,   // PvAPI, Prosilica GigE SDK\n\n    CV_CAP_OPENNI   =900,   // OpenNI (for Kinect)\n    CV_CAP_OPENNI_ASUS =910,   // OpenNI (for Asus Xtion)\n\n    CV_CAP_ANDROID  =1000,  // Android\n    CV_CAP_ANDROID_BACK =CV_CAP_ANDROID+99, // Android back camera\n    CV_CAP_ANDROID_FRONT =CV_CAP_ANDROID+98, // Android front camera\n\n    CV_CAP_XIAPI    =1100,   // XIMEA Camera API\n\n    CV_CAP_AVFOUNDATION = 1200,  // AVFoundation framework for iOS (OS X Lion will have the same API)\n\n    CV_CAP_GIGANETIX = 1300,  // Smartek Giganetix GigEVisionSDK\n\n    CV_CAP_INTELPERC = 1500 // Intel Perceptual Computing SDK\n};\n\n/* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */\nCVAPI(CvCapture*) cvCreateCameraCapture( int index );\n\n/* grab a frame, return 1 on success, 0 on fail.\n  this function is thought to be fast               */\nCVAPI(int) cvGrabFrame( CvCapture* capture );\n\n/* get the frame grabbed with cvGrabFrame(..)\n  This function may apply some frame processing like\n  frame decompression, flipping etc.\n  !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */\nCVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture, int streamIdx CV_DEFAULT(0) );\n\n/* Just a combination of cvGrabFrame and cvRetrieveFrame\n   !!!DO NOT RELEASE or MODIFY the retrieved frame!!!      */\nCVAPI(IplImage*) cvQueryFrame( CvCapture* capture );\n\n/* stop capturing/reading and free resources */\nCVAPI(void) cvReleaseCapture( CvCapture** capture );\n\nenum\n{\n    // modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)\n    // every feature can have only one mode turned on at a time\n    CV_CAP_PROP_DC1394_OFF         = -4,  //turn the feature off (not controlled manually nor automatically)\n    CV_CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user\n    CV_CAP_PROP_DC1394_MODE_AUTO = -2,\n    CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,\n    CV_CAP_PROP_POS_MSEC       =0,\n    CV_CAP_PROP_POS_FRAMES     =1,\n    CV_CAP_PROP_POS_AVI_RATIO  =2,\n    CV_CAP_PROP_FRAME_WIDTH    =3,\n    CV_CAP_PROP_FRAME_HEIGHT   =4,\n    CV_CAP_PROP_FPS            =5,\n    CV_CAP_PROP_FOURCC         =6,\n    CV_CAP_PROP_FRAME_COUNT    =7,\n    CV_CAP_PROP_FORMAT         =8,\n    CV_CAP_PROP_MODE           =9,\n    CV_CAP_PROP_BRIGHTNESS    =10,\n    CV_CAP_PROP_CONTRAST      =11,\n    CV_CAP_PROP_SATURATION    =12,\n    CV_CAP_PROP_HUE           =13,\n    CV_CAP_PROP_GAIN          =14,\n    CV_CAP_PROP_EXPOSURE      =15,\n    CV_CAP_PROP_CONVERT_RGB   =16,\n    CV_CAP_PROP_WHITE_BALANCE_U =17,\n    CV_CAP_PROP_RECTIFICATION =18,\n    CV_CAP_PROP_MONOCROME     =19,\n    CV_CAP_PROP_SHARPNESS     =20,\n    CV_CAP_PROP_AUTO_EXPOSURE =21, // exposure control done by camera,\n                                   // user can adjust refernce level\n                                   // using this feature\n    CV_CAP_PROP_GAMMA         =22,\n    CV_CAP_PROP_TEMPERATURE   =23,\n    CV_CAP_PROP_TRIGGER       =24,\n    CV_CAP_PROP_TRIGGER_DELAY =25,\n    CV_CAP_PROP_WHITE_BALANCE_V =26,\n    CV_CAP_PROP_ZOOM          =27,\n    CV_CAP_PROP_FOCUS         =28,\n    CV_CAP_PROP_GUID          =29,\n    CV_CAP_PROP_ISO_SPEED     =30,\n    CV_CAP_PROP_MAX_DC1394    =31,\n    CV_CAP_PROP_BACKLIGHT     =32,\n    CV_CAP_PROP_PAN           =33,\n    CV_CAP_PROP_TILT          =34,\n    CV_CAP_PROP_ROLL          =35,\n    CV_CAP_PROP_IRIS          =36,\n    CV_CAP_PROP_SETTINGS      =37,\n    CV_CAP_PROP_BUFFERSIZE    =38,\n\n    CV_CAP_PROP_AUTOGRAB      =1024, // property for highgui class CvCapture_Android only\n    CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // readonly, tricky property, returns cpnst char* indeed\n    CV_CAP_PROP_PREVIEW_FORMAT=1026, // readonly, tricky property, returns cpnst char* indeed\n\n    // OpenNI map generators\n    CV_CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,\n    CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,\n    CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR,\n\n    // Properties of cameras available through OpenNI interfaces\n    CV_CAP_PROP_OPENNI_OUTPUT_MODE     = 100,\n    CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm\n    CV_CAP_PROP_OPENNI_BASELINE        = 102, // in mm\n    CV_CAP_PROP_OPENNI_FOCAL_LENGTH    = 103, // in pixels\n    CV_CAP_PROP_OPENNI_REGISTRATION    = 104, // flag\n    CV_CAP_PROP_OPENNI_REGISTRATION_ON = CV_CAP_PROP_OPENNI_REGISTRATION, // flag that synchronizes the remapping depth map to image map\n                                                                          // by changing depth generator's view point (if the flag is \"on\") or\n                                                                          // sets this view point to its normal one (if the flag is \"off\").\n    CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,\n    CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE   = 106,\n    CV_CAP_PROP_OPENNI_CIRCLE_BUFFER     = 107,\n    CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108,\n\n    CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109,\n\n    CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT         = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,\n    CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE     = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE,\n    CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE,\n    CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH,\n    CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION,\n    CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,\n\n    // Properties of cameras available through GStreamer interface\n    CV_CAP_GSTREAMER_QUEUE_LENGTH   = 200, // default is 1\n\n    // PVAPI\n    CV_CAP_PROP_PVAPI_MULTICASTIP           = 300, // ip for anable multicast master mode. 0 for disable multicast\n    CV_CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, // FrameStartTriggerMode: Determines how a frame is initiated\n    CV_CAP_PROP_PVAPI_DECIMATIONHORIZONTAL  = 302, // Horizontal sub-sampling of the image\n    CV_CAP_PROP_PVAPI_DECIMATIONVERTICAL    = 303, // Vertical sub-sampling of the image\n    CV_CAP_PROP_PVAPI_BINNINGX              = 304, // Horizontal binning factor\n    CV_CAP_PROP_PVAPI_BINNINGY              = 305, // Vertical binning factor\n    CV_CAP_PROP_PVAPI_PIXELFORMAT           = 306, // Pixel format\n\n    // Properties of cameras available through XIMEA SDK interface\n    CV_CAP_PROP_XI_DOWNSAMPLING  = 400,      // Change image resolution by binning or skipping.\n    CV_CAP_PROP_XI_DATA_FORMAT   = 401,       // Output data format.\n    CV_CAP_PROP_XI_OFFSET_X      = 402,      // Horizontal offset from the origin to the area of interest (in pixels).\n    CV_CAP_PROP_XI_OFFSET_Y      = 403,      // Vertical offset from the origin to the area of interest (in pixels).\n    CV_CAP_PROP_XI_TRG_SOURCE    = 404,      // Defines source of trigger.\n    CV_CAP_PROP_XI_TRG_SOFTWARE  = 405,      // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.\n    CV_CAP_PROP_XI_GPI_SELECTOR  = 406,      // Selects general purpose input\n    CV_CAP_PROP_XI_GPI_MODE      = 407,      // Set general purpose input mode\n    CV_CAP_PROP_XI_GPI_LEVEL     = 408,      // Get general purpose level\n    CV_CAP_PROP_XI_GPO_SELECTOR  = 409,      // Selects general purpose output\n    CV_CAP_PROP_XI_GPO_MODE      = 410,      // Set general purpose output mode\n    CV_CAP_PROP_XI_LED_SELECTOR  = 411,      // Selects camera signalling LED\n    CV_CAP_PROP_XI_LED_MODE      = 412,      // Define camera signalling LED functionality\n    CV_CAP_PROP_XI_MANUAL_WB     = 413,      // Calculates White Balance(must be called during acquisition)\n    CV_CAP_PROP_XI_AUTO_WB       = 414,      // Automatic white balance\n    CV_CAP_PROP_XI_AEAG          = 415,      // Automatic exposure/gain\n    CV_CAP_PROP_XI_EXP_PRIORITY  = 416,      // Exposure priority (0.5 - exposure 50%, gain 50%).\n    CV_CAP_PROP_XI_AE_MAX_LIMIT  = 417,      // Maximum limit of exposure in AEAG procedure\n    CV_CAP_PROP_XI_AG_MAX_LIMIT  = 418,      // Maximum limit of gain in AEAG procedure\n    CV_CAP_PROP_XI_AEAG_LEVEL    = 419,       // Average intensity of output signal AEAG should achieve(in %)\n    CV_CAP_PROP_XI_TIMEOUT       = 420,       // Image capture timeout in milliseconds\n\n    // Properties for Android cameras\n    CV_CAP_PROP_ANDROID_FLASH_MODE = 8001,\n    CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002,\n    CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003,\n    CV_CAP_PROP_ANDROID_ANTIBANDING = 8004,\n    CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005,\n    CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006,\n    CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007,\n    CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008,\n    CV_CAP_PROP_ANDROID_EXPOSE_LOCK = 8009,\n    CV_CAP_PROP_ANDROID_WHITEBALANCE_LOCK = 8010,\n\n    // Properties of cameras available through AVFOUNDATION interface\n    CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001,\n    CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002,\n    CV_CAP_PROP_IOS_DEVICE_FLASH = 9003,\n    CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,\n    CV_CAP_PROP_IOS_DEVICE_TORCH = 9005,\n\n    // Properties of cameras available through Smartek Giganetix Ethernet Vision interface\n    /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */\n    CV_CAP_PROP_GIGA_FRAME_OFFSET_X = 10001,\n    CV_CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002,\n    CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003,\n    CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004,\n    CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,\n    CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006,\n\n    CV_CAP_PROP_INTELPERC_PROFILE_COUNT               = 11001,\n    CV_CAP_PROP_INTELPERC_PROFILE_IDX                 = 11002,\n    CV_CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE  = 11003,\n    CV_CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE      = 11004,\n    CV_CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD  = 11005,\n    CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ     = 11006,\n    CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT     = 11007,\n\n    // Intel PerC streams\n    CV_CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29,\n    CV_CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28,\n    CV_CAP_INTELPERC_GENERATORS_MASK = CV_CAP_INTELPERC_DEPTH_GENERATOR + CV_CAP_INTELPERC_IMAGE_GENERATOR\n};\n\nenum\n{\n    // Data given from depth generator.\n    CV_CAP_OPENNI_DEPTH_MAP                 = 0, // Depth values in mm (CV_16UC1)\n    CV_CAP_OPENNI_POINT_CLOUD_MAP           = 1, // XYZ in meters (CV_32FC3)\n    CV_CAP_OPENNI_DISPARITY_MAP             = 2, // Disparity in pixels (CV_8UC1)\n    CV_CAP_OPENNI_DISPARITY_MAP_32F         = 3, // Disparity in pixels (CV_32FC1)\n    CV_CAP_OPENNI_VALID_DEPTH_MASK          = 4, // CV_8UC1\n\n    // Data given from RGB image generator.\n    CV_CAP_OPENNI_BGR_IMAGE                 = 5,\n    CV_CAP_OPENNI_GRAY_IMAGE                = 6\n};\n\n// Supported output modes of OpenNI image generator\nenum\n{\n    CV_CAP_OPENNI_VGA_30HZ     = 0,\n    CV_CAP_OPENNI_SXGA_15HZ    = 1,\n    CV_CAP_OPENNI_SXGA_30HZ    = 2,\n    CV_CAP_OPENNI_QVGA_30HZ    = 3,\n    CV_CAP_OPENNI_QVGA_60HZ    = 4\n};\n\n//supported by Android camera output formats\nenum\n{\n    CV_CAP_ANDROID_COLOR_FRAME_BGR = 0, //BGR\n    CV_CAP_ANDROID_COLOR_FRAME = CV_CAP_ANDROID_COLOR_FRAME_BGR,\n    CV_CAP_ANDROID_GREY_FRAME  = 1,  //Y\n    CV_CAP_ANDROID_COLOR_FRAME_RGB = 2,\n    CV_CAP_ANDROID_COLOR_FRAME_BGRA = 3,\n    CV_CAP_ANDROID_COLOR_FRAME_RGBA = 4\n};\n\n// supported Android camera flash modes\nenum\n{\n    CV_CAP_ANDROID_FLASH_MODE_AUTO = 0,\n    CV_CAP_ANDROID_FLASH_MODE_OFF,\n    CV_CAP_ANDROID_FLASH_MODE_ON,\n    CV_CAP_ANDROID_FLASH_MODE_RED_EYE,\n    CV_CAP_ANDROID_FLASH_MODE_TORCH\n};\n\n// supported Android camera focus modes\nenum\n{\n    CV_CAP_ANDROID_FOCUS_MODE_AUTO = 0,\n    CV_CAP_ANDROID_FOCUS_MODE_CONTINUOUS_PICTURE,\n    CV_CAP_ANDROID_FOCUS_MODE_CONTINUOUS_VIDEO,\n    CV_CAP_ANDROID_FOCUS_MODE_EDOF,\n    CV_CAP_ANDROID_FOCUS_MODE_FIXED,\n    CV_CAP_ANDROID_FOCUS_MODE_INFINITY,\n    CV_CAP_ANDROID_FOCUS_MODE_MACRO\n};\n\n// supported Android camera white balance modes\nenum\n{\n    CV_CAP_ANDROID_WHITE_BALANCE_AUTO = 0,\n    CV_CAP_ANDROID_WHITE_BALANCE_CLOUDY_DAYLIGHT,\n    CV_CAP_ANDROID_WHITE_BALANCE_DAYLIGHT,\n    CV_CAP_ANDROID_WHITE_BALANCE_FLUORESCENT,\n    CV_CAP_ANDROID_WHITE_BALANCE_INCANDESCENT,\n    CV_CAP_ANDROID_WHITE_BALANCE_SHADE,\n    CV_CAP_ANDROID_WHITE_BALANCE_TWILIGHT,\n    CV_CAP_ANDROID_WHITE_BALANCE_WARM_FLUORESCENT\n};\n\n// supported Android camera antibanding modes\nenum\n{\n    CV_CAP_ANDROID_ANTIBANDING_50HZ = 0,\n    CV_CAP_ANDROID_ANTIBANDING_60HZ,\n    CV_CAP_ANDROID_ANTIBANDING_AUTO,\n    CV_CAP_ANDROID_ANTIBANDING_OFF\n};\n\nenum\n{\n    CV_CAP_INTELPERC_DEPTH_MAP              = 0, // Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth.\n    CV_CAP_INTELPERC_UVDEPTH_MAP            = 1, // Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates.\n    CV_CAP_INTELPERC_IR_MAP                 = 2, // Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.\n    CV_CAP_INTELPERC_IMAGE                  = 3\n};\n\n/* retrieve or set capture properties */\nCVAPI(double) cvGetCaptureProperty( CvCapture* capture, int property_id );\nCVAPI(int)    cvSetCaptureProperty( CvCapture* capture, int property_id, double value );\n\n// Return the type of the capturer (eg, CV_CAP_V4W, CV_CAP_UNICAP), which is unknown if created with CV_CAP_ANY\nCVAPI(int)    cvGetCaptureDomain( CvCapture* capture);\n\n/* \"black box\" video file writer structure */\ntypedef struct CvVideoWriter CvVideoWriter;\n\n#define CV_FOURCC_MACRO(c1, c2, c3, c4) (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24))\n\nCV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4)\n{\n    return CV_FOURCC_MACRO(c1, c2, c3, c4);\n}\n\n#define CV_FOURCC_PROMPT -1  /* Open Codec Selection Dialog (Windows only) */\n#define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V') /* Use default codec for specified filename (Linux only) */\n\n/* initialize video file writer */\nCVAPI(CvVideoWriter*) cvCreateVideoWriter( const char* filename, int fourcc,\n                                           double fps, CvSize frame_size,\n                                           int is_color CV_DEFAULT(1));\n\n//CVAPI(CvVideoWriter*) cvCreateImageSequenceWriter( const char* filename,\n//                                                   int is_color CV_DEFAULT(1));\n\n/* write frame to video file */\nCVAPI(int) cvWriteFrame( CvVideoWriter* writer, const IplImage* image );\n\n/* close video file writer */\nCVAPI(void) cvReleaseVideoWriter( CvVideoWriter** writer );\n\n/****************************************************************************************\\\n*                              Obsolete functions/synonyms                               *\n\\****************************************************************************************/\n\n#define cvCaptureFromFile cvCreateFileCapture\n#define cvCaptureFromCAM cvCreateCameraCapture\n#define cvCaptureFromAVI cvCaptureFromFile\n#define cvCreateAVIWriter cvCreateVideoWriter\n#define cvWriteToAVI cvWriteFrame\n#define cvAddSearchPath(path)\n#define cvvInitSystem cvInitSystem\n#define cvvNamedWindow cvNamedWindow\n#define cvvShowImage cvShowImage\n#define cvvResizeWindow cvResizeWindow\n#define cvvDestroyWindow cvDestroyWindow\n#define cvvCreateTrackbar cvCreateTrackbar\n#define cvvLoadImage(name) cvLoadImage((name),1)\n#define cvvSaveImage cvSaveImage\n#define cvvAddSearchPath cvAddSearchPath\n#define cvvWaitKey(name) cvWaitKey(0)\n#define cvvWaitKeyEx(name,delay) cvWaitKey(delay)\n#define cvvConvertImage cvConvertImage\n#define HG_AUTOSIZE CV_WINDOW_AUTOSIZE\n#define set_preprocess_func cvSetPreprocessFuncWin32\n#define set_postprocess_func cvSetPostprocessFuncWin32\n\n#if defined WIN32 || defined _WIN32\n\nCVAPI(void) cvSetPreprocessFuncWin32_(const void* callback);\nCVAPI(void) cvSetPostprocessFuncWin32_(const void* callback);\n#define cvSetPreprocessFuncWin32(callback) cvSetPreprocessFuncWin32_((const void*)(callback))\n#define cvSetPostprocessFuncWin32(callback) cvSetPostprocessFuncWin32_((const void*)(callback))\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/highgui/ios.h",
    "content": "\n/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#include \"opencv2/core/core.hpp\"\n#import \"opencv2/highgui/cap_ios.h\"\n\nUIImage* MatToUIImage(const cv::Mat& image);\nvoid UIImageToMat(const UIImage* image,\n                         cv::Mat& m, bool alphaExist = false);\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/imgproc/imgproc.hpp",
    "content": "/*! \\file imgproc.hpp\n \\brief The Image Processing\n */\n\n/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_IMGPROC_HPP__\n#define __OPENCV_IMGPROC_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/imgproc/types_c.h\"\n\n#ifdef __cplusplus\n\n/*! \\namespace cv\n Namespace where all the C++ OpenCV functionality resides\n */\nnamespace cv\n{\n\n//! various border interpolation methods\nenum { BORDER_REPLICATE=IPL_BORDER_REPLICATE, BORDER_CONSTANT=IPL_BORDER_CONSTANT,\n       BORDER_REFLECT=IPL_BORDER_REFLECT, BORDER_WRAP=IPL_BORDER_WRAP,\n       BORDER_REFLECT_101=IPL_BORDER_REFLECT_101, BORDER_REFLECT101=BORDER_REFLECT_101,\n       BORDER_TRANSPARENT=IPL_BORDER_TRANSPARENT,\n       BORDER_DEFAULT=BORDER_REFLECT_101, BORDER_ISOLATED=16 };\n\n//! 1D interpolation function: returns coordinate of the \"donor\" pixel for the specified location p.\nCV_EXPORTS_W int borderInterpolate( int p, int len, int borderType );\n\n/*!\n The Base Class for 1D or Row-wise Filters\n\n This is the base class for linear or non-linear filters that process 1D data.\n In particular, such filters are used for the \"horizontal\" filtering parts in separable filters.\n\n Several functions in OpenCV return Ptr<BaseRowFilter> for the specific types of filters,\n and those pointers can be used directly or within cv::FilterEngine.\n*/\nclass CV_EXPORTS BaseRowFilter\n{\npublic:\n    //! the default constructor\n    BaseRowFilter();\n    //! the destructor\n    virtual ~BaseRowFilter();\n    //! the filtering operator. Must be overridden in the derived classes. The horizontal border interpolation is done outside of the class.\n    virtual void operator()(const uchar* src, uchar* dst,\n                            int width, int cn) = 0;\n    int ksize, anchor;\n};\n\n\n/*!\n The Base Class for Column-wise Filters\n\n This is the base class for linear or non-linear filters that process columns of 2D arrays.\n Such filters are used for the \"vertical\" filtering parts in separable filters.\n\n Several functions in OpenCV return Ptr<BaseColumnFilter> for the specific types of filters,\n and those pointers can be used directly or within cv::FilterEngine.\n\n Unlike cv::BaseRowFilter, cv::BaseColumnFilter may have some context information,\n i.e. box filter keeps the sliding sum of elements. To reset the state BaseColumnFilter::reset()\n must be called (e.g. the method is called by cv::FilterEngine)\n */\nclass CV_EXPORTS BaseColumnFilter\n{\npublic:\n    //! the default constructor\n    BaseColumnFilter();\n    //! the destructor\n    virtual ~BaseColumnFilter();\n    //! the filtering operator. Must be overridden in the derived classes. The vertical border interpolation is done outside of the class.\n    virtual void operator()(const uchar** src, uchar* dst, int dststep,\n                            int dstcount, int width) = 0;\n    //! resets the internal buffers, if any\n    virtual void reset();\n    int ksize, anchor;\n};\n\n/*!\n The Base Class for Non-Separable 2D Filters.\n\n This is the base class for linear or non-linear 2D filters.\n\n Several functions in OpenCV return Ptr<BaseFilter> for the specific types of filters,\n and those pointers can be used directly or within cv::FilterEngine.\n\n Similar to cv::BaseColumnFilter, the class may have some context information,\n that should be reset using BaseFilter::reset() method before processing the new array.\n*/\nclass CV_EXPORTS BaseFilter\n{\npublic:\n    //! the default constructor\n    BaseFilter();\n    //! the destructor\n    virtual ~BaseFilter();\n    //! the filtering operator. The horizontal and the vertical border interpolation is done outside of the class.\n    virtual void operator()(const uchar** src, uchar* dst, int dststep,\n                            int dstcount, int width, int cn) = 0;\n    //! resets the internal buffers, if any\n    virtual void reset();\n    Size ksize;\n    Point anchor;\n};\n\n/*!\n The Main Class for Image Filtering.\n\n The class can be used to apply an arbitrary filtering operation to an image.\n It contains all the necessary intermediate buffers, it computes extrapolated values\n of the \"virtual\" pixels outside of the image etc.\n Pointers to the initialized cv::FilterEngine instances\n are returned by various OpenCV functions, such as cv::createSeparableLinearFilter(),\n cv::createLinearFilter(), cv::createGaussianFilter(), cv::createDerivFilter(),\n cv::createBoxFilter() and cv::createMorphologyFilter().\n\n Using the class you can process large images by parts and build complex pipelines\n that include filtering as some of the stages. If all you need is to apply some pre-defined\n filtering operation, you may use cv::filter2D(), cv::erode(), cv::dilate() etc.\n functions that create FilterEngine internally.\n\n Here is the example on how to use the class to implement Laplacian operator, which is the sum of\n second-order derivatives. More complex variant for different types is implemented in cv::Laplacian().\n\n \\code\n void laplace_f(const Mat& src, Mat& dst)\n {\n     CV_Assert( src.type() == CV_32F );\n     // make sure the destination array has the proper size and type\n     dst.create(src.size(), src.type());\n\n     // get the derivative and smooth kernels for d2I/dx2.\n     // for d2I/dy2 we could use the same kernels, just swapped\n     Mat kd, ks;\n     getSobelKernels( kd, ks, 2, 0, ksize, false, ktype );\n\n     // let's process 10 source rows at once\n     int DELTA = std::min(10, src.rows);\n     Ptr<FilterEngine> Fxx = createSeparableLinearFilter(src.type(),\n     dst.type(), kd, ks, Point(-1,-1), 0, borderType, borderType, Scalar() );\n     Ptr<FilterEngine> Fyy = createSeparableLinearFilter(src.type(),\n     dst.type(), ks, kd, Point(-1,-1), 0, borderType, borderType, Scalar() );\n\n     int y = Fxx->start(src), dsty = 0, dy = 0;\n     Fyy->start(src);\n     const uchar* sptr = src.data + y*src.step;\n\n     // allocate the buffers for the spatial image derivatives;\n     // the buffers need to have more than DELTA rows, because at the\n     // last iteration the output may take max(kd.rows-1,ks.rows-1)\n     // rows more than the input.\n     Mat Ixx( DELTA + kd.rows - 1, src.cols, dst.type() );\n     Mat Iyy( DELTA + kd.rows - 1, src.cols, dst.type() );\n\n     // inside the loop we always pass DELTA rows to the filter\n     // (note that the \"proceed\" method takes care of possibe overflow, since\n     // it was given the actual image height in the \"start\" method)\n     // on output we can get:\n     //  * < DELTA rows (the initial buffer accumulation stage)\n     //  * = DELTA rows (settled state in the middle)\n     //  * > DELTA rows (then the input image is over, but we generate\n     //                  \"virtual\" rows using the border mode and filter them)\n     // this variable number of output rows is dy.\n     // dsty is the current output row.\n     // sptr is the pointer to the first input row in the portion to process\n     for( ; dsty < dst.rows; sptr += DELTA*src.step, dsty += dy )\n     {\n         Fxx->proceed( sptr, (int)src.step, DELTA, Ixx.data, (int)Ixx.step );\n         dy = Fyy->proceed( sptr, (int)src.step, DELTA, d2y.data, (int)Iyy.step );\n         if( dy > 0 )\n         {\n             Mat dstripe = dst.rowRange(dsty, dsty + dy);\n             add(Ixx.rowRange(0, dy), Iyy.rowRange(0, dy), dstripe);\n         }\n     }\n }\n \\endcode\n*/\nclass CV_EXPORTS FilterEngine\n{\npublic:\n    //! the default constructor\n    FilterEngine();\n    //! the full constructor. Either _filter2D or both _rowFilter and _columnFilter must be non-empty.\n    FilterEngine(const Ptr<BaseFilter>& _filter2D,\n                 const Ptr<BaseRowFilter>& _rowFilter,\n                 const Ptr<BaseColumnFilter>& _columnFilter,\n                 int srcType, int dstType, int bufType,\n                 int _rowBorderType=BORDER_REPLICATE,\n                 int _columnBorderType=-1,\n                 const Scalar& _borderValue=Scalar());\n    //! the destructor\n    virtual ~FilterEngine();\n    //! reinitializes the engine. The previously assigned filters are released.\n    void init(const Ptr<BaseFilter>& _filter2D,\n              const Ptr<BaseRowFilter>& _rowFilter,\n              const Ptr<BaseColumnFilter>& _columnFilter,\n              int srcType, int dstType, int bufType,\n              int _rowBorderType=BORDER_REPLICATE, int _columnBorderType=-1,\n              const Scalar& _borderValue=Scalar());\n    //! starts filtering of the specified ROI of an image of size wholeSize.\n    virtual int start(Size wholeSize, Rect roi, int maxBufRows=-1);\n    //! starts filtering of the specified ROI of the specified image.\n    virtual int start(const Mat& src, const Rect& srcRoi=Rect(0,0,-1,-1),\n                      bool isolated=false, int maxBufRows=-1);\n    //! processes the next srcCount rows of the image.\n    virtual int proceed(const uchar* src, int srcStep, int srcCount,\n                        uchar* dst, int dstStep);\n    //! applies filter to the specified ROI of the image. if srcRoi=(0,0,-1,-1), the whole image is filtered.\n    virtual void apply( const Mat& src, Mat& dst,\n                        const Rect& srcRoi=Rect(0,0,-1,-1),\n                        Point dstOfs=Point(0,0),\n                        bool isolated=false);\n    //! returns true if the filter is separable\n    bool isSeparable() const { return (const BaseFilter*)filter2D == 0; }\n    //! returns the number\n    int remainingInputRows() const;\n    int remainingOutputRows() const;\n\n    int srcType, dstType, bufType;\n    Size ksize;\n    Point anchor;\n    int maxWidth;\n    Size wholeSize;\n    Rect roi;\n    int dx1, dx2;\n    int rowBorderType, columnBorderType;\n    vector<int> borderTab;\n    int borderElemSize;\n    vector<uchar> ringBuf;\n    vector<uchar> srcRow;\n    vector<uchar> constBorderValue;\n    vector<uchar> constBorderRow;\n    int bufStep, startY, startY0, endY, rowCount, dstY;\n    vector<uchar*> rows;\n\n    Ptr<BaseFilter> filter2D;\n    Ptr<BaseRowFilter> rowFilter;\n    Ptr<BaseColumnFilter> columnFilter;\n};\n\n//! type of the kernel\nenum { KERNEL_GENERAL=0, KERNEL_SYMMETRICAL=1, KERNEL_ASYMMETRICAL=2,\n       KERNEL_SMOOTH=4, KERNEL_INTEGER=8 };\n\n//! returns type (one of KERNEL_*) of 1D or 2D kernel specified by its coefficients.\nCV_EXPORTS int getKernelType(InputArray kernel, Point anchor);\n\n//! returns the primitive row filter with the specified kernel\nCV_EXPORTS Ptr<BaseRowFilter> getLinearRowFilter(int srcType, int bufType,\n                                            InputArray kernel, int anchor,\n                                            int symmetryType);\n\n//! returns the primitive column filter with the specified kernel\nCV_EXPORTS Ptr<BaseColumnFilter> getLinearColumnFilter(int bufType, int dstType,\n                                            InputArray kernel, int anchor,\n                                            int symmetryType, double delta=0,\n                                            int bits=0);\n\n//! returns 2D filter with the specified kernel\nCV_EXPORTS Ptr<BaseFilter> getLinearFilter(int srcType, int dstType,\n                                           InputArray kernel,\n                                           Point anchor=Point(-1,-1),\n                                           double delta=0, int bits=0);\n\n//! returns the separable linear filter engine\nCV_EXPORTS Ptr<FilterEngine> createSeparableLinearFilter(int srcType, int dstType,\n                          InputArray rowKernel, InputArray columnKernel,\n                          Point anchor=Point(-1,-1), double delta=0,\n                          int rowBorderType=BORDER_DEFAULT,\n                          int columnBorderType=-1,\n                          const Scalar& borderValue=Scalar());\n\n//! returns the non-separable linear filter engine\nCV_EXPORTS Ptr<FilterEngine> createLinearFilter(int srcType, int dstType,\n                 InputArray kernel, Point _anchor=Point(-1,-1),\n                 double delta=0, int rowBorderType=BORDER_DEFAULT,\n                 int columnBorderType=-1, const Scalar& borderValue=Scalar());\n\n//! returns the Gaussian kernel with the specified parameters\nCV_EXPORTS_W Mat getGaussianKernel( int ksize, double sigma, int ktype=CV_64F );\n\n//! returns the Gaussian filter engine\nCV_EXPORTS Ptr<FilterEngine> createGaussianFilter( int type, Size ksize,\n                                    double sigma1, double sigma2=0,\n                                    int borderType=BORDER_DEFAULT);\n//! initializes kernels of the generalized Sobel operator\nCV_EXPORTS_W void getDerivKernels( OutputArray kx, OutputArray ky,\n                                   int dx, int dy, int ksize,\n                                   bool normalize=false, int ktype=CV_32F );\n//! returns filter engine for the generalized Sobel operator\nCV_EXPORTS Ptr<FilterEngine> createDerivFilter( int srcType, int dstType,\n                                        int dx, int dy, int ksize,\n                                        int borderType=BORDER_DEFAULT );\n//! returns horizontal 1D box filter\nCV_EXPORTS Ptr<BaseRowFilter> getRowSumFilter(int srcType, int sumType,\n                                              int ksize, int anchor=-1);\n//! returns vertical 1D box filter\nCV_EXPORTS Ptr<BaseColumnFilter> getColumnSumFilter( int sumType, int dstType,\n                                                     int ksize, int anchor=-1,\n                                                     double scale=1);\n//! returns box filter engine\nCV_EXPORTS Ptr<FilterEngine> createBoxFilter( int srcType, int dstType, Size ksize,\n                                              Point anchor=Point(-1,-1),\n                                              bool normalize=true,\n                                              int borderType=BORDER_DEFAULT);\n\n//! returns the Gabor kernel with the specified parameters\nCV_EXPORTS_W Mat getGaborKernel( Size ksize, double sigma, double theta, double lambd,\n                                 double gamma, double psi=CV_PI*0.5, int ktype=CV_64F );\n\n//! type of morphological operation\nenum { MORPH_ERODE=CV_MOP_ERODE, MORPH_DILATE=CV_MOP_DILATE,\n       MORPH_OPEN=CV_MOP_OPEN, MORPH_CLOSE=CV_MOP_CLOSE,\n       MORPH_GRADIENT=CV_MOP_GRADIENT, MORPH_TOPHAT=CV_MOP_TOPHAT,\n       MORPH_BLACKHAT=CV_MOP_BLACKHAT };\n\n//! returns horizontal 1D morphological filter\nCV_EXPORTS Ptr<BaseRowFilter> getMorphologyRowFilter(int op, int type, int ksize, int anchor=-1);\n//! returns vertical 1D morphological filter\nCV_EXPORTS Ptr<BaseColumnFilter> getMorphologyColumnFilter(int op, int type, int ksize, int anchor=-1);\n//! returns 2D morphological filter\nCV_EXPORTS Ptr<BaseFilter> getMorphologyFilter(int op, int type, InputArray kernel,\n                                               Point anchor=Point(-1,-1));\n\n//! returns \"magic\" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.\nstatic inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); }\n\n//! returns morphological filter engine. Only MORPH_ERODE and MORPH_DILATE are supported.\nCV_EXPORTS Ptr<FilterEngine> createMorphologyFilter(int op, int type, InputArray kernel,\n                    Point anchor=Point(-1,-1), int rowBorderType=BORDER_CONSTANT,\n                    int columnBorderType=-1,\n                    const Scalar& borderValue=morphologyDefaultBorderValue());\n\n//! shape of the structuring element\nenum { MORPH_RECT=0, MORPH_CROSS=1, MORPH_ELLIPSE=2 };\n//! returns structuring element of the specified shape and size\nCV_EXPORTS_W Mat getStructuringElement(int shape, Size ksize, Point anchor=Point(-1,-1));\n\ntemplate<> CV_EXPORTS void Ptr<IplConvKernel>::delete_obj();\n\n//! copies 2D array to a larger destination array with extrapolation of the outer part of src using the specified border mode\nCV_EXPORTS_W void copyMakeBorder( InputArray src, OutputArray dst,\n                                int top, int bottom, int left, int right,\n                                int borderType, const Scalar& value=Scalar() );\n\n//! smooths the image using median filter.\nCV_EXPORTS_W void medianBlur( InputArray src, OutputArray dst, int ksize );\n//! smooths the image using Gaussian filter.\nCV_EXPORTS_W void GaussianBlur( InputArray src,\n                                               OutputArray dst, Size ksize,\n                                               double sigmaX, double sigmaY=0,\n                                               int borderType=BORDER_DEFAULT );\n//! smooths the image using bilateral filter\nCV_EXPORTS_W void bilateralFilter( InputArray src, OutputArray dst, int d,\n                                   double sigmaColor, double sigmaSpace,\n                                   int borderType=BORDER_DEFAULT );\n//! smooths the image using adaptive bilateral filter\nCV_EXPORTS_W void adaptiveBilateralFilter( InputArray src, OutputArray dst, Size ksize,\n                                           double sigmaSpace, double maxSigmaColor = 20.0, Point anchor=Point(-1, -1),\n                                           int borderType=BORDER_DEFAULT );\n//! smooths the image using the box filter. Each pixel is processed in O(1) time\nCV_EXPORTS_W void boxFilter( InputArray src, OutputArray dst, int ddepth,\n                             Size ksize, Point anchor=Point(-1,-1),\n                             bool normalize=true,\n                             int borderType=BORDER_DEFAULT );\n//! a synonym for normalized box filter\nCV_EXPORTS_W void blur( InputArray src, OutputArray dst,\n                        Size ksize, Point anchor=Point(-1,-1),\n                        int borderType=BORDER_DEFAULT );\n\n//! applies non-separable 2D linear filter to the image\nCV_EXPORTS_W void filter2D( InputArray src, OutputArray dst, int ddepth,\n                            InputArray kernel, Point anchor=Point(-1,-1),\n                            double delta=0, int borderType=BORDER_DEFAULT );\n\n//! applies separable 2D linear filter to the image\nCV_EXPORTS_W void sepFilter2D( InputArray src, OutputArray dst, int ddepth,\n                               InputArray kernelX, InputArray kernelY,\n                               Point anchor=Point(-1,-1),\n                               double delta=0, int borderType=BORDER_DEFAULT );\n\n//! applies generalized Sobel operator to the image\nCV_EXPORTS_W void Sobel( InputArray src, OutputArray dst, int ddepth,\n                         int dx, int dy, int ksize=3,\n                         double scale=1, double delta=0,\n                         int borderType=BORDER_DEFAULT );\n\n//! applies the vertical or horizontal Scharr operator to the image\nCV_EXPORTS_W void Scharr( InputArray src, OutputArray dst, int ddepth,\n                          int dx, int dy, double scale=1, double delta=0,\n                          int borderType=BORDER_DEFAULT );\n\n//! applies Laplacian operator to the image\nCV_EXPORTS_W void Laplacian( InputArray src, OutputArray dst, int ddepth,\n                             int ksize=1, double scale=1, double delta=0,\n                             int borderType=BORDER_DEFAULT );\n\n//! applies Canny edge detector and produces the edge map.\nCV_EXPORTS_W void Canny( InputArray image, OutputArray edges,\n                         double threshold1, double threshold2,\n                         int apertureSize=3, bool L2gradient=false );\n\n//! computes minimum eigen value of 2x2 derivative covariation matrix at each pixel - the cornerness criteria\nCV_EXPORTS_W void cornerMinEigenVal( InputArray src, OutputArray dst,\n                                   int blockSize, int ksize=3,\n                                   int borderType=BORDER_DEFAULT );\n\n//! computes Harris cornerness criteria at each image pixel\nCV_EXPORTS_W void cornerHarris( InputArray src, OutputArray dst, int blockSize,\n                                int ksize, double k,\n                                int borderType=BORDER_DEFAULT );\n\n// low-level function for computing eigenvalues and eigenvectors of 2x2 matrices\nCV_EXPORTS void eigen2x2( const float* a, float* e, int n );\n\n//! computes both eigenvalues and the eigenvectors of 2x2 derivative covariation matrix  at each pixel. The output is stored as 6-channel matrix.\nCV_EXPORTS_W void cornerEigenValsAndVecs( InputArray src, OutputArray dst,\n                                          int blockSize, int ksize,\n                                          int borderType=BORDER_DEFAULT );\n\n//! computes another complex cornerness criteria at each pixel\nCV_EXPORTS_W void preCornerDetect( InputArray src, OutputArray dst, int ksize,\n                                   int borderType=BORDER_DEFAULT );\n\n//! adjusts the corner locations with sub-pixel accuracy to maximize the certain cornerness criteria\nCV_EXPORTS_W void cornerSubPix( InputArray image, InputOutputArray corners,\n                                Size winSize, Size zeroZone,\n                                TermCriteria criteria );\n\n//! finds the strong enough corners where the cornerMinEigenVal() or cornerHarris() report the local maxima\nCV_EXPORTS_W void goodFeaturesToTrack( InputArray image, OutputArray corners,\n                                     int maxCorners, double qualityLevel, double minDistance,\n                                     InputArray mask=noArray(), int blockSize=3,\n                                     bool useHarrisDetector=false, double k=0.04 );\n\n//! finds lines in the black-n-white image using the standard or pyramid Hough transform\nCV_EXPORTS_W void HoughLines( InputArray image, OutputArray lines,\n                              double rho, double theta, int threshold,\n                              double srn=0, double stn=0 );\n\n//! finds line segments in the black-n-white image using probabilistic Hough transform\nCV_EXPORTS_W void HoughLinesP( InputArray image, OutputArray lines,\n                               double rho, double theta, int threshold,\n                               double minLineLength=0, double maxLineGap=0 );\n\n//! finds circles in the grayscale image using 2+1 gradient Hough transform\nCV_EXPORTS_W void HoughCircles( InputArray image, OutputArray circles,\n                               int method, double dp, double minDist,\n                               double param1=100, double param2=100,\n                               int minRadius=0, int maxRadius=0 );\n\nenum\n{\n    GHT_POSITION = 0,\n    GHT_SCALE = 1,\n    GHT_ROTATION = 2\n};\n\n//! finds arbitrary template in the grayscale image using Generalized Hough Transform\n//! Ballard, D.H. (1981). Generalizing the Hough transform to detect arbitrary shapes. Pattern Recognition 13 (2): 111-122.\n//! Guil, N., González-Linares, J.M. and Zapata, E.L. (1999). Bidimensional shape detection using an invariant approach. Pattern Recognition 32 (6): 1025-1038.\nclass CV_EXPORTS GeneralizedHough : public Algorithm\n{\npublic:\n    static Ptr<GeneralizedHough> create(int method);\n\n    virtual ~GeneralizedHough();\n\n    //! set template to search\n    void setTemplate(InputArray templ, int cannyThreshold = 100, Point templCenter = Point(-1, -1));\n    void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter = Point(-1, -1));\n\n    //! find template on image\n    void detect(InputArray image, OutputArray positions, OutputArray votes = cv::noArray(), int cannyThreshold = 100);\n    void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes = cv::noArray());\n\n    void release();\n\nprotected:\n    virtual void setTemplateImpl(const Mat& edges, const Mat& dx, const Mat& dy, Point templCenter) = 0;\n    virtual void detectImpl(const Mat& edges, const Mat& dx, const Mat& dy, OutputArray positions, OutputArray votes) = 0;\n    virtual void releaseImpl() = 0;\n\nprivate:\n    Mat edges_, dx_, dy_;\n};\n\n//! erodes the image (applies the local minimum operator)\nCV_EXPORTS_W void erode( InputArray src, OutputArray dst, InputArray kernel,\n                         Point anchor=Point(-1,-1), int iterations=1,\n                         int borderType=BORDER_CONSTANT,\n                         const Scalar& borderValue=morphologyDefaultBorderValue() );\n\n//! dilates the image (applies the local maximum operator)\nCV_EXPORTS_W void dilate( InputArray src, OutputArray dst, InputArray kernel,\n                          Point anchor=Point(-1,-1), int iterations=1,\n                          int borderType=BORDER_CONSTANT,\n                          const Scalar& borderValue=morphologyDefaultBorderValue() );\n\n//! applies an advanced morphological operation to the image\nCV_EXPORTS_W void morphologyEx( InputArray src, OutputArray dst,\n                                int op, InputArray kernel,\n                                Point anchor=Point(-1,-1), int iterations=1,\n                                int borderType=BORDER_CONSTANT,\n                                const Scalar& borderValue=morphologyDefaultBorderValue() );\n\n//! interpolation algorithm\nenum\n{\n    INTER_NEAREST=CV_INTER_NN, //!< nearest neighbor interpolation\n    INTER_LINEAR=CV_INTER_LINEAR, //!< bilinear interpolation\n    INTER_CUBIC=CV_INTER_CUBIC, //!< bicubic interpolation\n    INTER_AREA=CV_INTER_AREA, //!< area-based (or super) interpolation\n    INTER_LANCZOS4=CV_INTER_LANCZOS4, //!< Lanczos interpolation over 8x8 neighborhood\n    INTER_MAX=7,\n    WARP_INVERSE_MAP=CV_WARP_INVERSE_MAP\n};\n\n//! resizes the image\nCV_EXPORTS_W void resize( InputArray src, OutputArray dst,\n                          Size dsize, double fx=0, double fy=0,\n                          int interpolation=INTER_LINEAR );\n\n//! warps the image using affine transformation\nCV_EXPORTS_W void warpAffine( InputArray src, OutputArray dst,\n                              InputArray M, Size dsize,\n                              int flags=INTER_LINEAR,\n                              int borderMode=BORDER_CONSTANT,\n                              const Scalar& borderValue=Scalar());\n\n//! warps the image using perspective transformation\nCV_EXPORTS_W void warpPerspective( InputArray src, OutputArray dst,\n                                   InputArray M, Size dsize,\n                                   int flags=INTER_LINEAR,\n                                   int borderMode=BORDER_CONSTANT,\n                                   const Scalar& borderValue=Scalar());\n\nenum\n{\n    INTER_BITS=5, INTER_BITS2=INTER_BITS*2,\n    INTER_TAB_SIZE=(1<<INTER_BITS),\n    INTER_TAB_SIZE2=INTER_TAB_SIZE*INTER_TAB_SIZE\n};\n\n//! warps the image using the precomputed maps. The maps are stored in either floating-point or integer fixed-point format\nCV_EXPORTS_W void remap( InputArray src, OutputArray dst,\n                         InputArray map1, InputArray map2,\n                         int interpolation, int borderMode=BORDER_CONSTANT,\n                         const Scalar& borderValue=Scalar());\n\n//! converts maps for remap from floating-point to fixed-point format or backwards\nCV_EXPORTS_W void convertMaps( InputArray map1, InputArray map2,\n                               OutputArray dstmap1, OutputArray dstmap2,\n                               int dstmap1type, bool nninterpolation=false );\n\n//! returns 2x3 affine transformation matrix for the planar rotation.\nCV_EXPORTS_W Mat getRotationMatrix2D( Point2f center, double angle, double scale );\n//! returns 3x3 perspective transformation for the corresponding 4 point pairs.\nCV_EXPORTS Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] );\n//! returns 2x3 affine transformation for the corresponding 3 point pairs.\nCV_EXPORTS Mat getAffineTransform( const Point2f src[], const Point2f dst[] );\n//! computes 2x3 affine transformation matrix that is inverse to the specified 2x3 affine transformation.\nCV_EXPORTS_W void invertAffineTransform( InputArray M, OutputArray iM );\n\nCV_EXPORTS_W Mat getPerspectiveTransform( InputArray src, InputArray dst );\nCV_EXPORTS_W Mat getAffineTransform( InputArray src, InputArray dst );\n\n//! extracts rectangle from the image at sub-pixel location\nCV_EXPORTS_W void getRectSubPix( InputArray image, Size patchSize,\n                                 Point2f center, OutputArray patch, int patchType=-1 );\n\n//! computes the integral image\nCV_EXPORTS_W void integral( InputArray src, OutputArray sum, int sdepth=-1 );\n\n//! computes the integral image and integral for the squared image\nCV_EXPORTS_AS(integral2) void integral( InputArray src, OutputArray sum,\n                                        OutputArray sqsum, int sdepth=-1 );\n//! computes the integral image, integral for the squared image and the tilted integral image\nCV_EXPORTS_AS(integral3) void integral( InputArray src, OutputArray sum,\n                                        OutputArray sqsum, OutputArray tilted,\n                                        int sdepth=-1 );\n\n//! adds image to the accumulator (dst += src). Unlike cv::add, dst and src can have different types.\nCV_EXPORTS_W void accumulate( InputArray src, InputOutputArray dst,\n                              InputArray mask=noArray() );\n//! adds squared src image to the accumulator (dst += src*src).\nCV_EXPORTS_W void accumulateSquare( InputArray src, InputOutputArray dst,\n                                    InputArray mask=noArray() );\n//! adds product of the 2 images to the accumulator (dst += src1*src2).\nCV_EXPORTS_W void accumulateProduct( InputArray src1, InputArray src2,\n                                     InputOutputArray dst, InputArray mask=noArray() );\n//! updates the running average (dst = dst*(1-alpha) + src*alpha)\nCV_EXPORTS_W void accumulateWeighted( InputArray src, InputOutputArray dst,\n                                      double alpha, InputArray mask=noArray() );\n\n//! computes PSNR image/video quality metric\nCV_EXPORTS_W double PSNR(InputArray src1, InputArray src2);\n\nCV_EXPORTS_W Point2d phaseCorrelate(InputArray src1, InputArray src2,\n                                  InputArray window = noArray());\nCV_EXPORTS_W Point2d phaseCorrelateRes(InputArray src1, InputArray src2,\n                                    InputArray window, CV_OUT double* response = 0);\nCV_EXPORTS_W void createHanningWindow(OutputArray dst, Size winSize, int type);\n\n//! type of the threshold operation\nenum { THRESH_BINARY=CV_THRESH_BINARY, THRESH_BINARY_INV=CV_THRESH_BINARY_INV,\n       THRESH_TRUNC=CV_THRESH_TRUNC, THRESH_TOZERO=CV_THRESH_TOZERO,\n       THRESH_TOZERO_INV=CV_THRESH_TOZERO_INV, THRESH_MASK=CV_THRESH_MASK,\n       THRESH_OTSU=CV_THRESH_OTSU };\n\n//! applies fixed threshold to the image\nCV_EXPORTS_W double threshold( InputArray src, OutputArray dst,\n                               double thresh, double maxval, int type );\n\n//! adaptive threshold algorithm\nenum { ADAPTIVE_THRESH_MEAN_C=0, ADAPTIVE_THRESH_GAUSSIAN_C=1 };\n\n//! applies variable (adaptive) threshold to the image\nCV_EXPORTS_W void adaptiveThreshold( InputArray src, OutputArray dst,\n                                     double maxValue, int adaptiveMethod,\n                                     int thresholdType, int blockSize, double C );\n\n//! smooths and downsamples the image\nCV_EXPORTS_W void pyrDown( InputArray src, OutputArray dst,\n                           const Size& dstsize=Size(), int borderType=BORDER_DEFAULT );\n//! upsamples and smoothes the image\nCV_EXPORTS_W void pyrUp( InputArray src, OutputArray dst,\n                         const Size& dstsize=Size(), int borderType=BORDER_DEFAULT );\n\n//! builds the gaussian pyramid using pyrDown() as a basic operation\nCV_EXPORTS void buildPyramid( InputArray src, OutputArrayOfArrays dst,\n                              int maxlevel, int borderType=BORDER_DEFAULT );\n\n//! corrects lens distortion for the given camera matrix and distortion coefficients\nCV_EXPORTS_W void undistort( InputArray src, OutputArray dst,\n                             InputArray cameraMatrix,\n                             InputArray distCoeffs,\n                             InputArray newCameraMatrix=noArray() );\n\n//! initializes maps for cv::remap() to correct lens distortion and optionally rectify the image\nCV_EXPORTS_W void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs,\n                           InputArray R, InputArray newCameraMatrix,\n                           Size size, int m1type, OutputArray map1, OutputArray map2 );\n\nenum\n{\n    PROJ_SPHERICAL_ORTHO = 0,\n    PROJ_SPHERICAL_EQRECT = 1\n};\n\n//! initializes maps for cv::remap() for wide-angle\nCV_EXPORTS_W float initWideAngleProjMap( InputArray cameraMatrix, InputArray distCoeffs,\n                                         Size imageSize, int destImageWidth,\n                                         int m1type, OutputArray map1, OutputArray map2,\n                                         int projType=PROJ_SPHERICAL_EQRECT, double alpha=0);\n\n//! returns the default new camera matrix (by default it is the same as cameraMatrix unless centerPricipalPoint=true)\nCV_EXPORTS_W Mat getDefaultNewCameraMatrix( InputArray cameraMatrix, Size imgsize=Size(),\n                                            bool centerPrincipalPoint=false );\n\n//! returns points' coordinates after lens distortion correction\nCV_EXPORTS_W void undistortPoints( InputArray src, OutputArray dst,\n                                   InputArray cameraMatrix, InputArray distCoeffs,\n                                   InputArray R=noArray(), InputArray P=noArray());\n\ntemplate<> CV_EXPORTS void Ptr<CvHistogram>::delete_obj();\n\n//! computes the joint dense histogram for a set of images.\nCV_EXPORTS void calcHist( const Mat* images, int nimages,\n                          const int* channels, InputArray mask,\n                          OutputArray hist, int dims, const int* histSize,\n                          const float** ranges, bool uniform=true, bool accumulate=false );\n\n//! computes the joint sparse histogram for a set of images.\nCV_EXPORTS void calcHist( const Mat* images, int nimages,\n                          const int* channels, InputArray mask,\n                          SparseMat& hist, int dims,\n                          const int* histSize, const float** ranges,\n                          bool uniform=true, bool accumulate=false );\n\nCV_EXPORTS_W void calcHist( InputArrayOfArrays images,\n                            const vector<int>& channels,\n                            InputArray mask, OutputArray hist,\n                            const vector<int>& histSize,\n                            const vector<float>& ranges,\n                            bool accumulate=false );\n\n//! computes back projection for the set of images\nCV_EXPORTS void calcBackProject( const Mat* images, int nimages,\n                                 const int* channels, InputArray hist,\n                                 OutputArray backProject, const float** ranges,\n                                 double scale=1, bool uniform=true );\n\n//! computes back projection for the set of images\nCV_EXPORTS void calcBackProject( const Mat* images, int nimages,\n                                 const int* channels, const SparseMat& hist,\n                                 OutputArray backProject, const float** ranges,\n                                 double scale=1, bool uniform=true );\n\nCV_EXPORTS_W void calcBackProject( InputArrayOfArrays images, const vector<int>& channels,\n                                   InputArray hist, OutputArray dst,\n                                   const vector<float>& ranges,\n                                   double scale );\n\n/*CV_EXPORTS void calcBackProjectPatch( const Mat* images, int nimages, const int* channels,\n                                      InputArray hist, OutputArray dst, Size patchSize,\n                                      int method, double factor=1 );\n\nCV_EXPORTS_W void calcBackProjectPatch( InputArrayOfArrays images, const vector<int>& channels,\n                                        InputArray hist, OutputArray dst, Size patchSize,\n                                        int method, double factor=1 );*/\n\n//! compares two histograms stored in dense arrays\nCV_EXPORTS_W double compareHist( InputArray H1, InputArray H2, int method );\n\n//! compares two histograms stored in sparse arrays\nCV_EXPORTS double compareHist( const SparseMat& H1, const SparseMat& H2, int method );\n\n//! normalizes the grayscale image brightness and contrast by normalizing its histogram\nCV_EXPORTS_W void equalizeHist( InputArray src, OutputArray dst );\n\nclass CV_EXPORTS_W CLAHE : public Algorithm\n{\npublic:\n    CV_WRAP virtual void apply(InputArray src, OutputArray dst) = 0;\n\n    CV_WRAP virtual void setClipLimit(double clipLimit) = 0;\n    CV_WRAP virtual double getClipLimit() const = 0;\n\n    CV_WRAP virtual void setTilesGridSize(Size tileGridSize) = 0;\n    CV_WRAP virtual Size getTilesGridSize() const = 0;\n\n    CV_WRAP virtual void collectGarbage() = 0;\n};\nCV_EXPORTS_W Ptr<CLAHE> createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8));\n\nCV_EXPORTS float EMD( InputArray signature1, InputArray signature2,\n                      int distType, InputArray cost=noArray(),\n                      float* lowerBound=0, OutputArray flow=noArray() );\n\n//! segments the image using watershed algorithm\nCV_EXPORTS_W void watershed( InputArray image, InputOutputArray markers );\n\n//! filters image using meanshift algorithm\nCV_EXPORTS_W void pyrMeanShiftFiltering( InputArray src, OutputArray dst,\n                                         double sp, double sr, int maxLevel=1,\n                                         TermCriteria termcrit=TermCriteria(\n                                            TermCriteria::MAX_ITER+TermCriteria::EPS,5,1) );\n\n//! class of the pixel in GrabCut algorithm\nenum\n{\n    GC_BGD    = 0,  //!< background\n    GC_FGD    = 1,  //!< foreground\n    GC_PR_BGD = 2,  //!< most probably background\n    GC_PR_FGD = 3   //!< most probably foreground\n};\n\n//! GrabCut algorithm flags\nenum\n{\n    GC_INIT_WITH_RECT  = 0,\n    GC_INIT_WITH_MASK  = 1,\n    GC_EVAL            = 2\n};\n\n//! segments the image using GrabCut algorithm\nCV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, Rect rect,\n                           InputOutputArray bgdModel, InputOutputArray fgdModel,\n                           int iterCount, int mode = GC_EVAL );\n\nenum\n{\n    DIST_LABEL_CCOMP = 0,\n    DIST_LABEL_PIXEL = 1\n};\n\n//! builds the discrete Voronoi diagram\nCV_EXPORTS_AS(distanceTransformWithLabels) void distanceTransform( InputArray src, OutputArray dst,\n                                     OutputArray labels, int distanceType, int maskSize,\n                                     int labelType=DIST_LABEL_CCOMP );\n\n//! computes the distance transform map\nCV_EXPORTS_W void distanceTransform( InputArray src, OutputArray dst,\n                                     int distanceType, int maskSize );\n\nenum { FLOODFILL_FIXED_RANGE = 1 << 16, FLOODFILL_MASK_ONLY = 1 << 17 };\n\n//! fills the semi-uniform image region starting from the specified seed point\nCV_EXPORTS int floodFill( InputOutputArray image,\n                          Point seedPoint, Scalar newVal, CV_OUT Rect* rect=0,\n                          Scalar loDiff=Scalar(), Scalar upDiff=Scalar(),\n                          int flags=4 );\n\n//! fills the semi-uniform image region and/or the mask starting from the specified seed point\nCV_EXPORTS_W int floodFill( InputOutputArray image, InputOutputArray mask,\n                            Point seedPoint, Scalar newVal, CV_OUT Rect* rect=0,\n                            Scalar loDiff=Scalar(), Scalar upDiff=Scalar(),\n                            int flags=4 );\n\n\nenum\n{\n    COLOR_BGR2BGRA    =0,\n    COLOR_RGB2RGBA    =COLOR_BGR2BGRA,\n\n    COLOR_BGRA2BGR    =1,\n    COLOR_RGBA2RGB    =COLOR_BGRA2BGR,\n\n    COLOR_BGR2RGBA    =2,\n    COLOR_RGB2BGRA    =COLOR_BGR2RGBA,\n\n    COLOR_RGBA2BGR    =3,\n    COLOR_BGRA2RGB    =COLOR_RGBA2BGR,\n\n    COLOR_BGR2RGB     =4,\n    COLOR_RGB2BGR     =COLOR_BGR2RGB,\n\n    COLOR_BGRA2RGBA   =5,\n    COLOR_RGBA2BGRA   =COLOR_BGRA2RGBA,\n\n    COLOR_BGR2GRAY    =6,\n    COLOR_RGB2GRAY    =7,\n    COLOR_GRAY2BGR    =8,\n    COLOR_GRAY2RGB    =COLOR_GRAY2BGR,\n    COLOR_GRAY2BGRA   =9,\n    COLOR_GRAY2RGBA   =COLOR_GRAY2BGRA,\n    COLOR_BGRA2GRAY   =10,\n    COLOR_RGBA2GRAY   =11,\n\n    COLOR_BGR2BGR565  =12,\n    COLOR_RGB2BGR565  =13,\n    COLOR_BGR5652BGR  =14,\n    COLOR_BGR5652RGB  =15,\n    COLOR_BGRA2BGR565 =16,\n    COLOR_RGBA2BGR565 =17,\n    COLOR_BGR5652BGRA =18,\n    COLOR_BGR5652RGBA =19,\n\n    COLOR_GRAY2BGR565 =20,\n    COLOR_BGR5652GRAY =21,\n\n    COLOR_BGR2BGR555  =22,\n    COLOR_RGB2BGR555  =23,\n    COLOR_BGR5552BGR  =24,\n    COLOR_BGR5552RGB  =25,\n    COLOR_BGRA2BGR555 =26,\n    COLOR_RGBA2BGR555 =27,\n    COLOR_BGR5552BGRA =28,\n    COLOR_BGR5552RGBA =29,\n\n    COLOR_GRAY2BGR555 =30,\n    COLOR_BGR5552GRAY =31,\n\n    COLOR_BGR2XYZ     =32,\n    COLOR_RGB2XYZ     =33,\n    COLOR_XYZ2BGR     =34,\n    COLOR_XYZ2RGB     =35,\n\n    COLOR_BGR2YCrCb   =36,\n    COLOR_RGB2YCrCb   =37,\n    COLOR_YCrCb2BGR   =38,\n    COLOR_YCrCb2RGB   =39,\n\n    COLOR_BGR2HSV     =40,\n    COLOR_RGB2HSV     =41,\n\n    COLOR_BGR2Lab     =44,\n    COLOR_RGB2Lab     =45,\n\n    COLOR_BayerBG2BGR =46,\n    COLOR_BayerGB2BGR =47,\n    COLOR_BayerRG2BGR =48,\n    COLOR_BayerGR2BGR =49,\n\n    COLOR_BayerBG2RGB =COLOR_BayerRG2BGR,\n    COLOR_BayerGB2RGB =COLOR_BayerGR2BGR,\n    COLOR_BayerRG2RGB =COLOR_BayerBG2BGR,\n    COLOR_BayerGR2RGB =COLOR_BayerGB2BGR,\n\n    COLOR_BGR2Luv     =50,\n    COLOR_RGB2Luv     =51,\n    COLOR_BGR2HLS     =52,\n    COLOR_RGB2HLS     =53,\n\n    COLOR_HSV2BGR     =54,\n    COLOR_HSV2RGB     =55,\n\n    COLOR_Lab2BGR     =56,\n    COLOR_Lab2RGB     =57,\n    COLOR_Luv2BGR     =58,\n    COLOR_Luv2RGB     =59,\n    COLOR_HLS2BGR     =60,\n    COLOR_HLS2RGB     =61,\n\n    COLOR_BayerBG2BGR_VNG =62,\n    COLOR_BayerGB2BGR_VNG =63,\n    COLOR_BayerRG2BGR_VNG =64,\n    COLOR_BayerGR2BGR_VNG =65,\n\n    COLOR_BayerBG2RGB_VNG =COLOR_BayerRG2BGR_VNG,\n    COLOR_BayerGB2RGB_VNG =COLOR_BayerGR2BGR_VNG,\n    COLOR_BayerRG2RGB_VNG =COLOR_BayerBG2BGR_VNG,\n    COLOR_BayerGR2RGB_VNG =COLOR_BayerGB2BGR_VNG,\n\n    COLOR_BGR2HSV_FULL = 66,\n    COLOR_RGB2HSV_FULL = 67,\n    COLOR_BGR2HLS_FULL = 68,\n    COLOR_RGB2HLS_FULL = 69,\n\n    COLOR_HSV2BGR_FULL = 70,\n    COLOR_HSV2RGB_FULL = 71,\n    COLOR_HLS2BGR_FULL = 72,\n    COLOR_HLS2RGB_FULL = 73,\n\n    COLOR_LBGR2Lab     = 74,\n    COLOR_LRGB2Lab     = 75,\n    COLOR_LBGR2Luv     = 76,\n    COLOR_LRGB2Luv     = 77,\n\n    COLOR_Lab2LBGR     = 78,\n    COLOR_Lab2LRGB     = 79,\n    COLOR_Luv2LBGR     = 80,\n    COLOR_Luv2LRGB     = 81,\n\n    COLOR_BGR2YUV      = 82,\n    COLOR_RGB2YUV      = 83,\n    COLOR_YUV2BGR      = 84,\n    COLOR_YUV2RGB      = 85,\n\n    COLOR_BayerBG2GRAY = 86,\n    COLOR_BayerGB2GRAY = 87,\n    COLOR_BayerRG2GRAY = 88,\n    COLOR_BayerGR2GRAY = 89,\n\n    //YUV 4:2:0 formats family\n    COLOR_YUV2RGB_NV12 = 90,\n    COLOR_YUV2BGR_NV12 = 91,\n    COLOR_YUV2RGB_NV21 = 92,\n    COLOR_YUV2BGR_NV21 = 93,\n    COLOR_YUV420sp2RGB = COLOR_YUV2RGB_NV21,\n    COLOR_YUV420sp2BGR = COLOR_YUV2BGR_NV21,\n\n    COLOR_YUV2RGBA_NV12 = 94,\n    COLOR_YUV2BGRA_NV12 = 95,\n    COLOR_YUV2RGBA_NV21 = 96,\n    COLOR_YUV2BGRA_NV21 = 97,\n    COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21,\n    COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21,\n\n    COLOR_YUV2RGB_YV12 = 98,\n    COLOR_YUV2BGR_YV12 = 99,\n    COLOR_YUV2RGB_IYUV = 100,\n    COLOR_YUV2BGR_IYUV = 101,\n    COLOR_YUV2RGB_I420 = COLOR_YUV2RGB_IYUV,\n    COLOR_YUV2BGR_I420 = COLOR_YUV2BGR_IYUV,\n    COLOR_YUV420p2RGB = COLOR_YUV2RGB_YV12,\n    COLOR_YUV420p2BGR = COLOR_YUV2BGR_YV12,\n\n    COLOR_YUV2RGBA_YV12 = 102,\n    COLOR_YUV2BGRA_YV12 = 103,\n    COLOR_YUV2RGBA_IYUV = 104,\n    COLOR_YUV2BGRA_IYUV = 105,\n    COLOR_YUV2RGBA_I420 = COLOR_YUV2RGBA_IYUV,\n    COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV,\n    COLOR_YUV420p2RGBA = COLOR_YUV2RGBA_YV12,\n    COLOR_YUV420p2BGRA = COLOR_YUV2BGRA_YV12,\n\n    COLOR_YUV2GRAY_420 = 106,\n    COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420,\n    COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420,\n    COLOR_YUV2GRAY_YV12 = COLOR_YUV2GRAY_420,\n    COLOR_YUV2GRAY_IYUV = COLOR_YUV2GRAY_420,\n    COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420,\n    COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420,\n    COLOR_YUV420p2GRAY = COLOR_YUV2GRAY_420,\n\n    //YUV 4:2:2 formats family\n    COLOR_YUV2RGB_UYVY = 107,\n    COLOR_YUV2BGR_UYVY = 108,\n    //COLOR_YUV2RGB_VYUY = 109,\n    //COLOR_YUV2BGR_VYUY = 110,\n    COLOR_YUV2RGB_Y422 = COLOR_YUV2RGB_UYVY,\n    COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY,\n    COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY,\n    COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY,\n\n    COLOR_YUV2RGBA_UYVY = 111,\n    COLOR_YUV2BGRA_UYVY = 112,\n    //COLOR_YUV2RGBA_VYUY = 113,\n    //COLOR_YUV2BGRA_VYUY = 114,\n    COLOR_YUV2RGBA_Y422 = COLOR_YUV2RGBA_UYVY,\n    COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY,\n    COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY,\n    COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY,\n\n    COLOR_YUV2RGB_YUY2 = 115,\n    COLOR_YUV2BGR_YUY2 = 116,\n    COLOR_YUV2RGB_YVYU = 117,\n    COLOR_YUV2BGR_YVYU = 118,\n    COLOR_YUV2RGB_YUYV = COLOR_YUV2RGB_YUY2,\n    COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2,\n    COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2,\n    COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2,\n\n    COLOR_YUV2RGBA_YUY2 = 119,\n    COLOR_YUV2BGRA_YUY2 = 120,\n    COLOR_YUV2RGBA_YVYU = 121,\n    COLOR_YUV2BGRA_YVYU = 122,\n    COLOR_YUV2RGBA_YUYV = COLOR_YUV2RGBA_YUY2,\n    COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2,\n    COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2,\n    COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2,\n\n    COLOR_YUV2GRAY_UYVY = 123,\n    COLOR_YUV2GRAY_YUY2 = 124,\n    //COLOR_YUV2GRAY_VYUY = COLOR_YUV2GRAY_UYVY,\n    COLOR_YUV2GRAY_Y422 = COLOR_YUV2GRAY_UYVY,\n    COLOR_YUV2GRAY_UYNV = COLOR_YUV2GRAY_UYVY,\n    COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2,\n    COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2,\n    COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2,\n\n    // alpha premultiplication\n    COLOR_RGBA2mRGBA = 125,\n    COLOR_mRGBA2RGBA = 126,\n\n    COLOR_RGB2YUV_I420 = 127,\n    COLOR_BGR2YUV_I420 = 128,\n    COLOR_RGB2YUV_IYUV = COLOR_RGB2YUV_I420,\n    COLOR_BGR2YUV_IYUV = COLOR_BGR2YUV_I420,\n\n    COLOR_RGBA2YUV_I420 = 129,\n    COLOR_BGRA2YUV_I420 = 130,\n    COLOR_RGBA2YUV_IYUV = COLOR_RGBA2YUV_I420,\n    COLOR_BGRA2YUV_IYUV = COLOR_BGRA2YUV_I420,\n    COLOR_RGB2YUV_YV12  = 131,\n    COLOR_BGR2YUV_YV12  = 132,\n    COLOR_RGBA2YUV_YV12 = 133,\n    COLOR_BGRA2YUV_YV12 = 134,\n\n    COLOR_COLORCVT_MAX  = 135\n};\n\n\n//! converts image from one color space to another\nCV_EXPORTS_W void cvtColor( InputArray src, OutputArray dst, int code, int dstCn=0 );\n\n//! raster image moments\nclass CV_EXPORTS_W_MAP Moments\n{\npublic:\n    //! the default constructor\n    Moments();\n    //! the full constructor\n    Moments(double m00, double m10, double m01, double m20, double m11,\n            double m02, double m30, double m21, double m12, double m03 );\n    //! the conversion from CvMoments\n    Moments( const CvMoments& moments );\n    //! the conversion to CvMoments\n    operator CvMoments() const;\n\n    //! spatial moments\n    CV_PROP_RW double  m00, m10, m01, m20, m11, m02, m30, m21, m12, m03;\n    //! central moments\n    CV_PROP_RW double  mu20, mu11, mu02, mu30, mu21, mu12, mu03;\n    //! central normalized moments\n    CV_PROP_RW double  nu20, nu11, nu02, nu30, nu21, nu12, nu03;\n};\n\n//! computes moments of the rasterized shape or a vector of points\nCV_EXPORTS_W Moments moments( InputArray array, bool binaryImage=false );\n\n//! computes 7 Hu invariants from the moments\nCV_EXPORTS void HuMoments( const Moments& moments, double hu[7] );\nCV_EXPORTS_W void HuMoments( const Moments& m, CV_OUT OutputArray hu );\n\n//! type of the template matching operation\nenum { TM_SQDIFF=0, TM_SQDIFF_NORMED=1, TM_CCORR=2, TM_CCORR_NORMED=3, TM_CCOEFF=4, TM_CCOEFF_NORMED=5 };\n\n//! computes the proximity map for the raster template and the image where the template is searched for\nCV_EXPORTS_W void matchTemplate( InputArray image, InputArray templ,\n                                 OutputArray result, int method );\n\n//! mode of the contour retrieval algorithm\nenum\n{\n    RETR_EXTERNAL=CV_RETR_EXTERNAL, //!< retrieve only the most external (top-level) contours\n    RETR_LIST=CV_RETR_LIST, //!< retrieve all the contours without any hierarchical information\n    RETR_CCOMP=CV_RETR_CCOMP, //!< retrieve the connected components (that can possibly be nested)\n    RETR_TREE=CV_RETR_TREE, //!< retrieve all the contours and the whole hierarchy\n    RETR_FLOODFILL=CV_RETR_FLOODFILL\n};\n\n//! the contour approximation algorithm\nenum\n{\n    CHAIN_APPROX_NONE=CV_CHAIN_APPROX_NONE,\n    CHAIN_APPROX_SIMPLE=CV_CHAIN_APPROX_SIMPLE,\n    CHAIN_APPROX_TC89_L1=CV_CHAIN_APPROX_TC89_L1,\n    CHAIN_APPROX_TC89_KCOS=CV_CHAIN_APPROX_TC89_KCOS\n};\n\n//! retrieves contours and the hierarchical information from black-n-white image.\nCV_EXPORTS_W void findContours( InputOutputArray image, OutputArrayOfArrays contours,\n                              OutputArray hierarchy, int mode,\n                              int method, Point offset=Point());\n\n//! retrieves contours from black-n-white image.\nCV_EXPORTS void findContours( InputOutputArray image, OutputArrayOfArrays contours,\n                              int mode, int method, Point offset=Point());\n\n//! draws contours in the image\nCV_EXPORTS_W void drawContours( InputOutputArray image, InputArrayOfArrays contours,\n                              int contourIdx, const Scalar& color,\n                              int thickness=1, int lineType=8,\n                              InputArray hierarchy=noArray(),\n                              int maxLevel=INT_MAX, Point offset=Point() );\n\n//! approximates contour or a curve using Douglas-Peucker algorithm\nCV_EXPORTS_W void approxPolyDP( InputArray curve,\n                                OutputArray approxCurve,\n                                double epsilon, bool closed );\n\n//! computes the contour perimeter (closed=true) or a curve length\nCV_EXPORTS_W double arcLength( InputArray curve, bool closed );\n//! computes the bounding rectangle for a contour\nCV_EXPORTS_W Rect boundingRect( InputArray points );\n//! computes the contour area\nCV_EXPORTS_W double contourArea( InputArray contour, bool oriented=false );\n//! computes the minimal rotated rectangle for a set of points\nCV_EXPORTS_W RotatedRect minAreaRect( InputArray points );\n//! computes the minimal enclosing circle for a set of points\nCV_EXPORTS_W void minEnclosingCircle( InputArray points,\n                                      CV_OUT Point2f& center, CV_OUT float& radius );\n//! matches two contours using one of the available algorithms\nCV_EXPORTS_W double matchShapes( InputArray contour1, InputArray contour2,\n                                 int method, double parameter );\n//! computes convex hull for a set of 2D points.\nCV_EXPORTS_W void convexHull( InputArray points, OutputArray hull,\n                              bool clockwise=false, bool returnPoints=true );\n//! computes the contour convexity defects\nCV_EXPORTS_W void convexityDefects( InputArray contour, InputArray convexhull, OutputArray convexityDefects );\n\n//! returns true if the contour is convex. Does not support contours with self-intersection\nCV_EXPORTS_W bool isContourConvex( InputArray contour );\n\n//! finds intersection of two convex polygons\nCV_EXPORTS_W float intersectConvexConvex( InputArray _p1, InputArray _p2,\n                                          OutputArray _p12, bool handleNested=true );\n\n//! fits ellipse to the set of 2D points\nCV_EXPORTS_W RotatedRect fitEllipse( InputArray points );\n\n//! fits line to the set of 2D points using M-estimator algorithm\nCV_EXPORTS_W void fitLine( InputArray points, OutputArray line, int distType,\n                           double param, double reps, double aeps );\n//! checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary\nCV_EXPORTS_W double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist );\n\n\nclass CV_EXPORTS_W Subdiv2D\n{\npublic:\n    enum\n    {\n        PTLOC_ERROR = -2,\n        PTLOC_OUTSIDE_RECT = -1,\n        PTLOC_INSIDE = 0,\n        PTLOC_VERTEX = 1,\n        PTLOC_ON_EDGE = 2\n    };\n\n    enum\n    {\n        NEXT_AROUND_ORG   = 0x00,\n        NEXT_AROUND_DST   = 0x22,\n        PREV_AROUND_ORG   = 0x11,\n        PREV_AROUND_DST   = 0x33,\n        NEXT_AROUND_LEFT  = 0x13,\n        NEXT_AROUND_RIGHT = 0x31,\n        PREV_AROUND_LEFT  = 0x20,\n        PREV_AROUND_RIGHT = 0x02\n    };\n\n    CV_WRAP Subdiv2D();\n    CV_WRAP Subdiv2D(Rect rect);\n    CV_WRAP void initDelaunay(Rect rect);\n\n    CV_WRAP int insert(Point2f pt);\n    CV_WRAP void insert(const vector<Point2f>& ptvec);\n    CV_WRAP int locate(Point2f pt, CV_OUT int& edge, CV_OUT int& vertex);\n\n    CV_WRAP int findNearest(Point2f pt, CV_OUT Point2f* nearestPt=0);\n    CV_WRAP void getEdgeList(CV_OUT vector<Vec4f>& edgeList) const;\n    CV_WRAP void getTriangleList(CV_OUT vector<Vec6f>& triangleList) const;\n    CV_WRAP void getVoronoiFacetList(const vector<int>& idx, CV_OUT vector<vector<Point2f> >& facetList,\n                                     CV_OUT vector<Point2f>& facetCenters);\n\n    CV_WRAP Point2f getVertex(int vertex, CV_OUT int* firstEdge=0) const;\n\n    CV_WRAP int getEdge( int edge, int nextEdgeType ) const;\n    CV_WRAP int nextEdge(int edge) const;\n    CV_WRAP int rotateEdge(int edge, int rotate) const;\n    CV_WRAP int symEdge(int edge) const;\n    CV_WRAP int edgeOrg(int edge, CV_OUT Point2f* orgpt=0) const;\n    CV_WRAP int edgeDst(int edge, CV_OUT Point2f* dstpt=0) const;\n\nprotected:\n    int newEdge();\n    void deleteEdge(int edge);\n    int newPoint(Point2f pt, bool isvirtual, int firstEdge=0);\n    void deletePoint(int vtx);\n    void setEdgePoints( int edge, int orgPt, int dstPt );\n    void splice( int edgeA, int edgeB );\n    int connectEdges( int edgeA, int edgeB );\n    void swapEdges( int edge );\n    int isRightOf(Point2f pt, int edge) const;\n    void calcVoronoi();\n    void clearVoronoi();\n    void checkSubdiv() const;\n\n    struct CV_EXPORTS Vertex\n    {\n        Vertex();\n        Vertex(Point2f pt, bool _isvirtual, int _firstEdge=0);\n        bool isvirtual() const;\n        bool isfree() const;\n        int firstEdge;\n        int type;\n        Point2f pt;\n    };\n    struct CV_EXPORTS QuadEdge\n    {\n        QuadEdge();\n        QuadEdge(int edgeidx);\n        bool isfree() const;\n        int next[4];\n        int pt[4];\n    };\n\n    vector<Vertex> vtx;\n    vector<QuadEdge> qedges;\n    int freeQEdge;\n    int freePoint;\n    bool validGeometry;\n\n    int recentEdge;\n    Point2f topLeft;\n    Point2f bottomRight;\n};\n\n}\n\n#endif /* __cplusplus */\n\n#endif\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/imgproc/imgproc_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_IMGPROC_IMGPROC_C_H__\n#define __OPENCV_IMGPROC_IMGPROC_C_H__\n\n#include \"opencv2/core/core_c.h\"\n#include \"opencv2/imgproc/types_c.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*********************** Background statistics accumulation *****************************/\n\n/* Adds image to accumulator */\nCVAPI(void)  cvAcc( const CvArr* image, CvArr* sum,\n                   const CvArr* mask CV_DEFAULT(NULL) );\n\n/* Adds squared image to accumulator */\nCVAPI(void)  cvSquareAcc( const CvArr* image, CvArr* sqsum,\n                         const CvArr* mask CV_DEFAULT(NULL) );\n\n/* Adds a product of two images to accumulator */\nCVAPI(void)  cvMultiplyAcc( const CvArr* image1, const CvArr* image2, CvArr* acc,\n                           const CvArr* mask CV_DEFAULT(NULL) );\n\n/* Adds image to accumulator with weights: acc = acc*(1-alpha) + image*alpha */\nCVAPI(void)  cvRunningAvg( const CvArr* image, CvArr* acc, double alpha,\n                          const CvArr* mask CV_DEFAULT(NULL) );\n\n/****************************************************************************************\\\n*                                    Image Processing                                    *\n\\****************************************************************************************/\n\n/* Copies source 2D array inside of the larger destination array and\n   makes a border of the specified type (IPL_BORDER_*) around the copied area. */\nCVAPI(void) cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset,\n                              int bordertype, CvScalar value CV_DEFAULT(cvScalarAll(0)));\n\n/* Smoothes array (removes noise) */\nCVAPI(void) cvSmooth( const CvArr* src, CvArr* dst,\n                      int smoothtype CV_DEFAULT(CV_GAUSSIAN),\n                      int size1 CV_DEFAULT(3),\n                      int size2 CV_DEFAULT(0),\n                      double sigma1 CV_DEFAULT(0),\n                      double sigma2 CV_DEFAULT(0));\n\n/* Convolves the image with the kernel */\nCVAPI(void) cvFilter2D( const CvArr* src, CvArr* dst, const CvMat* kernel,\n                        CvPoint anchor CV_DEFAULT(cvPoint(-1,-1)));\n\n/* Finds integral image: SUM(X,Y) = sum(x<X,y<Y)I(x,y) */\nCVAPI(void) cvIntegral( const CvArr* image, CvArr* sum,\n                       CvArr* sqsum CV_DEFAULT(NULL),\n                       CvArr* tilted_sum CV_DEFAULT(NULL));\n\n/*\n   Smoothes the input image with gaussian kernel and then down-samples it.\n   dst_width = floor(src_width/2)[+1],\n   dst_height = floor(src_height/2)[+1]\n*/\nCVAPI(void)  cvPyrDown( const CvArr* src, CvArr* dst,\n                        int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );\n\n/*\n   Up-samples image and smoothes the result with gaussian kernel.\n   dst_width = src_width*2,\n   dst_height = src_height*2\n*/\nCVAPI(void)  cvPyrUp( const CvArr* src, CvArr* dst,\n                      int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );\n\n/* Builds pyramid for an image */\nCVAPI(CvMat**) cvCreatePyramid( const CvArr* img, int extra_layers, double rate,\n                                const CvSize* layer_sizes CV_DEFAULT(0),\n                                CvArr* bufarr CV_DEFAULT(0),\n                                int calc CV_DEFAULT(1),\n                                int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );\n\n/* Releases pyramid */\nCVAPI(void)  cvReleasePyramid( CvMat*** pyramid, int extra_layers );\n\n\n/* Filters image using meanshift algorithm */\nCVAPI(void) cvPyrMeanShiftFiltering( const CvArr* src, CvArr* dst,\n    double sp, double sr, int max_level CV_DEFAULT(1),\n    CvTermCriteria termcrit CV_DEFAULT(cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,5,1)));\n\n/* Segments image using seed \"markers\" */\nCVAPI(void) cvWatershed( const CvArr* image, CvArr* markers );\n\n/* Calculates an image derivative using generalized Sobel\n   (aperture_size = 1,3,5,7) or Scharr (aperture_size = -1) operator.\n   Scharr can be used only for the first dx or dy derivative */\nCVAPI(void) cvSobel( const CvArr* src, CvArr* dst,\n                    int xorder, int yorder,\n                    int aperture_size CV_DEFAULT(3));\n\n/* Calculates the image Laplacian: (d2/dx + d2/dy)I */\nCVAPI(void) cvLaplace( const CvArr* src, CvArr* dst,\n                      int aperture_size CV_DEFAULT(3) );\n\n/* Converts input array pixels from one color space to another */\nCVAPI(void)  cvCvtColor( const CvArr* src, CvArr* dst, int code );\n\n\n/* Resizes image (input array is resized to fit the destination array) */\nCVAPI(void)  cvResize( const CvArr* src, CvArr* dst,\n                       int interpolation CV_DEFAULT( CV_INTER_LINEAR ));\n\n/* Warps image with affine transform */\nCVAPI(void)  cvWarpAffine( const CvArr* src, CvArr* dst, const CvMat* map_matrix,\n                           int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),\n                           CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );\n\n/* Computes affine transform matrix for mapping src[i] to dst[i] (i=0,1,2) */\nCVAPI(CvMat*) cvGetAffineTransform( const CvPoint2D32f * src,\n                                    const CvPoint2D32f * dst,\n                                    CvMat * map_matrix );\n\n/* Computes rotation_matrix matrix */\nCVAPI(CvMat*)  cv2DRotationMatrix( CvPoint2D32f center, double angle,\n                                   double scale, CvMat* map_matrix );\n\n/* Warps image with perspective (projective) transform */\nCVAPI(void)  cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* map_matrix,\n                                int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),\n                                CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );\n\n/* Computes perspective transform matrix for mapping src[i] to dst[i] (i=0,1,2,3) */\nCVAPI(CvMat*) cvGetPerspectiveTransform( const CvPoint2D32f* src,\n                                         const CvPoint2D32f* dst,\n                                         CvMat* map_matrix );\n\n/* Performs generic geometric transformation using the specified coordinate maps */\nCVAPI(void)  cvRemap( const CvArr* src, CvArr* dst,\n                      const CvArr* mapx, const CvArr* mapy,\n                      int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),\n                      CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );\n\n/* Converts mapx & mapy from floating-point to integer formats for cvRemap */\nCVAPI(void)  cvConvertMaps( const CvArr* mapx, const CvArr* mapy,\n                            CvArr* mapxy, CvArr* mapalpha );\n\n/* Performs forward or inverse log-polar image transform */\nCVAPI(void)  cvLogPolar( const CvArr* src, CvArr* dst,\n                         CvPoint2D32f center, double M,\n                         int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS));\n\n/* Performs forward or inverse linear-polar image transform */\nCVAPI(void)  cvLinearPolar( const CvArr* src, CvArr* dst,\n                         CvPoint2D32f center, double maxRadius,\n                         int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS));\n\n/* Transforms the input image to compensate lens distortion */\nCVAPI(void) cvUndistort2( const CvArr* src, CvArr* dst,\n                          const CvMat* camera_matrix,\n                          const CvMat* distortion_coeffs,\n                          const CvMat* new_camera_matrix CV_DEFAULT(0) );\n\n/* Computes transformation map from intrinsic camera parameters\n   that can used by cvRemap */\nCVAPI(void) cvInitUndistortMap( const CvMat* camera_matrix,\n                                const CvMat* distortion_coeffs,\n                                CvArr* mapx, CvArr* mapy );\n\n/* Computes undistortion+rectification map for a head of stereo camera */\nCVAPI(void) cvInitUndistortRectifyMap( const CvMat* camera_matrix,\n                                       const CvMat* dist_coeffs,\n                                       const CvMat *R, const CvMat* new_camera_matrix,\n                                       CvArr* mapx, CvArr* mapy );\n\n/* Computes the original (undistorted) feature coordinates\n   from the observed (distorted) coordinates */\nCVAPI(void) cvUndistortPoints( const CvMat* src, CvMat* dst,\n                               const CvMat* camera_matrix,\n                               const CvMat* dist_coeffs,\n                               const CvMat* R CV_DEFAULT(0),\n                               const CvMat* P CV_DEFAULT(0));\n\n/* creates structuring element used for morphological operations */\nCVAPI(IplConvKernel*)  cvCreateStructuringElementEx(\n            int cols, int  rows, int  anchor_x, int  anchor_y,\n            int shape, int* values CV_DEFAULT(NULL) );\n\n/* releases structuring element */\nCVAPI(void)  cvReleaseStructuringElement( IplConvKernel** element );\n\n/* erodes input image (applies minimum filter) one or more times.\n   If element pointer is NULL, 3x3 rectangular element is used */\nCVAPI(void)  cvErode( const CvArr* src, CvArr* dst,\n                      IplConvKernel* element CV_DEFAULT(NULL),\n                      int iterations CV_DEFAULT(1) );\n\n/* dilates input image (applies maximum filter) one or more times.\n   If element pointer is NULL, 3x3 rectangular element is used */\nCVAPI(void)  cvDilate( const CvArr* src, CvArr* dst,\n                       IplConvKernel* element CV_DEFAULT(NULL),\n                       int iterations CV_DEFAULT(1) );\n\n/* Performs complex morphological transformation */\nCVAPI(void)  cvMorphologyEx( const CvArr* src, CvArr* dst,\n                             CvArr* temp, IplConvKernel* element,\n                             int operation, int iterations CV_DEFAULT(1) );\n\n/* Calculates all spatial and central moments up to the 3rd order */\nCVAPI(void) cvMoments( const CvArr* arr, CvMoments* moments, int binary CV_DEFAULT(0));\n\n/* Retrieve particular spatial, central or normalized central moments */\nCVAPI(double)  cvGetSpatialMoment( CvMoments* moments, int x_order, int y_order );\nCVAPI(double)  cvGetCentralMoment( CvMoments* moments, int x_order, int y_order );\nCVAPI(double)  cvGetNormalizedCentralMoment( CvMoments* moments,\n                                             int x_order, int y_order );\n\n/* Calculates 7 Hu's invariants from precalculated spatial and central moments */\nCVAPI(void) cvGetHuMoments( CvMoments*  moments, CvHuMoments*  hu_moments );\n\n/*********************************** data sampling **************************************/\n\n/* Fetches pixels that belong to the specified line segment and stores them to the buffer.\n   Returns the number of retrieved points. */\nCVAPI(int)  cvSampleLine( const CvArr* image, CvPoint pt1, CvPoint pt2, void* buffer,\n                          int connectivity CV_DEFAULT(8));\n\n/* Retrieves the rectangular image region with specified center from the input array.\n dst(x,y) <- src(x + center.x - dst_width/2, y + center.y - dst_height/2).\n Values of pixels with fractional coordinates are retrieved using bilinear interpolation*/\nCVAPI(void)  cvGetRectSubPix( const CvArr* src, CvArr* dst, CvPoint2D32f center );\n\n\n/* Retrieves quadrangle from the input array.\n    matrixarr = ( a11  a12 | b1 )   dst(x,y) <- src(A[x y]' + b)\n                ( a21  a22 | b2 )   (bilinear interpolation is used to retrieve pixels\n                                     with fractional coordinates)\n*/\nCVAPI(void)  cvGetQuadrangleSubPix( const CvArr* src, CvArr* dst,\n                                    const CvMat* map_matrix );\n\n/* Measures similarity between template and overlapped windows in the source image\n   and fills the resultant image with the measurements */\nCVAPI(void)  cvMatchTemplate( const CvArr* image, const CvArr* templ,\n                              CvArr* result, int method );\n\n/* Computes earth mover distance between\n   two weighted point sets (called signatures) */\nCVAPI(float)  cvCalcEMD2( const CvArr* signature1,\n                          const CvArr* signature2,\n                          int distance_type,\n                          CvDistanceFunction distance_func CV_DEFAULT(NULL),\n                          const CvArr* cost_matrix CV_DEFAULT(NULL),\n                          CvArr* flow CV_DEFAULT(NULL),\n                          float* lower_bound CV_DEFAULT(NULL),\n                          void* userdata CV_DEFAULT(NULL));\n\n/****************************************************************************************\\\n*                              Contours retrieving                                       *\n\\****************************************************************************************/\n\n/* Retrieves outer and optionally inner boundaries of white (non-zero) connected\n   components in the black (zero) background */\nCVAPI(int)  cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** first_contour,\n                            int header_size CV_DEFAULT(sizeof(CvContour)),\n                            int mode CV_DEFAULT(CV_RETR_LIST),\n                            int method CV_DEFAULT(CV_CHAIN_APPROX_SIMPLE),\n                            CvPoint offset CV_DEFAULT(cvPoint(0,0)));\n\n/* Initializes contour retrieving process.\n   Calls cvStartFindContours.\n   Calls cvFindNextContour until null pointer is returned\n   or some other condition becomes true.\n   Calls cvEndFindContours at the end. */\nCVAPI(CvContourScanner)  cvStartFindContours( CvArr* image, CvMemStorage* storage,\n                            int header_size CV_DEFAULT(sizeof(CvContour)),\n                            int mode CV_DEFAULT(CV_RETR_LIST),\n                            int method CV_DEFAULT(CV_CHAIN_APPROX_SIMPLE),\n                            CvPoint offset CV_DEFAULT(cvPoint(0,0)));\n\n/* Retrieves next contour */\nCVAPI(CvSeq*)  cvFindNextContour( CvContourScanner scanner );\n\n\n/* Substitutes the last retrieved contour with the new one\n   (if the substitutor is null, the last retrieved contour is removed from the tree) */\nCVAPI(void)   cvSubstituteContour( CvContourScanner scanner, CvSeq* new_contour );\n\n\n/* Releases contour scanner and returns pointer to the first outer contour */\nCVAPI(CvSeq*)  cvEndFindContours( CvContourScanner* scanner );\n\n/* Approximates a single Freeman chain or a tree of chains to polygonal curves */\nCVAPI(CvSeq*) cvApproxChains( CvSeq* src_seq, CvMemStorage* storage,\n                            int method CV_DEFAULT(CV_CHAIN_APPROX_SIMPLE),\n                            double parameter CV_DEFAULT(0),\n                            int  minimal_perimeter CV_DEFAULT(0),\n                            int  recursive CV_DEFAULT(0));\n\n/* Initializes Freeman chain reader.\n   The reader is used to iteratively get coordinates of all the chain points.\n   If the Freeman codes should be read as is, a simple sequence reader should be used */\nCVAPI(void) cvStartReadChainPoints( CvChain* chain, CvChainPtReader* reader );\n\n/* Retrieves the next chain point */\nCVAPI(CvPoint) cvReadChainPoint( CvChainPtReader* reader );\n\n\n/****************************************************************************************\\\n*                            Contour Processing and Shape Analysis                       *\n\\****************************************************************************************/\n\n/* Approximates a single polygonal curve (contour) or\n   a tree of polygonal curves (contours) */\nCVAPI(CvSeq*)  cvApproxPoly( const void* src_seq,\n                             int header_size, CvMemStorage* storage,\n                             int method, double eps,\n                             int recursive CV_DEFAULT(0));\n\n/* Calculates perimeter of a contour or length of a part of contour */\nCVAPI(double)  cvArcLength( const void* curve,\n                            CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),\n                            int is_closed CV_DEFAULT(-1));\n\nCV_INLINE double cvContourPerimeter( const void* contour )\n{\n    return cvArcLength( contour, CV_WHOLE_SEQ, 1 );\n}\n\n\n/* Calculates contour bounding rectangle (update=1) or\n   just retrieves pre-calculated rectangle (update=0) */\nCVAPI(CvRect)  cvBoundingRect( CvArr* points, int update CV_DEFAULT(0) );\n\n/* Calculates area of a contour or contour segment */\nCVAPI(double)  cvContourArea( const CvArr* contour,\n                              CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),\n                              int oriented CV_DEFAULT(0));\n\n/* Finds minimum area rotated rectangle bounding a set of points */\nCVAPI(CvBox2D)  cvMinAreaRect2( const CvArr* points,\n                                CvMemStorage* storage CV_DEFAULT(NULL));\n\n/* Finds minimum enclosing circle for a set of points */\nCVAPI(int)  cvMinEnclosingCircle( const CvArr* points,\n                                  CvPoint2D32f* center, float* radius );\n\n/* Compares two contours by matching their moments */\nCVAPI(double)  cvMatchShapes( const void* object1, const void* object2,\n                              int method, double parameter CV_DEFAULT(0));\n\n/* Calculates exact convex hull of 2d point set */\nCVAPI(CvSeq*) cvConvexHull2( const CvArr* input,\n                             void* hull_storage CV_DEFAULT(NULL),\n                             int orientation CV_DEFAULT(CV_CLOCKWISE),\n                             int return_points CV_DEFAULT(0));\n\n/* Checks whether the contour is convex or not (returns 1 if convex, 0 if not) */\nCVAPI(int)  cvCheckContourConvexity( const CvArr* contour );\n\n\n/* Finds convexity defects for the contour */\nCVAPI(CvSeq*)  cvConvexityDefects( const CvArr* contour, const CvArr* convexhull,\n                                   CvMemStorage* storage CV_DEFAULT(NULL));\n\n/* Fits ellipse into a set of 2d points */\nCVAPI(CvBox2D) cvFitEllipse2( const CvArr* points );\n\n/* Finds minimum rectangle containing two given rectangles */\nCVAPI(CvRect)  cvMaxRect( const CvRect* rect1, const CvRect* rect2 );\n\n/* Finds coordinates of the box vertices */\nCVAPI(void) cvBoxPoints( CvBox2D box, CvPoint2D32f pt[4] );\n\n/* Initializes sequence header for a matrix (column or row vector) of points -\n   a wrapper for cvMakeSeqHeaderForArray (it does not initialize bounding rectangle!!!) */\nCVAPI(CvSeq*) cvPointSeqFromMat( int seq_kind, const CvArr* mat,\n                                 CvContour* contour_header,\n                                 CvSeqBlock* block );\n\n/* Checks whether the point is inside polygon, outside, on an edge (at a vertex).\n   Returns positive, negative or zero value, correspondingly.\n   Optionally, measures a signed distance between\n   the point and the nearest polygon edge (measure_dist=1) */\nCVAPI(double) cvPointPolygonTest( const CvArr* contour,\n                                  CvPoint2D32f pt, int measure_dist );\n\n/****************************************************************************************\\\n*                                  Histogram functions                                   *\n\\****************************************************************************************/\n\n/* Creates new histogram */\nCVAPI(CvHistogram*)  cvCreateHist( int dims, int* sizes, int type,\n                                   float** ranges CV_DEFAULT(NULL),\n                                   int uniform CV_DEFAULT(1));\n\n/* Assignes histogram bin ranges */\nCVAPI(void)  cvSetHistBinRanges( CvHistogram* hist, float** ranges,\n                                int uniform CV_DEFAULT(1));\n\n/* Creates histogram header for array */\nCVAPI(CvHistogram*)  cvMakeHistHeaderForArray(\n                            int  dims, int* sizes, CvHistogram* hist,\n                            float* data, float** ranges CV_DEFAULT(NULL),\n                            int uniform CV_DEFAULT(1));\n\n/* Releases histogram */\nCVAPI(void)  cvReleaseHist( CvHistogram** hist );\n\n/* Clears all the histogram bins */\nCVAPI(void)  cvClearHist( CvHistogram* hist );\n\n/* Finds indices and values of minimum and maximum histogram bins */\nCVAPI(void)  cvGetMinMaxHistValue( const CvHistogram* hist,\n                                   float* min_value, float* max_value,\n                                   int* min_idx CV_DEFAULT(NULL),\n                                   int* max_idx CV_DEFAULT(NULL));\n\n\n/* Normalizes histogram by dividing all bins by sum of the bins, multiplied by <factor>.\n   After that sum of histogram bins is equal to <factor> */\nCVAPI(void)  cvNormalizeHist( CvHistogram* hist, double factor );\n\n\n/* Clear all histogram bins that are below the threshold */\nCVAPI(void)  cvThreshHist( CvHistogram* hist, double threshold );\n\n\n/* Compares two histogram */\nCVAPI(double)  cvCompareHist( const CvHistogram* hist1,\n                              const CvHistogram* hist2,\n                              int method);\n\n/* Copies one histogram to another. Destination histogram is created if\n   the destination pointer is NULL */\nCVAPI(void)  cvCopyHist( const CvHistogram* src, CvHistogram** dst );\n\n\n/* Calculates bayesian probabilistic histograms\n   (each or src and dst is an array of <number> histograms */\nCVAPI(void)  cvCalcBayesianProb( CvHistogram** src, int number,\n                                CvHistogram** dst);\n\n/* Calculates array histogram */\nCVAPI(void)  cvCalcArrHist( CvArr** arr, CvHistogram* hist,\n                            int accumulate CV_DEFAULT(0),\n                            const CvArr* mask CV_DEFAULT(NULL) );\n\nCV_INLINE  void  cvCalcHist( IplImage** image, CvHistogram* hist,\n                             int accumulate CV_DEFAULT(0),\n                             const CvArr* mask CV_DEFAULT(NULL) )\n{\n    cvCalcArrHist( (CvArr**)image, hist, accumulate, mask );\n}\n\n/* Calculates back project */\nCVAPI(void)  cvCalcArrBackProject( CvArr** image, CvArr* dst,\n                                   const CvHistogram* hist );\n#define  cvCalcBackProject(image, dst, hist) cvCalcArrBackProject((CvArr**)image, dst, hist)\n\n\n/* Does some sort of template matching but compares histograms of\n   template and each window location */\nCVAPI(void)  cvCalcArrBackProjectPatch( CvArr** image, CvArr* dst, CvSize range,\n                                        CvHistogram* hist, int method,\n                                        double factor );\n#define  cvCalcBackProjectPatch( image, dst, range, hist, method, factor ) \\\n     cvCalcArrBackProjectPatch( (CvArr**)image, dst, range, hist, method, factor )\n\n\n/* calculates probabilistic density (divides one histogram by another) */\nCVAPI(void)  cvCalcProbDensity( const CvHistogram* hist1, const CvHistogram* hist2,\n                                CvHistogram* dst_hist, double scale CV_DEFAULT(255) );\n\n/* equalizes histogram of 8-bit single-channel image */\nCVAPI(void)  cvEqualizeHist( const CvArr* src, CvArr* dst );\n\n\n/* Applies distance transform to binary image */\nCVAPI(void)  cvDistTransform( const CvArr* src, CvArr* dst,\n                              int distance_type CV_DEFAULT(CV_DIST_L2),\n                              int mask_size CV_DEFAULT(3),\n                              const float* mask CV_DEFAULT(NULL),\n                              CvArr* labels CV_DEFAULT(NULL),\n                              int labelType CV_DEFAULT(CV_DIST_LABEL_CCOMP));\n\n\n/* Applies fixed-level threshold to grayscale image.\n   This is a basic operation applied before retrieving contours */\nCVAPI(double)  cvThreshold( const CvArr*  src, CvArr*  dst,\n                            double  threshold, double  max_value,\n                            int threshold_type );\n\n/* Applies adaptive threshold to grayscale image.\n   The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and\n   CV_ADAPTIVE_THRESH_GAUSSIAN_C are:\n   neighborhood size (3, 5, 7 etc.),\n   and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...) */\nCVAPI(void)  cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double max_value,\n                                  int adaptive_method CV_DEFAULT(CV_ADAPTIVE_THRESH_MEAN_C),\n                                  int threshold_type CV_DEFAULT(CV_THRESH_BINARY),\n                                  int block_size CV_DEFAULT(3),\n                                  double param1 CV_DEFAULT(5));\n\n/* Fills the connected component until the color difference gets large enough */\nCVAPI(void)  cvFloodFill( CvArr* image, CvPoint seed_point,\n                          CvScalar new_val, CvScalar lo_diff CV_DEFAULT(cvScalarAll(0)),\n                          CvScalar up_diff CV_DEFAULT(cvScalarAll(0)),\n                          CvConnectedComp* comp CV_DEFAULT(NULL),\n                          int flags CV_DEFAULT(4),\n                          CvArr* mask CV_DEFAULT(NULL));\n\n/****************************************************************************************\\\n*                                  Feature detection                                     *\n\\****************************************************************************************/\n\n/* Runs canny edge detector */\nCVAPI(void)  cvCanny( const CvArr* image, CvArr* edges, double threshold1,\n                      double threshold2, int  aperture_size CV_DEFAULT(3) );\n\n/* Calculates constraint image for corner detection\n   Dx^2 * Dyy + Dxx * Dy^2 - 2 * Dx * Dy * Dxy.\n   Applying threshold to the result gives coordinates of corners */\nCVAPI(void) cvPreCornerDetect( const CvArr* image, CvArr* corners,\n                               int aperture_size CV_DEFAULT(3) );\n\n/* Calculates eigen values and vectors of 2x2\n   gradient covariation matrix at every image pixel */\nCVAPI(void)  cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv,\n                                       int block_size, int aperture_size CV_DEFAULT(3) );\n\n/* Calculates minimal eigenvalue for 2x2 gradient covariation matrix at\n   every image pixel */\nCVAPI(void)  cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval,\n                                  int block_size, int aperture_size CV_DEFAULT(3) );\n\n/* Harris corner detector:\n   Calculates det(M) - k*(trace(M)^2), where M is 2x2 gradient covariation matrix for each pixel */\nCVAPI(void)  cvCornerHarris( const CvArr* image, CvArr* harris_response,\n                             int block_size, int aperture_size CV_DEFAULT(3),\n                             double k CV_DEFAULT(0.04) );\n\n/* Adjust corner position using some sort of gradient search */\nCVAPI(void)  cvFindCornerSubPix( const CvArr* image, CvPoint2D32f* corners,\n                                 int count, CvSize win, CvSize zero_zone,\n                                 CvTermCriteria  criteria );\n\n/* Finds a sparse set of points within the selected region\n   that seem to be easy to track */\nCVAPI(void)  cvGoodFeaturesToTrack( const CvArr* image, CvArr* eig_image,\n                                    CvArr* temp_image, CvPoint2D32f* corners,\n                                    int* corner_count, double  quality_level,\n                                    double  min_distance,\n                                    const CvArr* mask CV_DEFAULT(NULL),\n                                    int block_size CV_DEFAULT(3),\n                                    int use_harris CV_DEFAULT(0),\n                                    double k CV_DEFAULT(0.04) );\n\n/* Finds lines on binary image using one of several methods.\n   line_storage is either memory storage or 1 x <max number of lines> CvMat, its\n   number of columns is changed by the function.\n   method is one of CV_HOUGH_*;\n   rho, theta and threshold are used for each of those methods;\n   param1 ~ line length, param2 ~ line gap - for probabilistic,\n   param1 ~ srn, param2 ~ stn - for multi-scale */\nCVAPI(CvSeq*)  cvHoughLines2( CvArr* image, void* line_storage, int method,\n                              double rho, double theta, int threshold,\n                              double param1 CV_DEFAULT(0), double param2 CV_DEFAULT(0));\n\n/* Finds circles in the image */\nCVAPI(CvSeq*) cvHoughCircles( CvArr* image, void* circle_storage,\n                              int method, double dp, double min_dist,\n                              double param1 CV_DEFAULT(100),\n                              double param2 CV_DEFAULT(100),\n                              int min_radius CV_DEFAULT(0),\n                              int max_radius CV_DEFAULT(0));\n\n/* Fits a line into set of 2d or 3d points in a robust way (M-estimator technique) */\nCVAPI(void)  cvFitLine( const CvArr* points, int dist_type, double param,\n                        double reps, double aeps, float* line );\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/imgproc/types_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_IMGPROC_TYPES_C_H__\n#define __OPENCV_IMGPROC_TYPES_C_H__\n\n#include \"opencv2/core/core_c.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* Connected component structure */\ntypedef struct CvConnectedComp\n{\n    double area;    /* area of the connected component  */\n    CvScalar value; /* average color of the connected component */\n    CvRect rect;    /* ROI of the component  */\n    CvSeq* contour; /* optional component boundary\n                      (the contour might have child contours corresponding to the holes)*/\n}\nCvConnectedComp;\n\n/* Image smooth methods */\nenum\n{\n    CV_BLUR_NO_SCALE =0,\n    CV_BLUR  =1,\n    CV_GAUSSIAN  =2,\n    CV_MEDIAN =3,\n    CV_BILATERAL =4\n};\n\n/* Filters used in pyramid decomposition */\nenum\n{\n    CV_GAUSSIAN_5x5 = 7\n};\n\n/* Special filters */\nenum\n{\n    CV_SCHARR =-1,\n    CV_MAX_SOBEL_KSIZE =7\n};\n\n/* Constants for color conversion */\nenum\n{\n    CV_BGR2BGRA    =0,\n    CV_RGB2RGBA    =CV_BGR2BGRA,\n\n    CV_BGRA2BGR    =1,\n    CV_RGBA2RGB    =CV_BGRA2BGR,\n\n    CV_BGR2RGBA    =2,\n    CV_RGB2BGRA    =CV_BGR2RGBA,\n\n    CV_RGBA2BGR    =3,\n    CV_BGRA2RGB    =CV_RGBA2BGR,\n\n    CV_BGR2RGB     =4,\n    CV_RGB2BGR     =CV_BGR2RGB,\n\n    CV_BGRA2RGBA   =5,\n    CV_RGBA2BGRA   =CV_BGRA2RGBA,\n\n    CV_BGR2GRAY    =6,\n    CV_RGB2GRAY    =7,\n    CV_GRAY2BGR    =8,\n    CV_GRAY2RGB    =CV_GRAY2BGR,\n    CV_GRAY2BGRA   =9,\n    CV_GRAY2RGBA   =CV_GRAY2BGRA,\n    CV_BGRA2GRAY   =10,\n    CV_RGBA2GRAY   =11,\n\n    CV_BGR2BGR565  =12,\n    CV_RGB2BGR565  =13,\n    CV_BGR5652BGR  =14,\n    CV_BGR5652RGB  =15,\n    CV_BGRA2BGR565 =16,\n    CV_RGBA2BGR565 =17,\n    CV_BGR5652BGRA =18,\n    CV_BGR5652RGBA =19,\n\n    CV_GRAY2BGR565 =20,\n    CV_BGR5652GRAY =21,\n\n    CV_BGR2BGR555  =22,\n    CV_RGB2BGR555  =23,\n    CV_BGR5552BGR  =24,\n    CV_BGR5552RGB  =25,\n    CV_BGRA2BGR555 =26,\n    CV_RGBA2BGR555 =27,\n    CV_BGR5552BGRA =28,\n    CV_BGR5552RGBA =29,\n\n    CV_GRAY2BGR555 =30,\n    CV_BGR5552GRAY =31,\n\n    CV_BGR2XYZ     =32,\n    CV_RGB2XYZ     =33,\n    CV_XYZ2BGR     =34,\n    CV_XYZ2RGB     =35,\n\n    CV_BGR2YCrCb   =36,\n    CV_RGB2YCrCb   =37,\n    CV_YCrCb2BGR   =38,\n    CV_YCrCb2RGB   =39,\n\n    CV_BGR2HSV     =40,\n    CV_RGB2HSV     =41,\n\n    CV_BGR2Lab     =44,\n    CV_RGB2Lab     =45,\n\n    CV_BayerBG2BGR =46,\n    CV_BayerGB2BGR =47,\n    CV_BayerRG2BGR =48,\n    CV_BayerGR2BGR =49,\n\n    CV_BayerBG2RGB =CV_BayerRG2BGR,\n    CV_BayerGB2RGB =CV_BayerGR2BGR,\n    CV_BayerRG2RGB =CV_BayerBG2BGR,\n    CV_BayerGR2RGB =CV_BayerGB2BGR,\n\n    CV_BGR2Luv     =50,\n    CV_RGB2Luv     =51,\n    CV_BGR2HLS     =52,\n    CV_RGB2HLS     =53,\n\n    CV_HSV2BGR     =54,\n    CV_HSV2RGB     =55,\n\n    CV_Lab2BGR     =56,\n    CV_Lab2RGB     =57,\n    CV_Luv2BGR     =58,\n    CV_Luv2RGB     =59,\n    CV_HLS2BGR     =60,\n    CV_HLS2RGB     =61,\n\n    CV_BayerBG2BGR_VNG =62,\n    CV_BayerGB2BGR_VNG =63,\n    CV_BayerRG2BGR_VNG =64,\n    CV_BayerGR2BGR_VNG =65,\n\n    CV_BayerBG2RGB_VNG =CV_BayerRG2BGR_VNG,\n    CV_BayerGB2RGB_VNG =CV_BayerGR2BGR_VNG,\n    CV_BayerRG2RGB_VNG =CV_BayerBG2BGR_VNG,\n    CV_BayerGR2RGB_VNG =CV_BayerGB2BGR_VNG,\n\n    CV_BGR2HSV_FULL = 66,\n    CV_RGB2HSV_FULL = 67,\n    CV_BGR2HLS_FULL = 68,\n    CV_RGB2HLS_FULL = 69,\n\n    CV_HSV2BGR_FULL = 70,\n    CV_HSV2RGB_FULL = 71,\n    CV_HLS2BGR_FULL = 72,\n    CV_HLS2RGB_FULL = 73,\n\n    CV_LBGR2Lab     = 74,\n    CV_LRGB2Lab     = 75,\n    CV_LBGR2Luv     = 76,\n    CV_LRGB2Luv     = 77,\n\n    CV_Lab2LBGR     = 78,\n    CV_Lab2LRGB     = 79,\n    CV_Luv2LBGR     = 80,\n    CV_Luv2LRGB     = 81,\n\n    CV_BGR2YUV      = 82,\n    CV_RGB2YUV      = 83,\n    CV_YUV2BGR      = 84,\n    CV_YUV2RGB      = 85,\n\n    CV_BayerBG2GRAY = 86,\n    CV_BayerGB2GRAY = 87,\n    CV_BayerRG2GRAY = 88,\n    CV_BayerGR2GRAY = 89,\n\n    //YUV 4:2:0 formats family\n    CV_YUV2RGB_NV12 = 90,\n    CV_YUV2BGR_NV12 = 91,\n    CV_YUV2RGB_NV21 = 92,\n    CV_YUV2BGR_NV21 = 93,\n    CV_YUV420sp2RGB = CV_YUV2RGB_NV21,\n    CV_YUV420sp2BGR = CV_YUV2BGR_NV21,\n\n    CV_YUV2RGBA_NV12 = 94,\n    CV_YUV2BGRA_NV12 = 95,\n    CV_YUV2RGBA_NV21 = 96,\n    CV_YUV2BGRA_NV21 = 97,\n    CV_YUV420sp2RGBA = CV_YUV2RGBA_NV21,\n    CV_YUV420sp2BGRA = CV_YUV2BGRA_NV21,\n\n    CV_YUV2RGB_YV12 = 98,\n    CV_YUV2BGR_YV12 = 99,\n    CV_YUV2RGB_IYUV = 100,\n    CV_YUV2BGR_IYUV = 101,\n    CV_YUV2RGB_I420 = CV_YUV2RGB_IYUV,\n    CV_YUV2BGR_I420 = CV_YUV2BGR_IYUV,\n    CV_YUV420p2RGB = CV_YUV2RGB_YV12,\n    CV_YUV420p2BGR = CV_YUV2BGR_YV12,\n\n    CV_YUV2RGBA_YV12 = 102,\n    CV_YUV2BGRA_YV12 = 103,\n    CV_YUV2RGBA_IYUV = 104,\n    CV_YUV2BGRA_IYUV = 105,\n    CV_YUV2RGBA_I420 = CV_YUV2RGBA_IYUV,\n    CV_YUV2BGRA_I420 = CV_YUV2BGRA_IYUV,\n    CV_YUV420p2RGBA = CV_YUV2RGBA_YV12,\n    CV_YUV420p2BGRA = CV_YUV2BGRA_YV12,\n\n    CV_YUV2GRAY_420 = 106,\n    CV_YUV2GRAY_NV21 = CV_YUV2GRAY_420,\n    CV_YUV2GRAY_NV12 = CV_YUV2GRAY_420,\n    CV_YUV2GRAY_YV12 = CV_YUV2GRAY_420,\n    CV_YUV2GRAY_IYUV = CV_YUV2GRAY_420,\n    CV_YUV2GRAY_I420 = CV_YUV2GRAY_420,\n    CV_YUV420sp2GRAY = CV_YUV2GRAY_420,\n    CV_YUV420p2GRAY = CV_YUV2GRAY_420,\n\n    //YUV 4:2:2 formats family\n    CV_YUV2RGB_UYVY = 107,\n    CV_YUV2BGR_UYVY = 108,\n    //CV_YUV2RGB_VYUY = 109,\n    //CV_YUV2BGR_VYUY = 110,\n    CV_YUV2RGB_Y422 = CV_YUV2RGB_UYVY,\n    CV_YUV2BGR_Y422 = CV_YUV2BGR_UYVY,\n    CV_YUV2RGB_UYNV = CV_YUV2RGB_UYVY,\n    CV_YUV2BGR_UYNV = CV_YUV2BGR_UYVY,\n\n    CV_YUV2RGBA_UYVY = 111,\n    CV_YUV2BGRA_UYVY = 112,\n    //CV_YUV2RGBA_VYUY = 113,\n    //CV_YUV2BGRA_VYUY = 114,\n    CV_YUV2RGBA_Y422 = CV_YUV2RGBA_UYVY,\n    CV_YUV2BGRA_Y422 = CV_YUV2BGRA_UYVY,\n    CV_YUV2RGBA_UYNV = CV_YUV2RGBA_UYVY,\n    CV_YUV2BGRA_UYNV = CV_YUV2BGRA_UYVY,\n\n    CV_YUV2RGB_YUY2 = 115,\n    CV_YUV2BGR_YUY2 = 116,\n    CV_YUV2RGB_YVYU = 117,\n    CV_YUV2BGR_YVYU = 118,\n    CV_YUV2RGB_YUYV = CV_YUV2RGB_YUY2,\n    CV_YUV2BGR_YUYV = CV_YUV2BGR_YUY2,\n    CV_YUV2RGB_YUNV = CV_YUV2RGB_YUY2,\n    CV_YUV2BGR_YUNV = CV_YUV2BGR_YUY2,\n\n    CV_YUV2RGBA_YUY2 = 119,\n    CV_YUV2BGRA_YUY2 = 120,\n    CV_YUV2RGBA_YVYU = 121,\n    CV_YUV2BGRA_YVYU = 122,\n    CV_YUV2RGBA_YUYV = CV_YUV2RGBA_YUY2,\n    CV_YUV2BGRA_YUYV = CV_YUV2BGRA_YUY2,\n    CV_YUV2RGBA_YUNV = CV_YUV2RGBA_YUY2,\n    CV_YUV2BGRA_YUNV = CV_YUV2BGRA_YUY2,\n\n    CV_YUV2GRAY_UYVY = 123,\n    CV_YUV2GRAY_YUY2 = 124,\n    //CV_YUV2GRAY_VYUY = CV_YUV2GRAY_UYVY,\n    CV_YUV2GRAY_Y422 = CV_YUV2GRAY_UYVY,\n    CV_YUV2GRAY_UYNV = CV_YUV2GRAY_UYVY,\n    CV_YUV2GRAY_YVYU = CV_YUV2GRAY_YUY2,\n    CV_YUV2GRAY_YUYV = CV_YUV2GRAY_YUY2,\n    CV_YUV2GRAY_YUNV = CV_YUV2GRAY_YUY2,\n\n    // alpha premultiplication\n    CV_RGBA2mRGBA = 125,\n    CV_mRGBA2RGBA = 126,\n\n    CV_RGB2YUV_I420 = 127,\n    CV_BGR2YUV_I420 = 128,\n    CV_RGB2YUV_IYUV = CV_RGB2YUV_I420,\n    CV_BGR2YUV_IYUV = CV_BGR2YUV_I420,\n\n    CV_RGBA2YUV_I420 = 129,\n    CV_BGRA2YUV_I420 = 130,\n    CV_RGBA2YUV_IYUV = CV_RGBA2YUV_I420,\n    CV_BGRA2YUV_IYUV = CV_BGRA2YUV_I420,\n    CV_RGB2YUV_YV12  = 131,\n    CV_BGR2YUV_YV12  = 132,\n    CV_RGBA2YUV_YV12 = 133,\n    CV_BGRA2YUV_YV12 = 134,\n\n    CV_COLORCVT_MAX  = 135\n};\n\n\n/* Sub-pixel interpolation methods */\nenum\n{\n    CV_INTER_NN        =0,\n    CV_INTER_LINEAR    =1,\n    CV_INTER_CUBIC     =2,\n    CV_INTER_AREA      =3,\n    CV_INTER_LANCZOS4  =4\n};\n\n/* ... and other image warping flags */\nenum\n{\n    CV_WARP_FILL_OUTLIERS =8,\n    CV_WARP_INVERSE_MAP  =16\n};\n\n/* Shapes of a structuring element for morphological operations */\nenum\n{\n    CV_SHAPE_RECT      =0,\n    CV_SHAPE_CROSS     =1,\n    CV_SHAPE_ELLIPSE   =2,\n    CV_SHAPE_CUSTOM    =100\n};\n\n/* Morphological operations */\nenum\n{\n    CV_MOP_ERODE        =0,\n    CV_MOP_DILATE       =1,\n    CV_MOP_OPEN         =2,\n    CV_MOP_CLOSE        =3,\n    CV_MOP_GRADIENT     =4,\n    CV_MOP_TOPHAT       =5,\n    CV_MOP_BLACKHAT     =6\n};\n\n/* Spatial and central moments */\ntypedef struct CvMoments\n{\n    double  m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; /* spatial moments */\n    double  mu20, mu11, mu02, mu30, mu21, mu12, mu03; /* central moments */\n    double  inv_sqrt_m00; /* m00 != 0 ? 1/sqrt(m00) : 0 */\n}\nCvMoments;\n\n/* Hu invariants */\ntypedef struct CvHuMoments\n{\n    double hu1, hu2, hu3, hu4, hu5, hu6, hu7; /* Hu invariants */\n}\nCvHuMoments;\n\n/* Template matching methods */\nenum\n{\n    CV_TM_SQDIFF        =0,\n    CV_TM_SQDIFF_NORMED =1,\n    CV_TM_CCORR         =2,\n    CV_TM_CCORR_NORMED  =3,\n    CV_TM_CCOEFF        =4,\n    CV_TM_CCOEFF_NORMED =5\n};\n\ntypedef float (CV_CDECL * CvDistanceFunction)( const float* a, const float* b, void* user_param );\n\n/* Contour retrieval modes */\nenum\n{\n    CV_RETR_EXTERNAL=0,\n    CV_RETR_LIST=1,\n    CV_RETR_CCOMP=2,\n    CV_RETR_TREE=3,\n    CV_RETR_FLOODFILL=4\n};\n\n/* Contour approximation methods */\nenum\n{\n    CV_CHAIN_CODE=0,\n    CV_CHAIN_APPROX_NONE=1,\n    CV_CHAIN_APPROX_SIMPLE=2,\n    CV_CHAIN_APPROX_TC89_L1=3,\n    CV_CHAIN_APPROX_TC89_KCOS=4,\n    CV_LINK_RUNS=5\n};\n\n/*\nInternal structure that is used for sequental retrieving contours from the image.\nIt supports both hierarchical and plane variants of Suzuki algorithm.\n*/\ntypedef struct _CvContourScanner* CvContourScanner;\n\n/* Freeman chain reader state */\ntypedef struct CvChainPtReader\n{\n    CV_SEQ_READER_FIELDS()\n    char      code;\n    CvPoint   pt;\n    schar     deltas[8][2];\n}\nCvChainPtReader;\n\n/* initializes 8-element array for fast access to 3x3 neighborhood of a pixel */\n#define  CV_INIT_3X3_DELTAS( deltas, step, nch )            \\\n    ((deltas)[0] =  (nch),  (deltas)[1] = -(step) + (nch),  \\\n     (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch),  \\\n     (deltas)[4] = -(nch),  (deltas)[5] =  (step) - (nch),  \\\n     (deltas)[6] =  (step), (deltas)[7] =  (step) + (nch))\n\n\n/****************************************************************************************\\\n*                              Planar subdivisions                                       *\n\\****************************************************************************************/\n\ntypedef size_t CvSubdiv2DEdge;\n\n#define CV_QUADEDGE2D_FIELDS()     \\\n    int flags;                     \\\n    struct CvSubdiv2DPoint* pt[4]; \\\n    CvSubdiv2DEdge  next[4];\n\n#define CV_SUBDIV2D_POINT_FIELDS()\\\n    int            flags;      \\\n    CvSubdiv2DEdge first;      \\\n    CvPoint2D32f   pt;         \\\n    int id;\n\n#define CV_SUBDIV2D_VIRTUAL_POINT_FLAG (1 << 30)\n\ntypedef struct CvQuadEdge2D\n{\n    CV_QUADEDGE2D_FIELDS()\n}\nCvQuadEdge2D;\n\ntypedef struct CvSubdiv2DPoint\n{\n    CV_SUBDIV2D_POINT_FIELDS()\n}\nCvSubdiv2DPoint;\n\n#define CV_SUBDIV2D_FIELDS()    \\\n    CV_GRAPH_FIELDS()           \\\n    int  quad_edges;            \\\n    int  is_geometry_valid;     \\\n    CvSubdiv2DEdge recent_edge; \\\n    CvPoint2D32f  topleft;      \\\n    CvPoint2D32f  bottomright;\n\ntypedef struct CvSubdiv2D\n{\n    CV_SUBDIV2D_FIELDS()\n}\nCvSubdiv2D;\n\n\ntypedef enum CvSubdiv2DPointLocation\n{\n    CV_PTLOC_ERROR = -2,\n    CV_PTLOC_OUTSIDE_RECT = -1,\n    CV_PTLOC_INSIDE = 0,\n    CV_PTLOC_VERTEX = 1,\n    CV_PTLOC_ON_EDGE = 2\n}\nCvSubdiv2DPointLocation;\n\ntypedef enum CvNextEdgeType\n{\n    CV_NEXT_AROUND_ORG   = 0x00,\n    CV_NEXT_AROUND_DST   = 0x22,\n    CV_PREV_AROUND_ORG   = 0x11,\n    CV_PREV_AROUND_DST   = 0x33,\n    CV_NEXT_AROUND_LEFT  = 0x13,\n    CV_NEXT_AROUND_RIGHT = 0x31,\n    CV_PREV_AROUND_LEFT  = 0x20,\n    CV_PREV_AROUND_RIGHT = 0x02\n}\nCvNextEdgeType;\n\n/* get the next edge with the same origin point (counterwise) */\n#define  CV_SUBDIV2D_NEXT_EDGE( edge )  (((CvQuadEdge2D*)((edge) & ~3))->next[(edge)&3])\n\n\n/* Contour approximation algorithms */\nenum\n{\n    CV_POLY_APPROX_DP = 0\n};\n\n/* Shape matching methods */\nenum\n{\n    CV_CONTOURS_MATCH_I1  =1,\n    CV_CONTOURS_MATCH_I2  =2,\n    CV_CONTOURS_MATCH_I3  =3\n};\n\n/* Shape orientation */\nenum\n{\n    CV_CLOCKWISE         =1,\n    CV_COUNTER_CLOCKWISE =2\n};\n\n\n/* Convexity defect */\ntypedef struct CvConvexityDefect\n{\n    CvPoint* start; /* point of the contour where the defect begins */\n    CvPoint* end; /* point of the contour where the defect ends */\n    CvPoint* depth_point; /* the farthest from the convex hull point within the defect */\n    float depth; /* distance between the farthest point and the convex hull */\n} CvConvexityDefect;\n\n\n/* Histogram comparison methods */\nenum\n{\n    CV_COMP_CORREL        =0,\n    CV_COMP_CHISQR        =1,\n    CV_COMP_INTERSECT     =2,\n    CV_COMP_BHATTACHARYYA =3,\n    CV_COMP_HELLINGER     =CV_COMP_BHATTACHARYYA\n};\n\n/* Mask size for distance transform */\nenum\n{\n    CV_DIST_MASK_3   =3,\n    CV_DIST_MASK_5   =5,\n    CV_DIST_MASK_PRECISE =0\n};\n\n/* Content of output label array: connected components or pixels */\nenum\n{\n  CV_DIST_LABEL_CCOMP = 0,\n  CV_DIST_LABEL_PIXEL = 1\n};\n\n/* Distance types for Distance Transform and M-estimators */\nenum\n{\n    CV_DIST_USER    =-1,  /* User defined distance */\n    CV_DIST_L1      =1,   /* distance = |x1-x2| + |y1-y2| */\n    CV_DIST_L2      =2,   /* the simple euclidean distance */\n    CV_DIST_C       =3,   /* distance = max(|x1-x2|,|y1-y2|) */\n    CV_DIST_L12     =4,   /* L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) */\n    CV_DIST_FAIR    =5,   /* distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 */\n    CV_DIST_WELSCH  =6,   /* distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 */\n    CV_DIST_HUBER   =7    /* distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345 */\n};\n\n\n/* Threshold types */\nenum\n{\n    CV_THRESH_BINARY      =0,  /* value = value > threshold ? max_value : 0       */\n    CV_THRESH_BINARY_INV  =1,  /* value = value > threshold ? 0 : max_value       */\n    CV_THRESH_TRUNC       =2,  /* value = value > threshold ? threshold : value   */\n    CV_THRESH_TOZERO      =3,  /* value = value > threshold ? value : 0           */\n    CV_THRESH_TOZERO_INV  =4,  /* value = value > threshold ? 0 : value           */\n    CV_THRESH_MASK        =7,\n    CV_THRESH_OTSU        =8  /* use Otsu algorithm to choose the optimal threshold value;\n                                 combine the flag with one of the above CV_THRESH_* values */\n};\n\n/* Adaptive threshold methods */\nenum\n{\n    CV_ADAPTIVE_THRESH_MEAN_C  =0,\n    CV_ADAPTIVE_THRESH_GAUSSIAN_C  =1\n};\n\n/* FloodFill flags */\nenum\n{\n    CV_FLOODFILL_FIXED_RANGE =(1 << 16),\n    CV_FLOODFILL_MASK_ONLY   =(1 << 17)\n};\n\n\n/* Canny edge detector flags */\nenum\n{\n    CV_CANNY_L2_GRADIENT  =(1 << 31)\n};\n\n/* Variants of a Hough transform */\nenum\n{\n    CV_HOUGH_STANDARD =0,\n    CV_HOUGH_PROBABILISTIC =1,\n    CV_HOUGH_MULTI_SCALE =2,\n    CV_HOUGH_GRADIENT =3\n};\n\n\n/* Fast search data structures  */\nstruct CvFeatureTree;\nstruct CvLSH;\nstruct CvLSHOperations;\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/legacy/blobtrack.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n\n#ifndef __OPENCV_VIDEOSURVEILLANCE_H__\n#define __OPENCV_VIDEOSURVEILLANCE_H__\n\n/* Turn off the functionality until cvaux/src/Makefile.am gets updated: */\n//#if _MSC_VER >= 1200\n\n#include \"opencv2/core/core_c.h\"\n#include <stdio.h>\n\n#if (defined _MSC_VER && _MSC_VER >= 1200) || defined __BORLANDC__\n#define cv_stricmp stricmp\n#define cv_strnicmp strnicmp\n#if defined WINCE\n#define strdup _strdup\n#define stricmp _stricmp\n#endif\n#elif defined __GNUC__ || defined __sun\n#define cv_stricmp strcasecmp\n#define cv_strnicmp strncasecmp\n#else\n#error Do not know how to make case-insensitive string comparison on this platform\n#endif\n\n//struct DefParam;\nstruct CvDefParam\n{\n    struct CvDefParam*    next;\n    char*               pName;\n    char*               pComment;\n    double*             pDouble;\n    double              Double;\n    float*              pFloat;\n    float               Float;\n    int*                pInt;\n    int                 Int;\n    char**              pStr;\n    char*               Str;\n};\n\nclass CV_EXPORTS CvVSModule\n{\nprivate: /* Internal data: */\n    CvDefParam*   m_pParamList;\n    char*       m_pModuleTypeName;\n    char*       m_pModuleName;\n    char*       m_pNickName;\nprotected:\n    int         m_Wnd;\npublic: /* Constructor and destructor: */\n    CvVSModule();\n    virtual ~CvVSModule();\nprivate: /* Internal functions: */\n    void    FreeParam(CvDefParam** pp);\n    CvDefParam* NewParam(const char* name);\n    CvDefParam* GetParamPtr(int index);\n    CvDefParam* GetParamPtr(const char* name);\nprotected: /* INTERNAL INTERFACE */\n    int  IsParam(const char* name);\n    void AddParam(const char* name, double* pAddr);\n    void AddParam(const char* name, float* pAddr);\n    void AddParam(const char* name, int* pAddr);\n    void AddParam(const char* name, const char** pAddr);\n    void AddParam(const char* name);\n    void CommentParam(const char* name, const char* pComment);\n    void SetTypeName(const char* name);\n    void SetModuleName(const char* name);\n    void DelParam(const char* name);\n\npublic: /* EXTERNAL INTERFACE */\n    const char* GetParamName(int index);\n    const char* GetParamComment(const char* name);\n    double GetParam(const char* name);\n    const char* GetParamStr(const char* name);\n    void   SetParam(const char* name, double val);\n    void   SetParamStr(const char* name, const char* str);\n    void TransferParamsFromChild(CvVSModule* pM, const char* prefix = NULL);\n    void TransferParamsToChild(CvVSModule* pM, char* prefix = NULL);\n    virtual void ParamUpdate();\n    const char*   GetTypeName();\n    int     IsModuleTypeName(const char* name);\n    char*   GetModuleName();\n    int     IsModuleName(const char* name);\n    void SetNickName(const char* pStr);\n    const char* GetNickName();\n    virtual void SaveState(CvFileStorage*);\n    virtual void LoadState(CvFileStorage*, CvFileNode*);\n\n    virtual void Release() = 0;\n};/* CvVMModule */\n\nCV_EXPORTS void cvWriteStruct(CvFileStorage* fs, const char* name, void* addr, const char* desc, int num=1);\nCV_EXPORTS void cvReadStructByName(CvFileStorage* fs, CvFileNode* node, const char* name, void* addr, const char* desc);\n\n/* FOREGROUND DETECTOR INTERFACE */\nclass CV_EXPORTS CvFGDetector : public CvVSModule\n{\npublic:\n    CvFGDetector();\n    virtual IplImage* GetMask() = 0;\n    /* Process current image: */\n    virtual void    Process(IplImage* pImg) = 0;\n    /* Release foreground detector: */\n    virtual void    Release() = 0;\n};\n\nCV_EXPORTS void cvReleaseFGDetector(CvFGDetector** ppT );\nCV_EXPORTS CvFGDetector* cvCreateFGDetectorBase(int type, void *param);\n\n\n/* BLOB STRUCTURE*/\nstruct CvBlob\n{\n    float   x,y; /* blob position   */\n    float   w,h; /* blob sizes      */\n    int     ID;  /* blob ID         */\n};\n\ninline CvBlob cvBlob(float x,float y, float w, float h)\n{\n    CvBlob B = {x,y,w,h,0};\n    return B;\n}\n#define CV_BLOB_MINW 5\n#define CV_BLOB_MINH 5\n#define CV_BLOB_ID(pB) (((CvBlob*)(pB))->ID)\n#define CV_BLOB_CENTER(pB) cvPoint2D32f(((CvBlob*)(pB))->x,((CvBlob*)(pB))->y)\n#define CV_BLOB_X(pB) (((CvBlob*)(pB))->x)\n#define CV_BLOB_Y(pB) (((CvBlob*)(pB))->y)\n#define CV_BLOB_WX(pB) (((CvBlob*)(pB))->w)\n#define CV_BLOB_WY(pB) (((CvBlob*)(pB))->h)\n#define CV_BLOB_RX(pB) (0.5f*CV_BLOB_WX(pB))\n#define CV_BLOB_RY(pB) (0.5f*CV_BLOB_WY(pB))\n#define CV_BLOB_RECT(pB) cvRect(cvRound(((CvBlob*)(pB))->x-CV_BLOB_RX(pB)),cvRound(((CvBlob*)(pB))->y-CV_BLOB_RY(pB)),cvRound(CV_BLOB_WX(pB)),cvRound(CV_BLOB_WY(pB)))\n/* END BLOB STRUCTURE*/\n\n\n/* simple BLOBLIST */\nclass CV_EXPORTS CvBlobSeq\n{\npublic:\n    CvBlobSeq(int BlobSize = sizeof(CvBlob))\n    {\n        m_pMem = cvCreateMemStorage();\n        m_pSeq = cvCreateSeq(0,sizeof(CvSeq),BlobSize,m_pMem);\n        strcpy(m_pElemFormat,\"ffffi\");\n    }\n    virtual ~CvBlobSeq()\n    {\n        cvReleaseMemStorage(&m_pMem);\n    };\n    virtual CvBlob* GetBlob(int BlobIndex)\n    {\n        return (CvBlob*)cvGetSeqElem(m_pSeq,BlobIndex);\n    };\n    virtual CvBlob* GetBlobByID(int BlobID)\n    {\n        int i;\n        for(i=0; i<m_pSeq->total; ++i)\n            if(BlobID == CV_BLOB_ID(GetBlob(i)))\n                return GetBlob(i);\n        return NULL;\n    };\n    virtual void DelBlob(int BlobIndex)\n    {\n        cvSeqRemove(m_pSeq,BlobIndex);\n    };\n    virtual void DelBlobByID(int BlobID)\n    {\n        int i;\n        for(i=0; i<m_pSeq->total; ++i)\n        {\n            if(BlobID == CV_BLOB_ID(GetBlob(i)))\n            {\n                DelBlob(i);\n                return;\n            }\n        }\n    };\n    virtual void Clear()\n    {\n        cvClearSeq(m_pSeq);\n    };\n    virtual void AddBlob(CvBlob* pB)\n    {\n        cvSeqPush(m_pSeq,pB);\n    };\n    virtual int GetBlobNum()\n    {\n        return m_pSeq->total;\n    };\n    virtual void Write(CvFileStorage* fs, const char* name)\n    {\n        const char*  attr[] = {\"dt\",m_pElemFormat,NULL};\n        if(fs)\n        {\n            cvWrite(fs,name,m_pSeq,cvAttrList(attr,NULL));\n        }\n    }\n    virtual void Load(CvFileStorage* fs, CvFileNode* node)\n    {\n        if(fs==NULL) return;\n        CvSeq* pSeq = (CvSeq*)cvRead(fs, node);\n        if(pSeq)\n        {\n            int i;\n            cvClearSeq(m_pSeq);\n            for(i=0;i<pSeq->total;++i)\n            {\n                void* pB = cvGetSeqElem( pSeq, i );\n                cvSeqPush( m_pSeq, pB );\n            }\n        }\n    }\n    void AddFormat(const char* str){strcat(m_pElemFormat,str);}\nprotected:\n    CvMemStorage*   m_pMem;\n    CvSeq*          m_pSeq;\n    char            m_pElemFormat[1024];\n};\n/* simple BLOBLIST */\n\n\n/* simple TRACKLIST */\nstruct CvBlobTrack\n{\n    int         TrackID;\n    int         StartFrame;\n    CvBlobSeq*  pBlobSeq;\n};\n\nclass CV_EXPORTS CvBlobTrackSeq\n{\npublic:\n    CvBlobTrackSeq(int TrackSize = sizeof(CvBlobTrack));\n    virtual ~CvBlobTrackSeq();\n    virtual CvBlobTrack* GetBlobTrack(int TrackIndex);\n    virtual CvBlobTrack* GetBlobTrackByID(int TrackID);\n    virtual void DelBlobTrack(int TrackIndex);\n    virtual void DelBlobTrackByID(int TrackID);\n    virtual void Clear();\n    virtual void AddBlobTrack(int TrackID, int StartFrame = 0);\n    virtual int GetBlobTrackNum();\nprotected:\n    CvMemStorage*   m_pMem;\n    CvSeq*          m_pSeq;\n};\n\n/* simple TRACKLIST */\n\n\n/* BLOB DETECTOR INTERFACE */\nclass CV_EXPORTS CvBlobDetector: public CvVSModule\n{\npublic:\n    CvBlobDetector(){SetTypeName(\"BlobDetector\");};\n    /* Try to detect new blob entrance based on foreground mask. */\n    /* pFGMask - image of foreground mask */\n    /* pNewBlob - pointer to CvBlob structure which will be filled if new blob entrance detected */\n    /* pOldBlobList - pointer to blob list which already exist on image */\n    virtual int DetectNewBlob(IplImage* pImg, IplImage* pImgFG, CvBlobSeq* pNewBlobList, CvBlobSeq* pOldBlobList) = 0;\n    /* release blob detector */\n    virtual void Release()=0;\n};\n\n/* Release any blob detector: */\nCV_EXPORTS void cvReleaseBlobDetector(CvBlobDetector** ppBD);\n\n/* Declarations of constructors of implemented modules: */\nCV_EXPORTS CvBlobDetector* cvCreateBlobDetectorSimple();\nCV_EXPORTS CvBlobDetector* cvCreateBlobDetectorCC();\n\nstruct CV_EXPORTS CvDetectedBlob : public CvBlob\n{\n    float response;\n};\n\nCV_INLINE CvDetectedBlob cvDetectedBlob( float x, float y, float w, float h, int ID = 0, float response = 0.0F )\n{\n    CvDetectedBlob b;\n    b.x = x; b.y = y; b.w = w; b.h = h; b.ID = ID; b.response = response;\n    return b;\n}\n\n\nclass CV_EXPORTS CvObjectDetector\n{\npublic:\n    CvObjectDetector( const char* /*detector_file_name*/ = 0 );\n    ~CvObjectDetector();\n\n    /*\n     * Release the current detector and load new detector from file\n     * (if detector_file_name is not 0)\n     * Return true on success:\n     */\n    bool Load( const char* /*detector_file_name*/ = 0 );\n\n    /* Return min detector window size: */\n    CvSize GetMinWindowSize() const;\n\n    /* Return max border: */\n    int GetMaxBorderSize() const;\n\n    /*\n     * Detect the object on the image and push the detected\n     * blobs into <detected_blob_seq> which must be the sequence of <CvDetectedBlob>s\n     */\n    void Detect( const CvArr* /*img*/, /* out */ CvBlobSeq* /*detected_blob_seq*/ = 0 );\n\nprotected:\n    class CvObjectDetectorImpl* impl;\n};\n\n\nCV_INLINE CvRect cvRectIntersection( const CvRect r1, const CvRect r2 )\n{\n    CvRect r = cvRect( MAX(r1.x, r2.x), MAX(r1.y, r2.y), 0, 0 );\n\n    r.width  = MIN(r1.x + r1.width, r2.x + r2.width) - r.x;\n    r.height = MIN(r1.y + r1.height, r2.y + r2.height) - r.y;\n\n    return r;\n}\n\n\n/*\n * CvImageDrawer\n *\n * Draw on an image the specified ROIs from the source image and\n * given blobs as ellipses or rectangles:\n */\n\nstruct CvDrawShape\n{\n    enum {RECT, ELLIPSE} shape;\n    CvScalar color;\n};\n\n/*extern const CvDrawShape icv_shape[] =\n{\n    { CvDrawShape::ELLIPSE, CV_RGB(255,0,0) },\n    { CvDrawShape::ELLIPSE, CV_RGB(0,255,0) },\n    { CvDrawShape::ELLIPSE, CV_RGB(0,0,255) },\n    { CvDrawShape::ELLIPSE, CV_RGB(255,255,0) },\n    { CvDrawShape::ELLIPSE, CV_RGB(0,255,255) },\n    { CvDrawShape::ELLIPSE, CV_RGB(255,0,255) }\n};*/\n\nclass CV_EXPORTS CvImageDrawer\n{\npublic:\n    CvImageDrawer() : m_image(0) {}\n    ~CvImageDrawer() { cvReleaseImage( &m_image ); }\n    void SetShapes( const CvDrawShape* shapes, int num );\n    /* <blob_seq> must be the sequence of <CvDetectedBlob>s */\n    IplImage* Draw( const CvArr* src, CvBlobSeq* blob_seq = 0, const CvSeq* roi_seq = 0 );\n    IplImage* GetImage() { return m_image; }\nprotected:\n    //static const int MAX_SHAPES = sizeof(icv_shape) / sizeof(icv_shape[0]);;\n\n    IplImage* m_image;\n    CvDrawShape m_shape[16];\n};\n\n\n\n/* Trajectory generation module: */\nclass CV_EXPORTS CvBlobTrackGen: public CvVSModule\n{\npublic:\n    CvBlobTrackGen(){SetTypeName(\"BlobTrackGen\");};\n    virtual void    SetFileName(char* pFileName) = 0;\n    virtual void    AddBlob(CvBlob* pBlob) = 0;\n    virtual void    Process(IplImage* pImg = NULL, IplImage* pFG = NULL) = 0;\n    virtual void    Release() = 0;\n};\n\ninline void cvReleaseBlobTrackGen(CvBlobTrackGen** pBTGen)\n{\n    if(*pBTGen)(*pBTGen)->Release();\n    *pBTGen = 0;\n}\n\n/* Declarations of constructors of implemented modules: */\nCV_EXPORTS CvBlobTrackGen* cvCreateModuleBlobTrackGen1();\nCV_EXPORTS CvBlobTrackGen* cvCreateModuleBlobTrackGenYML();\n\n\n\n/* BLOB TRACKER INTERFACE */\nclass CV_EXPORTS CvBlobTracker: public CvVSModule\n{\npublic:\n    CvBlobTracker();\n\n    /* Add new blob to track it and assign to this blob personal ID */\n    /* pBlob - pointer to structure with blob parameters (ID is ignored)*/\n    /* pImg - current image */\n    /* pImgFG - current foreground mask */\n    /* Return pointer to new added blob: */\n    virtual CvBlob* AddBlob(CvBlob* pBlob, IplImage* pImg, IplImage* pImgFG = NULL ) = 0;\n\n    /* Return number of currently tracked blobs: */\n    virtual int     GetBlobNum() = 0;\n\n    /* Return pointer to specified by index blob: */\n    virtual CvBlob* GetBlob(int BlobIndex) = 0;\n\n    /* Delete blob by its index: */\n    virtual void    DelBlob(int BlobIndex) = 0;\n\n    /* Process current image and track all existed blobs: */\n    virtual void    Process(IplImage* pImg, IplImage* pImgFG = NULL) = 0;\n\n    /* Release blob tracker: */\n    virtual void    Release() = 0;\n\n\n    /* Process one blob (for multi hypothesis tracing): */\n    virtual void ProcessBlob(int BlobIndex, CvBlob* pBlob, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL);\n\n    /* Get confidence/wieght/probability (0-1) for blob: */\n    virtual double  GetConfidence(int /*BlobIndex*/, CvBlob* /*pBlob*/, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL);\n\n    virtual double GetConfidenceList(CvBlobSeq* pBlobList, IplImage* pImg, IplImage* pImgFG = NULL);\n\n    virtual void UpdateBlob(int /*BlobIndex*/, CvBlob* /*pBlob*/, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL);\n\n    /* Update all blob models: */\n    virtual void Update(IplImage* pImg, IplImage* pImgFG = NULL);\n\n    /* Return pointer to blob by its unique ID: */\n    virtual int     GetBlobIndexByID(int BlobID);\n\n    /* Return pointer to blob by its unique ID: */\n    virtual CvBlob* GetBlobByID(int BlobID);\n\n    /* Delete blob by its ID: */\n    virtual void    DelBlobByID(int BlobID);\n\n    /* Set new parameters for specified (by index) blob: */\n    virtual void    SetBlob(int /*BlobIndex*/, CvBlob* /*pBlob*/);\n\n    /* Set new parameters for specified (by ID) blob: */\n    virtual void    SetBlobByID(int BlobID, CvBlob* pBlob);\n\n    /*  ===============  MULTI HYPOTHESIS INTERFACE ==================  */\n\n    /* Return number of position hyposetis of currently tracked blob: */\n    virtual int     GetBlobHypNum(int /*BlobIdx*/);\n\n    /* Return pointer to specified blob hypothesis by index blob: */\n    virtual CvBlob* GetBlobHyp(int BlobIndex, int /*hypothesis*/);\n\n    /* Set new parameters for specified (by index) blob hyp\n     * (can be called several times for each hyp ):\n     */\n    virtual void    SetBlobHyp(int /*BlobIndex*/, CvBlob* /*pBlob*/);\n};\n\nCV_EXPORTS void cvReleaseBlobTracker(CvBlobTracker**ppT );\n/* BLOB TRACKER INTERFACE */\n\n/*BLOB TRACKER ONE INTERFACE */\nclass CV_EXPORTS CvBlobTrackerOne : public CvVSModule\n{\npublic:\n    virtual void Init(CvBlob* pBlobInit, IplImage* pImg, IplImage* pImgFG = NULL) = 0;\n    virtual CvBlob* Process(CvBlob* pBlobPrev, IplImage* pImg, IplImage* pImgFG = NULL) = 0;\n    virtual void Release() =  0;\n\n    /* Non-required methods: */\n    virtual void SkipProcess(CvBlob* /*pBlobPrev*/, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL){};\n    virtual void Update(CvBlob* /*pBlob*/, IplImage* /*pImg*/, IplImage* /*pImgFG*/ = NULL){};\n    virtual void SetCollision(int /*CollisionFlag*/){}; /* call in case of blob collision situation*/\n    virtual double GetConfidence(CvBlob* /*pBlob*/, IplImage* /*pImg*/,\n                                 IplImage* /*pImgFG*/ = NULL, IplImage* /*pImgUnusedReg*/ = NULL)\n    {\n        return 1;\n    };\n};\ninline void cvReleaseBlobTrackerOne(CvBlobTrackerOne **ppT )\n{\n    ppT[0]->Release();\n    ppT[0] = 0;\n}\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerList(CvBlobTrackerOne* (*create)());\n/*BLOB TRACKER ONE INTERFACE */\n\n/* Declarations of constructors of implemented modules: */\n\n/* Some declarations for specific MeanShift tracker: */\n#define PROFILE_EPANECHNIKOV    0\n#define PROFILE_DOG             1\nstruct CvBlobTrackerParamMS\n{\n    int     noOfSigBits;\n    int     appearance_profile;\n    int     meanshift_profile;\n    float   sigma;\n};\n\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMS1(CvBlobTrackerParamMS* param);\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMS2(CvBlobTrackerParamMS* param);\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMS1ByList();\n\n/* Some declarations for specific Likelihood tracker: */\nstruct CvBlobTrackerParamLH\n{\n    int     HistType; /* see Prob.h */\n    int     ScaleAfter;\n};\n\n/* Without scale optimization: */\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerLHR(CvBlobTrackerParamLH* /*param*/ = NULL);\n\n/* With scale optimization: */\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerLHRS(CvBlobTrackerParamLH* /*param*/ = NULL);\n\n/* Simple blob tracker based on connected component tracking: */\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerCC();\n\n/* Connected component tracking and mean-shift particle filter collion-resolver: */\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerCCMSPF();\n\n/* Blob tracker that integrates meanshift and connected components: */\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMSFG();\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMSFGS();\n\n/* Meanshift without connected-components */\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMS();\n\n/* Particle filtering via Bhattacharya coefficient, which        */\n/* is roughly the dot-product of two probability densities.      */\n/* See: Real-Time Tracking of Non-Rigid Objects using Mean Shift */\n/*      Comanicius, Ramesh, Meer, 2000, 8p                       */\n/*      http://citeseer.ist.psu.edu/321441.html                  */\nCV_EXPORTS CvBlobTracker* cvCreateBlobTrackerMSPF();\n\n/* =========== tracker integrators trackers =============*/\n\n/* Integrator based on Particle Filtering method: */\n//CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerIPF();\n\n/* Rule based integrator: */\n//CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerIRB();\n\n/* Integrator based on data fusion using particle filtering: */\n//CV_EXPORTS CvBlobTracker* cvCreateBlobTrackerIPFDF();\n\n\n\n\n/* Trajectory postprocessing module: */\nclass CV_EXPORTS CvBlobTrackPostProc: public CvVSModule\n{\npublic:\n    CvBlobTrackPostProc(){SetTypeName(\"BlobTrackPostProc\");};\n    virtual void    AddBlob(CvBlob* pBlob) = 0;\n    virtual void    Process() = 0;\n    virtual int     GetBlobNum() = 0;\n    virtual CvBlob* GetBlob(int index) = 0;\n    virtual void    Release() = 0;\n\n    /* Additional functionality: */\n    virtual CvBlob* GetBlobByID(int BlobID)\n    {\n        int i;\n        for(i=GetBlobNum();i>0;i--)\n        {\n            CvBlob* pB=GetBlob(i-1);\n            if(pB->ID==BlobID) return pB;\n        }\n        return NULL;\n    };\n};\n\ninline void cvReleaseBlobTrackPostProc(CvBlobTrackPostProc** pBTPP)\n{\n    if(pBTPP == NULL) return;\n    if(*pBTPP)(*pBTPP)->Release();\n    *pBTPP = 0;\n}\n\n/* Trajectory generation module: */\nclass CV_EXPORTS CvBlobTrackPostProcOne: public CvVSModule\n{\npublic:\n    CvBlobTrackPostProcOne(){SetTypeName(\"BlobTrackPostOne\");};\n    virtual CvBlob* Process(CvBlob* pBlob) = 0;\n    virtual void    Release() = 0;\n};\n\n/* Create blob tracking post processing module based on simle module: */\nCV_EXPORTS CvBlobTrackPostProc* cvCreateBlobTrackPostProcList(CvBlobTrackPostProcOne* (*create)());\n\n\n/* Declarations of constructors of implemented modules: */\nCV_EXPORTS CvBlobTrackPostProc* cvCreateModuleBlobTrackPostProcKalman();\nCV_EXPORTS CvBlobTrackPostProc* cvCreateModuleBlobTrackPostProcTimeAverRect();\nCV_EXPORTS CvBlobTrackPostProc* cvCreateModuleBlobTrackPostProcTimeAverExp();\n\n\n/* PREDICTORS */\n/* blob PREDICTOR */\nclass CvBlobTrackPredictor: public CvVSModule\n{\npublic:\n    CvBlobTrackPredictor(){SetTypeName(\"BlobTrackPredictor\");};\n    virtual CvBlob* Predict() = 0;\n    virtual void    Update(CvBlob* pBlob) = 0;\n    virtual void    Release() = 0;\n};\nCV_EXPORTS CvBlobTrackPredictor* cvCreateModuleBlobTrackPredictKalman();\n\n\n\n/* Trajectory analyser module: */\nclass CV_EXPORTS CvBlobTrackAnalysis: public CvVSModule\n{\npublic:\n    CvBlobTrackAnalysis(){SetTypeName(\"BlobTrackAnalysis\");};\n    virtual void    AddBlob(CvBlob* pBlob) = 0;\n    virtual void    Process(IplImage* pImg, IplImage* pFG) = 0;\n    virtual float   GetState(int BlobID) = 0;\n    /* return 0 if trajectory is normal\n       return >0 if trajectory abnormal */\n    virtual const char*   GetStateDesc(int /*BlobID*/){return NULL;};\n    virtual void    SetFileName(char* /*DataBaseName*/){};\n    virtual void    Release() = 0;\n};\n\n\ninline void cvReleaseBlobTrackAnalysis(CvBlobTrackAnalysis** pBTPP)\n{\n    if(pBTPP == NULL) return;\n    if(*pBTPP)(*pBTPP)->Release();\n    *pBTPP = 0;\n}\n\n/* Feature-vector generation module: */\nclass CV_EXPORTS CvBlobTrackFVGen : public CvVSModule\n{\npublic:\n    CvBlobTrackFVGen(){SetTypeName(\"BlobTrackFVGen\");};\n    virtual void    AddBlob(CvBlob* pBlob) = 0;\n    virtual void    Process(IplImage* pImg, IplImage* pFG) = 0;\n    virtual void    Release() = 0;\n    virtual int     GetFVSize() = 0;\n    virtual int     GetFVNum() = 0;\n    virtual float*  GetFV(int index, int* pFVID) = 0; /* Returns pointer to FV, if return 0 then FV not created */\n    virtual float*  GetFVVar(){return NULL;}; /* Returns pointer to array of variation of values of FV, if returns 0 then FVVar does not exist. */\n    virtual float*  GetFVMin() = 0; /* Returns pointer to array of minimal values of FV, if returns 0 then FVrange does not exist */\n    virtual float*  GetFVMax() = 0; /* Returns pointer to array of maximal values of FV, if returns 0 then FVrange does not exist */\n};\n\n\n/* Trajectory Analyser module: */\nclass CV_EXPORTS CvBlobTrackAnalysisOne\n{\npublic:\n    virtual ~CvBlobTrackAnalysisOne() {};\n    virtual int     Process(CvBlob* pBlob, IplImage* pImg, IplImage* pFG) = 0;\n    /* return 0 if trajectory is normal\n       return >0 if trajectory abnormal */\n    virtual void    Release() = 0;\n};\n\n/* Create blob tracking post processing module based on simle module: */\nCV_EXPORTS CvBlobTrackAnalysis* cvCreateBlobTrackAnalysisList(CvBlobTrackAnalysisOne* (*create)());\n\n/* Declarations of constructors of implemented modules: */\n\n/* Based on histogram analysis of 2D FV (x,y): */\nCV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisHistP();\n\n/* Based on histogram analysis of 4D FV (x,y,vx,vy): */\nCV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisHistPV();\n\n/* Based on histogram analysis of 5D FV (x,y,vx,vy,state): */\nCV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisHistPVS();\n\n/* Based on histogram analysis of 4D FV (startpos,stoppos): */\nCV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisHistSS();\n\n\n\n/* Based on SVM classifier analysis of 2D FV (x,y): */\n//CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMP();\n\n/* Based on SVM classifier analysis of 4D FV (x,y,vx,vy): */\n//CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMPV();\n\n/* Based on SVM classifier analysis of 5D FV (x,y,vx,vy,state): */\n//CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMPVS();\n\n/* Based on SVM classifier analysis of 4D FV (startpos,stoppos): */\n//CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMSS();\n\n/* Track analysis based on distance between tracks: */\nCV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisTrackDist();\n\n/* Analyzer based on reation Road and height map: */\n//CV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysis3DRoadMap();\n\n/* Analyzer that makes OR decision using set of analyzers: */\nCV_EXPORTS CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisIOR();\n\n/* Estimator of human height: */\nclass CV_EXPORTS CvBlobTrackAnalysisHeight: public CvBlobTrackAnalysis\n{\npublic:\n    virtual double  GetHeight(CvBlob* pB) = 0;\n};\n//CV_EXPORTS CvBlobTrackAnalysisHeight* cvCreateModuleBlobTrackAnalysisHeightScale();\n\n\n\n/* AUTO BLOB TRACKER INTERFACE -- pipeline of 3 modules: */\nclass CV_EXPORTS CvBlobTrackerAuto: public CvVSModule\n{\npublic:\n    CvBlobTrackerAuto(){SetTypeName(\"BlobTrackerAuto\");};\n    virtual void        Process(IplImage* pImg, IplImage* pMask = NULL) = 0;\n    virtual CvBlob*     GetBlob(int index) = 0;\n    virtual CvBlob*     GetBlobByID(int ID) = 0;\n    virtual int         GetBlobNum() = 0;\n    virtual IplImage*   GetFGMask(){return NULL;};\n    virtual float       GetState(int BlobID) = 0;\n    virtual const char*       GetStateDesc(int BlobID) = 0;\n    /* return 0 if trajectory is normal;\n     * return >0 if trajectory abnormal. */\n    virtual void    Release() = 0;\n};\ninline void cvReleaseBlobTrackerAuto(CvBlobTrackerAuto** ppT)\n{\n    ppT[0]->Release();\n    ppT[0] = 0;\n}\n/* END AUTO BLOB TRACKER INTERFACE */\n\n\n/* Constructor functions and data for specific BlobTRackerAuto modules: */\n\n/* Parameters of blobtracker auto ver1: */\nstruct CvBlobTrackerAutoParam1\n{\n    int                     FGTrainFrames; /* Number of frames needed for FG (foreground) detector to train.        */\n\n    CvFGDetector*           pFG;           /* FGDetector module. If this field is NULL the Process FG mask is used. */\n\n    CvBlobDetector*         pBD;           /* Selected blob detector module. \t\t\t\t\t    */\n                                           /* If this field is NULL default blobdetector module will be created.    */\n\n    CvBlobTracker*          pBT;           /* Selected blob tracking module.\t\t\t\t\t    */\n                                           /* If this field is NULL default blobtracker module will be created.     */\n\n    CvBlobTrackGen*         pBTGen;        /* Selected blob trajectory generator.\t\t\t\t    */\n                                           /* If this field is NULL no generator is used.                           */\n\n    CvBlobTrackPostProc*    pBTPP;         /* Selected blob trajectory postprocessing module.\t\t\t    */\n                                           /* If this field is NULL no postprocessing is done.                      */\n\n    int                     UsePPData;\n\n    CvBlobTrackAnalysis*    pBTA;          /* Selected blob trajectory analysis module.                             */\n                                           /* If this field is NULL no track analysis is done.                      */\n};\n\n/* Create blob tracker auto ver1: */\nCV_EXPORTS CvBlobTrackerAuto* cvCreateBlobTrackerAuto1(CvBlobTrackerAutoParam1* param = NULL);\n\n/* Simple loader for many auto trackers by its type : */\ninline CvBlobTrackerAuto* cvCreateBlobTrackerAuto(int type, void* param)\n{\n    if(type == 0) return cvCreateBlobTrackerAuto1((CvBlobTrackerAutoParam1*)param);\n    return 0;\n}\n\n\n\nstruct CvTracksTimePos\n{\n    int len1,len2;\n    int beg1,beg2;\n    int end1,end2;\n    int comLen; //common length for two tracks\n    int shift1,shift2;\n};\n\n/*CV_EXPORTS int cvCompareTracks( CvBlobTrackSeq *groundTruth,\n                   CvBlobTrackSeq *result,\n                   FILE *file);*/\n\n\n/* Constructor functions:  */\n\nCV_EXPORTS void cvCreateTracks_One(CvBlobTrackSeq *TS);\nCV_EXPORTS void cvCreateTracks_Same(CvBlobTrackSeq *TS1, CvBlobTrackSeq *TS2);\nCV_EXPORTS void cvCreateTracks_AreaErr(CvBlobTrackSeq *TS1, CvBlobTrackSeq *TS2, int addW, int addH);\n\n\n/* HIST API */\nclass CV_EXPORTS CvProb\n{\npublic:\n    virtual ~CvProb() {};\n\n    /* Calculate probability value: */\n    virtual double Value(int* /*comp*/, int /*x*/ = 0, int /*y*/ = 0){return -1;};\n\n    /* Update histograpp Pnew = (1-W)*Pold + W*Padd*/\n    /* W weight of new added prob */\n    /* comps - matrix of new fetature vectors used to update prob */\n    virtual void AddFeature(float W, int* comps, int x =0, int y = 0) = 0;\n    virtual void Scale(float factor = 0, int x = -1, int y = -1) = 0;\n    virtual void Release() = 0;\n};\ninline void cvReleaseProb(CvProb** ppProb){ppProb[0]->Release();ppProb[0]=NULL;}\n/* HIST API */\n\n/* Some Prob: */\nCV_EXPORTS CvProb* cvCreateProbS(int dim, CvSize size, int sample_num);\nCV_EXPORTS CvProb* cvCreateProbMG(int dim, CvSize size, int sample_num);\nCV_EXPORTS CvProb* cvCreateProbMG2(int dim, CvSize size, int sample_num);\nCV_EXPORTS CvProb* cvCreateProbHist(int dim, CvSize size);\n\n#define CV_BT_HIST_TYPE_S     0\n#define CV_BT_HIST_TYPE_MG    1\n#define CV_BT_HIST_TYPE_MG2   2\n#define CV_BT_HIST_TYPE_H     3\ninline CvProb* cvCreateProb(int type, int dim, CvSize size = cvSize(1,1), void* /*param*/ = NULL)\n{\n    if(type == CV_BT_HIST_TYPE_S) return cvCreateProbS(dim, size, -1);\n    if(type == CV_BT_HIST_TYPE_MG) return cvCreateProbMG(dim, size, -1);\n    if(type == CV_BT_HIST_TYPE_MG2) return cvCreateProbMG2(dim, size, -1);\n    if(type == CV_BT_HIST_TYPE_H) return cvCreateProbHist(dim, size);\n    return NULL;\n}\n\n\n\n/* Noise type definitions: */\n#define CV_NOISE_NONE               0\n#define CV_NOISE_GAUSSIAN           1\n#define CV_NOISE_UNIFORM            2\n#define CV_NOISE_SPECKLE            3\n#define CV_NOISE_SALT_AND_PEPPER    4\n\n/* Add some noise to image: */\n/* pImg - (input) image without noise */\n/* pImg - (output) image with noise */\n/* noise_type - type of added noise */\n/*  CV_NOISE_GAUSSIAN - pImg += n , n - is gaussian noise with Ampl standart deviation */\n/*  CV_NOISE_UNIFORM - pImg += n , n - is uniform noise with Ampl standart deviation */\n/*  CV_NOISE_SPECKLE - pImg += n*pImg , n - is gaussian noise with Ampl standart deviation */\n/*  CV_NOISE_SALT_AND_PAPPER - pImg = pImg with blacked and whited pixels,\n            Ampl is density of brocken pixels (0-there are not broken pixels, 1 - all pixels are broken)*/\n/* Ampl - \"amplitude\" of noise */\n//CV_EXPORTS void cvAddNoise(IplImage* pImg, int noise_type, double Ampl, CvRNG* rnd_state = NULL);\n\n/*================== GENERATOR OF TEST VIDEO SEQUENCE ===================== */\ntypedef void CvTestSeq;\n\n/* pConfigfile - Name of file (yml or xml) with description of test sequence */\n/* videos - array of names of test videos described in \"pConfigfile\" file */\n/* numvideos - size of \"videos\" array */\nCV_EXPORTS CvTestSeq* cvCreateTestSeq(char* pConfigfile, char** videos, int numvideo, float Scale = 1, int noise_type = CV_NOISE_NONE, double noise_ampl = 0);\nCV_EXPORTS void cvReleaseTestSeq(CvTestSeq** ppTestSeq);\n\n/* Generate next frame from test video seq and return pointer to it: */\nCV_EXPORTS IplImage* cvTestSeqQueryFrame(CvTestSeq* pTestSeq);\n\n/* Return pointer to current foreground mask: */\nCV_EXPORTS IplImage* cvTestSeqGetFGMask(CvTestSeq* pTestSeq);\n\n/* Return pointer to current image: */\nCV_EXPORTS IplImage* cvTestSeqGetImage(CvTestSeq* pTestSeq);\n\n/* Return frame size of result test video: */\nCV_EXPORTS CvSize cvTestSeqGetImageSize(CvTestSeq* pTestSeq);\n\n/* Return number of frames result test video: */\nCV_EXPORTS int cvTestSeqFrameNum(CvTestSeq* pTestSeq);\n\n/* Return number of existing objects.\n * This is general number of any objects.\n * For example number of trajectories may be equal or less than returned value:\n */\nCV_EXPORTS int cvTestSeqGetObjectNum(CvTestSeq* pTestSeq);\n\n/* Return 0 if there is not position for current defined on current frame */\n/* Return 1 if there is object position and pPos was filled */\nCV_EXPORTS int cvTestSeqGetObjectPos(CvTestSeq* pTestSeq, int ObjIndex, CvPoint2D32f* pPos);\nCV_EXPORTS int cvTestSeqGetObjectSize(CvTestSeq* pTestSeq, int ObjIndex, CvPoint2D32f* pSize);\n\n/* Add noise to final image: */\nCV_EXPORTS void cvTestSeqAddNoise(CvTestSeq* pTestSeq, int noise_type = CV_NOISE_NONE, double noise_ampl = 0);\n\n/* Add Intensity variation: */\nCV_EXPORTS void cvTestSeqAddIntensityVariation(CvTestSeq* pTestSeq, float DI_per_frame, float MinI, float MaxI);\nCV_EXPORTS void cvTestSeqSetFrame(CvTestSeq* pTestSeq, int n);\n\n#endif\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/legacy/compat.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright( C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n//(including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort(including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n/*\n   A few macros and definitions for backward compatibility\n   with the previous versions of OpenCV. They are obsolete and\n   are likely to be removed in future. To check whether your code\n   uses any of these, define CV_NO_BACKWARD_COMPATIBILITY before\n   including cv.h.\n*/\n\n#ifndef __OPENCV_COMPAT_HPP__\n#define __OPENCV_COMPAT_HPP__\n\n#include \"opencv2/core/core_c.h\"\n#include \"opencv2/imgproc/types_c.h\"\n\n#include <math.h>\n#include <string.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef int CvMatType;\ntypedef int CvDisMaskType;\ntypedef CvMat CvMatArray;\n\ntypedef int CvThreshType;\ntypedef int CvAdaptiveThreshMethod;\ntypedef int CvCompareMethod;\ntypedef int CvFontFace;\ntypedef int CvPolyApproxMethod;\ntypedef int CvContoursMatchMethod;\ntypedef int CvContourTreesMatchMethod;\ntypedef int CvCoeffType;\ntypedef int CvRodriguesType;\ntypedef int CvElementShape;\ntypedef int CvMorphOp;\ntypedef int CvTemplMatchMethod;\n\ntypedef CvPoint2D64f CvPoint2D64d;\ntypedef CvPoint3D64f CvPoint3D64d;\n\nenum\n{\n    CV_MAT32F      = CV_32FC1,\n    CV_MAT3x1_32F  = CV_32FC1,\n    CV_MAT4x1_32F  = CV_32FC1,\n    CV_MAT3x3_32F  = CV_32FC1,\n    CV_MAT4x4_32F  = CV_32FC1,\n\n    CV_MAT64D      = CV_64FC1,\n    CV_MAT3x1_64D  = CV_64FC1,\n    CV_MAT4x1_64D  = CV_64FC1,\n    CV_MAT3x3_64D  = CV_64FC1,\n    CV_MAT4x4_64D  = CV_64FC1\n};\n\nenum\n{\n    IPL_GAUSSIAN_5x5 = 7\n};\n\ntypedef CvBox2D  CvBox2D32f;\n\n/* allocation/deallocation macros */\n#define cvCreateImageData   cvCreateData\n#define cvReleaseImageData  cvReleaseData\n#define cvSetImageData      cvSetData\n#define cvGetImageRawData   cvGetRawData\n\n#define cvmAlloc            cvCreateData\n#define cvmFree             cvReleaseData\n#define cvmAllocArray       cvCreateData\n#define cvmFreeArray        cvReleaseData\n\n#define cvIntegralImage     cvIntegral\n#define cvMatchContours     cvMatchShapes\n\nCV_EXPORTS CvMat cvMatArray( int rows, int cols, int type,\n                            int count, void* data CV_DEFAULT(0));\n\n#define cvUpdateMHIByTime  cvUpdateMotionHistory\n\n#define cvAccMask cvAcc\n#define cvSquareAccMask cvSquareAcc\n#define cvMultiplyAccMask cvMultiplyAcc\n#define cvRunningAvgMask(imgY, imgU, mask, alpha) cvRunningAvg(imgY, imgU, alpha, mask)\n\n#define cvSetHistThresh  cvSetHistBinRanges\n#define cvCalcHistMask(img, mask, hist, doNotClear) cvCalcHist(img, hist, doNotClear, mask)\n\nCV_EXPORTS double cvMean( const CvArr* image, const CvArr* mask CV_DEFAULT(0));\nCV_EXPORTS double cvSumPixels( const CvArr* image );\nCV_EXPORTS void  cvMean_StdDev( const CvArr* image, double* mean, double* sdv,\n                                const CvArr* mask CV_DEFAULT(0));\n\nCV_EXPORTS void cvmPerspectiveProject( const CvMat* mat, const CvArr* src, CvArr* dst );\nCV_EXPORTS void cvFillImage( CvArr* mat, double color );\n\n#define cvCvtPixToPlane cvSplit\n#define cvCvtPlaneToPix cvMerge\n\ntypedef struct CvRandState\n{\n    CvRNG     state;    /* RNG state (the current seed and carry)*/\n    int       disttype; /* distribution type */\n    CvScalar  param[2]; /* parameters of RNG */\n} CvRandState;\n\n/* Changes RNG range while preserving RNG state */\nCV_EXPORTS void  cvRandSetRange( CvRandState* state, double param1,\n                                 double param2, int index CV_DEFAULT(-1));\n\nCV_EXPORTS void  cvRandInit( CvRandState* state, double param1,\n                             double param2, int seed,\n                             int disttype CV_DEFAULT(CV_RAND_UNI));\n\n/* Fills array with random numbers */\nCV_EXPORTS void cvRand( CvRandState* state, CvArr* arr );\n\n#define cvRandNext( _state ) cvRandInt( &(_state)->state )\n\nCV_EXPORTS void cvbRand( CvRandState* state, float* dst, int len );\n\nCV_EXPORTS void  cvbCartToPolar( const float* y, const float* x,\n                                 float* magnitude, float* angle, int len );\nCV_EXPORTS void  cvbFastArctan( const float* y, const float* x, float* angle, int len );\nCV_EXPORTS void  cvbSqrt( const float* x, float* y, int len );\nCV_EXPORTS void  cvbInvSqrt( const float* x, float* y, int len );\nCV_EXPORTS void  cvbReciprocal( const float* x, float* y, int len );\nCV_EXPORTS void  cvbFastExp( const float* x, double* y, int len );\nCV_EXPORTS void  cvbFastLog( const double* x, float* y, int len );\n\nCV_EXPORTS CvRect  cvContourBoundingRect( void* point_set, int update CV_DEFAULT(0));\n\nCV_EXPORTS double cvPseudoInverse( const CvArr* src, CvArr* dst );\n#define cvPseudoInv cvPseudoInverse\n\n#define cvContourMoments( contour, moments ) cvMoments( contour, moments, 0 )\n\n#define cvGetPtrAt              cvPtr2D\n#define cvGetAt                 cvGet2D\n#define cvSetAt(arr,val,y,x)    cvSet2D((arr),(y),(x),(val))\n\n#define cvMeanMask  cvMean\n#define cvMean_StdDevMask(img,mask,mean,sdv) cvMean_StdDev(img,mean,sdv,mask)\n\n#define cvNormMask(imgA,imgB,mask,normType) cvNorm(imgA,imgB,normType,mask)\n\n#define cvMinMaxLocMask(img, mask, min_val, max_val, min_loc, max_loc) \\\n        cvMinMaxLoc(img, min_val, max_val, min_loc, max_loc, mask)\n\n#define cvRemoveMemoryManager  cvSetMemoryManager\n\n#define cvmSetZero( mat )               cvSetZero( mat )\n#define cvmSetIdentity( mat )           cvSetIdentity( mat )\n#define cvmAdd( src1, src2, dst )       cvAdd( src1, src2, dst, 0 )\n#define cvmSub( src1, src2, dst )       cvSub( src1, src2, dst, 0 )\n#define cvmCopy( src, dst )             cvCopy( src, dst, 0 )\n#define cvmMul( src1, src2, dst )       cvMatMulAdd( src1, src2, 0, dst )\n#define cvmTranspose( src, dst )        cvT( src, dst )\n#define cvmInvert( src, dst )           cvInv( src, dst )\n#define cvmMahalanobis(vec1, vec2, mat) cvMahalanobis( vec1, vec2, mat )\n#define cvmDotProduct( vec1, vec2 )     cvDotProduct( vec1, vec2 )\n#define cvmCrossProduct(vec1, vec2,dst) cvCrossProduct( vec1, vec2, dst )\n#define cvmTrace( mat )                 (cvTrace( mat )).val[0]\n#define cvmMulTransposed( src, dst, order ) cvMulTransposed( src, dst, order )\n#define cvmEigenVV( mat, evec, eval, eps)   cvEigenVV( mat, evec, eval, eps )\n#define cvmDet( mat )                   cvDet( mat )\n#define cvmScale( src, dst, scale )     cvScale( src, dst, scale )\n\n#define cvCopyImage( src, dst )         cvCopy( src, dst, 0 )\n#define cvReleaseMatHeader              cvReleaseMat\n\n/* Calculates exact convex hull of 2d point set */\nCV_EXPORTS void cvConvexHull( CvPoint* points, int num_points,\n                             CvRect* bound_rect,\n                             int orientation, int* hull, int* hullsize );\n\n\nCV_EXPORTS void cvMinAreaRect( CvPoint* points, int n,\n                              int left, int bottom,\n                              int right, int top,\n                              CvPoint2D32f* anchor,\n                              CvPoint2D32f* vect1,\n                              CvPoint2D32f* vect2 );\n\ntypedef int CvDisType;\ntypedef int CvChainApproxMethod;\ntypedef int CvContourRetrievalMode;\n\nCV_EXPORTS  void  cvFitLine3D( CvPoint3D32f* points, int count, int dist,\n                    void *param, float reps, float aeps, float* line );\n\n/* Fits a line into set of 2d points in a robust way (M-estimator technique) */\nCV_EXPORTS  void  cvFitLine2D( CvPoint2D32f* points, int count, int dist,\n                    void *param, float reps, float aeps, float* line );\n\nCV_EXPORTS  void  cvFitEllipse( const CvPoint2D32f* points, int count, CvBox2D* box );\n\n/* Projects 2d points to one of standard coordinate planes\n   (i.e. removes one of coordinates) */\nCV_EXPORTS  void  cvProject3D( CvPoint3D32f* points3D, int count,\n                              CvPoint2D32f* points2D,\n                              int xIndx CV_DEFAULT(0),\n                              int yIndx CV_DEFAULT(1));\n\n/* Retrieves value of the particular bin\n   of x-dimensional (x=1,2,3,...) histogram */\n#define cvQueryHistValue_1D( hist, idx0 ) \\\n    ((float)cvGetReal1D( (hist)->bins, (idx0)))\n#define cvQueryHistValue_2D( hist, idx0, idx1 ) \\\n    ((float)cvGetReal2D( (hist)->bins, (idx0), (idx1)))\n#define cvQueryHistValue_3D( hist, idx0, idx1, idx2 ) \\\n    ((float)cvGetReal3D( (hist)->bins, (idx0), (idx1), (idx2)))\n#define cvQueryHistValue_nD( hist, idx ) \\\n    ((float)cvGetRealND( (hist)->bins, (idx)))\n\n/* Returns pointer to the particular bin of x-dimesional histogram.\n   For sparse histogram the bin is created if it didn't exist before */\n#define cvGetHistValue_1D( hist, idx0 ) \\\n    ((float*)cvPtr1D( (hist)->bins, (idx0), 0))\n#define cvGetHistValue_2D( hist, idx0, idx1 ) \\\n    ((float*)cvPtr2D( (hist)->bins, (idx0), (idx1), 0))\n#define cvGetHistValue_3D( hist, idx0, idx1, idx2 ) \\\n    ((float*)cvPtr3D( (hist)->bins, (idx0), (idx1), (idx2), 0))\n#define cvGetHistValue_nD( hist, idx ) \\\n    ((float*)cvPtrND( (hist)->bins, (idx), 0))\n\n\n#define CV_IS_SET_ELEM_EXISTS CV_IS_SET_ELEM\n\n\nCV_EXPORTS  int  cvHoughLines( CvArr* image, double rho,\n                              double theta, int threshold,\n                              float* lines, int linesNumber );\n\nCV_EXPORTS  int  cvHoughLinesP( CvArr* image, double rho,\n                               double theta, int threshold,\n                               int lineLength, int lineGap,\n                               int* lines, int linesNumber );\n\n\nCV_EXPORTS  int  cvHoughLinesSDiv( CvArr* image, double rho, int srn,\n                                  double theta, int stn, int threshold,\n                                  float* lines, int linesNumber );\n\nCV_EXPORTS  float  cvCalcEMD( const float* signature1, int size1,\n                             const float* signature2, int size2,\n                             int dims, int dist_type CV_DEFAULT(CV_DIST_L2),\n                             CvDistanceFunction dist_func CV_DEFAULT(0),\n                             float* lower_bound CV_DEFAULT(0),\n                             void* user_param CV_DEFAULT(0));\n\nCV_EXPORTS  void  cvKMeans( int num_clusters, float** samples,\n                           int num_samples, int vec_size,\n                           CvTermCriteria termcrit, int* cluster_idx );\n\nCV_EXPORTS void  cvStartScanGraph( CvGraph* graph, CvGraphScanner* scanner,\n                                  CvGraphVtx* vtx CV_DEFAULT(NULL),\n                                  int mask CV_DEFAULT(CV_GRAPH_ALL_ITEMS));\n\nCV_EXPORTS  void  cvEndScanGraph( CvGraphScanner* scanner );\n\n\n/* old drawing functions */\nCV_EXPORTS void  cvLineAA( CvArr* img, CvPoint pt1, CvPoint pt2,\n                            double color, int scale CV_DEFAULT(0));\n\nCV_EXPORTS void  cvCircleAA( CvArr* img, CvPoint center, int radius,\n                            double color, int scale CV_DEFAULT(0) );\n\nCV_EXPORTS void  cvEllipseAA( CvArr* img, CvPoint center, CvSize axes,\n                              double angle, double start_angle,\n                              double end_angle, double color,\n                              int scale CV_DEFAULT(0) );\n\nCV_EXPORTS void  cvPolyLineAA( CvArr* img, CvPoint** pts, int* npts, int contours,\n                              int is_closed, double color, int scale CV_DEFAULT(0) );\n\n/****************************************************************************************\\\n*                                   Pixel Access Macros                                  *\n\\****************************************************************************************/\n\ntypedef struct _CvPixelPosition8u\n{\n    uchar*  currline;      /* pointer to the start of the current pixel line   */\n    uchar*  topline;       /* pointer to the start of the top pixel line       */\n    uchar*  bottomline;    /* pointer to the start of the first line           */\n                                    /* which is below the image                         */\n    int     x;                      /* current x coordinate ( in pixels )               */\n    int     width;                  /* width of the image  ( in pixels )                */\n    int     height;                 /* height of the image  ( in pixels )               */\n    int     step;                   /* distance between lines ( in elements of single   */\n                                    /* plane )                                          */\n    int     step_arr[3];            /* array: ( 0, -step, step ). It is used for        */\n                                    /* vertical moving                                  */\n} CvPixelPosition8u;\n\n/* this structure differs from the above only in data type */\ntypedef struct _CvPixelPosition8s\n{\n    schar*  currline;\n    schar*  topline;\n    schar*  bottomline;\n    int     x;\n    int     width;\n    int     height;\n    int     step;\n    int     step_arr[3];\n} CvPixelPosition8s;\n\n/* this structure differs from the CvPixelPosition8u only in data type */\ntypedef struct _CvPixelPosition32f\n{\n    float*  currline;\n    float*  topline;\n    float*  bottomline;\n    int     x;\n    int     width;\n    int     height;\n    int     step;\n    int     step_arr[3];\n} CvPixelPosition32f;\n\n\n/* Initialize one of the CvPixelPosition structures.   */\n/*  pos    - initialized structure                     */\n/*  origin - pointer to the left-top corner of the ROI */\n/*  step   - width of the whole image in bytes         */\n/*  roi    - width & height of the ROI                 */\n/*  x, y   - initial position                          */\n#define CV_INIT_PIXEL_POS(pos, origin, _step, roi, _x, _y, orientation)    \\\n    (                                                                        \\\n    (pos).step = (_step)/sizeof((pos).currline[0]) * (orientation ? -1 : 1), \\\n    (pos).width = (roi).width,                                               \\\n    (pos).height = (roi).height,                                             \\\n    (pos).bottomline = (origin) + (pos).step*(pos).height,                   \\\n    (pos).topline = (origin) - (pos).step,                                   \\\n    (pos).step_arr[0] = 0,                                                   \\\n    (pos).step_arr[1] = -(pos).step,                                         \\\n    (pos).step_arr[2] = (pos).step,                                          \\\n    (pos).x = (_x),                                                          \\\n    (pos).currline = (origin) + (pos).step*(_y) )\n\n\n/* Move to specified point ( absolute shift ) */\n/*  pos    - position structure               */\n/*  x, y   - coordinates of the new position  */\n/*  cs     - number of the image channels     */\n#define CV_MOVE_TO( pos, _x, _y, cs )                                                   \\\n((pos).currline = (_y) >= 0 && (_y) < (pos).height ? (pos).topline + ((_y)+1)*(pos).step : 0, \\\n (pos).x = (_x) >= 0 && (_x) < (pos).width ? (_x) : 0, (pos).currline + (_x) * (cs) )\n\n/* Get current coordinates                    */\n/*  pos    - position structure               */\n/*  x, y   - coordinates of the new position  */\n/*  cs     - number of the image channels     */\n#define CV_GET_CURRENT( pos, cs )  ((pos).currline + (pos).x * (cs))\n\n/* Move by one pixel relatively to current position */\n/*  pos    - position structure                     */\n/*  cs     - number of the image channels           */\n\n/* left */\n#define CV_MOVE_LEFT( pos, cs ) \\\n ( --(pos).x >= 0 ? (pos).currline + (pos).x*(cs) : 0 )\n\n/* right */\n#define CV_MOVE_RIGHT( pos, cs ) \\\n ( ++(pos).x < (pos).width ? (pos).currline + (pos).x*(cs) : 0 )\n\n/* up */\n#define CV_MOVE_UP( pos, cs ) \\\n (((pos).currline -= (pos).step) != (pos).topline ? (pos).currline + (pos).x*(cs) : 0 )\n\n/* down */\n#define CV_MOVE_DOWN( pos, cs ) \\\n (((pos).currline += (pos).step) != (pos).bottomline ? (pos).currline + (pos).x*(cs) : 0 )\n\n/* left up */\n#define CV_MOVE_LU( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_UP(pos, cs))\n\n/* right up */\n#define CV_MOVE_RU( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_UP(pos, cs))\n\n/* left down */\n#define CV_MOVE_LD( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_DOWN(pos, cs))\n\n/* right down */\n#define CV_MOVE_RD( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_DOWN(pos, cs))\n\n\n\n/* Move by one pixel relatively to current position with wrapping when the position     */\n/* achieves image boundary                                                              */\n/*  pos    - position structure                                                         */\n/*  cs     - number of the image channels                                               */\n\n/* left */\n#define CV_MOVE_LEFT_WRAP( pos, cs ) \\\n ((pos).currline + ( --(pos).x >= 0 ? (pos).x : ((pos).x = (pos).width-1))*(cs))\n\n/* right */\n#define CV_MOVE_RIGHT_WRAP( pos, cs ) \\\n ((pos).currline + ( ++(pos).x < (pos).width ? (pos).x : ((pos).x = 0))*(cs) )\n\n/* up */\n#define CV_MOVE_UP_WRAP( pos, cs ) \\\n    ((((pos).currline -= (pos).step) != (pos).topline ? \\\n    (pos).currline : ((pos).currline = (pos).bottomline - (pos).step)) + (pos).x*(cs) )\n\n/* down */\n#define CV_MOVE_DOWN_WRAP( pos, cs ) \\\n    ((((pos).currline += (pos).step) != (pos).bottomline ? \\\n    (pos).currline : ((pos).currline = (pos).topline + (pos).step)) + (pos).x*(cs) )\n\n/* left up */\n#define CV_MOVE_LU_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs))\n/* right up */\n#define CV_MOVE_RU_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs))\n/* left down */\n#define CV_MOVE_LD_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs))\n/* right down */\n#define CV_MOVE_RD_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs))\n\n/* Numeric constants which used for moving in arbitrary direction  */\nenum\n{\n    CV_SHIFT_NONE = 2,\n    CV_SHIFT_LEFT = 1,\n    CV_SHIFT_RIGHT = 3,\n    CV_SHIFT_UP = 6,\n    CV_SHIFT_DOWN = 10,\n    CV_SHIFT_LU = 5,\n    CV_SHIFT_RU = 7,\n    CV_SHIFT_LD = 9,\n    CV_SHIFT_RD = 11\n};\n\n/* Move by one pixel in specified direction                                     */\n/*  pos    - position structure                                                 */\n/*  shift  - direction ( it's value must be one of the CV_SHIFT_Ö constants ) */\n/*  cs     - number of the image channels                                       */\n#define CV_MOVE_PARAM( pos, shift, cs )                                             \\\n    ( (pos).currline += (pos).step_arr[(shift)>>2], (pos).x += ((shift)&3)-2,       \\\n    ((pos).currline != (pos).topline && (pos).currline != (pos).bottomline &&       \\\n    (pos).x >= 0 && (pos).x < (pos).width) ? (pos).currline + (pos).x*(cs) : 0 )\n\n/* Move by one pixel in specified direction with wrapping when the               */\n/* position achieves image boundary                                              */\n/*  pos    - position structure                                                  */\n/*  shift  - direction ( it's value must be one of the CV_SHIFT_Ö constants )  */\n/*  cs     - number of the image channels                                        */\n#define CV_MOVE_PARAM_WRAP( pos, shift, cs )                                        \\\n    ( (pos).currline += (pos).step_arr[(shift)>>2],                                 \\\n    (pos).currline = ((pos).currline == (pos).topline ?                             \\\n    (pos).bottomline - (pos).step :                                                 \\\n    (pos).currline == (pos).bottomline ?                                            \\\n    (pos).topline + (pos).step : (pos).currline),                                   \\\n                                                                                    \\\n    (pos).x += ((shift)&3)-2,                                                       \\\n    (pos).x = ((pos).x < 0 ? (pos).width-1 : (pos).x >= (pos).width ? 0 : (pos).x), \\\n                                                                                    \\\n    (pos).currline + (pos).x*(cs) )\n\n\ntypedef float*   CvVect32f;\ntypedef float*   CvMatr32f;\ntypedef double*  CvVect64d;\ntypedef double*  CvMatr64d;\n\nCV_EXPORTS void cvUnDistortOnce( const CvArr* src, CvArr* dst,\n                                const float* intrinsic_matrix,\n                                const float* distortion_coeffs,\n                                int interpolate );\n\n/* the two functions below have quite hackerish implementations, use with care\n   (or, which is better, switch to cvUndistortInitMap and cvRemap instead */\nCV_EXPORTS void cvUnDistortInit( const CvArr* src,\n                                CvArr* undistortion_map,\n                                const float* A, const float* k,\n                                int interpolate );\n\nCV_EXPORTS void  cvUnDistort( const CvArr* src, CvArr* dst,\n                             const CvArr* undistortion_map,\n                             int interpolate );\n\n/* Find fundamental matrix */\nCV_EXPORTS void  cvFindFundamentalMatrix( int* points1, int* points2,\n    int numpoints, int method, float* matrix );\n\n\nCV_EXPORTS int cvFindChessBoardCornerGuesses( const void* arr, void* thresharr,\n                               CvMemStorage* storage,\n                               CvSize pattern_size, CvPoint2D32f * corners,\n                               int *corner_count );\n\n/* Calibrates camera using multiple views of calibration pattern */\nCV_EXPORTS void cvCalibrateCamera( int image_count, int* _point_counts,\n    CvSize image_size, CvPoint2D32f* _image_points, CvPoint3D32f* _object_points,\n    float* _distortion_coeffs, float* _camera_matrix, float* _translation_vectors,\n    float* _rotation_matrices, int flags );\n\n\nCV_EXPORTS void cvCalibrateCamera_64d( int image_count, int* _point_counts,\n    CvSize image_size, CvPoint2D64f* _image_points, CvPoint3D64f* _object_points,\n    double* _distortion_coeffs, double* _camera_matrix, double* _translation_vectors,\n    double* _rotation_matrices, int flags );\n\n\n/* Find 3d position of object given intrinsic camera parameters,\n   3d model of the object and projection of the object into view plane */\nCV_EXPORTS void cvFindExtrinsicCameraParams( int point_count,\n    CvSize image_size, CvPoint2D32f* _image_points,\n    CvPoint3D32f* _object_points, float* focal_length,\n    CvPoint2D32f principal_point, float* _distortion_coeffs,\n    float* _rotation_vector, float* _translation_vector );\n\n/* Variant of the previous function that takes double-precision parameters */\nCV_EXPORTS void cvFindExtrinsicCameraParams_64d( int point_count,\n    CvSize image_size, CvPoint2D64f* _image_points,\n    CvPoint3D64f* _object_points, double* focal_length,\n    CvPoint2D64f principal_point, double* _distortion_coeffs,\n    double* _rotation_vector, double* _translation_vector );\n\n/* Rodrigues transform */\nenum\n{\n    CV_RODRIGUES_M2V = 0,\n    CV_RODRIGUES_V2M = 1\n};\n\n/* Converts rotation_matrix matrix to rotation_matrix vector or vice versa */\nCV_EXPORTS void  cvRodrigues( CvMat* rotation_matrix, CvMat* rotation_vector,\n                              CvMat* jacobian, int conv_type );\n\n/* Does reprojection of 3d object points to the view plane */\nCV_EXPORTS void  cvProjectPoints( int point_count, CvPoint3D64f* _object_points,\n    double* _rotation_vector, double*  _translation_vector,\n    double* focal_length, CvPoint2D64f principal_point,\n    double* _distortion, CvPoint2D64f* _image_points,\n    double* _deriv_points_rotation_matrix,\n    double* _deriv_points_translation_vect,\n    double* _deriv_points_focal,\n    double* _deriv_points_principal_point,\n    double* _deriv_points_distortion_coeffs );\n\n\n/* Simpler version of the previous function */\nCV_EXPORTS void  cvProjectPointsSimple( int point_count, CvPoint3D64f* _object_points,\n    double* _rotation_matrix, double*  _translation_vector,\n    double* _camera_matrix, double* _distortion, CvPoint2D64f* _image_points );\n\n\n#define cvMake2DPoints cvConvertPointsHomogeneous\n#define cvMake3DPoints cvConvertPointsHomogeneous\n\n#define cvWarpPerspectiveQMatrix cvGetPerspectiveTransform\n\n#define cvConvertPointsHomogenious cvConvertPointsHomogeneous\n\n\n//////////////////////////////////// feature extractors: obsolete API //////////////////////////////////\n\ntypedef struct CvSURFPoint\n{\n    CvPoint2D32f pt;\n\n    int          laplacian;\n    int          size;\n    float        dir;\n    float        hessian;\n\n} CvSURFPoint;\n\nCV_INLINE CvSURFPoint cvSURFPoint( CvPoint2D32f pt, int laplacian,\n                                  int size, float dir CV_DEFAULT(0),\n                                  float hessian CV_DEFAULT(0))\n{\n    CvSURFPoint kp;\n\n    kp.pt        = pt;\n    kp.laplacian = laplacian;\n    kp.size      = size;\n    kp.dir       = dir;\n    kp.hessian   = hessian;\n\n    return kp;\n}\n\ntypedef struct CvSURFParams\n{\n    int    extended;\n    int    upright;\n    double hessianThreshold;\n\n    int    nOctaves;\n    int    nOctaveLayers;\n\n} CvSURFParams;\n\nCVAPI(CvSURFParams) cvSURFParams( double hessianThreshold, int extended CV_DEFAULT(0) );\n\n// If useProvidedKeyPts!=0, keypoints are not detected, but descriptors are computed\n//  at the locations provided in keypoints (a CvSeq of CvSURFPoint).\nCVAPI(void) cvExtractSURF( const CvArr* img, const CvArr* mask,\n                          CvSeq** keypoints, CvSeq** descriptors,\n                          CvMemStorage* storage, CvSURFParams params,\n                             int useProvidedKeyPts CV_DEFAULT(0)  );\n\n/*!\n Maximal Stable Regions Parameters\n */\ntypedef struct CvMSERParams\n{\n    //! delta, in the code, it compares (size_{i}-size_{i-delta})/size_{i-delta}\n    int delta;\n    //! prune the area which bigger than maxArea\n    int maxArea;\n    //! prune the area which smaller than minArea\n    int minArea;\n    //! prune the area have simliar size to its children\n    float maxVariation;\n    //! trace back to cut off mser with diversity < min_diversity\n    float minDiversity;\n\n    /////// the next few params for MSER of color image\n\n    //! for color image, the evolution steps\n    int maxEvolution;\n    //! the area threshold to cause re-initialize\n    double areaThreshold;\n    //! ignore too small margin\n    double minMargin;\n    //! the aperture size for edge blur\n    int edgeBlurSize;\n} CvMSERParams;\n\nCVAPI(CvMSERParams) cvMSERParams( int delta CV_DEFAULT(5), int min_area CV_DEFAULT(60),\n                                 int max_area CV_DEFAULT(14400), float max_variation CV_DEFAULT(.25f),\n                                 float min_diversity CV_DEFAULT(.2f), int max_evolution CV_DEFAULT(200),\n                                 double area_threshold CV_DEFAULT(1.01),\n                                 double min_margin CV_DEFAULT(.003),\n                                 int edge_blur_size CV_DEFAULT(5) );\n\n// Extracts the contours of Maximally Stable Extremal Regions\nCVAPI(void) cvExtractMSER( CvArr* _img, CvArr* _mask, CvSeq** contours, CvMemStorage* storage, CvMSERParams params );\n\n\ntypedef struct CvStarKeypoint\n{\n    CvPoint pt;\n    int size;\n    float response;\n} CvStarKeypoint;\n\nCV_INLINE CvStarKeypoint cvStarKeypoint(CvPoint pt, int size, float response)\n{\n    CvStarKeypoint kpt;\n    kpt.pt = pt;\n    kpt.size = size;\n    kpt.response = response;\n    return kpt;\n}\n\ntypedef struct CvStarDetectorParams\n{\n    int maxSize;\n    int responseThreshold;\n    int lineThresholdProjected;\n    int lineThresholdBinarized;\n    int suppressNonmaxSize;\n} CvStarDetectorParams;\n\nCV_INLINE CvStarDetectorParams cvStarDetectorParams(\n                                                    int maxSize CV_DEFAULT(45),\n                                                    int responseThreshold CV_DEFAULT(30),\n                                                    int lineThresholdProjected CV_DEFAULT(10),\n                                                    int lineThresholdBinarized CV_DEFAULT(8),\n                                                    int suppressNonmaxSize CV_DEFAULT(5))\n{\n    CvStarDetectorParams params;\n    params.maxSize = maxSize;\n    params.responseThreshold = responseThreshold;\n    params.lineThresholdProjected = lineThresholdProjected;\n    params.lineThresholdBinarized = lineThresholdBinarized;\n    params.suppressNonmaxSize = suppressNonmaxSize;\n\n    return params;\n}\n\nCVAPI(CvSeq*) cvGetStarKeypoints( const CvArr* img, CvMemStorage* storage,\n                                 CvStarDetectorParams params CV_DEFAULT(cvStarDetectorParams()));\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/legacy/legacy.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_LEGACY_HPP__\n#define __OPENCV_LEGACY_HPP__\n\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/imgproc/imgproc_c.h\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/calib3d/calib3d.hpp\"\n#include \"opencv2/ml/ml.hpp\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nCVAPI(CvSeq*) cvSegmentImage( const CvArr* srcarr, CvArr* dstarr,\n                                    double canny_threshold,\n                                    double ffill_threshold,\n                                    CvMemStorage* storage );\n\n/****************************************************************************************\\\n*                                  Eigen objects                                         *\n\\****************************************************************************************/\n\ntypedef int (CV_CDECL * CvCallback)(int index, void* buffer, void* user_data);\ntypedef union\n{\n    CvCallback callback;\n    void* data;\n}\nCvInput;\n\n#define CV_EIGOBJ_NO_CALLBACK     0\n#define CV_EIGOBJ_INPUT_CALLBACK  1\n#define CV_EIGOBJ_OUTPUT_CALLBACK 2\n#define CV_EIGOBJ_BOTH_CALLBACK   3\n\n/* Calculates covariation matrix of a set of arrays */\nCVAPI(void)  cvCalcCovarMatrixEx( int nObjects, void* input, int ioFlags,\n                                  int ioBufSize, uchar* buffer, void* userData,\n                                  IplImage* avg, float* covarMatrix );\n\n/* Calculates eigen values and vectors of covariation matrix of a set of\n   arrays */\nCVAPI(void)  cvCalcEigenObjects( int nObjects, void* input, void* output,\n                                 int ioFlags, int ioBufSize, void* userData,\n                                 CvTermCriteria* calcLimit, IplImage* avg,\n                                 float* eigVals );\n\n/* Calculates dot product (obj - avg) * eigObj (i.e. projects image to eigen vector) */\nCVAPI(double)  cvCalcDecompCoeff( IplImage* obj, IplImage* eigObj, IplImage* avg );\n\n/* Projects image to eigen space (finds all decomposion coefficients */\nCVAPI(void)  cvEigenDecomposite( IplImage* obj, int nEigObjs, void* eigInput,\n                                 int ioFlags, void* userData, IplImage* avg,\n                                 float* coeffs );\n\n/* Projects original objects used to calculate eigen space basis to that space */\nCVAPI(void)  cvEigenProjection( void* eigInput, int nEigObjs, int ioFlags,\n                                void* userData, float* coeffs, IplImage* avg,\n                                IplImage* proj );\n\n/****************************************************************************************\\\n*                                       1D/2D HMM                                        *\n\\****************************************************************************************/\n\ntypedef struct CvImgObsInfo\n{\n    int obs_x;\n    int obs_y;\n    int obs_size;\n    float* obs;//consequtive observations\n\n    int* state;/* arr of pairs superstate/state to which observation belong */\n    int* mix;  /* number of mixture to which observation belong */\n\n} CvImgObsInfo;/*struct for 1 image*/\n\ntypedef CvImgObsInfo Cv1DObsInfo;\n\ntypedef struct CvEHMMState\n{\n    int num_mix;        /*number of mixtures in this state*/\n    float* mu;          /*mean vectors corresponding to each mixture*/\n    float* inv_var;     /* square root of inversed variances corresp. to each mixture*/\n    float* log_var_val; /* sum of 0.5 (LN2PI + ln(variance[i]) ) for i=1,n */\n    float* weight;      /*array of mixture weights. Summ of all weights in state is 1. */\n\n} CvEHMMState;\n\ntypedef struct CvEHMM\n{\n    int level; /* 0 - lowest(i.e its states are real states), ..... */\n    int num_states; /* number of HMM states */\n    float*  transP;/*transition probab. matrices for states */\n    float** obsProb; /* if level == 0 - array of brob matrices corresponding to hmm\n                        if level == 1 - martix of matrices */\n    union\n    {\n        CvEHMMState* state; /* if level == 0 points to real states array,\n                               if not - points to embedded hmms */\n        struct CvEHMM* ehmm; /* pointer to an embedded model or NULL, if it is a leaf */\n    } u;\n\n} CvEHMM;\n\n/*CVAPI(int)  icvCreate1DHMM( CvEHMM** this_hmm,\n                                   int state_number, int* num_mix, int obs_size );\n\nCVAPI(int)  icvRelease1DHMM( CvEHMM** phmm );\n\nCVAPI(int)  icvUniform1DSegm( Cv1DObsInfo* obs_info, CvEHMM* hmm );\n\nCVAPI(int)  icvInit1DMixSegm( Cv1DObsInfo** obs_info_array, int num_img, CvEHMM* hmm);\n\nCVAPI(int)  icvEstimate1DHMMStateParams( CvImgObsInfo** obs_info_array, int num_img, CvEHMM* hmm);\n\nCVAPI(int)  icvEstimate1DObsProb( CvImgObsInfo* obs_info, CvEHMM* hmm );\n\nCVAPI(int)  icvEstimate1DTransProb( Cv1DObsInfo** obs_info_array,\n                                           int num_seq,\n                                           CvEHMM* hmm );\n\nCVAPI(float)  icvViterbi( Cv1DObsInfo* obs_info, CvEHMM* hmm);\n\nCVAPI(int)  icv1DMixSegmL2( CvImgObsInfo** obs_info_array, int num_img, CvEHMM* hmm );*/\n\n/*********************************** Embedded HMMs *************************************/\n\n/* Creates 2D HMM */\nCVAPI(CvEHMM*)  cvCreate2DHMM( int* stateNumber, int* numMix, int obsSize );\n\n/* Releases HMM */\nCVAPI(void)  cvRelease2DHMM( CvEHMM** hmm );\n\n#define CV_COUNT_OBS(roi, win, delta, numObs )                                       \\\n{                                                                                    \\\n   (numObs)->width  =((roi)->width  -(win)->width  +(delta)->width)/(delta)->width;  \\\n   (numObs)->height =((roi)->height -(win)->height +(delta)->height)/(delta)->height;\\\n}\n\n/* Creates storage for observation vectors */\nCVAPI(CvImgObsInfo*)  cvCreateObsInfo( CvSize numObs, int obsSize );\n\n/* Releases storage for observation vectors */\nCVAPI(void)  cvReleaseObsInfo( CvImgObsInfo** obs_info );\n\n\n/* The function takes an image on input and and returns the sequnce of observations\n   to be used with an embedded HMM; Each observation is top-left block of DCT\n   coefficient matrix */\nCVAPI(void)  cvImgToObs_DCT( const CvArr* arr, float* obs, CvSize dctSize,\n                             CvSize obsSize, CvSize delta );\n\n\n/* Uniformly segments all observation vectors extracted from image */\nCVAPI(void)  cvUniformImgSegm( CvImgObsInfo* obs_info, CvEHMM* ehmm );\n\n/* Does mixture segmentation of the states of embedded HMM */\nCVAPI(void)  cvInitMixSegm( CvImgObsInfo** obs_info_array,\n                            int num_img, CvEHMM* hmm );\n\n/* Function calculates means, variances, weights of every Gaussian mixture\n   of every low-level state of embedded HMM */\nCVAPI(void)  cvEstimateHMMStateParams( CvImgObsInfo** obs_info_array,\n                                       int num_img, CvEHMM* hmm );\n\n/* Function computes transition probability matrices of embedded HMM\n   given observations segmentation */\nCVAPI(void)  cvEstimateTransProb( CvImgObsInfo** obs_info_array,\n                                  int num_img, CvEHMM* hmm );\n\n/* Function computes probabilities of appearing observations at any state\n   (i.e. computes P(obs|state) for every pair(obs,state)) */\nCVAPI(void)  cvEstimateObsProb( CvImgObsInfo* obs_info,\n                                CvEHMM* hmm );\n\n/* Runs Viterbi algorithm for embedded HMM */\nCVAPI(float)  cvEViterbi( CvImgObsInfo* obs_info, CvEHMM* hmm );\n\n\n/* Function clusters observation vectors from several images\n   given observations segmentation.\n   Euclidean distance used for clustering vectors.\n   Centers of clusters are given means of every mixture */\nCVAPI(void)  cvMixSegmL2( CvImgObsInfo** obs_info_array,\n                          int num_img, CvEHMM* hmm );\n\n/****************************************************************************************\\\n*               A few functions from old stereo gesture recognition demosions            *\n\\****************************************************************************************/\n\n/* Creates hand mask image given several points on the hand */\nCVAPI(void)  cvCreateHandMask( CvSeq* hand_points,\n                                   IplImage *img_mask, CvRect *roi);\n\n/* Finds hand region in range image data */\nCVAPI(void)  cvFindHandRegion (CvPoint3D32f* points, int count,\n                                CvSeq* indexs,\n                                float* line, CvSize2D32f size, int flag,\n                                CvPoint3D32f* center,\n                                CvMemStorage* storage, CvSeq **numbers);\n\n/* Finds hand region in range image data (advanced version) */\nCVAPI(void)  cvFindHandRegionA( CvPoint3D32f* points, int count,\n                                CvSeq* indexs,\n                                float* line, CvSize2D32f size, int jc,\n                                CvPoint3D32f* center,\n                                CvMemStorage* storage, CvSeq **numbers);\n\n/* Calculates the cooficients of the homography matrix */\nCVAPI(void)  cvCalcImageHomography( float* line, CvPoint3D32f* center,\n                                    float* intrinsic, float* homography );\n\n/****************************************************************************************\\\n*                           More operations on sequences                                 *\n\\****************************************************************************************/\n\n/*****************************************************************************************/\n\n#define CV_CURRENT_INT( reader ) (*((int *)(reader).ptr))\n#define CV_PREV_INT( reader ) (*((int *)(reader).prev_elem))\n\n#define  CV_GRAPH_WEIGHTED_VERTEX_FIELDS() CV_GRAPH_VERTEX_FIELDS()\\\n    float weight;\n\n#define  CV_GRAPH_WEIGHTED_EDGE_FIELDS() CV_GRAPH_EDGE_FIELDS()\n\ntypedef struct CvGraphWeightedVtx\n{\n    CV_GRAPH_WEIGHTED_VERTEX_FIELDS()\n} CvGraphWeightedVtx;\n\ntypedef struct CvGraphWeightedEdge\n{\n    CV_GRAPH_WEIGHTED_EDGE_FIELDS()\n} CvGraphWeightedEdge;\n\ntypedef enum CvGraphWeightType\n{\n    CV_NOT_WEIGHTED,\n    CV_WEIGHTED_VTX,\n    CV_WEIGHTED_EDGE,\n    CV_WEIGHTED_ALL\n} CvGraphWeightType;\n\n\n/* Calculates histogram of a contour */\nCVAPI(void)  cvCalcPGH( const CvSeq* contour, CvHistogram* hist );\n\n#define CV_DOMINANT_IPAN 1\n\n/* Finds high-curvature points of the contour */\nCVAPI(CvSeq*) cvFindDominantPoints( CvSeq* contour, CvMemStorage* storage,\n                                   int method CV_DEFAULT(CV_DOMINANT_IPAN),\n                                   double parameter1 CV_DEFAULT(0),\n                                   double parameter2 CV_DEFAULT(0),\n                                   double parameter3 CV_DEFAULT(0),\n                                   double parameter4 CV_DEFAULT(0));\n\n/*****************************************************************************************/\n\n\n/*******************************Stereo correspondence*************************************/\n\ntypedef struct CvCliqueFinder\n{\n    CvGraph* graph;\n    int**    adj_matr;\n    int N; //graph size\n\n    // stacks, counters etc/\n    int k; //stack size\n    int* current_comp;\n    int** All;\n\n    int* ne;\n    int* ce;\n    int* fixp; //node with minimal disconnections\n    int* nod;\n    int* s; //for selected candidate\n    int status;\n    int best_score;\n    int weighted;\n    int weighted_edges;\n    float best_weight;\n    float* edge_weights;\n    float* vertex_weights;\n    float* cur_weight;\n    float* cand_weight;\n\n} CvCliqueFinder;\n\n#define CLIQUE_TIME_OFF 2\n#define CLIQUE_FOUND 1\n#define CLIQUE_END   0\n\n/*CVAPI(void) cvStartFindCliques( CvGraph* graph, CvCliqueFinder* finder, int reverse,\n                                   int weighted CV_DEFAULT(0),  int weighted_edges CV_DEFAULT(0));\nCVAPI(int) cvFindNextMaximalClique( CvCliqueFinder* finder, int* clock_rest CV_DEFAULT(0) );\nCVAPI(void) cvEndFindCliques( CvCliqueFinder* finder );\n\nCVAPI(void) cvBronKerbosch( CvGraph* graph );*/\n\n\n/*F///////////////////////////////////////////////////////////////////////////////////////\n//\n//    Name:    cvSubgraphWeight\n//    Purpose: finds weight of subgraph in a graph\n//    Context:\n//    Parameters:\n//      graph - input graph.\n//      subgraph - sequence of pairwise different ints.  These are indices of vertices of subgraph.\n//      weight_type - describes the way we measure weight.\n//            one of the following:\n//            CV_NOT_WEIGHTED - weight of a clique is simply its size\n//            CV_WEIGHTED_VTX - weight of a clique is the sum of weights of its vertices\n//            CV_WEIGHTED_EDGE - the same but edges\n//            CV_WEIGHTED_ALL - the same but both edges and vertices\n//      weight_vtx - optional vector of floats, with size = graph->total.\n//            If weight_type is either CV_WEIGHTED_VTX or CV_WEIGHTED_ALL\n//            weights of vertices must be provided.  If weight_vtx not zero\n//            these weights considered to be here, otherwise function assumes\n//            that vertices of graph are inherited from CvGraphWeightedVtx.\n//      weight_edge - optional matrix of floats, of width and height = graph->total.\n//            If weight_type is either CV_WEIGHTED_EDGE or CV_WEIGHTED_ALL\n//            weights of edges ought to be supplied.  If weight_edge is not zero\n//            function finds them here, otherwise function expects\n//            edges of graph to be inherited from CvGraphWeightedEdge.\n//            If this parameter is not zero structure of the graph is determined from matrix\n//            rather than from CvGraphEdge's.  In particular, elements corresponding to\n//            absent edges should be zero.\n//    Returns:\n//      weight of subgraph.\n//    Notes:\n//F*/\n/*CVAPI(float) cvSubgraphWeight( CvGraph *graph, CvSeq *subgraph,\n                                  CvGraphWeightType weight_type CV_DEFAULT(CV_NOT_WEIGHTED),\n                                  CvVect32f weight_vtx CV_DEFAULT(0),\n                                  CvMatr32f weight_edge CV_DEFAULT(0) );*/\n\n\n/*F///////////////////////////////////////////////////////////////////////////////////////\n//\n//    Name:    cvFindCliqueEx\n//    Purpose: tries to find clique with maximum possible weight in a graph\n//    Context:\n//    Parameters:\n//      graph - input graph.\n//      storage - memory storage to be used by the result.\n//      is_complementary - optional flag showing whether function should seek for clique\n//            in complementary graph.\n//      weight_type - describes our notion about weight.\n//            one of the following:\n//            CV_NOT_WEIGHTED - weight of a clique is simply its size\n//            CV_WEIGHTED_VTX - weight of a clique is the sum of weights of its vertices\n//            CV_WEIGHTED_EDGE - the same but edges\n//            CV_WEIGHTED_ALL - the same but both edges and vertices\n//      weight_vtx - optional vector of floats, with size = graph->total.\n//            If weight_type is either CV_WEIGHTED_VTX or CV_WEIGHTED_ALL\n//            weights of vertices must be provided.  If weight_vtx not zero\n//            these weights considered to be here, otherwise function assumes\n//            that vertices of graph are inherited from CvGraphWeightedVtx.\n//      weight_edge - optional matrix of floats, of width and height = graph->total.\n//            If weight_type is either CV_WEIGHTED_EDGE or CV_WEIGHTED_ALL\n//            weights of edges ought to be supplied.  If weight_edge is not zero\n//            function finds them here, otherwise function expects\n//            edges of graph to be inherited from CvGraphWeightedEdge.\n//            Note that in case of CV_WEIGHTED_EDGE or CV_WEIGHTED_ALL\n//            nonzero is_complementary implies nonzero weight_edge.\n//      start_clique - optional sequence of pairwise different ints.  They are indices of\n//            vertices that shall be present in the output clique.\n//      subgraph_of_ban - optional sequence of (maybe equal) ints.  They are indices of\n//            vertices that shall not be present in the output clique.\n//      clique_weight_ptr - optional output parameter.  Weight of found clique stored here.\n//      num_generations - optional number of generations in evolutionary part of algorithm,\n//            zero forces to return first found clique.\n//      quality - optional parameter determining degree of required quality/speed tradeoff.\n//            Must be in the range from 0 to 9.\n//            0 is fast and dirty, 9 is slow but hopefully yields good clique.\n//    Returns:\n//      sequence of pairwise different ints.\n//      These are indices of vertices that form found clique.\n//    Notes:\n//      in cases of CV_WEIGHTED_EDGE and CV_WEIGHTED_ALL weights should be nonnegative.\n//      start_clique has a priority over subgraph_of_ban.\n//F*/\n/*CVAPI(CvSeq*) cvFindCliqueEx( CvGraph *graph, CvMemStorage *storage,\n                                 int is_complementary CV_DEFAULT(0),\n                                 CvGraphWeightType weight_type CV_DEFAULT(CV_NOT_WEIGHTED),\n                                 CvVect32f weight_vtx CV_DEFAULT(0),\n                                 CvMatr32f weight_edge CV_DEFAULT(0),\n                                 CvSeq *start_clique CV_DEFAULT(0),\n                                 CvSeq *subgraph_of_ban CV_DEFAULT(0),\n                                 float *clique_weight_ptr CV_DEFAULT(0),\n                                 int num_generations CV_DEFAULT(3),\n                                 int quality CV_DEFAULT(2) );*/\n\n\n#define CV_UNDEF_SC_PARAM         12345 //default value of parameters\n\n#define CV_IDP_BIRCHFIELD_PARAM1  25\n#define CV_IDP_BIRCHFIELD_PARAM2  5\n#define CV_IDP_BIRCHFIELD_PARAM3  12\n#define CV_IDP_BIRCHFIELD_PARAM4  15\n#define CV_IDP_BIRCHFIELD_PARAM5  25\n\n\n#define  CV_DISPARITY_BIRCHFIELD  0\n\n\n/*F///////////////////////////////////////////////////////////////////////////\n//\n//    Name:    cvFindStereoCorrespondence\n//    Purpose: find stereo correspondence on stereo-pair\n//    Context:\n//    Parameters:\n//      leftImage - left image of stereo-pair (format 8uC1).\n//      rightImage - right image of stereo-pair (format 8uC1).\n//   mode - mode of correspondence retrieval (now CV_DISPARITY_BIRCHFIELD only)\n//      dispImage - destination disparity image\n//      maxDisparity - maximal disparity\n//      param1, param2, param3, param4, param5 - parameters of algorithm\n//    Returns:\n//    Notes:\n//      Images must be rectified.\n//      All images must have format 8uC1.\n//F*/\nCVAPI(void)\ncvFindStereoCorrespondence(\n                   const  CvArr* leftImage, const  CvArr* rightImage,\n                   int     mode,\n                   CvArr*  dispImage,\n                   int     maxDisparity,\n                   double  param1 CV_DEFAULT(CV_UNDEF_SC_PARAM),\n                   double  param2 CV_DEFAULT(CV_UNDEF_SC_PARAM),\n                   double  param3 CV_DEFAULT(CV_UNDEF_SC_PARAM),\n                   double  param4 CV_DEFAULT(CV_UNDEF_SC_PARAM),\n                   double  param5 CV_DEFAULT(CV_UNDEF_SC_PARAM) );\n\n/*****************************************************************************************/\n/************ Epiline functions *******************/\n\n\n\ntypedef struct CvStereoLineCoeff\n{\n    double Xcoef;\n    double XcoefA;\n    double XcoefB;\n    double XcoefAB;\n\n    double Ycoef;\n    double YcoefA;\n    double YcoefB;\n    double YcoefAB;\n\n    double Zcoef;\n    double ZcoefA;\n    double ZcoefB;\n    double ZcoefAB;\n}CvStereoLineCoeff;\n\n\ntypedef struct CvCamera\n{\n    float   imgSize[2]; /* size of the camera view, used during calibration */\n    float   matrix[9]; /* intinsic camera parameters:  [ fx 0 cx; 0 fy cy; 0 0 1 ] */\n    float   distortion[4]; /* distortion coefficients - two coefficients for radial distortion\n                              and another two for tangential: [ k1 k2 p1 p2 ] */\n    float   rotMatr[9];\n    float   transVect[3]; /* rotation matrix and transition vector relatively\n                             to some reference point in the space. */\n} CvCamera;\n\ntypedef struct CvStereoCamera\n{\n    CvCamera* camera[2]; /* two individual camera parameters */\n    float fundMatr[9]; /* fundamental matrix */\n\n    /* New part for stereo */\n    CvPoint3D32f epipole[2];\n    CvPoint2D32f quad[2][4]; /* coordinates of destination quadrangle after\n                                epipolar geometry rectification */\n    double coeffs[2][3][3];/* coefficients for transformation */\n    CvPoint2D32f border[2][4];\n    CvSize warpSize;\n    CvStereoLineCoeff* lineCoeffs;\n    int needSwapCameras;/* flag set to 1 if need to swap cameras for good reconstruction */\n    float rotMatrix[9];\n    float transVector[3];\n} CvStereoCamera;\n\n\ntypedef struct CvContourOrientation\n{\n    float egvals[2];\n    float egvects[4];\n\n    float max, min; // minimum and maximum projections\n    int imax, imin;\n} CvContourOrientation;\n\n#define CV_CAMERA_TO_WARP 1\n#define CV_WARP_TO_CAMERA 2\n\nCVAPI(int) icvConvertWarpCoordinates(double coeffs[3][3],\n                                CvPoint2D32f* cameraPoint,\n                                CvPoint2D32f* warpPoint,\n                                int direction);\n\nCVAPI(int) icvGetSymPoint3D(  CvPoint3D64f pointCorner,\n                            CvPoint3D64f point1,\n                            CvPoint3D64f point2,\n                            CvPoint3D64f *pointSym2);\n\nCVAPI(void) icvGetPieceLength3D(CvPoint3D64f point1,CvPoint3D64f point2,double* dist);\n\nCVAPI(int) icvCompute3DPoint(    double alpha,double betta,\n                            CvStereoLineCoeff* coeffs,\n                            CvPoint3D64f* point);\n\nCVAPI(int) icvCreateConvertMatrVect( double*     rotMatr1,\n                                double*     transVect1,\n                                double*     rotMatr2,\n                                double*     transVect2,\n                                double*     convRotMatr,\n                                double*     convTransVect);\n\nCVAPI(int) icvConvertPointSystem(CvPoint3D64f  M2,\n                            CvPoint3D64f* M1,\n                            double*     rotMatr,\n                            double*     transVect\n                            );\n\nCVAPI(int) icvComputeCoeffForStereo(  CvStereoCamera* stereoCamera);\n\nCVAPI(int) icvGetCrossPieceVector(CvPoint2D32f p1_start,CvPoint2D32f p1_end,CvPoint2D32f v2_start,CvPoint2D32f v2_end,CvPoint2D32f *cross);\nCVAPI(int) icvGetCrossLineDirect(CvPoint2D32f p1,CvPoint2D32f p2,float a,float b,float c,CvPoint2D32f* cross);\nCVAPI(float) icvDefinePointPosition(CvPoint2D32f point1,CvPoint2D32f point2,CvPoint2D32f point);\nCVAPI(int) icvStereoCalibration( int numImages,\n                            int* nums,\n                            CvSize imageSize,\n                            CvPoint2D32f* imagePoints1,\n                            CvPoint2D32f* imagePoints2,\n                            CvPoint3D32f* objectPoints,\n                            CvStereoCamera* stereoparams\n                           );\n\n\nCVAPI(int) icvComputeRestStereoParams(CvStereoCamera *stereoparams);\n\nCVAPI(void) cvComputePerspectiveMap( const double coeffs[3][3], CvArr* rectMapX, CvArr* rectMapY );\n\nCVAPI(int) icvComCoeffForLine(   CvPoint2D64f point1,\n                            CvPoint2D64f point2,\n                            CvPoint2D64f point3,\n                            CvPoint2D64f point4,\n                            double*    camMatr1,\n                            double*    rotMatr1,\n                            double*    transVect1,\n                            double*    camMatr2,\n                            double*    rotMatr2,\n                            double*    transVect2,\n                            CvStereoLineCoeff*    coeffs,\n                            int* needSwapCameras);\n\nCVAPI(int) icvGetDirectionForPoint(  CvPoint2D64f point,\n                                double* camMatr,\n                                CvPoint3D64f* direct);\n\nCVAPI(int) icvGetCrossLines(CvPoint3D64f point11,CvPoint3D64f point12,\n                       CvPoint3D64f point21,CvPoint3D64f point22,\n                       CvPoint3D64f* midPoint);\n\nCVAPI(int) icvComputeStereoLineCoeffs(   CvPoint3D64f pointA,\n                                    CvPoint3D64f pointB,\n                                    CvPoint3D64f pointCam1,\n                                    double gamma,\n                                    CvStereoLineCoeff*    coeffs);\n\n/*CVAPI(int) icvComputeFundMatrEpipoles ( double* camMatr1,\n                                    double*     rotMatr1,\n                                    double*     transVect1,\n                                    double*     camMatr2,\n                                    double*     rotMatr2,\n                                    double*     transVect2,\n                                    CvPoint2D64f* epipole1,\n                                    CvPoint2D64f* epipole2,\n                                    double*     fundMatr);*/\n\nCVAPI(int) icvGetAngleLine( CvPoint2D64f startPoint, CvSize imageSize,CvPoint2D64f *point1,CvPoint2D64f *point2);\n\nCVAPI(void) icvGetCoefForPiece(   CvPoint2D64f p_start,CvPoint2D64f p_end,\n                        double *a,double *b,double *c,\n                        int* result);\n\n/*CVAPI(void) icvGetCommonArea( CvSize imageSize,\n                    CvPoint2D64f epipole1,CvPoint2D64f epipole2,\n                    double* fundMatr,\n                    double* coeff11,double* coeff12,\n                    double* coeff21,double* coeff22,\n                    int* result);*/\n\nCVAPI(void) icvComputeeInfiniteProject1(double*    rotMatr,\n                                     double*    camMatr1,\n                                     double*    camMatr2,\n                                     CvPoint2D32f point1,\n                                     CvPoint2D32f *point2);\n\nCVAPI(void) icvComputeeInfiniteProject2(double*    rotMatr,\n                                     double*    camMatr1,\n                                     double*    camMatr2,\n                                     CvPoint2D32f* point1,\n                                     CvPoint2D32f point2);\n\nCVAPI(void) icvGetCrossDirectDirect(  double* direct1,double* direct2,\n                            CvPoint2D64f *cross,int* result);\n\nCVAPI(void) icvGetCrossPieceDirect(   CvPoint2D64f p_start,CvPoint2D64f p_end,\n                            double a,double b,double c,\n                            CvPoint2D64f *cross,int* result);\n\nCVAPI(void) icvGetCrossPiecePiece( CvPoint2D64f p1_start,CvPoint2D64f p1_end,\n                            CvPoint2D64f p2_start,CvPoint2D64f p2_end,\n                            CvPoint2D64f* cross,\n                            int* result);\n\nCVAPI(void) icvGetPieceLength(CvPoint2D64f point1,CvPoint2D64f point2,double* dist);\n\nCVAPI(void) icvGetCrossRectDirect(    CvSize imageSize,\n                            double a,double b,double c,\n                            CvPoint2D64f *start,CvPoint2D64f *end,\n                            int* result);\n\nCVAPI(void) icvProjectPointToImage(   CvPoint3D64f point,\n                            double* camMatr,double* rotMatr,double* transVect,\n                            CvPoint2D64f* projPoint);\n\nCVAPI(void) icvGetQuadsTransform( CvSize        imageSize,\n                        double*     camMatr1,\n                        double*     rotMatr1,\n                        double*     transVect1,\n                        double*     camMatr2,\n                        double*     rotMatr2,\n                        double*     transVect2,\n                        CvSize*       warpSize,\n                        double quad1[4][2],\n                        double quad2[4][2],\n                        double*     fundMatr,\n                        CvPoint3D64f* epipole1,\n                        CvPoint3D64f* epipole2\n                        );\n\nCVAPI(void) icvGetQuadsTransformStruct(  CvStereoCamera* stereoCamera);\n\nCVAPI(void) icvComputeStereoParamsForCameras(CvStereoCamera* stereoCamera);\n\nCVAPI(void) icvGetCutPiece(   double* areaLineCoef1,double* areaLineCoef2,\n                    CvPoint2D64f epipole,\n                    CvSize imageSize,\n                    CvPoint2D64f* point11,CvPoint2D64f* point12,\n                    CvPoint2D64f* point21,CvPoint2D64f* point22,\n                    int* result);\n\nCVAPI(void) icvGetMiddleAnglePoint(   CvPoint2D64f basePoint,\n                            CvPoint2D64f point1,CvPoint2D64f point2,\n                            CvPoint2D64f* midPoint);\n\nCVAPI(void) icvGetNormalDirect(double* direct,CvPoint2D64f point,double* normDirect);\n\nCVAPI(double) icvGetVect(CvPoint2D64f basePoint,CvPoint2D64f point1,CvPoint2D64f point2);\n\nCVAPI(void) icvProjectPointToDirect(  CvPoint2D64f point,double* lineCoeff,\n                            CvPoint2D64f* projectPoint);\n\nCVAPI(void) icvGetDistanceFromPointToDirect( CvPoint2D64f point,double* lineCoef,double*dist);\n\nCVAPI(IplImage*) icvCreateIsometricImage( IplImage* src, IplImage* dst,\n                              int desired_depth, int desired_num_channels );\n\nCVAPI(void) cvDeInterlace( const CvArr* frame, CvArr* fieldEven, CvArr* fieldOdd );\n\n/*CVAPI(int) icvSelectBestRt(           int           numImages,\n                                    int*          numPoints,\n                                    CvSize        imageSize,\n                                    CvPoint2D32f* imagePoints1,\n                                    CvPoint2D32f* imagePoints2,\n                                    CvPoint3D32f* objectPoints,\n\n                                    CvMatr32f     cameraMatrix1,\n                                    CvVect32f     distortion1,\n                                    CvMatr32f     rotMatrs1,\n                                    CvVect32f     transVects1,\n\n                                    CvMatr32f     cameraMatrix2,\n                                    CvVect32f     distortion2,\n                                    CvMatr32f     rotMatrs2,\n                                    CvVect32f     transVects2,\n\n                                    CvMatr32f     bestRotMatr,\n                                    CvVect32f     bestTransVect\n                                    );*/\n\n\n/****************************************************************************************\\\n*                                     Contour Tree                                       *\n\\****************************************************************************************/\n\n/* Contour tree header */\ntypedef struct CvContourTree\n{\n    CV_SEQUENCE_FIELDS()\n    CvPoint p1;            /* the first point of the binary tree root segment */\n    CvPoint p2;            /* the last point of the binary tree root segment */\n} CvContourTree;\n\n/* Builds hierarhical representation of a contour */\nCVAPI(CvContourTree*)  cvCreateContourTree( const CvSeq* contour,\n                                            CvMemStorage* storage,\n                                            double threshold );\n\n/* Reconstruct (completelly or partially) contour a from contour tree */\nCVAPI(CvSeq*)  cvContourFromContourTree( const CvContourTree* tree,\n                                         CvMemStorage* storage,\n                                         CvTermCriteria criteria );\n\n/* Compares two contour trees */\nenum { CV_CONTOUR_TREES_MATCH_I1 = 1 };\n\nCVAPI(double)  cvMatchContourTrees( const CvContourTree* tree1,\n                                    const CvContourTree* tree2,\n                                    int method, double threshold );\n\n/****************************************************************************************\\\n*                                   Contour Morphing                                     *\n\\****************************************************************************************/\n\n/* finds correspondence between two contours */\nCvSeq* cvCalcContoursCorrespondence( const CvSeq* contour1,\n                                     const CvSeq* contour2,\n                                     CvMemStorage* storage);\n\n/* morphs contours using the pre-calculated correspondence:\n   alpha=0 ~ contour1, alpha=1 ~ contour2 */\nCvSeq* cvMorphContours( const CvSeq* contour1, const CvSeq* contour2,\n                        CvSeq* corr, double alpha,\n                        CvMemStorage* storage );\n\n\n/****************************************************************************************\\\n*                                   Active Contours                                      *\n\\****************************************************************************************/\n\n#define  CV_VALUE  1\n#define  CV_ARRAY  2\n/* Updates active contour in order to minimize its cummulative\n   (internal and external) energy. */\nCVAPI(void)  cvSnakeImage( const IplImage* image, CvPoint* points,\n                           int  length, float* alpha,\n                           float* beta, float* gamma,\n                           int coeff_usage, CvSize  win,\n                           CvTermCriteria criteria, int calc_gradient CV_DEFAULT(1));\n\n/****************************************************************************************\\\n*                                    Texture Descriptors                                 *\n\\****************************************************************************************/\n\n#define CV_GLCM_OPTIMIZATION_NONE                   -2\n#define CV_GLCM_OPTIMIZATION_LUT                    -1\n#define CV_GLCM_OPTIMIZATION_HISTOGRAM              0\n\n#define CV_GLCMDESC_OPTIMIZATION_ALLOWDOUBLENEST    10\n#define CV_GLCMDESC_OPTIMIZATION_ALLOWTRIPLENEST    11\n#define CV_GLCMDESC_OPTIMIZATION_HISTOGRAM          4\n\n#define CV_GLCMDESC_ENTROPY                         0\n#define CV_GLCMDESC_ENERGY                          1\n#define CV_GLCMDESC_HOMOGENITY                      2\n#define CV_GLCMDESC_CONTRAST                        3\n#define CV_GLCMDESC_CLUSTERTENDENCY                 4\n#define CV_GLCMDESC_CLUSTERSHADE                    5\n#define CV_GLCMDESC_CORRELATION                     6\n#define CV_GLCMDESC_CORRELATIONINFO1                7\n#define CV_GLCMDESC_CORRELATIONINFO2                8\n#define CV_GLCMDESC_MAXIMUMPROBABILITY              9\n\n#define CV_GLCM_ALL                                 0\n#define CV_GLCM_GLCM                                1\n#define CV_GLCM_DESC                                2\n\ntypedef struct CvGLCM CvGLCM;\n\nCVAPI(CvGLCM*) cvCreateGLCM( const IplImage* srcImage,\n                                int stepMagnitude,\n                                const int* stepDirections CV_DEFAULT(0),\n                                int numStepDirections CV_DEFAULT(0),\n                                int optimizationType CV_DEFAULT(CV_GLCM_OPTIMIZATION_NONE));\n\nCVAPI(void) cvReleaseGLCM( CvGLCM** GLCM, int flag CV_DEFAULT(CV_GLCM_ALL));\n\nCVAPI(void) cvCreateGLCMDescriptors( CvGLCM* destGLCM,\n                                        int descriptorOptimizationType\n                                        CV_DEFAULT(CV_GLCMDESC_OPTIMIZATION_ALLOWDOUBLENEST));\n\nCVAPI(double) cvGetGLCMDescriptor( CvGLCM* GLCM, int step, int descriptor );\n\nCVAPI(void) cvGetGLCMDescriptorStatistics( CvGLCM* GLCM, int descriptor,\n                                              double* average, double* standardDeviation );\n\nCVAPI(IplImage*) cvCreateGLCMImage( CvGLCM* GLCM, int step );\n\n/****************************************************************************************\\\n*                                  Face eyes&mouth tracking                              *\n\\****************************************************************************************/\n\n\ntypedef struct CvFaceTracker CvFaceTracker;\n\n#define CV_NUM_FACE_ELEMENTS    3\nenum CV_FACE_ELEMENTS\n{\n    CV_FACE_MOUTH = 0,\n    CV_FACE_LEFT_EYE = 1,\n    CV_FACE_RIGHT_EYE = 2\n};\n\nCVAPI(CvFaceTracker*) cvInitFaceTracker(CvFaceTracker* pFaceTracking, const IplImage* imgGray,\n                                                CvRect* pRects, int nRects);\nCVAPI(int) cvTrackFace( CvFaceTracker* pFaceTracker, IplImage* imgGray,\n                              CvRect* pRects, int nRects,\n                              CvPoint* ptRotate, double* dbAngleRotate);\nCVAPI(void) cvReleaseFaceTracker(CvFaceTracker** ppFaceTracker);\n\n\ntypedef struct CvFace\n{\n    CvRect MouthRect;\n    CvRect LeftEyeRect;\n    CvRect RightEyeRect;\n} CvFaceData;\n\nCvSeq * cvFindFace(IplImage * Image,CvMemStorage* storage);\nCvSeq * cvPostBoostingFindFace(IplImage * Image,CvMemStorage* storage);\n\n\n/****************************************************************************************\\\n*                                         3D Tracker                                     *\n\\****************************************************************************************/\n\ntypedef unsigned char CvBool;\n\ntypedef struct Cv3dTracker2dTrackedObject\n{\n    int id;\n    CvPoint2D32f p; // pgruebele: So we do not loose precision, this needs to be float\n} Cv3dTracker2dTrackedObject;\n\nCV_INLINE Cv3dTracker2dTrackedObject cv3dTracker2dTrackedObject(int id, CvPoint2D32f p)\n{\n    Cv3dTracker2dTrackedObject r;\n    r.id = id;\n    r.p = p;\n    return r;\n}\n\ntypedef struct Cv3dTrackerTrackedObject\n{\n    int id;\n    CvPoint3D32f p;             // location of the tracked object\n} Cv3dTrackerTrackedObject;\n\nCV_INLINE Cv3dTrackerTrackedObject cv3dTrackerTrackedObject(int id, CvPoint3D32f p)\n{\n    Cv3dTrackerTrackedObject r;\n    r.id = id;\n    r.p = p;\n    return r;\n}\n\ntypedef struct Cv3dTrackerCameraInfo\n{\n    CvBool valid;\n    float mat[4][4];              /* maps camera coordinates to world coordinates */\n    CvPoint2D32f principal_point; /* copied from intrinsics so this structure */\n                                  /* has all the info we need */\n} Cv3dTrackerCameraInfo;\n\ntypedef struct Cv3dTrackerCameraIntrinsics\n{\n    CvPoint2D32f principal_point;\n    float focal_length[2];\n    float distortion[4];\n} Cv3dTrackerCameraIntrinsics;\n\nCVAPI(CvBool) cv3dTrackerCalibrateCameras(int num_cameras,\n                     const Cv3dTrackerCameraIntrinsics camera_intrinsics[], /* size is num_cameras */\n                     CvSize etalon_size,\n                     float square_size,\n                     IplImage *samples[],                                   /* size is num_cameras */\n                     Cv3dTrackerCameraInfo camera_info[]);                  /* size is num_cameras */\n\nCVAPI(int)  cv3dTrackerLocateObjects(int num_cameras, int num_objects,\n                   const Cv3dTrackerCameraInfo camera_info[],        /* size is num_cameras */\n                   const Cv3dTracker2dTrackedObject tracking_info[], /* size is num_objects*num_cameras */\n                   Cv3dTrackerTrackedObject tracked_objects[]);      /* size is num_objects */\n/****************************************************************************************\n tracking_info is a rectangular array; one row per camera, num_objects elements per row.\n The id field of any unused slots must be -1. Ids need not be ordered or consecutive. On\n completion, the return value is the number of objects located; i.e., the number of objects\n visible by more than one camera. The id field of any unused slots in tracked objects is\n set to -1.\n****************************************************************************************/\n\n\n/****************************************************************************************\\\n*                           Skeletons and Linear-Contour Models                          *\n\\****************************************************************************************/\n\ntypedef enum CvLeeParameters\n{\n    CV_LEE_INT = 0,\n    CV_LEE_FLOAT = 1,\n    CV_LEE_DOUBLE = 2,\n    CV_LEE_AUTO = -1,\n    CV_LEE_ERODE = 0,\n    CV_LEE_ZOOM = 1,\n    CV_LEE_NON = 2\n} CvLeeParameters;\n\n#define CV_NEXT_VORONOISITE2D( SITE ) ((SITE)->edge[0]->site[((SITE)->edge[0]->site[0] == (SITE))])\n#define CV_PREV_VORONOISITE2D( SITE ) ((SITE)->edge[1]->site[((SITE)->edge[1]->site[0] == (SITE))])\n#define CV_FIRST_VORONOIEDGE2D( SITE ) ((SITE)->edge[0])\n#define CV_LAST_VORONOIEDGE2D( SITE ) ((SITE)->edge[1])\n#define CV_NEXT_VORONOIEDGE2D( EDGE, SITE ) ((EDGE)->next[(EDGE)->site[0] != (SITE)])\n#define CV_PREV_VORONOIEDGE2D( EDGE, SITE ) ((EDGE)->next[2 + ((EDGE)->site[0] != (SITE))])\n#define CV_VORONOIEDGE2D_BEGINNODE( EDGE, SITE ) ((EDGE)->node[((EDGE)->site[0] != (SITE))])\n#define CV_VORONOIEDGE2D_ENDNODE( EDGE, SITE ) ((EDGE)->node[((EDGE)->site[0] == (SITE))])\n#define CV_TWIN_VORONOISITE2D( SITE, EDGE ) ( (EDGE)->site[((EDGE)->site[0] == (SITE))])\n\n#define CV_VORONOISITE2D_FIELDS()    \\\n    struct CvVoronoiNode2D *node[2]; \\\n    struct CvVoronoiEdge2D *edge[2];\n\ntypedef struct CvVoronoiSite2D\n{\n    CV_VORONOISITE2D_FIELDS()\n    struct CvVoronoiSite2D *next[2];\n} CvVoronoiSite2D;\n\n#define CV_VORONOIEDGE2D_FIELDS()    \\\n    struct CvVoronoiNode2D *node[2]; \\\n    struct CvVoronoiSite2D *site[2]; \\\n    struct CvVoronoiEdge2D *next[4];\n\ntypedef struct CvVoronoiEdge2D\n{\n    CV_VORONOIEDGE2D_FIELDS()\n} CvVoronoiEdge2D;\n\n#define CV_VORONOINODE2D_FIELDS()       \\\n    CV_SET_ELEM_FIELDS(CvVoronoiNode2D) \\\n    CvPoint2D32f pt;                    \\\n    float radius;\n\ntypedef struct CvVoronoiNode2D\n{\n    CV_VORONOINODE2D_FIELDS()\n} CvVoronoiNode2D;\n\n#define CV_VORONOIDIAGRAM2D_FIELDS() \\\n    CV_GRAPH_FIELDS()                \\\n    CvSet *sites;\n\ntypedef struct CvVoronoiDiagram2D\n{\n    CV_VORONOIDIAGRAM2D_FIELDS()\n} CvVoronoiDiagram2D;\n\n/* Computes Voronoi Diagram for given polygons with holes */\nCVAPI(int)  cvVoronoiDiagramFromContour(CvSeq* ContourSeq,\n                                           CvVoronoiDiagram2D** VoronoiDiagram,\n                                           CvMemStorage* VoronoiStorage,\n                                           CvLeeParameters contour_type CV_DEFAULT(CV_LEE_INT),\n                                           int contour_orientation CV_DEFAULT(-1),\n                                           int attempt_number CV_DEFAULT(10));\n\n/* Computes Voronoi Diagram for domains in given image */\nCVAPI(int)  cvVoronoiDiagramFromImage(IplImage* pImage,\n                                         CvSeq** ContourSeq,\n                                         CvVoronoiDiagram2D** VoronoiDiagram,\n                                         CvMemStorage* VoronoiStorage,\n                                         CvLeeParameters regularization_method CV_DEFAULT(CV_LEE_NON),\n                                         float approx_precision CV_DEFAULT(CV_LEE_AUTO));\n\n/* Deallocates the storage */\nCVAPI(void) cvReleaseVoronoiStorage(CvVoronoiDiagram2D* VoronoiDiagram,\n                                          CvMemStorage** pVoronoiStorage);\n\n/*********************** Linear-Contour Model ****************************/\n\nstruct CvLCMEdge;\nstruct CvLCMNode;\n\ntypedef struct CvLCMEdge\n{\n    CV_GRAPH_EDGE_FIELDS()\n    CvSeq* chain;\n    float width;\n    int index1;\n    int index2;\n} CvLCMEdge;\n\ntypedef struct CvLCMNode\n{\n    CV_GRAPH_VERTEX_FIELDS()\n    CvContour* contour;\n} CvLCMNode;\n\n\n/* Computes hybrid model from Voronoi Diagram */\nCVAPI(CvGraph*) cvLinearContorModelFromVoronoiDiagram(CvVoronoiDiagram2D* VoronoiDiagram,\n                                                         float maxWidth);\n\n/* Releases hybrid model storage */\nCVAPI(int) cvReleaseLinearContorModelStorage(CvGraph** Graph);\n\n\n/* two stereo-related functions */\n\nCVAPI(void) cvInitPerspectiveTransform( CvSize size, const CvPoint2D32f vertex[4], double matrix[3][3],\n                                              CvArr* rectMap );\n\n/*CVAPI(void) cvInitStereoRectification( CvStereoCamera* params,\n                                             CvArr* rectMap1, CvArr* rectMap2,\n                                             int do_undistortion );*/\n\n/*************************** View Morphing Functions ************************/\n\ntypedef struct CvMatrix3\n{\n    float m[3][3];\n} CvMatrix3;\n\n/* The order of the function corresponds to the order they should appear in\n   the view morphing pipeline */\n\n/* Finds ending points of scanlines on left and right images of stereo-pair */\nCVAPI(void)  cvMakeScanlines( const CvMatrix3* matrix, CvSize  img_size,\n                              int*  scanlines1, int*  scanlines2,\n                              int*  lengths1, int*  lengths2,\n                              int*  line_count );\n\n/* Grab pixel values from scanlines and stores them sequentially\n   (some sort of perspective image transform) */\nCVAPI(void)  cvPreWarpImage( int       line_count,\n                             IplImage* img,\n                             uchar*    dst,\n                             int*      dst_nums,\n                             int*      scanlines);\n\n/* Approximate each grabbed scanline by a sequence of runs\n   (lossy run-length compression) */\nCVAPI(void)  cvFindRuns( int    line_count,\n                         uchar* prewarp1,\n                         uchar* prewarp2,\n                         int*   line_lengths1,\n                         int*   line_lengths2,\n                         int*   runs1,\n                         int*   runs2,\n                         int*   num_runs1,\n                         int*   num_runs2);\n\n/* Compares two sets of compressed scanlines */\nCVAPI(void)  cvDynamicCorrespondMulti( int  line_count,\n                                       int* first,\n                                       int* first_runs,\n                                       int* second,\n                                       int* second_runs,\n                                       int* first_corr,\n                                       int* second_corr);\n\n/* Finds scanline ending coordinates for some intermediate \"virtual\" camera position */\nCVAPI(void)  cvMakeAlphaScanlines( int*  scanlines1,\n                                   int*  scanlines2,\n                                   int*  scanlinesA,\n                                   int*  lengths,\n                                   int   line_count,\n                                   float alpha);\n\n/* Blends data of the left and right image scanlines to get\n   pixel values of \"virtual\" image scanlines */\nCVAPI(void)  cvMorphEpilinesMulti( int    line_count,\n                                   uchar* first_pix,\n                                   int*   first_num,\n                                   uchar* second_pix,\n                                   int*   second_num,\n                                   uchar* dst_pix,\n                                   int*   dst_num,\n                                   float  alpha,\n                                   int*   first,\n                                   int*   first_runs,\n                                   int*   second,\n                                   int*   second_runs,\n                                   int*   first_corr,\n                                   int*   second_corr);\n\n/* Does reverse warping of the morphing result to make\n   it fill the destination image rectangle */\nCVAPI(void)  cvPostWarpImage( int       line_count,\n                              uchar*    src,\n                              int*      src_nums,\n                              IplImage* img,\n                              int*      scanlines);\n\n/* Deletes Moire (missed pixels that appear due to discretization) */\nCVAPI(void)  cvDeleteMoire( IplImage*  img );\n\n\ntypedef struct CvConDensation\n{\n    int MP;\n    int DP;\n    float* DynamMatr;       /* Matrix of the linear Dynamics system  */\n    float* State;           /* Vector of State                       */\n    int SamplesNum;         /* Number of the Samples                 */\n    float** flSamples;      /* arr of the Sample Vectors             */\n    float** flNewSamples;   /* temporary array of the Sample Vectors */\n    float* flConfidence;    /* Confidence for each Sample            */\n    float* flCumulative;    /* Cumulative confidence                 */\n    float* Temp;            /* Temporary vector                      */\n    float* RandomSample;    /* RandomVector to update sample set     */\n    struct CvRandState* RandS; /* Array of structures to generate random vectors */\n} CvConDensation;\n\n/* Creates ConDensation filter state */\nCVAPI(CvConDensation*)  cvCreateConDensation( int dynam_params,\n                                             int measure_params,\n                                             int sample_count );\n\n/* Releases ConDensation filter state */\nCVAPI(void)  cvReleaseConDensation( CvConDensation** condens );\n\n/* Updates ConDensation filter by time (predict future state of the system) */\nCVAPI(void)  cvConDensUpdateByTime( CvConDensation* condens);\n\n/* Initializes ConDensation filter samples  */\nCVAPI(void)  cvConDensInitSampleSet( CvConDensation* condens, CvMat* lower_bound, CvMat* upper_bound );\n\nCV_INLINE int iplWidth( const IplImage* img )\n{\n    return !img ? 0 : !img->roi ? img->width : img->roi->width;\n}\n\nCV_INLINE int iplHeight( const IplImage* img )\n{\n    return !img ? 0 : !img->roi ? img->height : img->roi->height;\n}\n\n#ifdef __cplusplus\n}\n#endif\n\n#ifdef __cplusplus\n\n/****************************************************************************************\\\n*                                   Calibration engine                                   *\n\\****************************************************************************************/\n\ntypedef enum CvCalibEtalonType\n{\n    CV_CALIB_ETALON_USER = -1,\n    CV_CALIB_ETALON_CHESSBOARD = 0,\n    CV_CALIB_ETALON_CHECKERBOARD = CV_CALIB_ETALON_CHESSBOARD\n}\nCvCalibEtalonType;\n\nclass CV_EXPORTS CvCalibFilter\n{\npublic:\n    /* Constructor & destructor */\n    CvCalibFilter();\n    virtual ~CvCalibFilter();\n\n    /* Sets etalon type - one for all cameras.\n       etalonParams is used in case of pre-defined etalons (such as chessboard).\n       Number of elements in etalonParams is determined by etalonType.\n       E.g., if etalon type is CV_ETALON_TYPE_CHESSBOARD then:\n         etalonParams[0] is number of squares per one side of etalon\n         etalonParams[1] is number of squares per another side of etalon\n         etalonParams[2] is linear size of squares in the board in arbitrary units.\n       pointCount & points are used in case of\n       CV_CALIB_ETALON_USER (user-defined) etalon. */\n    virtual bool\n        SetEtalon( CvCalibEtalonType etalonType, double* etalonParams,\n                   int pointCount = 0, CvPoint2D32f* points = 0 );\n\n    /* Retrieves etalon parameters/or and points */\n    virtual CvCalibEtalonType\n        GetEtalon( int* paramCount = 0, const double** etalonParams = 0,\n                   int* pointCount = 0, const CvPoint2D32f** etalonPoints = 0 ) const;\n\n    /* Sets number of cameras calibrated simultaneously. It is equal to 1 initially */\n    virtual void SetCameraCount( int cameraCount );\n\n    /* Retrieves number of cameras */\n    int GetCameraCount() const { return cameraCount; }\n\n    /* Starts cameras calibration */\n    virtual bool SetFrames( int totalFrames );\n\n    /* Stops cameras calibration */\n    virtual void Stop( bool calibrate = false );\n\n    /* Retrieves number of cameras */\n    bool IsCalibrated() const { return isCalibrated; }\n\n    /* Feeds another serie of snapshots (one per each camera) to filter.\n       Etalon points on these images are found automatically.\n       If the function can't locate points, it returns false */\n    virtual bool FindEtalon( IplImage** imgs );\n\n    /* The same but takes matrices */\n    virtual bool FindEtalon( CvMat** imgs );\n\n    /* Lower-level function for feeding filter with already found etalon points.\n       Array of point arrays for each camera is passed. */\n    virtual bool Push( const CvPoint2D32f** points = 0 );\n\n    /* Returns total number of accepted frames and, optionally,\n       total number of frames to collect */\n    virtual int GetFrameCount( int* framesTotal = 0 ) const;\n\n    /* Retrieves camera parameters for specified camera.\n       If camera is not calibrated the function returns 0 */\n    virtual const CvCamera* GetCameraParams( int idx = 0 ) const;\n\n    virtual const CvStereoCamera* GetStereoParams() const;\n\n    /* Sets camera parameters for all cameras */\n    virtual bool SetCameraParams( CvCamera* params );\n\n    /* Saves all camera parameters to file */\n    virtual bool SaveCameraParams( const char* filename );\n\n    /* Loads all camera parameters from file */\n    virtual bool LoadCameraParams( const char* filename );\n\n    /* Undistorts images using camera parameters. Some of src pointers can be NULL. */\n    virtual bool Undistort( IplImage** src, IplImage** dst );\n\n    /* Undistorts images using camera parameters. Some of src pointers can be NULL. */\n    virtual bool Undistort( CvMat** src, CvMat** dst );\n\n    /* Returns array of etalon points detected/partally detected\n       on the latest frame for idx-th camera */\n    virtual bool GetLatestPoints( int idx, CvPoint2D32f** pts,\n                                                  int* count, bool* found );\n\n    /* Draw the latest detected/partially detected etalon */\n    virtual void DrawPoints( IplImage** dst );\n\n    /* Draw the latest detected/partially detected etalon */\n    virtual void DrawPoints( CvMat** dst );\n\n    virtual bool Rectify( IplImage** srcarr, IplImage** dstarr );\n    virtual bool Rectify( CvMat** srcarr, CvMat** dstarr );\n\nprotected:\n\n    enum { MAX_CAMERAS = 3 };\n\n    /* etalon data */\n    CvCalibEtalonType  etalonType;\n    int     etalonParamCount;\n    double* etalonParams;\n    int     etalonPointCount;\n    CvPoint2D32f* etalonPoints;\n    CvSize  imgSize;\n    CvMat*  grayImg;\n    CvMat*  tempImg;\n    CvMemStorage* storage;\n\n    /* camera data */\n    int     cameraCount;\n    CvCamera cameraParams[MAX_CAMERAS];\n    CvStereoCamera stereo;\n    CvPoint2D32f* points[MAX_CAMERAS];\n    CvMat*  undistMap[MAX_CAMERAS][2];\n    CvMat*  undistImg;\n    int     latestCounts[MAX_CAMERAS];\n    CvPoint2D32f* latestPoints[MAX_CAMERAS];\n    CvMat*  rectMap[MAX_CAMERAS][2];\n\n    /* Added by Valery */\n    //CvStereoCamera stereoParams;\n\n    int     maxPoints;\n    int     framesTotal;\n    int     framesAccepted;\n    bool    isCalibrated;\n};\n\n#include <iosfwd>\n#include <limits>\n\nclass CV_EXPORTS CvImage\n{\npublic:\n    CvImage() : image(0), refcount(0) {}\n    CvImage( CvSize _size, int _depth, int _channels )\n    {\n        image = cvCreateImage( _size, _depth, _channels );\n        refcount = image ? new int(1) : 0;\n    }\n\n    CvImage( IplImage* img ) : image(img)\n    {\n        refcount = image ? new int(1) : 0;\n    }\n\n    CvImage( const CvImage& img ) : image(img.image), refcount(img.refcount)\n    {\n        if( refcount ) ++(*refcount);\n    }\n\n    CvImage( const char* filename, const char* imgname=0, int color=-1 ) : image(0), refcount(0)\n    { load( filename, imgname, color ); }\n\n    CvImage( CvFileStorage* fs, const char* mapname, const char* imgname ) : image(0), refcount(0)\n    { read( fs, mapname, imgname ); }\n\n    CvImage( CvFileStorage* fs, const char* seqname, int idx ) : image(0), refcount(0)\n    { read( fs, seqname, idx ); }\n\n    ~CvImage()\n    {\n        if( refcount && !(--*refcount) )\n        {\n            cvReleaseImage( &image );\n            delete refcount;\n        }\n    }\n\n    CvImage clone() { return CvImage(image ? cvCloneImage(image) : 0); }\n\n    void create( CvSize _size, int _depth, int _channels )\n    {\n        if( !image || !refcount ||\n           image->width != _size.width || image->height != _size.height ||\n           image->depth != _depth || image->nChannels != _channels )\n            attach( cvCreateImage( _size, _depth, _channels ));\n    }\n\n    void release() { detach(); }\n    void clear() { detach(); }\n\n    void attach( IplImage* img, bool use_refcount=true )\n    {\n        if( refcount && --*refcount == 0 )\n        {\n            cvReleaseImage( &image );\n            delete refcount;\n        }\n        image = img;\n        refcount = use_refcount && image ? new int(1) : 0;\n    }\n\n    void detach()\n    {\n        if( refcount && --*refcount == 0 )\n        {\n            cvReleaseImage( &image );\n            delete refcount;\n        }\n        image = 0;\n        refcount = 0;\n    }\n\n    bool load( const char* filename, const char* imgname=0, int color=-1 );\n    bool read( CvFileStorage* fs, const char* mapname, const char* imgname );\n    bool read( CvFileStorage* fs, const char* seqname, int idx );\n    void save( const char* filename, const char* imgname, const int* params=0 );\n    void write( CvFileStorage* fs, const char* imgname );\n\n    void show( const char* window_name );\n    bool is_valid() { return image != 0; }\n\n    int width() const { return image ? image->width : 0; }\n    int height() const { return image ? image->height : 0; }\n\n    CvSize size() const { return image ? cvSize(image->width, image->height) : cvSize(0,0); }\n\n    CvSize roi_size() const\n    {\n        return !image ? cvSize(0,0) :\n        !image->roi ? cvSize(image->width,image->height) :\n        cvSize(image->roi->width, image->roi->height);\n    }\n\n    CvRect roi() const\n    {\n        return !image ? cvRect(0,0,0,0) :\n        !image->roi ? cvRect(0,0,image->width,image->height) :\n        cvRect(image->roi->xOffset,image->roi->yOffset,\n               image->roi->width,image->roi->height);\n    }\n\n    int coi() const { return !image || !image->roi ? 0 : image->roi->coi; }\n\n    void set_roi(CvRect _roi) { cvSetImageROI(image,_roi); }\n    void reset_roi() { cvResetImageROI(image); }\n    void set_coi(int _coi) { cvSetImageCOI(image,_coi); }\n    int depth() const { return image ? image->depth : 0; }\n    int channels() const { return image ? image->nChannels : 0; }\n    int pix_size() const { return image ? ((image->depth & 255)>>3)*image->nChannels : 0; }\n\n    uchar* data() { return image ? (uchar*)image->imageData : 0; }\n    const uchar* data() const { return image ? (const uchar*)image->imageData : 0; }\n    int step() const { return image ? image->widthStep : 0; }\n    int origin() const { return image ? image->origin : 0; }\n\n    uchar* roi_row(int y)\n    {\n        assert(0<=y);\n        assert(!image ?\n               1 : image->roi ?\n               y<image->roi->height : y<image->height);\n\n        return !image ? 0 :\n        !image->roi ?\n        (uchar*)(image->imageData + y*image->widthStep) :\n        (uchar*)(image->imageData + (y+image->roi->yOffset)*image->widthStep +\n                 image->roi->xOffset*((image->depth & 255)>>3)*image->nChannels);\n    }\n\n    const uchar* roi_row(int y) const\n    {\n        assert(0<=y);\n        assert(!image ?\n               1 : image->roi ?\n               y<image->roi->height : y<image->height);\n\n        return !image ? 0 :\n        !image->roi ?\n        (const uchar*)(image->imageData + y*image->widthStep) :\n        (const uchar*)(image->imageData + (y+image->roi->yOffset)*image->widthStep +\n                       image->roi->xOffset*((image->depth & 255)>>3)*image->nChannels);\n    }\n\n    operator const IplImage* () const { return image; }\n    operator IplImage* () { return image; }\n\n    CvImage& operator = (const CvImage& img)\n    {\n        if( img.refcount )\n            ++*img.refcount;\n        if( refcount && !(--*refcount) )\n            cvReleaseImage( &image );\n        image=img.image;\n        refcount=img.refcount;\n        return *this;\n    }\n\nprotected:\n    IplImage* image;\n    int* refcount;\n};\n\n\nclass CV_EXPORTS CvMatrix\n{\npublic:\n    CvMatrix() : matrix(0) {}\n    CvMatrix( int _rows, int _cols, int _type )\n    { matrix = cvCreateMat( _rows, _cols, _type ); }\n\n    CvMatrix( int _rows, int _cols, int _type, CvMat* hdr,\n             void* _data=0, int _step=CV_AUTOSTEP )\n    { matrix = cvInitMatHeader( hdr, _rows, _cols, _type, _data, _step ); }\n\n    CvMatrix( int rows, int cols, int type, CvMemStorage* storage, bool alloc_data=true );\n\n    CvMatrix( int _rows, int _cols, int _type, void* _data, int _step=CV_AUTOSTEP )\n    { matrix = cvCreateMatHeader( _rows, _cols, _type );\n        cvSetData( matrix, _data, _step ); }\n\n    CvMatrix( CvMat* m )\n    { matrix = m; }\n\n    CvMatrix( const CvMatrix& m )\n    {\n        matrix = m.matrix;\n        addref();\n    }\n\n    CvMatrix( const char* filename, const char* matname=0, int color=-1 ) : matrix(0)\n    {  load( filename, matname, color ); }\n\n    CvMatrix( CvFileStorage* fs, const char* mapname, const char* matname ) : matrix(0)\n    {  read( fs, mapname, matname ); }\n\n    CvMatrix( CvFileStorage* fs, const char* seqname, int idx ) : matrix(0)\n    {  read( fs, seqname, idx ); }\n\n    ~CvMatrix()\n    {\n        release();\n    }\n\n    CvMatrix clone() { return CvMatrix(matrix ? cvCloneMat(matrix) : 0); }\n\n    void set( CvMat* m, bool add_ref )\n    {\n        release();\n        matrix = m;\n        if( add_ref )\n            addref();\n    }\n\n    void create( int _rows, int _cols, int _type )\n    {\n        if( !matrix || !matrix->refcount ||\n           matrix->rows != _rows || matrix->cols != _cols ||\n           CV_MAT_TYPE(matrix->type) != _type )\n            set( cvCreateMat( _rows, _cols, _type ), false );\n    }\n\n    void addref() const\n    {\n        if( matrix )\n        {\n            if( matrix->hdr_refcount )\n                ++matrix->hdr_refcount;\n            else if( matrix->refcount )\n                ++*matrix->refcount;\n        }\n    }\n\n    void release()\n    {\n        if( matrix )\n        {\n            if( matrix->hdr_refcount )\n            {\n                if( --matrix->hdr_refcount == 0 )\n                    cvReleaseMat( &matrix );\n            }\n            else if( matrix->refcount )\n            {\n                if( --*matrix->refcount == 0 )\n                    cvFree( &matrix->refcount );\n            }\n            matrix = 0;\n        }\n    }\n\n    void clear()\n    {\n        release();\n    }\n\n    bool load( const char* filename, const char* matname=0, int color=-1 );\n    bool read( CvFileStorage* fs, const char* mapname, const char* matname );\n    bool read( CvFileStorage* fs, const char* seqname, int idx );\n    void save( const char* filename, const char* matname, const int* params=0 );\n    void write( CvFileStorage* fs, const char* matname );\n\n    void show( const char* window_name );\n\n    bool is_valid() { return matrix != 0; }\n\n    int rows() const { return matrix ? matrix->rows : 0; }\n    int cols() const { return matrix ? matrix->cols : 0; }\n\n    CvSize size() const\n    {\n        return !matrix ? cvSize(0,0) : cvSize(matrix->rows,matrix->cols);\n    }\n\n    int type() const { return matrix ? CV_MAT_TYPE(matrix->type) : 0; }\n    int depth() const { return matrix ? CV_MAT_DEPTH(matrix->type) : 0; }\n    int channels() const { return matrix ? CV_MAT_CN(matrix->type) : 0; }\n    int pix_size() const { return matrix ? CV_ELEM_SIZE(matrix->type) : 0; }\n\n    uchar* data() { return matrix ? matrix->data.ptr : 0; }\n    const uchar* data() const { return matrix ? matrix->data.ptr : 0; }\n    int step() const { return matrix ? matrix->step : 0; }\n\n    void set_data( void* _data, int _step=CV_AUTOSTEP )\n    { cvSetData( matrix, _data, _step ); }\n\n    uchar* row(int i) { return !matrix ? 0 : matrix->data.ptr + i*matrix->step; }\n    const uchar* row(int i) const\n    { return !matrix ? 0 : matrix->data.ptr + i*matrix->step; }\n\n    operator const CvMat* () const { return matrix; }\n    operator CvMat* () { return matrix; }\n\n    CvMatrix& operator = (const CvMatrix& _m)\n    {\n        _m.addref();\n        release();\n        matrix = _m.matrix;\n        return *this;\n    }\n\nprotected:\n    CvMat* matrix;\n};\n\n/****************************************************************************************\\\n *                                       CamShiftTracker                                  *\n \\****************************************************************************************/\n\nclass CV_EXPORTS CvCamShiftTracker\n{\npublic:\n\n    CvCamShiftTracker();\n    virtual ~CvCamShiftTracker();\n\n    /**** Characteristics of the object that are calculated by track_object method *****/\n    float   get_orientation() const // orientation of the object in degrees\n    { return m_box.angle; }\n    float   get_length() const // the larger linear size of the object\n    { return m_box.size.height; }\n    float   get_width() const // the smaller linear size of the object\n    { return m_box.size.width; }\n    CvPoint2D32f get_center() const // center of the object\n    { return m_box.center; }\n    CvRect get_window() const // bounding rectangle for the object\n    { return m_comp.rect; }\n\n    /*********************** Tracking parameters ************************/\n    int     get_threshold() const // thresholding value that applied to back project\n    { return m_threshold; }\n\n    int     get_hist_dims( int* dims = 0 ) const // returns number of histogram dimensions and sets\n    { return m_hist ? cvGetDims( m_hist->bins, dims ) : 0; }\n\n    int     get_min_ch_val( int channel ) const // get the minimum allowed value of the specified channel\n    { return m_min_ch_val[channel]; }\n\n    int     get_max_ch_val( int channel ) const // get the maximum allowed value of the specified channel\n    { return m_max_ch_val[channel]; }\n\n    // set initial object rectangle (must be called before initial calculation of the histogram)\n    bool    set_window( CvRect window)\n    { m_comp.rect = window; return true; }\n\n    bool    set_threshold( int threshold ) // threshold applied to the histogram bins\n    { m_threshold = threshold; return true; }\n\n    bool    set_hist_bin_range( int dim, int min_val, int max_val );\n\n    bool    set_hist_dims( int c_dims, int* dims );// set the histogram parameters\n\n    bool    set_min_ch_val( int channel, int val ) // set the minimum allowed value of the specified channel\n    { m_min_ch_val[channel] = val; return true; }\n    bool    set_max_ch_val( int channel, int val ) // set the maximum allowed value of the specified channel\n    { m_max_ch_val[channel] = val; return true; }\n\n    /************************ The processing methods *********************************/\n    // update object position\n    virtual bool  track_object( const IplImage* cur_frame );\n\n    // update object histogram\n    virtual bool  update_histogram( const IplImage* cur_frame );\n\n    // reset histogram\n    virtual void  reset_histogram();\n\n    /************************ Retrieving internal data *******************************/\n    // get back project image\n    virtual IplImage* get_back_project()\n    { return m_back_project; }\n\n    float query( int* bin ) const\n    { return m_hist ? (float)cvGetRealND(m_hist->bins, bin) : 0.f; }\n\nprotected:\n\n    // internal method for color conversion: fills m_color_planes group\n    virtual void color_transform( const IplImage* img );\n\n    CvHistogram* m_hist;\n\n    CvBox2D    m_box;\n    CvConnectedComp m_comp;\n\n    float      m_hist_ranges_data[CV_MAX_DIM][2];\n    float*     m_hist_ranges[CV_MAX_DIM];\n\n    int        m_min_ch_val[CV_MAX_DIM];\n    int        m_max_ch_val[CV_MAX_DIM];\n    int        m_threshold;\n\n    IplImage*  m_color_planes[CV_MAX_DIM];\n    IplImage*  m_back_project;\n    IplImage*  m_temp;\n    IplImage*  m_mask;\n};\n\n/****************************************************************************************\\\n*                              Expectation - Maximization                                *\n\\****************************************************************************************/\nstruct CV_EXPORTS_W_MAP CvEMParams\n{\n    CvEMParams();\n    CvEMParams( int nclusters, int cov_mat_type=cv::EM::COV_MAT_DIAGONAL,\n                int start_step=cv::EM::START_AUTO_STEP,\n                CvTermCriteria term_crit=cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 100, FLT_EPSILON),\n                const CvMat* probs=0, const CvMat* weights=0, const CvMat* means=0, const CvMat** covs=0 );\n\n    CV_PROP_RW int nclusters;\n    CV_PROP_RW int cov_mat_type;\n    CV_PROP_RW int start_step;\n    const CvMat* probs;\n    const CvMat* weights;\n    const CvMat* means;\n    const CvMat** covs;\n    CV_PROP_RW CvTermCriteria term_crit;\n};\n\n\nclass CV_EXPORTS_W CvEM : public CvStatModel\n{\npublic:\n    // Type of covariation matrices\n    enum { COV_MAT_SPHERICAL=cv::EM::COV_MAT_SPHERICAL,\n           COV_MAT_DIAGONAL =cv::EM::COV_MAT_DIAGONAL,\n           COV_MAT_GENERIC  =cv::EM::COV_MAT_GENERIC };\n\n    // The initial step\n    enum { START_E_STEP=cv::EM::START_E_STEP,\n           START_M_STEP=cv::EM::START_M_STEP,\n           START_AUTO_STEP=cv::EM::START_AUTO_STEP };\n\n    CV_WRAP CvEM();\n    CvEM( const CvMat* samples, const CvMat* sampleIdx=0,\n          CvEMParams params=CvEMParams(), CvMat* labels=0 );\n\n    virtual ~CvEM();\n\n    virtual bool train( const CvMat* samples, const CvMat* sampleIdx=0,\n                        CvEMParams params=CvEMParams(), CvMat* labels=0 );\n\n    virtual float predict( const CvMat* sample, CV_OUT CvMat* probs ) const;\n\n    CV_WRAP CvEM( const cv::Mat& samples, const cv::Mat& sampleIdx=cv::Mat(),\n                  CvEMParams params=CvEMParams() );\n\n    CV_WRAP virtual bool train( const cv::Mat& samples,\n                                const cv::Mat& sampleIdx=cv::Mat(),\n                                CvEMParams params=CvEMParams(),\n                                CV_OUT cv::Mat* labels=0 );\n\n    CV_WRAP virtual float predict( const cv::Mat& sample, CV_OUT cv::Mat* probs=0 ) const;\n    CV_WRAP virtual double calcLikelihood( const cv::Mat &sample ) const;\n\n    CV_WRAP int getNClusters() const;\n    CV_WRAP cv::Mat getMeans() const;\n    CV_WRAP void getCovs(CV_OUT std::vector<cv::Mat>& covs) const;\n    CV_WRAP cv::Mat getWeights() const;\n    CV_WRAP cv::Mat getProbs() const;\n\n    CV_WRAP inline double getLikelihood() const { return emObj.isTrained() ? logLikelihood : DBL_MAX; }\n\n    CV_WRAP virtual void clear();\n\n    int get_nclusters() const;\n    const CvMat* get_means() const;\n    const CvMat** get_covs() const;\n    const CvMat* get_weights() const;\n    const CvMat* get_probs() const;\n\n    inline double get_log_likelihood() const { return getLikelihood(); }\n\n    virtual void read( CvFileStorage* fs, CvFileNode* node );\n    virtual void write( CvFileStorage* fs, const char* name ) const;\n\nprotected:\n    void set_mat_hdrs();\n\n    cv::EM emObj;\n    cv::Mat probs;\n    double logLikelihood;\n\n    CvMat meansHdr;\n    std::vector<CvMat> covsHdrs;\n    std::vector<CvMat*> covsPtrs;\n    CvMat weightsHdr;\n    CvMat probsHdr;\n};\n\nnamespace cv\n{\n\ntypedef CvEMParams EMParams;\ntypedef CvEM ExpectationMaximization;\n\n/*!\n The Patch Generator class\n */\nclass CV_EXPORTS PatchGenerator\n{\npublic:\n    PatchGenerator();\n    PatchGenerator(double _backgroundMin, double _backgroundMax,\n                   double _noiseRange, bool _randomBlur=true,\n                   double _lambdaMin=0.6, double _lambdaMax=1.5,\n                   double _thetaMin=-CV_PI, double _thetaMax=CV_PI,\n                   double _phiMin=-CV_PI, double _phiMax=CV_PI );\n    void operator()(const Mat& image, Point2f pt, Mat& patch, Size patchSize, RNG& rng) const;\n    void operator()(const Mat& image, const Mat& transform, Mat& patch,\n                    Size patchSize, RNG& rng) const;\n    void warpWholeImage(const Mat& image, Mat& matT, Mat& buf,\n                        CV_OUT Mat& warped, int border, RNG& rng) const;\n    void generateRandomTransform(Point2f srcCenter, Point2f dstCenter,\n                                 CV_OUT Mat& transform, RNG& rng,\n                                 bool inverse=false) const;\n    void setAffineParam(double lambda, double theta, double phi);\n\n    double backgroundMin, backgroundMax;\n    double noiseRange;\n    bool randomBlur;\n    double lambdaMin, lambdaMax;\n    double thetaMin, thetaMax;\n    double phiMin, phiMax;\n};\n\n\nclass CV_EXPORTS LDetector\n{\npublic:\n    LDetector();\n    LDetector(int _radius, int _threshold, int _nOctaves,\n              int _nViews, double _baseFeatureSize, double _clusteringDistance);\n    void operator()(const Mat& image,\n                    CV_OUT vector<KeyPoint>& keypoints,\n                    int maxCount=0, bool scaleCoords=true) const;\n    void operator()(const vector<Mat>& pyr,\n                    CV_OUT vector<KeyPoint>& keypoints,\n                    int maxCount=0, bool scaleCoords=true) const;\n    void getMostStable2D(const Mat& image, CV_OUT vector<KeyPoint>& keypoints,\n                         int maxCount, const PatchGenerator& patchGenerator) const;\n    void setVerbose(bool verbose);\n\n    void read(const FileNode& node);\n    void write(FileStorage& fs, const String& name=String()) const;\n\n    int radius;\n    int threshold;\n    int nOctaves;\n    int nViews;\n    bool verbose;\n\n    double baseFeatureSize;\n    double clusteringDistance;\n};\n\ntypedef LDetector YAPE;\n\nclass CV_EXPORTS FernClassifier\n{\npublic:\n    FernClassifier();\n    FernClassifier(const FileNode& node);\n    FernClassifier(const vector<vector<Point2f> >& points,\n                   const vector<Mat>& refimgs,\n                   const vector<vector<int> >& labels=vector<vector<int> >(),\n                   int _nclasses=0, int _patchSize=PATCH_SIZE,\n                   int _signatureSize=DEFAULT_SIGNATURE_SIZE,\n                   int _nstructs=DEFAULT_STRUCTS,\n                   int _structSize=DEFAULT_STRUCT_SIZE,\n                   int _nviews=DEFAULT_VIEWS,\n                   int _compressionMethod=COMPRESSION_NONE,\n                   const PatchGenerator& patchGenerator=PatchGenerator());\n    virtual ~FernClassifier();\n    virtual void read(const FileNode& n);\n    virtual void write(FileStorage& fs, const String& name=String()) const;\n    virtual void trainFromSingleView(const Mat& image,\n                                     const vector<KeyPoint>& keypoints,\n                                     int _patchSize=PATCH_SIZE,\n                                     int _signatureSize=DEFAULT_SIGNATURE_SIZE,\n                                     int _nstructs=DEFAULT_STRUCTS,\n                                     int _structSize=DEFAULT_STRUCT_SIZE,\n                                     int _nviews=DEFAULT_VIEWS,\n                                     int _compressionMethod=COMPRESSION_NONE,\n                                     const PatchGenerator& patchGenerator=PatchGenerator());\n    virtual void train(const vector<vector<Point2f> >& points,\n                       const vector<Mat>& refimgs,\n                       const vector<vector<int> >& labels=vector<vector<int> >(),\n                       int _nclasses=0, int _patchSize=PATCH_SIZE,\n                       int _signatureSize=DEFAULT_SIGNATURE_SIZE,\n                       int _nstructs=DEFAULT_STRUCTS,\n                       int _structSize=DEFAULT_STRUCT_SIZE,\n                       int _nviews=DEFAULT_VIEWS,\n                       int _compressionMethod=COMPRESSION_NONE,\n                       const PatchGenerator& patchGenerator=PatchGenerator());\n    virtual int operator()(const Mat& img, Point2f kpt, vector<float>& signature) const;\n    virtual int operator()(const Mat& patch, vector<float>& signature) const;\n    virtual void clear();\n    virtual bool empty() const;\n    void setVerbose(bool verbose);\n\n    int getClassCount() const;\n    int getStructCount() const;\n    int getStructSize() const;\n    int getSignatureSize() const;\n    int getCompressionMethod() const;\n    Size getPatchSize() const;\n\n    struct Feature\n    {\n        uchar x1, y1, x2, y2;\n        Feature() : x1(0), y1(0), x2(0), y2(0) {}\n        Feature(int _x1, int _y1, int _x2, int _y2)\n        : x1((uchar)_x1), y1((uchar)_y1), x2((uchar)_x2), y2((uchar)_y2)\n        {}\n        template<typename _Tp> bool operator ()(const Mat_<_Tp>& patch) const\n        { return patch(y1,x1) > patch(y2, x2); }\n    };\n\n    enum\n    {\n        PATCH_SIZE = 31,\n        DEFAULT_STRUCTS = 50,\n        DEFAULT_STRUCT_SIZE = 9,\n        DEFAULT_VIEWS = 5000,\n        DEFAULT_SIGNATURE_SIZE = 176,\n        COMPRESSION_NONE = 0,\n        COMPRESSION_RANDOM_PROJ = 1,\n        COMPRESSION_PCA = 2,\n        DEFAULT_COMPRESSION_METHOD = COMPRESSION_NONE\n    };\n\nprotected:\n    virtual void prepare(int _nclasses, int _patchSize, int _signatureSize,\n                         int _nstructs, int _structSize,\n                         int _nviews, int _compressionMethod);\n    virtual void finalize(RNG& rng);\n    virtual int getLeaf(int fidx, const Mat& patch) const;\n\n    bool verbose;\n    int nstructs;\n    int structSize;\n    int nclasses;\n    int signatureSize;\n    int compressionMethod;\n    int leavesPerStruct;\n    Size patchSize;\n    vector<Feature> features;\n    vector<int> classCounters;\n    vector<float> posteriors;\n};\n\n\n/****************************************************************************************\\\n *                                 Calonder Classifier                                    *\n \\****************************************************************************************/\n\nstruct RTreeNode;\n\nstruct CV_EXPORTS BaseKeypoint\n{\n    int x;\n    int y;\n    IplImage* image;\n\n    BaseKeypoint()\n    : x(0), y(0), image(NULL)\n    {}\n\n    BaseKeypoint(int _x, int _y, IplImage* _image)\n    : x(_x), y(_y), image(_image)\n    {}\n};\n\nclass CV_EXPORTS RandomizedTree\n{\npublic:\n    friend class RTreeClassifier;\n\n    static const uchar PATCH_SIZE = 32;\n    static const int DEFAULT_DEPTH = 9;\n    static const int DEFAULT_VIEWS = 5000;\n    static const size_t DEFAULT_REDUCED_NUM_DIM = 176;\n    static float GET_LOWER_QUANT_PERC() { return .03f; }\n    static float GET_UPPER_QUANT_PERC() { return .92f; }\n\n    RandomizedTree();\n    ~RandomizedTree();\n\n    void train(vector<BaseKeypoint> const& base_set, RNG &rng,\n               int depth, int views, size_t reduced_num_dim, int num_quant_bits);\n    void train(vector<BaseKeypoint> const& base_set, RNG &rng,\n               PatchGenerator &make_patch, int depth, int views, size_t reduced_num_dim,\n               int num_quant_bits);\n\n    // following two funcs are EXPERIMENTAL (do not use unless you know exactly what you do)\n    static void quantizeVector(float *vec, int dim, int N, float bnds[2], int clamp_mode=0);\n    static void quantizeVector(float *src, int dim, int N, float bnds[2], uchar *dst);\n\n    // patch_data must be a 32x32 array (no row padding)\n    float* getPosterior(uchar* patch_data);\n    const float* getPosterior(uchar* patch_data) const;\n    uchar* getPosterior2(uchar* patch_data);\n    const uchar* getPosterior2(uchar* patch_data) const;\n\n    void read(const char* file_name, int num_quant_bits);\n    void read(std::istream &is, int num_quant_bits);\n    void write(const char* file_name) const;\n    void write(std::ostream &os) const;\n\n    int classes() { return classes_; }\n    int depth() { return depth_; }\n\n    //void setKeepFloatPosteriors(bool b) { keep_float_posteriors_ = b; }\n    void discardFloatPosteriors() { freePosteriors(1); }\n\n    inline void applyQuantization(int num_quant_bits) { makePosteriors2(num_quant_bits); }\n\n    // debug\n    void savePosteriors(std::string url, bool append=false);\n    void savePosteriors2(std::string url, bool append=false);\n\nprivate:\n    int classes_;\n    int depth_;\n    int num_leaves_;\n    vector<RTreeNode> nodes_;\n    float **posteriors_;        // 16-bytes aligned posteriors\n    uchar **posteriors2_;     // 16-bytes aligned posteriors\n    vector<int> leaf_counts_;\n\n    void createNodes(int num_nodes, RNG &rng);\n    void allocPosteriorsAligned(int num_leaves, int num_classes);\n    void freePosteriors(int which);    // which: 1=posteriors_, 2=posteriors2_, 3=both\n    void init(int classes, int depth, RNG &rng);\n    void addExample(int class_id, uchar* patch_data);\n    void finalize(size_t reduced_num_dim, int num_quant_bits);\n    int getIndex(uchar* patch_data) const;\n    inline float* getPosteriorByIndex(int index);\n    inline const float* getPosteriorByIndex(int index) const;\n    inline uchar* getPosteriorByIndex2(int index);\n    inline const uchar* getPosteriorByIndex2(int index) const;\n    //void makeRandomMeasMatrix(float *cs_phi, PHI_DISTR_TYPE dt, size_t reduced_num_dim);\n    void convertPosteriorsToChar();\n    void makePosteriors2(int num_quant_bits);\n    void compressLeaves(size_t reduced_num_dim);\n    void estimateQuantPercForPosteriors(float perc[2]);\n};\n\n\ninline uchar* getData(IplImage* image)\n{\n    return reinterpret_cast<uchar*>(image->imageData);\n}\n\ninline float* RandomizedTree::getPosteriorByIndex(int index)\n{\n    return const_cast<float*>(const_cast<const RandomizedTree*>(this)->getPosteriorByIndex(index));\n}\n\ninline const float* RandomizedTree::getPosteriorByIndex(int index) const\n{\n    return posteriors_[index];\n}\n\ninline uchar* RandomizedTree::getPosteriorByIndex2(int index)\n{\n    return const_cast<uchar*>(const_cast<const RandomizedTree*>(this)->getPosteriorByIndex2(index));\n}\n\ninline const uchar* RandomizedTree::getPosteriorByIndex2(int index) const\n{\n    return posteriors2_[index];\n}\n\nstruct CV_EXPORTS RTreeNode\n{\n    short offset1, offset2;\n\n    RTreeNode() {}\n    RTreeNode(uchar x1, uchar y1, uchar x2, uchar y2)\n    : offset1(y1*RandomizedTree::PATCH_SIZE + x1),\n    offset2(y2*RandomizedTree::PATCH_SIZE + x2)\n    {}\n\n    //! Left child on 0, right child on 1\n    inline bool operator() (uchar* patch_data) const\n    {\n        return patch_data[offset1] > patch_data[offset2];\n    }\n};\n\nclass CV_EXPORTS RTreeClassifier\n{\npublic:\n    static const int DEFAULT_TREES = 48;\n    static const size_t DEFAULT_NUM_QUANT_BITS = 4;\n\n    RTreeClassifier();\n    void train(vector<BaseKeypoint> const& base_set,\n               RNG &rng,\n               int num_trees = RTreeClassifier::DEFAULT_TREES,\n               int depth = RandomizedTree::DEFAULT_DEPTH,\n               int views = RandomizedTree::DEFAULT_VIEWS,\n               size_t reduced_num_dim = RandomizedTree::DEFAULT_REDUCED_NUM_DIM,\n               int num_quant_bits = DEFAULT_NUM_QUANT_BITS);\n    void train(vector<BaseKeypoint> const& base_set,\n               RNG &rng,\n               PatchGenerator &make_patch,\n               int num_trees = RTreeClassifier::DEFAULT_TREES,\n               int depth = RandomizedTree::DEFAULT_DEPTH,\n               int views = RandomizedTree::DEFAULT_VIEWS,\n               size_t reduced_num_dim = RandomizedTree::DEFAULT_REDUCED_NUM_DIM,\n               int num_quant_bits = DEFAULT_NUM_QUANT_BITS);\n\n    // sig must point to a memory block of at least classes()*sizeof(float|uchar) bytes\n    void getSignature(IplImage *patch, uchar *sig) const;\n    void getSignature(IplImage *patch, float *sig) const;\n    void getSparseSignature(IplImage *patch, float *sig, float thresh) const;\n    // TODO: deprecated in favor of getSignature overload, remove\n    void getFloatSignature(IplImage *patch, float *sig) const { getSignature(patch, sig); }\n\n    static int countNonZeroElements(float *vec, int n, double tol=1e-10);\n    static inline void safeSignatureAlloc(uchar **sig, int num_sig=1, int sig_len=176);\n    static inline uchar* safeSignatureAlloc(int num_sig=1, int sig_len=176);\n\n    inline int classes() const { return classes_; }\n    inline int original_num_classes() const { return original_num_classes_; }\n\n    void setQuantization(int num_quant_bits);\n    void discardFloatPosteriors();\n\n    void read(const char* file_name);\n    void read(std::istream &is);\n    void write(const char* file_name) const;\n    void write(std::ostream &os) const;\n\n    // experimental and debug\n    void saveAllFloatPosteriors(std::string file_url);\n    void saveAllBytePosteriors(std::string file_url);\n    void setFloatPosteriorsFromTextfile_176(std::string url);\n    float countZeroElements();\n\n    vector<RandomizedTree> trees_;\n\nprivate:\n    int classes_;\n    int num_quant_bits_;\n    mutable uchar **posteriors_;\n    mutable unsigned short *ptemp_;\n    int original_num_classes_;\n    bool keep_floats_;\n};\n\n/****************************************************************************************\\\n*                                     One-Way Descriptor                                 *\n\\****************************************************************************************/\n\n// CvAffinePose: defines a parameterized affine transformation of an image patch.\n// An image patch is rotated on angle phi (in degrees), then scaled lambda1 times\n// along horizontal and lambda2 times along vertical direction, and then rotated again\n// on angle (theta - phi).\nclass CV_EXPORTS CvAffinePose\n{\npublic:\n    float phi;\n    float theta;\n    float lambda1;\n    float lambda2;\n};\n\nclass CV_EXPORTS OneWayDescriptor\n{\npublic:\n    OneWayDescriptor();\n    ~OneWayDescriptor();\n\n    // allocates memory for given descriptor parameters\n    void Allocate(int pose_count, CvSize size, int nChannels);\n\n    // GenerateSamples: generates affine transformed patches with averaging them over small transformation variations.\n    // If external poses and transforms were specified, uses them instead of generating random ones\n    // - pose_count: the number of poses to be generated\n    // - frontal: the input patch (can be a roi in a larger image)\n    // - norm: if nonzero, normalizes the output patch so that the sum of pixel intensities is 1\n    void GenerateSamples(int pose_count, IplImage* frontal, int norm = 0);\n\n    // GenerateSamplesFast: generates affine transformed patches with averaging them over small transformation variations.\n    // Uses precalculated transformed pca components.\n    // - frontal: the input patch (can be a roi in a larger image)\n    // - pca_hr_avg: pca average vector\n    // - pca_hr_eigenvectors: pca eigenvectors\n    // - pca_descriptors: an array of precomputed descriptors of pca components containing their affine transformations\n    //   pca_descriptors[0] corresponds to the average, pca_descriptors[1]-pca_descriptors[pca_dim] correspond to eigenvectors\n    void GenerateSamplesFast(IplImage* frontal, CvMat* pca_hr_avg,\n                             CvMat* pca_hr_eigenvectors, OneWayDescriptor* pca_descriptors);\n\n    // sets the poses and corresponding transforms\n    void SetTransforms(CvAffinePose* poses, CvMat** transforms);\n\n    // Initialize: builds a descriptor.\n    // - pose_count: the number of poses to build. If poses were set externally, uses them rather than generating random ones\n    // - frontal: input patch. Can be a roi in a larger image\n    // - feature_name: the feature name to be associated with the descriptor\n    // - norm: if 1, the affine transformed patches are normalized so that their sum is 1\n    void Initialize(int pose_count, IplImage* frontal, const char* feature_name = 0, int norm = 0);\n\n    // InitializeFast: builds a descriptor using precomputed descriptors of pca components\n    // - pose_count: the number of poses to build\n    // - frontal: input patch. Can be a roi in a larger image\n    // - feature_name: the feature name to be associated with the descriptor\n    // - pca_hr_avg: average vector for PCA\n    // - pca_hr_eigenvectors: PCA eigenvectors (one vector per row)\n    // - pca_descriptors: precomputed descriptors of PCA components, the first descriptor for the average vector\n    // followed by the descriptors for eigenvectors\n    void InitializeFast(int pose_count, IplImage* frontal, const char* feature_name,\n                        CvMat* pca_hr_avg, CvMat* pca_hr_eigenvectors, OneWayDescriptor* pca_descriptors);\n\n    // ProjectPCASample: unwarps an image patch into a vector and projects it into PCA space\n    // - patch: input image patch\n    // - avg: PCA average vector\n    // - eigenvectors: PCA eigenvectors, one per row\n    // - pca_coeffs: output PCA coefficients\n    void ProjectPCASample(IplImage* patch, CvMat* avg, CvMat* eigenvectors, CvMat* pca_coeffs) const;\n\n    // InitializePCACoeffs: projects all warped patches into PCA space\n    // - avg: PCA average vector\n    // - eigenvectors: PCA eigenvectors, one per row\n    void InitializePCACoeffs(CvMat* avg, CvMat* eigenvectors);\n\n    // EstimatePose: finds the closest match between an input patch and a set of patches with different poses\n    // - patch: input image patch\n    // - pose_idx: the output index of the closest pose\n    // - distance: the distance to the closest pose (L2 distance)\n    void EstimatePose(IplImage* patch, int& pose_idx, float& distance) const;\n\n    // EstimatePosePCA: finds the closest match between an input patch and a set of patches with different poses.\n    // The distance between patches is computed in PCA space\n    // - patch: input image patch\n    // - pose_idx: the output index of the closest pose\n    // - distance: distance to the closest pose (L2 distance in PCA space)\n    // - avg: PCA average vector. If 0, matching without PCA is used\n    // - eigenvectors: PCA eigenvectors, one per row\n    void EstimatePosePCA(CvArr* patch, int& pose_idx, float& distance, CvMat* avg, CvMat* eigenvalues) const;\n\n    // GetPatchSize: returns the size of each image patch after warping (2 times smaller than the input patch)\n    CvSize GetPatchSize() const\n    {\n        return m_patch_size;\n    }\n\n    // GetInputPatchSize: returns the required size of the patch that the descriptor is built from\n    // (2 time larger than the patch after warping)\n    CvSize GetInputPatchSize() const\n    {\n        return cvSize(m_patch_size.width*2, m_patch_size.height*2);\n    }\n\n    // GetPatch: returns a patch corresponding to specified pose index\n    // - index: pose index\n    // - return value: the patch corresponding to specified pose index\n    IplImage* GetPatch(int index);\n\n    // GetPose: returns a pose corresponding to specified pose index\n    // - index: pose index\n    // - return value: the pose corresponding to specified pose index\n    CvAffinePose GetPose(int index) const;\n\n    // Save: saves all patches with different poses to a specified path\n    void Save(const char* path);\n\n    // ReadByName: reads a descriptor from a file storage\n    // - fs: file storage\n    // - parent: parent node\n    // - name: node name\n    // - return value: 1 if succeeded, 0 otherwise\n    int ReadByName(CvFileStorage* fs, CvFileNode* parent, const char* name);\n\n    // ReadByName: reads a descriptor from a file node\n    // - parent: parent node\n    // - name: node name\n    // - return value: 1 if succeeded, 0 otherwise\n    int ReadByName(const FileNode &parent, const char* name);\n\n    // Write: writes a descriptor into a file storage\n    // - fs: file storage\n    // - name: node name\n    void Write(CvFileStorage* fs, const char* name);\n\n    // GetFeatureName: returns a name corresponding to a feature\n    const char* GetFeatureName() const;\n\n    // GetCenter: returns the center of the feature\n    CvPoint GetCenter() const;\n\n    void SetPCADimHigh(int pca_dim_high) {m_pca_dim_high = pca_dim_high;};\n    void SetPCADimLow(int pca_dim_low) {m_pca_dim_low = pca_dim_low;};\n\n    int GetPCADimLow() const;\n    int GetPCADimHigh() const;\n\n    CvMat** GetPCACoeffs() const {return m_pca_coeffs;}\n\nprotected:\n    int m_pose_count; // the number of poses\n    CvSize m_patch_size; // size of each image\n    IplImage** m_samples; // an array of length m_pose_count containing the patch in different poses\n    IplImage* m_input_patch;\n    IplImage* m_train_patch;\n    CvMat** m_pca_coeffs; // an array of length m_pose_count containing pca decomposition of the patch in different poses\n    CvAffinePose* m_affine_poses; // an array of poses\n    CvMat** m_transforms; // an array of affine transforms corresponding to poses\n\n    string m_feature_name; // the name of the feature associated with the descriptor\n    CvPoint m_center; // the coordinates of the feature (the center of the input image ROI)\n\n    int m_pca_dim_high; // the number of descriptor pca components to use for generating affine poses\n    int m_pca_dim_low; // the number of pca components to use for comparison\n};\n\n\n// OneWayDescriptorBase: encapsulates functionality for training/loading a set of one way descriptors\n// and finding the nearest closest descriptor to an input feature\nclass CV_EXPORTS OneWayDescriptorBase\n{\npublic:\n\n    // creates an instance of OneWayDescriptor from a set of training files\n    // - patch_size: size of the input (large) patch\n    // - pose_count: the number of poses to generate for each descriptor\n    // - train_path: path to training files\n    // - pca_config: the name of the file that contains PCA for small patches (2 times smaller\n    // than patch_size each dimension\n    // - pca_hr_config: the name of the file that contains PCA for large patches (of patch_size size)\n    // - pca_desc_config: the name of the file that contains descriptors of PCA components\n    OneWayDescriptorBase(CvSize patch_size, int pose_count, const char* train_path = 0, const char* pca_config = 0,\n                         const char* pca_hr_config = 0, const char* pca_desc_config = 0, int pyr_levels = 1,\n                         int pca_dim_high = 100, int pca_dim_low = 100);\n\n    OneWayDescriptorBase(CvSize patch_size, int pose_count, const string &pca_filename, const string &train_path = string(), const string &images_list = string(),\n                         float _scale_min = 0.7f, float _scale_max=1.5f, float _scale_step=1.2f, int pyr_levels = 1,\n                         int pca_dim_high = 100, int pca_dim_low = 100);\n\n\n    virtual ~OneWayDescriptorBase();\n    void clear ();\n\n\n    // Allocate: allocates memory for a given number of descriptors\n    void Allocate(int train_feature_count);\n\n    // AllocatePCADescriptors: allocates memory for pca descriptors\n    void AllocatePCADescriptors();\n\n    // returns patch size\n    CvSize GetPatchSize() const {return m_patch_size;};\n    // returns the number of poses for each descriptor\n    int GetPoseCount() const {return m_pose_count;};\n\n    // returns the number of pyramid levels\n    int GetPyrLevels() const {return m_pyr_levels;};\n\n    // returns the number of descriptors\n    int GetDescriptorCount() const {return m_train_feature_count;};\n\n    // CreateDescriptorsFromImage: creates descriptors for each of the input features\n    // - src: input image\n    // - features: input features\n    // - pyr_levels: the number of pyramid levels\n    void CreateDescriptorsFromImage(IplImage* src, const vector<KeyPoint>& features);\n\n    // CreatePCADescriptors: generates descriptors for PCA components, needed for fast generation of feature descriptors\n    void CreatePCADescriptors();\n\n    // returns a feature descriptor by feature index\n    const OneWayDescriptor* GetDescriptor(int desc_idx) const {return &m_descriptors[desc_idx];};\n\n    // FindDescriptor: finds the closest descriptor\n    // - patch: input image patch\n    // - desc_idx: output index of the closest descriptor to the input patch\n    // - pose_idx: output index of the closest pose of the closest descriptor to the input patch\n    // - distance: distance from the input patch to the closest feature pose\n    // - _scales: scales of the input patch for each descriptor\n    // - scale_ranges: input scales variation (float[2])\n    void FindDescriptor(IplImage* patch, int& desc_idx, int& pose_idx, float& distance, float* _scale = 0, float* scale_ranges = 0) const;\n\n    // - patch: input image patch\n    // - n: number of the closest indexes\n    // - desc_idxs: output indexes of the closest descriptor to the input patch (n)\n    // - pose_idx: output indexes of the closest pose of the closest descriptor to the input patch (n)\n    // - distances: distance from the input patch to the closest feature pose (n)\n    // - _scales: scales of the input patch\n    // - scale_ranges: input scales variation (float[2])\n    void FindDescriptor(IplImage* patch, int n, vector<int>& desc_idxs, vector<int>& pose_idxs,\n                        vector<float>& distances, vector<float>& _scales, float* scale_ranges = 0) const;\n\n    // FindDescriptor: finds the closest descriptor\n    // - src: input image\n    // - pt: center of the feature\n    // - desc_idx: output index of the closest descriptor to the input patch\n    // - pose_idx: output index of the closest pose of the closest descriptor to the input patch\n    // - distance: distance from the input patch to the closest feature pose\n    void FindDescriptor(IplImage* src, cv::Point2f pt, int& desc_idx, int& pose_idx, float& distance) const;\n\n    // InitializePoses: generates random poses\n    void InitializePoses();\n\n    // InitializeTransformsFromPoses: generates 2x3 affine matrices from poses (initializes m_transforms)\n    void InitializeTransformsFromPoses();\n\n    // InitializePoseTransforms: subsequently calls InitializePoses and InitializeTransformsFromPoses\n    void InitializePoseTransforms();\n\n    // InitializeDescriptor: initializes a descriptor\n    // - desc_idx: descriptor index\n    // - train_image: image patch (ROI is supported)\n    // - feature_label: feature textual label\n    void InitializeDescriptor(int desc_idx, IplImage* train_image, const char* feature_label);\n\n    void InitializeDescriptor(int desc_idx, IplImage* train_image, const KeyPoint& keypoint, const char* feature_label);\n\n    // InitializeDescriptors: load features from an image and create descriptors for each of them\n    void InitializeDescriptors(IplImage* train_image, const vector<KeyPoint>& features,\n                               const char* feature_label = \"\", int desc_start_idx = 0);\n\n    // Write: writes this object to a file storage\n    // - fs: output filestorage\n    void Write (FileStorage &fs) const;\n\n    // Read: reads OneWayDescriptorBase object from a file node\n    // - fn: input file node\n    void Read (const FileNode &fn);\n\n    // LoadPCADescriptors: loads PCA descriptors from a file\n    // - filename: input filename\n    int LoadPCADescriptors(const char* filename);\n\n    // LoadPCADescriptors: loads PCA descriptors from a file node\n    // - fn: input file node\n    int LoadPCADescriptors(const FileNode &fn);\n\n    // SavePCADescriptors: saves PCA descriptors to a file\n    // - filename: output filename\n    void SavePCADescriptors(const char* filename);\n\n    // SavePCADescriptors: saves PCA descriptors to a file storage\n    // - fs: output file storage\n    void SavePCADescriptors(CvFileStorage* fs) const;\n\n    // GeneratePCA: calculate and save PCA components and descriptors\n    // - img_path: path to training PCA images directory\n    // - images_list: filename with filenames of training PCA images\n    void GeneratePCA(const char* img_path, const char* images_list, int pose_count=500);\n\n    // SetPCAHigh: sets the high resolution pca matrices (copied to internal structures)\n    void SetPCAHigh(CvMat* avg, CvMat* eigenvectors);\n\n    // SetPCALow: sets the low resolution pca matrices (copied to internal structures)\n    void SetPCALow(CvMat* avg, CvMat* eigenvectors);\n\n    int GetLowPCA(CvMat** avg, CvMat** eigenvectors)\n    {\n        *avg = m_pca_avg;\n        *eigenvectors = m_pca_eigenvectors;\n        return m_pca_dim_low;\n    };\n\n    int GetPCADimLow() const {return m_pca_dim_low;};\n    int GetPCADimHigh() const {return m_pca_dim_high;};\n\n    void ConvertDescriptorsArrayToTree(); // Converting pca_descriptors array to KD tree\n\n    // GetPCAFilename: get default PCA filename\n    static string GetPCAFilename () { return \"pca.yml\"; }\n\n    virtual bool empty() const { return m_train_feature_count <= 0 ? true : false; }\n\nprotected:\n    CvSize m_patch_size; // patch size\n    int m_pose_count; // the number of poses for each descriptor\n    int m_train_feature_count; // the number of the training features\n    OneWayDescriptor* m_descriptors; // array of train feature descriptors\n    CvMat* m_pca_avg; // PCA average Vector for small patches\n    CvMat* m_pca_eigenvectors; // PCA eigenvectors for small patches\n    CvMat* m_pca_hr_avg; // PCA average Vector for large patches\n    CvMat* m_pca_hr_eigenvectors; // PCA eigenvectors for large patches\n    OneWayDescriptor* m_pca_descriptors; // an array of PCA descriptors\n\n    cv::flann::Index* m_pca_descriptors_tree;\n    CvMat* m_pca_descriptors_matrix;\n\n    CvAffinePose* m_poses; // array of poses\n    CvMat** m_transforms; // array of affine transformations corresponding to poses\n\n    int m_pca_dim_high;\n    int m_pca_dim_low;\n\n    int m_pyr_levels;\n    float scale_min;\n    float scale_max;\n    float scale_step;\n\n    // SavePCAall: saves PCA components and descriptors to a file storage\n    // - fs: output file storage\n    void SavePCAall (FileStorage &fs) const;\n\n    // LoadPCAall: loads PCA components and descriptors from a file node\n    // - fn: input file node\n    void LoadPCAall (const FileNode &fn);\n};\n\nclass CV_EXPORTS OneWayDescriptorObject : public OneWayDescriptorBase\n{\npublic:\n    // creates an instance of OneWayDescriptorObject from a set of training files\n    // - patch_size: size of the input (large) patch\n    // - pose_count: the number of poses to generate for each descriptor\n    // - train_path: path to training files\n    // - pca_config: the name of the file that contains PCA for small patches (2 times smaller\n    // than patch_size each dimension\n    // - pca_hr_config: the name of the file that contains PCA for large patches (of patch_size size)\n    // - pca_desc_config: the name of the file that contains descriptors of PCA components\n    OneWayDescriptorObject(CvSize patch_size, int pose_count, const char* train_path, const char* pca_config,\n                           const char* pca_hr_config = 0, const char* pca_desc_config = 0, int pyr_levels = 1);\n\n    OneWayDescriptorObject(CvSize patch_size, int pose_count, const string &pca_filename,\n                           const string &train_path = string (), const string &images_list = string (),\n                           float _scale_min = 0.7f, float _scale_max=1.5f, float _scale_step=1.2f, int pyr_levels = 1);\n\n\n    virtual ~OneWayDescriptorObject();\n\n    // Allocate: allocates memory for a given number of features\n    // - train_feature_count: the total number of features\n    // - object_feature_count: the number of features extracted from the object\n    void Allocate(int train_feature_count, int object_feature_count);\n\n\n    void SetLabeledFeatures(const vector<KeyPoint>& features) {m_train_features = features;};\n    vector<KeyPoint>& GetLabeledFeatures() {return m_train_features;};\n    const vector<KeyPoint>& GetLabeledFeatures() const {return m_train_features;};\n    vector<KeyPoint> _GetLabeledFeatures() const;\n\n    // IsDescriptorObject: returns 1 if descriptor with specified index is positive, otherwise 0\n    int IsDescriptorObject(int desc_idx) const;\n\n    // MatchPointToPart: returns the part number of a feature if it matches one of the object parts, otherwise -1\n    int MatchPointToPart(CvPoint pt) const;\n\n    // GetDescriptorPart: returns the part number of the feature corresponding to a specified descriptor\n    // - desc_idx: descriptor index\n    int GetDescriptorPart(int desc_idx) const;\n\n\n    void InitializeObjectDescriptors(IplImage* train_image, const vector<KeyPoint>& features,\n                                     const char* feature_label, int desc_start_idx = 0, float scale = 1.0f,\n                                     int is_background = 0);\n\n    // GetObjectFeatureCount: returns the number of object features\n    int GetObjectFeatureCount() const {return m_object_feature_count;};\n\nprotected:\n    int* m_part_id; // contains part id for each of object descriptors\n    vector<KeyPoint> m_train_features; // train features\n    int m_object_feature_count; // the number of the positive features\n\n};\n\n\n/*\n *  OneWayDescriptorMatcher\n */\nclass OneWayDescriptorMatcher;\ntypedef OneWayDescriptorMatcher OneWayDescriptorMatch;\n\nclass CV_EXPORTS OneWayDescriptorMatcher : public GenericDescriptorMatcher\n{\npublic:\n    class CV_EXPORTS Params\n    {\n    public:\n        static const int POSE_COUNT = 500;\n        static const int PATCH_WIDTH = 24;\n        static const int PATCH_HEIGHT = 24;\n        static float GET_MIN_SCALE() { return 0.7f; }\n        static float GET_MAX_SCALE() { return 1.5f; }\n        static float GET_STEP_SCALE() { return 1.2f; }\n\n        Params( int poseCount = POSE_COUNT,\n               Size patchSize = Size(PATCH_WIDTH, PATCH_HEIGHT),\n               string pcaFilename = string(),\n               string trainPath = string(), string trainImagesList = string(),\n               float minScale = GET_MIN_SCALE(), float maxScale = GET_MAX_SCALE(),\n               float stepScale = GET_STEP_SCALE() );\n\n        int poseCount;\n        Size patchSize;\n        string pcaFilename;\n        string trainPath;\n        string trainImagesList;\n\n        float minScale, maxScale, stepScale;\n    };\n\n    OneWayDescriptorMatcher( const Params& params=Params() );\n    virtual ~OneWayDescriptorMatcher();\n\n    void initialize( const Params& params, const Ptr<OneWayDescriptorBase>& base=Ptr<OneWayDescriptorBase>() );\n\n    // Clears keypoints storing in collection and OneWayDescriptorBase\n    virtual void clear();\n\n    virtual void train();\n\n    virtual bool isMaskSupported();\n\n    virtual void read( const FileNode &fn );\n    virtual void write( FileStorage& fs ) const;\n\n    virtual bool empty() const;\n\n    virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const;\n\nprotected:\n    // Matches a set of keypoints from a single image of the training set. A rectangle with a center in a keypoint\n    // and size (patch_width/2*scale, patch_height/2*scale) is cropped from the source image for each\n    // keypoint. scale is iterated from DescriptorOneWayParams::min_scale to DescriptorOneWayParams::max_scale.\n    // The minimum distance to each training patch with all its affine poses is found over all scales.\n    // The class ID of a match is returned for each keypoint. The distance is calculated over PCA components\n    // loaded with DescriptorOneWay::Initialize, kd tree is used for finding minimum distances.\n    virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                              vector<vector<DMatch> >& matches, int k,\n                              const vector<Mat>& masks, bool compactResult );\n    virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                                 vector<vector<DMatch> >& matches, float maxDistance,\n                                 const vector<Mat>& masks, bool compactResult );\n\n    Ptr<OneWayDescriptorBase> base;\n    Params params;\n    int prevTrainCount;\n};\n\n/*\n *  FernDescriptorMatcher\n */\nclass FernDescriptorMatcher;\ntypedef FernDescriptorMatcher FernDescriptorMatch;\n\nclass CV_EXPORTS FernDescriptorMatcher : public GenericDescriptorMatcher\n{\npublic:\n    class CV_EXPORTS Params\n    {\n    public:\n        Params( int nclasses=0,\n               int patchSize=FernClassifier::PATCH_SIZE,\n               int signatureSize=FernClassifier::DEFAULT_SIGNATURE_SIZE,\n               int nstructs=FernClassifier::DEFAULT_STRUCTS,\n               int structSize=FernClassifier::DEFAULT_STRUCT_SIZE,\n               int nviews=FernClassifier::DEFAULT_VIEWS,\n               int compressionMethod=FernClassifier::COMPRESSION_NONE,\n               const PatchGenerator& patchGenerator=PatchGenerator() );\n\n        Params( const string& filename );\n\n        int nclasses;\n        int patchSize;\n        int signatureSize;\n        int nstructs;\n        int structSize;\n        int nviews;\n        int compressionMethod;\n        PatchGenerator patchGenerator;\n\n        string filename;\n    };\n\n    FernDescriptorMatcher( const Params& params=Params() );\n    virtual ~FernDescriptorMatcher();\n\n    virtual void clear();\n\n    virtual void train();\n\n    virtual bool isMaskSupported();\n\n    virtual void read( const FileNode &fn );\n    virtual void write( FileStorage& fs ) const;\n    virtual bool empty() const;\n\n    virtual Ptr<GenericDescriptorMatcher> clone( bool emptyTrainData=false ) const;\n\nprotected:\n    virtual void knnMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                              vector<vector<DMatch> >& matches, int k,\n                              const vector<Mat>& masks, bool compactResult );\n    virtual void radiusMatchImpl( const Mat& queryImage, vector<KeyPoint>& queryKeypoints,\n                                 vector<vector<DMatch> >& matches, float maxDistance,\n                                 const vector<Mat>& masks, bool compactResult );\n\n    void trainFernClassifier();\n    void calcBestProbAndMatchIdx( const Mat& image, const Point2f& pt,\n                                 float& bestProb, int& bestMatchIdx, vector<float>& signature );\n    Ptr<FernClassifier> classifier;\n    Params params;\n    int prevTrainCount;\n};\n\n\n/*\n * CalonderDescriptorExtractor\n */\ntemplate<typename T>\nclass CV_EXPORTS CalonderDescriptorExtractor : public DescriptorExtractor\n{\npublic:\n    CalonderDescriptorExtractor( const string& classifierFile );\n\n    virtual void read( const FileNode &fn );\n    virtual void write( FileStorage &fs ) const;\n\n    virtual int descriptorSize() const { return classifier_.classes(); }\n    virtual int descriptorType() const { return DataType<T>::type; }\n\n    virtual bool empty() const;\n\nprotected:\n    virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;\n\n    RTreeClassifier classifier_;\n    static const int BORDER_SIZE = 16;\n};\n\ntemplate<typename T>\nCalonderDescriptorExtractor<T>::CalonderDescriptorExtractor(const std::string& classifier_file)\n{\n    classifier_.read( classifier_file.c_str() );\n}\n\ntemplate<typename T>\nvoid CalonderDescriptorExtractor<T>::computeImpl( const Mat& image,\n                                                 vector<KeyPoint>& keypoints,\n                                                 Mat& descriptors) const\n{\n    // Cannot compute descriptors for keypoints on the image border.\n    KeyPointsFilter::runByImageBorder(keypoints, image.size(), BORDER_SIZE);\n\n    /// @todo Check 16-byte aligned\n    descriptors.create((int)keypoints.size(), classifier_.classes(), cv::DataType<T>::type);\n\n    int patchSize = RandomizedTree::PATCH_SIZE;\n    int offset = patchSize / 2;\n    for (size_t i = 0; i < keypoints.size(); ++i)\n    {\n        cv::Point2f pt = keypoints[i].pt;\n        IplImage ipl = image( Rect((int)(pt.x - offset), (int)(pt.y - offset), patchSize, patchSize) );\n        classifier_.getSignature( &ipl, descriptors.ptr<T>((int)i));\n    }\n}\n\ntemplate<typename T>\nvoid CalonderDescriptorExtractor<T>::read( const FileNode& )\n{}\n\ntemplate<typename T>\nvoid CalonderDescriptorExtractor<T>::write( FileStorage& ) const\n{}\n\ntemplate<typename T>\nbool CalonderDescriptorExtractor<T>::empty() const\n{\n    return classifier_.trees_.empty();\n}\n\n\n////////////////////// Brute Force Matcher //////////////////////////\n\ntemplate<class Distance>\nclass CV_EXPORTS BruteForceMatcher : public BFMatcher\n{\npublic:\n    BruteForceMatcher( Distance d = Distance() ) : BFMatcher(Distance::normType, false) {(void)d;}\n    virtual ~BruteForceMatcher() {}\n};\n\n\n/****************************************************************************************\\\n*                                Planar Object Detection                                 *\n\\****************************************************************************************/\n\nclass CV_EXPORTS PlanarObjectDetector\n{\npublic:\n    PlanarObjectDetector();\n    PlanarObjectDetector(const FileNode& node);\n    PlanarObjectDetector(const vector<Mat>& pyr, int _npoints=300,\n                         int _patchSize=FernClassifier::PATCH_SIZE,\n                         int _nstructs=FernClassifier::DEFAULT_STRUCTS,\n                         int _structSize=FernClassifier::DEFAULT_STRUCT_SIZE,\n                         int _nviews=FernClassifier::DEFAULT_VIEWS,\n                         const LDetector& detector=LDetector(),\n                         const PatchGenerator& patchGenerator=PatchGenerator());\n    virtual ~PlanarObjectDetector();\n    virtual void train(const vector<Mat>& pyr, int _npoints=300,\n                       int _patchSize=FernClassifier::PATCH_SIZE,\n                       int _nstructs=FernClassifier::DEFAULT_STRUCTS,\n                       int _structSize=FernClassifier::DEFAULT_STRUCT_SIZE,\n                       int _nviews=FernClassifier::DEFAULT_VIEWS,\n                       const LDetector& detector=LDetector(),\n                       const PatchGenerator& patchGenerator=PatchGenerator());\n    virtual void train(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,\n                       int _patchSize=FernClassifier::PATCH_SIZE,\n                       int _nstructs=FernClassifier::DEFAULT_STRUCTS,\n                       int _structSize=FernClassifier::DEFAULT_STRUCT_SIZE,\n                       int _nviews=FernClassifier::DEFAULT_VIEWS,\n                       const LDetector& detector=LDetector(),\n                       const PatchGenerator& patchGenerator=PatchGenerator());\n    Rect getModelROI() const;\n    vector<KeyPoint> getModelPoints() const;\n    const LDetector& getDetector() const;\n    const FernClassifier& getClassifier() const;\n    void setVerbose(bool verbose);\n\n    void read(const FileNode& node);\n    void write(FileStorage& fs, const String& name=String()) const;\n    bool operator()(const Mat& image, CV_OUT Mat& H, CV_OUT vector<Point2f>& corners) const;\n    bool operator()(const vector<Mat>& pyr, const vector<KeyPoint>& keypoints,\n                    CV_OUT Mat& H, CV_OUT vector<Point2f>& corners,\n                    CV_OUT vector<int>* pairs=0) const;\n\nprotected:\n    bool verbose;\n    Rect modelROI;\n    vector<KeyPoint> modelPoints;\n    LDetector ldetector;\n    FernClassifier fernClassifier;\n};\n\n}\n\n// 2009-01-12, Xavier Delacour <xavier.delacour@gmail.com>\n\nstruct lsh_hash {\n    int h1, h2;\n};\n\nstruct CvLSHOperations\n{\n    virtual ~CvLSHOperations() {}\n\n    virtual int vector_add(const void* data) = 0;\n    virtual void vector_remove(int i) = 0;\n    virtual const void* vector_lookup(int i) = 0;\n    virtual void vector_reserve(int n) = 0;\n    virtual unsigned int vector_count() = 0;\n\n    virtual void hash_insert(lsh_hash h, int l, int i) = 0;\n    virtual void hash_remove(lsh_hash h, int l, int i) = 0;\n    virtual int hash_lookup(lsh_hash h, int l, int* ret_i, int ret_i_max) = 0;\n};\n\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* Splits color or grayscale image into multiple connected components\n of nearly the same color/brightness using modification of Burt algorithm.\n comp with contain a pointer to sequence (CvSeq)\n of connected components (CvConnectedComp) */\nCVAPI(void) cvPyrSegmentation( IplImage* src, IplImage* dst,\n                              CvMemStorage* storage, CvSeq** comp,\n                              int level, double threshold1,\n                              double threshold2 );\n\n/****************************************************************************************\\\n*                              Planar subdivisions                                       *\n\\****************************************************************************************/\n\n/* Initializes Delaunay triangulation */\nCVAPI(void)  cvInitSubdivDelaunay2D( CvSubdiv2D* subdiv, CvRect rect );\n\n/* Creates new subdivision */\nCVAPI(CvSubdiv2D*)  cvCreateSubdiv2D( int subdiv_type, int header_size,\n                                     int vtx_size, int quadedge_size,\n                                     CvMemStorage* storage );\n\n/************************* high-level subdivision functions ***************************/\n\n/* Simplified Delaunay diagram creation */\nCV_INLINE  CvSubdiv2D* cvCreateSubdivDelaunay2D( CvRect rect, CvMemStorage* storage )\n{\n    CvSubdiv2D* subdiv = cvCreateSubdiv2D( CV_SEQ_KIND_SUBDIV2D, sizeof(*subdiv),\n                                          sizeof(CvSubdiv2DPoint), sizeof(CvQuadEdge2D), storage );\n\n    cvInitSubdivDelaunay2D( subdiv, rect );\n    return subdiv;\n}\n\n\n/* Inserts new point to the Delaunay triangulation */\nCVAPI(CvSubdiv2DPoint*)  cvSubdivDelaunay2DInsert( CvSubdiv2D* subdiv, CvPoint2D32f pt);\n\n/* Locates a point within the Delaunay triangulation (finds the edge\n the point is left to or belongs to, or the triangulation point the given\n point coinsides with */\nCVAPI(CvSubdiv2DPointLocation)  cvSubdiv2DLocate(\n                                                 CvSubdiv2D* subdiv, CvPoint2D32f pt,\n                                                 CvSubdiv2DEdge* edge,\n                                                 CvSubdiv2DPoint** vertex CV_DEFAULT(NULL) );\n\n/* Calculates Voronoi tesselation (i.e. coordinates of Voronoi points) */\nCVAPI(void)  cvCalcSubdivVoronoi2D( CvSubdiv2D* subdiv );\n\n\n/* Removes all Voronoi points from the tesselation */\nCVAPI(void)  cvClearSubdivVoronoi2D( CvSubdiv2D* subdiv );\n\n\n/* Finds the nearest to the given point vertex in subdivision. */\nCVAPI(CvSubdiv2DPoint*) cvFindNearestPoint2D( CvSubdiv2D* subdiv, CvPoint2D32f pt );\n\n\n/************ Basic quad-edge navigation and operations ************/\n\nCV_INLINE  CvSubdiv2DEdge  cvSubdiv2DNextEdge( CvSubdiv2DEdge edge )\n{\n    return  CV_SUBDIV2D_NEXT_EDGE(edge);\n}\n\n\nCV_INLINE  CvSubdiv2DEdge  cvSubdiv2DRotateEdge( CvSubdiv2DEdge edge, int rotate )\n{\n    return  (edge & ~3) + ((edge + rotate) & 3);\n}\n\nCV_INLINE  CvSubdiv2DEdge  cvSubdiv2DSymEdge( CvSubdiv2DEdge edge )\n{\n    return edge ^ 2;\n}\n\nCV_INLINE  CvSubdiv2DEdge  cvSubdiv2DGetEdge( CvSubdiv2DEdge edge, CvNextEdgeType type )\n{\n    CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3);\n    edge = e->next[(edge + (int)type) & 3];\n    return  (edge & ~3) + ((edge + ((int)type >> 4)) & 3);\n}\n\n\nCV_INLINE  CvSubdiv2DPoint*  cvSubdiv2DEdgeOrg( CvSubdiv2DEdge edge )\n{\n    CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3);\n    return (CvSubdiv2DPoint*)e->pt[edge & 3];\n}\n\n\nCV_INLINE  CvSubdiv2DPoint*  cvSubdiv2DEdgeDst( CvSubdiv2DEdge edge )\n{\n    CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3);\n    return (CvSubdiv2DPoint*)e->pt[(edge + 2) & 3];\n}\n\n/****************************************************************************************\\\n*                           Additional operations on Subdivisions                        *\n\\****************************************************************************************/\n\n// paints voronoi diagram: just demo function\nCVAPI(void)  icvDrawMosaic( CvSubdiv2D* subdiv, IplImage* src, IplImage* dst );\n\n// checks planar subdivision for correctness. It is not an absolute check,\n// but it verifies some relations between quad-edges\nCVAPI(int)   icvSubdiv2DCheck( CvSubdiv2D* subdiv );\n\n// returns squared distance between two 2D points with floating-point coordinates.\nCV_INLINE double icvSqDist2D32f( CvPoint2D32f pt1, CvPoint2D32f pt2 )\n{\n    double dx = pt1.x - pt2.x;\n    double dy = pt1.y - pt2.y;\n\n    return dx*dx + dy*dy;\n}\n\n\n\n\nCV_INLINE  double  cvTriangleArea( CvPoint2D32f a, CvPoint2D32f b, CvPoint2D32f c )\n{\n    return ((double)b.x - a.x) * ((double)c.y - a.y) - ((double)b.y - a.y) * ((double)c.x - a.x);\n}\n\n\n/* Constructs kd-tree from set of feature descriptors */\nCVAPI(struct CvFeatureTree*) cvCreateKDTree(CvMat* desc);\n\n/* Constructs spill-tree from set of feature descriptors */\nCVAPI(struct CvFeatureTree*) cvCreateSpillTree( const CvMat* raw_data,\n                                               const int naive CV_DEFAULT(50),\n                                               const double rho CV_DEFAULT(.7),\n                                               const double tau CV_DEFAULT(.1) );\n\n/* Release feature tree */\nCVAPI(void) cvReleaseFeatureTree(struct CvFeatureTree* tr);\n\n/* Searches feature tree for k nearest neighbors of given reference points,\n searching (in case of kd-tree/bbf) at most emax leaves. */\nCVAPI(void) cvFindFeatures(struct CvFeatureTree* tr, const CvMat* query_points,\n                           CvMat* indices, CvMat* dist, int k, int emax CV_DEFAULT(20));\n\n/* Search feature tree for all points that are inlier to given rect region.\n Only implemented for kd trees */\nCVAPI(int) cvFindFeaturesBoxed(struct CvFeatureTree* tr,\n                               CvMat* bounds_min, CvMat* bounds_max,\n                               CvMat* out_indices);\n\n\n/* Construct a Locality Sensitive Hash (LSH) table, for indexing d-dimensional vectors of\n given type. Vectors will be hashed L times with k-dimensional p-stable (p=2) functions. */\nCVAPI(struct CvLSH*) cvCreateLSH(struct CvLSHOperations* ops, int d,\n                                 int L CV_DEFAULT(10), int k CV_DEFAULT(10),\n                                 int type CV_DEFAULT(CV_64FC1), double r CV_DEFAULT(4),\n                                 int64 seed CV_DEFAULT(-1));\n\n/* Construct in-memory LSH table, with n bins. */\nCVAPI(struct CvLSH*) cvCreateMemoryLSH(int d, int n, int L CV_DEFAULT(10), int k CV_DEFAULT(10),\n                                       int type CV_DEFAULT(CV_64FC1), double r CV_DEFAULT(4),\n                                       int64 seed CV_DEFAULT(-1));\n\n/* Free the given LSH structure. */\nCVAPI(void) cvReleaseLSH(struct CvLSH** lsh);\n\n/* Return the number of vectors in the LSH. */\nCVAPI(unsigned int) LSHSize(struct CvLSH* lsh);\n\n/* Add vectors to the LSH structure, optionally returning indices. */\nCVAPI(void) cvLSHAdd(struct CvLSH* lsh, const CvMat* data, CvMat* indices CV_DEFAULT(0));\n\n/* Remove vectors from LSH, as addressed by given indices. */\nCVAPI(void) cvLSHRemove(struct CvLSH* lsh, const CvMat* indices);\n\n/* Query the LSH n times for at most k nearest points; data is n x d,\n indices and dist are n x k. At most emax stored points will be accessed. */\nCVAPI(void) cvLSHQuery(struct CvLSH* lsh, const CvMat* query_points,\n                       CvMat* indices, CvMat* dist, int k, int emax);\n\n/* Kolmogorov-Zabin stereo-correspondence algorithm (a.k.a. KZ1) */\n#define CV_STEREO_GC_OCCLUDED  SHRT_MAX\n\ntypedef struct CvStereoGCState\n{\n    int Ithreshold;\n    int interactionRadius;\n    float K, lambda, lambda1, lambda2;\n    int occlusionCost;\n    int minDisparity;\n    int numberOfDisparities;\n    int maxIters;\n\n    CvMat* left;\n    CvMat* right;\n    CvMat* dispLeft;\n    CvMat* dispRight;\n    CvMat* ptrLeft;\n    CvMat* ptrRight;\n    CvMat* vtxBuf;\n    CvMat* edgeBuf;\n} CvStereoGCState;\n\nCVAPI(CvStereoGCState*) cvCreateStereoGCState( int numberOfDisparities, int maxIters );\nCVAPI(void) cvReleaseStereoGCState( CvStereoGCState** state );\n\nCVAPI(void) cvFindStereoCorrespondenceGC( const CvArr* left, const CvArr* right,\n                                         CvArr* disparityLeft, CvArr* disparityRight,\n                                         CvStereoGCState* state,\n                                         int useDisparityGuess CV_DEFAULT(0) );\n\n/* Calculates optical flow for 2 images using classical Lucas & Kanade algorithm */\nCVAPI(void)  cvCalcOpticalFlowLK( const CvArr* prev, const CvArr* curr,\n                                 CvSize win_size, CvArr* velx, CvArr* vely );\n\n/* Calculates optical flow for 2 images using block matching algorithm */\nCVAPI(void)  cvCalcOpticalFlowBM( const CvArr* prev, const CvArr* curr,\n                                 CvSize block_size, CvSize shift_size,\n                                 CvSize max_range, int use_previous,\n                                 CvArr* velx, CvArr* vely );\n\n/* Calculates Optical flow for 2 images using Horn & Schunck algorithm */\nCVAPI(void)  cvCalcOpticalFlowHS( const CvArr* prev, const CvArr* curr,\n                                 int use_previous, CvArr* velx, CvArr* vely,\n                                 double lambda, CvTermCriteria criteria );\n\n\n/****************************************************************************************\\\n*                           Background/foreground segmentation                           *\n\\****************************************************************************************/\n\n/* We discriminate between foreground and background pixels\n * by building and maintaining a model of the background.\n * Any pixel which does not fit this model is then deemed\n * to be foreground.\n *\n * At present we support two core background models,\n * one of which has two variations:\n *\n *  o CV_BG_MODEL_FGD: latest and greatest algorithm, described in\n *\n *\t Foreground Object Detection from Videos Containing Complex Background.\n *\t Liyuan Li, Weimin Huang, Irene Y.H. Gu, and Qi Tian.\n *\t ACM MM2003 9p\n *\n *  o CV_BG_MODEL_FGD_SIMPLE:\n *       A code comment describes this as a simplified version of the above,\n *       but the code is in fact currently identical\n *\n *  o CV_BG_MODEL_MOG: \"Mixture of Gaussians\", older algorithm, described in\n *\n *       Moving target classification and tracking from real-time video.\n *       A Lipton, H Fujijoshi, R Patil\n *       Proceedings IEEE Workshop on Application of Computer Vision pp 8-14 1998\n *\n *       Learning patterns of activity using real-time tracking\n *       C Stauffer and W Grimson  August 2000\n *       IEEE Transactions on Pattern Analysis and Machine Intelligence 22(8):747-757\n */\n\n\n#define CV_BG_MODEL_FGD\t\t0\n#define CV_BG_MODEL_MOG\t\t1\t\t\t/* \"Mixture of Gaussians\".\t*/\n#define CV_BG_MODEL_FGD_SIMPLE\t2\n\nstruct CvBGStatModel;\n\ntypedef void (CV_CDECL * CvReleaseBGStatModel)( struct CvBGStatModel** bg_model );\ntypedef int (CV_CDECL * CvUpdateBGStatModel)( IplImage* curr_frame, struct CvBGStatModel* bg_model,\n                                             double learningRate );\n\n#define CV_BG_STAT_MODEL_FIELDS()                                               \\\nint             type; /*type of BG model*/                                      \\\nCvReleaseBGStatModel release;                                                   \\\nCvUpdateBGStatModel update;                                                     \\\nIplImage*       background;   /*8UC3 reference background image*/               \\\nIplImage*       foreground;   /*8UC1 foreground image*/                         \\\nIplImage**      layers;       /*8UC3 reference background image, can be null */ \\\nint             layer_count;  /* can be zero */                                 \\\nCvMemStorage*   storage;      /*storage for foreground_regions*/                \\\nCvSeq*          foreground_regions /*foreground object contours*/\n\ntypedef struct CvBGStatModel\n{\n    CV_BG_STAT_MODEL_FIELDS();\n} CvBGStatModel;\n\n//\n\n// Releases memory used by BGStatModel\nCVAPI(void) cvReleaseBGStatModel( CvBGStatModel** bg_model );\n\n// Updates statistical model and returns number of found foreground regions\nCVAPI(int) cvUpdateBGStatModel( IplImage* current_frame, CvBGStatModel*  bg_model,\n                               double learningRate CV_DEFAULT(-1));\n\n// Performs FG post-processing using segmentation\n// (all pixels of a region will be classified as foreground if majority of pixels of the region are FG).\n// parameters:\n//      segments - pointer to result of segmentation (for example MeanShiftSegmentation)\n//      bg_model - pointer to CvBGStatModel structure\nCVAPI(void) cvRefineForegroundMaskBySegm( CvSeq* segments, CvBGStatModel*  bg_model );\n\n/* Common use change detection function */\nCVAPI(int)  cvChangeDetection( IplImage*  prev_frame,\n                              IplImage*  curr_frame,\n                              IplImage*  change_mask );\n\n/*\n Interface of ACM MM2003 algorithm\n */\n\n/* Default parameters of foreground detection algorithm: */\n#define  CV_BGFG_FGD_LC              128\n#define  CV_BGFG_FGD_N1C             15\n#define  CV_BGFG_FGD_N2C             25\n\n#define  CV_BGFG_FGD_LCC             64\n#define  CV_BGFG_FGD_N1CC            25\n#define  CV_BGFG_FGD_N2CC            40\n\n/* Background reference image update parameter: */\n#define  CV_BGFG_FGD_ALPHA_1         0.1f\n\n/* stat model update parameter\n * 0.002f ~ 1K frame(~45sec), 0.005 ~ 18sec (if 25fps and absolutely static BG)\n */\n#define  CV_BGFG_FGD_ALPHA_2         0.005f\n\n/* start value for alpha parameter (to fast initiate statistic model) */\n#define  CV_BGFG_FGD_ALPHA_3         0.1f\n\n#define  CV_BGFG_FGD_DELTA           2\n\n#define  CV_BGFG_FGD_T               0.9f\n\n#define  CV_BGFG_FGD_MINAREA         15.f\n\n#define  CV_BGFG_FGD_BG_UPDATE_TRESH 0.5f\n\n/* See the above-referenced Li/Huang/Gu/Tian paper\n * for a full description of these background-model\n * tuning parameters.\n *\n * Nomenclature:  'c'  == \"color\", a three-component red/green/blue vector.\n *                         We use histograms of these to model the range of\n *                         colors we've seen at a given background pixel.\n *\n *                'cc' == \"color co-occurrence\", a six-component vector giving\n *                         RGB color for both this frame and preceding frame.\n *                             We use histograms of these to model the range of\n *                         color CHANGES we've seen at a given background pixel.\n */\ntypedef struct CvFGDStatModelParams\n{\n    int    Lc;\t\t\t/* Quantized levels per 'color' component. Power of two, typically 32, 64 or 128.\t\t\t\t*/\n    int    N1c;\t\t\t/* Number of color vectors used to model normal background color variation at a given pixel.\t\t\t*/\n    int    N2c;\t\t\t/* Number of color vectors retained at given pixel.  Must be > N1c, typically ~ 5/3 of N1c.\t\t\t*/\n    /* Used to allow the first N1c vectors to adapt over time to changing background.\t\t\t\t*/\n\n    int    Lcc;\t\t\t/* Quantized levels per 'color co-occurrence' component.  Power of two, typically 16, 32 or 64.\t\t\t*/\n    int    N1cc;\t\t/* Number of color co-occurrence vectors used to model normal background color variation at a given pixel.\t*/\n    int    N2cc;\t\t/* Number of color co-occurrence vectors retained at given pixel.  Must be > N1cc, typically ~ 5/3 of N1cc.\t*/\n    /* Used to allow the first N1cc vectors to adapt over time to changing background.\t\t\t\t*/\n\n    int    is_obj_without_holes;/* If TRUE we ignore holes within foreground blobs. Defaults to TRUE.\t\t\t\t\t\t*/\n    int    perform_morphing;\t/* Number of erode-dilate-erode foreground-blob cleanup iterations.\t\t\t\t\t\t*/\n    /* These erase one-pixel junk blobs and merge almost-touching blobs. Default value is 1.\t\t\t*/\n\n    float  alpha1;\t\t/* How quickly we forget old background pixel values seen.  Typically set to 0.1  \t\t\t\t*/\n    float  alpha2;\t\t/* \"Controls speed of feature learning\". Depends on T. Typical value circa 0.005. \t\t\t\t*/\n    float  alpha3;\t\t/* Alternate to alpha2, used (e.g.) for quicker initial convergence. Typical value 0.1.\t\t\t\t*/\n\n    float  delta;\t\t/* Affects color and color co-occurrence quantization, typically set to 2.\t\t\t\t\t*/\n    float  T;\t\t\t/* \"A percentage value which determines when new features can be recognized as new background.\" (Typically 0.9).*/\n    float  minArea;\t\t/* Discard foreground blobs whose bounding box is smaller than this threshold.\t\t\t\t\t*/\n} CvFGDStatModelParams;\n\ntypedef struct CvBGPixelCStatTable\n{\n    float          Pv, Pvb;\n    uchar          v[3];\n} CvBGPixelCStatTable;\n\ntypedef struct CvBGPixelCCStatTable\n{\n    float          Pv, Pvb;\n    uchar          v[6];\n} CvBGPixelCCStatTable;\n\ntypedef struct CvBGPixelStat\n{\n    float                 Pbc;\n    float                 Pbcc;\n    CvBGPixelCStatTable*  ctable;\n    CvBGPixelCCStatTable* cctable;\n    uchar                 is_trained_st_model;\n    uchar                 is_trained_dyn_model;\n} CvBGPixelStat;\n\n\ntypedef struct CvFGDStatModel\n{\n    CV_BG_STAT_MODEL_FIELDS();\n    CvBGPixelStat*         pixel_stat;\n    IplImage*              Ftd;\n    IplImage*              Fbd;\n    IplImage*              prev_frame;\n    CvFGDStatModelParams   params;\n} CvFGDStatModel;\n\n/* Creates FGD model */\nCVAPI(CvBGStatModel*) cvCreateFGDStatModel( IplImage* first_frame,\n                                           CvFGDStatModelParams* parameters CV_DEFAULT(NULL));\n\n/*\n Interface of Gaussian mixture algorithm\n\n \"An improved adaptive background mixture model for real-time tracking with shadow detection\"\n P. KadewTraKuPong and R. Bowden,\n Proc. 2nd European Workshp on Advanced Video-Based Surveillance Systems, 2001.\"\n http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf\n */\n\n/* Note:  \"MOG\" == \"Mixture Of Gaussians\": */\n\n#define CV_BGFG_MOG_MAX_NGAUSSIANS 500\n\n/* default parameters of gaussian background detection algorithm */\n#define CV_BGFG_MOG_BACKGROUND_THRESHOLD     0.7     /* threshold sum of weights for background test */\n#define CV_BGFG_MOG_STD_THRESHOLD            2.5     /* lambda=2.5 is 99% */\n#define CV_BGFG_MOG_WINDOW_SIZE              200     /* Learning rate; alpha = 1/CV_GBG_WINDOW_SIZE */\n#define CV_BGFG_MOG_NGAUSSIANS               5       /* = K = number of Gaussians in mixture */\n#define CV_BGFG_MOG_WEIGHT_INIT              0.05\n#define CV_BGFG_MOG_SIGMA_INIT               30\n#define CV_BGFG_MOG_MINAREA                  15.f\n\n\n#define CV_BGFG_MOG_NCOLORS                  3\n\ntypedef struct CvGaussBGStatModelParams\n{\n    int     win_size;               /* = 1/alpha */\n    int     n_gauss;\n    double  bg_threshold, std_threshold, minArea;\n    double  weight_init, variance_init;\n}CvGaussBGStatModelParams;\n\ntypedef struct CvGaussBGValues\n{\n    int         match_sum;\n    double      weight;\n    double      variance[CV_BGFG_MOG_NCOLORS];\n    double      mean[CV_BGFG_MOG_NCOLORS];\n} CvGaussBGValues;\n\ntypedef struct CvGaussBGPoint\n{\n    CvGaussBGValues* g_values;\n} CvGaussBGPoint;\n\n\ntypedef struct CvGaussBGModel\n{\n    CV_BG_STAT_MODEL_FIELDS();\n    CvGaussBGStatModelParams   params;\n    CvGaussBGPoint*            g_point;\n    int                        countFrames;\n    void*                      mog;\n} CvGaussBGModel;\n\n\n/* Creates Gaussian mixture background model */\nCVAPI(CvBGStatModel*) cvCreateGaussianBGModel( IplImage* first_frame,\n                                              CvGaussBGStatModelParams* parameters CV_DEFAULT(NULL));\n\n\ntypedef struct CvBGCodeBookElem\n{\n    struct CvBGCodeBookElem* next;\n    int tLastUpdate;\n    int stale;\n    uchar boxMin[3];\n    uchar boxMax[3];\n    uchar learnMin[3];\n    uchar learnMax[3];\n} CvBGCodeBookElem;\n\ntypedef struct CvBGCodeBookModel\n{\n    CvSize size;\n    int t;\n    uchar cbBounds[3];\n    uchar modMin[3];\n    uchar modMax[3];\n    CvBGCodeBookElem** cbmap;\n    CvMemStorage* storage;\n    CvBGCodeBookElem* freeList;\n} CvBGCodeBookModel;\n\nCVAPI(CvBGCodeBookModel*) cvCreateBGCodeBookModel( void );\nCVAPI(void) cvReleaseBGCodeBookModel( CvBGCodeBookModel** model );\n\nCVAPI(void) cvBGCodeBookUpdate( CvBGCodeBookModel* model, const CvArr* image,\n                               CvRect roi CV_DEFAULT(cvRect(0,0,0,0)),\n                               const CvArr* mask CV_DEFAULT(0) );\n\nCVAPI(int) cvBGCodeBookDiff( const CvBGCodeBookModel* model, const CvArr* image,\n                            CvArr* fgmask, CvRect roi CV_DEFAULT(cvRect(0,0,0,0)) );\n\nCVAPI(void) cvBGCodeBookClearStale( CvBGCodeBookModel* model, int staleThresh,\n                                   CvRect roi CV_DEFAULT(cvRect(0,0,0,0)),\n                                   const CvArr* mask CV_DEFAULT(0) );\n\nCVAPI(CvSeq*) cvSegmentFGMask( CvArr *fgmask, int poly1Hull0 CV_DEFAULT(1),\n                              float perimScale CV_DEFAULT(4.f),\n                              CvMemStorage* storage CV_DEFAULT(0),\n                              CvPoint offset CV_DEFAULT(cvPoint(0,0)));\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/legacy/streams.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_CVSTREAMS_H__\n#define __OPENCV_CVSTREAMS_H__\n\n#ifdef WIN32\n#include <streams.h>  /* !!! IF YOU'VE GOT AN ERROR HERE, PLEASE READ BELOW !!! */\n/***************** How to get Visual Studio understand streams.h ****************\\\n\nYou need DirectShow SDK that is now a part of Platform SDK\n(Windows Server 2003 SP1 SDK or later),\nand DirectX SDK (2006 April or later).\n\n1. Download the Platform SDK from\n   http://www.microsoft.com/msdownload/platformsdk/sdkupdate/\n   and DirectX SDK from msdn.microsoft.com/directx/\n   (They are huge, but you can download it by parts).\n   If it doesn't work for you, consider HighGUI that can capture video via VFW or MIL\n\n2. Install Platform SDK together with DirectShow SDK.\n   Install DirectX (with or without sample code).\n\n3. Build baseclasses.\n   See <PlatformSDKInstallFolder>\\samples\\multimedia\\directshow\\readme.txt.\n\n4. Copy the built libraries (called strmbase.lib and strmbasd.lib\n   in Release and Debug versions, respectively) to\n   <PlatformSDKInstallFolder>\\lib.\n\n5. In Developer Studio add the following paths:\n      <DirectXSDKInstallFolder>\\include\n      <PlatformSDKInstallFolder>\\include\n      <PlatformSDKInstallFolder>\\samples\\multimedia\\directshow\\baseclasses\n    to the includes' search path\n    (at Tools->Options->Directories->Include files in case of Visual Studio 6.0,\n     at Tools->Options->Projects and Solutions->VC++ Directories->Include files in case\n     of Visual Studio 2005)\n   Add\n      <DirectXSDKInstallFolder>\\lib\n      <PlatformSDKInstallFolder>\\lib\n   to the libraries' search path (in the same dialog, ...->\"Library files\" page)\n\n   NOTE: PUT THE ADDED LINES ON THE VERY TOP OF THE LISTS, OTHERWISE YOU MAY STILL GET\n   COMPILER OR LINKER ERRORS. This is necessary, because Visual Studio\n   may include older versions of the same headers and libraries.\n\n6. Now you can build OpenCV DirectShow filters.\n\n\\***********************************************************************************/\n\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/ml/ml.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_ML_HPP__\n#define __OPENCV_ML_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include <limits.h>\n\n#ifdef __cplusplus\n\n#include <map>\n#include <string>\n#include <iostream>\n\n// Apple defines a check() macro somewhere in the debug headers\n// that interferes with a method definiton in this header\n#undef check\n\n/****************************************************************************************\\\n*                               Main struct definitions                                  *\n\\****************************************************************************************/\n\n/* log(2*PI) */\n#define CV_LOG2PI (1.8378770664093454835606594728112)\n\n/* columns of <trainData> matrix are training samples */\n#define CV_COL_SAMPLE 0\n\n/* rows of <trainData> matrix are training samples */\n#define CV_ROW_SAMPLE 1\n\n#define CV_IS_ROW_SAMPLE(flags) ((flags) & CV_ROW_SAMPLE)\n\nstruct CvVectors\n{\n    int type;\n    int dims, count;\n    CvVectors* next;\n    union\n    {\n        uchar** ptr;\n        float** fl;\n        double** db;\n    } data;\n};\n\n#if 0\n/* A structure, representing the lattice range of statmodel parameters.\n   It is used for optimizing statmodel parameters by cross-validation method.\n   The lattice is logarithmic, so <step> must be greater then 1. */\ntypedef struct CvParamLattice\n{\n    double min_val;\n    double max_val;\n    double step;\n}\nCvParamLattice;\n\nCV_INLINE CvParamLattice cvParamLattice( double min_val, double max_val,\n                                         double log_step )\n{\n    CvParamLattice pl;\n    pl.min_val = MIN( min_val, max_val );\n    pl.max_val = MAX( min_val, max_val );\n    pl.step = MAX( log_step, 1. );\n    return pl;\n}\n\nCV_INLINE CvParamLattice cvDefaultParamLattice( void )\n{\n    CvParamLattice pl = {0,0,0};\n    return pl;\n}\n#endif\n\n/* Variable type */\n#define CV_VAR_NUMERICAL    0\n#define CV_VAR_ORDERED      0\n#define CV_VAR_CATEGORICAL  1\n\n#define CV_TYPE_NAME_ML_SVM         \"opencv-ml-svm\"\n#define CV_TYPE_NAME_ML_KNN         \"opencv-ml-knn\"\n#define CV_TYPE_NAME_ML_NBAYES      \"opencv-ml-bayesian\"\n#define CV_TYPE_NAME_ML_EM          \"opencv-ml-em\"\n#define CV_TYPE_NAME_ML_BOOSTING    \"opencv-ml-boost-tree\"\n#define CV_TYPE_NAME_ML_TREE        \"opencv-ml-tree\"\n#define CV_TYPE_NAME_ML_ANN_MLP     \"opencv-ml-ann-mlp\"\n#define CV_TYPE_NAME_ML_CNN         \"opencv-ml-cnn\"\n#define CV_TYPE_NAME_ML_RTREES      \"opencv-ml-random-trees\"\n#define CV_TYPE_NAME_ML_ERTREES     \"opencv-ml-extremely-randomized-trees\"\n#define CV_TYPE_NAME_ML_GBT         \"opencv-ml-gradient-boosting-trees\"\n\n#define CV_TRAIN_ERROR  0\n#define CV_TEST_ERROR   1\n\nclass CV_EXPORTS_W CvStatModel\n{\npublic:\n    CvStatModel();\n    virtual ~CvStatModel();\n\n    virtual void clear();\n\n    CV_WRAP virtual void save( const char* filename, const char* name=0 ) const;\n    CV_WRAP virtual void load( const char* filename, const char* name=0 );\n\n    virtual void write( CvFileStorage* storage, const char* name ) const;\n    virtual void read( CvFileStorage* storage, CvFileNode* node );\n\nprotected:\n    const char* default_model_name;\n};\n\n/****************************************************************************************\\\n*                                 Normal Bayes Classifier                                *\n\\****************************************************************************************/\n\n/* The structure, representing the grid range of statmodel parameters.\n   It is used for optimizing statmodel accuracy by varying model parameters,\n   the accuracy estimate being computed by cross-validation.\n   The grid is logarithmic, so <step> must be greater then 1. */\n\nclass CvMLData;\n\nstruct CV_EXPORTS_W_MAP CvParamGrid\n{\n    // SVM params type\n    enum { SVM_C=0, SVM_GAMMA=1, SVM_P=2, SVM_NU=3, SVM_COEF=4, SVM_DEGREE=5 };\n\n    CvParamGrid()\n    {\n        min_val = max_val = step = 0;\n    }\n\n    CvParamGrid( double min_val, double max_val, double log_step );\n    //CvParamGrid( int param_id );\n    bool check() const;\n\n    CV_PROP_RW double min_val;\n    CV_PROP_RW double max_val;\n    CV_PROP_RW double step;\n};\n\ninline CvParamGrid::CvParamGrid( double _min_val, double _max_val, double _log_step )\n{\n    min_val = _min_val;\n    max_val = _max_val;\n    step = _log_step;\n}\n\nclass CV_EXPORTS_W CvNormalBayesClassifier : public CvStatModel\n{\npublic:\n    CV_WRAP CvNormalBayesClassifier();\n    virtual ~CvNormalBayesClassifier();\n\n    CvNormalBayesClassifier( const CvMat* trainData, const CvMat* responses,\n        const CvMat* varIdx=0, const CvMat* sampleIdx=0 );\n\n    virtual bool train( const CvMat* trainData, const CvMat* responses,\n        const CvMat* varIdx = 0, const CvMat* sampleIdx=0, bool update=false );\n\n    virtual float predict( const CvMat* samples, CV_OUT CvMat* results=0 ) const;\n    CV_WRAP virtual void clear();\n\n    CV_WRAP CvNormalBayesClassifier( const cv::Mat& trainData, const cv::Mat& responses,\n                            const cv::Mat& varIdx=cv::Mat(), const cv::Mat& sampleIdx=cv::Mat() );\n    CV_WRAP virtual bool train( const cv::Mat& trainData, const cv::Mat& responses,\n                       const cv::Mat& varIdx = cv::Mat(), const cv::Mat& sampleIdx=cv::Mat(),\n                       bool update=false );\n    CV_WRAP virtual float predict( const cv::Mat& samples, CV_OUT cv::Mat* results=0 ) const;\n\n    virtual void write( CvFileStorage* storage, const char* name ) const;\n    virtual void read( CvFileStorage* storage, CvFileNode* node );\n\nprotected:\n    int     var_count, var_all;\n    CvMat*  var_idx;\n    CvMat*  cls_labels;\n    CvMat** count;\n    CvMat** sum;\n    CvMat** productsum;\n    CvMat** avg;\n    CvMat** inv_eigen_values;\n    CvMat** cov_rotate_mats;\n    CvMat*  c;\n};\n\n\n/****************************************************************************************\\\n*                          K-Nearest Neighbour Classifier                                *\n\\****************************************************************************************/\n\n// k Nearest Neighbors\nclass CV_EXPORTS_W CvKNearest : public CvStatModel\n{\npublic:\n\n    CV_WRAP CvKNearest();\n    virtual ~CvKNearest();\n\n    CvKNearest( const CvMat* trainData, const CvMat* responses,\n                const CvMat* sampleIdx=0, bool isRegression=false, int max_k=32 );\n\n    virtual bool train( const CvMat* trainData, const CvMat* responses,\n                        const CvMat* sampleIdx=0, bool is_regression=false,\n                        int maxK=32, bool updateBase=false );\n\n    virtual float find_nearest( const CvMat* samples, int k, CV_OUT CvMat* results=0,\n        const float** neighbors=0, CV_OUT CvMat* neighborResponses=0, CV_OUT CvMat* dist=0 ) const;\n\n    CV_WRAP CvKNearest( const cv::Mat& trainData, const cv::Mat& responses,\n               const cv::Mat& sampleIdx=cv::Mat(), bool isRegression=false, int max_k=32 );\n\n    CV_WRAP virtual bool train( const cv::Mat& trainData, const cv::Mat& responses,\n                       const cv::Mat& sampleIdx=cv::Mat(), bool isRegression=false,\n                       int maxK=32, bool updateBase=false );\n\n    virtual float find_nearest( const cv::Mat& samples, int k, cv::Mat* results=0,\n                                const float** neighbors=0, cv::Mat* neighborResponses=0,\n                                cv::Mat* dist=0 ) const;\n    CV_WRAP virtual float find_nearest( const cv::Mat& samples, int k, CV_OUT cv::Mat& results,\n                                        CV_OUT cv::Mat& neighborResponses, CV_OUT cv::Mat& dists) const;\n\n    virtual void clear();\n    int get_max_k() const;\n    int get_var_count() const;\n    int get_sample_count() const;\n    bool is_regression() const;\n\n    virtual float write_results( int k, int k1, int start, int end,\n        const float* neighbor_responses, const float* dist, CvMat* _results,\n        CvMat* _neighbor_responses, CvMat* _dist, Cv32suf* sort_buf ) const;\n\n    virtual void find_neighbors_direct( const CvMat* _samples, int k, int start, int end,\n        float* neighbor_responses, const float** neighbors, float* dist ) const;\n\nprotected:\n\n    int max_k, var_count;\n    int total;\n    bool regression;\n    CvVectors* samples;\n};\n\n/****************************************************************************************\\\n*                                   Support Vector Machines                              *\n\\****************************************************************************************/\n\n// SVM training parameters\nstruct CV_EXPORTS_W_MAP CvSVMParams\n{\n    CvSVMParams();\n    CvSVMParams( int svm_type, int kernel_type,\n                 double degree, double gamma, double coef0,\n                 double Cvalue, double nu, double p,\n                 CvMat* class_weights, CvTermCriteria term_crit );\n\n    CV_PROP_RW int         svm_type;\n    CV_PROP_RW int         kernel_type;\n    CV_PROP_RW double      degree; // for poly\n    CV_PROP_RW double      gamma;  // for poly/rbf/sigmoid\n    CV_PROP_RW double      coef0;  // for poly/sigmoid\n\n    CV_PROP_RW double      C;  // for CV_SVM_C_SVC, CV_SVM_EPS_SVR and CV_SVM_NU_SVR\n    CV_PROP_RW double      nu; // for CV_SVM_NU_SVC, CV_SVM_ONE_CLASS, and CV_SVM_NU_SVR\n    CV_PROP_RW double      p; // for CV_SVM_EPS_SVR\n    CvMat*      class_weights; // for CV_SVM_C_SVC\n    CV_PROP_RW CvTermCriteria term_crit; // termination criteria\n};\n\n\nstruct CV_EXPORTS CvSVMKernel\n{\n    typedef void (CvSVMKernel::*Calc)( int vec_count, int vec_size, const float** vecs,\n                                       const float* another, float* results );\n    CvSVMKernel();\n    CvSVMKernel( const CvSVMParams* params, Calc _calc_func );\n    virtual bool create( const CvSVMParams* params, Calc _calc_func );\n    virtual ~CvSVMKernel();\n\n    virtual void clear();\n    virtual void calc( int vcount, int n, const float** vecs, const float* another, float* results );\n\n    const CvSVMParams* params;\n    Calc calc_func;\n\n    virtual void calc_non_rbf_base( int vec_count, int vec_size, const float** vecs,\n                                    const float* another, float* results,\n                                    double alpha, double beta );\n\n    virtual void calc_linear( int vec_count, int vec_size, const float** vecs,\n                              const float* another, float* results );\n    virtual void calc_rbf( int vec_count, int vec_size, const float** vecs,\n                           const float* another, float* results );\n    virtual void calc_poly( int vec_count, int vec_size, const float** vecs,\n                            const float* another, float* results );\n    virtual void calc_sigmoid( int vec_count, int vec_size, const float** vecs,\n                               const float* another, float* results );\n};\n\n\nstruct CvSVMKernelRow\n{\n    CvSVMKernelRow* prev;\n    CvSVMKernelRow* next;\n    float* data;\n};\n\n\nstruct CvSVMSolutionInfo\n{\n    double obj;\n    double rho;\n    double upper_bound_p;\n    double upper_bound_n;\n    double r;   // for Solver_NU\n};\n\nclass CV_EXPORTS CvSVMSolver\n{\npublic:\n    typedef bool (CvSVMSolver::*SelectWorkingSet)( int& i, int& j );\n    typedef float* (CvSVMSolver::*GetRow)( int i, float* row, float* dst, bool existed );\n    typedef void (CvSVMSolver::*CalcRho)( double& rho, double& r );\n\n    CvSVMSolver();\n\n    CvSVMSolver( int count, int var_count, const float** samples, schar* y,\n                 int alpha_count, double* alpha, double Cp, double Cn,\n                 CvMemStorage* storage, CvSVMKernel* kernel, GetRow get_row,\n                 SelectWorkingSet select_working_set, CalcRho calc_rho );\n    virtual bool create( int count, int var_count, const float** samples, schar* y,\n                 int alpha_count, double* alpha, double Cp, double Cn,\n                 CvMemStorage* storage, CvSVMKernel* kernel, GetRow get_row,\n                 SelectWorkingSet select_working_set, CalcRho calc_rho );\n    virtual ~CvSVMSolver();\n\n    virtual void clear();\n    virtual bool solve_generic( CvSVMSolutionInfo& si );\n\n    virtual bool solve_c_svc( int count, int var_count, const float** samples, schar* y,\n                              double Cp, double Cn, CvMemStorage* storage,\n                              CvSVMKernel* kernel, double* alpha, CvSVMSolutionInfo& si );\n    virtual bool solve_nu_svc( int count, int var_count, const float** samples, schar* y,\n                               CvMemStorage* storage, CvSVMKernel* kernel,\n                               double* alpha, CvSVMSolutionInfo& si );\n    virtual bool solve_one_class( int count, int var_count, const float** samples,\n                                  CvMemStorage* storage, CvSVMKernel* kernel,\n                                  double* alpha, CvSVMSolutionInfo& si );\n\n    virtual bool solve_eps_svr( int count, int var_count, const float** samples, const float* y,\n                                CvMemStorage* storage, CvSVMKernel* kernel,\n                                double* alpha, CvSVMSolutionInfo& si );\n\n    virtual bool solve_nu_svr( int count, int var_count, const float** samples, const float* y,\n                               CvMemStorage* storage, CvSVMKernel* kernel,\n                               double* alpha, CvSVMSolutionInfo& si );\n\n    virtual float* get_row_base( int i, bool* _existed );\n    virtual float* get_row( int i, float* dst );\n\n    int sample_count;\n    int var_count;\n    int cache_size;\n    int cache_line_size;\n    const float** samples;\n    const CvSVMParams* params;\n    CvMemStorage* storage;\n    CvSVMKernelRow lru_list;\n    CvSVMKernelRow* rows;\n\n    int alpha_count;\n\n    double* G;\n    double* alpha;\n\n    // -1 - lower bound, 0 - free, 1 - upper bound\n    schar* alpha_status;\n\n    schar* y;\n    double* b;\n    float* buf[2];\n    double eps;\n    int max_iter;\n    double C[2];  // C[0] == Cn, C[1] == Cp\n    CvSVMKernel* kernel;\n\n    SelectWorkingSet select_working_set_func;\n    CalcRho calc_rho_func;\n    GetRow get_row_func;\n\n    virtual bool select_working_set( int& i, int& j );\n    virtual bool select_working_set_nu_svm( int& i, int& j );\n    virtual void calc_rho( double& rho, double& r );\n    virtual void calc_rho_nu_svm( double& rho, double& r );\n\n    virtual float* get_row_svc( int i, float* row, float* dst, bool existed );\n    virtual float* get_row_one_class( int i, float* row, float* dst, bool existed );\n    virtual float* get_row_svr( int i, float* row, float* dst, bool existed );\n};\n\n\nstruct CvSVMDecisionFunc\n{\n    double rho;\n    int sv_count;\n    double* alpha;\n    int* sv_index;\n};\n\n\n// SVM model\nclass CV_EXPORTS_W CvSVM : public CvStatModel\n{\npublic:\n    // SVM type\n    enum { C_SVC=100, NU_SVC=101, ONE_CLASS=102, EPS_SVR=103, NU_SVR=104 };\n\n    // SVM kernel type\n    enum { LINEAR=0, POLY=1, RBF=2, SIGMOID=3 };\n\n    // SVM params type\n    enum { C=0, GAMMA=1, P=2, NU=3, COEF=4, DEGREE=5 };\n\n    CV_WRAP CvSVM();\n    virtual ~CvSVM();\n\n    CvSVM( const CvMat* trainData, const CvMat* responses,\n           const CvMat* varIdx=0, const CvMat* sampleIdx=0,\n           CvSVMParams params=CvSVMParams() );\n\n    virtual bool train( const CvMat* trainData, const CvMat* responses,\n                        const CvMat* varIdx=0, const CvMat* sampleIdx=0,\n                        CvSVMParams params=CvSVMParams() );\n\n    virtual bool train_auto( const CvMat* trainData, const CvMat* responses,\n        const CvMat* varIdx, const CvMat* sampleIdx, CvSVMParams params,\n        int kfold = 10,\n        CvParamGrid Cgrid      = get_default_grid(CvSVM::C),\n        CvParamGrid gammaGrid  = get_default_grid(CvSVM::GAMMA),\n        CvParamGrid pGrid      = get_default_grid(CvSVM::P),\n        CvParamGrid nuGrid     = get_default_grid(CvSVM::NU),\n        CvParamGrid coeffGrid  = get_default_grid(CvSVM::COEF),\n        CvParamGrid degreeGrid = get_default_grid(CvSVM::DEGREE),\n        bool balanced=false );\n\n    virtual float predict( const CvMat* sample, bool returnDFVal=false ) const;\n    virtual float predict( const CvMat* samples, CV_OUT CvMat* results ) const;\n\n    CV_WRAP CvSVM( const cv::Mat& trainData, const cv::Mat& responses,\n          const cv::Mat& varIdx=cv::Mat(), const cv::Mat& sampleIdx=cv::Mat(),\n          CvSVMParams params=CvSVMParams() );\n\n    CV_WRAP virtual bool train( const cv::Mat& trainData, const cv::Mat& responses,\n                       const cv::Mat& varIdx=cv::Mat(), const cv::Mat& sampleIdx=cv::Mat(),\n                       CvSVMParams params=CvSVMParams() );\n\n    CV_WRAP virtual bool train_auto( const cv::Mat& trainData, const cv::Mat& responses,\n                            const cv::Mat& varIdx, const cv::Mat& sampleIdx, CvSVMParams params,\n                            int k_fold = 10,\n                            CvParamGrid Cgrid      = CvSVM::get_default_grid(CvSVM::C),\n                            CvParamGrid gammaGrid  = CvSVM::get_default_grid(CvSVM::GAMMA),\n                            CvParamGrid pGrid      = CvSVM::get_default_grid(CvSVM::P),\n                            CvParamGrid nuGrid     = CvSVM::get_default_grid(CvSVM::NU),\n                            CvParamGrid coeffGrid  = CvSVM::get_default_grid(CvSVM::COEF),\n                            CvParamGrid degreeGrid = CvSVM::get_default_grid(CvSVM::DEGREE),\n                            bool balanced=false);\n    CV_WRAP virtual float predict( const cv::Mat& sample, bool returnDFVal=false ) const;\n    CV_WRAP_AS(predict_all) void predict( cv::InputArray samples, cv::OutputArray results ) const;\n\n    CV_WRAP virtual int get_support_vector_count() const;\n    virtual const float* get_support_vector(int i) const;\n    virtual CvSVMParams get_params() const { return params; };\n    CV_WRAP virtual void clear();\n\n    static CvParamGrid get_default_grid( int param_id );\n\n    virtual void write( CvFileStorage* storage, const char* name ) const;\n    virtual void read( CvFileStorage* storage, CvFileNode* node );\n    CV_WRAP int get_var_count() const { return var_idx ? var_idx->cols : var_all; }\n\nprotected:\n\n    virtual bool set_params( const CvSVMParams& params );\n    virtual bool train1( int sample_count, int var_count, const float** samples,\n                    const void* responses, double Cp, double Cn,\n                    CvMemStorage* _storage, double* alpha, double& rho );\n    virtual bool do_train( int svm_type, int sample_count, int var_count, const float** samples,\n                    const CvMat* responses, CvMemStorage* _storage, double* alpha );\n    virtual void create_kernel();\n    virtual void create_solver();\n\n    virtual float predict( const float* row_sample, int row_len, bool returnDFVal=false ) const;\n\n    virtual void write_params( CvFileStorage* fs ) const;\n    virtual void read_params( CvFileStorage* fs, CvFileNode* node );\n\n    void optimize_linear_svm();\n\n    CvSVMParams params;\n    CvMat* class_labels;\n    int var_all;\n    float** sv;\n    int sv_total;\n    CvMat* var_idx;\n    CvMat* class_weights;\n    CvSVMDecisionFunc* decision_func;\n    CvMemStorage* storage;\n\n    CvSVMSolver* solver;\n    CvSVMKernel* kernel;\n\nprivate:\n    CvSVM(const CvSVM&);\n    CvSVM& operator = (const CvSVM&);\n};\n\n/****************************************************************************************\\\n*                              Expectation - Maximization                                *\n\\****************************************************************************************/\nnamespace cv\n{\nclass CV_EXPORTS_W EM : public Algorithm\n{\npublic:\n    // Type of covariation matrices\n    enum {COV_MAT_SPHERICAL=0, COV_MAT_DIAGONAL=1, COV_MAT_GENERIC=2, COV_MAT_DEFAULT=COV_MAT_DIAGONAL};\n\n    // Default parameters\n    enum {DEFAULT_NCLUSTERS=5, DEFAULT_MAX_ITERS=100};\n\n    // The initial step\n    enum {START_E_STEP=1, START_M_STEP=2, START_AUTO_STEP=0};\n\n    CV_WRAP EM(int nclusters=EM::DEFAULT_NCLUSTERS, int covMatType=EM::COV_MAT_DIAGONAL,\n       const TermCriteria& termCrit=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS,\n                                                 EM::DEFAULT_MAX_ITERS, FLT_EPSILON));\n\n    virtual ~EM();\n    CV_WRAP virtual void clear();\n\n    CV_WRAP virtual bool train(InputArray samples,\n                       OutputArray logLikelihoods=noArray(),\n                       OutputArray labels=noArray(),\n                       OutputArray probs=noArray());\n\n    CV_WRAP virtual bool trainE(InputArray samples,\n                        InputArray means0,\n                        InputArray covs0=noArray(),\n                        InputArray weights0=noArray(),\n                        OutputArray logLikelihoods=noArray(),\n                        OutputArray labels=noArray(),\n                        OutputArray probs=noArray());\n\n    CV_WRAP virtual bool trainM(InputArray samples,\n                        InputArray probs0,\n                        OutputArray logLikelihoods=noArray(),\n                        OutputArray labels=noArray(),\n                        OutputArray probs=noArray());\n\n    CV_WRAP Vec2d predict(InputArray sample,\n                OutputArray probs=noArray()) const;\n\n    CV_WRAP bool isTrained() const;\n\n    AlgorithmInfo* info() const;\n    virtual void read(const FileNode& fn);\n\nprotected:\n\n    virtual void setTrainData(int startStep, const Mat& samples,\n                              const Mat* probs0,\n                              const Mat* means0,\n                              const vector<Mat>* covs0,\n                              const Mat* weights0);\n\n    bool doTrain(int startStep,\n                 OutputArray logLikelihoods,\n                 OutputArray labels,\n                 OutputArray probs);\n    virtual void eStep();\n    virtual void mStep();\n\n    void clusterTrainSamples();\n    void decomposeCovs();\n    void computeLogWeightDivDet();\n\n    Vec2d computeProbabilities(const Mat& sample, Mat* probs) const;\n\n    // all inner matrices have type CV_64FC1\n    CV_PROP_RW int nclusters;\n    CV_PROP_RW int covMatType;\n    CV_PROP_RW int maxIters;\n    CV_PROP_RW double epsilon;\n\n    Mat trainSamples;\n    Mat trainProbs;\n    Mat trainLogLikelihoods;\n    Mat trainLabels;\n\n    CV_PROP Mat weights;\n    CV_PROP Mat means;\n    CV_PROP vector<Mat> covs;\n\n    vector<Mat> covsEigenValues;\n    vector<Mat> covsRotateMats;\n    vector<Mat> invCovsEigenValues;\n    Mat logWeightDivDet;\n};\n} // namespace cv\n\n/****************************************************************************************\\\n*                                      Decision Tree                                     *\n\\****************************************************************************************/\\\nstruct CvPair16u32s\n{\n    unsigned short* u;\n    int* i;\n};\n\n\n#define CV_DTREE_CAT_DIR(idx,subset) \\\n    (2*((subset[(idx)>>5]&(1 << ((idx) & 31)))==0)-1)\n\nstruct CvDTreeSplit\n{\n    int var_idx;\n    int condensed_idx;\n    int inversed;\n    float quality;\n    CvDTreeSplit* next;\n    union\n    {\n        int subset[2];\n        struct\n        {\n            float c;\n            int split_point;\n        }\n        ord;\n    };\n};\n\nstruct CvDTreeNode\n{\n    int class_idx;\n    int Tn;\n    double value;\n\n    CvDTreeNode* parent;\n    CvDTreeNode* left;\n    CvDTreeNode* right;\n\n    CvDTreeSplit* split;\n\n    int sample_count;\n    int depth;\n    int* num_valid;\n    int offset;\n    int buf_idx;\n    double maxlr;\n\n    // global pruning data\n    int complexity;\n    double alpha;\n    double node_risk, tree_risk, tree_error;\n\n    // cross-validation pruning data\n    int* cv_Tn;\n    double* cv_node_risk;\n    double* cv_node_error;\n\n    int get_num_valid(int vi) { return num_valid ? num_valid[vi] : sample_count; }\n    void set_num_valid(int vi, int n) { if( num_valid ) num_valid[vi] = n; }\n};\n\n\nstruct CV_EXPORTS_W_MAP CvDTreeParams\n{\n    CV_PROP_RW int   max_categories;\n    CV_PROP_RW int   max_depth;\n    CV_PROP_RW int   min_sample_count;\n    CV_PROP_RW int   cv_folds;\n    CV_PROP_RW bool  use_surrogates;\n    CV_PROP_RW bool  use_1se_rule;\n    CV_PROP_RW bool  truncate_pruned_tree;\n    CV_PROP_RW float regression_accuracy;\n    const float* priors;\n\n    CvDTreeParams();\n    CvDTreeParams( int max_depth, int min_sample_count,\n                   float regression_accuracy, bool use_surrogates,\n                   int max_categories, int cv_folds,\n                   bool use_1se_rule, bool truncate_pruned_tree,\n                   const float* priors );\n};\n\n\nstruct CV_EXPORTS CvDTreeTrainData\n{\n    CvDTreeTrainData();\n    CvDTreeTrainData( const CvMat* trainData, int tflag,\n                      const CvMat* responses, const CvMat* varIdx=0,\n                      const CvMat* sampleIdx=0, const CvMat* varType=0,\n                      const CvMat* missingDataMask=0,\n                      const CvDTreeParams& params=CvDTreeParams(),\n                      bool _shared=false, bool _add_labels=false );\n    virtual ~CvDTreeTrainData();\n\n    virtual void set_data( const CvMat* trainData, int tflag,\n                          const CvMat* responses, const CvMat* varIdx=0,\n                          const CvMat* sampleIdx=0, const CvMat* varType=0,\n                          const CvMat* missingDataMask=0,\n                          const CvDTreeParams& params=CvDTreeParams(),\n                          bool _shared=false, bool _add_labels=false,\n                          bool _update_data=false );\n    virtual void do_responses_copy();\n\n    virtual void get_vectors( const CvMat* _subsample_idx,\n         float* values, uchar* missing, float* responses, bool get_class_idx=false );\n\n    virtual CvDTreeNode* subsample_data( const CvMat* _subsample_idx );\n\n    virtual void write_params( CvFileStorage* fs ) const;\n    virtual void read_params( CvFileStorage* fs, CvFileNode* node );\n\n    // release all the data\n    virtual void clear();\n\n    int get_num_classes() const;\n    int get_var_type(int vi) const;\n    int get_work_var_count() const {return work_var_count;}\n\n    virtual const float* get_ord_responses( CvDTreeNode* n, float* values_buf, int* sample_indices_buf );\n    virtual const int* get_class_labels( CvDTreeNode* n, int* labels_buf );\n    virtual const int* get_cv_labels( CvDTreeNode* n, int* labels_buf );\n    virtual const int* get_sample_indices( CvDTreeNode* n, int* indices_buf );\n    virtual const int* get_cat_var_data( CvDTreeNode* n, int vi, int* cat_values_buf );\n    virtual void get_ord_var_data( CvDTreeNode* n, int vi, float* ord_values_buf, int* sorted_indices_buf,\n                                   const float** ord_values, const int** sorted_indices, int* sample_indices_buf );\n    virtual int get_child_buf_idx( CvDTreeNode* n );\n\n    ////////////////////////////////////\n\n    virtual bool set_params( const CvDTreeParams& params );\n    virtual CvDTreeNode* new_node( CvDTreeNode* parent, int count,\n                                   int storage_idx, int offset );\n\n    virtual CvDTreeSplit* new_split_ord( int vi, float cmp_val,\n                int split_point, int inversed, float quality );\n    virtual CvDTreeSplit* new_split_cat( int vi, float quality );\n    virtual void free_node_data( CvDTreeNode* node );\n    virtual void free_train_data();\n    virtual void free_node( CvDTreeNode* node );\n\n    int sample_count, var_all, var_count, max_c_count;\n    int ord_var_count, cat_var_count, work_var_count;\n    bool have_labels, have_priors;\n    bool is_classifier;\n    int tflag;\n\n    const CvMat* train_data;\n    const CvMat* responses;\n    CvMat* responses_copy; // used in Boosting\n\n    int buf_count, buf_size; // buf_size is obsolete, please do not use it, use expression ((int64)buf->rows * (int64)buf->cols / buf_count) instead\n    bool shared;\n    int is_buf_16u;\n\n    CvMat* cat_count;\n    CvMat* cat_ofs;\n    CvMat* cat_map;\n\n    CvMat* counts;\n    CvMat* buf;\n    inline size_t get_length_subbuf() const\n    {\n        size_t res = (size_t)(work_var_count + 1) * (size_t)sample_count;\n        return res;\n    }\n\n    CvMat* direction;\n    CvMat* split_buf;\n\n    CvMat* var_idx;\n    CvMat* var_type; // i-th element =\n                     //   k<0  - ordered\n                     //   k>=0 - categorical, see k-th element of cat_* arrays\n    CvMat* priors;\n    CvMat* priors_mult;\n\n    CvDTreeParams params;\n\n    CvMemStorage* tree_storage;\n    CvMemStorage* temp_storage;\n\n    CvDTreeNode* data_root;\n\n    CvSet* node_heap;\n    CvSet* split_heap;\n    CvSet* cv_heap;\n    CvSet* nv_heap;\n\n    cv::RNG* rng;\n};\n\nclass CvDTree;\nclass CvForestTree;\n\nnamespace cv\n{\n    struct DTreeBestSplitFinder;\n    struct ForestTreeBestSplitFinder;\n}\n\nclass CV_EXPORTS_W CvDTree : public CvStatModel\n{\npublic:\n    CV_WRAP CvDTree();\n    virtual ~CvDTree();\n\n    virtual bool train( const CvMat* trainData, int tflag,\n                        const CvMat* responses, const CvMat* varIdx=0,\n                        const CvMat* sampleIdx=0, const CvMat* varType=0,\n                        const CvMat* missingDataMask=0,\n                        CvDTreeParams params=CvDTreeParams() );\n\n    virtual bool train( CvMLData* trainData, CvDTreeParams params=CvDTreeParams() );\n\n    // type in {CV_TRAIN_ERROR, CV_TEST_ERROR}\n    virtual float calc_error( CvMLData* trainData, int type, std::vector<float> *resp = 0 );\n\n    virtual bool train( CvDTreeTrainData* trainData, const CvMat* subsampleIdx );\n\n    virtual CvDTreeNode* predict( const CvMat* sample, const CvMat* missingDataMask=0,\n                                  bool preprocessedInput=false ) const;\n\n    CV_WRAP virtual bool train( const cv::Mat& trainData, int tflag,\n                       const cv::Mat& responses, const cv::Mat& varIdx=cv::Mat(),\n                       const cv::Mat& sampleIdx=cv::Mat(), const cv::Mat& varType=cv::Mat(),\n                       const cv::Mat& missingDataMask=cv::Mat(),\n                       CvDTreeParams params=CvDTreeParams() );\n\n    CV_WRAP virtual CvDTreeNode* predict( const cv::Mat& sample, const cv::Mat& missingDataMask=cv::Mat(),\n                                  bool preprocessedInput=false ) const;\n    CV_WRAP virtual cv::Mat getVarImportance();\n\n    virtual const CvMat* get_var_importance();\n    CV_WRAP virtual void clear();\n\n    virtual void read( CvFileStorage* fs, CvFileNode* node );\n    virtual void write( CvFileStorage* fs, const char* name ) const;\n\n    // special read & write methods for trees in the tree ensembles\n    virtual void read( CvFileStorage* fs, CvFileNode* node,\n                       CvDTreeTrainData* data );\n    virtual void write( CvFileStorage* fs ) const;\n\n    const CvDTreeNode* get_root() const;\n    int get_pruned_tree_idx() const;\n    CvDTreeTrainData* get_data();\n\nprotected:\n    friend struct cv::DTreeBestSplitFinder;\n\n    virtual bool do_train( const CvMat* _subsample_idx );\n\n    virtual void try_split_node( CvDTreeNode* n );\n    virtual void split_node_data( CvDTreeNode* n );\n    virtual CvDTreeSplit* find_best_split( CvDTreeNode* n );\n    virtual CvDTreeSplit* find_split_ord_class( CvDTreeNode* n, int vi,\n                            float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_cat_class( CvDTreeNode* n, int vi,\n                            float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_ord_reg( CvDTreeNode* n, int vi,\n                            float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_cat_reg( CvDTreeNode* n, int vi,\n                            float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_surrogate_split_ord( CvDTreeNode* n, int vi, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_surrogate_split_cat( CvDTreeNode* n, int vi, uchar* ext_buf = 0 );\n    virtual double calc_node_dir( CvDTreeNode* node );\n    virtual void complete_node_dir( CvDTreeNode* node );\n    virtual void cluster_categories( const int* vectors, int vector_count,\n        int var_count, int* sums, int k, int* cluster_labels );\n\n    virtual void calc_node_value( CvDTreeNode* node );\n\n    virtual void prune_cv();\n    virtual double update_tree_rnc( int T, int fold );\n    virtual int cut_tree( int T, int fold, double min_alpha );\n    virtual void free_prune_data(bool cut_tree);\n    virtual void free_tree();\n\n    virtual void write_node( CvFileStorage* fs, CvDTreeNode* node ) const;\n    virtual void write_split( CvFileStorage* fs, CvDTreeSplit* split ) const;\n    virtual CvDTreeNode* read_node( CvFileStorage* fs, CvFileNode* node, CvDTreeNode* parent );\n    virtual CvDTreeSplit* read_split( CvFileStorage* fs, CvFileNode* node );\n    virtual void write_tree_nodes( CvFileStorage* fs ) const;\n    virtual void read_tree_nodes( CvFileStorage* fs, CvFileNode* node );\n\n    CvDTreeNode* root;\n    CvMat* var_importance;\n    CvDTreeTrainData* data;\n\npublic:\n    int pruned_tree_idx;\n};\n\n\n/****************************************************************************************\\\n*                                   Random Trees Classifier                              *\n\\****************************************************************************************/\n\nclass CvRTrees;\n\nclass CV_EXPORTS CvForestTree: public CvDTree\n{\npublic:\n    CvForestTree();\n    virtual ~CvForestTree();\n\n    virtual bool train( CvDTreeTrainData* trainData, const CvMat* _subsample_idx, CvRTrees* forest );\n\n    virtual int get_var_count() const {return data ? data->var_count : 0;}\n    virtual void read( CvFileStorage* fs, CvFileNode* node, CvRTrees* forest, CvDTreeTrainData* _data );\n\n    /* dummy methods to avoid warnings: BEGIN */\n    virtual bool train( const CvMat* trainData, int tflag,\n                        const CvMat* responses, const CvMat* varIdx=0,\n                        const CvMat* sampleIdx=0, const CvMat* varType=0,\n                        const CvMat* missingDataMask=0,\n                        CvDTreeParams params=CvDTreeParams() );\n\n    virtual bool train( CvDTreeTrainData* trainData, const CvMat* _subsample_idx );\n    virtual void read( CvFileStorage* fs, CvFileNode* node );\n    virtual void read( CvFileStorage* fs, CvFileNode* node,\n                       CvDTreeTrainData* data );\n    /* dummy methods to avoid warnings: END */\n\nprotected:\n    friend struct cv::ForestTreeBestSplitFinder;\n\n    virtual CvDTreeSplit* find_best_split( CvDTreeNode* n );\n    CvRTrees* forest;\n};\n\n\nstruct CV_EXPORTS_W_MAP CvRTParams : public CvDTreeParams\n{\n    //Parameters for the forest\n    CV_PROP_RW bool calc_var_importance; // true <=> RF processes variable importance\n    CV_PROP_RW int nactive_vars;\n    CV_PROP_RW CvTermCriteria term_crit;\n\n    CvRTParams();\n    CvRTParams( int max_depth, int min_sample_count,\n                float regression_accuracy, bool use_surrogates,\n                int max_categories, const float* priors, bool calc_var_importance,\n                int nactive_vars, int max_num_of_trees_in_the_forest,\n                float forest_accuracy, int termcrit_type );\n};\n\n\nclass CV_EXPORTS_W CvRTrees : public CvStatModel\n{\npublic:\n    CV_WRAP CvRTrees();\n    virtual ~CvRTrees();\n    virtual bool train( const CvMat* trainData, int tflag,\n                        const CvMat* responses, const CvMat* varIdx=0,\n                        const CvMat* sampleIdx=0, const CvMat* varType=0,\n                        const CvMat* missingDataMask=0,\n                        CvRTParams params=CvRTParams() );\n\n    virtual bool train( CvMLData* data, CvRTParams params=CvRTParams() );\n    virtual float predict( const CvMat* sample, const CvMat* missing = 0 ) const;\n    virtual float predict_prob( const CvMat* sample, const CvMat* missing = 0 ) const;\n\n    CV_WRAP virtual bool train( const cv::Mat& trainData, int tflag,\n                       const cv::Mat& responses, const cv::Mat& varIdx=cv::Mat(),\n                       const cv::Mat& sampleIdx=cv::Mat(), const cv::Mat& varType=cv::Mat(),\n                       const cv::Mat& missingDataMask=cv::Mat(),\n                       CvRTParams params=CvRTParams() );\n    CV_WRAP virtual float predict( const cv::Mat& sample, const cv::Mat& missing = cv::Mat() ) const;\n    CV_WRAP virtual float predict_prob( const cv::Mat& sample, const cv::Mat& missing = cv::Mat() ) const;\n    CV_WRAP virtual cv::Mat getVarImportance();\n\n    CV_WRAP virtual void clear();\n\n    virtual const CvMat* get_var_importance();\n    virtual float get_proximity( const CvMat* sample1, const CvMat* sample2,\n        const CvMat* missing1 = 0, const CvMat* missing2 = 0 ) const;\n\n    virtual float calc_error( CvMLData* data, int type , std::vector<float>* resp = 0 ); // type in {CV_TRAIN_ERROR, CV_TEST_ERROR}\n\n    virtual float get_train_error();\n\n    virtual void read( CvFileStorage* fs, CvFileNode* node );\n    virtual void write( CvFileStorage* fs, const char* name ) const;\n\n    CvMat* get_active_var_mask();\n    CvRNG* get_rng();\n\n    int get_tree_count() const;\n    CvForestTree* get_tree(int i) const;\n\nprotected:\n    virtual std::string getName() const;\n\n    virtual bool grow_forest( const CvTermCriteria term_crit );\n\n    // array of the trees of the forest\n    CvForestTree** trees;\n    CvDTreeTrainData* data;\n    int ntrees;\n    int nclasses;\n    double oob_error;\n    CvMat* var_importance;\n    int nsamples;\n\n    cv::RNG* rng;\n    CvMat* active_var_mask;\n};\n\n/****************************************************************************************\\\n*                           Extremely randomized trees Classifier                        *\n\\****************************************************************************************/\nstruct CV_EXPORTS CvERTreeTrainData : public CvDTreeTrainData\n{\n    virtual void set_data( const CvMat* trainData, int tflag,\n                          const CvMat* responses, const CvMat* varIdx=0,\n                          const CvMat* sampleIdx=0, const CvMat* varType=0,\n                          const CvMat* missingDataMask=0,\n                          const CvDTreeParams& params=CvDTreeParams(),\n                          bool _shared=false, bool _add_labels=false,\n                          bool _update_data=false );\n    virtual void get_ord_var_data( CvDTreeNode* n, int vi, float* ord_values_buf, int* missing_buf,\n                                   const float** ord_values, const int** missing, int* sample_buf = 0 );\n    virtual const int* get_sample_indices( CvDTreeNode* n, int* indices_buf );\n    virtual const int* get_cv_labels( CvDTreeNode* n, int* labels_buf );\n    virtual const int* get_cat_var_data( CvDTreeNode* n, int vi, int* cat_values_buf );\n    virtual void get_vectors( const CvMat* _subsample_idx, float* values, uchar* missing,\n                              float* responses, bool get_class_idx=false );\n    virtual CvDTreeNode* subsample_data( const CvMat* _subsample_idx );\n    const CvMat* missing_mask;\n};\n\nclass CV_EXPORTS CvForestERTree : public CvForestTree\n{\nprotected:\n    virtual double calc_node_dir( CvDTreeNode* node );\n    virtual CvDTreeSplit* find_split_ord_class( CvDTreeNode* n, int vi,\n        float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_cat_class( CvDTreeNode* n, int vi,\n        float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_ord_reg( CvDTreeNode* n, int vi,\n        float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_cat_reg( CvDTreeNode* n, int vi,\n        float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual void split_node_data( CvDTreeNode* n );\n};\n\nclass CV_EXPORTS_W CvERTrees : public CvRTrees\n{\npublic:\n    CV_WRAP CvERTrees();\n    virtual ~CvERTrees();\n    virtual bool train( const CvMat* trainData, int tflag,\n                        const CvMat* responses, const CvMat* varIdx=0,\n                        const CvMat* sampleIdx=0, const CvMat* varType=0,\n                        const CvMat* missingDataMask=0,\n                        CvRTParams params=CvRTParams());\n    CV_WRAP virtual bool train( const cv::Mat& trainData, int tflag,\n                       const cv::Mat& responses, const cv::Mat& varIdx=cv::Mat(),\n                       const cv::Mat& sampleIdx=cv::Mat(), const cv::Mat& varType=cv::Mat(),\n                       const cv::Mat& missingDataMask=cv::Mat(),\n                       CvRTParams params=CvRTParams());\n    virtual bool train( CvMLData* data, CvRTParams params=CvRTParams() );\nprotected:\n    virtual std::string getName() const;\n    virtual bool grow_forest( const CvTermCriteria term_crit );\n};\n\n\n/****************************************************************************************\\\n*                                   Boosted tree classifier                              *\n\\****************************************************************************************/\n\nstruct CV_EXPORTS_W_MAP CvBoostParams : public CvDTreeParams\n{\n    CV_PROP_RW int boost_type;\n    CV_PROP_RW int weak_count;\n    CV_PROP_RW int split_criteria;\n    CV_PROP_RW double weight_trim_rate;\n\n    CvBoostParams();\n    CvBoostParams( int boost_type, int weak_count, double weight_trim_rate,\n                   int max_depth, bool use_surrogates, const float* priors );\n};\n\n\nclass CvBoost;\n\nclass CV_EXPORTS CvBoostTree: public CvDTree\n{\npublic:\n    CvBoostTree();\n    virtual ~CvBoostTree();\n\n    virtual bool train( CvDTreeTrainData* trainData,\n                        const CvMat* subsample_idx, CvBoost* ensemble );\n\n    virtual void scale( double s );\n    virtual void read( CvFileStorage* fs, CvFileNode* node,\n                       CvBoost* ensemble, CvDTreeTrainData* _data );\n    virtual void clear();\n\n    /* dummy methods to avoid warnings: BEGIN */\n    virtual bool train( const CvMat* trainData, int tflag,\n                        const CvMat* responses, const CvMat* varIdx=0,\n                        const CvMat* sampleIdx=0, const CvMat* varType=0,\n                        const CvMat* missingDataMask=0,\n                        CvDTreeParams params=CvDTreeParams() );\n    virtual bool train( CvDTreeTrainData* trainData, const CvMat* _subsample_idx );\n\n    virtual void read( CvFileStorage* fs, CvFileNode* node );\n    virtual void read( CvFileStorage* fs, CvFileNode* node,\n                       CvDTreeTrainData* data );\n    /* dummy methods to avoid warnings: END */\n\nprotected:\n\n    virtual void try_split_node( CvDTreeNode* n );\n    virtual CvDTreeSplit* find_surrogate_split_ord( CvDTreeNode* n, int vi, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_surrogate_split_cat( CvDTreeNode* n, int vi, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_ord_class( CvDTreeNode* n, int vi,\n        float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_cat_class( CvDTreeNode* n, int vi,\n        float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_ord_reg( CvDTreeNode* n, int vi,\n        float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual CvDTreeSplit* find_split_cat_reg( CvDTreeNode* n, int vi,\n        float init_quality = 0, CvDTreeSplit* _split = 0, uchar* ext_buf = 0 );\n    virtual void calc_node_value( CvDTreeNode* n );\n    virtual double calc_node_dir( CvDTreeNode* n );\n\n    CvBoost* ensemble;\n};\n\n\nclass CV_EXPORTS_W CvBoost : public CvStatModel\n{\npublic:\n    // Boosting type\n    enum { DISCRETE=0, REAL=1, LOGIT=2, GENTLE=3 };\n\n    // Splitting criteria\n    enum { DEFAULT=0, GINI=1, MISCLASS=3, SQERR=4 };\n\n    CV_WRAP CvBoost();\n    virtual ~CvBoost();\n\n    CvBoost( const CvMat* trainData, int tflag,\n             const CvMat* responses, const CvMat* varIdx=0,\n             const CvMat* sampleIdx=0, const CvMat* varType=0,\n             const CvMat* missingDataMask=0,\n             CvBoostParams params=CvBoostParams() );\n\n    virtual bool train( const CvMat* trainData, int tflag,\n             const CvMat* responses, const CvMat* varIdx=0,\n             const CvMat* sampleIdx=0, const CvMat* varType=0,\n             const CvMat* missingDataMask=0,\n             CvBoostParams params=CvBoostParams(),\n             bool update=false );\n\n    virtual bool train( CvMLData* data,\n             CvBoostParams params=CvBoostParams(),\n             bool update=false );\n\n    virtual float predict( const CvMat* sample, const CvMat* missing=0,\n                           CvMat* weak_responses=0, CvSlice slice=CV_WHOLE_SEQ,\n                           bool raw_mode=false, bool return_sum=false ) const;\n\n    CV_WRAP CvBoost( const cv::Mat& trainData, int tflag,\n            const cv::Mat& responses, const cv::Mat& varIdx=cv::Mat(),\n            const cv::Mat& sampleIdx=cv::Mat(), const cv::Mat& varType=cv::Mat(),\n            const cv::Mat& missingDataMask=cv::Mat(),\n            CvBoostParams params=CvBoostParams() );\n\n    CV_WRAP virtual bool train( const cv::Mat& trainData, int tflag,\n                       const cv::Mat& responses, const cv::Mat& varIdx=cv::Mat(),\n                       const cv::Mat& sampleIdx=cv::Mat(), const cv::Mat& varType=cv::Mat(),\n                       const cv::Mat& missingDataMask=cv::Mat(),\n                       CvBoostParams params=CvBoostParams(),\n                       bool update=false );\n\n    CV_WRAP virtual float predict( const cv::Mat& sample, const cv::Mat& missing=cv::Mat(),\n                                   const cv::Range& slice=cv::Range::all(), bool rawMode=false,\n                                   bool returnSum=false ) const;\n\n    virtual float calc_error( CvMLData* _data, int type , std::vector<float> *resp = 0 ); // type in {CV_TRAIN_ERROR, CV_TEST_ERROR}\n\n    CV_WRAP virtual void prune( CvSlice slice );\n\n    CV_WRAP virtual void clear();\n\n    virtual void write( CvFileStorage* storage, const char* name ) const;\n    virtual void read( CvFileStorage* storage, CvFileNode* node );\n    virtual const CvMat* get_active_vars(bool absolute_idx=true);\n\n    CvSeq* get_weak_predictors();\n\n    CvMat* get_weights();\n    CvMat* get_subtree_weights();\n    CvMat* get_weak_response();\n    const CvBoostParams& get_params() const;\n    const CvDTreeTrainData* get_data() const;\n\nprotected:\n\n    void update_weights_impl( CvBoostTree* tree, double initial_weights[2] );\n\n    virtual bool set_params( const CvBoostParams& params );\n    virtual void update_weights( CvBoostTree* tree );\n    virtual void trim_weights();\n    virtual void write_params( CvFileStorage* fs ) const;\n    virtual void read_params( CvFileStorage* fs, CvFileNode* node );\n\n    CvDTreeTrainData* data;\n    CvBoostParams params;\n    CvSeq* weak;\n\n    CvMat* active_vars;\n    CvMat* active_vars_abs;\n    bool have_active_cat_vars;\n\n    CvMat* orig_response;\n    CvMat* sum_response;\n    CvMat* weak_eval;\n    CvMat* subsample_mask;\n    CvMat* weights;\n    CvMat* subtree_weights;\n    bool have_subsample;\n};\n\n\n/****************************************************************************************\\\n*                                   Gradient Boosted Trees                               *\n\\****************************************************************************************/\n\n// DataType: STRUCT CvGBTreesParams\n// Parameters of GBT (Gradient Boosted trees model), including single\n// tree settings and ensemble parameters.\n//\n// weak_count          - count of trees in the ensemble\n// loss_function_type  - loss function used for ensemble training\n// subsample_portion   - portion of whole training set used for\n//                       every single tree training.\n//                       subsample_portion value is in (0.0, 1.0].\n//                       subsample_portion == 1.0 when whole dataset is\n//                       used on each step. Count of sample used on each\n//                       step is computed as\n//                       int(total_samples_count * subsample_portion).\n// shrinkage           - regularization parameter.\n//                       Each tree prediction is multiplied on shrinkage value.\n\n\nstruct CV_EXPORTS_W_MAP CvGBTreesParams : public CvDTreeParams\n{\n    CV_PROP_RW int weak_count;\n    CV_PROP_RW int loss_function_type;\n    CV_PROP_RW float subsample_portion;\n    CV_PROP_RW float shrinkage;\n\n    CvGBTreesParams();\n    CvGBTreesParams( int loss_function_type, int weak_count, float shrinkage,\n        float subsample_portion, int max_depth, bool use_surrogates );\n};\n\n// DataType: CLASS CvGBTrees\n// Gradient Boosting Trees (GBT) algorithm implementation.\n//\n// data             - training dataset\n// params           - parameters of the CvGBTrees\n// weak             - array[0..(class_count-1)] of CvSeq\n//                    for storing tree ensembles\n// orig_response    - original responses of the training set samples\n// sum_response     - predicitons of the current model on the training dataset.\n//                    this matrix is updated on every iteration.\n// sum_response_tmp - predicitons of the model on the training set on the next\n//                    step. On every iteration values of sum_responses_tmp are\n//                    computed via sum_responses values. When the current\n//                    step is complete sum_response values become equal to\n//                    sum_responses_tmp.\n// sampleIdx       - indices of samples used for training the ensemble.\n//                    CvGBTrees training procedure takes a set of samples\n//                    (train_data) and a set of responses (responses).\n//                    Only pairs (train_data[i], responses[i]), where i is\n//                    in sample_idx are used for training the ensemble.\n// subsample_train  - indices of samples used for training a single decision\n//                    tree on the current step. This indices are countered\n//                    relatively to the sample_idx, so that pairs\n//                    (train_data[sample_idx[i]], responses[sample_idx[i]])\n//                    are used for training a decision tree.\n//                    Training set is randomly splited\n//                    in two parts (subsample_train and subsample_test)\n//                    on every iteration accordingly to the portion parameter.\n// subsample_test   - relative indices of samples from the training set,\n//                    which are not used for training a tree on the current\n//                    step.\n// missing          - mask of the missing values in the training set. This\n//                    matrix has the same size as train_data. 1 - missing\n//                    value, 0 - not a missing value.\n// class_labels     - output class labels map.\n// rng              - random number generator. Used for spliting the\n//                    training set.\n// class_count      - count of output classes.\n//                    class_count == 1 in the case of regression,\n//                    and > 1 in the case of classification.\n// delta            - Huber loss function parameter.\n// base_value       - start point of the gradient descent procedure.\n//                    model prediction is\n//                    f(x) = f_0 + sum_{i=1..weak_count-1}(f_i(x)), where\n//                    f_0 is the base value.\n\n\n\nclass CV_EXPORTS_W CvGBTrees : public CvStatModel\n{\npublic:\n\n    /*\n    // DataType: ENUM\n    // Loss functions implemented in CvGBTrees.\n    //\n    // SQUARED_LOSS\n    // problem: regression\n    // loss = (x - x')^2\n    //\n    // ABSOLUTE_LOSS\n    // problem: regression\n    // loss = abs(x - x')\n    //\n    // HUBER_LOSS\n    // problem: regression\n    // loss = delta*( abs(x - x') - delta/2), if abs(x - x') > delta\n    //           1/2*(x - x')^2, if abs(x - x') <= delta,\n    //           where delta is the alpha-quantile of pseudo responses from\n    //           the training set.\n    //\n    // DEVIANCE_LOSS\n    // problem: classification\n    //\n    */\n    enum {SQUARED_LOSS=0, ABSOLUTE_LOSS, HUBER_LOSS=3, DEVIANCE_LOSS};\n\n\n    /*\n    // Default constructor. Creates a model only (without training).\n    // Should be followed by one form of the train(...) function.\n    //\n    // API\n    // CvGBTrees();\n\n    // INPUT\n    // OUTPUT\n    // RESULT\n    */\n    CV_WRAP CvGBTrees();\n\n\n    /*\n    // Full form constructor. Creates a gradient boosting model and does the\n    // train.\n    //\n    // API\n    // CvGBTrees( const CvMat* trainData, int tflag,\n             const CvMat* responses, const CvMat* varIdx=0,\n             const CvMat* sampleIdx=0, const CvMat* varType=0,\n             const CvMat* missingDataMask=0,\n             CvGBTreesParams params=CvGBTreesParams() );\n\n    // INPUT\n    // trainData    - a set of input feature vectors.\n    //                  size of matrix is\n    //                  <count of samples> x <variables count>\n    //                  or <variables count> x <count of samples>\n    //                  depending on the tflag parameter.\n    //                  matrix values are float.\n    // tflag         - a flag showing how do samples stored in the\n    //                  trainData matrix row by row (tflag=CV_ROW_SAMPLE)\n    //                  or column by column (tflag=CV_COL_SAMPLE).\n    // responses     - a vector of responses corresponding to the samples\n    //                  in trainData.\n    // varIdx       - indices of used variables. zero value means that all\n    //                  variables are active.\n    // sampleIdx    - indices of used samples. zero value means that all\n    //                  samples from trainData are in the training set.\n    // varType      - vector of <variables count> length. gives every\n    //                  variable type CV_VAR_CATEGORICAL or CV_VAR_ORDERED.\n    //                  varType = 0 means all variables are numerical.\n    // missingDataMask  - a mask of misiing values in trainData.\n    //                  missingDataMask = 0 means that there are no missing\n    //                  values.\n    // params         - parameters of GTB algorithm.\n    // OUTPUT\n    // RESULT\n    */\n    CvGBTrees( const CvMat* trainData, int tflag,\n             const CvMat* responses, const CvMat* varIdx=0,\n             const CvMat* sampleIdx=0, const CvMat* varType=0,\n             const CvMat* missingDataMask=0,\n             CvGBTreesParams params=CvGBTreesParams() );\n\n\n    /*\n    // Destructor.\n    */\n    virtual ~CvGBTrees();\n\n\n    /*\n    // Gradient tree boosting model training\n    //\n    // API\n    // virtual bool train( const CvMat* trainData, int tflag,\n             const CvMat* responses, const CvMat* varIdx=0,\n             const CvMat* sampleIdx=0, const CvMat* varType=0,\n             const CvMat* missingDataMask=0,\n             CvGBTreesParams params=CvGBTreesParams(),\n             bool update=false );\n\n    // INPUT\n    // trainData    - a set of input feature vectors.\n    //                  size of matrix is\n    //                  <count of samples> x <variables count>\n    //                  or <variables count> x <count of samples>\n    //                  depending on the tflag parameter.\n    //                  matrix values are float.\n    // tflag         - a flag showing how do samples stored in the\n    //                  trainData matrix row by row (tflag=CV_ROW_SAMPLE)\n    //                  or column by column (tflag=CV_COL_SAMPLE).\n    // responses     - a vector of responses corresponding to the samples\n    //                  in trainData.\n    // varIdx       - indices of used variables. zero value means that all\n    //                  variables are active.\n    // sampleIdx    - indices of used samples. zero value means that all\n    //                  samples from trainData are in the training set.\n    // varType      - vector of <variables count> length. gives every\n    //                  variable type CV_VAR_CATEGORICAL or CV_VAR_ORDERED.\n    //                  varType = 0 means all variables are numerical.\n    // missingDataMask  - a mask of misiing values in trainData.\n    //                  missingDataMask = 0 means that there are no missing\n    //                  values.\n    // params         - parameters of GTB algorithm.\n    // update         - is not supported now. (!)\n    // OUTPUT\n    // RESULT\n    // Error state.\n    */\n    virtual bool train( const CvMat* trainData, int tflag,\n             const CvMat* responses, const CvMat* varIdx=0,\n             const CvMat* sampleIdx=0, const CvMat* varType=0,\n             const CvMat* missingDataMask=0,\n             CvGBTreesParams params=CvGBTreesParams(),\n             bool update=false );\n\n\n    /*\n    // Gradient tree boosting model training\n    //\n    // API\n    // virtual bool train( CvMLData* data,\n             CvGBTreesParams params=CvGBTreesParams(),\n             bool update=false ) {return false;};\n\n    // INPUT\n    // data          - training set.\n    // params        - parameters of GTB algorithm.\n    // update        - is not supported now. (!)\n    // OUTPUT\n    // RESULT\n    // Error state.\n    */\n    virtual bool train( CvMLData* data,\n             CvGBTreesParams params=CvGBTreesParams(),\n             bool update=false );\n\n\n    /*\n    // Response value prediction\n    //\n    // API\n    // virtual float predict_serial( const CvMat* sample, const CvMat* missing=0,\n             CvMat* weak_responses=0, CvSlice slice = CV_WHOLE_SEQ,\n             int k=-1 ) const;\n\n    // INPUT\n    // sample         - input sample of the same type as in the training set.\n    // missing        - missing values mask. missing=0 if there are no\n    //                   missing values in sample vector.\n    // weak_responses  - predictions of all of the trees.\n    //                   not implemented (!)\n    // slice           - part of the ensemble used for prediction.\n    //                   slice = CV_WHOLE_SEQ when all trees are used.\n    // k               - number of ensemble used.\n    //                   k is in {-1,0,1,..,<count of output classes-1>}.\n    //                   in the case of classification problem\n    //                   <count of output classes-1> ensembles are built.\n    //                   If k = -1 ordinary prediction is the result,\n    //                   otherwise function gives the prediction of the\n    //                   k-th ensemble only.\n    // OUTPUT\n    // RESULT\n    // Predicted value.\n    */\n    virtual float predict_serial( const CvMat* sample, const CvMat* missing=0,\n            CvMat* weakResponses=0, CvSlice slice = CV_WHOLE_SEQ,\n            int k=-1 ) const;\n\n    /*\n    // Response value prediction.\n    // Parallel version (in the case of TBB existence)\n    //\n    // API\n    // virtual float predict( const CvMat* sample, const CvMat* missing=0,\n             CvMat* weak_responses=0, CvSlice slice = CV_WHOLE_SEQ,\n             int k=-1 ) const;\n\n    // INPUT\n    // sample         - input sample of the same type as in the training set.\n    // missing        - missing values mask. missing=0 if there are no\n    //                   missing values in sample vector.\n    // weak_responses  - predictions of all of the trees.\n    //                   not implemented (!)\n    // slice           - part of the ensemble used for prediction.\n    //                   slice = CV_WHOLE_SEQ when all trees are used.\n    // k               - number of ensemble used.\n    //                   k is in {-1,0,1,..,<count of output classes-1>}.\n    //                   in the case of classification problem\n    //                   <count of output classes-1> ensembles are built.\n    //                   If k = -1 ordinary prediction is the result,\n    //                   otherwise function gives the prediction of the\n    //                   k-th ensemble only.\n    // OUTPUT\n    // RESULT\n    // Predicted value.\n    */\n    virtual float predict( const CvMat* sample, const CvMat* missing=0,\n            CvMat* weakResponses=0, CvSlice slice = CV_WHOLE_SEQ,\n            int k=-1 ) const;\n\n    /*\n    // Deletes all the data.\n    //\n    // API\n    // virtual void clear();\n\n    // INPUT\n    // OUTPUT\n    // delete data, weak, orig_response, sum_response,\n    //        weak_eval, subsample_train, subsample_test,\n    //        sample_idx, missing, lass_labels\n    // delta = 0.0\n    // RESULT\n    */\n    CV_WRAP virtual void clear();\n\n    /*\n    // Compute error on the train/test set.\n    //\n    // API\n    // virtual float calc_error( CvMLData* _data, int type,\n    //        std::vector<float> *resp = 0 );\n    //\n    // INPUT\n    // data  - dataset\n    // type  - defines which error is to compute: train (CV_TRAIN_ERROR) or\n    //         test (CV_TEST_ERROR).\n    // OUTPUT\n    // resp  - vector of predicitons\n    // RESULT\n    // Error value.\n    */\n    virtual float calc_error( CvMLData* _data, int type,\n            std::vector<float> *resp = 0 );\n\n    /*\n    //\n    // Write parameters of the gtb model and data. Write learned model.\n    //\n    // API\n    // virtual void write( CvFileStorage* fs, const char* name ) const;\n    //\n    // INPUT\n    // fs     - file storage to read parameters from.\n    // name   - model name.\n    // OUTPUT\n    // RESULT\n    */\n    virtual void write( CvFileStorage* fs, const char* name ) const;\n\n\n    /*\n    //\n    // Read parameters of the gtb model and data. Read learned model.\n    //\n    // API\n    // virtual void read( CvFileStorage* fs, CvFileNode* node );\n    //\n    // INPUT\n    // fs     - file storage to read parameters from.\n    // node   - file node.\n    // OUTPUT\n    // RESULT\n    */\n    virtual void read( CvFileStorage* fs, CvFileNode* node );\n\n\n    // new-style C++ interface\n    CV_WRAP CvGBTrees( const cv::Mat& trainData, int tflag,\n              const cv::Mat& responses, const cv::Mat& varIdx=cv::Mat(),\n              const cv::Mat& sampleIdx=cv::Mat(), const cv::Mat& varType=cv::Mat(),\n              const cv::Mat& missingDataMask=cv::Mat(),\n              CvGBTreesParams params=CvGBTreesParams() );\n\n    CV_WRAP virtual bool train( const cv::Mat& trainData, int tflag,\n                       const cv::Mat& responses, const cv::Mat& varIdx=cv::Mat(),\n                       const cv::Mat& sampleIdx=cv::Mat(), const cv::Mat& varType=cv::Mat(),\n                       const cv::Mat& missingDataMask=cv::Mat(),\n                       CvGBTreesParams params=CvGBTreesParams(),\n                       bool update=false );\n\n    CV_WRAP virtual float predict( const cv::Mat& sample, const cv::Mat& missing=cv::Mat(),\n                           const cv::Range& slice = cv::Range::all(),\n                           int k=-1 ) const;\n\nprotected:\n\n    /*\n    // Compute the gradient vector components.\n    //\n    // API\n    // virtual void find_gradient( const int k = 0);\n\n    // INPUT\n    // k        - used for classification problem, determining current\n    //            tree ensemble.\n    // OUTPUT\n    // changes components of data->responses\n    // which correspond to samples used for training\n    // on the current step.\n    // RESULT\n    */\n    virtual void find_gradient( const int k = 0);\n\n\n    /*\n    //\n    // Change values in tree leaves according to the used loss function.\n    //\n    // API\n    // virtual void change_values(CvDTree* tree, const int k = 0);\n    //\n    // INPUT\n    // tree      - decision tree to change.\n    // k         - used for classification problem, determining current\n    //             tree ensemble.\n    // OUTPUT\n    // changes 'value' fields of the trees' leaves.\n    // changes sum_response_tmp.\n    // RESULT\n    */\n    virtual void change_values(CvDTree* tree, const int k = 0);\n\n\n    /*\n    //\n    // Find optimal constant prediction value according to the used loss\n    // function.\n    // The goal is to find a constant which gives the minimal summary loss\n    // on the _Idx samples.\n    //\n    // API\n    // virtual float find_optimal_value( const CvMat* _Idx );\n    //\n    // INPUT\n    // _Idx        - indices of the samples from the training set.\n    // OUTPUT\n    // RESULT\n    // optimal constant value.\n    */\n    virtual float find_optimal_value( const CvMat* _Idx );\n\n\n    /*\n    //\n    // Randomly split the whole training set in two parts according\n    // to params.portion.\n    //\n    // API\n    // virtual void do_subsample();\n    //\n    // INPUT\n    // OUTPUT\n    // subsample_train - indices of samples used for training\n    // subsample_test  - indices of samples used for test\n    // RESULT\n    */\n    virtual void do_subsample();\n\n\n    /*\n    //\n    // Internal recursive function giving an array of subtree tree leaves.\n    //\n    // API\n    // void leaves_get( CvDTreeNode** leaves, int& count, CvDTreeNode* node );\n    //\n    // INPUT\n    // node         - current leaf.\n    // OUTPUT\n    // count        - count of leaves in the subtree.\n    // leaves       - array of pointers to leaves.\n    // RESULT\n    */\n    void leaves_get( CvDTreeNode** leaves, int& count, CvDTreeNode* node );\n\n\n    /*\n    //\n    // Get leaves of the tree.\n    //\n    // API\n    // CvDTreeNode** GetLeaves( const CvDTree* dtree, int& len );\n    //\n    // INPUT\n    // dtree            - decision tree.\n    // OUTPUT\n    // len              - count of the leaves.\n    // RESULT\n    // CvDTreeNode**    - array of pointers to leaves.\n    */\n    CvDTreeNode** GetLeaves( const CvDTree* dtree, int& len );\n\n\n    /*\n    //\n    // Is it a regression or a classification.\n    //\n    // API\n    // bool problem_type();\n    //\n    // INPUT\n    // OUTPUT\n    // RESULT\n    // false if it is a classification problem,\n    // true - if regression.\n    */\n    virtual bool problem_type() const;\n\n\n    /*\n    //\n    // Write parameters of the gtb model.\n    //\n    // API\n    // virtual void write_params( CvFileStorage* fs ) const;\n    //\n    // INPUT\n    // fs           - file storage to write parameters to.\n    // OUTPUT\n    // RESULT\n    */\n    virtual void write_params( CvFileStorage* fs ) const;\n\n\n    /*\n    //\n    // Read parameters of the gtb model and data.\n    //\n    // API\n    // virtual void read_params( CvFileStorage* fs );\n    //\n    // INPUT\n    // fs           - file storage to read parameters from.\n    // OUTPUT\n    // params       - parameters of the gtb model.\n    // data         - contains information about the structure\n    //                of the data set (count of variables,\n    //                their types, etc.).\n    // class_labels - output class labels map.\n    // RESULT\n    */\n    virtual void read_params( CvFileStorage* fs, CvFileNode* fnode );\n    int get_len(const CvMat* mat) const;\n\n\n    CvDTreeTrainData* data;\n    CvGBTreesParams params;\n\n    CvSeq** weak;\n    CvMat* orig_response;\n    CvMat* sum_response;\n    CvMat* sum_response_tmp;\n    CvMat* sample_idx;\n    CvMat* subsample_train;\n    CvMat* subsample_test;\n    CvMat* missing;\n    CvMat* class_labels;\n\n    cv::RNG* rng;\n\n    int class_count;\n    float delta;\n    float base_value;\n\n};\n\n\n\n/****************************************************************************************\\\n*                              Artificial Neural Networks (ANN)                          *\n\\****************************************************************************************/\n\n/////////////////////////////////// Multi-Layer Perceptrons //////////////////////////////\n\nstruct CV_EXPORTS_W_MAP CvANN_MLP_TrainParams\n{\n    CvANN_MLP_TrainParams();\n    CvANN_MLP_TrainParams( CvTermCriteria term_crit, int train_method,\n                           double param1, double param2=0 );\n    ~CvANN_MLP_TrainParams();\n\n    enum { BACKPROP=0, RPROP=1 };\n\n    CV_PROP_RW CvTermCriteria term_crit;\n    CV_PROP_RW int train_method;\n\n    // backpropagation parameters\n    CV_PROP_RW double bp_dw_scale, bp_moment_scale;\n\n    // rprop parameters\n    CV_PROP_RW double rp_dw0, rp_dw_plus, rp_dw_minus, rp_dw_min, rp_dw_max;\n};\n\n\nclass CV_EXPORTS_W CvANN_MLP : public CvStatModel\n{\npublic:\n    CV_WRAP CvANN_MLP();\n    CvANN_MLP( const CvMat* layerSizes,\n               int activateFunc=CvANN_MLP::SIGMOID_SYM,\n               double fparam1=0, double fparam2=0 );\n\n    virtual ~CvANN_MLP();\n\n    virtual void create( const CvMat* layerSizes,\n                         int activateFunc=CvANN_MLP::SIGMOID_SYM,\n                         double fparam1=0, double fparam2=0 );\n\n    virtual int train( const CvMat* inputs, const CvMat* outputs,\n                       const CvMat* sampleWeights, const CvMat* sampleIdx=0,\n                       CvANN_MLP_TrainParams params = CvANN_MLP_TrainParams(),\n                       int flags=0 );\n    virtual float predict( const CvMat* inputs, CV_OUT CvMat* outputs ) const;\n\n    CV_WRAP CvANN_MLP( const cv::Mat& layerSizes,\n              int activateFunc=CvANN_MLP::SIGMOID_SYM,\n              double fparam1=0, double fparam2=0 );\n\n    CV_WRAP virtual void create( const cv::Mat& layerSizes,\n                        int activateFunc=CvANN_MLP::SIGMOID_SYM,\n                        double fparam1=0, double fparam2=0 );\n\n    CV_WRAP virtual int train( const cv::Mat& inputs, const cv::Mat& outputs,\n                      const cv::Mat& sampleWeights, const cv::Mat& sampleIdx=cv::Mat(),\n                      CvANN_MLP_TrainParams params = CvANN_MLP_TrainParams(),\n                      int flags=0 );\n\n    CV_WRAP virtual float predict( const cv::Mat& inputs, CV_OUT cv::Mat& outputs ) const;\n\n    CV_WRAP virtual void clear();\n\n    // possible activation functions\n    enum { IDENTITY = 0, SIGMOID_SYM = 1, GAUSSIAN = 2 };\n\n    // available training flags\n    enum { UPDATE_WEIGHTS = 1, NO_INPUT_SCALE = 2, NO_OUTPUT_SCALE = 4 };\n\n    virtual void read( CvFileStorage* fs, CvFileNode* node );\n    virtual void write( CvFileStorage* storage, const char* name ) const;\n\n    int get_layer_count() { return layer_sizes ? layer_sizes->cols : 0; }\n    const CvMat* get_layer_sizes() { return layer_sizes; }\n    double* get_weights(int layer)\n    {\n        return layer_sizes && weights &&\n            (unsigned)layer <= (unsigned)layer_sizes->cols ? weights[layer] : 0;\n    }\n\n    virtual void calc_activ_func_deriv( CvMat* xf, CvMat* deriv, const double* bias ) const;\n\nprotected:\n\n    virtual bool prepare_to_train( const CvMat* _inputs, const CvMat* _outputs,\n            const CvMat* _sample_weights, const CvMat* sampleIdx,\n            CvVectors* _ivecs, CvVectors* _ovecs, double** _sw, int _flags );\n\n    // sequential random backpropagation\n    virtual int train_backprop( CvVectors _ivecs, CvVectors _ovecs, const double* _sw );\n\n    // RPROP algorithm\n    virtual int train_rprop( CvVectors _ivecs, CvVectors _ovecs, const double* _sw );\n\n    virtual void calc_activ_func( CvMat* xf, const double* bias ) const;\n    virtual void set_activ_func( int _activ_func=SIGMOID_SYM,\n                                 double _f_param1=0, double _f_param2=0 );\n    virtual void init_weights();\n    virtual void scale_input( const CvMat* _src, CvMat* _dst ) const;\n    virtual void scale_output( const CvMat* _src, CvMat* _dst ) const;\n    virtual void calc_input_scale( const CvVectors* vecs, int flags );\n    virtual void calc_output_scale( const CvVectors* vecs, int flags );\n\n    virtual void write_params( CvFileStorage* fs ) const;\n    virtual void read_params( CvFileStorage* fs, CvFileNode* node );\n\n    CvMat* layer_sizes;\n    CvMat* wbuf;\n    CvMat* sample_weights;\n    double** weights;\n    double f_param1, f_param2;\n    double min_val, max_val, min_val1, max_val1;\n    int activ_func;\n    int max_count, max_buf_sz;\n    CvANN_MLP_TrainParams params;\n    cv::RNG* rng;\n};\n\n/****************************************************************************************\\\n*                           Auxilary functions declarations                              *\n\\****************************************************************************************/\n\n/* Generates <sample> from multivariate normal distribution, where <mean> - is an\n   average row vector, <cov> - symmetric covariation matrix */\nCVAPI(void) cvRandMVNormal( CvMat* mean, CvMat* cov, CvMat* sample,\n                           CvRNG* rng CV_DEFAULT(0) );\n\n/* Generates sample from gaussian mixture distribution */\nCVAPI(void) cvRandGaussMixture( CvMat* means[],\n                               CvMat* covs[],\n                               float weights[],\n                               int clsnum,\n                               CvMat* sample,\n                               CvMat* sampClasses CV_DEFAULT(0) );\n\n#define CV_TS_CONCENTRIC_SPHERES 0\n\n/* creates test set */\nCVAPI(void) cvCreateTestSet( int type, CvMat** samples,\n                 int num_samples,\n                 int num_features,\n                 CvMat** responses,\n                 int num_classes, ... );\n\n/****************************************************************************************\\\n*                                      Data                                             *\n\\****************************************************************************************/\n\n#define CV_COUNT     0\n#define CV_PORTION   1\n\nstruct CV_EXPORTS CvTrainTestSplit\n{\n    CvTrainTestSplit();\n    CvTrainTestSplit( int train_sample_count, bool mix = true);\n    CvTrainTestSplit( float train_sample_portion, bool mix = true);\n\n    union\n    {\n        int count;\n        float portion;\n    } train_sample_part;\n    int train_sample_part_mode;\n\n    bool mix;\n};\n\nclass CV_EXPORTS CvMLData\n{\npublic:\n    CvMLData();\n    virtual ~CvMLData();\n\n    // returns:\n    // 0 - OK\n    // -1 - file can not be opened or is not correct\n    int read_csv( const char* filename );\n\n    const CvMat* get_values() const;\n    const CvMat* get_responses();\n    const CvMat* get_missing() const;\n\n    void set_response_idx( int idx ); // old response become predictors, new response_idx = idx\n                                      // if idx < 0 there will be no response\n    int get_response_idx() const;\n\n    void set_train_test_split( const CvTrainTestSplit * spl );\n    const CvMat* get_train_sample_idx() const;\n    const CvMat* get_test_sample_idx() const;\n    void mix_train_and_test_idx();\n\n    const CvMat* get_var_idx();\n    void chahge_var_idx( int vi, bool state ); // misspelled (saved for back compitability),\n                                               // use change_var_idx\n    void change_var_idx( int vi, bool state ); // state == true to set vi-variable as predictor\n\n    const CvMat* get_var_types();\n    int get_var_type( int var_idx ) const;\n    // following 2 methods enable to change vars type\n    // use these methods to assign CV_VAR_CATEGORICAL type for categorical variable\n    // with numerical labels; in the other cases var types are correctly determined automatically\n    void set_var_types( const char* str );  // str examples:\n                                            // \"ord[0-17],cat[18]\", \"ord[0,2,4,10-12], cat[1,3,5-9,13,14]\",\n                                            // \"cat\", \"ord\" (all vars are categorical/ordered)\n    void change_var_type( int var_idx, int type); // type in { CV_VAR_ORDERED, CV_VAR_CATEGORICAL }\n\n    void set_delimiter( char ch );\n    char get_delimiter() const;\n\n    void set_miss_ch( char ch );\n    char get_miss_ch() const;\n\n    const std::map<std::string, int>& get_class_labels_map() const;\n\nprotected:\n    virtual void clear();\n\n    void str_to_flt_elem( const char* token, float& flt_elem, int& type);\n    void free_train_test_idx();\n\n    char delimiter;\n    char miss_ch;\n    //char flt_separator;\n\n    CvMat* values;\n    CvMat* missing;\n    CvMat* var_types;\n    CvMat* var_idx_mask;\n\n    CvMat* response_out; // header\n    CvMat* var_idx_out; // mat\n    CvMat* var_types_out; // mat\n\n    int response_idx;\n\n    int train_sample_count;\n    bool mix;\n\n    int total_class_count;\n    std::map<std::string, int> class_map;\n\n    CvMat* train_sample_idx;\n    CvMat* test_sample_idx;\n    int* sample_idx; // data of train_sample_idx and test_sample_idx\n\n    cv::RNG* rng;\n};\n\n\nnamespace cv\n{\n\ntypedef CvStatModel StatModel;\ntypedef CvParamGrid ParamGrid;\ntypedef CvNormalBayesClassifier NormalBayesClassifier;\ntypedef CvKNearest KNearest;\ntypedef CvSVMParams SVMParams;\ntypedef CvSVMKernel SVMKernel;\ntypedef CvSVMSolver SVMSolver;\ntypedef CvSVM SVM;\ntypedef CvDTreeParams DTreeParams;\ntypedef CvMLData TrainData;\ntypedef CvDTree DecisionTree;\ntypedef CvForestTree ForestTree;\ntypedef CvRTParams RandomTreeParams;\ntypedef CvRTrees RandomTrees;\ntypedef CvERTreeTrainData ERTreeTRainData;\ntypedef CvForestERTree ERTree;\ntypedef CvERTrees ERTrees;\ntypedef CvBoostParams BoostParams;\ntypedef CvBoostTree BoostTree;\ntypedef CvBoost Boost;\ntypedef CvANN_MLP_TrainParams ANN_MLP_TrainParams;\ntypedef CvANN_MLP NeuralNet_MLP;\ntypedef CvGBTreesParams GradientBoostingTreeParams;\ntypedef CvGBTrees GradientBoostingTrees;\n\ntemplate<> CV_EXPORTS void Ptr<CvDTreeSplit>::delete_obj();\n\nCV_EXPORTS bool initModule_ml(void);\n\n}\n\n#endif // __cplusplus\n#endif // __OPENCV_ML_HPP__\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/nonfree/features2d.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_NONFREE_FEATURES_2D_HPP__\n#define __OPENCV_NONFREE_FEATURES_2D_HPP__\n\n#include \"opencv2/features2d/features2d.hpp\"\n\n#ifdef __cplusplus\n\nnamespace cv\n{\n\n/*!\n SIFT implementation.\n\n The class implements SIFT algorithm by D. Lowe.\n*/\nclass CV_EXPORTS_W SIFT : public Feature2D\n{\npublic:\n    CV_WRAP explicit SIFT( int nfeatures=0, int nOctaveLayers=3,\n          double contrastThreshold=0.04, double edgeThreshold=10,\n          double sigma=1.6);\n\n    //! returns the descriptor size in floats (128)\n    CV_WRAP int descriptorSize() const;\n\n    //! returns the descriptor type\n    CV_WRAP int descriptorType() const;\n\n    //! finds the keypoints using SIFT algorithm\n    void operator()(InputArray img, InputArray mask,\n                    vector<KeyPoint>& keypoints) const;\n    //! finds the keypoints and computes descriptors for them using SIFT algorithm.\n    //! Optionally it can compute descriptors for the user-provided keypoints\n    void operator()(InputArray img, InputArray mask,\n                    vector<KeyPoint>& keypoints,\n                    OutputArray descriptors,\n                    bool useProvidedKeypoints=false) const;\n\n    AlgorithmInfo* info() const;\n\n    void buildGaussianPyramid( const Mat& base, vector<Mat>& pyr, int nOctaves ) const;\n    void buildDoGPyramid( const vector<Mat>& pyr, vector<Mat>& dogpyr ) const;\n    void findScaleSpaceExtrema( const vector<Mat>& gauss_pyr, const vector<Mat>& dog_pyr,\n                                vector<KeyPoint>& keypoints ) const;\n\nprotected:\n    void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n    void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;\n\n    CV_PROP_RW int nfeatures;\n    CV_PROP_RW int nOctaveLayers;\n    CV_PROP_RW double contrastThreshold;\n    CV_PROP_RW double edgeThreshold;\n    CV_PROP_RW double sigma;\n};\n\ntypedef SIFT SiftFeatureDetector;\ntypedef SIFT SiftDescriptorExtractor;\n\n/*!\n SURF implementation.\n\n The class implements SURF algorithm by H. Bay et al.\n */\nclass CV_EXPORTS_W SURF : public Feature2D\n{\npublic:\n    //! the default constructor\n    CV_WRAP SURF();\n    //! the full constructor taking all the necessary parameters\n    explicit CV_WRAP SURF(double hessianThreshold,\n                  int nOctaves=4, int nOctaveLayers=2,\n                  bool extended=true, bool upright=false);\n\n    //! returns the descriptor size in float's (64 or 128)\n    CV_WRAP int descriptorSize() const;\n\n    //! returns the descriptor type\n    CV_WRAP int descriptorType() const;\n\n    //! finds the keypoints using fast hessian detector used in SURF\n    void operator()(InputArray img, InputArray mask,\n                    CV_OUT vector<KeyPoint>& keypoints) const;\n    //! finds the keypoints and computes their descriptors. Optionally it can compute descriptors for the user-provided keypoints\n    void operator()(InputArray img, InputArray mask,\n                    CV_OUT vector<KeyPoint>& keypoints,\n                    OutputArray descriptors,\n                    bool useProvidedKeypoints=false) const;\n\n    AlgorithmInfo* info() const;\n\n    CV_PROP_RW double hessianThreshold;\n    CV_PROP_RW int nOctaves;\n    CV_PROP_RW int nOctaveLayers;\n    CV_PROP_RW bool extended;\n    CV_PROP_RW bool upright;\n\nprotected:\n\n    void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;\n    void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;\n};\n\ntypedef SURF SurfFeatureDetector;\ntypedef SURF SurfDescriptorExtractor;\n\n} /* namespace cv */\n\n#endif /* __cplusplus */\n\n#endif\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/nonfree/gpu.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_NONFREE_GPU_HPP__\n#define __OPENCV_NONFREE_GPU_HPP__\n\n#include \"opencv2/core/gpumat.hpp\"\n\nnamespace cv { namespace gpu {\n\nclass CV_EXPORTS SURF_GPU\n{\npublic:\n    enum KeypointLayout\n    {\n        X_ROW = 0,\n        Y_ROW,\n        LAPLACIAN_ROW,\n        OCTAVE_ROW,\n        SIZE_ROW,\n        ANGLE_ROW,\n        HESSIAN_ROW,\n        ROWS_COUNT\n    };\n\n    //! the default constructor\n    SURF_GPU();\n    //! the full constructor taking all the necessary parameters\n    explicit SURF_GPU(double _hessianThreshold, int _nOctaves=4,\n         int _nOctaveLayers=2, bool _extended=false, float _keypointsRatio=0.01f, bool _upright = false);\n\n    //! returns the descriptor size in float's (64 or 128)\n    int descriptorSize() const;\n\n    //! upload host keypoints to device memory\n    void uploadKeypoints(const std::vector<KeyPoint>& keypoints, GpuMat& keypointsGPU);\n    //! download keypoints from device to host memory\n    void downloadKeypoints(const GpuMat& keypointsGPU, std::vector<KeyPoint>& keypoints);\n\n    //! download descriptors from device to host memory\n    void downloadDescriptors(const GpuMat& descriptorsGPU, std::vector<float>& descriptors);\n\n    //! finds the keypoints using fast hessian detector used in SURF\n    //! supports CV_8UC1 images\n    //! keypoints will have nFeature cols and 6 rows\n    //! keypoints.ptr<float>(X_ROW)[i] will contain x coordinate of i'th feature\n    //! keypoints.ptr<float>(Y_ROW)[i] will contain y coordinate of i'th feature\n    //! keypoints.ptr<float>(LAPLACIAN_ROW)[i] will contain laplacian sign of i'th feature\n    //! keypoints.ptr<float>(OCTAVE_ROW)[i] will contain octave of i'th feature\n    //! keypoints.ptr<float>(SIZE_ROW)[i] will contain size of i'th feature\n    //! keypoints.ptr<float>(ANGLE_ROW)[i] will contain orientation of i'th feature\n    //! keypoints.ptr<float>(HESSIAN_ROW)[i] will contain response of i'th feature\n    void operator()(const GpuMat& img, const GpuMat& mask, GpuMat& keypoints);\n    //! finds the keypoints and computes their descriptors.\n    //! Optionally it can compute descriptors for the user-provided keypoints and recompute keypoints direction\n    void operator()(const GpuMat& img, const GpuMat& mask, GpuMat& keypoints, GpuMat& descriptors,\n        bool useProvidedKeypoints = false);\n\n    void operator()(const GpuMat& img, const GpuMat& mask, std::vector<KeyPoint>& keypoints);\n    void operator()(const GpuMat& img, const GpuMat& mask, std::vector<KeyPoint>& keypoints, GpuMat& descriptors,\n        bool useProvidedKeypoints = false);\n\n    void operator()(const GpuMat& img, const GpuMat& mask, std::vector<KeyPoint>& keypoints, std::vector<float>& descriptors,\n        bool useProvidedKeypoints = false);\n\n    void releaseMemory();\n\n    // SURF parameters\n    double hessianThreshold;\n    int nOctaves;\n    int nOctaveLayers;\n    bool extended;\n    bool upright;\n\n    //! max keypoints = min(keypointsRatio * img.size().area(), 65535)\n    float keypointsRatio;\n\n    GpuMat sum, mask1, maskSum, intBuffer;\n\n    GpuMat det, trace;\n\n    GpuMat maxPosBuffer;\n};\n\n} // namespace gpu\n\n} // namespace cv\n\n#endif // __OPENCV_NONFREE_GPU_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/nonfree/nonfree.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_NONFREE_HPP__\n#define __OPENCV_NONFREE_HPP__\n\n#include \"opencv2/nonfree/features2d.hpp\"\n\nnamespace cv\n{\n\nCV_EXPORTS_W bool initModule_nonfree();\n\n}\n\n#endif\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/nonfree/ocl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n// By downloading, copying, installing or using the software you agree to this license.\n// If you do not agree to this license, do not download, install,\n// copy or use the software.\n//\n//\n// License Agreement\n// For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n// * Redistribution's of source code must retain the above copyright notice,\n// this list of conditions and the following disclaimer.\n//\n// * Redistribution's in binary form must reproduce the above copyright notice,\n// this list of conditions and the following disclaimer in the documentation\n// and/or other materials provided with the distribution.\n//\n// * The name of the copyright holders may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_NONFREE_OCL_HPP__\n#define __OPENCV_NONFREE_OCL_HPP__\n\n#include \"opencv2/ocl/ocl.hpp\"\n\nnamespace cv\n{\n    namespace ocl\n    {\n        //! Speeded up robust features, port from GPU module.\n        ////////////////////////////////// SURF //////////////////////////////////////////\n\n        class CV_EXPORTS SURF_OCL : public cv::Feature2D\n        {\n        public:\n            enum KeypointLayout\n            {\n                X_ROW = 0,\n                Y_ROW,\n                LAPLACIAN_ROW,\n                OCTAVE_ROW,\n                SIZE_ROW,\n                ANGLE_ROW,\n                HESSIAN_ROW,\n                ROWS_COUNT\n            };\n\n            //! the default constructor\n            SURF_OCL();\n            //! the full constructor taking all the necessary parameters\n            explicit SURF_OCL(double _hessianThreshold, int _nOctaves = 4,\n                              int _nOctaveLayers = 2, bool _extended = true, float _keypointsRatio = 0.01f, bool _upright = false);\n\n            //! returns the descriptor size in float's (64 or 128)\n            int descriptorSize() const;\n\n            int descriptorType() const;\n\n            //! upload host keypoints to device memory\n            void uploadKeypoints(const vector<cv::KeyPoint> &keypoints, oclMat &keypointsocl);\n            //! download keypoints from device to host memory\n            void downloadKeypoints(const oclMat &keypointsocl, vector<KeyPoint> &keypoints);\n            //! download descriptors from device to host memory\n            void downloadDescriptors(const oclMat &descriptorsocl, vector<float> &descriptors);\n            //! finds the keypoints using fast hessian detector used in SURF\n            //! supports CV_8UC1 images\n            //! keypoints will have nFeature cols and 6 rows\n            //! keypoints.ptr<float>(X_ROW)[i] will contain x coordinate of i'th feature\n            //! keypoints.ptr<float>(Y_ROW)[i] will contain y coordinate of i'th feature\n            //! keypoints.ptr<float>(LAPLACIAN_ROW)[i] will contain laplacian sign of i'th feature\n            //! keypoints.ptr<float>(OCTAVE_ROW)[i] will contain octave of i'th feature\n            //! keypoints.ptr<float>(SIZE_ROW)[i] will contain size of i'th feature\n            //! keypoints.ptr<float>(ANGLE_ROW)[i] will contain orientation of i'th feature\n            //! keypoints.ptr<float>(HESSIAN_ROW)[i] will contain response of i'th feature\n            void operator()(const oclMat &img, const oclMat &mask, oclMat &keypoints);\n            //! finds the keypoints and computes their descriptors.\n            //! Optionally it can compute descriptors for the user-provided keypoints and recompute keypoints direction\n            void operator()(const oclMat &img, const oclMat &mask, oclMat &keypoints, oclMat &descriptors,\n                            bool useProvidedKeypoints = false);\n            void operator()(const oclMat &img, const oclMat &mask, std::vector<KeyPoint> &keypoints);\n            void operator()(const oclMat &img, const oclMat &mask, std::vector<KeyPoint> &keypoints, oclMat &descriptors,\n                            bool useProvidedKeypoints = false);\n            void operator()(const oclMat &img, const oclMat &mask, std::vector<KeyPoint> &keypoints, std::vector<float> &descriptors,\n                            bool useProvidedKeypoints = false);\n\n            //! finds the keypoints using fast hessian detector used in SURF\n            void operator()(InputArray img, InputArray mask,\n                            CV_OUT vector<KeyPoint>& keypoints) const;\n            //! finds the keypoints and computes their descriptors. Optionally it can compute descriptors for the user-provided keypoints\n            void operator()(InputArray img, InputArray mask,\n                            CV_OUT vector<KeyPoint>& keypoints,\n                            OutputArray descriptors,\n                            bool useProvidedKeypoints=false) const;\n\n            AlgorithmInfo* info() const;\n\n            void releaseMemory();\n\n            // SURF parameters\n            float hessianThreshold;\n            int nOctaves;\n            int nOctaveLayers;\n            bool extended;\n            bool upright;\n            //! max keypoints = min(keypointsRatio * img.size().area(), 65535)\n            float keypointsRatio;\n            oclMat sum, mask1, maskSum, intBuffer;\n            oclMat det, trace;\n            oclMat maxPosBuffer;\n        protected:\n            void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask) const;\n            void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors) const;\n        };\n    }\n}\n\n#endif //__OPENCV_NONFREE_OCL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/objdetect/objdetect.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OBJDETECT_HPP__\n#define __OPENCV_OBJDETECT_HPP__\n\n#include \"opencv2/core/core.hpp\"\n\n#ifdef __cplusplus\n#include <map>\n#include <deque>\n\nextern \"C\" {\n#endif\n\n/****************************************************************************************\\\n*                         Haar-like Object Detection functions                           *\n\\****************************************************************************************/\n\n#define CV_HAAR_MAGIC_VAL    0x42500000\n#define CV_TYPE_NAME_HAAR    \"opencv-haar-classifier\"\n\n#define CV_IS_HAAR_CLASSIFIER( haar )                                                    \\\n    ((haar) != NULL &&                                                                   \\\n    (((const CvHaarClassifierCascade*)(haar))->flags & CV_MAGIC_MASK)==CV_HAAR_MAGIC_VAL)\n\n#define CV_HAAR_FEATURE_MAX  3\n\ntypedef struct CvHaarFeature\n{\n    int tilted;\n    struct\n    {\n        CvRect r;\n        float weight;\n    } rect[CV_HAAR_FEATURE_MAX];\n} CvHaarFeature;\n\ntypedef struct CvHaarClassifier\n{\n    int count;\n    CvHaarFeature* haar_feature;\n    float* threshold;\n    int* left;\n    int* right;\n    float* alpha;\n} CvHaarClassifier;\n\ntypedef struct CvHaarStageClassifier\n{\n    int  count;\n    float threshold;\n    CvHaarClassifier* classifier;\n\n    int next;\n    int child;\n    int parent;\n} CvHaarStageClassifier;\n\ntypedef struct CvHidHaarClassifierCascade CvHidHaarClassifierCascade;\n\ntypedef struct CvHaarClassifierCascade\n{\n    int  flags;\n    int  count;\n    CvSize orig_window_size;\n    CvSize real_window_size;\n    double scale;\n    CvHaarStageClassifier* stage_classifier;\n    CvHidHaarClassifierCascade* hid_cascade;\n} CvHaarClassifierCascade;\n\ntypedef struct CvAvgComp\n{\n    CvRect rect;\n    int neighbors;\n} CvAvgComp;\n\n/* Loads haar classifier cascade from a directory.\n   It is obsolete: convert your cascade to xml and use cvLoad instead */\nCVAPI(CvHaarClassifierCascade*) cvLoadHaarClassifierCascade(\n                    const char* directory, CvSize orig_window_size);\n\nCVAPI(void) cvReleaseHaarClassifierCascade( CvHaarClassifierCascade** cascade );\n\n#define CV_HAAR_DO_CANNY_PRUNING    1\n#define CV_HAAR_SCALE_IMAGE         2\n#define CV_HAAR_FIND_BIGGEST_OBJECT 4\n#define CV_HAAR_DO_ROUGH_SEARCH     8\n\n//CVAPI(CvSeq*) cvHaarDetectObjectsForROC( const CvArr* image,\n//                     CvHaarClassifierCascade* cascade, CvMemStorage* storage,\n//                     CvSeq** rejectLevels, CvSeq** levelWeightds,\n//                     double scale_factor CV_DEFAULT(1.1),\n//                     int min_neighbors CV_DEFAULT(3), int flags CV_DEFAULT(0),\n//                     CvSize min_size CV_DEFAULT(cvSize(0,0)), CvSize max_size CV_DEFAULT(cvSize(0,0)),\n//                     bool outputRejectLevels = false );\n\n\nCVAPI(CvSeq*) cvHaarDetectObjects( const CvArr* image,\n                     CvHaarClassifierCascade* cascade, CvMemStorage* storage,\n                     double scale_factor CV_DEFAULT(1.1),\n                     int min_neighbors CV_DEFAULT(3), int flags CV_DEFAULT(0),\n                     CvSize min_size CV_DEFAULT(cvSize(0,0)), CvSize max_size CV_DEFAULT(cvSize(0,0)));\n\n/* sets images for haar classifier cascade */\nCVAPI(void) cvSetImagesForHaarClassifierCascade( CvHaarClassifierCascade* cascade,\n                                                const CvArr* sum, const CvArr* sqsum,\n                                                const CvArr* tilted_sum, double scale );\n\n/* runs the cascade on the specified window */\nCVAPI(int) cvRunHaarClassifierCascade( const CvHaarClassifierCascade* cascade,\n                                       CvPoint pt, int start_stage CV_DEFAULT(0));\n\n\n/****************************************************************************************\\\n*                         Latent SVM Object Detection functions                          *\n\\****************************************************************************************/\n\n// DataType: STRUCT position\n// Structure describes the position of the filter in the feature pyramid\n// l - level in the feature pyramid\n// (x, y) - coordinate in level l\ntypedef struct CvLSVMFilterPosition\n{\n    int x;\n    int y;\n    int l;\n} CvLSVMFilterPosition;\n\n// DataType: STRUCT filterObject\n// Description of the filter, which corresponds to the part of the object\n// V               - ideal (penalty = 0) position of the partial filter\n//                   from the root filter position (V_i in the paper)\n// penaltyFunction - vector describes penalty function (d_i in the paper)\n//                   pf[0] * x + pf[1] * y + pf[2] * x^2 + pf[3] * y^2\n// FILTER DESCRIPTION\n//   Rectangular map (sizeX x sizeY),\n//   every cell stores feature vector (dimension = p)\n// H               - matrix of feature vectors\n//                   to set and get feature vectors (i,j)\n//                   used formula H[(j * sizeX + i) * p + k], where\n//                   k - component of feature vector in cell (i, j)\n// END OF FILTER DESCRIPTION\ntypedef struct CvLSVMFilterObject{\n    CvLSVMFilterPosition V;\n    float fineFunction[4];\n    int sizeX;\n    int sizeY;\n    int numFeatures;\n    float *H;\n} CvLSVMFilterObject;\n\n// data type: STRUCT CvLatentSvmDetector\n// structure contains internal representation of trained Latent SVM detector\n// num_filters          - total number of filters (root plus part) in model\n// num_components       - number of components in model\n// num_part_filters     - array containing number of part filters for each component\n// filters              - root and part filters for all model components\n// b                    - biases for all model components\n// score_threshold      - confidence level threshold\ntypedef struct CvLatentSvmDetector\n{\n    int num_filters;\n    int num_components;\n    int* num_part_filters;\n    CvLSVMFilterObject** filters;\n    float* b;\n    float score_threshold;\n}\nCvLatentSvmDetector;\n\n// data type: STRUCT CvObjectDetection\n// structure contains the bounding box and confidence level for detected object\n// rect                 - bounding box for a detected object\n// score                - confidence level\ntypedef struct CvObjectDetection\n{\n    CvRect rect;\n    float score;\n} CvObjectDetection;\n\n//////////////// Object Detection using Latent SVM //////////////\n\n\n/*\n// load trained detector from a file\n//\n// API\n// CvLatentSvmDetector* cvLoadLatentSvmDetector(const char* filename);\n// INPUT\n// filename             - path to the file containing the parameters of\n                        - trained Latent SVM detector\n// OUTPUT\n// trained Latent SVM detector in internal representation\n*/\nCVAPI(CvLatentSvmDetector*) cvLoadLatentSvmDetector(const char* filename);\n\n/*\n// release memory allocated for CvLatentSvmDetector structure\n//\n// API\n// void cvReleaseLatentSvmDetector(CvLatentSvmDetector** detector);\n// INPUT\n// detector             - CvLatentSvmDetector structure to be released\n// OUTPUT\n*/\nCVAPI(void) cvReleaseLatentSvmDetector(CvLatentSvmDetector** detector);\n\n/*\n// find rectangular regions in the given image that are likely\n// to contain objects and corresponding confidence levels\n//\n// API\n// CvSeq* cvLatentSvmDetectObjects(const IplImage* image,\n//                                  CvLatentSvmDetector* detector,\n//                                  CvMemStorage* storage,\n//                                  float overlap_threshold = 0.5f,\n//                                  int numThreads = -1);\n// INPUT\n// image                - image to detect objects in\n// detector             - Latent SVM detector in internal representation\n// storage              - memory storage to store the resultant sequence\n//                          of the object candidate rectangles\n// overlap_threshold    - threshold for the non-maximum suppression algorithm\n                           = 0.5f [here will be the reference to original paper]\n// OUTPUT\n// sequence of detected objects (bounding boxes and confidence levels stored in CvObjectDetection structures)\n*/\nCVAPI(CvSeq*) cvLatentSvmDetectObjects(IplImage* image,\n                                CvLatentSvmDetector* detector,\n                                CvMemStorage* storage,\n                                float overlap_threshold CV_DEFAULT(0.5f),\n                                int numThreads CV_DEFAULT(-1));\n\n#ifdef __cplusplus\n}\n\nCV_EXPORTS CvSeq* cvHaarDetectObjectsForROC( const CvArr* image,\n                     CvHaarClassifierCascade* cascade, CvMemStorage* storage,\n                     std::vector<int>& rejectLevels, std::vector<double>& levelWeightds,\n                     double scale_factor CV_DEFAULT(1.1),\n                     int min_neighbors CV_DEFAULT(3), int flags CV_DEFAULT(0),\n                     CvSize min_size CV_DEFAULT(cvSize(0,0)), CvSize max_size CV_DEFAULT(cvSize(0,0)),\n                     bool outputRejectLevels = false );\n\nnamespace cv\n{\n\n///////////////////////////// Object Detection ////////////////////////////\n\n/*\n * This is a class wrapping up the structure CvLatentSvmDetector and functions working with it.\n * The class goals are:\n * 1) provide c++ interface;\n * 2) make it possible to load and detect more than one class (model) unlike CvLatentSvmDetector.\n */\nclass CV_EXPORTS LatentSvmDetector\n{\npublic:\n    struct CV_EXPORTS ObjectDetection\n    {\n        ObjectDetection();\n        ObjectDetection( const Rect& rect, float score, int classID=-1 );\n        Rect rect;\n        float score;\n        int classID;\n    };\n\n    LatentSvmDetector();\n    LatentSvmDetector( const vector<string>& filenames, const vector<string>& classNames=vector<string>() );\n    virtual ~LatentSvmDetector();\n\n    virtual void clear();\n    virtual bool empty() const;\n    bool load( const vector<string>& filenames, const vector<string>& classNames=vector<string>() );\n\n    virtual void detect( const Mat& image,\n                         vector<ObjectDetection>& objectDetections,\n                         float overlapThreshold=0.5f,\n                         int numThreads=-1 );\n\n    const vector<string>& getClassNames() const;\n    size_t getClassCount() const;\n\nprivate:\n    vector<CvLatentSvmDetector*> detectors;\n    vector<string> classNames;\n};\n\n// class for grouping object candidates, detected by Cascade Classifier, HOG etc.\n// instance of the class is to be passed to cv::partition (see cxoperations.hpp)\nclass CV_EXPORTS SimilarRects\n{\npublic:\n    SimilarRects(double _eps) : eps(_eps) {}\n    inline bool operator()(const Rect& r1, const Rect& r2) const\n    {\n        double delta = eps*(std::min(r1.width, r2.width) + std::min(r1.height, r2.height))*0.5;\n        return std::abs(r1.x - r2.x) <= delta &&\n            std::abs(r1.y - r2.y) <= delta &&\n            std::abs(r1.x + r1.width - r2.x - r2.width) <= delta &&\n            std::abs(r1.y + r1.height - r2.y - r2.height) <= delta;\n    }\n    double eps;\n};\n\nCV_EXPORTS void groupRectangles(CV_OUT CV_IN_OUT vector<Rect>& rectList, int groupThreshold, double eps=0.2);\nCV_EXPORTS_W void groupRectangles(CV_OUT CV_IN_OUT vector<Rect>& rectList, CV_OUT vector<int>& weights, int groupThreshold, double eps=0.2);\nCV_EXPORTS void groupRectangles( vector<Rect>& rectList, int groupThreshold, double eps, vector<int>* weights, vector<double>* levelWeights );\nCV_EXPORTS void groupRectangles(vector<Rect>& rectList, vector<int>& rejectLevels,\n                                vector<double>& levelWeights, int groupThreshold, double eps=0.2);\nCV_EXPORTS void groupRectangles_meanshift(vector<Rect>& rectList, vector<double>& foundWeights, vector<double>& foundScales,\n                                          double detectThreshold = 0.0, Size winDetSize = Size(64, 128));\n\n\nclass CV_EXPORTS FeatureEvaluator\n{\npublic:\n    enum { HAAR = 0, LBP = 1, HOG = 2 };\n    virtual ~FeatureEvaluator();\n\n    virtual bool read(const FileNode& node);\n    virtual Ptr<FeatureEvaluator> clone() const;\n    virtual int getFeatureType() const;\n\n    virtual bool setImage(const Mat& img, Size origWinSize);\n    virtual bool setWindow(Point p);\n\n    virtual double calcOrd(int featureIdx) const;\n    virtual int calcCat(int featureIdx) const;\n\n    static Ptr<FeatureEvaluator> create(int type);\n};\n\ntemplate<> CV_EXPORTS void Ptr<CvHaarClassifierCascade>::delete_obj();\n\nenum\n{\n    CASCADE_DO_CANNY_PRUNING=1,\n    CASCADE_SCALE_IMAGE=2,\n    CASCADE_FIND_BIGGEST_OBJECT=4,\n    CASCADE_DO_ROUGH_SEARCH=8\n};\n\nclass CV_EXPORTS_W CascadeClassifier\n{\npublic:\n    CV_WRAP CascadeClassifier();\n    CV_WRAP CascadeClassifier( const string& filename );\n    virtual ~CascadeClassifier();\n\n    CV_WRAP virtual bool empty() const;\n    CV_WRAP bool load( const string& filename );\n    virtual bool read( const FileNode& node );\n    CV_WRAP virtual void detectMultiScale( const Mat& image,\n                                   CV_OUT vector<Rect>& objects,\n                                   double scaleFactor=1.1,\n                                   int minNeighbors=3, int flags=0,\n                                   Size minSize=Size(),\n                                   Size maxSize=Size() );\n\n    CV_WRAP virtual void detectMultiScale( const Mat& image,\n                                   CV_OUT vector<Rect>& objects,\n                                   vector<int>& rejectLevels,\n                                   vector<double>& levelWeights,\n                                   double scaleFactor=1.1,\n                                   int minNeighbors=3, int flags=0,\n                                   Size minSize=Size(),\n                                   Size maxSize=Size(),\n                                   bool outputRejectLevels=false );\n\n\n    bool isOldFormatCascade() const;\n    virtual Size getOriginalWindowSize() const;\n    int getFeatureType() const;\n    bool setImage( const Mat& );\n\nprotected:\n    //virtual bool detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,\n    //                                int stripSize, int yStep, double factor, vector<Rect>& candidates );\n\n    virtual bool detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,\n                                    int stripSize, int yStep, double factor, vector<Rect>& candidates,\n                                    vector<int>& rejectLevels, vector<double>& levelWeights, bool outputRejectLevels=false);\n\nprotected:\n    enum { BOOST = 0 };\n    enum { DO_CANNY_PRUNING = 1, SCALE_IMAGE = 2,\n           FIND_BIGGEST_OBJECT = 4, DO_ROUGH_SEARCH = 8 };\n\n    friend class CascadeClassifierInvoker;\n\n    template<class FEval>\n    friend int predictOrdered( CascadeClassifier& cascade, Ptr<FeatureEvaluator> &featureEvaluator, double& weight);\n\n    template<class FEval>\n    friend int predictCategorical( CascadeClassifier& cascade, Ptr<FeatureEvaluator> &featureEvaluator, double& weight);\n\n    template<class FEval>\n    friend int predictOrderedStump( CascadeClassifier& cascade, Ptr<FeatureEvaluator> &featureEvaluator, double& weight);\n\n    template<class FEval>\n    friend int predictCategoricalStump( CascadeClassifier& cascade, Ptr<FeatureEvaluator> &featureEvaluator, double& weight);\n\n    bool setImage( Ptr<FeatureEvaluator>& feval, const Mat& image);\n    virtual int runAt( Ptr<FeatureEvaluator>& feval, Point pt, double& weight );\n\n    class Data\n    {\n    public:\n        struct CV_EXPORTS DTreeNode\n        {\n            int featureIdx;\n            float threshold; // for ordered features only\n            int left;\n            int right;\n        };\n\n        struct CV_EXPORTS DTree\n        {\n            int nodeCount;\n        };\n\n        struct CV_EXPORTS Stage\n        {\n            int first;\n            int ntrees;\n            float threshold;\n        };\n\n        bool read(const FileNode &node);\n\n        bool isStumpBased;\n\n        int stageType;\n        int featureType;\n        int ncategories;\n        Size origWinSize;\n\n        vector<Stage> stages;\n        vector<DTree> classifiers;\n        vector<DTreeNode> nodes;\n        vector<float> leaves;\n        vector<int> subsets;\n    };\n\n    Data data;\n    Ptr<FeatureEvaluator> featureEvaluator;\n    Ptr<CvHaarClassifierCascade> oldCascade;\n\npublic:\n    class CV_EXPORTS MaskGenerator\n    {\n    public:\n        virtual ~MaskGenerator() {}\n        virtual cv::Mat generateMask(const cv::Mat& src)=0;\n        virtual void initializeMask(const cv::Mat& /*src*/) {};\n    };\n    void setMaskGenerator(Ptr<MaskGenerator> maskGenerator);\n    Ptr<MaskGenerator> getMaskGenerator();\n\n    void setFaceDetectionMaskGenerator();\n\nprotected:\n    Ptr<MaskGenerator> maskGenerator;\n};\n\n\n//////////////// HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector //////////////\n\n// struct for detection region of interest (ROI)\nstruct DetectionROI\n{\n   // scale(size) of the bounding box\n   double scale;\n   // set of requrested locations to be evaluated\n   vector<cv::Point> locations;\n   // vector that will contain confidence values for each location\n   vector<double> confidences;\n};\n\nstruct CV_EXPORTS_W HOGDescriptor\n{\npublic:\n    enum { L2Hys=0 };\n    enum { DEFAULT_NLEVELS=64 };\n\n    CV_WRAP HOGDescriptor() : winSize(64,128), blockSize(16,16), blockStride(8,8),\n        cellSize(8,8), nbins(9), derivAperture(1), winSigma(-1),\n        histogramNormType(HOGDescriptor::L2Hys), L2HysThreshold(0.2), gammaCorrection(true),\n        nlevels(HOGDescriptor::DEFAULT_NLEVELS)\n    {}\n\n    CV_WRAP HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride,\n                  Size _cellSize, int _nbins, int _derivAperture=1, double _winSigma=-1,\n                  int _histogramNormType=HOGDescriptor::L2Hys,\n                  double _L2HysThreshold=0.2, bool _gammaCorrection=false,\n                  int _nlevels=HOGDescriptor::DEFAULT_NLEVELS)\n    : winSize(_winSize), blockSize(_blockSize), blockStride(_blockStride), cellSize(_cellSize),\n    nbins(_nbins), derivAperture(_derivAperture), winSigma(_winSigma),\n    histogramNormType(_histogramNormType), L2HysThreshold(_L2HysThreshold),\n    gammaCorrection(_gammaCorrection), nlevels(_nlevels)\n    {}\n\n    CV_WRAP HOGDescriptor(const String& filename)\n    {\n        load(filename);\n    }\n\n    HOGDescriptor(const HOGDescriptor& d)\n    {\n        d.copyTo(*this);\n    }\n\n    virtual ~HOGDescriptor() {}\n\n    CV_WRAP size_t getDescriptorSize() const;\n    CV_WRAP bool checkDetectorSize() const;\n    CV_WRAP double getWinSigma() const;\n\n    CV_WRAP virtual void setSVMDetector(InputArray _svmdetector);\n\n    virtual bool read(FileNode& fn);\n    virtual void write(FileStorage& fs, const String& objname) const;\n\n    CV_WRAP virtual bool load(const String& filename, const String& objname=String());\n    CV_WRAP virtual void save(const String& filename, const String& objname=String()) const;\n    virtual void copyTo(HOGDescriptor& c) const;\n\n    CV_WRAP virtual void compute(const Mat& img,\n                         CV_OUT vector<float>& descriptors,\n                         Size winStride=Size(), Size padding=Size(),\n                         const vector<Point>& locations=vector<Point>()) const;\n    //with found weights output\n    CV_WRAP virtual void detect(const Mat& img, CV_OUT vector<Point>& foundLocations,\n                        CV_OUT vector<double>& weights,\n                        double hitThreshold=0, Size winStride=Size(),\n                        Size padding=Size(),\n                        const vector<Point>& searchLocations=vector<Point>()) const;\n    //without found weights output\n    virtual void detect(const Mat& img, CV_OUT vector<Point>& foundLocations,\n                        double hitThreshold=0, Size winStride=Size(),\n                        Size padding=Size(),\n                        const vector<Point>& searchLocations=vector<Point>()) const;\n    //with result weights output\n    CV_WRAP virtual void detectMultiScale(const Mat& img, CV_OUT vector<Rect>& foundLocations,\n                                  CV_OUT vector<double>& foundWeights, double hitThreshold=0,\n                                  Size winStride=Size(), Size padding=Size(), double scale=1.05,\n                                  double finalThreshold=2.0,bool useMeanshiftGrouping = false) const;\n    //without found weights output\n    virtual void detectMultiScale(const Mat& img, CV_OUT vector<Rect>& foundLocations,\n                                  double hitThreshold=0, Size winStride=Size(),\n                                  Size padding=Size(), double scale=1.05,\n                                  double finalThreshold=2.0, bool useMeanshiftGrouping = false) const;\n\n    CV_WRAP virtual void computeGradient(const Mat& img, CV_OUT Mat& grad, CV_OUT Mat& angleOfs,\n                                 Size paddingTL=Size(), Size paddingBR=Size()) const;\n\n    CV_WRAP static vector<float> getDefaultPeopleDetector();\n    CV_WRAP static vector<float> getDaimlerPeopleDetector();\n\n    CV_PROP Size winSize;\n    CV_PROP Size blockSize;\n    CV_PROP Size blockStride;\n    CV_PROP Size cellSize;\n    CV_PROP int nbins;\n    CV_PROP int derivAperture;\n    CV_PROP double winSigma;\n    CV_PROP int histogramNormType;\n    CV_PROP double L2HysThreshold;\n    CV_PROP bool gammaCorrection;\n    CV_PROP vector<float> svmDetector;\n    CV_PROP int nlevels;\n\n\n   // evaluate specified ROI and return confidence value for each location\n   void detectROI(const cv::Mat& img, const vector<cv::Point> &locations,\n                                   CV_OUT std::vector<cv::Point>& foundLocations, CV_OUT std::vector<double>& confidences,\n                                   double hitThreshold = 0, cv::Size winStride = Size(),\n                                   cv::Size padding = Size()) const;\n\n   // evaluate specified ROI and return confidence value for each location in multiple scales\n   void detectMultiScaleROI(const cv::Mat& img,\n                                                       CV_OUT std::vector<cv::Rect>& foundLocations,\n                                                       std::vector<DetectionROI>& locations,\n                                                       double hitThreshold = 0,\n                                                       int groupThreshold = 0) const;\n\n   // read/parse Dalal's alt model file\n   void readALTModel(std::string modelfile);\n   void groupRectangles(vector<cv::Rect>& rectList, vector<double>& weights, int groupThreshold, double eps) const;\n};\n\n\nCV_EXPORTS_W void findDataMatrix(InputArray image,\n                                 CV_OUT vector<string>& codes,\n                                 OutputArray corners=noArray(),\n                                 OutputArrayOfArrays dmtx=noArray());\nCV_EXPORTS_W void drawDataMatrixCodes(InputOutputArray image,\n                                      const vector<string>& codes,\n                                      InputArray corners);\n}\n\n/****************************************************************************************\\\n*                                Datamatrix                                              *\n\\****************************************************************************************/\n\nstruct CV_EXPORTS CvDataMatrixCode {\n  char msg[4];\n  CvMat *original;\n  CvMat *corners;\n};\n\nCV_EXPORTS std::deque<CvDataMatrixCode> cvFindDataMatrix(CvMat *im);\n\n/****************************************************************************************\\\n*                                 LINE-MOD                                               *\n\\****************************************************************************************/\n\nnamespace cv {\nnamespace linemod {\n\nusing cv::FileNode;\nusing cv::FileStorage;\nusing cv::Mat;\nusing cv::noArray;\nusing cv::OutputArrayOfArrays;\nusing cv::Point;\nusing cv::Ptr;\nusing cv::Rect;\nusing cv::Size;\n\n/// @todo Convert doxy comments to rst\n\n/**\n * \\brief Discriminant feature described by its location and label.\n */\nstruct CV_EXPORTS Feature\n{\n  int x; ///< x offset\n  int y; ///< y offset\n  int label; ///< Quantization\n\n  Feature() : x(0), y(0), label(0) {}\n  Feature(int x, int y, int label);\n\n  void read(const FileNode& fn);\n  void write(FileStorage& fs) const;\n};\n\ninline Feature::Feature(int _x, int _y, int _label) : x(_x), y(_y), label(_label) {}\n\nstruct CV_EXPORTS Template\n{\n  int width;\n  int height;\n  int pyramid_level;\n  std::vector<Feature> features;\n\n  void read(const FileNode& fn);\n  void write(FileStorage& fs) const;\n};\n\n/**\n * \\brief Represents a modality operating over an image pyramid.\n */\nclass QuantizedPyramid\n{\npublic:\n  // Virtual destructor\n  virtual ~QuantizedPyramid() {}\n\n  /**\n   * \\brief Compute quantized image at current pyramid level for online detection.\n   *\n   * \\param[out] dst The destination 8-bit image. For each pixel at most one bit is set,\n   *                 representing its classification.\n   */\n  virtual void quantize(Mat& dst) const =0;\n\n  /**\n   * \\brief Extract most discriminant features at current pyramid level to form a new template.\n   *\n   * \\param[out] templ The new template.\n   */\n  virtual bool extractTemplate(Template& templ) const =0;\n\n  /**\n   * \\brief Go to the next pyramid level.\n   *\n   * \\todo Allow pyramid scale factor other than 2\n   */\n  virtual void pyrDown() =0;\n\nprotected:\n  /// Candidate feature with a score\n  struct Candidate\n  {\n    Candidate(int x, int y, int label, float score);\n\n    /// Sort candidates with high score to the front\n    bool operator<(const Candidate& rhs) const\n    {\n      return score > rhs.score;\n    }\n\n    Feature f;\n    float score;\n  };\n\n  /**\n   * \\brief Choose candidate features so that they are not bunched together.\n   *\n   * \\param[in]  candidates   Candidate features sorted by score.\n   * \\param[out] features     Destination vector of selected features.\n   * \\param[in]  num_features Number of candidates to select.\n   * \\param[in]  distance     Hint for desired distance between features.\n   */\n  static void selectScatteredFeatures(const std::vector<Candidate>& candidates,\n                                      std::vector<Feature>& features,\n                                      size_t num_features, float distance);\n};\n\ninline QuantizedPyramid::Candidate::Candidate(int x, int y, int label, float _score) : f(x, y, label), score(_score) {}\n\n/**\n * \\brief Interface for modalities that plug into the LINE template matching representation.\n *\n * \\todo Max response, to allow optimization of summing (255/MAX) features as uint8\n */\nclass CV_EXPORTS Modality\n{\npublic:\n  // Virtual destructor\n  virtual ~Modality() {}\n\n  /**\n   * \\brief Form a quantized image pyramid from a source image.\n   *\n   * \\param[in] src  The source image. Type depends on the modality.\n   * \\param[in] mask Optional mask. If not empty, unmasked pixels are set to zero\n   *                 in quantized image and cannot be extracted as features.\n   */\n  Ptr<QuantizedPyramid> process(const Mat& src,\n                    const Mat& mask = Mat()) const\n  {\n    return processImpl(src, mask);\n  }\n\n  virtual std::string name() const =0;\n\n  virtual void read(const FileNode& fn) =0;\n  virtual void write(FileStorage& fs) const =0;\n\n  /**\n   * \\brief Create modality by name.\n   *\n   * The following modality types are supported:\n   * - \"ColorGradient\"\n   * - \"DepthNormal\"\n   */\n  static Ptr<Modality> create(const std::string& modality_type);\n\n  /**\n   * \\brief Load a modality from file.\n   */\n  static Ptr<Modality> create(const FileNode& fn);\n\nprotected:\n  // Indirection is because process() has a default parameter.\n  virtual Ptr<QuantizedPyramid> processImpl(const Mat& src,\n                        const Mat& mask) const =0;\n};\n\n/**\n * \\brief Modality that computes quantized gradient orientations from a color image.\n */\nclass CV_EXPORTS ColorGradient : public Modality\n{\npublic:\n  /**\n   * \\brief Default constructor. Uses reasonable default parameter values.\n   */\n  ColorGradient();\n\n  /**\n   * \\brief Constructor.\n   *\n   * \\param weak_threshold   When quantizing, discard gradients with magnitude less than this.\n   * \\param num_features     How many features a template must contain.\n   * \\param strong_threshold Consider as candidate features only gradients whose norms are\n   *                         larger than this.\n   */\n  ColorGradient(float weak_threshold, size_t num_features, float strong_threshold);\n\n  virtual std::string name() const;\n\n  virtual void read(const FileNode& fn);\n  virtual void write(FileStorage& fs) const;\n\n  float weak_threshold;\n  size_t num_features;\n  float strong_threshold;\n\nprotected:\n  virtual Ptr<QuantizedPyramid> processImpl(const Mat& src,\n                        const Mat& mask) const;\n};\n\n/**\n * \\brief Modality that computes quantized surface normals from a dense depth map.\n */\nclass CV_EXPORTS DepthNormal : public Modality\n{\npublic:\n  /**\n   * \\brief Default constructor. Uses reasonable default parameter values.\n   */\n  DepthNormal();\n\n  /**\n   * \\brief Constructor.\n   *\n   * \\param distance_threshold   Ignore pixels beyond this distance.\n   * \\param difference_threshold When computing normals, ignore contributions of pixels whose\n   *                             depth difference with the central pixel is above this threshold.\n   * \\param num_features         How many features a template must contain.\n   * \\param extract_threshold    Consider as candidate feature only if there are no differing\n   *                             orientations within a distance of extract_threshold.\n   */\n  DepthNormal(int distance_threshold, int difference_threshold, size_t num_features,\n              int extract_threshold);\n\n  virtual std::string name() const;\n\n  virtual void read(const FileNode& fn);\n  virtual void write(FileStorage& fs) const;\n\n  int distance_threshold;\n  int difference_threshold;\n  size_t num_features;\n  int extract_threshold;\n\nprotected:\n  virtual Ptr<QuantizedPyramid> processImpl(const Mat& src,\n                        const Mat& mask) const;\n};\n\n/**\n * \\brief Debug function to colormap a quantized image for viewing.\n */\nvoid colormap(const Mat& quantized, Mat& dst);\n\n/**\n * \\brief Represents a successful template match.\n */\nstruct CV_EXPORTS Match\n{\n  Match()\n  {\n  }\n\n  Match(int x, int y, float similarity, const std::string& class_id, int template_id);\n\n  /// Sort matches with high similarity to the front\n  bool operator<(const Match& rhs) const\n  {\n    // Secondarily sort on template_id for the sake of duplicate removal\n    if (similarity != rhs.similarity)\n      return similarity > rhs.similarity;\n    else\n      return template_id < rhs.template_id;\n  }\n\n  bool operator==(const Match& rhs) const\n  {\n    return x == rhs.x && y == rhs.y && similarity == rhs.similarity && class_id == rhs.class_id;\n  }\n\n  int x;\n  int y;\n  float similarity;\n  std::string class_id;\n  int template_id;\n};\n\ninline  Match::Match(int _x, int _y, float _similarity, const std::string& _class_id, int _template_id)\n    : x(_x), y(_y), similarity(_similarity), class_id(_class_id), template_id(_template_id)\n  {\n  }\n\n/**\n * \\brief Object detector using the LINE template matching algorithm with any set of\n * modalities.\n */\nclass CV_EXPORTS Detector\n{\npublic:\n  /**\n   * \\brief Empty constructor, initialize with read().\n   */\n  Detector();\n\n  /**\n   * \\brief Constructor.\n   *\n   * \\param modalities       Modalities to use (color gradients, depth normals, ...).\n   * \\param T_pyramid        Value of the sampling step T at each pyramid level. The\n   *                         number of pyramid levels is T_pyramid.size().\n   */\n  Detector(const std::vector< Ptr<Modality> >& modalities, const std::vector<int>& T_pyramid);\n\n  /**\n   * \\brief Detect objects by template matching.\n   *\n   * Matches globally at the lowest pyramid level, then refines locally stepping up the pyramid.\n   *\n   * \\param      sources   Source images, one for each modality.\n   * \\param      threshold Similarity threshold, a percentage between 0 and 100.\n   * \\param[out] matches   Template matches, sorted by similarity score.\n   * \\param      class_ids If non-empty, only search for the desired object classes.\n   * \\param[out] quantized_images Optionally return vector<Mat> of quantized images.\n   * \\param      masks     The masks for consideration during matching. The masks should be CV_8UC1\n   *                       where 255 represents a valid pixel.  If non-empty, the vector must be\n   *                       the same size as sources.  Each element must be\n   *                       empty or the same size as its corresponding source.\n   */\n  void match(const std::vector<Mat>& sources, float threshold, std::vector<Match>& matches,\n             const std::vector<std::string>& class_ids = std::vector<std::string>(),\n             OutputArrayOfArrays quantized_images = noArray(),\n             const std::vector<Mat>& masks = std::vector<Mat>()) const;\n\n  /**\n   * \\brief Add new object template.\n   *\n   * \\param      sources      Source images, one for each modality.\n   * \\param      class_id     Object class ID.\n   * \\param      object_mask  Mask separating object from background.\n   * \\param[out] bounding_box Optionally return bounding box of the extracted features.\n   *\n   * \\return Template ID, or -1 if failed to extract a valid template.\n   */\n  int addTemplate(const std::vector<Mat>& sources, const std::string& class_id,\n          const Mat& object_mask, Rect* bounding_box = NULL);\n\n  /**\n   * \\brief Add a new object template computed by external means.\n   */\n  int addSyntheticTemplate(const std::vector<Template>& templates, const std::string& class_id);\n\n  /**\n   * \\brief Get the modalities used by this detector.\n   *\n   * You are not permitted to add/remove modalities, but you may dynamic_cast them to\n   * tweak parameters.\n   */\n  const std::vector< Ptr<Modality> >& getModalities() const { return modalities; }\n\n  /**\n   * \\brief Get sampling step T at pyramid_level.\n   */\n  int getT(int pyramid_level) const { return T_at_level[pyramid_level]; }\n\n  /**\n   * \\brief Get number of pyramid levels used by this detector.\n   */\n  int pyramidLevels() const { return pyramid_levels; }\n\n  /**\n   * \\brief Get the template pyramid identified by template_id.\n   *\n   * For example, with 2 modalities (Gradient, Normal) and two pyramid levels\n   * (L0, L1), the order is (GradientL0, NormalL0, GradientL1, NormalL1).\n   */\n  const std::vector<Template>& getTemplates(const std::string& class_id, int template_id) const;\n\n  int numTemplates() const;\n  int numTemplates(const std::string& class_id) const;\n  int numClasses() const { return static_cast<int>(class_templates.size()); }\n\n  std::vector<std::string> classIds() const;\n\n  void read(const FileNode& fn);\n  void write(FileStorage& fs) const;\n\n  std::string readClass(const FileNode& fn, const std::string &class_id_override = \"\");\n  void writeClass(const std::string& class_id, FileStorage& fs) const;\n\n  void readClasses(const std::vector<std::string>& class_ids,\n                   const std::string& format = \"templates_%s.yml.gz\");\n  void writeClasses(const std::string& format = \"templates_%s.yml.gz\") const;\n\nprotected:\n  std::vector< Ptr<Modality> > modalities;\n  int pyramid_levels;\n  std::vector<int> T_at_level;\n\n  typedef std::vector<Template> TemplatePyramid;\n  typedef std::map<std::string, std::vector<TemplatePyramid> > TemplatesMap;\n  TemplatesMap class_templates;\n\n  typedef std::vector<Mat> LinearMemories;\n  // Indexed as [pyramid level][modality][quantized label]\n  typedef std::vector< std::vector<LinearMemories> > LinearMemoryPyramid;\n\n  void matchClass(const LinearMemoryPyramid& lm_pyramid,\n                  const std::vector<Size>& sizes,\n                  float threshold, std::vector<Match>& matches,\n                  const std::string& class_id,\n                  const std::vector<TemplatePyramid>& template_pyramids) const;\n};\n\n/**\n * \\brief Factory function for detector using LINE algorithm with color gradients.\n *\n * Default parameter settings suitable for VGA images.\n */\nCV_EXPORTS Ptr<Detector> getDefaultLINE();\n\n/**\n * \\brief Factory function for detector using LINE-MOD algorithm with color gradients\n * and depth normals.\n *\n * Default parameter settings suitable for VGA images.\n */\nCV_EXPORTS Ptr<Detector> getDefaultLINEMOD();\n\n} // namespace linemod\n} // namespace cv\n\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/ocl/matrix_operations.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2010-2012, Institute Of Software Chinese Academy Of Science, all rights reserved.\n// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.\n// Copyright (C) 2010-2012, Multicoreware, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OCL_MATRIX_OPERATIONS_HPP__\n#define __OPENCV_OCL_MATRIX_OPERATIONS_HPP__\n\n#include \"opencv2/ocl/ocl.hpp\"\n\nnamespace cv\n{\n\n    namespace ocl\n    {\n\n        enum\n        {\n            MAT_ADD = 1,\n            MAT_SUB,\n            MAT_MUL,\n            MAT_DIV,\n            MAT_NOT,\n            MAT_AND,\n            MAT_OR,\n            MAT_XOR\n        };\n\n        class CV_EXPORTS oclMatExpr\n        {\n            public:\n                oclMatExpr() : a(oclMat()), b(oclMat()), op(0) {}\n                oclMatExpr(const oclMat& _a, const oclMat& _b, int _op)\n                    : a(_a), b(_b), op(_op) {}\n                operator oclMat() const;\n                void assign(oclMat& m) const;\n\n            protected:\n                oclMat a, b;\n                int op;\n        };\n        ////////////////////////////////////////////////////////////////////////\n        //////////////////////////////// oclMat ////////////////////////////////\n        ////////////////////////////////////////////////////////////////////////\n\n        inline oclMat::oclMat() : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), offset(0), wholerows(0), wholecols(0) {}\n\n        inline oclMat::oclMat(int _rows, int _cols, int _type) : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), offset(0), wholerows(0), wholecols(0)\n        {\n            if( _rows > 0 && _cols > 0 )\n                create( _rows, _cols, _type );\n        }\n\n        inline oclMat::oclMat(Size _size, int _type) : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), offset(0), wholerows(0), wholecols(0)\n        {\n            if( _size.height > 0 && _size.width > 0 )\n                create( _size.height, _size.width, _type );\n        }\n\n        inline oclMat::oclMat(int _rows, int _cols, int _type, const Scalar &_s)\n            : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), offset(0), wholerows(0), wholecols(0)\n        {\n            if(_rows > 0 && _cols > 0)\n            {\n                create(_rows, _cols, _type);\n                *this = _s;\n            }\n        }\n\n        inline oclMat::oclMat(Size _size, int _type, const Scalar &_s)\n            : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), offset(0), wholerows(0), wholecols(0)\n        {\n            if( _size.height > 0 && _size.width > 0 )\n            {\n                create( _size.height, _size.width, _type );\n                *this = _s;\n            }\n        }\n\n        inline oclMat::oclMat(const oclMat &m)\n            : flags(m.flags), rows(m.rows), cols(m.cols), step(m.step), data(m.data),\n              refcount(m.refcount), datastart(m.datastart), dataend(m.dataend), clCxt(m.clCxt), offset(m.offset), wholerows(m.wholerows), wholecols(m.wholecols)\n        {\n            if( refcount )\n                CV_XADD(refcount, 1);\n        }\n\n        inline oclMat::oclMat(int _rows, int _cols, int _type, void *_data, size_t _step)\n            : flags(0), rows(0), cols(0), step(0), data(0), refcount(0),\n              datastart(0), dataend(0), offset(0), wholerows(0), wholecols(0)\n        {\n            cv::Mat m(_rows, _cols, _type, _data, _step);\n            upload(m);\n            //size_t minstep = cols * elemSize();\n            //if( step == Mat::AUTO_STEP )\n            //{\n            //    step = minstep;\n            //    flags |= Mat::CONTINUOUS_FLAG;\n            //}\n            //else\n            //{\n            //    if( rows == 1 ) step = minstep;\n            //    CV_DbgAssert( step >= minstep );\n            //    flags |= step == minstep ? Mat::CONTINUOUS_FLAG : 0;\n            //}\n            //dataend += step * (rows - 1) + minstep;\n        }\n\n        inline oclMat::oclMat(Size _size, int _type, void *_data, size_t _step)\n            : flags(0), rows(0), cols(0),\n              step(0), data(0), refcount(0),\n              datastart(0), dataend(0), offset(0), wholerows(0), wholecols(0)\n        {\n            cv::Mat m(_size, _type, _data, _step);\n            upload(m);\n            //size_t minstep = cols * elemSize();\n            //if( step == Mat::AUTO_STEP )\n            //{\n            //    step = minstep;\n            //    flags |= Mat::CONTINUOUS_FLAG;\n            //}\n            //else\n            //{\n            //    if( rows == 1 ) step = minstep;\n            //    CV_DbgAssert( step >= minstep );\n            //    flags |= step == minstep ? Mat::CONTINUOUS_FLAG : 0;\n            //}\n            //dataend += step * (rows - 1) + minstep;\n        }\n\n\n        inline oclMat::oclMat(const oclMat &m, const Range &rRange, const Range &cRange)\n        {\n            flags = m.flags;\n            step = m.step;\n            refcount = m.refcount;\n            data = m.data;\n            datastart = m.datastart;\n            dataend = m.dataend;\n            clCxt = m.clCxt;\n            wholerows = m.wholerows;\n            wholecols = m.wholecols;\n            offset = m.offset;\n            if( rRange == Range::all() )\n                rows = m.rows;\n            else\n            {\n                CV_Assert( 0 <= rRange.start && rRange.start <= rRange.end && rRange.end <= m.rows );\n                rows = rRange.size();\n                offset += step * rRange.start;\n            }\n\n            if( cRange == Range::all() )\n                cols = m.cols;\n            else\n            {\n                CV_Assert( 0 <= cRange.start && cRange.start <= cRange.end && cRange.end <= m.cols );\n                cols = cRange.size();\n                offset += cRange.start * elemSize();\n                flags &= cols < m.cols ? ~Mat::CONTINUOUS_FLAG : -1;\n            }\n\n            if( rows == 1 )\n                flags |= Mat::CONTINUOUS_FLAG;\n\n            if( refcount )\n                CV_XADD(refcount, 1);\n            if( rows <= 0 || cols <= 0 )\n                rows = cols = 0;\n        }\n\n        inline oclMat::oclMat(const oclMat &m, const Rect &roi)\n            : flags(m.flags), rows(roi.height), cols(roi.width),\n              step(m.step), data(m.data), refcount(m.refcount),\n              datastart(m.datastart), dataend(m.dataend), clCxt(m.clCxt), offset(m.offset), wholerows(m.wholerows), wholecols(m.wholecols)\n        {\n            flags &= roi.width < m.cols ? ~Mat::CONTINUOUS_FLAG : -1;\n            offset += roi.y * step + roi.x * elemSize();\n            CV_Assert( 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.wholecols &&\n                       0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.wholerows );\n            if( refcount )\n                CV_XADD(refcount, 1);\n            if( rows <= 0 || cols <= 0 )\n                rows = cols = 0;\n        }\n\n        inline oclMat::oclMat(const Mat &m)\n            : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0) , offset(0), wholerows(0), wholecols(0)\n        {\n            //clCxt = Context::getContext();\n            upload(m);\n        }\n\n        inline oclMat::~oclMat()\n        {\n            release();\n        }\n\n        inline oclMat &oclMat::operator = (const oclMat &m)\n        {\n            if( this != &m )\n            {\n                if( m.refcount )\n                    CV_XADD(m.refcount, 1);\n                release();\n                clCxt = m.clCxt;\n                flags = m.flags;\n                rows = m.rows;\n                cols = m.cols;\n                step = m.step;\n                data = m.data;\n                datastart = m.datastart;\n                dataend = m.dataend;\n                offset = m.offset;\n                wholerows = m.wholerows;\n                wholecols = m.wholecols;\n                refcount = m.refcount;\n            }\n            return *this;\n        }\n\n        inline oclMat &oclMat::operator = (const Mat &m)\n        {\n            //clCxt = Context::getContext();\n            upload(m);\n            return *this;\n        }\n\n        inline oclMat& oclMat::operator = (const oclMatExpr& expr)\n        {\n            expr.assign(*this);\n            return *this;\n        }\n\n        /* Fixme! To be supported in OpenCL later. */\n#if 0\n        template <class T> inline oclMat::operator DevMem2D_<T>() const\n        {\n            return DevMem2D_<T>(rows, cols, (T *)data, step);\n        }\n        template <class T> inline oclMat::operator PtrStep_<T>() const\n        {\n            return PtrStep_<T>(static_cast< DevMem2D_<T> >(*this));\n        }\n#endif\n\n        //CPP: void oclMat::upload(const Mat& m);\n\n        inline oclMat::operator Mat() const\n        {\n            Mat m;\n            download(m);\n            return m;\n        }\n\n        //CPP void oclMat::download(cv::Mat& m) const;\n\n        inline oclMat oclMat::row(int y) const\n        {\n            return oclMat(*this, Range(y, y + 1), Range::all());\n        }\n        inline oclMat oclMat::col(int x) const\n        {\n            return oclMat(*this, Range::all(), Range(x, x + 1));\n        }\n        inline oclMat oclMat::rowRange(int startrow, int endrow) const\n        {\n            return oclMat(*this, Range(startrow, endrow), Range::all());\n        }\n        inline oclMat oclMat::rowRange(const Range &r) const\n        {\n            return oclMat(*this, r, Range::all());\n        }\n        inline oclMat oclMat::colRange(int startcol, int endcol) const\n        {\n            return oclMat(*this, Range::all(), Range(startcol, endcol));\n        }\n        inline oclMat oclMat::colRange(const Range &r) const\n        {\n            return oclMat(*this, Range::all(), r);\n        }\n\n        inline oclMat oclMat::clone() const\n        {\n            oclMat m;\n            copyTo(m);\n            return m;\n        }\n\n        //CPP void oclMat::copyTo( oclMat& m ) const;\n        //CPP void oclMat::copyTo( oclMat& m, const oclMat& mask  ) const;\n        //CPP void oclMat::convertTo( oclMat& m, int rtype, double alpha=1, double beta=0 ) const;\n\n        inline void oclMat::assignTo( oclMat &m, int mtype ) const\n        {\n            if( mtype < 0 )\n                m = *this;\n            else\n                convertTo(m, mtype);\n        }\n\n        //CPP oclMat& oclMat::operator = (const Scalar& s);\n        //CPP oclMat& oclMat::setTo(const Scalar& s, const oclMat& mask=oclMat());\n        //CPP oclMat oclMat::reshape(int _cn, int _rows=0) const;\n        inline void oclMat::create(Size _size, int _type)\n        {\n            create(_size.height, _size.width, _type);\n        }\n        //CPP void oclMat::create(int _rows, int _cols, int _type);\n        //CPP void oclMat::release();\n\n        inline void oclMat::swap(oclMat &b)\n        {\n            std::swap( flags, b.flags );\n            std::swap( rows, b.rows );\n            std::swap( cols, b.cols );\n            std::swap( step, b.step );\n            std::swap( data, b.data );\n            std::swap( datastart, b.datastart );\n            std::swap( dataend, b.dataend );\n            std::swap( refcount, b.refcount );\n            std::swap( offset, b.offset );\n            std::swap( clCxt,  b.clCxt );\n            std::swap( wholerows, b.wholerows );\n            std::swap( wholecols, b.wholecols );\n        }\n\n        inline void oclMat::locateROI( Size &wholeSize, Point &ofs ) const\n        {\n            size_t esz = elemSize();//, minstep;\n            //ptrdiff_t delta1 = offset;//, delta2 = dataend - datastart;\n            CV_DbgAssert( step > 0 );\n            if( offset == 0 )\n                ofs.x = ofs.y = 0;\n            else\n            {\n                ofs.y = (int)(offset / step);\n                ofs.x = (int)((offset - step * ofs.y) / esz);\n                //CV_DbgAssert( data == datastart + ofs.y*step + ofs.x*esz );\n            }\n            //minstep = (ofs.x + cols)*esz;\n            //wholeSize.height = (int)((delta2 - minstep)/step + 1);\n            //wholeSize.height = std::max(wholeSize.height, ofs.y + rows);\n            //wholeSize.width = (int)((delta2 - step*(wholeSize.height-1))/esz);\n            //wholeSize.width = std::max(wholeSize.width, ofs.x + cols);\n            wholeSize.height = wholerows;\n            wholeSize.width = wholecols;\n        }\n\n        inline oclMat &oclMat::adjustROI( int dtop, int dbottom, int dleft, int dright )\n        {\n            Size wholeSize;\n            Point ofs;\n            size_t esz = elemSize();\n            locateROI( wholeSize, ofs );\n            int row1 = std::max(ofs.y - dtop, 0), row2 = std::min(ofs.y + rows + dbottom, wholeSize.height);\n            int col1 = std::max(ofs.x - dleft, 0), col2 = std::min(ofs.x + cols + dright, wholeSize.width);\n            offset += (row1 - ofs.y) * step + (col1 - ofs.x) * esz;\n            rows = row2 - row1;\n            cols = col2 - col1;\n            if( esz * cols == step || rows == 1 )\n                flags |= Mat::CONTINUOUS_FLAG;\n            else\n                flags &= ~Mat::CONTINUOUS_FLAG;\n            return *this;\n        }\n\n        inline oclMat oclMat::operator()( Range rRange, Range cRange ) const\n        {\n            return oclMat(*this, rRange, cRange);\n        }\n        inline oclMat oclMat::operator()( const Rect &roi ) const\n        {\n            return oclMat(*this, roi);\n        }\n\n        inline bool oclMat::isContinuous() const\n        {\n            return (flags & Mat::CONTINUOUS_FLAG) != 0;\n        }\n        inline size_t oclMat::elemSize() const\n        {\n            return CV_ELEM_SIZE((CV_MAKE_TYPE(type(), oclchannels())));\n        }\n        inline size_t oclMat::elemSize1() const\n        {\n            return CV_ELEM_SIZE1(flags);\n        }\n        inline int oclMat::type() const\n        {\n            return CV_MAT_TYPE(flags);\n        }\n        inline int oclMat::ocltype() const\n        {\n            return CV_MAKE_TYPE(depth(), oclchannels());\n        }\n        inline int oclMat::depth() const\n        {\n            return CV_MAT_DEPTH(flags);\n        }\n        inline int oclMat::channels() const\n        {\n            return CV_MAT_CN(flags);\n        }\n        inline int oclMat::oclchannels() const\n        {\n            return (CV_MAT_CN(flags)) == 3 ? 4 : (CV_MAT_CN(flags));\n        }\n        inline size_t oclMat::step1() const\n        {\n            return step / elemSize1();\n        }\n        inline Size oclMat::size() const\n        {\n            return Size(cols, rows);\n        }\n        inline bool oclMat::empty() const\n        {\n            return data == 0;\n        }\n\n        inline oclMat oclMat::t() const\n        {\n            oclMat tmp;\n            transpose(*this, tmp);\n            return tmp;\n        }\n\n        static inline void swap( oclMat &a, oclMat &b )\n        {\n            a.swap(b);\n        }\n\n        inline void ensureSizeIsEnough(int rows, int cols, int type, oclMat &m)\n        {\n            if (m.type() == type && m.rows >= rows && m.cols >= cols)\n                m = m(Rect(0, 0, cols, rows));\n            else\n                m.create(rows, cols, type);\n        }\n\n        inline void ensureSizeIsEnough(Size size, int type, oclMat &m)\n        {\n            ensureSizeIsEnough(size.height, size.width, type, m);\n        }\n\n\n    } /* end of namespace ocl */\n\n} /* end of namespace cv */\n\n#endif /* __OPENCV_OCL_MATRIX_OPERATIONS_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/ocl/ocl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2010-2012, Institute Of Software Chinese Academy Of Science, all rights reserved.\n// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.\n// Copyright (C) 2010-2012, Multicoreware, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_OCL_HPP__\n#define __OPENCV_OCL_HPP__\n\n#include <memory>\n#include <vector>\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/objdetect/objdetect.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/ml/ml.hpp\"\n\nnamespace cv\n{\n    namespace ocl\n    {\n        enum DeviceType\n        {\n            CVCL_DEVICE_TYPE_DEFAULT     = (1 << 0),\n            CVCL_DEVICE_TYPE_CPU         = (1 << 1),\n            CVCL_DEVICE_TYPE_GPU         = (1 << 2),\n            CVCL_DEVICE_TYPE_ACCELERATOR = (1 << 3),\n            //CVCL_DEVICE_TYPE_CUSTOM      = (1 << 4)\n            CVCL_DEVICE_TYPE_ALL         = 0xFFFFFFFF\n        };\n\n        enum DevMemRW\n        {\n            DEVICE_MEM_R_W = 0,\n            DEVICE_MEM_R_ONLY,\n            DEVICE_MEM_W_ONLY\n        };\n\n        enum DevMemType\n        {\n            DEVICE_MEM_DEFAULT = 0,\n            DEVICE_MEM_AHP,         //alloc host pointer\n            DEVICE_MEM_UHP,         //use host pointer\n            DEVICE_MEM_CHP,         //copy host pointer\n            DEVICE_MEM_PM           //persistent memory\n        };\n\n        // these classes contain OpenCL runtime information\n\n        struct PlatformInfo;\n\n        struct DeviceInfo\n        {\n            int _id; // reserved, don't use it\n\n            DeviceType deviceType;\n            std::string deviceProfile;\n            std::string deviceVersion;\n            std::string deviceName;\n            std::string deviceVendor;\n            int deviceVendorId;\n            std::string deviceDriverVersion;\n            std::string deviceExtensions;\n\n            size_t maxWorkGroupSize;\n            std::vector<size_t> maxWorkItemSizes;\n            int maxComputeUnits;\n            size_t localMemorySize;\n            size_t maxMemAllocSize;\n\n            int deviceVersionMajor;\n            int deviceVersionMinor;\n\n            bool haveDoubleSupport;\n            bool isUnifiedMemory; // 1 means integrated GPU, otherwise this value is 0\n            bool isIntelDevice;\n\n            std::string compilationExtraOptions;\n\n            const PlatformInfo* platform;\n\n            DeviceInfo();\n            ~DeviceInfo();\n        };\n\n        struct PlatformInfo\n        {\n            int _id; // reserved, don't use it\n\n            std::string platformProfile;\n            std::string platformVersion;\n            std::string platformName;\n            std::string platformVendor;\n            std::string platformExtensons;\n\n            int platformVersionMajor;\n            int platformVersionMinor;\n\n            std::vector<const DeviceInfo*> devices;\n\n            PlatformInfo();\n            ~PlatformInfo();\n        };\n\n        //////////////////////////////// Initialization & Info ////////////////////////\n        typedef std::vector<const PlatformInfo*> PlatformsInfo;\n\n        CV_EXPORTS int getOpenCLPlatforms(PlatformsInfo& platforms);\n\n        typedef std::vector<const DeviceInfo*> DevicesInfo;\n\n        CV_EXPORTS int getOpenCLDevices(DevicesInfo& devices, int deviceType = CVCL_DEVICE_TYPE_GPU,\n                const PlatformInfo* platform = NULL);\n\n        // set device you want to use\n        CV_EXPORTS void setDevice(const DeviceInfo* info);\n\n        // Initialize from OpenCL handles directly.\n        // Argument types is (pointers): cl_platform_id*, cl_context*, cl_device_id*\n        CV_EXPORTS void initializeContext(void* pClPlatform, void* pClContext, void* pClDevice);\n\n        //////////////////////////////// Error handling ////////////////////////\n        CV_EXPORTS void error(const char *error_string, const char *file, const int line, const char *func);\n\n        enum FEATURE_TYPE\n        {\n            FEATURE_CL_DOUBLE = 1,\n            FEATURE_CL_UNIFIED_MEM,\n            FEATURE_CL_VER_1_2,\n            FEATURE_CL_INTEL_DEVICE\n        };\n\n        // Represents OpenCL context, interface\n        class CV_EXPORTS Context\n        {\n        protected:\n            Context() { }\n            ~Context() { }\n        public:\n            static Context* getContext();\n\n            bool supportsFeature(FEATURE_TYPE featureType) const;\n            const DeviceInfo& getDeviceInfo() const;\n\n            const void* getOpenCLContextPtr() const;\n            const void* getOpenCLCommandQueuePtr() const;\n            const void* getOpenCLDeviceIDPtr() const;\n        };\n\n        inline const void *getClContextPtr()\n        {\n            return Context::getContext()->getOpenCLContextPtr();\n        }\n\n        inline const void *getClCommandQueuePtr()\n        {\n            return Context::getContext()->getOpenCLCommandQueuePtr();\n        }\n\n        CV_EXPORTS bool supportsFeature(FEATURE_TYPE featureType);\n\n        CV_EXPORTS void finish();\n\n        enum BINARY_CACHE_MODE\n        {\n            CACHE_NONE    = 0,        // do not cache OpenCL binary\n            CACHE_DEBUG   = 0x1 << 0, // cache OpenCL binary when built in debug mode\n            CACHE_RELEASE = 0x1 << 1, // default behavior, only cache when built in release mode\n            CACHE_ALL     = CACHE_DEBUG | CACHE_RELEASE // cache opencl binary\n        };\n        //! Enable or disable OpenCL program binary caching onto local disk\n        // After a program (*.cl files in opencl/ folder) is built at runtime, we allow the\n        // compiled OpenCL program to be cached to the path automatically as \"path/*.clb\"\n        // binary file, which will be reused when the OpenCV executable is started again.\n        //\n        // This feature is enabled by default.\n        CV_EXPORTS void setBinaryDiskCache(int mode = CACHE_RELEASE, cv::String path = \"./\");\n\n        //! set where binary cache to be saved to\n        CV_EXPORTS void setBinaryPath(const char *path);\n\n        struct ProgramSource\n        {\n            const char* name;\n            const char* programStr;\n            const char* programHash;\n\n            // Cache in memory by name (should be unique). Caching on disk disabled.\n            inline ProgramSource(const char* _name, const char* _programStr)\n                : name(_name), programStr(_programStr), programHash(NULL)\n            {\n            }\n\n            // Cache in memory by name (should be unique). Caching on disk uses programHash mark.\n            inline ProgramSource(const char* _name, const char* _programStr, const char* _programHash)\n                : name(_name), programStr(_programStr), programHash(_programHash)\n            {\n            }\n        };\n\n        //! Calls OpenCL kernel. Pass globalThreads = NULL, and cleanUp = true, to finally clean-up without executing.\n        //! Deprecated, will be replaced\n        CV_EXPORTS void openCLExecuteKernelInterop(Context *clCxt,\n                const cv::ocl::ProgramSource& source, string kernelName,\n                size_t globalThreads[3], size_t localThreads[3],\n                std::vector< std::pair<size_t, const void *> > &args,\n                int channels, int depth, const char *build_options);\n\n        class CV_EXPORTS oclMatExpr;\n        //////////////////////////////// oclMat ////////////////////////////////\n        class CV_EXPORTS oclMat\n        {\n        public:\n            //! default constructor\n            oclMat();\n            //! constructs oclMatrix of the specified size and type (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.)\n            oclMat(int rows, int cols, int type);\n            oclMat(Size size, int type);\n            //! constucts oclMatrix and fills it with the specified value _s.\n            oclMat(int rows, int cols, int type, const Scalar &s);\n            oclMat(Size size, int type, const Scalar &s);\n            //! copy constructor\n            oclMat(const oclMat &m);\n\n            //! constructor for oclMatrix headers pointing to user-allocated data\n            oclMat(int rows, int cols, int type, void *data, size_t step = Mat::AUTO_STEP);\n            oclMat(Size size, int type, void *data, size_t step = Mat::AUTO_STEP);\n\n            //! creates a matrix header for a part of the bigger matrix\n            oclMat(const oclMat &m, const Range &rowRange, const Range &colRange);\n            oclMat(const oclMat &m, const Rect &roi);\n\n            //! builds oclMat from Mat. Perfom blocking upload to device.\n            explicit oclMat (const Mat &m);\n\n            //! destructor - calls release()\n            ~oclMat();\n\n            //! assignment operators\n            oclMat &operator = (const oclMat &m);\n            //! assignment operator. Perfom blocking upload to device.\n            oclMat &operator = (const Mat &m);\n            oclMat &operator = (const oclMatExpr& expr);\n\n            //! pefroms blocking upload data to oclMat.\n            void upload(const cv::Mat &m);\n\n\n            //! downloads data from device to host memory. Blocking calls.\n            operator Mat() const;\n            void download(cv::Mat &m) const;\n\n            //! convert to _InputArray\n            operator _InputArray();\n\n            //! convert to _OutputArray\n            operator _OutputArray();\n\n            //! returns a new oclMatrix header for the specified row\n            oclMat row(int y) const;\n            //! returns a new oclMatrix header for the specified column\n            oclMat col(int x) const;\n            //! ... for the specified row span\n            oclMat rowRange(int startrow, int endrow) const;\n            oclMat rowRange(const Range &r) const;\n            //! ... for the specified column span\n            oclMat colRange(int startcol, int endcol) const;\n            oclMat colRange(const Range &r) const;\n\n            //! returns deep copy of the oclMatrix, i.e. the data is copied\n            oclMat clone() const;\n\n            //! copies those oclMatrix elements to \"m\" that are marked with non-zero mask elements.\n            // It calls m.create(this->size(), this->type()).\n            // It supports any data type\n            void copyTo( oclMat &m, const oclMat &mask = oclMat()) const;\n\n            //! converts oclMatrix to another datatype with optional scalng. See cvConvertScale.\n            void convertTo( oclMat &m, int rtype, double alpha = 1, double beta = 0 ) const;\n\n            void assignTo( oclMat &m, int type = -1 ) const;\n\n            //! sets every oclMatrix element to s\n            oclMat& operator = (const Scalar &s);\n            //! sets some of the oclMatrix elements to s, according to the mask\n            oclMat& setTo(const Scalar &s, const oclMat &mask = oclMat());\n            //! creates alternative oclMatrix header for the same data, with different\n            // number of channels and/or different number of rows. see cvReshape.\n            oclMat reshape(int cn, int rows = 0) const;\n\n            //! allocates new oclMatrix data unless the oclMatrix already has specified size and type.\n            // previous data is unreferenced if needed.\n            void create(int rows, int cols, int type);\n            void create(Size size, int type);\n\n            //! allocates new oclMatrix with specified device memory type.\n            void createEx(int rows, int cols, int type, DevMemRW rw_type, DevMemType mem_type);\n            void createEx(Size size, int type, DevMemRW rw_type, DevMemType mem_type);\n\n            //! decreases reference counter;\n            // deallocate the data when reference counter reaches 0.\n            void release();\n\n            //! swaps with other smart pointer\n            void swap(oclMat &mat);\n\n            //! locates oclMatrix header within a parent oclMatrix. See below\n            void locateROI( Size &wholeSize, Point &ofs ) const;\n            //! moves/resizes the current oclMatrix ROI inside the parent oclMatrix.\n            oclMat& adjustROI( int dtop, int dbottom, int dleft, int dright );\n            //! extracts a rectangular sub-oclMatrix\n            // (this is a generalized form of row, rowRange etc.)\n            oclMat operator()( Range rowRange, Range colRange ) const;\n            oclMat operator()( const Rect &roi ) const;\n\n            oclMat& operator+=( const oclMat& m );\n            oclMat& operator-=( const oclMat& m );\n            oclMat& operator*=( const oclMat& m );\n            oclMat& operator/=( const oclMat& m );\n\n            //! returns true if the oclMatrix data is continuous\n            // (i.e. when there are no gaps between successive rows).\n            // similar to CV_IS_oclMat_CONT(cvoclMat->type)\n            bool isContinuous() const;\n            //! returns element size in bytes,\n            // similar to CV_ELEM_SIZE(cvMat->type)\n            size_t elemSize() const;\n            //! returns the size of element channel in bytes.\n            size_t elemSize1() const;\n            //! returns element type, similar to CV_MAT_TYPE(cvMat->type)\n            int type() const;\n            //! returns element type, i.e. 8UC3 returns 8UC4 because in ocl\n            //! 3 channels element actually use 4 channel space\n            int ocltype() const;\n            //! returns element type, similar to CV_MAT_DEPTH(cvMat->type)\n            int depth() const;\n            //! returns element type, similar to CV_MAT_CN(cvMat->type)\n            int channels() const;\n            //! returns element type, return 4 for 3 channels element,\n            //!becuase 3 channels element actually use 4 channel space\n            int oclchannels() const;\n            //! returns step/elemSize1()\n            size_t step1() const;\n            //! returns oclMatrix size:\n            // width == number of columns, height == number of rows\n            Size size() const;\n            //! returns true if oclMatrix data is NULL\n            bool empty() const;\n\n            //! matrix transposition\n            oclMat t() const;\n\n            /*! includes several bit-fields:\n              - the magic signature\n              - continuity flag\n              - depth\n              - number of channels\n              */\n            int flags;\n            //! the number of rows and columns\n            int rows, cols;\n            //! a distance between successive rows in bytes; includes the gap if any\n            size_t step;\n            //! pointer to the data(OCL memory object)\n            uchar *data;\n\n            //! pointer to the reference counter;\n            // when oclMatrix points to user-allocated data, the pointer is NULL\n            int *refcount;\n\n            //! helper fields used in locateROI and adjustROI\n            //datastart and dataend are not used in current version\n            uchar *datastart;\n            uchar *dataend;\n\n            //! OpenCL context associated with the oclMat object.\n            Context *clCxt; // TODO clCtx\n            //add offset for handle ROI, calculated in byte\n            int offset;\n            //add wholerows and wholecols for the whole matrix, datastart and dataend are no longer used\n            int wholerows;\n            int wholecols;\n        };\n\n        // convert InputArray/OutputArray to oclMat references\n        CV_EXPORTS oclMat& getOclMatRef(InputArray src);\n        CV_EXPORTS oclMat& getOclMatRef(OutputArray src);\n\n        ///////////////////// mat split and merge /////////////////////////////////\n        //! Compose a multi-channel array from several single-channel arrays\n        // Support all types\n        CV_EXPORTS void merge(const oclMat *src, size_t n, oclMat &dst);\n        CV_EXPORTS void merge(const vector<oclMat> &src, oclMat &dst);\n\n        //! Divides multi-channel array into several single-channel arrays\n        // Support all types\n        CV_EXPORTS void split(const oclMat &src, oclMat *dst);\n        CV_EXPORTS void split(const oclMat &src, vector<oclMat> &dst);\n\n        ////////////////////////////// Arithmetics ///////////////////////////////////\n\n        //! adds one matrix to another with scale (dst = src1 * alpha + src2 * beta + gama)\n        // supports all data types\n        CV_EXPORTS void addWeighted(const oclMat &src1, double  alpha, const oclMat &src2, double beta, double gama, oclMat &dst);\n\n        //! adds one matrix to another (dst = src1 + src2)\n        // supports all data types\n        CV_EXPORTS void add(const oclMat &src1, const oclMat &src2, oclMat &dst, const oclMat &mask = oclMat());\n        //! adds scalar to a matrix (dst = src1 + s)\n        // supports all data types\n        CV_EXPORTS void add(const oclMat &src1, const Scalar &s, oclMat &dst, const oclMat &mask = oclMat());\n\n        //! subtracts one matrix from another (dst = src1 - src2)\n        // supports all data types\n        CV_EXPORTS void subtract(const oclMat &src1, const oclMat &src2, oclMat &dst, const oclMat &mask = oclMat());\n        //! subtracts scalar from a matrix (dst = src1 - s)\n        // supports all data types\n        CV_EXPORTS void subtract(const oclMat &src1, const Scalar &s, oclMat &dst, const oclMat &mask = oclMat());\n\n        //! computes element-wise product of the two arrays (dst = src1 * scale * src2)\n        // supports all data types\n        CV_EXPORTS void multiply(const oclMat &src1, const oclMat &src2, oclMat &dst, double scale = 1);\n        //! multiplies matrix to a number (dst = scalar * src)\n        // supports all data types\n        CV_EXPORTS void multiply(double scalar, const oclMat &src, oclMat &dst);\n\n        //! computes element-wise quotient of the two arrays (dst = src1 * scale / src2)\n        // supports all data types\n        CV_EXPORTS void divide(const oclMat &src1, const oclMat &src2, oclMat &dst, double scale = 1);\n        //! computes element-wise quotient of the two arrays (dst = scale / src)\n        // supports all data types\n        CV_EXPORTS void divide(double scale, const oclMat &src1, oclMat &dst);\n\n        //! computes element-wise minimum of the two arrays (dst = min(src1, src2))\n        // supports all data types\n        CV_EXPORTS void min(const oclMat &src1, const oclMat &src2, oclMat &dst);\n\n        //! computes element-wise maximum of the two arrays (dst = max(src1, src2))\n        // supports all data types\n        CV_EXPORTS void max(const oclMat &src1, const oclMat &src2, oclMat &dst);\n\n        //! compares elements of two arrays (dst = src1 \\verbatim<cmpop>\\endverbatim src2)\n        // supports all data types\n        CV_EXPORTS void compare(const oclMat &src1, const oclMat &src2, oclMat &dst, int cmpop);\n\n        //! transposes the matrix\n        // supports all data types\n        CV_EXPORTS void transpose(const oclMat &src, oclMat &dst);\n\n        //! computes element-wise absolute values of an array (dst = abs(src))\n        // supports all data types\n        CV_EXPORTS void abs(const oclMat &src, oclMat &dst);\n\n        //! computes element-wise absolute difference of two arrays (dst = abs(src1 - src2))\n        // supports all data types\n        CV_EXPORTS void absdiff(const oclMat &src1, const oclMat &src2, oclMat &dst);\n        //! computes element-wise absolute difference of array and scalar (dst = abs(src1 - s))\n        // supports all data types\n        CV_EXPORTS void absdiff(const oclMat &src1, const Scalar &s, oclMat &dst);\n\n        //! computes mean value and standard deviation of all or selected array elements\n        // supports all data types\n        CV_EXPORTS void meanStdDev(const oclMat &mtx, Scalar &mean, Scalar &stddev);\n\n        //! computes norm of array\n        // supports NORM_INF, NORM_L1, NORM_L2\n        // supports all data types\n        CV_EXPORTS double norm(const oclMat &src1, int normType = NORM_L2);\n\n        //! computes norm of the difference between two arrays\n        // supports NORM_INF, NORM_L1, NORM_L2\n        // supports all data types\n        CV_EXPORTS double norm(const oclMat &src1, const oclMat &src2, int normType = NORM_L2);\n\n        //! reverses the order of the rows, columns or both in a matrix\n        // supports all types\n        CV_EXPORTS void flip(const oclMat &src, oclMat &dst, int flipCode);\n\n        //! computes sum of array elements\n        // support all types\n        CV_EXPORTS Scalar sum(const oclMat &m);\n        CV_EXPORTS Scalar absSum(const oclMat &m);\n        CV_EXPORTS Scalar sqrSum(const oclMat &m);\n\n        //! finds global minimum and maximum array elements and returns their values\n        // support all C1 types\n        CV_EXPORTS void minMax(const oclMat &src, double *minVal, double *maxVal = 0, const oclMat &mask = oclMat());\n\n        //! finds global minimum and maximum array elements and returns their values with locations\n        // support all C1 types\n        CV_EXPORTS void minMaxLoc(const oclMat &src, double *minVal, double *maxVal = 0, Point *minLoc = 0, Point *maxLoc = 0,\n                                  const oclMat &mask = oclMat());\n\n        //! counts non-zero array elements\n        // support all types\n        CV_EXPORTS int countNonZero(const oclMat &src);\n\n        //! transforms 8-bit unsigned integers using lookup table: dst(i)=lut(src(i))\n        // destination array will have the depth type as lut and the same channels number as source\n        //It supports 8UC1 8UC4 only\n        CV_EXPORTS void LUT(const oclMat &src, const oclMat &lut, oclMat &dst);\n\n        //! only 8UC1 and 256 bins is supported now\n        CV_EXPORTS void calcHist(const oclMat &mat_src, oclMat &mat_hist);\n        //! only 8UC1 and 256 bins is supported now\n        CV_EXPORTS void equalizeHist(const oclMat &mat_src, oclMat &mat_dst);\n\n        //! only 8UC1 is supported now\n        CV_EXPORTS Ptr<cv::CLAHE> createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8));\n\n        //! bilateralFilter\n        // supports 8UC1 8UC4\n        CV_EXPORTS void bilateralFilter(const oclMat& src, oclMat& dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT);\n\n        //! Applies an adaptive bilateral filter to the input image\n        //  Unlike the usual bilateral filter that uses fixed value for sigmaColor,\n        //  the adaptive version calculates the local variance in he ksize neighborhood\n        //  and use this as sigmaColor, for the value filtering. However, the local standard deviation is\n        //  clamped to the maxSigmaColor.\n        //  supports 8UC1, 8UC3\n        CV_EXPORTS void adaptiveBilateralFilter(const oclMat& src, oclMat& dst, Size ksize, double sigmaSpace, double maxSigmaColor=20.0, Point anchor = Point(-1, -1), int borderType=BORDER_DEFAULT);\n\n        //! computes exponent of each matrix element (dst = e**src)\n        // supports only CV_32FC1, CV_64FC1 type\n        CV_EXPORTS void exp(const oclMat &src, oclMat &dst);\n\n        //! computes natural logarithm of absolute value of each matrix element: dst = log(abs(src))\n        // supports only CV_32FC1, CV_64FC1 type\n        CV_EXPORTS void log(const oclMat &src, oclMat &dst);\n\n        //! computes magnitude of each (x(i), y(i)) vector\n        // supports only CV_32F, CV_64F type\n        CV_EXPORTS void magnitude(const oclMat &x, const oclMat &y, oclMat &magnitude);\n\n        //! computes angle (angle(i)) of each (x(i), y(i)) vector\n        // supports only CV_32F, CV_64F type\n        CV_EXPORTS void phase(const oclMat &x, const oclMat &y, oclMat &angle, bool angleInDegrees = false);\n\n        //! the function raises every element of tne input array to p\n        // support only CV_32F, CV_64F type\n        CV_EXPORTS void pow(const oclMat &x, double p, oclMat &y);\n\n        //! converts Cartesian coordinates to polar\n        // supports only CV_32F CV_64F type\n        CV_EXPORTS void cartToPolar(const oclMat &x, const oclMat &y, oclMat &magnitude, oclMat &angle, bool angleInDegrees = false);\n\n        //! converts polar coordinates to Cartesian\n        // supports only CV_32F CV_64F type\n        CV_EXPORTS void polarToCart(const oclMat &magnitude, const oclMat &angle, oclMat &x, oclMat &y, bool angleInDegrees = false);\n\n        //! perfroms per-elements bit-wise inversion\n        // supports all types\n        CV_EXPORTS void bitwise_not(const oclMat &src, oclMat &dst);\n\n        //! calculates per-element bit-wise disjunction of two arrays\n        // supports all types\n        CV_EXPORTS void bitwise_or(const oclMat &src1, const oclMat &src2, oclMat &dst, const oclMat &mask = oclMat());\n        CV_EXPORTS void bitwise_or(const oclMat &src1, const Scalar &s, oclMat &dst, const oclMat &mask = oclMat());\n\n        //! calculates per-element bit-wise conjunction of two arrays\n        // supports all types\n        CV_EXPORTS void bitwise_and(const oclMat &src1, const oclMat &src2, oclMat &dst, const oclMat &mask = oclMat());\n        CV_EXPORTS void bitwise_and(const oclMat &src1, const Scalar &s, oclMat &dst, const oclMat &mask = oclMat());\n\n        //! calculates per-element bit-wise \"exclusive or\" operation\n        // supports all types\n        CV_EXPORTS void bitwise_xor(const oclMat &src1, const oclMat &src2, oclMat &dst, const oclMat &mask = oclMat());\n        CV_EXPORTS void bitwise_xor(const oclMat &src1, const Scalar &s, oclMat &dst, const oclMat &mask = oclMat());\n\n        //! Logical operators\n        CV_EXPORTS oclMat operator ~ (const oclMat &);\n        CV_EXPORTS oclMat operator | (const oclMat &, const oclMat &);\n        CV_EXPORTS oclMat operator & (const oclMat &, const oclMat &);\n        CV_EXPORTS oclMat operator ^ (const oclMat &, const oclMat &);\n\n\n        //! Mathematics operators\n        CV_EXPORTS oclMatExpr operator + (const oclMat &src1, const oclMat &src2);\n        CV_EXPORTS oclMatExpr operator - (const oclMat &src1, const oclMat &src2);\n        CV_EXPORTS oclMatExpr operator * (const oclMat &src1, const oclMat &src2);\n        CV_EXPORTS oclMatExpr operator / (const oclMat &src1, const oclMat &src2);\n\n        //! computes convolution of two images\n        // support only CV_32FC1 type\n        CV_EXPORTS void convolve(const oclMat &image, const oclMat &temp1, oclMat &result);\n\n        CV_EXPORTS void cvtColor(const oclMat &src, oclMat &dst, int code, int dcn = 0);\n\n        //! initializes a scaled identity matrix\n        CV_EXPORTS void setIdentity(oclMat& src, const Scalar & val = Scalar(1));\n\n        //! fills the output array with repeated copies of the input array\n        CV_EXPORTS void repeat(const oclMat & src, int ny, int nx, oclMat & dst);\n\n        //////////////////////////////// Filter Engine ////////////////////////////////\n\n        /*!\n          The Base Class for 1D or Row-wise Filters\n\n          This is the base class for linear or non-linear filters that process 1D data.\n          In particular, such filters are used for the \"horizontal\" filtering parts in separable filters.\n          */\n        class CV_EXPORTS BaseRowFilter_GPU\n        {\n        public:\n            BaseRowFilter_GPU(int ksize_, int anchor_, int bordertype_) : ksize(ksize_), anchor(anchor_), bordertype(bordertype_) {}\n            virtual ~BaseRowFilter_GPU() {}\n            virtual void operator()(const oclMat &src, oclMat &dst) = 0;\n            int ksize, anchor, bordertype;\n        };\n\n        /*!\n          The Base Class for Column-wise Filters\n\n          This is the base class for linear or non-linear filters that process columns of 2D arrays.\n          Such filters are used for the \"vertical\" filtering parts in separable filters.\n          */\n        class CV_EXPORTS BaseColumnFilter_GPU\n        {\n        public:\n            BaseColumnFilter_GPU(int ksize_, int anchor_, int bordertype_) : ksize(ksize_), anchor(anchor_), bordertype(bordertype_) {}\n            virtual ~BaseColumnFilter_GPU() {}\n            virtual void operator()(const oclMat &src, oclMat &dst) = 0;\n            int ksize, anchor, bordertype;\n        };\n\n        /*!\n          The Base Class for Non-Separable 2D Filters.\n\n          This is the base class for linear or non-linear 2D filters.\n          */\n        class CV_EXPORTS BaseFilter_GPU\n        {\n        public:\n            BaseFilter_GPU(const Size &ksize_, const Point &anchor_, const int &borderType_)\n                : ksize(ksize_), anchor(anchor_), borderType(borderType_) {}\n            virtual ~BaseFilter_GPU() {}\n            virtual void operator()(const oclMat &src, oclMat &dst) = 0;\n            Size ksize;\n            Point anchor;\n            int borderType;\n        };\n\n        /*!\n          The Base Class for Filter Engine.\n\n          The class can be used to apply an arbitrary filtering operation to an image.\n          It contains all the necessary intermediate buffers.\n          */\n        class CV_EXPORTS FilterEngine_GPU\n        {\n        public:\n            virtual ~FilterEngine_GPU() {}\n\n            virtual void apply(const oclMat &src, oclMat &dst, Rect roi = Rect(0, 0, -1, -1)) = 0;\n        };\n\n        //! returns the non-separable filter engine with the specified filter\n        CV_EXPORTS Ptr<FilterEngine_GPU> createFilter2D_GPU(const Ptr<BaseFilter_GPU> filter2D);\n\n        //! returns the primitive row filter with the specified kernel\n        CV_EXPORTS Ptr<BaseRowFilter_GPU> getLinearRowFilter_GPU(int srcType, int bufType, const Mat &rowKernel,\n                int anchor = -1, int bordertype = BORDER_DEFAULT);\n\n        //! returns the primitive column filter with the specified kernel\n        CV_EXPORTS Ptr<BaseColumnFilter_GPU> getLinearColumnFilter_GPU(int bufType, int dstType, const Mat &columnKernel,\n                int anchor = -1, int bordertype = BORDER_DEFAULT, double delta = 0.0);\n\n        //! returns the separable linear filter engine\n        CV_EXPORTS Ptr<FilterEngine_GPU> createSeparableLinearFilter_GPU(int srcType, int dstType, const Mat &rowKernel,\n                const Mat &columnKernel, const Point &anchor = Point(-1, -1), double delta = 0.0, int bordertype = BORDER_DEFAULT, Size imgSize = Size(-1,-1));\n\n        //! returns the separable filter engine with the specified filters\n        CV_EXPORTS Ptr<FilterEngine_GPU> createSeparableFilter_GPU(const Ptr<BaseRowFilter_GPU> &rowFilter,\n                const Ptr<BaseColumnFilter_GPU> &columnFilter);\n\n        //! returns the Gaussian filter engine\n        CV_EXPORTS Ptr<FilterEngine_GPU> createGaussianFilter_GPU(int type, Size ksize, double sigma1, double sigma2 = 0, int bordertype = BORDER_DEFAULT, Size imgSize = Size(-1,-1));\n\n        //! returns filter engine for the generalized Sobel operator\n        CV_EXPORTS Ptr<FilterEngine_GPU> createDerivFilter_GPU( int srcType, int dstType, int dx, int dy, int ksize, int borderType = BORDER_DEFAULT, Size imgSize = Size(-1,-1) );\n\n        //! applies Laplacian operator to the image\n        // supports only ksize = 1 and ksize = 3\n        CV_EXPORTS void Laplacian(const oclMat &src, oclMat &dst, int ddepth, int ksize = 1, double scale = 1,\n                double delta=0, int borderType=BORDER_DEFAULT);\n\n        //! returns 2D box filter\n        // dst type must be the same as source type\n        CV_EXPORTS Ptr<BaseFilter_GPU> getBoxFilter_GPU(int srcType, int dstType,\n                const Size &ksize, Point anchor = Point(-1, -1), int borderType = BORDER_DEFAULT);\n\n        //! returns box filter engine\n        CV_EXPORTS Ptr<FilterEngine_GPU> createBoxFilter_GPU(int srcType, int dstType, const Size &ksize,\n                const Point &anchor = Point(-1, -1), int borderType = BORDER_DEFAULT);\n\n        //! returns 2D filter with the specified kernel\n        // supports: dst type must be the same as source type\n        CV_EXPORTS Ptr<BaseFilter_GPU> getLinearFilter_GPU(int srcType, int dstType, const Mat &kernel, const Size &ksize,\n                const Point &anchor = Point(-1, -1), int borderType = BORDER_DEFAULT);\n\n        //! returns the non-separable linear filter engine\n        // supports: dst type must be the same as source type\n        CV_EXPORTS Ptr<FilterEngine_GPU> createLinearFilter_GPU(int srcType, int dstType, const Mat &kernel,\n                const Point &anchor = Point(-1, -1), int borderType = BORDER_DEFAULT);\n\n        //! smooths the image using the normalized box filter\n        CV_EXPORTS void boxFilter(const oclMat &src, oclMat &dst, int ddepth, Size ksize,\n                                  Point anchor = Point(-1, -1), int borderType = BORDER_DEFAULT);\n\n        //! returns 2D morphological filter\n        //! only MORPH_ERODE and MORPH_DILATE are supported\n        // supports CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4 types\n        // kernel must have CV_8UC1 type, one rows and cols == ksize.width * ksize.height\n        CV_EXPORTS Ptr<BaseFilter_GPU> getMorphologyFilter_GPU(int op, int type, const Mat &kernel, const Size &ksize,\n                Point anchor = Point(-1, -1));\n\n        //! returns morphological filter engine. Only MORPH_ERODE and MORPH_DILATE are supported.\n        CV_EXPORTS Ptr<FilterEngine_GPU> createMorphologyFilter_GPU(int op, int type, const Mat &kernel,\n                const Point &anchor = Point(-1, -1), int iterations = 1);\n\n        //! a synonym for normalized box filter\n        static inline void blur(const oclMat &src, oclMat &dst, Size ksize, Point anchor = Point(-1, -1),\n                                int borderType = BORDER_CONSTANT)\n        {\n            boxFilter(src, dst, -1, ksize, anchor, borderType);\n        }\n\n        //! applies non-separable 2D linear filter to the image\n        CV_EXPORTS void filter2D(const oclMat &src, oclMat &dst, int ddepth, const Mat &kernel,\n                                 Point anchor = Point(-1, -1), double delta = 0.0, int borderType = BORDER_DEFAULT);\n\n        //! applies separable 2D linear filter to the image\n        CV_EXPORTS void sepFilter2D(const oclMat &src, oclMat &dst, int ddepth, const Mat &kernelX, const Mat &kernelY,\n                                    Point anchor = Point(-1, -1), double delta = 0.0, int bordertype = BORDER_DEFAULT);\n\n        //! applies generalized Sobel operator to the image\n        // dst.type must equalize src.type\n        // supports data type: CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4\n        // supports border type: BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT,BORDER_REFLECT_101\n        CV_EXPORTS void Sobel(const oclMat &src, oclMat &dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, double delta = 0.0, int bordertype = BORDER_DEFAULT);\n\n        //! applies the vertical or horizontal Scharr operator to the image\n        // dst.type must equalize src.type\n        // supports data type: CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4\n        // supports border type: BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT,BORDER_REFLECT_101\n        CV_EXPORTS void Scharr(const oclMat &src, oclMat &dst, int ddepth, int dx, int dy, double scale = 1, double delta = 0.0, int bordertype = BORDER_DEFAULT);\n\n        //! smooths the image using Gaussian filter.\n        // dst.type must equalize src.type\n        // supports data type: CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4\n        // supports border type: BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT,BORDER_REFLECT_101\n        CV_EXPORTS void GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double sigma1, double sigma2 = 0, int bordertype = BORDER_DEFAULT);\n\n        //! erodes the image (applies the local minimum operator)\n        // supports data type: CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4\n        CV_EXPORTS void erode( const oclMat &src, oclMat &dst, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1,\n\n                               int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue());\n\n\n        //! dilates the image (applies the local maximum operator)\n        // supports data type: CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4\n        CV_EXPORTS void dilate( const oclMat &src, oclMat &dst, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1,\n\n                                int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue());\n\n\n        //! applies an advanced morphological operation to the image\n        CV_EXPORTS void morphologyEx( const oclMat &src, oclMat &dst, int op, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1,\n\n                                      int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue());\n\n\n        ////////////////////////////// Image processing //////////////////////////////\n        //! Does mean shift filtering on GPU.\n        CV_EXPORTS void meanShiftFiltering(const oclMat &src, oclMat &dst, int sp, int sr,\n                                           TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1));\n\n        //! Does mean shift procedure on GPU.\n        CV_EXPORTS void meanShiftProc(const oclMat &src, oclMat &dstr, oclMat &dstsp, int sp, int sr,\n                                      TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1));\n\n        //! Does mean shift segmentation with elimiation of small regions.\n        CV_EXPORTS void meanShiftSegmentation(const oclMat &src, Mat &dst, int sp, int sr, int minsize,\n                                              TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1));\n\n        //! applies fixed threshold to the image.\n        // supports CV_8UC1 and CV_32FC1 data type\n        // supports threshold type: THRESH_BINARY, THRESH_BINARY_INV, THRESH_TRUNC, THRESH_TOZERO, THRESH_TOZERO_INV\n        CV_EXPORTS double threshold(const oclMat &src, oclMat &dst, double thresh, double maxVal, int type = THRESH_TRUNC);\n\n        //! resizes the image\n        // Supports INTER_NEAREST, INTER_LINEAR\n        // supports CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4 types\n        CV_EXPORTS void resize(const oclMat &src, oclMat &dst, Size dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR);\n\n        //! Applies a generic geometrical transformation to an image.\n\n        // Supports INTER_NEAREST, INTER_LINEAR.\n        // Map1 supports CV_16SC2, CV_32FC2  types.\n        // Src supports CV_8UC1, CV_8UC2, CV_8UC4.\n        CV_EXPORTS void remap(const oclMat &src, oclMat &dst, oclMat &map1, oclMat &map2, int interpolation, int bordertype, const Scalar &value = Scalar());\n\n        //! copies 2D array to a larger destination array and pads borders with user-specifiable constant\n        // supports CV_8UC1, CV_8UC4, CV_32SC1 types\n        CV_EXPORTS void copyMakeBorder(const oclMat &src, oclMat &dst, int top, int bottom, int left, int right, int boardtype, const Scalar &value = Scalar());\n\n        //! Smoothes image using median filter\n        // The source 1- or 4-channel image. m should be 3 or 5, the image depth should be CV_8U or CV_32F.\n        CV_EXPORTS void medianFilter(const oclMat &src, oclMat &dst, int m);\n\n        //! warps the image using affine transformation\n        // Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC\n        // supports CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4 types\n        CV_EXPORTS void warpAffine(const oclMat &src, oclMat &dst, const Mat &M, Size dsize, int flags = INTER_LINEAR);\n\n        //! warps the image using perspective transformation\n        // Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC\n        // supports CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4 types\n        CV_EXPORTS void warpPerspective(const oclMat &src, oclMat &dst, const Mat &M, Size dsize, int flags = INTER_LINEAR);\n\n        //! computes the integral image and integral for the squared image\n        // sum will have CV_32S type, sqsum - CV32F type\n        // supports only CV_8UC1 source type\n        CV_EXPORTS void integral(const oclMat &src, oclMat &sum, oclMat &sqsum);\n        CV_EXPORTS void integral(const oclMat &src, oclMat &sum);\n        CV_EXPORTS void cornerHarris(const oclMat &src, oclMat &dst, int blockSize, int ksize, double k, int bordertype = cv::BORDER_DEFAULT);\n        CV_EXPORTS void cornerHarris_dxdy(const oclMat &src, oclMat &dst, oclMat &Dx, oclMat &Dy,\n            int blockSize, int ksize, double k, int bordertype = cv::BORDER_DEFAULT);\n        CV_EXPORTS void cornerMinEigenVal(const oclMat &src, oclMat &dst, int blockSize, int ksize, int bordertype = cv::BORDER_DEFAULT);\n        CV_EXPORTS void cornerMinEigenVal_dxdy(const oclMat &src, oclMat &dst, oclMat &Dx, oclMat &Dy,\n            int blockSize, int ksize, int bordertype = cv::BORDER_DEFAULT);\n        /////////////////////////////////// ML ///////////////////////////////////////////\n\n        //! Compute closest centers for each lines in source and lable it after center's index\n        // supports CV_32FC1/CV_32FC2/CV_32FC4 data type\n        // supports NORM_L1 and NORM_L2 distType\n        // if indices is provided, only the indexed rows will be calculated and their results are in the same\n        // order of indices\n        CV_EXPORTS void distanceToCenters(const oclMat &src, const oclMat &centers, Mat &dists, Mat &labels, int distType = NORM_L2SQR);\n\n        //!Does k-means procedure on GPU\n        // supports CV_32FC1/CV_32FC2/CV_32FC4 data type\n        CV_EXPORTS double kmeans(const oclMat &src, int K, oclMat &bestLabels,\n                                     TermCriteria criteria, int attemps, int flags, oclMat &centers);\n\n\n        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////CascadeClassifier//////////////////////////////////////////////////////////////////\n        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n        class CV_EXPORTS_W OclCascadeClassifier : public  cv::CascadeClassifier\n        {\n        public:\n            OclCascadeClassifier() {};\n            ~OclCascadeClassifier() {};\n\n            CvSeq* oclHaarDetectObjects(oclMat &gimg, CvMemStorage *storage, double scaleFactor,\n                                        int minNeighbors, int flags, CvSize minSize = cvSize(0, 0), CvSize maxSize = cvSize(0, 0));\n            void detectMultiScale(oclMat &image, CV_OUT std::vector<cv::Rect>& faces,\n                double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0,\n                Size minSize = Size(), Size maxSize = Size());\n        };\n\n        class CV_EXPORTS OclCascadeClassifierBuf : public  cv::CascadeClassifier\n        {\n        public:\n            OclCascadeClassifierBuf() :\n                m_flags(0), initialized(false), m_scaleFactor(0), buffers(NULL) {}\n\n            ~OclCascadeClassifierBuf() { release(); }\n\n            void detectMultiScale(oclMat &image, CV_OUT std::vector<cv::Rect>& faces,\n                                  double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0,\n                                  Size minSize = Size(), Size maxSize = Size());\n            void release();\n\n        private:\n            void Init(const int rows, const int cols, double scaleFactor, int flags,\n                      const int outputsz, const size_t localThreads[],\n                      CvSize minSize, CvSize maxSize);\n            void CreateBaseBufs(const int datasize, const int totalclassifier, const int flags, const int outputsz);\n            void CreateFactorRelatedBufs(const int rows, const int cols, const int flags,\n                                         const double scaleFactor, const size_t localThreads[],\n                                         CvSize minSize, CvSize maxSize);\n            void GenResult(CV_OUT std::vector<cv::Rect>& faces, const std::vector<cv::Rect> &rectList, const std::vector<int> &rweights);\n\n            int m_rows;\n            int m_cols;\n            int m_flags;\n            int m_loopcount;\n            int m_nodenum;\n            bool findBiggestObject;\n            bool initialized;\n            double m_scaleFactor;\n            Size m_minSize;\n            Size m_maxSize;\n            vector<CvSize> sizev;\n            vector<float> scalev;\n            oclMat gimg1, gsum, gsqsum;\n            void * buffers;\n        };\n\n\n        /////////////////////////////// Pyramid /////////////////////////////////////\n        CV_EXPORTS void pyrDown(const oclMat &src, oclMat &dst);\n\n        //! upsamples the source image and then smoothes it\n        CV_EXPORTS void pyrUp(const oclMat &src, oclMat &dst);\n\n        //! performs linear blending of two images\n        //! to avoid accuracy errors sum of weigths shouldn't be very close to zero\n        // supports only CV_8UC1 source type\n        CV_EXPORTS void blendLinear(const oclMat &img1, const oclMat &img2, const oclMat &weights1, const oclMat &weights2, oclMat &result);\n\n        //! computes vertical sum, supports only CV_32FC1 images\n        CV_EXPORTS void columnSum(const oclMat &src, oclMat &sum);\n\n        ///////////////////////////////////////// match_template /////////////////////////////////////////////////////////////\n        struct CV_EXPORTS MatchTemplateBuf\n        {\n            Size user_block_size;\n            oclMat imagef, templf;\n            std::vector<oclMat> images;\n            std::vector<oclMat> image_sums;\n            std::vector<oclMat> image_sqsums;\n        };\n\n        //! computes the proximity map for the raster template and the image where the template is searched for\n        // Supports TM_SQDIFF, TM_SQDIFF_NORMED, TM_CCORR, TM_CCORR_NORMED, TM_CCOEFF, TM_CCOEFF_NORMED for type 8UC1 and 8UC4\n        // Supports TM_SQDIFF, TM_CCORR for type 32FC1 and 32FC4\n        CV_EXPORTS void matchTemplate(const oclMat &image, const oclMat &templ, oclMat &result, int method);\n\n        //! computes the proximity map for the raster template and the image where the template is searched for\n        // Supports TM_SQDIFF, TM_SQDIFF_NORMED, TM_CCORR, TM_CCORR_NORMED, TM_CCOEFF, TM_CCOEFF_NORMED for type 8UC1 and 8UC4\n        // Supports TM_SQDIFF, TM_CCORR for type 32FC1 and 32FC4\n        CV_EXPORTS void matchTemplate(const oclMat &image, const oclMat &templ, oclMat &result, int method, MatchTemplateBuf &buf);\n\n        ///////////////////////////////////////////// Canny /////////////////////////////////////////////\n        struct CV_EXPORTS CannyBuf;\n        //! compute edges of the input image using Canny operator\n        // Support CV_8UC1 only\n        CV_EXPORTS void Canny(const oclMat &image, oclMat &edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false);\n        CV_EXPORTS void Canny(const oclMat &image, CannyBuf &buf, oclMat &edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false);\n        CV_EXPORTS void Canny(const oclMat &dx, const oclMat &dy, oclMat &edges, double low_thresh, double high_thresh, bool L2gradient = false);\n        CV_EXPORTS void Canny(const oclMat &dx, const oclMat &dy, CannyBuf &buf, oclMat &edges, double low_thresh, double high_thresh, bool L2gradient = false);\n\n        struct CV_EXPORTS CannyBuf\n        {\n            CannyBuf() : counter(1, 1, CV_32S) { }\n            ~CannyBuf()\n            {\n                release();\n            }\n            explicit CannyBuf(const Size &image_size, int apperture_size = 3) : counter(1, 1, CV_32S)\n            {\n                create(image_size, apperture_size);\n            }\n            CannyBuf(const oclMat &dx_, const oclMat &dy_);\n\n            void create(const Size &image_size, int apperture_size = 3);\n            void release();\n            oclMat dx, dy;\n            oclMat dx_buf, dy_buf;\n            oclMat edgeBuf;\n            oclMat trackBuf1, trackBuf2;\n            oclMat counter;\n            Ptr<FilterEngine_GPU> filterDX, filterDY;\n        };\n\n        ///////////////////////////////////////// clAmdFft related /////////////////////////////////////////\n        //! Performs a forward or inverse discrete Fourier transform (1D or 2D) of floating point matrix.\n        //! Param dft_size is the size of DFT transform.\n        //!\n        //! For complex-to-real transform it is assumed that the source matrix is packed in CLFFT's format.\n        // support src type of CV32FC1, CV32FC2\n        // support flags: DFT_INVERSE, DFT_REAL_OUTPUT, DFT_COMPLEX_OUTPUT, DFT_ROWS\n        // dft_size is the size of original input, which is used for transformation from complex to real.\n        // dft_size must be powers of 2, 3 and 5\n        // real to complex dft requires at least v1.8 clAmdFft\n        // real to complex dft output is not the same with cpu version\n        // real to complex and complex to real does not support DFT_ROWS\n        CV_EXPORTS void dft(const oclMat &src, oclMat &dst, Size dft_size = Size(), int flags = 0);\n\n        //! implements generalized matrix product algorithm GEMM from BLAS\n        // The functionality requires clAmdBlas library\n        // only support type CV_32FC1\n        // flag GEMM_3_T is not supported\n        CV_EXPORTS void gemm(const oclMat &src1, const oclMat &src2, double alpha,\n                             const oclMat &src3, double beta, oclMat &dst, int flags = 0);\n\n        //////////////// HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector //////////////\n        struct CV_EXPORTS HOGDescriptor\n        {\n            enum { DEFAULT_WIN_SIGMA = -1 };\n            enum { DEFAULT_NLEVELS = 64 };\n            enum { DESCR_FORMAT_ROW_BY_ROW, DESCR_FORMAT_COL_BY_COL };\n            HOGDescriptor(Size win_size = Size(64, 128), Size block_size = Size(16, 16),\n                          Size block_stride = Size(8, 8), Size cell_size = Size(8, 8),\n                          int nbins = 9, double win_sigma = DEFAULT_WIN_SIGMA,\n                          double threshold_L2hys = 0.2, bool gamma_correction = true,\n                          int nlevels = DEFAULT_NLEVELS);\n\n            size_t getDescriptorSize() const;\n            size_t getBlockHistogramSize() const;\n            void setSVMDetector(const vector<float> &detector);\n            static vector<float> getDefaultPeopleDetector();\n            static vector<float> getPeopleDetector48x96();\n            static vector<float> getPeopleDetector64x128();\n            void detect(const oclMat &img, vector<Point> &found_locations,\n                        double hit_threshold = 0, Size win_stride = Size(),\n                        Size padding = Size());\n            void detectMultiScale(const oclMat &img, vector<Rect> &found_locations,\n                                  double hit_threshold = 0, Size win_stride = Size(),\n                                  Size padding = Size(), double scale0 = 1.05,\n                                  int group_threshold = 2);\n            void getDescriptors(const oclMat &img, Size win_stride,\n                                oclMat &descriptors,\n                                int descr_format = DESCR_FORMAT_COL_BY_COL);\n            Size win_size;\n            Size block_size;\n            Size block_stride;\n            Size cell_size;\n\n            int nbins;\n            double win_sigma;\n            double threshold_L2hys;\n            bool gamma_correction;\n            int nlevels;\n\n        protected:\n            // initialize buffers; only need to do once in case of multiscale detection\n            void init_buffer(const oclMat &img, Size win_stride);\n            void computeBlockHistograms(const oclMat &img);\n            void computeGradient(const oclMat &img, oclMat &grad, oclMat &qangle);\n            double getWinSigma() const;\n            bool checkDetectorSize() const;\n\n            static int numPartsWithin(int size, int part_size, int stride);\n            static Size numPartsWithin(Size size, Size part_size, Size stride);\n\n            // Coefficients of the separating plane\n            float free_coef;\n            oclMat detector;\n            // Results of the last classification step\n            oclMat labels;\n            Mat labels_host;\n            // Results of the last histogram evaluation step\n            oclMat block_hists;\n            // Gradients conputation results\n            oclMat grad, qangle;\n            // scaled image\n            oclMat image_scale;\n            // effect size of input image (might be different from original size after scaling)\n            Size effect_size;\n\n        private:\n            oclMat gauss_w_lut;\n        };\n\n\n        ////////////////////////feature2d_ocl/////////////////\n        /****************************************************************************************\\\n        *                                      Distance                                          *\n        \\****************************************************************************************/\n        template<typename T>\n        struct CV_EXPORTS Accumulator\n        {\n            typedef T Type;\n        };\n        template<> struct Accumulator<unsigned char>\n        {\n            typedef float Type;\n        };\n        template<> struct Accumulator<unsigned short>\n        {\n            typedef float Type;\n        };\n        template<> struct Accumulator<char>\n        {\n            typedef float Type;\n        };\n        template<> struct Accumulator<short>\n        {\n            typedef float Type;\n        };\n\n        /*\n         * Manhattan distance (city block distance) functor\n         */\n        template<class T>\n        struct CV_EXPORTS L1\n        {\n            enum { normType = NORM_L1 };\n            typedef T ValueType;\n            typedef typename Accumulator<T>::Type ResultType;\n\n            ResultType operator()( const T *a, const T *b, int size ) const\n            {\n                return normL1<ValueType, ResultType>(a, b, size);\n            }\n        };\n\n        /*\n         * Euclidean distance functor\n         */\n        template<class T>\n        struct CV_EXPORTS L2\n        {\n            enum { normType = NORM_L2 };\n            typedef T ValueType;\n            typedef typename Accumulator<T>::Type ResultType;\n\n            ResultType operator()( const T *a, const T *b, int size ) const\n            {\n                return (ResultType)sqrt((double)normL2Sqr<ValueType, ResultType>(a, b, size));\n            }\n        };\n\n        /*\n         * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor\n         * bit count of A exclusive XOR'ed with B\n         */\n        struct CV_EXPORTS Hamming\n        {\n            enum { normType = NORM_HAMMING };\n            typedef unsigned char ValueType;\n            typedef int ResultType;\n\n            /** this will count the bits in a ^ b\n             */\n            ResultType operator()( const unsigned char *a, const unsigned char *b, int size ) const\n            {\n                return normHamming(a, b, size);\n            }\n        };\n\n        ////////////////////////////////// BruteForceMatcher //////////////////////////////////\n\n        class CV_EXPORTS BruteForceMatcher_OCL_base\n        {\n        public:\n            enum DistType {L1Dist = 0, L2Dist, HammingDist};\n            explicit BruteForceMatcher_OCL_base(DistType distType = L2Dist);\n            // Add descriptors to train descriptor collection\n            void add(const std::vector<oclMat> &descCollection);\n            // Get train descriptors collection\n            const std::vector<oclMat> &getTrainDescriptors() const;\n            // Clear train descriptors collection\n            void clear();\n            // Return true if there are not train descriptors in collection\n            bool empty() const;\n\n            // Return true if the matcher supports mask in match methods\n            bool isMaskSupported() const;\n\n            // Find one best match for each query descriptor\n            void matchSingle(const oclMat &query, const oclMat &train,\n                             oclMat &trainIdx, oclMat &distance,\n                             const oclMat &mask = oclMat());\n\n            // Download trainIdx and distance and convert it to CPU vector with DMatch\n            static void matchDownload(const oclMat &trainIdx, const oclMat &distance, std::vector<DMatch> &matches);\n            // Convert trainIdx and distance to vector with DMatch\n            static void matchConvert(const Mat &trainIdx, const Mat &distance, std::vector<DMatch> &matches);\n\n            // Find one best match for each query descriptor\n            void match(const oclMat &query, const oclMat &train, std::vector<DMatch> &matches, const oclMat &mask = oclMat());\n\n            // Make gpu collection of trains and masks in suitable format for matchCollection function\n            void makeGpuCollection(oclMat &trainCollection, oclMat &maskCollection, const std::vector<oclMat> &masks = std::vector<oclMat>());\n\n\n            // Find one best match from train collection for each query descriptor\n            void matchCollection(const oclMat &query, const oclMat &trainCollection,\n                                 oclMat &trainIdx, oclMat &imgIdx, oclMat &distance,\n                                 const oclMat &masks = oclMat());\n\n            // Download trainIdx, imgIdx and distance and convert it to vector with DMatch\n            static void matchDownload(const oclMat &trainIdx, const oclMat &imgIdx, const oclMat &distance, std::vector<DMatch> &matches);\n            // Convert trainIdx, imgIdx and distance to vector with DMatch\n            static void matchConvert(const Mat &trainIdx, const Mat &imgIdx, const Mat &distance, std::vector<DMatch> &matches);\n\n            // Find one best match from train collection for each query descriptor.\n            void match(const oclMat &query, std::vector<DMatch> &matches, const std::vector<oclMat> &masks = std::vector<oclMat>());\n\n            // Find k best matches for each query descriptor (in increasing order of distances)\n            void knnMatchSingle(const oclMat &query, const oclMat &train,\n                                oclMat &trainIdx, oclMat &distance, oclMat &allDist, int k,\n                                const oclMat &mask = oclMat());\n\n            // Download trainIdx and distance and convert it to vector with DMatch\n            // compactResult is used when mask is not empty. If compactResult is false matches\n            // vector will have the same size as queryDescriptors rows. If compactResult is true\n            // matches vector will not contain matches for fully masked out query descriptors.\n            static void knnMatchDownload(const oclMat &trainIdx, const oclMat &distance,\n                                         std::vector< std::vector<DMatch> > &matches, bool compactResult = false);\n\n            // Convert trainIdx and distance to vector with DMatch\n            static void knnMatchConvert(const Mat &trainIdx, const Mat &distance,\n                                        std::vector< std::vector<DMatch> > &matches, bool compactResult = false);\n\n            // Find k best matches for each query descriptor (in increasing order of distances).\n            // compactResult is used when mask is not empty. If compactResult is false matches\n            // vector will have the same size as queryDescriptors rows. If compactResult is true\n            // matches vector will not contain matches for fully masked out query descriptors.\n            void knnMatch(const oclMat &query, const oclMat &train,\n                          std::vector< std::vector<DMatch> > &matches, int k, const oclMat &mask = oclMat(),\n                          bool compactResult = false);\n\n            // Find k best matches from train collection for each query descriptor (in increasing order of distances)\n            void knnMatch2Collection(const oclMat &query, const oclMat &trainCollection,\n                                     oclMat &trainIdx, oclMat &imgIdx, oclMat &distance,\n                                     const oclMat &maskCollection = oclMat());\n\n            // Download trainIdx and distance and convert it to vector with DMatch\n            // compactResult is used when mask is not empty. If compactResult is false matches\n            // vector will have the same size as queryDescriptors rows. If compactResult is true\n            // matches vector will not contain matches for fully masked out query descriptors.\n            static void knnMatch2Download(const oclMat &trainIdx, const oclMat &imgIdx, const oclMat &distance,\n                                          std::vector< std::vector<DMatch> > &matches, bool compactResult = false);\n\n            // Convert trainIdx and distance to vector with DMatch\n            static void knnMatch2Convert(const Mat &trainIdx, const Mat &imgIdx, const Mat &distance,\n                                         std::vector< std::vector<DMatch> > &matches, bool compactResult = false);\n\n            // Find k best matches  for each query descriptor (in increasing order of distances).\n            // compactResult is used when mask is not empty. If compactResult is false matches\n            // vector will have the same size as queryDescriptors rows. If compactResult is true\n            // matches vector will not contain matches for fully masked out query descriptors.\n            void knnMatch(const oclMat &query, std::vector< std::vector<DMatch> > &matches, int k,\n                          const std::vector<oclMat> &masks = std::vector<oclMat>(), bool compactResult = false);\n\n            // Find best matches for each query descriptor which have distance less than maxDistance.\n            // nMatches.at<int>(0, queryIdx) will contain matches count for queryIdx.\n            // carefully nMatches can be greater than trainIdx.cols - it means that matcher didn't find all matches,\n            // because it didn't have enough memory.\n            // If trainIdx is empty, then trainIdx and distance will be created with size nQuery x max((nTrain / 100), 10),\n            // otherwize user can pass own allocated trainIdx and distance with size nQuery x nMaxMatches\n            // Matches doesn't sorted.\n            void radiusMatchSingle(const oclMat &query, const oclMat &train,\n                                   oclMat &trainIdx, oclMat &distance, oclMat &nMatches, float maxDistance,\n                                   const oclMat &mask = oclMat());\n\n            // Download trainIdx, nMatches and distance and convert it to vector with DMatch.\n            // matches will be sorted in increasing order of distances.\n            // compactResult is used when mask is not empty. If compactResult is false matches\n            // vector will have the same size as queryDescriptors rows. If compactResult is true\n            // matches vector will not contain matches for fully masked out query descriptors.\n            static void radiusMatchDownload(const oclMat &trainIdx, const oclMat &distance, const oclMat &nMatches,\n                                            std::vector< std::vector<DMatch> > &matches, bool compactResult = false);\n            // Convert trainIdx, nMatches and distance to vector with DMatch.\n            static void radiusMatchConvert(const Mat &trainIdx, const Mat &distance, const Mat &nMatches,\n                                           std::vector< std::vector<DMatch> > &matches, bool compactResult = false);\n            // Find best matches for each query descriptor which have distance less than maxDistance\n            // in increasing order of distances).\n            void radiusMatch(const oclMat &query, const oclMat &train,\n                             std::vector< std::vector<DMatch> > &matches, float maxDistance,\n                             const oclMat &mask = oclMat(), bool compactResult = false);\n            // Find best matches for each query descriptor which have distance less than maxDistance.\n            // If trainIdx is empty, then trainIdx and distance will be created with size nQuery x max((nQuery / 100), 10),\n            // otherwize user can pass own allocated trainIdx and distance with size nQuery x nMaxMatches\n            // Matches doesn't sorted.\n            void radiusMatchCollection(const oclMat &query, oclMat &trainIdx, oclMat &imgIdx, oclMat &distance, oclMat &nMatches, float maxDistance,\n                                       const std::vector<oclMat> &masks = std::vector<oclMat>());\n            // Download trainIdx, imgIdx, nMatches and distance and convert it to vector with DMatch.\n            // matches will be sorted in increasing order of distances.\n            // compactResult is used when mask is not empty. If compactResult is false matches\n            // vector will have the same size as queryDescriptors rows. If compactResult is true\n            // matches vector will not contain matches for fully masked out query descriptors.\n            static void radiusMatchDownload(const oclMat &trainIdx, const oclMat &imgIdx, const oclMat &distance, const oclMat &nMatches,\n                                            std::vector< std::vector<DMatch> > &matches, bool compactResult = false);\n            // Convert trainIdx, nMatches and distance to vector with DMatch.\n            static void radiusMatchConvert(const Mat &trainIdx, const Mat &imgIdx, const Mat &distance, const Mat &nMatches,\n                                           std::vector< std::vector<DMatch> > &matches, bool compactResult = false);\n            // Find best matches from train collection for each query descriptor which have distance less than\n            // maxDistance (in increasing order of distances).\n            void radiusMatch(const oclMat &query, std::vector< std::vector<DMatch> > &matches, float maxDistance,\n                             const std::vector<oclMat> &masks = std::vector<oclMat>(), bool compactResult = false);\n            DistType distType;\n        private:\n            std::vector<oclMat> trainDescCollection;\n        };\n\n        template <class Distance>\n        class CV_EXPORTS BruteForceMatcher_OCL;\n\n        template <typename T>\n        class CV_EXPORTS BruteForceMatcher_OCL< L1<T> > : public BruteForceMatcher_OCL_base\n        {\n        public:\n            explicit BruteForceMatcher_OCL() : BruteForceMatcher_OCL_base(L1Dist) {}\n            explicit BruteForceMatcher_OCL(L1<T> /*d*/) : BruteForceMatcher_OCL_base(L1Dist) {}\n        };\n\n        template <typename T>\n        class CV_EXPORTS BruteForceMatcher_OCL< L2<T> > : public BruteForceMatcher_OCL_base\n        {\n        public:\n            explicit BruteForceMatcher_OCL() : BruteForceMatcher_OCL_base(L2Dist) {}\n            explicit BruteForceMatcher_OCL(L2<T> /*d*/) : BruteForceMatcher_OCL_base(L2Dist) {}\n        };\n\n        template <> class CV_EXPORTS BruteForceMatcher_OCL< Hamming > : public BruteForceMatcher_OCL_base\n        {\n        public:\n            explicit BruteForceMatcher_OCL() : BruteForceMatcher_OCL_base(HammingDist) {}\n            explicit BruteForceMatcher_OCL(Hamming /*d*/) : BruteForceMatcher_OCL_base(HammingDist) {}\n        };\n\n        class CV_EXPORTS BFMatcher_OCL : public BruteForceMatcher_OCL_base\n        {\n        public:\n            explicit BFMatcher_OCL(int norm = NORM_L2) : BruteForceMatcher_OCL_base(norm == NORM_L1 ? L1Dist : norm == NORM_L2 ? L2Dist : HammingDist) {}\n        };\n\n        class CV_EXPORTS GoodFeaturesToTrackDetector_OCL\n        {\n        public:\n            explicit GoodFeaturesToTrackDetector_OCL(int maxCorners = 1000, double qualityLevel = 0.01, double minDistance = 0.0,\n                int blockSize = 3, bool useHarrisDetector = false, double harrisK = 0.04);\n\n            //! return 1 rows matrix with CV_32FC2 type\n            void operator ()(const oclMat& image, oclMat& corners, const oclMat& mask = oclMat());\n            //! download points of type Point2f to a vector. the vector's content will be erased\n            void downloadPoints(const oclMat &points, vector<Point2f> &points_v);\n\n            int maxCorners;\n            double qualityLevel;\n            double minDistance;\n\n            int blockSize;\n            bool useHarrisDetector;\n            double harrisK;\n            void releaseMemory()\n            {\n                Dx_.release();\n                Dy_.release();\n                eig_.release();\n                minMaxbuf_.release();\n                tmpCorners_.release();\n            }\n        private:\n            oclMat Dx_;\n            oclMat Dy_;\n            oclMat eig_;\n            oclMat eig_minmax_;\n            oclMat minMaxbuf_;\n            oclMat tmpCorners_;\n            oclMat counter_;\n        };\n\n        inline GoodFeaturesToTrackDetector_OCL::GoodFeaturesToTrackDetector_OCL(int maxCorners_, double qualityLevel_, double minDistance_,\n            int blockSize_, bool useHarrisDetector_, double harrisK_)\n        {\n            maxCorners = maxCorners_;\n            qualityLevel = qualityLevel_;\n            minDistance = minDistance_;\n            blockSize = blockSize_;\n            useHarrisDetector = useHarrisDetector_;\n            harrisK = harrisK_;\n        }\n\n        /////////////////////////////// PyrLKOpticalFlow /////////////////////////////////////\n        class CV_EXPORTS PyrLKOpticalFlow\n        {\n        public:\n            PyrLKOpticalFlow()\n            {\n                winSize = Size(21, 21);\n                maxLevel = 3;\n                iters = 30;\n                derivLambda = 0.5;\n                useInitialFlow = false;\n                minEigThreshold = 1e-4f;\n                getMinEigenVals = false;\n                isDeviceArch11_ = false;\n            }\n\n            void sparse(const oclMat &prevImg, const oclMat &nextImg, const oclMat &prevPts, oclMat &nextPts,\n                        oclMat &status, oclMat *err = 0);\n            void dense(const oclMat &prevImg, const oclMat &nextImg, oclMat &u, oclMat &v, oclMat *err = 0);\n            Size winSize;\n            int maxLevel;\n            int iters;\n            double derivLambda;\n            bool useInitialFlow;\n            float minEigThreshold;\n            bool getMinEigenVals;\n            void releaseMemory()\n            {\n                dx_calcBuf_.release();\n                dy_calcBuf_.release();\n\n                prevPyr_.clear();\n                nextPyr_.clear();\n\n                dx_buf_.release();\n                dy_buf_.release();\n            }\n        private:\n            void calcSharrDeriv(const oclMat &src, oclMat &dx, oclMat &dy);\n            void buildImagePyramid(const oclMat &img0, vector<oclMat> &pyr, bool withBorder);\n\n            oclMat dx_calcBuf_;\n            oclMat dy_calcBuf_;\n\n            vector<oclMat> prevPyr_;\n            vector<oclMat> nextPyr_;\n\n            oclMat dx_buf_;\n            oclMat dy_buf_;\n            oclMat uPyr_[2];\n            oclMat vPyr_[2];\n            bool isDeviceArch11_;\n        };\n\n        class CV_EXPORTS FarnebackOpticalFlow\n        {\n        public:\n            FarnebackOpticalFlow();\n\n            int numLevels;\n            double pyrScale;\n            bool fastPyramids;\n            int winSize;\n            int numIters;\n            int polyN;\n            double polySigma;\n            int flags;\n\n            void operator ()(const oclMat &frame0, const oclMat &frame1, oclMat &flowx, oclMat &flowy);\n\n            void releaseMemory();\n\n        private:\n            void setGaussianBlurKernel(const float *c_gKer, int ksizeHalf);\n\n            void gaussianBlurOcl(const oclMat &src, int ksizeHalf, oclMat &dst);\n\n            void polynomialExpansionOcl(\n                const oclMat &src, int polyN, oclMat &dst);\n\n            void gaussianBlur5Ocl(\n                const oclMat &src, int ksizeHalf, oclMat &dst);\n\n            void prepareGaussian(\n                int n, double sigma, float *g, float *xg, float *xxg,\n                double &ig11, double &ig03, double &ig33, double &ig55);\n\n            void setPolynomialExpansionConsts(int n, double sigma);\n\n            void updateFlow_boxFilter(\n                const oclMat& R0, const oclMat& R1, oclMat& flowx, oclMat &flowy,\n                oclMat& M, oclMat &bufM, int blockSize, bool updateMatrices);\n\n            void updateFlow_gaussianBlur(\n                const oclMat& R0, const oclMat& R1, oclMat& flowx, oclMat& flowy,\n                oclMat& M, oclMat &bufM, int blockSize, bool updateMatrices);\n\n            oclMat frames_[2];\n            oclMat pyrLevel_[2], M_, bufM_, R_[2], blurredFrame_[2];\n            std::vector<oclMat> pyramid0_, pyramid1_;\n            float ig[4];\n            oclMat gMat;\n            oclMat xgMat;\n            oclMat xxgMat;\n            oclMat gKerMat;\n        };\n\n        //////////////// build warping maps ////////////////////\n        //! builds plane warping maps\n        CV_EXPORTS void buildWarpPlaneMaps(Size src_size, Rect dst_roi, const Mat &K, const Mat &R, const Mat &T, float scale, oclMat &map_x, oclMat &map_y);\n        //! builds cylindrical warping maps\n        CV_EXPORTS void buildWarpCylindricalMaps(Size src_size, Rect dst_roi, const Mat &K, const Mat &R, float scale, oclMat &map_x, oclMat &map_y);\n        //! builds spherical warping maps\n        CV_EXPORTS void buildWarpSphericalMaps(Size src_size, Rect dst_roi, const Mat &K, const Mat &R, float scale, oclMat &map_x, oclMat &map_y);\n        //! builds Affine warping maps\n        CV_EXPORTS void buildWarpAffineMaps(const Mat &M, bool inverse, Size dsize, oclMat &xmap, oclMat &ymap);\n\n        //! builds Perspective warping maps\n        CV_EXPORTS void buildWarpPerspectiveMaps(const Mat &M, bool inverse, Size dsize, oclMat &xmap, oclMat &ymap);\n\n        ///////////////////////////////////// interpolate frames //////////////////////////////////////////////\n        //! Interpolate frames (images) using provided optical flow (displacement field).\n        //! frame0   - frame 0 (32-bit floating point images, single channel)\n        //! frame1   - frame 1 (the same type and size)\n        //! fu       - forward horizontal displacement\n        //! fv       - forward vertical displacement\n        //! bu       - backward horizontal displacement\n        //! bv       - backward vertical displacement\n        //! pos      - new frame position\n        //! newFrame - new frame\n        //! buf      - temporary buffer, will have width x 6*height size, CV_32FC1 type and contain 6 oclMat;\n        //!            occlusion masks            0, occlusion masks            1,\n        //!            interpolated forward flow  0, interpolated forward flow  1,\n        //!            interpolated backward flow 0, interpolated backward flow 1\n        //!\n        CV_EXPORTS void interpolateFrames(const oclMat &frame0, const oclMat &frame1,\n                                          const oclMat &fu, const oclMat &fv,\n                                          const oclMat &bu, const oclMat &bv,\n                                          float pos, oclMat &newFrame, oclMat &buf);\n\n        //! computes moments of the rasterized shape or a vector of points\n        //! _array should be a vector a points standing for the contour\n        CV_EXPORTS Moments ocl_moments(InputArray contour);\n        //! src should be a general image uploaded to the GPU.\n        //! the supported oclMat type are CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1 and CV_64FC1\n        //! to use type of CV_64FC1, the GPU should support CV_64FC1\n        CV_EXPORTS Moments ocl_moments(oclMat& src, bool binary);\n\n        class CV_EXPORTS StereoBM_OCL\n        {\n        public:\n            enum { BASIC_PRESET = 0, PREFILTER_XSOBEL = 1 };\n\n            enum { DEFAULT_NDISP = 64, DEFAULT_WINSZ = 19 };\n\n            //! the default constructor\n            StereoBM_OCL();\n            //! the full constructor taking the camera-specific preset, number of disparities and the SAD window size. ndisparities must be multiple of 8.\n            StereoBM_OCL(int preset, int ndisparities = DEFAULT_NDISP, int winSize = DEFAULT_WINSZ);\n\n            //! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair\n            //! Output disparity has CV_8U type.\n            void operator() ( const oclMat &left, const oclMat &right, oclMat &disparity);\n\n            //! Some heuristics that tries to estmate\n            // if current GPU will be faster then CPU in this algorithm.\n            // It queries current active device.\n            static bool checkIfGpuCallReasonable();\n\n            int preset;\n            int ndisp;\n            int winSize;\n\n            // If avergeTexThreshold  == 0 => post procesing is disabled\n            // If avergeTexThreshold != 0 then disparity is set 0 in each point (x,y) where for left image\n            // SumOfHorizontalGradiensInWindow(x, y, winSize) < (winSize * winSize) * avergeTexThreshold\n            // i.e. input left image is low textured.\n            float avergeTexThreshold;\n        private:\n            oclMat minSSD, leBuf, riBuf;\n        };\n\n        class CV_EXPORTS StereoBeliefPropagation\n        {\n        public:\n            enum { DEFAULT_NDISP  = 64 };\n            enum { DEFAULT_ITERS  = 5  };\n            enum { DEFAULT_LEVELS = 5  };\n            static void estimateRecommendedParams(int width, int height, int &ndisp, int &iters, int &levels);\n            explicit StereoBeliefPropagation(int ndisp  = DEFAULT_NDISP,\n                                             int iters  = DEFAULT_ITERS,\n                                             int levels = DEFAULT_LEVELS,\n                                             int msg_type = CV_16S);\n            StereoBeliefPropagation(int ndisp, int iters, int levels,\n                                    float max_data_term, float data_weight,\n                                    float max_disc_term, float disc_single_jump,\n                                    int msg_type = CV_32F);\n            void operator()(const oclMat &left, const oclMat &right, oclMat &disparity);\n            void operator()(const oclMat &data, oclMat &disparity);\n            int ndisp;\n            int iters;\n            int levels;\n            float max_data_term;\n            float data_weight;\n            float max_disc_term;\n            float disc_single_jump;\n            int msg_type;\n        private:\n            oclMat u, d, l, r, u2, d2, l2, r2;\n            std::vector<oclMat> datas;\n            oclMat out;\n        };\n\n        class CV_EXPORTS StereoConstantSpaceBP\n        {\n        public:\n            enum { DEFAULT_NDISP    = 128 };\n            enum { DEFAULT_ITERS    = 8   };\n            enum { DEFAULT_LEVELS   = 4   };\n            enum { DEFAULT_NR_PLANE = 4   };\n            static void estimateRecommendedParams(int width, int height, int &ndisp, int &iters, int &levels, int &nr_plane);\n            explicit StereoConstantSpaceBP(\n                int ndisp    = DEFAULT_NDISP,\n                int iters    = DEFAULT_ITERS,\n                int levels   = DEFAULT_LEVELS,\n                int nr_plane = DEFAULT_NR_PLANE,\n                int msg_type = CV_32F);\n            StereoConstantSpaceBP(int ndisp, int iters, int levels, int nr_plane,\n                float max_data_term, float data_weight, float max_disc_term, float disc_single_jump,\n                int min_disp_th = 0,\n                int msg_type = CV_32F);\n            void operator()(const oclMat &left, const oclMat &right, oclMat &disparity);\n            int ndisp;\n            int iters;\n            int levels;\n            int nr_plane;\n            float max_data_term;\n            float data_weight;\n            float max_disc_term;\n            float disc_single_jump;\n            int min_disp_th;\n            int msg_type;\n            bool use_local_init_data_cost;\n        private:\n            oclMat u[2], d[2], l[2], r[2];\n            oclMat disp_selected_pyr[2];\n            oclMat data_cost;\n            oclMat data_cost_selected;\n            oclMat temp;\n            oclMat out;\n        };\n\n        // Implementation of the Zach, Pock and Bischof Dual TV-L1 Optical Flow method\n        //\n        // see reference:\n        //   [1] C. Zach, T. Pock and H. Bischof, \"A Duality Based Approach for Realtime TV-L1 Optical Flow\".\n        //   [2] Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. \"TV-L1 Optical Flow Estimation\".\n        class CV_EXPORTS OpticalFlowDual_TVL1_OCL\n        {\n        public:\n            OpticalFlowDual_TVL1_OCL();\n\n            void operator ()(const oclMat& I0, const oclMat& I1, oclMat& flowx, oclMat& flowy);\n\n            void collectGarbage();\n\n            /**\n            * Time step of the numerical scheme.\n            */\n            double tau;\n\n            /**\n            * Weight parameter for the data term, attachment parameter.\n            * This is the most relevant parameter, which determines the smoothness of the output.\n            * The smaller this parameter is, the smoother the solutions we obtain.\n            * It depends on the range of motions of the images, so its value should be adapted to each image sequence.\n            */\n            double lambda;\n\n            /**\n            * Weight parameter for (u - v)^2, tightness parameter.\n            * It serves as a link between the attachment and the regularization terms.\n            * In theory, it should have a small value in order to maintain both parts in correspondence.\n            * The method is stable for a large range of values of this parameter.\n            */\n            double theta;\n\n            /**\n            * Number of scales used to create the pyramid of images.\n            */\n            int nscales;\n\n            /**\n            * Number of warpings per scale.\n            * Represents the number of times that I1(x+u0) and grad( I1(x+u0) ) are computed per scale.\n            * This is a parameter that assures the stability of the method.\n            * It also affects the running time, so it is a compromise between speed and accuracy.\n            */\n            int warps;\n\n            /**\n            * Stopping criterion threshold used in the numerical scheme, which is a trade-off between precision and running time.\n            * A small value will yield more accurate solutions at the expense of a slower convergence.\n            */\n            double epsilon;\n\n            /**\n            * Stopping criterion iterations number used in the numerical scheme.\n            */\n            int iterations;\n\n            bool useInitialFlow;\n\n        private:\n            void procOneScale(const oclMat& I0, const oclMat& I1, oclMat& u1, oclMat& u2);\n\n            std::vector<oclMat> I0s;\n            std::vector<oclMat> I1s;\n            std::vector<oclMat> u1s;\n            std::vector<oclMat> u2s;\n\n            oclMat I1x_buf;\n            oclMat I1y_buf;\n\n            oclMat I1w_buf;\n            oclMat I1wx_buf;\n            oclMat I1wy_buf;\n\n            oclMat grad_buf;\n            oclMat rho_c_buf;\n\n            oclMat p11_buf;\n            oclMat p12_buf;\n            oclMat p21_buf;\n            oclMat p22_buf;\n\n            oclMat diff_buf;\n            oclMat norm_buf;\n        };\n        // current supported sorting methods\n        enum\n        {\n            SORT_BITONIC,   // only support power-of-2 buffer size\n            SORT_SELECTION, // cannot sort duplicate keys\n            SORT_MERGE,\n            SORT_RADIX      // only support signed int/float keys(CV_32S/CV_32F)\n        };\n        //! Returns the sorted result of all the elements in input based on equivalent keys.\n        //\n        //  The element unit in the values to be sorted is determined from the data type,\n        //  i.e., a CV_32FC2 input {a1a2, b1b2} will be considered as two elements, regardless its\n        //  matrix dimension.\n        //  both keys and values will be sorted inplace\n        //  Key needs to be single channel oclMat.\n        //\n        //  Example:\n        //  input -\n        //    keys   = {2,    3,   1}   (CV_8UC1)\n        //    values = {10,5, 4,3, 6,2} (CV_8UC2)\n        //  sortByKey(keys, values, SORT_SELECTION, false);\n        //  output -\n        //    keys   = {1,    2,   3}   (CV_8UC1)\n        //    values = {6,2, 10,5, 4,3} (CV_8UC2)\n        CV_EXPORTS void sortByKey(oclMat& keys, oclMat& values, int method, bool isGreaterThan = false);\n        /*!Base class for MOG and MOG2!*/\n        class CV_EXPORTS BackgroundSubtractor\n        {\n        public:\n            //! the virtual destructor\n            virtual ~BackgroundSubtractor();\n            //! the update operator that takes the next video frame and returns the current foreground mask as 8-bit binary image.\n            virtual void operator()(const oclMat& image, oclMat& fgmask, float learningRate);\n\n            //! computes a background image\n            virtual void getBackgroundImage(oclMat& backgroundImage) const = 0;\n        };\n                /*!\n        Gaussian Mixture-based Backbround/Foreground Segmentation Algorithm\n\n        The class implements the following algorithm:\n        \"An improved adaptive background mixture model for real-time tracking with shadow detection\"\n        P. KadewTraKuPong and R. Bowden,\n        Proc. 2nd European Workshp on Advanced Video-Based Surveillance Systems, 2001.\"\n        http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf\n        */\n        class CV_EXPORTS MOG: public cv::ocl::BackgroundSubtractor\n        {\n        public:\n            //! the default constructor\n            MOG(int nmixtures = -1);\n\n            //! re-initiaization method\n            void initialize(Size frameSize, int frameType);\n\n            //! the update operator\n            void operator()(const oclMat& frame, oclMat& fgmask, float learningRate = 0.f);\n\n            //! computes a background image which are the mean of all background gaussians\n            void getBackgroundImage(oclMat& backgroundImage) const;\n\n            //! releases all inner buffers\n            void release();\n\n            int history;\n            float varThreshold;\n            float backgroundRatio;\n            float noiseSigma;\n\n        private:\n            int nmixtures_;\n\n            Size frameSize_;\n            int frameType_;\n            int nframes_;\n\n            oclMat weight_;\n            oclMat sortKey_;\n            oclMat mean_;\n            oclMat var_;\n        };\n\n        /*!\n        The class implements the following algorithm:\n        \"Improved adaptive Gausian mixture model for background subtraction\"\n        Z.Zivkovic\n        International Conference Pattern Recognition, UK, August, 2004.\n        http://www.zoranz.net/Publications/zivkovic2004ICPR.pdf\n        */\n        class CV_EXPORTS MOG2: public cv::ocl::BackgroundSubtractor\n        {\n        public:\n            //! the default constructor\n            MOG2(int nmixtures = -1);\n\n            //! re-initiaization method\n            void initialize(Size frameSize, int frameType);\n\n            //! the update operator\n            void operator()(const oclMat& frame, oclMat& fgmask, float learningRate = -1.0f);\n\n            //! computes a background image which are the mean of all background gaussians\n            void getBackgroundImage(oclMat& backgroundImage) const;\n\n            //! releases all inner buffers\n            void release();\n\n            // parameters\n            // you should call initialize after parameters changes\n\n            int history;\n\n            //! here it is the maximum allowed number of mixture components.\n            //! Actual number is determined dynamically per pixel\n            float varThreshold;\n            // threshold on the squared Mahalanobis distance to decide if it is well described\n            // by the background model or not. Related to Cthr from the paper.\n            // This does not influence the update of the background. A typical value could be 4 sigma\n            // and that is varThreshold=4*4=16; Corresponds to Tb in the paper.\n\n            /////////////////////////\n            // less important parameters - things you might change but be carefull\n            ////////////////////////\n\n            float backgroundRatio;\n            // corresponds to fTB=1-cf from the paper\n            // TB - threshold when the component becomes significant enough to be included into\n            // the background model. It is the TB=1-cf from the paper. So I use cf=0.1 => TB=0.\n            // For alpha=0.001 it means that the mode should exist for approximately 105 frames before\n            // it is considered foreground\n            // float noiseSigma;\n            float varThresholdGen;\n\n            //correspondts to Tg - threshold on the squared Mahalan. dist. to decide\n            //when a sample is close to the existing components. If it is not close\n            //to any a new component will be generated. I use 3 sigma => Tg=3*3=9.\n            //Smaller Tg leads to more generated components and higher Tg might make\n            //lead to small number of components but they can grow too large\n            float fVarInit;\n            float fVarMin;\n            float fVarMax;\n\n            //initial variance  for the newly generated components.\n            //It will will influence the speed of adaptation. A good guess should be made.\n            //A simple way is to estimate the typical standard deviation from the images.\n            //I used here 10 as a reasonable value\n            // min and max can be used to further control the variance\n            float fCT; //CT - complexity reduction prior\n            //this is related to the number of samples needed to accept that a component\n            //actually exists. We use CT=0.05 of all the samples. By setting CT=0 you get\n            //the standard Stauffer&Grimson algorithm (maybe not exact but very similar)\n\n            //shadow detection parameters\n            bool bShadowDetection; //default 1 - do shadow detection\n            unsigned char nShadowDetection; //do shadow detection - insert this value as the detection result - 127 default value\n            float fTau;\n            // Tau - shadow threshold. The shadow is detected if the pixel is darker\n            //version of the background. Tau is a threshold on how much darker the shadow can be.\n            //Tau= 0.5 means that if pixel is more than 2 times darker then it is not shadow\n            //See: Prati,Mikic,Trivedi,Cucchiarra,\"Detecting Moving Shadows...\",IEEE PAMI,2003.\n\n        private:\n            int nmixtures_;\n\n            Size frameSize_;\n            int frameType_;\n            int nframes_;\n\n            oclMat weight_;\n            oclMat variance_;\n            oclMat mean_;\n\n            oclMat bgmodelUsedModes_; //keep track of number of modes per pixel\n        };\n\n        /*!***************Kalman Filter*************!*/\n        class CV_EXPORTS KalmanFilter\n        {\n        public:\n            KalmanFilter();\n            //! the full constructor taking the dimensionality of the state, of the measurement and of the control vector\n            KalmanFilter(int dynamParams, int measureParams, int controlParams=0, int type=CV_32F);\n            //! re-initializes Kalman filter. The previous content is destroyed.\n            void init(int dynamParams, int measureParams, int controlParams=0, int type=CV_32F);\n\n            const oclMat& predict(const oclMat& control=oclMat());\n            const oclMat& correct(const oclMat& measurement);\n\n            oclMat statePre;           //!< predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k)\n            oclMat statePost;          //!< corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))\n            oclMat transitionMatrix;   //!< state transition matrix (A)\n            oclMat controlMatrix;      //!< control matrix (B) (not used if there is no control)\n            oclMat measurementMatrix;  //!< measurement matrix (H)\n            oclMat processNoiseCov;    //!< process noise covariance matrix (Q)\n            oclMat measurementNoiseCov;//!< measurement noise covariance matrix (R)\n            oclMat errorCovPre;        //!< priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/\n            oclMat gain;               //!< Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)\n            oclMat errorCovPost;       //!< posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)\n        private:\n            oclMat temp1;\n            oclMat temp2;\n            oclMat temp3;\n            oclMat temp4;\n            oclMat temp5;\n        };\n\n        /*!***************K Nearest Neighbour*************!*/\n        class CV_EXPORTS KNearestNeighbour: public CvKNearest\n        {\n        public:\n            KNearestNeighbour();\n            ~KNearestNeighbour();\n\n            bool train(const Mat& trainData, Mat& labels, Mat& sampleIdx = Mat().setTo(Scalar::all(0)),\n                bool isRegression = false, int max_k = 32, bool updateBase = false);\n\n            void clear();\n\n            void find_nearest(const oclMat& samples, int k, oclMat& lables);\n\n        private:\n            oclMat samples_ocl;\n        };\n\n        /*!***************  SVM  *************!*/\n        class CV_EXPORTS CvSVM_OCL : public CvSVM\n        {\n        public:\n            CvSVM_OCL();\n\n            CvSVM_OCL(const cv::Mat& trainData, const cv::Mat& responses,\n                      const cv::Mat& varIdx=cv::Mat(), const cv::Mat& sampleIdx=cv::Mat(),\n                      CvSVMParams params=CvSVMParams());\n            CV_WRAP float predict( const int row_index, Mat& src, bool returnDFVal=false ) const;\n            CV_WRAP void predict( cv::InputArray samples, cv::OutputArray results ) const;\n            CV_WRAP float predict( const cv::Mat& sample, bool returnDFVal=false ) const;\n            float predict( const CvMat* samples, CV_OUT CvMat* results ) const;\n\n        protected:\n            float predict( const int row_index, int row_len, Mat& src, bool returnDFVal=false ) const;\n            void create_kernel();\n            void create_solver();\n        };\n\n        /*!***************  END  *************!*/\n    }\n}\n#if defined _MSC_VER && _MSC_VER >= 1200\n#  pragma warning( push)\n#  pragma warning( disable: 4267)\n#endif\n#include \"opencv2/ocl/matrix_operations.hpp\"\n#if defined _MSC_VER && _MSC_VER >= 1200\n#  pragma warning( pop)\n#endif\n\n#endif /* __OPENCV_OCL_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/opencv.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_ALL_HPP__\n#define __OPENCV_ALL_HPP__\n\n#include \"opencv2/core/core_c.h\"\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/flann/miniflann.hpp\"\n#include \"opencv2/imgproc/imgproc_c.h\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/photo/photo.hpp\"\n#include \"opencv2/video/video.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/objdetect/objdetect.hpp\"\n#include \"opencv2/calib3d/calib3d.hpp\"\n#include \"opencv2/ml/ml.hpp\"\n#include \"opencv2/highgui/highgui_c.h\"\n#include \"opencv2/highgui/highgui.hpp\"\n#include \"opencv2/contrib/contrib.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/opencv_modules.hpp",
    "content": "/*\n *      ** File generated automatically, do not modify **\n *\n * This file defines the list of modules available in current build configuration\n *\n *\n*/\n\n#define HAVE_OPENCV_CALIB3D\n#define HAVE_OPENCV_CONTRIB\n#define HAVE_OPENCV_CORE\n#define HAVE_OPENCV_FEATURES2D\n#define HAVE_OPENCV_FLANN\n#define HAVE_OPENCV_GPU\n#define HAVE_OPENCV_HIGHGUI\n#define HAVE_OPENCV_IMGPROC\n#define HAVE_OPENCV_LEGACY\n#define HAVE_OPENCV_ML\n#define HAVE_OPENCV_NONFREE\n#define HAVE_OPENCV_OBJDETECT\n#define HAVE_OPENCV_OCL\n#define HAVE_OPENCV_PHOTO\n#define HAVE_OPENCV_STITCHING\n#define HAVE_OPENCV_SUPERRES\n#define HAVE_OPENCV_TS\n#define HAVE_OPENCV_VIDEO\n#define HAVE_OPENCV_VIDEOSTAB\n\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/photo/photo.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_PHOTO_HPP__\n#define __OPENCV_PHOTO_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n\n#include \"opencv2/photo/photo_c.h\"\n\n#ifdef __cplusplus\n\n/*! \\namespace cv\n Namespace where all the C++ OpenCV functionality resides\n */\nnamespace cv\n{\n\n//! the inpainting algorithm\nenum\n{\n    INPAINT_NS=CV_INPAINT_NS, // Navier-Stokes algorithm\n    INPAINT_TELEA=CV_INPAINT_TELEA // A. Telea algorithm\n};\n\n//! restores the damaged image areas using one of the available intpainting algorithms\nCV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask,\n                           OutputArray dst, double inpaintRadius, int flags );\n\n\nCV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float h = 3,\n                                        int templateWindowSize = 7, int searchWindowSize = 21);\n\nCV_EXPORTS_W void fastNlMeansDenoisingColored( InputArray src, OutputArray dst,\n                                               float h = 3, float hColor = 3,\n                                               int templateWindowSize = 7, int searchWindowSize = 21);\n\nCV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst,\n                                             int imgToDenoiseIndex, int temporalWindowSize,\n                                             float h = 3, int templateWindowSize = 7, int searchWindowSize = 21);\n\nCV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst,\n                                                    int imgToDenoiseIndex, int temporalWindowSize,\n                                                    float h = 3, float hColor = 3,\n                                                    int templateWindowSize = 7, int searchWindowSize = 21);\n\n}\n\n#endif //__cplusplus\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/photo/photo_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_PHOTO_C_H__\n#define __OPENCV_PHOTO_C_H__\n\n#include \"opencv2/core/core_c.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* Inpainting algorithms */\nenum\n{\n    CV_INPAINT_NS      =0,\n    CV_INPAINT_TELEA   =1\n};\n\n\n/* Inpaints the selected region in the image */\nCVAPI(void) cvInpaint( const CvArr* src, const CvArr* inpaint_mask,\n                       CvArr* dst, double inpaintRange, int flags );\n\n\n#ifdef __cplusplus\n} //extern \"C\"\n#endif\n\n#endif //__OPENCV_PHOTO_C_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/autocalib.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_AUTOCALIB_HPP__\n#define __OPENCV_STITCHING_AUTOCALIB_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"matchers.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n// See \"Construction of Panoramic Image Mosaics with Global and Local Alignment\"\n// by Heung-Yeung Shum and Richard Szeliski.\nvoid CV_EXPORTS focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok);\n\nvoid CV_EXPORTS estimateFocal(const std::vector<ImageFeatures> &features,\n                              const std::vector<MatchesInfo> &pairwise_matches,\n                              std::vector<double> &focals);\n\nbool CV_EXPORTS calibrateRotatingCamera(const std::vector<Mat> &Hs, Mat &K);\n\n} // namespace detail\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_AUTOCALIB_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/blenders.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_BLENDERS_HPP__\n#define __OPENCV_STITCHING_BLENDERS_HPP__\n\n#include \"opencv2/core/core.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n\n// Simple blender which puts one image over another\nclass CV_EXPORTS Blender\n{\npublic:\n    virtual ~Blender() {}\n\n    enum { NO, FEATHER, MULTI_BAND };\n    static Ptr<Blender> createDefault(int type, bool try_gpu = false);\n\n    void prepare(const std::vector<Point> &corners, const std::vector<Size> &sizes);\n    virtual void prepare(Rect dst_roi);\n    virtual void feed(const Mat &img, const Mat &mask, Point tl);\n    virtual void blend(Mat &dst, Mat &dst_mask);\n\nprotected:\n    Mat dst_, dst_mask_;\n    Rect dst_roi_;\n};\n\n\nclass CV_EXPORTS FeatherBlender : public Blender\n{\npublic:\n    FeatherBlender(float sharpness = 0.02f);\n\n    float sharpness() const { return sharpness_; }\n    void setSharpness(float val) { sharpness_ = val; }\n\n    void prepare(Rect dst_roi);\n    void feed(const Mat &img, const Mat &mask, Point tl);\n    void blend(Mat &dst, Mat &dst_mask);\n\n    // Creates weight maps for fixed set of source images by their masks and top-left corners.\n    // Final image can be obtained by simple weighting of the source images.\n    Rect createWeightMaps(const std::vector<Mat> &masks, const std::vector<Point> &corners,\n                          std::vector<Mat> &weight_maps);\n\nprivate:\n    float sharpness_;\n    Mat weight_map_;\n    Mat dst_weight_map_;\n};\n\ninline FeatherBlender::FeatherBlender(float _sharpness) { setSharpness(_sharpness); }\n\n\nclass CV_EXPORTS MultiBandBlender : public Blender\n{\npublic:\n    MultiBandBlender(int try_gpu = false, int num_bands = 5, int weight_type = CV_32F);\n\n    int numBands() const { return actual_num_bands_; }\n    void setNumBands(int val) { actual_num_bands_ = val; }\n\n    void prepare(Rect dst_roi);\n    void feed(const Mat &img, const Mat &mask, Point tl);\n    void blend(Mat &dst, Mat &dst_mask);\n\nprivate:\n    int actual_num_bands_, num_bands_;\n    std::vector<Mat> dst_pyr_laplace_;\n    std::vector<Mat> dst_band_weights_;\n    Rect dst_roi_final_;\n    bool can_use_gpu_;\n    int weight_type_; //CV_32F or CV_16S\n};\n\n\n//////////////////////////////////////////////////////////////////////////////\n// Auxiliary functions\n\nvoid CV_EXPORTS normalizeUsingWeightMap(const Mat& weight, Mat& src);\n\nvoid CV_EXPORTS createWeightMap(const Mat& mask, float sharpness, Mat& weight);\n\nvoid CV_EXPORTS createLaplacePyr(const Mat &img, int num_levels, std::vector<Mat>& pyr);\nvoid CV_EXPORTS createLaplacePyrGpu(const Mat &img, int num_levels, std::vector<Mat>& pyr);\n\n// Restores source image\nvoid CV_EXPORTS restoreImageFromLaplacePyr(std::vector<Mat>& pyr);\nvoid CV_EXPORTS restoreImageFromLaplacePyrGpu(std::vector<Mat>& pyr);\n\n} // namespace detail\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_BLENDERS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/camera.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_CAMERA_HPP__\n#define __OPENCV_STITCHING_CAMERA_HPP__\n\n#include \"opencv2/core/core.hpp\"\n\nnamespace cv {\nnamespace detail {\n\nstruct CV_EXPORTS CameraParams\n{\n    CameraParams();\n    CameraParams(const CameraParams& other);\n    const CameraParams& operator =(const CameraParams& other);\n    Mat K() const;\n\n    double focal; // Focal length\n    double aspect; // Aspect ratio\n    double ppx; // Principal point X\n    double ppy; // Principal point Y\n    Mat R; // Rotation\n    Mat t; // Translation\n};\n\n} // namespace detail\n} // namespace cv\n\n#endif // #ifndef __OPENCV_STITCHING_CAMERA_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/exposure_compensate.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__\n#define __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__\n\n#include \"opencv2/core/core.hpp\"\n\nnamespace cv {\nnamespace detail {\n\nclass CV_EXPORTS ExposureCompensator\n{\npublic:\n    virtual ~ExposureCompensator() {}\n\n    enum { NO, GAIN, GAIN_BLOCKS };\n    static Ptr<ExposureCompensator> createDefault(int type);\n\n    void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,\n              const std::vector<Mat> &masks);\n    virtual void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,\n                      const std::vector<std::pair<Mat,uchar> > &masks) = 0;\n    virtual void apply(int index, Point corner, Mat &image, const Mat &mask) = 0;\n};\n\n\nclass CV_EXPORTS NoExposureCompensator : public ExposureCompensator\n{\npublic:\n    void feed(const std::vector<Point> &/*corners*/, const std::vector<Mat> &/*images*/,\n              const std::vector<std::pair<Mat,uchar> > &/*masks*/) {};\n    void apply(int /*index*/, Point /*corner*/, Mat &/*image*/, const Mat &/*mask*/) {};\n};\n\n\nclass CV_EXPORTS GainCompensator : public ExposureCompensator\n{\npublic:\n    void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,\n              const std::vector<std::pair<Mat,uchar> > &masks);\n    void apply(int index, Point corner, Mat &image, const Mat &mask);\n    std::vector<double> gains() const;\n\nprivate:\n    Mat_<double> gains_;\n};\n\n\nclass CV_EXPORTS BlocksGainCompensator : public ExposureCompensator\n{\npublic:\n    BlocksGainCompensator(int bl_width = 32, int bl_height = 32)\n            : bl_width_(bl_width), bl_height_(bl_height) {}\n    void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,\n              const std::vector<std::pair<Mat,uchar> > &masks);\n    void apply(int index, Point corner, Mat &image, const Mat &mask);\n\nprivate:\n    int bl_width_, bl_height_;\n    std::vector<Mat_<float> > gain_maps_;\n};\n\n} // namespace detail\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/matchers.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_MATCHERS_HPP__\n#define __OPENCV_STITCHING_MATCHERS_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/core/gpumat.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n\n#include \"opencv2/opencv_modules.hpp\"\n\n#if defined(HAVE_OPENCV_NONFREE)\n    #include \"opencv2/nonfree/gpu.hpp\"\n#endif\n\nnamespace cv {\nnamespace detail {\n\nstruct CV_EXPORTS ImageFeatures\n{\n    int img_idx;\n    Size img_size;\n    std::vector<KeyPoint> keypoints;\n    Mat descriptors;\n};\n\n\nclass CV_EXPORTS FeaturesFinder\n{\npublic:\n    virtual ~FeaturesFinder() {}\n    void operator ()(const Mat &image, ImageFeatures &features);\n    void operator ()(const Mat &image, ImageFeatures &features, const std::vector<cv::Rect> &rois);\n    virtual void collectGarbage() {}\n\nprotected:\n    virtual void find(const Mat &image, ImageFeatures &features) = 0;\n};\n\n\nclass CV_EXPORTS SurfFeaturesFinder : public FeaturesFinder\n{\npublic:\n    SurfFeaturesFinder(double hess_thresh = 300., int num_octaves = 3, int num_layers = 4,\n                       int num_octaves_descr = /*4*/3, int num_layers_descr = /*2*/4);\n\nprivate:\n    void find(const Mat &image, ImageFeatures &features);\n\n    Ptr<FeatureDetector> detector_;\n    Ptr<DescriptorExtractor> extractor_;\n    Ptr<Feature2D> surf;\n};\n\nclass CV_EXPORTS OrbFeaturesFinder : public FeaturesFinder\n{\npublic:\n    OrbFeaturesFinder(Size _grid_size = Size(3,1), int nfeatures=1500, float scaleFactor=1.3f, int nlevels=5);\n\nprivate:\n    void find(const Mat &image, ImageFeatures &features);\n\n    Ptr<ORB> orb;\n    Size grid_size;\n};\n\n\n#if defined(HAVE_OPENCV_NONFREE)\nclass CV_EXPORTS SurfFeaturesFinderGpu : public FeaturesFinder\n{\npublic:\n    SurfFeaturesFinderGpu(double hess_thresh = 300., int num_octaves = 3, int num_layers = 4,\n                          int num_octaves_descr = 4, int num_layers_descr = 2);\n\n    void collectGarbage();\n\nprivate:\n    void find(const Mat &image, ImageFeatures &features);\n\n    gpu::GpuMat image_;\n    gpu::GpuMat gray_image_;\n    gpu::SURF_GPU surf_;\n    gpu::GpuMat keypoints_;\n    gpu::GpuMat descriptors_;\n#if defined(HAVE_OPENCV_GPU) && !defined(DYNAMIC_CUDA_SUPPORT)\n    int num_octaves_, num_layers_;\n    int num_octaves_descr_, num_layers_descr_;\n#endif\n};\n#endif\n\n\nstruct CV_EXPORTS MatchesInfo\n{\n    MatchesInfo();\n    MatchesInfo(const MatchesInfo &other);\n    const MatchesInfo& operator =(const MatchesInfo &other);\n\n    int src_img_idx, dst_img_idx;       // Images indices (optional)\n    std::vector<DMatch> matches;\n    std::vector<uchar> inliers_mask;    // Geometrically consistent matches mask\n    int num_inliers;                    // Number of geometrically consistent matches\n    Mat H;                              // Estimated homography\n    double confidence;                  // Confidence two images are from the same panorama\n};\n\n\nclass CV_EXPORTS FeaturesMatcher\n{\npublic:\n    virtual ~FeaturesMatcher() {}\n\n    void operator ()(const ImageFeatures &features1, const ImageFeatures &features2,\n                     MatchesInfo& matches_info) { match(features1, features2, matches_info); }\n\n    void operator ()(const std::vector<ImageFeatures> &features, std::vector<MatchesInfo> &pairwise_matches,\n                     const cv::Mat &mask = cv::Mat());\n\n    bool isThreadSafe() const { return is_thread_safe_; }\n\n    virtual void collectGarbage() {}\n\nprotected:\n    FeaturesMatcher(bool is_thread_safe = false) : is_thread_safe_(is_thread_safe) {}\n\n    virtual void match(const ImageFeatures &features1, const ImageFeatures &features2,\n                       MatchesInfo& matches_info) = 0;\n\n    bool is_thread_safe_;\n};\n\n\nclass CV_EXPORTS BestOf2NearestMatcher : public FeaturesMatcher\n{\npublic:\n    BestOf2NearestMatcher(bool try_use_gpu = false, float match_conf = 0.3f, int num_matches_thresh1 = 6,\n                          int num_matches_thresh2 = 6);\n\n    void collectGarbage();\n\nprotected:\n    void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info);\n\n    int num_matches_thresh1_;\n    int num_matches_thresh2_;\n    Ptr<FeaturesMatcher> impl_;\n};\n\n} // namespace detail\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_MATCHERS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/motion_estimators.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_MOTION_ESTIMATORS_HPP__\n#define __OPENCV_STITCHING_MOTION_ESTIMATORS_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"matchers.hpp\"\n#include \"util.hpp\"\n#include \"camera.hpp\"\n\nnamespace cv {\nnamespace detail {\n\nclass CV_EXPORTS Estimator\n{\npublic:\n    virtual ~Estimator() {}\n\n    void operator ()(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,\n                     std::vector<CameraParams> &cameras)\n        { estimate(features, pairwise_matches, cameras); }\n\nprotected:\n    virtual void estimate(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,\n                          std::vector<CameraParams> &cameras) = 0;\n};\n\n\nclass CV_EXPORTS HomographyBasedEstimator : public Estimator\n{\npublic:\n    HomographyBasedEstimator(bool is_focals_estimated = false)\n        : is_focals_estimated_(is_focals_estimated) {}\n\nprivate:\n    void estimate(const std::vector<ImageFeatures> &features, const std::vector<MatchesInfo> &pairwise_matches,\n                  std::vector<CameraParams> &cameras);\n\n    bool is_focals_estimated_;\n};\n\n\nclass CV_EXPORTS BundleAdjusterBase : public Estimator\n{\npublic:\n    const Mat refinementMask() const { return refinement_mask_.clone(); }\n    void setRefinementMask(const Mat &mask)\n    {\n        CV_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3));\n        refinement_mask_ = mask.clone();\n    }\n\n    double confThresh() const { return conf_thresh_; }\n    void setConfThresh(double conf_thresh) { conf_thresh_ = conf_thresh; }\n\n    CvTermCriteria termCriteria() { return term_criteria_; }\n    void setTermCriteria(const CvTermCriteria& term_criteria) { term_criteria_ = term_criteria; }\n\nprotected:\n    BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement)\n        : num_params_per_cam_(num_params_per_cam),\n          num_errs_per_measurement_(num_errs_per_measurement)\n    {\n        setRefinementMask(Mat::ones(3, 3, CV_8U));\n        setConfThresh(1.);\n        setTermCriteria(cvTermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 1000, DBL_EPSILON));\n    }\n\n    // Runs bundle adjustment\n    virtual void estimate(const std::vector<ImageFeatures> &features,\n                          const std::vector<MatchesInfo> &pairwise_matches,\n                          std::vector<CameraParams> &cameras);\n\n    virtual void setUpInitialCameraParams(const std::vector<CameraParams> &cameras) = 0;\n    virtual void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const = 0;\n    virtual void calcError(Mat &err) = 0;\n    virtual void calcJacobian(Mat &jac) = 0;\n\n    // 3x3 8U mask, where 0 means don't refine respective parameter, != 0 means refine\n    Mat refinement_mask_;\n\n    int num_images_;\n    int total_num_matches_;\n\n    int num_params_per_cam_;\n    int num_errs_per_measurement_;\n\n    const ImageFeatures *features_;\n    const MatchesInfo *pairwise_matches_;\n\n    // Threshold to filter out poorly matched image pairs\n    double conf_thresh_;\n\n    //Levenberg–Marquardt algorithm termination criteria\n    CvTermCriteria term_criteria_;\n\n    // Camera parameters matrix (CV_64F)\n    Mat cam_params_;\n\n    // Connected images pairs\n    std::vector<std::pair<int,int> > edges_;\n};\n\n\n// Minimizes reprojection error.\n// It can estimate focal length, aspect ratio, principal point.\n// You can affect only on them via the refinement mask.\nclass CV_EXPORTS BundleAdjusterReproj : public BundleAdjusterBase\n{\npublic:\n    BundleAdjusterReproj() : BundleAdjusterBase(7, 2) {}\n\nprivate:\n    void setUpInitialCameraParams(const std::vector<CameraParams> &cameras);\n    void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const;\n    void calcError(Mat &err);\n    void calcJacobian(Mat &jac);\n\n    Mat err1_, err2_;\n};\n\n\n// Minimizes sun of ray-to-ray distances.\n// It can estimate focal length. It ignores the refinement mask for now.\nclass CV_EXPORTS BundleAdjusterRay : public BundleAdjusterBase\n{\npublic:\n    BundleAdjusterRay() : BundleAdjusterBase(4, 3) {}\n\nprivate:\n    void setUpInitialCameraParams(const std::vector<CameraParams> &cameras);\n    void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const;\n    void calcError(Mat &err);\n    void calcJacobian(Mat &jac);\n\n    Mat err1_, err2_;\n};\n\n\nenum WaveCorrectKind\n{\n    WAVE_CORRECT_HORIZ,\n    WAVE_CORRECT_VERT\n};\n\nvoid CV_EXPORTS waveCorrect(std::vector<Mat> &rmats, WaveCorrectKind kind);\n\n\n//////////////////////////////////////////////////////////////////////////////\n// Auxiliary functions\n\n// Returns matches graph representation in DOT language\nstd::string CV_EXPORTS matchesGraphAsString(std::vector<std::string> &pathes, std::vector<MatchesInfo> &pairwise_matches,\n                                            float conf_threshold);\n\nstd::vector<int> CV_EXPORTS leaveBiggestComponent(std::vector<ImageFeatures> &features, std::vector<MatchesInfo> &pairwise_matches,\n                                                  float conf_threshold);\n\nvoid CV_EXPORTS findMaxSpanningTree(int num_images, const std::vector<MatchesInfo> &pairwise_matches,\n                                    Graph &span_tree, std::vector<int> &centers);\n\n} // namespace detail\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_MOTION_ESTIMATORS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/seam_finders.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_SEAM_FINDERS_HPP__\n#define __OPENCV_STITCHING_SEAM_FINDERS_HPP__\n\n#include <set>\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/core/gpumat.hpp\"\n\nnamespace cv {\nnamespace detail {\n\nclass CV_EXPORTS SeamFinder\n{\npublic:\n    virtual ~SeamFinder() {}\n    virtual void find(const std::vector<Mat> &src, const std::vector<Point> &corners,\n                      std::vector<Mat> &masks) = 0;\n};\n\n\nclass CV_EXPORTS NoSeamFinder : public SeamFinder\n{\npublic:\n    void find(const std::vector<Mat>&, const std::vector<Point>&, std::vector<Mat>&) {}\n};\n\n\nclass CV_EXPORTS PairwiseSeamFinder : public SeamFinder\n{\npublic:\n    virtual void find(const std::vector<Mat> &src, const std::vector<Point> &corners,\n                      std::vector<Mat> &masks);\n\nprotected:\n    void run();\n    virtual void findInPair(size_t first, size_t second, Rect roi) = 0;\n\n    std::vector<Mat> images_;\n    std::vector<Size> sizes_;\n    std::vector<Point> corners_;\n    std::vector<Mat> masks_;\n};\n\n\nclass CV_EXPORTS VoronoiSeamFinder : public PairwiseSeamFinder\n{\npublic:\n    virtual void find(const std::vector<Size> &size, const std::vector<Point> &corners,\n                      std::vector<Mat> &masks);\nprivate:\n    void findInPair(size_t first, size_t second, Rect roi);\n};\n\n\nclass CV_EXPORTS DpSeamFinder : public SeamFinder\n{\npublic:\n    enum CostFunction { COLOR, COLOR_GRAD };\n\n    DpSeamFinder(CostFunction costFunc = COLOR);\n\n    CostFunction costFunction() const { return costFunc_; }\n    void setCostFunction(CostFunction val) { costFunc_ = val; }\n\n    virtual void find(const std::vector<Mat> &src, const std::vector<Point> &corners,\n                      std::vector<Mat> &masks);\n\nprivate:\n    enum ComponentState\n    {\n        FIRST = 1, SECOND = 2, INTERS = 4,\n        INTERS_FIRST = INTERS | FIRST,\n        INTERS_SECOND = INTERS | SECOND\n    };\n\n    class ImagePairLess\n    {\n    public:\n        ImagePairLess(const std::vector<Mat> &images, const std::vector<Point> &corners)\n            : src_(&images[0]), corners_(&corners[0]) {}\n\n        bool operator() (const std::pair<size_t, size_t> &l, const std::pair<size_t, size_t> &r) const\n        {\n            Point c1 = corners_[l.first] + Point(src_[l.first].cols / 2, src_[l.first].rows / 2);\n            Point c2 = corners_[l.second] + Point(src_[l.second].cols / 2, src_[l.second].rows / 2);\n            int d1 = (c1 - c2).dot(c1 - c2);\n\n            c1 = corners_[r.first] + Point(src_[r.first].cols / 2, src_[r.first].rows / 2);\n            c2 = corners_[r.second] + Point(src_[r.second].cols / 2, src_[r.second].rows / 2);\n            int d2 = (c1 - c2).dot(c1 - c2);\n\n            return d1 < d2;\n        }\n\n    private:\n        const Mat *src_;\n        const Point *corners_;\n    };\n\n    class ClosePoints\n    {\n    public:\n        ClosePoints(int minDist) : minDist_(minDist) {}\n\n        bool operator() (const Point &p1, const Point &p2) const\n        {\n            int dist2 = (p1.x-p2.x) * (p1.x-p2.x) + (p1.y-p2.y) * (p1.y-p2.y);\n            return dist2 < minDist_ * minDist_;\n        }\n\n    private:\n        int minDist_;\n    };\n\n    void process(\n            const Mat &image1, const Mat &image2, Point tl1, Point tl2, Mat &mask1, Mat &mask2);\n\n    void findComponents();\n\n    void findEdges();\n\n    void resolveConflicts(\n            const Mat &image1, const Mat &image2, Point tl1, Point tl2, Mat &mask1, Mat &mask2);\n\n    void computeGradients(const Mat &image1, const Mat &image2);\n\n    bool hasOnlyOneNeighbor(int comp);\n\n    bool closeToContour(int y, int x, const Mat_<uchar> &contourMask);\n\n    bool getSeamTips(int comp1, int comp2, Point &p1, Point &p2);\n\n    void computeCosts(\n            const Mat &image1, const Mat &image2, Point tl1, Point tl2,\n            int comp, Mat_<float> &costV, Mat_<float> &costH);\n\n    bool estimateSeam(\n            const Mat &image1, const Mat &image2, Point tl1, Point tl2, int comp,\n            Point p1, Point p2, std::vector<Point> &seam, bool &isHorizontal);\n\n    void updateLabelsUsingSeam(\n            int comp1, int comp2, const std::vector<Point> &seam, bool isHorizontalSeam);\n\n    CostFunction costFunc_;\n\n    // processing images pair data\n    Point unionTl_, unionBr_;\n    Size unionSize_;\n    Mat_<uchar> mask1_, mask2_;\n    Mat_<uchar> contour1mask_, contour2mask_;\n    Mat_<float> gradx1_, grady1_;\n    Mat_<float> gradx2_, grady2_;\n\n    // components data\n    int ncomps_;\n    Mat_<int> labels_;\n    std::vector<ComponentState> states_;\n    std::vector<Point> tls_, brs_;\n    std::vector<std::vector<Point> > contours_;\n    std::set<std::pair<int, int> > edges_;\n};\n\n\nclass CV_EXPORTS GraphCutSeamFinderBase\n{\npublic:\n    enum { COST_COLOR, COST_COLOR_GRAD };\n};\n\n\nclass CV_EXPORTS GraphCutSeamFinder : public GraphCutSeamFinderBase, public SeamFinder\n{\npublic:\n    GraphCutSeamFinder(int cost_type = COST_COLOR_GRAD, float terminal_cost = 10000.f,\n                       float bad_region_penalty = 1000.f);\n\n    ~GraphCutSeamFinder();\n\n    void find(const std::vector<Mat> &src, const std::vector<Point> &corners,\n              std::vector<Mat> &masks);\n\nprivate:\n    // To avoid GCGraph dependency\n    class Impl;\n    Ptr<PairwiseSeamFinder> impl_;\n};\n\n\nclass CV_EXPORTS GraphCutSeamFinderGpu : public GraphCutSeamFinderBase, public PairwiseSeamFinder\n{\npublic:\n    GraphCutSeamFinderGpu(int cost_type = COST_COLOR_GRAD, float terminal_cost = 10000.f,\n                          float bad_region_penalty = 1000.f)\n#if defined(HAVE_OPENCV_GPU) && !defined(DYNAMIC_CUDA_SUPPORT)\n                          : cost_type_(cost_type),\n                            terminal_cost_(terminal_cost),\n                            bad_region_penalty_(bad_region_penalty)\n#endif\n    {\n        (void)cost_type;\n        (void)terminal_cost;\n        (void)bad_region_penalty;\n    }\n\n    void find(const std::vector<cv::Mat> &src, const std::vector<cv::Point> &corners,\n              std::vector<cv::Mat> &masks);\n    void findInPair(size_t first, size_t second, Rect roi);\n\nprivate:\n    void setGraphWeightsColor(const cv::Mat &img1, const cv::Mat &img2, const cv::Mat &mask1, const cv::Mat &mask2,\n                              cv::Mat &terminals, cv::Mat &leftT, cv::Mat &rightT, cv::Mat &top, cv::Mat &bottom);\n    void setGraphWeightsColorGrad(const cv::Mat &img1, const cv::Mat &img2, const cv::Mat &dx1, const cv::Mat &dx2,\n                                  const cv::Mat &dy1, const cv::Mat &dy2, const cv::Mat &mask1, const cv::Mat &mask2,\n                                  cv::Mat &terminals, cv::Mat &leftT, cv::Mat &rightT, cv::Mat &top, cv::Mat &bottom);\n    std::vector<Mat> dx_, dy_;\n#if defined(HAVE_OPENCV_GPU) && !defined(DYNAMIC_CUDA_SUPPORT)\n    int cost_type_;\n    float terminal_cost_;\n    float bad_region_penalty_;\n#endif\n};\n\n} // namespace detail\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_SEAM_FINDERS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/util.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_UTIL_HPP__\n#define __OPENCV_STITCHING_UTIL_HPP__\n\n#include <list>\n#include \"opencv2/core/core.hpp\"\n\n#define ENABLE_LOG 0\n\n// TODO remove LOG macros, add logging class\n#if ENABLE_LOG\n#ifdef ANDROID\n  #include <iostream>\n  #include <sstream>\n  #include <android/log.h>\n  #define LOG_STITCHING_MSG(msg) \\\n    do { \\\n        std::stringstream _os; \\\n        _os << msg; \\\n       __android_log_print(ANDROID_LOG_DEBUG, \"STITCHING\", \"%s\", _os.str().c_str()); \\\n    } while(0);\n#else\n  #include <iostream>\n  #define LOG_STITCHING_MSG(msg) for(;;) { std::cout << msg; std::cout.flush(); break; }\n#endif\n#else\n  #define LOG_STITCHING_MSG(msg)\n#endif\n\n#define LOG_(_level, _msg)                     \\\n    for(;;)                                    \\\n    {                                          \\\n        if ((_level) >= ::cv::detail::stitchingLogLevel()) \\\n        {                                      \\\n            LOG_STITCHING_MSG(_msg);           \\\n        }                                      \\\n    break;                                 \\\n    }\n\n\n#define LOG(msg) LOG_(1, msg)\n#define LOG_CHAT(msg) LOG_(0, msg)\n\n#define LOGLN(msg) LOG(msg << std::endl)\n#define LOGLN_CHAT(msg) LOG_CHAT(msg << std::endl)\n\n//#if DEBUG_LOG_CHAT\n//  #define LOG_CHAT(msg) LOG(msg)\n//  #define LOGLN_CHAT(msg) LOGLN(msg)\n//#else\n//  #define LOG_CHAT(msg) do{}while(0)\n//  #define LOGLN_CHAT(msg) do{}while(0)\n//#endif\n\nnamespace cv {\nnamespace detail {\n\nclass CV_EXPORTS DisjointSets\n{\npublic:\n    DisjointSets(int elem_count = 0) { createOneElemSets(elem_count); }\n\n    void createOneElemSets(int elem_count);\n    int findSetByElem(int elem);\n    int mergeSets(int set1, int set2);\n\n    std::vector<int> parent;\n    std::vector<int> size;\n\nprivate:\n    std::vector<int> rank_;\n};\n\n\nstruct CV_EXPORTS GraphEdge\n{\n    GraphEdge(int from, int to, float weight);\n    bool operator <(const GraphEdge& other) const { return weight < other.weight; }\n    bool operator >(const GraphEdge& other) const { return weight > other.weight; }\n\n    int from, to;\n    float weight;\n};\n\ninline GraphEdge::GraphEdge(int _from, int _to, float _weight) : from(_from), to(_to), weight(_weight) {}\n\n\nclass CV_EXPORTS Graph\n{\npublic:\n    Graph(int num_vertices = 0) { create(num_vertices); }\n    void create(int num_vertices) { edges_.assign(num_vertices, std::list<GraphEdge>()); }\n    int numVertices() const { return static_cast<int>(edges_.size()); }\n    void addEdge(int from, int to, float weight);\n    template <typename B> B forEach(B body) const;\n    template <typename B> B walkBreadthFirst(int from, B body) const;\n\nprivate:\n    std::vector< std::list<GraphEdge> > edges_;\n};\n\n\n//////////////////////////////////////////////////////////////////////////////\n// Auxiliary functions\n\nCV_EXPORTS bool overlapRoi(Point tl1, Point tl2, Size sz1, Size sz2, Rect &roi);\nCV_EXPORTS Rect resultRoi(const std::vector<Point> &corners, const std::vector<Mat> &images);\nCV_EXPORTS Rect resultRoi(const std::vector<Point> &corners, const std::vector<Size> &sizes);\nCV_EXPORTS Point resultTl(const std::vector<Point> &corners);\n\n// Returns random 'count' element subset of the {0,1,...,size-1} set\nCV_EXPORTS void selectRandomSubset(int count, int size, std::vector<int> &subset);\n\nCV_EXPORTS int& stitchingLogLevel();\n\n} // namespace detail\n} // namespace cv\n\n#include \"util_inl.hpp\"\n\n#endif // __OPENCV_STITCHING_UTIL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/util_inl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_UTIL_INL_HPP__\n#define __OPENCV_STITCHING_UTIL_INL_HPP__\n\n#include <queue>\n#include \"opencv2/core/core.hpp\"\n#include \"util.hpp\" // Make your IDE see declarations\n\nnamespace cv {\nnamespace detail {\n\ntemplate <typename B>\nB Graph::forEach(B body) const\n{\n    for (int i = 0; i < numVertices(); ++i)\n    {\n        std::list<GraphEdge>::const_iterator edge = edges_[i].begin();\n        for (; edge != edges_[i].end(); ++edge)\n            body(*edge);\n    }\n    return body;\n}\n\n\ntemplate <typename B>\nB Graph::walkBreadthFirst(int from, B body) const\n{\n    std::vector<bool> was(numVertices(), false);\n    std::queue<int> vertices;\n\n    was[from] = true;\n    vertices.push(from);\n\n    while (!vertices.empty())\n    {\n        int vertex = vertices.front();\n        vertices.pop();\n\n        std::list<GraphEdge>::const_iterator edge = edges_[vertex].begin();\n        for (; edge != edges_[vertex].end(); ++edge)\n        {\n            if (!was[edge->to])\n            {\n                body(*edge);\n                was[edge->to] = true;\n                vertices.push(edge->to);\n            }\n        }\n    }\n\n    return body;\n}\n\n\n//////////////////////////////////////////////////////////////////////////////\n// Some auxiliary math functions\n\nstatic inline\nfloat normL2(const Point3f& a)\n{\n    return a.x * a.x + a.y * a.y + a.z * a.z;\n}\n\n\nstatic inline\nfloat normL2(const Point3f& a, const Point3f& b)\n{\n    return normL2(a - b);\n}\n\n\nstatic inline\ndouble normL2sq(const Mat &r)\n{\n    return r.dot(r);\n}\n\n\nstatic inline int sqr(int x) { return x * x; }\nstatic inline float sqr(float x) { return x * x; }\nstatic inline double sqr(double x) { return x * x; }\n\n} // namespace detail\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_UTIL_INL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/warpers.hpp",
    "content": " /*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_WARPERS_HPP__\n#define __OPENCV_STITCHING_WARPERS_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/core/gpumat.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n\nnamespace cv {\nnamespace detail {\n\nclass CV_EXPORTS RotationWarper\n{\npublic:\n    virtual ~RotationWarper() {}\n\n    virtual Point2f warpPoint(const Point2f &pt, const Mat &K, const Mat &R) = 0;\n\n    virtual Rect buildMaps(Size src_size, const Mat &K, const Mat &R, Mat &xmap, Mat &ymap) = 0;\n\n    virtual Point warp(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n                       Mat &dst) = 0;\n\n    virtual void warpBackward(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n                              Size dst_size, Mat &dst) = 0;\n\n    virtual Rect warpRoi(Size src_size, const Mat &K, const Mat &R) = 0;\n\n    float getScale() const { return 1.f; }\n    void setScale(float) {}\n};\n\n\nstruct CV_EXPORTS ProjectorBase\n{\n    void setCameraParams(const Mat &K = Mat::eye(3, 3, CV_32F),\n                         const Mat &R = Mat::eye(3, 3, CV_32F),\n                         const Mat &T = Mat::zeros(3, 1, CV_32F));\n\n    float scale;\n    float k[9];\n    float rinv[9];\n    float r_kinv[9];\n    float k_rinv[9];\n    float t[3];\n};\n\n\ntemplate <class P>\nclass CV_EXPORTS RotationWarperBase : public RotationWarper\n{\npublic:\n    Point2f warpPoint(const Point2f &pt, const Mat &K, const Mat &R);\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, Mat &xmap, Mat &ymap);\n\n    Point warp(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n               Mat &dst);\n\n    void warpBackward(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n                      Size dst_size, Mat &dst);\n\n    Rect warpRoi(Size src_size, const Mat &K, const Mat &R);\n\n    float getScale() const { return projector_.scale; }\n    void setScale(float val) { projector_.scale = val; }\n\nprotected:\n\n    // Detects ROI of the destination image. It's correct for any projection.\n    virtual void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br);\n\n    // Detects ROI of the destination image by walking over image border.\n    // Correctness for any projection isn't guaranteed.\n    void detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br);\n\n    P projector_;\n};\n\n\nstruct CV_EXPORTS PlaneProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS PlaneWarper : public RotationWarperBase<PlaneProjector>\n{\npublic:\n    PlaneWarper(float scale = 1.f) { projector_.scale = scale; }\n\n    void setScale(float scale) { projector_.scale = scale; }\n\n    Point2f warpPoint(const Point2f &pt, const Mat &K, const Mat &R, const Mat &T);\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, const Mat &T, Mat &xmap, Mat &ymap);\n\n    Point warp(const Mat &src, const Mat &K, const Mat &R, const Mat &T, int interp_mode, int border_mode,\n               Mat &dst);\n\n    Rect warpRoi(Size src_size, const Mat &K, const Mat &R, const Mat &T);\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br);\n};\n\n\nstruct CV_EXPORTS SphericalProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\n// Projects image onto unit sphere with origin at (0, 0, 0).\n// Poles are located at (0, -1, 0) and (0, 1, 0) points.\nclass CV_EXPORTS SphericalWarper : public RotationWarperBase<SphericalProjector>\n{\npublic:\n    SphericalWarper(float scale) { projector_.scale = scale; }\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br);\n};\n\n\nstruct CV_EXPORTS CylindricalProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\n// Projects image onto x * x + z * z = 1 cylinder\nclass CV_EXPORTS CylindricalWarper : public RotationWarperBase<CylindricalProjector>\n{\npublic:\n    CylindricalWarper(float scale) { projector_.scale = scale; }\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br)\n    {\n        RotationWarperBase<CylindricalProjector>::detectResultRoiByBorder(src_size, dst_tl, dst_br);\n    }\n};\n\n\nstruct CV_EXPORTS FisheyeProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS FisheyeWarper : public RotationWarperBase<FisheyeProjector>\n{\npublic:\n    FisheyeWarper(float scale) { projector_.scale = scale; }\n};\n\n\nstruct CV_EXPORTS StereographicProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS StereographicWarper : public RotationWarperBase<StereographicProjector>\n{\npublic:\n    StereographicWarper(float scale) { projector_.scale = scale; }\n};\n\n\nstruct CV_EXPORTS CompressedRectilinearProjector : ProjectorBase\n{\n    float a, b;\n\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS CompressedRectilinearWarper : public RotationWarperBase<CompressedRectilinearProjector>\n{\npublic:\n    CompressedRectilinearWarper(float scale, float A = 1, float B = 1)\n    {\n        projector_.a = A;\n        projector_.b = B;\n        projector_.scale = scale;\n    }\n};\n\n\nstruct CV_EXPORTS CompressedRectilinearPortraitProjector : ProjectorBase\n{\n    float a, b;\n\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS CompressedRectilinearPortraitWarper : public RotationWarperBase<CompressedRectilinearPortraitProjector>\n{\npublic:\n   CompressedRectilinearPortraitWarper(float scale, float A = 1, float B = 1)\n   {\n       projector_.a = A;\n       projector_.b = B;\n       projector_.scale = scale;\n   }\n};\n\n\nstruct CV_EXPORTS PaniniProjector : ProjectorBase\n{\n    float a, b;\n\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS PaniniWarper : public RotationWarperBase<PaniniProjector>\n{\npublic:\n   PaniniWarper(float scale, float A = 1, float B = 1)\n   {\n       projector_.a = A;\n       projector_.b = B;\n       projector_.scale = scale;\n   }\n};\n\n\nstruct CV_EXPORTS PaniniPortraitProjector : ProjectorBase\n{\n    float a, b;\n\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS PaniniPortraitWarper : public RotationWarperBase<PaniniPortraitProjector>\n{\npublic:\n   PaniniPortraitWarper(float scale, float A = 1, float B = 1)\n   {\n       projector_.a = A;\n       projector_.b = B;\n       projector_.scale = scale;\n   }\n\n};\n\n\nstruct CV_EXPORTS MercatorProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS MercatorWarper : public RotationWarperBase<MercatorProjector>\n{\npublic:\n    MercatorWarper(float scale) { projector_.scale = scale; }\n};\n\n\nstruct CV_EXPORTS TransverseMercatorProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS TransverseMercatorWarper : public RotationWarperBase<TransverseMercatorProjector>\n{\npublic:\n    TransverseMercatorWarper(float scale) { projector_.scale = scale; }\n};\n\n\nclass CV_EXPORTS PlaneWarperGpu : public PlaneWarper\n{\npublic:\n    PlaneWarperGpu(float scale = 1.f) : PlaneWarper(scale) {}\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, Mat &xmap, Mat &ymap)\n    {\n        Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_);\n        d_xmap_.download(xmap);\n        d_ymap_.download(ymap);\n        return result;\n    }\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, const Mat &T, Mat &xmap, Mat &ymap)\n    {\n        Rect result = buildMaps(src_size, K, R, T, d_xmap_, d_ymap_);\n        d_xmap_.download(xmap);\n        d_ymap_.download(ymap);\n        return result;\n    }\n\n    Point warp(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n               Mat &dst)\n    {\n        d_src_.upload(src);\n        Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_);\n        d_dst_.download(dst);\n        return result;\n    }\n\n    Point warp(const Mat &src, const Mat &K, const Mat &R, const Mat &T, int interp_mode, int border_mode,\n               Mat &dst)\n    {\n        d_src_.upload(src);\n        Point result = warp(d_src_, K, R, T, interp_mode, border_mode, d_dst_);\n        d_dst_.download(dst);\n        return result;\n    }\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, gpu::GpuMat &xmap, gpu::GpuMat &ymap);\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, const Mat &T, gpu::GpuMat &xmap, gpu::GpuMat &ymap);\n\n    Point warp(const gpu::GpuMat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n               gpu::GpuMat &dst);\n\n    Point warp(const gpu::GpuMat &src, const Mat &K, const Mat &R, const Mat &T, int interp_mode, int border_mode,\n               gpu::GpuMat &dst);\n\nprivate:\n    gpu::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_;\n};\n\n\nclass CV_EXPORTS SphericalWarperGpu : public SphericalWarper\n{\npublic:\n    SphericalWarperGpu(float scale) : SphericalWarper(scale) {}\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, Mat &xmap, Mat &ymap)\n    {\n        Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_);\n        d_xmap_.download(xmap);\n        d_ymap_.download(ymap);\n        return result;\n    }\n\n    Point warp(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n               Mat &dst)\n    {\n        d_src_.upload(src);\n        Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_);\n        d_dst_.download(dst);\n        return result;\n    }\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, gpu::GpuMat &xmap, gpu::GpuMat &ymap);\n\n    Point warp(const gpu::GpuMat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n               gpu::GpuMat &dst);\n\nprivate:\n    gpu::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_;\n};\n\n\nclass CV_EXPORTS CylindricalWarperGpu : public CylindricalWarper\n{\npublic:\n    CylindricalWarperGpu(float scale) : CylindricalWarper(scale) {}\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, Mat &xmap, Mat &ymap)\n    {\n        Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_);\n        d_xmap_.download(xmap);\n        d_ymap_.download(ymap);\n        return result;\n    }\n\n    Point warp(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n               Mat &dst)\n    {\n        d_src_.upload(src);\n        Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_);\n        d_dst_.download(dst);\n        return result;\n    }\n\n    Rect buildMaps(Size src_size, const Mat &K, const Mat &R, gpu::GpuMat &xmap, gpu::GpuMat &ymap);\n\n    Point warp(const gpu::GpuMat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n               gpu::GpuMat &dst);\n\nprivate:\n    gpu::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_;\n};\n\n\nstruct SphericalPortraitProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\n// Projects image onto unit sphere with origin at (0, 0, 0).\n// Poles are located NOT at (0, -1, 0) and (0, 1, 0) points, BUT at (1, 0, 0) and (-1, 0, 0) points.\nclass CV_EXPORTS SphericalPortraitWarper : public RotationWarperBase<SphericalPortraitProjector>\n{\npublic:\n    SphericalPortraitWarper(float scale) { projector_.scale = scale; }\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br);\n};\n\nstruct CylindricalPortraitProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS CylindricalPortraitWarper : public RotationWarperBase<CylindricalPortraitProjector>\n{\npublic:\n    CylindricalPortraitWarper(float scale) { projector_.scale = scale; }\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br)\n    {\n        RotationWarperBase<CylindricalPortraitProjector>::detectResultRoiByBorder(src_size, dst_tl, dst_br);\n    }\n};\n\nstruct PlanePortraitProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS PlanePortraitWarper : public RotationWarperBase<PlanePortraitProjector>\n{\npublic:\n    PlanePortraitWarper(float scale) { projector_.scale = scale; }\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br)\n    {\n        RotationWarperBase<PlanePortraitProjector>::detectResultRoiByBorder(src_size, dst_tl, dst_br);\n    }\n};\n\n} // namespace detail\n} // namespace cv\n\n#include \"warpers_inl.hpp\"\n\n#endif // __OPENCV_STITCHING_WARPERS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/detail/warpers_inl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_WARPERS_INL_HPP__\n#define __OPENCV_STITCHING_WARPERS_INL_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"warpers.hpp\" // Make your IDE see declarations\n\nnamespace cv {\nnamespace detail {\n\ntemplate <class P>\nPoint2f RotationWarperBase<P>::warpPoint(const Point2f &pt, const Mat &K, const Mat &R)\n{\n    projector_.setCameraParams(K, R);\n    Point2f uv;\n    projector_.mapForward(pt.x, pt.y, uv.x, uv.y);\n    return uv;\n}\n\n\ntemplate <class P>\nRect RotationWarperBase<P>::buildMaps(Size src_size, const Mat &K, const Mat &R, Mat &xmap, Mat &ymap)\n{\n    projector_.setCameraParams(K, R);\n\n    Point dst_tl, dst_br;\n    detectResultRoi(src_size, dst_tl, dst_br);\n\n    xmap.create(dst_br.y - dst_tl.y + 1, dst_br.x - dst_tl.x + 1, CV_32F);\n    ymap.create(dst_br.y - dst_tl.y + 1, dst_br.x - dst_tl.x + 1, CV_32F);\n\n    float x, y;\n    for (int v = dst_tl.y; v <= dst_br.y; ++v)\n    {\n        for (int u = dst_tl.x; u <= dst_br.x; ++u)\n        {\n            projector_.mapBackward(static_cast<float>(u), static_cast<float>(v), x, y);\n            xmap.at<float>(v - dst_tl.y, u - dst_tl.x) = x;\n            ymap.at<float>(v - dst_tl.y, u - dst_tl.x) = y;\n        }\n    }\n\n    return Rect(dst_tl, dst_br);\n}\n\n\ntemplate <class P>\nPoint RotationWarperBase<P>::warp(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n                                  Mat &dst)\n{\n    Mat xmap, ymap;\n    Rect dst_roi = buildMaps(src.size(), K, R, xmap, ymap);\n\n    dst.create(dst_roi.height + 1, dst_roi.width + 1, src.type());\n    remap(src, dst, xmap, ymap, interp_mode, border_mode);\n\n    return dst_roi.tl();\n}\n\n\ntemplate <class P>\nvoid RotationWarperBase<P>::warpBackward(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode,\n                                         Size dst_size, Mat &dst)\n{\n    projector_.setCameraParams(K, R);\n\n    Point src_tl, src_br;\n    detectResultRoi(dst_size, src_tl, src_br);\n    CV_Assert(src_br.x - src_tl.x + 1 == src.cols && src_br.y - src_tl.y + 1 == src.rows);\n\n    Mat xmap(dst_size, CV_32F);\n    Mat ymap(dst_size, CV_32F);\n\n    float u, v;\n    for (int y = 0; y < dst_size.height; ++y)\n    {\n        for (int x = 0; x < dst_size.width; ++x)\n        {\n            projector_.mapForward(static_cast<float>(x), static_cast<float>(y), u, v);\n            xmap.at<float>(y, x) = u - src_tl.x;\n            ymap.at<float>(y, x) = v - src_tl.y;\n        }\n    }\n\n    dst.create(dst_size, src.type());\n    remap(src, dst, xmap, ymap, interp_mode, border_mode);\n}\n\n\ntemplate <class P>\nRect RotationWarperBase<P>::warpRoi(Size src_size, const Mat &K, const Mat &R)\n{\n    projector_.setCameraParams(K, R);\n\n    Point dst_tl, dst_br;\n    detectResultRoi(src_size, dst_tl, dst_br);\n\n    return Rect(dst_tl, Point(dst_br.x + 1, dst_br.y + 1));\n}\n\n\ntemplate <class P>\nvoid RotationWarperBase<P>::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br)\n{\n    float tl_uf = std::numeric_limits<float>::max();\n    float tl_vf = std::numeric_limits<float>::max();\n    float br_uf = -std::numeric_limits<float>::max();\n    float br_vf = -std::numeric_limits<float>::max();\n\n    float u, v;\n    for (int y = 0; y < src_size.height; ++y)\n    {\n        for (int x = 0; x < src_size.width; ++x)\n        {\n            projector_.mapForward(static_cast<float>(x), static_cast<float>(y), u, v);\n            tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);\n            br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);\n        }\n    }\n\n    dst_tl.x = static_cast<int>(tl_uf);\n    dst_tl.y = static_cast<int>(tl_vf);\n    dst_br.x = static_cast<int>(br_uf);\n    dst_br.y = static_cast<int>(br_vf);\n}\n\n\ntemplate <class P>\nvoid RotationWarperBase<P>::detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br)\n{\n    float tl_uf = std::numeric_limits<float>::max();\n    float tl_vf = std::numeric_limits<float>::max();\n    float br_uf = -std::numeric_limits<float>::max();\n    float br_vf = -std::numeric_limits<float>::max();\n\n    float u, v;\n    for (float x = 0; x < src_size.width; ++x)\n    {\n        projector_.mapForward(static_cast<float>(x), 0, u, v);\n        tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);\n        br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);\n\n        projector_.mapForward(static_cast<float>(x), static_cast<float>(src_size.height - 1), u, v);\n        tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);\n        br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);\n    }\n    for (int y = 0; y < src_size.height; ++y)\n    {\n        projector_.mapForward(0, static_cast<float>(y), u, v);\n        tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);\n        br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);\n\n        projector_.mapForward(static_cast<float>(src_size.width - 1), static_cast<float>(y), u, v);\n        tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v);\n        br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v);\n    }\n\n    dst_tl.x = static_cast<int>(tl_uf);\n    dst_tl.y = static_cast<int>(tl_vf);\n    dst_br.x = static_cast<int>(br_uf);\n    dst_br.y = static_cast<int>(br_vf);\n}\n\n\ninline\nvoid PlaneProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    x_ = t[0] + x_ / z_ * (1 - t[2]);\n    y_ = t[1] + y_ / z_ * (1 - t[2]);\n\n    u = scale * x_;\n    v = scale * y_;\n}\n\n\ninline\nvoid PlaneProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u = u / scale - t[0];\n    v = v / scale - t[1];\n\n    float z;\n    x = k_rinv[0] * u + k_rinv[1] * v + k_rinv[2] * (1 - t[2]);\n    y = k_rinv[3] * u + k_rinv[4] * v + k_rinv[5] * (1 - t[2]);\n    z = k_rinv[6] * u + k_rinv[7] * v + k_rinv[8] * (1 - t[2]);\n\n    x /= z;\n    y /= z;\n}\n\n\ninline\nvoid SphericalProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    u = scale * atan2f(x_, z_);\n    float w = y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_);\n    v = scale * (static_cast<float>(CV_PI) - acosf(w == w ? w : 0));\n}\n\n\ninline\nvoid SphericalProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float sinv = sinf(static_cast<float>(CV_PI) - v);\n    float x_ = sinv * sinf(u);\n    float y_ = cosf(static_cast<float>(CV_PI) - v);\n    float z_ = sinv * cosf(u);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\n\ninline\nvoid CylindricalProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    u = scale * atan2f(x_, z_);\n    v = scale * y_ / sqrtf(x_ * x_ + z_ * z_);\n}\n\n\ninline\nvoid CylindricalProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float x_ = sinf(u);\n    float y_ = v;\n    float z_ = cosf(u);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid FisheyeProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = (float)CV_PI - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    u = scale * v_ * cosf(u_);\n    v = scale * v_ * sinf(u_);\n}\n\ninline\nvoid FisheyeProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float u_ = atan2f(v, u);\n    float v_ = sqrtf(u*u + v*v);\n\n    float sinv = sinf((float)CV_PI - v_);\n    float x_ = sinv * sinf(u_);\n    float y_ = cosf((float)CV_PI - v_);\n    float z_ = sinv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid StereographicProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = (float)CV_PI - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    float r = sinf(v_) / (1 - cosf(v_));\n\n    u = scale * r * cos(u_);\n    v = scale * r * sin(u_);\n}\n\ninline\nvoid StereographicProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float u_ = atan2f(v, u);\n    float r = sqrtf(u*u + v*v);\n    float v_ = 2 * atanf(1.f / r);\n\n    float sinv = sinf((float)CV_PI - v_);\n    float x_ = sinv * sinf(u_);\n    float y_ = cosf((float)CV_PI - v_);\n    float z_ = sinv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid CompressedRectilinearProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    u = scale * a * tanf(u_ / a);\n    v = scale * b * tanf(v_) / cosf(u_);\n}\n\ninline\nvoid CompressedRectilinearProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float aatg = a * atanf(u / a);\n    float u_ = aatg;\n    float v_ = atanf(v * cosf(aatg) / b);\n\n    float cosv = cosf(v_);\n    float x_ = cosv * sinf(u_);\n    float y_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid CompressedRectilinearPortraitProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float y_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float x_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    u = - scale * a * tanf(u_ / a);\n    v = scale * b * tanf(v_) / cosf(u_);\n}\n\ninline\nvoid CompressedRectilinearPortraitProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= - scale;\n    v /= scale;\n\n    float aatg = a * atanf(u / a);\n    float u_ = aatg;\n    float v_ = atanf(v * cosf( aatg ) / b);\n\n    float cosv = cosf(v_);\n    float y_ = cosv * sinf(u_);\n    float x_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid PaniniProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    float tg = a * tanf(u_ / a);\n    u = scale * tg;\n\n    float sinu = sinf(u_);\n    if ( fabs(sinu) < 1E-7 )\n        v = scale * b * tanf(v_);\n    else\n        v = scale * b * tg * tanf(v_) / sinu;\n}\n\ninline\nvoid PaniniProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float lamda = a * atanf(u / a);\n    float u_ = lamda;\n\n    float v_;\n    if ( fabs(lamda) > 1E-7)\n        v_ = atanf(v * sinf(lamda) / (b * a * tanf(lamda / a)));\n    else\n        v_ = atanf(v / b);\n\n    float cosv = cosf(v_);\n    float x_ = cosv * sinf(u_);\n    float y_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid PaniniPortraitProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float y_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float x_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    float tg = a * tanf(u_ / a);\n    u = - scale * tg;\n\n    float sinu = sinf( u_ );\n    if ( fabs(sinu) < 1E-7 )\n        v = scale * b * tanf(v_);\n    else\n        v = scale * b * tg * tanf(v_) / sinu;\n}\n\ninline\nvoid PaniniPortraitProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= - scale;\n    v /= scale;\n\n    float lamda = a * atanf(u / a);\n    float u_ = lamda;\n\n    float v_;\n    if ( fabs(lamda) > 1E-7)\n        v_ = atanf(v * sinf(lamda) / (b * a * tanf(lamda/a)));\n    else\n        v_ = atanf(v / b);\n\n    float cosv = cosf(v_);\n    float y_ = cosv * sinf(u_);\n    float x_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid MercatorProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    u = scale * u_;\n    v = scale * logf( tanf( (float)(CV_PI/4) + v_/2 ) );\n}\n\ninline\nvoid MercatorProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float v_ = atanf( sinhf(v) );\n    float u_ = u;\n\n    float cosv = cosf(v_);\n    float x_ = cosv * sinf(u_);\n    float y_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid TransverseMercatorProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    float B = cosf(v_) * sinf(u_);\n\n    u = scale / 2 * logf( (1+B) / (1-B) );\n    v = scale * atan2f(tanf(v_), cosf(u_));\n}\n\ninline\nvoid TransverseMercatorProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float v_ = asinf( sinf(v) / coshf(u) );\n    float u_ = atan2f( sinhf(u), cos(v) );\n\n    float cosv = cosf(v_);\n    float x_ = cosv * sinf(u_);\n    float y_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid SphericalPortraitProjector::mapForward(float x, float y, float &u0, float &v0)\n{\n    float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float x_ = y0_;\n    float y_ = x0_;\n    float u, v;\n\n    u = scale * atan2f(x_, z_);\n    v = scale * (static_cast<float>(CV_PI) - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)));\n\n    u0 = -u;//v;\n    v0 = v;//u;\n}\n\n\ninline\nvoid SphericalPortraitProjector::mapBackward(float u0, float v0, float &x, float &y)\n{\n    float u, v;\n    u = -u0;//v0;\n    v = v0;//u0;\n\n    u /= scale;\n    v /= scale;\n\n    float sinv = sinf(static_cast<float>(CV_PI) - v);\n    float x0_ = sinv * sinf(u);\n    float y0_ = cosf(static_cast<float>(CV_PI) - v);\n    float z_ = sinv * cosf(u);\n\n    float x_ = y0_;\n    float y_ = x0_;\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid CylindricalPortraitProjector::mapForward(float x, float y, float &u0, float &v0)\n{\n    float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_  = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float x_ = y0_;\n    float y_ = x0_;\n    float u, v;\n\n    u = scale * atan2f(x_, z_);\n    v = scale * y_ / sqrtf(x_ * x_ + z_ * z_);\n\n    u0 = -u;//v;\n    v0 = v;//u;\n}\n\n\ninline\nvoid CylindricalPortraitProjector::mapBackward(float u0, float v0, float &x, float &y)\n{\n    float u, v;\n    u = -u0;//v0;\n    v = v0;//u0;\n\n    u /= scale;\n    v /= scale;\n\n    float x0_ = sinf(u);\n    float y0_ = v;\n    float z_  = cosf(u);\n\n    float x_ = y0_;\n    float y_ = x0_;\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid PlanePortraitProjector::mapForward(float x, float y, float &u0, float &v0)\n{\n    float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_  = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float x_ = y0_;\n    float y_ = x0_;\n\n    x_ = t[0] + x_ / z_ * (1 - t[2]);\n    y_ = t[1] + y_ / z_ * (1 - t[2]);\n\n    float u,v;\n    u = scale * x_;\n    v = scale * y_;\n\n    u0 = -u;\n    v0 = v;\n}\n\n\ninline\nvoid PlanePortraitProjector::mapBackward(float u0, float v0, float &x, float &y)\n{\n    float u, v;\n    u = -u0;\n    v = v0;\n\n    u = u / scale - t[0];\n    v = v / scale - t[1];\n\n    float z;\n    x = k_rinv[0] * v + k_rinv[1] * u + k_rinv[2] * (1 - t[2]);\n    y = k_rinv[3] * v + k_rinv[4] * u + k_rinv[5] * (1 - t[2]);\n    z = k_rinv[6] * v + k_rinv[7] * u + k_rinv[8] * (1 - t[2]);\n\n    x /= z;\n    y /= z;\n}\n\n\n} // namespace detail\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_WARPERS_INL_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/stitcher.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_STITCHER_HPP__\n#define __OPENCV_STITCHING_STITCHER_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/stitching/warpers.hpp\"\n#include \"opencv2/stitching/detail/matchers.hpp\"\n#include \"opencv2/stitching/detail/motion_estimators.hpp\"\n#include \"opencv2/stitching/detail/exposure_compensate.hpp\"\n#include \"opencv2/stitching/detail/seam_finders.hpp\"\n#include \"opencv2/stitching/detail/blenders.hpp\"\n#include \"opencv2/stitching/detail/camera.hpp\"\n\nnamespace cv {\n\nclass CV_EXPORTS Stitcher\n{\npublic:\n    enum { ORIG_RESOL = -1 };\n    enum Status { OK, ERR_NEED_MORE_IMGS };\n\n    // Creates stitcher with default parameters\n    static Stitcher createDefault(bool try_use_gpu = false);\n\n    double registrationResol() const { return registr_resol_; }\n    void setRegistrationResol(double resol_mpx) { registr_resol_ = resol_mpx; }\n\n    double seamEstimationResol() const { return seam_est_resol_; }\n    void setSeamEstimationResol(double resol_mpx) { seam_est_resol_ = resol_mpx; }\n\n    double compositingResol() const { return compose_resol_; }\n    void setCompositingResol(double resol_mpx) { compose_resol_ = resol_mpx; }\n\n    double panoConfidenceThresh() const { return conf_thresh_; }\n    void setPanoConfidenceThresh(double conf_thresh) { conf_thresh_ = conf_thresh; }\n\n    bool waveCorrection() const { return do_wave_correct_; }\n    void setWaveCorrection(bool flag) { do_wave_correct_ = flag; }\n\n    detail::WaveCorrectKind waveCorrectKind() const { return wave_correct_kind_; }\n    void setWaveCorrectKind(detail::WaveCorrectKind kind) { wave_correct_kind_ = kind; }\n\n    Ptr<detail::FeaturesFinder> featuresFinder() { return features_finder_; }\n    const Ptr<detail::FeaturesFinder> featuresFinder() const { return features_finder_; }\n    void setFeaturesFinder(Ptr<detail::FeaturesFinder> features_finder)\n        { features_finder_ = features_finder; }\n\n    Ptr<detail::FeaturesMatcher> featuresMatcher() { return features_matcher_; }\n    const Ptr<detail::FeaturesMatcher> featuresMatcher() const { return features_matcher_; }\n    void setFeaturesMatcher(Ptr<detail::FeaturesMatcher> features_matcher)\n        { features_matcher_ = features_matcher; }\n\n    const cv::Mat& matchingMask() const { return matching_mask_; }\n    void setMatchingMask(const cv::Mat &mask)\n    {\n        CV_Assert(mask.type() == CV_8U && mask.cols == mask.rows);\n        matching_mask_ = mask.clone();\n    }\n\n    Ptr<detail::BundleAdjusterBase> bundleAdjuster() { return bundle_adjuster_; }\n    const Ptr<detail::BundleAdjusterBase> bundleAdjuster() const { return bundle_adjuster_; }\n    void setBundleAdjuster(Ptr<detail::BundleAdjusterBase> bundle_adjuster)\n        { bundle_adjuster_ = bundle_adjuster; }\n\n    Ptr<WarperCreator> warper() { return warper_; }\n    const Ptr<WarperCreator> warper() const { return warper_; }\n    void setWarper(Ptr<WarperCreator> creator) { warper_ = creator; }\n\n    Ptr<detail::ExposureCompensator> exposureCompensator() { return exposure_comp_; }\n    const Ptr<detail::ExposureCompensator> exposureCompensator() const { return exposure_comp_; }\n    void setExposureCompensator(Ptr<detail::ExposureCompensator> exposure_comp)\n        { exposure_comp_ = exposure_comp; }\n\n    Ptr<detail::SeamFinder> seamFinder() { return seam_finder_; }\n    const Ptr<detail::SeamFinder> seamFinder() const { return seam_finder_; }\n    void setSeamFinder(Ptr<detail::SeamFinder> seam_finder) { seam_finder_ = seam_finder; }\n\n    Ptr<detail::Blender> blender() { return blender_; }\n    const Ptr<detail::Blender> blender() const { return blender_; }\n    void setBlender(Ptr<detail::Blender> b) { blender_ = b; }\n\n    Status estimateTransform(InputArray images);\n    Status estimateTransform(InputArray images, const std::vector<std::vector<Rect> > &rois);\n\n    Status composePanorama(OutputArray pano);\n    Status composePanorama(InputArray images, OutputArray pano);\n\n    Status stitch(InputArray images, OutputArray pano);\n    Status stitch(InputArray images, const std::vector<std::vector<Rect> > &rois, OutputArray pano);\n\n    std::vector<int> component() const { return indices_; }\n    std::vector<detail::CameraParams> cameras() const { return cameras_; }\n    double workScale() const { return work_scale_; }\n\nprivate:\n    Stitcher() {}\n\n    Status matchImages();\n    void estimateCameraParams();\n\n    double registr_resol_;\n    double seam_est_resol_;\n    double compose_resol_;\n    double conf_thresh_;\n    Ptr<detail::FeaturesFinder> features_finder_;\n    Ptr<detail::FeaturesMatcher> features_matcher_;\n    cv::Mat matching_mask_;\n    Ptr<detail::BundleAdjusterBase> bundle_adjuster_;\n    bool do_wave_correct_;\n    detail::WaveCorrectKind wave_correct_kind_;\n    Ptr<WarperCreator> warper_;\n    Ptr<detail::ExposureCompensator> exposure_comp_;\n    Ptr<detail::SeamFinder> seam_finder_;\n    Ptr<detail::Blender> blender_;\n\n    std::vector<cv::Mat> imgs_;\n    std::vector<std::vector<cv::Rect> > rois_;\n    std::vector<cv::Size> full_img_sizes_;\n    std::vector<detail::ImageFeatures> features_;\n    std::vector<detail::MatchesInfo> pairwise_matches_;\n    std::vector<cv::Mat> seam_est_imgs_;\n    std::vector<int> indices_;\n    std::vector<detail::CameraParams> cameras_;\n    double work_scale_;\n    double seam_scale_;\n    double seam_work_aspect_;\n    double warped_image_scale_;\n};\n\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_STITCHER_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/stitching/warpers.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_STITCHING_WARPER_CREATORS_HPP__\n#define __OPENCV_STITCHING_WARPER_CREATORS_HPP__\n\n#include \"opencv2/stitching/detail/warpers.hpp\"\n\nnamespace cv {\n\nclass WarperCreator\n{\npublic:\n    virtual ~WarperCreator() {}\n    virtual Ptr<detail::RotationWarper> create(float scale) const = 0;\n};\n\n\nclass PlaneWarper : public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::PlaneWarper(scale); }\n};\n\n\nclass CylindricalWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::CylindricalWarper(scale); }\n};\n\n\nclass SphericalWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::SphericalWarper(scale); }\n};\n\nclass FisheyeWarper : public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::FisheyeWarper(scale); }\n};\n\nclass StereographicWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::StereographicWarper(scale); }\n};\n\nclass CompressedRectilinearWarper: public WarperCreator\n{\n    float a, b;\npublic:\n    CompressedRectilinearWarper(float A = 1, float B = 1)\n    {\n        a = A; b = B;\n    }\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::CompressedRectilinearWarper(scale, a, b); }\n};\n\nclass CompressedRectilinearPortraitWarper: public WarperCreator\n{\n    float a, b;\npublic:\n    CompressedRectilinearPortraitWarper(float A = 1, float B = 1)\n    {\n        a = A; b = B;\n    }\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::CompressedRectilinearPortraitWarper(scale, a, b); }\n};\n\nclass PaniniWarper: public WarperCreator\n{\n    float a, b;\npublic:\n    PaniniWarper(float A = 1, float B = 1)\n    {\n        a = A; b = B;\n    }\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::PaniniWarper(scale, a, b); }\n};\n\nclass PaniniPortraitWarper: public WarperCreator\n{\n    float a, b;\npublic:\n    PaniniPortraitWarper(float A = 1, float B = 1)\n    {\n        a = A; b = B;\n    }\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::PaniniPortraitWarper(scale, a, b); }\n};\n\nclass MercatorWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::MercatorWarper(scale); }\n};\n\nclass TransverseMercatorWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::TransverseMercatorWarper(scale); }\n};\n\n\n\nclass PlaneWarperGpu: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::PlaneWarperGpu(scale); }\n};\n\n\nclass CylindricalWarperGpu: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::CylindricalWarperGpu(scale); }\n};\n\n\nclass SphericalWarperGpu: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const { return new detail::SphericalWarperGpu(scale); }\n};\n\n} // namespace cv\n\n#endif // __OPENCV_STITCHING_WARPER_CREATORS_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/superres/optical_flow.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__\n#define __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__\n\n#include \"opencv2/core/core.hpp\"\n\nnamespace cv\n{\n    namespace superres\n    {\n        class CV_EXPORTS DenseOpticalFlowExt : public cv::Algorithm\n        {\n        public:\n            virtual void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2 = noArray()) = 0;\n            virtual void collectGarbage() = 0;\n        };\n\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_Farneback();\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_Farneback_GPU();\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_Farneback_OCL();\n\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_Simple();\n\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_DualTVL1();\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_DualTVL1_GPU();\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_DualTVL1_OCL();\n\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_Brox_GPU();\n\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_PyrLK_GPU();\n        CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_PyrLK_OCL();\n    }\n}\n\n#endif // __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/superres/superres.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_SUPERRES_HPP__\n#define __OPENCV_SUPERRES_HPP__\n\n#include \"opencv2/core/core.hpp\"\n\nnamespace cv\n{\n    namespace superres\n    {\n        CV_EXPORTS bool initModule_superres();\n\n        class CV_EXPORTS FrameSource\n        {\n        public:\n            virtual ~FrameSource();\n\n            virtual void nextFrame(OutputArray frame) = 0;\n            virtual void reset() = 0;\n        };\n\n        CV_EXPORTS Ptr<FrameSource> createFrameSource_Empty();\n\n        CV_EXPORTS Ptr<FrameSource> createFrameSource_Video(const std::string& fileName);\n        CV_EXPORTS Ptr<FrameSource> createFrameSource_Video_GPU(const std::string& fileName);\n\n        CV_EXPORTS Ptr<FrameSource> createFrameSource_Camera(int deviceId = 0);\n\n        class CV_EXPORTS SuperResolution : public cv::Algorithm, public FrameSource\n        {\n        public:\n            void setInput(const Ptr<FrameSource>& frameSource);\n\n            void nextFrame(OutputArray frame);\n            void reset();\n\n            virtual void collectGarbage();\n\n        protected:\n            SuperResolution();\n\n            virtual void initImpl(Ptr<FrameSource>& frameSource) = 0;\n            virtual void processImpl(Ptr<FrameSource>& frameSource, OutputArray output) = 0;\n\n        private:\n            Ptr<FrameSource> frameSource_;\n            bool firstCall_;\n        };\n\n        // S. Farsiu , D. Robinson, M. Elad, P. Milanfar. Fast and robust multiframe super resolution.\n        // Dennis Mitzel, Thomas Pock, Thomas Schoenemann, Daniel Cremers. Video Super Resolution using Duality Based TV-L1 Optical Flow.\n        CV_EXPORTS Ptr<SuperResolution> createSuperResolution_BTVL1();\n        CV_EXPORTS Ptr<SuperResolution> createSuperResolution_BTVL1_GPU();\n        CV_EXPORTS Ptr<SuperResolution> createSuperResolution_BTVL1_OCL();\n    }\n}\n\n#endif // __OPENCV_SUPERRES_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/ts/gpu_perf.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_PERF_UTILITY_HPP__\n#define __OPENCV_GPU_PERF_UTILITY_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/highgui/highgui.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/ts/ts_perf.hpp\"\n\nnamespace perf\n{\n#ifdef OPENCV_TINY_GPU_MODULE\n    #define ALL_BORDER_MODES testing::Values(BorderMode(cv::BORDER_REFLECT101), BorderMode(cv::BORDER_REPLICATE), BorderMode(cv::BORDER_CONSTANT), BorderMode(cv::BORDER_REFLECT))\n    #define ALL_INTERPOLATIONS testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_AREA))\n#else\n    #define ALL_BORDER_MODES BorderMode::all()\n    #define ALL_INTERPOLATIONS Interpolation::all()\n#endif\n\n    CV_ENUM(BorderMode, BORDER_REFLECT101, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_WRAP)\n    CV_ENUM(Interpolation, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, INTER_AREA)\n    CV_ENUM(NormType, NORM_INF, NORM_L1, NORM_L2, NORM_HAMMING, NORM_MINMAX)\n\n    enum { Gray = 1, TwoChannel = 2, BGR = 3, BGRA = 4 };\n    CV_ENUM(MatCn, Gray, TwoChannel, BGR, BGRA)\n\n    #define GPU_CHANNELS_1_3_4 testing::Values(MatCn(Gray), MatCn(BGR), MatCn(BGRA))\n    #define GPU_CHANNELS_1_3 testing::Values(MatCn(Gray), MatCn(BGR))\n\n    #define GET_PARAM(k) std::tr1::get< k >(GetParam())\n\n    #define DEF_PARAM_TEST(name, ...) typedef ::perf::TestBaseWithParam< std::tr1::tuple< __VA_ARGS__ > > name\n    #define DEF_PARAM_TEST_1(name, param_type) typedef ::perf::TestBaseWithParam< param_type > name\n\n    DEF_PARAM_TEST_1(Sz, cv::Size);\n    typedef perf::Size_MatType Sz_Type;\n    DEF_PARAM_TEST(Sz_Depth, cv::Size, perf::MatDepth);\n    DEF_PARAM_TEST(Sz_Depth_Cn, cv::Size, perf::MatDepth, MatCn);\n\n    #define GPU_TYPICAL_MAT_SIZES testing::Values(perf::sz720p, perf::szSXGA, perf::sz1080p)\n\n    #define FAIL_NO_CPU() FAIL() << \"No such CPU implementation analogy\"\n\n    #define GPU_SANITY_CHECK(mat, ...) \\\n        do{ \\\n            cv::Mat gpu_##mat(mat); \\\n            SANITY_CHECK(gpu_##mat, ## __VA_ARGS__); \\\n        } while(0)\n\n    #define CPU_SANITY_CHECK(mat, ...) \\\n        do{ \\\n            cv::Mat cpu_##mat(mat); \\\n            SANITY_CHECK(cpu_##mat, ## __VA_ARGS__); \\\n        } while(0)\n\n    CV_EXPORTS cv::Mat readImage(const std::string& fileName, int flags = cv::IMREAD_COLOR);\n\n    struct CvtColorInfo\n    {\n        int scn;\n        int dcn;\n        int code;\n\n        CvtColorInfo() {}\n        explicit CvtColorInfo(int scn_, int dcn_, int code_) : scn(scn_), dcn(dcn_), code(code_) {}\n    };\n    CV_EXPORTS void PrintTo(const CvtColorInfo& info, std::ostream* os);\n\n    CV_EXPORTS void printCudaInfo();\n\n    CV_EXPORTS void sortKeyPoints(std::vector<cv::KeyPoint>& keypoints, cv::InputOutputArray _descriptors = cv::noArray());\n}\n\n#endif // __OPENCV_GPU_PERF_UTILITY_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/ts/gpu_test.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GPU_TEST_UTILITY_HPP__\n#define __OPENCV_GPU_TEST_UTILITY_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/core/gpumat.hpp\"\n#include \"opencv2/highgui/highgui.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/ts/ts.hpp\"\n#include \"opencv2/ts/ts_perf.hpp\"\n\nnamespace cvtest\n{\n    //////////////////////////////////////////////////////////////////////\n    // random generators\n\n    CV_EXPORTS int randomInt(int minVal, int maxVal);\n    CV_EXPORTS double randomDouble(double minVal, double maxVal);\n    CV_EXPORTS cv::Size randomSize(int minVal, int maxVal);\n    CV_EXPORTS cv::Scalar randomScalar(double minVal, double maxVal);\n    CV_EXPORTS cv::Mat randomMat(cv::Size size, int type, double minVal = 0.0, double maxVal = 255.0);\n\n    //////////////////////////////////////////////////////////////////////\n    // GpuMat create\n\n    CV_EXPORTS cv::gpu::GpuMat createMat(cv::Size size, int type, bool useRoi = false);\n    CV_EXPORTS cv::gpu::GpuMat loadMat(const cv::Mat& m, bool useRoi = false);\n\n    //////////////////////////////////////////////////////////////////////\n    // Image load\n\n    //! read image from testdata folder\n    CV_EXPORTS cv::Mat readImage(const std::string& fileName, int flags = cv::IMREAD_COLOR);\n\n    //! read image from testdata folder and convert it to specified type\n    CV_EXPORTS cv::Mat readImageType(const std::string& fname, int type);\n\n    //////////////////////////////////////////////////////////////////////\n    // Gpu devices\n\n    //! return true if device supports specified feature and gpu module was built with support the feature.\n    CV_EXPORTS bool supportFeature(const cv::gpu::DeviceInfo& info, cv::gpu::FeatureSet feature);\n\n    class CV_EXPORTS DeviceManager\n    {\n    public:\n        static DeviceManager& instance();\n\n        void load(int i);\n        void loadAll();\n\n        const std::vector<cv::gpu::DeviceInfo>& values() const { return devices_; }\n\n    private:\n        std::vector<cv::gpu::DeviceInfo> devices_;\n    };\n\n    #define ALL_DEVICES testing::ValuesIn(cvtest::DeviceManager::instance().values())\n\n    //////////////////////////////////////////////////////////////////////\n    // Additional assertion\n\n    CV_EXPORTS void minMaxLocGold(const cv::Mat& src, double* minVal_, double* maxVal_ = 0, cv::Point* minLoc_ = 0, cv::Point* maxLoc_ = 0, const cv::Mat& mask = cv::Mat());\n\n    CV_EXPORTS cv::Mat getMat(cv::InputArray arr);\n\n    CV_EXPORTS testing::AssertionResult assertMatNear(const char* expr1, const char* expr2, const char* eps_expr, cv::InputArray m1, cv::InputArray m2, double eps);\n\n    #define EXPECT_MAT_NEAR(m1, m2, eps) EXPECT_PRED_FORMAT3(cvtest::assertMatNear, m1, m2, eps)\n    #define ASSERT_MAT_NEAR(m1, m2, eps) ASSERT_PRED_FORMAT3(cvtest::assertMatNear, m1, m2, eps)\n\n    #define EXPECT_SCALAR_NEAR(s1, s2, eps) \\\n        { \\\n            EXPECT_NEAR(s1[0], s2[0], eps); \\\n            EXPECT_NEAR(s1[1], s2[1], eps); \\\n            EXPECT_NEAR(s1[2], s2[2], eps); \\\n            EXPECT_NEAR(s1[3], s2[3], eps); \\\n        }\n    #define ASSERT_SCALAR_NEAR(s1, s2, eps) \\\n        { \\\n            ASSERT_NEAR(s1[0], s2[0], eps); \\\n            ASSERT_NEAR(s1[1], s2[1], eps); \\\n            ASSERT_NEAR(s1[2], s2[2], eps); \\\n            ASSERT_NEAR(s1[3], s2[3], eps); \\\n        }\n\n    #define EXPECT_POINT2_NEAR(p1, p2, eps) \\\n        { \\\n            EXPECT_NEAR(p1.x, p2.x, eps); \\\n            EXPECT_NEAR(p1.y, p2.y, eps); \\\n        }\n    #define ASSERT_POINT2_NEAR(p1, p2, eps) \\\n        { \\\n            ASSERT_NEAR(p1.x, p2.x, eps); \\\n            ASSERT_NEAR(p1.y, p2.y, eps); \\\n        }\n\n    #define EXPECT_POINT3_NEAR(p1, p2, eps) \\\n        { \\\n            EXPECT_NEAR(p1.x, p2.x, eps); \\\n            EXPECT_NEAR(p1.y, p2.y, eps); \\\n            EXPECT_NEAR(p1.z, p2.z, eps); \\\n        }\n    #define ASSERT_POINT3_NEAR(p1, p2, eps) \\\n        { \\\n            ASSERT_NEAR(p1.x, p2.x, eps); \\\n            ASSERT_NEAR(p1.y, p2.y, eps); \\\n            ASSERT_NEAR(p1.z, p2.z, eps); \\\n        }\n\n    CV_EXPORTS double checkSimilarity(cv::InputArray m1, cv::InputArray m2);\n\n    #define EXPECT_MAT_SIMILAR(mat1, mat2, eps) \\\n        { \\\n            ASSERT_EQ(mat1.type(), mat2.type()); \\\n            ASSERT_EQ(mat1.size(), mat2.size()); \\\n            EXPECT_LE(checkSimilarity(mat1, mat2), eps); \\\n        }\n    #define ASSERT_MAT_SIMILAR(mat1, mat2, eps) \\\n        { \\\n            ASSERT_EQ(mat1.type(), mat2.type()); \\\n            ASSERT_EQ(mat1.size(), mat2.size()); \\\n            ASSERT_LE(checkSimilarity(mat1, mat2), eps); \\\n        }\n\n    //////////////////////////////////////////////////////////////////////\n    // Helper structs for value-parameterized tests\n\n    #define GPU_TEST_P(test_case_name, test_name) \\\n      class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \\\n          : public test_case_name { \\\n       public: \\\n        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \\\n        virtual void TestBody(); \\\n       private: \\\n        void UnsafeTestBody(); \\\n        static int AddToRegistry() { \\\n          ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \\\n              GetTestCasePatternHolder<test_case_name>(\\\n                  #test_case_name, __FILE__, __LINE__)->AddTestPattern(\\\n                      #test_case_name, \\\n                      #test_name, \\\n                      new ::testing::internal::TestMetaFactory< \\\n                          GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \\\n          return 0; \\\n        } \\\n        static int gtest_registering_dummy_; \\\n        GTEST_DISALLOW_COPY_AND_ASSIGN_(\\\n            GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \\\n      }; \\\n      int GTEST_TEST_CLASS_NAME_(test_case_name, \\\n                                 test_name)::gtest_registering_dummy_ = \\\n          GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \\\n      void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() \\\n      { \\\n        try \\\n        { \\\n          UnsafeTestBody(); \\\n        } \\\n        catch (...) \\\n        { \\\n          cv::gpu::resetDevice(); \\\n          throw; \\\n        } \\\n      } \\\n      void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::UnsafeTestBody()\n\n    #define PARAM_TEST_CASE(name, ...) struct name : testing::TestWithParam< std::tr1::tuple< __VA_ARGS__ > >\n    #define GET_PARAM(k) std::tr1::get< k >(GetParam())\n\n    #define DIFFERENT_SIZES testing::Values(cv::Size(128, 128), cv::Size(113, 113))\n\n    // Depth\n\n    using perf::MatDepth;\n\n#ifdef OPENCV_TINY_GPU_MODULE\n    #define ALL_DEPTH testing::Values(MatDepth(CV_8U), MatDepth(CV_32F))\n\n    #define DEPTH_PAIRS testing::Values(std::make_pair(MatDepth(CV_8U), MatDepth(CV_8U)),   \\\n                                        std::make_pair(MatDepth(CV_32F), MatDepth(CV_32F)))\n#else\n    #define ALL_DEPTH testing::Values(MatDepth(CV_8U), MatDepth(CV_8S), MatDepth(CV_16U), MatDepth(CV_16S), MatDepth(CV_32S), MatDepth(CV_32F), MatDepth(CV_64F))\n\n    #define DEPTH_PAIRS testing::Values(std::make_pair(MatDepth(CV_8U), MatDepth(CV_8U)),   \\\n                                        std::make_pair(MatDepth(CV_8U), MatDepth(CV_16U)),  \\\n                                        std::make_pair(MatDepth(CV_8U), MatDepth(CV_16S)),  \\\n                                        std::make_pair(MatDepth(CV_8U), MatDepth(CV_32S)),  \\\n                                        std::make_pair(MatDepth(CV_8U), MatDepth(CV_32F)),  \\\n                                        std::make_pair(MatDepth(CV_8U), MatDepth(CV_64F)),  \\\n                                                                                            \\\n                                        std::make_pair(MatDepth(CV_16U), MatDepth(CV_16U)), \\\n                                        std::make_pair(MatDepth(CV_16U), MatDepth(CV_32S)), \\\n                                        std::make_pair(MatDepth(CV_16U), MatDepth(CV_32F)), \\\n                                        std::make_pair(MatDepth(CV_16U), MatDepth(CV_64F)), \\\n                                                                                            \\\n                                        std::make_pair(MatDepth(CV_16S), MatDepth(CV_16S)), \\\n                                        std::make_pair(MatDepth(CV_16S), MatDepth(CV_32S)), \\\n                                        std::make_pair(MatDepth(CV_16S), MatDepth(CV_32F)), \\\n                                        std::make_pair(MatDepth(CV_16S), MatDepth(CV_64F)), \\\n                                                                                            \\\n                                        std::make_pair(MatDepth(CV_32S), MatDepth(CV_32S)), \\\n                                        std::make_pair(MatDepth(CV_32S), MatDepth(CV_32F)), \\\n                                        std::make_pair(MatDepth(CV_32S), MatDepth(CV_64F)), \\\n                                                                                            \\\n                                        std::make_pair(MatDepth(CV_32F), MatDepth(CV_32F)), \\\n                                        std::make_pair(MatDepth(CV_32F), MatDepth(CV_64F)), \\\n                                                                                            \\\n                                        std::make_pair(MatDepth(CV_64F), MatDepth(CV_64F)))\n#endif\n\n    // Type\n\n    using perf::MatType;\n\n    //! return vector with types from specified range.\n    CV_EXPORTS std::vector<MatType> types(int depth_start, int depth_end, int cn_start, int cn_end);\n\n    //! return vector with all types (depth: CV_8U-CV_64F, channels: 1-4).\n    CV_EXPORTS const std::vector<MatType>& all_types();\n\n    #define ALL_TYPES testing::ValuesIn(all_types())\n    #define TYPES(depth_start, depth_end, cn_start, cn_end) testing::ValuesIn(types(depth_start, depth_end, cn_start, cn_end))\n\n    // ROI\n\n    class UseRoi\n    {\n    public:\n        inline UseRoi(bool val = false) : val_(val) {}\n\n        inline operator bool() const { return val_; }\n\n    private:\n        bool val_;\n    };\n\n    CV_EXPORTS void PrintTo(const UseRoi& useRoi, std::ostream* os);\n\n    #define WHOLE_SUBMAT testing::Values(UseRoi(false), UseRoi(true))\n\n    // Direct/Inverse\n\n    class Inverse\n    {\n    public:\n        inline Inverse(bool val = false) : val_(val) {}\n\n        inline operator bool() const { return val_; }\n\n    private:\n        bool val_;\n    };\n\n    CV_EXPORTS void PrintTo(const Inverse& useRoi, std::ostream* os);\n\n    #define DIRECT_INVERSE testing::Values(Inverse(false), Inverse(true))\n\n    // Param class\n\n    #define IMPLEMENT_PARAM_CLASS(name, type) \\\n        class name \\\n        { \\\n        public: \\\n            name ( type arg = type ()) : val_(arg) {} \\\n            operator type () const {return val_;} \\\n        private: \\\n            type val_; \\\n        }; \\\n        inline void PrintTo( name param, std::ostream* os) \\\n        { \\\n            *os << #name <<  \"(\" << testing::PrintToString(static_cast< type >(param)) << \")\"; \\\n        }\n\n    IMPLEMENT_PARAM_CLASS(Channels, int)\n\n    #define ALL_CHANNELS testing::Values(Channels(1), Channels(2), Channels(3), Channels(4))\n    #define IMAGE_CHANNELS testing::Values(Channels(1), Channels(3), Channels(4))\n\n    // Flags and enums\n\n    CV_ENUM(NormCode, NORM_INF, NORM_L1, NORM_L2, NORM_TYPE_MASK, NORM_RELATIVE, NORM_MINMAX)\n\n    CV_ENUM(Interpolation, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, INTER_AREA)\n\n    CV_ENUM(BorderType, BORDER_REFLECT101, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_WRAP)\n#ifdef OPENCV_TINY_GPU_MODULE\n    #define ALL_BORDER_TYPES testing::Values(BorderType(cv::BORDER_REFLECT101), BorderType(cv::BORDER_REPLICATE), BorderType(cv::BORDER_CONSTANT), BorderType(cv::BORDER_REFLECT))\n#else\n    #define ALL_BORDER_TYPES testing::Values(BorderType(cv::BORDER_REFLECT101), BorderType(cv::BORDER_REPLICATE), BorderType(cv::BORDER_CONSTANT), BorderType(cv::BORDER_REFLECT), BorderType(cv::BORDER_WRAP))\n#endif\n\n    CV_FLAGS(WarpFlags, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, WARP_INVERSE_MAP)\n\n    //////////////////////////////////////////////////////////////////////\n    // Features2D\n\n    CV_EXPORTS testing::AssertionResult assertKeyPointsEquals(const char* gold_expr, const char* actual_expr, std::vector<cv::KeyPoint>& gold, std::vector<cv::KeyPoint>& actual);\n\n    #define ASSERT_KEYPOINTS_EQ(gold, actual) EXPECT_PRED_FORMAT2(assertKeyPointsEquals, gold, actual)\n\n    CV_EXPORTS int getMatchedPointsCount(std::vector<cv::KeyPoint>& gold, std::vector<cv::KeyPoint>& actual);\n    CV_EXPORTS int getMatchedPointsCount(const std::vector<cv::KeyPoint>& keypoints1, const std::vector<cv::KeyPoint>& keypoints2, const std::vector<cv::DMatch>& matches);\n\n    //////////////////////////////////////////////////////////////////////\n    // Other\n\n    CV_EXPORTS void dumpImage(const std::string& fileName, const cv::Mat& image);\n    CV_EXPORTS void showDiff(cv::InputArray gold, cv::InputArray actual, double eps);\n\n    CV_EXPORTS void printCudaInfo();\n}\n\nnamespace cv { namespace gpu\n{\n    CV_EXPORTS void PrintTo(const DeviceInfo& info, std::ostream* os);\n}}\n\n#endif // __OPENCV_GPU_TEST_UTILITY_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/ts/ts.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_GTESTCV_HPP__\n#define __OPENCV_GTESTCV_HPP__\n\n#include <stdarg.h> // for va_list\n\n#ifdef HAVE_WINRT\n    #pragma warning(disable:4447) // Disable warning 'main' signature found without threading model\n#endif\n\n#ifdef _MSC_VER\n#pragma warning( disable: 4127 )\n#endif\n\n#define GTEST_DONT_DEFINE_FAIL      0\n#define GTEST_DONT_DEFINE_SUCCEED   0\n#define GTEST_DONT_DEFINE_ASSERT_EQ 0\n#define GTEST_DONT_DEFINE_ASSERT_NE 0\n#define GTEST_DONT_DEFINE_ASSERT_LE 0\n#define GTEST_DONT_DEFINE_ASSERT_LT 0\n#define GTEST_DONT_DEFINE_ASSERT_GE 0\n#define GTEST_DONT_DEFINE_ASSERT_GT 0\n#define GTEST_DONT_DEFINE_TEST      0\n\n#include \"opencv2/ts/ts_gtest.h\"\n\n#ifndef GTEST_USES_SIMPLE_RE\n#  define GTEST_USES_SIMPLE_RE 0\n#endif\n#ifndef GTEST_USES_POSIX_RE\n#  define GTEST_USES_POSIX_RE 0\n#endif\n\n#include \"opencv2/core/core.hpp\"\n\nnamespace cvtest\n{\n\nusing std::vector;\nusing std::string;\nusing cv::RNG;\nusing cv::Mat;\nusing cv::Scalar;\nusing cv::Size;\nusing cv::Point;\nusing cv::Rect;\n\nclass CV_EXPORTS TS;\n\nCV_EXPORTS int64 readSeed(const char* str);\n\nCV_EXPORTS void randUni( RNG& rng, Mat& a, const Scalar& param1, const Scalar& param2 );\n\ninline unsigned randInt( RNG& rng )\n{\n    return (unsigned)rng;\n}\n\ninline  double randReal( RNG& rng )\n{\n    return (double)rng;\n}\n\n\nCV_EXPORTS const char* getTypeName( int type );\nCV_EXPORTS int typeByName( const char* type_name );\n\nCV_EXPORTS string vec2str(const string& sep, const int* v, size_t nelems);\n\ninline int clipInt( int val, int min_val, int max_val )\n{\n    if( val < min_val )\n        val = min_val;\n    if( val > max_val )\n        val = max_val;\n    return val;\n}\n\nCV_EXPORTS double getMinVal(int depth);\nCV_EXPORTS double getMaxVal(int depth);\n\nCV_EXPORTS Size randomSize(RNG& rng, double maxSizeLog);\nCV_EXPORTS void randomSize(RNG& rng, int minDims, int maxDims, double maxSizeLog, vector<int>& sz);\nCV_EXPORTS int randomType(RNG& rng, int typeMask, int minChannels, int maxChannels);\nCV_EXPORTS Mat randomMat(RNG& rng, Size size, int type, double minVal, double maxVal, bool useRoi);\nCV_EXPORTS Mat randomMat(RNG& rng, const vector<int>& size, int type, double minVal, double maxVal, bool useRoi);\nCV_EXPORTS void add(const Mat& a, double alpha, const Mat& b, double beta,\n                      Scalar gamma, Mat& c, int ctype, bool calcAbs=false);\nCV_EXPORTS void multiply(const Mat& a, const Mat& b, Mat& c, double alpha=1);\nCV_EXPORTS void divide(const Mat& a, const Mat& b, Mat& c, double alpha=1);\n\nCV_EXPORTS void convert(const Mat& src, Mat& dst, int dtype, double alpha=1, double beta=0);\nCV_EXPORTS void copy(const Mat& src, Mat& dst, const Mat& mask=Mat(), bool invertMask=false);\nCV_EXPORTS void set(Mat& dst, const Scalar& gamma, const Mat& mask=Mat());\n\n// working with multi-channel arrays\nCV_EXPORTS void extract( const Mat& a, Mat& plane, int coi );\nCV_EXPORTS void insert( const Mat& plane, Mat& a, int coi );\n\n// checks that the array does not have NaNs and/or Infs and all the elements are\n// within [min_val,max_val). idx is the index of the first \"bad\" element.\nCV_EXPORTS int check( const Mat& data, double min_val, double max_val, vector<int>* idx );\n\n// modifies values that are close to zero\nCV_EXPORTS void  patchZeros( Mat& mat, double level );\n\nCV_EXPORTS void transpose(const Mat& src, Mat& dst);\nCV_EXPORTS void erode(const Mat& src, Mat& dst, const Mat& _kernel, Point anchor=Point(-1,-1),\n                      int borderType=IPL_BORDER_CONSTANT, const Scalar& borderValue=Scalar());\nCV_EXPORTS void dilate(const Mat& src, Mat& dst, const Mat& _kernel, Point anchor=Point(-1,-1),\n                       int borderType=IPL_BORDER_CONSTANT, const Scalar& borderValue=Scalar());\nCV_EXPORTS void filter2D(const Mat& src, Mat& dst, int ddepth, const Mat& kernel,\n                         Point anchor, double delta, int borderType,\n                         const Scalar& borderValue=Scalar());\nCV_EXPORTS void copyMakeBorder(const Mat& src, Mat& dst, int top, int bottom, int left, int right,\n                               int borderType, const Scalar& borderValue=Scalar());\nCV_EXPORTS Mat calcSobelKernel2D( int dx, int dy, int apertureSize, int origin=0 );\nCV_EXPORTS Mat calcLaplaceKernel2D( int aperture_size );\n\nCV_EXPORTS void initUndistortMap( const Mat& a, const Mat& k, Size sz, Mat& mapx, Mat& mapy );\n\nCV_EXPORTS void minMaxLoc(const Mat& src, double* minval, double* maxval,\n                          vector<int>* minloc, vector<int>* maxloc, const Mat& mask=Mat());\nCV_EXPORTS double norm(const Mat& src, int normType, const Mat& mask=Mat());\nCV_EXPORTS double norm(const Mat& src1, const Mat& src2, int normType, const Mat& mask=Mat());\nCV_EXPORTS Scalar mean(const Mat& src, const Mat& mask=Mat());\n\nCV_EXPORTS bool cmpUlps(const Mat& data, const Mat& refdata, int expMaxDiff, double* realMaxDiff, vector<int>* idx);\n\n// compares two arrays. max_diff is the maximum actual difference,\n// success_err_level is maximum allowed difference, idx is the index of the first\n// element for which difference is >success_err_level\n// (or index of element with the maximum difference)\nCV_EXPORTS int cmpEps( const Mat& data, const Mat& refdata, double* max_diff,\n                       double success_err_level, vector<int>* idx,\n                       bool element_wise_relative_error );\n\n// a wrapper for the previous function. in case of error prints the message to log file.\nCV_EXPORTS int cmpEps2( TS* ts, const Mat& data, const Mat& refdata, double success_err_level,\n                        bool element_wise_relative_error, const char* desc );\n\nCV_EXPORTS int cmpEps2_64f( TS* ts, const double* val, const double* refval, int len,\n                        double eps, const char* param_name );\n\nCV_EXPORTS void logicOp(const Mat& src1, const Mat& src2, Mat& dst, char c);\nCV_EXPORTS void logicOp(const Mat& src, const Scalar& s, Mat& dst, char c);\nCV_EXPORTS void min(const Mat& src1, const Mat& src2, Mat& dst);\nCV_EXPORTS void min(const Mat& src, double s, Mat& dst);\nCV_EXPORTS void max(const Mat& src1, const Mat& src2, Mat& dst);\nCV_EXPORTS void max(const Mat& src, double s, Mat& dst);\n\nCV_EXPORTS void compare(const Mat& src1, const Mat& src2, Mat& dst, int cmpop);\nCV_EXPORTS void compare(const Mat& src, double s, Mat& dst, int cmpop);\nCV_EXPORTS void gemm(const Mat& src1, const Mat& src2, double alpha,\n                     const Mat& src3, double beta, Mat& dst, int flags);\n    CV_EXPORTS void transform( const Mat& src, Mat& dst, const Mat& transmat, const Mat& shift );\nCV_EXPORTS double crossCorr(const Mat& src1, const Mat& src2);\n\nstruct CV_EXPORTS MatInfo\n{\n    MatInfo(const Mat& _m) : m(&_m) {}\n    const Mat* m;\n};\n\nCV_EXPORTS std::ostream& operator << (std::ostream& out, const MatInfo& m);\n\nstruct CV_EXPORTS MatComparator\n{\npublic:\n    MatComparator(double maxdiff, int context);\n\n    ::testing::AssertionResult operator()(const char* expr1, const char* expr2,\n                                          const Mat& m1, const Mat& m2);\n\n    double maxdiff;\n    double realmaxdiff;\n    vector<int> loc0;\n    int context;\n};\n\n\n\nclass BaseTest;\nclass TS;\n\nclass CV_EXPORTS BaseTest\n{\npublic:\n    // constructor(s) and destructor\n    BaseTest();\n    virtual ~BaseTest();\n\n    // the main procedure of the test\n    virtual void run( int start_from );\n\n    // the wrapper for run that cares of exceptions\n    virtual void safe_run( int start_from=0 );\n\n    const string& get_name() const { return name; }\n\n    // returns true if and only if the different test cases do not depend on each other\n    // (so that test system could get right to a problematic test case)\n    virtual bool can_do_fast_forward();\n\n    // deallocates all the memory.\n    // called by init() (before initialization) and by the destructor\n    virtual void clear();\n\nprotected:\n    int test_case_count; // the total number of test cases\n\n    // read test params\n    virtual int read_params( CvFileStorage* fs );\n\n    // returns the number of tests or -1 if it is unknown a-priori\n    virtual int get_test_case_count();\n\n    // prepares data for the next test case. rng seed is updated by the function\n    virtual int prepare_test_case( int test_case_idx );\n\n    // checks if the test output is valid and accurate\n    virtual int validate_test_results( int test_case_idx );\n\n    // calls the tested function. the method is called from run_test_case()\n    virtual void run_func(); // runs tested func(s)\n\n    // updates progress bar\n    virtual int update_progress( int progress, int test_case_idx, int count, double dt );\n\n    // finds test parameter\n    const CvFileNode* find_param( CvFileStorage* fs, const char* param_name );\n\n    // name of the test (it is possible to locate a test by its name)\n    string name;\n\n    // pointer to the system that includes the test\n    TS* ts;\n};\n\n\n/*****************************************************************************************\\\n*                               Information about a failed test                           *\n\\*****************************************************************************************/\n\nstruct TestInfo\n{\n    TestInfo();\n\n    // pointer to the test\n    BaseTest* test;\n\n    // failure code (CV_FAIL*)\n    int code;\n\n    // seed value right before the data for the failed test case is prepared.\n    uint64 rng_seed;\n\n    // seed value right before running the test\n    uint64 rng_seed0;\n\n    // index of test case, can be then passed to BaseTest::proceed_to_test_case()\n    int test_case_idx;\n};\n\n/*****************************************************************************************\\\n*                                 Base Class for test system                              *\n\\*****************************************************************************************/\n\n// common parameters:\nstruct CV_EXPORTS TSParams\n{\n    TSParams();\n\n    // RNG seed, passed to and updated by every test executed.\n    uint64 rng_seed;\n\n    // whether to use IPP, MKL etc. or not\n    bool use_optimized;\n\n    // extensivity of the tests, scale factor for test_case_count\n    double test_case_count_scale;\n};\n\n\nclass CV_EXPORTS TS\n{\npublic:\n    // constructor(s) and destructor\n    TS();\n    virtual ~TS();\n\n    enum\n    {\n        NUL=0,\n        SUMMARY_IDX=0,\n        SUMMARY=1 << SUMMARY_IDX,\n        LOG_IDX=1,\n        LOG=1 << LOG_IDX,\n        CSV_IDX=2,\n        CSV=1 << CSV_IDX,\n        CONSOLE_IDX=3,\n        CONSOLE=1 << CONSOLE_IDX,\n        MAX_IDX=4\n    };\n\n    static TS* ptr();\n\n    // initialize test system before running the first test\n    virtual void init( const string& modulename );\n\n    // low-level printing functions that are used by individual tests and by the system itself\n    virtual void printf( int streams, const char* fmt, ... );\n    virtual void vprintf( int streams, const char* fmt, va_list arglist );\n\n    // updates the context: current test, test case, rng state\n    virtual void update_context( BaseTest* test, int test_case_idx, bool update_ts_context );\n\n    const TestInfo* get_current_test_info() { return &current_test_info; }\n\n    // sets information about a failed test\n    virtual void set_failed_test_info( int fail_code );\n\n    virtual void set_gtest_status();\n\n    // test error codes\n    enum\n    {\n        // everything is Ok\n        OK=0,\n\n        // generic error: stub value to be used\n        // temporarily if the error's cause is unknown\n        FAIL_GENERIC=-1,\n\n        // the test is missing some essential data to proceed further\n        FAIL_MISSING_TEST_DATA=-2,\n\n        // the tested function raised an error via cxcore error handler\n        FAIL_ERROR_IN_CALLED_FUNC=-3,\n\n        // an exception has been raised;\n        // for memory and arithmetic exception\n        // there are two specialized codes (see below...)\n        FAIL_EXCEPTION=-4,\n\n        // a memory exception\n        // (access violation, access to missed page, stack overflow etc.)\n        FAIL_MEMORY_EXCEPTION=-5,\n\n        // arithmetic exception (overflow, division by zero etc.)\n        FAIL_ARITHM_EXCEPTION=-6,\n\n        // the tested function corrupted memory (no exception have been raised)\n        FAIL_MEMORY_CORRUPTION_BEGIN=-7,\n        FAIL_MEMORY_CORRUPTION_END=-8,\n\n        // the tested function (or test ifself) do not deallocate some memory\n        FAIL_MEMORY_LEAK=-9,\n\n        // the tested function returned invalid object, e.g. matrix, containing NaNs,\n        // structure with NULL or out-of-range fields (while it should not)\n        FAIL_INVALID_OUTPUT=-10,\n\n        // the tested function returned valid object, but it does not match to\n        // the original (or produced by the test) object\n        FAIL_MISMATCH=-11,\n\n        // the tested function returned valid object (a single number or numerical array),\n        // but it differs too much from the original (or produced by the test) object\n        FAIL_BAD_ACCURACY=-12,\n\n        // the tested function hung. Sometimes, can be determined by unexpectedly long\n        // processing time (in this case there should be possibility to interrupt such a function\n        FAIL_HANG=-13,\n\n        // unexpected response on passing bad arguments to the tested function\n        // (the function crashed, proceed successfully (while it should not), or returned\n        // error code that is different from what is expected)\n        FAIL_BAD_ARG_CHECK=-14,\n\n        // the test data (in whole or for the particular test case) is invalid\n        FAIL_INVALID_TEST_DATA=-15,\n\n        // the test has been skipped because it is not in the selected subset of the tests to run,\n        // because it has been run already within the same run with the same parameters, or because\n        // of some other reason and this is not considered as an error.\n        // Normally TS::run() (or overridden method in the derived class) takes care of what\n        // needs to be run, so this code should not occur.\n        SKIPPED=1\n    };\n\n    // get file storage\n    CvFileStorage* get_file_storage();\n\n    // get RNG to generate random input data for a test\n    RNG& get_rng() { return rng; }\n\n    // returns the current error code\n    int get_err_code() { return current_test_info.code; }\n\n    // returns the test extensivity scale\n    double get_test_case_count_scale() { return params.test_case_count_scale; }\n\n    const string& get_data_path() const { return data_path; }\n\n    // returns textual description of failure code\n    static string str_from_code( int code );\n\nprotected:\n\n    // these are allocated within a test to try keep them valid in case of stack corruption\n    RNG rng;\n\n    // information about the current test\n    TestInfo current_test_info;\n\n    // the path to data files used by tests\n    string data_path;\n\n    TSParams params;\n    std::string output_buf[MAX_IDX];\n};\n\n\n/*****************************************************************************************\\\n*            Subclass of BaseTest for testing functions that process dense arrays           *\n\\*****************************************************************************************/\n\nclass CV_EXPORTS ArrayTest : public BaseTest\n{\npublic:\n    // constructor(s) and destructor\n    ArrayTest();\n    virtual ~ArrayTest();\n\n    virtual void clear();\n\nprotected:\n\n    virtual int read_params( CvFileStorage* fs );\n    virtual int prepare_test_case( int test_case_idx );\n    virtual int validate_test_results( int test_case_idx );\n\n    virtual void prepare_to_validation( int test_case_idx );\n    virtual void get_test_array_types_and_sizes( int test_case_idx, vector<vector<Size> >& sizes, vector<vector<int> >& types );\n    virtual void fill_array( int test_case_idx, int i, int j, Mat& arr );\n    virtual void get_minmax_bounds( int i, int j, int type, Scalar& low, Scalar& high );\n    virtual double get_success_error_level( int test_case_idx, int i, int j );\n\n    bool cvmat_allowed;\n    bool iplimage_allowed;\n    bool optional_mask;\n    bool element_wise_relative_error;\n\n    int min_log_array_size;\n    int max_log_array_size;\n\n    enum { INPUT, INPUT_OUTPUT, OUTPUT, REF_INPUT_OUTPUT, REF_OUTPUT, TEMP, MASK, MAX_ARR };\n\n    vector<vector<void*> > test_array;\n    vector<vector<Mat> > test_mat;\n    float buf[4];\n};\n\n\nclass CV_EXPORTS BadArgTest : public BaseTest\n{\npublic:\n    // constructor(s) and destructor\n    BadArgTest();\n    virtual ~BadArgTest();\n\nprotected:\n    virtual int run_test_case( int expected_code, const string& descr );\n    virtual void run_func(void) = 0;\n    int test_case_idx;\n    int progress;\n    double t, freq;\n\n    template<class F>\n    int run_test_case( int expected_code, const string& _descr, F f)\n    {\n        double new_t = (double)cv::getTickCount(), dt;\n        if( test_case_idx < 0 )\n        {\n            test_case_idx = 0;\n            progress = 0;\n            dt = 0;\n        }\n        else\n        {\n            dt = (new_t - t)/(freq*1000);\n            t = new_t;\n        }\n        progress = update_progress(progress, test_case_idx, 0, dt);\n\n        int errcount = 0;\n        bool thrown = false;\n        const char* descr = _descr.c_str() ? _descr.c_str() : \"\";\n\n        try\n        {\n            f();\n        }\n        catch(const cv::Exception& e)\n        {\n            thrown = true;\n            if( e.code != expected_code )\n            {\n                ts->printf(TS::LOG, \"%s (test case #%d): the error code %d is different from the expected %d\\n\",\n                    descr, test_case_idx, e.code, expected_code);\n                errcount = 1;\n            }\n        }\n        catch(...)\n        {\n            thrown = true;\n            ts->printf(TS::LOG, \"%s  (test case #%d): unknown exception was thrown (the function has likely crashed)\\n\",\n                       descr, test_case_idx);\n            errcount = 1;\n        }\n        if(!thrown)\n        {\n            ts->printf(TS::LOG, \"%s  (test case #%d): no expected exception was thrown\\n\",\n                       descr, test_case_idx);\n            errcount = 1;\n        }\n        test_case_idx++;\n\n        return errcount;\n    }\n};\n\nstruct CV_EXPORTS DefaultRngAuto\n{\n    const uint64 old_state;\n\n    DefaultRngAuto() : old_state(cv::theRNG().state) { cv::theRNG().state = (uint64)-1; }\n    ~DefaultRngAuto() { cv::theRNG().state = old_state; }\n\n    DefaultRngAuto& operator=(const DefaultRngAuto&);\n};\n\n}\n\nnamespace cvtest\n{\n\n// test images generation functions\nCV_EXPORTS void fillGradient(Mat& img, int delta = 5);\nCV_EXPORTS void smoothBorder(Mat& img, const Scalar& color, int delta = 3);\n\nCV_EXPORTS void printVersionInfo(bool useStdOut = true);\n} //namespace cvtest\n\n// fills c with zeros\nCV_EXPORTS void cvTsZero( CvMat* c, const CvMat* mask=0 );\n\n// copies a to b (whole matrix or only the selected region)\nCV_EXPORTS void cvTsCopy( const CvMat* a, CvMat* b, const CvMat* mask=0 );\n\n// converts one array to another\nCV_EXPORTS void  cvTsConvert( const CvMat* src, CvMat* dst );\n\nCV_EXPORTS void cvTsGEMM( const CvMat* a, const CvMat* b, double alpha,\n                         const CvMat* c, double beta, CvMat* d, int flags );\n\n#ifndef __CV_TEST_EXEC_ARGS\n#if defined(_MSC_VER) && (_MSC_VER <= 1400)\n#define __CV_TEST_EXEC_ARGS(...)    \\\n    while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\n#else\n#define __CV_TEST_EXEC_ARGS(...)    \\\n    __VA_ARGS__;\n#endif\n#endif\n\n#define CV_TEST_MAIN(resourcesubdir, ...) \\\nint main(int argc, char **argv) \\\n{ \\\n    cvtest::TS::ptr()->init(resourcesubdir); \\\n    ::testing::InitGoogleTest(&argc, argv); \\\n    cvtest::printVersionInfo(); \\\n    __CV_TEST_EXEC_ARGS(__VA_ARGS__) \\\n    return RUN_ALL_TESTS(); \\\n}\n\n// This usually only makes sense in perf tests with several implementations,\n// some of which are not available.\n#define CV_TEST_FAIL_NO_IMPL() do { \\\n    ::testing::Test::RecordProperty(\"custom_status\", \"noimpl\"); \\\n    FAIL() << \"No equivalent implementation.\"; \\\n} while (0)\n\n#endif\n\n#include \"ts_perf.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/ts/ts_gtest.h",
    "content": "// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: wan@google.com (Zhanyong Wan)\n//\n// The Google C++ Testing Framework (Google Test)\n//\n// This header file defines the public API for Google Test.  It should be\n// included by any test program that uses Google Test.\n//\n// IMPORTANT NOTE: Due to limitation of the C++ language, we have to\n// leave some internal implementation details in this header file.\n// They are clearly marked by comments like this:\n//\n//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n//\n// Such code is NOT meant to be used by a user directly, and is subject\n// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user\n// program!\n//\n// Acknowledgment: Google Test borrowed the idea of automatic test\n// registration from Barthelemy Dagenais' (barthelemy@prologique.com)\n// easyUnit framework.\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_H_\n#define GTEST_INCLUDE_GTEST_GTEST_H_\n\n#include <limits>\n#include <ostream>\n#include <vector>\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)\n//\n// The Google C++ Testing Framework (Google Test)\n//\n// This header file declares functions and macros used internally by\n// Google Test.  They are subject to change without notice.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Authors: wan@google.com (Zhanyong Wan)\n//\n// Low-level types and utilities for porting Google Test to various\n// platforms.  They are subject to change without notice.  DO NOT USE\n// THEM IN USER CODE.\n//\n// This file is fundamental to Google Test.  All other Google Test source\n// files are expected to #include this.  Therefore, it cannot #include\n// any other Google Test header.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_\n\n// The user can define the following macros in the build script to\n// control Google Test's behavior.  If the user doesn't define a macro\n// in this list, Google Test will define it.\n//\n//   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)\n//                              is/isn't available.\n//   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions\n//                              are enabled.\n//   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string\n//                              is/isn't available (some systems define\n//                              ::string, which is different to std::string).\n//   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string\n//                              is/isn't available (some systems define\n//                              ::wstring, which is different to std::wstring).\n//   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular\n//                              expressions are/aren't available.\n//   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>\n//                              is/isn't available.\n//   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't\n//                              enabled.\n//   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that\n//                              std::wstring does/doesn't work (Google Test can\n//                              be used where std::wstring is unavailable).\n//   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple\n//                              is/isn't available.\n//   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the\n//                              compiler supports Microsoft's \"Structured\n//                              Exception Handling\".\n//   GTEST_HAS_STREAM_REDIRECTION\n//                            - Define it to 1/0 to indicate whether the\n//                              platform supports I/O stream redirection using\n//                              dup() and dup2().\n//   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google\n//                              Test's own tr1 tuple implementation should be\n//                              used.  Unused when the user sets\n//                              GTEST_HAS_TR1_TUPLE to 0.\n//   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test\n//                              is building in C++11/C++98 mode.\n//   GTEST_LINKED_AS_SHARED_LIBRARY\n//                            - Define to 1 when compiling tests that use\n//                              Google Test as a shared library (known as\n//                              DLL on Windows).\n//   GTEST_CREATE_SHARED_LIBRARY\n//                            - Define to 1 when compiling Google Test itself\n//                              as a shared library.\n\n// This header defines the following utilities:\n//\n// Macros indicating the current platform (defined to 1 if compiled on\n// the given platform; otherwise undefined):\n//   GTEST_OS_AIX      - IBM AIX\n//   GTEST_OS_CYGWIN   - Cygwin\n//   GTEST_OS_HPUX     - HP-UX\n//   GTEST_OS_LINUX    - Linux\n//     GTEST_OS_LINUX_ANDROID - Google Android\n//   GTEST_OS_MAC      - Mac OS X\n//     GTEST_OS_IOS    - iOS\n//       GTEST_OS_IOS_SIMULATOR - iOS simulator\n//   GTEST_OS_NACL     - Google Native Client (NaCl)\n//   GTEST_OS_OPENBSD  - OpenBSD\n//   GTEST_OS_QNX      - QNX\n//   GTEST_OS_SOLARIS  - Sun Solaris\n//   GTEST_OS_SYMBIAN  - Symbian\n//   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)\n//     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop\n//     GTEST_OS_WINDOWS_MINGW    - MinGW\n//     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile\n//   GTEST_OS_ZOS      - z/OS\n//\n// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the\n// most stable support.  Since core members of the Google Test project\n// don't have access to other platforms, support for them may be less\n// stable.  If you notice any problems on your platform, please notify\n// googletestframework@googlegroups.com (patches for fixing them are\n// even more welcome!).\n//\n// Note that it is possible that none of the GTEST_OS_* macros are defined.\n//\n// Macros indicating available Google Test features (defined to 1 if\n// the corresponding feature is supported; otherwise undefined):\n//   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized\n//                            tests)\n//   GTEST_HAS_DEATH_TEST   - death tests\n//   GTEST_HAS_PARAM_TEST   - value-parameterized tests\n//   GTEST_HAS_TYPED_TEST   - typed tests\n//   GTEST_HAS_TYPED_TEST_P - type-parameterized tests\n//   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with\n//                            GTEST_HAS_POSIX_RE (see above) which users can\n//                            define themselves.\n//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;\n//                            the above two are mutually exclusive.\n//   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().\n//\n// Macros for basic C++ coding:\n//   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.\n//   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a\n//                              variable don't have to be used.\n//   GTEST_DISALLOW_ASSIGN_   - disables operator=.\n//   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.\n//   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.\n//\n// Synchronization:\n//   Mutex, MutexLock, ThreadLocal, GetThreadCount()\n//                  - synchronization primitives.\n//   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above\n//                         synchronization primitives have real implementations\n//                         and Google Test is thread-safe; or 0 otherwise.\n//\n// Template meta programming:\n//   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.\n//   IteratorTraits - partial implementation of std::iterator_traits, which\n//                    is not available in libCstd when compiled with Sun C++.\n//\n// Smart pointers:\n//   scoped_ptr     - as in TR2.\n//\n// Regular expressions:\n//   RE             - a simple regular expression class using the POSIX\n//                    Extended Regular Expression syntax on UNIX-like\n//                    platforms, or a reduced regular exception syntax on\n//                    other platforms, including Windows.\n//\n// Logging:\n//   GTEST_LOG_()   - logs messages at the specified severity level.\n//   LogToStderr()  - directs all log messages to stderr.\n//   FlushInfoLog() - flushes informational log messages.\n//\n// Stdout and stderr capturing:\n//   CaptureStdout()     - starts capturing stdout.\n//   GetCapturedStdout() - stops capturing stdout and returns the captured\n//                         string.\n//   CaptureStderr()     - starts capturing stderr.\n//   GetCapturedStderr() - stops capturing stderr and returns the captured\n//                         string.\n//\n// Integer types:\n//   TypeWithSize   - maps an integer to a int type.\n//   Int32, UInt32, Int64, UInt64, TimeInMillis\n//                  - integers of known sizes.\n//   BiggestInt     - the biggest signed integer type.\n//\n// Command-line utilities:\n//   GTEST_FLAG()       - references a flag.\n//   GTEST_DECLARE_*()  - declares a flag.\n//   GTEST_DEFINE_*()   - defines a flag.\n//   GetInjectableArgvs() - returns the command line as a vector of strings.\n//\n// Environment variable utilities:\n//   GetEnv()             - gets the value of an environment variable.\n//   BoolFromGTestEnv()   - parses a bool environment variable.\n//   Int32FromGTestEnv()  - parses an Int32 environment variable.\n//   StringFromGTestEnv() - parses a string environment variable.\n\n#include <ctype.h>   // for isspace, etc\n#include <stddef.h>  // for ptrdiff_t\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#ifndef _WIN32_WCE\n# include <sys/types.h>\n# include <sys/stat.h>\n#endif  // !_WIN32_WCE\n\n#if defined __APPLE__\n# include <AvailabilityMacros.h>\n# include <TargetConditionals.h>\n#endif\n\n#include <iostream>  // NOLINT\n#include <sstream>  // NOLINT\n#include <string>  // NOLINT\n\n#define GTEST_DEV_EMAIL_ \"googletestframework@@googlegroups.com\"\n#define GTEST_FLAG_PREFIX_ \"gtest_\"\n#define GTEST_FLAG_PREFIX_DASH_ \"gtest-\"\n#define GTEST_FLAG_PREFIX_UPPER_ \"GTEST_\"\n#define GTEST_NAME_ \"Google Test\"\n#define GTEST_PROJECT_URL_ \"http://code.google.com/p/googletest/\"\n\n// Determines the version of gcc that is used to compile this.\n#ifdef __GNUC__\n// 40302 means version 4.3.2.\n# define GTEST_GCC_VER_ \\\n    (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)\n#endif  // __GNUC__\n\n// Determines the platform on which Google Test is compiled.\n#define GTEST_OS_CYGWIN 0\n#define GTEST_OS_SYMBIAN 0\n#define GTEST_OS_WINDOWS 0\n#define GTEST_OS_WINDOWS_MOBILE 0\n#define GTEST_OS_WINDOWS_MINGW 0\n#define GTEST_OS_WINDOWS_DESKTOP 0\n#define GTEST_OS_MAC 0\n#define GTEST_OS_LINUX 0\n#define GTEST_OS_LINUX_ANDROID 0\n#define GTEST_OS_ZOS 0\n#define GTEST_OS_SOLARIS 0\n#define GTEST_OS_AIX 0\n#define GTEST_OS_HPUX 0\n#define GTEST_OS_NACL 0\n#define GTEST_OS_OPENBSD 0\n#define GTEST_OS_QNX 0\n#define GTEST_OS_IOS 0\n#define GTEST_OS_IOS_SIMULATOR 0\n\n#ifdef __CYGWIN__\n# undef GTEST_OS_CYGWIN\n# define GTEST_OS_CYGWIN 1\n#elif defined __SYMBIAN32__\n# undef GTEST_OS_SYMBIAN\n# define GTEST_OS_SYMBIAN 1\n#elif defined _WIN32\n# undef GTEST_OS_WINDOWS\n# define GTEST_OS_WINDOWS 1\n# ifdef _WIN32_WCE\n#  undef GTEST_OS_WINDOWS_MOBILE\n#  define GTEST_OS_WINDOWS_MOBILE 1\n# elif defined(__MINGW__) || defined(__MINGW32__)\n#  undef GTEST_OS_WINDOWS_MINGW\n#  define GTEST_OS_WINDOWS_MINGW 1\n# else\n#  undef GTEST_OS_WINDOWS_DESKTOP\n#  define GTEST_OS_WINDOWS_DESKTOP 1\n# endif  // _WIN32_WCE\n#elif defined __APPLE__\n# undef GTEST_OS_MAC\n# define GTEST_OS_MAC 1\n# if TARGET_OS_IPHONE\n#  undef GTEST_OS_IOS\n#  define GTEST_OS_IOS 1\n#  if TARGET_IPHONE_SIMULATOR\n#   undef GTEST_OS_IOS_SIMULATOR\n#   define GTEST_OS_IOS_SIMULATOR 1\n#  endif\n# endif\n#elif defined __linux__\n# undef GTEST_OS_LINUX\n# define GTEST_OS_LINUX 1\n# if defined __ANDROID__\n#  undef GTEST_OS_LINUX_ANDROID\n#  define GTEST_OS_LINUX_ANDROID 1\n# endif\n#elif defined __MVS__\n# undef GTEST_OS_ZOS\n# define GTEST_OS_ZOS 1\n#elif defined(__sun) && defined(__SVR4)\n# undef GTEST_OS_SOLARIS\n# define GTEST_OS_SOLARIS 1\n#elif defined(_AIX)\n# undef GTEST_OS_AIX\n# define GTEST_OS_AIX 1\n#elif defined(__hpux)\n# undef GTEST_OS_HPUX\n# define GTEST_OS_HPUX 1\n#elif defined __native_client__\n# undef GTEST_OS_NACL\n# define GTEST_OS_NACL 1\n#elif defined __OpenBSD__\n# undef GTEST_OS_OPENBSD\n# define GTEST_OS_OPENBSD 1\n#elif defined __QNX__\n# undef GTEST_OS_QNX\n# define GTEST_OS_QNX 1\n#endif  // __CYGWIN__\n\n#ifndef GTEST_LANG_CXX11\n// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when\n// -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a\n// value for __cplusplus, and recent versions of clang, gcc, and\n// probably other compilers set that too in C++11 mode.\n# if defined __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L\n// Compiling in at least C++11 mode.\n#  define GTEST_LANG_CXX11 1\n# else\n#  define GTEST_LANG_CXX11 0\n# endif\n#endif\n\n// Brings in definitions for functions used in the testing::internal::posix\n// namespace (read, write, close, chdir, isatty, stat). We do not currently\n// use them on Windows Mobile.\n#if !GTEST_OS_WINDOWS\n// This assumes that non-Windows OSes provide unistd.h. For OSes where this\n// is not the case, we need to include headers that provide the functions\n// mentioned above.\n# include <unistd.h>\n# include <strings.h>\n#elif !GTEST_OS_WINDOWS_MOBILE\n# include <direct.h>\n# include <io.h>\n#endif\n\n#if GTEST_OS_LINUX_ANDROID\n// Used to define __ANDROID_API__ matching the target NDK API level.\n#  include <android/api-level.h>  // NOLINT\n#endif\n\n// Defines this to true iff Google Test can use POSIX regular expressions.\n#ifndef GTEST_HAS_POSIX_RE\n# if GTEST_OS_LINUX_ANDROID\n// On Android, <regex.h> is only available starting with Froyo.\n#  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 8)\n# else\n# define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)\n#endif\n#endif\n\n#if GTEST_HAS_POSIX_RE\n\n// On some platforms, <regex.h> needs someone to define size_t, and\n// won't compile otherwise.  We can #include it here as we already\n// included <stdlib.h>, which is guaranteed to define size_t through\n// <stddef.h>.\n# include <regex.h>  // NOLINT\n\n# define GTEST_USES_POSIX_RE 1\n# define GTEST_USES_SIMPLE_RE 0\n\n#elif GTEST_OS_WINDOWS\n\n// <regex.h> is not available on Windows.  Use our own simple regex\n// implementation instead.\n# define GTEST_USES_SIMPLE_RE 1\n# define GTEST_USES_POSIX_RE  0\n\n#else\n\n// <regex.h> may not be available on this platform.  Use our own\n// simple regex implementation instead.\n# define GTEST_USES_SIMPLE_RE 1\n# define GTEST_USES_POSIX_RE  0\n\n#endif  // GTEST_HAS_POSIX_RE\n\n#ifndef GTEST_HAS_EXCEPTIONS\n// The user didn't tell us whether exceptions are enabled, so we need\n// to figure it out.\n# if defined(_MSC_VER) || defined(__BORLANDC__)\n// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS\n// macro to enable exceptions, so we'll do the same.\n// Assumes that exceptions are enabled by default.\n#  ifndef _HAS_EXCEPTIONS\n#   define _HAS_EXCEPTIONS 1\n#  endif  // _HAS_EXCEPTIONS\n#  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS\n# elif defined(__GNUC__) && __EXCEPTIONS\n// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.\n#  define GTEST_HAS_EXCEPTIONS 1\n# elif defined(__SUNPRO_CC)\n// Sun Pro CC supports exceptions.  However, there is no compile-time way of\n// detecting whether they are enabled or not.  Therefore, we assume that\n// they are enabled unless the user tells us otherwise.\n#  define GTEST_HAS_EXCEPTIONS 1\n# elif defined(__IBMCPP__) && __EXCEPTIONS\n// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.\n#  define GTEST_HAS_EXCEPTIONS 1\n# elif defined(__HP_aCC)\n// Exception handling is in effect by default in HP aCC compiler. It has to\n// be turned of by +noeh compiler option if desired.\n#  define GTEST_HAS_EXCEPTIONS 1\n# else\n// For other compilers, we assume exceptions are disabled to be\n// conservative.\n#  define GTEST_HAS_EXCEPTIONS 0\n# endif  // defined(_MSC_VER) || defined(__BORLANDC__)\n#endif  // GTEST_HAS_EXCEPTIONS\n\n#if !defined(GTEST_HAS_STD_STRING)\n// Even though we don't use this macro any longer, we keep it in case\n// some clients still depend on it.\n# define GTEST_HAS_STD_STRING 1\n#elif !GTEST_HAS_STD_STRING\n// The user told us that ::std::string isn't available.\n# error \"Google Test cannot be used where ::std::string isn't available.\"\n#endif  // !defined(GTEST_HAS_STD_STRING)\n\n#ifndef GTEST_HAS_GLOBAL_STRING\n// The user didn't tell us whether ::string is available, so we need\n// to figure it out.\n\n# define GTEST_HAS_GLOBAL_STRING 0\n\n#endif  // GTEST_HAS_GLOBAL_STRING\n\n#ifndef GTEST_HAS_STD_WSTRING\n// The user didn't tell us whether ::std::wstring is available, so we need\n// to figure it out.\n// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring\n//   is available.\n\n// Cygwin 1.7 and below doesn't support ::std::wstring.\n// Solaris' libc++ doesn't support it either.  Android has\n// no support for it at least as recent as Froyo (2.2).\n# define GTEST_HAS_STD_WSTRING \\\n    (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))\n\n#endif  // GTEST_HAS_STD_WSTRING\n\n#ifndef GTEST_HAS_GLOBAL_WSTRING\n// The user didn't tell us whether ::wstring is available, so we need\n// to figure it out.\n# define GTEST_HAS_GLOBAL_WSTRING \\\n    (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n// Determines whether RTTI is available.\n#ifndef GTEST_HAS_RTTI\n// The user didn't tell us whether RTTI is enabled, so we need to\n// figure it out.\n\n# ifdef _MSC_VER\n\n#  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.\n#   define GTEST_HAS_RTTI 1\n#  else\n#   define GTEST_HAS_RTTI 0\n#  endif\n\n// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.\n# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)\n\n#  ifdef __GXX_RTTI\n// When building against STLport with the Android NDK and with\n// -frtti -fno-exceptions, the build fails at link time with undefined\n// references to __cxa_bad_typeid. Note sure if STL or toolchain bug,\n// so disable RTTI when detected.\n#   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \\\n       !defined(__EXCEPTIONS)\n#    define GTEST_HAS_RTTI 0\n#   else\n#   define GTEST_HAS_RTTI 1\n#   endif  // GTEST_OS_LINUX_ANDROID && _STLPORT_MAJOR && !__EXCEPTIONS\n#  else\n#   define GTEST_HAS_RTTI 0\n#  endif  // __GXX_RTTI\n\n// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends\n// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the\n// first version with C++ support.\n# elif defined(__clang__)\n\n#  define GTEST_HAS_RTTI __has_feature(cxx_rtti)\n\n// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if\n// both the typeid and dynamic_cast features are present.\n# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)\n\n#  ifdef __RTTI_ALL__\n#   define GTEST_HAS_RTTI 1\n#  else\n#   define GTEST_HAS_RTTI 0\n#  endif\n\n# else\n\n// For all other compilers, we assume RTTI is enabled.\n#  define GTEST_HAS_RTTI 1\n\n# endif  // _MSC_VER\n\n#endif  // GTEST_HAS_RTTI\n\n// It's this header's responsibility to #include <typeinfo> when RTTI\n// is enabled.\n#if GTEST_HAS_RTTI\n# include <typeinfo>\n#endif\n\n// Determines whether Google Test can use the pthreads library.\n#ifndef GTEST_HAS_PTHREAD\n// The user didn't tell us explicitly, so we assume pthreads support is\n// available on Linux and Mac.\n//\n// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0\n// to your compiler flags.\n# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \\\n    || GTEST_OS_QNX)\n#endif  // GTEST_HAS_PTHREAD\n\n#if GTEST_HAS_PTHREAD\n// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is\n// true.\n# include <pthread.h>  // NOLINT\n\n// For timespec and nanosleep, used below.\n# include <time.h>  // NOLINT\n#endif\n\n// Determines whether Google Test can use tr1/tuple.  You can define\n// this macro to 0 to prevent Google Test from using tuple (any\n// feature depending on tuple with be disabled in this mode).\n#ifndef GTEST_HAS_TR1_TUPLE\n# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)\n// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.\n#  define GTEST_HAS_TR1_TUPLE 0\n# else\n// The user didn't tell us not to do it, so we assume it's OK.\n# define GTEST_HAS_TR1_TUPLE 1\n# endif\n#endif  // GTEST_HAS_TR1_TUPLE\n\n// Determines whether Google Test's own tr1 tuple implementation\n// should be used.\n#ifndef GTEST_USE_OWN_TR1_TUPLE\n// The user didn't tell us, so we need to figure it out.\n\n// We use our own TR1 tuple if we aren't sure the user has an\n// implementation of it already.  At this time, libstdc++ 4.0.0+ and\n// MSVC 2010 are the only mainstream standard libraries that come\n// with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler\n// pretends to be GCC by defining __GNUC__ and friends, but cannot\n// compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1\n// tuple in a 323 MB Feature Pack download, which we cannot assume the\n// user has.  QNX's QCC compiler is a modified GCC but it doesn't\n// support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,\n// and it can be used with some compilers that define __GNUC__.\n# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \\\n      && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) && !defined(_STLPORT_MAJOR) \\\n      || (defined(_MSC_VER) && _MSC_VER >= 1600)\n#  define GTEST_ENV_HAS_TR1_TUPLE_ 1\n# else\n#  define GTEST_ENV_HAS_TR1_TUPLE_ 0\n# endif\n\n// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used\n// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6\n// can build with clang but need to use gcc4.2's libstdc++).\n# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)\n#  define GTEST_ENV_HAS_STD_TUPLE_ 1\n# else\n#  define GTEST_ENV_HAS_STD_TUPLE_ 0\n# endif\n\n# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_\n#  define GTEST_USE_OWN_TR1_TUPLE 0\n# else\n#  define GTEST_USE_OWN_TR1_TUPLE 1\n#  undef  GTEST_HAS_TR1_TUPLE\n#  define GTEST_HAS_TR1_TUPLE 1\n# endif\n\n#endif  // GTEST_USE_OWN_TR1_TUPLE\n\n// To avoid conditional compilation everywhere, we make it\n// gtest-port.h's responsibility to #include the header implementing\n// tr1/tuple.\n#if GTEST_HAS_TR1_TUPLE\n\n# if GTEST_USE_OWN_TR1_TUPLE\n// This file was GENERATED by command:\n//     pump.py gtest-tuple.h.pump\n// DO NOT EDIT BY HAND!!!\n\n// Copyright 2009 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: wan@google.com (Zhanyong Wan)\n\n// Implements a subset of TR1 tuple needed by Google Test and Google Mock.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_\n\n#include <utility>  // For ::std::pair.\n\n// The compiler used in Symbian has a bug that prevents us from declaring the\n// tuple template as a friend (it complains that tuple is redefined).  This\n// hack bypasses the bug by declaring the members that should otherwise be\n// private as public.\n// Sun Studio versions < 12 also have the above bug.\n#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)\n# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:\n#else\n# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \\\n    template <GTEST_10_TYPENAMES_(U)> friend class tuple; \\\n   private:\n#endif\n\n// GTEST_n_TUPLE_(T) is the type of an n-tuple.\n#define GTEST_0_TUPLE_(T) tuple<>\n#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \\\n    void, void, void>\n#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \\\n    void, void, void>\n#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \\\n    void, void, void>\n#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \\\n    void, void, void>\n#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \\\n    void, void, void>\n#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \\\n    void, void, void>\n#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \\\n    void, void, void>\n#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \\\n    T##7, void, void>\n#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \\\n    T##7, T##8, void>\n#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \\\n    T##7, T##8, T##9>\n\n// GTEST_n_TYPENAMES_(T) declares a list of n typenames.\n#define GTEST_0_TYPENAMES_(T)\n#define GTEST_1_TYPENAMES_(T) typename T##0\n#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1\n#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2\n#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3\n#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4\n#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5\n#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5, typename T##6\n#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5, typename T##6, typename T##7\n#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5, typename T##6, \\\n    typename T##7, typename T##8\n#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5, typename T##6, \\\n    typename T##7, typename T##8, typename T##9\n\n// In theory, defining stuff in the ::std namespace is undefined\n// behavior.  We can do this as we are playing the role of a standard\n// library vendor.\nnamespace std {\nnamespace tr1 {\n\ntemplate <typename T0 = void, typename T1 = void, typename T2 = void,\n    typename T3 = void, typename T4 = void, typename T5 = void,\n    typename T6 = void, typename T7 = void, typename T8 = void,\n    typename T9 = void>\nclass tuple;\n\n// Anything in namespace gtest_internal is Google Test's INTERNAL\n// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.\nnamespace gtest_internal {\n\n// ByRef<T>::type is T if T is a reference; otherwise it's const T&.\ntemplate <typename T>\nstruct ByRef { typedef const T& type; };  // NOLINT\ntemplate <typename T>\nstruct ByRef<T&> { typedef T& type; };  // NOLINT\n\n// A handy wrapper for ByRef.\n#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type\n\n// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This\n// is the same as tr1::add_reference<T>::type.\ntemplate <typename T>\nstruct AddRef { typedef T& type; };  // NOLINT\ntemplate <typename T>\nstruct AddRef<T&> { typedef T& type; };  // NOLINT\n\n// A handy wrapper for AddRef.\n#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type\n\n// A helper for implementing get<k>().\ntemplate <int k> class Get;\n\n// A helper for implementing tuple_element<k, T>.  kIndexValid is true\n// iff k < the number of fields in tuple type T.\ntemplate <bool kIndexValid, int kIndex, class Tuple>\nstruct TupleElement;\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 0, GTEST_10_TUPLE_(T)> {\n  typedef T0 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 1, GTEST_10_TUPLE_(T)> {\n  typedef T1 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 2, GTEST_10_TUPLE_(T)> {\n  typedef T2 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 3, GTEST_10_TUPLE_(T)> {\n  typedef T3 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 4, GTEST_10_TUPLE_(T)> {\n  typedef T4 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 5, GTEST_10_TUPLE_(T)> {\n  typedef T5 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 6, GTEST_10_TUPLE_(T)> {\n  typedef T6 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 7, GTEST_10_TUPLE_(T)> {\n  typedef T7 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 8, GTEST_10_TUPLE_(T)> {\n  typedef T8 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 9, GTEST_10_TUPLE_(T)> {\n  typedef T9 type;\n};\n\n}  // namespace gtest_internal\n\ntemplate <>\nclass tuple<> {\n public:\n  tuple() {}\n  tuple(const tuple& /* t */)  {}\n  tuple& operator=(const tuple& /* t */) { return *this; }\n};\n\ntemplate <GTEST_1_TYPENAMES_(T)>\nclass GTEST_1_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}\n\n  tuple(const tuple& t) : f0_(t.f0_) {}\n\n  template <GTEST_1_TYPENAMES_(U)>\n  tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_1_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_1_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_1_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    return *this;\n  }\n\n  T0 f0_;\n};\n\ntemplate <GTEST_2_TYPENAMES_(T)>\nclass GTEST_2_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),\n      f1_(f1) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}\n\n  template <GTEST_2_TYPENAMES_(U)>\n  tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}\n  template <typename U0, typename U1>\n  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_2_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_2_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n  template <typename U0, typename U1>\n  tuple& operator=(const ::std::pair<U0, U1>& p) {\n    f0_ = p.first;\n    f1_ = p.second;\n    return *this;\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_2_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n};\n\ntemplate <GTEST_3_TYPENAMES_(T)>\nclass GTEST_3_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}\n\n  template <GTEST_3_TYPENAMES_(U)>\n  tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_3_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_3_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_3_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n};\n\ntemplate <GTEST_4_TYPENAMES_(T)>\nclass GTEST_4_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),\n      f3_(f3) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}\n\n  template <GTEST_4_TYPENAMES_(U)>\n  tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_4_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_4_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_4_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n};\n\ntemplate <GTEST_5_TYPENAMES_(T)>\nclass GTEST_5_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,\n      GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_) {}\n\n  template <GTEST_5_TYPENAMES_(U)>\n  tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_5_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_5_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_5_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n};\n\ntemplate <GTEST_6_TYPENAMES_(T)>\nclass GTEST_6_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),\n      f5_(f5) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_) {}\n\n  template <GTEST_6_TYPENAMES_(U)>\n  tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_6_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_6_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_6_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n};\n\ntemplate <GTEST_7_TYPENAMES_(T)>\nclass GTEST_7_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),\n      f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}\n\n  template <GTEST_7_TYPENAMES_(U)>\n  tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_7_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_7_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_7_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    f6_ = t.f6_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n  T6 f6_;\n};\n\ntemplate <GTEST_8_TYPENAMES_(T)>\nclass GTEST_8_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,\n      GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),\n      f5_(f5), f6_(f6), f7_(f7) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}\n\n  template <GTEST_8_TYPENAMES_(U)>\n  tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_8_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_8_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_8_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    f6_ = t.f6_;\n    f7_ = t.f7_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n  T6 f6_;\n  T7 f7_;\n};\n\ntemplate <GTEST_9_TYPENAMES_(T)>\nclass GTEST_9_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,\n      GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),\n      f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}\n\n  template <GTEST_9_TYPENAMES_(U)>\n  tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_9_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_9_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_9_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    f6_ = t.f6_;\n    f7_ = t.f7_;\n    f8_ = t.f8_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n  T6 f6_;\n  T7 f7_;\n  T8 f8_;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nclass tuple {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),\n      f9_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,\n      GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),\n      f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}\n\n  template <GTEST_10_TYPENAMES_(U)>\n  tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),\n      f9_(t.f9_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_10_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_10_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_10_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    f6_ = t.f6_;\n    f7_ = t.f7_;\n    f8_ = t.f8_;\n    f9_ = t.f9_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n  T6 f6_;\n  T7 f7_;\n  T8 f8_;\n  T9 f9_;\n};\n\n// 6.1.3.2 Tuple creation functions.\n\n// Known limitations: we don't support passing an\n// std::tr1::reference_wrapper<T> to make_tuple().  And we don't\n// implement tie().\n\ninline tuple<> make_tuple() { return tuple<>(); }\n\ntemplate <GTEST_1_TYPENAMES_(T)>\ninline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {\n  return GTEST_1_TUPLE_(T)(f0);\n}\n\ntemplate <GTEST_2_TYPENAMES_(T)>\ninline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {\n  return GTEST_2_TUPLE_(T)(f0, f1);\n}\n\ntemplate <GTEST_3_TYPENAMES_(T)>\ninline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {\n  return GTEST_3_TUPLE_(T)(f0, f1, f2);\n}\n\ntemplate <GTEST_4_TYPENAMES_(T)>\ninline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3) {\n  return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);\n}\n\ntemplate <GTEST_5_TYPENAMES_(T)>\ninline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4) {\n  return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);\n}\n\ntemplate <GTEST_6_TYPENAMES_(T)>\ninline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5) {\n  return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);\n}\n\ntemplate <GTEST_7_TYPENAMES_(T)>\ninline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5, const T6& f6) {\n  return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);\n}\n\ntemplate <GTEST_8_TYPENAMES_(T)>\ninline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {\n  return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);\n}\n\ntemplate <GTEST_9_TYPENAMES_(T)>\ninline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,\n    const T8& f8) {\n  return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);\n}\n\ntemplate <GTEST_10_TYPENAMES_(T)>\ninline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,\n    const T8& f8, const T9& f9) {\n  return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);\n}\n\n// 6.1.3.3 Tuple helper classes.\n\ntemplate <typename Tuple> struct tuple_size;\n\ntemplate <GTEST_0_TYPENAMES_(T)>\nstruct tuple_size<GTEST_0_TUPLE_(T)> {\n  static const int value = 0;\n};\n\ntemplate <GTEST_1_TYPENAMES_(T)>\nstruct tuple_size<GTEST_1_TUPLE_(T)> {\n  static const int value = 1;\n};\n\ntemplate <GTEST_2_TYPENAMES_(T)>\nstruct tuple_size<GTEST_2_TUPLE_(T)> {\n  static const int value = 2;\n};\n\ntemplate <GTEST_3_TYPENAMES_(T)>\nstruct tuple_size<GTEST_3_TUPLE_(T)> {\n  static const int value = 3;\n};\n\ntemplate <GTEST_4_TYPENAMES_(T)>\nstruct tuple_size<GTEST_4_TUPLE_(T)> {\n  static const int value = 4;\n};\n\ntemplate <GTEST_5_TYPENAMES_(T)>\nstruct tuple_size<GTEST_5_TUPLE_(T)> {\n  static const int value = 5;\n};\n\ntemplate <GTEST_6_TYPENAMES_(T)>\nstruct tuple_size<GTEST_6_TUPLE_(T)> {\n  static const int value = 6;\n};\n\ntemplate <GTEST_7_TYPENAMES_(T)>\nstruct tuple_size<GTEST_7_TUPLE_(T)> {\n  static const int value = 7;\n};\n\ntemplate <GTEST_8_TYPENAMES_(T)>\nstruct tuple_size<GTEST_8_TUPLE_(T)> {\n  static const int value = 8;\n};\n\ntemplate <GTEST_9_TYPENAMES_(T)>\nstruct tuple_size<GTEST_9_TUPLE_(T)> {\n  static const int value = 9;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct tuple_size<GTEST_10_TUPLE_(T)> {\n  static const int value = 10;\n};\n\ntemplate <int k, class Tuple>\nstruct tuple_element {\n  typedef typename gtest_internal::TupleElement<\n      k < (tuple_size<Tuple>::value), k, Tuple>::type type;\n};\n\n#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type\n\n// 6.1.3.4 Element access.\n\nnamespace gtest_internal {\n\ntemplate <>\nclass Get<0> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))\n  Field(Tuple& t) { return t.f0_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))\n  ConstField(const Tuple& t) { return t.f0_; }\n};\n\ntemplate <>\nclass Get<1> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))\n  Field(Tuple& t) { return t.f1_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))\n  ConstField(const Tuple& t) { return t.f1_; }\n};\n\ntemplate <>\nclass Get<2> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))\n  Field(Tuple& t) { return t.f2_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))\n  ConstField(const Tuple& t) { return t.f2_; }\n};\n\ntemplate <>\nclass Get<3> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))\n  Field(Tuple& t) { return t.f3_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))\n  ConstField(const Tuple& t) { return t.f3_; }\n};\n\ntemplate <>\nclass Get<4> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))\n  Field(Tuple& t) { return t.f4_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))\n  ConstField(const Tuple& t) { return t.f4_; }\n};\n\ntemplate <>\nclass Get<5> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))\n  Field(Tuple& t) { return t.f5_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))\n  ConstField(const Tuple& t) { return t.f5_; }\n};\n\ntemplate <>\nclass Get<6> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))\n  Field(Tuple& t) { return t.f6_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))\n  ConstField(const Tuple& t) { return t.f6_; }\n};\n\ntemplate <>\nclass Get<7> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))\n  Field(Tuple& t) { return t.f7_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))\n  ConstField(const Tuple& t) { return t.f7_; }\n};\n\ntemplate <>\nclass Get<8> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))\n  Field(Tuple& t) { return t.f8_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))\n  ConstField(const Tuple& t) { return t.f8_; }\n};\n\ntemplate <>\nclass Get<9> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))\n  Field(Tuple& t) { return t.f9_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))\n  ConstField(const Tuple& t) { return t.f9_; }\n};\n\n}  // namespace gtest_internal\n\ntemplate <int k, GTEST_10_TYPENAMES_(T)>\nGTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))\nget(GTEST_10_TUPLE_(T)& t) {\n  return gtest_internal::Get<k>::Field(t);\n}\n\ntemplate <int k, GTEST_10_TYPENAMES_(T)>\nGTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))\nget(const GTEST_10_TUPLE_(T)& t) {\n  return gtest_internal::Get<k>::ConstField(t);\n}\n\n// 6.1.3.5 Relational operators\n\n// We only implement == and !=, as we don't have a need for the rest yet.\n\nnamespace gtest_internal {\n\n// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the\n// first k fields of t1 equals the first k fields of t2.\n// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if\n// k1 != k2.\ntemplate <int kSize1, int kSize2>\nstruct SameSizeTuplePrefixComparator;\n\ntemplate <>\nstruct SameSizeTuplePrefixComparator<0, 0> {\n  template <class Tuple1, class Tuple2>\n  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {\n    return true;\n  }\n};\n\ntemplate <int k>\nstruct SameSizeTuplePrefixComparator<k, k> {\n  template <class Tuple1, class Tuple2>\n  static bool Eq(const Tuple1& t1, const Tuple2& t2) {\n    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&\n        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);\n  }\n};\n\n}  // namespace gtest_internal\n\ntemplate <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>\ninline bool operator==(const GTEST_10_TUPLE_(T)& t,\n                       const GTEST_10_TUPLE_(U)& u) {\n  return gtest_internal::SameSizeTuplePrefixComparator<\n      tuple_size<GTEST_10_TUPLE_(T)>::value,\n      tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);\n}\n\ntemplate <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>\ninline bool operator!=(const GTEST_10_TUPLE_(T)& t,\n                       const GTEST_10_TUPLE_(U)& u) { return !(t == u); }\n\n// 6.1.4 Pairs.\n// Unimplemented.\n\n}  // namespace tr1\n}  // namespace std\n\n#undef GTEST_0_TUPLE_\n#undef GTEST_1_TUPLE_\n#undef GTEST_2_TUPLE_\n#undef GTEST_3_TUPLE_\n#undef GTEST_4_TUPLE_\n#undef GTEST_5_TUPLE_\n#undef GTEST_6_TUPLE_\n#undef GTEST_7_TUPLE_\n#undef GTEST_8_TUPLE_\n#undef GTEST_9_TUPLE_\n#undef GTEST_10_TUPLE_\n\n#undef GTEST_0_TYPENAMES_\n#undef GTEST_1_TYPENAMES_\n#undef GTEST_2_TYPENAMES_\n#undef GTEST_3_TYPENAMES_\n#undef GTEST_4_TYPENAMES_\n#undef GTEST_5_TYPENAMES_\n#undef GTEST_6_TYPENAMES_\n#undef GTEST_7_TYPENAMES_\n#undef GTEST_8_TYPENAMES_\n#undef GTEST_9_TYPENAMES_\n#undef GTEST_10_TYPENAMES_\n\n#undef GTEST_DECLARE_TUPLE_AS_FRIEND_\n#undef GTEST_BY_REF_\n#undef GTEST_ADD_REF_\n#undef GTEST_TUPLE_ELEMENT_\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_\n# elif GTEST_ENV_HAS_STD_TUPLE_\n#  include <tuple>\n// C++11 puts its tuple into the ::std namespace rather than\n// ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.\n// This causes undefined behavior, but supported compilers react in\n// the way we intend.\nnamespace std {\nnamespace tr1 {\nusing ::std::get;\nusing ::std::make_tuple;\nusing ::std::tuple;\nusing ::std::tuple_element;\nusing ::std::tuple_size;\n}\n}\n\n# elif GTEST_OS_SYMBIAN\n\n// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to\n// use STLport's tuple implementation, which unfortunately doesn't\n// work as the copy of STLport distributed with Symbian is incomplete.\n// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to\n// use its own tuple implementation.\n#  ifdef BOOST_HAS_TR1_TUPLE\n#   undef BOOST_HAS_TR1_TUPLE\n#  endif  // BOOST_HAS_TR1_TUPLE\n\n// This prevents <boost/tr1/detail/config.hpp>, which defines\n// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.\n#  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED\n#  include <tuple>\n\n# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)\n// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does\n// not conform to the TR1 spec, which requires the header to be <tuple>.\n\n#  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302\n// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,\n// which is #included by <tr1/tuple>, to not compile when RTTI is\n// disabled.  _TR1_FUNCTIONAL is the header guard for\n// <tr1/functional>.  Hence the following #define is a hack to prevent\n// <tr1/functional> from being included.\n#   define _TR1_FUNCTIONAL 1\n#   include <tr1/tuple>\n#   undef _TR1_FUNCTIONAL  // Allows the user to #include\n                        // <tr1/functional> if he chooses to.\n#  else\n#   include <tr1/tuple>  // NOLINT\n#  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302\n\n# else\n// If the compiler is not GCC 4.0+, we assume the user is using a\n// spec-conforming TR1 implementation.\n#  include <tuple>  // NOLINT\n# endif  // GTEST_USE_OWN_TR1_TUPLE\n\n#endif  // GTEST_HAS_TR1_TUPLE\n\n// Determines whether clone(2) is supported.\n// Usually it will only be available on Linux, excluding\n// Linux on the Itanium architecture.\n// Also see http://linux.die.net/man/2/clone.\n#ifndef GTEST_HAS_CLONE\n// The user didn't tell us, so we need to figure it out.\n\n# if GTEST_OS_LINUX && !defined(__ia64__)\n#  if GTEST_OS_LINUX_ANDROID\n// On Android, clone() is only available on ARM starting with Gingerbread.\n#    if (defined(__arm__) || defined(__mips__)) && __ANDROID_API__ >= 9\n#     define GTEST_HAS_CLONE 1\n#    else\n#     define GTEST_HAS_CLONE 0\n#    endif\n#  else\n#  define GTEST_HAS_CLONE 1\n#  endif\n# else\n#  define GTEST_HAS_CLONE 0\n# endif  // GTEST_OS_LINUX && !defined(__ia64__)\n\n#endif  // GTEST_HAS_CLONE\n\n// Determines whether to support stream redirection. This is used to test\n// output correctness and to implement death tests.\n#ifndef GTEST_HAS_STREAM_REDIRECTION\n// By default, we assume that stream redirection is supported on all\n// platforms except known mobile ones.\n# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN\n#  define GTEST_HAS_STREAM_REDIRECTION 0\n# else\n#  define GTEST_HAS_STREAM_REDIRECTION 1\n# endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN\n#endif  // GTEST_HAS_STREAM_REDIRECTION\n\n// Determines whether to support death tests.\n// Google Test does not support death tests for VC 7.1 and earlier as\n// abort() in a VC 7.1 application compiled as GUI in debug config\n// pops up a dialog window that cannot be suppressed programmatically.\n#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \\\n     (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \\\n     (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \\\n     GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \\\n     GTEST_OS_OPENBSD || GTEST_OS_QNX)\n# define GTEST_HAS_DEATH_TEST 1\n# include <vector>  // NOLINT\n#else\n# define GTEST_HAS_DEATH_TEST 0\n#endif\n\n// We don't support MSVC 7.1 with exceptions disabled now.  Therefore\n// all the compilers we care about are adequate for supporting\n// value-parameterized tests.\n#define GTEST_HAS_PARAM_TEST 1\n\n// Determines whether to support type-driven tests.\n\n// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,\n// Sun Pro CC, IBM Visual Age, and HP aCC support.\n#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \\\n    defined(__IBMCPP__) || defined(__HP_aCC)\n# define GTEST_HAS_TYPED_TEST 1\n# define GTEST_HAS_TYPED_TEST_P 1\n#endif\n\n// Determines whether to support Combine(). This only makes sense when\n// value-parameterized tests are enabled.  The implementation doesn't\n// work on Sun Studio since it doesn't understand templated conversion\n// operators.\n#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)\n# define GTEST_HAS_COMBINE 1\n#endif\n\n// Determines whether the system compiler uses UTF-16 for encoding wide strings.\n#define GTEST_WIDE_STRING_USES_UTF16_ \\\n    (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)\n\n// Determines whether test results can be streamed to a socket.\n#if GTEST_OS_LINUX\n# define GTEST_CAN_STREAM_RESULTS_ 1\n#else\n# define GTEST_CAN_STREAM_RESULTS_ 0\n#endif\n\n// Defines some utility macros.\n\n// The GNU compiler emits a warning if nested \"if\" statements are followed by\n// an \"else\" statement and braces are not used to explicitly disambiguate the\n// \"else\" binding.  This leads to problems with code like:\n//\n//   if (gate)\n//     ASSERT_*(condition) << \"Some message\";\n//\n// The \"switch (0) case 0:\" idiom is used to suppress this.\n#ifdef __INTEL_COMPILER\n# define GTEST_AMBIGUOUS_ELSE_BLOCKER_\n#else\n# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT\n#endif\n\n// Use this annotation at the end of a struct/class definition to\n// prevent the compiler from optimizing away instances that are never\n// used.  This is useful when all interesting logic happens inside the\n// c'tor and / or d'tor.  Example:\n//\n//   struct Foo {\n//     Foo() { ... }\n//   } GTEST_ATTRIBUTE_UNUSED_;\n//\n// Also use it after a variable or parameter declaration to tell the\n// compiler the variable/parameter does not have to be used.\n#if defined(__GNUC__) && !defined(COMPILER_ICC)\n# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))\n#else\n# define GTEST_ATTRIBUTE_UNUSED_\n#endif\n\n// A macro to disallow operator=\n// This should be used in the private: declarations for a class.\n#define GTEST_DISALLOW_ASSIGN_(type)\\\n  void operator=(type const &)\n\n// A macro to disallow copy constructor and operator=\n// This should be used in the private: declarations for a class.\n#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\\\n  type(type const &);\\\n  GTEST_DISALLOW_ASSIGN_(type)\n\n// Tell the compiler to warn about unused return values for functions declared\n// with this macro.  The macro should be used on function declarations\n// following the argument list:\n//\n//   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;\n#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)\n# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))\n#else\n# define GTEST_MUST_USE_RESULT_\n#endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC\n\n// Determine whether the compiler supports Microsoft's Structured Exception\n// Handling.  This is supported by several Windows compilers but generally\n// does not exist on any other system.\n#ifndef GTEST_HAS_SEH\n// The user didn't tell us, so we need to figure it out.\n\n# if defined(_MSC_VER) || defined(__BORLANDC__)\n// These two compilers are known to support SEH.\n#  define GTEST_HAS_SEH 1\n# else\n// Assume no SEH.\n#  define GTEST_HAS_SEH 0\n# endif\n\n#endif  // GTEST_HAS_SEH\n\n#ifdef _MSC_VER\n\n# if GTEST_LINKED_AS_SHARED_LIBRARY\n#  define GTEST_API_ __declspec(dllimport)\n# elif GTEST_CREATE_SHARED_LIBRARY\n#  define GTEST_API_ __declspec(dllexport)\n# endif\n\n#endif  // _MSC_VER\n\n#ifndef GTEST_API_\n# define GTEST_API_\n#endif\n\n#ifdef __GNUC__\n// Ask the compiler to never inline a given function.\n# define GTEST_NO_INLINE_ __attribute__((noinline))\n#else\n# define GTEST_NO_INLINE_\n#endif\n\n// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.\n#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)\n# define GTEST_HAS_CXXABI_H_ 1\n#else\n# define GTEST_HAS_CXXABI_H_ 0\n#endif\n\nnamespace testing {\n\nclass Message;\n\nnamespace internal {\n\n// A secret type that Google Test users don't know about.  It has no\n// definition on purpose.  Therefore it's impossible to create a\n// Secret object, which is what we want.\nclass Secret;\n\n// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time\n// expression is true. For example, you could use it to verify the\n// size of a static array:\n//\n//   GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,\n//                         content_type_names_incorrect_size);\n//\n// or to make sure a struct is smaller than a certain size:\n//\n//   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);\n//\n// The second argument to the macro is the name of the variable. If\n// the expression is false, most compilers will issue a warning/error\n// containing the name of the variable.\n\ntemplate <bool>\nstruct CompileAssert {\n};\n\n#define GTEST_COMPILE_ASSERT_(expr, msg) \\\n  typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \\\n      msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_\n\n// Implementation details of GTEST_COMPILE_ASSERT_:\n//\n// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1\n//   elements (and thus is invalid) when the expression is false.\n//\n// - The simpler definition\n//\n//    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]\n//\n//   does not work, as gcc supports variable-length arrays whose sizes\n//   are determined at run-time (this is gcc's extension and not part\n//   of the C++ standard).  As a result, gcc fails to reject the\n//   following code with the simple definition:\n//\n//     int foo;\n//     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is\n//                                      // not a compile-time constant.\n//\n// - By using the type CompileAssert<(bool(expr))>, we ensures that\n//   expr is a compile-time constant.  (Template arguments must be\n//   determined at compile-time.)\n//\n// - The outter parentheses in CompileAssert<(bool(expr))> are necessary\n//   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written\n//\n//     CompileAssert<bool(expr)>\n//\n//   instead, these compilers will refuse to compile\n//\n//     GTEST_COMPILE_ASSERT_(5 > 0, some_message);\n//\n//   (They seem to think the \">\" in \"5 > 0\" marks the end of the\n//   template argument list.)\n//\n// - The array size is (bool(expr) ? 1 : -1), instead of simply\n//\n//     ((expr) ? 1 : -1).\n//\n//   This is to avoid running into a bug in MS VC 7.1, which\n//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.\n\n// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.\n//\n// This template is declared, but intentionally undefined.\ntemplate <typename T1, typename T2>\nstruct StaticAssertTypeEqHelper;\n\ntemplate <typename T>\nstruct StaticAssertTypeEqHelper<T, T> {};\n\n#if GTEST_HAS_GLOBAL_STRING\ntypedef ::string string;\n#else\ntypedef ::std::string string;\n#endif  // GTEST_HAS_GLOBAL_STRING\n\n#if GTEST_HAS_GLOBAL_WSTRING\ntypedef ::wstring wstring;\n#elif GTEST_HAS_STD_WSTRING\ntypedef ::std::wstring wstring;\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n// A helper for suppressing warnings on constant condition.  It just\n// returns 'condition'.\nGTEST_API_ bool IsTrue(bool condition);\n\n// Defines scoped_ptr.\n\n// This implementation of scoped_ptr is PARTIAL - it only contains\n// enough stuff to satisfy Google Test's need.\ntemplate <typename T>\nclass scoped_ptr {\n public:\n  typedef T element_type;\n\n  explicit scoped_ptr(T* p = NULL) : ptr_(p) {}\n  ~scoped_ptr() { reset(); }\n\n  T& operator*() const { return *ptr_; }\n  T* operator->() const { return ptr_; }\n  T* get() const { return ptr_; }\n\n  T* release() {\n    T* const ptr = ptr_;\n    ptr_ = NULL;\n    return ptr;\n  }\n\n  void reset(T* p = NULL) {\n    if (p != ptr_) {\n      if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.\n        delete ptr_;\n      }\n      ptr_ = p;\n    }\n  }\n\n private:\n  T* ptr_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);\n};\n\n// Defines RE.\n\n// A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended\n// Regular Expression syntax.\nclass GTEST_API_ RE {\n public:\n  // A copy constructor is required by the Standard to initialize object\n  // references from r-values.\n  RE(const RE& other) { Init(other.pattern()); }\n\n  // Constructs an RE from a string.\n  RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT\n\n#if GTEST_HAS_GLOBAL_STRING\n\n  RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT\n\n#endif  // GTEST_HAS_GLOBAL_STRING\n\n  RE(const char* regex) { Init(regex); }  // NOLINT\n  ~RE();\n\n  // Returns the string representation of the regex.\n  const char* pattern() const { return pattern_; }\n\n  // FullMatch(str, re) returns true iff regular expression re matches\n  // the entire str.\n  // PartialMatch(str, re) returns true iff regular expression re\n  // matches a substring of str (including str itself).\n  //\n  // TODO(wan@google.com): make FullMatch() and PartialMatch() work\n  // when str contains NUL characters.\n  static bool FullMatch(const ::std::string& str, const RE& re) {\n    return FullMatch(str.c_str(), re);\n  }\n  static bool PartialMatch(const ::std::string& str, const RE& re) {\n    return PartialMatch(str.c_str(), re);\n  }\n\n#if GTEST_HAS_GLOBAL_STRING\n\n  static bool FullMatch(const ::string& str, const RE& re) {\n    return FullMatch(str.c_str(), re);\n  }\n  static bool PartialMatch(const ::string& str, const RE& re) {\n    return PartialMatch(str.c_str(), re);\n  }\n\n#endif  // GTEST_HAS_GLOBAL_STRING\n\n  static bool FullMatch(const char* str, const RE& re);\n  static bool PartialMatch(const char* str, const RE& re);\n\n private:\n  void Init(const char* regex);\n\n  // We use a const char* instead of an std::string, as Google Test used to be\n  // used where std::string is not available.  TODO(wan@google.com): change to\n  // std::string.\n  const char* pattern_;\n  bool is_valid_;\n\n#if GTEST_USES_POSIX_RE\n\n  regex_t full_regex_;     // For FullMatch().\n  regex_t partial_regex_;  // For PartialMatch().\n\n#else  // GTEST_USES_SIMPLE_RE\n\n  const char* full_pattern_;  // For FullMatch();\n\n#endif\n\n  GTEST_DISALLOW_ASSIGN_(RE);\n};\n\n// Formats a source file path and a line number as they would appear\n// in an error message from the compiler used to compile this code.\nGTEST_API_ ::std::string FormatFileLocation(const char* file, int line);\n\n// Formats a file location for compiler-independent XML output.\n// Although this function is not platform dependent, we put it next to\n// FormatFileLocation in order to contrast the two functions.\nGTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,\n                                                               int line);\n\n// Defines logging utilities:\n//   GTEST_LOG_(severity) - logs messages at the specified severity level. The\n//                          message itself is streamed into the macro.\n//   LogToStderr()  - directs all log messages to stderr.\n//   FlushInfoLog() - flushes informational log messages.\n\nenum GTestLogSeverity {\n  GTEST_INFO,\n  GTEST_WARNING,\n  GTEST_ERROR,\n  GTEST_FATAL\n};\n\n// Formats log entry severity, provides a stream object for streaming the\n// log message, and terminates the message with a newline when going out of\n// scope.\nclass GTEST_API_ GTestLog {\n public:\n  GTestLog(GTestLogSeverity severity, const char* file, int line);\n\n  // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.\n  ~GTestLog();\n\n  ::std::ostream& GetStream() { return ::std::cerr; }\n\n private:\n  const GTestLogSeverity severity_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);\n};\n\n#define GTEST_LOG_(severity) \\\n    ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \\\n                                  __FILE__, __LINE__).GetStream()\n\ninline void LogToStderr() {}\ninline void FlushInfoLog() { fflush(NULL); }\n\n// INTERNAL IMPLEMENTATION - DO NOT USE.\n//\n// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition\n// is not satisfied.\n//  Synopsys:\n//    GTEST_CHECK_(boolean_condition);\n//     or\n//    GTEST_CHECK_(boolean_condition) << \"Additional message\";\n//\n//    This checks the condition and if the condition is not satisfied\n//    it prints message about the condition violation, including the\n//    condition itself, plus additional message streamed into it, if any,\n//    and then it aborts the program. It aborts the program irrespective of\n//    whether it is built in the debug mode or not.\n#define GTEST_CHECK_(condition) \\\n    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n    if (::testing::internal::IsTrue(condition)) \\\n      ; \\\n    else \\\n      GTEST_LOG_(FATAL) << \"Condition \" #condition \" failed. \"\n\n// An all-mode assert to verify that the given POSIX-style function\n// call returns 0 (indicating success).  Known limitation: this\n// doesn't expand to a balanced 'if' statement, so enclose the macro\n// in {} if you need to use it as the only statement in an 'if'\n// branch.\n#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \\\n  if (const int gtest_error = (posix_call)) \\\n    GTEST_LOG_(FATAL) << #posix_call << \"failed with error \" \\\n                      << gtest_error\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Use ImplicitCast_ as a safe version of static_cast for upcasting in\n// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a\n// const Foo*).  When you use ImplicitCast_, the compiler checks that\n// the cast is safe.  Such explicit ImplicitCast_s are necessary in\n// surprisingly many situations where C++ demands an exact type match\n// instead of an argument type convertable to a target type.\n//\n// The syntax for using ImplicitCast_ is the same as for static_cast:\n//\n//   ImplicitCast_<ToType>(expr)\n//\n// ImplicitCast_ would have been part of the C++ standard library,\n// but the proposal was submitted too late.  It will probably make\n// its way into the language in the future.\n//\n// This relatively ugly name is intentional. It prevents clashes with\n// similar functions users may have (e.g., implicit_cast). The internal\n// namespace alone is not enough because the function can be found by ADL.\ntemplate<typename To>\ninline To ImplicitCast_(To x) { return x; }\n\n// When you upcast (that is, cast a pointer from type Foo to type\n// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts\n// always succeed.  When you downcast (that is, cast a pointer from\n// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because\n// how do you know the pointer is really of type SubclassOfFoo?  It\n// could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,\n// when you downcast, you should use this macro.  In debug mode, we\n// use dynamic_cast<> to double-check the downcast is legal (we die\n// if it's not).  In normal mode, we do the efficient static_cast<>\n// instead.  Thus, it's important to test in debug mode to make sure\n// the cast is legal!\n//    This is the only place in the code we should use dynamic_cast<>.\n// In particular, you SHOULDN'T be using dynamic_cast<> in order to\n// do RTTI (eg code like this:\n//    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);\n//    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);\n// You should design the code some other way not to need this.\n//\n// This relatively ugly name is intentional. It prevents clashes with\n// similar functions users may have (e.g., down_cast). The internal\n// namespace alone is not enough because the function can be found by ADL.\ntemplate<typename To, typename From>  // use like this: DownCast_<T*>(foo);\ninline To DownCast_(From* f) {  // so we only accept pointers\n  // Ensures that To is a sub-type of From *.  This test is here only\n  // for compile-time type checking, and has no overhead in an\n  // optimized build at run-time, as it will be optimized away\n  // completely.\n  if (false) {\n    const To to = NULL;\n    ::testing::internal::ImplicitCast_<From*>(to);\n  }\n\n#if GTEST_HAS_RTTI\n  // RTTI: debug mode only!\n  GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);\n#endif\n  return static_cast<To>(f);\n}\n\n// Downcasts the pointer of type Base to Derived.\n// Derived must be a subclass of Base. The parameter MUST\n// point to a class of type Derived, not any subclass of it.\n// When RTTI is available, the function performs a runtime\n// check to enforce this.\ntemplate <class Derived, class Base>\nDerived* CheckedDowncastToActualType(Base* base) {\n#if GTEST_HAS_RTTI\n  GTEST_CHECK_(typeid(*base) == typeid(Derived));\n  return dynamic_cast<Derived*>(base);  // NOLINT\n#else\n  return static_cast<Derived*>(base);  // Poor man's downcast.\n#endif\n}\n\n#if GTEST_HAS_STREAM_REDIRECTION\n\n// Defines the stderr capturer:\n//   CaptureStdout     - starts capturing stdout.\n//   GetCapturedStdout - stops capturing stdout and returns the captured string.\n//   CaptureStderr     - starts capturing stderr.\n//   GetCapturedStderr - stops capturing stderr and returns the captured string.\n//\nGTEST_API_ void CaptureStdout();\nGTEST_API_ std::string GetCapturedStdout();\nGTEST_API_ void CaptureStderr();\nGTEST_API_ std::string GetCapturedStderr();\n\n#endif  // GTEST_HAS_STREAM_REDIRECTION\n\n\n#if GTEST_HAS_DEATH_TEST\n\nconst ::std::vector<testing::internal::string>& GetInjectableArgvs();\nvoid SetInjectableArgvs(const ::std::vector<testing::internal::string>*\n                             new_argvs);\n\n// A copy of all command line arguments.  Set by InitGoogleTest().\nextern ::std::vector<testing::internal::string> g_argvs;\n\n#endif  // GTEST_HAS_DEATH_TEST\n\n// Defines synchronization primitives.\n\n#if GTEST_HAS_PTHREAD\n\n// Sleeps for (roughly) n milli-seconds.  This function is only for\n// testing Google Test's own constructs.  Don't use it in user tests,\n// either directly or indirectly.\ninline void SleepMilliseconds(int n) {\n  const timespec time = {\n    0,                  // 0 seconds.\n    n * 1000L * 1000L,  // And n ms.\n  };\n  nanosleep(&time, NULL);\n}\n\n// Allows a controller thread to pause execution of newly created\n// threads until notified.  Instances of this class must be created\n// and destroyed in the controller thread.\n//\n// This class is only for testing Google Test's own constructs. Do not\n// use it in user tests, either directly or indirectly.\nclass Notification {\n public:\n  Notification() : notified_(false) {\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));\n  }\n  ~Notification() {\n    pthread_mutex_destroy(&mutex_);\n  }\n\n  // Notifies all threads created with this notification to start. Must\n  // be called from the controller thread.\n  void Notify() {\n    pthread_mutex_lock(&mutex_);\n    notified_ = true;\n    pthread_mutex_unlock(&mutex_);\n  }\n\n  // Blocks until the controller thread notifies. Must be called from a test\n  // thread.\n  void WaitForNotification() {\n    for (;;) {\n      pthread_mutex_lock(&mutex_);\n      const bool notified = notified_;\n      pthread_mutex_unlock(&mutex_);\n      if (notified)\n        break;\n      SleepMilliseconds(10);\n    }\n  }\n\n private:\n  pthread_mutex_t mutex_;\n  bool notified_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);\n};\n\n// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.\n// Consequently, it cannot select a correct instantiation of ThreadWithParam\n// in order to call its Run(). Introducing ThreadWithParamBase as a\n// non-templated base class for ThreadWithParam allows us to bypass this\n// problem.\nclass ThreadWithParamBase {\n public:\n  virtual ~ThreadWithParamBase() {}\n  virtual void Run() = 0;\n};\n\n// pthread_create() accepts a pointer to a function type with the C linkage.\n// According to the Standard (7.5/1), function types with different linkages\n// are different even if they are otherwise identical.  Some compilers (for\n// example, SunStudio) treat them as different types.  Since class methods\n// cannot be defined with C-linkage we need to define a free C-function to\n// pass into pthread_create().\nextern \"C\" inline void* ThreadFuncWithCLinkage(void* thread) {\n  static_cast<ThreadWithParamBase*>(thread)->Run();\n  return NULL;\n}\n\n// Helper class for testing Google Test's multi-threading constructs.\n// To use it, write:\n//\n//   void ThreadFunc(int param) { /* Do things with param */ }\n//   Notification thread_can_start;\n//   ...\n//   // The thread_can_start parameter is optional; you can supply NULL.\n//   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);\n//   thread_can_start.Notify();\n//\n// These classes are only for testing Google Test's own constructs. Do\n// not use them in user tests, either directly or indirectly.\ntemplate <typename T>\nclass ThreadWithParam : public ThreadWithParamBase {\n public:\n  typedef void (*UserThreadFunc)(T);\n\n  ThreadWithParam(\n      UserThreadFunc func, T param, Notification* thread_can_start)\n      : func_(func),\n        param_(param),\n        thread_can_start_(thread_can_start),\n        finished_(false) {\n    ThreadWithParamBase* const base = this;\n    // The thread can be created only after all fields except thread_\n    // have been initialized.\n    GTEST_CHECK_POSIX_SUCCESS_(\n        pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));\n  }\n  ~ThreadWithParam() { Join(); }\n\n  void Join() {\n    if (!finished_) {\n      GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));\n      finished_ = true;\n    }\n  }\n\n  virtual void Run() {\n    if (thread_can_start_ != NULL)\n      thread_can_start_->WaitForNotification();\n    func_(param_);\n  }\n\n private:\n  const UserThreadFunc func_;  // User-supplied thread function.\n  const T param_;  // User-supplied parameter to the thread function.\n  // When non-NULL, used to block execution until the controller thread\n  // notifies.\n  Notification* const thread_can_start_;\n  bool finished_;  // true iff we know that the thread function has finished.\n  pthread_t thread_;  // The native thread object.\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);\n};\n\n// MutexBase and Mutex implement mutex on pthreads-based platforms. They\n// are used in conjunction with class MutexLock:\n//\n//   Mutex mutex;\n//   ...\n//   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end\n//                            // of the current scope.\n//\n// MutexBase implements behavior for both statically and dynamically\n// allocated mutexes.  Do not use MutexBase directly.  Instead, write\n// the following to define a static mutex:\n//\n//   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);\n//\n// You can forward declare a static mutex like this:\n//\n//   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);\n//\n// To create a dynamic mutex, just define an object of type Mutex.\nclass MutexBase {\n public:\n  // Acquires this mutex.\n  void Lock() {\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));\n    owner_ = pthread_self();\n    has_owner_ = true;\n  }\n\n  // Releases this mutex.\n  void Unlock() {\n    // Since the lock is being released the owner_ field should no longer be\n    // considered valid. We don't protect writing to has_owner_ here, as it's\n    // the caller's responsibility to ensure that the current thread holds the\n    // mutex when this is called.\n    has_owner_ = false;\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));\n  }\n\n  // Does nothing if the current thread holds the mutex. Otherwise, crashes\n  // with high probability.\n  void AssertHeld() const {\n    GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))\n        << \"The current thread is not holding the mutex @\" << this;\n  }\n\n  // A static mutex may be used before main() is entered.  It may even\n  // be used before the dynamic initialization stage.  Therefore we\n  // must be able to initialize a static mutex object at link time.\n  // This means MutexBase has to be a POD and its member variables\n  // have to be public.\n public:\n  pthread_mutex_t mutex_;  // The underlying pthread mutex.\n  // has_owner_ indicates whether the owner_ field below contains a valid thread\n  // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All\n  // accesses to the owner_ field should be protected by a check of this field.\n  // An alternative might be to memset() owner_ to all zeros, but there's no\n  // guarantee that a zero'd pthread_t is necessarily invalid or even different\n  // from pthread_self().\n  bool has_owner_;\n  pthread_t owner_;  // The thread holding the mutex.\n};\n\n// Forward-declares a static mutex.\n# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \\\n    extern ::testing::internal::MutexBase mutex\n\n// Defines and statically (i.e. at link time) initializes a static mutex.\n// The initialization list here does not explicitly initialize each field,\n// instead relying on default initialization for the unspecified fields. In\n// particular, the owner_ field (a pthread_t) is not explicitly initialized.\n// This allows initialization to work whether pthread_t is a scalar or struct.\n// The flag -Wmissing-field-initializers must not be specified for this to work.\n# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \\\n    ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }\n\n// The Mutex class can only be used for mutexes created at runtime. It\n// shares its API with MutexBase otherwise.\nclass Mutex : public MutexBase {\n public:\n  Mutex() {\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));\n    has_owner_ = false;\n  }\n  ~Mutex() {\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));\n  }\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);\n};\n\n// We cannot name this class MutexLock as the ctor declaration would\n// conflict with a macro named MutexLock, which is defined on some\n// platforms.  Hence the typedef trick below.\nclass GTestMutexLock {\n public:\n  explicit GTestMutexLock(MutexBase* mutex)\n      : mutex_(mutex) { mutex_->Lock(); }\n\n  ~GTestMutexLock() { mutex_->Unlock(); }\n\n private:\n  MutexBase* const mutex_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);\n};\n\ntypedef GTestMutexLock MutexLock;\n\n// Helpers for ThreadLocal.\n\n// pthread_key_create() requires DeleteThreadLocalValue() to have\n// C-linkage.  Therefore it cannot be templatized to access\n// ThreadLocal<T>.  Hence the need for class\n// ThreadLocalValueHolderBase.\nclass ThreadLocalValueHolderBase {\n public:\n  virtual ~ThreadLocalValueHolderBase() {}\n};\n\n// Called by pthread to delete thread-local data stored by\n// pthread_setspecific().\nextern \"C\" inline void DeleteThreadLocalValue(void* value_holder) {\n  delete static_cast<ThreadLocalValueHolderBase*>(value_holder);\n}\n\n// Implements thread-local storage on pthreads-based systems.\n//\n//   // Thread 1\n//   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.\n//\n//   // Thread 2\n//   tl.set(150);  // Changes the value for thread 2 only.\n//   EXPECT_EQ(150, tl.get());\n//\n//   // Thread 1\n//   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.\n//   tl.set(200);\n//   EXPECT_EQ(200, tl.get());\n//\n// The template type argument T must have a public copy constructor.\n// In addition, the default ThreadLocal constructor requires T to have\n// a public default constructor.\n//\n// An object managed for a thread by a ThreadLocal instance is deleted\n// when the thread exits.  Or, if the ThreadLocal instance dies in\n// that thread, when the ThreadLocal dies.  It's the user's\n// responsibility to ensure that all other threads using a ThreadLocal\n// have exited when it dies, or the per-thread objects for those\n// threads will not be deleted.\n//\n// Google Test only uses global ThreadLocal objects.  That means they\n// will die after main() has returned.  Therefore, no per-thread\n// object managed by Google Test will be leaked as long as all threads\n// using Google Test have exited when main() returns.\ntemplate <typename T>\nclass ThreadLocal {\n public:\n  ThreadLocal() : key_(CreateKey()),\n                  default_() {}\n  explicit ThreadLocal(const T& value) : key_(CreateKey()),\n                                         default_(value) {}\n\n  ~ThreadLocal() {\n    // Destroys the managed object for the current thread, if any.\n    DeleteThreadLocalValue(pthread_getspecific(key_));\n\n    // Releases resources associated with the key.  This will *not*\n    // delete managed objects for other threads.\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));\n  }\n\n  T* pointer() { return GetOrCreateValue(); }\n  const T* pointer() const { return GetOrCreateValue(); }\n  const T& get() const { return *pointer(); }\n  void set(const T& value) { *pointer() = value; }\n\n private:\n  // Holds a value of type T.\n  class ValueHolder : public ThreadLocalValueHolderBase {\n   public:\n    explicit ValueHolder(const T& value) : value_(value) {}\n\n    T* pointer() { return &value_; }\n\n   private:\n    T value_;\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);\n  };\n\n  static pthread_key_t CreateKey() {\n    pthread_key_t key;\n    // When a thread exits, DeleteThreadLocalValue() will be called on\n    // the object managed for that thread.\n    GTEST_CHECK_POSIX_SUCCESS_(\n        pthread_key_create(&key, &DeleteThreadLocalValue));\n    return key;\n  }\n\n  T* GetOrCreateValue() const {\n    ThreadLocalValueHolderBase* const holder =\n        static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));\n    if (holder != NULL) {\n      return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();\n    }\n\n    ValueHolder* const new_holder = new ValueHolder(default_);\n    ThreadLocalValueHolderBase* const holder_base = new_holder;\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));\n    return new_holder->pointer();\n  }\n\n  // A key pthreads uses for looking up per-thread values.\n  const pthread_key_t key_;\n  const T default_;  // The default value for each thread.\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);\n};\n\n# define GTEST_IS_THREADSAFE 1\n\n#else  // GTEST_HAS_PTHREAD\n\n// A dummy implementation of synchronization primitives (mutex, lock,\n// and thread-local variable).  Necessary for compiling Google Test where\n// mutex is not supported - using Google Test in multiple threads is not\n// supported on such platforms.\n\nclass Mutex {\n public:\n  Mutex() {}\n  void Lock() {}\n  void Unlock() {}\n  void AssertHeld() const {}\n};\n\n# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \\\n  extern ::testing::internal::Mutex mutex\n\n# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex\n\nclass GTestMutexLock {\n public:\n  explicit GTestMutexLock(Mutex*) {}  // NOLINT\n};\n\ntypedef GTestMutexLock MutexLock;\n\ntemplate <typename T>\nclass ThreadLocal {\n public:\n  ThreadLocal() : value_() {}\n  explicit ThreadLocal(const T& value) : value_(value) {}\n  T* pointer() { return &value_; }\n  const T* pointer() const { return &value_; }\n  const T& get() const { return value_; }\n  void set(const T& value) { value_ = value; }\n private:\n  T value_;\n};\n\n// The above synchronization primitives have dummy implementations.\n// Therefore Google Test is not thread-safe.\n# define GTEST_IS_THREADSAFE 0\n\n#endif  // GTEST_HAS_PTHREAD\n\n// Returns the number of threads running in the process, or 0 to indicate that\n// we cannot detect it.\nGTEST_API_ size_t GetThreadCount();\n\n// Passing non-POD classes through ellipsis (...) crashes the ARM\n// compiler and generates a warning in Sun Studio.  The Nokia Symbian\n// and the IBM XL C/C++ compiler try to instantiate a copy constructor\n// for objects passed through ellipsis (...), failing for uncopyable\n// objects.  We define this to ensure that only POD is passed through\n// ellipsis on these systems.\n#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)\n// We lose support for NULL detection where the compiler doesn't like\n// passing non-POD classes through ellipsis (...).\n# define GTEST_ELLIPSIS_NEEDS_POD_ 1\n#else\n# define GTEST_CAN_COMPARE_NULL 1\n#endif\n\n// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between\n// const T& and const T* in a function template.  These compilers\n// _can_ decide between class template specializations for T and T*,\n// so a tr1::type_traits-like is_pointer works.\n#if defined(__SYMBIAN32__) || defined(__IBMCPP__)\n# define GTEST_NEEDS_IS_POINTER_ 1\n#endif\n\ntemplate <bool bool_value>\nstruct bool_constant {\n  typedef bool_constant<bool_value> type;\n  static const bool value = bool_value;\n};\ntemplate <bool bool_value> const bool bool_constant<bool_value>::value;\n\ntypedef bool_constant<false> false_type;\ntypedef bool_constant<true> true_type;\n\ntemplate <typename T>\nstruct is_pointer : public false_type {};\n\ntemplate <typename T>\nstruct is_pointer<T*> : public true_type {};\n\ntemplate <typename Iterator>\nstruct IteratorTraits {\n  typedef typename Iterator::value_type value_type;\n};\n\ntemplate <typename T>\nstruct IteratorTraits<T*> {\n  typedef T value_type;\n};\n\ntemplate <typename T>\nstruct IteratorTraits<const T*> {\n  typedef T value_type;\n};\n\n#if GTEST_OS_WINDOWS\n# define GTEST_PATH_SEP_ \"\\\\\"\n# define GTEST_HAS_ALT_PATH_SEP_ 1\n// The biggest signed integer type the compiler supports.\ntypedef __int64 BiggestInt;\n#else\n# define GTEST_PATH_SEP_ \"/\"\n# define GTEST_HAS_ALT_PATH_SEP_ 0\ntypedef long long BiggestInt;  // NOLINT\n#endif  // GTEST_OS_WINDOWS\n\n// Utilities for char.\n\n// isspace(int ch) and friends accept an unsigned char or EOF.  char\n// may be signed, depending on the compiler (or compiler flags).\n// Therefore we need to cast a char to unsigned char before calling\n// isspace(), etc.\n\ninline bool IsAlpha(char ch) {\n  return isalpha(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsAlNum(char ch) {\n  return isalnum(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsDigit(char ch) {\n  return isdigit(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsLower(char ch) {\n  return islower(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsSpace(char ch) {\n  return isspace(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsUpper(char ch) {\n  return isupper(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsXDigit(char ch) {\n  return isxdigit(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsXDigit(wchar_t ch) {\n  const unsigned char low_byte = static_cast<unsigned char>(ch);\n  return ch == low_byte && isxdigit(low_byte) != 0;\n}\n\ninline char ToLower(char ch) {\n  return static_cast<char>(tolower(static_cast<unsigned char>(ch)));\n}\ninline char ToUpper(char ch) {\n  return static_cast<char>(toupper(static_cast<unsigned char>(ch)));\n}\n\n// The testing::internal::posix namespace holds wrappers for common\n// POSIX functions.  These wrappers hide the differences between\n// Windows/MSVC and POSIX systems.  Since some compilers define these\n// standard functions as macros, the wrapper cannot have the same name\n// as the wrapped function.\n\nnamespace posix {\n\n// Functions with a different name on Windows.\n\n#if GTEST_OS_WINDOWS\n\ntypedef struct _stat StatStruct;\n\n# ifdef __BORLANDC__\ninline int IsATTY(int fd) { return isatty(fd); }\ninline int StrCaseCmp(const char* s1, const char* s2) {\n  return stricmp(s1, s2);\n}\ninline char* StrDup(const char* src) { return strdup(src); }\n# else  // !__BORLANDC__\n#  if GTEST_OS_WINDOWS_MOBILE\ninline int IsATTY(int /* fd */) { return 0; }\n#  else\ninline int IsATTY(int fd) { return _isatty(fd); }\n#  endif  // GTEST_OS_WINDOWS_MOBILE\ninline int StrCaseCmp(const char* s1, const char* s2) {\n  return _stricmp(s1, s2);\n}\ninline char* StrDup(const char* src) { return _strdup(src); }\n# endif  // __BORLANDC__\n\n# if GTEST_OS_WINDOWS_MOBILE\ninline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }\n// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this\n// time and thus not defined there.\n# else\ninline int FileNo(FILE* file) { return _fileno(file); }\ninline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }\ninline int RmDir(const char* dir) { return _rmdir(dir); }\ninline bool IsDir(const StatStruct& st) {\n  return (_S_IFDIR & st.st_mode) != 0;\n}\n# endif  // GTEST_OS_WINDOWS_MOBILE\n\n#else\n\ntypedef struct stat StatStruct;\n\ninline int FileNo(FILE* file) { return fileno(file); }\ninline int IsATTY(int fd) { return isatty(fd); }\ninline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }\ninline int StrCaseCmp(const char* s1, const char* s2) {\n  return strcasecmp(s1, s2);\n}\ninline char* StrDup(const char* src) { return strdup(src); }\ninline int RmDir(const char* dir) { return rmdir(dir); }\ninline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }\n\n#endif  // GTEST_OS_WINDOWS\n\n// Functions deprecated by MSVC 8.0.\n\n#ifdef _MSC_VER\n// Temporarily disable warning 4996 (deprecated function).\n# pragma warning(push)\n# pragma warning(disable:4996)\n#endif\n\ninline const char* StrNCpy(char* dest, const char* src, size_t n) {\n  return strncpy(dest, src, n);\n}\n\n// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and\n// StrError() aren't needed on Windows CE at this time and thus not\n// defined there.\n\n#if !GTEST_OS_WINDOWS_MOBILE\ninline int ChDir(const char* dir) { return chdir(dir); }\n#endif\ninline FILE* FOpen(const char* path, const char* mode) {\n  return fopen(path, mode);\n}\n#if !GTEST_OS_WINDOWS_MOBILE\ninline FILE *FReopen(const char* path, const char* mode, FILE* stream) {\n  return freopen(path, mode, stream);\n}\ninline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }\n#endif\ninline int FClose(FILE* fp) { return fclose(fp); }\n#if !GTEST_OS_WINDOWS_MOBILE\ninline int Read(int fd, void* buf, unsigned int count) {\n  return static_cast<int>(read(fd, buf, count));\n}\ninline int Write(int fd, const void* buf, unsigned int count) {\n  return static_cast<int>(write(fd, buf, count));\n}\ninline int Close(int fd) { return close(fd); }\ninline const char* StrError(int errnum) { return strerror(errnum); }\n#endif\ninline const char* GetEnv(const char* name) {\n#if GTEST_OS_WINDOWS_MOBILE\n  // We are on Windows CE, which has no environment variables.\n  return NULL;\n#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)\n  // Environment variables which we programmatically clear will be set to the\n  // empty string rather than unset (NULL).  Handle that case.\n  const char* const env = getenv(name);\n  return (env != NULL && env[0] != '\\0') ? env : NULL;\n#else\n  return getenv(name);\n#endif\n}\n\n#ifdef _MSC_VER\n# pragma warning(pop)  // Restores the warning state.\n#endif\n\n#if GTEST_OS_WINDOWS_MOBILE\n// Windows CE has no C library. The abort() function is used in\n// several places in Google Test. This implementation provides a reasonable\n// imitation of standard behaviour.\nvoid Abort();\n#else\ninline void Abort() { abort(); }\n#endif  // GTEST_OS_WINDOWS_MOBILE\n\n}  // namespace posix\n\n// MSVC \"deprecates\" snprintf and issues warnings wherever it is used.  In\n// order to avoid these warnings, we need to use _snprintf or _snprintf_s on\n// MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate\n// function in order to achieve that.  We use macro definition here because\n// snprintf is a variadic function.\n#if defined(_MSC_VER) && _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE\n// MSVC 2005 and above support variadic macros.\n# define GTEST_SNPRINTF_(buffer, size, format, ...) \\\n     _snprintf_s(buffer, size, size, format, __VA_ARGS__)\n#elif defined(_MSC_VER)\n// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't\n// complain about _snprintf.\n# define GTEST_SNPRINTF_ _snprintf\n#else\n# define GTEST_SNPRINTF_ snprintf\n#endif\n\n// The maximum number a BiggestInt can represent.  This definition\n// works no matter BiggestInt is represented in one's complement or\n// two's complement.\n//\n// We cannot rely on numeric_limits in STL, as __int64 and long long\n// are not part of standard C++ and numeric_limits doesn't need to be\n// defined for them.\nconst BiggestInt kMaxBiggestInt =\n    ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));\n\n// This template class serves as a compile-time function from size to\n// type.  It maps a size in bytes to a primitive type with that\n// size. e.g.\n//\n//   TypeWithSize<4>::UInt\n//\n// is typedef-ed to be unsigned int (unsigned integer made up of 4\n// bytes).\n//\n// Such functionality should belong to STL, but I cannot find it\n// there.\n//\n// Google Test uses this class in the implementation of floating-point\n// comparison.\n//\n// For now it only handles UInt (unsigned int) as that's all Google Test\n// needs.  Other types can be easily added in the future if need\n// arises.\ntemplate <size_t size>\nclass TypeWithSize {\n public:\n  // This prevents the user from using TypeWithSize<N> with incorrect\n  // values of N.\n  typedef void UInt;\n};\n\n// The specialization for size 4.\ntemplate <>\nclass TypeWithSize<4> {\n public:\n  // unsigned int has size 4 in both gcc and MSVC.\n  //\n  // As base/basictypes.h doesn't compile on Windows, we cannot use\n  // uint32, uint64, and etc here.\n  typedef int Int;\n  typedef unsigned int UInt;\n};\n\n// The specialization for size 8.\ntemplate <>\nclass TypeWithSize<8> {\n public:\n#if GTEST_OS_WINDOWS\n  typedef __int64 Int;\n  typedef unsigned __int64 UInt;\n#else\n  typedef long long Int;  // NOLINT\n  typedef unsigned long long UInt;  // NOLINT\n#endif  // GTEST_OS_WINDOWS\n};\n\n// Integer types of known sizes.\ntypedef TypeWithSize<4>::Int Int32;\ntypedef TypeWithSize<4>::UInt UInt32;\ntypedef TypeWithSize<8>::Int Int64;\ntypedef TypeWithSize<8>::UInt UInt64;\ntypedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.\n\n// Utilities for command line flags and environment variables.\n\n// Macro for referencing flags.\n#define GTEST_FLAG(name) FLAGS_gtest_##name\n\n// Macros for declaring flags.\n#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)\n#define GTEST_DECLARE_int32_(name) \\\n    GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)\n#define GTEST_DECLARE_string_(name) \\\n    GTEST_API_ extern ::std::string GTEST_FLAG(name)\n\n// Macros for defining flags.\n#define GTEST_DEFINE_bool_(name, default_val, doc) \\\n    GTEST_API_ bool GTEST_FLAG(name) = (default_val)\n#define GTEST_DEFINE_int32_(name, default_val, doc) \\\n    GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)\n#define GTEST_DEFINE_string_(name, default_val, doc) \\\n    GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)\n\n// Thread annotations\n#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)\n#define GTEST_LOCK_EXCLUDED_(locks)\n\n// Parses 'str' for a 32-bit signed integer.  If successful, writes the result\n// to *value and returns true; otherwise leaves *value unchanged and returns\n// false.\n// TODO(chandlerc): Find a better way to refactor flag and environment parsing\n// out of both gtest-port.cc and gtest.cc to avoid exporting this utility\n// function.\nbool ParseInt32(const Message& src_text, const char* str, Int32* value);\n\n// Parses a bool/Int32/string from the environment variable\n// corresponding to the given Google Test flag.\nbool BoolFromGTestEnv(const char* flag, bool default_val);\nGTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);\nconst char* StringFromGTestEnv(const char* flag, const char* default_val);\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_\n\n#if GTEST_OS_LINUX\n# include <stdlib.h>\n# include <sys/types.h>\n# include <sys/wait.h>\n# include <unistd.h>\n#endif  // GTEST_OS_LINUX\n\n#if GTEST_HAS_EXCEPTIONS\n# include <stdexcept>\n#endif\n\n#include <ctype.h>\n#include <float.h>\n#include <string.h>\n#include <iomanip>\n#include <limits>\n#include <set>\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: wan@google.com (Zhanyong Wan)\n//\n// The Google C++ Testing Framework (Google Test)\n//\n// This header file defines the Message class.\n//\n// IMPORTANT NOTE: Due to limitation of the C++ language, we have to\n// leave some internal implementation details in this header file.\n// They are clearly marked by comments like this:\n//\n//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n//\n// Such code is NOT meant to be used by a user directly, and is subject\n// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user\n// program!\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_\n#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_\n\n#include <limits>\n\n\n// Ensures that there is at least one operator<< in the global namespace.\n// See Message& operator<<(...) below for why.\nvoid operator<<(const testing::internal::Secret&, int);\n\nnamespace testing {\n\n// The Message class works like an ostream repeater.\n//\n// Typical usage:\n//\n//   1. You stream a bunch of values to a Message object.\n//      It will remember the text in a stringstream.\n//   2. Then you stream the Message object to an ostream.\n//      This causes the text in the Message to be streamed\n//      to the ostream.\n//\n// For example;\n//\n//   testing::Message foo;\n//   foo << 1 << \" != \" << 2;\n//   std::cout << foo;\n//\n// will print \"1 != 2\".\n//\n// Message is not intended to be inherited from.  In particular, its\n// destructor is not virtual.\n//\n// Note that stringstream behaves differently in gcc and in MSVC.  You\n// can stream a NULL char pointer to it in the former, but not in the\n// latter (it causes an access violation if you do).  The Message\n// class hides this difference by treating a NULL char pointer as\n// \"(null)\".\nclass GTEST_API_ Message {\n private:\n  // The type of basic IO manipulators (endl, ends, and flush) for\n  // narrow streams.\n  typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);\n\n public:\n  // Constructs an empty Message.\n  Message();\n\n  // Copy constructor.\n  Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT\n    *ss_ << msg.GetString();\n  }\n\n  // Constructs a Message from a C-string.\n  explicit Message(const char* str) : ss_(new ::std::stringstream) {\n    *ss_ << str;\n  }\n\n#if GTEST_OS_SYMBIAN\n  // Streams a value (either a pointer or not) to this object.\n  template <typename T>\n  inline Message& operator <<(const T& value) {\n    StreamHelper(typename internal::is_pointer<T>::type(), value);\n    return *this;\n  }\n#else\n  // Streams a non-pointer value to this object.\n  template <typename T>\n  inline Message& operator <<(const T& val) {\n    // Some libraries overload << for STL containers.  These\n    // overloads are defined in the global namespace instead of ::std.\n    //\n    // C++'s symbol lookup rule (i.e. Koenig lookup) says that these\n    // overloads are visible in either the std namespace or the global\n    // namespace, but not other namespaces, including the testing\n    // namespace which Google Test's Message class is in.\n    //\n    // To allow STL containers (and other types that has a << operator\n    // defined in the global namespace) to be used in Google Test\n    // assertions, testing::Message must access the custom << operator\n    // from the global namespace.  With this using declaration,\n    // overloads of << defined in the global namespace and those\n    // visible via Koenig lookup are both exposed in this function.\n    using ::operator <<;\n    *ss_ << val;\n    return *this;\n  }\n\n  // Streams a pointer value to this object.\n  //\n  // This function is an overload of the previous one.  When you\n  // stream a pointer to a Message, this definition will be used as it\n  // is more specialized.  (The C++ Standard, section\n  // [temp.func.order].)  If you stream a non-pointer, then the\n  // previous definition will be used.\n  //\n  // The reason for this overload is that streaming a NULL pointer to\n  // ostream is undefined behavior.  Depending on the compiler, you\n  // may get \"0\", \"(nil)\", \"(null)\", or an access violation.  To\n  // ensure consistent result across compilers, we always treat NULL\n  // as \"(null)\".\n  template <typename T>\n  inline Message& operator <<(T* const& pointer) {  // NOLINT\n    if (pointer == NULL) {\n      *ss_ << \"(null)\";\n    } else {\n      *ss_ << pointer;\n    }\n    return *this;\n  }\n#endif  // GTEST_OS_SYMBIAN\n\n  // Since the basic IO manipulators are overloaded for both narrow\n  // and wide streams, we have to provide this specialized definition\n  // of operator <<, even though its body is the same as the\n  // templatized version above.  Without this definition, streaming\n  // endl or other basic IO manipulators to Message will confuse the\n  // compiler.\n  Message& operator <<(BasicNarrowIoManip val) {\n    *ss_ << val;\n    return *this;\n  }\n\n  // Instead of 1/0, we want to see true/false for bool values.\n  Message& operator <<(bool b) {\n    return *this << (b ? \"true\" : \"false\");\n  }\n\n  // These two overloads allow streaming a wide C string to a Message\n  // using the UTF-8 encoding.\n  Message& operator <<(const wchar_t* wide_c_str);\n  Message& operator <<(wchar_t* wide_c_str);\n\n#if GTEST_HAS_STD_WSTRING\n  // Converts the given wide string to a narrow string using the UTF-8\n  // encoding, and streams the result to this Message object.\n  Message& operator <<(const ::std::wstring& wstr);\n#endif  // GTEST_HAS_STD_WSTRING\n\n#if GTEST_HAS_GLOBAL_WSTRING\n  // Converts the given wide string to a narrow string using the UTF-8\n  // encoding, and streams the result to this Message object.\n  Message& operator <<(const ::wstring& wstr);\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n  // Gets the text streamed to this object so far as an std::string.\n  // Each '\\0' character in the buffer is replaced with \"\\\\0\".\n  //\n  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n  std::string GetString() const;\n\n private:\n\n#if GTEST_OS_SYMBIAN\n  // These are needed as the Nokia Symbian Compiler cannot decide between\n  // const T& and const T* in a function template. The Nokia compiler _can_\n  // decide between class template specializations for T and T*, so a\n  // tr1::type_traits-like is_pointer works, and we can overload on that.\n  template <typename T>\n  inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {\n    if (pointer == NULL) {\n      *ss_ << \"(null)\";\n    } else {\n      *ss_ << pointer;\n    }\n  }\n  template <typename T>\n  inline void StreamHelper(internal::false_type /*is_pointer*/,\n                           const T& value) {\n    // See the comments in Message& operator <<(const T&) above for why\n    // we need this using statement.\n    using ::operator <<;\n    *ss_ << value;\n  }\n#endif  // GTEST_OS_SYMBIAN\n\n  // We'll hold the text streamed to this object here.\n  const internal::scoped_ptr< ::std::stringstream> ss_;\n\n  // We declare (but don't implement) this to prevent the compiler\n  // from implementing the assignment operator.\n  void operator=(const Message&);\n};\n\n// Streams a Message to an ostream.\ninline std::ostream& operator <<(std::ostream& os, const Message& sb) {\n  return os << sb.GetString();\n}\n\nnamespace internal {\n\n// Converts a streamable value to an std::string.  A NULL pointer is\n// converted to \"(null)\".  When the input value is a ::string,\n// ::std::string, ::wstring, or ::std::wstring object, each NUL\n// character in it is replaced with \"\\\\0\".\ntemplate <typename T>\nstd::string StreamableToString(const T& streamable) {\n  return (Message() << streamable).GetString();\n}\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)\n//\n// The Google C++ Testing Framework (Google Test)\n//\n// This header file declares the String class and functions used internally by\n// Google Test.  They are subject to change without notice. They should not used\n// by code external to Google Test.\n//\n// This header file is #included by <gtest/internal/gtest-internal.h>.\n// It should not be #included by other files.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_\n\n#ifdef __BORLANDC__\n// string.h is not guaranteed to provide strcpy on C++ Builder.\n# include <mem.h>\n#endif\n\n#include <string.h>\n#include <string>\n\n\nnamespace testing {\nnamespace internal {\n\n// String - an abstract class holding static string utilities.\nclass GTEST_API_ String {\n public:\n  // Static utility methods\n\n  // Clones a 0-terminated C string, allocating memory using new.  The\n  // caller is responsible for deleting the return value using\n  // delete[].  Returns the cloned string, or NULL if the input is\n  // NULL.\n  //\n  // This is different from strdup() in string.h, which allocates\n  // memory using malloc().\n  static const char* CloneCString(const char* c_str);\n\n#if GTEST_OS_WINDOWS_MOBILE\n  // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be\n  // able to pass strings to Win32 APIs on CE we need to convert them\n  // to 'Unicode', UTF-16.\n\n  // Creates a UTF-16 wide string from the given ANSI string, allocating\n  // memory using new. The caller is responsible for deleting the return\n  // value using delete[]. Returns the wide string, or NULL if the\n  // input is NULL.\n  //\n  // The wide string is created using the ANSI codepage (CP_ACP) to\n  // match the behaviour of the ANSI versions of Win32 calls and the\n  // C runtime.\n  static LPCWSTR AnsiToUtf16(const char* c_str);\n\n  // Creates an ANSI string from the given wide string, allocating\n  // memory using new. The caller is responsible for deleting the return\n  // value using delete[]. Returns the ANSI string, or NULL if the\n  // input is NULL.\n  //\n  // The returned string is created using the ANSI codepage (CP_ACP) to\n  // match the behaviour of the ANSI versions of Win32 calls and the\n  // C runtime.\n  static const char* Utf16ToAnsi(LPCWSTR utf16_str);\n#endif\n\n  // Compares two C strings.  Returns true iff they have the same content.\n  //\n  // Unlike strcmp(), this function can handle NULL argument(s).  A\n  // NULL C string is considered different to any non-NULL C string,\n  // including the empty string.\n  static bool CStringEquals(const char* lhs, const char* rhs);\n\n  // Converts a wide C string to a String using the UTF-8 encoding.\n  // NULL will be converted to \"(null)\".  If an error occurred during\n  // the conversion, \"(failed to convert from wide string)\" is\n  // returned.\n  static std::string ShowWideCString(const wchar_t* wide_c_str);\n\n  // Compares two wide C strings.  Returns true iff they have the same\n  // content.\n  //\n  // Unlike wcscmp(), this function can handle NULL argument(s).  A\n  // NULL C string is considered different to any non-NULL C string,\n  // including the empty string.\n  static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);\n\n  // Compares two C strings, ignoring case.  Returns true iff they\n  // have the same content.\n  //\n  // Unlike strcasecmp(), this function can handle NULL argument(s).\n  // A NULL C string is considered different to any non-NULL C string,\n  // including the empty string.\n  static bool CaseInsensitiveCStringEquals(const char* lhs,\n                                           const char* rhs);\n\n  // Compares two wide C strings, ignoring case.  Returns true iff they\n  // have the same content.\n  //\n  // Unlike wcscasecmp(), this function can handle NULL argument(s).\n  // A NULL C string is considered different to any non-NULL wide C string,\n  // including the empty string.\n  // NB: The implementations on different platforms slightly differ.\n  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE\n  // environment variable. On GNU platform this method uses wcscasecmp\n  // which compares according to LC_CTYPE category of the current locale.\n  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the\n  // current locale.\n  static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,\n                                               const wchar_t* rhs);\n\n  // Returns true iff the given string ends with the given suffix, ignoring\n  // case. Any string is considered to end with an empty suffix.\n  static bool EndsWithCaseInsensitive(\n      const std::string& str, const std::string& suffix);\n\n  // Formats an int value as \"%02d\".\n  static std::string FormatIntWidth2(int value);  // \"%02d\" for width == 2\n\n  // Formats an int value as \"%X\".\n  static std::string FormatHexInt(int value);\n\n  // Formats a byte as \"%02X\".\n  static std::string FormatByte(unsigned char value);\n\n private:\n  String();  // Not meant to be instantiated.\n};  // class String\n\n// Gets the content of the stringstream's buffer as an std::string.  Each '\\0'\n// character in the buffer is replaced with \"\\\\0\".\nGTEST_API_ std::string StringStreamToString(::std::stringstream* stream);\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_\n// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: keith.ray@gmail.com (Keith Ray)\n//\n// Google Test filepath utilities\n//\n// This header file declares classes and functions used internally by\n// Google Test.  They are subject to change without notice.\n//\n// This file is #included in <gtest/internal/gtest-internal.h>.\n// Do not include this header file separately!\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_\n\n\nnamespace testing {\nnamespace internal {\n\n// FilePath - a class for file and directory pathname manipulation which\n// handles platform-specific conventions (like the pathname separator).\n// Used for helper functions for naming files in a directory for xml output.\n// Except for Set methods, all methods are const or static, which provides an\n// \"immutable value object\" -- useful for peace of mind.\n// A FilePath with a value ending in a path separator (\"like/this/\") represents\n// a directory, otherwise it is assumed to represent a file. In either case,\n// it may or may not represent an actual file or directory in the file system.\n// Names are NOT checked for syntax correctness -- no checking for illegal\n// characters, malformed paths, etc.\n\nclass GTEST_API_ FilePath {\n public:\n  FilePath() : pathname_(\"\") { }\n  FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }\n\n  explicit FilePath(const std::string& pathname) : pathname_(pathname) {\n    Normalize();\n  }\n\n  FilePath& operator=(const FilePath& rhs) {\n    Set(rhs);\n    return *this;\n  }\n\n  void Set(const FilePath& rhs) {\n    pathname_ = rhs.pathname_;\n  }\n\n  const std::string& string() const { return pathname_; }\n  const char* c_str() const { return pathname_.c_str(); }\n\n  // Returns the current working directory, or \"\" if unsuccessful.\n  static FilePath GetCurrentDir();\n\n  // Given directory = \"dir\", base_name = \"test\", number = 0,\n  // extension = \"xml\", returns \"dir/test.xml\". If number is greater\n  // than zero (e.g., 12), returns \"dir/test_12.xml\".\n  // On Windows platform, uses \\ as the separator rather than /.\n  static FilePath MakeFileName(const FilePath& directory,\n                               const FilePath& base_name,\n                               int number,\n                               const char* extension);\n\n  // Given directory = \"dir\", relative_path = \"test.xml\",\n  // returns \"dir/test.xml\".\n  // On Windows, uses \\ as the separator rather than /.\n  static FilePath ConcatPaths(const FilePath& directory,\n                              const FilePath& relative_path);\n\n  // Returns a pathname for a file that does not currently exist. The pathname\n  // will be directory/base_name.extension or\n  // directory/base_name_<number>.extension if directory/base_name.extension\n  // already exists. The number will be incremented until a pathname is found\n  // that does not already exist.\n  // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.\n  // There could be a race condition if two or more processes are calling this\n  // function at the same time -- they could both pick the same filename.\n  static FilePath GenerateUniqueFileName(const FilePath& directory,\n                                         const FilePath& base_name,\n                                         const char* extension);\n\n  // Returns true iff the path is \"\".\n  bool IsEmpty() const { return pathname_.empty(); }\n\n  // If input name has a trailing separator character, removes it and returns\n  // the name, otherwise return the name string unmodified.\n  // On Windows platform, uses \\ as the separator, other platforms use /.\n  FilePath RemoveTrailingPathSeparator() const;\n\n  // Returns a copy of the FilePath with the directory part removed.\n  // Example: FilePath(\"path/to/file\").RemoveDirectoryName() returns\n  // FilePath(\"file\"). If there is no directory part (\"just_a_file\"), it returns\n  // the FilePath unmodified. If there is no file part (\"just_a_dir/\") it\n  // returns an empty FilePath (\"\").\n  // On Windows platform, '\\' is the path separator, otherwise it is '/'.\n  FilePath RemoveDirectoryName() const;\n\n  // RemoveFileName returns the directory path with the filename removed.\n  // Example: FilePath(\"path/to/file\").RemoveFileName() returns \"path/to/\".\n  // If the FilePath is \"a_file\" or \"/a_file\", RemoveFileName returns\n  // FilePath(\"./\") or, on Windows, FilePath(\".\\\\\"). If the filepath does\n  // not have a file, like \"just/a/dir/\", it returns the FilePath unmodified.\n  // On Windows platform, '\\' is the path separator, otherwise it is '/'.\n  FilePath RemoveFileName() const;\n\n  // Returns a copy of the FilePath with the case-insensitive extension removed.\n  // Example: FilePath(\"dir/file.exe\").RemoveExtension(\"EXE\") returns\n  // FilePath(\"dir/file\"). If a case-insensitive extension is not\n  // found, returns a copy of the original FilePath.\n  FilePath RemoveExtension(const char* extension) const;\n\n  // Creates directories so that path exists. Returns true if successful or if\n  // the directories already exist; returns false if unable to create\n  // directories for any reason. Will also return false if the FilePath does\n  // not represent a directory (that is, it doesn't end with a path separator).\n  bool CreateDirectoriesRecursively() const;\n\n  // Create the directory so that path exists. Returns true if successful or\n  // if the directory already exists; returns false if unable to create the\n  // directory for any reason, including if the parent directory does not\n  // exist. Not named \"CreateDirectory\" because that's a macro on Windows.\n  bool CreateFolder() const;\n\n  // Returns true if FilePath describes something in the file-system,\n  // either a file, directory, or whatever, and that something exists.\n  bool FileOrDirectoryExists() const;\n\n  // Returns true if pathname describes a directory in the file-system\n  // that exists.\n  bool DirectoryExists() const;\n\n  // Returns true if FilePath ends with a path separator, which indicates that\n  // it is intended to represent a directory. Returns false otherwise.\n  // This does NOT check that a directory (or file) actually exists.\n  bool IsDirectory() const;\n\n  // Returns true if pathname describes a root directory. (Windows has one\n  // root directory per disk drive.)\n  bool IsRootDirectory() const;\n\n  // Returns true if pathname describes an absolute path.\n  bool IsAbsolutePath() const;\n\n private:\n  // Replaces multiple consecutive separators with a single separator.\n  // For example, \"bar///foo\" becomes \"bar/foo\". Does not eliminate other\n  // redundancies that might be in a pathname involving \".\" or \"..\".\n  //\n  // A pathname with multiple consecutive separators may occur either through\n  // user error or as a result of some scripts or APIs that generate a pathname\n  // with a trailing separator. On other platforms the same API or script\n  // may NOT generate a pathname with a trailing \"/\". Then elsewhere that\n  // pathname may have another \"/\" and pathname components added to it,\n  // without checking for the separator already being there.\n  // The script language and operating system may allow paths like \"foo//bar\"\n  // but some of the functions in FilePath will not handle that correctly. In\n  // particular, RemoveTrailingPathSeparator() only removes one separator, and\n  // it is called in CreateDirectoriesRecursively() assuming that it will change\n  // a pathname from directory syntax (trailing separator) to filename syntax.\n  //\n  // On Windows this method also replaces the alternate path separator '/' with\n  // the primary path separator '\\\\', so that for example \"bar\\\\/\\\\foo\" becomes\n  // \"bar\\\\foo\".\n\n  void Normalize();\n\n  // Returns a pointer to the last occurence of a valid path separator in\n  // the FilePath. On Windows, for example, both '/' and '\\' are valid path\n  // separators. Returns NULL if no path separator was found.\n  const char* FindLastPathSeparator() const;\n\n  std::string pathname_;\n};  // class FilePath\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_\n// This file was GENERATED by command:\n//     pump.py gtest-type-util.h.pump\n// DO NOT EDIT BY HAND!!!\n\n// Copyright 2008 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: wan@google.com (Zhanyong Wan)\n\n// Type utilities needed for implementing typed and type-parameterized\n// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!\n//\n// Currently we support at most 50 types in a list, and at most 50\n// type-parameterized tests in one type-parameterized test case.\n// Please contact googletestframework@googlegroups.com if you need\n// more.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_\n\n\n// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using\n// libstdc++ (which is where cxxabi.h comes from).\n# if GTEST_HAS_CXXABI_H_\n#  include <cxxabi.h>\n# elif defined(__HP_aCC)\n#  include <acxx_demangle.h>\n# endif  // GTEST_HASH_CXXABI_H_\n\nnamespace testing {\nnamespace internal {\n\n// GetTypeName<T>() returns a human-readable name of type T.\n// NB: This function is also used in Google Mock, so don't move it inside of\n// the typed-test-only section below.\ntemplate <typename T>\nstd::string GetTypeName() {\n# if GTEST_HAS_RTTI\n\n  const char* const name = typeid(T).name();\n#  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)\n  int status = 0;\n  // gcc's implementation of typeid(T).name() mangles the type name,\n  // so we have to demangle it.\n#   if GTEST_HAS_CXXABI_H_\n  using abi::__cxa_demangle;\n#   endif  // GTEST_HAS_CXXABI_H_\n  char* const readable_name = __cxa_demangle(name, 0, 0, &status);\n  const std::string name_str(status == 0 ? readable_name : name);\n  free(readable_name);\n  return name_str;\n#  else\n  return name;\n#  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC\n\n# else\n\n  return \"<type>\";\n\n# endif  // GTEST_HAS_RTTI\n}\n\n#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P\n\n// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same\n// type.  This can be used as a compile-time assertion to ensure that\n// two types are equal.\n\ntemplate <typename T1, typename T2>\nstruct AssertTypeEq;\n\ntemplate <typename T>\nstruct AssertTypeEq<T, T> {\n  typedef bool type;\n};\n\n// A unique type used as the default value for the arguments of class\n// template Types.  This allows us to simulate variadic templates\n// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't\n// support directly.\nstruct None {};\n\n// The following family of struct and struct templates are used to\n// represent type lists.  In particular, TypesN<T1, T2, ..., TN>\n// represents a type list with N types (T1, T2, ..., and TN) in it.\n// Except for Types0, every struct in the family has two member types:\n// Head for the first type in the list, and Tail for the rest of the\n// list.\n\n// The empty type list.\nstruct Types0 {};\n\n// Type lists of length 1, 2, 3, and so on.\n\ntemplate <typename T1>\nstruct Types1 {\n  typedef T1 Head;\n  typedef Types0 Tail;\n};\ntemplate <typename T1, typename T2>\nstruct Types2 {\n  typedef T1 Head;\n  typedef Types1<T2> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3>\nstruct Types3 {\n  typedef T1 Head;\n  typedef Types2<T2, T3> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\nstruct Types4 {\n  typedef T1 Head;\n  typedef Types3<T2, T3, T4> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nstruct Types5 {\n  typedef T1 Head;\n  typedef Types4<T2, T3, T4, T5> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\nstruct Types6 {\n  typedef T1 Head;\n  typedef Types5<T2, T3, T4, T5, T6> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\nstruct Types7 {\n  typedef T1 Head;\n  typedef Types6<T2, T3, T4, T5, T6, T7> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\nstruct Types8 {\n  typedef T1 Head;\n  typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\nstruct Types9 {\n  typedef T1 Head;\n  typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\nstruct Types10 {\n  typedef T1 Head;\n  typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11>\nstruct Types11 {\n  typedef T1 Head;\n  typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12>\nstruct Types12 {\n  typedef T1 Head;\n  typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13>\nstruct Types13 {\n  typedef T1 Head;\n  typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14>\nstruct Types14 {\n  typedef T1 Head;\n  typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15>\nstruct Types15 {\n  typedef T1 Head;\n  typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16>\nstruct Types16 {\n  typedef T1 Head;\n  typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17>\nstruct Types17 {\n  typedef T1 Head;\n  typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18>\nstruct Types18 {\n  typedef T1 Head;\n  typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19>\nstruct Types19 {\n  typedef T1 Head;\n  typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20>\nstruct Types20 {\n  typedef T1 Head;\n  typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21>\nstruct Types21 {\n  typedef T1 Head;\n  typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22>\nstruct Types22 {\n  typedef T1 Head;\n  typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23>\nstruct Types23 {\n  typedef T1 Head;\n  typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24>\nstruct Types24 {\n  typedef T1 Head;\n  typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25>\nstruct Types25 {\n  typedef T1 Head;\n  typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26>\nstruct Types26 {\n  typedef T1 Head;\n  typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27>\nstruct Types27 {\n  typedef T1 Head;\n  typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28>\nstruct Types28 {\n  typedef T1 Head;\n  typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29>\nstruct Types29 {\n  typedef T1 Head;\n  typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30>\nstruct Types30 {\n  typedef T1 Head;\n  typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31>\nstruct Types31 {\n  typedef T1 Head;\n  typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32>\nstruct Types32 {\n  typedef T1 Head;\n  typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33>\nstruct Types33 {\n  typedef T1 Head;\n  typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34>\nstruct Types34 {\n  typedef T1 Head;\n  typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35>\nstruct Types35 {\n  typedef T1 Head;\n  typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36>\nstruct Types36 {\n  typedef T1 Head;\n  typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37>\nstruct Types37 {\n  typedef T1 Head;\n  typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38>\nstruct Types38 {\n  typedef T1 Head;\n  typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39>\nstruct Types39 {\n  typedef T1 Head;\n  typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40>\nstruct Types40 {\n  typedef T1 Head;\n  typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41>\nstruct Types41 {\n  typedef T1 Head;\n  typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42>\nstruct Types42 {\n  typedef T1 Head;\n  typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43>\nstruct Types43 {\n  typedef T1 Head;\n  typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44>\nstruct Types44 {\n  typedef T1 Head;\n  typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45>\nstruct Types45 {\n  typedef T1 Head;\n  typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46>\nstruct Types46 {\n  typedef T1 Head;\n  typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47>\nstruct Types47 {\n  typedef T1 Head;\n  typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46, T47> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48>\nstruct Types48 {\n  typedef T1 Head;\n  typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46, T47, T48> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49>\nstruct Types49 {\n  typedef T1 Head;\n  typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46, T47, T48, T49> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49, typename T50>\nstruct Types50 {\n  typedef T1 Head;\n  typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46, T47, T48, T49, T50> Tail;\n};\n\n\n}  // namespace internal\n\n// We don't want to require the users to write TypesN<...> directly,\n// as that would require them to count the length.  Types<...> is much\n// easier to write, but generates horrible messages when there is a\n// compiler error, as gcc insists on printing out each template\n// argument, even if it has the default value (this means Types<int>\n// will appear as Types<int, None, None, ..., None> in the compiler\n// errors).\n//\n// Our solution is to combine the best part of the two approaches: a\n// user would write Types<T1, ..., TN>, and Google Test will translate\n// that to TypesN<T1, ..., TN> internally to make error messages\n// readable.  The translation is done by the 'type' member of the\n// Types template.\ntemplate <typename T1 = internal::None, typename T2 = internal::None,\n    typename T3 = internal::None, typename T4 = internal::None,\n    typename T5 = internal::None, typename T6 = internal::None,\n    typename T7 = internal::None, typename T8 = internal::None,\n    typename T9 = internal::None, typename T10 = internal::None,\n    typename T11 = internal::None, typename T12 = internal::None,\n    typename T13 = internal::None, typename T14 = internal::None,\n    typename T15 = internal::None, typename T16 = internal::None,\n    typename T17 = internal::None, typename T18 = internal::None,\n    typename T19 = internal::None, typename T20 = internal::None,\n    typename T21 = internal::None, typename T22 = internal::None,\n    typename T23 = internal::None, typename T24 = internal::None,\n    typename T25 = internal::None, typename T26 = internal::None,\n    typename T27 = internal::None, typename T28 = internal::None,\n    typename T29 = internal::None, typename T30 = internal::None,\n    typename T31 = internal::None, typename T32 = internal::None,\n    typename T33 = internal::None, typename T34 = internal::None,\n    typename T35 = internal::None, typename T36 = internal::None,\n    typename T37 = internal::None, typename T38 = internal::None,\n    typename T39 = internal::None, typename T40 = internal::None,\n    typename T41 = internal::None, typename T42 = internal::None,\n    typename T43 = internal::None, typename T44 = internal::None,\n    typename T45 = internal::None, typename T46 = internal::None,\n    typename T47 = internal::None, typename T48 = internal::None,\n    typename T49 = internal::None, typename T50 = internal::None>\nstruct Types {\n  typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;\n};\n\ntemplate <>\nstruct Types<internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types0 type;\n};\ntemplate <typename T1>\nstruct Types<T1, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types1<T1> type;\n};\ntemplate <typename T1, typename T2>\nstruct Types<T1, T2, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types2<T1, T2> type;\n};\ntemplate <typename T1, typename T2, typename T3>\nstruct Types<T1, T2, T3, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types3<T1, T2, T3> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4>\nstruct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types4<T1, T2, T3, T4> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nstruct Types<T1, T2, T3, T4, T5, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types5<T1, T2, T3, T4, T5> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\nstruct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    T46, internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    T46, T47, internal::None, internal::None, internal::None> {\n  typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    T46, T47, T48, internal::None, internal::None> {\n  typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47, T48> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    T46, T47, T48, T49, internal::None> {\n  typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47, T48, T49> type;\n};\n\nnamespace internal {\n\n# define GTEST_TEMPLATE_ template <typename T> class\n\n// The template \"selector\" struct TemplateSel<Tmpl> is used to\n// represent Tmpl, which must be a class template with one type\n// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined\n// as the type Tmpl<T>.  This allows us to actually instantiate the\n// template \"selected\" by TemplateSel<Tmpl>.\n//\n// This trick is necessary for simulating typedef for class templates,\n// which C++ doesn't support directly.\ntemplate <GTEST_TEMPLATE_ Tmpl>\nstruct TemplateSel {\n  template <typename T>\n  struct Bind {\n    typedef Tmpl<T> type;\n  };\n};\n\n# define GTEST_BIND_(TmplSel, T) \\\n  TmplSel::template Bind<T>::type\n\n// A unique struct template used as the default value for the\n// arguments of class template Templates.  This allows us to simulate\n// variadic templates (e.g. Templates<int>, Templates<int, double>,\n// and etc), which C++ doesn't support directly.\ntemplate <typename T>\nstruct NoneT {};\n\n// The following family of struct and struct templates are used to\n// represent template lists.  In particular, TemplatesN<T1, T2, ...,\n// TN> represents a list of N templates (T1, T2, ..., and TN).  Except\n// for Templates0, every struct in the family has two member types:\n// Head for the selector of the first template in the list, and Tail\n// for the rest of the list.\n\n// The empty template list.\nstruct Templates0 {};\n\n// Template lists of length 1, 2, 3, and so on.\n\ntemplate <GTEST_TEMPLATE_ T1>\nstruct Templates1 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates0 Tail;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>\nstruct Templates2 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates1<T2> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>\nstruct Templates3 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates2<T2, T3> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4>\nstruct Templates4 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates3<T2, T3, T4> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>\nstruct Templates5 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates4<T2, T3, T4, T5> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>\nstruct Templates6 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates5<T2, T3, T4, T5, T6> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7>\nstruct Templates7 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>\nstruct Templates8 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>\nstruct Templates9 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10>\nstruct Templates10 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>\nstruct Templates11 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>\nstruct Templates12 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13>\nstruct Templates13 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>\nstruct Templates14 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>\nstruct Templates15 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16>\nstruct Templates16 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>\nstruct Templates17 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>\nstruct Templates18 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19>\nstruct Templates19 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>\nstruct Templates20 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>\nstruct Templates21 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22>\nstruct Templates22 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>\nstruct Templates23 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>\nstruct Templates24 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25>\nstruct Templates25 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>\nstruct Templates26 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>\nstruct Templates27 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28>\nstruct Templates28 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>\nstruct Templates29 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>\nstruct Templates30 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31>\nstruct Templates31 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>\nstruct Templates32 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>\nstruct Templates33 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34>\nstruct Templates34 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>\nstruct Templates35 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>\nstruct Templates36 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37>\nstruct Templates37 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>\nstruct Templates38 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>\nstruct Templates39 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40>\nstruct Templates40 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>\nstruct Templates41 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>\nstruct Templates42 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43>\nstruct Templates43 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>\nstruct Templates44 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>\nstruct Templates45 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46>\nstruct Templates46 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>\nstruct Templates47 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46, T47> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>\nstruct Templates48 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46, T47, T48> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,\n    GTEST_TEMPLATE_ T49>\nstruct Templates49 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46, T47, T48, T49> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,\n    GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>\nstruct Templates50 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46, T47, T48, T49, T50> Tail;\n};\n\n\n// We don't want to require the users to write TemplatesN<...> directly,\n// as that would require them to count the length.  Templates<...> is much\n// easier to write, but generates horrible messages when there is a\n// compiler error, as gcc insists on printing out each template\n// argument, even if it has the default value (this means Templates<list>\n// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler\n// errors).\n//\n// Our solution is to combine the best part of the two approaches: a\n// user would write Templates<T1, ..., TN>, and Google Test will translate\n// that to TemplatesN<T1, ..., TN> internally to make error messages\n// readable.  The translation is done by the 'type' member of the\n// Templates template.\ntemplate <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,\n    GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,\n    GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,\n    GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,\n    GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,\n    GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,\n    GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,\n    GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,\n    GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,\n    GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,\n    GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,\n    GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,\n    GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,\n    GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,\n    GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,\n    GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,\n    GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,\n    GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,\n    GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,\n    GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,\n    GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,\n    GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,\n    GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,\n    GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,\n    GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>\nstruct Templates {\n  typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46, T47, T48, T49, T50> type;\n};\n\ntemplate <>\nstruct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT> {\n  typedef Templates0 type;\n};\ntemplate <GTEST_TEMPLATE_ T1>\nstruct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT> {\n  typedef Templates1<T1> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>\nstruct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT> {\n  typedef Templates2<T1, T2> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>\nstruct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates3<T1, T2, T3> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4>\nstruct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates4<T1, T2, T3, T4> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>\nstruct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates5<T1, T2, T3, T4, T5> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>\nstruct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates6<T1, T2, T3, T4, T5, T6> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT> {\n  typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT> {\n  typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT> {\n  typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT> {\n  typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT> {\n  typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT> {\n  typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT> {\n  typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT> {\n  typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, T46, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, T46, T47, NoneT, NoneT, NoneT> {\n  typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46, T47> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, T46, T47, T48, NoneT, NoneT> {\n  typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46, T47, T48> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,\n    GTEST_TEMPLATE_ T49>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, T46, T47, T48, T49, NoneT> {\n  typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46, T47, T48, T49> type;\n};\n\n// The TypeList template makes it possible to use either a single type\n// or a Types<...> list in TYPED_TEST_CASE() and\n// INSTANTIATE_TYPED_TEST_CASE_P().\n\ntemplate <typename T>\nstruct TypeList {\n  typedef Types1<T> type;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49, typename T50>\nstruct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47, T48, T49, T50> > {\n  typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;\n};\n\n#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_\n\n// Due to C++ preprocessor weirdness, we need double indirection to\n// concatenate two tokens when one of them is __LINE__.  Writing\n//\n//   foo ## __LINE__\n//\n// will result in the token foo__LINE__, instead of foo followed by\n// the current line number.  For more details, see\n// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6\n#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)\n#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar\n\nclass ProtocolMessage;\nnamespace proto2 { class Message; }\n\nnamespace testing {\n\n// Forward declarations.\n\nclass AssertionResult;                 // Result of an assertion.\nclass Message;                         // Represents a failure message.\nclass Test;                            // Represents a test.\nclass TestInfo;                        // Information about a test.\nclass TestPartResult;                  // Result of a test part.\nclass UnitTest;                        // A collection of test cases.\n\ntemplate <typename T>\n::std::string PrintToString(const T& value);\n\nnamespace internal {\n\nstruct TraceInfo;                      // Information about a trace point.\nclass ScopedTrace;                     // Implements scoped trace.\nclass TestInfoImpl;                    // Opaque implementation of TestInfo\nclass UnitTestImpl;                    // Opaque implementation of UnitTest\n\n// How many times InitGoogleTest() has been called.\nGTEST_API_ extern int g_init_gtest_count;\n\n// The text used in failure messages to indicate the start of the\n// stack trace.\nGTEST_API_ extern const char kStackTraceMarker[];\n\n// Two overloaded helpers for checking at compile time whether an\n// expression is a null pointer literal (i.e. NULL or any 0-valued\n// compile-time integral constant).  Their return values have\n// different sizes, so we can use sizeof() to test which version is\n// picked by the compiler.  These helpers have no implementations, as\n// we only need their signatures.\n//\n// Given IsNullLiteralHelper(x), the compiler will pick the first\n// version if x can be implicitly converted to Secret*, and pick the\n// second version otherwise.  Since Secret is a secret and incomplete\n// type, the only expression a user can write that has type Secret* is\n// a null pointer literal.  Therefore, we know that x is a null\n// pointer literal if and only if the first version is picked by the\n// compiler.\nchar IsNullLiteralHelper(Secret* p);\nchar (&IsNullLiteralHelper(...))[2];  // NOLINT\n\n// A compile-time bool constant that is true if and only if x is a\n// null pointer literal (i.e. NULL or any 0-valued compile-time\n// integral constant).\n#ifdef GTEST_ELLIPSIS_NEEDS_POD_\n// We lose support for NULL detection where the compiler doesn't like\n// passing non-POD classes through ellipsis (...).\n# define GTEST_IS_NULL_LITERAL_(x) false\n#else\n# define GTEST_IS_NULL_LITERAL_(x) \\\n    (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)\n#endif  // GTEST_ELLIPSIS_NEEDS_POD_\n\n// Appends the user-supplied message to the Google-Test-generated message.\nGTEST_API_ std::string AppendUserMessage(\n    const std::string& gtest_msg, const Message& user_msg);\n\n#if GTEST_HAS_EXCEPTIONS\n\n// This exception is thrown by (and only by) a failed Google Test\n// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions\n// are enabled).  We derive it from std::runtime_error, which is for\n// errors presumably detectable only at run time.  Since\n// std::runtime_error inherits from std::exception, many testing\n// frameworks know how to extract and print the message inside it.\n\n#ifdef _MSC_VER\n# pragma warning(push)          // Saves the current warning state.\n# pragma warning(disable:4275)  // Temporarily disables warning 4275.\n#endif  // _MSC_VER\n\nclass GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {\n public:\n  explicit GoogleTestFailureException(const TestPartResult& failure);\n};\n\n#ifdef _MSC_VER\n# pragma warning(pop)           // Restores the warning state.\n#endif  // _MSC_VER\n\n#endif  // GTEST_HAS_EXCEPTIONS\n\n// A helper class for creating scoped traces in user programs.\nclass GTEST_API_ ScopedTrace {\n public:\n  // The c'tor pushes the given source file location and message onto\n  // a trace stack maintained by Google Test.\n  ScopedTrace(const char* file, int line, const Message& message);\n\n  // The d'tor pops the info pushed by the c'tor.\n  //\n  // Note that the d'tor is not virtual in order to be efficient.\n  // Don't inherit from ScopedTrace!\n  ~ScopedTrace();\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);\n} GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its\n                            // c'tor and d'tor.  Therefore it doesn't\n                            // need to be used otherwise.\n\n// Constructs and returns the message for an equality assertion\n// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.\n//\n// The first four parameters are the expressions used in the assertion\n// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)\n// where foo is 5 and bar is 6, we have:\n//\n//   expected_expression: \"foo\"\n//   actual_expression:   \"bar\"\n//   expected_value:      \"5\"\n//   actual_value:        \"6\"\n//\n// The ignoring_case parameter is true iff the assertion is a\n// *_STRCASEEQ*.  When it's true, the string \" (ignoring case)\" will\n// be inserted into the message.\nGTEST_API_ AssertionResult EqFailure(const char* expected_expression,\n                                     const char* actual_expression,\n                                     const std::string& expected_value,\n                                     const std::string& actual_value,\n                                     bool ignoring_case);\n\n// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.\nGTEST_API_ std::string GetBoolAssertionFailureMessage(\n    const AssertionResult& assertion_result,\n    const char* expression_text,\n    const char* actual_predicate_value,\n    const char* expected_predicate_value);\n\n// This template class represents an IEEE floating-point number\n// (either single-precision or double-precision, depending on the\n// template parameters).\n//\n// The purpose of this class is to do more sophisticated number\n// comparison.  (Due to round-off error, etc, it's very unlikely that\n// two floating-points will be equal exactly.  Hence a naive\n// comparison by the == operation often doesn't work.)\n//\n// Format of IEEE floating-point:\n//\n//   The most-significant bit being the leftmost, an IEEE\n//   floating-point looks like\n//\n//     sign_bit exponent_bits fraction_bits\n//\n//   Here, sign_bit is a single bit that designates the sign of the\n//   number.\n//\n//   For float, there are 8 exponent bits and 23 fraction bits.\n//\n//   For double, there are 11 exponent bits and 52 fraction bits.\n//\n//   More details can be found at\n//   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.\n//\n// Template parameter:\n//\n//   RawType: the raw floating-point type (either float or double)\ntemplate <typename RawType>\nclass FloatingPoint {\n public:\n  // Defines the unsigned integer type that has the same size as the\n  // floating point number.\n  typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;\n\n  // Constants.\n\n  // # of bits in a number.\n  static const size_t kBitCount = 8*sizeof(RawType);\n\n  // # of fraction bits in a number.\n  static const size_t kFractionBitCount =\n    std::numeric_limits<RawType>::digits - 1;\n\n  // # of exponent bits in a number.\n  static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;\n\n  // The mask for the sign bit.\n  static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);\n\n  // The mask for the fraction bits.\n  static const Bits kFractionBitMask =\n    ~static_cast<Bits>(0) >> (kExponentBitCount + 1);\n\n  // The mask for the exponent bits.\n  static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);\n\n  // How many ULP's (Units in the Last Place) we want to tolerate when\n  // comparing two numbers.  The larger the value, the more error we\n  // allow.  A 0 value means that two numbers must be exactly the same\n  // to be considered equal.\n  //\n  // The maximum error of a single floating-point operation is 0.5\n  // units in the last place.  On Intel CPU's, all floating-point\n  // calculations are done with 80-bit precision, while double has 64\n  // bits.  Therefore, 4 should be enough for ordinary use.\n  //\n  // See the following article for more details on ULP:\n  // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/\n  static const size_t kMaxUlps = 4;\n\n  // Constructs a FloatingPoint from a raw floating-point number.\n  //\n  // On an Intel CPU, passing a non-normalized NAN (Not a Number)\n  // around may change its bits, although the new value is guaranteed\n  // to be also a NAN.  Therefore, don't expect this constructor to\n  // preserve the bits in x when x is a NAN.\n  explicit FloatingPoint(const RawType& x) { u_.value_ = x; }\n\n  // Static methods\n\n  // Reinterprets a bit pattern as a floating-point number.\n  //\n  // This function is needed to test the AlmostEquals() method.\n  static RawType ReinterpretBits(const Bits bits) {\n    FloatingPoint fp(0);\n    fp.u_.bits_ = bits;\n    return fp.u_.value_;\n  }\n\n  // Returns the floating-point number that represent positive infinity.\n  static RawType Infinity() {\n    return ReinterpretBits(kExponentBitMask);\n  }\n\n  // Returns the maximum representable finite floating-point number.\n  static RawType Max();\n\n  // Non-static methods\n\n  // Returns the bits that represents this number.\n  const Bits &bits() const { return u_.bits_; }\n\n  // Returns the exponent bits of this number.\n  Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }\n\n  // Returns the fraction bits of this number.\n  Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }\n\n  // Returns the sign bit of this number.\n  Bits sign_bit() const { return kSignBitMask & u_.bits_; }\n\n  // Returns true iff this is NAN (not a number).\n  bool is_nan() const {\n    // It's a NAN if the exponent bits are all ones and the fraction\n    // bits are not entirely zeros.\n    return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);\n  }\n\n  // Returns true iff this number is at most kMaxUlps ULP's away from\n  // rhs.  In particular, this function:\n  //\n  //   - returns false if either number is (or both are) NAN.\n  //   - treats really large numbers as almost equal to infinity.\n  //   - thinks +0.0 and -0.0 are 0 DLP's apart.\n  bool AlmostEquals(const FloatingPoint& rhs) const {\n    // The IEEE standard says that any comparison operation involving\n    // a NAN must return false.\n    if (is_nan() || rhs.is_nan()) return false;\n\n    return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)\n        <= kMaxUlps;\n  }\n\n private:\n  // The data type used to store the actual floating-point number.\n  union FloatingPointUnion {\n    RawType value_;  // The raw floating-point number.\n    Bits bits_;      // The bits that represent the number.\n  };\n\n  // Converts an integer from the sign-and-magnitude representation to\n  // the biased representation.  More precisely, let N be 2 to the\n  // power of (kBitCount - 1), an integer x is represented by the\n  // unsigned number x + N.\n  //\n  // For instance,\n  //\n  //   -N + 1 (the most negative number representable using\n  //          sign-and-magnitude) is represented by 1;\n  //   0      is represented by N; and\n  //   N - 1  (the biggest number representable using\n  //          sign-and-magnitude) is represented by 2N - 1.\n  //\n  // Read http://en.wikipedia.org/wiki/Signed_number_representations\n  // for more details on signed number representations.\n  static Bits SignAndMagnitudeToBiased(const Bits &sam) {\n    if (kSignBitMask & sam) {\n      // sam represents a negative number.\n      return ~sam + 1;\n    } else {\n      // sam represents a positive number.\n      return kSignBitMask | sam;\n    }\n  }\n\n  // Given two numbers in the sign-and-magnitude representation,\n  // returns the distance between them as an unsigned number.\n  static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,\n                                                     const Bits &sam2) {\n    const Bits biased1 = SignAndMagnitudeToBiased(sam1);\n    const Bits biased2 = SignAndMagnitudeToBiased(sam2);\n    return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);\n  }\n\n  FloatingPointUnion u_;\n};\n\n// We cannot use std::numeric_limits<T>::max() as it clashes with the max()\n// macro defined by <windows.h>.\ntemplate <>\ninline float FloatingPoint<float>::Max() { return FLT_MAX; }\ntemplate <>\ninline double FloatingPoint<double>::Max() { return DBL_MAX; }\n\n// Typedefs the instances of the FloatingPoint template class that we\n// care to use.\ntypedef FloatingPoint<float> Float;\ntypedef FloatingPoint<double> Double;\n\n// In order to catch the mistake of putting tests that use different\n// test fixture classes in the same test case, we need to assign\n// unique IDs to fixture classes and compare them.  The TypeId type is\n// used to hold such IDs.  The user should treat TypeId as an opaque\n// type: the only operation allowed on TypeId values is to compare\n// them for equality using the == operator.\ntypedef const void* TypeId;\n\ntemplate <typename T>\nclass TypeIdHelper {\n public:\n  // dummy_ must not have a const type.  Otherwise an overly eager\n  // compiler (e.g. MSVC 7.1 & 8.0) may try to merge\n  // TypeIdHelper<T>::dummy_ for different Ts as an \"optimization\".\n  static bool dummy_;\n};\n\ntemplate <typename T>\nbool TypeIdHelper<T>::dummy_ = false;\n\n// GetTypeId<T>() returns the ID of type T.  Different values will be\n// returned for different types.  Calling the function twice with the\n// same type argument is guaranteed to return the same ID.\ntemplate <typename T>\nTypeId GetTypeId() {\n  // The compiler is required to allocate a different\n  // TypeIdHelper<T>::dummy_ variable for each T used to instantiate\n  // the template.  Therefore, the address of dummy_ is guaranteed to\n  // be unique.\n  return &(TypeIdHelper<T>::dummy_);\n}\n\n// Returns the type ID of ::testing::Test.  Always call this instead\n// of GetTypeId< ::testing::Test>() to get the type ID of\n// ::testing::Test, as the latter may give the wrong result due to a\n// suspected linker bug when compiling Google Test as a Mac OS X\n// framework.\nGTEST_API_ TypeId GetTestTypeId();\n\n// Defines the abstract factory interface that creates instances\n// of a Test object.\nclass TestFactoryBase {\n public:\n  virtual ~TestFactoryBase() {}\n\n  // Creates a test instance to run. The instance is both created and destroyed\n  // within TestInfoImpl::Run()\n  virtual Test* CreateTest() = 0;\n\n protected:\n  TestFactoryBase() {}\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);\n};\n\n// This class provides implementation of TeastFactoryBase interface.\n// It is used in TEST and TEST_F macros.\ntemplate <class TestClass>\nclass TestFactoryImpl : public TestFactoryBase {\n public:\n  virtual Test* CreateTest() { return new TestClass; }\n};\n\n#if GTEST_OS_WINDOWS\n\n// Predicate-formatters for implementing the HRESULT checking macros\n// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}\n// We pass a long instead of HRESULT to avoid causing an\n// include dependency for the HRESULT type.\nGTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,\n                                            long hr);  // NOLINT\nGTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,\n                                            long hr);  // NOLINT\n\n#endif  // GTEST_OS_WINDOWS\n\n// Types of SetUpTestCase() and TearDownTestCase() functions.\ntypedef void (*SetUpTestCaseFunc)();\ntypedef void (*TearDownTestCaseFunc)();\n\n// Creates a new TestInfo object and registers it with Google Test;\n// returns the created object.\n//\n// Arguments:\n//\n//   test_case_name:   name of the test case\n//   name:             name of the test\n//   type_param        the name of the test's type parameter, or NULL if\n//                     this is not a typed or a type-parameterized test.\n//   value_param       text representation of the test's value parameter,\n//                     or NULL if this is not a type-parameterized test.\n//   fixture_class_id: ID of the test fixture class\n//   set_up_tc:        pointer to the function that sets up the test case\n//   tear_down_tc:     pointer to the function that tears down the test case\n//   factory:          pointer to the factory that creates a test object.\n//                     The newly created TestInfo instance will assume\n//                     ownership of the factory object.\nGTEST_API_ TestInfo* MakeAndRegisterTestInfo(\n    const char* test_case_name,\n    const char* name,\n    const char* type_param,\n    const char* value_param,\n    TypeId fixture_class_id,\n    SetUpTestCaseFunc set_up_tc,\n    TearDownTestCaseFunc tear_down_tc,\n    TestFactoryBase* factory);\n\n// If *pstr starts with the given prefix, modifies *pstr to be right\n// past the prefix and returns true; otherwise leaves *pstr unchanged\n// and returns false.  None of pstr, *pstr, and prefix can be NULL.\nGTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);\n\n#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P\n\n// State of the definition of a type-parameterized test case.\nclass GTEST_API_ TypedTestCasePState {\n public:\n  TypedTestCasePState() : registered_(false) {}\n\n  // Adds the given test name to defined_test_names_ and return true\n  // if the test case hasn't been registered; otherwise aborts the\n  // program.\n  bool AddTestName(const char* file, int line, const char* case_name,\n                   const char* test_name) {\n    if (registered_) {\n      fprintf(stderr, \"%s Test %s must be defined before \"\n              \"REGISTER_TYPED_TEST_CASE_P(%s, ...).\\n\",\n              FormatFileLocation(file, line).c_str(), test_name, case_name);\n      fflush(stderr);\n      posix::Abort();\n    }\n    defined_test_names_.insert(test_name);\n    return true;\n  }\n\n  // Verifies that registered_tests match the test names in\n  // defined_test_names_; returns registered_tests if successful, or\n  // aborts the program otherwise.\n  const char* VerifyRegisteredTestNames(\n      const char* file, int line, const char* registered_tests);\n\n private:\n  bool registered_;\n  ::std::set<const char*> defined_test_names_;\n};\n\n// Skips to the first non-space char after the first comma in 'str';\n// returns NULL if no comma is found in 'str'.\ninline const char* SkipComma(const char* str) {\n  const char* comma = strchr(str, ',');\n  if (comma == NULL) {\n    return NULL;\n  }\n  while (IsSpace(*(++comma))) {}\n  return comma;\n}\n\n// Returns the prefix of 'str' before the first comma in it; returns\n// the entire string if it contains no comma.\ninline std::string GetPrefixUntilComma(const char* str) {\n  const char* comma = strchr(str, ',');\n  return comma == NULL ? str : std::string(str, comma);\n}\n\n// TypeParameterizedTest<Fixture, TestSel, Types>::Register()\n// registers a list of type-parameterized tests with Google Test.  The\n// return value is insignificant - we just need to return something\n// such that we can call this function in a namespace scope.\n//\n// Implementation note: The GTEST_TEMPLATE_ macro declares a template\n// template parameter.  It's defined in gtest-type-util.h.\ntemplate <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>\nclass TypeParameterizedTest {\n public:\n  // 'index' is the index of the test in the type list 'Types'\n  // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,\n  // Types).  Valid values for 'index' are [0, N - 1] where N is the\n  // length of Types.\n  static bool Register(const char* prefix, const char* case_name,\n                       const char* test_names, int index) {\n    typedef typename Types::Head Type;\n    typedef Fixture<Type> FixtureClass;\n    typedef typename GTEST_BIND_(TestSel, Type) TestClass;\n\n    // First, registers the first type-parameterized test in the type\n    // list.\n    MakeAndRegisterTestInfo(\n        (std::string(prefix) + (prefix[0] == '\\0' ? \"\" : \"/\") + case_name + \"/\"\n         + StreamableToString(index)).c_str(),\n        GetPrefixUntilComma(test_names).c_str(),\n        GetTypeName<Type>().c_str(),\n        NULL,  // No value parameter.\n        GetTypeId<FixtureClass>(),\n        TestClass::SetUpTestCase,\n        TestClass::TearDownTestCase,\n        new TestFactoryImpl<TestClass>);\n\n    // Next, recurses (at compile time) with the tail of the type list.\n    return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>\n        ::Register(prefix, case_name, test_names, index + 1);\n  }\n};\n\n// The base case for the compile time recursion.\ntemplate <GTEST_TEMPLATE_ Fixture, class TestSel>\nclass TypeParameterizedTest<Fixture, TestSel, Types0> {\n public:\n  static bool Register(const char* /*prefix*/, const char* /*case_name*/,\n                       const char* /*test_names*/, int /*index*/) {\n    return true;\n  }\n};\n\n// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()\n// registers *all combinations* of 'Tests' and 'Types' with Google\n// Test.  The return value is insignificant - we just need to return\n// something such that we can call this function in a namespace scope.\ntemplate <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>\nclass TypeParameterizedTestCase {\n public:\n  static bool Register(const char* prefix, const char* case_name,\n                       const char* test_names) {\n    typedef typename Tests::Head Head;\n\n    // First, register the first test in 'Test' for each type in 'Types'.\n    TypeParameterizedTest<Fixture, Head, Types>::Register(\n        prefix, case_name, test_names, 0);\n\n    // Next, recurses (at compile time) with the tail of the test list.\n    return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>\n        ::Register(prefix, case_name, SkipComma(test_names));\n  }\n};\n\n// The base case for the compile time recursion.\ntemplate <GTEST_TEMPLATE_ Fixture, typename Types>\nclass TypeParameterizedTestCase<Fixture, Templates0, Types> {\n public:\n  static bool Register(const char* /*prefix*/, const char* /*case_name*/,\n                       const char* /*test_names*/) {\n    return true;\n  }\n};\n\n#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P\n\n// Returns the current OS stack trace as an std::string.\n//\n// The maximum number of stack frames to be included is specified by\n// the gtest_stack_trace_depth flag.  The skip_count parameter\n// specifies the number of top frames to be skipped, which doesn't\n// count against the number of frames to be included.\n//\n// For example, if Foo() calls Bar(), which in turn calls\n// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in\n// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.\nGTEST_API_ std::string GetCurrentOsStackTraceExceptTop(\n    UnitTest* unit_test, int skip_count);\n\n// Helpers for suppressing warnings on unreachable code or constant\n// condition.\n\n// Always returns true.\nGTEST_API_ bool AlwaysTrue();\n\n// Always returns false.\ninline bool AlwaysFalse() { return !AlwaysTrue(); }\n\n// Helper for suppressing false warning from Clang on a const char*\n// variable declared in a conditional expression always being NULL in\n// the else branch.\nstruct GTEST_API_ ConstCharPtr {\n  ConstCharPtr(const char* str) : value(str) {}\n  operator bool() const { return true; }\n  const char* value;\n};\n\n// A simple Linear Congruential Generator for generating random\n// numbers with a uniform distribution.  Unlike rand() and srand(), it\n// doesn't use global state (and therefore can't interfere with user\n// code).  Unlike rand_r(), it's portable.  An LCG isn't very random,\n// but it's good enough for our purposes.\nclass GTEST_API_ Random {\n public:\n  static const UInt32 kMaxRange = 1u << 31;\n\n  explicit Random(UInt32 seed) : state_(seed) {}\n\n  void Reseed(UInt32 seed) { state_ = seed; }\n\n  // Generates a random number from [0, range).  Crashes if 'range' is\n  // 0 or greater than kMaxRange.\n  UInt32 Generate(UInt32 range);\n\n private:\n  UInt32 state_;\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);\n};\n\n// Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a\n// compiler error iff T1 and T2 are different types.\ntemplate <typename T1, typename T2>\nstruct CompileAssertTypesEqual;\n\ntemplate <typename T>\nstruct CompileAssertTypesEqual<T, T> {\n};\n\n// Removes the reference from a type if it is a reference type,\n// otherwise leaves it unchanged.  This is the same as\n// tr1::remove_reference, which is not widely available yet.\ntemplate <typename T>\nstruct RemoveReference { typedef T type; };  // NOLINT\ntemplate <typename T>\nstruct RemoveReference<T&> { typedef T type; };  // NOLINT\n\n// A handy wrapper around RemoveReference that works when the argument\n// T depends on template parameters.\n#define GTEST_REMOVE_REFERENCE_(T) \\\n    typename ::testing::internal::RemoveReference<T>::type\n\n// Removes const from a type if it is a const type, otherwise leaves\n// it unchanged.  This is the same as tr1::remove_const, which is not\n// widely available yet.\ntemplate <typename T>\nstruct RemoveConst { typedef T type; };  // NOLINT\ntemplate <typename T>\nstruct RemoveConst<const T> { typedef T type; };  // NOLINT\n\n// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above\n// definition to fail to remove the const in 'const int[3]' and 'const\n// char[3][4]'.  The following specialization works around the bug.\ntemplate <typename T, size_t N>\nstruct RemoveConst<const T[N]> {\n  typedef typename RemoveConst<T>::type type[N];\n};\n\n#if defined(_MSC_VER) && _MSC_VER < 1400\n// This is the only specialization that allows VC++ 7.1 to remove const in\n// 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC\n// and thus needs to be conditionally compiled.\ntemplate <typename T, size_t N>\nstruct RemoveConst<T[N]> {\n  typedef typename RemoveConst<T>::type type[N];\n};\n#endif\n\n// A handy wrapper around RemoveConst that works when the argument\n// T depends on template parameters.\n#define GTEST_REMOVE_CONST_(T) \\\n    typename ::testing::internal::RemoveConst<T>::type\n\n// Turns const U&, U&, const U, and U all into U.\n#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \\\n    GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))\n\n// Adds reference to a type if it is not a reference type,\n// otherwise leaves it unchanged.  This is the same as\n// tr1::add_reference, which is not widely available yet.\ntemplate <typename T>\nstruct AddReference { typedef T& type; };  // NOLINT\ntemplate <typename T>\nstruct AddReference<T&> { typedef T& type; };  // NOLINT\n\n// A handy wrapper around AddReference that works when the argument T\n// depends on template parameters.\n#define GTEST_ADD_REFERENCE_(T) \\\n    typename ::testing::internal::AddReference<T>::type\n\n// Adds a reference to const on top of T as necessary.  For example,\n// it transforms\n//\n//   char         ==> const char&\n//   const char   ==> const char&\n//   char&        ==> const char&\n//   const char&  ==> const char&\n//\n// The argument T must depend on some template parameters.\n#define GTEST_REFERENCE_TO_CONST_(T) \\\n    GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))\n\n// ImplicitlyConvertible<From, To>::value is a compile-time bool\n// constant that's true iff type From can be implicitly converted to\n// type To.\ntemplate <typename From, typename To>\nclass ImplicitlyConvertible {\n private:\n  // We need the following helper functions only for their types.\n  // They have no implementations.\n\n  // MakeFrom() is an expression whose type is From.  We cannot simply\n  // use From(), as the type From may not have a public default\n  // constructor.\n  static From MakeFrom();\n\n  // These two functions are overloaded.  Given an expression\n  // Helper(x), the compiler will pick the first version if x can be\n  // implicitly converted to type To; otherwise it will pick the\n  // second version.\n  //\n  // The first version returns a value of size 1, and the second\n  // version returns a value of size 2.  Therefore, by checking the\n  // size of Helper(x), which can be done at compile time, we can tell\n  // which version of Helper() is used, and hence whether x can be\n  // implicitly converted to type To.\n  static char Helper(To);\n  static char (&Helper(...))[2];  // NOLINT\n\n  // We have to put the 'public' section after the 'private' section,\n  // or MSVC refuses to compile the code.\n public:\n  // MSVC warns about implicitly converting from double to int for\n  // possible loss of data, so we need to temporarily disable the\n  // warning.\n#ifdef _MSC_VER\n# pragma warning(push)          // Saves the current warning state.\n# pragma warning(disable:4244)  // Temporarily disables warning 4244.\n\n  static const bool value =\n      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;\n# pragma warning(pop)           // Restores the warning state.\n#elif defined(__BORLANDC__)\n  // C++Builder cannot use member overload resolution during template\n  // instantiation.  The simplest workaround is to use its C++0x type traits\n  // functions (C++Builder 2009 and above only).\n  static const bool value = __is_convertible(From, To);\n#else\n  static const bool value =\n      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;\n#endif  // _MSV_VER\n};\ntemplate <typename From, typename To>\nconst bool ImplicitlyConvertible<From, To>::value;\n\n// IsAProtocolMessage<T>::value is a compile-time bool constant that's\n// true iff T is type ProtocolMessage, proto2::Message, or a subclass\n// of those.\ntemplate <typename T>\nstruct IsAProtocolMessage\n    : public bool_constant<\n  ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||\n  ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {\n};\n\n// When the compiler sees expression IsContainerTest<C>(0), if C is an\n// STL-style container class, the first overload of IsContainerTest\n// will be viable (since both C::iterator* and C::const_iterator* are\n// valid types and NULL can be implicitly converted to them).  It will\n// be picked over the second overload as 'int' is a perfect match for\n// the type of argument 0.  If C::iterator or C::const_iterator is not\n// a valid type, the first overload is not viable, and the second\n// overload will be picked.  Therefore, we can determine whether C is\n// a container class by checking the type of IsContainerTest<C>(0).\n// The value of the expression is insignificant.\n//\n// Note that we look for both C::iterator and C::const_iterator.  The\n// reason is that C++ injects the name of a class as a member of the\n// class itself (e.g. you can refer to class iterator as either\n// 'iterator' or 'iterator::iterator').  If we look for C::iterator\n// only, for example, we would mistakenly think that a class named\n// iterator is an STL container.\n//\n// Also note that the simpler approach of overloading\n// IsContainerTest(typename C::const_iterator*) and\n// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.\ntypedef int IsContainer;\ntemplate <class C>\nIsContainer IsContainerTest(int /* dummy */,\n                            typename C::iterator* /* it */ = NULL,\n                            typename C::const_iterator* /* const_it */ = NULL) {\n  return 0;\n}\n\ntypedef char IsNotContainer;\ntemplate <class C>\nIsNotContainer IsContainerTest(long /* dummy */) { return '\\0'; }\n\n// EnableIf<condition>::type is void when 'Cond' is true, and\n// undefined when 'Cond' is false.  To use SFINAE to make a function\n// overload only apply when a particular expression is true, add\n// \"typename EnableIf<expression>::type* = 0\" as the last parameter.\ntemplate<bool> struct EnableIf;\ntemplate<> struct EnableIf<true> { typedef void type; };  // NOLINT\n\n// Utilities for native arrays.\n\n// ArrayEq() compares two k-dimensional native arrays using the\n// elements' operator==, where k can be any integer >= 0.  When k is\n// 0, ArrayEq() degenerates into comparing a single pair of values.\n\ntemplate <typename T, typename U>\nbool ArrayEq(const T* lhs, size_t size, const U* rhs);\n\n// This generic version is used when k is 0.\ntemplate <typename T, typename U>\ninline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }\n\n// This overload is used when k >= 1.\ntemplate <typename T, typename U, size_t N>\ninline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {\n  return internal::ArrayEq(lhs, N, rhs);\n}\n\n// This helper reduces code bloat.  If we instead put its logic inside\n// the previous ArrayEq() function, arrays with different sizes would\n// lead to different copies of the template code.\ntemplate <typename T, typename U>\nbool ArrayEq(const T* lhs, size_t size, const U* rhs) {\n  for (size_t i = 0; i != size; i++) {\n    if (!internal::ArrayEq(lhs[i], rhs[i]))\n      return false;\n  }\n  return true;\n}\n\n// Finds the first element in the iterator range [begin, end) that\n// equals elem.  Element may be a native array type itself.\ntemplate <typename Iter, typename Element>\nIter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {\n  for (Iter it = begin; it != end; ++it) {\n    if (internal::ArrayEq(*it, elem))\n      return it;\n  }\n  return end;\n}\n\n// CopyArray() copies a k-dimensional native array using the elements'\n// operator=, where k can be any integer >= 0.  When k is 0,\n// CopyArray() degenerates into copying a single value.\n\ntemplate <typename T, typename U>\nvoid CopyArray(const T* from, size_t size, U* to);\n\n// This generic version is used when k is 0.\ntemplate <typename T, typename U>\ninline void CopyArray(const T& from, U* to) { *to = from; }\n\n// This overload is used when k >= 1.\ntemplate <typename T, typename U, size_t N>\ninline void CopyArray(const T(&from)[N], U(*to)[N]) {\n  internal::CopyArray(from, N, *to);\n}\n\n// This helper reduces code bloat.  If we instead put its logic inside\n// the previous CopyArray() function, arrays with different sizes\n// would lead to different copies of the template code.\ntemplate <typename T, typename U>\nvoid CopyArray(const T* from, size_t size, U* to) {\n  for (size_t i = 0; i != size; i++) {\n    internal::CopyArray(from[i], to + i);\n  }\n}\n\n// The relation between an NativeArray object (see below) and the\n// native array it represents.\nenum RelationToSource {\n  kReference,  // The NativeArray references the native array.\n  kCopy        // The NativeArray makes a copy of the native array and\n               // owns the copy.\n};\n\n// Adapts a native array to a read-only STL-style container.  Instead\n// of the complete STL container concept, this adaptor only implements\n// members useful for Google Mock's container matchers.  New members\n// should be added as needed.  To simplify the implementation, we only\n// support Element being a raw type (i.e. having no top-level const or\n// reference modifier).  It's the client's responsibility to satisfy\n// this requirement.  Element can be an array type itself (hence\n// multi-dimensional arrays are supported).\ntemplate <typename Element>\nclass NativeArray {\n public:\n  // STL-style container typedefs.\n  typedef Element value_type;\n  typedef Element* iterator;\n  typedef const Element* const_iterator;\n\n  // Constructs from a native array.\n  NativeArray(const Element* array, size_t count, RelationToSource relation) {\n    Init(array, count, relation);\n  }\n\n  // Copy constructor.\n  NativeArray(const NativeArray& rhs) {\n    Init(rhs.array_, rhs.size_, rhs.relation_to_source_);\n  }\n\n  ~NativeArray() {\n    // Ensures that the user doesn't instantiate NativeArray with a\n    // const or reference type.\n    static_cast<void>(StaticAssertTypeEqHelper<Element,\n        GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());\n    if (relation_to_source_ == kCopy)\n      delete[] array_;\n  }\n\n  // STL-style container methods.\n  size_t size() const { return size_; }\n  const_iterator begin() const { return array_; }\n  const_iterator end() const { return array_ + size_; }\n  bool operator==(const NativeArray& rhs) const {\n    return size() == rhs.size() &&\n        ArrayEq(begin(), size(), rhs.begin());\n  }\n\n private:\n  // Initializes this object; makes a copy of the input array if\n  // 'relation' is kCopy.\n  void Init(const Element* array, size_t a_size, RelationToSource relation) {\n    if (relation == kReference) {\n      array_ = array;\n    } else {\n      Element* const copy = new Element[a_size];\n      CopyArray(array, a_size, copy);\n      array_ = copy;\n    }\n    size_ = a_size;\n    relation_to_source_ = relation;\n  }\n\n  const Element* array_;\n  size_t size_;\n  RelationToSource relation_to_source_;\n\n  GTEST_DISALLOW_ASSIGN_(NativeArray);\n};\n\n}  // namespace internal\n}  // namespace testing\n\n#define GTEST_MESSAGE_AT_(file, line, message, result_type) \\\n  ::testing::internal::AssertHelper(result_type, file, line, message) \\\n    = ::testing::Message()\n\n#define GTEST_MESSAGE_(message, result_type) \\\n  GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)\n\n#define GTEST_FATAL_FAILURE_(message) \\\n  return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)\n\n#define GTEST_NONFATAL_FAILURE_(message) \\\n  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)\n\n#define GTEST_SUCCESS_(message) \\\n  GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)\n\n// Suppresses MSVC warnings 4072 (unreachable code) for the code following\n// statement if it returns or throws (or doesn't return or throw in some\n// situations).\n#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \\\n  if (::testing::internal::AlwaysTrue()) { statement; }\n\n#define GTEST_TEST_THROW_(statement, expected_exception, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::ConstCharPtr gtest_msg = \"\") { \\\n    bool gtest_caught_expected = false; \\\n    try { \\\n      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n    } \\\n    catch (expected_exception const&) { \\\n      gtest_caught_expected = true; \\\n    } \\\n    catch (...) { \\\n      gtest_msg.value = \\\n          \"Expected: \" #statement \" throws an exception of type \" \\\n          #expected_exception \".\\n  Actual: it throws a different type.\"; \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \\\n    } \\\n    if (!gtest_caught_expected) { \\\n      gtest_msg.value = \\\n          \"Expected: \" #statement \" throws an exception of type \" \\\n          #expected_exception \".\\n  Actual: it throws nothing.\"; \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \\\n      fail(gtest_msg.value)\n\n#define GTEST_TEST_NO_THROW_(statement, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::AlwaysTrue()) { \\\n    try { \\\n      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n    } \\\n    catch (...) { \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \\\n      fail(\"Expected: \" #statement \" doesn't throw an exception.\\n\" \\\n           \"  Actual: it throws.\")\n\n#define GTEST_TEST_ANY_THROW_(statement, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::AlwaysTrue()) { \\\n    bool gtest_caught_any = false; \\\n    try { \\\n      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n    } \\\n    catch (...) { \\\n      gtest_caught_any = true; \\\n    } \\\n    if (!gtest_caught_any) { \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \\\n      fail(\"Expected: \" #statement \" throws an exception.\\n\" \\\n           \"  Actual: it doesn't.\")\n\n\n// Implements Boolean test assertions such as EXPECT_TRUE. expression can be\n// either a boolean expression or an AssertionResult. text is a textual\n// represenation of expression as it was passed into the EXPECT_TRUE.\n#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (const ::testing::AssertionResult gtest_ar_ = \\\n      ::testing::AssertionResult(expression)) \\\n    ; \\\n  else \\\n    fail(::testing::internal::GetBoolAssertionFailureMessage(\\\n        gtest_ar_, text, #actual, #expected).c_str())\n\n#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::AlwaysTrue()) { \\\n    ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \\\n    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n    if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \\\n      fail(\"Expected: \" #statement \" doesn't generate new fatal \" \\\n           \"failures in the current thread.\\n\" \\\n           \"  Actual: it does.\")\n\n// Expands to the name of the class that implements the given test.\n#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \\\n  test_case_name##_##test_name##_Test\n\n// Helper macro for defining tests.\n#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\\\nclass GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\\\n public:\\\n  GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\\\n private:\\\n  virtual void TestBody();\\\n  static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\\\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(\\\n      GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\\\n};\\\n\\\n::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\\\n  ::test_info_ =\\\n    ::testing::internal::MakeAndRegisterTestInfo(\\\n        #test_case_name, #test_name, NULL, NULL, \\\n        (parent_id), \\\n        parent_class::SetUpTestCase, \\\n        parent_class::TearDownTestCase, \\\n        new ::testing::internal::TestFactoryImpl<\\\n            GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\\\nvoid GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: wan@google.com (Zhanyong Wan)\n//\n// The Google C++ Testing Framework (Google Test)\n//\n// This header file defines the public API for death tests.  It is\n// #included by gtest.h so a user doesn't need to include this\n// directly.\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_\n#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)\n//\n// The Google C++ Testing Framework (Google Test)\n//\n// This header file defines internal utilities needed for implementing\n// death tests.  They are subject to change without notice.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_\n\n\n#include <stdio.h>\n\nnamespace testing {\nnamespace internal {\n\nGTEST_DECLARE_string_(internal_run_death_test);\n\n// Names of the flags (needed for parsing Google Test flags).\nconst char kDeathTestStyleFlag[] = \"death_test_style\";\nconst char kDeathTestUseFork[] = \"death_test_use_fork\";\nconst char kInternalRunDeathTestFlag[] = \"internal_run_death_test\";\n\n#if GTEST_HAS_DEATH_TEST\n\n// DeathTest is a class that hides much of the complexity of the\n// GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method\n// returns a concrete class that depends on the prevailing death test\n// style, as defined by the --gtest_death_test_style and/or\n// --gtest_internal_run_death_test flags.\n\n// In describing the results of death tests, these terms are used with\n// the corresponding definitions:\n//\n// exit status:  The integer exit information in the format specified\n//               by wait(2)\n// exit code:    The integer code passed to exit(3), _exit(2), or\n//               returned from main()\nclass GTEST_API_ DeathTest {\n public:\n  // Create returns false if there was an error determining the\n  // appropriate action to take for the current death test; for example,\n  // if the gtest_death_test_style flag is set to an invalid value.\n  // The LastMessage method will return a more detailed message in that\n  // case.  Otherwise, the DeathTest pointer pointed to by the \"test\"\n  // argument is set.  If the death test should be skipped, the pointer\n  // is set to NULL; otherwise, it is set to the address of a new concrete\n  // DeathTest object that controls the execution of the current test.\n  static bool Create(const char* statement, const RE* regex,\n                     const char* file, int line, DeathTest** test);\n  DeathTest();\n  virtual ~DeathTest() { }\n\n  // A helper class that aborts a death test when it's deleted.\n  class ReturnSentinel {\n   public:\n    explicit ReturnSentinel(DeathTest* test) : test_(test) { }\n    ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }\n   private:\n    DeathTest* const test_;\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);\n  } GTEST_ATTRIBUTE_UNUSED_;\n\n  // An enumeration of possible roles that may be taken when a death\n  // test is encountered.  EXECUTE means that the death test logic should\n  // be executed immediately.  OVERSEE means that the program should prepare\n  // the appropriate environment for a child process to execute the death\n  // test, then wait for it to complete.\n  enum TestRole { OVERSEE_TEST, EXECUTE_TEST };\n\n  // An enumeration of the three reasons that a test might be aborted.\n  enum AbortReason {\n    TEST_ENCOUNTERED_RETURN_STATEMENT,\n    TEST_THREW_EXCEPTION,\n    TEST_DID_NOT_DIE\n  };\n\n  // Assumes one of the above roles.\n  virtual TestRole AssumeRole() = 0;\n\n  // Waits for the death test to finish and returns its status.\n  virtual int Wait() = 0;\n\n  // Returns true if the death test passed; that is, the test process\n  // exited during the test, its exit status matches a user-supplied\n  // predicate, and its stderr output matches a user-supplied regular\n  // expression.\n  // The user-supplied predicate may be a macro expression rather\n  // than a function pointer or functor, or else Wait and Passed could\n  // be combined.\n  virtual bool Passed(bool exit_status_ok) = 0;\n\n  // Signals that the death test did not die as expected.\n  virtual void Abort(AbortReason reason) = 0;\n\n  // Returns a human-readable outcome message regarding the outcome of\n  // the last death test.\n  static const char* LastMessage();\n\n  static void set_last_death_test_message(const std::string& message);\n\n private:\n  // A string containing a description of the outcome of the last death test.\n  static std::string last_death_test_message_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);\n};\n\n// Factory interface for death tests.  May be mocked out for testing.\nclass DeathTestFactory {\n public:\n  virtual ~DeathTestFactory() { }\n  virtual bool Create(const char* statement, const RE* regex,\n                      const char* file, int line, DeathTest** test) = 0;\n};\n\n// A concrete DeathTestFactory implementation for normal use.\nclass DefaultDeathTestFactory : public DeathTestFactory {\n public:\n  virtual bool Create(const char* statement, const RE* regex,\n                      const char* file, int line, DeathTest** test);\n};\n\n// Returns true if exit_status describes a process that was terminated\n// by a signal, or exited normally with a nonzero exit code.\nGTEST_API_ bool ExitedUnsuccessfully(int exit_status);\n\n// Traps C++ exceptions escaping statement and reports them as test\n// failures. Note that trapping SEH exceptions is not implemented here.\n# if GTEST_HAS_EXCEPTIONS\n#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \\\n  try { \\\n    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n  } catch (const ::std::exception& gtest_exception) { \\\n    fprintf(\\\n        stderr, \\\n        \"\\n%s: Caught std::exception-derived exception escaping the \" \\\n        \"death test statement. Exception message: %s\\n\", \\\n        ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \\\n        gtest_exception.what()); \\\n    fflush(stderr); \\\n    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \\\n  } catch (...) { \\\n    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \\\n  }\n\n# else\n#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \\\n  GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)\n\n# endif\n\n// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,\n// ASSERT_EXIT*, and EXPECT_EXIT*.\n# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::AlwaysTrue()) { \\\n    const ::testing::internal::RE& gtest_regex = (regex); \\\n    ::testing::internal::DeathTest* gtest_dt; \\\n    if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \\\n        __FILE__, __LINE__, &gtest_dt)) { \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \\\n    } \\\n    if (gtest_dt != NULL) { \\\n      ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \\\n          gtest_dt_ptr(gtest_dt); \\\n      switch (gtest_dt->AssumeRole()) { \\\n        case ::testing::internal::DeathTest::OVERSEE_TEST: \\\n          if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \\\n            goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \\\n          } \\\n          break; \\\n        case ::testing::internal::DeathTest::EXECUTE_TEST: { \\\n          ::testing::internal::DeathTest::ReturnSentinel \\\n              gtest_sentinel(gtest_dt); \\\n          GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \\\n          gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \\\n          break; \\\n        } \\\n        default: \\\n          break; \\\n      } \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \\\n      fail(::testing::internal::DeathTest::LastMessage())\n// The symbol \"fail\" here expands to something into which a message\n// can be streamed.\n\n// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in\n// NDEBUG mode. In this case we need the statements to be executed, the regex is\n// ignored, and the macro must accept a streamed message even though the message\n// is never printed.\n# define GTEST_EXECUTE_STATEMENT_(statement, regex) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::AlwaysTrue()) { \\\n     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n  } else \\\n    ::testing::Message()\n\n// A class representing the parsed contents of the\n// --gtest_internal_run_death_test flag, as it existed when\n// RUN_ALL_TESTS was called.\nclass InternalRunDeathTestFlag {\n public:\n  InternalRunDeathTestFlag(const std::string& a_file,\n                           int a_line,\n                           int an_index,\n                           int a_write_fd)\n      : file_(a_file), line_(a_line), index_(an_index),\n        write_fd_(a_write_fd) {}\n\n  ~InternalRunDeathTestFlag() {\n    if (write_fd_ >= 0)\n      posix::Close(write_fd_);\n  }\n\n  const std::string& file() const { return file_; }\n  int line() const { return line_; }\n  int index() const { return index_; }\n  int write_fd() const { return write_fd_; }\n\n private:\n  std::string file_;\n  int line_;\n  int index_;\n  int write_fd_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);\n};\n\n// Returns a newly created InternalRunDeathTestFlag object with fields\n// initialized from the GTEST_FLAG(internal_run_death_test) flag if\n// the flag is specified; otherwise returns NULL.\nInternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();\n\n#else  // GTEST_HAS_DEATH_TEST\n\n// This macro is used for implementing macros such as\n// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where\n// death tests are not supported. Those macros must compile on such systems\n// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on\n// systems that support death tests. This allows one to write such a macro\n// on a system that does not support death tests and be sure that it will\n// compile on a death-test supporting system.\n//\n// Parameters:\n//   statement -  A statement that a macro such as EXPECT_DEATH would test\n//                for program termination. This macro has to make sure this\n//                statement is compiled but not executed, to ensure that\n//                EXPECT_DEATH_IF_SUPPORTED compiles with a certain\n//                parameter iff EXPECT_DEATH compiles with it.\n//   regex     -  A regex that a macro such as EXPECT_DEATH would use to test\n//                the output of statement.  This parameter has to be\n//                compiled but not evaluated by this macro, to ensure that\n//                this macro only accepts expressions that a macro such as\n//                EXPECT_DEATH would accept.\n//   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED\n//                and a return statement for ASSERT_DEATH_IF_SUPPORTED.\n//                This ensures that ASSERT_DEATH_IF_SUPPORTED will not\n//                compile inside functions where ASSERT_DEATH doesn't\n//                compile.\n//\n//  The branch that has an always false condition is used to ensure that\n//  statement and regex are compiled (and thus syntactically correct) but\n//  never executed. The unreachable code macro protects the terminator\n//  statement from generating an 'unreachable code' warning in case\n//  statement unconditionally returns or throws. The Message constructor at\n//  the end allows the syntax of streaming additional messages into the\n//  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.\n# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \\\n    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n    if (::testing::internal::AlwaysTrue()) { \\\n      GTEST_LOG_(WARNING) \\\n          << \"Death tests are not supported on this platform.\\n\" \\\n          << \"Statement '\" #statement \"' cannot be verified.\"; \\\n    } else if (::testing::internal::AlwaysFalse()) { \\\n      ::testing::internal::RE::PartialMatch(\".*\", (regex)); \\\n      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n      terminator; \\\n    } else \\\n      ::testing::Message()\n\n#endif  // GTEST_HAS_DEATH_TEST\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_\n\nnamespace testing {\n\n// This flag controls the style of death tests.  Valid values are \"threadsafe\",\n// meaning that the death test child process will re-execute the test binary\n// from the start, running only a single death test, or \"fast\",\n// meaning that the child process will execute the test logic immediately\n// after forking.\nGTEST_DECLARE_string_(death_test_style);\n\n#if GTEST_HAS_DEATH_TEST\n\nnamespace internal {\n\n// Returns a Boolean value indicating whether the caller is currently\n// executing in the context of the death test child process.  Tools such as\n// Valgrind heap checkers may need this to modify their behavior in death\n// tests.  IMPORTANT: This is an internal utility.  Using it may break the\n// implementation of death tests.  User code MUST NOT use it.\nGTEST_API_ bool InDeathTestChild();\n\n}  // namespace internal\n\n// The following macros are useful for writing death tests.\n\n// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is\n// executed:\n//\n//   1. It generates a warning if there is more than one active\n//   thread.  This is because it's safe to fork() or clone() only\n//   when there is a single thread.\n//\n//   2. The parent process clone()s a sub-process and runs the death\n//   test in it; the sub-process exits with code 0 at the end of the\n//   death test, if it hasn't exited already.\n//\n//   3. The parent process waits for the sub-process to terminate.\n//\n//   4. The parent process checks the exit code and error message of\n//   the sub-process.\n//\n// Examples:\n//\n//   ASSERT_DEATH(server.SendMessage(56, \"Hello\"), \"Invalid port number\");\n//   for (int i = 0; i < 5; i++) {\n//     EXPECT_DEATH(server.ProcessRequest(i),\n//                  \"Invalid request .* in ProcessRequest()\")\n//                  << \"Failed to die on request \" << i;\n//   }\n//\n//   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), \"Exiting\");\n//\n//   bool KilledBySIGHUP(int exit_code) {\n//     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;\n//   }\n//\n//   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, \"Hanging up!\");\n//\n// On the regular expressions used in death tests:\n//\n//   On POSIX-compliant systems (*nix), we use the <regex.h> library,\n//   which uses the POSIX extended regex syntax.\n//\n//   On other platforms (e.g. Windows), we only support a simple regex\n//   syntax implemented as part of Google Test.  This limited\n//   implementation should be enough most of the time when writing\n//   death tests; though it lacks many features you can find in PCRE\n//   or POSIX extended regex syntax.  For example, we don't support\n//   union (\"x|y\"), grouping (\"(xy)\"), brackets (\"[xy]\"), and\n//   repetition count (\"x{5,7}\"), among others.\n//\n//   Below is the syntax that we do support.  We chose it to be a\n//   subset of both PCRE and POSIX extended regex, so it's easy to\n//   learn wherever you come from.  In the following: 'A' denotes a\n//   literal character, period (.), or a single \\\\ escape sequence;\n//   'x' and 'y' denote regular expressions; 'm' and 'n' are for\n//   natural numbers.\n//\n//     c     matches any literal character c\n//     \\\\d   matches any decimal digit\n//     \\\\D   matches any character that's not a decimal digit\n//     \\\\f   matches \\f\n//     \\\\n   matches \\n\n//     \\\\r   matches \\r\n//     \\\\s   matches any ASCII whitespace, including \\n\n//     \\\\S   matches any character that's not a whitespace\n//     \\\\t   matches \\t\n//     \\\\v   matches \\v\n//     \\\\w   matches any letter, _, or decimal digit\n//     \\\\W   matches any character that \\\\w doesn't match\n//     \\\\c   matches any literal character c, which must be a punctuation\n//     .     matches any single character except \\n\n//     A?    matches 0 or 1 occurrences of A\n//     A*    matches 0 or many occurrences of A\n//     A+    matches 1 or many occurrences of A\n//     ^     matches the beginning of a string (not that of each line)\n//     $     matches the end of a string (not that of each line)\n//     xy    matches x followed by y\n//\n//   If you accidentally use PCRE or POSIX extended regex features\n//   not implemented by us, you will get a run-time failure.  In that\n//   case, please try to rewrite your regular expression within the\n//   above syntax.\n//\n//   This implementation is *not* meant to be as highly tuned or robust\n//   as a compiled regex library, but should perform well enough for a\n//   death test, which already incurs significant overhead by launching\n//   a child process.\n//\n// Known caveats:\n//\n//   A \"threadsafe\" style death test obtains the path to the test\n//   program from argv[0] and re-executes it in the sub-process.  For\n//   simplicity, the current implementation doesn't search the PATH\n//   when launching the sub-process.  This means that the user must\n//   invoke the test program via a path that contains at least one\n//   path separator (e.g. path/to/foo_test and\n//   /absolute/path/to/bar_test are fine, but foo_test is not).  This\n//   is rarely a problem as people usually don't put the test binary\n//   directory in PATH.\n//\n// TODO(wan@google.com): make thread-safe death tests search the PATH.\n\n// Asserts that a given statement causes the program to exit, with an\n// integer exit status that satisfies predicate, and emitting error output\n// that matches regex.\n# define ASSERT_EXIT(statement, predicate, regex) \\\n    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)\n\n// Like ASSERT_EXIT, but continues on to successive tests in the\n// test case, if any:\n# define EXPECT_EXIT(statement, predicate, regex) \\\n    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)\n\n// Asserts that a given statement causes the program to exit, either by\n// explicitly exiting with a nonzero exit code or being killed by a\n// signal, and emitting error output that matches regex.\n# define ASSERT_DEATH(statement, regex) \\\n    ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)\n\n// Like ASSERT_DEATH, but continues on to successive tests in the\n// test case, if any:\n# define EXPECT_DEATH(statement, regex) \\\n    EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)\n\n// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:\n\n// Tests that an exit code describes a normal exit with a given exit code.\nclass GTEST_API_ ExitedWithCode {\n public:\n  explicit ExitedWithCode(int exit_code);\n  bool operator()(int exit_status) const;\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ExitedWithCode& other);\n\n  const int exit_code_;\n};\n\n# if !GTEST_OS_WINDOWS\n// Tests that an exit code describes an exit due to termination by a\n// given signal.\nclass GTEST_API_ KilledBySignal {\n public:\n  explicit KilledBySignal(int signum);\n  bool operator()(int exit_status) const;\n private:\n  const int signum_;\n};\n# endif  // !GTEST_OS_WINDOWS\n\n// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.\n// The death testing framework causes this to have interesting semantics,\n// since the sideeffects of the call are only visible in opt mode, and not\n// in debug mode.\n//\n// In practice, this can be used to test functions that utilize the\n// LOG(DFATAL) macro using the following style:\n//\n// int DieInDebugOr12(int* sideeffect) {\n//   if (sideeffect) {\n//     *sideeffect = 12;\n//   }\n//   LOG(DFATAL) << \"death\";\n//   return 12;\n// }\n//\n// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {\n//   int sideeffect = 0;\n//   // Only asserts in dbg.\n//   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), \"death\");\n//\n// #ifdef NDEBUG\n//   // opt-mode has sideeffect visible.\n//   EXPECT_EQ(12, sideeffect);\n// #else\n//   // dbg-mode no visible sideeffect.\n//   EXPECT_EQ(0, sideeffect);\n// #endif\n// }\n//\n// This will assert that DieInDebugReturn12InOpt() crashes in debug\n// mode, usually due to a DCHECK or LOG(DFATAL), but returns the\n// appropriate fallback value (12 in this case) in opt mode. If you\n// need to test that a function has appropriate side-effects in opt\n// mode, include assertions against the side-effects.  A general\n// pattern for this is:\n//\n// EXPECT_DEBUG_DEATH({\n//   // Side-effects here will have an effect after this statement in\n//   // opt mode, but none in debug mode.\n//   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));\n// }, \"death\");\n//\n# ifdef NDEBUG\n\n#  define EXPECT_DEBUG_DEATH(statement, regex) \\\n  GTEST_EXECUTE_STATEMENT_(statement, regex)\n\n#  define ASSERT_DEBUG_DEATH(statement, regex) \\\n  GTEST_EXECUTE_STATEMENT_(statement, regex)\n\n# else\n\n#  define EXPECT_DEBUG_DEATH(statement, regex) \\\n  EXPECT_DEATH(statement, regex)\n\n#  define ASSERT_DEBUG_DEATH(statement, regex) \\\n  ASSERT_DEATH(statement, regex)\n\n# endif  // NDEBUG for EXPECT_DEBUG_DEATH\n#endif  // GTEST_HAS_DEATH_TEST\n\n// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and\n// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if\n// death tests are supported; otherwise they just issue a warning.  This is\n// useful when you are combining death test assertions with normal test\n// assertions in one test.\n#if GTEST_HAS_DEATH_TEST\n# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \\\n    EXPECT_DEATH(statement, regex)\n# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \\\n    ASSERT_DEATH(statement, regex)\n#else\n# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \\\n    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )\n# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \\\n    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)\n#endif\n\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_\n// This file was GENERATED by command:\n//     pump.py gtest-param-test.h.pump\n// DO NOT EDIT BY HAND!!!\n\n// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Authors: vladl@google.com (Vlad Losev)\n//\n// Macros and functions for implementing parameterized tests\n// in Google C++ Testing Framework (Google Test)\n//\n// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!\n//\n#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_\n#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_\n\n\n// Value-parameterized tests allow you to test your code with different\n// parameters without writing multiple copies of the same test.\n//\n// Here is how you use value-parameterized tests:\n\n#if 0\n\n// To write value-parameterized tests, first you should define a fixture\n// class. It is usually derived from testing::TestWithParam<T> (see below for\n// another inheritance scheme that's sometimes useful in more complicated\n// class hierarchies), where the type of your parameter values.\n// TestWithParam<T> is itself derived from testing::Test. T can be any\n// copyable type. If it's a raw pointer, you are responsible for managing the\n// lifespan of the pointed values.\n\nclass FooTest : public ::testing::TestWithParam<const char*> {\n  // You can implement all the usual class fixture members here.\n};\n\n// Then, use the TEST_P macro to define as many parameterized tests\n// for this fixture as you want. The _P suffix is for \"parameterized\"\n// or \"pattern\", whichever you prefer to think.\n\nTEST_P(FooTest, DoesBlah) {\n  // Inside a test, access the test parameter with the GetParam() method\n  // of the TestWithParam<T> class:\n  EXPECT_TRUE(foo.Blah(GetParam()));\n  ...\n}\n\nTEST_P(FooTest, HasBlahBlah) {\n  ...\n}\n\n// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test\n// case with any set of parameters you want. Google Test defines a number\n// of functions for generating test parameters. They return what we call\n// (surprise!) parameter generators. Here is a  summary of them, which\n// are all in the testing namespace:\n//\n//\n//  Range(begin, end [, step]) - Yields values {begin, begin+step,\n//                               begin+step+step, ...}. The values do not\n//                               include end. step defaults to 1.\n//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.\n//  ValuesIn(container)        - Yields values from a C-style array, an STL\n//  ValuesIn(begin,end)          container, or an iterator range [begin, end).\n//  Bool()                     - Yields sequence {false, true}.\n//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product\n//                               for the math savvy) of the values generated\n//                               by the N generators.\n//\n// For more details, see comments at the definitions of these functions below\n// in this file.\n//\n// The following statement will instantiate tests from the FooTest test case\n// each with parameter values \"meeny\", \"miny\", and \"moe\".\n\nINSTANTIATE_TEST_CASE_P(InstantiationName,\n                        FooTest,\n                        Values(\"meeny\", \"miny\", \"moe\"));\n\n// To distinguish different instances of the pattern, (yes, you\n// can instantiate it more then once) the first argument to the\n// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the\n// actual test case name. Remember to pick unique prefixes for different\n// instantiations. The tests from the instantiation above will have\n// these names:\n//\n//    * InstantiationName/FooTest.DoesBlah/0 for \"meeny\"\n//    * InstantiationName/FooTest.DoesBlah/1 for \"miny\"\n//    * InstantiationName/FooTest.DoesBlah/2 for \"moe\"\n//    * InstantiationName/FooTest.HasBlahBlah/0 for \"meeny\"\n//    * InstantiationName/FooTest.HasBlahBlah/1 for \"miny\"\n//    * InstantiationName/FooTest.HasBlahBlah/2 for \"moe\"\n//\n// You can use these names in --gtest_filter.\n//\n// This statement will instantiate all tests from FooTest again, each\n// with parameter values \"cat\" and \"dog\":\n\nconst char* pets[] = {\"cat\", \"dog\"};\nINSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));\n\n// The tests from the instantiation above will have these names:\n//\n//    * AnotherInstantiationName/FooTest.DoesBlah/0 for \"cat\"\n//    * AnotherInstantiationName/FooTest.DoesBlah/1 for \"dog\"\n//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for \"cat\"\n//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for \"dog\"\n//\n// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests\n// in the given test case, whether their definitions come before or\n// AFTER the INSTANTIATE_TEST_CASE_P statement.\n//\n// Please also note that generator expressions (including parameters to the\n// generators) are evaluated in InitGoogleTest(), after main() has started.\n// This allows the user on one hand, to adjust generator parameters in order\n// to dynamically determine a set of tests to run and on the other hand,\n// give the user a chance to inspect the generated tests with Google Test\n// reflection API before RUN_ALL_TESTS() is executed.\n//\n// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc\n// for more examples.\n//\n// In the future, we plan to publish the API for defining new parameter\n// generators. But for now this interface remains part of the internal\n// implementation and is subject to change.\n//\n//\n// A parameterized test fixture must be derived from testing::Test and from\n// testing::WithParamInterface<T>, where T is the type of the parameter\n// values. Inheriting from TestWithParam<T> satisfies that requirement because\n// TestWithParam<T> inherits from both Test and WithParamInterface. In more\n// complicated hierarchies, however, it is occasionally useful to inherit\n// separately from Test and WithParamInterface. For example:\n\nclass BaseTest : public ::testing::Test {\n  // You can inherit all the usual members for a non-parameterized test\n  // fixture here.\n};\n\nclass DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {\n  // The usual test fixture members go here too.\n};\n\nTEST_F(BaseTest, HasFoo) {\n  // This is an ordinary non-parameterized test.\n}\n\nTEST_P(DerivedTest, DoesBlah) {\n  // GetParam works just the same here as if you inherit from TestWithParam.\n  EXPECT_TRUE(foo.Blah(GetParam()));\n}\n\n#endif  // 0\n\n\n#if !GTEST_OS_SYMBIAN\n# include <utility>\n#endif\n\n// scripts/fuse_gtest.py depends on gtest's own header being #included\n// *unconditionally*.  Therefore these #includes cannot be moved\n// inside #if GTEST_HAS_PARAM_TEST.\n// Copyright 2008 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: vladl@google.com (Vlad Losev)\n\n// Type and function utilities for implementing parameterized tests.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_\n\n#include <iterator>\n#include <utility>\n#include <vector>\n\n// scripts/fuse_gtest.py depends on gtest's own header being #included\n// *unconditionally*.  Therefore these #includes cannot be moved\n// inside #if GTEST_HAS_PARAM_TEST.\n// Copyright 2003 Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Authors: Dan Egnor (egnor@google.com)\n//\n// A \"smart\" pointer type with reference tracking.  Every pointer to a\n// particular object is kept on a circular linked list.  When the last pointer\n// to an object is destroyed or reassigned, the object is deleted.\n//\n// Used properly, this deletes the object when the last reference goes away.\n// There are several caveats:\n// - Like all reference counting schemes, cycles lead to leaks.\n// - Each smart pointer is actually two pointers (8 bytes instead of 4).\n// - Every time a pointer is assigned, the entire list of pointers to that\n//   object is traversed.  This class is therefore NOT SUITABLE when there\n//   will often be more than two or three pointers to a particular object.\n// - References are only tracked as long as linked_ptr<> objects are copied.\n//   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS\n//   will happen (double deletion).\n//\n// A good use of this class is storing object references in STL containers.\n// You can safely put linked_ptr<> in a vector<>.\n// Other uses may not be as good.\n//\n// Note: If you use an incomplete type with linked_ptr<>, the class\n// *containing* linked_ptr<> must have a constructor and destructor (even\n// if they do nothing!).\n//\n// Bill Gibbons suggested we use something like this.\n//\n// Thread Safety:\n//   Unlike other linked_ptr implementations, in this implementation\n//   a linked_ptr object is thread-safe in the sense that:\n//     - it's safe to copy linked_ptr objects concurrently,\n//     - it's safe to copy *from* a linked_ptr and read its underlying\n//       raw pointer (e.g. via get()) concurrently, and\n//     - it's safe to write to two linked_ptrs that point to the same\n//       shared object concurrently.\n// TODO(wan@google.com): rename this to safe_linked_ptr to avoid\n// confusion with normal linked_ptr.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_\n\n#include <stdlib.h>\n#include <assert.h>\n\n\nnamespace testing {\nnamespace internal {\n\n// Protects copying of all linked_ptr objects.\nGTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);\n\n// This is used internally by all instances of linked_ptr<>.  It needs to be\n// a non-template class because different types of linked_ptr<> can refer to\n// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).\n// So, it needs to be possible for different types of linked_ptr to participate\n// in the same circular linked list, so we need a single class type here.\n//\n// DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.\nclass linked_ptr_internal {\n public:\n  // Create a new circle that includes only this instance.\n  void join_new() {\n    next_ = this;\n  }\n\n  // Many linked_ptr operations may change p.link_ for some linked_ptr\n  // variable p in the same circle as this object.  Therefore we need\n  // to prevent two such operations from occurring concurrently.\n  //\n  // Note that different types of linked_ptr objects can coexist in a\n  // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and\n  // linked_ptr<Derived2>).  Therefore we must use a single mutex to\n  // protect all linked_ptr objects.  This can create serious\n  // contention in production code, but is acceptable in a testing\n  // framework.\n\n  // Join an existing circle.\n  void join(linked_ptr_internal const* ptr)\n      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {\n    MutexLock lock(&g_linked_ptr_mutex);\n\n    linked_ptr_internal const* p = ptr;\n    while (p->next_ != ptr) p = p->next_;\n    p->next_ = this;\n    next_ = ptr;\n  }\n\n  // Leave whatever circle we're part of.  Returns true if we were the\n  // last member of the circle.  Once this is done, you can join() another.\n  bool depart()\n      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {\n    MutexLock lock(&g_linked_ptr_mutex);\n\n    if (next_ == this) return true;\n    linked_ptr_internal const* p = next_;\n    while (p->next_ != this) p = p->next_;\n    p->next_ = next_;\n    return false;\n  }\n\n private:\n  mutable linked_ptr_internal const* next_;\n};\n\ntemplate <typename T>\nclass linked_ptr {\n public:\n  typedef T element_type;\n\n  // Take over ownership of a raw pointer.  This should happen as soon as\n  // possible after the object is created.\n  explicit linked_ptr(T* ptr = NULL) { capture(ptr); }\n  ~linked_ptr() { depart(); }\n\n  // Copy an existing linked_ptr<>, adding ourselves to the list of references.\n  template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }\n  linked_ptr(linked_ptr const& ptr) {  // NOLINT\n    assert(&ptr != this);\n    copy(&ptr);\n  }\n\n  // Assignment releases the old value and acquires the new.\n  template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {\n    depart();\n    copy(&ptr);\n    return *this;\n  }\n\n  linked_ptr& operator=(linked_ptr const& ptr) {\n    if (&ptr != this) {\n      depart();\n      copy(&ptr);\n    }\n    return *this;\n  }\n\n  // Smart pointer members.\n  void reset(T* ptr = NULL) {\n    depart();\n    capture(ptr);\n  }\n  T* get() const { return value_; }\n  T* operator->() const { return value_; }\n  T& operator*() const { return *value_; }\n\n  bool operator==(T* p) const { return value_ == p; }\n  bool operator!=(T* p) const { return value_ != p; }\n  template <typename U>\n  bool operator==(linked_ptr<U> const& ptr) const {\n    return value_ == ptr.get();\n  }\n  template <typename U>\n  bool operator!=(linked_ptr<U> const& ptr) const {\n    return value_ != ptr.get();\n  }\n\n private:\n  template <typename U>\n  friend class linked_ptr;\n\n  T* value_;\n  linked_ptr_internal link_;\n\n  void depart() {\n    if (link_.depart()) delete value_;\n  }\n\n  void capture(T* ptr) {\n    value_ = ptr;\n    link_.join_new();\n  }\n\n  template <typename U> void copy(linked_ptr<U> const* ptr) {\n    value_ = ptr->get();\n    if (value_)\n      link_.join(&ptr->link_);\n    else\n      link_.join_new();\n  }\n};\n\ntemplate<typename T> inline\nbool operator==(T* ptr, const linked_ptr<T>& x) {\n  return ptr == x.get();\n}\n\ntemplate<typename T> inline\nbool operator!=(T* ptr, const linked_ptr<T>& x) {\n  return ptr != x.get();\n}\n\n// A function to convert T* into linked_ptr<T>\n// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation\n// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))\ntemplate <typename T>\nlinked_ptr<T> make_linked_ptr(T* ptr) {\n  return linked_ptr<T>(ptr);\n}\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_\n// Copyright 2007, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: wan@google.com (Zhanyong Wan)\n\n// Google Test - The Google C++ Testing Framework\n//\n// This file implements a universal value printer that can print a\n// value of any type T:\n//\n//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);\n//\n// A user can teach this function how to print a class type T by\n// defining either operator<<() or PrintTo() in the namespace that\n// defines T.  More specifically, the FIRST defined function in the\n// following list will be used (assuming T is defined in namespace\n// foo):\n//\n//   1. foo::PrintTo(const T&, ostream*)\n//   2. operator<<(ostream&, const T&) defined in either foo or the\n//      global namespace.\n//\n// If none of the above is defined, it will print the debug string of\n// the value if it is a protocol buffer, or print the raw bytes in the\n// value otherwise.\n//\n// To aid debugging: when T is a reference type, the address of the\n// value is also printed; when T is a (const) char pointer, both the\n// pointer value and the NUL-terminated string it points to are\n// printed.\n//\n// We also provide some convenient wrappers:\n//\n//   // Prints a value to a string.  For a (const or not) char\n//   // pointer, the NUL-terminated string (but not the pointer) is\n//   // printed.\n//   std::string ::testing::PrintToString(const T& value);\n//\n//   // Prints a value tersely: for a reference type, the referenced\n//   // value (but not the address) is printed; for a (const or not) char\n//   // pointer, the NUL-terminated string (but not the pointer) is\n//   // printed.\n//   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);\n//\n//   // Prints value using the type inferred by the compiler.  The difference\n//   // from UniversalTersePrint() is that this function prints both the\n//   // pointer and the NUL-terminated string for a (const or not) char pointer.\n//   void ::testing::internal::UniversalPrint(const T& value, ostream*);\n//\n//   // Prints the fields of a tuple tersely to a string vector, one\n//   // element for each field. Tuple support must be enabled in\n//   // gtest-port.h.\n//   std::vector<string> UniversalTersePrintTupleFieldsToStrings(\n//       const Tuple& value);\n//\n// Known limitation:\n//\n// The print primitives print the elements of an STL-style container\n// using the compiler-inferred type of *iter where iter is a\n// const_iterator of the container.  When const_iterator is an input\n// iterator but not a forward iterator, this inferred type may not\n// match value_type, and the print output may be incorrect.  In\n// practice, this is rarely a problem as for most containers\n// const_iterator is a forward iterator.  We'll fix this if there's an\n// actual need for it.  Note that this fix cannot rely on value_type\n// being defined as many user-defined container types don't have\n// value_type.\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_\n#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_\n\n#include <ostream>  // NOLINT\n#include <sstream>\n#include <string>\n#include <utility>\n#include <vector>\n\nnamespace testing {\n\n// Definitions in the 'internal' and 'internal2' name spaces are\n// subject to change without notice.  DO NOT USE THEM IN USER CODE!\nnamespace internal2 {\n\n// Prints the given number of bytes in the given object to the given\n// ostream.\nGTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,\n                                     size_t count,\n                                     ::std::ostream* os);\n\n// For selecting which printer to use when a given type has neither <<\n// nor PrintTo().\nenum TypeKind {\n  kProtobuf,              // a protobuf type\n  kConvertibleToInteger,  // a type implicitly convertible to BiggestInt\n                          // (e.g. a named or unnamed enum type)\n  kOtherType              // anything else\n};\n\n// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called\n// by the universal printer to print a value of type T when neither\n// operator<< nor PrintTo() is defined for T, where kTypeKind is the\n// \"kind\" of T as defined by enum TypeKind.\ntemplate <typename T, TypeKind kTypeKind>\nclass TypeWithoutFormatter {\n public:\n  // This default version is called when kTypeKind is kOtherType.\n  static void PrintValue(const T& value, ::std::ostream* os) {\n    PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),\n                         sizeof(value), os);\n  }\n};\n\n// We print a protobuf using its ShortDebugString() when the string\n// doesn't exceed this many characters; otherwise we print it using\n// DebugString() for better readability.\nconst size_t kProtobufOneLinerMaxLength = 50;\n\ntemplate <typename T>\nclass TypeWithoutFormatter<T, kProtobuf> {\n public:\n  static void PrintValue(const T& value, ::std::ostream* os) {\n    const ::testing::internal::string short_str = value.ShortDebugString();\n    const ::testing::internal::string pretty_str =\n        short_str.length() <= kProtobufOneLinerMaxLength ?\n        short_str : (\"\\n\" + value.DebugString());\n    *os << (\"<\" + pretty_str + \">\");\n  }\n};\n\ntemplate <typename T>\nclass TypeWithoutFormatter<T, kConvertibleToInteger> {\n public:\n  // Since T has no << operator or PrintTo() but can be implicitly\n  // converted to BiggestInt, we print it as a BiggestInt.\n  //\n  // Most likely T is an enum type (either named or unnamed), in which\n  // case printing it as an integer is the desired behavior.  In case\n  // T is not an enum, printing it as an integer is the best we can do\n  // given that it has no user-defined printer.\n  static void PrintValue(const T& value, ::std::ostream* os) {\n    const internal::BiggestInt kBigInt = value;\n    *os << kBigInt;\n  }\n};\n\n// Prints the given value to the given ostream.  If the value is a\n// protocol message, its debug string is printed; if it's an enum or\n// of a type implicitly convertible to BiggestInt, it's printed as an\n// integer; otherwise the bytes in the value are printed.  This is\n// what UniversalPrinter<T>::Print() does when it knows nothing about\n// type T and T has neither << operator nor PrintTo().\n//\n// A user can override this behavior for a class type Foo by defining\n// a << operator in the namespace where Foo is defined.\n//\n// We put this operator in namespace 'internal2' instead of 'internal'\n// to simplify the implementation, as much code in 'internal' needs to\n// use << in STL, which would conflict with our own << were it defined\n// in 'internal'.\n//\n// Note that this operator<< takes a generic std::basic_ostream<Char,\n// CharTraits> type instead of the more restricted std::ostream.  If\n// we define it to take an std::ostream instead, we'll get an\n// \"ambiguous overloads\" compiler error when trying to print a type\n// Foo that supports streaming to std::basic_ostream<Char,\n// CharTraits>, as the compiler cannot tell whether\n// operator<<(std::ostream&, const T&) or\n// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more\n// specific.\ntemplate <typename Char, typename CharTraits, typename T>\n::std::basic_ostream<Char, CharTraits>& operator<<(\n    ::std::basic_ostream<Char, CharTraits>& os, const T& x) {\n  TypeWithoutFormatter<T,\n      (internal::IsAProtocolMessage<T>::value ? kProtobuf :\n       internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?\n       kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);\n  return os;\n}\n\n}  // namespace internal2\n}  // namespace testing\n\n// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up\n// magic needed for implementing UniversalPrinter won't work.\nnamespace testing_internal {\n\n// Used to print a value that is not an STL-style container when the\n// user doesn't define PrintTo() for it.\ntemplate <typename T>\nvoid DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {\n  // With the following statement, during unqualified name lookup,\n  // testing::internal2::operator<< appears as if it was declared in\n  // the nearest enclosing namespace that contains both\n  // ::testing_internal and ::testing::internal2, i.e. the global\n  // namespace.  For more details, refer to the C++ Standard section\n  // 7.3.4-1 [namespace.udir].  This allows us to fall back onto\n  // testing::internal2::operator<< in case T doesn't come with a <<\n  // operator.\n  //\n  // We cannot write 'using ::testing::internal2::operator<<;', which\n  // gcc 3.3 fails to compile due to a compiler bug.\n  using namespace ::testing::internal2;  // NOLINT\n\n  // Assuming T is defined in namespace foo, in the next statement,\n  // the compiler will consider all of:\n  //\n  //   1. foo::operator<< (thanks to Koenig look-up),\n  //   2. ::operator<< (as the current namespace is enclosed in ::),\n  //   3. testing::internal2::operator<< (thanks to the using statement above).\n  //\n  // The operator<< whose type matches T best will be picked.\n  //\n  // We deliberately allow #2 to be a candidate, as sometimes it's\n  // impossible to define #1 (e.g. when foo is ::std, defining\n  // anything in it is undefined behavior unless you are a compiler\n  // vendor.).\n  *os << value;\n}\n\n}  // namespace testing_internal\n\nnamespace testing {\nnamespace internal {\n\n// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given\n// value to the given ostream.  The caller must ensure that\n// 'ostream_ptr' is not NULL, or the behavior is undefined.\n//\n// We define UniversalPrinter as a class template (as opposed to a\n// function template), as we need to partially specialize it for\n// reference types, which cannot be done with function templates.\ntemplate <typename T>\nclass UniversalPrinter;\n\ntemplate <typename T>\nvoid UniversalPrint(const T& value, ::std::ostream* os);\n\n// Used to print an STL-style container when the user doesn't define\n// a PrintTo() for it.\ntemplate <typename C>\nvoid DefaultPrintTo(IsContainer /* dummy */,\n                    false_type /* is not a pointer */,\n                    const C& container, ::std::ostream* os) {\n  const size_t kMaxCount = 32;  // The maximum number of elements to print.\n  *os << '{';\n  size_t count = 0;\n  for (typename C::const_iterator it = container.begin();\n       it != container.end(); ++it, ++count) {\n    if (count > 0) {\n      *os << ',';\n      if (count == kMaxCount) {  // Enough has been printed.\n        *os << \" ...\";\n        break;\n      }\n    }\n    *os << ' ';\n    // We cannot call PrintTo(*it, os) here as PrintTo() doesn't\n    // handle *it being a native array.\n    internal::UniversalPrint(*it, os);\n  }\n\n  if (count > 0) {\n    *os << ' ';\n  }\n  *os << '}';\n}\n\n// Used to print a pointer that is neither a char pointer nor a member\n// pointer, when the user doesn't define PrintTo() for it.  (A member\n// variable pointer or member function pointer doesn't really point to\n// a location in the address space.  Their representation is\n// implementation-defined.  Therefore they will be printed as raw\n// bytes.)\ntemplate <typename T>\nvoid DefaultPrintTo(IsNotContainer /* dummy */,\n                    true_type /* is a pointer */,\n                    T* p, ::std::ostream* os) {\n  if (p == NULL) {\n    *os << \"NULL\";\n  } else {\n    // C++ doesn't allow casting from a function pointer to any object\n    // pointer.\n    //\n    // IsTrue() silences warnings: \"Condition is always true\",\n    // \"unreachable code\".\n    if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {\n      // T is not a function type.  We just call << to print p,\n      // relying on ADL to pick up user-defined << for their pointer\n      // types, if any.\n      *os << p;\n    } else {\n      // T is a function type, so '*os << p' doesn't do what we want\n      // (it just prints p as bool).  We want to print p as a const\n      // void*.  However, we cannot cast it to const void* directly,\n      // even using reinterpret_cast, as earlier versions of gcc\n      // (e.g. 3.4.5) cannot compile the cast when p is a function\n      // pointer.  Casting to UInt64 first solves the problem.\n      *os << reinterpret_cast<const void*>(\n          reinterpret_cast<internal::UInt64>(p));\n    }\n  }\n}\n\n// Used to print a non-container, non-pointer value when the user\n// doesn't define PrintTo() for it.\ntemplate <typename T>\nvoid DefaultPrintTo(IsNotContainer /* dummy */,\n                    false_type /* is not a pointer */,\n                    const T& value, ::std::ostream* os) {\n  ::testing_internal::DefaultPrintNonContainerTo(value, os);\n}\n\n// Prints the given value using the << operator if it has one;\n// otherwise prints the bytes in it.  This is what\n// UniversalPrinter<T>::Print() does when PrintTo() is not specialized\n// or overloaded for type T.\n//\n// A user can override this behavior for a class type Foo by defining\n// an overload of PrintTo() in the namespace where Foo is defined.  We\n// give the user this option as sometimes defining a << operator for\n// Foo is not desirable (e.g. the coding style may prevent doing it,\n// or there is already a << operator but it doesn't do what the user\n// wants).\ntemplate <typename T>\nvoid PrintTo(const T& value, ::std::ostream* os) {\n  // DefaultPrintTo() is overloaded.  The type of its first two\n  // arguments determine which version will be picked.  If T is an\n  // STL-style container, the version for container will be called; if\n  // T is a pointer, the pointer version will be called; otherwise the\n  // generic version will be called.\n  //\n  // Note that we check for container types here, prior to we check\n  // for protocol message types in our operator<<.  The rationale is:\n  //\n  // For protocol messages, we want to give people a chance to\n  // override Google Mock's format by defining a PrintTo() or\n  // operator<<.  For STL containers, other formats can be\n  // incompatible with Google Mock's format for the container\n  // elements; therefore we check for container types here to ensure\n  // that our format is used.\n  //\n  // The second argument of DefaultPrintTo() is needed to bypass a bug\n  // in Symbian's C++ compiler that prevents it from picking the right\n  // overload between:\n  //\n  //   PrintTo(const T& x, ...);\n  //   PrintTo(T* x, ...);\n  DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);\n}\n\n// The following list of PrintTo() overloads tells\n// UniversalPrinter<T>::Print() how to print standard types (built-in\n// types, strings, plain arrays, and pointers).\n\n// Overloads for various char types.\nGTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);\nGTEST_API_ void PrintTo(signed char c, ::std::ostream* os);\ninline void PrintTo(char c, ::std::ostream* os) {\n  // When printing a plain char, we always treat it as unsigned.  This\n  // way, the output won't be affected by whether the compiler thinks\n  // char is signed or not.\n  PrintTo(static_cast<unsigned char>(c), os);\n}\n\n// Overloads for other simple built-in types.\ninline void PrintTo(bool x, ::std::ostream* os) {\n  *os << (x ? \"true\" : \"false\");\n}\n\n// Overload for wchar_t type.\n// Prints a wchar_t as a symbol if it is printable or as its internal\n// code otherwise and also as its decimal code (except for L'\\0').\n// The L'\\0' char is printed as \"L'\\\\0'\". The decimal code is printed\n// as signed integer when wchar_t is implemented by the compiler\n// as a signed type and is printed as an unsigned integer when wchar_t\n// is implemented as an unsigned type.\nGTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);\n\n// Overloads for C strings.\nGTEST_API_ void PrintTo(const char* s, ::std::ostream* os);\ninline void PrintTo(char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const char*>(s), os);\n}\n\n// signed/unsigned char is often used for representing binary data, so\n// we print pointers to it as void* to be safe.\ninline void PrintTo(const signed char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const void*>(s), os);\n}\ninline void PrintTo(signed char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const void*>(s), os);\n}\ninline void PrintTo(const unsigned char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const void*>(s), os);\n}\ninline void PrintTo(unsigned char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const void*>(s), os);\n}\n\n// MSVC can be configured to define wchar_t as a typedef of unsigned\n// short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native\n// type.  When wchar_t is a typedef, defining an overload for const\n// wchar_t* would cause unsigned short* be printed as a wide string,\n// possibly causing invalid memory accesses.\n#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)\n// Overloads for wide C strings\nGTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);\ninline void PrintTo(wchar_t* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const wchar_t*>(s), os);\n}\n#endif\n\n// Overload for C arrays.  Multi-dimensional arrays are printed\n// properly.\n\n// Prints the given number of elements in an array, without printing\n// the curly braces.\ntemplate <typename T>\nvoid PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {\n  UniversalPrint(a[0], os);\n  for (size_t i = 1; i != count; i++) {\n    *os << \", \";\n    UniversalPrint(a[i], os);\n  }\n}\n\n// Overloads for ::string and ::std::string.\n#if GTEST_HAS_GLOBAL_STRING\nGTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);\ninline void PrintTo(const ::string& s, ::std::ostream* os) {\n  PrintStringTo(s, os);\n}\n#endif  // GTEST_HAS_GLOBAL_STRING\n\nGTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);\ninline void PrintTo(const ::std::string& s, ::std::ostream* os) {\n  PrintStringTo(s, os);\n}\n\n// Overloads for ::wstring and ::std::wstring.\n#if GTEST_HAS_GLOBAL_WSTRING\nGTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);\ninline void PrintTo(const ::wstring& s, ::std::ostream* os) {\n  PrintWideStringTo(s, os);\n}\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n#if GTEST_HAS_STD_WSTRING\nGTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);\ninline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {\n  PrintWideStringTo(s, os);\n}\n#endif  // GTEST_HAS_STD_WSTRING\n\n#if GTEST_HAS_TR1_TUPLE\n// Overload for ::std::tr1::tuple.  Needed for printing function arguments,\n// which are packed as tuples.\n\n// Helper function for printing a tuple.  T must be instantiated with\n// a tuple type.\ntemplate <typename T>\nvoid PrintTupleTo(const T& t, ::std::ostream* os);\n\n// Overloaded PrintTo() for tuples of various arities.  We support\n// tuples of up-to 10 fields.  The following implementation works\n// regardless of whether tr1::tuple is implemented using the\n// non-standard variadic template feature or not.\n\ninline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1>\nvoid PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6, typename T7>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6, typename T7, typename T8>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6, typename T7, typename T8, typename T9>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6, typename T7, typename T8, typename T9, typename T10>\nvoid PrintTo(\n    const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,\n    ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n#endif  // GTEST_HAS_TR1_TUPLE\n\n// Overload for std::pair.\ntemplate <typename T1, typename T2>\nvoid PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {\n  *os << '(';\n  // We cannot use UniversalPrint(value.first, os) here, as T1 may be\n  // a reference type.  The same for printing value.second.\n  UniversalPrinter<T1>::Print(value.first, os);\n  *os << \", \";\n  UniversalPrinter<T2>::Print(value.second, os);\n  *os << ')';\n}\n\n// Implements printing a non-reference type T by letting the compiler\n// pick the right overload of PrintTo() for T.\ntemplate <typename T>\nclass UniversalPrinter {\n public:\n  // MSVC warns about adding const to a function type, so we want to\n  // disable the warning.\n#ifdef _MSC_VER\n# pragma warning(push)          // Saves the current warning state.\n# pragma warning(disable:4180)  // Temporarily disables warning 4180.\n#endif  // _MSC_VER\n\n  // Note: we deliberately don't call this PrintTo(), as that name\n  // conflicts with ::testing::internal::PrintTo in the body of the\n  // function.\n  static void Print(const T& value, ::std::ostream* os) {\n    // By default, ::testing::internal::PrintTo() is used for printing\n    // the value.\n    //\n    // Thanks to Koenig look-up, if T is a class and has its own\n    // PrintTo() function defined in its namespace, that function will\n    // be visible here.  Since it is more specific than the generic ones\n    // in ::testing::internal, it will be picked by the compiler in the\n    // following statement - exactly what we want.\n    PrintTo(value, os);\n  }\n\n#ifdef _MSC_VER\n# pragma warning(pop)           // Restores the warning state.\n#endif  // _MSC_VER\n};\n\n// UniversalPrintArray(begin, len, os) prints an array of 'len'\n// elements, starting at address 'begin'.\ntemplate <typename T>\nvoid UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {\n  if (len == 0) {\n    *os << \"{}\";\n  } else {\n    *os << \"{ \";\n    const size_t kThreshold = 18;\n    const size_t kChunkSize = 8;\n    // If the array has more than kThreshold elements, we'll have to\n    // omit some details by printing only the first and the last\n    // kChunkSize elements.\n    // TODO(wan@google.com): let the user control the threshold using a flag.\n    if (len <= kThreshold) {\n      PrintRawArrayTo(begin, len, os);\n    } else {\n      PrintRawArrayTo(begin, kChunkSize, os);\n      *os << \", ..., \";\n      PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);\n    }\n    *os << \" }\";\n  }\n}\n// This overload prints a (const) char array compactly.\nGTEST_API_ void UniversalPrintArray(\n    const char* begin, size_t len, ::std::ostream* os);\n\n// This overload prints a (const) wchar_t array compactly.\nGTEST_API_ void UniversalPrintArray(\n    const wchar_t* begin, size_t len, ::std::ostream* os);\n\n// Implements printing an array type T[N].\ntemplate <typename T, size_t N>\nclass UniversalPrinter<T[N]> {\n public:\n  // Prints the given array, omitting some elements when there are too\n  // many.\n  static void Print(const T (&a)[N], ::std::ostream* os) {\n    UniversalPrintArray(a, N, os);\n  }\n};\n\n// Implements printing a reference type T&.\ntemplate <typename T>\nclass UniversalPrinter<T&> {\n public:\n  // MSVC warns about adding const to a function type, so we want to\n  // disable the warning.\n#ifdef _MSC_VER\n# pragma warning(push)          // Saves the current warning state.\n# pragma warning(disable:4180)  // Temporarily disables warning 4180.\n#endif  // _MSC_VER\n\n  static void Print(const T& value, ::std::ostream* os) {\n    // Prints the address of the value.  We use reinterpret_cast here\n    // as static_cast doesn't compile when T is a function type.\n    *os << \"@\" << reinterpret_cast<const void*>(&value) << \" \";\n\n    // Then prints the value itself.\n    UniversalPrint(value, os);\n  }\n\n#ifdef _MSC_VER\n# pragma warning(pop)           // Restores the warning state.\n#endif  // _MSC_VER\n};\n\n// Prints a value tersely: for a reference type, the referenced value\n// (but not the address) is printed; for a (const) char pointer, the\n// NUL-terminated string (but not the pointer) is printed.\n\ntemplate <typename T>\nclass UniversalTersePrinter {\n public:\n  static void Print(const T& value, ::std::ostream* os) {\n    UniversalPrint(value, os);\n  }\n};\ntemplate <typename T>\nclass UniversalTersePrinter<T&> {\n public:\n  static void Print(const T& value, ::std::ostream* os) {\n    UniversalPrint(value, os);\n  }\n};\ntemplate <typename T, size_t N>\nclass UniversalTersePrinter<T[N]> {\n public:\n  static void Print(const T (&value)[N], ::std::ostream* os) {\n    UniversalPrinter<T[N]>::Print(value, os);\n  }\n};\ntemplate <>\nclass UniversalTersePrinter<const char*> {\n public:\n  static void Print(const char* str, ::std::ostream* os) {\n    if (str == NULL) {\n      *os << \"NULL\";\n    } else {\n      UniversalPrint(string(str), os);\n    }\n  }\n};\ntemplate <>\nclass UniversalTersePrinter<char*> {\n public:\n  static void Print(char* str, ::std::ostream* os) {\n    UniversalTersePrinter<const char*>::Print(str, os);\n  }\n};\n\n#if GTEST_HAS_STD_WSTRING\ntemplate <>\nclass UniversalTersePrinter<const wchar_t*> {\n public:\n  static void Print(const wchar_t* str, ::std::ostream* os) {\n    if (str == NULL) {\n      *os << \"NULL\";\n    } else {\n      UniversalPrint(::std::wstring(str), os);\n    }\n  }\n};\n#endif\n\ntemplate <>\nclass UniversalTersePrinter<wchar_t*> {\n public:\n  static void Print(wchar_t* str, ::std::ostream* os) {\n    UniversalTersePrinter<const wchar_t*>::Print(str, os);\n  }\n};\n\ntemplate <typename T>\nvoid UniversalTersePrint(const T& value, ::std::ostream* os) {\n  UniversalTersePrinter<T>::Print(value, os);\n}\n\n// Prints a value using the type inferred by the compiler.  The\n// difference between this and UniversalTersePrint() is that for a\n// (const) char pointer, this prints both the pointer and the\n// NUL-terminated string.\ntemplate <typename T>\nvoid UniversalPrint(const T& value, ::std::ostream* os) {\n  // A workarond for the bug in VC++ 7.1 that prevents us from instantiating\n  // UniversalPrinter with T directly.\n  typedef T T1;\n  UniversalPrinter<T1>::Print(value, os);\n}\n\n#if GTEST_HAS_TR1_TUPLE\ntypedef ::std::vector<string> Strings;\n\n// This helper template allows PrintTo() for tuples and\n// UniversalTersePrintTupleFieldsToStrings() to be defined by\n// induction on the number of tuple fields.  The idea is that\n// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N\n// fields in tuple t, and can be defined in terms of\n// TuplePrefixPrinter<N - 1>.\n\n// The inductive case.\ntemplate <size_t N>\nstruct TuplePrefixPrinter {\n  // Prints the first N fields of a tuple.\n  template <typename Tuple>\n  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {\n    TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);\n    *os << \", \";\n    UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>\n        ::Print(::std::tr1::get<N - 1>(t), os);\n  }\n\n  // Tersely prints the first N fields of a tuple to a string vector,\n  // one element for each field.\n  template <typename Tuple>\n  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {\n    TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);\n    ::std::stringstream ss;\n    UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);\n    strings->push_back(ss.str());\n  }\n};\n\n// Base cases.\ntemplate <>\nstruct TuplePrefixPrinter<0> {\n  template <typename Tuple>\n  static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}\n\n  template <typename Tuple>\n  static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}\n};\n// We have to specialize the entire TuplePrefixPrinter<> class\n// template here, even though the definition of\n// TersePrintPrefixToStrings() is the same as the generic version, as\n// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't\n// support specializing a method template of a class template.\ntemplate <>\nstruct TuplePrefixPrinter<1> {\n  template <typename Tuple>\n  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {\n    UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::\n        Print(::std::tr1::get<0>(t), os);\n  }\n\n  template <typename Tuple>\n  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {\n    ::std::stringstream ss;\n    UniversalTersePrint(::std::tr1::get<0>(t), &ss);\n    strings->push_back(ss.str());\n  }\n};\n\n// Helper function for printing a tuple.  T must be instantiated with\n// a tuple type.\ntemplate <typename T>\nvoid PrintTupleTo(const T& t, ::std::ostream* os) {\n  *os << \"(\";\n  TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::\n      PrintPrefixTo(t, os);\n  *os << \")\";\n}\n\n// Prints the fields of a tuple tersely to a string vector, one\n// element for each field.  See the comment before\n// UniversalTersePrint() for how we define \"tersely\".\ntemplate <typename Tuple>\nStrings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {\n  Strings result;\n  TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::\n      TersePrintPrefixToStrings(value, &result);\n  return result;\n}\n#endif  // GTEST_HAS_TR1_TUPLE\n\n}  // namespace internal\n\ntemplate <typename T>\n::std::string PrintToString(const T& value) {\n  ::std::stringstream ss;\n  internal::UniversalTersePrinter<T>::Print(value, &ss);\n  return ss.str();\n}\n\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_\n\n#if GTEST_HAS_PARAM_TEST\n\nnamespace testing {\nnamespace internal {\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Outputs a message explaining invalid registration of different\n// fixture class for the same test case. This may happen when\n// TEST_P macro is used to define two tests with the same name\n// but in different namespaces.\nGTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,\n                                          const char* file, int line);\n\ntemplate <typename> class ParamGeneratorInterface;\ntemplate <typename> class ParamGenerator;\n\n// Interface for iterating over elements provided by an implementation\n// of ParamGeneratorInterface<T>.\ntemplate <typename T>\nclass ParamIteratorInterface {\n public:\n  virtual ~ParamIteratorInterface() {}\n  // A pointer to the base generator instance.\n  // Used only for the purposes of iterator comparison\n  // to make sure that two iterators belong to the same generator.\n  virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;\n  // Advances iterator to point to the next element\n  // provided by the generator. The caller is responsible\n  // for not calling Advance() on an iterator equal to\n  // BaseGenerator()->End().\n  virtual void Advance() = 0;\n  // Clones the iterator object. Used for implementing copy semantics\n  // of ParamIterator<T>.\n  virtual ParamIteratorInterface* Clone() const = 0;\n  // Dereferences the current iterator and provides (read-only) access\n  // to the pointed value. It is the caller's responsibility not to call\n  // Current() on an iterator equal to BaseGenerator()->End().\n  // Used for implementing ParamGenerator<T>::operator*().\n  virtual const T* Current() const = 0;\n  // Determines whether the given iterator and other point to the same\n  // element in the sequence generated by the generator.\n  // Used for implementing ParamGenerator<T>::operator==().\n  virtual bool Equals(const ParamIteratorInterface& other) const = 0;\n};\n\n// Class iterating over elements provided by an implementation of\n// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>\n// and implements the const forward iterator concept.\ntemplate <typename T>\nclass ParamIterator {\n public:\n  typedef T value_type;\n  typedef const T& reference;\n  typedef ptrdiff_t difference_type;\n\n  // ParamIterator assumes ownership of the impl_ pointer.\n  ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}\n  ParamIterator& operator=(const ParamIterator& other) {\n    if (this != &other)\n      impl_.reset(other.impl_->Clone());\n    return *this;\n  }\n\n  const T& operator*() const { return *impl_->Current(); }\n  const T* operator->() const { return impl_->Current(); }\n  // Prefix version of operator++.\n  ParamIterator& operator++() {\n    impl_->Advance();\n    return *this;\n  }\n  // Postfix version of operator++.\n  ParamIterator operator++(int /*unused*/) {\n    ParamIteratorInterface<T>* clone = impl_->Clone();\n    impl_->Advance();\n    return ParamIterator(clone);\n  }\n  bool operator==(const ParamIterator& other) const {\n    return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);\n  }\n  bool operator!=(const ParamIterator& other) const {\n    return !(*this == other);\n  }\n\n private:\n  friend class ParamGenerator<T>;\n  explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}\n  scoped_ptr<ParamIteratorInterface<T> > impl_;\n};\n\n// ParamGeneratorInterface<T> is the binary interface to access generators\n// defined in other translation units.\ntemplate <typename T>\nclass ParamGeneratorInterface {\n public:\n  typedef T ParamType;\n\n  virtual ~ParamGeneratorInterface() {}\n\n  // Generator interface definition\n  virtual ParamIteratorInterface<T>* Begin() const = 0;\n  virtual ParamIteratorInterface<T>* End() const = 0;\n};\n\n// Wraps ParamGeneratorInterface<T> and provides general generator syntax\n// compatible with the STL Container concept.\n// This class implements copy initialization semantics and the contained\n// ParamGeneratorInterface<T> instance is shared among all copies\n// of the original object. This is possible because that instance is immutable.\ntemplate<typename T>\nclass ParamGenerator {\n public:\n  typedef ParamIterator<T> iterator;\n\n  explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}\n  ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}\n\n  ParamGenerator& operator=(const ParamGenerator& other) {\n    impl_ = other.impl_;\n    return *this;\n  }\n\n  iterator begin() const { return iterator(impl_->Begin()); }\n  iterator end() const { return iterator(impl_->End()); }\n\n private:\n  linked_ptr<const ParamGeneratorInterface<T> > impl_;\n};\n\n// Generates values from a range of two comparable values. Can be used to\n// generate sequences of user-defined types that implement operator+() and\n// operator<().\n// This class is used in the Range() function.\ntemplate <typename T, typename IncrementT>\nclass RangeGenerator : public ParamGeneratorInterface<T> {\n public:\n  RangeGenerator(T begin, T end, IncrementT step)\n      : begin_(begin), end_(end),\n        step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}\n  virtual ~RangeGenerator() {}\n\n  virtual ParamIteratorInterface<T>* Begin() const {\n    return new Iterator(this, begin_, 0, step_);\n  }\n  virtual ParamIteratorInterface<T>* End() const {\n    return new Iterator(this, end_, end_index_, step_);\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<T> {\n   public:\n    Iterator(const ParamGeneratorInterface<T>* base, T value, int index,\n             IncrementT step)\n        : base_(base), value_(value), index_(index), step_(step) {}\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {\n      return base_;\n    }\n    virtual void Advance() {\n      value_ = value_ + step_;\n      index_++;\n    }\n    virtual ParamIteratorInterface<T>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const T* Current() const { return &value_; }\n    virtual bool Equals(const ParamIteratorInterface<T>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const int other_index =\n          CheckedDowncastToActualType<const Iterator>(&other)->index_;\n      return index_ == other_index;\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : ParamIteratorInterface<T>(),\n          base_(other.base_), value_(other.value_), index_(other.index_),\n          step_(other.step_) {}\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<T>* const base_;\n    T value_;\n    int index_;\n    const IncrementT step_;\n  };  // class RangeGenerator::Iterator\n\n  static int CalculateEndIndex(const T& begin,\n                               const T& end,\n                               const IncrementT& step) {\n    int end_index = 0;\n    for (T i = begin; i < end; i = i + step)\n      end_index++;\n    return end_index;\n  }\n\n  // No implementation - assignment is unsupported.\n  void operator=(const RangeGenerator& other);\n\n  const T begin_;\n  const T end_;\n  const IncrementT step_;\n  // The index for the end() iterator. All the elements in the generated\n  // sequence are indexed (0-based) to aid iterator comparison.\n  const int end_index_;\n};  // class RangeGenerator\n\n\n// Generates values from a pair of STL-style iterators. Used in the\n// ValuesIn() function. The elements are copied from the source range\n// since the source can be located on the stack, and the generator\n// is likely to persist beyond that stack frame.\ntemplate <typename T>\nclass ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {\n public:\n  template <typename ForwardIterator>\n  ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)\n      : container_(begin, end) {}\n  virtual ~ValuesInIteratorRangeGenerator() {}\n\n  virtual ParamIteratorInterface<T>* Begin() const {\n    return new Iterator(this, container_.begin());\n  }\n  virtual ParamIteratorInterface<T>* End() const {\n    return new Iterator(this, container_.end());\n  }\n\n private:\n  typedef typename ::std::vector<T> ContainerType;\n\n  class Iterator : public ParamIteratorInterface<T> {\n   public:\n    Iterator(const ParamGeneratorInterface<T>* base,\n             typename ContainerType::const_iterator iterator)\n        : base_(base), iterator_(iterator) {}\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {\n      return base_;\n    }\n    virtual void Advance() {\n      ++iterator_;\n      value_.reset();\n    }\n    virtual ParamIteratorInterface<T>* Clone() const {\n      return new Iterator(*this);\n    }\n    // We need to use cached value referenced by iterator_ because *iterator_\n    // can return a temporary object (and of type other then T), so just\n    // having \"return &*iterator_;\" doesn't work.\n    // value_ is updated here and not in Advance() because Advance()\n    // can advance iterator_ beyond the end of the range, and we cannot\n    // detect that fact. The client code, on the other hand, is\n    // responsible for not calling Current() on an out-of-range iterator.\n    virtual const T* Current() const {\n      if (value_.get() == NULL)\n        value_.reset(new T(*iterator_));\n      return value_.get();\n    }\n    virtual bool Equals(const ParamIteratorInterface<T>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      return iterator_ ==\n          CheckedDowncastToActualType<const Iterator>(&other)->iterator_;\n    }\n\n   private:\n    Iterator(const Iterator& other)\n          // The explicit constructor call suppresses a false warning\n          // emitted by gcc when supplied with the -Wextra option.\n        : ParamIteratorInterface<T>(),\n          base_(other.base_),\n          iterator_(other.iterator_) {}\n\n    const ParamGeneratorInterface<T>* const base_;\n    typename ContainerType::const_iterator iterator_;\n    // A cached value of *iterator_. We keep it here to allow access by\n    // pointer in the wrapping iterator's operator->().\n    // value_ needs to be mutable to be accessed in Current().\n    // Use of scoped_ptr helps manage cached value's lifetime,\n    // which is bound by the lifespan of the iterator itself.\n    mutable scoped_ptr<const T> value_;\n  };  // class ValuesInIteratorRangeGenerator::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const ValuesInIteratorRangeGenerator& other);\n\n  const ContainerType container_;\n};  // class ValuesInIteratorRangeGenerator\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Stores a parameter value and later creates tests parameterized with that\n// value.\ntemplate <class TestClass>\nclass ParameterizedTestFactory : public TestFactoryBase {\n public:\n  typedef typename TestClass::ParamType ParamType;\n  explicit ParameterizedTestFactory(ParamType parameter) :\n      parameter_(parameter) {}\n  virtual Test* CreateTest() {\n    TestClass::SetParam(&parameter_);\n    return new TestClass();\n  }\n\n private:\n  const ParamType parameter_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);\n};\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// TestMetaFactoryBase is a base class for meta-factories that create\n// test factories for passing into MakeAndRegisterTestInfo function.\ntemplate <class ParamType>\nclass TestMetaFactoryBase {\n public:\n  virtual ~TestMetaFactoryBase() {}\n\n  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;\n};\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// TestMetaFactory creates test factories for passing into\n// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives\n// ownership of test factory pointer, same factory object cannot be passed\n// into that method twice. But ParameterizedTestCaseInfo is going to call\n// it for each Test/Parameter value combination. Thus it needs meta factory\n// creator class.\ntemplate <class TestCase>\nclass TestMetaFactory\n    : public TestMetaFactoryBase<typename TestCase::ParamType> {\n public:\n  typedef typename TestCase::ParamType ParamType;\n\n  TestMetaFactory() {}\n\n  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {\n    return new ParameterizedTestFactory<TestCase>(parameter);\n  }\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);\n};\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// ParameterizedTestCaseInfoBase is a generic interface\n// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase\n// accumulates test information provided by TEST_P macro invocations\n// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations\n// and uses that information to register all resulting test instances\n// in RegisterTests method. The ParameterizeTestCaseRegistry class holds\n// a collection of pointers to the ParameterizedTestCaseInfo objects\n// and calls RegisterTests() on each of them when asked.\nclass ParameterizedTestCaseInfoBase {\n public:\n  virtual ~ParameterizedTestCaseInfoBase() {}\n\n  // Base part of test case name for display purposes.\n  virtual const string& GetTestCaseName() const = 0;\n  // Test case id to verify identity.\n  virtual TypeId GetTestCaseTypeId() const = 0;\n  // UnitTest class invokes this method to register tests in this\n  // test case right before running them in RUN_ALL_TESTS macro.\n  // This method should not be called more then once on any single\n  // instance of a ParameterizedTestCaseInfoBase derived class.\n  virtual void RegisterTests() = 0;\n\n protected:\n  ParameterizedTestCaseInfoBase() {}\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);\n};\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P\n// macro invocations for a particular test case and generators\n// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that\n// test case. It registers tests with all values generated by all\n// generators when asked.\ntemplate <class TestCase>\nclass ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {\n public:\n  // ParamType and GeneratorCreationFunc are private types but are required\n  // for declarations of public methods AddTestPattern() and\n  // AddTestCaseInstantiation().\n  typedef typename TestCase::ParamType ParamType;\n  // A function that returns an instance of appropriate generator type.\n  typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();\n\n  explicit ParameterizedTestCaseInfo(const char* name)\n      : test_case_name_(name) {}\n\n  // Test case base name for display purposes.\n  virtual const string& GetTestCaseName() const { return test_case_name_; }\n  // Test case id to verify identity.\n  virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }\n  // TEST_P macro uses AddTestPattern() to record information\n  // about a single test in a LocalTestInfo structure.\n  // test_case_name is the base name of the test case (without invocation\n  // prefix). test_base_name is the name of an individual test without\n  // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is\n  // test case base name and DoBar is test base name.\n  void AddTestPattern(const char* test_case_name,\n                      const char* test_base_name,\n                      TestMetaFactoryBase<ParamType>* meta_factory) {\n    tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,\n                                                       test_base_name,\n                                                       meta_factory)));\n  }\n  // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information\n  // about a generator.\n  int AddTestCaseInstantiation(const string& instantiation_name,\n                               GeneratorCreationFunc* func,\n                               const char* /* file */,\n                               int /* line */) {\n    instantiations_.push_back(::std::make_pair(instantiation_name, func));\n    return 0;  // Return value used only to run this method in namespace scope.\n  }\n  // UnitTest class invokes this method to register tests in this test case\n  // test cases right before running tests in RUN_ALL_TESTS macro.\n  // This method should not be called more then once on any single\n  // instance of a ParameterizedTestCaseInfoBase derived class.\n  // UnitTest has a guard to prevent from calling this method more then once.\n  virtual void RegisterTests() {\n    for (typename TestInfoContainer::iterator test_it = tests_.begin();\n         test_it != tests_.end(); ++test_it) {\n      linked_ptr<TestInfo> test_info = *test_it;\n      for (typename InstantiationContainer::iterator gen_it =\n               instantiations_.begin(); gen_it != instantiations_.end();\n               ++gen_it) {\n        const string& instantiation_name = gen_it->first;\n        ParamGenerator<ParamType> generator((*gen_it->second)());\n\n        string test_case_name;\n        if ( !instantiation_name.empty() )\n          test_case_name = instantiation_name + \"/\";\n        test_case_name += test_info->test_case_base_name;\n\n        int i = 0;\n        for (typename ParamGenerator<ParamType>::iterator param_it =\n                 generator.begin();\n             param_it != generator.end(); ++param_it, ++i) {\n          Message test_name_stream;\n          test_name_stream << test_info->test_base_name << \"/\" << i;\n          MakeAndRegisterTestInfo(\n              test_case_name.c_str(),\n              test_name_stream.GetString().c_str(),\n              NULL,  // No type parameter.\n              PrintToString(*param_it).c_str(),\n              GetTestCaseTypeId(),\n              TestCase::SetUpTestCase,\n              TestCase::TearDownTestCase,\n              test_info->test_meta_factory->CreateTestFactory(*param_it));\n        }  // for param_it\n      }  // for gen_it\n    }  // for test_it\n  }  // RegisterTests\n\n private:\n  // LocalTestInfo structure keeps information about a single test registered\n  // with TEST_P macro.\n  struct TestInfo {\n    TestInfo(const char* a_test_case_base_name,\n             const char* a_test_base_name,\n             TestMetaFactoryBase<ParamType>* a_test_meta_factory) :\n        test_case_base_name(a_test_case_base_name),\n        test_base_name(a_test_base_name),\n        test_meta_factory(a_test_meta_factory) {}\n\n    const string test_case_base_name;\n    const string test_base_name;\n    const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;\n  };\n  typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;\n  // Keeps pairs of <Instantiation name, Sequence generator creation function>\n  // received from INSTANTIATE_TEST_CASE_P macros.\n  typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >\n      InstantiationContainer;\n\n  const string test_case_name_;\n  TestInfoContainer tests_;\n  InstantiationContainer instantiations_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);\n};  // class ParameterizedTestCaseInfo\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase\n// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P\n// macros use it to locate their corresponding ParameterizedTestCaseInfo\n// descriptors.\nclass ParameterizedTestCaseRegistry {\n public:\n  ParameterizedTestCaseRegistry() {}\n  ~ParameterizedTestCaseRegistry() {\n    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();\n         it != test_case_infos_.end(); ++it) {\n      delete *it;\n    }\n  }\n\n  // Looks up or creates and returns a structure containing information about\n  // tests and instantiations of a particular test case.\n  template <class TestCase>\n  ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(\n      const char* test_case_name,\n      const char* file,\n      int line) {\n    ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;\n    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();\n         it != test_case_infos_.end(); ++it) {\n      if ((*it)->GetTestCaseName() == test_case_name) {\n        if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {\n          // Complain about incorrect usage of Google Test facilities\n          // and terminate the program since we cannot guaranty correct\n          // test case setup and tear-down in this case.\n          ReportInvalidTestCaseType(test_case_name,  file, line);\n          posix::Abort();\n        } else {\n          // At this point we are sure that the object we found is of the same\n          // type we are looking for, so we downcast it to that type\n          // without further checks.\n          typed_test_info = CheckedDowncastToActualType<\n              ParameterizedTestCaseInfo<TestCase> >(*it);\n        }\n        break;\n      }\n    }\n    if (typed_test_info == NULL) {\n      typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);\n      test_case_infos_.push_back(typed_test_info);\n    }\n    return typed_test_info;\n  }\n  void RegisterTests() {\n    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();\n         it != test_case_infos_.end(); ++it) {\n      (*it)->RegisterTests();\n    }\n  }\n\n private:\n  typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;\n\n  TestCaseInfoContainer test_case_infos_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);\n};\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  //  GTEST_HAS_PARAM_TEST\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_\n// This file was GENERATED by command:\n//     pump.py gtest-param-util-generated.h.pump\n// DO NOT EDIT BY HAND!!!\n\n// Copyright 2008 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: vladl@google.com (Vlad Losev)\n\n// Type and function utilities for implementing parameterized tests.\n// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!\n//\n// Currently Google Test supports at most 50 arguments in Values,\n// and at most 10 arguments in Combine. Please contact\n// googletestframework@googlegroups.com if you need more.\n// Please note that the number of arguments to Combine is limited\n// by the maximum arity of the implementation of tr1::tuple which is\n// currently set at 10.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_\n\n// scripts/fuse_gtest.py depends on gtest's own header being #included\n// *unconditionally*.  Therefore these #includes cannot be moved\n// inside #if GTEST_HAS_PARAM_TEST.\n\n#if GTEST_HAS_PARAM_TEST\n\nnamespace testing {\n\n// Forward declarations of ValuesIn(), which is implemented in\n// include/gtest/gtest-param-test.h.\ntemplate <typename ForwardIterator>\ninternal::ParamGenerator<\n  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>\nValuesIn(ForwardIterator begin, ForwardIterator end);\n\ntemplate <typename T, size_t N>\ninternal::ParamGenerator<T> ValuesIn(const T (&array)[N]);\n\ntemplate <class Container>\ninternal::ParamGenerator<typename Container::value_type> ValuesIn(\n    const Container& container);\n\nnamespace internal {\n\n// Used in the Values() function to provide polymorphic capabilities.\ntemplate <typename T1>\nclass ValueArray1 {\n public:\n  explicit ValueArray1(T1 v1) : v1_(v1) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray1& other);\n\n  const T1 v1_;\n};\n\ntemplate <typename T1, typename T2>\nclass ValueArray2 {\n public:\n  ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray2& other);\n\n  const T1 v1_;\n  const T2 v2_;\n};\n\ntemplate <typename T1, typename T2, typename T3>\nclass ValueArray3 {\n public:\n  ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray3& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\nclass ValueArray4 {\n public:\n  ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray4& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nclass ValueArray5 {\n public:\n  ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray5& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\nclass ValueArray6 {\n public:\n  ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray6& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\nclass ValueArray7 {\n public:\n  ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray7& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\nclass ValueArray8 {\n public:\n  ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n      T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray8& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\nclass ValueArray9 {\n public:\n  ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,\n      T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray9& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\nclass ValueArray10 {\n public:\n  ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray10& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11>\nclass ValueArray11 {\n public:\n  ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray11& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12>\nclass ValueArray12 {\n public:\n  ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray12& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13>\nclass ValueArray13 {\n public:\n  ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray13& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14>\nclass ValueArray14 {\n public:\n  ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray14& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15>\nclass ValueArray15 {\n public:\n  ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray15& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16>\nclass ValueArray16 {\n public:\n  ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray16& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17>\nclass ValueArray17 {\n public:\n  ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,\n      T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray17& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18>\nclass ValueArray18 {\n public:\n  ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray18& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19>\nclass ValueArray19 {\n public:\n  ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),\n      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray19& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20>\nclass ValueArray20 {\n public:\n  ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),\n      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),\n      v19_(v19), v20_(v20) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray20& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21>\nclass ValueArray21 {\n public:\n  ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),\n      v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray21& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22>\nclass ValueArray22 {\n public:\n  ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray22& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23>\nclass ValueArray23 {\n public:\n  ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray23& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24>\nclass ValueArray24 {\n public:\n  ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),\n      v22_(v22), v23_(v23), v24_(v24) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray24& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25>\nclass ValueArray25 {\n public:\n  ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,\n      T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray25& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26>\nclass ValueArray26 {\n public:\n  ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray26& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27>\nclass ValueArray27 {\n public:\n  ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),\n      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),\n      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),\n      v26_(v26), v27_(v27) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray27& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28>\nclass ValueArray28 {\n public:\n  ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),\n      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),\n      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),\n      v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray28& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29>\nclass ValueArray29 {\n public:\n  ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),\n      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),\n      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray29& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30>\nclass ValueArray30 {\n public:\n  ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray30& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31>\nclass ValueArray31 {\n public:\n  ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray31& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32>\nclass ValueArray32 {\n public:\n  ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),\n      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),\n      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray32& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33>\nclass ValueArray33 {\n public:\n  ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,\n      T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray33& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34>\nclass ValueArray34 {\n public:\n  ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray34& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35>\nclass ValueArray35 {\n public:\n  ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),\n      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),\n      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),\n      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),\n      v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray35& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36>\nclass ValueArray36 {\n public:\n  ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),\n      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),\n      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),\n      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),\n      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray36& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37>\nclass ValueArray37 {\n public:\n  ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),\n      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),\n      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),\n      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),\n      v36_(v36), v37_(v37) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray37& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38>\nclass ValueArray38 {\n public:\n  ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),\n      v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray38& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39>\nclass ValueArray39 {\n public:\n  ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),\n      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray39& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40>\nclass ValueArray40 {\n public:\n  ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),\n      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),\n      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),\n      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),\n      v40_(v40) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray40& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41>\nclass ValueArray41 {\n public:\n  ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,\n      T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),\n      v39_(v39), v40_(v40), v41_(v41) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray41& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42>\nclass ValueArray42 {\n public:\n  ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),\n      v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray42& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43>\nclass ValueArray43 {\n public:\n  ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),\n      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),\n      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),\n      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),\n      v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),\n      v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray43& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44>\nclass ValueArray44 {\n public:\n  ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),\n      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),\n      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),\n      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),\n      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),\n      v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),\n      v43_(v43), v44_(v44) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray44& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45>\nclass ValueArray45 {\n public:\n  ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),\n      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),\n      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),\n      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),\n      v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),\n      v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray45& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46>\nclass ValueArray46 {\n public:\n  ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),\n      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),\n      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray46& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47>\nclass ValueArray47 {\n public:\n  ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),\n      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),\n      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),\n      v47_(v47) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray47& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n  const T47 v47_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48>\nclass ValueArray48 {\n public:\n  ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),\n      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),\n      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),\n      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),\n      v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),\n      v46_(v46), v47_(v47), v48_(v48) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),\n        static_cast<T>(v48_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray48& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n  const T47 v47_;\n  const T48 v48_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49>\nclass ValueArray49 {\n public:\n  ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,\n      T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),\n      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),\n      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),\n        static_cast<T>(v48_), static_cast<T>(v49_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray49& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n  const T47 v47_;\n  const T48 v48_;\n  const T49 v49_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49, typename T50>\nclass ValueArray50 {\n public:\n  ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,\n      T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),\n      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),\n      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),\n        static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};\n    return ValuesIn(array);\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray50& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n  const T47 v47_;\n  const T48 v48_;\n  const T49 v49_;\n  const T50 v50_;\n};\n\n# if GTEST_HAS_COMBINE\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Generates values from the Cartesian product of values produced\n// by the argument generators.\n//\ntemplate <typename T1, typename T2>\nclass CartesianProductGenerator2\n    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {\n public:\n  typedef ::std::tr1::tuple<T1, T2> ParamType;\n\n  CartesianProductGenerator2(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2)\n      : g1_(g1), g2_(g2) {}\n  virtual ~CartesianProductGenerator2() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current2_;\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return &current_value_; }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_ = ParamType(*current1_, *current2_);\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    ParamType current_value_;\n  };  // class CartesianProductGenerator2::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator2& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n};  // class CartesianProductGenerator2\n\n\ntemplate <typename T1, typename T2, typename T3>\nclass CartesianProductGenerator3\n    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {\n public:\n  typedef ::std::tr1::tuple<T1, T2, T3> ParamType;\n\n  CartesianProductGenerator3(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)\n      : g1_(g1), g2_(g2), g3_(g3) {}\n  virtual ~CartesianProductGenerator3() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current3_;\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return &current_value_; }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_ = ParamType(*current1_, *current2_, *current3_);\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    ParamType current_value_;\n  };  // class CartesianProductGenerator3::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator3& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n};  // class CartesianProductGenerator3\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\nclass CartesianProductGenerator4\n    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {\n public:\n  typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;\n\n  CartesianProductGenerator4(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}\n  virtual ~CartesianProductGenerator4() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current4_;\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return &current_value_; }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_ = ParamType(*current1_, *current2_, *current3_,\n            *current4_);\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    ParamType current_value_;\n  };  // class CartesianProductGenerator4::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator4& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n};  // class CartesianProductGenerator4\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nclass CartesianProductGenerator5\n    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {\n public:\n  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;\n\n  CartesianProductGenerator5(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}\n  virtual ~CartesianProductGenerator5() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current5_;\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return &current_value_; }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_ = ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_);\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    ParamType current_value_;\n  };  // class CartesianProductGenerator5::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator5& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n};  // class CartesianProductGenerator5\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\nclass CartesianProductGenerator6\n    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,\n        T6> > {\n public:\n  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;\n\n  CartesianProductGenerator6(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}\n  virtual ~CartesianProductGenerator6() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current6_;\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return &current_value_; }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_ = ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_);\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    ParamType current_value_;\n  };  // class CartesianProductGenerator6::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator6& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n};  // class CartesianProductGenerator6\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\nclass CartesianProductGenerator7\n    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,\n        T7> > {\n public:\n  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;\n\n  CartesianProductGenerator7(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}\n  virtual ~CartesianProductGenerator7() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,\n        g7_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6,\n      const ParamGenerator<T7>& g7,\n      const typename ParamGenerator<T7>::iterator& current7)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),\n          begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current7_;\n      if (current7_ == end7_) {\n        current7_ = begin7_;\n        ++current6_;\n      }\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return &current_value_; }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_ &&\n          current7_ == typed_other->current7_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_),\n        begin7_(other.begin7_),\n        end7_(other.end7_),\n        current7_(other.current7_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_ = ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_, *current7_);\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_ ||\n          current7_ == end7_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    const typename ParamGenerator<T7>::iterator begin7_;\n    const typename ParamGenerator<T7>::iterator end7_;\n    typename ParamGenerator<T7>::iterator current7_;\n    ParamType current_value_;\n  };  // class CartesianProductGenerator7::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator7& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n  const ParamGenerator<T7> g7_;\n};  // class CartesianProductGenerator7\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\nclass CartesianProductGenerator8\n    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,\n        T7, T8> > {\n public:\n  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;\n\n  CartesianProductGenerator8(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,\n      const ParamGenerator<T8>& g8)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),\n          g8_(g8) {}\n  virtual ~CartesianProductGenerator8() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,\n        g7_.begin(), g8_, g8_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,\n        g8_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6,\n      const ParamGenerator<T7>& g7,\n      const typename ParamGenerator<T7>::iterator& current7,\n      const ParamGenerator<T8>& g8,\n      const typename ParamGenerator<T8>::iterator& current8)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),\n          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),\n          begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current8_;\n      if (current8_ == end8_) {\n        current8_ = begin8_;\n        ++current7_;\n      }\n      if (current7_ == end7_) {\n        current7_ = begin7_;\n        ++current6_;\n      }\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return &current_value_; }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_ &&\n          current7_ == typed_other->current7_ &&\n          current8_ == typed_other->current8_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_),\n        begin7_(other.begin7_),\n        end7_(other.end7_),\n        current7_(other.current7_),\n        begin8_(other.begin8_),\n        end8_(other.end8_),\n        current8_(other.current8_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_ = ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_, *current7_, *current8_);\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_ ||\n          current7_ == end7_ ||\n          current8_ == end8_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    const typename ParamGenerator<T7>::iterator begin7_;\n    const typename ParamGenerator<T7>::iterator end7_;\n    typename ParamGenerator<T7>::iterator current7_;\n    const typename ParamGenerator<T8>::iterator begin8_;\n    const typename ParamGenerator<T8>::iterator end8_;\n    typename ParamGenerator<T8>::iterator current8_;\n    ParamType current_value_;\n  };  // class CartesianProductGenerator8::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator8& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n  const ParamGenerator<T7> g7_;\n  const ParamGenerator<T8> g8_;\n};  // class CartesianProductGenerator8\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\nclass CartesianProductGenerator9\n    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,\n        T7, T8, T9> > {\n public:\n  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;\n\n  CartesianProductGenerator9(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,\n      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),\n          g9_(g9) {}\n  virtual ~CartesianProductGenerator9() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,\n        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,\n        g8_.end(), g9_, g9_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6,\n      const ParamGenerator<T7>& g7,\n      const typename ParamGenerator<T7>::iterator& current7,\n      const ParamGenerator<T8>& g8,\n      const typename ParamGenerator<T8>::iterator& current8,\n      const ParamGenerator<T9>& g9,\n      const typename ParamGenerator<T9>::iterator& current9)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),\n          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),\n          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),\n          begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current9_;\n      if (current9_ == end9_) {\n        current9_ = begin9_;\n        ++current8_;\n      }\n      if (current8_ == end8_) {\n        current8_ = begin8_;\n        ++current7_;\n      }\n      if (current7_ == end7_) {\n        current7_ = begin7_;\n        ++current6_;\n      }\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return &current_value_; }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_ &&\n          current7_ == typed_other->current7_ &&\n          current8_ == typed_other->current8_ &&\n          current9_ == typed_other->current9_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_),\n        begin7_(other.begin7_),\n        end7_(other.end7_),\n        current7_(other.current7_),\n        begin8_(other.begin8_),\n        end8_(other.end8_),\n        current8_(other.current8_),\n        begin9_(other.begin9_),\n        end9_(other.end9_),\n        current9_(other.current9_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_ = ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_, *current7_, *current8_,\n            *current9_);\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_ ||\n          current7_ == end7_ ||\n          current8_ == end8_ ||\n          current9_ == end9_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    const typename ParamGenerator<T7>::iterator begin7_;\n    const typename ParamGenerator<T7>::iterator end7_;\n    typename ParamGenerator<T7>::iterator current7_;\n    const typename ParamGenerator<T8>::iterator begin8_;\n    const typename ParamGenerator<T8>::iterator end8_;\n    typename ParamGenerator<T8>::iterator current8_;\n    const typename ParamGenerator<T9>::iterator begin9_;\n    const typename ParamGenerator<T9>::iterator end9_;\n    typename ParamGenerator<T9>::iterator current9_;\n    ParamType current_value_;\n  };  // class CartesianProductGenerator9::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator9& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n  const ParamGenerator<T7> g7_;\n  const ParamGenerator<T8> g8_;\n  const ParamGenerator<T9> g9_;\n};  // class CartesianProductGenerator9\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\nclass CartesianProductGenerator10\n    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,\n        T7, T8, T9, T10> > {\n public:\n  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;\n\n  CartesianProductGenerator10(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,\n      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,\n      const ParamGenerator<T10>& g10)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),\n          g9_(g9), g10_(g10) {}\n  virtual ~CartesianProductGenerator10() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,\n        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,\n        g8_.end(), g9_, g9_.end(), g10_, g10_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6,\n      const ParamGenerator<T7>& g7,\n      const typename ParamGenerator<T7>::iterator& current7,\n      const ParamGenerator<T8>& g8,\n      const typename ParamGenerator<T8>::iterator& current8,\n      const ParamGenerator<T9>& g9,\n      const typename ParamGenerator<T9>::iterator& current9,\n      const ParamGenerator<T10>& g10,\n      const typename ParamGenerator<T10>::iterator& current10)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),\n          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),\n          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),\n          begin9_(g9.begin()), end9_(g9.end()), current9_(current9),\n          begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current10_;\n      if (current10_ == end10_) {\n        current10_ = begin10_;\n        ++current9_;\n      }\n      if (current9_ == end9_) {\n        current9_ = begin9_;\n        ++current8_;\n      }\n      if (current8_ == end8_) {\n        current8_ = begin8_;\n        ++current7_;\n      }\n      if (current7_ == end7_) {\n        current7_ = begin7_;\n        ++current6_;\n      }\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return &current_value_; }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_ &&\n          current7_ == typed_other->current7_ &&\n          current8_ == typed_other->current8_ &&\n          current9_ == typed_other->current9_ &&\n          current10_ == typed_other->current10_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_),\n        begin7_(other.begin7_),\n        end7_(other.end7_),\n        current7_(other.current7_),\n        begin8_(other.begin8_),\n        end8_(other.end8_),\n        current8_(other.current8_),\n        begin9_(other.begin9_),\n        end9_(other.end9_),\n        current9_(other.current9_),\n        begin10_(other.begin10_),\n        end10_(other.end10_),\n        current10_(other.current10_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_ = ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_, *current7_, *current8_,\n            *current9_, *current10_);\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_ ||\n          current7_ == end7_ ||\n          current8_ == end8_ ||\n          current9_ == end9_ ||\n          current10_ == end10_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    const typename ParamGenerator<T7>::iterator begin7_;\n    const typename ParamGenerator<T7>::iterator end7_;\n    typename ParamGenerator<T7>::iterator current7_;\n    const typename ParamGenerator<T8>::iterator begin8_;\n    const typename ParamGenerator<T8>::iterator end8_;\n    typename ParamGenerator<T8>::iterator current8_;\n    const typename ParamGenerator<T9>::iterator begin9_;\n    const typename ParamGenerator<T9>::iterator end9_;\n    typename ParamGenerator<T9>::iterator current9_;\n    const typename ParamGenerator<T10>::iterator begin10_;\n    const typename ParamGenerator<T10>::iterator end10_;\n    typename ParamGenerator<T10>::iterator current10_;\n    ParamType current_value_;\n  };  // class CartesianProductGenerator10::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator10& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n  const ParamGenerator<T7> g7_;\n  const ParamGenerator<T8> g8_;\n  const ParamGenerator<T9> g9_;\n  const ParamGenerator<T10> g10_;\n};  // class CartesianProductGenerator10\n\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Helper classes providing Combine() with polymorphic features. They allow\n// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is\n// convertible to U.\n//\ntemplate <class Generator1, class Generator2>\nclass CartesianProductHolder2 {\n public:\nCartesianProductHolder2(const Generator1& g1, const Generator2& g2)\n      : g1_(g1), g2_(g2) {}\n  template <typename T1, typename T2>\n  operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {\n    return ParamGenerator< ::std::tr1::tuple<T1, T2> >(\n        new CartesianProductGenerator2<T1, T2>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder2& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n};  // class CartesianProductHolder2\n\ntemplate <class Generator1, class Generator2, class Generator3>\nclass CartesianProductHolder3 {\n public:\nCartesianProductHolder3(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3)\n      : g1_(g1), g2_(g2), g3_(g3) {}\n  template <typename T1, typename T2, typename T3>\n  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {\n    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(\n        new CartesianProductGenerator3<T1, T2, T3>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder3& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n};  // class CartesianProductHolder3\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4>\nclass CartesianProductHolder4 {\n public:\nCartesianProductHolder4(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}\n  template <typename T1, typename T2, typename T3, typename T4>\n  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {\n    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(\n        new CartesianProductGenerator4<T1, T2, T3, T4>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder4& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n};  // class CartesianProductHolder4\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5>\nclass CartesianProductHolder5 {\n public:\nCartesianProductHolder5(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5>\n  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {\n    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(\n        new CartesianProductGenerator5<T1, T2, T3, T4, T5>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder5& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n};  // class CartesianProductHolder5\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6>\nclass CartesianProductHolder6 {\n public:\nCartesianProductHolder6(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6>\n  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {\n    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(\n        new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder6& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n};  // class CartesianProductHolder6\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6, class Generator7>\nclass CartesianProductHolder7 {\n public:\nCartesianProductHolder7(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6, const Generator7& g7)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6, typename T7>\n  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,\n      T7> >() const {\n    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(\n        new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_),\n        static_cast<ParamGenerator<T7> >(g7_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder7& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n  const Generator7 g7_;\n};  // class CartesianProductHolder7\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6, class Generator7,\n    class Generator8>\nclass CartesianProductHolder8 {\n public:\nCartesianProductHolder8(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6, const Generator7& g7, const Generator8& g8)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),\n          g8_(g8) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6, typename T7, typename T8>\n  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,\n      T8> >() const {\n    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(\n        new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_),\n        static_cast<ParamGenerator<T7> >(g7_),\n        static_cast<ParamGenerator<T8> >(g8_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder8& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n  const Generator7 g7_;\n  const Generator8 g8_;\n};  // class CartesianProductHolder8\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6, class Generator7,\n    class Generator8, class Generator9>\nclass CartesianProductHolder9 {\n public:\nCartesianProductHolder9(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6, const Generator7& g7, const Generator8& g8,\n    const Generator9& g9)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),\n          g9_(g9) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6, typename T7, typename T8, typename T9>\n  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,\n      T9> >() const {\n    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,\n        T9> >(\n        new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_),\n        static_cast<ParamGenerator<T7> >(g7_),\n        static_cast<ParamGenerator<T8> >(g8_),\n        static_cast<ParamGenerator<T9> >(g9_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder9& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n  const Generator7 g7_;\n  const Generator8 g8_;\n  const Generator9 g9_;\n};  // class CartesianProductHolder9\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6, class Generator7,\n    class Generator8, class Generator9, class Generator10>\nclass CartesianProductHolder10 {\n public:\nCartesianProductHolder10(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6, const Generator7& g7, const Generator8& g8,\n    const Generator9& g9, const Generator10& g10)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),\n          g9_(g9), g10_(g10) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6, typename T7, typename T8, typename T9, typename T10>\n  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,\n      T9, T10> >() const {\n    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,\n        T9, T10> >(\n        new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,\n            T10>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_),\n        static_cast<ParamGenerator<T7> >(g7_),\n        static_cast<ParamGenerator<T8> >(g8_),\n        static_cast<ParamGenerator<T9> >(g9_),\n        static_cast<ParamGenerator<T10> >(g10_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder10& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n  const Generator7 g7_;\n  const Generator8 g8_;\n  const Generator9 g9_;\n  const Generator10 g10_;\n};  // class CartesianProductHolder10\n\n# endif  // GTEST_HAS_COMBINE\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  //  GTEST_HAS_PARAM_TEST\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_\n\n#if GTEST_HAS_PARAM_TEST\n\nnamespace testing {\n\n// Functions producing parameter generators.\n//\n// Google Test uses these generators to produce parameters for value-\n// parameterized tests. When a parameterized test case is instantiated\n// with a particular generator, Google Test creates and runs tests\n// for each element in the sequence produced by the generator.\n//\n// In the following sample, tests from test case FooTest are instantiated\n// each three times with parameter values 3, 5, and 8:\n//\n// class FooTest : public TestWithParam<int> { ... };\n//\n// TEST_P(FooTest, TestThis) {\n// }\n// TEST_P(FooTest, TestThat) {\n// }\n// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));\n//\n\n// Range() returns generators providing sequences of values in a range.\n//\n// Synopsis:\n// Range(start, end)\n//   - returns a generator producing a sequence of values {start, start+1,\n//     start+2, ..., }.\n// Range(start, end, step)\n//   - returns a generator producing a sequence of values {start, start+step,\n//     start+step+step, ..., }.\n// Notes:\n//   * The generated sequences never include end. For example, Range(1, 5)\n//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)\n//     returns a generator producing {1, 3, 5, 7}.\n//   * start and end must have the same type. That type may be any integral or\n//     floating-point type or a user defined type satisfying these conditions:\n//     * It must be assignable (have operator=() defined).\n//     * It must have operator+() (operator+(int-compatible type) for\n//       two-operand version).\n//     * It must have operator<() defined.\n//     Elements in the resulting sequences will also have that type.\n//   * Condition start < end must be satisfied in order for resulting sequences\n//     to contain any elements.\n//\ntemplate <typename T, typename IncrementT>\ninternal::ParamGenerator<T> Range(T start, T end, IncrementT step) {\n  return internal::ParamGenerator<T>(\n      new internal::RangeGenerator<T, IncrementT>(start, end, step));\n}\n\ntemplate <typename T>\ninternal::ParamGenerator<T> Range(T start, T end) {\n  return Range(start, end, 1);\n}\n\n// ValuesIn() function allows generation of tests with parameters coming from\n// a container.\n//\n// Synopsis:\n// ValuesIn(const T (&array)[N])\n//   - returns a generator producing sequences with elements from\n//     a C-style array.\n// ValuesIn(const Container& container)\n//   - returns a generator producing sequences with elements from\n//     an STL-style container.\n// ValuesIn(Iterator begin, Iterator end)\n//   - returns a generator producing sequences with elements from\n//     a range [begin, end) defined by a pair of STL-style iterators. These\n//     iterators can also be plain C pointers.\n//\n// Please note that ValuesIn copies the values from the containers\n// passed in and keeps them to generate tests in RUN_ALL_TESTS().\n//\n// Examples:\n//\n// This instantiates tests from test case StringTest\n// each with C-string values of \"foo\", \"bar\", and \"baz\":\n//\n// const char* strings[] = {\"foo\", \"bar\", \"baz\"};\n// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));\n//\n// This instantiates tests from test case StlStringTest\n// each with STL strings with values \"a\" and \"b\":\n//\n// ::std::vector< ::std::string> GetParameterStrings() {\n//   ::std::vector< ::std::string> v;\n//   v.push_back(\"a\");\n//   v.push_back(\"b\");\n//   return v;\n// }\n//\n// INSTANTIATE_TEST_CASE_P(CharSequence,\n//                         StlStringTest,\n//                         ValuesIn(GetParameterStrings()));\n//\n//\n// This will also instantiate tests from CharTest\n// each with parameter values 'a' and 'b':\n//\n// ::std::list<char> GetParameterChars() {\n//   ::std::list<char> list;\n//   list.push_back('a');\n//   list.push_back('b');\n//   return list;\n// }\n// ::std::list<char> l = GetParameterChars();\n// INSTANTIATE_TEST_CASE_P(CharSequence2,\n//                         CharTest,\n//                         ValuesIn(l.begin(), l.end()));\n//\ntemplate <typename ForwardIterator>\ninternal::ParamGenerator<\n  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>\nValuesIn(ForwardIterator begin, ForwardIterator end) {\n  typedef typename ::testing::internal::IteratorTraits<ForwardIterator>\n      ::value_type ParamType;\n  return internal::ParamGenerator<ParamType>(\n      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));\n}\n\ntemplate <typename T, size_t N>\ninternal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {\n  return ValuesIn(array, array + N);\n}\n\ntemplate <class Container>\ninternal::ParamGenerator<typename Container::value_type> ValuesIn(\n    const Container& container) {\n  return ValuesIn(container.begin(), container.end());\n}\n\n// Values() allows generating tests from explicitly specified list of\n// parameters.\n//\n// Synopsis:\n// Values(T v1, T v2, ..., T vN)\n//   - returns a generator producing sequences with elements v1, v2, ..., vN.\n//\n// For example, this instantiates tests from test case BarTest each\n// with values \"one\", \"two\", and \"three\":\n//\n// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values(\"one\", \"two\", \"three\"));\n//\n// This instantiates tests from test case BazTest each with values 1, 2, 3.5.\n// The exact type of values will depend on the type of parameter in BazTest.\n//\n// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));\n//\n// Currently, Values() supports from 1 to 50 parameters.\n//\ntemplate <typename T1>\ninternal::ValueArray1<T1> Values(T1 v1) {\n  return internal::ValueArray1<T1>(v1);\n}\n\ntemplate <typename T1, typename T2>\ninternal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {\n  return internal::ValueArray2<T1, T2>(v1, v2);\n}\n\ntemplate <typename T1, typename T2, typename T3>\ninternal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {\n  return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\ninternal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {\n  return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\ninternal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5) {\n  return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\ninternal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,\n    T4 v4, T5 v5, T6 v6) {\n  return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\ninternal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,\n    T4 v4, T5 v5, T6 v6, T7 v7) {\n  return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,\n      v6, v7);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\ninternal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {\n  return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,\n      v5, v6, v7, v8);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\ninternal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {\n  return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,\n      v4, v5, v6, v7, v8, v9);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\ninternal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,\n    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {\n  return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,\n      v2, v3, v4, v5, v6, v7, v8, v9, v10);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11>\ninternal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,\n    T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11) {\n  return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,\n      T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12>\ninternal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n    T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12) {\n  return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13>\ninternal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n    T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13) {\n  return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14>\ninternal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {\n  return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,\n      v14);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15>\ninternal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,\n    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {\n  return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,\n      v13, v14, v15);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16>\ninternal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16) {\n  return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,\n      v12, v13, v14, v15, v16);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17>\ninternal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17) {\n  return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,\n      v11, v12, v13, v14, v15, v16, v17);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18>\ninternal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,\n    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18) {\n  return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,\n      v10, v11, v12, v13, v14, v15, v16, v17, v18);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19>\ninternal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,\n    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,\n    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {\n  return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,\n      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20>\ninternal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {\n  return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,\n      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21>\ninternal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {\n  return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,\n      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22>\ninternal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,\n    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22) {\n  return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,\n      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23>\ninternal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23) {\n  return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,\n      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22, v23);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24>\ninternal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23, T24 v24) {\n  return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,\n      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,\n      v19, v20, v21, v22, v23, v24);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25>\ninternal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,\n    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,\n    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,\n    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {\n  return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,\n      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,\n      v18, v19, v20, v21, v22, v23, v24, v25);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26>\ninternal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n    T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26) {\n  return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,\n      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27>\ninternal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n    T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27) {\n  return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,\n      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28>\ninternal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n    T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28) {\n  return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,\n      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,\n      v28);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29>\ninternal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29) {\n  return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,\n      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,\n      v27, v28, v29);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30>\ninternal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,\n    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,\n    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,\n    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {\n  return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,\n      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,\n      v26, v27, v28, v29, v30);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31>\ninternal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {\n  return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,\n      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,\n      v25, v26, v27, v28, v29, v30, v31);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32>\ninternal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32) {\n  return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,\n      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,\n      v24, v25, v26, v27, v28, v29, v30, v31, v32);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33>\ninternal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,\n    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32, T33 v33) {\n  return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,\n      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,\n      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34>\ninternal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,\n    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,\n    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,\n    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,\n    T31 v31, T32 v32, T33 v33, T34 v34) {\n  return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,\n      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,\n      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35>\ninternal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,\n    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,\n    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {\n  return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,\n      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,\n      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36>\ninternal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,\n    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,\n    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {\n  return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,\n      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,\n      v34, v35, v36);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37>\ninternal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,\n    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,\n    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,\n    T37 v37) {\n  return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,\n      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,\n      v34, v35, v36, v37);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38>\ninternal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,\n    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,\n    T37 v37, T38 v38) {\n  return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,\n      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,\n      v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,\n      v33, v34, v35, v36, v37, v38);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39>\ninternal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,\n    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,\n    T37 v37, T38 v38, T39 v39) {\n  return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,\n      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,\n      v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,\n      v32, v33, v34, v35, v36, v37, v38, v39);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40>\ninternal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,\n    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,\n    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,\n    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,\n    T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,\n    T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {\n  return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,\n      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,\n      v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41>\ninternal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n    T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {\n  return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,\n      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,\n      v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42>\ninternal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n    T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n    T42 v42) {\n  return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,\n      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,\n      v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,\n      v42);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43>\ninternal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n    T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n    T42 v42, T43 v43) {\n  return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,\n      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,\n      v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,\n      v41, v42, v43);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44>\ninternal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n    T42 v42, T43 v43, T44 v44) {\n  return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,\n      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,\n      v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,\n      v40, v41, v42, v43, v44);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45>\ninternal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,\n    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,\n    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,\n    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,\n    T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,\n    T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {\n  return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,\n      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,\n      v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,\n      v39, v40, v41, v42, v43, v44, v45);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46>\ninternal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,\n    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {\n  return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,\n      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,\n      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,\n      v38, v39, v40, v41, v42, v43, v44, v45, v46);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47>\ninternal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,\n    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {\n  return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,\n      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,\n      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,\n      v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48>\ninternal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,\n    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,\n    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,\n    T48 v48) {\n  return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,\n      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,\n      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,\n      v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49>\ninternal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,\n    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,\n    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,\n    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,\n    T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,\n    T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,\n    T47 v47, T48 v48, T49 v49) {\n  return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,\n      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,\n      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,\n      v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49, typename T50>\ninternal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,\n    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,\n    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,\n    T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,\n    T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {\n  return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,\n      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,\n      v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,\n      v48, v49, v50);\n}\n\n// Bool() allows generating tests with parameters in a set of (false, true).\n//\n// Synopsis:\n// Bool()\n//   - returns a generator producing sequences with elements {false, true}.\n//\n// It is useful when testing code that depends on Boolean flags. Combinations\n// of multiple flags can be tested when several Bool()'s are combined using\n// Combine() function.\n//\n// In the following example all tests in the test case FlagDependentTest\n// will be instantiated twice with parameters false and true.\n//\n// class FlagDependentTest : public testing::TestWithParam<bool> {\n//   virtual void SetUp() {\n//     external_flag = GetParam();\n//   }\n// }\n// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());\n//\ninline internal::ParamGenerator<bool> Bool() {\n  return Values(false, true);\n}\n\n# if GTEST_HAS_COMBINE\n// Combine() allows the user to combine two or more sequences to produce\n// values of a Cartesian product of those sequences' elements.\n//\n// Synopsis:\n// Combine(gen1, gen2, ..., genN)\n//   - returns a generator producing sequences with elements coming from\n//     the Cartesian product of elements from the sequences generated by\n//     gen1, gen2, ..., genN. The sequence elements will have a type of\n//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types\n//     of elements from sequences produces by gen1, gen2, ..., genN.\n//\n// Combine can have up to 10 arguments. This number is currently limited\n// by the maximum number of elements in the tuple implementation used by Google\n// Test.\n//\n// Example:\n//\n// This will instantiate tests in test case AnimalTest each one with\n// the parameter values tuple(\"cat\", BLACK), tuple(\"cat\", WHITE),\n// tuple(\"dog\", BLACK), and tuple(\"dog\", WHITE):\n//\n// enum Color { BLACK, GRAY, WHITE };\n// class AnimalTest\n//     : public testing::TestWithParam<tuple<const char*, Color> > {...};\n//\n// TEST_P(AnimalTest, AnimalLooksNice) {...}\n//\n// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,\n//                         Combine(Values(\"cat\", \"dog\"),\n//                                 Values(BLACK, WHITE)));\n//\n// This will instantiate tests in FlagDependentTest with all variations of two\n// Boolean flags:\n//\n// class FlagDependentTest\n//     : public testing::TestWithParam<tuple<bool, bool> > {\n//   virtual void SetUp() {\n//     // Assigns external_flag_1 and external_flag_2 values from the tuple.\n//     tie(external_flag_1, external_flag_2) = GetParam();\n//   }\n// };\n//\n// TEST_P(FlagDependentTest, TestFeature1) {\n//   // Test your code using external_flag_1 and external_flag_2 here.\n// }\n// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,\n//                         Combine(Bool(), Bool()));\n//\ntemplate <typename Generator1, typename Generator2>\ninternal::CartesianProductHolder2<Generator1, Generator2> Combine(\n    const Generator1& g1, const Generator2& g2) {\n  return internal::CartesianProductHolder2<Generator1, Generator2>(\n      g1, g2);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3>\ninternal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3) {\n  return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(\n      g1, g2, g3);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4>\ninternal::CartesianProductHolder4<Generator1, Generator2, Generator3,\n    Generator4> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4) {\n  return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,\n      Generator4>(\n      g1, g2, g3, g4);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5>\ninternal::CartesianProductHolder5<Generator1, Generator2, Generator3,\n    Generator4, Generator5> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5) {\n  return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,\n      Generator4, Generator5>(\n      g1, g2, g3, g4, g5);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6>\ninternal::CartesianProductHolder6<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6) {\n  return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6>(\n      g1, g2, g3, g4, g5, g6);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6,\n    typename Generator7>\ninternal::CartesianProductHolder7<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6, Generator7> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6,\n        const Generator7& g7) {\n  return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6, Generator7>(\n      g1, g2, g3, g4, g5, g6, g7);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6,\n    typename Generator7, typename Generator8>\ninternal::CartesianProductHolder8<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6, Generator7, Generator8> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6,\n        const Generator7& g7, const Generator8& g8) {\n  return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6, Generator7, Generator8>(\n      g1, g2, g3, g4, g5, g6, g7, g8);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6,\n    typename Generator7, typename Generator8, typename Generator9>\ninternal::CartesianProductHolder9<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6, Generator7, Generator8,\n    Generator9> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6,\n        const Generator7& g7, const Generator8& g8, const Generator9& g9) {\n  return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(\n      g1, g2, g3, g4, g5, g6, g7, g8, g9);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6,\n    typename Generator7, typename Generator8, typename Generator9,\n    typename Generator10>\ninternal::CartesianProductHolder10<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,\n    Generator10> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6,\n        const Generator7& g7, const Generator8& g8, const Generator9& g9,\n        const Generator10& g10) {\n  return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,\n      Generator10>(\n      g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);\n}\n# endif  // GTEST_HAS_COMBINE\n\n\n\n# define TEST_P(test_case_name, test_name) \\\n  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \\\n      : public test_case_name { \\\n   public: \\\n    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \\\n    virtual void TestBody(); \\\n   private: \\\n    static int AddToRegistry() { \\\n      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \\\n          GetTestCasePatternHolder<test_case_name>(\\\n              #test_case_name, __FILE__, __LINE__)->AddTestPattern(\\\n                  #test_case_name, \\\n                  #test_name, \\\n                  new ::testing::internal::TestMetaFactory< \\\n                      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \\\n      return 0; \\\n    } \\\n    static int gtest_registering_dummy_; \\\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(\\\n        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \\\n  }; \\\n  int GTEST_TEST_CLASS_NAME_(test_case_name, \\\n                             test_name)::gtest_registering_dummy_ = \\\n      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \\\n  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()\n\n# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \\\n  ::testing::internal::ParamGenerator<test_case_name::ParamType> \\\n      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \\\n  int gtest_##prefix##test_case_name##_dummy_ = \\\n      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \\\n          GetTestCasePatternHolder<test_case_name>(\\\n              #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\\\n                  #prefix, \\\n                  &gtest_##prefix##test_case_name##_EvalGenerator_, \\\n                  __FILE__, __LINE__)\n\n}  // namespace testing\n\n#endif  // GTEST_HAS_PARAM_TEST\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_\n// Copyright 2006, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: wan@google.com (Zhanyong Wan)\n//\n// Google C++ Testing Framework definitions useful in production code.\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_\n#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_\n\n// When you need to test the private or protected members of a class,\n// use the FRIEND_TEST macro to declare your tests as friends of the\n// class.  For example:\n//\n// class MyClass {\n//  private:\n//   void MyMethod();\n//   FRIEND_TEST(MyClassTest, MyMethod);\n// };\n//\n// class MyClassTest : public testing::Test {\n//   // ...\n// };\n//\n// TEST_F(MyClassTest, MyMethod) {\n//   // Can call MyClass::MyMethod() here.\n// }\n\n#define FRIEND_TEST(test_case_name, test_name)\\\nfriend class test_case_name##_##test_name##_Test\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_\n// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: mheule@google.com (Markus Heule)\n//\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_\n#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_\n\n#include <iosfwd>\n#include <vector>\n\nnamespace testing {\n\n// A copyable object representing the result of a test part (i.e. an\n// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).\n//\n// Don't inherit from TestPartResult as its destructor is not virtual.\nclass GTEST_API_ TestPartResult {\n public:\n  // The possible outcomes of a test part (i.e. an assertion or an\n  // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).\n  enum Type {\n    kSuccess,          // Succeeded.\n    kNonFatalFailure,  // Failed but the test can continue.\n    kFatalFailure      // Failed and the test should be terminated.\n  };\n\n  // C'tor.  TestPartResult does NOT have a default constructor.\n  // Always use this constructor (with parameters) to create a\n  // TestPartResult object.\n  TestPartResult(Type a_type,\n                 const char* a_file_name,\n                 int a_line_number,\n                 const char* a_message)\n      : type_(a_type),\n        file_name_(a_file_name == NULL ? \"\" : a_file_name),\n        line_number_(a_line_number),\n        summary_(ExtractSummary(a_message)),\n        message_(a_message) {\n  }\n\n  // Gets the outcome of the test part.\n  Type type() const { return type_; }\n\n  // Gets the name of the source file where the test part took place, or\n  // NULL if it's unknown.\n  const char* file_name() const {\n    return file_name_.empty() ? NULL : file_name_.c_str();\n  }\n\n  // Gets the line in the source file where the test part took place,\n  // or -1 if it's unknown.\n  int line_number() const { return line_number_; }\n\n  // Gets the summary of the failure message.\n  const char* summary() const { return summary_.c_str(); }\n\n  // Gets the message associated with the test part.\n  const char* message() const { return message_.c_str(); }\n\n  // Returns true iff the test part passed.\n  bool passed() const { return type_ == kSuccess; }\n\n  // Returns true iff the test part failed.\n  bool failed() const { return type_ != kSuccess; }\n\n  // Returns true iff the test part non-fatally failed.\n  bool nonfatally_failed() const { return type_ == kNonFatalFailure; }\n\n  // Returns true iff the test part fatally failed.\n  bool fatally_failed() const { return type_ == kFatalFailure; }\n\n private:\n  Type type_;\n\n  // Gets the summary of the failure message by omitting the stack\n  // trace in it.\n  static std::string ExtractSummary(const char* message);\n\n  // The name of the source file where the test part took place, or\n  // \"\" if the source file is unknown.\n  std::string file_name_;\n  // The line in the source file where the test part took place, or -1\n  // if the line number is unknown.\n  int line_number_;\n  std::string summary_;  // The test failure summary.\n  std::string message_;  // The test failure message.\n};\n\n// Prints a TestPartResult object.\nstd::ostream& operator<<(std::ostream& os, const TestPartResult& result);\n\n// An array of TestPartResult objects.\n//\n// Don't inherit from TestPartResultArray as its destructor is not\n// virtual.\nclass GTEST_API_ TestPartResultArray {\n public:\n  TestPartResultArray() {}\n\n  // Appends the given TestPartResult to the array.\n  void Append(const TestPartResult& result);\n\n  // Returns the TestPartResult at the given index (0-based).\n  const TestPartResult& GetTestPartResult(int index) const;\n\n  // Returns the number of TestPartResult objects in the array.\n  int size() const;\n\n private:\n  std::vector<TestPartResult> array_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);\n};\n\n// This interface knows how to report a test part result.\nclass GTEST_API_ TestPartResultReporterInterface {\n public:\n  virtual ~TestPartResultReporterInterface() {}\n\n  virtual void ReportTestPartResult(const TestPartResult& result) = 0;\n};\n\nnamespace internal {\n\n// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a\n// statement generates new fatal failures. To do so it registers itself as the\n// current test part result reporter. Besides checking if fatal failures were\n// reported, it only delegates the reporting to the former result reporter.\n// The original result reporter is restored in the destructor.\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nclass GTEST_API_ HasNewFatalFailureHelper\n    : public TestPartResultReporterInterface {\n public:\n  HasNewFatalFailureHelper();\n  virtual ~HasNewFatalFailureHelper();\n  virtual void ReportTestPartResult(const TestPartResult& result);\n  bool has_new_fatal_failure() const { return has_new_fatal_failure_; }\n private:\n  bool has_new_fatal_failure_;\n  TestPartResultReporterInterface* original_reporter_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);\n};\n\n}  // namespace internal\n\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_\n// Copyright 2008 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: wan@google.com (Zhanyong Wan)\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_\n#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_\n\n// This header implements typed tests and type-parameterized tests.\n\n// Typed (aka type-driven) tests repeat the same test for types in a\n// list.  You must know which types you want to test with when writing\n// typed tests. Here's how you do it:\n\n#if 0\n\n// First, define a fixture class template.  It should be parameterized\n// by a type.  Remember to derive it from testing::Test.\ntemplate <typename T>\nclass FooTest : public testing::Test {\n public:\n  ...\n  typedef std::list<T> List;\n  static T shared_;\n  T value_;\n};\n\n// Next, associate a list of types with the test case, which will be\n// repeated for each type in the list.  The typedef is necessary for\n// the macro to parse correctly.\ntypedef testing::Types<char, int, unsigned int> MyTypes;\nTYPED_TEST_CASE(FooTest, MyTypes);\n\n// If the type list contains only one type, you can write that type\n// directly without Types<...>:\n//   TYPED_TEST_CASE(FooTest, int);\n\n// Then, use TYPED_TEST() instead of TEST_F() to define as many typed\n// tests for this test case as you want.\nTYPED_TEST(FooTest, DoesBlah) {\n  // Inside a test, refer to TypeParam to get the type parameter.\n  // Since we are inside a derived class template, C++ requires use to\n  // visit the members of FooTest via 'this'.\n  TypeParam n = this->value_;\n\n  // To visit static members of the fixture, add the TestFixture::\n  // prefix.\n  n += TestFixture::shared_;\n\n  // To refer to typedefs in the fixture, add the \"typename\n  // TestFixture::\" prefix.\n  typename TestFixture::List values;\n  values.push_back(n);\n  ...\n}\n\nTYPED_TEST(FooTest, HasPropertyA) { ... }\n\n#endif  // 0\n\n// Type-parameterized tests are abstract test patterns parameterized\n// by a type.  Compared with typed tests, type-parameterized tests\n// allow you to define the test pattern without knowing what the type\n// parameters are.  The defined pattern can be instantiated with\n// different types any number of times, in any number of translation\n// units.\n//\n// If you are designing an interface or concept, you can define a\n// suite of type-parameterized tests to verify properties that any\n// valid implementation of the interface/concept should have.  Then,\n// each implementation can easily instantiate the test suite to verify\n// that it conforms to the requirements, without having to write\n// similar tests repeatedly.  Here's an example:\n\n#if 0\n\n// First, define a fixture class template.  It should be parameterized\n// by a type.  Remember to derive it from testing::Test.\ntemplate <typename T>\nclass FooTest : public testing::Test {\n  ...\n};\n\n// Next, declare that you will define a type-parameterized test case\n// (the _P suffix is for \"parameterized\" or \"pattern\", whichever you\n// prefer):\nTYPED_TEST_CASE_P(FooTest);\n\n// Then, use TYPED_TEST_P() to define as many type-parameterized tests\n// for this type-parameterized test case as you want.\nTYPED_TEST_P(FooTest, DoesBlah) {\n  // Inside a test, refer to TypeParam to get the type parameter.\n  TypeParam n = 0;\n  ...\n}\n\nTYPED_TEST_P(FooTest, HasPropertyA) { ... }\n\n// Now the tricky part: you need to register all test patterns before\n// you can instantiate them.  The first argument of the macro is the\n// test case name; the rest are the names of the tests in this test\n// case.\nREGISTER_TYPED_TEST_CASE_P(FooTest,\n                           DoesBlah, HasPropertyA);\n\n// Finally, you are free to instantiate the pattern with the types you\n// want.  If you put the above code in a header file, you can #include\n// it in multiple C++ source files and instantiate it multiple times.\n//\n// To distinguish different instances of the pattern, the first\n// argument to the INSTANTIATE_* macro is a prefix that will be added\n// to the actual test case name.  Remember to pick unique prefixes for\n// different instances.\ntypedef testing::Types<char, int, unsigned int> MyTypes;\nINSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);\n\n// If the type list contains only one type, you can write that type\n// directly without Types<...>:\n//   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);\n\n#endif  // 0\n\n\n// Implements typed tests.\n\n#if GTEST_HAS_TYPED_TEST\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Expands to the name of the typedef for the type parameters of the\n// given test case.\n# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_\n\n// The 'Types' template argument below must have spaces around it\n// since some compilers may choke on '>>' when passing a template\n// instance (e.g. Types<int>)\n# define TYPED_TEST_CASE(CaseName, Types) \\\n  typedef ::testing::internal::TypeList< Types >::type \\\n      GTEST_TYPE_PARAMS_(CaseName)\n\n# define TYPED_TEST(CaseName, TestName) \\\n  template <typename gtest_TypeParam_> \\\n  class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \\\n      : public CaseName<gtest_TypeParam_> { \\\n   private: \\\n    typedef CaseName<gtest_TypeParam_> TestFixture; \\\n    typedef gtest_TypeParam_ TypeParam; \\\n    virtual void TestBody(); \\\n  }; \\\n  bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \\\n      ::testing::internal::TypeParameterizedTest< \\\n          CaseName, \\\n          ::testing::internal::TemplateSel< \\\n              GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \\\n          GTEST_TYPE_PARAMS_(CaseName)>::Register(\\\n              \"\", #CaseName, #TestName, 0); \\\n  template <typename gtest_TypeParam_> \\\n  void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()\n\n#endif  // GTEST_HAS_TYPED_TEST\n\n// Implements type-parameterized tests.\n\n#if GTEST_HAS_TYPED_TEST_P\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Expands to the namespace name that the type-parameterized tests for\n// the given type-parameterized test case are defined in.  The exact\n// name of the namespace is subject to change without notice.\n# define GTEST_CASE_NAMESPACE_(TestCaseName) \\\n  gtest_case_##TestCaseName##_\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Expands to the name of the variable used to remember the names of\n// the defined tests in the given test case.\n# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \\\n  gtest_typed_test_case_p_state_##TestCaseName##_\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.\n//\n// Expands to the name of the variable used to remember the names of\n// the registered tests in the given test case.\n# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \\\n  gtest_registered_test_names_##TestCaseName##_\n\n// The variables defined in the type-parameterized test macros are\n// static as typically these macros are used in a .h file that can be\n// #included in multiple translation units linked together.\n# define TYPED_TEST_CASE_P(CaseName) \\\n  static ::testing::internal::TypedTestCasePState \\\n      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)\n\n# define TYPED_TEST_P(CaseName, TestName) \\\n  namespace GTEST_CASE_NAMESPACE_(CaseName) { \\\n  template <typename gtest_TypeParam_> \\\n  class TestName : public CaseName<gtest_TypeParam_> { \\\n   private: \\\n    typedef CaseName<gtest_TypeParam_> TestFixture; \\\n    typedef gtest_TypeParam_ TypeParam; \\\n    virtual void TestBody(); \\\n  }; \\\n  static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \\\n      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\\\n          __FILE__, __LINE__, #CaseName, #TestName); \\\n  } \\\n  template <typename gtest_TypeParam_> \\\n  void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()\n\n# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \\\n  namespace GTEST_CASE_NAMESPACE_(CaseName) { \\\n  typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \\\n  } \\\n  static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \\\n      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\\\n          __FILE__, __LINE__, #__VA_ARGS__)\n\n// The 'Types' template argument below must have spaces around it\n// since some compilers may choke on '>>' when passing a template\n// instance (e.g. Types<int>)\n# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \\\n  bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \\\n      ::testing::internal::TypeParameterizedTestCase<CaseName, \\\n          GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \\\n          ::testing::internal::TypeList< Types >::type>::Register(\\\n              #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))\n\n#endif  // GTEST_HAS_TYPED_TEST_P\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_\n\n// Depending on the platform, different string classes are available.\n// On Linux, in addition to ::std::string, Google also makes use of\n// class ::string, which has the same interface as ::std::string, but\n// has a different implementation.\n//\n// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that\n// ::string is available AND is a distinct type to ::std::string, or\n// define it to 0 to indicate otherwise.\n//\n// If the user's ::std::string and ::string are the same class due to\n// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.\n//\n// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined\n// heuristically.\n\nnamespace testing {\n\n// Declares the flags.\n\n// This flag temporary enables the disabled tests.\nGTEST_DECLARE_bool_(also_run_disabled_tests);\n\n// This flag brings the debugger on an assertion failure.\nGTEST_DECLARE_bool_(break_on_failure);\n\n// This flag controls whether Google Test catches all test-thrown exceptions\n// and logs them as failures.\nGTEST_DECLARE_bool_(catch_exceptions);\n\n// This flag enables using colors in terminal output. Available values are\n// \"yes\" to enable colors, \"no\" (disable colors), or \"auto\" (the default)\n// to let Google Test decide.\nGTEST_DECLARE_string_(color);\n\n// This flag sets up the filter to select by name using a glob pattern\n// the tests to run. If the filter is not given all tests are executed.\nGTEST_DECLARE_string_(filter);\n\n// OpenCV extension: same as filter, but for the parameters string.\nGTEST_DECLARE_string_(param_filter);\n\n// This flag causes the Google Test to list tests. None of the tests listed\n// are actually run if the flag is provided.\nGTEST_DECLARE_bool_(list_tests);\n\n// This flag controls whether Google Test emits a detailed XML report to a file\n// in addition to its normal textual output.\nGTEST_DECLARE_string_(output);\n\n// This flags control whether Google Test prints the elapsed time for each\n// test.\nGTEST_DECLARE_bool_(print_time);\n\n// This flag specifies the random number seed.\nGTEST_DECLARE_int32_(random_seed);\n\n// This flag sets how many times the tests are repeated. The default value\n// is 1. If the value is -1 the tests are repeating forever.\nGTEST_DECLARE_int32_(repeat);\n\n// This flag controls whether Google Test includes Google Test internal\n// stack frames in failure stack traces.\nGTEST_DECLARE_bool_(show_internal_stack_frames);\n\n// When this flag is specified, tests' order is randomized on every iteration.\nGTEST_DECLARE_bool_(shuffle);\n\n// This flag specifies the maximum number of stack frames to be\n// printed in a failure message.\nGTEST_DECLARE_int32_(stack_trace_depth);\n\n// When this flag is specified, a failed assertion will throw an\n// exception if exceptions are enabled, or exit the program with a\n// non-zero code otherwise.\nGTEST_DECLARE_bool_(throw_on_failure);\n\n// When this flag is set with a \"host:port\" string, on supported\n// platforms test results are streamed to the specified port on\n// the specified host machine.\nGTEST_DECLARE_string_(stream_result_to);\n\n// The upper limit for valid stack trace depths.\nconst int kMaxStackTraceDepth = 100;\n\nnamespace internal {\n\nclass AssertHelper;\nclass DefaultGlobalTestPartResultReporter;\nclass ExecDeathTest;\nclass NoExecDeathTest;\nclass FinalSuccessChecker;\nclass GTestFlagSaver;\nclass StreamingListenerTest;\nclass TestResultAccessor;\nclass TestEventListenersAccessor;\nclass TestEventRepeater;\nclass UnitTestRecordPropertyTestHelper;\nclass WindowsDeathTest;\nclass UnitTestImpl* GetUnitTestImpl();\nvoid ReportFailureInUnknownLocation(TestPartResult::Type result_type,\n                                    const std::string& message);\n\n}  // namespace internal\n\n// The friend relationship of some of these classes is cyclic.\n// If we don't forward declare them the compiler might confuse the classes\n// in friendship clauses with same named classes on the scope.\nclass Test;\nclass TestCase;\nclass TestInfo;\nclass UnitTest;\n\n// A class for indicating whether an assertion was successful.  When\n// the assertion wasn't successful, the AssertionResult object\n// remembers a non-empty message that describes how it failed.\n//\n// To create an instance of this class, use one of the factory functions\n// (AssertionSuccess() and AssertionFailure()).\n//\n// This class is useful for two purposes:\n//   1. Defining predicate functions to be used with Boolean test assertions\n//      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts\n//   2. Defining predicate-format functions to be\n//      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).\n//\n// For example, if you define IsEven predicate:\n//\n//   testing::AssertionResult IsEven(int n) {\n//     if ((n % 2) == 0)\n//       return testing::AssertionSuccess();\n//     else\n//       return testing::AssertionFailure() << n << \" is odd\";\n//   }\n//\n// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))\n// will print the message\n//\n//   Value of: IsEven(Fib(5))\n//     Actual: false (5 is odd)\n//   Expected: true\n//\n// instead of a more opaque\n//\n//   Value of: IsEven(Fib(5))\n//     Actual: false\n//   Expected: true\n//\n// in case IsEven is a simple Boolean predicate.\n//\n// If you expect your predicate to be reused and want to support informative\n// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up\n// about half as often as positive ones in our tests), supply messages for\n// both success and failure cases:\n//\n//   testing::AssertionResult IsEven(int n) {\n//     if ((n % 2) == 0)\n//       return testing::AssertionSuccess() << n << \" is even\";\n//     else\n//       return testing::AssertionFailure() << n << \" is odd\";\n//   }\n//\n// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print\n//\n//   Value of: IsEven(Fib(6))\n//     Actual: true (8 is even)\n//   Expected: false\n//\n// NB: Predicates that support negative Boolean assertions have reduced\n// performance in positive ones so be careful not to use them in tests\n// that have lots (tens of thousands) of positive Boolean assertions.\n//\n// To use this class with EXPECT_PRED_FORMAT assertions such as:\n//\n//   // Verifies that Foo() returns an even number.\n//   EXPECT_PRED_FORMAT1(IsEven, Foo());\n//\n// you need to define:\n//\n//   testing::AssertionResult IsEven(const char* expr, int n) {\n//     if ((n % 2) == 0)\n//       return testing::AssertionSuccess();\n//     else\n//       return testing::AssertionFailure()\n//         << \"Expected: \" << expr << \" is even\\n  Actual: it's \" << n;\n//   }\n//\n// If Foo() returns 5, you will see the following message:\n//\n//   Expected: Foo() is even\n//     Actual: it's 5\n//\nclass GTEST_API_ AssertionResult {\n public:\n  // Copy constructor.\n  // Used in EXPECT_TRUE/FALSE(assertion_result).\n  AssertionResult(const AssertionResult& other);\n  // Used in the EXPECT_TRUE/FALSE(bool_expression).\n  explicit AssertionResult(bool success) : success_(success) {}\n\n  // Returns true iff the assertion succeeded.\n  operator bool() const { return success_; }  // NOLINT\n\n  // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.\n  AssertionResult operator!() const;\n\n  // Returns the text streamed into this AssertionResult. Test assertions\n  // use it when they fail (i.e., the predicate's outcome doesn't match the\n  // assertion's expectation). When nothing has been streamed into the\n  // object, returns an empty string.\n  const char* message() const {\n    return message_.get() != NULL ?  message_->c_str() : \"\";\n  }\n  // TODO(vladl@google.com): Remove this after making sure no clients use it.\n  // Deprecated; please use message() instead.\n  const char* failure_message() const { return message(); }\n\n  // Streams a custom failure message into this object.\n  template <typename T> AssertionResult& operator<<(const T& value) {\n    AppendMessage(Message() << value);\n    return *this;\n  }\n\n  // Allows streaming basic output manipulators such as endl or flush into\n  // this object.\n  AssertionResult& operator<<(\n      ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {\n    AppendMessage(Message() << basic_manipulator);\n    return *this;\n  }\n\n private:\n  // Appends the contents of message to message_.\n  void AppendMessage(const Message& a_message) {\n    if (message_.get() == NULL)\n      message_.reset(new ::std::string);\n    message_->append(a_message.GetString().c_str());\n  }\n\n  // Stores result of the assertion predicate.\n  bool success_;\n  // Stores the message describing the condition in case the expectation\n  // construct is not satisfied with the predicate's outcome.\n  // Referenced via a pointer to avoid taking too much stack frame space\n  // with test assertions.\n  internal::scoped_ptr< ::std::string> message_;\n\n  GTEST_DISALLOW_ASSIGN_(AssertionResult);\n};\n\n// Makes a successful assertion result.\nGTEST_API_ AssertionResult AssertionSuccess();\n\n// Makes a failed assertion result.\nGTEST_API_ AssertionResult AssertionFailure();\n\n// Makes a failed assertion result with the given failure message.\n// Deprecated; use AssertionFailure() << msg.\nGTEST_API_ AssertionResult AssertionFailure(const Message& msg);\n\n// The abstract class that all tests inherit from.\n//\n// In Google Test, a unit test program contains one or many TestCases, and\n// each TestCase contains one or many Tests.\n//\n// When you define a test using the TEST macro, you don't need to\n// explicitly derive from Test - the TEST macro automatically does\n// this for you.\n//\n// The only time you derive from Test is when defining a test fixture\n// to be used a TEST_F.  For example:\n//\n//   class FooTest : public testing::Test {\n//    protected:\n//     virtual void SetUp() { ... }\n//     virtual void TearDown() { ... }\n//     ...\n//   };\n//\n//   TEST_F(FooTest, Bar) { ... }\n//   TEST_F(FooTest, Baz) { ... }\n//\n// Test is not copyable.\nclass GTEST_API_ Test {\n public:\n  friend class TestInfo;\n\n  // Defines types for pointers to functions that set up and tear down\n  // a test case.\n  typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;\n  typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;\n\n  // The d'tor is virtual as we intend to inherit from Test.\n  virtual ~Test();\n\n  // Sets up the stuff shared by all tests in this test case.\n  //\n  // Google Test will call Foo::SetUpTestCase() before running the first\n  // test in test case Foo.  Hence a sub-class can define its own\n  // SetUpTestCase() method to shadow the one defined in the super\n  // class.\n  static void SetUpTestCase() {}\n\n  // Tears down the stuff shared by all tests in this test case.\n  //\n  // Google Test will call Foo::TearDownTestCase() after running the last\n  // test in test case Foo.  Hence a sub-class can define its own\n  // TearDownTestCase() method to shadow the one defined in the super\n  // class.\n  static void TearDownTestCase() {}\n\n  // Returns true iff the current test has a fatal failure.\n  static bool HasFatalFailure();\n\n  // Returns true iff the current test has a non-fatal failure.\n  static bool HasNonfatalFailure();\n\n  // Returns true iff the current test has a (either fatal or\n  // non-fatal) failure.\n  static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }\n\n  // Logs a property for the current test, test case, or for the entire\n  // invocation of the test program when used outside of the context of a\n  // test case.  Only the last value for a given key is remembered.  These\n  // are public static so they can be called from utility functions that are\n  // not members of the test fixture.  Calls to RecordProperty made during\n  // lifespan of the test (from the moment its constructor starts to the\n  // moment its destructor finishes) will be output in XML as attributes of\n  // the <testcase> element.  Properties recorded from fixture's\n  // SetUpTestCase or TearDownTestCase are logged as attributes of the\n  // corresponding <testsuite> element.  Calls to RecordProperty made in the\n  // global context (before or after invocation of RUN_ALL_TESTS and from\n  // SetUp/TearDown method of Environment objects registered with Google\n  // Test) will be output as attributes of the <testsuites> element.\n  static void RecordProperty(const std::string& key, const std::string& value);\n  static void RecordProperty(const std::string& key, int value);\n\n protected:\n  // Creates a Test object.\n  Test();\n\n  // Sets up the test fixture.\n  virtual void SetUp();\n\n  // Tears down the test fixture.\n  virtual void TearDown();\n\n private:\n  // Returns true iff the current test has the same fixture class as\n  // the first test in the current test case.\n  static bool HasSameFixtureClass();\n\n  // Runs the test after the test fixture has been set up.\n  //\n  // A sub-class must implement this to define the test logic.\n  //\n  // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.\n  // Instead, use the TEST or TEST_F macro.\n  virtual void TestBody() = 0;\n\n  // Sets up, executes, and tears down the test.\n  void Run();\n\n  // Deletes self.  We deliberately pick an unusual name for this\n  // internal method to avoid clashing with names used in user TESTs.\n  void DeleteSelf_() { delete this; }\n\n  // Uses a GTestFlagSaver to save and restore all Google Test flags.\n  const internal::GTestFlagSaver* const gtest_flag_saver_;\n\n  // Often a user mis-spells SetUp() as Setup() and spends a long time\n  // wondering why it is never called by Google Test.  The declaration of\n  // the following method is solely for catching such an error at\n  // compile time:\n  //\n  //   - The return type is deliberately chosen to be not void, so it\n  //   will be a conflict if a user declares void Setup() in his test\n  //   fixture.\n  //\n  //   - This method is private, so it will be another compiler error\n  //   if a user calls it from his test fixture.\n  //\n  // DO NOT OVERRIDE THIS FUNCTION.\n  //\n  // If you see an error about overriding the following function or\n  // about it being private, you have mis-spelled SetUp() as Setup().\n  struct Setup_should_be_spelled_SetUp {};\n  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }\n\n  // We disallow copying Tests.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);\n};\n\ntypedef internal::TimeInMillis TimeInMillis;\n\n// A copyable object representing a user specified test property which can be\n// output as a key/value string pair.\n//\n// Don't inherit from TestProperty as its destructor is not virtual.\nclass TestProperty {\n public:\n  // C'tor.  TestProperty does NOT have a default constructor.\n  // Always use this constructor (with parameters) to create a\n  // TestProperty object.\n  TestProperty(const std::string& a_key, const std::string& a_value) :\n    key_(a_key), value_(a_value) {\n  }\n\n  // Gets the user supplied key.\n  const char* key() const {\n    return key_.c_str();\n  }\n\n  // Gets the user supplied value.\n  const char* value() const {\n    return value_.c_str();\n  }\n\n  // Sets a new value, overriding the one supplied in the constructor.\n  void SetValue(const std::string& new_value) {\n    value_ = new_value;\n  }\n\n private:\n  // The key supplied by the user.\n  std::string key_;\n  // The value supplied by the user.\n  std::string value_;\n};\n\n// The result of a single Test.  This includes a list of\n// TestPartResults, a list of TestProperties, a count of how many\n// death tests there are in the Test, and how much time it took to run\n// the Test.\n//\n// TestResult is not copyable.\nclass GTEST_API_ TestResult {\n public:\n  // Creates an empty TestResult.\n  TestResult();\n\n  // D'tor.  Do not inherit from TestResult.\n  ~TestResult();\n\n  // Gets the number of all test parts.  This is the sum of the number\n  // of successful test parts and the number of failed test parts.\n  int total_part_count() const;\n\n  // Returns the number of the test properties.\n  int test_property_count() const;\n\n  // Returns true iff the test passed (i.e. no test part failed).\n  bool Passed() const { return !Failed(); }\n\n  // Returns true iff the test failed.\n  bool Failed() const;\n\n  // Returns true iff the test fatally failed.\n  bool HasFatalFailure() const;\n\n  // Returns true iff the test has a non-fatal failure.\n  bool HasNonfatalFailure() const;\n\n  // Returns the elapsed time, in milliseconds.\n  TimeInMillis elapsed_time() const { return elapsed_time_; }\n\n  // Returns the i-th test part result among all the results. i can range\n  // from 0 to test_property_count() - 1. If i is not in that range, aborts\n  // the program.\n  const TestPartResult& GetTestPartResult(int i) const;\n\n  // Returns the i-th test property. i can range from 0 to\n  // test_property_count() - 1. If i is not in that range, aborts the\n  // program.\n  const TestProperty& GetTestProperty(int i) const;\n\n private:\n  friend class TestInfo;\n  friend class TestCase;\n  friend class UnitTest;\n  friend class internal::DefaultGlobalTestPartResultReporter;\n  friend class internal::ExecDeathTest;\n  friend class internal::TestResultAccessor;\n  friend class internal::UnitTestImpl;\n  friend class internal::WindowsDeathTest;\n\n  // Gets the vector of TestPartResults.\n  const std::vector<TestPartResult>& test_part_results() const {\n    return test_part_results_;\n  }\n\n  // Gets the vector of TestProperties.\n  const std::vector<TestProperty>& test_properties() const {\n    return test_properties_;\n  }\n\n  // Sets the elapsed time.\n  void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }\n\n  // Adds a test property to the list. The property is validated and may add\n  // a non-fatal failure if invalid (e.g., if it conflicts with reserved\n  // key names). If a property is already recorded for the same key, the\n  // value will be updated, rather than storing multiple values for the same\n  // key.  xml_element specifies the element for which the property is being\n  // recorded and is used for validation.\n  void RecordProperty(const std::string& xml_element,\n                      const TestProperty& test_property);\n\n  // Adds a failure if the key is a reserved attribute of Google Test\n  // testcase tags.  Returns true if the property is valid.\n  // TODO(russr): Validate attribute names are legal and human readable.\n  static bool ValidateTestProperty(const std::string& xml_element,\n                                   const TestProperty& test_property);\n\n  // Adds a test part result to the list.\n  void AddTestPartResult(const TestPartResult& test_part_result);\n\n  // Returns the death test count.\n  int death_test_count() const { return death_test_count_; }\n\n  // Increments the death test count, returning the new count.\n  int increment_death_test_count() { return ++death_test_count_; }\n\n  // Clears the test part results.\n  void ClearTestPartResults();\n\n  // Clears the object.\n  void Clear();\n\n  // Protects mutable state of the property vector and of owned\n  // properties, whose values may be updated.\n  internal::Mutex test_properites_mutex_;\n\n  // The vector of TestPartResults\n  std::vector<TestPartResult> test_part_results_;\n  // The vector of TestProperties\n  std::vector<TestProperty> test_properties_;\n  // Running count of death tests.\n  int death_test_count_;\n  // The elapsed time, in milliseconds.\n  TimeInMillis elapsed_time_;\n\n  // We disallow copying TestResult.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);\n};  // class TestResult\n\n// A TestInfo object stores the following information about a test:\n//\n//   Test case name\n//   Test name\n//   Whether the test should be run\n//   A function pointer that creates the test object when invoked\n//   Test result\n//\n// The constructor of TestInfo registers itself with the UnitTest\n// singleton such that the RUN_ALL_TESTS() macro knows which tests to\n// run.\nclass GTEST_API_ TestInfo {\n public:\n  // Destructs a TestInfo object.  This function is not virtual, so\n  // don't inherit from TestInfo.\n  ~TestInfo();\n\n  // Returns the test case name.\n  const char* test_case_name() const { return test_case_name_.c_str(); }\n\n  // Returns the test name.\n  const char* name() const { return name_.c_str(); }\n\n  // Returns the name of the parameter type, or NULL if this is not a typed\n  // or a type-parameterized test.\n  const char* type_param() const {\n    if (type_param_.get() != NULL)\n      return type_param_->c_str();\n    return NULL;\n  }\n\n  // Returns the text representation of the value parameter, or NULL if this\n  // is not a value-parameterized test.\n  const char* value_param() const {\n    if (value_param_.get() != NULL)\n      return value_param_->c_str();\n    return NULL;\n  }\n\n  // Returns true if this test should run, that is if the test is not\n  // disabled (or it is disabled but the also_run_disabled_tests flag has\n  // been specified) and its full name matches the user-specified filter.\n  //\n  // Google Test allows the user to filter the tests by their full names.\n  // The full name of a test Bar in test case Foo is defined as\n  // \"Foo.Bar\".  Only the tests that match the filter will run.\n  //\n  // A filter is a colon-separated list of glob (not regex) patterns,\n  // optionally followed by a '-' and a colon-separated list of\n  // negative patterns (tests to exclude).  A test is run if it\n  // matches one of the positive patterns and does not match any of\n  // the negative patterns.\n  //\n  // For example, *A*:Foo.* is a filter that matches any string that\n  // contains the character 'A' or starts with \"Foo.\".\n  bool should_run() const { return should_run_; }\n\n  // Returns true iff this test will appear in the XML report.\n  bool is_reportable() const {\n    // For now, the XML report includes all tests matching the filter.\n    // In the future, we may trim tests that are excluded because of\n    // sharding.\n    return matches_filter_;\n  }\n\n  // Returns the result of the test.\n  const TestResult* result() const { return &result_; }\n\n private:\n#if GTEST_HAS_DEATH_TEST\n  friend class internal::DefaultDeathTestFactory;\n#endif  // GTEST_HAS_DEATH_TEST\n  friend class Test;\n  friend class TestCase;\n  friend class internal::UnitTestImpl;\n  friend class internal::StreamingListenerTest;\n  friend TestInfo* internal::MakeAndRegisterTestInfo(\n      const char* test_case_name,\n      const char* name,\n      const char* type_param,\n      const char* value_param,\n      internal::TypeId fixture_class_id,\n      Test::SetUpTestCaseFunc set_up_tc,\n      Test::TearDownTestCaseFunc tear_down_tc,\n      internal::TestFactoryBase* factory);\n\n  // Constructs a TestInfo object. The newly constructed instance assumes\n  // ownership of the factory object.\n  TestInfo(const std::string& test_case_name,\n           const std::string& name,\n           const char* a_type_param,   // NULL if not a type-parameterized test\n           const char* a_value_param,  // NULL if not a value-parameterized test\n           internal::TypeId fixture_class_id,\n           internal::TestFactoryBase* factory);\n\n  // Increments the number of death tests encountered in this test so\n  // far.\n  int increment_death_test_count() {\n    return result_.increment_death_test_count();\n  }\n\n  // Creates the test object, runs it, records its result, and then\n  // deletes it.\n  void Run();\n\n  static void ClearTestResult(TestInfo* test_info) {\n    test_info->result_.Clear();\n  }\n\n  // These fields are immutable properties of the test.\n  const std::string test_case_name_;     // Test case name\n  const std::string name_;               // Test name\n  // Name of the parameter type, or NULL if this is not a typed or a\n  // type-parameterized test.\n  const internal::scoped_ptr<const ::std::string> type_param_;\n  // Text representation of the value parameter, or NULL if this is not a\n  // value-parameterized test.\n  const internal::scoped_ptr<const ::std::string> value_param_;\n  const internal::TypeId fixture_class_id_;   // ID of the test fixture class\n  bool should_run_;                 // True iff this test should run\n  bool is_disabled_;                // True iff this test is disabled\n  bool matches_filter_;             // True if this test matches the\n                                    // user-specified filter.\n  internal::TestFactoryBase* const factory_;  // The factory that creates\n                                              // the test object\n\n  // This field is mutable and needs to be reset before running the\n  // test for the second time.\n  TestResult result_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);\n};\n\n// A test case, which consists of a vector of TestInfos.\n//\n// TestCase is not copyable.\nclass GTEST_API_ TestCase {\n public:\n  // Creates a TestCase with the given name.\n  //\n  // TestCase does NOT have a default constructor.  Always use this\n  // constructor to create a TestCase object.\n  //\n  // Arguments:\n  //\n  //   name:         name of the test case\n  //   a_type_param: the name of the test's type parameter, or NULL if\n  //                 this is not a type-parameterized test.\n  //   set_up_tc:    pointer to the function that sets up the test case\n  //   tear_down_tc: pointer to the function that tears down the test case\n  TestCase(const char* name, const char* a_type_param,\n           Test::SetUpTestCaseFunc set_up_tc,\n           Test::TearDownTestCaseFunc tear_down_tc);\n\n  // Destructor of TestCase.\n  virtual ~TestCase();\n\n  // Gets the name of the TestCase.\n  const char* name() const { return name_.c_str(); }\n\n  // Returns the name of the parameter type, or NULL if this is not a\n  // type-parameterized test case.\n  const char* type_param() const {\n    if (type_param_.get() != NULL)\n      return type_param_->c_str();\n    return NULL;\n  }\n\n  // Returns true if any test in this test case should run.\n  bool should_run() const { return should_run_; }\n\n  // Gets the number of successful tests in this test case.\n  int successful_test_count() const;\n\n  // Gets the number of failed tests in this test case.\n  int failed_test_count() const;\n\n  // Gets the number of disabled tests that will be reported in the XML report.\n  int reportable_disabled_test_count() const;\n\n  // Gets the number of disabled tests in this test case.\n  int disabled_test_count() const;\n\n  // Gets the number of tests to be printed in the XML report.\n  int reportable_test_count() const;\n\n  // Get the number of tests in this test case that should run.\n  int test_to_run_count() const;\n\n  // Gets the number of all tests in this test case.\n  int total_test_count() const;\n\n  // Returns true iff the test case passed.\n  bool Passed() const { return !Failed(); }\n\n  // Returns true iff the test case failed.\n  bool Failed() const { return failed_test_count() > 0; }\n\n  // Returns the elapsed time, in milliseconds.\n  TimeInMillis elapsed_time() const { return elapsed_time_; }\n\n  // Returns the i-th test among all the tests. i can range from 0 to\n  // total_test_count() - 1. If i is not in that range, returns NULL.\n  const TestInfo* GetTestInfo(int i) const;\n\n  // Returns the TestResult that holds test properties recorded during\n  // execution of SetUpTestCase and TearDownTestCase.\n  const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }\n\n private:\n  friend class Test;\n  friend class internal::UnitTestImpl;\n\n  // Gets the (mutable) vector of TestInfos in this TestCase.\n  std::vector<TestInfo*>& test_info_list() { return test_info_list_; }\n\n  // Gets the (immutable) vector of TestInfos in this TestCase.\n  const std::vector<TestInfo*>& test_info_list() const {\n    return test_info_list_;\n  }\n\n  // Returns the i-th test among all the tests. i can range from 0 to\n  // total_test_count() - 1. If i is not in that range, returns NULL.\n  TestInfo* GetMutableTestInfo(int i);\n\n  // Sets the should_run member.\n  void set_should_run(bool should) { should_run_ = should; }\n\n  // Adds a TestInfo to this test case.  Will delete the TestInfo upon\n  // destruction of the TestCase object.\n  void AddTestInfo(TestInfo * test_info);\n\n  // Clears the results of all tests in this test case.\n  void ClearResult();\n\n  // Clears the results of all tests in the given test case.\n  static void ClearTestCaseResult(TestCase* test_case) {\n    test_case->ClearResult();\n  }\n\n  // Runs every test in this TestCase.\n  void Run();\n\n  // Runs SetUpTestCase() for this TestCase.  This wrapper is needed\n  // for catching exceptions thrown from SetUpTestCase().\n  void RunSetUpTestCase() { (*set_up_tc_)(); }\n\n  // Runs TearDownTestCase() for this TestCase.  This wrapper is\n  // needed for catching exceptions thrown from TearDownTestCase().\n  void RunTearDownTestCase() { (*tear_down_tc_)(); }\n\n  // Returns true iff test passed.\n  static bool TestPassed(const TestInfo* test_info) {\n    return test_info->should_run() && test_info->result()->Passed();\n  }\n\n  // Returns true iff test failed.\n  static bool TestFailed(const TestInfo* test_info) {\n    return test_info->should_run() && test_info->result()->Failed();\n  }\n\n  // Returns true iff the test is disabled and will be reported in the XML\n  // report.\n  static bool TestReportableDisabled(const TestInfo* test_info) {\n    return test_info->is_reportable() && test_info->is_disabled_;\n  }\n\n  // Returns true iff test is disabled.\n  static bool TestDisabled(const TestInfo* test_info) {\n    return test_info->is_disabled_;\n  }\n\n  // Returns true iff this test will appear in the XML report.\n  static bool TestReportable(const TestInfo* test_info) {\n    return test_info->is_reportable();\n  }\n\n  // Returns true if the given test should run.\n  static bool ShouldRunTest(const TestInfo* test_info) {\n    return test_info->should_run();\n  }\n\n  // Shuffles the tests in this test case.\n  void ShuffleTests(internal::Random* random);\n\n  // Restores the test order to before the first shuffle.\n  void UnshuffleTests();\n\n  // Name of the test case.\n  std::string name_;\n  // Name of the parameter type, or NULL if this is not a typed or a\n  // type-parameterized test.\n  const internal::scoped_ptr<const ::std::string> type_param_;\n  // The vector of TestInfos in their original order.  It owns the\n  // elements in the vector.\n  std::vector<TestInfo*> test_info_list_;\n  // Provides a level of indirection for the test list to allow easy\n  // shuffling and restoring the test order.  The i-th element in this\n  // vector is the index of the i-th test in the shuffled test list.\n  std::vector<int> test_indices_;\n  // Pointer to the function that sets up the test case.\n  Test::SetUpTestCaseFunc set_up_tc_;\n  // Pointer to the function that tears down the test case.\n  Test::TearDownTestCaseFunc tear_down_tc_;\n  // True iff any test in this test case should run.\n  bool should_run_;\n  // Elapsed time, in milliseconds.\n  TimeInMillis elapsed_time_;\n  // Holds test properties recorded during execution of SetUpTestCase and\n  // TearDownTestCase.\n  TestResult ad_hoc_test_result_;\n\n  // We disallow copying TestCases.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);\n};\n\n// An Environment object is capable of setting up and tearing down an\n// environment.  The user should subclass this to define his own\n// environment(s).\n//\n// An Environment object does the set-up and tear-down in virtual\n// methods SetUp() and TearDown() instead of the constructor and the\n// destructor, as:\n//\n//   1. You cannot safely throw from a destructor.  This is a problem\n//      as in some cases Google Test is used where exceptions are enabled, and\n//      we may want to implement ASSERT_* using exceptions where they are\n//      available.\n//   2. You cannot use ASSERT_* directly in a constructor or\n//      destructor.\nclass Environment {\n public:\n  // The d'tor is virtual as we need to subclass Environment.\n  virtual ~Environment() {}\n\n  // Override this to define how to set up the environment.\n  virtual void SetUp() {}\n\n  // Override this to define how to tear down the environment.\n  virtual void TearDown() {}\n private:\n  // If you see an error about overriding the following function or\n  // about it being private, you have mis-spelled SetUp() as Setup().\n  struct Setup_should_be_spelled_SetUp {};\n  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }\n};\n\n// The interface for tracing execution of tests. The methods are organized in\n// the order the corresponding events are fired.\nclass TestEventListener {\n public:\n  virtual ~TestEventListener() {}\n\n  // Fired before any test activity starts.\n  virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;\n\n  // Fired before each iteration of tests starts.  There may be more than\n  // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration\n  // index, starting from 0.\n  virtual void OnTestIterationStart(const UnitTest& unit_test,\n                                    int iteration) = 0;\n\n  // Fired before environment set-up for each iteration of tests starts.\n  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;\n\n  // Fired after environment set-up for each iteration of tests ends.\n  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;\n\n  // Fired before the test case starts.\n  virtual void OnTestCaseStart(const TestCase& test_case) = 0;\n\n  // Fired before the test starts.\n  virtual void OnTestStart(const TestInfo& test_info) = 0;\n\n  // Fired after a failed assertion or a SUCCEED() invocation.\n  virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;\n\n  // Fired after the test ends.\n  virtual void OnTestEnd(const TestInfo& test_info) = 0;\n\n  // Fired after the test case ends.\n  virtual void OnTestCaseEnd(const TestCase& test_case) = 0;\n\n  // Fired before environment tear-down for each iteration of tests starts.\n  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;\n\n  // Fired after environment tear-down for each iteration of tests ends.\n  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;\n\n  // Fired after each iteration of tests finishes.\n  virtual void OnTestIterationEnd(const UnitTest& unit_test,\n                                  int iteration) = 0;\n\n  // Fired after all test activities have ended.\n  virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;\n};\n\n// The convenience class for users who need to override just one or two\n// methods and are not concerned that a possible change to a signature of\n// the methods they override will not be caught during the build.  For\n// comments about each method please see the definition of TestEventListener\n// above.\nclass EmptyTestEventListener : public TestEventListener {\n public:\n  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}\n  virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,\n                                    int /*iteration*/) {}\n  virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}\n  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}\n  virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}\n  virtual void OnTestStart(const TestInfo& /*test_info*/) {}\n  virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}\n  virtual void OnTestEnd(const TestInfo& /*test_info*/) {}\n  virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}\n  virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}\n  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}\n  virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,\n                                  int /*iteration*/) {}\n  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}\n};\n\n// TestEventListeners lets users add listeners to track events in Google Test.\nclass GTEST_API_ TestEventListeners {\n public:\n  TestEventListeners();\n  ~TestEventListeners();\n\n  // Appends an event listener to the end of the list. Google Test assumes\n  // the ownership of the listener (i.e. it will delete the listener when\n  // the test program finishes).\n  void Append(TestEventListener* listener);\n\n  // Removes the given event listener from the list and returns it.  It then\n  // becomes the caller's responsibility to delete the listener. Returns\n  // NULL if the listener is not found in the list.\n  TestEventListener* Release(TestEventListener* listener);\n\n  // Returns the standard listener responsible for the default console\n  // output.  Can be removed from the listeners list to shut down default\n  // console output.  Note that removing this object from the listener list\n  // with Release transfers its ownership to the caller and makes this\n  // function return NULL the next time.\n  TestEventListener* default_result_printer() const {\n    return default_result_printer_;\n  }\n\n  // Returns the standard listener responsible for the default XML output\n  // controlled by the --gtest_output=xml flag.  Can be removed from the\n  // listeners list by users who want to shut down the default XML output\n  // controlled by this flag and substitute it with custom one.  Note that\n  // removing this object from the listener list with Release transfers its\n  // ownership to the caller and makes this function return NULL the next\n  // time.\n  TestEventListener* default_xml_generator() const {\n    return default_xml_generator_;\n  }\n\n private:\n  friend class TestCase;\n  friend class TestInfo;\n  friend class internal::DefaultGlobalTestPartResultReporter;\n  friend class internal::NoExecDeathTest;\n  friend class internal::TestEventListenersAccessor;\n  friend class internal::UnitTestImpl;\n\n  // Returns repeater that broadcasts the TestEventListener events to all\n  // subscribers.\n  TestEventListener* repeater();\n\n  // Sets the default_result_printer attribute to the provided listener.\n  // The listener is also added to the listener list and previous\n  // default_result_printer is removed from it and deleted. The listener can\n  // also be NULL in which case it will not be added to the list. Does\n  // nothing if the previous and the current listener objects are the same.\n  void SetDefaultResultPrinter(TestEventListener* listener);\n\n  // Sets the default_xml_generator attribute to the provided listener.  The\n  // listener is also added to the listener list and previous\n  // default_xml_generator is removed from it and deleted. The listener can\n  // also be NULL in which case it will not be added to the list. Does\n  // nothing if the previous and the current listener objects are the same.\n  void SetDefaultXmlGenerator(TestEventListener* listener);\n\n  // Controls whether events will be forwarded by the repeater to the\n  // listeners in the list.\n  bool EventForwardingEnabled() const;\n  void SuppressEventForwarding();\n\n  // The actual list of listeners.\n  internal::TestEventRepeater* repeater_;\n  // Listener responsible for the standard result output.\n  TestEventListener* default_result_printer_;\n  // Listener responsible for the creation of the XML output file.\n  TestEventListener* default_xml_generator_;\n\n  // We disallow copying TestEventListeners.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);\n};\n\n// A UnitTest consists of a vector of TestCases.\n//\n// This is a singleton class.  The only instance of UnitTest is\n// created when UnitTest::GetInstance() is first called.  This\n// instance is never deleted.\n//\n// UnitTest is not copyable.\n//\n// This class is thread-safe as long as the methods are called\n// according to their specification.\nclass GTEST_API_ UnitTest {\n public:\n  // Gets the singleton UnitTest object.  The first time this method\n  // is called, a UnitTest object is constructed and returned.\n  // Consecutive calls will return the same object.\n  static UnitTest* GetInstance();\n\n  // Runs all tests in this UnitTest object and prints the result.\n  // Returns 0 if successful, or 1 otherwise.\n  //\n  // This method can only be called from the main thread.\n  //\n  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n  int Run() GTEST_MUST_USE_RESULT_;\n\n  // Returns the working directory when the first TEST() or TEST_F()\n  // was executed.  The UnitTest object owns the string.\n  const char* original_working_dir() const;\n\n  // Returns the TestCase object for the test that's currently running,\n  // or NULL if no test is running.\n  const TestCase* current_test_case() const\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Returns the TestInfo object for the test that's currently running,\n  // or NULL if no test is running.\n  const TestInfo* current_test_info() const\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Returns the random seed used at the start of the current test run.\n  int random_seed() const;\n\n#if GTEST_HAS_PARAM_TEST\n  // Returns the ParameterizedTestCaseRegistry object used to keep track of\n  // value-parameterized tests and instantiate and register them.\n  //\n  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n  internal::ParameterizedTestCaseRegistry& parameterized_test_registry()\n      GTEST_LOCK_EXCLUDED_(mutex_);\n#endif  // GTEST_HAS_PARAM_TEST\n\n  // Gets the number of successful test cases.\n  int successful_test_case_count() const;\n\n  // Gets the number of failed test cases.\n  int failed_test_case_count() const;\n\n  // Gets the number of all test cases.\n  int total_test_case_count() const;\n\n  // Gets the number of all test cases that contain at least one test\n  // that should run.\n  int test_case_to_run_count() const;\n\n  // Gets the number of successful tests.\n  int successful_test_count() const;\n\n  // Gets the number of failed tests.\n  int failed_test_count() const;\n\n  // Gets the number of disabled tests that will be reported in the XML report.\n  int reportable_disabled_test_count() const;\n\n  // Gets the number of disabled tests.\n  int disabled_test_count() const;\n\n  // Gets the number of tests to be printed in the XML report.\n  int reportable_test_count() const;\n\n  // Gets the number of all tests.\n  int total_test_count() const;\n\n  // Gets the number of tests that should run.\n  int test_to_run_count() const;\n\n  // Gets the time of the test program start, in ms from the start of the\n  // UNIX epoch.\n  TimeInMillis start_timestamp() const;\n\n  // Gets the elapsed time, in milliseconds.\n  TimeInMillis elapsed_time() const;\n\n  // Returns true iff the unit test passed (i.e. all test cases passed).\n  bool Passed() const;\n\n  // Returns true iff the unit test failed (i.e. some test case failed\n  // or something outside of all tests failed).\n  bool Failed() const;\n\n  // Gets the i-th test case among all the test cases. i can range from 0 to\n  // total_test_case_count() - 1. If i is not in that range, returns NULL.\n  const TestCase* GetTestCase(int i) const;\n\n  // Returns the TestResult containing information on test failures and\n  // properties logged outside of individual test cases.\n  const TestResult& ad_hoc_test_result() const;\n\n  // Returns the list of event listeners that can be used to track events\n  // inside Google Test.\n  TestEventListeners& listeners();\n\n private:\n  // Registers and returns a global test environment.  When a test\n  // program is run, all global test environments will be set-up in\n  // the order they were registered.  After all tests in the program\n  // have finished, all global test environments will be torn-down in\n  // the *reverse* order they were registered.\n  //\n  // The UnitTest object takes ownership of the given environment.\n  //\n  // This method can only be called from the main thread.\n  Environment* AddEnvironment(Environment* env);\n\n  // Adds a TestPartResult to the current TestResult object.  All\n  // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)\n  // eventually call this to report their results.  The user code\n  // should use the assertion macros instead of calling this directly.\n  void AddTestPartResult(TestPartResult::Type result_type,\n                         const char* file_name,\n                         int line_number,\n                         const std::string& message,\n                         const std::string& os_stack_trace)\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Adds a TestProperty to the current TestResult object when invoked from\n  // inside a test, to current TestCase's ad_hoc_test_result_ when invoked\n  // from SetUpTestCase or TearDownTestCase, or to the global property set\n  // when invoked elsewhere.  If the result already contains a property with\n  // the same key, the value will be updated.\n  void RecordProperty(const std::string& key, const std::string& value);\n\n  // Gets the i-th test case among all the test cases. i can range from 0 to\n  // total_test_case_count() - 1. If i is not in that range, returns NULL.\n  TestCase* GetMutableTestCase(int i);\n\n  // Accessors for the implementation object.\n  internal::UnitTestImpl* impl() { return impl_; }\n  const internal::UnitTestImpl* impl() const { return impl_; }\n\n  // These classes and funcions are friends as they need to access private\n  // members of UnitTest.\n  friend class Test;\n  friend class internal::AssertHelper;\n  friend class internal::ScopedTrace;\n  friend class internal::StreamingListenerTest;\n  friend class internal::UnitTestRecordPropertyTestHelper;\n  friend Environment* AddGlobalTestEnvironment(Environment* env);\n  friend internal::UnitTestImpl* internal::GetUnitTestImpl();\n  friend void internal::ReportFailureInUnknownLocation(\n      TestPartResult::Type result_type,\n      const std::string& message);\n\n  // Creates an empty UnitTest.\n  UnitTest();\n\n  // D'tor\n  virtual ~UnitTest();\n\n  // Pushes a trace defined by SCOPED_TRACE() on to the per-thread\n  // Google Test trace stack.\n  void PushGTestTrace(const internal::TraceInfo& trace)\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Pops a trace from the per-thread Google Test trace stack.\n  void PopGTestTrace()\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Protects mutable state in *impl_.  This is mutable as some const\n  // methods need to lock it too.\n  mutable internal::Mutex mutex_;\n\n  // Opaque implementation object.  This field is never changed once\n  // the object is constructed.  We don't mark it as const here, as\n  // doing so will cause a warning in the constructor of UnitTest.\n  // Mutable state in *impl_ is protected by mutex_.\n  internal::UnitTestImpl* impl_;\n\n  // We disallow copying UnitTest.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);\n};\n\n// A convenient wrapper for adding an environment for the test\n// program.\n//\n// You should call this before RUN_ALL_TESTS() is called, probably in\n// main().  If you use gtest_main, you need to call this before main()\n// starts for it to take effect.  For example, you can define a global\n// variable like this:\n//\n//   testing::Environment* const foo_env =\n//       testing::AddGlobalTestEnvironment(new FooEnvironment);\n//\n// However, we strongly recommend you to write your own main() and\n// call AddGlobalTestEnvironment() there, as relying on initialization\n// of global variables makes the code harder to read and may cause\n// problems when you register multiple environments from different\n// translation units and the environments have dependencies among them\n// (remember that the compiler doesn't guarantee the order in which\n// global variables from different translation units are initialized).\ninline Environment* AddGlobalTestEnvironment(Environment* env) {\n  return UnitTest::GetInstance()->AddEnvironment(env);\n}\n\n// Initializes Google Test.  This must be called before calling\n// RUN_ALL_TESTS().  In particular, it parses a command line for the\n// flags that Google Test recognizes.  Whenever a Google Test flag is\n// seen, it is removed from argv, and *argc is decremented.\n//\n// No value is returned.  Instead, the Google Test flag variables are\n// updated.\n//\n// Calling the function for the second time has no user-visible effect.\nGTEST_API_ void InitGoogleTest(int* argc, char** argv);\n\n// This overloaded version can be used in Windows programs compiled in\n// UNICODE mode.\nGTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);\n\nnamespace internal {\n\n// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a\n// value of type ToPrint that is an operand of a comparison assertion\n// (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in\n// the comparison, and is used to help determine the best way to\n// format the value.  In particular, when the value is a C string\n// (char pointer) and the other operand is an STL string object, we\n// want to format the C string as a string, since we know it is\n// compared by value with the string object.  If the value is a char\n// pointer but the other operand is not an STL string object, we don't\n// know whether the pointer is supposed to point to a NUL-terminated\n// string, and thus want to print it as a pointer to be safe.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n\n// The default case.\ntemplate <typename ToPrint, typename OtherOperand>\nclass FormatForComparison {\n public:\n  static ::std::string Format(const ToPrint& value) {\n    return ::testing::PrintToString(value);\n  }\n};\n\n// Array.\ntemplate <typename ToPrint, size_t N, typename OtherOperand>\nclass FormatForComparison<ToPrint[N], OtherOperand> {\n public:\n  static ::std::string Format(const ToPrint* value) {\n    return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);\n  }\n};\n\n// By default, print C string as pointers to be safe, as we don't know\n// whether they actually point to a NUL-terminated string.\n\n#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \\\n  template <typename OtherOperand>                                      \\\n  class FormatForComparison<CharType*, OtherOperand> {                  \\\n   public:                                                              \\\n    static ::std::string Format(CharType* value) {                      \\\n      return ::testing::PrintToString(static_cast<const void*>(value)); \\\n    }                                                                   \\\n  }\n\nGTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);\nGTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);\nGTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);\nGTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);\n\n#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_\n\n// If a C string is compared with an STL string object, we know it's meant\n// to point to a NUL-terminated string, and thus can print it as a string.\n\n#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \\\n  template <>                                                           \\\n  class FormatForComparison<CharType*, OtherStringType> {               \\\n   public:                                                              \\\n    static ::std::string Format(CharType* value) {                      \\\n      return ::testing::PrintToString(value);                           \\\n    }                                                                   \\\n  }\n\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);\n\n#if GTEST_HAS_GLOBAL_STRING\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);\n#endif\n\n#if GTEST_HAS_GLOBAL_WSTRING\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);\n#endif\n\n#if GTEST_HAS_STD_WSTRING\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);\n#endif\n\n#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_\n\n// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)\n// operand to be used in a failure message.  The type (but not value)\n// of the other operand may affect the format.  This allows us to\n// print a char* as a raw pointer when it is compared against another\n// char* or void*, and print it as a C string when it is compared\n// against an std::string object, for example.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\ntemplate <typename T1, typename T2>\nstd::string FormatForComparisonFailureMessage(\n    const T1& value, const T2& /* other_operand */) {\n  return FormatForComparison<T1, T2>::Format(value);\n}\n\n// The helper function for {ASSERT|EXPECT}_EQ.\ntemplate <typename T1, typename T2>\nAssertionResult CmpHelperEQ(const char* expected_expression,\n                            const char* actual_expression,\n                            const T1& expected,\n                            const T2& actual) {\n#ifdef _MSC_VER\n# pragma warning(push)          // Saves the current warning state.\n# pragma warning(disable:4389)  // Temporarily disables warning on\n                                // signed/unsigned mismatch.\n#endif\n\n  if (expected == actual) {\n    return AssertionSuccess();\n  }\n\n#ifdef _MSC_VER\n# pragma warning(pop)          // Restores the warning state.\n#endif\n\n  return EqFailure(expected_expression,\n                   actual_expression,\n                   FormatForComparisonFailureMessage(expected, actual),\n                   FormatForComparisonFailureMessage(actual, expected),\n                   false);\n}\n\n// With this overloaded version, we allow anonymous enums to be used\n// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums\n// can be implicitly cast to BiggestInt.\nGTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,\n                                       const char* actual_expression,\n                                       BiggestInt expected,\n                                       BiggestInt actual);\n\n// The helper class for {ASSERT|EXPECT}_EQ.  The template argument\n// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()\n// is a null pointer literal.  The following default implementation is\n// for lhs_is_null_literal being false.\ntemplate <bool lhs_is_null_literal>\nclass EqHelper {\n public:\n  // This templatized version is for the general case.\n  template <typename T1, typename T2>\n  static AssertionResult Compare(const char* expected_expression,\n                                 const char* actual_expression,\n                                 const T1& expected,\n                                 const T2& actual) {\n    return CmpHelperEQ(expected_expression, actual_expression, expected,\n                       actual);\n  }\n\n  // With this overloaded version, we allow anonymous enums to be used\n  // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous\n  // enums can be implicitly cast to BiggestInt.\n  //\n  // Even though its body looks the same as the above version, we\n  // cannot merge the two, as it will make anonymous enums unhappy.\n  static AssertionResult Compare(const char* expected_expression,\n                                 const char* actual_expression,\n                                 BiggestInt expected,\n                                 BiggestInt actual) {\n    return CmpHelperEQ(expected_expression, actual_expression, expected,\n                       actual);\n  }\n};\n\n// This specialization is used when the first argument to ASSERT_EQ()\n// is a null pointer literal, like NULL, false, or 0.\ntemplate <>\nclass EqHelper<true> {\n public:\n  // We define two overloaded versions of Compare().  The first\n  // version will be picked when the second argument to ASSERT_EQ() is\n  // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or\n  // EXPECT_EQ(false, a_bool).\n  template <typename T1, typename T2>\n  static AssertionResult Compare(\n      const char* expected_expression,\n      const char* actual_expression,\n      const T1& expected,\n      const T2& actual,\n      // The following line prevents this overload from being considered if T2\n      // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)\n      // expands to Compare(\"\", \"\", NULL, my_ptr), which requires a conversion\n      // to match the Secret* in the other overload, which would otherwise make\n      // this template match better.\n      typename EnableIf<!is_pointer<T2>::value>::type* = 0) {\n    return CmpHelperEQ(expected_expression, actual_expression, expected,\n                       actual);\n  }\n\n  // This version will be picked when the second argument to ASSERT_EQ() is a\n  // pointer, e.g. ASSERT_EQ(NULL, a_pointer).\n  template <typename T>\n  static AssertionResult Compare(\n      const char* expected_expression,\n      const char* actual_expression,\n      // We used to have a second template parameter instead of Secret*.  That\n      // template parameter would deduce to 'long', making this a better match\n      // than the first overload even without the first overload's EnableIf.\n      // Unfortunately, gcc with -Wconversion-null warns when \"passing NULL to\n      // non-pointer argument\" (even a deduced integral argument), so the old\n      // implementation caused warnings in user code.\n      Secret* /* expected (NULL) */,\n      T* actual) {\n    // We already know that 'expected' is a null pointer.\n    return CmpHelperEQ(expected_expression, actual_expression,\n                       static_cast<T*>(NULL), actual);\n  }\n};\n\n// A macro for implementing the helper functions needed to implement\n// ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste\n// of similar code.\n//\n// For each templatized helper function, we also define an overloaded\n// version for BiggestInt in order to reduce code bloat and allow\n// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled\n// with gcc 4.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n#define GTEST_IMPL_CMP_HELPER_(op_name, op)\\\ntemplate <typename T1, typename T2>\\\nAssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \\\n                                   const T1& val1, const T2& val2) {\\\n  if (val1 op val2) {\\\n    return AssertionSuccess();\\\n  } else {\\\n    return AssertionFailure() \\\n        << \"Expected: (\" << expr1 << \") \" #op \" (\" << expr2\\\n        << \"), actual: \" << FormatForComparisonFailureMessage(val1, val2)\\\n        << \" vs \" << FormatForComparisonFailureMessage(val2, val1);\\\n  }\\\n}\\\nGTEST_API_ AssertionResult CmpHelper##op_name(\\\n    const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n\n// Implements the helper function for {ASSERT|EXPECT}_NE\nGTEST_IMPL_CMP_HELPER_(NE, !=);\n// Implements the helper function for {ASSERT|EXPECT}_LE\nGTEST_IMPL_CMP_HELPER_(LE, <=);\n// Implements the helper function for {ASSERT|EXPECT}_LT\nGTEST_IMPL_CMP_HELPER_(LT, <);\n// Implements the helper function for {ASSERT|EXPECT}_GE\nGTEST_IMPL_CMP_HELPER_(GE, >=);\n// Implements the helper function for {ASSERT|EXPECT}_GT\nGTEST_IMPL_CMP_HELPER_(GT, >);\n\n#undef GTEST_IMPL_CMP_HELPER_\n\n// The helper function for {ASSERT|EXPECT}_STREQ.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,\n                                          const char* actual_expression,\n                                          const char* expected,\n                                          const char* actual);\n\n// The helper function for {ASSERT|EXPECT}_STRCASEEQ.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,\n                                              const char* actual_expression,\n                                              const char* expected,\n                                              const char* actual);\n\n// The helper function for {ASSERT|EXPECT}_STRNE.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,\n                                          const char* s2_expression,\n                                          const char* s1,\n                                          const char* s2);\n\n// The helper function for {ASSERT|EXPECT}_STRCASENE.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,\n                                              const char* s2_expression,\n                                              const char* s1,\n                                              const char* s2);\n\n\n// Helper function for *_STREQ on wide strings.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,\n                                          const char* actual_expression,\n                                          const wchar_t* expected,\n                                          const wchar_t* actual);\n\n// Helper function for *_STRNE on wide strings.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,\n                                          const char* s2_expression,\n                                          const wchar_t* s1,\n                                          const wchar_t* s2);\n\n}  // namespace internal\n\n// IsSubstring() and IsNotSubstring() are intended to be used as the\n// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by\n// themselves.  They check whether needle is a substring of haystack\n// (NULL is considered a substring of itself only), and return an\n// appropriate error message when they fail.\n//\n// The {needle,haystack}_expr arguments are the stringified\n// expressions that generated the two real arguments.\nGTEST_API_ AssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const char* needle, const char* haystack);\nGTEST_API_ AssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const wchar_t* needle, const wchar_t* haystack);\nGTEST_API_ AssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const char* needle, const char* haystack);\nGTEST_API_ AssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const wchar_t* needle, const wchar_t* haystack);\nGTEST_API_ AssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::string& needle, const ::std::string& haystack);\nGTEST_API_ AssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::string& needle, const ::std::string& haystack);\n\n#if GTEST_HAS_STD_WSTRING\nGTEST_API_ AssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::wstring& needle, const ::std::wstring& haystack);\nGTEST_API_ AssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::wstring& needle, const ::std::wstring& haystack);\n#endif  // GTEST_HAS_STD_WSTRING\n\nnamespace internal {\n\n// Helper template function for comparing floating-points.\n//\n// Template parameter:\n//\n//   RawType: the raw floating-point type (either float or double)\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\ntemplate <typename RawType>\nAssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,\n                                         const char* actual_expression,\n                                         RawType expected,\n                                         RawType actual) {\n  const FloatingPoint<RawType> lhs(expected), rhs(actual);\n\n  if (lhs.AlmostEquals(rhs)) {\n    return AssertionSuccess();\n  }\n\n  ::std::stringstream expected_ss;\n  expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)\n              << expected;\n\n  ::std::stringstream actual_ss;\n  actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)\n            << actual;\n\n  return EqFailure(expected_expression,\n                   actual_expression,\n                   StringStreamToString(&expected_ss),\n                   StringStreamToString(&actual_ss),\n                   false);\n}\n\n// Helper function for implementing ASSERT_NEAR.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,\n                                                const char* expr2,\n                                                const char* abs_error_expr,\n                                                double val1,\n                                                double val2,\n                                                double abs_error);\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n// A class that enables one to stream messages to assertion macros\nclass GTEST_API_ AssertHelper {\n public:\n  // Constructor.\n  AssertHelper(TestPartResult::Type type,\n               const char* file,\n               int line,\n               const char* message);\n  ~AssertHelper();\n\n  // Message assignment is a semantic trick to enable assertion\n  // streaming; see the GTEST_MESSAGE_ macro below.\n  void operator=(const Message& message) const;\n\n private:\n  // We put our data in a struct so that the size of the AssertHelper class can\n  // be as small as possible.  This is important because gcc is incapable of\n  // re-using stack space even for temporary variables, so every EXPECT_EQ\n  // reserves stack space for another AssertHelper.\n  struct AssertHelperData {\n    AssertHelperData(TestPartResult::Type t,\n                     const char* srcfile,\n                     int line_num,\n                     const char* msg)\n        : type(t), file(srcfile), line(line_num), message(msg) { }\n\n    TestPartResult::Type const type;\n    const char*        const file;\n    int                const line;\n    std::string const message;\n\n   private:\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);\n  };\n\n  AssertHelperData* const data_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);\n};\n\n}  // namespace internal\n\n#if GTEST_HAS_PARAM_TEST\n// The pure interface class that all value-parameterized tests inherit from.\n// A value-parameterized class must inherit from both ::testing::Test and\n// ::testing::WithParamInterface. In most cases that just means inheriting\n// from ::testing::TestWithParam, but more complicated test hierarchies\n// may need to inherit from Test and WithParamInterface at different levels.\n//\n// This interface has support for accessing the test parameter value via\n// the GetParam() method.\n//\n// Use it with one of the parameter generator defining functions, like Range(),\n// Values(), ValuesIn(), Bool(), and Combine().\n//\n// class FooTest : public ::testing::TestWithParam<int> {\n//  protected:\n//   FooTest() {\n//     // Can use GetParam() here.\n//   }\n//   virtual ~FooTest() {\n//     // Can use GetParam() here.\n//   }\n//   virtual void SetUp() {\n//     // Can use GetParam() here.\n//   }\n//   virtual void TearDown {\n//     // Can use GetParam() here.\n//   }\n// };\n// TEST_P(FooTest, DoesBar) {\n//   // Can use GetParam() method here.\n//   Foo foo;\n//   ASSERT_TRUE(foo.DoesBar(GetParam()));\n// }\n// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));\n\ntemplate <typename T>\nclass WithParamInterface {\n public:\n  typedef T ParamType;\n  virtual ~WithParamInterface() {}\n\n  // The current parameter value. Is also available in the test fixture's\n  // constructor. This member function is non-static, even though it only\n  // references static data, to reduce the opportunity for incorrect uses\n  // like writing 'WithParamInterface<bool>::GetParam()' for a test that\n  // uses a fixture whose parameter type is int.\n  const ParamType& GetParam() const {\n    GTEST_CHECK_(parameter_ != NULL)\n        << \"GetParam() can only be called inside a value-parameterized test \"\n        << \"-- did you intend to write TEST_P instead of TEST_F?\";\n    return *parameter_;\n  }\n\n private:\n  // Sets parameter value. The caller is responsible for making sure the value\n  // remains alive and unchanged throughout the current test.\n  static void SetParam(const ParamType* parameter) {\n    parameter_ = parameter;\n  }\n\n  // Static value used for accessing parameter during a test lifetime.\n  static const ParamType* parameter_;\n\n  // TestClass must be a subclass of WithParamInterface<T> and Test.\n  template <class TestClass> friend class internal::ParameterizedTestFactory;\n};\n\ntemplate <typename T>\nconst T* WithParamInterface<T>::parameter_ = NULL;\n\n// Most value-parameterized classes can ignore the existence of\n// WithParamInterface, and can just inherit from ::testing::TestWithParam.\n\ntemplate <typename T>\nclass TestWithParam : public Test, public WithParamInterface<T> {\n};\n\n#endif  // GTEST_HAS_PARAM_TEST\n\n// Macros for indicating success/failure in test code.\n\n// ADD_FAILURE unconditionally adds a failure to the current test.\n// SUCCEED generates a success - it doesn't automatically make the\n// current test successful, as a test is only successful when it has\n// no failure.\n//\n// EXPECT_* verifies that a certain condition is satisfied.  If not,\n// it behaves like ADD_FAILURE.  In particular:\n//\n//   EXPECT_TRUE  verifies that a Boolean condition is true.\n//   EXPECT_FALSE verifies that a Boolean condition is false.\n//\n// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except\n// that they will also abort the current function on failure.  People\n// usually want the fail-fast behavior of FAIL and ASSERT_*, but those\n// writing data-driven tests often find themselves using ADD_FAILURE\n// and EXPECT_* more.\n\n// Generates a nonfatal failure with a generic message.\n#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_(\"Failed\")\n\n// Generates a nonfatal failure at the given source file location with\n// a generic message.\n#define ADD_FAILURE_AT(file, line) \\\n  GTEST_MESSAGE_AT_(file, line, \"Failed\", \\\n                    ::testing::TestPartResult::kNonFatalFailure)\n\n// Generates a fatal failure with a generic message.\n#define GTEST_FAIL() GTEST_FATAL_FAILURE_(\"Failed\")\n\n// Define this macro to 1 to omit the definition of FAIL(), which is a\n// generic name and clashes with some other libraries.\n#if !GTEST_DONT_DEFINE_FAIL\n# define FAIL() GTEST_FAIL()\n#endif\n\n// Generates a success with a generic message.\n#define GTEST_SUCCEED() GTEST_SUCCESS_(\"Succeeded\")\n\n// Define this macro to 1 to omit the definition of SUCCEED(), which\n// is a generic name and clashes with some other libraries.\n#if !GTEST_DONT_DEFINE_SUCCEED\n# define SUCCEED() GTEST_SUCCEED()\n#endif\n\n// Macros for testing exceptions.\n//\n//    * {ASSERT|EXPECT}_THROW(statement, expected_exception):\n//         Tests that the statement throws the expected exception.\n//    * {ASSERT|EXPECT}_NO_THROW(statement):\n//         Tests that the statement doesn't throw any exception.\n//    * {ASSERT|EXPECT}_ANY_THROW(statement):\n//         Tests that the statement throws an exception.\n\n#define EXPECT_THROW(statement, expected_exception) \\\n  GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_NO_THROW(statement) \\\n  GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_ANY_THROW(statement) \\\n  GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_THROW(statement, expected_exception) \\\n  GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)\n#define ASSERT_NO_THROW(statement) \\\n  GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)\n#define ASSERT_ANY_THROW(statement) \\\n  GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)\n\n// Boolean assertions. Condition can be either a Boolean expression or an\n// AssertionResult. For more information on how to use AssertionResult with\n// these macros see comments on that class.\n#define EXPECT_TRUE(condition) \\\n  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \\\n                      GTEST_NONFATAL_FAILURE_)\n#define EXPECT_FALSE(condition) \\\n  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \\\n                      GTEST_NONFATAL_FAILURE_)\n#define ASSERT_TRUE(condition) \\\n  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \\\n                      GTEST_FATAL_FAILURE_)\n#define ASSERT_FALSE(condition) \\\n  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \\\n                      GTEST_FATAL_FAILURE_)\n\n// Includes the auto-generated header that implements a family of\n// generic predicate assertion macros.\n// Copyright 2006, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command\n// 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!\n//\n// Implements a family of generic predicate assertion macros.\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_\n#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_\n\n// Makes sure this header is not included before gtest.h.\n#ifndef GTEST_INCLUDE_GTEST_GTEST_H_\n# error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.\n#endif  // GTEST_INCLUDE_GTEST_GTEST_H_\n\n// This header implements a family of generic predicate assertion\n// macros:\n//\n//   ASSERT_PRED_FORMAT1(pred_format, v1)\n//   ASSERT_PRED_FORMAT2(pred_format, v1, v2)\n//   ...\n//\n// where pred_format is a function or functor that takes n (in the\n// case of ASSERT_PRED_FORMATn) values and their source expression\n// text, and returns a testing::AssertionResult.  See the definition\n// of ASSERT_EQ in gtest.h for an example.\n//\n// If you don't care about formatting, you can use the more\n// restrictive version:\n//\n//   ASSERT_PRED1(pred, v1)\n//   ASSERT_PRED2(pred, v1, v2)\n//   ...\n//\n// where pred is an n-ary function or functor that returns bool,\n// and the values v1, v2, ..., must support the << operator for\n// streaming to std::ostream.\n//\n// We also define the EXPECT_* variations.\n//\n// For now we only support predicates whose arity is at most 5.\n// Please email googletestframework@googlegroups.com if you need\n// support for higher arities.\n\n// GTEST_ASSERT_ is the basic statement to which all of the assertions\n// in this file reduce.  Don't use this in your code.\n\n#define GTEST_ASSERT_(expression, on_failure) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (const ::testing::AssertionResult gtest_ar = (expression)) \\\n    ; \\\n  else \\\n    on_failure(gtest_ar.failure_message())\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1>\nAssertionResult AssertPred1Helper(const char* pred_text,\n                                  const char* e1,\n                                  Pred pred,\n                                  const T1& v1) {\n  if (pred(v1)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, v1), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use\n// this in your code.\n#define GTEST_PRED1_(pred, v1, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \\\n                                             #v1, \\\n                                             pred, \\\n                                             v1), on_failure)\n\n// Unary predicate assertion macros.\n#define EXPECT_PRED_FORMAT1(pred_format, v1) \\\n  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED1(pred, v1) \\\n  GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT1(pred_format, v1) \\\n  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED1(pred, v1) \\\n  GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)\n\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1,\n          typename T2>\nAssertionResult AssertPred2Helper(const char* pred_text,\n                                  const char* e1,\n                                  const char* e2,\n                                  Pred pred,\n                                  const T1& v1,\n                                  const T2& v2) {\n  if (pred(v1, v2)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \", \"\n                            << e2 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1\n                            << \"\\n\" << e2 << \" evaluates to \" << v2;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use\n// this in your code.\n#define GTEST_PRED2_(pred, v1, v2, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \\\n                                             #v1, \\\n                                             #v2, \\\n                                             pred, \\\n                                             v1, \\\n                                             v2), on_failure)\n\n// Binary predicate assertion macros.\n#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \\\n  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED2(pred, v1, v2) \\\n  GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \\\n  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED2(pred, v1, v2) \\\n  GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)\n\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1,\n          typename T2,\n          typename T3>\nAssertionResult AssertPred3Helper(const char* pred_text,\n                                  const char* e1,\n                                  const char* e2,\n                                  const char* e3,\n                                  Pred pred,\n                                  const T1& v1,\n                                  const T2& v2,\n                                  const T3& v3) {\n  if (pred(v1, v2, v3)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \", \"\n                            << e2 << \", \"\n                            << e3 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1\n                            << \"\\n\" << e2 << \" evaluates to \" << v2\n                            << \"\\n\" << e3 << \" evaluates to \" << v3;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use\n// this in your code.\n#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \\\n                                             #v1, \\\n                                             #v2, \\\n                                             #v3, \\\n                                             pred, \\\n                                             v1, \\\n                                             v2, \\\n                                             v3), on_failure)\n\n// Ternary predicate assertion macros.\n#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \\\n  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED3(pred, v1, v2, v3) \\\n  GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \\\n  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED3(pred, v1, v2, v3) \\\n  GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)\n\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1,\n          typename T2,\n          typename T3,\n          typename T4>\nAssertionResult AssertPred4Helper(const char* pred_text,\n                                  const char* e1,\n                                  const char* e2,\n                                  const char* e3,\n                                  const char* e4,\n                                  Pred pred,\n                                  const T1& v1,\n                                  const T2& v2,\n                                  const T3& v3,\n                                  const T4& v4) {\n  if (pred(v1, v2, v3, v4)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \", \"\n                            << e2 << \", \"\n                            << e3 << \", \"\n                            << e4 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1\n                            << \"\\n\" << e2 << \" evaluates to \" << v2\n                            << \"\\n\" << e3 << \" evaluates to \" << v3\n                            << \"\\n\" << e4 << \" evaluates to \" << v4;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use\n// this in your code.\n#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \\\n                                             #v1, \\\n                                             #v2, \\\n                                             #v3, \\\n                                             #v4, \\\n                                             pred, \\\n                                             v1, \\\n                                             v2, \\\n                                             v3, \\\n                                             v4), on_failure)\n\n// 4-ary predicate assertion macros.\n#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \\\n  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED4(pred, v1, v2, v3, v4) \\\n  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \\\n  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED4(pred, v1, v2, v3, v4) \\\n  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)\n\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1,\n          typename T2,\n          typename T3,\n          typename T4,\n          typename T5>\nAssertionResult AssertPred5Helper(const char* pred_text,\n                                  const char* e1,\n                                  const char* e2,\n                                  const char* e3,\n                                  const char* e4,\n                                  const char* e5,\n                                  Pred pred,\n                                  const T1& v1,\n                                  const T2& v2,\n                                  const T3& v3,\n                                  const T4& v4,\n                                  const T5& v5) {\n  if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \", \"\n                            << e2 << \", \"\n                            << e3 << \", \"\n                            << e4 << \", \"\n                            << e5 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1\n                            << \"\\n\" << e2 << \" evaluates to \" << v2\n                            << \"\\n\" << e3 << \" evaluates to \" << v3\n                            << \"\\n\" << e4 << \" evaluates to \" << v4\n                            << \"\\n\" << e5 << \" evaluates to \" << v5;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use\n// this in your code.\n#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \\\n                                             #v1, \\\n                                             #v2, \\\n                                             #v3, \\\n                                             #v4, \\\n                                             #v5, \\\n                                             pred, \\\n                                             v1, \\\n                                             v2, \\\n                                             v3, \\\n                                             v4, \\\n                                             v5), on_failure)\n\n// 5-ary predicate assertion macros.\n#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \\\n  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \\\n  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \\\n  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \\\n  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)\n\n\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_\n\n// Macros for testing equalities and inequalities.\n//\n//    * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual\n//    * {ASSERT|EXPECT}_NE(v1, v2):           Tests that v1 != v2\n//    * {ASSERT|EXPECT}_LT(v1, v2):           Tests that v1 < v2\n//    * {ASSERT|EXPECT}_LE(v1, v2):           Tests that v1 <= v2\n//    * {ASSERT|EXPECT}_GT(v1, v2):           Tests that v1 > v2\n//    * {ASSERT|EXPECT}_GE(v1, v2):           Tests that v1 >= v2\n//\n// When they are not, Google Test prints both the tested expressions and\n// their actual values.  The values must be compatible built-in types,\n// or you will get a compiler error.  By \"compatible\" we mean that the\n// values can be compared by the respective operator.\n//\n// Note:\n//\n//   1. It is possible to make a user-defined type work with\n//   {ASSERT|EXPECT}_??(), but that requires overloading the\n//   comparison operators and is thus discouraged by the Google C++\n//   Usage Guide.  Therefore, you are advised to use the\n//   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are\n//   equal.\n//\n//   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on\n//   pointers (in particular, C strings).  Therefore, if you use it\n//   with two C strings, you are testing how their locations in memory\n//   are related, not how their content is related.  To compare two C\n//   strings by content, use {ASSERT|EXPECT}_STR*().\n//\n//   3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to\n//   {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you\n//   what the actual value is when it fails, and similarly for the\n//   other comparisons.\n//\n//   4. Do not depend on the order in which {ASSERT|EXPECT}_??()\n//   evaluate their arguments, which is undefined.\n//\n//   5. These macros evaluate their arguments exactly once.\n//\n// Examples:\n//\n//   EXPECT_NE(5, Foo());\n//   EXPECT_EQ(NULL, a_pointer);\n//   ASSERT_LT(i, array_size);\n//   ASSERT_GT(records.size(), 0) << \"There is no record left.\";\n\n#define EXPECT_EQ(expected, actual) \\\n  EXPECT_PRED_FORMAT2(::testing::internal:: \\\n                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \\\n                      expected, actual)\n#define EXPECT_NE(expected, actual) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)\n#define EXPECT_LE(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)\n#define EXPECT_LT(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)\n#define EXPECT_GE(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)\n#define EXPECT_GT(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)\n\n#define GTEST_ASSERT_EQ(expected, actual) \\\n  ASSERT_PRED_FORMAT2(::testing::internal:: \\\n                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \\\n                      expected, actual)\n#define GTEST_ASSERT_NE(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)\n#define GTEST_ASSERT_LE(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)\n#define GTEST_ASSERT_LT(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)\n#define GTEST_ASSERT_GE(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)\n#define GTEST_ASSERT_GT(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)\n\n// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of\n// ASSERT_XY(), which clashes with some users' own code.\n\n#if !GTEST_DONT_DEFINE_ASSERT_EQ\n# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_NE\n# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_LE\n# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_LT\n# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_GE\n# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_GT\n# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)\n#endif\n\n// C-string Comparisons.  All tests treat NULL and any non-NULL string\n// as different.  Two NULLs are equal.\n//\n//    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2\n//    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2\n//    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case\n//    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case\n//\n// For wide or narrow string objects, you can use the\n// {ASSERT|EXPECT}_??() macros.\n//\n// Don't depend on the order in which the arguments are evaluated,\n// which is undefined.\n//\n// These macros evaluate their arguments exactly once.\n\n#define EXPECT_STREQ(expected, actual) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)\n#define EXPECT_STRNE(s1, s2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)\n#define EXPECT_STRCASEEQ(expected, actual) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)\n#define EXPECT_STRCASENE(s1, s2)\\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)\n\n#define ASSERT_STREQ(expected, actual) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)\n#define ASSERT_STRNE(s1, s2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)\n#define ASSERT_STRCASEEQ(expected, actual) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)\n#define ASSERT_STRCASENE(s1, s2)\\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)\n\n// Macros for comparing floating-point numbers.\n//\n//    * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):\n//         Tests that two float values are almost equal.\n//    * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):\n//         Tests that two double values are almost equal.\n//    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):\n//         Tests that v1 and v2 are within the given distance to each other.\n//\n// Google Test uses ULP-based comparison to automatically pick a default\n// error bound that is appropriate for the operands.  See the\n// FloatingPoint template class in gtest-internal.h if you are\n// interested in the implementation details.\n\n#define EXPECT_FLOAT_EQ(expected, actual)\\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \\\n                      expected, actual)\n\n#define EXPECT_DOUBLE_EQ(expected, actual)\\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \\\n                      expected, actual)\n\n#define ASSERT_FLOAT_EQ(expected, actual)\\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \\\n                      expected, actual)\n\n#define ASSERT_DOUBLE_EQ(expected, actual)\\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \\\n                      expected, actual)\n\n#define EXPECT_NEAR(val1, val2, abs_error)\\\n  EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \\\n                      val1, val2, abs_error)\n\n#define ASSERT_NEAR(val1, val2, abs_error)\\\n  ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \\\n                      val1, val2, abs_error)\n\n// These predicate format functions work on floating-point values, and\n// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.\n//\n//   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);\n\n// Asserts that val1 is less than, or almost equal to, val2.  Fails\n// otherwise.  In particular, it fails if either val1 or val2 is NaN.\nGTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,\n                                   float val1, float val2);\nGTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,\n                                    double val1, double val2);\n\n\n#if GTEST_OS_WINDOWS\n\n// Macros that test for HRESULT failure and success, these are only useful\n// on Windows, and rely on Windows SDK macros and APIs to compile.\n//\n//    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)\n//\n// When expr unexpectedly fails or succeeds, Google Test prints the\n// expected result and the actual result with both a human-readable\n// string representation of the error, if available, as well as the\n// hex result code.\n# define EXPECT_HRESULT_SUCCEEDED(expr) \\\n    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))\n\n# define ASSERT_HRESULT_SUCCEEDED(expr) \\\n    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))\n\n# define EXPECT_HRESULT_FAILED(expr) \\\n    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))\n\n# define ASSERT_HRESULT_FAILED(expr) \\\n    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))\n\n#endif  // GTEST_OS_WINDOWS\n\n// Macros that execute statement and check that it doesn't generate new fatal\n// failures in the current thread.\n//\n//   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);\n//\n// Examples:\n//\n//   EXPECT_NO_FATAL_FAILURE(Process());\n//   ASSERT_NO_FATAL_FAILURE(Process()) << \"Process() failed\";\n//\n#define ASSERT_NO_FATAL_FAILURE(statement) \\\n    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)\n#define EXPECT_NO_FATAL_FAILURE(statement) \\\n    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)\n\n// Causes a trace (including the source file path, the current line\n// number, and the given message) to be included in every test failure\n// message generated by code in the current scope.  The effect is\n// undone when the control leaves the current scope.\n//\n// The message argument can be anything streamable to std::ostream.\n//\n// In the implementation, we include the current line number as part\n// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s\n// to appear in the same block - as long as they are on different\n// lines.\n#define SCOPED_TRACE(message) \\\n  ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\\\n    __FILE__, __LINE__, ::testing::Message() << (message))\n\n// Compile-time assertion for type equality.\n// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are\n// the same type.  The value it returns is not interesting.\n//\n// Instead of making StaticAssertTypeEq a class template, we make it a\n// function template that invokes a helper class template.  This\n// prevents a user from misusing StaticAssertTypeEq<T1, T2> by\n// defining objects of that type.\n//\n// CAVEAT:\n//\n// When used inside a method of a class template,\n// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is\n// instantiated.  For example, given:\n//\n//   template <typename T> class Foo {\n//    public:\n//     void Bar() { testing::StaticAssertTypeEq<int, T>(); }\n//   };\n//\n// the code:\n//\n//   void Test1() { Foo<bool> foo; }\n//\n// will NOT generate a compiler error, as Foo<bool>::Bar() is never\n// actually instantiated.  Instead, you need:\n//\n//   void Test2() { Foo<bool> foo; foo.Bar(); }\n//\n// to cause a compiler error.\ntemplate <typename T1, typename T2>\nbool StaticAssertTypeEq() {\n  (void)internal::StaticAssertTypeEqHelper<T1, T2>();\n  return true;\n}\n\n// Defines a test.\n//\n// The first parameter is the name of the test case, and the second\n// parameter is the name of the test within the test case.\n//\n// The convention is to end the test case name with \"Test\".  For\n// example, a test case for the Foo class can be named FooTest.\n//\n// The user should put his test code between braces after using this\n// macro.  Example:\n//\n//   TEST(FooTest, InitializesCorrectly) {\n//     Foo foo;\n//     EXPECT_TRUE(foo.StatusIsOK());\n//   }\n\n// Note that we call GetTestTypeId() instead of GetTypeId<\n// ::testing::Test>() here to get the type ID of testing::Test.  This\n// is to work around a suspected linker bug when using Google Test as\n// a framework on Mac OS X.  The bug causes GetTypeId<\n// ::testing::Test>() to return different values depending on whether\n// the call is from the Google Test framework itself or from user test\n// code.  GetTestTypeId() is guaranteed to always return the same\n// value, as it always calls GetTypeId<>() from the Google Test\n// framework.\n#define GTEST_TEST(test_case_name, test_name)\\\n  GTEST_TEST_(test_case_name, test_name, \\\n              ::testing::Test, ::testing::internal::GetTestTypeId())\n\n// Define this macro to 1 to omit the definition of TEST(), which\n// is a generic name and clashes with some other libraries.\n#if !GTEST_DONT_DEFINE_TEST\n# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)\n#endif\n\n// Defines a test that uses a test fixture.\n//\n// The first parameter is the name of the test fixture class, which\n// also doubles as the test case name.  The second parameter is the\n// name of the test within the test case.\n//\n// A test fixture class must be declared earlier.  The user should put\n// his test code between braces after using this macro.  Example:\n//\n//   class FooTest : public testing::Test {\n//    protected:\n//     virtual void SetUp() { b_.AddElement(3); }\n//\n//     Foo a_;\n//     Foo b_;\n//   };\n//\n//   TEST_F(FooTest, InitializesCorrectly) {\n//     EXPECT_TRUE(a_.StatusIsOK());\n//   }\n//\n//   TEST_F(FooTest, ReturnsElementCountCorrectly) {\n//     EXPECT_EQ(0, a_.size());\n//     EXPECT_EQ(1, b_.size());\n//   }\n\n#define TEST_F(test_fixture, test_name)\\\n  GTEST_TEST_(test_fixture, test_name, test_fixture, \\\n              ::testing::internal::GetTypeId<test_fixture>())\n\n}  // namespace testing\n\n// Use this function in main() to run all tests.  It returns 0 if all\n// tests are successful, or 1 otherwise.\n//\n// RUN_ALL_TESTS() should be invoked after the command line has been\n// parsed by InitGoogleTest().\n//\n// This function was formerly a macro; thus, it is in the global\n// namespace and has an all-caps name.\nint RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;\n\ninline int RUN_ALL_TESTS() {\n  return ::testing::UnitTest::GetInstance()->Run();\n}\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/ts/ts_perf.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_TS_PERF_HPP__\n#define __OPENCV_TS_PERF_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"ts_gtest.h\"\n\n#ifdef HAVE_TBB\n#include \"tbb/task_scheduler_init.h\"\n#endif\n\n#if !(defined(LOGD) || defined(LOGI) || defined(LOGW) || defined(LOGE))\n# if defined(ANDROID) && defined(USE_ANDROID_LOGGING)\n#  include <android/log.h>\n\n#  define PERF_TESTS_LOG_TAG \"OpenCV_perf\"\n#  define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, PERF_TESTS_LOG_TAG, __VA_ARGS__))\n#  define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, PERF_TESTS_LOG_TAG, __VA_ARGS__))\n#  define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, PERF_TESTS_LOG_TAG, __VA_ARGS__))\n#  define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, PERF_TESTS_LOG_TAG, __VA_ARGS__))\n# else\n#  define LOGD(_str, ...) do{printf(_str , ## __VA_ARGS__); printf(\"\\n\");fflush(stdout);} while(0)\n#  define LOGI(_str, ...) do{printf(_str , ## __VA_ARGS__); printf(\"\\n\");fflush(stdout);} while(0)\n#  define LOGW(_str, ...) do{printf(_str , ## __VA_ARGS__); printf(\"\\n\");fflush(stdout);} while(0)\n#  define LOGE(_str, ...) do{printf(_str , ## __VA_ARGS__); printf(\"\\n\");fflush(stdout);} while(0)\n# endif\n#endif\n\n// declare major namespaces to avoid errors on unknown namespace\nnamespace cv { namespace gpu {} namespace ocl {} }\n\nnamespace perf\n{\nclass TestBase;\n\n/*****************************************************************************************\\\n*                Predefined typical frame sizes and typical test parameters               *\n\\*****************************************************************************************/\nconst cv::Size szQVGA = cv::Size(320, 240);\nconst cv::Size szVGA = cv::Size(640, 480);\nconst cv::Size szSVGA = cv::Size(800, 600);\nconst cv::Size szXGA = cv::Size(1024, 768);\nconst cv::Size szSXGA = cv::Size(1280, 1024);\nconst cv::Size szWQHD = cv::Size(2560, 1440);\n\nconst cv::Size sznHD = cv::Size(640, 360);\nconst cv::Size szqHD = cv::Size(960, 540);\nconst cv::Size sz240p = szQVGA;\nconst cv::Size sz720p = cv::Size(1280, 720);\nconst cv::Size sz1080p = cv::Size(1920, 1080);\nconst cv::Size sz1440p = szWQHD;\nconst cv::Size sz2160p = cv::Size(3840, 2160);//UHDTV1 4K\nconst cv::Size sz4320p = cv::Size(7680, 4320);//UHDTV2 8K\n\nconst cv::Size sz3MP = cv::Size(2048, 1536);\nconst cv::Size sz5MP = cv::Size(2592, 1944);\nconst cv::Size sz2K = cv::Size(2048, 2048);\n\nconst cv::Size szODD = cv::Size(127, 61);\n\nconst cv::Size szSmall24 = cv::Size(24, 24);\nconst cv::Size szSmall32 = cv::Size(32, 32);\nconst cv::Size szSmall64 = cv::Size(64, 64);\nconst cv::Size szSmall128 = cv::Size(128, 128);\n\n#define SZ_ALL_VGA ::testing::Values(::perf::szQVGA, ::perf::szVGA, ::perf::szSVGA)\n#define SZ_ALL_GA  ::testing::Values(::perf::szQVGA, ::perf::szVGA, ::perf::szSVGA, ::perf::szXGA, ::perf::szSXGA)\n#define SZ_ALL_HD  ::testing::Values(::perf::sznHD, ::perf::szqHD, ::perf::sz720p, ::perf::sz1080p)\n#define SZ_ALL_SMALL ::testing::Values(::perf::szSmall24, ::perf::szSmall32, ::perf::szSmall64, ::perf::szSmall128)\n#define SZ_ALL  ::testing::Values(::perf::szQVGA, ::perf::szVGA, ::perf::szSVGA, ::perf::szXGA, ::perf::szSXGA, ::perf::sznHD, ::perf::szqHD, ::perf::sz720p, ::perf::sz1080p)\n#define SZ_TYPICAL  ::testing::Values(::perf::szVGA, ::perf::szqHD, ::perf::sz720p, ::perf::szODD)\n\n\n#define TYPICAL_MAT_SIZES ::perf::szVGA, ::perf::sz720p, ::perf::sz1080p, ::perf::szODD\n#define TYPICAL_MAT_TYPES CV_8UC1, CV_8UC4, CV_32FC1\n#define TYPICAL_MATS testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( TYPICAL_MAT_TYPES ) )\n#define TYPICAL_MATS_C1 testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( CV_8UC1, CV_32FC1 ) )\n#define TYPICAL_MATS_C4 testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( CV_8UC4 ) )\n\n\n/*****************************************************************************************\\\n*                MatType - printable wrapper over integer 'type' of Mat                   *\n\\*****************************************************************************************/\nclass MatType\n{\npublic:\n    MatType(int val=0) : _type(val) {}\n    operator int() const {return _type;}\n\nprivate:\n    int _type;\n};\n\n/*****************************************************************************************\\\n*     CV_ENUM and CV_FLAGS - macro to create printable wrappers for defines and enums     *\n\\*****************************************************************************************/\n\n#define CV_ENUM(class_name, ...)                                                        \\\n    namespace {                                                                         \\\n    struct class_name {                                                                 \\\n        class_name(int val = 0) : val_(val) {}                                          \\\n        operator int() const { return val_; }                                           \\\n        void PrintTo(std::ostream* os) const {                                          \\\n            using namespace cv;using namespace cv::gpu; using namespace cv::ocl;        \\\n            const int vals[] = { __VA_ARGS__ };                                         \\\n            const char* svals = #__VA_ARGS__;                                           \\\n            for(int i = 0, pos = 0; i < (int)(sizeof(vals)/sizeof(int)); ++i) {         \\\n                while(isspace(svals[pos]) || svals[pos] == ',') ++pos;                  \\\n                int start = pos;                                                        \\\n                while(!(isspace(svals[pos]) || svals[pos] == ',' || svals[pos] == 0))   \\\n                    ++pos;                                                              \\\n                if (val_ == vals[i]) {                                                  \\\n                    *os << std::string(svals + start, svals + pos);                     \\\n                    return;                                                             \\\n                }                                                                       \\\n            }                                                                           \\\n            *os << \"UNKNOWN\";                                                           \\\n        }                                                                               \\\n        static ::testing::internal::ParamGenerator<class_name> all() {                  \\\n            using namespace cv;using namespace cv::gpu; using namespace cv::ocl;        \\\n            static class_name vals[] = { __VA_ARGS__ };                                 \\\n            return ::testing::ValuesIn(vals);                                           \\\n        }                                                                               \\\n    private: int val_;                                                                  \\\n    };                                                                                  \\\n    inline void PrintTo(const class_name& t, std::ostream* os) { t.PrintTo(os); } }\n\n#define CV_FLAGS(class_name, ...)                                                       \\\n    namespace {                                                                         \\\n    struct class_name {                                                                 \\\n        class_name(int val = 0) : val_(val) {}                                          \\\n        operator int() const { return val_; }                                           \\\n        void PrintTo(std::ostream* os) const {                                          \\\n            using namespace cv;using namespace cv::gpu; using namespace cv::ocl;        \\\n            const int vals[] = { __VA_ARGS__ };                                         \\\n            const char* svals = #__VA_ARGS__;                                           \\\n            int value = val_;                                                           \\\n            bool first = true;                                                          \\\n            for(int i = 0, pos = 0; i < (int)(sizeof(vals)/sizeof(int)); ++i) {         \\\n                while(isspace(svals[pos]) || svals[pos] == ',') ++pos;                  \\\n                int start = pos;                                                        \\\n                while(!(isspace(svals[pos]) || svals[pos] == ',' || svals[pos] == 0))   \\\n                    ++pos;                                                              \\\n                if ((value & vals[i]) == vals[i]) {                                     \\\n                    value &= ~vals[i];                                                  \\\n                    if (first) first = false; else *os << \"|\";                          \\\n                    *os << std::string(svals + start, svals + pos);                     \\\n                    if (!value) return;                                                 \\\n                }                                                                       \\\n            }                                                                           \\\n            if (first) *os << \"UNKNOWN\";                                                \\\n        }                                                                               \\\n    private: int val_;                                                                  \\\n    };                                                                                  \\\n    inline void PrintTo(const class_name& t, std::ostream* os) { t.PrintTo(os); } }\n\nCV_ENUM(MatDepth, CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F, CV_USRTYPE1)\n\n/*****************************************************************************************\\\n*                 Regression control utility for performance testing                      *\n\\*****************************************************************************************/\nenum ERROR_TYPE\n{\n    ERROR_ABSOLUTE = 0,\n    ERROR_RELATIVE = 1\n};\n\nclass CV_EXPORTS Regression\n{\npublic:\n    static Regression& add(TestBase* test, const std::string& name, cv::InputArray array, double eps = DBL_EPSILON, ERROR_TYPE err = ERROR_ABSOLUTE);\n    static Regression& addKeypoints(TestBase* test, const std::string& name, const std::vector<cv::KeyPoint>& array, double eps = DBL_EPSILON, ERROR_TYPE err = ERROR_ABSOLUTE);\n    static Regression& addMatches(TestBase* test, const std::string& name, const std::vector<cv::DMatch>& array, double eps = DBL_EPSILON, ERROR_TYPE err = ERROR_ABSOLUTE);\n    static void Init(const std::string& testSuitName, const std::string& ext = \".xml\");\n\n    Regression& operator() (const std::string& name, cv::InputArray array, double eps = DBL_EPSILON, ERROR_TYPE err = ERROR_ABSOLUTE);\n\nprivate:\n    static Regression& instance();\n    Regression();\n    ~Regression();\n\n    Regression(const Regression&);\n    Regression& operator=(const Regression&);\n\n    cv::RNG regRNG;//own random numbers generator to make collection and verification work identical\n    std::string storageInPath;\n    std::string storageOutPath;\n    cv::FileStorage storageIn;\n    cv::FileStorage storageOut;\n    cv::FileNode rootIn;\n    std::string currentTestNodeName;\n    std::string suiteName;\n\n    cv::FileStorage& write();\n\n    static std::string getCurrentTestNodeName();\n    static bool isVector(cv::InputArray a);\n    static double getElem(cv::Mat& m, int x, int y, int cn = 0);\n\n    void init(const std::string& testSuitName, const std::string& ext);\n    void write(cv::InputArray array);\n    void write(cv::Mat m);\n    void verify(cv::FileNode node, cv::InputArray array, double eps, ERROR_TYPE err);\n    void verify(cv::FileNode node, cv::Mat actual, double eps, std::string argname, ERROR_TYPE err);\n};\n\n#define SANITY_CHECK(array, ...) ::perf::Regression::add(this, #array, array , ## __VA_ARGS__)\n#define SANITY_CHECK_KEYPOINTS(array, ...) ::perf::Regression::addKeypoints(this, #array, array , ## __VA_ARGS__)\n#define SANITY_CHECK_MATCHES(array, ...) ::perf::Regression::addMatches(this, #array, array , ## __VA_ARGS__)\n#define SANITY_CHECK_NOTHING() this->setVerified()\n\nclass CV_EXPORTS GpuPerf\n{\npublic:\n  static bool targetDevice();\n};\n\n#define PERF_RUN_GPU()  ::perf::GpuPerf::targetDevice()\n\n/*****************************************************************************************\\\n*                            Container for performance metrics                            *\n\\*****************************************************************************************/\ntypedef struct CV_EXPORTS performance_metrics\n{\n    size_t bytesIn;\n    size_t bytesOut;\n    unsigned int samples;\n    unsigned int outliers;\n    double gmean;\n    double gstddev;//stddev for log(time)\n    double mean;\n    double stddev;\n    double median;\n    double min;\n    double frequency;\n    int terminationReason;\n\n    enum\n    {\n        TERM_ITERATIONS = 0,\n        TERM_TIME = 1,\n        TERM_INTERRUPT = 2,\n        TERM_EXCEPTION = 3,\n        TERM_SKIP_TEST = 4, // there are some limitations and test should be skipped\n        TERM_UNKNOWN = -1\n    };\n\n    performance_metrics();\n    void clear();\n} performance_metrics;\n\n\n/*****************************************************************************************\\\n*                           Strategy for performance measuring                            *\n\\*****************************************************************************************/\nenum PERF_STRATEGY\n{\n    PERF_STRATEGY_BASE = 0,\n    PERF_STRATEGY_SIMPLE = 1\n};\n\n\n/*****************************************************************************************\\\n*                           Base fixture for performance tests                            *\n\\*****************************************************************************************/\nclass CV_EXPORTS TestBase: public ::testing::Test\n{\npublic:\n    TestBase();\n\n    static void Init(int argc, const char* const argv[]);\n    static void Init(const std::vector<std::string> & availableImpls,\n                     int argc, const char* const argv[]);\n    static void RecordRunParameters();\n    static std::string getDataPath(const std::string& relativePath);\n    static std::string getSelectedImpl();\n\n    static enum PERF_STRATEGY getPerformanceStrategy();\n    static enum PERF_STRATEGY setPerformanceStrategy(enum PERF_STRATEGY strategy);\n\n    class PerfSkipTestException: public cv::Exception {};\n\nprotected:\n    virtual void PerfTestBody() = 0;\n\n    virtual void SetUp();\n    virtual void TearDown();\n\n    void startTimer();\n    void stopTimer();\n    bool next();\n\n    //_declareHelper declare;\n\n    enum\n    {\n        WARMUP_READ,\n        WARMUP_WRITE,\n        WARMUP_RNG,\n        WARMUP_NONE\n    };\n\n    void reportMetrics(bool toJUnitXML = false);\n    static void warmup(cv::InputOutputArray a, int wtype = WARMUP_READ);\n\n    performance_metrics& calcMetrics();\n    void RunPerfTestBody();\nprivate:\n    typedef std::vector<std::pair<int, cv::Size> > SizeVector;\n    typedef std::vector<int64> TimeVector;\n\n    SizeVector inputData;\n    SizeVector outputData;\n    unsigned int getTotalInputSize() const;\n    unsigned int getTotalOutputSize() const;\n\n    TimeVector times;\n    int64 lastTime;\n    int64 totalTime;\n    int64 timeLimit;\n    static int64 timeLimitDefault;\n    static unsigned int iterationsLimitDefault;\n\n    unsigned int nIters;\n    unsigned int currentIter;\n    unsigned int runsPerIteration;\n\n    performance_metrics metrics;\n    void validateMetrics();\n\n    static int64 _timeadjustment;\n    static int64 _calibrate();\n\n    static void warmup_impl(cv::Mat m, int wtype);\n    static int getSizeInBytes(cv::InputArray a);\n    static cv::Size getSize(cv::InputArray a);\n    static void declareArray(SizeVector& sizes, cv::InputOutputArray a, int wtype = 0);\n\n    class CV_EXPORTS _declareHelper\n    {\n    public:\n        _declareHelper& in(cv::InputOutputArray a1, int wtype = WARMUP_READ);\n        _declareHelper& in(cv::InputOutputArray a1, cv::InputOutputArray a2, int wtype = WARMUP_READ);\n        _declareHelper& in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, int wtype = WARMUP_READ);\n        _declareHelper& in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, int wtype = WARMUP_READ);\n\n        _declareHelper& out(cv::InputOutputArray a1, int wtype = WARMUP_WRITE);\n        _declareHelper& out(cv::InputOutputArray a1, cv::InputOutputArray a2, int wtype = WARMUP_WRITE);\n        _declareHelper& out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, int wtype = WARMUP_WRITE);\n        _declareHelper& out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, int wtype = WARMUP_WRITE);\n\n        _declareHelper& iterations(unsigned int n);\n        _declareHelper& time(double timeLimitSecs);\n        _declareHelper& tbb_threads(int n = -1);\n        _declareHelper& runs(unsigned int runsNumber);\n    private:\n        TestBase* test;\n        _declareHelper(TestBase* t);\n        _declareHelper(const _declareHelper&);\n        _declareHelper& operator=(const _declareHelper&);\n        friend class TestBase;\n    };\n    friend class _declareHelper;\n\n    bool verified;\n\npublic:\n    _declareHelper declare;\n\n    void setVerified() { this->verified = true; }\n};\n\ntemplate<typename T> class TestBaseWithParam: public TestBase, public ::testing::WithParamInterface<T> {};\n\ntypedef std::tr1::tuple<cv::Size, MatType> Size_MatType_t;\ntypedef TestBaseWithParam<Size_MatType_t> Size_MatType;\n\n/*****************************************************************************************\\\n*                              Print functions for googletest                             *\n\\*****************************************************************************************/\nCV_EXPORTS void PrintTo(const MatType& t, std::ostream* os);\n\n} //namespace perf\n\nnamespace cv\n{\n\nCV_EXPORTS void PrintTo(const Size& sz, ::std::ostream* os);\n\n} //namespace cv\n\n\n/*****************************************************************************************\\\n*                        Macro definitions for performance tests                          *\n\\*****************************************************************************************/\n#define PERF_PROXY_NAMESPACE_NAME_(test_case_name, test_name) \\\n  test_case_name##_##test_name##_perf_namespace_proxy\n\n// Defines a performance test.\n//\n// The first parameter is the name of the test case, and the second\n// parameter is the name of the test within the test case.\n//\n// The user should put his test code between braces after using this\n// macro.  Example:\n//\n//   PERF_TEST(FooTest, InitializesCorrectly) {\n//     Foo foo;\n//     EXPECT_TRUE(foo.StatusIsOK());\n//   }\n#define PERF_TEST(test_case_name, test_name)\\\n    namespace PERF_PROXY_NAMESPACE_NAME_(test_case_name, test_name) {\\\n     class TestBase {/*compile error for this class means that you are trying to use perf::TestBase as a fixture*/};\\\n     class test_case_name : public ::perf::TestBase {\\\n      public:\\\n       test_case_name() {}\\\n      protected:\\\n       virtual void PerfTestBody();\\\n     };\\\n     TEST_F(test_case_name, test_name){ RunPerfTestBody(); }\\\n    }\\\n    void PERF_PROXY_NAMESPACE_NAME_(test_case_name, test_name)::test_case_name::PerfTestBody()\n\n// Defines a performance test that uses a test fixture.\n//\n// The first parameter is the name of the test fixture class, which\n// also doubles as the test case name.  The second parameter is the\n// name of the test within the test case.\n//\n// A test fixture class must be declared earlier.  The user should put\n// his test code between braces after using this macro.  Example:\n//\n//   class FooTest : public ::perf::TestBase {\n//    protected:\n//     virtual void SetUp() { TestBase::SetUp(); b_.AddElement(3); }\n//\n//     Foo a_;\n//     Foo b_;\n//   };\n//\n//   PERF_TEST_F(FooTest, InitializesCorrectly) {\n//     EXPECT_TRUE(a_.StatusIsOK());\n//   }\n//\n//   PERF_TEST_F(FooTest, ReturnsElementCountCorrectly) {\n//     EXPECT_EQ(0, a_.size());\n//     EXPECT_EQ(1, b_.size());\n//   }\n#define PERF_TEST_F(fixture, testname) \\\n    namespace PERF_PROXY_NAMESPACE_NAME_(fixture, testname) {\\\n     class TestBase {/*compile error for this class means that you are trying to use perf::TestBase as a fixture*/};\\\n     class fixture : public ::fixture {\\\n      public:\\\n       fixture() {}\\\n      protected:\\\n       virtual void PerfTestBody();\\\n     };\\\n     TEST_F(fixture, testname){ RunPerfTestBody(); }\\\n    }\\\n    void PERF_PROXY_NAMESPACE_NAME_(fixture, testname)::fixture::PerfTestBody()\n\n// Defines a parametrized performance test.\n//\n// The first parameter is the name of the test fixture class, which\n// also doubles as the test case name.  The second parameter is the\n// name of the test within the test case.\n//\n// The user should put his test code between braces after using this\n// macro.  Example:\n//\n//   typedef ::perf::TestBaseWithParam<cv::Size> FooTest;\n//\n//   PERF_TEST_P(FooTest, DoTestingRight, ::testing::Values(::perf::szVGA, ::perf::sz720p) {\n//     cv::Mat b(GetParam(), CV_8U, cv::Scalar(10));\n//     cv::Mat a(GetParam(), CV_8U, cv::Scalar(20));\n//     cv::Mat c(GetParam(), CV_8U, cv::Scalar(0));\n//\n//     declare.in(a, b).out(c).time(0.5);\n//\n//     TEST_CYCLE() cv::add(a, b, c);\n//\n//     SANITY_CHECK(c);\n//   }\n#define PERF_TEST_P(fixture, name, params)  \\\n    class fixture##_##name : public fixture {\\\n     public:\\\n      fixture##_##name() {}\\\n     protected:\\\n      virtual void PerfTestBody();\\\n    };\\\n    TEST_P(fixture##_##name, name /*perf*/){ RunPerfTestBody(); }\\\n    INSTANTIATE_TEST_CASE_P(/*none*/, fixture##_##name, params);\\\n    void fixture##_##name::PerfTestBody()\n\n#ifndef __CV_TEST_EXEC_ARGS\n#if defined(_MSC_VER) && (_MSC_VER <= 1400)\n#define __CV_TEST_EXEC_ARGS(...)    \\\n    while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\n#else\n#define __CV_TEST_EXEC_ARGS(...)    \\\n    __VA_ARGS__;\n#endif\n#endif\n\n#define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...)\t\\\n    ::perf::Regression::Init(#modulename); \\\n    ::perf::TestBase::Init(std::vector<std::string>(impls, impls + sizeof impls / sizeof *impls), \\\n                           argc, argv); \\\n    ::testing::InitGoogleTest(&argc, argv); \\\n    cvtest::printVersionInfo(); \\\n    ::testing::Test::RecordProperty(\"cv_module_name\", #modulename); \\\n    ::perf::TestBase::RecordRunParameters(); \\\n    __CV_TEST_EXEC_ARGS(__VA_ARGS__) \\\n    return RUN_ALL_TESTS();\n\n// impls must be an array, not a pointer; \"plain\" should always be one of the implementations\n#define CV_PERF_TEST_MAIN_WITH_IMPLS(modulename, impls, ...) \\\nint main(int argc, char **argv)\\\n{\\\n    CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, __VA_ARGS__)\\\n}\n\n#define CV_PERF_TEST_MAIN(modulename, ...) \\\nint main(int argc, char **argv)\\\n{\\\n    const char * plain_only[] = { \"plain\" };\\\n    CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\\\n}\n\n#define TEST_CYCLE_N(n) for(declare.iterations(n); startTimer(), next(); stopTimer())\n#define TEST_CYCLE() for(; startTimer(), next(); stopTimer())\n#define TEST_CYCLE_MULTIRUN(runsNum) for(declare.runs(runsNum); startTimer(), next(); stopTimer()) for(int r = 0; r < runsNum; ++r)\n\nnamespace perf\n{\nnamespace comparators\n{\n\ntemplate<typename T>\nstruct CV_EXPORTS RectLess_\n{\n  bool operator()(const cv::Rect_<T>& r1, const cv::Rect_<T>& r2) const\n  {\n    return r1.x < r2.x\n      || (r1.x == r2.x && r1.y < r2.y)\n      || (r1.x == r2.x && r1.y == r2.y && r1.width < r2.width)\n      || (r1.x == r2.x && r1.y == r2.y && r1.width == r2.width && r1.height < r2.height);\n  }\n};\n\ntypedef RectLess_<int> RectLess;\n\nstruct CV_EXPORTS KeypointGreater\n{\n    bool operator()(const cv::KeyPoint& kp1, const cv::KeyPoint& kp2) const\n    {\n        if(kp1.response > kp2.response) return true;\n        if(kp1.response < kp2.response) return false;\n        if(kp1.size > kp2.size) return true;\n        if(kp1.size < kp2.size) return false;\n        if(kp1.octave > kp2.octave) return true;\n        if(kp1.octave < kp2.octave) return false;\n        if(kp1.pt.y < kp2.pt.y) return false;\n        if(kp1.pt.y > kp2.pt.y) return true;\n        return kp1.pt.x < kp2.pt.x;\n    }\n};\n\n} //namespace comparators\n\nvoid CV_EXPORTS sort(std::vector<cv::KeyPoint>& pts, cv::InputOutputArray descriptors);\n} //namespace perf\n\n#endif //__OPENCV_TS_PERF_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/video/background_segm.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_BACKGROUND_SEGM_HPP__\n#define __OPENCV_BACKGROUND_SEGM_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include <list>\nnamespace cv\n{\n\n/*!\n The Base Class for Background/Foreground Segmentation\n\n The class is only used to define the common interface for\n the whole family of background/foreground segmentation algorithms.\n*/\nclass CV_EXPORTS_W BackgroundSubtractor : public Algorithm\n{\npublic:\n    //! the virtual destructor\n    virtual ~BackgroundSubtractor();\n    //! the update operator that takes the next video frame and returns the current foreground mask as 8-bit binary image.\n    CV_WRAP_AS(apply) virtual void operator()(InputArray image, OutputArray fgmask,\n                                              double learningRate=0);\n\n    //! computes a background image\n    virtual void getBackgroundImage(OutputArray backgroundImage) const;\n};\n\n\n/*!\n Gaussian Mixture-based Backbround/Foreground Segmentation Algorithm\n\n The class implements the following algorithm:\n \"An improved adaptive background mixture model for real-time tracking with shadow detection\"\n P. KadewTraKuPong and R. Bowden,\n Proc. 2nd European Workshp on Advanced Video-Based Surveillance Systems, 2001.\"\n http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf\n\n*/\nclass CV_EXPORTS_W BackgroundSubtractorMOG : public BackgroundSubtractor\n{\npublic:\n    //! the default constructor\n    CV_WRAP BackgroundSubtractorMOG();\n    //! the full constructor that takes the length of the history, the number of gaussian mixtures, the background ratio parameter and the noise strength\n    CV_WRAP BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma=0);\n    //! the destructor\n    virtual ~BackgroundSubtractorMOG();\n    //! the update operator\n    virtual void operator()(InputArray image, OutputArray fgmask, double learningRate=0);\n\n    //! re-initiaization method\n    virtual void initialize(Size frameSize, int frameType);\n\n    virtual AlgorithmInfo* info() const;\n\nprotected:\n    Size frameSize;\n    int frameType;\n    Mat bgmodel;\n    int nframes;\n    int history;\n    int nmixtures;\n    double varThreshold;\n    double backgroundRatio;\n    double noiseSigma;\n};\n\n\n/*!\n The class implements the following algorithm:\n \"Improved adaptive Gausian mixture model for background subtraction\"\n Z.Zivkovic\n International Conference Pattern Recognition, UK, August, 2004.\n http://www.zoranz.net/Publications/zivkovic2004ICPR.pdf\n*/\nclass CV_EXPORTS_W BackgroundSubtractorMOG2 : public BackgroundSubtractor\n{\npublic:\n    //! the default constructor\n    CV_WRAP BackgroundSubtractorMOG2();\n    //! the full constructor that takes the length of the history, the number of gaussian mixtures, the background ratio parameter and the noise strength\n    CV_WRAP BackgroundSubtractorMOG2(int history,  float varThreshold, bool bShadowDetection=true);\n    //! the destructor\n    virtual ~BackgroundSubtractorMOG2();\n    //! the update operator\n    virtual void operator()(InputArray image, OutputArray fgmask, double learningRate=-1);\n\n    //! computes a background image which are the mean of all background gaussians\n    virtual void getBackgroundImage(OutputArray backgroundImage) const;\n\n    //! re-initiaization method\n    virtual void initialize(Size frameSize, int frameType);\n\n    virtual AlgorithmInfo* info() const;\n\nprotected:\n    Size frameSize;\n    int frameType;\n    Mat bgmodel;\n    Mat bgmodelUsedModes;//keep track of number of modes per pixel\n    int nframes;\n    int history;\n    int nmixtures;\n    //! here it is the maximum allowed number of mixture components.\n    //! Actual number is determined dynamically per pixel\n    double varThreshold;\n    // threshold on the squared Mahalanobis distance to decide if it is well described\n    // by the background model or not. Related to Cthr from the paper.\n    // This does not influence the update of the background. A typical value could be 4 sigma\n    // and that is varThreshold=4*4=16; Corresponds to Tb in the paper.\n\n    /////////////////////////\n    // less important parameters - things you might change but be carefull\n    ////////////////////////\n    float backgroundRatio;\n    // corresponds to fTB=1-cf from the paper\n    // TB - threshold when the component becomes significant enough to be included into\n    // the background model. It is the TB=1-cf from the paper. So I use cf=0.1 => TB=0.\n    // For alpha=0.001 it means that the mode should exist for approximately 105 frames before\n    // it is considered foreground\n    // float noiseSigma;\n    float varThresholdGen;\n    //correspondts to Tg - threshold on the squared Mahalan. dist. to decide\n    //when a sample is close to the existing components. If it is not close\n    //to any a new component will be generated. I use 3 sigma => Tg=3*3=9.\n    //Smaller Tg leads to more generated components and higher Tg might make\n    //lead to small number of components but they can grow too large\n    float fVarInit;\n    float fVarMin;\n    float fVarMax;\n    //initial variance  for the newly generated components.\n    //It will will influence the speed of adaptation. A good guess should be made.\n    //A simple way is to estimate the typical standard deviation from the images.\n    //I used here 10 as a reasonable value\n    // min and max can be used to further control the variance\n    float fCT;//CT - complexity reduction prior\n    //this is related to the number of samples needed to accept that a component\n    //actually exists. We use CT=0.05 of all the samples. By setting CT=0 you get\n    //the standard Stauffer&Grimson algorithm (maybe not exact but very similar)\n\n    //shadow detection parameters\n    bool bShadowDetection;//default 1 - do shadow detection\n    unsigned char nShadowDetection;//do shadow detection - insert this value as the detection result - 127 default value\n    float fTau;\n    // Tau - shadow threshold. The shadow is detected if the pixel is darker\n    //version of the background. Tau is a threshold on how much darker the shadow can be.\n    //Tau= 0.5 means that if pixel is more than 2 times darker then it is not shadow\n    //See: Prati,Mikic,Trivedi,Cucchiarra,\"Detecting Moving Shadows...\",IEEE PAMI,2003.\n};\n\n/**\n * Background Subtractor module. Takes a series of images and returns a sequence of mask (8UC1)\n * images of the same size, where 255 indicates Foreground and 0 represents Background.\n * This class implements an algorithm described in \"Visual Tracking of Human Visitors under\n * Variable-Lighting Conditions for a Responsive Audio Art Installation,\" A. Godbehere,\n * A. Matsukawa, K. Goldberg, American Control Conference, Montreal, June 2012.\n */\nclass CV_EXPORTS BackgroundSubtractorGMG: public cv::BackgroundSubtractor\n{\npublic:\n    BackgroundSubtractorGMG();\n    virtual ~BackgroundSubtractorGMG();\n    virtual AlgorithmInfo* info() const;\n\n    /**\n     * Validate parameters and set up data structures for appropriate image size.\n     * Must call before running on data.\n     * @param frameSize input frame size\n     * @param min       minimum value taken on by pixels in image sequence. Usually 0\n     * @param max       maximum value taken on by pixels in image sequence. e.g. 1.0 or 255\n     */\n    void initialize(cv::Size frameSize, double min, double max);\n\n    /**\n     * Performs single-frame background subtraction and builds up a statistical background image\n     * model.\n     * @param image Input image\n     * @param fgmask Output mask image representing foreground and background pixels\n     * @param learningRate Determines how quickly features are \"forgotten\" from histograms\n     */\n    virtual void operator()(InputArray image, OutputArray fgmask, double learningRate=-1.0);\n\n    /**\n     * Releases all inner buffers.\n     */\n    void release();\n\n    //! Total number of distinct colors to maintain in histogram.\n    int     maxFeatures;\n    //! Set between 0.0 and 1.0, determines how quickly features are \"forgotten\" from histograms.\n    double  learningRate;\n    //! Number of frames of video to use to initialize histograms.\n    int     numInitializationFrames;\n    //! Number of discrete levels in each channel to be used in histograms.\n    int     quantizationLevels;\n    //! Prior probability that any given pixel is a background pixel. A sensitivity parameter.\n    double  backgroundPrior;\n    //! Value above which pixel is determined to be FG.\n    double  decisionThreshold;\n    //! Smoothing radius, in pixels, for cleaning up FG image.\n    int     smoothingRadius;\n    //! Perform background model update\n    bool updateBackgroundModel;\n\nprivate:\n    double maxVal_;\n    double minVal_;\n\n    cv::Size frameSize_;\n    int frameNum_;\n\n    cv::Mat_<int> nfeatures_;\n    cv::Mat_<unsigned int> colors_;\n    cv::Mat_<float> weights_;\n\n    cv::Mat buf_;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/video/tracking.hpp",
    "content": "/*! \\file tracking.hpp\n \\brief The Object and Feature Tracking\n */\n\n/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_TRACKING_HPP__\n#define __OPENCV_TRACKING_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/****************************************************************************************\\\n*                                  Motion Analysis                                       *\n\\****************************************************************************************/\n\n/************************************ optical flow ***************************************/\n\n#define  CV_LKFLOW_PYR_A_READY       1\n#define  CV_LKFLOW_PYR_B_READY       2\n#define  CV_LKFLOW_INITIAL_GUESSES   4\n#define  CV_LKFLOW_GET_MIN_EIGENVALS 8\n\n/* It is Lucas & Kanade method, modified to use pyramids.\n   Also it does several iterations to get optical flow for\n   every point at every pyramid level.\n   Calculates optical flow between two images for certain set of points (i.e.\n   it is a \"sparse\" optical flow, which is opposite to the previous 3 methods) */\nCVAPI(void)  cvCalcOpticalFlowPyrLK( const CvArr*  prev, const CvArr*  curr,\n                                     CvArr*  prev_pyr, CvArr*  curr_pyr,\n                                     const CvPoint2D32f* prev_features,\n                                     CvPoint2D32f* curr_features,\n                                     int       count,\n                                     CvSize    win_size,\n                                     int       level,\n                                     char*     status,\n                                     float*    track_error,\n                                     CvTermCriteria criteria,\n                                     int       flags );\n\n\n/* Modification of a previous sparse optical flow algorithm to calculate\n   affine flow */\nCVAPI(void)  cvCalcAffineFlowPyrLK( const CvArr*  prev, const CvArr*  curr,\n                                    CvArr*  prev_pyr, CvArr*  curr_pyr,\n                                    const CvPoint2D32f* prev_features,\n                                    CvPoint2D32f* curr_features,\n                                    float* matrices, int  count,\n                                    CvSize win_size, int  level,\n                                    char* status, float* track_error,\n                                    CvTermCriteria criteria, int flags );\n\n/* Estimate rigid transformation between 2 images or 2 point sets */\nCVAPI(int)  cvEstimateRigidTransform( const CvArr* A, const CvArr* B,\n                                      CvMat* M, int full_affine );\n\n/* Estimate optical flow for each pixel using the two-frame G. Farneback algorithm */\nCVAPI(void) cvCalcOpticalFlowFarneback( const CvArr* prev, const CvArr* next,\n                                        CvArr* flow, double pyr_scale, int levels,\n                                        int winsize, int iterations, int poly_n,\n                                        double poly_sigma, int flags );\n\n/********************************* motion templates *************************************/\n\n/****************************************************************************************\\\n*        All the motion template functions work only with single channel images.         *\n*        Silhouette image must have depth IPL_DEPTH_8U or IPL_DEPTH_8S                   *\n*        Motion history image must have depth IPL_DEPTH_32F,                             *\n*        Gradient mask - IPL_DEPTH_8U or IPL_DEPTH_8S,                                   *\n*        Motion orientation image - IPL_DEPTH_32F                                        *\n*        Segmentation mask - IPL_DEPTH_32F                                               *\n*        All the angles are in degrees, all the times are in milliseconds                *\n\\****************************************************************************************/\n\n/* Updates motion history image given motion silhouette */\nCVAPI(void)    cvUpdateMotionHistory( const CvArr* silhouette, CvArr* mhi,\n                                      double timestamp, double duration );\n\n/* Calculates gradient of the motion history image and fills\n   a mask indicating where the gradient is valid */\nCVAPI(void)    cvCalcMotionGradient( const CvArr* mhi, CvArr* mask, CvArr* orientation,\n                                     double delta1, double delta2,\n                                     int aperture_size CV_DEFAULT(3));\n\n/* Calculates average motion direction within a selected motion region\n   (region can be selected by setting ROIs and/or by composing a valid gradient mask\n   with the region mask) */\nCVAPI(double)  cvCalcGlobalOrientation( const CvArr* orientation, const CvArr* mask,\n                                        const CvArr* mhi, double timestamp,\n                                        double duration );\n\n/* Splits a motion history image into a few parts corresponding to separate independent motions\n   (e.g. left hand, right hand) */\nCVAPI(CvSeq*)  cvSegmentMotion( const CvArr* mhi, CvArr* seg_mask,\n                                CvMemStorage* storage,\n                                double timestamp, double seg_thresh );\n\n/****************************************************************************************\\\n*                                       Tracking                                         *\n\\****************************************************************************************/\n\n/* Implements CAMSHIFT algorithm - determines object position, size and orientation\n   from the object histogram back project (extension of meanshift) */\nCVAPI(int)  cvCamShift( const CvArr* prob_image, CvRect  window,\n                        CvTermCriteria criteria, CvConnectedComp* comp,\n                        CvBox2D* box CV_DEFAULT(NULL) );\n\n/* Implements MeanShift algorithm - determines object position\n   from the object histogram back project */\nCVAPI(int)  cvMeanShift( const CvArr* prob_image, CvRect  window,\n                         CvTermCriteria criteria, CvConnectedComp* comp );\n\n/*\nstandard Kalman filter (in G. Welch' and G. Bishop's notation):\n\n  x(k)=A*x(k-1)+B*u(k)+w(k)  p(w)~N(0,Q)\n  z(k)=H*x(k)+v(k),   p(v)~N(0,R)\n*/\ntypedef struct CvKalman\n{\n    int MP;                     /* number of measurement vector dimensions */\n    int DP;                     /* number of state vector dimensions */\n    int CP;                     /* number of control vector dimensions */\n\n    /* backward compatibility fields */\n#if 1\n    float* PosterState;         /* =state_pre->data.fl */\n    float* PriorState;          /* =state_post->data.fl */\n    float* DynamMatr;           /* =transition_matrix->data.fl */\n    float* MeasurementMatr;     /* =measurement_matrix->data.fl */\n    float* MNCovariance;        /* =measurement_noise_cov->data.fl */\n    float* PNCovariance;        /* =process_noise_cov->data.fl */\n    float* KalmGainMatr;        /* =gain->data.fl */\n    float* PriorErrorCovariance;/* =error_cov_pre->data.fl */\n    float* PosterErrorCovariance;/* =error_cov_post->data.fl */\n    float* Temp1;               /* temp1->data.fl */\n    float* Temp2;               /* temp2->data.fl */\n#endif\n\n    CvMat* state_pre;           /* predicted state (x'(k)):\n                                    x(k)=A*x(k-1)+B*u(k) */\n    CvMat* state_post;          /* corrected state (x(k)):\n                                    x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) */\n    CvMat* transition_matrix;   /* state transition matrix (A) */\n    CvMat* control_matrix;      /* control matrix (B)\n                                   (it is not used if there is no control)*/\n    CvMat* measurement_matrix;  /* measurement matrix (H) */\n    CvMat* process_noise_cov;   /* process noise covariance matrix (Q) */\n    CvMat* measurement_noise_cov; /* measurement noise covariance matrix (R) */\n    CvMat* error_cov_pre;       /* priori error estimate covariance matrix (P'(k)):\n                                    P'(k)=A*P(k-1)*At + Q)*/\n    CvMat* gain;                /* Kalman gain matrix (K(k)):\n                                    K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)*/\n    CvMat* error_cov_post;      /* posteriori error estimate covariance matrix (P(k)):\n                                    P(k)=(I-K(k)*H)*P'(k) */\n    CvMat* temp1;               /* temporary matrices */\n    CvMat* temp2;\n    CvMat* temp3;\n    CvMat* temp4;\n    CvMat* temp5;\n} CvKalman;\n\n/* Creates Kalman filter and sets A, B, Q, R and state to some initial values */\nCVAPI(CvKalman*) cvCreateKalman( int dynam_params, int measure_params,\n                                 int control_params CV_DEFAULT(0));\n\n/* Releases Kalman filter state */\nCVAPI(void)  cvReleaseKalman( CvKalman** kalman);\n\n/* Updates Kalman filter by time (predicts future state of the system) */\nCVAPI(const CvMat*)  cvKalmanPredict( CvKalman* kalman,\n                                      const CvMat* control CV_DEFAULT(NULL));\n\n/* Updates Kalman filter by measurement\n   (corrects state of the system and internal matrices) */\nCVAPI(const CvMat*)  cvKalmanCorrect( CvKalman* kalman, const CvMat* measurement );\n\n#define cvKalmanUpdateByTime  cvKalmanPredict\n#define cvKalmanUpdateByMeasurement cvKalmanCorrect\n\n#ifdef __cplusplus\n}\n\nnamespace cv\n{\n\n//! updates motion history image using the current silhouette\nCV_EXPORTS_W void updateMotionHistory( InputArray silhouette, InputOutputArray mhi,\n                                       double timestamp, double duration );\n\n//! computes the motion gradient orientation image from the motion history image\nCV_EXPORTS_W void calcMotionGradient( InputArray mhi, OutputArray mask,\n                                      OutputArray orientation,\n                                      double delta1, double delta2,\n                                      int apertureSize=3 );\n\n//! computes the global orientation of the selected motion history image part\nCV_EXPORTS_W double calcGlobalOrientation( InputArray orientation, InputArray mask,\n                                           InputArray mhi, double timestamp,\n                                           double duration );\n\nCV_EXPORTS_W void segmentMotion(InputArray mhi, OutputArray segmask,\n                                CV_OUT vector<Rect>& boundingRects,\n                                double timestamp, double segThresh);\n\n//! updates the object tracking window using CAMSHIFT algorithm\nCV_EXPORTS_W RotatedRect CamShift( InputArray probImage, CV_OUT CV_IN_OUT Rect& window,\n                                   TermCriteria criteria );\n\n//! updates the object tracking window using meanshift algorithm\nCV_EXPORTS_W int meanShift( InputArray probImage, CV_OUT CV_IN_OUT Rect& window,\n                            TermCriteria criteria );\n\n/*!\n Kalman filter.\n\n The class implements standard Kalman filter http://en.wikipedia.org/wiki/Kalman_filter.\n However, you can modify KalmanFilter::transitionMatrix, KalmanFilter::controlMatrix and\n KalmanFilter::measurementMatrix to get the extended Kalman filter functionality.\n*/\nclass CV_EXPORTS_W KalmanFilter\n{\npublic:\n    //! the default constructor\n    CV_WRAP KalmanFilter();\n    //! the full constructor taking the dimensionality of the state, of the measurement and of the control vector\n    CV_WRAP KalmanFilter(int dynamParams, int measureParams, int controlParams=0, int type=CV_32F);\n    //! re-initializes Kalman filter. The previous content is destroyed.\n    void init(int dynamParams, int measureParams, int controlParams=0, int type=CV_32F);\n\n    //! computes predicted state\n    CV_WRAP const Mat& predict(const Mat& control=Mat());\n    //! updates the predicted state from the measurement\n    CV_WRAP const Mat& correct(const Mat& measurement);\n\n    Mat statePre;           //!< predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k)\n    Mat statePost;          //!< corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))\n    Mat transitionMatrix;   //!< state transition matrix (A)\n    Mat controlMatrix;      //!< control matrix (B) (not used if there is no control)\n    Mat measurementMatrix;  //!< measurement matrix (H)\n    Mat processNoiseCov;    //!< process noise covariance matrix (Q)\n    Mat measurementNoiseCov;//!< measurement noise covariance matrix (R)\n    Mat errorCovPre;        //!< priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/\n    Mat gain;               //!< Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)\n    Mat errorCovPost;       //!< posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)\n\n    // temporary matrices\n    Mat temp1;\n    Mat temp2;\n    Mat temp3;\n    Mat temp4;\n    Mat temp5;\n};\n\nenum\n{\n    OPTFLOW_USE_INITIAL_FLOW = CV_LKFLOW_INITIAL_GUESSES,\n    OPTFLOW_LK_GET_MIN_EIGENVALS = CV_LKFLOW_GET_MIN_EIGENVALS,\n    OPTFLOW_FARNEBACK_GAUSSIAN = 256\n};\n\n//! constructs a pyramid which can be used as input for calcOpticalFlowPyrLK\nCV_EXPORTS_W int buildOpticalFlowPyramid(InputArray img, OutputArrayOfArrays pyramid,\n                                         Size winSize, int maxLevel, bool withDerivatives = true,\n                                         int pyrBorder = BORDER_REFLECT_101, int derivBorder = BORDER_CONSTANT,\n                                         bool tryReuseInputImage = true);\n\n//! computes sparse optical flow using multi-scale Lucas-Kanade algorithm\nCV_EXPORTS_W void calcOpticalFlowPyrLK( InputArray prevImg, InputArray nextImg,\n                           InputArray prevPts, CV_OUT InputOutputArray nextPts,\n                           OutputArray status, OutputArray err,\n                           Size winSize=Size(21,21), int maxLevel=3,\n                           TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01),\n                           int flags=0, double minEigThreshold=1e-4);\n\n//! computes dense optical flow using Farneback algorithm\nCV_EXPORTS_W void calcOpticalFlowFarneback( InputArray prev, InputArray next,\n                           CV_OUT InputOutputArray flow, double pyr_scale, int levels, int winsize,\n                           int iterations, int poly_n, double poly_sigma, int flags );\n\n//! estimates the best-fit Euqcidean, similarity, affine or perspective transformation\n// that maps one 2D point set to another or one image to another.\nCV_EXPORTS_W Mat estimateRigidTransform( InputArray src, InputArray dst,\n                                         bool fullAffine);\n\n//! computes dense optical flow using Simple Flow algorithm\nCV_EXPORTS_W void calcOpticalFlowSF(Mat& from,\n                                    Mat& to,\n                                    Mat& flow,\n                                    int layers,\n                                    int averaging_block_size,\n                                    int max_flow);\n\nCV_EXPORTS_W void calcOpticalFlowSF(Mat& from,\n                                    Mat& to,\n                                    Mat& flow,\n                                    int layers,\n                                    int averaging_block_size,\n                                    int max_flow,\n                                    double sigma_dist,\n                                    double sigma_color,\n                                    int postprocess_window,\n                                    double sigma_dist_fix,\n                                    double sigma_color_fix,\n                                    double occ_thr,\n                                    int upscale_averaging_radius,\n                                    double upscale_sigma_dist,\n                                    double upscale_sigma_color,\n                                    double speed_up_thr);\n\nclass CV_EXPORTS DenseOpticalFlow : public Algorithm\n{\npublic:\n    virtual void calc(InputArray I0, InputArray I1, InputOutputArray flow) = 0;\n    virtual void collectGarbage() = 0;\n};\n\n// Implementation of the Zach, Pock and Bischof Dual TV-L1 Optical Flow method\n//\n// see reference:\n//   [1] C. Zach, T. Pock and H. Bischof, \"A Duality Based Approach for Realtime TV-L1 Optical Flow\".\n//   [2] Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. \"TV-L1 Optical Flow Estimation\".\nCV_EXPORTS Ptr<DenseOpticalFlow> createOptFlow_DualTVL1();\n\n}\n\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/video/video.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEO_HPP__\n#define __OPENCV_VIDEO_HPP__\n\n#include \"opencv2/video/tracking.hpp\"\n#include \"opencv2/video/background_segm.hpp\"\n\n#ifdef __cplusplus\nnamespace cv\n{\n\nCV_EXPORTS bool initModule_video(void);\n\n}\n#endif\n\n#endif //__OPENCV_VIDEO_HPP__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/deblurring.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_DEBLURRING_HPP__\n#define __OPENCV_VIDEOSTAB_DEBLURRING_HPP__\n\n#include <vector>\n#include \"opencv2/core/core.hpp\"\n\nnamespace cv\n{\nnamespace videostab\n{\n\nCV_EXPORTS float calcBlurriness(const Mat &frame);\n\nclass CV_EXPORTS DeblurerBase\n{\npublic:\n    DeblurerBase() : radius_(0), frames_(0), motions_(0) {}\n\n    virtual ~DeblurerBase() {}\n\n    virtual void setRadius(int val) { radius_ = val; }\n    virtual int radius() const { return radius_; }\n\n    virtual void setFrames(const std::vector<Mat> &val) { frames_ = &val; }\n    virtual const std::vector<Mat>& frames() const { return *frames_; }\n\n    virtual void setMotions(const std::vector<Mat> &val) { motions_ = &val; }\n    virtual const std::vector<Mat>& motions() const { return *motions_; }\n\n    virtual void setBlurrinessRates(const std::vector<float> &val) { blurrinessRates_ = &val; }\n    virtual const std::vector<float>& blurrinessRates() const { return *blurrinessRates_; }\n\n    virtual void update() {}\n\n    virtual void deblur(int idx, Mat &frame) = 0;\n\nprotected:\n    int radius_;\n    const std::vector<Mat> *frames_;\n    const std::vector<Mat> *motions_;\n    const std::vector<float> *blurrinessRates_;\n};\n\nclass CV_EXPORTS NullDeblurer : public DeblurerBase\n{\npublic:\n    virtual void deblur(int /*idx*/, Mat &/*frame*/) {}\n};\n\nclass CV_EXPORTS WeightingDeblurer : public DeblurerBase\n{\npublic:\n    WeightingDeblurer();\n\n    void setSensitivity(float val) { sensitivity_ = val; }\n    float sensitivity() const { return sensitivity_; }\n\n    virtual void deblur(int idx, Mat &frame);\n\nprivate:\n    float sensitivity_;\n    Mat_<float> bSum_, gSum_, rSum_, wSum_;\n};\n\n} // namespace videostab\n} // namespace cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/fast_marching.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__\n#define __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__\n\n#include <cmath>\n#include <queue>\n#include <algorithm>\n#include \"opencv2/core/core.hpp\"\n\nnamespace cv\n{\nnamespace videostab\n{\n\n// See http://iwi.eldoc.ub.rug.nl/FILES/root/2004/JGraphToolsTelea/2004JGraphToolsTelea.pdf\nclass CV_EXPORTS FastMarchingMethod\n{\npublic:\n    FastMarchingMethod() : inf_(1e6f) {}\n\n    template <typename Inpaint>\n    Inpaint run(const Mat &mask, Inpaint inpaint);\n\n    Mat distanceMap() const { return dist_; }\n\nprivate:\n    enum { INSIDE = 0, BAND = 1, KNOWN = 255 };\n\n    struct DXY\n    {\n        float dist;\n        int x, y;\n\n        DXY() : dist(0), x(0), y(0) {}\n        DXY(float _dist, int _x, int _y) : dist(_dist), x(_x), y(_y) {}\n        bool operator <(const DXY &dxy) const { return dist < dxy.dist; }\n    };\n\n    float solve(int x1, int y1, int x2, int y2) const;\n    int& indexOf(const DXY &dxy) { return index_(dxy.y, dxy.x); }\n\n    void heapUp(int idx);\n    void heapDown(int idx);\n    void heapAdd(const DXY &dxy);\n    void heapRemoveMin();\n\n    float inf_;\n\n    cv::Mat_<uchar> flag_; // flag map\n    cv::Mat_<float> dist_; // distance map\n\n    cv::Mat_<int> index_; // index of point in the narrow band\n    std::vector<DXY> narrowBand_; // narrow band heap\n    int size_; // narrow band size\n};\n\n} // namespace videostab\n} // namespace cv\n\n#include \"fast_marching_inl.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/fast_marching_inl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_FAST_MARCHING_INL_HPP__\n#define __OPENCV_VIDEOSTAB_FAST_MARCHING_INL_HPP__\n\n#include \"opencv2/videostab/fast_marching.hpp\"\n\nnamespace cv\n{\nnamespace videostab\n{\n\ntemplate <typename Inpaint>\nInpaint FastMarchingMethod::run(const cv::Mat &mask, Inpaint inpaint)\n{\n    using namespace std;\n    using namespace cv;\n\n    CV_Assert(mask.type() == CV_8U);\n\n    static const int lut[4][2] = {{-1,0}, {0,-1}, {1,0}, {0,1}};\n\n    mask.copyTo(flag_);\n    flag_.create(mask.size());\n    dist_.create(mask.size());\n    index_.create(mask.size());\n    narrowBand_.clear();\n    size_ = 0;\n\n    // init\n    for (int y = 0; y < flag_.rows; ++y)\n    {\n        for (int x = 0; x < flag_.cols; ++x)\n        {\n            if (flag_(y,x) == KNOWN)\n                dist_(y,x) = 0.f;\n            else\n            {\n                int n = 0;\n                int nunknown = 0;\n\n                for (int i = 0; i < 4; ++i)\n                {\n                    int xn = x + lut[i][0];\n                    int yn = y + lut[i][1];\n\n                    if (xn >= 0 && xn < flag_.cols && yn >= 0 && yn < flag_.rows)\n                    {\n                        n++;\n                        if (flag_(yn,xn) != KNOWN)\n                            nunknown++;\n                    }\n                }\n\n                if (n>0 && nunknown == n)\n                {\n                    dist_(y,x) = inf_;\n                    flag_(y,x) = INSIDE;\n                }\n                else\n                {\n                    dist_(y,x) = 0.f;\n                    flag_(y,x) = BAND;\n                    inpaint(x, y);\n\n                    narrowBand_.push_back(DXY(0.f,x,y));\n                    index_(y,x) = size_++;\n                }\n            }\n        }\n    }\n\n    // make heap\n    for (int i = size_/2-1; i >= 0; --i)\n        heapDown(i);\n\n    // main cycle\n    while (size_ > 0)\n    {\n        int x = narrowBand_[0].x;\n        int y = narrowBand_[0].y;\n        heapRemoveMin();\n\n        flag_(y,x) = KNOWN;\n        for (int n = 0; n < 4; ++n)\n        {\n            int xn = x + lut[n][0];\n            int yn = y + lut[n][1];\n\n            if (xn >= 0 && xn < flag_.cols && yn >= 0 && yn < flag_.rows && flag_(yn,xn) != KNOWN)\n            {\n                dist_(yn,xn) = min(min(solve(xn-1, yn, xn, yn-1), solve(xn+1, yn, xn, yn-1)),\n                                   min(solve(xn-1, yn, xn, yn+1), solve(xn+1, yn, xn, yn+1)));\n\n                if (flag_(yn,xn) == INSIDE)\n                {\n                    flag_(yn,xn) = BAND;\n                    inpaint(xn, yn);\n                    heapAdd(DXY(dist_(yn,xn),xn,yn));\n                }\n                else\n                {\n                    int i = index_(yn,xn);\n                    if (dist_(yn,xn) < narrowBand_[i].dist)\n                    {\n                        narrowBand_[i].dist = dist_(yn,xn);\n                        heapUp(i);\n                    }\n                    // works better if it's commented out\n                    /*else if (dist(yn,xn) > narrowBand[i].dist)\n                    {\n                        narrowBand[i].dist = dist(yn,xn);\n                        heapDown(i);\n                    }*/\n                }\n            }\n        }\n    }\n\n    return inpaint;\n}\n\n} // namespace videostab\n} // namespace cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/frame_source.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__\n#define __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__\n\n#include <vector>\n#include <string>\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/highgui/highgui.hpp\"\n\nnamespace cv\n{\nnamespace videostab\n{\n\nclass CV_EXPORTS IFrameSource\n{\npublic:\n    virtual ~IFrameSource() {}\n    virtual void reset() = 0;\n    virtual Mat nextFrame() = 0;\n};\n\nclass CV_EXPORTS NullFrameSource : public IFrameSource\n{\npublic:\n    virtual void reset() {}\n    virtual Mat nextFrame() { return Mat(); }\n};\n\nclass CV_EXPORTS VideoFileSource : public IFrameSource\n{\npublic:\n    VideoFileSource(const std::string &path, bool volatileFrame = false);\n\n    virtual void reset();\n    virtual Mat nextFrame();\n\n    int frameCount() { return static_cast<int>(reader_.get(CV_CAP_PROP_FRAME_COUNT)); }\n    double fps() { return reader_.get(CV_CAP_PROP_FPS); }\n\nprivate:\n    std::string path_;\n    bool volatileFrame_;\n    VideoCapture reader_;\n};\n\n} // namespace videostab\n} // namespace cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/global_motion.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_GLOBAL_MOTION_HPP__\n#define __OPENCV_VIDEOSTAB_GLOBAL_MOTION_HPP__\n\n#include <vector>\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/features2d/features2d.hpp\"\n#include \"opencv2/videostab/optical_flow.hpp\"\n\nnamespace cv\n{\nnamespace videostab\n{\n\nenum MotionModel\n{\n    TRANSLATION = 0,\n    TRANSLATION_AND_SCALE = 1,\n    LINEAR_SIMILARITY = 2,\n    AFFINE = 3\n};\n\nCV_EXPORTS Mat estimateGlobalMotionLeastSquares(\n        const std::vector<Point2f> &points0, const std::vector<Point2f> &points1,\n        int model = AFFINE, float *rmse = 0);\n\nstruct CV_EXPORTS RansacParams\n{\n    int size; // subset size\n    float thresh; // max error to classify as inlier\n    float eps; // max outliers ratio\n    float prob; // probability of success\n\n    RansacParams(int _size, float _thresh, float _eps, float _prob)\n        : size(_size), thresh(_thresh), eps(_eps), prob(_prob) {}\n\n    static RansacParams translationMotionStd() { return RansacParams(2, 0.5f, 0.5f, 0.99f); }\n    static RansacParams translationAndScale2dMotionStd() { return RansacParams(3, 0.5f, 0.5f, 0.99f); }\n    static RansacParams linearSimilarityMotionStd() { return RansacParams(4, 0.5f, 0.5f, 0.99f); }\n    static RansacParams affine2dMotionStd() { return RansacParams(6, 0.5f, 0.5f, 0.99f); }\n};\n\nCV_EXPORTS Mat estimateGlobalMotionRobust(\n        const std::vector<Point2f> &points0, const std::vector<Point2f> &points1,\n        int model = AFFINE, const RansacParams &params = RansacParams::affine2dMotionStd(),\n        float *rmse = 0, int *ninliers = 0);\n\nclass CV_EXPORTS IGlobalMotionEstimator\n{\npublic:\n    virtual ~IGlobalMotionEstimator() {}\n    virtual Mat estimate(const Mat &frame0, const Mat &frame1) = 0;\n};\n\nclass CV_EXPORTS PyrLkRobustMotionEstimator : public IGlobalMotionEstimator\n{\npublic:\n    PyrLkRobustMotionEstimator();\n\n    void setDetector(Ptr<FeatureDetector> val) { detector_ = val; }\n    Ptr<FeatureDetector> detector() const { return detector_; }\n\n    void setOptFlowEstimator(Ptr<ISparseOptFlowEstimator> val) { optFlowEstimator_ = val; }\n    Ptr<ISparseOptFlowEstimator> optFlowEstimator() const { return optFlowEstimator_; }\n\n    void setMotionModel(MotionModel val) { motionModel_ = val; }\n    MotionModel motionModel() const { return motionModel_; }\n\n    void setRansacParams(const RansacParams &val) { ransacParams_ = val; }\n    RansacParams ransacParams() const { return ransacParams_; }\n\n    void setMaxRmse(float val) { maxRmse_ = val; }\n    float maxRmse() const { return maxRmse_; }\n\n    void setMinInlierRatio(float val) { minInlierRatio_ = val; }\n    float minInlierRatio() const { return minInlierRatio_; }\n\n    virtual Mat estimate(const Mat &frame0, const Mat &frame1);\n\nprivate:\n    Ptr<FeatureDetector> detector_;\n    Ptr<ISparseOptFlowEstimator> optFlowEstimator_;\n    MotionModel motionModel_;\n    RansacParams ransacParams_;\n    std::vector<uchar> status_;\n    std::vector<KeyPoint> keypointsPrev_;\n    std::vector<Point2f> pointsPrev_, points_;\n    std::vector<Point2f> pointsPrevGood_, pointsGood_;\n    float maxRmse_;\n    float minInlierRatio_;\n};\n\nCV_EXPORTS Mat getMotion(int from, int to, const Mat *motions, int size);\n\nCV_EXPORTS Mat getMotion(int from, int to, const std::vector<Mat> &motions);\n\n} // namespace videostab\n} // namespace cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/inpainting.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_INPAINTINT_HPP__\n#define __OPENCV_VIDEOSTAB_INPAINTINT_HPP__\n\n#include <vector>\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/videostab/optical_flow.hpp\"\n#include \"opencv2/videostab/fast_marching.hpp\"\n#include \"opencv2/photo/photo.hpp\"\n\nnamespace cv\n{\nnamespace videostab\n{\n\nclass CV_EXPORTS InpainterBase\n{\npublic:\n    InpainterBase()\n        : radius_(0), frames_(0), motions_(0),\n          stabilizedFrames_(0), stabilizationMotions_(0) {}\n\n    virtual ~InpainterBase() {}\n\n    virtual void setRadius(int val) { radius_ = val; }\n    virtual int radius() const { return radius_; }\n\n    virtual void setFrames(const std::vector<Mat> &val) { frames_ = &val; }\n    virtual const std::vector<Mat>& frames() const { return *frames_; }\n\n    virtual void setMotions(const std::vector<Mat> &val) { motions_ = &val; }\n    virtual const std::vector<Mat>& motions() const { return *motions_; }\n\n    virtual void setStabilizedFrames(const std::vector<Mat> &val) { stabilizedFrames_ = &val; }\n    virtual const std::vector<Mat>& stabilizedFrames() const { return *stabilizedFrames_; }\n\n    virtual void setStabilizationMotions(const std::vector<Mat> &val) { stabilizationMotions_ = &val; }\n    virtual const std::vector<Mat>& stabilizationMotions() const { return *stabilizationMotions_; }\n\n    virtual void update() {}\n\n    virtual void inpaint(int idx, Mat &frame, Mat &mask) = 0;\n\nprotected:\n    int radius_;\n    const std::vector<Mat> *frames_;\n    const std::vector<Mat> *motions_;\n    const std::vector<Mat> *stabilizedFrames_;\n    const std::vector<Mat> *stabilizationMotions_;\n};\n\nclass CV_EXPORTS NullInpainter : public InpainterBase\n{\npublic:\n    virtual void inpaint(int /*idx*/, Mat &/*frame*/, Mat &/*mask*/) {}\n};\n\nclass CV_EXPORTS InpaintingPipeline : public InpainterBase\n{\npublic:\n    void pushBack(Ptr<InpainterBase> inpainter) { inpainters_.push_back(inpainter); }\n    bool empty() const { return inpainters_.empty(); }\n\n    virtual void setRadius(int val);\n    virtual void setFrames(const std::vector<Mat> &val);\n    virtual void setMotions(const std::vector<Mat> &val);\n    virtual void setStabilizedFrames(const std::vector<Mat> &val);\n    virtual void setStabilizationMotions(const std::vector<Mat> &val);\n\n    virtual void update();\n\n    virtual void inpaint(int idx, Mat &frame, Mat &mask);\n\nprivate:\n    std::vector<Ptr<InpainterBase> > inpainters_;\n};\n\nclass CV_EXPORTS ConsistentMosaicInpainter : public InpainterBase\n{\npublic:\n    ConsistentMosaicInpainter();\n\n    void setStdevThresh(float val) { stdevThresh_ = val; }\n    float stdevThresh() const { return stdevThresh_; }\n\n    virtual void inpaint(int idx, Mat &frame, Mat &mask);\n\nprivate:\n    float stdevThresh_;\n};\n\nclass CV_EXPORTS MotionInpainter : public InpainterBase\n{\npublic:\n    MotionInpainter();\n\n    void setOptFlowEstimator(Ptr<IDenseOptFlowEstimator> val) { optFlowEstimator_ = val; }\n    Ptr<IDenseOptFlowEstimator> optFlowEstimator() const { return optFlowEstimator_; }\n\n    void setFlowErrorThreshold(float val) { flowErrorThreshold_ = val; }\n    float flowErrorThreshold() const { return flowErrorThreshold_; }\n\n    void setDistThreshold(float val) { distThresh_ = val; }\n    float distThresh() const { return distThresh_; }\n\n    void setBorderMode(int val) { borderMode_ = val; }\n    int borderMode() const { return borderMode_; }\n\n    virtual void inpaint(int idx, Mat &frame, Mat &mask);\n\nprivate:\n    FastMarchingMethod fmm_;\n    Ptr<IDenseOptFlowEstimator> optFlowEstimator_;\n    float flowErrorThreshold_;\n    float distThresh_;\n    int borderMode_;\n\n    Mat frame1_, transformedFrame1_;\n    Mat_<uchar> grayFrame_, transformedGrayFrame1_;\n    Mat_<uchar> mask1_, transformedMask1_;\n    Mat_<float> flowX_, flowY_, flowErrors_;\n    Mat_<uchar> flowMask_;\n};\n\nclass CV_EXPORTS ColorAverageInpainter : public InpainterBase\n{\npublic:\n    virtual void inpaint(int idx, Mat &frame, Mat &mask);\n\nprivate:\n    FastMarchingMethod fmm_;\n};\n\nclass CV_EXPORTS ColorInpainter : public InpainterBase\n{\npublic:\n    ColorInpainter(int method = INPAINT_TELEA, double _radius = 2.)\n        : method_(method), radius_(_radius) {}\n\n    virtual void inpaint(int idx, Mat &frame, Mat &mask);\n\nprivate:\n    int method_;\n    double radius_;\n    Mat invMask_;\n};\n\nCV_EXPORTS void calcFlowMask(\n        const Mat &flowX, const Mat &flowY, const Mat &errors, float maxError,\n        const Mat &mask0, const Mat &mask1, Mat &flowMask);\n\nCV_EXPORTS void completeFrameAccordingToFlow(\n        const Mat &flowMask, const Mat &flowX, const Mat &flowY, const Mat &frame1, const Mat &mask1,\n        float distThresh, Mat& frame0, Mat &mask0);\n\n} // namespace videostab\n} // namespace cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/log.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_LOG_HPP__\n#define __OPENCV_VIDEOSTAB_LOG_HPP__\n\n#include \"opencv2/core/core.hpp\"\n\nnamespace cv\n{\nnamespace videostab\n{\n\nclass CV_EXPORTS ILog\n{\npublic:\n    virtual ~ILog() {}\n    virtual void print(const char *format, ...) = 0;\n};\n\nclass CV_EXPORTS NullLog : public ILog\n{\npublic:\n    virtual void print(const char * /*format*/, ...) {}\n};\n\nclass CV_EXPORTS LogToStdout : public ILog\n{\npublic:\n    virtual void print(const char *format, ...);\n};\n\n} // namespace videostab\n} // namespace cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/motion_stabilizing.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__\n#define __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__\n\n#include <vector>\n#include \"opencv2/core/core.hpp\"\n\nnamespace cv\n{\nnamespace videostab\n{\n\nclass CV_EXPORTS IMotionStabilizer\n{\npublic:\n    virtual void stabilize(const Mat *motions, int size, Mat *stabilizationMotions) const = 0;\n\n#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY\n    virtual ~IMotionStabilizer() {}\n#endif\n};\n\nclass CV_EXPORTS MotionFilterBase : public IMotionStabilizer\n{\npublic:\n    MotionFilterBase() : radius_(0) {}\n    virtual ~MotionFilterBase() {}\n\n    virtual void setRadius(int val) { radius_ = val; }\n    virtual int radius() const { return radius_; }\n\n    virtual void update() {}\n\n    virtual Mat stabilize(int index, const Mat *motions, int size) const = 0;\n    virtual void stabilize(const Mat *motions, int size, Mat *stabilizationMotions) const;\n\nprotected:\n    int radius_;\n};\n\nclass CV_EXPORTS GaussianMotionFilter : public MotionFilterBase\n{\npublic:\n    GaussianMotionFilter() : stdev_(-1.f) {}\n\n    void setStdev(float val) { stdev_ = val; }\n    float stdev() const { return stdev_; }\n\n    virtual void update();\n\n    virtual Mat stabilize(int index, const Mat *motions, int size) const;\n\nprivate:\n    float stdev_;\n    std::vector<float> weight_;\n};\n\nCV_EXPORTS Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio);\n\nCV_EXPORTS float estimateOptimalTrimRatio(const Mat &M, Size size);\n\n} // namespace videostab\n} // namespace\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/optical_flow.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_OPTICAL_FLOW_HPP__\n#define __OPENCV_VIDEOSTAB_OPTICAL_FLOW_HPP__\n\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/opencv_modules.hpp\"\n\n#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)\n#  include \"opencv2/gpu/gpu.hpp\"\n#endif\n\nnamespace cv\n{\nnamespace videostab\n{\n\nclass CV_EXPORTS ISparseOptFlowEstimator\n{\npublic:\n    virtual ~ISparseOptFlowEstimator() {}\n    virtual void run(\n            InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1,\n            OutputArray status, OutputArray errors) = 0;\n};\n\nclass CV_EXPORTS IDenseOptFlowEstimator\n{\npublic:\n    virtual ~IDenseOptFlowEstimator() {}\n    virtual void run(\n            InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY,\n            OutputArray errors) = 0;\n};\n\nclass CV_EXPORTS PyrLkOptFlowEstimatorBase\n{\npublic:\n    PyrLkOptFlowEstimatorBase() { setWinSize(Size(21, 21)); setMaxLevel(3); }\n\n    void setWinSize(Size val) { winSize_ = val; }\n    Size winSize() const { return winSize_; }\n\n    void setMaxLevel(int val) { maxLevel_ = val; }\n    int maxLevel() const { return maxLevel_; }\n\nprotected:\n    Size winSize_;\n    int maxLevel_;\n};\n\nclass CV_EXPORTS SparsePyrLkOptFlowEstimator\n        : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator\n{\npublic:\n    virtual void run(\n            InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1,\n            OutputArray status, OutputArray errors);\n};\n\n#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)\nclass CV_EXPORTS DensePyrLkOptFlowEstimatorGpu\n        : public PyrLkOptFlowEstimatorBase, public IDenseOptFlowEstimator\n{\npublic:\n    DensePyrLkOptFlowEstimatorGpu();\n\n    virtual void run(\n            InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY,\n            OutputArray errors);\nprivate:\n    gpu::PyrLKOpticalFlow optFlowEstimator_;\n    gpu::GpuMat frame0_, frame1_, flowX_, flowY_, errors_;\n};\n#endif\n\n} // namespace videostab\n} // namespace cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/stabilizer.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_STABILIZER_HPP__\n#define __OPENCV_VIDEOSTAB_STABILIZER_HPP__\n\n#include <vector>\n#include \"opencv2/core/core.hpp\"\n#include \"opencv2/imgproc/imgproc.hpp\"\n#include \"opencv2/videostab/global_motion.hpp\"\n#include \"opencv2/videostab/motion_stabilizing.hpp\"\n#include \"opencv2/videostab/frame_source.hpp\"\n#include \"opencv2/videostab/log.hpp\"\n#include \"opencv2/videostab/inpainting.hpp\"\n#include \"opencv2/videostab/deblurring.hpp\"\n\nnamespace cv\n{\nnamespace videostab\n{\n\nclass CV_EXPORTS StabilizerBase\n{\npublic:\n    virtual ~StabilizerBase() {}\n\n    void setLog(Ptr<ILog> _log) { log_ = _log; }\n    Ptr<ILog> log() const { return log_; }\n\n    void setRadius(int val) { radius_ = val; }\n    int radius() const { return radius_; }\n\n    void setFrameSource(Ptr<IFrameSource> val) { frameSource_ = val; }\n    Ptr<IFrameSource> frameSource() const { return frameSource_; }\n\n    void setMotionEstimator(Ptr<IGlobalMotionEstimator> val) { motionEstimator_ = val; }\n    Ptr<IGlobalMotionEstimator> motionEstimator() const { return motionEstimator_; }\n\n    void setDeblurer(Ptr<DeblurerBase> val) { deblurer_ = val; }\n    Ptr<DeblurerBase> deblurrer() const { return deblurer_; }\n\n    void setTrimRatio(float val) { trimRatio_ = val; }\n    float trimRatio() const { return trimRatio_; }\n\n    void setCorrectionForInclusion(bool val) { doCorrectionForInclusion_ = val; }\n    bool doCorrectionForInclusion() const { return doCorrectionForInclusion_; }\n\n    void setBorderMode(int val) { borderMode_ = val; }\n    int borderMode() const { return borderMode_; }\n\n    void setInpainter(Ptr<InpainterBase> val) { inpainter_ = val; }\n    Ptr<InpainterBase> inpainter() const { return inpainter_; }\n\nprotected:\n    StabilizerBase();\n\n    void setUp(int cacheSize, const Mat &frame);\n    Mat nextStabilizedFrame();\n    bool doOneIteration();\n    void stabilizeFrame(const Mat &stabilizationMotion);\n\n    virtual void setUp(Mat &firstFrame) = 0;\n    virtual void stabilizeFrame() = 0;\n    virtual void estimateMotion() = 0;\n\n    Ptr<ILog> log_;\n    Ptr<IFrameSource> frameSource_;\n    Ptr<IGlobalMotionEstimator> motionEstimator_;\n    Ptr<DeblurerBase> deblurer_;\n    Ptr<InpainterBase> inpainter_;\n    int radius_;\n    float trimRatio_;\n    bool doCorrectionForInclusion_;\n    int borderMode_;\n\n    Size frameSize_;\n    Mat frameMask_;\n    int curPos_;\n    int curStabilizedPos_;\n    bool doDeblurring_;\n    Mat preProcessedFrame_;\n    bool doInpainting_;\n    Mat inpaintingMask_;\n    std::vector<Mat> frames_;\n    std::vector<Mat> motions_; // motions_[i] is the motion from i-th to i+1-th frame\n    std::vector<float> blurrinessRates_;\n    std::vector<Mat> stabilizedFrames_;\n    std::vector<Mat> stabilizedMasks_;\n    std::vector<Mat> stabilizationMotions_;\n};\n\nclass CV_EXPORTS OnePassStabilizer : public StabilizerBase, public IFrameSource\n{\npublic:\n    OnePassStabilizer();\n\n    void setMotionFilter(Ptr<MotionFilterBase> val) { motionFilter_ = val; }\n    Ptr<MotionFilterBase> motionFilter() const { return motionFilter_; }\n\n    virtual void reset() { resetImpl(); }\n    virtual Mat nextFrame() { return nextStabilizedFrame(); }\n\nprivate:\n    void resetImpl();\n\n    virtual void setUp(Mat &firstFrame);\n    virtual void estimateMotion();\n    virtual void stabilizeFrame();\n\n    Ptr<MotionFilterBase> motionFilter_;\n};\n\nclass CV_EXPORTS TwoPassStabilizer : public StabilizerBase, public IFrameSource\n{\npublic:\n    TwoPassStabilizer();\n\n    void setMotionStabilizer(Ptr<IMotionStabilizer> val) { motionStabilizer_ = val; }\n    Ptr<IMotionStabilizer> motionStabilizer() const { return motionStabilizer_; }\n\n    void setEstimateTrimRatio(bool val) { mustEstTrimRatio_ = val; }\n    bool mustEstimateTrimaRatio() const { return mustEstTrimRatio_; }\n\n    virtual void reset() { resetImpl(); }\n    virtual Mat nextFrame();\n\n    // available after pre-pass, before it's empty\n    std::vector<Mat> motions() const;\n\nprivate:\n    void resetImpl();\n    void runPrePassIfNecessary();\n\n    virtual void setUp(Mat &firstFrame);\n    virtual void estimateMotion() { /* do nothing as motion was estimation in pre-pass */ }\n    virtual void stabilizeFrame();\n\n    Ptr<IMotionStabilizer> motionStabilizer_;\n    bool mustEstTrimRatio_;\n\n    int frameCount_;\n    bool isPrePassDone_;\n};\n\n} // namespace videostab\n} // namespace cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/include/opencv2/videostab/videostab.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef __OPENCV_VIDEOSTAB_HPP__\n#define __OPENCV_VIDEOSTAB_HPP__\n\n#include \"opencv2/videostab/stabilizer.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/lib/pkgconfig/opencv.pc",
    "content": "# Package Information for pkg-config\n\nprefix=/root/git.code.oa.com/yt-industry-ai/opencv-ytfork\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir_old=${prefix}/include/opencv\nincludedir_new=${prefix}/include\n\nName: OpenCV\nDescription: Open Source Computer Vision Library\nVersion: 2.4.12\nLibs: -L${exec_prefix}/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lrt -lpthread -lm -ldl\nCflags: -I${includedir_old} -I${includedir_new}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv2/version.txt",
    "content": "v2.4.12 with libjpeg-turbo\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/.gitignore",
    "content": "opencv-4.3.0\nlibjpeg-turbo-2.0.5\nbuild\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/README.md",
    "content": "```\n  wget https://github.com/opencv/opencv/archive/4.5.3.tar.gz -O opencv-4.5.3.tar.gz\n  wget https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.1.1.tar.gz -O libjpeg-turbo-2.1.1.tar.gz\n\n  // build\n  tar -zxvf libjpeg-turbo-2.1.1.tar.gz\n  tar -zxvf opencv-4.5.3.tar.gz\n  sed -i 'N;2 a add_compile_options(-fPIC)' libjpeg-turbo-2.1.1/CMakeLists.txt\n\n  PREFIX=`pwd`\n  mkdir build; cd build\n  cmake ../libjpeg-turbo-2.1.1 -DCMAKE_INSTALL_PREFIX=$PREFIX/turbo -DCMAKE_BUILD_TYPE=RELEASE\n  make -j8 && make install\n  rm -rf *\n\n  cmake ../opencv-4.5.3 -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON -DBUILD_PNG=ON -DBUILD_JASPER=ON -DBUILD_TIFF=ON -DWITH_FFMPEG=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DBUILD_JPEG=OFF -DBUILD_OPENEXR=ON -DWITH_CUDA=OFF -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_JPEG=ON -DJPEG_INCLUDE_DIR=$PREFIX/turbo/include -DJPEG_LIBRARY=$PREFIX/turbo/lib64/libjpeg.a\n  make -j8 && make install\n```\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/calib3d/calib3d.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/calib3d.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/calib3d/calib3d_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CALIB3D_C_H\n#define OPENCV_CALIB3D_C_H\n\n#include \"opencv2/core/types_c.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* Calculates fundamental matrix given a set of corresponding points */\n#define CV_FM_7POINT 1\n#define CV_FM_8POINT 2\n\n#define CV_LMEDS 4\n#define CV_RANSAC 8\n\n#define CV_FM_LMEDS_ONLY  CV_LMEDS\n#define CV_FM_RANSAC_ONLY CV_RANSAC\n#define CV_FM_LMEDS CV_LMEDS\n#define CV_FM_RANSAC CV_RANSAC\n\nenum\n{\n    CV_ITERATIVE = 0,\n    CV_EPNP = 1, // F.Moreno-Noguer, V.Lepetit and P.Fua \"EPnP: Efficient Perspective-n-Point Camera Pose Estimation\"\n    CV_P3P = 2, // X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang; \"Complete Solution Classification for the Perspective-Three-Point Problem\"\n    CV_DLS = 3 // Joel A. Hesch and Stergios I. Roumeliotis. \"A Direct Least-Squares (DLS) Method for PnP\"\n};\n\n#define CV_CALIB_CB_ADAPTIVE_THRESH  1\n#define CV_CALIB_CB_NORMALIZE_IMAGE  2\n#define CV_CALIB_CB_FILTER_QUADS     4\n#define CV_CALIB_CB_FAST_CHECK       8\n\n#define CV_CALIB_USE_INTRINSIC_GUESS  1\n#define CV_CALIB_FIX_ASPECT_RATIO     2\n#define CV_CALIB_FIX_PRINCIPAL_POINT  4\n#define CV_CALIB_ZERO_TANGENT_DIST    8\n#define CV_CALIB_FIX_FOCAL_LENGTH 16\n#define CV_CALIB_FIX_K1  32\n#define CV_CALIB_FIX_K2  64\n#define CV_CALIB_FIX_K3  128\n#define CV_CALIB_FIX_K4  2048\n#define CV_CALIB_FIX_K5  4096\n#define CV_CALIB_FIX_K6  8192\n#define CV_CALIB_RATIONAL_MODEL 16384\n#define CV_CALIB_THIN_PRISM_MODEL 32768\n#define CV_CALIB_FIX_S1_S2_S3_S4  65536\n#define CV_CALIB_TILTED_MODEL  262144\n#define CV_CALIB_FIX_TAUX_TAUY  524288\n#define CV_CALIB_FIX_TANGENT_DIST 2097152\n\n#define CV_CALIB_NINTRINSIC 18\n\n#define CV_CALIB_FIX_INTRINSIC  256\n#define CV_CALIB_SAME_FOCAL_LENGTH 512\n\n#define CV_CALIB_ZERO_DISPARITY 1024\n\n/* stereo correspondence parameters and functions */\n#define CV_STEREO_BM_NORMALIZED_RESPONSE  0\n#define CV_STEREO_BM_XSOBEL               1\n\n#ifdef __cplusplus\n} // extern \"C\"\n\n//////////////////////////////////////////////////////////////////////////////////////////\nclass CV_EXPORTS CvLevMarq\n{\npublic:\n    CvLevMarq();\n    CvLevMarq( int nparams, int nerrs, CvTermCriteria criteria=\n              cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON),\n              bool completeSymmFlag=false );\n    ~CvLevMarq();\n    void init( int nparams, int nerrs, CvTermCriteria criteria=\n              cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON),\n              bool completeSymmFlag=false );\n    bool update( const CvMat*& param, CvMat*& J, CvMat*& err );\n    bool updateAlt( const CvMat*& param, CvMat*& JtJ, CvMat*& JtErr, double*& errNorm );\n\n    void clear();\n    void step();\n    enum { DONE=0, STARTED=1, CALC_J=2, CHECK_ERR=3 };\n\n    cv::Ptr<CvMat> mask;\n    cv::Ptr<CvMat> prevParam;\n    cv::Ptr<CvMat> param;\n    cv::Ptr<CvMat> J;\n    cv::Ptr<CvMat> err;\n    cv::Ptr<CvMat> JtJ;\n    cv::Ptr<CvMat> JtJN;\n    cv::Ptr<CvMat> JtErr;\n    cv::Ptr<CvMat> JtJV;\n    cv::Ptr<CvMat> JtJW;\n    double prevErrNorm, errNorm;\n    int lambdaLg10;\n    CvTermCriteria criteria;\n    int state;\n    int iters;\n    bool completeSymmFlag;\n    int solveMethod;\n};\n\n#endif\n\n#endif /* OPENCV_CALIB3D_C_H */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/calib3d.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CALIB3D_HPP\n#define OPENCV_CALIB3D_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/features2d.hpp\"\n#include \"opencv2/core/affine.hpp\"\n\n/**\n  @defgroup calib3d Camera Calibration and 3D Reconstruction\n\nThe functions in this section use a so-called pinhole camera model. The view of a scene\nis obtained by projecting a scene's 3D point \\f$P_w\\f$ into the image plane using a perspective\ntransformation which forms the corresponding pixel \\f$p\\f$. Both \\f$P_w\\f$ and \\f$p\\f$ are\nrepresented in homogeneous coordinates, i.e. as 3D and 2D homogeneous vector respectively. You will\nfind a brief introduction to projective geometry, homogeneous vectors and homogeneous\ntransformations at the end of this section's introduction. For more succinct notation, we often drop\nthe 'homogeneous' and say vector instead of homogeneous vector.\n\nThe distortion-free projective transformation given by a  pinhole camera model is shown below.\n\n\\f[s \\; p = A \\begin{bmatrix} R|t \\end{bmatrix} P_w,\\f]\n\nwhere \\f$P_w\\f$ is a 3D point expressed with respect to the world coordinate system,\n\\f$p\\f$ is a 2D pixel in the image plane, \\f$A\\f$ is the camera intrinsic matrix,\n\\f$R\\f$ and \\f$t\\f$ are the rotation and translation that describe the change of coordinates from\nworld to camera coordinate systems (or camera frame) and \\f$s\\f$ is the projective transformation's\narbitrary scaling and not part of the camera model.\n\nThe camera intrinsic matrix \\f$A\\f$ (notation used as in @cite Zhang2000 and also generally notated\nas \\f$K\\f$) projects 3D points given in the camera coordinate system to 2D pixel coordinates, i.e.\n\n\\f[p = A P_c.\\f]\n\nThe camera intrinsic matrix \\f$A\\f$ is composed of the focal lengths \\f$f_x\\f$ and \\f$f_y\\f$, which are\nexpressed in pixel units, and the principal point \\f$(c_x, c_y)\\f$, that is usually close to the\nimage center:\n\n\\f[A = \\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1},\\f]\n\nand thus\n\n\\f[s \\vecthree{u}{v}{1} = \\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1} \\vecthree{X_c}{Y_c}{Z_c}.\\f]\n\nThe matrix of intrinsic parameters does not depend on the scene viewed. So, once estimated, it can\nbe re-used as long as the focal length is fixed (in case of a zoom lens). Thus, if an image from the\ncamera is scaled by a factor, all of these parameters need to be scaled (multiplied/divided,\nrespectively) by the same factor.\n\nThe joint rotation-translation matrix \\f$[R|t]\\f$ is the matrix product of a projective\ntransformation and a homogeneous transformation. The 3-by-4 projective transformation maps 3D points\nrepresented in camera coordinates to 2D points in the image plane and represented in normalized\ncamera coordinates \\f$x' = X_c / Z_c\\f$ and \\f$y' = Y_c / Z_c\\f$:\n\n\\f[Z_c \\begin{bmatrix}\nx' \\\\\ny' \\\\\n1\n\\end{bmatrix} = \\begin{bmatrix}\n1 & 0 & 0 & 0 \\\\\n0 & 1 & 0 & 0 \\\\\n0 & 0 & 1 & 0\n\\end{bmatrix}\n\\begin{bmatrix}\nX_c \\\\\nY_c \\\\\nZ_c \\\\\n1\n\\end{bmatrix}.\\f]\n\nThe homogeneous transformation is encoded by the extrinsic parameters \\f$R\\f$ and \\f$t\\f$ and\nrepresents the change of basis from world coordinate system \\f$w\\f$ to the camera coordinate sytem\n\\f$c\\f$. Thus, given the representation of the point \\f$P\\f$ in world coordinates, \\f$P_w\\f$, we\nobtain \\f$P\\f$'s representation in the camera coordinate system, \\f$P_c\\f$, by\n\n\\f[P_c = \\begin{bmatrix}\nR & t \\\\\n0 & 1\n\\end{bmatrix} P_w,\\f]\n\nThis homogeneous transformation is composed out of \\f$R\\f$, a 3-by-3 rotation matrix, and \\f$t\\f$, a\n3-by-1 translation vector:\n\n\\f[\\begin{bmatrix}\nR & t \\\\\n0 & 1\n\\end{bmatrix} = \\begin{bmatrix}\nr_{11} & r_{12} & r_{13} & t_x \\\\\nr_{21} & r_{22} & r_{23} & t_y \\\\\nr_{31} & r_{32} & r_{33} & t_z \\\\\n0 & 0 & 0 & 1\n\\end{bmatrix},\n\\f]\n\nand therefore\n\n\\f[\\begin{bmatrix}\nX_c \\\\\nY_c \\\\\nZ_c \\\\\n1\n\\end{bmatrix} = \\begin{bmatrix}\nr_{11} & r_{12} & r_{13} & t_x \\\\\nr_{21} & r_{22} & r_{23} & t_y \\\\\nr_{31} & r_{32} & r_{33} & t_z \\\\\n0 & 0 & 0 & 1\n\\end{bmatrix}\n\\begin{bmatrix}\nX_w \\\\\nY_w \\\\\nZ_w \\\\\n1\n\\end{bmatrix}.\\f]\n\nCombining the projective transformation and the homogeneous transformation, we obtain the projective\ntransformation that maps 3D points in world coordinates into 2D points in the image plane and in\nnormalized camera coordinates:\n\n\\f[Z_c \\begin{bmatrix}\nx' \\\\\ny' \\\\\n1\n\\end{bmatrix} = \\begin{bmatrix} R|t \\end{bmatrix} \\begin{bmatrix}\nX_w \\\\\nY_w \\\\\nZ_w \\\\\n1\n\\end{bmatrix} = \\begin{bmatrix}\nr_{11} & r_{12} & r_{13} & t_x \\\\\nr_{21} & r_{22} & r_{23} & t_y \\\\\nr_{31} & r_{32} & r_{33} & t_z\n\\end{bmatrix}\n\\begin{bmatrix}\nX_w \\\\\nY_w \\\\\nZ_w \\\\\n1\n\\end{bmatrix},\\f]\n\nwith \\f$x' = X_c / Z_c\\f$ and \\f$y' = Y_c / Z_c\\f$. Putting the equations for instrincs and extrinsics together, we can write out\n\\f$s \\; p = A \\begin{bmatrix} R|t \\end{bmatrix} P_w\\f$ as\n\n\\f[s \\vecthree{u}{v}{1} = \\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\n\\begin{bmatrix}\nr_{11} & r_{12} & r_{13} & t_x \\\\\nr_{21} & r_{22} & r_{23} & t_y \\\\\nr_{31} & r_{32} & r_{33} & t_z\n\\end{bmatrix}\n\\begin{bmatrix}\nX_w \\\\\nY_w \\\\\nZ_w \\\\\n1\n\\end{bmatrix}.\\f]\n\nIf \\f$Z_c \\ne 0\\f$, the transformation above is equivalent to the following,\n\n\\f[\\begin{bmatrix}\nu \\\\\nv\n\\end{bmatrix} = \\begin{bmatrix}\nf_x X_c/Z_c + c_x \\\\\nf_y Y_c/Z_c + c_y\n\\end{bmatrix}\\f]\n\nwith\n\n\\f[\\vecthree{X_c}{Y_c}{Z_c} = \\begin{bmatrix}\nR|t\n\\end{bmatrix} \\begin{bmatrix}\nX_w \\\\\nY_w \\\\\nZ_w \\\\\n1\n\\end{bmatrix}.\\f]\n\nThe following figure illustrates the pinhole camera model.\n\n![Pinhole camera model](pics/pinhole_camera_model.png)\n\nReal lenses usually have some distortion, mostly radial distortion, and slight tangential distortion.\nSo, the above model is extended as:\n\n\\f[\\begin{bmatrix}\nu \\\\\nv\n\\end{bmatrix} = \\begin{bmatrix}\nf_x x'' + c_x \\\\\nf_y y'' + c_y\n\\end{bmatrix}\\f]\n\nwhere\n\n\\f[\\begin{bmatrix}\nx'' \\\\\ny''\n\\end{bmatrix} = \\begin{bmatrix}\nx' \\frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + 2 p_1 x' y' + p_2(r^2 + 2 x'^2) + s_1 r^2 + s_2 r^4 \\\\\ny' \\frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\\\\n\\end{bmatrix}\\f]\n\nwith\n\n\\f[r^2 = x'^2 + y'^2\\f]\n\nand\n\n\\f[\\begin{bmatrix}\nx'\\\\\ny'\n\\end{bmatrix} = \\begin{bmatrix}\nX_c/Z_c \\\\\nY_c/Z_c\n\\end{bmatrix},\\f]\n\nif \\f$Z_c \\ne 0\\f$.\n\nThe distortion parameters are the radial coefficients \\f$k_1\\f$, \\f$k_2\\f$, \\f$k_3\\f$, \\f$k_4\\f$, \\f$k_5\\f$, and \\f$k_6\\f$\n,\\f$p_1\\f$ and \\f$p_2\\f$ are the tangential distortion coefficients, and \\f$s_1\\f$, \\f$s_2\\f$, \\f$s_3\\f$, and \\f$s_4\\f$,\nare the thin prism distortion coefficients. Higher-order coefficients are not considered in OpenCV.\n\nThe next figures show two common types of radial distortion: barrel distortion\n(\\f$ 1 + k_1 r^2 + k_2 r^4 + k_3 r^6 \\f$ monotonically decreasing)\nand pincushion distortion (\\f$ 1 + k_1 r^2 + k_2 r^4 + k_3 r^6 \\f$ monotonically increasing).\nRadial distortion is always monotonic for real lenses,\nand if the estimator produces a non-monotonic result,\nthis should be considered a calibration failure.\nMore generally, radial distortion must be monotonic and the distortion function must be bijective.\nA failed estimation result may look deceptively good near the image center\nbut will work poorly in e.g. AR/SFM applications.\nThe optimization method used in OpenCV camera calibration does not include these constraints as\nthe framework does not support the required integer programming and polynomial inequalities.\nSee [issue #15992](https://github.com/opencv/opencv/issues/15992) for additional information.\n\n![](pics/distortion_examples.png)\n![](pics/distortion_examples2.png)\n\nIn some cases, the image sensor may be tilted in order to focus an oblique plane in front of the\ncamera (Scheimpflug principle). This can be useful for particle image velocimetry (PIV) or\ntriangulation with a laser fan. The tilt causes a perspective distortion of \\f$x''\\f$ and\n\\f$y''\\f$. This distortion can be modeled in the following way, see e.g. @cite Louhichi07.\n\n\\f[\\begin{bmatrix}\nu \\\\\nv\n\\end{bmatrix} = \\begin{bmatrix}\nf_x x''' + c_x \\\\\nf_y y''' + c_y\n\\end{bmatrix},\\f]\n\nwhere\n\n\\f[s\\vecthree{x'''}{y'''}{1} =\n\\vecthreethree{R_{33}(\\tau_x, \\tau_y)}{0}{-R_{13}(\\tau_x, \\tau_y)}\n{0}{R_{33}(\\tau_x, \\tau_y)}{-R_{23}(\\tau_x, \\tau_y)}\n{0}{0}{1} R(\\tau_x, \\tau_y) \\vecthree{x''}{y''}{1}\\f]\n\nand the matrix \\f$R(\\tau_x, \\tau_y)\\f$ is defined by two rotations with angular parameter\n\\f$\\tau_x\\f$ and \\f$\\tau_y\\f$, respectively,\n\n\\f[\nR(\\tau_x, \\tau_y) =\n\\vecthreethree{\\cos(\\tau_y)}{0}{-\\sin(\\tau_y)}{0}{1}{0}{\\sin(\\tau_y)}{0}{\\cos(\\tau_y)}\n\\vecthreethree{1}{0}{0}{0}{\\cos(\\tau_x)}{\\sin(\\tau_x)}{0}{-\\sin(\\tau_x)}{\\cos(\\tau_x)} =\n\\vecthreethree{\\cos(\\tau_y)}{\\sin(\\tau_y)\\sin(\\tau_x)}{-\\sin(\\tau_y)\\cos(\\tau_x)}\n{0}{\\cos(\\tau_x)}{\\sin(\\tau_x)}\n{\\sin(\\tau_y)}{-\\cos(\\tau_y)\\sin(\\tau_x)}{\\cos(\\tau_y)\\cos(\\tau_x)}.\n\\f]\n\nIn the functions below the coefficients are passed or returned as\n\n\\f[(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]])\\f]\n\nvector. That is, if the vector contains four elements, it means that \\f$k_3=0\\f$ . The distortion\ncoefficients do not depend on the scene viewed. Thus, they also belong to the intrinsic camera\nparameters. And they remain the same regardless of the captured image resolution. If, for example, a\ncamera has been calibrated on images of 320 x 240 resolution, absolutely the same distortion\ncoefficients can be used for 640 x 480 images from the same camera while \\f$f_x\\f$, \\f$f_y\\f$,\n\\f$c_x\\f$, and \\f$c_y\\f$ need to be scaled appropriately.\n\nThe functions below use the above model to do the following:\n\n-   Project 3D points to the image plane given intrinsic and extrinsic parameters.\n-   Compute extrinsic parameters given intrinsic parameters, a few 3D points, and their\nprojections.\n-   Estimate intrinsic and extrinsic camera parameters from several views of a known calibration\npattern (every view is described by several 3D-2D point correspondences).\n-   Estimate the relative position and orientation of the stereo camera \"heads\" and compute the\n*rectification* transformation that makes the camera optical axes parallel.\n\n<B> Homogeneous Coordinates </B><br>\nHomogeneous Coordinates are a system of coordinates that are used in projective geometry. Their use\nallows to represent points at infinity by finite coordinates and simplifies formulas when compared\nto the cartesian counterparts, e.g. they have the advantage that affine transformations can be\nexpressed as linear homogeneous transformation.\n\nOne obtains the homogeneous vector \\f$P_h\\f$ by appending a 1 along an n-dimensional cartesian\nvector \\f$P\\f$ e.g. for a 3D cartesian vector the mapping \\f$P \\rightarrow P_h\\f$ is:\n\n\\f[\\begin{bmatrix}\nX \\\\\nY \\\\\nZ\n\\end{bmatrix} \\rightarrow \\begin{bmatrix}\nX \\\\\nY \\\\\nZ \\\\\n1\n\\end{bmatrix}.\\f]\n\nFor the inverse mapping \\f$P_h \\rightarrow P\\f$, one divides all elements of the homogeneous vector\nby its last element, e.g. for a 3D homogeneous vector one gets its 2D cartesian counterpart by:\n\n\\f[\\begin{bmatrix}\nX \\\\\nY \\\\\nW\n\\end{bmatrix} \\rightarrow \\begin{bmatrix}\nX / W \\\\\nY / W\n\\end{bmatrix},\\f]\n\nif \\f$W \\ne 0\\f$.\n\nDue to this mapping, all multiples \\f$k P_h\\f$, for \\f$k \\ne 0\\f$, of a homogeneous point represent\nthe same point \\f$P_h\\f$. An intuitive understanding of this property is that under a projective\ntransformation, all multiples of \\f$P_h\\f$ are mapped to the same point. This is the physical\nobservation one does for pinhole cameras, as all points along a ray through the camera's pinhole are\nprojected to the same image point, e.g. all points along the red ray in the image of the pinhole\ncamera model above would be mapped to the same image coordinate. This property is also the source\nfor the scale ambiguity s in the equation of the pinhole camera model.\n\nAs mentioned, by using homogeneous coordinates we can express any change of basis parameterized by\n\\f$R\\f$ and \\f$t\\f$ as a linear transformation, e.g. for the change of basis from coordinate system\n0 to coordinate system 1 becomes:\n\n\\f[P_1 = R P_0 + t \\rightarrow P_{h_1} = \\begin{bmatrix}\nR & t \\\\\n0 & 1\n\\end{bmatrix} P_{h_0}.\\f]\n\n@note\n    -   Many functions in this module take a camera intrinsic matrix as an input parameter. Although all\n        functions assume the same structure of this parameter, they may name it differently. The\n        parameter's description, however, will be clear in that a camera intrinsic matrix with the structure\n        shown above is required.\n    -   A calibration sample for 3 cameras in a horizontal position can be found at\n        opencv_source_code/samples/cpp/3calibration.cpp\n    -   A calibration sample based on a sequence of images can be found at\n        opencv_source_code/samples/cpp/calibration.cpp\n    -   A calibration sample in order to do 3D reconstruction can be found at\n        opencv_source_code/samples/cpp/build3dmodel.cpp\n    -   A calibration example on stereo calibration can be found at\n        opencv_source_code/samples/cpp/stereo_calib.cpp\n    -   A calibration example on stereo matching can be found at\n        opencv_source_code/samples/cpp/stereo_match.cpp\n    -   (Python) A camera calibration sample can be found at\n        opencv_source_code/samples/python/calibrate.py\n\n  @{\n    @defgroup calib3d_fisheye Fisheye camera model\n\n    Definitions: Let P be a point in 3D of coordinates X in the world reference frame (stored in the\n    matrix X) The coordinate vector of P in the camera reference frame is:\n\n    \\f[Xc = R X + T\\f]\n\n    where R is the rotation matrix corresponding to the rotation vector om: R = rodrigues(om); call x, y\n    and z the 3 coordinates of Xc:\n\n    \\f[x = Xc_1 \\\\ y = Xc_2 \\\\ z = Xc_3\\f]\n\n    The pinhole projection coordinates of P is [a; b] where\n\n    \\f[a = x / z \\ and \\ b = y / z \\\\ r^2 = a^2 + b^2 \\\\ \\theta = atan(r)\\f]\n\n    Fisheye distortion:\n\n    \\f[\\theta_d = \\theta (1 + k_1 \\theta^2 + k_2 \\theta^4 + k_3 \\theta^6 + k_4 \\theta^8)\\f]\n\n    The distorted point coordinates are [x'; y'] where\n\n    \\f[x' = (\\theta_d / r) a \\\\ y' = (\\theta_d / r) b \\f]\n\n    Finally, conversion into pixel coordinates: The final pixel coordinates vector [u; v] where:\n\n    \\f[u = f_x (x' + \\alpha y') + c_x \\\\\n    v = f_y y' + c_y\\f]\n\n    @defgroup calib3d_c C API\n\n  @}\n */\n\nnamespace cv\n{\n\n//! @addtogroup calib3d\n//! @{\n\n//! type of the robust estimation algorithm\nenum { LMEDS  = 4,  //!< least-median of squares algorithm\n       RANSAC = 8,  //!< RANSAC algorithm\n       RHO    = 16, //!< RHO algorithm\n       USAC_DEFAULT  = 32, //!< USAC algorithm, default settings\n       USAC_PARALLEL = 33, //!< USAC, parallel version\n       USAC_FM_8PTS = 34,  //!< USAC, fundamental matrix 8 points\n       USAC_FAST = 35,     //!< USAC, fast settings\n       USAC_ACCURATE = 36, //!< USAC, accurate settings\n       USAC_PROSAC = 37,   //!< USAC, sorted points, runs PROSAC\n       USAC_MAGSAC = 38    //!< USAC, runs MAGSAC++\n     };\n\nenum SolvePnPMethod {\n    SOLVEPNP_ITERATIVE   = 0,\n    SOLVEPNP_EPNP        = 1, //!< EPnP: Efficient Perspective-n-Point Camera Pose Estimation @cite lepetit2009epnp\n    SOLVEPNP_P3P         = 2, //!< Complete Solution Classification for the Perspective-Three-Point Problem @cite gao2003complete\n    SOLVEPNP_DLS         = 3, //!< **Broken implementation. Using this flag will fallback to EPnP.** \\n\n                              //!< A Direct Least-Squares (DLS) Method for PnP @cite hesch2011direct\n    SOLVEPNP_UPNP        = 4, //!< **Broken implementation. Using this flag will fallback to EPnP.** \\n\n                              //!< Exhaustive Linearization for Robust Camera Pose and Focal Length Estimation @cite penate2013exhaustive\n    SOLVEPNP_AP3P        = 5, //!< An Efficient Algebraic Solution to the Perspective-Three-Point Problem @cite Ke17\n    SOLVEPNP_IPPE        = 6, //!< Infinitesimal Plane-Based Pose Estimation @cite Collins14 \\n\n                              //!< Object points must be coplanar.\n    SOLVEPNP_IPPE_SQUARE = 7, //!< Infinitesimal Plane-Based Pose Estimation @cite Collins14 \\n\n                              //!< This is a special case suitable for marker pose estimation.\\n\n                              //!< 4 coplanar object points must be defined in the following order:\n                              //!<   - point 0: [-squareLength / 2,  squareLength / 2, 0]\n                              //!<   - point 1: [ squareLength / 2,  squareLength / 2, 0]\n                              //!<   - point 2: [ squareLength / 2, -squareLength / 2, 0]\n                              //!<   - point 3: [-squareLength / 2, -squareLength / 2, 0]\n    SOLVEPNP_SQPNP       = 8, //!< SQPnP: A Consistently Fast and Globally OptimalSolution to the Perspective-n-Point Problem @cite Terzakis20\n#ifndef CV_DOXYGEN\n    SOLVEPNP_MAX_COUNT        //!< Used for count\n#endif\n};\n\nenum { CALIB_CB_ADAPTIVE_THRESH = 1,\n       CALIB_CB_NORMALIZE_IMAGE = 2,\n       CALIB_CB_FILTER_QUADS    = 4,\n       CALIB_CB_FAST_CHECK      = 8,\n       CALIB_CB_EXHAUSTIVE      = 16,\n       CALIB_CB_ACCURACY        = 32,\n       CALIB_CB_LARGER          = 64,\n       CALIB_CB_MARKER          = 128\n     };\n\nenum { CALIB_CB_SYMMETRIC_GRID  = 1,\n       CALIB_CB_ASYMMETRIC_GRID = 2,\n       CALIB_CB_CLUSTERING      = 4\n     };\n\nenum { CALIB_NINTRINSIC          = 18,\n       CALIB_USE_INTRINSIC_GUESS = 0x00001,\n       CALIB_FIX_ASPECT_RATIO    = 0x00002,\n       CALIB_FIX_PRINCIPAL_POINT = 0x00004,\n       CALIB_ZERO_TANGENT_DIST   = 0x00008,\n       CALIB_FIX_FOCAL_LENGTH    = 0x00010,\n       CALIB_FIX_K1              = 0x00020,\n       CALIB_FIX_K2              = 0x00040,\n       CALIB_FIX_K3              = 0x00080,\n       CALIB_FIX_K4              = 0x00800,\n       CALIB_FIX_K5              = 0x01000,\n       CALIB_FIX_K6              = 0x02000,\n       CALIB_RATIONAL_MODEL      = 0x04000,\n       CALIB_THIN_PRISM_MODEL    = 0x08000,\n       CALIB_FIX_S1_S2_S3_S4     = 0x10000,\n       CALIB_TILTED_MODEL        = 0x40000,\n       CALIB_FIX_TAUX_TAUY       = 0x80000,\n       CALIB_USE_QR              = 0x100000, //!< use QR instead of SVD decomposition for solving. Faster but potentially less precise\n       CALIB_FIX_TANGENT_DIST    = 0x200000,\n       // only for stereo\n       CALIB_FIX_INTRINSIC       = 0x00100,\n       CALIB_SAME_FOCAL_LENGTH   = 0x00200,\n       // for stereo rectification\n       CALIB_ZERO_DISPARITY      = 0x00400,\n       CALIB_USE_LU              = (1 << 17), //!< use LU instead of SVD decomposition for solving. much faster but potentially less precise\n       CALIB_USE_EXTRINSIC_GUESS = (1 << 22)  //!< for stereoCalibrate\n     };\n\n//! the algorithm for finding fundamental matrix\nenum { FM_7POINT = 1, //!< 7-point algorithm\n       FM_8POINT = 2, //!< 8-point algorithm\n       FM_LMEDS  = 4, //!< least-median algorithm. 7-point algorithm is used.\n       FM_RANSAC = 8  //!< RANSAC algorithm. It needs at least 15 points. 7-point algorithm is used.\n     };\n\nenum HandEyeCalibrationMethod\n{\n    CALIB_HAND_EYE_TSAI         = 0, //!< A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/Eye Calibration @cite Tsai89\n    CALIB_HAND_EYE_PARK         = 1, //!< Robot Sensor Calibration: Solving AX = XB on the Euclidean Group @cite Park94\n    CALIB_HAND_EYE_HORAUD       = 2, //!< Hand-eye Calibration @cite Horaud95\n    CALIB_HAND_EYE_ANDREFF      = 3, //!< On-line Hand-Eye Calibration @cite Andreff99\n    CALIB_HAND_EYE_DANIILIDIS   = 4  //!< Hand-Eye Calibration Using Dual Quaternions @cite Daniilidis98\n};\n\nenum RobotWorldHandEyeCalibrationMethod\n{\n    CALIB_ROBOT_WORLD_HAND_EYE_SHAH = 0, //!< Solving the robot-world/hand-eye calibration problem using the kronecker product @cite Shah2013SolvingTR\n    CALIB_ROBOT_WORLD_HAND_EYE_LI   = 1  //!< Simultaneous robot-world and hand-eye calibration using dual-quaternions and kronecker product @cite Li2010SimultaneousRA\n};\n\nenum SamplingMethod { SAMPLING_UNIFORM, SAMPLING_PROGRESSIVE_NAPSAC, SAMPLING_NAPSAC,\n        SAMPLING_PROSAC };\nenum LocalOptimMethod {LOCAL_OPTIM_NULL, LOCAL_OPTIM_INNER_LO, LOCAL_OPTIM_INNER_AND_ITER_LO,\n        LOCAL_OPTIM_GC, LOCAL_OPTIM_SIGMA};\nenum ScoreMethod {SCORE_METHOD_RANSAC, SCORE_METHOD_MSAC, SCORE_METHOD_MAGSAC, SCORE_METHOD_LMEDS};\nenum NeighborSearchMethod { NEIGH_FLANN_KNN, NEIGH_GRID, NEIGH_FLANN_RADIUS };\n\nstruct CV_EXPORTS_W_SIMPLE UsacParams\n{ // in alphabetical order\n    CV_WRAP UsacParams();\n    CV_PROP_RW double confidence;\n    CV_PROP_RW bool isParallel;\n    CV_PROP_RW int loIterations;\n    CV_PROP_RW LocalOptimMethod loMethod;\n    CV_PROP_RW int loSampleSize;\n    CV_PROP_RW int maxIterations;\n    CV_PROP_RW NeighborSearchMethod neighborsSearch;\n    CV_PROP_RW int randomGeneratorState;\n    CV_PROP_RW SamplingMethod sampler;\n    CV_PROP_RW ScoreMethod score;\n    CV_PROP_RW double threshold;\n};\n\n/** @brief Converts a rotation matrix to a rotation vector or vice versa.\n\n@param src Input rotation vector (3x1 or 1x3) or rotation matrix (3x3).\n@param dst Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively.\n@param jacobian Optional output Jacobian matrix, 3x9 or 9x3, which is a matrix of partial\nderivatives of the output array components with respect to the input array components.\n\n\\f[\\begin{array}{l} \\theta \\leftarrow norm(r) \\\\ r  \\leftarrow r/ \\theta \\\\ R =  \\cos(\\theta) I + (1- \\cos{\\theta} ) r r^T +  \\sin(\\theta) \\vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} \\end{array}\\f]\n\nInverse transformation can be also done easily, since\n\n\\f[\\sin ( \\theta ) \\vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} = \\frac{R - R^T}{2}\\f]\n\nA rotation vector is a convenient and most compact representation of a rotation matrix (since any\nrotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry\noptimization procedures like @ref calibrateCamera, @ref stereoCalibrate, or @ref solvePnP .\n\n@note More information about the computation of the derivative of a 3D rotation matrix with respect to its exponential coordinate\ncan be found in:\n    - A Compact Formula for the Derivative of a 3-D Rotation in Exponential Coordinates, Guillermo Gallego, Anthony J. Yezzi @cite Gallego2014ACF\n\n@note Useful information on SE(3) and Lie Groups can be found in:\n    - A tutorial on SE(3) transformation parameterizations and on-manifold optimization, Jose-Luis Blanco @cite blanco2010tutorial\n    - Lie Groups for 2D and 3D Transformation, Ethan Eade @cite Eade17\n    - A micro Lie theory for state estimation in robotics, Joan Solà, Jérémie Deray, Dinesh Atchuthan @cite Sol2018AML\n */\nCV_EXPORTS_W void Rodrigues( InputArray src, OutputArray dst, OutputArray jacobian = noArray() );\n\n\n\n/** Levenberg-Marquardt solver. Starting with the specified vector of parameters it\n    optimizes the target vector criteria \"err\"\n    (finds local minima of each target vector component absolute value).\n\n    When needed, it calls user-provided callback.\n*/\nclass CV_EXPORTS LMSolver : public Algorithm\n{\npublic:\n    class CV_EXPORTS Callback\n    {\n    public:\n        virtual ~Callback() {}\n        /**\n         computes error and Jacobian for the specified vector of parameters\n\n         @param param the current vector of parameters\n         @param err output vector of errors: err_i = actual_f_i - ideal_f_i\n         @param J output Jacobian: J_ij = d(err_i)/d(param_j)\n\n         when J=noArray(), it means that it does not need to be computed.\n         Dimensionality of error vector and param vector can be different.\n         The callback should explicitly allocate (with \"create\" method) each output array\n         (unless it's noArray()).\n        */\n        virtual bool compute(InputArray param, OutputArray err, OutputArray J) const = 0;\n    };\n\n    /**\n       Runs Levenberg-Marquardt algorithm using the passed vector of parameters as the start point.\n       The final vector of parameters (whether the algorithm converged or not) is stored at the same\n       vector. The method returns the number of iterations used. If it's equal to the previously specified\n       maxIters, there is a big chance the algorithm did not converge.\n\n       @param param initial/final vector of parameters.\n\n       Note that the dimensionality of parameter space is defined by the size of param vector,\n       and the dimensionality of optimized criteria is defined by the size of err vector\n       computed by the callback.\n    */\n    virtual int run(InputOutputArray param) const = 0;\n\n    /**\n       Sets the maximum number of iterations\n       @param maxIters the number of iterations\n    */\n    virtual void setMaxIters(int maxIters) = 0;\n    /**\n       Retrieves the current maximum number of iterations\n    */\n    virtual int getMaxIters() const = 0;\n\n    /**\n       Creates Levenberg-Marquard solver\n\n       @param cb callback\n       @param maxIters maximum number of iterations that can be further\n         modified using setMaxIters() method.\n    */\n    static Ptr<LMSolver> create(const Ptr<LMSolver::Callback>& cb, int maxIters);\n    static Ptr<LMSolver> create(const Ptr<LMSolver::Callback>& cb, int maxIters, double eps);\n};\n\n\n\n/** @example samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp\nAn example program about pose estimation from coplanar points\n\nCheck @ref tutorial_homography \"the corresponding tutorial\" for more details\n*/\n\n/** @brief Finds a perspective transformation between two planes.\n\n@param srcPoints Coordinates of the points in the original plane, a matrix of the type CV_32FC2\nor vector\\<Point2f\\> .\n@param dstPoints Coordinates of the points in the target plane, a matrix of the type CV_32FC2 or\na vector\\<Point2f\\> .\n@param method Method used to compute a homography matrix. The following methods are possible:\n-   **0** - a regular method using all the points, i.e., the least squares method\n-   @ref RANSAC - RANSAC-based robust method\n-   @ref LMEDS - Least-Median robust method\n-   @ref RHO - PROSAC-based robust method\n@param ransacReprojThreshold Maximum allowed reprojection error to treat a point pair as an inlier\n(used in the RANSAC and RHO methods only). That is, if\n\\f[\\| \\texttt{dstPoints} _i -  \\texttt{convertPointsHomogeneous} ( \\texttt{H} * \\texttt{srcPoints} _i) \\|_2  >  \\texttt{ransacReprojThreshold}\\f]\nthen the point \\f$i\\f$ is considered as an outlier. If srcPoints and dstPoints are measured in pixels,\nit usually makes sense to set this parameter somewhere in the range of 1 to 10.\n@param mask Optional output mask set by a robust method ( RANSAC or LMeDS ). Note that the input\nmask values are ignored.\n@param maxIters The maximum number of RANSAC iterations.\n@param confidence Confidence level, between 0 and 1.\n\nThe function finds and returns the perspective transformation \\f$H\\f$ between the source and the\ndestination planes:\n\n\\f[s_i  \\vecthree{x'_i}{y'_i}{1} \\sim H  \\vecthree{x_i}{y_i}{1}\\f]\n\nso that the back-projection error\n\n\\f[\\sum _i \\left ( x'_i- \\frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \\right )^2+ \\left ( y'_i- \\frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \\right )^2\\f]\n\nis minimized. If the parameter method is set to the default value 0, the function uses all the point\npairs to compute an initial homography estimate with a simple least-squares scheme.\n\nHowever, if not all of the point pairs ( \\f$srcPoints_i\\f$, \\f$dstPoints_i\\f$ ) fit the rigid perspective\ntransformation (that is, there are some outliers), this initial estimate will be poor. In this case,\nyou can use one of the three robust methods. The methods RANSAC, LMeDS and RHO try many different\nrandom subsets of the corresponding point pairs (of four pairs each, collinear pairs are discarded), estimate the homography matrix\nusing this subset and a simple least-squares algorithm, and then compute the quality/goodness of the\ncomputed homography (which is the number of inliers for RANSAC or the least median re-projection error for\nLMeDS). The best subset is then used to produce the initial estimate of the homography matrix and\nthe mask of inliers/outliers.\n\nRegardless of the method, robust or not, the computed homography matrix is refined further (using\ninliers only in case of a robust method) with the Levenberg-Marquardt method to reduce the\nre-projection error even more.\n\nThe methods RANSAC and RHO can handle practically any ratio of outliers but need a threshold to\ndistinguish inliers from outliers. The method LMeDS does not need any threshold but it works\ncorrectly only when there are more than 50% of inliers. Finally, if there are no outliers and the\nnoise is rather small, use the default method (method=0).\n\nThe function is used to find initial intrinsic and extrinsic matrices. Homography matrix is\ndetermined up to a scale. Thus, it is normalized so that \\f$h_{33}=1\\f$. Note that whenever an \\f$H\\f$ matrix\ncannot be estimated, an empty one will be returned.\n\n@sa\ngetAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective,\nperspectiveTransform\n */\nCV_EXPORTS_W Mat findHomography( InputArray srcPoints, InputArray dstPoints,\n                                 int method = 0, double ransacReprojThreshold = 3,\n                                 OutputArray mask=noArray(), const int maxIters = 2000,\n                                 const double confidence = 0.995);\n\n/** @overload */\nCV_EXPORTS Mat findHomography( InputArray srcPoints, InputArray dstPoints,\n                               OutputArray mask, int method = 0, double ransacReprojThreshold = 3 );\n\n\nCV_EXPORTS_W Mat findHomography(InputArray srcPoints, InputArray dstPoints, OutputArray mask,\n                   const UsacParams &params);\n\n/** @brief Computes an RQ decomposition of 3x3 matrices.\n\n@param src 3x3 input matrix.\n@param mtxR Output 3x3 upper-triangular matrix.\n@param mtxQ Output 3x3 orthogonal matrix.\n@param Qx Optional output 3x3 rotation matrix around x-axis.\n@param Qy Optional output 3x3 rotation matrix around y-axis.\n@param Qz Optional output 3x3 rotation matrix around z-axis.\n\nThe function computes a RQ decomposition using the given rotations. This function is used in\n#decomposeProjectionMatrix to decompose the left 3x3 submatrix of a projection matrix into a camera\nand a rotation matrix.\n\nIt optionally returns three rotation matrices, one for each axis, and the three Euler angles in\ndegrees (as the return value) that could be used in OpenGL. Note, there is always more than one\nsequence of rotations about the three principal axes that results in the same orientation of an\nobject, e.g. see @cite Slabaugh . Returned tree rotation matrices and corresponding three Euler angles\nare only one of the possible solutions.\n */\nCV_EXPORTS_W Vec3d RQDecomp3x3( InputArray src, OutputArray mtxR, OutputArray mtxQ,\n                                OutputArray Qx = noArray(),\n                                OutputArray Qy = noArray(),\n                                OutputArray Qz = noArray());\n\n/** @brief Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.\n\n@param projMatrix 3x4 input projection matrix P.\n@param cameraMatrix Output 3x3 camera intrinsic matrix \\f$\\cameramatrix{A}\\f$.\n@param rotMatrix Output 3x3 external rotation matrix R.\n@param transVect Output 4x1 translation vector T.\n@param rotMatrixX Optional 3x3 rotation matrix around x-axis.\n@param rotMatrixY Optional 3x3 rotation matrix around y-axis.\n@param rotMatrixZ Optional 3x3 rotation matrix around z-axis.\n@param eulerAngles Optional three-element vector containing three Euler angles of rotation in\ndegrees.\n\nThe function computes a decomposition of a projection matrix into a calibration and a rotation\nmatrix and the position of a camera.\n\nIt optionally returns three rotation matrices, one for each axis, and three Euler angles that could\nbe used in OpenGL. Note, there is always more than one sequence of rotations about the three\nprincipal axes that results in the same orientation of an object, e.g. see @cite Slabaugh . Returned\ntree rotation matrices and corresponding three Euler angles are only one of the possible solutions.\n\nThe function is based on RQDecomp3x3 .\n */\nCV_EXPORTS_W void decomposeProjectionMatrix( InputArray projMatrix, OutputArray cameraMatrix,\n                                             OutputArray rotMatrix, OutputArray transVect,\n                                             OutputArray rotMatrixX = noArray(),\n                                             OutputArray rotMatrixY = noArray(),\n                                             OutputArray rotMatrixZ = noArray(),\n                                             OutputArray eulerAngles =noArray() );\n\n/** @brief Computes partial derivatives of the matrix product for each multiplied matrix.\n\n@param A First multiplied matrix.\n@param B Second multiplied matrix.\n@param dABdA First output derivative matrix d(A\\*B)/dA of size\n\\f$\\texttt{A.rows*B.cols} \\times {A.rows*A.cols}\\f$ .\n@param dABdB Second output derivative matrix d(A\\*B)/dB of size\n\\f$\\texttt{A.rows*B.cols} \\times {B.rows*B.cols}\\f$ .\n\nThe function computes partial derivatives of the elements of the matrix product \\f$A*B\\f$ with regard to\nthe elements of each of the two input matrices. The function is used to compute the Jacobian\nmatrices in #stereoCalibrate but can also be used in any other similar optimization function.\n */\nCV_EXPORTS_W void matMulDeriv( InputArray A, InputArray B, OutputArray dABdA, OutputArray dABdB );\n\n/** @brief Combines two rotation-and-shift transformations.\n\n@param rvec1 First rotation vector.\n@param tvec1 First translation vector.\n@param rvec2 Second rotation vector.\n@param tvec2 Second translation vector.\n@param rvec3 Output rotation vector of the superposition.\n@param tvec3 Output translation vector of the superposition.\n@param dr3dr1 Optional output derivative of rvec3 with regard to rvec1\n@param dr3dt1 Optional output derivative of rvec3 with regard to tvec1\n@param dr3dr2 Optional output derivative of rvec3 with regard to rvec2\n@param dr3dt2 Optional output derivative of rvec3 with regard to tvec2\n@param dt3dr1 Optional output derivative of tvec3 with regard to rvec1\n@param dt3dt1 Optional output derivative of tvec3 with regard to tvec1\n@param dt3dr2 Optional output derivative of tvec3 with regard to rvec2\n@param dt3dt2 Optional output derivative of tvec3 with regard to tvec2\n\nThe functions compute:\n\n\\f[\\begin{array}{l} \\texttt{rvec3} =  \\mathrm{rodrigues} ^{-1} \\left ( \\mathrm{rodrigues} ( \\texttt{rvec2} )  \\cdot \\mathrm{rodrigues} ( \\texttt{rvec1} ) \\right )  \\\\ \\texttt{tvec3} =  \\mathrm{rodrigues} ( \\texttt{rvec2} )  \\cdot \\texttt{tvec1} +  \\texttt{tvec2} \\end{array} ,\\f]\n\nwhere \\f$\\mathrm{rodrigues}\\f$ denotes a rotation vector to a rotation matrix transformation, and\n\\f$\\mathrm{rodrigues}^{-1}\\f$ denotes the inverse transformation. See Rodrigues for details.\n\nAlso, the functions can compute the derivatives of the output vectors with regards to the input\nvectors (see matMulDeriv ). The functions are used inside #stereoCalibrate but can also be used in\nyour own code where Levenberg-Marquardt or another gradient-based solver is used to optimize a\nfunction that contains a matrix multiplication.\n */\nCV_EXPORTS_W void composeRT( InputArray rvec1, InputArray tvec1,\n                             InputArray rvec2, InputArray tvec2,\n                             OutputArray rvec3, OutputArray tvec3,\n                             OutputArray dr3dr1 = noArray(), OutputArray dr3dt1 = noArray(),\n                             OutputArray dr3dr2 = noArray(), OutputArray dr3dt2 = noArray(),\n                             OutputArray dt3dr1 = noArray(), OutputArray dt3dt1 = noArray(),\n                             OutputArray dt3dr2 = noArray(), OutputArray dt3dt2 = noArray() );\n\n/** @brief Projects 3D points to an image plane.\n\n@param objectPoints Array of object points expressed wrt. the world coordinate frame. A 3xN/Nx3\n1-channel or 1xN/Nx1 3-channel (or vector\\<Point3f\\> ), where N is the number of points in the view.\n@param rvec The rotation vector (@ref Rodrigues) that, together with tvec, performs a change of\nbasis from world to camera coordinate system, see @ref calibrateCamera for details.\n@param tvec The translation vector, see parameter description above.\n@param cameraMatrix Camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$\\distcoeffs\\f$ . If the vector is empty, the zero distortion coefficients are assumed.\n@param imagePoints Output array of image points, 1xN/Nx1 2-channel, or\nvector\\<Point2f\\> .\n@param jacobian Optional output 2Nx(10+\\<numDistCoeffs\\>) jacobian matrix of derivatives of image\npoints with respect to components of the rotation vector, translation vector, focal lengths,\ncoordinates of the principal point and the distortion coefficients. In the old interface different\ncomponents of the jacobian are returned via different output parameters.\n@param aspectRatio Optional \"fixed aspect ratio\" parameter. If the parameter is not 0, the\nfunction assumes that the aspect ratio (\\f$f_x / f_y\\f$) is fixed and correspondingly adjusts the\njacobian matrix.\n\nThe function computes the 2D projections of 3D points to the image plane, given intrinsic and\nextrinsic camera parameters. Optionally, the function computes Jacobians -matrices of partial\nderivatives of image points coordinates (as functions of all the input parameters) with respect to\nthe particular parameters, intrinsic and/or extrinsic. The Jacobians are used during the global\noptimization in @ref calibrateCamera, @ref solvePnP, and @ref stereoCalibrate. The function itself\ncan also be used to compute a re-projection error, given the current intrinsic and extrinsic\nparameters.\n\n@note By setting rvec = tvec = \\f$[0, 0, 0]\\f$, or by setting cameraMatrix to a 3x3 identity matrix,\nor by passing zero distortion coefficients, one can get various useful partial cases of the\nfunction. This means, one can compute the distorted coordinates for a sparse set of points or apply\na perspective transformation (and also compute the derivatives) in the ideal zero-distortion setup.\n */\nCV_EXPORTS_W void projectPoints( InputArray objectPoints,\n                                 InputArray rvec, InputArray tvec,\n                                 InputArray cameraMatrix, InputArray distCoeffs,\n                                 OutputArray imagePoints,\n                                 OutputArray jacobian = noArray(),\n                                 double aspectRatio = 0 );\n\n/** @example samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp\nAn example program about homography from the camera displacement\n\nCheck @ref tutorial_homography \"the corresponding tutorial\" for more details\n*/\n\n/** @brief Finds an object pose from 3D-2D point correspondences.\nThis function returns the rotation and the translation vectors that transform a 3D point expressed in the object\ncoordinate frame to the camera coordinate frame, using different methods:\n- P3P methods (@ref SOLVEPNP_P3P, @ref SOLVEPNP_AP3P): need 4 input points to return a unique solution.\n- @ref SOLVEPNP_IPPE Input points must be >= 4 and object points must be coplanar.\n- @ref SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.\nNumber of input points must be 4. Object points must be defined in the following order:\n  - point 0: [-squareLength / 2,  squareLength / 2, 0]\n  - point 1: [ squareLength / 2,  squareLength / 2, 0]\n  - point 2: [ squareLength / 2, -squareLength / 2, 0]\n  - point 3: [-squareLength / 2, -squareLength / 2, 0]\n- for all the other flags, number of input points must be >= 4 and object points can be in any configuration.\n\n@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or\n1xN/Nx1 3-channel, where N is the number of points. vector\\<Point3d\\> can be also passed here.\n@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,\nwhere N is the number of points. vector\\<Point2d\\> can be also passed here.\n@param cameraMatrix Input camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$\\distcoeffs\\f$. If the vector is NULL/empty, the zero distortion coefficients are\nassumed.\n@param rvec Output rotation vector (see @ref Rodrigues ) that, together with tvec, brings points from\nthe model coordinate system to the camera coordinate system.\n@param tvec Output translation vector.\n@param useExtrinsicGuess Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses\nthe provided rvec and tvec values as initial approximations of the rotation and translation\nvectors, respectively, and further optimizes them.\n@param flags Method for solving a PnP problem:\n-   @ref SOLVEPNP_ITERATIVE Iterative method is based on a Levenberg-Marquardt optimization. In\nthis case the function finds such a pose that minimizes reprojection error, that is the sum\nof squared distances between the observed projections imagePoints and the projected (using\n@ref projectPoints ) objectPoints .\n-   @ref SOLVEPNP_P3P Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang\n\"Complete Solution Classification for the Perspective-Three-Point Problem\" (@cite gao2003complete).\nIn this case the function requires exactly four object and image points.\n-   @ref SOLVEPNP_AP3P Method is based on the paper of T. Ke, S. Roumeliotis\n\"An Efficient Algebraic Solution to the Perspective-Three-Point Problem\" (@cite Ke17).\nIn this case the function requires exactly four object and image points.\n-   @ref SOLVEPNP_EPNP Method has been introduced by F. Moreno-Noguer, V. Lepetit and P. Fua in the\npaper \"EPnP: Efficient Perspective-n-Point Camera Pose Estimation\" (@cite lepetit2009epnp).\n-   @ref SOLVEPNP_DLS **Broken implementation. Using this flag will fallback to EPnP.** \\n\nMethod is based on the paper of J. Hesch and S. Roumeliotis.\n\"A Direct Least-Squares (DLS) Method for PnP\" (@cite hesch2011direct).\n-   @ref SOLVEPNP_UPNP **Broken implementation. Using this flag will fallback to EPnP.** \\n\nMethod is based on the paper of A. Penate-Sanchez, J. Andrade-Cetto,\nF. Moreno-Noguer. \"Exhaustive Linearization for Robust Camera Pose and Focal Length\nEstimation\" (@cite penate2013exhaustive). In this case the function also estimates the parameters \\f$f_x\\f$ and \\f$f_y\\f$\nassuming that both have the same value. Then the cameraMatrix is updated with the estimated\nfocal length.\n-   @ref SOLVEPNP_IPPE Method is based on the paper of T. Collins and A. Bartoli.\n\"Infinitesimal Plane-Based Pose Estimation\" (@cite Collins14). This method requires coplanar object points.\n-   @ref SOLVEPNP_IPPE_SQUARE Method is based on the paper of Toby Collins and Adrien Bartoli.\n\"Infinitesimal Plane-Based Pose Estimation\" (@cite Collins14). This method is suitable for marker pose estimation.\nIt requires 4 coplanar object points defined in the following order:\n  - point 0: [-squareLength / 2,  squareLength / 2, 0]\n  - point 1: [ squareLength / 2,  squareLength / 2, 0]\n  - point 2: [ squareLength / 2, -squareLength / 2, 0]\n  - point 3: [-squareLength / 2, -squareLength / 2, 0]\n-   @ref SOLVEPNP_SQPNP Method is based on the paper \"A Consistently Fast and Globally Optimal Solution to the\nPerspective-n-Point Problem\" by G. Terzakis and M.Lourakis (@cite Terzakis20). It requires 3 or more points.\n\n\nThe function estimates the object pose given a set of object points, their corresponding image\nprojections, as well as the camera intrinsic matrix and the distortion coefficients, see the figure below\n(more precisely, the X-axis of the camera frame is pointing to the right, the Y-axis downward\nand the Z-axis forward).\n\n![](pnp.jpg)\n\nPoints expressed in the world frame \\f$ \\bf{X}_w \\f$ are projected into the image plane \\f$ \\left[ u, v \\right] \\f$\nusing the perspective projection model \\f$ \\Pi \\f$ and the camera intrinsic parameters matrix \\f$ \\bf{A} \\f$:\n\n\\f[\n  \\begin{align*}\n  \\begin{bmatrix}\n  u \\\\\n  v \\\\\n  1\n  \\end{bmatrix} &=\n  \\bf{A} \\hspace{0.1em} \\Pi \\hspace{0.2em} ^{c}\\bf{T}_w\n  \\begin{bmatrix}\n  X_{w} \\\\\n  Y_{w} \\\\\n  Z_{w} \\\\\n  1\n  \\end{bmatrix} \\\\\n  \\begin{bmatrix}\n  u \\\\\n  v \\\\\n  1\n  \\end{bmatrix} &=\n  \\begin{bmatrix}\n  f_x & 0 & c_x \\\\\n  0 & f_y & c_y \\\\\n  0 & 0 & 1\n  \\end{bmatrix}\n  \\begin{bmatrix}\n  1 & 0 & 0 & 0 \\\\\n  0 & 1 & 0 & 0 \\\\\n  0 & 0 & 1 & 0\n  \\end{bmatrix}\n  \\begin{bmatrix}\n  r_{11} & r_{12} & r_{13} & t_x \\\\\n  r_{21} & r_{22} & r_{23} & t_y \\\\\n  r_{31} & r_{32} & r_{33} & t_z \\\\\n  0 & 0 & 0 & 1\n  \\end{bmatrix}\n  \\begin{bmatrix}\n  X_{w} \\\\\n  Y_{w} \\\\\n  Z_{w} \\\\\n  1\n  \\end{bmatrix}\n  \\end{align*}\n\\f]\n\nThe estimated pose is thus the rotation (`rvec`) and the translation (`tvec`) vectors that allow transforming\na 3D point expressed in the world frame into the camera frame:\n\n\\f[\n  \\begin{align*}\n  \\begin{bmatrix}\n  X_c \\\\\n  Y_c \\\\\n  Z_c \\\\\n  1\n  \\end{bmatrix} &=\n  \\hspace{0.2em} ^{c}\\bf{T}_w\n  \\begin{bmatrix}\n  X_{w} \\\\\n  Y_{w} \\\\\n  Z_{w} \\\\\n  1\n  \\end{bmatrix} \\\\\n  \\begin{bmatrix}\n  X_c \\\\\n  Y_c \\\\\n  Z_c \\\\\n  1\n  \\end{bmatrix} &=\n  \\begin{bmatrix}\n  r_{11} & r_{12} & r_{13} & t_x \\\\\n  r_{21} & r_{22} & r_{23} & t_y \\\\\n  r_{31} & r_{32} & r_{33} & t_z \\\\\n  0 & 0 & 0 & 1\n  \\end{bmatrix}\n  \\begin{bmatrix}\n  X_{w} \\\\\n  Y_{w} \\\\\n  Z_{w} \\\\\n  1\n  \\end{bmatrix}\n  \\end{align*}\n\\f]\n\n@note\n   -   An example of how to use solvePnP for planar augmented reality can be found at\n        opencv_source_code/samples/python/plane_ar.py\n   -   If you are using Python:\n        - Numpy array slices won't work as input because solvePnP requires contiguous\n        arrays (enforced by the assertion using cv::Mat::checkVector() around line 55 of\n        modules/calib3d/src/solvepnp.cpp version 2.4.9)\n        - The P3P algorithm requires image points to be in an array of shape (N,1,2) due\n        to its calling of #undistortPoints (around line 75 of modules/calib3d/src/solvepnp.cpp version 2.4.9)\n        which requires 2-channel information.\n        - Thus, given some data D = np.array(...) where D.shape = (N,M), in order to use a subset of\n        it as, e.g., imagePoints, one must effectively copy it into a new array: imagePoints =\n        np.ascontiguousarray(D[:,:2]).reshape((N,1,2))\n   -   The methods @ref SOLVEPNP_DLS and @ref SOLVEPNP_UPNP cannot be used as the current implementations are\n       unstable and sometimes give completely wrong results. If you pass one of these two\n       flags, @ref SOLVEPNP_EPNP method will be used instead.\n   -   The minimum number of points is 4 in the general case. In the case of @ref SOLVEPNP_P3P and @ref SOLVEPNP_AP3P\n       methods, it is required to use exactly 4 points (the first 3 points are used to estimate all the solutions\n       of the P3P problem, the last one is used to retain the best solution that minimizes the reprojection error).\n   -   With @ref SOLVEPNP_ITERATIVE method and `useExtrinsicGuess=true`, the minimum number of points is 3 (3 points\n       are sufficient to compute a pose but there are up to 4 solutions). The initial solution should be close to the\n       global solution to converge.\n   -   With @ref SOLVEPNP_IPPE input points must be >= 4 and object points must be coplanar.\n   -   With @ref SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.\n       Number of input points must be 4. Object points must be defined in the following order:\n         - point 0: [-squareLength / 2,  squareLength / 2, 0]\n         - point 1: [ squareLength / 2,  squareLength / 2, 0]\n         - point 2: [ squareLength / 2, -squareLength / 2, 0]\n         - point 3: [-squareLength / 2, -squareLength / 2, 0]\n    -  With @ref SOLVEPNP_SQPNP input points must be >= 3\n */\nCV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints,\n                            InputArray cameraMatrix, InputArray distCoeffs,\n                            OutputArray rvec, OutputArray tvec,\n                            bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE );\n\n/** @brief Finds an object pose from 3D-2D point correspondences using the RANSAC scheme.\n\n@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or\n1xN/Nx1 3-channel, where N is the number of points. vector\\<Point3d\\> can be also passed here.\n@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,\nwhere N is the number of points. vector\\<Point2d\\> can be also passed here.\n@param cameraMatrix Input camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$\\distcoeffs\\f$. If the vector is NULL/empty, the zero distortion coefficients are\nassumed.\n@param rvec Output rotation vector (see @ref Rodrigues ) that, together with tvec, brings points from\nthe model coordinate system to the camera coordinate system.\n@param tvec Output translation vector.\n@param useExtrinsicGuess Parameter used for @ref SOLVEPNP_ITERATIVE. If true (1), the function uses\nthe provided rvec and tvec values as initial approximations of the rotation and translation\nvectors, respectively, and further optimizes them.\n@param iterationsCount Number of iterations.\n@param reprojectionError Inlier threshold value used by the RANSAC procedure. The parameter value\nis the maximum allowed distance between the observed and computed point projections to consider it\nan inlier.\n@param confidence The probability that the algorithm produces a useful result.\n@param inliers Output vector that contains indices of inliers in objectPoints and imagePoints .\n@param flags Method for solving a PnP problem (see @ref solvePnP ).\n\nThe function estimates an object pose given a set of object points, their corresponding image\nprojections, as well as the camera intrinsic matrix and the distortion coefficients. This function finds such\na pose that minimizes reprojection error, that is, the sum of squared distances between the observed\nprojections imagePoints and the projected (using @ref projectPoints ) objectPoints. The use of RANSAC\nmakes the function resistant to outliers.\n\n@note\n   -   An example of how to use solvePNPRansac for object detection can be found at\n        opencv_source_code/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/\n   -   The default method used to estimate the camera pose for the Minimal Sample Sets step\n       is #SOLVEPNP_EPNP. Exceptions are:\n         - if you choose #SOLVEPNP_P3P or #SOLVEPNP_AP3P, these methods will be used.\n         - if the number of input points is equal to 4, #SOLVEPNP_P3P is used.\n   -   The method used to estimate the camera pose using all the inliers is defined by the\n       flags parameters unless it is equal to #SOLVEPNP_P3P or #SOLVEPNP_AP3P. In this case,\n       the method #SOLVEPNP_EPNP will be used instead.\n */\nCV_EXPORTS_W bool solvePnPRansac( InputArray objectPoints, InputArray imagePoints,\n                                  InputArray cameraMatrix, InputArray distCoeffs,\n                                  OutputArray rvec, OutputArray tvec,\n                                  bool useExtrinsicGuess = false, int iterationsCount = 100,\n                                  float reprojectionError = 8.0, double confidence = 0.99,\n                                  OutputArray inliers = noArray(), int flags = SOLVEPNP_ITERATIVE );\n\n\n/*\nFinds rotation and translation vector.\nIf cameraMatrix is given then run P3P. Otherwise run linear P6P and output cameraMatrix too.\n*/\nCV_EXPORTS_W bool solvePnPRansac( InputArray objectPoints, InputArray imagePoints,\n                     InputOutputArray cameraMatrix, InputArray distCoeffs,\n                     OutputArray rvec, OutputArray tvec, OutputArray inliers,\n                     const UsacParams &params=UsacParams());\n\n/** @brief Finds an object pose from 3 3D-2D point correspondences.\n\n@param objectPoints Array of object points in the object coordinate space, 3x3 1-channel or\n1x3/3x1 3-channel. vector\\<Point3f\\> can be also passed here.\n@param imagePoints Array of corresponding image points, 3x2 1-channel or 1x3/3x1 2-channel.\n vector\\<Point2f\\> can be also passed here.\n@param cameraMatrix Input camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$\\distcoeffs\\f$. If the vector is NULL/empty, the zero distortion coefficients are\nassumed.\n@param rvecs Output rotation vectors (see @ref Rodrigues ) that, together with tvecs, brings points from\nthe model coordinate system to the camera coordinate system. A P3P problem has up to 4 solutions.\n@param tvecs Output translation vectors.\n@param flags Method for solving a P3P problem:\n-   @ref SOLVEPNP_P3P Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang\n\"Complete Solution Classification for the Perspective-Three-Point Problem\" (@cite gao2003complete).\n-   @ref SOLVEPNP_AP3P Method is based on the paper of T. Ke and S. Roumeliotis.\n\"An Efficient Algebraic Solution to the Perspective-Three-Point Problem\" (@cite Ke17).\n\nThe function estimates the object pose given 3 object points, their corresponding image\nprojections, as well as the camera intrinsic matrix and the distortion coefficients.\n\n@note\nThe solutions are sorted by reprojection errors (lowest to highest).\n */\nCV_EXPORTS_W int solveP3P( InputArray objectPoints, InputArray imagePoints,\n                           InputArray cameraMatrix, InputArray distCoeffs,\n                           OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,\n                           int flags );\n\n/** @brief Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame\nto the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution.\n\n@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or 1xN/Nx1 3-channel,\nwhere N is the number of points. vector\\<Point3d\\> can also be passed here.\n@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,\nwhere N is the number of points. vector\\<Point2d\\> can also be passed here.\n@param cameraMatrix Input camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$\\distcoeffs\\f$. If the vector is NULL/empty, the zero distortion coefficients are\nassumed.\n@param rvec Input/Output rotation vector (see @ref Rodrigues ) that, together with tvec, brings points from\nthe model coordinate system to the camera coordinate system. Input values are used as an initial solution.\n@param tvec Input/Output translation vector. Input values are used as an initial solution.\n@param criteria Criteria when to stop the Levenberg-Marquard iterative algorithm.\n\nThe function refines the object pose given at least 3 object points, their corresponding image\nprojections, an initial solution for the rotation and translation vector,\nas well as the camera intrinsic matrix and the distortion coefficients.\nThe function minimizes the projection error with respect to the rotation and the translation vectors, according\nto a Levenberg-Marquardt iterative minimization @cite Madsen04 @cite Eade13 process.\n */\nCV_EXPORTS_W void solvePnPRefineLM( InputArray objectPoints, InputArray imagePoints,\n                                    InputArray cameraMatrix, InputArray distCoeffs,\n                                    InputOutputArray rvec, InputOutputArray tvec,\n                                    TermCriteria criteria = TermCriteria(TermCriteria::EPS + TermCriteria::COUNT, 20, FLT_EPSILON));\n\n/** @brief Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame\nto the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution.\n\n@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or 1xN/Nx1 3-channel,\nwhere N is the number of points. vector\\<Point3d\\> can also be passed here.\n@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,\nwhere N is the number of points. vector\\<Point2d\\> can also be passed here.\n@param cameraMatrix Input camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$\\distcoeffs\\f$. If the vector is NULL/empty, the zero distortion coefficients are\nassumed.\n@param rvec Input/Output rotation vector (see @ref Rodrigues ) that, together with tvec, brings points from\nthe model coordinate system to the camera coordinate system. Input values are used as an initial solution.\n@param tvec Input/Output translation vector. Input values are used as an initial solution.\n@param criteria Criteria when to stop the Levenberg-Marquard iterative algorithm.\n@param VVSlambda Gain for the virtual visual servoing control law, equivalent to the \\f$\\alpha\\f$\ngain in the Damped Gauss-Newton formulation.\n\nThe function refines the object pose given at least 3 object points, their corresponding image\nprojections, an initial solution for the rotation and translation vector,\nas well as the camera intrinsic matrix and the distortion coefficients.\nThe function minimizes the projection error with respect to the rotation and the translation vectors, using a\nvirtual visual servoing (VVS) @cite Chaumette06 @cite Marchand16 scheme.\n */\nCV_EXPORTS_W void solvePnPRefineVVS( InputArray objectPoints, InputArray imagePoints,\n                                     InputArray cameraMatrix, InputArray distCoeffs,\n                                     InputOutputArray rvec, InputOutputArray tvec,\n                                     TermCriteria criteria = TermCriteria(TermCriteria::EPS + TermCriteria::COUNT, 20, FLT_EPSILON),\n                                     double VVSlambda = 1);\n\n/** @brief Finds an object pose from 3D-2D point correspondences.\nThis function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector>\ncouple), depending on the number of input points and the chosen method:\n- P3P methods (@ref SOLVEPNP_P3P, @ref SOLVEPNP_AP3P): 3 or 4 input points. Number of returned solutions can be between 0 and 4 with 3 input points.\n- @ref SOLVEPNP_IPPE Input points must be >= 4 and object points must be coplanar. Returns 2 solutions.\n- @ref SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.\nNumber of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:\n  - point 0: [-squareLength / 2,  squareLength / 2, 0]\n  - point 1: [ squareLength / 2,  squareLength / 2, 0]\n  - point 2: [ squareLength / 2, -squareLength / 2, 0]\n  - point 3: [-squareLength / 2, -squareLength / 2, 0]\n- for all the other flags, number of input points must be >= 4 and object points can be in any configuration.\nOnly 1 solution is returned.\n\n@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or\n1xN/Nx1 3-channel, where N is the number of points. vector\\<Point3d\\> can be also passed here.\n@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,\nwhere N is the number of points. vector\\<Point2d\\> can be also passed here.\n@param cameraMatrix Input camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$\\distcoeffs\\f$. If the vector is NULL/empty, the zero distortion coefficients are\nassumed.\n@param rvecs Vector of output rotation vectors (see @ref Rodrigues ) that, together with tvecs, brings points from\nthe model coordinate system to the camera coordinate system.\n@param tvecs Vector of output translation vectors.\n@param useExtrinsicGuess Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses\nthe provided rvec and tvec values as initial approximations of the rotation and translation\nvectors, respectively, and further optimizes them.\n@param flags Method for solving a PnP problem:\n-   @ref SOLVEPNP_ITERATIVE Iterative method is based on a Levenberg-Marquardt optimization. In\nthis case the function finds such a pose that minimizes reprojection error, that is the sum\nof squared distances between the observed projections imagePoints and the projected (using\n #projectPoints ) objectPoints .\n-   @ref SOLVEPNP_P3P Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang\n\"Complete Solution Classification for the Perspective-Three-Point Problem\" (@cite gao2003complete).\nIn this case the function requires exactly four object and image points.\n-   @ref SOLVEPNP_AP3P Method is based on the paper of T. Ke, S. Roumeliotis\n\"An Efficient Algebraic Solution to the Perspective-Three-Point Problem\" (@cite Ke17).\nIn this case the function requires exactly four object and image points.\n-   @ref SOLVEPNP_EPNP Method has been introduced by F.Moreno-Noguer, V.Lepetit and P.Fua in the\npaper \"EPnP: Efficient Perspective-n-Point Camera Pose Estimation\" (@cite lepetit2009epnp).\n-   @ref SOLVEPNP_DLS **Broken implementation. Using this flag will fallback to EPnP.** \\n\nMethod is based on the paper of Joel A. Hesch and Stergios I. Roumeliotis.\n\"A Direct Least-Squares (DLS) Method for PnP\" (@cite hesch2011direct).\n-   @ref SOLVEPNP_UPNP **Broken implementation. Using this flag will fallback to EPnP.** \\n\nMethod is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto,\nF.Moreno-Noguer. \"Exhaustive Linearization for Robust Camera Pose and Focal Length\nEstimation\" (@cite penate2013exhaustive). In this case the function also estimates the parameters \\f$f_x\\f$ and \\f$f_y\\f$\nassuming that both have the same value. Then the cameraMatrix is updated with the estimated\nfocal length.\n-   @ref SOLVEPNP_IPPE Method is based on the paper of T. Collins and A. Bartoli.\n\"Infinitesimal Plane-Based Pose Estimation\" (@cite Collins14). This method requires coplanar object points.\n-   @ref SOLVEPNP_IPPE_SQUARE Method is based on the paper of Toby Collins and Adrien Bartoli.\n\"Infinitesimal Plane-Based Pose Estimation\" (@cite Collins14). This method is suitable for marker pose estimation.\nIt requires 4 coplanar object points defined in the following order:\n  - point 0: [-squareLength / 2,  squareLength / 2, 0]\n  - point 1: [ squareLength / 2,  squareLength / 2, 0]\n  - point 2: [ squareLength / 2, -squareLength / 2, 0]\n  - point 3: [-squareLength / 2, -squareLength / 2, 0]\n@param rvec Rotation vector used to initialize an iterative PnP refinement algorithm, when flag is @ref SOLVEPNP_ITERATIVE\nand useExtrinsicGuess is set to true.\n@param tvec Translation vector used to initialize an iterative PnP refinement algorithm, when flag is @ref SOLVEPNP_ITERATIVE\nand useExtrinsicGuess is set to true.\n@param reprojectionError Optional vector of reprojection error, that is the RMS error\n(\\f$ \\text{RMSE} = \\sqrt{\\frac{\\sum_{i}^{N} \\left ( \\hat{y_i} - y_i \\right )^2}{N}} \\f$) between the input image points\nand the 3D object points projected with the estimated pose.\n\nThe function estimates the object pose given a set of object points, their corresponding image\nprojections, as well as the camera intrinsic matrix and the distortion coefficients, see the figure below\n(more precisely, the X-axis of the camera frame is pointing to the right, the Y-axis downward\nand the Z-axis forward).\n\n![](pnp.jpg)\n\nPoints expressed in the world frame \\f$ \\bf{X}_w \\f$ are projected into the image plane \\f$ \\left[ u, v \\right] \\f$\nusing the perspective projection model \\f$ \\Pi \\f$ and the camera intrinsic parameters matrix \\f$ \\bf{A} \\f$:\n\n\\f[\n  \\begin{align*}\n  \\begin{bmatrix}\n  u \\\\\n  v \\\\\n  1\n  \\end{bmatrix} &=\n  \\bf{A} \\hspace{0.1em} \\Pi \\hspace{0.2em} ^{c}\\bf{T}_w\n  \\begin{bmatrix}\n  X_{w} \\\\\n  Y_{w} \\\\\n  Z_{w} \\\\\n  1\n  \\end{bmatrix} \\\\\n  \\begin{bmatrix}\n  u \\\\\n  v \\\\\n  1\n  \\end{bmatrix} &=\n  \\begin{bmatrix}\n  f_x & 0 & c_x \\\\\n  0 & f_y & c_y \\\\\n  0 & 0 & 1\n  \\end{bmatrix}\n  \\begin{bmatrix}\n  1 & 0 & 0 & 0 \\\\\n  0 & 1 & 0 & 0 \\\\\n  0 & 0 & 1 & 0\n  \\end{bmatrix}\n  \\begin{bmatrix}\n  r_{11} & r_{12} & r_{13} & t_x \\\\\n  r_{21} & r_{22} & r_{23} & t_y \\\\\n  r_{31} & r_{32} & r_{33} & t_z \\\\\n  0 & 0 & 0 & 1\n  \\end{bmatrix}\n  \\begin{bmatrix}\n  X_{w} \\\\\n  Y_{w} \\\\\n  Z_{w} \\\\\n  1\n  \\end{bmatrix}\n  \\end{align*}\n\\f]\n\nThe estimated pose is thus the rotation (`rvec`) and the translation (`tvec`) vectors that allow transforming\na 3D point expressed in the world frame into the camera frame:\n\n\\f[\n  \\begin{align*}\n  \\begin{bmatrix}\n  X_c \\\\\n  Y_c \\\\\n  Z_c \\\\\n  1\n  \\end{bmatrix} &=\n  \\hspace{0.2em} ^{c}\\bf{T}_w\n  \\begin{bmatrix}\n  X_{w} \\\\\n  Y_{w} \\\\\n  Z_{w} \\\\\n  1\n  \\end{bmatrix} \\\\\n  \\begin{bmatrix}\n  X_c \\\\\n  Y_c \\\\\n  Z_c \\\\\n  1\n  \\end{bmatrix} &=\n  \\begin{bmatrix}\n  r_{11} & r_{12} & r_{13} & t_x \\\\\n  r_{21} & r_{22} & r_{23} & t_y \\\\\n  r_{31} & r_{32} & r_{33} & t_z \\\\\n  0 & 0 & 0 & 1\n  \\end{bmatrix}\n  \\begin{bmatrix}\n  X_{w} \\\\\n  Y_{w} \\\\\n  Z_{w} \\\\\n  1\n  \\end{bmatrix}\n  \\end{align*}\n\\f]\n\n@note\n   -   An example of how to use solvePnP for planar augmented reality can be found at\n        opencv_source_code/samples/python/plane_ar.py\n   -   If you are using Python:\n        - Numpy array slices won't work as input because solvePnP requires contiguous\n        arrays (enforced by the assertion using cv::Mat::checkVector() around line 55 of\n        modules/calib3d/src/solvepnp.cpp version 2.4.9)\n        - The P3P algorithm requires image points to be in an array of shape (N,1,2) due\n        to its calling of #undistortPoints (around line 75 of modules/calib3d/src/solvepnp.cpp version 2.4.9)\n        which requires 2-channel information.\n        - Thus, given some data D = np.array(...) where D.shape = (N,M), in order to use a subset of\n        it as, e.g., imagePoints, one must effectively copy it into a new array: imagePoints =\n        np.ascontiguousarray(D[:,:2]).reshape((N,1,2))\n   -   The methods @ref SOLVEPNP_DLS and @ref SOLVEPNP_UPNP cannot be used as the current implementations are\n       unstable and sometimes give completely wrong results. If you pass one of these two\n       flags, @ref SOLVEPNP_EPNP method will be used instead.\n   -   The minimum number of points is 4 in the general case. In the case of @ref SOLVEPNP_P3P and @ref SOLVEPNP_AP3P\n       methods, it is required to use exactly 4 points (the first 3 points are used to estimate all the solutions\n       of the P3P problem, the last one is used to retain the best solution that minimizes the reprojection error).\n   -   With @ref SOLVEPNP_ITERATIVE method and `useExtrinsicGuess=true`, the minimum number of points is 3 (3 points\n       are sufficient to compute a pose but there are up to 4 solutions). The initial solution should be close to the\n       global solution to converge.\n   -   With @ref SOLVEPNP_IPPE input points must be >= 4 and object points must be coplanar.\n   -   With @ref SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.\n       Number of input points must be 4. Object points must be defined in the following order:\n         - point 0: [-squareLength / 2,  squareLength / 2, 0]\n         - point 1: [ squareLength / 2,  squareLength / 2, 0]\n         - point 2: [ squareLength / 2, -squareLength / 2, 0]\n         - point 3: [-squareLength / 2, -squareLength / 2, 0]\n */\nCV_EXPORTS_W int solvePnPGeneric( InputArray objectPoints, InputArray imagePoints,\n                                  InputArray cameraMatrix, InputArray distCoeffs,\n                                  OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,\n                                  bool useExtrinsicGuess = false, SolvePnPMethod flags = SOLVEPNP_ITERATIVE,\n                                  InputArray rvec = noArray(), InputArray tvec = noArray(),\n                                  OutputArray reprojectionError = noArray() );\n\n/** @brief Finds an initial camera intrinsic matrix from 3D-2D point correspondences.\n\n@param objectPoints Vector of vectors of the calibration pattern points in the calibration pattern\ncoordinate space. In the old interface all the per-view vectors are concatenated. See\n#calibrateCamera for details.\n@param imagePoints Vector of vectors of the projections of the calibration pattern points. In the\nold interface all the per-view vectors are concatenated.\n@param imageSize Image size in pixels used to initialize the principal point.\n@param aspectRatio If it is zero or negative, both \\f$f_x\\f$ and \\f$f_y\\f$ are estimated independently.\nOtherwise, \\f$f_x = f_y * \\texttt{aspectRatio}\\f$ .\n\nThe function estimates and returns an initial camera intrinsic matrix for the camera calibration process.\nCurrently, the function only supports planar calibration patterns, which are patterns where each\nobject point has z-coordinate =0.\n */\nCV_EXPORTS_W Mat initCameraMatrix2D( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints,\n                                     Size imageSize, double aspectRatio = 1.0 );\n\n/** @brief Finds the positions of internal corners of the chessboard.\n\n@param image Source chessboard view. It must be an 8-bit grayscale or color image.\n@param patternSize Number of inner corners per a chessboard row and column\n( patternSize = cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) ).\n@param corners Output array of detected corners.\n@param flags Various operation flags that can be zero or a combination of the following values:\n-   @ref CALIB_CB_ADAPTIVE_THRESH Use adaptive thresholding to convert the image to black\nand white, rather than a fixed threshold level (computed from the average image brightness).\n-   @ref CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before\napplying fixed or adaptive thresholding.\n-   @ref CALIB_CB_FILTER_QUADS Use additional criteria (like contour area, perimeter,\nsquare-like shape) to filter out false quads extracted at the contour retrieval stage.\n-   @ref CALIB_CB_FAST_CHECK Run a fast check on the image that looks for chessboard corners,\nand shortcut the call if none is found. This can drastically speed up the call in the\ndegenerate condition when no chessboard is observed.\n\nThe function attempts to determine whether the input image is a view of the chessboard pattern and\nlocate the internal chessboard corners. The function returns a non-zero value if all of the corners\nare found and they are placed in a certain order (row by row, left to right in every row).\nOtherwise, if the function fails to find all the corners or reorder them, it returns 0. For example,\na regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black\nsquares touch each other. The detected coordinates are approximate, and to determine their positions\nmore accurately, the function calls cornerSubPix. You also may use the function cornerSubPix with\ndifferent parameters if returned coordinates are not accurate enough.\n\nSample usage of detecting and drawing chessboard corners: :\n@code\n    Size patternsize(8,6); //interior number of corners\n    Mat gray = ....; //source image\n    vector<Point2f> corners; //this will be filled by the detected corners\n\n    //CALIB_CB_FAST_CHECK saves a lot of time on images\n    //that do not contain any chessboard corners\n    bool patternfound = findChessboardCorners(gray, patternsize, corners,\n            CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE\n            + CALIB_CB_FAST_CHECK);\n\n    if(patternfound)\n      cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),\n        TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));\n\n    drawChessboardCorners(img, patternsize, Mat(corners), patternfound);\n@endcode\n@note The function requires white space (like a square-thick border, the wider the better) around\nthe board to make the detection more robust in various environments. Otherwise, if there is no\nborder and the background is dark, the outer black squares cannot be segmented properly and so the\nsquare grouping and ordering algorithm fails.\n */\nCV_EXPORTS_W bool findChessboardCorners( InputArray image, Size patternSize, OutputArray corners,\n                                         int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE );\n\n/*\n   Checks whether the image contains chessboard of the specific size or not.\n   If yes, nonzero value is returned.\n*/\nCV_EXPORTS_W bool checkChessboard(InputArray img, Size size);\n\n/** @brief Finds the positions of internal corners of the chessboard using a sector based approach.\n\n@param image Source chessboard view. It must be an 8-bit grayscale or color image.\n@param patternSize Number of inner corners per a chessboard row and column\n( patternSize = cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) ).\n@param corners Output array of detected corners.\n@param flags Various operation flags that can be zero or a combination of the following values:\n-   @ref CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before detection.\n-   @ref CALIB_CB_EXHAUSTIVE Run an exhaustive search to improve detection rate.\n-   @ref CALIB_CB_ACCURACY Up sample input image to improve sub-pixel accuracy due to aliasing effects.\n-   @ref CALIB_CB_LARGER The detected pattern is allowed to be larger than patternSize (see description).\n-   @ref CALIB_CB_MARKER The detected pattern must have a marker (see description).\nThis should be used if an accurate camera calibration is required.\n@param meta Optional output arrray of detected corners (CV_8UC1 and size = cv::Size(columns,rows)).\nEach entry stands for one corner of the pattern and can have one of the following values:\n-   0 = no meta data attached\n-   1 = left-top corner of a black cell\n-   2 = left-top corner of a white cell\n-   3 = left-top corner of a black cell with a white marker dot\n-   4 = left-top corner of a white cell with a black marker dot (pattern origin in case of markers otherwise first corner)\n\nThe function is analog to #findChessboardCorners but uses a localized radon\ntransformation approximated by box filters being more robust to all sort of\nnoise, faster on larger images and is able to directly return the sub-pixel\nposition of the internal chessboard corners. The Method is based on the paper\n@cite duda2018 \"Accurate Detection and Localization of Checkerboard Corners for\nCalibration\" demonstrating that the returned sub-pixel positions are more\naccurate than the one returned by cornerSubPix allowing a precise camera\ncalibration for demanding applications.\n\nIn the case, the flags @ref CALIB_CB_LARGER or @ref CALIB_CB_MARKER are given,\nthe result can be recovered from the optional meta array. Both flags are\nhelpful to use calibration patterns exceeding the field of view of the camera.\nThese oversized patterns allow more accurate calibrations as corners can be\nutilized, which are as close as possible to the image borders.  For a\nconsistent coordinate system across all images, the optional marker (see image\nbelow) can be used to move the origin of the board to the location where the\nblack circle is located.\n\n@note The function requires a white boarder with roughly the same width as one\nof the checkerboard fields around the whole board to improve the detection in\nvarious environments. In addition, because of the localized radon\ntransformation it is beneficial to use round corners for the field corners\nwhich are located on the outside of the board. The following figure illustrates\na sample checkerboard optimized for the detection. However, any other checkerboard\ncan be used as well.\n![Checkerboard](pics/checkerboard_radon.png)\n */\nCV_EXPORTS_AS(findChessboardCornersSBWithMeta)\nbool findChessboardCornersSB(InputArray image,Size patternSize, OutputArray corners,\n                             int flags,OutputArray meta);\n/** @overload */\nCV_EXPORTS_W inline\nbool findChessboardCornersSB(InputArray image, Size patternSize, OutputArray corners,\n                             int flags = 0)\n{\n    return findChessboardCornersSB(image, patternSize, corners, flags, noArray());\n}\n\n/** @brief Estimates the sharpness of a detected chessboard.\n\nImage sharpness, as well as brightness, are a critical parameter for accuracte\ncamera calibration. For accessing these parameters for filtering out\nproblematic calibraiton images, this method calculates edge profiles by traveling from\nblack to white chessboard cell centers. Based on this, the number of pixels is\ncalculated required to transit from black to white. This width of the\ntransition area is a good indication of how sharp the chessboard is imaged\nand should be below ~3.0 pixels.\n\n@param image Gray image used to find chessboard corners\n@param patternSize Size of a found chessboard pattern\n@param corners Corners found by #findChessboardCornersSB\n@param rise_distance Rise distance 0.8 means 10% ... 90% of the final signal strength\n@param vertical By default edge responses for horizontal lines are calculated\n@param sharpness Optional output array with a sharpness value for calculated edge responses (see description)\n\nThe optional sharpness array is of type CV_32FC1 and has for each calculated\nprofile one row with the following five entries:\n* 0 = x coordinate of the underlying edge in the image\n* 1 = y coordinate of the underlying edge in the image\n* 2 = width of the transition area (sharpness)\n* 3 = signal strength in the black cell (min brightness)\n* 4 = signal strength in the white cell (max brightness)\n\n@return Scalar(average sharpness, average min brightness, average max brightness,0)\n*/\nCV_EXPORTS_W Scalar estimateChessboardSharpness(InputArray image, Size patternSize, InputArray corners,\n                                                float rise_distance=0.8F,bool vertical=false,\n                                                OutputArray sharpness=noArray());\n\n\n//! finds subpixel-accurate positions of the chessboard corners\nCV_EXPORTS_W bool find4QuadCornerSubpix( InputArray img, InputOutputArray corners, Size region_size );\n\n/** @brief Renders the detected chessboard corners.\n\n@param image Destination image. It must be an 8-bit color image.\n@param patternSize Number of inner corners per a chessboard row and column\n(patternSize = cv::Size(points_per_row,points_per_column)).\n@param corners Array of detected corners, the output of #findChessboardCorners.\n@param patternWasFound Parameter indicating whether the complete board was found or not. The\nreturn value of #findChessboardCorners should be passed here.\n\nThe function draws individual chessboard corners detected either as red circles if the board was not\nfound, or as colored corners connected with lines if the board was found.\n */\nCV_EXPORTS_W void drawChessboardCorners( InputOutputArray image, Size patternSize,\n                                         InputArray corners, bool patternWasFound );\n\n/** @brief Draw axes of the world/object coordinate system from pose estimation. @sa solvePnP\n\n@param image Input/output image. It must have 1 or 3 channels. The number of channels is not altered.\n@param cameraMatrix Input 3x3 floating-point matrix of camera intrinsic parameters.\n\\f$\\cameramatrix{A}\\f$\n@param distCoeffs Input vector of distortion coefficients\n\\f$\\distcoeffs\\f$. If the vector is empty, the zero distortion coefficients are assumed.\n@param rvec Rotation vector (see @ref Rodrigues ) that, together with tvec, brings points from\nthe model coordinate system to the camera coordinate system.\n@param tvec Translation vector.\n@param length Length of the painted axes in the same unit than tvec (usually in meters).\n@param thickness Line thickness of the painted axes.\n\nThis function draws the axes of the world/object coordinate system w.r.t. to the camera frame.\nOX is drawn in red, OY in green and OZ in blue.\n */\nCV_EXPORTS_W void drawFrameAxes(InputOutputArray image, InputArray cameraMatrix, InputArray distCoeffs,\n                                InputArray rvec, InputArray tvec, float length, int thickness=3);\n\nstruct CV_EXPORTS_W_SIMPLE CirclesGridFinderParameters\n{\n    CV_WRAP CirclesGridFinderParameters();\n    CV_PROP_RW cv::Size2f densityNeighborhoodSize;\n    CV_PROP_RW float minDensity;\n    CV_PROP_RW int kmeansAttempts;\n    CV_PROP_RW int minDistanceToAddKeypoint;\n    CV_PROP_RW int keypointScale;\n    CV_PROP_RW float minGraphConfidence;\n    CV_PROP_RW float vertexGain;\n    CV_PROP_RW float vertexPenalty;\n    CV_PROP_RW float existingVertexGain;\n    CV_PROP_RW float edgeGain;\n    CV_PROP_RW float edgePenalty;\n    CV_PROP_RW float convexHullFactor;\n    CV_PROP_RW float minRNGEdgeSwitchDist;\n\n    enum GridType\n    {\n      SYMMETRIC_GRID, ASYMMETRIC_GRID\n    };\n    GridType gridType;\n\n    CV_PROP_RW float squareSize; //!< Distance between two adjacent points. Used by CALIB_CB_CLUSTERING.\n    CV_PROP_RW float maxRectifiedDistance; //!< Max deviation from prediction. Used by CALIB_CB_CLUSTERING.\n};\n\n#ifndef DISABLE_OPENCV_3_COMPATIBILITY\ntypedef CirclesGridFinderParameters CirclesGridFinderParameters2;\n#endif\n\n/** @brief Finds centers in the grid of circles.\n\n@param image grid view of input circles; it must be an 8-bit grayscale or color image.\n@param patternSize number of circles per row and column\n( patternSize = Size(points_per_row, points_per_colum) ).\n@param centers output array of detected centers.\n@param flags various operation flags that can be one of the following values:\n-   @ref CALIB_CB_SYMMETRIC_GRID uses symmetric pattern of circles.\n-   @ref CALIB_CB_ASYMMETRIC_GRID uses asymmetric pattern of circles.\n-   @ref CALIB_CB_CLUSTERING uses a special algorithm for grid detection. It is more robust to\nperspective distortions but much more sensitive to background clutter.\n@param blobDetector feature detector that finds blobs like dark circles on light background.\n                    If `blobDetector` is NULL then `image` represents Point2f array of candidates.\n@param parameters struct for finding circles in a grid pattern.\n\nThe function attempts to determine whether the input image contains a grid of circles. If it is, the\nfunction locates centers of the circles. The function returns a non-zero value if all of the centers\nhave been found and they have been placed in a certain order (row by row, left to right in every\nrow). Otherwise, if the function fails to find all the corners or reorder them, it returns 0.\n\nSample usage of detecting and drawing the centers of circles: :\n@code\n    Size patternsize(7,7); //number of centers\n    Mat gray = ...; //source image\n    vector<Point2f> centers; //this will be filled by the detected centers\n\n    bool patternfound = findCirclesGrid(gray, patternsize, centers);\n\n    drawChessboardCorners(img, patternsize, Mat(centers), patternfound);\n@endcode\n@note The function requires white space (like a square-thick border, the wider the better) around\nthe board to make the detection more robust in various environments.\n */\nCV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize,\n                                   OutputArray centers, int flags,\n                                   const Ptr<FeatureDetector> &blobDetector,\n                                   const CirclesGridFinderParameters& parameters);\n\n/** @overload */\nCV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize,\n                                   OutputArray centers, int flags = CALIB_CB_SYMMETRIC_GRID,\n                                   const Ptr<FeatureDetector> &blobDetector = SimpleBlobDetector::create());\n\n/** @brief Finds the camera intrinsic and extrinsic parameters from several views of a calibration\npattern.\n\n@param objectPoints In the new interface it is a vector of vectors of calibration pattern points in\nthe calibration pattern coordinate space (e.g. std::vector<std::vector<cv::Vec3f>>). The outer\nvector contains as many elements as the number of pattern views. If the same calibration pattern\nis shown in each view and it is fully visible, all the vectors will be the same. Although, it is\npossible to use partially occluded patterns or even different patterns in different views. Then,\nthe vectors will be different. Although the points are 3D, they all lie in the calibration pattern's\nXY coordinate plane (thus 0 in the Z-coordinate), if the used calibration pattern is a planar rig.\nIn the old interface all the vectors of object points from different views are concatenated\ntogether.\n@param imagePoints In the new interface it is a vector of vectors of the projections of calibration\npattern points (e.g. std::vector<std::vector<cv::Vec2f>>). imagePoints.size() and\nobjectPoints.size(), and imagePoints[i].size() and objectPoints[i].size() for each i, must be equal,\nrespectively. In the old interface all the vectors of object points from different views are\nconcatenated together.\n@param imageSize Size of the image used only to initialize the camera intrinsic matrix.\n@param cameraMatrix Input/output 3x3 floating-point camera intrinsic matrix\n\\f$\\cameramatrix{A}\\f$ . If @ref CALIB_USE_INTRINSIC_GUESS\nand/or @ref CALIB_FIX_ASPECT_RATIO, @ref CALIB_FIX_PRINCIPAL_POINT or @ref CALIB_FIX_FOCAL_LENGTH\nare specified, some or all of fx, fy, cx, cy must be initialized before calling the function.\n@param distCoeffs Input/output vector of distortion coefficients\n\\f$\\distcoeffs\\f$.\n@param rvecs Output vector of rotation vectors (@ref Rodrigues ) estimated for each pattern view\n(e.g. std::vector<cv::Mat>>). That is, each i-th rotation vector together with the corresponding\ni-th translation vector (see the next output parameter description) brings the calibration pattern\nfrom the object coordinate space (in which object points are specified) to the camera coordinate\nspace. In more technical terms, the tuple of the i-th rotation and translation vector performs\na change of basis from object coordinate space to camera coordinate space. Due to its duality, this\ntuple is equivalent to the position of the calibration pattern with respect to the camera coordinate\nspace.\n@param tvecs Output vector of translation vectors estimated for each pattern view, see parameter\ndescribtion above.\n@param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic\nparameters. Order of deviations values:\n\\f$(f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,\n s_4, \\tau_x, \\tau_y)\\f$ If one of parameters is not estimated, it's deviation is equals to zero.\n@param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic\nparameters. Order of deviations values: \\f$(R_0, T_0, \\dotsc , R_{M - 1}, T_{M - 1})\\f$ where M is\nthe number of pattern views. \\f$R_i, T_i\\f$ are concatenated 1x3 vectors.\n @param perViewErrors Output vector of the RMS re-projection error estimated for each pattern view.\n@param flags Different flags that may be zero or a combination of the following values:\n-   @ref CALIB_USE_INTRINSIC_GUESS cameraMatrix contains valid initial values of\nfx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image\ncenter ( imageSize is used), and focal distances are computed in a least-squares fashion.\nNote, that if intrinsic parameters are known, there is no need to use this function just to\nestimate extrinsic parameters. Use @ref solvePnP instead.\n-   @ref CALIB_FIX_PRINCIPAL_POINT The principal point is not changed during the global\noptimization. It stays at the center or at a different location specified when\n @ref CALIB_USE_INTRINSIC_GUESS is set too.\n-   @ref CALIB_FIX_ASPECT_RATIO The functions consider only fy as a free parameter. The\nratio fx/fy stays the same as in the input cameraMatrix . When\n @ref CALIB_USE_INTRINSIC_GUESS is not set, the actual input values of fx and fy are\nignored, only their ratio is computed and used further.\n-   @ref CALIB_ZERO_TANGENT_DIST Tangential distortion coefficients \\f$(p_1, p_2)\\f$ are set\nto zeros and stay zero.\n-   @ref CALIB_FIX_FOCAL_LENGTH The focal length is not changed during the global optimization if\n @ref CALIB_USE_INTRINSIC_GUESS is set.\n-   @ref CALIB_FIX_K1,..., @ref CALIB_FIX_K6 The corresponding radial distortion\ncoefficient is not changed during the optimization. If @ref CALIB_USE_INTRINSIC_GUESS is\nset, the coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to 0.\n-   @ref CALIB_RATIONAL_MODEL Coefficients k4, k5, and k6 are enabled. To provide the\nbackward compatibility, this extra flag should be explicitly specified to make the\ncalibration function use the rational model and return 8 coefficients or more.\n-   @ref CALIB_THIN_PRISM_MODEL Coefficients s1, s2, s3 and s4 are enabled. To provide the\nbackward compatibility, this extra flag should be explicitly specified to make the\ncalibration function use the thin prism model and return 12 coefficients or more.\n-   @ref CALIB_FIX_S1_S2_S3_S4 The thin prism distortion coefficients are not changed during\nthe optimization. If @ref CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the\nsupplied distCoeffs matrix is used. Otherwise, it is set to 0.\n-   @ref CALIB_TILTED_MODEL Coefficients tauX and tauY are enabled. To provide the\nbackward compatibility, this extra flag should be explicitly specified to make the\ncalibration function use the tilted sensor model and return 14 coefficients.\n-   @ref CALIB_FIX_TAUX_TAUY The coefficients of the tilted sensor model are not changed during\nthe optimization. If @ref CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the\nsupplied distCoeffs matrix is used. Otherwise, it is set to 0.\n@param criteria Termination criteria for the iterative optimization algorithm.\n\n@return the overall RMS re-projection error.\n\nThe function estimates the intrinsic camera parameters and extrinsic parameters for each of the\nviews. The algorithm is based on @cite Zhang2000 and @cite BouguetMCT . The coordinates of 3D object\npoints and their corresponding 2D projections in each view must be specified. That may be achieved\nby using an object with known geometry and easily detectable feature points. Such an object is\ncalled a calibration rig or calibration pattern, and OpenCV has built-in support for a chessboard as\na calibration rig (see @ref findChessboardCorners). Currently, initialization of intrinsic\nparameters (when @ref CALIB_USE_INTRINSIC_GUESS is not set) is only implemented for planar calibration\npatterns (where Z-coordinates of the object points must be all zeros). 3D calibration rigs can also\nbe used as long as initial cameraMatrix is provided.\n\nThe algorithm performs the following steps:\n\n-   Compute the initial intrinsic parameters (the option only available for planar calibration\n    patterns) or read them from the input parameters. The distortion coefficients are all set to\n    zeros initially unless some of CALIB_FIX_K? are specified.\n\n-   Estimate the initial camera pose as if the intrinsic parameters have been already known. This is\n    done using @ref solvePnP .\n\n-   Run the global Levenberg-Marquardt optimization algorithm to minimize the reprojection error,\n    that is, the total sum of squared distances between the observed feature points imagePoints and\n    the projected (using the current estimates for camera parameters and the poses) object points\n    objectPoints. See @ref projectPoints for details.\n\n@note\n    If you use a non-square (i.e. non-N-by-N) grid and @ref findChessboardCorners for calibration,\n    and @ref calibrateCamera returns bad values (zero distortion coefficients, \\f$c_x\\f$ and\n    \\f$c_y\\f$ very far from the image center, and/or large differences between \\f$f_x\\f$ and\n    \\f$f_y\\f$ (ratios of 10:1 or more)), then you are probably using patternSize=cvSize(rows,cols)\n    instead of using patternSize=cvSize(cols,rows) in @ref findChessboardCorners.\n\n@sa\n   calibrateCameraRO, findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate,\n   undistort\n */\nCV_EXPORTS_AS(calibrateCameraExtended) double calibrateCamera( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints, Size imageSize,\n                                     InputOutputArray cameraMatrix, InputOutputArray distCoeffs,\n                                     OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,\n                                     OutputArray stdDeviationsIntrinsics,\n                                     OutputArray stdDeviationsExtrinsics,\n                                     OutputArray perViewErrors,\n                                     int flags = 0, TermCriteria criteria = TermCriteria(\n                                        TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) );\n\n/** @overload */\nCV_EXPORTS_W double calibrateCamera( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints, Size imageSize,\n                                     InputOutputArray cameraMatrix, InputOutputArray distCoeffs,\n                                     OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,\n                                     int flags = 0, TermCriteria criteria = TermCriteria(\n                                        TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) );\n\n/** @brief Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.\n\nThis function is an extension of #calibrateCamera with the method of releasing object which was\nproposed in @cite strobl2011iccv. In many common cases with inaccurate, unmeasured, roughly planar\ntargets (calibration plates), this method can dramatically improve the precision of the estimated\ncamera parameters. Both the object-releasing method and standard method are supported by this\nfunction. Use the parameter **iFixedPoint** for method selection. In the internal implementation,\n#calibrateCamera is a wrapper for this function.\n\n@param objectPoints Vector of vectors of calibration pattern points in the calibration pattern\ncoordinate space. See #calibrateCamera for details. If the method of releasing object to be used,\nthe identical calibration board must be used in each view and it must be fully visible, and all\nobjectPoints[i] must be the same and all points should be roughly close to a plane. **The calibration\ntarget has to be rigid, or at least static if the camera (rather than the calibration target) is\nshifted for grabbing images.**\n@param imagePoints Vector of vectors of the projections of calibration pattern points. See\n#calibrateCamera for details.\n@param imageSize Size of the image used only to initialize the intrinsic camera matrix.\n@param iFixedPoint The index of the 3D object point in objectPoints[0] to be fixed. It also acts as\na switch for calibration method selection. If object-releasing method to be used, pass in the\nparameter in the range of [1, objectPoints[0].size()-2], otherwise a value out of this range will\nmake standard calibration method selected. Usually the top-right corner point of the calibration\nboard grid is recommended to be fixed when object-releasing method being utilized. According to\n\\cite strobl2011iccv, two other points are also fixed. In this implementation, objectPoints[0].front\nand objectPoints[0].back.z are used. With object-releasing method, accurate rvecs, tvecs and\nnewObjPoints are only possible if coordinates of these three fixed points are accurate enough.\n@param cameraMatrix Output 3x3 floating-point camera matrix. See #calibrateCamera for details.\n@param distCoeffs Output vector of distortion coefficients. See #calibrateCamera for details.\n@param rvecs Output vector of rotation vectors estimated for each pattern view. See #calibrateCamera\nfor details.\n@param tvecs Output vector of translation vectors estimated for each pattern view.\n@param newObjPoints The updated output vector of calibration pattern points. The coordinates might\nbe scaled based on three fixed points. The returned coordinates are accurate only if the above\nmentioned three fixed points are accurate. If not needed, noArray() can be passed in. This parameter\nis ignored with standard calibration method.\n@param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters.\nSee #calibrateCamera for details.\n@param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters.\nSee #calibrateCamera for details.\n@param stdDeviationsObjPoints Output vector of standard deviations estimated for refined coordinates\nof calibration pattern points. It has the same size and order as objectPoints[0] vector. This\nparameter is ignored with standard calibration method.\n @param perViewErrors Output vector of the RMS re-projection error estimated for each pattern view.\n@param flags Different flags that may be zero or a combination of some predefined values. See\n#calibrateCamera for details. If the method of releasing object is used, the calibration time may\nbe much longer. CALIB_USE_QR or CALIB_USE_LU could be used for faster calibration with potentially\nless precise and less stable in some rare cases.\n@param criteria Termination criteria for the iterative optimization algorithm.\n\n@return the overall RMS re-projection error.\n\nThe function estimates the intrinsic camera parameters and extrinsic parameters for each of the\nviews. The algorithm is based on @cite Zhang2000, @cite BouguetMCT and @cite strobl2011iccv. See\n#calibrateCamera for other detailed explanations.\n@sa\n   calibrateCamera, findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort\n */\nCV_EXPORTS_AS(calibrateCameraROExtended) double calibrateCameraRO( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints, Size imageSize, int iFixedPoint,\n                                     InputOutputArray cameraMatrix, InputOutputArray distCoeffs,\n                                     OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,\n                                     OutputArray newObjPoints,\n                                     OutputArray stdDeviationsIntrinsics,\n                                     OutputArray stdDeviationsExtrinsics,\n                                     OutputArray stdDeviationsObjPoints,\n                                     OutputArray perViewErrors,\n                                     int flags = 0, TermCriteria criteria = TermCriteria(\n                                        TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) );\n\n/** @overload */\nCV_EXPORTS_W double calibrateCameraRO( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints, Size imageSize, int iFixedPoint,\n                                     InputOutputArray cameraMatrix, InputOutputArray distCoeffs,\n                                     OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,\n                                     OutputArray newObjPoints,\n                                     int flags = 0, TermCriteria criteria = TermCriteria(\n                                        TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) );\n\n/** @brief Computes useful camera characteristics from the camera intrinsic matrix.\n\n@param cameraMatrix Input camera intrinsic matrix that can be estimated by #calibrateCamera or\n#stereoCalibrate .\n@param imageSize Input image size in pixels.\n@param apertureWidth Physical width in mm of the sensor.\n@param apertureHeight Physical height in mm of the sensor.\n@param fovx Output field of view in degrees along the horizontal sensor axis.\n@param fovy Output field of view in degrees along the vertical sensor axis.\n@param focalLength Focal length of the lens in mm.\n@param principalPoint Principal point in mm.\n@param aspectRatio \\f$f_y/f_x\\f$\n\nThe function computes various useful camera characteristics from the previously estimated camera\nmatrix.\n\n@note\n   Do keep in mind that the unity measure 'mm' stands for whatever unit of measure one chooses for\n    the chessboard pitch (it can thus be any value).\n */\nCV_EXPORTS_W void calibrationMatrixValues( InputArray cameraMatrix, Size imageSize,\n                                           double apertureWidth, double apertureHeight,\n                                           CV_OUT double& fovx, CV_OUT double& fovy,\n                                           CV_OUT double& focalLength, CV_OUT Point2d& principalPoint,\n                                           CV_OUT double& aspectRatio );\n\n/** @brief Calibrates a stereo camera set up. This function finds the intrinsic parameters\nfor each of the two cameras and the extrinsic parameters between the two cameras.\n\n@param objectPoints Vector of vectors of the calibration pattern points. The same structure as\nin @ref calibrateCamera. For each pattern view, both cameras need to see the same object\npoints. Therefore, objectPoints.size(), imagePoints1.size(), and imagePoints2.size() need to be\nequal as well as objectPoints[i].size(), imagePoints1[i].size(), and imagePoints2[i].size() need to\nbe equal for each i.\n@param imagePoints1 Vector of vectors of the projections of the calibration pattern points,\nobserved by the first camera. The same structure as in @ref calibrateCamera.\n@param imagePoints2 Vector of vectors of the projections of the calibration pattern points,\nobserved by the second camera. The same structure as in @ref calibrateCamera.\n@param cameraMatrix1 Input/output camera intrinsic matrix for the first camera, the same as in\n@ref calibrateCamera. Furthermore, for the stereo case, additional flags may be used, see below.\n@param distCoeffs1 Input/output vector of distortion coefficients, the same as in\n@ref calibrateCamera.\n@param cameraMatrix2 Input/output second camera intrinsic matrix for the second camera. See description for\ncameraMatrix1.\n@param distCoeffs2 Input/output lens distortion coefficients for the second camera. See\ndescription for distCoeffs1.\n@param imageSize Size of the image used only to initialize the camera intrinsic matrices.\n@param R Output rotation matrix. Together with the translation vector T, this matrix brings\npoints given in the first camera's coordinate system to points in the second camera's\ncoordinate system. In more technical terms, the tuple of R and T performs a change of basis\nfrom the first camera's coordinate system to the second camera's coordinate system. Due to its\nduality, this tuple is equivalent to the position of the first camera with respect to the\nsecond camera coordinate system.\n@param T Output translation vector, see description above.\n@param E Output essential matrix.\n@param F Output fundamental matrix.\n@param perViewErrors Output vector of the RMS re-projection error estimated for each pattern view.\n@param flags Different flags that may be zero or a combination of the following values:\n-   @ref CALIB_FIX_INTRINSIC Fix cameraMatrix? and distCoeffs? so that only R, T, E, and F\nmatrices are estimated.\n-   @ref CALIB_USE_INTRINSIC_GUESS Optimize some or all of the intrinsic parameters\naccording to the specified flags. Initial values are provided by the user.\n-   @ref CALIB_USE_EXTRINSIC_GUESS R and T contain valid initial values that are optimized further.\nOtherwise R and T are initialized to the median value of the pattern views (each dimension separately).\n-   @ref CALIB_FIX_PRINCIPAL_POINT Fix the principal points during the optimization.\n-   @ref CALIB_FIX_FOCAL_LENGTH Fix \\f$f^{(j)}_x\\f$ and \\f$f^{(j)}_y\\f$ .\n-   @ref CALIB_FIX_ASPECT_RATIO Optimize \\f$f^{(j)}_y\\f$ . Fix the ratio \\f$f^{(j)}_x/f^{(j)}_y\\f$\n.\n-   @ref CALIB_SAME_FOCAL_LENGTH Enforce \\f$f^{(0)}_x=f^{(1)}_x\\f$ and \\f$f^{(0)}_y=f^{(1)}_y\\f$ .\n-   @ref CALIB_ZERO_TANGENT_DIST Set tangential distortion coefficients for each camera to\nzeros and fix there.\n-   @ref CALIB_FIX_K1,..., @ref CALIB_FIX_K6 Do not change the corresponding radial\ndistortion coefficient during the optimization. If @ref CALIB_USE_INTRINSIC_GUESS is set,\nthe coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to 0.\n-   @ref CALIB_RATIONAL_MODEL Enable coefficients k4, k5, and k6. To provide the backward\ncompatibility, this extra flag should be explicitly specified to make the calibration\nfunction use the rational model and return 8 coefficients. If the flag is not set, the\nfunction computes and returns only 5 distortion coefficients.\n-   @ref CALIB_THIN_PRISM_MODEL Coefficients s1, s2, s3 and s4 are enabled. To provide the\nbackward compatibility, this extra flag should be explicitly specified to make the\ncalibration function use the thin prism model and return 12 coefficients. If the flag is not\nset, the function computes and returns only 5 distortion coefficients.\n-   @ref CALIB_FIX_S1_S2_S3_S4 The thin prism distortion coefficients are not changed during\nthe optimization. If @ref CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the\nsupplied distCoeffs matrix is used. Otherwise, it is set to 0.\n-   @ref CALIB_TILTED_MODEL Coefficients tauX and tauY are enabled. To provide the\nbackward compatibility, this extra flag should be explicitly specified to make the\ncalibration function use the tilted sensor model and return 14 coefficients. If the flag is not\nset, the function computes and returns only 5 distortion coefficients.\n-   @ref CALIB_FIX_TAUX_TAUY The coefficients of the tilted sensor model are not changed during\nthe optimization. If @ref CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the\nsupplied distCoeffs matrix is used. Otherwise, it is set to 0.\n@param criteria Termination criteria for the iterative optimization algorithm.\n\nThe function estimates the transformation between two cameras making a stereo pair. If one computes\nthe poses of an object relative to the first camera and to the second camera,\n( \\f$R_1\\f$,\\f$T_1\\f$ ) and (\\f$R_2\\f$,\\f$T_2\\f$), respectively, for a stereo camera where the\nrelative position and orientation between the two cameras are fixed, then those poses definitely\nrelate to each other. This means, if the relative position and orientation (\\f$R\\f$,\\f$T\\f$) of the\ntwo cameras is known, it is possible to compute (\\f$R_2\\f$,\\f$T_2\\f$) when (\\f$R_1\\f$,\\f$T_1\\f$) is\ngiven. This is what the described function does. It computes (\\f$R\\f$,\\f$T\\f$) such that:\n\n\\f[R_2=R R_1\\f]\n\\f[T_2=R T_1 + T.\\f]\n\nTherefore, one can compute the coordinate representation of a 3D point for the second camera's\ncoordinate system when given the point's coordinate representation in the first camera's coordinate\nsystem:\n\n\\f[\\begin{bmatrix}\nX_2 \\\\\nY_2 \\\\\nZ_2 \\\\\n1\n\\end{bmatrix} = \\begin{bmatrix}\nR & T \\\\\n0 & 1\n\\end{bmatrix} \\begin{bmatrix}\nX_1 \\\\\nY_1 \\\\\nZ_1 \\\\\n1\n\\end{bmatrix}.\\f]\n\n\nOptionally, it computes the essential matrix E:\n\n\\f[E= \\vecthreethree{0}{-T_2}{T_1}{T_2}{0}{-T_0}{-T_1}{T_0}{0} R\\f]\n\nwhere \\f$T_i\\f$ are components of the translation vector \\f$T\\f$ : \\f$T=[T_0, T_1, T_2]^T\\f$ .\nAnd the function can also compute the fundamental matrix F:\n\n\\f[F = cameraMatrix2^{-T}\\cdot E \\cdot cameraMatrix1^{-1}\\f]\n\nBesides the stereo-related information, the function can also perform a full calibration of each of\nthe two cameras. However, due to the high dimensionality of the parameter space and noise in the\ninput data, the function can diverge from the correct solution. If the intrinsic parameters can be\nestimated with high accuracy for each of the cameras individually (for example, using\n#calibrateCamera ), you are recommended to do so and then pass @ref CALIB_FIX_INTRINSIC flag to the\nfunction along with the computed intrinsic parameters. Otherwise, if all the parameters are\nestimated at once, it makes sense to restrict some parameters, for example, pass\n @ref CALIB_SAME_FOCAL_LENGTH and @ref CALIB_ZERO_TANGENT_DIST flags, which is usually a\nreasonable assumption.\n\nSimilarly to #calibrateCamera, the function minimizes the total re-projection error for all the\npoints in all the available views from both cameras. The function returns the final value of the\nre-projection error.\n */\nCV_EXPORTS_AS(stereoCalibrateExtended) double stereoCalibrate( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2,\n                                     InputOutputArray cameraMatrix1, InputOutputArray distCoeffs1,\n                                     InputOutputArray cameraMatrix2, InputOutputArray distCoeffs2,\n                                     Size imageSize, InputOutputArray R,InputOutputArray T, OutputArray E, OutputArray F,\n                                     OutputArray perViewErrors, int flags = CALIB_FIX_INTRINSIC,\n                                     TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6) );\n\n/// @overload\nCV_EXPORTS_W double stereoCalibrate( InputArrayOfArrays objectPoints,\n                                     InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2,\n                                     InputOutputArray cameraMatrix1, InputOutputArray distCoeffs1,\n                                     InputOutputArray cameraMatrix2, InputOutputArray distCoeffs2,\n                                     Size imageSize, OutputArray R,OutputArray T, OutputArray E, OutputArray F,\n                                     int flags = CALIB_FIX_INTRINSIC,\n                                     TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6) );\n\n/** @brief Computes rectification transforms for each head of a calibrated stereo camera.\n\n@param cameraMatrix1 First camera intrinsic matrix.\n@param distCoeffs1 First camera distortion parameters.\n@param cameraMatrix2 Second camera intrinsic matrix.\n@param distCoeffs2 Second camera distortion parameters.\n@param imageSize Size of the image used for stereo calibration.\n@param R Rotation matrix from the coordinate system of the first camera to the second camera,\nsee @ref stereoCalibrate.\n@param T Translation vector from the coordinate system of the first camera to the second camera,\nsee @ref stereoCalibrate.\n@param R1 Output 3x3 rectification transform (rotation matrix) for the first camera. This matrix\nbrings points given in the unrectified first camera's coordinate system to points in the rectified\nfirst camera's coordinate system. In more technical terms, it performs a change of basis from the\nunrectified first camera's coordinate system to the rectified first camera's coordinate system.\n@param R2 Output 3x3 rectification transform (rotation matrix) for the second camera. This matrix\nbrings points given in the unrectified second camera's coordinate system to points in the rectified\nsecond camera's coordinate system. In more technical terms, it performs a change of basis from the\nunrectified second camera's coordinate system to the rectified second camera's coordinate system.\n@param P1 Output 3x4 projection matrix in the new (rectified) coordinate systems for the first\ncamera, i.e. it projects points given in the rectified first camera coordinate system into the\nrectified first camera's image.\n@param P2 Output 3x4 projection matrix in the new (rectified) coordinate systems for the second\ncamera, i.e. it projects points given in the rectified first camera coordinate system into the\nrectified second camera's image.\n@param Q Output \\f$4 \\times 4\\f$ disparity-to-depth mapping matrix (see @ref reprojectImageTo3D).\n@param flags Operation flags that may be zero or @ref CALIB_ZERO_DISPARITY . If the flag is set,\nthe function makes the principal points of each camera have the same pixel coordinates in the\nrectified views. And if the flag is not set, the function may still shift the images in the\nhorizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the\nuseful image area.\n@param alpha Free scaling parameter. If it is -1 or absent, the function performs the default\nscaling. Otherwise, the parameter should be between 0 and 1. alpha=0 means that the rectified\nimages are zoomed and shifted so that only valid pixels are visible (no black areas after\nrectification). alpha=1 means that the rectified image is decimated and shifted so that all the\npixels from the original images from the cameras are retained in the rectified images (no source\nimage pixels are lost). Any intermediate value yields an intermediate result between\nthose two extreme cases.\n@param newImageSize New image resolution after rectification. The same size should be passed to\n#initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0)\nis passed (default), it is set to the original imageSize . Setting it to a larger value can help you\npreserve details in the original image, especially when there is a big radial distortion.\n@param validPixROI1 Optional output rectangles inside the rectified images where all the pixels\nare valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller\n(see the picture below).\n@param validPixROI2 Optional output rectangles inside the rectified images where all the pixels\nare valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller\n(see the picture below).\n\nThe function computes the rotation matrices for each camera that (virtually) make both camera image\nplanes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies\nthe dense stereo correspondence problem. The function takes the matrices computed by #stereoCalibrate\nas input. As output, it provides two rotation matrices and also two projection matrices in the new\ncoordinates. The function distinguishes the following two cases:\n\n-   **Horizontal stereo**: the first and the second camera views are shifted relative to each other\n    mainly along the x-axis (with possible small vertical shift). In the rectified images, the\n    corresponding epipolar lines in the left and right cameras are horizontal and have the same\n    y-coordinate. P1 and P2 look like:\n\n    \\f[\\texttt{P1} = \\begin{bmatrix}\n                        f & 0 & cx_1 & 0 \\\\\n                        0 & f & cy & 0 \\\\\n                        0 & 0 & 1 & 0\n                     \\end{bmatrix}\\f]\n\n    \\f[\\texttt{P2} = \\begin{bmatrix}\n                        f & 0 & cx_2 & T_x*f \\\\\n                        0 & f & cy & 0 \\\\\n                        0 & 0 & 1 & 0\n                     \\end{bmatrix} ,\\f]\n\n    where \\f$T_x\\f$ is a horizontal shift between the cameras and \\f$cx_1=cx_2\\f$ if\n    @ref CALIB_ZERO_DISPARITY is set.\n\n-   **Vertical stereo**: the first and the second camera views are shifted relative to each other\n    mainly in the vertical direction (and probably a bit in the horizontal direction too). The epipolar\n    lines in the rectified images are vertical and have the same x-coordinate. P1 and P2 look like:\n\n    \\f[\\texttt{P1} = \\begin{bmatrix}\n                        f & 0 & cx & 0 \\\\\n                        0 & f & cy_1 & 0 \\\\\n                        0 & 0 & 1 & 0\n                     \\end{bmatrix}\\f]\n\n    \\f[\\texttt{P2} = \\begin{bmatrix}\n                        f & 0 & cx & 0 \\\\\n                        0 & f & cy_2 & T_y*f \\\\\n                        0 & 0 & 1 & 0\n                     \\end{bmatrix},\\f]\n\n    where \\f$T_y\\f$ is a vertical shift between the cameras and \\f$cy_1=cy_2\\f$ if\n    @ref CALIB_ZERO_DISPARITY is set.\n\nAs you can see, the first three columns of P1 and P2 will effectively be the new \"rectified\" camera\nmatrices. The matrices, together with R1 and R2 , can then be passed to #initUndistortRectifyMap to\ninitialize the rectification map for each camera.\n\nSee below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through\nthe corresponding image regions. This means that the images are well rectified, which is what most\nstereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that\ntheir interiors are all valid pixels.\n\n![image](pics/stereo_undistort.jpg)\n */\nCV_EXPORTS_W void stereoRectify( InputArray cameraMatrix1, InputArray distCoeffs1,\n                                 InputArray cameraMatrix2, InputArray distCoeffs2,\n                                 Size imageSize, InputArray R, InputArray T,\n                                 OutputArray R1, OutputArray R2,\n                                 OutputArray P1, OutputArray P2,\n                                 OutputArray Q, int flags = CALIB_ZERO_DISPARITY,\n                                 double alpha = -1, Size newImageSize = Size(),\n                                 CV_OUT Rect* validPixROI1 = 0, CV_OUT Rect* validPixROI2 = 0 );\n\n/** @brief Computes a rectification transform for an uncalibrated stereo camera.\n\n@param points1 Array of feature points in the first image.\n@param points2 The corresponding points in the second image. The same formats as in\n#findFundamentalMat are supported.\n@param F Input fundamental matrix. It can be computed from the same set of point pairs using\n#findFundamentalMat .\n@param imgSize Size of the image.\n@param H1 Output rectification homography matrix for the first image.\n@param H2 Output rectification homography matrix for the second image.\n@param threshold Optional threshold used to filter out the outliers. If the parameter is greater\nthan zero, all the point pairs that do not comply with the epipolar geometry (that is, the points\nfor which \\f$|\\texttt{points2[i]}^T*\\texttt{F}*\\texttt{points1[i]}|>\\texttt{threshold}\\f$ ) are\nrejected prior to computing the homographies. Otherwise, all the points are considered inliers.\n\nThe function computes the rectification transformations without knowing intrinsic parameters of the\ncameras and their relative position in the space, which explains the suffix \"uncalibrated\". Another\nrelated difference from #stereoRectify is that the function outputs not the rectification\ntransformations in the object (3D) space, but the planar perspective transformations encoded by the\nhomography matrices H1 and H2 . The function implements the algorithm @cite Hartley99 .\n\n@note\n   While the algorithm does not need to know the intrinsic parameters of the cameras, it heavily\n    depends on the epipolar geometry. Therefore, if the camera lenses have a significant distortion,\n    it would be better to correct it before computing the fundamental matrix and calling this\n    function. For example, distortion coefficients can be estimated for each head of stereo camera\n    separately by using #calibrateCamera . Then, the images can be corrected using #undistort , or\n    just the point coordinates can be corrected with #undistortPoints .\n */\nCV_EXPORTS_W bool stereoRectifyUncalibrated( InputArray points1, InputArray points2,\n                                             InputArray F, Size imgSize,\n                                             OutputArray H1, OutputArray H2,\n                                             double threshold = 5 );\n\n//! computes the rectification transformations for 3-head camera, where all the heads are on the same line.\nCV_EXPORTS_W float rectify3Collinear( InputArray cameraMatrix1, InputArray distCoeffs1,\n                                      InputArray cameraMatrix2, InputArray distCoeffs2,\n                                      InputArray cameraMatrix3, InputArray distCoeffs3,\n                                      InputArrayOfArrays imgpt1, InputArrayOfArrays imgpt3,\n                                      Size imageSize, InputArray R12, InputArray T12,\n                                      InputArray R13, InputArray T13,\n                                      OutputArray R1, OutputArray R2, OutputArray R3,\n                                      OutputArray P1, OutputArray P2, OutputArray P3,\n                                      OutputArray Q, double alpha, Size newImgSize,\n                                      CV_OUT Rect* roi1, CV_OUT Rect* roi2, int flags );\n\n/** @brief Returns the new camera intrinsic matrix based on the free scaling parameter.\n\n@param cameraMatrix Input camera intrinsic matrix.\n@param distCoeffs Input vector of distortion coefficients\n\\f$\\distcoeffs\\f$. If the vector is NULL/empty, the zero distortion coefficients are\nassumed.\n@param imageSize Original image size.\n@param alpha Free scaling parameter between 0 (when all the pixels in the undistorted image are\nvalid) and 1 (when all the source image pixels are retained in the undistorted image). See\n#stereoRectify for details.\n@param newImgSize Image size after rectification. By default, it is set to imageSize .\n@param validPixROI Optional output rectangle that outlines all-good-pixels region in the\nundistorted image. See roi1, roi2 description in #stereoRectify .\n@param centerPrincipalPoint Optional flag that indicates whether in the new camera intrinsic matrix the\nprincipal point should be at the image center or not. By default, the principal point is chosen to\nbest fit a subset of the source image (determined by alpha) to the corrected image.\n@return new_camera_matrix Output new camera intrinsic matrix.\n\nThe function computes and returns the optimal new camera intrinsic matrix based on the free scaling parameter.\nBy varying this parameter, you may retrieve only sensible pixels alpha=0 , keep all the original\nimage pixels if there is valuable information in the corners alpha=1 , or get something in between.\nWhen alpha\\>0 , the undistorted result is likely to have some black pixels corresponding to\n\"virtual\" pixels outside of the captured distorted image. The original camera intrinsic matrix, distortion\ncoefficients, the computed new camera intrinsic matrix, and newImageSize should be passed to\n#initUndistortRectifyMap to produce the maps for #remap .\n */\nCV_EXPORTS_W Mat getOptimalNewCameraMatrix( InputArray cameraMatrix, InputArray distCoeffs,\n                                            Size imageSize, double alpha, Size newImgSize = Size(),\n                                            CV_OUT Rect* validPixROI = 0,\n                                            bool centerPrincipalPoint = false);\n\n/** @brief Computes Hand-Eye calibration: \\f$_{}^{g}\\textrm{T}_c\\f$\n\n@param[in] R_gripper2base Rotation part extracted from the homogeneous matrix that transforms a point\nexpressed in the gripper frame to the robot base frame (\\f$_{}^{b}\\textrm{T}_g\\f$).\nThis is a vector (`vector<Mat>`) that contains the rotation, `(3x3)` rotation matrices or `(3x1)` rotation vectors,\nfor all the transformations from gripper frame to robot base frame.\n@param[in] t_gripper2base Translation part extracted from the homogeneous matrix that transforms a point\nexpressed in the gripper frame to the robot base frame (\\f$_{}^{b}\\textrm{T}_g\\f$).\nThis is a vector (`vector<Mat>`) that contains the `(3x1)` translation vectors for all the transformations\nfrom gripper frame to robot base frame.\n@param[in] R_target2cam Rotation part extracted from the homogeneous matrix that transforms a point\nexpressed in the target frame to the camera frame (\\f$_{}^{c}\\textrm{T}_t\\f$).\nThis is a vector (`vector<Mat>`) that contains the rotation, `(3x3)` rotation matrices or `(3x1)` rotation vectors,\nfor all the transformations from calibration target frame to camera frame.\n@param[in] t_target2cam Rotation part extracted from the homogeneous matrix that transforms a point\nexpressed in the target frame to the camera frame (\\f$_{}^{c}\\textrm{T}_t\\f$).\nThis is a vector (`vector<Mat>`) that contains the `(3x1)` translation vectors for all the transformations\nfrom calibration target frame to camera frame.\n@param[out] R_cam2gripper Estimated `(3x3)` rotation part extracted from the homogeneous matrix that transforms a point\nexpressed in the camera frame to the gripper frame (\\f$_{}^{g}\\textrm{T}_c\\f$).\n@param[out] t_cam2gripper Estimated `(3x1)` translation part extracted from the homogeneous matrix that transforms a point\nexpressed in the camera frame to the gripper frame (\\f$_{}^{g}\\textrm{T}_c\\f$).\n@param[in] method One of the implemented Hand-Eye calibration method, see cv::HandEyeCalibrationMethod\n\nThe function performs the Hand-Eye calibration using various methods. One approach consists in estimating the\nrotation then the translation (separable solutions) and the following methods are implemented:\n  - R. Tsai, R. Lenz A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/EyeCalibration \\cite Tsai89\n  - F. Park, B. Martin Robot Sensor Calibration: Solving AX = XB on the Euclidean Group \\cite Park94\n  - R. Horaud, F. Dornaika Hand-Eye Calibration \\cite Horaud95\n\nAnother approach consists in estimating simultaneously the rotation and the translation (simultaneous solutions),\nwith the following implemented methods:\n  - N. Andreff, R. Horaud, B. Espiau On-line Hand-Eye Calibration \\cite Andreff99\n  - K. Daniilidis Hand-Eye Calibration Using Dual Quaternions \\cite Daniilidis98\n\nThe following picture describes the Hand-Eye calibration problem where the transformation between a camera (\"eye\")\nmounted on a robot gripper (\"hand\") has to be estimated. This configuration is called eye-in-hand.\n\nThe eye-to-hand configuration consists in a static camera observing a calibration pattern mounted on the robot\nend-effector. The transformation from the camera to the robot base frame can then be estimated by inputting\nthe suitable transformations to the function, see below.\n\n![](pics/hand-eye_figure.png)\n\nThe calibration procedure is the following:\n  - a static calibration pattern is used to estimate the transformation between the target frame\n  and the camera frame\n  - the robot gripper is moved in order to acquire several poses\n  - for each pose, the homogeneous transformation between the gripper frame and the robot base frame is recorded using for\n  instance the robot kinematics\n\\f[\n    \\begin{bmatrix}\n    X_b\\\\\n    Y_b\\\\\n    Z_b\\\\\n    1\n    \\end{bmatrix}\n    =\n    \\begin{bmatrix}\n    _{}^{b}\\textrm{R}_g & _{}^{b}\\textrm{t}_g \\\\\n    0_{1 \\times 3} & 1\n    \\end{bmatrix}\n    \\begin{bmatrix}\n    X_g\\\\\n    Y_g\\\\\n    Z_g\\\\\n    1\n    \\end{bmatrix}\n\\f]\n  - for each pose, the homogeneous transformation between the calibration target frame and the camera frame is recorded using\n  for instance a pose estimation method (PnP) from 2D-3D point correspondences\n\\f[\n    \\begin{bmatrix}\n    X_c\\\\\n    Y_c\\\\\n    Z_c\\\\\n    1\n    \\end{bmatrix}\n    =\n    \\begin{bmatrix}\n    _{}^{c}\\textrm{R}_t & _{}^{c}\\textrm{t}_t \\\\\n    0_{1 \\times 3} & 1\n    \\end{bmatrix}\n    \\begin{bmatrix}\n    X_t\\\\\n    Y_t\\\\\n    Z_t\\\\\n    1\n    \\end{bmatrix}\n\\f]\n\nThe Hand-Eye calibration procedure returns the following homogeneous transformation\n\\f[\n    \\begin{bmatrix}\n    X_g\\\\\n    Y_g\\\\\n    Z_g\\\\\n    1\n    \\end{bmatrix}\n    =\n    \\begin{bmatrix}\n    _{}^{g}\\textrm{R}_c & _{}^{g}\\textrm{t}_c \\\\\n    0_{1 \\times 3} & 1\n    \\end{bmatrix}\n    \\begin{bmatrix}\n    X_c\\\\\n    Y_c\\\\\n    Z_c\\\\\n    1\n    \\end{bmatrix}\n\\f]\n\nThis problem is also known as solving the \\f$\\mathbf{A}\\mathbf{X}=\\mathbf{X}\\mathbf{B}\\f$ equation:\n  - for an eye-in-hand configuration\n\\f[\n    \\begin{align*}\n    ^{b}{\\textrm{T}_g}^{(1)} \\hspace{0.2em} ^{g}\\textrm{T}_c \\hspace{0.2em} ^{c}{\\textrm{T}_t}^{(1)} &=\n    \\hspace{0.1em} ^{b}{\\textrm{T}_g}^{(2)} \\hspace{0.2em} ^{g}\\textrm{T}_c \\hspace{0.2em} ^{c}{\\textrm{T}_t}^{(2)} \\\\\n\n    (^{b}{\\textrm{T}_g}^{(2)})^{-1} \\hspace{0.2em} ^{b}{\\textrm{T}_g}^{(1)} \\hspace{0.2em} ^{g}\\textrm{T}_c &=\n    \\hspace{0.1em} ^{g}\\textrm{T}_c \\hspace{0.2em} ^{c}{\\textrm{T}_t}^{(2)} (^{c}{\\textrm{T}_t}^{(1)})^{-1} \\\\\n\n    \\textrm{A}_i \\textrm{X} &= \\textrm{X} \\textrm{B}_i \\\\\n    \\end{align*}\n\\f]\n\n  - for an eye-to-hand configuration\n\\f[\n    \\begin{align*}\n    ^{g}{\\textrm{T}_b}^{(1)} \\hspace{0.2em} ^{b}\\textrm{T}_c \\hspace{0.2em} ^{c}{\\textrm{T}_t}^{(1)} &=\n    \\hspace{0.1em} ^{g}{\\textrm{T}_b}^{(2)} \\hspace{0.2em} ^{b}\\textrm{T}_c \\hspace{0.2em} ^{c}{\\textrm{T}_t}^{(2)} \\\\\n\n    (^{g}{\\textrm{T}_b}^{(2)})^{-1} \\hspace{0.2em} ^{g}{\\textrm{T}_b}^{(1)} \\hspace{0.2em} ^{b}\\textrm{T}_c &=\n    \\hspace{0.1em} ^{b}\\textrm{T}_c \\hspace{0.2em} ^{c}{\\textrm{T}_t}^{(2)} (^{c}{\\textrm{T}_t}^{(1)})^{-1} \\\\\n\n    \\textrm{A}_i \\textrm{X} &= \\textrm{X} \\textrm{B}_i \\\\\n    \\end{align*}\n\\f]\n\n\\note\nAdditional information can be found on this [website](http://campar.in.tum.de/Chair/HandEyeCalibration).\n\\note\nA minimum of 2 motions with non parallel rotation axes are necessary to determine the hand-eye transformation.\nSo at least 3 different poses are required, but it is strongly recommended to use many more poses.\n\n */\nCV_EXPORTS_W void calibrateHandEye( InputArrayOfArrays R_gripper2base, InputArrayOfArrays t_gripper2base,\n                                    InputArrayOfArrays R_target2cam, InputArrayOfArrays t_target2cam,\n                                    OutputArray R_cam2gripper, OutputArray t_cam2gripper,\n                                    HandEyeCalibrationMethod method=CALIB_HAND_EYE_TSAI );\n\n/** @brief Computes Robot-World/Hand-Eye calibration: \\f$_{}^{w}\\textrm{T}_b\\f$ and \\f$_{}^{c}\\textrm{T}_g\\f$\n\n@param[in] R_world2cam Rotation part extracted from the homogeneous matrix that transforms a point\nexpressed in the world frame to the camera frame (\\f$_{}^{c}\\textrm{T}_w\\f$).\nThis is a vector (`vector<Mat>`) that contains the rotation, `(3x3)` rotation matrices or `(3x1)` rotation vectors,\nfor all the transformations from world frame to the camera frame.\n@param[in] t_world2cam Translation part extracted from the homogeneous matrix that transforms a point\nexpressed in the world frame to the camera frame (\\f$_{}^{c}\\textrm{T}_w\\f$).\nThis is a vector (`vector<Mat>`) that contains the `(3x1)` translation vectors for all the transformations\nfrom world frame to the camera frame.\n@param[in] R_base2gripper Rotation part extracted from the homogeneous matrix that transforms a point\nexpressed in the robot base frame to the gripper frame (\\f$_{}^{g}\\textrm{T}_b\\f$).\nThis is a vector (`vector<Mat>`) that contains the rotation, `(3x3)` rotation matrices or `(3x1)` rotation vectors,\nfor all the transformations from robot base frame to the gripper frame.\n@param[in] t_base2gripper Rotation part extracted from the homogeneous matrix that transforms a point\nexpressed in the robot base frame to the gripper frame (\\f$_{}^{g}\\textrm{T}_b\\f$).\nThis is a vector (`vector<Mat>`) that contains the `(3x1)` translation vectors for all the transformations\nfrom robot base frame to the gripper frame.\n@param[out] R_base2world Estimated `(3x3)` rotation part extracted from the homogeneous matrix that transforms a point\nexpressed in the robot base frame to the world frame (\\f$_{}^{w}\\textrm{T}_b\\f$).\n@param[out] t_base2world Estimated `(3x1)` translation part extracted from the homogeneous matrix that transforms a point\nexpressed in the robot base frame to the world frame (\\f$_{}^{w}\\textrm{T}_b\\f$).\n@param[out] R_gripper2cam Estimated `(3x3)` rotation part extracted from the homogeneous matrix that transforms a point\nexpressed in the gripper frame to the camera frame (\\f$_{}^{c}\\textrm{T}_g\\f$).\n@param[out] t_gripper2cam Estimated `(3x1)` translation part extracted from the homogeneous matrix that transforms a point\nexpressed in the gripper frame to the camera frame (\\f$_{}^{c}\\textrm{T}_g\\f$).\n@param[in] method One of the implemented Robot-World/Hand-Eye calibration method, see cv::RobotWorldHandEyeCalibrationMethod\n\nThe function performs the Robot-World/Hand-Eye calibration using various methods. One approach consists in estimating the\nrotation then the translation (separable solutions):\n  - M. Shah, Solving the robot-world/hand-eye calibration problem using the kronecker product \\cite Shah2013SolvingTR\n\nAnother approach consists in estimating simultaneously the rotation and the translation (simultaneous solutions),\nwith the following implemented method:\n  - A. Li, L. Wang, and D. Wu, Simultaneous robot-world and hand-eye calibration using dual-quaternions and kronecker product \\cite Li2010SimultaneousRA\n\nThe following picture describes the Robot-World/Hand-Eye calibration problem where the transformations between a robot and a world frame\nand between a robot gripper (\"hand\") and a camera (\"eye\") mounted at the robot end-effector have to be estimated.\n\n![](pics/robot-world_hand-eye_figure.png)\n\nThe calibration procedure is the following:\n  - a static calibration pattern is used to estimate the transformation between the target frame\n  and the camera frame\n  - the robot gripper is moved in order to acquire several poses\n  - for each pose, the homogeneous transformation between the gripper frame and the robot base frame is recorded using for\n  instance the robot kinematics\n\\f[\n    \\begin{bmatrix}\n    X_g\\\\\n    Y_g\\\\\n    Z_g\\\\\n    1\n    \\end{bmatrix}\n    =\n    \\begin{bmatrix}\n    _{}^{g}\\textrm{R}_b & _{}^{g}\\textrm{t}_b \\\\\n    0_{1 \\times 3} & 1\n    \\end{bmatrix}\n    \\begin{bmatrix}\n    X_b\\\\\n    Y_b\\\\\n    Z_b\\\\\n    1\n    \\end{bmatrix}\n\\f]\n  - for each pose, the homogeneous transformation between the calibration target frame (the world frame) and the camera frame is recorded using\n  for instance a pose estimation method (PnP) from 2D-3D point correspondences\n\\f[\n    \\begin{bmatrix}\n    X_c\\\\\n    Y_c\\\\\n    Z_c\\\\\n    1\n    \\end{bmatrix}\n    =\n    \\begin{bmatrix}\n    _{}^{c}\\textrm{R}_w & _{}^{c}\\textrm{t}_w \\\\\n    0_{1 \\times 3} & 1\n    \\end{bmatrix}\n    \\begin{bmatrix}\n    X_w\\\\\n    Y_w\\\\\n    Z_w\\\\\n    1\n    \\end{bmatrix}\n\\f]\n\nThe Robot-World/Hand-Eye calibration procedure returns the following homogeneous transformations\n\\f[\n    \\begin{bmatrix}\n    X_w\\\\\n    Y_w\\\\\n    Z_w\\\\\n    1\n    \\end{bmatrix}\n    =\n    \\begin{bmatrix}\n    _{}^{w}\\textrm{R}_b & _{}^{w}\\textrm{t}_b \\\\\n    0_{1 \\times 3} & 1\n    \\end{bmatrix}\n    \\begin{bmatrix}\n    X_b\\\\\n    Y_b\\\\\n    Z_b\\\\\n    1\n    \\end{bmatrix}\n\\f]\n\\f[\n    \\begin{bmatrix}\n    X_c\\\\\n    Y_c\\\\\n    Z_c\\\\\n    1\n    \\end{bmatrix}\n    =\n    \\begin{bmatrix}\n    _{}^{c}\\textrm{R}_g & _{}^{c}\\textrm{t}_g \\\\\n    0_{1 \\times 3} & 1\n    \\end{bmatrix}\n    \\begin{bmatrix}\n    X_g\\\\\n    Y_g\\\\\n    Z_g\\\\\n    1\n    \\end{bmatrix}\n\\f]\n\nThis problem is also known as solving the \\f$\\mathbf{A}\\mathbf{X}=\\mathbf{Z}\\mathbf{B}\\f$ equation, with:\n  - \\f$\\mathbf{A} \\Leftrightarrow \\hspace{0.1em} _{}^{c}\\textrm{T}_w\\f$\n  - \\f$\\mathbf{X} \\Leftrightarrow \\hspace{0.1em} _{}^{w}\\textrm{T}_b\\f$\n  - \\f$\\mathbf{Z} \\Leftrightarrow \\hspace{0.1em} _{}^{c}\\textrm{T}_g\\f$\n  - \\f$\\mathbf{B} \\Leftrightarrow \\hspace{0.1em} _{}^{g}\\textrm{T}_b\\f$\n\n\\note\nAt least 3 measurements are required (input vectors size must be greater or equal to 3).\n\n */\nCV_EXPORTS_W void calibrateRobotWorldHandEye( InputArrayOfArrays R_world2cam, InputArrayOfArrays t_world2cam,\n                                              InputArrayOfArrays R_base2gripper, InputArrayOfArrays t_base2gripper,\n                                              OutputArray R_base2world, OutputArray t_base2world,\n                                              OutputArray R_gripper2cam, OutputArray t_gripper2cam,\n                                              RobotWorldHandEyeCalibrationMethod method=CALIB_ROBOT_WORLD_HAND_EYE_SHAH );\n\n/** @brief Converts points from Euclidean to homogeneous space.\n\n@param src Input vector of N-dimensional points.\n@param dst Output vector of N+1-dimensional points.\n\nThe function converts points from Euclidean to homogeneous space by appending 1's to the tuple of\npoint coordinates. That is, each point (x1, x2, ..., xn) is converted to (x1, x2, ..., xn, 1).\n */\nCV_EXPORTS_W void convertPointsToHomogeneous( InputArray src, OutputArray dst );\n\n/** @brief Converts points from homogeneous to Euclidean space.\n\n@param src Input vector of N-dimensional points.\n@param dst Output vector of N-1-dimensional points.\n\nThe function converts points homogeneous to Euclidean space using perspective projection. That is,\neach point (x1, x2, ... x(n-1), xn) is converted to (x1/xn, x2/xn, ..., x(n-1)/xn). When xn=0, the\noutput point coordinates will be (0,0,0,...).\n */\nCV_EXPORTS_W void convertPointsFromHomogeneous( InputArray src, OutputArray dst );\n\n/** @brief Converts points to/from homogeneous coordinates.\n\n@param src Input array or vector of 2D, 3D, or 4D points.\n@param dst Output vector of 2D, 3D, or 4D points.\n\nThe function converts 2D or 3D points from/to homogeneous coordinates by calling either\n#convertPointsToHomogeneous or #convertPointsFromHomogeneous.\n\n@note The function is obsolete. Use one of the previous two functions instead.\n */\nCV_EXPORTS void convertPointsHomogeneous( InputArray src, OutputArray dst );\n\n/** @brief Calculates a fundamental matrix from the corresponding points in two images.\n\n@param points1 Array of N points from the first image. The point coordinates should be\nfloating-point (single or double precision).\n@param points2 Array of the second image points of the same size and format as points1 .\n@param method Method for computing a fundamental matrix.\n-   @ref FM_7POINT for a 7-point algorithm. \\f$N = 7\\f$\n-   @ref FM_8POINT for an 8-point algorithm. \\f$N \\ge 8\\f$\n-   @ref FM_RANSAC for the RANSAC algorithm. \\f$N \\ge 8\\f$\n-   @ref FM_LMEDS for the LMedS algorithm. \\f$N \\ge 8\\f$\n@param ransacReprojThreshold Parameter used only for RANSAC. It is the maximum distance from a point to an epipolar\nline in pixels, beyond which the point is considered an outlier and is not used for computing the\nfinal fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the\npoint localization, image resolution, and the image noise.\n@param confidence Parameter used for the RANSAC and LMedS methods only. It specifies a desirable level\nof confidence (probability) that the estimated matrix is correct.\n@param[out] mask optional output mask\n@param maxIters The maximum number of robust method iterations.\n\nThe epipolar geometry is described by the following equation:\n\n\\f[[p_2; 1]^T F [p_1; 1] = 0\\f]\n\nwhere \\f$F\\f$ is a fundamental matrix, \\f$p_1\\f$ and \\f$p_2\\f$ are corresponding points in the first and the\nsecond images, respectively.\n\nThe function calculates the fundamental matrix using one of four methods listed above and returns\nthe found fundamental matrix. Normally just one matrix is found. But in case of the 7-point\nalgorithm, the function may return up to 3 solutions ( \\f$9 \\times 3\\f$ matrix that stores all 3\nmatrices sequentially).\n\nThe calculated fundamental matrix may be passed further to computeCorrespondEpilines that finds the\nepipolar lines corresponding to the specified points. It can also be passed to\n#stereoRectifyUncalibrated to compute the rectification transformation. :\n@code\n    // Example. Estimation of fundamental matrix using the RANSAC algorithm\n    int point_count = 100;\n    vector<Point2f> points1(point_count);\n    vector<Point2f> points2(point_count);\n\n    // initialize the points here ...\n    for( int i = 0; i < point_count; i++ )\n    {\n        points1[i] = ...;\n        points2[i] = ...;\n    }\n\n    Mat fundamental_matrix =\n     findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);\n@endcode\n */\nCV_EXPORTS_W Mat findFundamentalMat( InputArray points1, InputArray points2,\n                                     int method, double ransacReprojThreshold, double confidence,\n                                     int maxIters, OutputArray mask = noArray() );\n\n/** @overload */\nCV_EXPORTS_W Mat findFundamentalMat( InputArray points1, InputArray points2,\n                                     int method = FM_RANSAC,\n                                     double ransacReprojThreshold = 3., double confidence = 0.99,\n                                     OutputArray mask = noArray() );\n\n/** @overload */\nCV_EXPORTS Mat findFundamentalMat( InputArray points1, InputArray points2,\n                                   OutputArray mask, int method = FM_RANSAC,\n                                   double ransacReprojThreshold = 3., double confidence = 0.99 );\n\n\nCV_EXPORTS_W Mat findFundamentalMat( InputArray points1, InputArray points2,\n                        OutputArray mask, const UsacParams &params);\n\n/** @brief Calculates an essential matrix from the corresponding points in two images.\n\n@param points1 Array of N (N \\>= 5) 2D points from the first image. The point coordinates should\nbe floating-point (single or double precision).\n@param points2 Array of the second image points of the same size and format as points1 .\n@param cameraMatrix Camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\nNote that this function assumes that points1 and points2 are feature points from cameras with the\nsame camera intrinsic matrix. If this assumption does not hold for your use case, use\n#undistortPoints with `P = cv::NoArray()` for both cameras to transform image points\nto normalized image coordinates, which are valid for the identity camera intrinsic matrix. When\npassing these coordinates, pass the identity matrix for this parameter.\n@param method Method for computing an essential matrix.\n-   @ref RANSAC for the RANSAC algorithm.\n-   @ref LMEDS for the LMedS algorithm.\n@param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of\nconfidence (probability) that the estimated matrix is correct.\n@param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar\nline in pixels, beyond which the point is considered an outlier and is not used for computing the\nfinal fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the\npoint localization, image resolution, and the image noise.\n@param mask Output array of N elements, every element of which is set to 0 for outliers and to 1\nfor the other points. The array is computed only in the RANSAC and LMedS methods.\n@param maxIters The maximum number of robust method iterations.\n\nThis function estimates essential matrix based on the five-point algorithm solver in @cite Nister03 .\n@cite SteweniusCFS is also a related. The epipolar geometry is described by the following equation:\n\n\\f[[p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\\f]\n\nwhere \\f$E\\f$ is an essential matrix, \\f$p_1\\f$ and \\f$p_2\\f$ are corresponding points in the first and the\nsecond images, respectively. The result of this function may be passed further to\n#decomposeEssentialMat or  #recoverPose to recover the relative pose between cameras.\n */\nCV_EXPORTS_W\nMat findEssentialMat(\n    InputArray points1, InputArray points2,\n    InputArray cameraMatrix, int method = RANSAC,\n    double prob = 0.999, double threshold = 1.0,\n    int maxIters = 1000, OutputArray mask = noArray()\n);\n\n/** @overload */\nCV_EXPORTS\nMat findEssentialMat(\n    InputArray points1, InputArray points2,\n    InputArray cameraMatrix, int method,\n    double prob, double threshold,\n    OutputArray mask\n);  // TODO remove from OpenCV 5.0\n\n/** @overload\n@param points1 Array of N (N \\>= 5) 2D points from the first image. The point coordinates should\nbe floating-point (single or double precision).\n@param points2 Array of the second image points of the same size and format as points1 .\n@param focal focal length of the camera. Note that this function assumes that points1 and points2\nare feature points from cameras with same focal length and principal point.\n@param pp principal point of the camera.\n@param method Method for computing a fundamental matrix.\n-   @ref RANSAC for the RANSAC algorithm.\n-   @ref LMEDS for the LMedS algorithm.\n@param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar\nline in pixels, beyond which the point is considered an outlier and is not used for computing the\nfinal fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the\npoint localization, image resolution, and the image noise.\n@param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of\nconfidence (probability) that the estimated matrix is correct.\n@param mask Output array of N elements, every element of which is set to 0 for outliers and to 1\nfor the other points. The array is computed only in the RANSAC and LMedS methods.\n@param maxIters The maximum number of robust method iterations.\n\nThis function differs from the one above that it computes camera intrinsic matrix from focal length and\nprincipal point:\n\n\\f[A =\n\\begin{bmatrix}\nf & 0 & x_{pp}  \\\\\n0 & f & y_{pp}  \\\\\n0 & 0 & 1\n\\end{bmatrix}\\f]\n */\nCV_EXPORTS_W\nMat findEssentialMat(\n    InputArray points1, InputArray points2,\n    double focal = 1.0, Point2d pp = Point2d(0, 0),\n    int method = RANSAC, double prob = 0.999,\n    double threshold = 1.0, int maxIters = 1000,\n    OutputArray mask = noArray()\n);\n\n/** @overload */\nCV_EXPORTS\nMat findEssentialMat(\n    InputArray points1, InputArray points2,\n    double focal, Point2d pp,\n    int method, double prob,\n    double threshold, OutputArray mask\n);  // TODO remove from OpenCV 5.0\n\n/** @brief Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.\n\n@param points1 Array of N (N \\>= 5) 2D points from the first image. The point coordinates should\nbe floating-point (single or double precision).\n@param points2 Array of the second image points of the same size and format as points1 .\n@param cameraMatrix1 Camera matrix \\f$K = \\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\\f$ .\nNote that this function assumes that points1 and points2 are feature points from cameras with the\nsame camera matrix. If this assumption does not hold for your use case, use\n#undistortPoints with `P = cv::NoArray()` for both cameras to transform image points\nto normalized image coordinates, which are valid for the identity camera matrix. When\npassing these coordinates, pass the identity matrix for this parameter.\n@param cameraMatrix2 Camera matrix \\f$K = \\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\\f$ .\nNote that this function assumes that points1 and points2 are feature points from cameras with the\nsame camera matrix. If this assumption does not hold for your use case, use\n#undistortPoints with `P = cv::NoArray()` for both cameras to transform image points\nto normalized image coordinates, which are valid for the identity camera matrix. When\npassing these coordinates, pass the identity matrix for this parameter.\n@param distCoeffs1 Input vector of distortion coefficients\n\\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]])\\f$\nof 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.\n@param distCoeffs2 Input vector of distortion coefficients\n\\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]])\\f$\nof 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.\n@param method Method for computing an essential matrix.\n-   @ref RANSAC for the RANSAC algorithm.\n-   @ref LMEDS for the LMedS algorithm.\n@param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of\nconfidence (probability) that the estimated matrix is correct.\n@param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar\nline in pixels, beyond which the point is considered an outlier and is not used for computing the\nfinal fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the\npoint localization, image resolution, and the image noise.\n@param mask Output array of N elements, every element of which is set to 0 for outliers and to 1\nfor the other points. The array is computed only in the RANSAC and LMedS methods.\n\nThis function estimates essential matrix based on the five-point algorithm solver in @cite Nister03 .\n@cite SteweniusCFS is also a related. The epipolar geometry is described by the following equation:\n\n\\f[[p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\\f]\n\nwhere \\f$E\\f$ is an essential matrix, \\f$p_1\\f$ and \\f$p_2\\f$ are corresponding points in the first and the\nsecond images, respectively. The result of this function may be passed further to\n#decomposeEssentialMat or  #recoverPose to recover the relative pose between cameras.\n */\nCV_EXPORTS_W Mat findEssentialMat( InputArray points1, InputArray points2,\n                                 InputArray cameraMatrix1, InputArray distCoeffs1,\n                                 InputArray cameraMatrix2, InputArray distCoeffs2,\n                                 int method = RANSAC,\n                                 double prob = 0.999, double threshold = 1.0,\n                                 OutputArray mask = noArray() );\n\n\nCV_EXPORTS_W Mat findEssentialMat( InputArray points1, InputArray points2,\n                      InputArray cameraMatrix1, InputArray cameraMatrix2,\n                      InputArray dist_coeff1, InputArray dist_coeff2, OutputArray mask,\n                      const UsacParams &params);\n\n/** @brief Decompose an essential matrix to possible rotations and translation.\n\n@param E The input essential matrix.\n@param R1 One possible rotation matrix.\n@param R2 Another possible rotation matrix.\n@param t One possible translation.\n\nThis function decomposes the essential matrix E using svd decomposition @cite HartleyZ00. In\ngeneral, four possible poses exist for the decomposition of E. They are \\f$[R_1, t]\\f$,\n\\f$[R_1, -t]\\f$, \\f$[R_2, t]\\f$, \\f$[R_2, -t]\\f$.\n\nIf E gives the epipolar constraint \\f$[p_2; 1]^T A^{-T} E A^{-1} [p_1; 1] = 0\\f$ between the image\npoints \\f$p_1\\f$ in the first image and \\f$p_2\\f$ in second image, then any of the tuples\n\\f$[R_1, t]\\f$, \\f$[R_1, -t]\\f$, \\f$[R_2, t]\\f$, \\f$[R_2, -t]\\f$ is a change of basis from the first\ncamera's coordinate system to the second camera's coordinate system. However, by decomposing E, one\ncan only get the direction of the translation. For this reason, the translation t is returned with\nunit length.\n */\nCV_EXPORTS_W void decomposeEssentialMat( InputArray E, OutputArray R1, OutputArray R2, OutputArray t );\n\n/** @brief Recovers the relative camera rotation and the translation from an estimated essential\nmatrix and the corresponding points in two images, using cheirality check. Returns the number of\ninliers that pass the check.\n\n@param E The input essential matrix.\n@param points1 Array of N 2D points from the first image. The point coordinates should be\nfloating-point (single or double precision).\n@param points2 Array of the second image points of the same size and format as points1 .\n@param cameraMatrix Camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\nNote that this function assumes that points1 and points2 are feature points from cameras with the\nsame camera intrinsic matrix.\n@param R Output rotation matrix. Together with the translation vector, this matrix makes up a tuple\nthat performs a change of basis from the first camera's coordinate system to the second camera's\ncoordinate system. Note that, in general, t can not be used for this tuple, see the parameter\ndescribed below.\n@param t Output translation vector. This vector is obtained by @ref decomposeEssentialMat and\ntherefore is only known up to scale, i.e. t is the direction of the translation vector and has unit\nlength.\n@param mask Input/output mask for inliers in points1 and points2. If it is not empty, then it marks\ninliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to\nrecover pose. In the output mask only inliers which pass the cheirality check.\n\nThis function decomposes an essential matrix using @ref decomposeEssentialMat and then verifies\npossible pose hypotheses by doing cheirality check. The cheirality check means that the\ntriangulated 3D points should have positive depth. Some details can be found in @cite Nister03.\n\nThis function can be used to process the output E and mask from @ref findEssentialMat. In this\nscenario, points1 and points2 are the same input for #findEssentialMat :\n@code\n    // Example. Estimation of fundamental matrix using the RANSAC algorithm\n    int point_count = 100;\n    vector<Point2f> points1(point_count);\n    vector<Point2f> points2(point_count);\n\n    // initialize the points here ...\n    for( int i = 0; i < point_count; i++ )\n    {\n        points1[i] = ...;\n        points2[i] = ...;\n    }\n\n    // cametra matrix with both focal lengths = 1, and principal point = (0, 0)\n    Mat cameraMatrix = Mat::eye(3, 3, CV_64F);\n\n    Mat E, R, t, mask;\n\n    E = findEssentialMat(points1, points2, cameraMatrix, RANSAC, 0.999, 1.0, mask);\n    recoverPose(E, points1, points2, cameraMatrix, R, t, mask);\n@endcode\n */\nCV_EXPORTS_W int recoverPose( InputArray E, InputArray points1, InputArray points2,\n                            InputArray cameraMatrix, OutputArray R, OutputArray t,\n                            InputOutputArray mask = noArray() );\n\n/** @overload\n@param E The input essential matrix.\n@param points1 Array of N 2D points from the first image. The point coordinates should be\nfloating-point (single or double precision).\n@param points2 Array of the second image points of the same size and format as points1 .\n@param R Output rotation matrix. Together with the translation vector, this matrix makes up a tuple\nthat performs a change of basis from the first camera's coordinate system to the second camera's\ncoordinate system. Note that, in general, t can not be used for this tuple, see the parameter\ndescription below.\n@param t Output translation vector. This vector is obtained by @ref decomposeEssentialMat and\ntherefore is only known up to scale, i.e. t is the direction of the translation vector and has unit\nlength.\n@param focal Focal length of the camera. Note that this function assumes that points1 and points2\nare feature points from cameras with same focal length and principal point.\n@param pp principal point of the camera.\n@param mask Input/output mask for inliers in points1 and points2. If it is not empty, then it marks\ninliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to\nrecover pose. In the output mask only inliers which pass the cheirality check.\n\nThis function differs from the one above that it computes camera intrinsic matrix from focal length and\nprincipal point:\n\n\\f[A =\n\\begin{bmatrix}\nf & 0 & x_{pp}  \\\\\n0 & f & y_{pp}  \\\\\n0 & 0 & 1\n\\end{bmatrix}\\f]\n */\nCV_EXPORTS_W int recoverPose( InputArray E, InputArray points1, InputArray points2,\n                            OutputArray R, OutputArray t,\n                            double focal = 1.0, Point2d pp = Point2d(0, 0),\n                            InputOutputArray mask = noArray() );\n\n/** @overload\n@param E The input essential matrix.\n@param points1 Array of N 2D points from the first image. The point coordinates should be\nfloating-point (single or double precision).\n@param points2 Array of the second image points of the same size and format as points1.\n@param cameraMatrix Camera intrinsic matrix \\f$\\cameramatrix{A}\\f$ .\nNote that this function assumes that points1 and points2 are feature points from cameras with the\nsame camera intrinsic matrix.\n@param R Output rotation matrix. Together with the translation vector, this matrix makes up a tuple\nthat performs a change of basis from the first camera's coordinate system to the second camera's\ncoordinate system. Note that, in general, t can not be used for this tuple, see the parameter\ndescription below.\n@param t Output translation vector. This vector is obtained by @ref decomposeEssentialMat and\ntherefore is only known up to scale, i.e. t is the direction of the translation vector and has unit\nlength.\n@param distanceThresh threshold distance which is used to filter out far away points (i.e. infinite\npoints).\n@param mask Input/output mask for inliers in points1 and points2. If it is not empty, then it marks\ninliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to\nrecover pose. In the output mask only inliers which pass the cheirality check.\n@param triangulatedPoints 3D points which were reconstructed by triangulation.\n\nThis function differs from the one above that it outputs the triangulated 3D point that are used for\nthe cheirality check.\n */\nCV_EXPORTS_W int recoverPose( InputArray E, InputArray points1, InputArray points2,\n                            InputArray cameraMatrix, OutputArray R, OutputArray t, double distanceThresh, InputOutputArray mask = noArray(),\n                            OutputArray triangulatedPoints = noArray());\n\n/** @brief For points in an image of a stereo pair, computes the corresponding epilines in the other image.\n\n@param points Input points. \\f$N \\times 1\\f$ or \\f$1 \\times N\\f$ matrix of type CV_32FC2 or\nvector\\<Point2f\\> .\n@param whichImage Index of the image (1 or 2) that contains the points .\n@param F Fundamental matrix that can be estimated using #findFundamentalMat or #stereoRectify .\n@param lines Output vector of the epipolar lines corresponding to the points in the other image.\nEach line \\f$ax + by + c=0\\f$ is encoded by 3 numbers \\f$(a, b, c)\\f$ .\n\nFor every point in one of the two images of a stereo pair, the function finds the equation of the\ncorresponding epipolar line in the other image.\n\nFrom the fundamental matrix definition (see #findFundamentalMat ), line \\f$l^{(2)}_i\\f$ in the second\nimage for the point \\f$p^{(1)}_i\\f$ in the first image (when whichImage=1 ) is computed as:\n\n\\f[l^{(2)}_i = F p^{(1)}_i\\f]\n\nAnd vice versa, when whichImage=2, \\f$l^{(1)}_i\\f$ is computed from \\f$p^{(2)}_i\\f$ as:\n\n\\f[l^{(1)}_i = F^T p^{(2)}_i\\f]\n\nLine coefficients are defined up to a scale. They are normalized so that \\f$a_i^2+b_i^2=1\\f$ .\n */\nCV_EXPORTS_W void computeCorrespondEpilines( InputArray points, int whichImage,\n                                             InputArray F, OutputArray lines );\n\n/** @brief This function reconstructs 3-dimensional points (in homogeneous coordinates) by using\ntheir observations with a stereo camera.\n\n@param projMatr1 3x4 projection matrix of the first camera, i.e. this matrix projects 3D points\ngiven in the world's coordinate system into the first image.\n@param projMatr2 3x4 projection matrix of the second camera, i.e. this matrix projects 3D points\ngiven in the world's coordinate system into the second image.\n@param projPoints1 2xN array of feature points in the first image. In the case of the c++ version,\nit can be also a vector of feature points or two-channel matrix of size 1xN or Nx1.\n@param projPoints2 2xN array of corresponding points in the second image. In the case of the c++\nversion, it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1.\n@param points4D 4xN array of reconstructed points in homogeneous coordinates. These points are\nreturned in the world's coordinate system.\n\n@note\n   Keep in mind that all input data should be of float type in order for this function to work.\n\n@note\n   If the projection matrices from @ref stereoRectify are used, then the returned points are\n   represented in the first camera's rectified coordinate system.\n\n@sa\n   reprojectImageTo3D\n */\nCV_EXPORTS_W void triangulatePoints( InputArray projMatr1, InputArray projMatr2,\n                                     InputArray projPoints1, InputArray projPoints2,\n                                     OutputArray points4D );\n\n/** @brief Refines coordinates of corresponding points.\n\n@param F 3x3 fundamental matrix.\n@param points1 1xN array containing the first set of points.\n@param points2 1xN array containing the second set of points.\n@param newPoints1 The optimized points1.\n@param newPoints2 The optimized points2.\n\nThe function implements the Optimal Triangulation Method (see Multiple View Geometry for details).\nFor each given point correspondence points1[i] \\<-\\> points2[i], and a fundamental matrix F, it\ncomputes the corrected correspondences newPoints1[i] \\<-\\> newPoints2[i] that minimize the geometric\nerror \\f$d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2\\f$ (where \\f$d(a,b)\\f$ is the\ngeometric distance between points \\f$a\\f$ and \\f$b\\f$ ) subject to the epipolar constraint\n\\f$newPoints2^T * F * newPoints1 = 0\\f$ .\n */\nCV_EXPORTS_W void correctMatches( InputArray F, InputArray points1, InputArray points2,\n                                  OutputArray newPoints1, OutputArray newPoints2 );\n\n/** @brief Filters off small noise blobs (speckles) in the disparity map\n\n@param img The input 16-bit signed disparity image\n@param newVal The disparity value used to paint-off the speckles\n@param maxSpeckleSize The maximum speckle size to consider it a speckle. Larger blobs are not\naffected by the algorithm\n@param maxDiff Maximum difference between neighbor disparity pixels to put them into the same\nblob. Note that since StereoBM, StereoSGBM and may be other algorithms return a fixed-point\ndisparity map, where disparity values are multiplied by 16, this scale factor should be taken into\naccount when specifying this parameter value.\n@param buf The optional temporary buffer to avoid memory allocation within the function.\n */\nCV_EXPORTS_W void filterSpeckles( InputOutputArray img, double newVal,\n                                  int maxSpeckleSize, double maxDiff,\n                                  InputOutputArray buf = noArray() );\n\n//! computes valid disparity ROI from the valid ROIs of the rectified images (that are returned by #stereoRectify)\nCV_EXPORTS_W Rect getValidDisparityROI( Rect roi1, Rect roi2,\n                                        int minDisparity, int numberOfDisparities,\n                                        int blockSize );\n\n//! validates disparity using the left-right check. The matrix \"cost\" should be computed by the stereo correspondence algorithm\nCV_EXPORTS_W void validateDisparity( InputOutputArray disparity, InputArray cost,\n                                     int minDisparity, int numberOfDisparities,\n                                     int disp12MaxDisp = 1 );\n\n/** @brief Reprojects a disparity image to 3D space.\n\n@param disparity Input single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit\nfloating-point disparity image. The values of 8-bit / 16-bit signed formats are assumed to have no\nfractional bits. If the disparity is 16-bit signed format, as computed by @ref StereoBM or\n@ref StereoSGBM and maybe other algorithms, it should be divided by 16 (and scaled to float) before\nbeing used here.\n@param _3dImage Output 3-channel floating-point image of the same size as disparity. Each element of\n_3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity map. If one\nuses Q obtained by @ref stereoRectify, then the returned points are represented in the first\ncamera's rectified coordinate system.\n@param Q \\f$4 \\times 4\\f$ perspective transformation matrix that can be obtained with\n@ref stereoRectify.\n@param handleMissingValues Indicates, whether the function should handle missing values (i.e.\npoints where the disparity was not computed). If handleMissingValues=true, then pixels with the\nminimal disparity that corresponds to the outliers (see StereoMatcher::compute ) are transformed\nto 3D points with a very large Z value (currently set to 10000).\n@param ddepth The optional output array depth. If it is -1, the output image will have CV_32F\ndepth. ddepth can also be set to CV_16S, CV_32S or CV_32F.\n\nThe function transforms a single-channel disparity map to a 3-channel image representing a 3D\nsurface. That is, for each pixel (x,y) and the corresponding disparity d=disparity(x,y) , it\ncomputes:\n\n\\f[\\begin{bmatrix}\nX \\\\\nY \\\\\nZ \\\\\nW\n\\end{bmatrix} = Q \\begin{bmatrix}\nx \\\\\ny \\\\\n\\texttt{disparity} (x,y) \\\\\nz\n\\end{bmatrix}.\\f]\n\n@sa\n   To reproject a sparse set of points {(x,y,d),...} to 3D space, use perspectiveTransform.\n */\nCV_EXPORTS_W void reprojectImageTo3D( InputArray disparity,\n                                      OutputArray _3dImage, InputArray Q,\n                                      bool handleMissingValues = false,\n                                      int ddepth = -1 );\n\n/** @brief Calculates the Sampson Distance between two points.\n\nThe function cv::sampsonDistance calculates and returns the first order approximation of the geometric error as:\n\\f[\nsd( \\texttt{pt1} , \\texttt{pt2} )=\n\\frac{(\\texttt{pt2}^t \\cdot \\texttt{F} \\cdot \\texttt{pt1})^2}\n{((\\texttt{F} \\cdot \\texttt{pt1})(0))^2 +\n((\\texttt{F} \\cdot \\texttt{pt1})(1))^2 +\n((\\texttt{F}^t \\cdot \\texttt{pt2})(0))^2 +\n((\\texttt{F}^t \\cdot \\texttt{pt2})(1))^2}\n\\f]\nThe fundamental matrix may be calculated using the #findFundamentalMat function. See @cite HartleyZ00 11.4.3 for details.\n@param pt1 first homogeneous 2d point\n@param pt2 second homogeneous 2d point\n@param F fundamental matrix\n@return The computed Sampson distance.\n*/\nCV_EXPORTS_W double sampsonDistance(InputArray pt1, InputArray pt2, InputArray F);\n\n/** @brief Computes an optimal affine transformation between two 3D point sets.\n\nIt computes\n\\f[\n\\begin{bmatrix}\nx\\\\\ny\\\\\nz\\\\\n\\end{bmatrix}\n=\n\\begin{bmatrix}\na_{11} & a_{12} & a_{13}\\\\\na_{21} & a_{22} & a_{23}\\\\\na_{31} & a_{32} & a_{33}\\\\\n\\end{bmatrix}\n\\begin{bmatrix}\nX\\\\\nY\\\\\nZ\\\\\n\\end{bmatrix}\n+\n\\begin{bmatrix}\nb_1\\\\\nb_2\\\\\nb_3\\\\\n\\end{bmatrix}\n\\f]\n\n@param src First input 3D point set containing \\f$(X,Y,Z)\\f$.\n@param dst Second input 3D point set containing \\f$(x,y,z)\\f$.\n@param out Output 3D affine transformation matrix \\f$3 \\times 4\\f$ of the form\n\\f[\n\\begin{bmatrix}\na_{11} & a_{12} & a_{13} & b_1\\\\\na_{21} & a_{22} & a_{23} & b_2\\\\\na_{31} & a_{32} & a_{33} & b_3\\\\\n\\end{bmatrix}\n\\f]\n@param inliers Output vector indicating which points are inliers (1-inlier, 0-outlier).\n@param ransacThreshold Maximum reprojection error in the RANSAC algorithm to consider a point as\nan inlier.\n@param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything\nbetween 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation\nsignificantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.\n\nThe function estimates an optimal 3D affine transformation between two 3D point sets using the\nRANSAC algorithm.\n */\nCV_EXPORTS_W  int estimateAffine3D(InputArray src, InputArray dst,\n                                   OutputArray out, OutputArray inliers,\n                                   double ransacThreshold = 3, double confidence = 0.99);\n\n/** @brief Computes an optimal affine transformation between two 3D point sets.\n\nIt computes \\f$R,s,t\\f$ minimizing \\f$\\sum{i} dst_i - c \\cdot R \\cdot src_i \\f$\nwhere \\f$R\\f$ is a 3x3 rotation matrix, \\f$t\\f$ is a 3x1 translation vector and \\f$s\\f$ is a\nscalar size value. This is an implementation of the algorithm by Umeyama \\cite umeyama1991least .\nThe estimated affine transform has a homogeneous scale which is a subclass of affine\ntransformations with 7 degrees of freedom. The paired point sets need to comprise at least 3\npoints each.\n\n@param src First input 3D point set.\n@param dst Second input 3D point set.\n@param scale If null is passed, the scale parameter c will be assumed to be 1.0.\nElse the pointed-to variable will be set to the optimal scale.\n@param force_rotation If true, the returned rotation will never be a reflection.\nThis might be unwanted, e.g. when optimizing a transform between a right- and a\nleft-handed coordinate system.\n@return 3D affine transformation matrix \\f$3 \\times 4\\f$ of the form\n\\f[T =\n\\begin{bmatrix}\nR & t\\\\\n\\end{bmatrix}\n\\f]\n\n */\nCV_EXPORTS_W   cv::Mat estimateAffine3D(InputArray src, InputArray dst,\n                                        CV_OUT double* scale = nullptr, bool force_rotation = true);\n\n/** @brief Computes an optimal translation between two 3D point sets.\n *\n * It computes\n * \\f[\n * \\begin{bmatrix}\n * x\\\\\n * y\\\\\n * z\\\\\n * \\end{bmatrix}\n * =\n * \\begin{bmatrix}\n * X\\\\\n * Y\\\\\n * Z\\\\\n * \\end{bmatrix}\n * +\n * \\begin{bmatrix}\n * b_1\\\\\n * b_2\\\\\n * b_3\\\\\n * \\end{bmatrix}\n * \\f]\n *\n * @param src First input 3D point set containing \\f$(X,Y,Z)\\f$.\n * @param dst Second input 3D point set containing \\f$(x,y,z)\\f$.\n * @param out Output 3D translation vector \\f$3 \\times 1\\f$ of the form\n * \\f[\n * \\begin{bmatrix}\n * b_1 \\\\\n * b_2 \\\\\n * b_3 \\\\\n * \\end{bmatrix}\n * \\f]\n * @param inliers Output vector indicating which points are inliers (1-inlier, 0-outlier).\n * @param ransacThreshold Maximum reprojection error in the RANSAC algorithm to consider a point as\n * an inlier.\n * @param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything\n * between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation\n * significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.\n *\n * The function estimates an optimal 3D translation between two 3D point sets using the\n * RANSAC algorithm.\n *  */\nCV_EXPORTS_W  int estimateTranslation3D(InputArray src, InputArray dst,\n                                        OutputArray out, OutputArray inliers,\n                                        double ransacThreshold = 3, double confidence = 0.99);\n\n/** @brief Computes an optimal affine transformation between two 2D point sets.\n\nIt computes\n\\f[\n\\begin{bmatrix}\nx\\\\\ny\\\\\n\\end{bmatrix}\n=\n\\begin{bmatrix}\na_{11} & a_{12}\\\\\na_{21} & a_{22}\\\\\n\\end{bmatrix}\n\\begin{bmatrix}\nX\\\\\nY\\\\\n\\end{bmatrix}\n+\n\\begin{bmatrix}\nb_1\\\\\nb_2\\\\\n\\end{bmatrix}\n\\f]\n\n@param from First input 2D point set containing \\f$(X,Y)\\f$.\n@param to Second input 2D point set containing \\f$(x,y)\\f$.\n@param inliers Output vector indicating which points are inliers (1-inlier, 0-outlier).\n@param method Robust method used to compute transformation. The following methods are possible:\n-   @ref RANSAC - RANSAC-based robust method\n-   @ref LMEDS - Least-Median robust method\nRANSAC is the default method.\n@param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider\na point as an inlier. Applies only to RANSAC.\n@param maxIters The maximum number of robust method iterations.\n@param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything\nbetween 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation\nsignificantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.\n@param refineIters Maximum number of iterations of refining algorithm (Levenberg-Marquardt).\nPassing 0 will disable refining, so the output matrix will be output of robust method.\n\n@return Output 2D affine transformation matrix \\f$2 \\times 3\\f$ or empty matrix if transformation\ncould not be estimated. The returned matrix has the following form:\n\\f[\n\\begin{bmatrix}\na_{11} & a_{12} & b_1\\\\\na_{21} & a_{22} & b_2\\\\\n\\end{bmatrix}\n\\f]\n\nThe function estimates an optimal 2D affine transformation between two 2D point sets using the\nselected robust algorithm.\n\nThe computed transformation is then refined further (using only inliers) with the\nLevenberg-Marquardt method to reduce the re-projection error even more.\n\n@note\nThe RANSAC method can handle practically any ratio of outliers but needs a threshold to\ndistinguish inliers from outliers. The method LMeDS does not need any threshold but it works\ncorrectly only when there are more than 50% of inliers.\n\n@sa estimateAffinePartial2D, getAffineTransform\n*/\nCV_EXPORTS_W cv::Mat estimateAffine2D(InputArray from, InputArray to, OutputArray inliers = noArray(),\n                                  int method = RANSAC, double ransacReprojThreshold = 3,\n                                  size_t maxIters = 2000, double confidence = 0.99,\n                                  size_t refineIters = 10);\n\n\nCV_EXPORTS_W cv::Mat estimateAffine2D(InputArray pts1, InputArray pts2, OutputArray inliers,\n                     const UsacParams &params);\n\n/** @brief Computes an optimal limited affine transformation with 4 degrees of freedom between\ntwo 2D point sets.\n\n@param from First input 2D point set.\n@param to Second input 2D point set.\n@param inliers Output vector indicating which points are inliers.\n@param method Robust method used to compute transformation. The following methods are possible:\n-   @ref RANSAC - RANSAC-based robust method\n-   @ref LMEDS - Least-Median robust method\nRANSAC is the default method.\n@param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider\na point as an inlier. Applies only to RANSAC.\n@param maxIters The maximum number of robust method iterations.\n@param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything\nbetween 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation\nsignificantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.\n@param refineIters Maximum number of iterations of refining algorithm (Levenberg-Marquardt).\nPassing 0 will disable refining, so the output matrix will be output of robust method.\n\n@return Output 2D affine transformation (4 degrees of freedom) matrix \\f$2 \\times 3\\f$ or\nempty matrix if transformation could not be estimated.\n\nThe function estimates an optimal 2D affine transformation with 4 degrees of freedom limited to\ncombinations of translation, rotation, and uniform scaling. Uses the selected algorithm for robust\nestimation.\n\nThe computed transformation is then refined further (using only inliers) with the\nLevenberg-Marquardt method to reduce the re-projection error even more.\n\nEstimated transformation matrix is:\n\\f[ \\begin{bmatrix} \\cos(\\theta) \\cdot s & -\\sin(\\theta) \\cdot s & t_x \\\\\n                \\sin(\\theta) \\cdot s & \\cos(\\theta) \\cdot s & t_y\n\\end{bmatrix} \\f]\nWhere \\f$ \\theta \\f$ is the rotation angle, \\f$ s \\f$ the scaling factor and \\f$ t_x, t_y \\f$ are\ntranslations in \\f$ x, y \\f$ axes respectively.\n\n@note\nThe RANSAC method can handle practically any ratio of outliers but need a threshold to\ndistinguish inliers from outliers. The method LMeDS does not need any threshold but it works\ncorrectly only when there are more than 50% of inliers.\n\n@sa estimateAffine2D, getAffineTransform\n*/\nCV_EXPORTS_W cv::Mat estimateAffinePartial2D(InputArray from, InputArray to, OutputArray inliers = noArray(),\n                                  int method = RANSAC, double ransacReprojThreshold = 3,\n                                  size_t maxIters = 2000, double confidence = 0.99,\n                                  size_t refineIters = 10);\n\n/** @example samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp\nAn example program with homography decomposition.\n\nCheck @ref tutorial_homography \"the corresponding tutorial\" for more details.\n*/\n\n/** @brief Decompose a homography matrix to rotation(s), translation(s) and plane normal(s).\n\n@param H The input homography matrix between two images.\n@param K The input camera intrinsic matrix.\n@param rotations Array of rotation matrices.\n@param translations Array of translation matrices.\n@param normals Array of plane normal matrices.\n\nThis function extracts relative camera motion between two views of a planar object and returns up to\nfour mathematical solution tuples of rotation, translation, and plane normal. The decomposition of\nthe homography matrix H is described in detail in @cite Malis.\n\nIf the homography H, induced by the plane, gives the constraint\n\\f[s_i \\vecthree{x'_i}{y'_i}{1} \\sim H \\vecthree{x_i}{y_i}{1}\\f] on the source image points\n\\f$p_i\\f$ and the destination image points \\f$p'_i\\f$, then the tuple of rotations[k] and\ntranslations[k] is a change of basis from the source camera's coordinate system to the destination\ncamera's coordinate system. However, by decomposing H, one can only get the translation normalized\nby the (typically unknown) depth of the scene, i.e. its direction but with normalized length.\n\nIf point correspondences are available, at least two solutions may further be invalidated, by\napplying positive depth constraint, i.e. all points must be in front of the camera.\n */\nCV_EXPORTS_W int decomposeHomographyMat(InputArray H,\n                                        InputArray K,\n                                        OutputArrayOfArrays rotations,\n                                        OutputArrayOfArrays translations,\n                                        OutputArrayOfArrays normals);\n\n/** @brief Filters homography decompositions based on additional information.\n\n@param rotations Vector of rotation matrices.\n@param normals Vector of plane normal matrices.\n@param beforePoints Vector of (rectified) visible reference points before the homography is applied\n@param afterPoints Vector of (rectified) visible reference points after the homography is applied\n@param possibleSolutions Vector of int indices representing the viable solution set after filtering\n@param pointsMask optional Mat/Vector of 8u type representing the mask for the inliers as given by the #findHomography function\n\nThis function is intended to filter the output of the #decomposeHomographyMat based on additional\ninformation as described in @cite Malis . The summary of the method: the #decomposeHomographyMat function\nreturns 2 unique solutions and their \"opposites\" for a total of 4 solutions. If we have access to the\nsets of points visible in the camera frame before and after the homography transformation is applied,\nwe can determine which are the true potential solutions and which are the opposites by verifying which\nhomographies are consistent with all visible reference points being in front of the camera. The inputs\nare left unchanged; the filtered solution set is returned as indices into the existing one.\n\n*/\nCV_EXPORTS_W void filterHomographyDecompByVisibleRefpoints(InputArrayOfArrays rotations,\n                                                           InputArrayOfArrays normals,\n                                                           InputArray beforePoints,\n                                                           InputArray afterPoints,\n                                                           OutputArray possibleSolutions,\n                                                           InputArray pointsMask = noArray());\n\n/** @brief The base class for stereo correspondence algorithms.\n */\nclass CV_EXPORTS_W StereoMatcher : public Algorithm\n{\npublic:\n    enum { DISP_SHIFT = 4,\n           DISP_SCALE = (1 << DISP_SHIFT)\n         };\n\n    /** @brief Computes disparity map for the specified stereo pair\n\n    @param left Left 8-bit single-channel image.\n    @param right Right image of the same size and the same type as the left one.\n    @param disparity Output disparity map. It has the same size as the input images. Some algorithms,\n    like StereoBM or StereoSGBM compute 16-bit fixed-point disparity map (where each disparity value\n    has 4 fractional bits), whereas other algorithms output 32-bit floating-point disparity map.\n     */\n    CV_WRAP virtual void compute( InputArray left, InputArray right,\n                                  OutputArray disparity ) = 0;\n\n    CV_WRAP virtual int getMinDisparity() const = 0;\n    CV_WRAP virtual void setMinDisparity(int minDisparity) = 0;\n\n    CV_WRAP virtual int getNumDisparities() const = 0;\n    CV_WRAP virtual void setNumDisparities(int numDisparities) = 0;\n\n    CV_WRAP virtual int getBlockSize() const = 0;\n    CV_WRAP virtual void setBlockSize(int blockSize) = 0;\n\n    CV_WRAP virtual int getSpeckleWindowSize() const = 0;\n    CV_WRAP virtual void setSpeckleWindowSize(int speckleWindowSize) = 0;\n\n    CV_WRAP virtual int getSpeckleRange() const = 0;\n    CV_WRAP virtual void setSpeckleRange(int speckleRange) = 0;\n\n    CV_WRAP virtual int getDisp12MaxDiff() const = 0;\n    CV_WRAP virtual void setDisp12MaxDiff(int disp12MaxDiff) = 0;\n};\n\n\n/** @brief Class for computing stereo correspondence using the block matching algorithm, introduced and\ncontributed to OpenCV by K. Konolige.\n */\nclass CV_EXPORTS_W StereoBM : public StereoMatcher\n{\npublic:\n    enum { PREFILTER_NORMALIZED_RESPONSE = 0,\n           PREFILTER_XSOBEL              = 1\n         };\n\n    CV_WRAP virtual int getPreFilterType() const = 0;\n    CV_WRAP virtual void setPreFilterType(int preFilterType) = 0;\n\n    CV_WRAP virtual int getPreFilterSize() const = 0;\n    CV_WRAP virtual void setPreFilterSize(int preFilterSize) = 0;\n\n    CV_WRAP virtual int getPreFilterCap() const = 0;\n    CV_WRAP virtual void setPreFilterCap(int preFilterCap) = 0;\n\n    CV_WRAP virtual int getTextureThreshold() const = 0;\n    CV_WRAP virtual void setTextureThreshold(int textureThreshold) = 0;\n\n    CV_WRAP virtual int getUniquenessRatio() const = 0;\n    CV_WRAP virtual void setUniquenessRatio(int uniquenessRatio) = 0;\n\n    CV_WRAP virtual int getSmallerBlockSize() const = 0;\n    CV_WRAP virtual void setSmallerBlockSize(int blockSize) = 0;\n\n    CV_WRAP virtual Rect getROI1() const = 0;\n    CV_WRAP virtual void setROI1(Rect roi1) = 0;\n\n    CV_WRAP virtual Rect getROI2() const = 0;\n    CV_WRAP virtual void setROI2(Rect roi2) = 0;\n\n    /** @brief Creates StereoBM object\n\n    @param numDisparities the disparity search range. For each pixel algorithm will find the best\n    disparity from 0 (default minimum disparity) to numDisparities. The search range can then be\n    shifted by changing the minimum disparity.\n    @param blockSize the linear size of the blocks compared by the algorithm. The size should be odd\n    (as the block is centered at the current pixel). Larger block size implies smoother, though less\n    accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher\n    chance for algorithm to find a wrong correspondence.\n\n    The function create StereoBM object. You can then call StereoBM::compute() to compute disparity for\n    a specific stereo pair.\n     */\n    CV_WRAP static Ptr<StereoBM> create(int numDisparities = 0, int blockSize = 21);\n};\n\n/** @brief The class implements the modified H. Hirschmuller algorithm @cite HH08 that differs from the original\none as follows:\n\n-   By default, the algorithm is single-pass, which means that you consider only 5 directions\ninstead of 8. Set mode=StereoSGBM::MODE_HH in createStereoSGBM to run the full variant of the\nalgorithm but beware that it may consume a lot of memory.\n-   The algorithm matches blocks, not individual pixels. Though, setting blockSize=1 reduces the\nblocks to single pixels.\n-   Mutual information cost function is not implemented. Instead, a simpler Birchfield-Tomasi\nsub-pixel metric from @cite BT98 is used. Though, the color images are supported as well.\n-   Some pre- and post- processing steps from K. Konolige algorithm StereoBM are included, for\nexample: pre-filtering (StereoBM::PREFILTER_XSOBEL type) and post-filtering (uniqueness\ncheck, quadratic interpolation and speckle filtering).\n\n@note\n   -   (Python) An example illustrating the use of the StereoSGBM matching algorithm can be found\n        at opencv_source_code/samples/python/stereo_match.py\n */\nclass CV_EXPORTS_W StereoSGBM : public StereoMatcher\n{\npublic:\n    enum\n    {\n        MODE_SGBM = 0,\n        MODE_HH   = 1,\n        MODE_SGBM_3WAY = 2,\n        MODE_HH4  = 3\n    };\n\n    CV_WRAP virtual int getPreFilterCap() const = 0;\n    CV_WRAP virtual void setPreFilterCap(int preFilterCap) = 0;\n\n    CV_WRAP virtual int getUniquenessRatio() const = 0;\n    CV_WRAP virtual void setUniquenessRatio(int uniquenessRatio) = 0;\n\n    CV_WRAP virtual int getP1() const = 0;\n    CV_WRAP virtual void setP1(int P1) = 0;\n\n    CV_WRAP virtual int getP2() const = 0;\n    CV_WRAP virtual void setP2(int P2) = 0;\n\n    CV_WRAP virtual int getMode() const = 0;\n    CV_WRAP virtual void setMode(int mode) = 0;\n\n    /** @brief Creates StereoSGBM object\n\n    @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes\n    rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.\n    @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than\n    zero. In the current implementation, this parameter must be divisible by 16.\n    @param blockSize Matched block size. It must be an odd number \\>=1 . Normally, it should be\n    somewhere in the 3..11 range.\n    @param P1 The first parameter controlling the disparity smoothness. See below.\n    @param P2 The second parameter controlling the disparity smoothness. The larger the values are,\n    the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1\n    between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor\n    pixels. The algorithm requires P2 \\> P1 . See stereo_match.cpp sample where some reasonably good\n    P1 and P2 values are shown (like 8\\*number_of_image_channels\\*blockSize\\*blockSize and\n    32\\*number_of_image_channels\\*blockSize\\*blockSize , respectively).\n    @param disp12MaxDiff Maximum allowed difference (in integer pixel units) in the left-right\n    disparity check. Set it to a non-positive value to disable the check.\n    @param preFilterCap Truncation value for the prefiltered image pixels. The algorithm first\n    computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.\n    The result values are passed to the Birchfield-Tomasi pixel cost function.\n    @param uniquenessRatio Margin in percentage by which the best (minimum) computed cost function\n    value should \"win\" the second best value to consider the found match correct. Normally, a value\n    within the 5-15 range is good enough.\n    @param speckleWindowSize Maximum size of smooth disparity regions to consider their noise speckles\n    and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the\n    50-200 range.\n    @param speckleRange Maximum disparity variation within each connected component. If you do speckle\n    filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.\n    Normally, 1 or 2 is good enough.\n    @param mode Set it to StereoSGBM::MODE_HH to run the full-scale two-pass dynamic programming\n    algorithm. It will consume O(W\\*H\\*numDisparities) bytes, which is large for 640x480 stereo and\n    huge for HD-size pictures. By default, it is set to false .\n\n    The first constructor initializes StereoSGBM with all the default parameters. So, you only have to\n    set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter\n    to a custom value.\n     */\n    CV_WRAP static Ptr<StereoSGBM> create(int minDisparity = 0, int numDisparities = 16, int blockSize = 3,\n                                          int P1 = 0, int P2 = 0, int disp12MaxDiff = 0,\n                                          int preFilterCap = 0, int uniquenessRatio = 0,\n                                          int speckleWindowSize = 0, int speckleRange = 0,\n                                          int mode = StereoSGBM::MODE_SGBM);\n};\n\n\n//! cv::undistort mode\nenum UndistortTypes\n{\n    PROJ_SPHERICAL_ORTHO  = 0,\n    PROJ_SPHERICAL_EQRECT = 1\n};\n\n/** @brief Transforms an image to compensate for lens distortion.\n\nThe function transforms an image to compensate radial and tangential lens distortion.\n\nThe function is simply a combination of #initUndistortRectifyMap (with unity R ) and #remap\n(with bilinear interpolation). See the former function for details of the transformation being\nperformed.\n\nThose pixels in the destination image, for which there is no correspondent pixels in the source\nimage, are filled with zeros (black color).\n\nA particular subset of the source image that will be visible in the corrected image can be regulated\nby newCameraMatrix. You can use #getOptimalNewCameraMatrix to compute the appropriate\nnewCameraMatrix depending on your requirements.\n\nThe camera matrix and the distortion parameters can be determined using #calibrateCamera. If\nthe resolution of images is different from the resolution used at the calibration stage, \\f$f_x,\nf_y, c_x\\f$ and \\f$c_y\\f$ need to be scaled accordingly, while the distortion coefficients remain\nthe same.\n\n@param src Input (distorted) image.\n@param dst Output (corrected) image that has the same size and type as src .\n@param cameraMatrix Input camera matrix \\f$A = \\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]])\\f$\nof 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.\n@param newCameraMatrix Camera matrix of the distorted image. By default, it is the same as\ncameraMatrix but you may additionally scale and shift the result by using a different matrix.\n */\nCV_EXPORTS_W void undistort( InputArray src, OutputArray dst,\n                             InputArray cameraMatrix,\n                             InputArray distCoeffs,\n                             InputArray newCameraMatrix = noArray() );\n\n/** @brief Computes the undistortion and rectification transformation map.\n\nThe function computes the joint undistortion and rectification transformation and represents the\nresult in the form of maps for #remap. The undistorted image looks like original, as if it is\ncaptured with a camera using the camera matrix =newCameraMatrix and zero distortion. In case of a\nmonocular camera, newCameraMatrix is usually equal to cameraMatrix, or it can be computed by\n#getOptimalNewCameraMatrix for a better control over scaling. In case of a stereo camera,\nnewCameraMatrix is normally set to P1 or P2 computed by #stereoRectify .\n\nAlso, this new camera is oriented differently in the coordinate space, according to R. That, for\nexample, helps to align two heads of a stereo camera so that the epipolar lines on both images\nbecome horizontal and have the same y- coordinate (in case of a horizontally aligned stereo camera).\n\nThe function actually builds the maps for the inverse mapping algorithm that is used by #remap. That\nis, for each pixel \\f$(u, v)\\f$ in the destination (corrected and rectified) image, the function\ncomputes the corresponding coordinates in the source image (that is, in the original image from\ncamera). The following process is applied:\n\\f[\n\\begin{array}{l}\nx  \\leftarrow (u - {c'}_x)/{f'}_x  \\\\\ny  \\leftarrow (v - {c'}_y)/{f'}_y  \\\\\n{[X\\,Y\\,W]} ^T  \\leftarrow R^{-1}*[x \\, y \\, 1]^T  \\\\\nx'  \\leftarrow X/W  \\\\\ny'  \\leftarrow Y/W  \\\\\nr^2  \\leftarrow x'^2 + y'^2 \\\\\nx''  \\leftarrow x' \\frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}\n+ 2p_1 x' y' + p_2(r^2 + 2 x'^2)  + s_1 r^2 + s_2 r^4\\\\\ny''  \\leftarrow y' \\frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}\n+ p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\\\\ns\\vecthree{x'''}{y'''}{1} =\n\\vecthreethree{R_{33}(\\tau_x, \\tau_y)}{0}{-R_{13}((\\tau_x, \\tau_y)}\n{0}{R_{33}(\\tau_x, \\tau_y)}{-R_{23}(\\tau_x, \\tau_y)}\n{0}{0}{1} R(\\tau_x, \\tau_y) \\vecthree{x''}{y''}{1}\\\\\nmap_x(u,v)  \\leftarrow x''' f_x + c_x  \\\\\nmap_y(u,v)  \\leftarrow y''' f_y + c_y\n\\end{array}\n\\f]\nwhere \\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]])\\f$\nare the distortion coefficients.\n\nIn case of a stereo camera, this function is called twice: once for each camera head, after\n#stereoRectify, which in its turn is called after #stereoCalibrate. But if the stereo camera\nwas not calibrated, it is still possible to compute the rectification transformations directly from\nthe fundamental matrix using #stereoRectifyUncalibrated. For each camera, the function computes\nhomography H as the rectification transformation in a pixel domain, not a rotation matrix R in 3D\nspace. R can be computed from H as\n\\f[\\texttt{R} = \\texttt{cameraMatrix} ^{-1} \\cdot \\texttt{H} \\cdot \\texttt{cameraMatrix}\\f]\nwhere cameraMatrix can be chosen arbitrarily.\n\n@param cameraMatrix Input camera matrix \\f$A=\\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]])\\f$\nof 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.\n@param R Optional rectification transformation in the object space (3x3 matrix). R1 or R2 ,\ncomputed by #stereoRectify can be passed here. If the matrix is empty, the identity transformation\nis assumed. In cvInitUndistortMap R assumed to be an identity matrix.\n@param newCameraMatrix New camera matrix \\f$A'=\\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}\\f$.\n@param size Undistorted image size.\n@param m1type Type of the first output map that can be CV_32FC1, CV_32FC2 or CV_16SC2, see #convertMaps\n@param map1 The first output map.\n@param map2 The second output map.\n */\nCV_EXPORTS_W\nvoid initUndistortRectifyMap(InputArray cameraMatrix, InputArray distCoeffs,\n                             InputArray R, InputArray newCameraMatrix,\n                             Size size, int m1type, OutputArray map1, OutputArray map2);\n\n/** @brief Computes the projection and inverse-rectification transformation map. In essense, this is the inverse of\n#initUndistortRectifyMap to accomodate stereo-rectification of projectors ('inverse-cameras') in projector-camera pairs.\n\nThe function computes the joint projection and inverse rectification transformation and represents the\nresult in the form of maps for #remap. The projected image looks like a distorted version of the original which,\nonce projected by a projector, should visually match the original. In case of a monocular camera, newCameraMatrix\nis usually equal to cameraMatrix, or it can be computed by\n#getOptimalNewCameraMatrix for a better control over scaling. In case of a projector-camera pair,\nnewCameraMatrix is normally set to P1 or P2 computed by #stereoRectify .\n\nThe projector is oriented differently in the coordinate space, according to R. In case of projector-camera pairs,\nthis helps align the projector (in the same manner as #initUndistortRectifyMap for the camera) to create a stereo-rectified pair. This\nallows epipolar lines on both images to become horizontal and have the same y-coordinate (in case of a horizontally aligned projector-camera pair).\n\nThe function builds the maps for the inverse mapping algorithm that is used by #remap. That\nis, for each pixel \\f$(u, v)\\f$ in the destination (projected and inverse-rectified) image, the function\ncomputes the corresponding coordinates in the source image (that is, in the original digital image). The following process is applied:\n\n\\f[\n\\begin{array}{l}\n\\text{newCameraMatrix}\\\\\nx  \\leftarrow (u - {c'}_x)/{f'}_x  \\\\\ny  \\leftarrow (v - {c'}_y)/{f'}_y  \\\\\n\n\\\\\\text{Undistortion}\n\\\\\\scriptsize{\\textit{though equation shown is for radial undistortion, function implements cv::undistortPoints()}}\\\\\nr^2  \\leftarrow x^2 + y^2 \\\\\n\\theta \\leftarrow \\frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}\\\\\nx' \\leftarrow \\frac{x}{\\theta} \\\\\ny'  \\leftarrow \\frac{y}{\\theta} \\\\\n\n\\\\\\text{Rectification}\\\\\n{[X\\,Y\\,W]} ^T  \\leftarrow R*[x' \\, y' \\, 1]^T  \\\\\nx''  \\leftarrow X/W  \\\\\ny''  \\leftarrow Y/W  \\\\\n\n\\\\\\text{cameraMatrix}\\\\\nmap_x(u,v)  \\leftarrow x'' f_x + c_x  \\\\\nmap_y(u,v)  \\leftarrow y'' f_y + c_y\n\\end{array}\n\\f]\nwhere \\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]])\\f$\nare the distortion coefficients vector distCoeffs.\n\nIn case of a stereo-rectified projector-camera pair, this function is called for the projector while #initUndistortRectifyMap is called for the camera head.\nThis is done after #stereoRectify, which in turn is called after #stereoCalibrate. If the projector-camera pair\nis not calibrated, it is still possible to compute the rectification transformations directly from\nthe fundamental matrix using #stereoRectifyUncalibrated. For the projector and camera, the function computes\nhomography H as the rectification transformation in a pixel domain, not a rotation matrix R in 3D\nspace. R can be computed from H as\n\\f[\\texttt{R} = \\texttt{cameraMatrix} ^{-1} \\cdot \\texttt{H} \\cdot \\texttt{cameraMatrix}\\f]\nwhere cameraMatrix can be chosen arbitrarily.\n\n@param cameraMatrix Input camera matrix \\f$A=\\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]])\\f$\nof 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.\n@param R Optional rectification transformation in the object space (3x3 matrix). R1 or R2,\ncomputed by #stereoRectify can be passed here. If the matrix is empty, the identity transformation\nis assumed.\n@param newCameraMatrix New camera matrix \\f$A'=\\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}\\f$.\n@param size Distorted image size.\n@param m1type Type of the first output map. Can be CV_32FC1, CV_32FC2 or CV_16SC2, see #convertMaps\n@param map1 The first output map for #remap.\n@param map2 The second output map for #remap.\n */\nCV_EXPORTS_W\nvoid initInverseRectificationMap( InputArray cameraMatrix, InputArray distCoeffs,\n                           InputArray R, InputArray newCameraMatrix,\n                           const Size& size, int m1type, OutputArray map1, OutputArray map2 );\n\n//! initializes maps for #remap for wide-angle\nCV_EXPORTS\nfloat initWideAngleProjMap(InputArray cameraMatrix, InputArray distCoeffs,\n                           Size imageSize, int destImageWidth,\n                           int m1type, OutputArray map1, OutputArray map2,\n                           enum UndistortTypes projType = PROJ_SPHERICAL_EQRECT, double alpha = 0);\nstatic inline\nfloat initWideAngleProjMap(InputArray cameraMatrix, InputArray distCoeffs,\n                           Size imageSize, int destImageWidth,\n                           int m1type, OutputArray map1, OutputArray map2,\n                           int projType, double alpha = 0)\n{\n    return initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize, destImageWidth,\n                                m1type, map1, map2, (UndistortTypes)projType, alpha);\n}\n\n/** @brief Returns the default new camera matrix.\n\nThe function returns the camera matrix that is either an exact copy of the input cameraMatrix (when\ncenterPrinicipalPoint=false ), or the modified one (when centerPrincipalPoint=true).\n\nIn the latter case, the new camera matrix will be:\n\n\\f[\\begin{bmatrix} f_x && 0 && ( \\texttt{imgSize.width} -1)*0.5  \\\\ 0 && f_y && ( \\texttt{imgSize.height} -1)*0.5  \\\\ 0 && 0 && 1 \\end{bmatrix} ,\\f]\n\nwhere \\f$f_x\\f$ and \\f$f_y\\f$ are \\f$(0,0)\\f$ and \\f$(1,1)\\f$ elements of cameraMatrix, respectively.\n\nBy default, the undistortion functions in OpenCV (see #initUndistortRectifyMap, #undistort) do not\nmove the principal point. However, when you work with stereo, it is important to move the principal\npoints in both views to the same y-coordinate (which is required by most of stereo correspondence\nalgorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for\neach view where the principal points are located at the center.\n\n@param cameraMatrix Input camera matrix.\n@param imgsize Camera view image size in pixels.\n@param centerPrincipalPoint Location of the principal point in the new camera matrix. The\nparameter indicates whether this location should be at the image center or not.\n */\nCV_EXPORTS_W\nMat getDefaultNewCameraMatrix(InputArray cameraMatrix, Size imgsize = Size(),\n                              bool centerPrincipalPoint = false);\n\n/** @brief Computes the ideal point coordinates from the observed point coordinates.\n\nThe function is similar to #undistort and #initUndistortRectifyMap but it operates on a\nsparse set of points instead of a raster image. Also the function performs a reverse transformation\nto  #projectPoints. In case of a 3D object, it does not reconstruct its 3D coordinates, but for a\nplanar object, it does, up to a translation vector, if the proper R is specified.\n\nFor each observed point coordinate \\f$(u, v)\\f$ the function computes:\n\\f[\n\\begin{array}{l}\nx^{\"}  \\leftarrow (u - c_x)/f_x  \\\\\ny^{\"}  \\leftarrow (v - c_y)/f_y  \\\\\n(x',y') = undistort(x^{\"},y^{\"}, \\texttt{distCoeffs}) \\\\\n{[X\\,Y\\,W]} ^T  \\leftarrow R*[x' \\, y' \\, 1]^T  \\\\\nx  \\leftarrow X/W  \\\\\ny  \\leftarrow Y/W  \\\\\n\\text{only performed if P is specified:} \\\\\nu'  \\leftarrow x {f'}_x + {c'}_x  \\\\\nv'  \\leftarrow y {f'}_y + {c'}_y\n\\end{array}\n\\f]\n\nwhere *undistort* is an approximate iterative algorithm that estimates the normalized original\npoint coordinates out of the normalized distorted point coordinates (\"normalized\" means that the\ncoordinates do not depend on the camera matrix).\n\nThe function can be used for both a stereo camera head or a monocular camera (when R is empty).\n@param src Observed point coordinates, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel (CV_32FC2 or CV_64FC2) (or\nvector\\<Point2f\\> ).\n@param dst Output ideal point coordinates (1xN/Nx1 2-channel or vector\\<Point2f\\> ) after undistortion and reverse perspective\ntransformation. If matrix P is identity or omitted, dst will contain normalized point coordinates.\n@param cameraMatrix Camera matrix \\f$\\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\\f$ .\n@param distCoeffs Input vector of distortion coefficients\n\\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]])\\f$\nof 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.\n@param R Rectification transformation in the object space (3x3 matrix). R1 or R2 computed by\n#stereoRectify can be passed here. If the matrix is empty, the identity transformation is used.\n@param P New camera matrix (3x3) or new projection matrix (3x4) \\f$\\begin{bmatrix} {f'}_x & 0 & {c'}_x & t_x \\\\ 0 & {f'}_y & {c'}_y & t_y \\\\ 0 & 0 & 1 & t_z \\end{bmatrix}\\f$. P1 or P2 computed by\n#stereoRectify can be passed here. If the matrix is empty, the identity new camera matrix is used.\n */\nCV_EXPORTS_W\nvoid undistortPoints(InputArray src, OutputArray dst,\n                     InputArray cameraMatrix, InputArray distCoeffs,\n                     InputArray R = noArray(), InputArray P = noArray());\n/** @overload\n    @note Default version of #undistortPoints does 5 iterations to compute undistorted points.\n */\nCV_EXPORTS_AS(undistortPointsIter)\nvoid undistortPoints(InputArray src, OutputArray dst,\n                     InputArray cameraMatrix, InputArray distCoeffs,\n                     InputArray R, InputArray P, TermCriteria criteria);\n\n//! @} calib3d\n\n/** @brief The methods in this namespace use a so-called fisheye camera model.\n  @ingroup calib3d_fisheye\n*/\nnamespace fisheye\n{\n//! @addtogroup calib3d_fisheye\n//! @{\n\n    enum{\n        CALIB_USE_INTRINSIC_GUESS   = 1 << 0,\n        CALIB_RECOMPUTE_EXTRINSIC   = 1 << 1,\n        CALIB_CHECK_COND            = 1 << 2,\n        CALIB_FIX_SKEW              = 1 << 3,\n        CALIB_FIX_K1                = 1 << 4,\n        CALIB_FIX_K2                = 1 << 5,\n        CALIB_FIX_K3                = 1 << 6,\n        CALIB_FIX_K4                = 1 << 7,\n        CALIB_FIX_INTRINSIC         = 1 << 8,\n        CALIB_FIX_PRINCIPAL_POINT   = 1 << 9,\n        CALIB_ZERO_DISPARITY        = 1 << 10,\n        CALIB_FIX_FOCAL_LENGTH      = 1 << 11\n    };\n\n    /** @brief Projects points using fisheye model\n\n    @param objectPoints Array of object points, 1xN/Nx1 3-channel (or vector\\<Point3f\\> ), where N is\n    the number of points in the view.\n    @param imagePoints Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, or\n    vector\\<Point2f\\>.\n    @param affine\n    @param K Camera intrinsic matrix \\f$cameramatrix{K}\\f$.\n    @param D Input vector of distortion coefficients \\f$\\distcoeffsfisheye\\f$.\n    @param alpha The skew coefficient.\n    @param jacobian Optional output 2Nx15 jacobian matrix of derivatives of image points with respect\n    to components of the focal lengths, coordinates of the principal point, distortion coefficients,\n    rotation vector, translation vector, and the skew. In the old interface different components of\n    the jacobian are returned via different output parameters.\n\n    The function computes projections of 3D points to the image plane given intrinsic and extrinsic\n    camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of\n    image points coordinates (as functions of all the input parameters) with respect to the particular\n    parameters, intrinsic and/or extrinsic.\n     */\n    CV_EXPORTS void projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine,\n        InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray());\n\n    /** @overload */\n    CV_EXPORTS_W void projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec,\n        InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray());\n\n    /** @brief Distorts 2D points using fisheye model.\n\n    @param undistorted Array of object points, 1xN/Nx1 2-channel (or vector\\<Point2f\\> ), where N is\n    the number of points in the view.\n    @param K Camera intrinsic matrix \\f$cameramatrix{K}\\f$.\n    @param D Input vector of distortion coefficients \\f$\\distcoeffsfisheye\\f$.\n    @param alpha The skew coefficient.\n    @param distorted Output array of image points, 1xN/Nx1 2-channel, or vector\\<Point2f\\> .\n\n    Note that the function assumes the camera intrinsic matrix of the undistorted points to be identity.\n    This means if you want to transform back points undistorted with #fisheye::undistortPoints you have to\n    multiply them with \\f$P^{-1}\\f$.\n     */\n    CV_EXPORTS_W void distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0);\n\n    /** @brief Undistorts 2D points using fisheye model\n\n    @param distorted Array of object points, 1xN/Nx1 2-channel (or vector\\<Point2f\\> ), where N is the\n    number of points in the view.\n    @param K Camera intrinsic matrix \\f$cameramatrix{K}\\f$.\n    @param D Input vector of distortion coefficients \\f$\\distcoeffsfisheye\\f$.\n    @param R Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3\n    1-channel or 1x1 3-channel\n    @param P New camera intrinsic matrix (3x3) or new projection matrix (3x4)\n    @param undistorted Output array of image points, 1xN/Nx1 2-channel, or vector\\<Point2f\\> .\n     */\n    CV_EXPORTS_W void undistortPoints(InputArray distorted, OutputArray undistorted,\n        InputArray K, InputArray D, InputArray R = noArray(), InputArray P  = noArray());\n\n    /** @brief Computes undistortion and rectification maps for image transform by #remap. If D is empty zero\n    distortion is used, if R or P is empty identity matrixes are used.\n\n    @param K Camera intrinsic matrix \\f$cameramatrix{K}\\f$.\n    @param D Input vector of distortion coefficients \\f$\\distcoeffsfisheye\\f$.\n    @param R Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3\n    1-channel or 1x1 3-channel\n    @param P New camera intrinsic matrix (3x3) or new projection matrix (3x4)\n    @param size Undistorted image size.\n    @param m1type Type of the first output map that can be CV_32FC1 or CV_16SC2 . See #convertMaps\n    for details.\n    @param map1 The first output map.\n    @param map2 The second output map.\n     */\n    CV_EXPORTS_W void initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P,\n        const cv::Size& size, int m1type, OutputArray map1, OutputArray map2);\n\n    /** @brief Transforms an image to compensate for fisheye lens distortion.\n\n    @param distorted image with fisheye lens distortion.\n    @param undistorted Output image with compensated fisheye lens distortion.\n    @param K Camera intrinsic matrix \\f$cameramatrix{K}\\f$.\n    @param D Input vector of distortion coefficients \\f$\\distcoeffsfisheye\\f$.\n    @param Knew Camera intrinsic matrix of the distorted image. By default, it is the identity matrix but you\n    may additionally scale and shift the result by using a different matrix.\n    @param new_size the new size\n\n    The function transforms an image to compensate radial and tangential lens distortion.\n\n    The function is simply a combination of #fisheye::initUndistortRectifyMap (with unity R ) and #remap\n    (with bilinear interpolation). See the former function for details of the transformation being\n    performed.\n\n    See below the results of undistortImage.\n       -   a\\) result of undistort of perspective camera model (all possible coefficients (k_1, k_2, k_3,\n            k_4, k_5, k_6) of distortion were optimized under calibration)\n        -   b\\) result of #fisheye::undistortImage of fisheye camera model (all possible coefficients (k_1, k_2,\n            k_3, k_4) of fisheye distortion were optimized under calibration)\n        -   c\\) original image was captured with fisheye lens\n\n    Pictures a) and b) almost the same. But if we consider points of image located far from the center\n    of image, we can notice that on image a) these points are distorted.\n\n    ![image](pics/fisheye_undistorted.jpg)\n     */\n    CV_EXPORTS_W void undistortImage(InputArray distorted, OutputArray undistorted,\n        InputArray K, InputArray D, InputArray Knew = cv::noArray(), const Size& new_size = Size());\n\n    /** @brief Estimates new camera intrinsic matrix for undistortion or rectification.\n\n    @param K Camera intrinsic matrix \\f$cameramatrix{K}\\f$.\n    @param image_size Size of the image\n    @param D Input vector of distortion coefficients \\f$\\distcoeffsfisheye\\f$.\n    @param R Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3\n    1-channel or 1x1 3-channel\n    @param P New camera intrinsic matrix (3x3) or new projection matrix (3x4)\n    @param balance Sets the new focal length in range between the min focal length and the max focal\n    length. Balance is in range of [0, 1].\n    @param new_size the new size\n    @param fov_scale Divisor for new focal length.\n     */\n    CV_EXPORTS_W void estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R,\n        OutputArray P, double balance = 0.0, const Size& new_size = Size(), double fov_scale = 1.0);\n\n    /** @brief Performs camera calibaration\n\n    @param objectPoints vector of vectors of calibration pattern points in the calibration pattern\n    coordinate space.\n    @param imagePoints vector of vectors of the projections of calibration pattern points.\n    imagePoints.size() and objectPoints.size() and imagePoints[i].size() must be equal to\n    objectPoints[i].size() for each i.\n    @param image_size Size of the image used only to initialize the camera intrinsic matrix.\n    @param K Output 3x3 floating-point camera intrinsic matrix\n    \\f$\\cameramatrix{A}\\f$ . If\n    @ref fisheye::CALIB_USE_INTRINSIC_GUESS is specified, some or all of fx, fy, cx, cy must be\n    initialized before calling the function.\n    @param D Output vector of distortion coefficients \\f$\\distcoeffsfisheye\\f$.\n    @param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view.\n    That is, each k-th rotation vector together with the corresponding k-th translation vector (see\n    the next output parameter description) brings the calibration pattern from the model coordinate\n    space (in which object points are specified) to the world coordinate space, that is, a real\n    position of the calibration pattern in the k-th pattern view (k=0.. *M* -1).\n    @param tvecs Output vector of translation vectors estimated for each pattern view.\n    @param flags Different flags that may be zero or a combination of the following values:\n    -    @ref fisheye::CALIB_USE_INTRINSIC_GUESS  cameraMatrix contains valid initial values of\n    fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image\n    center ( imageSize is used), and focal distances are computed in a least-squares fashion.\n    -    @ref fisheye::CALIB_RECOMPUTE_EXTRINSIC  Extrinsic will be recomputed after each iteration\n    of intrinsic optimization.\n    -    @ref fisheye::CALIB_CHECK_COND  The functions will check validity of condition number.\n    -    @ref fisheye::CALIB_FIX_SKEW  Skew coefficient (alpha) is set to zero and stay zero.\n    -    @ref fisheye::CALIB_FIX_K1,..., @ref fisheye::CALIB_FIX_K4 Selected distortion coefficients\n    are set to zeros and stay zero.\n    -    @ref fisheye::CALIB_FIX_PRINCIPAL_POINT  The principal point is not changed during the global\noptimization. It stays at the center or at a different location specified when @ref fisheye::CALIB_USE_INTRINSIC_GUESS is set too.\n    -    @ref fisheye::CALIB_FIX_FOCAL_LENGTH The focal length is not changed during the global\noptimization. It is the \\f$max(width,height)/\\pi\\f$ or the provided \\f$f_x\\f$, \\f$f_y\\f$ when @ref fisheye::CALIB_USE_INTRINSIC_GUESS is set too.\n    @param criteria Termination criteria for the iterative optimization algorithm.\n     */\n    CV_EXPORTS_W double calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size,\n        InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags = 0,\n            TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON));\n\n    /** @brief Stereo rectification for fisheye camera model\n\n    @param K1 First camera intrinsic matrix.\n    @param D1 First camera distortion parameters.\n    @param K2 Second camera intrinsic matrix.\n    @param D2 Second camera distortion parameters.\n    @param imageSize Size of the image used for stereo calibration.\n    @param R Rotation matrix between the coordinate systems of the first and the second\n    cameras.\n    @param tvec Translation vector between coordinate systems of the cameras.\n    @param R1 Output 3x3 rectification transform (rotation matrix) for the first camera.\n    @param R2 Output 3x3 rectification transform (rotation matrix) for the second camera.\n    @param P1 Output 3x4 projection matrix in the new (rectified) coordinate systems for the first\n    camera.\n    @param P2 Output 3x4 projection matrix in the new (rectified) coordinate systems for the second\n    camera.\n    @param Q Output \\f$4 \\times 4\\f$ disparity-to-depth mapping matrix (see reprojectImageTo3D ).\n    @param flags Operation flags that may be zero or @ref fisheye::CALIB_ZERO_DISPARITY . If the flag is set,\n    the function makes the principal points of each camera have the same pixel coordinates in the\n    rectified views. And if the flag is not set, the function may still shift the images in the\n    horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the\n    useful image area.\n    @param newImageSize New image resolution after rectification. The same size should be passed to\n    #initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0)\n    is passed (default), it is set to the original imageSize . Setting it to larger value can help you\n    preserve details in the original image, especially when there is a big radial distortion.\n    @param balance Sets the new focal length in range between the min focal length and the max focal\n    length. Balance is in range of [0, 1].\n    @param fov_scale Divisor for new focal length.\n     */\n    CV_EXPORTS_W void stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec,\n        OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize = Size(),\n        double balance = 0.0, double fov_scale = 1.0);\n\n    /** @brief Performs stereo calibration\n\n    @param objectPoints Vector of vectors of the calibration pattern points.\n    @param imagePoints1 Vector of vectors of the projections of the calibration pattern points,\n    observed by the first camera.\n    @param imagePoints2 Vector of vectors of the projections of the calibration pattern points,\n    observed by the second camera.\n    @param K1 Input/output first camera intrinsic matrix:\n    \\f$\\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}\\f$ , \\f$j = 0,\\, 1\\f$ . If\n    any of @ref fisheye::CALIB_USE_INTRINSIC_GUESS , @ref fisheye::CALIB_FIX_INTRINSIC are specified,\n    some or all of the matrix components must be initialized.\n    @param D1 Input/output vector of distortion coefficients \\f$\\distcoeffsfisheye\\f$ of 4 elements.\n    @param K2 Input/output second camera intrinsic matrix. The parameter is similar to K1 .\n    @param D2 Input/output lens distortion coefficients for the second camera. The parameter is\n    similar to D1 .\n    @param imageSize Size of the image used only to initialize camera intrinsic matrix.\n    @param R Output rotation matrix between the 1st and the 2nd camera coordinate systems.\n    @param T Output translation vector between the coordinate systems of the cameras.\n    @param flags Different flags that may be zero or a combination of the following values:\n    -    @ref fisheye::CALIB_FIX_INTRINSIC  Fix K1, K2? and D1, D2? so that only R, T matrices\n    are estimated.\n    -    @ref fisheye::CALIB_USE_INTRINSIC_GUESS  K1, K2 contains valid initial values of\n    fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image\n    center (imageSize is used), and focal distances are computed in a least-squares fashion.\n    -    @ref fisheye::CALIB_RECOMPUTE_EXTRINSIC  Extrinsic will be recomputed after each iteration\n    of intrinsic optimization.\n    -    @ref fisheye::CALIB_CHECK_COND  The functions will check validity of condition number.\n    -    @ref fisheye::CALIB_FIX_SKEW  Skew coefficient (alpha) is set to zero and stay zero.\n    -   @ref fisheye::CALIB_FIX_K1,..., @ref fisheye::CALIB_FIX_K4 Selected distortion coefficients are set to zeros and stay\n    zero.\n    @param criteria Termination criteria for the iterative optimization algorithm.\n     */\n    CV_EXPORTS_W double stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2,\n                                  InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize,\n                                  OutputArray R, OutputArray T, int flags = fisheye::CALIB_FIX_INTRINSIC,\n                                  TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON));\n\n//! @} calib3d_fisheye\n} // end namespace fisheye\n\n} //end namespace cv\n\n#if 0 //def __cplusplus\n//////////////////////////////////////////////////////////////////////////////////////////\nclass CV_EXPORTS CvLevMarq\n{\npublic:\n    CvLevMarq();\n    CvLevMarq( int nparams, int nerrs, CvTermCriteria criteria=\n              cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON),\n              bool completeSymmFlag=false );\n    ~CvLevMarq();\n    void init( int nparams, int nerrs, CvTermCriteria criteria=\n              cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON),\n              bool completeSymmFlag=false );\n    bool update( const CvMat*& param, CvMat*& J, CvMat*& err );\n    bool updateAlt( const CvMat*& param, CvMat*& JtJ, CvMat*& JtErr, double*& errNorm );\n\n    void clear();\n    void step();\n    enum { DONE=0, STARTED=1, CALC_J=2, CHECK_ERR=3 };\n\n    cv::Ptr<CvMat> mask;\n    cv::Ptr<CvMat> prevParam;\n    cv::Ptr<CvMat> param;\n    cv::Ptr<CvMat> J;\n    cv::Ptr<CvMat> err;\n    cv::Ptr<CvMat> JtJ;\n    cv::Ptr<CvMat> JtJN;\n    cv::Ptr<CvMat> JtErr;\n    cv::Ptr<CvMat> JtJV;\n    cv::Ptr<CvMat> JtJW;\n    double prevErrNorm, errNorm;\n    int lambdaLg10;\n    CvTermCriteria criteria;\n    int state;\n    int iters;\n    bool completeSymmFlag;\n    int solveMethod;\n};\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/affine.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_AFFINE3_HPP\n#define OPENCV_CORE_AFFINE3_HPP\n\n#ifdef __cplusplus\n\n#include <opencv2/core.hpp>\n\nnamespace cv\n{\n\n//! @addtogroup core\n//! @{\n\n    /** @brief Affine transform\n     *\n     * It represents a 4x4 homogeneous transformation matrix \\f$T\\f$\n     *\n     *  \\f[T =\n     *  \\begin{bmatrix}\n     *  R & t\\\\\n     *  0 & 1\\\\\n     *  \\end{bmatrix}\n     *  \\f]\n     *\n     *  where \\f$R\\f$ is a 3x3 rotation matrix and \\f$t\\f$ is a 3x1 translation vector.\n     *\n     *  You can specify \\f$R\\f$ either by a 3x3 rotation matrix or by a 3x1 rotation vector,\n     *  which is converted to a 3x3 rotation matrix by the Rodrigues formula.\n     *\n     *  To construct a matrix \\f$T\\f$ representing first rotation around the axis \\f$r\\f$ with rotation\n     *  angle \\f$|r|\\f$ in radian (right hand rule) and then translation by the vector \\f$t\\f$, you can use\n     *\n     *  @code\n     *  cv::Vec3f r, t;\n     *  cv::Affine3f T(r, t);\n     *  @endcode\n     *\n     *  If you already have the rotation matrix \\f$R\\f$, then you can use\n     *\n     *  @code\n     *  cv::Matx33f R;\n     *  cv::Affine3f T(R, t);\n     *  @endcode\n     *\n     *  To extract the rotation matrix \\f$R\\f$ from \\f$T\\f$, use\n     *\n     *  @code\n     *  cv::Matx33f R = T.rotation();\n     *  @endcode\n     *\n     *  To extract the translation vector \\f$t\\f$ from \\f$T\\f$, use\n     *\n     *  @code\n     *  cv::Vec3f t = T.translation();\n     *  @endcode\n     *\n     *  To extract the rotation vector \\f$r\\f$ from \\f$T\\f$, use\n     *\n     *  @code\n     *  cv::Vec3f r = T.rvec();\n     *  @endcode\n     *\n     *  Note that since the mapping from rotation vectors to rotation matrices\n     *  is many to one. The returned rotation vector is not necessarily the one\n     *  you used before to set the matrix.\n     *\n     *  If you have two transformations \\f$T = T_1 * T_2\\f$, use\n     *\n     *  @code\n     *  cv::Affine3f T, T1, T2;\n     *  T = T2.concatenate(T1);\n     *  @endcode\n     *\n     *  To get the inverse transform of \\f$T\\f$, use\n     *\n     *  @code\n     *  cv::Affine3f T, T_inv;\n     *  T_inv = T.inv();\n     *  @endcode\n     *\n     */\n    template<typename T>\n    class Affine3\n    {\n    public:\n        typedef T float_type;\n        typedef Matx<float_type, 3, 3> Mat3;\n        typedef Matx<float_type, 4, 4> Mat4;\n        typedef Vec<float_type, 3> Vec3;\n\n       //! Default constructor. It represents a 4x4 identity matrix.\n        Affine3();\n\n        //! Augmented affine matrix\n        Affine3(const Mat4& affine);\n\n        /**\n         *  The resulting 4x4 matrix is\n         *\n         *  \\f[\n         *  \\begin{bmatrix}\n         *  R & t\\\\\n         *  0 & 1\\\\\n         *  \\end{bmatrix}\n         *  \\f]\n         *\n         * @param R 3x3 rotation matrix.\n         * @param t 3x1 translation vector.\n         */\n        Affine3(const Mat3& R, const Vec3& t = Vec3::all(0));\n\n        /**\n         * Rodrigues vector.\n         *\n         * The last row of the current matrix is set to [0,0,0,1].\n         *\n         * @param rvec 3x1 rotation vector. Its direction indicates the rotation axis and its length\n         *             indicates the rotation angle in radian (using right hand rule).\n         * @param t 3x1 translation vector.\n         */\n        Affine3(const Vec3& rvec, const Vec3& t = Vec3::all(0));\n\n        /**\n         * Combines all constructors above. Supports 4x4, 3x4, 3x3, 1x3, 3x1 sizes of data matrix.\n         *\n         * The last row of the current matrix is set to [0,0,0,1] when data is not 4x4.\n         *\n         * @param data 1-channel matrix.\n         *             when it is 4x4, it is copied to the current matrix and t is not used.\n         *             When it is 3x4, it is copied to the upper part 3x4 of the current matrix and t is not used.\n         *             When it is 3x3, it is copied to the upper left 3x3 part of the current matrix.\n         *             When it is 3x1 or 1x3, it is treated as a rotation vector and the Rodrigues formula is used\n         *                             to compute a 3x3 rotation matrix.\n         * @param t 3x1 translation vector. It is used only when data is neither 4x4 nor 3x4.\n         */\n        explicit Affine3(const Mat& data, const Vec3& t = Vec3::all(0));\n\n        //! From 16-element array\n        explicit Affine3(const float_type* vals);\n\n        //! Create an 4x4 identity transform\n        static Affine3 Identity();\n\n        /**\n         * Rotation matrix.\n         *\n         * Copy the rotation matrix to the upper left 3x3 part of the current matrix.\n         * The remaining elements of the current matrix are not changed.\n         *\n         * @param R 3x3 rotation matrix.\n         *\n         */\n        void rotation(const Mat3& R);\n\n        /**\n         * Rodrigues vector.\n         *\n         * It sets the upper left 3x3 part of the matrix. The remaining part is unaffected.\n         *\n         * @param rvec 3x1 rotation vector. The direction indicates the rotation axis and\n         *             its length indicates the rotation angle in radian (using the right thumb convention).\n         */\n        void rotation(const Vec3& rvec);\n\n        /**\n         * Combines rotation methods above. Supports 3x3, 1x3, 3x1 sizes of data matrix.\n         *\n         * It sets the upper left 3x3 part of the matrix. The remaining part is unaffected.\n         *\n         * @param data 1-channel matrix.\n         *             When it is a 3x3 matrix, it sets the upper left 3x3 part of the current matrix.\n         *             When it is a 1x3 or 3x1 matrix, it is used as a rotation vector. The Rodrigues formula\n         *             is used to compute the rotation matrix and sets the upper left 3x3 part of the current matrix.\n         */\n        void rotation(const Mat& data);\n\n        /**\n         * Copy the 3x3 matrix L to the upper left part of the current matrix\n         *\n         * It sets the upper left 3x3 part of the matrix. The remaining part is unaffected.\n         *\n         * @param L 3x3 matrix.\n         */\n        void linear(const Mat3& L);\n\n        /**\n         * Copy t to the first three elements of the last column of the current matrix\n         *\n         * It sets the upper right 3x1 part of the matrix. The remaining part is unaffected.\n         *\n         * @param t 3x1 translation vector.\n         */\n        void translation(const Vec3& t);\n\n        //! @return the upper left 3x3 part\n        Mat3 rotation() const;\n\n        //! @return the upper left 3x3 part\n        Mat3 linear() const;\n\n        //! @return the upper right 3x1 part\n        Vec3 translation() const;\n\n        //! Rodrigues vector.\n        //! @return a vector representing the upper left 3x3 rotation matrix of the current matrix.\n        //! @warning  Since the mapping between rotation vectors and rotation matrices is many to one,\n        //!           this function returns only one rotation vector that represents the current rotation matrix,\n        //!           which is not necessarily the same one set by `rotation(const Vec3& rvec)`.\n        Vec3 rvec() const;\n\n        //! @return the inverse of the current matrix.\n        Affine3 inv(int method = cv::DECOMP_SVD) const;\n\n        //! a.rotate(R) is equivalent to Affine(R, 0) * a;\n        Affine3 rotate(const Mat3& R) const;\n\n        //! a.rotate(rvec) is equivalent to Affine(rvec, 0) * a;\n        Affine3 rotate(const Vec3& rvec) const;\n\n        //! a.translate(t) is equivalent to Affine(E, t) * a, where E is an identity matrix\n        Affine3 translate(const Vec3& t) const;\n\n        //! a.concatenate(affine) is equivalent to affine * a;\n        Affine3 concatenate(const Affine3& affine) const;\n\n        template <typename Y> operator Affine3<Y>() const;\n\n        template <typename Y> Affine3<Y> cast() const;\n\n        Mat4 matrix;\n\n#if defined EIGEN_WORLD_VERSION && defined EIGEN_GEOMETRY_MODULE_H\n        Affine3(const Eigen::Transform<T, 3, Eigen::Affine, (Eigen::RowMajor)>& affine);\n        Affine3(const Eigen::Transform<T, 3, Eigen::Affine>& affine);\n        operator Eigen::Transform<T, 3, Eigen::Affine, (Eigen::RowMajor)>() const;\n        operator Eigen::Transform<T, 3, Eigen::Affine>() const;\n#endif\n    };\n\n    template<typename T> static\n    Affine3<T> operator*(const Affine3<T>& affine1, const Affine3<T>& affine2);\n\n    //! V is a 3-element vector with member fields x, y and z\n    template<typename T, typename V> static\n    V operator*(const Affine3<T>& affine, const V& vector);\n\n    typedef Affine3<float> Affine3f;\n    typedef Affine3<double> Affine3d;\n\n    static Vec3f operator*(const Affine3f& affine, const Vec3f& vector);\n    static Vec3d operator*(const Affine3d& affine, const Vec3d& vector);\n\n    template<typename _Tp> class DataType< Affine3<_Tp> >\n    {\n    public:\n        typedef Affine3<_Tp>                               value_type;\n        typedef Affine3<typename DataType<_Tp>::work_type> work_type;\n        typedef _Tp                                        channel_type;\n\n        enum { generic_type = 0,\n               channels     = 16,\n               fmt          = traits::SafeFmt<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n               ,depth        = DataType<channel_type>::depth\n               ,type         = CV_MAKETYPE(depth, channels)\n#endif\n             };\n\n        typedef Vec<channel_type, channels> vec_type;\n    };\n\n    namespace traits {\n    template<typename _Tp>\n    struct Depth< Affine3<_Tp> > { enum { value = Depth<_Tp>::value }; };\n    template<typename _Tp>\n    struct Type< Affine3<_Tp> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, 16) }; };\n    } // namespace\n\n//! @} core\n\n}\n\n//! @cond IGNORED\n\n///////////////////////////////////////////////////////////////////////////////////\n// Implementation\n\ntemplate<typename T> inline\ncv::Affine3<T>::Affine3()\n    : matrix(Mat4::eye())\n{}\n\ntemplate<typename T> inline\ncv::Affine3<T>::Affine3(const Mat4& affine)\n    : matrix(affine)\n{}\n\ntemplate<typename T> inline\ncv::Affine3<T>::Affine3(const Mat3& R, const Vec3& t)\n{\n    rotation(R);\n    translation(t);\n    matrix.val[12] = matrix.val[13] = matrix.val[14] = 0;\n    matrix.val[15] = 1;\n}\n\ntemplate<typename T> inline\ncv::Affine3<T>::Affine3(const Vec3& _rvec, const Vec3& t)\n{\n    rotation(_rvec);\n    translation(t);\n    matrix.val[12] = matrix.val[13] = matrix.val[14] = 0;\n    matrix.val[15] = 1;\n}\n\ntemplate<typename T> inline\ncv::Affine3<T>::Affine3(const cv::Mat& data, const Vec3& t)\n{\n    CV_Assert(data.type() == cv::traits::Type<T>::value);\n    CV_Assert(data.channels() == 1);\n\n    if (data.cols == 4 && data.rows == 4)\n    {\n        data.copyTo(matrix);\n        return;\n    }\n    else if (data.cols == 4 && data.rows == 3)\n    {\n        rotation(data(Rect(0, 0, 3, 3)));\n        translation(data(Rect(3, 0, 1, 3)));\n    }\n    else\n    {\n        rotation(data);\n        translation(t);\n    }\n\n    matrix.val[12] = matrix.val[13] = matrix.val[14] = 0;\n    matrix.val[15] = 1;\n}\n\ntemplate<typename T> inline\ncv::Affine3<T>::Affine3(const float_type* vals) : matrix(vals)\n{}\n\ntemplate<typename T> inline\ncv::Affine3<T> cv::Affine3<T>::Identity()\n{\n    return Affine3<T>(cv::Affine3<T>::Mat4::eye());\n}\n\ntemplate<typename T> inline\nvoid cv::Affine3<T>::rotation(const Mat3& R)\n{\n    linear(R);\n}\n\ntemplate<typename T> inline\nvoid cv::Affine3<T>::rotation(const Vec3& _rvec)\n{\n    double theta = norm(_rvec);\n\n    if (theta < DBL_EPSILON)\n        rotation(Mat3::eye());\n    else\n    {\n        double c = std::cos(theta);\n        double s = std::sin(theta);\n        double c1 = 1. - c;\n        double itheta = (theta != 0) ? 1./theta : 0.;\n\n        Point3_<T> r = _rvec*itheta;\n\n        Mat3 rrt( r.x*r.x, r.x*r.y, r.x*r.z, r.x*r.y, r.y*r.y, r.y*r.z, r.x*r.z, r.y*r.z, r.z*r.z );\n        Mat3 r_x( 0, -r.z, r.y, r.z, 0, -r.x, -r.y, r.x, 0 );\n\n        // R = cos(theta)*I + (1 - cos(theta))*r*rT + sin(theta)*[r_x]\n        // where [r_x] is [0 -rz ry; rz 0 -rx; -ry rx 0]\n        Mat3 R = c*Mat3::eye() + c1*rrt + s*r_x;\n\n        rotation(R);\n    }\n}\n\n//Combines rotation methods above. Supports 3x3, 1x3, 3x1 sizes of data matrix;\ntemplate<typename T> inline\nvoid cv::Affine3<T>::rotation(const cv::Mat& data)\n{\n    CV_Assert(data.type() == cv::traits::Type<T>::value);\n    CV_Assert(data.channels() == 1);\n\n    if (data.cols == 3 && data.rows == 3)\n    {\n        Mat3 R;\n        data.copyTo(R);\n        rotation(R);\n    }\n    else if ((data.cols == 3 && data.rows == 1) || (data.cols == 1 && data.rows == 3))\n    {\n        Vec3 _rvec;\n        data.reshape(1, 3).copyTo(_rvec);\n        rotation(_rvec);\n    }\n    else\n        CV_Error(Error::StsError, \"Input matrix can only be 3x3, 1x3 or 3x1\");\n}\n\ntemplate<typename T> inline\nvoid cv::Affine3<T>::linear(const Mat3& L)\n{\n    matrix.val[0] = L.val[0]; matrix.val[1] = L.val[1];  matrix.val[ 2] = L.val[2];\n    matrix.val[4] = L.val[3]; matrix.val[5] = L.val[4];  matrix.val[ 6] = L.val[5];\n    matrix.val[8] = L.val[6]; matrix.val[9] = L.val[7];  matrix.val[10] = L.val[8];\n}\n\ntemplate<typename T> inline\nvoid cv::Affine3<T>::translation(const Vec3& t)\n{\n    matrix.val[3] = t[0]; matrix.val[7] = t[1]; matrix.val[11] = t[2];\n}\n\ntemplate<typename T> inline\ntypename cv::Affine3<T>::Mat3 cv::Affine3<T>::rotation() const\n{\n    return linear();\n}\n\ntemplate<typename T> inline\ntypename cv::Affine3<T>::Mat3 cv::Affine3<T>::linear() const\n{\n    typename cv::Affine3<T>::Mat3 R;\n    R.val[0] = matrix.val[0];  R.val[1] = matrix.val[1];  R.val[2] = matrix.val[ 2];\n    R.val[3] = matrix.val[4];  R.val[4] = matrix.val[5];  R.val[5] = matrix.val[ 6];\n    R.val[6] = matrix.val[8];  R.val[7] = matrix.val[9];  R.val[8] = matrix.val[10];\n    return R;\n}\n\ntemplate<typename T> inline\ntypename cv::Affine3<T>::Vec3 cv::Affine3<T>::translation() const\n{\n    return Vec3(matrix.val[3], matrix.val[7], matrix.val[11]);\n}\n\ntemplate<typename T> inline\ntypename cv::Affine3<T>::Vec3 cv::Affine3<T>::rvec() const\n{\n    cv::Vec3d w;\n    cv::Matx33d u, vt, R = rotation();\n    cv::SVD::compute(R, w, u, vt, cv::SVD::FULL_UV + cv::SVD::MODIFY_A);\n    R = u * vt;\n\n    double rx = R.val[7] - R.val[5];\n    double ry = R.val[2] - R.val[6];\n    double rz = R.val[3] - R.val[1];\n\n    double s = std::sqrt((rx*rx + ry*ry + rz*rz)*0.25);\n    double c = (R.val[0] + R.val[4] + R.val[8] - 1) * 0.5;\n    c = c > 1.0 ? 1.0 : c < -1.0 ? -1.0 : c;\n    double theta = std::acos(c);\n\n    if( s < 1e-5 )\n    {\n        if( c > 0 )\n            rx = ry = rz = 0;\n        else\n        {\n            double t;\n            t = (R.val[0] + 1) * 0.5;\n            rx = std::sqrt(std::max(t, 0.0));\n            t = (R.val[4] + 1) * 0.5;\n            ry = std::sqrt(std::max(t, 0.0)) * (R.val[1] < 0 ? -1.0 : 1.0);\n            t = (R.val[8] + 1) * 0.5;\n            rz = std::sqrt(std::max(t, 0.0)) * (R.val[2] < 0 ? -1.0 : 1.0);\n\n            if( fabs(rx) < fabs(ry) && fabs(rx) < fabs(rz) && (R.val[5] > 0) != (ry*rz > 0) )\n                rz = -rz;\n            theta /= std::sqrt(rx*rx + ry*ry + rz*rz);\n            rx *= theta;\n            ry *= theta;\n            rz *= theta;\n        }\n    }\n    else\n    {\n        double vth = 1/(2*s);\n        vth *= theta;\n        rx *= vth; ry *= vth; rz *= vth;\n    }\n\n    return cv::Vec3d(rx, ry, rz);\n}\n\ntemplate<typename T> inline\ncv::Affine3<T> cv::Affine3<T>::inv(int method) const\n{\n    return matrix.inv(method);\n}\n\ntemplate<typename T> inline\ncv::Affine3<T> cv::Affine3<T>::rotate(const Mat3& R) const\n{\n    Mat3 Lc = linear();\n    Vec3 tc = translation();\n    Mat4 result;\n    result.val[12] = result.val[13] = result.val[14] = 0;\n    result.val[15] = 1;\n\n    for(int j = 0; j < 3; ++j)\n    {\n        for(int i = 0; i < 3; ++i)\n        {\n            float_type value = 0;\n            for(int k = 0; k < 3; ++k)\n                value += R(j, k) * Lc(k, i);\n            result(j, i) = value;\n        }\n\n        result(j, 3) = R.row(j).dot(tc.t());\n    }\n    return result;\n}\n\ntemplate<typename T> inline\ncv::Affine3<T> cv::Affine3<T>::rotate(const Vec3& _rvec) const\n{\n    return rotate(Affine3f(_rvec).rotation());\n}\n\ntemplate<typename T> inline\ncv::Affine3<T> cv::Affine3<T>::translate(const Vec3& t) const\n{\n    Mat4 m = matrix;\n    m.val[ 3] += t[0];\n    m.val[ 7] += t[1];\n    m.val[11] += t[2];\n    return m;\n}\n\ntemplate<typename T> inline\ncv::Affine3<T> cv::Affine3<T>::concatenate(const Affine3<T>& affine) const\n{\n    return (*this).rotate(affine.rotation()).translate(affine.translation());\n}\n\ntemplate<typename T> template <typename Y> inline\ncv::Affine3<T>::operator Affine3<Y>() const\n{\n    return Affine3<Y>(matrix);\n}\n\ntemplate<typename T> template <typename Y> inline\ncv::Affine3<Y> cv::Affine3<T>::cast() const\n{\n    return Affine3<Y>(matrix);\n}\n\ntemplate<typename T> inline\ncv::Affine3<T> cv::operator*(const cv::Affine3<T>& affine1, const cv::Affine3<T>& affine2)\n{\n    return affine2.concatenate(affine1);\n}\n\ntemplate<typename T, typename V> inline\nV cv::operator*(const cv::Affine3<T>& affine, const V& v)\n{\n    const typename Affine3<T>::Mat4& m = affine.matrix;\n\n    V r;\n    r.x = m.val[0] * v.x + m.val[1] * v.y + m.val[ 2] * v.z + m.val[ 3];\n    r.y = m.val[4] * v.x + m.val[5] * v.y + m.val[ 6] * v.z + m.val[ 7];\n    r.z = m.val[8] * v.x + m.val[9] * v.y + m.val[10] * v.z + m.val[11];\n    return r;\n}\n\nstatic inline\ncv::Vec3f cv::operator*(const cv::Affine3f& affine, const cv::Vec3f& v)\n{\n    const cv::Matx44f& m = affine.matrix;\n    cv::Vec3f r;\n    r.val[0] = m.val[0] * v[0] + m.val[1] * v[1] + m.val[ 2] * v[2] + m.val[ 3];\n    r.val[1] = m.val[4] * v[0] + m.val[5] * v[1] + m.val[ 6] * v[2] + m.val[ 7];\n    r.val[2] = m.val[8] * v[0] + m.val[9] * v[1] + m.val[10] * v[2] + m.val[11];\n    return r;\n}\n\nstatic inline\ncv::Vec3d cv::operator*(const cv::Affine3d& affine, const cv::Vec3d& v)\n{\n    const cv::Matx44d& m = affine.matrix;\n    cv::Vec3d r;\n    r.val[0] = m.val[0] * v[0] + m.val[1] * v[1] + m.val[ 2] * v[2] + m.val[ 3];\n    r.val[1] = m.val[4] * v[0] + m.val[5] * v[1] + m.val[ 6] * v[2] + m.val[ 7];\n    r.val[2] = m.val[8] * v[0] + m.val[9] * v[1] + m.val[10] * v[2] + m.val[11];\n    return r;\n}\n\n\n\n#if defined EIGEN_WORLD_VERSION && defined EIGEN_GEOMETRY_MODULE_H\n\ntemplate<typename T> inline\ncv::Affine3<T>::Affine3(const Eigen::Transform<T, 3, Eigen::Affine, (Eigen::RowMajor)>& affine)\n{\n    cv::Mat(4, 4, cv::traits::Type<T>::value, affine.matrix().data()).copyTo(matrix);\n}\n\ntemplate<typename T> inline\ncv::Affine3<T>::Affine3(const Eigen::Transform<T, 3, Eigen::Affine>& affine)\n{\n    Eigen::Transform<T, 3, Eigen::Affine, (Eigen::RowMajor)> a = affine;\n    cv::Mat(4, 4, cv::traits::Type<T>::value, a.matrix().data()).copyTo(matrix);\n}\n\ntemplate<typename T> inline\ncv::Affine3<T>::operator Eigen::Transform<T, 3, Eigen::Affine, (Eigen::RowMajor)>() const\n{\n    Eigen::Transform<T, 3, Eigen::Affine, (Eigen::RowMajor)> r;\n    cv::Mat hdr(4, 4, cv::traits::Type<T>::value, r.matrix().data());\n    cv::Mat(matrix, false).copyTo(hdr);\n    return r;\n}\n\ntemplate<typename T> inline\ncv::Affine3<T>::operator Eigen::Transform<T, 3, Eigen::Affine>() const\n{\n    return this->operator Eigen::Transform<T, 3, Eigen::Affine, (Eigen::RowMajor)>();\n}\n\n#endif /* defined EIGEN_WORLD_VERSION && defined EIGEN_GEOMETRY_MODULE_H */\n\n//! @endcond\n\n#endif /* __cplusplus */\n\n#endif /* OPENCV_CORE_AFFINE3_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/async.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_ASYNC_HPP\n#define OPENCV_CORE_ASYNC_HPP\n\n#include <opencv2/core/mat.hpp>\n\n#ifdef CV_CXX11\n//#include <future>\n#include <chrono>\n#endif\n\nnamespace cv {\n\n/** @addtogroup core_async\n\n@{\n*/\n\n\n/** @brief Returns result of asynchronous operations\n\nObject has attached asynchronous state.\nAssignment operator doesn't clone asynchronous state (it is shared between all instances).\n\nResult can be fetched via get() method only once.\n\n*/\nclass CV_EXPORTS_W AsyncArray\n{\npublic:\n    ~AsyncArray() CV_NOEXCEPT;\n    CV_WRAP AsyncArray() CV_NOEXCEPT;\n    AsyncArray(const AsyncArray& o) CV_NOEXCEPT;\n    AsyncArray& operator=(const AsyncArray& o) CV_NOEXCEPT;\n    CV_WRAP void release() CV_NOEXCEPT;\n\n    /** Fetch the result.\n    @param[out] dst destination array\n\n    Waits for result until container has valid result.\n    Throws exception if exception was stored as a result.\n\n    Throws exception on invalid container state.\n\n    @note Result or stored exception can be fetched only once.\n    */\n    CV_WRAP void get(OutputArray dst) const;\n\n    /** Retrieving the result with timeout\n    @param[out] dst destination array\n    @param[in] timeoutNs timeout in nanoseconds, -1 for infinite wait\n\n    @returns true if result is ready, false if the timeout has expired\n\n    @note Result or stored exception can be fetched only once.\n    */\n    bool get(OutputArray dst, int64 timeoutNs) const;\n\n    CV_WRAP inline\n    bool get(OutputArray dst, double timeoutNs) const { return get(dst, (int64)timeoutNs); }\n\n    bool wait_for(int64 timeoutNs) const;\n\n    CV_WRAP inline\n    bool wait_for(double timeoutNs) const { return wait_for((int64)timeoutNs); }\n\n    CV_WRAP bool valid() const CV_NOEXCEPT;\n\n#ifdef CV_CXX11\n    inline AsyncArray(AsyncArray&& o) { p = o.p; o.p = NULL; }\n    inline AsyncArray& operator=(AsyncArray&& o) CV_NOEXCEPT { std::swap(p, o.p); return *this; }\n\n    template<typename _Rep, typename _Period>\n    inline bool get(OutputArray dst, const std::chrono::duration<_Rep, _Period>& timeout)\n    {\n        return get(dst, (int64)(std::chrono::nanoseconds(timeout).count()));\n    }\n\n    template<typename _Rep, typename _Period>\n    inline bool wait_for(const std::chrono::duration<_Rep, _Period>& timeout)\n    {\n        return wait_for((int64)(std::chrono::nanoseconds(timeout).count()));\n    }\n\n#if 0\n    std::future<Mat> getFutureMat() const;\n    std::future<UMat> getFutureUMat() const;\n#endif\n#endif\n\n\n    // PImpl\n    struct Impl; friend struct Impl;\n    inline void* _getImpl() const CV_NOEXCEPT { return p; }\nprotected:\n    Impl* p;\n};\n\n\n//! @}\n} // namespace\n#endif // OPENCV_CORE_ASYNC_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/base.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2014, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_BASE_HPP\n#define OPENCV_CORE_BASE_HPP\n\n#ifndef __cplusplus\n#  error base.hpp header must be compiled as C++\n#endif\n\n#include \"opencv2/opencv_modules.hpp\"\n\n#include <climits>\n#include <algorithm>\n\n#include \"opencv2/core/cvdef.h\"\n#include \"opencv2/core/cvstd.hpp\"\n\nnamespace cv\n{\n\n//! @addtogroup core_utils\n//! @{\n\nnamespace Error {\n//! error codes\nenum Code {\n    StsOk=                       0,  //!< everything is ok\n    StsBackTrace=               -1,  //!< pseudo error for back trace\n    StsError=                   -2,  //!< unknown /unspecified error\n    StsInternal=                -3,  //!< internal error (bad state)\n    StsNoMem=                   -4,  //!< insufficient memory\n    StsBadArg=                  -5,  //!< function arg/param is bad\n    StsBadFunc=                 -6,  //!< unsupported function\n    StsNoConv=                  -7,  //!< iteration didn't converge\n    StsAutoTrace=               -8,  //!< tracing\n    HeaderIsNull=               -9,  //!< image header is NULL\n    BadImageSize=              -10,  //!< image size is invalid\n    BadOffset=                 -11,  //!< offset is invalid\n    BadDataPtr=                -12,  //!<\n    BadStep=                   -13,  //!< image step is wrong, this may happen for a non-continuous matrix.\n    BadModelOrChSeq=           -14,  //!<\n    BadNumChannels=            -15,  //!< bad number of channels, for example, some functions accept only single channel matrices.\n    BadNumChannel1U=           -16,  //!<\n    BadDepth=                  -17,  //!< input image depth is not supported by the function\n    BadAlphaChannel=           -18,  //!<\n    BadOrder=                  -19,  //!< number of dimensions is out of range\n    BadOrigin=                 -20,  //!< incorrect input origin\n    BadAlign=                  -21,  //!< incorrect input align\n    BadCallBack=               -22,  //!<\n    BadTileSize=               -23,  //!<\n    BadCOI=                    -24,  //!< input COI is not supported\n    BadROISize=                -25,  //!< incorrect input roi\n    MaskIsTiled=               -26,  //!<\n    StsNullPtr=                -27,  //!< null pointer\n    StsVecLengthErr=           -28,  //!< incorrect vector length\n    StsFilterStructContentErr= -29,  //!< incorrect filter structure content\n    StsKernelStructContentErr= -30,  //!< incorrect transform kernel content\n    StsFilterOffsetErr=        -31,  //!< incorrect filter offset value\n    StsBadSize=                -201, //!< the input/output structure size is incorrect\n    StsDivByZero=              -202, //!< division by zero\n    StsInplaceNotSupported=    -203, //!< in-place operation is not supported\n    StsObjectNotFound=         -204, //!< request can't be completed\n    StsUnmatchedFormats=       -205, //!< formats of input/output arrays differ\n    StsBadFlag=                -206, //!< flag is wrong or not supported\n    StsBadPoint=               -207, //!< bad CvPoint\n    StsBadMask=                -208, //!< bad format of mask (neither 8uC1 nor 8sC1)\n    StsUnmatchedSizes=         -209, //!< sizes of input/output structures do not match\n    StsUnsupportedFormat=      -210, //!< the data format/type is not supported by the function\n    StsOutOfRange=             -211, //!< some of parameters are out of range\n    StsParseError=             -212, //!< invalid syntax/structure of the parsed file\n    StsNotImplemented=         -213, //!< the requested function/feature is not implemented\n    StsBadMemBlock=            -214, //!< an allocated block has been corrupted\n    StsAssert=                 -215, //!< assertion failed\n    GpuNotSupported=           -216, //!< no CUDA support\n    GpuApiCallError=           -217, //!< GPU API call error\n    OpenGlNotSupported=        -218, //!< no OpenGL support\n    OpenGlApiCallError=        -219, //!< OpenGL API call error\n    OpenCLApiCallError=        -220, //!< OpenCL API call error\n    OpenCLDoubleNotSupported=  -221,\n    OpenCLInitError=           -222, //!< OpenCL initialization error\n    OpenCLNoAMDBlasFft=        -223\n};\n} //Error\n\n//! @} core_utils\n\n//! @addtogroup core_array\n//! @{\n\n//! matrix decomposition types\nenum DecompTypes {\n    /** Gaussian elimination with the optimal pivot element chosen. */\n    DECOMP_LU       = 0,\n    /** singular value decomposition (SVD) method; the system can be over-defined and/or the matrix\n    src1 can be singular */\n    DECOMP_SVD      = 1,\n    /** eigenvalue decomposition; the matrix src1 must be symmetrical */\n    DECOMP_EIG      = 2,\n    /** Cholesky \\f$LL^T\\f$ factorization; the matrix src1 must be symmetrical and positively\n    defined */\n    DECOMP_CHOLESKY = 3,\n    /** QR factorization; the system can be over-defined and/or the matrix src1 can be singular */\n    DECOMP_QR       = 4,\n    /** while all the previous flags are mutually exclusive, this flag can be used together with\n    any of the previous; it means that the normal equations\n    \\f$\\texttt{src1}^T\\cdot\\texttt{src1}\\cdot\\texttt{dst}=\\texttt{src1}^T\\texttt{src2}\\f$ are\n    solved instead of the original system\n    \\f$\\texttt{src1}\\cdot\\texttt{dst}=\\texttt{src2}\\f$ */\n    DECOMP_NORMAL   = 16\n};\n\n/** norm types\n\nsrc1 and src2 denote input arrays.\n*/\n\nenum NormTypes {\n                /**\n                \\f[\n                norm =  \\forkthree\n                {\\|\\texttt{src1}\\|_{L_{\\infty}} =  \\max _I | \\texttt{src1} (I)|}{if  \\(\\texttt{normType} = \\texttt{NORM_INF}\\) }\n                {\\|\\texttt{src1}-\\texttt{src2}\\|_{L_{\\infty}} =  \\max _I | \\texttt{src1} (I) -  \\texttt{src2} (I)|}{if  \\(\\texttt{normType} = \\texttt{NORM_INF}\\) }\n                {\\frac{\\|\\texttt{src1}-\\texttt{src2}\\|_{L_{\\infty}}    }{\\|\\texttt{src2}\\|_{L_{\\infty}} }}{if  \\(\\texttt{normType} = \\texttt{NORM_RELATIVE | NORM_INF}\\) }\n                \\f]\n                */\n                NORM_INF       = 1,\n                /**\n                \\f[\n                norm =  \\forkthree\n                {\\| \\texttt{src1} \\| _{L_1} =  \\sum _I | \\texttt{src1} (I)|}{if  \\(\\texttt{normType} = \\texttt{NORM_L1}\\)}\n                { \\| \\texttt{src1} - \\texttt{src2} \\| _{L_1} =  \\sum _I | \\texttt{src1} (I) -  \\texttt{src2} (I)|}{if  \\(\\texttt{normType} = \\texttt{NORM_L1}\\) }\n                { \\frac{\\|\\texttt{src1}-\\texttt{src2}\\|_{L_1} }{\\|\\texttt{src2}\\|_{L_1}} }{if  \\(\\texttt{normType} = \\texttt{NORM_RELATIVE | NORM_L1}\\) }\n                \\f]*/\n                 NORM_L1        = 2,\n                 /**\n                 \\f[\n                 norm =  \\forkthree\n                 { \\| \\texttt{src1} \\| _{L_2} =  \\sqrt{\\sum_I \\texttt{src1}(I)^2} }{if  \\(\\texttt{normType} = \\texttt{NORM_L2}\\) }\n                 { \\| \\texttt{src1} - \\texttt{src2} \\| _{L_2} =  \\sqrt{\\sum_I (\\texttt{src1}(I) - \\texttt{src2}(I))^2} }{if  \\(\\texttt{normType} = \\texttt{NORM_L2}\\) }\n                 { \\frac{\\|\\texttt{src1}-\\texttt{src2}\\|_{L_2} }{\\|\\texttt{src2}\\|_{L_2}} }{if  \\(\\texttt{normType} = \\texttt{NORM_RELATIVE | NORM_L2}\\) }\n                 \\f]\n                 */\n                 NORM_L2        = 4,\n                 /**\n                 \\f[\n                 norm =  \\forkthree\n                 { \\| \\texttt{src1} \\| _{L_2} ^{2} = \\sum_I \\texttt{src1}(I)^2} {if  \\(\\texttt{normType} = \\texttt{NORM_L2SQR}\\)}\n                 { \\| \\texttt{src1} - \\texttt{src2} \\| _{L_2} ^{2} =  \\sum_I (\\texttt{src1}(I) - \\texttt{src2}(I))^2 }{if  \\(\\texttt{normType} = \\texttt{NORM_L2SQR}\\) }\n                 { \\left(\\frac{\\|\\texttt{src1}-\\texttt{src2}\\|_{L_2} }{\\|\\texttt{src2}\\|_{L_2}}\\right)^2 }{if  \\(\\texttt{normType} = \\texttt{NORM_RELATIVE | NORM_L2SQR}\\) }\n                 \\f]\n                 */\n                 NORM_L2SQR     = 5,\n                 /**\n                 In the case of one input array, calculates the Hamming distance of the array from zero,\n                 In the case of two input arrays, calculates the Hamming distance between the arrays.\n                 */\n                 NORM_HAMMING   = 6,\n                 /**\n                 Similar to NORM_HAMMING, but in the calculation, each two bits of the input sequence will\n                 be added and treated as a single bit to be used in the same calculation as NORM_HAMMING.\n                 */\n                 NORM_HAMMING2  = 7,\n                 NORM_TYPE_MASK = 7, //!< bit-mask which can be used to separate norm type from norm flags\n                 NORM_RELATIVE  = 8, //!< flag\n                 NORM_MINMAX    = 32 //!< flag\n               };\n\n//! comparison types\nenum CmpTypes { CMP_EQ = 0, //!< src1 is equal to src2.\n                CMP_GT = 1, //!< src1 is greater than src2.\n                CMP_GE = 2, //!< src1 is greater than or equal to src2.\n                CMP_LT = 3, //!< src1 is less than src2.\n                CMP_LE = 4, //!< src1 is less than or equal to src2.\n                CMP_NE = 5  //!< src1 is unequal to src2.\n              };\n\n//! generalized matrix multiplication flags\nenum GemmFlags { GEMM_1_T = 1, //!< transposes src1\n                 GEMM_2_T = 2, //!< transposes src2\n                 GEMM_3_T = 4 //!< transposes src3\n               };\n\nenum DftFlags {\n    /** performs an inverse 1D or 2D transform instead of the default forward\n        transform. */\n    DFT_INVERSE        = 1,\n    /** scales the result: divide it by the number of array elements. Normally, it is\n        combined with DFT_INVERSE. */\n    DFT_SCALE          = 2,\n    /** performs a forward or inverse transform of every individual row of the input\n        matrix; this flag enables you to transform multiple vectors simultaneously and can be used to\n        decrease the overhead (which is sometimes several times larger than the processing itself) to\n        perform 3D and higher-dimensional transformations and so forth.*/\n    DFT_ROWS           = 4,\n    /** performs a forward transformation of 1D or 2D real array; the result,\n        though being a complex array, has complex-conjugate symmetry (*CCS*, see the function\n        description below for details), and such an array can be packed into a real array of the same\n        size as input, which is the fastest option and which is what the function does by default;\n        however, you may wish to get a full complex array (for simpler spectrum analysis, and so on) -\n        pass the flag to enable the function to produce a full-size complex output array. */\n    DFT_COMPLEX_OUTPUT = 16,\n    /** performs an inverse transformation of a 1D or 2D complex array; the\n        result is normally a complex array of the same size, however, if the input array has\n        conjugate-complex symmetry (for example, it is a result of forward transformation with\n        DFT_COMPLEX_OUTPUT flag), the output is a real array; while the function itself does not\n        check whether the input is symmetrical or not, you can pass the flag and then the function\n        will assume the symmetry and produce the real output array (note that when the input is packed\n        into a real array and inverse transformation is executed, the function treats the input as a\n        packed complex-conjugate symmetrical array, and the output will also be a real array). */\n    DFT_REAL_OUTPUT    = 32,\n    /** specifies that input is complex input. If this flag is set, the input must have 2 channels.\n        On the other hand, for backwards compatibility reason, if input has 2 channels, input is\n        already considered complex. */\n    DFT_COMPLEX_INPUT  = 64,\n    /** performs an inverse 1D or 2D transform instead of the default forward transform. */\n    DCT_INVERSE        = DFT_INVERSE,\n    /** performs a forward or inverse transform of every individual row of the input\n        matrix. This flag enables you to transform multiple vectors simultaneously and can be used to\n        decrease the overhead (which is sometimes several times larger than the processing itself) to\n        perform 3D and higher-dimensional transforms and so forth.*/\n    DCT_ROWS           = DFT_ROWS\n};\n\n//! Various border types, image boundaries are denoted with `|`\n//! @see borderInterpolate, copyMakeBorder\nenum BorderTypes {\n    BORDER_CONSTANT    = 0, //!< `iiiiii|abcdefgh|iiiiiii`  with some specified `i`\n    BORDER_REPLICATE   = 1, //!< `aaaaaa|abcdefgh|hhhhhhh`\n    BORDER_REFLECT     = 2, //!< `fedcba|abcdefgh|hgfedcb`\n    BORDER_WRAP        = 3, //!< `cdefgh|abcdefgh|abcdefg`\n    BORDER_REFLECT_101 = 4, //!< `gfedcb|abcdefgh|gfedcba`\n    BORDER_TRANSPARENT = 5, //!< `uvwxyz|abcdefgh|ijklmno`\n\n    BORDER_REFLECT101  = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101\n    BORDER_DEFAULT     = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101\n    BORDER_ISOLATED    = 16 //!< do not look outside of ROI\n};\n\n//! @} core_array\n\n//! @addtogroup core_utils\n//! @{\n\n/*! @brief Signals an error and raises the exception.\n\nBy default the function prints information about the error to stderr,\nthen it either stops if setBreakOnError() had been called before or raises the exception.\nIt is possible to alternate error processing by using redirectError().\n@param _code - error code (Error::Code)\n@param _err - error description\n@param _func - function name. Available only when the compiler supports getting it\n@param _file - source file name where the error has occurred\n@param _line - line number in the source file where the error has occurred\n@see CV_Error, CV_Error_, CV_Assert, CV_DbgAssert\n */\nCV_EXPORTS CV_NORETURN void error(int _code, const String& _err, const char* _func, const char* _file, int _line);\n\n#ifdef CV_STATIC_ANALYSIS\n\n// In practice, some macro are not processed correctly (noreturn is not detected).\n// We need to use simplified definition for them.\n#define CV_Error(code, msg) do { (void)(code); (void)(msg); abort(); } while (0)\n#define CV_Error_(code, args) do { (void)(code); (void)(cv::format args); abort(); } while (0)\n#define CV_Assert( expr ) do { if (!(expr)) abort(); } while (0)\n\n#else // CV_STATIC_ANALYSIS\n\n/** @brief Call the error handler.\n\nCurrently, the error handler prints the error code and the error message to the standard\nerror stream `stderr`. In the Debug configuration, it then provokes memory access violation, so that\nthe execution stack and all the parameters can be analyzed by the debugger. In the Release\nconfiguration, the exception is thrown.\n\n@param code one of Error::Code\n@param msg error message\n*/\n#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )\n\n/**  @brief Call the error handler.\n\nThis macro can be used to construct an error message on-fly to include some dynamic information,\nfor example:\n@code\n    // note the extra parentheses around the formatted text message\n    CV_Error_(Error::StsOutOfRange,\n    (\"the value at (%d, %d)=%g is out of range\", badPt.x, badPt.y, badValue));\n@endcode\n@param code one of Error::Code\n@param args printf-like formatted error message in parentheses\n*/\n#define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ )\n\n/** @brief Checks a condition at runtime and throws exception if it fails\n\nThe macros CV_Assert (and CV_DbgAssert(expr)) evaluate the specified expression. If it is 0, the macros\nraise an error (see cv::error). The macro CV_Assert checks the condition in both Debug and Release\nconfigurations while CV_DbgAssert is only retained in the Debug configuration.\n*/\n#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)\n\n#endif // CV_STATIC_ANALYSIS\n\n//! @cond IGNORED\n#if !defined(__OPENCV_BUILD)  // TODO: backward compatibility only\n#ifndef CV_ErrorNoReturn\n#define CV_ErrorNoReturn CV_Error\n#endif\n#ifndef CV_ErrorNoReturn_\n#define CV_ErrorNoReturn_ CV_Error_\n#endif\n#endif\n\n#define CV_Assert_1 CV_Assert\n#define CV_Assert_2( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_1( __VA_ARGS__ ))\n#define CV_Assert_3( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_2( __VA_ARGS__ ))\n#define CV_Assert_4( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_3( __VA_ARGS__ ))\n#define CV_Assert_5( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_4( __VA_ARGS__ ))\n#define CV_Assert_6( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_5( __VA_ARGS__ ))\n#define CV_Assert_7( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_6( __VA_ARGS__ ))\n#define CV_Assert_8( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_7( __VA_ARGS__ ))\n#define CV_Assert_9( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_8( __VA_ARGS__ ))\n#define CV_Assert_10( expr, ... ) CV_Assert_1(expr); __CV_EXPAND(CV_Assert_9( __VA_ARGS__ ))\n\n#define CV_Assert_N(...) do { __CV_EXPAND(__CV_CAT(CV_Assert_, __CV_VA_NUM_ARGS(__VA_ARGS__)) (__VA_ARGS__)); } while(0)\n\n//! @endcond\n\n#if defined _DEBUG || defined CV_STATIC_ANALYSIS\n#  define CV_DbgAssert(expr) CV_Assert(expr)\n#else\n/** replaced with CV_Assert(expr) in Debug configuration */\n#  define CV_DbgAssert(expr)\n#endif\n\n/*\n * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor\n * bit count of A exclusive XOR'ed with B\n */\nstruct CV_EXPORTS Hamming\n{\n    static const NormTypes normType = NORM_HAMMING;\n    typedef unsigned char ValueType;\n    typedef int ResultType;\n\n    /** this will count the bits in a ^ b\n     */\n    ResultType operator()( const unsigned char* a, const unsigned char* b, int size ) const;\n};\n\ntypedef Hamming HammingLUT;\n\n/////////////////////////////////// inline norms ////////////////////////////////////\n\ntemplate<typename _Tp> inline _Tp cv_abs(_Tp x) { return std::abs(x); }\ninline int cv_abs(uchar x) { return x; }\ninline int cv_abs(schar x) { return std::abs(x); }\ninline int cv_abs(ushort x) { return x; }\ninline int cv_abs(short x) { return std::abs(x); }\n\ntemplate<typename _Tp, typename _AccTp> static inline\n_AccTp normL2Sqr(const _Tp* a, int n)\n{\n    _AccTp s = 0;\n    int i=0;\n#if CV_ENABLE_UNROLLED\n    for( ; i <= n - 4; i += 4 )\n    {\n        _AccTp v0 = a[i], v1 = a[i+1], v2 = a[i+2], v3 = a[i+3];\n        s += v0*v0 + v1*v1 + v2*v2 + v3*v3;\n    }\n#endif\n    for( ; i < n; i++ )\n    {\n        _AccTp v = a[i];\n        s += v*v;\n    }\n    return s;\n}\n\ntemplate<typename _Tp, typename _AccTp> static inline\n_AccTp normL1(const _Tp* a, int n)\n{\n    _AccTp s = 0;\n    int i = 0;\n#if CV_ENABLE_UNROLLED\n    for(; i <= n - 4; i += 4 )\n    {\n        s += (_AccTp)cv_abs(a[i]) + (_AccTp)cv_abs(a[i+1]) +\n            (_AccTp)cv_abs(a[i+2]) + (_AccTp)cv_abs(a[i+3]);\n    }\n#endif\n    for( ; i < n; i++ )\n        s += cv_abs(a[i]);\n    return s;\n}\n\ntemplate<typename _Tp, typename _AccTp> static inline\n_AccTp normInf(const _Tp* a, int n)\n{\n    _AccTp s = 0;\n    for( int i = 0; i < n; i++ )\n        s = std::max(s, (_AccTp)cv_abs(a[i]));\n    return s;\n}\n\ntemplate<typename _Tp, typename _AccTp> static inline\n_AccTp normL2Sqr(const _Tp* a, const _Tp* b, int n)\n{\n    _AccTp s = 0;\n    int i= 0;\n#if CV_ENABLE_UNROLLED\n    for(; i <= n - 4; i += 4 )\n    {\n        _AccTp v0 = _AccTp(a[i] - b[i]), v1 = _AccTp(a[i+1] - b[i+1]), v2 = _AccTp(a[i+2] - b[i+2]), v3 = _AccTp(a[i+3] - b[i+3]);\n        s += v0*v0 + v1*v1 + v2*v2 + v3*v3;\n    }\n#endif\n    for( ; i < n; i++ )\n    {\n        _AccTp v = _AccTp(a[i] - b[i]);\n        s += v*v;\n    }\n    return s;\n}\n\nstatic inline float normL2Sqr(const float* a, const float* b, int n)\n{\n    float s = 0.f;\n    for( int i = 0; i < n; i++ )\n    {\n        float v = a[i] - b[i];\n        s += v*v;\n    }\n    return s;\n}\n\ntemplate<typename _Tp, typename _AccTp> static inline\n_AccTp normL1(const _Tp* a, const _Tp* b, int n)\n{\n    _AccTp s = 0;\n    int i= 0;\n#if CV_ENABLE_UNROLLED\n    for(; i <= n - 4; i += 4 )\n    {\n        _AccTp v0 = _AccTp(a[i] - b[i]), v1 = _AccTp(a[i+1] - b[i+1]), v2 = _AccTp(a[i+2] - b[i+2]), v3 = _AccTp(a[i+3] - b[i+3]);\n        s += std::abs(v0) + std::abs(v1) + std::abs(v2) + std::abs(v3);\n    }\n#endif\n    for( ; i < n; i++ )\n    {\n        _AccTp v = _AccTp(a[i] - b[i]);\n        s += std::abs(v);\n    }\n    return s;\n}\n\ninline float normL1(const float* a, const float* b, int n)\n{\n    float s = 0.f;\n    for( int i = 0; i < n; i++ )\n    {\n        s += std::abs(a[i] - b[i]);\n    }\n    return s;\n}\n\ninline int normL1(const uchar* a, const uchar* b, int n)\n{\n    int s = 0;\n    for( int i = 0; i < n; i++ )\n    {\n        s += std::abs(a[i] - b[i]);\n    }\n    return s;\n}\n\ntemplate<typename _Tp, typename _AccTp> static inline\n_AccTp normInf(const _Tp* a, const _Tp* b, int n)\n{\n    _AccTp s = 0;\n    for( int i = 0; i < n; i++ )\n    {\n        _AccTp v0 = a[i] - b[i];\n        s = std::max(s, std::abs(v0));\n    }\n    return s;\n}\n\n/** @brief Computes the cube root of an argument.\n\n The function cubeRoot computes \\f$\\sqrt[3]{\\texttt{val}}\\f$. Negative arguments are handled correctly.\n NaN and Inf are not handled. The accuracy approaches the maximum possible accuracy for\n single-precision data.\n @param val A function argument.\n */\nCV_EXPORTS_W float cubeRoot(float val);\n\n/** @overload\n\ncubeRoot with argument of `double` type calls `std::cbrt(double)`\n*/\nstatic inline\ndouble cubeRoot(double val)\n{\n    return std::cbrt(val);\n}\n\n/** @brief Calculates the angle of a 2D vector in degrees.\n\n The function fastAtan2 calculates the full-range angle of an input 2D vector. The angle is measured\n in degrees and varies from 0 to 360 degrees. The accuracy is about 0.3 degrees.\n @param x x-coordinate of the vector.\n @param y y-coordinate of the vector.\n */\nCV_EXPORTS_W float fastAtan2(float y, float x);\n\n/** proxy for hal::LU */\nCV_EXPORTS int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n);\n/** proxy for hal::LU */\nCV_EXPORTS int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n);\n/** proxy for hal::Cholesky */\nCV_EXPORTS bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n);\n/** proxy for hal::Cholesky */\nCV_EXPORTS bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n);\n\n////////////////// forward declarations for important OpenCV types //////////////////\n\n//! @cond IGNORED\n\ntemplate<typename _Tp, int cn> class Vec;\ntemplate<typename _Tp, int m, int n> class Matx;\n\ntemplate<typename _Tp> class Complex;\ntemplate<typename _Tp> class Point_;\ntemplate<typename _Tp> class Point3_;\ntemplate<typename _Tp> class Size_;\ntemplate<typename _Tp> class Rect_;\ntemplate<typename _Tp> class Scalar_;\n\nclass CV_EXPORTS RotatedRect;\nclass CV_EXPORTS Range;\nclass CV_EXPORTS TermCriteria;\nclass CV_EXPORTS KeyPoint;\nclass CV_EXPORTS DMatch;\nclass CV_EXPORTS RNG;\n\nclass CV_EXPORTS Mat;\nclass CV_EXPORTS MatExpr;\n\nclass CV_EXPORTS UMat;\n\nclass CV_EXPORTS SparseMat;\ntypedef Mat MatND;\n\ntemplate<typename _Tp> class Mat_;\ntemplate<typename _Tp> class SparseMat_;\n\nclass CV_EXPORTS MatConstIterator;\nclass CV_EXPORTS SparseMatIterator;\nclass CV_EXPORTS SparseMatConstIterator;\ntemplate<typename _Tp> class MatIterator_;\ntemplate<typename _Tp> class MatConstIterator_;\ntemplate<typename _Tp> class SparseMatIterator_;\ntemplate<typename _Tp> class SparseMatConstIterator_;\n\nnamespace ogl\n{\n    class CV_EXPORTS Buffer;\n    class CV_EXPORTS Texture2D;\n    class CV_EXPORTS Arrays;\n}\n\nnamespace cuda\n{\n    class CV_EXPORTS GpuMat;\n    class CV_EXPORTS HostMem;\n    class CV_EXPORTS Stream;\n    class CV_EXPORTS Event;\n}\n\nnamespace cudev\n{\n    template <typename _Tp> class GpuMat_;\n}\n\nnamespace ipp\n{\nCV_EXPORTS   unsigned long long getIppFeatures();\nCV_EXPORTS   void setIppStatus(int status, const char * const funcname = NULL, const char * const filename = NULL,\n                             int line = 0);\nCV_EXPORTS   int getIppStatus();\nCV_EXPORTS   String getIppErrorLocation();\nCV_EXPORTS_W bool   useIPP();\nCV_EXPORTS_W void   setUseIPP(bool flag);\nCV_EXPORTS_W String getIppVersion();\n\n// IPP Not-Exact mode. This function may force use of IPP then both IPP and OpenCV provide proper results\n// but have internal accuracy differences which have too much direct or indirect impact on accuracy tests.\nCV_EXPORTS_W bool useIPP_NotExact();\nCV_EXPORTS_W void setUseIPP_NotExact(bool flag);\n#ifndef DISABLE_OPENCV_3_COMPATIBILITY\nstatic inline bool useIPP_NE() { return useIPP_NotExact(); }\nstatic inline void setUseIPP_NE(bool flag) { setUseIPP_NotExact(flag); }\n#endif\n\n} // ipp\n\n//! @endcond\n\n//! @} core_utils\n\n\n\n\n} // cv\n\n#include \"opencv2/core/neon_utils.hpp\"\n#include \"opencv2/core/vsx_utils.hpp\"\n#include \"opencv2/core/check.hpp\"\n\n#endif //OPENCV_CORE_BASE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/bindings_utils.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_BINDINGS_UTILS_HPP\n#define OPENCV_CORE_BINDINGS_UTILS_HPP\n\n#include <opencv2/core/async.hpp>\n#include <opencv2/core/detail/async_promise.hpp>\n#include <opencv2/core/utils/logger.hpp>\n\n#include <stdexcept>\n\nnamespace cv { namespace utils {\n//! @addtogroup core_utils\n//! @{\n\nCV_EXPORTS_W String dumpInputArray(InputArray argument);\n\nCV_EXPORTS_W String dumpInputArrayOfArrays(InputArrayOfArrays argument);\n\nCV_EXPORTS_W String dumpInputOutputArray(InputOutputArray argument);\n\nCV_EXPORTS_W String dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument);\n\nCV_WRAP static inline\nString dumpBool(bool argument)\n{\n    return (argument) ? String(\"Bool: True\") : String(\"Bool: False\");\n}\n\nCV_WRAP static inline\nString dumpInt(int argument)\n{\n    return cv::format(\"Int: %d\", argument);\n}\n\nCV_WRAP static inline\nString dumpSizeT(size_t argument)\n{\n    std::ostringstream oss(\"size_t: \", std::ios::ate);\n    oss << argument;\n    return oss.str();\n}\n\nCV_WRAP static inline\nString dumpFloat(float argument)\n{\n    return cv::format(\"Float: %.2f\", argument);\n}\n\nCV_WRAP static inline\nString dumpDouble(double argument)\n{\n    return cv::format(\"Double: %.2f\", argument);\n}\n\nCV_WRAP static inline\nString dumpCString(const char* argument)\n{\n    return cv::format(\"String: %s\", argument);\n}\n\nCV_WRAP static inline\nString dumpString(const String& argument)\n{\n    return cv::format(\"String: %s\", argument.c_str());\n}\n\nCV_WRAP static inline\nString testOverloadResolution(int value, const Point& point = Point(42, 24))\n{\n    return format(\"overload (int=%d, point=(x=%d, y=%d))\", value, point.x,\n                  point.y);\n}\n\nCV_WRAP static inline\nString testOverloadResolution(const Rect& rect)\n{\n    return format(\"overload (rect=(x=%d, y=%d, w=%d, h=%d))\", rect.x, rect.y,\n                  rect.width, rect.height);\n}\n\nCV_WRAP static inline\nString dumpRect(const Rect& argument)\n{\n    return format(\"rect: (x=%d, y=%d, w=%d, h=%d)\", argument.x, argument.y,\n                  argument.width, argument.height);\n}\n\nCV_WRAP static inline\nString dumpTermCriteria(const TermCriteria& argument)\n{\n    return format(\"term_criteria: (type=%d, max_count=%d, epsilon=%lf\",\n                  argument.type, argument.maxCount, argument.epsilon);\n}\n\nCV_WRAP static inline\nString dumpRotatedRect(const RotatedRect& argument)\n{\n    return format(\"rotated_rect: (c_x=%f, c_y=%f, w=%f, h=%f, a=%f)\",\n                  argument.center.x, argument.center.y, argument.size.width,\n                  argument.size.height, argument.angle);\n}\n\nCV_WRAP static inline\nString dumpRange(const Range& argument)\n{\n    if (argument == Range::all())\n    {\n        return \"range: all\";\n    }\n    else\n    {\n        return format(\"range: (s=%d, e=%d)\", argument.start, argument.end);\n    }\n}\n\nCV_WRAP static inline\nvoid testRaiseGeneralException()\n{\n    throw std::runtime_error(\"exception text\");\n}\n\nCV_WRAP static inline\nAsyncArray testAsyncArray(InputArray argument)\n{\n    AsyncPromise p;\n    p.setValue(argument);\n    return p.getArrayResult();\n}\n\nCV_WRAP static inline\nAsyncArray testAsyncException()\n{\n    AsyncPromise p;\n    try\n    {\n        CV_Error(Error::StsOk, \"Test: Generated async error\");\n    }\n    catch (const cv::Exception& e)\n    {\n        p.setException(e);\n    }\n    return p.getArrayResult();\n}\n\nnamespace fs {\n    CV_EXPORTS_W cv::String getCacheDirectoryForDownloads();\n} // namespace fs\n\n//! @}  // core_utils\n}  // namespace cv::utils\n\n//! @cond IGNORED\n\nCV_WRAP static inline\nint setLogLevel(int level)\n{\n    // NB: Binding generators doesn't work with enums properly yet, so we define separate overload here\n    return cv::utils::logging::setLogLevel((cv::utils::logging::LogLevel)level);\n}\n\nCV_WRAP static inline\nint getLogLevel()\n{\n    return cv::utils::logging::getLogLevel();\n}\n\n//! @endcond IGNORED\n\n} // namespaces cv /  utils\n\n#endif // OPENCV_CORE_BINDINGS_UTILS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/bufferpool.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.\n\n#ifndef OPENCV_CORE_BUFFER_POOL_HPP\n#define OPENCV_CORE_BUFFER_POOL_HPP\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable: 4265)\n#endif\n\nnamespace cv\n{\n\n//! @addtogroup core\n//! @{\n\nclass BufferPoolController\n{\nprotected:\n    ~BufferPoolController() { }\npublic:\n    virtual size_t getReservedSize() const = 0;\n    virtual size_t getMaxReservedSize() const = 0;\n    virtual void setMaxReservedSize(size_t size) = 0;\n    virtual void freeAllReservedBuffers() = 0;\n};\n\n//! @}\n\n}\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif // OPENCV_CORE_BUFFER_POOL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/check.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_CHECK_HPP\n#define OPENCV_CORE_CHECK_HPP\n\n#include <opencv2/core/base.hpp>\n\nnamespace cv {\n\n/** Returns string of cv::Mat depth value: CV_8U -> \"CV_8U\" or \"<invalid depth>\" */\nCV_EXPORTS const char* depthToString(int depth);\n\n/** Returns string of cv::Mat depth value: CV_8UC3 -> \"CV_8UC3\" or \"<invalid type>\" */\nCV_EXPORTS const String typeToString(int type);\n\n\n//! @cond IGNORED\nnamespace detail {\n\n/** Returns string of cv::Mat depth value: CV_8U -> \"CV_8U\" or NULL */\nCV_EXPORTS const char* depthToString_(int depth);\n\n/** Returns string of cv::Mat depth value: CV_8UC3 -> \"CV_8UC3\" or cv::String() */\nCV_EXPORTS const cv::String typeToString_(int type);\n\nenum TestOp {\n  TEST_CUSTOM = 0,\n  TEST_EQ = 1,\n  TEST_NE = 2,\n  TEST_LE = 3,\n  TEST_LT = 4,\n  TEST_GE = 5,\n  TEST_GT = 6,\n  CV__LAST_TEST_OP\n};\n\nstruct CheckContext {\n    const char* func;\n    const char* file;\n    int line;\n    enum TestOp testOp;\n    const char* message;\n    const char* p1_str;\n    const char* p2_str;\n};\n\n#ifndef CV__CHECK_FILENAME\n# define CV__CHECK_FILENAME __FILE__\n#endif\n\n#ifndef CV__CHECK_FUNCTION\n# if defined _MSC_VER\n#   define CV__CHECK_FUNCTION __FUNCSIG__\n# elif defined __GNUC__\n#   define CV__CHECK_FUNCTION __PRETTY_FUNCTION__\n# else\n#   define CV__CHECK_FUNCTION \"<unknown>\"\n# endif\n#endif\n\n#define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__)\n#define CV__DEFINE_CHECK_CONTEXT(id, message, testOp, p1_str, p2_str) \\\n    static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \\\n            { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, \"\" message, \"\" p1_str, \"\" p2_str }\n\nCV_EXPORTS void CV_NORETURN check_failed_auto(const int v1, const int v2, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v1, const size_t v2, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_auto(const float v1, const float v2, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_auto(const double v1, const double v2, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_auto(const Size_<int> v1, const Size_<int> v2, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_MatDepth(const int v1, const int v2, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_MatType(const int v1, const int v2, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_MatChannels(const int v1, const int v2, const CheckContext& ctx);\n\nCV_EXPORTS void CV_NORETURN check_failed_auto(const int v, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_auto(const float v, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_auto(const double v, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_auto(const Size_<int> v, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_auto(const std::string& v1, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_MatDepth(const int v, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_MatType(const int v, const CheckContext& ctx);\nCV_EXPORTS void CV_NORETURN check_failed_MatChannels(const int v, const CheckContext& ctx);\n\n\n#define CV__TEST_EQ(v1, v2) ((v1) == (v2))\n#define CV__TEST_NE(v1, v2) ((v1) != (v2))\n#define CV__TEST_LE(v1, v2) ((v1) <= (v2))\n#define CV__TEST_LT(v1, v2) ((v1) < (v2))\n#define CV__TEST_GE(v1, v2) ((v1) >= (v2))\n#define CV__TEST_GT(v1, v2) ((v1) > (v2))\n\n#define CV__CHECK(id, op, type, v1, v2, v1_str, v2_str, msg_str) do { \\\n    if(CV__TEST_##op((v1), (v2))) ; else { \\\n        CV__DEFINE_CHECK_CONTEXT(id, msg_str, cv::detail::TEST_ ## op, v1_str, v2_str); \\\n        cv::detail::check_failed_ ## type((v1), (v2), CV__CHECK_LOCATION_VARNAME(id)); \\\n    } \\\n} while (0)\n\n#define CV__CHECK_CUSTOM_TEST(id, type, v, test_expr, v_str, test_expr_str, msg_str) do { \\\n    if(!!(test_expr)) ; else { \\\n        CV__DEFINE_CHECK_CONTEXT(id, msg_str, cv::detail::TEST_CUSTOM, v_str, test_expr_str); \\\n        cv::detail::check_failed_ ## type((v), CV__CHECK_LOCATION_VARNAME(id)); \\\n    } \\\n} while (0)\n\n} // namespace\n//! @endcond\n\n\n/// Supported values of these types: int, float, double\n#define CV_CheckEQ(v1, v2, msg)  CV__CHECK(_, EQ, auto, v1, v2, #v1, #v2, msg)\n#define CV_CheckNE(v1, v2, msg)  CV__CHECK(_, NE, auto, v1, v2, #v1, #v2, msg)\n#define CV_CheckLE(v1, v2, msg)  CV__CHECK(_, LE, auto, v1, v2, #v1, #v2, msg)\n#define CV_CheckLT(v1, v2, msg)  CV__CHECK(_, LT, auto, v1, v2, #v1, #v2, msg)\n#define CV_CheckGE(v1, v2, msg)  CV__CHECK(_, GE, auto, v1, v2, #v1, #v2, msg)\n#define CV_CheckGT(v1, v2, msg)  CV__CHECK(_, GT, auto, v1, v2, #v1, #v2, msg)\n\n/// Check with additional \"decoding\" of type values in error message\n#define CV_CheckTypeEQ(t1, t2, msg)  CV__CHECK(_, EQ, MatType, t1, t2, #t1, #t2, msg)\n/// Check with additional \"decoding\" of depth values in error message\n#define CV_CheckDepthEQ(d1, d2, msg)  CV__CHECK(_, EQ, MatDepth, d1, d2, #d1, #d2, msg)\n\n#define CV_CheckChannelsEQ(c1, c2, msg)  CV__CHECK(_, EQ, MatChannels, c1, c2, #c1, #c2, msg)\n\n/// Example: type == CV_8UC1 || type == CV_8UC3\n#define CV_CheckType(t, test_expr, msg)  CV__CHECK_CUSTOM_TEST(_, MatType, t, (test_expr), #t, #test_expr, msg)\n\n/// Example: depth == CV_32F || depth == CV_64F\n#define CV_CheckDepth(t, test_expr, msg)  CV__CHECK_CUSTOM_TEST(_, MatDepth, t, (test_expr), #t, #test_expr, msg)\n\n/// Example: v == A || v == B\n#define CV_Check(v, test_expr, msg)  CV__CHECK_CUSTOM_TEST(_, auto, v, (test_expr), #v, #test_expr, msg)\n\n/// Some complex conditions: CV_Check(src2, src2.empty() || (src2.type() == src1.type() && src2.size() == src1.size()), \"src2 should have same size/type as src1\")\n// TODO define pretty-printers\n\n#ifndef NDEBUG\n#define CV_DbgCheck(v, test_expr, msg)  CV__CHECK_CUSTOM_TEST(_, auto, v, (test_expr), #v, #test_expr, msg)\n#define CV_DbgCheckEQ(v1, v2, msg)  CV__CHECK(_, EQ, auto, v1, v2, #v1, #v2, msg)\n#define CV_DbgCheckNE(v1, v2, msg)  CV__CHECK(_, NE, auto, v1, v2, #v1, #v2, msg)\n#define CV_DbgCheckLE(v1, v2, msg)  CV__CHECK(_, LE, auto, v1, v2, #v1, #v2, msg)\n#define CV_DbgCheckLT(v1, v2, msg)  CV__CHECK(_, LT, auto, v1, v2, #v1, #v2, msg)\n#define CV_DbgCheckGE(v1, v2, msg)  CV__CHECK(_, GE, auto, v1, v2, #v1, #v2, msg)\n#define CV_DbgCheckGT(v1, v2, msg)  CV__CHECK(_, GT, auto, v1, v2, #v1, #v2, msg)\n#else\n#define CV_DbgCheck(v, test_expr, msg)  do { } while (0)\n#define CV_DbgCheckEQ(v1, v2, msg)  do { } while (0)\n#define CV_DbgCheckNE(v1, v2, msg)  do { } while (0)\n#define CV_DbgCheckLE(v1, v2, msg)  do { } while (0)\n#define CV_DbgCheckLT(v1, v2, msg)  do { } while (0)\n#define CV_DbgCheckGE(v1, v2, msg)  do { } while (0)\n#define CV_DbgCheckGT(v1, v2, msg)  do { } while (0)\n#endif\n\n} // namespace\n\n#endif // OPENCV_CORE_CHECK_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/core.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/core.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/core_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n\n#ifndef OPENCV_CORE_C_H\n#define OPENCV_CORE_C_H\n\n#include \"opencv2/core/types_c.h\"\n\n#ifdef __cplusplus\n#  ifdef _MSC_VER\n/* disable warning C4190: 'function' has C-linkage specified, but returns UDT 'typename'\n                          which is incompatible with C\n\n   It is OK to disable it because we only extend few plain structures with\n   C++ constructors for simpler interoperability with C++ API of the library\n*/\n#    pragma warning(disable:4190)\n#  elif defined __clang__ && __clang_major__ >= 3\n#    pragma GCC diagnostic ignored \"-Wreturn-type-c-linkage\"\n#  endif\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** @addtogroup core_c\n    @{\n*/\n\n/****************************************************************************************\\\n*          Array allocation, deallocation, initialization and access to elements         *\n\\****************************************************************************************/\n\n/** `malloc` wrapper.\n   If there is no enough memory, the function\n   (as well as other OpenCV functions that call cvAlloc)\n   raises an error. */\nCVAPI(void*)  cvAlloc( size_t size );\n\n/** `free` wrapper.\n   Here and further all the memory releasing functions\n   (that all call cvFree) take double pointer in order to\n   to clear pointer to the data after releasing it.\n   Passing pointer to NULL pointer is Ok: nothing happens in this case\n*/\nCVAPI(void)   cvFree_( void* ptr );\n#define cvFree(ptr) (cvFree_(*(ptr)), *(ptr)=0)\n\n/** @brief Creates an image header but does not allocate the image data.\n\n@param size Image width and height\n@param depth Image depth (see cvCreateImage )\n@param channels Number of channels (see cvCreateImage )\n */\nCVAPI(IplImage*)  cvCreateImageHeader( CvSize size, int depth, int channels );\n\n/** @brief Initializes an image header that was previously allocated.\n\nThe returned IplImage\\* points to the initialized header.\n@param image Image header to initialize\n@param size Image width and height\n@param depth Image depth (see cvCreateImage )\n@param channels Number of channels (see cvCreateImage )\n@param origin Top-left IPL_ORIGIN_TL or bottom-left IPL_ORIGIN_BL\n@param align Alignment for image rows, typically 4 or 8 bytes\n */\nCVAPI(IplImage*) cvInitImageHeader( IplImage* image, CvSize size, int depth,\n                                   int channels, int origin CV_DEFAULT(0),\n                                   int align CV_DEFAULT(4));\n\n/** @brief Creates an image header and allocates the image data.\n\nThis function call is equivalent to the following code:\n@code\n    header = cvCreateImageHeader(size, depth, channels);\n    cvCreateData(header);\n@endcode\n@param size Image width and height\n@param depth Bit depth of image elements. See IplImage for valid depths.\n@param channels Number of channels per pixel. See IplImage for details. This function only creates\nimages with interleaved channels.\n */\nCVAPI(IplImage*)  cvCreateImage( CvSize size, int depth, int channels );\n\n/** @brief Deallocates an image header.\n\nThis call is an analogue of :\n@code\n    if(image )\n    {\n        iplDeallocate(*image, IPL_IMAGE_HEADER | IPL_IMAGE_ROI);\n        *image = 0;\n    }\n@endcode\nbut it does not use IPL functions by default (see the CV_TURN_ON_IPL_COMPATIBILITY macro).\n@param image Double pointer to the image header\n */\nCVAPI(void)  cvReleaseImageHeader( IplImage** image );\n\n/** @brief Deallocates the image header and the image data.\n\nThis call is a shortened form of :\n@code\n    if(*image )\n    {\n        cvReleaseData(*image);\n        cvReleaseImageHeader(image);\n    }\n@endcode\n@param image Double pointer to the image header\n*/\nCVAPI(void)  cvReleaseImage( IplImage** image );\n\n/** Creates a copy of IPL image (widthStep may differ) */\nCVAPI(IplImage*) cvCloneImage( const IplImage* image );\n\n/** @brief Sets the channel of interest in an IplImage.\n\nIf the ROI is set to NULL and the coi is *not* 0, the ROI is allocated. Most OpenCV functions do\n*not* support the COI setting, so to process an individual image/matrix channel one may copy (via\ncvCopy or cvSplit) the channel to a separate image/matrix, process it and then copy the result\nback (via cvCopy or cvMerge) if needed.\n@param image A pointer to the image header\n@param coi The channel of interest. 0 - all channels are selected, 1 - first channel is selected,\netc. Note that the channel indices become 1-based.\n */\nCVAPI(void)  cvSetImageCOI( IplImage* image, int coi );\n\n/** @brief Returns the index of the channel of interest.\n\nReturns the channel of interest of in an IplImage. Returned values correspond to the coi in\ncvSetImageCOI.\n@param image A pointer to the image header\n */\nCVAPI(int)  cvGetImageCOI( const IplImage* image );\n\n/** @brief Sets an image Region Of Interest (ROI) for a given rectangle.\n\nIf the original image ROI was NULL and the rect is not the whole image, the ROI structure is\nallocated.\n\nMost OpenCV functions support the use of ROI and treat the image rectangle as a separate image. For\nexample, all of the pixel coordinates are counted from the top-left (or bottom-left) corner of the\nROI, not the original image.\n@param image A pointer to the image header\n@param rect The ROI rectangle\n */\nCVAPI(void)  cvSetImageROI( IplImage* image, CvRect rect );\n\n/** @brief Resets the image ROI to include the entire image and releases the ROI structure.\n\nThis produces a similar result to the following, but in addition it releases the ROI structure. :\n@code\n    cvSetImageROI(image, cvRect(0, 0, image->width, image->height ));\n    cvSetImageCOI(image, 0);\n@endcode\n@param image A pointer to the image header\n */\nCVAPI(void)  cvResetImageROI( IplImage* image );\n\n/** @brief Returns the image ROI.\n\nIf there is no ROI set, cvRect(0,0,image-\\>width,image-\\>height) is returned.\n@param image A pointer to the image header\n */\nCVAPI(CvRect) cvGetImageROI( const IplImage* image );\n\n/** @brief Creates a matrix header but does not allocate the matrix data.\n\nThe function allocates a new matrix header and returns a pointer to it. The matrix data can then be\nallocated using cvCreateData or set explicitly to user-allocated data via cvSetData.\n@param rows Number of rows in the matrix\n@param cols Number of columns in the matrix\n@param type Type of the matrix elements, see cvCreateMat\n */\nCVAPI(CvMat*)  cvCreateMatHeader( int rows, int cols, int type );\n\n#define CV_AUTOSTEP  0x7fffffff\n\n/** @brief Initializes a pre-allocated matrix header.\n\nThis function is often used to process raw data with OpenCV matrix functions. For example, the\nfollowing code computes the matrix product of two matrices, stored as ordinary arrays:\n@code\n    double a[] = { 1, 2, 3, 4,\n                   5, 6, 7, 8,\n                   9, 10, 11, 12 };\n\n    double b[] = { 1, 5, 9,\n                   2, 6, 10,\n                   3, 7, 11,\n                   4, 8, 12 };\n\n    double c[9];\n    CvMat Ma, Mb, Mc ;\n\n    cvInitMatHeader(&Ma, 3, 4, CV_64FC1, a);\n    cvInitMatHeader(&Mb, 4, 3, CV_64FC1, b);\n    cvInitMatHeader(&Mc, 3, 3, CV_64FC1, c);\n\n    cvMatMulAdd(&Ma, &Mb, 0, &Mc);\n    // the c array now contains the product of a (3x4) and b (4x3)\n@endcode\n@param mat A pointer to the matrix header to be initialized\n@param rows Number of rows in the matrix\n@param cols Number of columns in the matrix\n@param type Type of the matrix elements, see cvCreateMat .\n@param data Optional: data pointer assigned to the matrix header\n@param step Optional: full row width in bytes of the assigned data. By default, the minimal\npossible step is used which assumes there are no gaps between subsequent rows of the matrix.\n */\nCVAPI(CvMat*) cvInitMatHeader( CvMat* mat, int rows, int cols,\n                              int type, void* data CV_DEFAULT(NULL),\n                              int step CV_DEFAULT(CV_AUTOSTEP) );\n\n/** @brief Creates a matrix header and allocates the matrix data.\n\nThe function call is equivalent to the following code:\n@code\n    CvMat* mat = cvCreateMatHeader(rows, cols, type);\n    cvCreateData(mat);\n@endcode\n@param rows Number of rows in the matrix\n@param cols Number of columns in the matrix\n@param type The type of the matrix elements in the form\nCV_\\<bit depth\\>\\<S|U|F\\>C\\<number of channels\\> , where S=signed, U=unsigned, F=float. For\nexample, CV _ 8UC1 means the elements are 8-bit unsigned and the there is 1 channel, and CV _\n32SC2 means the elements are 32-bit signed and there are 2 channels.\n */\nCVAPI(CvMat*)  cvCreateMat( int rows, int cols, int type );\n\n/** @brief Deallocates a matrix.\n\nThe function decrements the matrix data reference counter and deallocates matrix header. If the data\nreference counter is 0, it also deallocates the data. :\n@code\n    if(*mat )\n        cvDecRefData(*mat);\n    cvFree((void**)mat);\n@endcode\n@param mat Double pointer to the matrix\n */\nCVAPI(void)  cvReleaseMat( CvMat** mat );\n\n/** @brief Decrements an array data reference counter.\n\nThe function decrements the data reference counter in a CvMat or CvMatND if the reference counter\n\npointer is not NULL. If the counter reaches zero, the data is deallocated. In the current\nimplementation the reference counter is not NULL only if the data was allocated using the\ncvCreateData function. The counter will be NULL in other cases such as: external data was assigned\nto the header using cvSetData, header is part of a larger matrix or image, or the header was\nconverted from an image or n-dimensional matrix header.\n@param arr Pointer to an array header\n */\nCV_INLINE  void  cvDecRefData( CvArr* arr )\n{\n    if( CV_IS_MAT( arr ))\n    {\n        CvMat* mat = (CvMat*)arr;\n        mat->data.ptr = NULL;\n        if( mat->refcount != NULL && --*mat->refcount == 0 )\n            cvFree( &mat->refcount );\n        mat->refcount = NULL;\n    }\n    else if( CV_IS_MATND( arr ))\n    {\n        CvMatND* mat = (CvMatND*)arr;\n        mat->data.ptr = NULL;\n        if( mat->refcount != NULL && --*mat->refcount == 0 )\n            cvFree( &mat->refcount );\n        mat->refcount = NULL;\n    }\n}\n\n/** @brief Increments array data reference counter.\n\nThe function increments CvMat or CvMatND data reference counter and returns the new counter value if\nthe reference counter pointer is not NULL, otherwise it returns zero.\n@param arr Array header\n */\nCV_INLINE  int  cvIncRefData( CvArr* arr )\n{\n    int refcount = 0;\n    if( CV_IS_MAT( arr ))\n    {\n        CvMat* mat = (CvMat*)arr;\n        if( mat->refcount != NULL )\n            refcount = ++*mat->refcount;\n    }\n    else if( CV_IS_MATND( arr ))\n    {\n        CvMatND* mat = (CvMatND*)arr;\n        if( mat->refcount != NULL )\n            refcount = ++*mat->refcount;\n    }\n    return refcount;\n}\n\n\n/** Creates an exact copy of the input matrix (except, may be, step value) */\nCVAPI(CvMat*) cvCloneMat( const CvMat* mat );\n\n\n/** @brief Returns matrix header corresponding to the rectangular sub-array of input image or matrix.\n\nThe function returns header, corresponding to a specified rectangle of the input array. In other\n\nwords, it allows the user to treat a rectangular part of input array as a stand-alone array. ROI is\ntaken into account by the function so the sub-array of ROI is actually extracted.\n@param arr Input array\n@param submat Pointer to the resultant sub-array header\n@param rect Zero-based coordinates of the rectangle of interest\n */\nCVAPI(CvMat*) cvGetSubRect( const CvArr* arr, CvMat* submat, CvRect rect );\n#define cvGetSubArr cvGetSubRect\n\n/** @brief Returns array row or row span.\n\nThe function returns the header, corresponding to a specified row/row span of the input array.\ncvGetRow(arr, submat, row) is a shortcut for cvGetRows(arr, submat, row, row+1).\n@param arr Input array\n@param submat Pointer to the resulting sub-array header\n@param start_row Zero-based index of the starting row (inclusive) of the span\n@param end_row Zero-based index of the ending row (exclusive) of the span\n@param delta_row Index step in the row span. That is, the function extracts every delta_row -th\nrow from start_row and up to (but not including) end_row .\n */\nCVAPI(CvMat*) cvGetRows( const CvArr* arr, CvMat* submat,\n                        int start_row, int end_row,\n                        int delta_row CV_DEFAULT(1));\n\n/** @overload\n@param arr Input array\n@param submat Pointer to the resulting sub-array header\n@param row Zero-based index of the selected row\n*/\nCV_INLINE  CvMat*  cvGetRow( const CvArr* arr, CvMat* submat, int row )\n{\n    return cvGetRows( arr, submat, row, row + 1, 1 );\n}\n\n\n/** @brief Returns one of more array columns.\n\nThe function returns the header, corresponding to a specified column span of the input array. That\n\nis, no data is copied. Therefore, any modifications of the submatrix will affect the original array.\nIf you need to copy the columns, use cvCloneMat. cvGetCol(arr, submat, col) is a shortcut for\ncvGetCols(arr, submat, col, col+1).\n@param arr Input array\n@param submat Pointer to the resulting sub-array header\n@param start_col Zero-based index of the starting column (inclusive) of the span\n@param end_col Zero-based index of the ending column (exclusive) of the span\n */\nCVAPI(CvMat*) cvGetCols( const CvArr* arr, CvMat* submat,\n                        int start_col, int end_col );\n\n/** @overload\n@param arr Input array\n@param submat Pointer to the resulting sub-array header\n@param col Zero-based index of the selected column\n*/\nCV_INLINE  CvMat*  cvGetCol( const CvArr* arr, CvMat* submat, int col )\n{\n    return cvGetCols( arr, submat, col, col + 1 );\n}\n\n/** @brief Returns one of array diagonals.\n\nThe function returns the header, corresponding to a specified diagonal of the input array.\n@param arr Input array\n@param submat Pointer to the resulting sub-array header\n@param diag Index of the array diagonal. Zero value corresponds to the main diagonal, -1\ncorresponds to the diagonal above the main, 1 corresponds to the diagonal below the main, and so\nforth.\n */\nCVAPI(CvMat*) cvGetDiag( const CvArr* arr, CvMat* submat,\n                            int diag CV_DEFAULT(0));\n\n/** low-level scalar <-> raw data conversion functions */\nCVAPI(void) cvScalarToRawData( const CvScalar* scalar, void* data, int type,\n                              int extend_to_12 CV_DEFAULT(0) );\n\nCVAPI(void) cvRawDataToScalar( const void* data, int type, CvScalar* scalar );\n\n/** @brief Creates a new matrix header but does not allocate the matrix data.\n\nThe function allocates a header for a multi-dimensional dense array. The array data can further be\nallocated using cvCreateData or set explicitly to user-allocated data via cvSetData.\n@param dims Number of array dimensions\n@param sizes Array of dimension sizes\n@param type Type of array elements, see cvCreateMat\n */\nCVAPI(CvMatND*)  cvCreateMatNDHeader( int dims, const int* sizes, int type );\n\n/** @brief Creates the header and allocates the data for a multi-dimensional dense array.\n\nThis function call is equivalent to the following code:\n@code\n    CvMatND* mat = cvCreateMatNDHeader(dims, sizes, type);\n    cvCreateData(mat);\n@endcode\n@param dims Number of array dimensions. This must not exceed CV_MAX_DIM (32 by default, but can be\nchanged at build time).\n@param sizes Array of dimension sizes.\n@param type Type of array elements, see cvCreateMat .\n */\nCVAPI(CvMatND*)  cvCreateMatND( int dims, const int* sizes, int type );\n\n/** @brief Initializes a pre-allocated multi-dimensional array header.\n\n@param mat A pointer to the array header to be initialized\n@param dims The number of array dimensions\n@param sizes An array of dimension sizes\n@param type Type of array elements, see cvCreateMat\n@param data Optional data pointer assigned to the matrix header\n */\nCVAPI(CvMatND*)  cvInitMatNDHeader( CvMatND* mat, int dims, const int* sizes,\n                                    int type, void* data CV_DEFAULT(NULL) );\n\n/** @brief Deallocates a multi-dimensional array.\n\nThe function decrements the array data reference counter and releases the array header. If the\nreference counter reaches 0, it also deallocates the data. :\n@code\n    if(*mat )\n        cvDecRefData(*mat);\n    cvFree((void**)mat);\n@endcode\n@param mat Double pointer to the array\n */\nCV_INLINE  void  cvReleaseMatND( CvMatND** mat )\n{\n    cvReleaseMat( (CvMat**)mat );\n}\n\n/** Creates a copy of CvMatND (except, may be, steps) */\nCVAPI(CvMatND*) cvCloneMatND( const CvMatND* mat );\n\n/** @brief Creates sparse array.\n\nThe function allocates a multi-dimensional sparse array. Initially the array contain no elements,\nthat is PtrND and other related functions will return 0 for every index.\n@param dims Number of array dimensions. In contrast to the dense matrix, the number of dimensions is\npractically unlimited (up to \\f$2^{16}\\f$ ).\n@param sizes Array of dimension sizes\n@param type Type of array elements. The same as for CvMat\n */\nCVAPI(CvSparseMat*)  cvCreateSparseMat( int dims, const int* sizes, int type );\n\n/** @brief Deallocates sparse array.\n\nThe function releases the sparse array and clears the array pointer upon exit.\n@param mat Double pointer to the array\n */\nCVAPI(void)  cvReleaseSparseMat( CvSparseMat** mat );\n\n/** Creates a copy of CvSparseMat (except, may be, zero items) */\nCVAPI(CvSparseMat*) cvCloneSparseMat( const CvSparseMat* mat );\n\n/** @brief Initializes sparse array elements iterator.\n\nThe function initializes iterator of sparse array elements and returns pointer to the first element,\nor NULL if the array is empty.\n@param mat Input array\n@param mat_iterator Initialized iterator\n */\nCVAPI(CvSparseNode*) cvInitSparseMatIterator( const CvSparseMat* mat,\n                                              CvSparseMatIterator* mat_iterator );\n\n/** @brief Returns the next sparse matrix element\n\nThe function moves iterator to the next sparse matrix element and returns pointer to it. In the\ncurrent version there is no any particular order of the elements, because they are stored in the\nhash table. The sample below demonstrates how to iterate through the sparse matrix:\n@code\n    // print all the non-zero sparse matrix elements and compute their sum\n    double sum = 0;\n    int i, dims = cvGetDims(sparsemat);\n    CvSparseMatIterator it;\n    CvSparseNode* node = cvInitSparseMatIterator(sparsemat, &it);\n\n    for(; node != 0; node = cvGetNextSparseNode(&it))\n    {\n        int* idx = CV_NODE_IDX(array, node);\n        float val = *(float*)CV_NODE_VAL(array, node);\n        printf(\"M\");\n        for(i = 0; i < dims; i++ )\n            printf(\"[%d]\", idx[i]);\n        printf(\"=%g\\n\", val);\n\n        sum += val;\n    }\n\n    printf(\"nTotal sum = %g\\n\", sum);\n@endcode\n@param mat_iterator Sparse array iterator\n */\nCV_INLINE CvSparseNode* cvGetNextSparseNode( CvSparseMatIterator* mat_iterator )\n{\n    if( mat_iterator->node->next )\n        return mat_iterator->node = mat_iterator->node->next;\n    else\n    {\n        int idx;\n        for( idx = ++mat_iterator->curidx; idx < mat_iterator->mat->hashsize; idx++ )\n        {\n            CvSparseNode* node = (CvSparseNode*)mat_iterator->mat->hashtable[idx];\n            if( node )\n            {\n                mat_iterator->curidx = idx;\n                return mat_iterator->node = node;\n            }\n        }\n        return NULL;\n    }\n}\n\n\n#define CV_MAX_ARR 10\n\n/** matrix iterator: used for n-ary operations on dense arrays */\ntypedef struct CvNArrayIterator\n{\n    int count; /**< number of arrays */\n    int dims; /**< number of dimensions to iterate */\n    CvSize size; /**< maximal common linear size: { width = size, height = 1 } */\n    uchar* ptr[CV_MAX_ARR]; /**< pointers to the array slices */\n    int stack[CV_MAX_DIM]; /**< for internal use */\n    CvMatND* hdr[CV_MAX_ARR]; /**< pointers to the headers of the\n                                 matrices that are processed */\n}\nCvNArrayIterator;\n\n#define CV_NO_DEPTH_CHECK     1\n#define CV_NO_CN_CHECK        2\n#define CV_NO_SIZE_CHECK      4\n\n/** initializes iterator that traverses through several arrays simultaneously\n   (the function together with cvNextArraySlice is used for\n    N-ari element-wise operations) */\nCVAPI(int) cvInitNArrayIterator( int count, CvArr** arrs,\n                                 const CvArr* mask, CvMatND* stubs,\n                                 CvNArrayIterator* array_iterator,\n                                 int flags CV_DEFAULT(0) );\n\n/** returns zero value if iteration is finished, non-zero (slice length) otherwise */\nCVAPI(int) cvNextNArraySlice( CvNArrayIterator* array_iterator );\n\n\n/** @brief Returns type of array elements.\n\nThe function returns type of the array elements. In the case of IplImage the type is converted to\nCvMat-like representation. For example, if the image has been created as:\n@code\n    IplImage* img = cvCreateImage(cvSize(640, 480), IPL_DEPTH_8U, 3);\n@endcode\nThe code cvGetElemType(img) will return CV_8UC3.\n@param arr Input array\n */\nCVAPI(int) cvGetElemType( const CvArr* arr );\n\n/** @brief Return number of array dimensions\n\nThe function returns the array dimensionality and the array of dimension sizes. In the case of\nIplImage or CvMat it always returns 2 regardless of number of image/matrix rows. For example, the\nfollowing code calculates total number of array elements:\n@code\n    int sizes[CV_MAX_DIM];\n    int i, total = 1;\n    int dims = cvGetDims(arr, size);\n    for(i = 0; i < dims; i++ )\n        total *= sizes[i];\n@endcode\n@param arr Input array\n@param sizes Optional output vector of the array dimension sizes. For 2d arrays the number of rows\n(height) goes first, number of columns (width) next.\n */\nCVAPI(int) cvGetDims( const CvArr* arr, int* sizes CV_DEFAULT(NULL) );\n\n\n/** @brief Returns array size along the specified dimension.\n\n@param arr Input array\n@param index Zero-based dimension index (for matrices 0 means number of rows, 1 means number of\ncolumns; for images 0 means height, 1 means width)\n */\nCVAPI(int) cvGetDimSize( const CvArr* arr, int index );\n\n\n/** @brief Return pointer to a particular array element.\n\nThe functions return a pointer to a specific array element. Number of array dimension should match\nto the number of indices passed to the function except for cvPtr1D function that can be used for\nsequential access to 1D, 2D or nD dense arrays.\n\nThe functions can be used for sparse arrays as well - if the requested node does not exist they\ncreate it and set it to zero.\n\nAll these as well as other functions accessing array elements ( cvGetND , cvGetRealND , cvSet\n, cvSetND , cvSetRealND ) raise an error in case if the element index is out of range.\n@param arr Input array\n@param idx0 The first zero-based component of the element index\n@param type Optional output parameter: type of matrix elements\n */\nCVAPI(uchar*) cvPtr1D( const CvArr* arr, int idx0, int* type CV_DEFAULT(NULL));\n/** @overload */\nCVAPI(uchar*) cvPtr2D( const CvArr* arr, int idx0, int idx1, int* type CV_DEFAULT(NULL) );\n/** @overload */\nCVAPI(uchar*) cvPtr3D( const CvArr* arr, int idx0, int idx1, int idx2,\n                      int* type CV_DEFAULT(NULL));\n/** @overload\n@param arr Input array\n@param idx Array of the element indices\n@param type Optional output parameter: type of matrix elements\n@param create_node Optional input parameter for sparse matrices. Non-zero value of the parameter\nmeans that the requested element is created if it does not exist already.\n@param precalc_hashval Optional input parameter for sparse matrices. If the pointer is not NULL,\nthe function does not recalculate the node hash value, but takes it from the specified location.\nIt is useful for speeding up pair-wise operations (TODO: provide an example)\n*/\nCVAPI(uchar*) cvPtrND( const CvArr* arr, const int* idx, int* type CV_DEFAULT(NULL),\n                      int create_node CV_DEFAULT(1),\n                      unsigned* precalc_hashval CV_DEFAULT(NULL));\n\n/** @brief Return a specific array element.\n\nThe functions return a specific array element. In the case of a sparse array the functions return 0\nif the requested node does not exist (no new node is created by the functions).\n@param arr Input array\n@param idx0 The first zero-based component of the element index\n */\nCVAPI(CvScalar) cvGet1D( const CvArr* arr, int idx0 );\n/** @overload */\nCVAPI(CvScalar) cvGet2D( const CvArr* arr, int idx0, int idx1 );\n/** @overload */\nCVAPI(CvScalar) cvGet3D( const CvArr* arr, int idx0, int idx1, int idx2 );\n/** @overload\n@param arr Input array\n@param idx Array of the element indices\n*/\nCVAPI(CvScalar) cvGetND( const CvArr* arr, const int* idx );\n\n/** @brief Return a specific element of single-channel 1D, 2D, 3D or nD array.\n\nReturns a specific element of a single-channel array. If the array has multiple channels, a runtime\nerror is raised. Note that Get?D functions can be used safely for both single-channel and\nmultiple-channel arrays though they are a bit slower.\n\nIn the case of a sparse array the functions return 0 if the requested node does not exist (no new\nnode is created by the functions).\n@param arr Input array. Must have a single channel.\n@param idx0 The first zero-based component of the element index\n */\nCVAPI(double) cvGetReal1D( const CvArr* arr, int idx0 );\n/** @overload */\nCVAPI(double) cvGetReal2D( const CvArr* arr, int idx0, int idx1 );\n/** @overload */\nCVAPI(double) cvGetReal3D( const CvArr* arr, int idx0, int idx1, int idx2 );\n/** @overload\n@param arr Input array. Must have a single channel.\n@param idx Array of the element indices\n*/\nCVAPI(double) cvGetRealND( const CvArr* arr, const int* idx );\n\n/** @brief Change the particular array element.\n\nThe functions assign the new value to a particular array element. In the case of a sparse array the\nfunctions create the node if it does not exist yet.\n@param arr Input array\n@param idx0 The first zero-based component of the element index\n@param value The assigned value\n */\nCVAPI(void) cvSet1D( CvArr* arr, int idx0, CvScalar value );\n/** @overload */\nCVAPI(void) cvSet2D( CvArr* arr, int idx0, int idx1, CvScalar value );\n/** @overload */\nCVAPI(void) cvSet3D( CvArr* arr, int idx0, int idx1, int idx2, CvScalar value );\n/** @overload\n@param arr Input array\n@param idx Array of the element indices\n@param value The assigned value\n*/\nCVAPI(void) cvSetND( CvArr* arr, const int* idx, CvScalar value );\n\n/** @brief Change a specific array element.\n\nThe functions assign a new value to a specific element of a single-channel array. If the array has\nmultiple channels, a runtime error is raised. Note that the Set\\*D function can be used safely for\nboth single-channel and multiple-channel arrays, though they are a bit slower.\n\nIn the case of a sparse array the functions create the node if it does not yet exist.\n@param arr Input array\n@param idx0 The first zero-based component of the element index\n@param value The assigned value\n */\nCVAPI(void) cvSetReal1D( CvArr* arr, int idx0, double value );\n/** @overload */\nCVAPI(void) cvSetReal2D( CvArr* arr, int idx0, int idx1, double value );\n/** @overload */\nCVAPI(void) cvSetReal3D( CvArr* arr, int idx0,\n                        int idx1, int idx2, double value );\n/** @overload\n@param arr Input array\n@param idx Array of the element indices\n@param value The assigned value\n*/\nCVAPI(void) cvSetRealND( CvArr* arr, const int* idx, double value );\n\n/** clears element of ND dense array,\n   in case of sparse arrays it deletes the specified node */\nCVAPI(void) cvClearND( CvArr* arr, const int* idx );\n\n/** @brief Returns matrix header for arbitrary array.\n\nThe function returns a matrix header for the input array that can be a matrix - CvMat, an image -\nIplImage, or a multi-dimensional dense array - CvMatND (the third option is allowed only if\nallowND != 0) . In the case of matrix the function simply returns the input pointer. In the case of\nIplImage\\* or CvMatND it initializes the header structure with parameters of the current image ROI\nand returns &header. Because COI is not supported by CvMat, it is returned separately.\n\nThe function provides an easy way to handle both types of arrays - IplImage and CvMat using the same\ncode. Input array must have non-zero data pointer, otherwise the function will report an error.\n\n@note If the input array is IplImage with planar data layout and COI set, the function returns the\npointer to the selected plane and COI == 0. This feature allows user to process IplImage structures\nwith planar data layout, even though OpenCV does not support such images.\n@param arr Input array\n@param header Pointer to CvMat structure used as a temporary buffer\n@param coi Optional output parameter for storing COI\n@param allowND If non-zero, the function accepts multi-dimensional dense arrays (CvMatND\\*) and\nreturns 2D matrix (if CvMatND has two dimensions) or 1D matrix (when CvMatND has 1 dimension or\nmore than 2 dimensions). The CvMatND array must be continuous.\n@sa cvGetImage, cvarrToMat.\n */\nCVAPI(CvMat*) cvGetMat( const CvArr* arr, CvMat* header,\n                       int* coi CV_DEFAULT(NULL),\n                       int allowND CV_DEFAULT(0));\n\n/** @brief Returns image header for arbitrary array.\n\nThe function returns the image header for the input array that can be a matrix (CvMat) or image\n(IplImage). In the case of an image the function simply returns the input pointer. In the case of\nCvMat it initializes an image_header structure with the parameters of the input matrix. Note that\nif we transform IplImage to CvMat using cvGetMat and then transform CvMat back to IplImage using\nthis function, we will get different headers if the ROI is set in the original image.\n@param arr Input array\n@param image_header Pointer to IplImage structure used as a temporary buffer\n */\nCVAPI(IplImage*) cvGetImage( const CvArr* arr, IplImage* image_header );\n\n\n/** @brief Changes the shape of a multi-dimensional array without copying the data.\n\nThe function is an advanced version of cvReshape that can work with multi-dimensional arrays as\nwell (though it can work with ordinary images and matrices) and change the number of dimensions.\n\nBelow are the two samples from the cvReshape description rewritten using cvReshapeMatND:\n@code\n    IplImage* color_img = cvCreateImage(cvSize(320,240), IPL_DEPTH_8U, 3);\n    IplImage gray_img_hdr, *gray_img;\n    gray_img = (IplImage*)cvReshapeMatND(color_img, sizeof(gray_img_hdr), &gray_img_hdr, 1, 0, 0);\n    ...\n    int size[] = { 2, 2, 2 };\n    CvMatND* mat = cvCreateMatND(3, size, CV_32F);\n    CvMat row_header, *row;\n    row = (CvMat*)cvReshapeMatND(mat, sizeof(row_header), &row_header, 0, 1, 0);\n@endcode\nIn C, the header file for this function includes a convenient macro cvReshapeND that does away with\nthe sizeof_header parameter. So, the lines containing the call to cvReshapeMatND in the examples\nmay be replaced as follow:\n@code\n    gray_img = (IplImage*)cvReshapeND(color_img, &gray_img_hdr, 1, 0, 0);\n    ...\n    row = (CvMat*)cvReshapeND(mat, &row_header, 0, 1, 0);\n@endcode\n@param arr Input array\n@param sizeof_header Size of output header to distinguish between IplImage, CvMat and CvMatND\noutput headers\n@param header Output header to be filled\n@param new_cn New number of channels. new_cn = 0 means that the number of channels remains\nunchanged.\n@param new_dims New number of dimensions. new_dims = 0 means that the number of dimensions\nremains the same.\n@param new_sizes Array of new dimension sizes. Only new_dims-1 values are used, because the\ntotal number of elements must remain the same. Thus, if new_dims = 1, new_sizes array is not\nused.\n */\nCVAPI(CvArr*) cvReshapeMatND( const CvArr* arr,\n                             int sizeof_header, CvArr* header,\n                             int new_cn, int new_dims, int* new_sizes );\n\n#define cvReshapeND( arr, header, new_cn, new_dims, new_sizes )   \\\n      cvReshapeMatND( (arr), sizeof(*(header)), (header),         \\\n                      (new_cn), (new_dims), (new_sizes))\n\n/** @brief Changes shape of matrix/image without copying data.\n\nThe function initializes the CvMat header so that it points to the same data as the original array\nbut has a different shape - different number of channels, different number of rows, or both.\n\nThe following example code creates one image buffer and two image headers, the first is for a\n320x240x3 image and the second is for a 960x240x1 image:\n@code\n    IplImage* color_img = cvCreateImage(cvSize(320,240), IPL_DEPTH_8U, 3);\n    CvMat gray_mat_hdr;\n    IplImage gray_img_hdr, *gray_img;\n    cvReshape(color_img, &gray_mat_hdr, 1);\n    gray_img = cvGetImage(&gray_mat_hdr, &gray_img_hdr);\n@endcode\nAnd the next example converts a 3x3 matrix to a single 1x9 vector:\n@code\n    CvMat* mat = cvCreateMat(3, 3, CV_32F);\n    CvMat row_header, *row;\n    row = cvReshape(mat, &row_header, 0, 1);\n@endcode\n@param arr Input array\n@param header Output header to be filled\n@param new_cn New number of channels. 'new_cn = 0' means that the number of channels remains\nunchanged.\n@param new_rows New number of rows. 'new_rows = 0' means that the number of rows remains\nunchanged unless it needs to be changed according to new_cn value.\n*/\nCVAPI(CvMat*) cvReshape( const CvArr* arr, CvMat* header,\n                        int new_cn, int new_rows CV_DEFAULT(0) );\n\n/** Repeats source 2d array several times in both horizontal and\n   vertical direction to fill destination array */\nCVAPI(void) cvRepeat( const CvArr* src, CvArr* dst );\n\n/** @brief Allocates array data\n\nThe function allocates image, matrix or multi-dimensional dense array data. Note that in the case of\nmatrix types OpenCV allocation functions are used. In the case of IplImage they are used unless\nCV_TURN_ON_IPL_COMPATIBILITY() has been called before. In the latter case IPL functions are used\nto allocate the data.\n@param arr Array header\n */\nCVAPI(void)  cvCreateData( CvArr* arr );\n\n/** @brief Releases array data.\n\nThe function releases the array data. In the case of CvMat or CvMatND it simply calls\ncvDecRefData(), that is the function can not deallocate external data. See also the note to\ncvCreateData .\n@param arr Array header\n */\nCVAPI(void)  cvReleaseData( CvArr* arr );\n\n/** @brief Assigns user data to the array header.\n\nThe function assigns user data to the array header. Header should be initialized before using\ncvCreateMatHeader, cvCreateImageHeader, cvCreateMatNDHeader, cvInitMatHeader,\ncvInitImageHeader or cvInitMatNDHeader.\n@param arr Array header\n@param data User data\n@param step Full row length in bytes\n */\nCVAPI(void)  cvSetData( CvArr* arr, void* data, int step );\n\n/** @brief Retrieves low-level information about the array.\n\nThe function fills output variables with low-level information about the array data. All output\n\nparameters are optional, so some of the pointers may be set to NULL. If the array is IplImage with\nROI set, the parameters of ROI are returned.\n\nThe following example shows how to get access to array elements. It computes absolute values of the\narray elements :\n@code\n    float* data;\n    int step;\n    CvSize size;\n\n    cvGetRawData(array, (uchar**)&data, &step, &size);\n    step /= sizeof(data[0]);\n\n    for(int y = 0; y < size.height; y++, data += step )\n        for(int x = 0; x < size.width; x++ )\n            data[x] = (float)fabs(data[x]);\n@endcode\n@param arr Array header\n@param data Output pointer to the whole image origin or ROI origin if ROI is set\n@param step Output full row length in bytes\n@param roi_size Output ROI size\n */\nCVAPI(void) cvGetRawData( const CvArr* arr, uchar** data,\n                         int* step CV_DEFAULT(NULL),\n                         CvSize* roi_size CV_DEFAULT(NULL));\n\n/** @brief Returns size of matrix or image ROI.\n\nThe function returns number of rows (CvSize::height) and number of columns (CvSize::width) of the\ninput matrix or image. In the case of image the size of ROI is returned.\n@param arr array header\n */\nCVAPI(CvSize) cvGetSize( const CvArr* arr );\n\n/** @brief Copies one array to another.\n\nThe function copies selected elements from an input array to an output array:\n\n\\f[\\texttt{dst} (I)= \\texttt{src} (I)  \\quad \\text{if} \\quad \\texttt{mask} (I)  \\ne 0.\\f]\n\nIf any of the passed arrays is of IplImage type, then its ROI and COI fields are used. Both arrays\nmust have the same type, the same number of dimensions, and the same size. The function can also\ncopy sparse arrays (mask is not supported in this case).\n@param src The source array\n@param dst The destination array\n@param mask Operation mask, 8-bit single channel array; specifies elements of the destination array\nto be changed\n */\nCVAPI(void)  cvCopy( const CvArr* src, CvArr* dst,\n                     const CvArr* mask CV_DEFAULT(NULL) );\n\n/** @brief Sets every element of an array to a given value.\n\nThe function copies the scalar value to every selected element of the destination array:\n\\f[\\texttt{arr} (I)= \\texttt{value} \\quad \\text{if} \\quad \\texttt{mask} (I)  \\ne 0\\f]\nIf array arr is of IplImage type, then is ROI used, but COI must not be set.\n@param arr The destination array\n@param value Fill value\n@param mask Operation mask, 8-bit single channel array; specifies elements of the destination\narray to be changed\n */\nCVAPI(void)  cvSet( CvArr* arr, CvScalar value,\n                    const CvArr* mask CV_DEFAULT(NULL) );\n\n/** @brief Clears the array.\n\nThe function clears the array. In the case of dense arrays (CvMat, CvMatND or IplImage),\ncvZero(array) is equivalent to cvSet(array,cvScalarAll(0),0). In the case of sparse arrays all the\nelements are removed.\n@param arr Array to be cleared\n */\nCVAPI(void)  cvSetZero( CvArr* arr );\n#define cvZero  cvSetZero\n\n\n/** Splits a multi-channel array into the set of single-channel arrays or\n   extracts particular [color] plane */\nCVAPI(void)  cvSplit( const CvArr* src, CvArr* dst0, CvArr* dst1,\n                      CvArr* dst2, CvArr* dst3 );\n\n/** Merges a set of single-channel arrays into the single multi-channel array\n   or inserts one particular [color] plane to the array */\nCVAPI(void)  cvMerge( const CvArr* src0, const CvArr* src1,\n                      const CvArr* src2, const CvArr* src3,\n                      CvArr* dst );\n\n/** Copies several channels from input arrays to\n   certain channels of output arrays */\nCVAPI(void)  cvMixChannels( const CvArr** src, int src_count,\n                            CvArr** dst, int dst_count,\n                            const int* from_to, int pair_count );\n\n/** @brief Converts one array to another with optional linear transformation.\n\nThe function has several different purposes, and thus has several different names. It copies one\narray to another with optional scaling, which is performed first, and/or optional type conversion,\nperformed after:\n\n\\f[\\texttt{dst} (I) =  \\texttt{scale} \\texttt{src} (I) + ( \\texttt{shift} _0, \\texttt{shift} _1,...)\\f]\n\nAll the channels of multi-channel arrays are processed independently.\n\nThe type of conversion is done with rounding and saturation, that is if the result of scaling +\nconversion can not be represented exactly by a value of the destination array element type, it is\nset to the nearest representable value on the real axis.\n@param src Source array\n@param dst Destination array\n@param scale Scale factor\n@param shift Value added to the scaled source array elements\n */\nCVAPI(void)  cvConvertScale( const CvArr* src, CvArr* dst,\n                             double scale CV_DEFAULT(1),\n                             double shift CV_DEFAULT(0) );\n#define cvCvtScale cvConvertScale\n#define cvScale  cvConvertScale\n#define cvConvert( src, dst )  cvConvertScale( (src), (dst), 1, 0 )\n\n\n/** Performs linear transformation on every source array element,\n   stores absolute value of the result:\n   dst(x,y,c) = abs(scale*src(x,y,c)+shift).\n   destination array must have 8u type.\n   In other cases one may use cvConvertScale + cvAbsDiffS */\nCVAPI(void)  cvConvertScaleAbs( const CvArr* src, CvArr* dst,\n                                double scale CV_DEFAULT(1),\n                                double shift CV_DEFAULT(0) );\n#define cvCvtScaleAbs  cvConvertScaleAbs\n\n\n/** checks termination criteria validity and\n   sets eps to default_eps (if it is not set),\n   max_iter to default_max_iters (if it is not set)\n*/\nCVAPI(CvTermCriteria) cvCheckTermCriteria( CvTermCriteria criteria,\n                                           double default_eps,\n                                           int default_max_iters );\n\n/****************************************************************************************\\\n*                   Arithmetic, logic and comparison operations                          *\n\\****************************************************************************************/\n\n/** dst(mask) = src1(mask) + src2(mask) */\nCVAPI(void)  cvAdd( const CvArr* src1, const CvArr* src2, CvArr* dst,\n                    const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(mask) = src(mask) + value */\nCVAPI(void)  cvAddS( const CvArr* src, CvScalar value, CvArr* dst,\n                     const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(mask) = src1(mask) - src2(mask) */\nCVAPI(void)  cvSub( const CvArr* src1, const CvArr* src2, CvArr* dst,\n                    const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(mask) = src(mask) - value = src(mask) + (-value) */\nCV_INLINE  void  cvSubS( const CvArr* src, CvScalar value, CvArr* dst,\n                         const CvArr* mask CV_DEFAULT(NULL))\n{\n    cvAddS( src, cvScalar( -value.val[0], -value.val[1], -value.val[2], -value.val[3]),\n            dst, mask );\n}\n\n/** dst(mask) = value - src(mask) */\nCVAPI(void)  cvSubRS( const CvArr* src, CvScalar value, CvArr* dst,\n                      const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(idx) = src1(idx) * src2(idx) * scale\n   (scaled element-wise multiplication of 2 arrays) */\nCVAPI(void)  cvMul( const CvArr* src1, const CvArr* src2,\n                    CvArr* dst, double scale CV_DEFAULT(1) );\n\n/** element-wise division/inversion with scaling:\n    dst(idx) = src1(idx) * scale / src2(idx)\n    or dst(idx) = scale / src2(idx) if src1 == 0 */\nCVAPI(void)  cvDiv( const CvArr* src1, const CvArr* src2,\n                    CvArr* dst, double scale CV_DEFAULT(1));\n\n/** dst = src1 * scale + src2 */\nCVAPI(void)  cvScaleAdd( const CvArr* src1, CvScalar scale,\n                         const CvArr* src2, CvArr* dst );\n#define cvAXPY( A, real_scalar, B, C ) cvScaleAdd(A, cvRealScalar(real_scalar), B, C)\n\n/** dst = src1 * alpha + src2 * beta + gamma */\nCVAPI(void)  cvAddWeighted( const CvArr* src1, double alpha,\n                            const CvArr* src2, double beta,\n                            double gamma, CvArr* dst );\n\n/** @brief Calculates the dot product of two arrays in Euclidean metrics.\n\nThe function calculates and returns the Euclidean dot product of two arrays.\n\n\\f[src1  \\bullet src2 =  \\sum _I ( \\texttt{src1} (I)  \\texttt{src2} (I))\\f]\n\nIn the case of multiple channel arrays, the results for all channels are accumulated. In particular,\ncvDotProduct(a,a) where a is a complex vector, will return \\f$||\\texttt{a}||^2\\f$. The function can\nprocess multi-dimensional arrays, row by row, layer by layer, and so on.\n@param src1 The first source array\n@param src2 The second source array\n */\nCVAPI(double)  cvDotProduct( const CvArr* src1, const CvArr* src2 );\n\n/** dst(idx) = src1(idx) & src2(idx) */\nCVAPI(void) cvAnd( const CvArr* src1, const CvArr* src2,\n                  CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(idx) = src(idx) & value */\nCVAPI(void) cvAndS( const CvArr* src, CvScalar value,\n                   CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(idx) = src1(idx) | src2(idx) */\nCVAPI(void) cvOr( const CvArr* src1, const CvArr* src2,\n                 CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(idx) = src(idx) | value */\nCVAPI(void) cvOrS( const CvArr* src, CvScalar value,\n                  CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(idx) = src1(idx) ^ src2(idx) */\nCVAPI(void) cvXor( const CvArr* src1, const CvArr* src2,\n                  CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(idx) = src(idx) ^ value */\nCVAPI(void) cvXorS( const CvArr* src, CvScalar value,\n                   CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));\n\n/** dst(idx) = ~src(idx) */\nCVAPI(void) cvNot( const CvArr* src, CvArr* dst );\n\n/** dst(idx) = lower(idx) <= src(idx) < upper(idx) */\nCVAPI(void) cvInRange( const CvArr* src, const CvArr* lower,\n                      const CvArr* upper, CvArr* dst );\n\n/** dst(idx) = lower <= src(idx) < upper */\nCVAPI(void) cvInRangeS( const CvArr* src, CvScalar lower,\n                       CvScalar upper, CvArr* dst );\n\n#define CV_CMP_EQ   0\n#define CV_CMP_GT   1\n#define CV_CMP_GE   2\n#define CV_CMP_LT   3\n#define CV_CMP_LE   4\n#define CV_CMP_NE   5\n\n/** The comparison operation support single-channel arrays only.\n   Destination image should be 8uC1 or 8sC1 */\n\n/** dst(idx) = src1(idx) _cmp_op_ src2(idx) */\nCVAPI(void) cvCmp( const CvArr* src1, const CvArr* src2, CvArr* dst, int cmp_op );\n\n/** dst(idx) = src1(idx) _cmp_op_ value */\nCVAPI(void) cvCmpS( const CvArr* src, double value, CvArr* dst, int cmp_op );\n\n/** dst(idx) = min(src1(idx),src2(idx)) */\nCVAPI(void) cvMin( const CvArr* src1, const CvArr* src2, CvArr* dst );\n\n/** dst(idx) = max(src1(idx),src2(idx)) */\nCVAPI(void) cvMax( const CvArr* src1, const CvArr* src2, CvArr* dst );\n\n/** dst(idx) = min(src(idx),value) */\nCVAPI(void) cvMinS( const CvArr* src, double value, CvArr* dst );\n\n/** dst(idx) = max(src(idx),value) */\nCVAPI(void) cvMaxS( const CvArr* src, double value, CvArr* dst );\n\n/** dst(x,y,c) = abs(src1(x,y,c) - src2(x,y,c)) */\nCVAPI(void) cvAbsDiff( const CvArr* src1, const CvArr* src2, CvArr* dst );\n\n/** dst(x,y,c) = abs(src(x,y,c) - value(c)) */\nCVAPI(void) cvAbsDiffS( const CvArr* src, CvArr* dst, CvScalar value );\n#define cvAbs( src, dst ) cvAbsDiffS( (src), (dst), cvScalarAll(0))\n\n/****************************************************************************************\\\n*                                Math operations                                         *\n\\****************************************************************************************/\n\n/** Does cartesian->polar coordinates conversion.\n   Either of output components (magnitude or angle) is optional */\nCVAPI(void)  cvCartToPolar( const CvArr* x, const CvArr* y,\n                            CvArr* magnitude, CvArr* angle CV_DEFAULT(NULL),\n                            int angle_in_degrees CV_DEFAULT(0));\n\n/** Does polar->cartesian coordinates conversion.\n   Either of output components (magnitude or angle) is optional.\n   If magnitude is missing it is assumed to be all 1's */\nCVAPI(void)  cvPolarToCart( const CvArr* magnitude, const CvArr* angle,\n                            CvArr* x, CvArr* y,\n                            int angle_in_degrees CV_DEFAULT(0));\n\n/** Does powering: dst(idx) = src(idx)^power */\nCVAPI(void)  cvPow( const CvArr* src, CvArr* dst, double power );\n\n/** Does exponention: dst(idx) = exp(src(idx)).\n   Overflow is not handled yet. Underflow is handled.\n   Maximal relative error is ~7e-6 for single-precision input */\nCVAPI(void)  cvExp( const CvArr* src, CvArr* dst );\n\n/** Calculates natural logarithms: dst(idx) = log(abs(src(idx))).\n   Logarithm of 0 gives large negative number(~-700)\n   Maximal relative error is ~3e-7 for single-precision output\n*/\nCVAPI(void)  cvLog( const CvArr* src, CvArr* dst );\n\n/** Fast arctangent calculation */\nCVAPI(float) cvFastArctan( float y, float x );\n\n/** Fast cubic root calculation */\nCVAPI(float)  cvCbrt( float value );\n\n#define  CV_CHECK_RANGE    1\n#define  CV_CHECK_QUIET    2\n/** Checks array values for NaNs, Infs or simply for too large numbers\n   (if CV_CHECK_RANGE is set). If CV_CHECK_QUIET is set,\n   no runtime errors is raised (function returns zero value in case of \"bad\" values).\n   Otherwise cvError is called */\nCVAPI(int)  cvCheckArr( const CvArr* arr, int flags CV_DEFAULT(0),\n                        double min_val CV_DEFAULT(0), double max_val CV_DEFAULT(0));\n#define cvCheckArray cvCheckArr\n\n#define CV_RAND_UNI      0\n#define CV_RAND_NORMAL   1\n\n/** @brief Fills an array with random numbers and updates the RNG state.\n\nThe function fills the destination array with uniformly or normally distributed random numbers.\n@param rng CvRNG state initialized by cvRNG\n@param arr The destination array\n@param dist_type Distribution type\n> -   **CV_RAND_UNI** uniform distribution\n> -   **CV_RAND_NORMAL** normal or Gaussian distribution\n@param param1 The first parameter of the distribution. In the case of a uniform distribution it is\nthe inclusive lower boundary of the random numbers range. In the case of a normal distribution it\nis the mean value of the random numbers.\n@param param2 The second parameter of the distribution. In the case of a uniform distribution it\nis the exclusive upper boundary of the random numbers range. In the case of a normal distribution\nit is the standard deviation of the random numbers.\n@sa randu, randn, RNG::fill.\n */\nCVAPI(void) cvRandArr( CvRNG* rng, CvArr* arr, int dist_type,\n                      CvScalar param1, CvScalar param2 );\n\nCVAPI(void) cvRandShuffle( CvArr* mat, CvRNG* rng,\n                           double iter_factor CV_DEFAULT(1.));\n\n#define CV_SORT_EVERY_ROW 0\n#define CV_SORT_EVERY_COLUMN 1\n#define CV_SORT_ASCENDING 0\n#define CV_SORT_DESCENDING 16\n\nCVAPI(void) cvSort( const CvArr* src, CvArr* dst CV_DEFAULT(NULL),\n                    CvArr* idxmat CV_DEFAULT(NULL),\n                    int flags CV_DEFAULT(0));\n\n/** Finds real roots of a cubic equation */\nCVAPI(int) cvSolveCubic( const CvMat* coeffs, CvMat* roots );\n\n/** Finds all real and complex roots of a polynomial equation */\nCVAPI(void) cvSolvePoly(const CvMat* coeffs, CvMat *roots2,\n      int maxiter CV_DEFAULT(20), int fig CV_DEFAULT(100));\n\n/****************************************************************************************\\\n*                                Matrix operations                                       *\n\\****************************************************************************************/\n\n/** @brief Calculates the cross product of two 3D vectors.\n\nThe function calculates the cross product of two 3D vectors:\n\\f[\\texttt{dst} =  \\texttt{src1} \\times \\texttt{src2}\\f]\nor:\n\\f[\\begin{array}{l} \\texttt{dst} _1 =  \\texttt{src1} _2  \\texttt{src2} _3 -  \\texttt{src1} _3  \\texttt{src2} _2 \\\\ \\texttt{dst} _2 =  \\texttt{src1} _3  \\texttt{src2} _1 -  \\texttt{src1} _1  \\texttt{src2} _3 \\\\ \\texttt{dst} _3 =  \\texttt{src1} _1  \\texttt{src2} _2 -  \\texttt{src1} _2  \\texttt{src2} _1 \\end{array}\\f]\n@param src1 The first source vector\n@param src2 The second source vector\n@param dst The destination vector\n */\nCVAPI(void)  cvCrossProduct( const CvArr* src1, const CvArr* src2, CvArr* dst );\n\n/** Matrix transform: dst = A*B + C, C is optional */\n#define cvMatMulAdd( src1, src2, src3, dst ) cvGEMM( (src1), (src2), 1., (src3), 1., (dst), 0 )\n#define cvMatMul( src1, src2, dst )  cvMatMulAdd( (src1), (src2), NULL, (dst))\n\n#define CV_GEMM_A_T 1\n#define CV_GEMM_B_T 2\n#define CV_GEMM_C_T 4\n/** Extended matrix transform:\n   dst = alpha*op(A)*op(B) + beta*op(C), where op(X) is X or X^T */\nCVAPI(void)  cvGEMM( const CvArr* src1, const CvArr* src2, double alpha,\n                     const CvArr* src3, double beta, CvArr* dst,\n                     int tABC CV_DEFAULT(0));\n#define cvMatMulAddEx cvGEMM\n\n/** Transforms each element of source array and stores\n   resultant vectors in destination array */\nCVAPI(void)  cvTransform( const CvArr* src, CvArr* dst,\n                          const CvMat* transmat,\n                          const CvMat* shiftvec CV_DEFAULT(NULL));\n#define cvMatMulAddS cvTransform\n\n/** Does perspective transform on every element of input array */\nCVAPI(void)  cvPerspectiveTransform( const CvArr* src, CvArr* dst,\n                                     const CvMat* mat );\n\n/** Calculates (A-delta)*(A-delta)^T (order=0) or (A-delta)^T*(A-delta) (order=1) */\nCVAPI(void) cvMulTransposed( const CvArr* src, CvArr* dst, int order,\n                             const CvArr* delta CV_DEFAULT(NULL),\n                             double scale CV_DEFAULT(1.) );\n\n/** Transposes matrix. Square matrices can be transposed in-place */\nCVAPI(void)  cvTranspose( const CvArr* src, CvArr* dst );\n#define cvT cvTranspose\n\n/** Completes the symmetric matrix from the lower (LtoR=0) or from the upper (LtoR!=0) part */\nCVAPI(void)  cvCompleteSymm( CvMat* matrix, int LtoR CV_DEFAULT(0) );\n\n/** Mirror array data around horizontal (flip=0),\n   vertical (flip=1) or both(flip=-1) axises:\n   cvFlip(src) flips images vertically and sequences horizontally (inplace) */\nCVAPI(void)  cvFlip( const CvArr* src, CvArr* dst CV_DEFAULT(NULL),\n                     int flip_mode CV_DEFAULT(0));\n#define cvMirror cvFlip\n\n\n#define CV_SVD_MODIFY_A   1\n#define CV_SVD_U_T        2\n#define CV_SVD_V_T        4\n\n/** Performs Singular Value Decomposition of a matrix */\nCVAPI(void)   cvSVD( CvArr* A, CvArr* W, CvArr* U CV_DEFAULT(NULL),\n                     CvArr* V CV_DEFAULT(NULL), int flags CV_DEFAULT(0));\n\n/** Performs Singular Value Back Substitution (solves A*X = B):\n   flags must be the same as in cvSVD */\nCVAPI(void)   cvSVBkSb( const CvArr* W, const CvArr* U,\n                        const CvArr* V, const CvArr* B,\n                        CvArr* X, int flags );\n\n#define CV_LU  0\n#define CV_SVD 1\n#define CV_SVD_SYM 2\n#define CV_CHOLESKY 3\n#define CV_QR  4\n#define CV_NORMAL 16\n\n/** Inverts matrix */\nCVAPI(double)  cvInvert( const CvArr* src, CvArr* dst,\n                         int method CV_DEFAULT(CV_LU));\n#define cvInv cvInvert\n\n/** Solves linear system (src1)*(dst) = (src2)\n   (returns 0 if src1 is a singular and CV_LU method is used) */\nCVAPI(int)  cvSolve( const CvArr* src1, const CvArr* src2, CvArr* dst,\n                     int method CV_DEFAULT(CV_LU));\n\n/** Calculates determinant of input matrix */\nCVAPI(double) cvDet( const CvArr* mat );\n\n/** Calculates trace of the matrix (sum of elements on the main diagonal) */\nCVAPI(CvScalar) cvTrace( const CvArr* mat );\n\n/** Finds eigen values and vectors of a symmetric matrix */\nCVAPI(void)  cvEigenVV( CvArr* mat, CvArr* evects, CvArr* evals,\n                        double eps CV_DEFAULT(0),\n                        int lowindex CV_DEFAULT(-1),\n                        int highindex CV_DEFAULT(-1));\n\n///* Finds selected eigen values and vectors of a symmetric matrix */\n//CVAPI(void)  cvSelectedEigenVV( CvArr* mat, CvArr* evects, CvArr* evals,\n//                                int lowindex, int highindex );\n\n/** Makes an identity matrix (mat_ij = i == j) */\nCVAPI(void)  cvSetIdentity( CvArr* mat, CvScalar value CV_DEFAULT(cvRealScalar(1)) );\n\n/** Fills matrix with given range of numbers */\nCVAPI(CvArr*)  cvRange( CvArr* mat, double start, double end );\n\n/**   @anchor core_c_CovarFlags\n@name Flags for cvCalcCovarMatrix\n@see cvCalcCovarMatrix\n  @{\n*/\n\n/** flag for cvCalcCovarMatrix, transpose([v1-avg, v2-avg,...]) * [v1-avg,v2-avg,...] */\n#define CV_COVAR_SCRAMBLED 0\n\n/** flag for cvCalcCovarMatrix, [v1-avg, v2-avg,...] * transpose([v1-avg,v2-avg,...]) */\n#define CV_COVAR_NORMAL    1\n\n/** flag for cvCalcCovarMatrix, do not calc average (i.e. mean vector) - use the input vector instead\n   (useful for calculating covariance matrix by parts) */\n#define CV_COVAR_USE_AVG   2\n\n/** flag for cvCalcCovarMatrix, scale the covariance matrix coefficients by number of the vectors */\n#define CV_COVAR_SCALE     4\n\n/** flag for cvCalcCovarMatrix, all the input vectors are stored in a single matrix, as its rows */\n#define CV_COVAR_ROWS      8\n\n/** flag for cvCalcCovarMatrix, all the input vectors are stored in a single matrix, as its columns */\n#define CV_COVAR_COLS     16\n\n/** @} */\n\n/** Calculates covariation matrix for a set of vectors\n@see @ref core_c_CovarFlags \"flags\"\n*/\nCVAPI(void)  cvCalcCovarMatrix( const CvArr** vects, int count,\n                                CvArr* cov_mat, CvArr* avg, int flags );\n\n#define CV_PCA_DATA_AS_ROW 0\n#define CV_PCA_DATA_AS_COL 1\n#define CV_PCA_USE_AVG 2\nCVAPI(void)  cvCalcPCA( const CvArr* data, CvArr* mean,\n                        CvArr* eigenvals, CvArr* eigenvects, int flags );\n\nCVAPI(void)  cvProjectPCA( const CvArr* data, const CvArr* mean,\n                           const CvArr* eigenvects, CvArr* result );\n\nCVAPI(void)  cvBackProjectPCA( const CvArr* proj, const CvArr* mean,\n                               const CvArr* eigenvects, CvArr* result );\n\n/** Calculates Mahalanobis(weighted) distance */\nCVAPI(double)  cvMahalanobis( const CvArr* vec1, const CvArr* vec2, const CvArr* mat );\n#define cvMahalonobis  cvMahalanobis\n\n/****************************************************************************************\\\n*                                    Array Statistics                                    *\n\\****************************************************************************************/\n\n/** Finds sum of array elements */\nCVAPI(CvScalar)  cvSum( const CvArr* arr );\n\n/** Calculates number of non-zero pixels */\nCVAPI(int)  cvCountNonZero( const CvArr* arr );\n\n/** Calculates mean value of array elements */\nCVAPI(CvScalar)  cvAvg( const CvArr* arr, const CvArr* mask CV_DEFAULT(NULL) );\n\n/** Calculates mean and standard deviation of pixel values */\nCVAPI(void)  cvAvgSdv( const CvArr* arr, CvScalar* mean, CvScalar* std_dev,\n                       const CvArr* mask CV_DEFAULT(NULL) );\n\n/** Finds global minimum, maximum and their positions */\nCVAPI(void)  cvMinMaxLoc( const CvArr* arr, double* min_val, double* max_val,\n                          CvPoint* min_loc CV_DEFAULT(NULL),\n                          CvPoint* max_loc CV_DEFAULT(NULL),\n                          const CvArr* mask CV_DEFAULT(NULL) );\n\n/** @anchor core_c_NormFlags\n  @name Flags for cvNorm and cvNormalize\n  @{\n*/\n#define CV_C            1\n#define CV_L1           2\n#define CV_L2           4\n#define CV_NORM_MASK    7\n#define CV_RELATIVE     8\n#define CV_DIFF         16\n#define CV_MINMAX       32\n\n#define CV_DIFF_C       (CV_DIFF | CV_C)\n#define CV_DIFF_L1      (CV_DIFF | CV_L1)\n#define CV_DIFF_L2      (CV_DIFF | CV_L2)\n#define CV_RELATIVE_C   (CV_RELATIVE | CV_C)\n#define CV_RELATIVE_L1  (CV_RELATIVE | CV_L1)\n#define CV_RELATIVE_L2  (CV_RELATIVE | CV_L2)\n/** @} */\n\n/** Finds norm, difference norm or relative difference norm for an array (or two arrays)\n@see ref core_c_NormFlags \"flags\"\n*/\nCVAPI(double)  cvNorm( const CvArr* arr1, const CvArr* arr2 CV_DEFAULT(NULL),\n                       int norm_type CV_DEFAULT(CV_L2),\n                       const CvArr* mask CV_DEFAULT(NULL) );\n\n/** @see ref core_c_NormFlags \"flags\" */\nCVAPI(void)  cvNormalize( const CvArr* src, CvArr* dst,\n                          double a CV_DEFAULT(1.), double b CV_DEFAULT(0.),\n                          int norm_type CV_DEFAULT(CV_L2),\n                          const CvArr* mask CV_DEFAULT(NULL) );\n\n/** @anchor core_c_ReduceFlags\n  @name Flags for cvReduce\n  @{\n*/\n#define CV_REDUCE_SUM 0\n#define CV_REDUCE_AVG 1\n#define CV_REDUCE_MAX 2\n#define CV_REDUCE_MIN 3\n/** @} */\n\n/** @see @ref core_c_ReduceFlags \"flags\" */\nCVAPI(void)  cvReduce( const CvArr* src, CvArr* dst, int dim CV_DEFAULT(-1),\n                       int op CV_DEFAULT(CV_REDUCE_SUM) );\n\n/****************************************************************************************\\\n*                      Discrete Linear Transforms and Related Functions                  *\n\\****************************************************************************************/\n\n/** @anchor core_c_DftFlags\n  @name Flags for cvDFT, cvDCT and cvMulSpectrums\n  @{\n  */\n#define CV_DXT_FORWARD  0\n#define CV_DXT_INVERSE  1\n#define CV_DXT_SCALE    2 /**< divide result by size of array */\n#define CV_DXT_INV_SCALE (CV_DXT_INVERSE + CV_DXT_SCALE)\n#define CV_DXT_INVERSE_SCALE CV_DXT_INV_SCALE\n#define CV_DXT_ROWS     4 /**< transform each row individually */\n#define CV_DXT_MUL_CONJ 8 /**< conjugate the second argument of cvMulSpectrums */\n/** @} */\n\n/** Discrete Fourier Transform:\n    complex->complex,\n    real->ccs (forward),\n    ccs->real (inverse)\n@see core_c_DftFlags \"flags\"\n*/\nCVAPI(void)  cvDFT( const CvArr* src, CvArr* dst, int flags,\n                    int nonzero_rows CV_DEFAULT(0) );\n#define cvFFT cvDFT\n\n/** Multiply results of DFTs: DFT(X)*DFT(Y) or DFT(X)*conj(DFT(Y))\n@see core_c_DftFlags \"flags\"\n*/\nCVAPI(void)  cvMulSpectrums( const CvArr* src1, const CvArr* src2,\n                             CvArr* dst, int flags );\n\n/** Finds optimal DFT vector size >= size0 */\nCVAPI(int)  cvGetOptimalDFTSize( int size0 );\n\n/** Discrete Cosine Transform\n@see core_c_DftFlags \"flags\"\n*/\nCVAPI(void)  cvDCT( const CvArr* src, CvArr* dst, int flags );\n\n/****************************************************************************************\\\n*                              Dynamic data structures                                   *\n\\****************************************************************************************/\n\n/** Calculates length of sequence slice (with support of negative indices). */\nCVAPI(int) cvSliceLength( CvSlice slice, const CvSeq* seq );\n\n\n/** Creates new memory storage.\n   block_size == 0 means that default,\n   somewhat optimal size, is used (currently, it is 64K) */\nCVAPI(CvMemStorage*)  cvCreateMemStorage( int block_size CV_DEFAULT(0));\n\n\n/** Creates a memory storage that will borrow memory blocks from parent storage */\nCVAPI(CvMemStorage*)  cvCreateChildMemStorage( CvMemStorage* parent );\n\n\n/** Releases memory storage. All the children of a parent must be released before\n   the parent. A child storage returns all the blocks to parent when it is released */\nCVAPI(void)  cvReleaseMemStorage( CvMemStorage** storage );\n\n\n/** Clears memory storage. This is the only way(!!!) (besides cvRestoreMemStoragePos)\n   to reuse memory allocated for the storage - cvClearSeq,cvClearSet ...\n   do not free any memory.\n   A child storage returns all the blocks to the parent when it is cleared */\nCVAPI(void)  cvClearMemStorage( CvMemStorage* storage );\n\n/** Remember a storage \"free memory\" position */\nCVAPI(void)  cvSaveMemStoragePos( const CvMemStorage* storage, CvMemStoragePos* pos );\n\n/** Restore a storage \"free memory\" position */\nCVAPI(void)  cvRestoreMemStoragePos( CvMemStorage* storage, CvMemStoragePos* pos );\n\n/** Allocates continuous buffer of the specified size in the storage */\nCVAPI(void*) cvMemStorageAlloc( CvMemStorage* storage, size_t size );\n\n/** Allocates string in memory storage */\n//CVAPI(CvString) cvMemStorageAllocString( CvMemStorage* storage, const char* ptr,\n//                                         int len CV_DEFAULT(-1) );\n\n/** Creates new empty sequence that will reside in the specified storage */\nCVAPI(CvSeq*)  cvCreateSeq( int seq_flags, size_t header_size,\n                            size_t elem_size, CvMemStorage* storage );\n\n/** Changes default size (granularity) of sequence blocks.\n   The default size is ~1Kbyte */\nCVAPI(void)  cvSetSeqBlockSize( CvSeq* seq, int delta_elems );\n\n\n/** Adds new element to the end of sequence. Returns pointer to the element */\nCVAPI(schar*)  cvSeqPush( CvSeq* seq, const void* element CV_DEFAULT(NULL));\n\n\n/** Adds new element to the beginning of sequence. Returns pointer to it */\nCVAPI(schar*)  cvSeqPushFront( CvSeq* seq, const void* element CV_DEFAULT(NULL));\n\n\n/** Removes the last element from sequence and optionally saves it */\nCVAPI(void)  cvSeqPop( CvSeq* seq, void* element CV_DEFAULT(NULL));\n\n\n/** Removes the first element from sequence and optioanally saves it */\nCVAPI(void)  cvSeqPopFront( CvSeq* seq, void* element CV_DEFAULT(NULL));\n\n\n#define CV_FRONT 1\n#define CV_BACK 0\n/** Adds several new elements to the end of sequence */\nCVAPI(void)  cvSeqPushMulti( CvSeq* seq, const void* elements,\n                             int count, int in_front CV_DEFAULT(0) );\n\n/** Removes several elements from the end of sequence and optionally saves them */\nCVAPI(void)  cvSeqPopMulti( CvSeq* seq, void* elements,\n                            int count, int in_front CV_DEFAULT(0) );\n\n/** Inserts a new element in the middle of sequence.\n   cvSeqInsert(seq,0,elem) == cvSeqPushFront(seq,elem) */\nCVAPI(schar*)  cvSeqInsert( CvSeq* seq, int before_index,\n                            const void* element CV_DEFAULT(NULL));\n\n/** Removes specified sequence element */\nCVAPI(void)  cvSeqRemove( CvSeq* seq, int index );\n\n\n/** Removes all the elements from the sequence. The freed memory\n   can be reused later only by the same sequence unless cvClearMemStorage\n   or cvRestoreMemStoragePos is called */\nCVAPI(void)  cvClearSeq( CvSeq* seq );\n\n\n/** Retrieves pointer to specified sequence element.\n   Negative indices are supported and mean counting from the end\n   (e.g -1 means the last sequence element) */\nCVAPI(schar*)  cvGetSeqElem( const CvSeq* seq, int index );\n\n/** Calculates index of the specified sequence element.\n   Returns -1 if element does not belong to the sequence */\nCVAPI(int)  cvSeqElemIdx( const CvSeq* seq, const void* element,\n                         CvSeqBlock** block CV_DEFAULT(NULL) );\n\n/** Initializes sequence writer. The new elements will be added to the end of sequence */\nCVAPI(void)  cvStartAppendToSeq( CvSeq* seq, CvSeqWriter* writer );\n\n\n/** Combination of cvCreateSeq and cvStartAppendToSeq */\nCVAPI(void)  cvStartWriteSeq( int seq_flags, int header_size,\n                              int elem_size, CvMemStorage* storage,\n                              CvSeqWriter* writer );\n\n/** Closes sequence writer, updates sequence header and returns pointer\n   to the resultant sequence\n   (which may be useful if the sequence was created using cvStartWriteSeq))\n*/\nCVAPI(CvSeq*)  cvEndWriteSeq( CvSeqWriter* writer );\n\n\n/** Updates sequence header. May be useful to get access to some of previously\n   written elements via cvGetSeqElem or sequence reader */\nCVAPI(void)   cvFlushSeqWriter( CvSeqWriter* writer );\n\n\n/** Initializes sequence reader.\n   The sequence can be read in forward or backward direction */\nCVAPI(void) cvStartReadSeq( const CvSeq* seq, CvSeqReader* reader,\n                           int reverse CV_DEFAULT(0) );\n\n\n/** Returns current sequence reader position (currently observed sequence element) */\nCVAPI(int)  cvGetSeqReaderPos( CvSeqReader* reader );\n\n\n/** Changes sequence reader position. It may seek to an absolute or\n   to relative to the current position */\nCVAPI(void)   cvSetSeqReaderPos( CvSeqReader* reader, int index,\n                                 int is_relative CV_DEFAULT(0));\n\n/** Copies sequence content to a continuous piece of memory */\nCVAPI(void*)  cvCvtSeqToArray( const CvSeq* seq, void* elements,\n                               CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ) );\n\n/** Creates sequence header for array.\n   After that all the operations on sequences that do not alter the content\n   can be applied to the resultant sequence */\nCVAPI(CvSeq*) cvMakeSeqHeaderForArray( int seq_type, int header_size,\n                                       int elem_size, void* elements, int total,\n                                       CvSeq* seq, CvSeqBlock* block );\n\n/** Extracts sequence slice (with or without copying sequence elements) */\nCVAPI(CvSeq*) cvSeqSlice( const CvSeq* seq, CvSlice slice,\n                         CvMemStorage* storage CV_DEFAULT(NULL),\n                         int copy_data CV_DEFAULT(0));\n\nCV_INLINE CvSeq* cvCloneSeq( const CvSeq* seq, CvMemStorage* storage CV_DEFAULT(NULL))\n{\n    return cvSeqSlice( seq, CV_WHOLE_SEQ, storage, 1 );\n}\n\n/** Removes sequence slice */\nCVAPI(void)  cvSeqRemoveSlice( CvSeq* seq, CvSlice slice );\n\n/** Inserts a sequence or array into another sequence */\nCVAPI(void)  cvSeqInsertSlice( CvSeq* seq, int before_index, const CvArr* from_arr );\n\n/** a < b ? -1 : a > b ? 1 : 0 */\ntypedef int (CV_CDECL* CvCmpFunc)(const void* a, const void* b, void* userdata );\n\n/** Sorts sequence in-place given element comparison function */\nCVAPI(void) cvSeqSort( CvSeq* seq, CvCmpFunc func, void* userdata CV_DEFAULT(NULL) );\n\n/** Finds element in a [sorted] sequence */\nCVAPI(schar*) cvSeqSearch( CvSeq* seq, const void* elem, CvCmpFunc func,\n                           int is_sorted, int* elem_idx,\n                           void* userdata CV_DEFAULT(NULL) );\n\n/** Reverses order of sequence elements in-place */\nCVAPI(void) cvSeqInvert( CvSeq* seq );\n\n/** Splits sequence into one or more equivalence classes using the specified criteria */\nCVAPI(int)  cvSeqPartition( const CvSeq* seq, CvMemStorage* storage,\n                            CvSeq** labels, CvCmpFunc is_equal, void* userdata );\n\n/************ Internal sequence functions ************/\nCVAPI(void)  cvChangeSeqBlock( void* reader, int direction );\nCVAPI(void)  cvCreateSeqBlock( CvSeqWriter* writer );\n\n\n/** Creates a new set */\nCVAPI(CvSet*)  cvCreateSet( int set_flags, int header_size,\n                            int elem_size, CvMemStorage* storage );\n\n/** Adds new element to the set and returns pointer to it */\nCVAPI(int)  cvSetAdd( CvSet* set_header, CvSetElem* elem CV_DEFAULT(NULL),\n                      CvSetElem** inserted_elem CV_DEFAULT(NULL) );\n\n/** Fast variant of cvSetAdd */\nCV_INLINE  CvSetElem* cvSetNew( CvSet* set_header )\n{\n    CvSetElem* elem = set_header->free_elems;\n    if( elem )\n    {\n        set_header->free_elems = elem->next_free;\n        elem->flags = elem->flags & CV_SET_ELEM_IDX_MASK;\n        set_header->active_count++;\n    }\n    else\n        cvSetAdd( set_header, NULL, &elem );\n    return elem;\n}\n\n/** Removes set element given its pointer */\nCV_INLINE  void cvSetRemoveByPtr( CvSet* set_header, void* elem )\n{\n    CvSetElem* _elem = (CvSetElem*)elem;\n    assert( _elem->flags >= 0 /*&& (elem->flags & CV_SET_ELEM_IDX_MASK) < set_header->total*/ );\n    _elem->next_free = set_header->free_elems;\n    _elem->flags = (_elem->flags & CV_SET_ELEM_IDX_MASK) | CV_SET_ELEM_FREE_FLAG;\n    set_header->free_elems = _elem;\n    set_header->active_count--;\n}\n\n/** Removes element from the set by its index  */\nCVAPI(void)   cvSetRemove( CvSet* set_header, int index );\n\n/** Returns a set element by index. If the element doesn't belong to the set,\n   NULL is returned */\nCV_INLINE CvSetElem* cvGetSetElem( const CvSet* set_header, int idx )\n{\n    CvSetElem* elem = (CvSetElem*)(void *)cvGetSeqElem( (CvSeq*)set_header, idx );\n    return elem && CV_IS_SET_ELEM( elem ) ? elem : 0;\n}\n\n/** Removes all the elements from the set */\nCVAPI(void)  cvClearSet( CvSet* set_header );\n\n/** Creates new graph */\nCVAPI(CvGraph*)  cvCreateGraph( int graph_flags, int header_size,\n                                int vtx_size, int edge_size,\n                                CvMemStorage* storage );\n\n/** Adds new vertex to the graph */\nCVAPI(int)  cvGraphAddVtx( CvGraph* graph, const CvGraphVtx* vtx CV_DEFAULT(NULL),\n                           CvGraphVtx** inserted_vtx CV_DEFAULT(NULL) );\n\n\n/** Removes vertex from the graph together with all incident edges */\nCVAPI(int)  cvGraphRemoveVtx( CvGraph* graph, int index );\nCVAPI(int)  cvGraphRemoveVtxByPtr( CvGraph* graph, CvGraphVtx* vtx );\n\n\n/** Link two vertices specified by indices or pointers if they\n   are not connected or return pointer to already existing edge\n   connecting the vertices.\n   Functions return 1 if a new edge was created, 0 otherwise */\nCVAPI(int)  cvGraphAddEdge( CvGraph* graph,\n                            int start_idx, int end_idx,\n                            const CvGraphEdge* edge CV_DEFAULT(NULL),\n                            CvGraphEdge** inserted_edge CV_DEFAULT(NULL) );\n\nCVAPI(int)  cvGraphAddEdgeByPtr( CvGraph* graph,\n                               CvGraphVtx* start_vtx, CvGraphVtx* end_vtx,\n                               const CvGraphEdge* edge CV_DEFAULT(NULL),\n                               CvGraphEdge** inserted_edge CV_DEFAULT(NULL) );\n\n/** Remove edge connecting two vertices */\nCVAPI(void)  cvGraphRemoveEdge( CvGraph* graph, int start_idx, int end_idx );\nCVAPI(void)  cvGraphRemoveEdgeByPtr( CvGraph* graph, CvGraphVtx* start_vtx,\n                                     CvGraphVtx* end_vtx );\n\n/** Find edge connecting two vertices */\nCVAPI(CvGraphEdge*)  cvFindGraphEdge( const CvGraph* graph, int start_idx, int end_idx );\nCVAPI(CvGraphEdge*)  cvFindGraphEdgeByPtr( const CvGraph* graph,\n                                           const CvGraphVtx* start_vtx,\n                                           const CvGraphVtx* end_vtx );\n#define cvGraphFindEdge cvFindGraphEdge\n#define cvGraphFindEdgeByPtr cvFindGraphEdgeByPtr\n\n/** Remove all vertices and edges from the graph */\nCVAPI(void)  cvClearGraph( CvGraph* graph );\n\n\n/** Count number of edges incident to the vertex */\nCVAPI(int)  cvGraphVtxDegree( const CvGraph* graph, int vtx_idx );\nCVAPI(int)  cvGraphVtxDegreeByPtr( const CvGraph* graph, const CvGraphVtx* vtx );\n\n\n/** Retrieves graph vertex by given index */\n#define cvGetGraphVtx( graph, idx ) (CvGraphVtx*)cvGetSetElem((CvSet*)(graph), (idx))\n\n/** Retrieves index of a graph vertex given its pointer */\n#define cvGraphVtxIdx( graph, vtx ) ((vtx)->flags & CV_SET_ELEM_IDX_MASK)\n\n/** Retrieves index of a graph edge given its pointer */\n#define cvGraphEdgeIdx( graph, edge ) ((edge)->flags & CV_SET_ELEM_IDX_MASK)\n\n#define cvGraphGetVtxCount( graph ) ((graph)->active_count)\n#define cvGraphGetEdgeCount( graph ) ((graph)->edges->active_count)\n\n#define  CV_GRAPH_VERTEX        1\n#define  CV_GRAPH_TREE_EDGE     2\n#define  CV_GRAPH_BACK_EDGE     4\n#define  CV_GRAPH_FORWARD_EDGE  8\n#define  CV_GRAPH_CROSS_EDGE    16\n#define  CV_GRAPH_ANY_EDGE      30\n#define  CV_GRAPH_NEW_TREE      32\n#define  CV_GRAPH_BACKTRACKING  64\n#define  CV_GRAPH_OVER          -1\n\n#define  CV_GRAPH_ALL_ITEMS    -1\n\n/** flags for graph vertices and edges */\n#define  CV_GRAPH_ITEM_VISITED_FLAG  (1 << 30)\n#define  CV_IS_GRAPH_VERTEX_VISITED(vtx) \\\n    (((CvGraphVtx*)(vtx))->flags & CV_GRAPH_ITEM_VISITED_FLAG)\n#define  CV_IS_GRAPH_EDGE_VISITED(edge) \\\n    (((CvGraphEdge*)(edge))->flags & CV_GRAPH_ITEM_VISITED_FLAG)\n#define  CV_GRAPH_SEARCH_TREE_NODE_FLAG   (1 << 29)\n#define  CV_GRAPH_FORWARD_EDGE_FLAG       (1 << 28)\n\ntypedef struct CvGraphScanner\n{\n    CvGraphVtx* vtx;       /* current graph vertex (or current edge origin) */\n    CvGraphVtx* dst;       /* current graph edge destination vertex */\n    CvGraphEdge* edge;     /* current edge */\n\n    CvGraph* graph;        /* the graph */\n    CvSeq*   stack;        /* the graph vertex stack */\n    int      index;        /* the lower bound of certainly visited vertices */\n    int      mask;         /* event mask */\n}\nCvGraphScanner;\n\n/** Creates new graph scanner. */\nCVAPI(CvGraphScanner*)  cvCreateGraphScanner( CvGraph* graph,\n                                             CvGraphVtx* vtx CV_DEFAULT(NULL),\n                                             int mask CV_DEFAULT(CV_GRAPH_ALL_ITEMS));\n\n/** Releases graph scanner. */\nCVAPI(void) cvReleaseGraphScanner( CvGraphScanner** scanner );\n\n/** Get next graph element */\nCVAPI(int)  cvNextGraphItem( CvGraphScanner* scanner );\n\n/** Creates a copy of graph */\nCVAPI(CvGraph*) cvCloneGraph( const CvGraph* graph, CvMemStorage* storage );\n\n\n/** Does look-up transformation. Elements of the source array\n   (that should be 8uC1 or 8sC1) are used as indexes in lutarr 256-element table */\nCVAPI(void) cvLUT( const CvArr* src, CvArr* dst, const CvArr* lut );\n\n\n/******************* Iteration through the sequence tree *****************/\ntypedef struct CvTreeNodeIterator\n{\n    const void* node;\n    int level;\n    int max_level;\n}\nCvTreeNodeIterator;\n\nCVAPI(void) cvInitTreeNodeIterator( CvTreeNodeIterator* tree_iterator,\n                                   const void* first, int max_level );\nCVAPI(void*) cvNextTreeNode( CvTreeNodeIterator* tree_iterator );\nCVAPI(void*) cvPrevTreeNode( CvTreeNodeIterator* tree_iterator );\n\n/** Inserts sequence into tree with specified \"parent\" sequence.\n   If parent is equal to frame (e.g. the most external contour),\n   then added contour will have null pointer to parent. */\nCVAPI(void) cvInsertNodeIntoTree( void* node, void* parent, void* frame );\n\n/** Removes contour from tree (together with the contour children). */\nCVAPI(void) cvRemoveNodeFromTree( void* node, void* frame );\n\n/** Gathers pointers to all the sequences,\n   accessible from the `first`, to the single sequence */\nCVAPI(CvSeq*) cvTreeToNodeSeq( const void* first, int header_size,\n                              CvMemStorage* storage );\n\n/** The function implements the K-means algorithm for clustering an array of sample\n   vectors in a specified number of classes */\n#define CV_KMEANS_USE_INITIAL_LABELS    1\nCVAPI(int) cvKMeans2( const CvArr* samples, int cluster_count, CvArr* labels,\n                      CvTermCriteria termcrit, int attempts CV_DEFAULT(1),\n                      CvRNG* rng CV_DEFAULT(0), int flags CV_DEFAULT(0),\n                      CvArr* _centers CV_DEFAULT(0), double* compactness CV_DEFAULT(0) );\n\n/****************************************************************************************\\\n*                                    System functions                                    *\n\\****************************************************************************************/\n\n/** Loads optimized functions from IPP, MKL etc. or switches back to pure C code */\nCVAPI(int)  cvUseOptimized( int on_off );\n\ntypedef IplImage* (CV_STDCALL* Cv_iplCreateImageHeader)\n                            (int,int,int,char*,char*,int,int,int,int,int,\n                            IplROI*,IplImage*,void*,IplTileInfo*);\ntypedef void (CV_STDCALL* Cv_iplAllocateImageData)(IplImage*,int,int);\ntypedef void (CV_STDCALL* Cv_iplDeallocate)(IplImage*,int);\ntypedef IplROI* (CV_STDCALL* Cv_iplCreateROI)(int,int,int,int,int);\ntypedef IplImage* (CV_STDCALL* Cv_iplCloneImage)(const IplImage*);\n\n/** @brief Makes OpenCV use IPL functions for allocating IplImage and IplROI structures.\n\nNormally, the function is not called directly. Instead, a simple macro\nCV_TURN_ON_IPL_COMPATIBILITY() is used that calls cvSetIPLAllocators and passes there pointers\nto IPL allocation functions. :\n@code\n    ...\n    CV_TURN_ON_IPL_COMPATIBILITY()\n    ...\n@endcode\n@param create_header pointer to a function, creating IPL image header.\n@param allocate_data pointer to a function, allocating IPL image data.\n@param deallocate pointer to a function, deallocating IPL image.\n@param create_roi pointer to a function, creating IPL image ROI (i.e. Region of Interest).\n@param clone_image pointer to a function, cloning an IPL image.\n */\nCVAPI(void) cvSetIPLAllocators( Cv_iplCreateImageHeader create_header,\n                               Cv_iplAllocateImageData allocate_data,\n                               Cv_iplDeallocate deallocate,\n                               Cv_iplCreateROI create_roi,\n                               Cv_iplCloneImage clone_image );\n\n#define CV_TURN_ON_IPL_COMPATIBILITY()                                  \\\n    cvSetIPLAllocators( iplCreateImageHeader, iplAllocateImage,         \\\n                        iplDeallocate, iplCreateROI, iplCloneImage )\n\n/****************************************************************************************\\\n*                                    Data Persistence                                    *\n\\****************************************************************************************/\n\n#if 0\n/********************************** High-level functions ********************************/\n\n/** @brief Opens file storage for reading or writing data.\n\nThe function opens file storage for reading or writing data. In the latter case, a new file is\ncreated or an existing file is rewritten. The type of the read or written file is determined by the\nfilename extension: .xml for XML, .yml or .yaml for YAML and .json for JSON.\n\nAt the same time, it also supports adding parameters like \"example.xml?base64\".\n\nThe function returns a pointer to the CvFileStorage structure.\nIf the file cannot be opened then the function returns NULL.\n@param filename Name of the file associated with the storage\n@param memstorage Memory storage used for temporary data and for\n:   storing dynamic structures, such as CvSeq or CvGraph . If it is NULL, a temporary memory\n    storage is created and used.\n@param flags Can be one of the following:\n> -   **CV_STORAGE_READ** the storage is open for reading\n> -   **CV_STORAGE_WRITE** the storage is open for writing\n      (use **CV_STORAGE_WRITE | CV_STORAGE_WRITE_BASE64** to write rawdata in Base64)\n@param encoding\n */\nCVAPI(CvFileStorage*)  cvOpenFileStorage( const char* filename, CvMemStorage* memstorage,\n                                          int flags, const char* encoding CV_DEFAULT(NULL) );\n\n/** @brief Releases file storage.\n\nThe function closes the file associated with the storage and releases all the temporary structures.\nIt must be called after all I/O operations with the storage are finished.\n@param fs Double pointer to the released file storage\n */\nCVAPI(void) cvReleaseFileStorage( CvFileStorage** fs );\n\n/** returns attribute value or 0 (NULL) if there is no such attribute */\nCVAPI(const char*) cvAttrValue( const CvAttrList* attr, const char* attr_name );\n\n/** @brief Starts writing a new structure.\n\nThe function starts writing a compound structure (collection) that can be a sequence or a map. After\nall the structure fields, which can be scalars or structures, are written, cvEndWriteStruct should\nbe called. The function can be used to group some objects or to implement the write function for a\nsome user object (see CvTypeInfo).\n@param fs File storage\n@param name Name of the written structure. The structure can be accessed by this name when the\nstorage is read.\n@param struct_flags A combination one of the following values:\n-   **CV_NODE_SEQ** the written structure is a sequence (see discussion of CvFileStorage ),\n    that is, its elements do not have a name.\n-   **CV_NODE_MAP** the written structure is a map (see discussion of CvFileStorage ), that\n    is, all its elements have names.\nOne and only one of the two above flags must be specified\n-   **CV_NODE_FLOW** the optional flag that makes sense only for YAML streams. It means that\n     the structure is written as a flow (not as a block), which is more compact. It is\n     recommended to use this flag for structures or arrays whose elements are all scalars.\n@param type_name Optional parameter - the object type name. In\n    case of XML it is written as a type_id attribute of the structure opening tag. In the case of\n    YAML it is written after a colon following the structure name (see the example in\n    CvFileStorage description). In case of JSON it is written as a name/value pair.\n    Mainly it is used with user objects. When the storage is read, the\n    encoded type name is used to determine the object type (see CvTypeInfo and cvFindType ).\n@param attributes This parameter is not used in the current implementation\n */\nCVAPI(void) cvStartWriteStruct( CvFileStorage* fs, const char* name,\n                                int struct_flags, const char* type_name CV_DEFAULT(NULL),\n                                CvAttrList attributes CV_DEFAULT(cvAttrList()));\n\n/** @brief Finishes writing to a file node collection.\n@param fs File storage\n@sa cvStartWriteStruct.\n */\nCVAPI(void) cvEndWriteStruct( CvFileStorage* fs );\n\n/** @brief Writes an integer value.\n\nThe function writes a single integer value (with or without a name) to the file storage.\n@param fs File storage\n@param name Name of the written value. Should be NULL if and only if the parent structure is a\nsequence.\n@param value The written value\n */\nCVAPI(void) cvWriteInt( CvFileStorage* fs, const char* name, int value );\n\n/** @brief Writes a floating-point value.\n\nThe function writes a single floating-point value (with or without a name) to file storage. Special\nvalues are encoded as follows: NaN (Not A Number) as .NaN, infinity as +.Inf or -.Inf.\n\nThe following example shows how to use the low-level writing functions to store custom structures,\nsuch as termination criteria, without registering a new type. :\n@code\n    void write_termcriteria( CvFileStorage* fs, const char* struct_name,\n                             CvTermCriteria* termcrit )\n    {\n        cvStartWriteStruct( fs, struct_name, CV_NODE_MAP, NULL, cvAttrList(0,0));\n        cvWriteComment( fs, \"termination criteria\", 1 ); // just a description\n        if( termcrit->type & CV_TERMCRIT_ITER )\n            cvWriteInteger( fs, \"max_iterations\", termcrit->max_iter );\n        if( termcrit->type & CV_TERMCRIT_EPS )\n            cvWriteReal( fs, \"accuracy\", termcrit->epsilon );\n        cvEndWriteStruct( fs );\n    }\n@endcode\n@param fs File storage\n@param name Name of the written value. Should be NULL if and only if the parent structure is a\nsequence.\n@param value The written value\n*/\nCVAPI(void) cvWriteReal( CvFileStorage* fs, const char* name, double value );\n\n/** @brief Writes a text string.\n\nThe function writes a text string to file storage.\n@param fs File storage\n@param name Name of the written string . Should be NULL if and only if the parent structure is a\nsequence.\n@param str The written text string\n@param quote If non-zero, the written string is put in quotes, regardless of whether they are\nrequired. Otherwise, if the flag is zero, quotes are used only when they are required (e.g. when\nthe string starts with a digit or contains spaces).\n */\nCVAPI(void) cvWriteString( CvFileStorage* fs, const char* name,\n                           const char* str, int quote CV_DEFAULT(0) );\n\n/** @brief Writes a comment.\n\nThe function writes a comment into file storage. The comments are skipped when the storage is read.\n@param fs File storage\n@param comment The written comment, single-line or multi-line\n@param eol_comment If non-zero, the function tries to put the comment at the end of current line.\nIf the flag is zero, if the comment is multi-line, or if it does not fit at the end of the current\nline, the comment starts a new line.\n */\nCVAPI(void) cvWriteComment( CvFileStorage* fs, const char* comment,\n                            int eol_comment );\n\n/** @brief Writes an object to file storage.\n\nThe function writes an object to file storage. First, the appropriate type info is found using\ncvTypeOf. Then, the write method associated with the type info is called.\n\nAttributes are used to customize the writing procedure. The standard types support the following\nattributes (all the dt attributes have the same format as in cvWriteRawData):\n\n-# CvSeq\n    -   **header_dt** description of user fields of the sequence header that follow CvSeq, or\n        CvChain (if the sequence is a Freeman chain) or CvContour (if the sequence is a contour or\n        point sequence)\n    -   **dt** description of the sequence elements.\n    -   **recursive** if the attribute is present and is not equal to \"0\" or \"false\", the whole\n        tree of sequences (contours) is stored.\n-# CvGraph\n    -   **header_dt** description of user fields of the graph header that follows CvGraph;\n    -   **vertex_dt** description of user fields of graph vertices\n    -   **edge_dt** description of user fields of graph edges (note that the edge weight is\n        always written, so there is no need to specify it explicitly)\n\nBelow is the code that creates the YAML file shown in the CvFileStorage description:\n@code\n    #include \"cxcore.h\"\n\n    int main( int argc, char** argv )\n    {\n        CvMat* mat = cvCreateMat( 3, 3, CV_32F );\n        CvFileStorage* fs = cvOpenFileStorage( \"example.yml\", 0, CV_STORAGE_WRITE );\n\n        cvSetIdentity( mat );\n        cvWrite( fs, \"A\", mat, cvAttrList(0,0) );\n\n        cvReleaseFileStorage( &fs );\n        cvReleaseMat( &mat );\n        return 0;\n    }\n@endcode\n@param fs File storage\n@param name Name of the written object. Should be NULL if and only if the parent structure is a\nsequence.\n@param ptr Pointer to the object\n@param attributes The attributes of the object. They are specific for each particular type (see\nthe discussion below).\n */\nCVAPI(void) cvWrite( CvFileStorage* fs, const char* name, const void* ptr,\n                         CvAttrList attributes CV_DEFAULT(cvAttrList()));\n\n/** @brief Starts the next stream.\n\nThe function finishes the currently written stream and starts the next stream. In the case of XML\nthe file with multiple streams looks like this:\n@code{.xml}\n    <opencv_storage>\n    <!-- stream #1 data -->\n    </opencv_storage>\n    <opencv_storage>\n    <!-- stream #2 data -->\n    </opencv_storage>\n    ...\n@endcode\nThe YAML file will look like this:\n@code{.yaml}\n    %YAML 1.0\n    # stream #1 data\n    ...\n    ---\n    # stream #2 data\n@endcode\nThis is useful for concatenating files or for resuming the writing process.\n@param fs File storage\n */\nCVAPI(void) cvStartNextStream( CvFileStorage* fs );\n\n/** @brief Writes multiple numbers.\n\nThe function writes an array, whose elements consist of single or multiple numbers. The function\ncall can be replaced with a loop containing a few cvWriteInt and cvWriteReal calls, but a single\ncall is more efficient. Note that because none of the elements have a name, they should be written\nto a sequence rather than a map.\n@param fs File storage\n@param src Pointer to the written array\n@param len Number of the array elements to write\n@param dt Specification of each array element, see @ref format_spec \"format specification\"\n */\nCVAPI(void) cvWriteRawData( CvFileStorage* fs, const void* src,\n                                int len, const char* dt );\n\n/** @brief Writes multiple numbers in Base64.\n\nIf either CV_STORAGE_WRITE_BASE64 or cv::FileStorage::WRITE_BASE64 is used,\nthis function will be the same as cvWriteRawData. If neither, the main\ndifference is that it outputs a sequence in Base64 encoding rather than\nin plain text.\n\nThis function can only be used to write a sequence with a type \"binary\".\n\n@param fs File storage\n@param src Pointer to the written array\n@param len Number of the array elements to write\n@param dt Specification of each array element, see @ref format_spec \"format specification\"\n*/\nCVAPI(void) cvWriteRawDataBase64( CvFileStorage* fs, const void* src,\n                                 int len, const char* dt );\n\n/** @brief Returns a unique pointer for a given name.\n\nThe function returns a unique pointer for each particular file node name. This pointer can be then\npassed to the cvGetFileNode function that is faster than cvGetFileNodeByName because it compares\ntext strings by comparing pointers rather than the strings' content.\n\nConsider the following example where an array of points is encoded as a sequence of 2-entry maps:\n@code\n    points:\n      - { x: 10, y: 10 }\n      - { x: 20, y: 20 }\n      - { x: 30, y: 30 }\n      # ...\n@endcode\nThen, it is possible to get hashed \"x\" and \"y\" pointers to speed up decoding of the points. :\n@code\n    #include \"cxcore.h\"\n\n    int main( int argc, char** argv )\n    {\n        CvFileStorage* fs = cvOpenFileStorage( \"points.yml\", 0, CV_STORAGE_READ );\n        CvStringHashNode* x_key = cvGetHashedNode( fs, \"x\", -1, 1 );\n        CvStringHashNode* y_key = cvGetHashedNode( fs, \"y\", -1, 1 );\n        CvFileNode* points = cvGetFileNodeByName( fs, 0, \"points\" );\n\n        if( CV_NODE_IS_SEQ(points->tag) )\n        {\n            CvSeq* seq = points->data.seq;\n            int i, total = seq->total;\n            CvSeqReader reader;\n            cvStartReadSeq( seq, &reader, 0 );\n            for( i = 0; i < total; i++ )\n            {\n                CvFileNode* pt = (CvFileNode*)reader.ptr;\n    #if 1 // faster variant\n                CvFileNode* xnode = cvGetFileNode( fs, pt, x_key, 0 );\n                CvFileNode* ynode = cvGetFileNode( fs, pt, y_key, 0 );\n                assert( xnode && CV_NODE_IS_INT(xnode->tag) &&\n                        ynode && CV_NODE_IS_INT(ynode->tag));\n                int x = xnode->data.i; // or x = cvReadInt( xnode, 0 );\n                int y = ynode->data.i; // or y = cvReadInt( ynode, 0 );\n    #elif 1 // slower variant; does not use x_key & y_key\n                CvFileNode* xnode = cvGetFileNodeByName( fs, pt, \"x\" );\n                CvFileNode* ynode = cvGetFileNodeByName( fs, pt, \"y\" );\n                assert( xnode && CV_NODE_IS_INT(xnode->tag) &&\n                        ynode && CV_NODE_IS_INT(ynode->tag));\n                int x = xnode->data.i; // or x = cvReadInt( xnode, 0 );\n                int y = ynode->data.i; // or y = cvReadInt( ynode, 0 );\n    #else // the slowest yet the easiest to use variant\n                int x = cvReadIntByName( fs, pt, \"x\", 0 );\n                int y = cvReadIntByName( fs, pt, \"y\", 0 );\n    #endif\n                CV_NEXT_SEQ_ELEM( seq->elem_size, reader );\n                printf(\"\n            }\n        }\n        cvReleaseFileStorage( &fs );\n        return 0;\n    }\n@endcode\nPlease note that whatever method of accessing a map you are using, it is still much slower than\nusing plain sequences; for example, in the above example, it is more efficient to encode the points\nas pairs of integers in a single numeric sequence.\n@param fs File storage\n@param name Literal node name\n@param len Length of the name (if it is known apriori), or -1 if it needs to be calculated\n@param create_missing Flag that specifies, whether an absent key should be added into the hash table\n*/\nCVAPI(CvStringHashNode*) cvGetHashedKey( CvFileStorage* fs, const char* name,\n                                        int len CV_DEFAULT(-1),\n                                        int create_missing CV_DEFAULT(0));\n\n/** @brief Retrieves one of the top-level nodes of the file storage.\n\nThe function returns one of the top-level file nodes. The top-level nodes do not have a name, they\ncorrespond to the streams that are stored one after another in the file storage. If the index is out\nof range, the function returns a NULL pointer, so all the top-level nodes can be iterated by\nsubsequent calls to the function with stream_index=0,1,..., until the NULL pointer is returned.\nThis function can be used as a base for recursive traversal of the file storage.\n@param fs File storage\n@param stream_index Zero-based index of the stream. See cvStartNextStream . In most cases,\nthere is only one stream in the file; however, there can be several.\n */\nCVAPI(CvFileNode*) cvGetRootFileNode( const CvFileStorage* fs,\n                                     int stream_index CV_DEFAULT(0) );\n\n/** @brief Finds a node in a map or file storage.\n\nThe function finds a file node. It is a faster version of cvGetFileNodeByName (see\ncvGetHashedKey discussion). Also, the function can insert a new node, if it is not in the map yet.\n@param fs File storage\n@param map The parent map. If it is NULL, the function searches a top-level node. If both map and\nkey are NULLs, the function returns the root file node - a map that contains top-level nodes.\n@param key Unique pointer to the node name, retrieved with cvGetHashedKey\n@param create_missing Flag that specifies whether an absent node should be added to the map\n */\nCVAPI(CvFileNode*) cvGetFileNode( CvFileStorage* fs, CvFileNode* map,\n                                 const CvStringHashNode* key,\n                                 int create_missing CV_DEFAULT(0) );\n\n/** @brief Finds a node in a map or file storage.\n\nThe function finds a file node by name. The node is searched either in map or, if the pointer is\nNULL, among the top-level file storage nodes. Using this function for maps and cvGetSeqElem (or\nsequence reader) for sequences, it is possible to navigate through the file storage. To speed up\nmultiple queries for a certain key (e.g., in the case of an array of structures) one may use a\ncombination of cvGetHashedKey and cvGetFileNode.\n@param fs File storage\n@param map The parent map. If it is NULL, the function searches in all the top-level nodes\n(streams), starting with the first one.\n@param name The file node name\n */\nCVAPI(CvFileNode*) cvGetFileNodeByName( const CvFileStorage* fs,\n                                       const CvFileNode* map,\n                                       const char* name );\n\n/** @brief Retrieves an integer value from a file node.\n\nThe function returns an integer that is represented by the file node. If the file node is NULL, the\ndefault_value is returned (thus, it is convenient to call the function right after cvGetFileNode\nwithout checking for a NULL pointer). If the file node has type CV_NODE_INT, then node-\\>data.i is\nreturned. If the file node has type CV_NODE_REAL, then node-\\>data.f is converted to an integer\nand returned. Otherwise the error is reported.\n@param node File node\n@param default_value The value that is returned if node is NULL\n */\nCV_INLINE int cvReadInt( const CvFileNode* node, int default_value CV_DEFAULT(0) )\n{\n    return !node ? default_value :\n        CV_NODE_IS_INT(node->tag) ? node->data.i :\n        CV_NODE_IS_REAL(node->tag) ? cvRound(node->data.f) : 0x7fffffff;\n}\n\n/** @brief Finds a file node and returns its value.\n\nThe function is a simple superposition of cvGetFileNodeByName and cvReadInt.\n@param fs File storage\n@param map The parent map. If it is NULL, the function searches a top-level node.\n@param name The node name\n@param default_value The value that is returned if the file node is not found\n */\nCV_INLINE int cvReadIntByName( const CvFileStorage* fs, const CvFileNode* map,\n                         const char* name, int default_value CV_DEFAULT(0) )\n{\n    return cvReadInt( cvGetFileNodeByName( fs, map, name ), default_value );\n}\n\n/** @brief Retrieves a floating-point value from a file node.\n\nThe function returns a floating-point value that is represented by the file node. If the file node\nis NULL, the default_value is returned (thus, it is convenient to call the function right after\ncvGetFileNode without checking for a NULL pointer). If the file node has type CV_NODE_REAL ,\nthen node-\\>data.f is returned. If the file node has type CV_NODE_INT , then node-:math:\\>data.f\nis converted to floating-point and returned. Otherwise the result is not determined.\n@param node File node\n@param default_value The value that is returned if node is NULL\n */\nCV_INLINE double cvReadReal( const CvFileNode* node, double default_value CV_DEFAULT(0.) )\n{\n    return !node ? default_value :\n        CV_NODE_IS_INT(node->tag) ? (double)node->data.i :\n        CV_NODE_IS_REAL(node->tag) ? node->data.f : 1e300;\n}\n\n/** @brief Finds a file node and returns its value.\n\nThe function is a simple superposition of cvGetFileNodeByName and cvReadReal .\n@param fs File storage\n@param map The parent map. If it is NULL, the function searches a top-level node.\n@param name The node name\n@param default_value The value that is returned if the file node is not found\n */\nCV_INLINE double cvReadRealByName( const CvFileStorage* fs, const CvFileNode* map,\n                        const char* name, double default_value CV_DEFAULT(0.) )\n{\n    return cvReadReal( cvGetFileNodeByName( fs, map, name ), default_value );\n}\n\n/** @brief Retrieves a text string from a file node.\n\nThe function returns a text string that is represented by the file node. If the file node is NULL,\nthe default_value is returned (thus, it is convenient to call the function right after\ncvGetFileNode without checking for a NULL pointer). If the file node has type CV_NODE_STR , then\nnode-:math:\\>data.str.ptr is returned. Otherwise the result is not determined.\n@param node File node\n@param default_value The value that is returned if node is NULL\n */\nCV_INLINE const char* cvReadString( const CvFileNode* node,\n                        const char* default_value CV_DEFAULT(NULL) )\n{\n    return !node ? default_value : CV_NODE_IS_STRING(node->tag) ? node->data.str.ptr : 0;\n}\n\n/** @brief Finds a file node by its name and returns its value.\n\nThe function is a simple superposition of cvGetFileNodeByName and cvReadString .\n@param fs File storage\n@param map The parent map. If it is NULL, the function searches a top-level node.\n@param name The node name\n@param default_value The value that is returned if the file node is not found\n */\nCV_INLINE const char* cvReadStringByName( const CvFileStorage* fs, const CvFileNode* map,\n                        const char* name, const char* default_value CV_DEFAULT(NULL) )\n{\n    return cvReadString( cvGetFileNodeByName( fs, map, name ), default_value );\n}\n\n\n/** @brief Decodes an object and returns a pointer to it.\n\nThe function decodes a user object (creates an object in a native representation from the file\nstorage subtree) and returns it. The object to be decoded must be an instance of a registered type\nthat supports the read method (see CvTypeInfo). The type of the object is determined by the type\nname that is encoded in the file. If the object is a dynamic structure, it is created either in\nmemory storage and passed to cvOpenFileStorage or, if a NULL pointer was passed, in temporary\nmemory storage, which is released when cvReleaseFileStorage is called. Otherwise, if the object is\nnot a dynamic structure, it is created in a heap and should be released with a specialized function\nor by using the generic cvRelease.\n@param fs File storage\n@param node The root object node\n@param attributes Unused parameter\n */\nCVAPI(void*) cvRead( CvFileStorage* fs, CvFileNode* node,\n                        CvAttrList* attributes CV_DEFAULT(NULL));\n\n/** @brief Finds an object by name and decodes it.\n\nThe function is a simple superposition of cvGetFileNodeByName and cvRead.\n@param fs File storage\n@param map The parent map. If it is NULL, the function searches a top-level node.\n@param name The node name\n@param attributes Unused parameter\n */\nCV_INLINE void* cvReadByName( CvFileStorage* fs, const CvFileNode* map,\n                              const char* name, CvAttrList* attributes CV_DEFAULT(NULL) )\n{\n    return cvRead( fs, cvGetFileNodeByName( fs, map, name ), attributes );\n}\n\n\n/** @brief Initializes the file node sequence reader.\n\nThe function initializes the sequence reader to read data from a file node. The initialized reader\ncan be then passed to cvReadRawDataSlice.\n@param fs File storage\n@param src The file node (a sequence) to read numbers from\n@param reader Pointer to the sequence reader\n */\nCVAPI(void) cvStartReadRawData( const CvFileStorage* fs, const CvFileNode* src,\n                               CvSeqReader* reader );\n\n/** @brief Initializes file node sequence reader.\n\nThe function reads one or more elements from the file node, representing a sequence, to a\nuser-specified array. The total number of read sequence elements is a product of total and the\nnumber of components in each array element. For example, if dt=2if, the function will read total\\*3\nsequence elements. As with any sequence, some parts of the file node sequence can be skipped or read\nrepeatedly by repositioning the reader using cvSetSeqReaderPos.\n@param fs File storage\n@param reader The sequence reader. Initialize it with cvStartReadRawData .\n@param count The number of elements to read\n@param dst Pointer to the destination array\n@param dt Specification of each array element. It has the same format as in cvWriteRawData .\n */\nCVAPI(void) cvReadRawDataSlice( const CvFileStorage* fs, CvSeqReader* reader,\n                               int count, void* dst, const char* dt );\n\n/** @brief Reads multiple numbers.\n\nThe function reads elements from a file node that represents a sequence of scalars.\n@param fs File storage\n@param src The file node (a sequence) to read numbers from\n@param dst Pointer to the destination array\n@param dt Specification of each array element. It has the same format as in cvWriteRawData .\n */\nCVAPI(void) cvReadRawData( const CvFileStorage* fs, const CvFileNode* src,\n                          void* dst, const char* dt );\n\n/** @brief Writes a file node to another file storage.\n\nThe function writes a copy of a file node to file storage. Possible applications of the function are\nmerging several file storages into one and conversion between XML, YAML and JSON formats.\n@param fs Destination file storage\n@param new_node_name New name of the file node in the destination file storage. To keep the\nexisting name, use cvcvGetFileNodeName\n@param node The written node\n@param embed If the written node is a collection and this parameter is not zero, no extra level of\nhierarchy is created. Instead, all the elements of node are written into the currently written\nstructure. Of course, map elements can only be embedded into another map, and sequence elements\ncan only be embedded into another sequence.\n */\nCVAPI(void) cvWriteFileNode( CvFileStorage* fs, const char* new_node_name,\n                            const CvFileNode* node, int embed );\n\n/** @brief Returns the name of a file node.\n\nThe function returns the name of a file node or NULL, if the file node does not have a name or if\nnode is NULL.\n@param node File node\n */\nCVAPI(const char*) cvGetFileNodeName( const CvFileNode* node );\n\n/*********************************** Adding own types ***********************************/\n\n/** @brief Registers a new type.\n\nThe function registers a new type, which is described by info . The function creates a copy of the\nstructure, so the user should delete it after calling the function.\n@param info Type info structure\n */\nCVAPI(void) cvRegisterType( const CvTypeInfo* info );\n\n/** @brief Unregisters the type.\n\nThe function unregisters a type with a specified name. If the name is unknown, it is possible to\nlocate the type info by an instance of the type using cvTypeOf or by iterating the type list,\nstarting from cvFirstType, and then calling cvUnregisterType(info-\\>typeName).\n@param type_name Name of an unregistered type\n */\nCVAPI(void) cvUnregisterType( const char* type_name );\n\n/** @brief Returns the beginning of a type list.\n\nThe function returns the first type in the list of registered types. Navigation through the list can\nbe done via the prev and next fields of the CvTypeInfo structure.\n */\nCVAPI(CvTypeInfo*) cvFirstType(void);\n\n/** @brief Finds a type by its name.\n\nThe function finds a registered type by its name. It returns NULL if there is no type with the\nspecified name.\n@param type_name Type name\n */\nCVAPI(CvTypeInfo*) cvFindType( const char* type_name );\n\n/** @brief Returns the type of an object.\n\nThe function finds the type of a given object. It iterates through the list of registered types and\ncalls the is_instance function/method for every type info structure with that object until one of\nthem returns non-zero or until the whole list has been traversed. In the latter case, the function\nreturns NULL.\n@param struct_ptr The object pointer\n */\nCVAPI(CvTypeInfo*) cvTypeOf( const void* struct_ptr );\n\n#endif\n\n/** @brief Releases an object.\n\n The function finds the type of a given object and calls release with the double pointer.\n @param struct_ptr Double pointer to the object\n */\nCVAPI(void) cvRelease( void** struct_ptr );\n\n/** @brief Makes a clone of an object.\n\nThe function finds the type of a given object and calls clone with the passed object. Of course, if\nyou know the object type, for example, struct_ptr is CvMat\\*, it is faster to call the specific\nfunction, like cvCloneMat.\n@param struct_ptr The object to clone\n */\nCVAPI(void*) cvClone( const void* struct_ptr );\n\n/*********************************** Measuring Execution Time ***************************/\n\n/** helper functions for RNG initialization and accurate time measurement:\n   uses internal clock counter on x86 */\nCVAPI(int64)  cvGetTickCount( void );\nCVAPI(double) cvGetTickFrequency( void );\n\n/*********************************** CPU capabilities ***********************************/\n\nCVAPI(int) cvCheckHardwareSupport(int feature);\n\n/*********************************** Multi-Threading ************************************/\n\n/** retrieve/set the number of threads used in OpenMP implementations */\nCVAPI(int)  cvGetNumThreads( void );\nCVAPI(void) cvSetNumThreads( int threads CV_DEFAULT(0) );\n/** get index of the thread being executed */\nCVAPI(int)  cvGetThreadNum( void );\n\n\n/********************************** Error Handling **************************************/\n\n/** Get current OpenCV error status */\nCVAPI(int) cvGetErrStatus( void );\n\n/** Sets error status silently */\nCVAPI(void) cvSetErrStatus( int status );\n\n#define CV_ErrModeLeaf     0   /* Print error and exit program */\n#define CV_ErrModeParent   1   /* Print error and continue */\n#define CV_ErrModeSilent   2   /* Don't print and continue */\n\n/** Retrieves current error processing mode */\nCVAPI(int)  cvGetErrMode( void );\n\n/** Sets error processing mode, returns previously used mode */\nCVAPI(int) cvSetErrMode( int mode );\n\n/** Sets error status and performs some additional actions (displaying message box,\n writing message to stderr, terminating application etc.)\n depending on the current error mode */\nCVAPI(void) cvError( int status, const char* func_name,\n                    const char* err_msg, const char* file_name, int line );\n\n/** Retrieves textual description of the error given its code */\nCVAPI(const char*) cvErrorStr( int status );\n\n/** Retrieves detailed information about the last error occurred */\nCVAPI(int) cvGetErrInfo( const char** errcode_desc, const char** description,\n                        const char** filename, int* line );\n\n/** Maps IPP error codes to the counterparts from OpenCV */\nCVAPI(int) cvErrorFromIppStatus( int ipp_status );\n\ntypedef int (CV_CDECL *CvErrorCallback)( int status, const char* func_name,\n                                        const char* err_msg, const char* file_name, int line, void* userdata );\n\n/** Assigns a new error-handling function */\nCVAPI(CvErrorCallback) cvRedirectError( CvErrorCallback error_handler,\n                                       void* userdata CV_DEFAULT(NULL),\n                                       void** prev_userdata CV_DEFAULT(NULL) );\n\n/** Output nothing */\nCVAPI(int) cvNulDevReport( int status, const char* func_name, const char* err_msg,\n                          const char* file_name, int line, void* userdata );\n\n/** Output to console(fprintf(stderr,...)) */\nCVAPI(int) cvStdErrReport( int status, const char* func_name, const char* err_msg,\n                          const char* file_name, int line, void* userdata );\n\n/** Output to MessageBox(WIN32) */\nCVAPI(int) cvGuiBoxReport( int status, const char* func_name, const char* err_msg,\n                          const char* file_name, int line, void* userdata );\n\n#define OPENCV_ERROR(status,func,context)                           \\\ncvError((status),(func),(context),__FILE__,__LINE__)\n\n#define OPENCV_ASSERT(expr,func,context)                            \\\n{if (! (expr))                                      \\\n{OPENCV_ERROR(CV_StsInternal,(func),(context));}}\n\n#define OPENCV_CALL( Func )                                         \\\n{                                                                   \\\nFunc;                                                           \\\n}\n\n\n/** CV_FUNCNAME macro defines icvFuncName constant which is used by CV_ERROR macro */\n#ifdef CV_NO_FUNC_NAMES\n#define CV_FUNCNAME( Name )\n#define cvFuncName \"\"\n#else\n#define CV_FUNCNAME( Name )  \\\nstatic char cvFuncName[] = Name\n#endif\n\n\n/**\n CV_ERROR macro unconditionally raises error with passed code and message.\n After raising error, control will be transferred to the exit label.\n */\n#define CV_ERROR( Code, Msg )                                       \\\n{                                                                   \\\n    cvError( (Code), cvFuncName, Msg, __FILE__, __LINE__ );        \\\n    __CV_EXIT__;                                                   \\\n}\n\n/**\n CV_CHECK macro checks error status after CV (or IPL)\n function call. If error detected, control will be transferred to the exit\n label.\n */\n#define CV_CHECK()                                                  \\\n{                                                                   \\\n    if( cvGetErrStatus() < 0 )                                      \\\n        CV_ERROR( CV_StsBackTrace, \"Inner function failed.\" );      \\\n}\n\n\n/**\n CV_CALL macro calls CV (or IPL) function, checks error status and\n signals a error if the function failed. Useful in \"parent node\"\n error processing mode\n */\n#define CV_CALL( Func )                                             \\\n{                                                                   \\\n    Func;                                                           \\\n    CV_CHECK();                                                     \\\n}\n\n\n/** Runtime assertion macro */\n#define CV_ASSERT( Condition )                                          \\\n{                                                                       \\\n    if( !(Condition) )                                                  \\\n        CV_ERROR( CV_StsInternal, \"Assertion: \" #Condition \" failed\" ); \\\n}\n\n#define __CV_BEGIN__       {\n#define __CV_END__         goto exit; exit: ; }\n#define __CV_EXIT__        goto exit\n\n/** @} core_c */\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n#ifdef __cplusplus\n\n#include \"opencv2/core/utility.hpp\"\n\nnamespace cv\n{\n\n//! @addtogroup core_c_glue\n//! @{\n\n/////////////////////////////////////////// glue ///////////////////////////////////////////\n\n//! converts array (CvMat or IplImage) to cv::Mat\nCV_EXPORTS Mat cvarrToMat(const CvArr* arr, bool copyData=false,\n                          bool allowND=true, int coiMode=0,\n                          AutoBuffer<double>* buf=0);\n\nstatic inline Mat cvarrToMatND(const CvArr* arr, bool copyData=false, int coiMode=0)\n{\n    return cvarrToMat(arr, copyData, true, coiMode);\n}\n\n\n//! extracts Channel of Interest from CvMat or IplImage and makes cv::Mat out of it.\nCV_EXPORTS void extractImageCOI(const CvArr* arr, OutputArray coiimg, int coi=-1);\n//! inserts single-channel cv::Mat into a multi-channel CvMat or IplImage\nCV_EXPORTS void insertImageCOI(InputArray coiimg, CvArr* arr, int coi=-1);\n\n\n\n////// specialized implementations of DefaultDeleter::operator() for classic OpenCV types //////\n\ntemplate<> struct DefaultDeleter<CvMat>{ CV_EXPORTS void operator ()(CvMat* obj) const; };\ntemplate<> struct DefaultDeleter<IplImage>{ CV_EXPORTS void operator ()(IplImage* obj) const; };\ntemplate<> struct DefaultDeleter<CvMatND>{ CV_EXPORTS void operator ()(CvMatND* obj) const; };\ntemplate<> struct DefaultDeleter<CvSparseMat>{ CV_EXPORTS void operator ()(CvSparseMat* obj) const; };\ntemplate<> struct DefaultDeleter<CvMemStorage>{ CV_EXPORTS void operator ()(CvMemStorage* obj) const; };\n\n////////////// convenient wrappers for operating old-style dynamic structures //////////////\n\ntemplate<typename _Tp> class SeqIterator;\n\ntypedef Ptr<CvMemStorage> MemStorage;\n\n/*!\n Template Sequence Class derived from CvSeq\n\n The class provides more convenient access to sequence elements,\n STL-style operations and iterators.\n\n \\note The class is targeted for simple data types,\n    i.e. no constructors or destructors\n    are called for the sequence elements.\n*/\ntemplate<typename _Tp> class Seq\n{\npublic:\n    typedef SeqIterator<_Tp> iterator;\n    typedef SeqIterator<_Tp> const_iterator;\n\n    //! the default constructor\n    Seq();\n    //! the constructor for wrapping CvSeq structure. The real element type in CvSeq should match _Tp.\n    Seq(const CvSeq* seq);\n    //! creates the empty sequence that resides in the specified storage\n    Seq(MemStorage& storage, int headerSize = sizeof(CvSeq));\n    //! returns read-write reference to the specified element\n    _Tp& operator [](int idx);\n    //! returns read-only reference to the specified element\n    const _Tp& operator[](int idx) const;\n    //! returns iterator pointing to the beginning of the sequence\n    SeqIterator<_Tp> begin() const;\n    //! returns iterator pointing to the element following the last sequence element\n    SeqIterator<_Tp> end() const;\n    //! returns the number of elements in the sequence\n    size_t size() const;\n    //! returns the type of sequence elements (CV_8UC1 ... CV_64FC(CV_CN_MAX) ...)\n    int type() const;\n    //! returns the depth of sequence elements (CV_8U ... CV_64F)\n    int depth() const;\n    //! returns the number of channels in each sequence element\n    int channels() const;\n    //! returns the size of each sequence element\n    size_t elemSize() const;\n    //! returns index of the specified sequence element\n    size_t index(const _Tp& elem) const;\n    //! appends the specified element to the end of the sequence\n    void push_back(const _Tp& elem);\n    //! appends the specified element to the front of the sequence\n    void push_front(const _Tp& elem);\n    //! appends zero or more elements to the end of the sequence\n    void push_back(const _Tp* elems, size_t count);\n    //! appends zero or more elements to the front of the sequence\n    void push_front(const _Tp* elems, size_t count);\n    //! inserts the specified element to the specified position\n    void insert(int idx, const _Tp& elem);\n    //! inserts zero or more elements to the specified position\n    void insert(int idx, const _Tp* elems, size_t count);\n    //! removes element at the specified position\n    void remove(int idx);\n    //! removes the specified subsequence\n    void remove(const Range& r);\n\n    //! returns reference to the first sequence element\n    _Tp& front();\n    //! returns read-only reference to the first sequence element\n    const _Tp& front() const;\n    //! returns reference to the last sequence element\n    _Tp& back();\n    //! returns read-only reference to the last sequence element\n    const _Tp& back() const;\n    //! returns true iff the sequence contains no elements\n    bool empty() const;\n\n    //! removes all the elements from the sequence\n    void clear();\n    //! removes the first element from the sequence\n    void pop_front();\n    //! removes the last element from the sequence\n    void pop_back();\n    //! removes zero or more elements from the beginning of the sequence\n    void pop_front(_Tp* elems, size_t count);\n    //! removes zero or more elements from the end of the sequence\n    void pop_back(_Tp* elems, size_t count);\n\n    //! copies the whole sequence or the sequence slice to the specified vector\n    void copyTo(std::vector<_Tp>& vec, const Range& range=Range::all()) const;\n    //! returns the vector containing all the sequence elements\n    operator std::vector<_Tp>() const;\n\n    CvSeq* seq;\n};\n\n\n/*!\n STL-style Sequence Iterator inherited from the CvSeqReader structure\n*/\ntemplate<typename _Tp> class SeqIterator : public CvSeqReader\n{\npublic:\n    //! the default constructor\n    SeqIterator();\n    //! the constructor setting the iterator to the beginning or to the end of the sequence\n    SeqIterator(const Seq<_Tp>& seq, bool seekEnd=false);\n    //! positions the iterator within the sequence\n    void seek(size_t pos);\n    //! reports the current iterator position\n    size_t tell() const;\n    //! returns reference to the current sequence element\n    _Tp& operator *();\n    //! returns read-only reference to the current sequence element\n    const _Tp& operator *() const;\n    //! moves iterator to the next sequence element\n    SeqIterator& operator ++();\n    //! moves iterator to the next sequence element\n    SeqIterator operator ++(int) const;\n    //! moves iterator to the previous sequence element\n    SeqIterator& operator --();\n    //! moves iterator to the previous sequence element\n    SeqIterator operator --(int) const;\n\n    //! moves iterator forward by the specified offset (possibly negative)\n    SeqIterator& operator +=(int);\n    //! moves iterator backward by the specified offset (possibly negative)\n    SeqIterator& operator -=(int);\n\n    // this is index of the current element module seq->total*2\n    // (to distinguish between 0 and seq->total)\n    int index;\n};\n\n\n\n// bridge C++ => C Seq API\nCV_EXPORTS schar*  seqPush( CvSeq* seq, const void* element=0);\nCV_EXPORTS schar*  seqPushFront( CvSeq* seq, const void* element=0);\nCV_EXPORTS void  seqPop( CvSeq* seq, void* element=0);\nCV_EXPORTS void  seqPopFront( CvSeq* seq, void* element=0);\nCV_EXPORTS void  seqPopMulti( CvSeq* seq, void* elements,\n                              int count, int in_front=0 );\nCV_EXPORTS void  seqRemove( CvSeq* seq, int index );\nCV_EXPORTS void  clearSeq( CvSeq* seq );\nCV_EXPORTS schar*  getSeqElem( const CvSeq* seq, int index );\nCV_EXPORTS void  seqRemoveSlice( CvSeq* seq, CvSlice slice );\nCV_EXPORTS void  seqInsertSlice( CvSeq* seq, int before_index, const CvArr* from_arr );\n\ntemplate<typename _Tp> inline Seq<_Tp>::Seq() : seq(0) {}\ntemplate<typename _Tp> inline Seq<_Tp>::Seq( const CvSeq* _seq ) : seq((CvSeq*)_seq)\n{\n    CV_Assert(!_seq || _seq->elem_size == sizeof(_Tp));\n}\n\ntemplate<typename _Tp> inline Seq<_Tp>::Seq( MemStorage& storage,\n                                             int headerSize )\n{\n    CV_Assert(headerSize >= (int)sizeof(CvSeq));\n    seq = cvCreateSeq(DataType<_Tp>::type, headerSize, sizeof(_Tp), storage);\n}\n\ntemplate<typename _Tp> inline _Tp& Seq<_Tp>::operator [](int idx)\n{ return *(_Tp*)getSeqElem(seq, idx); }\n\ntemplate<typename _Tp> inline const _Tp& Seq<_Tp>::operator [](int idx) const\n{ return *(_Tp*)getSeqElem(seq, idx); }\n\ntemplate<typename _Tp> inline SeqIterator<_Tp> Seq<_Tp>::begin() const\n{ return SeqIterator<_Tp>(*this); }\n\ntemplate<typename _Tp> inline SeqIterator<_Tp> Seq<_Tp>::end() const\n{ return SeqIterator<_Tp>(*this, true); }\n\ntemplate<typename _Tp> inline size_t Seq<_Tp>::size() const\n{ return seq ? seq->total : 0; }\n\ntemplate<typename _Tp> inline int Seq<_Tp>::type() const\n{ return seq ? CV_MAT_TYPE(seq->flags) : 0; }\n\ntemplate<typename _Tp> inline int Seq<_Tp>::depth() const\n{ return seq ? CV_MAT_DEPTH(seq->flags) : 0; }\n\ntemplate<typename _Tp> inline int Seq<_Tp>::channels() const\n{ return seq ? CV_MAT_CN(seq->flags) : 0; }\n\ntemplate<typename _Tp> inline size_t Seq<_Tp>::elemSize() const\n{ return seq ? seq->elem_size : 0; }\n\ntemplate<typename _Tp> inline size_t Seq<_Tp>::index(const _Tp& elem) const\n{ return cvSeqElemIdx(seq, &elem); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::push_back(const _Tp& elem)\n{ cvSeqPush(seq, &elem); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::push_front(const _Tp& elem)\n{ cvSeqPushFront(seq, &elem); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::push_back(const _Tp* elem, size_t count)\n{ cvSeqPushMulti(seq, elem, (int)count, 0); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::push_front(const _Tp* elem, size_t count)\n{ cvSeqPushMulti(seq, elem, (int)count, 1); }\n\ntemplate<typename _Tp> inline _Tp& Seq<_Tp>::back()\n{ return *(_Tp*)getSeqElem(seq, -1); }\n\ntemplate<typename _Tp> inline const _Tp& Seq<_Tp>::back() const\n{ return *(const _Tp*)getSeqElem(seq, -1); }\n\ntemplate<typename _Tp> inline _Tp& Seq<_Tp>::front()\n{ return *(_Tp*)getSeqElem(seq, 0); }\n\ntemplate<typename _Tp> inline const _Tp& Seq<_Tp>::front() const\n{ return *(const _Tp*)getSeqElem(seq, 0); }\n\ntemplate<typename _Tp> inline bool Seq<_Tp>::empty() const\n{ return !seq || seq->total == 0; }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::clear()\n{ if(seq) clearSeq(seq); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::pop_back()\n{ seqPop(seq); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::pop_front()\n{ seqPopFront(seq); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::pop_back(_Tp* elem, size_t count)\n{ seqPopMulti(seq, elem, (int)count, 0); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::pop_front(_Tp* elem, size_t count)\n{ seqPopMulti(seq, elem, (int)count, 1); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::insert(int idx, const _Tp& elem)\n{ seqInsert(seq, idx, &elem); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::insert(int idx, const _Tp* elems, size_t count)\n{\n    CvMat m = cvMat(1, count, DataType<_Tp>::type, elems);\n    seqInsertSlice(seq, idx, &m);\n}\n\ntemplate<typename _Tp> inline void Seq<_Tp>::remove(int idx)\n{ seqRemove(seq, idx); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::remove(const Range& r)\n{ seqRemoveSlice(seq, cvSlice(r.start, r.end)); }\n\ntemplate<typename _Tp> inline void Seq<_Tp>::copyTo(std::vector<_Tp>& vec, const Range& range) const\n{\n    size_t len = !seq ? 0 : range == Range::all() ? seq->total : range.end - range.start;\n    vec.resize(len);\n    if( seq && len )\n        cvCvtSeqToArray(seq, &vec[0], cvSlice(range));\n}\n\ntemplate<typename _Tp> inline Seq<_Tp>::operator std::vector<_Tp>() const\n{\n    std::vector<_Tp> vec;\n    copyTo(vec);\n    return vec;\n}\n\ntemplate<typename _Tp> inline SeqIterator<_Tp>::SeqIterator()\n{ memset(this, 0, sizeof(*this)); }\n\ntemplate<typename _Tp> inline SeqIterator<_Tp>::SeqIterator(const Seq<_Tp>& _seq, bool seekEnd)\n{\n    cvStartReadSeq(_seq.seq, this);\n    index = seekEnd ? _seq.seq->total : 0;\n}\n\ntemplate<typename _Tp> inline void SeqIterator<_Tp>::seek(size_t pos)\n{\n    cvSetSeqReaderPos(this, (int)pos, false);\n    index = pos;\n}\n\ntemplate<typename _Tp> inline size_t SeqIterator<_Tp>::tell() const\n{ return index; }\n\ntemplate<typename _Tp> inline _Tp& SeqIterator<_Tp>::operator *()\n{ return *(_Tp*)ptr; }\n\ntemplate<typename _Tp> inline const _Tp& SeqIterator<_Tp>::operator *() const\n{ return *(const _Tp*)ptr; }\n\ntemplate<typename _Tp> inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator ++()\n{\n    CV_NEXT_SEQ_ELEM(sizeof(_Tp), *this);\n    if( ++index >= seq->total*2 )\n        index = 0;\n    return *this;\n}\n\ntemplate<typename _Tp> inline SeqIterator<_Tp> SeqIterator<_Tp>::operator ++(int) const\n{\n    SeqIterator<_Tp> it = *this;\n    ++*this;\n    return it;\n}\n\ntemplate<typename _Tp> inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator --()\n{\n    CV_PREV_SEQ_ELEM(sizeof(_Tp), *this);\n    if( --index < 0 )\n        index = seq->total*2-1;\n    return *this;\n}\n\ntemplate<typename _Tp> inline SeqIterator<_Tp> SeqIterator<_Tp>::operator --(int) const\n{\n    SeqIterator<_Tp> it = *this;\n    --*this;\n    return it;\n}\n\ntemplate<typename _Tp> inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator +=(int delta)\n{\n    cvSetSeqReaderPos(this, delta, 1);\n    index += delta;\n    int n = seq->total*2;\n    if( index < 0 )\n        index += n;\n    if( index >= n )\n        index -= n;\n    return *this;\n}\n\ntemplate<typename _Tp> inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator -=(int delta)\n{\n    return (*this += -delta);\n}\n\ntemplate<typename _Tp> inline ptrdiff_t operator - (const SeqIterator<_Tp>& a,\n                                                    const SeqIterator<_Tp>& b)\n{\n    ptrdiff_t delta = a.index - b.index, n = a.seq->total;\n    if( delta > n || delta < -n )\n        delta += delta < 0 ? n : -n;\n    return delta;\n}\n\ntemplate<typename _Tp> inline bool operator == (const SeqIterator<_Tp>& a,\n                                                const SeqIterator<_Tp>& b)\n{\n    return a.seq == b.seq && a.index == b.index;\n}\n\ntemplate<typename _Tp> inline bool operator != (const SeqIterator<_Tp>& a,\n                                                const SeqIterator<_Tp>& b)\n{\n    return !(a == b);\n}\n\n//! @}\n\n} // cv\n\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/block.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_DEVICE_BLOCK_HPP\n#define OPENCV_CUDA_DEVICE_BLOCK_HPP\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    struct Block\n    {\n        static __device__ __forceinline__ unsigned int id()\n        {\n            return blockIdx.x;\n        }\n\n        static __device__ __forceinline__ unsigned int stride()\n        {\n            return blockDim.x * blockDim.y * blockDim.z;\n        }\n\n        static __device__ __forceinline__ void sync()\n        {\n            __syncthreads();\n        }\n\n        static __device__ __forceinline__ int flattenedThreadId()\n        {\n            return threadIdx.z * blockDim.x * blockDim.y + threadIdx.y * blockDim.x + threadIdx.x;\n        }\n\n        template<typename It, typename T>\n        static __device__ __forceinline__ void fill(It beg, It end, const T& value)\n        {\n            int STRIDE = stride();\n            It t = beg + flattenedThreadId();\n\n            for(; t < end; t += STRIDE)\n                *t = value;\n        }\n\n        template<typename OutIt, typename T>\n        static __device__ __forceinline__ void yota(OutIt beg, OutIt end, T value)\n        {\n            int STRIDE = stride();\n            int tid = flattenedThreadId();\n            value += tid;\n\n            for(OutIt t = beg + tid; t < end; t += STRIDE, value += STRIDE)\n                *t = value;\n        }\n\n        template<typename InIt, typename OutIt>\n        static __device__ __forceinline__ void copy(InIt beg, InIt end, OutIt out)\n        {\n            int STRIDE = stride();\n            InIt  t = beg + flattenedThreadId();\n            OutIt o = out + (t - beg);\n\n            for(; t < end; t += STRIDE, o += STRIDE)\n                *o = *t;\n        }\n\n        template<typename InIt, typename OutIt, class UnOp>\n        static __device__ __forceinline__ void transform(InIt beg, InIt end, OutIt out, UnOp op)\n        {\n            int STRIDE = stride();\n            InIt  t = beg + flattenedThreadId();\n            OutIt o = out + (t - beg);\n\n            for(; t < end; t += STRIDE, o += STRIDE)\n                *o = op(*t);\n        }\n\n        template<typename InIt1, typename InIt2, typename OutIt, class BinOp>\n        static __device__ __forceinline__ void transform(InIt1 beg1, InIt1 end1, InIt2 beg2, OutIt out, BinOp op)\n        {\n            int STRIDE = stride();\n            InIt1 t1 = beg1 + flattenedThreadId();\n            InIt2 t2 = beg2 + flattenedThreadId();\n            OutIt o  = out + (t1 - beg1);\n\n            for(; t1 < end1; t1 += STRIDE, t2 += STRIDE, o += STRIDE)\n                *o = op(*t1, *t2);\n        }\n\n        template<int CTA_SIZE, typename T, class BinOp>\n        static __device__ __forceinline__ void reduce(volatile T* buffer, BinOp op)\n        {\n            int tid = flattenedThreadId();\n            T val =  buffer[tid];\n\n            if (CTA_SIZE >= 1024) { if (tid < 512) buffer[tid] = val = op(val, buffer[tid + 512]); __syncthreads(); }\n            if (CTA_SIZE >=  512) { if (tid < 256) buffer[tid] = val = op(val, buffer[tid + 256]); __syncthreads(); }\n            if (CTA_SIZE >=  256) { if (tid < 128) buffer[tid] = val = op(val, buffer[tid + 128]); __syncthreads(); }\n            if (CTA_SIZE >=  128) { if (tid <  64) buffer[tid] = val = op(val, buffer[tid +  64]); __syncthreads(); }\n\n            if (tid < 32)\n            {\n                if (CTA_SIZE >=   64) { buffer[tid] = val = op(val, buffer[tid +  32]); }\n                if (CTA_SIZE >=   32) { buffer[tid] = val = op(val, buffer[tid +  16]); }\n                if (CTA_SIZE >=   16) { buffer[tid] = val = op(val, buffer[tid +   8]); }\n                if (CTA_SIZE >=    8) { buffer[tid] = val = op(val, buffer[tid +   4]); }\n                if (CTA_SIZE >=    4) { buffer[tid] = val = op(val, buffer[tid +   2]); }\n                if (CTA_SIZE >=    2) { buffer[tid] = val = op(val, buffer[tid +   1]); }\n            }\n        }\n\n        template<int CTA_SIZE, typename T, class BinOp>\n        static __device__ __forceinline__ T reduce(volatile T* buffer, T init, BinOp op)\n        {\n            int tid = flattenedThreadId();\n            T val =  buffer[tid] = init;\n            __syncthreads();\n\n            if (CTA_SIZE >= 1024) { if (tid < 512) buffer[tid] = val = op(val, buffer[tid + 512]); __syncthreads(); }\n            if (CTA_SIZE >=  512) { if (tid < 256) buffer[tid] = val = op(val, buffer[tid + 256]); __syncthreads(); }\n            if (CTA_SIZE >=  256) { if (tid < 128) buffer[tid] = val = op(val, buffer[tid + 128]); __syncthreads(); }\n            if (CTA_SIZE >=  128) { if (tid <  64) buffer[tid] = val = op(val, buffer[tid +  64]); __syncthreads(); }\n\n            if (tid < 32)\n            {\n                if (CTA_SIZE >=   64) { buffer[tid] = val = op(val, buffer[tid +  32]); }\n                if (CTA_SIZE >=   32) { buffer[tid] = val = op(val, buffer[tid +  16]); }\n                if (CTA_SIZE >=   16) { buffer[tid] = val = op(val, buffer[tid +   8]); }\n                if (CTA_SIZE >=    8) { buffer[tid] = val = op(val, buffer[tid +   4]); }\n                if (CTA_SIZE >=    4) { buffer[tid] = val = op(val, buffer[tid +   2]); }\n                if (CTA_SIZE >=    2) { buffer[tid] = val = op(val, buffer[tid +   1]); }\n            }\n            __syncthreads();\n            return buffer[0];\n        }\n\n        template <typename T, class BinOp>\n        static __device__ __forceinline__ void reduce_n(T* data, unsigned int n, BinOp op)\n        {\n            int ftid = flattenedThreadId();\n            int sft = stride();\n\n            if (sft < n)\n            {\n                for (unsigned int i = sft + ftid; i < n; i += sft)\n                    data[ftid] = op(data[ftid], data[i]);\n\n                __syncthreads();\n\n                n = sft;\n            }\n\n            while (n > 1)\n            {\n                unsigned int half = n/2;\n\n                if (ftid < half)\n                    data[ftid] = op(data[ftid], data[n - ftid - 1]);\n\n                __syncthreads();\n\n                n = n - half;\n            }\n        }\n    };\n}}}\n\n//! @endcond\n\n#endif /* OPENCV_CUDA_DEVICE_BLOCK_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/border_interpolate.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_BORDER_INTERPOLATE_HPP\n#define OPENCV_CUDA_BORDER_INTERPOLATE_HPP\n\n#include \"saturate_cast.hpp\"\n#include \"vec_traits.hpp\"\n#include \"vec_math.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    //////////////////////////////////////////////////////////////\n    // BrdConstant\n\n    template <typename D> struct BrdRowConstant\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowConstant(int width_, const D& val_ = VecTraits<D>::all(0)) : width(width_), val(val_) {}\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return x >= 0 ? saturate_cast<D>(data[x]) : val;\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return x < width ? saturate_cast<D>(data[x]) : val;\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return (x >= 0 && x < width) ? saturate_cast<D>(data[x]) : val;\n        }\n\n        int width;\n        D val;\n    };\n\n    template <typename D> struct BrdColConstant\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColConstant(int height_, const D& val_ = VecTraits<D>::all(0)) : height(height_), val(val_) {}\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return y >= 0 ? saturate_cast<D>(*(const T*)((const char*)data + y * step)) : val;\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return y < height ? saturate_cast<D>(*(const T*)((const char*)data + y * step)) : val;\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return (y >= 0 && y < height) ? saturate_cast<D>(*(const T*)((const char*)data + y * step)) : val;\n        }\n\n        int height;\n        D val;\n    };\n\n    template <typename D> struct BrdConstant\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdConstant(int height_, int width_, const D& val_ = VecTraits<D>::all(0)) : height(height_), width(width_), val(val_)\n        {\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast<D>(((const T*)((const uchar*)data + y * step))[x]) : val;\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast<D>(src(y, x)) : val;\n        }\n\n        int height;\n        int width;\n        D val;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BrdReplicate\n\n    template <typename D> struct BrdRowReplicate\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowReplicate(int width) : last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdRowReplicate(int width, U) : last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return ::max(x, 0);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::min(x, last_col);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_low(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_high(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col(x)]);\n        }\n\n        int last_col;\n    };\n\n    template <typename D> struct BrdColReplicate\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColReplicate(int height) : last_row(height - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdColReplicate(int height, U) : last_row(height - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return ::max(y, 0);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::min(y, last_row);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const T*)((const char*)data + idx_row_low(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const T*)((const char*)data + idx_row_high(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const T*)((const char*)data + idx_row(y) * step));\n        }\n\n        int last_row;\n    };\n\n    template <typename D> struct BrdReplicate\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdReplicate(int height, int width) : last_row(height - 1), last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdReplicate(int height, int width, U) : last_row(height - 1), last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return ::max(y, 0);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::min(y, last_row);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return ::max(x, 0);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::min(x, last_col);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return saturate_cast<D>(src(idx_row(y), idx_col(x)));\n        }\n\n        int last_row;\n        int last_col;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BrdReflect101\n\n    template <typename D> struct BrdRowReflect101\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowReflect101(int width) : last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdRowReflect101(int width, U) : last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return ::abs(x) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::abs(last_col - ::abs(last_col - x)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_low(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_high(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col(x)]);\n        }\n\n        int last_col;\n    };\n\n    template <typename D> struct BrdColReflect101\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColReflect101(int height) : last_row(height - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdColReflect101(int height, U) : last_row(height - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return ::abs(y) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::abs(last_row - ::abs(last_row - y)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_low(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_high(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row(y) * step));\n        }\n\n        int last_row;\n    };\n\n    template <typename D> struct BrdReflect101\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdReflect101(int height, int width) : last_row(height - 1), last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdReflect101(int height, int width, U) : last_row(height - 1), last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return ::abs(y) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::abs(last_row - ::abs(last_row - y)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return ::abs(x) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::abs(last_col - ::abs(last_col - x)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return saturate_cast<D>(src(idx_row(y), idx_col(x)));\n        }\n\n        int last_row;\n        int last_col;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BrdReflect\n\n    template <typename D> struct BrdRowReflect\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowReflect(int width) : last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdRowReflect(int width, U) : last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return (::abs(x) - (x < 0)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return ::abs(last_col - ::abs(last_col - x) + (x > last_col)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_high(::abs(x) - (x < 0));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_low(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_high(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col(x)]);\n        }\n\n        int last_col;\n    };\n\n    template <typename D> struct BrdColReflect\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColReflect(int height) : last_row(height - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdColReflect(int height, U) : last_row(height - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return (::abs(y) - (y < 0)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return ::abs(last_row - ::abs(last_row - y) + (y > last_row)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_high(::abs(y) - (y < 0));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_low(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_high(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row(y) * step));\n        }\n\n        int last_row;\n    };\n\n    template <typename D> struct BrdReflect\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdReflect(int height, int width) : last_row(height - 1), last_col(width - 1) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdReflect(int height, int width, U) : last_row(height - 1), last_col(width - 1) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return (::abs(y) - (y < 0)) % (last_row + 1);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return /*::abs*/(last_row - ::abs(last_row - y) + (y > last_row)) /*% (last_row + 1)*/;\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_low(idx_row_high(y));\n        }\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return (::abs(x) - (x < 0)) % (last_col + 1);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return (last_col - ::abs(last_col - x) + (x > last_col));\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_low(idx_col_high(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return saturate_cast<D>(src(idx_row(y), idx_col(x)));\n        }\n\n        int last_row;\n        int last_col;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BrdWrap\n\n    template <typename D> struct BrdRowWrap\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdRowWrap(int width_) : width(width_) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdRowWrap(int width_, U) : width(width_) {}\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return (x >= 0) * x + (x < 0) * (x - ((x - width + 1) / width) * width);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return (x < width) * x + (x >= width) * (x % width);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_high(idx_col_low(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_low(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col_high(x)]);\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int x, const T* data) const\n        {\n            return saturate_cast<D>(data[idx_col(x)]);\n        }\n\n        int width;\n    };\n\n    template <typename D> struct BrdColWrap\n    {\n        typedef D result_type;\n\n        explicit __host__ __device__ __forceinline__ BrdColWrap(int height_) : height(height_) {}\n        template <typename U> __host__ __device__ __forceinline__ BrdColWrap(int height_, U) : height(height_) {}\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return (y >= 0) * y + (y < 0) * (y - ((y - height + 1) / height) * height);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return (y < height) * y + (y >= height) * (y % height);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_high(idx_row_low(y));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_low(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_low(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at_high(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row_high(y) * step));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(*(const D*)((const char*)data + idx_row(y) * step));\n        }\n\n        int height;\n    };\n\n    template <typename D> struct BrdWrap\n    {\n        typedef D result_type;\n\n        __host__ __device__ __forceinline__ BrdWrap(int height_, int width_) :\n            height(height_), width(width_)\n        {\n        }\n        template <typename U>\n        __host__ __device__ __forceinline__ BrdWrap(int height_, int width_, U) :\n            height(height_), width(width_)\n        {\n        }\n\n        __device__ __forceinline__ int idx_row_low(int y) const\n        {\n            return (y >= 0) ? y : (y - ((y - height + 1) / height) * height);\n        }\n\n        __device__ __forceinline__ int idx_row_high(int y) const\n        {\n            return (y < height) ? y : (y % height);\n        }\n\n        __device__ __forceinline__ int idx_row(int y) const\n        {\n            return idx_row_high(idx_row_low(y));\n        }\n\n        __device__ __forceinline__ int idx_col_low(int x) const\n        {\n            return (x >= 0) ? x : (x - ((x - width + 1) / width) * width);\n        }\n\n        __device__ __forceinline__ int idx_col_high(int x) const\n        {\n            return (x < width) ? x : (x % width);\n        }\n\n        __device__ __forceinline__ int idx_col(int x) const\n        {\n            return idx_col_high(idx_col_low(x));\n        }\n\n        template <typename T> __device__ __forceinline__ D at(int y, int x, const T* data, size_t step) const\n        {\n            return saturate_cast<D>(((const T*)((const char*)data + idx_row(y) * step))[idx_col(x)]);\n        }\n\n        template <typename Ptr2D> __device__ __forceinline__ D at(typename Ptr2D::index_type y, typename Ptr2D::index_type x, const Ptr2D& src) const\n        {\n            return saturate_cast<D>(src(idx_row(y), idx_col(x)));\n        }\n\n        int height;\n        int width;\n    };\n\n    //////////////////////////////////////////////////////////////\n    // BorderReader\n\n    template <typename Ptr2D, typename B> struct BorderReader\n    {\n        typedef typename B::result_type elem_type;\n        typedef typename Ptr2D::index_type index_type;\n\n        __host__ __device__ __forceinline__ BorderReader(const Ptr2D& ptr_, const B& b_) : ptr(ptr_), b(b_) {}\n\n        __device__ __forceinline__ elem_type operator ()(index_type y, index_type x) const\n        {\n            return b.at(y, x, ptr);\n        }\n\n        Ptr2D ptr;\n        B b;\n    };\n\n    // under win32 there is some bug with templated types that passed as kernel parameters\n    // with this specialization all works fine\n    template <typename Ptr2D, typename D> struct BorderReader< Ptr2D, BrdConstant<D> >\n    {\n        typedef typename BrdConstant<D>::result_type elem_type;\n        typedef typename Ptr2D::index_type index_type;\n\n        __host__ __device__ __forceinline__ BorderReader(const Ptr2D& src_, const BrdConstant<D>& b) :\n            src(src_), height(b.height), width(b.width), val(b.val)\n        {\n        }\n\n        __device__ __forceinline__ D operator ()(index_type y, index_type x) const\n        {\n            return (x >= 0 && x < width && y >= 0 && y < height) ? saturate_cast<D>(src(y, x)) : val;\n        }\n\n        Ptr2D src;\n        int height;\n        int width;\n        D val;\n    };\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_BORDER_INTERPOLATE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/color.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_COLOR_HPP\n#define OPENCV_CUDA_COLOR_HPP\n\n#include \"detail/color_detail.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    // All OPENCV_CUDA_IMPLEMENT_*_TRAITS(ColorSpace1_to_ColorSpace2, ...) macros implements\n    // template <typename T> class ColorSpace1_to_ColorSpace2_traits\n    // {\n    //     typedef ... functor_type;\n    //     static __host__ __device__ functor_type create_functor();\n    // };\n\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB_TRAITS(bgr_to_rgb, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB_TRAITS(bgr_to_bgra, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB_TRAITS(bgr_to_rgba, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB_TRAITS(bgra_to_bgr, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB_TRAITS(bgra_to_rgb, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB_TRAITS(bgra_to_rgba, 4, 4, 2)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2RGB_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS(bgr_to_bgr555, 3, 0, 5)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS(bgr_to_bgr565, 3, 0, 6)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS(rgb_to_bgr555, 3, 2, 5)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS(rgb_to_bgr565, 3, 2, 6)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS(bgra_to_bgr555, 4, 0, 5)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS(bgra_to_bgr565, 4, 0, 6)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS(rgba_to_bgr555, 4, 2, 5)\n    OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS(rgba_to_bgr565, 4, 2, 6)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS(bgr555_to_rgb, 3, 2, 5)\n    OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS(bgr565_to_rgb, 3, 2, 6)\n    OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS(bgr555_to_bgr, 3, 0, 5)\n    OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS(bgr565_to_bgr, 3, 0, 6)\n    OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS(bgr555_to_rgba, 4, 2, 5)\n    OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS(bgr565_to_rgba, 4, 2, 6)\n    OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS(bgr555_to_bgra, 4, 0, 5)\n    OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS(bgr565_to_bgra, 4, 0, 6)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_GRAY2RGB_TRAITS(gray_to_bgr, 3)\n    OPENCV_CUDA_IMPLEMENT_GRAY2RGB_TRAITS(gray_to_bgra, 4)\n\n    #undef OPENCV_CUDA_IMPLEMENT_GRAY2RGB_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_GRAY2RGB5x5_TRAITS(gray_to_bgr555, 5)\n    OPENCV_CUDA_IMPLEMENT_GRAY2RGB5x5_TRAITS(gray_to_bgr565, 6)\n\n    #undef OPENCV_CUDA_IMPLEMENT_GRAY2RGB5x5_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB5x52GRAY_TRAITS(bgr555_to_gray, 5)\n    OPENCV_CUDA_IMPLEMENT_RGB5x52GRAY_TRAITS(bgr565_to_gray, 6)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB5x52GRAY_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB2GRAY_TRAITS(rgb_to_gray, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2GRAY_TRAITS(bgr_to_gray, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2GRAY_TRAITS(rgba_to_gray, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2GRAY_TRAITS(bgra_to_gray, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2GRAY_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS(rgb_to_yuv, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS(rgba_to_yuv, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS(rgb_to_yuv4, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS(rgba_to_yuv4, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS(bgr_to_yuv, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS(bgra_to_yuv, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS(bgr_to_yuv4, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS(bgra_to_yuv4, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_rgb, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_rgba, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_rgb, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_rgba, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_bgr, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_bgra, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_bgr, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS(rgb_to_YCrCb, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS(rgba_to_YCrCb, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS(rgb_to_YCrCb4, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS(rgba_to_YCrCb4, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS(bgr_to_YCrCb, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS(bgra_to_YCrCb, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS(bgr_to_YCrCb4, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS(bgra_to_YCrCb4, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb_to_rgb, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb_to_rgba, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb4_to_rgb, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb4_to_rgba, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb_to_bgr, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb_to_bgra, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb4_to_bgr, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS(YCrCb4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS(rgb_to_xyz, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS(rgba_to_xyz, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS(rgb_to_xyz4, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS(rgba_to_xyz4, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS(bgr_to_xyz, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS(bgra_to_xyz, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS(bgr_to_xyz4, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS(bgra_to_xyz4, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS(xyz_to_rgb, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS(xyz4_to_rgb, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS(xyz_to_rgba, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS(xyz4_to_rgba, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS(xyz_to_bgr, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS(xyz4_to_bgr, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS(xyz_to_bgra, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS(xyz4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS(rgb_to_hsv, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS(rgba_to_hsv, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS(rgb_to_hsv4, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS(rgba_to_hsv4, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS(bgr_to_hsv, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS(bgra_to_hsv, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS(bgr_to_hsv4, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS(bgra_to_hsv4, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS(hsv_to_rgb, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS(hsv_to_rgba, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS(hsv4_to_rgb, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS(hsv4_to_rgba, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS(hsv_to_bgr, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS(hsv_to_bgra, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS(hsv4_to_bgr, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS(hsv4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS(rgb_to_hls, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS(rgba_to_hls, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS(rgb_to_hls4, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS(rgba_to_hls4, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS(bgr_to_hls, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS(bgra_to_hls, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS(bgr_to_hls4, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS(bgra_to_hls4, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS(hls_to_rgb, 3, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS(hls_to_rgba, 3, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS(hls4_to_rgb, 4, 3, 2)\n    OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS(hls4_to_rgba, 4, 4, 2)\n    OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS(hls_to_bgr, 3, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS(hls_to_bgra, 3, 4, 0)\n    OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS(hls4_to_bgr, 4, 3, 0)\n    OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS(hls4_to_bgra, 4, 4, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(rgb_to_lab, 3, 3, true, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(rgba_to_lab, 4, 3, true, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(rgb_to_lab4, 3, 4, true, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(rgba_to_lab4, 4, 4, true, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(bgr_to_lab, 3, 3, true, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(bgra_to_lab, 4, 3, true, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(bgr_to_lab4, 3, 4, true, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(bgra_to_lab4, 4, 4, true, 0)\n\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(lrgb_to_lab, 3, 3, false, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(lrgba_to_lab, 4, 3, false, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(lrgb_to_lab4, 3, 4, false, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(lrgba_to_lab4, 4, 4, false, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(lbgr_to_lab, 3, 3, false, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(lbgra_to_lab, 4, 3, false, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(lbgr_to_lab4, 3, 4, false, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(lbgra_to_lab4, 4, 4, false, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab_to_rgb, 3, 3, true, 2)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_rgb, 4, 3, true, 2)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab_to_rgba, 3, 4, true, 2)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_rgba, 4, 4, true, 2)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab_to_bgr, 3, 3, true, 0)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_bgr, 4, 3, true, 0)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab_to_bgra, 3, 4, true, 0)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_bgra, 4, 4, true, 0)\n\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab_to_lrgb, 3, 3, false, 2)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_lrgb, 4, 3, false, 2)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab_to_lrgba, 3, 4, false, 2)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_lrgba, 4, 4, false, 2)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab_to_lbgr, 3, 3, false, 0)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_lbgr, 4, 3, false, 0)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab_to_lbgra, 3, 4, false, 0)\n    OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(lab4_to_lbgra, 4, 4, false, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(rgb_to_luv, 3, 3, true, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(rgba_to_luv, 4, 3, true, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(rgb_to_luv4, 3, 4, true, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(rgba_to_luv4, 4, 4, true, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(bgr_to_luv, 3, 3, true, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(bgra_to_luv, 4, 3, true, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(bgr_to_luv4, 3, 4, true, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(bgra_to_luv4, 4, 4, true, 0)\n\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(lrgb_to_luv, 3, 3, false, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(lrgba_to_luv, 4, 3, false, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(lrgb_to_luv4, 3, 4, false, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(lrgba_to_luv4, 4, 4, false, 2)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(lbgr_to_luv, 3, 3, false, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(lbgra_to_luv, 4, 3, false, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(lbgr_to_luv4, 3, 4, false, 0)\n    OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(lbgra_to_luv4, 4, 4, false, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS\n\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv_to_rgb, 3, 3, true, 2)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_rgb, 4, 3, true, 2)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv_to_rgba, 3, 4, true, 2)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_rgba, 4, 4, true, 2)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv_to_bgr, 3, 3, true, 0)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_bgr, 4, 3, true, 0)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv_to_bgra, 3, 4, true, 0)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_bgra, 4, 4, true, 0)\n\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv_to_lrgb, 3, 3, false, 2)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_lrgb, 4, 3, false, 2)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv_to_lrgba, 3, 4, false, 2)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_lrgba, 4, 4, false, 2)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv_to_lbgr, 3, 3, false, 0)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_lbgr, 4, 3, false, 0)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv_to_lbgra, 3, 4, false, 0)\n    OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(luv4_to_lbgra, 4, 4, false, 0)\n\n    #undef OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_COLOR_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/common.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_COMMON_HPP\n#define OPENCV_CUDA_COMMON_HPP\n\n#include <cuda_runtime.h>\n#include \"opencv2/core/cuda_types.hpp\"\n#include \"opencv2/core/cvdef.h\"\n#include \"opencv2/core/base.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\n#ifndef CV_PI_F\n    #ifndef CV_PI\n        #define CV_PI_F 3.14159265f\n    #else\n        #define CV_PI_F ((float)CV_PI)\n    #endif\n#endif\n\nnamespace cv { namespace cuda {\n    static inline void checkCudaError(cudaError_t err, const char* file, const int line, const char* func)\n    {\n        if (cudaSuccess != err)\n            cv::error(cv::Error::GpuApiCallError, cudaGetErrorString(err), func, file, line);\n    }\n}}\n\n#ifndef cudaSafeCall\n    #define cudaSafeCall(expr)  cv::cuda::checkCudaError(expr, __FILE__, __LINE__, CV_Func)\n#endif\n\nnamespace cv { namespace cuda\n{\n    template <typename T> static inline bool isAligned(const T* ptr, size_t size)\n    {\n        return reinterpret_cast<size_t>(ptr) % size == 0;\n    }\n\n    static inline bool isAligned(size_t step, size_t size)\n    {\n        return step % size == 0;\n    }\n}}\n\nnamespace cv { namespace cuda\n{\n    namespace device\n    {\n        __host__ __device__ __forceinline__ int divUp(int total, int grain)\n        {\n            return (total + grain - 1) / grain;\n        }\n\n        template<class T> inline void bindTexture(const textureReference* tex, const PtrStepSz<T>& img)\n        {\n            cudaChannelFormatDesc desc = cudaCreateChannelDesc<T>();\n            cudaSafeCall( cudaBindTexture2D(0, tex, img.ptr(), &desc, img.cols, img.rows, img.step) );\n        }\n\n        template<class T> inline void createTextureObjectPitch2D(cudaTextureObject_t* tex, PtrStepSz<T>& img, const cudaTextureDesc& texDesc)\n        {\n            cudaResourceDesc resDesc;\n            memset(&resDesc, 0, sizeof(resDesc));\n            resDesc.resType = cudaResourceTypePitch2D;\n            resDesc.res.pitch2D.devPtr = static_cast<void*>(img.ptr());\n            resDesc.res.pitch2D.height = img.rows;\n            resDesc.res.pitch2D.width = img.cols;\n            resDesc.res.pitch2D.pitchInBytes = img.step;\n            resDesc.res.pitch2D.desc = cudaCreateChannelDesc<T>();\n\n            cudaSafeCall( cudaCreateTextureObject(tex, &resDesc, &texDesc, NULL) );\n        }\n    }\n}}\n\n//! @endcond\n\n#endif // OPENCV_CUDA_COMMON_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/datamov_utils.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_DATAMOV_UTILS_HPP\n#define OPENCV_CUDA_DATAMOV_UTILS_HPP\n\n#include \"common.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 200\n\n        // for Fermi memory space is detected automatically\n        template <typename T> struct ForceGlob\n        {\n            __device__ __forceinline__ static void Load(const T* ptr, int offset, T& val)  { val = ptr[offset];  }\n        };\n\n    #else // __CUDA_ARCH__ >= 200\n\n        #if defined(_WIN64) || defined(__LP64__)\n            // 64-bit register modifier for inlined asm\n            #define OPENCV_CUDA_ASM_PTR \"l\"\n        #else\n            // 32-bit register modifier for inlined asm\n            #define OPENCV_CUDA_ASM_PTR \"r\"\n        #endif\n\n        template<class T> struct ForceGlob;\n\n        #define OPENCV_CUDA_DEFINE_FORCE_GLOB(base_type, ptx_type, reg_mod) \\\n            template <> struct ForceGlob<base_type> \\\n            { \\\n                __device__ __forceinline__ static void Load(const base_type* ptr, int offset, base_type& val) \\\n                { \\\n                    asm(\"ld.global.\"#ptx_type\" %0, [%1];\" : \"=\"#reg_mod(val) : OPENCV_CUDA_ASM_PTR(ptr + offset)); \\\n                } \\\n            };\n\n        #define OPENCV_CUDA_DEFINE_FORCE_GLOB_B(base_type, ptx_type) \\\n            template <> struct ForceGlob<base_type> \\\n            { \\\n                __device__ __forceinline__ static void Load(const base_type* ptr, int offset, base_type& val) \\\n                { \\\n                    asm(\"ld.global.\"#ptx_type\" %0, [%1];\" : \"=r\"(*reinterpret_cast<uint*>(&val)) : OPENCV_CUDA_ASM_PTR(ptr + offset)); \\\n                } \\\n            };\n\n            OPENCV_CUDA_DEFINE_FORCE_GLOB_B(uchar,  u8)\n            OPENCV_CUDA_DEFINE_FORCE_GLOB_B(schar,  s8)\n            OPENCV_CUDA_DEFINE_FORCE_GLOB_B(char,   b8)\n            OPENCV_CUDA_DEFINE_FORCE_GLOB  (ushort, u16, h)\n            OPENCV_CUDA_DEFINE_FORCE_GLOB  (short,  s16, h)\n            OPENCV_CUDA_DEFINE_FORCE_GLOB  (uint,   u32, r)\n            OPENCV_CUDA_DEFINE_FORCE_GLOB  (int,    s32, r)\n            OPENCV_CUDA_DEFINE_FORCE_GLOB  (float,  f32, f)\n            OPENCV_CUDA_DEFINE_FORCE_GLOB  (double, f64, d)\n\n        #undef OPENCV_CUDA_DEFINE_FORCE_GLOB\n        #undef OPENCV_CUDA_DEFINE_FORCE_GLOB_B\n        #undef OPENCV_CUDA_ASM_PTR\n\n    #endif // __CUDA_ARCH__ >= 200\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_DATAMOV_UTILS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/detail/color_detail.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_COLOR_DETAIL_HPP\n#define OPENCV_CUDA_COLOR_DETAIL_HPP\n\n#include \"../common.hpp\"\n#include \"../vec_traits.hpp\"\n#include \"../saturate_cast.hpp\"\n#include \"../limits.hpp\"\n#include \"../functional.hpp\"\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    #ifndef CV_DESCALE\n        #define CV_DESCALE(x, n) (((x) + (1 << ((n)-1))) >> (n))\n    #endif\n\n    namespace color_detail\n    {\n        template<typename T> struct ColorChannel\n        {\n            typedef float worktype_f;\n            static __device__ __forceinline__ T max() { return numeric_limits<T>::max(); }\n            static __device__ __forceinline__ T half() { return (T)(max()/2 + 1); }\n        };\n\n        template<> struct ColorChannel<float>\n        {\n            typedef float worktype_f;\n            static __device__ __forceinline__ float max() { return 1.f; }\n            static __device__ __forceinline__ float half() { return 0.5f; }\n        };\n\n        template <typename T> static __device__ __forceinline__ void setAlpha(typename TypeVec<T, 3>::vec_type& vec, T val)\n        {\n        }\n\n        template <typename T> static __device__ __forceinline__ void setAlpha(typename TypeVec<T, 4>::vec_type& vec, T val)\n        {\n            vec.w = val;\n        }\n\n        template <typename T> static __device__ __forceinline__ T getAlpha(const typename TypeVec<T, 3>::vec_type& vec)\n        {\n            return ColorChannel<T>::max();\n        }\n\n        template <typename T> static __device__ __forceinline__ T getAlpha(const typename TypeVec<T, 4>::vec_type& vec)\n        {\n            return vec.w;\n        }\n\n        //constants for conversion from/to RGB and Gray, YUV, YCrCb according to BT.601\n        constexpr float B2YF = 0.114f;\n        constexpr float G2YF = 0.587f;\n        constexpr float R2YF = 0.299f;\n\n        //to YCbCr\n        constexpr float YCBF = 0.564f; // == 1/2/(1-B2YF)\n        constexpr float YCRF = 0.713f; // == 1/2/(1-R2YF)\n        const     int   YCBI = 9241;  // == YCBF*16384\n        const     int   YCRI = 11682; // == YCRF*16384\n        //to YUV\n        constexpr float B2UF = 0.492f;\n        constexpr float R2VF = 0.877f;\n        const     int   B2UI = 8061;  // == B2UF*16384\n        const     int   R2VI = 14369; // == R2VF*16384\n        //from YUV\n        constexpr float U2BF = 2.032f;\n        constexpr float U2GF = -0.395f;\n        constexpr float V2GF = -0.581f;\n        constexpr float V2RF = 1.140f;\n        const     int   U2BI = 33292;\n        const     int   U2GI = -6472;\n        const     int   V2GI = -9519;\n        const     int   V2RI = 18678;\n        //from YCrCb\n        constexpr float CB2BF = 1.773f;\n        constexpr float CB2GF = -0.344f;\n        constexpr float CR2GF = -0.714f;\n        constexpr float CR2RF = 1.403f;\n        const     int   CB2BI = 29049;\n        const     int   CB2GI = -5636;\n        const     int   CR2GI = -11698;\n        const     int   CR2RI = 22987;\n\n        enum\n        {\n            yuv_shift  = 14,\n            xyz_shift  = 12,\n            gray_shift = 15,\n            R2Y        = 4899,\n            G2Y        = 9617,\n            B2Y        = 1868,\n            RY15 =  9798, // == R2YF*32768 + 0.5\n            GY15 = 19235, // == G2YF*32768 + 0.5\n            BY15 =  3735, // == B2YF*32768 + 0.5\n            BLOCK_SIZE = 256\n        };\n    }\n\n////////////////// Various 3/4-channel to 3/4-channel RGB transformations /////////////////\n\n    namespace color_detail\n    {\n        template <typename T, int scn, int dcn, int bidx> struct RGB2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                dst.x = (&src.x)[bidx];\n                dst.y = src.y;\n                dst.z = (&src.x)[bidx^2];\n                setAlpha(dst, getAlpha<T>(src));\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2RGB() {}\n            __host__ __device__ __forceinline__ RGB2RGB(const RGB2RGB&) {}\n        };\n\n        template <> struct RGB2RGB<uchar, 4, 4, 2> : unary_function<uint, uint>\n        {\n            __device__ uint operator()(uint src) const\n            {\n                uint dst = 0;\n\n                dst |= (0xffu & (src >> 16));\n                dst |= (0xffu & (src >> 8)) << 8;\n                dst |= (0xffu & (src)) << 16;\n                dst |= (0xffu & (src >> 24)) << 24;\n\n                return dst;\n            }\n\n            __host__ __device__ __forceinline__ RGB2RGB() {}\n            __host__ __device__ __forceinline__ RGB2RGB(const RGB2RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2RGB<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n/////////// Transforming 16-bit (565 or 555) RGB to/from 24/32-bit (888[8]) RGB //////////\n\n    namespace color_detail\n    {\n        template <int green_bits, int bidx> struct RGB2RGB5x5Converter;\n        template<int bidx> struct RGB2RGB5x5Converter<6, bidx>\n        {\n            static __device__ __forceinline__ ushort cvt(const uchar3& src)\n            {\n                return (ushort)(((&src.x)[bidx] >> 3) | ((src.y & ~3) << 3) | (((&src.x)[bidx^2] & ~7) << 8));\n            }\n\n            static __device__ __forceinline__ ushort cvt(uint src)\n            {\n                uint b = 0xffu & (src >> (bidx * 8));\n                uint g = 0xffu & (src >> 8);\n                uint r = 0xffu & (src >> ((bidx ^ 2) * 8));\n                return (ushort)((b >> 3) | ((g & ~3) << 3) | ((r & ~7) << 8));\n            }\n        };\n\n        template<int bidx> struct RGB2RGB5x5Converter<5, bidx>\n        {\n            static __device__ __forceinline__ ushort cvt(const uchar3& src)\n            {\n                return (ushort)(((&src.x)[bidx] >> 3) | ((src.y & ~7) << 2) | (((&src.x)[bidx^2] & ~7) << 7));\n            }\n\n            static __device__ __forceinline__ ushort cvt(uint src)\n            {\n                uint b = 0xffu & (src >> (bidx * 8));\n                uint g = 0xffu & (src >> 8);\n                uint r = 0xffu & (src >> ((bidx ^ 2) * 8));\n                uint a = 0xffu & (src >> 24);\n                return (ushort)((b >> 3) | ((g & ~7) << 2) | ((r & ~7) << 7) | (a * 0x8000));\n            }\n        };\n\n        template<int scn, int bidx, int green_bits> struct RGB2RGB5x5;\n\n        template<int bidx, int green_bits> struct RGB2RGB5x5<3, bidx,green_bits> : unary_function<uchar3, ushort>\n        {\n            __device__ __forceinline__ ushort operator()(const uchar3& src) const\n            {\n                return RGB2RGB5x5Converter<green_bits, bidx>::cvt(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2RGB5x5() {}\n            __host__ __device__ __forceinline__ RGB2RGB5x5(const RGB2RGB5x5&) {}\n        };\n\n        template<int bidx, int green_bits> struct RGB2RGB5x5<4, bidx,green_bits> : unary_function<uint, ushort>\n        {\n            __device__ __forceinline__ ushort operator()(uint src) const\n            {\n                return RGB2RGB5x5Converter<green_bits, bidx>::cvt(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2RGB5x5() {}\n            __host__ __device__ __forceinline__ RGB2RGB5x5(const RGB2RGB5x5&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2RGB5x5_TRAITS(name, scn, bidx, green_bits) \\\n    struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2RGB5x5<scn, bidx, green_bits> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        template <int green_bits, int bidx> struct RGB5x52RGBConverter;\n\n        template <int bidx> struct RGB5x52RGBConverter<5, bidx>\n        {\n            static __device__ __forceinline__ void cvt(uint src, uchar3& dst)\n            {\n                (&dst.x)[bidx] = src << 3;\n                dst.y = (src >> 2) & ~7;\n                (&dst.x)[bidx ^ 2] = (src >> 7) & ~7;\n            }\n\n            static __device__ __forceinline__ void cvt(uint src, uint& dst)\n            {\n                dst = 0;\n\n                dst |= (0xffu & (src << 3)) << (bidx * 8);\n                dst |= (0xffu & ((src >> 2) & ~7)) << 8;\n                dst |= (0xffu & ((src >> 7) & ~7)) << ((bidx ^ 2) * 8);\n                dst |= ((src & 0x8000) * 0xffu) << 24;\n            }\n        };\n\n        template <int bidx> struct RGB5x52RGBConverter<6, bidx>\n        {\n            static __device__ __forceinline__ void cvt(uint src, uchar3& dst)\n            {\n                (&dst.x)[bidx] = src << 3;\n                dst.y = (src >> 3) & ~3;\n                (&dst.x)[bidx ^ 2] = (src >> 8) & ~7;\n            }\n\n            static __device__ __forceinline__ void cvt(uint src, uint& dst)\n            {\n                dst = 0xffu << 24;\n\n                dst |= (0xffu & (src << 3)) << (bidx * 8);\n                dst |= (0xffu &((src >> 3) & ~3)) << 8;\n                dst |= (0xffu & ((src >> 8) & ~7)) << ((bidx ^ 2) * 8);\n            }\n        };\n\n        template <int dcn, int bidx, int green_bits> struct RGB5x52RGB;\n\n        template <int bidx, int green_bits> struct RGB5x52RGB<3, bidx, green_bits> : unary_function<ushort, uchar3>\n        {\n            __device__ __forceinline__ uchar3 operator()(ushort src) const\n            {\n                uchar3 dst;\n                RGB5x52RGBConverter<green_bits, bidx>::cvt(src, dst);\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB5x52RGB() {}\n            __host__ __device__ __forceinline__ RGB5x52RGB(const RGB5x52RGB&) {}\n\n        };\n\n        template <int bidx, int green_bits> struct RGB5x52RGB<4, bidx, green_bits> : unary_function<ushort, uint>\n        {\n            __device__ __forceinline__ uint operator()(ushort src) const\n            {\n                uint dst;\n                RGB5x52RGBConverter<green_bits, bidx>::cvt(src, dst);\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB5x52RGB() {}\n            __host__ __device__ __forceinline__ RGB5x52RGB(const RGB5x52RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB5x52RGB_TRAITS(name, dcn, bidx, green_bits) \\\n    struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB5x52RGB<dcn, bidx, green_bits> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////// Grayscale to Color ////////////////////////////////\n\n    namespace color_detail\n    {\n        template <typename T, int dcn> struct Gray2RGB : unary_function<T, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(T src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                dst.z = dst.y = dst.x = src;\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ Gray2RGB() {}\n            __host__ __device__ __forceinline__ Gray2RGB(const Gray2RGB&) {}\n        };\n\n        template <> struct Gray2RGB<uchar, 4> : unary_function<uchar, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                uint dst = 0xffu << 24;\n\n                dst |= src;\n                dst |= src << 8;\n                dst |= src << 16;\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ Gray2RGB() {}\n            __host__ __device__ __forceinline__ Gray2RGB(const Gray2RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_GRAY2RGB_TRAITS(name, dcn) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::Gray2RGB<T, dcn> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        template <int green_bits> struct Gray2RGB5x5Converter;\n        template<> struct Gray2RGB5x5Converter<6>\n        {\n            static __device__ __forceinline__ ushort cvt(uint t)\n            {\n                return (ushort)((t >> 3) | ((t & ~3) << 3) | ((t & ~7) << 8));\n            }\n        };\n\n        template<> struct Gray2RGB5x5Converter<5>\n        {\n            static __device__ __forceinline__ ushort cvt(uint t)\n            {\n                t >>= 3;\n                return (ushort)(t | (t << 5) | (t << 10));\n            }\n        };\n\n        template<int green_bits> struct Gray2RGB5x5 : unary_function<uchar, ushort>\n        {\n            __device__ __forceinline__ ushort operator()(uint src) const\n            {\n                return Gray2RGB5x5Converter<green_bits>::cvt(src);\n            }\n\n            __host__ __device__ __forceinline__ Gray2RGB5x5() {}\n            __host__ __device__ __forceinline__ Gray2RGB5x5(const Gray2RGB5x5&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_GRAY2RGB5x5_TRAITS(name, green_bits) \\\n    struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::Gray2RGB5x5<green_bits> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////// Color to Grayscale ////////////////////////////////\n\n    namespace color_detail\n    {\n        template <int green_bits> struct RGB5x52GrayConverter;\n        template <> struct RGB5x52GrayConverter<6>\n        {\n            static __device__ __forceinline__ uchar cvt(uint t)\n            {\n                return (uchar)CV_DESCALE(((t << 3) & 0xf8) * BY15 + ((t >> 3) & 0xfc) * GY15 + ((t >> 8) & 0xf8) * RY15, gray_shift);\n            }\n        };\n\n        template <> struct RGB5x52GrayConverter<5>\n        {\n            static __device__ __forceinline__ uchar cvt(uint t)\n            {\n                return (uchar)CV_DESCALE(((t << 3) & 0xf8) * BY15 + ((t >> 2) & 0xf8) * GY15 + ((t >> 7) & 0xf8) * RY15, gray_shift);\n            }\n        };\n\n        template<int green_bits> struct RGB5x52Gray : unary_function<ushort, uchar>\n        {\n            __device__ __forceinline__ uchar operator()(uint src) const\n            {\n                return RGB5x52GrayConverter<green_bits>::cvt(src);\n            }\n            __host__ __device__ __forceinline__ RGB5x52Gray() {}\n            __host__ __device__ __forceinline__ RGB5x52Gray(const RGB5x52Gray&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB5x52GRAY_TRAITS(name, green_bits) \\\n    struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB5x52Gray<green_bits> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        template <int bidx, typename T> static __device__ __forceinline__ T RGB2GrayConvert(const T* src)\n        {\n            return (T)CV_DESCALE((unsigned)(src[bidx] * BY15 + src[1] * GY15 + src[bidx^2] * RY15), gray_shift);\n        }\n\n        template <int bidx> static __device__ __forceinline__ uchar RGB2GrayConvert(uint src)\n        {\n            uint b = 0xffu & (src >> (bidx * 8));\n            uint g = 0xffu & (src >> 8);\n            uint r = 0xffu & (src >> ((bidx ^ 2) * 8));\n            return CV_DESCALE((uint)(b * BY15 + g * GY15 + r * RY15), gray_shift);\n        }\n\n        template <int bidx> static __device__ __forceinline__ float RGB2GrayConvert(const float* src)\n        {\n            return src[bidx] * B2YF + src[1] * G2YF + src[bidx^2] * R2YF;\n        }\n\n        template <typename T, int scn, int bidx> struct RGB2Gray : unary_function<typename TypeVec<T, scn>::vec_type, T>\n        {\n            __device__ __forceinline__ T operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                return RGB2GrayConvert<bidx>(&src.x);\n            }\n            __host__ __device__ __forceinline__ RGB2Gray() {}\n            __host__ __device__ __forceinline__ RGB2Gray(const RGB2Gray&) {}\n        };\n\n        template <int bidx> struct RGB2Gray<uchar, 4, bidx> : unary_function<uint, uchar>\n        {\n            __device__ __forceinline__ uchar operator()(uint src) const\n            {\n                return RGB2GrayConvert<bidx>(src);\n            }\n            __host__ __device__ __forceinline__ RGB2Gray() {}\n            __host__ __device__ __forceinline__ RGB2Gray(const RGB2Gray&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2GRAY_TRAITS(name, scn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2Gray<T, scn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////////// RGB <-> YUV //////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ float c_RGB2YUVCoeffs_f[5] = { B2YF, G2YF, R2YF, B2UF, R2VF };\n        __constant__ int   c_RGB2YUVCoeffs_i[5] = { B2Y, G2Y, R2Y, B2UI, R2VI };\n\n        template <int bidx, typename T, typename D> static __device__ void RGB2YUVConvert(const T* src, D& dst)\n        {\n            const int delta = ColorChannel<T>::half() * (1 << yuv_shift);\n\n            const int Y = CV_DESCALE(src[0] * c_RGB2YUVCoeffs_i[bidx^2] + src[1] * c_RGB2YUVCoeffs_i[1] + src[2] * c_RGB2YUVCoeffs_i[bidx], yuv_shift);\n            const int Cr = CV_DESCALE((src[bidx^2] - Y) * c_RGB2YUVCoeffs_i[3] + delta, yuv_shift);\n            const int Cb = CV_DESCALE((src[bidx] - Y) * c_RGB2YUVCoeffs_i[4] + delta, yuv_shift);\n\n            dst.x = saturate_cast<T>(Y);\n            dst.y = saturate_cast<T>(Cr);\n            dst.z = saturate_cast<T>(Cb);\n        }\n\n        template <int bidx, typename D> static __device__ __forceinline__ void RGB2YUVConvert(const float* src, D& dst)\n        {\n            dst.x = src[0] * c_RGB2YUVCoeffs_f[bidx^2] + src[1] * c_RGB2YUVCoeffs_f[1] + src[2] * c_RGB2YUVCoeffs_f[bidx];\n            dst.y = (src[bidx^2] - dst.x) * c_RGB2YUVCoeffs_f[3] + ColorChannel<float>::half();\n            dst.z = (src[bidx] - dst.x) * c_RGB2YUVCoeffs_f[4] + ColorChannel<float>::half();\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct RGB2YUV\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator ()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n                RGB2YUVConvert<bidx>(&src.x, dst);\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB2YUV() {}\n            __host__ __device__ __forceinline__ RGB2YUV(const RGB2YUV&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2YUV_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2YUV<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ float c_YUV2RGBCoeffs_f[5] = { U2BF, U2GF, V2GF, V2RF };\n        __constant__ int   c_YUV2RGBCoeffs_i[5] = { U2BI, U2GI, V2GI, V2RI };\n\n        template <int bidx, typename T, typename D> static __device__ void YUV2RGBConvert(const T& src, D* dst)\n        {\n            const int b = src.x + CV_DESCALE((src.z - ColorChannel<D>::half()) * c_YUV2RGBCoeffs_i[3], yuv_shift);\n\n            const int g = src.x + CV_DESCALE((src.z - ColorChannel<D>::half()) * c_YUV2RGBCoeffs_i[2]\n                                             + (src.y - ColorChannel<D>::half()) * c_YUV2RGBCoeffs_i[1], yuv_shift);\n\n            const int r = src.x + CV_DESCALE((src.y - ColorChannel<D>::half()) * c_YUV2RGBCoeffs_i[0], yuv_shift);\n\n            dst[bidx] = saturate_cast<D>(b);\n            dst[1] = saturate_cast<D>(g);\n            dst[bidx^2] = saturate_cast<D>(r);\n        }\n\n        template <int bidx> static __device__ uint YUV2RGBConvert(uint src)\n        {\n            const int x = 0xff & (src);\n            const int y = 0xff & (src >> 8);\n            const int z = 0xff & (src >> 16);\n\n            const int b = x + CV_DESCALE((z - ColorChannel<uchar>::half()) * c_YUV2RGBCoeffs_i[3], yuv_shift);\n\n            const int g = x + CV_DESCALE((z - ColorChannel<uchar>::half()) * c_YUV2RGBCoeffs_i[2]\n                                         + (y - ColorChannel<uchar>::half()) * c_YUV2RGBCoeffs_i[1], yuv_shift);\n\n            const int r = x + CV_DESCALE((y - ColorChannel<uchar>::half()) * c_YUV2RGBCoeffs_i[0], yuv_shift);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(b) << (bidx * 8);\n            dst |= saturate_cast<uchar>(g) << 8;\n            dst |= saturate_cast<uchar>(r) << ((bidx ^ 2) * 8);\n\n            return dst;\n        }\n\n        template <int bidx, typename T> static __device__ __forceinline__ void YUV2RGBConvert(const T& src, float* dst)\n        {\n            dst[bidx] = src.x + (src.z - ColorChannel<float>::half()) * c_YUV2RGBCoeffs_f[3];\n\n            dst[1] = src.x + (src.z - ColorChannel<float>::half()) * c_YUV2RGBCoeffs_f[2]\n                     + (src.y - ColorChannel<float>::half()) * c_YUV2RGBCoeffs_f[1];\n\n            dst[bidx^2] = src.x + (src.y - ColorChannel<float>::half()) * c_YUV2RGBCoeffs_f[0];\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct YUV2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator ()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                YUV2RGBConvert<bidx>(src, &dst.x);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ YUV2RGB() {}\n            __host__ __device__ __forceinline__ YUV2RGB(const YUV2RGB&) {}\n        };\n\n        template <int bidx> struct YUV2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator ()(uint src) const\n            {\n                return YUV2RGBConvert<bidx>(src);\n            }\n            __host__ __device__ __forceinline__ YUV2RGB() {}\n            __host__ __device__ __forceinline__ YUV2RGB(const YUV2RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_YUV2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::YUV2RGB<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////////// RGB <-> YCrCb //////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ float c_RGB2YCrCbCoeffs_f[5] = {R2YF, G2YF, B2YF, YCRF, YCBF};\n        __constant__ int   c_RGB2YCrCbCoeffs_i[5] = {R2Y, G2Y, B2Y, YCRI, YCBI};\n\n        template <int bidx, typename T, typename D> static __device__ void RGB2YCrCbConvert(const T* src, D& dst)\n        {\n            const int delta = ColorChannel<T>::half() * (1 << yuv_shift);\n\n            const int Y = CV_DESCALE(src[0] * c_RGB2YCrCbCoeffs_i[bidx^2] + src[1] * c_RGB2YCrCbCoeffs_i[1] + src[2] * c_RGB2YCrCbCoeffs_i[bidx], yuv_shift);\n            const int Cr = CV_DESCALE((src[bidx^2] - Y) * c_RGB2YCrCbCoeffs_i[3] + delta, yuv_shift);\n            const int Cb = CV_DESCALE((src[bidx] - Y) * c_RGB2YCrCbCoeffs_i[4] + delta, yuv_shift);\n\n            dst.x = saturate_cast<T>(Y);\n            dst.y = saturate_cast<T>(Cr);\n            dst.z = saturate_cast<T>(Cb);\n        }\n\n        template <int bidx> static __device__ uint RGB2YCrCbConvert(uint src)\n        {\n            const int delta = ColorChannel<uchar>::half() * (1 << yuv_shift);\n\n            const int Y = CV_DESCALE((0xffu & src) * c_RGB2YCrCbCoeffs_i[bidx^2] + (0xffu & (src >> 8)) * c_RGB2YCrCbCoeffs_i[1] + (0xffu & (src >> 16)) * c_RGB2YCrCbCoeffs_i[bidx], yuv_shift);\n            const int Cr = CV_DESCALE(((0xffu & (src >> ((bidx ^ 2) * 8))) - Y) * c_RGB2YCrCbCoeffs_i[3] + delta, yuv_shift);\n            const int Cb = CV_DESCALE(((0xffu & (src >> (bidx * 8))) - Y) * c_RGB2YCrCbCoeffs_i[4] + delta, yuv_shift);\n\n            uint dst = 0;\n\n            dst |= saturate_cast<uchar>(Y);\n            dst |= saturate_cast<uchar>(Cr) << 8;\n            dst |= saturate_cast<uchar>(Cb) << 16;\n\n            return dst;\n        }\n\n        template <int bidx, typename D> static __device__ __forceinline__ void RGB2YCrCbConvert(const float* src, D& dst)\n        {\n            dst.x = src[0] * c_RGB2YCrCbCoeffs_f[bidx^2] + src[1] * c_RGB2YCrCbCoeffs_f[1] + src[2] * c_RGB2YCrCbCoeffs_f[bidx];\n            dst.y = (src[bidx^2] - dst.x) * c_RGB2YCrCbCoeffs_f[3] + ColorChannel<float>::half();\n            dst.z = (src[bidx] - dst.x) * c_RGB2YCrCbCoeffs_f[4] + ColorChannel<float>::half();\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct RGB2YCrCb\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator ()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n                RGB2YCrCbConvert<bidx>(&src.x, dst);\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB2YCrCb() {}\n            __host__ __device__ __forceinline__ RGB2YCrCb(const RGB2YCrCb&) {}\n        };\n\n        template <int bidx> struct RGB2YCrCb<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator ()(uint src) const\n            {\n                return RGB2YCrCbConvert<bidx>(src);\n            }\n\n            __host__ __device__ __forceinline__ RGB2YCrCb() {}\n            __host__ __device__ __forceinline__ RGB2YCrCb(const RGB2YCrCb&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2YCrCb_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2YCrCb<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ float c_YCrCb2RGBCoeffs_f[5] = {CR2RF, CR2GF, CB2GF, CB2BF};\n        __constant__ int   c_YCrCb2RGBCoeffs_i[5] = {CR2RI, CR2GI, CB2GI, CB2BI};\n\n        template <int bidx, typename T, typename D> static __device__ void YCrCb2RGBConvert(const T& src, D* dst)\n        {\n            const int b = src.x + CV_DESCALE((src.z - ColorChannel<D>::half()) * c_YCrCb2RGBCoeffs_i[3], yuv_shift);\n            const int g = src.x + CV_DESCALE((src.z - ColorChannel<D>::half()) * c_YCrCb2RGBCoeffs_i[2] + (src.y - ColorChannel<D>::half()) * c_YCrCb2RGBCoeffs_i[1], yuv_shift);\n            const int r = src.x + CV_DESCALE((src.y - ColorChannel<D>::half()) * c_YCrCb2RGBCoeffs_i[0], yuv_shift);\n\n            dst[bidx] = saturate_cast<D>(b);\n            dst[1] = saturate_cast<D>(g);\n            dst[bidx^2] = saturate_cast<D>(r);\n        }\n\n        template <int bidx> static __device__ uint YCrCb2RGBConvert(uint src)\n        {\n            const int x = 0xff & (src);\n            const int y = 0xff & (src >> 8);\n            const int z = 0xff & (src >> 16);\n\n            const int b = x + CV_DESCALE((z - ColorChannel<uchar>::half()) * c_YCrCb2RGBCoeffs_i[3], yuv_shift);\n            const int g = x + CV_DESCALE((z - ColorChannel<uchar>::half()) * c_YCrCb2RGBCoeffs_i[2] + (y - ColorChannel<uchar>::half()) * c_YCrCb2RGBCoeffs_i[1], yuv_shift);\n            const int r = x + CV_DESCALE((y - ColorChannel<uchar>::half()) * c_YCrCb2RGBCoeffs_i[0], yuv_shift);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(b) << (bidx * 8);\n            dst |= saturate_cast<uchar>(g) << 8;\n            dst |= saturate_cast<uchar>(r) << ((bidx ^ 2) * 8);\n\n            return dst;\n        }\n\n        template <int bidx, typename T> __device__ __forceinline__ void YCrCb2RGBConvert(const T& src, float* dst)\n        {\n            dst[bidx] = src.x + (src.z - ColorChannel<float>::half()) * c_YCrCb2RGBCoeffs_f[3];\n            dst[1] = src.x + (src.z - ColorChannel<float>::half()) * c_YCrCb2RGBCoeffs_f[2] + (src.y - ColorChannel<float>::half()) * c_YCrCb2RGBCoeffs_f[1];\n            dst[bidx^2] = src.x + (src.y - ColorChannel<float>::half()) * c_YCrCb2RGBCoeffs_f[0];\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct YCrCb2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator ()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                YCrCb2RGBConvert<bidx>(src, &dst.x);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ YCrCb2RGB() {}\n            __host__ __device__ __forceinline__ YCrCb2RGB(const YCrCb2RGB&) {}\n        };\n\n        template <int bidx> struct YCrCb2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator ()(uint src) const\n            {\n                return YCrCb2RGBConvert<bidx>(src);\n            }\n            __host__ __device__ __forceinline__ YCrCb2RGB() {}\n            __host__ __device__ __forceinline__ YCrCb2RGB(const YCrCb2RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_YCrCb2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::YCrCb2RGB<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n////////////////////////////////////// RGB <-> XYZ ///////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ float c_RGB2XYZ_D65f[9] = { 0.412453f, 0.357580f, 0.180423f, 0.212671f, 0.715160f, 0.072169f, 0.019334f, 0.119193f, 0.950227f };\n        __constant__ int   c_RGB2XYZ_D65i[9] = { 1689, 1465, 739, 871, 2929, 296, 79, 488, 3892 };\n\n        template <int bidx, typename T, typename D> static __device__ __forceinline__ void RGB2XYZConvert(const T* src, D& dst)\n        {\n            dst.z = saturate_cast<T>(CV_DESCALE(src[bidx^2] * c_RGB2XYZ_D65i[6] + src[1] * c_RGB2XYZ_D65i[7] + src[bidx] * c_RGB2XYZ_D65i[8], xyz_shift));\n            dst.x = saturate_cast<T>(CV_DESCALE(src[bidx^2] * c_RGB2XYZ_D65i[0] + src[1] * c_RGB2XYZ_D65i[1] + src[bidx] * c_RGB2XYZ_D65i[2], xyz_shift));\n            dst.y = saturate_cast<T>(CV_DESCALE(src[bidx^2] * c_RGB2XYZ_D65i[3] + src[1] * c_RGB2XYZ_D65i[4] + src[bidx] * c_RGB2XYZ_D65i[5], xyz_shift));\n        }\n\n        template <int bidx> static __device__ __forceinline__ uint RGB2XYZConvert(uint src)\n        {\n            const uint b = 0xffu & (src >> (bidx * 8));\n            const uint g = 0xffu & (src >> 8);\n            const uint r = 0xffu & (src >> ((bidx ^ 2) * 8));\n\n            const uint x = saturate_cast<uchar>(CV_DESCALE(r * c_RGB2XYZ_D65i[0] + g * c_RGB2XYZ_D65i[1] + b * c_RGB2XYZ_D65i[2], xyz_shift));\n            const uint y = saturate_cast<uchar>(CV_DESCALE(r * c_RGB2XYZ_D65i[3] + g * c_RGB2XYZ_D65i[4] + b * c_RGB2XYZ_D65i[5], xyz_shift));\n            const uint z = saturate_cast<uchar>(CV_DESCALE(r * c_RGB2XYZ_D65i[6] + g * c_RGB2XYZ_D65i[7] + b * c_RGB2XYZ_D65i[8], xyz_shift));\n\n            uint dst = 0;\n\n            dst |= x;\n            dst |= y << 8;\n            dst |= z << 16;\n\n            return dst;\n        }\n\n        template <int bidx, typename D> static __device__ __forceinline__ void RGB2XYZConvert(const float* src, D& dst)\n        {\n            dst.x = src[bidx^2] * c_RGB2XYZ_D65f[0] + src[1] * c_RGB2XYZ_D65f[1] + src[bidx] * c_RGB2XYZ_D65f[2];\n            dst.y = src[bidx^2] * c_RGB2XYZ_D65f[3] + src[1] * c_RGB2XYZ_D65f[4] + src[bidx] * c_RGB2XYZ_D65f[5];\n            dst.z = src[bidx^2] * c_RGB2XYZ_D65f[6] + src[1] * c_RGB2XYZ_D65f[7] + src[bidx] * c_RGB2XYZ_D65f[8];\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct RGB2XYZ\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                RGB2XYZConvert<bidx>(&src.x, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB2XYZ() {}\n            __host__ __device__ __forceinline__ RGB2XYZ(const RGB2XYZ&) {}\n        };\n\n        template <int bidx> struct RGB2XYZ<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return RGB2XYZConvert<bidx>(src);\n            }\n            __host__ __device__ __forceinline__ RGB2XYZ() {}\n            __host__ __device__ __forceinline__ RGB2XYZ(const RGB2XYZ&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2XYZ_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2XYZ<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ float c_XYZ2sRGB_D65f[9] = { 3.240479f, -1.53715f, -0.498535f, -0.969256f, 1.875991f, 0.041556f, 0.055648f, -0.204043f, 1.057311f };\n        __constant__ int   c_XYZ2sRGB_D65i[9] = { 13273, -6296, -2042, -3970, 7684, 170, 228, -836, 4331 };\n\n        template <int bidx, typename T, typename D> static __device__ __forceinline__ void XYZ2RGBConvert(const T& src, D* dst)\n        {\n            dst[bidx^2] = saturate_cast<D>(CV_DESCALE(src.x * c_XYZ2sRGB_D65i[0] + src.y * c_XYZ2sRGB_D65i[1] + src.z * c_XYZ2sRGB_D65i[2], xyz_shift));\n            dst[1]      = saturate_cast<D>(CV_DESCALE(src.x * c_XYZ2sRGB_D65i[3] + src.y * c_XYZ2sRGB_D65i[4] + src.z * c_XYZ2sRGB_D65i[5], xyz_shift));\n            dst[bidx]   = saturate_cast<D>(CV_DESCALE(src.x * c_XYZ2sRGB_D65i[6] + src.y * c_XYZ2sRGB_D65i[7] + src.z * c_XYZ2sRGB_D65i[8], xyz_shift));\n        }\n\n        template <int bidx> static __device__ __forceinline__ uint XYZ2RGBConvert(uint src)\n        {\n            const int x = 0xff & src;\n            const int y = 0xff & (src >> 8);\n            const int z = 0xff & (src >> 16);\n\n            const uint r = saturate_cast<uchar>(CV_DESCALE(x * c_XYZ2sRGB_D65i[0] + y * c_XYZ2sRGB_D65i[1] + z * c_XYZ2sRGB_D65i[2], xyz_shift));\n            const uint g = saturate_cast<uchar>(CV_DESCALE(x * c_XYZ2sRGB_D65i[3] + y * c_XYZ2sRGB_D65i[4] + z * c_XYZ2sRGB_D65i[5], xyz_shift));\n            const uint b = saturate_cast<uchar>(CV_DESCALE(x * c_XYZ2sRGB_D65i[6] + y * c_XYZ2sRGB_D65i[7] + z * c_XYZ2sRGB_D65i[8], xyz_shift));\n\n            uint dst = 0xffu << 24;\n\n            dst |= b << (bidx * 8);\n            dst |= g << 8;\n            dst |= r << ((bidx ^ 2) * 8);\n\n            return dst;\n        }\n\n        template <int bidx, typename T> static __device__ __forceinline__ void XYZ2RGBConvert(const T& src, float* dst)\n        {\n            dst[bidx^2] = src.x * c_XYZ2sRGB_D65f[0] + src.y * c_XYZ2sRGB_D65f[1] + src.z * c_XYZ2sRGB_D65f[2];\n            dst[1]      = src.x * c_XYZ2sRGB_D65f[3] + src.y * c_XYZ2sRGB_D65f[4] + src.z * c_XYZ2sRGB_D65f[5];\n            dst[bidx]   = src.x * c_XYZ2sRGB_D65f[6] + src.y * c_XYZ2sRGB_D65f[7] + src.z * c_XYZ2sRGB_D65f[8];\n        }\n\n        template <typename T, int scn, int dcn, int bidx> struct XYZ2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                XYZ2RGBConvert<bidx>(src, &dst.x);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ XYZ2RGB() {}\n            __host__ __device__ __forceinline__ XYZ2RGB(const XYZ2RGB&) {}\n        };\n\n        template <int bidx> struct XYZ2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return XYZ2RGBConvert<bidx>(src);\n            }\n            __host__ __device__ __forceinline__ XYZ2RGB() {}\n            __host__ __device__ __forceinline__ XYZ2RGB(const XYZ2RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_XYZ2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::XYZ2RGB<T, scn, dcn, bidx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n////////////////////////////////////// RGB <-> HSV ///////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ int c_HsvDivTable   [256] = {0, 1044480, 522240, 348160, 261120, 208896, 174080, 149211, 130560, 116053, 104448, 94953, 87040, 80345, 74606, 69632, 65280, 61440, 58027, 54973, 52224, 49737, 47476, 45412, 43520, 41779, 40172, 38684, 37303, 36017, 34816, 33693, 32640, 31651, 30720, 29842, 29013, 28229, 27486, 26782, 26112, 25475, 24869, 24290, 23738, 23211, 22706, 22223, 21760, 21316, 20890, 20480, 20086, 19707, 19342, 18991, 18651, 18324, 18008, 17703, 17408, 17123, 16846, 16579, 16320, 16069, 15825, 15589, 15360, 15137, 14921, 14711, 14507, 14308, 14115, 13926, 13743, 13565, 13391, 13221, 13056, 12895, 12738, 12584, 12434, 12288, 12145, 12006, 11869, 11736, 11605, 11478, 11353, 11231, 11111, 10995, 10880, 10768, 10658, 10550, 10445, 10341, 10240, 10141, 10043, 9947, 9854, 9761, 9671, 9582, 9495, 9410, 9326, 9243, 9162, 9082, 9004, 8927, 8852, 8777, 8704, 8632, 8561, 8492, 8423, 8356, 8290, 8224, 8160, 8097, 8034, 7973, 7913, 7853, 7795, 7737, 7680, 7624, 7569, 7514, 7461, 7408, 7355, 7304, 7253, 7203, 7154, 7105, 7057, 7010, 6963, 6917, 6872, 6827, 6782, 6739, 6695, 6653, 6611, 6569, 6528, 6487, 6447, 6408, 6369, 6330, 6292, 6254, 6217, 6180, 6144, 6108, 6073, 6037, 6003, 5968, 5935, 5901, 5868, 5835, 5803, 5771, 5739, 5708, 5677, 5646, 5615, 5585, 5556, 5526, 5497, 5468, 5440, 5412, 5384, 5356, 5329, 5302, 5275, 5249, 5222, 5196, 5171, 5145, 5120, 5095, 5070, 5046, 5022, 4998, 4974, 4950, 4927, 4904, 4881, 4858, 4836, 4813, 4791, 4769, 4748, 4726, 4705, 4684, 4663, 4642, 4622, 4601, 4581, 4561, 4541, 4522, 4502, 4483, 4464, 4445, 4426, 4407, 4389, 4370, 4352, 4334, 4316, 4298, 4281, 4263, 4246, 4229, 4212, 4195, 4178, 4161, 4145, 4128, 4112, 4096};\n        __constant__ int c_HsvDivTable180[256] = {0, 122880, 61440, 40960, 30720, 24576, 20480, 17554, 15360, 13653, 12288, 11171, 10240, 9452, 8777, 8192, 7680, 7228, 6827, 6467, 6144, 5851, 5585, 5343, 5120, 4915, 4726, 4551, 4389, 4237, 4096, 3964, 3840, 3724, 3614, 3511, 3413, 3321, 3234, 3151, 3072, 2997, 2926, 2858, 2793, 2731, 2671, 2614, 2560, 2508, 2458, 2409, 2363, 2318, 2276, 2234, 2194, 2156, 2119, 2083, 2048, 2014, 1982, 1950, 1920, 1890, 1862, 1834, 1807, 1781, 1755, 1731, 1707, 1683, 1661, 1638, 1617, 1596, 1575, 1555, 1536, 1517, 1499, 1480, 1463, 1446, 1429, 1412, 1396, 1381, 1365, 1350, 1336, 1321, 1307, 1293, 1280, 1267, 1254, 1241, 1229, 1217, 1205, 1193, 1182, 1170, 1159, 1148, 1138, 1127, 1117, 1107, 1097, 1087, 1078, 1069, 1059, 1050, 1041, 1033, 1024, 1016, 1007, 999, 991, 983, 975, 968, 960, 953, 945, 938, 931, 924, 917, 910, 904, 897, 890, 884, 878, 871, 865, 859, 853, 847, 842, 836, 830, 825, 819, 814, 808, 803, 798, 793, 788, 783, 778, 773, 768, 763, 759, 754, 749, 745, 740, 736, 731, 727, 723, 719, 714, 710, 706, 702, 698, 694, 690, 686, 683, 679, 675, 671, 668, 664, 661, 657, 654, 650, 647, 643, 640, 637, 633, 630, 627, 624, 621, 617, 614, 611, 608, 605, 602, 599, 597, 594, 591, 588, 585, 582, 580, 577, 574, 572, 569, 566, 564, 561, 559, 556, 554, 551, 549, 546, 544, 541, 539, 537, 534, 532, 530, 527, 525, 523, 521, 518, 516, 514, 512, 510, 508, 506, 504, 502, 500, 497, 495, 493, 492, 490, 488, 486, 484, 482};\n        __constant__ int c_HsvDivTable256[256] = {0, 174763, 87381, 58254, 43691, 34953, 29127, 24966, 21845, 19418, 17476, 15888, 14564, 13443, 12483, 11651, 10923, 10280, 9709, 9198, 8738, 8322, 7944, 7598, 7282, 6991, 6722, 6473, 6242, 6026, 5825, 5638, 5461, 5296, 5140, 4993, 4855, 4723, 4599, 4481, 4369, 4263, 4161, 4064, 3972, 3884, 3799, 3718, 3641, 3567, 3495, 3427, 3361, 3297, 3236, 3178, 3121, 3066, 3013, 2962, 2913, 2865, 2819, 2774, 2731, 2689, 2648, 2608, 2570, 2533, 2497, 2461, 2427, 2394, 2362, 2330, 2300, 2270, 2241, 2212, 2185, 2158, 2131, 2106, 2081, 2056, 2032, 2009, 1986, 1964, 1942, 1920, 1900, 1879, 1859, 1840, 1820, 1802, 1783, 1765, 1748, 1730, 1713, 1697, 1680, 1664, 1649, 1633, 1618, 1603, 1589, 1574, 1560, 1547, 1533, 1520, 1507, 1494, 1481, 1469, 1456, 1444, 1432, 1421, 1409, 1398, 1387, 1376, 1365, 1355, 1344, 1334, 1324, 1314, 1304, 1295, 1285, 1276, 1266, 1257, 1248, 1239, 1231, 1222, 1214, 1205, 1197, 1189, 1181, 1173, 1165, 1157, 1150, 1142, 1135, 1128, 1120, 1113, 1106, 1099, 1092, 1085, 1079, 1072, 1066, 1059, 1053, 1046, 1040, 1034, 1028, 1022, 1016, 1010, 1004, 999, 993, 987, 982, 976, 971, 966, 960, 955, 950, 945, 940, 935, 930, 925, 920, 915, 910, 906, 901, 896, 892, 887, 883, 878, 874, 869, 865, 861, 857, 853, 848, 844, 840, 836, 832, 828, 824, 820, 817, 813, 809, 805, 802, 798, 794, 791, 787, 784, 780, 777, 773, 770, 767, 763, 760, 757, 753, 750, 747, 744, 741, 737, 734, 731, 728, 725, 722, 719, 716, 713, 710, 708, 705, 702, 699, 696, 694, 691, 688, 685};\n\n        template <int bidx, int hr, typename D> static __device__ void RGB2HSVConvert(const uchar* src, D& dst)\n        {\n            const int hsv_shift = 12;\n            const int* hdiv_table = hr == 180 ? c_HsvDivTable180 : c_HsvDivTable256;\n\n            int b = src[bidx], g = src[1], r = src[bidx^2];\n            int h, s, v = b;\n            int vmin = b, diff;\n            int vr, vg;\n\n            v = ::max(v, g);\n            v = ::max(v, r);\n            vmin = ::min(vmin, g);\n            vmin = ::min(vmin, r);\n\n            diff = v - vmin;\n            vr = (v == r) * -1;\n            vg = (v == g) * -1;\n\n            s = (diff * c_HsvDivTable[v] + (1 << (hsv_shift-1))) >> hsv_shift;\n            h = (vr & (g - b)) + (~vr & ((vg & (b - r + 2 * diff)) + ((~vg) & (r - g + 4 * diff))));\n            h = (h * hdiv_table[diff] + (1 << (hsv_shift-1))) >> hsv_shift;\n            h += (h < 0) * hr;\n\n            dst.x = saturate_cast<uchar>(h);\n            dst.y = (uchar)s;\n            dst.z = (uchar)v;\n        }\n\n        template <int bidx, int hr> static __device__ uint RGB2HSVConvert(uint src)\n        {\n            const int hsv_shift = 12;\n            const int* hdiv_table = hr == 180 ? c_HsvDivTable180 : c_HsvDivTable256;\n\n            const int b = 0xff & (src >> (bidx * 8));\n            const int g = 0xff & (src >> 8);\n            const int r = 0xff & (src >> ((bidx ^ 2) * 8));\n\n            int h, s, v = b;\n            int vmin = b, diff;\n            int vr, vg;\n\n            v = ::max(v, g);\n            v = ::max(v, r);\n            vmin = ::min(vmin, g);\n            vmin = ::min(vmin, r);\n\n            diff = v - vmin;\n            vr = (v == r) * -1;\n            vg = (v == g) * -1;\n\n            s = (diff * c_HsvDivTable[v] + (1 << (hsv_shift-1))) >> hsv_shift;\n            h = (vr & (g - b)) + (~vr & ((vg & (b - r + 2 * diff)) + ((~vg) & (r - g + 4 * diff))));\n            h = (h * hdiv_table[diff] + (1 << (hsv_shift-1))) >> hsv_shift;\n            h += (h < 0) * hr;\n\n            uint dst = 0;\n\n            dst |= saturate_cast<uchar>(h);\n            dst |= (0xffu & s) << 8;\n            dst |= (0xffu & v) << 16;\n\n            return dst;\n        }\n\n        template <int bidx, int hr, typename D> static __device__ void RGB2HSVConvert(const float* src, D& dst)\n        {\n            const float hscale = hr * (1.f / 360.f);\n\n            float b = src[bidx], g = src[1], r = src[bidx^2];\n            float h, s, v;\n\n            float vmin, diff;\n\n            v = vmin = r;\n            v = fmax(v, g);\n            v = fmax(v, b);\n            vmin = fmin(vmin, g);\n            vmin = fmin(vmin, b);\n\n            diff = v - vmin;\n            s = diff / (float)(::fabs(v) + numeric_limits<float>::epsilon());\n            diff = (float)(60. / (diff + numeric_limits<float>::epsilon()));\n\n            h  = (v == r) * (g - b) * diff;\n            h += (v != r && v == g) * ((b - r) * diff + 120.f);\n            h += (v != r && v != g) * ((r - g) * diff + 240.f);\n            h += (h < 0) * 360.f;\n\n            dst.x = h * hscale;\n            dst.y = s;\n            dst.z = v;\n        }\n\n        template <typename T, int scn, int dcn, int bidx, int hr> struct RGB2HSV\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                RGB2HSVConvert<bidx, hr>(&src.x, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB2HSV() {}\n            __host__ __device__ __forceinline__ RGB2HSV(const RGB2HSV&) {}\n        };\n\n        template <int bidx, int hr> struct RGB2HSV<uchar, 4, 4, bidx, hr> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return RGB2HSVConvert<bidx, hr>(src);\n            }\n            __host__ __device__ __forceinline__ RGB2HSV() {}\n            __host__ __device__ __forceinline__ RGB2HSV(const RGB2HSV&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2HSV_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2HSV<T, scn, dcn, bidx, 180> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <typename T> struct name ## _full_traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2HSV<T, scn, dcn, bidx, 256> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _traits<float> \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2HSV<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _full_traits<float> \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2HSV<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ int c_HsvSectorData[6][3] = { {1,3,0}, {1,0,2}, {3,0,1}, {0,2,1}, {0,1,3}, {2,1,0} };\n\n        template <int bidx, int hr, typename T> static __device__ void HSV2RGBConvert(const T& src, float* dst)\n        {\n            const float hscale = 6.f / hr;\n\n            float h = src.x, s = src.y, v = src.z;\n            float b = v, g = v, r = v;\n\n            if (s != 0)\n            {\n                h *= hscale;\n\n                if( h < 0 )\n                    do h += 6; while( h < 0 );\n                else if( h >= 6 )\n                    do h -= 6; while( h >= 6 );\n\n                int sector = __float2int_rd(h);\n                h -= sector;\n\n                if ( (unsigned)sector >= 6u )\n                {\n                    sector = 0;\n                    h = 0.f;\n                }\n\n                float tab[4];\n                tab[0] = v;\n                tab[1] = v * (1.f - s);\n                tab[2] = v * (1.f - s * h);\n                tab[3] = v * (1.f - s * (1.f - h));\n\n                b = tab[c_HsvSectorData[sector][0]];\n                g = tab[c_HsvSectorData[sector][1]];\n                r = tab[c_HsvSectorData[sector][2]];\n            }\n\n            dst[bidx] = b;\n            dst[1] = g;\n            dst[bidx^2] = r;\n        }\n\n        template <int bidx, int HR, typename T> static __device__ void HSV2RGBConvert(const T& src, uchar* dst)\n        {\n            float3 buf;\n\n            buf.x = src.x;\n            buf.y = src.y * (1.f / 255.f);\n            buf.z = src.z * (1.f / 255.f);\n\n            HSV2RGBConvert<bidx, HR>(buf, &buf.x);\n\n            dst[0] = saturate_cast<uchar>(buf.x * 255.f);\n            dst[1] = saturate_cast<uchar>(buf.y * 255.f);\n            dst[2] = saturate_cast<uchar>(buf.z * 255.f);\n        }\n\n        template <int bidx, int hr> static __device__ uint HSV2RGBConvert(uint src)\n        {\n            float3 buf;\n\n            buf.x = src & 0xff;\n            buf.y = ((src >> 8) & 0xff) * (1.f/255.f);\n            buf.z = ((src >> 16) & 0xff) * (1.f/255.f);\n\n            HSV2RGBConvert<bidx, hr>(buf, &buf.x);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(buf.x * 255.f);\n            dst |= saturate_cast<uchar>(buf.y * 255.f) << 8;\n            dst |= saturate_cast<uchar>(buf.z * 255.f) << 16;\n\n            return dst;\n        }\n\n        template <typename T, int scn, int dcn, int bidx, int hr> struct HSV2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                HSV2RGBConvert<bidx, hr>(src, &dst.x);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ HSV2RGB() {}\n            __host__ __device__ __forceinline__ HSV2RGB(const HSV2RGB&) {}\n        };\n\n        template <int bidx, int hr> struct HSV2RGB<uchar, 4, 4, bidx, hr> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return HSV2RGBConvert<bidx, hr>(src);\n            }\n            __host__ __device__ __forceinline__ HSV2RGB() {}\n            __host__ __device__ __forceinline__ HSV2RGB(const HSV2RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_HSV2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::HSV2RGB<T, scn, dcn, bidx, 180> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <typename T> struct name ## _full_traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::HSV2RGB<T, scn, dcn, bidx, 255> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _traits<float> \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::HSV2RGB<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _full_traits<float> \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::HSV2RGB<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n/////////////////////////////////////// RGB <-> HLS ////////////////////////////////////////\n\n    namespace color_detail\n    {\n        template <int bidx, int hr, typename D> static __device__ void RGB2HLSConvert(const float* src, D& dst)\n        {\n            const float hscale = hr * (1.f / 360.f);\n\n            float b = src[bidx], g = src[1], r = src[bidx^2];\n            float h = 0.f, s = 0.f, l;\n            float vmin, vmax, diff;\n\n            vmax = vmin = r;\n            vmax = fmax(vmax, g);\n            vmax = fmax(vmax, b);\n            vmin = fmin(vmin, g);\n            vmin = fmin(vmin, b);\n\n            diff = vmax - vmin;\n            l = (vmax + vmin) * 0.5f;\n\n            if (diff > numeric_limits<float>::epsilon())\n            {\n                s = (l < 0.5f) * diff / (vmax + vmin);\n                s += (l >= 0.5f) * diff / (2.0f - vmax - vmin);\n\n                diff = 60.f / diff;\n\n                h  = (vmax == r) * (g - b) * diff;\n                h += (vmax != r && vmax == g) * ((b - r) * diff + 120.f);\n                h += (vmax != r && vmax != g) * ((r - g) * diff + 240.f);\n                h += (h < 0.f) * 360.f;\n            }\n\n            dst.x = h * hscale;\n            dst.y = l;\n            dst.z = s;\n        }\n\n        template <int bidx, int hr, typename D> static __device__ void RGB2HLSConvert(const uchar* src, D& dst)\n        {\n            float3 buf;\n\n            buf.x = src[0] * (1.f / 255.f);\n            buf.y = src[1] * (1.f / 255.f);\n            buf.z = src[2] * (1.f / 255.f);\n\n            RGB2HLSConvert<bidx, hr>(&buf.x, buf);\n\n            dst.x = saturate_cast<uchar>(buf.x);\n            dst.y = saturate_cast<uchar>(buf.y*255.f);\n            dst.z = saturate_cast<uchar>(buf.z*255.f);\n        }\n\n        template <int bidx, int hr> static __device__ uint RGB2HLSConvert(uint src)\n        {\n            float3 buf;\n\n            buf.x = (0xff & src) * (1.f / 255.f);\n            buf.y = (0xff & (src >> 8)) * (1.f / 255.f);\n            buf.z = (0xff & (src >> 16)) * (1.f / 255.f);\n\n            RGB2HLSConvert<bidx, hr>(&buf.x, buf);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(buf.x);\n            dst |= saturate_cast<uchar>(buf.y * 255.f) << 8;\n            dst |= saturate_cast<uchar>(buf.z * 255.f) << 16;\n\n            return dst;\n        }\n\n        template <typename T, int scn, int dcn, int bidx, int hr> struct RGB2HLS\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                RGB2HLSConvert<bidx, hr>(&src.x, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB2HLS() {}\n            __host__ __device__ __forceinline__ RGB2HLS(const RGB2HLS&) {}\n        };\n\n        template <int bidx, int hr> struct RGB2HLS<uchar, 4, 4, bidx, hr> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return RGB2HLSConvert<bidx, hr>(src);\n            }\n            __host__ __device__ __forceinline__ RGB2HLS() {}\n            __host__ __device__ __forceinline__ RGB2HLS(const RGB2HLS&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2HLS_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2HLS<T, scn, dcn, bidx, 180> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <typename T> struct name ## _full_traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2HLS<T, scn, dcn, bidx, 256> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _traits<float> \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2HLS<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _full_traits<float> \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2HLS<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ int c_HlsSectorData[6][3] = { {1,3,0}, {1,0,2}, {3,0,1}, {0,2,1}, {0,1,3}, {2,1,0} };\n\n        template <int bidx, int hr, typename T> static __device__ void HLS2RGBConvert(const T& src, float* dst)\n        {\n            const float hscale = 6.0f / hr;\n\n            float h = src.x, l = src.y, s = src.z;\n            float b = l, g = l, r = l;\n\n            if (s != 0)\n            {\n                float p2  = (l <= 0.5f) * l * (1 + s);\n                      p2 += (l > 0.5f) * (l + s - l * s);\n                float p1 = 2 * l - p2;\n\n                h *= hscale;\n\n                if( h < 0 )\n                    do h += 6; while( h < 0 );\n                else if( h >= 6 )\n                    do h -= 6; while( h >= 6 );\n\n                int sector;\n                sector = __float2int_rd(h);\n\n                h -= sector;\n\n                float tab[4];\n                tab[0] = p2;\n                tab[1] = p1;\n                tab[2] = p1 + (p2 - p1) * (1 - h);\n                tab[3] = p1 + (p2 - p1) * h;\n\n                b = tab[c_HlsSectorData[sector][0]];\n                g = tab[c_HlsSectorData[sector][1]];\n                r = tab[c_HlsSectorData[sector][2]];\n            }\n\n            dst[bidx] = b;\n            dst[1] = g;\n            dst[bidx^2] = r;\n        }\n\n        template <int bidx, int hr, typename T> static __device__ void HLS2RGBConvert(const T& src, uchar* dst)\n        {\n            float3 buf;\n\n            buf.x = src.x;\n            buf.y = src.y * (1.f / 255.f);\n            buf.z = src.z * (1.f / 255.f);\n\n            HLS2RGBConvert<bidx, hr>(buf, &buf.x);\n\n            dst[0] = saturate_cast<uchar>(buf.x * 255.f);\n            dst[1] = saturate_cast<uchar>(buf.y * 255.f);\n            dst[2] = saturate_cast<uchar>(buf.z * 255.f);\n        }\n\n        template <int bidx, int hr> static __device__ uint HLS2RGBConvert(uint src)\n        {\n            float3 buf;\n\n            buf.x = 0xff & src;\n            buf.y = (0xff & (src >> 8)) * (1.f / 255.f);\n            buf.z = (0xff & (src >> 16)) * (1.f / 255.f);\n\n            HLS2RGBConvert<bidx, hr>(buf, &buf.x);\n\n            uint dst = 0xffu << 24;\n\n            dst |= saturate_cast<uchar>(buf.x * 255.f);\n            dst |= saturate_cast<uchar>(buf.y * 255.f) << 8;\n            dst |= saturate_cast<uchar>(buf.z * 255.f) << 16;\n\n            return dst;\n        }\n\n        template <typename T, int scn, int dcn, int bidx, int hr> struct HLS2RGB\n            : unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<T, dcn>::vec_type operator()(const typename TypeVec<T, scn>::vec_type& src) const\n            {\n                typename TypeVec<T, dcn>::vec_type dst;\n\n                HLS2RGBConvert<bidx, hr>(src, &dst.x);\n                setAlpha(dst, ColorChannel<T>::max());\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ HLS2RGB() {}\n            __host__ __device__ __forceinline__ HLS2RGB(const HLS2RGB&) {}\n        };\n\n        template <int bidx, int hr> struct HLS2RGB<uchar, 4, 4, bidx, hr> : unary_function<uint, uint>\n        {\n            __device__ __forceinline__ uint operator()(uint src) const\n            {\n                return HLS2RGBConvert<bidx, hr>(src);\n            }\n            __host__ __device__ __forceinline__ HLS2RGB() {}\n            __host__ __device__ __forceinline__ HLS2RGB(const HLS2RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_HLS2RGB_TRAITS(name, scn, dcn, bidx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::HLS2RGB<T, scn, dcn, bidx, 180> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <typename T> struct name ## _full_traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::HLS2RGB<T, scn, dcn, bidx, 255> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _traits<float> \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::HLS2RGB<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    }; \\\n    template <> struct name ## _full_traits<float> \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::HLS2RGB<float, scn, dcn, bidx, 360> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////////// RGB <-> Lab /////////////////////////////////////\n\n    namespace color_detail\n    {\n        enum\n        {\n            LAB_CBRT_TAB_SIZE = 1024,\n            GAMMA_TAB_SIZE = 1024,\n            lab_shift = xyz_shift,\n            gamma_shift = 3,\n            lab_shift2 = (lab_shift + gamma_shift),\n            LAB_CBRT_TAB_SIZE_B = (256 * 3 / 2 * (1 << gamma_shift))\n        };\n\n        __constant__ ushort c_sRGBGammaTab_b[] = {0,1,1,2,2,3,4,4,5,6,6,7,8,8,9,10,11,11,12,13,14,15,16,17,19,20,21,22,24,25,26,28,29,31,33,34,36,38,40,41,43,45,47,49,51,54,56,58,60,63,65,68,70,73,75,78,81,83,86,89,92,95,98,101,105,108,111,115,118,121,125,129,132,136,140,144,147,151,155,160,164,168,172,176,181,185,190,194,199,204,209,213,218,223,228,233,239,244,249,255,260,265,271,277,282,288,294,300,306,312,318,324,331,337,343,350,356,363,370,376,383,390,397,404,411,418,426,433,440,448,455,463,471,478,486,494,502,510,518,527,535,543,552,560,569,578,586,595,604,613,622,631,641,650,659,669,678,688,698,707,717,727,737,747,757,768,778,788,799,809,820,831,842,852,863,875,886,897,908,920,931,943,954,966,978,990,1002,1014,1026,1038,1050,1063,1075,1088,1101,1113,1126,1139,1152,1165,1178,1192,1205,1218,1232,1245,1259,1273,1287,1301,1315,1329,1343,1357,1372,1386,1401,1415,1430,1445,1460,1475,1490,1505,1521,1536,1551,1567,1583,1598,1614,1630,1646,1662,1678,1695,1711,1728,1744,1761,1778,1794,1811,1828,1846,1863,1880,1897,1915,1933,1950,1968,1986,2004,2022,2040};\n\n        __device__ __forceinline__ int LabCbrt_b(int i)\n        {\n            float x = i * (1.f / (255.f * (1 << gamma_shift)));\n            return (1 << lab_shift2) * (x < 0.008856f ? x * 7.787f + 0.13793103448275862f : ::cbrtf(x));\n        }\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void RGB2LabConvert_b(const T& src, D& dst)\n        {\n            const int Lscale = (116 * 255 + 50) / 100;\n            const int Lshift = -((16 * 255 * (1 << lab_shift2) + 50) / 100);\n\n            int B = blueIdx == 0 ? src.x : src.z;\n            int G = src.y;\n            int R = blueIdx == 0 ? src.z : src.x;\n\n            if (srgb)\n            {\n                B = c_sRGBGammaTab_b[B];\n                G = c_sRGBGammaTab_b[G];\n                R = c_sRGBGammaTab_b[R];\n            }\n            else\n            {\n                B <<= 3;\n                G <<= 3;\n                R <<= 3;\n            }\n\n            int fX = LabCbrt_b(CV_DESCALE(B * 778 + G * 1541 + R * 1777, lab_shift));\n            int fY = LabCbrt_b(CV_DESCALE(B * 296 + G * 2929 + R * 871, lab_shift));\n            int fZ = LabCbrt_b(CV_DESCALE(B * 3575 + G * 448 + R * 73, lab_shift));\n\n            int L = CV_DESCALE(Lscale * fY + Lshift, lab_shift2);\n            int a = CV_DESCALE(500 * (fX - fY) + 128 * (1 << lab_shift2), lab_shift2);\n            int b = CV_DESCALE(200 * (fY - fZ) + 128 * (1 << lab_shift2), lab_shift2);\n\n            dst.x = saturate_cast<uchar>(L);\n            dst.y = saturate_cast<uchar>(a);\n            dst.z = saturate_cast<uchar>(b);\n        }\n\n        __device__ __forceinline__ float splineInterpolate(float x, const float* tab, int n)\n        {\n            int ix = ::min(::max(int(x), 0), n-1);\n            x -= ix;\n            tab += ix * 4;\n            return ((tab[3] * x + tab[2]) * x + tab[1]) * x + tab[0];\n        }\n\n        __constant__ float c_sRGBGammaTab[] = {0,7.55853e-05,0.,-7.51331e-13,7.55853e-05,7.55853e-05,-2.25399e-12,3.75665e-12,0.000151171,7.55853e-05,9.01597e-12,-6.99932e-12,0.000226756,7.55853e-05,-1.1982e-11,2.41277e-12,0.000302341,7.55853e-05,-4.74369e-12,1.19001e-11,0.000377927,7.55853e-05,3.09568e-11,-2.09095e-11,0.000453512,7.55853e-05,-3.17718e-11,1.35303e-11,0.000529097,7.55853e-05,8.81905e-12,-4.10782e-12,0.000604683,7.55853e-05,-3.50439e-12,2.90097e-12,0.000680268,7.55853e-05,5.19852e-12,-7.49607e-12,0.000755853,7.55853e-05,-1.72897e-11,2.70833e-11,0.000831439,7.55854e-05,6.39602e-11,-4.26295e-11,0.000907024,7.55854e-05,-6.39282e-11,2.70193e-11,0.000982609,7.55853e-05,1.71298e-11,-7.24017e-12,0.00105819,7.55853e-05,-4.59077e-12,1.94137e-12,0.00113378,7.55853e-05,1.23333e-12,-5.25291e-13,0.00120937,7.55853e-05,-3.42545e-13,1.59799e-13,0.00128495,7.55853e-05,1.36852e-13,-1.13904e-13,0.00136054,7.55853e-05,-2.04861e-13,2.95818e-13,0.00143612,7.55853e-05,6.82594e-13,-1.06937e-12,0.00151171,7.55853e-05,-2.52551e-12,3.98166e-12,0.00158729,7.55853e-05,9.41946e-12,-1.48573e-11,0.00166288,7.55853e-05,-3.51523e-11,5.54474e-11,0.00173846,7.55854e-05,1.3119e-10,-9.0517e-11,0.00181405,7.55854e-05,-1.40361e-10,7.37899e-11,0.00188963,7.55853e-05,8.10085e-11,-8.82272e-11,0.00196522,7.55852e-05,-1.83673e-10,1.62704e-10,0.0020408,7.55853e-05,3.04438e-10,-2.13341e-10,0.00211639,7.55853e-05,-3.35586e-10,2.25e-10,0.00219197,7.55853e-05,3.39414e-10,-2.20997e-10,0.00226756,7.55853e-05,-3.23576e-10,1.93326e-10,0.00234315,7.55853e-05,2.564e-10,-8.66446e-11,0.00241873,7.55855e-05,-3.53328e-12,-7.9578e-11,0.00249432,7.55853e-05,-2.42267e-10,1.72126e-10,0.0025699,7.55853e-05,2.74111e-10,-1.43265e-10,0.00264549,7.55854e-05,-1.55683e-10,-6.47292e-11,0.00272107,7.55849e-05,-3.4987e-10,8.67842e-10,0.00279666,7.55868e-05,2.25366e-09,-3.8723e-09,0.00287224,7.55797e-05,-9.36325e-09,1.5087e-08,0.00294783,7.56063e-05,3.58978e-08,-5.69415e-08,0.00302341,7.55072e-05,-1.34927e-07,2.13144e-07,0.003099,7.58768e-05,5.04507e-07,1.38713e-07,0.00317552,7.7302e-05,9.20646e-07,-1.55186e-07,0.00325359,7.86777e-05,4.55087e-07,4.26813e-08,0.00333276,7.97159e-05,5.83131e-07,-1.06495e-08,0.00341305,8.08502e-05,5.51182e-07,3.87467e-09,0.00349446,8.19642e-05,5.62806e-07,-1.92586e-10,0.00357698,8.30892e-05,5.62228e-07,1.0866e-09,0.00366063,8.4217e-05,5.65488e-07,5.02818e-10,0.00374542,8.53494e-05,5.66997e-07,8.60211e-10,0.00383133,8.6486e-05,5.69577e-07,7.13044e-10,0.00391839,8.76273e-05,5.71716e-07,4.78527e-10,0.00400659,8.87722e-05,5.73152e-07,1.09818e-09,0.00409594,8.99218e-05,5.76447e-07,2.50964e-10,0.00418644,9.10754e-05,5.772e-07,1.15762e-09,0.00427809,9.22333e-05,5.80672e-07,2.40865e-10,0.0043709,9.33954e-05,5.81395e-07,1.13854e-09,0.00446488,9.45616e-05,5.84811e-07,3.27267e-10,0.00456003,9.57322e-05,5.85792e-07,8.1197e-10,0.00465635,9.69062e-05,5.88228e-07,6.15823e-10,0.00475384,9.80845e-05,5.90076e-07,9.15747e-10,0.00485252,9.92674e-05,5.92823e-07,3.778e-10,0.00495238,0.000100454,5.93956e-07,8.32623e-10,0.00505343,0.000101645,5.96454e-07,4.82695e-10,0.00515567,0.000102839,5.97902e-07,9.61904e-10,0.00525911,0.000104038,6.00788e-07,3.26281e-10,0.00536375,0.00010524,6.01767e-07,9.926e-10,0.00546959,0.000106447,6.04745e-07,3.59933e-10,0.00557664,0.000107657,6.05824e-07,8.2728e-10,0.0056849,0.000108871,6.08306e-07,5.21898e-10,0.00579438,0.00011009,6.09872e-07,8.10492e-10,0.00590508,0.000111312,6.12303e-07,4.27046e-10,0.00601701,0.000112538,6.13585e-07,7.40878e-10,0.00613016,0.000113767,6.15807e-07,8.00469e-10,0.00624454,0.000115001,6.18209e-07,2.48178e-10,0.00636016,0.000116238,6.18953e-07,1.00073e-09,0.00647702,0.000117479,6.21955e-07,4.05654e-10,0.00659512,0.000118724,6.23172e-07,6.36192e-10,0.00671447,0.000119973,6.25081e-07,7.74927e-10,0.00683507,0.000121225,6.27406e-07,4.54975e-10,0.00695692,0.000122481,6.28771e-07,6.64841e-10,0.00708003,0.000123741,6.30765e-07,6.10972e-10,0.00720441,0.000125004,6.32598e-07,6.16543e-10,0.00733004,0.000126271,6.34448e-07,6.48204e-10,0.00745695,0.000127542,6.36392e-07,5.15835e-10,0.00758513,0.000128816,6.3794e-07,5.48103e-10,0.00771458,0.000130094,6.39584e-07,1.01706e-09,0.00784532,0.000131376,6.42635e-07,4.0283e-11,0.00797734,0.000132661,6.42756e-07,6.84471e-10,0.00811064,0.000133949,6.4481e-07,9.47144e-10,0.00824524,0.000135241,6.47651e-07,1.83472e-10,0.00838112,0.000136537,6.48201e-07,1.11296e-09,0.00851831,0.000137837,6.5154e-07,2.13163e-11,0.0086568,0.00013914,6.51604e-07,6.64462e-10,0.00879659,0.000140445,6.53598e-07,1.04613e-09,0.00893769,0.000141756,6.56736e-07,-1.92377e-10,0.0090801,0.000143069,6.56159e-07,1.58601e-09,0.00922383,0.000144386,6.60917e-07,-5.63754e-10,0.00936888,0.000145706,6.59226e-07,1.60033e-09,0.00951524,0.000147029,6.64027e-07,-2.49543e-10,0.00966294,0.000148356,6.63278e-07,1.26043e-09,0.00981196,0.000149687,6.67059e-07,-1.35572e-10,0.00996231,0.00015102,6.66653e-07,1.14458e-09,0.010114,0.000152357,6.70086e-07,2.13864e-10,0.010267,0.000153698,6.70728e-07,7.93856e-10,0.0104214,0.000155042,6.73109e-07,3.36077e-10,0.0105771,0.000156389,6.74118e-07,6.55765e-10,0.0107342,0.000157739,6.76085e-07,7.66211e-10,0.0108926,0.000159094,6.78384e-07,4.66116e-12,0.0110524,0.000160451,6.78398e-07,1.07775e-09,0.0112135,0.000161811,6.81631e-07,3.41023e-10,0.011376,0.000163175,6.82654e-07,3.5205e-10,0.0115398,0.000164541,6.8371e-07,1.04473e-09,0.0117051,0.000165912,6.86844e-07,1.25757e-10,0.0118717,0.000167286,6.87222e-07,3.14818e-10,0.0120396,0.000168661,6.88166e-07,1.40886e-09,0.012209,0.000170042,6.92393e-07,-3.62244e-10,0.0123797,0.000171425,6.91306e-07,9.71397e-10,0.0125518,0.000172811,6.9422e-07,2.02003e-10,0.0127253,0.0001742,6.94826e-07,1.01448e-09,0.0129002,0.000175593,6.97869e-07,3.96653e-10,0.0130765,0.00017699,6.99059e-07,1.92927e-10,0.0132542,0.000178388,6.99638e-07,6.94305e-10,0.0134333,0.00017979,7.01721e-07,7.55108e-10,0.0136138,0.000181195,7.03986e-07,1.05918e-11,0.0137957,0.000182603,7.04018e-07,1.06513e-09,0.013979,0.000184015,7.07214e-07,3.85512e-10,0.0141637,0.00018543,7.0837e-07,1.86769e-10,0.0143499,0.000186848,7.0893e-07,7.30116e-10,0.0145374,0.000188268,7.11121e-07,6.17983e-10,0.0147264,0.000189692,7.12975e-07,5.23282e-10,0.0149168,0.000191119,7.14545e-07,8.28398e-11,0.0151087,0.000192549,7.14793e-07,1.0081e-09,0.0153019,0.000193981,7.17817e-07,5.41244e-10,0.0154966,0.000195418,7.19441e-07,-3.7907e-10,0.0156928,0.000196856,7.18304e-07,1.90641e-09,0.0158903,0.000198298,7.24023e-07,-7.27387e-10,0.0160893,0.000199744,7.21841e-07,1.00317e-09,0.0162898,0.000201191,7.24851e-07,4.39949e-10,0.0164917,0.000202642,7.2617e-07,9.6234e-10,0.0166951,0.000204097,7.29057e-07,-5.64019e-10,0.0168999,0.000205554,7.27365e-07,1.29374e-09,0.0171062,0.000207012,7.31247e-07,9.77025e-10,0.017314,0.000208478,7.34178e-07,-1.47651e-09,0.0175232,0.000209942,7.29748e-07,3.06636e-09,0.0177338,0.00021141,7.38947e-07,-1.47573e-09,0.017946,0.000212884,7.3452e-07,9.7386e-10,0.0181596,0.000214356,7.37442e-07,1.30562e-09,0.0183747,0.000215835,7.41358e-07,-6.08376e-10,0.0185913,0.000217315,7.39533e-07,1.12785e-09,0.0188093,0.000218798,7.42917e-07,-1.77711e-10,0.0190289,0.000220283,7.42384e-07,1.44562e-09,0.0192499,0.000221772,7.46721e-07,-1.68825e-11,0.0194724,0.000223266,7.4667e-07,4.84533e-10,0.0196964,0.000224761,7.48124e-07,-5.85298e-11,0.0199219,0.000226257,7.47948e-07,1.61217e-09,0.0201489,0.000227757,7.52785e-07,-8.02136e-10,0.0203775,0.00022926,7.50378e-07,1.59637e-09,0.0206075,0.000230766,7.55167e-07,4.47168e-12,0.020839,0.000232276,7.55181e-07,2.48387e-10,0.021072,0.000233787,7.55926e-07,8.6474e-10,0.0213066,0.000235302,7.5852e-07,1.78299e-11,0.0215426,0.000236819,7.58573e-07,9.26567e-10,0.0217802,0.000238339,7.61353e-07,1.34529e-12,0.0220193,0.000239862,7.61357e-07,9.30659e-10,0.0222599,0.000241387,7.64149e-07,1.34529e-12,0.0225021,0.000242915,7.64153e-07,9.26567e-10,0.0227458,0.000244447,7.66933e-07,1.76215e-11,0.022991,0.00024598,7.66986e-07,8.65536e-10,0.0232377,0.000247517,7.69582e-07,2.45677e-10,0.023486,0.000249057,7.70319e-07,1.44193e-11,0.0237358,0.000250598,7.70363e-07,1.55918e-09,0.0239872,0.000252143,7.7504e-07,-6.63173e-10,0.0242401,0.000253691,7.73051e-07,1.09357e-09,0.0244946,0.000255241,7.76331e-07,1.41919e-11,0.0247506,0.000256793,7.76374e-07,7.12248e-10,0.0250082,0.000258348,7.78511e-07,8.62049e-10,0.0252673,0.000259908,7.81097e-07,-4.35061e-10,0.025528,0.000261469,7.79792e-07,8.7825e-10,0.0257902,0.000263031,7.82426e-07,6.47181e-10,0.0260541,0.000264598,7.84368e-07,2.58448e-10,0.0263194,0.000266167,7.85143e-07,1.81558e-10,0.0265864,0.000267738,7.85688e-07,8.78041e-10,0.0268549,0.000269312,7.88322e-07,3.15102e-11,0.027125,0.000270889,7.88417e-07,8.58525e-10,0.0273967,0.000272468,7.90992e-07,2.59812e-10,0.02767,0.000274051,7.91772e-07,-3.5224e-11,0.0279448,0.000275634,7.91666e-07,1.74377e-09,0.0282212,0.000277223,7.96897e-07,-1.35196e-09,0.0284992,0.000278813,7.92841e-07,1.80141e-09,0.0287788,0.000280404,7.98246e-07,-2.65629e-10,0.0290601,0.000281999,7.97449e-07,1.12374e-09,0.0293428,0.000283598,8.0082e-07,-5.04106e-10,0.0296272,0.000285198,7.99308e-07,8.92764e-10,0.0299132,0.000286799,8.01986e-07,6.58379e-10,0.0302008,0.000288405,8.03961e-07,1.98971e-10,0.0304901,0.000290014,8.04558e-07,4.08382e-10,0.0307809,0.000291624,8.05783e-07,3.01839e-11,0.0310733,0.000293236,8.05874e-07,1.33343e-09,0.0313673,0.000294851,8.09874e-07,2.2419e-10,0.031663,0.000296472,8.10547e-07,-3.67606e-10,0.0319603,0.000298092,8.09444e-07,1.24624e-09,0.0322592,0.000299714,8.13182e-07,-8.92025e-10,0.0325597,0.000301338,8.10506e-07,2.32183e-09,0.0328619,0.000302966,8.17472e-07,-9.44719e-10,0.0331657,0.000304598,8.14638e-07,1.45703e-09,0.0334711,0.000306232,8.19009e-07,-1.15805e-09,0.0337781,0.000307866,8.15535e-07,3.17507e-09,0.0340868,0.000309507,8.2506e-07,-4.09161e-09,0.0343971,0.000311145,8.12785e-07,5.74079e-09,0.0347091,0.000312788,8.30007e-07,-3.97034e-09,0.0350227,0.000314436,8.18096e-07,2.68985e-09,0.035338,0.00031608,8.26166e-07,6.61676e-10,0.0356549,0.000317734,8.28151e-07,-1.61123e-09,0.0359734,0.000319386,8.23317e-07,2.05786e-09,0.0362936,0.000321038,8.29491e-07,8.30388e-10,0.0366155,0.0003227,8.31982e-07,-1.65424e-09,0.036939,0.000324359,8.27019e-07,2.06129e-09,0.0372642,0.000326019,8.33203e-07,8.59719e-10,0.0375911,0.000327688,8.35782e-07,-1.77488e-09,0.0379196,0.000329354,8.30458e-07,2.51464e-09,0.0382498,0.000331023,8.38002e-07,-8.33135e-10,0.0385817,0.000332696,8.35502e-07,8.17825e-10,0.0389152,0.00033437,8.37956e-07,1.28718e-09,0.0392504,0.00033605,8.41817e-07,-2.2413e-09,0.0395873,0.000337727,8.35093e-07,3.95265e-09,0.0399258,0.000339409,8.46951e-07,-2.39332e-09,0.0402661,0.000341095,8.39771e-07,1.89533e-09,0.040608,0.000342781,8.45457e-07,-1.46271e-09,0.0409517,0.000344467,8.41069e-07,3.95554e-09,0.041297,0.000346161,8.52936e-07,-3.18369e-09,0.041644,0.000347857,8.43385e-07,1.32873e-09,0.0419927,0.000349548,8.47371e-07,1.59402e-09,0.0423431,0.000351248,8.52153e-07,-2.54336e-10,0.0426952,0.000352951,8.5139e-07,-5.76676e-10,0.043049,0.000354652,8.4966e-07,2.56114e-09,0.0434045,0.000356359,8.57343e-07,-2.21744e-09,0.0437617,0.000358067,8.50691e-07,2.58344e-09,0.0441206,0.000359776,8.58441e-07,-6.65826e-10,0.0444813,0.000361491,8.56444e-07,7.99218e-11,0.0448436,0.000363204,8.56684e-07,3.46063e-10,0.0452077,0.000364919,8.57722e-07,2.26116e-09,0.0455734,0.000366641,8.64505e-07,-1.94005e-09,0.045941,0.000368364,8.58685e-07,1.77384e-09,0.0463102,0.000370087,8.64007e-07,-1.43005e-09,0.0466811,0.000371811,8.59717e-07,3.94634e-09,0.0470538,0.000373542,8.71556e-07,-3.17946e-09,0.0474282,0.000375276,8.62017e-07,1.32104e-09,0.0478043,0.000377003,8.6598e-07,1.62045e-09,0.0481822,0.00037874,8.70842e-07,-3.52297e-10,0.0485618,0.000380481,8.69785e-07,-2.11211e-10,0.0489432,0.00038222,8.69151e-07,1.19716e-09,0.0493263,0.000383962,8.72743e-07,-8.52026e-10,0.0497111,0.000385705,8.70187e-07,2.21092e-09,0.0500977,0.000387452,8.76819e-07,-5.41339e-10,0.050486,0.000389204,8.75195e-07,-4.5361e-11,0.0508761,0.000390954,8.75059e-07,7.22669e-10,0.0512679,0.000392706,8.77227e-07,8.79936e-10,0.0516615,0.000394463,8.79867e-07,-5.17048e-10,0.0520568,0.000396222,8.78316e-07,1.18833e-09,0.0524539,0.000397982,8.81881e-07,-5.11022e-10,0.0528528,0.000399744,8.80348e-07,8.55683e-10,0.0532534,0.000401507,8.82915e-07,8.13562e-10,0.0536558,0.000403276,8.85356e-07,-3.84603e-10,0.05406,0.000405045,8.84202e-07,7.24962e-10,0.0544659,0.000406816,8.86377e-07,1.20986e-09,0.0548736,0.000408592,8.90006e-07,-1.83896e-09,0.0552831,0.000410367,8.84489e-07,2.42071e-09,0.0556944,0.000412143,8.91751e-07,-3.93413e-10,0.0561074,0.000413925,8.90571e-07,-8.46967e-10,0.0565222,0.000415704,8.8803e-07,3.78122e-09,0.0569388,0.000417491,8.99374e-07,-3.1021e-09,0.0573572,0.000419281,8.90068e-07,1.17658e-09,0.0577774,0.000421064,8.93597e-07,2.12117e-09,0.0581993,0.000422858,8.99961e-07,-2.21068e-09,0.0586231,0.000424651,8.93329e-07,2.9961e-09,0.0590486,0.000426447,9.02317e-07,-2.32311e-09,0.059476,0.000428244,8.95348e-07,2.57122e-09,0.0599051,0.000430043,9.03062e-07,-5.11098e-10,0.0603361,0.000431847,9.01528e-07,-5.27166e-10,0.0607688,0.000433649,8.99947e-07,2.61984e-09,0.0612034,0.000435457,9.07806e-07,-2.50141e-09,0.0616397,0.000437265,9.00302e-07,3.66045e-09,0.0620779,0.000439076,9.11283e-07,-4.68977e-09,0.0625179,0.000440885,8.97214e-07,7.64783e-09,0.0629597,0.000442702,9.20158e-07,-7.27499e-09,0.0634033,0.000444521,8.98333e-07,6.55113e-09,0.0638487,0.000446337,9.17986e-07,-4.02844e-09,0.0642959,0.000448161,9.05901e-07,2.11196e-09,0.064745,0.000449979,9.12236e-07,3.03125e-09,0.0651959,0.000451813,9.2133e-07,-6.78648e-09,0.0656486,0.000453635,9.00971e-07,9.21375e-09,0.0661032,0.000455464,9.28612e-07,-7.71684e-09,0.0665596,0.000457299,9.05462e-07,6.7522e-09,0.0670178,0.00045913,9.25718e-07,-4.3907e-09,0.0674778,0.000460968,9.12546e-07,3.36e-09,0.0679397,0.000462803,9.22626e-07,-1.59876e-09,0.0684034,0.000464644,9.1783e-07,3.0351e-09,0.068869,0.000466488,9.26935e-07,-3.09101e-09,0.0693364,0.000468333,9.17662e-07,1.8785e-09,0.0698057,0.000470174,9.23298e-07,3.02733e-09,0.0702768,0.00047203,9.3238e-07,-6.53722e-09,0.0707497,0.000473875,9.12768e-07,8.22054e-09,0.0712245,0.000475725,9.37429e-07,-3.99325e-09,0.0717012,0.000477588,9.2545e-07,3.01839e-10,0.0721797,0.00047944,9.26355e-07,2.78597e-09,0.0726601,0.000481301,9.34713e-07,-3.99507e-09,0.0731423,0.000483158,9.22728e-07,5.7435e-09,0.0736264,0.000485021,9.39958e-07,-4.07776e-09,0.0741123,0.000486888,9.27725e-07,3.11695e-09,0.0746002,0.000488753,9.37076e-07,-9.39394e-10,0.0750898,0.000490625,9.34258e-07,6.4055e-10,0.0755814,0.000492495,9.3618e-07,-1.62265e-09,0.0760748,0.000494363,9.31312e-07,5.84995e-09,0.0765701,0.000496243,9.48861e-07,-6.87601e-09,0.0770673,0.00049812,9.28233e-07,6.75296e-09,0.0775664,0.000499997,9.48492e-07,-5.23467e-09,0.0780673,0.000501878,9.32788e-07,6.73523e-09,0.0785701,0.000503764,9.52994e-07,-6.80514e-09,0.0790748,0.000505649,9.32578e-07,5.5842e-09,0.0795814,0.000507531,9.49331e-07,-6.30583e-10,0.0800899,0.000509428,9.47439e-07,-3.0618e-09,0.0806003,0.000511314,9.38254e-07,5.4273e-09,0.0811125,0.000513206,9.54536e-07,-3.74627e-09,0.0816267,0.000515104,9.43297e-07,2.10713e-09,0.0821427,0.000516997,9.49618e-07,2.76839e-09,0.0826607,0.000518905,9.57924e-07,-5.73006e-09,0.0831805,0.000520803,9.40733e-07,5.25072e-09,0.0837023,0.0005227,9.56486e-07,-3.71718e-10,0.084226,0.000524612,9.5537e-07,-3.76404e-09,0.0847515,0.000526512,9.44078e-07,7.97735e-09,0.085279,0.000528424,9.6801e-07,-5.79367e-09,0.0858084,0.000530343,9.50629e-07,2.96268e-10,0.0863397,0.000532245,9.51518e-07,4.6086e-09,0.0868729,0.000534162,9.65344e-07,-3.82947e-09,0.087408,0.000536081,9.53856e-07,3.25861e-09,0.087945,0.000537998,9.63631e-07,-1.7543e-09,0.088484,0.00053992,9.58368e-07,3.75849e-09,0.0890249,0.000541848,9.69644e-07,-5.82891e-09,0.0895677,0.00054377,9.52157e-07,4.65593e-09,0.0901124,0.000545688,9.66125e-07,2.10643e-09,0.0906591,0.000547627,9.72444e-07,-5.63099e-09,0.0912077,0.000549555,9.55551e-07,5.51627e-09,0.0917582,0.000551483,9.721e-07,-1.53292e-09,0.0923106,0.000553422,9.67501e-07,6.15311e-10,0.092865,0.000555359,9.69347e-07,-9.28291e-10,0.0934213,0.000557295,9.66562e-07,3.09774e-09,0.0939796,0.000559237,9.75856e-07,-4.01186e-09,0.0945398,0.000561177,9.6382e-07,5.49892e-09,0.095102,0.000563121,9.80317e-07,-3.08258e-09,0.0956661,0.000565073,9.71069e-07,-6.19176e-10,0.0962321,0.000567013,9.69212e-07,5.55932e-09,0.0968001,0.000568968,9.8589e-07,-6.71704e-09,0.09737,0.00057092,9.65738e-07,6.40762e-09,0.0979419,0.00057287,9.84961e-07,-4.0122e-09,0.0985158,0.000574828,9.72925e-07,2.19059e-09,0.0990916,0.000576781,9.79496e-07,2.70048e-09,0.0996693,0.000578748,9.87598e-07,-5.54193e-09,0.100249,0.000580706,9.70972e-07,4.56597e-09,0.100831,0.000582662,9.8467e-07,2.17923e-09,0.101414,0.000584638,9.91208e-07,-5.83232e-09,0.102,0.000586603,9.73711e-07,6.24884e-09,0.102588,0.000588569,9.92457e-07,-4.26178e-09,0.103177,0.000590541,9.79672e-07,3.34781e-09,0.103769,0.00059251,9.89715e-07,-1.67904e-09,0.104362,0.000594485,9.84678e-07,3.36839e-09,0.104958,0.000596464,9.94783e-07,-4.34397e-09,0.105555,0.000598441,9.81751e-07,6.55696e-09,0.106155,0.000600424,1.00142e-06,-6.98272e-09,0.106756,0.000602406,9.80474e-07,6.4728e-09,0.107359,0.000604386,9.99893e-07,-4.00742e-09,0.107965,0.000606374,9.8787e-07,2.10654e-09,0.108572,0.000608356,9.9419e-07,3.0318e-09,0.109181,0.000610353,1.00329e-06,-6.7832e-09,0.109793,0.00061234,9.82936e-07,9.1998e-09,0.110406,0.000614333,1.01054e-06,-7.6642e-09,0.111021,0.000616331,9.87543e-07,6.55579e-09,0.111639,0.000618326,1.00721e-06,-3.65791e-09,0.112258,0.000620329,9.96236e-07,6.25467e-10,0.112879,0.000622324,9.98113e-07,1.15593e-09,0.113503,0.000624323,1.00158e-06,2.20158e-09,0.114128,0.000626333,1.00819e-06,-2.51191e-09,0.114755,0.000628342,1.00065e-06,3.95517e-10,0.115385,0.000630345,1.00184e-06,9.29807e-10,0.116016,0.000632351,1.00463e-06,3.33599e-09,0.116649,0.00063437,1.01463e-06,-6.82329e-09,0.117285,0.000636379,9.94163e-07,9.05595e-09,0.117922,0.000638395,1.02133e-06,-7.04862e-09,0.118562,0.000640416,1.00019e-06,4.23737e-09,0.119203,0.000642429,1.0129e-06,-2.45033e-09,0.119847,0.000644448,1.00555e-06,5.56395e-09,0.120492,0.000646475,1.02224e-06,-4.9043e-09,0.121139,0.000648505,1.00753e-06,-8.47952e-10,0.121789,0.000650518,1.00498e-06,8.29622e-09,0.122441,0.000652553,1.02987e-06,-9.98538e-09,0.123094,0.000654582,9.99914e-07,9.2936e-09,0.12375,0.00065661,1.02779e-06,-4.83707e-09,0.124407,0.000658651,1.01328e-06,2.60411e-09,0.125067,0.000660685,1.0211e-06,-5.57945e-09,0.125729,0.000662711,1.00436e-06,1.22631e-08,0.126392,0.000664756,1.04115e-06,-1.36704e-08,0.127058,0.000666798,1.00014e-06,1.26161e-08,0.127726,0.000668836,1.03798e-06,-6.99155e-09,0.128396,0.000670891,1.01701e-06,4.48836e-10,0.129068,0.000672926,1.01836e-06,5.19606e-09,0.129742,0.000674978,1.03394e-06,-6.3319e-09,0.130418,0.000677027,1.01495e-06,5.2305e-09,0.131096,0.000679073,1.03064e-06,3.11123e-10,0.131776,0.000681135,1.03157e-06,-6.47511e-09,0.132458,0.000683179,1.01215e-06,1.06882e-08,0.133142,0.000685235,1.04421e-06,-6.47519e-09,0.133829,0.000687304,1.02479e-06,3.11237e-10,0.134517,0.000689355,1.02572e-06,5.23035e-09,0.135207,0.000691422,1.04141e-06,-6.3316e-09,0.1359,0.000693486,1.02242e-06,5.19484e-09,0.136594,0.000695546,1.038e-06,4.53497e-10,0.137291,0.000697623,1.03936e-06,-7.00891e-09,0.137989,0.000699681,1.01834e-06,1.2681e-08,0.13869,0.000701756,1.05638e-06,-1.39128e-08,0.139393,0.000703827,1.01464e-06,1.31679e-08,0.140098,0.000705896,1.05414e-06,-8.95659e-09,0.140805,0.000707977,1.02727e-06,7.75742e-09,0.141514,0.000710055,1.05055e-06,-7.17182e-09,0.142225,0.000712135,1.02903e-06,6.02862e-09,0.142938,0.000714211,1.04712e-06,-2.04163e-09,0.143653,0.000716299,1.04099e-06,2.13792e-09,0.144371,0.000718387,1.04741e-06,-6.51009e-09,0.14509,0.000720462,1.02787e-06,9.00123e-09,0.145812,0.000722545,1.05488e-06,3.07523e-10,0.146535,0.000724656,1.0558e-06,-1.02312e-08,0.147261,0.000726737,1.02511e-06,1.0815e-08,0.147989,0.000728819,1.05755e-06,-3.22681e-09,0.148719,0.000730925,1.04787e-06,2.09244e-09,0.14945,0.000733027,1.05415e-06,-5.143e-09,0.150185,0.00073512,1.03872e-06,3.57844e-09,0.150921,0.000737208,1.04946e-06,5.73027e-09,0.151659,0.000739324,1.06665e-06,-1.15983e-08,0.152399,0.000741423,1.03185e-06,1.08605e-08,0.153142,0.000743519,1.06443e-06,-2.04106e-09,0.153886,0.000745642,1.05831e-06,-2.69642e-09,0.154633,0.00074775,1.05022e-06,-2.07425e-09,0.155382,0.000749844,1.044e-06,1.09934e-08,0.156133,0.000751965,1.07698e-06,-1.20972e-08,0.156886,0.000754083,1.04069e-06,7.59288e-09,0.157641,0.000756187,1.06347e-06,-3.37305e-09,0.158398,0.000758304,1.05335e-06,5.89921e-09,0.159158,0.000760428,1.07104e-06,-5.32248e-09,0.159919,0.000762554,1.05508e-06,4.8927e-10,0.160683,0.000764666,1.05654e-06,3.36547e-09,0.161448,0.000766789,1.06664e-06,9.50081e-10,0.162216,0.000768925,1.06949e-06,-7.16568e-09,0.162986,0.000771043,1.04799e-06,1.28114e-08,0.163758,0.000773177,1.08643e-06,-1.42774e-08,0.164533,0.000775307,1.0436e-06,1.44956e-08,0.165309,0.000777438,1.08708e-06,-1.39025e-08,0.166087,0.00077957,1.04538e-06,1.13118e-08,0.166868,0.000781695,1.07931e-06,-1.54224e-09,0.167651,0.000783849,1.07468e-06,-5.14312e-09,0.168436,0.000785983,1.05925e-06,7.21381e-09,0.169223,0.000788123,1.0809e-06,-8.81096e-09,0.170012,0.000790259,1.05446e-06,1.31289e-08,0.170803,0.000792407,1.09385e-06,-1.39022e-08,0.171597,0.000794553,1.05214e-06,1.26775e-08,0.172392,0.000796695,1.09018e-06,-7.00557e-09,0.17319,0.000798855,1.06916e-06,4.43796e-10,0.17399,0.000800994,1.07049e-06,5.23031e-09,0.174792,0.000803151,1.08618e-06,-6.46397e-09,0.175596,0.000805304,1.06679e-06,5.72444e-09,0.176403,0.000807455,1.08396e-06,-1.53254e-09,0.177211,0.000809618,1.07937e-06,4.05673e-10,0.178022,0.000811778,1.08058e-06,-9.01916e-11,0.178835,0.000813939,1.08031e-06,-4.49821e-11,0.17965,0.000816099,1.08018e-06,2.70234e-10,0.180467,0.00081826,1.08099e-06,-1.03603e-09,0.181286,0.000820419,1.07788e-06,3.87392e-09,0.182108,0.000822587,1.0895e-06,4.41522e-10,0.182932,0.000824767,1.09083e-06,-5.63997e-09,0.183758,0.000826932,1.07391e-06,7.21707e-09,0.184586,0.000829101,1.09556e-06,-8.32718e-09,0.185416,0.000831267,1.07058e-06,1.11907e-08,0.186248,0.000833442,1.10415e-06,-6.63336e-09,0.187083,0.00083563,1.08425e-06,4.41484e-10,0.187919,0.0008378,1.08557e-06,4.86754e-09,0.188758,0.000839986,1.10017e-06,-5.01041e-09,0.189599,0.000842171,1.08514e-06,2.72811e-10,0.190443,0.000844342,1.08596e-06,3.91916e-09,0.191288,0.000846526,1.09772e-06,-1.04819e-09,0.192136,0.000848718,1.09457e-06,2.73531e-10,0.192985,0.000850908,1.0954e-06,-4.58916e-11,0.193837,0.000853099,1.09526e-06,-9.01158e-11,0.194692,0.000855289,1.09499e-06,4.06506e-10,0.195548,0.00085748,1.09621e-06,-1.53595e-09,0.196407,0.000859668,1.0916e-06,5.73717e-09,0.197267,0.000861869,1.10881e-06,-6.51164e-09,0.19813,0.000864067,1.08928e-06,5.40831e-09,0.198995,0.000866261,1.1055e-06,-2.20401e-10,0.199863,0.000868472,1.10484e-06,-4.52652e-09,0.200732,0.000870668,1.09126e-06,3.42508e-09,0.201604,0.000872861,1.10153e-06,5.72762e-09,0.202478,0.000875081,1.11872e-06,-1.14344e-08,0.203354,0.000877284,1.08441e-06,1.02076e-08,0.204233,0.000879484,1.11504e-06,4.06355e-10,0.205113,0.000881715,1.11626e-06,-1.18329e-08,0.205996,0.000883912,1.08076e-06,1.71227e-08,0.206881,0.000886125,1.13213e-06,-1.19546e-08,0.207768,0.000888353,1.09626e-06,8.93465e-10,0.208658,0.000890548,1.09894e-06,8.38062e-09,0.209549,0.000892771,1.12408e-06,-4.61353e-09,0.210443,0.000895006,1.11024e-06,-4.82756e-09,0.211339,0.000897212,1.09576e-06,9.02245e-09,0.212238,0.00089943,1.12283e-06,-1.45997e-09,0.213138,0.000901672,1.11845e-06,-3.18255e-09,0.214041,0.000903899,1.1089e-06,-7.11073e-10,0.214946,0.000906115,1.10677e-06,6.02692e-09,0.215853,0.000908346,1.12485e-06,-8.49548e-09,0.216763,0.00091057,1.09936e-06,1.30537e-08,0.217675,0.000912808,1.13852e-06,-1.3917e-08,0.218588,0.000915044,1.09677e-06,1.28121e-08,0.219505,0.000917276,1.13521e-06,-7.5288e-09,0.220423,0.000919523,1.11262e-06,2.40205e-09,0.221344,0.000921756,1.11983e-06,-2.07941e-09,0.222267,0.000923989,1.11359e-06,5.91551e-09,0.223192,0.000926234,1.13134e-06,-6.68149e-09,0.224119,0.000928477,1.11129e-06,5.90929e-09,0.225049,0.000930717,1.12902e-06,-2.05436e-09,0.22598,0.000932969,1.12286e-06,2.30807e-09,0.226915,0.000935222,1.12978e-06,-7.17796e-09,0.227851,0.00093746,1.10825e-06,1.15028e-08,0.228789,0.000939711,1.14276e-06,-9.03083e-09,0.22973,0.000941969,1.11566e-06,9.71932e-09,0.230673,0.00094423,1.14482e-06,-1.49452e-08,0.231619,0.000946474,1.09998e-06,2.02591e-08,0.232566,0.000948735,1.16076e-06,-2.13879e-08,0.233516,0.000950993,1.0966e-06,2.05888e-08,0.234468,0.000953247,1.15837e-06,-1.62642e-08,0.235423,0.000955515,1.10957e-06,1.46658e-08,0.236379,0.000957779,1.15357e-06,-1.25966e-08,0.237338,0.000960048,1.11578e-06,5.91793e-09,0.238299,0.000962297,1.13353e-06,3.82602e-09,0.239263,0.000964576,1.14501e-06,-6.3208e-09,0.240229,0.000966847,1.12605e-06,6.55613e-09,0.241197,0.000969119,1.14572e-06,-5.00268e-09,0.242167,0.000971395,1.13071e-06,-1.44659e-09,0.243139,0.000973652,1.12637e-06,1.07891e-08,0.244114,0.000975937,1.15874e-06,-1.19073e-08,0.245091,0.000978219,1.12302e-06,7.03782e-09,0.246071,0.000980486,1.14413e-06,-1.34276e-09,0.247052,0.00098277,1.1401e-06,-1.66669e-09,0.248036,0.000985046,1.1351e-06,8.00935e-09,0.249022,0.00098734,1.15913e-06,-1.54694e-08,0.250011,0.000989612,1.11272e-06,2.4066e-08,0.251002,0.000991909,1.18492e-06,-2.11901e-08,0.251995,0.000994215,1.12135e-06,1.08973e-09,0.25299,0.000996461,1.12462e-06,1.68311e-08,0.253988,0.000998761,1.17511e-06,-8.8094e-09,0.254987,0.00100109,1.14868e-06,-1.13958e-08,0.25599,0.00100335,1.1145e-06,2.45902e-08,0.256994,0.00100565,1.18827e-06,-2.73603e-08,0.258001,0.00100795,1.10618e-06,2.52464e-08,0.25901,0.00101023,1.18192e-06,-1.40207e-08,0.260021,0.00101256,1.13986e-06,1.03387e-09,0.261035,0.00101484,1.14296e-06,9.8853e-09,0.262051,0.00101715,1.17262e-06,-1.07726e-08,0.263069,0.00101947,1.1403e-06,3.40272e-09,0.26409,0.00102176,1.15051e-06,-2.83827e-09,0.265113,0.00102405,1.142e-06,7.95039e-09,0.266138,0.00102636,1.16585e-06,8.39047e-10,0.267166,0.00102869,1.16836e-06,-1.13066e-08,0.268196,0.00103099,1.13444e-06,1.4585e-08,0.269228,0.00103331,1.1782e-06,-1.72314e-08,0.270262,0.00103561,1.1265e-06,2.45382e-08,0.271299,0.00103794,1.20012e-06,-2.13166e-08,0.272338,0.00104028,1.13617e-06,1.12364e-09,0.273379,0.00104255,1.13954e-06,1.68221e-08,0.274423,0.00104488,1.19001e-06,-8.80736e-09,0.275469,0.00104723,1.16358e-06,-1.13948e-08,0.276518,0.00104953,1.1294e-06,2.45839e-08,0.277568,0.00105186,1.20315e-06,-2.73361e-08,0.278621,0.00105418,1.12114e-06,2.51559e-08,0.279677,0.0010565,1.19661e-06,-1.36832e-08,0.280734,0.00105885,1.15556e-06,-2.25706e-10,0.281794,0.00106116,1.15488e-06,1.45862e-08,0.282857,0.00106352,1.19864e-06,-2.83167e-08,0.283921,0.00106583,1.11369e-06,3.90759e-08,0.284988,0.00106817,1.23092e-06,-3.85801e-08,0.286058,0.00107052,1.11518e-06,2.58375e-08,0.287129,0.00107283,1.19269e-06,-5.16498e-09,0.288203,0.0010752,1.1772e-06,-5.17768e-09,0.28928,0.00107754,1.16167e-06,-3.92671e-09,0.290358,0.00107985,1.14988e-06,2.08846e-08,0.29144,0.00108221,1.21254e-06,-2.00072e-08,0.292523,0.00108458,1.15252e-06,-4.60659e-10,0.293609,0.00108688,1.15114e-06,2.18499e-08,0.294697,0.00108925,1.21669e-06,-2.73343e-08,0.295787,0.0010916,1.13468e-06,2.78826e-08,0.29688,0.00109395,1.21833e-06,-2.45915e-08,0.297975,0.00109632,1.14456e-06,1.08787e-08,0.299073,0.00109864,1.17719e-06,1.08788e-08,0.300172,0.00110102,1.20983e-06,-2.45915e-08,0.301275,0.00110337,1.13605e-06,2.78828e-08,0.302379,0.00110573,1.2197e-06,-2.73348e-08,0.303486,0.00110808,1.1377e-06,2.18518e-08,0.304595,0.00111042,1.20325e-06,-4.67556e-10,0.305707,0.00111283,1.20185e-06,-1.99816e-08,0.306821,0.00111517,1.14191e-06,2.07891e-08,0.307937,0.00111752,1.20427e-06,-3.57026e-09,0.309056,0.00111992,1.19356e-06,-6.50797e-09,0.310177,0.00112228,1.17404e-06,-2.00165e-10,0.3113,0.00112463,1.17344e-06,7.30874e-09,0.312426,0.001127,1.19536e-06,7.67424e-10,0.313554,0.00112939,1.19767e-06,-1.03784e-08,0.314685,0.00113176,1.16653e-06,1.09437e-08,0.315818,0.00113412,1.19936e-06,-3.59406e-09,0.316953,0.00113651,1.18858e-06,3.43251e-09,0.318091,0.0011389,1.19888e-06,-1.0136e-08,0.319231,0.00114127,1.16847e-06,7.30915e-09,0.320374,0.00114363,1.1904e-06,1.07018e-08,0.321518,0.00114604,1.2225e-06,-2.03137e-08,0.322666,0.00114842,1.16156e-06,1.09484e-08,0.323815,0.00115078,1.19441e-06,6.32224e-09,0.324967,0.00115319,1.21337e-06,-6.43509e-09,0.326122,0.00115559,1.19407e-06,-1.03842e-08,0.327278,0.00115795,1.16291e-06,1.81697e-08,0.328438,0.00116033,1.21742e-06,-2.6901e-09,0.329599,0.00116276,1.20935e-06,-7.40939e-09,0.330763,0.00116515,1.18713e-06,2.52533e-09,0.331929,0.00116754,1.1947e-06,-2.69191e-09,0.333098,0.00116992,1.18663e-06,8.24218e-09,0.334269,0.00117232,1.21135e-06,-4.74377e-10,0.335443,0.00117474,1.20993e-06,-6.34471e-09,0.336619,0.00117714,1.1909e-06,-3.94922e-09,0.337797,0.00117951,1.17905e-06,2.21417e-08,0.338978,0.00118193,1.24547e-06,-2.50128e-08,0.340161,0.00118435,1.17043e-06,1.8305e-08,0.341346,0.00118674,1.22535e-06,-1.84048e-08,0.342534,0.00118914,1.17013e-06,2.55121e-08,0.343725,0.00119156,1.24667e-06,-2.40389e-08,0.344917,0.00119398,1.17455e-06,1.10389e-08,0.346113,0.00119636,1.20767e-06,9.68574e-09,0.34731,0.0011988,1.23673e-06,-1.99797e-08,0.34851,0.00120122,1.17679e-06,1.06284e-08,0.349713,0.0012036,1.20867e-06,7.26868e-09,0.350917,0.00120604,1.23048e-06,-9.90072e-09,0.352125,0.00120847,1.20078e-06,2.53177e-09,0.353334,0.00121088,1.20837e-06,-2.26199e-10,0.354546,0.0012133,1.20769e-06,-1.62705e-09,0.355761,0.00121571,1.20281e-06,6.73435e-09,0.356978,0.00121813,1.22302e-06,4.49207e-09,0.358197,0.00122059,1.23649e-06,-2.47027e-08,0.359419,0.00122299,1.16238e-06,3.47142e-08,0.360643,0.00122542,1.26653e-06,-2.47472e-08,0.36187,0.00122788,1.19229e-06,4.66965e-09,0.363099,0.00123028,1.20629e-06,6.06872e-09,0.36433,0.00123271,1.2245e-06,8.57729e-10,0.365564,0.00123516,1.22707e-06,-9.49952e-09,0.366801,0.00123759,1.19858e-06,7.33792e-09,0.36804,0.00124001,1.22059e-06,9.95025e-09,0.369281,0.00124248,1.25044e-06,-1.73366e-08,0.370525,0.00124493,1.19843e-06,-2.08464e-10,0.371771,0.00124732,1.1978e-06,1.81704e-08,0.373019,0.00124977,1.25232e-06,-1.28683e-08,0.37427,0.00125224,1.21371e-06,3.50042e-09,0.375524,0.00125468,1.22421e-06,-1.1335e-09,0.37678,0.00125712,1.22081e-06,1.03345e-09,0.378038,0.00125957,1.22391e-06,-3.00023e-09,0.379299,0.00126201,1.21491e-06,1.09676e-08,0.380562,0.00126447,1.24781e-06,-1.10676e-08,0.381828,0.00126693,1.21461e-06,3.50042e-09,0.383096,0.00126937,1.22511e-06,-2.93403e-09,0.384366,0.00127181,1.21631e-06,8.23574e-09,0.385639,0.00127427,1.24102e-06,-2.06607e-10,0.386915,0.00127675,1.2404e-06,-7.40935e-09,0.388193,0.00127921,1.21817e-06,4.1761e-11,0.389473,0.00128165,1.21829e-06,7.24223e-09,0.390756,0.0012841,1.24002e-06,7.91564e-10,0.392042,0.00128659,1.2424e-06,-1.04086e-08,0.393329,0.00128904,1.21117e-06,1.10405e-08,0.39462,0.0012915,1.24429e-06,-3.951e-09,0.395912,0.00129397,1.23244e-06,4.7634e-09,0.397208,0.00129645,1.24673e-06,-1.51025e-08,0.398505,0.0012989,1.20142e-06,2.58443e-08,0.399805,0.00130138,1.27895e-06,-2.86702e-08,0.401108,0.00130385,1.19294e-06,2.92318e-08,0.402413,0.00130632,1.28064e-06,-2.86524e-08,0.403721,0.0013088,1.19468e-06,2.57731e-08,0.405031,0.00131127,1.272e-06,-1.48355e-08,0.406343,0.00131377,1.2275e-06,3.76652e-09,0.407658,0.00131623,1.23879e-06,-2.30784e-10,0.408976,0.00131871,1.2381e-06,-2.84331e-09,0.410296,0.00132118,1.22957e-06,1.16041e-08,0.411618,0.00132367,1.26438e-06,-1.37708e-08,0.412943,0.00132616,1.22307e-06,1.36768e-08,0.41427,0.00132865,1.2641e-06,-1.1134e-08,0.4156,0.00133114,1.2307e-06,1.05714e-09,0.416933,0.00133361,1.23387e-06,6.90538e-09,0.418267,0.00133609,1.25459e-06,1.12372e-09,0.419605,0.00133861,1.25796e-06,-1.14002e-08,0.420945,0.00134109,1.22376e-06,1.46747e-08,0.422287,0.00134358,1.26778e-06,-1.7496e-08,0.423632,0.00134606,1.21529e-06,2.5507e-08,0.424979,0.00134857,1.29182e-06,-2.49272e-08,0.426329,0.00135108,1.21703e-06,1.45972e-08,0.427681,0.00135356,1.26083e-06,-3.65935e-09,0.429036,0.00135607,1.24985e-06,4.00178e-11,0.430393,0.00135857,1.24997e-06,3.49917e-09,0.431753,0.00136108,1.26047e-06,-1.40366e-08,0.433116,0.00136356,1.21836e-06,2.28448e-08,0.43448,0.00136606,1.28689e-06,-1.77378e-08,0.435848,0.00136858,1.23368e-06,1.83043e-08,0.437218,0.0013711,1.28859e-06,-2.56769e-08,0.43859,0.0013736,1.21156e-06,2.47987e-08,0.439965,0.0013761,1.28595e-06,-1.39133e-08,0.441342,0.00137863,1.24421e-06,1.05202e-09,0.442722,0.00138112,1.24737e-06,9.70507e-09,0.444104,0.00138365,1.27649e-06,-1.00698e-08,0.445489,0.00138617,1.24628e-06,7.72123e-10,0.446877,0.00138867,1.24859e-06,6.98132e-09,0.448267,0.00139118,1.26954e-06,1.10477e-09,0.449659,0.00139373,1.27285e-06,-1.14003e-08,0.451054,0.00139624,1.23865e-06,1.4694e-08,0.452452,0.00139876,1.28273e-06,-1.75734e-08,0.453852,0.00140127,1.23001e-06,2.5797e-08,0.455254,0.00140381,1.3074e-06,-2.60097e-08,0.456659,0.00140635,1.22937e-06,1.86371e-08,0.458067,0.00140886,1.28529e-06,-1.8736e-08,0.459477,0.00141137,1.22908e-06,2.65048e-08,0.46089,0.00141391,1.30859e-06,-2.76784e-08,0.462305,0.00141645,1.22556e-06,2.46043e-08,0.463722,0.00141897,1.29937e-06,-1.11341e-08,0.465143,0.00142154,1.26597e-06,-9.87033e-09,0.466565,0.00142404,1.23636e-06,2.08131e-08,0.467991,0.00142657,1.2988e-06,-1.37773e-08,0.469419,0.00142913,1.25746e-06,4.49378e-09,0.470849,0.00143166,1.27094e-06,-4.19781e-09,0.472282,0.00143419,1.25835e-06,1.22975e-08,0.473717,0.00143674,1.29524e-06,-1.51902e-08,0.475155,0.00143929,1.24967e-06,1.86608e-08,0.476596,0.00144184,1.30566e-06,-2.96506e-08,0.478039,0.00144436,1.2167e-06,4.03368e-08,0.479485,0.00144692,1.33771e-06,-4.22896e-08,0.480933,0.00144947,1.21085e-06,3.94148e-08,0.482384,0.00145201,1.32909e-06,-2.59626e-08,0.483837,0.00145459,1.2512e-06,4.83124e-09,0.485293,0.0014571,1.2657e-06,6.63757e-09,0.486751,0.00145966,1.28561e-06,-1.57911e-09,0.488212,0.00146222,1.28087e-06,-3.21468e-10,0.489676,0.00146478,1.27991e-06,2.86517e-09,0.491142,0.00146735,1.2885e-06,-1.11392e-08,0.49261,0.00146989,1.25508e-06,1.18893e-08,0.494081,0.00147244,1.29075e-06,-6.61574e-09,0.495555,0.001475,1.27091e-06,1.45736e-08,0.497031,0.00147759,1.31463e-06,-2.18759e-08,0.49851,0.00148015,1.249e-06,1.33252e-08,0.499992,0.00148269,1.28897e-06,-1.62277e-09,0.501476,0.00148526,1.28411e-06,-6.83421e-09,0.502962,0.00148781,1.2636e-06,2.89596e-08,0.504451,0.00149042,1.35048e-06,-4.93997e-08,0.505943,0.00149298,1.20228e-06,4.94299e-08,0.507437,0.00149553,1.35057e-06,-2.91107e-08,0.508934,0.00149814,1.26324e-06,7.40848e-09,0.510434,0.00150069,1.28547e-06,-5.23187e-10,0.511936,0.00150326,1.2839e-06,-5.31585e-09,0.51344,0.00150581,1.26795e-06,2.17866e-08,0.514947,0.00150841,1.33331e-06,-2.22257e-08,0.516457,0.00151101,1.26663e-06,7.51178e-09,0.517969,0.00151357,1.28917e-06,-7.82128e-09,0.519484,0.00151613,1.2657e-06,2.37733e-08,0.521002,0.00151873,1.33702e-06,-2.76674e-08,0.522522,0.00152132,1.25402e-06,2.72917e-08,0.524044,0.00152391,1.3359e-06,-2.18949e-08,0.525569,0.00152652,1.27021e-06,6.83372e-10,0.527097,0.00152906,1.27226e-06,1.91613e-08,0.528628,0.00153166,1.32974e-06,-1.77241e-08,0.53016,0.00153427,1.27657e-06,-7.86963e-09,0.531696,0.0015368,1.25296e-06,4.92027e-08,0.533234,0.00153945,1.40057e-06,-6.9732e-08,0.534775,0.00154204,1.19138e-06,5.09114e-08,0.536318,0.00154458,1.34411e-06,-1.4704e-08,0.537864,0.00154722,1.3e-06,7.9048e-09,0.539413,0.00154984,1.32371e-06,-1.69152e-08,0.540964,0.00155244,1.27297e-06,1.51355e-10,0.542517,0.00155499,1.27342e-06,1.63099e-08,0.544074,0.00155758,1.32235e-06,-5.78647e-09,0.545633,0.00156021,1.30499e-06,6.83599e-09,0.547194,0.00156284,1.3255e-06,-2.15575e-08,0.548758,0.00156543,1.26083e-06,1.97892e-08,0.550325,0.00156801,1.32019e-06,2.00525e-09,0.551894,0.00157065,1.32621e-06,-2.78103e-08,0.553466,0.00157322,1.24278e-06,4.96314e-08,0.555041,0.00157586,1.39167e-06,-5.1506e-08,0.556618,0.00157849,1.23716e-06,3.71835e-08,0.558198,0.00158107,1.34871e-06,-3.76233e-08,0.55978,0.00158366,1.23584e-06,5.37052e-08,0.561365,0.00158629,1.39695e-06,-5.79884e-08,0.562953,0.00158891,1.22299e-06,5.90392e-08,0.564543,0.00159153,1.4001e-06,-5.89592e-08,0.566136,0.00159416,1.22323e-06,5.7588e-08,0.567731,0.00159678,1.39599e-06,-5.21835e-08,0.569329,0.00159941,1.23944e-06,3.19369e-08,0.57093,0.00160199,1.33525e-06,-1.59594e-08,0.572533,0.00160461,1.28737e-06,3.19006e-08,0.574139,0.00160728,1.38307e-06,-5.20383e-08,0.575748,0.00160989,1.22696e-06,5.70431e-08,0.577359,0.00161251,1.39809e-06,-5.69247e-08,0.578973,0.00161514,1.22731e-06,5.14463e-08,0.580589,0.00161775,1.38165e-06,-2.9651e-08,0.582208,0.00162042,1.2927e-06,7.55339e-09,0.58383,0.00162303,1.31536e-06,-5.62636e-10,0.585455,0.00162566,1.31367e-06,-5.30281e-09,0.587081,0.00162827,1.29776e-06,2.17738e-08,0.588711,0.00163093,1.36309e-06,-2.21875e-08,0.590343,0.00163359,1.29652e-06,7.37164e-09,0.591978,0.00163621,1.31864e-06,-7.29907e-09,0.593616,0.00163882,1.29674e-06,2.18247e-08,0.595256,0.00164148,1.36221e-06,-2.03952e-08,0.596899,0.00164414,1.30103e-06,1.51241e-10,0.598544,0.00164675,1.30148e-06,1.97902e-08,0.600192,0.00164941,1.36085e-06,-1.97074e-08,0.601843,0.00165207,1.30173e-06,-5.65175e-10,0.603496,0.00165467,1.30004e-06,2.1968e-08,0.605152,0.00165734,1.36594e-06,-2.77024e-08,0.606811,0.00165999,1.28283e-06,2.92369e-08,0.608472,0.00166264,1.37054e-06,-2.96407e-08,0.610136,0.00166529,1.28162e-06,2.97215e-08,0.611803,0.00166795,1.37079e-06,-2.96408e-08,0.613472,0.0016706,1.28186e-06,2.92371e-08,0.615144,0.00167325,1.36957e-06,-2.77031e-08,0.616819,0.00167591,1.28647e-06,2.19708e-08,0.618496,0.00167855,1.35238e-06,-5.75407e-10,0.620176,0.00168125,1.35065e-06,-1.9669e-08,0.621858,0.00168389,1.29164e-06,1.96468e-08,0.623544,0.00168653,1.35058e-06,6.86403e-10,0.625232,0.00168924,1.35264e-06,-2.23924e-08,0.626922,0.00169187,1.28547e-06,2.92788e-08,0.628615,0.00169453,1.3733e-06,-3.51181e-08,0.630311,0.00169717,1.26795e-06,5.15889e-08,0.63201,0.00169987,1.42272e-06,-5.2028e-08,0.633711,0.00170255,1.26663e-06,3.73139e-08,0.635415,0.0017052,1.37857e-06,-3.76227e-08,0.637121,0.00170784,1.2657e-06,5.35722e-08,0.63883,0.00171054,1.42642e-06,-5.74567e-08,0.640542,0.00171322,1.25405e-06,5.70456e-08,0.642257,0.0017159,1.42519e-06,-5.15163e-08,0.643974,0.00171859,1.27064e-06,2.98103e-08,0.645694,0.00172122,1.36007e-06,-8.12016e-09,0.647417,0.00172392,1.33571e-06,2.67039e-09,0.649142,0.0017266,1.34372e-06,-2.56152e-09,0.65087,0.00172928,1.33604e-06,7.57571e-09,0.6526,0.00173197,1.35876e-06,-2.77413e-08,0.654334,0.00173461,1.27554e-06,4.3785e-08,0.65607,0.00173729,1.40689e-06,-2.81896e-08,0.657808,0.00174002,1.32233e-06,9.36893e-09,0.65955,0.00174269,1.35043e-06,-9.28617e-09,0.661294,0.00174536,1.32257e-06,2.77757e-08,0.66304,0.00174809,1.4059e-06,-4.2212e-08,0.66479,0.00175078,1.27926e-06,2.1863e-08,0.666542,0.0017534,1.34485e-06,1.43648e-08,0.668297,0.00175613,1.38795e-06,-1.97177e-08,0.670054,0.00175885,1.3288e-06,4.90115e-09,0.671814,0.00176152,1.3435e-06,1.13232e-10,0.673577,0.00176421,1.34384e-06,-5.3542e-09,0.675343,0.00176688,1.32778e-06,2.13035e-08,0.677111,0.0017696,1.39169e-06,-2.02553e-08,0.678882,0.00177232,1.33092e-06,1.13005e-10,0.680656,0.00177499,1.33126e-06,1.98031e-08,0.682432,0.00177771,1.39067e-06,-1.97211e-08,0.684211,0.00178043,1.33151e-06,-5.2349e-10,0.685993,0.00178309,1.32994e-06,2.18151e-08,0.687777,0.00178582,1.39538e-06,-2.71325e-08,0.689564,0.00178853,1.31398e-06,2.71101e-08,0.691354,0.00179124,1.39531e-06,-2.17035e-08,0.693147,0.00179396,1.3302e-06,9.92865e-11,0.694942,0.00179662,1.3305e-06,2.13063e-08,0.69674,0.00179935,1.39442e-06,-2.57198e-08,0.698541,0.00180206,1.31726e-06,2.19682e-08,0.700344,0.00180476,1.38317e-06,-2.54852e-09,0.70215,0.00180752,1.37552e-06,-1.17741e-08,0.703959,0.00181023,1.3402e-06,-9.95999e-09,0.705771,0.00181288,1.31032e-06,5.16141e-08,0.707585,0.00181566,1.46516e-06,-7.72869e-08,0.709402,0.00181836,1.2333e-06,7.87197e-08,0.711222,0.00182106,1.46946e-06,-5.87781e-08,0.713044,0.00182382,1.29312e-06,3.71834e-08,0.714869,0.00182652,1.40467e-06,-3.03511e-08,0.716697,0.00182924,1.31362e-06,2.46161e-08,0.718528,0.00183194,1.38747e-06,-8.5087e-09,0.720361,0.00183469,1.36194e-06,9.41892e-09,0.722197,0.00183744,1.3902e-06,-2.91671e-08,0.724036,0.00184014,1.3027e-06,4.76448e-08,0.725878,0.00184288,1.44563e-06,-4.22028e-08,0.727722,0.00184565,1.31902e-06,1.95682e-09,0.729569,0.00184829,1.3249e-06,3.43754e-08,0.731419,0.00185104,1.42802e-06,-2.0249e-08,0.733271,0.00185384,1.36727e-06,-1.29838e-08,0.735126,0.00185654,1.32832e-06,1.25794e-08,0.736984,0.00185923,1.36606e-06,2.22711e-08,0.738845,0.00186203,1.43287e-06,-4.20594e-08,0.740708,0.00186477,1.3067e-06,2.67571e-08,0.742574,0.00186746,1.38697e-06,-5.36424e-09,0.744443,0.00187022,1.37087e-06,-5.30023e-09,0.746315,0.00187295,1.35497e-06,2.65653e-08,0.748189,0.00187574,1.43467e-06,-4.13564e-08,0.750066,0.00187848,1.3106e-06,1.9651e-08,0.751946,0.00188116,1.36955e-06,2.23572e-08,0.753828,0.00188397,1.43663e-06,-4.9475e-08,0.755714,0.00188669,1.2882e-06,5.63335e-08,0.757602,0.00188944,1.4572e-06,-5.66499e-08,0.759493,0.00189218,1.28725e-06,5.10567e-08,0.761386,0.00189491,1.44042e-06,-2.83677e-08,0.763283,0.00189771,1.35532e-06,2.80962e-09,0.765182,0.00190042,1.36375e-06,1.71293e-08,0.767083,0.0019032,1.41513e-06,-1.17221e-08,0.768988,0.001906,1.37997e-06,-2.98453e-08,0.770895,0.00190867,1.29043e-06,7.14987e-08,0.772805,0.00191146,1.50493e-06,-7.73354e-08,0.774718,0.00191424,1.27292e-06,5.90292e-08,0.776634,0.00191697,1.45001e-06,-3.9572e-08,0.778552,0.00191975,1.33129e-06,3.9654e-08,0.780473,0.00192253,1.45026e-06,-5.94395e-08,0.782397,0.00192525,1.27194e-06,7.88945e-08,0.784324,0.00192803,1.50862e-06,-7.73249e-08,0.786253,0.00193082,1.27665e-06,5.15913e-08,0.788185,0.00193352,1.43142e-06,-9.83099e-09,0.79012,0.00193636,1.40193e-06,-1.22672e-08,0.792058,0.00193912,1.36513e-06,-7.05275e-10,0.793999,0.00194185,1.36301e-06,1.50883e-08,0.795942,0.00194462,1.40828e-06,-4.33147e-11,0.797888,0.00194744,1.40815e-06,-1.49151e-08,0.799837,0.00195021,1.3634e-06,9.93244e-11,0.801788,0.00195294,1.3637e-06,1.45179e-08,0.803743,0.00195571,1.40725e-06,1.43363e-09,0.8057,0.00195853,1.41155e-06,-2.02525e-08,0.80766,0.00196129,1.35079e-06,1.99718e-08,0.809622,0.00196405,1.41071e-06,-3.01649e-11,0.811588,0.00196687,1.41062e-06,-1.9851e-08,0.813556,0.00196964,1.35107e-06,1.98296e-08,0.815527,0.0019724,1.41056e-06,1.37485e-10,0.817501,0.00197522,1.41097e-06,-2.03796e-08,0.819477,0.00197798,1.34983e-06,2.17763e-08,0.821457,0.00198074,1.41516e-06,-7.12085e-09,0.823439,0.00198355,1.3938e-06,6.70707e-09,0.825424,0.00198636,1.41392e-06,-1.97074e-08,0.827412,0.00198913,1.35479e-06,1.25179e-08,0.829402,0.00199188,1.39235e-06,2.92405e-08,0.831396,0.00199475,1.48007e-06,-6.98755e-08,0.833392,0.0019975,1.27044e-06,7.14477e-08,0.835391,0.00200026,1.48479e-06,-3.71014e-08,0.837392,0.00200311,1.37348e-06,1.73533e-08,0.839397,0.00200591,1.42554e-06,-3.23118e-08,0.841404,0.00200867,1.32861e-06,5.2289e-08,0.843414,0.00201148,1.48547e-06,-5.76348e-08,0.845427,0.00201428,1.31257e-06,5.9041e-08,0.847443,0.00201708,1.48969e-06,-5.93197e-08,0.849461,0.00201988,1.31173e-06,5.90289e-08,0.851482,0.00202268,1.48882e-06,-5.75864e-08,0.853507,0.00202549,1.31606e-06,5.21075e-08,0.855533,0.00202828,1.47238e-06,-3.16344e-08,0.857563,0.00203113,1.37748e-06,1.48257e-08,0.859596,0.00203393,1.42196e-06,-2.76684e-08,0.861631,0.00203669,1.33895e-06,3.62433e-08,0.863669,0.00203947,1.44768e-06,1.90463e-09,0.86571,0.00204237,1.45339e-06,-4.38617e-08,0.867754,0.00204515,1.32181e-06,5.43328e-08,0.8698,0.00204796,1.48481e-06,-5.42603e-08,0.87185,0.00205076,1.32203e-06,4.34989e-08,0.873902,0.00205354,1.45252e-06,-5.26029e-10,0.875957,0.00205644,1.45095e-06,-4.13949e-08,0.878015,0.00205922,1.32676e-06,4.68962e-08,0.880075,0.00206201,1.46745e-06,-2.69807e-08,0.882139,0.00206487,1.38651e-06,1.42181e-09,0.884205,0.00206764,1.39077e-06,2.12935e-08,0.886274,0.00207049,1.45465e-06,-2.69912e-08,0.888346,0.00207332,1.37368e-06,2.70664e-08,0.890421,0.00207615,1.45488e-06,-2.16698e-08,0.892498,0.00207899,1.38987e-06,8.14756e-12,0.894579,0.00208177,1.38989e-06,2.16371e-08,0.896662,0.00208462,1.45481e-06,-2.6952e-08,0.898748,0.00208744,1.37395e-06,2.65663e-08,0.900837,0.00209027,1.45365e-06,-1.97084e-08,0.902928,0.00209312,1.39452e-06,-7.33731e-09,0.905023,0.00209589,1.37251e-06,4.90578e-08,0.90712,0.00209878,1.51968e-06,-6.96845e-08,0.90922,0.00210161,1.31063e-06,5.08664e-08,0.911323,0.00210438,1.46323e-06,-1.45717e-08,0.913429,0.00210727,1.41952e-06,7.42038e-09,0.915538,0.00211013,1.44178e-06,-1.51097e-08,0.917649,0.00211297,1.39645e-06,-6.58618e-09,0.919764,0.00211574,1.37669e-06,4.14545e-08,0.921881,0.00211862,1.50105e-06,-4.00222e-08,0.924001,0.0021215,1.38099e-06,-5.7518e-10,0.926124,0.00212426,1.37926e-06,4.23229e-08,0.92825,0.00212714,1.50623e-06,-4.9507e-08,0.930378,0.00213001,1.35771e-06,3.64958e-08,0.93251,0.00213283,1.4672e-06,-3.68713e-08,0.934644,0.00213566,1.35658e-06,5.13848e-08,0.936781,0.00213852,1.51074e-06,-4.94585e-08,0.938921,0.0021414,1.36236e-06,2.72399e-08,0.941064,0.0021442,1.44408e-06,1.0372e-10,0.943209,0.00214709,1.44439e-06,-2.76547e-08,0.945358,0.0021499,1.36143e-06,5.09106e-08,0.947509,0.00215277,1.51416e-06,-5.67784e-08,0.949663,0.00215563,1.34382e-06,5.69935e-08,0.95182,0.00215849,1.5148e-06,-5.19861e-08,0.95398,0.00216136,1.35885e-06,3.17417e-08,0.956143,0.00216418,1.45407e-06,-1.53758e-08,0.958309,0.00216704,1.40794e-06,2.97615e-08,0.960477,0.00216994,1.49723e-06,-4.40657e-08,0.962649,0.00217281,1.36503e-06,2.72919e-08,0.964823,0.00217562,1.44691e-06,-5.49729e-09,0.967,0.0021785,1.43041e-06,-5.30273e-09,0.96918,0.00218134,1.41451e-06,2.67084e-08,0.971363,0.00218425,1.49463e-06,-4.19265e-08,0.973548,0.00218711,1.36885e-06,2.17881e-08,0.975737,0.00218992,1.43422e-06,1.43789e-08,0.977928,0.00219283,1.47735e-06,-1.96989e-08,0.980122,0.00219572,1.41826e-06,4.81221e-09,0.98232,0.00219857,1.43269e-06,4.50048e-10,0.98452,0.00220144,1.43404e-06,-6.61237e-09,0.986722,0.00220429,1.41421e-06,2.59993e-08,0.988928,0.0022072,1.4922e-06,-3.77803e-08,0.991137,0.00221007,1.37886e-06,5.9127e-09,0.993348,0.00221284,1.3966e-06,1.33339e-07,0.995563,0.00221604,1.79662e-06,-5.98872e-07,0.99778,0.00222015,0.,0.};\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void RGB2LabConvert_f(const T& src, D& dst)\n        {\n            const float _1_3 = 1.0f / 3.0f;\n            const float _a = 16.0f / 116.0f;\n\n            float B = blueIdx == 0 ? src.x : src.z;\n            float G = src.y;\n            float R = blueIdx == 0 ? src.z : src.x;\n\n            if (srgb)\n            {\n                B = splineInterpolate(B * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n                G = splineInterpolate(G * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n                R = splineInterpolate(R * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n            }\n\n            float X = B * 0.189828f + G * 0.376219f + R * 0.433953f;\n            float Y = B * 0.072169f + G * 0.715160f + R * 0.212671f;\n            float Z = B * 0.872766f + G * 0.109477f + R * 0.017758f;\n\n            float FX = X > 0.008856f ? ::powf(X, _1_3) : (7.787f * X + _a);\n            float FY = Y > 0.008856f ? ::powf(Y, _1_3) : (7.787f * Y + _a);\n            float FZ = Z > 0.008856f ? ::powf(Z, _1_3) : (7.787f * Z + _a);\n\n            float L = Y > 0.008856f ? (116.f * FY - 16.f) : (903.3f * Y);\n            float a = 500.f * (FX - FY);\n            float b = 200.f * (FY - FZ);\n\n            dst.x = L;\n            dst.y = a;\n            dst.z = b;\n        }\n\n        template <typename T, int scn, int dcn, bool srgb, int blueIdx> struct RGB2Lab;\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct RGB2Lab<uchar, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<uchar, scn>::vec_type, typename TypeVec<uchar, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<uchar, dcn>::vec_type operator ()(const typename TypeVec<uchar, scn>::vec_type& src) const\n            {\n                typename TypeVec<uchar, dcn>::vec_type dst;\n\n                RGB2LabConvert_b<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB2Lab() {}\n            __host__ __device__ __forceinline__ RGB2Lab(const RGB2Lab&) {}\n        };\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct RGB2Lab<float, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                RGB2LabConvert_f<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB2Lab() {}\n            __host__ __device__ __forceinline__ RGB2Lab(const RGB2Lab&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2Lab_TRAITS(name, scn, dcn, srgb, blueIdx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2Lab<T, scn, dcn, srgb, blueIdx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        __constant__ float c_sRGBInvGammaTab[] = {0,0.0126255,0.,-8.33961e-06,0.0126172,0.0126005,-2.50188e-05,4.1698e-05,0.0252344,0.0126756,0.000100075,-0.000158451,0.0378516,0.0124004,-0.000375277,-0.000207393,0.0496693,0.0110276,-0.000997456,0.00016837,0.0598678,0.00953783,-0.000492346,2.07235e-05,0.068934,0.00861531,-0.000430176,3.62876e-05,0.0771554,0.00786382,-0.000321313,1.87625e-05,0.0847167,0.00727748,-0.000265025,1.53594e-05,0.0917445,0.00679351,-0.000218947,1.10545e-05,0.0983301,0.00638877,-0.000185784,8.66984e-06,0.104542,0.00604322,-0.000159774,6.82996e-06,0.110432,0.00574416,-0.000139284,5.51008e-06,0.116042,0.00548212,-0.000122754,4.52322e-06,0.121406,0.00525018,-0.000109184,3.75557e-06,0.126551,0.00504308,-9.79177e-05,3.17134e-06,0.131499,0.00485676,-8.84037e-05,2.68469e-06,0.13627,0.004688,-8.03496e-05,2.31725e-06,0.14088,0.00453426,-7.33978e-05,2.00868e-06,0.145343,0.00439349,-6.73718e-05,1.74775e-06,0.149671,0.00426399,-6.21286e-05,1.53547e-06,0.153875,0.00414434,-5.75222e-05,1.364e-06,0.157963,0.00403338,-5.34301e-05,1.20416e-06,0.161944,0.00393014,-4.98177e-05,1.09114e-06,0.165825,0.00383377,-4.65443e-05,9.57987e-07,0.169613,0.00374356,-4.36703e-05,8.88359e-07,0.173314,0.00365888,-4.10052e-05,7.7849e-07,0.176933,0.00357921,-3.86697e-05,7.36254e-07,0.180474,0.00350408,-3.6461e-05,6.42534e-07,0.183942,0.00343308,-3.45334e-05,6.12614e-07,0.187342,0.00336586,-3.26955e-05,5.42894e-07,0.190675,0.00330209,-3.10669e-05,5.08967e-07,0.193947,0.00324149,-2.954e-05,4.75977e-07,0.197159,0.00318383,-2.8112e-05,4.18343e-07,0.200315,0.00312887,-2.6857e-05,4.13651e-07,0.203418,0.00307639,-2.5616e-05,3.70847e-07,0.206469,0.00302627,-2.45035e-05,3.3813e-07,0.209471,0.00297828,-2.34891e-05,3.32999e-07,0.212426,0.0029323,-2.24901e-05,2.96826e-07,0.215336,0.00288821,-2.15996e-05,2.82736e-07,0.218203,0.00284586,-2.07514e-05,2.70961e-07,0.221029,0.00280517,-1.99385e-05,2.42744e-07,0.223814,0.00276602,-1.92103e-05,2.33277e-07,0.226561,0.0027283,-1.85105e-05,2.2486e-07,0.229271,0.00269195,-1.78359e-05,2.08383e-07,0.231945,0.00265691,-1.72108e-05,1.93305e-07,0.234585,0.00262307,-1.66308e-05,1.80687e-07,0.237192,0.00259035,-1.60888e-05,1.86632e-07,0.239766,0.00255873,-1.55289e-05,1.60569e-07,0.24231,0.00252815,-1.50472e-05,1.54566e-07,0.244823,0.00249852,-1.45835e-05,1.59939e-07,0.247307,0.00246983,-1.41037e-05,1.29549e-07,0.249763,0.00244202,-1.3715e-05,1.41429e-07,0.252191,0.00241501,-1.32907e-05,1.39198e-07,0.254593,0.00238885,-1.28731e-05,1.06444e-07,0.256969,0.00236342,-1.25538e-05,1.2048e-07,0.25932,0.00233867,-1.21924e-05,1.26892e-07,0.261647,0.00231467,-1.18117e-05,8.72084e-08,0.26395,0.00229131,-1.15501e-05,1.20323e-07,0.26623,0.00226857,-1.11891e-05,8.71514e-08,0.268487,0.00224645,-1.09276e-05,9.73165e-08,0.270723,0.00222489,-1.06357e-05,8.98259e-08,0.272937,0.00220389,-1.03662e-05,7.98218e-08,0.275131,0.00218339,-1.01267e-05,9.75254e-08,0.277304,0.00216343,-9.83416e-06,6.65195e-08,0.279458,0.00214396,-9.63461e-06,8.34313e-08,0.281592,0.00212494,-9.38431e-06,7.65919e-08,0.283708,0.00210641,-9.15454e-06,5.7236e-08,0.285805,0.00208827,-8.98283e-06,8.18939e-08,0.287885,0.00207055,-8.73715e-06,6.2224e-08,0.289946,0.00205326,-8.55047e-06,5.66388e-08,0.291991,0.00203633,-8.38056e-06,6.88491e-08,0.294019,0.00201978,-8.17401e-06,5.53955e-08,0.296031,0.00200359,-8.00782e-06,6.71971e-08,0.298027,0.00198778,-7.80623e-06,3.34439e-08,0.300007,0.00197227,-7.7059e-06,6.7248e-08,0.301971,0.00195706,-7.50416e-06,5.51915e-08,0.303921,0.00194221,-7.33858e-06,3.98124e-08,0.305856,0.00192766,-7.21915e-06,5.37795e-08,0.307776,0.00191338,-7.05781e-06,4.30919e-08,0.309683,0.00189939,-6.92853e-06,4.20744e-08,0.311575,0.00188566,-6.80231e-06,5.68321e-08,0.313454,0.00187223,-6.63181e-06,2.86195e-08,0.31532,0.00185905,-6.54595e-06,3.73075e-08,0.317172,0.00184607,-6.43403e-06,6.05684e-08,0.319012,0.00183338,-6.25233e-06,1.84426e-08,0.320839,0.00182094,-6.197e-06,4.44757e-08,0.322654,0.00180867,-6.06357e-06,4.20729e-08,0.324456,0.00179667,-5.93735e-06,2.56511e-08,0.326247,0.00178488,-5.8604e-06,3.41368e-08,0.328026,0.00177326,-5.75799e-06,4.64177e-08,0.329794,0.00176188,-5.61874e-06,1.86107e-08,0.33155,0.0017507,-5.5629e-06,2.81511e-08,0.333295,0.00173966,-5.47845e-06,4.75987e-08,0.335029,0.00172884,-5.33565e-06,1.98726e-08,0.336753,0.00171823,-5.27604e-06,2.19226e-08,0.338466,0.00170775,-5.21027e-06,4.14483e-08,0.340169,0.00169745,-5.08592e-06,2.09017e-08,0.341861,0.00168734,-5.02322e-06,2.39561e-08,0.343543,0.00167737,-4.95135e-06,3.22852e-08,0.345216,0.00166756,-4.85449e-06,2.57173e-08,0.346878,0.00165793,-4.77734e-06,1.38569e-08,0.348532,0.00164841,-4.73577e-06,3.80634e-08,0.350175,0.00163906,-4.62158e-06,1.27043e-08,0.35181,0.00162985,-4.58347e-06,3.03279e-08,0.353435,0.00162078,-4.49249e-06,1.49961e-08,0.355051,0.00161184,-4.4475e-06,2.88977e-08,0.356659,0.00160303,-4.3608e-06,1.84241e-08,0.358257,0.00159436,-4.30553e-06,1.6616e-08,0.359848,0.0015858,-4.25568e-06,3.43218e-08,0.361429,0.00157739,-4.15272e-06,-4.89172e-09,0.363002,0.00156907,-4.16739e-06,4.48498e-08,0.364567,0.00156087,-4.03284e-06,4.30676e-09,0.366124,0.00155282,-4.01992e-06,2.73303e-08,0.367673,0.00154486,-3.93793e-06,5.58036e-09,0.369214,0.001537,-3.92119e-06,3.97554e-08,0.370747,0.00152928,-3.80193e-06,-1.55904e-08,0.372272,0.00152163,-3.8487e-06,5.24081e-08,0.37379,0.00151409,-3.69147e-06,-1.52272e-08,0.375301,0.00150666,-3.73715e-06,3.83028e-08,0.376804,0.0014993,-3.62225e-06,1.10278e-08,0.378299,0.00149209,-3.58916e-06,6.99326e-09,0.379788,0.00148493,-3.56818e-06,2.06038e-08,0.381269,0.00147786,-3.50637e-06,2.98009e-08,0.382744,0.00147093,-3.41697e-06,-2.05978e-08,0.384211,0.00146404,-3.47876e-06,5.25899e-08,0.385672,0.00145724,-3.32099e-06,-1.09471e-08,0.387126,0.00145056,-3.35383e-06,2.10009e-08,0.388573,0.00144392,-3.29083e-06,1.63501e-08,0.390014,0.00143739,-3.24178e-06,3.00641e-09,0.391448,0.00143091,-3.23276e-06,3.12282e-08,0.392875,0.00142454,-3.13908e-06,-8.70932e-09,0.394297,0.00141824,-3.16521e-06,3.34114e-08,0.395712,0.00141201,-3.06497e-06,-5.72754e-09,0.397121,0.00140586,-3.08215e-06,1.9301e-08,0.398524,0.00139975,-3.02425e-06,1.7931e-08,0.39992,0.00139376,-2.97046e-06,-1.61822e-09,0.401311,0.00138781,-2.97531e-06,1.83442e-08,0.402696,0.00138192,-2.92028e-06,1.76485e-08,0.404075,0.00137613,-2.86733e-06,4.68617e-10,0.405448,0.00137039,-2.86593e-06,1.02794e-08,0.406816,0.00136469,-2.83509e-06,1.80179e-08,0.408178,0.00135908,-2.78104e-06,7.05594e-09,0.409534,0.00135354,-2.75987e-06,1.33633e-08,0.410885,0.00134806,-2.71978e-06,-9.04568e-10,0.41223,0.00134261,-2.72249e-06,2.0057e-08,0.41357,0.00133723,-2.66232e-06,1.00841e-08,0.414905,0.00133194,-2.63207e-06,-7.88835e-10,0.416234,0.00132667,-2.63444e-06,2.28734e-08,0.417558,0.00132147,-2.56582e-06,-1.29785e-09,0.418877,0.00131633,-2.56971e-06,1.21205e-08,0.420191,0.00131123,-2.53335e-06,1.24202e-08,0.421499,0.0013062,-2.49609e-06,-2.19681e-09,0.422803,0.0013012,-2.50268e-06,2.61696e-08,0.424102,0.00129628,-2.42417e-06,-1.30747e-08,0.425396,0.00129139,-2.46339e-06,2.6129e-08,0.426685,0.00128654,-2.38501e-06,-2.03454e-09,0.427969,0.00128176,-2.39111e-06,1.18115e-08,0.429248,0.00127702,-2.35567e-06,1.43932e-08,0.430523,0.00127235,-2.31249e-06,-9.77965e-09,0.431793,0.00126769,-2.34183e-06,2.47253e-08,0.433058,0.00126308,-2.26766e-06,2.85278e-10,0.434319,0.00125855,-2.2668e-06,3.93614e-09,0.435575,0.00125403,-2.25499e-06,1.37722e-08,0.436827,0.00124956,-2.21368e-06,5.79803e-10,0.438074,0.00124513,-2.21194e-06,1.37112e-08,0.439317,0.00124075,-2.1708e-06,4.17973e-09,0.440556,0.00123642,-2.15826e-06,-6.27703e-10,0.44179,0.0012321,-2.16015e-06,2.81332e-08,0.44302,0.00122787,-2.07575e-06,-2.24985e-08,0.444246,0.00122365,-2.14324e-06,3.20586e-08,0.445467,0.00121946,-2.04707e-06,-1.6329e-08,0.446685,0.00121532,-2.09605e-06,3.32573e-08,0.447898,0.00121122,-1.99628e-06,-2.72927e-08,0.449107,0.00120715,-2.07816e-06,4.6111e-08,0.450312,0.00120313,-1.93983e-06,-3.79416e-08,0.451514,0.00119914,-2.05365e-06,4.60507e-08,0.452711,0.00119517,-1.9155e-06,-2.7052e-08,0.453904,0.00119126,-1.99666e-06,3.23551e-08,0.455093,0.00118736,-1.89959e-06,-1.29613e-08,0.456279,0.00118352,-1.93848e-06,1.94905e-08,0.45746,0.0011797,-1.88e-06,-5.39588e-09,0.458638,0.00117593,-1.89619e-06,2.09282e-09,0.459812,0.00117214,-1.88991e-06,2.68267e-08,0.460982,0.00116844,-1.80943e-06,-1.99925e-08,0.462149,0.00116476,-1.86941e-06,2.3341e-08,0.463312,0.00116109,-1.79939e-06,-1.37674e-08,0.464471,0.00115745,-1.84069e-06,3.17287e-08,0.465627,0.00115387,-1.7455e-06,-2.37407e-08,0.466779,0.00115031,-1.81673e-06,3.34315e-08,0.467927,0.00114677,-1.71643e-06,-2.05786e-08,0.469073,0.00114328,-1.77817e-06,1.90802e-08,0.470214,0.00113978,-1.72093e-06,3.86247e-09,0.471352,0.00113635,-1.70934e-06,-4.72759e-09,0.472487,0.00113292,-1.72352e-06,1.50478e-08,0.473618,0.00112951,-1.67838e-06,4.14108e-09,0.474746,0.00112617,-1.66595e-06,-1.80986e-09,0.47587,0.00112283,-1.67138e-06,3.09816e-09,0.476991,0.0011195,-1.66209e-06,1.92198e-08,0.478109,0.00111623,-1.60443e-06,-2.03726e-08,0.479224,0.00111296,-1.66555e-06,3.2468e-08,0.480335,0.00110973,-1.56814e-06,-2.00922e-08,0.481443,0.00110653,-1.62842e-06,1.80983e-08,0.482548,0.00110333,-1.57413e-06,7.30362e-09,0.48365,0.0011002,-1.55221e-06,-1.75107e-08,0.484749,0.00109705,-1.60475e-06,3.29373e-08,0.485844,0.00109393,-1.50594e-06,-2.48315e-08,0.486937,0.00109085,-1.58043e-06,3.65865e-08,0.488026,0.0010878,-1.47067e-06,-3.21078e-08,0.489112,0.00108476,-1.56699e-06,3.22397e-08,0.490195,0.00108172,-1.47027e-06,-7.44391e-09,0.491276,0.00107876,-1.49261e-06,-2.46428e-09,0.492353,0.00107577,-1.5e-06,1.73011e-08,0.493427,0.00107282,-1.4481e-06,-7.13552e-09,0.494499,0.0010699,-1.4695e-06,1.1241e-08,0.495567,0.001067,-1.43578e-06,-8.02637e-09,0.496633,0.0010641,-1.45986e-06,2.08645e-08,0.497695,0.00106124,-1.39726e-06,-1.58271e-08,0.498755,0.0010584,-1.44475e-06,1.26415e-08,0.499812,0.00105555,-1.40682e-06,2.48655e-08,0.500866,0.00105281,-1.33222e-06,-5.24988e-08,0.501918,0.00104999,-1.48972e-06,6.59206e-08,0.502966,0.00104721,-1.29196e-06,-3.237e-08,0.504012,0.00104453,-1.38907e-06,3.95479e-09,0.505055,0.00104176,-1.3772e-06,1.65509e-08,0.506096,0.00103905,-1.32755e-06,-1.05539e-08,0.507133,0.00103637,-1.35921e-06,2.56648e-08,0.508168,0.00103373,-1.28222e-06,-3.25007e-08,0.509201,0.00103106,-1.37972e-06,4.47336e-08,0.51023,0.00102844,-1.24552e-06,-2.72245e-08,0.511258,0.00102587,-1.32719e-06,4.55952e-09,0.512282,0.00102323,-1.31352e-06,8.98645e-09,0.513304,0.00102063,-1.28656e-06,1.90992e-08,0.514323,0.00101811,-1.22926e-06,-2.57786e-08,0.51534,0.00101557,-1.30659e-06,2.44104e-08,0.516355,0.00101303,-1.23336e-06,-1.22581e-08,0.517366,0.00101053,-1.27014e-06,2.4622e-08,0.518376,0.00100806,-1.19627e-06,-2.66253e-08,0.519383,0.00100559,-1.27615e-06,2.22744e-08,0.520387,0.00100311,-1.20932e-06,-2.8679e-09,0.521389,0.00100068,-1.21793e-06,-1.08029e-08,0.522388,0.000998211,-1.25034e-06,4.60795e-08,0.523385,0.000995849,-1.1121e-06,-5.4306e-08,0.52438,0.000993462,-1.27502e-06,5.19354e-08,0.525372,0.000991067,-1.11921e-06,-3.42262e-08,0.526362,0.000988726,-1.22189e-06,2.53646e-08,0.52735,0.000986359,-1.14579e-06,-7.62782e-09,0.528335,0.000984044,-1.16868e-06,5.14668e-09,0.529318,0.000981722,-1.15324e-06,-1.29589e-08,0.530298,0.000979377,-1.19211e-06,4.66888e-08,0.531276,0.000977133,-1.05205e-06,-5.45868e-08,0.532252,0.000974865,-1.21581e-06,5.24495e-08,0.533226,0.000972591,-1.05846e-06,-3.60019e-08,0.534198,0.000970366,-1.16647e-06,3.19537e-08,0.535167,0.000968129,-1.07061e-06,-3.2208e-08,0.536134,0.000965891,-1.16723e-06,3.72738e-08,0.537099,0.000963668,-1.05541e-06,2.32205e-09,0.538061,0.000961564,-1.04844e-06,-4.65618e-08,0.539022,0.000959328,-1.18813e-06,6.47159e-08,0.53998,0.000957146,-9.93979e-07,-3.3488e-08,0.540936,0.000955057,-1.09444e-06,9.63166e-09,0.54189,0.000952897,-1.06555e-06,-5.03871e-09,0.542842,0.000950751,-1.08066e-06,1.05232e-08,0.543792,0.000948621,-1.04909e-06,2.25503e-08,0.544739,0.000946591,-9.81444e-07,-4.11195e-08,0.545685,0.000944504,-1.1048e-06,2.27182e-08,0.546628,0.000942363,-1.03665e-06,9.85146e-09,0.54757,0.000940319,-1.00709e-06,-2.51938e-09,0.548509,0.000938297,-1.01465e-06,2.25858e-10,0.549446,0.000936269,-1.01397e-06,1.61598e-09,0.550381,0.000934246,-1.00913e-06,-6.68983e-09,0.551315,0.000932207,-1.0292e-06,2.51434e-08,0.552246,0.000930224,-9.53765e-07,-3.42793e-08,0.553175,0.000928214,-1.0566e-06,5.23688e-08,0.554102,0.000926258,-8.99497e-07,-5.59865e-08,0.555028,0.000924291,-1.06746e-06,5.23679e-08,0.555951,0.000922313,-9.10352e-07,-3.42763e-08,0.556872,0.00092039,-1.01318e-06,2.51326e-08,0.557792,0.000918439,-9.37783e-07,-6.64954e-09,0.558709,0.000916543,-9.57732e-07,1.46554e-09,0.559625,0.000914632,-9.53335e-07,7.87281e-10,0.560538,0.000912728,-9.50973e-07,-4.61466e-09,0.56145,0.000910812,-9.64817e-07,1.76713e-08,0.56236,0.000908935,-9.11804e-07,-6.46564e-09,0.563268,0.000907092,-9.312e-07,8.19121e-09,0.564174,0.000905255,-9.06627e-07,-2.62992e-08,0.565078,0.000903362,-9.85524e-07,3.74007e-08,0.565981,0.000901504,-8.73322e-07,-4.0942e-09,0.566882,0.000899745,-8.85605e-07,-2.1024e-08,0.56778,0.00089791,-9.48677e-07,2.85854e-08,0.568677,0.000896099,-8.62921e-07,-3.3713e-08,0.569573,0.000894272,-9.64059e-07,4.6662e-08,0.570466,0.000892484,-8.24073e-07,-3.37258e-08,0.571358,0.000890734,-9.25251e-07,2.86365e-08,0.572247,0.00088897,-8.39341e-07,-2.12155e-08,0.573135,0.000887227,-9.02988e-07,-3.37913e-09,0.574022,0.000885411,-9.13125e-07,3.47319e-08,0.574906,0.000883689,-8.08929e-07,-1.63394e-08,0.575789,0.000882022,-8.57947e-07,-2.8979e-08,0.57667,0.00088022,-9.44885e-07,7.26509e-08,0.57755,0.000878548,-7.26932e-07,-8.28106e-08,0.578427,0.000876845,-9.75364e-07,7.97774e-08,0.579303,0.000875134,-7.36032e-07,-5.74849e-08,0.580178,0.00087349,-9.08486e-07,3.09529e-08,0.58105,0.000871765,-8.15628e-07,-6.72206e-09,0.581921,0.000870114,-8.35794e-07,-4.06451e-09,0.582791,0.00086843,-8.47987e-07,2.29799e-08,0.583658,0.000866803,-7.79048e-07,-2.82503e-08,0.584524,0.00086516,-8.63799e-07,3.04167e-08,0.585388,0.000863524,-7.72548e-07,-3.38119e-08,0.586251,0.000861877,-8.73984e-07,4.52264e-08,0.587112,0.000860265,-7.38305e-07,-2.78842e-08,0.587972,0.000858705,-8.21958e-07,6.70567e-09,0.58883,0.000857081,-8.01841e-07,1.06161e-09,0.589686,0.000855481,-7.98656e-07,-1.09521e-08,0.590541,0.00085385,-8.31512e-07,4.27468e-08,0.591394,0.000852316,-7.03272e-07,-4.08257e-08,0.592245,0.000850787,-8.25749e-07,1.34677e-09,0.593095,0.000849139,-8.21709e-07,3.54387e-08,0.593944,0.000847602,-7.15393e-07,-2.38924e-08,0.59479,0.0008461,-7.8707e-07,5.26143e-10,0.595636,0.000844527,-7.85491e-07,2.17879e-08,0.596479,0.000843021,-7.20127e-07,-2.80733e-08,0.597322,0.000841497,-8.04347e-07,3.09005e-08,0.598162,0.000839981,-7.11646e-07,-3.5924e-08,0.599002,0.00083845,-8.19418e-07,5.3191e-08,0.599839,0.000836971,-6.59845e-07,-5.76307e-08,0.600676,0.000835478,-8.32737e-07,5.81227e-08,0.60151,0.000833987,-6.58369e-07,-5.56507e-08,0.602344,0.000832503,-8.25321e-07,4.52706e-08,0.603175,0.000830988,-6.89509e-07,-6.22236e-09,0.604006,0.000829591,-7.08176e-07,-2.03811e-08,0.604834,0.000828113,-7.6932e-07,2.8142e-08,0.605662,0.000826659,-6.84894e-07,-3.25822e-08,0.606488,0.000825191,-7.8264e-07,4.25823e-08,0.607312,0.000823754,-6.54893e-07,-1.85376e-08,0.608135,0.000822389,-7.10506e-07,-2.80365e-08,0.608957,0.000820883,-7.94616e-07,7.1079e-08,0.609777,0.000819507,-5.81379e-07,-7.74655e-08,0.610596,0.000818112,-8.13775e-07,5.9969e-08,0.611413,0.000816665,-6.33868e-07,-4.32013e-08,0.612229,0.000815267,-7.63472e-07,5.32313e-08,0.613044,0.0008139,-6.03778e-07,-5.05148e-08,0.613857,0.000812541,-7.55323e-07,2.96187e-08,0.614669,0.000811119,-6.66466e-07,-8.35545e-09,0.615479,0.000809761,-6.91533e-07,3.80301e-09,0.616288,0.00080839,-6.80124e-07,-6.85666e-09,0.617096,0.000807009,-7.00694e-07,2.36237e-08,0.617903,0.000805678,-6.29822e-07,-2.80336e-08,0.618708,0.000804334,-7.13923e-07,2.8906e-08,0.619511,0.000802993,-6.27205e-07,-2.79859e-08,0.620314,0.000801655,-7.11163e-07,2.34329e-08,0.621114,0.000800303,-6.40864e-07,-6.14108e-09,0.621914,0.000799003,-6.59287e-07,1.13151e-09,0.622712,0.000797688,-6.55893e-07,1.61507e-09,0.62351,0.000796381,-6.51048e-07,-7.59186e-09,0.624305,0.000795056,-6.73823e-07,2.87524e-08,0.6251,0.000793794,-5.87566e-07,-4.7813e-08,0.625893,0.000792476,-7.31005e-07,4.32901e-08,0.626685,0.000791144,-6.01135e-07,-6.13814e-09,0.627475,0.000789923,-6.19549e-07,-1.87376e-08,0.628264,0.000788628,-6.75762e-07,2.14837e-08,0.629052,0.000787341,-6.11311e-07,-7.59265e-09,0.629839,0.000786095,-6.34089e-07,8.88692e-09,0.630625,0.000784854,-6.07428e-07,-2.7955e-08,0.631409,0.000783555,-6.91293e-07,4.33285e-08,0.632192,0.000782302,-5.61307e-07,-2.61497e-08,0.632973,0.000781101,-6.39757e-07,1.6658e-09,0.633754,0.000779827,-6.34759e-07,1.94866e-08,0.634533,0.000778616,-5.76299e-07,-2.00076e-08,0.635311,0.000777403,-6.36322e-07,9.39091e-10,0.636088,0.000776133,-6.33505e-07,1.62512e-08,0.636863,0.000774915,-5.84751e-07,-6.33937e-09,0.637638,0.000773726,-6.03769e-07,9.10609e-09,0.638411,0.000772546,-5.76451e-07,-3.00849e-08,0.639183,0.000771303,-6.66706e-07,5.1629e-08,0.639953,0.000770125,-5.11819e-07,-5.7222e-08,0.640723,0.000768929,-6.83485e-07,5.80497e-08,0.641491,0.000767736,-5.09336e-07,-5.57674e-08,0.642259,0.000766551,-6.76638e-07,4.58105e-08,0.643024,0.000765335,-5.39206e-07,-8.26541e-09,0.643789,0.000764231,-5.64002e-07,-1.27488e-08,0.644553,0.000763065,-6.02249e-07,-3.44168e-10,0.645315,0.00076186,-6.03281e-07,1.41254e-08,0.646077,0.000760695,-5.60905e-07,3.44727e-09,0.646837,0.000759584,-5.50563e-07,-2.79144e-08,0.647596,0.000758399,-6.34307e-07,4.86057e-08,0.648354,0.000757276,-4.88489e-07,-4.72989e-08,0.64911,0.000756158,-6.30386e-07,2.13807e-08,0.649866,0.000754961,-5.66244e-07,2.13808e-08,0.65062,0.000753893,-5.02102e-07,-4.7299e-08,0.651374,0.000752746,-6.43999e-07,4.86059e-08,0.652126,0.000751604,-4.98181e-07,-2.79154e-08,0.652877,0.000750524,-5.81927e-07,3.45089e-09,0.653627,0.000749371,-5.71575e-07,1.41119e-08,0.654376,0.00074827,-5.29239e-07,-2.93748e-10,0.655123,0.00074721,-5.3012e-07,-1.29368e-08,0.65587,0.000746111,-5.68931e-07,-7.56355e-09,0.656616,0.000744951,-5.91621e-07,4.3191e-08,0.65736,0.000743897,-4.62048e-07,-4.59911e-08,0.658103,0.000742835,-6.00022e-07,2.15642e-08,0.658846,0.0007417,-5.35329e-07,1.93389e-08,0.659587,0.000740687,-4.77312e-07,-3.93152e-08,0.660327,0.000739615,-5.95258e-07,1.87126e-08,0.661066,0.00073848,-5.3912e-07,2.40695e-08,0.661804,0.000737474,-4.66912e-07,-5.53859e-08,0.662541,0.000736374,-6.33069e-07,7.82648e-08,0.663277,0.000735343,-3.98275e-07,-7.88593e-08,0.664012,0.00073431,-6.34853e-07,5.83585e-08,0.664745,0.000733215,-4.59777e-07,-3.53656e-08,0.665478,0.000732189,-5.65874e-07,2.34994e-08,0.66621,0.000731128,-4.95376e-07,9.72743e-10,0.66694,0.00073014,-4.92458e-07,-2.73903e-08,0.66767,0.000729073,-5.74629e-07,4.89839e-08,0.668398,0.000728071,-4.27677e-07,-4.93359e-08,0.669126,0.000727068,-5.75685e-07,2.91504e-08,0.669853,0.000726004,-4.88234e-07,-7.66109e-09,0.670578,0.000725004,-5.11217e-07,1.49392e-09,0.671303,0.000723986,-5.06735e-07,1.68533e-09,0.672026,0.000722978,-5.01679e-07,-8.23525e-09,0.672749,0.00072195,-5.26385e-07,3.12556e-08,0.67347,0.000720991,-4.32618e-07,-5.71825e-08,0.674191,0.000719954,-6.04166e-07,7.8265e-08,0.67491,0.00071898,-3.69371e-07,-7.70634e-08,0.675628,0.00071801,-6.00561e-07,5.11747e-08,0.676346,0.000716963,-4.47037e-07,-8.42615e-09,0.677062,0.000716044,-4.72315e-07,-1.747e-08,0.677778,0.000715046,-5.24725e-07,1.87015e-08,0.678493,0.000714053,-4.68621e-07,2.26856e-09,0.679206,0.000713123,-4.61815e-07,-2.77758e-08,0.679919,0.000712116,-5.45142e-07,4.92298e-08,0.68063,0.000711173,-3.97453e-07,-4.99339e-08,0.681341,0.000710228,-5.47255e-07,3.12967e-08,0.682051,0.000709228,-4.53365e-07,-1.56481e-08,0.68276,0.000708274,-5.00309e-07,3.12958e-08,0.683467,0.000707367,-4.06422e-07,-4.99303e-08,0.684174,0.000706405,-5.56213e-07,4.9216e-08,0.68488,0.00070544,-4.08565e-07,-2.77245e-08,0.685585,0.00070454,-4.91738e-07,2.07748e-09,0.686289,0.000703562,-4.85506e-07,1.94146e-08,0.686992,0.00070265,-4.27262e-07,-2.01314e-08,0.687695,0.000701735,-4.87656e-07,1.50616e-09,0.688396,0.000700764,-4.83137e-07,1.41067e-08,0.689096,0.00069984,-4.40817e-07,1.67168e-09,0.689795,0.000698963,-4.35802e-07,-2.07934e-08,0.690494,0.000698029,-4.98182e-07,2.18972e-08,0.691192,0.000697099,-4.32491e-07,-7.19092e-09,0.691888,0.000696212,-4.54064e-07,6.86642e-09,0.692584,0.000695325,-4.33464e-07,-2.02747e-08,0.693279,0.000694397,-4.94288e-07,1.46279e-08,0.693973,0.000693452,-4.50405e-07,2.13678e-08,0.694666,0.000692616,-3.86301e-07,-4.04945e-08,0.695358,0.000691721,-5.07785e-07,2.14009e-08,0.696049,0.00069077,-4.43582e-07,1.44955e-08,0.69674,0.000689926,-4.00096e-07,-1.97783e-08,0.697429,0.000689067,-4.5943e-07,5.01296e-09,0.698118,0.000688163,-4.44392e-07,-2.73521e-10,0.698805,0.000687273,-4.45212e-07,-3.91893e-09,0.699492,0.000686371,-4.56969e-07,1.59493e-08,0.700178,0.000685505,-4.09121e-07,-2.73351e-10,0.700863,0.000684686,-4.09941e-07,-1.4856e-08,0.701548,0.000683822,-4.54509e-07,9.25979e-11,0.702231,0.000682913,-4.54231e-07,1.44855e-08,0.702913,0.000682048,-4.10775e-07,1.56992e-09,0.703595,0.000681231,-4.06065e-07,-2.07652e-08,0.704276,0.000680357,-4.68361e-07,2.18864e-08,0.704956,0.000679486,-4.02701e-07,-7.17595e-09,0.705635,0.000678659,-4.24229e-07,6.81748e-09,0.706313,0.000677831,-4.03777e-07,-2.0094e-08,0.70699,0.000676963,-4.64059e-07,1.39538e-08,0.707667,0.000676077,-4.22197e-07,2.38835e-08,0.708343,0.000675304,-3.50547e-07,-4.98831e-08,0.709018,0.000674453,-5.00196e-07,5.64395e-08,0.709692,0.000673622,-3.30878e-07,-5.66657e-08,0.710365,0.00067279,-5.00875e-07,5.1014e-08,0.711037,0.000671942,-3.47833e-07,-2.81809e-08,0.711709,0.000671161,-4.32376e-07,2.10513e-09,0.712379,0.000670303,-4.2606e-07,1.97604e-08,0.713049,0.00066951,-3.66779e-07,-2.15422e-08,0.713718,0.000668712,-4.31406e-07,6.8038e-09,0.714387,0.000667869,-4.10994e-07,-5.67295e-09,0.715054,0.00066703,-4.28013e-07,1.5888e-08,0.715721,0.000666222,-3.80349e-07,1.72576e-09,0.716387,0.000665467,-3.75172e-07,-2.27911e-08,0.717052,0.000664648,-4.43545e-07,2.9834e-08,0.717716,0.00066385,-3.54043e-07,-3.69401e-08,0.718379,0.000663031,-4.64864e-07,5.83219e-08,0.719042,0.000662277,-2.89898e-07,-7.71382e-08,0.719704,0.000661465,-5.21313e-07,7.14171e-08,0.720365,0.000660637,-3.07061e-07,-2.97161e-08,0.721025,0.000659934,-3.96209e-07,-1.21575e-08,0.721685,0.000659105,-4.32682e-07,1.87412e-08,0.722343,0.000658296,-3.76458e-07,-3.2029e-09,0.723001,0.000657533,-3.86067e-07,-5.9296e-09,0.723659,0.000656743,-4.03856e-07,2.69213e-08,0.724315,0.000656016,-3.23092e-07,-4.21511e-08,0.724971,0.000655244,-4.49545e-07,2.24737e-08,0.725625,0.000654412,-3.82124e-07,1.18611e-08,0.726279,0.000653683,-3.46541e-07,-1.03132e-08,0.726933,0.000652959,-3.7748e-07,-3.02128e-08,0.727585,0.000652114,-4.68119e-07,7.15597e-08,0.728237,0.000651392,-2.5344e-07,-7.72119e-08,0.728888,0.000650654,-4.85075e-07,5.8474e-08,0.729538,0.000649859,-3.09654e-07,-3.74746e-08,0.730188,0.000649127,-4.22077e-07,3.18197e-08,0.730837,0.000648379,-3.26618e-07,-3.01997e-08,0.731485,0.000647635,-4.17217e-07,2.93747e-08,0.732132,0.000646888,-3.29093e-07,-2.76943e-08,0.732778,0.000646147,-4.12176e-07,2.17979e-08,0.733424,0.000645388,-3.46783e-07,1.07292e-10,0.734069,0.000644695,-3.46461e-07,-2.22271e-08,0.734713,0.000643935,-4.13142e-07,2.91963e-08,0.735357,0.000643197,-3.25553e-07,-3.49536e-08,0.736,0.000642441,-4.30414e-07,5.10133e-08,0.736642,0.000641733,-2.77374e-07,-4.98904e-08,0.737283,0.000641028,-4.27045e-07,2.93392e-08,0.737924,0.000640262,-3.39028e-07,-7.86156e-09,0.738564,0.000639561,-3.62612e-07,2.10703e-09,0.739203,0.000638842,-3.56291e-07,-5.6653e-10,0.739842,0.000638128,-3.57991e-07,1.59086e-10,0.740479,0.000637412,-3.57513e-07,-6.98321e-11,0.741116,0.000636697,-3.57723e-07,1.20214e-10,0.741753,0.000635982,-3.57362e-07,-4.10987e-10,0.742388,0.000635266,-3.58595e-07,1.5237e-09,0.743023,0.000634553,-3.54024e-07,-5.68376e-09,0.743657,0.000633828,-3.71075e-07,2.12113e-08,0.744291,0.00063315,-3.07441e-07,-1.95569e-08,0.744924,0.000632476,-3.66112e-07,-2.58816e-09,0.745556,0.000631736,-3.73877e-07,2.99096e-08,0.746187,0.000631078,-2.84148e-07,-5.74454e-08,0.746818,0.000630337,-4.56484e-07,8.06629e-08,0.747448,0.000629666,-2.14496e-07,-8.63922e-08,0.748077,0.000628978,-4.73672e-07,8.60918e-08,0.748706,0.000628289,-2.15397e-07,-7.91613e-08,0.749334,0.000627621,-4.5288e-07,5.17393e-08,0.749961,0.00062687,-2.97663e-07,-8.58662e-09,0.750588,0.000626249,-3.23422e-07,-1.73928e-08,0.751214,0.00062555,-3.75601e-07,1.85532e-08,0.751839,0.000624855,-3.19941e-07,2.78479e-09,0.752463,0.000624223,-3.11587e-07,-2.96923e-08,0.753087,0.000623511,-4.00664e-07,5.63799e-08,0.75371,0.000622879,-2.31524e-07,-7.66179e-08,0.754333,0.000622186,-4.61378e-07,7.12778e-08,0.754955,0.000621477,-2.47545e-07,-2.96794e-08,0.755576,0.000620893,-3.36583e-07,-1.21648e-08,0.756196,0.000620183,-3.73077e-07,1.87339e-08,0.756816,0.000619493,-3.16875e-07,-3.16622e-09,0.757435,0.00061885,-3.26374e-07,-6.0691e-09,0.758054,0.000618179,-3.44581e-07,2.74426e-08,0.758672,0.000617572,-2.62254e-07,-4.40968e-08,0.759289,0.000616915,-3.94544e-07,2.97352e-08,0.759906,0.000616215,-3.05338e-07,-1.52393e-08,0.760522,0.000615559,-3.51056e-07,3.12221e-08,0.761137,0.000614951,-2.5739e-07,-5.00443e-08,0.761751,0.000614286,-4.07523e-07,4.9746e-08,0.762365,0.00061362,-2.58285e-07,-2.97303e-08,0.762979,0.000613014,-3.47476e-07,9.57079e-09,0.763591,0.000612348,-3.18764e-07,-8.55287e-09,0.764203,0.000611685,-3.44422e-07,2.46407e-08,0.764815,0.00061107,-2.705e-07,-3.04053e-08,0.765426,0.000610437,-3.61716e-07,3.73759e-08,0.766036,0.000609826,-2.49589e-07,-5.94935e-08,0.766645,0.000609149,-4.28069e-07,8.13889e-08,0.767254,0.000608537,-1.83902e-07,-8.72483e-08,0.767862,0.000607907,-4.45647e-07,8.87901e-08,0.76847,0.000607282,-1.79277e-07,-8.90983e-08,0.769077,0.000606656,-4.46572e-07,8.87892e-08,0.769683,0.000606029,-1.80204e-07,-8.72446e-08,0.770289,0.000605407,-4.41938e-07,8.13752e-08,0.770894,0.000604768,-1.97812e-07,-5.94423e-08,0.771498,0.000604194,-3.76139e-07,3.71848e-08,0.772102,0.000603553,-2.64585e-07,-2.96922e-08,0.772705,0.000602935,-3.53661e-07,2.19793e-08,0.773308,0.000602293,-2.87723e-07,1.37955e-09,0.77391,0.000601722,-2.83585e-07,-2.74976e-08,0.774512,0.000601072,-3.66077e-07,4.9006e-08,0.775112,0.000600487,-2.19059e-07,-4.93171e-08,0.775712,0.000599901,-3.67011e-07,2.90531e-08,0.776312,0.000599254,-2.79851e-07,-7.29081e-09,0.776911,0.000598673,-3.01724e-07,1.10077e-10,0.777509,0.00059807,-3.01393e-07,6.85053e-09,0.778107,0.000597487,-2.80842e-07,-2.75123e-08,0.778704,0.000596843,-3.63379e-07,4.35939e-08,0.779301,0.000596247,-2.32597e-07,-2.7654e-08,0.779897,0.000595699,-3.15559e-07,7.41741e-09,0.780492,0.00059509,-2.93307e-07,-2.01562e-09,0.781087,0.000594497,-2.99354e-07,6.45059e-10,0.781681,0.000593901,-2.97418e-07,-5.64635e-10,0.782275,0.000593304,-2.99112e-07,1.61347e-09,0.782868,0.000592711,-2.94272e-07,-5.88926e-09,0.78346,0.000592105,-3.1194e-07,2.19436e-08,0.784052,0.000591546,-2.46109e-07,-2.22805e-08,0.784643,0.000590987,-3.1295e-07,7.57368e-09,0.785234,0.000590384,-2.90229e-07,-8.01428e-09,0.785824,0.00058978,-3.14272e-07,2.44834e-08,0.786414,0.000589225,-2.40822e-07,-3.03148e-08,0.787003,0.000588652,-3.31766e-07,3.7171e-08,0.787591,0.0005881,-2.20253e-07,-5.87646e-08,0.788179,0.000587483,-3.96547e-07,7.86782e-08,0.788766,0.000586926,-1.60512e-07,-7.71342e-08,0.789353,0.000586374,-3.91915e-07,5.10444e-08,0.789939,0.000585743,-2.38782e-07,-7.83422e-09,0.790524,0.000585242,-2.62284e-07,-1.97076e-08,0.791109,0.000584658,-3.21407e-07,2.70598e-08,0.791693,0.000584097,-2.40228e-07,-2.89269e-08,0.792277,0.000583529,-3.27008e-07,2.90431e-08,0.792861,0.000582963,-2.39879e-07,-2.76409e-08,0.793443,0.0005824,-3.22802e-07,2.1916e-08,0.794025,0.00058182,-2.57054e-07,-4.18368e-10,0.794607,0.000581305,-2.58309e-07,-2.02425e-08,0.795188,0.000580727,-3.19036e-07,2.17838e-08,0.795768,0.000580155,-2.53685e-07,-7.28814e-09,0.796348,0.000579625,-2.75549e-07,7.36871e-09,0.796928,0.000579096,-2.53443e-07,-2.21867e-08,0.797506,0.000578523,-3.20003e-07,2.17736e-08,0.798085,0.000577948,-2.54683e-07,-5.30296e-09,0.798662,0.000577423,-2.70592e-07,-5.61698e-10,0.799239,0.00057688,-2.72277e-07,7.54977e-09,0.799816,0.000576358,-2.49627e-07,-2.96374e-08,0.800392,0.00057577,-3.38539e-07,5.1395e-08,0.800968,0.000575247,-1.84354e-07,-5.67335e-08,0.801543,0.000574708,-3.54555e-07,5.63297e-08,0.802117,0.000574168,-1.85566e-07,-4.93759e-08,0.802691,0.000573649,-3.33693e-07,2.19646e-08,0.803264,0.000573047,-2.678e-07,2.1122e-08,0.803837,0.000572575,-2.04433e-07,-4.68482e-08,0.804409,0.000572026,-3.44978e-07,4.70613e-08,0.804981,0.000571477,-2.03794e-07,-2.21877e-08,0.805552,0.000571003,-2.70357e-07,-1.79153e-08,0.806123,0.000570408,-3.24103e-07,3.42443e-08,0.806693,0.000569863,-2.2137e-07,1.47556e-10,0.807263,0.000569421,-2.20928e-07,-3.48345e-08,0.807832,0.000568874,-3.25431e-07,1.99812e-08,0.808401,0.000568283,-2.65487e-07,1.45143e-08,0.808969,0.000567796,-2.21945e-07,-1.84338e-08,0.809536,0.000567297,-2.77246e-07,-3.83608e-10,0.810103,0.000566741,-2.78397e-07,1.99683e-08,0.81067,0.000566244,-2.18492e-07,-1.98848e-08,0.811236,0.000565747,-2.78146e-07,-3.38976e-11,0.811801,0.000565191,-2.78248e-07,2.00204e-08,0.812366,0.000564695,-2.18187e-07,-2.04429e-08,0.812931,0.000564197,-2.79516e-07,2.1467e-09,0.813495,0.000563644,-2.73076e-07,1.18561e-08,0.814058,0.000563134,-2.37507e-07,1.00334e-08,0.814621,0.000562689,-2.07407e-07,-5.19898e-08,0.815183,0.000562118,-3.63376e-07,7.87163e-08,0.815745,0.000561627,-1.27227e-07,-8.40616e-08,0.816306,0.000561121,-3.79412e-07,7.87163e-08,0.816867,0.000560598,-1.43263e-07,-5.19898e-08,0.817428,0.000560156,-2.99233e-07,1.00335e-08,0.817988,0.000559587,-2.69132e-07,1.18559e-08,0.818547,0.000559085,-2.33564e-07,2.14764e-09,0.819106,0.000558624,-2.27122e-07,-2.04464e-08,0.819664,0.000558108,-2.88461e-07,2.00334e-08,0.820222,0.000557591,-2.28361e-07,-8.24277e-11,0.820779,0.000557135,-2.28608e-07,-1.97037e-08,0.821336,0.000556618,-2.87719e-07,1.92925e-08,0.821893,0.000556101,-2.29841e-07,2.13831e-09,0.822448,0.000555647,-2.23427e-07,-2.78458e-08,0.823004,0.000555117,-3.06964e-07,4.96402e-08,0.823559,0.000554652,-1.58043e-07,-5.15058e-08,0.824113,0.000554181,-3.12561e-07,3.71737e-08,0.824667,0.000553668,-2.0104e-07,-3.75844e-08,0.82522,0.000553153,-3.13793e-07,5.35592e-08,0.825773,0.000552686,-1.53115e-07,-5.74431e-08,0.826326,0.000552207,-3.25444e-07,5.7004e-08,0.826878,0.000551728,-1.54433e-07,-5.13635e-08,0.827429,0.000551265,-3.08523e-07,2.92406e-08,0.82798,0.000550735,-2.20801e-07,-5.99424e-09,0.828531,0.000550276,-2.38784e-07,-5.26363e-09,0.829081,0.000549782,-2.54575e-07,2.70488e-08,0.82963,0.000549354,-1.73429e-07,-4.33268e-08,0.83018,0.000548878,-3.03409e-07,2.7049e-08,0.830728,0.000548352,-2.22262e-07,-5.26461e-09,0.831276,0.000547892,-2.38056e-07,-5.99057e-09,0.831824,0.000547397,-2.56027e-07,2.92269e-08,0.832371,0.000546973,-1.68347e-07,-5.13125e-08,0.832918,0.000546482,-3.22284e-07,5.68139e-08,0.833464,0.000546008,-1.51843e-07,-5.67336e-08,0.83401,0.000545534,-3.22043e-07,5.09113e-08,0.834555,0.000545043,-1.6931e-07,-2.77022e-08,0.8351,0.000544621,-2.52416e-07,2.92924e-10,0.835644,0.000544117,-2.51537e-07,2.65305e-08,0.836188,0.000543694,-1.71946e-07,-4.68105e-08,0.836732,0.00054321,-3.12377e-07,4.15021e-08,0.837275,0.000542709,-1.87871e-07,1.13355e-11,0.837817,0.000542334,-1.87837e-07,-4.15474e-08,0.838359,0.000541833,-3.12479e-07,4.69691e-08,0.838901,0.000541349,-1.71572e-07,-2.71196e-08,0.839442,0.000540925,-2.52931e-07,1.90462e-09,0.839983,0.000540425,-2.47217e-07,1.95011e-08,0.840523,0.000539989,-1.88713e-07,-2.03045e-08,0.841063,0.00053955,-2.49627e-07,2.11216e-09,0.841602,0.000539057,-2.4329e-07,1.18558e-08,0.842141,0.000538606,-2.07723e-07,1.00691e-08,0.842679,0.000538221,-1.77516e-07,-5.21324e-08,0.843217,0.00053771,-3.33913e-07,7.92513e-08,0.843755,0.00053728,-9.6159e-08,-8.60587e-08,0.844292,0.000536829,-3.54335e-07,8.61696e-08,0.844828,0.000536379,-9.58263e-08,-7.98057e-08,0.845364,0.000535948,-3.35243e-07,5.42394e-08,0.8459,0.00053544,-1.72525e-07,-1.79426e-08,0.846435,0.000535041,-2.26353e-07,1.75308e-08,0.84697,0.000534641,-1.73761e-07,-5.21806e-08,0.847505,0.000534137,-3.30302e-07,7.19824e-08,0.848038,0.000533692,-1.14355e-07,-5.69349e-08,0.848572,0.000533293,-2.8516e-07,3.65479e-08,0.849105,0.000532832,-1.75516e-07,-2.96519e-08,0.849638,0.000532392,-2.64472e-07,2.2455e-08,0.85017,0.000531931,-1.97107e-07,-5.63451e-10,0.850702,0.000531535,-1.98797e-07,-2.02011e-08,0.851233,0.000531077,-2.59401e-07,2.17634e-08,0.851764,0.000530623,-1.94111e-07,-7.24794e-09,0.852294,0.000530213,-2.15854e-07,7.22832e-09,0.852824,0.000529803,-1.94169e-07,-2.16653e-08,0.853354,0.00052935,-2.59165e-07,1.98283e-08,0.853883,0.000528891,-1.9968e-07,1.95678e-09,0.854412,0.000528497,-1.9381e-07,-2.76554e-08,0.85494,0.000528027,-2.76776e-07,4.90603e-08,0.855468,0.00052762,-1.29596e-07,-4.93764e-08,0.855995,0.000527213,-2.77725e-07,2.92361e-08,0.856522,0.000526745,-1.90016e-07,-7.96341e-09,0.857049,0.000526341,-2.13907e-07,2.61752e-09,0.857575,0.000525922,-2.06054e-07,-2.50665e-09,0.8581,0.000525502,-2.13574e-07,7.40906e-09,0.858626,0.000525097,-1.91347e-07,-2.71296e-08,0.859151,0.000524633,-2.72736e-07,4.15048e-08,0.859675,0.000524212,-1.48221e-07,-1.96802e-08,0.860199,0.000523856,-2.07262e-07,-2.23886e-08,0.860723,0.000523375,-2.74428e-07,4.96299e-08,0.861246,0.000522975,-1.25538e-07,-5.69216e-08,0.861769,0.000522553,-2.96303e-07,5.88473e-08,0.862291,0.000522137,-1.19761e-07,-5.92584e-08,0.862813,0.00052172,-2.97536e-07,5.8977e-08,0.863334,0.000521301,-1.20605e-07,-5.74403e-08,0.863855,0.000520888,-2.92926e-07,5.15751e-08,0.864376,0.000520457,-1.38201e-07,-2.96506e-08,0.864896,0.000520091,-2.27153e-07,7.42277e-09,0.865416,0.000519659,-2.04885e-07,-4.05057e-11,0.865936,0.00051925,-2.05006e-07,-7.26074e-09,0.866455,0.000518818,-2.26788e-07,2.90835e-08,0.866973,0.000518451,-1.39538e-07,-4.94686e-08,0.867492,0.000518024,-2.87944e-07,4.95814e-08,0.868009,0.000517597,-1.39199e-07,-2.96479e-08,0.868527,0.000517229,-2.28143e-07,9.40539e-09,0.869044,0.000516801,-1.99927e-07,-7.9737e-09,0.86956,0.000516378,-2.23848e-07,2.24894e-08,0.870077,0.000515997,-1.5638e-07,-2.23793e-08,0.870592,0.000515617,-2.23517e-07,7.42302e-09,0.871108,0.000515193,-2.01248e-07,-7.31283e-09,0.871623,0.000514768,-2.23187e-07,2.18283e-08,0.872137,0.000514387,-1.57702e-07,-2.03959e-08,0.872652,0.000514011,-2.1889e-07,1.50711e-10,0.873165,0.000513573,-2.18437e-07,1.97931e-08,0.873679,0.000513196,-1.59058e-07,-1.97183e-08,0.874192,0.000512819,-2.18213e-07,-5.24324e-10,0.874704,0.000512381,-2.19786e-07,2.18156e-08,0.875217,0.000512007,-1.54339e-07,-2.71336e-08,0.875728,0.000511616,-2.3574e-07,2.71141e-08,0.87624,0.000511226,-1.54398e-07,-2.17182e-08,0.876751,0.000510852,-2.19552e-07,1.54131e-10,0.877262,0.000510414,-2.1909e-07,2.11017e-08,0.877772,0.000510039,-1.55785e-07,-2.49562e-08,0.878282,0.000509652,-2.30654e-07,1.91183e-08,0.878791,0.000509248,-1.73299e-07,8.08751e-09,0.8793,0.000508926,-1.49036e-07,-5.14684e-08,0.879809,0.000508474,-3.03441e-07,7.85766e-08,0.880317,0.000508103,-6.77112e-08,-8.40242e-08,0.880825,0.000507715,-3.19784e-07,7.87063e-08,0.881333,0.000507312,-8.36649e-08,-5.19871e-08,0.88184,0.000506988,-2.39626e-07,1.00327e-08,0.882346,0.000506539,-2.09528e-07,1.18562e-08,0.882853,0.000506156,-1.73959e-07,2.14703e-09,0.883359,0.000505814,-1.67518e-07,-2.04444e-08,0.883864,0.000505418,-2.28851e-07,2.00258e-08,0.88437,0.00050502,-1.68774e-07,-5.42855e-11,0.884874,0.000504682,-1.68937e-07,-1.98087e-08,0.885379,0.000504285,-2.28363e-07,1.96842e-08,0.885883,0.000503887,-1.6931e-07,6.76342e-10,0.886387,0.000503551,-1.67281e-07,-2.23896e-08,0.88689,0.000503149,-2.3445e-07,2.92774e-08,0.887393,0.000502768,-1.46618e-07,-3.51152e-08,0.887896,0.00050237,-2.51963e-07,5.15787e-08,0.888398,0.00050202,-9.72271e-08,-5.19903e-08,0.8889,0.00050167,-2.53198e-07,3.71732e-08,0.889401,0.000501275,-1.41678e-07,-3.70978e-08,0.889902,0.00050088,-2.52972e-07,5.16132e-08,0.890403,0.000500529,-9.81321e-08,-5.01459e-08,0.890903,0.000500183,-2.4857e-07,2.9761e-08,0.891403,0.000499775,-1.59287e-07,-9.29351e-09,0.891903,0.000499428,-1.87167e-07,7.41301e-09,0.892402,0.000499076,-1.64928e-07,-2.03585e-08,0.892901,0.000498685,-2.26004e-07,1.44165e-08,0.893399,0.000498276,-1.82754e-07,2.22974e-08,0.893898,0.000497978,-1.15862e-07,-4.40013e-08,0.894395,0.000497614,-2.47866e-07,3.44985e-08,0.894893,0.000497222,-1.44371e-07,-3.43882e-08,0.89539,0.00049683,-2.47535e-07,4.34497e-08,0.895886,0.000496465,-1.17186e-07,-2.02012e-08,0.896383,0.00049617,-1.7779e-07,-2.22497e-08,0.896879,0.000495748,-2.44539e-07,4.95952e-08,0.897374,0.000495408,-9.57532e-08,-5.69217e-08,0.89787,0.000495045,-2.66518e-07,5.88823e-08,0.898364,0.000494689,-8.98713e-08,-5.93983e-08,0.898859,0.000494331,-2.68066e-07,5.95017e-08,0.899353,0.000493973,-8.95613e-08,-5.9399e-08,0.899847,0.000493616,-2.67758e-07,5.8885e-08,0.90034,0.000493257,-9.11033e-08,-5.69317e-08,0.900833,0.000492904,-2.61898e-07,4.96326e-08,0.901326,0.000492529,-1.13001e-07,-2.23893e-08,0.901819,0.000492236,-1.80169e-07,-1.968e-08,0.902311,0.000491817,-2.39209e-07,4.15047e-08,0.902802,0.000491463,-1.14694e-07,-2.71296e-08,0.903293,0.000491152,-1.96083e-07,7.409e-09,0.903784,0.000490782,-1.73856e-07,-2.50645e-09,0.904275,0.000490427,-1.81376e-07,2.61679e-09,0.904765,0.000490072,-1.73525e-07,-7.96072e-09,0.905255,0.000489701,-1.97407e-07,2.92261e-08,0.905745,0.000489394,-1.09729e-07,-4.93389e-08,0.906234,0.000489027,-2.57746e-07,4.89204e-08,0.906723,0.000488658,-1.10985e-07,-2.71333e-08,0.907211,0.000488354,-1.92385e-07,8.30861e-12,0.907699,0.00048797,-1.9236e-07,2.71001e-08,0.908187,0.000487666,-1.1106e-07,-4.88041e-08,0.908675,0.000487298,-2.57472e-07,4.89069e-08,0.909162,0.000486929,-1.10751e-07,-2.76143e-08,0.909649,0.000486625,-1.93594e-07,1.9457e-09,0.910135,0.000486244,-1.87757e-07,1.98315e-08,0.910621,0.000485928,-1.28262e-07,-2.16671e-08,0.911107,0.000485606,-1.93264e-07,7.23216e-09,0.911592,0.000485241,-1.71567e-07,-7.26152e-09,0.912077,0.000484877,-1.93352e-07,2.18139e-08,0.912562,0.000484555,-1.2791e-07,-2.03895e-08,0.913047,0.000484238,-1.89078e-07,1.39494e-10,0.913531,0.000483861,-1.8866e-07,1.98315e-08,0.914014,0.000483543,-1.29165e-07,-1.98609e-08,0.914498,0.000483225,-1.88748e-07,7.39912e-12,0.914981,0.000482847,-1.88726e-07,1.98313e-08,0.915463,0.000482529,-1.29232e-07,-1.9728e-08,0.915946,0.000482212,-1.88416e-07,-5.24035e-10,0.916428,0.000481833,-1.89988e-07,2.18241e-08,0.916909,0.000481519,-1.24516e-07,-2.71679e-08,0.917391,0.000481188,-2.06019e-07,2.72427e-08,0.917872,0.000480858,-1.24291e-07,-2.21985e-08,0.918353,0.000480543,-1.90886e-07,1.94644e-09,0.918833,0.000480167,-1.85047e-07,1.44127e-08,0.919313,0.00047984,-1.41809e-07,7.39438e-12,0.919793,0.000479556,-1.41787e-07,-1.44423e-08,0.920272,0.000479229,-1.85114e-07,-1.84291e-09,0.920751,0.000478854,-1.90642e-07,2.18139e-08,0.92123,0.000478538,-1.25201e-07,-2.58081e-08,0.921708,0.00047821,-2.02625e-07,2.18139e-08,0.922186,0.00047787,-1.37183e-07,-1.84291e-09,0.922664,0.00047759,-1.42712e-07,-1.44423e-08,0.923141,0.000477262,-1.86039e-07,7.34701e-12,0.923618,0.00047689,-1.86017e-07,1.44129e-08,0.924095,0.000476561,-1.42778e-07,1.94572e-09,0.924572,0.000476281,-1.36941e-07,-2.21958e-08,0.925048,0.000475941,-2.03528e-07,2.72327e-08,0.925523,0.000475615,-1.2183e-07,-2.71304e-08,0.925999,0.00047529,-2.03221e-07,2.16843e-08,0.926474,0.000474949,-1.38168e-07,-2.16005e-12,0.926949,0.000474672,-1.38175e-07,-2.16756e-08,0.927423,0.000474331,-2.03202e-07,2.71001e-08,0.927897,0.000474006,-1.21902e-07,-2.71201e-08,0.928371,0.000473681,-2.03262e-07,2.17757e-08,0.928845,0.00047334,-1.37935e-07,-3.78028e-10,0.929318,0.000473063,-1.39069e-07,-2.02636e-08,0.929791,0.000472724,-1.9986e-07,2.18276e-08,0.930263,0.000472389,-1.34377e-07,-7.44231e-09,0.930736,0.000472098,-1.56704e-07,7.94165e-09,0.931208,0.000471809,-1.32879e-07,-2.43243e-08,0.931679,0.00047147,-2.05851e-07,2.97508e-08,0.932151,0.000471148,-1.16599e-07,-3.50742e-08,0.932622,0.000470809,-2.21822e-07,5.09414e-08,0.933092,0.000470518,-6.89976e-08,-4.94821e-08,0.933563,0.000470232,-2.17444e-07,2.77775e-08,0.934033,0.00046988,-1.34111e-07,-2.02351e-09,0.934502,0.000469606,-1.40182e-07,-1.96835e-08,0.934972,0.000469267,-1.99232e-07,2.11529e-08,0.935441,0.000468932,-1.35774e-07,-5.32332e-09,0.93591,0.000468644,-1.51743e-07,1.40413e-10,0.936378,0.000468341,-1.51322e-07,4.76166e-09,0.936846,0.000468053,-1.37037e-07,-1.9187e-08,0.937314,0.000467721,-1.94598e-07,1.23819e-08,0.937782,0.000467369,-1.57453e-07,2.92642e-08,0.938249,0.000467142,-6.96601e-08,-6.98342e-08,0.938716,0.000466793,-2.79163e-07,7.12586e-08,0.939183,0.000466449,-6.53869e-08,-3.63863e-08,0.939649,0.000466209,-1.74546e-07,1.46818e-08,0.940115,0.000465904,-1.305e-07,-2.2341e-08,0.940581,0.000465576,-1.97523e-07,1.50774e-08,0.941046,0.000465226,-1.52291e-07,2.16359e-08,0.941511,0.000464986,-8.73832e-08,-4.20162e-08,0.941976,0.000464685,-2.13432e-07,2.72198e-08,0.942441,0.00046434,-1.31773e-07,-7.2581e-09,0.942905,0.000464055,-1.53547e-07,1.81263e-09,0.943369,0.000463753,-1.48109e-07,7.58386e-12,0.943832,0.000463457,-1.48086e-07,-1.84298e-09,0.944296,0.000463155,-1.53615e-07,7.36433e-09,0.944759,0.00046287,-1.31522e-07,-2.76143e-08,0.945221,0.000462524,-2.14365e-07,4.34883e-08,0.945684,0.000462226,-8.39003e-08,-2.71297e-08,0.946146,0.000461977,-1.65289e-07,5.42595e-09,0.946608,0.000461662,-1.49012e-07,5.42593e-09,0.947069,0.000461381,-1.32734e-07,-2.71297e-08,0.94753,0.000461034,-2.14123e-07,4.34881e-08,0.947991,0.000460736,-8.36585e-08,-2.76134e-08,0.948452,0.000460486,-1.66499e-07,7.36083e-09,0.948912,0.000460175,-1.44416e-07,-1.82993e-09,0.949372,0.000459881,-1.49906e-07,-4.11073e-11,0.949832,0.000459581,-1.50029e-07,1.99434e-09,0.950291,0.000459287,-1.44046e-07,-7.93627e-09,0.950751,0.000458975,-1.67855e-07,2.97507e-08,0.951209,0.000458728,-7.86029e-08,-5.1462e-08,0.951668,0.000458417,-2.32989e-07,5.6888e-08,0.952126,0.000458121,-6.2325e-08,-5.68806e-08,0.952584,0.000457826,-2.32967e-07,5.14251e-08,0.953042,0.000457514,-7.86914e-08,-2.96107e-08,0.953499,0.000457268,-1.67523e-07,7.41296e-09,0.953956,0.000456955,-1.45285e-07,-4.11262e-11,0.954413,0.000456665,-1.45408e-07,-7.24847e-09,0.95487,0.000456352,-1.67153e-07,2.9035e-08,0.955326,0.000456105,-8.00484e-08,-4.92869e-08,0.955782,0.000455797,-2.27909e-07,4.89032e-08,0.956238,0.000455488,-8.11994e-08,-2.71166e-08,0.956693,0.000455244,-1.62549e-07,-4.13678e-11,0.957148,0.000454919,-1.62673e-07,2.72821e-08,0.957603,0.000454675,-8.0827e-08,-4.94824e-08,0.958057,0.000454365,-2.29274e-07,5.14382e-08,0.958512,0.000454061,-7.49597e-08,-3.7061e-08,0.958965,0.0004538,-1.86143e-07,3.72013e-08,0.959419,0.000453539,-7.45389e-08,-5.21396e-08,0.959873,0.000453234,-2.30958e-07,5.21476e-08,0.960326,0.000452928,-7.45146e-08,-3.72416e-08,0.960778,0.000452667,-1.8624e-07,3.72143e-08,0.961231,0.000452407,-7.45967e-08,-5.20109e-08,0.961683,0.000452101,-2.30629e-07,5.16199e-08,0.962135,0.000451795,-7.57696e-08,-3.52595e-08,0.962587,0.000451538,-1.81548e-07,2.98133e-08,0.963038,0.000451264,-9.2108e-08,-2.43892e-08,0.963489,0.000451007,-1.65276e-07,8.13892e-09,0.96394,0.000450701,-1.40859e-07,-8.16647e-09,0.964391,0.000450394,-1.65358e-07,2.45269e-08,0.964841,0.000450137,-9.17775e-08,-3.03367e-08,0.965291,0.000449863,-1.82787e-07,3.7215e-08,0.965741,0.000449609,-7.11424e-08,-5.89188e-08,0.96619,0.00044929,-2.47899e-07,7.92509e-08,0.966639,0.000449032,-1.01462e-08,-7.92707e-08,0.967088,0.000448773,-2.47958e-07,5.90181e-08,0.967537,0.000448455,-7.0904e-08,-3.75925e-08,0.967985,0.0004482,-1.83681e-07,3.17471e-08,0.968433,0.000447928,-8.84401e-08,-2.97913e-08,0.968881,0.000447662,-1.77814e-07,2.78133e-08,0.969329,0.000447389,-9.4374e-08,-2.18572e-08,0.969776,0.000447135,-1.59946e-07,1.10134e-11,0.970223,0.000446815,-1.59913e-07,2.18132e-08,0.97067,0.000446561,-9.44732e-08,-2.76591e-08,0.971116,0.000446289,-1.7745e-07,2.92185e-08,0.971562,0.000446022,-8.97948e-08,-2.96104e-08,0.972008,0.000445753,-1.78626e-07,2.96185e-08,0.972454,0.000445485,-8.97706e-08,-2.92588e-08,0.972899,0.000445218,-1.77547e-07,2.78123e-08,0.973344,0.000444946,-9.41103e-08,-2.23856e-08,0.973789,0.000444691,-1.61267e-07,2.12559e-09,0.974233,0.000444374,-1.5489e-07,1.38833e-08,0.974678,0.000444106,-1.13241e-07,1.94591e-09,0.975122,0.000443886,-1.07403e-07,-2.16669e-08,0.975565,0.000443606,-1.72404e-07,2.5117e-08,0.976009,0.000443336,-9.70526e-08,-1.91963e-08,0.976452,0.000443085,-1.54642e-07,-7.93627e-09,0.976895,0.000442752,-1.7845e-07,5.09414e-08,0.977338,0.000442548,-2.56262e-08,-7.66201e-08,0.97778,0.000442266,-2.55486e-07,7.67249e-08,0.978222,0.000441986,-2.53118e-08,-5.14655e-08,0.978664,0.000441781,-1.79708e-07,9.92773e-09,0.979106,0.000441451,-1.49925e-07,1.17546e-08,0.979547,0.000441186,-1.14661e-07,2.65868e-09,0.979988,0.000440965,-1.06685e-07,-2.23893e-08,0.980429,0.000440684,-1.73853e-07,2.72939e-08,0.980869,0.000440419,-9.19716e-08,-2.71816e-08,0.98131,0.000440153,-1.73516e-07,2.18278e-08,0.98175,0.000439872,-1.08033e-07,-5.24833e-10,0.982189,0.000439654,-1.09607e-07,-1.97284e-08,0.982629,0.000439376,-1.68793e-07,1.98339e-08,0.983068,0.000439097,-1.09291e-07,-2.62901e-12,0.983507,0.000438879,-1.09299e-07,-1.98234e-08,0.983946,0.000438601,-1.68769e-07,1.96916e-08,0.984384,0.000438322,-1.09694e-07,6.6157e-10,0.984823,0.000438105,-1.0771e-07,-2.23379e-08,0.985261,0.000437823,-1.74723e-07,2.90855e-08,0.985698,0.00043756,-8.74669e-08,-3.43992e-08,0.986136,0.000437282,-1.90665e-07,4.89068e-08,0.986573,0.000437048,-4.39442e-08,-4.20188e-08,0.98701,0.000436834,-1.7e-07,-4.11073e-11,0.987446,0.000436494,-1.70124e-07,4.21832e-08,0.987883,0.00043628,-4.35742e-08,-4.94824e-08,0.988319,0.000436044,-1.92021e-07,3.6537e-08,0.988755,0.00043577,-8.24102e-08,-3.70611e-08,0.989191,0.000435494,-1.93593e-07,5.21026e-08,0.989626,0.000435263,-3.72855e-08,-5.21402e-08,0.990061,0.000435032,-1.93706e-07,3.7249e-08,0.990496,0.000434756,-8.19592e-08,-3.72512e-08,0.990931,0.000434481,-1.93713e-07,5.21511e-08,0.991365,0.00043425,-3.72595e-08,-5.21439e-08,0.991799,0.000434019,-1.93691e-07,3.72152e-08,0.992233,0.000433743,-8.20456e-08,-3.71123e-08,0.992667,0.000433468,-1.93382e-07,5.16292e-08,0.9931,0.000433236,-3.84947e-08,-5.01953e-08,0.993533,0.000433008,-1.89081e-07,2.99427e-08,0.993966,0.00043272,-9.92525e-08,-9.9708e-09,0.994399,0.000432491,-1.29165e-07,9.94051e-09,0.994831,0.000432263,-9.93434e-08,-2.97912e-08,0.995263,0.000431975,-1.88717e-07,4.96198e-08,0.995695,0.000431746,-3.98578e-08,-4.94785e-08,0.996127,0.000431518,-1.88293e-07,2.9085e-08,0.996558,0.000431229,-1.01038e-07,-7.25675e-09,0.996989,0.000431005,-1.22809e-07,-5.79945e-11,0.99742,0.000430759,-1.22983e-07,7.48873e-09,0.997851,0.000430536,-1.00516e-07,-2.98969e-08,0.998281,0.000430245,-1.90207e-07,5.24942e-08,0.998711,0.000430022,-3.27246e-08,-6.08706e-08,0.999141,0.000429774,-2.15336e-07,7.17788e-08,0.999571,0.000429392,0.,0.};\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void Lab2RGBConvert_f(const T& src, D& dst)\n        {\n            const float lThresh = 0.008856f * 903.3f;\n            const float fThresh = 7.787f * 0.008856f + 16.0f / 116.0f;\n\n            float Y, fy;\n\n            if (src.x <= lThresh)\n            {\n                Y = src.x / 903.3f;\n                fy = 7.787f * Y + 16.0f / 116.0f;\n            }\n            else\n            {\n                fy = (src.x + 16.0f) / 116.0f;\n                Y = fy * fy * fy;\n            }\n\n            float X = src.y / 500.0f + fy;\n            float Z = fy - src.z / 200.0f;\n\n            if (X <= fThresh)\n                X = (X - 16.0f / 116.0f) / 7.787f;\n            else\n                X = X * X * X;\n\n            if (Z <= fThresh)\n                Z = (Z - 16.0f / 116.0f) / 7.787f;\n            else\n                Z = Z * Z * Z;\n\n            float B = 0.052891f * X - 0.204043f * Y + 1.151152f * Z;\n            float G = -0.921235f * X + 1.875991f * Y + 0.045244f * Z;\n            float R = 3.079933f * X - 1.537150f * Y - 0.542782f * Z;\n\n            if (srgb)\n            {\n                B = splineInterpolate(B * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n                G = splineInterpolate(G * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n                R = splineInterpolate(R * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n            }\n\n            dst.x = blueIdx == 0 ? B : R;\n            dst.y = G;\n            dst.z = blueIdx == 0 ? R : B;\n            setAlpha(dst, ColorChannel<float>::max());\n        }\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void Lab2RGBConvert_b(const T& src, D& dst)\n        {\n            float3 srcf, dstf;\n\n            srcf.x = src.x * (100.f / 255.f);\n            srcf.y = src.y - 128;\n            srcf.z = src.z - 128;\n\n            Lab2RGBConvert_f<srgb, blueIdx>(srcf, dstf);\n\n            dst.x = saturate_cast<uchar>(dstf.x * 255.f);\n            dst.y = saturate_cast<uchar>(dstf.y * 255.f);\n            dst.z = saturate_cast<uchar>(dstf.z * 255.f);\n            setAlpha(dst, ColorChannel<uchar>::max());\n        }\n\n        template <typename T, int scn, int dcn, bool srgb, int blueIdx> struct Lab2RGB;\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct Lab2RGB<uchar, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<uchar, scn>::vec_type, typename TypeVec<uchar, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<uchar, dcn>::vec_type operator ()(const typename TypeVec<uchar, scn>::vec_type& src) const\n            {\n                typename TypeVec<uchar, dcn>::vec_type dst;\n\n                Lab2RGBConvert_b<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ Lab2RGB() {}\n            __host__ __device__ __forceinline__ Lab2RGB(const Lab2RGB&) {}\n        };\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct Lab2RGB<float, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                Lab2RGBConvert_f<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ Lab2RGB() {}\n            __host__ __device__ __forceinline__ Lab2RGB(const Lab2RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_Lab2RGB_TRAITS(name, scn, dcn, srgb, blueIdx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::Lab2RGB<T, scn, dcn, srgb, blueIdx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n///////////////////////////////////// RGB <-> Luv /////////////////////////////////////\n\n    namespace color_detail\n    {\n        __constant__ float c_LabCbrtTab[] = {0.137931,0.0114066,0.,1.18859e-07,0.149338,0.011407,3.56578e-07,-5.79396e-07,0.160745,0.0114059,-1.38161e-06,2.16892e-06,0.172151,0.0114097,5.12516e-06,-8.0814e-06,0.183558,0.0113957,-1.9119e-05,3.01567e-05,0.194965,0.0114479,7.13509e-05,-0.000112545,0.206371,0.011253,-0.000266285,-0.000106493,0.217252,0.0104009,-0.000585765,7.32149e-05,0.22714,0.00944906,-0.00036612,1.21917e-05,0.236235,0.0087534,-0.000329545,2.01753e-05,0.244679,0.00815483,-0.000269019,1.24435e-05,0.252577,0.00765412,-0.000231689,1.05618e-05,0.26001,0.00722243,-0.000200003,8.26662e-06,0.267041,0.00684723,-0.000175203,6.76746e-06,0.27372,0.00651712,-0.000154901,5.61192e-06,0.280088,0.00622416,-0.000138065,4.67009e-06,0.286179,0.00596204,-0.000124055,3.99012e-06,0.292021,0.0057259,-0.000112085,3.36032e-06,0.297638,0.00551181,-0.000102004,2.95338e-06,0.30305,0.00531666,-9.31435e-05,2.52875e-06,0.308277,0.00513796,-8.55572e-05,2.22022e-06,0.313331,0.00497351,-7.88966e-05,1.97163e-06,0.318228,0.00482163,-7.29817e-05,1.7248e-06,0.322978,0.00468084,-6.78073e-05,1.55998e-06,0.327593,0.0045499,-6.31274e-05,1.36343e-06,0.332081,0.00442774,-5.90371e-05,1.27136e-06,0.336451,0.00431348,-5.5223e-05,1.09111e-06,0.34071,0.00420631,-5.19496e-05,1.0399e-06,0.344866,0.00410553,-4.88299e-05,9.18347e-07,0.348923,0.00401062,-4.60749e-05,8.29942e-07,0.352889,0.00392096,-4.35851e-05,7.98478e-07,0.356767,0.00383619,-4.11896e-05,6.84917e-07,0.360562,0.00375586,-3.91349e-05,6.63976e-07,0.36428,0.00367959,-3.7143e-05,5.93086e-07,0.367923,0.00360708,-3.53637e-05,5.6976e-07,0.371495,0.00353806,-3.36544e-05,4.95533e-07,0.375,0.00347224,-3.21678e-05,4.87951e-07,0.378441,0.00340937,-3.0704e-05,4.4349e-07,0.38182,0.00334929,-2.93735e-05,4.20297e-07,0.38514,0.0032918,-2.81126e-05,3.7872e-07,0.388404,0.00323671,-2.69764e-05,3.596e-07,0.391614,0.00318384,-2.58976e-05,3.5845e-07,0.394772,0.00313312,-2.48223e-05,2.92765e-07,0.397881,0.00308435,-2.3944e-05,3.18232e-07,0.400942,0.00303742,-2.29893e-05,2.82046e-07,0.403957,0.00299229,-2.21432e-05,2.52315e-07,0.406927,0.00294876,-2.13862e-05,2.58416e-07,0.409855,0.00290676,-2.0611e-05,2.33939e-07,0.412741,0.00286624,-1.99092e-05,2.36342e-07,0.415587,0.00282713,-1.92001e-05,1.916e-07,0.418396,0.00278931,-1.86253e-05,2.1915e-07,0.421167,0.00275271,-1.79679e-05,1.83498e-07,0.423901,0.00271733,-1.74174e-05,1.79343e-07,0.426602,0.00268303,-1.68794e-05,1.72013e-07,0.429268,0.00264979,-1.63633e-05,1.75686e-07,0.431901,0.00261759,-1.58363e-05,1.3852e-07,0.434503,0.00258633,-1.54207e-05,1.64304e-07,0.437074,0.00255598,-1.49278e-05,1.28136e-07,0.439616,0.00252651,-1.45434e-05,1.57618e-07,0.442128,0.0024979,-1.40705e-05,1.0566e-07,0.444612,0.00247007,-1.37535e-05,1.34998e-07,0.447068,0.00244297,-1.33485e-05,1.29207e-07,0.449498,0.00241666,-1.29609e-05,9.32347e-08,0.451902,0.00239102,-1.26812e-05,1.23703e-07,0.45428,0.00236603,-1.23101e-05,9.74072e-08,0.456634,0.0023417,-1.20179e-05,1.12518e-07,0.458964,0.002318,-1.16803e-05,7.83681e-08,0.46127,0.00229488,-1.14452e-05,1.10452e-07,0.463554,0.00227232,-1.11139e-05,7.58719e-08,0.465815,0.00225032,-1.08863e-05,9.2699e-08,0.468055,0.00222882,-1.06082e-05,8.97738e-08,0.470273,0.00220788,-1.03388e-05,5.4845e-08,0.47247,0.00218736,-1.01743e-05,1.0808e-07,0.474648,0.00216734,-9.85007e-06,4.9277e-08,0.476805,0.00214779,-9.70224e-06,8.22408e-08,0.478943,0.00212863,-9.45551e-06,6.87942e-08,0.481063,0.00210993,-9.24913e-06,5.98144e-08,0.483163,0.00209161,-9.06969e-06,7.93789e-08,0.485246,0.00207371,-8.83155e-06,3.99032e-08,0.487311,0.00205616,-8.71184e-06,8.88325e-08,0.489358,0.002039,-8.44534e-06,2.20004e-08,0.491389,0.00202218,-8.37934e-06,9.13872e-08,0.493403,0.0020057,-8.10518e-06,2.96829e-08,0.495401,0.00198957,-8.01613e-06,5.81028e-08,0.497382,0.00197372,-7.84183e-06,6.5731e-08,0.499348,0.00195823,-7.64463e-06,3.66019e-08,0.501299,0.00194305,-7.53483e-06,2.62811e-08,0.503234,0.00192806,-7.45598e-06,9.66907e-08,0.505155,0.00191344,-7.16591e-06,4.18928e-09,0.507061,0.00189912,-7.15334e-06,6.53665e-08,0.508953,0.00188501,-6.95724e-06,3.23686e-08,0.510831,0.00187119,-6.86014e-06,4.35774e-08,0.512696,0.0018576,-6.72941e-06,3.17406e-08,0.514547,0.00184424,-6.63418e-06,6.78785e-08,0.516384,0.00183117,-6.43055e-06,-5.23126e-09,0.518209,0.0018183,-6.44624e-06,7.22562e-08,0.520021,0.00180562,-6.22947e-06,1.42292e-08,0.52182,0.0017932,-6.18679e-06,4.9641e-08,0.523607,0.00178098,-6.03786e-06,2.56259e-08,0.525382,0.00176898,-5.96099e-06,2.66696e-08,0.527145,0.00175714,-5.88098e-06,4.65094e-08,0.528897,0.00174552,-5.74145e-06,2.57114e-08,0.530637,0.00173411,-5.66431e-06,2.94588e-08,0.532365,0.00172287,-5.57594e-06,3.52667e-08,0.534082,0.00171182,-5.47014e-06,8.28868e-09,0.535789,0.00170091,-5.44527e-06,5.07871e-08,0.537484,0.00169017,-5.29291e-06,2.69817e-08,0.539169,0.00167967,-5.21197e-06,2.01009e-08,0.540844,0.0016693,-5.15166e-06,1.18237e-08,0.542508,0.00165903,-5.11619e-06,5.18135e-08,0.544162,0.00164896,-4.96075e-06,1.9341e-08,0.545806,0.00163909,-4.90273e-06,-9.96867e-09,0.54744,0.00162926,-4.93263e-06,8.01382e-08,0.549064,0.00161963,-4.69222e-06,-1.25601e-08,0.550679,0.00161021,-4.7299e-06,2.97067e-08,0.552285,0.00160084,-4.64078e-06,1.29426e-08,0.553881,0.0015916,-4.60195e-06,3.77327e-08,0.555468,0.00158251,-4.48875e-06,1.49412e-08,0.557046,0.00157357,-4.44393e-06,2.17118e-08,0.558615,0.00156475,-4.3788e-06,1.74206e-08,0.560176,0.00155605,-4.32653e-06,2.78152e-08,0.561727,0.00154748,-4.24309e-06,-9.47239e-09,0.563271,0.00153896,-4.27151e-06,6.9679e-08,0.564805,0.00153063,-4.06247e-06,-3.08246e-08,0.566332,0.00152241,-4.15494e-06,5.36188e-08,0.56785,0.00151426,-3.99409e-06,-4.83594e-09,0.56936,0.00150626,-4.00859e-06,2.53293e-08,0.570863,0.00149832,-3.93261e-06,2.27286e-08,0.572357,0.00149052,-3.86442e-06,2.96541e-09,0.573844,0.0014828,-3.85552e-06,2.50147e-08,0.575323,0.00147516,-3.78048e-06,1.61842e-08,0.576794,0.00146765,-3.73193e-06,2.94582e-08,0.578258,0.00146028,-3.64355e-06,-1.48076e-08,0.579715,0.00145295,-3.68798e-06,2.97724e-08,0.581164,0.00144566,-3.59866e-06,1.49272e-08,0.582606,0.00143851,-3.55388e-06,2.97285e-08,0.584041,0.00143149,-3.46469e-06,-1.46323e-08,0.585469,0.00142451,-3.50859e-06,2.88004e-08,0.58689,0.00141758,-3.42219e-06,1.864e-08,0.588304,0.00141079,-3.36627e-06,1.58482e-08,0.589712,0.00140411,-3.31872e-06,-2.24279e-08,0.591112,0.00139741,-3.38601e-06,7.38639e-08,0.592507,0.00139085,-3.16441e-06,-3.46088e-08,0.593894,0.00138442,-3.26824e-06,4.96675e-09,0.595275,0.0013779,-3.25334e-06,7.4346e-08,0.59665,0.00137162,-3.0303e-06,-6.39319e-08,0.598019,0.00136536,-3.2221e-06,6.21725e-08,0.599381,0.00135911,-3.03558e-06,-5.94423e-09,0.600737,0.00135302,-3.05341e-06,2.12091e-08,0.602087,0.00134697,-2.98979e-06,-1.92876e-08,0.603431,0.00134094,-3.04765e-06,5.5941e-08,0.604769,0.00133501,-2.87983e-06,-2.56622e-08,0.606101,0.00132917,-2.95681e-06,4.67078e-08,0.607427,0.0013234,-2.81669e-06,-4.19592e-08,0.608748,0.00131764,-2.94257e-06,6.15243e-08,0.610062,0.00131194,-2.75799e-06,-2.53244e-08,0.611372,0.00130635,-2.83397e-06,3.97739e-08,0.612675,0.0013008,-2.71465e-06,-1.45618e-08,0.613973,0.00129533,-2.75833e-06,1.84733e-08,0.615266,0.00128986,-2.70291e-06,2.73606e-10,0.616553,0.00128446,-2.70209e-06,4.00367e-08,0.617835,0.00127918,-2.58198e-06,-4.12113e-08,0.619111,0.00127389,-2.70561e-06,6.52039e-08,0.620383,0.00126867,-2.51e-06,-4.07901e-08,0.621649,0.00126353,-2.63237e-06,3.83516e-08,0.62291,0.00125838,-2.51732e-06,6.59315e-09,0.624166,0.00125337,-2.49754e-06,-5.11939e-09,0.625416,0.00124836,-2.5129e-06,1.38846e-08,0.626662,0.00124337,-2.47124e-06,9.18514e-09,0.627903,0.00123846,-2.44369e-06,8.97952e-09,0.629139,0.0012336,-2.41675e-06,1.45012e-08,0.63037,0.00122881,-2.37325e-06,-7.37949e-09,0.631597,0.00122404,-2.39538e-06,1.50169e-08,0.632818,0.00121929,-2.35033e-06,6.91648e-09,0.634035,0.00121461,-2.32958e-06,1.69219e-08,0.635248,0.00121,-2.27882e-06,-1.49997e-08,0.636455,0.0012054,-2.32382e-06,4.30769e-08,0.637659,0.00120088,-2.19459e-06,-3.80986e-08,0.638857,0.00119638,-2.30888e-06,4.97134e-08,0.640051,0.00119191,-2.15974e-06,-4.15463e-08,0.641241,0.00118747,-2.28438e-06,5.68667e-08,0.642426,0.00118307,-2.11378e-06,-7.10641e-09,0.643607,0.00117882,-2.1351e-06,-2.8441e-08,0.644784,0.00117446,-2.22042e-06,6.12658e-08,0.645956,0.00117021,-2.03663e-06,-3.78083e-08,0.647124,0.00116602,-2.15005e-06,3.03627e-08,0.648288,0.00116181,-2.05896e-06,-2.40379e-08,0.649448,0.00115762,-2.13108e-06,6.57887e-08,0.650603,0.00115356,-1.93371e-06,-6.03028e-08,0.651755,0.00114951,-2.11462e-06,5.62134e-08,0.652902,0.00114545,-1.94598e-06,-4.53417e-08,0.654046,0.00114142,-2.082e-06,6.55489e-08,0.655185,0.00113745,-1.88536e-06,-3.80396e-08,0.656321,0.00113357,-1.99948e-06,2.70049e-08,0.657452,0.00112965,-1.91846e-06,-1.03755e-08,0.65858,0.00112578,-1.94959e-06,1.44973e-08,0.659704,0.00112192,-1.9061e-06,1.1991e-08,0.660824,0.00111815,-1.87012e-06,-2.85634e-09,0.66194,0.0011144,-1.87869e-06,-5.65782e-10,0.663053,0.00111064,-1.88039e-06,5.11947e-09,0.664162,0.0011069,-1.86503e-06,3.96924e-08,0.665267,0.00110328,-1.74595e-06,-4.46795e-08,0.666368,0.00109966,-1.87999e-06,1.98161e-08,0.667466,0.00109596,-1.82054e-06,2.502e-08,0.66856,0.00109239,-1.74548e-06,-6.86593e-10,0.669651,0.0010889,-1.74754e-06,-2.22739e-08,0.670738,0.00108534,-1.81437e-06,3.01776e-08,0.671821,0.0010818,-1.72383e-06,2.07732e-08,0.672902,0.00107841,-1.66151e-06,-5.36658e-08,0.673978,0.00107493,-1.82251e-06,7.46802e-08,0.675051,0.00107151,-1.59847e-06,-6.62411e-08,0.676121,0.00106811,-1.79719e-06,7.10748e-08,0.677188,0.00106473,-1.58397e-06,-3.92441e-08,0.678251,0.00106145,-1.7017e-06,2.62973e-08,0.679311,0.00105812,-1.62281e-06,-6.34035e-09,0.680367,0.00105486,-1.64183e-06,-9.36249e-10,0.68142,0.00105157,-1.64464e-06,1.00854e-08,0.68247,0.00104831,-1.61438e-06,2.01995e-08,0.683517,0.00104514,-1.55378e-06,-3.1279e-08,0.68456,0.00104194,-1.64762e-06,4.53114e-08,0.685601,0.00103878,-1.51169e-06,-3.07573e-08,0.686638,0.00103567,-1.60396e-06,1.81133e-08,0.687672,0.00103251,-1.54962e-06,1.79085e-08,0.688703,0.00102947,-1.49589e-06,-3.01428e-08,0.689731,0.00102639,-1.58632e-06,4.30583e-08,0.690756,0.00102334,-1.45715e-06,-2.28814e-08,0.691778,0.00102036,-1.52579e-06,-1.11373e-08,0.692797,0.00101727,-1.5592e-06,6.74305e-08,0.693812,0.00101436,-1.35691e-06,-7.97709e-08,0.694825,0.0010114,-1.59622e-06,7.28391e-08,0.695835,0.00100843,-1.37771e-06,-3.27715e-08,0.696842,0.00100558,-1.47602e-06,-1.35807e-09,0.697846,0.00100262,-1.48009e-06,3.82037e-08,0.698847,0.000999775,-1.36548e-06,-3.22474e-08,0.699846,0.000996948,-1.46223e-06,3.11809e-08,0.700841,0.000994117,-1.36868e-06,-3.28714e-08,0.701834,0.000991281,-1.4673e-06,4.07001e-08,0.702824,0.000988468,-1.3452e-06,-1.07197e-08,0.703811,0.000985746,-1.37736e-06,2.17866e-09,0.704795,0.000982998,-1.37082e-06,2.00521e-09,0.705777,0.000980262,-1.3648e-06,-1.01996e-08,0.706756,0.000977502,-1.3954e-06,3.87931e-08,0.707732,0.000974827,-1.27902e-06,-2.57632e-08,0.708706,0.000972192,-1.35631e-06,4.65513e-09,0.709676,0.000969493,-1.34235e-06,7.14257e-09,0.710645,0.00096683,-1.32092e-06,2.63791e-08,0.71161,0.000964267,-1.24178e-06,-5.30543e-08,0.712573,0.000961625,-1.40095e-06,6.66289e-08,0.713533,0.000959023,-1.20106e-06,-3.46474e-08,0.714491,0.000956517,-1.305e-06,1.23559e-08,0.715446,0.000953944,-1.26793e-06,-1.47763e-08,0.716399,0.000951364,-1.31226e-06,4.67494e-08,0.717349,0.000948879,-1.17201e-06,-5.3012e-08,0.718297,0.000946376,-1.33105e-06,4.60894e-08,0.719242,0.000943852,-1.19278e-06,-1.21366e-08,0.720185,0.00094143,-1.22919e-06,2.45673e-09,0.721125,0.000938979,-1.22182e-06,2.30966e-09,0.722063,0.000936543,-1.21489e-06,-1.16954e-08,0.722998,0.000934078,-1.24998e-06,4.44718e-08,0.723931,0.000931711,-1.11656e-06,-4.69823e-08,0.724861,0.000929337,-1.25751e-06,2.4248e-08,0.725789,0.000926895,-1.18477e-06,9.5949e-09,0.726715,0.000924554,-1.15598e-06,-3.02286e-09,0.727638,0.000922233,-1.16505e-06,2.49649e-09,0.72856,0.00091991,-1.15756e-06,-6.96321e-09,0.729478,0.000917575,-1.17845e-06,2.53564e-08,0.730395,0.000915294,-1.10238e-06,-3.48578e-08,0.731309,0.000912984,-1.20695e-06,5.44704e-08,0.732221,0.000910734,-1.04354e-06,-6.38144e-08,0.73313,0.000908455,-1.23499e-06,8.15781e-08,0.734038,0.00090623,-9.90253e-07,-8.3684e-08,0.734943,0.000903999,-1.2413e-06,7.43441e-08,0.735846,0.000901739,-1.01827e-06,-3.48787e-08,0.736746,0.000899598,-1.12291e-06,5.56596e-09,0.737645,0.000897369,-1.10621e-06,1.26148e-08,0.738541,0.000895194,-1.06837e-06,3.57935e-09,0.739435,0.000893068,-1.05763e-06,-2.69322e-08,0.740327,0.000890872,-1.13842e-06,4.45448e-08,0.741217,0.000888729,-1.00479e-06,-3.20376e-08,0.742105,0.000886623,-1.1009e-06,2.40011e-08,0.74299,0.000884493,-1.0289e-06,-4.36209e-09,0.743874,0.000882422,-1.04199e-06,-6.55268e-09,0.744755,0.000880319,-1.06164e-06,3.05728e-08,0.745634,0.000878287,-9.69926e-07,-5.61338e-08,0.746512,0.000876179,-1.13833e-06,7.4753e-08,0.747387,0.000874127,-9.14068e-07,-6.40644e-08,0.74826,0.000872106,-1.10626e-06,6.22955e-08,0.749131,0.000870081,-9.19375e-07,-6.59083e-08,0.75,0.000868044,-1.1171e-06,8.21284e-08,0.750867,0.000866056,-8.70714e-07,-8.37915e-08,0.751732,0.000864064,-1.12209e-06,7.42237e-08,0.752595,0.000862042,-8.99418e-07,-3.42894e-08,0.753456,0.00086014,-1.00229e-06,3.32955e-09,0.754315,0.000858146,-9.92297e-07,2.09712e-08,0.755173,0.000856224,-9.29384e-07,-2.76096e-08,0.756028,0.000854282,-1.01221e-06,2.98627e-08,0.756881,0.000852348,-9.22625e-07,-3.22365e-08,0.757733,0.000850406,-1.01933e-06,3.94786e-08,0.758582,0.000848485,-9.00898e-07,-6.46833e-09,0.75943,0.000846664,-9.20303e-07,-1.36052e-08,0.760275,0.000844783,-9.61119e-07,1.28447e-09,0.761119,0.000842864,-9.57266e-07,8.4674e-09,0.761961,0.000840975,-9.31864e-07,2.44506e-08,0.762801,0.000839185,-8.58512e-07,-4.6665e-08,0.763639,0.000837328,-9.98507e-07,4.30001e-08,0.764476,0.00083546,-8.69507e-07,-6.12609e-09,0.76531,0.000833703,-8.87885e-07,-1.84959e-08,0.766143,0.000831871,-9.43372e-07,2.05052e-08,0.766974,0.000830046,-8.81857e-07,-3.92026e-09,0.767803,0.000828271,-8.93618e-07,-4.82426e-09,0.768631,0.000826469,-9.0809e-07,2.32172e-08,0.769456,0.000824722,-8.38439e-07,-2.84401e-08,0.77028,0.00082296,-9.23759e-07,3.09386e-08,0.771102,0.000821205,-8.30943e-07,-3.57099e-08,0.771922,0.000819436,-9.38073e-07,5.22963e-08,0.772741,0.000817717,-7.81184e-07,-5.42658e-08,0.773558,0.000815992,-9.43981e-07,4.55579e-08,0.774373,0.000814241,-8.07308e-07,-8.75656e-09,0.775186,0.0008126,-8.33578e-07,-1.05315e-08,0.775998,0.000810901,-8.65172e-07,-8.72188e-09,0.776808,0.000809145,-8.91338e-07,4.54191e-08,0.777616,0.000807498,-7.5508e-07,-5.37454e-08,0.778423,0.000805827,-9.16317e-07,5.03532e-08,0.779228,0.000804145,-7.65257e-07,-2.84584e-08,0.780031,0.000802529,-8.50632e-07,3.87579e-09,0.780833,0.00080084,-8.39005e-07,1.29552e-08,0.781633,0.0007992,-8.00139e-07,3.90804e-09,0.782432,0.000797612,-7.88415e-07,-2.85874e-08,0.783228,0.000795949,-8.74177e-07,5.0837e-08,0.784023,0.000794353,-7.21666e-07,-5.55513e-08,0.784817,0.000792743,-8.8832e-07,5.21587e-08,0.785609,0.000791123,-7.31844e-07,-3.38744e-08,0.786399,0.000789558,-8.33467e-07,2.37342e-08,0.787188,0.000787962,-7.62264e-07,-1.45775e-09,0.787975,0.000786433,-7.66638e-07,-1.79034e-08,0.788761,0.000784846,-8.20348e-07,1.34665e-08,0.789545,0.000783246,-7.79948e-07,2.3642e-08,0.790327,0.000781757,-7.09022e-07,-4.84297e-08,0.791108,0.000780194,-8.54311e-07,5.08674e-08,0.791888,0.000778638,-7.01709e-07,-3.58303e-08,0.792666,0.000777127,-8.092e-07,3.28493e-08,0.793442,0.000775607,-7.10652e-07,-3.59624e-08,0.794217,0.000774078,-8.1854e-07,5.13959e-08,0.79499,0.000772595,-6.64352e-07,-5.04121e-08,0.795762,0.000771115,-8.15588e-07,3.10431e-08,0.796532,0.000769577,-7.22459e-07,-1.41557e-08,0.797301,0.00076809,-7.64926e-07,2.55795e-08,0.798069,0.000766636,-6.88187e-07,-2.85578e-08,0.798835,0.000765174,-7.73861e-07,2.90472e-08,0.799599,0.000763714,-6.86719e-07,-2.80262e-08,0.800362,0.000762256,-7.70798e-07,2.34531e-08,0.801123,0.000760785,-7.00438e-07,-6.18144e-09,0.801884,0.000759366,-7.18983e-07,1.27263e-09,0.802642,0.000757931,-7.15165e-07,1.09101e-09,0.803399,0.000756504,-7.11892e-07,-5.63675e-09,0.804155,0.000755064,-7.28802e-07,2.14559e-08,0.80491,0.00075367,-6.64434e-07,-2.05821e-08,0.805663,0.00075228,-7.26181e-07,1.26812e-09,0.806414,0.000750831,-7.22377e-07,1.55097e-08,0.807164,0.000749433,-6.75848e-07,-3.70216e-09,0.807913,0.00074807,-6.86954e-07,-7.0105e-10,0.80866,0.000746694,-6.89057e-07,6.5063e-09,0.809406,0.000745336,-6.69538e-07,-2.53242e-08,0.810151,0.000743921,-7.45511e-07,3.51858e-08,0.810894,0.000742535,-6.39953e-07,3.79034e-09,0.811636,0.000741267,-6.28582e-07,-5.03471e-08,0.812377,0.000739858,-7.79624e-07,7.83886e-08,0.813116,0.000738534,-5.44458e-07,-8.43935e-08,0.813854,0.000737192,-7.97638e-07,8.03714e-08,0.81459,0.000735838,-5.56524e-07,-5.82784e-08,0.815325,0.00073455,-7.31359e-07,3.35329e-08,0.816059,0.000733188,-6.3076e-07,-1.62486e-08,0.816792,0.000731878,-6.79506e-07,3.14614e-08,0.817523,0.000730613,-5.85122e-07,-4.99925e-08,0.818253,0.000729293,-7.35099e-07,4.92994e-08,0.818982,0.000727971,-5.87201e-07,-2.79959e-08,0.819709,0.000726712,-6.71189e-07,3.07959e-09,0.820435,0.000725379,-6.6195e-07,1.56777e-08,0.82116,0.000724102,-6.14917e-07,-6.18564e-09,0.821883,0.000722854,-6.33474e-07,9.06488e-09,0.822606,0.000721614,-6.06279e-07,-3.00739e-08,0.823327,0.000720311,-6.96501e-07,5.16262e-08,0.824046,0.000719073,-5.41623e-07,-5.72214e-08,0.824765,0.000717818,-7.13287e-07,5.80503e-08,0.825482,0.000716566,-5.39136e-07,-5.57703e-08,0.826198,0.00071532,-7.06447e-07,4.58215e-08,0.826912,0.000714045,-5.68983e-07,-8.30636e-09,0.827626,0.000712882,-5.93902e-07,-1.25961e-08,0.828338,0.000711656,-6.3169e-07,-9.13985e-10,0.829049,0.00071039,-6.34432e-07,1.62519e-08,0.829759,0.00070917,-5.85676e-07,-4.48904e-09,0.830468,0.000707985,-5.99143e-07,1.70418e-09,0.831175,0.000706792,-5.9403e-07,-2.32768e-09,0.831881,0.000705597,-6.01014e-07,7.60648e-09,0.832586,0.000704418,-5.78194e-07,-2.80982e-08,0.83329,0.000703177,-6.62489e-07,4.51817e-08,0.833993,0.000701988,-5.26944e-07,-3.34192e-08,0.834694,0.000700834,-6.27201e-07,2.88904e-08,0.835394,0.000699666,-5.4053e-07,-2.25378e-08,0.836093,0.000698517,-6.08143e-07,1.65589e-09,0.836791,0.000697306,-6.03176e-07,1.59142e-08,0.837488,0.000696147,-5.55433e-07,-5.70801e-09,0.838184,0.000695019,-5.72557e-07,6.91792e-09,0.838878,0.000693895,-5.51803e-07,-2.19637e-08,0.839571,0.000692725,-6.17694e-07,2.13321e-08,0.840263,0.000691554,-5.53698e-07,-3.75996e-09,0.840954,0.000690435,-5.64978e-07,-6.29219e-09,0.841644,0.000689287,-5.83855e-07,2.89287e-08,0.842333,0.000688206,-4.97068e-07,-4.98181e-08,0.843021,0.000687062,-6.46523e-07,5.11344e-08,0.843707,0.000685922,-4.9312e-07,-3.55102e-08,0.844393,0.00068483,-5.9965e-07,3.13019e-08,0.845077,0.000683724,-5.05745e-07,-3.00925e-08,0.84576,0.000682622,-5.96022e-07,2.94636e-08,0.846442,0.000681519,-5.07631e-07,-2.81572e-08,0.847123,0.000680419,-5.92103e-07,2.35606e-08,0.847803,0.000679306,-5.21421e-07,-6.48045e-09,0.848482,0.000678243,-5.40863e-07,2.36124e-09,0.849159,0.000677169,-5.33779e-07,-2.96461e-09,0.849836,0.000676092,-5.42673e-07,9.49728e-09,0.850512,0.000675035,-5.14181e-07,-3.50245e-08,0.851186,0.000673902,-6.19254e-07,7.09959e-08,0.851859,0.000672876,-4.06267e-07,-7.01453e-08,0.852532,0.000671853,-6.16703e-07,3.07714e-08,0.853203,0.000670712,-5.24388e-07,6.66423e-09,0.853873,0.000669684,-5.04396e-07,2.17629e-09,0.854542,0.000668681,-4.97867e-07,-1.53693e-08,0.855211,0.000667639,-5.43975e-07,-3.03752e-10,0.855878,0.000666551,-5.44886e-07,1.65844e-08,0.856544,0.000665511,-4.95133e-07,-6.42907e-09,0.857209,0.000664501,-5.1442e-07,9.13195e-09,0.857873,0.0006635,-4.87024e-07,-3.00987e-08,0.858536,0.000662435,-5.7732e-07,5.16584e-08,0.859198,0.000661436,-4.22345e-07,-5.73255e-08,0.859859,0.000660419,-5.94322e-07,5.84343e-08,0.860518,0.000659406,-4.19019e-07,-5.72022e-08,0.861177,0.000658396,-5.90626e-07,5.11653e-08,0.861835,0.000657368,-4.3713e-07,-2.82495e-08,0.862492,0.000656409,-5.21878e-07,2.22788e-09,0.863148,0.000655372,-5.15195e-07,1.9338e-08,0.863803,0.0006544,-4.5718e-07,-1.99754e-08,0.864457,0.000653425,-5.17107e-07,9.59024e-10,0.86511,0.000652394,-5.1423e-07,1.61393e-08,0.865762,0.000651414,-4.65812e-07,-5.91149e-09,0.866413,0.000650465,-4.83546e-07,7.50665e-09,0.867063,0.00064952,-4.61026e-07,-2.4115e-08,0.867712,0.000648526,-5.33371e-07,2.93486e-08,0.86836,0.000647547,-4.45325e-07,-3.36748e-08,0.869007,0.000646555,-5.4635e-07,4.57461e-08,0.869653,0.0006456,-4.09112e-07,-3.01002e-08,0.870298,0.000644691,-4.99412e-07,1.50501e-08,0.870942,0.000643738,-4.54262e-07,-3.01002e-08,0.871585,0.000642739,-5.44563e-07,4.57461e-08,0.872228,0.000641787,-4.07324e-07,-3.36748e-08,0.872869,0.000640871,-5.08349e-07,2.93486e-08,0.873509,0.000639943,-4.20303e-07,-2.4115e-08,0.874149,0.00063903,-4.92648e-07,7.50655e-09,0.874787,0.000638067,-4.70128e-07,-5.91126e-09,0.875425,0.000637109,-4.87862e-07,1.61385e-08,0.876062,0.000636182,-4.39447e-07,9.61961e-10,0.876697,0.000635306,-4.36561e-07,-1.99863e-08,0.877332,0.000634373,-4.9652e-07,1.93785e-08,0.877966,0.000633438,-4.38384e-07,2.07697e-09,0.878599,0.000632567,-4.32153e-07,-2.76864e-08,0.879231,0.00063162,-5.15212e-07,4.90641e-08,0.879862,0.000630737,-3.6802e-07,-4.93606e-08,0.880493,0.000629852,-5.16102e-07,2.9169e-08,0.881122,0.000628908,-4.28595e-07,-7.71083e-09,0.881751,0.000628027,-4.51727e-07,1.6744e-09,0.882378,0.000627129,-4.46704e-07,1.01317e-09,0.883005,0.000626239,-4.43665e-07,-5.72703e-09,0.883631,0.000625334,-4.60846e-07,2.1895e-08,0.884255,0.000624478,-3.95161e-07,-2.22481e-08,0.88488,0.000623621,-4.61905e-07,7.4928e-09,0.885503,0.00062272,-4.39427e-07,-7.72306e-09,0.886125,0.000621818,-4.62596e-07,2.33995e-08,0.886746,0.000620963,-3.92398e-07,-2.62704e-08,0.887367,0.000620099,-4.71209e-07,2.20775e-08,0.887987,0.000619223,-4.04976e-07,-2.43496e-09,0.888605,0.000618406,-4.12281e-07,-1.23377e-08,0.889223,0.000617544,-4.49294e-07,-7.81876e-09,0.88984,0.000616622,-4.72751e-07,4.36128e-08,0.890457,0.000615807,-3.41912e-07,-4.7423e-08,0.891072,0.000614981,-4.84181e-07,2.68698e-08,0.891687,0.000614093,-4.03572e-07,-4.51384e-10,0.8923,0.000613285,-4.04926e-07,-2.50643e-08,0.892913,0.0006124,-4.80119e-07,4.11038e-08,0.893525,0.000611563,-3.56808e-07,-2.01414e-08,0.894136,0.000610789,-4.17232e-07,-2.01426e-08,0.894747,0.000609894,-4.7766e-07,4.11073e-08,0.895356,0.000609062,-3.54338e-07,-2.50773e-08,0.895965,0.000608278,-4.2957e-07,-4.02954e-10,0.896573,0.000607418,-4.30779e-07,2.66891e-08,0.89718,0.000606636,-3.50711e-07,-4.67489e-08,0.897786,0.000605795,-4.90958e-07,4.10972e-08,0.898391,0.000604936,-3.67666e-07,1.56948e-09,0.898996,0.000604205,-3.62958e-07,-4.73751e-08,0.8996,0.000603337,-5.05083e-07,6.87214e-08,0.900202,0.000602533,-2.98919e-07,-4.86966e-08,0.900805,0.000601789,-4.45009e-07,6.85589e-09,0.901406,0.00060092,-4.24441e-07,2.1273e-08,0.902007,0.000600135,-3.60622e-07,-3.23434e-08,0.902606,0.000599317,-4.57652e-07,4.84959e-08,0.903205,0.000598547,-3.12164e-07,-4.24309e-08,0.903803,0.000597795,-4.39457e-07,2.01844e-09,0.904401,0.000596922,-4.33402e-07,3.43571e-08,0.904997,0.000596159,-3.30331e-07,-2.02374e-08,0.905593,0.000595437,-3.91043e-07,-1.30123e-08,0.906188,0.000594616,-4.3008e-07,1.26819e-08,0.906782,0.000593794,-3.92034e-07,2.18894e-08,0.907376,0.000593076,-3.26366e-07,-4.06349e-08,0.907968,0.000592301,-4.4827e-07,2.1441e-08,0.90856,0.000591469,-3.83947e-07,1.44754e-08,0.909151,0.000590744,-3.40521e-07,-1.97379e-08,0.909742,0.000590004,-3.99735e-07,4.87161e-09,0.910331,0.000589219,-3.8512e-07,2.51532e-10,0.91092,0.00058845,-3.84366e-07,-5.87776e-09,0.911508,0.000587663,-4.01999e-07,2.32595e-08,0.912096,0.000586929,-3.3222e-07,-2.75554e-08,0.912682,0.000586182,-4.14887e-07,2.73573e-08,0.913268,0.000585434,-3.32815e-07,-2.22692e-08,0.913853,0.000584702,-3.99622e-07,2.11486e-09,0.914437,0.000583909,-3.93278e-07,1.38098e-08,0.915021,0.000583164,-3.51848e-07,2.25042e-09,0.915604,0.000582467,-3.45097e-07,-2.28115e-08,0.916186,0.000581708,-4.13531e-07,2.93911e-08,0.916767,0.000580969,-3.25358e-07,-3.51481e-08,0.917348,0.000580213,-4.30803e-07,5.15967e-08,0.917928,0.000579506,-2.76012e-07,-5.20296e-08,0.918507,0.000578798,-4.32101e-07,3.73124e-08,0.919085,0.000578046,-3.20164e-07,-3.76154e-08,0.919663,0.000577293,-4.3301e-07,5.35447e-08,0.92024,0.000576587,-2.72376e-07,-5.7354e-08,0.920816,0.000575871,-4.44438e-07,5.66621e-08,0.921391,0.000575152,-2.74452e-07,-5.00851e-08,0.921966,0.000574453,-4.24707e-07,2.4469e-08,0.92254,0.000573677,-3.513e-07,1.18138e-08,0.923114,0.000573009,-3.15859e-07,-1.21195e-08,0.923686,0.000572341,-3.52217e-07,-2.29403e-08,0.924258,0.000571568,-4.21038e-07,4.4276e-08,0.924829,0.000570859,-2.8821e-07,-3.49546e-08,0.9254,0.000570178,-3.93074e-07,3.59377e-08,0.92597,0.000569499,-2.85261e-07,-4.91915e-08,0.926539,0.000568781,-4.32835e-07,4.16189e-08,0.927107,0.00056804,-3.07979e-07,1.92523e-09,0.927675,0.00056743,-3.02203e-07,-4.93198e-08,0.928242,0.000566678,-4.50162e-07,7.61447e-08,0.928809,0.000566006,-2.21728e-07,-7.6445e-08,0.929374,0.000565333,-4.51063e-07,5.08216e-08,0.929939,0.000564583,-2.98599e-07,-7.63212e-09,0.930503,0.000563963,-3.21495e-07,-2.02931e-08,0.931067,0.000563259,-3.82374e-07,2.92001e-08,0.93163,0.000562582,-2.94774e-07,-3.69025e-08,0.932192,0.000561882,-4.05482e-07,5.88053e-08,0.932754,0.000561247,-2.29066e-07,-7.91094e-08,0.933315,0.000560552,-4.66394e-07,7.88184e-08,0.933875,0.000559856,-2.29939e-07,-5.73501e-08,0.934434,0.000559224,-4.01989e-07,3.13727e-08,0.934993,0.000558514,-3.07871e-07,-8.53611e-09,0.935551,0.000557873,-3.33479e-07,2.77175e-09,0.936109,0.000557214,-3.25164e-07,-2.55091e-09,0.936666,0.000556556,-3.32817e-07,7.43188e-09,0.937222,0.000555913,-3.10521e-07,-2.71766e-08,0.937778,0.00055521,-3.92051e-07,4.167e-08,0.938333,0.000554551,-2.67041e-07,-2.02941e-08,0.938887,0.000553956,-3.27923e-07,-2.00984e-08,0.93944,0.00055324,-3.88218e-07,4.10828e-08,0.939993,0.000552587,-2.6497e-07,-2.50237e-08,0.940546,0.000551982,-3.40041e-07,-5.92583e-10,0.941097,0.0005513,-3.41819e-07,2.7394e-08,0.941648,0.000550698,-2.59637e-07,-4.93788e-08,0.942199,0.000550031,-4.07773e-07,5.09119e-08,0.942748,0.000549368,-2.55038e-07,-3.50595e-08,0.943297,0.000548753,-3.60216e-07,2.97214e-08,0.943846,0.000548122,-2.71052e-07,-2.42215e-08,0.944394,0.000547507,-3.43716e-07,7.55985e-09,0.944941,0.000546842,-3.21037e-07,-6.01796e-09,0.945487,0.000546182,-3.3909e-07,1.65119e-08,0.946033,0.000545553,-2.89555e-07,-4.2498e-10,0.946578,0.000544973,-2.9083e-07,-1.4812e-08,0.947123,0.000544347,-3.35266e-07,6.83068e-11,0.947667,0.000543676,-3.35061e-07,1.45388e-08,0.94821,0.00054305,-2.91444e-07,1.38123e-09,0.948753,0.000542471,-2.87301e-07,-2.00637e-08,0.949295,0.000541836,-3.47492e-07,1.92688e-08,0.949837,0.000541199,-2.89685e-07,2.59298e-09,0.950378,0.000540628,-2.81906e-07,-2.96407e-08,0.950918,0.000539975,-3.70829e-07,5.63652e-08,0.951458,0.000539402,-2.01733e-07,-7.66107e-08,0.951997,0.000538769,-4.31565e-07,7.12638e-08,0.952535,0.00053812,-2.17774e-07,-2.96305e-08,0.953073,0.000537595,-3.06665e-07,-1.23464e-08,0.95361,0.000536945,-3.43704e-07,1.94114e-08,0.954147,0.000536316,-2.8547e-07,-5.69451e-09,0.954683,0.000535728,-3.02554e-07,3.36666e-09,0.955219,0.000535133,-2.92454e-07,-7.77208e-09,0.955753,0.000534525,-3.1577e-07,2.77216e-08,0.956288,0.000533976,-2.32605e-07,-4.35097e-08,0.956821,0.00053338,-3.63134e-07,2.7108e-08,0.957354,0.000532735,-2.8181e-07,-5.31772e-09,0.957887,0.000532156,-2.97764e-07,-5.83718e-09,0.958419,0.000531543,-3.15275e-07,2.86664e-08,0.95895,0.000530998,-2.29276e-07,-4.9224e-08,0.959481,0.000530392,-3.76948e-07,4.90201e-08,0.960011,0.000529785,-2.29887e-07,-2.76471e-08,0.96054,0.000529243,-3.12829e-07,1.96385e-09,0.961069,0.000528623,-3.06937e-07,1.97917e-08,0.961598,0.000528068,-2.47562e-07,-2.15261e-08,0.962125,0.000527508,-3.1214e-07,6.70795e-09,0.962653,0.000526904,-2.92016e-07,-5.30573e-09,0.963179,0.000526304,-3.07934e-07,1.4515e-08,0.963705,0.000525732,-2.64389e-07,6.85048e-09,0.964231,0.000525224,-2.43837e-07,-4.19169e-08,0.964756,0.00052461,-3.69588e-07,4.1608e-08,0.96528,0.000523996,-2.44764e-07,-5.30598e-09,0.965804,0.000523491,-2.60682e-07,-2.03841e-08,0.966327,0.000522908,-3.21834e-07,2.72378e-08,0.966849,0.000522346,-2.40121e-07,-2.89625e-08,0.967371,0.000521779,-3.27008e-07,2.90075e-08,0.967893,0.000521212,-2.39986e-07,-2.74629e-08,0.968414,0.00052065,-3.22374e-07,2.12396e-08,0.968934,0.000520069,-2.58656e-07,2.10922e-09,0.969454,0.000519558,-2.52328e-07,-2.96765e-08,0.969973,0.000518964,-3.41357e-07,5.6992e-08,0.970492,0.000518452,-1.70382e-07,-7.90821e-08,0.97101,0.000517874,-4.07628e-07,8.05224e-08,0.971528,0.000517301,-1.66061e-07,-6.41937e-08,0.972045,0.000516776,-3.58642e-07,5.70429e-08,0.972561,0.00051623,-1.87513e-07,-4.47686e-08,0.973077,0.00051572,-3.21819e-07,2.82237e-09,0.973593,0.000515085,-3.13352e-07,3.34792e-08,0.974108,0.000514559,-2.12914e-07,-1.75298e-08,0.974622,0.000514081,-2.65503e-07,-2.29648e-08,0.975136,0.000513481,-3.34398e-07,4.97843e-08,0.975649,0.000512961,-1.85045e-07,-5.6963e-08,0.976162,0.00051242,-3.55934e-07,5.88585e-08,0.976674,0.000511885,-1.79359e-07,-5.92616e-08,0.977185,0.000511348,-3.57143e-07,5.89785e-08,0.977696,0.000510811,-1.80208e-07,-5.74433e-08,0.978207,0.000510278,-3.52538e-07,5.15854e-08,0.978717,0.000509728,-1.97781e-07,-2.9689e-08,0.979226,0.000509243,-2.86848e-07,7.56591e-09,0.979735,0.000508692,-2.64151e-07,-5.74649e-10,0.980244,0.000508162,-2.65875e-07,-5.26732e-09,0.980752,0.000507615,-2.81677e-07,2.16439e-08,0.981259,0.000507116,-2.16745e-07,-2.17037e-08,0.981766,0.000506618,-2.81856e-07,5.56636e-09,0.982272,0.000506071,-2.65157e-07,-5.61689e-10,0.982778,0.000505539,-2.66842e-07,-3.31963e-09,0.983283,0.000504995,-2.76801e-07,1.38402e-08,0.983788,0.000504483,-2.3528e-07,7.56339e-09,0.984292,0.000504035,-2.1259e-07,-4.40938e-08,0.984796,0.000503478,-3.44871e-07,4.96026e-08,0.985299,0.000502937,-1.96064e-07,-3.51071e-08,0.985802,0.000502439,-3.01385e-07,3.12212e-08,0.986304,0.00050193,-2.07721e-07,-3.0173e-08,0.986806,0.000501424,-2.9824e-07,2.9866e-08,0.987307,0.000500917,-2.08642e-07,-2.96865e-08,0.987808,0.000500411,-2.97702e-07,2.92753e-08,0.988308,0.000499903,-2.09876e-07,-2.78101e-08,0.988807,0.0004994,-2.93306e-07,2.23604e-08,0.989307,0.000498881,-2.26225e-07,-2.02681e-09,0.989805,0.000498422,-2.32305e-07,-1.42531e-08,0.990303,0.000497915,-2.75065e-07,-5.65232e-10,0.990801,0.000497363,-2.76761e-07,1.65141e-08,0.991298,0.000496859,-2.27218e-07,-5.88639e-09,0.991795,0.000496387,-2.44878e-07,7.0315e-09,0.992291,0.000495918,-2.23783e-07,-2.22396e-08,0.992787,0.000495404,-2.90502e-07,2.23224e-08,0.993282,0.00049489,-2.23535e-07,-7.44543e-09,0.993776,0.000494421,-2.45871e-07,7.45924e-09,0.994271,0.000493951,-2.23493e-07,-2.23915e-08,0.994764,0.000493437,-2.90668e-07,2.25021e-08,0.995257,0.000492923,-2.23161e-07,-8.01218e-09,0.99575,0.000492453,-2.47198e-07,9.54669e-09,0.996242,0.000491987,-2.18558e-07,-3.01746e-08,0.996734,0.000491459,-3.09082e-07,5.1547e-08,0.997225,0.000490996,-1.54441e-07,-5.68039e-08,0.997716,0.000490517,-3.24853e-07,5.64594e-08,0.998206,0.000490036,-1.55474e-07,-4.98245e-08,0.998696,0.000489576,-3.04948e-07,2.36292e-08,0.999186,0.000489037,-2.3406e-07,1.49121e-08,0.999674,0.000488613,-1.89324e-07,-2.3673e-08,1.00016,0.000488164,-2.60343e-07,2.01754e-08,1.00065,0.000487704,-1.99816e-07,-5.70288e-08,1.00114,0.000487133,-3.70903e-07,8.87303e-08,1.00162,0.000486657,-1.04712e-07,-5.94737e-08,1.00211,0.000486269,-2.83133e-07,2.99553e-08,1.0026,0.000485793,-1.93267e-07,-6.03474e-08,1.00308,0.000485225,-3.74309e-07,9.2225e-08,1.00357,0.000484754,-9.76345e-08,-7.0134e-08,1.00405,0.000484348,-3.08036e-07,6.91016e-08,1.00454,0.000483939,-1.00731e-07,-8.70633e-08,1.00502,0.000483476,-3.61921e-07,4.07328e-08,1.0055,0.000482875,-2.39723e-07,4.33413e-08,1.00599,0.000482525,-1.09699e-07,-9.48886e-08,1.00647,0.000482021,-3.94365e-07,9.77947e-08,1.00695,0.000481526,-1.00981e-07,-5.78713e-08,1.00743,0.00048115,-2.74595e-07,1.44814e-08,1.00791,0.000480645,-2.31151e-07,-5.42665e-11,1.00839,0.000480182,-2.31314e-07,-1.42643e-08,1.00887,0.000479677,-2.74106e-07,5.71115e-08,1.00935,0.0004793,-1.02772e-07,-9.49724e-08,1.00983,0.000478809,-3.87689e-07,8.43596e-08,1.01031,0.000478287,-1.3461e-07,-4.04755e-09,1.01079,0.000478006,-1.46753e-07,-6.81694e-08,1.01127,0.000477508,-3.51261e-07,3.83067e-08,1.01174,0.00047692,-2.36341e-07,3.41521e-08,1.01222,0.00047655,-1.33885e-07,-5.57058e-08,1.0127,0.000476115,-3.01002e-07,6.94616e-08,1.01317,0.000475721,-9.26174e-08,-1.02931e-07,1.01365,0.000475227,-4.01412e-07,1.03846e-07,1.01412,0.000474736,-8.98751e-08,-7.40321e-08,1.0146,0.000474334,-3.11971e-07,7.30735e-08,1.01507,0.00047393,-9.27508e-08,-9.90527e-08,1.01554,0.000473447,-3.89909e-07,8.47188e-08,1.01602,0.000472921,-1.35753e-07,-1.40381e-09,1.01649,0.000472645,-1.39964e-07,-7.91035e-08,1.01696,0.000472128,-3.77275e-07,7.93993e-08,1.01744,0.000471612,-1.39077e-07,-7.52607e-11,1.01791,0.000471334,-1.39302e-07,-7.90983e-08,1.01838,0.000470818,-3.76597e-07,7.80499e-08,1.01885,0.000470299,-1.42448e-07,5.31733e-09,1.01932,0.00047003,-1.26496e-07,-9.93193e-08,1.01979,0.000469479,-4.24453e-07,1.53541e-07,1.02026,0.00046909,3.617e-08,-1.57217e-07,1.02073,0.000468691,-4.35482e-07,1.177e-07,1.02119,0.000468173,-8.23808e-08,-7.51659e-08,1.02166,0.000467783,-3.07878e-07,6.37538e-08,1.02213,0.000467358,-1.16617e-07,-6.064e-08,1.0226,0.000466943,-2.98537e-07,5.9597e-08,1.02306,0.000466525,-1.19746e-07,-5.85386e-08,1.02353,0.00046611,-2.95362e-07,5.53482e-08,1.024,0.000465685,-1.29317e-07,-4.36449e-08,1.02446,0.000465296,-2.60252e-07,2.20268e-11,1.02493,0.000464775,-2.60186e-07,4.35568e-08,1.02539,0.000464386,-1.29516e-07,-5.50398e-08,1.02586,0.000463961,-2.94635e-07,5.73932e-08,1.02632,0.000463544,-1.22456e-07,-5.53236e-08,1.02678,0.000463133,-2.88426e-07,4.46921e-08,1.02725,0.000462691,-1.5435e-07,-4.23534e-09,1.02771,0.000462369,-1.67056e-07,-2.77507e-08,1.02817,0.000461952,-2.50308e-07,-3.97101e-09,1.02863,0.000461439,-2.62221e-07,4.36348e-08,1.02909,0.000461046,-1.31317e-07,-5.13589e-08,1.02955,0.000460629,-2.85394e-07,4.25913e-08,1.03001,0.000460186,-1.5762e-07,2.0285e-10,1.03047,0.000459871,-1.57011e-07,-4.34027e-08,1.03093,0.000459427,-2.87219e-07,5.41987e-08,1.03139,0.000459015,-1.24623e-07,-5.4183e-08,1.03185,0.000458604,-2.87172e-07,4.33239e-08,1.03231,0.000458159,-1.572e-07,9.65817e-11,1.03277,0.000457845,-1.56911e-07,-4.37103e-08,1.03323,0.0004574,-2.88041e-07,5.55351e-08,1.03368,0.000456991,-1.21436e-07,-5.9221e-08,1.03414,0.00045657,-2.99099e-07,6.21394e-08,1.0346,0.000456158,-1.1268e-07,-7.01275e-08,1.03505,0.000455723,-3.23063e-07,9.91614e-08,1.03551,0.000455374,-2.55788e-08,-8.80996e-08,1.03596,0.000455058,-2.89878e-07,1.48184e-08,1.03642,0.000454523,-2.45422e-07,2.88258e-08,1.03687,0.000454119,-1.58945e-07,-1.09125e-08,1.03733,0.000453768,-1.91682e-07,1.48241e-08,1.03778,0.000453429,-1.4721e-07,-4.83838e-08,1.03823,0.00045299,-2.92361e-07,5.95019e-08,1.03869,0.000452584,-1.13856e-07,-7.04146e-08,1.03914,0.000452145,-3.25099e-07,1.02947e-07,1.03959,0.000451803,-1.62583e-08,-1.02955e-07,1.04004,0.000451462,-3.25123e-07,7.04544e-08,1.04049,0.000451023,-1.1376e-07,-5.96534e-08,1.04094,0.000450616,-2.9272e-07,4.89499e-08,1.04139,0.000450178,-1.45871e-07,-1.69369e-08,1.04184,0.000449835,-1.96681e-07,1.87977e-08,1.04229,0.000449498,-1.40288e-07,-5.82539e-08,1.04274,0.000449043,-3.1505e-07,9.50087e-08,1.04319,0.000448698,-3.00238e-08,-8.33623e-08,1.04364,0.000448388,-2.80111e-07,2.20363e-11,1.04409,0.000447828,-2.80045e-07,8.32742e-08,1.04454,0.000447517,-3.02221e-08,-9.47002e-08,1.04498,0.000447173,-3.14323e-07,5.7108e-08,1.04543,0.000446716,-1.42999e-07,-1.45225e-08,1.04588,0.000446386,-1.86566e-07,9.82022e-10,1.04632,0.000446016,-1.8362e-07,1.05944e-08,1.04677,0.00044568,-1.51837e-07,-4.33597e-08,1.04721,0.000445247,-2.81916e-07,4.36352e-08,1.04766,0.000444814,-1.51011e-07,-1.19717e-08,1.0481,0.000444476,-1.86926e-07,4.25158e-09,1.04855,0.000444115,-1.74171e-07,-5.03461e-09,1.04899,0.000443751,-1.89275e-07,1.58868e-08,1.04944,0.00044342,-1.41614e-07,-5.85127e-08,1.04988,0.000442961,-3.17152e-07,9.89548e-08,1.05032,0.000442624,-2.0288e-08,-9.88878e-08,1.05076,0.000442287,-3.16951e-07,5.81779e-08,1.05121,0.000441827,-1.42418e-07,-1.46144e-08,1.05165,0.000441499,-1.86261e-07,2.79892e-10,1.05209,0.000441127,-1.85421e-07,1.34949e-08,1.05253,0.000440797,-1.44937e-07,-5.42594e-08,1.05297,0.000440344,-3.07715e-07,8.43335e-08,1.05341,0.000439982,-5.47146e-08,-4.46558e-08,1.05385,0.000439738,-1.88682e-07,-2.49193e-08,1.05429,0.000439286,-2.6344e-07,2.5124e-08,1.05473,0.000438835,-1.88068e-07,4.36328e-08,1.05517,0.000438589,-5.71699e-08,-8.04459e-08,1.05561,0.000438234,-2.98508e-07,3.97324e-08,1.05605,0.000437756,-1.79311e-07,4.07258e-08,1.05648,0.000437519,-5.71332e-08,-8.34263e-08,1.05692,0.000437155,-3.07412e-07,5.45608e-08,1.05736,0.000436704,-1.4373e-07,-1.56078e-08,1.05779,0.000436369,-1.90553e-07,7.87043e-09,1.05823,0.000436012,-1.66942e-07,-1.58739e-08,1.05867,0.00043563,-2.14563e-07,5.56251e-08,1.0591,0.000435368,-4.76881e-08,-8.74172e-08,1.05954,0.000435011,-3.0994e-07,5.56251e-08,1.05997,0.000434558,-1.43064e-07,-1.58739e-08,1.06041,0.000434224,-1.90686e-07,7.87042e-09,1.06084,0.000433866,-1.67075e-07,-1.56078e-08,1.06127,0.000433485,-2.13898e-07,5.45609e-08,1.06171,0.000433221,-5.02157e-08,-8.34263e-08,1.06214,0.00043287,-3.00495e-07,4.07258e-08,1.06257,0.000432391,-1.78317e-07,3.97325e-08,1.063,0.000432154,-5.91198e-08,-8.04464e-08,1.06344,0.000431794,-3.00459e-07,4.36347e-08,1.06387,0.000431324,-1.69555e-07,2.5117e-08,1.0643,0.000431061,-9.42041e-08,-2.48934e-08,1.06473,0.000430798,-1.68884e-07,-4.47527e-08,1.06516,0.000430326,-3.03142e-07,8.46951e-08,1.06559,0.000429973,-4.90573e-08,-5.56089e-08,1.06602,0.000429708,-2.15884e-07,1.85314e-08,1.06645,0.000429332,-1.6029e-07,-1.85166e-08,1.06688,0.000428956,-2.1584e-07,5.5535e-08,1.06731,0.000428691,-4.92347e-08,-8.44142e-08,1.06774,0.000428339,-3.02477e-07,4.37032e-08,1.06816,0.000427865,-1.71368e-07,2.88107e-08,1.06859,0.000427609,-8.49356e-08,-3.97367e-08,1.06902,0.00042732,-2.04146e-07,1.09267e-08,1.06945,0.000426945,-1.71365e-07,-3.97023e-09,1.06987,0.00042659,-1.83276e-07,4.9542e-09,1.0703,0.000426238,-1.68414e-07,-1.58466e-08,1.07073,0.000425854,-2.15953e-07,5.84321e-08,1.07115,0.000425597,-4.0657e-08,-9.86725e-08,1.07158,0.00042522,-3.36674e-07,9.78392e-08,1.072,0.00042484,-4.31568e-08,-5.42658e-08,1.07243,0.000424591,-2.05954e-07,1.45377e-11,1.07285,0.000424179,-2.0591e-07,5.42076e-08,1.07328,0.00042393,-4.32877e-08,-9.76357e-08,1.0737,0.00042355,-3.36195e-07,9.79165e-08,1.07412,0.000423172,-4.24451e-08,-5.56118e-08,1.07455,0.00042292,-2.09281e-07,5.32143e-09,1.07497,0.000422518,-1.93316e-07,3.43261e-08,1.07539,0.000422234,-9.0338e-08,-2.34165e-08,1.07581,0.000421983,-1.60588e-07,-5.98692e-08,1.07623,0.000421482,-3.40195e-07,1.43684e-07,1.07666,0.000421233,9.08574e-08,-1.5724e-07,1.07708,0.000420943,-3.80862e-07,1.27647e-07,1.0775,0.000420564,2.0791e-09,-1.1493e-07,1.07792,0.000420223,-3.4271e-07,9.36534e-08,1.07834,0.000419819,-6.17499e-08,-2.12653e-08,1.07876,0.000419632,-1.25546e-07,-8.59219e-09,1.07918,0.000419355,-1.51322e-07,-6.35752e-08,1.0796,0.000418861,-3.42048e-07,1.43684e-07,1.08002,0.000418608,8.90034e-08,-1.53532e-07,1.08043,0.000418326,-3.71593e-07,1.12817e-07,1.08085,0.000417921,-3.31414e-08,-5.93184e-08,1.08127,0.000417677,-2.11097e-07,5.24697e-09,1.08169,0.00041727,-1.95356e-07,3.83305e-08,1.0821,0.000416995,-8.03642e-08,-3.93597e-08,1.08252,0.000416716,-1.98443e-07,-1.0094e-10,1.08294,0.000416319,-1.98746e-07,3.97635e-08,1.08335,0.00041604,-7.94557e-08,-3.97437e-08,1.08377,0.000415762,-1.98687e-07,1.94215e-12,1.08419,0.000415365,-1.98681e-07,3.97359e-08,1.0846,0.000415087,-7.94732e-08,-3.97362e-08,1.08502,0.000414809,-1.98682e-07,-4.31063e-13,1.08543,0.000414411,-1.98683e-07,3.97379e-08,1.08584,0.000414133,-7.94694e-08,-3.97418e-08,1.08626,0.000413855,-1.98695e-07,2.00563e-11,1.08667,0.000413458,-1.98635e-07,3.96616e-08,1.08709,0.000413179,-7.965e-08,-3.9457e-08,1.0875,0.000412902,-1.98021e-07,-1.04281e-09,1.08791,0.000412502,-2.01149e-07,4.36282e-08,1.08832,0.000412231,-7.02648e-08,-5.42608e-08,1.08874,0.000411928,-2.33047e-07,5.42057e-08,1.08915,0.000411624,-7.04301e-08,-4.33527e-08,1.08956,0.000411353,-2.00488e-07,-4.07378e-12,1.08997,0.000410952,-2.005e-07,4.3369e-08,1.09038,0.000410681,-7.03934e-08,-5.42627e-08,1.09079,0.000410378,-2.33182e-07,5.44726e-08,1.0912,0.000410075,-6.97637e-08,-4.44186e-08,1.09161,0.000409802,-2.03019e-07,3.99235e-09,1.09202,0.000409408,-1.91042e-07,2.84491e-08,1.09243,0.000409111,-1.05695e-07,1.42043e-09,1.09284,0.000408904,-1.01434e-07,-3.41308e-08,1.09325,0.000408599,-2.03826e-07,1.58937e-08,1.09366,0.000408239,-1.56145e-07,-2.94438e-08,1.09406,0.000407838,-2.44476e-07,1.01881e-07,1.09447,0.000407655,6.11676e-08,-1.39663e-07,1.09488,0.000407358,-3.57822e-07,9.91432e-08,1.09529,0.00040694,-6.03921e-08,-1.84912e-08,1.09569,0.000406764,-1.15866e-07,-2.51785e-08,1.0961,0.000406457,-1.91401e-07,-4.03115e-12,1.09651,0.000406074,-1.91413e-07,2.51947e-08,1.09691,0.000405767,-1.15829e-07,1.84346e-08,1.09732,0.00040559,-6.05254e-08,-9.89332e-08,1.09772,0.000405172,-3.57325e-07,1.3888e-07,1.09813,0.000404874,5.93136e-08,-9.8957e-08,1.09853,0.000404696,-2.37557e-07,1.853e-08,1.09894,0.000404277,-1.81968e-07,2.48372e-08,1.09934,0.000403987,-1.07456e-07,1.33047e-09,1.09975,0.000403776,-1.03465e-07,-3.01591e-08,1.10015,0.000403479,-1.93942e-07,9.66054e-11,1.10055,0.000403091,-1.93652e-07,2.97727e-08,1.10096,0.000402793,-1.04334e-07,2.19273e-11,1.10136,0.000402585,-1.04268e-07,-2.98604e-08,1.10176,0.000402287,-1.93849e-07,2.10325e-10,1.10216,0.0004019,-1.93218e-07,2.90191e-08,1.10256,0.0004016,-1.06161e-07,2.92264e-09,1.10297,0.000401397,-9.73931e-08,-4.07096e-08,1.10337,0.00040108,-2.19522e-07,4.07067e-08,1.10377,0.000400763,-9.7402e-08,-2.90783e-09,1.10417,0.000400559,-1.06126e-07,-2.90754e-08,1.10457,0.00040026,-1.93352e-07,9.00021e-14,1.10497,0.000399873,-1.93351e-07,2.9075e-08,1.10537,0.000399574,-1.06126e-07,2.90902e-09,1.10577,0.00039937,-9.73992e-08,-4.07111e-08,1.10617,0.000399053,-2.19533e-07,4.07262e-08,1.10657,0.000398736,-9.73541e-08,-2.98424e-09,1.10697,0.000398533,-1.06307e-07,-2.87892e-08,1.10736,0.000398234,-1.92674e-07,-1.06824e-09,1.10776,0.000397845,-1.95879e-07,3.30622e-08,1.10816,0.000397552,-9.66926e-08,-1.19712e-08,1.10856,0.000397323,-1.32606e-07,1.48225e-08,1.10895,0.000397102,-8.81387e-08,-4.73187e-08,1.10935,0.000396784,-2.30095e-07,5.52429e-08,1.10975,0.00039649,-6.4366e-08,-5.44437e-08,1.11014,0.000396198,-2.27697e-07,4.33226e-08,1.11054,0.000395872,-9.77293e-08,3.62656e-10,1.11094,0.000395678,-9.66414e-08,-4.47732e-08,1.11133,0.00039535,-2.30961e-07,5.95208e-08,1.11173,0.000395067,-5.23985e-08,-7.41008e-08,1.11212,0.00039474,-2.74701e-07,1.17673e-07,1.11252,0.000394543,7.83181e-08,-1.58172e-07,1.11291,0.000394225,-3.96199e-07,1.57389e-07,1.1133,0.000393905,7.59679e-08,-1.13756e-07,1.1137,0.000393716,-2.653e-07,5.92165e-08,1.11409,0.000393363,-8.76507e-08,-3.90074e-09,1.11449,0.000393176,-9.93529e-08,-4.36136e-08,1.11488,0.000392846,-2.30194e-07,5.91457e-08,1.11527,0.000392563,-5.27564e-08,-7.376e-08,1.11566,0.000392237,-2.74037e-07,1.16685e-07,1.11606,0.000392039,7.60189e-08,-1.54562e-07,1.11645,0.000391727,-3.87667e-07,1.43935e-07,1.11684,0.000391384,4.4137e-08,-6.35487e-08,1.11723,0.000391281,-1.46509e-07,-8.94896e-09,1.11762,0.000390961,-1.73356e-07,-1.98647e-08,1.11801,0.000390555,-2.3295e-07,8.8408e-08,1.1184,0.000390354,3.22736e-08,-9.53486e-08,1.11879,0.000390133,-2.53772e-07,5.45677e-08,1.11918,0.000389789,-9.0069e-08,-3.71296e-09,1.11957,0.000389598,-1.01208e-07,-3.97159e-08,1.11996,0.000389276,-2.20355e-07,4.33671e-08,1.12035,0.000388966,-9.02542e-08,-1.45431e-08,1.12074,0.000388741,-1.33883e-07,1.48052e-08,1.12113,0.000388518,-8.94678e-08,-4.46778e-08,1.12152,0.000388205,-2.23501e-07,4.46966e-08,1.12191,0.000387892,-8.94114e-08,-1.48992e-08,1.12229,0.000387669,-1.34109e-07,1.49003e-08,1.12268,0.000387445,-8.94082e-08,-4.47019e-08,1.12307,0.000387132,-2.23514e-07,4.4698e-08,1.12345,0.000386819,-8.942e-08,-1.48806e-08,1.12384,0.000386596,-1.34062e-07,1.48245e-08,1.12423,0.000386372,-8.95885e-08,-4.44172e-08,1.12461,0.00038606,-2.2284e-07,4.36351e-08,1.125,0.000385745,-9.19348e-08,-1.09139e-08,1.12539,0.000385528,-1.24677e-07,2.05584e-11,1.12577,0.000385279,-1.24615e-07,1.08317e-08,1.12616,0.000385062,-9.21198e-08,-4.33473e-08,1.12654,0.000384748,-2.22162e-07,4.33481e-08,1.12693,0.000384434,-9.21174e-08,-1.08356e-08,1.12731,0.000384217,-1.24624e-07,-5.50907e-12,1.12769,0.000383968,-1.24641e-07,1.08577e-08,1.12808,0.000383751,-9.20679e-08,-4.34252e-08,1.12846,0.000383437,-2.22343e-07,4.36337e-08,1.12884,0.000383123,-9.14422e-08,-1.19005e-08,1.12923,0.000382904,-1.27144e-07,3.96813e-09,1.12961,0.000382662,-1.15239e-07,-3.97207e-09,1.12999,0.000382419,-1.27155e-07,1.19201e-08,1.13038,0.000382201,-9.1395e-08,-4.37085e-08,1.13076,0.000381887,-2.2252e-07,4.37046e-08,1.13114,0.000381573,-9.14068e-08,-1.19005e-08,1.13152,0.000381355,-1.27108e-07,3.89734e-09,1.1319,0.000381112,-1.15416e-07,-3.68887e-09,1.13228,0.00038087,-1.26483e-07,1.08582e-08,1.13266,0.00038065,-9.39083e-08,-3.97438e-08,1.13304,0.000380343,-2.1314e-07,2.89076e-08,1.13342,0.000380003,-1.26417e-07,4.33225e-08,1.1338,0.00037988,3.55072e-09,-8.29883e-08,1.13418,0.000379638,-2.45414e-07,5.0212e-08,1.13456,0.000379298,-9.47781e-08,1.34964e-09,1.13494,0.000379113,-9.07292e-08,-5.56105e-08,1.13532,0.000378764,-2.57561e-07,1.01883e-07,1.1357,0.000378555,4.80889e-08,-1.13504e-07,1.13608,0.000378311,-2.92423e-07,1.13713e-07,1.13646,0.000378067,4.87176e-08,-1.02931e-07,1.13683,0.000377856,-2.60076e-07,5.95923e-08,1.13721,0.000377514,-8.12988e-08,-1.62288e-08,1.13759,0.000377303,-1.29985e-07,5.32278e-09,1.13797,0.000377059,-1.14017e-07,-5.06237e-09,1.13834,0.000376816,-1.29204e-07,1.49267e-08,1.13872,0.000376602,-8.44237e-08,-5.46444e-08,1.1391,0.000376269,-2.48357e-07,8.44417e-08,1.13947,0.000376026,4.96815e-09,-4.47039e-08,1.13985,0.000375902,-1.29143e-07,-2.48355e-08,1.14023,0.000375569,-2.0365e-07,2.48368e-08,1.1406,0.000375236,-1.2914e-07,4.46977e-08,1.14098,0.000375112,4.95341e-09,-8.44184e-08,1.14135,0.000374869,-2.48302e-07,5.45572e-08,1.14173,0.000374536,-8.463e-08,-1.46013e-08,1.1421,0.000374323,-1.28434e-07,3.8478e-09,1.14247,0.000374077,-1.1689e-07,-7.89941e-10,1.14285,0.000373841,-1.1926e-07,-6.88042e-10,1.14322,0.0003736,-1.21324e-07,3.54213e-09,1.1436,0.000373368,-1.10698e-07,-1.34805e-08,1.14397,0.000373107,-1.51139e-07,5.03798e-08,1.14434,0.000372767,0.,0.};\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void RGB2LuvConvert_f(const T& src, D& dst)\n        {\n            const float _d = 1.f / (0.950456f + 15 + 1.088754f * 3);\n            const float _un = 13 * (4 * 0.950456f * _d);\n            const float _vn = 13 * (9 * _d);\n\n            float B = blueIdx == 0 ? src.x : src.z;\n            float G = src.y;\n            float R = blueIdx == 0 ? src.z : src.x;\n\n            if (srgb)\n            {\n                B = splineInterpolate(B * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n                G = splineInterpolate(G * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n                R = splineInterpolate(R * GAMMA_TAB_SIZE, c_sRGBGammaTab, GAMMA_TAB_SIZE);\n            }\n\n            float X = R * 0.412453f + G * 0.357580f + B * 0.180423f;\n            float Y = R * 0.212671f + G * 0.715160f + B * 0.072169f;\n            float Z = R * 0.019334f + G * 0.119193f + B * 0.950227f;\n\n            float L = splineInterpolate(Y * (LAB_CBRT_TAB_SIZE / 1.5f), c_LabCbrtTab, LAB_CBRT_TAB_SIZE);\n            L = 116.f * L - 16.f;\n\n            const float d = (4 * 13) / ::fmaxf(X + 15 * Y + 3 * Z, numeric_limits<float>::epsilon());\n            float u = L * (X * d - _un);\n            float v = L * ((9 * 0.25f) * Y * d - _vn);\n\n            dst.x = L;\n            dst.y = u;\n            dst.z = v;\n        }\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void RGB2LuvConvert_b(const T& src, D& dst)\n        {\n            float3 srcf, dstf;\n\n            srcf.x = src.x * (1.f / 255.f);\n            srcf.y = src.y * (1.f / 255.f);\n            srcf.z = src.z * (1.f / 255.f);\n\n            RGB2LuvConvert_f<srgb, blueIdx>(srcf, dstf);\n\n            dst.x = saturate_cast<uchar>(dstf.x * 2.55f);\n            dst.y = saturate_cast<uchar>(dstf.y * 0.72033898305084743f + 96.525423728813564f);\n            dst.z = saturate_cast<uchar>(dstf.z * 0.9732824427480916f + 136.259541984732824f);\n        }\n\n        template <typename T, int scn, int dcn, bool srgb, int blueIdx> struct RGB2Luv;\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct RGB2Luv<uchar, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<uchar, scn>::vec_type, typename TypeVec<uchar, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<uchar, dcn>::vec_type operator ()(const typename TypeVec<uchar, scn>::vec_type& src) const\n            {\n                typename TypeVec<uchar, dcn>::vec_type dst;\n\n                RGB2LuvConvert_b<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB2Luv() {}\n            __host__ __device__ __forceinline__ RGB2Luv(const RGB2Luv&) {}\n        };\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct RGB2Luv<float, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                RGB2LuvConvert_f<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ RGB2Luv() {}\n            __host__ __device__ __forceinline__ RGB2Luv(const RGB2Luv&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_RGB2Luv_TRAITS(name, scn, dcn, srgb, blueIdx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::RGB2Luv<T, scn, dcn, srgb, blueIdx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    namespace color_detail\n    {\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void Luv2RGBConvert_f(const T& src, D& dst)\n        {\n            const float _d = 1.f / (0.950456f + 15 + 1.088754f * 3);\n            const float _un = 4 * 0.950456f * _d;\n            const float _vn = 9 * _d;\n\n            float L = src.x;\n            float u = src.y;\n            float v = src.z;\n\n            float Y = (L + 16.f) * (1.f / 116.f);\n            Y = Y * Y * Y;\n\n            float d = (1.f / 13.f) / L;\n            u = u * d + _un;\n            v = v * d + _vn;\n\n            float iv = 1.f / v;\n            float X = 2.25f * u * Y * iv;\n            float Z = (12 - 3 * u - 20 * v) * Y * 0.25f * iv;\n\n            float B = 0.055648f * X - 0.204043f * Y + 1.057311f * Z;\n            float G = -0.969256f * X + 1.875991f * Y + 0.041556f * Z;\n            float R = 3.240479f * X - 1.537150f * Y - 0.498535f * Z;\n\n            if (srgb)\n            {\n                B = splineInterpolate(B * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n                G = splineInterpolate(G * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n                R = splineInterpolate(R * GAMMA_TAB_SIZE, c_sRGBInvGammaTab, GAMMA_TAB_SIZE);\n            }\n\n            dst.x = blueIdx == 0 ? B : R;\n            dst.y = G;\n            dst.z = blueIdx == 0 ? R : B;\n            setAlpha(dst, ColorChannel<float>::max());\n        }\n\n        template <bool srgb, int blueIdx, typename T, typename D>\n        __device__ __forceinline__ void Luv2RGBConvert_b(const T& src, D& dst)\n        {\n            float3 srcf, dstf;\n\n            srcf.x = src.x * (100.f / 255.f);\n            srcf.y = src.y * 1.388235294117647f - 134.f;\n            srcf.z = src.z * 1.027450980392157f - 140.f;\n\n            Luv2RGBConvert_f<srgb, blueIdx>(srcf, dstf);\n\n            dst.x = saturate_cast<uchar>(dstf.x * 255.f);\n            dst.y = saturate_cast<uchar>(dstf.y * 255.f);\n            dst.z = saturate_cast<uchar>(dstf.z * 255.f);\n            setAlpha(dst, ColorChannel<uchar>::max());\n        }\n\n        template <typename T, int scn, int dcn, bool srgb, int blueIdx> struct Luv2RGB;\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct Luv2RGB<uchar, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<uchar, scn>::vec_type, typename TypeVec<uchar, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<uchar, dcn>::vec_type operator ()(const typename TypeVec<uchar, scn>::vec_type& src) const\n            {\n                typename TypeVec<uchar, dcn>::vec_type dst;\n\n                Luv2RGBConvert_b<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ Luv2RGB() {}\n            __host__ __device__ __forceinline__ Luv2RGB(const Luv2RGB&) {}\n        };\n        template <int scn, int dcn, bool srgb, int blueIdx>\n        struct Luv2RGB<float, scn, dcn, srgb, blueIdx>\n            : unary_function<typename TypeVec<float, scn>::vec_type, typename TypeVec<float, dcn>::vec_type>\n        {\n            __device__ __forceinline__ typename TypeVec<float, dcn>::vec_type operator ()(const typename TypeVec<float, scn>::vec_type& src) const\n            {\n                typename TypeVec<float, dcn>::vec_type dst;\n\n                Luv2RGBConvert_f<srgb, blueIdx>(src, dst);\n\n                return dst;\n            }\n            __host__ __device__ __forceinline__ Luv2RGB() {}\n            __host__ __device__ __forceinline__ Luv2RGB(const Luv2RGB&) {}\n        };\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_Luv2RGB_TRAITS(name, scn, dcn, srgb, blueIdx) \\\n    template <typename T> struct name ## _traits \\\n    { \\\n        typedef ::cv::cuda::device::color_detail::Luv2RGB<T, scn, dcn, srgb, blueIdx> functor_type; \\\n        static __host__ __device__ __forceinline__ functor_type create_functor() \\\n        { \\\n            return functor_type(); \\\n        } \\\n    };\n\n    #undef CV_DESCALE\n\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_COLOR_DETAIL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/detail/reduce.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_REDUCE_DETAIL_HPP\n#define OPENCV_CUDA_REDUCE_DETAIL_HPP\n\n#include <thrust/tuple.h>\n#include \"../warp.hpp\"\n#include \"../warp_shuffle.hpp\"\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    namespace reduce_detail\n    {\n        template <typename T> struct GetType;\n        template <typename T> struct GetType<T*>\n        {\n            typedef T type;\n        };\n        template <typename T> struct GetType<volatile T*>\n        {\n            typedef T type;\n        };\n        template <typename T> struct GetType<T&>\n        {\n            typedef T type;\n        };\n\n        template <unsigned int I, unsigned int N>\n        struct For\n        {\n            template <class PointerTuple, class ValTuple>\n            static __device__ void loadToSmem(const PointerTuple& smem, const ValTuple& val, unsigned int tid)\n            {\n                thrust::get<I>(smem)[tid] = thrust::get<I>(val);\n\n                For<I + 1, N>::loadToSmem(smem, val, tid);\n            }\n            template <class PointerTuple, class ValTuple>\n            static __device__ void loadFromSmem(const PointerTuple& smem, const ValTuple& val, unsigned int tid)\n            {\n                thrust::get<I>(val) = thrust::get<I>(smem)[tid];\n\n                For<I + 1, N>::loadFromSmem(smem, val, tid);\n            }\n\n            template <class PointerTuple, class ValTuple, class OpTuple>\n            static __device__ void merge(const PointerTuple& smem, const ValTuple& val, unsigned int tid, unsigned int delta, const OpTuple& op)\n            {\n                typename GetType<typename thrust::tuple_element<I, PointerTuple>::type>::type reg = thrust::get<I>(smem)[tid + delta];\n                thrust::get<I>(smem)[tid] = thrust::get<I>(val) = thrust::get<I>(op)(thrust::get<I>(val), reg);\n\n                For<I + 1, N>::merge(smem, val, tid, delta, op);\n            }\n            template <class ValTuple, class OpTuple>\n            static __device__ void mergeShfl(const ValTuple& val, unsigned int delta, unsigned int width, const OpTuple& op)\n            {\n                typename GetType<typename thrust::tuple_element<I, ValTuple>::type>::type reg = shfl_down(thrust::get<I>(val), delta, width);\n                thrust::get<I>(val) = thrust::get<I>(op)(thrust::get<I>(val), reg);\n\n                For<I + 1, N>::mergeShfl(val, delta, width, op);\n            }\n        };\n        template <unsigned int N>\n        struct For<N, N>\n        {\n            template <class PointerTuple, class ValTuple>\n            static __device__ void loadToSmem(const PointerTuple&, const ValTuple&, unsigned int)\n            {\n            }\n            template <class PointerTuple, class ValTuple>\n            static __device__ void loadFromSmem(const PointerTuple&, const ValTuple&, unsigned int)\n            {\n            }\n\n            template <class PointerTuple, class ValTuple, class OpTuple>\n            static __device__ void merge(const PointerTuple&, const ValTuple&, unsigned int, unsigned int, const OpTuple&)\n            {\n            }\n            template <class ValTuple, class OpTuple>\n            static __device__ void mergeShfl(const ValTuple&, unsigned int, unsigned int, const OpTuple&)\n            {\n            }\n        };\n\n        template <typename T>\n        __device__ __forceinline__ void loadToSmem(volatile T* smem, T& val, unsigned int tid)\n        {\n            smem[tid] = val;\n        }\n        template <typename T>\n        __device__ __forceinline__ void loadFromSmem(volatile T* smem, T& val, unsigned int tid)\n        {\n            val = smem[tid];\n        }\n        template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9,\n                  typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9>\n        __device__ __forceinline__ void loadToSmem(const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>& smem,\n                                                       const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                                       unsigned int tid)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9> >::value>::loadToSmem(smem, val, tid);\n        }\n        template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9,\n                  typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9>\n        __device__ __forceinline__ void loadFromSmem(const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>& smem,\n                                                         const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                                         unsigned int tid)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9> >::value>::loadFromSmem(smem, val, tid);\n        }\n\n        template <typename T, class Op>\n        __device__ __forceinline__ void merge(volatile T* smem, T& val, unsigned int tid, unsigned int delta, const Op& op)\n        {\n            T reg = smem[tid + delta];\n            smem[tid] = val = op(val, reg);\n        }\n        template <typename T, class Op>\n        __device__ __forceinline__ void mergeShfl(T& val, unsigned int delta, unsigned int width, const Op& op)\n        {\n            T reg = shfl_down(val, delta, width);\n            val = op(val, reg);\n        }\n        template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9,\n                  typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9,\n                  class Op0, class Op1, class Op2, class Op3, class Op4, class Op5, class Op6, class Op7, class Op8, class Op9>\n        __device__ __forceinline__ void merge(const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>& smem,\n                                              const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                              unsigned int tid,\n                                              unsigned int delta,\n                                              const thrust::tuple<Op0, Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, Op9>& op)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9> >::value>::merge(smem, val, tid, delta, op);\n        }\n        template <typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9,\n                  class Op0, class Op1, class Op2, class Op3, class Op4, class Op5, class Op6, class Op7, class Op8, class Op9>\n        __device__ __forceinline__ void mergeShfl(const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                                  unsigned int delta,\n                                                  unsigned int width,\n                                                  const thrust::tuple<Op0, Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, Op9>& op)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9> >::value>::mergeShfl(val, delta, width, op);\n        }\n\n        template <unsigned int N> struct Generic\n        {\n            template <typename Pointer, typename Reference, class Op>\n            static __device__ void reduce(Pointer smem, Reference val, unsigned int tid, Op op)\n            {\n                loadToSmem(smem, val, tid);\n                if (N >= 32)\n                    __syncthreads();\n\n                if (N >= 2048)\n                {\n                    if (tid < 1024)\n                        merge(smem, val, tid, 1024, op);\n\n                    __syncthreads();\n                }\n                if (N >= 1024)\n                {\n                    if (tid < 512)\n                        merge(smem, val, tid, 512, op);\n\n                    __syncthreads();\n                }\n                if (N >= 512)\n                {\n                    if (tid < 256)\n                        merge(smem, val, tid, 256, op);\n\n                    __syncthreads();\n                }\n                if (N >= 256)\n                {\n                    if (tid < 128)\n                        merge(smem, val, tid, 128, op);\n\n                    __syncthreads();\n                }\n                if (N >= 128)\n                {\n                    if (tid < 64)\n                        merge(smem, val, tid, 64, op);\n\n                    __syncthreads();\n                }\n                if (N >= 64)\n                {\n                    if (tid < 32)\n                        merge(smem, val, tid, 32, op);\n                }\n\n                if (tid < 16)\n                {\n                    merge(smem, val, tid, 16, op);\n                    merge(smem, val, tid, 8, op);\n                    merge(smem, val, tid, 4, op);\n                    merge(smem, val, tid, 2, op);\n                    merge(smem, val, tid, 1, op);\n                }\n            }\n        };\n\n        template <unsigned int I, typename Pointer, typename Reference, class Op>\n        struct Unroll\n        {\n            static __device__ void loopShfl(Reference val, Op op, unsigned int N)\n            {\n                mergeShfl(val, I, N, op);\n                Unroll<I / 2, Pointer, Reference, Op>::loopShfl(val, op, N);\n            }\n            static __device__ void loop(Pointer smem, Reference val, unsigned int tid, Op op)\n            {\n                merge(smem, val, tid, I, op);\n                Unroll<I / 2, Pointer, Reference, Op>::loop(smem, val, tid, op);\n            }\n        };\n        template <typename Pointer, typename Reference, class Op>\n        struct Unroll<0, Pointer, Reference, Op>\n        {\n            static __device__ void loopShfl(Reference, Op, unsigned int)\n            {\n            }\n            static __device__ void loop(Pointer, Reference, unsigned int, Op)\n            {\n            }\n        };\n\n        template <unsigned int N> struct WarpOptimized\n        {\n            template <typename Pointer, typename Reference, class Op>\n            static __device__ void reduce(Pointer smem, Reference val, unsigned int tid, Op op)\n            {\n            #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n                CV_UNUSED(smem);\n                CV_UNUSED(tid);\n\n                Unroll<N / 2, Pointer, Reference, Op>::loopShfl(val, op, N);\n            #else\n                loadToSmem(smem, val, tid);\n\n                if (tid < N / 2)\n                    Unroll<N / 2, Pointer, Reference, Op>::loop(smem, val, tid, op);\n            #endif\n            }\n        };\n\n        template <unsigned int N> struct GenericOptimized32\n        {\n            enum { M = N / 32 };\n\n            template <typename Pointer, typename Reference, class Op>\n            static __device__ void reduce(Pointer smem, Reference val, unsigned int tid, Op op)\n            {\n                const unsigned int laneId = Warp::laneId();\n\n            #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n                Unroll<16, Pointer, Reference, Op>::loopShfl(val, op, warpSize);\n\n                if (laneId == 0)\n                    loadToSmem(smem, val, tid / 32);\n            #else\n                loadToSmem(smem, val, tid);\n\n                if (laneId < 16)\n                    Unroll<16, Pointer, Reference, Op>::loop(smem, val, tid, op);\n\n                __syncthreads();\n\n                if (laneId == 0)\n                    loadToSmem(smem, val, tid / 32);\n            #endif\n\n                __syncthreads();\n\n                loadFromSmem(smem, val, tid);\n\n                if (tid < 32)\n                {\n                #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n                    Unroll<M / 2, Pointer, Reference, Op>::loopShfl(val, op, M);\n                #else\n                    Unroll<M / 2, Pointer, Reference, Op>::loop(smem, val, tid, op);\n                #endif\n                }\n            }\n        };\n\n        template <bool val, class T1, class T2> struct StaticIf;\n        template <class T1, class T2> struct StaticIf<true, T1, T2>\n        {\n            typedef T1 type;\n        };\n        template <class T1, class T2> struct StaticIf<false, T1, T2>\n        {\n            typedef T2 type;\n        };\n\n        template <unsigned int N> struct IsPowerOf2\n        {\n            enum { value = ((N != 0) && !(N & (N - 1))) };\n        };\n\n        template <unsigned int N> struct Dispatcher\n        {\n            typedef typename StaticIf<\n                (N <= 32) && IsPowerOf2<N>::value,\n                WarpOptimized<N>,\n                typename StaticIf<\n                    (N <= 1024) && IsPowerOf2<N>::value,\n                    GenericOptimized32<N>,\n                    Generic<N>\n                >::type\n            >::type reductor;\n        };\n    }\n}}}\n\n//! @endcond\n\n#endif // OPENCV_CUDA_REDUCE_DETAIL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/detail/reduce_key_val.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_PRED_VAL_REDUCE_DETAIL_HPP\n#define OPENCV_CUDA_PRED_VAL_REDUCE_DETAIL_HPP\n\n#include <thrust/tuple.h>\n#include \"../warp.hpp\"\n#include \"../warp_shuffle.hpp\"\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    namespace reduce_key_val_detail\n    {\n        template <typename T> struct GetType;\n        template <typename T> struct GetType<T*>\n        {\n            typedef T type;\n        };\n        template <typename T> struct GetType<volatile T*>\n        {\n            typedef T type;\n        };\n        template <typename T> struct GetType<T&>\n        {\n            typedef T type;\n        };\n\n        template <unsigned int I, unsigned int N>\n        struct For\n        {\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void loadToSmem(const PointerTuple& smem, const ReferenceTuple& data, unsigned int tid)\n            {\n                thrust::get<I>(smem)[tid] = thrust::get<I>(data);\n\n                For<I + 1, N>::loadToSmem(smem, data, tid);\n            }\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void loadFromSmem(const PointerTuple& smem, const ReferenceTuple& data, unsigned int tid)\n            {\n                thrust::get<I>(data) = thrust::get<I>(smem)[tid];\n\n                For<I + 1, N>::loadFromSmem(smem, data, tid);\n            }\n\n            template <class ReferenceTuple>\n            static __device__ void copyShfl(const ReferenceTuple& val, unsigned int delta, int width)\n            {\n                thrust::get<I>(val) = shfl_down(thrust::get<I>(val), delta, width);\n\n                For<I + 1, N>::copyShfl(val, delta, width);\n            }\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void copy(const PointerTuple& svals, const ReferenceTuple& val, unsigned int tid, unsigned int delta)\n            {\n                thrust::get<I>(svals)[tid] = thrust::get<I>(val) = thrust::get<I>(svals)[tid + delta];\n\n                For<I + 1, N>::copy(svals, val, tid, delta);\n            }\n\n            template <class KeyReferenceTuple, class ValReferenceTuple, class CmpTuple>\n            static __device__ void mergeShfl(const KeyReferenceTuple& key, const ValReferenceTuple& val, const CmpTuple& cmp, unsigned int delta, int width)\n            {\n                typename GetType<typename thrust::tuple_element<I, KeyReferenceTuple>::type>::type reg = shfl_down(thrust::get<I>(key), delta, width);\n\n                if (thrust::get<I>(cmp)(reg, thrust::get<I>(key)))\n                {\n                    thrust::get<I>(key) = reg;\n                    thrust::get<I>(val) = shfl_down(thrust::get<I>(val), delta, width);\n                }\n\n                For<I + 1, N>::mergeShfl(key, val, cmp, delta, width);\n            }\n            template <class KeyPointerTuple, class KeyReferenceTuple, class ValPointerTuple, class ValReferenceTuple, class CmpTuple>\n            static __device__ void merge(const KeyPointerTuple& skeys, const KeyReferenceTuple& key,\n                                         const ValPointerTuple& svals, const ValReferenceTuple& val,\n                                         const CmpTuple& cmp,\n                                         unsigned int tid, unsigned int delta)\n            {\n                typename GetType<typename thrust::tuple_element<I, KeyPointerTuple>::type>::type reg = thrust::get<I>(skeys)[tid + delta];\n\n                if (thrust::get<I>(cmp)(reg, thrust::get<I>(key)))\n                {\n                    thrust::get<I>(skeys)[tid] = thrust::get<I>(key) = reg;\n                    thrust::get<I>(svals)[tid] = thrust::get<I>(val) = thrust::get<I>(svals)[tid + delta];\n                }\n\n                For<I + 1, N>::merge(skeys, key, svals, val, cmp, tid, delta);\n            }\n        };\n        template <unsigned int N>\n        struct For<N, N>\n        {\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void loadToSmem(const PointerTuple&, const ReferenceTuple&, unsigned int)\n            {\n            }\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void loadFromSmem(const PointerTuple&, const ReferenceTuple&, unsigned int)\n            {\n            }\n\n            template <class ReferenceTuple>\n            static __device__ void copyShfl(const ReferenceTuple&, unsigned int, int)\n            {\n            }\n            template <class PointerTuple, class ReferenceTuple>\n            static __device__ void copy(const PointerTuple&, const ReferenceTuple&, unsigned int, unsigned int)\n            {\n            }\n\n            template <class KeyReferenceTuple, class ValReferenceTuple, class CmpTuple>\n            static __device__ void mergeShfl(const KeyReferenceTuple&, const ValReferenceTuple&, const CmpTuple&, unsigned int, int)\n            {\n            }\n            template <class KeyPointerTuple, class KeyReferenceTuple, class ValPointerTuple, class ValReferenceTuple, class CmpTuple>\n            static __device__ void merge(const KeyPointerTuple&, const KeyReferenceTuple&,\n                                         const ValPointerTuple&, const ValReferenceTuple&,\n                                         const CmpTuple&,\n                                         unsigned int, unsigned int)\n            {\n            }\n        };\n\n        //////////////////////////////////////////////////////\n        // loadToSmem\n\n        template <typename T>\n        __device__ __forceinline__ void loadToSmem(volatile T* smem, T& data, unsigned int tid)\n        {\n            smem[tid] = data;\n        }\n        template <typename T>\n        __device__ __forceinline__ void loadFromSmem(volatile T* smem, T& data, unsigned int tid)\n        {\n            data = smem[tid];\n        }\n        template <typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9>\n        __device__ __forceinline__ void loadToSmem(const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& smem,\n                                                   const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& data,\n                                                   unsigned int tid)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9> >::value>::loadToSmem(smem, data, tid);\n        }\n        template <typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9>\n        __device__ __forceinline__ void loadFromSmem(const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& smem,\n                                                     const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& data,\n                                                     unsigned int tid)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9> >::value>::loadFromSmem(smem, data, tid);\n        }\n\n        //////////////////////////////////////////////////////\n        // copyVals\n\n        template <typename V>\n        __device__ __forceinline__ void copyValsShfl(V& val, unsigned int delta, int width)\n        {\n            val = shfl_down(val, delta, width);\n        }\n        template <typename V>\n        __device__ __forceinline__ void copyVals(volatile V* svals, V& val, unsigned int tid, unsigned int delta)\n        {\n            svals[tid] = val = svals[tid + delta];\n        }\n        template <typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9>\n        __device__ __forceinline__ void copyValsShfl(const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                     unsigned int delta,\n                                                     int width)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9> >::value>::copyShfl(val, delta, width);\n        }\n        template <typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9>\n        __device__ __forceinline__ void copyVals(const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                                 const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                 unsigned int tid, unsigned int delta)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9> >::value>::copy(svals, val, tid, delta);\n        }\n\n        //////////////////////////////////////////////////////\n        // merge\n\n        template <typename K, typename V, class Cmp>\n        __device__ __forceinline__ void mergeShfl(K& key, V& val, const Cmp& cmp, unsigned int delta, int width)\n        {\n            K reg = shfl_down(key, delta, width);\n\n            if (cmp(reg, key))\n            {\n                key = reg;\n                copyValsShfl(val, delta, width);\n            }\n        }\n        template <typename K, typename V, class Cmp>\n        __device__ __forceinline__ void merge(volatile K* skeys, K& key, volatile V* svals, V& val, const Cmp& cmp, unsigned int tid, unsigned int delta)\n        {\n            K reg = skeys[tid + delta];\n\n            if (cmp(reg, key))\n            {\n                skeys[tid] = key = reg;\n                copyVals(svals, val, tid, delta);\n            }\n        }\n        template <typename K,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n                  class Cmp>\n        __device__ __forceinline__ void mergeShfl(K& key,\n                                                  const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                  const Cmp& cmp,\n                                                  unsigned int delta, int width)\n        {\n            K reg = shfl_down(key, delta, width);\n\n            if (cmp(reg, key))\n            {\n                key = reg;\n                copyValsShfl(val, delta, width);\n            }\n        }\n        template <typename K,\n                  typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n                  class Cmp>\n        __device__ __forceinline__ void merge(volatile K* skeys, K& key,\n                                              const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                              const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                              const Cmp& cmp, unsigned int tid, unsigned int delta)\n        {\n            K reg = skeys[tid + delta];\n\n            if (cmp(reg, key))\n            {\n                skeys[tid] = key = reg;\n                copyVals(svals, val, tid, delta);\n            }\n        }\n        template <typename KR0, typename KR1, typename KR2, typename KR3, typename KR4, typename KR5, typename KR6, typename KR7, typename KR8, typename KR9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n                  class Cmp0, class Cmp1, class Cmp2, class Cmp3, class Cmp4, class Cmp5, class Cmp6, class Cmp7, class Cmp8, class Cmp9>\n        __device__ __forceinline__ void mergeShfl(const thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9>& key,\n                                                  const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                  const thrust::tuple<Cmp0, Cmp1, Cmp2, Cmp3, Cmp4, Cmp5, Cmp6, Cmp7, Cmp8, Cmp9>& cmp,\n                                                  unsigned int delta, int width)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9> >::value>::mergeShfl(key, val, cmp, delta, width);\n        }\n        template <typename KP0, typename KP1, typename KP2, typename KP3, typename KP4, typename KP5, typename KP6, typename KP7, typename KP8, typename KP9,\n                  typename KR0, typename KR1, typename KR2, typename KR3, typename KR4, typename KR5, typename KR6, typename KR7, typename KR8, typename KR9,\n                  typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n                  typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n                  class Cmp0, class Cmp1, class Cmp2, class Cmp3, class Cmp4, class Cmp5, class Cmp6, class Cmp7, class Cmp8, class Cmp9>\n        __device__ __forceinline__ void merge(const thrust::tuple<KP0, KP1, KP2, KP3, KP4, KP5, KP6, KP7, KP8, KP9>& skeys,\n                                              const thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9>& key,\n                                              const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                              const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                              const thrust::tuple<Cmp0, Cmp1, Cmp2, Cmp3, Cmp4, Cmp5, Cmp6, Cmp7, Cmp8, Cmp9>& cmp,\n                                              unsigned int tid, unsigned int delta)\n        {\n            For<0, thrust::tuple_size<thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9> >::value>::merge(skeys, key, svals, val, cmp, tid, delta);\n        }\n\n        //////////////////////////////////////////////////////\n        // Generic\n\n        template <unsigned int N> struct Generic\n        {\n            template <class KP, class KR, class VP, class VR, class Cmp>\n            static __device__ void reduce(KP skeys, KR key, VP svals, VR val, unsigned int tid, Cmp cmp)\n            {\n                loadToSmem(skeys, key, tid);\n                loadValsToSmem(svals, val, tid);\n                if (N >= 32)\n                    __syncthreads();\n\n                if (N >= 2048)\n                {\n                    if (tid < 1024)\n                        merge(skeys, key, svals, val, cmp, tid, 1024);\n\n                    __syncthreads();\n                }\n                if (N >= 1024)\n                {\n                    if (tid < 512)\n                        merge(skeys, key, svals, val, cmp, tid, 512);\n\n                    __syncthreads();\n                }\n                if (N >= 512)\n                {\n                    if (tid < 256)\n                        merge(skeys, key, svals, val, cmp, tid, 256);\n\n                    __syncthreads();\n                }\n                if (N >= 256)\n                {\n                    if (tid < 128)\n                        merge(skeys, key, svals, val, cmp, tid, 128);\n\n                    __syncthreads();\n                }\n                if (N >= 128)\n                {\n                    if (tid < 64)\n                        merge(skeys, key, svals, val, cmp, tid, 64);\n\n                    __syncthreads();\n                }\n                if (N >= 64)\n                {\n                    if (tid < 32)\n                        merge(skeys, key, svals, val, cmp, tid, 32);\n                }\n\n                if (tid < 16)\n                {\n                    merge(skeys, key, svals, val, cmp, tid, 16);\n                    merge(skeys, key, svals, val, cmp, tid, 8);\n                    merge(skeys, key, svals, val, cmp, tid, 4);\n                    merge(skeys, key, svals, val, cmp, tid, 2);\n                    merge(skeys, key, svals, val, cmp, tid, 1);\n                }\n            }\n        };\n\n        template <unsigned int I, class KP, class KR, class VP, class VR, class Cmp>\n        struct Unroll\n        {\n            static __device__ void loopShfl(KR key, VR val, Cmp cmp, unsigned int N)\n            {\n                mergeShfl(key, val, cmp, I, N);\n                Unroll<I / 2, KP, KR, VP, VR, Cmp>::loopShfl(key, val, cmp, N);\n            }\n            static __device__ void loop(KP skeys, KR key, VP svals, VR val, unsigned int tid, Cmp cmp)\n            {\n                merge(skeys, key, svals, val, cmp, tid, I);\n                Unroll<I / 2, KP, KR, VP, VR, Cmp>::loop(skeys, key, svals, val, tid, cmp);\n            }\n        };\n        template <class KP, class KR, class VP, class VR, class Cmp>\n        struct Unroll<0, KP, KR, VP, VR, Cmp>\n        {\n            static __device__ void loopShfl(KR, VR, Cmp, unsigned int)\n            {\n            }\n            static __device__ void loop(KP, KR, VP, VR, unsigned int, Cmp)\n            {\n            }\n        };\n\n        template <unsigned int N> struct WarpOptimized\n        {\n            template <class KP, class KR, class VP, class VR, class Cmp>\n            static __device__ void reduce(KP skeys, KR key, VP svals, VR val, unsigned int tid, Cmp cmp)\n            {\n            #if 0 // __CUDA_ARCH__ >= 300\n                CV_UNUSED(skeys);\n                CV_UNUSED(svals);\n                CV_UNUSED(tid);\n\n                Unroll<N / 2, KP, KR, VP, VR, Cmp>::loopShfl(key, val, cmp, N);\n            #else\n                loadToSmem(skeys, key, tid);\n                loadToSmem(svals, val, tid);\n\n                if (tid < N / 2)\n                    Unroll<N / 2, KP, KR, VP, VR, Cmp>::loop(skeys, key, svals, val, tid, cmp);\n            #endif\n            }\n        };\n\n        template <unsigned int N> struct GenericOptimized32\n        {\n            enum { M = N / 32 };\n\n            template <class KP, class KR, class VP, class VR, class Cmp>\n            static __device__ void reduce(KP skeys, KR key, VP svals, VR val, unsigned int tid, Cmp cmp)\n            {\n                const unsigned int laneId = Warp::laneId();\n\n            #if 0 // __CUDA_ARCH__ >= 300\n                Unroll<16, KP, KR, VP, VR, Cmp>::loopShfl(key, val, cmp, warpSize);\n\n                if (laneId == 0)\n                {\n                    loadToSmem(skeys, key, tid / 32);\n                    loadToSmem(svals, val, tid / 32);\n                }\n            #else\n                loadToSmem(skeys, key, tid);\n                loadToSmem(svals, val, tid);\n\n                if (laneId < 16)\n                    Unroll<16, KP, KR, VP, VR, Cmp>::loop(skeys, key, svals, val, tid, cmp);\n\n                __syncthreads();\n\n                if (laneId == 0)\n                {\n                    loadToSmem(skeys, key, tid / 32);\n                    loadToSmem(svals, val, tid / 32);\n                }\n            #endif\n\n                __syncthreads();\n\n                loadFromSmem(skeys, key, tid);\n\n                if (tid < 32)\n                {\n                #if 0 // __CUDA_ARCH__ >= 300\n                    loadFromSmem(svals, val, tid);\n\n                    Unroll<M / 2, KP, KR, VP, VR, Cmp>::loopShfl(key, val, cmp, M);\n                #else\n                    Unroll<M / 2, KP, KR, VP, VR, Cmp>::loop(skeys, key, svals, val, tid, cmp);\n                #endif\n                }\n            }\n        };\n\n        template <bool val, class T1, class T2> struct StaticIf;\n        template <class T1, class T2> struct StaticIf<true, T1, T2>\n        {\n            typedef T1 type;\n        };\n        template <class T1, class T2> struct StaticIf<false, T1, T2>\n        {\n            typedef T2 type;\n        };\n\n        template <unsigned int N> struct IsPowerOf2\n        {\n            enum { value = ((N != 0) && !(N & (N - 1))) };\n        };\n\n        template <unsigned int N> struct Dispatcher\n        {\n            typedef typename StaticIf<\n                (N <= 32) && IsPowerOf2<N>::value,\n                WarpOptimized<N>,\n                typename StaticIf<\n                    (N <= 1024) && IsPowerOf2<N>::value,\n                    GenericOptimized32<N>,\n                    Generic<N>\n                >::type\n            >::type reductor;\n        };\n    }\n}}}\n\n//! @endcond\n\n#endif // OPENCV_CUDA_PRED_VAL_REDUCE_DETAIL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/detail/transform_detail.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_TRANSFORM_DETAIL_HPP\n#define OPENCV_CUDA_TRANSFORM_DETAIL_HPP\n\n#include \"../common.hpp\"\n#include \"../vec_traits.hpp\"\n#include \"../functional.hpp\"\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    namespace transform_detail\n    {\n        //! Read Write Traits\n\n        template <typename T, typename D, int shift> struct UnaryReadWriteTraits\n        {\n            typedef typename TypeVec<T, shift>::vec_type read_type;\n            typedef typename TypeVec<D, shift>::vec_type write_type;\n        };\n\n        template <typename T1, typename T2, typename D, int shift> struct BinaryReadWriteTraits\n        {\n            typedef typename TypeVec<T1, shift>::vec_type read_type1;\n            typedef typename TypeVec<T2, shift>::vec_type read_type2;\n            typedef typename TypeVec<D, shift>::vec_type write_type;\n        };\n\n        //! Transform kernels\n\n        template <int shift> struct OpUnroller;\n        template <> struct OpUnroller<1>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src.x);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src1.x, src2.x);\n            }\n        };\n        template <> struct OpUnroller<2>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src.y);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src1.x, src2.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src1.y, src2.y);\n            }\n        };\n        template <> struct OpUnroller<3>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, const UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src.y);\n                if (mask(y, x_shifted + 2))\n                    dst.z = op(src.z);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, const BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src1.x, src2.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src1.y, src2.y);\n                if (mask(y, x_shifted + 2))\n                    dst.z = op(src1.z, src2.z);\n            }\n        };\n        template <> struct OpUnroller<4>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, const UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src.y);\n                if (mask(y, x_shifted + 2))\n                    dst.z = op(src.z);\n                if (mask(y, x_shifted + 3))\n                    dst.w = op(src.w);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, const BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.x = op(src1.x, src2.x);\n                if (mask(y, x_shifted + 1))\n                    dst.y = op(src1.y, src2.y);\n                if (mask(y, x_shifted + 2))\n                    dst.z = op(src1.z, src2.z);\n                if (mask(y, x_shifted + 3))\n                    dst.w = op(src1.w, src2.w);\n            }\n        };\n        template <> struct OpUnroller<8>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T& src, D& dst, const Mask& mask, const UnOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.a0 = op(src.a0);\n                if (mask(y, x_shifted + 1))\n                    dst.a1 = op(src.a1);\n                if (mask(y, x_shifted + 2))\n                    dst.a2 = op(src.a2);\n                if (mask(y, x_shifted + 3))\n                    dst.a3 = op(src.a3);\n                if (mask(y, x_shifted + 4))\n                    dst.a4 = op(src.a4);\n                if (mask(y, x_shifted + 5))\n                    dst.a5 = op(src.a5);\n                if (mask(y, x_shifted + 6))\n                    dst.a6 = op(src.a6);\n                if (mask(y, x_shifted + 7))\n                    dst.a7 = op(src.a7);\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static __device__ __forceinline__ void unroll(const T1& src1, const T2& src2, D& dst, const Mask& mask, const BinOp& op, int x_shifted, int y)\n            {\n                if (mask(y, x_shifted))\n                    dst.a0 = op(src1.a0, src2.a0);\n                if (mask(y, x_shifted + 1))\n                    dst.a1 = op(src1.a1, src2.a1);\n                if (mask(y, x_shifted + 2))\n                    dst.a2 = op(src1.a2, src2.a2);\n                if (mask(y, x_shifted + 3))\n                    dst.a3 = op(src1.a3, src2.a3);\n                if (mask(y, x_shifted + 4))\n                    dst.a4 = op(src1.a4, src2.a4);\n                if (mask(y, x_shifted + 5))\n                    dst.a5 = op(src1.a5, src2.a5);\n                if (mask(y, x_shifted + 6))\n                    dst.a6 = op(src1.a6, src2.a6);\n                if (mask(y, x_shifted + 7))\n                    dst.a7 = op(src1.a7, src2.a7);\n            }\n        };\n\n        template <typename T, typename D, typename UnOp, typename Mask>\n        static __global__ void transformSmart(const PtrStepSz<T> src_, PtrStep<D> dst_, const Mask mask, const UnOp op)\n        {\n            typedef TransformFunctorTraits<UnOp> ft;\n            typedef typename UnaryReadWriteTraits<T, D, ft::smart_shift>::read_type read_type;\n            typedef typename UnaryReadWriteTraits<T, D, ft::smart_shift>::write_type write_type;\n\n            const int x = threadIdx.x + blockIdx.x * blockDim.x;\n            const int y = threadIdx.y + blockIdx.y * blockDim.y;\n            const int x_shifted = x * ft::smart_shift;\n\n            if (y < src_.rows)\n            {\n                const T* src = src_.ptr(y);\n                D* dst = dst_.ptr(y);\n\n                if (x_shifted + ft::smart_shift - 1 < src_.cols)\n                {\n                    const read_type src_n_el = ((const read_type*)src)[x];\n                    OpUnroller<ft::smart_shift>::unroll(src_n_el, ((write_type*)dst)[x], mask, op, x_shifted, y);\n                }\n                else\n                {\n                    for (int real_x = x_shifted; real_x < src_.cols; ++real_x)\n                    {\n                        if (mask(y, real_x))\n                            dst[real_x] = op(src[real_x]);\n                    }\n                }\n            }\n        }\n\n        template <typename T, typename D, typename UnOp, typename Mask>\n        __global__ static void transformSimple(const PtrStepSz<T> src, PtrStep<D> dst, const Mask mask, const UnOp op)\n        {\n            const int x = blockDim.x * blockIdx.x + threadIdx.x;\n            const int y = blockDim.y * blockIdx.y + threadIdx.y;\n\n            if (x < src.cols && y < src.rows && mask(y, x))\n            {\n                dst.ptr(y)[x] = op(src.ptr(y)[x]);\n            }\n        }\n\n        template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n        static __global__ void transformSmart(const PtrStepSz<T1> src1_, const PtrStep<T2> src2_, PtrStep<D> dst_,\n            const Mask mask, const BinOp op)\n        {\n            typedef TransformFunctorTraits<BinOp> ft;\n            typedef typename BinaryReadWriteTraits<T1, T2, D, ft::smart_shift>::read_type1 read_type1;\n            typedef typename BinaryReadWriteTraits<T1, T2, D, ft::smart_shift>::read_type2 read_type2;\n            typedef typename BinaryReadWriteTraits<T1, T2, D, ft::smart_shift>::write_type write_type;\n\n            const int x = threadIdx.x + blockIdx.x * blockDim.x;\n            const int y = threadIdx.y + blockIdx.y * blockDim.y;\n            const int x_shifted = x * ft::smart_shift;\n\n            if (y < src1_.rows)\n            {\n                const T1* src1 = src1_.ptr(y);\n                const T2* src2 = src2_.ptr(y);\n                D* dst = dst_.ptr(y);\n\n                if (x_shifted + ft::smart_shift - 1 < src1_.cols)\n                {\n                    const read_type1 src1_n_el = ((const read_type1*)src1)[x];\n                    const read_type2 src2_n_el = ((const read_type2*)src2)[x];\n\n                    OpUnroller<ft::smart_shift>::unroll(src1_n_el, src2_n_el, ((write_type*)dst)[x], mask, op, x_shifted, y);\n                }\n                else\n                {\n                    for (int real_x = x_shifted; real_x < src1_.cols; ++real_x)\n                    {\n                        if (mask(y, real_x))\n                            dst[real_x] = op(src1[real_x], src2[real_x]);\n                    }\n                }\n            }\n        }\n\n        template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n        static __global__ void transformSimple(const PtrStepSz<T1> src1, const PtrStep<T2> src2, PtrStep<D> dst,\n            const Mask mask, const BinOp op)\n        {\n            const int x = blockDim.x * blockIdx.x + threadIdx.x;\n            const int y = blockDim.y * blockIdx.y + threadIdx.y;\n\n            if (x < src1.cols && y < src1.rows && mask(y, x))\n            {\n                const T1 src1_data = src1.ptr(y)[x];\n                const T2 src2_data = src2.ptr(y)[x];\n                dst.ptr(y)[x] = op(src1_data, src2_data);\n            }\n        }\n\n        template <bool UseSmart> struct TransformDispatcher;\n        template<> struct TransformDispatcher<false>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static void call(PtrStepSz<T> src, PtrStepSz<D> dst, UnOp op, Mask mask, cudaStream_t stream)\n            {\n                typedef TransformFunctorTraits<UnOp> ft;\n\n                const dim3 threads(ft::simple_block_dim_x, ft::simple_block_dim_y, 1);\n                const dim3 grid(divUp(src.cols, threads.x), divUp(src.rows, threads.y), 1);\n\n                transformSimple<T, D><<<grid, threads, 0, stream>>>(src, dst, mask, op);\n                cudaSafeCall( cudaGetLastError() );\n\n                if (stream == 0)\n                    cudaSafeCall( cudaDeviceSynchronize() );\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static void call(PtrStepSz<T1> src1, PtrStepSz<T2> src2, PtrStepSz<D> dst, BinOp op, Mask mask, cudaStream_t stream)\n            {\n                typedef TransformFunctorTraits<BinOp> ft;\n\n                const dim3 threads(ft::simple_block_dim_x, ft::simple_block_dim_y, 1);\n                const dim3 grid(divUp(src1.cols, threads.x), divUp(src1.rows, threads.y), 1);\n\n                transformSimple<T1, T2, D><<<grid, threads, 0, stream>>>(src1, src2, dst, mask, op);\n                cudaSafeCall( cudaGetLastError() );\n\n                if (stream == 0)\n                    cudaSafeCall( cudaDeviceSynchronize() );\n            }\n        };\n        template<> struct TransformDispatcher<true>\n        {\n            template <typename T, typename D, typename UnOp, typename Mask>\n            static void call(PtrStepSz<T> src, PtrStepSz<D> dst, UnOp op, Mask mask, cudaStream_t stream)\n            {\n                typedef TransformFunctorTraits<UnOp> ft;\n\n                CV_StaticAssert(ft::smart_shift != 1, \"\");\n\n                if (!isAligned(src.data, ft::smart_shift * sizeof(T)) || !isAligned(src.step, ft::smart_shift * sizeof(T)) ||\n                    !isAligned(dst.data, ft::smart_shift * sizeof(D)) || !isAligned(dst.step, ft::smart_shift * sizeof(D)))\n                {\n                    TransformDispatcher<false>::call(src, dst, op, mask, stream);\n                    return;\n                }\n\n                const dim3 threads(ft::smart_block_dim_x, ft::smart_block_dim_y, 1);\n                const dim3 grid(divUp(src.cols, threads.x * ft::smart_shift), divUp(src.rows, threads.y), 1);\n\n                transformSmart<T, D><<<grid, threads, 0, stream>>>(src, dst, mask, op);\n                cudaSafeCall( cudaGetLastError() );\n\n                if (stream == 0)\n                    cudaSafeCall( cudaDeviceSynchronize() );\n            }\n\n            template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n            static void call(PtrStepSz<T1> src1, PtrStepSz<T2> src2, PtrStepSz<D> dst, BinOp op, Mask mask, cudaStream_t stream)\n            {\n                typedef TransformFunctorTraits<BinOp> ft;\n\n                CV_StaticAssert(ft::smart_shift != 1, \"\");\n\n                if (!isAligned(src1.data, ft::smart_shift * sizeof(T1)) || !isAligned(src1.step, ft::smart_shift * sizeof(T1)) ||\n                    !isAligned(src2.data, ft::smart_shift * sizeof(T2)) || !isAligned(src2.step, ft::smart_shift * sizeof(T2)) ||\n                    !isAligned(dst.data, ft::smart_shift * sizeof(D)) || !isAligned(dst.step, ft::smart_shift * sizeof(D)))\n                {\n                    TransformDispatcher<false>::call(src1, src2, dst, op, mask, stream);\n                    return;\n                }\n\n                const dim3 threads(ft::smart_block_dim_x, ft::smart_block_dim_y, 1);\n                const dim3 grid(divUp(src1.cols, threads.x * ft::smart_shift), divUp(src1.rows, threads.y), 1);\n\n                transformSmart<T1, T2, D><<<grid, threads, 0, stream>>>(src1, src2, dst, mask, op);\n                cudaSafeCall( cudaGetLastError() );\n\n                if (stream == 0)\n                    cudaSafeCall( cudaDeviceSynchronize() );\n            }\n        };\n    } // namespace transform_detail\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_TRANSFORM_DETAIL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/detail/type_traits_detail.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_TYPE_TRAITS_DETAIL_HPP\n#define OPENCV_CUDA_TYPE_TRAITS_DETAIL_HPP\n\n#include \"../common.hpp\"\n#include \"../vec_traits.hpp\"\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    namespace type_traits_detail\n    {\n        template <bool, typename T1, typename T2> struct Select { typedef T1 type; };\n        template <typename T1, typename T2> struct Select<false, T1, T2> { typedef T2 type; };\n\n        template <typename T> struct IsSignedIntergral { enum {value = 0}; };\n        template <> struct IsSignedIntergral<schar> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<char1> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<short> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<short1> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<int> { enum {value = 1}; };\n        template <> struct IsSignedIntergral<int1> { enum {value = 1}; };\n\n        template <typename T> struct IsUnsignedIntegral { enum {value = 0}; };\n        template <> struct IsUnsignedIntegral<uchar> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<uchar1> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<ushort> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<ushort1> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<uint> { enum {value = 1}; };\n        template <> struct IsUnsignedIntegral<uint1> { enum {value = 1}; };\n\n        template <typename T> struct IsIntegral { enum {value = IsSignedIntergral<T>::value || IsUnsignedIntegral<T>::value}; };\n        template <> struct IsIntegral<char> { enum {value = 1}; };\n        template <> struct IsIntegral<bool> { enum {value = 1}; };\n\n        template <typename T> struct IsFloat { enum {value = 0}; };\n        template <> struct IsFloat<float> { enum {value = 1}; };\n        template <> struct IsFloat<double> { enum {value = 1}; };\n\n        template <typename T> struct IsVec { enum {value = 0}; };\n        template <> struct IsVec<uchar1> { enum {value = 1}; };\n        template <> struct IsVec<uchar2> { enum {value = 1}; };\n        template <> struct IsVec<uchar3> { enum {value = 1}; };\n        template <> struct IsVec<uchar4> { enum {value = 1}; };\n        template <> struct IsVec<uchar8> { enum {value = 1}; };\n        template <> struct IsVec<char1> { enum {value = 1}; };\n        template <> struct IsVec<char2> { enum {value = 1}; };\n        template <> struct IsVec<char3> { enum {value = 1}; };\n        template <> struct IsVec<char4> { enum {value = 1}; };\n        template <> struct IsVec<char8> { enum {value = 1}; };\n        template <> struct IsVec<ushort1> { enum {value = 1}; };\n        template <> struct IsVec<ushort2> { enum {value = 1}; };\n        template <> struct IsVec<ushort3> { enum {value = 1}; };\n        template <> struct IsVec<ushort4> { enum {value = 1}; };\n        template <> struct IsVec<ushort8> { enum {value = 1}; };\n        template <> struct IsVec<short1> { enum {value = 1}; };\n        template <> struct IsVec<short2> { enum {value = 1}; };\n        template <> struct IsVec<short3> { enum {value = 1}; };\n        template <> struct IsVec<short4> { enum {value = 1}; };\n        template <> struct IsVec<short8> { enum {value = 1}; };\n        template <> struct IsVec<uint1> { enum {value = 1}; };\n        template <> struct IsVec<uint2> { enum {value = 1}; };\n        template <> struct IsVec<uint3> { enum {value = 1}; };\n        template <> struct IsVec<uint4> { enum {value = 1}; };\n        template <> struct IsVec<uint8> { enum {value = 1}; };\n        template <> struct IsVec<int1> { enum {value = 1}; };\n        template <> struct IsVec<int2> { enum {value = 1}; };\n        template <> struct IsVec<int3> { enum {value = 1}; };\n        template <> struct IsVec<int4> { enum {value = 1}; };\n        template <> struct IsVec<int8> { enum {value = 1}; };\n        template <> struct IsVec<float1> { enum {value = 1}; };\n        template <> struct IsVec<float2> { enum {value = 1}; };\n        template <> struct IsVec<float3> { enum {value = 1}; };\n        template <> struct IsVec<float4> { enum {value = 1}; };\n        template <> struct IsVec<float8> { enum {value = 1}; };\n        template <> struct IsVec<double1> { enum {value = 1}; };\n        template <> struct IsVec<double2> { enum {value = 1}; };\n        template <> struct IsVec<double3> { enum {value = 1}; };\n        template <> struct IsVec<double4> { enum {value = 1}; };\n        template <> struct IsVec<double8> { enum {value = 1}; };\n\n        template <class U> struct AddParameterType { typedef const U& type; };\n        template <class U> struct AddParameterType<U&> { typedef U& type; };\n        template <> struct AddParameterType<void> { typedef void type; };\n\n        template <class U> struct ReferenceTraits\n        {\n            enum { value = false };\n            typedef U type;\n        };\n        template <class U> struct ReferenceTraits<U&>\n        {\n            enum { value = true };\n            typedef U type;\n        };\n\n        template <class U> struct PointerTraits\n        {\n            enum { value = false };\n            typedef void type;\n        };\n        template <class U> struct PointerTraits<U*>\n        {\n            enum { value = true };\n            typedef U type;\n        };\n        template <class U> struct PointerTraits<U*&>\n        {\n            enum { value = true };\n            typedef U type;\n        };\n\n        template <class U> struct UnConst\n        {\n            typedef U type;\n            enum { value = 0 };\n        };\n        template <class U> struct UnConst<const U>\n        {\n            typedef U type;\n            enum { value = 1 };\n        };\n        template <class U> struct UnConst<const U&>\n        {\n            typedef U& type;\n            enum { value = 1 };\n        };\n\n        template <class U> struct UnVolatile\n        {\n            typedef U type;\n            enum { value = 0 };\n        };\n        template <class U> struct UnVolatile<volatile U>\n        {\n            typedef U type;\n            enum { value = 1 };\n        };\n        template <class U> struct UnVolatile<volatile U&>\n        {\n            typedef U& type;\n            enum { value = 1 };\n        };\n    } // namespace type_traits_detail\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_TYPE_TRAITS_DETAIL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/detail/vec_distance_detail.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_VEC_DISTANCE_DETAIL_HPP\n#define OPENCV_CUDA_VEC_DISTANCE_DETAIL_HPP\n\n#include \"../datamov_utils.hpp\"\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    namespace vec_distance_detail\n    {\n        template <int THREAD_DIM, int N> struct UnrollVecDiffCached\n        {\n            template <typename Dist, typename T1, typename T2>\n            static __device__ void calcCheck(const T1* vecCached, const T2* vecGlob, int len, Dist& dist, int ind)\n            {\n                if (ind < len)\n                {\n                    T1 val1 = *vecCached++;\n\n                    T2 val2;\n                    ForceGlob<T2>::Load(vecGlob, ind, val2);\n\n                    dist.reduceIter(val1, val2);\n\n                    UnrollVecDiffCached<THREAD_DIM, N - 1>::calcCheck(vecCached, vecGlob, len, dist, ind + THREAD_DIM);\n                }\n            }\n\n            template <typename Dist, typename T1, typename T2>\n            static __device__ void calcWithoutCheck(const T1* vecCached, const T2* vecGlob, Dist& dist)\n            {\n                T1 val1 = *vecCached++;\n\n                T2 val2;\n                ForceGlob<T2>::Load(vecGlob, 0, val2);\n                vecGlob += THREAD_DIM;\n\n                dist.reduceIter(val1, val2);\n\n                UnrollVecDiffCached<THREAD_DIM, N - 1>::calcWithoutCheck(vecCached, vecGlob, dist);\n            }\n        };\n        template <int THREAD_DIM> struct UnrollVecDiffCached<THREAD_DIM, 0>\n        {\n            template <typename Dist, typename T1, typename T2>\n            static __device__ __forceinline__ void calcCheck(const T1*, const T2*, int, Dist&, int)\n            {\n            }\n\n            template <typename Dist, typename T1, typename T2>\n            static __device__ __forceinline__ void calcWithoutCheck(const T1*, const T2*, Dist&)\n            {\n            }\n        };\n\n        template <int THREAD_DIM, int MAX_LEN, bool LEN_EQ_MAX_LEN> struct VecDiffCachedCalculator;\n        template <int THREAD_DIM, int MAX_LEN> struct VecDiffCachedCalculator<THREAD_DIM, MAX_LEN, false>\n        {\n            template <typename Dist, typename T1, typename T2>\n            static __device__ __forceinline__ void calc(const T1* vecCached, const T2* vecGlob, int len, Dist& dist, int tid)\n            {\n                UnrollVecDiffCached<THREAD_DIM, MAX_LEN / THREAD_DIM>::calcCheck(vecCached, vecGlob, len, dist, tid);\n            }\n        };\n        template <int THREAD_DIM, int MAX_LEN> struct VecDiffCachedCalculator<THREAD_DIM, MAX_LEN, true>\n        {\n            template <typename Dist, typename T1, typename T2>\n            static __device__ __forceinline__ void calc(const T1* vecCached, const T2* vecGlob, int len, Dist& dist, int tid)\n            {\n                UnrollVecDiffCached<THREAD_DIM, MAX_LEN / THREAD_DIM>::calcWithoutCheck(vecCached, vecGlob + tid, dist);\n            }\n        };\n    } // namespace vec_distance_detail\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_VEC_DISTANCE_DETAIL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/dynamic_smem.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_DYNAMIC_SMEM_HPP\n#define OPENCV_CUDA_DYNAMIC_SMEM_HPP\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template<class T> struct DynamicSharedMem\n    {\n        __device__ __forceinline__ operator T*()\n        {\n            extern __shared__ int __smem[];\n            return (T*)__smem;\n        }\n\n        __device__ __forceinline__ operator const T*() const\n        {\n            extern __shared__ int __smem[];\n            return (T*)__smem;\n        }\n    };\n\n    // specialize for double to avoid unaligned memory access compile errors\n    template<> struct DynamicSharedMem<double>\n    {\n        __device__ __forceinline__ operator double*()\n        {\n            extern __shared__ double __smem_d[];\n            return (double*)__smem_d;\n        }\n\n        __device__ __forceinline__ operator const double*() const\n        {\n            extern __shared__ double __smem_d[];\n            return (double*)__smem_d;\n        }\n    };\n}}}\n\n//! @endcond\n\n#endif // OPENCV_CUDA_DYNAMIC_SMEM_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/emulation.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_EMULATION_HPP_\n#define OPENCV_CUDA_EMULATION_HPP_\n\n#include \"common.hpp\"\n#include \"warp_reduce.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    struct Emulation\n    {\n\n        static __device__ __forceinline__ int syncthreadsOr(int pred)\n        {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ < 200)\n                // just campilation stab\n                return 0;\n#else\n                return __syncthreads_or(pred);\n#endif\n        }\n\n        template<int CTA_SIZE>\n        static __forceinline__ __device__ int Ballot(int predicate)\n        {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ >= 200)\n            return __ballot(predicate);\n#else\n            __shared__ volatile int cta_buffer[CTA_SIZE];\n\n            int tid = threadIdx.x;\n            cta_buffer[tid] = predicate ? (1 << (tid & 31)) : 0;\n            return warp_reduce(cta_buffer);\n#endif\n        }\n\n        struct smem\n        {\n            enum { TAG_MASK = (1U << ( (sizeof(unsigned int) << 3) - 5U)) - 1U };\n\n            template<typename T>\n            static __device__ __forceinline__ T atomicInc(T* address, T val)\n            {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ < 120)\n                T count;\n                unsigned int tag = threadIdx.x << ( (sizeof(unsigned int) << 3) - 5U);\n                do\n                {\n                    count = *address & TAG_MASK;\n                    count = tag | (count + 1);\n                    *address = count;\n                } while (*address != count);\n\n                return (count & TAG_MASK) - 1;\n#else\n                return ::atomicInc(address, val);\n#endif\n            }\n\n            template<typename T>\n            static __device__ __forceinline__ T atomicAdd(T* address, T val)\n            {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ < 120)\n                T count;\n                unsigned int tag = threadIdx.x << ( (sizeof(unsigned int) << 3) - 5U);\n                do\n                {\n                    count = *address & TAG_MASK;\n                    count = tag | (count + val);\n                    *address = count;\n                } while (*address != count);\n\n                return (count & TAG_MASK) - val;\n#else\n                return ::atomicAdd(address, val);\n#endif\n            }\n\n            template<typename T>\n            static __device__ __forceinline__ T atomicMin(T* address, T val)\n            {\n#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ < 120)\n                T count = ::min(*address, val);\n                do\n                {\n                    *address = count;\n                } while (*address > count);\n\n                return count;\n#else\n                return ::atomicMin(address, val);\n#endif\n            }\n        }; // struct cmem\n\n        struct glob\n        {\n            static __device__ __forceinline__ int atomicAdd(int* address, int val)\n            {\n                return ::atomicAdd(address, val);\n            }\n            static __device__ __forceinline__ unsigned int atomicAdd(unsigned int* address, unsigned int val)\n            {\n                return ::atomicAdd(address, val);\n            }\n            static __device__ __forceinline__ float atomicAdd(float* address, float val)\n            {\n            #if __CUDA_ARCH__ >= 200\n                return ::atomicAdd(address, val);\n            #else\n                int* address_as_i = (int*) address;\n                int old = *address_as_i, assumed;\n                do {\n                    assumed = old;\n                    old = ::atomicCAS(address_as_i, assumed,\n                        __float_as_int(val + __int_as_float(assumed)));\n                } while (assumed != old);\n                return __int_as_float(old);\n            #endif\n            }\n            static __device__ __forceinline__ double atomicAdd(double* address, double val)\n            {\n            #if __CUDA_ARCH__ >= 130\n                unsigned long long int* address_as_ull = (unsigned long long int*) address;\n                unsigned long long int old = *address_as_ull, assumed;\n                do {\n                    assumed = old;\n                    old = ::atomicCAS(address_as_ull, assumed,\n                        __double_as_longlong(val + __longlong_as_double(assumed)));\n                } while (assumed != old);\n                return __longlong_as_double(old);\n            #else\n                CV_UNUSED(address);\n                CV_UNUSED(val);\n                return 0.0;\n            #endif\n            }\n\n            static __device__ __forceinline__ int atomicMin(int* address, int val)\n            {\n                return ::atomicMin(address, val);\n            }\n            static __device__ __forceinline__ float atomicMin(float* address, float val)\n            {\n            #if __CUDA_ARCH__ >= 120\n                int* address_as_i = (int*) address;\n                int old = *address_as_i, assumed;\n                do {\n                    assumed = old;\n                    old = ::atomicCAS(address_as_i, assumed,\n                        __float_as_int(::fminf(val, __int_as_float(assumed))));\n                } while (assumed != old);\n                return __int_as_float(old);\n            #else\n                CV_UNUSED(address);\n                CV_UNUSED(val);\n                return 0.0f;\n            #endif\n            }\n            static __device__ __forceinline__ double atomicMin(double* address, double val)\n            {\n            #if __CUDA_ARCH__ >= 130\n                unsigned long long int* address_as_ull = (unsigned long long int*) address;\n                unsigned long long int old = *address_as_ull, assumed;\n                do {\n                    assumed = old;\n                    old = ::atomicCAS(address_as_ull, assumed,\n                        __double_as_longlong(::fmin(val, __longlong_as_double(assumed))));\n                } while (assumed != old);\n                return __longlong_as_double(old);\n            #else\n                CV_UNUSED(address);\n                CV_UNUSED(val);\n                return 0.0;\n            #endif\n            }\n\n            static __device__ __forceinline__ int atomicMax(int* address, int val)\n            {\n                return ::atomicMax(address, val);\n            }\n            static __device__ __forceinline__ float atomicMax(float* address, float val)\n            {\n            #if __CUDA_ARCH__ >= 120\n                int* address_as_i = (int*) address;\n                int old = *address_as_i, assumed;\n                do {\n                    assumed = old;\n                    old = ::atomicCAS(address_as_i, assumed,\n                        __float_as_int(::fmaxf(val, __int_as_float(assumed))));\n                } while (assumed != old);\n                return __int_as_float(old);\n            #else\n                CV_UNUSED(address);\n                CV_UNUSED(val);\n                return 0.0f;\n            #endif\n            }\n            static __device__ __forceinline__ double atomicMax(double* address, double val)\n            {\n            #if __CUDA_ARCH__ >= 130\n                unsigned long long int* address_as_ull = (unsigned long long int*) address;\n                unsigned long long int old = *address_as_ull, assumed;\n                do {\n                    assumed = old;\n                    old = ::atomicCAS(address_as_ull, assumed,\n                        __double_as_longlong(::fmax(val, __longlong_as_double(assumed))));\n                } while (assumed != old);\n                return __longlong_as_double(old);\n            #else\n                CV_UNUSED(address);\n                CV_UNUSED(val);\n                return 0.0;\n            #endif\n            }\n        };\n    }; //struct Emulation\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif /* OPENCV_CUDA_EMULATION_HPP_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/filters.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_FILTERS_HPP\n#define OPENCV_CUDA_FILTERS_HPP\n\n#include \"saturate_cast.hpp\"\n#include \"vec_traits.hpp\"\n#include \"vec_math.hpp\"\n#include \"type_traits.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template <typename Ptr2D> struct PointFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n\n        explicit __host__ __device__ __forceinline__ PointFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)\n        : src(src_)\n        {\n            CV_UNUSED(fx);\n            CV_UNUSED(fy);\n        }\n\n        __device__ __forceinline__ elem_type operator ()(float y, float x) const\n        {\n            return src(__float2int_rz(y), __float2int_rz(x));\n        }\n\n        Ptr2D src;\n    };\n\n    template <typename Ptr2D> struct LinearFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n\n        explicit __host__ __device__ __forceinline__ LinearFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)\n        : src(src_)\n        {\n            CV_UNUSED(fx);\n            CV_UNUSED(fy);\n        }\n        __device__ __forceinline__ elem_type operator ()(float y, float x) const\n        {\n            typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\n\n            work_type out = VecTraits<work_type>::all(0);\n\n            const int x1 = __float2int_rd(x);\n            const int y1 = __float2int_rd(y);\n            const int x2 = x1 + 1;\n            const int y2 = y1 + 1;\n\n            elem_type src_reg = src(y1, x1);\n            out = out + src_reg * ((x2 - x) * (y2 - y));\n\n            src_reg = src(y1, x2);\n            out = out + src_reg * ((x - x1) * (y2 - y));\n\n            src_reg = src(y2, x1);\n            out = out + src_reg * ((x2 - x) * (y - y1));\n\n            src_reg = src(y2, x2);\n            out = out + src_reg * ((x - x1) * (y - y1));\n\n            return saturate_cast<elem_type>(out);\n        }\n\n        Ptr2D src;\n    };\n\n    template <typename Ptr2D> struct CubicFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n        typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\n\n        explicit __host__ __device__ __forceinline__ CubicFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)\n        : src(src_)\n        {\n            CV_UNUSED(fx);\n            CV_UNUSED(fy);\n        }\n\n        static __device__ __forceinline__ float bicubicCoeff(float x_)\n        {\n            float x = fabsf(x_);\n            if (x <= 1.0f)\n            {\n                return x * x * (1.5f * x - 2.5f) + 1.0f;\n            }\n            else if (x < 2.0f)\n            {\n                return x * (x * (-0.5f * x + 2.5f) - 4.0f) + 2.0f;\n            }\n            else\n            {\n                return 0.0f;\n            }\n        }\n\n        __device__ elem_type operator ()(float y, float x) const\n        {\n            const float xmin = ::ceilf(x - 2.0f);\n            const float xmax = ::floorf(x + 2.0f);\n\n            const float ymin = ::ceilf(y - 2.0f);\n            const float ymax = ::floorf(y + 2.0f);\n\n            work_type sum = VecTraits<work_type>::all(0);\n            float wsum = 0.0f;\n\n            for (float cy = ymin; cy <= ymax; cy += 1.0f)\n            {\n                for (float cx = xmin; cx <= xmax; cx += 1.0f)\n                {\n                    const float w = bicubicCoeff(x - cx) * bicubicCoeff(y - cy);\n                    sum = sum + w * src(__float2int_rd(cy), __float2int_rd(cx));\n                    wsum += w;\n                }\n            }\n\n            work_type res = (!wsum)? VecTraits<work_type>::all(0) : sum / wsum;\n\n            return saturate_cast<elem_type>(res);\n        }\n\n        Ptr2D src;\n    };\n    // for integer scaling\n    template <typename Ptr2D> struct IntegerAreaFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n\n        explicit __host__ __device__ __forceinline__ IntegerAreaFilter(const Ptr2D& src_, float scale_x_, float scale_y_)\n            : src(src_), scale_x(scale_x_), scale_y(scale_y_), scale(1.f / (scale_x * scale_y)) {}\n\n        __device__ __forceinline__ elem_type operator ()(float y, float x) const\n        {\n            float fsx1 = x * scale_x;\n            float fsx2 = fsx1 + scale_x;\n\n            int sx1 = __float2int_ru(fsx1);\n            int sx2 = __float2int_rd(fsx2);\n\n            float fsy1 = y * scale_y;\n            float fsy2 = fsy1 + scale_y;\n\n            int sy1 = __float2int_ru(fsy1);\n            int sy2 = __float2int_rd(fsy2);\n\n            typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\n            work_type out = VecTraits<work_type>::all(0.f);\n\n            for(int dy = sy1; dy < sy2; ++dy)\n                for(int dx = sx1; dx < sx2; ++dx)\n                {\n                    out = out + src(dy, dx) * scale;\n                }\n\n            return saturate_cast<elem_type>(out);\n        }\n\n        Ptr2D src;\n        float scale_x, scale_y ,scale;\n    };\n\n    template <typename Ptr2D> struct AreaFilter\n    {\n        typedef typename Ptr2D::elem_type elem_type;\n        typedef float index_type;\n\n        explicit __host__ __device__ __forceinline__ AreaFilter(const Ptr2D& src_, float scale_x_, float scale_y_)\n            : src(src_), scale_x(scale_x_), scale_y(scale_y_){}\n\n        __device__ __forceinline__ elem_type operator ()(float y, float x) const\n        {\n            float fsx1 = x * scale_x;\n            float fsx2 = fsx1 + scale_x;\n\n            int sx1 = __float2int_ru(fsx1);\n            int sx2 = __float2int_rd(fsx2);\n\n            float fsy1 = y * scale_y;\n            float fsy2 = fsy1 + scale_y;\n\n            int sy1 = __float2int_ru(fsy1);\n            int sy2 = __float2int_rd(fsy2);\n\n            float scale = 1.f / (fminf(scale_x, src.width - fsx1) * fminf(scale_y, src.height - fsy1));\n\n            typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\n            work_type out = VecTraits<work_type>::all(0.f);\n\n            for (int dy = sy1; dy < sy2; ++dy)\n            {\n                for (int dx = sx1; dx < sx2; ++dx)\n                    out = out + src(dy, dx) * scale;\n\n                if (sx1 > fsx1)\n                    out = out + src(dy, (sx1 -1) ) * ((sx1 - fsx1) * scale);\n\n                if (sx2 < fsx2)\n                    out = out + src(dy, sx2) * ((fsx2 -sx2) * scale);\n            }\n\n            if (sy1 > fsy1)\n                for (int dx = sx1; dx < sx2; ++dx)\n                    out = out + src( (sy1 - 1) , dx) * ((sy1 -fsy1) * scale);\n\n            if (sy2 < fsy2)\n                for (int dx = sx1; dx < sx2; ++dx)\n                    out = out + src(sy2, dx) * ((fsy2 -sy2) * scale);\n\n            if ((sy1 > fsy1) &&  (sx1 > fsx1))\n                out = out + src( (sy1 - 1) , (sx1 - 1)) * ((sy1 -fsy1) * (sx1 -fsx1) * scale);\n\n            if ((sy1 > fsy1) &&  (sx2 < fsx2))\n                out = out + src( (sy1 - 1) , sx2) * ((sy1 -fsy1) * (fsx2 -sx2) * scale);\n\n            if ((sy2 < fsy2) &&  (sx2 < fsx2))\n                out = out + src(sy2, sx2) * ((fsy2 -sy2) * (fsx2 -sx2) * scale);\n\n            if ((sy2 < fsy2) &&  (sx1 > fsx1))\n                out = out + src(sy2, (sx1 - 1)) * ((fsy2 -sy2) * (sx1 -fsx1) * scale);\n\n            return saturate_cast<elem_type>(out);\n        }\n\n        Ptr2D src;\n        float scale_x, scale_y;\n        int width, haight;\n    };\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_FILTERS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/funcattrib.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_DEVICE_FUNCATTRIB_HPP\n#define OPENCV_CUDA_DEVICE_FUNCATTRIB_HPP\n\n#include <cstdio>\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template<class Func>\n    void printFuncAttrib(Func& func)\n    {\n\n        cudaFuncAttributes attrs;\n        cudaFuncGetAttributes(&attrs, func);\n\n        printf(\"=== Function stats ===\\n\");\n        printf(\"Name: \\n\");\n        printf(\"sharedSizeBytes    = %d\\n\", attrs.sharedSizeBytes);\n        printf(\"constSizeBytes     = %d\\n\", attrs.constSizeBytes);\n        printf(\"localSizeBytes     = %d\\n\", attrs.localSizeBytes);\n        printf(\"maxThreadsPerBlock = %d\\n\", attrs.maxThreadsPerBlock);\n        printf(\"numRegs            = %d\\n\", attrs.numRegs);\n        printf(\"ptxVersion         = %d\\n\", attrs.ptxVersion);\n        printf(\"binaryVersion      = %d\\n\", attrs.binaryVersion);\n        printf(\"\\n\");\n        fflush(stdout);\n    }\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif  /* OPENCV_CUDA_DEVICE_FUNCATTRIB_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/functional.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_FUNCTIONAL_HPP\n#define OPENCV_CUDA_FUNCTIONAL_HPP\n\n#include <functional>\n#include \"saturate_cast.hpp\"\n#include \"vec_traits.hpp\"\n#include \"type_traits.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    // Function Objects\n    template<typename Argument, typename Result> struct unary_function\n    {\n        typedef Argument argument_type;\n        typedef Result result_type;\n    };\n    template<typename Argument1, typename Argument2, typename Result> struct binary_function\n    {\n        typedef Argument1 first_argument_type;\n        typedef Argument2 second_argument_type;\n        typedef Result result_type;\n    };\n\n    // Arithmetic Operations\n    template <typename T> struct plus : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a + b;\n        }\n        __host__ __device__ __forceinline__ plus() {}\n        __host__ __device__ __forceinline__ plus(const plus&) {}\n    };\n\n    template <typename T> struct minus : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a - b;\n        }\n        __host__ __device__ __forceinline__ minus() {}\n        __host__ __device__ __forceinline__ minus(const minus&) {}\n    };\n\n    template <typename T> struct multiplies : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a * b;\n        }\n        __host__ __device__ __forceinline__ multiplies() {}\n        __host__ __device__ __forceinline__ multiplies(const multiplies&) {}\n    };\n\n    template <typename T> struct divides : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a / b;\n        }\n        __host__ __device__ __forceinline__ divides() {}\n        __host__ __device__ __forceinline__ divides(const divides&) {}\n    };\n\n    template <typename T> struct modulus : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a % b;\n        }\n        __host__ __device__ __forceinline__ modulus() {}\n        __host__ __device__ __forceinline__ modulus(const modulus&) {}\n    };\n\n    template <typename T> struct negate : unary_function<T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a) const\n        {\n            return -a;\n        }\n        __host__ __device__ __forceinline__ negate() {}\n        __host__ __device__ __forceinline__ negate(const negate&) {}\n    };\n\n    // Comparison Operations\n    template <typename T> struct equal_to : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a == b;\n        }\n        __host__ __device__ __forceinline__ equal_to() {}\n        __host__ __device__ __forceinline__ equal_to(const equal_to&) {}\n    };\n\n    template <typename T> struct not_equal_to : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a != b;\n        }\n        __host__ __device__ __forceinline__ not_equal_to() {}\n        __host__ __device__ __forceinline__ not_equal_to(const not_equal_to&) {}\n    };\n\n    template <typename T> struct greater : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a > b;\n        }\n        __host__ __device__ __forceinline__ greater() {}\n        __host__ __device__ __forceinline__ greater(const greater&) {}\n    };\n\n    template <typename T> struct less : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a < b;\n        }\n        __host__ __device__ __forceinline__ less() {}\n        __host__ __device__ __forceinline__ less(const less&) {}\n    };\n\n    template <typename T> struct greater_equal : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a >= b;\n        }\n        __host__ __device__ __forceinline__ greater_equal() {}\n        __host__ __device__ __forceinline__ greater_equal(const greater_equal&) {}\n    };\n\n    template <typename T> struct less_equal : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a <= b;\n        }\n        __host__ __device__ __forceinline__ less_equal() {}\n        __host__ __device__ __forceinline__ less_equal(const less_equal&) {}\n    };\n\n    // Logical Operations\n    template <typename T> struct logical_and : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a && b;\n        }\n        __host__ __device__ __forceinline__ logical_and() {}\n        __host__ __device__ __forceinline__ logical_and(const logical_and&) {}\n    };\n\n    template <typename T> struct logical_or : binary_function<T, T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a,\n                                                    typename TypeTraits<T>::ParameterType b) const\n        {\n            return a || b;\n        }\n        __host__ __device__ __forceinline__ logical_or() {}\n        __host__ __device__ __forceinline__ logical_or(const logical_or&) {}\n    };\n\n    template <typename T> struct logical_not : unary_function<T, bool>\n    {\n        __device__ __forceinline__ bool operator ()(typename TypeTraits<T>::ParameterType a) const\n        {\n            return !a;\n        }\n        __host__ __device__ __forceinline__ logical_not() {}\n        __host__ __device__ __forceinline__ logical_not(const logical_not&) {}\n    };\n\n    // Bitwise Operations\n    template <typename T> struct bit_and : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a & b;\n        }\n        __host__ __device__ __forceinline__ bit_and() {}\n        __host__ __device__ __forceinline__ bit_and(const bit_and&) {}\n    };\n\n    template <typename T> struct bit_or : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a | b;\n        }\n        __host__ __device__ __forceinline__ bit_or() {}\n        __host__ __device__ __forceinline__ bit_or(const bit_or&) {}\n    };\n\n    template <typename T> struct bit_xor : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType a,\n                                                 typename TypeTraits<T>::ParameterType b) const\n        {\n            return a ^ b;\n        }\n        __host__ __device__ __forceinline__ bit_xor() {}\n        __host__ __device__ __forceinline__ bit_xor(const bit_xor&) {}\n    };\n\n    template <typename T> struct bit_not : unary_function<T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType v) const\n        {\n            return ~v;\n        }\n        __host__ __device__ __forceinline__ bit_not() {}\n        __host__ __device__ __forceinline__ bit_not(const bit_not&) {}\n    };\n\n    // Generalized Identity Operations\n    template <typename T> struct identity : unary_function<T, T>\n    {\n        __device__ __forceinline__ typename TypeTraits<T>::ParameterType operator()(typename TypeTraits<T>::ParameterType x) const\n        {\n            return x;\n        }\n        __host__ __device__ __forceinline__ identity() {}\n        __host__ __device__ __forceinline__ identity(const identity&) {}\n    };\n\n    template <typename T1, typename T2> struct project1st : binary_function<T1, T2, T1>\n    {\n        __device__ __forceinline__ typename TypeTraits<T1>::ParameterType operator()(typename TypeTraits<T1>::ParameterType lhs, typename TypeTraits<T2>::ParameterType rhs) const\n        {\n            return lhs;\n        }\n        __host__ __device__ __forceinline__ project1st() {}\n        __host__ __device__ __forceinline__ project1st(const project1st&) {}\n    };\n\n    template <typename T1, typename T2> struct project2nd : binary_function<T1, T2, T2>\n    {\n        __device__ __forceinline__ typename TypeTraits<T2>::ParameterType operator()(typename TypeTraits<T1>::ParameterType lhs, typename TypeTraits<T2>::ParameterType rhs) const\n        {\n            return rhs;\n        }\n        __host__ __device__ __forceinline__ project2nd() {}\n        __host__ __device__ __forceinline__ project2nd(const project2nd&) {}\n    };\n\n    // Min/Max Operations\n\n#define OPENCV_CUDA_IMPLEMENT_MINMAX(name, type, op) \\\n    template <> struct name<type> : binary_function<type, type, type> \\\n    { \\\n        __device__ __forceinline__ type operator()(type lhs, type rhs) const {return op(lhs, rhs);} \\\n        __host__ __device__ __forceinline__ name() {}\\\n        __host__ __device__ __forceinline__ name(const name&) {}\\\n    };\n\n    template <typename T> struct maximum : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType lhs, typename TypeTraits<T>::ParameterType rhs) const\n        {\n            return max(lhs, rhs);\n        }\n        __host__ __device__ __forceinline__ maximum() {}\n        __host__ __device__ __forceinline__ maximum(const maximum&) {}\n    };\n\n    OPENCV_CUDA_IMPLEMENT_MINMAX(maximum, uchar, ::max)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(maximum, schar, ::max)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(maximum, char, ::max)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(maximum, ushort, ::max)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(maximum, short, ::max)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(maximum, int, ::max)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(maximum, uint, ::max)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(maximum, float, ::fmax)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(maximum, double, ::fmax)\n\n    template <typename T> struct minimum : binary_function<T, T, T>\n    {\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType lhs, typename TypeTraits<T>::ParameterType rhs) const\n        {\n            return min(lhs, rhs);\n        }\n        __host__ __device__ __forceinline__ minimum() {}\n        __host__ __device__ __forceinline__ minimum(const minimum&) {}\n    };\n\n    OPENCV_CUDA_IMPLEMENT_MINMAX(minimum, uchar, ::min)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(minimum, schar, ::min)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(minimum, char, ::min)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(minimum, ushort, ::min)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(minimum, short, ::min)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(minimum, int, ::min)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(minimum, uint, ::min)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(minimum, float, ::fmin)\n    OPENCV_CUDA_IMPLEMENT_MINMAX(minimum, double, ::fmin)\n\n#undef OPENCV_CUDA_IMPLEMENT_MINMAX\n\n    // Math functions\n\n    template <typename T> struct abs_func : unary_function<T, T>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType x) const\n        {\n            return abs(x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<unsigned char> : unary_function<unsigned char, unsigned char>\n    {\n        __device__ __forceinline__ unsigned char operator ()(unsigned char x) const\n        {\n            return x;\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<signed char> : unary_function<signed char, signed char>\n    {\n        __device__ __forceinline__ signed char operator ()(signed char x) const\n        {\n            return ::abs((int)x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<char> : unary_function<char, char>\n    {\n        __device__ __forceinline__ char operator ()(char x) const\n        {\n            return ::abs((int)x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<unsigned short> : unary_function<unsigned short, unsigned short>\n    {\n        __device__ __forceinline__ unsigned short operator ()(unsigned short x) const\n        {\n            return x;\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<short> : unary_function<short, short>\n    {\n        __device__ __forceinline__ short operator ()(short x) const\n        {\n            return ::abs((int)x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<unsigned int> : unary_function<unsigned int, unsigned int>\n    {\n        __device__ __forceinline__ unsigned int operator ()(unsigned int x) const\n        {\n            return x;\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<int> : unary_function<int, int>\n    {\n        __device__ __forceinline__ int operator ()(int x) const\n        {\n            return ::abs(x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<float> : unary_function<float, float>\n    {\n        __device__ __forceinline__ float operator ()(float x) const\n        {\n            return ::fabsf(x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n    template <> struct abs_func<double> : unary_function<double, double>\n    {\n        __device__ __forceinline__ double operator ()(double x) const\n        {\n            return ::fabs(x);\n        }\n\n        __host__ __device__ __forceinline__ abs_func() {}\n        __host__ __device__ __forceinline__ abs_func(const abs_func&) {}\n    };\n\n#define OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(name, func) \\\n    template <typename T> struct name ## _func : unary_function<T, float> \\\n    { \\\n        __device__ __forceinline__ float operator ()(typename TypeTraits<T>::ParameterType v) const \\\n        { \\\n            return func ## f(v); \\\n        } \\\n        __host__ __device__ __forceinline__ name ## _func() {} \\\n        __host__ __device__ __forceinline__ name ## _func(const name ## _func&) {} \\\n    }; \\\n    template <> struct name ## _func<double> : unary_function<double, double> \\\n    { \\\n        __device__ __forceinline__ double operator ()(double v) const \\\n        { \\\n            return func(v); \\\n        } \\\n        __host__ __device__ __forceinline__ name ## _func() {} \\\n        __host__ __device__ __forceinline__ name ## _func(const name ## _func&) {} \\\n    };\n\n#define OPENCV_CUDA_IMPLEMENT_BIN_FUNCTOR(name, func) \\\n    template <typename T> struct name ## _func : binary_function<T, T, float> \\\n    { \\\n        __device__ __forceinline__ float operator ()(typename TypeTraits<T>::ParameterType v1, typename TypeTraits<T>::ParameterType v2) const \\\n        { \\\n            return func ## f(v1, v2); \\\n        } \\\n        __host__ __device__ __forceinline__ name ## _func() {} \\\n        __host__ __device__ __forceinline__ name ## _func(const name ## _func&) {} \\\n    }; \\\n    template <> struct name ## _func<double> : binary_function<double, double, double> \\\n    { \\\n        __device__ __forceinline__ double operator ()(double v1, double v2) const \\\n        { \\\n            return func(v1, v2); \\\n        } \\\n        __host__ __device__ __forceinline__ name ## _func() {} \\\n        __host__ __device__ __forceinline__ name ## _func(const name ## _func&) {} \\\n    };\n\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(sqrt, ::sqrt)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(exp, ::exp)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(exp2, ::exp2)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(exp10, ::exp10)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(log, ::log)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(log2, ::log2)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(log10, ::log10)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(sin, ::sin)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(cos, ::cos)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(tan, ::tan)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(asin, ::asin)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(acos, ::acos)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(atan, ::atan)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(sinh, ::sinh)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(cosh, ::cosh)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(tanh, ::tanh)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(asinh, ::asinh)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(acosh, ::acosh)\n    OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR(atanh, ::atanh)\n\n    OPENCV_CUDA_IMPLEMENT_BIN_FUNCTOR(hypot, ::hypot)\n    OPENCV_CUDA_IMPLEMENT_BIN_FUNCTOR(atan2, ::atan2)\n    OPENCV_CUDA_IMPLEMENT_BIN_FUNCTOR(pow, ::pow)\n\n    #undef OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR\n    #undef OPENCV_CUDA_IMPLEMENT_UN_FUNCTOR_NO_DOUBLE\n    #undef OPENCV_CUDA_IMPLEMENT_BIN_FUNCTOR\n\n    template<typename T> struct hypot_sqr_func : binary_function<T, T, float>\n    {\n        __device__ __forceinline__ T operator ()(typename TypeTraits<T>::ParameterType src1, typename TypeTraits<T>::ParameterType src2) const\n        {\n            return src1 * src1 + src2 * src2;\n        }\n        __host__ __device__ __forceinline__ hypot_sqr_func() {}\n        __host__ __device__ __forceinline__ hypot_sqr_func(const hypot_sqr_func&) {}\n    };\n\n    // Saturate Cast Functor\n    template <typename T, typename D> struct saturate_cast_func : unary_function<T, D>\n    {\n        __device__ __forceinline__ D operator ()(typename TypeTraits<T>::ParameterType v) const\n        {\n            return saturate_cast<D>(v);\n        }\n        __host__ __device__ __forceinline__ saturate_cast_func() {}\n        __host__ __device__ __forceinline__ saturate_cast_func(const saturate_cast_func&) {}\n    };\n\n    // Threshold Functors\n    template <typename T> struct thresh_binary_func : unary_function<T, T>\n    {\n        __host__ __device__ __forceinline__ thresh_binary_func(T thresh_, T maxVal_) : thresh(thresh_), maxVal(maxVal_) {}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return (src > thresh) * maxVal;\n        }\n\n        __host__ __device__ __forceinline__ thresh_binary_func() {}\n        __host__ __device__ __forceinline__ thresh_binary_func(const thresh_binary_func& other)\n            : thresh(other.thresh), maxVal(other.maxVal) {}\n\n        T thresh;\n        T maxVal;\n    };\n\n    template <typename T> struct thresh_binary_inv_func : unary_function<T, T>\n    {\n        __host__ __device__ __forceinline__ thresh_binary_inv_func(T thresh_, T maxVal_) : thresh(thresh_), maxVal(maxVal_) {}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return (src <= thresh) * maxVal;\n        }\n\n        __host__ __device__ __forceinline__ thresh_binary_inv_func() {}\n        __host__ __device__ __forceinline__ thresh_binary_inv_func(const thresh_binary_inv_func& other)\n            : thresh(other.thresh), maxVal(other.maxVal) {}\n\n        T thresh;\n        T maxVal;\n    };\n\n    template <typename T> struct thresh_trunc_func : unary_function<T, T>\n    {\n        explicit __host__ __device__ __forceinline__ thresh_trunc_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {CV_UNUSED(maxVal_);}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return minimum<T>()(src, thresh);\n        }\n\n        __host__ __device__ __forceinline__ thresh_trunc_func() {}\n        __host__ __device__ __forceinline__ thresh_trunc_func(const thresh_trunc_func& other)\n            : thresh(other.thresh) {}\n\n        T thresh;\n    };\n\n    template <typename T> struct thresh_to_zero_func : unary_function<T, T>\n    {\n        explicit __host__ __device__ __forceinline__ thresh_to_zero_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {CV_UNUSED(maxVal_);}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return (src > thresh) * src;\n        }\n\n        __host__ __device__ __forceinline__ thresh_to_zero_func() {}\n       __host__  __device__ __forceinline__ thresh_to_zero_func(const thresh_to_zero_func& other)\n            : thresh(other.thresh) {}\n\n        T thresh;\n    };\n\n    template <typename T> struct thresh_to_zero_inv_func : unary_function<T, T>\n    {\n        explicit __host__ __device__ __forceinline__ thresh_to_zero_inv_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {CV_UNUSED(maxVal_);}\n\n        __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\n        {\n            return (src <= thresh) * src;\n        }\n\n        __host__ __device__ __forceinline__ thresh_to_zero_inv_func() {}\n        __host__ __device__ __forceinline__ thresh_to_zero_inv_func(const thresh_to_zero_inv_func& other)\n            : thresh(other.thresh) {}\n\n        T thresh;\n    };\n\n    // Function Object Adaptors\n    template <typename Predicate> struct unary_negate : unary_function<typename Predicate::argument_type, bool>\n    {\n      explicit __host__ __device__ __forceinline__ unary_negate(const Predicate& p) : pred(p) {}\n\n      __device__ __forceinline__ bool operator()(typename TypeTraits<typename Predicate::argument_type>::ParameterType x) const\n      {\n          return !pred(x);\n      }\n\n      __host__ __device__ __forceinline__ unary_negate() {}\n      __host__ __device__ __forceinline__ unary_negate(const unary_negate& other) : pred(other.pred) {}\n\n      Predicate pred;\n    };\n\n    template <typename Predicate> __host__ __device__ __forceinline__ unary_negate<Predicate> not1(const Predicate& pred)\n    {\n        return unary_negate<Predicate>(pred);\n    }\n\n    template <typename Predicate> struct binary_negate : binary_function<typename Predicate::first_argument_type, typename Predicate::second_argument_type, bool>\n    {\n        explicit __host__ __device__ __forceinline__ binary_negate(const Predicate& p) : pred(p) {}\n\n        __device__ __forceinline__ bool operator()(typename TypeTraits<typename Predicate::first_argument_type>::ParameterType x,\n                                                   typename TypeTraits<typename Predicate::second_argument_type>::ParameterType y) const\n        {\n            return !pred(x,y);\n        }\n\n        __host__ __device__ __forceinline__ binary_negate() {}\n        __host__ __device__ __forceinline__ binary_negate(const binary_negate& other) : pred(other.pred) {}\n\n        Predicate pred;\n    };\n\n    template <typename BinaryPredicate> __host__ __device__ __forceinline__ binary_negate<BinaryPredicate> not2(const BinaryPredicate& pred)\n    {\n        return binary_negate<BinaryPredicate>(pred);\n    }\n\n    template <typename Op> struct binder1st : unary_function<typename Op::second_argument_type, typename Op::result_type>\n    {\n        __host__ __device__ __forceinline__ binder1st(const Op& op_, const typename Op::first_argument_type& arg1_) : op(op_), arg1(arg1_) {}\n\n        __device__ __forceinline__ typename Op::result_type operator ()(typename TypeTraits<typename Op::second_argument_type>::ParameterType a) const\n        {\n            return op(arg1, a);\n        }\n\n        __host__ __device__ __forceinline__ binder1st() {}\n        __host__ __device__ __forceinline__ binder1st(const binder1st& other) : op(other.op), arg1(other.arg1) {}\n\n        Op op;\n        typename Op::first_argument_type arg1;\n    };\n\n    template <typename Op, typename T> __host__ __device__ __forceinline__ binder1st<Op> bind1st(const Op& op, const T& x)\n    {\n        return binder1st<Op>(op, typename Op::first_argument_type(x));\n    }\n\n    template <typename Op> struct binder2nd : unary_function<typename Op::first_argument_type, typename Op::result_type>\n    {\n        __host__ __device__ __forceinline__ binder2nd(const Op& op_, const typename Op::second_argument_type& arg2_) : op(op_), arg2(arg2_) {}\n\n        __forceinline__ __device__ typename Op::result_type operator ()(typename TypeTraits<typename Op::first_argument_type>::ParameterType a) const\n        {\n            return op(a, arg2);\n        }\n\n        __host__ __device__ __forceinline__ binder2nd() {}\n        __host__ __device__ __forceinline__ binder2nd(const binder2nd& other) : op(other.op), arg2(other.arg2) {}\n\n        Op op;\n        typename Op::second_argument_type arg2;\n    };\n\n    template <typename Op, typename T> __host__ __device__ __forceinline__ binder2nd<Op> bind2nd(const Op& op, const T& x)\n    {\n        return binder2nd<Op>(op, typename Op::second_argument_type(x));\n    }\n\n    // Functor Traits\n    template <typename F> struct IsUnaryFunction\n    {\n        typedef char Yes;\n        struct No {Yes a[2];};\n\n        template <typename T, typename D> static Yes check(unary_function<T, D>);\n        static No check(...);\n\n        static F makeF();\n\n        enum { value = (sizeof(check(makeF())) == sizeof(Yes)) };\n    };\n\n    template <typename F> struct IsBinaryFunction\n    {\n        typedef char Yes;\n        struct No {Yes a[2];};\n\n        template <typename T1, typename T2, typename D> static Yes check(binary_function<T1, T2, D>);\n        static No check(...);\n\n        static F makeF();\n\n        enum { value = (sizeof(check(makeF())) == sizeof(Yes)) };\n    };\n\n    namespace functional_detail\n    {\n        template <size_t src_elem_size, size_t dst_elem_size> struct UnOpShift { enum { shift = 1 }; };\n        template <size_t src_elem_size> struct UnOpShift<src_elem_size, 1> { enum { shift = 4 }; };\n        template <size_t src_elem_size> struct UnOpShift<src_elem_size, 2> { enum { shift = 2 }; };\n\n        template <typename T, typename D> struct DefaultUnaryShift\n        {\n            enum { shift = UnOpShift<sizeof(T), sizeof(D)>::shift };\n        };\n\n        template <size_t src_elem_size1, size_t src_elem_size2, size_t dst_elem_size> struct BinOpShift { enum { shift = 1 }; };\n        template <size_t src_elem_size1, size_t src_elem_size2> struct BinOpShift<src_elem_size1, src_elem_size2, 1> { enum { shift = 4 }; };\n        template <size_t src_elem_size1, size_t src_elem_size2> struct BinOpShift<src_elem_size1, src_elem_size2, 2> { enum { shift = 2 }; };\n\n        template <typename T1, typename T2, typename D> struct DefaultBinaryShift\n        {\n            enum { shift = BinOpShift<sizeof(T1), sizeof(T2), sizeof(D)>::shift };\n        };\n\n        template <typename Func, bool unary = IsUnaryFunction<Func>::value> struct ShiftDispatcher;\n        template <typename Func> struct ShiftDispatcher<Func, true>\n        {\n            enum { shift = DefaultUnaryShift<typename Func::argument_type, typename Func::result_type>::shift };\n        };\n        template <typename Func> struct ShiftDispatcher<Func, false>\n        {\n            enum { shift = DefaultBinaryShift<typename Func::first_argument_type, typename Func::second_argument_type, typename Func::result_type>::shift };\n        };\n    }\n\n    template <typename Func> struct DefaultTransformShift\n    {\n        enum { shift = functional_detail::ShiftDispatcher<Func>::shift };\n    };\n\n    template <typename Func> struct DefaultTransformFunctorTraits\n    {\n        enum { simple_block_dim_x = 16 };\n        enum { simple_block_dim_y = 16 };\n\n        enum { smart_block_dim_x = 16 };\n        enum { smart_block_dim_y = 16 };\n        enum { smart_shift = DefaultTransformShift<Func>::shift };\n    };\n\n    template <typename Func> struct TransformFunctorTraits : DefaultTransformFunctorTraits<Func> {};\n\n#define OPENCV_CUDA_TRANSFORM_FUNCTOR_TRAITS(type) \\\n    template <> struct TransformFunctorTraits< type > : DefaultTransformFunctorTraits< type >\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_FUNCTIONAL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/limits.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_LIMITS_HPP\n#define OPENCV_CUDA_LIMITS_HPP\n\n#include <limits.h>\n#include <float.h>\n#include \"common.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\ntemplate <class T> struct numeric_limits;\n\ntemplate <> struct numeric_limits<bool>\n{\n    __device__ __forceinline__ static bool min() { return false; }\n    __device__ __forceinline__ static bool max() { return true;  }\n    static const bool is_signed = false;\n};\n\ntemplate <> struct numeric_limits<signed char>\n{\n    __device__ __forceinline__ static signed char min() { return SCHAR_MIN; }\n    __device__ __forceinline__ static signed char max() { return SCHAR_MAX; }\n    static const bool is_signed = true;\n};\n\ntemplate <> struct numeric_limits<unsigned char>\n{\n    __device__ __forceinline__ static unsigned char min() { return 0; }\n    __device__ __forceinline__ static unsigned char max() { return UCHAR_MAX; }\n    static const bool is_signed = false;\n};\n\ntemplate <> struct numeric_limits<short>\n{\n    __device__ __forceinline__ static short min() { return SHRT_MIN; }\n    __device__ __forceinline__ static short max() { return SHRT_MAX; }\n    static const bool is_signed = true;\n};\n\ntemplate <> struct numeric_limits<unsigned short>\n{\n    __device__ __forceinline__ static unsigned short min() { return 0; }\n    __device__ __forceinline__ static unsigned short max() { return USHRT_MAX; }\n    static const bool is_signed = false;\n};\n\ntemplate <> struct numeric_limits<int>\n{\n    __device__ __forceinline__ static int min() { return INT_MIN; }\n    __device__ __forceinline__ static int max() { return INT_MAX; }\n    static const bool is_signed = true;\n};\n\ntemplate <> struct numeric_limits<unsigned int>\n{\n    __device__ __forceinline__ static unsigned int min() { return 0; }\n    __device__ __forceinline__ static unsigned int max() { return UINT_MAX; }\n    static const bool is_signed = false;\n};\n\ntemplate <> struct numeric_limits<float>\n{\n    __device__ __forceinline__ static float min() { return FLT_MIN; }\n    __device__ __forceinline__ static float max() { return FLT_MAX; }\n    __device__ __forceinline__ static float epsilon() { return FLT_EPSILON; }\n    static const bool is_signed = true;\n};\n\ntemplate <> struct numeric_limits<double>\n{\n    __device__ __forceinline__ static double min() { return DBL_MIN; }\n    __device__ __forceinline__ static double max() { return DBL_MAX; }\n    __device__ __forceinline__ static double epsilon() { return DBL_EPSILON; }\n    static const bool is_signed = true;\n};\n}}} // namespace cv { namespace cuda { namespace cudev {\n\n//! @endcond\n\n#endif // OPENCV_CUDA_LIMITS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/reduce.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_REDUCE_HPP\n#define OPENCV_CUDA_REDUCE_HPP\n\n#ifndef THRUST_DEBUG // eliminate -Wundef warning\n#define THRUST_DEBUG 0\n#endif\n\n#include <thrust/tuple.h>\n#include \"detail/reduce.hpp\"\n#include \"detail/reduce_key_val.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template <int N, typename T, class Op>\n    __device__ __forceinline__ void reduce(volatile T* smem, T& val, unsigned int tid, const Op& op)\n    {\n        reduce_detail::Dispatcher<N>::reductor::template reduce<volatile T*, T&, const Op&>(smem, val, tid, op);\n    }\n    template <int N,\n              typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9,\n              typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, typename R6, typename R7, typename R8, typename R9,\n              class Op0, class Op1, class Op2, class Op3, class Op4, class Op5, class Op6, class Op7, class Op8, class Op9>\n    __device__ __forceinline__ void reduce(const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>& smem,\n                                           const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>& val,\n                                           unsigned int tid,\n                                           const thrust::tuple<Op0, Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, Op9>& op)\n    {\n        reduce_detail::Dispatcher<N>::reductor::template reduce<\n                const thrust::tuple<P0, P1, P2, P3, P4, P5, P6, P7, P8, P9>&,\n                const thrust::tuple<R0, R1, R2, R3, R4, R5, R6, R7, R8, R9>&,\n                const thrust::tuple<Op0, Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8, Op9>&>(smem, val, tid, op);\n    }\n\n    template <unsigned int N, typename K, typename V, class Cmp>\n    __device__ __forceinline__ void reduceKeyVal(volatile K* skeys, K& key, volatile V* svals, V& val, unsigned int tid, const Cmp& cmp)\n    {\n        reduce_key_val_detail::Dispatcher<N>::reductor::template reduce<volatile K*, K&, volatile V*, V&, const Cmp&>(skeys, key, svals, val, tid, cmp);\n    }\n    template <unsigned int N,\n              typename K,\n              typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n              typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n              class Cmp>\n    __device__ __forceinline__ void reduceKeyVal(volatile K* skeys, K& key,\n                                                 const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                                 const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                 unsigned int tid, const Cmp& cmp)\n    {\n        reduce_key_val_detail::Dispatcher<N>::reductor::template reduce<volatile K*, K&,\n                const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>&,\n                const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>&,\n                const Cmp&>(skeys, key, svals, val, tid, cmp);\n    }\n    template <unsigned int N,\n              typename KP0, typename KP1, typename KP2, typename KP3, typename KP4, typename KP5, typename KP6, typename KP7, typename KP8, typename KP9,\n              typename KR0, typename KR1, typename KR2, typename KR3, typename KR4, typename KR5, typename KR6, typename KR7, typename KR8, typename KR9,\n              typename VP0, typename VP1, typename VP2, typename VP3, typename VP4, typename VP5, typename VP6, typename VP7, typename VP8, typename VP9,\n              typename VR0, typename VR1, typename VR2, typename VR3, typename VR4, typename VR5, typename VR6, typename VR7, typename VR8, typename VR9,\n              class Cmp0, class Cmp1, class Cmp2, class Cmp3, class Cmp4, class Cmp5, class Cmp6, class Cmp7, class Cmp8, class Cmp9>\n    __device__ __forceinline__ void reduceKeyVal(const thrust::tuple<KP0, KP1, KP2, KP3, KP4, KP5, KP6, KP7, KP8, KP9>& skeys,\n                                                 const thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9>& key,\n                                                 const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>& svals,\n                                                 const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>& val,\n                                                 unsigned int tid,\n                                                 const thrust::tuple<Cmp0, Cmp1, Cmp2, Cmp3, Cmp4, Cmp5, Cmp6, Cmp7, Cmp8, Cmp9>& cmp)\n    {\n        reduce_key_val_detail::Dispatcher<N>::reductor::template reduce<\n                const thrust::tuple<KP0, KP1, KP2, KP3, KP4, KP5, KP6, KP7, KP8, KP9>&,\n                const thrust::tuple<KR0, KR1, KR2, KR3, KR4, KR5, KR6, KR7, KR8, KR9>&,\n                const thrust::tuple<VP0, VP1, VP2, VP3, VP4, VP5, VP6, VP7, VP8, VP9>&,\n                const thrust::tuple<VR0, VR1, VR2, VR3, VR4, VR5, VR6, VR7, VR8, VR9>&,\n                const thrust::tuple<Cmp0, Cmp1, Cmp2, Cmp3, Cmp4, Cmp5, Cmp6, Cmp7, Cmp8, Cmp9>&\n                >(skeys, key, svals, val, tid, cmp);\n    }\n\n    // smem_tuple\n\n    template <typename T0>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*>\n    smem_tuple(T0* t0)\n    {\n        return thrust::make_tuple((volatile T0*) t0);\n    }\n\n    template <typename T0, typename T1>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*>\n    smem_tuple(T0* t0, T1* t1)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1);\n    }\n\n    template <typename T0, typename T1, typename T2>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*>\n    smem_tuple(T0* t0, T1* t1, T2* t2)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*, volatile T6*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5, T6* t6)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5, (volatile T6*) t6);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*, volatile T6*, volatile T7*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5, T6* t6, T7* t7)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5, (volatile T6*) t6, (volatile T7*) t7);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*, volatile T6*, volatile T7*, volatile T8*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5, T6* t6, T7* t7, T8* t8)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5, (volatile T6*) t6, (volatile T7*) t7, (volatile T8*) t8);\n    }\n\n    template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>\n    __device__ __forceinline__\n    thrust::tuple<volatile T0*, volatile T1*, volatile T2*, volatile T3*, volatile T4*, volatile T5*, volatile T6*, volatile T7*, volatile T8*, volatile T9*>\n    smem_tuple(T0* t0, T1* t1, T2* t2, T3* t3, T4* t4, T5* t5, T6* t6, T7* t7, T8* t8, T9* t9)\n    {\n        return thrust::make_tuple((volatile T0*) t0, (volatile T1*) t1, (volatile T2*) t2, (volatile T3*) t3, (volatile T4*) t4, (volatile T5*) t5, (volatile T6*) t6, (volatile T7*) t7, (volatile T8*) t8, (volatile T9*) t9);\n    }\n}}}\n\n//! @endcond\n\n#endif // OPENCV_CUDA_REDUCE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/saturate_cast.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_SATURATE_CAST_HPP\n#define OPENCV_CUDA_SATURATE_CAST_HPP\n\n#include \"common.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(uchar v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(schar v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(ushort v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(short v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(uint v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(int v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(float v) { return _Tp(v); }\n    template<typename _Tp> __device__ __forceinline__ _Tp saturate_cast(double v) { return _Tp(v); }\n\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(schar v)\n    {\n        uint res = 0;\n        int vi = v;\n        asm(\"cvt.sat.u8.s8 %0, %1;\" : \"=r\"(res) : \"r\"(vi));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(short v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u8.s16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(ushort v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u8.u16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(int v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u8.s32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(uint v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u8.u32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(float v)\n    {\n        uint res = 0;\n        asm(\"cvt.rni.sat.u8.f32 %0, %1;\" : \"=r\"(res) : \"f\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uchar saturate_cast<uchar>(double v)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130\n        uint res = 0;\n        asm(\"cvt.rni.sat.u8.f64 %0, %1;\" : \"=r\"(res) : \"d\"(v));\n        return res;\n    #else\n        return saturate_cast<uchar>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(uchar v)\n    {\n        uint res = 0;\n        uint vi = v;\n        asm(\"cvt.sat.s8.u8 %0, %1;\" : \"=r\"(res) : \"r\"(vi));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(short v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.s8.s16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(ushort v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.s8.u16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(int v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.s8.s32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(uint v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.s8.u32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(float v)\n    {\n        uint res = 0;\n        asm(\"cvt.rni.sat.s8.f32 %0, %1;\" : \"=r\"(res) : \"f\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ schar saturate_cast<schar>(double v)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130\n        uint res = 0;\n        asm(\"cvt.rni.sat.s8.f64 %0, %1;\" : \"=r\"(res) : \"d\"(v));\n        return res;\n    #else\n        return saturate_cast<schar>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(schar v)\n    {\n        ushort res = 0;\n        int vi = v;\n        asm(\"cvt.sat.u16.s8 %0, %1;\" : \"=h\"(res) : \"r\"(vi));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(short v)\n    {\n        ushort res = 0;\n        asm(\"cvt.sat.u16.s16 %0, %1;\" : \"=h\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(int v)\n    {\n        ushort res = 0;\n        asm(\"cvt.sat.u16.s32 %0, %1;\" : \"=h\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(uint v)\n    {\n        ushort res = 0;\n        asm(\"cvt.sat.u16.u32 %0, %1;\" : \"=h\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(float v)\n    {\n        ushort res = 0;\n        asm(\"cvt.rni.sat.u16.f32 %0, %1;\" : \"=h\"(res) : \"f\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ ushort saturate_cast<ushort>(double v)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130\n        ushort res = 0;\n        asm(\"cvt.rni.sat.u16.f64 %0, %1;\" : \"=h\"(res) : \"d\"(v));\n        return res;\n    #else\n        return saturate_cast<ushort>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ short saturate_cast<short>(ushort v)\n    {\n        short res = 0;\n        asm(\"cvt.sat.s16.u16 %0, %1;\" : \"=h\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ short saturate_cast<short>(int v)\n    {\n        short res = 0;\n        asm(\"cvt.sat.s16.s32 %0, %1;\" : \"=h\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ short saturate_cast<short>(uint v)\n    {\n        short res = 0;\n        asm(\"cvt.sat.s16.u32 %0, %1;\" : \"=h\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ short saturate_cast<short>(float v)\n    {\n        short res = 0;\n        asm(\"cvt.rni.sat.s16.f32 %0, %1;\" : \"=h\"(res) : \"f\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ short saturate_cast<short>(double v)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130\n        short res = 0;\n        asm(\"cvt.rni.sat.s16.f64 %0, %1;\" : \"=h\"(res) : \"d\"(v));\n        return res;\n    #else\n        return saturate_cast<short>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ int saturate_cast<int>(uint v)\n    {\n        int res = 0;\n        asm(\"cvt.sat.s32.u32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ int saturate_cast<int>(float v)\n    {\n        return __float2int_rn(v);\n    }\n    template<> __device__ __forceinline__ int saturate_cast<int>(double v)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130\n        return __double2int_rn(v);\n    #else\n        return saturate_cast<int>((float)v);\n    #endif\n    }\n\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(schar v)\n    {\n        uint res = 0;\n        int vi = v;\n        asm(\"cvt.sat.u32.s8 %0, %1;\" : \"=r\"(res) : \"r\"(vi));\n        return res;\n    }\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(short v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u32.s16 %0, %1;\" : \"=r\"(res) : \"h\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(int v)\n    {\n        uint res = 0;\n        asm(\"cvt.sat.u32.s32 %0, %1;\" : \"=r\"(res) : \"r\"(v));\n        return res;\n    }\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(float v)\n    {\n        return __float2uint_rn(v);\n    }\n    template<> __device__ __forceinline__ uint saturate_cast<uint>(double v)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130\n        return __double2uint_rn(v);\n    #else\n        return saturate_cast<uint>((float)v);\n    #endif\n    }\n}}}\n\n//! @endcond\n\n#endif /* OPENCV_CUDA_SATURATE_CAST_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/scan.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_SCAN_HPP\n#define OPENCV_CUDA_SCAN_HPP\n\n#include \"opencv2/core/cuda/common.hpp\"\n#include \"opencv2/core/cuda/utility.hpp\"\n#include \"opencv2/core/cuda/warp.hpp\"\n#include \"opencv2/core/cuda/warp_shuffle.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    enum ScanKind { EXCLUSIVE = 0,  INCLUSIVE = 1 };\n\n    template <ScanKind Kind, typename T, typename F> struct WarpScan\n    {\n        __device__ __forceinline__ WarpScan() {}\n        __device__ __forceinline__ WarpScan(const WarpScan& other) { CV_UNUSED(other); }\n\n        __device__ __forceinline__ T operator()( volatile T *ptr , const unsigned int idx)\n        {\n            const unsigned int lane = idx & 31;\n            F op;\n\n            if ( lane >=  1) ptr [idx ] = op(ptr [idx -  1], ptr [idx]);\n            if ( lane >=  2) ptr [idx ] = op(ptr [idx -  2], ptr [idx]);\n            if ( lane >=  4) ptr [idx ] = op(ptr [idx -  4], ptr [idx]);\n            if ( lane >=  8) ptr [idx ] = op(ptr [idx -  8], ptr [idx]);\n            if ( lane >= 16) ptr [idx ] = op(ptr [idx - 16], ptr [idx]);\n\n            if( Kind == INCLUSIVE )\n                return ptr [idx];\n            else\n                return (lane > 0) ? ptr [idx - 1] : 0;\n        }\n\n        __device__ __forceinline__ unsigned int index(const unsigned int tid)\n        {\n            return tid;\n        }\n\n        __device__ __forceinline__ void init(volatile T *ptr){}\n\n        static const int warp_offset      = 0;\n\n        typedef WarpScan<INCLUSIVE, T, F>  merge;\n    };\n\n    template <ScanKind Kind , typename T, typename F> struct WarpScanNoComp\n    {\n        __device__ __forceinline__ WarpScanNoComp() {}\n        __device__ __forceinline__ WarpScanNoComp(const WarpScanNoComp& other) { CV_UNUSED(other); }\n\n        __device__ __forceinline__ T operator()( volatile T *ptr , const unsigned int idx)\n        {\n            const unsigned int lane = threadIdx.x & 31;\n            F op;\n\n            ptr [idx ] = op(ptr [idx -  1], ptr [idx]);\n            ptr [idx ] = op(ptr [idx -  2], ptr [idx]);\n            ptr [idx ] = op(ptr [idx -  4], ptr [idx]);\n            ptr [idx ] = op(ptr [idx -  8], ptr [idx]);\n            ptr [idx ] = op(ptr [idx - 16], ptr [idx]);\n\n            if( Kind == INCLUSIVE )\n                return ptr [idx];\n            else\n                return (lane > 0) ? ptr [idx - 1] : 0;\n        }\n\n        __device__ __forceinline__ unsigned int index(const unsigned int tid)\n        {\n            return (tid >> warp_log) * warp_smem_stride + 16 + (tid & warp_mask);\n        }\n\n        __device__ __forceinline__ void init(volatile T *ptr)\n        {\n            ptr[threadIdx.x] = 0;\n        }\n\n        static const int warp_smem_stride = 32 + 16 + 1;\n        static const int warp_offset      = 16;\n        static const int warp_log         = 5;\n        static const int warp_mask        = 31;\n\n        typedef WarpScanNoComp<INCLUSIVE, T, F> merge;\n    };\n\n    template <ScanKind Kind , typename T, typename Sc, typename F> struct BlockScan\n    {\n        __device__ __forceinline__ BlockScan() {}\n        __device__ __forceinline__ BlockScan(const BlockScan& other) { CV_UNUSED(other); }\n\n        __device__ __forceinline__ T operator()(volatile T *ptr)\n        {\n            const unsigned int tid  = threadIdx.x;\n            const unsigned int lane = tid & warp_mask;\n            const unsigned int warp = tid >> warp_log;\n\n            Sc scan;\n            typename Sc::merge merge_scan;\n            const unsigned int idx = scan.index(tid);\n\n            T val = scan(ptr, idx);\n            __syncthreads ();\n\n            if( warp == 0)\n                scan.init(ptr);\n            __syncthreads ();\n\n            if( lane == 31 )\n                ptr [scan.warp_offset + warp ] = (Kind == INCLUSIVE) ? val : ptr [idx];\n            __syncthreads ();\n\n            if( warp == 0 )\n                merge_scan(ptr, idx);\n            __syncthreads();\n\n            if ( warp > 0)\n                val = ptr [scan.warp_offset + warp - 1] + val;\n            __syncthreads ();\n\n            ptr[idx] = val;\n            __syncthreads ();\n\n            return val ;\n        }\n\n        static const int warp_log  = 5;\n        static const int warp_mask = 31;\n    };\n\n    template <typename T>\n    __device__ T warpScanInclusive(T idata, volatile T* s_Data, unsigned int tid)\n    {\n    #if __CUDA_ARCH__ >= 300\n        const unsigned int laneId = cv::cuda::device::Warp::laneId();\n\n        // scan on shuffl functions\n        #pragma unroll\n        for (int i = 1; i <= (OPENCV_CUDA_WARP_SIZE / 2); i *= 2)\n        {\n            const T n = cv::cuda::device::shfl_up(idata, i);\n            if (laneId >= i)\n                  idata += n;\n        }\n\n        return idata;\n    #else\n        unsigned int pos = 2 * tid - (tid & (OPENCV_CUDA_WARP_SIZE - 1));\n        s_Data[pos] = 0;\n        pos += OPENCV_CUDA_WARP_SIZE;\n        s_Data[pos] = idata;\n\n        s_Data[pos] += s_Data[pos - 1];\n        s_Data[pos] += s_Data[pos - 2];\n        s_Data[pos] += s_Data[pos - 4];\n        s_Data[pos] += s_Data[pos - 8];\n        s_Data[pos] += s_Data[pos - 16];\n\n        return s_Data[pos];\n    #endif\n    }\n\n    template <typename T>\n    __device__ __forceinline__ T warpScanExclusive(T idata, volatile T* s_Data, unsigned int tid)\n    {\n        return warpScanInclusive(idata, s_Data, tid) - idata;\n    }\n\n    template <int tiNumScanThreads, typename T>\n    __device__ T blockScanInclusive(T idata, volatile T* s_Data, unsigned int tid)\n    {\n        if (tiNumScanThreads > OPENCV_CUDA_WARP_SIZE)\n        {\n            //Bottom-level inclusive warp scan\n            T warpResult = warpScanInclusive(idata, s_Data, tid);\n\n            //Save top elements of each warp for exclusive warp scan\n            //sync to wait for warp scans to complete (because s_Data is being overwritten)\n            __syncthreads();\n            if ((tid & (OPENCV_CUDA_WARP_SIZE - 1)) == (OPENCV_CUDA_WARP_SIZE - 1))\n            {\n                s_Data[tid >> OPENCV_CUDA_LOG_WARP_SIZE] = warpResult;\n            }\n\n            //wait for warp scans to complete\n            __syncthreads();\n\n            if (tid < (tiNumScanThreads / OPENCV_CUDA_WARP_SIZE) )\n            {\n                //grab top warp elements\n                T val = s_Data[tid];\n                //calculate exclusive scan and write back to shared memory\n                s_Data[tid] = warpScanExclusive(val, s_Data, tid);\n            }\n\n            //return updated warp scans with exclusive scan results\n            __syncthreads();\n\n            return warpResult + s_Data[tid >> OPENCV_CUDA_LOG_WARP_SIZE];\n        }\n        else\n        {\n            return warpScanInclusive(idata, s_Data, tid);\n        }\n    }\n}}}\n\n//! @endcond\n\n#endif // OPENCV_CUDA_SCAN_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/simd_functions.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n/*\n * Copyright (c) 2013 NVIDIA Corporation. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n *   Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n *\n *   Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n *\n *   Neither the name of NVIDIA Corporation nor the names of its contributors\n *   may be used to endorse or promote products derived from this software\n *   without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef OPENCV_CUDA_SIMD_FUNCTIONS_HPP\n#define OPENCV_CUDA_SIMD_FUNCTIONS_HPP\n\n#include \"common.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    // 2\n\n    static __device__ __forceinline__ unsigned int vadd2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vadd2.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vadd.u32.u32.u32.sat %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vadd.u32.u32.u32.sat %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = a ^ b;          // sum bits\n        r = a + b;          // actual sum\n        s = s ^ r;          // determine carry-ins for each bit position\n        s = s & 0x00010000; // carry-in to high word (= carry-out from low word)\n        r = r - s;          // subtract out carry-out from low word\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsub2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vsub2.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vsub.u32.u32.u32.sat %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vsub.u32.u32.u32.sat %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = a ^ b;          // sum bits\n        r = a - b;          // actual sum\n        s = s ^ r;          // determine carry-ins for each bit position\n        s = s & 0x00010000; // borrow to high word\n        r = r + s;          // compensate for borrow from low word\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vabsdiff2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vabsdiff2.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vabsdiff.u32.u32.u32.sat %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vabsdiff.u32.u32.u32.sat %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t, u, v;\n        s = a & 0x0000ffff; // extract low halfword\n        r = b & 0x0000ffff; // extract low halfword\n        u = ::max(r, s);    // maximum of low halfwords\n        v = ::min(r, s);    // minimum of low halfwords\n        s = a & 0xffff0000; // extract high halfword\n        r = b & 0xffff0000; // extract high halfword\n        t = ::max(r, s);    // maximum of high halfwords\n        s = ::min(r, s);    // minimum of high halfwords\n        r = u | t;          // maximum of both halfwords\n        s = v | s;          // minimum of both halfwords\n        r = r - s;          // |a - b| = max(a,b) - min(a,b);\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vavg2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, s;\n\n        // HAKMEM #23: a + b = 2 * (a & b) + (a ^ b) ==>\n        // (a + b) / 2 = (a & b) + ((a ^ b) >> 1)\n        s = a ^ b;\n        r = a & b;\n        s = s & 0xfffefffe; // ensure shift doesn't cross halfword boundaries\n        s = s >> 1;\n        s = r + s;\n\n        return s;\n    }\n\n    static __device__ __forceinline__ unsigned int vavrg2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vavrg2.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // HAKMEM #23: a + b = 2 * (a | b) - (a ^ b) ==>\n        // (a + b + 1) / 2 = (a | b) - ((a ^ b) >> 1)\n        unsigned int s;\n        s = a ^ b;\n        r = a | b;\n        s = s & 0xfffefffe; // ensure shift doesn't cross half-word boundaries\n        s = s >> 1;\n        r = r - s;\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vseteq2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.eq %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        unsigned int c;\n        r = a ^ b;          // 0x0000 if a == b\n        c = r | 0x80008000; // set msbs, to catch carry out\n        r = r ^ c;          // extract msbs, msb = 1 if r < 0x8000\n        c = c - 0x00010001; // msb = 0, if r was 0x0000 or 0x8000\n        c = r & ~c;         // msb = 1, if r was 0x0000\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpeq2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vseteq2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        r = a ^ b;          // 0x0000 if a == b\n        c = r | 0x80008000; // set msbs, to catch carry out\n        r = r ^ c;          // extract msbs, msb = 1 if r < 0x8000\n        c = c - 0x00010001; // msb = 0, if r was 0x0000 or 0x8000\n        c = r & ~c;         // msb = 1, if r was 0x0000\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetge2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.ge %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavrg2(a, b);   // (a + ~b + 1) / 2 = (a - b) / 2\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpge2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetge2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavrg2(a, b);   // (a + ~b + 1) / 2 = (a - b) / 2\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetgt2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.gt %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavg2(a, b);    // (a + ~b) / 2 = (a - b) / 2 [rounded down]\n        c = c & 0x80008000; // msbs = carry-outs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpgt2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetgt2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavg2(a, b);    // (a + ~b) / 2 = (a - b) / 2 [rounded down]\n        c = c & 0x80008000; // msbs = carry-outs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetle2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.le %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavrg2(a, b);   // (b + ~a + 1) / 2 = (b - a) / 2\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmple2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetle2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavrg2(a, b);   // (b + ~a + 1) / 2 = (b - a) / 2\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetlt2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset2.u32.u32.lt %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavg2(a, b);    // (b + ~a) / 2 = (b - a) / 2 [rounded down]\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmplt2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetlt2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavg2(a, b);    // (b + ~a) / 2 = (b - a) / 2 [rounded down]\n        c = c & 0x80008000; // msb = carry-outs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetne2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm (\"vset2.u32.u32.ne %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        unsigned int c;\n        r = a ^ b;          // 0x0000 if a == b\n        c = r | 0x80008000; // set msbs, to catch carry out\n        c = c - 0x00010001; // msb = 0, if r was 0x0000 or 0x8000\n        c = r | c;          // msb = 1, if r was not 0x0000\n        c = c & 0x80008000; // extract msbs\n        r = c >> 15;        // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpne2(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetne2(a, b);\n        c = r << 16;        // convert bool\n        r = c - r;          //  into mask\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        r = a ^ b;          // 0x0000 if a == b\n        c = r | 0x80008000; // set msbs, to catch carry out\n        c = c - 0x00010001; // msb = 0, if r was 0x0000 or 0x8000\n        c = r | c;          // msb = 1, if r was not 0x0000\n        c = c & 0x80008000; // extract msbs\n        r = c >> 15;        // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vmax2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vmax2.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vmax.u32.u32.u32 %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmax.u32.u32.u32 %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t, u;\n        r = a & 0x0000ffff; // extract low halfword\n        s = b & 0x0000ffff; // extract low halfword\n        t = ::max(r, s);    // maximum of low halfwords\n        r = a & 0xffff0000; // extract high halfword\n        s = b & 0xffff0000; // extract high halfword\n        u = ::max(r, s);    // maximum of high halfwords\n        r = t | u;          // combine halfword maximums\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vmin2(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vmin2.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vmin.u32.u32.u32 %0.h0, %1.h0, %2.h0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmin.u32.u32.u32 %0.h1, %1.h1, %2.h1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t, u;\n        r = a & 0x0000ffff; // extract low halfword\n        s = b & 0x0000ffff; // extract low halfword\n        t = ::min(r, s);    // minimum of low halfwords\n        r = a & 0xffff0000; // extract high halfword\n        s = b & 0xffff0000; // extract high halfword\n        u = ::min(r, s);    // minimum of high halfwords\n        r = t | u;          // combine halfword minimums\n    #endif\n\n        return r;\n    }\n\n    // 4\n\n    static __device__ __forceinline__ unsigned int vadd4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vadd4.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vadd.u32.u32.u32.sat %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vadd.u32.u32.u32.sat %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vadd.u32.u32.u32.sat %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vadd.u32.u32.u32.sat %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t;\n        s = a ^ b;          // sum bits\n        r = a & 0x7f7f7f7f; // clear msbs\n        t = b & 0x7f7f7f7f; // clear msbs\n        s = s & 0x80808080; // msb sum bits\n        r = r + t;          // add without msbs, record carry-out in msbs\n        r = r ^ s;          // sum of msb sum and carry-in bits, w/o carry-out\n    #endif /* __CUDA_ARCH__ >= 300 */\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsub4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vsub4.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vsub.u32.u32.u32.sat %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vsub.u32.u32.u32.sat %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vsub.u32.u32.u32.sat %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vsub.u32.u32.u32.sat %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s, t;\n        s = a ^ ~b;         // inverted sum bits\n        r = a | 0x80808080; // set msbs\n        t = b & 0x7f7f7f7f; // clear msbs\n        s = s & 0x80808080; // inverted msb sum bits\n        r = r - t;          // subtract w/o msbs, record inverted borrows in msb\n        r = r ^ s;          // combine inverted msb sum bits and borrows\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vavg4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, s;\n\n        // HAKMEM #23: a + b = 2 * (a & b) + (a ^ b) ==>\n        // (a + b) / 2 = (a & b) + ((a ^ b) >> 1)\n        s = a ^ b;\n        r = a & b;\n        s = s & 0xfefefefe; // ensure following shift doesn't cross byte boundaries\n        s = s >> 1;\n        s = r + s;\n\n        return s;\n    }\n\n    static __device__ __forceinline__ unsigned int vavrg4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vavrg4.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // HAKMEM #23: a + b = 2 * (a | b) - (a ^ b) ==>\n        // (a + b + 1) / 2 = (a | b) - ((a ^ b) >> 1)\n        unsigned int c;\n        c = a ^ b;\n        r = a | b;\n        c = c & 0xfefefefe; // ensure following shift doesn't cross byte boundaries\n        c = c >> 1;\n        r = r - c;\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vseteq4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.eq %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        unsigned int c;\n        r = a ^ b;          // 0x00 if a == b\n        c = r | 0x80808080; // set msbs, to catch carry out\n        r = r ^ c;          // extract msbs, msb = 1 if r < 0x80\n        c = c - 0x01010101; // msb = 0, if r was 0x00 or 0x80\n        c = r & ~c;         // msb = 1, if r was 0x00\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpeq4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, t;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vseteq4(a, b);\n        t = r << 8;         // convert bool\n        r = t - r;          //  to mask\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        t = a ^ b;          // 0x00 if a == b\n        r = t | 0x80808080; // set msbs, to catch carry out\n        t = t ^ r;          // extract msbs, msb = 1 if t < 0x80\n        r = r - 0x01010101; // msb = 0, if t was 0x00 or 0x80\n        r = t & ~r;         // msb = 1, if t was 0x00\n        t = r >> 7;         // build mask\n        t = r - t;          //  from\n        r = t | r;          //   msbs\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetle4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.le %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavrg4(a, b);   // (b + ~a + 1) / 2 = (b - a) / 2\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmple4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetle4(a, b);\n        c = r << 8;         // convert bool\n        r = c - r;          //  to mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavrg4(a, b);   // (b + ~a + 1) / 2 = (b - a) / 2\n        c = c & 0x80808080; // msbs = carry-outs\n        r = c >> 7;         // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetlt4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.lt %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavg4(a, b);    // (b + ~a) / 2 = (b - a) / 2 [rounded down]\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmplt4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetlt4(a, b);\n        c = r << 8;         // convert bool\n        r = c - r;          //  to mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(a));\n        c = vavg4(a, b);    // (b + ~a) / 2 = (b - a) / 2 [rounded down]\n        c = c & 0x80808080; // msbs = carry-outs\n        r = c >> 7;         // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetge4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.ge %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavrg4(a, b);   // (a + ~b + 1) / 2 = (a - b) / 2\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpge4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, s;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetge4(a, b);\n        s = r << 8;         // convert bool\n        r = s - r;          //  to mask\n    #else\n        asm (\"not.b32 %0,%0;\" : \"+r\"(b));\n        r = vavrg4 (a, b);  // (a + ~b + 1) / 2 = (a - b) / 2\n        r = r & 0x80808080; // msb = carry-outs\n        s = r >> 7;         // build mask\n        s = r - s;          //  from\n        r = s | r;          //   msbs\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetgt4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.gt %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int c;\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavg4(a, b);    // (a + ~b) / 2 = (a - b) / 2 [rounded down]\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpgt4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetgt4(a, b);\n        c = r << 8;         // convert bool\n        r = c - r;          //  to mask\n    #else\n        asm(\"not.b32 %0, %0;\" : \"+r\"(b));\n        c = vavg4(a, b);    // (a + ~b) / 2 = (a - b) / 2 [rounded down]\n        c = c & 0x80808080; // msb = carry-outs\n        r = c >> 7;         // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vsetne4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vset4.u32.u32.ne %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        unsigned int c;\n        r = a ^ b;          // 0x00 if a == b\n        c = r | 0x80808080; // set msbs, to catch carry out\n        c = c - 0x01010101; // msb = 0, if r was 0x00 or 0x80\n        c = r | c;          // msb = 1, if r was not 0x00\n        c = c & 0x80808080; // extract msbs\n        r = c >> 7;         // convert to bool\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vcmpne4(unsigned int a, unsigned int b)\n    {\n        unsigned int r, c;\n\n    #if __CUDA_ARCH__ >= 300\n        r = vsetne4(a, b);\n        c = r << 8;         // convert bool\n        r = c - r;          //  to mask\n    #else\n        // inspired by Alan Mycroft's null-byte detection algorithm:\n        // null_byte(x) = ((x - 0x01010101) & (~x & 0x80808080))\n        r = a ^ b;          // 0x00 if a == b\n        c = r | 0x80808080; // set msbs, to catch carry out\n        c = c - 0x01010101; // msb = 0, if r was 0x00 or 0x80\n        c = r | c;          // msb = 1, if r was not 0x00\n        c = c & 0x80808080; // extract msbs\n        r = c >> 7;         // convert\n        r = c - r;          //  msbs to\n        r = c | r;          //   mask\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vabsdiff4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vabsdiff4.u32.u32.u32.sat %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vabsdiff.u32.u32.u32.sat %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vabsdiff.u32.u32.u32.sat %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vabsdiff.u32.u32.u32.sat %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vabsdiff.u32.u32.u32.sat %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = vcmpge4(a, b);  // mask = 0xff if a >= b\n        r = a ^ b;          //\n        s = (r &  s) ^ b;   // select a when a >= b, else select b => max(a,b)\n        r = s ^ r;          // select a when b >= a, else select b => min(a,b)\n        r = s - r;          // |a - b| = max(a,b) - min(a,b);\n    #endif\n\n        return r;\n    }\n\n    static __device__ __forceinline__ unsigned int vmax4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vmax4.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vmax.u32.u32.u32 %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmax.u32.u32.u32 %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmax.u32.u32.u32 %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmax.u32.u32.u32 %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = vcmpge4(a, b);  // mask = 0xff if a >= b\n        r = a & s;          // select a when b >= a\n        s = b & ~s;         // select b when b < a\n        r = r | s;          // combine byte selections\n    #endif\n\n        return r;           // byte-wise unsigned maximum\n    }\n\n    static __device__ __forceinline__ unsigned int vmin4(unsigned int a, unsigned int b)\n    {\n        unsigned int r = 0;\n\n    #if __CUDA_ARCH__ >= 300\n        asm(\"vmin4.u32.u32.u32 %0, %1, %2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #elif __CUDA_ARCH__ >= 200\n        asm(\"vmin.u32.u32.u32 %0.b0, %1.b0, %2.b0, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmin.u32.u32.u32 %0.b1, %1.b1, %2.b1, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmin.u32.u32.u32 %0.b2, %1.b2, %2.b2, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n        asm(\"vmin.u32.u32.u32 %0.b3, %1.b3, %2.b3, %3;\" : \"=r\"(r) : \"r\"(a), \"r\"(b), \"r\"(r));\n    #else\n        unsigned int s;\n        s = vcmpge4(b, a);  // mask = 0xff if a >= b\n        r = a & s;          // select a when b >= a\n        s = b & ~s;         // select b when b < a\n        r = r | s;          // combine byte selections\n    #endif\n\n        return r;\n    }\n}}}\n\n//! @endcond\n\n#endif // OPENCV_CUDA_SIMD_FUNCTIONS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/transform.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_TRANSFORM_HPP\n#define OPENCV_CUDA_TRANSFORM_HPP\n\n#include \"common.hpp\"\n#include \"utility.hpp\"\n#include \"detail/transform_detail.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template <typename T, typename D, typename UnOp, typename Mask>\n    static inline void transform(PtrStepSz<T> src, PtrStepSz<D> dst, UnOp op, const Mask& mask, cudaStream_t stream)\n    {\n        typedef TransformFunctorTraits<UnOp> ft;\n        transform_detail::TransformDispatcher<VecTraits<T>::cn == 1 && VecTraits<D>::cn == 1 && ft::smart_shift != 1>::call(src, dst, op, mask, stream);\n    }\n\n    template <typename T1, typename T2, typename D, typename BinOp, typename Mask>\n    static inline void transform(PtrStepSz<T1> src1, PtrStepSz<T2> src2, PtrStepSz<D> dst, BinOp op, const Mask& mask, cudaStream_t stream)\n    {\n        typedef TransformFunctorTraits<BinOp> ft;\n        transform_detail::TransformDispatcher<VecTraits<T1>::cn == 1 && VecTraits<T2>::cn == 1 && VecTraits<D>::cn == 1 && ft::smart_shift != 1>::call(src1, src2, dst, op, mask, stream);\n    }\n}}}\n\n//! @endcond\n\n#endif // OPENCV_CUDA_TRANSFORM_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/type_traits.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_TYPE_TRAITS_HPP\n#define OPENCV_CUDA_TYPE_TRAITS_HPP\n\n#include \"detail/type_traits_detail.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template <typename T> struct IsSimpleParameter\n    {\n        enum {value = type_traits_detail::IsIntegral<T>::value || type_traits_detail::IsFloat<T>::value ||\n            type_traits_detail::PointerTraits<typename type_traits_detail::ReferenceTraits<T>::type>::value};\n    };\n\n    template <typename T> struct TypeTraits\n    {\n        typedef typename type_traits_detail::UnConst<T>::type                                                NonConstType;\n        typedef typename type_traits_detail::UnVolatile<T>::type                                             NonVolatileType;\n        typedef typename type_traits_detail::UnVolatile<typename type_traits_detail::UnConst<T>::type>::type UnqualifiedType;\n        typedef typename type_traits_detail::PointerTraits<UnqualifiedType>::type                            PointeeType;\n        typedef typename type_traits_detail::ReferenceTraits<T>::type                                        ReferredType;\n\n        enum { isConst          = type_traits_detail::UnConst<T>::value };\n        enum { isVolatile       = type_traits_detail::UnVolatile<T>::value };\n\n        enum { isReference      = type_traits_detail::ReferenceTraits<UnqualifiedType>::value };\n        enum { isPointer        = type_traits_detail::PointerTraits<typename type_traits_detail::ReferenceTraits<UnqualifiedType>::type>::value };\n\n        enum { isUnsignedInt    = type_traits_detail::IsUnsignedIntegral<UnqualifiedType>::value };\n        enum { isSignedInt      = type_traits_detail::IsSignedIntergral<UnqualifiedType>::value };\n        enum { isIntegral       = type_traits_detail::IsIntegral<UnqualifiedType>::value };\n        enum { isFloat          = type_traits_detail::IsFloat<UnqualifiedType>::value };\n        enum { isArith          = isIntegral || isFloat };\n        enum { isVec            = type_traits_detail::IsVec<UnqualifiedType>::value };\n\n        typedef typename type_traits_detail::Select<IsSimpleParameter<UnqualifiedType>::value,\n            T, typename type_traits_detail::AddParameterType<T>::type>::type ParameterType;\n    };\n}}}\n\n//! @endcond\n\n#endif // OPENCV_CUDA_TYPE_TRAITS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/utility.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_UTILITY_HPP\n#define OPENCV_CUDA_UTILITY_HPP\n\n#include \"saturate_cast.hpp\"\n#include \"datamov_utils.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    struct CV_EXPORTS ThrustAllocator\n    {\n        typedef uchar value_type;\n        virtual ~ThrustAllocator();\n        virtual __device__ __host__ uchar* allocate(size_t numBytes) = 0;\n        virtual __device__ __host__ void deallocate(uchar* ptr, size_t numBytes) = 0;\n        static ThrustAllocator& getAllocator();\n        static void setAllocator(ThrustAllocator* allocator);\n    };\n    #define OPENCV_CUDA_LOG_WARP_SIZE        (5)\n    #define OPENCV_CUDA_WARP_SIZE            (1 << OPENCV_CUDA_LOG_WARP_SIZE)\n    #define OPENCV_CUDA_LOG_MEM_BANKS        ((__CUDA_ARCH__ >= 200) ? 5 : 4) // 32 banks on fermi, 16 on tesla\n    #define OPENCV_CUDA_MEM_BANKS            (1 << OPENCV_CUDA_LOG_MEM_BANKS)\n\n    ///////////////////////////////////////////////////////////////////////////////\n    // swap\n\n    template <typename T> void __device__ __host__ __forceinline__ swap(T& a, T& b)\n    {\n        const T temp = a;\n        a = b;\n        b = temp;\n    }\n\n    ///////////////////////////////////////////////////////////////////////////////\n    // Mask Reader\n\n    struct SingleMask\n    {\n        explicit __host__ __device__ __forceinline__ SingleMask(PtrStepb mask_) : mask(mask_) {}\n        __host__ __device__ __forceinline__ SingleMask(const SingleMask& mask_): mask(mask_.mask){}\n\n        __device__ __forceinline__ bool operator()(int y, int x) const\n        {\n            return mask.ptr(y)[x] != 0;\n        }\n\n        PtrStepb mask;\n    };\n\n    struct SingleMaskChannels\n    {\n        __host__ __device__ __forceinline__ SingleMaskChannels(PtrStepb mask_, int channels_)\n        : mask(mask_), channels(channels_) {}\n        __host__ __device__ __forceinline__ SingleMaskChannels(const SingleMaskChannels& mask_)\n            :mask(mask_.mask), channels(mask_.channels){}\n\n        __device__ __forceinline__ bool operator()(int y, int x) const\n        {\n            return mask.ptr(y)[x / channels] != 0;\n        }\n\n        PtrStepb mask;\n        int channels;\n    };\n\n    struct MaskCollection\n    {\n        explicit __host__ __device__ __forceinline__ MaskCollection(PtrStepb* maskCollection_)\n            : maskCollection(maskCollection_) {}\n\n        __device__ __forceinline__ MaskCollection(const MaskCollection& masks_)\n            : maskCollection(masks_.maskCollection), curMask(masks_.curMask){}\n\n        __device__ __forceinline__ void next()\n        {\n            curMask = *maskCollection++;\n        }\n        __device__ __forceinline__ void setMask(int z)\n        {\n            curMask = maskCollection[z];\n        }\n\n        __device__ __forceinline__ bool operator()(int y, int x) const\n        {\n            uchar val;\n            return curMask.data == 0 || (ForceGlob<uchar>::Load(curMask.ptr(y), x, val), (val != 0));\n        }\n\n        const PtrStepb* maskCollection;\n        PtrStepb curMask;\n    };\n\n    struct WithOutMask\n    {\n        __host__ __device__ __forceinline__ WithOutMask(){}\n        __host__ __device__ __forceinline__ WithOutMask(const WithOutMask&){}\n\n        __device__ __forceinline__ void next() const\n        {\n        }\n        __device__ __forceinline__ void setMask(int) const\n        {\n        }\n\n        __device__ __forceinline__ bool operator()(int, int) const\n        {\n            return true;\n        }\n\n        __device__ __forceinline__ bool operator()(int, int, int) const\n        {\n            return true;\n        }\n\n        static __device__ __forceinline__ bool check(int, int)\n        {\n            return true;\n        }\n\n        static __device__ __forceinline__ bool check(int, int, int)\n        {\n            return true;\n        }\n    };\n\n    ///////////////////////////////////////////////////////////////////////////////\n    // Solve linear system\n\n    // solve 2x2 linear system Ax=b\n    template <typename T> __device__ __forceinline__ bool solve2x2(const T A[2][2], const T b[2], T x[2])\n    {\n        T det = A[0][0] * A[1][1] - A[1][0] * A[0][1];\n\n        if (det != 0)\n        {\n            double invdet = 1.0 / det;\n\n            x[0] = saturate_cast<T>(invdet * (b[0] * A[1][1] - b[1] * A[0][1]));\n\n            x[1] = saturate_cast<T>(invdet * (A[0][0] * b[1] - A[1][0] * b[0]));\n\n            return true;\n        }\n\n        return false;\n    }\n\n    // solve 3x3 linear system Ax=b\n    template <typename T> __device__ __forceinline__ bool solve3x3(const T A[3][3], const T b[3], T x[3])\n    {\n        T det = A[0][0] * (A[1][1] * A[2][2] - A[1][2] * A[2][1])\n              - A[0][1] * (A[1][0] * A[2][2] - A[1][2] * A[2][0])\n              + A[0][2] * (A[1][0] * A[2][1] - A[1][1] * A[2][0]);\n\n        if (det != 0)\n        {\n            double invdet = 1.0 / det;\n\n            x[0] = saturate_cast<T>(invdet *\n                (b[0]    * (A[1][1] * A[2][2] - A[1][2] * A[2][1]) -\n                 A[0][1] * (b[1]    * A[2][2] - A[1][2] * b[2]   ) +\n                 A[0][2] * (b[1]    * A[2][1] - A[1][1] * b[2]   )));\n\n            x[1] = saturate_cast<T>(invdet *\n                (A[0][0] * (b[1]    * A[2][2] - A[1][2] * b[2]   ) -\n                 b[0]    * (A[1][0] * A[2][2] - A[1][2] * A[2][0]) +\n                 A[0][2] * (A[1][0] * b[2]    - b[1]    * A[2][0])));\n\n            x[2] = saturate_cast<T>(invdet *\n                (A[0][0] * (A[1][1] * b[2]    - b[1]    * A[2][1]) -\n                 A[0][1] * (A[1][0] * b[2]    - b[1]    * A[2][0]) +\n                 b[0]    * (A[1][0] * A[2][1] - A[1][1] * A[2][0])));\n\n            return true;\n        }\n\n        return false;\n    }\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_UTILITY_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/vec_distance.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_VEC_DISTANCE_HPP\n#define OPENCV_CUDA_VEC_DISTANCE_HPP\n\n#include \"reduce.hpp\"\n#include \"functional.hpp\"\n#include \"detail/vec_distance_detail.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template <typename T> struct L1Dist\n    {\n        typedef int value_type;\n        typedef int result_type;\n\n        __device__ __forceinline__ L1Dist() : mySum(0) {}\n\n        __device__ __forceinline__ void reduceIter(int val1, int val2)\n        {\n            mySum = __sad(val1, val2, mySum);\n        }\n\n        template <int THREAD_DIM> __device__ __forceinline__ void reduceAll(int* smem, int tid)\n        {\n            reduce<THREAD_DIM>(smem, mySum, tid, plus<int>());\n        }\n\n        __device__ __forceinline__ operator int() const\n        {\n            return mySum;\n        }\n\n        int mySum;\n    };\n    template <> struct L1Dist<float>\n    {\n        typedef float value_type;\n        typedef float result_type;\n\n        __device__ __forceinline__ L1Dist() : mySum(0.0f) {}\n\n        __device__ __forceinline__ void reduceIter(float val1, float val2)\n        {\n            mySum += ::fabs(val1 - val2);\n        }\n\n        template <int THREAD_DIM> __device__ __forceinline__ void reduceAll(float* smem, int tid)\n        {\n            reduce<THREAD_DIM>(smem, mySum, tid, plus<float>());\n        }\n\n        __device__ __forceinline__ operator float() const\n        {\n            return mySum;\n        }\n\n        float mySum;\n    };\n\n    struct L2Dist\n    {\n        typedef float value_type;\n        typedef float result_type;\n\n        __device__ __forceinline__ L2Dist() : mySum(0.0f) {}\n\n        __device__ __forceinline__ void reduceIter(float val1, float val2)\n        {\n            float reg = val1 - val2;\n            mySum += reg * reg;\n        }\n\n        template <int THREAD_DIM> __device__ __forceinline__ void reduceAll(float* smem, int tid)\n        {\n            reduce<THREAD_DIM>(smem, mySum, tid, plus<float>());\n        }\n\n        __device__ __forceinline__ operator float() const\n        {\n            return sqrtf(mySum);\n        }\n\n        float mySum;\n    };\n\n    struct HammingDist\n    {\n        typedef int value_type;\n        typedef int result_type;\n\n        __device__ __forceinline__ HammingDist() : mySum(0) {}\n\n        __device__ __forceinline__ void reduceIter(int val1, int val2)\n        {\n            mySum += __popc(val1 ^ val2);\n        }\n\n        template <int THREAD_DIM> __device__ __forceinline__ void reduceAll(int* smem, int tid)\n        {\n            reduce<THREAD_DIM>(smem, mySum, tid, plus<int>());\n        }\n\n        __device__ __forceinline__ operator int() const\n        {\n            return mySum;\n        }\n\n        int mySum;\n    };\n\n    // calc distance between two vectors in global memory\n    template <int THREAD_DIM, typename Dist, typename T1, typename T2>\n    __device__ void calcVecDiffGlobal(const T1* vec1, const T2* vec2, int len, Dist& dist, typename Dist::result_type* smem, int tid)\n    {\n        for (int i = tid; i < len; i += THREAD_DIM)\n        {\n            T1 val1;\n            ForceGlob<T1>::Load(vec1, i, val1);\n\n            T2 val2;\n            ForceGlob<T2>::Load(vec2, i, val2);\n\n            dist.reduceIter(val1, val2);\n        }\n\n        dist.reduceAll<THREAD_DIM>(smem, tid);\n    }\n\n    // calc distance between two vectors, first vector is cached in register or shared memory, second vector is in global memory\n    template <int THREAD_DIM, int MAX_LEN, bool LEN_EQ_MAX_LEN, typename Dist, typename T1, typename T2>\n    __device__ __forceinline__ void calcVecDiffCached(const T1* vecCached, const T2* vecGlob, int len, Dist& dist, typename Dist::result_type* smem, int tid)\n    {\n        vec_distance_detail::VecDiffCachedCalculator<THREAD_DIM, MAX_LEN, LEN_EQ_MAX_LEN>::calc(vecCached, vecGlob, len, dist, tid);\n\n        dist.reduceAll<THREAD_DIM>(smem, tid);\n    }\n\n    // calc distance between two vectors in global memory\n    template <int THREAD_DIM, typename T1> struct VecDiffGlobal\n    {\n        explicit __device__ __forceinline__ VecDiffGlobal(const T1* vec1_, int = 0, void* = 0, int = 0, int = 0)\n        {\n            vec1 = vec1_;\n        }\n\n        template <typename T2, typename Dist>\n        __device__ __forceinline__ void calc(const T2* vec2, int len, Dist& dist, typename Dist::result_type* smem, int tid) const\n        {\n            calcVecDiffGlobal<THREAD_DIM>(vec1, vec2, len, dist, smem, tid);\n        }\n\n        const T1* vec1;\n    };\n\n    // calc distance between two vectors, first vector is cached in register memory, second vector is in global memory\n    template <int THREAD_DIM, int MAX_LEN, bool LEN_EQ_MAX_LEN, typename U> struct VecDiffCachedRegister\n    {\n        template <typename T1> __device__ __forceinline__ VecDiffCachedRegister(const T1* vec1, int len, U* smem, int glob_tid, int tid)\n        {\n            if (glob_tid < len)\n                smem[glob_tid] = vec1[glob_tid];\n            __syncthreads();\n\n            U* vec1ValsPtr = vec1Vals;\n\n            #pragma unroll\n            for (int i = tid; i < MAX_LEN; i += THREAD_DIM)\n                *vec1ValsPtr++ = smem[i];\n\n            __syncthreads();\n        }\n\n        template <typename T2, typename Dist>\n        __device__ __forceinline__ void calc(const T2* vec2, int len, Dist& dist, typename Dist::result_type* smem, int tid) const\n        {\n            calcVecDiffCached<THREAD_DIM, MAX_LEN, LEN_EQ_MAX_LEN>(vec1Vals, vec2, len, dist, smem, tid);\n        }\n\n        U vec1Vals[MAX_LEN / THREAD_DIM];\n    };\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_VEC_DISTANCE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/vec_math.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_VECMATH_HPP\n#define OPENCV_CUDA_VECMATH_HPP\n\n#include \"vec_traits.hpp\"\n#include \"saturate_cast.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n\n// saturate_cast\n\nnamespace vec_math_detail\n{\n    template <int cn, typename VecD> struct SatCastHelper;\n    template <typename VecD> struct SatCastHelper<1, VecD>\n    {\n        template <typename VecS> static __device__ __forceinline__ VecD cast(const VecS& v)\n        {\n            typedef typename VecTraits<VecD>::elem_type D;\n            return VecTraits<VecD>::make(saturate_cast<D>(v.x));\n        }\n    };\n    template <typename VecD> struct SatCastHelper<2, VecD>\n    {\n        template <typename VecS> static __device__ __forceinline__ VecD cast(const VecS& v)\n        {\n            typedef typename VecTraits<VecD>::elem_type D;\n            return VecTraits<VecD>::make(saturate_cast<D>(v.x), saturate_cast<D>(v.y));\n        }\n    };\n    template <typename VecD> struct SatCastHelper<3, VecD>\n    {\n        template <typename VecS> static __device__ __forceinline__ VecD cast(const VecS& v)\n        {\n            typedef typename VecTraits<VecD>::elem_type D;\n            return VecTraits<VecD>::make(saturate_cast<D>(v.x), saturate_cast<D>(v.y), saturate_cast<D>(v.z));\n        }\n    };\n    template <typename VecD> struct SatCastHelper<4, VecD>\n    {\n        template <typename VecS> static __device__ __forceinline__ VecD cast(const VecS& v)\n        {\n            typedef typename VecTraits<VecD>::elem_type D;\n            return VecTraits<VecD>::make(saturate_cast<D>(v.x), saturate_cast<D>(v.y), saturate_cast<D>(v.z), saturate_cast<D>(v.w));\n        }\n    };\n\n    template <typename VecD, typename VecS> static __device__ __forceinline__ VecD saturate_cast_helper(const VecS& v)\n    {\n        return SatCastHelper<VecTraits<VecD>::cn, VecD>::cast(v);\n    }\n}\n\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uchar1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const char1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const ushort1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const short1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uint1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const int1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const float1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const double1& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\n\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uchar2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const char2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const ushort2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const short2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uint2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const int2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const float2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const double2& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\n\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uchar3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const char3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const ushort3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const short3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uint3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const int3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const float3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const double3& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\n\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uchar4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const char4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const ushort4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const short4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const uint4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const int4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const float4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\ntemplate<typename T> static __device__ __forceinline__ T saturate_cast(const double4& v) {return vec_math_detail::saturate_cast_helper<T>(v);}\n\n// unary operators\n\n#define CV_CUDEV_IMPLEMENT_VEC_UNARY_OP(op, input_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 operator op(const input_type ## 1 & a) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(op (a.x)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 operator op(const input_type ## 2 & a) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(op (a.x), op (a.y)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 operator op(const input_type ## 3 & a) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(op (a.x), op (a.y), op (a.z)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 operator op(const input_type ## 4 & a) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(op (a.x), op (a.y), op (a.z), op (a.w)); \\\n    }\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, char, char)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, short, short)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, int, int)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(-, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(!, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, char, char)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, short, short)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, int, int)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_OP(~, uint, uint)\n\n#undef CV_CUDEV_IMPLEMENT_VEC_UNARY_OP\n\n// unary functions\n\n#define CV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(func_name, func, input_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 func_name(const input_type ## 1 & a) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(func (a.x)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 func_name(const input_type ## 2 & a) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(func (a.x), func (a.y)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 func_name(const input_type ## 3 & a) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(func (a.x), func (a.y), func (a.z)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 func_name(const input_type ## 4 & a) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(func (a.x), func (a.y), func (a.z), func (a.w)); \\\n    }\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(abs, ::fabsf, float, float)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrtf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sqrt, ::sqrt, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::expf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp, ::exp, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp2, ::exp2, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(exp10, ::exp10, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::logf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log, ::log, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log2, ::log2, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(log10, ::log10, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sinf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sin, ::sin, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cosf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cos, ::cos, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tanf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tan, ::tan, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asinf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asin, ::asin, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acosf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acos, ::acos, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atanf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atan, ::atan, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinhf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(sinh, ::sinh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::coshf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(cosh, ::cosh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanhf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(tanh, ::tanh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinhf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(asinh, ::asinh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acoshf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(acosh, ::acosh, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanhf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC(atanh, ::atanh, double, double)\n\n#undef CV_CUDEV_IMPLEMENT_VEC_UNARY_FUNC\n\n// binary operators (vec & vec)\n\n#define CV_CUDEV_IMPLEMENT_VEC_BINARY_OP(op, input_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 operator op(const input_type ## 1 & a, const input_type ## 1 & b) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(a.x op b.x); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 operator op(const input_type ## 2 & a, const input_type ## 2 & b) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(a.x op b.x, a.y op b.y); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 operator op(const input_type ## 3 & a, const input_type ## 3 & b) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(a.x op b.x, a.y op b.y, a.z op b.z); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 operator op(const input_type ## 4 & a, const input_type ## 4 & b) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(a.x op b.x, a.y op b.y, a.z op b.z, a.w op b.w); \\\n    }\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, uchar, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, char, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, ushort, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, short, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(+, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, uchar, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, char, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, ushort, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, short, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(-, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, uchar, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, char, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, ushort, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, short, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(*, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, uchar, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, char, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, ushort, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, short, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(/, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(==, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(!=, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(>=, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(<=, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&&, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, char, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, ushort, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, short, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, int, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, uint, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, float, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(||, double, uchar)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(&, uint, uint)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(|, uint, uint)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_OP(^, uint, uint)\n\n#undef CV_CUDEV_IMPLEMENT_VEC_BINARY_OP\n\n// binary operators (vec & scalar)\n\n#define CV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(op, input_type, scalar_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 operator op(const input_type ## 1 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(a.x op s); \\\n    } \\\n    __device__ __forceinline__ output_type ## 1 operator op(scalar_type s, const input_type ## 1 & b) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(s op b.x); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 operator op(const input_type ## 2 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(a.x op s, a.y op s); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 operator op(scalar_type s, const input_type ## 2 & b) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(s op b.x, s op b.y); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 operator op(const input_type ## 3 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(a.x op s, a.y op s, a.z op s); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 operator op(scalar_type s, const input_type ## 3 & b) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(s op b.x, s op b.y, s op b.z); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 operator op(const input_type ## 4 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(a.x op s, a.y op s, a.z op s, a.w op s); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 operator op(scalar_type s, const input_type ## 4 & b) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(s op b.x, s op b.y, s op b.z, s op b.w); \\\n    }\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uchar, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, char, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, ushort, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, short, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(+, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uchar, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, char, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, ushort, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, short, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(-, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uchar, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, char, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, ushort, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, short, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(*, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uchar, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, char, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, ushort, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, short, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(/, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(==, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(!=, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(>=, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(<=, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&&, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, char, char, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, ushort, ushort, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, short, short, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, int, int, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, uint, uint, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, float, float, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(||, double, double, uchar)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(&, uint, uint, uint)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(|, uint, uint, uint)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP(^, uint, uint, uint)\n\n#undef CV_CUDEV_IMPLEMENT_SCALAR_BINARY_OP\n\n// binary function (vec & vec)\n\n#define CV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(func_name, func, input_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 func_name(const input_type ## 1 & a, const input_type ## 1 & b) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(func (a.x, b.x)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 func_name(const input_type ## 2 & a, const input_type ## 2 & b) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(func (a.x, b.x), func (a.y, b.y)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 func_name(const input_type ## 3 & a, const input_type ## 3 & b) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(func (a.x, b.x), func (a.y, b.y), func (a.z, b.z)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 func_name(const input_type ## 4 & a, const input_type ## 4 & b) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(func (a.x, b.x), func (a.y, b.y), func (a.z, b.z), func (a.w, b.w)); \\\n    }\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::max, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::fmaxf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(max, ::fmax, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, uchar, uchar)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, char, char)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, ushort, ushort)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, short, short)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, uint, uint)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::min, int, int)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::fminf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(min, ::fmin, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, char, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, short, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, int, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypotf, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(hypot, ::hypot, double, double)\n\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, uchar, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, char, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, ushort, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, short, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, uint, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, int, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2f, float, float)\nCV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC(atan2, ::atan2, double, double)\n\n#undef CV_CUDEV_IMPLEMENT_VEC_BINARY_FUNC\n\n// binary function (vec & scalar)\n\n#define CV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(func_name, func, input_type, scalar_type, output_type) \\\n    __device__ __forceinline__ output_type ## 1 func_name(const input_type ## 1 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(func ((output_type) a.x, (output_type) s)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 1 func_name(scalar_type s, const input_type ## 1 & b) \\\n    { \\\n        return VecTraits<output_type ## 1>::make(func ((output_type) s, (output_type) b.x)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 func_name(const input_type ## 2 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(func ((output_type) a.x, (output_type) s), func ((output_type) a.y, (output_type) s)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 2 func_name(scalar_type s, const input_type ## 2 & b) \\\n    { \\\n        return VecTraits<output_type ## 2>::make(func ((output_type) s, (output_type) b.x), func ((output_type) s, (output_type) b.y)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 func_name(const input_type ## 3 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(func ((output_type) a.x, (output_type) s), func ((output_type) a.y, (output_type) s), func ((output_type) a.z, (output_type) s)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 3 func_name(scalar_type s, const input_type ## 3 & b) \\\n    { \\\n        return VecTraits<output_type ## 3>::make(func ((output_type) s, (output_type) b.x), func ((output_type) s, (output_type) b.y), func ((output_type) s, (output_type) b.z)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 func_name(const input_type ## 4 & a, scalar_type s) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(func ((output_type) a.x, (output_type) s), func ((output_type) a.y, (output_type) s), func ((output_type) a.z, (output_type) s), func ((output_type) a.w, (output_type) s)); \\\n    } \\\n    __device__ __forceinline__ output_type ## 4 func_name(scalar_type s, const input_type ## 4 & b) \\\n    { \\\n        return VecTraits<output_type ## 4>::make(func ((output_type) s, (output_type) b.x), func ((output_type) s, (output_type) b.y), func ((output_type) s, (output_type) b.z), func ((output_type) s, (output_type) b.w)); \\\n    }\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::max, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmaxf, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(max, ::fmax, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, uchar, uchar, uchar)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, char, char, char)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, ushort, ushort, ushort)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, short, short, short)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, uint, uint, uint)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::min, int, int, int)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fminf, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(min, ::fmin, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypotf, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(hypot, ::hypot, double, double, double)\n\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, uchar, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, uchar, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, char, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, char, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, ushort, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, ushort, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, short, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, short, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, uint, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, uint, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, int, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, int, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2f, float, float, float)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, float, double, double)\nCV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC(atan2, ::atan2, double, double, double)\n\n#undef CV_CUDEV_IMPLEMENT_SCALAR_BINARY_FUNC\n\n}}} // namespace cv { namespace cuda { namespace device\n\n//! @endcond\n\n#endif // OPENCV_CUDA_VECMATH_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/vec_traits.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_VEC_TRAITS_HPP\n#define OPENCV_CUDA_VEC_TRAITS_HPP\n\n#include \"common.hpp\"\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template<typename T, int N> struct TypeVec;\n\n    struct __align__(8) uchar8\n    {\n        uchar a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ uchar8 make_uchar8(uchar a0, uchar a1, uchar a2, uchar a3, uchar a4, uchar a5, uchar a6, uchar a7)\n    {\n        uchar8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(8) char8\n    {\n        schar a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ char8 make_char8(schar a0, schar a1, schar a2, schar a3, schar a4, schar a5, schar a6, schar a7)\n    {\n        char8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(16) ushort8\n    {\n        ushort a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ ushort8 make_ushort8(ushort a0, ushort a1, ushort a2, ushort a3, ushort a4, ushort a5, ushort a6, ushort a7)\n    {\n        ushort8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(16) short8\n    {\n        short a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ short8 make_short8(short a0, short a1, short a2, short a3, short a4, short a5, short a6, short a7)\n    {\n        short8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(32) uint8\n    {\n        uint a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ uint8 make_uint8(uint a0, uint a1, uint a2, uint a3, uint a4, uint a5, uint a6, uint a7)\n    {\n        uint8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(32) int8\n    {\n        int a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ int8 make_int8(int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7)\n    {\n        int8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct __align__(32) float8\n    {\n        float a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ float8 make_float8(float a0, float a1, float a2, float a3, float a4, float a5, float a6, float a7)\n    {\n        float8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n    struct double8\n    {\n        double a0, a1, a2, a3, a4, a5, a6, a7;\n    };\n    static __host__ __device__ __forceinline__ double8 make_double8(double a0, double a1, double a2, double a3, double a4, double a5, double a6, double a7)\n    {\n        double8 val = {a0, a1, a2, a3, a4, a5, a6, a7};\n        return val;\n    }\n\n#define OPENCV_CUDA_IMPLEMENT_TYPE_VEC(type) \\\n    template<> struct TypeVec<type, 1> { typedef type vec_type; }; \\\n    template<> struct TypeVec<type ## 1, 1> { typedef type ## 1 vec_type; }; \\\n    template<> struct TypeVec<type, 2> { typedef type ## 2 vec_type; }; \\\n    template<> struct TypeVec<type ## 2, 2> { typedef type ## 2 vec_type; }; \\\n    template<> struct TypeVec<type, 3> { typedef type ## 3 vec_type; }; \\\n    template<> struct TypeVec<type ## 3, 3> { typedef type ## 3 vec_type; }; \\\n    template<> struct TypeVec<type, 4> { typedef type ## 4 vec_type; }; \\\n    template<> struct TypeVec<type ## 4, 4> { typedef type ## 4 vec_type; }; \\\n    template<> struct TypeVec<type, 8> { typedef type ## 8 vec_type; }; \\\n    template<> struct TypeVec<type ## 8, 8> { typedef type ## 8 vec_type; };\n\n    OPENCV_CUDA_IMPLEMENT_TYPE_VEC(uchar)\n    OPENCV_CUDA_IMPLEMENT_TYPE_VEC(char)\n    OPENCV_CUDA_IMPLEMENT_TYPE_VEC(ushort)\n    OPENCV_CUDA_IMPLEMENT_TYPE_VEC(short)\n    OPENCV_CUDA_IMPLEMENT_TYPE_VEC(int)\n    OPENCV_CUDA_IMPLEMENT_TYPE_VEC(uint)\n    OPENCV_CUDA_IMPLEMENT_TYPE_VEC(float)\n    OPENCV_CUDA_IMPLEMENT_TYPE_VEC(double)\n\n    #undef OPENCV_CUDA_IMPLEMENT_TYPE_VEC\n\n    template<> struct TypeVec<schar, 1> { typedef schar vec_type; };\n    template<> struct TypeVec<schar, 2> { typedef char2 vec_type; };\n    template<> struct TypeVec<schar, 3> { typedef char3 vec_type; };\n    template<> struct TypeVec<schar, 4> { typedef char4 vec_type; };\n    template<> struct TypeVec<schar, 8> { typedef char8 vec_type; };\n\n    template<> struct TypeVec<bool, 1> { typedef uchar vec_type; };\n    template<> struct TypeVec<bool, 2> { typedef uchar2 vec_type; };\n    template<> struct TypeVec<bool, 3> { typedef uchar3 vec_type; };\n    template<> struct TypeVec<bool, 4> { typedef uchar4 vec_type; };\n    template<> struct TypeVec<bool, 8> { typedef uchar8 vec_type; };\n\n    template<typename T> struct VecTraits;\n\n#define OPENCV_CUDA_IMPLEMENT_VEC_TRAITS(type) \\\n    template<> struct VecTraits<type> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=1}; \\\n        static __device__ __host__ __forceinline__ type all(type v) {return v;} \\\n        static __device__ __host__ __forceinline__ type make(type x) {return x;} \\\n        static __device__ __host__ __forceinline__ type make(const type* v) {return *v;} \\\n    }; \\\n    template<> struct VecTraits<type ## 1> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=1}; \\\n        static __device__ __host__ __forceinline__ type ## 1 all(type v) {return make_ ## type ## 1(v);} \\\n        static __device__ __host__ __forceinline__ type ## 1 make(type x) {return make_ ## type ## 1(x);} \\\n        static __device__ __host__ __forceinline__ type ## 1 make(const type* v) {return make_ ## type ## 1(*v);} \\\n    }; \\\n    template<> struct VecTraits<type ## 2> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=2}; \\\n        static __device__ __host__ __forceinline__ type ## 2 all(type v) {return make_ ## type ## 2(v, v);} \\\n        static __device__ __host__ __forceinline__ type ## 2 make(type x, type y) {return make_ ## type ## 2(x, y);} \\\n        static __device__ __host__ __forceinline__ type ## 2 make(const type* v) {return make_ ## type ## 2(v[0], v[1]);} \\\n    }; \\\n    template<> struct VecTraits<type ## 3> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=3}; \\\n        static __device__ __host__ __forceinline__ type ## 3 all(type v) {return make_ ## type ## 3(v, v, v);} \\\n        static __device__ __host__ __forceinline__ type ## 3 make(type x, type y, type z) {return make_ ## type ## 3(x, y, z);} \\\n        static __device__ __host__ __forceinline__ type ## 3 make(const type* v) {return make_ ## type ## 3(v[0], v[1], v[2]);} \\\n    }; \\\n    template<> struct VecTraits<type ## 4> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=4}; \\\n        static __device__ __host__ __forceinline__ type ## 4 all(type v) {return make_ ## type ## 4(v, v, v, v);} \\\n        static __device__ __host__ __forceinline__ type ## 4 make(type x, type y, type z, type w) {return make_ ## type ## 4(x, y, z, w);} \\\n        static __device__ __host__ __forceinline__ type ## 4 make(const type* v) {return make_ ## type ## 4(v[0], v[1], v[2], v[3]);} \\\n    }; \\\n    template<> struct VecTraits<type ## 8> \\\n    { \\\n        typedef type elem_type; \\\n        enum {cn=8}; \\\n        static __device__ __host__ __forceinline__ type ## 8 all(type v) {return make_ ## type ## 8(v, v, v, v, v, v, v, v);} \\\n        static __device__ __host__ __forceinline__ type ## 8 make(type a0, type a1, type a2, type a3, type a4, type a5, type a6, type a7) {return make_ ## type ## 8(a0, a1, a2, a3, a4, a5, a6, a7);} \\\n        static __device__ __host__ __forceinline__ type ## 8 make(const type* v) {return make_ ## type ## 8(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);} \\\n    };\n\n    OPENCV_CUDA_IMPLEMENT_VEC_TRAITS(uchar)\n    OPENCV_CUDA_IMPLEMENT_VEC_TRAITS(ushort)\n    OPENCV_CUDA_IMPLEMENT_VEC_TRAITS(short)\n    OPENCV_CUDA_IMPLEMENT_VEC_TRAITS(int)\n    OPENCV_CUDA_IMPLEMENT_VEC_TRAITS(uint)\n    OPENCV_CUDA_IMPLEMENT_VEC_TRAITS(float)\n    OPENCV_CUDA_IMPLEMENT_VEC_TRAITS(double)\n\n    #undef OPENCV_CUDA_IMPLEMENT_VEC_TRAITS\n\n    template<> struct VecTraits<char>\n    {\n        typedef char elem_type;\n        enum {cn=1};\n        static __device__ __host__ __forceinline__ char all(char v) {return v;}\n        static __device__ __host__ __forceinline__ char make(char x) {return x;}\n        static __device__ __host__ __forceinline__ char make(const char* x) {return *x;}\n    };\n    template<> struct VecTraits<schar>\n    {\n        typedef schar elem_type;\n        enum {cn=1};\n        static __device__ __host__ __forceinline__ schar all(schar v) {return v;}\n        static __device__ __host__ __forceinline__ schar make(schar x) {return x;}\n        static __device__ __host__ __forceinline__ schar make(const schar* x) {return *x;}\n    };\n    template<> struct VecTraits<char1>\n    {\n        typedef schar elem_type;\n        enum {cn=1};\n        static __device__ __host__ __forceinline__ char1 all(schar v) {return make_char1(v);}\n        static __device__ __host__ __forceinline__ char1 make(schar x) {return make_char1(x);}\n        static __device__ __host__ __forceinline__ char1 make(const schar* v) {return make_char1(v[0]);}\n    };\n    template<> struct VecTraits<char2>\n    {\n        typedef schar elem_type;\n        enum {cn=2};\n        static __device__ __host__ __forceinline__ char2 all(schar v) {return make_char2(v, v);}\n        static __device__ __host__ __forceinline__ char2 make(schar x, schar y) {return make_char2(x, y);}\n        static __device__ __host__ __forceinline__ char2 make(const schar* v) {return make_char2(v[0], v[1]);}\n    };\n    template<> struct VecTraits<char3>\n    {\n        typedef schar elem_type;\n        enum {cn=3};\n        static __device__ __host__ __forceinline__ char3 all(schar v) {return make_char3(v, v, v);}\n        static __device__ __host__ __forceinline__ char3 make(schar x, schar y, schar z) {return make_char3(x, y, z);}\n        static __device__ __host__ __forceinline__ char3 make(const schar* v) {return make_char3(v[0], v[1], v[2]);}\n    };\n    template<> struct VecTraits<char4>\n    {\n        typedef schar elem_type;\n        enum {cn=4};\n        static __device__ __host__ __forceinline__ char4 all(schar v) {return make_char4(v, v, v, v);}\n        static __device__ __host__ __forceinline__ char4 make(schar x, schar y, schar z, schar w) {return make_char4(x, y, z, w);}\n        static __device__ __host__ __forceinline__ char4 make(const schar* v) {return make_char4(v[0], v[1], v[2], v[3]);}\n    };\n    template<> struct VecTraits<char8>\n    {\n        typedef schar elem_type;\n        enum {cn=8};\n        static __device__ __host__ __forceinline__ char8 all(schar v) {return make_char8(v, v, v, v, v, v, v, v);}\n        static __device__ __host__ __forceinline__ char8 make(schar a0, schar a1, schar a2, schar a3, schar a4, schar a5, schar a6, schar a7) {return make_char8(a0, a1, a2, a3, a4, a5, a6, a7);}\n        static __device__ __host__ __forceinline__ char8 make(const schar* v) {return make_char8(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);}\n    };\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif // OPENCV_CUDA_VEC_TRAITS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/warp.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_DEVICE_WARP_HPP\n#define OPENCV_CUDA_DEVICE_WARP_HPP\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    struct Warp\n    {\n        enum\n        {\n            LOG_WARP_SIZE = 5,\n            WARP_SIZE     = 1 << LOG_WARP_SIZE,\n            STRIDE        = WARP_SIZE\n        };\n\n        /** \\brief Returns the warp lane ID of the calling thread. */\n        static __device__ __forceinline__ unsigned int laneId()\n        {\n            unsigned int ret;\n            asm(\"mov.u32 %0, %%laneid;\" : \"=r\"(ret) );\n            return ret;\n        }\n\n        template<typename It, typename T>\n        static __device__ __forceinline__ void fill(It beg, It end, const T& value)\n        {\n            for(It t = beg + laneId(); t < end; t += STRIDE)\n                *t = value;\n        }\n\n        template<typename InIt, typename OutIt>\n        static __device__ __forceinline__ OutIt copy(InIt beg, InIt end, OutIt out)\n        {\n            for(InIt t = beg + laneId(); t < end; t += STRIDE, out += STRIDE)\n                *out = *t;\n            return out;\n        }\n\n        template<typename InIt, typename OutIt, class UnOp>\n        static __device__ __forceinline__ OutIt transform(InIt beg, InIt end, OutIt out, UnOp op)\n        {\n            for(InIt t = beg + laneId(); t < end; t += STRIDE, out += STRIDE)\n                *out = op(*t);\n            return out;\n        }\n\n        template<typename InIt1, typename InIt2, typename OutIt, class BinOp>\n        static __device__ __forceinline__ OutIt transform(InIt1 beg1, InIt1 end1, InIt2 beg2, OutIt out, BinOp op)\n        {\n            unsigned int lane = laneId();\n\n            InIt1 t1 = beg1 + lane;\n            InIt2 t2 = beg2 + lane;\n            for(; t1 < end1; t1 += STRIDE, t2 += STRIDE, out += STRIDE)\n                *out = op(*t1, *t2);\n            return out;\n        }\n\n        template <class T, class BinOp>\n        static __device__ __forceinline__ T reduce(volatile T *ptr, BinOp op)\n        {\n            const unsigned int lane = laneId();\n\n            if (lane < 16)\n            {\n                T partial = ptr[lane];\n\n                ptr[lane] = partial = op(partial, ptr[lane + 16]);\n                ptr[lane] = partial = op(partial, ptr[lane + 8]);\n                ptr[lane] = partial = op(partial, ptr[lane + 4]);\n                ptr[lane] = partial = op(partial, ptr[lane + 2]);\n                ptr[lane] = partial = op(partial, ptr[lane + 1]);\n            }\n\n            return *ptr;\n        }\n\n        template<typename OutIt, typename T>\n        static __device__ __forceinline__ void yota(OutIt beg, OutIt end, T value)\n        {\n            unsigned int lane = laneId();\n            value += lane;\n\n            for(OutIt t = beg + lane; t < end; t += STRIDE, value += STRIDE)\n                *t = value;\n        }\n    };\n}}} // namespace cv { namespace cuda { namespace cudev\n\n//! @endcond\n\n#endif /* OPENCV_CUDA_DEVICE_WARP_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/warp_reduce.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_WARP_REDUCE_HPP__\n#define OPENCV_CUDA_WARP_REDUCE_HPP__\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n    template <class T>\n    __device__ __forceinline__ T warp_reduce(volatile T *ptr , const unsigned int tid = threadIdx.x)\n    {\n        const unsigned int lane = tid & 31; // index of thread in warp (0..31)\n\n        if (lane < 16)\n        {\n            T partial = ptr[tid];\n\n            ptr[tid] = partial = partial + ptr[tid + 16];\n            ptr[tid] = partial = partial + ptr[tid + 8];\n            ptr[tid] = partial = partial + ptr[tid + 4];\n            ptr[tid] = partial = partial + ptr[tid + 2];\n            ptr[tid] = partial = partial + ptr[tid + 1];\n        }\n\n        return ptr[tid - lane];\n    }\n}}} // namespace cv { namespace cuda { namespace cudev {\n\n//! @endcond\n\n#endif /* OPENCV_CUDA_WARP_REDUCE_HPP__ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda/warp_shuffle.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CUDA_WARP_SHUFFLE_HPP\n#define OPENCV_CUDA_WARP_SHUFFLE_HPP\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda { namespace device\n{\n#if __CUDACC_VER_MAJOR__ >= 9\n#  define __shfl(x, y, z) __shfl_sync(0xFFFFFFFFU, x, y, z)\n#  define __shfl_up(x, y, z) __shfl_up_sync(0xFFFFFFFFU, x, y, z)\n#  define __shfl_down(x, y, z) __shfl_down_sync(0xFFFFFFFFU, x, y, z)\n#endif\n    template <typename T>\n    __device__ __forceinline__ T shfl(T val, int srcLane, int width = warpSize)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n        return __shfl(val, srcLane, width);\n    #else\n        return T();\n    #endif\n    }\n    __device__ __forceinline__ unsigned int shfl(unsigned int val, int srcLane, int width = warpSize)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n        return (unsigned int) __shfl((int) val, srcLane, width);\n    #else\n        return 0;\n    #endif\n    }\n    __device__ __forceinline__ double shfl(double val, int srcLane, int width = warpSize)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n        int lo = __double2loint(val);\n        int hi = __double2hiint(val);\n\n        lo = __shfl(lo, srcLane, width);\n        hi = __shfl(hi, srcLane, width);\n\n        return __hiloint2double(hi, lo);\n    #else\n        return 0.0;\n    #endif\n    }\n\n    template <typename T>\n    __device__ __forceinline__ T shfl_down(T val, unsigned int delta, int width = warpSize)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n        return __shfl_down(val, delta, width);\n    #else\n        return T();\n    #endif\n    }\n    __device__ __forceinline__ unsigned int shfl_down(unsigned int val, unsigned int delta, int width = warpSize)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n        return (unsigned int) __shfl_down((int) val, delta, width);\n    #else\n        return 0;\n    #endif\n    }\n    __device__ __forceinline__ double shfl_down(double val, unsigned int delta, int width = warpSize)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n        int lo = __double2loint(val);\n        int hi = __double2hiint(val);\n\n        lo = __shfl_down(lo, delta, width);\n        hi = __shfl_down(hi, delta, width);\n\n        return __hiloint2double(hi, lo);\n    #else\n        return 0.0;\n    #endif\n    }\n\n    template <typename T>\n    __device__ __forceinline__ T shfl_up(T val, unsigned int delta, int width = warpSize)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n        return __shfl_up(val, delta, width);\n    #else\n        return T();\n    #endif\n    }\n    __device__ __forceinline__ unsigned int shfl_up(unsigned int val, unsigned int delta, int width = warpSize)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n        return (unsigned int) __shfl_up((int) val, delta, width);\n    #else\n        return 0;\n    #endif\n    }\n    __device__ __forceinline__ double shfl_up(double val, unsigned int delta, int width = warpSize)\n    {\n    #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 300\n        int lo = __double2loint(val);\n        int hi = __double2hiint(val);\n\n        lo = __shfl_up(lo, delta, width);\n        hi = __shfl_up(hi, delta, width);\n\n        return __hiloint2double(hi, lo);\n    #else\n        return 0.0;\n    #endif\n    }\n}}}\n\n#  undef __shfl\n#  undef __shfl_up\n#  undef __shfl_down\n\n//! @endcond\n\n#endif // OPENCV_CUDA_WARP_SHUFFLE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_CUDA_HPP\n#define OPENCV_CORE_CUDA_HPP\n\n#ifndef __cplusplus\n#  error cuda.hpp header must be compiled as C++\n#endif\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/core/cuda_types.hpp\"\n\n/**\n  @defgroup cuda CUDA-accelerated Computer Vision\n  @{\n    @defgroup cudacore Core part\n    @{\n      @defgroup cudacore_init Initialization and Information\n      @defgroup cudacore_struct Data Structures\n    @}\n  @}\n */\n\nnamespace cv { namespace cuda {\n\n//! @addtogroup cudacore_struct\n//! @{\n\n//===================================================================================\n// GpuMat\n//===================================================================================\n\n/** @brief Base storage class for GPU memory with reference counting.\n\nIts interface matches the Mat interface with the following limitations:\n\n-   no arbitrary dimensions support (only 2D)\n-   no functions that return references to their data (because references on GPU are not valid for\n    CPU)\n-   no expression templates technique support\n\nBeware that the latter limitation may lead to overloaded matrix operators that cause memory\nallocations. The GpuMat class is convertible to cuda::PtrStepSz and cuda::PtrStep so it can be\npassed directly to the kernel.\n\n@note In contrast with Mat, in most cases GpuMat::isContinuous() == false . This means that rows are\naligned to a size depending on the hardware. Single-row GpuMat is always a continuous matrix.\n\n@note You are not recommended to leave static or global GpuMat variables allocated, that is, to rely\non its destructor. The destruction order of such variables and CUDA context is undefined. GPU memory\nrelease function returns error if the CUDA context has been destroyed before.\n\nSome member functions are described as a \"Blocking Call\" while some are described as a\n\"Non-Blocking Call\". Blocking functions are synchronous to host. It is guaranteed that the GPU\noperation is finished when the function returns. However, non-blocking functions are asynchronous to\nhost. Those functions may return even if the GPU operation is not finished.\n\nCompared to their blocking counterpart, non-blocking functions accept Stream as an additional\nargument. If a non-default stream is passed, the GPU operation may overlap with operations in other\nstreams.\n\n@sa Mat\n */\nclass CV_EXPORTS_W GpuMat\n{\npublic:\n    class CV_EXPORTS_W Allocator\n    {\n    public:\n        virtual ~Allocator() {}\n\n        // allocator must fill data, step and refcount fields\n        virtual bool allocate(GpuMat* mat, int rows, int cols, size_t elemSize) = 0;\n        virtual void free(GpuMat* mat) = 0;\n    };\n\n    //! default allocator\n    CV_WRAP static GpuMat::Allocator* defaultAllocator();\n    CV_WRAP static void setDefaultAllocator(GpuMat::Allocator* allocator);\n\n    //! default constructor\n    CV_WRAP explicit GpuMat(GpuMat::Allocator* allocator = GpuMat::defaultAllocator());\n\n    //! constructs GpuMat of the specified size and type\n    CV_WRAP GpuMat(int rows, int cols, int type, GpuMat::Allocator* allocator = GpuMat::defaultAllocator());\n    CV_WRAP GpuMat(Size size, int type, GpuMat::Allocator* allocator = GpuMat::defaultAllocator());\n\n    //! constructs GpuMat and fills it with the specified value _s\n    CV_WRAP GpuMat(int rows, int cols, int type, Scalar s, GpuMat::Allocator* allocator = GpuMat::defaultAllocator());\n    CV_WRAP GpuMat(Size size, int type, Scalar s, GpuMat::Allocator* allocator = GpuMat::defaultAllocator());\n\n    //! copy constructor\n    CV_WRAP GpuMat(const GpuMat& m);\n\n    //! constructor for GpuMat headers pointing to user-allocated data\n    GpuMat(int rows, int cols, int type, void* data, size_t step = Mat::AUTO_STEP);\n    GpuMat(Size size, int type, void* data, size_t step = Mat::AUTO_STEP);\n\n    //! creates a GpuMat header for a part of the bigger matrix\n    CV_WRAP GpuMat(const GpuMat& m, Range rowRange, Range colRange);\n    CV_WRAP GpuMat(const GpuMat& m, Rect roi);\n\n    //! builds GpuMat from host memory (Blocking call)\n    CV_WRAP explicit GpuMat(InputArray arr, GpuMat::Allocator* allocator = GpuMat::defaultAllocator());\n\n    //! destructor - calls release()\n    ~GpuMat();\n\n    //! assignment operators\n    GpuMat& operator =(const GpuMat& m);\n\n    //! allocates new GpuMat data unless the GpuMat already has specified size and type\n    CV_WRAP void create(int rows, int cols, int type);\n    CV_WRAP void create(Size size, int type);\n\n    //! decreases reference counter, deallocate the data when reference counter reaches 0\n    void release();\n\n    //! swaps with other smart pointer\n    CV_WRAP void swap(GpuMat& mat);\n\n    /** @brief Performs data upload to GpuMat (Blocking call)\n\n    This function copies data from host memory to device memory. As being a blocking call, it is\n    guaranteed that the copy operation is finished when this function returns.\n    */\n    CV_WRAP void upload(InputArray arr);\n\n    /** @brief Performs data upload to GpuMat (Non-Blocking call)\n\n    This function copies data from host memory to device memory. As being a non-blocking call, this\n    function may return even if the copy operation is not finished.\n\n    The copy operation may be overlapped with operations in other non-default streams if \\p stream is\n    not the default stream and \\p dst is HostMem allocated with HostMem::PAGE_LOCKED option.\n    */\n    CV_WRAP void upload(InputArray arr, Stream& stream);\n\n    /** @brief Performs data download from GpuMat (Blocking call)\n\n    This function copies data from device memory to host memory. As being a blocking call, it is\n    guaranteed that the copy operation is finished when this function returns.\n    */\n    CV_WRAP void download(OutputArray dst) const;\n\n    /** @brief Performs data download from GpuMat (Non-Blocking call)\n\n    This function copies data from device memory to host memory. As being a non-blocking call, this\n    function may return even if the copy operation is not finished.\n\n    The copy operation may be overlapped with operations in other non-default streams if \\p stream is\n    not the default stream and \\p dst is HostMem allocated with HostMem::PAGE_LOCKED option.\n    */\n    CV_WRAP void download(OutputArray dst, Stream& stream) const;\n\n    //! returns deep copy of the GpuMat, i.e. the data is copied\n    CV_WRAP GpuMat clone() const;\n\n    //! copies the GpuMat content to device memory (Blocking call)\n    CV_WRAP void copyTo(OutputArray dst) const;\n\n    //! copies the GpuMat content to device memory (Non-Blocking call)\n    CV_WRAP void copyTo(OutputArray dst, Stream& stream) const;\n\n    //! copies those GpuMat elements to \"m\" that are marked with non-zero mask elements (Blocking call)\n    CV_WRAP void copyTo(OutputArray dst, InputArray mask) const;\n\n    //! copies those GpuMat elements to \"m\" that are marked with non-zero mask elements (Non-Blocking call)\n    CV_WRAP void copyTo(OutputArray dst, InputArray mask, Stream& stream) const;\n\n    //! sets some of the GpuMat elements to s (Blocking call)\n    CV_WRAP GpuMat& setTo(Scalar s);\n\n    //! sets some of the GpuMat elements to s (Non-Blocking call)\n    CV_WRAP GpuMat& setTo(Scalar s, Stream& stream);\n\n    //! sets some of the GpuMat elements to s, according to the mask (Blocking call)\n    CV_WRAP GpuMat& setTo(Scalar s, InputArray mask);\n\n    //! sets some of the GpuMat elements to s, according to the mask (Non-Blocking call)\n    CV_WRAP GpuMat& setTo(Scalar s, InputArray mask, Stream& stream);\n\n    //! converts GpuMat to another datatype (Blocking call)\n    CV_WRAP void convertTo(OutputArray dst, int rtype) const;\n\n    //! converts GpuMat to another datatype (Non-Blocking call)\n    CV_WRAP void convertTo(OutputArray dst, int rtype, Stream& stream) const;\n\n    //! converts GpuMat to another datatype with scaling (Blocking call)\n    CV_WRAP void convertTo(OutputArray dst, int rtype, double alpha, double beta = 0.0) const;\n\n    //! converts GpuMat to another datatype with scaling (Non-Blocking call)\n    CV_WRAP void convertTo(OutputArray dst, int rtype, double alpha, Stream& stream) const;\n\n    //! converts GpuMat to another datatype with scaling (Non-Blocking call)\n    CV_WRAP void convertTo(OutputArray dst, int rtype, double alpha, double beta, Stream& stream) const;\n\n    CV_WRAP void assignTo(GpuMat& m, int type = -1) const;\n\n    //! returns pointer to y-th row\n    uchar* ptr(int y = 0);\n    const uchar* ptr(int y = 0) const;\n\n    //! template version of the above method\n    template<typename _Tp> _Tp* ptr(int y = 0);\n    template<typename _Tp> const _Tp* ptr(int y = 0) const;\n\n    template <typename _Tp> operator PtrStepSz<_Tp>() const;\n    template <typename _Tp> operator PtrStep<_Tp>() const;\n\n    //! returns a new GpuMat header for the specified row\n    CV_WRAP GpuMat row(int y) const;\n\n    //! returns a new GpuMat header for the specified column\n    CV_WRAP GpuMat col(int x) const;\n\n    //! ... for the specified row span\n    CV_WRAP GpuMat rowRange(int startrow, int endrow) const;\n    CV_WRAP GpuMat rowRange(Range r) const;\n\n    //! ... for the specified column span\n    CV_WRAP GpuMat colRange(int startcol, int endcol) const;\n    CV_WRAP GpuMat colRange(Range r) const;\n\n    //! extracts a rectangular sub-GpuMat (this is a generalized form of row, rowRange etc.)\n    GpuMat operator ()(Range rowRange, Range colRange) const;\n    GpuMat operator ()(Rect roi) const;\n\n    //! creates alternative GpuMat header for the same data, with different\n    //! number of channels and/or different number of rows\n    CV_WRAP GpuMat reshape(int cn, int rows = 0) const;\n\n    //! locates GpuMat header within a parent GpuMat\n    CV_WRAP void locateROI(Size& wholeSize, Point& ofs) const;\n\n    //! moves/resizes the current GpuMat ROI inside the parent GpuMat\n    CV_WRAP GpuMat& adjustROI(int dtop, int dbottom, int dleft, int dright);\n\n    //! returns true iff the GpuMat data is continuous\n    //! (i.e. when there are no gaps between successive rows)\n    CV_WRAP bool isContinuous() const;\n\n    //! returns element size in bytes\n    CV_WRAP size_t elemSize() const;\n\n    //! returns the size of element channel in bytes\n    CV_WRAP size_t elemSize1() const;\n\n    //! returns element type\n    CV_WRAP int type() const;\n\n    //! returns element type\n    CV_WRAP int depth() const;\n\n    //! returns number of channels\n    CV_WRAP int channels() const;\n\n    //! returns step/elemSize1()\n    CV_WRAP size_t step1() const;\n\n    //! returns GpuMat size : width == number of columns, height == number of rows\n    CV_WRAP Size size() const;\n\n    //! returns true if GpuMat data is NULL\n    CV_WRAP bool empty() const;\n\n    // returns pointer to cuda memory\n    CV_WRAP void* cudaPtr() const;\n\n    //! internal use method: updates the continuity flag\n    CV_WRAP void updateContinuityFlag();\n\n    /*! includes several bit-fields:\n    - the magic signature\n    - continuity flag\n    - depth\n    - number of channels\n    */\n    int flags;\n\n    //! the number of rows and columns\n    int rows, cols;\n\n    //! a distance between successive rows in bytes; includes the gap if any\n    CV_PROP size_t step;\n\n    //! pointer to the data\n    uchar* data;\n\n    //! pointer to the reference counter;\n    //! when GpuMat points to user-allocated data, the pointer is NULL\n    int* refcount;\n\n    //! helper fields used in locateROI and adjustROI\n    uchar* datastart;\n    const uchar* dataend;\n\n    //! allocator\n    Allocator* allocator;\n};\n\nstruct CV_EXPORTS_W GpuData\n{\n    explicit GpuData(size_t _size);\n     ~GpuData();\n\n    GpuData(const GpuData&) = delete;\n    GpuData& operator=(const GpuData&) = delete;\n\n    GpuData(GpuData&&) = delete;\n    GpuData& operator=(GpuData&&) = delete;\n\n    uchar* data;\n    size_t size;\n};\n\nclass CV_EXPORTS_W GpuMatND\n{\npublic:\n    using SizeArray = std::vector<int>;\n    using StepArray = std::vector<size_t>;\n    using IndexArray = std::vector<int>;\n\n    //! destructor\n    ~GpuMatND();\n\n    //! default constructor\n    GpuMatND();\n\n    /** @overload\n    @param size Array of integers specifying an n-dimensional array shape.\n    @param type Array type. Use CV_8UC1, ..., CV_16FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    */\n    GpuMatND(SizeArray size, int type);\n\n    /** @overload\n    @param size Array of integers specifying an n-dimensional array shape.\n    @param type Array type. Use CV_8UC1, ..., CV_16FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    @param data Pointer to the user data. Matrix constructors that take data and step parameters do not\n    allocate matrix data. Instead, they just initialize the matrix header that points to the specified\n    data, which means that no data is copied. This operation is very efficient and can be used to\n    process external data using OpenCV functions. The external data is not automatically deallocated, so\n    you should take care of it.\n    @param step Array of _size.size()-1 steps in case of a multi-dimensional array (the last step is always\n    set to the element size). If not specified, the matrix is assumed to be continuous.\n    */\n    GpuMatND(SizeArray size, int type, void* data, StepArray step = StepArray());\n\n    /** @brief Allocates GPU memory.\n    Suppose there is some GPU memory already allocated. In that case, this method may choose to reuse that\n    GPU memory under the specific condition: it must be of the same size and type, not externally allocated,\n    the GPU memory is continuous(i.e., isContinuous() is true), and is not a sub-matrix of another GpuMatND\n    (i.e., isSubmatrix() is false). In other words, this method guarantees that the GPU memory allocated by\n    this method is always continuous and is not a sub-region of another GpuMatND.\n    */\n    void create(SizeArray size, int type);\n\n    void release();\n\n    void swap(GpuMatND& m) noexcept;\n\n    /** @brief Creates a full copy of the array and the underlying data.\n    The method creates a full copy of the array. It mimics the behavior of Mat::clone(), i.e.\n    the original step is not taken into account. So, the array copy is a continuous array\n    occupying total()\\*elemSize() bytes.\n    */\n    GpuMatND clone() const;\n\n    /** @overload\n    This overload is non-blocking, so it may return even if the copy operation is not finished.\n    */\n    GpuMatND clone(Stream& stream) const;\n\n    /** @brief Extracts a sub-matrix.\n    The operator makes a new header for the specified sub-array of \\*this.\n    The operator is an O(1) operation, that is, no matrix data is copied.\n    @param ranges Array of selected ranges along each dimension.\n    */\n    GpuMatND operator()(const std::vector<Range>& ranges) const;\n\n    /** @brief Creates a GpuMat header for a 2D plane part of an n-dim matrix.\n    @note The returned GpuMat is constructed with the constructor for user-allocated data.\n    That is, It does not perform reference counting.\n    @note This function does not increment this GpuMatND's reference counter.\n    */\n    GpuMat createGpuMatHeader(IndexArray idx, Range rowRange, Range colRange) const;\n\n    /** @overload\n    Creates a GpuMat header if this GpuMatND is effectively 2D.\n    @note The returned GpuMat is constructed with the constructor for user-allocated data.\n    That is, It does not perform reference counting.\n    @note This function does not increment this GpuMatND's reference counter.\n    */\n    GpuMat createGpuMatHeader() const;\n\n    /** @brief Extracts a 2D plane part of an n-dim matrix.\n    It differs from createGpuMatHeader(IndexArray, Range, Range) in that it clones a part of this\n    GpuMatND to the returned GpuMat.\n    @note This operator does not increment this GpuMatND's reference counter;\n    */\n    GpuMat operator()(IndexArray idx, Range rowRange, Range colRange) const;\n\n    /** @brief Extracts a 2D plane part of an n-dim matrix if this GpuMatND is effectively 2D.\n    It differs from createGpuMatHeader() in that it clones a part of this GpuMatND.\n    @note This operator does not increment this GpuMatND's reference counter;\n    */\n    operator GpuMat() const;\n\n    GpuMatND(const GpuMatND&) = default;\n    GpuMatND& operator=(const GpuMatND&) = default;\n\n#if defined(__GNUC__) && __GNUC__ < 5\n    // error: function '...' defaulted on its first declaration with an exception-specification\n    // that differs from the implicit declaration '...'\n\n    GpuMatND(GpuMatND&&) = default;\n    GpuMatND& operator=(GpuMatND&&) = default;\n#else\n    GpuMatND(GpuMatND&&) noexcept = default;\n    GpuMatND& operator=(GpuMatND&&) noexcept = default;\n#endif\n\n    void upload(InputArray src);\n    void upload(InputArray src, Stream& stream);\n    void download(OutputArray dst) const;\n    void download(OutputArray dst, Stream& stream) const;\n\n    //! returns true iff the GpuMatND data is continuous\n    //! (i.e. when there are no gaps between successive rows)\n    bool isContinuous() const;\n\n    //! returns true if the matrix is a sub-matrix of another matrix\n    bool isSubmatrix() const;\n\n    //! returns element size in bytes\n    size_t elemSize() const;\n\n    //! returns the size of element channel in bytes\n    size_t elemSize1() const;\n\n    //! returns true if data is null\n    bool empty() const;\n\n    //! returns true if not empty and points to external(user-allocated) gpu memory\n    bool external() const;\n\n    //! returns pointer to the first byte of the GPU memory\n    uchar* getDevicePtr() const;\n\n    //! returns the total number of array elements\n    size_t total() const;\n\n    //! returns the size of underlying memory in bytes\n    size_t totalMemSize() const;\n\n    //! returns element type\n    int type() const;\n\nprivate:\n    //! internal use\n    void setFields(SizeArray size, int type, StepArray step = StepArray());\n\npublic:\n    /*! includes several bit-fields:\n    - the magic signature\n    - continuity flag\n    - depth\n    - number of channels\n    */\n    int flags;\n\n    //! matrix dimensionality\n    int dims;\n\n    //! shape of this array\n    SizeArray size;\n\n    /*! step values\n    Their semantics is identical to the semantics of step for Mat.\n    */\n    StepArray step;\n\nprivate:\n    /*! internal use\n    If this GpuMatND holds external memory, this is empty.\n    */\n    std::shared_ptr<GpuData> data_;\n\n    /*! internal use\n    If this GpuMatND manages memory with reference counting, this value is\n    always equal to data_->data. If this GpuMatND holds external memory,\n    data_ is empty and data points to the external memory.\n    */\n    uchar* data;\n\n    /*! internal use\n    If this GpuMatND is a sub-matrix of a larger matrix, this value is the\n    difference of the first byte between the sub-matrix and the whole matrix.\n    */\n    size_t offset;\n};\n\n/** @brief Creates a continuous matrix.\n\n@param rows Row count.\n@param cols Column count.\n@param type Type of the matrix.\n@param arr Destination matrix. This parameter changes only if it has a proper type and area (\n\\f$\\texttt{rows} \\times \\texttt{cols}\\f$ ).\n\nMatrix is called continuous if its elements are stored continuously, that is, without gaps at the\nend of each row.\n */\nCV_EXPORTS_W void createContinuous(int rows, int cols, int type, OutputArray arr);\n\n/** @brief Ensures that the size of a matrix is big enough and the matrix has a proper type.\n\n@param rows Minimum desired number of rows.\n@param cols Minimum desired number of columns.\n@param type Desired matrix type.\n@param arr Destination matrix.\n\nThe function does not reallocate memory if the matrix has proper attributes already.\n */\nCV_EXPORTS_W void ensureSizeIsEnough(int rows, int cols, int type, OutputArray arr);\n\n/** @brief BufferPool for use with CUDA streams\n\nBufferPool utilizes Stream's allocator to create new buffers for GpuMat's. It is\nonly useful when enabled with #setBufferPoolUsage.\n\n@code\n    setBufferPoolUsage(true);\n@endcode\n\n@note #setBufferPoolUsage must be called \\em before any Stream declaration.\n\nUsers may specify custom allocator for Stream and may implement their own stream based\nfunctions utilizing the same underlying GPU memory management.\n\nIf custom allocator is not specified, BufferPool utilizes StackAllocator by\ndefault. StackAllocator allocates a chunk of GPU device memory beforehand,\nand when GpuMat is declared later on, it is given the pre-allocated memory.\nThis kind of strategy reduces the number of calls for memory allocating APIs\nsuch as cudaMalloc or cudaMallocPitch.\n\nBelow is an example that utilizes BufferPool with StackAllocator:\n\n@code\n    #include <opencv2/opencv.hpp>\n\n    using namespace cv;\n    using namespace cv::cuda\n\n    int main()\n    {\n        setBufferPoolUsage(true);                               // Tell OpenCV that we are going to utilize BufferPool\n        setBufferPoolConfig(getDevice(), 1024 * 1024 * 64, 2);  // Allocate 64 MB, 2 stacks (default is 10 MB, 5 stacks)\n\n        Stream stream1, stream2;                                // Each stream uses 1 stack\n        BufferPool pool1(stream1), pool2(stream2);\n\n        GpuMat d_src1 = pool1.getBuffer(4096, 4096, CV_8UC1);   // 16MB\n        GpuMat d_dst1 = pool1.getBuffer(4096, 4096, CV_8UC3);   // 48MB, pool1 is now full\n\n        GpuMat d_src2 = pool2.getBuffer(1024, 1024, CV_8UC1);   // 1MB\n        GpuMat d_dst2 = pool2.getBuffer(1024, 1024, CV_8UC3);   // 3MB\n\n        cvtColor(d_src1, d_dst1, CV_GRAY2BGR, 0, stream1);\n        cvtColor(d_src2, d_dst2, CV_GRAY2BGR, 0, stream2);\n    }\n@endcode\n\nIf we allocate another GpuMat on pool1 in the above example, it will be carried out by\nthe DefaultAllocator since the stack for pool1 is full.\n\n@code\n    GpuMat d_add1 = pool1.getBuffer(1024, 1024, CV_8UC1);   // Stack for pool1 is full, memory is allocated with DefaultAllocator\n@endcode\n\nIf a third stream is declared in the above example, allocating with #getBuffer\nwithin that stream will also be carried out by the DefaultAllocator because we've run out of\nstacks.\n\n@code\n    Stream stream3;                                         // Only 2 stacks were allocated, we've run out of stacks\n    BufferPool pool3(stream3);\n    GpuMat d_src3 = pool3.getBuffer(1024, 1024, CV_8UC1);   // Memory is allocated with DefaultAllocator\n@endcode\n\n@warning When utilizing StackAllocator, deallocation order is important.\n\nJust like a stack, deallocation must be done in LIFO order. Below is an example of\nerroneous usage that violates LIFO rule. If OpenCV is compiled in Debug mode, this\nsample code will emit CV_Assert error.\n\n@code\n    int main()\n    {\n        setBufferPoolUsage(true);                               // Tell OpenCV that we are going to utilize BufferPool\n        Stream stream;                                          // A default size (10 MB) stack is allocated to this stream\n        BufferPool pool(stream);\n\n        GpuMat mat1 = pool.getBuffer(1024, 1024, CV_8UC1);      // Allocate mat1 (1MB)\n        GpuMat mat2 = pool.getBuffer(1024, 1024, CV_8UC1);      // Allocate mat2 (1MB)\n\n        mat1.release();                                         // erroneous usage : mat2 must be deallocated before mat1\n    }\n@endcode\n\nSince C++ local variables are destroyed in the reverse order of construction,\nthe code sample below satisfies the LIFO rule. Local GpuMat's are deallocated\nand the corresponding memory is automatically returned to the pool for later usage.\n\n@code\n    int main()\n    {\n        setBufferPoolUsage(true);                               // Tell OpenCV that we are going to utilize BufferPool\n        setBufferPoolConfig(getDevice(), 1024 * 1024 * 64, 2);  // Allocate 64 MB, 2 stacks (default is 10 MB, 5 stacks)\n\n        Stream stream1, stream2;                                // Each stream uses 1 stack\n        BufferPool pool1(stream1), pool2(stream2);\n\n        for (int i = 0; i < 10; i++)\n        {\n            GpuMat d_src1 = pool1.getBuffer(4096, 4096, CV_8UC1);   // 16MB\n            GpuMat d_dst1 = pool1.getBuffer(4096, 4096, CV_8UC3);   // 48MB, pool1 is now full\n\n            GpuMat d_src2 = pool2.getBuffer(1024, 1024, CV_8UC1);   // 1MB\n            GpuMat d_dst2 = pool2.getBuffer(1024, 1024, CV_8UC3);   // 3MB\n\n            d_src1.setTo(Scalar(i), stream1);\n            d_src2.setTo(Scalar(i), stream2);\n\n            cvtColor(d_src1, d_dst1, CV_GRAY2BGR, 0, stream1);\n            cvtColor(d_src2, d_dst2, CV_GRAY2BGR, 0, stream2);\n                                                                    // The order of destruction of the local variables is:\n                                                                    //   d_dst2 => d_src2 => d_dst1 => d_src1\n                                                                    // LIFO rule is satisfied, this code runs without error\n        }\n    }\n@endcode\n */\nclass CV_EXPORTS_W BufferPool\n{\npublic:\n\n    //! Gets the BufferPool for the given stream.\n    explicit BufferPool(Stream& stream);\n\n    //! Allocates a new GpuMat of given size and type.\n    CV_WRAP GpuMat getBuffer(int rows, int cols, int type);\n\n    //! Allocates a new GpuMat of given size and type.\n    CV_WRAP GpuMat getBuffer(Size size, int type) { return getBuffer(size.height, size.width, type); }\n\n    //! Returns the allocator associated with the stream.\n    CV_WRAP Ptr<GpuMat::Allocator> getAllocator() const { return allocator_; }\n\nprivate:\n    Ptr<GpuMat::Allocator> allocator_;\n};\n\n//! BufferPool management (must be called before Stream creation)\nCV_EXPORTS_W void setBufferPoolUsage(bool on);\nCV_EXPORTS_W void setBufferPoolConfig(int deviceId, size_t stackSize, int stackCount);\n\n//===================================================================================\n// HostMem\n//===================================================================================\n\n/** @brief Class with reference counting wrapping special memory type allocation functions from CUDA.\n\nIts interface is also Mat-like but with additional memory type parameters.\n\n-   **PAGE_LOCKED** sets a page locked memory type used commonly for fast and asynchronous\n    uploading/downloading data from/to GPU.\n-   **SHARED** specifies a zero copy memory allocation that enables mapping the host memory to GPU\n    address space, if supported.\n-   **WRITE_COMBINED** sets the write combined buffer that is not cached by CPU. Such buffers are\n    used to supply GPU with data when GPU only reads it. The advantage is a better CPU cache\n    utilization.\n\n@note Allocation size of such memory types is usually limited. For more details, see *CUDA 2.2\nPinned Memory APIs* document or *CUDA C Programming Guide*.\n */\nclass CV_EXPORTS_W HostMem\n{\npublic:\n    enum AllocType { PAGE_LOCKED = 1, SHARED = 2, WRITE_COMBINED = 4 };\n\n    static MatAllocator* getAllocator(HostMem::AllocType alloc_type = HostMem::AllocType::PAGE_LOCKED);\n\n    CV_WRAP explicit HostMem(HostMem::AllocType alloc_type = HostMem::AllocType::PAGE_LOCKED);\n\n    HostMem(const HostMem& m);\n\n    CV_WRAP HostMem(int rows, int cols, int type, HostMem::AllocType alloc_type = HostMem::AllocType::PAGE_LOCKED);\n    CV_WRAP HostMem(Size size, int type, HostMem::AllocType alloc_type = HostMem::AllocType::PAGE_LOCKED);\n\n    //! creates from host memory with coping data\n    CV_WRAP explicit HostMem(InputArray arr, HostMem::AllocType alloc_type = HostMem::AllocType::PAGE_LOCKED);\n\n    ~HostMem();\n\n    HostMem& operator =(const HostMem& m);\n\n    //! swaps with other smart pointer\n    CV_WRAP void swap(HostMem& b);\n\n    //! returns deep copy of the matrix, i.e. the data is copied\n    CV_WRAP HostMem clone() const;\n\n    //! allocates new matrix data unless the matrix already has specified size and type.\n    CV_WRAP void create(int rows, int cols, int type);\n    void create(Size size, int type);\n\n    //! creates alternative HostMem header for the same data, with different\n    //! number of channels and/or different number of rows\n    CV_WRAP HostMem reshape(int cn, int rows = 0) const;\n\n    //! decrements reference counter and released memory if needed.\n    void release();\n\n    //! returns matrix header with disabled reference counting for HostMem data.\n    CV_WRAP Mat createMatHeader() const;\n\n    /** @brief Maps CPU memory to GPU address space and creates the cuda::GpuMat header without reference counting\n    for it.\n\n    This can be done only if memory was allocated with the SHARED flag and if it is supported by the\n    hardware. Laptops often share video and CPU memory, so address spaces can be mapped, which\n    eliminates an extra copy.\n     */\n    GpuMat createGpuMatHeader() const;\n\n    // Please see cv::Mat for descriptions\n    CV_WRAP bool isContinuous() const;\n    CV_WRAP size_t elemSize() const;\n    CV_WRAP size_t elemSize1() const;\n    CV_WRAP int type() const;\n    CV_WRAP int depth() const;\n    CV_WRAP int channels() const;\n    CV_WRAP size_t step1() const;\n    CV_WRAP Size size() const;\n    CV_WRAP bool empty() const;\n\n    // Please see cv::Mat for descriptions\n    int flags;\n    int rows, cols;\n    CV_PROP size_t step;\n\n    uchar* data;\n    int* refcount;\n\n    uchar* datastart;\n    const uchar* dataend;\n\n    AllocType alloc_type;\n};\n\n/** @brief Page-locks the memory of matrix and maps it for the device(s).\n\n@param m Input matrix.\n */\nCV_EXPORTS_W void registerPageLocked(Mat& m);\n\n/** @brief Unmaps the memory of matrix and makes it pageable again.\n\n@param m Input matrix.\n */\nCV_EXPORTS_W void unregisterPageLocked(Mat& m);\n\n//===================================================================================\n// Stream\n//===================================================================================\n\n/** @brief This class encapsulates a queue of asynchronous calls.\n\n@note Currently, you may face problems if an operation is enqueued twice with different data. Some\nfunctions use the constant GPU memory, and next call may update the memory before the previous one\nhas been finished. But calling different operations asynchronously is safe because each operation\nhas its own constant buffer. Memory copy/upload/download/set operations to the buffers you hold are\nalso safe.\n\n@note The Stream class is not thread-safe. Please use different Stream objects for different CPU threads.\n\n@code\nvoid thread1()\n{\n    cv::cuda::Stream stream1;\n    cv::cuda::func1(..., stream1);\n}\n\nvoid thread2()\n{\n    cv::cuda::Stream stream2;\n    cv::cuda::func2(..., stream2);\n}\n@endcode\n\n@note By default all CUDA routines are launched in Stream::Null() object, if the stream is not specified by user.\nIn multi-threading environment the stream objects must be passed explicitly (see previous note).\n */\nclass CV_EXPORTS_W Stream\n{\n    typedef void (Stream::*bool_type)() const;\n    void this_type_does_not_support_comparisons() const {}\n\npublic:\n    typedef void (*StreamCallback)(int status, void* userData);\n\n    //! creates a new asynchronous stream\n    CV_WRAP Stream();\n\n    //! creates a new asynchronous stream with custom allocator\n    CV_WRAP Stream(const Ptr<GpuMat::Allocator>& allocator);\n\n    /** @brief creates a new Stream using the cudaFlags argument to determine the behaviors of the stream\n\n    @note The cudaFlags parameter is passed to the underlying api cudaStreamCreateWithFlags() and\n    supports the same parameter values.\n    @code\n        // creates an OpenCV cuda::Stream that manages an asynchronous, non-blocking,\n        // non-default CUDA stream\n        cv::cuda::Stream cvStream(cudaStreamNonBlocking);\n    @endcode\n     */\n    CV_WRAP Stream(const size_t cudaFlags);\n\n    /** @brief Returns true if the current stream queue is finished. Otherwise, it returns false.\n    */\n    CV_WRAP bool queryIfComplete() const;\n\n    /** @brief Blocks the current CPU thread until all operations in the stream are complete.\n    */\n    CV_WRAP void waitForCompletion();\n\n    /** @brief Makes a compute stream wait on an event.\n    */\n    CV_WRAP void waitEvent(const Event& event);\n\n    /** @brief Adds a callback to be called on the host after all currently enqueued items in the stream have\n    completed.\n\n    @note Callbacks must not make any CUDA API calls. Callbacks must not perform any synchronization\n    that may depend on outstanding device work or other callbacks that are not mandated to run earlier.\n    Callbacks without a mandated order (in independent streams) execute in undefined order and may be\n    serialized.\n     */\n    void enqueueHostCallback(StreamCallback callback, void* userData);\n\n    //! return Stream object for default CUDA stream\n    CV_WRAP static Stream& Null();\n\n    //! returns true if stream object is not default (!= 0)\n    operator bool_type() const;\n\n    //! return Pointer to CUDA stream\n    CV_WRAP void* cudaPtr() const;\n\n    class Impl;\n\nprivate:\n    Ptr<Impl> impl_;\n    Stream(const Ptr<Impl>& impl);\n\n    friend struct StreamAccessor;\n    friend class BufferPool;\n    friend class DefaultDeviceInitializer;\n};\n\nclass CV_EXPORTS_W Event\n{\npublic:\n    enum CreateFlags\n    {\n        DEFAULT        = 0x00,  /**< Default event flag */\n        BLOCKING_SYNC  = 0x01,  /**< Event uses blocking synchronization */\n        DISABLE_TIMING = 0x02,  /**< Event will not record timing data */\n        INTERPROCESS   = 0x04   /**< Event is suitable for interprocess use. DisableTiming must be set */\n    };\n\n    CV_WRAP explicit Event(Event::CreateFlags flags = Event::CreateFlags::DEFAULT);\n\n    //! records an event\n    CV_WRAP void record(Stream& stream = Stream::Null());\n\n    //! queries an event's status\n    CV_WRAP bool queryIfComplete() const;\n\n    //! waits for an event to complete\n    CV_WRAP void waitForCompletion();\n\n    //! computes the elapsed time between events\n    CV_WRAP static float elapsedTime(const Event& start, const Event& end);\n\n    class Impl;\n\nprivate:\n    Ptr<Impl> impl_;\n    Event(const Ptr<Impl>& impl);\n\n    friend struct EventAccessor;\n};\n\n//! @} cudacore_struct\n\n//===================================================================================\n// Initialization & Info\n//===================================================================================\n\n//! @addtogroup cudacore_init\n//! @{\n\n/** @brief Returns the number of installed CUDA-enabled devices.\n\nUse this function before any other CUDA functions calls. If OpenCV is compiled without CUDA support,\nthis function returns 0. If the CUDA driver is not installed, or is incompatible, this function\nreturns -1.\n */\nCV_EXPORTS_W int getCudaEnabledDeviceCount();\n\n/** @brief Sets a device and initializes it for the current thread.\n\n@param device System index of a CUDA device starting with 0.\n\nIf the call of this function is omitted, a default device is initialized at the fist CUDA usage.\n */\nCV_EXPORTS_W void setDevice(int device);\n\n/** @brief Returns the current device index set by cuda::setDevice or initialized by default.\n */\nCV_EXPORTS_W int getDevice();\n\n/** @brief Explicitly destroys and cleans up all resources associated with the current device in the current\nprocess.\n\nAny subsequent API call to this device will reinitialize the device.\n */\nCV_EXPORTS_W void resetDevice();\n\n/** @brief Enumeration providing CUDA computing features.\n */\nenum FeatureSet\n{\n    FEATURE_SET_COMPUTE_10 = 10,\n    FEATURE_SET_COMPUTE_11 = 11,\n    FEATURE_SET_COMPUTE_12 = 12,\n    FEATURE_SET_COMPUTE_13 = 13,\n    FEATURE_SET_COMPUTE_20 = 20,\n    FEATURE_SET_COMPUTE_21 = 21,\n    FEATURE_SET_COMPUTE_30 = 30,\n    FEATURE_SET_COMPUTE_32 = 32,\n    FEATURE_SET_COMPUTE_35 = 35,\n    FEATURE_SET_COMPUTE_50 = 50,\n\n    GLOBAL_ATOMICS = FEATURE_SET_COMPUTE_11,\n    SHARED_ATOMICS = FEATURE_SET_COMPUTE_12,\n    NATIVE_DOUBLE = FEATURE_SET_COMPUTE_13,\n    WARP_SHUFFLE_FUNCTIONS = FEATURE_SET_COMPUTE_30,\n    DYNAMIC_PARALLELISM = FEATURE_SET_COMPUTE_35\n};\n\n//! checks whether current device supports the given feature\nCV_EXPORTS bool deviceSupports(FeatureSet feature_set);\n\n/** @brief Class providing a set of static methods to check what NVIDIA\\* card architecture the CUDA module was\nbuilt for.\n\nAccording to the CUDA C Programming Guide Version 3.2: \"PTX code produced for some specific compute\ncapability can always be compiled to binary code of greater or equal compute capability\".\n */\nclass CV_EXPORTS_W TargetArchs\n{\npublic:\n    /** @brief The following method checks whether the module was built with the support of the given feature:\n\n    @param feature_set Features to be checked. See :ocvcuda::FeatureSet.\n     */\n    static bool builtWith(FeatureSet feature_set);\n\n    /** @brief There is a set of methods to check whether the module contains intermediate (PTX) or binary CUDA\n    code for the given architecture(s):\n\n    @param major Major compute capability version.\n    @param minor Minor compute capability version.\n     */\n    CV_WRAP static bool has(int major, int minor);\n    CV_WRAP static bool hasPtx(int major, int minor);\n    CV_WRAP static bool hasBin(int major, int minor);\n\n    CV_WRAP static bool hasEqualOrLessPtx(int major, int minor);\n    CV_WRAP static bool hasEqualOrGreater(int major, int minor);\n    CV_WRAP static bool hasEqualOrGreaterPtx(int major, int minor);\n    CV_WRAP static bool hasEqualOrGreaterBin(int major, int minor);\n};\n\n/** @brief Class providing functionality for querying the specified GPU properties.\n */\nclass CV_EXPORTS_W DeviceInfo\n{\npublic:\n    //! creates DeviceInfo object for the current GPU\n    CV_WRAP DeviceInfo();\n\n    /** @brief The constructors.\n\n    @param device_id System index of the CUDA device starting with 0.\n\n    Constructs the DeviceInfo object for the specified device. If device_id parameter is missed, it\n    constructs an object for the current device.\n     */\n    CV_WRAP DeviceInfo(int device_id);\n\n    /** @brief Returns system index of the CUDA device starting with 0.\n    */\n    CV_WRAP int deviceID() const;\n\n    //! ASCII string identifying device\n    const char* name() const;\n\n    //! global memory available on device in bytes\n    CV_WRAP size_t totalGlobalMem() const;\n\n    //! shared memory available per block in bytes\n    CV_WRAP size_t sharedMemPerBlock() const;\n\n    //! 32-bit registers available per block\n    CV_WRAP int regsPerBlock() const;\n\n    //! warp size in threads\n    CV_WRAP int warpSize() const;\n\n    //! maximum pitch in bytes allowed by memory copies\n    CV_WRAP size_t memPitch() const;\n\n    //! maximum number of threads per block\n    CV_WRAP int maxThreadsPerBlock() const;\n\n    //! maximum size of each dimension of a block\n    CV_WRAP Vec3i maxThreadsDim() const;\n\n    //! maximum size of each dimension of a grid\n    CV_WRAP Vec3i maxGridSize() const;\n\n    //! clock frequency in kilohertz\n    CV_WRAP int clockRate() const;\n\n    //! constant memory available on device in bytes\n    CV_WRAP size_t totalConstMem() const;\n\n    //! major compute capability\n    CV_WRAP int majorVersion() const;\n\n    //! minor compute capability\n    CV_WRAP int minorVersion() const;\n\n    //! alignment requirement for textures\n    CV_WRAP size_t textureAlignment() const;\n\n    //! pitch alignment requirement for texture references bound to pitched memory\n    CV_WRAP size_t texturePitchAlignment() const;\n\n    //! number of multiprocessors on device\n    CV_WRAP int multiProcessorCount() const;\n\n    //! specified whether there is a run time limit on kernels\n    CV_WRAP bool kernelExecTimeoutEnabled() const;\n\n    //! device is integrated as opposed to discrete\n    CV_WRAP bool integrated() const;\n\n    //! device can map host memory with cudaHostAlloc/cudaHostGetDevicePointer\n    CV_WRAP bool canMapHostMemory() const;\n\n    enum ComputeMode\n    {\n        ComputeModeDefault,         /**< default compute mode (Multiple threads can use cudaSetDevice with this device) */\n        ComputeModeExclusive,       /**< compute-exclusive-thread mode (Only one thread in one process will be able to use cudaSetDevice with this device) */\n        ComputeModeProhibited,      /**< compute-prohibited mode (No threads can use cudaSetDevice with this device) */\n        ComputeModeExclusiveProcess /**< compute-exclusive-process mode (Many threads in one process will be able to use cudaSetDevice with this device) */\n    };\n\n    //! compute mode\n    CV_WRAP DeviceInfo::ComputeMode computeMode() const;\n\n    //! maximum 1D texture size\n    CV_WRAP int maxTexture1D() const;\n\n    //! maximum 1D mipmapped texture size\n    CV_WRAP int maxTexture1DMipmap() const;\n\n    //! maximum size for 1D textures bound to linear memory\n    CV_WRAP int maxTexture1DLinear() const;\n\n    //! maximum 2D texture dimensions\n    CV_WRAP Vec2i maxTexture2D() const;\n\n    //! maximum 2D mipmapped texture dimensions\n    CV_WRAP Vec2i maxTexture2DMipmap() const;\n\n    //! maximum dimensions (width, height, pitch) for 2D textures bound to pitched memory\n    CV_WRAP Vec3i maxTexture2DLinear() const;\n\n    //! maximum 2D texture dimensions if texture gather operations have to be performed\n    CV_WRAP Vec2i maxTexture2DGather() const;\n\n    //! maximum 3D texture dimensions\n    CV_WRAP Vec3i maxTexture3D() const;\n\n    //! maximum Cubemap texture dimensions\n    CV_WRAP int maxTextureCubemap() const;\n\n    //! maximum 1D layered texture dimensions\n    CV_WRAP Vec2i maxTexture1DLayered() const;\n\n    //! maximum 2D layered texture dimensions\n    CV_WRAP Vec3i maxTexture2DLayered() const;\n\n    //! maximum Cubemap layered texture dimensions\n    CV_WRAP Vec2i maxTextureCubemapLayered() const;\n\n    //! maximum 1D surface size\n    CV_WRAP int maxSurface1D() const;\n\n    //! maximum 2D surface dimensions\n    CV_WRAP Vec2i maxSurface2D() const;\n\n    //! maximum 3D surface dimensions\n    CV_WRAP Vec3i maxSurface3D() const;\n\n    //! maximum 1D layered surface dimensions\n    CV_WRAP Vec2i maxSurface1DLayered() const;\n\n    //! maximum 2D layered surface dimensions\n    CV_WRAP Vec3i maxSurface2DLayered() const;\n\n    //! maximum Cubemap surface dimensions\n    CV_WRAP int maxSurfaceCubemap() const;\n\n    //! maximum Cubemap layered surface dimensions\n    CV_WRAP Vec2i maxSurfaceCubemapLayered() const;\n\n    //! alignment requirements for surfaces\n    CV_WRAP size_t surfaceAlignment() const;\n\n    //! device can possibly execute multiple kernels concurrently\n    CV_WRAP bool concurrentKernels() const;\n\n    //! device has ECC support enabled\n    CV_WRAP bool ECCEnabled() const;\n\n    //! PCI bus ID of the device\n    CV_WRAP int pciBusID() const;\n\n    //! PCI device ID of the device\n    CV_WRAP int pciDeviceID() const;\n\n    //! PCI domain ID of the device\n    CV_WRAP int pciDomainID() const;\n\n    //! true if device is a Tesla device using TCC driver, false otherwise\n    CV_WRAP bool tccDriver() const;\n\n    //! number of asynchronous engines\n    CV_WRAP int asyncEngineCount() const;\n\n    //! device shares a unified address space with the host\n    CV_WRAP bool unifiedAddressing() const;\n\n    //! peak memory clock frequency in kilohertz\n    CV_WRAP int memoryClockRate() const;\n\n    //! global memory bus width in bits\n    CV_WRAP int memoryBusWidth() const;\n\n    //! size of L2 cache in bytes\n    CV_WRAP int l2CacheSize() const;\n\n    //! maximum resident threads per multiprocessor\n    CV_WRAP int maxThreadsPerMultiProcessor() const;\n\n    //! gets free and total device memory\n    CV_WRAP void queryMemory(size_t& totalMemory, size_t& freeMemory) const;\n    CV_WRAP size_t freeMemory() const;\n    CV_WRAP size_t totalMemory() const;\n\n    /** @brief Provides information on CUDA feature support.\n\n    @param feature_set Features to be checked. See cuda::FeatureSet.\n\n    This function returns true if the device has the specified CUDA feature. Otherwise, it returns false\n     */\n    bool supports(FeatureSet feature_set) const;\n\n    /** @brief Checks the CUDA module and device compatibility.\n\n    This function returns true if the CUDA module can be run on the specified device. Otherwise, it\n    returns false .\n     */\n    CV_WRAP bool isCompatible() const;\n\nprivate:\n    int device_id_;\n};\n\nCV_EXPORTS_W void printCudaDeviceInfo(int device);\nCV_EXPORTS_W void printShortCudaDeviceInfo(int device);\n\n/** @brief Converts an array to half precision floating number.\n\n@param _src input array.\n@param _dst output array.\n@param stream Stream for the asynchronous version.\n@sa convertFp16\n*/\nCV_EXPORTS void convertFp16(InputArray _src, OutputArray _dst, Stream& stream = Stream::Null());\n\n//! @} cudacore_init\n\n}} // namespace cv { namespace cuda {\n\n\n#include \"opencv2/core/cuda.inl.hpp\"\n\n#endif /* OPENCV_CORE_CUDA_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda.inl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_CUDAINL_HPP\n#define OPENCV_CORE_CUDAINL_HPP\n\n#include \"opencv2/core/cuda.hpp\"\n\n//! @cond IGNORED\n\nnamespace cv { namespace cuda {\n\n//===================================================================================\n// GpuMat\n//===================================================================================\n\ninline\nGpuMat::GpuMat(Allocator* allocator_)\n    : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_)\n{}\n\ninline\nGpuMat::GpuMat(int rows_, int cols_, int type_, Allocator* allocator_)\n    : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_)\n{\n    if (rows_ > 0 && cols_ > 0)\n        create(rows_, cols_, type_);\n}\n\ninline\nGpuMat::GpuMat(Size size_, int type_, Allocator* allocator_)\n    : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_)\n{\n    if (size_.height > 0 && size_.width > 0)\n        create(size_.height, size_.width, type_);\n}\n\ninline\nGpuMat::GpuMat(int rows_, int cols_, int type_, Scalar s_, Allocator* allocator_)\n    : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_)\n{\n    if (rows_ > 0 && cols_ > 0)\n    {\n        create(rows_, cols_, type_);\n        setTo(s_);\n    }\n}\n\ninline\nGpuMat::GpuMat(Size size_, int type_, Scalar s_, Allocator* allocator_)\n    : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_)\n{\n    if (size_.height > 0 && size_.width > 0)\n    {\n        create(size_.height, size_.width, type_);\n        setTo(s_);\n    }\n}\n\ninline\nGpuMat::GpuMat(const GpuMat& m)\n    : flags(m.flags), rows(m.rows), cols(m.cols), step(m.step), data(m.data), refcount(m.refcount), datastart(m.datastart), dataend(m.dataend), allocator(m.allocator)\n{\n    if (refcount)\n        CV_XADD(refcount, 1);\n}\n\ninline\nGpuMat::GpuMat(InputArray arr, Allocator* allocator_) :\n    flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_)\n{\n    upload(arr);\n}\n\ninline\nGpuMat::~GpuMat()\n{\n    release();\n}\n\ninline\nGpuMat& GpuMat::operator =(const GpuMat& m)\n{\n    if (this != &m)\n    {\n        GpuMat temp(m);\n        swap(temp);\n    }\n\n    return *this;\n}\n\ninline\nvoid GpuMat::create(Size size_, int type_)\n{\n    create(size_.height, size_.width, type_);\n}\n\ninline\nvoid GpuMat::swap(GpuMat& b)\n{\n    std::swap(flags, b.flags);\n    std::swap(rows, b.rows);\n    std::swap(cols, b.cols);\n    std::swap(step, b.step);\n    std::swap(data, b.data);\n    std::swap(datastart, b.datastart);\n    std::swap(dataend, b.dataend);\n    std::swap(refcount, b.refcount);\n    std::swap(allocator, b.allocator);\n}\n\ninline\nGpuMat GpuMat::clone() const\n{\n    GpuMat m;\n    copyTo(m);\n    return m;\n}\n\ninline\nvoid GpuMat::copyTo(OutputArray dst, InputArray mask) const\n{\n    copyTo(dst, mask, Stream::Null());\n}\n\ninline\nGpuMat& GpuMat::setTo(Scalar s)\n{\n    return setTo(s, Stream::Null());\n}\n\ninline\nGpuMat& GpuMat::setTo(Scalar s, InputArray mask)\n{\n    return setTo(s, mask, Stream::Null());\n}\n\ninline\nvoid GpuMat::convertTo(OutputArray dst, int rtype) const\n{\n    convertTo(dst, rtype, Stream::Null());\n}\n\ninline\nvoid GpuMat::convertTo(OutputArray dst, int rtype, double alpha, double beta) const\n{\n    convertTo(dst, rtype, alpha, beta, Stream::Null());\n}\n\ninline\nvoid GpuMat::convertTo(OutputArray dst, int rtype, double alpha, Stream& stream) const\n{\n    convertTo(dst, rtype, alpha, 0.0, stream);\n}\n\ninline\nvoid GpuMat::assignTo(GpuMat& m, int _type) const\n{\n    if (_type < 0)\n        m = *this;\n    else\n        convertTo(m, _type);\n}\n\ninline\nuchar* GpuMat::ptr(int y)\n{\n    CV_DbgAssert( (unsigned)y < (unsigned)rows );\n    return data + step * y;\n}\n\ninline\nconst uchar* GpuMat::ptr(int y) const\n{\n    CV_DbgAssert( (unsigned)y < (unsigned)rows );\n    return data + step * y;\n}\n\ntemplate<typename _Tp> inline\n_Tp* GpuMat::ptr(int y)\n{\n    return (_Tp*)ptr(y);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* GpuMat::ptr(int y) const\n{\n    return (const _Tp*)ptr(y);\n}\n\ntemplate <class T> inline\nGpuMat::operator PtrStepSz<T>() const\n{\n    return PtrStepSz<T>(rows, cols, (T*)data, step);\n}\n\ntemplate <class T> inline\nGpuMat::operator PtrStep<T>() const\n{\n    return PtrStep<T>((T*)data, step);\n}\n\ninline\nGpuMat GpuMat::row(int y) const\n{\n    return GpuMat(*this, Range(y, y+1), Range::all());\n}\n\ninline\nGpuMat GpuMat::col(int x) const\n{\n    return GpuMat(*this, Range::all(), Range(x, x+1));\n}\n\ninline\nGpuMat GpuMat::rowRange(int startrow, int endrow) const\n{\n    return GpuMat(*this, Range(startrow, endrow), Range::all());\n}\n\ninline\nGpuMat GpuMat::rowRange(Range r) const\n{\n    return GpuMat(*this, r, Range::all());\n}\n\ninline\nGpuMat GpuMat::colRange(int startcol, int endcol) const\n{\n    return GpuMat(*this, Range::all(), Range(startcol, endcol));\n}\n\ninline\nGpuMat GpuMat::colRange(Range r) const\n{\n    return GpuMat(*this, Range::all(), r);\n}\n\ninline\nGpuMat GpuMat::operator ()(Range rowRange_, Range colRange_) const\n{\n    return GpuMat(*this, rowRange_, colRange_);\n}\n\ninline\nGpuMat GpuMat::operator ()(Rect roi) const\n{\n    return GpuMat(*this, roi);\n}\n\ninline\nbool GpuMat::isContinuous() const\n{\n    return (flags & Mat::CONTINUOUS_FLAG) != 0;\n}\n\ninline\nsize_t GpuMat::elemSize() const\n{\n    return CV_ELEM_SIZE(flags);\n}\n\ninline\nsize_t GpuMat::elemSize1() const\n{\n    return CV_ELEM_SIZE1(flags);\n}\n\ninline\nint GpuMat::type() const\n{\n    return CV_MAT_TYPE(flags);\n}\n\ninline\nint GpuMat::depth() const\n{\n    return CV_MAT_DEPTH(flags);\n}\n\ninline\nint GpuMat::channels() const\n{\n    return CV_MAT_CN(flags);\n}\n\ninline\nsize_t GpuMat::step1() const\n{\n    return step / elemSize1();\n}\n\ninline\nSize GpuMat::size() const\n{\n    return Size(cols, rows);\n}\n\ninline\nbool GpuMat::empty() const\n{\n    return data == 0;\n}\n\ninline\nvoid* GpuMat::cudaPtr() const\n{\n    return data;\n}\n\nstatic inline\nGpuMat createContinuous(int rows, int cols, int type)\n{\n    GpuMat m;\n    createContinuous(rows, cols, type, m);\n    return m;\n}\n\nstatic inline\nvoid createContinuous(Size size, int type, OutputArray arr)\n{\n    createContinuous(size.height, size.width, type, arr);\n}\n\nstatic inline\nGpuMat createContinuous(Size size, int type)\n{\n    GpuMat m;\n    createContinuous(size, type, m);\n    return m;\n}\n\nstatic inline\nvoid ensureSizeIsEnough(Size size, int type, OutputArray arr)\n{\n    ensureSizeIsEnough(size.height, size.width, type, arr);\n}\n\nstatic inline\nvoid swap(GpuMat& a, GpuMat& b)\n{\n    a.swap(b);\n}\n\n//===================================================================================\n// GpuMatND\n//===================================================================================\n\ninline\nGpuMatND::GpuMatND() :\n    flags(0), dims(0), data(nullptr), offset(0)\n{\n}\n\ninline\nGpuMatND::GpuMatND(SizeArray _size, int _type) :\n    flags(0), dims(0), data(nullptr), offset(0)\n{\n    create(std::move(_size), _type);\n}\n\ninline\nvoid GpuMatND::swap(GpuMatND& m) noexcept\n{\n    std::swap(*this, m);\n}\n\ninline\nbool GpuMatND::isContinuous() const\n{\n    return (flags & Mat::CONTINUOUS_FLAG) != 0;\n}\n\ninline\nbool GpuMatND::isSubmatrix() const\n{\n    return (flags & Mat::SUBMATRIX_FLAG) != 0;\n}\n\ninline\nsize_t GpuMatND::elemSize() const\n{\n    return CV_ELEM_SIZE(flags);\n}\n\ninline\nsize_t GpuMatND::elemSize1() const\n{\n    return CV_ELEM_SIZE1(flags);\n}\n\ninline\nbool GpuMatND::empty() const\n{\n    return data == nullptr;\n}\n\ninline\nbool GpuMatND::external() const\n{\n    return !empty() && data_.use_count() == 0;\n}\n\ninline\nuchar* GpuMatND::getDevicePtr() const\n{\n    return data + offset;\n}\n\ninline\nsize_t GpuMatND::total() const\n{\n    size_t p = 1;\n    for(auto s : size)\n        p *= s;\n    return p;\n}\n\ninline\nsize_t GpuMatND::totalMemSize() const\n{\n    return size[0] * step[0];\n}\n\ninline\nint GpuMatND::type() const\n{\n    return CV_MAT_TYPE(flags);\n}\n\n//===================================================================================\n// HostMem\n//===================================================================================\n\ninline\nHostMem::HostMem(AllocType alloc_type_)\n    : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_)\n{\n}\n\ninline\nHostMem::HostMem(const HostMem& m)\n    : flags(m.flags), rows(m.rows), cols(m.cols), step(m.step), data(m.data), refcount(m.refcount), datastart(m.datastart), dataend(m.dataend), alloc_type(m.alloc_type)\n{\n    if( refcount )\n        CV_XADD(refcount, 1);\n}\n\ninline\nHostMem::HostMem(int rows_, int cols_, int type_, AllocType alloc_type_)\n    : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_)\n{\n    if (rows_ > 0 && cols_ > 0)\n        create(rows_, cols_, type_);\n}\n\ninline\nHostMem::HostMem(Size size_, int type_, AllocType alloc_type_)\n    : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_)\n{\n    if (size_.height > 0 && size_.width > 0)\n        create(size_.height, size_.width, type_);\n}\n\ninline\nHostMem::HostMem(InputArray arr, AllocType alloc_type_)\n    : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_)\n{\n    arr.getMat().copyTo(*this);\n}\n\ninline\nHostMem::~HostMem()\n{\n    release();\n}\n\ninline\nHostMem& HostMem::operator =(const HostMem& m)\n{\n    if (this != &m)\n    {\n        HostMem temp(m);\n        swap(temp);\n    }\n\n    return *this;\n}\n\ninline\nvoid HostMem::swap(HostMem& b)\n{\n    std::swap(flags, b.flags);\n    std::swap(rows, b.rows);\n    std::swap(cols, b.cols);\n    std::swap(step, b.step);\n    std::swap(data, b.data);\n    std::swap(datastart, b.datastart);\n    std::swap(dataend, b.dataend);\n    std::swap(refcount, b.refcount);\n    std::swap(alloc_type, b.alloc_type);\n}\n\ninline\nHostMem HostMem::clone() const\n{\n    HostMem m(size(), type(), alloc_type);\n    createMatHeader().copyTo(m);\n    return m;\n}\n\ninline\nvoid HostMem::create(Size size_, int type_)\n{\n    create(size_.height, size_.width, type_);\n}\n\ninline\nMat HostMem::createMatHeader() const\n{\n    return Mat(size(), type(), data, step);\n}\n\ninline\nbool HostMem::isContinuous() const\n{\n    return (flags & Mat::CONTINUOUS_FLAG) != 0;\n}\n\ninline\nsize_t HostMem::elemSize() const\n{\n    return CV_ELEM_SIZE(flags);\n}\n\ninline\nsize_t HostMem::elemSize1() const\n{\n    return CV_ELEM_SIZE1(flags);\n}\n\ninline\nint HostMem::type() const\n{\n    return CV_MAT_TYPE(flags);\n}\n\ninline\nint HostMem::depth() const\n{\n    return CV_MAT_DEPTH(flags);\n}\n\ninline\nint HostMem::channels() const\n{\n    return CV_MAT_CN(flags);\n}\n\ninline\nsize_t HostMem::step1() const\n{\n    return step / elemSize1();\n}\n\ninline\nSize HostMem::size() const\n{\n    return Size(cols, rows);\n}\n\ninline\nbool HostMem::empty() const\n{\n    return data == 0;\n}\n\nstatic inline\nvoid swap(HostMem& a, HostMem& b)\n{\n    a.swap(b);\n}\n\n//===================================================================================\n// Stream\n//===================================================================================\n\ninline\nStream::Stream(const Ptr<Impl>& impl)\n    : impl_(impl)\n{\n}\n\n//===================================================================================\n// Event\n//===================================================================================\n\ninline\nEvent::Event(const Ptr<Impl>& impl)\n    : impl_(impl)\n{\n}\n\n//===================================================================================\n// Initialization & Info\n//===================================================================================\n\ninline\nbool TargetArchs::has(int major, int minor)\n{\n    return hasPtx(major, minor) || hasBin(major, minor);\n}\n\ninline\nbool TargetArchs::hasEqualOrGreater(int major, int minor)\n{\n    return hasEqualOrGreaterPtx(major, minor) || hasEqualOrGreaterBin(major, minor);\n}\n\ninline\nDeviceInfo::DeviceInfo()\n{\n    device_id_ = getDevice();\n}\n\ninline\nDeviceInfo::DeviceInfo(int device_id)\n{\n    CV_Assert( device_id >= 0 && device_id < getCudaEnabledDeviceCount() );\n    device_id_ = device_id;\n}\n\ninline\nint DeviceInfo::deviceID() const\n{\n    return device_id_;\n}\n\ninline\nsize_t DeviceInfo::freeMemory() const\n{\n    size_t _totalMemory = 0, _freeMemory = 0;\n    queryMemory(_totalMemory, _freeMemory);\n    return _freeMemory;\n}\n\ninline\nsize_t DeviceInfo::totalMemory() const\n{\n    size_t _totalMemory = 0, _freeMemory = 0;\n    queryMemory(_totalMemory, _freeMemory);\n    return _totalMemory;\n}\n\ninline\nbool DeviceInfo::supports(FeatureSet feature_set) const\n{\n    int version = majorVersion() * 10 + minorVersion();\n    return version >= feature_set;\n}\n\n\n}} // namespace cv { namespace cuda {\n\n//===================================================================================\n// Mat\n//===================================================================================\n\nnamespace cv {\n\ninline\nMat::Mat(const cuda::GpuMat& m)\n    : flags(0), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows)\n{\n    m.download(*this);\n}\n\n}\n\n//! @endcond\n\n#endif // OPENCV_CORE_CUDAINL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda_stream_accessor.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP\n#define OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP\n\n#ifndef __cplusplus\n#  error cuda_stream_accessor.hpp header must be compiled as C++\n#endif\n\n/** @file cuda_stream_accessor.hpp\n * This is only header file that depends on CUDA Runtime API. All other headers are independent.\n */\n\n#include <cuda_runtime.h>\n#include \"opencv2/core/cuda.hpp\"\n\nnamespace cv\n{\n    namespace cuda\n    {\n\n//! @addtogroup cudacore_struct\n//! @{\n\n        /** @brief Class that enables getting cudaStream_t from cuda::Stream\n         */\n        struct StreamAccessor\n        {\n            CV_EXPORTS static cudaStream_t getStream(const Stream& stream);\n            CV_EXPORTS static Stream wrapStream(cudaStream_t stream);\n        };\n\n        /** @brief Class that enables getting cudaEvent_t from cuda::Event\n         */\n        struct EventAccessor\n        {\n            CV_EXPORTS static cudaEvent_t getEvent(const Event& event);\n            CV_EXPORTS static Event wrapEvent(cudaEvent_t event);\n        };\n\n//! @}\n\n    }\n}\n\n#endif /* OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cuda_types.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_CUDA_TYPES_HPP\n#define OPENCV_CORE_CUDA_TYPES_HPP\n\n#ifndef __cplusplus\n#  error cuda_types.hpp header must be compiled as C++\n#endif\n\n#if defined(__OPENCV_BUILD) && defined(__clang__)\n#pragma clang diagnostic ignored \"-Winconsistent-missing-override\"\n#endif\n#if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5\n#pragma GCC diagnostic ignored \"-Wsuggest-override\"\n#endif\n\n/** @file\n * @deprecated Use @ref cudev instead.\n */\n\n//! @cond IGNORED\n\n#ifdef __CUDACC__\n    #define __CV_CUDA_HOST_DEVICE__ __host__ __device__ __forceinline__\n#else\n    #define __CV_CUDA_HOST_DEVICE__\n#endif\n\nnamespace cv\n{\n    namespace cuda\n    {\n\n        // Simple lightweight structures that encapsulates information about an image on device.\n        // It is intended to pass to nvcc-compiled code. GpuMat depends on headers that nvcc can't compile\n\n        template <typename T> struct DevPtr\n        {\n            typedef T elem_type;\n            typedef int index_type;\n\n            enum { elem_size = sizeof(elem_type) };\n\n            T* data;\n\n            __CV_CUDA_HOST_DEVICE__ DevPtr() : data(0) {}\n            __CV_CUDA_HOST_DEVICE__ DevPtr(T* data_) : data(data_) {}\n\n            __CV_CUDA_HOST_DEVICE__ size_t elemSize() const { return elem_size; }\n            __CV_CUDA_HOST_DEVICE__ operator       T*()       { return data; }\n            __CV_CUDA_HOST_DEVICE__ operator const T*() const { return data; }\n        };\n\n        template <typename T> struct PtrSz : public DevPtr<T>\n        {\n            __CV_CUDA_HOST_DEVICE__ PtrSz() : size(0) {}\n            __CV_CUDA_HOST_DEVICE__ PtrSz(T* data_, size_t size_) : DevPtr<T>(data_), size(size_) {}\n\n            size_t size;\n        };\n\n        template <typename T> struct PtrStep : public DevPtr<T>\n        {\n            __CV_CUDA_HOST_DEVICE__ PtrStep() : step(0) {}\n            __CV_CUDA_HOST_DEVICE__ PtrStep(T* data_, size_t step_) : DevPtr<T>(data_), step(step_) {}\n\n            size_t step;\n\n            __CV_CUDA_HOST_DEVICE__       T* ptr(int y = 0)       { return (      T*)( (      char*)(((DevPtr<T>*)this)->data) + y * step); }\n            __CV_CUDA_HOST_DEVICE__ const T* ptr(int y = 0) const { return (const T*)( (const char*)(((DevPtr<T>*)this)->data) + y * step); }\n\n            __CV_CUDA_HOST_DEVICE__       T& operator ()(int y, int x)       { return ptr(y)[x]; }\n            __CV_CUDA_HOST_DEVICE__ const T& operator ()(int y, int x) const { return ptr(y)[x]; }\n        };\n\n        template <typename T> struct PtrStepSz : public PtrStep<T>\n        {\n            __CV_CUDA_HOST_DEVICE__ PtrStepSz() : cols(0), rows(0) {}\n            __CV_CUDA_HOST_DEVICE__ PtrStepSz(int rows_, int cols_, T* data_, size_t step_)\n                : PtrStep<T>(data_, step_), cols(cols_), rows(rows_) {}\n\n            template <typename U>\n            explicit PtrStepSz(const PtrStepSz<U>& d) : PtrStep<T>((T*)d.data, d.step), cols(d.cols), rows(d.rows){}\n\n            int cols;\n            int rows;\n        };\n\n        typedef PtrStepSz<unsigned char> PtrStepSzb;\n        typedef PtrStepSz<unsigned short> PtrStepSzus;\n        typedef PtrStepSz<float> PtrStepSzf;\n        typedef PtrStepSz<int> PtrStepSzi;\n\n        typedef PtrStep<unsigned char> PtrStepb;\n        typedef PtrStep<unsigned short> PtrStepus;\n        typedef PtrStep<float> PtrStepf;\n        typedef PtrStep<int> PtrStepi;\n\n    }\n}\n\n//! @endcond\n\n#endif /* OPENCV_CORE_CUDA_TYPES_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cv_cpu_dispatch.h",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#if defined __OPENCV_BUILD \\\n\n#include \"cv_cpu_config.h\"\n#include \"cv_cpu_helper.h\"\n\n#ifdef CV_CPU_DISPATCH_MODE\n#define CV_CPU_OPTIMIZATION_NAMESPACE __CV_CAT(opt_, CV_CPU_DISPATCH_MODE)\n#define CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN namespace __CV_CAT(opt_, CV_CPU_DISPATCH_MODE) {\n#define CV_CPU_OPTIMIZATION_NAMESPACE_END }\n#else\n#define CV_CPU_OPTIMIZATION_NAMESPACE cpu_baseline\n#define CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN namespace cpu_baseline {\n#define CV_CPU_OPTIMIZATION_NAMESPACE_END }\n#define CV_CPU_BASELINE_MODE 1\n#endif\n\n\n#define __CV_CPU_DISPATCH_CHAIN_END(fn, args, mode, ...)  /* done */\n#define __CV_CPU_DISPATCH(fn, args, mode, ...) __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n#define __CV_CPU_DISPATCH_EXPAND(fn, args, ...) __CV_EXPAND(__CV_CPU_DISPATCH(fn, args, __VA_ARGS__))\n#define CV_CPU_DISPATCH(fn, args, ...) __CV_CPU_DISPATCH_EXPAND(fn, args, __VA_ARGS__, END) // expand macros\n\n\n#if defined CV_ENABLE_INTRINSICS \\\n    && !defined CV_DISABLE_OPTIMIZATION \\\n    && !defined __CUDACC__ /* do not include SSE/AVX/NEON headers for NVCC compiler */ \\\n\n#ifdef CV_CPU_COMPILE_SSE2\n#  include <emmintrin.h>\n#  define CV_MMX 1\n#  define CV_SSE 1\n#  define CV_SSE2 1\n#endif\n#ifdef CV_CPU_COMPILE_SSE3\n#  include <pmmintrin.h>\n#  define CV_SSE3 1\n#endif\n#ifdef CV_CPU_COMPILE_SSSE3\n#  include <tmmintrin.h>\n#  define CV_SSSE3 1\n#endif\n#ifdef CV_CPU_COMPILE_SSE4_1\n#  include <smmintrin.h>\n#  define CV_SSE4_1 1\n#endif\n#ifdef CV_CPU_COMPILE_SSE4_2\n#  include <nmmintrin.h>\n#  define CV_SSE4_2 1\n#endif\n#ifdef CV_CPU_COMPILE_POPCNT\n#  ifdef _MSC_VER\n#    include <nmmintrin.h>\n#    if defined(_M_X64)\n#      define CV_POPCNT_U64 _mm_popcnt_u64\n#    endif\n#    define CV_POPCNT_U32 _mm_popcnt_u32\n#  else\n#    include <popcntintrin.h>\n#    if defined(__x86_64__)\n#      define CV_POPCNT_U64 __builtin_popcountll\n#    endif\n#    define CV_POPCNT_U32 __builtin_popcount\n#  endif\n#  define CV_POPCNT 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX\n#  include <immintrin.h>\n#  define CV_AVX 1\n#endif\n#ifdef CV_CPU_COMPILE_FP16\n#  if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64)\n#    include <arm_neon.h>\n#  else\n#    include <immintrin.h>\n#  endif\n#  define CV_FP16 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX2\n#  include <immintrin.h>\n#  define CV_AVX2 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX_512F\n#  include <immintrin.h>\n#  define CV_AVX_512F 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX512_COMMON\n#  define CV_AVX512_COMMON 1\n#  define CV_AVX_512CD 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX512_KNL\n#  define CV_AVX512_KNL 1\n#  define CV_AVX_512ER 1\n#  define CV_AVX_512PF 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX512_KNM\n#  define CV_AVX512_KNM 1\n#  define CV_AVX_5124FMAPS 1\n#  define CV_AVX_5124VNNIW 1\n#  define CV_AVX_512VPOPCNTDQ 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX512_SKX\n#  define CV_AVX512_SKX 1\n#  define CV_AVX_512VL 1\n#  define CV_AVX_512BW 1\n#  define CV_AVX_512DQ 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX512_CNL\n#  define CV_AVX512_CNL 1\n#  define CV_AVX_512IFMA 1\n#  define CV_AVX_512VBMI 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX512_CLX\n#  define CV_AVX512_CLX 1\n#  define CV_AVX_512VNNI 1\n#endif\n#ifdef CV_CPU_COMPILE_AVX512_ICL\n#  define CV_AVX512_ICL 1\n#  undef CV_AVX_512IFMA\n#  define CV_AVX_512IFMA 1\n#  undef CV_AVX_512VBMI\n#  define CV_AVX_512VBMI 1\n#  undef CV_AVX_512VNNI\n#  define CV_AVX_512VNNI 1\n#  define CV_AVX_512VBMI2 1\n#  define CV_AVX_512BITALG 1\n#  define CV_AVX_512VPOPCNTDQ 1\n#endif\n#ifdef CV_CPU_COMPILE_FMA3\n#  define CV_FMA3 1\n#endif\n\n#if defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER))\n# include <Intrin.h>\n# include <arm_neon.h>\n# define CV_NEON 1\n#elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__))\n#  include <arm_neon.h>\n#  define CV_NEON 1\n#endif\n\n#if defined(__riscv) && defined(__riscv_vector) && defined(__riscv_vector_071)\n# include<riscv-vector.h>\n# define CV_RVV071 1\n#endif\n\n#if defined(__ARM_NEON__) || defined(__aarch64__)\n#  include <arm_neon.h>\n#endif\n\n#ifdef CV_CPU_COMPILE_VSX\n#  include <altivec.h>\n#  undef vector\n#  undef pixel\n#  undef bool\n#  define CV_VSX 1\n#endif\n\n#ifdef CV_CPU_COMPILE_VSX3\n#  define CV_VSX3 1\n#endif\n\n#ifdef CV_CPU_COMPILE_MSA\n#  include \"hal/msa_macros.h\"\n#  define CV_MSA 1\n#endif\n\n#ifdef __EMSCRIPTEN__\n#  define CV_WASM_SIMD 1\n#  include <wasm_simd128.h>\n#endif\n\n#if defined CV_CPU_COMPILE_RVV\n#  define CV_RVV 1\n#  include <riscv_vector.h>\n#endif\n\n#endif // CV_ENABLE_INTRINSICS && !CV_DISABLE_OPTIMIZATION && !__CUDACC__\n\n#if defined CV_CPU_COMPILE_AVX && !defined CV_CPU_BASELINE_COMPILE_AVX\nstruct VZeroUpperGuard {\n#ifdef __GNUC__\n    __attribute__((always_inline))\n#endif\n    inline VZeroUpperGuard() { _mm256_zeroupper(); }\n#ifdef __GNUC__\n    __attribute__((always_inline))\n#endif\n    inline ~VZeroUpperGuard() { _mm256_zeroupper(); }\n};\n#define __CV_AVX_GUARD VZeroUpperGuard __vzeroupper_guard; CV_UNUSED(__vzeroupper_guard);\n#endif\n\n#ifdef __CV_AVX_GUARD\n#define CV_AVX_GUARD __CV_AVX_GUARD\n#else\n#define CV_AVX_GUARD\n#endif\n\n#endif // __OPENCV_BUILD\n\n\n\n#if !defined __OPENCV_BUILD /* Compatibility code */ \\\n    && !defined __CUDACC__ /* do not include SSE/AVX/NEON headers for NVCC compiler */\n#if defined __SSE2__ || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2)\n#  include <emmintrin.h>\n#  define CV_MMX 1\n#  define CV_SSE 1\n#  define CV_SSE2 1\n#elif defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER))\n# include <Intrin.h>\n# include <arm_neon.h>\n# define CV_NEON 1\n#elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__))\n#  include <arm_neon.h>\n#  define CV_NEON 1\n#elif defined(__VSX__) && defined(__PPC64__) && defined(__LITTLE_ENDIAN__)\n#  include <altivec.h>\n#  undef vector\n#  undef pixel\n#  undef bool\n#  define CV_VSX 1\n#endif\n\n#ifdef __F16C__\n#  include <immintrin.h>\n#  define CV_FP16 1\n#endif\n\n#endif // !__OPENCV_BUILD && !__CUDACC (Compatibility code)\n\n\n\n#ifndef CV_MMX\n#  define CV_MMX 0\n#endif\n#ifndef CV_SSE\n#  define CV_SSE 0\n#endif\n#ifndef CV_SSE2\n#  define CV_SSE2 0\n#endif\n#ifndef CV_SSE3\n#  define CV_SSE3 0\n#endif\n#ifndef CV_SSSE3\n#  define CV_SSSE3 0\n#endif\n#ifndef CV_SSE4_1\n#  define CV_SSE4_1 0\n#endif\n#ifndef CV_SSE4_2\n#  define CV_SSE4_2 0\n#endif\n#ifndef CV_POPCNT\n#  define CV_POPCNT 0\n#endif\n#ifndef CV_AVX\n#  define CV_AVX 0\n#endif\n#ifndef CV_FP16\n#  define CV_FP16 0\n#endif\n#ifndef CV_AVX2\n#  define CV_AVX2 0\n#endif\n#ifndef CV_FMA3\n#  define CV_FMA3 0\n#endif\n#ifndef CV_AVX_512F\n#  define CV_AVX_512F 0\n#endif\n#ifndef CV_AVX_512BW\n#  define CV_AVX_512BW 0\n#endif\n#ifndef CV_AVX_512CD\n#  define CV_AVX_512CD 0\n#endif\n#ifndef CV_AVX_512DQ\n#  define CV_AVX_512DQ 0\n#endif\n#ifndef CV_AVX_512ER\n#  define CV_AVX_512ER 0\n#endif\n#ifndef CV_AVX_512IFMA\n#  define CV_AVX_512IFMA 0\n#endif\n#define CV_AVX_512IFMA512 CV_AVX_512IFMA // deprecated\n#ifndef CV_AVX_512PF\n#  define CV_AVX_512PF 0\n#endif\n#ifndef CV_AVX_512VBMI\n#  define CV_AVX_512VBMI 0\n#endif\n#ifndef CV_AVX_512VL\n#  define CV_AVX_512VL 0\n#endif\n#ifndef CV_AVX_5124FMAPS\n#  define CV_AVX_5124FMAPS 0\n#endif\n#ifndef CV_AVX_5124VNNIW\n#  define CV_AVX_5124VNNIW 0\n#endif\n#ifndef CV_AVX_512VPOPCNTDQ\n#  define CV_AVX_512VPOPCNTDQ 0\n#endif\n#ifndef CV_AVX_512VNNI\n#  define CV_AVX_512VNNI 0\n#endif\n#ifndef CV_AVX_512VBMI2\n#  define CV_AVX_512VBMI2 0\n#endif\n#ifndef CV_AVX_512BITALG\n#  define CV_AVX_512BITALG 0\n#endif\n#ifndef CV_AVX512_COMMON\n#  define CV_AVX512_COMMON 0\n#endif\n#ifndef CV_AVX512_KNL\n#  define CV_AVX512_KNL 0\n#endif\n#ifndef CV_AVX512_KNM\n#  define CV_AVX512_KNM 0\n#endif\n#ifndef CV_AVX512_SKX\n#  define CV_AVX512_SKX 0\n#endif\n#ifndef CV_AVX512_CNL\n#  define CV_AVX512_CNL 0\n#endif\n#ifndef CV_AVX512_CLX\n#  define CV_AVX512_CLX 0\n#endif\n#ifndef CV_AVX512_ICL\n#  define CV_AVX512_ICL 0\n#endif\n\n#ifndef CV_NEON\n#  define CV_NEON 0\n#endif\n\n#ifndef CV_RVV071\n#  define CV_RVV071 0\n#endif\n\n#ifndef CV_VSX\n#  define CV_VSX 0\n#endif\n\n#ifndef CV_VSX3\n#  define CV_VSX3 0\n#endif\n\n#ifndef CV_MSA\n#  define CV_MSA 0\n#endif\n\n#ifndef CV_WASM_SIMD\n#  define CV_WASM_SIMD 0\n#endif\n\n#ifndef CV_RVV\n#  define CV_RVV 0\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cv_cpu_helper.h",
    "content": "// AUTOGENERATED, DO NOT EDIT\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE\n#  define CV_TRY_SSE 1\n#  define CV_CPU_FORCE_SSE 1\n#  define CV_CPU_HAS_SUPPORT_SSE 1\n#  define CV_CPU_CALL_SSE(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_SSE_(fn, args) return (opt_SSE::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE\n#  define CV_TRY_SSE 1\n#  define CV_CPU_FORCE_SSE 0\n#  define CV_CPU_HAS_SUPPORT_SSE (cv::checkHardwareSupport(CV_CPU_SSE))\n#  define CV_CPU_CALL_SSE(fn, args) if (CV_CPU_HAS_SUPPORT_SSE) return (opt_SSE::fn args)\n#  define CV_CPU_CALL_SSE_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE) return (opt_SSE::fn args)\n#else\n#  define CV_TRY_SSE 0\n#  define CV_CPU_FORCE_SSE 0\n#  define CV_CPU_HAS_SUPPORT_SSE 0\n#  define CV_CPU_CALL_SSE(fn, args)\n#  define CV_CPU_CALL_SSE_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_SSE(fn, args, mode, ...)  CV_CPU_CALL_SSE(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE2\n#  define CV_TRY_SSE2 1\n#  define CV_CPU_FORCE_SSE2 1\n#  define CV_CPU_HAS_SUPPORT_SSE2 1\n#  define CV_CPU_CALL_SSE2(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_SSE2_(fn, args) return (opt_SSE2::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE2\n#  define CV_TRY_SSE2 1\n#  define CV_CPU_FORCE_SSE2 0\n#  define CV_CPU_HAS_SUPPORT_SSE2 (cv::checkHardwareSupport(CV_CPU_SSE2))\n#  define CV_CPU_CALL_SSE2(fn, args) if (CV_CPU_HAS_SUPPORT_SSE2) return (opt_SSE2::fn args)\n#  define CV_CPU_CALL_SSE2_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE2) return (opt_SSE2::fn args)\n#else\n#  define CV_TRY_SSE2 0\n#  define CV_CPU_FORCE_SSE2 0\n#  define CV_CPU_HAS_SUPPORT_SSE2 0\n#  define CV_CPU_CALL_SSE2(fn, args)\n#  define CV_CPU_CALL_SSE2_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_SSE2(fn, args, mode, ...)  CV_CPU_CALL_SSE2(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE3\n#  define CV_TRY_SSE3 1\n#  define CV_CPU_FORCE_SSE3 1\n#  define CV_CPU_HAS_SUPPORT_SSE3 1\n#  define CV_CPU_CALL_SSE3(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_SSE3_(fn, args) return (opt_SSE3::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE3\n#  define CV_TRY_SSE3 1\n#  define CV_CPU_FORCE_SSE3 0\n#  define CV_CPU_HAS_SUPPORT_SSE3 (cv::checkHardwareSupport(CV_CPU_SSE3))\n#  define CV_CPU_CALL_SSE3(fn, args) if (CV_CPU_HAS_SUPPORT_SSE3) return (opt_SSE3::fn args)\n#  define CV_CPU_CALL_SSE3_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE3) return (opt_SSE3::fn args)\n#else\n#  define CV_TRY_SSE3 0\n#  define CV_CPU_FORCE_SSE3 0\n#  define CV_CPU_HAS_SUPPORT_SSE3 0\n#  define CV_CPU_CALL_SSE3(fn, args)\n#  define CV_CPU_CALL_SSE3_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_SSE3(fn, args, mode, ...)  CV_CPU_CALL_SSE3(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSSE3\n#  define CV_TRY_SSSE3 1\n#  define CV_CPU_FORCE_SSSE3 1\n#  define CV_CPU_HAS_SUPPORT_SSSE3 1\n#  define CV_CPU_CALL_SSSE3(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_SSSE3_(fn, args) return (opt_SSSE3::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSSE3\n#  define CV_TRY_SSSE3 1\n#  define CV_CPU_FORCE_SSSE3 0\n#  define CV_CPU_HAS_SUPPORT_SSSE3 (cv::checkHardwareSupport(CV_CPU_SSSE3))\n#  define CV_CPU_CALL_SSSE3(fn, args) if (CV_CPU_HAS_SUPPORT_SSSE3) return (opt_SSSE3::fn args)\n#  define CV_CPU_CALL_SSSE3_(fn, args) if (CV_CPU_HAS_SUPPORT_SSSE3) return (opt_SSSE3::fn args)\n#else\n#  define CV_TRY_SSSE3 0\n#  define CV_CPU_FORCE_SSSE3 0\n#  define CV_CPU_HAS_SUPPORT_SSSE3 0\n#  define CV_CPU_CALL_SSSE3(fn, args)\n#  define CV_CPU_CALL_SSSE3_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_SSSE3(fn, args, mode, ...)  CV_CPU_CALL_SSSE3(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE4_1\n#  define CV_TRY_SSE4_1 1\n#  define CV_CPU_FORCE_SSE4_1 1\n#  define CV_CPU_HAS_SUPPORT_SSE4_1 1\n#  define CV_CPU_CALL_SSE4_1(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_SSE4_1_(fn, args) return (opt_SSE4_1::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE4_1\n#  define CV_TRY_SSE4_1 1\n#  define CV_CPU_FORCE_SSE4_1 0\n#  define CV_CPU_HAS_SUPPORT_SSE4_1 (cv::checkHardwareSupport(CV_CPU_SSE4_1))\n#  define CV_CPU_CALL_SSE4_1(fn, args) if (CV_CPU_HAS_SUPPORT_SSE4_1) return (opt_SSE4_1::fn args)\n#  define CV_CPU_CALL_SSE4_1_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE4_1) return (opt_SSE4_1::fn args)\n#else\n#  define CV_TRY_SSE4_1 0\n#  define CV_CPU_FORCE_SSE4_1 0\n#  define CV_CPU_HAS_SUPPORT_SSE4_1 0\n#  define CV_CPU_CALL_SSE4_1(fn, args)\n#  define CV_CPU_CALL_SSE4_1_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_SSE4_1(fn, args, mode, ...)  CV_CPU_CALL_SSE4_1(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE4_2\n#  define CV_TRY_SSE4_2 1\n#  define CV_CPU_FORCE_SSE4_2 1\n#  define CV_CPU_HAS_SUPPORT_SSE4_2 1\n#  define CV_CPU_CALL_SSE4_2(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_SSE4_2_(fn, args) return (opt_SSE4_2::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE4_2\n#  define CV_TRY_SSE4_2 1\n#  define CV_CPU_FORCE_SSE4_2 0\n#  define CV_CPU_HAS_SUPPORT_SSE4_2 (cv::checkHardwareSupport(CV_CPU_SSE4_2))\n#  define CV_CPU_CALL_SSE4_2(fn, args) if (CV_CPU_HAS_SUPPORT_SSE4_2) return (opt_SSE4_2::fn args)\n#  define CV_CPU_CALL_SSE4_2_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE4_2) return (opt_SSE4_2::fn args)\n#else\n#  define CV_TRY_SSE4_2 0\n#  define CV_CPU_FORCE_SSE4_2 0\n#  define CV_CPU_HAS_SUPPORT_SSE4_2 0\n#  define CV_CPU_CALL_SSE4_2(fn, args)\n#  define CV_CPU_CALL_SSE4_2_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_SSE4_2(fn, args, mode, ...)  CV_CPU_CALL_SSE4_2(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_POPCNT\n#  define CV_TRY_POPCNT 1\n#  define CV_CPU_FORCE_POPCNT 1\n#  define CV_CPU_HAS_SUPPORT_POPCNT 1\n#  define CV_CPU_CALL_POPCNT(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_POPCNT_(fn, args) return (opt_POPCNT::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_POPCNT\n#  define CV_TRY_POPCNT 1\n#  define CV_CPU_FORCE_POPCNT 0\n#  define CV_CPU_HAS_SUPPORT_POPCNT (cv::checkHardwareSupport(CV_CPU_POPCNT))\n#  define CV_CPU_CALL_POPCNT(fn, args) if (CV_CPU_HAS_SUPPORT_POPCNT) return (opt_POPCNT::fn args)\n#  define CV_CPU_CALL_POPCNT_(fn, args) if (CV_CPU_HAS_SUPPORT_POPCNT) return (opt_POPCNT::fn args)\n#else\n#  define CV_TRY_POPCNT 0\n#  define CV_CPU_FORCE_POPCNT 0\n#  define CV_CPU_HAS_SUPPORT_POPCNT 0\n#  define CV_CPU_CALL_POPCNT(fn, args)\n#  define CV_CPU_CALL_POPCNT_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_POPCNT(fn, args, mode, ...)  CV_CPU_CALL_POPCNT(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX\n#  define CV_TRY_AVX 1\n#  define CV_CPU_FORCE_AVX 1\n#  define CV_CPU_HAS_SUPPORT_AVX 1\n#  define CV_CPU_CALL_AVX(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX_(fn, args) return (opt_AVX::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX\n#  define CV_TRY_AVX 1\n#  define CV_CPU_FORCE_AVX 0\n#  define CV_CPU_HAS_SUPPORT_AVX (cv::checkHardwareSupport(CV_CPU_AVX))\n#  define CV_CPU_CALL_AVX(fn, args) if (CV_CPU_HAS_SUPPORT_AVX) return (opt_AVX::fn args)\n#  define CV_CPU_CALL_AVX_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX) return (opt_AVX::fn args)\n#else\n#  define CV_TRY_AVX 0\n#  define CV_CPU_FORCE_AVX 0\n#  define CV_CPU_HAS_SUPPORT_AVX 0\n#  define CV_CPU_CALL_AVX(fn, args)\n#  define CV_CPU_CALL_AVX_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX(fn, args, mode, ...)  CV_CPU_CALL_AVX(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_FP16\n#  define CV_TRY_FP16 1\n#  define CV_CPU_FORCE_FP16 1\n#  define CV_CPU_HAS_SUPPORT_FP16 1\n#  define CV_CPU_CALL_FP16(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_FP16_(fn, args) return (opt_FP16::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_FP16\n#  define CV_TRY_FP16 1\n#  define CV_CPU_FORCE_FP16 0\n#  define CV_CPU_HAS_SUPPORT_FP16 (cv::checkHardwareSupport(CV_CPU_FP16))\n#  define CV_CPU_CALL_FP16(fn, args) if (CV_CPU_HAS_SUPPORT_FP16) return (opt_FP16::fn args)\n#  define CV_CPU_CALL_FP16_(fn, args) if (CV_CPU_HAS_SUPPORT_FP16) return (opt_FP16::fn args)\n#else\n#  define CV_TRY_FP16 0\n#  define CV_CPU_FORCE_FP16 0\n#  define CV_CPU_HAS_SUPPORT_FP16 0\n#  define CV_CPU_CALL_FP16(fn, args)\n#  define CV_CPU_CALL_FP16_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_FP16(fn, args, mode, ...)  CV_CPU_CALL_FP16(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX2\n#  define CV_TRY_AVX2 1\n#  define CV_CPU_FORCE_AVX2 1\n#  define CV_CPU_HAS_SUPPORT_AVX2 1\n#  define CV_CPU_CALL_AVX2(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX2_(fn, args) return (opt_AVX2::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX2\n#  define CV_TRY_AVX2 1\n#  define CV_CPU_FORCE_AVX2 0\n#  define CV_CPU_HAS_SUPPORT_AVX2 (cv::checkHardwareSupport(CV_CPU_AVX2))\n#  define CV_CPU_CALL_AVX2(fn, args) if (CV_CPU_HAS_SUPPORT_AVX2) return (opt_AVX2::fn args)\n#  define CV_CPU_CALL_AVX2_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX2) return (opt_AVX2::fn args)\n#else\n#  define CV_TRY_AVX2 0\n#  define CV_CPU_FORCE_AVX2 0\n#  define CV_CPU_HAS_SUPPORT_AVX2 0\n#  define CV_CPU_CALL_AVX2(fn, args)\n#  define CV_CPU_CALL_AVX2_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX2(fn, args, mode, ...)  CV_CPU_CALL_AVX2(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_FMA3\n#  define CV_TRY_FMA3 1\n#  define CV_CPU_FORCE_FMA3 1\n#  define CV_CPU_HAS_SUPPORT_FMA3 1\n#  define CV_CPU_CALL_FMA3(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_FMA3_(fn, args) return (opt_FMA3::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_FMA3\n#  define CV_TRY_FMA3 1\n#  define CV_CPU_FORCE_FMA3 0\n#  define CV_CPU_HAS_SUPPORT_FMA3 (cv::checkHardwareSupport(CV_CPU_FMA3))\n#  define CV_CPU_CALL_FMA3(fn, args) if (CV_CPU_HAS_SUPPORT_FMA3) return (opt_FMA3::fn args)\n#  define CV_CPU_CALL_FMA3_(fn, args) if (CV_CPU_HAS_SUPPORT_FMA3) return (opt_FMA3::fn args)\n#else\n#  define CV_TRY_FMA3 0\n#  define CV_CPU_FORCE_FMA3 0\n#  define CV_CPU_HAS_SUPPORT_FMA3 0\n#  define CV_CPU_CALL_FMA3(fn, args)\n#  define CV_CPU_CALL_FMA3_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_FMA3(fn, args, mode, ...)  CV_CPU_CALL_FMA3(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX_512F\n#  define CV_TRY_AVX_512F 1\n#  define CV_CPU_FORCE_AVX_512F 1\n#  define CV_CPU_HAS_SUPPORT_AVX_512F 1\n#  define CV_CPU_CALL_AVX_512F(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX_512F_(fn, args) return (opt_AVX_512F::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX_512F\n#  define CV_TRY_AVX_512F 1\n#  define CV_CPU_FORCE_AVX_512F 0\n#  define CV_CPU_HAS_SUPPORT_AVX_512F (cv::checkHardwareSupport(CV_CPU_AVX_512F))\n#  define CV_CPU_CALL_AVX_512F(fn, args) if (CV_CPU_HAS_SUPPORT_AVX_512F) return (opt_AVX_512F::fn args)\n#  define CV_CPU_CALL_AVX_512F_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX_512F) return (opt_AVX_512F::fn args)\n#else\n#  define CV_TRY_AVX_512F 0\n#  define CV_CPU_FORCE_AVX_512F 0\n#  define CV_CPU_HAS_SUPPORT_AVX_512F 0\n#  define CV_CPU_CALL_AVX_512F(fn, args)\n#  define CV_CPU_CALL_AVX_512F_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX_512F(fn, args, mode, ...)  CV_CPU_CALL_AVX_512F(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_COMMON\n#  define CV_TRY_AVX512_COMMON 1\n#  define CV_CPU_FORCE_AVX512_COMMON 1\n#  define CV_CPU_HAS_SUPPORT_AVX512_COMMON 1\n#  define CV_CPU_CALL_AVX512_COMMON(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX512_COMMON_(fn, args) return (opt_AVX512_COMMON::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_COMMON\n#  define CV_TRY_AVX512_COMMON 1\n#  define CV_CPU_FORCE_AVX512_COMMON 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_COMMON (cv::checkHardwareSupport(CV_CPU_AVX512_COMMON))\n#  define CV_CPU_CALL_AVX512_COMMON(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_COMMON) return (opt_AVX512_COMMON::fn args)\n#  define CV_CPU_CALL_AVX512_COMMON_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_COMMON) return (opt_AVX512_COMMON::fn args)\n#else\n#  define CV_TRY_AVX512_COMMON 0\n#  define CV_CPU_FORCE_AVX512_COMMON 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_COMMON 0\n#  define CV_CPU_CALL_AVX512_COMMON(fn, args)\n#  define CV_CPU_CALL_AVX512_COMMON_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX512_COMMON(fn, args, mode, ...)  CV_CPU_CALL_AVX512_COMMON(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_KNL\n#  define CV_TRY_AVX512_KNL 1\n#  define CV_CPU_FORCE_AVX512_KNL 1\n#  define CV_CPU_HAS_SUPPORT_AVX512_KNL 1\n#  define CV_CPU_CALL_AVX512_KNL(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX512_KNL_(fn, args) return (opt_AVX512_KNL::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_KNL\n#  define CV_TRY_AVX512_KNL 1\n#  define CV_CPU_FORCE_AVX512_KNL 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_KNL (cv::checkHardwareSupport(CV_CPU_AVX512_KNL))\n#  define CV_CPU_CALL_AVX512_KNL(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_KNL) return (opt_AVX512_KNL::fn args)\n#  define CV_CPU_CALL_AVX512_KNL_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_KNL) return (opt_AVX512_KNL::fn args)\n#else\n#  define CV_TRY_AVX512_KNL 0\n#  define CV_CPU_FORCE_AVX512_KNL 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_KNL 0\n#  define CV_CPU_CALL_AVX512_KNL(fn, args)\n#  define CV_CPU_CALL_AVX512_KNL_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX512_KNL(fn, args, mode, ...)  CV_CPU_CALL_AVX512_KNL(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_KNM\n#  define CV_TRY_AVX512_KNM 1\n#  define CV_CPU_FORCE_AVX512_KNM 1\n#  define CV_CPU_HAS_SUPPORT_AVX512_KNM 1\n#  define CV_CPU_CALL_AVX512_KNM(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX512_KNM_(fn, args) return (opt_AVX512_KNM::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_KNM\n#  define CV_TRY_AVX512_KNM 1\n#  define CV_CPU_FORCE_AVX512_KNM 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_KNM (cv::checkHardwareSupport(CV_CPU_AVX512_KNM))\n#  define CV_CPU_CALL_AVX512_KNM(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_KNM) return (opt_AVX512_KNM::fn args)\n#  define CV_CPU_CALL_AVX512_KNM_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_KNM) return (opt_AVX512_KNM::fn args)\n#else\n#  define CV_TRY_AVX512_KNM 0\n#  define CV_CPU_FORCE_AVX512_KNM 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_KNM 0\n#  define CV_CPU_CALL_AVX512_KNM(fn, args)\n#  define CV_CPU_CALL_AVX512_KNM_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX512_KNM(fn, args, mode, ...)  CV_CPU_CALL_AVX512_KNM(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_SKX\n#  define CV_TRY_AVX512_SKX 1\n#  define CV_CPU_FORCE_AVX512_SKX 1\n#  define CV_CPU_HAS_SUPPORT_AVX512_SKX 1\n#  define CV_CPU_CALL_AVX512_SKX(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX512_SKX_(fn, args) return (opt_AVX512_SKX::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_SKX\n#  define CV_TRY_AVX512_SKX 1\n#  define CV_CPU_FORCE_AVX512_SKX 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_SKX (cv::checkHardwareSupport(CV_CPU_AVX512_SKX))\n#  define CV_CPU_CALL_AVX512_SKX(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_SKX) return (opt_AVX512_SKX::fn args)\n#  define CV_CPU_CALL_AVX512_SKX_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_SKX) return (opt_AVX512_SKX::fn args)\n#else\n#  define CV_TRY_AVX512_SKX 0\n#  define CV_CPU_FORCE_AVX512_SKX 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_SKX 0\n#  define CV_CPU_CALL_AVX512_SKX(fn, args)\n#  define CV_CPU_CALL_AVX512_SKX_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX512_SKX(fn, args, mode, ...)  CV_CPU_CALL_AVX512_SKX(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_CNL\n#  define CV_TRY_AVX512_CNL 1\n#  define CV_CPU_FORCE_AVX512_CNL 1\n#  define CV_CPU_HAS_SUPPORT_AVX512_CNL 1\n#  define CV_CPU_CALL_AVX512_CNL(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX512_CNL_(fn, args) return (opt_AVX512_CNL::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_CNL\n#  define CV_TRY_AVX512_CNL 1\n#  define CV_CPU_FORCE_AVX512_CNL 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_CNL (cv::checkHardwareSupport(CV_CPU_AVX512_CNL))\n#  define CV_CPU_CALL_AVX512_CNL(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_CNL) return (opt_AVX512_CNL::fn args)\n#  define CV_CPU_CALL_AVX512_CNL_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_CNL) return (opt_AVX512_CNL::fn args)\n#else\n#  define CV_TRY_AVX512_CNL 0\n#  define CV_CPU_FORCE_AVX512_CNL 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_CNL 0\n#  define CV_CPU_CALL_AVX512_CNL(fn, args)\n#  define CV_CPU_CALL_AVX512_CNL_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX512_CNL(fn, args, mode, ...)  CV_CPU_CALL_AVX512_CNL(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_CLX\n#  define CV_TRY_AVX512_CLX 1\n#  define CV_CPU_FORCE_AVX512_CLX 1\n#  define CV_CPU_HAS_SUPPORT_AVX512_CLX 1\n#  define CV_CPU_CALL_AVX512_CLX(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX512_CLX_(fn, args) return (opt_AVX512_CLX::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_CLX\n#  define CV_TRY_AVX512_CLX 1\n#  define CV_CPU_FORCE_AVX512_CLX 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_CLX (cv::checkHardwareSupport(CV_CPU_AVX512_CLX))\n#  define CV_CPU_CALL_AVX512_CLX(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_CLX) return (opt_AVX512_CLX::fn args)\n#  define CV_CPU_CALL_AVX512_CLX_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_CLX) return (opt_AVX512_CLX::fn args)\n#else\n#  define CV_TRY_AVX512_CLX 0\n#  define CV_CPU_FORCE_AVX512_CLX 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_CLX 0\n#  define CV_CPU_CALL_AVX512_CLX(fn, args)\n#  define CV_CPU_CALL_AVX512_CLX_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX512_CLX(fn, args, mode, ...)  CV_CPU_CALL_AVX512_CLX(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_ICL\n#  define CV_TRY_AVX512_ICL 1\n#  define CV_CPU_FORCE_AVX512_ICL 1\n#  define CV_CPU_HAS_SUPPORT_AVX512_ICL 1\n#  define CV_CPU_CALL_AVX512_ICL(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_AVX512_ICL_(fn, args) return (opt_AVX512_ICL::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_ICL\n#  define CV_TRY_AVX512_ICL 1\n#  define CV_CPU_FORCE_AVX512_ICL 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_ICL (cv::checkHardwareSupport(CV_CPU_AVX512_ICL))\n#  define CV_CPU_CALL_AVX512_ICL(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_ICL) return (opt_AVX512_ICL::fn args)\n#  define CV_CPU_CALL_AVX512_ICL_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_ICL) return (opt_AVX512_ICL::fn args)\n#else\n#  define CV_TRY_AVX512_ICL 0\n#  define CV_CPU_FORCE_AVX512_ICL 0\n#  define CV_CPU_HAS_SUPPORT_AVX512_ICL 0\n#  define CV_CPU_CALL_AVX512_ICL(fn, args)\n#  define CV_CPU_CALL_AVX512_ICL_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_AVX512_ICL(fn, args, mode, ...)  CV_CPU_CALL_AVX512_ICL(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_NEON\n#  define CV_TRY_NEON 1\n#  define CV_CPU_FORCE_NEON 1\n#  define CV_CPU_HAS_SUPPORT_NEON 1\n#  define CV_CPU_CALL_NEON(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_NEON_(fn, args) return (opt_NEON::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_NEON\n#  define CV_TRY_NEON 1\n#  define CV_CPU_FORCE_NEON 0\n#  define CV_CPU_HAS_SUPPORT_NEON (cv::checkHardwareSupport(CV_CPU_NEON))\n#  define CV_CPU_CALL_NEON(fn, args) if (CV_CPU_HAS_SUPPORT_NEON) return (opt_NEON::fn args)\n#  define CV_CPU_CALL_NEON_(fn, args) if (CV_CPU_HAS_SUPPORT_NEON) return (opt_NEON::fn args)\n#else\n#  define CV_TRY_NEON 0\n#  define CV_CPU_FORCE_NEON 0\n#  define CV_CPU_HAS_SUPPORT_NEON 0\n#  define CV_CPU_CALL_NEON(fn, args)\n#  define CV_CPU_CALL_NEON_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_NEON(fn, args, mode, ...)  CV_CPU_CALL_NEON(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_MSA\n#  define CV_TRY_MSA 1\n#  define CV_CPU_FORCE_MSA 1\n#  define CV_CPU_HAS_SUPPORT_MSA 1\n#  define CV_CPU_CALL_MSA(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_MSA_(fn, args) return (opt_MSA::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_MSA\n#  define CV_TRY_MSA 1\n#  define CV_CPU_FORCE_MSA 0\n#  define CV_CPU_HAS_SUPPORT_MSA (cv::checkHardwareSupport(CV_CPU_MSA))\n#  define CV_CPU_CALL_MSA(fn, args) if (CV_CPU_HAS_SUPPORT_MSA) return (opt_MSA::fn args)\n#  define CV_CPU_CALL_MSA_(fn, args) if (CV_CPU_HAS_SUPPORT_MSA) return (opt_MSA::fn args)\n#else\n#  define CV_TRY_MSA 0\n#  define CV_CPU_FORCE_MSA 0\n#  define CV_CPU_HAS_SUPPORT_MSA 0\n#  define CV_CPU_CALL_MSA(fn, args)\n#  define CV_CPU_CALL_MSA_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_MSA(fn, args, mode, ...)  CV_CPU_CALL_MSA(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_VSX\n#  define CV_TRY_VSX 1\n#  define CV_CPU_FORCE_VSX 1\n#  define CV_CPU_HAS_SUPPORT_VSX 1\n#  define CV_CPU_CALL_VSX(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_VSX_(fn, args) return (opt_VSX::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_VSX\n#  define CV_TRY_VSX 1\n#  define CV_CPU_FORCE_VSX 0\n#  define CV_CPU_HAS_SUPPORT_VSX (cv::checkHardwareSupport(CV_CPU_VSX))\n#  define CV_CPU_CALL_VSX(fn, args) if (CV_CPU_HAS_SUPPORT_VSX) return (opt_VSX::fn args)\n#  define CV_CPU_CALL_VSX_(fn, args) if (CV_CPU_HAS_SUPPORT_VSX) return (opt_VSX::fn args)\n#else\n#  define CV_TRY_VSX 0\n#  define CV_CPU_FORCE_VSX 0\n#  define CV_CPU_HAS_SUPPORT_VSX 0\n#  define CV_CPU_CALL_VSX(fn, args)\n#  define CV_CPU_CALL_VSX_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_VSX(fn, args, mode, ...)  CV_CPU_CALL_VSX(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_VSX3\n#  define CV_TRY_VSX3 1\n#  define CV_CPU_FORCE_VSX3 1\n#  define CV_CPU_HAS_SUPPORT_VSX3 1\n#  define CV_CPU_CALL_VSX3(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_VSX3_(fn, args) return (opt_VSX3::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_VSX3\n#  define CV_TRY_VSX3 1\n#  define CV_CPU_FORCE_VSX3 0\n#  define CV_CPU_HAS_SUPPORT_VSX3 (cv::checkHardwareSupport(CV_CPU_VSX3))\n#  define CV_CPU_CALL_VSX3(fn, args) if (CV_CPU_HAS_SUPPORT_VSX3) return (opt_VSX3::fn args)\n#  define CV_CPU_CALL_VSX3_(fn, args) if (CV_CPU_HAS_SUPPORT_VSX3) return (opt_VSX3::fn args)\n#else\n#  define CV_TRY_VSX3 0\n#  define CV_CPU_FORCE_VSX3 0\n#  define CV_CPU_HAS_SUPPORT_VSX3 0\n#  define CV_CPU_CALL_VSX3(fn, args)\n#  define CV_CPU_CALL_VSX3_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_VSX3(fn, args, mode, ...)  CV_CPU_CALL_VSX3(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_RVV\n#  define CV_TRY_RVV 1\n#  define CV_CPU_FORCE_RVV 1\n#  define CV_CPU_HAS_SUPPORT_RVV 1\n#  define CV_CPU_CALL_RVV(fn, args) return (cpu_baseline::fn args)\n#  define CV_CPU_CALL_RVV_(fn, args) return (opt_RVV::fn args)\n#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_RVV\n#  define CV_TRY_RVV 1\n#  define CV_CPU_FORCE_RVV 0\n#  define CV_CPU_HAS_SUPPORT_RVV (cv::checkHardwareSupport(CV_CPU_RVV))\n#  define CV_CPU_CALL_RVV(fn, args) if (CV_CPU_HAS_SUPPORT_RVV) return (opt_RVV::fn args)\n#  define CV_CPU_CALL_RVV_(fn, args) if (CV_CPU_HAS_SUPPORT_RVV) return (opt_RVV::fn args)\n#else\n#  define CV_TRY_RVV 0\n#  define CV_CPU_FORCE_RVV 0\n#  define CV_CPU_HAS_SUPPORT_RVV 0\n#  define CV_CPU_CALL_RVV(fn, args)\n#  define CV_CPU_CALL_RVV_(fn, args)\n#endif\n#define __CV_CPU_DISPATCH_CHAIN_RVV(fn, args, mode, ...)  CV_CPU_CALL_RVV(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))\n\n#define CV_CPU_CALL_BASELINE(fn, args) return (cpu_baseline::fn args)\n#define __CV_CPU_DISPATCH_CHAIN_BASELINE(fn, args, mode, ...)  CV_CPU_CALL_BASELINE(fn, args) /* last in sequence */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cvdef.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_CVDEF_H\n#define OPENCV_CORE_CVDEF_H\n\n#include \"opencv2/core/version.hpp\"\n\n//! @addtogroup core_utils\n//! @{\n\n#ifdef OPENCV_INCLUDE_PORT_FILE  // User-provided header file with custom platform configuration\n#include OPENCV_INCLUDE_PORT_FILE\n#endif\n\n#if !defined CV_DOXYGEN && !defined CV_IGNORE_DEBUG_BUILD_GUARD\n#if (defined(_MSC_VER) && (defined(DEBUG) || defined(_DEBUG))) || \\\n    (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_DEBUG_PEDANTIC))\n// Guard to prevent using of binary incompatible binaries / runtimes\n// https://github.com/opencv/opencv/pull/9161\n#define CV__DEBUG_NS_BEGIN namespace debug_build_guard {\n#define CV__DEBUG_NS_END }\nnamespace cv { namespace debug_build_guard { } using namespace debug_build_guard; }\n#endif\n#endif\n\n#ifndef CV__DEBUG_NS_BEGIN\n#define CV__DEBUG_NS_BEGIN\n#define CV__DEBUG_NS_END\n#endif\n\n\n#ifdef __OPENCV_BUILD\n#include \"cvconfig.h\"\n#endif\n\n#ifndef __CV_EXPAND\n#define __CV_EXPAND(x) x\n#endif\n\n#ifndef __CV_CAT\n#define __CV_CAT__(x, y) x ## y\n#define __CV_CAT_(x, y) __CV_CAT__(x, y)\n#define __CV_CAT(x, y) __CV_CAT_(x, y)\n#endif\n\n#define __CV_VA_NUM_ARGS_HELPER(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N\n#define __CV_VA_NUM_ARGS(...) __CV_EXPAND(__CV_VA_NUM_ARGS_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))\n\n#ifdef CV_Func\n// keep current value (through OpenCV port file)\n#elif defined __GNUC__ || (defined (__cpluscplus) && (__cpluscplus >= 201103))\n#define CV_Func __func__\n#elif defined __clang__ && (__clang_minor__ * 100 + __clang_major__ >= 305)\n#define CV_Func __func__\n#elif defined(__STDC_VERSION__) && (__STDC_VERSION >= 199901)\n#define CV_Func __func__\n#elif defined _MSC_VER\n#define CV_Func __FUNCTION__\n#elif defined(__INTEL_COMPILER) && (_INTEL_COMPILER >= 600)\n#define CV_Func __FUNCTION__\n#elif defined __IBMCPP__ && __IBMCPP__ >=500\n#define CV_Func __FUNCTION__\n#elif defined __BORLAND__ && (__BORLANDC__ >= 0x550)\n#define CV_Func __FUNC__\n#else\n#define CV_Func \"<unknown>\"\n#endif\n\n//! @cond IGNORED\n\n//////////////// static assert /////////////////\n#define CVAUX_CONCAT_EXP(a, b) a##b\n#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)\n\n#if defined(__clang__)\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_static_assert)\n#    define CV_StaticAssert(condition, reason)    static_assert((condition), reason \" \" #condition)\n#  elif __has_extension(c_static_assert)\n#    define CV_StaticAssert(condition, reason)    _Static_assert((condition), reason \" \" #condition)\n#  endif\n#elif defined(__GNUC__)\n#  if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)\n#    define CV_StaticAssert(condition, reason)    static_assert((condition), reason \" \" #condition)\n#  endif\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1600 /* MSVC 10 */\n#    define CV_StaticAssert(condition, reason)    static_assert((condition), reason \" \" #condition)\n#  endif\n#endif\n#ifndef CV_StaticAssert\n#  if !defined(__clang__) && defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 302)\n#    define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error(\"CV_StaticAssert: \" reason \" \" #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); })\n#  else\nnamespace cv {\n     template <bool x> struct CV_StaticAssert_failed;\n     template <> struct CV_StaticAssert_failed<true> { enum { val = 1 }; };\n     template<int x> struct CV_StaticAssert_test {};\n}\n#    define CV_StaticAssert(condition, reason)\\\n       typedef cv::CV_StaticAssert_test< sizeof(cv::CV_StaticAssert_failed< static_cast<bool>(condition) >) > CVAUX_CONCAT(CV_StaticAssert_failed_at_, __LINE__)\n#  endif\n#endif\n\n// Suppress warning \"-Wdeprecated-declarations\" / C4996\n#if defined(_MSC_VER)\n    #define CV_DO_PRAGMA(x) __pragma(x)\n#elif defined(__GNUC__)\n    #define CV_DO_PRAGMA(x) _Pragma (#x)\n#else\n    #define CV_DO_PRAGMA(x)\n#endif\n\n#ifdef _MSC_VER\n#define CV_SUPPRESS_DEPRECATED_START \\\n    CV_DO_PRAGMA(warning(push)) \\\n    CV_DO_PRAGMA(warning(disable: 4996))\n#define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(warning(pop))\n#elif defined (__clang__) || ((__GNUC__)  && (__GNUC__*100 + __GNUC_MINOR__ > 405))\n#define CV_SUPPRESS_DEPRECATED_START \\\n    CV_DO_PRAGMA(GCC diagnostic push) \\\n    CV_DO_PRAGMA(GCC diagnostic ignored \"-Wdeprecated-declarations\")\n#define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(GCC diagnostic pop)\n#else\n#define CV_SUPPRESS_DEPRECATED_START\n#define CV_SUPPRESS_DEPRECATED_END\n#endif\n\n#define CV_UNUSED(name) (void)name\n\n//! @endcond\n\n// undef problematic defines sometimes defined by system headers (windows.h in particular)\n#undef small\n#undef min\n#undef max\n#undef abs\n#undef Complex\n\n#if defined __cplusplus\n#include <limits>\n#else\n#include <limits.h>\n#endif\n\n#include \"opencv2/core/hal/interface.h\"\n\n#if defined __ICL\n#  define CV_ICC   __ICL\n#elif defined __ICC\n#  define CV_ICC   __ICC\n#elif defined __ECL\n#  define CV_ICC   __ECL\n#elif defined __ECC\n#  define CV_ICC   __ECC\n#elif defined __INTEL_COMPILER\n#  define CV_ICC   __INTEL_COMPILER\n#endif\n\n#ifndef CV_INLINE\n#  if defined __cplusplus\n#    define CV_INLINE static inline\n#  elif defined _MSC_VER\n#    define CV_INLINE __inline\n#  else\n#    define CV_INLINE static\n#  endif\n#endif\n\n#ifndef CV_ALWAYS_INLINE\n#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))\n#define CV_ALWAYS_INLINE inline __attribute__((always_inline))\n#elif defined(_MSC_VER)\n#define CV_ALWAYS_INLINE __forceinline\n#else\n#define CV_ALWAYS_INLINE inline\n#endif\n#endif\n\n#if defined CV_DISABLE_OPTIMIZATION || (defined CV_ICC && !defined CV_ENABLE_UNROLLED)\n#  define CV_ENABLE_UNROLLED 0\n#else\n#  define CV_ENABLE_UNROLLED 1\n#endif\n\n#ifdef __GNUC__\n#  define CV_DECL_ALIGNED(x) __attribute__ ((aligned (x)))\n#elif defined _MSC_VER\n#  define CV_DECL_ALIGNED(x) __declspec(align(x))\n#else\n#  define CV_DECL_ALIGNED(x)\n#endif\n\n/* CPU features and intrinsics support */\n#define CV_CPU_NONE             0\n#define CV_CPU_MMX              1\n#define CV_CPU_SSE              2\n#define CV_CPU_SSE2             3\n#define CV_CPU_SSE3             4\n#define CV_CPU_SSSE3            5\n#define CV_CPU_SSE4_1           6\n#define CV_CPU_SSE4_2           7\n#define CV_CPU_POPCNT           8\n#define CV_CPU_FP16             9\n#define CV_CPU_AVX              10\n#define CV_CPU_AVX2             11\n#define CV_CPU_FMA3             12\n\n#define CV_CPU_AVX_512F         13\n#define CV_CPU_AVX_512BW        14\n#define CV_CPU_AVX_512CD        15\n#define CV_CPU_AVX_512DQ        16\n#define CV_CPU_AVX_512ER        17\n#define CV_CPU_AVX_512IFMA512   18 // deprecated\n#define CV_CPU_AVX_512IFMA      18\n#define CV_CPU_AVX_512PF        19\n#define CV_CPU_AVX_512VBMI      20\n#define CV_CPU_AVX_512VL        21\n#define CV_CPU_AVX_512VBMI2     22\n#define CV_CPU_AVX_512VNNI      23\n#define CV_CPU_AVX_512BITALG    24\n#define CV_CPU_AVX_512VPOPCNTDQ 25\n#define CV_CPU_AVX_5124VNNIW    26\n#define CV_CPU_AVX_5124FMAPS    27\n\n#define CV_CPU_NEON             100\n\n#define CV_CPU_MSA              150\n\n#define CV_CPU_RISCVV           170\n\n#define CV_CPU_VSX              200\n#define CV_CPU_VSX3             201\n\n#define CV_CPU_RVV              210\n\n// CPU features groups\n#define CV_CPU_AVX512_SKX       256\n#define CV_CPU_AVX512_COMMON    257\n#define CV_CPU_AVX512_KNL       258\n#define CV_CPU_AVX512_KNM       259\n#define CV_CPU_AVX512_CNL       260\n#define CV_CPU_AVX512_CLX       261\n#define CV_CPU_AVX512_ICL       262\n\n// when adding to this list remember to update the following enum\n#define CV_HARDWARE_MAX_FEATURE 512\n\n/** @brief Available CPU features.\n*/\nenum CpuFeatures {\n    CPU_MMX             = 1,\n    CPU_SSE             = 2,\n    CPU_SSE2            = 3,\n    CPU_SSE3            = 4,\n    CPU_SSSE3           = 5,\n    CPU_SSE4_1          = 6,\n    CPU_SSE4_2          = 7,\n    CPU_POPCNT          = 8,\n    CPU_FP16            = 9,\n    CPU_AVX             = 10,\n    CPU_AVX2            = 11,\n    CPU_FMA3            = 12,\n\n    CPU_AVX_512F        = 13,\n    CPU_AVX_512BW       = 14,\n    CPU_AVX_512CD       = 15,\n    CPU_AVX_512DQ       = 16,\n    CPU_AVX_512ER       = 17,\n    CPU_AVX_512IFMA512  = 18, // deprecated\n    CPU_AVX_512IFMA     = 18,\n    CPU_AVX_512PF       = 19,\n    CPU_AVX_512VBMI     = 20,\n    CPU_AVX_512VL       = 21,\n    CPU_AVX_512VBMI2    = 22,\n    CPU_AVX_512VNNI     = 23,\n    CPU_AVX_512BITALG   = 24,\n    CPU_AVX_512VPOPCNTDQ= 25,\n    CPU_AVX_5124VNNIW   = 26,\n    CPU_AVX_5124FMAPS   = 27,\n\n    CPU_NEON            = 100,\n\n    CPU_MSA             = 150,\n\n    CPU_RISCVV          = 170,\n\n    CPU_VSX             = 200,\n    CPU_VSX3            = 201,\n\n    CPU_RVV             = 210,\n\n    CPU_AVX512_SKX      = 256, //!< Skylake-X with AVX-512F/CD/BW/DQ/VL\n    CPU_AVX512_COMMON   = 257, //!< Common instructions AVX-512F/CD for all CPUs that support AVX-512\n    CPU_AVX512_KNL      = 258, //!< Knights Landing with AVX-512F/CD/ER/PF\n    CPU_AVX512_KNM      = 259, //!< Knights Mill with AVX-512F/CD/ER/PF/4FMAPS/4VNNIW/VPOPCNTDQ\n    CPU_AVX512_CNL      = 260, //!< Cannon Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI\n    CPU_AVX512_CLX      = 261, //!< Cascade Lake with AVX-512F/CD/BW/DQ/VL/VNNI\n    CPU_AVX512_ICL      = 262, //!< Ice Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI/VNNI/VBMI2/BITALG/VPOPCNTDQ\n\n    CPU_MAX_FEATURE     = 512  // see CV_HARDWARE_MAX_FEATURE\n};\n\n\n#include \"cv_cpu_dispatch.h\"\n\n#if !defined(CV_STRONG_ALIGNMENT) && defined(__arm__) && !(defined(__aarch64__) || defined(_M_ARM64))\n// int*, int64* should be propertly aligned pointers on ARMv7\n#define CV_STRONG_ALIGNMENT 1\n#endif\n#if !defined(CV_STRONG_ALIGNMENT)\n#define CV_STRONG_ALIGNMENT 0\n#endif\n\n/* fundamental constants */\n#define CV_PI   3.1415926535897932384626433832795\n#define CV_2PI  6.283185307179586476925286766559\n#define CV_LOG2 0.69314718055994530941723212145818\n\n#if defined __ARM_FP16_FORMAT_IEEE \\\n    && !defined __CUDACC__\n#  define CV_FP16_TYPE 1\n#else\n#  define CV_FP16_TYPE 0\n#endif\n\ntypedef union Cv16suf\n{\n    short i;\n    ushort u;\n#if CV_FP16_TYPE\n    __fp16 h;\n#endif\n}\nCv16suf;\n\ntypedef union Cv32suf\n{\n    int i;\n    unsigned u;\n    float f;\n}\nCv32suf;\n\ntypedef union Cv64suf\n{\n    int64 i;\n    uint64 u;\n    double f;\n}\nCv64suf;\n\n#ifndef OPENCV_ABI_COMPATIBILITY\n#define OPENCV_ABI_COMPATIBILITY 400\n#endif\n\n#ifdef __OPENCV_BUILD\n#  define DISABLE_OPENCV_3_COMPATIBILITY\n#  define OPENCV_DISABLE_DEPRECATED_COMPATIBILITY\n#endif\n\n#ifndef CV_EXPORTS\n# if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined(CVAPI_EXPORTS)\n#   define CV_EXPORTS __declspec(dllexport)\n# elif defined __GNUC__ && __GNUC__ >= 4 && (defined(CVAPI_EXPORTS) || defined(__APPLE__))\n#   define CV_EXPORTS __attribute__ ((visibility (\"default\")))\n# endif\n#endif\n\n#ifndef CV_EXPORTS\n# define CV_EXPORTS\n#endif\n\n#ifdef _MSC_VER\n#   define CV_EXPORTS_TEMPLATE\n#else\n#   define CV_EXPORTS_TEMPLATE CV_EXPORTS\n#endif\n\n#ifndef CV_DEPRECATED\n#  if defined(__GNUC__)\n#    define CV_DEPRECATED __attribute__ ((deprecated))\n#  elif defined(_MSC_VER)\n#    define CV_DEPRECATED __declspec(deprecated)\n#  else\n#    define CV_DEPRECATED\n#  endif\n#endif\n\n#ifndef CV_DEPRECATED_EXTERNAL\n#  if defined(__OPENCV_BUILD)\n#    define CV_DEPRECATED_EXTERNAL /* nothing */\n#  else\n#    define CV_DEPRECATED_EXTERNAL CV_DEPRECATED\n#  endif\n#endif\n\n\n#ifndef CV_EXTERN_C\n#  ifdef __cplusplus\n#    define CV_EXTERN_C extern \"C\"\n#  else\n#    define CV_EXTERN_C\n#  endif\n#endif\n\n/* special informative macros for wrapper generators */\n#define CV_EXPORTS_W CV_EXPORTS\n#define CV_EXPORTS_W_SIMPLE CV_EXPORTS\n#define CV_EXPORTS_AS(synonym) CV_EXPORTS\n#define CV_EXPORTS_W_MAP CV_EXPORTS\n#define CV_IN_OUT\n#define CV_OUT\n#define CV_PROP\n#define CV_PROP_RW\n#define CV_WRAP\n#define CV_WRAP_AS(synonym)\n#define CV_WRAP_MAPPABLE(mappable)\n#define CV_WRAP_PHANTOM(phantom_header)\n#define CV_WRAP_DEFAULT(val)\n\n/****************************************************************************************\\\n*                                  Matrix type (Mat)                                     *\n\\****************************************************************************************/\n\n#define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)\n#define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)\n#define CV_MAT_TYPE_MASK        (CV_DEPTH_MAX*CV_CN_MAX - 1)\n#define CV_MAT_TYPE(flags)      ((flags) & CV_MAT_TYPE_MASK)\n#define CV_MAT_CONT_FLAG_SHIFT  14\n#define CV_MAT_CONT_FLAG        (1 << CV_MAT_CONT_FLAG_SHIFT)\n#define CV_IS_MAT_CONT(flags)   ((flags) & CV_MAT_CONT_FLAG)\n#define CV_IS_CONT_MAT          CV_IS_MAT_CONT\n#define CV_SUBMAT_FLAG_SHIFT    15\n#define CV_SUBMAT_FLAG          (1 << CV_SUBMAT_FLAG_SHIFT)\n#define CV_IS_SUBMAT(flags)     ((flags) & CV_MAT_SUBMAT_FLAG)\n\n/** Size of each channel item,\n   0x28442211 = 0010 1000 0100 0100 0010 0010 0001 0001 ~ array of sizeof(arr_type_elem) */\n#define CV_ELEM_SIZE1(type) ((0x28442211 >> CV_MAT_DEPTH(type)*4) & 15)\n\n#define CV_ELEM_SIZE(type) (CV_MAT_CN(type)*CV_ELEM_SIZE1(type))\n\n#ifndef MIN\n#  define MIN(a,b)  ((a) > (b) ? (b) : (a))\n#endif\n\n#ifndef MAX\n#  define MAX(a,b)  ((a) < (b) ? (b) : (a))\n#endif\n\n///////////////////////////////////////// Enum operators ///////////////////////////////////////\n\n/**\n\nProvides compatibility operators for both classical and C++11 enum classes,\nas well as exposing the C++11 enum class members for backwards compatibility\n\n@code\n    // Provides operators required for flag enums\n    CV_ENUM_FLAGS(AccessFlag)\n\n    // Exposes the listed members of the enum class AccessFlag to the current namespace\n    CV_ENUM_CLASS_EXPOSE(AccessFlag, ACCESS_READ [, ACCESS_WRITE [, ...] ]);\n@endcode\n*/\n\n#define __CV_ENUM_CLASS_EXPOSE_1(EnumType, MEMBER_CONST)                                              \\\nstatic const EnumType MEMBER_CONST = EnumType::MEMBER_CONST;                                          \\\n\n#define __CV_ENUM_CLASS_EXPOSE_2(EnumType, MEMBER_CONST, ...)                                         \\\n__CV_ENUM_CLASS_EXPOSE_1(EnumType, MEMBER_CONST);                                                     \\\n__CV_EXPAND(__CV_ENUM_CLASS_EXPOSE_1(EnumType, __VA_ARGS__));                                         \\\n\n#define __CV_ENUM_CLASS_EXPOSE_3(EnumType, MEMBER_CONST, ...)                                         \\\n__CV_ENUM_CLASS_EXPOSE_1(EnumType, MEMBER_CONST);                                                     \\\n__CV_EXPAND(__CV_ENUM_CLASS_EXPOSE_2(EnumType, __VA_ARGS__));                                         \\\n\n#define __CV_ENUM_CLASS_EXPOSE_4(EnumType, MEMBER_CONST, ...)                                         \\\n__CV_ENUM_CLASS_EXPOSE_1(EnumType, MEMBER_CONST);                                                     \\\n__CV_EXPAND(__CV_ENUM_CLASS_EXPOSE_3(EnumType, __VA_ARGS__));                                         \\\n\n#define __CV_ENUM_CLASS_EXPOSE_5(EnumType, MEMBER_CONST, ...)                                         \\\n__CV_ENUM_CLASS_EXPOSE_1(EnumType, MEMBER_CONST);                                                     \\\n__CV_EXPAND(__CV_ENUM_CLASS_EXPOSE_4(EnumType, __VA_ARGS__));                                         \\\n\n#define __CV_ENUM_CLASS_EXPOSE_6(EnumType, MEMBER_CONST, ...)                                         \\\n__CV_ENUM_CLASS_EXPOSE_1(EnumType, MEMBER_CONST);                                                     \\\n__CV_EXPAND(__CV_ENUM_CLASS_EXPOSE_5(EnumType, __VA_ARGS__));                                         \\\n\n#define __CV_ENUM_CLASS_EXPOSE_7(EnumType, MEMBER_CONST, ...)                                         \\\n__CV_ENUM_CLASS_EXPOSE_1(EnumType, MEMBER_CONST);                                                     \\\n__CV_EXPAND(__CV_ENUM_CLASS_EXPOSE_6(EnumType, __VA_ARGS__));                                         \\\n\n#define __CV_ENUM_CLASS_EXPOSE_8(EnumType, MEMBER_CONST, ...)                                         \\\n__CV_ENUM_CLASS_EXPOSE_1(EnumType, MEMBER_CONST);                                                     \\\n__CV_EXPAND(__CV_ENUM_CLASS_EXPOSE_7(EnumType, __VA_ARGS__));                                         \\\n\n#define __CV_ENUM_CLASS_EXPOSE_9(EnumType, MEMBER_CONST, ...)                                         \\\n__CV_ENUM_CLASS_EXPOSE_1(EnumType, MEMBER_CONST);                                                     \\\n__CV_EXPAND(__CV_ENUM_CLASS_EXPOSE_8(EnumType, __VA_ARGS__));                                         \\\n\n#define __CV_ENUM_FLAGS_LOGICAL_NOT(EnumType)                                                         \\\nstatic inline bool operator!(const EnumType& val)                                                     \\\n{                                                                                                     \\\n    typedef std::underlying_type<EnumType>::type UnderlyingType;                                      \\\n    return !static_cast<UnderlyingType>(val);                                                         \\\n}                                                                                                     \\\n\n#define __CV_ENUM_FLAGS_LOGICAL_NOT_EQ(Arg1Type, Arg2Type)                                            \\\nstatic inline bool operator!=(const Arg1Type& a, const Arg2Type& b)                                   \\\n{                                                                                                     \\\n    return static_cast<int>(a) != static_cast<int>(b);                                                \\\n}                                                                                                     \\\n\n#define __CV_ENUM_FLAGS_LOGICAL_EQ(Arg1Type, Arg2Type)                                                \\\nstatic inline bool operator==(const Arg1Type& a, const Arg2Type& b)                                   \\\n{                                                                                                     \\\n    return static_cast<int>(a) == static_cast<int>(b);                                                \\\n}                                                                                                     \\\n\n#define __CV_ENUM_FLAGS_BITWISE_NOT(EnumType)                                                         \\\nstatic inline EnumType operator~(const EnumType& val)                                                 \\\n{                                                                                                     \\\n    typedef std::underlying_type<EnumType>::type UnderlyingType;                                      \\\n    return static_cast<EnumType>(~static_cast<UnderlyingType>(val));                                  \\\n}                                                                                                     \\\n\n#define __CV_ENUM_FLAGS_BITWISE_OR(EnumType, Arg1Type, Arg2Type)                                      \\\nstatic inline EnumType operator|(const Arg1Type& a, const Arg2Type& b)                                \\\n{                                                                                                     \\\n    typedef std::underlying_type<EnumType>::type UnderlyingType;                                      \\\n    return static_cast<EnumType>(static_cast<UnderlyingType>(a) | static_cast<UnderlyingType>(b));    \\\n}                                                                                                     \\\n\n#define __CV_ENUM_FLAGS_BITWISE_AND(EnumType, Arg1Type, Arg2Type)                                     \\\nstatic inline EnumType operator&(const Arg1Type& a, const Arg2Type& b)                                \\\n{                                                                                                     \\\n    typedef std::underlying_type<EnumType>::type UnderlyingType;                                      \\\n    return static_cast<EnumType>(static_cast<UnderlyingType>(a) & static_cast<UnderlyingType>(b));    \\\n}                                                                                                     \\\n\n#define __CV_ENUM_FLAGS_BITWISE_XOR(EnumType, Arg1Type, Arg2Type)                                     \\\nstatic inline EnumType operator^(const Arg1Type& a, const Arg2Type& b)                                \\\n{                                                                                                     \\\n    typedef std::underlying_type<EnumType>::type UnderlyingType;                                      \\\n    return static_cast<EnumType>(static_cast<UnderlyingType>(a) ^ static_cast<UnderlyingType>(b));    \\\n}                                                                                                     \\\n\n#define __CV_ENUM_FLAGS_BITWISE_OR_EQ(EnumType, Arg1Type)                                             \\\nstatic inline EnumType& operator|=(EnumType& _this, const Arg1Type& val)                              \\\n{                                                                                                     \\\n    _this = static_cast<EnumType>(static_cast<int>(_this) | static_cast<int>(val));                   \\\n    return _this;                                                                                     \\\n}                                                                                                     \\\n\n#define __CV_ENUM_FLAGS_BITWISE_AND_EQ(EnumType, Arg1Type)                                            \\\nstatic inline EnumType& operator&=(EnumType& _this, const Arg1Type& val)                              \\\n{                                                                                                     \\\n    _this = static_cast<EnumType>(static_cast<int>(_this) & static_cast<int>(val));                   \\\n    return _this;                                                                                     \\\n}                                                                                                     \\\n\n#define __CV_ENUM_FLAGS_BITWISE_XOR_EQ(EnumType, Arg1Type)                                            \\\nstatic inline EnumType& operator^=(EnumType& _this, const Arg1Type& val)                              \\\n{                                                                                                     \\\n    _this = static_cast<EnumType>(static_cast<int>(_this) ^ static_cast<int>(val));                   \\\n    return _this;                                                                                     \\\n}                                                                                                     \\\n\n#define CV_ENUM_CLASS_EXPOSE(EnumType, ...)                                                           \\\n__CV_EXPAND(__CV_CAT(__CV_ENUM_CLASS_EXPOSE_, __CV_VA_NUM_ARGS(__VA_ARGS__))(EnumType, __VA_ARGS__)); \\\n\n#define CV_ENUM_FLAGS(EnumType)                                                                       \\\n__CV_ENUM_FLAGS_LOGICAL_NOT      (EnumType)                                                           \\\n__CV_ENUM_FLAGS_LOGICAL_EQ       (EnumType, int)                                                      \\\n__CV_ENUM_FLAGS_LOGICAL_NOT_EQ   (EnumType, int)                                                      \\\n                                                                                                      \\\n__CV_ENUM_FLAGS_BITWISE_NOT      (EnumType)                                                           \\\n__CV_ENUM_FLAGS_BITWISE_OR       (EnumType, EnumType, EnumType)                                       \\\n__CV_ENUM_FLAGS_BITWISE_AND      (EnumType, EnumType, EnumType)                                       \\\n__CV_ENUM_FLAGS_BITWISE_XOR      (EnumType, EnumType, EnumType)                                       \\\n                                                                                                      \\\n__CV_ENUM_FLAGS_BITWISE_OR_EQ    (EnumType, EnumType)                                                 \\\n__CV_ENUM_FLAGS_BITWISE_AND_EQ   (EnumType, EnumType)                                                 \\\n__CV_ENUM_FLAGS_BITWISE_XOR_EQ   (EnumType, EnumType)                                                 \\\n\n/****************************************************************************************\\\n*                                    static analysys                                     *\n\\****************************************************************************************/\n\n// In practice, some macro are not processed correctly (noreturn is not detected).\n// We need to use simplified definition for them.\n#ifndef CV_STATIC_ANALYSIS\n# if defined(__KLOCWORK__) || defined(__clang_analyzer__) || defined(__COVERITY__)\n#   define CV_STATIC_ANALYSIS 1\n# endif\n#else\n# if defined(CV_STATIC_ANALYSIS) && !(__CV_CAT(1, CV_STATIC_ANALYSIS) == 1)  // defined and not empty\n#   if 0 == CV_STATIC_ANALYSIS\n#     undef CV_STATIC_ANALYSIS\n#   endif\n# endif\n#endif\n\n/****************************************************************************************\\\n*                                    Thread sanitizer                                    *\n\\****************************************************************************************/\n#ifndef CV_THREAD_SANITIZER\n# if defined(__has_feature)\n#   if __has_feature(thread_sanitizer)\n#     define CV_THREAD_SANITIZER\n#   endif\n# endif\n#endif\n\n/****************************************************************************************\\\n*          exchange-add operation for atomic operations on reference counters            *\n\\****************************************************************************************/\n\n#ifdef CV_XADD\n  // allow to use user-defined macro\n#elif defined __GNUC__ || defined __clang__\n#  if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__)  && !defined __INTEL_COMPILER\n#    ifdef __ATOMIC_ACQ_REL\n#      define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)\n#    else\n#      define CV_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), delta, 4)\n#    endif\n#  else\n#    if defined __ATOMIC_ACQ_REL && !defined __clang__\n       // version for gcc >= 4.7\n#      define CV_XADD(addr, delta) (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL)\n#    else\n#      define CV_XADD(addr, delta) (int)__sync_fetch_and_add((unsigned*)(addr), (unsigned)(delta))\n#    endif\n#  endif\n#elif defined _MSC_VER && !defined RC_INVOKED\n#  include <intrin.h>\n#  define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta)\n#else\n  #ifdef OPENCV_FORCE_UNSAFE_XADD\n    CV_INLINE int CV_XADD(int* addr, int delta) { int tmp = *addr; *addr += delta; return tmp; }\n  #else\n    #error \"OpenCV: can't define safe CV_XADD macro for current platform (unsupported). Define CV_XADD macro through custom port header (see OPENCV_INCLUDE_PORT_FILE)\"\n  #endif\n#endif\n\n\n/****************************************************************************************\\\n*                                  CV_NORETURN attribute                                 *\n\\****************************************************************************************/\n\n#ifndef CV_NORETURN\n#  if defined(__GNUC__)\n#    define CV_NORETURN __attribute__((__noreturn__))\n#  elif defined(_MSC_VER) && (_MSC_VER >= 1300)\n#    define CV_NORETURN __declspec(noreturn)\n#  else\n#    define CV_NORETURN /* nothing by default */\n#  endif\n#endif\n\n\n/****************************************************************************************\\\n*                                  CV_NODISCARD attribute                                *\n* encourages the compiler to issue a warning if the return value is discarded (C++17)    *\n\\****************************************************************************************/\n#ifndef CV_NODISCARD\n#  if defined(__GNUC__)\n#    define CV_NODISCARD __attribute__((__warn_unused_result__)) // at least available with GCC 3.4\n#  elif defined(__clang__) && defined(__has_attribute)\n#    if __has_attribute(__warn_unused_result__)\n#      define CV_NODISCARD __attribute__((__warn_unused_result__))\n#    endif\n#  endif\n#endif\n#ifndef CV_NODISCARD\n#  define CV_NODISCARD /* nothing by default */\n#endif\n\n\n/****************************************************************************************\\\n*                                    C++ 11                                              *\n\\****************************************************************************************/\n#ifndef CV_CXX11\n#  if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)\n#    define CV_CXX11 1\n#  endif\n#else\n#  if CV_CXX11 == 0\n#    undef CV_CXX11\n#  endif\n#endif\n#ifndef CV_CXX11\n#  error \"OpenCV 4.x+ requires enabled C++11 support\"\n#endif\n\n#define CV_CXX_MOVE_SEMANTICS 1\n#define CV_CXX_MOVE(x) std::move(x)\n#define CV_CXX_STD_ARRAY 1\n#include <array>\n#ifndef CV_OVERRIDE\n#  define CV_OVERRIDE override\n#endif\n#ifndef CV_FINAL\n#  define CV_FINAL final\n#endif\n\n#ifndef CV_NOEXCEPT\n#  if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)\n#    define CV_NOEXCEPT noexcept\n#  endif\n#endif\n#ifndef CV_NOEXCEPT\n#  define CV_NOEXCEPT\n#endif\n\n#ifndef CV_CONSTEXPR\n#  if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)\n#    define CV_CONSTEXPR constexpr\n#  endif\n#endif\n#ifndef CV_CONSTEXPR\n#  define CV_CONSTEXPR\n#endif\n\n// Integer types portatibility\n#ifdef OPENCV_STDINT_HEADER\n#include OPENCV_STDINT_HEADER\n#elif defined(__cplusplus)\n#if defined(_MSC_VER) && _MSC_VER < 1600 /* MSVS 2010 */\nnamespace cv {\ntypedef signed char int8_t;\ntypedef unsigned char uint8_t;\ntypedef signed short int16_t;\ntypedef unsigned short uint16_t;\ntypedef signed int int32_t;\ntypedef unsigned int uint32_t;\ntypedef signed __int64 int64_t;\ntypedef unsigned __int64 uint64_t;\n}\n#elif defined(_MSC_VER) || __cplusplus >= 201103L\n#include <cstdint>\nnamespace cv {\nusing std::int8_t;\nusing std::uint8_t;\nusing std::int16_t;\nusing std::uint16_t;\nusing std::int32_t;\nusing std::uint32_t;\nusing std::int64_t;\nusing std::uint64_t;\n}\n#else\n#include <stdint.h>\nnamespace cv {\ntypedef ::int8_t int8_t;\ntypedef ::uint8_t uint8_t;\ntypedef ::int16_t int16_t;\ntypedef ::uint16_t uint16_t;\ntypedef ::int32_t int32_t;\ntypedef ::uint32_t uint32_t;\ntypedef ::int64_t int64_t;\ntypedef ::uint64_t uint64_t;\n}\n#endif\n#else // pure C\n#include <stdint.h>\n#endif\n\n#ifdef __cplusplus\nnamespace cv\n{\n\nclass float16_t\n{\npublic:\n#if CV_FP16_TYPE\n\n    float16_t() : h(0) {}\n    explicit float16_t(float x) { h = (__fp16)x; }\n    operator float() const { return (float)h; }\n    static float16_t fromBits(ushort w)\n    {\n        Cv16suf u;\n        u.u = w;\n        float16_t result;\n        result.h = u.h;\n        return result;\n    }\n    static float16_t zero()\n    {\n        float16_t result;\n        result.h = (__fp16)0;\n        return result;\n    }\n    ushort bits() const\n    {\n        Cv16suf u;\n        u.h = h;\n        return u.u;\n    }\nprotected:\n    __fp16 h;\n\n#else\n    float16_t() : w(0) {}\n    explicit float16_t(float x)\n    {\n    #if CV_FP16\n        __m128 v = _mm_load_ss(&x);\n        w = (ushort)_mm_cvtsi128_si32(_mm_cvtps_ph(v, 0));\n    #else\n        Cv32suf in;\n        in.f = x;\n        unsigned sign = in.u & 0x80000000;\n        in.u ^= sign;\n\n        if( in.u >= 0x47800000 )\n            w = (ushort)(in.u > 0x7f800000 ? 0x7e00 : 0x7c00);\n        else\n        {\n            if (in.u < 0x38800000)\n            {\n                in.f += 0.5f;\n                w = (ushort)(in.u - 0x3f000000);\n            }\n            else\n            {\n                unsigned t = in.u + 0xc8000fff;\n                w = (ushort)((t + ((in.u >> 13) & 1)) >> 13);\n            }\n        }\n\n        w = (ushort)(w | (sign >> 16));\n    #endif\n    }\n\n    operator float() const\n    {\n    #if CV_FP16\n        float f;\n        _mm_store_ss(&f, _mm_cvtph_ps(_mm_cvtsi32_si128(w)));\n        return f;\n    #else\n        Cv32suf out;\n\n        unsigned t = ((w & 0x7fff) << 13) + 0x38000000;\n        unsigned sign = (w & 0x8000) << 16;\n        unsigned e = w & 0x7c00;\n\n        out.u = t + (1 << 23);\n        out.u = (e >= 0x7c00 ? t + 0x38000000 :\n                 e == 0 ? (static_cast<void>(out.f -= 6.103515625e-05f), out.u) : t) | sign;\n        return out.f;\n    #endif\n    }\n\n    static float16_t fromBits(ushort b)\n    {\n        float16_t result;\n        result.w = b;\n        return result;\n    }\n    static float16_t zero()\n    {\n        float16_t result;\n        result.w = (ushort)0;\n        return result;\n    }\n    ushort bits() const { return w; }\nprotected:\n    ushort w;\n\n#endif\n};\n\n}\n#endif\n\n//! @}\n\n#ifndef __cplusplus\n#include \"opencv2/core/fast_math.hpp\" // define cvRound(double)\n#endif\n\n#endif // OPENCV_CORE_CVDEF_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cvstd.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_CVSTD_HPP\n#define OPENCV_CORE_CVSTD_HPP\n\n#ifndef __cplusplus\n#  error cvstd.hpp header must be compiled as C++\n#endif\n\n#include \"opencv2/core/cvdef.h\"\n#include <cstddef>\n#include <cstring>\n#include <cctype>\n\n#include <string>\n\n// import useful primitives from stl\n#  include <algorithm>\n#  include <utility>\n#  include <cstdlib> //for abs(int)\n#  include <cmath>\n\nnamespace cv\n{\n    static inline uchar abs(uchar a) { return a; }\n    static inline ushort abs(ushort a) { return a; }\n    static inline unsigned abs(unsigned a) { return a; }\n    static inline uint64 abs(uint64 a) { return a; }\n\n    using std::min;\n    using std::max;\n    using std::abs;\n    using std::swap;\n    using std::sqrt;\n    using std::exp;\n    using std::pow;\n    using std::log;\n}\n\n#include \"cvstd_wrapper.hpp\"\n\nnamespace cv {\n\n//! @addtogroup core_utils\n//! @{\n\n//////////////////////////// memory management functions ////////////////////////////\n\n/** @brief Allocates an aligned memory buffer.\n\nThe function allocates the buffer of the specified size and returns it. When the buffer size is 16\nbytes or more, the returned buffer is aligned to 16 bytes.\n@param bufSize Allocated buffer size.\n */\nCV_EXPORTS void* fastMalloc(size_t bufSize);\n\n/** @brief Deallocates a memory buffer.\n\nThe function deallocates the buffer allocated with fastMalloc . If NULL pointer is passed, the\nfunction does nothing. C version of the function clears the pointer *pptr* to avoid problems with\ndouble memory deallocation.\n@param ptr Pointer to the allocated buffer.\n */\nCV_EXPORTS void fastFree(void* ptr);\n\n/*!\n  The STL-compliant memory Allocator based on cv::fastMalloc() and cv::fastFree()\n*/\ntemplate<typename _Tp> class Allocator\n{\npublic:\n    typedef _Tp value_type;\n    typedef value_type* pointer;\n    typedef const value_type* const_pointer;\n    typedef value_type& reference;\n    typedef const value_type& const_reference;\n    typedef size_t size_type;\n    typedef ptrdiff_t difference_type;\n    template<typename U> class rebind { typedef Allocator<U> other; };\n\n    explicit Allocator() {}\n    ~Allocator() {}\n    explicit Allocator(Allocator const&) {}\n    template<typename U>\n    explicit Allocator(Allocator<U> const&) {}\n\n    // address\n    pointer address(reference r) { return &r; }\n    const_pointer address(const_reference r) { return &r; }\n\n    pointer allocate(size_type count, const void* =0) { return reinterpret_cast<pointer>(fastMalloc(count * sizeof (_Tp))); }\n    void deallocate(pointer p, size_type) { fastFree(p); }\n\n    void construct(pointer p, const _Tp& v) { new(static_cast<void*>(p)) _Tp(v); }\n    void destroy(pointer p) { p->~_Tp(); }\n\n    size_type max_size() const { return cv::max(static_cast<_Tp>(-1)/sizeof(_Tp), 1); }\n};\n\n//! @} core_utils\n\n//! @endcond\n\n//! @addtogroup core_basic\n//! @{\n\n//////////////////////////////// string class ////////////////////////////////\n\nclass CV_EXPORTS FileNode; //for string constructor from FileNode\n\ntypedef std::string String;\n\n#ifndef OPENCV_DISABLE_STRING_LOWER_UPPER_CONVERSIONS\n\n//! @cond IGNORED\nnamespace details {\n// std::tolower is int->int\nstatic inline char char_tolower(char ch)\n{\n    return (char)std::tolower((int)ch);\n}\n// std::toupper is int->int\nstatic inline char char_toupper(char ch)\n{\n    return (char)std::toupper((int)ch);\n}\n} // namespace details\n//! @endcond\n\nstatic inline std::string toLowerCase(const std::string& str)\n{\n    std::string result(str);\n    std::transform(result.begin(), result.end(), result.begin(), details::char_tolower);\n    return result;\n}\n\nstatic inline std::string toUpperCase(const std::string& str)\n{\n    std::string result(str);\n    std::transform(result.begin(), result.end(), result.begin(), details::char_toupper);\n    return result;\n}\n\n#endif // OPENCV_DISABLE_STRING_LOWER_UPPER_CONVERSIONS\n\n//! @} core_basic\n} // cv\n\n#endif //OPENCV_CORE_CVSTD_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cvstd.inl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_CVSTDINL_HPP\n#define OPENCV_CORE_CVSTDINL_HPP\n\n#include <complex>\n#include <ostream>\n#include <sstream>\n\n//! @cond IGNORED\n\n#ifdef _MSC_VER\n#pragma warning( push )\n#pragma warning( disable: 4127 )\n#endif\n\nnamespace cv\n{\n\ntemplate<typename _Tp> class DataType< std::complex<_Tp> >\n{\npublic:\n    typedef std::complex<_Tp>  value_type;\n    typedef value_type         work_type;\n    typedef _Tp                channel_type;\n\n    enum { generic_type = 0,\n           depth        = DataType<channel_type>::depth,\n           channels     = 2,\n           fmt          = DataType<channel_type>::fmt + ((channels - 1) << 8),\n           type         = CV_MAKETYPE(depth, channels) };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nstatic inline\nstd::ostream& operator << (std::ostream& out, Ptr<Formatted> fmtd)\n{\n    fmtd->reset();\n    for(const char* str = fmtd->next(); str; str = fmtd->next())\n        out << str;\n    return out;\n}\n\nstatic inline\nstd::ostream& operator << (std::ostream& out, const Mat& mtx)\n{\n    return out << Formatter::get()->format(mtx);\n}\n\nstatic inline\nstd::ostream& operator << (std::ostream& out, const UMat& m)\n{\n    return out << m.getMat(ACCESS_READ);\n}\n\ntemplate<typename _Tp> static inline\nstd::ostream& operator << (std::ostream& out, const Complex<_Tp>& c)\n{\n    return out << \"(\" << c.re << \",\" << c.im << \")\";\n}\n\ntemplate<typename _Tp> static inline\nstd::ostream& operator << (std::ostream& out, const std::vector<Point_<_Tp> >& vec)\n{\n    return out << Formatter::get()->format(Mat(vec));\n}\n\n\ntemplate<typename _Tp> static inline\nstd::ostream& operator << (std::ostream& out, const std::vector<Point3_<_Tp> >& vec)\n{\n    return out << Formatter::get()->format(Mat(vec));\n}\n\n\ntemplate<typename _Tp, int m, int n> static inline\nstd::ostream& operator << (std::ostream& out, const Matx<_Tp, m, n>& matx)\n{\n    return out << Formatter::get()->format(Mat(matx));\n}\n\ntemplate<typename _Tp> static inline\nstd::ostream& operator << (std::ostream& out, const Point_<_Tp>& p)\n{\n    out << \"[\" << p.x << \", \" << p.y << \"]\";\n    return out;\n}\n\ntemplate<typename _Tp> static inline\nstd::ostream& operator << (std::ostream& out, const Point3_<_Tp>& p)\n{\n    out << \"[\" << p.x << \", \" << p.y << \", \" << p.z << \"]\";\n    return out;\n}\n\ntemplate<typename _Tp, int n> static inline\nstd::ostream& operator << (std::ostream& out, const Vec<_Tp, n>& vec)\n{\n    out << \"[\";\n    if (cv::traits::Depth<_Tp>::value <= CV_32S)\n    {\n        for (int i = 0; i < n - 1; ++i) {\n            out << (int)vec[i] << \", \";\n        }\n        out << (int)vec[n-1] << \"]\";\n    }\n    else\n    {\n        for (int i = 0; i < n - 1; ++i) {\n            out << vec[i] << \", \";\n        }\n        out << vec[n-1] << \"]\";\n    }\n\n    return out;\n}\n\ntemplate<typename _Tp> static inline\nstd::ostream& operator << (std::ostream& out, const Size_<_Tp>& size)\n{\n    return out << \"[\" << size.width << \" x \" << size.height << \"]\";\n}\n\ntemplate<typename _Tp> static inline\nstd::ostream& operator << (std::ostream& out, const Rect_<_Tp>& rect)\n{\n    return out << \"[\" << rect.width << \" x \" << rect.height << \" from (\" << rect.x << \", \" << rect.y << \")]\";\n}\n\nstatic inline std::ostream& operator << (std::ostream& out, const MatSize& msize)\n{\n    int i, dims = msize.dims();\n    for( i = 0; i < dims; i++ )\n    {\n        out << msize[i];\n        if( i < dims-1 )\n            out << \" x \";\n    }\n    return out;\n}\n\nstatic inline std::ostream &operator<< (std::ostream &s, cv::Range &r)\n{\n    return s << \"[\" << r.start << \" : \" << r.end << \")\";\n}\n\n} // cv\n\n#ifdef _MSC_VER\n#pragma warning( pop )\n#endif\n\n//! @endcond\n\n#endif // OPENCV_CORE_CVSTDINL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/cvstd_wrapper.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_CVSTD_WRAPPER_HPP\n#define OPENCV_CORE_CVSTD_WRAPPER_HPP\n\n#include \"opencv2/core/cvdef.h\"\n\n#include <string>\n#include <memory>  // std::shared_ptr\n#include <type_traits>  // std::enable_if\n\nnamespace cv {\n\nusing std::nullptr_t;\n\n//! @addtogroup core_basic\n//! @{\n\n#ifdef CV_DOXYGEN\n\ntemplate <typename _Tp> using Ptr = std::shared_ptr<_Tp>;  // In ideal world it should look like this, but we need some compatibility workarounds below\n\ntemplate<typename _Tp, typename ... A1> static inline\nPtr<_Tp> makePtr(const A1&... a1) { return std::make_shared<_Tp>(a1...); }\n\n#else  // cv::Ptr with compatibility workarounds\n\n// It should be defined for C-API types only.\n// C++ types should use regular \"delete\" operator.\ntemplate<typename Y> struct DefaultDeleter;\n#if 0\n{\n    void operator()(Y* p) const;\n};\n#endif\n\nnamespace sfinae {\ntemplate<typename C, typename Ret, typename... Args>\nstruct has_parenthesis_operator\n{\nprivate:\n    template<typename T>\n    static CV_CONSTEXPR std::true_type check(typename std::is_same<typename std::decay<decltype(std::declval<T>().operator()(std::declval<Args>()...))>::type, Ret>::type*);\n\n    template<typename> static CV_CONSTEXPR std::false_type check(...);\n\n    typedef decltype(check<C>(0)) type;\n\npublic:\n#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)\n    static CV_CONSTEXPR bool value = type::value;\n#else\n    // support MSVS 2013\n    static const int value = type::value;\n#endif\n};\n} // namespace sfinae\n\ntemplate <typename T, typename = void>\nstruct has_custom_delete\n        : public std::false_type {};\n\n// Force has_custom_delete to std::false_type when NVCC is compiling CUDA source files\n#ifndef __CUDACC__\ntemplate <typename T>\nstruct has_custom_delete<T, typename std::enable_if< sfinae::has_parenthesis_operator<DefaultDeleter<T>, void, T*>::value >::type >\n        : public std::true_type {};\n#endif\n\ntemplate<typename T>\nstruct Ptr : public std::shared_ptr<T>\n{\n#if 0\n    using std::shared_ptr<T>::shared_ptr;  // GCC 5.x can't handle this\n#else\n    inline Ptr() CV_NOEXCEPT : std::shared_ptr<T>() {}\n    inline Ptr(nullptr_t) CV_NOEXCEPT : std::shared_ptr<T>(nullptr) {}\n    template<typename Y, typename D> inline Ptr(Y* p, D d) : std::shared_ptr<T>(p, d) {}\n    template<typename D> inline Ptr(nullptr_t, D d) : std::shared_ptr<T>(nullptr, d) {}\n\n    template<typename Y> inline Ptr(const Ptr<Y>& r, T* ptr) CV_NOEXCEPT : std::shared_ptr<T>(r, ptr) {}\n\n    inline Ptr(const Ptr<T>& o) CV_NOEXCEPT : std::shared_ptr<T>(o) {}\n    inline Ptr(Ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}\n\n    template<typename Y> inline Ptr(const Ptr<Y>& o) CV_NOEXCEPT : std::shared_ptr<T>(o) {}\n    template<typename Y> inline Ptr(Ptr<Y>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}\n#endif\n    inline Ptr(const std::shared_ptr<T>& o) CV_NOEXCEPT : std::shared_ptr<T>(o) {}\n    inline Ptr(std::shared_ptr<T>&& o) CV_NOEXCEPT : std::shared_ptr<T>(std::move(o)) {}\n\n    // Overload with custom DefaultDeleter: Ptr<IplImage>(...)\n    template<typename Y>\n    inline Ptr(const std::true_type&, Y* ptr) : std::shared_ptr<T>(ptr, DefaultDeleter<Y>()) {}\n\n    // Overload without custom deleter: Ptr<std::string>(...);\n    template<typename Y>\n    inline Ptr(const std::false_type&, Y* ptr) : std::shared_ptr<T>(ptr) {}\n\n    template<typename Y = T>\n    inline Ptr(Y* ptr) : Ptr(has_custom_delete<Y>(), ptr) {}\n\n    // Overload with custom DefaultDeleter: Ptr<IplImage>(...)\n    template<typename Y>\n    inline void reset(const std::true_type&, Y* ptr) { std::shared_ptr<T>::reset(ptr, DefaultDeleter<Y>()); }\n\n    // Overload without custom deleter: Ptr<std::string>(...);\n    template<typename Y>\n    inline void reset(const std::false_type&, Y* ptr) { std::shared_ptr<T>::reset(ptr); }\n\n    template<typename Y>\n    inline void reset(Y* ptr) { Ptr<T>::reset(has_custom_delete<Y>(), ptr); }\n\n    template<class Y, class Deleter>\n    void reset(Y* ptr, Deleter d) { std::shared_ptr<T>::reset(ptr, d); }\n\n    void reset() CV_NOEXCEPT { std::shared_ptr<T>::reset(); }\n\n    Ptr& operator=(const Ptr& o) { std::shared_ptr<T>::operator =(o); return *this; }\n    template<typename Y> inline Ptr& operator=(const Ptr<Y>& o) { std::shared_ptr<T>::operator =(o); return *this; }\n\n    T* operator->() const CV_NOEXCEPT { return std::shared_ptr<T>::get();}\n    typename std::add_lvalue_reference<T>::type operator*() const CV_NOEXCEPT { return *std::shared_ptr<T>::get(); }\n\n    // OpenCV 3.x methods (not a part of standard C++ library)\n    inline void release() { std::shared_ptr<T>::reset(); }\n    inline operator T* () const { return std::shared_ptr<T>::get(); }\n    inline bool empty() const { return std::shared_ptr<T>::get() == nullptr; }\n\n    template<typename Y> inline\n    Ptr<Y> staticCast() const CV_NOEXCEPT { return std::static_pointer_cast<Y>(*this); }\n\n    template<typename Y> inline\n    Ptr<Y> constCast() const CV_NOEXCEPT { return std::const_pointer_cast<Y>(*this); }\n\n    template<typename Y> inline\n    Ptr<Y> dynamicCast() const CV_NOEXCEPT { return std::dynamic_pointer_cast<Y>(*this); }\n};\n\ntemplate<typename _Tp, typename ... A1> static inline\nPtr<_Tp> makePtr(const A1&... a1)\n{\n    static_assert( !has_custom_delete<_Tp>::value, \"Can't use this makePtr with custom DefaultDeleter\");\n    return (Ptr<_Tp>)std::make_shared<_Tp>(a1...);\n}\n\n#endif // CV_DOXYGEN\n\n//! @} core_basic\n} // cv\n\n#endif //OPENCV_CORE_CVSTD_WRAPPER_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/detail/async_promise.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_ASYNC_PROMISE_HPP\n#define OPENCV_CORE_ASYNC_PROMISE_HPP\n\n#include \"../async.hpp\"\n\n#include \"exception_ptr.hpp\"\n\nnamespace cv {\n\n/** @addtogroup core_async\n@{\n*/\n\n\n/** @brief Provides result of asynchronous operations\n\n*/\nclass CV_EXPORTS AsyncPromise\n{\npublic:\n    ~AsyncPromise() CV_NOEXCEPT;\n    AsyncPromise() CV_NOEXCEPT;\n    explicit AsyncPromise(const AsyncPromise& o) CV_NOEXCEPT;\n    AsyncPromise& operator=(const AsyncPromise& o) CV_NOEXCEPT;\n    void release() CV_NOEXCEPT;\n\n    /** Returns associated AsyncArray\n    @note Can be called once\n    */\n    AsyncArray getArrayResult();\n\n    /** Stores asynchronous result.\n    @param[in] value result\n    */\n    void setValue(InputArray value);\n\n    // TODO \"move\" setters\n\n#if CV__EXCEPTION_PTR\n    /** Stores exception.\n    @param[in] exception exception to be raised in AsyncArray\n    */\n    void setException(std::exception_ptr exception);\n#endif\n\n    /** Stores exception.\n    @param[in] exception exception to be raised in AsyncArray\n    */\n    void setException(const cv::Exception& exception);\n\n#ifdef CV_CXX11\n    explicit AsyncPromise(AsyncPromise&& o) { p = o.p; o.p = NULL; }\n    AsyncPromise& operator=(AsyncPromise&& o) CV_NOEXCEPT { std::swap(p, o.p); return *this; }\n#endif\n\n\n    // PImpl\n    typedef struct AsyncArray::Impl Impl; friend struct AsyncArray::Impl;\n    inline void* _getImpl() const CV_NOEXCEPT { return p; }\nprotected:\n    Impl* p;\n};\n\n\n//! @}\n} // namespace\n#endif // OPENCV_CORE_ASYNC_PROMISE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/detail/exception_ptr.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_DETAILS_EXCEPTION_PTR_H\n#define OPENCV_CORE_DETAILS_EXCEPTION_PTR_H\n\n#ifndef CV__EXCEPTION_PTR\n#  if defined(__ANDROID__) && defined(ATOMIC_INT_LOCK_FREE) && ATOMIC_INT_LOCK_FREE < 2\n#    define CV__EXCEPTION_PTR 0  // Not supported, details: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938\n#  elif defined(CV_CXX11)\n#    define CV__EXCEPTION_PTR 1\n#  elif defined(_MSC_VER)\n#    define CV__EXCEPTION_PTR (_MSC_VER >= 1600)\n#  elif defined(__clang__)\n#    define CV__EXCEPTION_PTR 0  // C++11 only (see above)\n#  elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)\n#    define CV__EXCEPTION_PTR (__GXX_EXPERIMENTAL_CXX0X__ > 0)\n#  endif\n#endif\n#ifndef CV__EXCEPTION_PTR\n#  define CV__EXCEPTION_PTR 0\n#elif CV__EXCEPTION_PTR\n#  include <exception>  // std::exception_ptr\n#endif\n\n#endif // OPENCV_CORE_DETAILS_EXCEPTION_PTR_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/directx.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors as is and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the copyright holders or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_DIRECTX_HPP\n#define OPENCV_CORE_DIRECTX_HPP\n\n#include \"mat.hpp\"\n#include \"ocl.hpp\"\n\n#if !defined(__d3d11_h__)\nstruct ID3D11Device;\nstruct ID3D11Texture2D;\n#endif\n\n#if !defined(__d3d10_h__)\nstruct ID3D10Device;\nstruct ID3D10Texture2D;\n#endif\n\n#if !defined(_D3D9_H_)\nstruct IDirect3DDevice9;\nstruct IDirect3DDevice9Ex;\nstruct IDirect3DSurface9;\n#endif\n\n\nnamespace cv { namespace directx {\n\nnamespace ocl {\nusing namespace cv::ocl;\n\n//! @addtogroup core_directx\n// This section describes OpenCL and DirectX interoperability.\n//\n// To enable DirectX support, configure OpenCV using CMake with WITH_DIRECTX=ON . Note, DirectX is\n// supported only on Windows.\n//\n// To use OpenCL functionality you should first initialize OpenCL context from DirectX resource.\n//\n//! @{\n\n// TODO static functions in the Context class\n//! @brief Creates OpenCL context from D3D11 device\n//\n//! @param pD3D11Device - pointer to D3D11 device\n//! @return Returns reference to OpenCL Context\nCV_EXPORTS Context& initializeContextFromD3D11Device(ID3D11Device* pD3D11Device);\n\n//! @brief Creates OpenCL context from D3D10 device\n//\n//! @param pD3D10Device - pointer to D3D10 device\n//! @return Returns reference to OpenCL Context\nCV_EXPORTS Context& initializeContextFromD3D10Device(ID3D10Device* pD3D10Device);\n\n//! @brief Creates OpenCL context from Direct3DDevice9Ex device\n//\n//! @param pDirect3DDevice9Ex - pointer to Direct3DDevice9Ex device\n//! @return Returns reference to OpenCL Context\nCV_EXPORTS Context& initializeContextFromDirect3DDevice9Ex(IDirect3DDevice9Ex* pDirect3DDevice9Ex);\n\n//! @brief Creates OpenCL context from Direct3DDevice9 device\n//\n//! @param pDirect3DDevice9 - pointer to Direct3Device9 device\n//! @return Returns reference to OpenCL Context\nCV_EXPORTS Context& initializeContextFromDirect3DDevice9(IDirect3DDevice9* pDirect3DDevice9);\n\n//! @}\n\n} // namespace cv::directx::ocl\n\n//! @addtogroup core_directx\n//! @{\n\n//! @brief Converts InputArray to ID3D11Texture2D. If destination texture format is DXGI_FORMAT_NV12 then\n//!        input UMat expected to be in BGR format and data will be downsampled and color-converted to NV12.\n//\n//! @note Note: Destination texture must be allocated by application. Function does memory copy from src to\n//!             pD3D11Texture2D\n//\n//! @param src - source InputArray\n//! @param pD3D11Texture2D - destination D3D11 texture\nCV_EXPORTS void convertToD3D11Texture2D(InputArray src, ID3D11Texture2D* pD3D11Texture2D);\n\n//! @brief Converts ID3D11Texture2D to OutputArray. If input texture format is DXGI_FORMAT_NV12 then\n//!        data will be upsampled and color-converted to BGR format.\n//\n//! @note Note: Destination matrix will be re-allocated if it has not enough memory to match texture size.\n//!             function does memory copy from pD3D11Texture2D to dst\n//\n//! @param pD3D11Texture2D - source D3D11 texture\n//! @param dst             - destination OutputArray\nCV_EXPORTS void convertFromD3D11Texture2D(ID3D11Texture2D* pD3D11Texture2D, OutputArray dst);\n\n//! @brief Converts InputArray to ID3D10Texture2D\n//\n//! @note Note: function does memory copy from src to\n//!             pD3D10Texture2D\n//\n//! @param src             - source InputArray\n//! @param pD3D10Texture2D - destination D3D10 texture\nCV_EXPORTS void convertToD3D10Texture2D(InputArray src, ID3D10Texture2D* pD3D10Texture2D);\n\n//! @brief Converts ID3D10Texture2D to OutputArray\n//\n//! @note Note: function does memory copy from pD3D10Texture2D\n//!             to dst\n//\n//! @param pD3D10Texture2D - source D3D10 texture\n//! @param dst             - destination OutputArray\nCV_EXPORTS void convertFromD3D10Texture2D(ID3D10Texture2D* pD3D10Texture2D, OutputArray dst);\n\n//! @brief Converts InputArray to IDirect3DSurface9\n//\n//! @note Note: function does memory copy from src to\n//!             pDirect3DSurface9\n//\n//! @param src                 - source InputArray\n//! @param pDirect3DSurface9   - destination D3D10 texture\n//! @param surfaceSharedHandle - shared handle\nCV_EXPORTS void convertToDirect3DSurface9(InputArray src, IDirect3DSurface9* pDirect3DSurface9, void* surfaceSharedHandle = NULL);\n\n//! @brief Converts IDirect3DSurface9 to OutputArray\n//\n//! @note Note: function does memory copy from pDirect3DSurface9\n//!             to dst\n//\n//! @param pDirect3DSurface9   - source D3D10 texture\n//! @param dst                 - destination OutputArray\n//! @param surfaceSharedHandle - shared handle\nCV_EXPORTS void convertFromDirect3DSurface9(IDirect3DSurface9* pDirect3DSurface9, OutputArray dst, void* surfaceSharedHandle = NULL);\n\n//! @brief Get OpenCV type from DirectX type\n//! @param iDXGI_FORMAT - enum DXGI_FORMAT for D3D10/D3D11\n//! @return OpenCV type or -1 if there is no equivalent\nCV_EXPORTS int getTypeFromDXGI_FORMAT(const int iDXGI_FORMAT); // enum DXGI_FORMAT for D3D10/D3D11\n\n//! @brief Get OpenCV type from DirectX type\n//! @param iD3DFORMAT - enum D3DTYPE for D3D9\n//! @return OpenCV type or -1 if there is no equivalent\nCV_EXPORTS int getTypeFromD3DFORMAT(const int iD3DFORMAT); // enum D3DTYPE for D3D9\n\n//! @}\n\n} } // namespace cv::directx\n\n#endif // OPENCV_CORE_DIRECTX_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/dualquaternion.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2020, Huawei Technologies Co., Ltd. All rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//       http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// Author: Liangqian Kong <kongliangqian@huawei.com>\n//         Longbu Wang <wanglongbu@huawei.com>\n#ifndef OPENCV_CORE_DUALQUATERNION_HPP\n#define OPENCV_CORE_DUALQUATERNION_HPP\n\n#include <opencv2/core/quaternion.hpp>\n#include <opencv2/core/affine.hpp>\n\nnamespace cv{\n//! @addtogroup core\n//! @{\n\ntemplate <typename _Tp> class DualQuat;\ntemplate <typename _Tp> std::ostream& operator<<(std::ostream&, const DualQuat<_Tp>&);\n\n/**\n * Dual quaternions were introduced to describe rotation together with translation while ordinary\n * quaternions can only describe rotation. It can be used for shortest path pose interpolation,\n * local pose optimization or volumetric deformation. More details can be found\n * - https://en.wikipedia.org/wiki/Dual_quaternion\n * - [\"A beginners guide to dual-quaternions: what they are, how they work, and how to use them for 3D character hierarchies\", Ben Kenwright, 2012](https://borodust.org/public/shared/beginner_dual_quats.pdf)\n * - [\"Dual Quaternions\", Yan-Bin Jia, 2013](http://web.cs.iastate.edu/~cs577/handouts/dual-quaternion.pdf)\n * - [\"Geometric Skinning with Approximate Dual Quaternion Blending\", Kavan, 2008](https://www.cs.utah.edu/~ladislav/kavan08geometric/kavan08geometric)\n * - http://rodolphe-vaillant.fr/?e=29\n *\n * A unit dual quaternion can be classically represented as:\n * \\f[\n * \\begin{equation}\n * \\begin{split}\n * \\sigma &= \\left(r+\\frac{\\epsilon}{2}tr\\right)\\\\\n * &= [w, x, y, z, w\\_, x\\_, y\\_, z\\_]\n * \\end{split}\n * \\end{equation}\n * \\f]\n * where \\f$r, t\\f$ represents the rotation (ordinary unit quaternion) and translation (pure ordinary quaternion) respectively.\n *\n * A general dual quaternions which consist of two quaternions is usually represented in form of:\n * \\f[\n * \\sigma = p + \\epsilon q\n * \\f]\n * where the introduced dual unit \\f$\\epsilon\\f$ satisfies \\f$\\epsilon^2 = \\epsilon^3 =...=0\\f$, and \\f$p, q\\f$ are quaternions.\n *\n * Alternatively, dual quaternions can also be interpreted as four components which are all [dual numbers](https://www.cs.utah.edu/~ladislav/kavan08geometric/kavan08geometric):\n * \\f[\n * \\sigma = \\hat{q}_w + \\hat{q}_xi + \\hat{q}_yj + \\hat{q}_zk\n * \\f]\n * If we set \\f$\\hat{q}_x, \\hat{q}_y\\f$ and \\f$\\hat{q}_z\\f$ equal to 0, a dual quaternion is transformed to a dual number. see normalize().\n *\n * If you want to create a dual quaternion, you can use:\n *\n * ```\n * using namespace cv;\n * double angle = CV_PI;\n *\n * // create from eight number\n * DualQuatd dq1(1, 2, 3, 4, 5, 6, 7, 8); //p = [1,2,3,4]. q=[5,6,7,8]\n *\n * // create from Vec\n * Vec<double, 8> v{1,2,3,4,5,6,7,8};\n * DualQuatd dq_v{v};\n *\n * // create from two quaternion\n * Quatd p(1, 2, 3, 4);\n * Quatd q(5, 6, 7, 8);\n * DualQuatd dq2 = DualQuatd::createFromQuat(p, q);\n *\n * // create from an angle, an axis and a translation\n * Vec3d axis{0, 0, 1};\n * Vec3d trans{3, 4, 5};\n * DualQuatd dq3 = DualQuatd::createFromAngleAxisTrans(angle, axis, trans);\n *\n * // If you already have an instance of class Affine3, then you can use\n * Affine3d R = dq3.toAffine3();\n * DualQuatd dq4 = DualQuatd::createFromAffine3(R);\n *\n * // or create directly by affine transformation matrix Rt\n * // see createFromMat() in detail for the form of Rt\n * Matx44d Rt = dq3.toMat();\n * DualQuatd dq5 = DualQuatd::createFromMat(Rt);\n *\n * // Any rotation + translation movement can\n * // be expressed as a rotation + translation around the same line in space (expressed by Plucker\n * // coords), and here's a way to represent it this way.\n * Vec3d axis{1, 1, 1}; // axis will be normalized in createFromPitch\n * Vec3d trans{3, 4 ,5};\n * axis = axis / std::sqrt(axis.dot(axis));// The formula for computing moment that I use below requires a normalized axis\n * Vec3d moment = 1.0 / 2 * (trans.cross(axis) + axis.cross(trans.cross(axis)) *\n *                            std::cos(rotation_angle / 2) / std::sin(rotation_angle / 2));\n * double d = trans.dot(qaxis);\n * DualQuatd dq6 = DualQuatd::createFromPitch(angle, d, axis, moment);\n * ```\n *\n * A point \\f$v=(x, y, z)\\f$ in form of dual quaternion is \\f$[1+\\epsilon v]=[1,0,0,0,0,x,y,z]\\f$.\n * The transformation of a point \\f$v_1\\f$ to another point \\f$v_2\\f$ under the dual quaternion \\f$\\sigma\\f$ is\n * \\f[\n * 1 + \\epsilon v_2 = \\sigma * (1 + \\epsilon v_1) * \\sigma^{\\star}\n * \\f]\n * where \\f$\\sigma^{\\star}=p^*-\\epsilon q^*.\\f$\n *\n * A line in the \\f$Pl\\ddot{u}cker\\f$ coordinates \\f$(\\hat{l}, m)\\f$ defined by the dual quaternion \\f$l=\\hat{l}+\\epsilon m\\f$.\n * To transform a line, \\f[l_2 = \\sigma * l_1 * \\sigma^*,\\f] where \\f$\\sigma=r+\\frac{\\epsilon}{2}rt\\f$ and\n * \\f$\\sigma^*=p^*+\\epsilon q^*\\f$.\n *\n * To extract the Vec<double, 8> or Vec<float, 8>, see toVec();\n *\n * To extract the affine transformation matrix, see toMat();\n *\n * To extract the instance of Affine3, see toAffine3();\n *\n * If two quaternions \\f$q_0, q_1\\f$ are needed to be interpolated, you can use sclerp()\n * ```\n * DualQuatd::sclerp(q0, q1, t)\n * ```\n * or dqblend().\n * ```\n * DualQuatd::dqblend(q0, q1, t)\n * ```\n * With more than two dual quaternions to be blended, you can use generalize linear dual quaternion blending\n * with the corresponding weights, i.e. gdqblend().\n *\n */\ntemplate <typename _Tp>\nclass CV_EXPORTS DualQuat{\n    static_assert(std::is_floating_point<_Tp>::value, \"Dual quaternion only make sense with type of float or double\");\n    using value_type = _Tp;\n\npublic:\n    static constexpr _Tp CV_DUAL_QUAT_EPS = (_Tp)1.e-6;\n\n    DualQuat();\n\n    /**\n     * @brief create from eight same type numbers.\n     */\n    DualQuat(const _Tp w, const _Tp x, const _Tp y, const _Tp z, const _Tp w_, const _Tp x_, const _Tp y_, const _Tp z_);\n\n    /**\n     * @brief create from a double or float vector.\n     */\n    DualQuat(const Vec<_Tp, 8> &q);\n\n    _Tp w, x, y, z, w_, x_, y_, z_;\n\n    /**\n     * @brief create Dual Quaternion from two same type quaternions p and q.\n     * A Dual Quaternion \\f$\\sigma\\f$ has the form:\n     * \\f[\\sigma = p + \\epsilon q\\f]\n     * where p and q are defined as follows:\n     * \\f[\\begin{equation}\n     *    \\begin{split}\n     *    p &= w + x\\boldsymbol{i} + y\\boldsymbol{j} + z\\boldsymbol{k}\\\\\n     *    q &= w\\_ + x\\_\\boldsymbol{i} + y\\_\\boldsymbol{j} + z\\_\\boldsymbol{k}.\n     *    \\end{split}\n     *   \\end{equation}\n     * \\f]\n     * The p and q are the real part and dual part respectively.\n     * @param realPart a quaternion, real part of dual quaternion.\n     * @param dualPart a quaternion, dual part of dual quaternion.\n     * @sa Quat\n    */\n    static DualQuat<_Tp> createFromQuat(const Quat<_Tp> &realPart, const Quat<_Tp> &dualPart);\n\n    /**\n     * @brief create a dual quaternion from a rotation angle \\f$\\theta\\f$, a rotation axis\n     * \\f$\\boldsymbol{u}\\f$ and a translation \\f$\\boldsymbol{t}\\f$.\n     * It generates a dual quaternion \\f$\\sigma\\f$ in the form of\n     * \\f[\\begin{equation}\n     *    \\begin{split}\n     *    \\sigma &= r + \\frac{\\epsilon}{2}\\boldsymbol{t}r \\\\\n     *           &= [\\cos(\\frac{\\theta}{2}), \\boldsymbol{u}\\sin(\\frac{\\theta}{2})]\n     *           + \\frac{\\epsilon}{2}[0, \\boldsymbol{t}][[\\cos(\\frac{\\theta}{2}),\n     *           \\boldsymbol{u}\\sin(\\frac{\\theta}{2})]]\\\\\n     *           &= \\cos(\\frac{\\theta}{2}) + \\boldsymbol{u}\\sin(\\frac{\\theta}{2})\n     *           + \\frac{\\epsilon}{2}(-(\\boldsymbol{t} \\cdot \\boldsymbol{u})\\sin(\\frac{\\theta}{2})\n     *           + \\boldsymbol{t}\\cos(\\frac{\\theta}{2}) + \\boldsymbol{u} \\times \\boldsymbol{t} \\sin(\\frac{\\theta}{2})).\n     *    \\end{split}\n     *    \\end{equation}\\f]\n     * @param angle rotation angle.\n     * @param axis rotation axis.\n     * @param translation a vector of length 3.\n     * @note Axis will be normalized in this function. And translation is applied\n     * after the rotation. Use @ref createFromQuat(r, r * t / 2) to create a dual quaternion\n     * which translation is applied before rotation.\n     * @sa Quat\n     */\n    static DualQuat<_Tp> createFromAngleAxisTrans(const _Tp angle, const Vec<_Tp, 3> &axis, const Vec<_Tp, 3> &translation);\n\n    /**\n     * @brief Transform this dual quaternion to an affine transformation matrix \\f$M\\f$.\n     * Dual quaternion consists of a rotation \\f$r=[a,b,c,d]\\f$ and a translation \\f$t=[\\Delta x,\\Delta y,\\Delta z]\\f$. The\n     * affine transformation matrix \\f$M\\f$ has the form\n     * \\f[\n     * \\begin{bmatrix}\n     * 1-2(e_2^2 +e_3^2) &2(e_1e_2-e_0e_3) &2(e_0e_2+e_1e_3) &\\Delta x\\\\\n     * 2(e_0e_3+e_1e_2)  &1-2(e_1^2+e_3^2) &2(e_2e_3-e_0e_1) &\\Delta y\\\\\n     * 2(e_1e_3-e_0e_2)  &2(e_0e_1+e_2e_3) &1-2(e_1^2-e_2^2) &\\Delta z\\\\\n     * 0&0&0&1\n     * \\end{bmatrix}\n     * \\f]\n     *  if A is a matrix consisting of  n points to be transformed, this could be achieved by\n     * \\f[\n     *  new\\_A = M * A\n     * \\f]\n     * where A has the form\n     * \\f[\n     * \\begin{bmatrix}\n     * x_0& x_1& x_2&...&x_n\\\\\n     * y_0& y_1& y_2&...&y_n\\\\\n     * z_0& z_1& z_2&...&z_n\\\\\n     * 1&1&1&...&1\n     * \\end{bmatrix}\n     * \\f]\n     * where the same subscript represent the same point. The size of A should be \\f$[4,n]\\f$.\n     * and the same size for matrix new_A.\n     * @param _R 4x4 matrix that represents rotations and translation.\n     * @note Translation is applied after the rotation. Use createFromQuat(r, r * t / 2) to create\n     * a dual quaternion which translation is applied before rotation.\n     */\n    static DualQuat<_Tp> createFromMat(InputArray _R);\n\n    /**\n     * @brief create dual quaternion from an affine matrix. The definition of affine matrix can refer to  createFromMat()\n     */\n    static DualQuat<_Tp> createFromAffine3(const Affine3<_Tp> &R);\n\n    /**\n     * @brief A dual quaternion is a vector in form of\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * \\sigma &=\\boldsymbol{p} + \\epsilon \\boldsymbol{q}\\\\\n     * &= \\cos\\hat{\\frac{\\theta}{2}}+\\overline{\\hat{l}}\\sin\\frac{\\hat{\\theta}}{2}\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     * where \\f$\\hat{\\theta}\\f$ is dual angle and \\f$\\overline{\\hat{l}}\\f$ is dual axis:\n     * \\f[\n     * \\hat{\\theta}=\\theta + \\epsilon d,\\\\\n     * \\overline{\\hat{l}}= \\hat{l} +\\epsilon m.\n     * \\f]\n     * In this representation, \\f$\\theta\\f$ is rotation angle and \\f$(\\hat{l},m)\\f$ is the screw axis, d is the translation distance along the axis.\n     *\n     * @param angle rotation angle.\n     * @param d translation along the rotation axis.\n     * @param axis rotation axis represented by quaternion with w = 0.\n     * @param moment the moment of line, and it should be orthogonal to axis.\n     * @note Translation is applied after the rotation. Use createFromQuat(r, r * t / 2) to create\n     * a dual quaternion which translation is applied before rotation.\n     */\n    static DualQuat<_Tp> createFromPitch(const _Tp angle, const _Tp d, const Vec<_Tp, 3> &axis, const Vec<_Tp, 3> &moment);\n\n    /**\n     * @brief return a quaternion which represent the real part of dual quaternion.\n     * The definition of real part is in createFromQuat().\n     * @sa createFromQuat, getDualPart\n     */\n    Quat<_Tp> getRealPart() const;\n\n    /**\n     * @brief return a quaternion which represent the dual part of dual quaternion.\n     * The definition of dual part is in createFromQuat().\n     * @sa createFromQuat, getRealPart\n     */\n    Quat<_Tp> getDualPart() const;\n\n    /**\n     * @brief return the conjugate of a dual quaternion.\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * \\sigma^* &= (p + \\epsilon q)^*\n     *          &= (p^* + \\epsilon q^*)\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     * @param dq a dual quaternion.\n     */\n    template <typename T>\n    friend DualQuat<T> conjugate(const DualQuat<T> &dq);\n\n    /**\n     * @brief return the conjugate of a dual quaternion.\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * \\sigma^* &= (p + \\epsilon q)^*\n     *          &= (p^* + \\epsilon q^*)\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     */\n    DualQuat<_Tp> conjugate() const;\n\n    /**\n     * @brief return the rotation in quaternion form.\n     */\n    Quat<_Tp> getRotation(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return the translation vector.\n     * The rotation \\f$r\\f$ in this dual quaternion \\f$\\sigma\\f$ is applied before translation \\f$t\\f$.\n     * The dual quaternion \\f$\\sigma\\f$ is defined as\n     * \\f[\\begin{equation}\n     * \\begin{split}\n     * \\sigma &= p + \\epsilon q \\\\\n     *        &= r + \\frac{\\epsilon}{2}{t}r.\n     * \\end{split}\n     * \\end{equation}\\f]\n     * Thus, the translation can be obtained as follows\n     * \\f[t = 2qp^*.\\f]\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, this dual quaternion assume to be a unit dual quaternion\n     * and this function will save some computations.\n     * @note This dual quaternion's translation is applied after the rotation.\n     */\n    Vec<_Tp, 3> getTranslation(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return the norm \\f$||\\sigma||\\f$ of dual quaternion \\f$\\sigma = p + \\epsilon q\\f$.\n     * \\f[\n     *  \\begin{equation}\n     *  \\begin{split}\n     *  ||\\sigma|| &= \\sqrt{\\sigma * \\sigma^*} \\\\\n     *        &= ||p|| + \\epsilon \\frac{p \\cdot q}{||p||}.\n     *  \\end{split}\n     *  \\end{equation}\n     *  \\f]\n     * Generally speaking, the norm of a not unit dual\n     * quaternion is a dual number. For convenience, we return it in the form of a dual quaternion\n     * , i.e.\n     * \\f[ ||\\sigma|| = [||p||, 0, 0, 0, \\frac{p \\cdot q}{||p||}, 0, 0, 0].\\f]\n     *\n     * @note The data type of dual number is dual quaternion.\n     */\n    DualQuat<_Tp> norm() const;\n\n    /**\n     * @brief return a normalized dual quaternion.\n     * A dual quaternion can be expressed as\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * \\sigma &= p + \\epsilon q\\\\\n     * &=||\\sigma||\\left(r+\\frac{1}{2}tr\\right)\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     * where \\f$r, t\\f$ represents the rotation (ordinary quaternion) and translation (pure ordinary quaternion) respectively,\n     * and \\f$||\\sigma||\\f$ is the norm of dual quaternion(a dual number).\n     * A dual quaternion is unit if and only if\n     * \\f[\n     * ||p||=1, p \\cdot q=0\n     * \\f]\n     * where \\f$\\cdot\\f$ means dot product.\n     * The process of normalization is\n     * \\f[\n     * \\sigma_{u}=\\frac{\\sigma}{||\\sigma||}\n     * \\f]\n     * Next, we simply proof \\f$\\sigma_u\\f$ is a unit dual quaternion:\n     * \\f[\n     * \\renewcommand{\\Im}{\\operatorname{Im}}\n     * \\begin{equation}\n     * \\begin{split}\n     * \\sigma_{u}=\\frac{\\sigma}{||\\sigma||}&=\\frac{p + \\epsilon q}{||p||+\\epsilon\\frac{p\\cdot q}{||p||}}\\\\\n     * &=\\frac{p}{||p||}+\\epsilon\\left(\\frac{q}{||p||}-p\\frac{p\\cdot q}{||p||^3}\\right)\\\\\n     * &=\\frac{p}{||p||}+\\epsilon\\frac{1}{||p||^2}\\left(qp^{*}-p\\cdot q\\right)\\frac{p}{||p||}\\\\\n     * &=\\frac{p}{||p||}+\\epsilon\\frac{1}{||p||^2}\\Im(qp^*)\\frac{p}{||p||}.\\\\\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     * As expected, the real part is a rotation and dual part is a pure quaternion.\n     */\n    DualQuat<_Tp> normalize() const;\n\n    /**\n     * @brief if \\f$\\sigma = p + \\epsilon q\\f$ is a dual quaternion, p is not zero,\n     * the inverse dual quaternion is\n     * \\f[\\sigma^{-1} = \\frac{\\sigma^*}{||\\sigma||^2}, \\f]\n     * or equivalentlly,\n     * \\f[\\sigma^{-1} = p^{-1} - \\epsilon p^{-1}qp^{-1}.\\f]\n     * @param dq a dual quaternion.\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, dual quaternion dq assume to be a unit dual quaternion\n     * and this function will save some computations.\n     */\n    template <typename T>\n    friend DualQuat<T> inv(const DualQuat<T> &dq, QuatAssumeType assumeUnit);\n\n    /**\n     * @brief if \\f$\\sigma = p + \\epsilon q\\f$ is a dual quaternion, p is not zero,\n     * the inverse dual quaternion is\n     * \\f[\\sigma^{-1} = \\frac{\\sigma^*}{||\\sigma||^2}, \\f]\n     * or equivalentlly,\n     * \\f[\\sigma^{-1} = p^{-1} - \\epsilon p^{-1}qp^{-1}.\\f]\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, this dual quaternion assume to be a unit dual quaternion\n     * and this function will save some computations.\n     */\n    DualQuat<_Tp> inv(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return the dot product of two dual quaternion.\n     * @param p other dual quaternion.\n     */\n    _Tp dot(DualQuat<_Tp> p) const;\n\n    /**\n     ** @brief return the value of \\f$p^t\\f$ where p is a dual quaternion.\n     * This could be calculated as:\n     * \\f[\n     * p^t = \\exp(t\\ln p)\n     * \\f]\n     * @param dq a dual quaternion.\n     * @param t index of power function.\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, dual quaternion dq assume to be a unit dual quaternion\n     * and this function will save some computations.\n     */\n    template <typename T>\n    friend DualQuat<T> power(const DualQuat<T> &dq, const T t, QuatAssumeType assumeUnit);\n\n    /**\n     ** @brief return the value of \\f$p^t\\f$ where p is a dual quaternion.\n     * This could be calculated as:\n     * \\f[\n     * p^t = \\exp(t\\ln p)\n     * \\f]\n     *\n     * @param t index of power function.\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, this dual quaternion assume to be a unit dual quaternion\n     * and this function will save some computations.\n     */\n    DualQuat<_Tp> power(const _Tp t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return the value of \\f$p^q\\f$ where p and q are dual quaternions.\n     * This could be calculated as:\n     * \\f[\n     * p^q = \\exp(q\\ln p)\n     * \\f]\n     * @param p a dual quaternion.\n     * @param q a dual quaternion.\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, dual quaternion p assume to be a dual unit quaternion\n     * and this function will save some computations.\n     */\n    template <typename T>\n    friend DualQuat<T> power(const DualQuat<T>& p, const DualQuat<T>& q, QuatAssumeType assumeUnit);\n\n    /**\n     * @brief return the value of \\f$p^q\\f$ where p and q are dual quaternions.\n     * This could be calculated as:\n     * \\f[\n     * p^q = \\exp(q\\ln p)\n     * \\f]\n     *\n     * @param q a dual quaternion\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, this dual quaternion assume to be a dual unit quaternion\n     * and this function will save some computations.\n     */\n    DualQuat<_Tp> power(const DualQuat<_Tp>& q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return the value of exponential function value\n     * @param dq a dual quaternion.\n     */\n    template <typename T>\n    friend DualQuat<T> exp(const DualQuat<T> &dq);\n\n    /**\n     * @brief return the value of exponential function value\n     */\n    DualQuat<_Tp> exp() const;\n\n    /**\n     * @brief return the value of logarithm function value\n     *\n     * @param dq a dual quaternion.\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, dual quaternion dq assume to be a unit dual quaternion\n     * and this function will save some computations.\n     */\n    template <typename T>\n    friend DualQuat<T> log(const DualQuat<T> &dq, QuatAssumeType assumeUnit);\n\n    /**\n     * @brief return the value of logarithm function value\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, this dual quaternion assume to be a unit dual quaternion\n     * and this function will save some computations.\n     */\n    DualQuat<_Tp> log(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief Transform this dual quaternion to a vector.\n     */\n    Vec<_Tp, 8> toVec() const;\n\n    /**\n     * @brief Transform this dual quaternion to a affine transformation matrix\n     * the form of matrix, see createFromMat().\n     */\n    Matx<_Tp, 4, 4> toMat(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n      * @brief Transform this dual quaternion to a instance of Affine3.\n      */\n    Affine3<_Tp> toAffine3(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief The screw linear interpolation(ScLERP) is an extension of spherical linear interpolation of dual quaternion.\n     * If \\f$\\sigma_1\\f$ and \\f$\\sigma_2\\f$ are two dual quaternions representing the initial and final pose.\n     * The interpolation of ScLERP function can be defined as:\n     * \\f[\n     * ScLERP(t;\\sigma_1,\\sigma_2) = \\sigma_1 * (\\sigma_1^{-1} * \\sigma_2)^t, t\\in[0,1]\n     * \\f]\n     *\n     * @param q1 a dual quaternion represents a initial pose.\n     * @param q2 a dual quaternion represents a final pose.\n     * @param t interpolation parameter\n     * @param directChange if true, it always return the shortest path.\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, this dual quaternion assume to be a unit dual quaternion\n     * and this function will save some computations.\n     *\n     * For example\n     * ```\n     * double angle1 = CV_PI / 2;\n     * Vec3d axis{0, 0, 1};\n     * Vec3d t(0, 0, 3);\n     * DualQuatd initial = DualQuatd::createFromAngleAxisTrans(angle1, axis, t);\n     * double angle2 = CV_PI;\n     * DualQuatd final = DualQuatd::createFromAngleAxisTrans(angle2, axis, t);\n     * DualQuatd inter = DualQuatd::sclerp(initial, final, 0.5);\n     * ```\n     */\n    static DualQuat<_Tp> sclerp(const DualQuat<_Tp> &q1, const DualQuat<_Tp> &q2, const _Tp t,\n                                bool directChange=true, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n    /**\n     * @brief The method of Dual Quaternion linear Blending(DQB) is to compute a transformation between dual quaternion\n     * \\f$q_1\\f$ and \\f$q_2\\f$ and can be defined as:\n     * \\f[\n     * DQB(t;{\\boldsymbol{q}}_1,{\\boldsymbol{q}}_2)=\n     * \\frac{(1-t){\\boldsymbol{q}}_1+t{\\boldsymbol{q}}_2}{||(1-t){\\boldsymbol{q}}_1+t{\\boldsymbol{q}}_2||}.\n     * \\f]\n     * where \\f$q_1\\f$ and \\f$q_2\\f$ are unit dual quaternions representing the input transformations.\n     * If you want to use DQB that works for more than two rigid transformations, see @ref gdqblend\n     *\n     * @param q1 a unit dual quaternion representing the input transformations.\n     * @param q2 a unit dual quaternion representing the input transformations.\n     * @param t parameter \\f$t\\in[0,1]\\f$.\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, this dual quaternion assume to be a unit dual quaternion\n     * and this function will save some computations.\n     *\n     * @sa gdqblend\n     */\n    static DualQuat<_Tp> dqblend(const DualQuat<_Tp> &q1, const DualQuat<_Tp> &q2, const _Tp t,\n                                   QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\n    /**\n     * @brief The generalized Dual Quaternion linear Blending works for more than two rigid transformations.\n     * If these transformations are expressed as unit dual quaternions \\f$q_1,...,q_n\\f$ with convex weights\n     * \\f$w = (w_1,...,w_n)\\f$, the generalized DQB is simply\n     * \\f[\n     * gDQB(\\boldsymbol{w};{\\boldsymbol{q}}_1,...,{\\boldsymbol{q}}_n)=\\frac{w_1{\\boldsymbol{q}}_1+...+w_n{\\boldsymbol{q}}_n}\n     * {||w_1{\\boldsymbol{q}}_1+...+w_n{\\boldsymbol{q}}_n||}.\n     * \\f]\n     * @param dualquat vector of dual quaternions\n     * @param weights vector of weights, the size of weights should be the same as dualquat, and the weights should\n     * satisfy \\f$\\sum_0^n w_{i} = 1\\f$ and \\f$w_i>0\\f$.\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, these dual quaternions assume to be unit quaternions\n     * and this function will save some computations.\n     * @note the type of weights' element should be the same as the date type of dual quaternion inside the dualquat.\n     */\n    template <int cn>\n    static DualQuat<_Tp> gdqblend(const Vec<DualQuat<_Tp>, cn> &dualquat, InputArray weights,\n                                QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\n    /**\n     * @brief The generalized Dual Quaternion linear Blending works for more than two rigid transformations.\n     * If these transformations are expressed as unit dual quaternions \\f$q_1,...,q_n\\f$ with convex weights\n     * \\f$w = (w_1,...,w_n)\\f$, the generalized DQB is simply\n     * \\f[\n     * gDQB(\\boldsymbol{w};{\\boldsymbol{q}}_1,...,{\\boldsymbol{q}}_n)=\\frac{w_1{\\boldsymbol{q}}_1+...+w_n{\\boldsymbol{q}}_n}\n     * {||w_1{\\boldsymbol{q}}_1+...+w_n{\\boldsymbol{q}}_n||}.\n     * \\f]\n     * @param dualquat The dual quaternions which have 8 channels and 1 row or 1 col.\n     * @param weights vector of weights, the size of weights should be the same as dualquat, and the weights should\n     * satisfy \\f$\\sum_0^n w_{i} = 1\\f$ and \\f$w_i>0\\f$.\n     * @param assumeUnit if @ref QUAT_ASSUME_UNIT, these dual quaternions assume to be unit quaternions\n     * and this function will save some computations.\n     * @note the type of weights' element should be the same as the date type of dual quaternion inside the dualquat.\n     */\n    static DualQuat<_Tp> gdqblend(InputArray dualquat, InputArray weights,\n                                QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\n    /**\n     * @brief Return opposite dual quaternion \\f$-p\\f$\n     * which satisfies \\f$p + (-p) = 0.\\f$\n     *\n     * For example\n     * ```\n     * DualQuatd q{1, 2, 3, 4, 5, 6, 7, 8};\n     * std::cout << -q << std::endl; // [-1, -2, -3, -4, -5, -6, -7, -8]\n     * ```\n     */\n    DualQuat<_Tp> operator-() const;\n\n    /**\n     * @brief return true if two dual quaternions p and q are nearly equal, i.e. when the absolute\n     * value of each \\f$p_i\\f$ and \\f$q_i\\f$ is less than CV_DUAL_QUAT_EPS.\n     */\n    bool operator==(const DualQuat<_Tp>&) const;\n\n    /**\n     * @brief Subtraction operator of two dual quaternions p and q.\n     * It returns a new dual quaternion that each value is the sum of \\f$p_i\\f$ and \\f$-q_i\\f$.\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * DualQuatd q{5, 6, 7, 8, 9, 10, 11, 12};\n     * std::cout << p - q << std::endl; //[-4, -4, -4, -4, 4, -4, -4, -4]\n     * ```\n     */\n    DualQuat<_Tp> operator-(const DualQuat<_Tp>&) const;\n\n    /**\n     * @brief Subtraction assignment operator of two dual quaternions p and q.\n     * It subtracts right operand from the left operand and assign the result to left operand.\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * DualQuatd q{5, 6, 7, 8, 9, 10, 11, 12};\n     * p -= q; // equivalent to p = p - q\n     * std::cout << p << std::endl; //[-4, -4, -4, -4, 4, -4, -4, -4]\n     *\n     * ```\n     */\n    DualQuat<_Tp>& operator-=(const DualQuat<_Tp>&);\n\n    /**\n     * @brief Addition operator of two dual quaternions p and q.\n     * It returns a new dual quaternion that each value is the sum of \\f$p_i\\f$ and \\f$q_i\\f$.\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * DualQuatd q{5, 6, 7, 8, 9, 10, 11, 12};\n     * std::cout << p + q << std::endl; //[6, 8, 10, 12, 14, 16, 18, 20]\n     * ```\n     */\n    DualQuat<_Tp> operator+(const DualQuat<_Tp>&) const;\n\n    /**\n     * @brief Addition assignment operator of two dual quaternions p and q.\n     * It adds right operand to the left operand and assign the result to left operand.\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * DualQuatd q{5, 6, 7, 8, 9, 10, 11, 12};\n     * p += q; // equivalent to p = p + q\n     * std::cout << p << std::endl; //[6, 8, 10, 12, 14, 16, 18, 20]\n     *\n     * ```\n     */\n    DualQuat<_Tp>& operator+=(const DualQuat<_Tp>&);\n\n    /**\n     * @brief Multiplication assignment operator of two quaternions.\n     * It multiplies right operand with the left operand and assign the result to left operand.\n     *\n     * Rule of dual quaternion multiplication:\n     * The dual quaternion can be written as an ordered pair of quaternions [A, B]. Thus\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * q &= [A, B][C, D]\\\\\n     * &=[AC, AD + BC]\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * DualQuatd q{5, 6, 7, 8, 9, 10, 11, 12};\n     * p *= q;\n     * std::cout << p << std::endl; //[-60, 12, 30, 24, -216, 80, 124, 120]\n     * ```\n     */\n    DualQuat<_Tp>& operator*=(const DualQuat<_Tp>&);\n\n    /**\n     * @brief Multiplication assignment operator of a quaternions and a scalar.\n     * It multiplies right operand with the left operand and assign the result to left operand.\n     *\n     * Rule of dual quaternion multiplication with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * s &= [w, x, y, z, w\\_, x\\_, y\\_, z\\_] * s\\\\\n     *  &=[w   s, x   s, y   s, z   s, w\\_  \\space  s, x\\_  \\space  s, y\\_ \\space  s, z\\_ \\space  s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * double s = 2.0;\n     * p *= s;\n     * std::cout << p << std::endl; //[2, 4, 6, 8, 10, 12, 14, 16]\n     * ```\n     * @note the type of scalar should be equal to the dual quaternion.\n     */\n    DualQuat<_Tp> operator*=(const _Tp s);\n\n\n    /**\n     * @brief Multiplication operator of two dual quaternions q and p.\n     * Multiplies values on either side of the operator.\n     *\n     * Rule of dual quaternion multiplication:\n     * The dual quaternion can be written as an ordered pair of quaternions [A, B]. Thus\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * q &= [A, B][C, D]\\\\\n     * &=[AC, AD + BC]\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * DualQuatd q{5, 6, 7, 8, 9, 10, 11, 12};\n     * std::cout << p * q << std::endl; //[-60, 12, 30, 24, -216, 80, 124, 120]\n     * ```\n     */\n    DualQuat<_Tp> operator*(const DualQuat<_Tp>&) const;\n\n    /**\n     * @brief Division operator of a dual quaternions and a scalar.\n     * It divides left operand with the right operand and assign the result to left operand.\n     *\n     * Rule of dual quaternion division with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p / s &= [w, x, y, z, w\\_, x\\_, y\\_, z\\_] / s\\\\\n     * &=[w/s, x/s, y/s, z/s, w\\_/s, x\\_/s, y\\_/s, z\\_/s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * double s = 2.0;\n     * p /= s; // equivalent to p = p / s\n     * std::cout << p << std::endl; //[0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4]\n     * ```\n     * @note the type of scalar should be equal to this dual quaternion.\n     */\n    DualQuat<_Tp> operator/(const _Tp s) const;\n\n    /**\n     * @brief Division operator of two dual quaternions p and q.\n     * Divides left hand operand by right hand operand.\n     *\n     * Rule of dual quaternion division with a dual quaternion:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p / q &= p * q.inv()\\\\\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * DualQuatd q{5, 6, 7, 8, 9, 10, 11, 12};\n     * std::cout << p / q << std::endl; // equivalent to p * q.inv()\n     * ```\n     */\n    DualQuat<_Tp> operator/(const DualQuat<_Tp>&) const;\n\n    /**\n     * @brief Division assignment operator of two dual quaternions p and q;\n     * It divides left operand with the right operand and assign the result to left operand.\n     *\n     * Rule of dual quaternion division with a quaternion:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p / q&= p * q.inv()\\\\\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * DualQuatd q{5, 6, 7, 8, 9, 10, 11, 12};\n     * p /= q; // equivalent to p = p * q.inv()\n     * std::cout << p << std::endl;\n     * ```\n     */\n    DualQuat<_Tp>& operator/=(const DualQuat<_Tp>&);\n\n    /**\n     * @brief Division assignment operator of a dual quaternions and a scalar.\n     * It divides left operand with the right operand and assign the result to left operand.\n     *\n     * Rule of dual quaternion division with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p / s &= [w, x, y, z, w\\_, x\\_, y\\_ ,z\\_] / s\\\\\n     * &=[w / s, x / s, y / s, z / s, w\\_ / \\space s, x\\_ / \\space s, y\\_ / \\space s, z\\_ / \\space s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * double s = 2.0;;\n     * p /= s; // equivalent to p = p / s\n     * std::cout << p << std::endl; //[0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0]\n     * ```\n     * @note the type of scalar should be equal to the dual quaternion.\n     */\n    Quat<_Tp>& operator/=(const _Tp s);\n\n    /**\n     * @brief Addition operator of a scalar and a dual quaternions.\n     * Adds right hand operand from left hand operand.\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * double scalar = 2.0;\n     * std::cout << scalar + p << std::endl; //[3.0, 2, 3, 4, 5, 6, 7, 8]\n     * ```\n     * @note the type of scalar should be equal to the dual quaternion.\n     */\n    template <typename T>\n    friend DualQuat<T> cv::operator+(const T s, const DualQuat<T>&);\n\n    /**\n     * @brief Addition operator of a dual quaternions and a scalar.\n     * Adds right hand operand from left hand operand.\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * double scalar = 2.0;\n     * std::cout << p + scalar << std::endl; //[3.0, 2, 3, 4, 5, 6, 7, 8]\n     * ```\n     * @note the type of scalar should be equal to the dual quaternion.\n     */\n    template <typename T>\n    friend DualQuat<T> cv::operator+(const DualQuat<T>&, const T s);\n\n    /**\n     * @brief Multiplication operator of a scalar and a dual quaternions.\n     * It multiplies right operand with the left operand and assign the result to left operand.\n     *\n     * Rule of dual quaternion multiplication with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * s &= [w, x, y, z, w\\_, x\\_, y\\_, z\\_] * s\\\\\n     * &=[w s, x s, y s, z s, w\\_ \\space s, x\\_ \\space s, y\\_ \\space s, z\\_ \\space s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * double s = 2.0;\n     * std::cout << s * p << std::endl; //[2, 4, 6, 8, 10, 12, 14, 16]\n     * ```\n     * @note the type of scalar should be equal to the dual quaternion.\n     */\n    template <typename T>\n    friend DualQuat<T> cv::operator*(const T s, const DualQuat<T>&);\n\n    /**\n     * @brief Subtraction operator of a dual quaternion and a scalar.\n     * Subtracts right hand operand from left hand operand.\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * double scalar = 2.0;\n     * std::cout << p - scalar << std::endl; //[-1, 2, 3, 4, 5, 6, 7, 8]\n     * ```\n     * @note the type of scalar should be equal to the dual quaternion.\n     */\n    template <typename T>\n    friend DualQuat<T> cv::operator-(const DualQuat<T>&, const T s);\n\n    /**\n     * @brief Subtraction operator of a scalar and a dual quaternions.\n     * Subtracts right hand operand from left hand operand.\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * double scalar = 2.0;\n     * std::cout << scalar - p << std::endl; //[1.0, -2, -3, -4, -5, -6, -7, -8]\n     * ```\n     * @note the type of scalar should be equal to the dual quaternion.\n     */\n    template <typename T>\n    friend DualQuat<T> cv::operator-(const T s, const DualQuat<T>&);\n\n    /**\n     * @brief Multiplication operator of a dual quaternions and a scalar.\n     * It multiplies right operand with the left operand and assign the result to left operand.\n     *\n     * Rule of dual quaternion multiplication with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * s &= [w, x, y, z, w\\_, x\\_, y\\_, z\\_] * s\\\\\n     * &=[w s, x s, y s, z s, w\\_ \\space s, x\\_ \\space s, y\\_ \\space s, z\\_ \\space s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * DualQuatd p{1, 2, 3, 4, 5, 6, 7, 8};\n     * double s = 2.0;\n     * std::cout << p * s << std::endl; //[2, 4, 6, 8, 10, 12, 14, 16]\n     * ```\n     * @note the type of scalar should be equal to the dual quaternion.\n     */\n    template <typename T>\n    friend DualQuat<T> cv::operator*(const DualQuat<T>&, const T s);\n\n    template <typename S>\n    friend std::ostream& cv::operator<<(std::ostream&, const DualQuat<S>&);\n\n};\n\nusing DualQuatd = DualQuat<double>;\nusing DualQuatf = DualQuat<float>;\n\n//! @} core\n}//namespace\n\n#include \"dualquaternion.inl.hpp\"\n\n#endif /* OPENCV_CORE_QUATERNION_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/dualquaternion.inl.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2020, Huawei Technologies Co., Ltd. All rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//       http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// Author: Liangqian Kong <kongliangqian@huawei.com>\n//         Longbu Wang <wanglongbu@huawei.com>\n\n#ifndef OPENCV_CORE_DUALQUATERNION_INL_HPP\n#define OPENCV_CORE_DUALQUATERNION_INL_HPP\n\n#ifndef OPENCV_CORE_DUALQUATERNION_HPP\n#error This is not a standalone header. Include dualquaternion.hpp instead.\n#endif\n\n///////////////////////////////////////////////////////////////////////////////////////\n//Implementation\nnamespace cv {\n\ntemplate <typename T>\nDualQuat<T>::DualQuat():w(0), x(0), y(0), z(0), w_(0), x_(0), y_(0), z_(0){};\n\ntemplate <typename T>\nDualQuat<T>::DualQuat(const T vw, const T vx, const T vy, const T vz, const T _w, const T _x, const T _y, const T _z):\n                      w(vw), x(vx), y(vy), z(vz), w_(_w), x_(_x), y_(_y), z_(_z){};\n\ntemplate <typename T>\nDualQuat<T>::DualQuat(const Vec<T, 8> &q):w(q[0]), x(q[1]), y(q[2]), z(q[3]),\n                                          w_(q[4]), x_(q[5]), y_(q[6]), z_(q[7]){};\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::createFromQuat(const Quat<T> &realPart, const Quat<T> &dualPart)\n{\n    T w = realPart.w;\n    T x = realPart.x;\n    T y = realPart.y;\n    T z = realPart.z;\n    T w_ = dualPart.w;\n    T x_ = dualPart.x;\n    T y_ = dualPart.y;\n    T z_ = dualPart.z;\n    return DualQuat<T>(w, x, y, z, w_, x_, y_, z_);\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::createFromAngleAxisTrans(const T angle, const Vec<T, 3> &axis, const Vec<T, 3> &trans)\n{\n    Quat<T> r = Quat<T>::createFromAngleAxis(angle, axis);\n    Quat<T> t{0, trans[0], trans[1], trans[2]};\n    return createFromQuat(r, t * r / 2);\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::createFromMat(InputArray _R)\n{\n    CV_CheckTypeEQ(_R.type(), cv::traits::Type<T>::value, \"\");\n    if (_R.size() != Size(4, 4))\n    {\n        CV_Error(Error::StsBadArg, \"The input matrix must have 4 columns and 4 rows\");\n    }\n    Mat R = _R.getMat();\n    Quat<T> r = Quat<T>::createFromRotMat(R.colRange(0, 3).rowRange(0, 3));\n    Quat<T> trans(0, R.at<T>(0, 3), R.at<T>(1, 3), R.at<T>(2, 3));\n    return createFromQuat(r, trans * r / 2);\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::createFromAffine3(const Affine3<T> &R)\n{\n    return createFromMat(R.matrix);\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::createFromPitch(const T angle, const T d, const Vec<T, 3> &axis, const Vec<T, 3> &moment)\n{\n    T half_angle = angle / 2, half_d = d / 2;\n    Quat<T> qaxis = Quat<T>(0, axis[0], axis[1], axis[2]).normalize();\n    Quat<T> qmoment = Quat<T>(0, moment[0], moment[1], moment[2]);\n    qmoment -= qaxis * axis.dot(moment);\n    Quat<T> dual = -half_d * std::sin(half_angle) + std::sin(half_angle) * qmoment +\n        half_d * std::cos(half_angle) * qaxis;\n    return createFromQuat(Quat<T>::createFromAngleAxis(angle, axis), dual);\n}\n\ntemplate <typename T>\ninline bool DualQuat<T>::operator==(const DualQuat<T> &q) const\n{\n    return (abs(w - q.w) < CV_DUAL_QUAT_EPS && abs(x - q.x) < CV_DUAL_QUAT_EPS &&\n            abs(y - q.y) < CV_DUAL_QUAT_EPS && abs(z - q.z) < CV_DUAL_QUAT_EPS &&\n            abs(w_ - q.w_) < CV_DUAL_QUAT_EPS && abs(x_ - q.x_) < CV_DUAL_QUAT_EPS &&\n            abs(y_ - q.y_) < CV_DUAL_QUAT_EPS && abs(z_ - q.z_) < CV_DUAL_QUAT_EPS);\n}\n\ntemplate <typename T>\ninline Quat<T> DualQuat<T>::getRealPart() const\n{\n    return Quat<T>(w, x, y, z);\n}\n\ntemplate <typename T>\ninline Quat<T> DualQuat<T>::getDualPart() const\n{\n    return Quat<T>(w_, x_, y_, z_);\n}\n\ntemplate <typename T>\ninline DualQuat<T> conjugate(const DualQuat<T> &dq)\n{\n    return dq.conjugate();\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::conjugate() const\n{\n    return DualQuat<T>(w, -x, -y, -z, w_, -x_, -y_, -z_);\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::norm() const\n{\n    Quat<T> real = getRealPart();\n    T realNorm = real.norm();\n    Quat<T> dual = getDualPart();\n    if (realNorm < CV_DUAL_QUAT_EPS){\n        return DualQuat<T>(0, 0, 0, 0, 0, 0, 0, 0);\n    }\n    return DualQuat<T>(realNorm, 0, 0, 0, real.dot(dual) / realNorm, 0, 0, 0);\n}\n\ntemplate <typename T>\ninline Quat<T> DualQuat<T>::getRotation(QuatAssumeType assumeUnit) const\n{\n    if (assumeUnit)\n    {\n        return getRealPart();\n    }\n    return getRealPart().normalize();\n}\n\ntemplate <typename T>\ninline Vec<T, 3> DualQuat<T>::getTranslation(QuatAssumeType assumeUnit) const\n{\n    Quat<T> trans = 2.0 * (getDualPart() * getRealPart().inv(assumeUnit));\n    return Vec<T, 3>{trans[1], trans[2], trans[3]};\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::normalize() const\n{\n    Quat<T> p = getRealPart();\n    Quat<T> q = getDualPart();\n    T p_norm = p.norm();\n    if (p_norm < CV_DUAL_QUAT_EPS)\n    {\n        CV_Error(Error::StsBadArg, \"Cannot normalize this dual quaternion: the norm is too small.\");\n    }\n    Quat<T> p_nr = p / p_norm;\n    Quat<T> q_nr = q / p_norm;\n    return createFromQuat(p_nr, q_nr - p_nr * p_nr.dot(q_nr));\n}\n\ntemplate <typename T>\ninline T DualQuat<T>::dot(DualQuat<T> q) const\n{\n    return q.w * w + q.x * x + q.y * y + q.z * z + q.w_ * w_ + q.x_ * x_ + q.y_ * y_ + q.z_ * z_;\n}\n\ntemplate <typename T>\ninline DualQuat<T> inv(const DualQuat<T> &dq, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)\n{\n    return dq.inv(assumeUnit);\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::inv(QuatAssumeType assumeUnit) const\n{\n    Quat<T> real = getRealPart();\n    Quat<T> dual = getDualPart();\n    return createFromQuat(real.inv(assumeUnit), -real.inv(assumeUnit) * dual * real.inv(assumeUnit));\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::operator-(const DualQuat<T> &q) const\n{\n    return DualQuat<T>(w - q.w, x - q.x, y - q.y, z - q.z, w_ - q.w_, x_ - q.x_, y_ - q.y_, z_ - q.z_);\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::operator-() const\n{\n    return DualQuat<T>(-w, -x, -y, -z, -w_, -x_, -y_, -z_);\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::operator+(const DualQuat<T> &q) const\n{\n    return DualQuat<T>(w + q.w, x + q.x, y + q.y, z + q.z, w_ + q.w_, x_ + q.x_, y_ + q.y_, z_ + q.z_);\n}\n\ntemplate <typename T>\ninline DualQuat<T>& DualQuat<T>::operator+=(const DualQuat<T> &q)\n{\n    *this = *this + q;\n    return *this;\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::operator*(const DualQuat<T> &q) const\n{\n    Quat<T> A = getRealPart();\n    Quat<T> B = getDualPart();\n    Quat<T> C = q.getRealPart();\n    Quat<T> D = q.getDualPart();\n    return DualQuat<T>::createFromQuat(A * C, A * D + B * C);\n}\n\ntemplate <typename T>\ninline DualQuat<T>& DualQuat<T>::operator*=(const DualQuat<T> &q)\n{\n    *this = *this * q;\n    return *this;\n}\n\ntemplate <typename T>\ninline DualQuat<T> operator+(const T a, const DualQuat<T> &q)\n{\n    return DualQuat<T>(a + q.w, q.x, q.y, q.z, q.w_, q.x_, q.y_, q.z_);\n}\n\ntemplate <typename T>\ninline DualQuat<T> operator+(const DualQuat<T> &q, const T a)\n{\n    return DualQuat<T>(a + q.w, q.x, q.y, q.z, q.w_, q.x_, q.y_, q.z_);\n}\n\ntemplate <typename T>\ninline DualQuat<T> operator-(const DualQuat<T> &q, const T a)\n{\n    return DualQuat<T>(q.w - a, q.x, q.y, q.z, q.w_, q.x_, q.y_, q.z_);\n}\n\ntemplate <typename T>\ninline DualQuat<T>& DualQuat<T>::operator-=(const DualQuat<T> &q)\n{\n    *this = *this - q;\n    return *this;\n}\n\ntemplate <typename T>\ninline DualQuat<T> operator-(const T a, const DualQuat<T> &q)\n{\n    return DualQuat<T>(a - q.w, -q.x, -q.y, -q.z, -q.w_, -q.x_, -q.y_, -q.z_);\n}\n\ntemplate <typename T>\ninline DualQuat<T> operator*(const T a, const DualQuat<T> &q)\n{\n    return DualQuat<T>(q.w * a, q.x * a, q.y * a, q.z * a, q.w_ * a, q.x_ * a, q.y_ * a, q.z_ * a);\n}\n\ntemplate <typename T>\ninline DualQuat<T> operator*(const DualQuat<T> &q, const T a)\n{\n    return DualQuat<T>(q.w * a, q.x * a, q.y * a, q.z * a, q.w_ * a, q.x_ * a, q.y_ * a, q.z_ * a);\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::operator/(const T a) const\n{\n    return DualQuat<T>(w / a, x / a, y / a, z / a, w_ / a, x_ / a, y_ / a, z_ / a);\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::operator/(const DualQuat<T> &q) const\n{\n    return *this * q.inv();\n}\n\ntemplate <typename T>\ninline DualQuat<T>& DualQuat<T>::operator/=(const DualQuat<T> &q)\n{\n    *this = *this / q;\n    return *this;\n}\n\ntemplate <typename T>\nstd::ostream & operator<<(std::ostream &os, const DualQuat<T> &q)\n{\n    os << \"DualQuat \" << Vec<T, 8>{q.w, q.x, q.y, q.z, q.w_, q.x_, q.y_, q.z_};\n    return os;\n}\n\ntemplate <typename T>\ninline DualQuat<T> exp(const DualQuat<T> &dq)\n{\n    return dq.exp();\n}\n\nnamespace detail {\n\ntemplate <typename _Tp>\nMatx<_Tp, 4, 4> jacob_exp(const Quat<_Tp> &q)\n{\n    _Tp nv = std::sqrt(q.x * q.x + q.y * q.y + q.z * q.z);\n    _Tp sinc_nv = abs(nv) < cv::DualQuat<_Tp>::CV_DUAL_QUAT_EPS ? 1 - nv * nv / 6 : std::sin(nv) / nv;\n    _Tp csiii_nv = abs(nv) < cv::DualQuat<_Tp>::CV_DUAL_QUAT_EPS ? -(_Tp)1.0 / 3 : (std::cos(nv) - sinc_nv) / nv / nv;\n    Matx<_Tp, 4, 4> J_exp_quat {\n        std::cos(nv), -sinc_nv * q.x,  -sinc_nv * q.y,  -sinc_nv * q.z,\n        sinc_nv * q.x, csiii_nv * q.x * q.x + sinc_nv, csiii_nv * q.x * q.y, csiii_nv * q.x * q.z,\n        sinc_nv * q.y, csiii_nv * q.y * q.x, csiii_nv * q.y * q.y + sinc_nv, csiii_nv * q.y * q.z,\n        sinc_nv * q.z, csiii_nv * q.z * q.x, csiii_nv * q.z * q.y, csiii_nv * q.z * q.z + sinc_nv\n    };\n    return std::exp(q.w) * J_exp_quat;\n}\n\n} // namespace detail\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::exp() const\n{\n    Quat<T> real = getRealPart();\n    return createFromQuat(real.exp(), Quat<T>(detail::jacob_exp(real) * getDualPart().toVec()));\n}\n\ntemplate <typename T>\nDualQuat<T> log(const DualQuat<T> &dq, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)\n{\n    return dq.log(assumeUnit);\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::log(QuatAssumeType assumeUnit) const\n{\n    Quat<T> plog = getRealPart().log(assumeUnit);\n    Matx<T, 4, 4> jacob = detail::jacob_exp(plog);\n    return createFromQuat(plog, Quat<T>(jacob.inv() * getDualPart().toVec()));\n}\n\ntemplate <typename T>\ninline DualQuat<T> power(const DualQuat<T> &dq, const T t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)\n{\n    return dq.power(t, assumeUnit);\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::power(const T t, QuatAssumeType assumeUnit) const\n{\n    return (t * log(assumeUnit)).exp();\n}\n\ntemplate <typename T>\ninline DualQuat<T> power(const DualQuat<T> &p, const DualQuat<T> &q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)\n{\n    return p.power(q, assumeUnit);\n}\n\ntemplate <typename T>\ninline DualQuat<T> DualQuat<T>::power(const DualQuat<T> &q, QuatAssumeType assumeUnit) const\n{\n    return (q * log(assumeUnit)).exp();\n}\n\ntemplate <typename T>\ninline Vec<T, 8> DualQuat<T>::toVec() const\n{\n   return Vec<T, 8>(w, x, y, z, w_, x_, y_, z_);\n}\n\ntemplate <typename T>\nAffine3<T> DualQuat<T>::toAffine3(QuatAssumeType assumeUnit) const\n{\n    return Affine3<T>(toMat(assumeUnit));\n}\n\ntemplate <typename T>\nMatx<T, 4, 4> DualQuat<T>::toMat(QuatAssumeType assumeUnit) const\n{\n    Matx<T, 4, 4> rot44 = getRotation(assumeUnit).toRotMat4x4();\n    Vec<T, 3> translation = getTranslation(assumeUnit);\n    rot44(0, 3) = translation[0];\n    rot44(1, 3) = translation[1];\n    rot44(2, 3) = translation[2];\n    return rot44;\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::sclerp(const DualQuat<T> &q0, const DualQuat<T> &q1, const T t, bool directChange, QuatAssumeType assumeUnit)\n{\n    DualQuat<T> v0(q0), v1(q1);\n    if (!assumeUnit)\n    {\n        v0 = v0.normalize();\n        v1 = v1.normalize();\n    }\n    Quat<T> v0Real = v0.getRealPart();\n    Quat<T> v1Real = v1.getRealPart();\n    if (directChange && v1Real.dot(v0Real) < 0)\n    {\n        v0 = -v0;\n    }\n    DualQuat<T> v0inv1 = v0.inv() * v1;\n    return v0 * v0inv1.power(t, QUAT_ASSUME_UNIT);\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::dqblend(const DualQuat<T> &q1, const DualQuat<T> &q2, const T t, QuatAssumeType assumeUnit)\n{\n    DualQuat<T> v1(q1), v2(q2);\n    if (!assumeUnit)\n    {\n        v1 = v1.normalize();\n        v2 = v2.normalize();\n    }\n    if (v1.getRotation(assumeUnit).dot(v2.getRotation(assumeUnit)) < 0)\n    {\n        return ((1 - t) * v1 - t * v2).normalize();\n    }\n    return ((1 - t) * v1 + t * v2).normalize();\n}\n\ntemplate <typename T>\nDualQuat<T> DualQuat<T>::gdqblend(InputArray _dualquat, InputArray _weight, QuatAssumeType assumeUnit)\n{\n    CV_CheckTypeEQ(_weight.type(), cv::traits::Type<T>::value, \"\");\n    CV_CheckTypeEQ(_dualquat.type(), CV_MAKETYPE(CV_MAT_DEPTH(cv::traits::Type<T>::value), 8), \"\");\n    Size dq_s = _dualquat.size();\n    if (dq_s != _weight.size() || (dq_s.height != 1 && dq_s.width != 1))\n    {\n        CV_Error(Error::StsBadArg, \"The size of weight must be the same as dualquat, both of them should be (1, n) or (n, 1)\");\n    }\n    Mat dualquat = _dualquat.getMat(), weight = _weight.getMat();\n    const int cn = std::max(dq_s.width, dq_s.height);\n    if (!assumeUnit)\n    {\n        for (int i = 0; i < cn; ++i)\n        {\n            dualquat.at<Vec<T, 8>>(i) = DualQuat<T>{dualquat.at<Vec<T, 8>>(i)}.normalize().toVec();\n        }\n    }\n    Vec<T, 8> dq_blend = dualquat.at<Vec<T, 8>>(0) * weight.at<T>(0);\n    Quat<T> q0 = DualQuat<T> {dualquat.at<Vec<T, 8>>(0)}.getRotation(assumeUnit);\n    for (int i = 1; i < cn; ++i)\n    {\n        T k = q0.dot(DualQuat<T>{dualquat.at<Vec<T, 8>>(i)}.getRotation(assumeUnit)) < 0 ? -1: 1;\n        dq_blend = dq_blend + dualquat.at<Vec<T, 8>>(i) * k * weight.at<T>(i);\n    }\n    return DualQuat<T>{dq_blend}.normalize();\n}\n\ntemplate <typename T>\ntemplate <int cn>\nDualQuat<T> DualQuat<T>::gdqblend(const Vec<DualQuat<T>, cn> &_dualquat, InputArray _weight, QuatAssumeType assumeUnit)\n{\n    Vec<DualQuat<T>, cn> dualquat(_dualquat);\n    if (cn == 0)\n    {\n        return DualQuat<T>(1, 0, 0, 0, 0, 0, 0, 0);\n    }\n    Mat dualquat_mat(cn, 1, CV_64FC(8));\n    for (int i = 0; i < cn ; ++i)\n    {\n        dualquat_mat.at<Vec<T, 8>>(i) = dualquat[i].toVec();\n    }\n    return gdqblend(dualquat_mat, _weight, assumeUnit);\n}\n\n} //namespace cv\n\n#endif /*OPENCV_CORE_DUALQUATERNION_INL_HPP*/\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/eigen.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n\n#ifndef OPENCV_CORE_EIGEN_HPP\n#define OPENCV_CORE_EIGEN_HPP\n\n#ifndef EIGEN_WORLD_VERSION\n#error \"Wrong usage of OpenCV's Eigen utility header. Include Eigen's headers first. See https://github.com/opencv/opencv/issues/17366\"\n#endif\n\n#include \"opencv2/core.hpp\"\n\n#if defined _MSC_VER && _MSC_VER >= 1200\n#define NOMINMAX // fix https://github.com/opencv/opencv/issues/17548\n#pragma warning( disable: 4714 ) //__forceinline is not inlined\n#pragma warning( disable: 4127 ) //conditional expression is constant\n#pragma warning( disable: 4244 ) //conversion from '__int64' to 'int', possible loss of data\n#endif\n\n#if !defined(OPENCV_DISABLE_EIGEN_TENSOR_SUPPORT)\n#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 \\\n    && defined(CV_CXX11) && defined(CV_CXX_STD_ARRAY)\n#include <unsupported/Eigen/CXX11/Tensor>\n#define OPENCV_EIGEN_TENSOR_SUPPORT 1\n#endif  // EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3\n#endif  // !defined(OPENCV_DISABLE_EIGEN_TENSOR_SUPPORT)\n\nnamespace cv\n{\n\n/** @addtogroup core_eigen\nThese functions are provided for OpenCV-Eigen interoperability. They convert `Mat`\nobjects to corresponding `Eigen::Matrix` objects and vice-versa. Consult the [Eigen\ndocumentation](https://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html) for\ninformation about the `Matrix` template type.\n\n@note Using these functions requires the `Eigen/Dense` or similar header to be\nincluded before this header.\n*/\n//! @{\n\n#if defined(OPENCV_EIGEN_TENSOR_SUPPORT) || defined(CV_DOXYGEN)\n/** @brief Converts an Eigen::Tensor to a cv::Mat.\n\nThe method converts an Eigen::Tensor with shape (H x W x C) to a cv::Mat where:\n H = number of rows\n W = number of columns\n C = number of channels\n\nUsage:\n\\code\nEigen::Tensor<float, 3, Eigen::RowMajor> a_tensor(...);\n// populate tensor with values\nMat a_mat;\neigen2cv(a_tensor, a_mat);\n\\endcode\n*/\ntemplate <typename _Tp, int _layout> static inline\nvoid eigen2cv( const Eigen::Tensor<_Tp, 3, _layout> &src, OutputArray dst )\n{\n    if( !(_layout & Eigen::RowMajorBit) )\n    {\n        const std::array<int, 3> shuffle{2, 1, 0};\n        Eigen::Tensor<_Tp, 3, !_layout> row_major_tensor = src.swap_layout().shuffle(shuffle);\n        Mat _src(src.dimension(0), src.dimension(1), CV_MAKETYPE(DataType<_Tp>::type, src.dimension(2)), row_major_tensor.data());\n        _src.copyTo(dst);\n    }\n    else\n    {\n        Mat _src(src.dimension(0), src.dimension(1), CV_MAKETYPE(DataType<_Tp>::type, src.dimension(2)), (void *)src.data());\n        _src.copyTo(dst);\n    }\n}\n\n/** @brief Converts a cv::Mat to an Eigen::Tensor.\n\nThe method converts a cv::Mat to an Eigen Tensor with shape (H x W x C) where:\n H = number of rows\n W = number of columns\n C = number of channels\n\nUsage:\n\\code\nMat a_mat(...);\n// populate Mat with values\nEigen::Tensor<float, 3, Eigen::RowMajor> a_tensor(...);\ncv2eigen(a_mat, a_tensor);\n\\endcode\n*/\ntemplate <typename _Tp, int _layout> static inline\nvoid cv2eigen( const Mat &src, Eigen::Tensor<_Tp, 3, _layout> &dst )\n{\n    if( !(_layout & Eigen::RowMajorBit) )\n    {\n        Eigen::Tensor<_Tp, 3, !_layout> row_major_tensor(src.rows, src.cols, src.channels());\n        Mat _dst(src.rows, src.cols, CV_MAKETYPE(DataType<_Tp>::type, src.channels()), row_major_tensor.data());\n        if (src.type() == _dst.type())\n            src.copyTo(_dst);\n        else\n            src.convertTo(_dst, _dst.type());\n        const std::array<int, 3> shuffle{2, 1, 0};\n        dst = row_major_tensor.swap_layout().shuffle(shuffle);\n    }\n    else\n    {\n        dst.resize(src.rows, src.cols, src.channels());\n        Mat _dst(src.rows, src.cols, CV_MAKETYPE(DataType<_Tp>::type, src.channels()), dst.data());\n        if (src.type() == _dst.type())\n            src.copyTo(_dst);\n        else\n            src.convertTo(_dst, _dst.type());\n    }\n}\n\n/** @brief Maps cv::Mat data to an Eigen::TensorMap.\n\nThe method wraps an existing Mat data array with an Eigen TensorMap of shape (H x W x C) where:\n H = number of rows\n W = number of columns\n C = number of channels\n\nExplicit instantiation of the return type is required.\n\n@note Caller should be aware of the lifetime of the cv::Mat instance and take appropriate safety measures.\nThe cv::Mat instance will retain ownership of the data and the Eigen::TensorMap will lose access when the cv::Mat data is deallocated.\n\nThe example below initializes a cv::Mat and produces an Eigen::TensorMap:\n\\code\nfloat arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};\nMat a_mat(2, 2, CV_32FC3, arr);\nEigen::TensorMap<Eigen::Tensor<float, 3, Eigen::RowMajor>> a_tensormap = cv2eigen_tensormap<float>(a_mat);\n\\endcode\n*/\ntemplate <typename _Tp> static inline\nEigen::TensorMap<Eigen::Tensor<_Tp, 3, Eigen::RowMajor>> cv2eigen_tensormap(InputArray src)\n{\n    Mat mat = src.getMat();\n    CV_CheckTypeEQ(mat.type(), CV_MAKETYPE(traits::Type<_Tp>::value, mat.channels()), \"\");\n    return Eigen::TensorMap<Eigen::Tensor<_Tp, 3, Eigen::RowMajor>>((_Tp *)mat.data, mat.rows, mat.cols, mat.channels());\n}\n#endif // OPENCV_EIGEN_TENSOR_SUPPORT\n\ntemplate<typename _Tp, int _rows, int _cols, int _options, int _maxRows, int _maxCols> static inline\nvoid eigen2cv( const Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& src, OutputArray dst )\n{\n    if( !(src.Flags & Eigen::RowMajorBit) )\n    {\n        Mat _src(src.cols(), src.rows(), traits::Type<_Tp>::value,\n              (void*)src.data(), src.outerStride()*sizeof(_Tp));\n        transpose(_src, dst);\n    }\n    else\n    {\n        Mat _src(src.rows(), src.cols(), traits::Type<_Tp>::value,\n                 (void*)src.data(), src.outerStride()*sizeof(_Tp));\n        _src.copyTo(dst);\n    }\n}\n\n// Matx case\ntemplate<typename _Tp, int _rows, int _cols, int _options, int _maxRows, int _maxCols> static inline\nvoid eigen2cv( const Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& src,\n               Matx<_Tp, _rows, _cols>& dst )\n{\n    if( !(src.Flags & Eigen::RowMajorBit) )\n    {\n        dst = Matx<_Tp, _cols, _rows>(static_cast<const _Tp*>(src.data())).t();\n    }\n    else\n    {\n        dst = Matx<_Tp, _rows, _cols>(static_cast<const _Tp*>(src.data()));\n    }\n}\n\ntemplate<typename _Tp, int _rows, int _cols, int _options, int _maxRows, int _maxCols> static inline\nvoid cv2eigen( const Mat& src,\n               Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& dst )\n{\n    CV_DbgAssert(src.rows == _rows && src.cols == _cols);\n    if( !(dst.Flags & Eigen::RowMajorBit) )\n    {\n        const Mat _dst(src.cols, src.rows, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        if( src.type() == _dst.type() )\n            transpose(src, _dst);\n        else if( src.cols == src.rows )\n        {\n            src.convertTo(_dst, _dst.type());\n            transpose(_dst, _dst);\n        }\n        else\n            Mat(src.t()).convertTo(_dst, _dst.type());\n    }\n    else\n    {\n        const Mat _dst(src.rows, src.cols, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        src.convertTo(_dst, _dst.type());\n    }\n}\n\n// Matx case\ntemplate<typename _Tp, int _rows, int _cols, int _options, int _maxRows, int _maxCols> static inline\nvoid cv2eigen( const Matx<_Tp, _rows, _cols>& src,\n               Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& dst )\n{\n    if( !(dst.Flags & Eigen::RowMajorBit) )\n    {\n        const Mat _dst(_cols, _rows, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        transpose(src, _dst);\n    }\n    else\n    {\n        const Mat _dst(_rows, _cols, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        Mat(src).copyTo(_dst);\n    }\n}\n\ntemplate<typename _Tp>  static inline\nvoid cv2eigen( const Mat& src,\n               Eigen::Matrix<_Tp, Eigen::Dynamic, Eigen::Dynamic>& dst )\n{\n    dst.resize(src.rows, src.cols);\n    if( !(dst.Flags & Eigen::RowMajorBit) )\n    {\n        const Mat _dst(src.cols, src.rows, traits::Type<_Tp>::value,\n             dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        if( src.type() == _dst.type() )\n            transpose(src, _dst);\n        else if( src.cols == src.rows )\n        {\n            src.convertTo(_dst, _dst.type());\n            transpose(_dst, _dst);\n        }\n        else\n            Mat(src.t()).convertTo(_dst, _dst.type());\n    }\n    else\n    {\n        const Mat _dst(src.rows, src.cols, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        src.convertTo(_dst, _dst.type());\n    }\n}\n\n// Matx case\ntemplate<typename _Tp, int _rows, int _cols> static inline\nvoid cv2eigen( const Matx<_Tp, _rows, _cols>& src,\n               Eigen::Matrix<_Tp, Eigen::Dynamic, Eigen::Dynamic>& dst )\n{\n    dst.resize(_rows, _cols);\n    if( !(dst.Flags & Eigen::RowMajorBit) )\n    {\n        const Mat _dst(_cols, _rows, traits::Type<_Tp>::value,\n             dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        transpose(src, _dst);\n    }\n    else\n    {\n        const Mat _dst(_rows, _cols, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        Mat(src).copyTo(_dst);\n    }\n}\n\ntemplate<typename _Tp> static inline\nvoid cv2eigen( const Mat& src,\n               Eigen::Matrix<_Tp, Eigen::Dynamic, 1>& dst )\n{\n    CV_Assert(src.cols == 1);\n    dst.resize(src.rows);\n\n    if( !(dst.Flags & Eigen::RowMajorBit) )\n    {\n        const Mat _dst(src.cols, src.rows, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        if( src.type() == _dst.type() )\n            transpose(src, _dst);\n        else\n            Mat(src.t()).convertTo(_dst, _dst.type());\n    }\n    else\n    {\n        const Mat _dst(src.rows, src.cols, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        src.convertTo(_dst, _dst.type());\n    }\n}\n\n// Matx case\ntemplate<typename _Tp, int _rows> static inline\nvoid cv2eigen( const Matx<_Tp, _rows, 1>& src,\n               Eigen::Matrix<_Tp, Eigen::Dynamic, 1>& dst )\n{\n    dst.resize(_rows);\n\n    if( !(dst.Flags & Eigen::RowMajorBit) )\n    {\n        const Mat _dst(1, _rows, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        transpose(src, _dst);\n    }\n    else\n    {\n        const Mat _dst(_rows, 1, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        src.copyTo(_dst);\n    }\n}\n\n\ntemplate<typename _Tp> static inline\nvoid cv2eigen( const Mat& src,\n               Eigen::Matrix<_Tp, 1, Eigen::Dynamic>& dst )\n{\n    CV_Assert(src.rows == 1);\n    dst.resize(src.cols);\n    if( !(dst.Flags & Eigen::RowMajorBit) )\n    {\n        const Mat _dst(src.cols, src.rows, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        if( src.type() == _dst.type() )\n            transpose(src, _dst);\n        else\n            Mat(src.t()).convertTo(_dst, _dst.type());\n    }\n    else\n    {\n        const Mat _dst(src.rows, src.cols, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        src.convertTo(_dst, _dst.type());\n    }\n}\n\n//Matx\ntemplate<typename _Tp, int _cols> static inline\nvoid cv2eigen( const Matx<_Tp, 1, _cols>& src,\n               Eigen::Matrix<_Tp, 1, Eigen::Dynamic>& dst )\n{\n    dst.resize(_cols);\n    if( !(dst.Flags & Eigen::RowMajorBit) )\n    {\n        const Mat _dst(_cols, 1, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        transpose(src, _dst);\n    }\n    else\n    {\n        const Mat _dst(1, _cols, traits::Type<_Tp>::value,\n                 dst.data(), (size_t)(dst.outerStride()*sizeof(_Tp)));\n        Mat(src).copyTo(_dst);\n    }\n}\n\n//! @}\n\n} // cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/fast_math.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_FAST_MATH_HPP\n#define OPENCV_CORE_FAST_MATH_HPP\n\n#include \"opencv2/core/cvdef.h\"\n\n//! @addtogroup core_utils\n//! @{\n\n/****************************************************************************************\\\n*                                      fast math                                         *\n\\****************************************************************************************/\n\n#ifdef __cplusplus\n#  include <cmath>\n#else\n#  ifdef __BORLANDC__\n#    include <fastmath.h>\n#  else\n#    include <math.h>\n#  endif\n#endif\n\n#if defined(__CUDACC__)\n  // nothing, intrinsics/asm code is not supported\n#else\n  #if ((defined _MSC_VER && defined _M_X64) \\\n      || (defined __GNUC__ && defined __x86_64__ && defined __SSE2__)) \\\n      && !defined(OPENCV_SKIP_INCLUDE_EMMINTRIN_H)\n    #include <emmintrin.h>\n  #endif\n\n  #if defined __PPC64__ && defined __GNUC__ && defined _ARCH_PWR8 \\\n      && !defined(OPENCV_SKIP_INCLUDE_ALTIVEC_H)\n    #include <altivec.h>\n    #undef vector\n    #undef bool\n    #undef pixel\n  #endif\n\n  #if defined(CV_INLINE_ROUND_FLT)\n    // user-specified version\n    // CV_INLINE_ROUND_DBL should be defined too\n  #elif defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__\n    // 1. general scheme\n    #define ARM_ROUND(_value, _asm_string) \\\n        int res; \\\n        float temp; \\\n        CV_UNUSED(temp); \\\n        __asm__(_asm_string : [res] \"=r\" (res), [temp] \"=w\" (temp) : [value] \"w\" (_value)); \\\n        return res\n    // 2. version for double\n    #ifdef __clang__\n        #define CV_INLINE_ROUND_DBL(value) ARM_ROUND(value, \"vcvtr.s32.f64 %[temp], %[value] \\n vmov %[res], %[temp]\")\n    #else\n        #define CV_INLINE_ROUND_DBL(value) ARM_ROUND(value, \"vcvtr.s32.f64 %[temp], %P[value] \\n vmov %[res], %[temp]\")\n    #endif\n    // 3. version for float\n    #define CV_INLINE_ROUND_FLT(value) ARM_ROUND(value, \"vcvtr.s32.f32 %[temp], %[value]\\n vmov %[res], %[temp]\")\n  #elif defined __PPC64__ && defined __GNUC__ && defined _ARCH_PWR8\n    // P8 and newer machines can convert fp32/64 to int quickly.\n    #define CV_INLINE_ROUND_DBL(value) \\\n        int out; \\\n        double temp; \\\n        __asm__( \"fctiw %[temp],%[in]\\n\\tmfvsrwz %[out],%[temp]\\n\\t\" : [out] \"=r\" (out), [temp] \"=d\" (temp) : [in] \"d\" ((double)(value)) : ); \\\n        return out;\n\n    // FP32 also works with FP64 routine above\n    #define CV_INLINE_ROUND_FLT(value) CV_INLINE_ROUND_DBL(value)\n  #endif\n\n  #ifdef CV_INLINE_ISINF_FLT\n    // user-specified version\n    // CV_INLINE_ISINF_DBL should be defined too\n  #elif defined __PPC64__ && defined _ARCH_PWR9 && defined(scalar_test_data_class)\n    #define CV_INLINE_ISINF_DBL(value) return scalar_test_data_class(value, 0x30);\n    #define CV_INLINE_ISINF_FLT(value) CV_INLINE_ISINF_DBL(value)\n  #endif\n\n  #ifdef CV_INLINE_ISNAN_FLT\n    // user-specified version\n    // CV_INLINE_ISNAN_DBL should be defined too\n  #elif defined __PPC64__ && defined _ARCH_PWR9 && defined(scalar_test_data_class)\n    #define CV_INLINE_ISNAN_DBL(value) return scalar_test_data_class(value, 0x40);\n    #define CV_INLINE_ISNAN_FLT(value) CV_INLINE_ISNAN_DBL(value)\n  #endif\n\n  #if !defined(OPENCV_USE_FASTMATH_BUILTINS) \\\n    && ( \\\n        defined(__x86_64__) || defined(__i686__) \\\n        || defined(__arm__) \\\n        || defined(__PPC64__) \\\n    )\n    /* Let builtin C math functions when available. Dedicated hardware is available to\n       round and convert FP values. */\n    #define OPENCV_USE_FASTMATH_BUILTINS 1\n  #endif\n\n  /* Enable builtin math functions if possible, desired, and available.\n     Note, not all math functions inline equally. E.g lrint will not inline\n     without the -fno-math-errno option. */\n  #if defined(CV_ICC)\n    // nothing\n  #elif defined(OPENCV_USE_FASTMATH_BUILTINS) && OPENCV_USE_FASTMATH_BUILTINS\n    #if defined(__clang__)\n      #define CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS\n      #if !defined(CV_INLINE_ISNAN_DBL) && __has_builtin(__builtin_isnan)\n        #define CV_INLINE_ISNAN_DBL(value) return __builtin_isnan(value);\n      #endif\n      #if !defined(CV_INLINE_ISNAN_FLT) && __has_builtin(__builtin_isnan)\n        #define CV_INLINE_ISNAN_FLT(value) return __builtin_isnan(value);\n      #endif\n      #if !defined(CV_INLINE_ISINF_DBL) && __has_builtin(__builtin_isinf)\n        #define CV_INLINE_ISINF_DBL(value) return __builtin_isinf(value);\n      #endif\n      #if !defined(CV_INLINE_ISINF_FLT) && __has_builtin(__builtin_isinf)\n        #define CV_INLINE_ISINF_FLT(value) return __builtin_isinf(value);\n      #endif\n    #elif defined(__GNUC__)\n      #define CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS\n      #if !defined(CV_INLINE_ISNAN_DBL)\n        #define CV_INLINE_ISNAN_DBL(value) return __builtin_isnan(value);\n      #endif\n      #if !defined(CV_INLINE_ISNAN_FLT)\n        #define CV_INLINE_ISNAN_FLT(value) return __builtin_isnanf(value);\n      #endif\n      #if !defined(CV_INLINE_ISINF_DBL)\n        #define CV_INLINE_ISINF_DBL(value) return __builtin_isinf(value);\n      #endif\n      #if !defined(CV_INLINE_ISINF_FLT)\n        #define CV_INLINE_ISINF_FLT(value) return __builtin_isinff(value);\n      #endif\n    #elif defined(_MSC_VER)\n      #if !defined(CV_INLINE_ISNAN_DBL)\n        #define CV_INLINE_ISNAN_DBL(value) return isnan(value);\n      #endif\n      #if !defined(CV_INLINE_ISNAN_FLT)\n        #define CV_INLINE_ISNAN_FLT(value) return isnan(value);\n      #endif\n      #if !defined(CV_INLINE_ISINF_DBL)\n        #define CV_INLINE_ISINF_DBL(value) return isinf(value);\n      #endif\n      #if !defined(CV_INLINE_ISINF_FLT)\n        #define CV_INLINE_ISINF_FLT(value) return isinf(value);\n      #endif\n    #endif\n  #endif\n\n#endif // defined(__CUDACC__)\n\n/** @brief Rounds floating-point number to the nearest integer\n\n @param value floating-point number. If the value is outside of INT_MIN ... INT_MAX range, the\n result is not defined.\n */\nCV_INLINE int\ncvRound( double value )\n{\n#if defined CV_INLINE_ROUND_DBL\n    CV_INLINE_ROUND_DBL(value);\n#elif ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \\\n    && defined __SSE2__ && !defined __APPLE__) || CV_SSE2) \\\n    && !defined(__CUDACC__)\n    __m128d t = _mm_set_sd( value );\n    return _mm_cvtsd_si32(t);\n#elif defined _MSC_VER && defined _M_IX86\n    int t;\n    __asm\n    {\n        fld value;\n        fistp t;\n    }\n    return t;\n#elif defined CV_ICC || defined __GNUC__\n    return (int)(lrint(value));\n#else\n    /* it's ok if round does not comply with IEEE754 standard;\n       the tests should allow +/-1 difference when the tested functions use round */\n    return (int)(value + (value >= 0 ? 0.5 : -0.5));\n#endif\n}\n\n\n/** @brief Rounds floating-point number to the nearest integer not larger than the original.\n\n The function computes an integer i such that:\n \\f[i \\le \\texttt{value} < i+1\\f]\n @param value floating-point number. If the value is outside of INT_MIN ... INT_MAX range, the\n result is not defined.\n */\nCV_INLINE int cvFloor( double value )\n{\n#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \\\n    && ( \\\n        defined(__PPC64__) \\\n    )\n    return __builtin_floor(value);\n#else\n    int i = (int)value;\n    return i - (i > value);\n#endif\n}\n\n/** @brief Rounds floating-point number to the nearest integer not smaller than the original.\n\n The function computes an integer i such that:\n \\f[i \\le \\texttt{value} < i+1\\f]\n @param value floating-point number. If the value is outside of INT_MIN ... INT_MAX range, the\n result is not defined.\n */\nCV_INLINE int cvCeil( double value )\n{\n#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \\\n    && ( \\\n        defined(__PPC64__) \\\n    )\n    return __builtin_ceil(value);\n#else\n    int i = (int)value;\n    return i + (i < value);\n#endif\n}\n\n/** @brief Determines if the argument is Not A Number.\n\n @param value The input floating-point value\n\n The function returns 1 if the argument is Not A Number (as defined by IEEE754 standard), 0\n otherwise. */\nCV_INLINE int cvIsNaN( double value )\n{\n#if defined CV_INLINE_ISNAN_DBL\n    CV_INLINE_ISNAN_DBL(value);\n#else\n    Cv64suf ieee754;\n    ieee754.f = value;\n    return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) +\n           ((unsigned)ieee754.u != 0) > 0x7ff00000;\n#endif\n}\n\n/** @brief Determines if the argument is Infinity.\n\n @param value The input floating-point value\n\n The function returns 1 if the argument is a plus or minus infinity (as defined by IEEE754 standard)\n and 0 otherwise. */\nCV_INLINE int cvIsInf( double value )\n{\n#if defined CV_INLINE_ISINF_DBL\n    CV_INLINE_ISINF_DBL(value);\n#elif defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64) || defined(__PPC64__)\n    Cv64suf ieee754;\n    ieee754.f = value;\n    return (ieee754.u & 0x7fffffff00000000) ==\n                        0x7ff0000000000000;\n#else\n    Cv64suf ieee754;\n    ieee754.f = value;\n    return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 &&\n            (unsigned)ieee754.u == 0;\n#endif\n}\n\n#ifdef __cplusplus\n\n/** @overload */\nCV_INLINE int cvRound(float value)\n{\n#if defined CV_INLINE_ROUND_FLT\n    CV_INLINE_ROUND_FLT(value);\n#elif ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \\\n    && defined __SSE2__ && !defined __APPLE__) || CV_SSE2) \\\n    && !defined(__CUDACC__)\n    __m128 t = _mm_set_ss( value );\n    return _mm_cvtss_si32(t);\n#elif defined _MSC_VER && defined _M_IX86\n    int t;\n    __asm\n    {\n        fld value;\n        fistp t;\n    }\n    return t;\n#elif defined CV_ICC || defined __GNUC__\n    return (int)(lrintf(value));\n#else\n    /* it's ok if round does not comply with IEEE754 standard;\n     the tests should allow +/-1 difference when the tested functions use round */\n    return (int)(value + (value >= 0 ? 0.5f : -0.5f));\n#endif\n}\n\n/** @overload */\nCV_INLINE int cvRound( int value )\n{\n    return value;\n}\n\n/** @overload */\nCV_INLINE int cvFloor( float value )\n{\n#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \\\n    && ( \\\n        defined(__PPC64__) \\\n    )\n    return __builtin_floorf(value);\n#else\n    int i = (int)value;\n    return i - (i > value);\n#endif\n}\n\n/** @overload */\nCV_INLINE int cvFloor( int value )\n{\n    return value;\n}\n\n/** @overload */\nCV_INLINE int cvCeil( float value )\n{\n#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \\\n    && ( \\\n        defined(__PPC64__) \\\n    )\n    return __builtin_ceilf(value);\n#else\n    int i = (int)value;\n    return i + (i < value);\n#endif\n}\n\n/** @overload */\nCV_INLINE int cvCeil( int value )\n{\n    return value;\n}\n\n/** @overload */\nCV_INLINE int cvIsNaN( float value )\n{\n#if defined CV_INLINE_ISNAN_FLT\n    CV_INLINE_ISNAN_FLT(value);\n#else\n    Cv32suf ieee754;\n    ieee754.f = value;\n    return (ieee754.u & 0x7fffffff) > 0x7f800000;\n#endif\n}\n\n/** @overload */\nCV_INLINE int cvIsInf( float value )\n{\n#if defined CV_INLINE_ISINF_FLT\n    CV_INLINE_ISINF_FLT(value);\n#else\n    Cv32suf ieee754;\n    ieee754.f = value;\n    return (ieee754.u & 0x7fffffff) == 0x7f800000;\n#endif\n}\n\n#endif // __cplusplus\n\n//! @} core_utils\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/hal.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_HAL_HPP\n#define OPENCV_HAL_HPP\n\n#include \"opencv2/core/cvdef.h\"\n#include \"opencv2/core/cvstd.hpp\"\n#include \"opencv2/core/hal/interface.h\"\n\nnamespace cv { namespace hal {\n\n//! @addtogroup core_hal_functions\n//! @{\n\nCV_EXPORTS int normHamming(const uchar* a, int n);\nCV_EXPORTS int normHamming(const uchar* a, const uchar* b, int n);\n\nCV_EXPORTS int normHamming(const uchar* a, int n, int cellSize);\nCV_EXPORTS int normHamming(const uchar* a, const uchar* b, int n, int cellSize);\n\nCV_EXPORTS int LU32f(float* A, size_t astep, int m, float* b, size_t bstep, int n);\nCV_EXPORTS int LU64f(double* A, size_t astep, int m, double* b, size_t bstep, int n);\nCV_EXPORTS bool Cholesky32f(float* A, size_t astep, int m, float* b, size_t bstep, int n);\nCV_EXPORTS bool Cholesky64f(double* A, size_t astep, int m, double* b, size_t bstep, int n);\nCV_EXPORTS void SVD32f(float* At, size_t astep, float* W, float* U, size_t ustep, float* Vt, size_t vstep, int m, int n, int flags);\nCV_EXPORTS void SVD64f(double* At, size_t astep, double* W, double* U, size_t ustep, double* Vt, size_t vstep, int m, int n, int flags);\nCV_EXPORTS int QR32f(float* A, size_t astep, int m, int n, int k, float* b, size_t bstep, float* hFactors);\nCV_EXPORTS int QR64f(double* A, size_t astep, int m, int n, int k, double* b, size_t bstep, double* hFactors);\n\nCV_EXPORTS void gemm32f(const float* src1, size_t src1_step, const float* src2, size_t src2_step,\n                        float alpha, const float* src3, size_t src3_step, float beta, float* dst, size_t dst_step,\n                        int m_a, int n_a, int n_d, int flags);\nCV_EXPORTS void gemm64f(const double* src1, size_t src1_step, const double* src2, size_t src2_step,\n                        double alpha, const double* src3, size_t src3_step, double beta, double* dst, size_t dst_step,\n                        int m_a, int n_a, int n_d, int flags);\nCV_EXPORTS void gemm32fc(const float* src1, size_t src1_step, const float* src2, size_t src2_step,\n                        float alpha, const float* src3, size_t src3_step, float beta, float* dst, size_t dst_step,\n                        int m_a, int n_a, int n_d, int flags);\nCV_EXPORTS void gemm64fc(const double* src1, size_t src1_step, const double* src2, size_t src2_step,\n                        double alpha, const double* src3, size_t src3_step, double beta, double* dst, size_t dst_step,\n                        int m_a, int n_a, int n_d, int flags);\n\nCV_EXPORTS int normL1_(const uchar* a, const uchar* b, int n);\nCV_EXPORTS float normL1_(const float* a, const float* b, int n);\nCV_EXPORTS float normL2Sqr_(const float* a, const float* b, int n);\n\nCV_EXPORTS void exp32f(const float* src, float* dst, int n);\nCV_EXPORTS void exp64f(const double* src, double* dst, int n);\nCV_EXPORTS void log32f(const float* src, float* dst, int n);\nCV_EXPORTS void log64f(const double* src, double* dst, int n);\n\nCV_EXPORTS void fastAtan32f(const float* y, const float* x, float* dst, int n, bool angleInDegrees);\nCV_EXPORTS void fastAtan64f(const double* y, const double* x, double* dst, int n, bool angleInDegrees);\nCV_EXPORTS void magnitude32f(const float* x, const float* y, float* dst, int n);\nCV_EXPORTS void magnitude64f(const double* x, const double* y, double* dst, int n);\nCV_EXPORTS void sqrt32f(const float* src, float* dst, int len);\nCV_EXPORTS void sqrt64f(const double* src, double* dst, int len);\nCV_EXPORTS void invSqrt32f(const float* src, float* dst, int len);\nCV_EXPORTS void invSqrt64f(const double* src, double* dst, int len);\n\nCV_EXPORTS void split8u(const uchar* src, uchar** dst, int len, int cn );\nCV_EXPORTS void split16u(const ushort* src, ushort** dst, int len, int cn );\nCV_EXPORTS void split32s(const int* src, int** dst, int len, int cn );\nCV_EXPORTS void split64s(const int64* src, int64** dst, int len, int cn );\n\nCV_EXPORTS void merge8u(const uchar** src, uchar* dst, int len, int cn );\nCV_EXPORTS void merge16u(const ushort** src, ushort* dst, int len, int cn );\nCV_EXPORTS void merge32s(const int** src, int* dst, int len, int cn );\nCV_EXPORTS void merge64s(const int64** src, int64* dst, int len, int cn );\n\nCV_EXPORTS void add8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void add8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void add16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void add16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void add32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void add32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void add64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* );\n\nCV_EXPORTS void sub8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void sub8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void sub16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void sub16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void sub32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void sub32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void sub64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* );\n\nCV_EXPORTS void max8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void max8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void max16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void max16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void max32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void max32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void max64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* );\n\nCV_EXPORTS void min8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void min8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void min16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void min16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void min32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void min32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void min64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* );\n\nCV_EXPORTS void absdiff8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void absdiff8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void absdiff16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void absdiff16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void absdiff32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void absdiff32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void absdiff64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* );\n\nCV_EXPORTS void and8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void or8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void xor8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* );\nCV_EXPORTS void not8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* );\n\nCV_EXPORTS void cmp8u(const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop);\nCV_EXPORTS void cmp8s(const schar* src1, size_t step1, const schar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop);\nCV_EXPORTS void cmp16u(const ushort* src1, size_t step1, const ushort* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop);\nCV_EXPORTS void cmp16s(const short* src1, size_t step1, const short* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop);\nCV_EXPORTS void cmp32s(const int* src1, size_t step1, const int* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop);\nCV_EXPORTS void cmp32f(const float* src1, size_t step1, const float* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop);\nCV_EXPORTS void cmp64f(const double* src1, size_t step1, const double* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop);\n\nCV_EXPORTS void mul8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void mul8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void mul16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void mul16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void mul32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void mul32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void mul64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* scale);\n\nCV_EXPORTS void div8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void div8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void div16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void div16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void div32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void div32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void div64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* scale);\n\nCV_EXPORTS void recip8u( const uchar *, size_t, const uchar * src2, size_t step2, uchar* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void recip8s( const schar *, size_t, const schar * src2, size_t step2, schar* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void recip16u( const ushort *, size_t, const ushort * src2, size_t step2, ushort* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void recip16s( const short *, size_t, const short * src2, size_t step2, short* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void recip32s( const int *, size_t, const int * src2, size_t step2, int* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void recip32f( const float *, size_t, const float * src2, size_t step2, float* dst, size_t step, int width, int height, void* scale);\nCV_EXPORTS void recip64f( const double *, size_t, const double * src2, size_t step2, double* dst, size_t step, int width, int height, void* scale);\n\nCV_EXPORTS void addWeighted8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _scalars );\nCV_EXPORTS void addWeighted8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* scalars );\nCV_EXPORTS void addWeighted16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* scalars );\nCV_EXPORTS void addWeighted16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* scalars );\nCV_EXPORTS void addWeighted32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* scalars );\nCV_EXPORTS void addWeighted32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* scalars );\nCV_EXPORTS void addWeighted64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* scalars );\n\nCV_EXPORTS void cvt16f32f( const float16_t* src, float* dst, int len );\nCV_EXPORTS void cvt32f16f( const float* src, float16_t* dst, int len );\n\nCV_EXPORTS void addRNGBias32f( float* arr, const float* scaleBiasPairs, int len );\nCV_EXPORTS void addRNGBias64f( double* arr, const double* scaleBiasPairs, int len );\n\nstruct CV_EXPORTS DFT1D\n{\n    static Ptr<DFT1D> create(int len, int count, int depth, int flags, bool * useBuffer = 0);\n    virtual void apply(const uchar *src, uchar *dst) = 0;\n    virtual ~DFT1D() {}\n};\n\nstruct CV_EXPORTS DFT2D\n{\n    static Ptr<DFT2D> create(int width, int height, int depth,\n                             int src_channels, int dst_channels,\n                             int flags, int nonzero_rows = 0);\n    virtual void apply(const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step) = 0;\n    virtual ~DFT2D() {}\n};\n\nstruct CV_EXPORTS DCT2D\n{\n    static Ptr<DCT2D> create(int width, int height, int depth, int flags);\n    virtual void apply(const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step) = 0;\n    virtual ~DCT2D() {}\n};\n\n//! @} core_hal\n\n//=============================================================================\n// for binary compatibility with 3.0\n\n//! @cond IGNORED\n\nCV_EXPORTS int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n);\nCV_EXPORTS int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n);\nCV_EXPORTS bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n);\nCV_EXPORTS bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n);\n\nCV_EXPORTS void exp(const float* src, float* dst, int n);\nCV_EXPORTS void exp(const double* src, double* dst, int n);\nCV_EXPORTS void log(const float* src, float* dst, int n);\nCV_EXPORTS void log(const double* src, double* dst, int n);\n\nCV_EXPORTS void fastAtan2(const float* y, const float* x, float* dst, int n, bool angleInDegrees);\nCV_EXPORTS void magnitude(const float* x, const float* y, float* dst, int n);\nCV_EXPORTS void magnitude(const double* x, const double* y, double* dst, int n);\nCV_EXPORTS void sqrt(const float* src, float* dst, int len);\nCV_EXPORTS void sqrt(const double* src, double* dst, int len);\nCV_EXPORTS void invSqrt(const float* src, float* dst, int len);\nCV_EXPORTS void invSqrt(const double* src, double* dst, int len);\n\n//! @endcond\n\n}} //cv::hal\n\n#endif //OPENCV_HAL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/interface.h",
    "content": "#ifndef OPENCV_CORE_HAL_INTERFACE_H\n#define OPENCV_CORE_HAL_INTERFACE_H\n\n//! @addtogroup core_hal_interface\n//! @{\n\n//! @name Return codes\n//! @{\n#define CV_HAL_ERROR_OK 0\n#define CV_HAL_ERROR_NOT_IMPLEMENTED 1\n#define CV_HAL_ERROR_UNKNOWN -1\n//! @}\n\n#ifdef __cplusplus\n#include <cstddef>\n#else\n#include <stddef.h>\n#include <stdbool.h>\n#endif\n\n//! @name Data types\n//! primitive types\n//! - schar  - signed 1 byte integer\n//! - uchar  - unsigned 1 byte integer\n//! - short  - signed 2 byte integer\n//! - ushort - unsigned 2 byte integer\n//! - int    - signed 4 byte integer\n//! - uint   - unsigned 4 byte integer\n//! - int64  - signed 8 byte integer\n//! - uint64 - unsigned 8 byte integer\n//! @{\n#if !defined _MSC_VER && !defined __BORLANDC__\n#  if defined __cplusplus && __cplusplus >= 201103L && !defined __APPLE__\n#    include <cstdint>\n#    ifdef __NEWLIB__\n        typedef unsigned int uint;\n#    else\n        typedef std::uint32_t uint;\n#    endif\n#  else\n#    include <stdint.h>\n     typedef uint32_t uint;\n#  endif\n#else\n   typedef unsigned uint;\n#endif\n\ntypedef signed char schar;\n\n#ifndef __IPL_H__\n   typedef unsigned char uchar;\n   typedef unsigned short ushort;\n#endif\n\n#if defined _MSC_VER || defined __BORLANDC__\n   typedef __int64 int64;\n   typedef unsigned __int64 uint64;\n#  define CV_BIG_INT(n)   n##I64\n#  define CV_BIG_UINT(n)  n##UI64\n#else\n   typedef int64_t int64;\n   typedef uint64_t uint64;\n#  define CV_BIG_INT(n)   n##LL\n#  define CV_BIG_UINT(n)  n##ULL\n#endif\n\n#define CV_USRTYPE1 (void)\"CV_USRTYPE1 support has been dropped in OpenCV 4.0\"\n\n#define CV_CN_MAX     512\n#define CV_CN_SHIFT   3\n#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)\n\n#define CV_8U   0\n#define CV_8S   1\n#define CV_16U  2\n#define CV_16S  3\n#define CV_32S  4\n#define CV_32F  5\n#define CV_64F  6\n#define CV_16F  7\n\n#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)\n#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)\n\n#define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))\n#define CV_MAKE_TYPE CV_MAKETYPE\n\n#define CV_8UC1 CV_MAKETYPE(CV_8U,1)\n#define CV_8UC2 CV_MAKETYPE(CV_8U,2)\n#define CV_8UC3 CV_MAKETYPE(CV_8U,3)\n#define CV_8UC4 CV_MAKETYPE(CV_8U,4)\n#define CV_8UC(n) CV_MAKETYPE(CV_8U,(n))\n\n#define CV_8SC1 CV_MAKETYPE(CV_8S,1)\n#define CV_8SC2 CV_MAKETYPE(CV_8S,2)\n#define CV_8SC3 CV_MAKETYPE(CV_8S,3)\n#define CV_8SC4 CV_MAKETYPE(CV_8S,4)\n#define CV_8SC(n) CV_MAKETYPE(CV_8S,(n))\n\n#define CV_16UC1 CV_MAKETYPE(CV_16U,1)\n#define CV_16UC2 CV_MAKETYPE(CV_16U,2)\n#define CV_16UC3 CV_MAKETYPE(CV_16U,3)\n#define CV_16UC4 CV_MAKETYPE(CV_16U,4)\n#define CV_16UC(n) CV_MAKETYPE(CV_16U,(n))\n\n#define CV_16SC1 CV_MAKETYPE(CV_16S,1)\n#define CV_16SC2 CV_MAKETYPE(CV_16S,2)\n#define CV_16SC3 CV_MAKETYPE(CV_16S,3)\n#define CV_16SC4 CV_MAKETYPE(CV_16S,4)\n#define CV_16SC(n) CV_MAKETYPE(CV_16S,(n))\n\n#define CV_32SC1 CV_MAKETYPE(CV_32S,1)\n#define CV_32SC2 CV_MAKETYPE(CV_32S,2)\n#define CV_32SC3 CV_MAKETYPE(CV_32S,3)\n#define CV_32SC4 CV_MAKETYPE(CV_32S,4)\n#define CV_32SC(n) CV_MAKETYPE(CV_32S,(n))\n\n#define CV_32FC1 CV_MAKETYPE(CV_32F,1)\n#define CV_32FC2 CV_MAKETYPE(CV_32F,2)\n#define CV_32FC3 CV_MAKETYPE(CV_32F,3)\n#define CV_32FC4 CV_MAKETYPE(CV_32F,4)\n#define CV_32FC(n) CV_MAKETYPE(CV_32F,(n))\n\n#define CV_64FC1 CV_MAKETYPE(CV_64F,1)\n#define CV_64FC2 CV_MAKETYPE(CV_64F,2)\n#define CV_64FC3 CV_MAKETYPE(CV_64F,3)\n#define CV_64FC4 CV_MAKETYPE(CV_64F,4)\n#define CV_64FC(n) CV_MAKETYPE(CV_64F,(n))\n\n#define CV_16FC1 CV_MAKETYPE(CV_16F,1)\n#define CV_16FC2 CV_MAKETYPE(CV_16F,2)\n#define CV_16FC3 CV_MAKETYPE(CV_16F,3)\n#define CV_16FC4 CV_MAKETYPE(CV_16F,4)\n#define CV_16FC(n) CV_MAKETYPE(CV_16F,(n))\n//! @}\n\n//! @name Comparison operation\n//! @sa cv::CmpTypes\n//! @{\n#define CV_HAL_CMP_EQ 0\n#define CV_HAL_CMP_GT 1\n#define CV_HAL_CMP_GE 2\n#define CV_HAL_CMP_LT 3\n#define CV_HAL_CMP_LE 4\n#define CV_HAL_CMP_NE 5\n//! @}\n\n//! @name Border processing modes\n//! @sa cv::BorderTypes\n//! @{\n#define CV_HAL_BORDER_CONSTANT 0\n#define CV_HAL_BORDER_REPLICATE 1\n#define CV_HAL_BORDER_REFLECT 2\n#define CV_HAL_BORDER_WRAP 3\n#define CV_HAL_BORDER_REFLECT_101 4\n#define CV_HAL_BORDER_TRANSPARENT 5\n#define CV_HAL_BORDER_ISOLATED 16\n//! @}\n\n//! @name DFT flags\n//! @{\n#define CV_HAL_DFT_INVERSE        1\n#define CV_HAL_DFT_SCALE          2\n#define CV_HAL_DFT_ROWS           4\n#define CV_HAL_DFT_COMPLEX_OUTPUT 16\n#define CV_HAL_DFT_REAL_OUTPUT    32\n#define CV_HAL_DFT_TWO_STAGE      64\n#define CV_HAL_DFT_STAGE_COLS    128\n#define CV_HAL_DFT_IS_CONTINUOUS 512\n#define CV_HAL_DFT_IS_INPLACE 1024\n//! @}\n\n//! @name SVD flags\n//! @{\n#define CV_HAL_SVD_NO_UV    1\n#define CV_HAL_SVD_SHORT_UV 2\n#define CV_HAL_SVD_MODIFY_A 4\n#define CV_HAL_SVD_FULL_UV  8\n//! @}\n\n//! @name Gemm flags\n//! @{\n#define CV_HAL_GEMM_1_T 1\n#define CV_HAL_GEMM_2_T 2\n#define CV_HAL_GEMM_3_T 4\n//! @}\n\n//! @}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_HAL_INTRIN_HPP\n#define OPENCV_HAL_INTRIN_HPP\n\n#include <cmath>\n#include <float.h>\n#include <stdlib.h>\n#include \"opencv2/core/cvdef.h\"\n\n#define OPENCV_HAL_ADD(a, b) ((a) + (b))\n#define OPENCV_HAL_AND(a, b) ((a) & (b))\n#define OPENCV_HAL_NOP(a) (a)\n#define OPENCV_HAL_1ST(a, b) (a)\n\nnamespace {\ninline unsigned int trailingZeros32(unsigned int value) {\n#if defined(_MSC_VER)\n#if (_MSC_VER < 1700) || defined(_M_ARM) || defined(_M_ARM64)\n    unsigned long index = 0;\n    _BitScanForward(&index, value);\n    return (unsigned int)index;\n#elif defined(__clang__)\n    // clang-cl doesn't export _tzcnt_u32 for non BMI systems\n    return value ? __builtin_ctz(value) : 32;\n#else\n    return _tzcnt_u32(value);\n#endif\n#elif defined(__GNUC__) || defined(__GNUG__)\n    return __builtin_ctz(value);\n#elif defined(__ICC) || defined(__INTEL_COMPILER)\n    return _bit_scan_forward(value);\n#elif defined(__clang__)\n    return llvm.cttz.i32(value, true);\n#else\n    static const int MultiplyDeBruijnBitPosition[32] = {\n        0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,\n        31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 };\n    return MultiplyDeBruijnBitPosition[((uint32_t)((value & -value) * 0x077CB531U)) >> 27];\n#endif\n}\n}\n\n// unlike HAL API, which is in cv::hal,\n// we put intrinsics into cv namespace to make its\n// access from within opencv code more accessible\nnamespace cv {\n\nnamespace hal {\n\nenum StoreMode\n{\n    STORE_UNALIGNED = 0,\n    STORE_ALIGNED = 1,\n    STORE_ALIGNED_NOCACHE = 2\n};\n\n}\n\n// TODO FIXIT: Don't use \"God\" traits. Split on separate cases.\ntemplate<typename _Tp> struct V_TypeTraits\n{\n};\n\n#define CV_INTRIN_DEF_TYPE_TRAITS(type, int_type_, uint_type_, abs_type_, w_type_, q_type_, sum_type_) \\\n    template<> struct V_TypeTraits<type> \\\n    { \\\n        typedef type value_type; \\\n        typedef int_type_ int_type; \\\n        typedef abs_type_ abs_type; \\\n        typedef uint_type_ uint_type; \\\n        typedef w_type_ w_type; \\\n        typedef q_type_ q_type; \\\n        typedef sum_type_ sum_type; \\\n    \\\n        static inline int_type reinterpret_int(type x) \\\n        { \\\n            union { type l; int_type i; } v; \\\n            v.l = x; \\\n            return v.i; \\\n        } \\\n    \\\n        static inline type reinterpret_from_int(int_type x) \\\n        { \\\n            union { type l; int_type i; } v; \\\n            v.i = x; \\\n            return v.l; \\\n        } \\\n    }\n\n#define CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(type, int_type_, uint_type_, abs_type_, w_type_, sum_type_) \\\n    template<> struct V_TypeTraits<type> \\\n    { \\\n        typedef type value_type; \\\n        typedef int_type_ int_type; \\\n        typedef abs_type_ abs_type; \\\n        typedef uint_type_ uint_type; \\\n        typedef w_type_ w_type; \\\n        typedef sum_type_ sum_type; \\\n    \\\n        static inline int_type reinterpret_int(type x) \\\n        { \\\n            union { type l; int_type i; } v; \\\n            v.l = x; \\\n            return v.i; \\\n        } \\\n    \\\n        static inline type reinterpret_from_int(int_type x) \\\n        { \\\n            union { type l; int_type i; } v; \\\n            v.i = x; \\\n            return v.l; \\\n        } \\\n    }\n\nCV_INTRIN_DEF_TYPE_TRAITS(uchar, schar, uchar, uchar, ushort, unsigned, unsigned);\nCV_INTRIN_DEF_TYPE_TRAITS(schar, schar, uchar, uchar, short, int, int);\nCV_INTRIN_DEF_TYPE_TRAITS(ushort, short, ushort, ushort, unsigned, uint64, unsigned);\nCV_INTRIN_DEF_TYPE_TRAITS(short, short, ushort, ushort, int, int64, int);\nCV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(unsigned, int, unsigned, unsigned, uint64, unsigned);\nCV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(int, int, unsigned, unsigned, int64, int);\nCV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(float, int, unsigned, float, double, float);\nCV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(uint64, int64, uint64, uint64, void, uint64);\nCV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(int64, int64, uint64, uint64, void, int64);\nCV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(double, int64, uint64, double, void, double);\n\n#ifndef CV_DOXYGEN\n\n#ifndef CV_CPU_OPTIMIZATION_HAL_NAMESPACE\n#ifdef CV_FORCE_SIMD128_CPP\n    #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_EMULATOR_CPP\n    #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_EMULATOR_CPP {\n    #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }\n#elif defined(CV_CPU_DISPATCH_MODE)\n    #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE __CV_CAT(hal_, CV_CPU_DISPATCH_MODE)\n    #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace __CV_CAT(hal_, CV_CPU_DISPATCH_MODE) {\n    #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }\n#else\n    #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_baseline\n    #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_baseline {\n    #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }\n#endif\n#endif // CV_CPU_OPTIMIZATION_HAL_NAMESPACE\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\nusing namespace CV_CPU_OPTIMIZATION_HAL_NAMESPACE;\n#endif\n}\n\n#ifdef CV_DOXYGEN\n#   undef CV_AVX2\n#   undef CV_SSE2\n#   undef CV_NEON\n#   undef CV_VSX\n#   undef CV_FP16\n#   undef CV_MSA\n#   undef CV_RVV\n#endif\n\n#if (CV_SSE2 || CV_NEON || CV_VSX || CV_MSA || CV_WASM_SIMD || CV_RVV071 || CV_RVV) && !defined(CV_FORCE_SIMD128_CPP)\n#define CV__SIMD_FORWARD 128\n#include \"opencv2/core/hal/intrin_forward.hpp\"\n#endif\n\n#if CV_SSE2 && !defined(CV_FORCE_SIMD128_CPP)\n\n#include \"opencv2/core/hal/intrin_sse_em.hpp\"\n#include \"opencv2/core/hal/intrin_sse.hpp\"\n\n#elif CV_NEON && !defined(CV_FORCE_SIMD128_CPP)\n\n#include \"opencv2/core/hal/intrin_neon.hpp\"\n\n#elif CV_RVV071 && !defined(CV_FORCE_SIMD128_CPP)\n#define CV_SIMD128_CPP 0\n#include \"opencv2/core/hal/intrin_rvv071.hpp\"\n\n#elif CV_VSX && !defined(CV_FORCE_SIMD128_CPP)\n\n#include \"opencv2/core/hal/intrin_vsx.hpp\"\n\n#elif CV_MSA && !defined(CV_FORCE_SIMD128_CPP)\n\n#include \"opencv2/core/hal/intrin_msa.hpp\"\n\n#elif CV_WASM_SIMD && !defined(CV_FORCE_SIMD128_CPP)\n#include \"opencv2/core/hal/intrin_wasm.hpp\"\n\n#elif CV_RVV && !defined(CV_FORCE_SIMD128_CPP)\n#include \"opencv2/core/hal/intrin_rvv.hpp\"\n\n#else\n\n#include \"opencv2/core/hal/intrin_cpp.hpp\"\n\n#endif\n\n// AVX2 can be used together with SSE2, so\n// we define those two sets of intrinsics at once.\n// Most of the intrinsics do not conflict (the proper overloaded variant is\n// resolved by the argument types, e.g. v_float32x4 ~ SSE2, v_float32x8 ~ AVX2),\n// but some of AVX2 intrinsics get v256_ prefix instead of v_, e.g. v256_load() vs v_load().\n// Correspondingly, the wide intrinsics (which are mapped to the \"widest\"\n// available instruction set) will get vx_ prefix\n// (and will be mapped to v256_ counterparts) (e.g. vx_load() => v256_load())\n#if CV_AVX2\n\n#define CV__SIMD_FORWARD 256\n#include \"opencv2/core/hal/intrin_forward.hpp\"\n#include \"opencv2/core/hal/intrin_avx.hpp\"\n\n#endif\n\n// AVX512 can be used together with SSE2 and AVX2, so\n// we define those sets of intrinsics at once.\n// For some of AVX512 intrinsics get v512_ prefix instead of v_, e.g. v512_load() vs v_load().\n// Wide intrinsics will be mapped to v512_ counterparts in this case(e.g. vx_load() => v512_load())\n#if CV_AVX512_SKX\n\n#define CV__SIMD_FORWARD 512\n#include \"opencv2/core/hal/intrin_forward.hpp\"\n#include \"opencv2/core/hal/intrin_avx512.hpp\"\n\n#endif\n\n//! @cond IGNORED\n\nnamespace cv {\n\n#ifndef CV_DOXYGEN\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n#endif\n\n#ifndef CV_SIMD128\n#define CV_SIMD128 0\n#endif\n\n#ifndef CV_SIMD128_CPP\n#define CV_SIMD128_CPP 0\n#endif\n\n#ifndef CV_SIMD128_64F\n#define CV_SIMD128_64F 0\n#endif\n\n#ifndef CV_SIMD256\n#define CV_SIMD256 0\n#endif\n\n#ifndef CV_SIMD256_64F\n#define CV_SIMD256_64F 0\n#endif\n\n#ifndef CV_SIMD512\n#define CV_SIMD512 0\n#endif\n\n#ifndef CV_SIMD512_64F\n#define CV_SIMD512_64F 0\n#endif\n\n#ifndef CV_SIMD128_FP16\n#define CV_SIMD128_FP16 0\n#endif\n\n#ifndef CV_SIMD256_FP16\n#define CV_SIMD256_FP16 0\n#endif\n\n#ifndef CV_SIMD512_FP16\n#define CV_SIMD512_FP16 0\n#endif\n\n//==================================================================================================\n\ntemplate<typename _Tp> struct V_RegTraits\n{\n};\n\n#define CV_DEF_REG_TRAITS(prefix, _reg, lane_type, suffix, _u_reg, _w_reg, _q_reg, _int_reg, _round_reg) \\\n    template<> struct V_RegTraits<_reg> \\\n    { \\\n        typedef _reg reg; \\\n        typedef _u_reg u_reg; \\\n        typedef _w_reg w_reg; \\\n        typedef _q_reg q_reg; \\\n        typedef _int_reg int_reg; \\\n        typedef _round_reg round_reg; \\\n    }\n\n#if CV_SIMD128 || CV_SIMD128_CPP\n    CV_DEF_REG_TRAITS(v, v_uint8x16, uchar, u8, v_uint8x16, v_uint16x8, v_uint32x4, v_int8x16, void);\n    CV_DEF_REG_TRAITS(v, v_int8x16, schar, s8, v_uint8x16, v_int16x8, v_int32x4, v_int8x16, void);\n    CV_DEF_REG_TRAITS(v, v_uint16x8, ushort, u16, v_uint16x8, v_uint32x4, v_uint64x2, v_int16x8, void);\n    CV_DEF_REG_TRAITS(v, v_int16x8, short, s16, v_uint16x8, v_int32x4, v_int64x2, v_int16x8, void);\n    CV_DEF_REG_TRAITS(v, v_uint32x4, unsigned, u32, v_uint32x4, v_uint64x2, void, v_int32x4, void);\n    CV_DEF_REG_TRAITS(v, v_int32x4, int, s32, v_uint32x4, v_int64x2, void, v_int32x4, void);\n#if CV_SIMD128_64F || CV_SIMD128_CPP\n    CV_DEF_REG_TRAITS(v, v_float32x4, float, f32, v_float32x4, v_float64x2, void, v_int32x4, v_int32x4);\n#else\n    CV_DEF_REG_TRAITS(v, v_float32x4, float, f32, v_float32x4, void, void, v_int32x4, v_int32x4);\n#endif\n    CV_DEF_REG_TRAITS(v, v_uint64x2, uint64, u64, v_uint64x2, void, void, v_int64x2, void);\n    CV_DEF_REG_TRAITS(v, v_int64x2, int64, s64, v_uint64x2, void, void, v_int64x2, void);\n#if CV_SIMD128_64F\n    CV_DEF_REG_TRAITS(v, v_float64x2, double, f64, v_float64x2, void, void, v_int64x2, v_int32x4);\n#endif\n#endif\n\n#if CV_SIMD256\n    CV_DEF_REG_TRAITS(v256, v_uint8x32, uchar, u8, v_uint8x32, v_uint16x16, v_uint32x8, v_int8x32, void);\n    CV_DEF_REG_TRAITS(v256, v_int8x32, schar, s8, v_uint8x32, v_int16x16, v_int32x8, v_int8x32, void);\n    CV_DEF_REG_TRAITS(v256, v_uint16x16, ushort, u16, v_uint16x16, v_uint32x8, v_uint64x4, v_int16x16, void);\n    CV_DEF_REG_TRAITS(v256, v_int16x16, short, s16, v_uint16x16, v_int32x8, v_int64x4, v_int16x16, void);\n    CV_DEF_REG_TRAITS(v256, v_uint32x8, unsigned, u32, v_uint32x8, v_uint64x4, void, v_int32x8, void);\n    CV_DEF_REG_TRAITS(v256, v_int32x8, int, s32, v_uint32x8, v_int64x4, void, v_int32x8, void);\n    CV_DEF_REG_TRAITS(v256, v_float32x8, float, f32, v_float32x8, v_float64x4, void, v_int32x8, v_int32x8);\n    CV_DEF_REG_TRAITS(v256, v_uint64x4, uint64, u64, v_uint64x4, void, void, v_int64x4, void);\n    CV_DEF_REG_TRAITS(v256, v_int64x4, int64, s64, v_uint64x4, void, void, v_int64x4, void);\n    CV_DEF_REG_TRAITS(v256, v_float64x4, double, f64, v_float64x4, void, void, v_int64x4, v_int32x8);\n#endif\n\n#if CV_SIMD512\n    CV_DEF_REG_TRAITS(v512, v_uint8x64, uchar, u8, v_uint8x64, v_uint16x32, v_uint32x16, v_int8x64, void);\n    CV_DEF_REG_TRAITS(v512, v_int8x64, schar, s8, v_uint8x64, v_int16x32, v_int32x16, v_int8x64, void);\n    CV_DEF_REG_TRAITS(v512, v_uint16x32, ushort, u16, v_uint16x32, v_uint32x16, v_uint64x8, v_int16x32, void);\n    CV_DEF_REG_TRAITS(v512, v_int16x32, short, s16, v_uint16x32, v_int32x16, v_int64x8, v_int16x32, void);\n    CV_DEF_REG_TRAITS(v512, v_uint32x16, unsigned, u32, v_uint32x16, v_uint64x8, void, v_int32x16, void);\n    CV_DEF_REG_TRAITS(v512, v_int32x16, int, s32, v_uint32x16, v_int64x8, void, v_int32x16, void);\n    CV_DEF_REG_TRAITS(v512, v_float32x16, float, f32, v_float32x16, v_float64x8, void, v_int32x16, v_int32x16);\n    CV_DEF_REG_TRAITS(v512, v_uint64x8, uint64, u64, v_uint64x8, void, void, v_int64x8, void);\n    CV_DEF_REG_TRAITS(v512, v_int64x8, int64, s64, v_uint64x8, void, void, v_int64x8, void);\n    CV_DEF_REG_TRAITS(v512, v_float64x8, double, f64, v_float64x8, void, void, v_int64x8, v_int32x16);\n#endif\n//! @endcond\n\n#if CV_SIMD512 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 512)\n#define CV__SIMD_NAMESPACE simd512\nnamespace CV__SIMD_NAMESPACE {\n    #define CV_SIMD 1\n    #define CV_SIMD_64F CV_SIMD512_64F\n    #define CV_SIMD_FP16 CV_SIMD512_FP16\n    #define CV_SIMD_WIDTH 64\n//! @addtogroup core_hal_intrin\n//! @{\n    //! @brief Maximum available vector register capacity 8-bit unsigned integer values\n    typedef v_uint8x64    v_uint8;\n    //! @brief Maximum available vector register capacity 8-bit signed integer values\n    typedef v_int8x64     v_int8;\n    //! @brief Maximum available vector register capacity 16-bit unsigned integer values\n    typedef v_uint16x32   v_uint16;\n    //! @brief Maximum available vector register capacity 16-bit signed integer values\n    typedef v_int16x32    v_int16;\n    //! @brief Maximum available vector register capacity 32-bit unsigned integer values\n    typedef v_uint32x16   v_uint32;\n    //! @brief Maximum available vector register capacity 32-bit signed integer values\n    typedef v_int32x16    v_int32;\n    //! @brief Maximum available vector register capacity 64-bit unsigned integer values\n    typedef v_uint64x8    v_uint64;\n    //! @brief Maximum available vector register capacity 64-bit signed integer values\n    typedef v_int64x8     v_int64;\n    //! @brief Maximum available vector register capacity 32-bit floating point values (single precision)\n    typedef v_float32x16  v_float32;\n    #if CV_SIMD512_64F\n    //! @brief Maximum available vector register capacity 64-bit floating point values (double precision)\n    typedef v_float64x8   v_float64;\n    #endif\n//! @}\n\n    #define VXPREFIX(func) v512##func\n} // namespace\nusing namespace CV__SIMD_NAMESPACE;\n#elif CV_SIMD256 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 256)\n#define CV__SIMD_NAMESPACE simd256\nnamespace CV__SIMD_NAMESPACE {\n    #define CV_SIMD 1\n    #define CV_SIMD_64F CV_SIMD256_64F\n    #define CV_SIMD_FP16 CV_SIMD256_FP16\n    #define CV_SIMD_WIDTH 32\n//! @addtogroup core_hal_intrin\n//! @{\n    //! @brief Maximum available vector register capacity 8-bit unsigned integer values\n    typedef v_uint8x32   v_uint8;\n    //! @brief Maximum available vector register capacity 8-bit signed integer values\n    typedef v_int8x32    v_int8;\n    //! @brief Maximum available vector register capacity 16-bit unsigned integer values\n    typedef v_uint16x16  v_uint16;\n    //! @brief Maximum available vector register capacity 16-bit signed integer values\n    typedef v_int16x16   v_int16;\n    //! @brief Maximum available vector register capacity 32-bit unsigned integer values\n    typedef v_uint32x8   v_uint32;\n    //! @brief Maximum available vector register capacity 32-bit signed integer values\n    typedef v_int32x8    v_int32;\n    //! @brief Maximum available vector register capacity 64-bit unsigned integer values\n    typedef v_uint64x4   v_uint64;\n    //! @brief Maximum available vector register capacity 64-bit signed integer values\n    typedef v_int64x4    v_int64;\n    //! @brief Maximum available vector register capacity 32-bit floating point values (single precision)\n    typedef v_float32x8  v_float32;\n    #if CV_SIMD256_64F\n    //! @brief Maximum available vector register capacity 64-bit floating point values (double precision)\n    typedef v_float64x4  v_float64;\n    #endif\n//! @}\n\n    #define VXPREFIX(func) v256##func\n} // namespace\nusing namespace CV__SIMD_NAMESPACE;\n#elif (CV_SIMD128 || CV_SIMD128_CPP) && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 128)\n#if defined CV_SIMD128_CPP\n#define CV__SIMD_NAMESPACE simd128_cpp\n#else\n#define CV__SIMD_NAMESPACE simd128\n#endif\nnamespace CV__SIMD_NAMESPACE {\n    #define CV_SIMD CV_SIMD128\n    #define CV_SIMD_64F CV_SIMD128_64F\n    #define CV_SIMD_WIDTH 16\n//! @addtogroup core_hal_intrin\n//! @{\n    //! @brief Maximum available vector register capacity 8-bit unsigned integer values\n    typedef v_uint8x16  v_uint8;\n    //! @brief Maximum available vector register capacity 8-bit signed integer values\n    typedef v_int8x16   v_int8;\n    //! @brief Maximum available vector register capacity 16-bit unsigned integer values\n    typedef v_uint16x8  v_uint16;\n    //! @brief Maximum available vector register capacity 16-bit signed integer values\n    typedef v_int16x8   v_int16;\n    //! @brief Maximum available vector register capacity 32-bit unsigned integer values\n    typedef v_uint32x4  v_uint32;\n    //! @brief Maximum available vector register capacity 32-bit signed integer values\n    typedef v_int32x4   v_int32;\n    //! @brief Maximum available vector register capacity 64-bit unsigned integer values\n    typedef v_uint64x2  v_uint64;\n    //! @brief Maximum available vector register capacity 64-bit signed integer values\n    typedef v_int64x2   v_int64;\n    //! @brief Maximum available vector register capacity 32-bit floating point values (single precision)\n    typedef v_float32x4 v_float32;\n    #if CV_SIMD128_64F\n    //! @brief Maximum available vector register capacity 64-bit floating point values (double precision)\n    typedef v_float64x2 v_float64;\n    #endif\n//! @}\n\n    #define VXPREFIX(func) v##func\n} // namespace\nusing namespace CV__SIMD_NAMESPACE;\n#endif\n\nnamespace CV__SIMD_NAMESPACE {\n//! @addtogroup core_hal_intrin\n//! @{\n    //! @name Wide init with value\n    //! @{\n    //! @brief Create maximum available capacity vector with elements set to a specific value\n    inline v_uint8 vx_setall_u8(uchar v) { return VXPREFIX(_setall_u8)(v); }\n    inline v_int8 vx_setall_s8(schar v) { return VXPREFIX(_setall_s8)(v); }\n    inline v_uint16 vx_setall_u16(ushort v) { return VXPREFIX(_setall_u16)(v); }\n    inline v_int16 vx_setall_s16(short v) { return VXPREFIX(_setall_s16)(v); }\n    inline v_int32 vx_setall_s32(int v) { return VXPREFIX(_setall_s32)(v); }\n    inline v_uint32 vx_setall_u32(unsigned v) { return VXPREFIX(_setall_u32)(v); }\n    inline v_float32 vx_setall_f32(float v) { return VXPREFIX(_setall_f32)(v); }\n    inline v_int64 vx_setall_s64(int64 v) { return VXPREFIX(_setall_s64)(v); }\n    inline v_uint64 vx_setall_u64(uint64 v) { return VXPREFIX(_setall_u64)(v); }\n#if CV_SIMD_64F\n    inline v_float64 vx_setall_f64(double v) { return VXPREFIX(_setall_f64)(v); }\n#endif\n    //! @}\n\n    //! @name Wide init with zero\n    //! @{\n    //! @brief Create maximum available capacity vector with elements set to zero\n    inline v_uint8 vx_setzero_u8() { return VXPREFIX(_setzero_u8)(); }\n    inline v_int8 vx_setzero_s8() { return VXPREFIX(_setzero_s8)(); }\n    inline v_uint16 vx_setzero_u16() { return VXPREFIX(_setzero_u16)(); }\n    inline v_int16 vx_setzero_s16() { return VXPREFIX(_setzero_s16)(); }\n    inline v_int32 vx_setzero_s32() { return VXPREFIX(_setzero_s32)(); }\n    inline v_uint32 vx_setzero_u32() { return VXPREFIX(_setzero_u32)(); }\n    inline v_float32 vx_setzero_f32() { return VXPREFIX(_setzero_f32)(); }\n    inline v_int64 vx_setzero_s64() { return VXPREFIX(_setzero_s64)(); }\n    inline v_uint64 vx_setzero_u64() { return VXPREFIX(_setzero_u64)(); }\n#if CV_SIMD_64F\n    inline v_float64 vx_setzero_f64() { return VXPREFIX(_setzero_f64)(); }\n#endif\n    //! @}\n\n    //! @name Wide load from memory\n    //! @{\n    //! @brief Load maximum available capacity register contents from memory\n    inline v_uint8 vx_load(const uchar * ptr) { return VXPREFIX(_load)(ptr); }\n    inline v_int8 vx_load(const schar * ptr) { return VXPREFIX(_load)(ptr); }\n    inline v_uint16 vx_load(const ushort * ptr) { return VXPREFIX(_load)(ptr); }\n    inline v_int16 vx_load(const short * ptr) { return VXPREFIX(_load)(ptr); }\n    inline v_int32 vx_load(const int * ptr) { return VXPREFIX(_load)(ptr); }\n    inline v_uint32 vx_load(const unsigned * ptr) { return VXPREFIX(_load)(ptr); }\n    inline v_float32 vx_load(const float * ptr) { return VXPREFIX(_load)(ptr); }\n    inline v_int64 vx_load(const int64 * ptr) { return VXPREFIX(_load)(ptr); }\n    inline v_uint64 vx_load(const uint64 * ptr) { return VXPREFIX(_load)(ptr); }\n#if CV_SIMD_64F\n    inline v_float64 vx_load(const double * ptr) { return VXPREFIX(_load)(ptr); }\n#endif\n    //! @}\n\n    //! @name Wide load from memory(aligned)\n    //! @{\n    //! @brief Load maximum available capacity register contents from memory(aligned)\n    inline v_uint8 vx_load_aligned(const uchar * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n    inline v_int8 vx_load_aligned(const schar * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n    inline v_uint16 vx_load_aligned(const ushort * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n    inline v_int16 vx_load_aligned(const short * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n    inline v_int32 vx_load_aligned(const int * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n    inline v_uint32 vx_load_aligned(const unsigned * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n    inline v_float32 vx_load_aligned(const float * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n    inline v_int64 vx_load_aligned(const int64 * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n    inline v_uint64 vx_load_aligned(const uint64 * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n#if CV_SIMD_64F\n    inline v_float64 vx_load_aligned(const double * ptr) { return VXPREFIX(_load_aligned)(ptr); }\n#endif\n    //! @}\n\n    //! @name Wide load lower half from memory\n    //! @{\n    //! @brief Load lower half of maximum available capacity register from memory\n    inline v_uint8 vx_load_low(const uchar * ptr) { return VXPREFIX(_load_low)(ptr); }\n    inline v_int8 vx_load_low(const schar * ptr) { return VXPREFIX(_load_low)(ptr); }\n    inline v_uint16 vx_load_low(const ushort * ptr) { return VXPREFIX(_load_low)(ptr); }\n    inline v_int16 vx_load_low(const short * ptr) { return VXPREFIX(_load_low)(ptr); }\n    inline v_int32 vx_load_low(const int * ptr) { return VXPREFIX(_load_low)(ptr); }\n    inline v_uint32 vx_load_low(const unsigned * ptr) { return VXPREFIX(_load_low)(ptr); }\n    inline v_float32 vx_load_low(const float * ptr) { return VXPREFIX(_load_low)(ptr); }\n    inline v_int64 vx_load_low(const int64 * ptr) { return VXPREFIX(_load_low)(ptr); }\n    inline v_uint64 vx_load_low(const uint64 * ptr) { return VXPREFIX(_load_low)(ptr); }\n#if CV_SIMD_64F\n    inline v_float64 vx_load_low(const double * ptr) { return VXPREFIX(_load_low)(ptr); }\n#endif\n    //! @}\n\n    //! @name Wide load halfs from memory\n    //! @{\n    //! @brief Load maximum available capacity register contents from two memory blocks\n    inline v_uint8 vx_load_halves(const uchar * ptr0, const uchar * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n    inline v_int8 vx_load_halves(const schar * ptr0, const schar * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n    inline v_uint16 vx_load_halves(const ushort * ptr0, const ushort * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n    inline v_int16 vx_load_halves(const short * ptr0, const short * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n    inline v_int32 vx_load_halves(const int * ptr0, const int * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n    inline v_uint32 vx_load_halves(const unsigned * ptr0, const unsigned * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n    inline v_float32 vx_load_halves(const float * ptr0, const float * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n    inline v_int64 vx_load_halves(const int64 * ptr0, const int64 * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n    inline v_uint64 vx_load_halves(const uint64 * ptr0, const uint64 * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n#if CV_SIMD_64F\n    inline v_float64 vx_load_halves(const double * ptr0, const double * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); }\n#endif\n    //! @}\n\n    //! @name Wide LUT of elements\n    //! @{\n    //! @brief Load maximum available capacity register contents with array elements by provided indexes\n    inline v_uint8 vx_lut(const uchar * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n    inline v_int8 vx_lut(const schar * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n    inline v_uint16 vx_lut(const ushort * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n    inline v_int16 vx_lut(const short* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n    inline v_int32 vx_lut(const int* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n    inline v_uint32 vx_lut(const unsigned* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n    inline v_float32 vx_lut(const float* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n    inline v_int64 vx_lut(const int64 * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n    inline v_uint64 vx_lut(const uint64 * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n#if CV_SIMD_64F\n    inline v_float64 vx_lut(const double* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); }\n#endif\n    //! @}\n\n    //! @name Wide LUT of element pairs\n    //! @{\n    //! @brief Load maximum available capacity register contents with array element pairs by provided indexes\n    inline v_uint8 vx_lut_pairs(const uchar * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n    inline v_int8 vx_lut_pairs(const schar * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n    inline v_uint16 vx_lut_pairs(const ushort * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n    inline v_int16 vx_lut_pairs(const short* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n    inline v_int32 vx_lut_pairs(const int* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n    inline v_uint32 vx_lut_pairs(const unsigned* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n    inline v_float32 vx_lut_pairs(const float* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n    inline v_int64 vx_lut_pairs(const int64 * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n    inline v_uint64 vx_lut_pairs(const uint64 * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n#if CV_SIMD_64F\n    inline v_float64 vx_lut_pairs(const double* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); }\n#endif\n    //! @}\n\n    //! @name Wide LUT of element quads\n    //! @{\n    //! @brief Load maximum available capacity register contents with array element quads by provided indexes\n    inline v_uint8 vx_lut_quads(const uchar* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }\n    inline v_int8 vx_lut_quads(const schar* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }\n    inline v_uint16 vx_lut_quads(const ushort* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }\n    inline v_int16 vx_lut_quads(const short* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }\n    inline v_int32 vx_lut_quads(const int* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }\n    inline v_uint32 vx_lut_quads(const unsigned* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }\n    inline v_float32 vx_lut_quads(const float* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); }\n    //! @}\n\n    //! @name Wide load with double expansion\n    //! @{\n    //! @brief Load maximum available capacity register contents from memory with double expand\n    inline v_uint16 vx_load_expand(const uchar * ptr) { return VXPREFIX(_load_expand)(ptr); }\n    inline v_int16 vx_load_expand(const schar * ptr) { return VXPREFIX(_load_expand)(ptr); }\n    inline v_uint32 vx_load_expand(const ushort * ptr) { return VXPREFIX(_load_expand)(ptr); }\n    inline v_int32 vx_load_expand(const short* ptr) { return VXPREFIX(_load_expand)(ptr); }\n    inline v_int64 vx_load_expand(const int* ptr) { return VXPREFIX(_load_expand)(ptr); }\n    inline v_uint64 vx_load_expand(const unsigned* ptr) { return VXPREFIX(_load_expand)(ptr); }\n    inline v_float32 vx_load_expand(const float16_t * ptr) { return VXPREFIX(_load_expand)(ptr); }\n    //! @}\n\n    //! @name Wide load with quad expansion\n    //! @{\n    //! @brief Load maximum available capacity register contents from memory with quad expand\n    inline v_uint32 vx_load_expand_q(const uchar * ptr) { return VXPREFIX(_load_expand_q)(ptr); }\n    inline v_int32 vx_load_expand_q(const schar * ptr) { return VXPREFIX(_load_expand_q)(ptr); }\n    //! @}\n\n    /** @brief SIMD processing state cleanup call */\n    inline void vx_cleanup() { VXPREFIX(_cleanup)(); }\n\n\n//! @cond IGNORED\n\n    // backward compatibility\n    template<typename _Tp, typename _Tvec> static inline\n    void vx_store(_Tp* dst, const _Tvec& v) { return v_store(dst, v); }\n    // backward compatibility\n    template<typename _Tp, typename _Tvec> static inline\n    void vx_store_aligned(_Tp* dst, const _Tvec& v) { return v_store_aligned(dst, v); }\n\n//! @endcond\n\n\n//! @}\n    #undef VXPREFIX\n} // namespace\n\n//! @cond IGNORED\n#ifndef CV_SIMD_64F\n#define CV_SIMD_64F 0\n#endif\n\n#ifndef CV_SIMD_FP16\n#define CV_SIMD_FP16 0  //!< Defined to 1 on native support of operations with float16x8_t / float16x16_t (SIMD256) types\n#endif\n\n#ifndef CV_SIMD\n#define CV_SIMD 0\n#endif\n\n#include \"simd_utils.impl.hpp\"\n\n#ifndef CV_DOXYGEN\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n#endif\n\n} // cv::\n\n//! @endcond\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_avx.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html\n\n#ifndef OPENCV_HAL_INTRIN_AVX_HPP\n#define OPENCV_HAL_INTRIN_AVX_HPP\n\n#define CV_SIMD256 1\n#define CV_SIMD256_64F 1\n#define CV_SIMD256_FP16 0  // no native operations with FP16 type. Only load/store from float32x8 are available (if CV_FP16 == 1)\n\nnamespace cv\n{\n\n//! @cond IGNORED\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n///////// Utils ////////////\n\ninline __m256i _v256_combine(const __m128i& lo, const __m128i& hi)\n{ return _mm256_inserti128_si256(_mm256_castsi128_si256(lo), hi, 1); }\n\ninline __m256 _v256_combine(const __m128& lo, const __m128& hi)\n{ return _mm256_insertf128_ps(_mm256_castps128_ps256(lo), hi, 1); }\n\ninline __m256d _v256_combine(const __m128d& lo, const __m128d& hi)\n{ return _mm256_insertf128_pd(_mm256_castpd128_pd256(lo), hi, 1); }\n\ninline int _v_cvtsi256_si32(const __m256i& a)\n{ return _mm_cvtsi128_si32(_mm256_castsi256_si128(a)); }\n\ninline __m256i _v256_shuffle_odd_64(const __m256i& v)\n{ return _mm256_permute4x64_epi64(v, _MM_SHUFFLE(3, 1, 2, 0)); }\n\ninline __m256d _v256_shuffle_odd_64(const __m256d& v)\n{ return _mm256_permute4x64_pd(v, _MM_SHUFFLE(3, 1, 2, 0)); }\n\ntemplate<int imm>\ninline __m256i _v256_permute2x128(const __m256i& a, const __m256i& b)\n{ return _mm256_permute2x128_si256(a, b, imm); }\n\ntemplate<int imm>\ninline __m256 _v256_permute2x128(const __m256& a, const __m256& b)\n{ return _mm256_permute2f128_ps(a, b, imm); }\n\ntemplate<int imm>\ninline __m256d _v256_permute2x128(const __m256d& a, const __m256d& b)\n{ return _mm256_permute2f128_pd(a, b, imm); }\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v256_permute2x128(const _Tpvec& a, const _Tpvec& b)\n{ return _Tpvec(_v256_permute2x128<imm>(a.val, b.val)); }\n\ntemplate<int imm>\ninline __m256i _v256_permute4x64(const __m256i& a)\n{ return _mm256_permute4x64_epi64(a, imm); }\n\ntemplate<int imm>\ninline __m256d _v256_permute4x64(const __m256d& a)\n{ return _mm256_permute4x64_pd(a, imm); }\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v256_permute4x64(const _Tpvec& a)\n{ return _Tpvec(_v256_permute4x64<imm>(a.val)); }\n\ninline __m128i _v256_extract_high(const __m256i& v)\n{ return _mm256_extracti128_si256(v, 1); }\n\ninline __m128  _v256_extract_high(const __m256& v)\n{ return _mm256_extractf128_ps(v, 1); }\n\ninline __m128d _v256_extract_high(const __m256d& v)\n{ return _mm256_extractf128_pd(v, 1); }\n\ninline __m128i _v256_extract_low(const __m256i& v)\n{ return _mm256_castsi256_si128(v); }\n\ninline __m128  _v256_extract_low(const __m256& v)\n{ return _mm256_castps256_ps128(v); }\n\ninline __m128d _v256_extract_low(const __m256d& v)\n{ return _mm256_castpd256_pd128(v); }\n\ninline __m256i _v256_packs_epu32(const __m256i& a, const __m256i& b)\n{\n    const __m256i m = _mm256_set1_epi32(65535);\n    __m256i am = _mm256_min_epu32(a, m);\n    __m256i bm = _mm256_min_epu32(b, m);\n    return _mm256_packus_epi32(am, bm);\n}\n\ntemplate<int i>\ninline int _v256_extract_epi8(const __m256i& a)\n{\n#if defined(CV__SIMD_HAVE_mm256_extract_epi8) || (CV_AVX2 && (!defined(_MSC_VER) || _MSC_VER >= 1910/*MSVS 2017*/))\n    return _mm256_extract_epi8(a, i);\n#else\n    __m128i b = _mm256_extractf128_si256(a, ((i) >> 4));\n    return _mm_extract_epi8(b, i & 15);  // SSE4.1\n#endif\n}\n\ntemplate<int i>\ninline int _v256_extract_epi16(const __m256i& a)\n{\n#if defined(CV__SIMD_HAVE_mm256_extract_epi8) || (CV_AVX2 && (!defined(_MSC_VER) || _MSC_VER >= 1910/*MSVS 2017*/))\n    return _mm256_extract_epi16(a, i);\n#else\n    __m128i b = _mm256_extractf128_si256(a, ((i) >> 3));\n    return _mm_extract_epi16(b, i & 7);  // SSE2\n#endif\n}\n\ntemplate<int i>\ninline int _v256_extract_epi32(const __m256i& a)\n{\n#if defined(CV__SIMD_HAVE_mm256_extract_epi8) || (CV_AVX2 && (!defined(_MSC_VER) || _MSC_VER >= 1910/*MSVS 2017*/))\n    return _mm256_extract_epi32(a, i);\n#else\n    __m128i b = _mm256_extractf128_si256(a, ((i) >> 2));\n    return _mm_extract_epi32(b, i & 3);  // SSE4.1\n#endif\n}\n\ntemplate<int i>\ninline int64 _v256_extract_epi64(const __m256i& a)\n{\n#if defined(CV__SIMD_HAVE_mm256_extract_epi8) || (CV_AVX2 && (!defined(_MSC_VER) || _MSC_VER >= 1910/*MSVS 2017*/))\n    return _mm256_extract_epi64(a, i);\n#else\n    __m128i b = _mm256_extractf128_si256(a, ((i) >> 1));\n    return _mm_extract_epi64(b, i & 1);  // SSE4.1\n#endif\n}\n\n///////// Types ////////////\n\nstruct v_uint8x32\n{\n    typedef uchar lane_type;\n    enum { nlanes = 32 };\n    __m256i val;\n\n    explicit v_uint8x32(__m256i v) : val(v) {}\n    v_uint8x32(uchar v0,  uchar v1,  uchar v2,  uchar v3,\n               uchar v4,  uchar v5,  uchar v6,  uchar v7,\n               uchar v8,  uchar v9,  uchar v10, uchar v11,\n               uchar v12, uchar v13, uchar v14, uchar v15,\n               uchar v16, uchar v17, uchar v18, uchar v19,\n               uchar v20, uchar v21, uchar v22, uchar v23,\n               uchar v24, uchar v25, uchar v26, uchar v27,\n               uchar v28, uchar v29, uchar v30, uchar v31)\n    {\n        val = _mm256_setr_epi8((char)v0, (char)v1, (char)v2, (char)v3,\n            (char)v4,  (char)v5,  (char)v6 , (char)v7,  (char)v8,  (char)v9,\n            (char)v10, (char)v11, (char)v12, (char)v13, (char)v14, (char)v15,\n            (char)v16, (char)v17, (char)v18, (char)v19, (char)v20, (char)v21,\n            (char)v22, (char)v23, (char)v24, (char)v25, (char)v26, (char)v27,\n            (char)v28, (char)v29, (char)v30, (char)v31);\n    }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_uint8x32() {}\n\n    uchar get0() const { return (uchar)_v_cvtsi256_si32(val); }\n};\n\nstruct v_int8x32\n{\n    typedef schar lane_type;\n    enum { nlanes = 32 };\n    __m256i val;\n\n    explicit v_int8x32(__m256i v) : val(v) {}\n    v_int8x32(schar v0,  schar v1,  schar v2,  schar v3,\n              schar v4,  schar v5,  schar v6,  schar v7,\n              schar v8,  schar v9,  schar v10, schar v11,\n              schar v12, schar v13, schar v14, schar v15,\n              schar v16, schar v17, schar v18, schar v19,\n              schar v20, schar v21, schar v22, schar v23,\n              schar v24, schar v25, schar v26, schar v27,\n              schar v28, schar v29, schar v30, schar v31)\n    {\n        val = _mm256_setr_epi8(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9,\n            v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20,\n            v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31);\n    }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_int8x32() {}\n\n    schar get0() const { return (schar)_v_cvtsi256_si32(val); }\n};\n\nstruct v_uint16x16\n{\n    typedef ushort lane_type;\n    enum { nlanes = 16 };\n    __m256i val;\n\n    explicit v_uint16x16(__m256i v) : val(v) {}\n    v_uint16x16(ushort v0,  ushort v1,  ushort v2,  ushort v3,\n                ushort v4,  ushort v5,  ushort v6,  ushort v7,\n                ushort v8,  ushort v9,  ushort v10, ushort v11,\n                ushort v12, ushort v13, ushort v14, ushort v15)\n    {\n        val = _mm256_setr_epi16((short)v0, (short)v1, (short)v2, (short)v3,\n            (short)v4,  (short)v5,  (short)v6,  (short)v7,  (short)v8,  (short)v9,\n            (short)v10, (short)v11, (short)v12, (short)v13, (short)v14, (short)v15);\n    }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_uint16x16() {}\n\n    ushort get0() const { return (ushort)_v_cvtsi256_si32(val); }\n};\n\nstruct v_int16x16\n{\n    typedef short lane_type;\n    enum { nlanes = 16 };\n    __m256i val;\n\n    explicit v_int16x16(__m256i v) : val(v) {}\n    v_int16x16(short v0,  short v1,  short v2,  short v3,\n               short v4,  short v5,  short v6,  short v7,\n               short v8,  short v9,  short v10, short v11,\n               short v12, short v13, short v14, short v15)\n    {\n        val = _mm256_setr_epi16(v0, v1, v2, v3, v4, v5, v6, v7,\n            v8, v9, v10, v11, v12, v13, v14, v15);\n    }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_int16x16() {}\n\n    short get0() const { return (short)_v_cvtsi256_si32(val); }\n};\n\nstruct v_uint32x8\n{\n    typedef unsigned lane_type;\n    enum { nlanes = 8 };\n    __m256i val;\n\n    explicit v_uint32x8(__m256i v) : val(v) {}\n    v_uint32x8(unsigned v0, unsigned v1, unsigned v2, unsigned v3,\n               unsigned v4, unsigned v5, unsigned v6, unsigned v7)\n    {\n        val = _mm256_setr_epi32((unsigned)v0, (unsigned)v1, (unsigned)v2,\n            (unsigned)v3, (unsigned)v4, (unsigned)v5, (unsigned)v6, (unsigned)v7);\n    }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_uint32x8() {}\n\n    unsigned get0() const { return (unsigned)_v_cvtsi256_si32(val); }\n};\n\nstruct v_int32x8\n{\n    typedef int lane_type;\n    enum { nlanes = 8 };\n    __m256i val;\n\n    explicit v_int32x8(__m256i v) : val(v) {}\n    v_int32x8(int v0, int v1, int v2, int v3,\n              int v4, int v5, int v6, int v7)\n    {\n        val = _mm256_setr_epi32(v0, v1, v2, v3, v4, v5, v6, v7);\n    }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_int32x8() {}\n\n    int get0() const { return _v_cvtsi256_si32(val); }\n};\n\nstruct v_float32x8\n{\n    typedef float lane_type;\n    enum { nlanes = 8 };\n    __m256 val;\n\n    explicit v_float32x8(__m256 v) : val(v) {}\n    v_float32x8(float v0, float v1, float v2, float v3,\n                float v4, float v5, float v6, float v7)\n    {\n        val = _mm256_setr_ps(v0, v1, v2, v3, v4, v5, v6, v7);\n    }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_float32x8() {}\n\n    float get0() const { return _mm_cvtss_f32(_mm256_castps256_ps128(val)); }\n};\n\nstruct v_uint64x4\n{\n    typedef uint64 lane_type;\n    enum { nlanes = 4 };\n    __m256i val;\n\n    explicit v_uint64x4(__m256i v) : val(v) {}\n    v_uint64x4(uint64 v0, uint64 v1, uint64 v2, uint64 v3)\n    { val = _mm256_setr_epi64x((int64)v0, (int64)v1, (int64)v2, (int64)v3); }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_uint64x4() {}\n\n    uint64 get0() const\n    {\n    #if defined __x86_64__ || defined _M_X64\n        return (uint64)_mm_cvtsi128_si64(_mm256_castsi256_si128(val));\n    #else\n        int a = _mm_cvtsi128_si32(_mm256_castsi256_si128(val));\n        int b = _mm_cvtsi128_si32(_mm256_castsi256_si128(_mm256_srli_epi64(val, 32)));\n        return (unsigned)a | ((uint64)(unsigned)b << 32);\n    #endif\n    }\n};\n\nstruct v_int64x4\n{\n    typedef int64 lane_type;\n    enum { nlanes = 4 };\n    __m256i val;\n\n    explicit v_int64x4(__m256i v) : val(v) {}\n    v_int64x4(int64 v0, int64 v1, int64 v2, int64 v3)\n    { val = _mm256_setr_epi64x(v0, v1, v2, v3); }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_int64x4() {}\n\n    int64 get0() const\n    {\n    #if defined __x86_64__ || defined _M_X64\n        return (int64)_mm_cvtsi128_si64(_mm256_castsi256_si128(val));\n    #else\n        int a = _mm_cvtsi128_si32(_mm256_castsi256_si128(val));\n        int b = _mm_cvtsi128_si32(_mm256_castsi256_si128(_mm256_srli_epi64(val, 32)));\n        return (int64)((unsigned)a | ((uint64)(unsigned)b << 32));\n    #endif\n    }\n};\n\nstruct v_float64x4\n{\n    typedef double lane_type;\n    enum { nlanes = 4 };\n    __m256d val;\n\n    explicit v_float64x4(__m256d v) : val(v) {}\n    v_float64x4(double v0, double v1, double v2, double v3)\n    { val = _mm256_setr_pd(v0, v1, v2, v3); }\n    /* coverity[uninit_ctor]: suppress warning */\n    v_float64x4() {}\n\n    double get0() const { return _mm_cvtsd_f64(_mm256_castpd256_pd128(val)); }\n};\n\n//////////////// Load and store operations ///////////////\n\n#define OPENCV_HAL_IMPL_AVX_LOADSTORE(_Tpvec, _Tp)                    \\\n    inline _Tpvec v256_load(const _Tp* ptr)                           \\\n    { return _Tpvec(_mm256_loadu_si256((const __m256i*)ptr)); }       \\\n    inline _Tpvec v256_load_aligned(const _Tp* ptr)                   \\\n    { return _Tpvec(_mm256_load_si256((const __m256i*)ptr)); }        \\\n    inline _Tpvec v256_load_low(const _Tp* ptr)                       \\\n    {                                                                 \\\n        __m128i v128 = _mm_loadu_si128((const __m128i*)ptr);          \\\n        return _Tpvec(_mm256_castsi128_si256(v128));                  \\\n    }                                                                 \\\n    inline _Tpvec v256_load_halves(const _Tp* ptr0, const _Tp* ptr1)  \\\n    {                                                                 \\\n        __m128i vlo = _mm_loadu_si128((const __m128i*)ptr0);          \\\n        __m128i vhi = _mm_loadu_si128((const __m128i*)ptr1);          \\\n        return _Tpvec(_v256_combine(vlo, vhi));                       \\\n    }                                                                 \\\n    inline void v_store(_Tp* ptr, const _Tpvec& a)                    \\\n    { _mm256_storeu_si256((__m256i*)ptr, a.val); }                    \\\n    inline void v_store_aligned(_Tp* ptr, const _Tpvec& a)            \\\n    { _mm256_store_si256((__m256i*)ptr, a.val); }                     \\\n    inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a)    \\\n    { _mm256_stream_si256((__m256i*)ptr, a.val); }                    \\\n    inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \\\n    { \\\n        if( mode == hal::STORE_UNALIGNED ) \\\n            _mm256_storeu_si256((__m256i*)ptr, a.val); \\\n        else if( mode == hal::STORE_ALIGNED_NOCACHE )  \\\n            _mm256_stream_si256((__m256i*)ptr, a.val); \\\n        else \\\n            _mm256_store_si256((__m256i*)ptr, a.val); \\\n    } \\\n    inline void v_store_low(_Tp* ptr, const _Tpvec& a)                \\\n    { _mm_storeu_si128((__m128i*)ptr, _v256_extract_low(a.val)); }    \\\n    inline void v_store_high(_Tp* ptr, const _Tpvec& a)               \\\n    { _mm_storeu_si128((__m128i*)ptr, _v256_extract_high(a.val)); }\n\nOPENCV_HAL_IMPL_AVX_LOADSTORE(v_uint8x32,  uchar)\nOPENCV_HAL_IMPL_AVX_LOADSTORE(v_int8x32,   schar)\nOPENCV_HAL_IMPL_AVX_LOADSTORE(v_uint16x16, ushort)\nOPENCV_HAL_IMPL_AVX_LOADSTORE(v_int16x16,  short)\nOPENCV_HAL_IMPL_AVX_LOADSTORE(v_uint32x8,  unsigned)\nOPENCV_HAL_IMPL_AVX_LOADSTORE(v_int32x8,   int)\nOPENCV_HAL_IMPL_AVX_LOADSTORE(v_uint64x4,  uint64)\nOPENCV_HAL_IMPL_AVX_LOADSTORE(v_int64x4,   int64)\n\n#define OPENCV_HAL_IMPL_AVX_LOADSTORE_FLT(_Tpvec, _Tp, suffix, halfreg)   \\\n    inline _Tpvec v256_load(const _Tp* ptr)                               \\\n    { return _Tpvec(_mm256_loadu_##suffix(ptr)); }                        \\\n    inline _Tpvec v256_load_aligned(const _Tp* ptr)                       \\\n    { return _Tpvec(_mm256_load_##suffix(ptr)); }                         \\\n    inline _Tpvec v256_load_low(const _Tp* ptr)                           \\\n    {                                                                     \\\n        return _Tpvec(_mm256_cast##suffix##128_##suffix##256              \\\n                     (_mm_loadu_##suffix(ptr)));                          \\\n    }                                                                     \\\n    inline _Tpvec v256_load_halves(const _Tp* ptr0, const _Tp* ptr1)      \\\n    {                                                                     \\\n        halfreg vlo = _mm_loadu_##suffix(ptr0);                           \\\n        halfreg vhi = _mm_loadu_##suffix(ptr1);                           \\\n        return _Tpvec(_v256_combine(vlo, vhi));                           \\\n    }                                                                     \\\n    inline void v_store(_Tp* ptr, const _Tpvec& a)                        \\\n    { _mm256_storeu_##suffix(ptr, a.val); }                               \\\n    inline void v_store_aligned(_Tp* ptr, const _Tpvec& a)                \\\n    { _mm256_store_##suffix(ptr, a.val); }                                \\\n    inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a)        \\\n    { _mm256_stream_##suffix(ptr, a.val); }                               \\\n    inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \\\n    { \\\n        if( mode == hal::STORE_UNALIGNED ) \\\n            _mm256_storeu_##suffix(ptr, a.val); \\\n        else if( mode == hal::STORE_ALIGNED_NOCACHE )  \\\n            _mm256_stream_##suffix(ptr, a.val); \\\n        else \\\n            _mm256_store_##suffix(ptr, a.val); \\\n    } \\\n    inline void v_store_low(_Tp* ptr, const _Tpvec& a)                    \\\n    { _mm_storeu_##suffix(ptr, _v256_extract_low(a.val)); }               \\\n    inline void v_store_high(_Tp* ptr, const _Tpvec& a)                   \\\n    { _mm_storeu_##suffix(ptr, _v256_extract_high(a.val)); }\n\nOPENCV_HAL_IMPL_AVX_LOADSTORE_FLT(v_float32x8, float,  ps, __m128)\nOPENCV_HAL_IMPL_AVX_LOADSTORE_FLT(v_float64x4, double, pd, __m128d)\n\n#define OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, _Tpvecf, suffix, cast) \\\n    inline _Tpvec v_reinterpret_as_##suffix(const _Tpvecf& a)   \\\n    { return _Tpvec(cast(a.val)); }\n\n#define OPENCV_HAL_IMPL_AVX_INIT(_Tpvec, _Tp, suffix, ssuffix, ctype_s)          \\\n    inline _Tpvec v256_setzero_##suffix()                                        \\\n    { return _Tpvec(_mm256_setzero_si256()); }                                   \\\n    inline _Tpvec v256_setall_##suffix(_Tp v)                                    \\\n    { return _Tpvec(_mm256_set1_##ssuffix((ctype_s)v)); }                        \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_uint8x32,  suffix, OPENCV_HAL_NOP)        \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_int8x32,   suffix, OPENCV_HAL_NOP)        \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_uint16x16, suffix, OPENCV_HAL_NOP)        \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_int16x16,  suffix, OPENCV_HAL_NOP)        \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_uint32x8,  suffix, OPENCV_HAL_NOP)        \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_int32x8,   suffix, OPENCV_HAL_NOP)        \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_uint64x4,  suffix, OPENCV_HAL_NOP)        \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_int64x4,   suffix, OPENCV_HAL_NOP)        \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_float32x8, suffix, _mm256_castps_si256)   \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_float64x4, suffix, _mm256_castpd_si256)\n\nOPENCV_HAL_IMPL_AVX_INIT(v_uint8x32,  uchar,    u8,  epi8,   char)\nOPENCV_HAL_IMPL_AVX_INIT(v_int8x32,   schar,    s8,  epi8,   char)\nOPENCV_HAL_IMPL_AVX_INIT(v_uint16x16, ushort,   u16, epi16,  short)\nOPENCV_HAL_IMPL_AVX_INIT(v_int16x16,  short,    s16, epi16,  short)\nOPENCV_HAL_IMPL_AVX_INIT(v_uint32x8,  unsigned, u32, epi32,  int)\nOPENCV_HAL_IMPL_AVX_INIT(v_int32x8,   int,      s32, epi32,  int)\nOPENCV_HAL_IMPL_AVX_INIT(v_uint64x4,  uint64,   u64, epi64x, int64)\nOPENCV_HAL_IMPL_AVX_INIT(v_int64x4,   int64,    s64, epi64x, int64)\n\n#define OPENCV_HAL_IMPL_AVX_INIT_FLT(_Tpvec, _Tp, suffix, zsuffix, cast) \\\n    inline _Tpvec v256_setzero_##suffix()                                \\\n    { return _Tpvec(_mm256_setzero_##zsuffix()); }                       \\\n    inline _Tpvec v256_setall_##suffix(_Tp v)                            \\\n    { return _Tpvec(_mm256_set1_##zsuffix(v)); }                         \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_uint8x32,  suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_int8x32,   suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_uint16x16, suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_int16x16,  suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_uint32x8,  suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_int32x8,   suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_uint64x4,  suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX_CAST(_Tpvec, v_int64x4,   suffix, cast)\n\nOPENCV_HAL_IMPL_AVX_INIT_FLT(v_float32x8, float,  f32, ps, _mm256_castsi256_ps)\nOPENCV_HAL_IMPL_AVX_INIT_FLT(v_float64x4, double, f64, pd, _mm256_castsi256_pd)\n\ninline v_float32x8 v_reinterpret_as_f32(const v_float32x8& a)\n{ return a; }\ninline v_float32x8 v_reinterpret_as_f32(const v_float64x4& a)\n{ return v_float32x8(_mm256_castpd_ps(a.val)); }\n\ninline v_float64x4 v_reinterpret_as_f64(const v_float64x4& a)\n{ return a; }\ninline v_float64x4 v_reinterpret_as_f64(const v_float32x8& a)\n{ return v_float64x4(_mm256_castps_pd(a.val)); }\n\n/* Recombine */\n/*#define OPENCV_HAL_IMPL_AVX_COMBINE(_Tpvec, perm)                    \\\n    inline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b)    \\\n    { return _Tpvec(perm(a.val, b.val, 0x20)); }                     \\\n    inline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b)   \\\n    { return _Tpvec(perm(a.val, b.val, 0x31)); }                     \\\n    inline void v_recombine(const _Tpvec& a, const _Tpvec& b,        \\\n                             _Tpvec& c, _Tpvec& d)                   \\\n    { c = v_combine_low(a, b); d = v_combine_high(a, b); }\n\n#define OPENCV_HAL_IMPL_AVX_UNPACKS(_Tpvec, suffix)                  \\\n    OPENCV_HAL_IMPL_AVX_COMBINE(_Tpvec, _mm256_permute2x128_si256)   \\\n    inline void v_zip(const _Tpvec& a0, const _Tpvec& a1,            \\\n                             _Tpvec& b0, _Tpvec& b1)                 \\\n    {                                                                \\\n        __m256i v0 = _v256_shuffle_odd_64(a0.val);                   \\\n        __m256i v1 = _v256_shuffle_odd_64(a1.val);                   \\\n        b0.val = _mm256_unpacklo_##suffix(v0, v1);                   \\\n        b1.val = _mm256_unpackhi_##suffix(v0, v1);                   \\\n    }\n\nOPENCV_HAL_IMPL_AVX_UNPACKS(v_uint8x32,  epi8)\nOPENCV_HAL_IMPL_AVX_UNPACKS(v_int8x32,   epi8)\nOPENCV_HAL_IMPL_AVX_UNPACKS(v_uint16x16, epi16)\nOPENCV_HAL_IMPL_AVX_UNPACKS(v_int16x16,  epi16)\nOPENCV_HAL_IMPL_AVX_UNPACKS(v_uint32x8,  epi32)\nOPENCV_HAL_IMPL_AVX_UNPACKS(v_int32x8,   epi32)\nOPENCV_HAL_IMPL_AVX_UNPACKS(v_uint64x4,  epi64)\nOPENCV_HAL_IMPL_AVX_UNPACKS(v_int64x4,   epi64)\nOPENCV_HAL_IMPL_AVX_COMBINE(v_float32x8, _mm256_permute2f128_ps)\nOPENCV_HAL_IMPL_AVX_COMBINE(v_float64x4, _mm256_permute2f128_pd)\n\ninline void v_zip(const v_float32x8& a0, const v_float32x8& a1, v_float32x8& b0, v_float32x8& b1)\n{\n    __m256 v0 = _mm256_unpacklo_ps(a0.val, a1.val);\n    __m256 v1 = _mm256_unpackhi_ps(a0.val, a1.val);\n    v_recombine(v_float32x8(v0), v_float32x8(v1), b0, b1);\n}\n\ninline void v_zip(const v_float64x4& a0, const v_float64x4& a1, v_float64x4& b0, v_float64x4& b1)\n{\n    __m256d v0 = _v_shuffle_odd_64(a0.val);\n    __m256d v1 = _v_shuffle_odd_64(a1.val);\n    b0.val = _mm256_unpacklo_pd(v0, v1);\n    b1.val = _mm256_unpackhi_pd(v0, v1);\n}*/\n\n//////////////// Variant Value reordering ///////////////\n\n// unpacks\n#define OPENCV_HAL_IMPL_AVX_UNPACK(_Tpvec, suffix)                 \\\n    inline _Tpvec v256_unpacklo(const _Tpvec& a, const _Tpvec& b)  \\\n    { return _Tpvec(_mm256_unpacklo_##suffix(a.val, b.val)); }     \\\n    inline _Tpvec v256_unpackhi(const _Tpvec& a, const _Tpvec& b)  \\\n    { return _Tpvec(_mm256_unpackhi_##suffix(a.val, b.val)); }\n\nOPENCV_HAL_IMPL_AVX_UNPACK(v_uint8x32,  epi8)\nOPENCV_HAL_IMPL_AVX_UNPACK(v_int8x32,   epi8)\nOPENCV_HAL_IMPL_AVX_UNPACK(v_uint16x16, epi16)\nOPENCV_HAL_IMPL_AVX_UNPACK(v_int16x16,  epi16)\nOPENCV_HAL_IMPL_AVX_UNPACK(v_uint32x8,  epi32)\nOPENCV_HAL_IMPL_AVX_UNPACK(v_int32x8,   epi32)\nOPENCV_HAL_IMPL_AVX_UNPACK(v_uint64x4,  epi64)\nOPENCV_HAL_IMPL_AVX_UNPACK(v_int64x4,   epi64)\nOPENCV_HAL_IMPL_AVX_UNPACK(v_float32x8, ps)\nOPENCV_HAL_IMPL_AVX_UNPACK(v_float64x4, pd)\n\n// blend\n#define OPENCV_HAL_IMPL_AVX_BLEND(_Tpvec, suffix)               \\\n    template<int m>                                             \\\n    inline _Tpvec v256_blend(const _Tpvec& a, const _Tpvec& b)  \\\n    { return _Tpvec(_mm256_blend_##suffix(a.val, b.val, m)); }\n\nOPENCV_HAL_IMPL_AVX_BLEND(v_uint16x16, epi16)\nOPENCV_HAL_IMPL_AVX_BLEND(v_int16x16,  epi16)\nOPENCV_HAL_IMPL_AVX_BLEND(v_uint32x8,  epi32)\nOPENCV_HAL_IMPL_AVX_BLEND(v_int32x8,   epi32)\nOPENCV_HAL_IMPL_AVX_BLEND(v_float32x8, ps)\nOPENCV_HAL_IMPL_AVX_BLEND(v_float64x4, pd)\n\ntemplate<int m>\ninline v_uint64x4 v256_blend(const v_uint64x4& a, const v_uint64x4& b)\n{\n    enum {M0 = m};\n    enum {M1 = (M0 | (M0 << 2)) & 0x33};\n    enum {M2 = (M1 | (M1 << 1)) & 0x55};\n    enum {MM =  M2 | (M2 << 1)};\n    return v_uint64x4(_mm256_blend_epi32(a.val, b.val, MM));\n}\ntemplate<int m>\ninline v_int64x4 v256_blend(const v_int64x4& a, const v_int64x4& b)\n{ return v_int64x4(v256_blend<m>(v_uint64x4(a.val), v_uint64x4(b.val)).val); }\n\n// shuffle\n// todo: emulate 64bit\n#define OPENCV_HAL_IMPL_AVX_SHUFFLE(_Tpvec, intrin)  \\\n    template<int m>                                  \\\n    inline _Tpvec v256_shuffle(const _Tpvec& a)      \\\n    { return _Tpvec(_mm256_##intrin(a.val, m)); }\n\nOPENCV_HAL_IMPL_AVX_SHUFFLE(v_uint32x8,  shuffle_epi32)\nOPENCV_HAL_IMPL_AVX_SHUFFLE(v_int32x8,   shuffle_epi32)\nOPENCV_HAL_IMPL_AVX_SHUFFLE(v_float32x8, permute_ps)\nOPENCV_HAL_IMPL_AVX_SHUFFLE(v_float64x4, permute_pd)\n\ntemplate<typename _Tpvec>\ninline void v256_zip(const _Tpvec& a, const _Tpvec& b, _Tpvec& ab0, _Tpvec& ab1)\n{\n    ab0 = v256_unpacklo(a, b);\n    ab1 = v256_unpackhi(a, b);\n}\n\ntemplate<typename _Tpvec>\ninline _Tpvec v256_combine_diagonal(const _Tpvec& a, const _Tpvec& b)\n{ return _Tpvec(_mm256_blend_epi32(a.val, b.val, 0xf0)); }\n\ninline v_float32x8 v256_combine_diagonal(const v_float32x8& a, const v_float32x8& b)\n{ return v256_blend<0xf0>(a, b); }\n\ninline v_float64x4 v256_combine_diagonal(const v_float64x4& a, const v_float64x4& b)\n{ return v256_blend<0xc>(a, b); }\n\ntemplate<typename _Tpvec>\ninline _Tpvec v256_alignr_128(const _Tpvec& a, const _Tpvec& b)\n{ return v256_permute2x128<0x21>(a, b); }\n\ntemplate<typename _Tpvec>\ninline _Tpvec v256_alignr_64(const _Tpvec& a, const _Tpvec& b)\n{ return _Tpvec(_mm256_alignr_epi8(a.val, b.val, 8)); }\ninline v_float64x4 v256_alignr_64(const v_float64x4& a, const v_float64x4& b)\n{ return v_float64x4(_mm256_shuffle_pd(b.val, a.val, _MM_SHUFFLE(0, 0, 1, 1))); }\n// todo: emulate float32\n\ntemplate<typename _Tpvec>\ninline _Tpvec v256_swap_halves(const _Tpvec& a)\n{ return v256_permute2x128<1>(a, a); }\n\ntemplate<typename _Tpvec>\ninline _Tpvec v256_reverse_64(const _Tpvec& a)\n{ return v256_permute4x64<_MM_SHUFFLE(0, 1, 2, 3)>(a); }\n\n// ZIP\n#define OPENCV_HAL_IMPL_AVX_ZIP(_Tpvec)                              \\\n    inline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b)    \\\n    { return v256_permute2x128<0x20>(a, b); }                        \\\n    inline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b)   \\\n    { return v256_permute2x128<0x31>(a, b); }                        \\\n    inline void v_recombine(const _Tpvec& a, const _Tpvec& b,        \\\n                             _Tpvec& c, _Tpvec& d)                   \\\n    {                                                                \\\n        _Tpvec a1b0 = v256_alignr_128(a, b);                         \\\n        c = v256_combine_diagonal(a, a1b0);                          \\\n        d = v256_combine_diagonal(a1b0, b);                          \\\n    }                                                                \\\n    inline void v_zip(const _Tpvec& a, const _Tpvec& b,              \\\n                      _Tpvec& ab0, _Tpvec& ab1)                      \\\n    {                                                                \\\n        _Tpvec ab0ab2, ab1ab3;                                       \\\n        v256_zip(a, b, ab0ab2, ab1ab3);                              \\\n        v_recombine(ab0ab2, ab1ab3, ab0, ab1);                       \\\n    }\n\nOPENCV_HAL_IMPL_AVX_ZIP(v_uint8x32)\nOPENCV_HAL_IMPL_AVX_ZIP(v_int8x32)\nOPENCV_HAL_IMPL_AVX_ZIP(v_uint16x16)\nOPENCV_HAL_IMPL_AVX_ZIP(v_int16x16)\nOPENCV_HAL_IMPL_AVX_ZIP(v_uint32x8)\nOPENCV_HAL_IMPL_AVX_ZIP(v_int32x8)\nOPENCV_HAL_IMPL_AVX_ZIP(v_uint64x4)\nOPENCV_HAL_IMPL_AVX_ZIP(v_int64x4)\nOPENCV_HAL_IMPL_AVX_ZIP(v_float32x8)\nOPENCV_HAL_IMPL_AVX_ZIP(v_float64x4)\n\n////////// Arithmetic, bitwise and comparison operations /////////\n\n/* Element-wise binary and unary operations */\n\n/** Arithmetics **/\n#define OPENCV_HAL_IMPL_AVX_BIN_OP(bin_op, _Tpvec, intrin)            \\\n    inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b)  \\\n    { return _Tpvec(intrin(a.val, b.val)); }                          \\\n    inline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b)    \\\n    { a.val = intrin(a.val, b.val); return a; }\n\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_uint8x32,  _mm256_adds_epu8)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_uint8x32,  _mm256_subs_epu8)\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_int8x32,   _mm256_adds_epi8)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_int8x32,   _mm256_subs_epi8)\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_uint16x16, _mm256_adds_epu16)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_uint16x16, _mm256_subs_epu16)\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_int16x16,  _mm256_adds_epi16)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_int16x16,  _mm256_subs_epi16)\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_uint32x8,  _mm256_add_epi32)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_uint32x8,  _mm256_sub_epi32)\nOPENCV_HAL_IMPL_AVX_BIN_OP(*, v_uint32x8,  _mm256_mullo_epi32)\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_int32x8,   _mm256_add_epi32)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_int32x8,   _mm256_sub_epi32)\nOPENCV_HAL_IMPL_AVX_BIN_OP(*, v_int32x8,   _mm256_mullo_epi32)\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_uint64x4,  _mm256_add_epi64)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_uint64x4,  _mm256_sub_epi64)\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_int64x4,   _mm256_add_epi64)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_int64x4,   _mm256_sub_epi64)\n\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_float32x8, _mm256_add_ps)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_float32x8, _mm256_sub_ps)\nOPENCV_HAL_IMPL_AVX_BIN_OP(*, v_float32x8, _mm256_mul_ps)\nOPENCV_HAL_IMPL_AVX_BIN_OP(/, v_float32x8, _mm256_div_ps)\nOPENCV_HAL_IMPL_AVX_BIN_OP(+, v_float64x4, _mm256_add_pd)\nOPENCV_HAL_IMPL_AVX_BIN_OP(-, v_float64x4, _mm256_sub_pd)\nOPENCV_HAL_IMPL_AVX_BIN_OP(*, v_float64x4, _mm256_mul_pd)\nOPENCV_HAL_IMPL_AVX_BIN_OP(/, v_float64x4, _mm256_div_pd)\n\n// saturating multiply 8-bit, 16-bit\ninline v_uint8x32 operator * (const v_uint8x32& a, const v_uint8x32& b)\n{\n    v_uint16x16 c, d;\n    v_mul_expand(a, b, c, d);\n    return v_pack(c, d);\n}\ninline v_int8x32 operator * (const v_int8x32& a, const v_int8x32& b)\n{\n    v_int16x16 c, d;\n    v_mul_expand(a, b, c, d);\n    return v_pack(c, d);\n}\ninline v_uint16x16 operator * (const v_uint16x16& a, const v_uint16x16& b)\n{\n    __m256i pl = _mm256_mullo_epi16(a.val, b.val);\n    __m256i ph = _mm256_mulhi_epu16(a.val, b.val);\n    __m256i p0 = _mm256_unpacklo_epi16(pl, ph);\n    __m256i p1 = _mm256_unpackhi_epi16(pl, ph);\n    return v_uint16x16(_v256_packs_epu32(p0, p1));\n}\ninline v_int16x16 operator * (const v_int16x16& a, const v_int16x16& b)\n{\n    __m256i pl = _mm256_mullo_epi16(a.val, b.val);\n    __m256i ph = _mm256_mulhi_epi16(a.val, b.val);\n    __m256i p0 = _mm256_unpacklo_epi16(pl, ph);\n    __m256i p1 = _mm256_unpackhi_epi16(pl, ph);\n    return v_int16x16(_mm256_packs_epi32(p0, p1));\n}\ninline v_uint8x32& operator *= (v_uint8x32& a, const v_uint8x32& b)\n{ a = a * b; return a; }\ninline v_int8x32& operator *= (v_int8x32& a, const v_int8x32& b)\n{ a = a * b; return a; }\ninline v_uint16x16& operator *= (v_uint16x16& a, const v_uint16x16& b)\n{ a = a * b; return a; }\ninline v_int16x16& operator *= (v_int16x16& a, const v_int16x16& b)\n{ a = a * b; return a; }\n\n/** Non-saturating arithmetics **/\n#define OPENCV_HAL_IMPL_AVX_BIN_FUNC(func, _Tpvec, intrin) \\\n    inline _Tpvec func(const _Tpvec& a, const _Tpvec& b)   \\\n    { return _Tpvec(intrin(a.val, b.val)); }\n\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_add_wrap, v_uint8x32,  _mm256_add_epi8)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_add_wrap, v_int8x32,   _mm256_add_epi8)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_add_wrap, v_uint16x16, _mm256_add_epi16)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_add_wrap, v_int16x16,  _mm256_add_epi16)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_sub_wrap, v_uint8x32,  _mm256_sub_epi8)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_sub_wrap, v_int8x32,   _mm256_sub_epi8)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_sub_wrap, v_uint16x16, _mm256_sub_epi16)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_sub_wrap, v_int16x16,  _mm256_sub_epi16)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_mul_wrap, v_uint16x16, _mm256_mullo_epi16)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_mul_wrap, v_int16x16,  _mm256_mullo_epi16)\n\ninline v_uint8x32 v_mul_wrap(const v_uint8x32& a, const v_uint8x32& b)\n{\n    __m256i ad = _mm256_srai_epi16(a.val, 8);\n    __m256i bd = _mm256_srai_epi16(b.val, 8);\n    __m256i p0 = _mm256_mullo_epi16(a.val, b.val); // even\n    __m256i p1 = _mm256_slli_epi16(_mm256_mullo_epi16(ad, bd), 8); // odd\n\n    const __m256i b01 = _mm256_set1_epi32(0xFF00FF00);\n    return v_uint8x32(_mm256_blendv_epi8(p0, p1, b01));\n}\ninline v_int8x32 v_mul_wrap(const v_int8x32& a, const v_int8x32& b)\n{\n    return v_reinterpret_as_s8(v_mul_wrap(v_reinterpret_as_u8(a), v_reinterpret_as_u8(b)));\n}\n\n//  Multiply and expand\ninline void v_mul_expand(const v_uint8x32& a, const v_uint8x32& b,\n                         v_uint16x16& c, v_uint16x16& d)\n{\n    v_uint16x16 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c = v_mul_wrap(a0, b0);\n    d = v_mul_wrap(a1, b1);\n}\n\ninline void v_mul_expand(const v_int8x32& a, const v_int8x32& b,\n                         v_int16x16& c, v_int16x16& d)\n{\n    v_int16x16 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c = v_mul_wrap(a0, b0);\n    d = v_mul_wrap(a1, b1);\n}\n\ninline void v_mul_expand(const v_int16x16& a, const v_int16x16& b,\n                         v_int32x8& c, v_int32x8& d)\n{\n    v_int16x16 vhi = v_int16x16(_mm256_mulhi_epi16(a.val, b.val));\n\n    v_int16x16 v0, v1;\n    v_zip(v_mul_wrap(a, b), vhi, v0, v1);\n\n    c = v_reinterpret_as_s32(v0);\n    d = v_reinterpret_as_s32(v1);\n}\n\ninline void v_mul_expand(const v_uint16x16& a, const v_uint16x16& b,\n                         v_uint32x8& c, v_uint32x8& d)\n{\n    v_uint16x16 vhi = v_uint16x16(_mm256_mulhi_epu16(a.val, b.val));\n\n    v_uint16x16 v0, v1;\n    v_zip(v_mul_wrap(a, b), vhi, v0, v1);\n\n    c = v_reinterpret_as_u32(v0);\n    d = v_reinterpret_as_u32(v1);\n}\n\ninline void v_mul_expand(const v_uint32x8& a, const v_uint32x8& b,\n                         v_uint64x4& c, v_uint64x4& d)\n{\n    __m256i v0 = _mm256_mul_epu32(a.val, b.val);\n    __m256i v1 = _mm256_mul_epu32(_mm256_srli_epi64(a.val, 32), _mm256_srli_epi64(b.val, 32));\n    v_zip(v_uint64x4(v0), v_uint64x4(v1), c, d);\n}\n\ninline v_int16x16 v_mul_hi(const v_int16x16& a, const v_int16x16& b) { return v_int16x16(_mm256_mulhi_epi16(a.val, b.val)); }\ninline v_uint16x16 v_mul_hi(const v_uint16x16& a, const v_uint16x16& b) { return v_uint16x16(_mm256_mulhi_epu16(a.val, b.val)); }\n\n/** Bitwise shifts **/\n#define OPENCV_HAL_IMPL_AVX_SHIFT_OP(_Tpuvec, _Tpsvec, suffix, srai)  \\\n    inline _Tpuvec operator << (const _Tpuvec& a, int imm)            \\\n    { return _Tpuvec(_mm256_slli_##suffix(a.val, imm)); }             \\\n    inline _Tpsvec operator << (const _Tpsvec& a, int imm)            \\\n    { return _Tpsvec(_mm256_slli_##suffix(a.val, imm)); }             \\\n    inline _Tpuvec operator >> (const _Tpuvec& a, int imm)            \\\n    { return _Tpuvec(_mm256_srli_##suffix(a.val, imm)); }             \\\n    inline _Tpsvec operator >> (const _Tpsvec& a, int imm)            \\\n    { return _Tpsvec(srai(a.val, imm)); }                             \\\n    template<int imm>                                                 \\\n    inline _Tpuvec v_shl(const _Tpuvec& a)                            \\\n    { return _Tpuvec(_mm256_slli_##suffix(a.val, imm)); }             \\\n    template<int imm>                                                 \\\n    inline _Tpsvec v_shl(const _Tpsvec& a)                            \\\n    { return _Tpsvec(_mm256_slli_##suffix(a.val, imm)); }             \\\n    template<int imm>                                                 \\\n    inline _Tpuvec v_shr(const _Tpuvec& a)                            \\\n    { return _Tpuvec(_mm256_srli_##suffix(a.val, imm)); }             \\\n    template<int imm>                                                 \\\n    inline _Tpsvec v_shr(const _Tpsvec& a)                            \\\n    { return _Tpsvec(srai(a.val, imm)); }\n\nOPENCV_HAL_IMPL_AVX_SHIFT_OP(v_uint16x16, v_int16x16, epi16, _mm256_srai_epi16)\nOPENCV_HAL_IMPL_AVX_SHIFT_OP(v_uint32x8,  v_int32x8,  epi32, _mm256_srai_epi32)\n\ninline __m256i _mm256_srai_epi64xx(const __m256i a, int imm)\n{\n    __m256i d = _mm256_set1_epi64x((int64)1 << 63);\n    __m256i r = _mm256_srli_epi64(_mm256_add_epi64(a, d), imm);\n    return _mm256_sub_epi64(r, _mm256_srli_epi64(d, imm));\n}\nOPENCV_HAL_IMPL_AVX_SHIFT_OP(v_uint64x4,  v_int64x4,  epi64, _mm256_srai_epi64xx)\n\n\n/** Bitwise logic **/\n#define OPENCV_HAL_IMPL_AVX_LOGIC_OP(_Tpvec, suffix, not_const)  \\\n    OPENCV_HAL_IMPL_AVX_BIN_OP(&, _Tpvec, _mm256_and_##suffix)   \\\n    OPENCV_HAL_IMPL_AVX_BIN_OP(|, _Tpvec, _mm256_or_##suffix)    \\\n    OPENCV_HAL_IMPL_AVX_BIN_OP(^, _Tpvec, _mm256_xor_##suffix)   \\\n    inline _Tpvec operator ~ (const _Tpvec& a)                   \\\n    { return _Tpvec(_mm256_xor_##suffix(a.val, not_const)); }\n\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_uint8x32,   si256, _mm256_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_int8x32,    si256, _mm256_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_uint16x16,  si256, _mm256_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_int16x16,   si256, _mm256_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_uint32x8,   si256, _mm256_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_int32x8,    si256, _mm256_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_uint64x4,   si256, _mm256_set1_epi64x(-1))\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_int64x4,    si256, _mm256_set1_epi64x(-1))\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_float32x8,  ps,    _mm256_castsi256_ps(_mm256_set1_epi32(-1)))\nOPENCV_HAL_IMPL_AVX_LOGIC_OP(v_float64x4,  pd,    _mm256_castsi256_pd(_mm256_set1_epi32(-1)))\n\n/** Select **/\n#define OPENCV_HAL_IMPL_AVX_SELECT(_Tpvec, suffix)                               \\\n    inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n    { return _Tpvec(_mm256_blendv_##suffix(b.val, a.val, mask.val)); }\n\nOPENCV_HAL_IMPL_AVX_SELECT(v_uint8x32,  epi8)\nOPENCV_HAL_IMPL_AVX_SELECT(v_int8x32,   epi8)\nOPENCV_HAL_IMPL_AVX_SELECT(v_uint16x16, epi8)\nOPENCV_HAL_IMPL_AVX_SELECT(v_int16x16,  epi8)\nOPENCV_HAL_IMPL_AVX_SELECT(v_uint32x8,  epi8)\nOPENCV_HAL_IMPL_AVX_SELECT(v_int32x8,   epi8)\nOPENCV_HAL_IMPL_AVX_SELECT(v_float32x8, ps)\nOPENCV_HAL_IMPL_AVX_SELECT(v_float64x4, pd)\n\n/** Comparison **/\n#define OPENCV_HAL_IMPL_AVX_CMP_OP_OV(_Tpvec)                     \\\n    inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b)  \\\n    { return ~(a == b); }                                         \\\n    inline _Tpvec operator <  (const _Tpvec& a, const _Tpvec& b)  \\\n    { return b > a; }                                             \\\n    inline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b)  \\\n    { return ~(a < b); }                                          \\\n    inline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b)  \\\n    { return b >= a; }\n\n#define OPENCV_HAL_IMPL_AVX_CMP_OP_INT(_Tpuvec, _Tpsvec, suffix, sbit)   \\\n    inline _Tpuvec operator == (const _Tpuvec& a, const _Tpuvec& b)      \\\n    { return _Tpuvec(_mm256_cmpeq_##suffix(a.val, b.val)); }             \\\n    inline _Tpuvec operator > (const _Tpuvec& a, const _Tpuvec& b)       \\\n    {                                                                    \\\n        __m256i smask = _mm256_set1_##suffix(sbit);                      \\\n        return _Tpuvec(_mm256_cmpgt_##suffix(                            \\\n                       _mm256_xor_si256(a.val, smask),                   \\\n                       _mm256_xor_si256(b.val, smask)));                 \\\n    }                                                                    \\\n    inline _Tpsvec operator == (const _Tpsvec& a, const _Tpsvec& b)      \\\n    { return _Tpsvec(_mm256_cmpeq_##suffix(a.val, b.val)); }             \\\n    inline _Tpsvec operator > (const _Tpsvec& a, const _Tpsvec& b)       \\\n    { return _Tpsvec(_mm256_cmpgt_##suffix(a.val, b.val)); }             \\\n    OPENCV_HAL_IMPL_AVX_CMP_OP_OV(_Tpuvec)                               \\\n    OPENCV_HAL_IMPL_AVX_CMP_OP_OV(_Tpsvec)\n\nOPENCV_HAL_IMPL_AVX_CMP_OP_INT(v_uint8x32,  v_int8x32,  epi8,  (char)-128)\nOPENCV_HAL_IMPL_AVX_CMP_OP_INT(v_uint16x16, v_int16x16, epi16, (short)-32768)\nOPENCV_HAL_IMPL_AVX_CMP_OP_INT(v_uint32x8,  v_int32x8,  epi32, (int)0x80000000)\n\n#define OPENCV_HAL_IMPL_AVX_CMP_OP_64BIT(_Tpvec)                 \\\n    inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \\\n    { return _Tpvec(_mm256_cmpeq_epi64(a.val, b.val)); }         \\\n    inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \\\n    { return ~(a == b); }\n\nOPENCV_HAL_IMPL_AVX_CMP_OP_64BIT(v_uint64x4)\nOPENCV_HAL_IMPL_AVX_CMP_OP_64BIT(v_int64x4)\n\n#define OPENCV_HAL_IMPL_AVX_CMP_FLT(bin_op, imm8, _Tpvec, suffix)    \\\n    inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \\\n    { return _Tpvec(_mm256_cmp_##suffix(a.val, b.val, imm8)); }\n\n#define OPENCV_HAL_IMPL_AVX_CMP_OP_FLT(_Tpvec, suffix)               \\\n    OPENCV_HAL_IMPL_AVX_CMP_FLT(==, _CMP_EQ_OQ,  _Tpvec, suffix)     \\\n    OPENCV_HAL_IMPL_AVX_CMP_FLT(!=, _CMP_NEQ_OQ, _Tpvec, suffix)     \\\n    OPENCV_HAL_IMPL_AVX_CMP_FLT(<,  _CMP_LT_OQ,  _Tpvec, suffix)     \\\n    OPENCV_HAL_IMPL_AVX_CMP_FLT(>,  _CMP_GT_OQ,  _Tpvec, suffix)     \\\n    OPENCV_HAL_IMPL_AVX_CMP_FLT(<=, _CMP_LE_OQ,  _Tpvec, suffix)     \\\n    OPENCV_HAL_IMPL_AVX_CMP_FLT(>=, _CMP_GE_OQ,  _Tpvec, suffix)\n\nOPENCV_HAL_IMPL_AVX_CMP_OP_FLT(v_float32x8, ps)\nOPENCV_HAL_IMPL_AVX_CMP_OP_FLT(v_float64x4, pd)\n\ninline v_float32x8 v_not_nan(const v_float32x8& a)\n{ return v_float32x8(_mm256_cmp_ps(a.val, a.val, _CMP_ORD_Q)); }\ninline v_float64x4 v_not_nan(const v_float64x4& a)\n{ return v_float64x4(_mm256_cmp_pd(a.val, a.val, _CMP_ORD_Q)); }\n\n/** min/max **/\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_min, v_uint8x32,  _mm256_min_epu8)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_max, v_uint8x32,  _mm256_max_epu8)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_min, v_int8x32,   _mm256_min_epi8)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_max, v_int8x32,   _mm256_max_epi8)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_min, v_uint16x16, _mm256_min_epu16)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_max, v_uint16x16, _mm256_max_epu16)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_min, v_int16x16,  _mm256_min_epi16)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_max, v_int16x16,  _mm256_max_epi16)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_min, v_uint32x8,  _mm256_min_epu32)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_max, v_uint32x8,  _mm256_max_epu32)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_min, v_int32x8,   _mm256_min_epi32)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_max, v_int32x8,   _mm256_max_epi32)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_min, v_float32x8, _mm256_min_ps)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_max, v_float32x8, _mm256_max_ps)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_min, v_float64x4, _mm256_min_pd)\nOPENCV_HAL_IMPL_AVX_BIN_FUNC(v_max, v_float64x4, _mm256_max_pd)\n\n/** Rotate **/\ntemplate<int imm>\ninline v_uint8x32 v_rotate_left(const v_uint8x32& a, const v_uint8x32& b)\n{\n    enum {IMM_R = (16 - imm) & 0xFF};\n    enum {IMM_R2 = (32 - imm) & 0xFF};\n\n    if (imm == 0)  return a;\n    if (imm == 32) return b;\n    if (imm > 32)  return v_uint8x32();\n\n    __m256i swap = _mm256_permute2x128_si256(a.val, b.val, 0x03);\n    if (imm == 16) return v_uint8x32(swap);\n    if (imm < 16)  return v_uint8x32(_mm256_alignr_epi8(a.val, swap, IMM_R));\n    return v_uint8x32(_mm256_alignr_epi8(swap, b.val, IMM_R2)); // imm < 32\n}\n\ntemplate<int imm>\ninline v_uint8x32 v_rotate_right(const v_uint8x32& a, const v_uint8x32& b)\n{\n    enum {IMM_L = (imm - 16) & 0xFF};\n\n    if (imm == 0)  return a;\n    if (imm == 32) return b;\n    if (imm > 32)  return v_uint8x32();\n\n    __m256i swap = _mm256_permute2x128_si256(a.val, b.val, 0x21);\n    if (imm == 16) return v_uint8x32(swap);\n    if (imm < 16)  return v_uint8x32(_mm256_alignr_epi8(swap, a.val, imm));\n    return v_uint8x32(_mm256_alignr_epi8(b.val, swap, IMM_L));\n}\n\ntemplate<int imm>\ninline v_uint8x32 v_rotate_left(const v_uint8x32& a)\n{\n    enum {IMM_L = (imm - 16) & 0xFF};\n    enum {IMM_R = (16 - imm) & 0xFF};\n\n    if (imm == 0) return a;\n    if (imm > 32) return v_uint8x32();\n\n    // ESAC control[3] ? [127:0] = 0\n    __m256i swapz = _mm256_permute2x128_si256(a.val, a.val, _MM_SHUFFLE(0, 0, 2, 0));\n    if (imm == 16) return v_uint8x32(swapz);\n    if (imm < 16)  return v_uint8x32(_mm256_alignr_epi8(a.val, swapz, IMM_R));\n    return v_uint8x32(_mm256_slli_si256(swapz, IMM_L));\n}\n\ntemplate<int imm>\ninline v_uint8x32 v_rotate_right(const v_uint8x32& a)\n{\n    enum {IMM_L = (imm - 16) & 0xFF};\n\n    if (imm == 0) return a;\n    if (imm > 32) return v_uint8x32();\n\n    // ESAC control[3] ? [127:0] = 0\n    __m256i swapz = _mm256_permute2x128_si256(a.val, a.val, _MM_SHUFFLE(2, 0, 0, 1));\n    if (imm == 16) return v_uint8x32(swapz);\n    if (imm < 16)  return v_uint8x32(_mm256_alignr_epi8(swapz, a.val, imm));\n    return v_uint8x32(_mm256_srli_si256(swapz, IMM_L));\n}\n\n#define OPENCV_HAL_IMPL_AVX_ROTATE_CAST(intrin, _Tpvec, cast)     \\\n    template<int imm>                                             \\\n    inline _Tpvec intrin(const _Tpvec& a, const _Tpvec& b)        \\\n    {                                                             \\\n        enum {IMMxW = imm * sizeof(typename _Tpvec::lane_type)};  \\\n        v_uint8x32 ret = intrin<IMMxW>(v_reinterpret_as_u8(a),    \\\n                                       v_reinterpret_as_u8(b));   \\\n        return _Tpvec(cast(ret.val));                             \\\n    }                                                             \\\n    template<int imm>                                             \\\n    inline _Tpvec intrin(const _Tpvec& a)                         \\\n    {                                                             \\\n        enum {IMMxW = imm * sizeof(typename _Tpvec::lane_type)};  \\\n        v_uint8x32 ret = intrin<IMMxW>(v_reinterpret_as_u8(a));   \\\n        return _Tpvec(cast(ret.val));                             \\\n    }\n\n#define OPENCV_HAL_IMPL_AVX_ROTATE(_Tpvec)                                  \\\n    OPENCV_HAL_IMPL_AVX_ROTATE_CAST(v_rotate_left,  _Tpvec, OPENCV_HAL_NOP) \\\n    OPENCV_HAL_IMPL_AVX_ROTATE_CAST(v_rotate_right, _Tpvec, OPENCV_HAL_NOP)\n\nOPENCV_HAL_IMPL_AVX_ROTATE(v_int8x32)\nOPENCV_HAL_IMPL_AVX_ROTATE(v_uint16x16)\nOPENCV_HAL_IMPL_AVX_ROTATE(v_int16x16)\nOPENCV_HAL_IMPL_AVX_ROTATE(v_uint32x8)\nOPENCV_HAL_IMPL_AVX_ROTATE(v_int32x8)\nOPENCV_HAL_IMPL_AVX_ROTATE(v_uint64x4)\nOPENCV_HAL_IMPL_AVX_ROTATE(v_int64x4)\n\nOPENCV_HAL_IMPL_AVX_ROTATE_CAST(v_rotate_left,  v_float32x8, _mm256_castsi256_ps)\nOPENCV_HAL_IMPL_AVX_ROTATE_CAST(v_rotate_right, v_float32x8, _mm256_castsi256_ps)\nOPENCV_HAL_IMPL_AVX_ROTATE_CAST(v_rotate_left,  v_float64x4, _mm256_castsi256_pd)\nOPENCV_HAL_IMPL_AVX_ROTATE_CAST(v_rotate_right, v_float64x4, _mm256_castsi256_pd)\n\n/** Reverse **/\ninline v_uint8x32 v_reverse(const v_uint8x32 &a)\n{\n    static const __m256i perm = _mm256_setr_epi8(\n            15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,\n            15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);\n    __m256i vec = _mm256_shuffle_epi8(a.val, perm);\n    return v_uint8x32(_mm256_permute2x128_si256(vec, vec, 1));\n}\n\ninline v_int8x32 v_reverse(const v_int8x32 &a)\n{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); }\n\ninline v_uint16x16 v_reverse(const v_uint16x16 &a)\n{\n    static const __m256i perm = _mm256_setr_epi8(\n            14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1,\n            14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1);\n    __m256i vec = _mm256_shuffle_epi8(a.val, perm);\n    return v_uint16x16(_mm256_permute2x128_si256(vec, vec, 1));\n}\n\ninline v_int16x16 v_reverse(const v_int16x16 &a)\n{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); }\n\ninline v_uint32x8 v_reverse(const v_uint32x8 &a)\n{\n    static const __m256i perm = _mm256_setr_epi32(7, 6, 5, 4, 3, 2, 1, 0);\n    return v_uint32x8(_mm256_permutevar8x32_epi32(a.val, perm));\n}\n\ninline v_int32x8 v_reverse(const v_int32x8 &a)\n{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_float32x8 v_reverse(const v_float32x8 &a)\n{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_uint64x4 v_reverse(const v_uint64x4 &a)\n{\n    return v_uint64x4(_mm256_permute4x64_epi64(a.val, _MM_SHUFFLE(0, 1, 2, 3)));\n}\n\ninline v_int64x4 v_reverse(const v_int64x4 &a)\n{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); }\n\ninline v_float64x4 v_reverse(const v_float64x4 &a)\n{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); }\n\n////////// Reduce and mask /////////\n\n/** Reduce **/\ninline unsigned v_reduce_sum(const v_uint8x32& a)\n{\n    __m256i half = _mm256_sad_epu8(a.val, _mm256_setzero_si256());\n    __m128i quarter = _mm_add_epi32(_v256_extract_low(half), _v256_extract_high(half));\n    return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter)));\n}\ninline int v_reduce_sum(const v_int8x32& a)\n{\n    __m256i half = _mm256_sad_epu8(_mm256_xor_si256(a.val, _mm256_set1_epi8((schar)-128)), _mm256_setzero_si256());\n    __m128i quarter = _mm_add_epi32(_v256_extract_low(half), _v256_extract_high(half));\n    return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter))) - 4096;\n}\n#define OPENCV_HAL_IMPL_AVX_REDUCE_32(_Tpvec, sctype, func, intrin) \\\n    inline sctype v_reduce_##func(const _Tpvec& a) \\\n    { \\\n        __m128i val = intrin(_v256_extract_low(a.val), _v256_extract_high(a.val)); \\\n        val = intrin(val, _mm_srli_si128(val,8)); \\\n        val = intrin(val, _mm_srli_si128(val,4)); \\\n        val = intrin(val, _mm_srli_si128(val,2)); \\\n        val = intrin(val, _mm_srli_si128(val,1)); \\\n        return (sctype)_mm_cvtsi128_si32(val); \\\n    }\n\nOPENCV_HAL_IMPL_AVX_REDUCE_32(v_uint8x32, uchar, min, _mm_min_epu8)\nOPENCV_HAL_IMPL_AVX_REDUCE_32(v_int8x32,  schar, min, _mm_min_epi8)\nOPENCV_HAL_IMPL_AVX_REDUCE_32(v_uint8x32, uchar, max, _mm_max_epu8)\nOPENCV_HAL_IMPL_AVX_REDUCE_32(v_int8x32,  schar, max, _mm_max_epi8)\n\n#define OPENCV_HAL_IMPL_AVX_REDUCE_16(_Tpvec, sctype, func, intrin) \\\n    inline sctype v_reduce_##func(const _Tpvec& a)                  \\\n    {                                                               \\\n        __m128i v0 = _v256_extract_low(a.val);                      \\\n        __m128i v1 = _v256_extract_high(a.val);                     \\\n        v0 = intrin(v0, v1);                                        \\\n        v0 = intrin(v0, _mm_srli_si128(v0, 8));                     \\\n        v0 = intrin(v0, _mm_srli_si128(v0, 4));                     \\\n        v0 = intrin(v0, _mm_srli_si128(v0, 2));                     \\\n        return (sctype) _mm_cvtsi128_si32(v0);                      \\\n    }\n\nOPENCV_HAL_IMPL_AVX_REDUCE_16(v_uint16x16, ushort, min, _mm_min_epu16)\nOPENCV_HAL_IMPL_AVX_REDUCE_16(v_int16x16,  short,  min, _mm_min_epi16)\nOPENCV_HAL_IMPL_AVX_REDUCE_16(v_uint16x16, ushort, max, _mm_max_epu16)\nOPENCV_HAL_IMPL_AVX_REDUCE_16(v_int16x16,  short,  max, _mm_max_epi16)\n\n#define OPENCV_HAL_IMPL_AVX_REDUCE_8(_Tpvec, sctype, func, intrin) \\\n    inline sctype v_reduce_##func(const _Tpvec& a)                 \\\n    {                                                              \\\n        __m128i v0 = _v256_extract_low(a.val);                     \\\n        __m128i v1 = _v256_extract_high(a.val);                    \\\n        v0 = intrin(v0, v1);                                       \\\n        v0 = intrin(v0, _mm_srli_si128(v0, 8));                    \\\n        v0 = intrin(v0, _mm_srli_si128(v0, 4));                    \\\n        return (sctype) _mm_cvtsi128_si32(v0);                     \\\n    }\n\nOPENCV_HAL_IMPL_AVX_REDUCE_8(v_uint32x8, unsigned, min, _mm_min_epu32)\nOPENCV_HAL_IMPL_AVX_REDUCE_8(v_int32x8,  int,      min, _mm_min_epi32)\nOPENCV_HAL_IMPL_AVX_REDUCE_8(v_uint32x8, unsigned, max, _mm_max_epu32)\nOPENCV_HAL_IMPL_AVX_REDUCE_8(v_int32x8,  int,      max, _mm_max_epi32)\n\n#define OPENCV_HAL_IMPL_AVX_REDUCE_FLT(func, intrin)                  \\\n    inline float v_reduce_##func(const v_float32x8& a)                \\\n    {                                                                 \\\n        __m128 v0 = _v256_extract_low(a.val);                         \\\n        __m128 v1 = _v256_extract_high(a.val);                        \\\n        v0 = intrin(v0, v1);                                          \\\n        v0 = intrin(v0, _mm_permute_ps(v0, _MM_SHUFFLE(0, 0, 3, 2))); \\\n        v0 = intrin(v0, _mm_permute_ps(v0, _MM_SHUFFLE(0, 0, 0, 1))); \\\n        return _mm_cvtss_f32(v0);                                     \\\n    }\n\nOPENCV_HAL_IMPL_AVX_REDUCE_FLT(min, _mm_min_ps)\nOPENCV_HAL_IMPL_AVX_REDUCE_FLT(max, _mm_max_ps)\n\ninline int v_reduce_sum(const v_int32x8& a)\n{\n    __m256i s0 = _mm256_hadd_epi32(a.val, a.val);\n            s0 = _mm256_hadd_epi32(s0, s0);\n\n    __m128i s1 = _v256_extract_high(s0);\n            s1 = _mm_add_epi32(_v256_extract_low(s0), s1);\n\n    return _mm_cvtsi128_si32(s1);\n}\n\ninline unsigned v_reduce_sum(const v_uint32x8& a)\n{ return v_reduce_sum(v_reinterpret_as_s32(a)); }\n\ninline int v_reduce_sum(const v_int16x16& a)\n{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); }\ninline unsigned v_reduce_sum(const v_uint16x16& a)\n{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); }\n\ninline float v_reduce_sum(const v_float32x8& a)\n{\n    __m256 s0 = _mm256_hadd_ps(a.val, a.val);\n           s0 = _mm256_hadd_ps(s0, s0);\n\n    __m128 s1 = _v256_extract_high(s0);\n           s1 = _mm_add_ps(_v256_extract_low(s0), s1);\n\n    return _mm_cvtss_f32(s1);\n}\n\ninline uint64 v_reduce_sum(const v_uint64x4& a)\n{\n    uint64 CV_DECL_ALIGNED(32) idx[2];\n    _mm_store_si128((__m128i*)idx, _mm_add_epi64(_v256_extract_low(a.val), _v256_extract_high(a.val)));\n    return idx[0] + idx[1];\n}\ninline int64 v_reduce_sum(const v_int64x4& a)\n{\n    int64 CV_DECL_ALIGNED(32) idx[2];\n    _mm_store_si128((__m128i*)idx, _mm_add_epi64(_v256_extract_low(a.val), _v256_extract_high(a.val)));\n    return idx[0] + idx[1];\n}\ninline double v_reduce_sum(const v_float64x4& a)\n{\n    __m256d s0 = _mm256_hadd_pd(a.val, a.val);\n    return _mm_cvtsd_f64(_mm_add_pd(_v256_extract_low(s0), _v256_extract_high(s0)));\n}\n\ninline v_float32x8 v_reduce_sum4(const v_float32x8& a, const v_float32x8& b,\n                                 const v_float32x8& c, const v_float32x8& d)\n{\n    __m256 ab = _mm256_hadd_ps(a.val, b.val);\n    __m256 cd = _mm256_hadd_ps(c.val, d.val);\n    return v_float32x8(_mm256_hadd_ps(ab, cd));\n}\n\ninline unsigned v_reduce_sad(const v_uint8x32& a, const v_uint8x32& b)\n{\n    __m256i half = _mm256_sad_epu8(a.val, b.val);\n    __m128i quarter = _mm_add_epi32(_v256_extract_low(half), _v256_extract_high(half));\n    return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter)));\n}\ninline unsigned v_reduce_sad(const v_int8x32& a, const v_int8x32& b)\n{\n    __m256i half = _mm256_set1_epi8(0x7f);\n    half = _mm256_sad_epu8(_mm256_add_epi8(a.val, half), _mm256_add_epi8(b.val, half));\n    __m128i quarter = _mm_add_epi32(_v256_extract_low(half), _v256_extract_high(half));\n    return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter)));\n}\ninline unsigned v_reduce_sad(const v_uint16x16& a, const v_uint16x16& b)\n{\n    v_uint32x8 l, h;\n    v_expand(v_add_wrap(a - b, b - a), l, h);\n    return v_reduce_sum(l + h);\n}\ninline unsigned v_reduce_sad(const v_int16x16& a, const v_int16x16& b)\n{\n    v_uint32x8 l, h;\n    v_expand(v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b))), l, h);\n    return v_reduce_sum(l + h);\n}\ninline unsigned v_reduce_sad(const v_uint32x8& a, const v_uint32x8& b)\n{\n    return v_reduce_sum(v_max(a, b) - v_min(a, b));\n}\ninline unsigned v_reduce_sad(const v_int32x8& a, const v_int32x8& b)\n{\n    v_int32x8 m = a < b;\n    return v_reduce_sum(v_reinterpret_as_u32(((a - b) ^ m) - m));\n}\ninline float v_reduce_sad(const v_float32x8& a, const v_float32x8& b)\n{\n    return v_reduce_sum((a - b) & v_float32x8(_mm256_castsi256_ps(_mm256_set1_epi32(0x7fffffff))));\n}\n\n/** Popcount **/\ninline v_uint8x32 v_popcount(const v_uint8x32& a)\n{\n    __m256i _popcnt_table = _mm256_setr_epi8(0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,\n                                             0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4);\n    __m256i _popcnt_mask = _mm256_set1_epi8(0x0F);\n    return v_uint8x32(_mm256_add_epi8(_mm256_shuffle_epi8(_popcnt_table, _mm256_and_si256(                  a.val    , _popcnt_mask)),\n                                      _mm256_shuffle_epi8(_popcnt_table, _mm256_and_si256(_mm256_srli_epi16(a.val, 4), _popcnt_mask))));\n}\ninline v_uint16x16 v_popcount(const v_uint16x16& a)\n{\n    v_uint8x32 p = v_popcount(v_reinterpret_as_u8(a));\n    p += v_rotate_right<1>(p);\n    return v_reinterpret_as_u16(p) & v256_setall_u16(0x00ff);\n}\ninline v_uint32x8 v_popcount(const v_uint32x8& a)\n{\n    v_uint8x32 p = v_popcount(v_reinterpret_as_u8(a));\n    p += v_rotate_right<1>(p);\n    p += v_rotate_right<2>(p);\n    return v_reinterpret_as_u32(p) & v256_setall_u32(0x000000ff);\n}\ninline v_uint64x4 v_popcount(const v_uint64x4& a)\n{\n    return v_uint64x4(_mm256_sad_epu8(v_popcount(v_reinterpret_as_u8(a)).val, _mm256_setzero_si256()));\n}\ninline v_uint8x32 v_popcount(const v_int8x32& a)\n{ return v_popcount(v_reinterpret_as_u8(a)); }\ninline v_uint16x16 v_popcount(const v_int16x16& a)\n{ return v_popcount(v_reinterpret_as_u16(a)); }\ninline v_uint32x8 v_popcount(const v_int32x8& a)\n{ return v_popcount(v_reinterpret_as_u32(a)); }\ninline v_uint64x4 v_popcount(const v_int64x4& a)\n{ return v_popcount(v_reinterpret_as_u64(a)); }\n\n/** Mask **/\ninline int v_signmask(const v_int8x32& a)\n{ return _mm256_movemask_epi8(a.val); }\ninline int v_signmask(const v_uint8x32& a)\n{ return v_signmask(v_reinterpret_as_s8(a)); }\n\ninline int v_signmask(const v_int16x16& a)\n{ return v_signmask(v_pack(a, a)) & 0xFFFF; }\ninline int v_signmask(const v_uint16x16& a)\n{ return v_signmask(v_reinterpret_as_s16(a)); }\n\ninline int v_signmask(const v_float32x8& a)\n{ return _mm256_movemask_ps(a.val); }\ninline int v_signmask(const v_float64x4& a)\n{ return _mm256_movemask_pd(a.val); }\n\ninline int v_signmask(const v_int32x8& a)\n{ return v_signmask(v_reinterpret_as_f32(a)); }\ninline int v_signmask(const v_uint32x8& a)\n{ return v_signmask(v_reinterpret_as_f32(a)); }\n\ninline int v_signmask(const v_int64x4& a)\n{ return v_signmask(v_reinterpret_as_f64(a)); }\ninline int v_signmask(const v_uint64x4& a)\n{ return v_signmask(v_reinterpret_as_f64(a)); }\n\ninline int v_scan_forward(const v_int8x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); }\ninline int v_scan_forward(const v_uint8x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); }\ninline int v_scan_forward(const v_int16x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; }\ninline int v_scan_forward(const v_uint16x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; }\ninline int v_scan_forward(const v_int32x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; }\ninline int v_scan_forward(const v_uint32x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; }\ninline int v_scan_forward(const v_float32x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; }\ninline int v_scan_forward(const v_int64x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; }\ninline int v_scan_forward(const v_uint64x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; }\ninline int v_scan_forward(const v_float64x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; }\n\n/** Checks **/\n#define OPENCV_HAL_IMPL_AVX_CHECK(_Tpvec, allmask) \\\n    inline bool v_check_all(const _Tpvec& a) { return v_signmask(a) == allmask; } \\\n    inline bool v_check_any(const _Tpvec& a) { return v_signmask(a) != 0; }\nOPENCV_HAL_IMPL_AVX_CHECK(v_uint8x32, -1)\nOPENCV_HAL_IMPL_AVX_CHECK(v_int8x32, -1)\nOPENCV_HAL_IMPL_AVX_CHECK(v_uint32x8, 255)\nOPENCV_HAL_IMPL_AVX_CHECK(v_int32x8, 255)\nOPENCV_HAL_IMPL_AVX_CHECK(v_uint64x4, 15)\nOPENCV_HAL_IMPL_AVX_CHECK(v_int64x4, 15)\nOPENCV_HAL_IMPL_AVX_CHECK(v_float32x8, 255)\nOPENCV_HAL_IMPL_AVX_CHECK(v_float64x4, 15)\n\n#define OPENCV_HAL_IMPL_AVX_CHECK_SHORT(_Tpvec)  \\\n    inline bool v_check_all(const _Tpvec& a) { return (v_signmask(v_reinterpret_as_s8(a)) & 0xaaaaaaaa) == 0xaaaaaaaa; } \\\n    inline bool v_check_any(const _Tpvec& a) { return (v_signmask(v_reinterpret_as_s8(a)) & 0xaaaaaaaa) != 0; }\nOPENCV_HAL_IMPL_AVX_CHECK_SHORT(v_uint16x16)\nOPENCV_HAL_IMPL_AVX_CHECK_SHORT(v_int16x16)\n\n////////// Other math /////////\n\n/** Some frequent operations **/\n#define OPENCV_HAL_IMPL_AVX_MULADD(_Tpvec, suffix)                            \\\n    inline _Tpvec v_fma(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c)    \\\n    { return _Tpvec(_mm256_fmadd_##suffix(a.val, b.val, c.val)); }            \\\n    inline _Tpvec v_muladd(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c) \\\n    { return _Tpvec(_mm256_fmadd_##suffix(a.val, b.val, c.val)); }            \\\n    inline _Tpvec v_sqrt(const _Tpvec& x)                                     \\\n    { return _Tpvec(_mm256_sqrt_##suffix(x.val)); }                           \\\n    inline _Tpvec v_sqr_magnitude(const _Tpvec& a, const _Tpvec& b)           \\\n    { return v_fma(a, a, b * b); }                                            \\\n    inline _Tpvec v_magnitude(const _Tpvec& a, const _Tpvec& b)               \\\n    { return v_sqrt(v_fma(a, a, b*b)); }\n\nOPENCV_HAL_IMPL_AVX_MULADD(v_float32x8, ps)\nOPENCV_HAL_IMPL_AVX_MULADD(v_float64x4, pd)\n\ninline v_int32x8 v_fma(const v_int32x8& a, const v_int32x8& b, const v_int32x8& c)\n{\n    return a * b + c;\n}\n\ninline v_int32x8 v_muladd(const v_int32x8& a, const v_int32x8& b, const v_int32x8& c)\n{\n    return v_fma(a, b, c);\n}\n\ninline v_float32x8 v_invsqrt(const v_float32x8& x)\n{\n    v_float32x8 half = x * v256_setall_f32(0.5);\n    v_float32x8 t  = v_float32x8(_mm256_rsqrt_ps(x.val));\n    // todo: _mm256_fnmsub_ps\n    t *= v256_setall_f32(1.5) - ((t * t) * half);\n    return t;\n}\n\ninline v_float64x4 v_invsqrt(const v_float64x4& x)\n{\n    return v256_setall_f64(1.) / v_sqrt(x);\n}\n\n/** Absolute values **/\n#define OPENCV_HAL_IMPL_AVX_ABS(_Tpvec, suffix)         \\\n    inline v_u##_Tpvec v_abs(const v_##_Tpvec& x)       \\\n    { return v_u##_Tpvec(_mm256_abs_##suffix(x.val)); }\n\nOPENCV_HAL_IMPL_AVX_ABS(int8x32,  epi8)\nOPENCV_HAL_IMPL_AVX_ABS(int16x16, epi16)\nOPENCV_HAL_IMPL_AVX_ABS(int32x8,  epi32)\n\ninline v_float32x8 v_abs(const v_float32x8& x)\n{ return x & v_float32x8(_mm256_castsi256_ps(_mm256_set1_epi32(0x7fffffff))); }\ninline v_float64x4 v_abs(const v_float64x4& x)\n{ return x & v_float64x4(_mm256_castsi256_pd(_mm256_srli_epi64(_mm256_set1_epi64x(-1), 1))); }\n\n/** Absolute difference **/\ninline v_uint8x32 v_absdiff(const v_uint8x32& a, const v_uint8x32& b)\n{ return v_add_wrap(a - b,  b - a); }\ninline v_uint16x16 v_absdiff(const v_uint16x16& a, const v_uint16x16& b)\n{ return v_add_wrap(a - b,  b - a); }\ninline v_uint32x8 v_absdiff(const v_uint32x8& a, const v_uint32x8& b)\n{ return v_max(a, b) - v_min(a, b); }\n\ninline v_uint8x32 v_absdiff(const v_int8x32& a, const v_int8x32& b)\n{\n    v_int8x32 d = v_sub_wrap(a, b);\n    v_int8x32 m = a < b;\n    return v_reinterpret_as_u8(v_sub_wrap(d ^ m, m));\n}\n\ninline v_uint16x16 v_absdiff(const v_int16x16& a, const v_int16x16& b)\n{ return v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b))); }\n\ninline v_uint32x8 v_absdiff(const v_int32x8& a, const v_int32x8& b)\n{\n    v_int32x8 d = a - b;\n    v_int32x8 m = a < b;\n    return v_reinterpret_as_u32((d ^ m) - m);\n}\n\ninline v_float32x8 v_absdiff(const v_float32x8& a, const v_float32x8& b)\n{ return v_abs(a - b); }\n\ninline v_float64x4 v_absdiff(const v_float64x4& a, const v_float64x4& b)\n{ return v_abs(a - b); }\n\n/** Saturating absolute difference **/\ninline v_int8x32 v_absdiffs(const v_int8x32& a, const v_int8x32& b)\n{\n    v_int8x32 d = a - b;\n    v_int8x32 m = a < b;\n    return (d ^ m) - m;\n}\ninline v_int16x16 v_absdiffs(const v_int16x16& a, const v_int16x16& b)\n{ return v_max(a, b) - v_min(a, b); }\n\n////////// Conversions /////////\n\n/** Rounding **/\ninline v_int32x8 v_round(const v_float32x8& a)\n{ return v_int32x8(_mm256_cvtps_epi32(a.val)); }\n\ninline v_int32x8 v_round(const v_float64x4& a)\n{ return v_int32x8(_mm256_castsi128_si256(_mm256_cvtpd_epi32(a.val))); }\n\ninline v_int32x8 v_round(const v_float64x4& a, const v_float64x4& b)\n{\n    __m128i ai = _mm256_cvtpd_epi32(a.val), bi = _mm256_cvtpd_epi32(b.val);\n    return v_int32x8(_v256_combine(ai, bi));\n}\n\ninline v_int32x8 v_trunc(const v_float32x8& a)\n{ return v_int32x8(_mm256_cvttps_epi32(a.val)); }\n\ninline v_int32x8 v_trunc(const v_float64x4& a)\n{ return v_int32x8(_mm256_castsi128_si256(_mm256_cvttpd_epi32(a.val))); }\n\ninline v_int32x8 v_floor(const v_float32x8& a)\n{ return v_int32x8(_mm256_cvttps_epi32(_mm256_floor_ps(a.val))); }\n\ninline v_int32x8 v_floor(const v_float64x4& a)\n{ return v_trunc(v_float64x4(_mm256_floor_pd(a.val))); }\n\ninline v_int32x8 v_ceil(const v_float32x8& a)\n{ return v_int32x8(_mm256_cvttps_epi32(_mm256_ceil_ps(a.val))); }\n\ninline v_int32x8 v_ceil(const v_float64x4& a)\n{ return v_trunc(v_float64x4(_mm256_ceil_pd(a.val))); }\n\n/** To float **/\ninline v_float32x8 v_cvt_f32(const v_int32x8& a)\n{ return v_float32x8(_mm256_cvtepi32_ps(a.val)); }\n\ninline v_float32x8 v_cvt_f32(const v_float64x4& a)\n{ return v_float32x8(_mm256_castps128_ps256(_mm256_cvtpd_ps(a.val))); }\n\ninline v_float32x8 v_cvt_f32(const v_float64x4& a, const v_float64x4& b)\n{\n    __m128 af = _mm256_cvtpd_ps(a.val), bf = _mm256_cvtpd_ps(b.val);\n    return v_float32x8(_v256_combine(af, bf));\n}\n\ninline v_float64x4 v_cvt_f64(const v_int32x8& a)\n{ return v_float64x4(_mm256_cvtepi32_pd(_v256_extract_low(a.val))); }\n\ninline v_float64x4 v_cvt_f64_high(const v_int32x8& a)\n{ return v_float64x4(_mm256_cvtepi32_pd(_v256_extract_high(a.val))); }\n\ninline v_float64x4 v_cvt_f64(const v_float32x8& a)\n{ return v_float64x4(_mm256_cvtps_pd(_v256_extract_low(a.val))); }\n\ninline v_float64x4 v_cvt_f64_high(const v_float32x8& a)\n{ return v_float64x4(_mm256_cvtps_pd(_v256_extract_high(a.val))); }\n\n// from (Mysticial and wim) https://stackoverflow.com/q/41144668\ninline v_float64x4 v_cvt_f64(const v_int64x4& v)\n{\n    // constants encoded as floating-point\n    __m256i magic_i_lo   = _mm256_set1_epi64x(0x4330000000000000); // 2^52\n    __m256i magic_i_hi32 = _mm256_set1_epi64x(0x4530000080000000); // 2^84 + 2^63\n    __m256i magic_i_all  = _mm256_set1_epi64x(0x4530000080100000); // 2^84 + 2^63 + 2^52\n    __m256d magic_d_all  = _mm256_castsi256_pd(magic_i_all);\n\n    // Blend the 32 lowest significant bits of v with magic_int_lo\n    __m256i v_lo         = _mm256_blend_epi32(magic_i_lo, v.val, 0x55);\n    // Extract the 32 most significant bits of v\n    __m256i v_hi         = _mm256_srli_epi64(v.val, 32);\n    // Flip the msb of v_hi and blend with 0x45300000\n            v_hi         = _mm256_xor_si256(v_hi, magic_i_hi32);\n    // Compute in double precision\n    __m256d v_hi_dbl     = _mm256_sub_pd(_mm256_castsi256_pd(v_hi), magic_d_all);\n    // (v_hi - magic_d_all) + v_lo  Do not assume associativity of floating point addition\n    __m256d result       = _mm256_add_pd(v_hi_dbl, _mm256_castsi256_pd(v_lo));\n    return v_float64x4(result);\n}\n\n////////////// Lookup table access ////////////////////\n\ninline v_int8x32 v256_lut(const schar* tab, const int* idx)\n{\n    return v_int8x32(_mm256_setr_epi8(tab[idx[ 0]], tab[idx[ 1]], tab[idx[ 2]], tab[idx[ 3]], tab[idx[ 4]], tab[idx[ 5]], tab[idx[ 6]], tab[idx[ 7]],\n                                      tab[idx[ 8]], tab[idx[ 9]], tab[idx[10]], tab[idx[11]], tab[idx[12]], tab[idx[13]], tab[idx[14]], tab[idx[15]],\n                                      tab[idx[16]], tab[idx[17]], tab[idx[18]], tab[idx[19]], tab[idx[20]], tab[idx[21]], tab[idx[22]], tab[idx[23]],\n                                      tab[idx[24]], tab[idx[25]], tab[idx[26]], tab[idx[27]], tab[idx[28]], tab[idx[29]], tab[idx[30]], tab[idx[31]]));\n}\ninline v_int8x32 v256_lut_pairs(const schar* tab, const int* idx)\n{\n    return v_int8x32(_mm256_setr_epi16(*(const short*)(tab + idx[ 0]), *(const short*)(tab + idx[ 1]), *(const short*)(tab + idx[ 2]), *(const short*)(tab + idx[ 3]),\n                                       *(const short*)(tab + idx[ 4]), *(const short*)(tab + idx[ 5]), *(const short*)(tab + idx[ 6]), *(const short*)(tab + idx[ 7]),\n                                       *(const short*)(tab + idx[ 8]), *(const short*)(tab + idx[ 9]), *(const short*)(tab + idx[10]), *(const short*)(tab + idx[11]),\n                                       *(const short*)(tab + idx[12]), *(const short*)(tab + idx[13]), *(const short*)(tab + idx[14]), *(const short*)(tab + idx[15])));\n}\ninline v_int8x32 v256_lut_quads(const schar* tab, const int* idx)\n{\n    return v_int8x32(_mm256_i32gather_epi32((const int*)tab, _mm256_loadu_si256((const __m256i*)idx), 1));\n}\ninline v_uint8x32 v256_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v256_lut((const schar *)tab, idx)); }\ninline v_uint8x32 v256_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v256_lut_pairs((const schar *)tab, idx)); }\ninline v_uint8x32 v256_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v256_lut_quads((const schar *)tab, idx)); }\n\ninline v_int16x16 v256_lut(const short* tab, const int* idx)\n{\n    return v_int16x16(_mm256_setr_epi16(tab[idx[0]], tab[idx[1]], tab[idx[ 2]], tab[idx[ 3]], tab[idx[ 4]], tab[idx[ 5]], tab[idx[ 6]], tab[idx[ 7]],\n                                        tab[idx[8]], tab[idx[9]], tab[idx[10]], tab[idx[11]], tab[idx[12]], tab[idx[13]], tab[idx[14]], tab[idx[15]]));\n}\ninline v_int16x16 v256_lut_pairs(const short* tab, const int* idx)\n{\n    return v_int16x16(_mm256_i32gather_epi32((const int*)tab, _mm256_loadu_si256((const __m256i*)idx), 2));\n}\ninline v_int16x16 v256_lut_quads(const short* tab, const int* idx)\n{\n#if defined(__GNUC__)\n    return v_int16x16(_mm256_i32gather_epi64((const long long int*)tab, _mm_loadu_si128((const __m128i*)idx), 2));//Looks like intrinsic has wrong definition\n#else\n    return v_int16x16(_mm256_i32gather_epi64((const int64*)tab, _mm_loadu_si128((const __m128i*)idx), 2));\n#endif\n}\ninline v_uint16x16 v256_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v256_lut((const short *)tab, idx)); }\ninline v_uint16x16 v256_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v256_lut_pairs((const short *)tab, idx)); }\ninline v_uint16x16 v256_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v256_lut_quads((const short *)tab, idx)); }\n\ninline v_int32x8 v256_lut(const int* tab, const int* idx)\n{\n    return v_int32x8(_mm256_i32gather_epi32(tab, _mm256_loadu_si256((const __m256i*)idx), 4));\n}\ninline v_int32x8 v256_lut_pairs(const int* tab, const int* idx)\n{\n#if defined(__GNUC__)\n    return v_int32x8(_mm256_i32gather_epi64((const long long int*)tab, _mm_loadu_si128((const __m128i*)idx), 4));\n#else\n    return v_int32x8(_mm256_i32gather_epi64((const int64*)tab, _mm_loadu_si128((const __m128i*)idx), 4));\n#endif\n}\ninline v_int32x8 v256_lut_quads(const int* tab, const int* idx)\n{\n    return v_int32x8(_v256_combine(_mm_loadu_si128((const __m128i*)(tab + idx[0])), _mm_loadu_si128((const __m128i*)(tab + idx[1]))));\n}\ninline v_uint32x8 v256_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v256_lut((const int *)tab, idx)); }\ninline v_uint32x8 v256_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v256_lut_pairs((const int *)tab, idx)); }\ninline v_uint32x8 v256_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v256_lut_quads((const int *)tab, idx)); }\n\ninline v_int64x4 v256_lut(const int64* tab, const int* idx)\n{\n#if defined(__GNUC__)\n    return v_int64x4(_mm256_i32gather_epi64((const long long int*)tab, _mm_loadu_si128((const __m128i*)idx), 8));\n#else\n    return v_int64x4(_mm256_i32gather_epi64(tab, _mm_loadu_si128((const __m128i*)idx), 8));\n#endif\n}\ninline v_int64x4 v256_lut_pairs(const int64* tab, const int* idx)\n{\n    return v_int64x4(_v256_combine(_mm_loadu_si128((const __m128i*)(tab + idx[0])), _mm_loadu_si128((const __m128i*)(tab + idx[1]))));\n}\ninline v_uint64x4 v256_lut(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v256_lut((const int64 *)tab, idx)); }\ninline v_uint64x4 v256_lut_pairs(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v256_lut_pairs((const int64 *)tab, idx)); }\n\ninline v_float32x8 v256_lut(const float* tab, const int* idx)\n{\n    return v_float32x8(_mm256_i32gather_ps(tab, _mm256_loadu_si256((const __m256i*)idx), 4));\n}\ninline v_float32x8 v256_lut_pairs(const float* tab, const int* idx) { return v_reinterpret_as_f32(v256_lut_pairs((const int *)tab, idx)); }\ninline v_float32x8 v256_lut_quads(const float* tab, const int* idx) { return v_reinterpret_as_f32(v256_lut_quads((const int *)tab, idx)); }\n\ninline v_float64x4 v256_lut(const double* tab, const int* idx)\n{\n    return v_float64x4(_mm256_i32gather_pd(tab, _mm_loadu_si128((const __m128i*)idx), 8));\n}\ninline v_float64x4 v256_lut_pairs(const double* tab, const int* idx) { return v_float64x4(_v256_combine(_mm_loadu_pd(tab + idx[0]), _mm_loadu_pd(tab + idx[1]))); }\n\ninline v_int32x8 v_lut(const int* tab, const v_int32x8& idxvec)\n{\n    return v_int32x8(_mm256_i32gather_epi32(tab, idxvec.val, 4));\n}\n\ninline v_uint32x8 v_lut(const unsigned* tab, const v_int32x8& idxvec)\n{\n    return v_reinterpret_as_u32(v_lut((const int *)tab, idxvec));\n}\n\ninline v_float32x8 v_lut(const float* tab, const v_int32x8& idxvec)\n{\n    return v_float32x8(_mm256_i32gather_ps(tab, idxvec.val, 4));\n}\n\ninline v_float64x4 v_lut(const double* tab, const v_int32x8& idxvec)\n{\n    return v_float64x4(_mm256_i32gather_pd(tab, _mm256_castsi256_si128(idxvec.val), 8));\n}\n\ninline void v_lut_deinterleave(const float* tab, const v_int32x8& idxvec, v_float32x8& x, v_float32x8& y)\n{\n    int CV_DECL_ALIGNED(32) idx[8];\n    v_store_aligned(idx, idxvec);\n    __m128 z = _mm_setzero_ps();\n    __m128 xy01, xy45, xy23, xy67;\n    xy01 = _mm_loadl_pi(z, (const __m64*)(tab + idx[0]));\n    xy01 = _mm_loadh_pi(xy01, (const __m64*)(tab + idx[1]));\n    xy45 = _mm_loadl_pi(z, (const __m64*)(tab + idx[4]));\n    xy45 = _mm_loadh_pi(xy45, (const __m64*)(tab + idx[5]));\n    __m256 xy0145 = _v256_combine(xy01, xy45);\n    xy23 = _mm_loadl_pi(z, (const __m64*)(tab + idx[2]));\n    xy23 = _mm_loadh_pi(xy23, (const __m64*)(tab + idx[3]));\n    xy67 = _mm_loadl_pi(z, (const __m64*)(tab + idx[6]));\n    xy67 = _mm_loadh_pi(xy67, (const __m64*)(tab + idx[7]));\n    __m256 xy2367 = _v256_combine(xy23, xy67);\n\n    __m256 xxyy0145 = _mm256_unpacklo_ps(xy0145, xy2367);\n    __m256 xxyy2367 = _mm256_unpackhi_ps(xy0145, xy2367);\n\n    x = v_float32x8(_mm256_unpacklo_ps(xxyy0145, xxyy2367));\n    y = v_float32x8(_mm256_unpackhi_ps(xxyy0145, xxyy2367));\n}\n\ninline void v_lut_deinterleave(const double* tab, const v_int32x8& idxvec, v_float64x4& x, v_float64x4& y)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_low(idx, idxvec);\n    __m128d xy0 = _mm_loadu_pd(tab + idx[0]);\n    __m128d xy2 = _mm_loadu_pd(tab + idx[2]);\n    __m128d xy1 = _mm_loadu_pd(tab + idx[1]);\n    __m128d xy3 = _mm_loadu_pd(tab + idx[3]);\n    __m256d xy02 = _v256_combine(xy0, xy2);\n    __m256d xy13 = _v256_combine(xy1, xy3);\n\n    x = v_float64x4(_mm256_unpacklo_pd(xy02, xy13));\n    y = v_float64x4(_mm256_unpackhi_pd(xy02, xy13));\n}\n\ninline v_int8x32 v_interleave_pairs(const v_int8x32& vec)\n{\n    return v_int8x32(_mm256_shuffle_epi8(vec.val, _mm256_set_epi64x(0x0f0d0e0c0b090a08, 0x0705060403010200, 0x0f0d0e0c0b090a08, 0x0705060403010200)));\n}\ninline v_uint8x32 v_interleave_pairs(const v_uint8x32& vec) { return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); }\ninline v_int8x32 v_interleave_quads(const v_int8x32& vec)\n{\n    return v_int8x32(_mm256_shuffle_epi8(vec.val, _mm256_set_epi64x(0x0f0b0e0a0d090c08, 0x0703060205010400, 0x0f0b0e0a0d090c08, 0x0703060205010400)));\n}\ninline v_uint8x32 v_interleave_quads(const v_uint8x32& vec) { return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x16 v_interleave_pairs(const v_int16x16& vec)\n{\n    return v_int16x16(_mm256_shuffle_epi8(vec.val, _mm256_set_epi64x(0x0f0e0b0a0d0c0908, 0x0706030205040100, 0x0f0e0b0a0d0c0908, 0x0706030205040100)));\n}\ninline v_uint16x16 v_interleave_pairs(const v_uint16x16& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); }\ninline v_int16x16 v_interleave_quads(const v_int16x16& vec)\n{\n    return v_int16x16(_mm256_shuffle_epi8(vec.val, _mm256_set_epi64x(0x0f0e07060d0c0504, 0x0b0a030209080100, 0x0f0e07060d0c0504, 0x0b0a030209080100)));\n}\ninline v_uint16x16 v_interleave_quads(const v_uint16x16& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x8 v_interleave_pairs(const v_int32x8& vec)\n{\n    return v_int32x8(_mm256_shuffle_epi32(vec.val, _MM_SHUFFLE(3, 1, 2, 0)));\n}\ninline v_uint32x8 v_interleave_pairs(const v_uint32x8& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\ninline v_float32x8 v_interleave_pairs(const v_float32x8& vec) { return v_reinterpret_as_f32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\n\ninline v_int8x32 v_pack_triplets(const v_int8x32& vec)\n{\n    return v_int8x32(_mm256_permutevar8x32_epi32(_mm256_shuffle_epi8(vec.val, _mm256_broadcastsi128_si256(_mm_set_epi64x(0xffffff0f0e0d0c0a, 0x0908060504020100))),\n                                                 _mm256_set_epi64x(0x0000000700000007, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000)));\n}\ninline v_uint8x32 v_pack_triplets(const v_uint8x32& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x16 v_pack_triplets(const v_int16x16& vec)\n{\n    return v_int16x16(_mm256_permutevar8x32_epi32(_mm256_shuffle_epi8(vec.val, _mm256_broadcastsi128_si256(_mm_set_epi64x(0xffff0f0e0d0c0b0a, 0x0908050403020100))),\n                                                  _mm256_set_epi64x(0x0000000700000007, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000)));\n}\ninline v_uint16x16 v_pack_triplets(const v_uint16x16& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x8 v_pack_triplets(const v_int32x8& vec)\n{\n    return v_int32x8(_mm256_permutevar8x32_epi32(vec.val, _mm256_set_epi64x(0x0000000700000007, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000)));\n}\ninline v_uint32x8 v_pack_triplets(const v_uint32x8& vec) { return v_reinterpret_as_u32(v_pack_triplets(v_reinterpret_as_s32(vec))); }\ninline v_float32x8 v_pack_triplets(const v_float32x8& vec)\n{\n    return v_float32x8(_mm256_permutevar8x32_ps(vec.val, _mm256_set_epi64x(0x0000000700000007, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000)));\n}\n\n////////// Matrix operations /////////\n\n//////// Dot Product ////////\n\n// 16 >> 32\ninline v_int32x8 v_dotprod(const v_int16x16& a, const v_int16x16& b)\n{ return v_int32x8(_mm256_madd_epi16(a.val, b.val)); }\ninline v_int32x8 v_dotprod(const v_int16x16& a, const v_int16x16& b, const v_int32x8& c)\n{ return v_dotprod(a, b) + c; }\n\n// 32 >> 64\ninline v_int64x4 v_dotprod(const v_int32x8& a, const v_int32x8& b)\n{\n    __m256i even = _mm256_mul_epi32(a.val, b.val);\n    __m256i odd = _mm256_mul_epi32(_mm256_srli_epi64(a.val, 32), _mm256_srli_epi64(b.val, 32));\n    return v_int64x4(_mm256_add_epi64(even, odd));\n}\ninline v_int64x4 v_dotprod(const v_int32x8& a, const v_int32x8& b, const v_int64x4& c)\n{ return v_dotprod(a, b) + c; }\n\n// 8 >> 32\ninline v_uint32x8 v_dotprod_expand(const v_uint8x32& a, const v_uint8x32& b)\n{\n    __m256i even_m = _mm256_set1_epi32(0xFF00FF00);\n    __m256i even_a = _mm256_blendv_epi8(a.val, _mm256_setzero_si256(), even_m);\n    __m256i odd_a  = _mm256_srli_epi16(a.val, 8);\n\n    __m256i even_b = _mm256_blendv_epi8(b.val, _mm256_setzero_si256(), even_m);\n    __m256i odd_b  = _mm256_srli_epi16(b.val, 8);\n\n    __m256i prod0  = _mm256_madd_epi16(even_a, even_b);\n    __m256i prod1  = _mm256_madd_epi16(odd_a, odd_b);\n    return v_uint32x8(_mm256_add_epi32(prod0, prod1));\n}\ninline v_uint32x8 v_dotprod_expand(const v_uint8x32& a, const v_uint8x32& b, const v_uint32x8& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int32x8 v_dotprod_expand(const v_int8x32& a, const v_int8x32& b)\n{\n    __m256i even_a = _mm256_srai_epi16(_mm256_bslli_epi128(a.val, 1), 8);\n    __m256i odd_a  = _mm256_srai_epi16(a.val, 8);\n\n    __m256i even_b = _mm256_srai_epi16(_mm256_bslli_epi128(b.val, 1), 8);\n    __m256i odd_b  = _mm256_srai_epi16(b.val, 8);\n\n    __m256i prod0  = _mm256_madd_epi16(even_a, even_b);\n    __m256i prod1  = _mm256_madd_epi16(odd_a, odd_b);\n    return v_int32x8(_mm256_add_epi32(prod0, prod1));\n}\ninline v_int32x8 v_dotprod_expand(const v_int8x32& a, const v_int8x32& b, const v_int32x8& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 16 >> 64\ninline v_uint64x4 v_dotprod_expand(const v_uint16x16& a, const v_uint16x16& b)\n{\n    __m256i mullo = _mm256_mullo_epi16(a.val, b.val);\n    __m256i mulhi = _mm256_mulhi_epu16(a.val, b.val);\n    __m256i mul0  = _mm256_unpacklo_epi16(mullo, mulhi);\n    __m256i mul1  = _mm256_unpackhi_epi16(mullo, mulhi);\n\n    __m256i p02   = _mm256_blend_epi32(mul0, _mm256_setzero_si256(), 0xAA);\n    __m256i p13   = _mm256_srli_epi64(mul0, 32);\n    __m256i p46   = _mm256_blend_epi32(mul1, _mm256_setzero_si256(), 0xAA);\n    __m256i p57   = _mm256_srli_epi64(mul1, 32);\n\n    __m256i p15_  = _mm256_add_epi64(p02, p13);\n    __m256i p9d_  = _mm256_add_epi64(p46, p57);\n\n    return v_uint64x4(_mm256_add_epi64(\n        _mm256_unpacklo_epi64(p15_, p9d_),\n        _mm256_unpackhi_epi64(p15_, p9d_)\n    ));\n}\ninline v_uint64x4 v_dotprod_expand(const v_uint16x16& a, const v_uint16x16& b, const v_uint64x4& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int64x4 v_dotprod_expand(const v_int16x16& a, const v_int16x16& b)\n{\n    __m256i prod = _mm256_madd_epi16(a.val, b.val);\n    __m256i sign = _mm256_srai_epi32(prod, 31);\n\n    __m256i lo = _mm256_unpacklo_epi32(prod, sign);\n    __m256i hi = _mm256_unpackhi_epi32(prod, sign);\n\n    return v_int64x4(_mm256_add_epi64(\n        _mm256_unpacklo_epi64(lo, hi),\n        _mm256_unpackhi_epi64(lo, hi)\n    ));\n}\ninline v_int64x4 v_dotprod_expand(const v_int16x16& a, const v_int16x16& b, const v_int64x4& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 32 >> 64f\ninline v_float64x4 v_dotprod_expand(const v_int32x8& a, const v_int32x8& b)\n{ return v_cvt_f64(v_dotprod(a, b)); }\ninline v_float64x4 v_dotprod_expand(const v_int32x8& a, const v_int32x8& b, const v_float64x4& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n//////// Fast Dot Product ////////\n\n// 16 >> 32\ninline v_int32x8 v_dotprod_fast(const v_int16x16& a, const v_int16x16& b)\n{ return v_dotprod(a, b); }\ninline v_int32x8 v_dotprod_fast(const v_int16x16& a, const v_int16x16& b, const v_int32x8& c)\n{ return v_dotprod(a, b, c); }\n\n// 32 >> 64\ninline v_int64x4 v_dotprod_fast(const v_int32x8& a, const v_int32x8& b)\n{ return v_dotprod(a, b); }\ninline v_int64x4 v_dotprod_fast(const v_int32x8& a, const v_int32x8& b, const v_int64x4& c)\n{ return v_dotprod(a, b, c); }\n\n// 8 >> 32\ninline v_uint32x8 v_dotprod_expand_fast(const v_uint8x32& a, const v_uint8x32& b)\n{ return v_dotprod_expand(a, b); }\ninline v_uint32x8 v_dotprod_expand_fast(const v_uint8x32& a, const v_uint8x32& b, const v_uint32x8& c)\n{ return v_dotprod_expand(a, b, c); }\n\ninline v_int32x8 v_dotprod_expand_fast(const v_int8x32& a, const v_int8x32& b)\n{ return v_dotprod_expand(a, b); }\ninline v_int32x8 v_dotprod_expand_fast(const v_int8x32& a, const v_int8x32& b, const v_int32x8& c)\n{ return v_dotprod_expand(a, b, c); }\n\n// 16 >> 64\ninline v_uint64x4 v_dotprod_expand_fast(const v_uint16x16& a, const v_uint16x16& b)\n{\n    __m256i mullo = _mm256_mullo_epi16(a.val, b.val);\n    __m256i mulhi = _mm256_mulhi_epu16(a.val, b.val);\n    __m256i mul0  = _mm256_unpacklo_epi16(mullo, mulhi);\n    __m256i mul1  = _mm256_unpackhi_epi16(mullo, mulhi);\n\n    __m256i p02   = _mm256_blend_epi32(mul0, _mm256_setzero_si256(), 0xAA);\n    __m256i p13   = _mm256_srli_epi64(mul0, 32);\n    __m256i p46   = _mm256_blend_epi32(mul1, _mm256_setzero_si256(), 0xAA);\n    __m256i p57   = _mm256_srli_epi64(mul1, 32);\n\n    __m256i p15_  = _mm256_add_epi64(p02, p13);\n    __m256i p9d_  = _mm256_add_epi64(p46, p57);\n\n    return v_uint64x4(_mm256_add_epi64(p15_, p9d_));\n}\ninline v_uint64x4 v_dotprod_expand_fast(const v_uint16x16& a, const v_uint16x16& b, const v_uint64x4& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\ninline v_int64x4 v_dotprod_expand_fast(const v_int16x16& a, const v_int16x16& b)\n{\n    __m256i prod = _mm256_madd_epi16(a.val, b.val);\n    __m256i sign = _mm256_srai_epi32(prod, 31);\n    __m256i lo = _mm256_unpacklo_epi32(prod, sign);\n    __m256i hi = _mm256_unpackhi_epi32(prod, sign);\n    return v_int64x4(_mm256_add_epi64(lo, hi));\n}\ninline v_int64x4 v_dotprod_expand_fast(const v_int16x16& a, const v_int16x16& b, const v_int64x4& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\n// 32 >> 64f\ninline v_float64x4 v_dotprod_expand_fast(const v_int32x8& a, const v_int32x8& b)\n{ return v_dotprod_expand(a, b); }\ninline v_float64x4 v_dotprod_expand_fast(const v_int32x8& a, const v_int32x8& b, const v_float64x4& c)\n{ return v_dotprod_expand(a, b, c); }\n\n#define OPENCV_HAL_AVX_SPLAT2_PS(a, im) \\\n    v_float32x8(_mm256_permute_ps(a.val, _MM_SHUFFLE(im, im, im, im)))\n\ninline v_float32x8 v_matmul(const v_float32x8& v, const v_float32x8& m0,\n                            const v_float32x8& m1, const v_float32x8& m2,\n                            const v_float32x8& m3)\n{\n    v_float32x8 v04 = OPENCV_HAL_AVX_SPLAT2_PS(v, 0);\n    v_float32x8 v15 = OPENCV_HAL_AVX_SPLAT2_PS(v, 1);\n    v_float32x8 v26 = OPENCV_HAL_AVX_SPLAT2_PS(v, 2);\n    v_float32x8 v37 = OPENCV_HAL_AVX_SPLAT2_PS(v, 3);\n    return v_fma(v04, m0, v_fma(v15, m1, v_fma(v26, m2, v37 * m3)));\n}\n\ninline v_float32x8 v_matmuladd(const v_float32x8& v, const v_float32x8& m0,\n                               const v_float32x8& m1, const v_float32x8& m2,\n                               const v_float32x8& a)\n{\n    v_float32x8 v04 = OPENCV_HAL_AVX_SPLAT2_PS(v, 0);\n    v_float32x8 v15 = OPENCV_HAL_AVX_SPLAT2_PS(v, 1);\n    v_float32x8 v26 = OPENCV_HAL_AVX_SPLAT2_PS(v, 2);\n    return v_fma(v04, m0, v_fma(v15, m1, v_fma(v26, m2, a)));\n}\n\n#define OPENCV_HAL_IMPL_AVX_TRANSPOSE4x4(_Tpvec, suffix, cast_from, cast_to)    \\\n    inline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1,              \\\n                               const _Tpvec& a2, const _Tpvec& a3,              \\\n                               _Tpvec& b0, _Tpvec& b1, _Tpvec& b2, _Tpvec& b3)  \\\n    {                                                                           \\\n        __m256i t0 = cast_from(_mm256_unpacklo_##suffix(a0.val, a1.val));       \\\n        __m256i t1 = cast_from(_mm256_unpacklo_##suffix(a2.val, a3.val));       \\\n        __m256i t2 = cast_from(_mm256_unpackhi_##suffix(a0.val, a1.val));       \\\n        __m256i t3 = cast_from(_mm256_unpackhi_##suffix(a2.val, a3.val));       \\\n        b0.val = cast_to(_mm256_unpacklo_epi64(t0, t1));                        \\\n        b1.val = cast_to(_mm256_unpackhi_epi64(t0, t1));                        \\\n        b2.val = cast_to(_mm256_unpacklo_epi64(t2, t3));                        \\\n        b3.val = cast_to(_mm256_unpackhi_epi64(t2, t3));                        \\\n    }\n\nOPENCV_HAL_IMPL_AVX_TRANSPOSE4x4(v_uint32x8,  epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_AVX_TRANSPOSE4x4(v_int32x8,   epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_AVX_TRANSPOSE4x4(v_float32x8, ps, _mm256_castps_si256, _mm256_castsi256_ps)\n\n//////////////// Value reordering ///////////////\n\n/* Expand */\n#define OPENCV_HAL_IMPL_AVX_EXPAND(_Tpvec, _Tpwvec, _Tp, intrin)    \\\n    inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \\\n    {                                                               \\\n        b0.val = intrin(_v256_extract_low(a.val));                  \\\n        b1.val = intrin(_v256_extract_high(a.val));                 \\\n    }                                                               \\\n    inline _Tpwvec v_expand_low(const _Tpvec& a)                    \\\n    { return _Tpwvec(intrin(_v256_extract_low(a.val))); }           \\\n    inline _Tpwvec v_expand_high(const _Tpvec& a)                   \\\n    { return _Tpwvec(intrin(_v256_extract_high(a.val))); }          \\\n    inline _Tpwvec v256_load_expand(const _Tp* ptr)                 \\\n    {                                                               \\\n        __m128i a = _mm_loadu_si128((const __m128i*)ptr);           \\\n        return _Tpwvec(intrin(a));                                  \\\n    }\n\nOPENCV_HAL_IMPL_AVX_EXPAND(v_uint8x32,  v_uint16x16, uchar,    _mm256_cvtepu8_epi16)\nOPENCV_HAL_IMPL_AVX_EXPAND(v_int8x32,   v_int16x16,  schar,    _mm256_cvtepi8_epi16)\nOPENCV_HAL_IMPL_AVX_EXPAND(v_uint16x16, v_uint32x8,  ushort,   _mm256_cvtepu16_epi32)\nOPENCV_HAL_IMPL_AVX_EXPAND(v_int16x16,  v_int32x8,   short,    _mm256_cvtepi16_epi32)\nOPENCV_HAL_IMPL_AVX_EXPAND(v_uint32x8,  v_uint64x4,  unsigned, _mm256_cvtepu32_epi64)\nOPENCV_HAL_IMPL_AVX_EXPAND(v_int32x8,   v_int64x4,   int,      _mm256_cvtepi32_epi64)\n\n#define OPENCV_HAL_IMPL_AVX_EXPAND_Q(_Tpvec, _Tp, intrin)   \\\n    inline _Tpvec v256_load_expand_q(const _Tp* ptr)        \\\n    {                                                       \\\n        __m128i a = _mm_loadl_epi64((const __m128i*)ptr);   \\\n        return _Tpvec(intrin(a));                           \\\n    }\n\nOPENCV_HAL_IMPL_AVX_EXPAND_Q(v_uint32x8, uchar, _mm256_cvtepu8_epi32)\nOPENCV_HAL_IMPL_AVX_EXPAND_Q(v_int32x8,  schar, _mm256_cvtepi8_epi32)\n\n/* pack */\n// 16\ninline v_int8x32 v_pack(const v_int16x16& a, const v_int16x16& b)\n{ return v_int8x32(_v256_shuffle_odd_64(_mm256_packs_epi16(a.val, b.val))); }\n\ninline v_uint8x32 v_pack(const v_uint16x16& a, const v_uint16x16& b)\n{\n    __m256i t = _mm256_set1_epi16(255);\n    __m256i a1 = _mm256_min_epu16(a.val, t);\n    __m256i b1 = _mm256_min_epu16(b.val, t);\n    return v_uint8x32(_v256_shuffle_odd_64(_mm256_packus_epi16(a1, b1)));\n}\n\ninline v_uint8x32 v_pack_u(const v_int16x16& a, const v_int16x16& b)\n{\n    return v_uint8x32(_v256_shuffle_odd_64(_mm256_packus_epi16(a.val, b.val)));\n}\n\ninline void v_pack_store(schar* ptr, const v_int16x16& a)\n{ v_store_low(ptr, v_pack(a, a)); }\n\ninline void v_pack_store(uchar* ptr, const v_uint16x16& a)\n{\n    const __m256i m = _mm256_set1_epi16(255);\n    __m256i am = _mm256_min_epu16(a.val, m);\n            am =  _v256_shuffle_odd_64(_mm256_packus_epi16(am, am));\n    v_store_low(ptr, v_uint8x32(am));\n}\n\ninline void v_pack_u_store(uchar* ptr, const v_int16x16& a)\n{ v_store_low(ptr, v_pack_u(a, a)); }\n\ntemplate<int n> inline\nv_uint8x32 v_rshr_pack(const v_uint16x16& a, const v_uint16x16& b)\n{\n    // we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers.\n    v_uint16x16 delta = v256_setall_u16((short)(1 << (n-1)));\n    return v_pack_u(v_reinterpret_as_s16((a + delta) >> n),\n                    v_reinterpret_as_s16((b + delta) >> n));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(uchar* ptr, const v_uint16x16& a)\n{\n    v_uint16x16 delta = v256_setall_u16((short)(1 << (n-1)));\n    v_pack_u_store(ptr, v_reinterpret_as_s16((a + delta) >> n));\n}\n\ntemplate<int n> inline\nv_uint8x32 v_rshr_pack_u(const v_int16x16& a, const v_int16x16& b)\n{\n    v_int16x16 delta = v256_setall_s16((short)(1 << (n-1)));\n    return v_pack_u((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_u_store(uchar* ptr, const v_int16x16& a)\n{\n    v_int16x16 delta = v256_setall_s16((short)(1 << (n-1)));\n    v_pack_u_store(ptr, (a + delta) >> n);\n}\n\ntemplate<int n> inline\nv_int8x32 v_rshr_pack(const v_int16x16& a, const v_int16x16& b)\n{\n    v_int16x16 delta = v256_setall_s16((short)(1 << (n-1)));\n    return v_pack((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(schar* ptr, const v_int16x16& a)\n{\n    v_int16x16 delta = v256_setall_s16((short)(1 << (n-1)));\n    v_pack_store(ptr, (a + delta) >> n);\n}\n\n// 32\ninline v_int16x16 v_pack(const v_int32x8& a, const v_int32x8& b)\n{ return v_int16x16(_v256_shuffle_odd_64(_mm256_packs_epi32(a.val, b.val))); }\n\ninline v_uint16x16 v_pack(const v_uint32x8& a, const v_uint32x8& b)\n{ return v_uint16x16(_v256_shuffle_odd_64(_v256_packs_epu32(a.val, b.val))); }\n\ninline v_uint16x16 v_pack_u(const v_int32x8& a, const v_int32x8& b)\n{ return v_uint16x16(_v256_shuffle_odd_64(_mm256_packus_epi32(a.val, b.val))); }\n\ninline void v_pack_store(short* ptr, const v_int32x8& a)\n{ v_store_low(ptr, v_pack(a, a)); }\n\ninline void v_pack_store(ushort* ptr, const v_uint32x8& a)\n{\n    const __m256i m = _mm256_set1_epi32(65535);\n    __m256i am = _mm256_min_epu32(a.val, m);\n            am = _v256_shuffle_odd_64(_mm256_packus_epi32(am, am));\n    v_store_low(ptr, v_uint16x16(am));\n}\n\ninline void v_pack_u_store(ushort* ptr, const v_int32x8& a)\n{ v_store_low(ptr, v_pack_u(a, a)); }\n\n\ntemplate<int n> inline\nv_uint16x16 v_rshr_pack(const v_uint32x8& a, const v_uint32x8& b)\n{\n    // we assume that n > 0, and so the shifted 32-bit values can be treated as signed numbers.\n    v_uint32x8 delta = v256_setall_u32(1 << (n-1));\n    return v_pack_u(v_reinterpret_as_s32((a + delta) >> n),\n                    v_reinterpret_as_s32((b + delta) >> n));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(ushort* ptr, const v_uint32x8& a)\n{\n    v_uint32x8 delta = v256_setall_u32(1 << (n-1));\n    v_pack_u_store(ptr, v_reinterpret_as_s32((a + delta) >> n));\n}\n\ntemplate<int n> inline\nv_uint16x16 v_rshr_pack_u(const v_int32x8& a, const v_int32x8& b)\n{\n    v_int32x8 delta = v256_setall_s32(1 << (n-1));\n    return v_pack_u((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_u_store(ushort* ptr, const v_int32x8& a)\n{\n    v_int32x8 delta = v256_setall_s32(1 << (n-1));\n    v_pack_u_store(ptr, (a + delta) >> n);\n}\n\ntemplate<int n> inline\nv_int16x16 v_rshr_pack(const v_int32x8& a, const v_int32x8& b)\n{\n    v_int32x8 delta = v256_setall_s32(1 << (n-1));\n    return v_pack((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(short* ptr, const v_int32x8& a)\n{\n    v_int32x8 delta = v256_setall_s32(1 << (n-1));\n    v_pack_store(ptr, (a + delta) >> n);\n}\n\n// 64\n// Non-saturating pack\ninline v_uint32x8 v_pack(const v_uint64x4& a, const v_uint64x4& b)\n{\n    __m256i a0 = _mm256_shuffle_epi32(a.val, _MM_SHUFFLE(0, 0, 2, 0));\n    __m256i b0 = _mm256_shuffle_epi32(b.val, _MM_SHUFFLE(0, 0, 2, 0));\n    __m256i ab = _mm256_unpacklo_epi64(a0, b0); // a0, a1, b0, b1, a2, a3, b2, b3\n    return v_uint32x8(_v256_shuffle_odd_64(ab));\n}\n\ninline v_int32x8 v_pack(const v_int64x4& a, const v_int64x4& b)\n{ return v_reinterpret_as_s32(v_pack(v_reinterpret_as_u64(a), v_reinterpret_as_u64(b))); }\n\ninline void v_pack_store(unsigned* ptr, const v_uint64x4& a)\n{\n    __m256i a0 = _mm256_shuffle_epi32(a.val, _MM_SHUFFLE(0, 0, 2, 0));\n    v_store_low(ptr, v_uint32x8(_v256_shuffle_odd_64(a0)));\n}\n\ninline void v_pack_store(int* ptr, const v_int64x4& b)\n{ v_pack_store((unsigned*)ptr, v_reinterpret_as_u64(b)); }\n\ntemplate<int n> inline\nv_uint32x8 v_rshr_pack(const v_uint64x4& a, const v_uint64x4& b)\n{\n    v_uint64x4 delta = v256_setall_u64((uint64)1 << (n-1));\n    return v_pack((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(unsigned* ptr, const v_uint64x4& a)\n{\n    v_uint64x4 delta = v256_setall_u64((uint64)1 << (n-1));\n    v_pack_store(ptr, (a + delta) >> n);\n}\n\ntemplate<int n> inline\nv_int32x8 v_rshr_pack(const v_int64x4& a, const v_int64x4& b)\n{\n    v_int64x4 delta = v256_setall_s64((int64)1 << (n-1));\n    return v_pack((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(int* ptr, const v_int64x4& a)\n{\n    v_int64x4 delta = v256_setall_s64((int64)1 << (n-1));\n    v_pack_store(ptr, (a + delta) >> n);\n}\n\n// pack boolean\ninline v_uint8x32 v_pack_b(const v_uint16x16& a, const v_uint16x16& b)\n{\n    __m256i ab = _mm256_packs_epi16(a.val, b.val);\n    return v_uint8x32(_v256_shuffle_odd_64(ab));\n}\n\ninline v_uint8x32 v_pack_b(const v_uint32x8& a, const v_uint32x8& b,\n                           const v_uint32x8& c, const v_uint32x8& d)\n{\n    __m256i ab = _mm256_packs_epi32(a.val, b.val);\n    __m256i cd = _mm256_packs_epi32(c.val, d.val);\n\n    __m256i abcd = _v256_shuffle_odd_64(_mm256_packs_epi16(ab, cd));\n    return v_uint8x32(_mm256_shuffle_epi32(abcd, _MM_SHUFFLE(3, 1, 2, 0)));\n}\n\ninline v_uint8x32 v_pack_b(const v_uint64x4& a, const v_uint64x4& b, const v_uint64x4& c,\n                           const v_uint64x4& d, const v_uint64x4& e, const v_uint64x4& f,\n                           const v_uint64x4& g, const v_uint64x4& h)\n{\n    __m256i ab = _mm256_packs_epi32(a.val, b.val);\n    __m256i cd = _mm256_packs_epi32(c.val, d.val);\n    __m256i ef = _mm256_packs_epi32(e.val, f.val);\n    __m256i gh = _mm256_packs_epi32(g.val, h.val);\n\n    __m256i abcd = _mm256_packs_epi32(ab, cd);\n    __m256i efgh = _mm256_packs_epi32(ef, gh);\n    __m256i pkall = _v256_shuffle_odd_64(_mm256_packs_epi16(abcd, efgh));\n\n    __m256i rev = _mm256_alignr_epi8(pkall, pkall, 8);\n    return v_uint8x32(_mm256_unpacklo_epi16(pkall, rev));\n}\n\n/* Recombine */\n// its up there with load and store operations\n\n/* Extract */\n#define OPENCV_HAL_IMPL_AVX_EXTRACT(_Tpvec)                    \\\n    template<int s>                                            \\\n    inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b)  \\\n    { return v_rotate_right<s>(a, b); }\n\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_uint8x32)\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_int8x32)\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_uint16x16)\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_int16x16)\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_uint32x8)\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_int32x8)\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_uint64x4)\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_int64x4)\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_float32x8)\nOPENCV_HAL_IMPL_AVX_EXTRACT(v_float64x4)\n\ntemplate<int i>\ninline uchar v_extract_n(v_uint8x32 a)\n{\n    return (uchar)_v256_extract_epi8<i>(a.val);\n}\n\ntemplate<int i>\ninline schar v_extract_n(v_int8x32 a)\n{\n    return (schar)v_extract_n<i>(v_reinterpret_as_u8(a));\n}\n\ntemplate<int i>\ninline ushort v_extract_n(v_uint16x16 a)\n{\n    return (ushort)_v256_extract_epi16<i>(a.val);\n}\n\ntemplate<int i>\ninline short v_extract_n(v_int16x16 a)\n{\n    return (short)v_extract_n<i>(v_reinterpret_as_u16(a));\n}\n\ntemplate<int i>\ninline uint v_extract_n(v_uint32x8 a)\n{\n    return (uint)_v256_extract_epi32<i>(a.val);\n}\n\ntemplate<int i>\ninline int v_extract_n(v_int32x8 a)\n{\n    return (int)v_extract_n<i>(v_reinterpret_as_u32(a));\n}\n\ntemplate<int i>\ninline uint64 v_extract_n(v_uint64x4 a)\n{\n    return (uint64)_v256_extract_epi64<i>(a.val);\n}\n\ntemplate<int i>\ninline int64 v_extract_n(v_int64x4 v)\n{\n    return (int64)v_extract_n<i>(v_reinterpret_as_u64(v));\n}\n\ntemplate<int i>\ninline float v_extract_n(v_float32x8 v)\n{\n    union { uint iv; float fv; } d;\n    d.iv = v_extract_n<i>(v_reinterpret_as_u32(v));\n    return d.fv;\n}\n\ntemplate<int i>\ninline double v_extract_n(v_float64x4 v)\n{\n    union { uint64 iv; double dv; } d;\n    d.iv = v_extract_n<i>(v_reinterpret_as_u64(v));\n    return d.dv;\n}\n\ntemplate<int i>\ninline v_uint32x8 v_broadcast_element(v_uint32x8 a)\n{\n    static const __m256i perm = _mm256_set1_epi32((char)i);\n    return v_uint32x8(_mm256_permutevar8x32_epi32(a.val, perm));\n}\n\ntemplate<int i>\ninline v_int32x8 v_broadcast_element(const v_int32x8 &a)\n{ return v_reinterpret_as_s32(v_broadcast_element<i>(v_reinterpret_as_u32(a))); }\n\ntemplate<int i>\ninline v_float32x8 v_broadcast_element(const v_float32x8 &a)\n{ return v_reinterpret_as_f32(v_broadcast_element<i>(v_reinterpret_as_u32(a))); }\n\n\n///////////////////// load deinterleave /////////////////////////////\n\ninline void v_load_deinterleave( const uchar* ptr, v_uint8x32& a, v_uint8x32& b )\n{\n    __m256i ab0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i ab1 = _mm256_loadu_si256((const __m256i*)(ptr + 32));\n\n    const __m256i sh = _mm256_setr_epi8(0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15,\n                                               0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15);\n    __m256i p0 = _mm256_shuffle_epi8(ab0, sh);\n    __m256i p1 = _mm256_shuffle_epi8(ab1, sh);\n    __m256i pl = _mm256_permute2x128_si256(p0, p1, 0 + 2*16);\n    __m256i ph = _mm256_permute2x128_si256(p0, p1, 1 + 3*16);\n    __m256i a0 = _mm256_unpacklo_epi64(pl, ph);\n    __m256i b0 = _mm256_unpackhi_epi64(pl, ph);\n    a = v_uint8x32(a0);\n    b = v_uint8x32(b0);\n}\n\ninline void v_load_deinterleave( const ushort* ptr, v_uint16x16& a, v_uint16x16& b )\n{\n    __m256i ab0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i ab1 = _mm256_loadu_si256((const __m256i*)(ptr + 16));\n\n    const __m256i sh = _mm256_setr_epi8(0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15,\n                                               0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15);\n    __m256i p0 = _mm256_shuffle_epi8(ab0, sh);\n    __m256i p1 = _mm256_shuffle_epi8(ab1, sh);\n    __m256i pl = _mm256_permute2x128_si256(p0, p1, 0 + 2*16);\n    __m256i ph = _mm256_permute2x128_si256(p0, p1, 1 + 3*16);\n    __m256i a0 = _mm256_unpacklo_epi64(pl, ph);\n    __m256i b0 = _mm256_unpackhi_epi64(pl, ph);\n    a = v_uint16x16(a0);\n    b = v_uint16x16(b0);\n}\n\ninline void v_load_deinterleave( const unsigned* ptr, v_uint32x8& a, v_uint32x8& b )\n{\n    __m256i ab0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i ab1 = _mm256_loadu_si256((const __m256i*)(ptr + 8));\n\n    const int sh = 0+2*4+1*16+3*64;\n    __m256i p0 = _mm256_shuffle_epi32(ab0, sh);\n    __m256i p1 = _mm256_shuffle_epi32(ab1, sh);\n    __m256i pl = _mm256_permute2x128_si256(p0, p1, 0 + 2*16);\n    __m256i ph = _mm256_permute2x128_si256(p0, p1, 1 + 3*16);\n    __m256i a0 = _mm256_unpacklo_epi64(pl, ph);\n    __m256i b0 = _mm256_unpackhi_epi64(pl, ph);\n    a = v_uint32x8(a0);\n    b = v_uint32x8(b0);\n}\n\ninline void v_load_deinterleave( const uint64* ptr, v_uint64x4& a, v_uint64x4& b )\n{\n    __m256i ab0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i ab1 = _mm256_loadu_si256((const __m256i*)(ptr + 4));\n\n    __m256i pl = _mm256_permute2x128_si256(ab0, ab1, 0 + 2*16);\n    __m256i ph = _mm256_permute2x128_si256(ab0, ab1, 1 + 3*16);\n    __m256i a0 = _mm256_unpacklo_epi64(pl, ph);\n    __m256i b0 = _mm256_unpackhi_epi64(pl, ph);\n    a = v_uint64x4(a0);\n    b = v_uint64x4(b0);\n}\n\ninline void v_load_deinterleave( const uchar* ptr, v_uint8x32& a, v_uint8x32& b, v_uint8x32& c )\n{\n    __m256i bgr0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i bgr1 = _mm256_loadu_si256((const __m256i*)(ptr + 32));\n    __m256i bgr2 = _mm256_loadu_si256((const __m256i*)(ptr + 64));\n\n    __m256i s02_low = _mm256_permute2x128_si256(bgr0, bgr2, 0 + 2*16);\n    __m256i s02_high = _mm256_permute2x128_si256(bgr0, bgr2, 1 + 3*16);\n\n    const __m256i m0 = _mm256_setr_epi8(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0,\n                                               0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0);\n    const __m256i m1 = _mm256_setr_epi8(0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0,\n                                               -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);\n\n    __m256i b0 = _mm256_blendv_epi8(_mm256_blendv_epi8(s02_low, s02_high, m0), bgr1, m1);\n    __m256i g0 = _mm256_blendv_epi8(_mm256_blendv_epi8(s02_high, s02_low, m1), bgr1, m0);\n    __m256i r0 = _mm256_blendv_epi8(_mm256_blendv_epi8(bgr1, s02_low, m0), s02_high, m1);\n\n    const __m256i\n    sh_b = _mm256_setr_epi8(0, 3, 6, 9, 12, 15, 2, 5, 8, 11, 14, 1, 4, 7, 10, 13,\n                            0, 3, 6, 9, 12, 15, 2, 5, 8, 11, 14, 1, 4, 7, 10, 13),\n    sh_g = _mm256_setr_epi8(1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, 5, 8, 11, 14,\n                            1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, 5, 8, 11, 14),\n    sh_r = _mm256_setr_epi8(2, 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15,\n                            2, 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15);\n    b0 = _mm256_shuffle_epi8(b0, sh_b);\n    g0 = _mm256_shuffle_epi8(g0, sh_g);\n    r0 = _mm256_shuffle_epi8(r0, sh_r);\n\n    a = v_uint8x32(b0);\n    b = v_uint8x32(g0);\n    c = v_uint8x32(r0);\n}\n\ninline void v_load_deinterleave( const ushort* ptr, v_uint16x16& a, v_uint16x16& b, v_uint16x16& c )\n{\n    __m256i bgr0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i bgr1 = _mm256_loadu_si256((const __m256i*)(ptr + 16));\n    __m256i bgr2 = _mm256_loadu_si256((const __m256i*)(ptr + 32));\n\n    __m256i s02_low = _mm256_permute2x128_si256(bgr0, bgr2, 0 + 2*16);\n    __m256i s02_high = _mm256_permute2x128_si256(bgr0, bgr2, 1 + 3*16);\n\n    const __m256i m0 = _mm256_setr_epi8(0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1,\n                                               0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0);\n    const __m256i m1 = _mm256_setr_epi8(0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0,\n                                               -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0);\n    __m256i b0 = _mm256_blendv_epi8(_mm256_blendv_epi8(s02_low, s02_high, m0), bgr1, m1);\n    __m256i g0 = _mm256_blendv_epi8(_mm256_blendv_epi8(bgr1, s02_low, m0), s02_high, m1);\n    __m256i r0 = _mm256_blendv_epi8(_mm256_blendv_epi8(s02_high, s02_low, m1), bgr1, m0);\n    const __m256i sh_b = _mm256_setr_epi8(0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11,\n                                                 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11);\n    const __m256i sh_g = _mm256_setr_epi8(2, 3, 8, 9, 14, 15, 4, 5, 10, 11, 0, 1, 6, 7, 12, 13,\n                                                 2, 3, 8, 9, 14, 15, 4, 5, 10, 11, 0, 1, 6, 7, 12, 13);\n    const __m256i sh_r = _mm256_setr_epi8(4, 5, 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15,\n                                                 4, 5, 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15);\n    b0 = _mm256_shuffle_epi8(b0, sh_b);\n    g0 = _mm256_shuffle_epi8(g0, sh_g);\n    r0 = _mm256_shuffle_epi8(r0, sh_r);\n\n    a = v_uint16x16(b0);\n    b = v_uint16x16(g0);\n    c = v_uint16x16(r0);\n}\n\ninline void v_load_deinterleave( const unsigned* ptr, v_uint32x8& a, v_uint32x8& b, v_uint32x8& c )\n{\n    __m256i bgr0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i bgr1 = _mm256_loadu_si256((const __m256i*)(ptr + 8));\n    __m256i bgr2 = _mm256_loadu_si256((const __m256i*)(ptr + 16));\n\n    __m256i s02_low = _mm256_permute2x128_si256(bgr0, bgr2, 0 + 2*16);\n    __m256i s02_high = _mm256_permute2x128_si256(bgr0, bgr2, 1 + 3*16);\n\n    __m256i b0 = _mm256_blend_epi32(_mm256_blend_epi32(s02_low, s02_high, 0x24), bgr1, 0x92);\n    __m256i g0 = _mm256_blend_epi32(_mm256_blend_epi32(s02_high, s02_low, 0x92), bgr1, 0x24);\n    __m256i r0 = _mm256_blend_epi32(_mm256_blend_epi32(bgr1, s02_low, 0x24), s02_high, 0x92);\n\n    b0 = _mm256_shuffle_epi32(b0, 0x6c);\n    g0 = _mm256_shuffle_epi32(g0, 0xb1);\n    r0 = _mm256_shuffle_epi32(r0, 0xc6);\n\n    a = v_uint32x8(b0);\n    b = v_uint32x8(g0);\n    c = v_uint32x8(r0);\n}\n\ninline void v_load_deinterleave( const uint64* ptr, v_uint64x4& a, v_uint64x4& b, v_uint64x4& c )\n{\n    __m256i bgr0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i bgr1 = _mm256_loadu_si256((const __m256i*)(ptr + 4));\n    __m256i bgr2 = _mm256_loadu_si256((const __m256i*)(ptr + 8));\n\n    __m256i s01 = _mm256_blend_epi32(bgr0, bgr1, 0xf0);\n    __m256i s12 = _mm256_blend_epi32(bgr1, bgr2, 0xf0);\n    __m256i s20r = _mm256_permute4x64_epi64(_mm256_blend_epi32(bgr2, bgr0, 0xf0), 0x1b);\n    __m256i b0 = _mm256_unpacklo_epi64(s01, s20r);\n    __m256i g0 = _mm256_alignr_epi8(s12, s01, 8);\n    __m256i r0 = _mm256_unpackhi_epi64(s20r, s12);\n\n    a = v_uint64x4(b0);\n    b = v_uint64x4(g0);\n    c = v_uint64x4(r0);\n}\n\ninline void v_load_deinterleave( const uchar* ptr, v_uint8x32& a, v_uint8x32& b, v_uint8x32& c, v_uint8x32& d )\n{\n    __m256i bgr0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i bgr1 = _mm256_loadu_si256((const __m256i*)(ptr + 32));\n    __m256i bgr2 = _mm256_loadu_si256((const __m256i*)(ptr + 64));\n    __m256i bgr3 = _mm256_loadu_si256((const __m256i*)(ptr + 96));\n    const __m256i sh = _mm256_setr_epi8(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15,\n                                               0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15);\n\n    __m256i p0 = _mm256_shuffle_epi8(bgr0, sh);\n    __m256i p1 = _mm256_shuffle_epi8(bgr1, sh);\n    __m256i p2 = _mm256_shuffle_epi8(bgr2, sh);\n    __m256i p3 = _mm256_shuffle_epi8(bgr3, sh);\n\n    __m256i p01l = _mm256_unpacklo_epi32(p0, p1);\n    __m256i p01h = _mm256_unpackhi_epi32(p0, p1);\n    __m256i p23l = _mm256_unpacklo_epi32(p2, p3);\n    __m256i p23h = _mm256_unpackhi_epi32(p2, p3);\n\n    __m256i pll = _mm256_permute2x128_si256(p01l, p23l, 0 + 2*16);\n    __m256i plh = _mm256_permute2x128_si256(p01l, p23l, 1 + 3*16);\n    __m256i phl = _mm256_permute2x128_si256(p01h, p23h, 0 + 2*16);\n    __m256i phh = _mm256_permute2x128_si256(p01h, p23h, 1 + 3*16);\n\n    __m256i b0 = _mm256_unpacklo_epi32(pll, plh);\n    __m256i g0 = _mm256_unpackhi_epi32(pll, plh);\n    __m256i r0 = _mm256_unpacklo_epi32(phl, phh);\n    __m256i a0 = _mm256_unpackhi_epi32(phl, phh);\n\n    a = v_uint8x32(b0);\n    b = v_uint8x32(g0);\n    c = v_uint8x32(r0);\n    d = v_uint8x32(a0);\n}\n\ninline void v_load_deinterleave( const ushort* ptr, v_uint16x16& a, v_uint16x16& b, v_uint16x16& c, v_uint16x16& d )\n{\n    __m256i bgr0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i bgr1 = _mm256_loadu_si256((const __m256i*)(ptr + 16));\n    __m256i bgr2 = _mm256_loadu_si256((const __m256i*)(ptr + 32));\n    __m256i bgr3 = _mm256_loadu_si256((const __m256i*)(ptr + 48));\n    const __m256i sh = _mm256_setr_epi8(0, 1, 8, 9, 2, 3, 10, 11, 4, 5, 12, 13, 6, 7, 14, 15,\n                                               0, 1, 8, 9, 2, 3, 10, 11, 4, 5, 12, 13, 6, 7, 14, 15);\n    __m256i p0 = _mm256_shuffle_epi8(bgr0, sh);\n    __m256i p1 = _mm256_shuffle_epi8(bgr1, sh);\n    __m256i p2 = _mm256_shuffle_epi8(bgr2, sh);\n    __m256i p3 = _mm256_shuffle_epi8(bgr3, sh);\n\n    __m256i p01l = _mm256_unpacklo_epi32(p0, p1);\n    __m256i p01h = _mm256_unpackhi_epi32(p0, p1);\n    __m256i p23l = _mm256_unpacklo_epi32(p2, p3);\n    __m256i p23h = _mm256_unpackhi_epi32(p2, p3);\n\n    __m256i pll = _mm256_permute2x128_si256(p01l, p23l, 0 + 2*16);\n    __m256i plh = _mm256_permute2x128_si256(p01l, p23l, 1 + 3*16);\n    __m256i phl = _mm256_permute2x128_si256(p01h, p23h, 0 + 2*16);\n    __m256i phh = _mm256_permute2x128_si256(p01h, p23h, 1 + 3*16);\n\n    __m256i b0 = _mm256_unpacklo_epi32(pll, plh);\n    __m256i g0 = _mm256_unpackhi_epi32(pll, plh);\n    __m256i r0 = _mm256_unpacklo_epi32(phl, phh);\n    __m256i a0 = _mm256_unpackhi_epi32(phl, phh);\n\n    a = v_uint16x16(b0);\n    b = v_uint16x16(g0);\n    c = v_uint16x16(r0);\n    d = v_uint16x16(a0);\n}\n\ninline void v_load_deinterleave( const unsigned* ptr, v_uint32x8& a, v_uint32x8& b, v_uint32x8& c, v_uint32x8& d )\n{\n    __m256i p0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i p1 = _mm256_loadu_si256((const __m256i*)(ptr + 8));\n    __m256i p2 = _mm256_loadu_si256((const __m256i*)(ptr + 16));\n    __m256i p3 = _mm256_loadu_si256((const __m256i*)(ptr + 24));\n\n    __m256i p01l = _mm256_unpacklo_epi32(p0, p1);\n    __m256i p01h = _mm256_unpackhi_epi32(p0, p1);\n    __m256i p23l = _mm256_unpacklo_epi32(p2, p3);\n    __m256i p23h = _mm256_unpackhi_epi32(p2, p3);\n\n    __m256i pll = _mm256_permute2x128_si256(p01l, p23l, 0 + 2*16);\n    __m256i plh = _mm256_permute2x128_si256(p01l, p23l, 1 + 3*16);\n    __m256i phl = _mm256_permute2x128_si256(p01h, p23h, 0 + 2*16);\n    __m256i phh = _mm256_permute2x128_si256(p01h, p23h, 1 + 3*16);\n\n    __m256i b0 = _mm256_unpacklo_epi32(pll, plh);\n    __m256i g0 = _mm256_unpackhi_epi32(pll, plh);\n    __m256i r0 = _mm256_unpacklo_epi32(phl, phh);\n    __m256i a0 = _mm256_unpackhi_epi32(phl, phh);\n\n    a = v_uint32x8(b0);\n    b = v_uint32x8(g0);\n    c = v_uint32x8(r0);\n    d = v_uint32x8(a0);\n}\n\ninline void v_load_deinterleave( const uint64* ptr, v_uint64x4& a, v_uint64x4& b, v_uint64x4& c, v_uint64x4& d )\n{\n    __m256i bgra0 = _mm256_loadu_si256((const __m256i*)ptr);\n    __m256i bgra1 = _mm256_loadu_si256((const __m256i*)(ptr + 4));\n    __m256i bgra2 = _mm256_loadu_si256((const __m256i*)(ptr + 8));\n    __m256i bgra3 = _mm256_loadu_si256((const __m256i*)(ptr + 12));\n\n    __m256i l02 = _mm256_permute2x128_si256(bgra0, bgra2, 0 + 2*16);\n    __m256i h02 = _mm256_permute2x128_si256(bgra0, bgra2, 1 + 3*16);\n    __m256i l13 = _mm256_permute2x128_si256(bgra1, bgra3, 0 + 2*16);\n    __m256i h13 = _mm256_permute2x128_si256(bgra1, bgra3, 1 + 3*16);\n\n    __m256i b0 = _mm256_unpacklo_epi64(l02, l13);\n    __m256i g0 = _mm256_unpackhi_epi64(l02, l13);\n    __m256i r0 = _mm256_unpacklo_epi64(h02, h13);\n    __m256i a0 = _mm256_unpackhi_epi64(h02, h13);\n\n    a = v_uint64x4(b0);\n    b = v_uint64x4(g0);\n    c = v_uint64x4(r0);\n    d = v_uint64x4(a0);\n}\n\n///////////////////////////// store interleave /////////////////////////////////////\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x32& x, const v_uint8x32& y,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i xy_l = _mm256_unpacklo_epi8(x.val, y.val);\n    __m256i xy_h = _mm256_unpackhi_epi8(x.val, y.val);\n\n    __m256i xy0 = _mm256_permute2x128_si256(xy_l, xy_h, 0 + 2*16);\n    __m256i xy1 = _mm256_permute2x128_si256(xy_l, xy_h, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, xy0);\n        _mm256_stream_si256((__m256i*)(ptr + 32), xy1);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, xy0);\n        _mm256_store_si256((__m256i*)(ptr + 32), xy1);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, xy0);\n        _mm256_storeu_si256((__m256i*)(ptr + 32), xy1);\n    }\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x16& x, const v_uint16x16& y,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i xy_l = _mm256_unpacklo_epi16(x.val, y.val);\n    __m256i xy_h = _mm256_unpackhi_epi16(x.val, y.val);\n\n    __m256i xy0 = _mm256_permute2x128_si256(xy_l, xy_h, 0 + 2*16);\n    __m256i xy1 = _mm256_permute2x128_si256(xy_l, xy_h, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, xy0);\n        _mm256_stream_si256((__m256i*)(ptr + 16), xy1);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, xy0);\n        _mm256_store_si256((__m256i*)(ptr + 16), xy1);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, xy0);\n        _mm256_storeu_si256((__m256i*)(ptr + 16), xy1);\n    }\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x8& x, const v_uint32x8& y,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i xy_l = _mm256_unpacklo_epi32(x.val, y.val);\n    __m256i xy_h = _mm256_unpackhi_epi32(x.val, y.val);\n\n    __m256i xy0 = _mm256_permute2x128_si256(xy_l, xy_h, 0 + 2*16);\n    __m256i xy1 = _mm256_permute2x128_si256(xy_l, xy_h, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, xy0);\n        _mm256_stream_si256((__m256i*)(ptr + 8), xy1);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, xy0);\n        _mm256_store_si256((__m256i*)(ptr + 8), xy1);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, xy0);\n        _mm256_storeu_si256((__m256i*)(ptr + 8), xy1);\n    }\n}\n\ninline void v_store_interleave( uint64* ptr, const v_uint64x4& x, const v_uint64x4& y,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i xy_l = _mm256_unpacklo_epi64(x.val, y.val);\n    __m256i xy_h = _mm256_unpackhi_epi64(x.val, y.val);\n\n    __m256i xy0 = _mm256_permute2x128_si256(xy_l, xy_h, 0 + 2*16);\n    __m256i xy1 = _mm256_permute2x128_si256(xy_l, xy_h, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, xy0);\n        _mm256_stream_si256((__m256i*)(ptr + 4), xy1);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, xy0);\n        _mm256_store_si256((__m256i*)(ptr + 4), xy1);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, xy0);\n        _mm256_storeu_si256((__m256i*)(ptr + 4), xy1);\n    }\n}\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x32& a, const v_uint8x32& b, const v_uint8x32& c,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    const __m256i sh_b = _mm256_setr_epi8(\n            0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15, 10, 5,\n            0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15, 10, 5);\n    const __m256i sh_g = _mm256_setr_epi8(\n            5, 0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15, 10,\n            5, 0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15, 10);\n    const __m256i sh_r = _mm256_setr_epi8(\n            10, 5, 0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15,\n            10, 5, 0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15);\n\n    __m256i b0 = _mm256_shuffle_epi8(a.val, sh_b);\n    __m256i g0 = _mm256_shuffle_epi8(b.val, sh_g);\n    __m256i r0 = _mm256_shuffle_epi8(c.val, sh_r);\n\n    const __m256i m0 = _mm256_setr_epi8(0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0,\n                                               0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0);\n    const __m256i m1 = _mm256_setr_epi8(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0,\n                                               0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0);\n\n    __m256i p0 = _mm256_blendv_epi8(_mm256_blendv_epi8(b0, g0, m0), r0, m1);\n    __m256i p1 = _mm256_blendv_epi8(_mm256_blendv_epi8(g0, r0, m0), b0, m1);\n    __m256i p2 = _mm256_blendv_epi8(_mm256_blendv_epi8(r0, b0, m0), g0, m1);\n\n    __m256i bgr0 = _mm256_permute2x128_si256(p0, p1, 0 + 2*16);\n    __m256i bgr1 = _mm256_permute2x128_si256(p2, p0, 0 + 3*16);\n    __m256i bgr2 = _mm256_permute2x128_si256(p1, p2, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, bgr0);\n        _mm256_stream_si256((__m256i*)(ptr + 32), bgr1);\n        _mm256_stream_si256((__m256i*)(ptr + 64), bgr2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, bgr0);\n        _mm256_store_si256((__m256i*)(ptr + 32), bgr1);\n        _mm256_store_si256((__m256i*)(ptr + 64), bgr2);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, bgr0);\n        _mm256_storeu_si256((__m256i*)(ptr + 32), bgr1);\n        _mm256_storeu_si256((__m256i*)(ptr + 64), bgr2);\n    }\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x16& a, const v_uint16x16& b, const v_uint16x16& c,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    const __m256i sh_b = _mm256_setr_epi8(\n         0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11,\n         0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11);\n    const __m256i sh_g = _mm256_setr_epi8(\n         10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5,\n         10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5);\n    const __m256i sh_r = _mm256_setr_epi8(\n         4, 5, 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15,\n         4, 5, 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15);\n\n    __m256i b0 = _mm256_shuffle_epi8(a.val, sh_b);\n    __m256i g0 = _mm256_shuffle_epi8(b.val, sh_g);\n    __m256i r0 = _mm256_shuffle_epi8(c.val, sh_r);\n\n    const __m256i m0 = _mm256_setr_epi8(0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1,\n                                               0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0);\n    const __m256i m1 = _mm256_setr_epi8(0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0,\n                                               -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0);\n\n    __m256i p0 = _mm256_blendv_epi8(_mm256_blendv_epi8(b0, g0, m0), r0, m1);\n    __m256i p1 = _mm256_blendv_epi8(_mm256_blendv_epi8(g0, r0, m0), b0, m1);\n    __m256i p2 = _mm256_blendv_epi8(_mm256_blendv_epi8(r0, b0, m0), g0, m1);\n\n    __m256i bgr0 = _mm256_permute2x128_si256(p0, p2, 0 + 2*16);\n    //__m256i bgr1 = p1;\n    __m256i bgr2 = _mm256_permute2x128_si256(p0, p2, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, bgr0);\n        _mm256_stream_si256((__m256i*)(ptr + 16), p1);\n        _mm256_stream_si256((__m256i*)(ptr + 32), bgr2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, bgr0);\n        _mm256_store_si256((__m256i*)(ptr + 16), p1);\n        _mm256_store_si256((__m256i*)(ptr + 32), bgr2);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, bgr0);\n        _mm256_storeu_si256((__m256i*)(ptr + 16), p1);\n        _mm256_storeu_si256((__m256i*)(ptr + 32), bgr2);\n    }\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x8& a, const v_uint32x8& b, const v_uint32x8& c,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i b0 = _mm256_shuffle_epi32(a.val, 0x6c);\n    __m256i g0 = _mm256_shuffle_epi32(b.val, 0xb1);\n    __m256i r0 = _mm256_shuffle_epi32(c.val, 0xc6);\n\n    __m256i p0 = _mm256_blend_epi32(_mm256_blend_epi32(b0, g0, 0x92), r0, 0x24);\n    __m256i p1 = _mm256_blend_epi32(_mm256_blend_epi32(g0, r0, 0x92), b0, 0x24);\n    __m256i p2 = _mm256_blend_epi32(_mm256_blend_epi32(r0, b0, 0x92), g0, 0x24);\n\n    __m256i bgr0 = _mm256_permute2x128_si256(p0, p1, 0 + 2*16);\n    //__m256i bgr1 = p2;\n    __m256i bgr2 = _mm256_permute2x128_si256(p0, p1, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, bgr0);\n        _mm256_stream_si256((__m256i*)(ptr + 8), p2);\n        _mm256_stream_si256((__m256i*)(ptr + 16), bgr2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, bgr0);\n        _mm256_store_si256((__m256i*)(ptr + 8), p2);\n        _mm256_store_si256((__m256i*)(ptr + 16), bgr2);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, bgr0);\n        _mm256_storeu_si256((__m256i*)(ptr + 8), p2);\n        _mm256_storeu_si256((__m256i*)(ptr + 16), bgr2);\n    }\n}\n\ninline void v_store_interleave( uint64* ptr, const v_uint64x4& a, const v_uint64x4& b, const v_uint64x4& c,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i s01 = _mm256_unpacklo_epi64(a.val, b.val);\n    __m256i s12 = _mm256_unpackhi_epi64(b.val, c.val);\n    __m256i s20 = _mm256_blend_epi32(c.val, a.val, 0xcc);\n\n    __m256i bgr0 = _mm256_permute2x128_si256(s01, s20, 0 + 2*16);\n    __m256i bgr1 = _mm256_blend_epi32(s01, s12, 0x0f);\n    __m256i bgr2 = _mm256_permute2x128_si256(s20, s12, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, bgr0);\n        _mm256_stream_si256((__m256i*)(ptr + 4), bgr1);\n        _mm256_stream_si256((__m256i*)(ptr + 8), bgr2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, bgr0);\n        _mm256_store_si256((__m256i*)(ptr + 4), bgr1);\n        _mm256_store_si256((__m256i*)(ptr + 8), bgr2);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, bgr0);\n        _mm256_storeu_si256((__m256i*)(ptr + 4), bgr1);\n        _mm256_storeu_si256((__m256i*)(ptr + 8), bgr2);\n    }\n}\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x32& a, const v_uint8x32& b,\n                                const v_uint8x32& c, const v_uint8x32& d,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i bg0 = _mm256_unpacklo_epi8(a.val, b.val);\n    __m256i bg1 = _mm256_unpackhi_epi8(a.val, b.val);\n    __m256i ra0 = _mm256_unpacklo_epi8(c.val, d.val);\n    __m256i ra1 = _mm256_unpackhi_epi8(c.val, d.val);\n\n    __m256i bgra0_ = _mm256_unpacklo_epi16(bg0, ra0);\n    __m256i bgra1_ = _mm256_unpackhi_epi16(bg0, ra0);\n    __m256i bgra2_ = _mm256_unpacklo_epi16(bg1, ra1);\n    __m256i bgra3_ = _mm256_unpackhi_epi16(bg1, ra1);\n\n    __m256i bgra0 = _mm256_permute2x128_si256(bgra0_, bgra1_, 0 + 2*16);\n    __m256i bgra2 = _mm256_permute2x128_si256(bgra0_, bgra1_, 1 + 3*16);\n    __m256i bgra1 = _mm256_permute2x128_si256(bgra2_, bgra3_, 0 + 2*16);\n    __m256i bgra3 = _mm256_permute2x128_si256(bgra2_, bgra3_, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, bgra0);\n        _mm256_stream_si256((__m256i*)(ptr + 32), bgra1);\n        _mm256_stream_si256((__m256i*)(ptr + 64), bgra2);\n        _mm256_stream_si256((__m256i*)(ptr + 96), bgra3);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, bgra0);\n        _mm256_store_si256((__m256i*)(ptr + 32), bgra1);\n        _mm256_store_si256((__m256i*)(ptr + 64), bgra2);\n        _mm256_store_si256((__m256i*)(ptr + 96), bgra3);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, bgra0);\n        _mm256_storeu_si256((__m256i*)(ptr + 32), bgra1);\n        _mm256_storeu_si256((__m256i*)(ptr + 64), bgra2);\n        _mm256_storeu_si256((__m256i*)(ptr + 96), bgra3);\n    }\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x16& a, const v_uint16x16& b,\n                                const v_uint16x16& c, const v_uint16x16& d,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i bg0 = _mm256_unpacklo_epi16(a.val, b.val);\n    __m256i bg1 = _mm256_unpackhi_epi16(a.val, b.val);\n    __m256i ra0 = _mm256_unpacklo_epi16(c.val, d.val);\n    __m256i ra1 = _mm256_unpackhi_epi16(c.val, d.val);\n\n    __m256i bgra0_ = _mm256_unpacklo_epi32(bg0, ra0);\n    __m256i bgra1_ = _mm256_unpackhi_epi32(bg0, ra0);\n    __m256i bgra2_ = _mm256_unpacklo_epi32(bg1, ra1);\n    __m256i bgra3_ = _mm256_unpackhi_epi32(bg1, ra1);\n\n    __m256i bgra0 = _mm256_permute2x128_si256(bgra0_, bgra1_, 0 + 2*16);\n    __m256i bgra2 = _mm256_permute2x128_si256(bgra0_, bgra1_, 1 + 3*16);\n    __m256i bgra1 = _mm256_permute2x128_si256(bgra2_, bgra3_, 0 + 2*16);\n    __m256i bgra3 = _mm256_permute2x128_si256(bgra2_, bgra3_, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, bgra0);\n        _mm256_stream_si256((__m256i*)(ptr + 16), bgra1);\n        _mm256_stream_si256((__m256i*)(ptr + 32), bgra2);\n        _mm256_stream_si256((__m256i*)(ptr + 48), bgra3);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, bgra0);\n        _mm256_store_si256((__m256i*)(ptr + 16), bgra1);\n        _mm256_store_si256((__m256i*)(ptr + 32), bgra2);\n        _mm256_store_si256((__m256i*)(ptr + 48), bgra3);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, bgra0);\n        _mm256_storeu_si256((__m256i*)(ptr + 16), bgra1);\n        _mm256_storeu_si256((__m256i*)(ptr + 32), bgra2);\n        _mm256_storeu_si256((__m256i*)(ptr + 48), bgra3);\n    }\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x8& a, const v_uint32x8& b,\n                                const v_uint32x8& c, const v_uint32x8& d,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i bg0 = _mm256_unpacklo_epi32(a.val, b.val);\n    __m256i bg1 = _mm256_unpackhi_epi32(a.val, b.val);\n    __m256i ra0 = _mm256_unpacklo_epi32(c.val, d.val);\n    __m256i ra1 = _mm256_unpackhi_epi32(c.val, d.val);\n\n    __m256i bgra0_ = _mm256_unpacklo_epi64(bg0, ra0);\n    __m256i bgra1_ = _mm256_unpackhi_epi64(bg0, ra0);\n    __m256i bgra2_ = _mm256_unpacklo_epi64(bg1, ra1);\n    __m256i bgra3_ = _mm256_unpackhi_epi64(bg1, ra1);\n\n    __m256i bgra0 = _mm256_permute2x128_si256(bgra0_, bgra1_, 0 + 2*16);\n    __m256i bgra2 = _mm256_permute2x128_si256(bgra0_, bgra1_, 1 + 3*16);\n    __m256i bgra1 = _mm256_permute2x128_si256(bgra2_, bgra3_, 0 + 2*16);\n    __m256i bgra3 = _mm256_permute2x128_si256(bgra2_, bgra3_, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, bgra0);\n        _mm256_stream_si256((__m256i*)(ptr + 8), bgra1);\n        _mm256_stream_si256((__m256i*)(ptr + 16), bgra2);\n        _mm256_stream_si256((__m256i*)(ptr + 24), bgra3);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, bgra0);\n        _mm256_store_si256((__m256i*)(ptr + 8), bgra1);\n        _mm256_store_si256((__m256i*)(ptr + 16), bgra2);\n        _mm256_store_si256((__m256i*)(ptr + 24), bgra3);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, bgra0);\n        _mm256_storeu_si256((__m256i*)(ptr + 8), bgra1);\n        _mm256_storeu_si256((__m256i*)(ptr + 16), bgra2);\n        _mm256_storeu_si256((__m256i*)(ptr + 24), bgra3);\n    }\n}\n\ninline void v_store_interleave( uint64* ptr, const v_uint64x4& a, const v_uint64x4& b,\n                                const v_uint64x4& c, const v_uint64x4& d,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m256i bg0 = _mm256_unpacklo_epi64(a.val, b.val);\n    __m256i bg1 = _mm256_unpackhi_epi64(a.val, b.val);\n    __m256i ra0 = _mm256_unpacklo_epi64(c.val, d.val);\n    __m256i ra1 = _mm256_unpackhi_epi64(c.val, d.val);\n\n    __m256i bgra0 = _mm256_permute2x128_si256(bg0, ra0, 0 + 2*16);\n    __m256i bgra1 = _mm256_permute2x128_si256(bg1, ra1, 0 + 2*16);\n    __m256i bgra2 = _mm256_permute2x128_si256(bg0, ra0, 1 + 3*16);\n    __m256i bgra3 = _mm256_permute2x128_si256(bg1, ra1, 1 + 3*16);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm256_stream_si256((__m256i*)ptr, bgra0);\n        _mm256_stream_si256((__m256i*)(ptr + 4), bgra1);\n        _mm256_stream_si256((__m256i*)(ptr + 8), bgra2);\n        _mm256_stream_si256((__m256i*)(ptr + 12), bgra3);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm256_store_si256((__m256i*)ptr, bgra0);\n        _mm256_store_si256((__m256i*)(ptr + 4), bgra1);\n        _mm256_store_si256((__m256i*)(ptr + 8), bgra2);\n        _mm256_store_si256((__m256i*)(ptr + 12), bgra3);\n    }\n    else\n    {\n        _mm256_storeu_si256((__m256i*)ptr, bgra0);\n        _mm256_storeu_si256((__m256i*)(ptr + 4), bgra1);\n        _mm256_storeu_si256((__m256i*)(ptr + 8), bgra2);\n        _mm256_storeu_si256((__m256i*)(ptr + 12), bgra3);\n    }\n}\n\n#define OPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(_Tpvec0, _Tp0, suffix0, _Tpvec1, _Tp1, suffix1) \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0 ) \\\n{ \\\n    _Tpvec1 a1, b1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n} \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0 ) \\\n{ \\\n    _Tpvec1 a1, b1, c1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n    c0 = v_reinterpret_as_##suffix0(c1); \\\n} \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0, _Tpvec0& d0 ) \\\n{ \\\n    _Tpvec1 a1, b1, c1, d1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1, d1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n    c0 = v_reinterpret_as_##suffix0(c1); \\\n    d0 = v_reinterpret_as_##suffix0(d1); \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                hal::StoreMode mode=hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, mode);      \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, const _Tpvec0& c0, \\\n                                hal::StoreMode mode=hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, c1, mode);  \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                const _Tpvec0& c0, const _Tpvec0& d0, \\\n                                hal::StoreMode mode=hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \\\n    _Tpvec1 d1 = v_reinterpret_as_##suffix1(d0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, c1, d1, mode); \\\n}\n\nOPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(v_int8x32, schar, s8, v_uint8x32, uchar, u8)\nOPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(v_int16x16, short, s16, v_uint16x16, ushort, u16)\nOPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(v_int32x8, int, s32, v_uint32x8, unsigned, u32)\nOPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(v_float32x8, float, f32, v_uint32x8, unsigned, u32)\nOPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(v_int64x4, int64, s64, v_uint64x4, uint64, u64)\nOPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(v_float64x4, double, f64, v_uint64x4, uint64, u64)\n\n//\n// FP16\n//\n\ninline v_float32x8 v256_load_expand(const float16_t* ptr)\n{\n#if CV_FP16\n    return v_float32x8(_mm256_cvtph_ps(_mm_loadu_si128((const __m128i*)ptr)));\n#else\n    float CV_DECL_ALIGNED(32) buf[8];\n    for (int i = 0; i < 8; i++)\n        buf[i] = (float)ptr[i];\n    return v256_load_aligned(buf);\n#endif\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x8& a)\n{\n#if CV_FP16\n    __m128i ah = _mm256_cvtps_ph(a.val, 0);\n    _mm_storeu_si128((__m128i*)ptr, ah);\n#else\n    float CV_DECL_ALIGNED(32) buf[8];\n    v_store_aligned(buf, a);\n    for (int i = 0; i < 8; i++)\n        ptr[i] = float16_t(buf[i]);\n#endif\n}\n\n//\n// end of FP16\n//\n\ninline void v256_cleanup() { _mm256_zeroall(); }\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n} // cv::\n\n#endif // OPENCV_HAL_INTRIN_AVX_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_avx512.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html\n\n#ifndef OPENCV_HAL_INTRIN_AVX512_HPP\n#define OPENCV_HAL_INTRIN_AVX512_HPP\n\n#if defined(_MSC_VER) && (_MSC_VER < 1920/*MSVS2019*/)\n# pragma warning(disable:4146)  // unary minus operator applied to unsigned type, result still unsigned\n# pragma warning(disable:4309)  // 'argument': truncation of constant value\n# pragma warning(disable:4310)  // cast truncates constant value\n#endif\n\n#define CVT_ROUND_MODES_IMPLEMENTED 0\n\n#define CV_SIMD512 1\n#define CV_SIMD512_64F 1\n#define CV_SIMD512_FP16 0  // no native operations with FP16 type. Only load/store from float32x8 are available (if CV_FP16 == 1)\n\n#define _v512_set_epu64(a7, a6, a5, a4, a3, a2, a1, a0) _mm512_set_epi64((int64)(a7),(int64)(a6),(int64)(a5),(int64)(a4),(int64)(a3),(int64)(a2),(int64)(a1),(int64)(a0))\n#define _v512_set_epu32(a15, a14, a13, a12, a11, a10,  a9,  a8,  a7,  a6,  a5,  a4,  a3,  a2,  a1,  a0) \\\n        _mm512_set_epi64(((int64)(a15)<<32)|(int64)(a14), ((int64)(a13)<<32)|(int64)(a12), ((int64)(a11)<<32)|(int64)(a10), ((int64)( a9)<<32)|(int64)( a8), \\\n                         ((int64)( a7)<<32)|(int64)( a6), ((int64)( a5)<<32)|(int64)( a4), ((int64)( a3)<<32)|(int64)( a2), ((int64)( a1)<<32)|(int64)( a0))\n#define _v512_set_epu16(a31, a30, a29, a28, a27, a26, a25, a24, a23, a22, a21, a20, a19, a18, a17, a16, \\\n                        a15, a14, a13, a12, a11, a10,  a9,  a8,  a7,  a6,  a5,  a4,  a3,  a2,  a1,  a0) \\\n        _v512_set_epu32(((unsigned)(a31)<<16)|(unsigned)(a30), ((unsigned)(a29)<<16)|(unsigned)(a28), ((unsigned)(a27)<<16)|(unsigned)(a26), ((unsigned)(a25)<<16)|(unsigned)(a24), \\\n                        ((unsigned)(a23)<<16)|(unsigned)(a22), ((unsigned)(a21)<<16)|(unsigned)(a20), ((unsigned)(a19)<<16)|(unsigned)(a18), ((unsigned)(a17)<<16)|(unsigned)(a16), \\\n                        ((unsigned)(a15)<<16)|(unsigned)(a14), ((unsigned)(a13)<<16)|(unsigned)(a12), ((unsigned)(a11)<<16)|(unsigned)(a10), ((unsigned)( a9)<<16)|(unsigned)( a8), \\\n                        ((unsigned)( a7)<<16)|(unsigned)( a6), ((unsigned)( a5)<<16)|(unsigned)( a4), ((unsigned)( a3)<<16)|(unsigned)( a2), ((unsigned)( a1)<<16)|(unsigned)( a0))\n#define _v512_set_epu8(a63, a62, a61, a60, a59, a58, a57, a56, a55, a54, a53, a52, a51, a50, a49, a48, \\\n                       a47, a46, a45, a44, a43, a42, a41, a40, a39, a38, a37, a36, a35, a34, a33, a32, \\\n                       a31, a30, a29, a28, a27, a26, a25, a24, a23, a22, a21, a20, a19, a18, a17, a16, \\\n                       a15, a14, a13, a12, a11, a10,  a9,  a8,  a7,  a6,  a5,  a4,  a3,  a2,  a1,  a0) \\\n        _v512_set_epu32(((unsigned)(a63)<<24)|((unsigned)(a62)<<16)|((unsigned)(a61)<<8)|(unsigned)(a60),((unsigned)(a59)<<24)|((unsigned)(a58)<<16)|((unsigned)(a57)<<8)|(unsigned)(a56), \\\n                        ((unsigned)(a55)<<24)|((unsigned)(a54)<<16)|((unsigned)(a53)<<8)|(unsigned)(a52),((unsigned)(a51)<<24)|((unsigned)(a50)<<16)|((unsigned)(a49)<<8)|(unsigned)(a48), \\\n                        ((unsigned)(a47)<<24)|((unsigned)(a46)<<16)|((unsigned)(a45)<<8)|(unsigned)(a44),((unsigned)(a43)<<24)|((unsigned)(a42)<<16)|((unsigned)(a41)<<8)|(unsigned)(a40), \\\n                        ((unsigned)(a39)<<24)|((unsigned)(a38)<<16)|((unsigned)(a37)<<8)|(unsigned)(a36),((unsigned)(a35)<<24)|((unsigned)(a34)<<16)|((unsigned)(a33)<<8)|(unsigned)(a32), \\\n                        ((unsigned)(a31)<<24)|((unsigned)(a30)<<16)|((unsigned)(a29)<<8)|(unsigned)(a28),((unsigned)(a27)<<24)|((unsigned)(a26)<<16)|((unsigned)(a25)<<8)|(unsigned)(a24), \\\n                        ((unsigned)(a23)<<24)|((unsigned)(a22)<<16)|((unsigned)(a21)<<8)|(unsigned)(a20),((unsigned)(a19)<<24)|((unsigned)(a18)<<16)|((unsigned)(a17)<<8)|(unsigned)(a16), \\\n                        ((unsigned)(a15)<<24)|((unsigned)(a14)<<16)|((unsigned)(a13)<<8)|(unsigned)(a12),((unsigned)(a11)<<24)|((unsigned)(a10)<<16)|((unsigned)( a9)<<8)|(unsigned)( a8), \\\n                        ((unsigned)( a7)<<24)|((unsigned)( a6)<<16)|((unsigned)( a5)<<8)|(unsigned)( a4),((unsigned)( a3)<<24)|((unsigned)( a2)<<16)|((unsigned)( a1)<<8)|(unsigned)( a0))\n#define _v512_set_epi8(a63, a62, a61, a60, a59, a58, a57, a56, a55, a54, a53, a52, a51, a50, a49, a48, \\\n                       a47, a46, a45, a44, a43, a42, a41, a40, a39, a38, a37, a36, a35, a34, a33, a32, \\\n                       a31, a30, a29, a28, a27, a26, a25, a24, a23, a22, a21, a20, a19, a18, a17, a16, \\\n                       a15, a14, a13, a12, a11, a10,  a9,  a8,  a7,  a6,  a5,  a4,  a3,  a2,  a1,  a0) \\\n        _v512_set_epu8((uchar)(a63), (uchar)(a62), (uchar)(a61), (uchar)(a60), (uchar)(a59), (uchar)(a58), (uchar)(a57), (uchar)(a56), \\\n                       (uchar)(a55), (uchar)(a54), (uchar)(a53), (uchar)(a52), (uchar)(a51), (uchar)(a50), (uchar)(a49), (uchar)(a48), \\\n                       (uchar)(a47), (uchar)(a46), (uchar)(a45), (uchar)(a44), (uchar)(a43), (uchar)(a42), (uchar)(a41), (uchar)(a40), \\\n                       (uchar)(a39), (uchar)(a38), (uchar)(a37), (uchar)(a36), (uchar)(a35), (uchar)(a34), (uchar)(a33), (uchar)(a32), \\\n                       (uchar)(a31), (uchar)(a30), (uchar)(a29), (uchar)(a28), (uchar)(a27), (uchar)(a26), (uchar)(a25), (uchar)(a24), \\\n                       (uchar)(a23), (uchar)(a22), (uchar)(a21), (uchar)(a20), (uchar)(a19), (uchar)(a18), (uchar)(a17), (uchar)(a16), \\\n                       (uchar)(a15), (uchar)(a14), (uchar)(a13), (uchar)(a12), (uchar)(a11), (uchar)(a10), (uchar)( a9), (uchar)( a8), \\\n                       (uchar)( a7), (uchar)( a6), (uchar)( a5), (uchar)( a4), (uchar)( a3), (uchar)( a2), (uchar)( a1), (uchar)( a0))\n\n#ifndef _mm512_cvtpd_pslo\n#ifdef _mm512_zextsi256_si512\n#define _mm512_cvtpd_pslo(a) _mm512_zextps256_ps512(_mm512_cvtpd_ps(a))\n#else\n//if preferred way to extend with zeros is unavailable\n#define _mm512_cvtpd_pslo(a) _mm512_castps256_ps512(_mm512_cvtpd_ps(a))\n#endif\n#endif\n///////// Utils ////////////\n\nnamespace\n{\n\ninline __m512i _v512_combine(const __m256i& lo, const __m256i& hi)\n{ return _mm512_inserti32x8(_mm512_castsi256_si512(lo), hi, 1); }\n\ninline __m512 _v512_combine(const __m256& lo, const __m256& hi)\n{ return _mm512_insertf32x8(_mm512_castps256_ps512(lo), hi, 1); }\n\ninline __m512d _v512_combine(const __m256d& lo, const __m256d& hi)\n{ return _mm512_insertf64x4(_mm512_castpd256_pd512(lo), hi, 1); }\n\ninline int _v_cvtsi512_si32(const __m512i& a)\n{ return _mm_cvtsi128_si32(_mm512_castsi512_si128(a)); }\n\ninline __m256i _v512_extract_high(const __m512i& v)\n{ return _mm512_extracti32x8_epi32(v, 1); }\n\ninline __m256  _v512_extract_high(const __m512& v)\n{ return _mm512_extractf32x8_ps(v, 1); }\n\ninline __m256d _v512_extract_high(const __m512d& v)\n{ return _mm512_extractf64x4_pd(v, 1); }\n\ninline __m256i _v512_extract_low(const __m512i& v)\n{ return _mm512_castsi512_si256(v); }\n\ninline __m256  _v512_extract_low(const __m512& v)\n{ return _mm512_castps512_ps256(v); }\n\ninline __m256d _v512_extract_low(const __m512d& v)\n{ return _mm512_castpd512_pd256(v); }\n\ninline __m512i _v512_insert(const __m512i& a, const __m256i& b)\n{ return _mm512_inserti32x8(a, b, 0); }\n\ninline __m512 _v512_insert(const __m512& a, const __m256& b)\n{ return _mm512_insertf32x8(a, b, 0); }\n\ninline __m512d _v512_insert(const __m512d& a, const __m256d& b)\n{ return _mm512_insertf64x4(a, b, 0); }\n\n}\n\nnamespace cv\n{\n\n//! @cond IGNORED\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n///////// Types ////////////\n\nstruct v_uint8x64\n{\n    typedef uchar lane_type;\n    enum { nlanes = 64 };\n    __m512i val;\n\n    explicit v_uint8x64(__m512i v) : val(v) {}\n    v_uint8x64(uchar v0,  uchar v1,  uchar v2,  uchar v3,\n               uchar v4,  uchar v5,  uchar v6,  uchar v7,\n               uchar v8,  uchar v9,  uchar v10, uchar v11,\n               uchar v12, uchar v13, uchar v14, uchar v15,\n               uchar v16, uchar v17, uchar v18, uchar v19,\n               uchar v20, uchar v21, uchar v22, uchar v23,\n               uchar v24, uchar v25, uchar v26, uchar v27,\n               uchar v28, uchar v29, uchar v30, uchar v31,\n               uchar v32, uchar v33, uchar v34, uchar v35,\n               uchar v36, uchar v37, uchar v38, uchar v39,\n               uchar v40, uchar v41, uchar v42, uchar v43,\n               uchar v44, uchar v45, uchar v46, uchar v47,\n               uchar v48, uchar v49, uchar v50, uchar v51,\n               uchar v52, uchar v53, uchar v54, uchar v55,\n               uchar v56, uchar v57, uchar v58, uchar v59,\n               uchar v60, uchar v61, uchar v62, uchar v63)\n    {\n        val = _v512_set_epu8(v63, v62, v61, v60, v59, v58, v57, v56, v55, v54, v53, v52, v51, v50, v49, v48,\n                             v47, v46, v45, v44, v43, v42, v41, v40, v39, v38, v37, v36, v35, v34, v33, v32,\n                             v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16,\n                             v15, v14, v13, v12, v11, v10, v9,  v8,  v7,  v6,  v5,  v4,  v3,  v2,  v1,  v0);\n    }\n    v_uint8x64() {}\n\n    static inline v_uint8x64 zero() { return v_uint8x64(_mm512_setzero_si512()); }\n\n    uchar get0() const { return (uchar)_v_cvtsi512_si32(val); }\n};\n\nstruct v_int8x64\n{\n    typedef schar lane_type;\n    enum { nlanes = 64 };\n    __m512i val;\n\n    explicit v_int8x64(__m512i v) : val(v) {}\n    v_int8x64(schar v0,  schar v1,  schar v2,  schar v3,\n              schar v4,  schar v5,  schar v6,  schar v7,\n              schar v8,  schar v9,  schar v10, schar v11,\n              schar v12, schar v13, schar v14, schar v15,\n              schar v16, schar v17, schar v18, schar v19,\n              schar v20, schar v21, schar v22, schar v23,\n              schar v24, schar v25, schar v26, schar v27,\n              schar v28, schar v29, schar v30, schar v31,\n              schar v32, schar v33, schar v34, schar v35,\n              schar v36, schar v37, schar v38, schar v39,\n              schar v40, schar v41, schar v42, schar v43,\n              schar v44, schar v45, schar v46, schar v47,\n              schar v48, schar v49, schar v50, schar v51,\n              schar v52, schar v53, schar v54, schar v55,\n              schar v56, schar v57, schar v58, schar v59,\n              schar v60, schar v61, schar v62, schar v63)\n    {\n        val = _v512_set_epi8(v63, v62, v61, v60, v59, v58, v57, v56, v55, v54, v53, v52, v51, v50, v49, v48,\n                             v47, v46, v45, v44, v43, v42, v41, v40, v39, v38, v37, v36, v35, v34, v33, v32,\n                             v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16,\n                             v15, v14, v13, v12, v11, v10, v9,  v8,  v7,  v6,  v5,  v4,  v3,  v2,  v1,  v0);\n    }\n    v_int8x64() {}\n\n    static inline v_int8x64 zero() { return v_int8x64(_mm512_setzero_si512()); }\n\n    schar get0() const { return (schar)_v_cvtsi512_si32(val); }\n};\n\nstruct v_uint16x32\n{\n    typedef ushort lane_type;\n    enum { nlanes = 32 };\n    __m512i val;\n\n    explicit v_uint16x32(__m512i v) : val(v) {}\n    v_uint16x32(ushort v0,  ushort v1,  ushort v2,  ushort v3,\n                ushort v4,  ushort v5,  ushort v6,  ushort v7,\n                ushort v8,  ushort v9,  ushort v10, ushort v11,\n                ushort v12, ushort v13, ushort v14, ushort v15,\n                ushort v16, ushort v17, ushort v18, ushort v19,\n                ushort v20, ushort v21, ushort v22, ushort v23,\n                ushort v24, ushort v25, ushort v26, ushort v27,\n                ushort v28, ushort v29, ushort v30, ushort v31)\n    {\n        val = _v512_set_epu16(v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16,\n                              v15, v14, v13, v12, v11, v10, v9,  v8,  v7,  v6,  v5,  v4,  v3,  v2,  v1,  v0);\n    }\n    v_uint16x32() {}\n\n    static inline v_uint16x32 zero() { return v_uint16x32(_mm512_setzero_si512()); }\n\n    ushort get0() const { return (ushort)_v_cvtsi512_si32(val); }\n};\n\nstruct v_int16x32\n{\n    typedef short lane_type;\n    enum { nlanes = 32 };\n    __m512i val;\n\n    explicit v_int16x32(__m512i v) : val(v) {}\n    v_int16x32(short v0,  short v1,  short v2,  short v3,  short v4,  short v5,  short v6,  short v7,\n               short v8,  short v9,  short v10, short v11, short v12, short v13, short v14, short v15,\n               short v16, short v17, short v18, short v19, short v20, short v21, short v22, short v23,\n               short v24, short v25, short v26, short v27, short v28, short v29, short v30, short v31)\n    {\n        val = _v512_set_epu16((ushort)v31, (ushort)v30, (ushort)v29, (ushort)v28, (ushort)v27, (ushort)v26, (ushort)v25, (ushort)v24,\n                              (ushort)v23, (ushort)v22, (ushort)v21, (ushort)v20, (ushort)v19, (ushort)v18, (ushort)v17, (ushort)v16,\n                              (ushort)v15, (ushort)v14, (ushort)v13, (ushort)v12, (ushort)v11, (ushort)v10, (ushort)v9 , (ushort)v8,\n                              (ushort)v7 , (ushort)v6 , (ushort)v5 , (ushort)v4 , (ushort)v3 , (ushort)v2 , (ushort)v1 , (ushort)v0);\n    }\n    v_int16x32() {}\n\n    static inline v_int16x32 zero() { return v_int16x32(_mm512_setzero_si512()); }\n\n    short get0() const { return (short)_v_cvtsi512_si32(val); }\n};\n\nstruct v_uint32x16\n{\n    typedef unsigned lane_type;\n    enum { nlanes = 16 };\n    __m512i val;\n\n    explicit v_uint32x16(__m512i v) : val(v) {}\n    v_uint32x16(unsigned v0,  unsigned v1,  unsigned v2,  unsigned v3,\n                unsigned v4,  unsigned v5,  unsigned v6,  unsigned v7,\n                unsigned v8,  unsigned v9,  unsigned v10, unsigned v11,\n                unsigned v12, unsigned v13, unsigned v14, unsigned v15)\n    {\n        val = _mm512_setr_epi32((int)v0,  (int)v1,  (int)v2,  (int)v3, (int)v4,  (int)v5,  (int)v6,  (int)v7,\n                                (int)v8,  (int)v9,  (int)v10, (int)v11, (int)v12, (int)v13, (int)v14, (int)v15);\n    }\n    v_uint32x16() {}\n\n    static inline v_uint32x16 zero() { return v_uint32x16(_mm512_setzero_si512()); }\n\n    unsigned get0() const { return (unsigned)_v_cvtsi512_si32(val); }\n};\n\nstruct v_int32x16\n{\n    typedef int lane_type;\n    enum { nlanes = 16 };\n    __m512i val;\n\n    explicit v_int32x16(__m512i v) : val(v) {}\n    v_int32x16(int v0, int v1, int v2,  int v3,  int v4,  int v5,  int v6,  int v7,\n               int v8, int v9, int v10, int v11, int v12, int v13, int v14, int v15)\n    {\n        val = _mm512_setr_epi32(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15);\n    }\n    v_int32x16() {}\n\n    static inline v_int32x16 zero() { return v_int32x16(_mm512_setzero_si512()); }\n\n    int get0() const { return _v_cvtsi512_si32(val); }\n};\n\nstruct v_float32x16\n{\n    typedef float lane_type;\n    enum { nlanes = 16 };\n    __m512 val;\n\n    explicit v_float32x16(__m512 v) : val(v) {}\n    v_float32x16(float v0, float v1, float v2,  float v3,  float v4,  float v5,  float v6,  float v7,\n                 float v8, float v9, float v10, float v11, float v12, float v13, float v14, float v15)\n    {\n        val = _mm512_setr_ps(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15);\n    }\n    v_float32x16() {}\n\n    static inline v_float32x16 zero() { return v_float32x16(_mm512_setzero_ps()); }\n\n    float get0() const { return _mm_cvtss_f32(_mm512_castps512_ps128(val)); }\n};\n\nstruct v_uint64x8\n{\n    typedef uint64 lane_type;\n    enum { nlanes = 8 };\n    __m512i val;\n\n    explicit v_uint64x8(__m512i v) : val(v) {}\n    v_uint64x8(uint64 v0, uint64 v1, uint64 v2, uint64 v3, uint64 v4, uint64 v5, uint64 v6, uint64 v7)\n    { val = _mm512_setr_epi64((int64)v0, (int64)v1, (int64)v2, (int64)v3, (int64)v4, (int64)v5, (int64)v6, (int64)v7); }\n    v_uint64x8() {}\n\n    static inline v_uint64x8 zero() { return v_uint64x8(_mm512_setzero_si512()); }\n\n    uint64 get0() const\n    {\n    #if defined __x86_64__ || defined _M_X64\n        return (uint64)_mm_cvtsi128_si64(_mm512_castsi512_si128(val));\n    #else\n        int a = _mm_cvtsi128_si32(_mm512_castsi512_si128(val));\n        int b = _mm_cvtsi128_si32(_mm512_castsi512_si128(_mm512_srli_epi64(val, 32)));\n        return (unsigned)a | ((uint64)(unsigned)b << 32);\n    #endif\n    }\n};\n\nstruct v_int64x8\n{\n    typedef int64 lane_type;\n    enum { nlanes = 8 };\n    __m512i val;\n\n    explicit v_int64x8(__m512i v) : val(v) {}\n    v_int64x8(int64 v0, int64 v1, int64 v2, int64 v3, int64 v4, int64 v5, int64 v6, int64 v7)\n    { val = _mm512_setr_epi64(v0, v1, v2, v3, v4, v5, v6, v7); }\n    v_int64x8() {}\n\n    static inline v_int64x8 zero() { return v_int64x8(_mm512_setzero_si512()); }\n\n    int64 get0() const\n    {\n    #if defined __x86_64__ || defined _M_X64\n        return (int64)_mm_cvtsi128_si64(_mm512_castsi512_si128(val));\n    #else\n        int a = _mm_cvtsi128_si32(_mm512_castsi512_si128(val));\n        int b = _mm_cvtsi128_si32(_mm512_castsi512_si128(_mm512_srli_epi64(val, 32)));\n        return (int64)((unsigned)a | ((uint64)(unsigned)b << 32));\n    #endif\n    }\n};\n\nstruct v_float64x8\n{\n    typedef double lane_type;\n    enum { nlanes = 8 };\n    __m512d val;\n\n    explicit v_float64x8(__m512d v) : val(v) {}\n    v_float64x8(double v0, double v1, double v2, double v3, double v4, double v5, double v6, double v7)\n    { val = _mm512_setr_pd(v0, v1, v2, v3, v4, v5, v6, v7); }\n    v_float64x8() {}\n\n    static inline v_float64x8 zero() { return v_float64x8(_mm512_setzero_pd()); }\n\n    double get0() const { return _mm_cvtsd_f64(_mm512_castpd512_pd128(val)); }\n};\n\n//////////////// Load and store operations ///////////////\n\n#define OPENCV_HAL_IMPL_AVX512_LOADSTORE(_Tpvec, _Tp)                    \\\n    inline _Tpvec v512_load(const _Tp* ptr)                           \\\n    { return _Tpvec(_mm512_loadu_si512((const __m512i*)ptr)); }       \\\n    inline _Tpvec v512_load_aligned(const _Tp* ptr)                   \\\n    { return _Tpvec(_mm512_load_si512((const __m512i*)ptr)); }        \\\n    inline _Tpvec v512_load_low(const _Tp* ptr)                       \\\n    {                                                                 \\\n        __m256i v256 = _mm256_loadu_si256((const __m256i*)ptr);       \\\n        return _Tpvec(_mm512_castsi256_si512(v256));                  \\\n    }                                                                 \\\n    inline _Tpvec v512_load_halves(const _Tp* ptr0, const _Tp* ptr1)  \\\n    {                                                                 \\\n        __m256i vlo = _mm256_loadu_si256((const __m256i*)ptr0);       \\\n        __m256i vhi = _mm256_loadu_si256((const __m256i*)ptr1);       \\\n        return _Tpvec(_v512_combine(vlo, vhi));                       \\\n    }                                                                 \\\n    inline void v_store(_Tp* ptr, const _Tpvec& a)                    \\\n    { _mm512_storeu_si512((__m512i*)ptr, a.val); }                    \\\n    inline void v_store_aligned(_Tp* ptr, const _Tpvec& a)            \\\n    { _mm512_store_si512((__m512i*)ptr, a.val); }                     \\\n    inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a)    \\\n    { _mm512_stream_si512((__m512i*)ptr, a.val); }                    \\\n    inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \\\n    { \\\n        if( mode == hal::STORE_UNALIGNED ) \\\n            _mm512_storeu_si512((__m512i*)ptr, a.val); \\\n        else if( mode == hal::STORE_ALIGNED_NOCACHE )  \\\n            _mm512_stream_si512((__m512i*)ptr, a.val); \\\n        else \\\n            _mm512_store_si512((__m512i*)ptr, a.val); \\\n    } \\\n    inline void v_store_low(_Tp* ptr, const _Tpvec& a)                \\\n    { _mm256_storeu_si256((__m256i*)ptr, _v512_extract_low(a.val)); }    \\\n    inline void v_store_high(_Tp* ptr, const _Tpvec& a)               \\\n    { _mm256_storeu_si256((__m256i*)ptr, _v512_extract_high(a.val)); }\n\nOPENCV_HAL_IMPL_AVX512_LOADSTORE(v_uint8x64,  uchar)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE(v_int8x64,   schar)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE(v_uint16x32, ushort)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE(v_int16x32,  short)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE(v_uint32x16,  unsigned)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE(v_int32x16,   int)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE(v_uint64x8,  uint64)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE(v_int64x8,   int64)\n\n#define OPENCV_HAL_IMPL_AVX512_LOADSTORE_FLT(_Tpvec, _Tp, suffix, halfreg)   \\\n    inline _Tpvec v512_load(const _Tp* ptr)                               \\\n    { return _Tpvec(_mm512_loadu_##suffix(ptr)); }                        \\\n    inline _Tpvec v512_load_aligned(const _Tp* ptr)                       \\\n    { return _Tpvec(_mm512_load_##suffix(ptr)); }                         \\\n    inline _Tpvec v512_load_low(const _Tp* ptr)                           \\\n    {                                                                     \\\n        return _Tpvec(_mm512_cast##suffix##256_##suffix##512              \\\n                     (_mm256_loadu_##suffix(ptr)));                       \\\n    }                                                                     \\\n    inline _Tpvec v512_load_halves(const _Tp* ptr0, const _Tp* ptr1)      \\\n    {                                                                     \\\n        halfreg vlo = _mm256_loadu_##suffix(ptr0);                        \\\n        halfreg vhi = _mm256_loadu_##suffix(ptr1);                        \\\n        return _Tpvec(_v512_combine(vlo, vhi));                           \\\n    }                                                                     \\\n    inline void v_store(_Tp* ptr, const _Tpvec& a)                        \\\n    { _mm512_storeu_##suffix(ptr, a.val); }                               \\\n    inline void v_store_aligned(_Tp* ptr, const _Tpvec& a)                \\\n    { _mm512_store_##suffix(ptr, a.val); }                                \\\n    inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a)        \\\n    { _mm512_stream_##suffix(ptr, a.val); }                               \\\n    inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \\\n    { \\\n        if( mode == hal::STORE_UNALIGNED ) \\\n            _mm512_storeu_##suffix(ptr, a.val); \\\n        else if( mode == hal::STORE_ALIGNED_NOCACHE )  \\\n            _mm512_stream_##suffix(ptr, a.val); \\\n        else \\\n            _mm512_store_##suffix(ptr, a.val); \\\n    } \\\n    inline void v_store_low(_Tp* ptr, const _Tpvec& a)                    \\\n    { _mm256_storeu_##suffix(ptr, _v512_extract_low(a.val)); }            \\\n    inline void v_store_high(_Tp* ptr, const _Tpvec& a)                   \\\n    { _mm256_storeu_##suffix(ptr, _v512_extract_high(a.val)); }\n\nOPENCV_HAL_IMPL_AVX512_LOADSTORE_FLT(v_float32x16, float,  ps, __m256)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE_FLT(v_float64x8, double, pd, __m256d)\n\n#define OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, _Tpvecf, suffix, cast) \\\n    inline _Tpvec v_reinterpret_as_##suffix(const _Tpvecf& a)   \\\n    { return _Tpvec(cast(a.val)); }\n\n#define OPENCV_HAL_IMPL_AVX512_INIT(_Tpvec, _Tp, suffix, ssuffix, ctype_s)         \\\n    inline _Tpvec v512_setzero_##suffix()                                          \\\n    { return _Tpvec(_mm512_setzero_si512()); }                                     \\\n    inline _Tpvec v512_setall_##suffix(_Tp v)                                      \\\n    { return _Tpvec(_mm512_set1_##ssuffix((ctype_s)v)); }                          \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint8x64,   suffix, OPENCV_HAL_NOP)      \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int8x64,    suffix, OPENCV_HAL_NOP)      \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint16x32,  suffix, OPENCV_HAL_NOP)      \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int16x32,   suffix, OPENCV_HAL_NOP)      \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint32x16,  suffix, OPENCV_HAL_NOP)      \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int32x16,   suffix, OPENCV_HAL_NOP)      \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint64x8,   suffix, OPENCV_HAL_NOP)      \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int64x8,    suffix, OPENCV_HAL_NOP)      \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_float32x16, suffix, _mm512_castps_si512) \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_float64x8,  suffix, _mm512_castpd_si512)\n\nOPENCV_HAL_IMPL_AVX512_INIT(v_uint8x64,  uchar,    u8,  epi8,   char)\nOPENCV_HAL_IMPL_AVX512_INIT(v_int8x64,   schar,    s8,  epi8,   char)\nOPENCV_HAL_IMPL_AVX512_INIT(v_uint16x32, ushort,   u16, epi16,  short)\nOPENCV_HAL_IMPL_AVX512_INIT(v_int16x32,  short,    s16, epi16,  short)\nOPENCV_HAL_IMPL_AVX512_INIT(v_uint32x16, unsigned, u32, epi32,  int)\nOPENCV_HAL_IMPL_AVX512_INIT(v_int32x16,  int,      s32, epi32,  int)\nOPENCV_HAL_IMPL_AVX512_INIT(v_uint64x8,  uint64,   u64, epi64,  int64)\nOPENCV_HAL_IMPL_AVX512_INIT(v_int64x8,   int64,    s64, epi64,  int64)\n\n#define OPENCV_HAL_IMPL_AVX512_INIT_FLT(_Tpvec, _Tp, suffix, zsuffix, cast) \\\n    inline _Tpvec v512_setzero_##suffix()                                   \\\n    { return _Tpvec(_mm512_setzero_##zsuffix()); }                          \\\n    inline _Tpvec v512_setall_##suffix(_Tp v)                               \\\n    { return _Tpvec(_mm512_set1_##zsuffix(v)); }                            \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint8x64,  suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int8x64,   suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint16x32, suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int16x32,  suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint32x16, suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int32x16,  suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint64x8,  suffix, cast)          \\\n    OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int64x8,   suffix, cast)\n\nOPENCV_HAL_IMPL_AVX512_INIT_FLT(v_float32x16, float,  f32, ps, _mm512_castsi512_ps)\nOPENCV_HAL_IMPL_AVX512_INIT_FLT(v_float64x8,  double, f64, pd, _mm512_castsi512_pd)\n\ninline v_float32x16 v_reinterpret_as_f32(const v_float32x16& a)\n{ return a; }\ninline v_float32x16 v_reinterpret_as_f32(const v_float64x8& a)\n{ return v_float32x16(_mm512_castpd_ps(a.val)); }\n\ninline v_float64x8 v_reinterpret_as_f64(const v_float64x8& a)\n{ return a; }\ninline v_float64x8 v_reinterpret_as_f64(const v_float32x16& a)\n{ return v_float64x8(_mm512_castps_pd(a.val)); }\n\n// FP16\ninline v_float32x16 v512_load_expand(const float16_t* ptr)\n{\n    return v_float32x16(_mm512_cvtph_ps(_mm256_loadu_si256((const __m256i*)ptr)));\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x16& a)\n{\n    __m256i ah = _mm512_cvtps_ph(a.val, 0);\n    _mm256_storeu_si256((__m256i*)ptr, ah);\n}\n\n/* Recombine & ZIP */\ninline void v_zip(const v_int8x64& a, const v_int8x64& b, v_int8x64& ab0, v_int8x64& ab1)\n{\n#if CV_AVX_512VBMI\n    __m512i mask0 = _v512_set_epu8( 95,  31,  94,  30,  93,  29,  92,  28,  91,  27,  90,  26,  89,  25,  88,  24,\n                                    87,  23,  86,  22,  85,  21,  84,  20,  83,  19,  82,  18,  81,  17,  80,  16,\n                                    79,  15,  78,  14,  77,  13,  76,  12,  75,  11,  74,  10,  73,   9,  72,   8,\n                                    71,   7,  70,   6,  69,   5,  68,   4,  67,   3,  66,   2,  65,   1,  64,   0);\n    ab0 = v_int8x64(_mm512_permutex2var_epi8(a.val, mask0, b.val));\n    __m512i mask1 = _v512_set_epu8(127,  63, 126,  62, 125,  61, 124,  60, 123,  59, 122,  58, 121,  57, 120,  56,\n                                   119,  55, 118,  54, 117,  53, 116,  52, 115,  51, 114,  50, 113,  49, 112,  48,\n                                   111,  47, 110,  46, 109,  45, 108,  44, 107,  43, 106,  42, 105,  41, 104,  40,\n                                   103,  39, 102,  38, 101,  37, 100,  36,  99,  35,  98,  34,  97,  33,  96,  32);\n    ab1 = v_int8x64(_mm512_permutex2var_epi8(a.val, mask1, b.val));\n#else\n    __m512i low  = _mm512_unpacklo_epi8(a.val, b.val);\n    __m512i high = _mm512_unpackhi_epi8(a.val, b.val);\n    ab0 = v_int8x64(_mm512_permutex2var_epi64(low, _v512_set_epu64(11, 10, 3, 2,  9,  8, 1, 0), high));\n    ab1 = v_int8x64(_mm512_permutex2var_epi64(low, _v512_set_epu64(15, 14, 7, 6, 13, 12, 5, 4), high));\n#endif\n}\ninline void v_zip(const v_int16x32& a, const v_int16x32& b, v_int16x32& ab0, v_int16x32& ab1)\n{\n    __m512i mask0 = _v512_set_epu16(47, 15, 46, 14, 45, 13, 44, 12, 43, 11, 42, 10, 41,  9, 40,  8,\n                                    39,  7, 38,  6, 37,  5, 36,  4, 35,  3, 34,  2, 33,  1, 32,  0);\n    ab0 = v_int16x32(_mm512_permutex2var_epi16(a.val, mask0, b.val));\n    __m512i mask1 = _v512_set_epu16(63, 31, 62, 30, 61, 29, 60, 28, 59, 27, 58, 26, 57, 25, 56, 24,\n                                    55, 23, 54, 22, 53, 21, 52, 20, 51, 19, 50, 18, 49, 17, 48, 16);\n    ab1 = v_int16x32(_mm512_permutex2var_epi16(a.val, mask1, b.val));\n}\ninline void v_zip(const v_int32x16& a, const v_int32x16& b, v_int32x16& ab0, v_int32x16& ab1)\n{\n    __m512i mask0 = _v512_set_epu32(23,  7, 22,  6, 21,  5, 20,  4, 19,  3, 18,  2, 17, 1, 16, 0);\n    ab0 = v_int32x16(_mm512_permutex2var_epi32(a.val, mask0, b.val));\n    __m512i mask1 = _v512_set_epu32(31, 15, 30, 14, 29, 13, 28, 12, 27, 11, 26, 10, 25, 9, 24, 8);\n    ab1 = v_int32x16(_mm512_permutex2var_epi32(a.val, mask1, b.val));\n}\ninline void v_zip(const v_int64x8& a, const v_int64x8& b, v_int64x8& ab0, v_int64x8& ab1)\n{\n    __m512i mask0 = _v512_set_epu64(11, 3, 10, 2,  9, 1,  8, 0);\n    ab0 = v_int64x8(_mm512_permutex2var_epi64(a.val, mask0, b.val));\n    __m512i mask1 = _v512_set_epu64(15, 7, 14, 6, 13, 5, 12, 4);\n    ab1 = v_int64x8(_mm512_permutex2var_epi64(a.val, mask1, b.val));\n}\n\ninline void v_zip(const v_uint8x64&  a, const v_uint8x64&  b, v_uint8x64& ab0, v_uint8x64& ab1)\n{\n    v_int8x64 i0, i1;\n    v_zip(v_reinterpret_as_s8(a), v_reinterpret_as_s8(b), i0, i1);\n    ab0 = v_reinterpret_as_u8(i0);\n    ab1 = v_reinterpret_as_u8(i1);\n}\ninline void v_zip(const v_uint16x32&  a, const v_uint16x32&  b, v_uint16x32& ab0, v_uint16x32& ab1)\n{\n    v_int16x32 i0, i1;\n    v_zip(v_reinterpret_as_s16(a), v_reinterpret_as_s16(b), i0, i1);\n    ab0 = v_reinterpret_as_u16(i0);\n    ab1 = v_reinterpret_as_u16(i1);\n}\ninline void v_zip(const v_uint32x16&  a, const v_uint32x16&  b, v_uint32x16& ab0, v_uint32x16& ab1)\n{\n    v_int32x16 i0, i1;\n    v_zip(v_reinterpret_as_s32(a), v_reinterpret_as_s32(b), i0, i1);\n    ab0 = v_reinterpret_as_u32(i0);\n    ab1 = v_reinterpret_as_u32(i1);\n}\ninline void v_zip(const v_uint64x8&  a, const v_uint64x8&  b, v_uint64x8& ab0, v_uint64x8& ab1)\n{\n    v_int64x8 i0, i1;\n    v_zip(v_reinterpret_as_s64(a), v_reinterpret_as_s64(b), i0, i1);\n    ab0 = v_reinterpret_as_u64(i0);\n    ab1 = v_reinterpret_as_u64(i1);\n}\ninline void v_zip(const v_float32x16&  a, const v_float32x16&  b, v_float32x16& ab0, v_float32x16& ab1)\n{\n    v_int32x16 i0, i1;\n    v_zip(v_reinterpret_as_s32(a), v_reinterpret_as_s32(b), i0, i1);\n    ab0 = v_reinterpret_as_f32(i0);\n    ab1 = v_reinterpret_as_f32(i1);\n}\ninline void v_zip(const v_float64x8&  a, const v_float64x8&  b, v_float64x8& ab0, v_float64x8& ab1)\n{\n    v_int64x8 i0, i1;\n    v_zip(v_reinterpret_as_s64(a), v_reinterpret_as_s64(b), i0, i1);\n    ab0 = v_reinterpret_as_f64(i0);\n    ab1 = v_reinterpret_as_f64(i1);\n}\n\n#define OPENCV_HAL_IMPL_AVX512_COMBINE(_Tpvec, suffix)                                    \\\n    inline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b)                         \\\n    { return _Tpvec(_v512_combine(_v512_extract_low(a.val), _v512_extract_low(b.val))); } \\\n    inline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b)                        \\\n    { return _Tpvec(_v512_insert(b.val, _v512_extract_high(a.val))); }                    \\\n    inline void v_recombine(const _Tpvec& a, const _Tpvec& b,                             \\\n                                  _Tpvec& c, _Tpvec& d)                                   \\\n    {                                                                                     \\\n        c.val = _v512_combine(_v512_extract_low(a.val),_v512_extract_low(b.val));         \\\n        d.val = _v512_insert(b.val,_v512_extract_high(a.val));                            \\\n    }\n\n\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_uint8x64,   epi8)\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_int8x64,    epi8)\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_uint16x32,  epi16)\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_int16x32,   epi16)\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_uint32x16,  epi32)\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_int32x16,   epi32)\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_uint64x8,   epi64)\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_int64x8,    epi64)\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_float32x16, ps)\nOPENCV_HAL_IMPL_AVX512_COMBINE(v_float64x8,  pd)\n\n////////// Arithmetic, bitwise and comparison operations /////////\n\n/* Element-wise binary and unary operations */\n\n/** Non-saturating arithmetics **/\n#define OPENCV_HAL_IMPL_AVX512_BIN_FUNC(func, _Tpvec, intrin) \\\n    inline _Tpvec func(const _Tpvec& a, const _Tpvec& b)      \\\n    { return _Tpvec(intrin(a.val, b.val)); }\n\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_add_wrap, v_uint8x64, _mm512_add_epi8)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_add_wrap, v_int8x64, _mm512_add_epi8)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_add_wrap, v_uint16x32, _mm512_add_epi16)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_add_wrap, v_int16x32, _mm512_add_epi16)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_sub_wrap, v_uint8x64, _mm512_sub_epi8)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_sub_wrap, v_int8x64, _mm512_sub_epi8)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_sub_wrap, v_uint16x32, _mm512_sub_epi16)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_sub_wrap, v_int16x32, _mm512_sub_epi16)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_mul_wrap, v_uint16x32, _mm512_mullo_epi16)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_mul_wrap, v_int16x32, _mm512_mullo_epi16)\n\ninline v_uint8x64 v_mul_wrap(const v_uint8x64& a, const v_uint8x64& b)\n{\n    __m512i ad = _mm512_srai_epi16(a.val, 8);\n    __m512i bd = _mm512_srai_epi16(b.val, 8);\n    __m512i p0 = _mm512_mullo_epi16(a.val, b.val); // even\n    __m512i p1 = _mm512_slli_epi16(_mm512_mullo_epi16(ad, bd), 8); // odd\n    return v_uint8x64(_mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, p0, p1));\n}\ninline v_int8x64 v_mul_wrap(const v_int8x64& a, const v_int8x64& b)\n{\n    return v_reinterpret_as_s8(v_mul_wrap(v_reinterpret_as_u8(a), v_reinterpret_as_u8(b)));\n}\n\n#define OPENCV_HAL_IMPL_AVX512_BIN_OP(bin_op, _Tpvec, intrin)            \\\n    inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b)     \\\n    { return _Tpvec(intrin(a.val, b.val)); }                             \\\n    inline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b)       \\\n    { a.val = intrin(a.val, b.val); return a; }\n\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_uint32x16, _mm512_add_epi32)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_uint32x16, _mm512_sub_epi32)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_int32x16, _mm512_add_epi32)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_int32x16, _mm512_sub_epi32)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_uint64x8, _mm512_add_epi64)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_uint64x8, _mm512_sub_epi64)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_int64x8, _mm512_add_epi64)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_int64x8, _mm512_sub_epi64)\n\nOPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_uint32x16, _mm512_mullo_epi32)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_int32x16, _mm512_mullo_epi32)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_uint64x8, _mm512_mullo_epi64)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_int64x8, _mm512_mullo_epi64)\n\n/** Saturating arithmetics **/\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_uint8x64,  _mm512_adds_epu8)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_uint8x64,  _mm512_subs_epu8)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_int8x64,   _mm512_adds_epi8)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_int8x64,   _mm512_subs_epi8)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_uint16x32, _mm512_adds_epu16)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_uint16x32, _mm512_subs_epu16)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_int16x32,  _mm512_adds_epi16)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_int16x32,  _mm512_subs_epi16)\n\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_float32x16, _mm512_add_ps)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_float32x16, _mm512_sub_ps)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_float32x16, _mm512_mul_ps)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(/, v_float32x16, _mm512_div_ps)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_float64x8, _mm512_add_pd)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_float64x8, _mm512_sub_pd)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_float64x8, _mm512_mul_pd)\nOPENCV_HAL_IMPL_AVX512_BIN_OP(/, v_float64x8, _mm512_div_pd)\n\n// saturating multiply\ninline v_uint8x64 operator * (const v_uint8x64& a, const v_uint8x64& b)\n{\n    v_uint16x32 c, d;\n    v_mul_expand(a, b, c, d);\n    return v_pack(c, d);\n}\ninline v_int8x64 operator * (const v_int8x64& a, const v_int8x64& b)\n{\n    v_int16x32 c, d;\n    v_mul_expand(a, b, c, d);\n    return v_pack(c, d);\n}\ninline v_uint16x32 operator * (const v_uint16x32& a, const v_uint16x32& b)\n{\n    __m512i pl = _mm512_mullo_epi16(a.val, b.val);\n    __m512i ph = _mm512_mulhi_epu16(a.val, b.val);\n    __m512i p0 = _mm512_unpacklo_epi16(pl, ph);\n    __m512i p1 = _mm512_unpackhi_epi16(pl, ph);\n\n    const __m512i m = _mm512_set1_epi32(65535);\n    return v_uint16x32(_mm512_packus_epi32(_mm512_min_epu32(p0, m), _mm512_min_epu32(p1, m)));\n}\ninline v_int16x32 operator * (const v_int16x32& a, const v_int16x32& b)\n{\n    __m512i pl = _mm512_mullo_epi16(a.val, b.val);\n    __m512i ph = _mm512_mulhi_epi16(a.val, b.val);\n    __m512i p0 = _mm512_unpacklo_epi16(pl, ph);\n    __m512i p1 = _mm512_unpackhi_epi16(pl, ph);\n    return v_int16x32(_mm512_packs_epi32(p0, p1));\n}\n\ninline v_uint8x64& operator *= (v_uint8x64& a, const v_uint8x64& b)\n{ a = a * b; return a; }\ninline v_int8x64& operator *= (v_int8x64& a, const v_int8x64& b)\n{ a = a * b; return a; }\ninline v_uint16x32& operator *= (v_uint16x32& a, const v_uint16x32& b)\n{ a = a * b; return a; }\ninline v_int16x32& operator *= (v_int16x32& a, const v_int16x32& b)\n{ a = a * b; return a; }\n\ninline v_int16x32 v_mul_hi(const v_int16x32& a, const v_int16x32& b) { return v_int16x32(_mm512_mulhi_epi16(a.val, b.val)); }\ninline v_uint16x32 v_mul_hi(const v_uint16x32& a, const v_uint16x32& b) { return v_uint16x32(_mm512_mulhi_epu16(a.val, b.val)); }\n\n//  Multiply and expand\ninline void v_mul_expand(const v_uint8x64& a, const v_uint8x64& b,\n                         v_uint16x32& c, v_uint16x32& d)\n{\n    v_uint16x32 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c = v_mul_wrap(a0, b0);\n    d = v_mul_wrap(a1, b1);\n}\n\ninline void v_mul_expand(const v_int8x64& a, const v_int8x64& b,\n                         v_int16x32& c, v_int16x32& d)\n{\n    v_int16x32 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c = v_mul_wrap(a0, b0);\n    d = v_mul_wrap(a1, b1);\n}\n\ninline void v_mul_expand(const v_int16x32& a, const v_int16x32& b,\n                         v_int32x16& c, v_int32x16& d)\n{\n    v_int16x32 v0, v1;\n    v_zip(v_mul_wrap(a, b), v_mul_hi(a, b), v0, v1);\n\n    c = v_reinterpret_as_s32(v0);\n    d = v_reinterpret_as_s32(v1);\n}\n\ninline void v_mul_expand(const v_uint16x32& a, const v_uint16x32& b,\n                         v_uint32x16& c, v_uint32x16& d)\n{\n    v_uint16x32 v0, v1;\n    v_zip(v_mul_wrap(a, b), v_mul_hi(a, b), v0, v1);\n\n    c = v_reinterpret_as_u32(v0);\n    d = v_reinterpret_as_u32(v1);\n}\n\ninline void v_mul_expand(const v_uint32x16& a, const v_uint32x16& b,\n                         v_uint64x8& c, v_uint64x8& d)\n{\n    v_zip(v_uint64x8(_mm512_mul_epu32(a.val, b.val)),\n          v_uint64x8(_mm512_mul_epu32(_mm512_srli_epi64(a.val, 32), _mm512_srli_epi64(b.val, 32))), c, d);\n}\n\ninline void v_mul_expand(const v_int32x16& a, const v_int32x16& b,\n    v_int64x8& c, v_int64x8& d)\n{\n    v_zip(v_int64x8(_mm512_mul_epi32(a.val, b.val)),\n          v_int64x8(_mm512_mul_epi32(_mm512_srli_epi64(a.val, 32), _mm512_srli_epi64(b.val, 32))), c, d);\n}\n\n/** Bitwise shifts **/\n#define OPENCV_HAL_IMPL_AVX512_SHIFT_OP(_Tpuvec, _Tpsvec, suffix) \\\n    inline _Tpuvec operator << (const _Tpuvec& a, int imm)        \\\n    { return _Tpuvec(_mm512_slli_##suffix(a.val, imm)); }         \\\n    inline _Tpsvec operator << (const _Tpsvec& a, int imm)        \\\n    { return _Tpsvec(_mm512_slli_##suffix(a.val, imm)); }         \\\n    inline _Tpuvec operator >> (const _Tpuvec& a, int imm)        \\\n    { return _Tpuvec(_mm512_srli_##suffix(a.val, imm)); }         \\\n    inline _Tpsvec operator >> (const _Tpsvec& a, int imm)        \\\n    { return _Tpsvec(_mm512_srai_##suffix(a.val, imm)); }         \\\n    template<int imm>                                             \\\n    inline _Tpuvec v_shl(const _Tpuvec& a)                        \\\n    { return _Tpuvec(_mm512_slli_##suffix(a.val, imm)); }         \\\n    template<int imm>                                             \\\n    inline _Tpsvec v_shl(const _Tpsvec& a)                        \\\n    { return _Tpsvec(_mm512_slli_##suffix(a.val, imm)); }         \\\n    template<int imm>                                             \\\n    inline _Tpuvec v_shr(const _Tpuvec& a)                        \\\n    { return _Tpuvec(_mm512_srli_##suffix(a.val, imm)); }         \\\n    template<int imm>                                             \\\n    inline _Tpsvec v_shr(const _Tpsvec& a)                        \\\n    { return _Tpsvec(_mm512_srai_##suffix(a.val, imm)); }\n\nOPENCV_HAL_IMPL_AVX512_SHIFT_OP(v_uint16x32, v_int16x32, epi16)\nOPENCV_HAL_IMPL_AVX512_SHIFT_OP(v_uint32x16, v_int32x16, epi32)\nOPENCV_HAL_IMPL_AVX512_SHIFT_OP(v_uint64x8,  v_int64x8,  epi64)\n\n\n/** Bitwise logic **/\n#define OPENCV_HAL_IMPL_AVX512_LOGIC_OP(_Tpvec, suffix, not_const) \\\n    OPENCV_HAL_IMPL_AVX512_BIN_OP(&, _Tpvec, _mm512_and_##suffix)  \\\n    OPENCV_HAL_IMPL_AVX512_BIN_OP(|, _Tpvec, _mm512_or_##suffix)   \\\n    OPENCV_HAL_IMPL_AVX512_BIN_OP(^, _Tpvec, _mm512_xor_##suffix)  \\\n    inline _Tpvec operator ~ (const _Tpvec& a)                     \\\n    { return _Tpvec(_mm512_xor_##suffix(a.val, not_const)); }\n\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_uint8x64,   si512, _mm512_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_int8x64,    si512, _mm512_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_uint16x32,  si512, _mm512_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_int16x32,   si512, _mm512_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_uint32x16,  si512, _mm512_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_int32x16,   si512, _mm512_set1_epi32(-1))\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_uint64x8,   si512, _mm512_set1_epi64(-1))\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_int64x8,    si512, _mm512_set1_epi64(-1))\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_float32x16, ps,    _mm512_castsi512_ps(_mm512_set1_epi32(-1)))\nOPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_float64x8,  pd,    _mm512_castsi512_pd(_mm512_set1_epi32(-1)))\n\n/** Select **/\n#define OPENCV_HAL_IMPL_AVX512_SELECT(_Tpvec, suffix, zsuf)                      \\\n    inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n    { return _Tpvec(_mm512_mask_blend_##suffix(_mm512_cmp_##suffix##_mask(mask.val, _mm512_setzero_##zsuf(), _MM_CMPINT_EQ), a.val, b.val)); }\n\nOPENCV_HAL_IMPL_AVX512_SELECT(v_uint8x64,   epi8, si512)\nOPENCV_HAL_IMPL_AVX512_SELECT(v_int8x64,    epi8, si512)\nOPENCV_HAL_IMPL_AVX512_SELECT(v_uint16x32, epi16, si512)\nOPENCV_HAL_IMPL_AVX512_SELECT(v_int16x32,  epi16, si512)\nOPENCV_HAL_IMPL_AVX512_SELECT(v_uint32x16, epi32, si512)\nOPENCV_HAL_IMPL_AVX512_SELECT(v_int32x16,  epi32, si512)\nOPENCV_HAL_IMPL_AVX512_SELECT(v_uint64x8,  epi64, si512)\nOPENCV_HAL_IMPL_AVX512_SELECT(v_int64x8,   epi64, si512)\nOPENCV_HAL_IMPL_AVX512_SELECT(v_float32x16,   ps,    ps)\nOPENCV_HAL_IMPL_AVX512_SELECT(v_float64x8,    pd,    pd)\n\n/** Comparison **/\n#define OPENCV_HAL_IMPL_AVX512_CMP_INT(bin_op, imm8, _Tpvec, sufcmp, sufset, tval) \\\n    inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b)               \\\n    { return _Tpvec(_mm512_maskz_set1_##sufset(_mm512_cmp_##sufcmp##_mask(a.val, b.val, imm8), tval)); }\n\n#define OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(_Tpvec, sufcmp, sufset, tval)              \\\n    OPENCV_HAL_IMPL_AVX512_CMP_INT(==, _MM_CMPINT_EQ,  _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_INT(!=, _MM_CMPINT_NE,  _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_INT(<,  _MM_CMPINT_LT,  _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_INT(>,  _MM_CMPINT_NLE, _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_INT(<=, _MM_CMPINT_LE,  _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_INT(>=, _MM_CMPINT_NLT, _Tpvec, sufcmp, sufset, tval)\n\nOPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_uint8x64,   epu8,  epi8, (char)-1)\nOPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_int8x64,    epi8,  epi8, (char)-1)\nOPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_uint16x32, epu16, epi16, (short)-1)\nOPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_int16x32,  epi16, epi16, (short)-1)\nOPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_uint32x16, epu32, epi32, (int)-1)\nOPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_int32x16,  epi32, epi32, (int)-1)\nOPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_uint64x8,  epu64, epi64, (int64)-1)\nOPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_int64x8,   epi64, epi64, (int64)-1)\n\n#define OPENCV_HAL_IMPL_AVX512_CMP_FLT(bin_op, imm8, _Tpvec, sufcmp, sufset, tval) \\\n    inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b)               \\\n    { return _Tpvec(_mm512_castsi512_##sufcmp(_mm512_maskz_set1_##sufset(_mm512_cmp_##sufcmp##_mask(a.val, b.val, imm8), tval))); }\n\n#define OPENCV_HAL_IMPL_AVX512_CMP_OP_FLT(_Tpvec, sufcmp, sufset, tval)           \\\n    OPENCV_HAL_IMPL_AVX512_CMP_FLT(==, _CMP_EQ_OQ,  _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_FLT(!=, _CMP_NEQ_OQ, _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_FLT(<,  _CMP_LT_OQ,  _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_FLT(>,  _CMP_GT_OQ,  _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_FLT(<=, _CMP_LE_OQ,  _Tpvec, sufcmp, sufset, tval) \\\n    OPENCV_HAL_IMPL_AVX512_CMP_FLT(>=, _CMP_GE_OQ,  _Tpvec, sufcmp, sufset, tval)\n\nOPENCV_HAL_IMPL_AVX512_CMP_OP_FLT(v_float32x16, ps, epi32, (int)-1)\nOPENCV_HAL_IMPL_AVX512_CMP_OP_FLT(v_float64x8,  pd, epi64, (int64)-1)\n\ninline v_float32x16 v_not_nan(const v_float32x16& a)\n{ return v_float32x16(_mm512_castsi512_ps(_mm512_maskz_set1_epi32(_mm512_cmp_ps_mask(a.val, a.val, _CMP_ORD_Q), (int)-1))); }\ninline v_float64x8 v_not_nan(const v_float64x8& a)\n{ return v_float64x8(_mm512_castsi512_pd(_mm512_maskz_set1_epi64(_mm512_cmp_pd_mask(a.val, a.val, _CMP_ORD_Q), (int64)-1))); }\n\n/** min/max **/\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_uint8x64,   _mm512_min_epu8)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_uint8x64,   _mm512_max_epu8)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_int8x64,    _mm512_min_epi8)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_int8x64,    _mm512_max_epi8)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_uint16x32,  _mm512_min_epu16)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_uint16x32,  _mm512_max_epu16)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_int16x32,   _mm512_min_epi16)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_int16x32,   _mm512_max_epi16)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_uint32x16,  _mm512_min_epu32)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_uint32x16,  _mm512_max_epu32)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_int32x16,   _mm512_min_epi32)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_int32x16,   _mm512_max_epi32)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_uint64x8,   _mm512_min_epu64)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_uint64x8,   _mm512_max_epu64)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_int64x8,    _mm512_min_epi64)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_int64x8,    _mm512_max_epi64)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_float32x16, _mm512_min_ps)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_float32x16, _mm512_max_ps)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_float64x8,  _mm512_min_pd)\nOPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_float64x8,  _mm512_max_pd)\n\n/** Rotate **/\nnamespace {\n    template<bool prec, int imm4, bool part, int imm32>\n    struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64&) { return v_int8x64(); }};\n    template<int imm4, int imm32>\n    struct _v_rotate_right<true, imm4, false, imm32> { static inline v_int8x64 eval(const v_int8x64& a, const v_int8x64& b)\n    {\n        return v_int8x64(_mm512_or_si512(_mm512_srli_epi32(_mm512_alignr_epi32(b.val, a.val, imm32    ),    imm4 *8),\n                                         _mm512_slli_epi32(_mm512_alignr_epi32(b.val, a.val, imm32 + 1), (4-imm4)*8)));\n    }};\n    template<int imm4>\n    struct _v_rotate_right<true, imm4, false, 15> { static inline v_int8x64 eval(const v_int8x64& a, const v_int8x64& b)\n    {\n        return v_int8x64(_mm512_or_si512(_mm512_srli_epi32(_mm512_alignr_epi32(b.val, a.val, 15),    imm4 *8),\n                                         _mm512_slli_epi32(                                b.val, (4-imm4)*8)));\n    }};\n    template<int imm4, int imm32>\n    struct _v_rotate_right<true, imm4, true, imm32> { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64& b)\n    {\n        return v_int8x64(_mm512_or_si512(_mm512_srli_epi32(_mm512_alignr_epi32(_mm512_setzero_si512(), b.val, imm32 - 16),    imm4 *8),\n                                         _mm512_slli_epi32(_mm512_alignr_epi32(_mm512_setzero_si512(), b.val, imm32 - 15), (4-imm4)*8)));\n    }};\n    template<int imm4>\n    struct _v_rotate_right<true, imm4, true, 31> { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64& b)\n    { return v_int8x64(_mm512_srli_epi32(_mm512_alignr_epi32(_mm512_setzero_si512(), b.val, 15), imm4*8)); }};\n    template<int imm32>\n    struct _v_rotate_right<false, 0, false, imm32> { static inline v_int8x64 eval(const v_int8x64& a, const v_int8x64& b)\n    { return v_int8x64(_mm512_alignr_epi32(b.val, a.val, imm32)); }};\n    template<>\n    struct _v_rotate_right<false, 0, false, 0> { static inline v_int8x64 eval(const v_int8x64& a, const v_int8x64&) { return a; }};\n    template<int imm32>\n    struct _v_rotate_right<false, 0, true, imm32> { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64& b)\n    { return v_int8x64(_mm512_alignr_epi32(_mm512_setzero_si512(), b.val, imm32 - 16)); }};\n    template<>\n    struct _v_rotate_right<false, 0, true, 16> { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64& b) { return b; }};\n    template<>\n    struct _v_rotate_right<false, 0, true, 32> { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64&) { return v_int8x64(); }};\n}\ntemplate<int imm> inline v_int8x64 v_rotate_right(const v_int8x64& a, const v_int8x64& b)\n{\n    return imm >= 128 ? v_int8x64() :\n#if CV_AVX_512VBMI\n    v_int8x64(_mm512_permutex2var_epi8(a.val,\n    _v512_set_epu8(0x3f + imm, 0x3e + imm, 0x3d + imm, 0x3c + imm, 0x3b + imm, 0x3a + imm, 0x39 + imm, 0x38 + imm,\n                   0x37 + imm, 0x36 + imm, 0x35 + imm, 0x34 + imm, 0x33 + imm, 0x32 + imm, 0x31 + imm, 0x30 + imm,\n                   0x2f + imm, 0x2e + imm, 0x2d + imm, 0x2c + imm, 0x2b + imm, 0x2a + imm, 0x29 + imm, 0x28 + imm,\n                   0x27 + imm, 0x26 + imm, 0x25 + imm, 0x24 + imm, 0x23 + imm, 0x22 + imm, 0x21 + imm, 0x20 + imm,\n                   0x1f + imm, 0x1e + imm, 0x1d + imm, 0x1c + imm, 0x1b + imm, 0x1a + imm, 0x19 + imm, 0x18 + imm,\n                   0x17 + imm, 0x16 + imm, 0x15 + imm, 0x14 + imm, 0x13 + imm, 0x12 + imm, 0x11 + imm, 0x10 + imm,\n                   0x0f + imm, 0x0e + imm, 0x0d + imm, 0x0c + imm, 0x0b + imm, 0x0a + imm, 0x09 + imm, 0x08 + imm,\n                   0x07 + imm, 0x06 + imm, 0x05 + imm, 0x04 + imm, 0x03 + imm, 0x02 + imm, 0x01 + imm, 0x00 + imm), b.val));\n#else\n    _v_rotate_right<imm%4!=0, imm%4, (imm/4 > 15), imm/4>::eval(a, b);\n#endif\n}\ntemplate<int imm>\ninline v_int8x64 v_rotate_left(const v_int8x64& a, const v_int8x64& b)\n{\n    if (imm == 0) return a;\n    if (imm == 64) return b;\n    if (imm >= 128) return v_int8x64();\n#if CV_AVX_512VBMI\n    return v_int8x64(_mm512_permutex2var_epi8(b.val,\n           _v512_set_epi8(0x7f - imm,0x7e - imm,0x7d - imm,0x7c - imm,0x7b - imm,0x7a - imm,0x79 - imm,0x78 - imm,\n                          0x77 - imm,0x76 - imm,0x75 - imm,0x74 - imm,0x73 - imm,0x72 - imm,0x71 - imm,0x70 - imm,\n                          0x6f - imm,0x6e - imm,0x6d - imm,0x6c - imm,0x6b - imm,0x6a - imm,0x69 - imm,0x68 - imm,\n                          0x67 - imm,0x66 - imm,0x65 - imm,0x64 - imm,0x63 - imm,0x62 - imm,0x61 - imm,0x60 - imm,\n                          0x5f - imm,0x5e - imm,0x5d - imm,0x5c - imm,0x5b - imm,0x5a - imm,0x59 - imm,0x58 - imm,\n                          0x57 - imm,0x56 - imm,0x55 - imm,0x54 - imm,0x53 - imm,0x52 - imm,0x51 - imm,0x50 - imm,\n                          0x4f - imm,0x4e - imm,0x4d - imm,0x4c - imm,0x4b - imm,0x4a - imm,0x49 - imm,0x48 - imm,\n                          0x47 - imm,0x46 - imm,0x45 - imm,0x44 - imm,0x43 - imm,0x42 - imm,0x41 - imm,0x40 - imm), a.val));\n#else\n    return imm < 64 ? v_rotate_right<64 - imm>(b, a) : v_rotate_right<128 - imm>(v512_setzero_s8(), b);\n#endif\n}\ntemplate<int imm>\ninline v_int8x64 v_rotate_right(const v_int8x64& a)\n{\n    if (imm == 0) return a;\n    if (imm >= 64) return v_int8x64();\n#if CV_AVX_512VBMI\n    return v_int8x64(_mm512_maskz_permutexvar_epi8(0xFFFFFFFFFFFFFFFF >> imm,\n           _v512_set_epu8(0x3f + imm,0x3e + imm,0x3d + imm,0x3c + imm,0x3b + imm,0x3a + imm,0x39 + imm,0x38 + imm,\n                          0x37 + imm,0x36 + imm,0x35 + imm,0x34 + imm,0x33 + imm,0x32 + imm,0x31 + imm,0x30 + imm,\n                          0x2f + imm,0x2e + imm,0x2d + imm,0x2c + imm,0x2b + imm,0x2a + imm,0x29 + imm,0x28 + imm,\n                          0x27 + imm,0x26 + imm,0x25 + imm,0x24 + imm,0x23 + imm,0x22 + imm,0x21 + imm,0x20 + imm,\n                          0x1f + imm,0x1e + imm,0x1d + imm,0x1c + imm,0x1b + imm,0x1a + imm,0x19 + imm,0x18 + imm,\n                          0x17 + imm,0x16 + imm,0x15 + imm,0x14 + imm,0x13 + imm,0x12 + imm,0x11 + imm,0x10 + imm,\n                          0x0f + imm,0x0e + imm,0x0d + imm,0x0c + imm,0x0b + imm,0x0a + imm,0x09 + imm,0x08 + imm,\n                          0x07 + imm,0x06 + imm,0x05 + imm,0x04 + imm,0x03 + imm,0x02 + imm,0x01 + imm,0x00 + imm), a.val));\n#else\n    return v_rotate_right<imm>(a, v512_setzero_s8());\n#endif\n}\ntemplate<int imm>\ninline v_int8x64 v_rotate_left(const v_int8x64& a)\n{\n    if (imm == 0) return a;\n    if (imm >= 64) return v_int8x64();\n#if CV_AVX_512VBMI\n    return v_int8x64(_mm512_maskz_permutexvar_epi8(0xFFFFFFFFFFFFFFFF << imm,\n           _v512_set_epi8(0x3f - imm,0x3e - imm,0x3d - imm,0x3c - imm,0x3b - imm,0x3a - imm,0x39 - imm,0x38 - imm,\n                          0x37 - imm,0x36 - imm,0x35 - imm,0x34 - imm,0x33 - imm,0x32 - imm,0x31 - imm,0x30 - imm,\n                          0x2f - imm,0x2e - imm,0x2d - imm,0x2c - imm,0x2b - imm,0x2a - imm,0x29 - imm,0x28 - imm,\n                          0x27 - imm,0x26 - imm,0x25 - imm,0x24 - imm,0x23 - imm,0x22 - imm,0x21 - imm,0x20 - imm,\n                          0x1f - imm,0x1e - imm,0x1d - imm,0x1c - imm,0x1b - imm,0x1a - imm,0x19 - imm,0x18 - imm,\n                          0x17 - imm,0x16 - imm,0x15 - imm,0x14 - imm,0x13 - imm,0x12 - imm,0x11 - imm,0x10 - imm,\n                          0x0f - imm,0x0e - imm,0x0d - imm,0x0c - imm,0x0b - imm,0x0a - imm,0x09 - imm,0x08 - imm,\n                          0x07 - imm,0x06 - imm,0x05 - imm,0x04 - imm,0x03 - imm,0x02 - imm,0x01 - imm,0x00 - imm), a.val));\n#else\n    return v_rotate_right<64 - imm>(v512_setzero_s8(), a);\n#endif\n}\n\n#define OPENCV_HAL_IMPL_AVX512_ROTATE_PM(_Tpvec, suffix)                                                                                   \\\ntemplate<int imm> inline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b)                                                            \\\n{ return v_reinterpret_as_##suffix(v_rotate_left<imm * sizeof(_Tpvec::lane_type)>(v_reinterpret_as_s8(a), v_reinterpret_as_s8(b))); }      \\\ntemplate<int imm> inline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b)                                                           \\\n{ return v_reinterpret_as_##suffix(v_rotate_right<imm * sizeof(_Tpvec::lane_type)>(v_reinterpret_as_s8(a), v_reinterpret_as_s8(b))); }     \\\ntemplate<int imm> inline _Tpvec v_rotate_left(const _Tpvec& a)                                                                             \\\n{ return v_reinterpret_as_##suffix(v_rotate_left<imm * sizeof(_Tpvec::lane_type)>(v_reinterpret_as_s8(a))); }                              \\\ntemplate<int imm> inline _Tpvec v_rotate_right(const _Tpvec& a)                                                                            \\\n{ return v_reinterpret_as_##suffix(v_rotate_right<imm * sizeof(_Tpvec::lane_type)>(v_reinterpret_as_s8(a))); }\n\n#define OPENCV_HAL_IMPL_AVX512_ROTATE_EC(_Tpvec, suffix)                                                                                   \\\ntemplate<int imm>                                                                                                                          \\\ninline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b)                                                                              \\\n{                                                                                                                                          \\\n    enum { SHIFT2 = (_Tpvec::nlanes - imm) };                                                                                              \\\n    enum { MASK = ((1 << _Tpvec::nlanes) - 1) };                                                                                           \\\n    if (imm == 0) return a;                                                                                                                \\\n    if (imm == _Tpvec::nlanes) return b;                                                                                                   \\\n    if (imm >= 2*_Tpvec::nlanes) return _Tpvec::zero();                                                                                    \\\n    return _Tpvec(_mm512_mask_expand_##suffix(_mm512_maskz_compress_##suffix((MASK << SHIFT2)&MASK, b.val), (MASK << (imm))&MASK, a.val)); \\\n}                                                                                                                                          \\\ntemplate<int imm>                                                                                                                          \\\ninline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b)                                                                             \\\n{                                                                                                                                          \\\n    enum { SHIFT2 = (_Tpvec::nlanes - imm) };                                                                                              \\\n    enum { MASK = ((1 << _Tpvec::nlanes) - 1) };                                                                                           \\\n    if (imm == 0) return a;                                                                                                                \\\n    if (imm == _Tpvec::nlanes) return b;                                                                                                   \\\n    if (imm >= 2*_Tpvec::nlanes) return _Tpvec::zero();                                                                                    \\\n    return _Tpvec(_mm512_mask_expand_##suffix(_mm512_maskz_compress_##suffix((MASK << (imm))&MASK, a.val), (MASK << SHIFT2)&MASK, b.val)); \\\n}                                                                                                                                          \\\ntemplate<int imm>                                                                                                                          \\\ninline _Tpvec v_rotate_left(const _Tpvec& a)                                                                                               \\\n{                                                                                                                                          \\\n    if (imm == 0) return a;                                                                                                                \\\n    if (imm >= _Tpvec::nlanes) return _Tpvec::zero();                                                                                      \\\n    return _Tpvec(_mm512_maskz_expand_##suffix((1 << _Tpvec::nlanes) - (1 << (imm)), a.val));                                              \\\n}                                                                                                                                          \\\ntemplate<int imm>                                                                                                                          \\\ninline _Tpvec v_rotate_right(const _Tpvec& a)                                                                                              \\\n{                                                                                                                                          \\\n    if (imm == 0) return a;                                                                                                                \\\n    if (imm >= _Tpvec::nlanes) return _Tpvec::zero();                                                                                      \\\n    return _Tpvec(_mm512_maskz_compress_##suffix((1 << _Tpvec::nlanes) - (1 << (imm)), a.val));                                            \\\n}\n\nOPENCV_HAL_IMPL_AVX512_ROTATE_PM(v_uint8x64,   u8)\nOPENCV_HAL_IMPL_AVX512_ROTATE_PM(v_uint16x32,  u16)\nOPENCV_HAL_IMPL_AVX512_ROTATE_PM(v_int16x32,   s16)\nOPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_uint32x16,  epi32)\nOPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_int32x16,   epi32)\nOPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_uint64x8,   epi64)\nOPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_int64x8,    epi64)\nOPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_float32x16, ps)\nOPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_float64x8,  pd)\n\n/** Reverse **/\ninline v_uint8x64 v_reverse(const v_uint8x64 &a)\n{\n#if CV_AVX_512VBMI\n    static const __m512i perm = _mm512_set_epi32(\n            0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f,\n            0x10111213, 0x14151617, 0x18191a1b, 0x1c1d1e1f,\n            0x20212223, 0x24252627, 0x28292a2b, 0x2c2d2e2f,\n            0x30313233, 0x34353637, 0x38393a3b, 0x3c3d3e3f);\n    return v_uint8x64(_mm512_permutexvar_epi8(perm, a.val));\n#else\n    static const __m512i shuf = _mm512_set_epi32(\n            0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f,\n            0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f,\n            0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f,\n            0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f);\n    static const __m512i perm = _mm512_set_epi64(1, 0, 3, 2, 5, 4, 7, 6);\n    __m512i vec = _mm512_shuffle_epi8(a.val, shuf);\n    return v_uint8x64(_mm512_permutexvar_epi64(perm, vec));\n#endif\n}\n\ninline v_int8x64 v_reverse(const v_int8x64 &a)\n{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); }\n\ninline v_uint16x32 v_reverse(const v_uint16x32 &a)\n{\n#if CV_AVX_512VBMI\n    static const __m512i perm = _mm512_set_epi32(\n            0x00000001, 0x00020003, 0x00040005, 0x00060007,\n            0x00080009, 0x000a000b, 0x000c000d, 0x000e000f,\n            0x00100011, 0x00120013, 0x00140015, 0x00160017,\n            0x00180019, 0x001a001b, 0x001c001d, 0x001e001f);\n    return v_uint16x32(_mm512_permutexvar_epi16(perm, a.val));\n#else\n    static const __m512i shuf = _mm512_set_epi32(\n            0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e,\n            0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e,\n            0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e,\n            0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e);\n    static const __m512i perm = _mm512_set_epi64(1, 0, 3, 2, 5, 4, 7, 6);\n    __m512i vec = _mm512_shuffle_epi8(a.val, shuf);\n    return v_uint16x32(_mm512_permutexvar_epi64(perm, vec));\n#endif\n}\n\ninline v_int16x32 v_reverse(const v_int16x32 &a)\n{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); }\n\ninline v_uint32x16 v_reverse(const v_uint32x16 &a)\n{\n    static const __m512i perm = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,14, 15);\n    return v_uint32x16(_mm512_permutexvar_epi32(perm, a.val));\n}\n\ninline v_int32x16 v_reverse(const v_int32x16 &a)\n{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_float32x16 v_reverse(const v_float32x16 &a)\n{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_uint64x8 v_reverse(const v_uint64x8 &a)\n{\n    static const __m512i perm = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);\n    return v_uint64x8(_mm512_permutexvar_epi64(perm, a.val));\n}\n\ninline v_int64x8 v_reverse(const v_int64x8 &a)\n{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); }\n\ninline v_float64x8 v_reverse(const v_float64x8 &a)\n{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); }\n\n////////// Reduce /////////\n\n/** Reduce **/\n#define OPENCV_HAL_IMPL_AVX512_REDUCE_ADD64(a, b) a + b\n#define OPENCV_HAL_IMPL_AVX512_REDUCE_8(sctype, func, _Tpvec, ifunc, scop)                                          \\\n    inline sctype v_reduce_##func(const _Tpvec& a)                                                                  \\\n    { __m256i half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val));                           \\\n      sctype CV_DECL_ALIGNED(64) idx[2];                                                                            \\\n      _mm_store_si128((__m128i*)idx, _mm_##ifunc(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1))); \\\n      return scop(idx[0], idx[1]); }\nOPENCV_HAL_IMPL_AVX512_REDUCE_8(uint64, min, v_uint64x8, min_epu64, min)\nOPENCV_HAL_IMPL_AVX512_REDUCE_8(uint64, max, v_uint64x8, max_epu64, max)\nOPENCV_HAL_IMPL_AVX512_REDUCE_8(uint64, sum, v_uint64x8, add_epi64, OPENCV_HAL_IMPL_AVX512_REDUCE_ADD64)\nOPENCV_HAL_IMPL_AVX512_REDUCE_8(int64,  min, v_int64x8,  min_epi64, min)\nOPENCV_HAL_IMPL_AVX512_REDUCE_8(int64,  max, v_int64x8,  max_epi64, max)\nOPENCV_HAL_IMPL_AVX512_REDUCE_8(int64,  sum, v_int64x8,  add_epi64, OPENCV_HAL_IMPL_AVX512_REDUCE_ADD64)\n\n#define OPENCV_HAL_IMPL_AVX512_REDUCE_8F(func, ifunc, scop)                                         \\\n    inline double v_reduce_##func(const v_float64x8& a)                                             \\\n    { __m256d half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val));           \\\n      double CV_DECL_ALIGNED(64) idx[2];                                                            \\\n      _mm_store_pd(idx, _mm_##ifunc(_mm256_castpd256_pd128(half), _mm256_extractf128_pd(half, 1))); \\\n      return scop(idx[0], idx[1]); }\nOPENCV_HAL_IMPL_AVX512_REDUCE_8F(min, min_pd, min)\nOPENCV_HAL_IMPL_AVX512_REDUCE_8F(max, max_pd, max)\nOPENCV_HAL_IMPL_AVX512_REDUCE_8F(sum, add_pd, OPENCV_HAL_IMPL_AVX512_REDUCE_ADD64)\n\n#define OPENCV_HAL_IMPL_AVX512_REDUCE_16(sctype, func, _Tpvec, ifunc)                                 \\\n    inline sctype v_reduce_##func(const _Tpvec& a)                                                    \\\n    { __m256i half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val));             \\\n      __m128i quarter = _mm_##ifunc(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1)); \\\n      quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 8));                                     \\\n      quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 4));                                     \\\n      return (sctype)_mm_cvtsi128_si32(quarter); }\nOPENCV_HAL_IMPL_AVX512_REDUCE_16(uint, min, v_uint32x16, min_epu32)\nOPENCV_HAL_IMPL_AVX512_REDUCE_16(uint, max, v_uint32x16, max_epu32)\nOPENCV_HAL_IMPL_AVX512_REDUCE_16(int,  min, v_int32x16,  min_epi32)\nOPENCV_HAL_IMPL_AVX512_REDUCE_16(int,  max, v_int32x16,  max_epi32)\n\n#define OPENCV_HAL_IMPL_AVX512_REDUCE_16F(func, ifunc)                                            \\\n    inline float v_reduce_##func(const v_float32x16& a)                                           \\\n    { __m256 half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val));          \\\n      __m128 quarter = _mm_##ifunc(_mm256_castps256_ps128(half), _mm256_extractf128_ps(half, 1)); \\\n      quarter = _mm_##ifunc(quarter, _mm_permute_ps(quarter, _MM_SHUFFLE(0, 0, 3, 2)));           \\\n      quarter = _mm_##ifunc(quarter, _mm_permute_ps(quarter, _MM_SHUFFLE(0, 0, 0, 1)));           \\\n      return _mm_cvtss_f32(quarter); }\nOPENCV_HAL_IMPL_AVX512_REDUCE_16F(min, min_ps)\nOPENCV_HAL_IMPL_AVX512_REDUCE_16F(max, max_ps)\n\ninline float v_reduce_sum(const v_float32x16& a)\n{\n    __m256 half = _mm256_add_ps(_v512_extract_low(a.val), _v512_extract_high(a.val));\n    __m128 quarter = _mm_add_ps(_mm256_castps256_ps128(half), _mm256_extractf128_ps(half, 1));\n    quarter = _mm_hadd_ps(quarter, quarter);\n    return _mm_cvtss_f32(_mm_hadd_ps(quarter, quarter));\n}\ninline int v_reduce_sum(const v_int32x16& a)\n{\n    __m256i half = _mm256_add_epi32(_v512_extract_low(a.val), _v512_extract_high(a.val));\n    __m128i quarter = _mm_add_epi32(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1));\n    quarter = _mm_hadd_epi32(quarter, quarter);\n    return _mm_cvtsi128_si32(_mm_hadd_epi32(quarter, quarter));\n}\ninline uint v_reduce_sum(const v_uint32x16& a)\n{ return (uint)v_reduce_sum(v_reinterpret_as_s32(a)); }\n\n#define OPENCV_HAL_IMPL_AVX512_REDUCE_32(sctype, func, _Tpvec, ifunc)                                 \\\n    inline sctype v_reduce_##func(const _Tpvec& a)                                                    \\\n    { __m256i half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val));             \\\n      __m128i quarter = _mm_##ifunc(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1)); \\\n      quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 8));                                     \\\n      quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 4));                                     \\\n      quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 2));                                     \\\n      return (sctype)_mm_cvtsi128_si32(quarter); }\nOPENCV_HAL_IMPL_AVX512_REDUCE_32(ushort, min, v_uint16x32, min_epu16)\nOPENCV_HAL_IMPL_AVX512_REDUCE_32(ushort, max, v_uint16x32, max_epu16)\nOPENCV_HAL_IMPL_AVX512_REDUCE_32(short,  min, v_int16x32,  min_epi16)\nOPENCV_HAL_IMPL_AVX512_REDUCE_32(short,  max, v_int16x32,  max_epi16)\n\ninline int v_reduce_sum(const v_int16x32& a)\n{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); }\ninline uint v_reduce_sum(const v_uint16x32& a)\n{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); }\n\n#define OPENCV_HAL_IMPL_AVX512_REDUCE_64(sctype, func, _Tpvec, ifunc)                                 \\\n    inline sctype v_reduce_##func(const _Tpvec& a)                                                    \\\n    { __m256i half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val));             \\\n      __m128i quarter = _mm_##ifunc(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1)); \\\n      quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 8));                                     \\\n      quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 4));                                     \\\n      quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 2));                                     \\\n      quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 1));                                     \\\n      return (sctype)_mm_cvtsi128_si32(quarter); }\nOPENCV_HAL_IMPL_AVX512_REDUCE_64(uchar, min, v_uint8x64, min_epu8)\nOPENCV_HAL_IMPL_AVX512_REDUCE_64(uchar, max, v_uint8x64, max_epu8)\nOPENCV_HAL_IMPL_AVX512_REDUCE_64(schar, min, v_int8x64,  min_epi8)\nOPENCV_HAL_IMPL_AVX512_REDUCE_64(schar, max, v_int8x64,  max_epi8)\n\n#define OPENCV_HAL_IMPL_AVX512_REDUCE_64_SUM(sctype, _Tpvec, suffix)                                    \\\n    inline sctype v_reduce_sum(const _Tpvec& a)                                                         \\\n    {   __m512i a16 = _mm512_add_epi16(_mm512_cvt##suffix##_epi16(_v512_extract_low(a.val)),            \\\n                                       _mm512_cvt##suffix##_epi16(_v512_extract_high(a.val)));          \\\n        a16 = _mm512_cvtepi16_epi32(_mm256_add_epi16(_v512_extract_low(a16), _v512_extract_high(a16))); \\\n        __m256i a8 = _mm256_add_epi32(_v512_extract_low(a16), _v512_extract_high(a16));                 \\\n        __m128i a4 = _mm_add_epi32(_mm256_castsi256_si128(a8), _mm256_extracti128_si256(a8, 1));        \\\n        a4 = _mm_hadd_epi32(a4, a4);                                                                    \\\n        return (sctype)_mm_cvtsi128_si32(_mm_hadd_epi32(a4, a4)); }\nOPENCV_HAL_IMPL_AVX512_REDUCE_64_SUM(uint, v_uint8x64, epu8)\nOPENCV_HAL_IMPL_AVX512_REDUCE_64_SUM(int,  v_int8x64,  epi8)\n\ninline v_float32x16 v_reduce_sum4(const v_float32x16& a, const v_float32x16& b,\n                                  const v_float32x16& c, const v_float32x16& d)\n{\n    __m256 abl = _mm256_hadd_ps(_v512_extract_low(a.val), _v512_extract_low(b.val));\n    __m256 abh = _mm256_hadd_ps(_v512_extract_high(a.val), _v512_extract_high(b.val));\n    __m256 cdl = _mm256_hadd_ps(_v512_extract_low(c.val), _v512_extract_low(d.val));\n    __m256 cdh = _mm256_hadd_ps(_v512_extract_high(c.val), _v512_extract_high(d.val));\n    return v_float32x16(_v512_combine(_mm256_hadd_ps(abl, cdl), _mm256_hadd_ps(abh, cdh)));\n}\n\ninline unsigned v_reduce_sad(const v_uint8x64& a, const v_uint8x64& b)\n{\n    __m512i val = _mm512_sad_epu8(a.val, b.val);\n    __m256i half = _mm256_add_epi32(_v512_extract_low(val), _v512_extract_high(val));\n    __m128i quarter = _mm_add_epi32(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1));\n    return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter)));\n}\ninline unsigned v_reduce_sad(const v_int8x64& a, const v_int8x64& b)\n{\n    __m512i val = _mm512_set1_epi8(-128);\n    val = _mm512_sad_epu8(_mm512_add_epi8(a.val, val), _mm512_add_epi8(b.val, val));\n    __m256i half = _mm256_add_epi32(_v512_extract_low(val), _v512_extract_high(val));\n    __m128i quarter = _mm_add_epi32(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1));\n    return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter)));\n}\ninline unsigned v_reduce_sad(const v_uint16x32& a, const v_uint16x32& b)\n{ return v_reduce_sum(v_add_wrap(a - b, b - a)); }\ninline unsigned v_reduce_sad(const v_int16x32& a, const v_int16x32& b)\n{ return v_reduce_sum(v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b)))); }\ninline unsigned v_reduce_sad(const v_uint32x16& a, const v_uint32x16& b)\n{ return v_reduce_sum(v_max(a, b) - v_min(a, b)); }\ninline unsigned v_reduce_sad(const v_int32x16& a, const v_int32x16& b)\n{ return v_reduce_sum(v_reinterpret_as_u32(v_max(a, b) - v_min(a, b))); }\ninline float v_reduce_sad(const v_float32x16& a, const v_float32x16& b)\n{ return v_reduce_sum((a - b) & v_float32x16(_mm512_castsi512_ps(_mm512_set1_epi32(0x7fffffff)))); }\ninline double v_reduce_sad(const v_float64x8& a, const v_float64x8& b)\n{ return v_reduce_sum((a - b) & v_float64x8(_mm512_castsi512_pd(_mm512_set1_epi64(0x7fffffffffffffff)))); }\n\n/** Popcount **/\ninline v_uint8x64 v_popcount(const v_int8x64& a)\n{\n#if CV_AVX_512BITALG\n    return v_uint8x64(_mm512_popcnt_epi8(a.val));\n#elif CV_AVX_512VBMI\n    __m512i _popcnt_table0 = _v512_set_epu8(7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3,\n                                            5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1,\n                                            5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1,\n                                            4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0);\n    __m512i _popcnt_table1 = _v512_set_epu8(7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3,\n                                            6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2,\n                                            6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2,\n                                            5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1);\n    return v_uint8x64(_mm512_sub_epi8(_mm512_permutex2var_epi8(_popcnt_table0, a.val, _popcnt_table1), _mm512_movm_epi8(_mm512_movepi8_mask(a.val))));\n#else\n    __m512i _popcnt_table = _mm512_set4_epi32(0x04030302, 0x03020201, 0x03020201, 0x02010100);\n    __m512i _popcnt_mask = _mm512_set1_epi8(0x0F);\n\n    return v_uint8x64(_mm512_add_epi8(_mm512_shuffle_epi8(_popcnt_table, _mm512_and_si512(                  a.val,     _popcnt_mask)),\n                                      _mm512_shuffle_epi8(_popcnt_table, _mm512_and_si512(_mm512_srli_epi16(a.val, 4), _popcnt_mask))));\n#endif\n}\ninline v_uint16x32 v_popcount(const v_int16x32& a)\n{\n#if CV_AVX_512BITALG\n    return v_uint16x32(_mm512_popcnt_epi16(a.val));\n#elif CV_AVX_512VPOPCNTDQ\n    __m512i zero = _mm512_setzero_si512();\n    return v_uint16x32(_mm512_packs_epi32(_mm512_popcnt_epi32(_mm512_unpacklo_epi16(a.val, zero)),\n                                          _mm512_popcnt_epi32(_mm512_unpackhi_epi16(a.val, zero))));\n#else\n    v_uint8x64 p = v_popcount(v_reinterpret_as_s8(a));\n    p += v_rotate_right<1>(p);\n    return v_reinterpret_as_u16(p) & v512_setall_u16(0x00ff);\n#endif\n}\ninline v_uint32x16 v_popcount(const v_int32x16& a)\n{\n#if CV_AVX_512VPOPCNTDQ\n    return v_uint32x16(_mm512_popcnt_epi32(a.val));\n#else\n    v_uint8x64 p = v_popcount(v_reinterpret_as_s8(a));\n    p += v_rotate_right<1>(p);\n    p += v_rotate_right<2>(p);\n    return v_reinterpret_as_u32(p) & v512_setall_u32(0x000000ff);\n#endif\n}\ninline v_uint64x8 v_popcount(const v_int64x8& a)\n{\n#if CV_AVX_512VPOPCNTDQ\n    return v_uint64x8(_mm512_popcnt_epi64(a.val));\n#else\n    return v_uint64x8(_mm512_sad_epu8(v_popcount(v_reinterpret_as_s8(a)).val, _mm512_setzero_si512()));\n#endif\n}\n\n\ninline v_uint8x64  v_popcount(const v_uint8x64&  a) { return v_popcount(v_reinterpret_as_s8 (a)); }\ninline v_uint16x32 v_popcount(const v_uint16x32& a) { return v_popcount(v_reinterpret_as_s16(a)); }\ninline v_uint32x16 v_popcount(const v_uint32x16& a) { return v_popcount(v_reinterpret_as_s32(a)); }\ninline v_uint64x8  v_popcount(const v_uint64x8&  a) { return v_popcount(v_reinterpret_as_s64(a)); }\n\n\n////////// Other math /////////\n\n/** Some frequent operations **/\n#define OPENCV_HAL_IMPL_AVX512_MULADD(_Tpvec, suffix)                         \\\n    inline _Tpvec v_fma(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c)    \\\n    { return _Tpvec(_mm512_fmadd_##suffix(a.val, b.val, c.val)); }            \\\n    inline _Tpvec v_muladd(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c) \\\n    { return _Tpvec(_mm512_fmadd_##suffix(a.val, b.val, c.val)); }            \\\n    inline _Tpvec v_sqrt(const _Tpvec& x)                                     \\\n    { return _Tpvec(_mm512_sqrt_##suffix(x.val)); }                           \\\n    inline _Tpvec v_sqr_magnitude(const _Tpvec& a, const _Tpvec& b)           \\\n    { return v_fma(a, a, b * b); }                                            \\\n    inline _Tpvec v_magnitude(const _Tpvec& a, const _Tpvec& b)               \\\n    { return v_sqrt(v_fma(a, a, b * b)); }\n\nOPENCV_HAL_IMPL_AVX512_MULADD(v_float32x16, ps)\nOPENCV_HAL_IMPL_AVX512_MULADD(v_float64x8,  pd)\n\ninline v_int32x16 v_fma(const v_int32x16& a, const v_int32x16& b, const v_int32x16& c)\n{ return a * b + c; }\ninline v_int32x16 v_muladd(const v_int32x16& a, const v_int32x16& b, const v_int32x16& c)\n{ return v_fma(a, b, c); }\n\ninline v_float32x16 v_invsqrt(const v_float32x16& x)\n{\n#if CV_AVX_512ER\n    return v_float32x16(_mm512_rsqrt28_ps(x.val));\n#else\n    v_float32x16 half = x * v512_setall_f32(0.5);\n    v_float32x16 t  = v_float32x16(_mm512_rsqrt14_ps(x.val));\n    t *= v512_setall_f32(1.5) - ((t * t) * half);\n    return t;\n#endif\n}\n\ninline v_float64x8 v_invsqrt(const v_float64x8& x)\n{\n#if CV_AVX_512ER\n    return v_float64x8(_mm512_rsqrt28_pd(x.val));\n#else\n    return v512_setall_f64(1.) / v_sqrt(x);\n//    v_float64x8 half = x * v512_setall_f64(0.5);\n//    v_float64x8 t = v_float64x8(_mm512_rsqrt14_pd(x.val));\n//    t *= v512_setall_f64(1.5) - ((t * t) * half);\n//    t *= v512_setall_f64(1.5) - ((t * t) * half);\n//    return t;\n#endif\n}\n\n/** Absolute values **/\n#define OPENCV_HAL_IMPL_AVX512_ABS(_Tpvec, _Tpuvec, suffix) \\\n    inline _Tpuvec v_abs(const _Tpvec& x)                   \\\n    { return _Tpuvec(_mm512_abs_##suffix(x.val)); }\n\nOPENCV_HAL_IMPL_AVX512_ABS(v_int8x64,    v_uint8x64,    epi8)\nOPENCV_HAL_IMPL_AVX512_ABS(v_int16x32,   v_uint16x32,  epi16)\nOPENCV_HAL_IMPL_AVX512_ABS(v_int32x16,   v_uint32x16,  epi32)\nOPENCV_HAL_IMPL_AVX512_ABS(v_int64x8,    v_uint64x8,   epi64)\n\ninline v_float32x16 v_abs(const v_float32x16& x)\n{\n#ifdef _mm512_abs_pd\n    return v_float32x16(_mm512_abs_ps(x.val));\n#else\n    return v_float32x16(_mm512_castsi512_ps(_mm512_and_si512(_mm512_castps_si512(x.val),\n                        _v512_set_epu64(0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF,\n                                        0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF))));\n#endif\n}\n\ninline v_float64x8 v_abs(const v_float64x8& x)\n{\n#ifdef _mm512_abs_pd\n    #if defined __GNUC__ && (__GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ <= 3) || (__GNUC__ == 8 && __GNUC_MINOR__ <= 2))\n        // Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87476\n        return v_float64x8(_mm512_abs_pd(_mm512_castpd_ps(x.val)));\n    #else\n        return v_float64x8(_mm512_abs_pd(x.val));\n    #endif\n#else\n    return v_float64x8(_mm512_castsi512_pd(_mm512_and_si512(_mm512_castpd_si512(x.val),\n                       _v512_set_epu64(0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF,\n                                       0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF))));\n#endif\n}\n\n/** Absolute difference **/\ninline v_uint8x64 v_absdiff(const v_uint8x64& a, const v_uint8x64& b)\n{ return v_add_wrap(a - b,  b - a); }\ninline v_uint16x32 v_absdiff(const v_uint16x32& a, const v_uint16x32& b)\n{ return v_add_wrap(a - b,  b - a); }\ninline v_uint32x16 v_absdiff(const v_uint32x16& a, const v_uint32x16& b)\n{ return v_max(a, b) - v_min(a, b); }\n\ninline v_uint8x64 v_absdiff(const v_int8x64& a, const v_int8x64& b)\n{\n    v_int8x64 d = v_sub_wrap(a, b);\n    v_int8x64 m = a < b;\n    return v_reinterpret_as_u8(v_sub_wrap(d ^ m, m));\n}\n\ninline v_uint16x32 v_absdiff(const v_int16x32& a, const v_int16x32& b)\n{ return v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b))); }\n\ninline v_uint32x16 v_absdiff(const v_int32x16& a, const v_int32x16& b)\n{\n    v_int32x16 d = a - b;\n    v_int32x16 m = a < b;\n    return v_reinterpret_as_u32((d ^ m) - m);\n}\n\ninline v_float32x16 v_absdiff(const v_float32x16& a, const v_float32x16& b)\n{ return v_abs(a - b); }\n\ninline v_float64x8 v_absdiff(const v_float64x8& a, const v_float64x8& b)\n{ return v_abs(a - b); }\n\n/** Saturating absolute difference **/\ninline v_int8x64 v_absdiffs(const v_int8x64& a, const v_int8x64& b)\n{\n    v_int8x64 d = a - b;\n    v_int8x64 m = a < b;\n    return (d ^ m) - m;\n}\ninline v_int16x32 v_absdiffs(const v_int16x32& a, const v_int16x32& b)\n{ return v_max(a, b) - v_min(a, b); }\n\n////////// Conversions /////////\n\n/** Rounding **/\ninline v_int32x16 v_round(const v_float32x16& a)\n{ return v_int32x16(_mm512_cvtps_epi32(a.val)); }\n\ninline v_int32x16 v_round(const v_float64x8& a)\n{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvtpd_epi32(a.val))); }\n\ninline v_int32x16 v_round(const v_float64x8& a, const v_float64x8& b)\n{ return v_int32x16(_v512_combine(_mm512_cvtpd_epi32(a.val), _mm512_cvtpd_epi32(b.val))); }\n\ninline v_int32x16 v_trunc(const v_float32x16& a)\n{ return v_int32x16(_mm512_cvttps_epi32(a.val)); }\n\ninline v_int32x16 v_trunc(const v_float64x8& a)\n{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvttpd_epi32(a.val))); }\n\n#if CVT_ROUND_MODES_IMPLEMENTED\ninline v_int32x16 v_floor(const v_float32x16& a)\n{ return v_int32x16(_mm512_cvt_roundps_epi32(a.val, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC)); }\n\ninline v_int32x16 v_floor(const v_float64x8& a)\n{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvt_roundpd_epi32(a.val, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC))); }\n\ninline v_int32x16 v_ceil(const v_float32x16& a)\n{ return v_int32x16(_mm512_cvt_roundps_epi32(a.val, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC)); }\n\ninline v_int32x16 v_ceil(const v_float64x8& a)\n{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvt_roundpd_epi32(a.val, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC))); }\n#else\ninline v_int32x16 v_floor(const v_float32x16& a)\n{ return v_int32x16(_mm512_cvtps_epi32(_mm512_roundscale_ps(a.val, 1))); }\n\ninline v_int32x16 v_floor(const v_float64x8& a)\n{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvtpd_epi32(_mm512_roundscale_pd(a.val, 1)))); }\n\ninline v_int32x16 v_ceil(const v_float32x16& a)\n{ return v_int32x16(_mm512_cvtps_epi32(_mm512_roundscale_ps(a.val, 2))); }\n\ninline v_int32x16 v_ceil(const v_float64x8& a)\n{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvtpd_epi32(_mm512_roundscale_pd(a.val, 2)))); }\n#endif\n\n/** To float **/\ninline v_float32x16 v_cvt_f32(const v_int32x16& a)\n{ return v_float32x16(_mm512_cvtepi32_ps(a.val)); }\n\ninline v_float32x16 v_cvt_f32(const v_float64x8& a)\n{ return v_float32x16(_mm512_cvtpd_pslo(a.val)); }\n\ninline v_float32x16 v_cvt_f32(const v_float64x8& a, const v_float64x8& b)\n{ return v_float32x16(_v512_combine(_mm512_cvtpd_ps(a.val), _mm512_cvtpd_ps(b.val))); }\n\ninline v_float64x8 v_cvt_f64(const v_int32x16& a)\n{ return v_float64x8(_mm512_cvtepi32_pd(_v512_extract_low(a.val))); }\n\ninline v_float64x8 v_cvt_f64_high(const v_int32x16& a)\n{ return v_float64x8(_mm512_cvtepi32_pd(_v512_extract_high(a.val))); }\n\ninline v_float64x8 v_cvt_f64(const v_float32x16& a)\n{ return v_float64x8(_mm512_cvtps_pd(_v512_extract_low(a.val))); }\n\ninline v_float64x8 v_cvt_f64_high(const v_float32x16& a)\n{ return v_float64x8(_mm512_cvtps_pd(_v512_extract_high(a.val))); }\n\n// from (Mysticial and wim) https://stackoverflow.com/q/41144668\ninline v_float64x8 v_cvt_f64(const v_int64x8& v)\n{\n#if CV_AVX_512DQ\n    return v_float64x8(_mm512_cvtepi64_pd(v.val));\n#else\n    // constants encoded as floating-point\n    __m512i magic_i_lo   = _mm512_set1_epi64(0x4330000000000000); // 2^52\n    __m512i magic_i_hi32 = _mm512_set1_epi64(0x4530000080000000); // 2^84 + 2^63\n    __m512i magic_i_all  = _mm512_set1_epi64(0x4530000080100000); // 2^84 + 2^63 + 2^52\n    __m512d magic_d_all  = _mm512_castsi512_pd(magic_i_all);\n\n    // Blend the 32 lowest significant bits of v with magic_int_lo\n    __m512i v_lo         = _mm512_mask_blend_epi32(0x5555, magic_i_lo, v.val);\n    // Extract the 32 most significant bits of v\n    __m512i v_hi         = _mm512_srli_epi64(v.val, 32);\n    // Flip the msb of v_hi and blend with 0x45300000\n            v_hi         = _mm512_xor_si512(v_hi, magic_i_hi32);\n    // Compute in double precision\n    __m512d v_hi_dbl     = _mm512_sub_pd(_mm512_castsi512_pd(v_hi), magic_d_all);\n    // (v_hi - magic_d_all) + v_lo  Do not assume associativity of floating point addition\n    __m512d result       = _mm512_add_pd(v_hi_dbl, _mm512_castsi512_pd(v_lo));\n    return v_float64x8(result);\n#endif\n}\n\n////////////// Lookup table access ////////////////////\n\ninline v_int8x64 v512_lut(const schar* tab, const int* idx)\n{\n    __m128i p0 = _mm512_cvtepi32_epi8(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx    ), (const int *)tab, 1));\n    __m128i p1 = _mm512_cvtepi32_epi8(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 1), (const int *)tab, 1));\n    __m128i p2 = _mm512_cvtepi32_epi8(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 2), (const int *)tab, 1));\n    __m128i p3 = _mm512_cvtepi32_epi8(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 3), (const int *)tab, 1));\n    return v_int8x64(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_castsi128_si512(p0), p1, 1), p2, 2), p3, 3));\n}\ninline v_int8x64 v512_lut_pairs(const schar* tab, const int* idx)\n{\n    __m256i p0 = _mm512_cvtepi32_epi16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx    ), (const int *)tab, 1));\n    __m256i p1 = _mm512_cvtepi32_epi16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 1), (const int *)tab, 1));\n    return v_int8x64(_v512_combine(p0, p1));\n}\ninline v_int8x64 v512_lut_quads(const schar* tab, const int* idx)\n{\n    return v_int8x64(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx), (const int *)tab, 1));\n}\ninline v_uint8x64 v512_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v512_lut((const schar *)tab, idx)); }\ninline v_uint8x64 v512_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v512_lut_pairs((const schar *)tab, idx)); }\ninline v_uint8x64 v512_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v512_lut_quads((const schar *)tab, idx)); }\n\ninline v_int16x32 v512_lut(const short* tab, const int* idx)\n{\n    __m256i p0 = _mm512_cvtepi32_epi16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx    ), (const int *)tab, 2));\n    __m256i p1 = _mm512_cvtepi32_epi16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 1), (const int *)tab, 2));\n    return v_int16x32(_v512_combine(p0, p1));\n}\ninline v_int16x32 v512_lut_pairs(const short* tab, const int* idx)\n{\n    return v_int16x32(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx), (const int *)tab, 2));\n}\ninline v_int16x32 v512_lut_quads(const short* tab, const int* idx)\n{\n#if defined(__GNUC__)\n    return v_int16x32(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const long long int*)tab, 2));\n#else\n    return v_int16x32(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const int64*)tab, 2));\n#endif\n}\ninline v_uint16x32 v512_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v512_lut((const short *)tab, idx)); }\ninline v_uint16x32 v512_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v512_lut_pairs((const short *)tab, idx)); }\ninline v_uint16x32 v512_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v512_lut_quads((const short *)tab, idx)); }\n\ninline v_int32x16 v512_lut(const int* tab, const int* idx)\n{\n    return v_int32x16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx), tab, 4));\n}\ninline v_int32x16 v512_lut_pairs(const int* tab, const int* idx)\n{\n#if defined(__GNUC__)\n    return v_int32x16(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const long long int*)tab, 4));\n#else\n    return v_int32x16(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const int64*)tab, 4));\n#endif\n}\ninline v_int32x16 v512_lut_quads(const int* tab, const int* idx)\n{\n    return v_int32x16(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_castsi128_si512(\n                          _mm_loadu_si128((const __m128i*)(tab + idx[0]))),\n                          _mm_loadu_si128((const __m128i*)(tab + idx[1])), 1),\n                          _mm_loadu_si128((const __m128i*)(tab + idx[2])), 2),\n                          _mm_loadu_si128((const __m128i*)(tab + idx[3])), 3));\n}\ninline v_uint32x16 v512_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v512_lut((const int *)tab, idx)); }\ninline v_uint32x16 v512_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v512_lut_pairs((const int *)tab, idx)); }\ninline v_uint32x16 v512_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v512_lut_quads((const int *)tab, idx)); }\n\ninline v_int64x8 v512_lut(const int64* tab, const int* idx)\n{\n#if defined(__GNUC__)\n    return v_int64x8(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const long long int*)tab, 8));\n#else\n    return v_int64x8(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), tab , 8));\n#endif\n}\ninline v_int64x8 v512_lut_pairs(const int64* tab, const int* idx)\n{\n    return v_int64x8(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_castsi128_si512(\n                         _mm_loadu_si128((const __m128i*)(tab + idx[0]))),\n                         _mm_loadu_si128((const __m128i*)(tab + idx[1])), 1),\n                         _mm_loadu_si128((const __m128i*)(tab + idx[2])), 2),\n                         _mm_loadu_si128((const __m128i*)(tab + idx[3])), 3));\n}\ninline v_uint64x8 v512_lut(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v512_lut((const int64 *)tab, idx)); }\ninline v_uint64x8 v512_lut_pairs(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v512_lut_pairs((const int64 *)tab, idx)); }\n\ninline v_float32x16 v512_lut(const float* tab, const int* idx)\n{\n    return v_float32x16(_mm512_i32gather_ps(_mm512_loadu_si512((const __m512i*)idx), tab, 4));\n}\ninline v_float32x16 v512_lut_pairs(const float* tab, const int* idx) { return v_reinterpret_as_f32(v512_lut_pairs((const int *)tab, idx)); }\ninline v_float32x16 v512_lut_quads(const float* tab, const int* idx) { return v_reinterpret_as_f32(v512_lut_quads((const int *)tab, idx)); }\n\ninline v_float64x8 v512_lut(const double* tab, const int* idx)\n{\n    return v_float64x8(_mm512_i32gather_pd(_mm256_loadu_si256((const __m256i*)idx), tab, 8));\n}\ninline v_float64x8 v512_lut_pairs(const double* tab, const int* idx)\n{\n        return v_float64x8(_mm512_insertf64x2(_mm512_insertf64x2(_mm512_insertf64x2(_mm512_castpd128_pd512(\n                               _mm_loadu_pd(tab + idx[0])),\n                               _mm_loadu_pd(tab + idx[1]), 1),\n                               _mm_loadu_pd(tab + idx[2]), 2),\n                               _mm_loadu_pd(tab + idx[3]), 3));\n}\n\ninline v_int32x16 v_lut(const int* tab, const v_int32x16& idxvec)\n{\n    return v_int32x16(_mm512_i32gather_epi32(idxvec.val, tab, 4));\n}\n\ninline v_uint32x16 v_lut(const unsigned* tab, const v_int32x16& idxvec)\n{\n    return v_reinterpret_as_u32(v_lut((const int *)tab, idxvec));\n}\n\ninline v_float32x16 v_lut(const float* tab, const v_int32x16& idxvec)\n{\n    return v_float32x16(_mm512_i32gather_ps(idxvec.val, tab, 4));\n}\n\ninline v_float64x8 v_lut(const double* tab, const v_int32x16& idxvec)\n{\n    return v_float64x8(_mm512_i32gather_pd(_v512_extract_low(idxvec.val), tab, 8));\n}\n\ninline void v_lut_deinterleave(const float* tab, const v_int32x16& idxvec, v_float32x16& x, v_float32x16& y)\n{\n    x.val = _mm512_i32gather_ps(idxvec.val, tab, 4);\n    y.val = _mm512_i32gather_ps(idxvec.val, &tab[1], 4);\n}\n\ninline void v_lut_deinterleave(const double* tab, const v_int32x16& idxvec, v_float64x8& x, v_float64x8& y)\n{\n    x.val = _mm512_i32gather_pd(_v512_extract_low(idxvec.val), tab, 8);\n    y.val = _mm512_i32gather_pd(_v512_extract_low(idxvec.val), &tab[1], 8);\n}\n\ninline v_int8x64 v_interleave_pairs(const v_int8x64& vec)\n{\n    return v_int8x64(_mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0x0f0d0e0c, 0x0b090a08, 0x07050604, 0x03010200)));\n}\ninline v_uint8x64 v_interleave_pairs(const v_uint8x64& vec) { return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); }\ninline v_int8x64 v_interleave_quads(const v_int8x64& vec)\n{\n    return v_int8x64(_mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0x0f0b0e0a, 0x0d090c08, 0x07030602, 0x05010400)));\n}\ninline v_uint8x64 v_interleave_quads(const v_uint8x64& vec) { return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x32 v_interleave_pairs(const v_int16x32& vec)\n{\n    return v_int16x32(_mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0x0f0e0b0a, 0x0d0c0908, 0x07060302, 0x05040100)));\n}\ninline v_uint16x32 v_interleave_pairs(const v_uint16x32& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); }\ninline v_int16x32 v_interleave_quads(const v_int16x32& vec)\n{\n    return v_int16x32(_mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0x0f0e0706, 0x0d0c0504, 0x0b0a0302, 0x09080100)));\n}\ninline v_uint16x32 v_interleave_quads(const v_uint16x32& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x16 v_interleave_pairs(const v_int32x16& vec)\n{\n    return v_int32x16(_mm512_shuffle_epi32(vec.val, _MM_PERM_ACBD));\n}\ninline v_uint32x16 v_interleave_pairs(const v_uint32x16& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\ninline v_float32x16 v_interleave_pairs(const v_float32x16& vec) { return v_reinterpret_as_f32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\n\ninline v_int8x64 v_pack_triplets(const v_int8x64& vec)\n{\n    return v_int8x64(_mm512_permutexvar_epi32(_v512_set_epu64(0x0000000f0000000f, 0x0000000f0000000f, 0x0000000e0000000d, 0x0000000c0000000a,\n                                                              0x0000000900000008, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000),\n                                              _mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0xffffff0f, 0x0e0d0c0a, 0x09080605, 0x04020100))));\n}\ninline v_uint8x64 v_pack_triplets(const v_uint8x64& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x32 v_pack_triplets(const v_int16x32& vec)\n{\n    return v_int16x32(_mm512_permutexvar_epi16(_v512_set_epu64(0x001f001f001f001f, 0x001f001f001f001f, 0x001e001d001c001a, 0x0019001800160015,\n                                                               0x0014001200110010, 0x000e000d000c000a, 0x0009000800060005, 0x0004000200010000), vec.val));\n}\ninline v_uint16x32 v_pack_triplets(const v_uint16x32& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x16 v_pack_triplets(const v_int32x16& vec)\n{\n    return v_int32x16(_mm512_permutexvar_epi32(_v512_set_epu64(0x0000000f0000000f, 0x0000000f0000000f, 0x0000000e0000000d, 0x0000000c0000000a,\n                                                               0x0000000900000008, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000), vec.val));\n}\ninline v_uint32x16 v_pack_triplets(const v_uint32x16& vec) { return v_reinterpret_as_u32(v_pack_triplets(v_reinterpret_as_s32(vec))); }\ninline v_float32x16 v_pack_triplets(const v_float32x16& vec)\n{\n    return v_float32x16(_mm512_permutexvar_ps(_v512_set_epu64(0x0000000f0000000f, 0x0000000f0000000f, 0x0000000e0000000d, 0x0000000c0000000a,\n                                                              0x0000000900000008, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000), vec.val));\n}\n\n////////// Matrix operations /////////\n\n//////// Dot Product ////////\n\n// 16 >> 32\ninline v_int32x16 v_dotprod(const v_int16x32& a, const v_int16x32& b)\n{ return v_int32x16(_mm512_madd_epi16(a.val, b.val)); }\ninline v_int32x16 v_dotprod(const v_int16x32& a, const v_int16x32& b, const v_int32x16& c)\n{ return v_dotprod(a, b) + c; }\n\n// 32 >> 64\ninline v_int64x8 v_dotprod(const v_int32x16& a, const v_int32x16& b)\n{\n    __m512i even = _mm512_mul_epi32(a.val, b.val);\n    __m512i odd = _mm512_mul_epi32(_mm512_srli_epi64(a.val, 32), _mm512_srli_epi64(b.val, 32));\n    return v_int64x8(_mm512_add_epi64(even, odd));\n}\ninline v_int64x8 v_dotprod(const v_int32x16& a, const v_int32x16& b, const v_int64x8& c)\n{ return v_dotprod(a, b) + c; }\n\n// 8 >> 32\ninline v_uint32x16 v_dotprod_expand(const v_uint8x64& a, const v_uint8x64& b)\n{\n    __m512i even_a = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, a.val, _mm512_setzero_si512());\n    __m512i odd_a  = _mm512_srli_epi16(a.val, 8);\n\n    __m512i even_b = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, b.val, _mm512_setzero_si512());\n    __m512i odd_b  = _mm512_srli_epi16(b.val, 8);\n\n    __m512i prod0  = _mm512_madd_epi16(even_a, even_b);\n    __m512i prod1  = _mm512_madd_epi16(odd_a, odd_b);\n    return v_uint32x16(_mm512_add_epi32(prod0, prod1));\n}\ninline v_uint32x16 v_dotprod_expand(const v_uint8x64& a, const v_uint8x64& b, const v_uint32x16& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int32x16 v_dotprod_expand(const v_int8x64& a, const v_int8x64& b)\n{\n    __m512i even_a = _mm512_srai_epi16(_mm512_bslli_epi128(a.val, 1), 8);\n    __m512i odd_a  = _mm512_srai_epi16(a.val, 8);\n\n    __m512i even_b = _mm512_srai_epi16(_mm512_bslli_epi128(b.val, 1), 8);\n    __m512i odd_b  = _mm512_srai_epi16(b.val, 8);\n\n    __m512i prod0  = _mm512_madd_epi16(even_a, even_b);\n    __m512i prod1  = _mm512_madd_epi16(odd_a, odd_b);\n    return v_int32x16(_mm512_add_epi32(prod0, prod1));\n}\ninline v_int32x16 v_dotprod_expand(const v_int8x64& a, const v_int8x64& b, const v_int32x16& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 16 >> 64\ninline v_uint64x8 v_dotprod_expand(const v_uint16x32& a, const v_uint16x32& b)\n{\n    __m512i mullo = _mm512_mullo_epi16(a.val, b.val);\n    __m512i mulhi = _mm512_mulhi_epu16(a.val, b.val);\n    __m512i mul0  = _mm512_unpacklo_epi16(mullo, mulhi);\n    __m512i mul1  = _mm512_unpackhi_epi16(mullo, mulhi);\n\n    __m512i p02   = _mm512_mask_blend_epi32(0xAAAA, mul0, _mm512_setzero_si512());\n    __m512i p13   = _mm512_srli_epi64(mul0, 32);\n    __m512i p46   = _mm512_mask_blend_epi32(0xAAAA, mul1, _mm512_setzero_si512());\n    __m512i p57   = _mm512_srli_epi64(mul1, 32);\n\n    __m512i p15_  = _mm512_add_epi64(p02, p13);\n    __m512i p9d_  = _mm512_add_epi64(p46, p57);\n\n    return v_uint64x8(_mm512_add_epi64(\n        _mm512_unpacklo_epi64(p15_, p9d_),\n        _mm512_unpackhi_epi64(p15_, p9d_)\n    ));\n}\ninline v_uint64x8 v_dotprod_expand(const v_uint16x32& a, const v_uint16x32& b, const v_uint64x8& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int64x8 v_dotprod_expand(const v_int16x32& a, const v_int16x32& b)\n{\n    __m512i prod = _mm512_madd_epi16(a.val, b.val);\n    __m512i even = _mm512_srai_epi64(_mm512_bslli_epi128(prod, 4), 32);\n    __m512i odd  = _mm512_srai_epi64(prod, 32);\n    return v_int64x8(_mm512_add_epi64(even, odd));\n}\ninline v_int64x8 v_dotprod_expand(const v_int16x32& a, const v_int16x32& b, const v_int64x8& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 32 >> 64f\ninline v_float64x8 v_dotprod_expand(const v_int32x16& a, const v_int32x16& b)\n{ return v_cvt_f64(v_dotprod(a, b)); }\ninline v_float64x8 v_dotprod_expand(const v_int32x16& a, const v_int32x16& b, const v_float64x8& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n//////// Fast Dot Product ////////\n\n// 16 >> 32\ninline v_int32x16 v_dotprod_fast(const v_int16x32& a, const v_int16x32& b)\n{ return v_dotprod(a, b); }\ninline v_int32x16 v_dotprod_fast(const v_int16x32& a, const v_int16x32& b, const v_int32x16& c)\n{ return v_dotprod(a, b, c); }\n\n// 32 >> 64\ninline v_int64x8 v_dotprod_fast(const v_int32x16& a, const v_int32x16& b)\n{ return v_dotprod(a, b); }\ninline v_int64x8 v_dotprod_fast(const v_int32x16& a, const v_int32x16& b, const v_int64x8& c)\n{ return v_dotprod(a, b, c); }\n\n// 8 >> 32\ninline v_uint32x16 v_dotprod_expand_fast(const v_uint8x64& a, const v_uint8x64& b)\n{ return v_dotprod_expand(a, b); }\ninline v_uint32x16 v_dotprod_expand_fast(const v_uint8x64& a, const v_uint8x64& b, const v_uint32x16& c)\n{ return v_dotprod_expand(a, b, c); }\n\ninline v_int32x16 v_dotprod_expand_fast(const v_int8x64& a, const v_int8x64& b)\n{ return v_dotprod_expand(a, b); }\ninline v_int32x16 v_dotprod_expand_fast(const v_int8x64& a, const v_int8x64& b, const v_int32x16& c)\n{ return v_dotprod_expand(a, b, c); }\n\n// 16 >> 64\ninline v_uint64x8 v_dotprod_expand_fast(const v_uint16x32& a, const v_uint16x32& b)\n{\n    __m512i mullo = _mm512_mullo_epi16(a.val, b.val);\n    __m512i mulhi = _mm512_mulhi_epu16(a.val, b.val);\n    __m512i mul0  = _mm512_unpacklo_epi16(mullo, mulhi);\n    __m512i mul1  = _mm512_unpackhi_epi16(mullo, mulhi);\n\n    __m512i p02   = _mm512_mask_blend_epi32(0xAAAA, mul0, _mm512_setzero_si512());\n    __m512i p13   = _mm512_srli_epi64(mul0, 32);\n    __m512i p46   = _mm512_mask_blend_epi32(0xAAAA, mul1, _mm512_setzero_si512());\n    __m512i p57   = _mm512_srli_epi64(mul1, 32);\n\n    __m512i p15_  = _mm512_add_epi64(p02, p13);\n    __m512i p9d_  = _mm512_add_epi64(p46, p57);\n    return v_uint64x8(_mm512_add_epi64(p15_, p9d_));\n}\ninline v_uint64x8 v_dotprod_expand_fast(const v_uint16x32& a, const v_uint16x32& b, const v_uint64x8& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\ninline v_int64x8 v_dotprod_expand_fast(const v_int16x32& a, const v_int16x32& b)\n{ return v_dotprod_expand(a, b); }\ninline v_int64x8 v_dotprod_expand_fast(const v_int16x32& a, const v_int16x32& b, const v_int64x8& c)\n{ return v_dotprod_expand(a, b, c); }\n\n// 32 >> 64f\ninline v_float64x8 v_dotprod_expand_fast(const v_int32x16& a, const v_int32x16& b)\n{ return v_dotprod_expand(a, b); }\ninline v_float64x8 v_dotprod_expand_fast(const v_int32x16& a, const v_int32x16& b, const v_float64x8& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n\n#define OPENCV_HAL_AVX512_SPLAT2_PS(a, im) \\\n    v_float32x16(_mm512_permute_ps(a.val, _MM_SHUFFLE(im, im, im, im)))\n\ninline v_float32x16 v_matmul(const v_float32x16& v,\n                             const v_float32x16& m0, const v_float32x16& m1,\n                             const v_float32x16& m2, const v_float32x16& m3)\n{\n    v_float32x16 v04 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 0);\n    v_float32x16 v15 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 1);\n    v_float32x16 v26 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 2);\n    v_float32x16 v37 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 3);\n    return v_fma(v04, m0, v_fma(v15, m1, v_fma(v26, m2, v37 * m3)));\n}\n\ninline v_float32x16 v_matmuladd(const v_float32x16& v,\n                                const v_float32x16& m0, const v_float32x16& m1,\n                                const v_float32x16& m2, const v_float32x16& a)\n{\n    v_float32x16 v04 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 0);\n    v_float32x16 v15 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 1);\n    v_float32x16 v26 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 2);\n    return v_fma(v04, m0, v_fma(v15, m1, v_fma(v26, m2, a)));\n}\n\n#define OPENCV_HAL_IMPL_AVX512_TRANSPOSE4x4(_Tpvec, suffix, cast_from, cast_to) \\\n    inline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1,              \\\n                               const _Tpvec& a2, const _Tpvec& a3,              \\\n                               _Tpvec& b0, _Tpvec& b1, _Tpvec& b2, _Tpvec& b3)  \\\n    {                                                                           \\\n        __m512i t0 = cast_from(_mm512_unpacklo_##suffix(a0.val, a1.val));       \\\n        __m512i t1 = cast_from(_mm512_unpacklo_##suffix(a2.val, a3.val));       \\\n        __m512i t2 = cast_from(_mm512_unpackhi_##suffix(a0.val, a1.val));       \\\n        __m512i t3 = cast_from(_mm512_unpackhi_##suffix(a2.val, a3.val));       \\\n        b0.val = cast_to(_mm512_unpacklo_epi64(t0, t1));                        \\\n        b1.val = cast_to(_mm512_unpackhi_epi64(t0, t1));                        \\\n        b2.val = cast_to(_mm512_unpacklo_epi64(t2, t3));                        \\\n        b3.val = cast_to(_mm512_unpackhi_epi64(t2, t3));                        \\\n    }\n\nOPENCV_HAL_IMPL_AVX512_TRANSPOSE4x4(v_uint32x16,  epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_AVX512_TRANSPOSE4x4(v_int32x16,   epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_AVX512_TRANSPOSE4x4(v_float32x16, ps, _mm512_castps_si512, _mm512_castsi512_ps)\n\n//////////////// Value reordering ///////////////\n\n/* Expand */\n#define OPENCV_HAL_IMPL_AVX512_EXPAND(_Tpvec, _Tpwvec, _Tp, intrin) \\\n    inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \\\n    {                                                               \\\n        b0.val = intrin(_v512_extract_low(a.val));                  \\\n        b1.val = intrin(_v512_extract_high(a.val));                 \\\n    }                                                               \\\n    inline _Tpwvec v_expand_low(const _Tpvec& a)                    \\\n    { return _Tpwvec(intrin(_v512_extract_low(a.val))); }           \\\n    inline _Tpwvec v_expand_high(const _Tpvec& a)                   \\\n    { return _Tpwvec(intrin(_v512_extract_high(a.val))); }          \\\n    inline _Tpwvec v512_load_expand(const _Tp* ptr)                 \\\n    {                                                               \\\n        __m256i a = _mm256_loadu_si256((const __m256i*)ptr);        \\\n        return _Tpwvec(intrin(a));                                  \\\n    }\n\nOPENCV_HAL_IMPL_AVX512_EXPAND(v_uint8x64,  v_uint16x32, uchar,    _mm512_cvtepu8_epi16)\nOPENCV_HAL_IMPL_AVX512_EXPAND(v_int8x64,   v_int16x32,  schar,    _mm512_cvtepi8_epi16)\nOPENCV_HAL_IMPL_AVX512_EXPAND(v_uint16x32, v_uint32x16, ushort,   _mm512_cvtepu16_epi32)\nOPENCV_HAL_IMPL_AVX512_EXPAND(v_int16x32,  v_int32x16,  short,    _mm512_cvtepi16_epi32)\nOPENCV_HAL_IMPL_AVX512_EXPAND(v_uint32x16, v_uint64x8,  unsigned, _mm512_cvtepu32_epi64)\nOPENCV_HAL_IMPL_AVX512_EXPAND(v_int32x16,  v_int64x8,   int,      _mm512_cvtepi32_epi64)\n\n#define OPENCV_HAL_IMPL_AVX512_EXPAND_Q(_Tpvec, _Tp, intrin) \\\n    inline _Tpvec v512_load_expand_q(const _Tp* ptr)         \\\n    {                                                        \\\n        __m128i a = _mm_loadu_si128((const __m128i*)ptr);    \\\n        return _Tpvec(intrin(a));                            \\\n    }\n\nOPENCV_HAL_IMPL_AVX512_EXPAND_Q(v_uint32x16, uchar, _mm512_cvtepu8_epi32)\nOPENCV_HAL_IMPL_AVX512_EXPAND_Q(v_int32x16,  schar, _mm512_cvtepi8_epi32)\n\n/* pack */\n// 16\ninline v_int8x64 v_pack(const v_int16x32& a, const v_int16x32& b)\n{ return v_int8x64(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packs_epi16(a.val, b.val))); }\n\ninline v_uint8x64 v_pack(const v_uint16x32& a, const v_uint16x32& b)\n{\n    const __m512i t = _mm512_set1_epi16(255);\n    return v_uint8x64(_v512_combine(_mm512_cvtepi16_epi8(_mm512_min_epu16(a.val, t)), _mm512_cvtepi16_epi8(_mm512_min_epu16(b.val, t))));\n}\n\ninline v_uint8x64 v_pack_u(const v_int16x32& a, const v_int16x32& b)\n{\n    return v_uint8x64(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packus_epi16(a.val, b.val)));\n}\n\ninline void v_pack_store(schar* ptr, const v_int16x32& a)\n{ v_store_low(ptr, v_pack(a, a)); }\n\ninline void v_pack_store(uchar* ptr, const v_uint16x32& a)\n{\n    const __m512i m = _mm512_set1_epi16(255);\n    _mm256_storeu_si256((__m256i*)ptr, _mm512_cvtepi16_epi8(_mm512_min_epu16(a.val, m)));\n}\n\ninline void v_pack_u_store(uchar* ptr, const v_int16x32& a)\n{ v_store_low(ptr, v_pack_u(a, a)); }\n\ntemplate<int n> inline\nv_uint8x64 v_rshr_pack(const v_uint16x32& a, const v_uint16x32& b)\n{\n    // we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers.\n    v_uint16x32 delta = v512_setall_u16((short)(1 << (n-1)));\n    return v_pack_u(v_reinterpret_as_s16((a + delta) >> n),\n                    v_reinterpret_as_s16((b + delta) >> n));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(uchar* ptr, const v_uint16x32& a)\n{\n    v_uint16x32 delta = v512_setall_u16((short)(1 << (n-1)));\n    v_pack_u_store(ptr, v_reinterpret_as_s16((a + delta) >> n));\n}\n\ntemplate<int n> inline\nv_uint8x64 v_rshr_pack_u(const v_int16x32& a, const v_int16x32& b)\n{\n    v_int16x32 delta = v512_setall_s16((short)(1 << (n-1)));\n    return v_pack_u((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_u_store(uchar* ptr, const v_int16x32& a)\n{\n    v_int16x32 delta = v512_setall_s16((short)(1 << (n-1)));\n    v_pack_u_store(ptr, (a + delta) >> n);\n}\n\ntemplate<int n> inline\nv_int8x64 v_rshr_pack(const v_int16x32& a, const v_int16x32& b)\n{\n    v_int16x32 delta = v512_setall_s16((short)(1 << (n-1)));\n    return v_pack((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(schar* ptr, const v_int16x32& a)\n{\n    v_int16x32 delta = v512_setall_s16((short)(1 << (n-1)));\n    v_pack_store(ptr, (a + delta) >> n);\n}\n\n// 32\ninline v_int16x32 v_pack(const v_int32x16& a, const v_int32x16& b)\n{ return v_int16x32(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packs_epi32(a.val, b.val))); }\n\ninline v_uint16x32 v_pack(const v_uint32x16& a, const v_uint32x16& b)\n{\n    const __m512i m = _mm512_set1_epi32(65535);\n    return v_uint16x32(_v512_combine(_mm512_cvtepi32_epi16(_mm512_min_epu32(a.val, m)), _mm512_cvtepi32_epi16(_mm512_min_epu32(b.val, m))));\n}\n\ninline v_uint16x32 v_pack_u(const v_int32x16& a, const v_int32x16& b)\n{ return v_uint16x32(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packus_epi32(a.val, b.val))); }\n\ninline void v_pack_store(short* ptr, const v_int32x16& a)\n{ v_store_low(ptr, v_pack(a, a)); }\n\ninline void v_pack_store(ushort* ptr, const v_uint32x16& a)\n{\n    const __m512i m = _mm512_set1_epi32(65535);\n    _mm256_storeu_si256((__m256i*)ptr, _mm512_cvtepi32_epi16(_mm512_min_epu32(a.val, m)));\n}\n\ninline void v_pack_u_store(ushort* ptr, const v_int32x16& a)\n{ v_store_low(ptr, v_pack_u(a, a)); }\n\n\ntemplate<int n> inline\nv_uint16x32 v_rshr_pack(const v_uint32x16& a, const v_uint32x16& b)\n{\n    v_uint32x16 delta = v512_setall_u32(1 << (n-1));\n    return v_pack_u(v_reinterpret_as_s32((a + delta) >> n),\n                    v_reinterpret_as_s32((b + delta) >> n));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(ushort* ptr, const v_uint32x16& a)\n{\n    v_uint32x16 delta = v512_setall_u32(1 << (n-1));\n    v_pack_u_store(ptr, v_reinterpret_as_s32((a + delta) >> n));\n}\n\ntemplate<int n> inline\nv_uint16x32 v_rshr_pack_u(const v_int32x16& a, const v_int32x16& b)\n{\n    v_int32x16 delta = v512_setall_s32(1 << (n-1));\n    return v_pack_u((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_u_store(ushort* ptr, const v_int32x16& a)\n{\n    v_int32x16 delta = v512_setall_s32(1 << (n-1));\n    v_pack_u_store(ptr, (a + delta) >> n);\n}\n\ntemplate<int n> inline\nv_int16x32 v_rshr_pack(const v_int32x16& a, const v_int32x16& b)\n{\n    v_int32x16 delta = v512_setall_s32(1 << (n-1));\n    return v_pack((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(short* ptr, const v_int32x16& a)\n{\n    v_int32x16 delta = v512_setall_s32(1 << (n-1));\n    v_pack_store(ptr, (a + delta) >> n);\n}\n\n// 64\n// Non-saturating pack\ninline v_uint32x16 v_pack(const v_uint64x8& a, const v_uint64x8& b)\n{ return v_uint32x16(_v512_combine(_mm512_cvtepi64_epi32(a.val), _mm512_cvtepi64_epi32(b.val))); }\n\ninline v_int32x16 v_pack(const v_int64x8& a, const v_int64x8& b)\n{ return v_reinterpret_as_s32(v_pack(v_reinterpret_as_u64(a), v_reinterpret_as_u64(b))); }\n\ninline void v_pack_store(unsigned* ptr, const v_uint64x8& a)\n{ _mm256_storeu_si256((__m256i*)ptr, _mm512_cvtepi64_epi32(a.val)); }\n\ninline void v_pack_store(int* ptr, const v_int64x8& b)\n{ v_pack_store((unsigned*)ptr, v_reinterpret_as_u64(b)); }\n\ntemplate<int n> inline\nv_uint32x16 v_rshr_pack(const v_uint64x8& a, const v_uint64x8& b)\n{\n    v_uint64x8 delta = v512_setall_u64((uint64)1 << (n-1));\n    return v_pack((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(unsigned* ptr, const v_uint64x8& a)\n{\n    v_uint64x8 delta = v512_setall_u64((uint64)1 << (n-1));\n    v_pack_store(ptr, (a + delta) >> n);\n}\n\ntemplate<int n> inline\nv_int32x16 v_rshr_pack(const v_int64x8& a, const v_int64x8& b)\n{\n    v_int64x8 delta = v512_setall_s64((int64)1 << (n-1));\n    return v_pack((a + delta) >> n, (b + delta) >> n);\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(int* ptr, const v_int64x8& a)\n{\n    v_int64x8 delta = v512_setall_s64((int64)1 << (n-1));\n    v_pack_store(ptr, (a + delta) >> n);\n}\n\n// pack boolean\ninline v_uint8x64 v_pack_b(const v_uint16x32& a, const v_uint16x32& b)\n{ return v_uint8x64(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packs_epi16(a.val, b.val))); }\n\ninline v_uint8x64 v_pack_b(const v_uint32x16& a, const v_uint32x16& b,\n                           const v_uint32x16& c, const v_uint32x16& d)\n{\n    __m512i ab = _mm512_packs_epi32(a.val, b.val);\n    __m512i cd = _mm512_packs_epi32(c.val, d.val);\n\n    return v_uint8x64(_mm512_permutexvar_epi32(_v512_set_epu32(15, 11, 7, 3, 14, 10, 6, 2, 13, 9, 5, 1, 12, 8, 4, 0), _mm512_packs_epi16(ab, cd)));\n}\n\ninline v_uint8x64 v_pack_b(const v_uint64x8& a, const v_uint64x8& b, const v_uint64x8& c,\n                           const v_uint64x8& d, const v_uint64x8& e, const v_uint64x8& f,\n                           const v_uint64x8& g, const v_uint64x8& h)\n{\n    __m512i ab = _mm512_packs_epi32(a.val, b.val);\n    __m512i cd = _mm512_packs_epi32(c.val, d.val);\n    __m512i ef = _mm512_packs_epi32(e.val, f.val);\n    __m512i gh = _mm512_packs_epi32(g.val, h.val);\n\n    __m512i abcd = _mm512_packs_epi32(ab, cd);\n    __m512i efgh = _mm512_packs_epi32(ef, gh);\n\n    return v_uint8x64(_mm512_permutexvar_epi16(_v512_set_epu16(31, 23, 15, 7, 30, 22, 14, 6, 29, 21, 13, 5, 28, 20, 12, 4,\n                                                               27, 19, 11, 3, 26, 18, 10, 2, 25, 17,  9, 1, 24, 16,  8, 0), _mm512_packs_epi16(abcd, efgh)));\n}\n\n/* Recombine */\n// its up there with load and store operations\n\n/* Extract */\n#define OPENCV_HAL_IMPL_AVX512_EXTRACT(_Tpvec)                \\\n    template<int s>                                           \\\n    inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) \\\n    { return v_rotate_right<s>(a, b); }\n\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_uint8x64)\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_int8x64)\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_uint16x32)\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_int16x32)\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_uint32x16)\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_int32x16)\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_uint64x8)\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_int64x8)\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_float32x16)\nOPENCV_HAL_IMPL_AVX512_EXTRACT(v_float64x8)\n\n#define OPENCV_HAL_IMPL_AVX512_EXTRACT_N(_Tpvec, _Tp) \\\ntemplate<int i> inline _Tp v_extract_n(_Tpvec v) { return v_rotate_right<i>(v).get0(); }\n\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_uint8x64, uchar)\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_int8x64, schar)\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_uint16x32, ushort)\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_int16x32, short)\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_uint32x16, uint)\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_int32x16, int)\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_uint64x8, uint64)\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_int64x8, int64)\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_float32x16, float)\nOPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_float64x8, double)\n\ntemplate<int i>\ninline v_uint32x16 v_broadcast_element(v_uint32x16 a)\n{\n    static const __m512i perm = _mm512_set1_epi32((char)i);\n    return v_uint32x16(_mm512_permutexvar_epi32(perm, a.val));\n}\n\ntemplate<int i>\ninline v_int32x16 v_broadcast_element(const v_int32x16 &a)\n{ return v_reinterpret_as_s32(v_broadcast_element<i>(v_reinterpret_as_u32(a))); }\n\ntemplate<int i>\ninline v_float32x16 v_broadcast_element(const v_float32x16 &a)\n{ return v_reinterpret_as_f32(v_broadcast_element<i>(v_reinterpret_as_u32(a))); }\n\n\n///////////////////// load deinterleave /////////////////////////////\n\ninline void v_load_deinterleave( const uchar* ptr, v_uint8x64& a, v_uint8x64& b )\n{\n    __m512i ab0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i ab1 = _mm512_loadu_si512((const __m512i*)(ptr + 64));\n#if CV_AVX_512VBMI\n    __m512i mask0 = _v512_set_epu8(126, 124, 122, 120, 118, 116, 114, 112, 110, 108, 106, 104, 102, 100, 98, 96,\n                                    94,  92,  90,  88,  86,  84,  82,  80,  78,  76,  74,  72,  70,  68, 66, 64,\n                                    62,  60,  58,  56,  54,  52,  50,  48,  46,  44,  42,  40,  38,  36, 34, 32,\n                                    30,  28,  26,  24,  22,  20,  18,  16,  14,  12,  10,   8,   6,   4,  2,  0);\n    __m512i mask1 = _v512_set_epu8(127, 125, 123, 121, 119, 117, 115, 113, 111, 109, 107, 105, 103, 101, 99, 97,\n                                    95,  93,  91,  89,  87,  85,  83,  81,  79,  77,  75,  73,  71,  69, 67, 65,\n                                    63,  61,  59,  57,  55,  53,  51,  49,  47,  45,  43,  41,  39,  37, 35, 33,\n                                    31,  29,  27,  25,  23,  21,  19,  17,  15,  13,  11,   9,   7,   5,  3,  1);\n    a = v_uint8x64(_mm512_permutex2var_epi8(ab0, mask0, ab1));\n    b = v_uint8x64(_mm512_permutex2var_epi8(ab0, mask1, ab1));\n#else\n    __m512i mask0 = _mm512_set4_epi32(0x0f0d0b09, 0x07050301, 0x0e0c0a08, 0x06040200);\n    __m512i a0b0 = _mm512_shuffle_epi8(ab0, mask0);\n    __m512i a1b1 = _mm512_shuffle_epi8(ab1, mask0);\n    __m512i mask1 = _v512_set_epu64(14, 12, 10, 8, 6, 4, 2, 0);\n    __m512i mask2 = _v512_set_epu64(15, 13, 11, 9, 7, 5, 3, 1);\n    a = v_uint8x64(_mm512_permutex2var_epi64(a0b0, mask1, a1b1));\n    b = v_uint8x64(_mm512_permutex2var_epi64(a0b0, mask2, a1b1));\n#endif\n}\n\ninline void v_load_deinterleave( const ushort* ptr, v_uint16x32& a, v_uint16x32& b )\n{\n    __m512i ab0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i ab1 = _mm512_loadu_si512((const __m512i*)(ptr + 32));\n    __m512i mask0 = _v512_set_epu16(62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32,\n                                    30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10,  8,  6,  4,  2,  0);\n    __m512i mask1 = _v512_set_epu16(63, 61, 59, 57, 55, 53, 51, 49, 47, 45, 43, 41, 39, 37, 35, 33,\n                                    31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11,  9,  7,  5,  3,  1);\n    a = v_uint16x32(_mm512_permutex2var_epi16(ab0, mask0, ab1));\n    b = v_uint16x32(_mm512_permutex2var_epi16(ab0, mask1, ab1));\n}\n\ninline void v_load_deinterleave( const unsigned* ptr, v_uint32x16& a, v_uint32x16& b )\n{\n    __m512i ab0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i ab1 = _mm512_loadu_si512((const __m512i*)(ptr + 16));\n    __m512i mask0 = _v512_set_epu32(30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0);\n    __m512i mask1 = _v512_set_epu32(31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1);\n    a = v_uint32x16(_mm512_permutex2var_epi32(ab0, mask0, ab1));\n    b = v_uint32x16(_mm512_permutex2var_epi32(ab0, mask1, ab1));\n}\n\ninline void v_load_deinterleave( const uint64* ptr, v_uint64x8& a, v_uint64x8& b )\n{\n    __m512i ab0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i ab1 = _mm512_loadu_si512((const __m512i*)(ptr + 8));\n    __m512i mask0 = _v512_set_epu64(14, 12, 10, 8, 6, 4, 2, 0);\n    __m512i mask1 = _v512_set_epu64(15, 13, 11, 9, 7, 5, 3, 1);\n    a = v_uint64x8(_mm512_permutex2var_epi64(ab0, mask0, ab1));\n    b = v_uint64x8(_mm512_permutex2var_epi64(ab0, mask1, ab1));\n}\n\ninline void v_load_deinterleave( const uchar* ptr, v_uint8x64& a, v_uint8x64& b, v_uint8x64& c )\n{\n    __m512i bgr0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i bgr1 = _mm512_loadu_si512((const __m512i*)(ptr + 64));\n    __m512i bgr2 = _mm512_loadu_si512((const __m512i*)(ptr + 128));\n\n#if CV_AVX_512VBMI2\n    __m512i mask0 = _v512_set_epu8(126, 123, 120, 117, 114, 111, 108, 105, 102,  99,  96,  93,  90,  87,  84, 81,\n                                    78,  75,  72,  69,  66,  63,  60,  57,  54,  51,  48,  45,  42,  39,  36, 33,\n                                    30,  27,  24,  21,  18,  15,  12,   9,   6,   3,   0,  62,  59,  56,  53, 50,\n                                    47,  44,  41,  38,  35,  32,  29,  26,  23,  20,  17,  14,  11,   8,   5,  2);\n    __m512i r0b01 = _mm512_permutex2var_epi8(bgr0, mask0, bgr1);\n    __m512i b1g12 = _mm512_permutex2var_epi8(bgr1, mask0, bgr2);\n    __m512i r12b2 = _mm512_permutex2var_epi8(bgr1,\n                    _v512_set_epu8(125, 122, 119, 116, 113, 110, 107, 104, 101,  98,  95,  92,  89,  86,  83, 80,\n                                    77,  74,  71,  68,  65, 127, 124, 121, 118, 115, 112, 109, 106, 103, 100, 97,\n                                    94,  91,  88,  85,  82,  79,  76,  73,  70,  67,  64,  61,  58,  55,  52, 49,\n                                    46,  43,  40,  37,  34,  31,  28,  25,  22,  19,  16,  13,  10,   7,   4,  1), bgr2);\n    a = v_uint8x64(_mm512_mask_compress_epi8(r12b2, 0xffffffffffe00000, r0b01));\n    b = v_uint8x64(_mm512_mask_compress_epi8(b1g12, 0x2492492492492492, bgr0));\n    c = v_uint8x64(_mm512_mask_expand_epi8(r0b01, 0xffffffffffe00000, r12b2));\n#elif CV_AVX_512VBMI\n    __m512i b0g0b1 = _mm512_mask_blend_epi8(0xb6db6db6db6db6db, bgr1, bgr0);\n    __m512i g1r1g2 = _mm512_mask_blend_epi8(0xb6db6db6db6db6db, bgr2, bgr1);\n    __m512i r2b2r0 = _mm512_mask_blend_epi8(0xb6db6db6db6db6db, bgr0, bgr2);\n    a = v_uint8x64(_mm512_permutex2var_epi8(b0g0b1, _v512_set_epu8(125, 122, 119, 116, 113, 110, 107, 104, 101,  98,  95,  92,  89,  86,  83,  80,\n                                                                    77,  74,  71,  68,  65,  63,  61,  60,  58,  57,  55,  54,  52,  51,  49,  48,\n                                                                    46,  45,  43,  42,  40,  39,  37,  36,  34,  33,  31,  30,  28,  27,  25,  24,\n                                                                    23,  21,  20,  18,  17,  15,  14,  12,  11,   9,   8,   6,   5,   3,   2,   0), bgr2));\n    b = v_uint8x64(_mm512_permutex2var_epi8(g1r1g2, _v512_set_epu8( 63,  61,  60,  58,  57,  55,  54,  52,  51,  49,  48,  46,  45,  43,  42,  40,\n                                                                    39,  37,  36,  34,  33,  31,  30,  28,  27,  25,  24,  23,  21,  20,  18,  17,\n                                                                    15,  14,  12,  11,   9,   8,   6,   5,   3,   2,   0, 126, 123, 120, 117, 114,\n                                                                   111, 108, 105, 102,  99,  96,  93,  90,  87,  84,  81,  78,  75,  72,  69,  66), bgr0));\n    c = v_uint8x64(_mm512_permutex2var_epi8(r2b2r0, _v512_set_epu8( 63,  60,  57,  54,  51,  48,  45,  42,  39,  36,  33,  30,  27,  24,  21,  18,\n                                                                    15,  12,   9,   6,   3,   0, 125, 122, 119, 116, 113, 110, 107, 104, 101,  98,\n                                                                    95,  92,  89,  86,  83,  80,  77,  74,  71,  68,  65,  62,  59,  56,  53,  50,\n                                                                    47,  44,  41,  38,  35,  32,  29,  26,  23,  20,  17,  14,  11,   8,   5,   2), bgr1));\n#else\n    __m512i mask0 = _v512_set_epu16(61, 58, 55, 52, 49, 46, 43, 40, 37, 34, 63, 60, 57, 54, 51, 48,\n                                    45, 42, 39, 36, 33, 30, 27, 24, 21, 18, 15, 12,  9,  6,  3,  0);\n    __m512i b01g1 = _mm512_permutex2var_epi16(bgr0, mask0, bgr1);\n    __m512i r12b2 = _mm512_permutex2var_epi16(bgr1, mask0, bgr2);\n    __m512i g20r0 = _mm512_permutex2var_epi16(bgr2, mask0, bgr0);\n\n    __m512i b0g0 = _mm512_mask_blend_epi32(0xf800, b01g1, r12b2);\n    __m512i r0b1 = _mm512_permutex2var_epi16(bgr1, _v512_set_epu16(42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 29, 26, 23, 20, 17,\n                                                                   14, 11,  8,  5,  2, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43), g20r0);\n    __m512i g1r1 = _mm512_alignr_epi32(r12b2, g20r0, 11);\n    a = v_uint8x64(_mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, b0g0, r0b1));\n    c = v_uint8x64(_mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, r0b1, g1r1));\n    b = v_uint8x64(_mm512_shuffle_epi8(_mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, g1r1, b0g0), _mm512_set4_epi32(0x0e0f0c0d, 0x0a0b0809, 0x06070405, 0x02030001)));\n#endif\n}\n\ninline void v_load_deinterleave( const ushort* ptr, v_uint16x32& a, v_uint16x32& b, v_uint16x32& c )\n{\n    __m512i bgr0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i bgr1 = _mm512_loadu_si512((const __m512i*)(ptr + 32));\n    __m512i bgr2 = _mm512_loadu_si512((const __m512i*)(ptr + 64));\n\n    __m512i mask0 = _v512_set_epu16(61, 58, 55, 52, 49, 46, 43, 40, 37, 34, 63, 60, 57, 54, 51, 48,\n                                    45, 42, 39, 36, 33, 30, 27, 24, 21, 18, 15, 12,  9,  6,  3,  0);\n    __m512i b01g1 = _mm512_permutex2var_epi16(bgr0, mask0, bgr1);\n    __m512i r12b2 = _mm512_permutex2var_epi16(bgr1, mask0, bgr2);\n    __m512i g20r0 = _mm512_permutex2var_epi16(bgr2, mask0, bgr0);\n\n    a = v_uint16x32(_mm512_mask_blend_epi32(0xf800, b01g1, r12b2));\n    b = v_uint16x32(_mm512_permutex2var_epi16(bgr1, _v512_set_epu16(42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 29, 26, 23, 20, 17,\n                                                                    14, 11,  8,  5,  2, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43), g20r0));\n    c = v_uint16x32(_mm512_alignr_epi32(r12b2, g20r0, 11));\n}\n\ninline void v_load_deinterleave( const unsigned* ptr, v_uint32x16& a, v_uint32x16& b, v_uint32x16& c )\n{\n    __m512i bgr0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i bgr1 = _mm512_loadu_si512((const __m512i*)(ptr + 16));\n    __m512i bgr2 = _mm512_loadu_si512((const __m512i*)(ptr + 32));\n\n    __m512i mask0 = _v512_set_epu32(29, 26, 23, 20, 17, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3, 0);\n    __m512i b01r1 = _mm512_permutex2var_epi32(bgr0, mask0, bgr1);\n    __m512i g12b2 = _mm512_permutex2var_epi32(bgr1, mask0, bgr2);\n    __m512i r20g0 = _mm512_permutex2var_epi32(bgr2, mask0, bgr0);\n\n    a = v_uint32x16(_mm512_mask_blend_epi32(0xf800, b01r1, g12b2));\n    b = v_uint32x16(_mm512_alignr_epi32(g12b2, r20g0, 11));\n    c = v_uint32x16(_mm512_permutex2var_epi32(bgr1, _v512_set_epu32(21, 20, 19, 18, 17, 16, 13, 10, 7, 4, 1, 26, 25, 24, 23, 22), r20g0));\n}\n\ninline void v_load_deinterleave( const uint64* ptr, v_uint64x8& a, v_uint64x8& b, v_uint64x8& c )\n{\n    __m512i bgr0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i bgr1 = _mm512_loadu_si512((const __m512i*)(ptr + 8));\n    __m512i bgr2 = _mm512_loadu_si512((const __m512i*)(ptr + 16));\n\n    __m512i mask0 = _v512_set_epu64(13, 10, 15, 12, 9, 6, 3, 0);\n    __m512i b01g1 = _mm512_permutex2var_epi64(bgr0, mask0, bgr1);\n    __m512i r12b2 = _mm512_permutex2var_epi64(bgr1, mask0, bgr2);\n    __m512i g20r0 = _mm512_permutex2var_epi64(bgr2, mask0, bgr0);\n\n    a = v_uint64x8(_mm512_mask_blend_epi64(0xc0, b01g1, r12b2));\n    c = v_uint64x8(_mm512_alignr_epi64(r12b2, g20r0, 6));\n    b = v_uint64x8(_mm512_permutex2var_epi64(bgr1, _v512_set_epu64(10, 9, 8, 5, 2, 13, 12, 11), g20r0));\n}\n\ninline void v_load_deinterleave( const uchar* ptr, v_uint8x64& a, v_uint8x64& b, v_uint8x64& c, v_uint8x64& d )\n{\n    __m512i bgra0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i bgra1 = _mm512_loadu_si512((const __m512i*)(ptr + 64));\n    __m512i bgra2 = _mm512_loadu_si512((const __m512i*)(ptr + 128));\n    __m512i bgra3 = _mm512_loadu_si512((const __m512i*)(ptr + 192));\n\n#if CV_AVX_512VBMI\n    __m512i mask0 = _v512_set_epu8(126, 124, 122, 120, 118, 116, 114, 112, 110, 108, 106, 104, 102, 100, 98, 96,\n                                    94,  92,  90,  88,  86,  84,  82,  80,  78,  76,  74,  72,  70,  68, 66, 64,\n                                    62,  60,  58,  56,  54,  52,  50,  48,  46,  44,  42,  40,  38,  36, 34, 32,\n                                    30,  28,  26,  24,  22,  20,  18,  16,  14,  12,  10,   8,   6,   4,  2,  0);\n    __m512i mask1 = _v512_set_epu8(127, 125, 123, 121, 119, 117, 115, 113, 111, 109, 107, 105, 103, 101, 99, 97,\n                                    95,  93,  91,  89,  87,  85,  83,  81,  79,  77,  75,  73,  71,  69, 67, 65,\n                                    63,  61,  59,  57,  55,  53,  51,  49,  47,  45,  43,  41,  39,  37, 35, 33,\n                                    31,  29,  27,  25,  23,  21,  19,  17,  15,  13,  11,   9,   7,   5,  3,  1);\n\n    __m512i br01 = _mm512_permutex2var_epi8(bgra0, mask0, bgra1);\n    __m512i ga01 = _mm512_permutex2var_epi8(bgra0, mask1, bgra1);\n    __m512i br23 = _mm512_permutex2var_epi8(bgra2, mask0, bgra3);\n    __m512i ga23 = _mm512_permutex2var_epi8(bgra2, mask1, bgra3);\n\n    a = v_uint8x64(_mm512_permutex2var_epi8(br01, mask0, br23));\n    c = v_uint8x64(_mm512_permutex2var_epi8(br01, mask1, br23));\n    b = v_uint8x64(_mm512_permutex2var_epi8(ga01, mask0, ga23));\n    d = v_uint8x64(_mm512_permutex2var_epi8(ga01, mask1, ga23));\n#else\n    __m512i mask = _mm512_set4_epi32(0x0f0b0703, 0x0e0a0602, 0x0d090501, 0x0c080400);\n    __m512i b0g0r0a0 = _mm512_shuffle_epi8(bgra0, mask);\n    __m512i b1g1r1a1 = _mm512_shuffle_epi8(bgra1, mask);\n    __m512i b2g2r2a2 = _mm512_shuffle_epi8(bgra2, mask);\n    __m512i b3g3r3a3 = _mm512_shuffle_epi8(bgra3, mask);\n\n    __m512i mask0 = _v512_set_epu32(30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0);\n    __m512i mask1 = _v512_set_epu32(31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1);\n\n    __m512i br01 = _mm512_permutex2var_epi32(b0g0r0a0, mask0, b1g1r1a1);\n    __m512i ga01 = _mm512_permutex2var_epi32(b0g0r0a0, mask1, b1g1r1a1);\n    __m512i br23 = _mm512_permutex2var_epi32(b2g2r2a2, mask0, b3g3r3a3);\n    __m512i ga23 = _mm512_permutex2var_epi32(b2g2r2a2, mask1, b3g3r3a3);\n\n    a = v_uint8x64(_mm512_permutex2var_epi32(br01, mask0, br23));\n    c = v_uint8x64(_mm512_permutex2var_epi32(br01, mask1, br23));\n    b = v_uint8x64(_mm512_permutex2var_epi32(ga01, mask0, ga23));\n    d = v_uint8x64(_mm512_permutex2var_epi32(ga01, mask1, ga23));\n#endif\n}\n\ninline void v_load_deinterleave( const ushort* ptr, v_uint16x32& a, v_uint16x32& b, v_uint16x32& c, v_uint16x32& d )\n{\n    __m512i bgra0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i bgra1 = _mm512_loadu_si512((const __m512i*)(ptr + 32));\n    __m512i bgra2 = _mm512_loadu_si512((const __m512i*)(ptr + 64));\n    __m512i bgra3 = _mm512_loadu_si512((const __m512i*)(ptr + 96));\n\n    __m512i mask0 = _v512_set_epu16(62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32,\n                                    30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10,  8,  6,  4,  2,  0);\n    __m512i mask1 = _v512_set_epu16(63, 61, 59, 57, 55, 53, 51, 49, 47, 45, 43, 41, 39, 37, 35, 33,\n                                    31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11,  9,  7,  5,  3,  1);\n\n    __m512i br01 = _mm512_permutex2var_epi16(bgra0, mask0, bgra1);\n    __m512i ga01 = _mm512_permutex2var_epi16(bgra0, mask1, bgra1);\n    __m512i br23 = _mm512_permutex2var_epi16(bgra2, mask0, bgra3);\n    __m512i ga23 = _mm512_permutex2var_epi16(bgra2, mask1, bgra3);\n\n    a = v_uint16x32(_mm512_permutex2var_epi16(br01, mask0, br23));\n    c = v_uint16x32(_mm512_permutex2var_epi16(br01, mask1, br23));\n    b = v_uint16x32(_mm512_permutex2var_epi16(ga01, mask0, ga23));\n    d = v_uint16x32(_mm512_permutex2var_epi16(ga01, mask1, ga23));\n}\n\ninline void v_load_deinterleave( const unsigned* ptr, v_uint32x16& a, v_uint32x16& b, v_uint32x16& c, v_uint32x16& d )\n{\n    __m512i bgra0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i bgra1 = _mm512_loadu_si512((const __m512i*)(ptr + 16));\n    __m512i bgra2 = _mm512_loadu_si512((const __m512i*)(ptr + 32));\n    __m512i bgra3 = _mm512_loadu_si512((const __m512i*)(ptr + 48));\n\n    __m512i mask0 = _v512_set_epu32(30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0);\n    __m512i mask1 = _v512_set_epu32(31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1);\n\n    __m512i br01 = _mm512_permutex2var_epi32(bgra0, mask0, bgra1);\n    __m512i ga01 = _mm512_permutex2var_epi32(bgra0, mask1, bgra1);\n    __m512i br23 = _mm512_permutex2var_epi32(bgra2, mask0, bgra3);\n    __m512i ga23 = _mm512_permutex2var_epi32(bgra2, mask1, bgra3);\n\n    a = v_uint32x16(_mm512_permutex2var_epi32(br01, mask0, br23));\n    c = v_uint32x16(_mm512_permutex2var_epi32(br01, mask1, br23));\n    b = v_uint32x16(_mm512_permutex2var_epi32(ga01, mask0, ga23));\n    d = v_uint32x16(_mm512_permutex2var_epi32(ga01, mask1, ga23));\n}\n\ninline void v_load_deinterleave( const uint64* ptr, v_uint64x8& a, v_uint64x8& b, v_uint64x8& c, v_uint64x8& d )\n{\n    __m512i bgra0 = _mm512_loadu_si512((const __m512i*)ptr);\n    __m512i bgra1 = _mm512_loadu_si512((const __m512i*)(ptr + 8));\n    __m512i bgra2 = _mm512_loadu_si512((const __m512i*)(ptr + 16));\n    __m512i bgra3 = _mm512_loadu_si512((const __m512i*)(ptr + 24));\n\n    __m512i mask0 = _v512_set_epu64(14, 12, 10, 8, 6, 4, 2, 0);\n    __m512i mask1 = _v512_set_epu64(15, 13, 11, 9, 7, 5, 3, 1);\n\n    __m512i br01 = _mm512_permutex2var_epi64(bgra0, mask0, bgra1);\n    __m512i ga01 = _mm512_permutex2var_epi64(bgra0, mask1, bgra1);\n    __m512i br23 = _mm512_permutex2var_epi64(bgra2, mask0, bgra3);\n    __m512i ga23 = _mm512_permutex2var_epi64(bgra2, mask1, bgra3);\n\n    a = v_uint64x8(_mm512_permutex2var_epi64(br01, mask0, br23));\n    c = v_uint64x8(_mm512_permutex2var_epi64(br01, mask1, br23));\n    b = v_uint64x8(_mm512_permutex2var_epi64(ga01, mask0, ga23));\n    d = v_uint64x8(_mm512_permutex2var_epi64(ga01, mask1, ga23));\n}\n\n///////////////////////////// store interleave /////////////////////////////////////\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x64& x, const v_uint8x64& y,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    v_uint8x64 low, high;\n    v_zip(x, y, low, high);\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, low.val);\n        _mm512_stream_si512((__m512i*)(ptr + 64), high.val);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, low.val);\n        _mm512_store_si512((__m512i*)(ptr + 64), high.val);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, low.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 64), high.val);\n    }\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x32& x, const v_uint16x32& y,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    v_uint16x32 low, high;\n    v_zip(x, y, low, high);\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, low.val);\n        _mm512_stream_si512((__m512i*)(ptr + 32), high.val);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, low.val);\n        _mm512_store_si512((__m512i*)(ptr + 32), high.val);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, low.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 32), high.val);\n    }\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x16& x, const v_uint32x16& y,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    v_uint32x16 low, high;\n    v_zip(x, y, low, high);\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, low.val);\n        _mm512_stream_si512((__m512i*)(ptr + 16), high.val);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, low.val);\n        _mm512_store_si512((__m512i*)(ptr + 16), high.val);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, low.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 16), high.val);\n    }\n}\n\ninline void v_store_interleave( uint64* ptr, const v_uint64x8& x, const v_uint64x8& y,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    v_uint64x8 low, high;\n    v_zip(x, y, low, high);\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, low.val);\n        _mm512_stream_si512((__m512i*)(ptr + 8), high.val);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, low.val);\n        _mm512_store_si512((__m512i*)(ptr + 8), high.val);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, low.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 8), high.val);\n    }\n}\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x64& a, const v_uint8x64& b, const v_uint8x64& c,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n#if CV_AVX_512VBMI\n    __m512i mask0 = _v512_set_epu8(127,  84,  20, 126,  83,  19, 125,  82,  18, 124,  81,  17, 123,  80,  16, 122,\n                                    79,  15, 121,  78,  14, 120,  77,  13, 119,  76,  12, 118,  75,  11, 117,  74,\n                                    10, 116,  73,   9, 115,  72,   8, 114,  71,   7, 113,  70,   6, 112,  69,   5,\n                                   111,  68,   4, 110,  67,   3, 109,  66,   2, 108,  65,   1, 107,  64,   0, 106);\n    __m512i mask1 = _v512_set_epu8( 21,  42, 105,  20,  41, 104,  19,  40, 103,  18,  39, 102,  17,  38, 101,  16,\n                                    37, 100,  15,  36,  99,  14,  35,  98,  13,  34,  97,  12,  33,  96,  11,  32,\n                                    95,  10,  31,  94,   9,  30,  93,   8,  29,  92,   7,  28,  91,   6,  27,  90,\n                                     5,  26,  89,   4,  25,  88,   3,  24,  87,   2,  23,  86,   1,  22,  85,   0);\n    __m512i mask2 = _v512_set_epu8(106, 127,  63, 105, 126,  62, 104, 125,  61, 103, 124,  60, 102, 123,  59, 101,\n                                   122,  58, 100, 121,  57,  99, 120,  56,  98, 119,  55,  97, 118,  54,  96, 117,\n                                    53,  95, 116,  52,  94, 115,  51,  93, 114,  50,  92, 113,  49,  91, 112,  48,\n                                    90, 111,  47,  89, 110,  46,  88, 109,  45,  87, 108,  44,  86, 107,  43,  85);\n    __m512i r2g0r0 = _mm512_permutex2var_epi8(b.val, mask0, c.val);\n    __m512i b0r1b1 = _mm512_permutex2var_epi8(a.val, mask1, c.val);\n    __m512i g1b2g2 = _mm512_permutex2var_epi8(a.val, mask2, b.val);\n\n    __m512i bgr0 = _mm512_mask_blend_epi8(0x9249249249249249, r2g0r0, b0r1b1);\n    __m512i bgr1 = _mm512_mask_blend_epi8(0x9249249249249249, b0r1b1, g1b2g2);\n    __m512i bgr2 = _mm512_mask_blend_epi8(0x9249249249249249, g1b2g2, r2g0r0);\n#else\n    __m512i g1g0 = _mm512_shuffle_epi8(b.val, _mm512_set4_epi32(0x0e0f0c0d, 0x0a0b0809, 0x06070405, 0x02030001));\n    __m512i b0g0 = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, a.val, g1g0);\n    __m512i r0b1 = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, c.val, a.val);\n    __m512i g1r1 = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, g1g0, c.val);\n\n    __m512i mask0 = _v512_set_epu16(42, 10, 31, 41,  9, 30, 40,  8, 29, 39,  7, 28, 38,  6, 27, 37,\n                                     5, 26, 36,  4, 25, 35,  3, 24, 34,  2, 23, 33,  1, 22, 32,  0);\n    __m512i mask1 = _v512_set_epu16(21, 52, 41, 20, 51, 40, 19, 50, 39, 18, 49, 38, 17, 48, 37, 16,\n                                    47, 36, 15, 46, 35, 14, 45, 34, 13, 44, 33, 12, 43, 32, 11, 42);\n    __m512i mask2 = _v512_set_epu16(63, 31, 20, 62, 30, 19, 61, 29, 18, 60, 28, 17, 59, 27, 16, 58,\n                                    26, 15, 57, 25, 14, 56, 24, 13, 55, 23, 12, 54, 22, 11, 53, 21);\n    __m512i b0g0b2 = _mm512_permutex2var_epi16(b0g0, mask0, r0b1);\n    __m512i r1b1r0 = _mm512_permutex2var_epi16(b0g0, mask1, g1r1);\n    __m512i g2r2g1 = _mm512_permutex2var_epi16(r0b1, mask2, g1r1);\n\n    __m512i bgr0 = _mm512_mask_blend_epi16(0x24924924, b0g0b2, r1b1r0);\n    __m512i bgr1 = _mm512_mask_blend_epi16(0x24924924, r1b1r0, g2r2g1);\n    __m512i bgr2 = _mm512_mask_blend_epi16(0x24924924, g2r2g1, b0g0b2);\n#endif\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, bgr0);\n        _mm512_stream_si512((__m512i*)(ptr + 64), bgr1);\n        _mm512_stream_si512((__m512i*)(ptr + 128), bgr2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, bgr0);\n        _mm512_store_si512((__m512i*)(ptr + 64), bgr1);\n        _mm512_store_si512((__m512i*)(ptr + 128), bgr2);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, bgr0);\n        _mm512_storeu_si512((__m512i*)(ptr + 64), bgr1);\n        _mm512_storeu_si512((__m512i*)(ptr + 128), bgr2);\n    }\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x32& a, const v_uint16x32& b, const v_uint16x32& c,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m512i mask0 = _v512_set_epu16(42, 10, 31, 41,  9, 30, 40,  8, 29, 39,  7, 28, 38,  6, 27, 37,\n                                     5, 26, 36,  4, 25, 35,  3, 24, 34,  2, 23, 33,  1, 22, 32,  0);\n    __m512i mask1 = _v512_set_epu16(21, 52, 41, 20, 51, 40, 19, 50, 39, 18, 49, 38, 17, 48, 37, 16,\n                                    47, 36, 15, 46, 35, 14, 45, 34, 13, 44, 33, 12, 43, 32, 11, 42);\n    __m512i mask2 = _v512_set_epu16(63, 31, 20, 62, 30, 19, 61, 29, 18, 60, 28, 17, 59, 27, 16, 58,\n                                    26, 15, 57, 25, 14, 56, 24, 13, 55, 23, 12, 54, 22, 11, 53, 21);\n    __m512i b0g0b2 = _mm512_permutex2var_epi16(a.val, mask0, b.val);\n    __m512i r1b1r0 = _mm512_permutex2var_epi16(a.val, mask1, c.val);\n    __m512i g2r2g1 = _mm512_permutex2var_epi16(b.val, mask2, c.val);\n\n    __m512i bgr0 = _mm512_mask_blend_epi16(0x24924924, b0g0b2, r1b1r0);\n    __m512i bgr1 = _mm512_mask_blend_epi16(0x24924924, r1b1r0, g2r2g1);\n    __m512i bgr2 = _mm512_mask_blend_epi16(0x24924924, g2r2g1, b0g0b2);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, bgr0);\n        _mm512_stream_si512((__m512i*)(ptr + 32), bgr1);\n        _mm512_stream_si512((__m512i*)(ptr + 64), bgr2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, bgr0);\n        _mm512_store_si512((__m512i*)(ptr + 32), bgr1);\n        _mm512_store_si512((__m512i*)(ptr + 64), bgr2);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, bgr0);\n        _mm512_storeu_si512((__m512i*)(ptr + 32), bgr1);\n        _mm512_storeu_si512((__m512i*)(ptr + 64), bgr2);\n    }\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x16& a, const v_uint32x16& b, const v_uint32x16& c,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m512i mask0 = _v512_set_epu32(26, 31, 15, 25, 30, 14, 24, 29, 13, 23, 28, 12, 22, 27, 11, 21);\n    __m512i mask1 = _v512_set_epu32(31, 10, 25, 30,  9, 24, 29,  8, 23, 28,  7, 22, 27,  6, 21, 26);\n    __m512i g1b2g2 = _mm512_permutex2var_epi32(a.val, mask0, b.val);\n    __m512i r2r1b1 = _mm512_permutex2var_epi32(a.val, mask1, c.val);\n\n    __m512i bgr0 = _mm512_mask_expand_epi32(_mm512_mask_expand_epi32(_mm512_maskz_expand_epi32(0x9249, a.val), 0x2492, b.val), 0x4924, c.val);\n    __m512i bgr1 = _mm512_mask_blend_epi32(0x9249, r2r1b1, g1b2g2);\n    __m512i bgr2 = _mm512_mask_blend_epi32(0x9249, g1b2g2, r2r1b1);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, bgr0);\n        _mm512_stream_si512((__m512i*)(ptr + 16), bgr1);\n        _mm512_stream_si512((__m512i*)(ptr + 32), bgr2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, bgr0);\n        _mm512_store_si512((__m512i*)(ptr + 16), bgr1);\n        _mm512_store_si512((__m512i*)(ptr + 32), bgr2);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, bgr0);\n        _mm512_storeu_si512((__m512i*)(ptr + 16), bgr1);\n        _mm512_storeu_si512((__m512i*)(ptr + 32), bgr2);\n    }\n}\n\ninline void v_store_interleave( uint64* ptr, const v_uint64x8& a, const v_uint64x8& b, const v_uint64x8& c,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    __m512i mask0 = _v512_set_epu64( 5, 12,  7,  4, 11,  6,  3, 10);\n    __m512i mask1 = _v512_set_epu64(15,  7,  4, 14,  6,  3, 13,  5);\n    __m512i r1b1b2 = _mm512_permutex2var_epi64(a.val, mask0, c.val);\n    __m512i g2r2g1 = _mm512_permutex2var_epi64(b.val, mask1, c.val);\n\n    __m512i bgr0 = _mm512_mask_expand_epi64(_mm512_mask_expand_epi64(_mm512_maskz_expand_epi64(0x49, a.val), 0x92, b.val), 0x24, c.val);\n    __m512i bgr1 = _mm512_mask_blend_epi64(0xdb, g2r2g1, r1b1b2);\n    __m512i bgr2 = _mm512_mask_blend_epi64(0xdb, r1b1b2, g2r2g1);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, bgr0);\n        _mm512_stream_si512((__m512i*)(ptr + 8), bgr1);\n        _mm512_stream_si512((__m512i*)(ptr + 16), bgr2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, bgr0);\n        _mm512_store_si512((__m512i*)(ptr + 8), bgr1);\n        _mm512_store_si512((__m512i*)(ptr + 16), bgr2);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, bgr0);\n        _mm512_storeu_si512((__m512i*)(ptr + 8), bgr1);\n        _mm512_storeu_si512((__m512i*)(ptr + 16), bgr2);\n    }\n}\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x64& a, const v_uint8x64& b,\n                                const v_uint8x64& c, const v_uint8x64& d,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    v_uint8x64 br01, br23, ga01, ga23;\n    v_zip(a, c, br01, br23);\n    v_zip(b, d, ga01, ga23);\n    v_uint8x64 bgra0, bgra1, bgra2, bgra3;\n    v_zip(br01, ga01, bgra0, bgra1);\n    v_zip(br23, ga23, bgra2, bgra3);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, bgra0.val);\n        _mm512_stream_si512((__m512i*)(ptr + 64), bgra1.val);\n        _mm512_stream_si512((__m512i*)(ptr + 128), bgra2.val);\n        _mm512_stream_si512((__m512i*)(ptr + 192), bgra3.val);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, bgra0.val);\n        _mm512_store_si512((__m512i*)(ptr + 64), bgra1.val);\n        _mm512_store_si512((__m512i*)(ptr + 128), bgra2.val);\n        _mm512_store_si512((__m512i*)(ptr + 192), bgra3.val);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, bgra0.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 64), bgra1.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 128), bgra2.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 192), bgra3.val);\n    }\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x32& a, const v_uint16x32& b,\n                                const v_uint16x32& c, const v_uint16x32& d,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    v_uint16x32 br01, br23, ga01, ga23;\n    v_zip(a, c, br01, br23);\n    v_zip(b, d, ga01, ga23);\n    v_uint16x32 bgra0, bgra1, bgra2, bgra3;\n    v_zip(br01, ga01, bgra0, bgra1);\n    v_zip(br23, ga23, bgra2, bgra3);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, bgra0.val);\n        _mm512_stream_si512((__m512i*)(ptr + 32), bgra1.val);\n        _mm512_stream_si512((__m512i*)(ptr + 64), bgra2.val);\n        _mm512_stream_si512((__m512i*)(ptr + 96), bgra3.val);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, bgra0.val);\n        _mm512_store_si512((__m512i*)(ptr + 32), bgra1.val);\n        _mm512_store_si512((__m512i*)(ptr + 64), bgra2.val);\n        _mm512_store_si512((__m512i*)(ptr + 96), bgra3.val);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, bgra0.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 32), bgra1.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 64), bgra2.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 96), bgra3.val);\n    }\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x16& a, const v_uint32x16& b,\n                                const v_uint32x16& c, const v_uint32x16& d,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    v_uint32x16 br01, br23, ga01, ga23;\n    v_zip(a, c, br01, br23);\n    v_zip(b, d, ga01, ga23);\n    v_uint32x16 bgra0, bgra1, bgra2, bgra3;\n    v_zip(br01, ga01, bgra0, bgra1);\n    v_zip(br23, ga23, bgra2, bgra3);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, bgra0.val);\n        _mm512_stream_si512((__m512i*)(ptr + 16), bgra1.val);\n        _mm512_stream_si512((__m512i*)(ptr + 32), bgra2.val);\n        _mm512_stream_si512((__m512i*)(ptr + 48), bgra3.val);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, bgra0.val);\n        _mm512_store_si512((__m512i*)(ptr + 16), bgra1.val);\n        _mm512_store_si512((__m512i*)(ptr + 32), bgra2.val);\n        _mm512_store_si512((__m512i*)(ptr + 48), bgra3.val);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, bgra0.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 16), bgra1.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 32), bgra2.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 48), bgra3.val);\n    }\n}\n\ninline void v_store_interleave( uint64* ptr, const v_uint64x8& a, const v_uint64x8& b,\n                                const v_uint64x8& c, const v_uint64x8& d,\n                                hal::StoreMode mode=hal::STORE_UNALIGNED )\n{\n    v_uint64x8 br01, br23, ga01, ga23;\n    v_zip(a, c, br01, br23);\n    v_zip(b, d, ga01, ga23);\n    v_uint64x8 bgra0, bgra1, bgra2, bgra3;\n    v_zip(br01, ga01, bgra0, bgra1);\n    v_zip(br23, ga23, bgra2, bgra3);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm512_stream_si512((__m512i*)ptr, bgra0.val);\n        _mm512_stream_si512((__m512i*)(ptr + 8), bgra1.val);\n        _mm512_stream_si512((__m512i*)(ptr + 16), bgra2.val);\n        _mm512_stream_si512((__m512i*)(ptr + 24), bgra3.val);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm512_store_si512((__m512i*)ptr, bgra0.val);\n        _mm512_store_si512((__m512i*)(ptr + 8), bgra1.val);\n        _mm512_store_si512((__m512i*)(ptr + 16), bgra2.val);\n        _mm512_store_si512((__m512i*)(ptr + 24), bgra3.val);\n    }\n    else\n    {\n        _mm512_storeu_si512((__m512i*)ptr, bgra0.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 8), bgra1.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 16), bgra2.val);\n        _mm512_storeu_si512((__m512i*)(ptr + 24), bgra3.val);\n    }\n}\n\n#define OPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(_Tpvec0, _Tp0, suffix0, _Tpvec1, _Tp1, suffix1) \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0 ) \\\n{ \\\n    _Tpvec1 a1, b1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n} \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0 ) \\\n{ \\\n    _Tpvec1 a1, b1, c1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n    c0 = v_reinterpret_as_##suffix0(c1); \\\n} \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0, _Tpvec0& d0 ) \\\n{ \\\n    _Tpvec1 a1, b1, c1, d1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1, d1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n    c0 = v_reinterpret_as_##suffix0(c1); \\\n    d0 = v_reinterpret_as_##suffix0(d1); \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                hal::StoreMode mode=hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, mode);      \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, const _Tpvec0& c0, \\\n                                hal::StoreMode mode=hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, c1, mode);  \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                const _Tpvec0& c0, const _Tpvec0& d0, \\\n                                hal::StoreMode mode=hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \\\n    _Tpvec1 d1 = v_reinterpret_as_##suffix1(d0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, c1, d1, mode); \\\n}\n\nOPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_int8x64, schar, s8, v_uint8x64, uchar, u8)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_int16x32, short, s16, v_uint16x32, ushort, u16)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_int32x16, int, s32, v_uint32x16, unsigned, u32)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_float32x16, float, f32, v_uint32x16, unsigned, u32)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_int64x8, int64, s64, v_uint64x8, uint64, u64)\nOPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_float64x8, double, f64, v_uint64x8, uint64, u64)\n\n////////// Mask and checks /////////\n\n/** Mask **/\ninline int64 v_signmask(const v_int8x64& a) { return (int64)_mm512_movepi8_mask(a.val); }\ninline int v_signmask(const v_int16x32& a) { return (int)_mm512_cmp_epi16_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); }\ninline int v_signmask(const v_int32x16& a) { return (int)_mm512_cmp_epi32_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); }\ninline int v_signmask(const v_int64x8& a) { return (int)_mm512_cmp_epi64_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); }\n\ninline int64 v_signmask(const v_uint8x64& a) { return v_signmask(v_reinterpret_as_s8(a)); }\ninline int v_signmask(const v_uint16x32& a) { return v_signmask(v_reinterpret_as_s16(a)); }\ninline int v_signmask(const v_uint32x16& a) { return v_signmask(v_reinterpret_as_s32(a)); }\ninline int v_signmask(const v_uint64x8& a) { return v_signmask(v_reinterpret_as_s64(a)); }\ninline int v_signmask(const v_float32x16& a) { return v_signmask(v_reinterpret_as_s32(a)); }\ninline int v_signmask(const v_float64x8& a) { return v_signmask(v_reinterpret_as_s64(a)); }\n\n/** Checks **/\ninline bool v_check_all(const v_int8x64& a) { return !(bool)_mm512_cmp_epi8_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_NLT); }\ninline bool v_check_any(const v_int8x64& a) { return (bool)_mm512_movepi8_mask(a.val); }\ninline bool v_check_all(const v_int16x32& a) { return !(bool)_mm512_cmp_epi16_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_NLT); }\ninline bool v_check_any(const v_int16x32& a) { return (bool)_mm512_cmp_epi16_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); }\ninline bool v_check_all(const v_int32x16& a) { return !(bool)_mm512_cmp_epi32_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_NLT); }\ninline bool v_check_any(const v_int32x16& a) { return (bool)_mm512_cmp_epi32_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); }\ninline bool v_check_all(const v_int64x8& a) { return !(bool)_mm512_cmp_epi64_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_NLT); }\ninline bool v_check_any(const v_int64x8& a) { return (bool)_mm512_cmp_epi64_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); }\n\ninline bool v_check_all(const v_float32x16& a) { return v_check_all(v_reinterpret_as_s32(a)); }\ninline bool v_check_any(const v_float32x16& a) { return v_check_any(v_reinterpret_as_s32(a)); }\ninline bool v_check_all(const v_float64x8& a) { return v_check_all(v_reinterpret_as_s64(a)); }\ninline bool v_check_any(const v_float64x8& a) { return v_check_any(v_reinterpret_as_s64(a)); }\ninline bool v_check_all(const v_uint8x64& a) { return v_check_all(v_reinterpret_as_s8(a)); }\ninline bool v_check_all(const v_uint16x32& a) { return v_check_all(v_reinterpret_as_s16(a)); }\ninline bool v_check_all(const v_uint32x16& a) { return v_check_all(v_reinterpret_as_s32(a)); }\ninline bool v_check_all(const v_uint64x8& a) { return v_check_all(v_reinterpret_as_s64(a)); }\ninline bool v_check_any(const v_uint8x64& a) { return v_check_any(v_reinterpret_as_s8(a)); }\ninline bool v_check_any(const v_uint16x32& a) { return v_check_any(v_reinterpret_as_s16(a)); }\ninline bool v_check_any(const v_uint32x16& a) { return v_check_any(v_reinterpret_as_s32(a)); }\ninline bool v_check_any(const v_uint64x8& a) { return v_check_any(v_reinterpret_as_s64(a)); }\n\ninline int v_scan_forward(const v_int8x64& a)\n{\n    int64 mask = _mm512_movepi8_mask(a.val);\n    int mask32 = (int)mask;\n    return mask != 0 ? mask32 != 0 ? trailingZeros32(mask32) : 32 + trailingZeros32((int)(mask >> 32)) : 0;\n}\ninline int v_scan_forward(const v_uint8x64& a) { return v_scan_forward(v_reinterpret_as_s8(a)); }\ninline int v_scan_forward(const v_int16x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))); }\ninline int v_scan_forward(const v_uint16x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))); }\ninline int v_scan_forward(const v_int32x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 2; }\ninline int v_scan_forward(const v_uint32x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 2; }\ninline int v_scan_forward(const v_float32x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 2; }\ninline int v_scan_forward(const v_int64x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 4; }\ninline int v_scan_forward(const v_uint64x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 4; }\ninline int v_scan_forward(const v_float64x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 4; }\n\ninline void v512_cleanup() { _mm256_zeroall(); }\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n} // cv::\n\n#endif // OPENCV_HAL_INTRIN_AVX_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_cpp.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_HAL_INTRIN_CPP_HPP\n#define OPENCV_HAL_INTRIN_CPP_HPP\n\n#include <limits>\n#include <cstring>\n#include <algorithm>\n#include \"opencv2/core/saturate.hpp\"\n\n//! @cond IGNORED\n#define CV_SIMD128_CPP 1\n#if defined(CV_FORCE_SIMD128_CPP)\n#define CV_SIMD128 1\n#define CV_SIMD128_64F 1\n#endif\n#if defined(CV_DOXYGEN)\n#define CV_SIMD128 1\n#define CV_SIMD128_64F 1\n#define CV_SIMD256 1\n#define CV_SIMD256_64F 1\n#define CV_SIMD512 1\n#define CV_SIMD512_64F 1\n#else\n#define CV_SIMD256 0 // Explicitly disable SIMD256 and SIMD512 support for scalar intrinsic implementation\n#define CV_SIMD512 0 // to avoid warnings during compilation\n#endif\n//! @endcond\n\nnamespace cv\n{\n\n#ifndef CV_DOXYGEN\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n#endif\n\n/** @addtogroup core_hal_intrin\n\n\"Universal intrinsics\" is a types and functions set intended to simplify vectorization of code on\ndifferent platforms. Currently a few different SIMD extensions on different architectures are supported.\n128 bit registers of various types support is implemented for a wide range of architectures\nincluding x86(__SSE/SSE2/SSE4.2__), ARM(__NEON__), PowerPC(__VSX__), MIPS(__MSA__).\n256 bit long registers are supported on x86(__AVX2__) and 512 bit long registers are supported on x86(__AVX512__).\nIn case when there is no SIMD extension available during compilation, fallback C++ implementation of intrinsics\nwill be chosen and code will work as expected although it could be slower.\n\n### Types\n\nThere are several types representing packed values vector registers, each type is\nimplemented as a structure based on a one SIMD register.\n\n- cv::v_uint8 and cv::v_int8: 8-bit integer values (unsigned/signed) - char\n- cv::v_uint16 and cv::v_int16: 16-bit integer values (unsigned/signed) - short\n- cv::v_uint32 and cv::v_int32: 32-bit integer values (unsigned/signed) - int\n- cv::v_uint64 and cv::v_int64: 64-bit integer values (unsigned/signed) - int64\n- cv::v_float32: 32-bit floating point values (signed) - float\n- cv::v_float64: 64-bit floating point values (signed) - double\n\nExact bit length(and value quantity) of listed types is compile time deduced and depends on architecture SIMD\ncapabilities chosen as available during compilation of the library. All the types contains __nlanes__ enumeration\nto check for exact value quantity of the type.\n\nIn case the exact bit length of the type is important it is possible to use specific fixed length register types.\n\nThere are several types representing 128-bit registers.\n\n- cv::v_uint8x16 and cv::v_int8x16: sixteen 8-bit integer values (unsigned/signed) - char\n- cv::v_uint16x8 and cv::v_int16x8: eight 16-bit integer values (unsigned/signed) - short\n- cv::v_uint32x4 and cv::v_int32x4: four 32-bit integer values (unsigned/signed) - int\n- cv::v_uint64x2 and cv::v_int64x2: two 64-bit integer values (unsigned/signed) - int64\n- cv::v_float32x4: four 32-bit floating point values (signed) - float\n- cv::v_float64x2: two 64-bit floating point values (signed) - double\n\nThere are several types representing 256-bit registers.\n\n- cv::v_uint8x32 and cv::v_int8x32: thirty two 8-bit integer values (unsigned/signed) - char\n- cv::v_uint16x16 and cv::v_int16x16: sixteen 16-bit integer values (unsigned/signed) - short\n- cv::v_uint32x8 and cv::v_int32x8: eight 32-bit integer values (unsigned/signed) - int\n- cv::v_uint64x4 and cv::v_int64x4: four 64-bit integer values (unsigned/signed) - int64\n- cv::v_float32x8: eight 32-bit floating point values (signed) - float\n- cv::v_float64x4: four 64-bit floating point values (signed) - double\n\n@note\n256 bit registers at the moment implemented for AVX2 SIMD extension only, if you want to use this type directly,\ndon't forget to check the CV_SIMD256 preprocessor definition:\n@code\n#if CV_SIMD256\n//...\n#endif\n@endcode\n\nThere are several types representing 512-bit registers.\n\n- cv::v_uint8x64 and cv::v_int8x64: sixty four 8-bit integer values (unsigned/signed) - char\n- cv::v_uint16x32 and cv::v_int16x32: thirty two 16-bit integer values (unsigned/signed) - short\n- cv::v_uint32x16 and cv::v_int32x16: sixteen 32-bit integer values (unsigned/signed) - int\n- cv::v_uint64x8 and cv::v_int64x8: eight 64-bit integer values (unsigned/signed) - int64\n- cv::v_float32x16: sixteen 32-bit floating point values (signed) - float\n- cv::v_float64x8: eight 64-bit floating point values (signed) - double\n@note\n512 bit registers at the moment implemented for AVX512 SIMD extension only, if you want to use this type directly,\ndon't forget to check the CV_SIMD512 preprocessor definition.\n\n@note\ncv::v_float64x2 is not implemented in NEON variant, if you want to use this type, don't forget to\ncheck the CV_SIMD128_64F preprocessor definition.\n\n### Load and store operations\n\nThese operations allow to set contents of the register explicitly or by loading it from some memory\nblock and to save contents of the register to memory block.\n\nThere are variable size register load operations that provide result of maximum available size\ndepending on chosen platform capabilities.\n- Constructors:\n@ref v_reg::v_reg(const _Tp *ptr) \"from memory\",\n- Other create methods:\nvx_setall_s8, vx_setall_u8, ...,\nvx_setzero_u8, vx_setzero_s8, ...\n- Memory load operations:\nvx_load, vx_load_aligned, vx_load_low, vx_load_halves,\n- Memory operations with expansion of values:\nvx_load_expand, vx_load_expand_q\n\nAlso there are fixed size register load/store operations.\n\nFor 128 bit registers\n- Constructors:\n@ref v_reg::v_reg(const _Tp *ptr) \"from memory\",\n@ref v_reg::v_reg(_Tp s0, _Tp s1) \"from two values\", ...\n- Other create methods:\n@ref v_setall_s8, @ref v_setall_u8, ...,\n@ref v_setzero_u8, @ref v_setzero_s8, ...\n- Memory load operations:\n@ref v_load, @ref v_load_aligned, @ref v_load_low, @ref v_load_halves,\n- Memory operations with expansion of values:\n@ref v_load_expand, @ref v_load_expand_q\n\nFor 256 bit registers(check CV_SIMD256 preprocessor definition)\n- Constructors:\n@ref v_reg::v_reg(const _Tp *ptr) \"from memory\",\n@ref v_reg::v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3) \"from four values\", ...\n- Other create methods:\n@ref v256_setall_s8, @ref v256_setall_u8, ...,\n@ref v256_setzero_u8, @ref v256_setzero_s8, ...\n- Memory load operations:\n@ref v256_load, @ref v256_load_aligned, @ref v256_load_low, @ref v256_load_halves,\n- Memory operations with expansion of values:\n@ref v256_load_expand, @ref v256_load_expand_q\n\nFor 512 bit registers(check CV_SIMD512 preprocessor definition)\n- Constructors:\n@ref v_reg::v_reg(const _Tp *ptr) \"from memory\",\n@ref v_reg::v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3, _Tp s4, _Tp s5, _Tp s6, _Tp s7) \"from eight values\", ...\n- Other create methods:\n@ref v512_setall_s8, @ref v512_setall_u8, ...,\n@ref v512_setzero_u8, @ref v512_setzero_s8, ...\n- Memory load operations:\n@ref v512_load, @ref v512_load_aligned, @ref v512_load_low, @ref v512_load_halves,\n- Memory operations with expansion of values:\n@ref v512_load_expand, @ref v512_load_expand_q\n\nStore to memory operations are similar across different platform capabilities:\n@ref v_store, @ref v_store_aligned,\n@ref v_store_high, @ref v_store_low\n\n### Value reordering\n\nThese operations allow to reorder or recombine elements in one or multiple vectors.\n\n- Interleave, deinterleave (2, 3 and 4 channels): @ref v_load_deinterleave, @ref v_store_interleave\n- Expand: @ref v_expand, @ref v_expand_low, @ref v_expand_high\n- Pack: @ref v_pack, @ref v_pack_u, @ref v_pack_b, @ref v_rshr_pack, @ref v_rshr_pack_u,\n@ref v_pack_store, @ref v_pack_u_store, @ref v_rshr_pack_store, @ref v_rshr_pack_u_store\n- Recombine: @ref v_zip, @ref v_recombine, @ref v_combine_low, @ref v_combine_high\n- Reverse: @ref v_reverse\n- Extract: @ref v_extract\n\n\n### Arithmetic, bitwise and comparison operations\n\nElement-wise binary and unary operations.\n\n- Arithmetics:\n@ref operator +(const v_reg &a, const v_reg &b) \"+\",\n@ref operator -(const v_reg &a, const v_reg &b) \"-\",\n@ref operator *(const v_reg &a, const v_reg &b) \"*\",\n@ref operator /(const v_reg &a, const v_reg &b) \"/\",\n@ref v_mul_expand\n\n- Non-saturating arithmetics: @ref v_add_wrap, @ref v_sub_wrap\n\n- Bitwise shifts:\n@ref operator <<(const v_reg &a, int s) \"<<\",\n@ref operator >>(const v_reg &a, int s) \">>\",\n@ref v_shl, @ref v_shr\n\n- Bitwise logic:\n@ref operator &(const v_reg &a, const v_reg &b) \"&\",\n@ref operator |(const v_reg &a, const v_reg &b) \"|\",\n@ref operator ^(const v_reg &a, const v_reg &b) \"^\",\n@ref operator ~(const v_reg &a) \"~\"\n\n- Comparison:\n@ref operator >(const v_reg &a, const v_reg &b) \">\",\n@ref operator >=(const v_reg &a, const v_reg &b) \">=\",\n@ref operator <(const v_reg &a, const v_reg &b) \"<\",\n@ref operator <=(const v_reg &a, const v_reg &b) \"<=\",\n@ref operator ==(const v_reg &a, const v_reg &b) \"==\",\n@ref operator !=(const v_reg &a, const v_reg &b) \"!=\"\n\n- min/max: @ref v_min, @ref v_max\n\n### Reduce and mask\n\nMost of these operations return only one value.\n\n- Reduce: @ref v_reduce_min, @ref v_reduce_max, @ref v_reduce_sum, @ref v_popcount\n- Mask: @ref v_signmask, @ref v_check_all, @ref v_check_any, @ref v_select\n\n### Other math\n\n- Some frequent operations: @ref v_sqrt, @ref v_invsqrt, @ref v_magnitude, @ref v_sqr_magnitude\n- Absolute values: @ref v_abs, @ref v_absdiff, @ref v_absdiffs\n\n### Conversions\n\nDifferent type conversions and casts:\n\n- Rounding: @ref v_round, @ref v_floor, @ref v_ceil, @ref v_trunc,\n- To float: @ref v_cvt_f32, @ref v_cvt_f64\n- Reinterpret: @ref v_reinterpret_as_u8, @ref v_reinterpret_as_s8, ...\n\n### Matrix operations\n\nIn these operations vectors represent matrix rows/columns: @ref v_dotprod, @ref v_dotprod_fast,\n@ref v_dotprod_expand, @ref v_dotprod_expand_fast, @ref v_matmul, @ref v_transpose4x4\n\n### Usability\n\nMost operations are implemented only for some subset of the available types, following matrices\nshows the applicability of different operations to the types.\n\nRegular integers:\n\n| Operations\\\\Types | uint 8 | int 8 | uint 16 | int 16 | uint 32 | int 32 |\n|-------------------|:-:|:-:|:-:|:-:|:-:|:-:|\n|load, store        | x | x | x | x | x | x |\n|interleave         | x | x | x | x | x | x |\n|expand             | x | x | x | x | x | x |\n|expand_low         | x | x | x | x | x | x |\n|expand_high        | x | x | x | x | x | x |\n|expand_q           | x | x |   |   |   |   |\n|add, sub           | x | x | x | x | x | x |\n|add_wrap, sub_wrap | x | x | x | x |   |   |\n|mul_wrap           | x | x | x | x |   |   |\n|mul                | x | x | x | x | x | x |\n|mul_expand         | x | x | x | x | x |   |\n|compare            | x | x | x | x | x | x |\n|shift              |   |   | x | x | x | x |\n|dotprod            |   |   |   | x |   | x |\n|dotprod_fast       |   |   |   | x |   | x |\n|dotprod_expand     | x | x | x | x |   | x |\n|dotprod_expand_fast| x | x | x | x |   | x |\n|logical            | x | x | x | x | x | x |\n|min, max           | x | x | x | x | x | x |\n|absdiff            | x | x | x | x | x | x |\n|absdiffs           |   | x |   | x |   |   |\n|reduce             | x | x | x | x | x | x |\n|mask               | x | x | x | x | x | x |\n|pack               | x | x | x | x | x | x |\n|pack_u             | x |   | x |   |   |   |\n|pack_b             | x |   |   |   |   |   |\n|unpack             | x | x | x | x | x | x |\n|extract            | x | x | x | x | x | x |\n|rotate (lanes)     | x | x | x | x | x | x |\n|cvt_flt32          |   |   |   |   |   | x |\n|cvt_flt64          |   |   |   |   |   | x |\n|transpose4x4       |   |   |   |   | x | x |\n|reverse            | x | x | x | x | x | x |\n|extract_n          | x | x | x | x | x | x |\n|broadcast_element  |   |   |   |   | x | x |\n\nBig integers:\n\n| Operations\\\\Types | uint 64 | int 64 |\n|-------------------|:-:|:-:|\n|load, store        | x | x |\n|add, sub           | x | x |\n|shift              | x | x |\n|logical            | x | x |\n|reverse            | x | x |\n|extract            | x | x |\n|rotate (lanes)     | x | x |\n|cvt_flt64          |   | x |\n|extract_n          | x | x |\n\nFloating point:\n\n| Operations\\\\Types | float 32 | float 64 |\n|-------------------|:-:|:-:|\n|load, store        | x | x |\n|interleave         | x |   |\n|add, sub           | x | x |\n|mul                | x | x |\n|div                | x | x |\n|compare            | x | x |\n|min, max           | x | x |\n|absdiff            | x | x |\n|reduce             | x |   |\n|mask               | x | x |\n|unpack             | x | x |\n|cvt_flt32          |   | x |\n|cvt_flt64          | x |   |\n|sqrt, abs          | x | x |\n|float math         | x | x |\n|transpose4x4       | x |   |\n|extract            | x | x |\n|rotate (lanes)     | x | x |\n|reverse            | x | x |\n|extract_n          | x | x |\n|broadcast_element  | x |   |\n\n @{ */\n\ntemplate<typename _Tp, int n> struct v_reg\n{\n//! @cond IGNORED\n    typedef _Tp lane_type;\n    enum { nlanes = n };\n// !@endcond\n\n    /** @brief Constructor\n\n    Initializes register with data from memory\n    @param ptr pointer to memory block with data for register */\n    explicit v_reg(const _Tp* ptr) { for( int i = 0; i < n; i++ ) s[i] = ptr[i]; }\n\n    /** @brief Constructor\n\n    Initializes register with two 64-bit values */\n    v_reg(_Tp s0, _Tp s1) { s[0] = s0; s[1] = s1; }\n\n    /** @brief Constructor\n\n    Initializes register with four 32-bit values */\n    v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3) { s[0] = s0; s[1] = s1; s[2] = s2; s[3] = s3; }\n\n    /** @brief Constructor\n\n    Initializes register with eight 16-bit values */\n    v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3,\n           _Tp s4, _Tp s5, _Tp s6, _Tp s7)\n    {\n        s[0] = s0; s[1] = s1; s[2] = s2; s[3] = s3;\n        s[4] = s4; s[5] = s5; s[6] = s6; s[7] = s7;\n    }\n\n    /** @brief Constructor\n\n    Initializes register with sixteen 8-bit values */\n    v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3,\n           _Tp s4, _Tp s5, _Tp s6, _Tp s7,\n           _Tp s8, _Tp s9, _Tp s10, _Tp s11,\n           _Tp s12, _Tp s13, _Tp s14, _Tp s15)\n    {\n        s[0] = s0; s[1] = s1; s[2] = s2; s[3] = s3;\n        s[4] = s4; s[5] = s5; s[6] = s6; s[7] = s7;\n        s[8] = s8; s[9] = s9; s[10] = s10; s[11] = s11;\n        s[12] = s12; s[13] = s13; s[14] = s14; s[15] = s15;\n    }\n\n    /** @brief Default constructor\n\n    Does not initialize anything*/\n    v_reg() {}\n\n    /** @brief Copy constructor */\n    v_reg(const v_reg<_Tp, n> & r)\n    {\n        for( int i = 0; i < n; i++ )\n            s[i] = r.s[i];\n    }\n    /** @brief Access first value\n\n    Returns value of the first lane according to register type, for example:\n    @code{.cpp}\n    v_int32x4 r(1, 2, 3, 4);\n    int v = r.get0(); // returns 1\n    v_uint64x2 r(1, 2);\n    uint64_t v = r.get0(); // returns 1\n    @endcode\n    */\n    _Tp get0() const { return s[0]; }\n\n//! @cond IGNORED\n    _Tp get(const int i) const { return s[i]; }\n    v_reg<_Tp, n> high() const\n    {\n        v_reg<_Tp, n> c;\n        int i;\n        for( i = 0; i < n/2; i++ )\n        {\n            c.s[i] = s[i+(n/2)];\n            c.s[i+(n/2)] = 0;\n        }\n        return c;\n    }\n\n    static v_reg<_Tp, n> zero()\n    {\n        v_reg<_Tp, n> c;\n        for( int i = 0; i < n; i++ )\n            c.s[i] = (_Tp)0;\n        return c;\n    }\n\n    static v_reg<_Tp, n> all(_Tp s)\n    {\n        v_reg<_Tp, n> c;\n        for( int i = 0; i < n; i++ )\n            c.s[i] = s;\n        return c;\n    }\n\n    template<typename _Tp2, int n2> v_reg<_Tp2, n2> reinterpret_as() const\n    {\n        size_t bytes = std::min(sizeof(_Tp2)*n2, sizeof(_Tp)*n);\n        v_reg<_Tp2, n2> c;\n        std::memcpy(&c.s[0], &s[0], bytes);\n        return c;\n    }\n\n    v_reg& operator=(const v_reg<_Tp, n> & r)\n    {\n        for( int i = 0; i < n; i++ )\n            s[i] = r.s[i];\n        return *this;\n    }\n\n    _Tp s[n];\n//! @endcond\n};\n\n/** @brief Sixteen 8-bit unsigned integer values */\ntypedef v_reg<uchar, 16> v_uint8x16;\n/** @brief Sixteen 8-bit signed integer values */\ntypedef v_reg<schar, 16> v_int8x16;\n/** @brief Eight 16-bit unsigned integer values */\ntypedef v_reg<ushort, 8> v_uint16x8;\n/** @brief Eight 16-bit signed integer values */\ntypedef v_reg<short, 8> v_int16x8;\n/** @brief Four 32-bit unsigned integer values */\ntypedef v_reg<unsigned, 4> v_uint32x4;\n/** @brief Four 32-bit signed integer values */\ntypedef v_reg<int, 4> v_int32x4;\n/** @brief Four 32-bit floating point values (single precision) */\ntypedef v_reg<float, 4> v_float32x4;\n/** @brief Two 64-bit floating point values (double precision) */\ntypedef v_reg<double, 2> v_float64x2;\n/** @brief Two 64-bit unsigned integer values */\ntypedef v_reg<uint64, 2> v_uint64x2;\n/** @brief Two 64-bit signed integer values */\ntypedef v_reg<int64, 2> v_int64x2;\n\n#if CV_SIMD256\n/** @brief Thirty two 8-bit unsigned integer values */\ntypedef v_reg<uchar, 32> v_uint8x32;\n/** @brief Thirty two 8-bit signed integer values */\ntypedef v_reg<schar, 32> v_int8x32;\n/** @brief Sixteen 16-bit unsigned integer values */\ntypedef v_reg<ushort, 16> v_uint16x16;\n/** @brief Sixteen 16-bit signed integer values */\ntypedef v_reg<short, 16> v_int16x16;\n/** @brief Eight 32-bit unsigned integer values */\ntypedef v_reg<unsigned, 8> v_uint32x8;\n/** @brief Eight 32-bit signed integer values */\ntypedef v_reg<int, 8> v_int32x8;\n/** @brief Eight 32-bit floating point values (single precision) */\ntypedef v_reg<float, 8> v_float32x8;\n/** @brief Four 64-bit floating point values (double precision) */\ntypedef v_reg<double, 4> v_float64x4;\n/** @brief Four 64-bit unsigned integer values */\ntypedef v_reg<uint64, 4> v_uint64x4;\n/** @brief Four 64-bit signed integer values */\ntypedef v_reg<int64, 4> v_int64x4;\n#endif\n\n#if CV_SIMD512\n/** @brief Sixty four 8-bit unsigned integer values */\ntypedef v_reg<uchar, 64> v_uint8x64;\n/** @brief Sixty four 8-bit signed integer values */\ntypedef v_reg<schar, 64> v_int8x64;\n/** @brief Thirty two 16-bit unsigned integer values */\ntypedef v_reg<ushort, 32> v_uint16x32;\n/** @brief Thirty two 16-bit signed integer values */\ntypedef v_reg<short, 32> v_int16x32;\n/** @brief Sixteen 32-bit unsigned integer values */\ntypedef v_reg<unsigned, 16> v_uint32x16;\n/** @brief Sixteen 32-bit signed integer values */\ntypedef v_reg<int, 16> v_int32x16;\n/** @brief Sixteen 32-bit floating point values (single precision) */\ntypedef v_reg<float, 16> v_float32x16;\n/** @brief Eight 64-bit floating point values (double precision) */\ntypedef v_reg<double, 8> v_float64x8;\n/** @brief Eight 64-bit unsigned integer values */\ntypedef v_reg<uint64, 8> v_uint64x8;\n/** @brief Eight 64-bit signed integer values */\ntypedef v_reg<int64, 8> v_int64x8;\n#endif\n\nenum {\n    simd128_width = 16,\n#if CV_SIMD256\n    simd256_width = 32,\n#endif\n#if CV_SIMD512\n    simd512_width = 64,\n    simdmax_width = simd512_width\n#elif CV_SIMD256\n    simdmax_width = simd256_width\n#else\n    simdmax_width = simd128_width\n#endif\n};\n\n/** @brief Add values\n\nFor all types. */\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n> operator+(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n>& operator+=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\n\n/** @brief Subtract values\n\nFor all types. */\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n> operator-(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n>& operator-=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\n\n/** @brief Multiply values\n\nFor 16- and 32-bit integer types and floating types. */\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n> operator*(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n>& operator*=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\n\n/** @brief Divide values\n\nFor floating types only. */\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n> operator/(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n>& operator/=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\n\n\n/** @brief Bitwise AND\n\nOnly for integer types. */\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n> operator&(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n>& operator&=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\n\n/** @brief Bitwise OR\n\nOnly for integer types. */\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n> operator|(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n>& operator|=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\n\n/** @brief Bitwise XOR\n\nOnly for integer types.*/\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n> operator^(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n>& operator^=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);\n\n/** @brief Bitwise NOT\n\nOnly for integer types.*/\ntemplate<typename _Tp, int n> CV_INLINE v_reg<_Tp, n> operator~(const v_reg<_Tp, n>& a);\n\n\n#ifndef CV_DOXYGEN\n\n#define CV__HAL_INTRIN_EXPAND_WITH_INTEGER_TYPES(macro_name, ...) \\\n__CV_EXPAND(macro_name(uchar, __VA_ARGS__)) \\\n__CV_EXPAND(macro_name(schar, __VA_ARGS__)) \\\n__CV_EXPAND(macro_name(ushort, __VA_ARGS__)) \\\n__CV_EXPAND(macro_name(short, __VA_ARGS__)) \\\n__CV_EXPAND(macro_name(unsigned, __VA_ARGS__)) \\\n__CV_EXPAND(macro_name(int, __VA_ARGS__)) \\\n__CV_EXPAND(macro_name(uint64, __VA_ARGS__)) \\\n__CV_EXPAND(macro_name(int64, __VA_ARGS__)) \\\n\n#define CV__HAL_INTRIN_EXPAND_WITH_FP_TYPES(macro_name, ...) \\\n__CV_EXPAND(macro_name(float, __VA_ARGS__)) \\\n__CV_EXPAND(macro_name(double, __VA_ARGS__)) \\\n\n#define CV__HAL_INTRIN_EXPAND_WITH_ALL_TYPES(macro_name, ...) \\\nCV__HAL_INTRIN_EXPAND_WITH_INTEGER_TYPES(macro_name, __VA_ARGS__) \\\nCV__HAL_INTRIN_EXPAND_WITH_FP_TYPES(macro_name, __VA_ARGS__) \\\n\n#define CV__HAL_INTRIN_IMPL_BIN_OP_(_Tp, bin_op) \\\ntemplate<int n> inline \\\nv_reg<_Tp, n> operator bin_op (const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    v_reg<_Tp, n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n        c.s[i] = saturate_cast<_Tp>(a.s[i] bin_op b.s[i]); \\\n    return c; \\\n} \\\ntemplate<int n> inline \\\nv_reg<_Tp, n>& operator bin_op##= (v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    for( int i = 0; i < n; i++ ) \\\n        a.s[i] = saturate_cast<_Tp>(a.s[i] bin_op b.s[i]); \\\n    return a; \\\n}\n\n#define CV__HAL_INTRIN_IMPL_BIN_OP(bin_op) CV__HAL_INTRIN_EXPAND_WITH_ALL_TYPES(CV__HAL_INTRIN_IMPL_BIN_OP_, bin_op)\n\nCV__HAL_INTRIN_IMPL_BIN_OP(+)\nCV__HAL_INTRIN_IMPL_BIN_OP(-)\nCV__HAL_INTRIN_IMPL_BIN_OP(*)\nCV__HAL_INTRIN_EXPAND_WITH_FP_TYPES(CV__HAL_INTRIN_IMPL_BIN_OP_, /)\n\n#define CV__HAL_INTRIN_IMPL_BIT_OP_(_Tp, bit_op) \\\ntemplate<int n> CV_INLINE \\\nv_reg<_Tp, n> operator bit_op (const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    v_reg<_Tp, n> c; \\\n    typedef typename V_TypeTraits<_Tp>::int_type itype; \\\n    for( int i = 0; i < n; i++ ) \\\n        c.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int((itype)(V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) bit_op \\\n                                                        V_TypeTraits<_Tp>::reinterpret_int(b.s[i]))); \\\n    return c; \\\n} \\\ntemplate<int n> CV_INLINE \\\nv_reg<_Tp, n>& operator bit_op##= (v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    typedef typename V_TypeTraits<_Tp>::int_type itype; \\\n    for( int i = 0; i < n; i++ ) \\\n        a.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int((itype)(V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) bit_op \\\n                                                        V_TypeTraits<_Tp>::reinterpret_int(b.s[i]))); \\\n    return a; \\\n}\n\n#define CV__HAL_INTRIN_IMPL_BIT_OP(bit_op) \\\nCV__HAL_INTRIN_EXPAND_WITH_INTEGER_TYPES(CV__HAL_INTRIN_IMPL_BIT_OP_, bit_op) \\\nCV__HAL_INTRIN_EXPAND_WITH_FP_TYPES(CV__HAL_INTRIN_IMPL_BIT_OP_, bit_op) /* TODO: FIXIT remove this after masks refactoring */\n\n\nCV__HAL_INTRIN_IMPL_BIT_OP(&)\nCV__HAL_INTRIN_IMPL_BIT_OP(|)\nCV__HAL_INTRIN_IMPL_BIT_OP(^)\n\n#define CV__HAL_INTRIN_IMPL_BITWISE_NOT_(_Tp, dummy) \\\ntemplate<int n> CV_INLINE \\\nv_reg<_Tp, n> operator ~ (const v_reg<_Tp, n>& a) \\\n{ \\\n    v_reg<_Tp, n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n        c.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int(~V_TypeTraits<_Tp>::reinterpret_int(a.s[i])); \\\n    return c; \\\n} \\\n\nCV__HAL_INTRIN_EXPAND_WITH_INTEGER_TYPES(CV__HAL_INTRIN_IMPL_BITWISE_NOT_, ~)\n\n#endif  // !CV_DOXYGEN\n\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_MATH_FUNC(func, cfunc, _Tp2) \\\ntemplate<typename _Tp, int n> inline v_reg<_Tp2, n> func(const v_reg<_Tp, n>& a) \\\n{ \\\n    v_reg<_Tp2, n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n        c.s[i] = cfunc(a.s[i]); \\\n    return c; \\\n}\n\n/** @brief Square root of elements\n\nOnly for floating point types.*/\nOPENCV_HAL_IMPL_MATH_FUNC(v_sqrt, std::sqrt, _Tp)\n\n//! @cond IGNORED\nOPENCV_HAL_IMPL_MATH_FUNC(v_sin, std::sin, _Tp)\nOPENCV_HAL_IMPL_MATH_FUNC(v_cos, std::cos, _Tp)\nOPENCV_HAL_IMPL_MATH_FUNC(v_exp, std::exp, _Tp)\nOPENCV_HAL_IMPL_MATH_FUNC(v_log, std::log, _Tp)\n//! @endcond\n\n/** @brief Absolute value of elements\n\nOnly for floating point types.*/\nOPENCV_HAL_IMPL_MATH_FUNC(v_abs, (typename V_TypeTraits<_Tp>::abs_type)std::abs,\n                          typename V_TypeTraits<_Tp>::abs_type)\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_MINMAX_FUNC(func, cfunc) \\\ntemplate<typename _Tp, int n> inline v_reg<_Tp, n> func(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    v_reg<_Tp, n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n        c.s[i] = cfunc(a.s[i], b.s[i]); \\\n    return c; \\\n}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_REDUCE_MINMAX_FUNC(func, cfunc) \\\ntemplate<typename _Tp, int n> inline _Tp func(const v_reg<_Tp, n>& a) \\\n{ \\\n    _Tp c = a.s[0]; \\\n    for( int i = 1; i < n; i++ ) \\\n        c = cfunc(c, a.s[i]); \\\n    return c; \\\n}\n\n/** @brief Choose min values for each pair\n\nScheme:\n@code\n{A1 A2 ...}\n{B1 B2 ...}\n--------------\n{min(A1,B1) min(A2,B2) ...}\n@endcode\nFor all types except 64-bit integer. */\nOPENCV_HAL_IMPL_MINMAX_FUNC(v_min, std::min)\n\n/** @brief Choose max values for each pair\n\nScheme:\n@code\n{A1 A2 ...}\n{B1 B2 ...}\n--------------\n{max(A1,B1) max(A2,B2) ...}\n@endcode\nFor all types except 64-bit integer. */\nOPENCV_HAL_IMPL_MINMAX_FUNC(v_max, std::max)\n\n/** @brief Find one min value\n\nScheme:\n@code\n{A1 A2 A3 ...} => min(A1,A2,A3,...)\n@endcode\nFor all types except 64-bit integer and 64-bit floating point types. */\nOPENCV_HAL_IMPL_REDUCE_MINMAX_FUNC(v_reduce_min, std::min)\n\n/** @brief Find one max value\n\nScheme:\n@code\n{A1 A2 A3 ...} => max(A1,A2,A3,...)\n@endcode\nFor all types except 64-bit integer and 64-bit floating point types. */\nOPENCV_HAL_IMPL_REDUCE_MINMAX_FUNC(v_reduce_max, std::max)\n\nstatic const unsigned char popCountTable[] =\n{\n    0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8,\n};\n/** @brief Count the 1 bits in the vector lanes and return result as corresponding unsigned type\n\nScheme:\n@code\n{A1 A2 A3 ...} => {popcount(A1), popcount(A2), popcount(A3), ...}\n@endcode\nFor all integer types. */\ntemplate<typename _Tp, int n>\ninline v_reg<typename V_TypeTraits<_Tp>::abs_type, n> v_popcount(const v_reg<_Tp, n>& a)\n{\n    v_reg<typename V_TypeTraits<_Tp>::abs_type, n> b = v_reg<typename V_TypeTraits<_Tp>::abs_type, n>::zero();\n    for (int i = 0; i < n*(int)sizeof(_Tp); i++)\n        b.s[i/sizeof(_Tp)] += popCountTable[v_reinterpret_as_u8(a).s[i]];\n    return b;\n}\n\n\n//! @cond IGNORED\ntemplate<typename _Tp, int n>\ninline void v_minmax( const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b,\n                      v_reg<_Tp, n>& minval, v_reg<_Tp, n>& maxval )\n{\n    for( int i = 0; i < n; i++ )\n    {\n        minval.s[i] = std::min(a.s[i], b.s[i]);\n        maxval.s[i] = std::max(a.s[i], b.s[i]);\n    }\n}\n//! @endcond\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_CMP_OP(cmp_op) \\\ntemplate<typename _Tp, int n> \\\ninline v_reg<_Tp, n> operator cmp_op(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    typedef typename V_TypeTraits<_Tp>::int_type itype; \\\n    v_reg<_Tp, n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n        c.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int((itype)-(int)(a.s[i] cmp_op b.s[i])); \\\n    return c; \\\n}\n\n/** @brief Less-than comparison\n\nFor all types except 64-bit integer values. */\nOPENCV_HAL_IMPL_CMP_OP(<)\n\n/** @brief Greater-than comparison\n\nFor all types except 64-bit integer values. */\nOPENCV_HAL_IMPL_CMP_OP(>)\n\n/** @brief Less-than or equal comparison\n\nFor all types except 64-bit integer values. */\nOPENCV_HAL_IMPL_CMP_OP(<=)\n\n/** @brief Greater-than or equal comparison\n\nFor all types except 64-bit integer values. */\nOPENCV_HAL_IMPL_CMP_OP(>=)\n\n/** @brief Equal comparison\n\nFor all types except 64-bit integer values. */\nOPENCV_HAL_IMPL_CMP_OP(==)\n\n/** @brief Not equal comparison\n\nFor all types except 64-bit integer values. */\nOPENCV_HAL_IMPL_CMP_OP(!=)\n\ntemplate<int n>\ninline v_reg<float, n> v_not_nan(const v_reg<float, n>& a)\n{\n    typedef typename V_TypeTraits<float>::int_type itype;\n    v_reg<float, n> c;\n    for (int i = 0; i < n; i++)\n        c.s[i] = V_TypeTraits<float>::reinterpret_from_int((itype)-(int)(a.s[i] == a.s[i]));\n    return c;\n}\ntemplate<int n>\ninline v_reg<double, n> v_not_nan(const v_reg<double, n>& a)\n{\n    typedef typename V_TypeTraits<double>::int_type itype;\n    v_reg<double, n> c;\n    for (int i = 0; i < n; i++)\n        c.s[i] = V_TypeTraits<double>::reinterpret_from_int((itype)-(int)(a.s[i] == a.s[i]));\n    return c;\n}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_ARITHM_OP(func, bin_op, cast_op, _Tp2) \\\ntemplate<typename _Tp, int n> \\\ninline v_reg<_Tp2, n> func(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    typedef _Tp2 rtype; \\\n    v_reg<rtype, n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n        c.s[i] = cast_op(a.s[i] bin_op b.s[i]); \\\n    return c; \\\n}\n\n/** @brief Add values without saturation\n\nFor 8- and 16-bit integer values. */\nOPENCV_HAL_IMPL_ARITHM_OP(v_add_wrap, +, (_Tp), _Tp)\n\n/** @brief Subtract values without saturation\n\nFor 8- and 16-bit integer values. */\nOPENCV_HAL_IMPL_ARITHM_OP(v_sub_wrap, -, (_Tp), _Tp)\n\n/** @brief Multiply values without saturation\n\nFor 8- and 16-bit integer values. */\nOPENCV_HAL_IMPL_ARITHM_OP(v_mul_wrap, *, (_Tp), _Tp)\n\n//! @cond IGNORED\ntemplate<typename T> inline T _absdiff(T a, T b)\n{\n    return a > b ? a - b : b - a;\n}\n//! @endcond\n\n/** @brief Absolute difference\n\nReturns \\f$ |a - b| \\f$ converted to corresponding unsigned type.\nExample:\n@code{.cpp}\nv_int32x4 a, b; // {1, 2, 3, 4} and {4, 3, 2, 1}\nv_uint32x4 c = v_absdiff(a, b); // result is {3, 1, 1, 3}\n@endcode\nFor 8-, 16-, 32-bit integer source types. */\ntemplate<typename _Tp, int n>\ninline v_reg<typename V_TypeTraits<_Tp>::abs_type, n> v_absdiff(const v_reg<_Tp, n>& a, const v_reg<_Tp, n> & b)\n{\n    typedef typename V_TypeTraits<_Tp>::abs_type rtype;\n    v_reg<rtype, n> c;\n    const rtype mask = (rtype)(std::numeric_limits<_Tp>::is_signed ? (1 << (sizeof(rtype)*8 - 1)) : 0);\n    for( int i = 0; i < n; i++ )\n    {\n        rtype ua = a.s[i] ^ mask;\n        rtype ub = b.s[i] ^ mask;\n        c.s[i] = _absdiff(ua, ub);\n    }\n    return c;\n}\n\n/** @overload\n\nFor 32-bit floating point values */\ntemplate<int n> inline v_reg<float, n> v_absdiff(const v_reg<float, n>& a, const v_reg<float, n>& b)\n{\n    v_reg<float, n> c;\n    for( int i = 0; i < c.nlanes; i++ )\n        c.s[i] = _absdiff(a.s[i], b.s[i]);\n    return c;\n}\n\n/** @overload\n\nFor 64-bit floating point values */\ntemplate<int n> inline v_reg<double, n> v_absdiff(const v_reg<double, n>& a, const v_reg<double, n>& b)\n{\n    v_reg<double, n> c;\n    for( int i = 0; i < c.nlanes; i++ )\n        c.s[i] = _absdiff(a.s[i], b.s[i]);\n    return c;\n}\n\n/** @brief Saturating absolute difference\n\nReturns \\f$ saturate(|a - b|) \\f$ .\nFor 8-, 16-bit signed integer source types. */\ntemplate<typename _Tp, int n>\ninline v_reg<_Tp, n> v_absdiffs(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    v_reg<_Tp, n> c;\n    for( int i = 0; i < n; i++)\n        c.s[i] = saturate_cast<_Tp>(std::abs(a.s[i] - b.s[i]));\n    return c;\n}\n\n/** @brief Inversed square root\n\nReturns \\f$ 1/sqrt(a) \\f$\nFor floating point types only. */\ntemplate<typename _Tp, int n>\ninline v_reg<_Tp, n> v_invsqrt(const v_reg<_Tp, n>& a)\n{\n    v_reg<_Tp, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = 1.f/std::sqrt(a.s[i]);\n    return c;\n}\n\n/** @brief Magnitude\n\nReturns \\f$ sqrt(a^2 + b^2) \\f$\nFor floating point types only. */\ntemplate<typename _Tp, int n>\ninline v_reg<_Tp, n> v_magnitude(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    v_reg<_Tp, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = std::sqrt(a.s[i]*a.s[i] + b.s[i]*b.s[i]);\n    return c;\n}\n\n/** @brief Square of the magnitude\n\nReturns \\f$ a^2 + b^2 \\f$\nFor floating point types only. */\ntemplate<typename _Tp, int n>\ninline v_reg<_Tp, n> v_sqr_magnitude(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    v_reg<_Tp, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = a.s[i]*a.s[i] + b.s[i]*b.s[i];\n    return c;\n}\n\n/** @brief Multiply and add\n\n Returns \\f$ a*b + c \\f$\n For floating point types and signed 32bit int only. */\ntemplate<typename _Tp, int n>\ninline v_reg<_Tp, n> v_fma(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b,\n                           const v_reg<_Tp, n>& c)\n{\n    v_reg<_Tp, n> d;\n    for( int i = 0; i < n; i++ )\n        d.s[i] = a.s[i]*b.s[i] + c.s[i];\n    return d;\n}\n\n/** @brief A synonym for v_fma */\ntemplate<typename _Tp, int n>\ninline v_reg<_Tp, n> v_muladd(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b,\n                              const v_reg<_Tp, n>& c)\n{\n    return v_fma(a, b, c);\n}\n\n/** @brief Dot product of elements\n\nMultiply values in two registers and sum adjacent result pairs.\n\nScheme:\n@code\n  {A1 A2 ...} // 16-bit\nx {B1 B2 ...} // 16-bit\n-------------\n{A1B1+A2B2 ...} // 32-bit\n\n@endcode\n*/\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>\nv_dotprod(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    typedef typename V_TypeTraits<_Tp>::w_type w_type;\n    v_reg<w_type, n/2> c;\n    for( int i = 0; i < (n/2); i++ )\n        c.s[i] = (w_type)a.s[i*2]*b.s[i*2] + (w_type)a.s[i*2+1]*b.s[i*2+1];\n    return c;\n}\n\n/** @brief Dot product of elements\n\nSame as cv::v_dotprod, but add a third element to the sum of adjacent pairs.\nScheme:\n@code\n  {A1 A2 ...} // 16-bit\nx {B1 B2 ...} // 16-bit\n-------------\n  {A1B1+A2B2+C1 ...} // 32-bit\n@endcode\n*/\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>\nv_dotprod(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b,\n          const v_reg<typename V_TypeTraits<_Tp>::w_type, n / 2>& c)\n{\n    typedef typename V_TypeTraits<_Tp>::w_type w_type;\n    v_reg<w_type, n/2> s;\n    for( int i = 0; i < (n/2); i++ )\n        s.s[i] = (w_type)a.s[i*2]*b.s[i*2] + (w_type)a.s[i*2+1]*b.s[i*2+1] + c.s[i];\n    return s;\n}\n\n/** @brief Fast Dot product of elements\n\nSame as cv::v_dotprod, but it may perform unorder sum between result pairs in some platforms,\nthis intrinsic can be used if the sum among all lanes is only matters\nand also it should be yielding better performance on the affected platforms.\n\n*/\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>\nv_dotprod_fast(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{ return v_dotprod(a, b); }\n\n/** @brief Fast Dot product of elements\n\nSame as cv::v_dotprod_fast, but add a third element to the sum of adjacent pairs.\n*/\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>\nv_dotprod_fast(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b,\n               const v_reg<typename V_TypeTraits<_Tp>::w_type, n / 2>& c)\n{ return v_dotprod(a, b, c); }\n\n/** @brief Dot product of elements and expand\n\nMultiply values in two registers and expand the sum of adjacent result pairs.\n\nScheme:\n@code\n  {A1 A2 A3 A4 ...} // 8-bit\nx {B1 B2 B3 B4 ...} // 8-bit\n-------------\n  {A1B1+A2B2+A3B3+A4B4 ...} // 32-bit\n\n@endcode\n*/\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::q_type, n/4>\nv_dotprod_expand(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    typedef typename V_TypeTraits<_Tp>::q_type q_type;\n    v_reg<q_type, n/4> s;\n    for( int i = 0; i < (n/4); i++ )\n        s.s[i] = (q_type)a.s[i*4    ]*b.s[i*4    ] + (q_type)a.s[i*4 + 1]*b.s[i*4 + 1] +\n                 (q_type)a.s[i*4 + 2]*b.s[i*4 + 2] + (q_type)a.s[i*4 + 3]*b.s[i*4 + 3];\n    return s;\n}\n\n/** @brief Dot product of elements\n\nSame as cv::v_dotprod_expand, but add a third element to the sum of adjacent pairs.\nScheme:\n@code\n  {A1 A2 A3 A4 ...} // 8-bit\nx {B1 B2 B3 B4 ...} // 8-bit\n-------------\n  {A1B1+A2B2+A3B3+A4B4+C1 ...} // 32-bit\n@endcode\n*/\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::q_type, n/4>\nv_dotprod_expand(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b,\n                 const v_reg<typename V_TypeTraits<_Tp>::q_type, n / 4>& c)\n{\n    typedef typename V_TypeTraits<_Tp>::q_type q_type;\n    v_reg<q_type, n/4> s;\n    for( int i = 0; i < (n/4); i++ )\n        s.s[i] = (q_type)a.s[i*4    ]*b.s[i*4    ] + (q_type)a.s[i*4 + 1]*b.s[i*4 + 1] +\n                 (q_type)a.s[i*4 + 2]*b.s[i*4 + 2] + (q_type)a.s[i*4 + 3]*b.s[i*4 + 3] + c.s[i];\n    return s;\n}\n\n/** @brief Fast Dot product of elements and expand\n\nMultiply values in two registers and expand the sum of adjacent result pairs.\n\nSame as cv::v_dotprod_expand, but it may perform unorder sum between result pairs in some platforms,\nthis intrinsic can be used if the sum among all lanes is only matters\nand also it should be yielding better performance on the affected platforms.\n\n*/\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::q_type, n/4>\nv_dotprod_expand_fast(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{ return v_dotprod_expand(a, b); }\n\n/** @brief Fast Dot product of elements\n\nSame as cv::v_dotprod_expand_fast, but add a third element to the sum of adjacent pairs.\n*/\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::q_type, n/4>\nv_dotprod_expand_fast(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b,\n                      const v_reg<typename V_TypeTraits<_Tp>::q_type, n / 4>& c)\n{ return v_dotprod_expand(a, b, c); }\n\n/** @brief Multiply and expand\n\nMultiply values two registers and store results in two registers with wider pack type.\nScheme:\n@code\n  {A B C D} // 32-bit\nx {E F G H} // 32-bit\n---------------\n{AE BF}         // 64-bit\n        {CG DH} // 64-bit\n@endcode\nExample:\n@code{.cpp}\nv_uint32x4 a, b; // {1,2,3,4} and {2,2,2,2}\nv_uint64x2 c, d; // results\nv_mul_expand(a, b, c, d); // c, d = {2,4}, {6, 8}\n@endcode\nImplemented only for 16- and unsigned 32-bit source types (v_int16x8, v_uint16x8, v_uint32x4).\n*/\ntemplate<typename _Tp, int n> inline void v_mul_expand(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b,\n                                                       v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>& c,\n                                                       v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>& d)\n{\n    typedef typename V_TypeTraits<_Tp>::w_type w_type;\n    for( int i = 0; i < (n/2); i++ )\n    {\n        c.s[i] = (w_type)a.s[i]*b.s[i];\n        d.s[i] = (w_type)a.s[i+(n/2)]*b.s[i+(n/2)];\n    }\n}\n\n/** @brief Multiply and extract high part\n\nMultiply values two registers and store high part of the results.\nImplemented only for 16-bit source types (v_int16x8, v_uint16x8). Returns \\f$ a*b >> 16 \\f$\n*/\ntemplate<typename _Tp, int n> inline v_reg<_Tp, n> v_mul_hi(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    typedef typename V_TypeTraits<_Tp>::w_type w_type;\n    v_reg<_Tp, n> c;\n    for (int i = 0; i < n; i++)\n        c.s[i] = (_Tp)(((w_type)a.s[i] * b.s[i]) >> sizeof(_Tp)*8);\n    return c;\n}\n\n//! @cond IGNORED\ntemplate<typename _Tp, int n> inline void v_hsum(const v_reg<_Tp, n>& a,\n                                                 v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>& c)\n{\n    typedef typename V_TypeTraits<_Tp>::w_type w_type;\n    for( int i = 0; i < (n/2); i++ )\n    {\n        c.s[i] = (w_type)a.s[i*2] + a.s[i*2+1];\n    }\n}\n//! @endcond\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_SHIFT_OP(shift_op) \\\ntemplate<typename _Tp, int n> inline v_reg<_Tp, n> operator shift_op(const v_reg<_Tp, n>& a, int imm) \\\n{ \\\n    v_reg<_Tp, n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n        c.s[i] = (_Tp)(a.s[i] shift_op imm); \\\n    return c; \\\n}\n\n/** @brief Bitwise shift left\n\nFor 16-, 32- and 64-bit integer values. */\nOPENCV_HAL_IMPL_SHIFT_OP(<< )\n\n/** @brief Bitwise shift right\n\nFor 16-, 32- and 64-bit integer values. */\nOPENCV_HAL_IMPL_SHIFT_OP(>> )\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_ROTATE_SHIFT_OP(suffix,opA,opB) \\\ntemplate<int imm, typename _Tp, int n> inline v_reg<_Tp, n> v_rotate_##suffix(const v_reg<_Tp, n>& a) \\\n{ \\\n    v_reg<_Tp, n> b; \\\n    for (int i = 0; i < n; i++) \\\n    { \\\n        int sIndex = i opA imm; \\\n        if (0 <= sIndex && sIndex < n) \\\n        { \\\n            b.s[i] = a.s[sIndex]; \\\n        } \\\n        else \\\n        { \\\n            b.s[i] = 0; \\\n        } \\\n    } \\\n    return b; \\\n} \\\ntemplate<int imm, typename _Tp, int n> inline v_reg<_Tp, n> v_rotate_##suffix(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    v_reg<_Tp, n> c; \\\n    for (int i = 0; i < n; i++) \\\n    { \\\n        int aIndex = i opA imm; \\\n        int bIndex = i opA imm opB n; \\\n        if (0 <= bIndex && bIndex < n) \\\n        { \\\n            c.s[i] = b.s[bIndex]; \\\n        } \\\n        else if (0 <= aIndex && aIndex < n) \\\n        { \\\n            c.s[i] = a.s[aIndex]; \\\n        } \\\n        else \\\n        { \\\n            c.s[i] = 0; \\\n        } \\\n    } \\\n    return c; \\\n}\n\n/** @brief Element shift left among vector\n\nFor all type */\nOPENCV_HAL_IMPL_ROTATE_SHIFT_OP(left,  -, +)\n\n/** @brief Element shift right among vector\n\nFor all type */\nOPENCV_HAL_IMPL_ROTATE_SHIFT_OP(right, +, -)\n\n/** @brief Sum packed values\n\nScheme:\n@code\n{A1 A2 A3 ...} => sum{A1,A2,A3,...}\n@endcode\n*/\ntemplate<typename _Tp, int n> inline typename V_TypeTraits<_Tp>::sum_type v_reduce_sum(const v_reg<_Tp, n>& a)\n{\n    typename V_TypeTraits<_Tp>::sum_type c = a.s[0];\n    for( int i = 1; i < n; i++ )\n        c += a.s[i];\n    return c;\n}\n\n/** @brief Sums all elements of each input vector, returns the vector of sums\n\n Scheme:\n @code\n result[0] = a[0] + a[1] + a[2] + a[3]\n result[1] = b[0] + b[1] + b[2] + b[3]\n result[2] = c[0] + c[1] + c[2] + c[3]\n result[3] = d[0] + d[1] + d[2] + d[3]\n @endcode\n*/\ntemplate<int n> inline v_reg<float, n> v_reduce_sum4(const v_reg<float, n>& a, const v_reg<float, n>& b,\n    const v_reg<float, n>& c, const v_reg<float, n>& d)\n{\n    v_reg<float, n> r;\n    for(int i = 0; i < (n/4); i++)\n    {\n        r.s[i*4 + 0] = a.s[i*4 + 0] + a.s[i*4 + 1] + a.s[i*4 + 2] + a.s[i*4 + 3];\n        r.s[i*4 + 1] = b.s[i*4 + 0] + b.s[i*4 + 1] + b.s[i*4 + 2] + b.s[i*4 + 3];\n        r.s[i*4 + 2] = c.s[i*4 + 0] + c.s[i*4 + 1] + c.s[i*4 + 2] + c.s[i*4 + 3];\n        r.s[i*4 + 3] = d.s[i*4 + 0] + d.s[i*4 + 1] + d.s[i*4 + 2] + d.s[i*4 + 3];\n    }\n    return r;\n}\n\n/** @brief Sum absolute differences of values\n\nScheme:\n@code\n{A1 A2 A3 ...} {B1 B2 B3 ...} => sum{ABS(A1-B1),abs(A2-B2),abs(A3-B3),...}\n@endcode\nFor all types except 64-bit types.*/\ntemplate<typename _Tp, int n> inline typename V_TypeTraits< typename V_TypeTraits<_Tp>::abs_type >::sum_type v_reduce_sad(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    typename V_TypeTraits< typename V_TypeTraits<_Tp>::abs_type >::sum_type c = _absdiff(a.s[0], b.s[0]);\n    for (int i = 1; i < n; i++)\n        c += _absdiff(a.s[i], b.s[i]);\n    return c;\n}\n\n/** @brief Get negative values mask\n@deprecated v_signmask depends on a lane count heavily and therefore isn't universal enough\n\nReturned value is a bit mask with bits set to 1 on places corresponding to negative packed values indexes.\nExample:\n@code{.cpp}\nv_int32x4 r; // set to {-1, -1, 1, 1}\nint mask = v_signmask(r); // mask = 3 <== 00000000 00000000 00000000 00000011\n@endcode\n*/\ntemplate<typename _Tp, int n> inline int v_signmask(const v_reg<_Tp, n>& a)\n{\n    int mask = 0;\n    for( int i = 0; i < n; i++ )\n        mask |= (V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) < 0) << i;\n    return mask;\n}\n\n/** @brief Get first negative lane index\n\nReturned value is an index of first negative lane (undefined for input of all positive values)\nExample:\n@code{.cpp}\nv_int32x4 r; // set to {0, 0, -1, -1}\nint idx = v_heading_zeros(r); // idx = 2\n@endcode\n*/\ntemplate <typename _Tp, int n> inline int v_scan_forward(const v_reg<_Tp, n>& a)\n{\n    for (int i = 0; i < n; i++)\n        if(V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) < 0)\n            return i;\n    return 0;\n}\n\n/** @brief Check if all packed values are less than zero\n\nUnsigned values will be casted to signed: `uchar 254 => char -2`.\n*/\ntemplate<typename _Tp, int n> inline bool v_check_all(const v_reg<_Tp, n>& a)\n{\n    for( int i = 0; i < n; i++ )\n        if( V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) >= 0 )\n            return false;\n    return true;\n}\n\n/** @brief Check if any of packed values is less than zero\n\nUnsigned values will be casted to signed: `uchar 254 => char -2`.\n*/\ntemplate<typename _Tp, int n> inline bool v_check_any(const v_reg<_Tp, n>& a)\n{\n    for( int i = 0; i < n; i++ )\n        if( V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) < 0 )\n            return true;\n    return false;\n}\n\n/** @brief Per-element select (blend operation)\n\nReturn value will be built by combining values _a_ and _b_ using the following scheme:\n    result[i] = mask[i] ? a[i] : b[i];\n\n@note: _mask_ element values are restricted to these values:\n- 0: select element from _b_\n- 0xff/0xffff/etc: select element from _a_\n(fully compatible with bitwise-based operator)\n*/\ntemplate<typename _Tp, int n> inline v_reg<_Tp, n> v_select(const v_reg<_Tp, n>& mask,\n                                                           const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    typedef V_TypeTraits<_Tp> Traits;\n    typedef typename Traits::int_type int_type;\n    v_reg<_Tp, n> c;\n    for( int i = 0; i < n; i++ )\n    {\n        int_type m = Traits::reinterpret_int(mask.s[i]);\n        CV_DbgAssert(m == 0 || m == (~(int_type)0));  // restrict mask values: 0 or 0xff/0xffff/etc\n        c.s[i] = m ? a.s[i] : b.s[i];\n    }\n    return c;\n}\n\n/** @brief Expand values to the wider pack type\n\nCopy contents of register to two registers with 2x wider pack type.\nScheme:\n@code\n int32x4     int64x2 int64x2\n{A B C D} ==> {A B} , {C D}\n@endcode */\ntemplate<typename _Tp, int n> inline void v_expand(const v_reg<_Tp, n>& a,\n                            v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>& b0,\n                            v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>& b1)\n{\n    for( int i = 0; i < (n/2); i++ )\n    {\n        b0.s[i] = a.s[i];\n        b1.s[i] = a.s[i+(n/2)];\n    }\n}\n\n/** @brief Expand lower values to the wider pack type\n\nSame as cv::v_expand, but return lower half of the vector.\n\nScheme:\n@code\n int32x4     int64x2\n{A B C D} ==> {A B}\n@endcode */\ntemplate<typename _Tp, int n>\ninline v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>\nv_expand_low(const v_reg<_Tp, n>& a)\n{\n    v_reg<typename V_TypeTraits<_Tp>::w_type, n/2> b;\n    for( int i = 0; i < (n/2); i++ )\n        b.s[i] = a.s[i];\n    return b;\n}\n\n/** @brief Expand higher values to the wider pack type\n\nSame as cv::v_expand_low, but expand higher half of the vector instead.\n\nScheme:\n@code\n int32x4     int64x2\n{A B C D} ==> {C D}\n@endcode */\ntemplate<typename _Tp, int n>\ninline v_reg<typename V_TypeTraits<_Tp>::w_type, n/2>\nv_expand_high(const v_reg<_Tp, n>& a)\n{\n    v_reg<typename V_TypeTraits<_Tp>::w_type, n/2> b;\n    for( int i = 0; i < (n/2); i++ )\n        b.s[i] = a.s[i+(n/2)];\n    return b;\n}\n\n//! @cond IGNORED\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::int_type, n>\n    v_reinterpret_as_int(const v_reg<_Tp, n>& a)\n{\n    v_reg<typename V_TypeTraits<_Tp>::int_type, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = V_TypeTraits<_Tp>::reinterpret_int(a.s[i]);\n    return c;\n}\n\ntemplate<typename _Tp, int n> inline v_reg<typename V_TypeTraits<_Tp>::uint_type, n>\n    v_reinterpret_as_uint(const v_reg<_Tp, n>& a)\n{\n    v_reg<typename V_TypeTraits<_Tp>::uint_type, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = V_TypeTraits<_Tp>::reinterpret_uint(a.s[i]);\n    return c;\n}\n//! @endcond\n\n/** @brief Interleave two vectors\n\nScheme:\n@code\n  {A1 A2 A3 A4}\n  {B1 B2 B3 B4}\n---------------\n  {A1 B1 A2 B2} and {A3 B3 A4 B4}\n@endcode\nFor all types except 64-bit.\n*/\ntemplate<typename _Tp, int n> inline void v_zip( const v_reg<_Tp, n>& a0, const v_reg<_Tp, n>& a1,\n                                               v_reg<_Tp, n>& b0, v_reg<_Tp, n>& b1 )\n{\n    int i;\n    for( i = 0; i < n/2; i++ )\n    {\n        b0.s[i*2] = a0.s[i];\n        b0.s[i*2+1] = a1.s[i];\n    }\n    for( ; i < n; i++ )\n    {\n        b1.s[i*2-n] = a0.s[i];\n        b1.s[i*2-n+1] = a1.s[i];\n    }\n}\n\n/** @brief Load register contents from memory\n\n@param ptr pointer to memory block with data\n@return register object\n\n@note Returned type will be detected from passed pointer type, for example uchar ==> cv::v_uint8x16, int ==> cv::v_int32x4, etc.\n\n@note Use vx_load version to get maximum available register length result\n\n@note Alignment requirement:\nif CV_STRONG_ALIGNMENT=1 then passed pointer must be aligned (`sizeof(lane type)` should be enough).\nDo not cast pointer types without runtime check for pointer alignment (like `uchar*` => `int*`).\n */\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_load(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    return v_reg<_Tp, simd128_width / sizeof(_Tp)>(ptr);\n}\n\n#if CV_SIMD256\n/** @brief Load 256-bit length register contents from memory\n\n@param ptr pointer to memory block with data\n@return register object\n\n@note Returned type will be detected from passed pointer type, for example uchar ==> cv::v_uint8x32, int ==> cv::v_int32x8, etc.\n\n@note Check CV_SIMD256 preprocessor definition prior to use.\nUse vx_load version to get maximum available register length result\n\n@note Alignment requirement:\nif CV_STRONG_ALIGNMENT=1 then passed pointer must be aligned (`sizeof(lane type)` should be enough).\nDo not cast pointer types without runtime check for pointer alignment (like `uchar*` => `int*`).\n */\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd256_width / sizeof(_Tp)> v256_load(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    return v_reg<_Tp, simd256_width / sizeof(_Tp)>(ptr);\n}\n#endif\n\n#if CV_SIMD512\n/** @brief Load 512-bit length register contents from memory\n\n@param ptr pointer to memory block with data\n@return register object\n\n@note Returned type will be detected from passed pointer type, for example uchar ==> cv::v_uint8x64, int ==> cv::v_int32x16, etc.\n\n@note Check CV_SIMD512 preprocessor definition prior to use.\nUse vx_load version to get maximum available register length result\n\n@note Alignment requirement:\nif CV_STRONG_ALIGNMENT=1 then passed pointer must be aligned (`sizeof(lane type)` should be enough).\nDo not cast pointer types without runtime check for pointer alignment (like `uchar*` => `int*`).\n */\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd512_width / sizeof(_Tp)> v512_load(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    return v_reg<_Tp, simd512_width / sizeof(_Tp)>(ptr);\n}\n#endif\n\n/** @brief Load register contents from memory (aligned)\n\nsimilar to cv::v_load, but source memory block should be aligned (to 16-byte boundary in case of SIMD128, 32-byte - SIMD256, etc)\n\n@note Use vx_load_aligned version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_load_aligned(const _Tp* ptr)\n{\n    CV_Assert(isAligned<sizeof(v_reg<_Tp, simd128_width / sizeof(_Tp)>)>(ptr));\n    return v_reg<_Tp, simd128_width / sizeof(_Tp)>(ptr);\n}\n\n#if CV_SIMD256\n/** @brief Load register contents from memory (aligned)\n\nsimilar to cv::v256_load, but source memory block should be aligned (to 32-byte boundary in case of SIMD256, 64-byte - SIMD512, etc)\n\n@note Check CV_SIMD256 preprocessor definition prior to use.\nUse vx_load_aligned version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd256_width / sizeof(_Tp)> v256_load_aligned(const _Tp* ptr)\n{\n    CV_Assert(isAligned<sizeof(v_reg<_Tp, simd256_width / sizeof(_Tp)>)>(ptr));\n    return v_reg<_Tp, simd256_width / sizeof(_Tp)>(ptr);\n}\n#endif\n\n#if CV_SIMD512\n/** @brief Load register contents from memory (aligned)\n\nsimilar to cv::v512_load, but source memory block should be aligned (to 64-byte boundary in case of SIMD512, etc)\n\n@note Check CV_SIMD512 preprocessor definition prior to use.\nUse vx_load_aligned version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd512_width / sizeof(_Tp)> v512_load_aligned(const _Tp* ptr)\n{\n    CV_Assert(isAligned<sizeof(v_reg<_Tp, simd512_width / sizeof(_Tp)>)>(ptr));\n    return v_reg<_Tp, simd512_width / sizeof(_Tp)>(ptr);\n}\n#endif\n\n/** @brief Load 64-bits of data to lower part (high part is undefined).\n\n@param ptr memory block containing data for first half (0..n/2)\n\n@code{.cpp}\nint lo[2] = { 1, 2 };\nv_int32x4 r = v_load_low(lo);\n@endcode\n\n@note Use vx_load_low version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_load_low(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    v_reg<_Tp, simd128_width / sizeof(_Tp)> c;\n    for( int i = 0; i < c.nlanes/2; i++ )\n    {\n        c.s[i] = ptr[i];\n    }\n    return c;\n}\n\n#if CV_SIMD256\n/** @brief Load 128-bits of data to lower part (high part is undefined).\n\n@param ptr memory block containing data for first half (0..n/2)\n\n@code{.cpp}\nint lo[4] = { 1, 2, 3, 4 };\nv_int32x8 r = v256_load_low(lo);\n@endcode\n\n@note Check CV_SIMD256 preprocessor definition prior to use.\nUse vx_load_low version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd256_width / sizeof(_Tp)> v256_load_low(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    v_reg<_Tp, simd256_width / sizeof(_Tp)> c;\n    for (int i = 0; i < c.nlanes / 2; i++)\n    {\n        c.s[i] = ptr[i];\n    }\n    return c;\n}\n#endif\n\n#if CV_SIMD512\n/** @brief Load 256-bits of data to lower part (high part is undefined).\n\n@param ptr memory block containing data for first half (0..n/2)\n\n@code{.cpp}\nint lo[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };\nv_int32x16 r = v512_load_low(lo);\n@endcode\n\n@note Check CV_SIMD512 preprocessor definition prior to use.\nUse vx_load_low version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd512_width / sizeof(_Tp)> v512_load_low(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    v_reg<_Tp, simd512_width / sizeof(_Tp)> c;\n    for (int i = 0; i < c.nlanes / 2; i++)\n    {\n        c.s[i] = ptr[i];\n    }\n    return c;\n}\n#endif\n\n/** @brief Load register contents from two memory blocks\n\n@param loptr memory block containing data for first half (0..n/2)\n@param hiptr memory block containing data for second half (n/2..n)\n\n@code{.cpp}\nint lo[2] = { 1, 2 }, hi[2] = { 3, 4 };\nv_int32x4 r = v_load_halves(lo, hi);\n@endcode\n\n@note Use vx_load_halves version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_load_halves(const _Tp* loptr, const _Tp* hiptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(loptr));\n    CV_Assert(isAligned<sizeof(_Tp)>(hiptr));\n#endif\n    v_reg<_Tp, simd128_width / sizeof(_Tp)> c;\n    for( int i = 0; i < c.nlanes/2; i++ )\n    {\n        c.s[i] = loptr[i];\n        c.s[i+c.nlanes/2] = hiptr[i];\n    }\n    return c;\n}\n\n#if CV_SIMD256\n/** @brief Load register contents from two memory blocks\n\n@param loptr memory block containing data for first half (0..n/2)\n@param hiptr memory block containing data for second half (n/2..n)\n\n@code{.cpp}\nint lo[4] = { 1, 2, 3, 4 }, hi[4] = { 5, 6, 7, 8 };\nv_int32x8 r = v256_load_halves(lo, hi);\n@endcode\n\n@note Check CV_SIMD256 preprocessor definition prior to use.\nUse vx_load_halves version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd256_width / sizeof(_Tp)> v256_load_halves(const _Tp* loptr, const _Tp* hiptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(loptr));\n    CV_Assert(isAligned<sizeof(_Tp)>(hiptr));\n#endif\n    v_reg<_Tp, simd256_width / sizeof(_Tp)> c;\n    for (int i = 0; i < c.nlanes / 2; i++)\n    {\n        c.s[i] = loptr[i];\n        c.s[i + c.nlanes / 2] = hiptr[i];\n    }\n    return c;\n}\n#endif\n\n#if CV_SIMD512\n/** @brief Load register contents from two memory blocks\n\n@param loptr memory block containing data for first half (0..n/2)\n@param hiptr memory block containing data for second half (n/2..n)\n\n@code{.cpp}\nint lo[4] = { 1, 2, 3, 4, 5, 6, 7, 8 }, hi[4] = { 9, 10, 11, 12, 13, 14, 15, 16 };\nv_int32x16 r = v512_load_halves(lo, hi);\n@endcode\n\n@note Check CV_SIMD512 preprocessor definition prior to use.\nUse vx_load_halves version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<_Tp, simd512_width / sizeof(_Tp)> v512_load_halves(const _Tp* loptr, const _Tp* hiptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(loptr));\n    CV_Assert(isAligned<sizeof(_Tp)>(hiptr));\n#endif\n    v_reg<_Tp, simd512_width / sizeof(_Tp)> c;\n    for (int i = 0; i < c.nlanes / 2; i++)\n    {\n        c.s[i] = loptr[i];\n        c.s[i + c.nlanes / 2] = hiptr[i];\n    }\n    return c;\n}\n#endif\n\n/** @brief Load register contents from memory with double expand\n\nSame as cv::v_load, but result pack type will be 2x wider than memory type.\n\n@code{.cpp}\nshort buf[4] = {1, 2, 3, 4}; // type is int16\nv_int32x4 r = v_load_expand(buf); // r = {1, 2, 3, 4} - type is int32\n@endcode\nFor 8-, 16-, 32-bit integer source types.\n\n@note Use vx_load_expand version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<typename V_TypeTraits<_Tp>::w_type, simd128_width / sizeof(typename V_TypeTraits<_Tp>::w_type)>\nv_load_expand(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    typedef typename V_TypeTraits<_Tp>::w_type w_type;\n    v_reg<w_type, simd128_width / sizeof(w_type)> c;\n    for( int i = 0; i < c.nlanes; i++ )\n    {\n        c.s[i] = ptr[i];\n    }\n    return c;\n}\n\n#if CV_SIMD256\n/** @brief Load register contents from memory with double expand\n\nSame as cv::v256_load, but result pack type will be 2x wider than memory type.\n\n@code{.cpp}\nshort buf[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // type is int16\nv_int32x8 r = v256_load_expand(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8} - type is int32\n@endcode\nFor 8-, 16-, 32-bit integer source types.\n\n@note Check CV_SIMD256 preprocessor definition prior to use.\nUse vx_load_expand version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<typename V_TypeTraits<_Tp>::w_type, simd256_width / sizeof(typename V_TypeTraits<_Tp>::w_type)>\nv256_load_expand(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    typedef typename V_TypeTraits<_Tp>::w_type w_type;\n    v_reg<w_type, simd256_width / sizeof(w_type)> c;\n    for (int i = 0; i < c.nlanes; i++)\n    {\n        c.s[i] = ptr[i];\n    }\n    return c;\n}\n#endif\n\n#if CV_SIMD512\n/** @brief Load register contents from memory with double expand\n\nSame as cv::v512_load, but result pack type will be 2x wider than memory type.\n\n@code{.cpp}\nshort buf[8] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; // type is int16\nv_int32x16 r = v512_load_expand(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} - type is int32\n@endcode\nFor 8-, 16-, 32-bit integer source types.\n\n@note Check CV_SIMD512 preprocessor definition prior to use.\nUse vx_load_expand version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<typename V_TypeTraits<_Tp>::w_type, simd512_width / sizeof(typename V_TypeTraits<_Tp>::w_type)>\nv512_load_expand(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    typedef typename V_TypeTraits<_Tp>::w_type w_type;\n    v_reg<w_type, simd512_width / sizeof(w_type)> c;\n    for (int i = 0; i < c.nlanes; i++)\n    {\n        c.s[i] = ptr[i];\n    }\n    return c;\n}\n#endif\n\n/** @brief Load register contents from memory with quad expand\n\nSame as cv::v_load_expand, but result type is 4 times wider than source.\n@code{.cpp}\nchar buf[4] = {1, 2, 3, 4}; // type is int8\nv_int32x4 r = v_load_expand_q(buf); // r = {1, 2, 3, 4} - type is int32\n@endcode\nFor 8-bit integer source types.\n\n@note Use vx_load_expand_q version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<typename V_TypeTraits<_Tp>::q_type, simd128_width / sizeof(typename V_TypeTraits<_Tp>::q_type)>\nv_load_expand_q(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    typedef typename V_TypeTraits<_Tp>::q_type q_type;\n    v_reg<q_type, simd128_width / sizeof(q_type)> c;\n    for( int i = 0; i < c.nlanes; i++ )\n    {\n        c.s[i] = ptr[i];\n    }\n    return c;\n}\n\n#if CV_SIMD256\n/** @brief Load register contents from memory with quad expand\n\nSame as cv::v256_load_expand, but result type is 4 times wider than source.\n@code{.cpp}\nchar buf[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // type is int8\nv_int32x8 r = v256_load_expand_q(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8} - type is int32\n@endcode\nFor 8-bit integer source types.\n\n@note Check CV_SIMD256 preprocessor definition prior to use.\nUse vx_load_expand_q version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<typename V_TypeTraits<_Tp>::q_type, simd256_width / sizeof(typename V_TypeTraits<_Tp>::q_type)>\nv256_load_expand_q(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    typedef typename V_TypeTraits<_Tp>::q_type q_type;\n    v_reg<q_type, simd256_width / sizeof(q_type)> c;\n    for (int i = 0; i < c.nlanes; i++)\n    {\n        c.s[i] = ptr[i];\n    }\n    return c;\n}\n#endif\n\n#if CV_SIMD512\n/** @brief Load register contents from memory with quad expand\n\nSame as cv::v512_load_expand, but result type is 4 times wider than source.\n@code{.cpp}\nchar buf[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; // type is int8\nv_int32x16 r = v512_load_expand_q(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} - type is int32\n@endcode\nFor 8-bit integer source types.\n\n@note Check CV_SIMD512 preprocessor definition prior to use.\nUse vx_load_expand_q version to get maximum available register length result\n*/\ntemplate<typename _Tp>\ninline v_reg<typename V_TypeTraits<_Tp>::q_type, simd512_width / sizeof(typename V_TypeTraits<_Tp>::q_type)>\nv512_load_expand_q(const _Tp* ptr)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    typedef typename V_TypeTraits<_Tp>::q_type q_type;\n    v_reg<q_type, simd512_width / sizeof(q_type)> c;\n    for (int i = 0; i < c.nlanes; i++)\n    {\n        c.s[i] = ptr[i];\n    }\n    return c;\n}\n#endif\n\n/** @brief Load and deinterleave (2 channels)\n\nLoad data from memory deinterleave and store to 2 registers.\nScheme:\n@code\n{A1 B1 A2 B2 ...} ==> {A1 A2 ...}, {B1 B2 ...}\n@endcode\nFor all types except 64-bit. */\ntemplate<typename _Tp, int n> inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a,\n                                                            v_reg<_Tp, n>& b)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    int i, i2;\n    for( i = i2 = 0; i < n; i++, i2 += 2 )\n    {\n        a.s[i] = ptr[i2];\n        b.s[i] = ptr[i2+1];\n    }\n}\n\n/** @brief Load and deinterleave (3 channels)\n\nLoad data from memory deinterleave and store to 3 registers.\nScheme:\n@code\n{A1 B1 C1 A2 B2 C2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}\n@endcode\nFor all types except 64-bit. */\ntemplate<typename _Tp, int n> inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a,\n                                                            v_reg<_Tp, n>& b, v_reg<_Tp, n>& c)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    int i, i3;\n    for( i = i3 = 0; i < n; i++, i3 += 3 )\n    {\n        a.s[i] = ptr[i3];\n        b.s[i] = ptr[i3+1];\n        c.s[i] = ptr[i3+2];\n    }\n}\n\n/** @brief Load and deinterleave (4 channels)\n\nLoad data from memory deinterleave and store to 4 registers.\nScheme:\n@code\n{A1 B1 C1 D1 A2 B2 C2 D2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...}\n@endcode\nFor all types except 64-bit. */\ntemplate<typename _Tp, int n>\ninline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a,\n                                v_reg<_Tp, n>& b, v_reg<_Tp, n>& c,\n                                v_reg<_Tp, n>& d)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    int i, i4;\n    for( i = i4 = 0; i < n; i++, i4 += 4 )\n    {\n        a.s[i] = ptr[i4];\n        b.s[i] = ptr[i4+1];\n        c.s[i] = ptr[i4+2];\n        d.s[i] = ptr[i4+3];\n    }\n}\n\n/** @brief Interleave and store (2 channels)\n\nInterleave and store data from 2 registers to memory.\nScheme:\n@code\n{A1 A2 ...}, {B1 B2 ...} ==> {A1 B1 A2 B2 ...}\n@endcode\nFor all types except 64-bit. */\ntemplate<typename _Tp, int n>\ninline void v_store_interleave( _Tp* ptr, const v_reg<_Tp, n>& a,\n                               const v_reg<_Tp, n>& b,\n                               hal::StoreMode /*mode*/=hal::STORE_UNALIGNED)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    int i, i2;\n    for( i = i2 = 0; i < n; i++, i2 += 2 )\n    {\n        ptr[i2] = a.s[i];\n        ptr[i2+1] = b.s[i];\n    }\n}\n\n/** @brief Interleave and store (3 channels)\n\nInterleave and store data from 3 registers to memory.\nScheme:\n@code\n{A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...} ==> {A1 B1 C1 A2 B2 C2 ...}\n@endcode\nFor all types except 64-bit. */\ntemplate<typename _Tp, int n>\ninline void v_store_interleave( _Tp* ptr, const v_reg<_Tp, n>& a,\n                                const v_reg<_Tp, n>& b, const v_reg<_Tp, n>& c,\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    int i, i3;\n    for( i = i3 = 0; i < n; i++, i3 += 3 )\n    {\n        ptr[i3] = a.s[i];\n        ptr[i3+1] = b.s[i];\n        ptr[i3+2] = c.s[i];\n    }\n}\n\n/** @brief Interleave and store (4 channels)\n\nInterleave and store data from 4 registers to memory.\nScheme:\n@code\n{A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...} ==> {A1 B1 C1 D1 A2 B2 C2 D2 ...}\n@endcode\nFor all types except 64-bit. */\ntemplate<typename _Tp, int n> inline void v_store_interleave( _Tp* ptr, const v_reg<_Tp, n>& a,\n                                                            const v_reg<_Tp, n>& b, const v_reg<_Tp, n>& c,\n                                                            const v_reg<_Tp, n>& d,\n                                                            hal::StoreMode /*mode*/=hal::STORE_UNALIGNED)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    int i, i4;\n    for( i = i4 = 0; i < n; i++, i4 += 4 )\n    {\n        ptr[i4] = a.s[i];\n        ptr[i4+1] = b.s[i];\n        ptr[i4+2] = c.s[i];\n        ptr[i4+3] = d.s[i];\n    }\n}\n\n/** @brief Store data to memory\n\nStore register contents to memory.\nScheme:\n@code\n  REG {A B C D} ==> MEM {A B C D}\n@endcode\nPointer can be unaligned. */\ntemplate<typename _Tp, int n>\ninline void v_store(_Tp* ptr, const v_reg<_Tp, n>& a)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    for( int i = 0; i < n; i++ )\n        ptr[i] = a.s[i];\n}\n\ntemplate<typename _Tp, int n>\ninline void v_store(_Tp* ptr, const v_reg<_Tp, n>& a, hal::StoreMode /*mode*/)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    v_store(ptr, a);\n}\n\n/** @brief Store data to memory (lower half)\n\nStore lower half of register contents to memory.\nScheme:\n@code\n  REG {A B C D} ==> MEM {A B}\n@endcode */\ntemplate<typename _Tp, int n>\ninline void v_store_low(_Tp* ptr, const v_reg<_Tp, n>& a)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    for( int i = 0; i < (n/2); i++ )\n        ptr[i] = a.s[i];\n}\n\n/** @brief Store data to memory (higher half)\n\nStore higher half of register contents to memory.\nScheme:\n@code\n  REG {A B C D} ==> MEM {C D}\n@endcode */\ntemplate<typename _Tp, int n>\ninline void v_store_high(_Tp* ptr, const v_reg<_Tp, n>& a)\n{\n#if CV_STRONG_ALIGNMENT\n    CV_Assert(isAligned<sizeof(_Tp)>(ptr));\n#endif\n    for( int i = 0; i < (n/2); i++ )\n        ptr[i] = a.s[i+(n/2)];\n}\n\n/** @brief Store data to memory (aligned)\n\nStore register contents to memory.\nScheme:\n@code\n  REG {A B C D} ==> MEM {A B C D}\n@endcode\nPointer __should__ be aligned by 16-byte boundary. */\ntemplate<typename _Tp, int n>\ninline void v_store_aligned(_Tp* ptr, const v_reg<_Tp, n>& a)\n{\n    CV_Assert(isAligned<sizeof(v_reg<_Tp, n>)>(ptr));\n    v_store(ptr, a);\n}\n\ntemplate<typename _Tp, int n>\ninline void v_store_aligned_nocache(_Tp* ptr, const v_reg<_Tp, n>& a)\n{\n    CV_Assert(isAligned<sizeof(v_reg<_Tp, n>)>(ptr));\n    v_store(ptr, a);\n}\n\ntemplate<typename _Tp, int n>\ninline void v_store_aligned(_Tp* ptr, const v_reg<_Tp, n>& a, hal::StoreMode /*mode*/)\n{\n    CV_Assert(isAligned<sizeof(v_reg<_Tp, n>)>(ptr));\n    v_store(ptr, a);\n}\n\n/** @brief Combine vector from first elements of two vectors\n\nScheme:\n@code\n  {A1 A2 A3 A4}\n  {B1 B2 B3 B4}\n---------------\n  {A1 A2 B1 B2}\n@endcode\nFor all types except 64-bit. */\ntemplate<typename _Tp, int n>\ninline v_reg<_Tp, n> v_combine_low(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    v_reg<_Tp, n> c;\n    for( int i = 0; i < (n/2); i++ )\n    {\n        c.s[i] = a.s[i];\n        c.s[i+(n/2)] = b.s[i];\n    }\n    return c;\n}\n\n/** @brief Combine vector from last elements of two vectors\n\nScheme:\n@code\n  {A1 A2 A3 A4}\n  {B1 B2 B3 B4}\n---------------\n  {A3 A4 B3 B4}\n@endcode\nFor all types except 64-bit. */\ntemplate<typename _Tp, int n>\ninline v_reg<_Tp, n> v_combine_high(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    v_reg<_Tp, n> c;\n    for( int i = 0; i < (n/2); i++ )\n    {\n        c.s[i] = a.s[i+(n/2)];\n        c.s[i+(n/2)] = b.s[i+(n/2)];\n    }\n    return c;\n}\n\n/** @brief Combine two vectors from lower and higher parts of two other vectors\n\n@code{.cpp}\nlow = cv::v_combine_low(a, b);\nhigh = cv::v_combine_high(a, b);\n@endcode */\ntemplate<typename _Tp, int n>\ninline void v_recombine(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b,\n                        v_reg<_Tp, n>& low, v_reg<_Tp, n>& high)\n{\n    for( int i = 0; i < (n/2); i++ )\n    {\n        low.s[i] = a.s[i];\n        low.s[i+(n/2)] = b.s[i];\n        high.s[i] = a.s[i+(n/2)];\n        high.s[i+(n/2)] = b.s[i+(n/2)];\n    }\n}\n\n/** @brief Vector reverse order\n\nReverse the order of the vector\nScheme:\n@code\n  REG {A1 ... An} ==> REG {An ... A1}\n@endcode\nFor all types. */\ntemplate<typename _Tp, int n>\ninline v_reg<_Tp, n> v_reverse(const v_reg<_Tp, n>& a)\n{\n    v_reg<_Tp, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = a.s[n-i-1];\n    return c;\n}\n\n/** @brief Vector extract\n\nScheme:\n@code\n  {A1 A2 A3 A4}\n  {B1 B2 B3 B4}\n========================\nshift = 1  {A2 A3 A4 B1}\nshift = 2  {A3 A4 B1 B2}\nshift = 3  {A4 B1 B2 B3}\n@endcode\nRestriction: 0 <= shift < nlanes\n\nUsage:\n@code\nv_int32x4 a, b, c;\nc = v_extract<2>(a, b);\n@endcode\nFor all types. */\ntemplate<int s, typename _Tp, int n>\ninline v_reg<_Tp, n> v_extract(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    v_reg<_Tp, n> r;\n    const int shift = n - s;\n    int i = 0;\n    for (; i < shift; ++i)\n        r.s[i] = a.s[i+s];\n    for (; i < n; ++i)\n        r.s[i] = b.s[i-shift];\n    return r;\n}\n\n/** @brief Vector extract\n\nScheme:\nReturn the s-th element of v.\nRestriction: 0 <= s < nlanes\n\nUsage:\n@code\nv_int32x4 a;\nint r;\nr = v_extract_n<2>(a);\n@endcode\nFor all types. */\ntemplate<int s, typename _Tp, int n>\ninline _Tp v_extract_n(const v_reg<_Tp, n>& v)\n{\n    CV_DbgAssert(s >= 0 && s < n);\n    return v.s[s];\n}\n\n/** @brief Broadcast i-th element of vector\n\nScheme:\n@code\n{ v[0] v[1] v[2] ... v[SZ] } => { v[i], v[i], v[i] ... v[i] }\n@endcode\nRestriction: 0 <= i < nlanes\nSupported types: 32-bit integers and floats (s32/u32/f32)\n */\ntemplate<int i, typename _Tp, int n>\ninline v_reg<_Tp, n> v_broadcast_element(const v_reg<_Tp, n>& a)\n{\n    CV_DbgAssert(i >= 0 && i < n);\n    return v_reg<_Tp, n>::all(a.s[i]);\n}\n\n/** @brief Round elements\n\nRounds each value. Input type is float vector ==> output type is int vector.\n@note Only for floating point types.\n*/\ntemplate<int n> inline v_reg<int, n> v_round(const v_reg<float, n>& a)\n{\n    v_reg<int, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = cvRound(a.s[i]);\n    return c;\n}\n\n/** @overload */\ntemplate<int n> inline v_reg<int, n*2> v_round(const v_reg<double, n>& a, const v_reg<double, n>& b)\n{\n    v_reg<int, n*2> c;\n    for( int i = 0; i < n; i++ )\n    {\n        c.s[i] = cvRound(a.s[i]);\n        c.s[i+n] = cvRound(b.s[i]);\n    }\n    return c;\n}\n\n/** @brief Floor elements\n\nFloor each value. Input type is float vector ==> output type is int vector.\n@note Only for floating point types.\n*/\ntemplate<int n> inline v_reg<int, n> v_floor(const v_reg<float, n>& a)\n{\n    v_reg<int, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = cvFloor(a.s[i]);\n    return c;\n}\n\n/** @brief Ceil elements\n\nCeil each value. Input type is float vector ==> output type is int vector.\n@note Only for floating point types.\n*/\ntemplate<int n> inline v_reg<int, n> v_ceil(const v_reg<float, n>& a)\n{\n    v_reg<int, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = cvCeil(a.s[i]);\n    return c;\n}\n\n/** @brief Truncate elements\n\nTruncate each value. Input type is float vector ==> output type is int vector.\n@note Only for floating point types.\n*/\ntemplate<int n> inline v_reg<int, n> v_trunc(const v_reg<float, n>& a)\n{\n    v_reg<int, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = (int)(a.s[i]);\n    return c;\n}\n\n/** @overload */\ntemplate<int n> inline v_reg<int, n*2> v_round(const v_reg<double, n>& a)\n{\n    v_reg<int, n*2> c;\n    for( int i = 0; i < n; i++ )\n    {\n        c.s[i] = cvRound(a.s[i]);\n        c.s[i+n] = 0;\n    }\n    return c;\n}\n\n/** @overload */\ntemplate<int n> inline v_reg<int, n*2> v_floor(const v_reg<double, n>& a)\n{\n    v_reg<int, n*2> c;\n    for( int i = 0; i < n; i++ )\n    {\n        c.s[i] = cvFloor(a.s[i]);\n        c.s[i+n] = 0;\n    }\n    return c;\n}\n\n/** @overload */\ntemplate<int n> inline v_reg<int, n*2> v_ceil(const v_reg<double, n>& a)\n{\n    v_reg<int, n*2> c;\n    for( int i = 0; i < n; i++ )\n    {\n        c.s[i] = cvCeil(a.s[i]);\n        c.s[i+n] = 0;\n    }\n    return c;\n}\n\n/** @overload */\ntemplate<int n> inline v_reg<int, n*2> v_trunc(const v_reg<double, n>& a)\n{\n    v_reg<int, n*2> c;\n    for( int i = 0; i < n; i++ )\n    {\n        c.s[i] = (int)(a.s[i]);\n        c.s[i+n] = 0;\n    }\n    return c;\n}\n\n/** @brief Convert to float\n\nSupported input type is cv::v_int32. */\ntemplate<int n> inline v_reg<float, n> v_cvt_f32(const v_reg<int, n>& a)\n{\n    v_reg<float, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = (float)a.s[i];\n    return c;\n}\n\n/** @brief Convert lower half to float\n\nSupported input type is cv::v_float64. */\ntemplate<int n> inline v_reg<float, n*2> v_cvt_f32(const v_reg<double, n>& a)\n{\n    v_reg<float, n*2> c;\n    for( int i = 0; i < n; i++ )\n    {\n        c.s[i] = (float)a.s[i];\n        c.s[i+n] = 0;\n    }\n    return c;\n}\n\n/** @brief Convert to float\n\nSupported input type is cv::v_float64. */\ntemplate<int n> inline v_reg<float, n*2> v_cvt_f32(const v_reg<double, n>& a, const v_reg<double, n>& b)\n{\n    v_reg<float, n*2> c;\n    for( int i = 0; i < n; i++ )\n    {\n        c.s[i] = (float)a.s[i];\n        c.s[i+n] = (float)b.s[i];\n    }\n    return c;\n}\n\n/** @brief Convert lower half to double\n\nSupported input type is cv::v_int32. */\ntemplate<int n> CV_INLINE v_reg<double, n/2> v_cvt_f64(const v_reg<int, n>& a)\n{\n    v_reg<double, (n/2)> c;\n    for( int i = 0; i < (n/2); i++ )\n        c.s[i] = (double)a.s[i];\n    return c;\n}\n\n/** @brief Convert to double high part of vector\n\nSupported input type is cv::v_int32. */\ntemplate<int n> CV_INLINE v_reg<double, (n/2)> v_cvt_f64_high(const v_reg<int, n>& a)\n{\n    v_reg<double, (n/2)> c;\n    for( int i = 0; i < (n/2); i++ )\n        c.s[i] = (double)a.s[i + (n/2)];\n    return c;\n}\n\n/** @brief Convert lower half to double\n\nSupported input type is cv::v_float32. */\ntemplate<int n> CV_INLINE v_reg<double, (n/2)> v_cvt_f64(const v_reg<float, n>& a)\n{\n    v_reg<double, (n/2)> c;\n    for( int i = 0; i < (n/2); i++ )\n        c.s[i] = (double)a.s[i];\n    return c;\n}\n\n/** @brief Convert to double high part of vector\n\nSupported input type is cv::v_float32. */\ntemplate<int n> CV_INLINE v_reg<double, (n/2)> v_cvt_f64_high(const v_reg<float, n>& a)\n{\n    v_reg<double, (n/2)> c;\n    for( int i = 0; i < (n/2); i++ )\n        c.s[i] = (double)a.s[i + (n/2)];\n    return c;\n}\n\n/** @brief Convert to double\n\nSupported input type is cv::v_int64. */\ntemplate<int n> CV_INLINE v_reg<double, n> v_cvt_f64(const v_reg<int64, n>& a)\n{\n    v_reg<double, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = (double)a.s[i];\n    return c;\n}\n\n\ntemplate<typename _Tp> inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_lut(const _Tp* tab, const int* idx)\n{\n    v_reg<_Tp, simd128_width / sizeof(_Tp)> c;\n    for (int i = 0; i < c.nlanes; i++)\n        c.s[i] = tab[idx[i]];\n    return c;\n}\ntemplate<typename _Tp> inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_lut_pairs(const _Tp* tab, const int* idx)\n{\n    v_reg<_Tp, simd128_width / sizeof(_Tp)> c;\n    for (int i = 0; i < c.nlanes; i++)\n        c.s[i] = tab[idx[i / 2] + i % 2];\n    return c;\n}\ntemplate<typename _Tp> inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_lut_quads(const _Tp* tab, const int* idx)\n{\n    v_reg<_Tp, simd128_width / sizeof(_Tp)> c;\n    for (int i = 0; i < c.nlanes; i++)\n        c.s[i] = tab[idx[i / 4] + i % 4];\n    return c;\n}\n\ntemplate<int n> inline v_reg<int, n> v_lut(const int* tab, const v_reg<int, n>& idx)\n{\n    v_reg<int, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = tab[idx.s[i]];\n    return c;\n}\n\ntemplate<int n> inline v_reg<unsigned, n> v_lut(const unsigned* tab, const v_reg<int, n>& idx)\n{\n    v_reg<int, n> c;\n    for (int i = 0; i < n; i++)\n        c.s[i] = tab[idx.s[i]];\n    return c;\n}\n\ntemplate<int n> inline v_reg<float, n> v_lut(const float* tab, const v_reg<int, n>& idx)\n{\n    v_reg<float, n> c;\n    for( int i = 0; i < n; i++ )\n        c.s[i] = tab[idx.s[i]];\n    return c;\n}\n\ntemplate<int n> inline v_reg<double, n/2> v_lut(const double* tab, const v_reg<int, n>& idx)\n{\n    v_reg<double, n/2> c;\n    for( int i = 0; i < n/2; i++ )\n        c.s[i] = tab[idx.s[i]];\n    return c;\n}\n\n\ntemplate<int n> inline void v_lut_deinterleave(const float* tab, const v_reg<int, n>& idx,\n                                               v_reg<float, n>& x, v_reg<float, n>& y)\n{\n    for( int i = 0; i < n; i++ )\n    {\n        int j = idx.s[i];\n        x.s[i] = tab[j];\n        y.s[i] = tab[j+1];\n    }\n}\n\ntemplate<int n> inline void v_lut_deinterleave(const double* tab, const v_reg<int, n*2>& idx,\n                                               v_reg<double, n>& x, v_reg<double, n>& y)\n{\n    for( int i = 0; i < n; i++ )\n    {\n        int j = idx.s[i];\n        x.s[i] = tab[j];\n        y.s[i] = tab[j+1];\n    }\n}\n\ntemplate<typename _Tp, int n> inline v_reg<_Tp, n> v_interleave_pairs(const v_reg<_Tp, n>& vec)\n{\n    v_reg<_Tp, n> c;\n    for (int i = 0; i < n/4; i++)\n    {\n        c.s[4*i  ] = vec.s[4*i  ];\n        c.s[4*i+1] = vec.s[4*i+2];\n        c.s[4*i+2] = vec.s[4*i+1];\n        c.s[4*i+3] = vec.s[4*i+3];\n    }\n    return c;\n}\n\ntemplate<typename _Tp, int n> inline v_reg<_Tp, n> v_interleave_quads(const v_reg<_Tp, n>& vec)\n{\n    v_reg<_Tp, n> c;\n    for (int i = 0; i < n/8; i++)\n    {\n        c.s[8*i  ] = vec.s[8*i  ];\n        c.s[8*i+1] = vec.s[8*i+4];\n        c.s[8*i+2] = vec.s[8*i+1];\n        c.s[8*i+3] = vec.s[8*i+5];\n        c.s[8*i+4] = vec.s[8*i+2];\n        c.s[8*i+5] = vec.s[8*i+6];\n        c.s[8*i+6] = vec.s[8*i+3];\n        c.s[8*i+7] = vec.s[8*i+7];\n    }\n    return c;\n}\n\ntemplate<typename _Tp, int n> inline v_reg<_Tp, n> v_pack_triplets(const v_reg<_Tp, n>& vec)\n{\n    v_reg<_Tp, n> c;\n    for (int i = 0; i < n/4; i++)\n    {\n        c.s[3*i  ] = vec.s[4*i  ];\n        c.s[3*i+1] = vec.s[4*i+1];\n        c.s[3*i+2] = vec.s[4*i+2];\n    }\n    return c;\n}\n\n/** @brief Transpose 4x4 matrix\n\nScheme:\n@code\na0  {A1 A2 A3 A4}\na1  {B1 B2 B3 B4}\na2  {C1 C2 C3 C4}\na3  {D1 D2 D3 D4}\n===============\nb0  {A1 B1 C1 D1}\nb1  {A2 B2 C2 D2}\nb2  {A3 B3 C3 D3}\nb3  {A4 B4 C4 D4}\n@endcode\n*/\ntemplate<typename _Tp, int n>\ninline void v_transpose4x4( v_reg<_Tp, n>& a0, const v_reg<_Tp, n>& a1,\n                            const v_reg<_Tp, n>& a2, const v_reg<_Tp, n>& a3,\n                            v_reg<_Tp, n>& b0, v_reg<_Tp, n>& b1,\n                            v_reg<_Tp, n>& b2, v_reg<_Tp, n>& b3 )\n{\n    for (int i = 0; i < n / 4; i++)\n    {\n        b0.s[0 + i*4] = a0.s[0 + i*4]; b0.s[1 + i*4] = a1.s[0 + i*4];\n        b0.s[2 + i*4] = a2.s[0 + i*4]; b0.s[3 + i*4] = a3.s[0 + i*4];\n        b1.s[0 + i*4] = a0.s[1 + i*4]; b1.s[1 + i*4] = a1.s[1 + i*4];\n        b1.s[2 + i*4] = a2.s[1 + i*4]; b1.s[3 + i*4] = a3.s[1 + i*4];\n        b2.s[0 + i*4] = a0.s[2 + i*4]; b2.s[1 + i*4] = a1.s[2 + i*4];\n        b2.s[2 + i*4] = a2.s[2 + i*4]; b2.s[3 + i*4] = a3.s[2 + i*4];\n        b3.s[0 + i*4] = a0.s[3 + i*4]; b3.s[1 + i*4] = a1.s[3 + i*4];\n        b3.s[2 + i*4] = a2.s[3 + i*4]; b3.s[3 + i*4] = a3.s[3 + i*4];\n    }\n}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_INIT_ZERO(_Tpvec, prefix, suffix) \\\ninline _Tpvec prefix##_setzero_##suffix() { return _Tpvec::zero(); }\n\n//! @name Init with zero\n//! @{\n//! @brief Create new vector with zero elements\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint8x16, v, u8)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int8x16, v, s8)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint16x8, v, u16)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int16x8, v, s16)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint32x4, v, u32)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int32x4, v, s32)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_float32x4, v, f32)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_float64x2, v, f64)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint64x2, v, u64)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int64x2, v, s64)\n\n#if CV_SIMD256\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint8x32, v256, u8)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int8x32, v256, s8)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint16x16, v256, u16)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int16x16, v256, s16)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint32x8, v256, u32)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int32x8, v256, s32)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_float32x8, v256, f32)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_float64x4, v256, f64)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint64x4, v256, u64)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int64x4, v256, s64)\n#endif\n\n#if CV_SIMD512\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint8x64, v512, u8)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int8x64, v512, s8)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint16x32, v512, u16)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int16x32, v512, s16)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint32x16, v512, u32)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int32x16, v512, s32)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_float32x16, v512, f32)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_float64x8, v512, f64)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_uint64x8, v512, u64)\nOPENCV_HAL_IMPL_C_INIT_ZERO(v_int64x8, v512, s64)\n#endif\n//! @}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_INIT_VAL(_Tpvec, _Tp, prefix, suffix) \\\ninline _Tpvec prefix##_setall_##suffix(_Tp val) { return _Tpvec::all(val); }\n\n//! @name Init with value\n//! @{\n//! @brief Create new vector with elements set to a specific value\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint8x16, uchar, v, u8)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int8x16, schar, v, s8)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint16x8, ushort, v, u16)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int16x8, short, v, s16)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint32x4, unsigned, v, u32)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int32x4, int, v, s32)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_float32x4, float, v, f32)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_float64x2, double, v, f64)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint64x2, uint64, v, u64)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int64x2, int64, v, s64)\n\n#if CV_SIMD256\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint8x32, uchar, v256, u8)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int8x32, schar, v256, s8)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint16x16, ushort, v256, u16)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int16x16, short, v256, s16)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint32x8, unsigned, v256, u32)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int32x8, int, v256, s32)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_float32x8, float, v256, f32)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_float64x4, double, v256, f64)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint64x4, uint64, v256, u64)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int64x4, int64, v256, s64)\n#endif\n\n#if CV_SIMD512\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint8x64, uchar, v512, u8)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int8x64, schar, v512, s8)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint16x32, ushort, v512, u16)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int16x32, short, v512, s16)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint32x16, unsigned, v512, u32)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int32x16, int, v512, s32)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_float32x16, float, v512, f32)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_float64x8, double, v512, f64)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_uint64x8, uint64, v512, u64)\nOPENCV_HAL_IMPL_C_INIT_VAL(v_int64x8, int64, v512, s64)\n#endif\n//! @}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_REINTERPRET(_Tp, suffix) \\\ntemplate<typename _Tp0, int n0> inline v_reg<_Tp, n0*sizeof(_Tp0)/sizeof(_Tp)> \\\n    v_reinterpret_as_##suffix(const v_reg<_Tp0, n0>& a) \\\n{ return a.template reinterpret_as<_Tp, n0*sizeof(_Tp0)/sizeof(_Tp)>(); }\n\n//! @name Reinterpret\n//! @{\n//! @brief Convert vector to different type without modifying underlying data.\nOPENCV_HAL_IMPL_C_REINTERPRET(uchar, u8)\nOPENCV_HAL_IMPL_C_REINTERPRET(schar, s8)\nOPENCV_HAL_IMPL_C_REINTERPRET(ushort, u16)\nOPENCV_HAL_IMPL_C_REINTERPRET(short, s16)\nOPENCV_HAL_IMPL_C_REINTERPRET(unsigned, u32)\nOPENCV_HAL_IMPL_C_REINTERPRET(int, s32)\nOPENCV_HAL_IMPL_C_REINTERPRET(float, f32)\nOPENCV_HAL_IMPL_C_REINTERPRET(double, f64)\nOPENCV_HAL_IMPL_C_REINTERPRET(uint64, u64)\nOPENCV_HAL_IMPL_C_REINTERPRET(int64, s64)\n//! @}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_SHIFTL(_Tp) \\\ntemplate<int shift, int n> inline v_reg<_Tp, n> v_shl(const v_reg<_Tp, n>& a) \\\n{ return a << shift; }\n\n//! @name Left shift\n//! @{\n//! @brief Shift left\nOPENCV_HAL_IMPL_C_SHIFTL(ushort)\nOPENCV_HAL_IMPL_C_SHIFTL(short)\nOPENCV_HAL_IMPL_C_SHIFTL(unsigned)\nOPENCV_HAL_IMPL_C_SHIFTL(int)\nOPENCV_HAL_IMPL_C_SHIFTL(uint64)\nOPENCV_HAL_IMPL_C_SHIFTL(int64)\n//! @}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_SHIFTR(_Tp) \\\ntemplate<int shift, int n> inline v_reg<_Tp, n> v_shr(const v_reg<_Tp, n>& a) \\\n{ return a >> shift; }\n\n//! @name Right shift\n//! @{\n//! @brief Shift right\nOPENCV_HAL_IMPL_C_SHIFTR(ushort)\nOPENCV_HAL_IMPL_C_SHIFTR(short)\nOPENCV_HAL_IMPL_C_SHIFTR(unsigned)\nOPENCV_HAL_IMPL_C_SHIFTR(int)\nOPENCV_HAL_IMPL_C_SHIFTR(uint64)\nOPENCV_HAL_IMPL_C_SHIFTR(int64)\n//! @}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_RSHIFTR(_Tp) \\\ntemplate<int shift, int n> inline v_reg<_Tp, n> v_rshr(const v_reg<_Tp, n>& a) \\\n{ \\\n    v_reg<_Tp, n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n        c.s[i] = (_Tp)((a.s[i] + ((_Tp)1 << (shift - 1))) >> shift); \\\n    return c; \\\n}\n\n//! @name Rounding shift\n//! @{\n//! @brief Rounding shift right\nOPENCV_HAL_IMPL_C_RSHIFTR(ushort)\nOPENCV_HAL_IMPL_C_RSHIFTR(short)\nOPENCV_HAL_IMPL_C_RSHIFTR(unsigned)\nOPENCV_HAL_IMPL_C_RSHIFTR(int)\nOPENCV_HAL_IMPL_C_RSHIFTR(uint64)\nOPENCV_HAL_IMPL_C_RSHIFTR(int64)\n//! @}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_PACK(_Tp, _Tpn, pack_suffix, cast) \\\ntemplate<int n> inline v_reg<_Tpn, 2*n> v_##pack_suffix(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    v_reg<_Tpn, 2*n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n    { \\\n        c.s[i] = cast<_Tpn>(a.s[i]); \\\n        c.s[i+n] = cast<_Tpn>(b.s[i]); \\\n    } \\\n    return c; \\\n}\n\n//! @name Pack\n//! @{\n//! @brief Pack values from two vectors to one\n//!\n//! Return vector type have twice more elements than input vector types. Variant with _u_ suffix also\n//! converts to corresponding unsigned type.\n//!\n//! - pack: for 16-, 32- and 64-bit integer input types\n//! - pack_u: for 16- and 32-bit signed integer input types\n//!\n//! @note All variants except 64-bit use saturation.\nOPENCV_HAL_IMPL_C_PACK(ushort, uchar, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK(short, schar, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK(unsigned, ushort, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK(int, short, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK(uint64, unsigned, pack, static_cast)\nOPENCV_HAL_IMPL_C_PACK(int64, int, pack, static_cast)\nOPENCV_HAL_IMPL_C_PACK(short, uchar, pack_u, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK(int, ushort, pack_u, saturate_cast)\n//! @}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_RSHR_PACK(_Tp, _Tpn, pack_suffix, cast) \\\ntemplate<int shift, int n> inline v_reg<_Tpn, 2*n> v_rshr_##pack_suffix(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \\\n{ \\\n    v_reg<_Tpn, 2*n> c; \\\n    for( int i = 0; i < n; i++ ) \\\n    { \\\n        c.s[i] = cast<_Tpn>((a.s[i] + ((_Tp)1 << (shift - 1))) >> shift); \\\n        c.s[i+n] = cast<_Tpn>((b.s[i] + ((_Tp)1 << (shift - 1))) >> shift); \\\n    } \\\n    return c; \\\n}\n\n//! @name Pack with rounding shift\n//! @{\n//! @brief Pack values from two vectors to one with rounding shift\n//!\n//! Values from the input vectors will be shifted right by _n_ bits with rounding, converted to narrower\n//! type and returned in the result vector. Variant with _u_ suffix converts to unsigned type.\n//!\n//! - pack: for 16-, 32- and 64-bit integer input types\n//! - pack_u: for 16- and 32-bit signed integer input types\n//!\n//! @note All variants except 64-bit use saturation.\nOPENCV_HAL_IMPL_C_RSHR_PACK(ushort, uchar, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK(short, schar, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK(unsigned, ushort, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK(int, short, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK(uint64, unsigned, pack, static_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK(int64, int, pack, static_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK(short, uchar, pack_u, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK(int, ushort, pack_u, saturate_cast)\n//! @}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_PACK_STORE(_Tp, _Tpn, pack_suffix, cast) \\\ntemplate<int n> inline void v_##pack_suffix##_store(_Tpn* ptr, const v_reg<_Tp, n>& a) \\\n{ \\\n    for( int i = 0; i < n; i++ ) \\\n        ptr[i] = cast<_Tpn>(a.s[i]); \\\n}\n\n//! @name Pack and store\n//! @{\n//! @brief Store values from the input vector into memory with pack\n//!\n//! Values will be stored into memory with conversion to narrower type.\n//! Variant with _u_ suffix converts to corresponding unsigned type.\n//!\n//! - pack: for 16-, 32- and 64-bit integer input types\n//! - pack_u: for 16- and 32-bit signed integer input types\n//!\n//! @note All variants except 64-bit use saturation.\nOPENCV_HAL_IMPL_C_PACK_STORE(ushort, uchar, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK_STORE(short, schar, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK_STORE(unsigned, ushort, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK_STORE(int, short, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK_STORE(uint64, unsigned, pack, static_cast)\nOPENCV_HAL_IMPL_C_PACK_STORE(int64, int, pack, static_cast)\nOPENCV_HAL_IMPL_C_PACK_STORE(short, uchar, pack_u, saturate_cast)\nOPENCV_HAL_IMPL_C_PACK_STORE(int, ushort, pack_u, saturate_cast)\n//! @}\n\n//! @brief Helper macro\n//! @ingroup core_hal_intrin_impl\n#define OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(_Tp, _Tpn, pack_suffix, cast) \\\ntemplate<int shift, int n> inline void v_rshr_##pack_suffix##_store(_Tpn* ptr, const v_reg<_Tp, n>& a) \\\n{ \\\n    for( int i = 0; i < n; i++ ) \\\n        ptr[i] = cast<_Tpn>((a.s[i] + ((_Tp)1 << (shift - 1))) >> shift); \\\n}\n\n//! @name Pack and store with rounding shift\n//! @{\n//! @brief Store values from the input vector into memory with pack\n//!\n//! Values will be shifted _n_ bits right with rounding, converted to narrower type and stored into\n//! memory. Variant with _u_ suffix converts to unsigned type.\n//!\n//! - pack: for 16-, 32- and 64-bit integer input types\n//! - pack_u: for 16- and 32-bit signed integer input types\n//!\n//! @note All variants except 64-bit use saturation.\nOPENCV_HAL_IMPL_C_RSHR_PACK_STORE(ushort, uchar, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK_STORE(short, schar, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK_STORE(unsigned, ushort, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK_STORE(int, short, pack, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK_STORE(uint64, unsigned, pack, static_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK_STORE(int64, int, pack, static_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK_STORE(short, uchar, pack_u, saturate_cast)\nOPENCV_HAL_IMPL_C_RSHR_PACK_STORE(int, ushort, pack_u, saturate_cast)\n//! @}\n\n//! @cond IGNORED\ntemplate<typename _Tpm, typename _Tp, int n>\ninline void _pack_b(_Tpm* mptr, const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b)\n{\n    for (int i = 0; i < n; ++i)\n    {\n        mptr[i] = (_Tpm)a.s[i];\n        mptr[i + n] = (_Tpm)b.s[i];\n    }\n}\n//! @endcond\n\n//! @name Pack boolean values\n//! @{\n//! @brief Pack boolean values from multiple vectors to one unsigned 8-bit integer vector\n//!\n//! @note Must provide valid boolean values to guarantee same result for all architectures.\n\n/** @brief\n//! For 16-bit boolean values\n\nScheme:\n@code\na  {0xFFFF 0 0 0xFFFF 0 0xFFFF 0xFFFF 0}\nb  {0xFFFF 0 0xFFFF 0 0 0xFFFF 0 0xFFFF}\n===============\n{\n   0xFF 0 0 0xFF 0 0xFF 0xFF 0\n   0xFF 0 0xFF 0 0 0xFF 0 0xFF\n}\n@endcode */\n\ntemplate<int n> inline v_reg<uchar, 2*n> v_pack_b(const v_reg<ushort, n>& a, const v_reg<ushort, n>& b)\n{\n    v_reg<uchar, 2*n> mask;\n    _pack_b(mask.s, a, b);\n    return mask;\n}\n\n/** @overload\nFor 32-bit boolean values\n\nScheme:\n@code\na  {0xFFFF.. 0 0 0xFFFF..}\nb  {0 0xFFFF.. 0xFFFF.. 0}\nc  {0xFFFF.. 0 0xFFFF.. 0}\nd  {0 0xFFFF.. 0 0xFFFF..}\n===============\n{\n   0xFF 0 0 0xFF 0 0xFF 0xFF 0\n   0xFF 0 0xFF 0 0 0xFF 0 0xFF\n}\n@endcode */\n\ntemplate<int n> inline v_reg<uchar, 4*n> v_pack_b(const v_reg<unsigned, n>& a, const v_reg<unsigned, n>& b,\n                                                  const v_reg<unsigned, n>& c, const v_reg<unsigned, n>& d)\n{\n    v_reg<uchar, 4*n> mask;\n    _pack_b(mask.s, a, b);\n    _pack_b(mask.s + 2*n, c, d);\n    return mask;\n}\n\n/** @overload\nFor 64-bit boolean values\n\nScheme:\n@code\na  {0xFFFF.. 0}\nb  {0 0xFFFF..}\nc  {0xFFFF.. 0}\nd  {0 0xFFFF..}\n\ne  {0xFFFF.. 0}\nf  {0xFFFF.. 0}\ng  {0 0xFFFF..}\nh  {0 0xFFFF..}\n===============\n{\n   0xFF 0 0 0xFF 0xFF 0 0 0xFF\n   0xFF 0 0xFF 0 0 0xFF 0 0xFF\n}\n@endcode */\ntemplate<int n> inline v_reg<uchar, 8*n> v_pack_b(const v_reg<uint64, n>& a, const v_reg<uint64, n>& b,\n                                                  const v_reg<uint64, n>& c, const v_reg<uint64, n>& d,\n                                                  const v_reg<uint64, n>& e, const v_reg<uint64, n>& f,\n                                                  const v_reg<uint64, n>& g, const v_reg<uint64, n>& h)\n{\n    v_reg<uchar, 8*n> mask;\n    _pack_b(mask.s, a, b);\n    _pack_b(mask.s + 2*n, c, d);\n    _pack_b(mask.s + 4*n, e, f);\n    _pack_b(mask.s + 6*n, g, h);\n    return mask;\n}\n//! @}\n\n/** @brief Matrix multiplication\n\nScheme:\n@code\n{A0 A1 A2 A3}   |V0|\n{B0 B1 B2 B3}   |V1|\n{C0 C1 C2 C3}   |V2|\n{D0 D1 D2 D3} x |V3|\n====================\n{R0 R1 R2 R3}, where:\nR0 = A0V0 + B0V1 + C0V2 + D0V3,\nR1 = A1V0 + B1V1 + C1V2 + D1V3\n...\n@endcode\n*/\ntemplate<int n>\ninline v_reg<float, n> v_matmul(const v_reg<float, n>& v,\n                                const v_reg<float, n>& a, const v_reg<float, n>& b,\n                                const v_reg<float, n>& c, const v_reg<float, n>& d)\n{\n    v_reg<float, n> res;\n    for (int i = 0; i < n / 4; i++)\n    {\n        res.s[0 + i*4] = v.s[0 + i*4] * a.s[0 + i*4] + v.s[1 + i*4] * b.s[0 + i*4] + v.s[2 + i*4] * c.s[0 + i*4] + v.s[3 + i*4] * d.s[0 + i*4];\n        res.s[1 + i*4] = v.s[0 + i*4] * a.s[1 + i*4] + v.s[1 + i*4] * b.s[1 + i*4] + v.s[2 + i*4] * c.s[1 + i*4] + v.s[3 + i*4] * d.s[1 + i*4];\n        res.s[2 + i*4] = v.s[0 + i*4] * a.s[2 + i*4] + v.s[1 + i*4] * b.s[2 + i*4] + v.s[2 + i*4] * c.s[2 + i*4] + v.s[3 + i*4] * d.s[2 + i*4];\n        res.s[3 + i*4] = v.s[0 + i*4] * a.s[3 + i*4] + v.s[1 + i*4] * b.s[3 + i*4] + v.s[2 + i*4] * c.s[3 + i*4] + v.s[3 + i*4] * d.s[3 + i*4];\n    }\n    return res;\n}\n\n/** @brief Matrix multiplication and add\n\nScheme:\n@code\n{A0 A1 A2 A3}   |V0|   |D0|\n{B0 B1 B2 B3}   |V1|   |D1|\n{C0 C1 C2 C3} x |V2| + |D2|\n====================   |D3|\n{R0 R1 R2 R3}, where:\nR0 = A0V0 + B0V1 + C0V2 + D0,\nR1 = A1V0 + B1V1 + C1V2 + D1\n...\n@endcode\n*/\ntemplate<int n>\ninline v_reg<float, n> v_matmuladd(const v_reg<float, n>& v,\n                                   const v_reg<float, n>& a, const v_reg<float, n>& b,\n                                   const v_reg<float, n>& c, const v_reg<float, n>& d)\n{\n    v_reg<float, n> res;\n    for (int i = 0; i < n / 4; i++)\n    {\n        res.s[0 + i * 4] = v.s[0 + i * 4] * a.s[0 + i * 4] + v.s[1 + i * 4] * b.s[0 + i * 4] + v.s[2 + i * 4] * c.s[0 + i * 4] + d.s[0 + i * 4];\n        res.s[1 + i * 4] = v.s[0 + i * 4] * a.s[1 + i * 4] + v.s[1 + i * 4] * b.s[1 + i * 4] + v.s[2 + i * 4] * c.s[1 + i * 4] + d.s[1 + i * 4];\n        res.s[2 + i * 4] = v.s[0 + i * 4] * a.s[2 + i * 4] + v.s[1 + i * 4] * b.s[2 + i * 4] + v.s[2 + i * 4] * c.s[2 + i * 4] + d.s[2 + i * 4];\n        res.s[3 + i * 4] = v.s[0 + i * 4] * a.s[3 + i * 4] + v.s[1 + i * 4] * b.s[3 + i * 4] + v.s[2 + i * 4] * c.s[3 + i * 4] + d.s[3 + i * 4];\n    }\n    return res;\n}\n\n\ntemplate<int n> inline v_reg<double, n/2> v_dotprod_expand(const v_reg<int, n>& a, const v_reg<int, n>& b)\n{ return v_fma(v_cvt_f64(a), v_cvt_f64(b), v_cvt_f64_high(a) * v_cvt_f64_high(b)); }\ntemplate<int n> inline v_reg<double, n/2> v_dotprod_expand(const v_reg<int, n>& a, const v_reg<int, n>& b,\n                                                           const v_reg<double, n/2>& c)\n{ return v_fma(v_cvt_f64(a), v_cvt_f64(b), v_fma(v_cvt_f64_high(a), v_cvt_f64_high(b), c)); }\n\ntemplate<int n> inline v_reg<double, n/2> v_dotprod_expand_fast(const v_reg<int, n>& a, const v_reg<int, n>& b)\n{ return v_dotprod_expand(a, b); }\ntemplate<int n> inline v_reg<double, n/2> v_dotprod_expand_fast(const v_reg<int, n>& a, const v_reg<int, n>& b,\n                                                                const v_reg<double, n/2>& c)\n{ return v_dotprod_expand(a, b, c); }\n\n////// FP16 support ///////\n\ninline v_reg<float, simd128_width / sizeof(float)>\nv_load_expand(const float16_t* ptr)\n{\n    v_reg<float, simd128_width / sizeof(float)> v;\n    for( int i = 0; i < v.nlanes; i++ )\n    {\n        v.s[i] = ptr[i];\n    }\n    return v;\n}\n#if CV_SIMD256\ninline v_reg<float, simd256_width / sizeof(float)>\nv256_load_expand(const float16_t* ptr)\n{\n    v_reg<float, simd256_width / sizeof(float)> v;\n    for (int i = 0; i < v.nlanes; i++)\n    {\n        v.s[i] = ptr[i];\n    }\n    return v;\n}\n#endif\n#if CV_SIMD512\ninline v_reg<float, simd512_width / sizeof(float)>\nv512_load_expand(const float16_t* ptr)\n{\n    v_reg<float, simd512_width / sizeof(float)> v;\n    for (int i = 0; i < v.nlanes; i++)\n    {\n        v.s[i] = ptr[i];\n    }\n    return v;\n}\n#endif\n\ntemplate<int n> inline void\nv_pack_store(float16_t* ptr, const v_reg<float, n>& v)\n{\n    for( int i = 0; i < v.nlanes; i++ )\n    {\n        ptr[i] = float16_t(v.s[i]);\n    }\n}\n\ninline void v_cleanup() {}\n#if CV_SIMD256\ninline void v256_cleanup() {}\n#endif\n#if CV_SIMD512\ninline void v512_cleanup() {}\n#endif\n\n//! @}\n\n#ifndef CV_DOXYGEN\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n#endif\n}\n\n#if !defined(CV_DOXYGEN)\n#undef CV_SIMD256\n#undef CV_SIMD512\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_forward.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html\n\n#ifndef CV__SIMD_FORWARD\n#error \"Need to pre-define forward width\"\n#endif\n\nnamespace cv\n{\n\n//! @cond IGNORED\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n/** Types **/\n#if CV__SIMD_FORWARD == 1024\n// [todo] 1024\n#error \"1024-long ops not implemented yet\"\n#elif CV__SIMD_FORWARD == 512\n// 512\n#define __CV_VX(fun)   v512_##fun\n#define __CV_V_UINT8   v_uint8x64\n#define __CV_V_INT8    v_int8x64\n#define __CV_V_UINT16  v_uint16x32\n#define __CV_V_INT16   v_int16x32\n#define __CV_V_UINT32  v_uint32x16\n#define __CV_V_INT32   v_int32x16\n#define __CV_V_UINT64  v_uint64x8\n#define __CV_V_INT64   v_int64x8\n#define __CV_V_FLOAT32 v_float32x16\n#define __CV_V_FLOAT64 v_float64x8\nstruct v_uint8x64;\nstruct v_int8x64;\nstruct v_uint16x32;\nstruct v_int16x32;\nstruct v_uint32x16;\nstruct v_int32x16;\nstruct v_uint64x8;\nstruct v_int64x8;\nstruct v_float32x16;\nstruct v_float64x8;\n#elif CV__SIMD_FORWARD == 256\n// 256\n#define __CV_VX(fun)   v256_##fun\n#define __CV_V_UINT8   v_uint8x32\n#define __CV_V_INT8    v_int8x32\n#define __CV_V_UINT16  v_uint16x16\n#define __CV_V_INT16   v_int16x16\n#define __CV_V_UINT32  v_uint32x8\n#define __CV_V_INT32   v_int32x8\n#define __CV_V_UINT64  v_uint64x4\n#define __CV_V_INT64   v_int64x4\n#define __CV_V_FLOAT32 v_float32x8\n#define __CV_V_FLOAT64 v_float64x4\nstruct v_uint8x32;\nstruct v_int8x32;\nstruct v_uint16x16;\nstruct v_int16x16;\nstruct v_uint32x8;\nstruct v_int32x8;\nstruct v_uint64x4;\nstruct v_int64x4;\nstruct v_float32x8;\nstruct v_float64x4;\n#else\n// 128\n#define __CV_VX(fun)   v_##fun\n#define __CV_V_UINT8   v_uint8x16\n#define __CV_V_INT8    v_int8x16\n#define __CV_V_UINT16  v_uint16x8\n#define __CV_V_INT16   v_int16x8\n#define __CV_V_UINT32  v_uint32x4\n#define __CV_V_INT32   v_int32x4\n#define __CV_V_UINT64  v_uint64x2\n#define __CV_V_INT64   v_int64x2\n#define __CV_V_FLOAT32 v_float32x4\n#define __CV_V_FLOAT64 v_float64x2\nstruct v_uint8x16;\nstruct v_int8x16;\nstruct v_uint16x8;\nstruct v_int16x8;\nstruct v_uint32x4;\nstruct v_int32x4;\nstruct v_uint64x2;\nstruct v_int64x2;\nstruct v_float32x4;\nstruct v_float64x2;\n#endif\n\n/** Value reordering **/\n\n// Expansion\nvoid v_expand(const __CV_V_UINT8&,  __CV_V_UINT16&, __CV_V_UINT16&);\nvoid v_expand(const __CV_V_INT8&,   __CV_V_INT16&,  __CV_V_INT16&);\nvoid v_expand(const __CV_V_UINT16&, __CV_V_UINT32&, __CV_V_UINT32&);\nvoid v_expand(const __CV_V_INT16&,  __CV_V_INT32&,  __CV_V_INT32&);\nvoid v_expand(const __CV_V_UINT32&, __CV_V_UINT64&, __CV_V_UINT64&);\nvoid v_expand(const __CV_V_INT32&,  __CV_V_INT64&,  __CV_V_INT64&);\n// Low Expansion\n__CV_V_UINT16 v_expand_low(const __CV_V_UINT8&);\n__CV_V_INT16  v_expand_low(const __CV_V_INT8&);\n__CV_V_UINT32 v_expand_low(const __CV_V_UINT16&);\n__CV_V_INT32  v_expand_low(const __CV_V_INT16&);\n__CV_V_UINT64 v_expand_low(const __CV_V_UINT32&);\n__CV_V_INT64  v_expand_low(const __CV_V_INT32&);\n// High Expansion\n__CV_V_UINT16 v_expand_high(const __CV_V_UINT8&);\n__CV_V_INT16  v_expand_high(const __CV_V_INT8&);\n__CV_V_UINT32 v_expand_high(const __CV_V_UINT16&);\n__CV_V_INT32  v_expand_high(const __CV_V_INT16&);\n__CV_V_UINT64 v_expand_high(const __CV_V_UINT32&);\n__CV_V_INT64  v_expand_high(const __CV_V_INT32&);\n// Load & Low Expansion\n__CV_V_UINT16 __CV_VX(load_expand)(const uchar*);\n__CV_V_INT16  __CV_VX(load_expand)(const schar*);\n__CV_V_UINT32 __CV_VX(load_expand)(const ushort*);\n__CV_V_INT32  __CV_VX(load_expand)(const short*);\n__CV_V_UINT64 __CV_VX(load_expand)(const uint*);\n__CV_V_INT64  __CV_VX(load_expand)(const int*);\n// Load lower 8-bit and expand into 32-bit\n__CV_V_UINT32 __CV_VX(load_expand_q)(const uchar*);\n__CV_V_INT32  __CV_VX(load_expand_q)(const schar*);\n\n// Saturating Pack\n__CV_V_UINT8  v_pack(const __CV_V_UINT16&, const __CV_V_UINT16&);\n__CV_V_INT8   v_pack(const __CV_V_INT16&,  const __CV_V_INT16&);\n__CV_V_UINT16 v_pack(const __CV_V_UINT32&, const __CV_V_UINT32&);\n__CV_V_INT16  v_pack(const __CV_V_INT32&,  const __CV_V_INT32&);\n// Non-saturating Pack\n__CV_V_UINT32 v_pack(const __CV_V_UINT64&, const __CV_V_UINT64&);\n__CV_V_INT32  v_pack(const __CV_V_INT64&,  const __CV_V_INT64&);\n// Pack signed integers with unsigned saturation\n__CV_V_UINT8  v_pack_u(const __CV_V_INT16&, const __CV_V_INT16&);\n__CV_V_UINT16 v_pack_u(const __CV_V_INT32&, const __CV_V_INT32&);\n\n/** Arithmetic, bitwise and comparison operations **/\n\n// Non-saturating multiply\n#if CV_VSX\ntemplate<typename Tvec>\nTvec v_mul_wrap(const Tvec& a, const Tvec& b);\n#else\n__CV_V_UINT8  v_mul_wrap(const __CV_V_UINT8&,  const __CV_V_UINT8&);\n__CV_V_INT8   v_mul_wrap(const __CV_V_INT8&,   const __CV_V_INT8&);\n__CV_V_UINT16 v_mul_wrap(const __CV_V_UINT16&, const __CV_V_UINT16&);\n__CV_V_INT16  v_mul_wrap(const __CV_V_INT16&,  const __CV_V_INT16&);\n#endif\n\n//  Multiply and expand\n#if CV_VSX\ntemplate<typename Tvec, typename Twvec>\nvoid v_mul_expand(const Tvec& a, const Tvec& b, Twvec& c, Twvec& d);\n#else\nvoid v_mul_expand(const __CV_V_UINT8&,  const __CV_V_UINT8&,  __CV_V_UINT16&, __CV_V_UINT16&);\nvoid v_mul_expand(const __CV_V_INT8&,   const __CV_V_INT8&,   __CV_V_INT16&,  __CV_V_INT16&);\nvoid v_mul_expand(const __CV_V_UINT16&, const __CV_V_UINT16&, __CV_V_UINT32&, __CV_V_UINT32&);\nvoid v_mul_expand(const __CV_V_INT16&,  const __CV_V_INT16&,  __CV_V_INT32&,  __CV_V_INT32&);\nvoid v_mul_expand(const __CV_V_UINT32&, const __CV_V_UINT32&, __CV_V_UINT64&, __CV_V_UINT64&);\nvoid v_mul_expand(const __CV_V_INT32&,  const __CV_V_INT32&,  __CV_V_INT64&,  __CV_V_INT64&);\n#endif\n\n// Conversions\n__CV_V_FLOAT32 v_cvt_f32(const __CV_V_INT32& a);\n__CV_V_FLOAT32 v_cvt_f32(const __CV_V_FLOAT64& a);\n__CV_V_FLOAT32 v_cvt_f32(const __CV_V_FLOAT64& a, const __CV_V_FLOAT64& b);\n__CV_V_FLOAT64 v_cvt_f64(const __CV_V_INT32& a);\n__CV_V_FLOAT64 v_cvt_f64_high(const __CV_V_INT32& a);\n__CV_V_FLOAT64 v_cvt_f64(const __CV_V_FLOAT32& a);\n__CV_V_FLOAT64 v_cvt_f64_high(const __CV_V_FLOAT32& a);\n__CV_V_FLOAT64 v_cvt_f64(const __CV_V_INT64& a);\n\n/** Cleanup **/\n#undef CV__SIMD_FORWARD\n#undef __CV_VX\n#undef __CV_V_UINT8\n#undef __CV_V_INT8\n#undef __CV_V_UINT16\n#undef __CV_V_INT16\n#undef __CV_V_UINT32\n#undef __CV_V_INT32\n#undef __CV_V_UINT64\n#undef __CV_V_INT64\n#undef __CV_V_FLOAT32\n#undef __CV_V_FLOAT64\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n} // cv::"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_msa.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_HAL_INTRIN_MSA_HPP\n#define OPENCV_HAL_INTRIN_MSA_HPP\n\n#include <algorithm>\n#include \"opencv2/core/utility.hpp\"\n\nnamespace cv\n{\n\n//! @cond IGNORED\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n#define CV_SIMD128 1\n\n//MSA implements 128-bit wide vector registers shared with the 64-bit wide floating-point unit registers.\n//MSA and FPU can not be both present, unless the FPU has 64-bit floating-point registers.\n#define CV_SIMD128_64F 1\n\nstruct v_uint8x16\n{\n    typedef uchar lane_type;\n    enum { nlanes = 16 };\n\n    v_uint8x16() {}\n    explicit v_uint8x16(v16u8 v) : val(v) {}\n    v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7,\n               uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15)\n    {\n        uchar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        val = msa_ld1q_u8(v);\n    }\n\n    uchar get0() const\n    {\n        return msa_getq_lane_u8(val, 0);\n    }\n\n    v16u8 val;\n};\n\nstruct v_int8x16\n{\n    typedef schar lane_type;\n    enum { nlanes = 16 };\n\n    v_int8x16() {}\n    explicit v_int8x16(v16i8 v) : val(v) {}\n    v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7,\n               schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15)\n    {\n        schar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        val = msa_ld1q_s8(v);\n    }\n\n    schar get0() const\n    {\n        return msa_getq_lane_s8(val, 0);\n    }\n\n    v16i8 val;\n};\n\nstruct v_uint16x8\n{\n    typedef ushort lane_type;\n    enum { nlanes = 8 };\n\n    v_uint16x8() {}\n    explicit v_uint16x8(v8u16 v) : val(v) {}\n    v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)\n    {\n        ushort v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        val = msa_ld1q_u16(v);\n    }\n\n    ushort get0() const\n    {\n        return msa_getq_lane_u16(val, 0);\n    }\n\n    v8u16 val;\n};\n\nstruct v_int16x8\n{\n    typedef short lane_type;\n    enum { nlanes = 8 };\n\n    v_int16x8() {}\n    explicit v_int16x8(v8i16 v) : val(v) {}\n    v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)\n    {\n        short v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        val = msa_ld1q_s16(v);\n    }\n\n    short get0() const\n    {\n        return msa_getq_lane_s16(val, 0);\n    }\n\n    v8i16 val;\n};\n\nstruct v_uint32x4\n{\n    typedef unsigned int lane_type;\n    enum { nlanes = 4 };\n\n    v_uint32x4() {}\n    explicit v_uint32x4(v4u32 v) : val(v) {}\n    v_uint32x4(unsigned int v0, unsigned int v1, unsigned int v2, unsigned int v3)\n    {\n        unsigned int v[] = {v0, v1, v2, v3};\n        val = msa_ld1q_u32(v);\n    }\n\n    unsigned int get0() const\n    {\n        return msa_getq_lane_u32(val, 0);\n    }\n\n    v4u32 val;\n};\n\nstruct v_int32x4\n{\n    typedef int lane_type;\n    enum { nlanes = 4 };\n\n    v_int32x4() {}\n    explicit v_int32x4(v4i32 v) : val(v) {}\n    v_int32x4(int v0, int v1, int v2, int v3)\n    {\n        int v[] = {v0, v1, v2, v3};\n        val = msa_ld1q_s32(v);\n    }\n\n    int get0() const\n    {\n        return msa_getq_lane_s32(val, 0);\n    }\n\n    v4i32 val;\n};\n\nstruct v_float32x4\n{\n    typedef float lane_type;\n    enum { nlanes = 4 };\n\n    v_float32x4() {}\n    explicit v_float32x4(v4f32 v) : val(v) {}\n    v_float32x4(float v0, float v1, float v2, float v3)\n    {\n        float v[] = {v0, v1, v2, v3};\n        val = msa_ld1q_f32(v);\n    }\n\n    float get0() const\n    {\n        return msa_getq_lane_f32(val, 0);\n    }\n\n    v4f32 val;\n};\n\nstruct v_uint64x2\n{\n    typedef uint64 lane_type;\n    enum { nlanes = 2 };\n\n    v_uint64x2() {}\n    explicit v_uint64x2(v2u64 v) : val(v) {}\n    v_uint64x2(uint64 v0, uint64 v1)\n    {\n        uint64 v[] = {v0, v1};\n        val = msa_ld1q_u64(v);\n    }\n\n    uint64 get0() const\n    {\n        return msa_getq_lane_u64(val, 0);\n    }\n\n    v2u64 val;\n};\n\nstruct v_int64x2\n{\n    typedef int64 lane_type;\n    enum { nlanes = 2 };\n\n    v_int64x2() {}\n    explicit v_int64x2(v2i64 v) : val(v) {}\n    v_int64x2(int64 v0, int64 v1)\n    {\n        int64 v[] = {v0, v1};\n        val = msa_ld1q_s64(v);\n    }\n\n    int64 get0() const\n    {\n        return msa_getq_lane_s64(val, 0);\n    }\n\n    v2i64 val;\n};\n\nstruct v_float64x2\n{\n    typedef double lane_type;\n    enum { nlanes = 2 };\n\n    v_float64x2() {}\n    explicit v_float64x2(v2f64 v) : val(v) {}\n    v_float64x2(double v0, double v1)\n    {\n        double v[] = {v0, v1};\n        val = msa_ld1q_f64(v);\n    }\n\n    double get0() const\n    {\n        return msa_getq_lane_f64(val, 0);\n    }\n\n    v2f64 val;\n};\n\n#define OPENCV_HAL_IMPL_MSA_INIT(_Tpv, _Tp, suffix) \\\ninline v_##_Tpv v_setzero_##suffix() { return v_##_Tpv(msa_dupq_n_##suffix((_Tp)0)); } \\\ninline v_##_Tpv v_setall_##suffix(_Tp v) { return v_##_Tpv(msa_dupq_n_##suffix(v)); } \\\ninline v_uint8x16 v_reinterpret_as_u8(const v_##_Tpv& v) { return v_uint8x16(MSA_TPV_REINTERPRET(v16u8, v.val)); } \\\ninline v_int8x16 v_reinterpret_as_s8(const v_##_Tpv& v) { return v_int8x16(MSA_TPV_REINTERPRET(v16i8, v.val)); } \\\ninline v_uint16x8 v_reinterpret_as_u16(const v_##_Tpv& v) { return v_uint16x8(MSA_TPV_REINTERPRET(v8u16, v.val)); } \\\ninline v_int16x8 v_reinterpret_as_s16(const v_##_Tpv& v) { return v_int16x8(MSA_TPV_REINTERPRET(v8i16, v.val)); } \\\ninline v_uint32x4 v_reinterpret_as_u32(const v_##_Tpv& v) { return v_uint32x4(MSA_TPV_REINTERPRET(v4u32, v.val)); } \\\ninline v_int32x4 v_reinterpret_as_s32(const v_##_Tpv& v) { return v_int32x4(MSA_TPV_REINTERPRET(v4i32, v.val)); } \\\ninline v_uint64x2 v_reinterpret_as_u64(const v_##_Tpv& v) { return v_uint64x2(MSA_TPV_REINTERPRET(v2u64, v.val)); } \\\ninline v_int64x2 v_reinterpret_as_s64(const v_##_Tpv& v) { return v_int64x2(MSA_TPV_REINTERPRET(v2i64, v.val)); } \\\ninline v_float32x4 v_reinterpret_as_f32(const v_##_Tpv& v) { return v_float32x4(MSA_TPV_REINTERPRET(v4f32, v.val)); } \\\ninline v_float64x2 v_reinterpret_as_f64(const v_##_Tpv& v) { return v_float64x2(MSA_TPV_REINTERPRET(v2f64, v.val)); }\n\nOPENCV_HAL_IMPL_MSA_INIT(uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_MSA_INIT(int8x16, schar, s8)\nOPENCV_HAL_IMPL_MSA_INIT(uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_MSA_INIT(int16x8, short, s16)\nOPENCV_HAL_IMPL_MSA_INIT(uint32x4, unsigned int, u32)\nOPENCV_HAL_IMPL_MSA_INIT(int32x4, int, s32)\nOPENCV_HAL_IMPL_MSA_INIT(uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_MSA_INIT(int64x2, int64, s64)\nOPENCV_HAL_IMPL_MSA_INIT(float32x4, float, f32)\nOPENCV_HAL_IMPL_MSA_INIT(float64x2, double, f64)\n\n#define OPENCV_HAL_IMPL_MSA_PACK(_Tpvec, _Tpwvec, pack, mov, rshr) \\\ninline _Tpvec v_##pack(const _Tpwvec& a, const _Tpwvec& b) \\\n{ \\\n    return _Tpvec(mov(a.val, b.val)); \\\n} \\\ntemplate<int n> inline \\\n_Tpvec v_rshr_##pack(const _Tpwvec& a, const _Tpwvec& b) \\\n{ \\\n    return _Tpvec(rshr(a.val, b.val, n)); \\\n}\n\nOPENCV_HAL_IMPL_MSA_PACK(v_uint8x16, v_uint16x8, pack, msa_qpack_u16, msa_qrpackr_u16)\nOPENCV_HAL_IMPL_MSA_PACK(v_int8x16, v_int16x8, pack, msa_qpack_s16, msa_qrpackr_s16)\nOPENCV_HAL_IMPL_MSA_PACK(v_uint16x8, v_uint32x4, pack, msa_qpack_u32, msa_qrpackr_u32)\nOPENCV_HAL_IMPL_MSA_PACK(v_int16x8, v_int32x4, pack, msa_qpack_s32, msa_qrpackr_s32)\nOPENCV_HAL_IMPL_MSA_PACK(v_uint32x4, v_uint64x2, pack, msa_pack_u64, msa_rpackr_u64)\nOPENCV_HAL_IMPL_MSA_PACK(v_int32x4, v_int64x2, pack, msa_pack_s64, msa_rpackr_s64)\nOPENCV_HAL_IMPL_MSA_PACK(v_uint8x16, v_int16x8, pack_u, msa_qpacku_s16, msa_qrpackru_s16)\nOPENCV_HAL_IMPL_MSA_PACK(v_uint16x8, v_int32x4, pack_u, msa_qpacku_s32, msa_qrpackru_s32)\n\n#define OPENCV_HAL_IMPL_MSA_PACK_STORE(_Tpvec, _Tp, hreg, suffix, _Tpwvec, pack, mov, rshr) \\\ninline void v_##pack##_store(_Tp* ptr, const _Tpwvec& a) \\\n{ \\\n    hreg a1 = mov(a.val); \\\n    msa_st1_##suffix(ptr, a1); \\\n} \\\ntemplate<int n> inline \\\nvoid v_rshr_##pack##_store(_Tp* ptr, const _Tpwvec& a) \\\n{ \\\n    hreg a1 = rshr(a.val, n); \\\n    msa_st1_##suffix(ptr, a1); \\\n}\n\nOPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint8x16, uchar, v8u8, u8, v_uint16x8, pack, msa_qmovn_u16, msa_qrshrn_n_u16)\nOPENCV_HAL_IMPL_MSA_PACK_STORE(v_int8x16, schar, v8i8, s8, v_int16x8, pack, msa_qmovn_s16, msa_qrshrn_n_s16)\nOPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint16x8, ushort, v4u16, u16, v_uint32x4, pack, msa_qmovn_u32, msa_qrshrn_n_u32)\nOPENCV_HAL_IMPL_MSA_PACK_STORE(v_int16x8, short, v4i16, s16, v_int32x4, pack, msa_qmovn_s32, msa_qrshrn_n_s32)\nOPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint32x4, unsigned, v2u32, u32, v_uint64x2, pack, msa_movn_u64, msa_rshrn_n_u64)\nOPENCV_HAL_IMPL_MSA_PACK_STORE(v_int32x4, int, v2i32, s32, v_int64x2, pack, msa_movn_s64, msa_rshrn_n_s64)\nOPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint8x16, uchar, v8u8, u8, v_int16x8, pack_u, msa_qmovun_s16, msa_qrshrun_n_s16)\nOPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint16x8, ushort, v4u16, u16, v_int32x4, pack_u, msa_qmovun_s32, msa_qrshrun_n_s32)\n\n// pack boolean\ninline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b)\n{\n    return v_uint8x16(msa_pack_u16(a.val, b.val));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b,\n                           const v_uint32x4& c, const v_uint32x4& d)\n{\n    return v_uint8x16(msa_pack_u16(msa_pack_u32(a.val, b.val), msa_pack_u32(c.val, d.val)));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c,\n                           const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f,\n                           const v_uint64x2& g, const v_uint64x2& h)\n{\n    v8u16 abcd = msa_pack_u32(msa_pack_u64(a.val, b.val), msa_pack_u64(c.val, d.val));\n    v8u16 efgh = msa_pack_u32(msa_pack_u64(e.val, f.val), msa_pack_u64(g.val, h.val));\n    return v_uint8x16(msa_pack_u16(abcd, efgh));\n}\n\ninline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0,\n                            const v_float32x4& m1, const v_float32x4& m2,\n                            const v_float32x4& m3)\n{\n    v4f32 v0 = v.val;\n    v4f32 res = msa_mulq_lane_f32(m0.val, v0, 0);\n    res = msa_mlaq_lane_f32(res, m1.val, v0, 1);\n    res = msa_mlaq_lane_f32(res, m2.val, v0, 2);\n    res = msa_mlaq_lane_f32(res, m3.val, v0, 3);\n    return v_float32x4(res);\n}\n\ninline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0,\n                               const v_float32x4& m1, const v_float32x4& m2,\n                               const v_float32x4& a)\n{\n    v4f32 v0 = v.val;\n    v4f32 res = msa_mulq_lane_f32(m0.val, v0, 0);\n    res = msa_mlaq_lane_f32(res, m1.val, v0, 1);\n    res = msa_mlaq_lane_f32(res, m2.val, v0, 2);\n    res = msa_addq_f32(res, a.val);\n    return v_float32x4(res);\n}\n\n#define OPENCV_HAL_IMPL_MSA_BIN_OP(bin_op, _Tpvec, intrin) \\\ninline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val)); \\\n} \\\ninline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \\\n{ \\\n    a.val = intrin(a.val, b.val); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_uint8x16, msa_qaddq_u8)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_uint8x16, msa_qsubq_u8)\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_int8x16, msa_qaddq_s8)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_int8x16, msa_qsubq_s8)\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_uint16x8, msa_qaddq_u16)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_uint16x8, msa_qsubq_u16)\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_int16x8, msa_qaddq_s16)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_int16x8, msa_qsubq_s16)\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_int32x4, msa_addq_s32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_int32x4, msa_subq_s32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(*, v_int32x4, msa_mulq_s32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_uint32x4, msa_addq_u32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_uint32x4, msa_subq_u32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(*, v_uint32x4, msa_mulq_u32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_float32x4, msa_addq_f32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_float32x4, msa_subq_f32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(*, v_float32x4, msa_mulq_f32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_int64x2, msa_addq_s64)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_int64x2, msa_subq_s64)\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_uint64x2, msa_addq_u64)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_uint64x2, msa_subq_u64)\nOPENCV_HAL_IMPL_MSA_BIN_OP(/, v_float32x4, msa_divq_f32)\nOPENCV_HAL_IMPL_MSA_BIN_OP(+, v_float64x2, msa_addq_f64)\nOPENCV_HAL_IMPL_MSA_BIN_OP(-, v_float64x2, msa_subq_f64)\nOPENCV_HAL_IMPL_MSA_BIN_OP(*, v_float64x2, msa_mulq_f64)\nOPENCV_HAL_IMPL_MSA_BIN_OP(/, v_float64x2, msa_divq_f64)\n\n// saturating multiply 8-bit, 16-bit\n#define OPENCV_HAL_IMPL_MSA_MUL_SAT(_Tpvec, _Tpwvec)         \\\ninline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b)  \\\n{                                                            \\\n    _Tpwvec c, d;                                            \\\n    v_mul_expand(a, b, c, d);                                \\\n    return v_pack(c, d);                                     \\\n}                                                            \\\ninline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b)      \\\n{a = a * b; return a; }\n\nOPENCV_HAL_IMPL_MSA_MUL_SAT(v_int8x16,  v_int16x8)\nOPENCV_HAL_IMPL_MSA_MUL_SAT(v_uint8x16, v_uint16x8)\nOPENCV_HAL_IMPL_MSA_MUL_SAT(v_int16x8,  v_int32x4)\nOPENCV_HAL_IMPL_MSA_MUL_SAT(v_uint16x8, v_uint32x4)\n\n//  Multiply and expand\ninline void v_mul_expand(const v_int8x16& a, const v_int8x16& b,\n                         v_int16x8& c, v_int16x8& d)\n{\n    v16i8 a_lo, a_hi, b_lo, b_hi;\n\n    ILVRL_B2_SB(a.val, msa_dupq_n_s8(0), a_lo, a_hi);\n    ILVRL_B2_SB(b.val, msa_dupq_n_s8(0), b_lo, b_hi);\n    c.val = msa_mulq_s16(msa_paddlq_s8(a_lo), msa_paddlq_s8(b_lo));\n    d.val = msa_mulq_s16(msa_paddlq_s8(a_hi), msa_paddlq_s8(b_hi));\n}\n\ninline void v_mul_expand(const v_uint8x16& a, const v_uint8x16& b,\n                         v_uint16x8& c, v_uint16x8& d)\n{\n    v16u8 a_lo, a_hi, b_lo, b_hi;\n\n    ILVRL_B2_UB(a.val, msa_dupq_n_u8(0), a_lo, a_hi);\n    ILVRL_B2_UB(b.val, msa_dupq_n_u8(0), b_lo, b_hi);\n    c.val = msa_mulq_u16(msa_paddlq_u8(a_lo), msa_paddlq_u8(b_lo));\n    d.val = msa_mulq_u16(msa_paddlq_u8(a_hi), msa_paddlq_u8(b_hi));\n}\n\ninline void v_mul_expand(const v_int16x8& a, const v_int16x8& b,\n                         v_int32x4& c, v_int32x4& d)\n{\n    v8i16 a_lo, a_hi, b_lo, b_hi;\n\n    ILVRL_H2_SH(a.val, msa_dupq_n_s16(0), a_lo, a_hi);\n    ILVRL_H2_SH(b.val, msa_dupq_n_s16(0), b_lo, b_hi);\n    c.val = msa_mulq_s32(msa_paddlq_s16(a_lo), msa_paddlq_s16(b_lo));\n    d.val = msa_mulq_s32(msa_paddlq_s16(a_hi), msa_paddlq_s16(b_hi));\n}\n\ninline void v_mul_expand(const v_uint16x8& a, const v_uint16x8& b,\n                         v_uint32x4& c, v_uint32x4& d)\n{\n    v8u16 a_lo, a_hi, b_lo, b_hi;\n\n    ILVRL_H2_UH(a.val, msa_dupq_n_u16(0), a_lo, a_hi);\n    ILVRL_H2_UH(b.val, msa_dupq_n_u16(0), b_lo, b_hi);\n    c.val = msa_mulq_u32(msa_paddlq_u16(a_lo), msa_paddlq_u16(b_lo));\n    d.val = msa_mulq_u32(msa_paddlq_u16(a_hi), msa_paddlq_u16(b_hi));\n}\n\ninline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b,\n                         v_uint64x2& c, v_uint64x2& d)\n{\n    v4u32 a_lo, a_hi, b_lo, b_hi;\n\n    ILVRL_W2_UW(a.val, msa_dupq_n_u32(0), a_lo, a_hi);\n    ILVRL_W2_UW(b.val, msa_dupq_n_u32(0), b_lo, b_hi);\n    c.val = msa_mulq_u64(msa_paddlq_u32(a_lo), msa_paddlq_u32(b_lo));\n    d.val = msa_mulq_u64(msa_paddlq_u32(a_hi), msa_paddlq_u32(b_hi));\n}\n\ninline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b)\n{\n    v8i16 a_lo, a_hi, b_lo, b_hi;\n\n    ILVRL_H2_SH(a.val, msa_dupq_n_s16(0), a_lo, a_hi);\n    ILVRL_H2_SH(b.val, msa_dupq_n_s16(0), b_lo, b_hi);\n\n    return v_int16x8(msa_packr_s32(msa_mulq_s32(msa_paddlq_s16(a_lo), msa_paddlq_s16(b_lo)),\n                                   msa_mulq_s32(msa_paddlq_s16(a_hi), msa_paddlq_s16(b_hi)), 16));\n}\n\ninline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v8u16 a_lo, a_hi, b_lo, b_hi;\n\n    ILVRL_H2_UH(a.val, msa_dupq_n_u16(0), a_lo, a_hi);\n    ILVRL_H2_UH(b.val, msa_dupq_n_u16(0), b_lo, b_hi);\n\n    return v_uint16x8(msa_packr_u32(msa_mulq_u32(msa_paddlq_u16(a_lo), msa_paddlq_u16(b_lo)),\n                                    msa_mulq_u32(msa_paddlq_u16(a_hi), msa_paddlq_u16(b_hi)), 16));\n}\n\n//////// Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b)\n{ return v_int32x4(msa_dotp_s_w(a.val, b.val)); }\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{ return v_int32x4(msa_dpadd_s_w(c.val , a.val, b.val)); }\n\n// 32 >> 64\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b)\n{ return v_int64x2(msa_dotp_s_d(a.val, b.val)); }\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{ return v_int64x2(msa_dpadd_s_d(c.val , a.val, b.val)); }\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b)\n{\n    v8u16 even_a = msa_shrq_n_u16(msa_shlq_n_u16(MSA_TPV_REINTERPRET(v8u16, a.val), 8), 8);\n    v8u16 odd_a  = msa_shrq_n_u16(MSA_TPV_REINTERPRET(v8u16, a.val), 8);\n    v8u16 even_b = msa_shrq_n_u16(msa_shlq_n_u16(MSA_TPV_REINTERPRET(v8u16, b.val), 8), 8);\n    v8u16 odd_b  = msa_shrq_n_u16(MSA_TPV_REINTERPRET(v8u16, b.val), 8);\n    v4u32 prod   = msa_dotp_u_w(even_a, even_b);\n    return v_uint32x4(msa_dpadd_u_w(prod, odd_a, odd_b));\n}\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{\n    v8u16 even_a = msa_shrq_n_u16(msa_shlq_n_u16(MSA_TPV_REINTERPRET(v8u16, a.val), 8), 8);\n    v8u16 odd_a  = msa_shrq_n_u16(MSA_TPV_REINTERPRET(v8u16, a.val), 8);\n    v8u16 even_b = msa_shrq_n_u16(msa_shlq_n_u16(MSA_TPV_REINTERPRET(v8u16, b.val), 8), 8);\n    v8u16 odd_b  = msa_shrq_n_u16(MSA_TPV_REINTERPRET(v8u16, b.val), 8);\n    v4u32 prod   = msa_dpadd_u_w(c.val, even_a, even_b);\n    return v_uint32x4(msa_dpadd_u_w(prod, odd_a, odd_b));\n}\n\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b)\n{\n    v8i16 prod = msa_dotp_s_h(a.val, b.val);\n    return v_int32x4(msa_hadd_s32(prod, prod));\n}\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b,\n                                  const v_int32x4& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v4u32 even_a = msa_shrq_n_u32(msa_shlq_n_u32(MSA_TPV_REINTERPRET(v4u32, a.val), 16), 16);\n    v4u32 odd_a  = msa_shrq_n_u32(MSA_TPV_REINTERPRET(v4u32, a.val), 16);\n    v4u32 even_b = msa_shrq_n_u32(msa_shlq_n_u32(MSA_TPV_REINTERPRET(v4u32, b.val), 16), 16);\n    v4u32 odd_b  = msa_shrq_n_u32(MSA_TPV_REINTERPRET(v4u32, b.val), 16);\n    v2u64 prod   = msa_dotp_u_d(even_a, even_b);\n    return v_uint64x2(msa_dpadd_u_d(prod, odd_a, odd_b));\n}\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b,\n                                   const v_uint64x2& c)\n{\n    v4u32 even_a = msa_shrq_n_u32(msa_shlq_n_u32(MSA_TPV_REINTERPRET(v4u32, a.val), 16), 16);\n    v4u32 odd_a  = msa_shrq_n_u32(MSA_TPV_REINTERPRET(v4u32, a.val), 16);\n    v4u32 even_b = msa_shrq_n_u32(msa_shlq_n_u32(MSA_TPV_REINTERPRET(v4u32, b.val), 16), 16);\n    v4u32 odd_b  = msa_shrq_n_u32(MSA_TPV_REINTERPRET(v4u32, b.val), 16);\n    v2u64 prod   = msa_dpadd_u_d(c.val, even_a, even_b);\n    return v_uint64x2(msa_dpadd_u_d(prod, odd_a, odd_b));\n}\n\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b)\n{\n    v4i32 prod = msa_dotp_s_w(a.val, b.val);\n    return v_int64x2(msa_hadd_s64(prod, prod));\n}\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 32 >> 64f\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b)\n{ return v_cvt_f64(v_dotprod(a, b)); }\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n\n//////// Fast Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b)\n{ return v_dotprod(a, b); }\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{ return v_dotprod(a, b, c); }\n\n// 32 >> 64\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_dotprod(a, b); }\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{ return v_dotprod(a, b, c); }\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b)\n{ return v_dotprod_expand(a, b); }\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{ return v_dotprod_expand(a, b, c); }\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b)\n{ return v_dotprod_expand(a, b); }\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{ return v_dotprod_expand(a, b, c); }\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b)\n{ return v_dotprod_expand(a, b); }\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{ return v_dotprod_expand(a, b, c); }\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b)\n{ return v_dotprod_expand(a, b); }\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{ return v_dotprod_expand(a, b, c); }\n\n// 32 >> 64f\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_dotprod_expand(a, b); }\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ return v_dotprod_expand(a, b, c); }\n\n#define OPENCV_HAL_IMPL_MSA_LOGIC_OP(_Tpvec, _Tpv, suffix) \\\nOPENCV_HAL_IMPL_MSA_BIN_OP(&, _Tpvec, msa_andq_##suffix)   \\\nOPENCV_HAL_IMPL_MSA_BIN_OP(|, _Tpvec, msa_orrq_##suffix)   \\\nOPENCV_HAL_IMPL_MSA_BIN_OP(^, _Tpvec, msa_eorq_##suffix)   \\\ninline _Tpvec operator ~ (const _Tpvec& a) \\\n{ \\\n    return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_mvnq_u8(MSA_TPV_REINTERPRET(v16u8, a.val)))); \\\n}\n\nOPENCV_HAL_IMPL_MSA_LOGIC_OP(v_uint8x16, v16u8, u8)\nOPENCV_HAL_IMPL_MSA_LOGIC_OP(v_int8x16, v16i8, s8)\nOPENCV_HAL_IMPL_MSA_LOGIC_OP(v_uint16x8, v8u16, u16)\nOPENCV_HAL_IMPL_MSA_LOGIC_OP(v_int16x8, v8i16, s16)\nOPENCV_HAL_IMPL_MSA_LOGIC_OP(v_uint32x4, v4u32, u32)\nOPENCV_HAL_IMPL_MSA_LOGIC_OP(v_int32x4, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_LOGIC_OP(v_uint64x2, v2u64, u64)\nOPENCV_HAL_IMPL_MSA_LOGIC_OP(v_int64x2, v2i64, s64)\n\n#define OPENCV_HAL_IMPL_MSA_FLT_BIT_OP(bin_op, intrin) \\\ninline v_float32x4 operator bin_op (const v_float32x4& a, const v_float32x4& b) \\\n{ \\\n    return v_float32x4(MSA_TPV_REINTERPRET(v4f32, intrin(MSA_TPV_REINTERPRET(v4i32, a.val), MSA_TPV_REINTERPRET(v4i32, b.val)))); \\\n} \\\ninline v_float32x4& operator bin_op##= (v_float32x4& a, const v_float32x4& b) \\\n{ \\\n    a.val = MSA_TPV_REINTERPRET(v4f32, intrin(MSA_TPV_REINTERPRET(v4i32, a.val), MSA_TPV_REINTERPRET(v4i32, b.val))); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_MSA_FLT_BIT_OP(&, msa_andq_s32)\nOPENCV_HAL_IMPL_MSA_FLT_BIT_OP(|, msa_orrq_s32)\nOPENCV_HAL_IMPL_MSA_FLT_BIT_OP(^, msa_eorq_s32)\n\ninline v_float32x4 operator ~ (const v_float32x4& a)\n{\n    return v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_mvnq_s32(MSA_TPV_REINTERPRET(v4i32, a.val))));\n}\n\n/* v_abs */\n#define OPENCV_HAL_IMPL_MSA_ABS(_Tpuvec, _Tpsvec, usuffix, ssuffix) \\\ninline _Tpuvec v_abs(const _Tpsvec& a) \\\n{ \\\n    return v_reinterpret_as_##usuffix(_Tpsvec(msa_absq_##ssuffix(a.val))); \\\n}\n\nOPENCV_HAL_IMPL_MSA_ABS(v_uint8x16, v_int8x16, u8, s8)\nOPENCV_HAL_IMPL_MSA_ABS(v_uint16x8, v_int16x8, u16, s16)\nOPENCV_HAL_IMPL_MSA_ABS(v_uint32x4, v_int32x4, u32, s32)\n\n/* v_abs(float), v_sqrt, v_invsqrt */\n#define OPENCV_HAL_IMPL_MSA_BASIC_FUNC(_Tpvec, func, intrin) \\\ninline _Tpvec func(const _Tpvec& a) \\\n{ \\\n    return _Tpvec(intrin(a.val)); \\\n}\n\nOPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float32x4, v_abs, msa_absq_f32)\nOPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float64x2, v_abs, msa_absq_f64)\nOPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float32x4, v_sqrt, msa_sqrtq_f32)\nOPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float32x4, v_invsqrt, msa_rsqrtq_f32)\nOPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float64x2, v_sqrt, msa_sqrtq_f64)\nOPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float64x2, v_invsqrt, msa_rsqrtq_f64)\n\n#define OPENCV_HAL_IMPL_MSA_DBL_BIT_OP(bin_op, intrin) \\\ninline v_float64x2 operator bin_op (const v_float64x2& a, const v_float64x2& b) \\\n{ \\\n    return v_float64x2(MSA_TPV_REINTERPRET(v2f64, intrin(MSA_TPV_REINTERPRET(v2i64, a.val), MSA_TPV_REINTERPRET(v2i64, b.val)))); \\\n} \\\ninline v_float64x2& operator bin_op##= (v_float64x2& a, const v_float64x2& b) \\\n{ \\\n    a.val = MSA_TPV_REINTERPRET(v2f64, intrin(MSA_TPV_REINTERPRET(v2i64, a.val), MSA_TPV_REINTERPRET(v2i64, b.val))); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_MSA_DBL_BIT_OP(&, msa_andq_s64)\nOPENCV_HAL_IMPL_MSA_DBL_BIT_OP(|, msa_orrq_s64)\nOPENCV_HAL_IMPL_MSA_DBL_BIT_OP(^, msa_eorq_s64)\n\ninline v_float64x2 operator ~ (const v_float64x2& a)\n{\n    return v_float64x2(MSA_TPV_REINTERPRET(v2f64, msa_mvnq_s32(MSA_TPV_REINTERPRET(v4i32, a.val))));\n}\n\n// TODO: exp, log, sin, cos\n\n#define OPENCV_HAL_IMPL_MSA_BIN_FUNC(_Tpvec, func, intrin) \\\ninline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val)); \\\n}\n\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_min, msa_minq_u8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_max, msa_maxq_u8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_min, msa_minq_s8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_max, msa_maxq_s8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_min, msa_minq_u16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_max, msa_maxq_u16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_min, msa_minq_s16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_max, msa_maxq_s16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint32x4, v_min, msa_minq_u32)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint32x4, v_max, msa_maxq_u32)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int32x4, v_min, msa_minq_s32)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int32x4, v_max, msa_maxq_s32)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float32x4, v_min, msa_minq_f32)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float32x4, v_max, msa_maxq_f32)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float64x2, v_min, msa_minq_f64)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float64x2, v_max, msa_maxq_f64)\n\n#define OPENCV_HAL_IMPL_MSA_INT_CMP_OP(_Tpvec, _Tpv, suffix, not_suffix) \\\ninline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_ceqq_##suffix(a.val, b.val))); } \\\ninline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_mvnq_##not_suffix(msa_ceqq_##suffix(a.val, b.val)))); } \\\ninline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_cltq_##suffix(a.val, b.val))); } \\\ninline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_cgtq_##suffix(a.val, b.val))); } \\\ninline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_cleq_##suffix(a.val, b.val))); } \\\ninline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_cgeq_##suffix(a.val, b.val))); }\n\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_uint8x16, v16u8, u8, u8)\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_int8x16, v16i8, s8, u8)\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_uint16x8, v8u16, u16, u16)\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_int16x8, v8i16, s16, u16)\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_uint32x4, v4u32, u32, u32)\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_int32x4, v4i32, s32, u32)\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_float32x4, v4f32, f32, u32)\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_uint64x2, v2u64, u64, u64)\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_int64x2, v2i64, s64, u64)\nOPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_float64x2, v2f64, f64, u64)\n\ninline v_float32x4 v_not_nan(const v_float32x4& a)\n{ return v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_ceqq_f32(a.val, a.val))); }\ninline v_float64x2 v_not_nan(const v_float64x2& a)\n{ return v_float64x2(MSA_TPV_REINTERPRET(v2f64, msa_ceqq_f64(a.val, a.val))); }\n\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_add_wrap, msa_addq_u8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_add_wrap, msa_addq_s8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_add_wrap, msa_addq_u16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_add_wrap, msa_addq_s16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_sub_wrap, msa_subq_u8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_sub_wrap, msa_subq_s8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_sub_wrap, msa_subq_u16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_sub_wrap, msa_subq_s16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_mul_wrap, msa_mulq_u8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_mul_wrap, msa_mulq_s8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_mul_wrap, msa_mulq_u16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_mul_wrap, msa_mulq_s16)\n\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_absdiff, msa_abdq_u8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_absdiff, msa_abdq_u16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint32x4, v_absdiff, msa_abdq_u32)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float32x4, v_absdiff, msa_abdq_f32)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float64x2, v_absdiff, msa_abdq_f64)\n\n/** Saturating absolute difference **/\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_absdiffs, msa_qabdq_s8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_absdiffs, msa_qabdq_s16)\n\n#define OPENCV_HAL_IMPL_MSA_BIN_FUNC2(_Tpvec, _Tpvec2, _Tpv, func, intrin) \\\ninline _Tpvec2 func(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec2(MSA_TPV_REINTERPRET(_Tpv, intrin(a.val, b.val))); \\\n}\n\nOPENCV_HAL_IMPL_MSA_BIN_FUNC2(v_int8x16, v_uint8x16, v16u8, v_absdiff, msa_abdq_s8)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC2(v_int16x8, v_uint16x8, v8u16, v_absdiff, msa_abdq_s16)\nOPENCV_HAL_IMPL_MSA_BIN_FUNC2(v_int32x4, v_uint32x4, v4u32, v_absdiff, msa_abdq_s32)\n\n/* v_magnitude, v_sqr_magnitude, v_fma, v_muladd */\ninline v_float32x4 v_magnitude(const v_float32x4& a, const v_float32x4& b)\n{\n    v_float32x4 x(msa_mlaq_f32(msa_mulq_f32(a.val, a.val), b.val, b.val));\n    return v_sqrt(x);\n}\n\ninline v_float32x4 v_sqr_magnitude(const v_float32x4& a, const v_float32x4& b)\n{\n    return v_float32x4(msa_mlaq_f32(msa_mulq_f32(a.val, a.val), b.val, b.val));\n}\n\ninline v_float32x4 v_fma(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n    return v_float32x4(msa_mlaq_f32(c.val, a.val, b.val));\n}\n\ninline v_int32x4 v_fma(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return v_int32x4(msa_mlaq_s32(c.val, a.val, b.val));\n}\n\ninline v_float32x4 v_muladd(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\ninline v_int32x4 v_muladd(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\ninline v_float64x2 v_magnitude(const v_float64x2& a, const v_float64x2& b)\n{\n    v_float64x2 x(msa_mlaq_f64(msa_mulq_f64(a.val, a.val), b.val, b.val));\n    return v_sqrt(x);\n}\n\ninline v_float64x2 v_sqr_magnitude(const v_float64x2& a, const v_float64x2& b)\n{\n    return v_float64x2(msa_mlaq_f64(msa_mulq_f64(a.val, a.val), b.val, b.val));\n}\n\ninline v_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n    return v_float64x2(msa_mlaq_f64(c.val, a.val, b.val));\n}\n\ninline v_float64x2 v_muladd(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n    return v_fma(a, b, c);\n}\n\n// trade efficiency for convenience\n#define OPENCV_HAL_IMPL_MSA_SHIFT_OP(_Tpvec, suffix, _Tps, ssuffix) \\\ninline _Tpvec operator << (const _Tpvec& a, int n) \\\n{ return _Tpvec(msa_shlq_##suffix(a.val, msa_dupq_n_##ssuffix((_Tps)n))); } \\\ninline _Tpvec operator >> (const _Tpvec& a, int n) \\\n{ return _Tpvec(msa_shrq_##suffix(a.val, msa_dupq_n_##ssuffix((_Tps)n))); } \\\ntemplate<int n> inline _Tpvec v_shl(const _Tpvec& a) \\\n{ return _Tpvec(msa_shlq_n_##suffix(a.val, n)); } \\\ntemplate<int n> inline _Tpvec v_shr(const _Tpvec& a) \\\n{ return _Tpvec(msa_shrq_n_##suffix(a.val, n)); } \\\ntemplate<int n> inline _Tpvec v_rshr(const _Tpvec& a) \\\n{ return _Tpvec(msa_rshrq_n_##suffix(a.val, n)); }\n\nOPENCV_HAL_IMPL_MSA_SHIFT_OP(v_uint8x16, u8, schar, s8)\nOPENCV_HAL_IMPL_MSA_SHIFT_OP(v_int8x16, s8, schar, s8)\nOPENCV_HAL_IMPL_MSA_SHIFT_OP(v_uint16x8, u16, short, s16)\nOPENCV_HAL_IMPL_MSA_SHIFT_OP(v_int16x8, s16, short, s16)\nOPENCV_HAL_IMPL_MSA_SHIFT_OP(v_uint32x4, u32, int, s32)\nOPENCV_HAL_IMPL_MSA_SHIFT_OP(v_int32x4, s32, int, s32)\nOPENCV_HAL_IMPL_MSA_SHIFT_OP(v_uint64x2, u64, int64, s64)\nOPENCV_HAL_IMPL_MSA_SHIFT_OP(v_int64x2, s64, int64, s64)\n\n/* v_rotate_right, v_rotate_left */\n#define OPENCV_HAL_IMPL_MSA_ROTATE_OP(_Tpvec, _Tpv, _Tpvs, suffix) \\\ntemplate<int n> inline _Tpvec v_rotate_right(const _Tpvec& a) \\\n{ \\\n    return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##suffix(0), n))); \\\n} \\\ntemplate<int n> inline _Tpvec v_rotate_left(const _Tpvec& a) \\\n{ \\\n    return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(msa_dupq_n_##suffix(0), MSA_TPV_REINTERPRET(_Tpvs, a.val), _Tpvec::nlanes - n))); \\\n} \\\ntemplate<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a) \\\n{ \\\n    return a; \\\n} \\\ntemplate<int n> inline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), MSA_TPV_REINTERPRET(_Tpvs, b.val), n))); \\\n} \\\ntemplate<int n> inline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(MSA_TPV_REINTERPRET(_Tpvs, b.val), MSA_TPV_REINTERPRET(_Tpvs, a.val), _Tpvec::nlanes - n))); \\\n} \\\ntemplate<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    CV_UNUSED(b); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_uint8x16, v16u8, v16i8, s8)\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_int8x16, v16i8, v16i8, s8)\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_uint16x8, v8u16, v8i16, s16)\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_int16x8, v8i16, v8i16, s16)\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_uint32x4, v4u32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_int32x4, v4i32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_float32x4, v4f32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_uint64x2, v2u64, v2i64, s64)\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_int64x2, v2i64, v2i64, s64)\nOPENCV_HAL_IMPL_MSA_ROTATE_OP(v_float64x2, v2f64, v2i64, s64)\n\n#define OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(_Tpvec, _Tp, suffix) \\\ninline _Tpvec v_load(const _Tp* ptr) \\\n{ return _Tpvec(msa_ld1q_##suffix(ptr)); } \\\ninline _Tpvec v_load_aligned(const _Tp* ptr) \\\n{ return _Tpvec(msa_ld1q_##suffix(ptr)); } \\\ninline _Tpvec v_load_low(const _Tp* ptr) \\\n{ return _Tpvec(msa_combine_##suffix(msa_ld1_##suffix(ptr), msa_dup_n_##suffix((_Tp)0))); } \\\ninline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \\\n{ return _Tpvec(msa_combine_##suffix(msa_ld1_##suffix(ptr0), msa_ld1_##suffix(ptr1))); } \\\ninline void v_store(_Tp* ptr, const _Tpvec& a) \\\n{ msa_st1q_##suffix(ptr, a.val); } \\\ninline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \\\n{ msa_st1q_##suffix(ptr, a.val); } \\\ninline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \\\n{ msa_st1q_##suffix(ptr, a.val); } \\\ninline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode /*mode*/) \\\n{ msa_st1q_##suffix(ptr, a.val); } \\\ninline void v_store_low(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    int n  = _Tpvec::nlanes; \\\n    for( int i = 0; i < (n/2); i++ ) \\\n        ptr[i] = a.val[i]; \\\n} \\\ninline void v_store_high(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    int n  = _Tpvec::nlanes; \\\n    for( int i = 0; i < (n/2); i++ ) \\\n        ptr[i] = a.val[i+(n/2)]; \\\n}\n\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_int8x16, schar, s8)\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_int16x8, short, s16)\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_int32x4, int, s32)\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_int64x2, int64, s64)\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_float32x4, float, f32)\nOPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_float64x2, double, f64)\n\n\n/** Reverse **/\ninline v_uint8x16 v_reverse(const v_uint8x16 &a)\n{\n    v_uint8x16 c = v_uint8x16((v16u8)__builtin_msa_vshf_b((v16i8)((v2i64){0x08090A0B0C0D0E0F, 0x0001020304050607}), msa_dupq_n_s8(0), (v16i8)a.val));\n    return c;\n}\n\ninline v_int8x16 v_reverse(const v_int8x16 &a)\n{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); }\n\ninline v_uint16x8 v_reverse(const v_uint16x8 &a)\n{\n    v_uint16x8 c = v_uint16x8((v8u16)__builtin_msa_vshf_h((v8i16)((v2i64){0x0004000500060007, 0x0000000100020003}), msa_dupq_n_s16(0), (v8i16)a.val));\n    return c;\n}\n\ninline v_int16x8 v_reverse(const v_int16x8 &a)\n{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); }\n\ninline v_uint32x4 v_reverse(const v_uint32x4 &a)\n{\n    v_uint32x4 c;\n    c.val[0] = a.val[3];\n    c.val[1] = a.val[2];\n    c.val[2] = a.val[1];\n    c.val[3] = a.val[0];\n    return c;\n}\n\ninline v_int32x4 v_reverse(const v_int32x4 &a)\n{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_float32x4 v_reverse(const v_float32x4 &a)\n{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_uint64x2 v_reverse(const v_uint64x2 &a)\n{\n    v_uint64x2 c;\n    c.val[0] = a.val[1];\n    c.val[1] = a.val[0];\n    return c;\n}\n\ninline v_int64x2 v_reverse(const v_int64x2 &a)\n{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); }\n\ninline v_float64x2 v_reverse(const v_float64x2 &a)\n{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); }\n\n\n#define OPENCV_HAL_IMPL_MSA_REDUCE_OP_8U(func, cfunc) \\\ninline unsigned short v_reduce_##func(const v_uint16x8& a) \\\n{ \\\n    v8u16 a_lo, a_hi; \\\n    ILVRL_H2_UH(a.val, msa_dupq_n_u16(0), a_lo, a_hi); \\\n    v4u32 b = msa_##func##q_u32(msa_paddlq_u16(a_lo), msa_paddlq_u16(a_hi)); \\\n    v4u32 b_lo, b_hi; \\\n    ILVRL_W2_UW(b, msa_dupq_n_u32(0), b_lo, b_hi); \\\n    v2u64 c = msa_##func##q_u64(msa_paddlq_u32(b_lo), msa_paddlq_u32(b_hi)); \\\n    return (unsigned short)cfunc(c[0], c[1]); \\\n}\n\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_8U(max, std::max)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_8U(min, std::min)\n\n#define OPENCV_HAL_IMPL_MSA_REDUCE_OP_8S(func, cfunc) \\\ninline short v_reduce_##func(const v_int16x8& a) \\\n{ \\\n    v8i16 a_lo, a_hi; \\\n    ILVRL_H2_SH(a.val, msa_dupq_n_s16(0), a_lo, a_hi); \\\n    v4i32 b = msa_##func##q_s32(msa_paddlq_s16(a_lo), msa_paddlq_s16(a_hi)); \\\n    v4i32 b_lo, b_hi; \\\n    ILVRL_W2_SW(b, msa_dupq_n_s32(0), b_lo, b_hi); \\\n    v2i64 c = msa_##func##q_s64(msa_paddlq_s32(b_lo), msa_paddlq_s32(b_hi)); \\\n    return (short)cfunc(c[0], c[1]); \\\n}\n\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_8S(max, std::max)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_8S(min, std::min)\n\n#define OPENCV_HAL_IMPL_MSA_REDUCE_OP_4(_Tpvec, scalartype, func, cfunc) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    return (scalartype)cfunc(cfunc(a.val[0], a.val[1]), cfunc(a.val[2], a.val[3])); \\\n}\n\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_uint32x4, unsigned, max, std::max)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_uint32x4, unsigned, min, std::min)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_int32x4, int, max, std::max)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_int32x4, int, min, std::min)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_float32x4, float, max, std::max)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_float32x4, float, min, std::min)\n\n\n#define OPENCV_HAL_IMPL_MSA_REDUCE_OP_16(_Tpvec, scalartype, _Tpvec2, func) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    _Tpvec2 a1, a2; \\\n    v_expand(a, a1, a2); \\\n    return (scalartype)v_reduce_##func(v_##func(a1, a2)); \\\n}\n\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_16(v_uint8x16, uchar, v_uint16x8, min)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_16(v_uint8x16, uchar, v_uint16x8, max)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_16(v_int8x16, char, v_int16x8, min)\nOPENCV_HAL_IMPL_MSA_REDUCE_OP_16(v_int8x16, char, v_int16x8, max)\n\n\n\n#define OPENCV_HAL_IMPL_MSA_REDUCE_SUM(_Tpvec, scalartype, suffix) \\\ninline scalartype v_reduce_sum(const _Tpvec& a) \\\n{ \\\n    return (scalartype)msa_sum_##suffix(a.val); \\\n}\n\nOPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_uint8x16, unsigned char, u8)\nOPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_int8x16, char, s8)\nOPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_uint16x8, unsigned short, u16)\nOPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_int16x8, short, s16)\nOPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_int32x4, int, s32)\nOPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_float32x4, float, f32)\n\ninline uint64 v_reduce_sum(const v_uint64x2& a)\n{ return (uint64)(msa_getq_lane_u64(a.val, 0) + msa_getq_lane_u64(a.val, 1)); }\ninline int64 v_reduce_sum(const v_int64x2& a)\n{ return (int64)(msa_getq_lane_s64(a.val, 0) + msa_getq_lane_s64(a.val, 1)); }\ninline double v_reduce_sum(const v_float64x2& a)\n{\n    return msa_getq_lane_f64(a.val, 0) + msa_getq_lane_f64(a.val, 1);\n}\n\n/* v_reduce_sum4, v_reduce_sad */\ninline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b,\n                                 const v_float32x4& c, const v_float32x4& d)\n{\n    v4f32 u0 = msa_addq_f32(MSA_TPV_REINTERPRET(v4f32, msa_ilvevq_s32(MSA_TPV_REINTERPRET(v4i32, b.val), MSA_TPV_REINTERPRET(v4i32, a.val))),\n                            MSA_TPV_REINTERPRET(v4f32, msa_ilvodq_s32(MSA_TPV_REINTERPRET(v4i32, b.val), MSA_TPV_REINTERPRET(v4i32, a.val)))); // a0+a1 b0+b1 a2+a3 b2+b3\n    v4f32 u1 = msa_addq_f32(MSA_TPV_REINTERPRET(v4f32, msa_ilvevq_s32(MSA_TPV_REINTERPRET(v4i32, d.val), MSA_TPV_REINTERPRET(v4i32, c.val))),\n                            MSA_TPV_REINTERPRET(v4f32, msa_ilvodq_s32(MSA_TPV_REINTERPRET(v4i32, d.val), MSA_TPV_REINTERPRET(v4i32, c.val)))); // c0+c1 d0+d1 c2+c3 d2+d3\n\n    return v_float32x4(msa_addq_f32(MSA_TPV_REINTERPRET(v4f32, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, u1), MSA_TPV_REINTERPRET(v2i64, u0))),\n                                    MSA_TPV_REINTERPRET(v4f32, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, u1), MSA_TPV_REINTERPRET(v2i64, u0)))));\n}\n\ninline unsigned v_reduce_sad(const v_uint8x16& a, const v_uint8x16& b)\n{\n    v16u8 t0 = msa_abdq_u8(a.val, b.val);\n    v8u16 t1 = msa_paddlq_u8(t0);\n    v4u32 t2 = msa_paddlq_u16(t1);\n    return msa_sum_u32(t2);\n}\ninline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b)\n{\n    v16u8 t0 = MSA_TPV_REINTERPRET(v16u8, msa_abdq_s8(a.val, b.val));\n    v8u16 t1 = msa_paddlq_u8(t0);\n    v4u32 t2 = msa_paddlq_u16(t1);\n    return msa_sum_u32(t2);\n}\ninline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v8u16 t0 = msa_abdq_u16(a.val, b.val);\n    v4u32 t1 = msa_paddlq_u16(t0);\n    return msa_sum_u32(t1);\n}\ninline unsigned v_reduce_sad(const v_int16x8& a, const v_int16x8& b)\n{\n    v8u16 t0 = MSA_TPV_REINTERPRET(v8u16, msa_abdq_s16(a.val, b.val));\n    v4u32 t1 = msa_paddlq_u16(t0);\n    return msa_sum_u32(t1);\n}\ninline unsigned v_reduce_sad(const v_uint32x4& a, const v_uint32x4& b)\n{\n    v4u32 t0 = msa_abdq_u32(a.val, b.val);\n    return msa_sum_u32(t0);\n}\ninline unsigned v_reduce_sad(const v_int32x4& a, const v_int32x4& b)\n{\n    v4u32 t0 = MSA_TPV_REINTERPRET(v4u32, msa_abdq_s32(a.val, b.val));\n    return msa_sum_u32(t0);\n}\ninline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b)\n{\n    v4f32 t0 = msa_abdq_f32(a.val, b.val);\n    return msa_sum_f32(t0);\n}\n\n/* v_popcount */\n#define OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE8(_Tpvec) \\\ninline v_uint8x16 v_popcount(const _Tpvec& a) \\\n{ \\\n    v16u8 t = MSA_TPV_REINTERPRET(v16u8, msa_cntq_s8(MSA_TPV_REINTERPRET(v16i8, a.val))); \\\n    return v_uint8x16(t); \\\n}\nOPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE8(v_uint8x16)\nOPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE8(v_int8x16)\n\n#define OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE16(_Tpvec) \\\ninline v_uint16x8 v_popcount(const _Tpvec& a) \\\n{ \\\n    v8u16 t = MSA_TPV_REINTERPRET(v8u16, msa_cntq_s16(MSA_TPV_REINTERPRET(v8i16, a.val))); \\\n    return v_uint16x8(t); \\\n}\nOPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE16(v_uint16x8)\nOPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE16(v_int16x8)\n\n#define OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE32(_Tpvec) \\\ninline v_uint32x4 v_popcount(const _Tpvec& a) \\\n{ \\\n    v4u32 t = MSA_TPV_REINTERPRET(v4u32, msa_cntq_s32(MSA_TPV_REINTERPRET(v4i32, a.val))); \\\n    return v_uint32x4(t); \\\n}\nOPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE32(v_uint32x4)\nOPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE32(v_int32x4)\n\n#define OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE64(_Tpvec) \\\ninline v_uint64x2 v_popcount(const _Tpvec& a) \\\n{ \\\n    v2u64 t = MSA_TPV_REINTERPRET(v2u64, msa_cntq_s64(MSA_TPV_REINTERPRET(v2i64, a.val))); \\\n    return v_uint64x2(t); \\\n}\nOPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE64(v_uint64x2)\nOPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE64(v_int64x2)\n\ninline int v_signmask(const v_uint8x16& a)\n{\n    v8i8 m0 = msa_create_s8(CV_BIG_UINT(0x0706050403020100));\n    v16u8 v0 = msa_shlq_u8(msa_shrq_n_u8(a.val, 7), msa_combine_s8(m0, m0));\n    v8u16 v1 = msa_paddlq_u8(v0);\n    v4u32 v2 = msa_paddlq_u16(v1);\n    v2u64 v3 = msa_paddlq_u32(v2);\n    return (int)msa_getq_lane_u64(v3, 0) + ((int)msa_getq_lane_u64(v3, 1) << 8);\n}\ninline int v_signmask(const v_int8x16& a)\n{ return v_signmask(v_reinterpret_as_u8(a)); }\n\ninline int v_signmask(const v_uint16x8& a)\n{\n    v4i16 m0 = msa_create_s16(CV_BIG_UINT(0x0003000200010000));\n    v8u16 v0 = msa_shlq_u16(msa_shrq_n_u16(a.val, 15), msa_combine_s16(m0, m0));\n    v4u32 v1 = msa_paddlq_u16(v0);\n    v2u64 v2 = msa_paddlq_u32(v1);\n    return (int)msa_getq_lane_u64(v2, 0) + ((int)msa_getq_lane_u64(v2, 1) << 4);\n}\ninline int v_signmask(const v_int16x8& a)\n{ return v_signmask(v_reinterpret_as_u16(a)); }\n\ninline int v_signmask(const v_uint32x4& a)\n{\n    v2i32 m0 = msa_create_s32(CV_BIG_UINT(0x0000000100000000));\n    v4u32 v0 = msa_shlq_u32(msa_shrq_n_u32(a.val, 31), msa_combine_s32(m0, m0));\n    v2u64 v1 = msa_paddlq_u32(v0);\n    return (int)msa_getq_lane_u64(v1, 0) + ((int)msa_getq_lane_u64(v1, 1) << 2);\n}\ninline int v_signmask(const v_int32x4& a)\n{ return v_signmask(v_reinterpret_as_u32(a)); }\ninline int v_signmask(const v_float32x4& a)\n{ return v_signmask(v_reinterpret_as_u32(a)); }\n\ninline int v_signmask(const v_uint64x2& a)\n{\n    v2u64 v0 = msa_shrq_n_u64(a.val, 63);\n    return (int)msa_getq_lane_u64(v0, 0) + ((int)msa_getq_lane_u64(v0, 1) << 1);\n}\ninline int v_signmask(const v_int64x2& a)\n{ return v_signmask(v_reinterpret_as_u64(a)); }\ninline int v_signmask(const v_float64x2& a)\n{ return v_signmask(v_reinterpret_as_u64(a)); }\n\ninline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(a)); }\n\n#define OPENCV_HAL_IMPL_MSA_CHECK_ALLANY(_Tpvec, _Tpvec2, suffix, shift) \\\ninline bool v_check_all(const v_##_Tpvec& a) \\\n{ \\\n    _Tpvec2 v0 = msa_shrq_n_##suffix(msa_mvnq_##suffix(a.val), shift); \\\n    v2u64 v1 = MSA_TPV_REINTERPRET(v2u64, v0); \\\n    return (msa_getq_lane_u64(v1, 0) | msa_getq_lane_u64(v1, 1)) == 0; \\\n} \\\ninline bool v_check_any(const v_##_Tpvec& a) \\\n{ \\\n    _Tpvec2 v0 = msa_shrq_n_##suffix(a.val, shift); \\\n    v2u64 v1 = MSA_TPV_REINTERPRET(v2u64, v0); \\\n    return (msa_getq_lane_u64(v1, 0) | msa_getq_lane_u64(v1, 1)) != 0; \\\n}\n\nOPENCV_HAL_IMPL_MSA_CHECK_ALLANY(uint8x16, v16u8, u8, 7)\nOPENCV_HAL_IMPL_MSA_CHECK_ALLANY(uint16x8, v8u16, u16, 15)\nOPENCV_HAL_IMPL_MSA_CHECK_ALLANY(uint32x4, v4u32, u32, 31)\nOPENCV_HAL_IMPL_MSA_CHECK_ALLANY(uint64x2, v2u64, u64, 63)\n\ninline bool v_check_all(const v_int8x16& a)\n{ return v_check_all(v_reinterpret_as_u8(a)); }\ninline bool v_check_all(const v_int16x8& a)\n{ return v_check_all(v_reinterpret_as_u16(a)); }\ninline bool v_check_all(const v_int32x4& a)\n{ return v_check_all(v_reinterpret_as_u32(a)); }\ninline bool v_check_all(const v_float32x4& a)\n{ return v_check_all(v_reinterpret_as_u32(a)); }\n\ninline bool v_check_any(const v_int8x16& a)\n{ return v_check_any(v_reinterpret_as_u8(a)); }\ninline bool v_check_any(const v_int16x8& a)\n{ return v_check_any(v_reinterpret_as_u16(a)); }\ninline bool v_check_any(const v_int32x4& a)\n{ return v_check_any(v_reinterpret_as_u32(a)); }\ninline bool v_check_any(const v_float32x4& a)\n{ return v_check_any(v_reinterpret_as_u32(a)); }\n\ninline bool v_check_all(const v_int64x2& a)\n{ return v_check_all(v_reinterpret_as_u64(a)); }\ninline bool v_check_all(const v_float64x2& a)\n{ return v_check_all(v_reinterpret_as_u64(a)); }\ninline bool v_check_any(const v_int64x2& a)\n{ return v_check_any(v_reinterpret_as_u64(a)); }\ninline bool v_check_any(const v_float64x2& a)\n{ return v_check_any(v_reinterpret_as_u64(a)); }\n\n/* v_select */\n#define OPENCV_HAL_IMPL_MSA_SELECT(_Tpvec, _Tpv, _Tpvu) \\\ninline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_bslq_u8(MSA_TPV_REINTERPRET(_Tpvu, mask.val), \\\n                  MSA_TPV_REINTERPRET(_Tpvu, b.val), MSA_TPV_REINTERPRET(_Tpvu, a.val)))); \\\n}\n\nOPENCV_HAL_IMPL_MSA_SELECT(v_uint8x16, v16u8, v16u8)\nOPENCV_HAL_IMPL_MSA_SELECT(v_int8x16, v16i8, v16u8)\nOPENCV_HAL_IMPL_MSA_SELECT(v_uint16x8, v8u16, v16u8)\nOPENCV_HAL_IMPL_MSA_SELECT(v_int16x8, v8i16, v16u8)\nOPENCV_HAL_IMPL_MSA_SELECT(v_uint32x4, v4u32, v16u8)\nOPENCV_HAL_IMPL_MSA_SELECT(v_int32x4, v4i32, v16u8)\nOPENCV_HAL_IMPL_MSA_SELECT(v_float32x4, v4f32, v16u8)\nOPENCV_HAL_IMPL_MSA_SELECT(v_float64x2, v2f64, v16u8)\n\n#define OPENCV_HAL_IMPL_MSA_EXPAND(_Tpvec, _Tpwvec, _Tp, suffix, ssuffix, _Tpv, _Tpvs) \\\ninline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \\\n{ \\\n    _Tpv a_lo = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##ssuffix(0))); \\\n    _Tpv a_hi = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##ssuffix(0))); \\\n    b0.val = msa_paddlq_##suffix(a_lo); \\\n    b1.val = msa_paddlq_##suffix(a_hi); \\\n} \\\ninline _Tpwvec v_expand_low(const _Tpvec& a) \\\n{ \\\n    _Tpv a_lo = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##ssuffix(0))); \\\n    return _Tpwvec(msa_paddlq_##suffix(a_lo)); \\\n} \\\ninline _Tpwvec v_expand_high(const _Tpvec& a) \\\n{ \\\n    _Tpv a_hi = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##ssuffix(0))); \\\n    return _Tpwvec(msa_paddlq_##suffix(a_hi)); \\\n} \\\ninline _Tpwvec v_load_expand(const _Tp* ptr) \\\n{ \\\n    return _Tpwvec(msa_movl_##suffix(msa_ld1_##suffix(ptr))); \\\n}\n\nOPENCV_HAL_IMPL_MSA_EXPAND(v_uint8x16, v_uint16x8, uchar, u8, s8, v16u8, v16i8)\nOPENCV_HAL_IMPL_MSA_EXPAND(v_int8x16, v_int16x8, schar, s8, s8, v16i8, v16i8)\nOPENCV_HAL_IMPL_MSA_EXPAND(v_uint16x8, v_uint32x4, ushort, u16, s16, v8u16, v8i16)\nOPENCV_HAL_IMPL_MSA_EXPAND(v_int16x8, v_int32x4, short, s16, s16, v8i16, v8i16)\nOPENCV_HAL_IMPL_MSA_EXPAND(v_uint32x4, v_uint64x2, uint, u32, s32, v4u32, v4i32)\nOPENCV_HAL_IMPL_MSA_EXPAND(v_int32x4, v_int64x2, int, s32, s32, v4i32, v4i32)\n\ninline v_uint32x4 v_load_expand_q(const uchar* ptr)\n{\n    return v_uint32x4((v4u32){ptr[0], ptr[1], ptr[2], ptr[3]});\n}\n\ninline v_int32x4 v_load_expand_q(const schar* ptr)\n{\n    return v_int32x4((v4i32){ptr[0], ptr[1], ptr[2], ptr[3]});\n}\n\n/* v_zip, v_combine_low, v_combine_high, v_recombine */\n#define OPENCV_HAL_IMPL_MSA_UNPACKS(_Tpvec, _Tpv, _Tpvs, ssuffix) \\\ninline void v_zip(const _Tpvec& a0, const _Tpvec& a1, _Tpvec& b0, _Tpvec& b1) \\\n{ \\\n    b0.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a1.val), MSA_TPV_REINTERPRET(_Tpvs, a0.val))); \\\n    b1.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a1.val), MSA_TPV_REINTERPRET(_Tpvs, a0.val))); \\\n} \\\ninline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, b.val), MSA_TPV_REINTERPRET(v2i64, a.val)))); \\\n} \\\ninline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, b.val), MSA_TPV_REINTERPRET(v2i64, a.val)))); \\\n} \\\ninline void v_recombine(const _Tpvec& a, const _Tpvec& b, _Tpvec& c, _Tpvec& d) \\\n{ \\\n    c.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, b.val), MSA_TPV_REINTERPRET(v2i64, a.val))); \\\n    d.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, b.val), MSA_TPV_REINTERPRET(v2i64, a.val))); \\\n}\n\nOPENCV_HAL_IMPL_MSA_UNPACKS(v_uint8x16, v16u8, v16i8, s8)\nOPENCV_HAL_IMPL_MSA_UNPACKS(v_int8x16, v16i8, v16i8, s8)\nOPENCV_HAL_IMPL_MSA_UNPACKS(v_uint16x8, v8u16, v8i16, s16)\nOPENCV_HAL_IMPL_MSA_UNPACKS(v_int16x8, v8i16, v8i16, s16)\nOPENCV_HAL_IMPL_MSA_UNPACKS(v_uint32x4, v4u32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_UNPACKS(v_int32x4, v4i32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_UNPACKS(v_float32x4, v4f32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_UNPACKS(v_float64x2, v2f64, v2i64, s64)\n\n/* v_extract */\n#define OPENCV_HAL_IMPL_MSA_EXTRACT(_Tpvec, _Tpv, _Tpvs, suffix) \\\ntemplate <int s> \\\ninline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), MSA_TPV_REINTERPRET(_Tpvs, b.val), s))); \\\n}\n\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_uint8x16, v16u8, v16i8, s8)\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_int8x16, v16i8, v16i8, s8)\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_uint16x8, v8u16, v8i16, s16)\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_int16x8, v8i16, v8i16, s16)\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_uint32x4, v4u32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_int32x4, v4i32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_uint64x2, v2u64, v2i64, s64)\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_int64x2, v2i64, v2i64, s64)\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_float32x4, v4f32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_EXTRACT(v_float64x2, v2f64, v2i64, s64)\n\n/* v_round, v_floor, v_ceil, v_trunc */\ninline v_int32x4 v_round(const v_float32x4& a)\n{\n    return v_int32x4(msa_cvttintq_s32_f32(a.val));\n}\n\ninline v_int32x4 v_floor(const v_float32x4& a)\n{\n    v4i32 a1 = msa_cvttintq_s32_f32(a.val);\n    return v_int32x4(msa_addq_s32(a1, MSA_TPV_REINTERPRET(v4i32, msa_cgtq_f32(msa_cvtfintq_f32_s32(a1), a.val))));\n}\n\ninline v_int32x4 v_ceil(const v_float32x4& a)\n{\n    v4i32 a1 = msa_cvttintq_s32_f32(a.val);\n    return v_int32x4(msa_subq_s32(a1, MSA_TPV_REINTERPRET(v4i32, msa_cgtq_f32(a.val, msa_cvtfintq_f32_s32(a1)))));\n}\n\ninline v_int32x4 v_trunc(const v_float32x4& a)\n{\n    return v_int32x4(msa_cvttruncq_s32_f32(a.val));\n}\n\ninline v_int32x4 v_round(const v_float64x2& a)\n{\n    return v_int32x4(msa_pack_s64(msa_cvttintq_s64_f64(a.val), msa_dupq_n_s64(0)));\n}\n\ninline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b)\n{\n    return v_int32x4(msa_pack_s64(msa_cvttintq_s64_f64(a.val), msa_cvttintq_s64_f64(b.val)));\n}\n\ninline v_int32x4 v_floor(const v_float64x2& a)\n{\n    v2f64 a1 = msa_cvtrintq_f64(a.val);\n    return v_int32x4(msa_pack_s64(msa_addq_s64(msa_cvttruncq_s64_f64(a1), MSA_TPV_REINTERPRET(v2i64, msa_cgtq_f64(a1, a.val))), msa_dupq_n_s64(0)));\n}\n\ninline v_int32x4 v_ceil(const v_float64x2& a)\n{\n    v2f64 a1 = msa_cvtrintq_f64(a.val);\n    return v_int32x4(msa_pack_s64(msa_subq_s64(msa_cvttruncq_s64_f64(a1), MSA_TPV_REINTERPRET(v2i64, msa_cgtq_f64(a.val, a1))), msa_dupq_n_s64(0)));\n}\n\ninline v_int32x4 v_trunc(const v_float64x2& a)\n{\n    return v_int32x4(msa_pack_s64(msa_cvttruncq_s64_f64(a.val), msa_dupq_n_s64(0)));\n}\n\n#define OPENCV_HAL_IMPL_MSA_TRANSPOSE4x4(_Tpvec, _Tpv, _Tpvs, ssuffix) \\\ninline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1, \\\n                           const _Tpvec& a2, const _Tpvec& a3, \\\n                           _Tpvec& b0, _Tpvec& b1, \\\n                           _Tpvec& b2, _Tpvec& b3) \\\n{ \\\n    _Tpv t00 = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a1.val), MSA_TPV_REINTERPRET(_Tpvs, a0.val))); \\\n    _Tpv t01 = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a1.val), MSA_TPV_REINTERPRET(_Tpvs, a0.val))); \\\n    _Tpv t10 = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a3.val), MSA_TPV_REINTERPRET(_Tpvs, a2.val))); \\\n    _Tpv t11 = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a3.val), MSA_TPV_REINTERPRET(_Tpvs, a2.val))); \\\n    b0.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, t10), MSA_TPV_REINTERPRET(v2i64, t00))); \\\n    b1.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, t10), MSA_TPV_REINTERPRET(v2i64, t00))); \\\n    b2.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, t11), MSA_TPV_REINTERPRET(v2i64, t01))); \\\n    b3.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, t11), MSA_TPV_REINTERPRET(v2i64, t01))); \\\n}\n\nOPENCV_HAL_IMPL_MSA_TRANSPOSE4x4(v_uint32x4, v4u32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_TRANSPOSE4x4(v_int32x4, v4i32, v4i32, s32)\nOPENCV_HAL_IMPL_MSA_TRANSPOSE4x4(v_float32x4, v4f32, v4i32, s32)\n\n#define OPENCV_HAL_IMPL_MSA_INTERLEAVED(_Tpvec, _Tp, suffix) \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b) \\\n{ \\\n    msa_ld2q_##suffix(ptr, &a.val, &b.val); \\\n} \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, v_##_Tpvec& c) \\\n{ \\\n    msa_ld3q_##suffix(ptr, &a.val, &b.val, &c.val); \\\n} \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, \\\n                                v_##_Tpvec& c, v_##_Tpvec& d) \\\n{ \\\n    msa_ld4q_##suffix(ptr, &a.val, &b.val, &c.val, &d.val); \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    msa_st2q_##suffix(ptr, a.val, b.val); \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \\\n                                const v_##_Tpvec& c, hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    msa_st3q_##suffix(ptr, a.val, b.val, c.val); \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \\\n                                const v_##_Tpvec& c, const v_##_Tpvec& d, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED ) \\\n{ \\\n    msa_st4q_##suffix(ptr, a.val, b.val, c.val, d.val); \\\n}\n\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(int8x16, schar, s8)\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(int16x8, short, s16)\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(int32x4, int, s32)\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(float32x4, float, f32)\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(int64x2, int64, s64)\nOPENCV_HAL_IMPL_MSA_INTERLEAVED(float64x2, double, f64)\n\n/* v_cvt_f32, v_cvt_f64, v_cvt_f64_high */\ninline v_float32x4 v_cvt_f32(const v_int32x4& a)\n{\n    return v_float32x4(msa_cvtfintq_f32_s32(a.val));\n}\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a)\n{\n    return v_float32x4(msa_cvtfq_f32_f64(a.val, msa_dupq_n_f64(0.0f)));\n}\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b)\n{\n    return v_float32x4(msa_cvtfq_f32_f64(a.val, b.val));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int32x4& a)\n{\n    return v_float64x2(msa_cvtflq_f64_f32(msa_cvtfintq_f32_s32(a.val)));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_int32x4& a)\n{\n    return v_float64x2(msa_cvtfhq_f64_f32(msa_cvtfintq_f32_s32(a.val)));\n}\n\ninline v_float64x2 v_cvt_f64(const v_float32x4& a)\n{\n    return v_float64x2(msa_cvtflq_f64_f32(a.val));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_float32x4& a)\n{\n    return v_float64x2(msa_cvtfhq_f64_f32(a.val));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int64x2& a)\n{\n    return v_float64x2(msa_cvtfintq_f64_s64(a.val));\n}\n\n////////////// Lookup table access ////////////////////\ninline v_int8x16 v_lut(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[ 0]],\n        tab[idx[ 1]],\n        tab[idx[ 2]],\n        tab[idx[ 3]],\n        tab[idx[ 4]],\n        tab[idx[ 5]],\n        tab[idx[ 6]],\n        tab[idx[ 7]],\n        tab[idx[ 8]],\n        tab[idx[ 9]],\n        tab[idx[10]],\n        tab[idx[11]],\n        tab[idx[12]],\n        tab[idx[13]],\n        tab[idx[14]],\n        tab[idx[15]]\n    };\n    return v_int8x16(msa_ld1q_s8(elems));\n}\ninline v_int8x16 v_lut_pairs(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[3]],\n        tab[idx[3] + 1],\n        tab[idx[4]],\n        tab[idx[4] + 1],\n        tab[idx[5]],\n        tab[idx[5] + 1],\n        tab[idx[6]],\n        tab[idx[6] + 1],\n        tab[idx[7]],\n        tab[idx[7] + 1]\n    };\n    return v_int8x16(msa_ld1q_s8(elems));\n}\ninline v_int8x16 v_lut_quads(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[0] + 2],\n        tab[idx[0] + 3],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[1] + 2],\n        tab[idx[1] + 3],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[2] + 2],\n        tab[idx[2] + 3],\n        tab[idx[3]],\n        tab[idx[3] + 1],\n        tab[idx[3] + 2],\n        tab[idx[3] + 3]\n    };\n    return v_int8x16(msa_ld1q_s8(elems));\n}\ninline v_uint8x16 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((schar*)tab, idx)); }\ninline v_uint8x16 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((schar*)tab, idx)); }\ninline v_uint8x16 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((schar*)tab, idx)); }\n\n\ninline v_int16x8 v_lut(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]],\n        tab[idx[4]],\n        tab[idx[5]],\n        tab[idx[6]],\n        tab[idx[7]]\n    };\n    return v_int16x8(msa_ld1q_s16(elems));\n}\ninline v_int16x8 v_lut_pairs(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[3]],\n        tab[idx[3] + 1]\n    };\n    return v_int16x8(msa_ld1q_s16(elems));\n}\ninline v_int16x8 v_lut_quads(const short* tab, const int* idx)\n{\n    return v_int16x8(msa_combine_s16(msa_ld1_s16(tab + idx[0]), msa_ld1_s16(tab + idx[1])));\n}\ninline v_uint16x8 v_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut((short*)tab, idx)); }\ninline v_uint16x8 v_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_pairs((short*)tab, idx)); }\ninline v_uint16x8 v_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_quads((short*)tab, idx)); }\n\ninline v_int32x4 v_lut(const int* tab, const int* idx)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]]\n    };\n    return v_int32x4(msa_ld1q_s32(elems));\n}\ninline v_int32x4 v_lut_pairs(const int* tab, const int* idx)\n{\n    return v_int32x4(msa_combine_s32(msa_ld1_s32(tab + idx[0]), msa_ld1_s32(tab + idx[1])));\n}\ninline v_int32x4 v_lut_quads(const int* tab, const int* idx)\n{\n    return v_int32x4(msa_ld1q_s32(tab + idx[0]));\n}\ninline v_uint32x4 v_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut((int*)tab, idx)); }\ninline v_uint32x4 v_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_pairs((int*)tab, idx)); }\ninline v_uint32x4 v_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_quads((int*)tab, idx)); }\n\ninline v_int64x2 v_lut(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(msa_combine_s64(msa_create_s64(tab[idx[0]]), msa_create_s64(tab[idx[1]])));\n}\ninline v_int64x2 v_lut_pairs(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(msa_ld1q_s64(tab + idx[0]));\n}\ninline v_uint64x2 v_lut(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut((const int64_t *)tab, idx)); }\ninline v_uint64x2 v_lut_pairs(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut_pairs((const int64_t *)tab, idx)); }\n\ninline v_float32x4 v_lut(const float* tab, const int* idx)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]]\n    };\n    return v_float32x4(msa_ld1q_f32(elems));\n}\ninline v_float32x4 v_lut_pairs(const float* tab, const int* idx)\n{\n    uint64 CV_DECL_ALIGNED(32) elems[2] =\n    {\n        *(uint64*)(tab + idx[0]),\n        *(uint64*)(tab + idx[1])\n    };\n    return v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_ld1q_u64(elems)));\n}\ninline v_float32x4 v_lut_quads(const float* tab, const int* idx)\n{\n    return v_float32x4(msa_ld1q_f32(tab + idx[0]));\n}\n\ninline v_int32x4 v_lut(const int* tab, const v_int32x4& idxvec)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n\n    return v_int32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n}\n\ninline v_uint32x4 v_lut(const unsigned* tab, const v_int32x4& idxvec)\n{\n    unsigned CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[msa_getq_lane_s32(idxvec.val, 0)],\n        tab[msa_getq_lane_s32(idxvec.val, 1)],\n        tab[msa_getq_lane_s32(idxvec.val, 2)],\n        tab[msa_getq_lane_s32(idxvec.val, 3)]\n    };\n    return v_uint32x4(msa_ld1q_u32(elems));\n}\n\ninline v_float32x4 v_lut(const float* tab, const v_int32x4& idxvec)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n\n    return v_float32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n}\n\ninline void v_lut_deinterleave(const float* tab, const v_int32x4& idxvec, v_float32x4& x, v_float32x4& y)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n\n    v4f32 xy02 = msa_combine_f32(msa_ld1_f32(tab + idx[0]), msa_ld1_f32(tab + idx[2]));\n    v4f32 xy13 = msa_combine_f32(msa_ld1_f32(tab + idx[1]), msa_ld1_f32(tab + idx[3]));\n    x = v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_ilvevq_s32(MSA_TPV_REINTERPRET(v4i32, xy13), MSA_TPV_REINTERPRET(v4i32, xy02))));\n    y = v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_ilvodq_s32(MSA_TPV_REINTERPRET(v4i32, xy13), MSA_TPV_REINTERPRET(v4i32, xy02))));\n}\n\ninline v_int8x16 v_interleave_pairs(const v_int8x16& vec)\n{\n    v_int8x16 c = v_int8x16(__builtin_msa_vshf_b((v16i8)((v2i64){0x0705060403010200, 0x0F0D0E0C0B090A08}), msa_dupq_n_s8(0), vec.val));\n    return c;\n}\ninline v_uint8x16 v_interleave_pairs(const v_uint8x16& vec)\n{ return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); }\ninline v_int8x16 v_interleave_quads(const v_int8x16& vec)\n{\n    v_int8x16 c = v_int8x16(__builtin_msa_vshf_b((v16i8)((v2i64){0x0703060205010400, 0x0F0B0E0A0D090C08}), msa_dupq_n_s8(0), vec.val));\n    return c;\n}\ninline v_uint8x16 v_interleave_quads(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_interleave_pairs(const v_int16x8& vec)\n{\n    v_int16x8 c = v_int16x8(__builtin_msa_vshf_h((v8i16)((v2i64){0x0003000100020000, 0x0007000500060004}), msa_dupq_n_s16(0), vec.val));\n    return c;\n}\n\ninline v_uint16x8 v_interleave_pairs(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); }\n\ninline v_int16x8 v_interleave_quads(const v_int16x8& vec)\n{\n    v_int16x8 c = v_int16x8(__builtin_msa_vshf_h((v8i16)((v2i64){0x0005000100040000, 0x0007000300060002}), msa_dupq_n_s16(0), vec.val));\n    return c;\n}\n\ninline v_uint16x8 v_interleave_quads(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_interleave_pairs(const v_int32x4& vec)\n{\n    v_int32x4 c;\n    c.val[0] = vec.val[0];\n    c.val[1] = vec.val[2];\n    c.val[2] = vec.val[1];\n    c.val[3] = vec.val[3];\n    return c;\n}\n\ninline v_uint32x4 v_interleave_pairs(const v_uint32x4& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\ninline v_float32x4 v_interleave_pairs(const v_float32x4& vec) { return v_reinterpret_as_f32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\n\ninline v_int8x16 v_pack_triplets(const v_int8x16& vec)\n{\n    v_int8x16 c = v_int8x16(__builtin_msa_vshf_b((v16i8)((v2i64){0x0908060504020100, 0x131211100E0D0C0A}), msa_dupq_n_s8(0), vec.val));\n    return c;\n}\n\ninline v_uint8x16 v_pack_triplets(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_pack_triplets(const v_int16x8& vec)\n{\n    v_int16x8 c = v_int16x8(__builtin_msa_vshf_h((v8i16)((v2i64){0x0004000200010000, 0x0009000800060005}), msa_dupq_n_s16(0), vec.val));\n    return c;\n}\n\ninline v_uint16x8 v_pack_triplets(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); }\ninline v_int32x4 v_pack_triplets(const v_int32x4& vec) { return vec; }\ninline v_uint32x4 v_pack_triplets(const v_uint32x4& vec) { return vec; }\ninline v_float32x4 v_pack_triplets(const v_float32x4& vec) { return vec; }\n\ninline v_float64x2 v_lut(const double* tab, const int* idx)\n{\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        tab[idx[0]],\n        tab[idx[1]]\n    };\n    return v_float64x2(msa_ld1q_f64(elems));\n}\n\ninline v_float64x2 v_lut_pairs(const double* tab, const int* idx)\n{\n    return v_float64x2(msa_ld1q_f64(tab + idx[0]));\n}\n\ninline v_float64x2 v_lut(const double* tab, const v_int32x4& idxvec)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n\n    return v_float64x2(tab[idx[0]], tab[idx[1]]);\n}\n\ninline void v_lut_deinterleave(const double* tab, const v_int32x4& idxvec, v_float64x2& x, v_float64x2& y)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n\n    v2f64 xy0 = msa_ld1q_f64(tab + idx[0]);\n    v2f64 xy1 = msa_ld1q_f64(tab + idx[1]);\n    x = v_float64x2(MSA_TPV_REINTERPRET(v2f64, msa_ilvevq_s64(MSA_TPV_REINTERPRET(v2i64, xy1), MSA_TPV_REINTERPRET(v2i64, xy0))));\n    y = v_float64x2(MSA_TPV_REINTERPRET(v2f64, msa_ilvodq_s64(MSA_TPV_REINTERPRET(v2i64, xy1), MSA_TPV_REINTERPRET(v2i64, xy0))));\n}\n\ntemplate<int i, typename _Tp>\ninline typename _Tp::lane_type v_extract_n(const _Tp& a)\n{\n    return v_rotate_right<i>(a).get0();\n}\n\ntemplate<int i>\ninline v_uint32x4 v_broadcast_element(const v_uint32x4& a)\n{\n    return v_setall_u32(v_extract_n<i>(a));\n}\ntemplate<int i>\ninline v_int32x4 v_broadcast_element(const v_int32x4& a)\n{\n    return v_setall_s32(v_extract_n<i>(a));\n}\ntemplate<int i>\ninline v_float32x4 v_broadcast_element(const v_float32x4& a)\n{\n    return v_setall_f32(v_extract_n<i>(a));\n}\n\n////// FP16 support ///////\n#if CV_FP16\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n#ifndef msa_ld1_f16\n    v4f16 v = (v4f16)msa_ld1_s16((const short*)ptr);\n#else\n    v4f16 v = msa_ld1_f16((const __fp16*)ptr);\n#endif\n    return v_float32x4(msa_cvt_f32_f16(v));\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n    v4f16 hv = msa_cvt_f16_f32(v.val);\n\n#ifndef msa_st1_f16\n    msa_st1_s16((short*)ptr, (int16x4_t)hv);\n#else\n    msa_st1_f16((__fp16*)ptr, hv);\n#endif\n}\n#else\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n    float buf[4];\n    for( int i = 0; i < 4; i++ )\n        buf[i] = (float)ptr[i];\n    return v_load(buf);\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n    float buf[4];\n    v_store(buf, v);\n    for( int i = 0; i < 4; i++ )\n        ptr[i] = (float16_t)buf[i];\n}\n#endif\n\ninline void v_cleanup() {}\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_neon.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_HAL_INTRIN_NEON_HPP\n#define OPENCV_HAL_INTRIN_NEON_HPP\n\n#include <algorithm>\n#include \"opencv2/core/utility.hpp\"\n\nnamespace cv\n{\n\n//! @cond IGNORED\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n#define CV_SIMD128 1\n#if defined(__aarch64__) || defined(_M_ARM64)\n#define CV_SIMD128_64F 1\n#else\n#define CV_SIMD128_64F 0\n#endif\n\n// The following macro checks if the code is being compiled for the\n// AArch64 execution state of Armv8, to enable the 128-bit\n// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by\n// the Arm C Language Extension (ACLE) specifications [1] to check the\n// availability of 128-bit intrinsics, and it is supporrted by clang\n// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft\n// Visual Studio [2] .\n//\n// [1] https://developer.arm.com/documentation/101028/0012/13--Advanced-SIMD--Neon--intrinsics\n// [2] https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros\n#if defined(__ARM_64BIT_STATE) || defined(_M_ARM64)\n#define CV_NEON_AARCH64 1\n#else\n#define CV_NEON_AARCH64 0\n#endif\n\n// TODO\n#define CV_NEON_DOT 0\n\n//////////// Utils ////////////\n\n#if CV_SIMD128_64F\n#define OPENCV_HAL_IMPL_NEON_UNZIP(_Tpv, _Tpvx2, suffix) \\\n    inline void _v128_unzip(const _Tpv& a, const _Tpv& b, _Tpv& c, _Tpv& d) \\\n    { c = vuzp1q_##suffix(a, b); d = vuzp2q_##suffix(a, b); }\n#define OPENCV_HAL_IMPL_NEON_UNZIP_L(_Tpv, _Tpvx2, suffix) \\\n    inline void _v128_unzip(const _Tpv&a, const _Tpv&b, _Tpv& c, _Tpv& d) \\\n    { c = vuzp1_##suffix(a, b); d = vuzp2_##suffix(a, b); }\n#else\n#define OPENCV_HAL_IMPL_NEON_UNZIP(_Tpv, _Tpvx2, suffix) \\\n    inline void _v128_unzip(const _Tpv& a, const _Tpv& b, _Tpv& c, _Tpv& d) \\\n    { _Tpvx2 ab = vuzpq_##suffix(a, b); c = ab.val[0]; d = ab.val[1]; }\n#define OPENCV_HAL_IMPL_NEON_UNZIP_L(_Tpv, _Tpvx2, suffix) \\\n    inline void _v128_unzip(const _Tpv& a, const _Tpv& b, _Tpv& c, _Tpv& d) \\\n    { _Tpvx2 ab = vuzp_##suffix(a, b); c = ab.val[0]; d = ab.val[1]; }\n#endif\n\n#if CV_SIMD128_64F\n#define OPENCV_HAL_IMPL_NEON_REINTERPRET(_Tpv, suffix) \\\n    template <typename T> static inline \\\n    _Tpv vreinterpretq_##suffix##_f64(T a) { return (_Tpv) a; } \\\n    template <typename T> static inline \\\n    float64x2_t vreinterpretq_f64_##suffix(T a) { return (float64x2_t) a; }\n#else\n#define OPENCV_HAL_IMPL_NEON_REINTERPRET(_Tpv, suffix)\n#endif\n\n#define OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(_Tpv, _Tpvl, suffix) \\\n    OPENCV_HAL_IMPL_NEON_UNZIP(_Tpv##_t, _Tpv##x2_t, suffix) \\\n    OPENCV_HAL_IMPL_NEON_UNZIP_L(_Tpvl##_t, _Tpvl##x2_t, suffix) \\\n    OPENCV_HAL_IMPL_NEON_REINTERPRET(_Tpv##_t, suffix)\n\n#define OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_I64(_Tpv, _Tpvl, suffix) \\\n    OPENCV_HAL_IMPL_NEON_REINTERPRET(_Tpv##_t, suffix)\n\n#define OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_F64(_Tpv, _Tpvl, suffix) \\\n    OPENCV_HAL_IMPL_NEON_UNZIP(_Tpv##_t, _Tpv##x2_t, suffix)\n\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(uint8x16, uint8x8,  u8)\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(int8x16,  int8x8,   s8)\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(uint16x8, uint16x4, u16)\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(int16x8,  int16x4,  s16)\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(uint32x4, uint32x2, u32)\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(int32x4,  int32x2,  s32)\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(float32x4, float32x2, f32)\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_I64(uint64x2, uint64x1, u64)\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_I64(int64x2,  int64x1,  s64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_F64(float64x2, float64x1,f64)\n#endif\n\n//////////// Types ////////////\n\nstruct v_uint8x16\n{\n    typedef uchar lane_type;\n    enum { nlanes = 16 };\n\n    v_uint8x16() {}\n    explicit v_uint8x16(uint8x16_t v) : val(v) {}\n    v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7,\n               uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15)\n    {\n        uchar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        val = vld1q_u8(v);\n    }\n    uchar get0() const\n    {\n        return vgetq_lane_u8(val, 0);\n    }\n\n    uint8x16_t val;\n};\n\nstruct v_int8x16\n{\n    typedef schar lane_type;\n    enum { nlanes = 16 };\n\n    v_int8x16() {}\n    explicit v_int8x16(int8x16_t v) : val(v) {}\n    v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7,\n               schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15)\n    {\n        schar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        val = vld1q_s8(v);\n    }\n    schar get0() const\n    {\n        return vgetq_lane_s8(val, 0);\n    }\n\n    int8x16_t val;\n};\n\nstruct v_uint16x8\n{\n    typedef ushort lane_type;\n    enum { nlanes = 8 };\n\n    v_uint16x8() {}\n    explicit v_uint16x8(uint16x8_t v) : val(v) {}\n    v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)\n    {\n        ushort v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        val = vld1q_u16(v);\n    }\n    ushort get0() const\n    {\n        return vgetq_lane_u16(val, 0);\n    }\n\n    uint16x8_t val;\n};\n\nstruct v_int16x8\n{\n    typedef short lane_type;\n    enum { nlanes = 8 };\n\n    v_int16x8() {}\n    explicit v_int16x8(int16x8_t v) : val(v) {}\n    v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)\n    {\n        short v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        val = vld1q_s16(v);\n    }\n    short get0() const\n    {\n        return vgetq_lane_s16(val, 0);\n    }\n\n    int16x8_t val;\n};\n\nstruct v_uint32x4\n{\n    typedef unsigned lane_type;\n    enum { nlanes = 4 };\n\n    v_uint32x4() {}\n    explicit v_uint32x4(uint32x4_t v) : val(v) {}\n    v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3)\n    {\n        unsigned v[] = {v0, v1, v2, v3};\n        val = vld1q_u32(v);\n    }\n    unsigned get0() const\n    {\n        return vgetq_lane_u32(val, 0);\n    }\n\n    uint32x4_t val;\n};\n\nstruct v_int32x4\n{\n    typedef int lane_type;\n    enum { nlanes = 4 };\n\n    v_int32x4() {}\n    explicit v_int32x4(int32x4_t v) : val(v) {}\n    v_int32x4(int v0, int v1, int v2, int v3)\n    {\n        int v[] = {v0, v1, v2, v3};\n        val = vld1q_s32(v);\n    }\n    int get0() const\n    {\n        return vgetq_lane_s32(val, 0);\n    }\n    int32x4_t val;\n};\n\nstruct v_float32x4\n{\n    typedef float lane_type;\n    enum { nlanes = 4 };\n\n    v_float32x4() {}\n    explicit v_float32x4(float32x4_t v) : val(v) {}\n    v_float32x4(float v0, float v1, float v2, float v3)\n    {\n        float v[] = {v0, v1, v2, v3};\n        val = vld1q_f32(v);\n    }\n    float get0() const\n    {\n        return vgetq_lane_f32(val, 0);\n    }\n    float32x4_t val;\n};\n\nstruct v_uint64x2\n{\n    typedef uint64 lane_type;\n    enum { nlanes = 2 };\n\n    v_uint64x2() {}\n    explicit v_uint64x2(uint64x2_t v) : val(v) {}\n    v_uint64x2(uint64 v0, uint64 v1)\n    {\n        uint64 v[] = {v0, v1};\n        val = vld1q_u64(v);\n    }\n    uint64 get0() const\n    {\n        return vgetq_lane_u64(val, 0);\n    }\n    uint64x2_t val;\n};\n\nstruct v_int64x2\n{\n    typedef int64 lane_type;\n    enum { nlanes = 2 };\n\n    v_int64x2() {}\n    explicit v_int64x2(int64x2_t v) : val(v) {}\n    v_int64x2(int64 v0, int64 v1)\n    {\n        int64 v[] = {v0, v1};\n        val = vld1q_s64(v);\n    }\n    int64 get0() const\n    {\n        return vgetq_lane_s64(val, 0);\n    }\n    int64x2_t val;\n};\n\n#if CV_SIMD128_64F\nstruct v_float64x2\n{\n    typedef double lane_type;\n    enum { nlanes = 2 };\n\n    v_float64x2() {}\n    explicit v_float64x2(float64x2_t v) : val(v) {}\n    v_float64x2(double v0, double v1)\n    {\n        double v[] = {v0, v1};\n        val = vld1q_f64(v);\n    }\n    double get0() const\n    {\n        return vgetq_lane_f64(val, 0);\n    }\n    float64x2_t val;\n};\n#endif\n\n#define OPENCV_HAL_IMPL_NEON_INIT(_Tpv, _Tp, suffix) \\\ninline v_##_Tpv v_setzero_##suffix() { return v_##_Tpv(vdupq_n_##suffix((_Tp)0)); } \\\ninline v_##_Tpv v_setall_##suffix(_Tp v) { return v_##_Tpv(vdupq_n_##suffix(v)); } \\\ninline _Tpv##_t vreinterpretq_##suffix##_##suffix(_Tpv##_t v) { return v; } \\\ninline v_uint8x16 v_reinterpret_as_u8(const v_##_Tpv& v) { return v_uint8x16(vreinterpretq_u8_##suffix(v.val)); } \\\ninline v_int8x16 v_reinterpret_as_s8(const v_##_Tpv& v) { return v_int8x16(vreinterpretq_s8_##suffix(v.val)); } \\\ninline v_uint16x8 v_reinterpret_as_u16(const v_##_Tpv& v) { return v_uint16x8(vreinterpretq_u16_##suffix(v.val)); } \\\ninline v_int16x8 v_reinterpret_as_s16(const v_##_Tpv& v) { return v_int16x8(vreinterpretq_s16_##suffix(v.val)); } \\\ninline v_uint32x4 v_reinterpret_as_u32(const v_##_Tpv& v) { return v_uint32x4(vreinterpretq_u32_##suffix(v.val)); } \\\ninline v_int32x4 v_reinterpret_as_s32(const v_##_Tpv& v) { return v_int32x4(vreinterpretq_s32_##suffix(v.val)); } \\\ninline v_uint64x2 v_reinterpret_as_u64(const v_##_Tpv& v) { return v_uint64x2(vreinterpretq_u64_##suffix(v.val)); } \\\ninline v_int64x2 v_reinterpret_as_s64(const v_##_Tpv& v) { return v_int64x2(vreinterpretq_s64_##suffix(v.val)); } \\\ninline v_float32x4 v_reinterpret_as_f32(const v_##_Tpv& v) { return v_float32x4(vreinterpretq_f32_##suffix(v.val)); }\n\nOPENCV_HAL_IMPL_NEON_INIT(uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_NEON_INIT(int8x16, schar, s8)\nOPENCV_HAL_IMPL_NEON_INIT(uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_NEON_INIT(int16x8, short, s16)\nOPENCV_HAL_IMPL_NEON_INIT(uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_NEON_INIT(int32x4, int, s32)\nOPENCV_HAL_IMPL_NEON_INIT(uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_NEON_INIT(int64x2, int64, s64)\nOPENCV_HAL_IMPL_NEON_INIT(float32x4, float, f32)\n#if CV_SIMD128_64F\n#define OPENCV_HAL_IMPL_NEON_INIT_64(_Tpv, suffix) \\\ninline v_float64x2 v_reinterpret_as_f64(const v_##_Tpv& v) { return v_float64x2(vreinterpretq_f64_##suffix(v.val)); }\nOPENCV_HAL_IMPL_NEON_INIT(float64x2, double, f64)\nOPENCV_HAL_IMPL_NEON_INIT_64(uint8x16, u8)\nOPENCV_HAL_IMPL_NEON_INIT_64(int8x16, s8)\nOPENCV_HAL_IMPL_NEON_INIT_64(uint16x8, u16)\nOPENCV_HAL_IMPL_NEON_INIT_64(int16x8, s16)\nOPENCV_HAL_IMPL_NEON_INIT_64(uint32x4, u32)\nOPENCV_HAL_IMPL_NEON_INIT_64(int32x4, s32)\nOPENCV_HAL_IMPL_NEON_INIT_64(uint64x2, u64)\nOPENCV_HAL_IMPL_NEON_INIT_64(int64x2, s64)\nOPENCV_HAL_IMPL_NEON_INIT_64(float32x4, f32)\nOPENCV_HAL_IMPL_NEON_INIT_64(float64x2, f64)\n#endif\n\n#define OPENCV_HAL_IMPL_NEON_PACK(_Tpvec, _Tp, hreg, suffix, _Tpwvec, pack, mov, rshr) \\\ninline _Tpvec v_##pack(const _Tpwvec& a, const _Tpwvec& b) \\\n{ \\\n    hreg a1 = mov(a.val), b1 = mov(b.val); \\\n    return _Tpvec(vcombine_##suffix(a1, b1)); \\\n} \\\ninline void v_##pack##_store(_Tp* ptr, const _Tpwvec& a) \\\n{ \\\n    hreg a1 = mov(a.val); \\\n    vst1_##suffix(ptr, a1); \\\n} \\\ntemplate<int n> inline \\\n_Tpvec v_rshr_##pack(const _Tpwvec& a, const _Tpwvec& b) \\\n{ \\\n    hreg a1 = rshr(a.val, n); \\\n    hreg b1 = rshr(b.val, n); \\\n    return _Tpvec(vcombine_##suffix(a1, b1)); \\\n} \\\ntemplate<int n> inline \\\nvoid v_rshr_##pack##_store(_Tp* ptr, const _Tpwvec& a) \\\n{ \\\n    hreg a1 = rshr(a.val, n); \\\n    vst1_##suffix(ptr, a1); \\\n}\n\nOPENCV_HAL_IMPL_NEON_PACK(v_uint8x16, uchar, uint8x8_t, u8, v_uint16x8, pack, vqmovn_u16, vqrshrn_n_u16)\nOPENCV_HAL_IMPL_NEON_PACK(v_int8x16, schar, int8x8_t, s8, v_int16x8, pack, vqmovn_s16, vqrshrn_n_s16)\nOPENCV_HAL_IMPL_NEON_PACK(v_uint16x8, ushort, uint16x4_t, u16, v_uint32x4, pack, vqmovn_u32, vqrshrn_n_u32)\nOPENCV_HAL_IMPL_NEON_PACK(v_int16x8, short, int16x4_t, s16, v_int32x4, pack, vqmovn_s32, vqrshrn_n_s32)\nOPENCV_HAL_IMPL_NEON_PACK(v_uint32x4, unsigned, uint32x2_t, u32, v_uint64x2, pack, vmovn_u64, vrshrn_n_u64)\nOPENCV_HAL_IMPL_NEON_PACK(v_int32x4, int, int32x2_t, s32, v_int64x2, pack, vmovn_s64, vrshrn_n_s64)\n\nOPENCV_HAL_IMPL_NEON_PACK(v_uint8x16, uchar, uint8x8_t, u8, v_int16x8, pack_u, vqmovun_s16, vqrshrun_n_s16)\nOPENCV_HAL_IMPL_NEON_PACK(v_uint16x8, ushort, uint16x4_t, u16, v_int32x4, pack_u, vqmovun_s32, vqrshrun_n_s32)\n\n// pack boolean\ninline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b)\n{\n    uint8x16_t ab = vcombine_u8(vmovn_u16(a.val), vmovn_u16(b.val));\n    return v_uint8x16(ab);\n}\n\ninline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b,\n                           const v_uint32x4& c, const v_uint32x4& d)\n{\n    uint16x8_t nab = vcombine_u16(vmovn_u32(a.val), vmovn_u32(b.val));\n    uint16x8_t ncd = vcombine_u16(vmovn_u32(c.val), vmovn_u32(d.val));\n    return v_uint8x16(vcombine_u8(vmovn_u16(nab), vmovn_u16(ncd)));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c,\n                           const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f,\n                           const v_uint64x2& g, const v_uint64x2& h)\n{\n    uint32x4_t ab = vcombine_u32(vmovn_u64(a.val), vmovn_u64(b.val));\n    uint32x4_t cd = vcombine_u32(vmovn_u64(c.val), vmovn_u64(d.val));\n    uint32x4_t ef = vcombine_u32(vmovn_u64(e.val), vmovn_u64(f.val));\n    uint32x4_t gh = vcombine_u32(vmovn_u64(g.val), vmovn_u64(h.val));\n\n    uint16x8_t abcd = vcombine_u16(vmovn_u32(ab), vmovn_u32(cd));\n    uint16x8_t efgh = vcombine_u16(vmovn_u32(ef), vmovn_u32(gh));\n    return v_uint8x16(vcombine_u8(vmovn_u16(abcd), vmovn_u16(efgh)));\n}\n\ninline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0,\n                            const v_float32x4& m1, const v_float32x4& m2,\n                            const v_float32x4& m3)\n{\n    float32x2_t vl = vget_low_f32(v.val), vh = vget_high_f32(v.val);\n    float32x4_t res = vmulq_lane_f32(m0.val, vl, 0);\n    res = vmlaq_lane_f32(res, m1.val, vl, 1);\n    res = vmlaq_lane_f32(res, m2.val, vh, 0);\n    res = vmlaq_lane_f32(res, m3.val, vh, 1);\n    return v_float32x4(res);\n}\n\ninline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0,\n                               const v_float32x4& m1, const v_float32x4& m2,\n                               const v_float32x4& a)\n{\n    float32x2_t vl = vget_low_f32(v.val), vh = vget_high_f32(v.val);\n    float32x4_t res = vmulq_lane_f32(m0.val, vl, 0);\n    res = vmlaq_lane_f32(res, m1.val, vl, 1);\n    res = vmlaq_lane_f32(res, m2.val, vh, 0);\n    res = vaddq_f32(res, a.val);\n    return v_float32x4(res);\n}\n\n#define OPENCV_HAL_IMPL_NEON_BIN_OP(bin_op, _Tpvec, intrin) \\\ninline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val)); \\\n} \\\ninline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \\\n{ \\\n    a.val = intrin(a.val, b.val); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_uint8x16, vqaddq_u8)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_uint8x16, vqsubq_u8)\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_int8x16, vqaddq_s8)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_int8x16, vqsubq_s8)\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_uint16x8, vqaddq_u16)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_uint16x8, vqsubq_u16)\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_int16x8, vqaddq_s16)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_int16x8, vqsubq_s16)\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_int32x4, vaddq_s32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_int32x4, vsubq_s32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(*, v_int32x4, vmulq_s32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_uint32x4, vaddq_u32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_uint32x4, vsubq_u32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(*, v_uint32x4, vmulq_u32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_float32x4, vaddq_f32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_float32x4, vsubq_f32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(*, v_float32x4, vmulq_f32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_int64x2, vaddq_s64)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_int64x2, vsubq_s64)\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_uint64x2, vaddq_u64)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_uint64x2, vsubq_u64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_BIN_OP(/, v_float32x4, vdivq_f32)\nOPENCV_HAL_IMPL_NEON_BIN_OP(+, v_float64x2, vaddq_f64)\nOPENCV_HAL_IMPL_NEON_BIN_OP(-, v_float64x2, vsubq_f64)\nOPENCV_HAL_IMPL_NEON_BIN_OP(*, v_float64x2, vmulq_f64)\nOPENCV_HAL_IMPL_NEON_BIN_OP(/, v_float64x2, vdivq_f64)\n#else\ninline v_float32x4 operator / (const v_float32x4& a, const v_float32x4& b)\n{\n    float32x4_t reciprocal = vrecpeq_f32(b.val);\n    reciprocal = vmulq_f32(vrecpsq_f32(b.val, reciprocal), reciprocal);\n    reciprocal = vmulq_f32(vrecpsq_f32(b.val, reciprocal), reciprocal);\n    return v_float32x4(vmulq_f32(a.val, reciprocal));\n}\ninline v_float32x4& operator /= (v_float32x4& a, const v_float32x4& b)\n{\n    float32x4_t reciprocal = vrecpeq_f32(b.val);\n    reciprocal = vmulq_f32(vrecpsq_f32(b.val, reciprocal), reciprocal);\n    reciprocal = vmulq_f32(vrecpsq_f32(b.val, reciprocal), reciprocal);\n    a.val = vmulq_f32(a.val, reciprocal);\n    return a;\n}\n#endif\n\n// saturating multiply 8-bit, 16-bit\n#define OPENCV_HAL_IMPL_NEON_MUL_SAT(_Tpvec, _Tpwvec)            \\\n    inline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b)  \\\n    {                                                            \\\n        _Tpwvec c, d;                                            \\\n        v_mul_expand(a, b, c, d);                                \\\n        return v_pack(c, d);                                     \\\n    }                                                            \\\n    inline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b)      \\\n    { a = a * b; return a; }\n\nOPENCV_HAL_IMPL_NEON_MUL_SAT(v_int8x16,  v_int16x8)\nOPENCV_HAL_IMPL_NEON_MUL_SAT(v_uint8x16, v_uint16x8)\nOPENCV_HAL_IMPL_NEON_MUL_SAT(v_int16x8,  v_int32x4)\nOPENCV_HAL_IMPL_NEON_MUL_SAT(v_uint16x8, v_uint32x4)\n\n//  Multiply and expand\ninline void v_mul_expand(const v_int8x16& a, const v_int8x16& b,\n                         v_int16x8& c, v_int16x8& d)\n{\n    c.val = vmull_s8(vget_low_s8(a.val), vget_low_s8(b.val));\n#if CV_NEON_AARCH64\n    d.val = vmull_high_s8(a.val, b.val);\n#else // #if CV_NEON_AARCH64\n    d.val = vmull_s8(vget_high_s8(a.val), vget_high_s8(b.val));\n#endif // #if CV_NEON_AARCH64\n}\n\ninline void v_mul_expand(const v_uint8x16& a, const v_uint8x16& b,\n                         v_uint16x8& c, v_uint16x8& d)\n{\n    c.val = vmull_u8(vget_low_u8(a.val), vget_low_u8(b.val));\n#if CV_NEON_AARCH64\n    d.val = vmull_high_u8(a.val, b.val);\n#else // #if CV_NEON_AARCH64\n    d.val = vmull_u8(vget_high_u8(a.val), vget_high_u8(b.val));\n#endif // #if CV_NEON_AARCH64\n}\n\ninline void v_mul_expand(const v_int16x8& a, const v_int16x8& b,\n                         v_int32x4& c, v_int32x4& d)\n{\n    c.val = vmull_s16(vget_low_s16(a.val), vget_low_s16(b.val));\n#if CV_NEON_AARCH64\n    d.val = vmull_high_s16(a.val, b.val);\n#else // #if CV_NEON_AARCH64\n    d.val = vmull_s16(vget_high_s16(a.val), vget_high_s16(b.val));\n#endif // #if CV_NEON_AARCH64\n}\n\ninline void v_mul_expand(const v_uint16x8& a, const v_uint16x8& b,\n                         v_uint32x4& c, v_uint32x4& d)\n{\n    c.val = vmull_u16(vget_low_u16(a.val), vget_low_u16(b.val));\n#if CV_NEON_AARCH64\n    d.val = vmull_high_u16(a.val, b.val);\n#else // #if CV_NEON_AARCH64\n    d.val = vmull_u16(vget_high_u16(a.val), vget_high_u16(b.val));\n#endif // #if CV_NEON_AARCH64\n}\n\ninline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b,\n                         v_uint64x2& c, v_uint64x2& d)\n{\n    c.val = vmull_u32(vget_low_u32(a.val), vget_low_u32(b.val));\n#if CV_NEON_AARCH64\n    d.val = vmull_high_u32(a.val, b.val);\n#else // #if CV_NEON_AARCH64\n    d.val = vmull_u32(vget_high_u32(a.val), vget_high_u32(b.val));\n#endif // #if CV_NEON_AARCH64\n}\n\ninline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b)\n{\n    return v_int16x8(vcombine_s16(\n                                  vshrn_n_s32(vmull_s16( vget_low_s16(a.val),  vget_low_s16(b.val)), 16),\n                                  vshrn_n_s32(\n#if CV_NEON_AARCH64\n                                    vmull_high_s16(a.val, b.val)\n#else // #if CV_NEON_AARCH64\n                                    vmull_s16(vget_high_s16(a.val), vget_high_s16(b.val))\n#endif // #if CV_NEON_AARCH64\n                                    , 16)\n                                 ));\n}\ninline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b)\n{\n    return v_uint16x8(vcombine_u16(\n                                   vshrn_n_u32(vmull_u16( vget_low_u16(a.val),  vget_low_u16(b.val)), 16),\n                                   vshrn_n_u32(\n#if CV_NEON_AARCH64\n                                    vmull_high_u16(a.val, b.val)\n#else // #if CV_NEON_AARCH64\n                                    vmull_u16(vget_high_u16(a.val), vget_high_u16(b.val))\n#endif // #if CV_NEON_AARCH64\n                                    , 16)\n                                  ));\n}\n\n//////// Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b)\n{\n    int16x8_t uzp1, uzp2;\n    _v128_unzip(a.val, b.val, uzp1, uzp2);\n    int16x4_t a0 = vget_low_s16(uzp1);\n    int16x4_t b0 = vget_high_s16(uzp1);\n    int16x4_t a1 = vget_low_s16(uzp2);\n    int16x4_t b1 = vget_high_s16(uzp2);\n    int32x4_t p = vmull_s16(a0, b0);\n    return v_int32x4(vmlal_s16(p, a1, b1));\n}\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{\n    int16x8_t uzp1, uzp2;\n    _v128_unzip(a.val, b.val, uzp1, uzp2);\n    int16x4_t a0 = vget_low_s16(uzp1);\n    int16x4_t b0 = vget_high_s16(uzp1);\n    int16x4_t a1 = vget_low_s16(uzp2);\n    int16x4_t b1 = vget_high_s16(uzp2);\n    int32x4_t p = vmlal_s16(c.val, a0, b0);\n    return v_int32x4(vmlal_s16(p, a1, b1));\n}\n\n// 32 >> 64\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b)\n{\n    int32x4_t uzp1, uzp2;\n    _v128_unzip(a.val, b.val, uzp1, uzp2);\n    int32x2_t a0 = vget_low_s32(uzp1);\n    int32x2_t b0 = vget_high_s32(uzp1);\n    int32x2_t a1 = vget_low_s32(uzp2);\n    int32x2_t b1 = vget_high_s32(uzp2);\n    int64x2_t p = vmull_s32(a0, b0);\n    return v_int64x2(vmlal_s32(p, a1, b1));\n}\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{\n    int32x4_t uzp1, uzp2;\n    _v128_unzip(a.val, b.val, uzp1, uzp2);\n    int32x2_t a0 = vget_low_s32(uzp1);\n    int32x2_t b0 = vget_high_s32(uzp1);\n    int32x2_t a1 = vget_low_s32(uzp2);\n    int32x2_t b1 = vget_high_s32(uzp2);\n    int64x2_t p = vmlal_s32(c.val, a0, b0);\n    return v_int64x2(vmlal_s32(p, a1, b1));\n}\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b)\n{\n#if CV_NEON_DOT\n    return v_uint32x4(vdotq_u32(vdupq_n_u32(0), a.val, b.val));\n#else\n    const uint8x16_t zero   = vreinterpretq_u8_u32(vdupq_n_u32(0));\n    const uint8x16_t mask   = vreinterpretq_u8_u32(vdupq_n_u32(0x00FF00FF));\n    const uint16x8_t zero32 = vreinterpretq_u16_u32(vdupq_n_u32(0));\n    const uint16x8_t mask32 = vreinterpretq_u16_u32(vdupq_n_u32(0x0000FFFF));\n\n    uint16x8_t even = vmulq_u16(vreinterpretq_u16_u8(vbslq_u8(mask, a.val, zero)),\n                                vreinterpretq_u16_u8(vbslq_u8(mask, b.val, zero)));\n    uint16x8_t odd  = vmulq_u16(vshrq_n_u16(vreinterpretq_u16_u8(a.val), 8),\n                                vshrq_n_u16(vreinterpretq_u16_u8(b.val), 8));\n\n    uint32x4_t s0 = vaddq_u32(vreinterpretq_u32_u16(vbslq_u16(mask32, even, zero32)),\n                              vreinterpretq_u32_u16(vbslq_u16(mask32, odd,  zero32)));\n    uint32x4_t s1 = vaddq_u32(vshrq_n_u32(vreinterpretq_u32_u16(even), 16),\n                              vshrq_n_u32(vreinterpretq_u32_u16(odd),  16));\n    return v_uint32x4(vaddq_u32(s0, s1));\n#endif\n}\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b,\n                                   const v_uint32x4& c)\n{\n#if CV_NEON_DOT\n    return v_uint32x4(vdotq_u32(c.val, a.val, b.val));\n#else\n    return v_dotprod_expand(a, b) + c;\n#endif\n}\n\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b)\n{\n#if CV_NEON_DOT\n    return v_int32x4(vdotq_s32(vdupq_n_s32(0), a.val, b.val));\n#else\n    int16x8_t p0  = vmull_s8(vget_low_s8(a.val), vget_low_s8(b.val));\n    int16x8_t p1  = vmull_s8(vget_high_s8(a.val), vget_high_s8(b.val));\n    int16x8_t uzp1, uzp2;\n    _v128_unzip(p0, p1, uzp1, uzp2);\n    int16x8_t sum = vaddq_s16(uzp1, uzp2);\n    int16x4_t uzpl1, uzpl2;\n    _v128_unzip(vget_low_s16(sum), vget_high_s16(sum), uzpl1, uzpl2);\n    return v_int32x4(vaddl_s16(uzpl1, uzpl2));\n#endif\n}\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b,\n                                  const v_int32x4& c)\n{\n#if CV_NEON_DOT\n    return v_int32x4(vdotq_s32(c.val, a.val, b.val));\n#else\n    return v_dotprod_expand(a, b) + c;\n#endif\n}\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b)\n{\n    const uint16x8_t zero = vreinterpretq_u16_u32(vdupq_n_u32(0));\n    const uint16x8_t mask = vreinterpretq_u16_u32(vdupq_n_u32(0x0000FFFF));\n\n    uint32x4_t even = vmulq_u32(vreinterpretq_u32_u16(vbslq_u16(mask, a.val, zero)),\n                                vreinterpretq_u32_u16(vbslq_u16(mask, b.val, zero)));\n    uint32x4_t odd  = vmulq_u32(vshrq_n_u32(vreinterpretq_u32_u16(a.val), 16),\n                                vshrq_n_u32(vreinterpretq_u32_u16(b.val), 16));\n    uint32x4_t uzp1, uzp2;\n    _v128_unzip(even, odd, uzp1, uzp2);\n    uint64x2_t s0  = vaddl_u32(vget_low_u32(uzp1), vget_high_u32(uzp1));\n    uint64x2_t s1  = vaddl_u32(vget_low_u32(uzp2), vget_high_u32(uzp2));\n    return v_uint64x2(vaddq_u64(s0, s1));\n}\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b)\n{\n    int32x4_t p0  = vmull_s16(vget_low_s16(a.val),  vget_low_s16(b.val));\n    int32x4_t p1  = vmull_s16(vget_high_s16(a.val), vget_high_s16(b.val));\n\n    int32x4_t uzp1, uzp2;\n    _v128_unzip(p0, p1, uzp1, uzp2);\n    int32x4_t sum = vaddq_s32(uzp1, uzp2);\n\n    int32x2_t uzpl1, uzpl2;\n    _v128_unzip(vget_low_s32(sum), vget_high_s32(sum), uzpl1, uzpl2);\n    return v_int64x2(vaddl_s32(uzpl1, uzpl2));\n}\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b,\n                                  const v_int64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 32 >> 64f\n#if CV_SIMD128_64F\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b)\n{ return v_cvt_f64(v_dotprod(a, b)); }\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a,   const v_int32x4& b,\n                                    const v_float64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n#endif\n\n//////// Fast Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b)\n{\n#if CV_NEON_AARCH64\n    int32x4_t p = vmull_s16(vget_low_s16(a.val), vget_low_s16(b.val));\n    return v_int32x4(vmlal_high_s16(p, a.val, b.val));\n#else\n    int16x4_t a0 = vget_low_s16(a.val);\n    int16x4_t a1 = vget_high_s16(a.val);\n    int16x4_t b0 = vget_low_s16(b.val);\n    int16x4_t b1 = vget_high_s16(b.val);\n    int32x4_t p = vmull_s16(a0, b0);\n    return v_int32x4(vmlal_s16(p, a1, b1));\n#endif\n}\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{\n#if CV_NEON_AARCH64\n    int32x4_t p = vmlal_s16(c.val, vget_low_s16(a.val), vget_low_s16(b.val));\n    return v_int32x4(vmlal_high_s16(p, a.val, b.val));\n#else\n    int16x4_t a0 = vget_low_s16(a.val);\n    int16x4_t a1 = vget_high_s16(a.val);\n    int16x4_t b0 = vget_low_s16(b.val);\n    int16x4_t b1 = vget_high_s16(b.val);\n    int32x4_t p = vmlal_s16(c.val, a0, b0);\n    return v_int32x4(vmlal_s16(p, a1, b1));\n#endif\n}\n\n// 32 >> 64\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b)\n{\n#if CV_NEON_AARCH64\n    int64x2_t p = vmull_s32(vget_low_s32(a.val), vget_low_s32(b.val));\n    return v_int64x2(vmlal_high_s32(p, a.val, b.val));\n#else\n    int32x2_t a0 = vget_low_s32(a.val);\n    int32x2_t a1 = vget_high_s32(a.val);\n    int32x2_t b0 = vget_low_s32(b.val);\n    int32x2_t b1 = vget_high_s32(b.val);\n    int64x2_t p = vmull_s32(a0, b0);\n    return v_int64x2(vmlal_s32(p, a1, b1));\n#endif\n}\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{\n#if CV_NEON_AARCH64\n    int64x2_t p = vmlal_s32(c.val, vget_low_s32(a.val), vget_low_s32(b.val));\n    return v_int64x2(vmlal_high_s32(p, a.val, b.val));\n#else\n    int32x2_t a0 = vget_low_s32(a.val);\n    int32x2_t a1 = vget_high_s32(a.val);\n    int32x2_t b0 = vget_low_s32(b.val);\n    int32x2_t b1 = vget_high_s32(b.val);\n    int64x2_t p = vmlal_s32(c.val, a0, b0);\n    return v_int64x2(vmlal_s32(p, a1, b1));\n#endif\n}\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b)\n{\n#if CV_NEON_DOT\n    return v_uint32x4(vdotq_u32(vdupq_n_u32(0), a.val, b.val));\n#else\n    uint16x8_t p0 = vmull_u8(vget_low_u8(a.val), vget_low_u8(b.val));\n    uint16x8_t p1 = vmull_u8(vget_high_u8(a.val), vget_high_u8(b.val));\n    uint32x4_t s0 = vaddl_u16(vget_low_u16(p0), vget_low_u16(p1));\n    uint32x4_t s1 = vaddl_u16(vget_high_u16(p0), vget_high_u16(p1));\n    return v_uint32x4(vaddq_u32(s0, s1));\n#endif\n}\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{\n#if CV_NEON_DOT\n    return v_uint32x4(vdotq_u32(c.val, a.val, b.val));\n#else\n    return v_dotprod_expand_fast(a, b) + c;\n#endif\n}\n\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b)\n{\n#if CV_NEON_DOT\n    return v_int32x4(vdotq_s32(vdupq_n_s32(0), a.val, b.val));\n#else\n    int16x8_t prod = vmull_s8(vget_low_s8(a.val), vget_low_s8(b.val));\n    prod = vmlal_s8(prod, vget_high_s8(a.val), vget_high_s8(b.val));\n    return v_int32x4(vaddl_s16(vget_low_s16(prod), vget_high_s16(prod)));\n#endif\n}\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{\n#if CV_NEON_DOT\n    return v_int32x4(vdotq_s32(c.val, a.val, b.val));\n#else\n    return v_dotprod_expand_fast(a, b) + c;\n#endif\n}\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b)\n{\n    uint32x4_t p0  = vmull_u16(vget_low_u16(a.val),  vget_low_u16(b.val));\n    uint32x4_t p1  = vmull_u16(vget_high_u16(a.val), vget_high_u16(b.val));\n    uint64x2_t s0  = vaddl_u32(vget_low_u32(p0), vget_high_u32(p0));\n    uint64x2_t s1  = vaddl_u32(vget_low_u32(p1), vget_high_u32(p1));\n    return v_uint64x2(vaddq_u64(s0, s1));\n}\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b)\n{\n    int32x4_t prod = vmull_s16(vget_low_s16(a.val), vget_low_s16(b.val));\n    prod = vmlal_s16(prod, vget_high_s16(a.val), vget_high_s16(b.val));\n    return v_int64x2(vaddl_s32(vget_low_s32(prod), vget_high_s32(prod)));\n}\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\n// 32 >> 64f\n#if CV_SIMD128_64F\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_cvt_f64(v_dotprod_fast(a, b)); }\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n#endif\n\n\n#define OPENCV_HAL_IMPL_NEON_LOGIC_OP(_Tpvec, suffix) \\\n    OPENCV_HAL_IMPL_NEON_BIN_OP(&, _Tpvec, vandq_##suffix) \\\n    OPENCV_HAL_IMPL_NEON_BIN_OP(|, _Tpvec, vorrq_##suffix) \\\n    OPENCV_HAL_IMPL_NEON_BIN_OP(^, _Tpvec, veorq_##suffix) \\\n    inline _Tpvec operator ~ (const _Tpvec& a) \\\n    { \\\n        return _Tpvec(vreinterpretq_##suffix##_u8(vmvnq_u8(vreinterpretq_u8_##suffix(a.val)))); \\\n    }\n\nOPENCV_HAL_IMPL_NEON_LOGIC_OP(v_uint8x16, u8)\nOPENCV_HAL_IMPL_NEON_LOGIC_OP(v_int8x16, s8)\nOPENCV_HAL_IMPL_NEON_LOGIC_OP(v_uint16x8, u16)\nOPENCV_HAL_IMPL_NEON_LOGIC_OP(v_int16x8, s16)\nOPENCV_HAL_IMPL_NEON_LOGIC_OP(v_uint32x4, u32)\nOPENCV_HAL_IMPL_NEON_LOGIC_OP(v_int32x4, s32)\nOPENCV_HAL_IMPL_NEON_LOGIC_OP(v_uint64x2, u64)\nOPENCV_HAL_IMPL_NEON_LOGIC_OP(v_int64x2, s64)\n\n#define OPENCV_HAL_IMPL_NEON_FLT_BIT_OP(bin_op, intrin) \\\ninline v_float32x4 operator bin_op (const v_float32x4& a, const v_float32x4& b) \\\n{ \\\n    return v_float32x4(vreinterpretq_f32_s32(intrin(vreinterpretq_s32_f32(a.val), vreinterpretq_s32_f32(b.val)))); \\\n} \\\ninline v_float32x4& operator bin_op##= (v_float32x4& a, const v_float32x4& b) \\\n{ \\\n    a.val = vreinterpretq_f32_s32(intrin(vreinterpretq_s32_f32(a.val), vreinterpretq_s32_f32(b.val))); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_NEON_FLT_BIT_OP(&, vandq_s32)\nOPENCV_HAL_IMPL_NEON_FLT_BIT_OP(|, vorrq_s32)\nOPENCV_HAL_IMPL_NEON_FLT_BIT_OP(^, veorq_s32)\n\ninline v_float32x4 operator ~ (const v_float32x4& a)\n{\n    return v_float32x4(vreinterpretq_f32_s32(vmvnq_s32(vreinterpretq_s32_f32(a.val))));\n}\n\n#if CV_SIMD128_64F\ninline v_float32x4 v_sqrt(const v_float32x4& x)\n{\n    return v_float32x4(vsqrtq_f32(x.val));\n}\n\ninline v_float32x4 v_invsqrt(const v_float32x4& x)\n{\n    v_float32x4 one = v_setall_f32(1.0f);\n    return one / v_sqrt(x);\n}\n#else\ninline v_float32x4 v_sqrt(const v_float32x4& x)\n{\n    float32x4_t x1 = vmaxq_f32(x.val, vdupq_n_f32(FLT_MIN));\n    float32x4_t e = vrsqrteq_f32(x1);\n    e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x1, e), e), e);\n    e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x1, e), e), e);\n    return v_float32x4(vmulq_f32(x.val, e));\n}\n\ninline v_float32x4 v_invsqrt(const v_float32x4& x)\n{\n    float32x4_t e = vrsqrteq_f32(x.val);\n    e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x.val, e), e), e);\n    e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x.val, e), e), e);\n    return v_float32x4(e);\n}\n#endif\n\n#define OPENCV_HAL_IMPL_NEON_ABS(_Tpuvec, _Tpsvec, usuffix, ssuffix) \\\ninline _Tpuvec v_abs(const _Tpsvec& a) { return v_reinterpret_as_##usuffix(_Tpsvec(vabsq_##ssuffix(a.val))); }\n\nOPENCV_HAL_IMPL_NEON_ABS(v_uint8x16, v_int8x16, u8, s8)\nOPENCV_HAL_IMPL_NEON_ABS(v_uint16x8, v_int16x8, u16, s16)\nOPENCV_HAL_IMPL_NEON_ABS(v_uint32x4, v_int32x4, u32, s32)\n\ninline v_float32x4 v_abs(v_float32x4 x)\n{ return v_float32x4(vabsq_f32(x.val)); }\n\n#if CV_SIMD128_64F\n#define OPENCV_HAL_IMPL_NEON_DBL_BIT_OP(bin_op, intrin) \\\ninline v_float64x2 operator bin_op (const v_float64x2& a, const v_float64x2& b) \\\n{ \\\n    return v_float64x2(vreinterpretq_f64_s64(intrin(vreinterpretq_s64_f64(a.val), vreinterpretq_s64_f64(b.val)))); \\\n} \\\ninline v_float64x2& operator bin_op##= (v_float64x2& a, const v_float64x2& b) \\\n{ \\\n    a.val = vreinterpretq_f64_s64(intrin(vreinterpretq_s64_f64(a.val), vreinterpretq_s64_f64(b.val))); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_NEON_DBL_BIT_OP(&, vandq_s64)\nOPENCV_HAL_IMPL_NEON_DBL_BIT_OP(|, vorrq_s64)\nOPENCV_HAL_IMPL_NEON_DBL_BIT_OP(^, veorq_s64)\n\ninline v_float64x2 operator ~ (const v_float64x2& a)\n{\n    return v_float64x2(vreinterpretq_f64_s32(vmvnq_s32(vreinterpretq_s32_f64(a.val))));\n}\n\ninline v_float64x2 v_sqrt(const v_float64x2& x)\n{\n    return v_float64x2(vsqrtq_f64(x.val));\n}\n\ninline v_float64x2 v_invsqrt(const v_float64x2& x)\n{\n    v_float64x2 one = v_setall_f64(1.0f);\n    return one / v_sqrt(x);\n}\n\ninline v_float64x2 v_abs(v_float64x2 x)\n{ return v_float64x2(vabsq_f64(x.val)); }\n#endif\n\n// TODO: exp, log, sin, cos\n\n#define OPENCV_HAL_IMPL_NEON_BIN_FUNC(_Tpvec, func, intrin) \\\ninline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val)); \\\n}\n\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_min, vminq_u8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_max, vmaxq_u8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_min, vminq_s8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_max, vmaxq_s8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_min, vminq_u16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_max, vmaxq_u16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int16x8, v_min, vminq_s16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int16x8, v_max, vmaxq_s16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint32x4, v_min, vminq_u32)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint32x4, v_max, vmaxq_u32)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int32x4, v_min, vminq_s32)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int32x4, v_max, vmaxq_s32)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float32x4, v_min, vminq_f32)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float32x4, v_max, vmaxq_f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float64x2, v_min, vminq_f64)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float64x2, v_max, vmaxq_f64)\n#endif\n\n#if CV_SIMD128_64F\ninline int64x2_t vmvnq_s64(int64x2_t a)\n{\n    int64x2_t vx = vreinterpretq_s64_u32(vdupq_n_u32(0xFFFFFFFF));\n    return veorq_s64(a, vx);\n}\ninline uint64x2_t vmvnq_u64(uint64x2_t a)\n{\n    uint64x2_t vx = vreinterpretq_u64_u32(vdupq_n_u32(0xFFFFFFFF));\n    return veorq_u64(a, vx);\n}\n#endif\n#define OPENCV_HAL_IMPL_NEON_INT_CMP_OP(_Tpvec, cast, suffix, not_suffix) \\\ninline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(cast(vceqq_##suffix(a.val, b.val))); } \\\ninline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(cast(vmvnq_##not_suffix(vceqq_##suffix(a.val, b.val)))); } \\\ninline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(cast(vcltq_##suffix(a.val, b.val))); } \\\ninline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(cast(vcgtq_##suffix(a.val, b.val))); } \\\ninline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(cast(vcleq_##suffix(a.val, b.val))); } \\\ninline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(cast(vcgeq_##suffix(a.val, b.val))); }\n\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint8x16, OPENCV_HAL_NOP, u8, u8)\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int8x16, vreinterpretq_s8_u8, s8, u8)\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint16x8, OPENCV_HAL_NOP, u16, u16)\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int16x8, vreinterpretq_s16_u16, s16, u16)\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint32x4, OPENCV_HAL_NOP, u32, u32)\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int32x4, vreinterpretq_s32_u32, s32, u32)\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_float32x4, vreinterpretq_f32_u32, f32, u32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint64x2, OPENCV_HAL_NOP, u64, u64)\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int64x2, vreinterpretq_s64_u64, s64, u64)\nOPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_float64x2, vreinterpretq_f64_u64, f64, u64)\n#endif\n\ninline v_float32x4 v_not_nan(const v_float32x4& a)\n{ return v_float32x4(vreinterpretq_f32_u32(vceqq_f32(a.val, a.val))); }\n#if CV_SIMD128_64F\ninline v_float64x2 v_not_nan(const v_float64x2& a)\n{ return v_float64x2(vreinterpretq_f64_u64(vceqq_f64(a.val, a.val))); }\n#endif\n\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_add_wrap, vaddq_u8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_add_wrap, vaddq_s8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_add_wrap, vaddq_u16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int16x8, v_add_wrap, vaddq_s16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_sub_wrap, vsubq_u8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_sub_wrap, vsubq_s8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_sub_wrap, vsubq_u16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int16x8, v_sub_wrap, vsubq_s16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_mul_wrap, vmulq_u8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_mul_wrap, vmulq_s8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_mul_wrap, vmulq_u16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int16x8, v_mul_wrap, vmulq_s16)\n\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_absdiff, vabdq_u8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_absdiff, vabdq_u16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint32x4, v_absdiff, vabdq_u32)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float32x4, v_absdiff, vabdq_f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float64x2, v_absdiff, vabdq_f64)\n#endif\n\n/** Saturating absolute difference **/\ninline v_int8x16 v_absdiffs(const v_int8x16& a, const v_int8x16& b)\n{ return v_int8x16(vqabsq_s8(vqsubq_s8(a.val, b.val))); }\ninline v_int16x8 v_absdiffs(const v_int16x8& a, const v_int16x8& b)\n{ return v_int16x8(vqabsq_s16(vqsubq_s16(a.val, b.val))); }\n\n#define OPENCV_HAL_IMPL_NEON_BIN_FUNC2(_Tpvec, _Tpvec2, cast, func, intrin) \\\ninline _Tpvec2 func(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec2(cast(intrin(a.val, b.val))); \\\n}\n\nOPENCV_HAL_IMPL_NEON_BIN_FUNC2(v_int8x16, v_uint8x16, vreinterpretq_u8_s8, v_absdiff, vabdq_s8)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC2(v_int16x8, v_uint16x8, vreinterpretq_u16_s16, v_absdiff, vabdq_s16)\nOPENCV_HAL_IMPL_NEON_BIN_FUNC2(v_int32x4, v_uint32x4, vreinterpretq_u32_s32, v_absdiff, vabdq_s32)\n\ninline v_float32x4 v_magnitude(const v_float32x4& a, const v_float32x4& b)\n{\n    v_float32x4 x(vmlaq_f32(vmulq_f32(a.val, a.val), b.val, b.val));\n    return v_sqrt(x);\n}\n\ninline v_float32x4 v_sqr_magnitude(const v_float32x4& a, const v_float32x4& b)\n{\n    return v_float32x4(vmlaq_f32(vmulq_f32(a.val, a.val), b.val, b.val));\n}\n\ninline v_float32x4 v_fma(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n#if CV_SIMD128_64F\n    // ARMv8, which adds support for 64-bit floating-point (so CV_SIMD128_64F is defined),\n    // also adds FMA support both for single- and double-precision floating-point vectors\n    return v_float32x4(vfmaq_f32(c.val, a.val, b.val));\n#else\n    return v_float32x4(vmlaq_f32(c.val, a.val, b.val));\n#endif\n}\n\ninline v_int32x4 v_fma(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return v_int32x4(vmlaq_s32(c.val, a.val, b.val));\n}\n\ninline v_float32x4 v_muladd(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\ninline v_int32x4 v_muladd(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_magnitude(const v_float64x2& a, const v_float64x2& b)\n{\n    v_float64x2 x(vaddq_f64(vmulq_f64(a.val, a.val), vmulq_f64(b.val, b.val)));\n    return v_sqrt(x);\n}\n\ninline v_float64x2 v_sqr_magnitude(const v_float64x2& a, const v_float64x2& b)\n{\n    return v_float64x2(vaddq_f64(vmulq_f64(a.val, a.val), vmulq_f64(b.val, b.val)));\n}\n\ninline v_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n    return v_float64x2(vfmaq_f64(c.val, a.val, b.val));\n}\n\ninline v_float64x2 v_muladd(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n    return v_fma(a, b, c);\n}\n#endif\n\n// trade efficiency for convenience\n#define OPENCV_HAL_IMPL_NEON_SHIFT_OP(_Tpvec, suffix, _Tps, ssuffix) \\\ninline _Tpvec operator << (const _Tpvec& a, int n) \\\n{ return _Tpvec(vshlq_##suffix(a.val, vdupq_n_##ssuffix((_Tps)n))); } \\\ninline _Tpvec operator >> (const _Tpvec& a, int n) \\\n{ return _Tpvec(vshlq_##suffix(a.val, vdupq_n_##ssuffix((_Tps)-n))); } \\\ntemplate<int n> inline _Tpvec v_shl(const _Tpvec& a) \\\n{ return _Tpvec(vshlq_n_##suffix(a.val, n)); } \\\ntemplate<int n> inline _Tpvec v_shr(const _Tpvec& a) \\\n{ return _Tpvec(vshrq_n_##suffix(a.val, n)); } \\\ntemplate<int n> inline _Tpvec v_rshr(const _Tpvec& a) \\\n{ return _Tpvec(vrshrq_n_##suffix(a.val, n)); }\n\nOPENCV_HAL_IMPL_NEON_SHIFT_OP(v_uint8x16, u8, schar, s8)\nOPENCV_HAL_IMPL_NEON_SHIFT_OP(v_int8x16, s8, schar, s8)\nOPENCV_HAL_IMPL_NEON_SHIFT_OP(v_uint16x8, u16, short, s16)\nOPENCV_HAL_IMPL_NEON_SHIFT_OP(v_int16x8, s16, short, s16)\nOPENCV_HAL_IMPL_NEON_SHIFT_OP(v_uint32x4, u32, int, s32)\nOPENCV_HAL_IMPL_NEON_SHIFT_OP(v_int32x4, s32, int, s32)\nOPENCV_HAL_IMPL_NEON_SHIFT_OP(v_uint64x2, u64, int64, s64)\nOPENCV_HAL_IMPL_NEON_SHIFT_OP(v_int64x2, s64, int64, s64)\n\n#define OPENCV_HAL_IMPL_NEON_ROTATE_OP(_Tpvec, suffix) \\\ntemplate<int n> inline _Tpvec v_rotate_right(const _Tpvec& a) \\\n{ return _Tpvec(vextq_##suffix(a.val, vdupq_n_##suffix(0), n)); } \\\ntemplate<int n> inline _Tpvec v_rotate_left(const _Tpvec& a) \\\n{ return _Tpvec(vextq_##suffix(vdupq_n_##suffix(0), a.val, _Tpvec::nlanes - n)); } \\\ntemplate<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a) \\\n{ return a; } \\\ntemplate<int n> inline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(vextq_##suffix(a.val, b.val, n)); } \\\ntemplate<int n> inline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(vextq_##suffix(b.val, a.val, _Tpvec::nlanes - n)); } \\\ntemplate<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a, const _Tpvec& b) \\\n{ CV_UNUSED(b); return a; }\n\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_uint8x16, u8)\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_int8x16, s8)\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_uint16x8, u16)\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_int16x8, s16)\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_uint32x4, u32)\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_int32x4, s32)\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_float32x4, f32)\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_uint64x2, u64)\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_int64x2, s64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_ROTATE_OP(v_float64x2, f64)\n#endif\n\n#if defined(__clang__) && defined(__aarch64__)\n// avoid LD2 instruction. details: https://github.com/opencv/opencv/issues/14863\n#define OPENCV_HAL_IMPL_NEON_LOAD_LOW_OP(_Tpvec, _Tp, suffix) \\\ninline _Tpvec v_load_low(const _Tp* ptr) \\\n{ \\\ntypedef uint64 CV_DECL_ALIGNED(1) unaligned_uint64; \\\nuint64 v = *(unaligned_uint64*)ptr; \\\nreturn _Tpvec(v_reinterpret_as_##suffix(v_uint64x2(v, (uint64)123456))); \\\n}\n#else\n#define OPENCV_HAL_IMPL_NEON_LOAD_LOW_OP(_Tpvec, _Tp, suffix) \\\ninline _Tpvec v_load_low(const _Tp* ptr) \\\n{ return _Tpvec(vcombine_##suffix(vld1_##suffix(ptr), vdup_n_##suffix((_Tp)0))); }\n#endif\n\n#define OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(_Tpvec, _Tp, suffix) \\\ninline _Tpvec v_load(const _Tp* ptr) \\\n{ return _Tpvec(vld1q_##suffix(ptr)); } \\\ninline _Tpvec v_load_aligned(const _Tp* ptr) \\\n{ return _Tpvec(vld1q_##suffix(ptr)); } \\\nOPENCV_HAL_IMPL_NEON_LOAD_LOW_OP(_Tpvec, _Tp, suffix) \\\ninline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \\\n{ return _Tpvec(vcombine_##suffix(vld1_##suffix(ptr0), vld1_##suffix(ptr1))); } \\\ninline void v_store(_Tp* ptr, const _Tpvec& a) \\\n{ vst1q_##suffix(ptr, a.val); } \\\ninline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \\\n{ vst1q_##suffix(ptr, a.val); } \\\ninline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \\\n{ vst1q_##suffix(ptr, a.val); } \\\ninline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode /*mode*/) \\\n{ vst1q_##suffix(ptr, a.val); } \\\ninline void v_store_low(_Tp* ptr, const _Tpvec& a) \\\n{ vst1_##suffix(ptr, vget_low_##suffix(a.val)); } \\\ninline void v_store_high(_Tp* ptr, const _Tpvec& a) \\\n{ vst1_##suffix(ptr, vget_high_##suffix(a.val)); }\n\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int8x16, schar, s8)\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int16x8, short, s16)\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int32x4, int, s32)\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int64x2, int64, s64)\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_float32x4, float, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_float64x2, double, f64)\n#endif\n\ninline unsigned v_reduce_sum(const v_uint8x16& a)\n{\n#if CV_NEON_AARCH64\n    uint16_t t0 = vaddlvq_u8(a.val);\n    return t0;\n#else // #if CV_NEON_AARCH64\n    uint32x4_t t0 = vpaddlq_u16(vpaddlq_u8(a.val));\n    uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0));\n    return vget_lane_u32(vpadd_u32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\ninline int v_reduce_sum(const v_int8x16& a)\n{\n#if CV_NEON_AARCH64\n    int16_t t0 = vaddlvq_s8(a.val);\n    return t0;\n#else // #if CV_NEON_AARCH64\n    int32x4_t t0 = vpaddlq_s16(vpaddlq_s8(a.val));\n    int32x2_t t1 = vpadd_s32(vget_low_s32(t0), vget_high_s32(t0));\n    return vget_lane_s32(vpadd_s32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\ninline unsigned v_reduce_sum(const v_uint16x8& a)\n{\n#if CV_NEON_AARCH64\n    uint32_t t0 = vaddlvq_u16(a.val);\n    return t0;\n#else // #if CV_NEON_AARCH64\n    uint32x4_t t0 = vpaddlq_u16(a.val);\n    uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0));\n    return vget_lane_u32(vpadd_u32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\ninline int v_reduce_sum(const v_int16x8& a)\n{\n#if CV_NEON_AARCH64\n    int32_t t0 = vaddlvq_s16(a.val);\n    return t0;\n#else // #if CV_NEON_AARCH64\n    int32x4_t t0 = vpaddlq_s16(a.val);\n    int32x2_t t1 = vpadd_s32(vget_low_s32(t0), vget_high_s32(t0));\n    return vget_lane_s32(vpadd_s32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\n\n#if CV_NEON_AARCH64\n#define OPENCV_HAL_IMPL_NEON_REDUCE_OP_16(_Tpvec, _Tpnvec, scalartype, func, vectorfunc, suffix) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    return v##vectorfunc##vq_##suffix(a.val); \\\n}\n#else // #if CV_NEON_AARCH64\n#define OPENCV_HAL_IMPL_NEON_REDUCE_OP_16(_Tpvec, _Tpnvec, scalartype, func, vectorfunc, suffix) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    _Tpnvec##_t a0 = vp##vectorfunc##_##suffix(vget_low_##suffix(a.val), vget_high_##suffix(a.val)); \\\n    a0 = vp##vectorfunc##_##suffix(a0, a0); \\\n    a0 = vp##vectorfunc##_##suffix(a0, a0); \\\n    return (scalartype)vget_lane_##suffix(vp##vectorfunc##_##suffix(a0, a0),0); \\\n}\n#endif // #if CV_NEON_AARCH64\n\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_16(v_uint8x16, uint8x8, uchar, max, max, u8)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_16(v_uint8x16, uint8x8, uchar, min, min, u8)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_16(v_int8x16, int8x8, schar, max, max, s8)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_16(v_int8x16, int8x8, schar, min, min, s8)\n\n#if CV_NEON_AARCH64\n#define OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(_Tpvec, _Tpnvec, scalartype, func, vectorfunc, suffix) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    return v##vectorfunc##vq_##suffix(a.val); \\\n}\n#else // #if CV_NEON_AARCH64\n#define OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(_Tpvec, _Tpnvec, scalartype, func, vectorfunc, suffix) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    _Tpnvec##_t a0 = vp##vectorfunc##_##suffix(vget_low_##suffix(a.val), vget_high_##suffix(a.val)); \\\n    a0 = vp##vectorfunc##_##suffix(a0, a0); \\\n    return (scalartype)vget_lane_##suffix(vp##vectorfunc##_##suffix(a0, a0),0); \\\n}\n#endif // #if CV_NEON_AARCH64\n\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_uint16x8, uint16x4, ushort, max, max, u16)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_uint16x8, uint16x4, ushort, min, min, u16)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_int16x8, int16x4, short, max, max, s16)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_int16x8, int16x4, short, min, min, s16)\n\n#if CV_NEON_AARCH64\n#define OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(_Tpvec, _Tpnvec, scalartype, func, vectorfunc, suffix) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    return v##vectorfunc##vq_##suffix(a.val); \\\n}\n#else // #if CV_NEON_AARCH64\n#define OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(_Tpvec, _Tpnvec, scalartype, func, vectorfunc, suffix) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    _Tpnvec##_t a0 = vp##vectorfunc##_##suffix(vget_low_##suffix(a.val), vget_high_##suffix(a.val)); \\\n    return (scalartype)vget_lane_##suffix(vp##vectorfunc##_##suffix(a0, vget_high_##suffix(a.val)),0); \\\n}\n#endif // #if CV_NEON_AARCH64\n\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_uint32x4, uint32x2, unsigned, sum, add, u32)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_uint32x4, uint32x2, unsigned, max, max, u32)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_uint32x4, uint32x2, unsigned, min, min, u32)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_int32x4, int32x2, int, sum, add, s32)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_int32x4, int32x2, int, max, max, s32)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_int32x4, int32x2, int, min, min, s32)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_float32x4, float32x2, float, sum, add, f32)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_float32x4, float32x2, float, max, max, f32)\nOPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_float32x4, float32x2, float, min, min, f32)\n\ninline uint64 v_reduce_sum(const v_uint64x2& a)\n{\n#if CV_NEON_AARCH64\n    return vaddvq_u64(a.val);\n#else // #if CV_NEON_AARCH64\n    return vget_lane_u64(vadd_u64(vget_low_u64(a.val), vget_high_u64(a.val)),0);\n#endif // #if CV_NEON_AARCH64\n}\ninline int64 v_reduce_sum(const v_int64x2& a)\n{\n#if CV_NEON_AARCH64\n    return vaddvq_s64(a.val);\n#else // #if CV_NEON_AARCH64\n    return vget_lane_s64(vadd_s64(vget_low_s64(a.val), vget_high_s64(a.val)),0);\n#endif // #if CV_NEON_AARCH64\n}\n#if CV_SIMD128_64F\ninline double v_reduce_sum(const v_float64x2& a)\n{\n    return vaddvq_f64(a.val);\n}\n#endif\n\ninline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b,\n                                 const v_float32x4& c, const v_float32x4& d)\n{\n#if CV_NEON_AARCH64\n    float32x4_t ab = vpaddq_f32(a.val, b.val); // a0+a1 a2+a3 b0+b1 b2+b3\n    float32x4_t cd = vpaddq_f32(c.val, d.val); // c0+c1 d0+d1 c2+c3 d2+d3\n    return v_float32x4(vpaddq_f32(ab, cd));  // sumA sumB sumC sumD\n#else // #if CV_NEON_AARCH64\n    float32x4x2_t ab = vtrnq_f32(a.val, b.val);\n    float32x4x2_t cd = vtrnq_f32(c.val, d.val);\n\n    float32x4_t u0 = vaddq_f32(ab.val[0], ab.val[1]); // a0+a1 b0+b1 a2+a3 b2+b3\n    float32x4_t u1 = vaddq_f32(cd.val[0], cd.val[1]); // c0+c1 d0+d1 c2+c3 d2+d3\n\n    float32x4_t v0 = vcombine_f32(vget_low_f32(u0), vget_low_f32(u1));\n    float32x4_t v1 = vcombine_f32(vget_high_f32(u0), vget_high_f32(u1));\n\n    return v_float32x4(vaddq_f32(v0, v1));\n#endif // #if CV_NEON_AARCH64\n}\n\ninline unsigned v_reduce_sad(const v_uint8x16& a, const v_uint8x16& b)\n{\n#if CV_NEON_AARCH64\n    uint8x16_t t0 = vabdq_u8(a.val, b.val);\n    uint16_t t1 = vaddlvq_u8(t0);\n    return t1;\n#else // #if CV_NEON_AARCH64\n    uint32x4_t t0 = vpaddlq_u16(vpaddlq_u8(vabdq_u8(a.val, b.val)));\n    uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0));\n    return vget_lane_u32(vpadd_u32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\ninline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b)\n{\n#if CV_NEON_AARCH64\n    uint8x16_t t0 = vreinterpretq_u8_s8(vabdq_s8(a.val, b.val));\n    uint16_t t1 = vaddlvq_u8(t0);\n    return t1;\n#else // #if CV_NEON_AARCH64\n    uint32x4_t t0 = vpaddlq_u16(vpaddlq_u8(vreinterpretq_u8_s8(vabdq_s8(a.val, b.val))));\n    uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0));\n    return vget_lane_u32(vpadd_u32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\ninline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b)\n{\n#if CV_NEON_AARCH64\n    uint16x8_t t0 = vabdq_u16(a.val, b.val);\n    uint32_t t1 = vaddlvq_u16(t0);\n    return t1;\n#else // #if CV_NEON_AARCH64\n    uint32x4_t t0 = vpaddlq_u16(vabdq_u16(a.val, b.val));\n    uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0));\n    return vget_lane_u32(vpadd_u32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\ninline unsigned v_reduce_sad(const v_int16x8& a, const v_int16x8& b)\n{\n#if CV_NEON_AARCH64\n    uint16x8_t t0 = vreinterpretq_u16_s16(vabdq_s16(a.val, b.val));\n    uint32_t t1 = vaddlvq_u16(t0);\n    return t1;\n#else // #if CV_NEON_AARCH64\n    uint32x4_t t0 = vpaddlq_u16(vreinterpretq_u16_s16(vabdq_s16(a.val, b.val)));\n    uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0));\n    return vget_lane_u32(vpadd_u32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\ninline unsigned v_reduce_sad(const v_uint32x4& a, const v_uint32x4& b)\n{\n#if CV_NEON_AARCH64\n    uint32x4_t t0 = vabdq_u32(a.val, b.val);\n    uint32_t t1 = vaddvq_u32(t0);\n    return t1;\n#else // #if CV_NEON_AARCH64\n    uint32x4_t t0 = vabdq_u32(a.val, b.val);\n    uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0));\n    return vget_lane_u32(vpadd_u32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\ninline unsigned v_reduce_sad(const v_int32x4& a, const v_int32x4& b)\n{\n#if CV_NEON_AARCH64\n    uint32x4_t t0 = vreinterpretq_u32_s32(vabdq_s32(a.val, b.val));\n    uint32_t t1 = vaddvq_u32(t0);\n    return t1;\n#else // #if CV_NEON_AARCH64\n    uint32x4_t t0 = vreinterpretq_u32_s32(vabdq_s32(a.val, b.val));\n    uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0));\n    return vget_lane_u32(vpadd_u32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\ninline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b)\n{\n#if CV_NEON_AARCH64\n    float32x4_t t0 = vabdq_f32(a.val, b.val);\n    return vaddvq_f32(t0);\n#else // #if CV_NEON_AARCH64\n    float32x4_t t0 = vabdq_f32(a.val, b.val);\n    float32x2_t t1 = vpadd_f32(vget_low_f32(t0), vget_high_f32(t0));\n    return vget_lane_f32(vpadd_f32(t1, t1), 0);\n#endif // #if CV_NEON_AARCH64\n}\n\ninline v_uint8x16 v_popcount(const v_uint8x16& a)\n{ return v_uint8x16(vcntq_u8(a.val)); }\ninline v_uint8x16 v_popcount(const v_int8x16& a)\n{ return v_uint8x16(vcntq_u8(vreinterpretq_u8_s8(a.val))); }\ninline v_uint16x8 v_popcount(const v_uint16x8& a)\n{ return v_uint16x8(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u16(a.val)))); }\ninline v_uint16x8 v_popcount(const v_int16x8& a)\n{ return v_uint16x8(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_s16(a.val)))); }\ninline v_uint32x4 v_popcount(const v_uint32x4& a)\n{ return v_uint32x4(vpaddlq_u16(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u32(a.val))))); }\ninline v_uint32x4 v_popcount(const v_int32x4& a)\n{ return v_uint32x4(vpaddlq_u16(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_s32(a.val))))); }\ninline v_uint64x2 v_popcount(const v_uint64x2& a)\n{ return v_uint64x2(vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(a.val)))))); }\ninline v_uint64x2 v_popcount(const v_int64x2& a)\n{ return v_uint64x2(vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_s64(a.val)))))); }\n\ninline int v_signmask(const v_uint8x16& a)\n{\n#if CV_NEON_AARCH64\n    const int8x16_t signPosition = {0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7};\n    const uint8x16_t byteOrder = {0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15};\n    uint8x16_t v0 = vshlq_u8(vshrq_n_u8(a.val, 7), signPosition);\n    uint8x16_t v1 = vqtbl1q_u8(v0, byteOrder);\n    uint32_t t0 = vaddlvq_u16(vreinterpretq_u16_u8(v1));\n    return t0;\n#else // #if CV_NEON_AARCH64\n    int8x8_t m0 = vcreate_s8(CV_BIG_UINT(0x0706050403020100));\n    uint8x16_t v0 = vshlq_u8(vshrq_n_u8(a.val, 7), vcombine_s8(m0, m0));\n    uint64x2_t v1 = vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(v0)));\n    return (int)vgetq_lane_u64(v1, 0) + ((int)vgetq_lane_u64(v1, 1) << 8);\n#endif // #if CV_NEON_AARCH64\n}\n\ninline int v_signmask(const v_int8x16& a)\n{ return v_signmask(v_reinterpret_as_u8(a)); }\n\ninline int v_signmask(const v_uint16x8& a)\n{\n#if CV_NEON_AARCH64\n    const int16x8_t signPosition = {0,1,2,3,4,5,6,7};\n    uint16x8_t v0 = vshlq_u16(vshrq_n_u16(a.val, 15), signPosition);\n    uint32_t t0 = vaddlvq_u16(v0);\n    return t0;\n#else // #if CV_NEON_AARCH64\n    int16x4_t m0 = vcreate_s16(CV_BIG_UINT(0x0003000200010000));\n    uint16x8_t v0 = vshlq_u16(vshrq_n_u16(a.val, 15), vcombine_s16(m0, m0));\n    uint64x2_t v1 = vpaddlq_u32(vpaddlq_u16(v0));\n    return (int)vgetq_lane_u64(v1, 0) + ((int)vgetq_lane_u64(v1, 1) << 4);\n#endif // #if CV_NEON_AARCH64\n}\ninline int v_signmask(const v_int16x8& a)\n{ return v_signmask(v_reinterpret_as_u16(a)); }\n\ninline int v_signmask(const v_uint32x4& a)\n{\n#if CV_NEON_AARCH64\n    const int32x4_t signPosition = {0,1,2,3};\n    uint32x4_t v0 = vshlq_u32(vshrq_n_u32(a.val, 31), signPosition);\n    uint32_t t0 = vaddvq_u32(v0);\n    return t0;\n#else // #if CV_NEON_AARCH64\n    int32x2_t m0 = vcreate_s32(CV_BIG_UINT(0x0000000100000000));\n    uint32x4_t v0 = vshlq_u32(vshrq_n_u32(a.val, 31), vcombine_s32(m0, m0));\n    uint64x2_t v1 = vpaddlq_u32(v0);\n    return (int)vgetq_lane_u64(v1, 0) + ((int)vgetq_lane_u64(v1, 1) << 2);\n#endif // #if CV_NEON_AARCH64\n}\ninline int v_signmask(const v_int32x4& a)\n{ return v_signmask(v_reinterpret_as_u32(a)); }\ninline int v_signmask(const v_float32x4& a)\n{ return v_signmask(v_reinterpret_as_u32(a)); }\ninline int v_signmask(const v_uint64x2& a)\n{\n#if CV_NEON_AARCH64\n    const int64x2_t signPosition = {0,1};\n    uint64x2_t v0 = vshlq_u64(vshrq_n_u64(a.val, 63), signPosition);\n    uint64_t t0 = vaddvq_u64(v0);\n    return t0;\n#else // #if CV_NEON_AARCH64\n    int64x1_t m0 = vdup_n_s64(0);\n    uint64x2_t v0 = vshlq_u64(vshrq_n_u64(a.val, 63), vcombine_s64(m0, m0));\n    return (int)vgetq_lane_u64(v0, 0) + ((int)vgetq_lane_u64(v0, 1) << 1);\n#endif // #if CV_NEON_AARCH64\n}\ninline int v_signmask(const v_int64x2& a)\n{ return v_signmask(v_reinterpret_as_u64(a)); }\n#if CV_SIMD128_64F\ninline int v_signmask(const v_float64x2& a)\n{ return v_signmask(v_reinterpret_as_u64(a)); }\n#endif\n\ninline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(a)); }\n#if CV_SIMD128_64F\ninline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(a)); }\n#endif\n\n#if CV_NEON_AARCH64\n    #define OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(_Tpvec, suffix, shift) \\\n    inline bool v_check_all(const v_##_Tpvec& a) \\\n    { \\\n        return (vminvq_##suffix(a.val) >> shift) != 0; \\\n    } \\\n    inline bool v_check_any(const v_##_Tpvec& a) \\\n    { \\\n        return (vmaxvq_##suffix(a.val) >> shift) != 0; \\\n    }\n#else // #if CV_NEON_AARCH64\n    #define OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(_Tpvec, suffix, shift) \\\n    inline bool v_check_all(const v_##_Tpvec& a) \\\n    { \\\n        _Tpvec##_t v0 = vshrq_n_##suffix(vmvnq_##suffix(a.val), shift); \\\n        uint64x2_t v1 = vreinterpretq_u64_##suffix(v0); \\\n        return (vgetq_lane_u64(v1, 0) | vgetq_lane_u64(v1, 1)) == 0; \\\n    } \\\n    inline bool v_check_any(const v_##_Tpvec& a) \\\n    { \\\n        _Tpvec##_t v0 = vshrq_n_##suffix(a.val, shift); \\\n        uint64x2_t v1 = vreinterpretq_u64_##suffix(v0); \\\n        return (vgetq_lane_u64(v1, 0) | vgetq_lane_u64(v1, 1)) != 0; \\\n    }\n#endif // #if CV_NEON_AARCH64\n\nOPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint8x16, u8, 7)\nOPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint16x8, u16, 15)\nOPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint32x4, u32, 31)\n\ninline bool v_check_all(const v_uint64x2& a)\n{\n    uint64x2_t v0 = vshrq_n_u64(a.val, 63);\n    return (vgetq_lane_u64(v0, 0) & vgetq_lane_u64(v0, 1)) == 1;\n}\ninline bool v_check_any(const v_uint64x2& a)\n{\n    uint64x2_t v0 = vshrq_n_u64(a.val, 63);\n    return (vgetq_lane_u64(v0, 0) | vgetq_lane_u64(v0, 1)) != 0;\n}\n\ninline bool v_check_all(const v_int8x16& a)\n{ return v_check_all(v_reinterpret_as_u8(a)); }\ninline bool v_check_all(const v_int16x8& a)\n{ return v_check_all(v_reinterpret_as_u16(a)); }\ninline bool v_check_all(const v_int32x4& a)\n{ return v_check_all(v_reinterpret_as_u32(a)); }\ninline bool v_check_all(const v_float32x4& a)\n{ return v_check_all(v_reinterpret_as_u32(a)); }\n\ninline bool v_check_any(const v_int8x16& a)\n{ return v_check_any(v_reinterpret_as_u8(a)); }\ninline bool v_check_any(const v_int16x8& a)\n{ return v_check_any(v_reinterpret_as_u16(a)); }\ninline bool v_check_any(const v_int32x4& a)\n{ return v_check_any(v_reinterpret_as_u32(a)); }\ninline bool v_check_any(const v_float32x4& a)\n{ return v_check_any(v_reinterpret_as_u32(a)); }\n\ninline bool v_check_all(const v_int64x2& a)\n{ return v_check_all(v_reinterpret_as_u64(a)); }\ninline bool v_check_any(const v_int64x2& a)\n{ return v_check_any(v_reinterpret_as_u64(a)); }\n#if CV_SIMD128_64F\ninline bool v_check_all(const v_float64x2& a)\n{ return v_check_all(v_reinterpret_as_u64(a)); }\ninline bool v_check_any(const v_float64x2& a)\n{ return v_check_any(v_reinterpret_as_u64(a)); }\n#endif\n\n#define OPENCV_HAL_IMPL_NEON_SELECT(_Tpvec, suffix, usuffix) \\\ninline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(vbslq_##suffix(vreinterpretq_##usuffix##_##suffix(mask.val), a.val, b.val)); \\\n}\n\nOPENCV_HAL_IMPL_NEON_SELECT(v_uint8x16, u8, u8)\nOPENCV_HAL_IMPL_NEON_SELECT(v_int8x16, s8, u8)\nOPENCV_HAL_IMPL_NEON_SELECT(v_uint16x8, u16, u16)\nOPENCV_HAL_IMPL_NEON_SELECT(v_int16x8, s16, u16)\nOPENCV_HAL_IMPL_NEON_SELECT(v_uint32x4, u32, u32)\nOPENCV_HAL_IMPL_NEON_SELECT(v_int32x4, s32, u32)\nOPENCV_HAL_IMPL_NEON_SELECT(v_float32x4, f32, u32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_SELECT(v_float64x2, f64, u64)\n#endif\n\n#if CV_NEON_AARCH64\n#define OPENCV_HAL_IMPL_NEON_EXPAND(_Tpvec, _Tpwvec, _Tp, suffix) \\\ninline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \\\n{ \\\n    b0.val = vmovl_##suffix(vget_low_##suffix(a.val)); \\\n    b1.val = vmovl_high_##suffix(a.val); \\\n} \\\ninline _Tpwvec v_expand_low(const _Tpvec& a) \\\n{ \\\n    return _Tpwvec(vmovl_##suffix(vget_low_##suffix(a.val))); \\\n} \\\ninline _Tpwvec v_expand_high(const _Tpvec& a) \\\n{ \\\n    return _Tpwvec(vmovl_high_##suffix(a.val)); \\\n} \\\ninline _Tpwvec v_load_expand(const _Tp* ptr) \\\n{ \\\n    return _Tpwvec(vmovl_##suffix(vld1_##suffix(ptr))); \\\n}\n#else\n#define OPENCV_HAL_IMPL_NEON_EXPAND(_Tpvec, _Tpwvec, _Tp, suffix) \\\ninline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \\\n{ \\\n    b0.val = vmovl_##suffix(vget_low_##suffix(a.val)); \\\n    b1.val = vmovl_##suffix(vget_high_##suffix(a.val)); \\\n} \\\ninline _Tpwvec v_expand_low(const _Tpvec& a) \\\n{ \\\n    return _Tpwvec(vmovl_##suffix(vget_low_##suffix(a.val))); \\\n} \\\ninline _Tpwvec v_expand_high(const _Tpvec& a) \\\n{ \\\n    return _Tpwvec(vmovl_##suffix(vget_high_##suffix(a.val))); \\\n} \\\ninline _Tpwvec v_load_expand(const _Tp* ptr) \\\n{ \\\n    return _Tpwvec(vmovl_##suffix(vld1_##suffix(ptr))); \\\n}\n#endif\n\nOPENCV_HAL_IMPL_NEON_EXPAND(v_uint8x16, v_uint16x8, uchar, u8)\nOPENCV_HAL_IMPL_NEON_EXPAND(v_int8x16, v_int16x8, schar, s8)\nOPENCV_HAL_IMPL_NEON_EXPAND(v_uint16x8, v_uint32x4, ushort, u16)\nOPENCV_HAL_IMPL_NEON_EXPAND(v_int16x8, v_int32x4, short, s16)\nOPENCV_HAL_IMPL_NEON_EXPAND(v_uint32x4, v_uint64x2, uint, u32)\nOPENCV_HAL_IMPL_NEON_EXPAND(v_int32x4, v_int64x2, int, s32)\n\ninline v_uint32x4 v_load_expand_q(const uchar* ptr)\n{\n    typedef unsigned int CV_DECL_ALIGNED(1) unaligned_uint;\n    uint8x8_t v0 = vcreate_u8(*(unaligned_uint*)ptr);\n    uint16x4_t v1 = vget_low_u16(vmovl_u8(v0));\n    return v_uint32x4(vmovl_u16(v1));\n}\n\ninline v_int32x4 v_load_expand_q(const schar* ptr)\n{\n    typedef unsigned int CV_DECL_ALIGNED(1) unaligned_uint;\n    int8x8_t v0 = vcreate_s8(*(unaligned_uint*)ptr);\n    int16x4_t v1 = vget_low_s16(vmovl_s8(v0));\n    return v_int32x4(vmovl_s16(v1));\n}\n\n#if defined(__aarch64__) || defined(_M_ARM64)\n#define OPENCV_HAL_IMPL_NEON_UNPACKS(_Tpvec, suffix) \\\ninline void v_zip(const v_##_Tpvec& a0, const v_##_Tpvec& a1, v_##_Tpvec& b0, v_##_Tpvec& b1) \\\n{ \\\n    b0.val = vzip1q_##suffix(a0.val, a1.val); \\\n    b1.val = vzip2q_##suffix(a0.val, a1.val); \\\n} \\\ninline v_##_Tpvec v_combine_low(const v_##_Tpvec& a, const v_##_Tpvec& b) \\\n{ \\\n    return v_##_Tpvec(vcombine_##suffix(vget_low_##suffix(a.val), vget_low_##suffix(b.val))); \\\n} \\\ninline v_##_Tpvec v_combine_high(const v_##_Tpvec& a, const v_##_Tpvec& b) \\\n{ \\\n    return v_##_Tpvec(vcombine_##suffix(vget_high_##suffix(a.val), vget_high_##suffix(b.val))); \\\n} \\\ninline void v_recombine(const v_##_Tpvec& a, const v_##_Tpvec& b, v_##_Tpvec& c, v_##_Tpvec& d) \\\n{ \\\n    c.val = vcombine_##suffix(vget_low_##suffix(a.val), vget_low_##suffix(b.val)); \\\n    d.val = vcombine_##suffix(vget_high_##suffix(a.val), vget_high_##suffix(b.val)); \\\n}\n#else\n#define OPENCV_HAL_IMPL_NEON_UNPACKS(_Tpvec, suffix) \\\ninline void v_zip(const v_##_Tpvec& a0, const v_##_Tpvec& a1, v_##_Tpvec& b0, v_##_Tpvec& b1) \\\n{ \\\n    _Tpvec##x2_t p = vzipq_##suffix(a0.val, a1.val); \\\n    b0.val = p.val[0]; \\\n    b1.val = p.val[1]; \\\n} \\\ninline v_##_Tpvec v_combine_low(const v_##_Tpvec& a, const v_##_Tpvec& b) \\\n{ \\\n    return v_##_Tpvec(vcombine_##suffix(vget_low_##suffix(a.val), vget_low_##suffix(b.val))); \\\n} \\\ninline v_##_Tpvec v_combine_high(const v_##_Tpvec& a, const v_##_Tpvec& b) \\\n{ \\\n    return v_##_Tpvec(vcombine_##suffix(vget_high_##suffix(a.val), vget_high_##suffix(b.val))); \\\n} \\\ninline void v_recombine(const v_##_Tpvec& a, const v_##_Tpvec& b, v_##_Tpvec& c, v_##_Tpvec& d) \\\n{ \\\n    c.val = vcombine_##suffix(vget_low_##suffix(a.val), vget_low_##suffix(b.val)); \\\n    d.val = vcombine_##suffix(vget_high_##suffix(a.val), vget_high_##suffix(b.val)); \\\n}\n#endif\n\nOPENCV_HAL_IMPL_NEON_UNPACKS(uint8x16, u8)\nOPENCV_HAL_IMPL_NEON_UNPACKS(int8x16, s8)\nOPENCV_HAL_IMPL_NEON_UNPACKS(uint16x8, u16)\nOPENCV_HAL_IMPL_NEON_UNPACKS(int16x8, s16)\nOPENCV_HAL_IMPL_NEON_UNPACKS(uint32x4, u32)\nOPENCV_HAL_IMPL_NEON_UNPACKS(int32x4, s32)\nOPENCV_HAL_IMPL_NEON_UNPACKS(float32x4, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_UNPACKS(float64x2, f64)\n#endif\n\ninline v_uint8x16 v_reverse(const v_uint8x16 &a)\n{\n    uint8x16_t vec = vrev64q_u8(a.val);\n    return v_uint8x16(vextq_u8(vec, vec, 8));\n}\n\ninline v_int8x16 v_reverse(const v_int8x16 &a)\n{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); }\n\ninline v_uint16x8 v_reverse(const v_uint16x8 &a)\n{\n    uint16x8_t vec = vrev64q_u16(a.val);\n    return v_uint16x8(vextq_u16(vec, vec, 4));\n}\n\ninline v_int16x8 v_reverse(const v_int16x8 &a)\n{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); }\n\ninline v_uint32x4 v_reverse(const v_uint32x4 &a)\n{\n    uint32x4_t vec = vrev64q_u32(a.val);\n    return v_uint32x4(vextq_u32(vec, vec, 2));\n}\n\ninline v_int32x4 v_reverse(const v_int32x4 &a)\n{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_float32x4 v_reverse(const v_float32x4 &a)\n{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_uint64x2 v_reverse(const v_uint64x2 &a)\n{\n    uint64x2_t vec = a.val;\n    uint64x1_t vec_lo = vget_low_u64(vec);\n    uint64x1_t vec_hi = vget_high_u64(vec);\n    return v_uint64x2(vcombine_u64(vec_hi, vec_lo));\n}\n\ninline v_int64x2 v_reverse(const v_int64x2 &a)\n{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); }\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_reverse(const v_float64x2 &a)\n{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); }\n#endif\n\n#define OPENCV_HAL_IMPL_NEON_EXTRACT(_Tpvec, suffix) \\\ntemplate <int s> \\\ninline v_##_Tpvec v_extract(const v_##_Tpvec& a, const v_##_Tpvec& b) \\\n{ \\\n    return v_##_Tpvec(vextq_##suffix(a.val, b.val, s)); \\\n}\n\nOPENCV_HAL_IMPL_NEON_EXTRACT(uint8x16, u8)\nOPENCV_HAL_IMPL_NEON_EXTRACT(int8x16, s8)\nOPENCV_HAL_IMPL_NEON_EXTRACT(uint16x8, u16)\nOPENCV_HAL_IMPL_NEON_EXTRACT(int16x8, s16)\nOPENCV_HAL_IMPL_NEON_EXTRACT(uint32x4, u32)\nOPENCV_HAL_IMPL_NEON_EXTRACT(int32x4, s32)\nOPENCV_HAL_IMPL_NEON_EXTRACT(uint64x2, u64)\nOPENCV_HAL_IMPL_NEON_EXTRACT(int64x2, s64)\nOPENCV_HAL_IMPL_NEON_EXTRACT(float32x4, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_EXTRACT(float64x2, f64)\n#endif\n\n#define OPENCV_HAL_IMPL_NEON_EXTRACT_N(_Tpvec, _Tp, suffix) \\\ntemplate<int i> inline _Tp v_extract_n(_Tpvec v) { return vgetq_lane_##suffix(v.val, i); }\n\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_int8x16, schar, s8)\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_int16x8, short, s16)\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_uint32x4, uint, u32)\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_int32x4, int, s32)\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_int64x2, int64, s64)\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_float32x4, float, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_EXTRACT_N(v_float64x2, double, f64)\n#endif\n\n#define OPENCV_HAL_IMPL_NEON_BROADCAST(_Tpvec, _Tp, suffix) \\\ntemplate<int i> inline _Tpvec v_broadcast_element(_Tpvec v) { _Tp t = v_extract_n<i>(v); return v_setall_##suffix(t); }\n\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_int8x16, schar, s8)\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_int16x8, short, s16)\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_uint32x4, uint, u32)\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_int32x4, int, s32)\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_int64x2, int64, s64)\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_float32x4, float, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_BROADCAST(v_float64x2, double, f64)\n#endif\n\n#if CV_SIMD128_64F\ninline v_int32x4 v_round(const v_float32x4& a)\n{\n    float32x4_t a_ = a.val;\n    int32x4_t result;\n    __asm__ (\"fcvtns %0.4s, %1.4s\"\n             : \"=w\"(result)\n             : \"w\"(a_)\n             : /* No clobbers */);\n    return v_int32x4(result);\n}\n#else\ninline v_int32x4 v_round(const v_float32x4& a)\n{\n    static const int32x4_t v_sign = vdupq_n_s32(1 << 31),\n        v_05 = vreinterpretq_s32_f32(vdupq_n_f32(0.5f));\n\n    int32x4_t v_addition = vorrq_s32(v_05, vandq_s32(v_sign, vreinterpretq_s32_f32(a.val)));\n    return v_int32x4(vcvtq_s32_f32(vaddq_f32(a.val, vreinterpretq_f32_s32(v_addition))));\n}\n#endif\ninline v_int32x4 v_floor(const v_float32x4& a)\n{\n    int32x4_t a1 = vcvtq_s32_f32(a.val);\n    uint32x4_t mask = vcgtq_f32(vcvtq_f32_s32(a1), a.val);\n    return v_int32x4(vaddq_s32(a1, vreinterpretq_s32_u32(mask)));\n}\n\ninline v_int32x4 v_ceil(const v_float32x4& a)\n{\n    int32x4_t a1 = vcvtq_s32_f32(a.val);\n    uint32x4_t mask = vcgtq_f32(a.val, vcvtq_f32_s32(a1));\n    return v_int32x4(vsubq_s32(a1, vreinterpretq_s32_u32(mask)));\n}\n\ninline v_int32x4 v_trunc(const v_float32x4& a)\n{ return v_int32x4(vcvtq_s32_f32(a.val)); }\n\n#if CV_SIMD128_64F\ninline v_int32x4 v_round(const v_float64x2& a)\n{\n    static const int32x2_t zero = vdup_n_s32(0);\n    return v_int32x4(vcombine_s32(vmovn_s64(vcvtaq_s64_f64(a.val)), zero));\n}\n\ninline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b)\n{\n    return v_int32x4(vcombine_s32(vmovn_s64(vcvtaq_s64_f64(a.val)), vmovn_s64(vcvtaq_s64_f64(b.val))));\n}\n\ninline v_int32x4 v_floor(const v_float64x2& a)\n{\n    static const int32x2_t zero = vdup_n_s32(0);\n    int64x2_t a1 = vcvtq_s64_f64(a.val);\n    uint64x2_t mask = vcgtq_f64(vcvtq_f64_s64(a1), a.val);\n    a1 = vaddq_s64(a1, vreinterpretq_s64_u64(mask));\n    return v_int32x4(vcombine_s32(vmovn_s64(a1), zero));\n}\n\ninline v_int32x4 v_ceil(const v_float64x2& a)\n{\n    static const int32x2_t zero = vdup_n_s32(0);\n    int64x2_t a1 = vcvtq_s64_f64(a.val);\n    uint64x2_t mask = vcgtq_f64(a.val, vcvtq_f64_s64(a1));\n    a1 = vsubq_s64(a1, vreinterpretq_s64_u64(mask));\n    return v_int32x4(vcombine_s32(vmovn_s64(a1), zero));\n}\n\ninline v_int32x4 v_trunc(const v_float64x2& a)\n{\n    static const int32x2_t zero = vdup_n_s32(0);\n    return v_int32x4(vcombine_s32(vmovn_s64(vcvtaq_s64_f64(a.val)), zero));\n}\n#endif\n\n#if CV_NEON_AARCH64\n#define OPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(_Tpvec, suffix) \\\ninline void v_transpose4x4(const v_##_Tpvec& a0, const v_##_Tpvec& a1, \\\n                         const v_##_Tpvec& a2, const v_##_Tpvec& a3, \\\n                         v_##_Tpvec& b0, v_##_Tpvec& b1, \\\n                         v_##_Tpvec& b2, v_##_Tpvec& b3) \\\n{ \\\n    /* -- Pass 1: 64b transpose */ \\\n    _Tpvec##_t t0 = vreinterpretq_##suffix##32_##suffix##64( \\\n                        vtrn1q_##suffix##64(vreinterpretq_##suffix##64_##suffix##32(a0.val), \\\n                                            vreinterpretq_##suffix##64_##suffix##32(a2.val))); \\\n    _Tpvec##_t t1 = vreinterpretq_##suffix##32_##suffix##64( \\\n                        vtrn1q_##suffix##64(vreinterpretq_##suffix##64_##suffix##32(a1.val), \\\n                                            vreinterpretq_##suffix##64_##suffix##32(a3.val))); \\\n    _Tpvec##_t t2 = vreinterpretq_##suffix##32_##suffix##64( \\\n                        vtrn2q_##suffix##64(vreinterpretq_##suffix##64_##suffix##32(a0.val), \\\n                                            vreinterpretq_##suffix##64_##suffix##32(a2.val))); \\\n    _Tpvec##_t t3 = vreinterpretq_##suffix##32_##suffix##64( \\\n                        vtrn2q_##suffix##64(vreinterpretq_##suffix##64_##suffix##32(a1.val), \\\n                                            vreinterpretq_##suffix##64_##suffix##32(a3.val))); \\\n    /* -- Pass 2: 32b transpose */ \\\n    b0.val = vtrn1q_##suffix##32(t0, t1); \\\n    b1.val = vtrn2q_##suffix##32(t0, t1); \\\n    b2.val = vtrn1q_##suffix##32(t2, t3); \\\n    b3.val = vtrn2q_##suffix##32(t2, t3); \\\n}\n\nOPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(uint32x4, u)\nOPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(int32x4, s)\nOPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(float32x4, f)\n#else // #if CV_NEON_AARCH64\n#define OPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(_Tpvec, suffix) \\\ninline void v_transpose4x4(const v_##_Tpvec& a0, const v_##_Tpvec& a1, \\\n                         const v_##_Tpvec& a2, const v_##_Tpvec& a3, \\\n                         v_##_Tpvec& b0, v_##_Tpvec& b1, \\\n                         v_##_Tpvec& b2, v_##_Tpvec& b3) \\\n{ \\\n    /* m00 m01 m02 m03 */ \\\n    /* m10 m11 m12 m13 */ \\\n    /* m20 m21 m22 m23 */ \\\n    /* m30 m31 m32 m33 */ \\\n    _Tpvec##x2_t t0 = vtrnq_##suffix(a0.val, a1.val); \\\n    _Tpvec##x2_t t1 = vtrnq_##suffix(a2.val, a3.val); \\\n    /* m00 m10 m02 m12 */ \\\n    /* m01 m11 m03 m13 */ \\\n    /* m20 m30 m22 m32 */ \\\n    /* m21 m31 m23 m33 */ \\\n    b0.val = vcombine_##suffix(vget_low_##suffix(t0.val[0]), vget_low_##suffix(t1.val[0])); \\\n    b1.val = vcombine_##suffix(vget_low_##suffix(t0.val[1]), vget_low_##suffix(t1.val[1])); \\\n    b2.val = vcombine_##suffix(vget_high_##suffix(t0.val[0]), vget_high_##suffix(t1.val[0])); \\\n    b3.val = vcombine_##suffix(vget_high_##suffix(t0.val[1]), vget_high_##suffix(t1.val[1])); \\\n}\n\nOPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(uint32x4, u32)\nOPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(int32x4, s32)\nOPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(float32x4, f32)\n#endif // #if CV_NEON_AARCH64\n\n#define OPENCV_HAL_IMPL_NEON_INTERLEAVED(_Tpvec, _Tp, suffix) \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b) \\\n{ \\\n    _Tpvec##x2_t v = vld2q_##suffix(ptr); \\\n    a.val = v.val[0]; \\\n    b.val = v.val[1]; \\\n} \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, v_##_Tpvec& c) \\\n{ \\\n    _Tpvec##x3_t v = vld3q_##suffix(ptr); \\\n    a.val = v.val[0]; \\\n    b.val = v.val[1]; \\\n    c.val = v.val[2]; \\\n} \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, \\\n                                v_##_Tpvec& c, v_##_Tpvec& d) \\\n{ \\\n    _Tpvec##x4_t v = vld4q_##suffix(ptr); \\\n    a.val = v.val[0]; \\\n    b.val = v.val[1]; \\\n    c.val = v.val[2]; \\\n    d.val = v.val[3]; \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    _Tpvec##x2_t v; \\\n    v.val[0] = a.val; \\\n    v.val[1] = b.val; \\\n    vst2q_##suffix(ptr, v); \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \\\n                                const v_##_Tpvec& c, hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    _Tpvec##x3_t v; \\\n    v.val[0] = a.val; \\\n    v.val[1] = b.val; \\\n    v.val[2] = c.val; \\\n    vst3q_##suffix(ptr, v); \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \\\n                                const v_##_Tpvec& c, const v_##_Tpvec& d, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec##x4_t v; \\\n    v.val[0] = a.val; \\\n    v.val[1] = b.val; \\\n    v.val[2] = c.val; \\\n    v.val[3] = d.val; \\\n    vst4q_##suffix(ptr, v); \\\n}\n\n#define OPENCV_HAL_IMPL_NEON_INTERLEAVED_INT64(tp, suffix) \\\ninline void v_load_deinterleave( const tp* ptr, v_##tp##x2& a, v_##tp##x2& b ) \\\n{ \\\n    tp##x1_t a0 = vld1_##suffix(ptr); \\\n    tp##x1_t b0 = vld1_##suffix(ptr + 1); \\\n    tp##x1_t a1 = vld1_##suffix(ptr + 2); \\\n    tp##x1_t b1 = vld1_##suffix(ptr + 3); \\\n    a = v_##tp##x2(vcombine_##suffix(a0, a1)); \\\n    b = v_##tp##x2(vcombine_##suffix(b0, b1)); \\\n} \\\n \\\ninline void v_load_deinterleave( const tp* ptr, v_##tp##x2& a, \\\n                                 v_##tp##x2& b, v_##tp##x2& c ) \\\n{ \\\n    tp##x1_t a0 = vld1_##suffix(ptr); \\\n    tp##x1_t b0 = vld1_##suffix(ptr + 1); \\\n    tp##x1_t c0 = vld1_##suffix(ptr + 2); \\\n    tp##x1_t a1 = vld1_##suffix(ptr + 3); \\\n    tp##x1_t b1 = vld1_##suffix(ptr + 4); \\\n    tp##x1_t c1 = vld1_##suffix(ptr + 5); \\\n    a = v_##tp##x2(vcombine_##suffix(a0, a1)); \\\n    b = v_##tp##x2(vcombine_##suffix(b0, b1)); \\\n    c = v_##tp##x2(vcombine_##suffix(c0, c1)); \\\n} \\\n \\\ninline void v_load_deinterleave( const tp* ptr, v_##tp##x2& a, v_##tp##x2& b, \\\n                                 v_##tp##x2& c, v_##tp##x2& d ) \\\n{ \\\n    tp##x1_t a0 = vld1_##suffix(ptr); \\\n    tp##x1_t b0 = vld1_##suffix(ptr + 1); \\\n    tp##x1_t c0 = vld1_##suffix(ptr + 2); \\\n    tp##x1_t d0 = vld1_##suffix(ptr + 3); \\\n    tp##x1_t a1 = vld1_##suffix(ptr + 4); \\\n    tp##x1_t b1 = vld1_##suffix(ptr + 5); \\\n    tp##x1_t c1 = vld1_##suffix(ptr + 6); \\\n    tp##x1_t d1 = vld1_##suffix(ptr + 7); \\\n    a = v_##tp##x2(vcombine_##suffix(a0, a1)); \\\n    b = v_##tp##x2(vcombine_##suffix(b0, b1)); \\\n    c = v_##tp##x2(vcombine_##suffix(c0, c1)); \\\n    d = v_##tp##x2(vcombine_##suffix(d0, d1)); \\\n} \\\n \\\ninline void v_store_interleave( tp* ptr, const v_##tp##x2& a, const v_##tp##x2& b, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    vst1_##suffix(ptr, vget_low_##suffix(a.val)); \\\n    vst1_##suffix(ptr + 1, vget_low_##suffix(b.val)); \\\n    vst1_##suffix(ptr + 2, vget_high_##suffix(a.val)); \\\n    vst1_##suffix(ptr + 3, vget_high_##suffix(b.val)); \\\n} \\\n \\\ninline void v_store_interleave( tp* ptr, const v_##tp##x2& a, \\\n                                const v_##tp##x2& b, const v_##tp##x2& c, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    vst1_##suffix(ptr, vget_low_##suffix(a.val)); \\\n    vst1_##suffix(ptr + 1, vget_low_##suffix(b.val)); \\\n    vst1_##suffix(ptr + 2, vget_low_##suffix(c.val)); \\\n    vst1_##suffix(ptr + 3, vget_high_##suffix(a.val)); \\\n    vst1_##suffix(ptr + 4, vget_high_##suffix(b.val)); \\\n    vst1_##suffix(ptr + 5, vget_high_##suffix(c.val)); \\\n} \\\n \\\ninline void v_store_interleave( tp* ptr, const v_##tp##x2& a, const v_##tp##x2& b, \\\n                                const v_##tp##x2& c, const v_##tp##x2& d, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    vst1_##suffix(ptr, vget_low_##suffix(a.val)); \\\n    vst1_##suffix(ptr + 1, vget_low_##suffix(b.val)); \\\n    vst1_##suffix(ptr + 2, vget_low_##suffix(c.val)); \\\n    vst1_##suffix(ptr + 3, vget_low_##suffix(d.val)); \\\n    vst1_##suffix(ptr + 4, vget_high_##suffix(a.val)); \\\n    vst1_##suffix(ptr + 5, vget_high_##suffix(b.val)); \\\n    vst1_##suffix(ptr + 6, vget_high_##suffix(c.val)); \\\n    vst1_##suffix(ptr + 7, vget_high_##suffix(d.val)); \\\n}\n\nOPENCV_HAL_IMPL_NEON_INTERLEAVED(uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_NEON_INTERLEAVED(int8x16, schar, s8)\nOPENCV_HAL_IMPL_NEON_INTERLEAVED(uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_NEON_INTERLEAVED(int16x8, short, s16)\nOPENCV_HAL_IMPL_NEON_INTERLEAVED(uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_NEON_INTERLEAVED(int32x4, int, s32)\nOPENCV_HAL_IMPL_NEON_INTERLEAVED(float32x4, float, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_NEON_INTERLEAVED(float64x2, double, f64)\n#endif\n\nOPENCV_HAL_IMPL_NEON_INTERLEAVED_INT64(int64, s64)\nOPENCV_HAL_IMPL_NEON_INTERLEAVED_INT64(uint64, u64)\n\ninline v_float32x4 v_cvt_f32(const v_int32x4& a)\n{\n    return v_float32x4(vcvtq_f32_s32(a.val));\n}\n\n#if CV_SIMD128_64F\ninline v_float32x4 v_cvt_f32(const v_float64x2& a)\n{\n    float32x2_t zero = vdup_n_f32(0.0f);\n    return v_float32x4(vcombine_f32(vcvt_f32_f64(a.val), zero));\n}\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b)\n{\n    return v_float32x4(vcombine_f32(vcvt_f32_f64(a.val), vcvt_f32_f64(b.val)));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int32x4& a)\n{\n    return v_float64x2(vcvt_f64_f32(vcvt_f32_s32(vget_low_s32(a.val))));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_int32x4& a)\n{\n    return v_float64x2(vcvt_f64_f32(vcvt_f32_s32(vget_high_s32(a.val))));\n}\n\ninline v_float64x2 v_cvt_f64(const v_float32x4& a)\n{\n    return v_float64x2(vcvt_f64_f32(vget_low_f32(a.val)));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_float32x4& a)\n{\n    return v_float64x2(vcvt_f64_f32(vget_high_f32(a.val)));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int64x2& a)\n{  return v_float64x2(vcvtq_f64_s64(a.val)); }\n\n#endif\n\n////////////// Lookup table access ////////////////////\n\ninline v_int8x16 v_lut(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[ 0]],\n        tab[idx[ 1]],\n        tab[idx[ 2]],\n        tab[idx[ 3]],\n        tab[idx[ 4]],\n        tab[idx[ 5]],\n        tab[idx[ 6]],\n        tab[idx[ 7]],\n        tab[idx[ 8]],\n        tab[idx[ 9]],\n        tab[idx[10]],\n        tab[idx[11]],\n        tab[idx[12]],\n        tab[idx[13]],\n        tab[idx[14]],\n        tab[idx[15]]\n    };\n    return v_int8x16(vld1q_s8(elems));\n}\ninline v_int8x16 v_lut_pairs(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[3]],\n        tab[idx[3] + 1],\n        tab[idx[4]],\n        tab[idx[4] + 1],\n        tab[idx[5]],\n        tab[idx[5] + 1],\n        tab[idx[6]],\n        tab[idx[6] + 1],\n        tab[idx[7]],\n        tab[idx[7] + 1]\n    };\n    return v_int8x16(vld1q_s8(elems));\n}\ninline v_int8x16 v_lut_quads(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[0] + 2],\n        tab[idx[0] + 3],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[1] + 2],\n        tab[idx[1] + 3],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[2] + 2],\n        tab[idx[2] + 3],\n        tab[idx[3]],\n        tab[idx[3] + 1],\n        tab[idx[3] + 2],\n        tab[idx[3] + 3]\n    };\n    return v_int8x16(vld1q_s8(elems));\n}\ninline v_uint8x16 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((schar*)tab, idx)); }\ninline v_uint8x16 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((schar*)tab, idx)); }\ninline v_uint8x16 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((schar*)tab, idx)); }\n\ninline v_int16x8 v_lut(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]],\n        tab[idx[4]],\n        tab[idx[5]],\n        tab[idx[6]],\n        tab[idx[7]]\n    };\n    return v_int16x8(vld1q_s16(elems));\n}\ninline v_int16x8 v_lut_pairs(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[3]],\n        tab[idx[3] + 1]\n    };\n    return v_int16x8(vld1q_s16(elems));\n}\ninline v_int16x8 v_lut_quads(const short* tab, const int* idx)\n{\n    return v_int16x8(vcombine_s16(vld1_s16(tab + idx[0]), vld1_s16(tab + idx[1])));\n}\ninline v_uint16x8 v_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut((short*)tab, idx)); }\ninline v_uint16x8 v_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_pairs((short*)tab, idx)); }\ninline v_uint16x8 v_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_quads((short*)tab, idx)); }\n\ninline v_int32x4 v_lut(const int* tab, const int* idx)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]]\n    };\n    return v_int32x4(vld1q_s32(elems));\n}\ninline v_int32x4 v_lut_pairs(const int* tab, const int* idx)\n{\n    return v_int32x4(vcombine_s32(vld1_s32(tab + idx[0]), vld1_s32(tab + idx[1])));\n}\ninline v_int32x4 v_lut_quads(const int* tab, const int* idx)\n{\n    return v_int32x4(vld1q_s32(tab + idx[0]));\n}\ninline v_uint32x4 v_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut((int*)tab, idx)); }\ninline v_uint32x4 v_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_pairs((int*)tab, idx)); }\ninline v_uint32x4 v_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_quads((int*)tab, idx)); }\n\ninline v_int64x2 v_lut(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(vcombine_s64(vcreate_s64(tab[idx[0]]), vcreate_s64(tab[idx[1]])));\n}\ninline v_int64x2 v_lut_pairs(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(vld1q_s64(tab + idx[0]));\n}\ninline v_uint64x2 v_lut(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut((const int64_t *)tab, idx)); }\ninline v_uint64x2 v_lut_pairs(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut_pairs((const int64_t *)tab, idx)); }\n\ninline v_float32x4 v_lut(const float* tab, const int* idx)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]]\n    };\n    return v_float32x4(vld1q_f32(elems));\n}\ninline v_float32x4 v_lut_pairs(const float* tab, const int* idx)\n{\n    typedef uint64 CV_DECL_ALIGNED(1) unaligned_uint64;\n\n    uint64 CV_DECL_ALIGNED(32) elems[2] =\n    {\n        *(unaligned_uint64*)(tab + idx[0]),\n        *(unaligned_uint64*)(tab + idx[1])\n    };\n    return v_float32x4(vreinterpretq_f32_u64(vld1q_u64(elems)));\n}\ninline v_float32x4 v_lut_quads(const float* tab, const int* idx)\n{\n    return v_float32x4(vld1q_f32(tab + idx[0]));\n}\n\ninline v_int32x4 v_lut(const int* tab, const v_int32x4& idxvec)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[vgetq_lane_s32(idxvec.val, 0)],\n        tab[vgetq_lane_s32(idxvec.val, 1)],\n        tab[vgetq_lane_s32(idxvec.val, 2)],\n        tab[vgetq_lane_s32(idxvec.val, 3)]\n    };\n    return v_int32x4(vld1q_s32(elems));\n}\n\ninline v_uint32x4 v_lut(const unsigned* tab, const v_int32x4& idxvec)\n{\n    unsigned CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[vgetq_lane_s32(idxvec.val, 0)],\n        tab[vgetq_lane_s32(idxvec.val, 1)],\n        tab[vgetq_lane_s32(idxvec.val, 2)],\n        tab[vgetq_lane_s32(idxvec.val, 3)]\n    };\n    return v_uint32x4(vld1q_u32(elems));\n}\n\ninline v_float32x4 v_lut(const float* tab, const v_int32x4& idxvec)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[vgetq_lane_s32(idxvec.val, 0)],\n        tab[vgetq_lane_s32(idxvec.val, 1)],\n        tab[vgetq_lane_s32(idxvec.val, 2)],\n        tab[vgetq_lane_s32(idxvec.val, 3)]\n    };\n    return v_float32x4(vld1q_f32(elems));\n}\n\ninline void v_lut_deinterleave(const float* tab, const v_int32x4& idxvec, v_float32x4& x, v_float32x4& y)\n{\n    /*int CV_DECL_ALIGNED(32) idx[4];\n    v_store(idx, idxvec);\n\n    float32x4_t xy02 = vcombine_f32(vld1_f32(tab + idx[0]), vld1_f32(tab + idx[2]));\n    float32x4_t xy13 = vcombine_f32(vld1_f32(tab + idx[1]), vld1_f32(tab + idx[3]));\n\n    float32x4x2_t xxyy = vuzpq_f32(xy02, xy13);\n    x = v_float32x4(xxyy.val[0]);\n    y = v_float32x4(xxyy.val[1]);*/\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n\n    x = v_float32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n    y = v_float32x4(tab[idx[0]+1], tab[idx[1]+1], tab[idx[2]+1], tab[idx[3]+1]);\n}\n\ninline v_int8x16 v_interleave_pairs(const v_int8x16& vec)\n{\n    return v_int8x16(vcombine_s8(vtbl1_s8(vget_low_s8(vec.val), vcreate_s8(0x0705060403010200)), vtbl1_s8(vget_high_s8(vec.val), vcreate_s8(0x0705060403010200))));\n}\ninline v_uint8x16 v_interleave_pairs(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); }\ninline v_int8x16 v_interleave_quads(const v_int8x16& vec)\n{\n    return v_int8x16(vcombine_s8(vtbl1_s8(vget_low_s8(vec.val), vcreate_s8(0x0703060205010400)), vtbl1_s8(vget_high_s8(vec.val), vcreate_s8(0x0703060205010400))));\n}\ninline v_uint8x16 v_interleave_quads(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_interleave_pairs(const v_int16x8& vec)\n{\n    return v_int16x8(vreinterpretq_s16_s8(vcombine_s8(vtbl1_s8(vget_low_s8(vreinterpretq_s8_s16(vec.val)), vcreate_s8(0x0706030205040100)), vtbl1_s8(vget_high_s8(vreinterpretq_s8_s16(vec.val)), vcreate_s8(0x0706030205040100)))));\n}\ninline v_uint16x8 v_interleave_pairs(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); }\ninline v_int16x8 v_interleave_quads(const v_int16x8& vec)\n{\n    int16x4x2_t res = vzip_s16(vget_low_s16(vec.val), vget_high_s16(vec.val));\n    return v_int16x8(vcombine_s16(res.val[0], res.val[1]));\n}\ninline v_uint16x8 v_interleave_quads(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_interleave_pairs(const v_int32x4& vec)\n{\n    int32x2x2_t res = vzip_s32(vget_low_s32(vec.val), vget_high_s32(vec.val));\n    return v_int32x4(vcombine_s32(res.val[0], res.val[1]));\n}\ninline v_uint32x4 v_interleave_pairs(const v_uint32x4& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\ninline v_float32x4 v_interleave_pairs(const v_float32x4& vec) { return v_reinterpret_as_f32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\n\ninline v_int8x16 v_pack_triplets(const v_int8x16& vec)\n{\n    return v_int8x16(vextq_s8(vcombine_s8(vtbl1_s8(vget_low_s8(vec.val), vcreate_s8(0x0605040201000000)), vtbl1_s8(vget_high_s8(vec.val), vcreate_s8(0x0807060504020100))), vdupq_n_s8(0), 2));\n}\ninline v_uint8x16 v_pack_triplets(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_pack_triplets(const v_int16x8& vec)\n{\n    return v_int16x8(vreinterpretq_s16_s8(vextq_s8(vcombine_s8(vtbl1_s8(vget_low_s8(vreinterpretq_s8_s16(vec.val)), vcreate_s8(0x0504030201000000)), vget_high_s8(vreinterpretq_s8_s16(vec.val))), vdupq_n_s8(0), 2)));\n}\ninline v_uint16x8 v_pack_triplets(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_pack_triplets(const v_int32x4& vec) { return vec; }\ninline v_uint32x4 v_pack_triplets(const v_uint32x4& vec) { return vec; }\ninline v_float32x4 v_pack_triplets(const v_float32x4& vec) { return vec; }\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_lut(const double* tab, const int* idx)\n{\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        tab[idx[0]],\n        tab[idx[1]]\n    };\n    return v_float64x2(vld1q_f64(elems));\n}\n\ninline v_float64x2 v_lut_pairs(const double* tab, const int* idx)\n{\n    return v_float64x2(vld1q_f64(tab + idx[0]));\n}\n\ninline v_float64x2 v_lut(const double* tab, const v_int32x4& idxvec)\n{\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        tab[vgetq_lane_s32(idxvec.val, 0)],\n        tab[vgetq_lane_s32(idxvec.val, 1)],\n    };\n    return v_float64x2(vld1q_f64(elems));\n}\n\ninline void v_lut_deinterleave(const double* tab, const v_int32x4& idxvec, v_float64x2& x, v_float64x2& y)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n\n    x = v_float64x2(tab[idx[0]], tab[idx[1]]);\n    y = v_float64x2(tab[idx[0]+1], tab[idx[1]+1]);\n}\n#endif\n\n////// FP16 support ///////\n#if CV_FP16\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n    float16x4_t v =\n    #ifndef vld1_f16 // APPLE compiler defines vld1_f16 as macro\n        (float16x4_t)vld1_s16((const short*)ptr);\n    #else\n        vld1_f16((const __fp16*)ptr);\n    #endif\n    return v_float32x4(vcvt_f32_f16(v));\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n    float16x4_t hv = vcvt_f16_f32(v.val);\n\n    #ifndef vst1_f16 // APPLE compiler defines vst1_f16 as macro\n        vst1_s16((short*)ptr, (int16x4_t)hv);\n    #else\n        vst1_f16((__fp16*)ptr, hv);\n    #endif\n}\n#else\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n    const int N = 4;\n    float buf[N];\n    for( int i = 0; i < N; i++ ) buf[i] = (float)ptr[i];\n    return v_load(buf);\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n    const int N = 4;\n    float buf[N];\n    v_store(buf, v);\n    for( int i = 0; i < N; i++ ) ptr[i] = float16_t(buf[i]);\n}\n#endif\n\ninline void v_cleanup() {}\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_rvv.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n// The original implementation has been contributed by Yin Zhang.\n// Copyright (C) 2020, Institute of Software, Chinese Academy of Sciences.\n\n#ifndef OPENCV_HAL_INTRIN_RVV_HPP\n#define OPENCV_HAL_INTRIN_RVV_HPP\n\n#include <algorithm>\n\nnamespace cv\n{\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n#define CV_SIMD128 1\n#define CV_SIMD128_64F 1\n\n//////////// Unsupported native intrinsics in C++ ////////////\n\nstruct vuint8mf2_t\n{\n    uchar val[8] = {0};\n    vuint8mf2_t() {}\n    vuint8mf2_t(const uchar* ptr)\n    {\n        for (int i = 0; i < 8; ++i)\n        {\n            val[i] = ptr[i];\n        }\n    }\n};\nstruct vint8mf2_t\n{\n    schar val[8] = {0};\n    vint8mf2_t() {}\n    vint8mf2_t(const schar* ptr)\n    {\n        for (int i = 0; i < 8; ++i)\n        {\n            val[i] = ptr[i];\n        }\n    }\n};\nstruct vuint16mf2_t\n{\n    ushort val[4] = {0};\n    vuint16mf2_t() {}\n    vuint16mf2_t(const ushort* ptr)\n    {\n        for (int i = 0; i < 4; ++i)\n        {\n            val[i] = ptr[i];\n        }\n    }\n};\nstruct vint16mf2_t\n{\n    short val[4] = {0};\n    vint16mf2_t() {}\n    vint16mf2_t(const short* ptr)\n    {\n        for (int i = 0; i < 4; ++i)\n        {\n            val[i] = ptr[i];\n        }\n    }\n};\nstruct vuint32mf2_t\n{\n    unsigned val[2] = {0};\n    vuint32mf2_t() {}\n    vuint32mf2_t(const unsigned* ptr)\n    {\n        val[0] = ptr[0];\n        val[1] = ptr[1];\n    }\n};\nstruct vint32mf2_t\n{\n    int val[2] = {0};\n    vint32mf2_t() {}\n    vint32mf2_t(const int* ptr)\n    {\n        val[0] = ptr[0];\n        val[1] = ptr[1];\n    }\n};\nstruct vfloat32mf2_t\n{\n    float val[2] = {0};\n    vfloat32mf2_t() {}\n    vfloat32mf2_t(const float* ptr)\n    {\n        val[0] = ptr[0];\n        val[1] = ptr[1];\n    }\n};\nstruct vuint64mf2_t\n{\n    uint64 val[1] = {0};\n    vuint64mf2_t() {}\n    vuint64mf2_t(const uint64* ptr)\n    {\n        val[0] = ptr[0];\n    }\n};\nstruct vint64mf2_t\n{\n    int64 val[1] = {0};\n    vint64mf2_t() {}\n    vint64mf2_t(const int64* ptr)\n    {\n        val[0] = ptr[0];\n    }\n};\nstruct vfloat64mf2_t\n{\n    double val[1] = {0};\n    vfloat64mf2_t() {}\n    vfloat64mf2_t(const double* ptr)\n    {\n        val[0] = ptr[0];\n    }\n};\nstruct vuint8mf4_t\n{\n    uchar val[4] = {0};\n    vuint8mf4_t() {}\n    vuint8mf4_t(const uchar* ptr)\n    {\n        for (int i = 0; i < 4; ++i)\n        {\n            val[i] = ptr[i];\n        }\n    }\n};\nstruct vint8mf4_t\n{\n    schar val[4] = {0};\n    vint8mf4_t() {}\n    vint8mf4_t(const schar* ptr)\n    {\n        for (int i = 0; i < 4; ++i)\n        {\n            val[i] = ptr[i];\n        }\n    }\n};\n\n#define OPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(_Tpvec, _Tp, suffix, width, n) \\\ninline _Tpvec vle##width##_v_##suffix##mf2(const _Tp* ptr) \\\n{ \\\n    return _Tpvec(ptr); \\\n} \\\ninline void vse##width##_v_##suffix##mf2(_Tp* ptr, _Tpvec v) \\\n{ \\\n    for (int i = 0; i < n; ++i) \\\n    { \\\n            ptr[i] = v.val[i]; \\\n    } \\\n}\n\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vuint8mf2_t, uint8_t, u8, 8, 8)\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vint8mf2_t, int8_t, i8, 8, 8)\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vuint16mf2_t, uint16_t, u16, 16, 4)\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vint16mf2_t, int16_t, i16, 16, 4)\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vuint32mf2_t, uint32_t, u32, 32, 2)\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vint32mf2_t, int32_t, i32, 32, 2)\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vfloat32mf2_t, float32_t, f32, 32, 2)\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vuint64mf2_t, uint64_t, u64, 64, 1)\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vint64mf2_t, int64_t, i64, 64, 1)\nOPENCV_HAL_IMPL_RVV_NATIVE_LOADSTORE_MF2(vfloat64mf2_t, float64_t, f64, 64, 1)\n\n\n#define OPENCV_HAL_IMPL_RVV_NATIVE_WCVT(_Tpwvec, _Tpvec, _wTp, wcvt, suffix, width, n) \\\ninline _Tpwvec wcvt (_Tpvec v) \\\n{ \\\n    _wTp tmp[n]; \\\n    for (int i = 0; i < n; ++i) \\\n    { \\\n            tmp[i] = (_wTp)v.val[i]; \\\n    } \\\n    vsetvlmax_e##width##m1(); \\\n    return vle##width##_v_##suffix##m1(tmp); \\\n}\n\nOPENCV_HAL_IMPL_RVV_NATIVE_WCVT(vuint16m1_t, vuint8mf2_t, ushort, vwcvtu_x_x_v_u16m1, u16, 16, 8)\nOPENCV_HAL_IMPL_RVV_NATIVE_WCVT(vint16m1_t, vint8mf2_t, short, vwcvt_x_x_v_i16m1, i16, 16, 8)\nOPENCV_HAL_IMPL_RVV_NATIVE_WCVT(vuint32m1_t, vuint16mf2_t, unsigned, vwcvtu_x_x_v_u32m1, u32, 32, 4)\nOPENCV_HAL_IMPL_RVV_NATIVE_WCVT(vint32m1_t, vint16mf2_t, int, vwcvt_x_x_v_i32m1, i32, 32, 4)\nOPENCV_HAL_IMPL_RVV_NATIVE_WCVT(vuint64m1_t, vuint32mf2_t, uint64, vwcvtu_x_x_v_u64m1, u64, 64, 2)\nOPENCV_HAL_IMPL_RVV_NATIVE_WCVT(vint64m1_t, vint32mf2_t, int64, vwcvt_x_x_v_i64m1, i64, 64, 2)\n\ninline vuint8mf4_t vle8_v_u8mf4 (const uint8_t *base)\n{\n    return vuint8mf4_t(base);\n}\ninline vint8mf4_t vle8_v_i8mf4 (const int8_t *base)\n{\n    return vint8mf4_t(base);\n}\n\ninline vuint16mf2_t vwcvtu_x_x_v_u16mf2 (vuint8mf4_t src)\n{\n    ushort tmp[4];\n    for (int i = 0; i < 4; ++i)\n    {\n            tmp[i] = (ushort)src.val[i];\n    }\n    return vle16_v_u16mf2(tmp);\n}\ninline vint16mf2_t vwcvt_x_x_v_i16mf2 (vint8mf4_t src)\n{\n    short tmp[4];\n    for (int i = 0; i < 4; ++i)\n    {\n            tmp[i] = (short)src.val[i];\n    }\n    return vle16_v_i16mf2(tmp);\n}\n\n//////////// Types ////////////\n\nstruct v_uint8x16\n{\n    typedef uchar lane_type;\n    enum { nlanes = 16 };\n\n    v_uint8x16() {}\n    explicit v_uint8x16(vuint8m1_t v)\n    {\n        vsetvlmax_e8m1();\n        vse8_v_u8m1(val, v);\n    }\n    v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7,\n               uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15)\n    {\n        uchar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vuint8m1_t() const\n    {\n        vsetvlmax_e8m1();\n        return vle8_v_u8m1(val);\n    }\n    uchar get0() const\n    {\n        return val[0];\n    }\n\n    uchar val[16];\n};\n\nstruct v_int8x16\n{\n    typedef schar lane_type;\n    enum { nlanes = 16 };\n\n    v_int8x16() {}\n    explicit v_int8x16(vint8m1_t v)\n    {\n        vsetvlmax_e8m1();\n        vse8_v_i8m1(val, v);\n    }\n    v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7,\n               schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15)\n    {\n        schar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vint8m1_t() const\n    {\n        vsetvlmax_e8m1();\n        return vle8_v_i8m1(val);\n    }\n    schar get0() const\n    {\n        return val[0];\n    }\n\n    schar val[16];\n};\n\nstruct v_uint16x8\n{\n    typedef ushort lane_type;\n    enum { nlanes = 8 };\n\n    v_uint16x8() {}\n    explicit v_uint16x8(vuint16m1_t v)\n    {\n        vsetvlmax_e16m1();\n        vse16_v_u16m1(val, v);\n    }\n    v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)\n    {\n        ushort v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vuint16m1_t() const\n    {\n        vsetvlmax_e16m1();\n        return vle16_v_u16m1(val);\n    }\n    ushort get0() const\n    {\n        return val[0];\n    }\n\n    ushort val[8];\n};\n\nstruct v_int16x8\n{\n    typedef short lane_type;\n    enum { nlanes = 8 };\n\n    v_int16x8() {}\n    explicit v_int16x8(vint16m1_t v)\n    {\n        vsetvlmax_e16m1();\n        vse16_v_i16m1(val, v);\n    }\n    v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)\n    {\n        short v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vint16m1_t() const\n    {\n        vsetvlmax_e16m1();\n        return vle16_v_i16m1(val);\n    }\n    short get0() const\n    {\n        return val[0];\n    }\n\n    short val[8];\n};\n\nstruct v_uint32x4\n{\n    typedef unsigned lane_type;\n    enum { nlanes = 4 };\n\n    v_uint32x4() {}\n    explicit v_uint32x4(vuint32m1_t v)\n    {\n        vsetvlmax_e32m1();\n        vse32_v_u32m1(val, v);\n    }\n    v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3)\n    {\n        unsigned v[] = {v0, v1, v2, v3};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vuint32m1_t() const\n    {\n        vsetvlmax_e32m1();\n        return vle32_v_u32m1(val);\n    }\n    unsigned get0() const\n    {\n        return val[0];\n    }\n\n    unsigned val[4];\n};\n\nstruct v_int32x4\n{\n    typedef int lane_type;\n    enum { nlanes = 4 };\n\n    v_int32x4() {}\n    explicit v_int32x4(vint32m1_t v)\n    {\n        vsetvlmax_e32m1();\n        vse32_v_i32m1(val, v);\n    }\n    v_int32x4(int v0, int v1, int v2, int v3)\n    {\n        int v[] = {v0, v1, v2, v3};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vint32m1_t() const\n    {\n        vsetvlmax_e32m1();\n        return vle32_v_i32m1(val);\n    }\n    int get0() const\n    {\n        return val[0];\n    }\n    int val[4];\n};\n\nstruct v_float32x4\n{\n    typedef float lane_type;\n    enum { nlanes = 4 };\n\n    v_float32x4() {}\n    explicit v_float32x4(vfloat32m1_t v)\n    {\n        vsetvlmax_e32m1();\n        vse32_v_f32m1(val, v);\n    }\n    v_float32x4(float v0, float v1, float v2, float v3)\n    {\n        float v[] = {v0, v1, v2, v3};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vfloat32m1_t() const\n    {\n        vsetvlmax_e32m1();\n        return vle32_v_f32m1(val);\n    }\n    float get0() const\n    {\n        return val[0];\n    }\n    float val[4];\n};\n\nstruct v_uint64x2\n{\n    typedef uint64 lane_type;\n    enum { nlanes = 2 };\n\n    v_uint64x2() {}\n    explicit v_uint64x2(vuint64m1_t v)\n    {\n        vsetvlmax_e64m1();\n        vse64_v_u64m1(val, v);\n    }\n    v_uint64x2(uint64 v0, uint64 v1)\n    {\n        uint64 v[] = {v0, v1};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vuint64m1_t() const\n    {\n        vsetvlmax_e64m1();\n        return vle64_v_u64m1(val);\n    }\n    uint64 get0() const\n    {\n        return val[0];\n    }\n\n    uint64 val[2];\n};\n\nstruct v_int64x2\n{\n    typedef int64 lane_type;\n    enum { nlanes = 2 };\n\n    v_int64x2() {}\n    explicit v_int64x2(vint64m1_t v)\n    {\n        vsetvlmax_e64m1();\n        vse64_v_i64m1(val, v);\n    }\n    v_int64x2(int64 v0, int64 v1)\n    {\n        int64 v[] = {v0, v1};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vint64m1_t() const\n    {\n        vsetvlmax_e64m1();\n        return vle64_v_i64m1(val);\n    }\n    int64 get0() const\n    {\n        return val[0];\n    }\n\n    int64 val[2];\n};\n\n#if CV_SIMD128_64F\nstruct v_float64x2\n{\n    typedef double lane_type;\n    enum { nlanes = 2 };\n\n    v_float64x2() {}\n    explicit v_float64x2(vfloat64m1_t v)\n    {\n        vsetvlmax_e64m1();\n        vse64_v_f64m1(val, v);\n    }\n    v_float64x2(double v0, double v1)\n    {\n        double v[] = {v0, v1};\n        for (int i = 0; i < nlanes; ++i)\n        {\n            val[i] = v[i];\n        }\n    }\n    operator vfloat64m1_t() const\n    {\n        vsetvlmax_e64m1();\n        return vle64_v_f64m1(val);\n    }\n    double get0() const\n    {\n        return val[0];\n    }\n\n    double val[2];\n};\n#endif\n\n\n//////////// Initial ////////////\n\n#define OPENCV_HAL_IMPL_RVV_INIT_INTEGER(_Tpvec, _Tp, width, suffix1, suffix2) \\\ninline v_##_Tpvec v_setzero_##suffix1() \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return v_##_Tpvec(vzero_##suffix2##m1()); \\\n} \\\ninline v_##_Tpvec v_setall_##suffix1(_Tp v) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return v_##_Tpvec(vmv_v_x_##suffix2##m1(v)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_INIT_INTEGER(uint8x16, uchar, 8, u8, u8)\nOPENCV_HAL_IMPL_RVV_INIT_INTEGER(int8x16, schar, 8, s8, i8)\nOPENCV_HAL_IMPL_RVV_INIT_INTEGER(uint16x8, ushort, 16, u16, u16)\nOPENCV_HAL_IMPL_RVV_INIT_INTEGER(int16x8, short, 16, s16, i16)\nOPENCV_HAL_IMPL_RVV_INIT_INTEGER(uint32x4, unsigned, 32, u32, u32)\nOPENCV_HAL_IMPL_RVV_INIT_INTEGER(int32x4, int, 32, s32, i32)\nOPENCV_HAL_IMPL_RVV_INIT_INTEGER(uint64x2, uint64, 64, u64, u64)\nOPENCV_HAL_IMPL_RVV_INIT_INTEGER(int64x2, int64, 64, s64, i64)\n\n#define OPENCV_HAL_IMPL_RVV_INIT_FP(_Tpv, _Tp, width, suffix) \\\ninline v_##_Tpv v_setzero_##suffix() \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return v_##_Tpv(vzero_##suffix##m1()); \\\n} \\\ninline v_##_Tpv v_setall_##suffix(_Tp v) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return v_##_Tpv(vfmv_v_f_##suffix##m1(v)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_INIT_FP(float32x4, float, 32, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_INIT_FP(float64x2, double, 64, f64)\n#endif\n\n//////////// Reinterpret ////////////\n\n#define OPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(_Tpvec, suffix) \\\ninline v_##_Tpvec v_reinterpret_as_##suffix(const v_##_Tpvec& v) { return v; }\n\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(uint8x16, u8)\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(int8x16, s8)\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(uint16x8, u16)\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(int16x8, s16)\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(uint32x4, u32)\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(int32x4, s32)\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(float32x4, f32)\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(uint64x2, u64)\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(int64x2, s64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_SELF_REINTERPRET(float64x2, f64)\n#endif\n\n#define OPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(_Tpvec1, _Tpvec2, _nTpvec1, _nTpvec2, suffix1, suffix2, nsuffix1, nsuffix2, width1, width2) \\\ninline v_##_Tpvec1 v_reinterpret_as_##suffix1(const v_##_Tpvec2& v) \\\n{ \\\n    vsetvlmax_e##width2##m1(); \\\n    return v_##_Tpvec1((_nTpvec1)vle##width2##_v_##nsuffix2##m1(v.val)); \\\n} \\\ninline v_##_Tpvec2 v_reinterpret_as_##suffix2(const v_##_Tpvec1& v) \\\n{ \\\n    vsetvlmax_e##width1##m1(); \\\n    return v_##_Tpvec2((_nTpvec2)vle##width1##_v_##nsuffix1##m1(v.val)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint8x16, int8x16, vuint8m1_t, vint8m1_t, u8, s8, u8, i8, 8, 8)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint16x8, int16x8, vuint16m1_t, vint16m1_t, u16, s16, u16, i16, 16, 16)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint32x4, int32x4, vuint32m1_t, vint32m1_t, u32, s32, u32, i32, 32, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint32x4, float32x4, vuint32m1_t, vfloat32m1_t, u32, f32, u32, f32, 32, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int32x4, float32x4, vint32m1_t, vfloat32m1_t, s32, f32, i32, f32, 32, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint64x2, int64x2, vuint64m1_t, vint64m1_t, u64, s64, u64, i64, 64, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint8x16, uint16x8, vuint8m1_t, vuint16m1_t, u8, u16, u8, u16, 8, 16)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint8x16, uint32x4, vuint8m1_t, vuint32m1_t, u8, u32, u8, u32, 8, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint8x16, uint64x2, vuint8m1_t, vuint64m1_t, u8, u64, u8, u64, 8, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint16x8, uint32x4, vuint16m1_t, vuint32m1_t, u16, u32, u16, u32, 16, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint16x8, uint64x2, vuint16m1_t, vuint64m1_t, u16, u64, u16, u64, 16, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint32x4, uint64x2, vuint32m1_t, vuint64m1_t, u32, u64, u32, u64, 32, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int8x16, int16x8, vint8m1_t, vint16m1_t, s8, s16, i8, i16, 8, 16)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int8x16, int32x4, vint8m1_t, vint32m1_t, s8, s32, i8, i32, 8, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int8x16, int64x2, vint8m1_t, vint64m1_t, s8, s64, i8, i64, 8, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int16x8, int32x4, vint16m1_t, vint32m1_t, s16, s32, i16, i32, 16, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int16x8, int64x2, vint16m1_t, vint64m1_t, s16, s64, i16, i64, 16, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int32x4, int64x2, vint32m1_t, vint64m1_t, s32, s64, i32, i64, 32, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint8x16, int16x8, vuint8m1_t, vint16m1_t, u8, s16, u8, i16, 8, 16)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint8x16, int32x4, vuint8m1_t, vint32m1_t, u8, s32, u8, i32, 8, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint8x16, int64x2, vuint8m1_t, vint64m1_t, u8, s64, u8, i64, 8, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint16x8, int8x16, vuint16m1_t, vint8m1_t, u16, s8, u16, i8, 16, 8)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint16x8, int32x4, vuint16m1_t, vint32m1_t, u16, s32, u16, i32, 16, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint16x8, int64x2, vuint16m1_t, vint64m1_t, u16, s64, u16, i64, 16, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint32x4, int8x16, vuint32m1_t, vint8m1_t, u32, s8, u32, i8, 32, 8)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint32x4, int16x8, vuint32m1_t, vint16m1_t, u32, s16, u32, i16, 32, 16)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint32x4, int64x2, vuint32m1_t, vint64m1_t, u32, s64, u32, i64, 32, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint64x2, int8x16, vuint64m1_t, vint8m1_t, u64, s8, u64, i8, 64, 8)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint64x2, int16x8, vuint64m1_t, vint16m1_t, u64, s16, u64, i16, 64, 16)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint64x2, int32x4, vuint64m1_t, vint32m1_t, u64, s32, u64, i32, 64, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint8x16, float32x4, vuint8m1_t, vfloat32m1_t, u8, f32, u8, f32, 8, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint16x8, float32x4, vuint16m1_t, vfloat32m1_t, u16, f32, u16, f32, 16, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint64x2, float32x4, vuint64m1_t, vfloat32m1_t, u64, f32, u64, f32, 64, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int8x16, float32x4, vint8m1_t, vfloat32m1_t, s8, f32, i8, f32, 8, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int16x8, float32x4, vint16m1_t, vfloat32m1_t, s16, f32, i16, f32, 16, 32)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int64x2, float32x4, vint64m1_t, vfloat32m1_t, s64, f32, i64, f32, 64, 32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint64x2, float64x2, vuint64m1_t, vfloat64m1_t, u64, f64, u64, f64, 64, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int64x2, float64x2, vint64m1_t, vfloat64m1_t, s64, f64, i64, f64, 64, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint8x16, float64x2, vuint8m1_t, vfloat64m1_t, u8, f64, u8, f64, 8, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint16x8, float64x2, vuint16m1_t, vfloat64m1_t, u16, f64, u16, f64, 16, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(uint32x4, float64x2, vuint32m1_t, vfloat64m1_t, u32, f64, u32, f64, 32, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int8x16, float64x2, vint8m1_t, vfloat64m1_t, s8, f64, i8, f64, 8, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int16x8, float64x2, vint16m1_t, vfloat64m1_t, s16, f64, i16, f64, 16, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(int32x4, float64x2, vint32m1_t, vfloat64m1_t, s32, f64, i32, f64, 32, 64)\nOPENCV_HAL_IMPL_RVV_ONE_TIME_REINTERPRET(float32x4, float64x2, vfloat32m1_t, vfloat64m1_t, f32, f64, f32, f64, 32, 64)\n#endif\n\n////////////// Extract //////////////\n\n#define OPENCV_HAL_IMPL_RVV_EXTRACT(_Tpvec, _Tp, suffix, width, vmv) \\\ntemplate <int s> \\\ninline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vslideup_vx_##suffix##m1(vslidedown_vx_##suffix##m1(vzero_##suffix##m1(), a, s), b, _Tpvec::nlanes - s)); \\\n} \\\ntemplate<int i> inline _Tp v_extract_n(_Tpvec v) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tp(vmv(vslidedown_vx_##suffix##m1(vzero_##suffix##m1(), v, i))); \\\n}\n\n\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_uint8x16, uchar, u8, 8, vmv_x_s_u8m1_u8)\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_int8x16, schar, i8, 8, vmv_x_s_i8m1_i8)\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_uint16x8, ushort, u16, 16, vmv_x_s_u16m1_u16)\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_int16x8, short, i16, 16, vmv_x_s_i16m1_i16)\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_uint32x4, uint, u32, 32, vmv_x_s_u32m1_u32)\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_int32x4, int, i32, 32, vmv_x_s_i32m1_i32)\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_uint64x2, uint64, u64, 64, vmv_x_s_u64m1_u64)\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_int64x2, int64, i64, 64, vmv_x_s_i64m1_i64)\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_float32x4, float, f32, 32, vfmv_f_s_f32m1_f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_EXTRACT(v_float64x2, double, f64, 64, vfmv_f_s_f64m1_f64)\n#endif\n\n////////////// Load/Store //////////////\n\n#define OPENCV_HAL_IMPL_RVV_LOADSTORE_OP(_Tpvec, _nTpvec, _Tp, hvl, width, suffix) \\\ninline _Tpvec v_load(const _Tp* ptr) \\\n{ \\\n    vsetvlmax_e8m1(); \\\n    return _Tpvec((_nTpvec)vle8_v_u8m1((uchar*)ptr)); \\\n} \\\ninline _Tpvec v_load_aligned(const _Tp* ptr) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vle##width##_v_##suffix##m1(ptr)); \\\n} \\\ninline _Tpvec v_load_low(const _Tp* ptr) \\\n{ \\\n    vsetvl_e##width##m1(hvl); \\\n    _Tpvec res = _Tpvec(vle##width##_v_##suffix##m1(ptr)); \\\n    vsetvlmax_e##width##m1(); \\\n    return res; \\\n} \\\ninline void v_store(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e8m1(); \\\n    vse8_v_u8m1((uchar*)ptr, vle8_v_u8m1((uchar*)a.val)); \\\n} \\\ninline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    vse##width##_v_##suffix##m1(ptr, a); \\\n} \\\ninline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    vse##width##_v_##suffix##m1(ptr, a); \\\n} \\\ninline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode /*mode*/) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    vse##width##_v_##suffix##m1(ptr, a); \\\n} \\\ninline void v_store_low(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) tmp_ptr[_Tpvec::nlanes] = {0}; \\\n    vsetvlmax_e##width##m1(); \\\n    vse##width##_v_##suffix##m1(tmp_ptr, a); \\\n    for(int i = 0; i < _Tpvec::nlanes/2; ++i) \\\n    { \\\n        ptr[i] = tmp_ptr[i]; \\\n    } \\\n} \\\ninline void v_store_high(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) tmp_ptr[_Tpvec::nlanes] = {0}; \\\n    vsetvlmax_e##width##m1(); \\\n    vse##width##_v_##suffix##m1(tmp_ptr, a); \\\n    for(int i = 0; i < _Tpvec::nlanes/2; ++i) \\\n    { \\\n        ptr[i] = tmp_ptr[i+_Tpvec::nlanes/2]; \\\n    } \\\n}\n\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_uint8x16, vuint8m1_t, uchar, 8, 8, u8)\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_int8x16, vint8m1_t, schar, 8, 8, i8)\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_uint16x8, vuint16m1_t, ushort, 4, 16, u16)\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_int16x8, vint16m1_t, short, 4, 16, i16)\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_uint32x4, vuint32m1_t, unsigned, 2, 32, u32)\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_int32x4, vint32m1_t, int, 2, 32, i32)\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_uint64x2, vuint64m1_t, uint64, 1, 64, u64)\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_int64x2, vint64m1_t, int64, 1, 64, i64)\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float32x4, vfloat32m1_t, float, 2, 32, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_LOADSTORE_OP(v_float64x2, vfloat64m1_t, double, 1, 64, f64)\n#endif\n\ninline v_int8x16 v_load_halves(const schar* ptr0, const schar* ptr1)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        ptr0[0], ptr0[1], ptr0[2], ptr0[3], ptr0[4], ptr0[5], ptr0[6], ptr0[7],\n        ptr1[0], ptr1[1], ptr1[2], ptr1[3], ptr1[4], ptr1[5], ptr1[6], ptr1[7]\n    };\n    vsetvlmax_e8m1();\n    return v_int8x16(vle8_v_i8m1(elems));\n}\ninline v_uint8x16 v_load_halves(const uchar* ptr0, const uchar* ptr1) { return v_reinterpret_as_u8(v_load_halves((schar*)ptr0, (schar*)ptr1)); }\n\ninline v_int16x8 v_load_halves(const short* ptr0, const short* ptr1)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        ptr0[0], ptr0[1], ptr0[2], ptr0[3], ptr1[0], ptr1[1], ptr1[2], ptr1[3]\n    };\n    vsetvlmax_e16m1();\n    return v_int16x8(vle16_v_i16m1(elems));\n}\ninline v_uint16x8 v_load_halves(const ushort* ptr0, const ushort* ptr1) { return v_reinterpret_as_u16(v_load_halves((short*)ptr0, (short*)ptr1)); }\n\ninline v_int32x4 v_load_halves(const int* ptr0, const int* ptr1)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        ptr0[0], ptr0[1], ptr1[0], ptr1[1]\n    };\n    vsetvlmax_e32m1();\n    return v_int32x4(vle32_v_i32m1(elems));\n}\ninline v_float32x4 v_load_halves(const float* ptr0, const float* ptr1)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        ptr0[0], ptr0[1], ptr1[0], ptr1[1]\n    };\n    vsetvlmax_e32m1();\n    return v_float32x4(vle32_v_f32m1(elems));\n}\ninline v_uint32x4 v_load_halves(const unsigned* ptr0, const unsigned* ptr1) { return v_reinterpret_as_u32(v_load_halves((int*)ptr0, (int*)ptr1)); }\n\ninline v_int64x2 v_load_halves(const int64* ptr0, const int64* ptr1)\n{\n    int64 CV_DECL_ALIGNED(32) elems[2] =\n    {\n        ptr0[0], ptr1[0]\n    };\n    vsetvlmax_e64m1();\n    return v_int64x2(vle64_v_i64m1(elems));\n}\ninline v_uint64x2 v_load_halves(const uint64* ptr0, const uint64* ptr1) { return v_reinterpret_as_u64(v_load_halves((int64*)ptr0, (int64*)ptr1)); }\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_load_halves(const double* ptr0, const double* ptr1)\n{\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        ptr0[0], ptr1[0]\n    };\n    vsetvlmax_e64m1();\n    return v_float64x2(vle64_v_f64m1(elems));\n}\n#endif\n\n\n////////////// Lookup table access ////////////////////\n\ninline v_int8x16 v_lut(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[ 0]],\n        tab[idx[ 1]],\n        tab[idx[ 2]],\n        tab[idx[ 3]],\n        tab[idx[ 4]],\n        tab[idx[ 5]],\n        tab[idx[ 6]],\n        tab[idx[ 7]],\n        tab[idx[ 8]],\n        tab[idx[ 9]],\n        tab[idx[10]],\n        tab[idx[11]],\n        tab[idx[12]],\n        tab[idx[13]],\n        tab[idx[14]],\n        tab[idx[15]]\n    };\n    vsetvlmax_e8m1();\n    return v_int8x16(vle8_v_i8m1(elems));\n}\ninline v_int8x16 v_lut_pairs(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[3]],\n        tab[idx[3] + 1],\n        tab[idx[4]],\n        tab[idx[4] + 1],\n        tab[idx[5]],\n        tab[idx[5] + 1],\n        tab[idx[6]],\n        tab[idx[6] + 1],\n        tab[idx[7]],\n        tab[idx[7] + 1]\n    };\n    vsetvlmax_e8m1();\n    return v_int8x16(vle8_v_i8m1(elems));\n}\ninline v_int8x16 v_lut_quads(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[0] + 2],\n        tab[idx[0] + 3],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[1] + 2],\n        tab[idx[1] + 3],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[2] + 2],\n        tab[idx[2] + 3],\n        tab[idx[3]],\n        tab[idx[3] + 1],\n        tab[idx[3] + 2],\n        tab[idx[3] + 3]\n    };\n    vsetvlmax_e8m1();\n    return v_int8x16(vle8_v_i8m1(elems));\n}\ninline v_uint8x16 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((schar*)tab, idx)); }\ninline v_uint8x16 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((schar*)tab, idx)); }\ninline v_uint8x16 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((schar*)tab, idx)); }\n\ninline v_int16x8 v_lut(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]],\n        tab[idx[4]],\n        tab[idx[5]],\n        tab[idx[6]],\n        tab[idx[7]]\n    };\n    vsetvlmax_e16m1();\n    return v_int16x8(vle16_v_i16m1(elems));\n}\ninline v_int16x8 v_lut_pairs(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[3]],\n        tab[idx[3] + 1]\n    };\n    vsetvlmax_e16m1();\n    return v_int16x8(vle16_v_i16m1(elems));\n}\ninline v_int16x8 v_lut_quads(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[0] + 2],\n        tab[idx[0] + 3],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[1] + 2],\n        tab[idx[1] + 3]\n    };\n    vsetvlmax_e16m1();\n    return v_int16x8(vle16_v_i16m1(elems));\n}\ninline v_uint16x8 v_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut((short*)tab, idx)); }\ninline v_uint16x8 v_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_pairs((short*)tab, idx)); }\ninline v_uint16x8 v_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_quads((short*)tab, idx)); }\n\ninline v_int32x4 v_lut(const int* tab, const int* idx)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]]\n    };\n    vsetvlmax_e32m1();\n    return v_int32x4(vle32_v_i32m1(elems));\n}\ninline v_int32x4 v_lut_pairs(const int* tab, const int* idx)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1]\n    };\n    vsetvlmax_e32m1();\n    return v_int32x4(vle32_v_i32m1(elems));\n}\ninline v_int32x4 v_lut_quads(const int* tab, const int* idx)\n{\n    vsetvlmax_e32m1();\n    return v_int32x4(vle32_v_i32m1(tab + idx[0]));\n}\n\ninline v_uint32x4 v_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut((int*)tab, idx)); }\ninline v_uint32x4 v_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_pairs((int*)tab, idx)); }\ninline v_uint32x4 v_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_quads((int*)tab, idx)); }\n\ninline v_int64x2 v_lut(const int64_t* tab, const int* idx)\n{\n    int64_t CV_DECL_ALIGNED(32) elems[2] =\n    {\n        tab[idx[0]],\n        tab[idx[1]]\n    };\n    vsetvlmax_e64m1();\n    return v_int64x2(vle64_v_i64m1(elems));\n}\ninline v_int64x2 v_lut_pairs(const int64* tab, const int* idx)\n{\n    vsetvlmax_e64m1();\n    return v_int64x2(vle64_v_i64m1(tab + idx[0]));\n}\ninline v_uint64x2 v_lut(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v_lut((const int64_t *)tab, idx)); }\ninline v_uint64x2 v_lut_pairs(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v_lut_pairs((const int64_t *)tab, idx)); }\n\ninline v_float32x4 v_lut(const float* tab, const int* idx)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]]\n    };\n    vsetvlmax_e32m1();\n    return v_float32x4(vle32_v_f32m1(elems));\n}\ninline v_float32x4 v_lut_pairs(const float* tab, const int* idx)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1]\n    };\n    vsetvlmax_e32m1();\n    return v_float32x4(vle32_v_f32m1(elems));\n}\ninline v_float32x4 v_lut_quads(const float* tab, const int* idx)\n{\n    vsetvlmax_e32m1();\n    return v_float32x4(vle32_v_f32m1(tab + idx[0]));\n}\n\ninline v_int32x4 v_lut(const int* tab, const v_int32x4& idxvec)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[v_extract_n<0>(idxvec)],\n        tab[v_extract_n<1>(idxvec)],\n        tab[v_extract_n<2>(idxvec)],\n        tab[v_extract_n<3>(idxvec)]\n    };\n    vsetvlmax_e32m1();\n    return v_int32x4(vle32_v_i32m1(elems));\n}\n\ninline v_uint32x4 v_lut(const unsigned* tab, const v_int32x4& idxvec)\n{\n    unsigned CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[v_extract_n<0>(idxvec)],\n        tab[v_extract_n<1>(idxvec)],\n        tab[v_extract_n<2>(idxvec)],\n        tab[v_extract_n<3>(idxvec)]\n    };\n    vsetvlmax_e32m1();\n    return v_uint32x4(vle32_v_u32m1(elems));\n}\n\ninline v_float32x4 v_lut(const float* tab, const v_int32x4& idxvec)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[v_extract_n<0>(idxvec)],\n        tab[v_extract_n<1>(idxvec)],\n        tab[v_extract_n<2>(idxvec)],\n        tab[v_extract_n<3>(idxvec)]\n    };\n    vsetvlmax_e32m1();\n    return v_float32x4(vle32_v_f32m1(elems));\n}\n\ninline void v_lut_deinterleave(const float* tab, const v_int32x4& idxvec, v_float32x4& x, v_float32x4& y)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n\n    x = v_float32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n    y = v_float32x4(tab[idx[0]+1], tab[idx[1]+1], tab[idx[2]+1], tab[idx[3]+1]);\n}\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_lut(const double* tab, const int* idx)\n{\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        tab[idx[0]],\n        tab[idx[1]]\n    };\n    vsetvlmax_e64m1();\n    return v_float64x2(vle64_v_f64m1(elems));\n}\n\ninline v_float64x2 v_lut_pairs(const double* tab, const int* idx)\n{\n    vsetvlmax_e64m1();\n    return v_float64x2(vle64_v_f64m1(tab + idx[0]));\n}\n\ninline v_float64x2 v_lut(const double* tab, const v_int32x4& idxvec)\n{\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        tab[v_extract_n<0>(idxvec)],\n        tab[v_extract_n<1>(idxvec)]\n    };\n    vsetvlmax_e64m1();\n    return v_float64x2(vle64_v_f64m1(elems));\n}\n\ninline void v_lut_deinterleave(const double* tab, const v_int32x4& idxvec, v_float64x2& x, v_float64x2& y)\n{\n    int CV_DECL_ALIGNED(32) idx[4] = {0};\n    v_store_aligned(idx, idxvec);\n\n    x = v_float64x2(tab[idx[0]], tab[idx[1]]);\n    y = v_float64x2(tab[idx[0]+1], tab[idx[1]+1]);\n}\n#endif\n\n////////////// Pack boolean ////////////////////\n\ninline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b)\n{\n    ushort CV_DECL_ALIGNED(32) ptr[16] = {0};\n    v_store(ptr, a);\n    v_store(ptr + 8, b);\n    vsetvlmax_e8m1();\n    return v_uint8x16(vnsrl_wx_u8m1(vle16_v_u16m2(ptr), 0));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b,\n                           const v_uint32x4& c, const v_uint32x4& d)\n{\n    unsigned CV_DECL_ALIGNED(32) ptr[16] = {0};\n    v_store(ptr, a);\n    v_store(ptr + 4, b);\n    v_store(ptr + 8, c);\n    v_store(ptr + 12, d);\n    vsetvlmax_e8m1();\n    return v_uint8x16(vnsrl_wx_u8m1(vnsrl_wx_u16m2(vle32_v_u32m4(ptr), 0), 0));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c,\n                           const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f,\n                           const v_uint64x2& g, const v_uint64x2& h)\n{\n    uint64 CV_DECL_ALIGNED(32) ptr[16] = {0};\n    v_store(ptr, a);\n    v_store(ptr + 2, b);\n    v_store(ptr + 4, c);\n    v_store(ptr + 6, d);\n    v_store(ptr + 8, e);\n    v_store(ptr + 10, f);\n    v_store(ptr + 12, g);\n    v_store(ptr + 14, h);\n    vsetvlmax_e8m1();\n    return v_uint8x16(vnsrl_wx_u8m1(vnsrl_wx_u16m2(vnsrl_wx_u32m4(vle64_v_u64m8(ptr), 0), 0), 0));\n}\n\n////////////// Arithmetics //////////////\n#define OPENCV_HAL_IMPL_RVV_BIN_OP(bin_op, _Tpvec, intrin, width) \\\ninline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(intrin(a, b)); \\\n} \\\ninline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    a = _Tpvec(intrin(a, b)); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_uint8x16, vsaddu_vv_u8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_uint8x16, vssubu_vv_u8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_uint8x16, vdivu_vv_u8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_int8x16, vsadd_vv_i8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_int8x16, vssub_vv_i8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_int8x16, vdiv_vv_i8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_uint16x8, vsaddu_vv_u16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_uint16x8, vssubu_vv_u16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_uint16x8, vdivu_vv_u16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_int16x8, vsadd_vv_i16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_int16x8, vssub_vv_i16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_int16x8, vdiv_vv_i16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_uint32x4, vadd_vv_u32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_uint32x4, vsub_vv_u32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(*, v_uint32x4, vmul_vv_u32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_uint32x4, vdivu_vv_u32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_int32x4, vadd_vv_i32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_int32x4, vsub_vv_i32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(*, v_int32x4, vmul_vv_i32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_int32x4, vdiv_vv_i32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_float32x4, vfadd_vv_f32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_float32x4, vfsub_vv_f32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(*, v_float32x4, vfmul_vv_f32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_float32x4, vfdiv_vv_f32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_uint64x2, vadd_vv_u64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_uint64x2, vsub_vv_u64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(*, v_uint64x2, vmul_vv_u64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_uint64x2, vdivu_vv_u64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_int64x2, vadd_vv_i64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_int64x2, vsub_vv_i64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(*, v_int64x2, vmul_vv_i64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_int64x2, vdiv_vv_i64m1, 64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_BIN_OP(+, v_float64x2, vfadd_vv_f64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(-, v_float64x2, vfsub_vv_f64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(*, v_float64x2, vfmul_vv_f64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_OP(/, v_float64x2, vfdiv_vv_f64m1, 64)\n#endif\n\n\n////////////// Bitwise logic //////////////\n\n#define OPENCV_HAL_IMPL_RVV_LOGIC_OP(_Tpvec, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_BIN_OP(&, _Tpvec, vand_vv_##suffix##m1, width) \\\nOPENCV_HAL_IMPL_RVV_BIN_OP(|, _Tpvec, vor_vv_##suffix##m1, width) \\\nOPENCV_HAL_IMPL_RVV_BIN_OP(^, _Tpvec, vxor_vv_##suffix##m1, width) \\\ninline _Tpvec operator ~ (const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vnot_v_##suffix##m1(a)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_LOGIC_OP(v_uint8x16, u8, 8)\nOPENCV_HAL_IMPL_RVV_LOGIC_OP(v_int8x16, i8, 8)\nOPENCV_HAL_IMPL_RVV_LOGIC_OP(v_uint16x8, u16, 16)\nOPENCV_HAL_IMPL_RVV_LOGIC_OP(v_int16x8, i16, 16)\nOPENCV_HAL_IMPL_RVV_LOGIC_OP(v_uint32x4, u32, 32)\nOPENCV_HAL_IMPL_RVV_LOGIC_OP(v_int32x4, i32, 32)\nOPENCV_HAL_IMPL_RVV_LOGIC_OP(v_uint64x2, u64, 64)\nOPENCV_HAL_IMPL_RVV_LOGIC_OP(v_int64x2, i64, 64)\n\n#define OPENCV_HAL_IMPL_RVV_FLT_BIT_OP(bin_op, intrin) \\\ninline v_float32x4 operator bin_op (const v_float32x4& a, const v_float32x4& b) \\\n{ \\\n    vsetvlmax_e32m1(); \\\n    return v_float32x4(vreinterpret_v_i32m1_f32m1(intrin(vreinterpret_v_f32m1_i32m1(a), vreinterpret_v_f32m1_i32m1(b)))); \\\n} \\\ninline v_float32x4& operator bin_op##= (v_float32x4& a, const v_float32x4& b) \\\n{ \\\n    vsetvlmax_e32m1(); \\\n    a = v_float32x4(vreinterpret_v_i32m1_f32m1(intrin(vreinterpret_v_f32m1_i32m1(a), vreinterpret_v_f32m1_i32m1(b)))); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_RVV_FLT_BIT_OP(&, vand_vv_i32m1)\nOPENCV_HAL_IMPL_RVV_FLT_BIT_OP(|, vor_vv_i32m1)\nOPENCV_HAL_IMPL_RVV_FLT_BIT_OP(^, vxor_vv_i32m1)\n\ninline v_float32x4 operator ~ (const v_float32x4& a)\n{\n    vsetvlmax_e32m1();\n    return v_float32x4(vreinterpret_v_i32m1_f32m1(vnot_v_i32m1(vreinterpret_v_f32m1_i32m1(a))));\n}\n\n#if CV_SIMD128_64F\n#define OPENCV_HAL_IMPL_RVV_FLT64_BIT_OP(bin_op, intrin) \\\ninline v_float64x2 operator bin_op (const v_float64x2& a, const v_float64x2& b) \\\n{ \\\n    vsetvlmax_e64m1(); \\\n    return v_float64x2(vreinterpret_v_i64m1_f64m1(intrin(vreinterpret_v_f64m1_i64m1(a), vreinterpret_v_f64m1_i64m1(b)))); \\\n} \\\ninline v_float64x2& operator bin_op##= (v_float64x2& a, const v_float64x2& b) \\\n{ \\\n    vsetvlmax_e64m1(); \\\n    a = v_float64x2(vreinterpret_v_i64m1_f64m1(intrin(vreinterpret_v_f64m1_i64m1(a), vreinterpret_v_f64m1_i64m1(b)))); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_RVV_FLT64_BIT_OP(&, vand_vv_i64m1)\nOPENCV_HAL_IMPL_RVV_FLT64_BIT_OP(|, vor_vv_i64m1)\nOPENCV_HAL_IMPL_RVV_FLT64_BIT_OP(^, vxor_vv_i64m1)\n\ninline v_float64x2 operator ~ (const v_float64x2& a)\n{\n    vsetvlmax_e64m1();\n    return v_float64x2(vreinterpret_v_i64m1_f64m1(vnot_v_i64m1(vreinterpret_v_f64m1_i64m1(a))));\n}\n#endif\n\n////////////// Bitwise shifts //////////////\n\n#define OPENCV_HAL_IMPL_RVV_UNSIGNED_SHIFT_OP(_Tpvec, suffix, width) \\\ninline _Tpvec operator << (const _Tpvec& a, int n) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vsll_vx_##suffix##m1(a, uint8_t(n))); \\\n} \\\ninline _Tpvec operator >> (const _Tpvec& a, int n) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vsrl_vx_##suffix##m1(a, uint8_t(n))); \\\n} \\\ntemplate<int n> inline _Tpvec v_shl(const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vsll_vx_##suffix##m1(a, uint8_t(n))); \\\n} \\\ntemplate<int n> inline _Tpvec v_shr(const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vsrl_vx_##suffix##m1(a, uint8_t(n))); \\\n}\n\n#define OPENCV_HAL_IMPL_RVV_SIGNED_SHIFT_OP(_Tpvec, suffix, width) \\\ninline _Tpvec operator << (const _Tpvec& a, int n) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vsll_vx_##suffix##m1(a, uint8_t(n))); \\\n} \\\ninline _Tpvec operator >> (const _Tpvec& a, int n) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vsra_vx_##suffix##m1(a, uint8_t(n))); \\\n} \\\ntemplate<int n> inline _Tpvec v_shl(const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vsll_vx_##suffix##m1(a, uint8_t(n))); \\\n} \\\ntemplate<int n> inline _Tpvec v_shr(const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vsra_vx_##suffix##m1(a, uint8_t(n))); \\\n}\n\nOPENCV_HAL_IMPL_RVV_UNSIGNED_SHIFT_OP(v_uint8x16, u8, 8)\nOPENCV_HAL_IMPL_RVV_UNSIGNED_SHIFT_OP(v_uint16x8, u16, 16)\nOPENCV_HAL_IMPL_RVV_UNSIGNED_SHIFT_OP(v_uint32x4, u32, 32)\nOPENCV_HAL_IMPL_RVV_UNSIGNED_SHIFT_OP(v_uint64x2, u64, 64)\nOPENCV_HAL_IMPL_RVV_SIGNED_SHIFT_OP(v_int8x16, i8, 8)\nOPENCV_HAL_IMPL_RVV_SIGNED_SHIFT_OP(v_int16x8, i16, 16)\nOPENCV_HAL_IMPL_RVV_SIGNED_SHIFT_OP(v_int32x4, i32, 32)\nOPENCV_HAL_IMPL_RVV_SIGNED_SHIFT_OP(v_int64x2, i64, 64)\n\n\n////////////// Comparison //////////////\n\n#define OPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, op, intrin, suffix, width) \\\ninline _Tpvec operator op (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vmerge_vxm_##suffix##m1(intrin(a, b), vzero_##suffix##m1(), 1)); \\\n}\n\n#define OPENCV_HAL_IMPL_RVV_FLOAT_CMP_OP(_Tpvec, op, intrin, suffix, width) \\\ninline _Tpvec operator op (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vfmerge_vfm_##suffix##m1(intrin(a, b), vzero_##suffix##m1(), 1)); \\\n}\n\n#define OPENCV_HAL_IMPL_RVV_UNSIGNED_CMP(_Tpvec, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, ==, vmseq_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, !=, vmsne_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, <, vmsltu_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, >, vmsgtu_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, <=, vmsleu_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, >=, vmsgeu_vv_##suffix##m1_b##width, suffix, width)\n\n#define OPENCV_HAL_IMPL_RVV_SIGNED_CMP(_Tpvec, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, ==, vmseq_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, !=, vmsne_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, <, vmslt_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, >, vmsgt_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, <=, vmsle_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_INT_CMP_OP(_Tpvec, >=, vmsge_vv_##suffix##m1_b##width, suffix, width)\n\n#define OPENCV_HAL_IMPL_RVV_FLOAT_CMP(_Tpvec, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_FLOAT_CMP_OP(_Tpvec, ==, vmfeq_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_FLOAT_CMP_OP(_Tpvec, !=, vmfne_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_FLOAT_CMP_OP(_Tpvec, <, vmflt_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_FLOAT_CMP_OP(_Tpvec, >, vmfgt_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_FLOAT_CMP_OP(_Tpvec, <=, vmfle_vv_##suffix##m1_b##width, suffix, width) \\\nOPENCV_HAL_IMPL_RVV_FLOAT_CMP_OP(_Tpvec, >=, vmfge_vv_##suffix##m1_b##width, suffix, width)\n\n\nOPENCV_HAL_IMPL_RVV_UNSIGNED_CMP(v_uint8x16, u8, 8)\nOPENCV_HAL_IMPL_RVV_UNSIGNED_CMP(v_uint16x8, u16, 16)\nOPENCV_HAL_IMPL_RVV_UNSIGNED_CMP(v_uint32x4, u32, 32)\nOPENCV_HAL_IMPL_RVV_UNSIGNED_CMP(v_uint64x2, u64, 64)\nOPENCV_HAL_IMPL_RVV_SIGNED_CMP(v_int8x16, i8, 8)\nOPENCV_HAL_IMPL_RVV_SIGNED_CMP(v_int16x8, i16, 16)\nOPENCV_HAL_IMPL_RVV_SIGNED_CMP(v_int32x4, i32, 32)\nOPENCV_HAL_IMPL_RVV_SIGNED_CMP(v_int64x2, i64, 64)\nOPENCV_HAL_IMPL_RVV_FLOAT_CMP(v_float32x4, f32, 32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_FLOAT_CMP(v_float64x2, f64, 64)\n#endif\n\ninline v_float32x4 v_not_nan(const v_float32x4& a)\n{ return a == a; }\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_not_nan(const v_float64x2& a)\n{ return a == a; }\n#endif\n\n////////////// Min/Max //////////////\n\n#define OPENCV_HAL_IMPL_RVV_BIN_FUNC(_Tpvec, func, intrin, width) \\\ninline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(intrin(a, b)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint8x16, v_min, vminu_vv_u8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint8x16, v_max, vmaxu_vv_u8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int8x16, v_min, vmin_vv_i8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int8x16, v_max, vmax_vv_i8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint16x8, v_min, vminu_vv_u16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint16x8, v_max, vmaxu_vv_u16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int16x8, v_min, vmin_vv_i16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int16x8, v_max, vmax_vv_i16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint32x4, v_min, vminu_vv_u32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint32x4, v_max, vmaxu_vv_u32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int32x4, v_min, vmin_vv_i32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int32x4, v_max, vmax_vv_i32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_float32x4, v_min, vfmin_vv_f32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_float32x4, v_max, vfmax_vv_f32m1, 32)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint64x2, v_min, vminu_vv_u64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint64x2, v_max, vmaxu_vv_u64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int64x2, v_min, vmin_vv_i64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int64x2, v_max, vmax_vv_i64m1, 64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_float64x2, v_min, vfmin_vv_f64m1, 64)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_float64x2, v_max, vfmax_vv_f64m1, 64)\n#endif\n\n////////////// Arithmetics wrap //////////////\n\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint8x16, v_add_wrap, vadd_vv_u8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int8x16, v_add_wrap, vadd_vv_i8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint16x8, v_add_wrap, vadd_vv_u16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int16x8, v_add_wrap, vadd_vv_i16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint8x16, v_sub_wrap, vsub_vv_u8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int8x16, v_sub_wrap, vsub_vv_i8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint16x8, v_sub_wrap, vsub_vv_u16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int16x8, v_sub_wrap, vsub_vv_i16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint8x16, v_mul_wrap, vmul_vv_u8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int8x16, v_mul_wrap, vmul_vv_i8m1, 8)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_uint16x8, v_mul_wrap, vmul_vv_u16m1, 16)\nOPENCV_HAL_IMPL_RVV_BIN_FUNC(v_int16x8, v_mul_wrap, vmul_vv_i16m1, 16)\n\n////////////// Reduce //////////////\n\n#define OPENCV_HAL_IMPL_RVV_REDUCE_SUM(_Tpvec, _wTpvec, _nwTpvec, scalartype, suffix, wsuffix, wwidth, red) \\\ninline scalartype v_reduce_sum(const _Tpvec& a)  \\\n{ \\\n    vsetvlmax_e##wwidth##m1(); \\\n    _nwTpvec zero = vzero_##wsuffix##m1(); \\\n    _nwTpvec res = vzero_##wsuffix##m1(); \\\n    res = v##red##_vs_##suffix##m1_##wsuffix##m1(res, a, zero); \\\n    return (scalartype)(_wTpvec(res).get0()); \\\n}\n\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_uint8x16, v_uint16x8, vuint16m1_t, unsigned, u8, u16, 16, wredsumu)\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_int8x16, v_int16x8, vint16m1_t, int, i8, i16, 16, wredsum)\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_uint16x8, v_uint32x4, vuint32m1_t, unsigned, u16, u32, 32, wredsumu)\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_int16x8, v_int32x4, vint32m1_t, int, i16, i32, 32, wredsum)\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_uint32x4, v_uint64x2, vuint64m1_t, unsigned, u32, u64, 64, wredsumu)\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_int32x4, v_int64x2, vint64m1_t, int, i32, i64, 64, wredsum)\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_float32x4, v_float32x4, vfloat32m1_t, float, f32, f32, 32, fredsum)\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_uint64x2, v_uint64x2, vuint64m1_t, uint64, u64, u64, 64, redsum)\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_int64x2, v_int64x2, vint64m1_t, int64, i64, i64, 64, redsum)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_REDUCE_SUM(v_float64x2, v_float64x2, vfloat64m1_t, double, f64, f64, 64, fredsum)\n#endif\n\n\n#define OPENCV_HAL_IMPL_RVV_REDUCE(_Tpvec, func, scalartype, suffix, width, red) \\\ninline scalartype v_reduce_##func(const _Tpvec& a)  \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    _Tpvec res = _Tpvec(v##red##_vs_##suffix##m1_##suffix##m1(a, a, a)); \\\n    return scalartype(res.get0()); \\\n}\n\nOPENCV_HAL_IMPL_RVV_REDUCE(v_uint8x16, min, uchar, u8, 8, redminu)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_int8x16, min, schar, i8, 8, redmin)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_uint16x8, min, ushort, u16, 16, redminu)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_int16x8, min, short, i16, 16, redmin)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_uint32x4, min, unsigned, u32, 32, redminu)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_int32x4, min, int, i32, 32, redmin)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_float32x4, min, float, f32, 32, fredmin)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_uint8x16, max, uchar, u8, 8, redmaxu)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_int8x16, max, schar, i8, 8, redmax)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_uint16x8, max, ushort, u16, 16, redmaxu)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_int16x8, max, short, i16, 16, redmax)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_uint32x4, max, unsigned, u32, 32, redmaxu)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_int32x4, max, int, i32, 32, redmax)\nOPENCV_HAL_IMPL_RVV_REDUCE(v_float32x4, max, float, f32, 32, fredmax)\n\n\ninline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b,\n                                 const v_float32x4& c, const v_float32x4& d)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        v_reduce_sum(a),\n        v_reduce_sum(b),\n        v_reduce_sum(c),\n        v_reduce_sum(d)\n    };\n    vsetvlmax_e32m1();\n    return v_float32x4(vle32_v_f32m1(elems));\n}\n\n////////////// Square-Root //////////////\n\ninline v_float32x4 v_sqrt(const v_float32x4& x)\n{\n    vsetvlmax_e32m1();\n    return v_float32x4(vfsqrt_v_f32m1(x));\n}\n\ninline v_float32x4 v_invsqrt(const v_float32x4& x)\n{\n    v_float32x4 one = v_setall_f32(1.0f);\n    return one / v_sqrt(x);\n}\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_sqrt(const v_float64x2& x)\n{\n    vsetvlmax_e64m1();\n    return v_float64x2(vfsqrt_v_f64m1(x));\n}\n\ninline v_float64x2 v_invsqrt(const v_float64x2& x)\n{\n    v_float64x2 one = v_setall_f64(1.0f);\n    return one / v_sqrt(x);\n}\n#endif\n\ninline v_float32x4 v_magnitude(const v_float32x4& a, const v_float32x4& b)\n{\n    vsetvlmax_e32m1();\n    v_float32x4 x(vfmacc_vv_f32m1(vfmul_vv_f32m1(a, a), b, b));\n    return v_sqrt(x);\n}\n\ninline v_float32x4 v_sqr_magnitude(const v_float32x4& a, const v_float32x4& b)\n{\n    vsetvlmax_e32m1();\n    return v_float32x4(vfmacc_vv_f32m1(vfmul_vv_f32m1(a, a), b, b));\n}\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_magnitude(const v_float64x2& a, const v_float64x2& b)\n{\n    vsetvlmax_e64m1();\n    v_float64x2 x(vfmacc_vv_f64m1(vfmul_vv_f64m1(a, a), b, b));\n    return v_sqrt(x);\n}\n\ninline v_float64x2 v_sqr_magnitude(const v_float64x2& a, const v_float64x2& b)\n{\n    vsetvlmax_e64m1();\n    return v_float64x2(vfmacc_vv_f64m1(vfmul_vv_f64m1(a, a), b, b));\n}\n#endif\n\n////////////// Multiply-Add //////////////\n\ninline v_float32x4 v_fma(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n    vsetvlmax_e32m1();\n    return v_float32x4(vfmacc_vv_f32m1(c, a, b));\n}\ninline v_int32x4 v_fma(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    vsetvlmax_e32m1();\n    return v_int32x4(vmacc_vv_i32m1(c, a, b));\n}\n\ninline v_float32x4 v_muladd(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\ninline v_int32x4 v_muladd(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n    vsetvlmax_e64m1();\n    return v_float64x2(vfmacc_vv_f64m1(c, a, b));\n}\n\ninline v_float64x2 v_muladd(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n    return v_fma(a, b, c);\n}\n#endif\n\n////////////// Check all/any //////////////\n\n#define OPENCV_HAL_IMPL_RVV_CHECK_ALLANY(_Tpvec, suffix, shift, width) \\\ninline bool v_check_all(const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    v_uint64x2 v = v_uint64x2((vuint64m1_t)vsrl_vx_##suffix##m1(vnot_v_##suffix##m1(a), shift)); \\\n    return (v.val[0] | v.val[1]) == 0; \\\n} \\\ninline bool v_check_any(const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    v_uint64x2 v = v_uint64x2((vuint64m1_t)vsrl_vx_##suffix##m1(a, shift)); \\\n    return (v.val[0] | v.val[1]) != 0; \\\n}\n\nOPENCV_HAL_IMPL_RVV_CHECK_ALLANY(v_uint8x16, u8, 7, 8)\nOPENCV_HAL_IMPL_RVV_CHECK_ALLANY(v_uint16x8, u16, 15, 16)\nOPENCV_HAL_IMPL_RVV_CHECK_ALLANY(v_uint32x4, u32, 31, 32)\nOPENCV_HAL_IMPL_RVV_CHECK_ALLANY(v_uint64x2, u64, 63, 64)\n\n\ninline bool v_check_all(const v_int8x16& a)\n{ return v_check_all(v_reinterpret_as_u8(a)); }\ninline bool v_check_any(const v_int8x16& a)\n{ return v_check_any(v_reinterpret_as_u8(a)); }\n\ninline bool v_check_all(const v_int16x8& a)\n{ return v_check_all(v_reinterpret_as_u16(a)); }\ninline bool v_check_any(const v_int16x8& a)\n{ return v_check_any(v_reinterpret_as_u16(a)); }\n\ninline bool v_check_all(const v_int32x4& a)\n{ return v_check_all(v_reinterpret_as_u32(a)); }\ninline bool v_check_any(const v_int32x4& a)\n{ return v_check_any(v_reinterpret_as_u32(a)); }\n\ninline bool v_check_all(const v_float32x4& a)\n{ return v_check_all(v_reinterpret_as_u32(a)); }\ninline bool v_check_any(const v_float32x4& a)\n{ return v_check_any(v_reinterpret_as_u32(a)); }\n\ninline bool v_check_all(const v_int64x2& a)\n{ return v_check_all(v_reinterpret_as_u64(a)); }\ninline bool v_check_any(const v_int64x2& a)\n{ return v_check_any(v_reinterpret_as_u64(a)); }\n\n#if CV_SIMD128_64F\ninline bool v_check_all(const v_float64x2& a)\n{ return v_check_all(v_reinterpret_as_u64(a)); }\ninline bool v_check_any(const v_float64x2& a)\n{ return v_check_any(v_reinterpret_as_u64(a)); }\n#endif\n\n////////////// abs //////////////\n\n#define OPENCV_HAL_IMPL_RVV_ABSDIFF(_Tpvec, abs) \\\ninline _Tpvec v_##abs(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return v_max(a, b) - v_min(a, b); \\\n}\n\nOPENCV_HAL_IMPL_RVV_ABSDIFF(v_uint8x16, absdiff)\nOPENCV_HAL_IMPL_RVV_ABSDIFF(v_uint16x8, absdiff)\nOPENCV_HAL_IMPL_RVV_ABSDIFF(v_uint32x4, absdiff)\nOPENCV_HAL_IMPL_RVV_ABSDIFF(v_float32x4, absdiff)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_ABSDIFF(v_float64x2, absdiff)\n#endif\nOPENCV_HAL_IMPL_RVV_ABSDIFF(v_int8x16, absdiffs)\nOPENCV_HAL_IMPL_RVV_ABSDIFF(v_int16x8, absdiffs)\n\n#define OPENCV_HAL_IMPL_RVV_ABSDIFF_S(_Tpvec, _rTpvec, _nwTpvec, sub, rshr, width) \\\ninline _rTpvec v_absdiff(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _rTpvec(rshr((_nwTpvec)sub(v_max(a, b), v_min(a, b)), 0)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_ABSDIFF_S(v_int8x16, v_uint8x16, vuint16m2_t, vwsub_vv_i16m2, vnclipu_wx_u8m1, 8)\nOPENCV_HAL_IMPL_RVV_ABSDIFF_S(v_int16x8, v_uint16x8, vuint32m2_t, vwsub_vv_i32m2, vnclipu_wx_u16m1, 16)\nOPENCV_HAL_IMPL_RVV_ABSDIFF_S(v_int32x4, v_uint32x4, vuint64m2_t, vwsub_vv_i64m2, vnclipu_wx_u32m1, 32)\n\n#define OPENCV_HAL_IMPL_RVV_ABS(_Tprvec, _Tpvec, suffix) \\\ninline _Tprvec v_abs(const _Tpvec& a) \\\n{ \\\n    return v_absdiff(a, v_setzero_##suffix()); \\\n}\n\nOPENCV_HAL_IMPL_RVV_ABS(v_uint8x16, v_int8x16, s8)\nOPENCV_HAL_IMPL_RVV_ABS(v_uint16x8, v_int16x8, s16)\nOPENCV_HAL_IMPL_RVV_ABS(v_uint32x4, v_int32x4, s32)\nOPENCV_HAL_IMPL_RVV_ABS(v_float32x4, v_float32x4, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_ABS(v_float64x2, v_float64x2, f64)\n#endif\n\n\n#define OPENCV_HAL_IMPL_RVV_REDUCE_SAD(_Tpvec, scalartype) \\\ninline scalartype v_reduce_sad(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return v_reduce_sum(v_absdiff(a, b)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_REDUCE_SAD(v_uint8x16, unsigned)\nOPENCV_HAL_IMPL_RVV_REDUCE_SAD(v_int8x16, unsigned)\nOPENCV_HAL_IMPL_RVV_REDUCE_SAD(v_uint16x8, unsigned)\nOPENCV_HAL_IMPL_RVV_REDUCE_SAD(v_int16x8, unsigned)\nOPENCV_HAL_IMPL_RVV_REDUCE_SAD(v_uint32x4, unsigned)\nOPENCV_HAL_IMPL_RVV_REDUCE_SAD(v_int32x4, unsigned)\nOPENCV_HAL_IMPL_RVV_REDUCE_SAD(v_float32x4, float)\n\n////////////// Select //////////////\n\n#define OPENCV_HAL_IMPL_RVV_SELECT(_Tpvec, merge, ne, width) \\\ninline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(merge(ne(mask, 0), b, a)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_SELECT(v_uint8x16, vmerge_vvm_u8m1, vmsne_vx_u8m1_b8, 8)\nOPENCV_HAL_IMPL_RVV_SELECT(v_int8x16, vmerge_vvm_i8m1, vmsne_vx_i8m1_b8, 8)\nOPENCV_HAL_IMPL_RVV_SELECT(v_uint16x8, vmerge_vvm_u16m1, vmsne_vx_u16m1_b16, 16)\nOPENCV_HAL_IMPL_RVV_SELECT(v_int16x8, vmerge_vvm_i16m1, vmsne_vx_i16m1_b16, 16)\nOPENCV_HAL_IMPL_RVV_SELECT(v_uint32x4, vmerge_vvm_u32m1, vmsne_vx_u32m1_b32, 32)\nOPENCV_HAL_IMPL_RVV_SELECT(v_int32x4, vmerge_vvm_i32m1, vmsne_vx_i32m1_b32, 32)\nOPENCV_HAL_IMPL_RVV_SELECT(v_float32x4, vmerge_vvm_f32m1, vmfne_vf_f32m1_b32, 32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_SELECT(v_float64x2, vmerge_vvm_f64m1, vmfne_vf_f64m1_b64, 64)\n#endif\n\n////////////// Rotate shift //////////////\n\n#define OPENCV_HAL_IMPL_RVV_ROTATE_OP(_Tpvec, suffix, width) \\\ntemplate<int n> inline _Tpvec v_rotate_right(const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vslidedown_vx_##suffix##m1(vzero_##suffix##m1(), a, n)); \\\n} \\\ntemplate<int n> inline _Tpvec v_rotate_left(const _Tpvec& a) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vslideup_vx_##suffix##m1(vzero_##suffix##m1(), a, n)); \\\n} \\\ntemplate<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a) \\\n{ return a; } \\\ntemplate<int n> inline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vslideup_vx_##suffix##m1(vslidedown_vx_##suffix##m1(vzero_##suffix##m1(), a, n), b, _Tpvec::nlanes - n)); \\\n} \\\ntemplate<int n> inline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vsetvlmax_e##width##m1(); \\\n    return _Tpvec(vslideup_vx_##suffix##m1(vslidedown_vx_##suffix##m1(vzero_##suffix##m1(), b, _Tpvec::nlanes - n), a, n)); \\\n} \\\ntemplate<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a, const _Tpvec& b) \\\n{ CV_UNUSED(b); return a; }\n\n\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_uint8x16, u8, 8)\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_int8x16, i8, 8)\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_uint16x8, u16, 16)\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_int16x8, i16, 16)\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_uint32x4, u32, 32)\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_int32x4, i32, 32)\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_float32x4, f32, 32)\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_uint64x2, u64, 64)\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_int64x2, i64, 64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_ROTATE_OP(v_float64x2, f64, 64)\n#endif\n\n////////////// Convert to float //////////////\n\ninline v_float32x4 v_cvt_f32(const v_int32x4& a)\n{\n    vsetvlmax_e32m1();\n    return v_float32x4(vfcvt_f_x_v_f32m1(a));\n}\n\n#if CV_SIMD128_64F\ninline v_float32x4 v_cvt_f32(const v_float64x2& a)\n{\n    double arr[4] = {a.val[0], a.val[1], 0, 0};\n    vsetvlmax_e64m2();\n    vfloat64m2_t tmp = vle64_v_f64m2(arr);\n    vsetvlmax_e32m1();\n    return v_float32x4(vfncvt_f_f_w_f32m1(tmp));\n}\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b)\n{\n    double arr[4] = {a.val[0], a.val[1], b.val[0], b.val[1]};\n    vsetvlmax_e64m2();\n    vfloat64m2_t tmp = vle64_v_f64m2(arr);\n    vsetvlmax_e32m1();\n    return v_float32x4(vfncvt_f_f_w_f32m1(tmp));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int32x4& a)\n{\n    double CV_DECL_ALIGNED(32) ptr[4] = {0};\n    vsetvlmax_e64m2();\n    vse64_v_f64m2(ptr, vfwcvt_f_x_v_f64m2(a));\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        ptr[0], ptr[1]\n    };\n    vsetvlmax_e64m1();\n    return v_float64x2(vle64_v_f64m1(elems));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_int32x4& a)\n{\n    double CV_DECL_ALIGNED(32) ptr[4] = {0};\n    vsetvlmax_e64m2();\n    vse64_v_f64m2(ptr, vfwcvt_f_x_v_f64m2(a));\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        ptr[2], ptr[3]\n    };\n    vsetvlmax_e64m1();\n    return v_float64x2(vle64_v_f64m1(elems));\n}\n\ninline v_float64x2 v_cvt_f64(const v_float32x4& a)\n{\n    double CV_DECL_ALIGNED(32) ptr[4] = {0};\n    vsetvlmax_e64m2();\n    vse64_v_f64m2(ptr, vfwcvt_f_f_v_f64m2(a));\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        ptr[0], ptr[1]\n    };\n    vsetvlmax_e64m1();\n    return v_float64x2(vle64_v_f64m1(elems));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_float32x4& a)\n{\n    double CV_DECL_ALIGNED(32) ptr[4] = {0};\n    vsetvlmax_e64m2();\n    vse64_v_f64m2(ptr, vfwcvt_f_f_v_f64m2(a));\n    double CV_DECL_ALIGNED(32) elems[2] =\n    {\n        ptr[2], ptr[3]\n    };\n    vsetvlmax_e64m1();\n    return v_float64x2(vle64_v_f64m1(elems));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int64x2& a)\n{\n    vsetvlmax_e64m1();\n    return v_float64x2(vfcvt_f_x_v_f64m1(a));\n}\n#endif\n\n////////////// Broadcast //////////////\n\n#define OPENCV_HAL_IMPL_RVV_BROADCAST(_Tpvec, suffix) \\\ntemplate<int i> inline _Tpvec v_broadcast_element(_Tpvec v) \\\n{ \\\n    return v_setall_##suffix(v_extract_n<i>(v)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_uint8x16, u8)\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_int8x16, s8)\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_uint16x8, u16)\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_int16x8, s16)\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_uint32x4, u32)\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_int32x4, s32)\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_uint64x2, u64)\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_int64x2, s64)\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_float32x4, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_BROADCAST(v_float64x2, f64)\n#endif\n\n////////////// Transpose4x4 //////////////\n\n#define OPENCV_HAL_IMPL_RVV_TRANSPOSE4x4(_Tpvec, _Tp, suffix) \\\ninline void v_transpose4x4(const v_##_Tpvec& a0, const v_##_Tpvec& a1, \\\n                         const v_##_Tpvec& a2, const v_##_Tpvec& a3, \\\n                         v_##_Tpvec& b0, v_##_Tpvec& b1, \\\n                         v_##_Tpvec& b2, v_##_Tpvec& b3) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) elems0[4] = \\\n    { \\\n        v_extract_n<0>(a0), \\\n        v_extract_n<0>(a1), \\\n        v_extract_n<0>(a2), \\\n        v_extract_n<0>(a3) \\\n    }; \\\n    b0 = v_load(elems0); \\\n    _Tp CV_DECL_ALIGNED(32) elems1[4] = \\\n    { \\\n        v_extract_n<1>(a0), \\\n        v_extract_n<1>(a1), \\\n        v_extract_n<1>(a2), \\\n        v_extract_n<1>(a3) \\\n    }; \\\n    b1 = v_load(elems1); \\\n    _Tp CV_DECL_ALIGNED(32) elems2[4] = \\\n    { \\\n        v_extract_n<2>(a0), \\\n        v_extract_n<2>(a1), \\\n        v_extract_n<2>(a2), \\\n        v_extract_n<2>(a3) \\\n    }; \\\n    b2 = v_load(elems2); \\\n    _Tp CV_DECL_ALIGNED(32) elems3[4] = \\\n    { \\\n        v_extract_n<3>(a0), \\\n        v_extract_n<3>(a1), \\\n        v_extract_n<3>(a2), \\\n        v_extract_n<3>(a3) \\\n    }; \\\n    b3 = v_load(elems3); \\\n}\n\nOPENCV_HAL_IMPL_RVV_TRANSPOSE4x4(uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_RVV_TRANSPOSE4x4(int32x4, int, i32)\nOPENCV_HAL_IMPL_RVV_TRANSPOSE4x4(float32x4, float, f32)\n\n////////////// Reverse //////////////\n\n#define OPENCV_HAL_IMPL_RVV_REVERSE(_Tpvec, _Tp, width, suffix) \\\ninline _Tpvec v_reverse(const _Tpvec& a)  \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptr[_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptra[_Tpvec::nlanes] = {0}; \\\n    v_store(ptra, a); \\\n    for (int i = 0; i < _Tpvec::nlanes; i++) \\\n    { \\\n        ptr[i] = ptra[_Tpvec::nlanes-i-1]; \\\n    } \\\n    return v_load(ptr); \\\n}\n\nOPENCV_HAL_IMPL_RVV_REVERSE(v_uint8x16, uchar, 8, u8)\nOPENCV_HAL_IMPL_RVV_REVERSE(v_int8x16, schar, 8, i8)\nOPENCV_HAL_IMPL_RVV_REVERSE(v_uint16x8, ushort, 16, u16)\nOPENCV_HAL_IMPL_RVV_REVERSE(v_int16x8, short, 16, i16)\nOPENCV_HAL_IMPL_RVV_REVERSE(v_uint32x4, unsigned, 32, u32)\nOPENCV_HAL_IMPL_RVV_REVERSE(v_int32x4, int, 32, i32)\nOPENCV_HAL_IMPL_RVV_REVERSE(v_float32x4, float, 32, f32)\nOPENCV_HAL_IMPL_RVV_REVERSE(v_uint64x2, uint64, 64, u64)\nOPENCV_HAL_IMPL_RVV_REVERSE(v_int64x2, int64, 64, i64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_REVERSE(v_float64x2, double, 64, f64)\n#endif\n\n//////////// Value reordering ////////////\n\n#define OPENCV_HAL_IMPL_RVV_EXPAND(_Tpwvec, _Tp, _Tpvec, width, suffix, wcvt) \\\ninline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) lptr[_Tpvec::nlanes/2] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) hptr[_Tpvec::nlanes/2] = {0}; \\\n    v_store_low(lptr, a); \\\n    v_store_high(hptr, a); \\\n    b0 = _Tpwvec(wcvt(vle##width##_v_##suffix##mf2(lptr))); \\\n    b1 = _Tpwvec(wcvt(vle##width##_v_##suffix##mf2(hptr))); \\\n} \\\ninline _Tpwvec v_expand_low(const _Tpvec& a) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) lptr[_Tpvec::nlanes/2] = {0}; \\\n    v_store_low(lptr, a); \\\n    return _Tpwvec(wcvt(vle##width##_v_##suffix##mf2(lptr))); \\\n} \\\ninline _Tpwvec v_expand_high(const _Tpvec& a) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) hptr[_Tpvec::nlanes/2] = {0}; \\\n    v_store_high(hptr, a); \\\n    return _Tpwvec(wcvt(vle##width##_v_##suffix##mf2(hptr))); \\\n} \\\ninline _Tpwvec v_load_expand(const _Tp* ptr) \\\n{ \\\n    return _Tpwvec(wcvt(vle##width##_v_##suffix##mf2(ptr))); \\\n}\n\nOPENCV_HAL_IMPL_RVV_EXPAND(v_uint16x8, uchar, v_uint8x16, 8, u8, vwcvtu_x_x_v_u16m1)\nOPENCV_HAL_IMPL_RVV_EXPAND(v_int16x8, schar, v_int8x16, 8, i8, vwcvt_x_x_v_i16m1)\nOPENCV_HAL_IMPL_RVV_EXPAND(v_uint32x4, ushort, v_uint16x8, 16, u16, vwcvtu_x_x_v_u32m1)\nOPENCV_HAL_IMPL_RVV_EXPAND(v_int32x4, short, v_int16x8, 16, i16, vwcvt_x_x_v_i32m1)\nOPENCV_HAL_IMPL_RVV_EXPAND(v_uint64x2, uint, v_uint32x4, 32, u32, vwcvtu_x_x_v_u64m1)\nOPENCV_HAL_IMPL_RVV_EXPAND(v_int64x2, int, v_int32x4, 32, i32, vwcvt_x_x_v_i64m1)\n\ninline v_uint32x4 v_load_expand_q(const uchar* ptr)\n{\n    vsetvlmax_e32m1();\n    return v_uint32x4(vwcvtu_x_x_v_u32m1(vwcvtu_x_x_v_u16mf2(vle8_v_u8mf4(ptr))));\n}\n\ninline v_int32x4 v_load_expand_q(const schar* ptr)\n{\n    vsetvlmax_e32m1();\n    return v_int32x4(vwcvt_x_x_v_i32m1(vwcvt_x_x_v_i16mf2(vle8_v_i8mf4(ptr))));\n}\n\n\n#define OPENCV_HAL_IMPL_RVV_PACK(_Tpvec, _Tp, _wTpvec, _wTp, width, suffix, rshr, shr) \\\ninline _Tpvec v_pack(const _wTpvec& a, const _wTpvec& b) \\\n{ \\\n    _wTp CV_DECL_ALIGNED(32) arr[_Tpvec::nlanes] = {0}; \\\n    v_store(arr, a); \\\n    v_store(arr + _wTpvec::nlanes, b); \\\n    vsetvlmax_e##width##m2(); \\\n    return _Tpvec(shr(vle##width##_v_##suffix##m2(arr), 0)); \\\n} \\\ninline void v_pack_store(_Tp* ptr, const _wTpvec& a) \\\n{ \\\n    _wTp CV_DECL_ALIGNED(32) arr[_Tpvec::nlanes] = {0}; \\\n    v_store(arr, a); \\\n    v_store(arr + _wTpvec::nlanes, _wTpvec(vzero_##suffix##m1())); \\\n    vsetvlmax_e##width##m2(); \\\n    v_store(ptr, _Tpvec(shr(vle##width##_v_##suffix##m2(arr), 0))); \\\n} \\\ntemplate<int n> inline \\\n_Tpvec v_rshr_pack(const _wTpvec& a, const _wTpvec& b) \\\n{ \\\n    _wTp CV_DECL_ALIGNED(32) arr[_Tpvec::nlanes] = {0}; \\\n    v_store(arr, a); \\\n    v_store(arr + _wTpvec::nlanes, b); \\\n    vsetvlmax_e##width##m2(); \\\n    return _Tpvec(rshr(vle##width##_v_##suffix##m2(arr), n)); \\\n} \\\ntemplate<int n> inline \\\nvoid v_rshr_pack_store(_Tp* ptr, const _wTpvec& a) \\\n{ \\\n    _wTp CV_DECL_ALIGNED(32) arr[_Tpvec::nlanes] = {0}; \\\n    v_store(arr, a); \\\n    v_store(arr + _wTpvec::nlanes, _wTpvec(vzero_##suffix##m1())); \\\n    vsetvlmax_e##width##m2(); \\\n    v_store(ptr, _Tpvec(rshr(vle##width##_v_##suffix##m2(arr), n))); \\\n}\n\nOPENCV_HAL_IMPL_RVV_PACK(v_uint8x16, uchar, v_uint16x8, ushort, 16, u16, vnclipu_wx_u8m1, vnclipu_wx_u8m1)\nOPENCV_HAL_IMPL_RVV_PACK(v_int8x16, schar, v_int16x8, short, 16, i16, vnclip_wx_i8m1, vnclip_wx_i8m1)\nOPENCV_HAL_IMPL_RVV_PACK(v_uint16x8, ushort, v_uint32x4, unsigned, 32, u32, vnclipu_wx_u16m1, vnclipu_wx_u16m1)\nOPENCV_HAL_IMPL_RVV_PACK(v_int16x8, short, v_int32x4, int, 32, i32, vnclip_wx_i16m1, vnclip_wx_i16m1)\nOPENCV_HAL_IMPL_RVV_PACK(v_uint32x4, unsigned, v_uint64x2, uint64, 64, u64, vnclipu_wx_u32m1, vnsrl_wx_u32m1)\nOPENCV_HAL_IMPL_RVV_PACK(v_int32x4, int, v_int64x2, int64, 64, i64, vnclip_wx_i32m1, vnsra_wx_i32m1)\n\n\n#define OPENCV_HAL_IMPL_RVV_PACK_U(_Tpvec, _Tp, _wTpvec, _wTp, width, suffix, rshr, cast) \\\ninline _Tpvec v_pack_u(const _wTpvec& a, const _wTpvec& b) \\\n{ \\\n    _wTp CV_DECL_ALIGNED(32) arr[_Tpvec::nlanes] = {0}; \\\n    v_store(arr, a); \\\n    v_store(arr + _wTpvec::nlanes, b); \\\n    vsetvlmax_e##width##m2(); \\\n    return _Tpvec(rshr(cast(vmax_vx_##suffix##m2(vle##width##_v_##suffix##m2(arr), 0)), 0)); \\\n} \\\ninline void v_pack_u_store(_Tp* ptr, const _wTpvec& a) \\\n{ \\\n    _wTp CV_DECL_ALIGNED(32) arr[_Tpvec::nlanes] = {0}; \\\n    v_store(arr, a); \\\n    v_store(arr + _wTpvec::nlanes, _wTpvec(vzero_##suffix##m1())); \\\n    vsetvlmax_e##width##m2(); \\\n    v_store(ptr, _Tpvec(rshr(cast(vmax_vx_##suffix##m2(vle##width##_v_##suffix##m2(arr), 0)), 0))); \\\n} \\\ntemplate<int n> inline \\\n_Tpvec v_rshr_pack_u(const _wTpvec& a, const _wTpvec& b) \\\n{ \\\n    _wTp CV_DECL_ALIGNED(32) arr[_Tpvec::nlanes] = {0}; \\\n    v_store(arr, a); \\\n    v_store(arr + _wTpvec::nlanes, b); \\\n    vsetvlmax_e##width##m2(); \\\n    return _Tpvec(rshr(cast(vmax_vx_##suffix##m2(vle##width##_v_##suffix##m2(arr), 0)), n)); \\\n} \\\ntemplate<int n> inline \\\nvoid v_rshr_pack_u_store(_Tp* ptr, const _wTpvec& a) \\\n{ \\\n    _wTp CV_DECL_ALIGNED(32) arr[_Tpvec::nlanes] = {0}; \\\n    v_store(arr, a); \\\n    v_store(arr + _wTpvec::nlanes, _wTpvec(vzero_##suffix##m1())); \\\n    vsetvlmax_e##width##m2(); \\\n    v_store(ptr, _Tpvec(rshr(cast(vmax_vx_##suffix##m2(vle##width##_v_##suffix##m2(arr), 0)), n))); \\\n}\n\nOPENCV_HAL_IMPL_RVV_PACK_U(v_uint8x16, uchar, v_int16x8, short, 16, i16, vnclipu_wx_u8m1, vreinterpret_v_i16m2_u16m2)\nOPENCV_HAL_IMPL_RVV_PACK_U(v_uint16x8, ushort, v_int32x4, int, 32, i32, vnclipu_wx_u16m1, vreinterpret_v_i32m2_u32m2)\n\n\n#define OPENCV_HAL_IMPL_RVV_UNPACKS(_Tpvec, _Tp, width, suffix) \\\ninline void v_zip(const v_##_Tpvec& a0, const v_##_Tpvec& a1, v_##_Tpvec& b0, v_##_Tpvec& b1) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptra0[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptra1[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb0[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb1[v_##_Tpvec::nlanes] = {0}; \\\n    v_store(ptra0, a0); \\\n    v_store(ptra1, a1); \\\n    int i; \\\n    for( i = 0; i < v_##_Tpvec::nlanes/2; i++ ) \\\n    { \\\n        ptrb0[i*2] = ptra0[i]; \\\n        ptrb0[i*2+1] = ptra1[i]; \\\n    } \\\n    for( ; i < v_##_Tpvec::nlanes; i++ ) \\\n    { \\\n        ptrb1[i*2-v_##_Tpvec::nlanes] = ptra0[i]; \\\n        ptrb1[i*2-v_##_Tpvec::nlanes+1] = ptra1[i]; \\\n    } \\\n    b0 = v_load(ptrb0); \\\n    b1 = v_load(ptrb1); \\\n} \\\ninline v_##_Tpvec v_combine_low(const v_##_Tpvec& a, const v_##_Tpvec& b) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptra[v_##_Tpvec::nlanes/2] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb[v_##_Tpvec::nlanes/2] = {0}; \\\n    v_store_low(ptra, a); \\\n    v_store_low(ptrb, b); \\\n    return v_load_halves(ptra, ptrb); \\\n} \\\ninline v_##_Tpvec v_combine_high(const v_##_Tpvec& a, const v_##_Tpvec& b) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptra[v_##_Tpvec::nlanes/2] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb[v_##_Tpvec::nlanes/2] = {0}; \\\n    v_store_high(ptra, a); \\\n    v_store_high(ptrb, b); \\\n    return v_load_halves(ptra, ptrb); \\\n} \\\ninline void v_recombine(const v_##_Tpvec& a, const v_##_Tpvec& b, v_##_Tpvec& c, v_##_Tpvec& d) \\\n{ \\\n    c = v_combine_low(a, b); \\\n    d = v_combine_high(a, b); \\\n}\n\nOPENCV_HAL_IMPL_RVV_UNPACKS(uint8x16, uchar, 8, u8)\nOPENCV_HAL_IMPL_RVV_UNPACKS(int8x16, schar, 8, i8)\nOPENCV_HAL_IMPL_RVV_UNPACKS(uint16x8, ushort, 16, u16)\nOPENCV_HAL_IMPL_RVV_UNPACKS(int16x8, short, 16, i16)\nOPENCV_HAL_IMPL_RVV_UNPACKS(uint32x4, unsigned, 32, u32)\nOPENCV_HAL_IMPL_RVV_UNPACKS(int32x4, int, 32, i32)\nOPENCV_HAL_IMPL_RVV_UNPACKS(float32x4, float, 32, f32)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_UNPACKS(float64x2, double, 64, f64)\n#endif\n\n\n#define OPENCV_HAL_IMPL_RVV_INTERLEAVED(_Tpvec, _Tp, suffix, width) \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptra[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb[v_##_Tpvec::nlanes] = {0}; \\\n    int i, i2; \\\n    for( i = i2 = 0; i < v_##_Tpvec::nlanes; i++, i2 += 2 ) \\\n    { \\\n        ptra[i] = ptr[i2]; \\\n        ptrb[i] = ptr[i2+1]; \\\n    } \\\n    a = v_load(ptra); \\\n    b = v_load(ptrb); \\\n} \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, v_##_Tpvec& c) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptra[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrc[v_##_Tpvec::nlanes] = {0}; \\\n    int i, i3; \\\n    for( i = i3 = 0; i < v_##_Tpvec::nlanes; i++, i3 += 3 ) \\\n    { \\\n        ptra[i] = ptr[i3]; \\\n        ptrb[i] = ptr[i3+1]; \\\n        ptrc[i] = ptr[i3+2]; \\\n    } \\\n    a = v_load(ptra); \\\n    b = v_load(ptrb); \\\n    c = v_load(ptrc); \\\n} \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, \\\n                                v_##_Tpvec& c, v_##_Tpvec& d) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptra[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrc[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrd[v_##_Tpvec::nlanes] = {0}; \\\n    int i, i4; \\\n    for( i = i4 = 0; i < v_##_Tpvec::nlanes; i++, i4 += 4 ) \\\n    { \\\n        ptra[i] = ptr[i4]; \\\n        ptrb[i] = ptr[i4+1]; \\\n        ptrc[i] = ptr[i4+2]; \\\n        ptrd[i] = ptr[i4+3]; \\\n    } \\\n    a = v_load(ptra); \\\n    b = v_load(ptrb); \\\n    c = v_load(ptrc); \\\n    d = v_load(ptrd); \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    int i, i2; \\\n    _Tp CV_DECL_ALIGNED(32) ptra[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb[v_##_Tpvec::nlanes] = {0}; \\\n    v_store(ptra, a); \\\n    v_store(ptrb, b); \\\n    for( i = i2 = 0; i < v_##_Tpvec::nlanes; i++, i2 += 2 ) \\\n    { \\\n        ptr[i2] = ptra[i]; \\\n        ptr[i2+1] = ptrb[i]; \\\n    } \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \\\n                                const v_##_Tpvec& c, hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    int i, i3; \\\n    _Tp CV_DECL_ALIGNED(32) ptra[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrc[v_##_Tpvec::nlanes] = {0}; \\\n    v_store(ptra, a); \\\n    v_store(ptrb, b); \\\n    v_store(ptrc, c); \\\n    for( i = i3 = 0; i < v_##_Tpvec::nlanes; i++, i3 += 3 ) \\\n    { \\\n        ptr[i3] = ptra[i]; \\\n        ptr[i3+1] = ptrb[i]; \\\n        ptr[i3+2] = ptrc[i]; \\\n    } \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \\\n                                const v_##_Tpvec& c, const v_##_Tpvec& d, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED ) \\\n{ \\\n    int i, i4; \\\n    _Tp CV_DECL_ALIGNED(32) ptra[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrb[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrc[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrd[v_##_Tpvec::nlanes] = {0}; \\\n    v_store(ptra, a); \\\n    v_store(ptrb, b); \\\n    v_store(ptrc, c); \\\n    v_store(ptrd, d); \\\n    for( i = i4 = 0; i < v_##_Tpvec::nlanes; i++, i4 += 4 ) \\\n    { \\\n        ptr[i4] = ptra[i]; \\\n        ptr[i4+1] = ptrb[i]; \\\n        ptr[i4+2] = ptrc[i]; \\\n        ptr[i4+3] = ptrd[i]; \\\n    } \\\n} \\\ninline v_##_Tpvec v_interleave_pairs(const v_##_Tpvec& vec) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptr[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrvec[v_##_Tpvec::nlanes] = {0}; \\\n    v_store(ptrvec, vec); \\\n    for (int i = 0; i < v_##_Tpvec::nlanes/4; i++) \\\n    { \\\n        ptr[4*i  ] = ptrvec[4*i  ]; \\\n        ptr[4*i+1] = ptrvec[4*i+2]; \\\n        ptr[4*i+2] = ptrvec[4*i+1]; \\\n        ptr[4*i+3] = ptrvec[4*i+3]; \\\n    } \\\n    return v_load(ptr); \\\n} \\\ninline v_##_Tpvec v_interleave_quads(const v_##_Tpvec& vec) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptr[v_##_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrvec[v_##_Tpvec::nlanes] = {0}; \\\n    v_store(ptrvec, vec); \\\n    for (int i = 0; i < v_##_Tpvec::nlanes/8; i++) \\\n    { \\\n        ptr[8*i  ] = ptrvec[4*i  ]; \\\n        ptr[8*i+1] = ptrvec[4*i+4]; \\\n        ptr[8*i+2] = ptrvec[4*i+1]; \\\n        ptr[8*i+3] = ptrvec[4*i+5]; \\\n        ptr[8*i+4] = ptrvec[4*i+2]; \\\n        ptr[8*i+5] = ptrvec[4*i+6]; \\\n        ptr[8*i+6] = ptrvec[4*i+3]; \\\n        ptr[8*i+7] = ptrvec[4*i+7]; \\\n    } \\\n    return v_load(ptr); \\\n}\n\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(uint8x16, uchar, u8, 8)\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(int8x16, schar, i8, 8)\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(uint16x8, ushort, u16, 16)\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(int16x8, short, i16, 16)\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(uint32x4, unsigned, u32, 32)\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(int32x4, int, i32, 32)\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(float32x4, float, f32, 32)\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(uint64x2, uint64, u64, 64)\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(int64x2, int64, i64, 64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_INTERLEAVED(float64x2, double, f64, 64)\n#endif\n\n//////////// PopCount ////////////\n\nstatic const unsigned char popCountTable[] =\n{\n    0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8,\n};\n\n#define OPENCV_HAL_IMPL_RVV_POPCOUNT_OP(_rTpvec, _Tpvec, _rTp, _Tp, suffix) \\\ninline _rTpvec v_popcount(const _Tpvec& a) \\\n{ \\\n    uchar CV_DECL_ALIGNED(32) ptra[16] = {0}; \\\n    v_store(ptra, v_reinterpret_as_u8(a)); \\\n    _rTp CV_DECL_ALIGNED(32) ptr[_Tpvec::nlanes] = {0}; \\\n    v_store(ptr, v_setzero_##suffix()); \\\n    for (int i = 0; i < _Tpvec::nlanes*(int)sizeof(_Tp); i++) \\\n        ptr[i/sizeof(_Tp)] += popCountTable[ptra[i]]; \\\n    return v_load(ptr); \\\n}\n\nOPENCV_HAL_IMPL_RVV_POPCOUNT_OP(v_uint8x16, v_uint8x16, uchar, uchar, u8)\nOPENCV_HAL_IMPL_RVV_POPCOUNT_OP(v_uint8x16, v_int8x16, uchar, schar, u8)\nOPENCV_HAL_IMPL_RVV_POPCOUNT_OP(v_uint16x8, v_uint16x8, ushort, ushort, u16)\nOPENCV_HAL_IMPL_RVV_POPCOUNT_OP(v_uint16x8, v_int16x8, ushort, short, u16)\nOPENCV_HAL_IMPL_RVV_POPCOUNT_OP(v_uint32x4, v_uint32x4, unsigned, unsigned, u32)\nOPENCV_HAL_IMPL_RVV_POPCOUNT_OP(v_uint32x4, v_int32x4, unsigned, int, u32)\nOPENCV_HAL_IMPL_RVV_POPCOUNT_OP(v_uint64x2, v_uint64x2, uint64, uint64, u64)\nOPENCV_HAL_IMPL_RVV_POPCOUNT_OP(v_uint64x2, v_int64x2, uint64, int64, u64)\n\n//////////// SignMask ////////////\n\n#define OPENCV_HAL_IMPL_RVV_SIGNMASK_OP(_Tpvec, _Tp, suffix, width, shift) \\\ninline int v_signmask(const _Tpvec& a) \\\n{ \\\n    int mask = 0; \\\n    vsetvlmax_e##width##m1(); \\\n    _Tpvec tmp = _Tpvec(vsrl_vx_##suffix##m1(a, shift)); \\\n    for( int i = 0; i < _Tpvec::nlanes; i++ ) \\\n        mask |= (int)(tmp.val[i]) << i; \\\n    return mask; \\\n}\n\nOPENCV_HAL_IMPL_RVV_SIGNMASK_OP(v_uint8x16, uchar, u8, 8, 7)\nOPENCV_HAL_IMPL_RVV_SIGNMASK_OP(v_uint16x8, ushort, u16, 16, 15)\nOPENCV_HAL_IMPL_RVV_SIGNMASK_OP(v_uint32x4, unsigned, u32, 32, 31)\nOPENCV_HAL_IMPL_RVV_SIGNMASK_OP(v_uint64x2, uint64, u64, 64, 63)\n\ninline int v_signmask(const v_int8x16& a)\n{ return v_signmask(v_reinterpret_as_u8(a)); }\ninline int v_signmask(const v_int16x8& a)\n{ return v_signmask(v_reinterpret_as_u16(a)); }\ninline int v_signmask(const v_int32x4& a)\n{ return v_signmask(v_reinterpret_as_u32(a)); }\ninline int v_signmask(const v_float32x4& a)\n{ return v_signmask(v_reinterpret_as_u32(a)); }\ninline int v_signmask(const v_int64x2& a)\n{ return v_signmask(v_reinterpret_as_u64(a)); }\n#if CV_SIMD128_64F\ninline int v_signmask(const v_float64x2& a)\n{ return v_signmask(v_reinterpret_as_u64(a)); }\n#endif\n\n\n//////////// Scan forward ////////////\n\n#define OPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(_Tpvec, _Tp, suffix) \\\ninline int v_scan_forward(const _Tpvec& a) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptr[_Tpvec::nlanes] = {0}; \\\n    v_store(ptr, v_reinterpret_as_##suffix(a)); \\\n    for (int i = 0; i < _Tpvec::nlanes; i++) \\\n        if(int(ptr[i]) < 0) \\\n            return i; \\\n    return 0; \\\n}\n\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_int8x16, schar, s8)\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_int16x8, short, s16)\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_int32x4, int, s32)\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_float32x4, float, f32)\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_int64x2, int64, s64)\n#if CV_SIMD128_64F\nOPENCV_HAL_IMPL_RVV_SCAN_FORWOARD_OP(v_float64x2, double, f64)\n#endif\n\n//////////// Pack triplets ////////////\n\n#define OPENCV_HAL_IMPL_RVV_PACK_TRIPLETS(_Tpvec, _Tp) \\\ninline _Tpvec v_pack_triplets(const _Tpvec& vec) \\\n{ \\\n    _Tp CV_DECL_ALIGNED(32) ptr[_Tpvec::nlanes] = {0}; \\\n    _Tp CV_DECL_ALIGNED(32) ptrvec[_Tpvec::nlanes] = {0}; \\\n    v_store(ptrvec, vec); \\\n    for (int i = 0; i < _Tpvec::nlanes/4; i++) \\\n    { \\\n        ptr[3*i  ] = ptrvec[4*i  ]; \\\n        ptr[3*i+1] = ptrvec[4*i+2]; \\\n        ptr[3*i+2] = ptrvec[4*i+2]; \\\n    } \\\n    return v_load(ptr); \\\n}\n\nOPENCV_HAL_IMPL_RVV_PACK_TRIPLETS(v_uint8x16, uchar)\nOPENCV_HAL_IMPL_RVV_PACK_TRIPLETS(v_int8x16, schar)\nOPENCV_HAL_IMPL_RVV_PACK_TRIPLETS(v_uint16x8, ushort)\nOPENCV_HAL_IMPL_RVV_PACK_TRIPLETS(v_int16x8, short)\nOPENCV_HAL_IMPL_RVV_PACK_TRIPLETS(v_uint32x4, unsigned)\nOPENCV_HAL_IMPL_RVV_PACK_TRIPLETS(v_int32x4, int)\nOPENCV_HAL_IMPL_RVV_PACK_TRIPLETS(v_float32x4, float)\n\n\n////// FP16 support ///////\n\n#if CV_FP16\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n    return v_float32x4(vfwcvt_f_f_v_f32m1(vle16_v_f16mf2(ptr)));\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n    vse16_v_f16mf2(ptr, vfncvt_f_f_w_f16mf2(v));\n}\n#else\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n    const int N = 4;\n    float buf[N];\n    for( int i = 0; i < N; i++ ) buf[i] = (float)ptr[i];\n    return v_load(buf);\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n    const int N = 4;\n    float buf[N];\n    v_store(buf, v);\n    for( int i = 0; i < N; i++ ) ptr[i] = float16_t(buf[i]);\n}\n#endif\n\n////////////// Rounding //////////////\n\ninline v_int32x4 v_round(const v_float32x4& a)\n{\n    vsetvlmax_e32m1();\n    return v_int32x4(vfcvt_x_f_v_i32m1(a));\n}\n\ninline v_int32x4 v_floor(const v_float32x4& a)\n{\n    v_float32x4 ZP5 = v_setall_f32(0.5f);\n    v_float32x4 t = a - ZP5;\n    vsetvlmax_e32m1();\n    return v_int32x4(vfcvt_x_f_v_i32m1(t));\n}\n\ninline v_int32x4 v_ceil(const v_float32x4& a)\n{\n    v_float32x4 ZP5 = v_setall_f32(0.5f);\n    v_float32x4 t = a + ZP5;\n    vsetvlmax_e32m1();\n    return v_int32x4(vfcvt_x_f_v_i32m1(t));\n}\n\ninline v_int32x4 v_trunc(const v_float32x4& a)\n{\n    vsetvlmax_e32m1();\n    return v_int32x4(vfcvt_rtz_x_f_v_i32m1(a));\n}\n#if CV_SIMD128_64F\ninline v_int32x4 v_round(const v_float64x2& a)\n{\n    double arr[4] = {a.val[0], a.val[1], 0, 0};\n    vsetvlmax_e64m2();\n    vfloat64m2_t tmp = vle64_v_f64m2(arr);\n    return v_int32x4(vfncvt_x_f_w_i32m1(tmp));\n}\n\ninline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b)\n{\n    double arr[4] = {a.val[0], a.val[1], b.val[0], b.val[1]};\n    vsetvlmax_e64m2();\n    vfloat64m2_t tmp = vle64_v_f64m2(arr);\n    return v_int32x4(vfncvt_x_f_w_i32m1(tmp));\n}\n\ninline v_int32x4 v_floor(const v_float64x2& a)\n{\n    double arr[4] = {a.val[0]-0.5f, a.val[1]-0.5f, 0, 0};\n    vsetvlmax_e64m2();\n    vfloat64m2_t tmp = vle64_v_f64m2(arr);\n    return v_int32x4(vfncvt_x_f_w_i32m1(tmp));\n}\n\ninline v_int32x4 v_ceil(const v_float64x2& a)\n{\n    double arr[4] = {a.val[0]+0.5f, a.val[1]+0.5f, 0, 0};\n    vsetvlmax_e64m2();\n    vfloat64m2_t tmp = vle64_v_f64m2(arr);\n    return v_int32x4(vfncvt_x_f_w_i32m1(tmp));\n}\n\ninline v_int32x4 v_trunc(const v_float64x2& a)\n{\n    double arr[4] = {a.val[0], a.val[1], 0, 0};\n    vsetvlmax_e64m2();\n    vfloat64m2_t tmp = vle64_v_f64m2(arr);\n    return v_int32x4(vfncvt_rtz_x_f_w_i32m1(tmp));\n}\n#endif\n\n\n//////// Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b)\n{\n    int CV_DECL_ALIGNED(32) ptr[8] = {0};\n    v_int32x4 t1, t2;\n    vsetvlmax_e32m2();\n    vse32_v_i32m2(ptr, vwmul_vv_i32m2(a, b));\n    v_load_deinterleave(ptr, t1, t2);\n    return t1 + t2;\n}\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{\n    int CV_DECL_ALIGNED(32) ptr[8] = {0};\n    v_int32x4 t1, t2;\n    vsetvlmax_e32m2();\n    vse32_v_i32m2(ptr, vwmul_vv_i32m2(a, b));\n    v_load_deinterleave(ptr, t1, t2);\n    return t1 + t2 + c;\n}\n\n// 32 >> 64\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b)\n{\n    int64 CV_DECL_ALIGNED(32) ptr[4] = {0};\n    v_int64x2 t1, t2;\n    vsetvlmax_e64m2();\n    vse64_v_i64m2(ptr, vwmul_vv_i64m2(a, b));\n    v_load_deinterleave(ptr, t1, t2);\n    return t1 + t2;\n}\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{\n    int64 CV_DECL_ALIGNED(32) ptr[4] = {0};\n    v_int64x2 t1, t2;\n    vsetvlmax_e64m2();\n    vse64_v_i64m2(ptr, vwmul_vv_i64m2(a, b));\n    v_load_deinterleave(ptr, t1, t2);\n    return t1 + t2 + c;\n}\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b)\n{\n    unsigned CV_DECL_ALIGNED(32) ptr[16] = {0};\n    v_uint32x4 t1, t2, t3, t4;\n    vsetvlmax_e32m4();\n    vse32_v_u32m4(ptr, vqmaccu_vv_u32m4(vzero_u32m4(), a, b));\n    v_load_deinterleave(ptr, t1, t2, t3, t4);\n    return t1 + t2 + t3 + t4;\n}\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b,\n                                   const v_uint32x4& c)\n{\n    unsigned CV_DECL_ALIGNED(32) ptr[16] = {0};\n    v_uint32x4 t1, t2, t3, t4;\n    vsetvlmax_e32m4();\n    vse32_v_u32m4(ptr, vqmaccu_vv_u32m4(vzero_u32m4(), a, b));\n    v_load_deinterleave(ptr, t1, t2, t3, t4);\n    return t1 + t2 + t3 + t4 + c;\n}\n\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b)\n{\n    int CV_DECL_ALIGNED(32) ptr[16] = {0};\n    v_int32x4 t1, t2, t3, t4;\n    vsetvlmax_e32m4();\n    vse32_v_i32m4(ptr, vqmacc_vv_i32m4(vzero_i32m4(), a, b));\n    v_load_deinterleave(ptr, t1, t2, t3, t4);\n    return t1 + t2 + t3 + t4;\n}\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b,\n                                  const v_int32x4& c)\n{\n    int CV_DECL_ALIGNED(32) ptr[16] = {0};\n    v_int32x4 t1, t2, t3, t4;\n    vsetvlmax_e32m4();\n    vse32_v_i32m4(ptr, vqmacc_vv_i32m4(vzero_i32m4(), a, b));\n    v_load_deinterleave(ptr, t1, t2, t3, t4);\n    return t1 + t2 + t3 + t4 + c;\n}\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b)\n{\n    uint64 CV_DECL_ALIGNED(32) ptr[8] = {0};\n    v_uint64x2 t1, t2, t3, t4;\n    vsetvlmax_e64m4();\n    vse64_v_u64m4(ptr, vqmaccu_vv_u64m4(vzero_u64m4(), a, b));\n    v_load_deinterleave(ptr, t1, t2, t3, t4);\n    return t1 + t2 + t3 + t4;\n}\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{\n    uint64 CV_DECL_ALIGNED(32) ptr[8] = {0};\n    v_uint64x2 t1, t2, t3, t4;\n    vsetvlmax_e64m4();\n    vse64_v_u64m4(ptr, vqmaccu_vv_u64m4(vzero_u64m4(), a, b));\n    v_load_deinterleave(ptr, t1, t2, t3, t4);\n    return t1 + t2 + t3 + t4 + c;\n}\n\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b)\n{\n    int64 CV_DECL_ALIGNED(32) ptr[8] = {0};\n    v_int64x2 t1, t2, t3, t4;\n    vsetvlmax_e64m4();\n    vse64_v_i64m4(ptr, vqmacc_vv_i64m4(vzero_i64m4(), a, b));\n    v_load_deinterleave(ptr, t1, t2, t3, t4);\n    return t1 + t2 + t3 + t4;\n}\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b,\n                                  const v_int64x2& c)\n{\n    int64 CV_DECL_ALIGNED(32) ptr[8] = {0};\n    v_int64x2 t1, t2, t3, t4;\n    vsetvlmax_e64m4();\n    vse64_v_i64m4(ptr, vqmacc_vv_i64m4(vzero_i64m4(), a, b));\n    v_load_deinterleave(ptr, t1, t2, t3, t4);\n    return t1 + t2 + t3 + t4 + c;\n}\n\n// 32 >> 64f\n#if CV_SIMD128_64F\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b)\n{ return v_cvt_f64(v_dotprod(a, b)); }\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a,   const v_int32x4& b,\n                                    const v_float64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n#endif\n\n//////// Fast Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b)\n{\n    int CV_DECL_ALIGNED(32) ptr[8] = {0};\n    vsetvlmax_e32m2();\n    vse32_v_i32m2(ptr, vwmul_vv_i32m2(a, b));\n    v_int32x4 t1 = v_load(ptr);\n    v_int32x4 t2 = v_load(ptr+4);\n    return t1 + t2;\n}\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{\n    int CV_DECL_ALIGNED(32) ptr[8] = {0};\n    vsetvlmax_e32m2();\n    vse32_v_i32m2(ptr, vwmul_vv_i32m2(a, b));\n    v_int32x4 t1 = v_load(ptr);\n    v_int32x4 t2 = v_load(ptr+4);\n    return t1 + t2 + c;\n}\n\n// 32 >> 64\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b)\n{\n    int64 CV_DECL_ALIGNED(32) ptr[4] = {0};\n    vsetvlmax_e64m2();\n    vse64_v_i64m2(ptr, vwmul_vv_i64m2(a, b));\n    v_int64x2 t1 = v_load(ptr);\n    v_int64x2 t2 = v_load(ptr+2);\n    return t1 + t2;\n}\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{\n    int64 CV_DECL_ALIGNED(32) ptr[4] = {0};\n    vsetvlmax_e64m2();\n    vse64_v_i64m2(ptr, vwmul_vv_i64m2(a, b));\n    v_int64x2 t1 = v_load(ptr);\n    v_int64x2 t2 = v_load(ptr+2);\n    return t1 + t2 + c;\n}\n\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b)\n{\n    unsigned CV_DECL_ALIGNED(32) ptr[16] = {0};\n    vsetvlmax_e32m4();\n    vse32_v_u32m4(ptr, vqmaccu_vv_u32m4(vzero_u32m4(), a, b));\n    v_uint32x4 t1 = v_load(ptr);\n    v_uint32x4 t2 = v_load(ptr+4);\n    v_uint32x4 t3 = v_load(ptr+8);\n    v_uint32x4 t4 = v_load(ptr+12);\n    return t1 + t2 + t3 + t4;\n}\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{\n    unsigned CV_DECL_ALIGNED(32) ptr[16] = {0};\n    vsetvlmax_e32m4();\n    vse32_v_u32m4(ptr, vqmaccu_vv_u32m4(vzero_u32m4(), a, b));\n    v_uint32x4 t1 = v_load(ptr);\n    v_uint32x4 t2 = v_load(ptr+4);\n    v_uint32x4 t3 = v_load(ptr+8);\n    v_uint32x4 t4 = v_load(ptr+12);\n    return t1 + t2 + t3 + t4 + c;\n}\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b)\n{\n    int CV_DECL_ALIGNED(32) ptr[16] = {0};\n    vsetvlmax_e32m4();\n    vse32_v_i32m4(ptr, vqmacc_vv_i32m4(vzero_i32m4(), a, b));\n    v_int32x4 t1 = v_load(ptr);\n    v_int32x4 t2 = v_load(ptr+4);\n    v_int32x4 t3 = v_load(ptr+8);\n    v_int32x4 t4 = v_load(ptr+12);\n    return t1 + t2 + t3 + t4;\n}\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{\n    int CV_DECL_ALIGNED(32) ptr[16] = {0};\n    vsetvlmax_e32m4();\n    vse32_v_i32m4(ptr, vqmacc_vv_i32m4(vzero_i32m4(), a, b));\n    v_int32x4 t1 = v_load(ptr);\n    v_int32x4 t2 = v_load(ptr+4);\n    v_int32x4 t3 = v_load(ptr+8);\n    v_int32x4 t4 = v_load(ptr+12);\n    return t1 + t2 + t3 + t4 + c;\n}\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b)\n{\n    uint64 CV_DECL_ALIGNED(32) ptr[8] = {0};\n    vsetvlmax_e64m4();\n    vse64_v_u64m4(ptr, vqmaccu_vv_u64m4(vzero_u64m4(), a, b));\n    v_uint64x2 t1 = v_load(ptr);\n    v_uint64x2 t2 = v_load(ptr+2);\n    v_uint64x2 t3 = v_load(ptr+4);\n    v_uint64x2 t4 = v_load(ptr+6);\n    return t1 + t2 + t3 + t4;\n}\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{\n    uint64 CV_DECL_ALIGNED(32) ptr[8] = {0};\n    vsetvlmax_e64m4();\n    vse64_v_u64m4(ptr, vqmaccu_vv_u64m4(vzero_u64m4(), a, b));\n    v_uint64x2 t1 = v_load(ptr);\n    v_uint64x2 t2 = v_load(ptr+2);\n    v_uint64x2 t3 = v_load(ptr+4);\n    v_uint64x2 t4 = v_load(ptr+6);\n    return t1 + t2 + t3 + t4 + c;\n}\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b)\n{\n    int64 CV_DECL_ALIGNED(32) ptr[8] = {0};\n    vsetvlmax_e64m4();\n    vse64_v_i64m4(ptr, vqmacc_vv_i64m4(vzero_i64m4(), a, b));\n    v_int64x2 t1 = v_load(ptr);\n    v_int64x2 t2 = v_load(ptr+2);\n    v_int64x2 t3 = v_load(ptr+4);\n    v_int64x2 t4 = v_load(ptr+6);\n    return t1 + t2 + t3 + t4;\n}\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{\n    int64 CV_DECL_ALIGNED(32) ptr[8] = {0};\n    vsetvlmax_e64m4();\n    vse64_v_i64m4(ptr, vqmacc_vv_i64m4(vzero_i64m4(), a, b));\n    v_int64x2 t1 = v_load(ptr);\n    v_int64x2 t2 = v_load(ptr+2);\n    v_int64x2 t3 = v_load(ptr+4);\n    v_int64x2 t4 = v_load(ptr+6);\n    return t1 + t2 + t3 + t4 + c;\n}\n\n// 32 >> 64f\n#if CV_SIMD128_64F\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_cvt_f64(v_dotprod_fast(a, b)); }\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n#endif\n\n\ninline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0,\n                            const v_float32x4& m1, const v_float32x4& m2,\n                            const v_float32x4& m3)\n{\n    vsetvlmax_e32m1();\n    vfloat32m1_t res = vfmul_vf_f32m1(m0, v_extract_n<0>(v));\n    res = vfmacc_vf_f32m1(res, v_extract_n<1>(v), m1);\n    res = vfmacc_vf_f32m1(res, v_extract_n<2>(v), m2);\n    res = vfmacc_vf_f32m1(res, v_extract_n<3>(v), m3);\n    return v_float32x4(res);\n}\n\ninline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0,\n                               const v_float32x4& m1, const v_float32x4& m2,\n                               const v_float32x4& a)\n{\n    vsetvlmax_e32m1();\n    vfloat32m1_t res = vfmul_vf_f32m1(m0, v_extract_n<0>(v));\n    res = vfmacc_vf_f32m1(res, v_extract_n<1>(v), m1);\n    res = vfmacc_vf_f32m1(res, v_extract_n<2>(v), m2);\n    return v_float32x4(res) + a;\n}\n\n#define OPENCV_HAL_IMPL_RVV_MUL_EXPAND(_Tpvec, _Tpwvec, _Tpw, suffix, wmul, width) \\\ninline void v_mul_expand(const _Tpvec& a, const _Tpvec& b, _Tpwvec& c, _Tpwvec& d) \\\n{ \\\n    _Tpw CV_DECL_ALIGNED(32) ptr[_Tpwvec::nlanes*2] = {0}; \\\n    vsetvlmax_e##width##m2(); \\\n    vse##width##_v_##suffix##m2(ptr, wmul(a, b)); \\\n    vsetvlmax_e##width##m1(); \\\n    c = _Tpwvec(vle##width##_v_##suffix##m1(ptr)); \\\n    d = _Tpwvec(vle##width##_v_##suffix##m1(ptr+_Tpwvec::nlanes)); \\\n}\n\nOPENCV_HAL_IMPL_RVV_MUL_EXPAND(v_uint8x16, v_uint16x8, ushort, u16, vwmulu_vv_u16m2, 16)\nOPENCV_HAL_IMPL_RVV_MUL_EXPAND(v_int8x16, v_int16x8, short, i16, vwmul_vv_i16m2, 16)\nOPENCV_HAL_IMPL_RVV_MUL_EXPAND(v_uint16x8, v_uint32x4, unsigned, u32, vwmulu_vv_u32m2, 32)\nOPENCV_HAL_IMPL_RVV_MUL_EXPAND(v_int16x8, v_int32x4, int, i32, vwmul_vv_i32m2, 32)\nOPENCV_HAL_IMPL_RVV_MUL_EXPAND(v_uint32x4, v_uint64x2, uint64, u64, vwmulu_vv_u64m2, 64)\n\n\ninline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b)\n{\n    vsetvlmax_e16m1();\n    return v_int16x8(vnsra_wx_i16m1(vwmul_vv_i32m2(a, b), 16));\n}\ninline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b)\n{\n    vsetvlmax_e16m1();\n    return v_uint16x8(vnsrl_wx_u16m1(vwmulu_vv_u32m2(a, b), 16));\n}\n\n\n//////// Saturating Multiply ////////\n\n#define OPENCV_HAL_IMPL_RVV_MUL_SAT(_Tpvec, _wTpvec) \\\ninline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    _wTpvec c, d; \\\n    v_mul_expand(a, b, c, d); \\\n    return v_pack(c, d); \\\n} \\\ninline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b) \\\n{ \\\n    a = a * b; \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_RVV_MUL_SAT(v_uint8x16, v_uint16x8)\nOPENCV_HAL_IMPL_RVV_MUL_SAT(v_int8x16, v_int16x8)\nOPENCV_HAL_IMPL_RVV_MUL_SAT(v_uint16x8, v_uint32x4)\nOPENCV_HAL_IMPL_RVV_MUL_SAT(v_int16x8, v_int32x4)\n\n\ninline void v_cleanup() {}\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n\n}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_rvv071.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html\n\n// Copyright (C) 2015, PingTouGe Semiconductor Co., Ltd., all rights reserved.\n\n#ifndef OPENCV_HAL_INTRIN_RISCVV_HPP\n#define OPENCV_HAL_INTRIN_RISCVV_HPP\n\n#include <float.h>\n#include <algorithm>\n#include \"opencv2/core/utility.hpp\"\n\nnamespace cv\n{\n\n//! @cond IGNORED\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n#define CV_SIMD128 1\n#define CV_SIMD128_64F 1\n//////////// Types ////////////\nstruct v_uint8x16\n{\n    typedef uchar lane_type;\n    enum { nlanes = 16 };\n\n    v_uint8x16() {}\n    explicit v_uint8x16(vuint8m1_t v) : val(v) {}\n    v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7,\n               uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15)\n    {\n        uchar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        val = (vuint8m1_t)vle_v_u8m1((unsigned char*)v, 16);\n    }\n    uchar get0() const\n    {\n        return vmv_x_s_u8m1_u8(val, 16);\n    }\n\n    vuint8m1_t val;\n};\n\nstruct v_int8x16\n{\n    typedef schar lane_type;\n    enum { nlanes = 16 };\n\n    v_int8x16() {}\n    explicit v_int8x16(vint8m1_t v) : val(v) {}\n    v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7,\n               schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15)\n    {\n        schar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        val = (vint8m1_t)vle_v_i8m1((schar*)v, 16);\n    }\n    schar get0() const\n    {\n        return vmv_x_s_i8m1_i8(val, 16);\n    }\n\n    vint8m1_t val;\n};\n\nstruct v_uint16x8\n{\n    typedef ushort lane_type;\n    enum { nlanes = 8 };\n\n    v_uint16x8() {}\n    explicit v_uint16x8(vuint16m1_t v) : val(v) {}\n    v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)\n    {\n        ushort v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        val = (vuint16m1_t)vle_v_u16m1((unsigned short*)v, 8);\n    }\n    ushort get0() const\n    {\n        return vmv_x_s_u16m1_u16(val, 8);\n    }\n\n    vuint16m1_t val;\n};\n\nstruct v_int16x8\n{\n    typedef short lane_type;\n    enum { nlanes = 8 };\n\n    v_int16x8() {}\n    explicit v_int16x8(vint16m1_t v) : val(v) {}\n    v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)\n    {\n        short v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        val = (vint16m1_t)vle_v_i16m1((signed short*)v, 8);\n    }\n    short get0() const\n    {\n        return vmv_x_s_i16m1_i16(val, 8);\n    }\n\n    vint16m1_t val;\n};\n\nstruct v_uint32x4\n{\n    typedef unsigned lane_type;\n    enum { nlanes = 4 };\n\n    v_uint32x4() {}\n    explicit v_uint32x4(vuint32m1_t v) : val(v) {}\n    v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3)\n    {\n        unsigned v[] = {v0, v1, v2, v3};\n        val = (vuint32m1_t)vle_v_u32m1((unsigned int*)v, 4);\n    }\n    unsigned get0() const\n    {\n        return vmv_x_s_u32m1_u32(val, 4);\n    }\n\n    vuint32m1_t val;\n};\n\nstruct v_int32x4\n{\n    typedef int lane_type;\n    enum { nlanes = 4 };\n\n    v_int32x4() {}\n    explicit v_int32x4(vint32m1_t v) : val(v) {}\n    v_int32x4(int v0, int v1, int v2, int v3)\n    {\n        int v[] = {v0, v1, v2, v3};\n        val = (vint32m1_t)vle_v_i32m1((signed int*)v, 4);\n    }\n    int get0() const\n    {\n        return vmv_x_s_i32m1_i32(val, 4);\n    }\n    vint32m1_t val;\n};\n\nstruct v_float32x4\n{\n    typedef float lane_type;\n    enum { nlanes = 4 };\n\n    v_float32x4() {}\n    explicit v_float32x4(vfloat32m1_t v) : val(v) {}\n    v_float32x4(float v0, float v1, float v2, float v3)\n    {\n        float v[] = {v0, v1, v2, v3};\n        val = (vfloat32m1_t)vle_v_f32m1((float*)v, 4);\n    }\n    float get0() const\n    {\n        return vfmv_f_s_f32m1_f32(val, 4);\n    }\n    vfloat32m1_t val;\n};\n\nstruct v_uint64x2\n{\n    typedef uint64 lane_type;\n    enum { nlanes = 2 };\n\n    v_uint64x2() {}\n    explicit v_uint64x2(vuint64m1_t v) : val(v) {}\n    v_uint64x2(uint64 v0, uint64 v1)\n    {\n        uint64 v[] = {v0, v1};\n        val = (vuint64m1_t)vle_v_u64m1((unsigned long*)v, 2);\n    }\n    uint64 get0() const\n    {\n        return vmv_x_s_u64m1_u64(val, 2);\n    }\n    vuint64m1_t val;\n};\n\nstruct v_int64x2\n{\n    typedef int64 lane_type;\n    enum { nlanes = 2 };\n\n    v_int64x2() {}\n    explicit v_int64x2(vint64m1_t v) : val(v) {}\n    v_int64x2(int64 v0, int64 v1)\n    {\n        int64 v[] = {v0, v1};\n        val = (vint64m1_t)vle_v_i64m1((long*)v, 2);\n    }\n    int64 get0() const\n    {\n        return vmv_x_s_i64m1_i64(val, 2);\n    }\n    vint64m1_t val;\n};\n\nstruct v_float64x2\n{\n    typedef double lane_type;\n    enum { nlanes = 2 };\n\n    v_float64x2() {}\n    explicit v_float64x2(vfloat64m1_t v) : val(v) {}\n    v_float64x2(double v0, double v1)\n    {\n        double v[] = {v0, v1};\n        val = (vfloat64m1_t)vle_v_f64m1((double*)v, 2);\n    }\n    double get0() const\n    {\n        return vfmv_f_s_f64m1_f64(val, 2);\n    }\n    vfloat64m1_t val;\n};\n\n#define OPENCV_HAL_IMPL_RISCVV_INIT(_Tpv, _Tp, suffix) \\\ninline _Tp##m1_t vreinterpretq_##suffix##_##suffix(_Tp##m1_t v) { return v; } \\\ninline v_uint8x16 v_reinterpret_as_u8(const v_##_Tpv& v) { return v_uint8x16((vuint8m1_t)(v.val)); } \\\ninline v_int8x16 v_reinterpret_as_s8(const v_##_Tpv& v) { return v_int8x16((vint8m1_t)(v.val)); } \\\ninline v_uint16x8 v_reinterpret_as_u16(const v_##_Tpv& v) { return v_uint16x8((vuint16m1_t)(v.val)); } \\\ninline v_int16x8 v_reinterpret_as_s16(const v_##_Tpv& v) { return v_int16x8((vint16m1_t)(v.val)); } \\\ninline v_uint32x4 v_reinterpret_as_u32(const v_##_Tpv& v) { return v_uint32x4((vuint32m1_t)(v.val)); } \\\ninline v_int32x4 v_reinterpret_as_s32(const v_##_Tpv& v) { return v_int32x4((vint32m1_t)(v.val)); } \\\ninline v_uint64x2 v_reinterpret_as_u64(const v_##_Tpv& v) { return v_uint64x2((vuint64m1_t)(v.val)); } \\\ninline v_int64x2 v_reinterpret_as_s64(const v_##_Tpv& v) { return v_int64x2((vint64m1_t)(v.val)); } \\\ninline v_float32x4 v_reinterpret_as_f32(const v_##_Tpv& v) { return v_float32x4((vfloat32m1_t)(v.val)); }\\\ninline v_float64x2 v_reinterpret_as_f64(const v_##_Tpv& v) { return v_float64x2((vfloat64m1_t)(v.val)); }\n\n\nOPENCV_HAL_IMPL_RISCVV_INIT(uint8x16, vuint8, u8)\nOPENCV_HAL_IMPL_RISCVV_INIT(int8x16, vint8, s8)\nOPENCV_HAL_IMPL_RISCVV_INIT(uint16x8, vuint16, u16)\nOPENCV_HAL_IMPL_RISCVV_INIT(int16x8, vint16, s16)\nOPENCV_HAL_IMPL_RISCVV_INIT(uint32x4, vuint32, u32)\nOPENCV_HAL_IMPL_RISCVV_INIT(int32x4, vint32, s32)\nOPENCV_HAL_IMPL_RISCVV_INIT(uint64x2, vuint64, u64)\nOPENCV_HAL_IMPL_RISCVV_INIT(int64x2, vint64, s64)\nOPENCV_HAL_IMPL_RISCVV_INIT(float64x2, vfloat64, f64)\nOPENCV_HAL_IMPL_RISCVV_INIT(float32x4, vfloat32, f32)\n#define OPENCV_HAL_IMPL_RISCVV_INIT_SET(__Tp, _Tp, suffix, len, num) \\\ninline v_##_Tp##x##num v_setzero_##suffix() { return v_##_Tp##x##num((v##_Tp##m1_t){0}); }     \\\ninline v_##_Tp##x##num v_setall_##suffix(__Tp v) { return v_##_Tp##x##num(vmv_v_x_##len##m1(v, num)); }\n\nOPENCV_HAL_IMPL_RISCVV_INIT_SET(uchar, uint8, u8, u8, 16)\nOPENCV_HAL_IMPL_RISCVV_INIT_SET(char, int8, s8, i8, 16)\nOPENCV_HAL_IMPL_RISCVV_INIT_SET(ushort, uint16, u16, u16, 8)\nOPENCV_HAL_IMPL_RISCVV_INIT_SET(short, int16, s16, i16, 8)\nOPENCV_HAL_IMPL_RISCVV_INIT_SET(unsigned int, uint32, u32, u32, 4)\nOPENCV_HAL_IMPL_RISCVV_INIT_SET(int, int32, s32, i32, 4)\nOPENCV_HAL_IMPL_RISCVV_INIT_SET(unsigned long, uint64, u64, u64, 2)\nOPENCV_HAL_IMPL_RISCVV_INIT_SET(long, int64, s64, i64, 2)\ninline v_float32x4 v_setzero_f32() { return v_float32x4((vfloat32m1_t){0}); }\ninline v_float32x4 v_setall_f32(float v) { return v_float32x4(vfmv_v_f_f32m1(v, 4)); }\n\ninline v_float64x2 v_setzero_f64() { return v_float64x2(vfmv_v_f_f64m1(0, 2)); }\ninline v_float64x2 v_setall_f64(double v) { return v_float64x2(vfmv_v_f_f64m1(v, 2)); }\n\n\n#define OPENCV_HAL_IMPL_RISCVV_BIN_OP(bin_op, _Tpvec, intrin) \\\ninline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val)); \\\n} \\\ninline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \\\n{ \\\n    a.val = intrin(a.val, b.val); \\\n    return a; \\\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_BIN_OPN(bin_op, _Tpvec, intrin, num) \\\ninline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val, num)); \\\n} \\\ninline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \\\n{ \\\n    a.val = intrin(a.val, b.val, num); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_uint8x16, vsaddu_vv_u8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_uint8x16, vssubu_vv_u8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_int8x16, vsadd_vv_i8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_int8x16, vssub_vv_i8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_uint16x8, vsaddu_vv_u16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_uint16x8, vssubu_vv_u16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_int16x8, vsadd_vv_i16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_int16x8, vssub_vv_i16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_int32x4, vsadd_vv_i32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_int32x4, vssub_vv_i32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(*, v_int32x4, vmul_vv_i32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_uint32x4, vadd_vv_u32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_uint32x4, vsub_vv_u32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(*, v_uint32x4, vmul_vv_u32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_int64x2, vsadd_vv_i64m1, 2)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_int64x2, vssub_vv_i64m1, 2)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_uint64x2, vadd_vv_u64m1, 2)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_uint64x2, vsub_vv_u64m1, 2)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_float32x4, vfadd_vv_f32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_float32x4, vfsub_vv_f32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(*, v_float32x4, vfmul_vv_f32m1, 4)\ninline v_float32x4 operator / (const v_float32x4& a, const v_float32x4& b)\n{\n    return v_float32x4(vfdiv_vv_f32m1(a.val, b.val, 4));\n}\ninline v_float32x4& operator /= (v_float32x4& a, const v_float32x4& b)\n{\n    a.val = vfdiv_vv_f32m1(a.val, b.val, 4);\n    return a;\n}\n\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(+, v_float64x2, vfadd_vv_f64m1, 2)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(-, v_float64x2, vfsub_vv_f64m1, 2)\nOPENCV_HAL_IMPL_RISCVV_BIN_OPN(*, v_float64x2, vfmul_vv_f64m1, 2)\ninline v_float64x2 operator / (const v_float64x2& a, const v_float64x2& b)\n{\n    return v_float64x2(vfdiv_vv_f64m1(a.val, b.val, 2));\n}\ninline v_float64x2& operator /= (v_float64x2& a, const v_float64x2& b)\n{\n    a.val = vfdiv_vv_f64m1(a.val, b.val, 2);\n    return a;\n}\n// TODO: exp, log, sin, cos\n\n#define OPENCV_HAL_IMPL_RISCVV_BIN_FUNC(_Tpvec, func, intrin) \\\ninline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val)); \\\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_BINN_FUNC(_Tpvec, func, intrin, num) \\\ninline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val, num)); \\\n}\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint8x16, v_min, vminu_vv_u8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint8x16, v_max, vmaxu_vv_u8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int8x16, v_min, vmin_vv_i8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int8x16, v_max, vmax_vv_i8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint16x8, v_min, vminu_vv_u16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint16x8, v_max, vmaxu_vv_u16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int16x8, v_min, vmin_vv_i16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int16x8, v_max, vmax_vv_i16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint32x4, v_min, vminu_vv_u32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint32x4, v_max, vmaxu_vv_u32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int32x4, v_min, vmin_vv_i32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int32x4, v_max, vmax_vv_i32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_float32x4, v_min, vfmin_vv_f32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_float32x4, v_max, vfmax_vv_f32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_float64x2, v_min, vfmin_vv_f64m1, 2)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_float64x2, v_max, vfmax_vv_f64m1, 2)\n\ninline v_float32x4 v_sqrt(const v_float32x4& x)\n{\n    return v_float32x4(vfsqrt_v_f32m1(x.val, 4));\n}\n\ninline v_float32x4 v_invsqrt(const v_float32x4& x)\n{\n    return v_float32x4(vfrdiv_vf_f32m1(vfsqrt_v_f32m1(x.val, 4), 1, 4));\n}\n\ninline v_float32x4 v_magnitude(const v_float32x4& a, const v_float32x4& b)\n{\n    v_float32x4 x(vfmacc_vv_f32m1(vfmul_vv_f32m1(a.val, a.val, 4), b.val, b.val, 4));\n    return v_sqrt(x);\n}\n\ninline v_float32x4 v_sqr_magnitude(const v_float32x4& a, const v_float32x4& b)\n{\n    return v_float32x4(vfmacc_vv_f32m1(vfmul_vv_f32m1(a.val, a.val, 4), b.val, b.val, 4));\n}\n\ninline v_float32x4 v_fma(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n    return v_float32x4(vfmacc_vv_f32m1(c.val, a.val, b.val, 4));\n}\n\ninline v_int32x4 v_fma(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return v_int32x4(vmacc_vv_i32m1(c.val, a.val, b.val, 4));\n}\n\ninline v_float32x4 v_muladd(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\ninline v_int32x4 v_muladd(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\ninline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0,\n                            const v_float32x4& m1, const v_float32x4& m2,\n                            const v_float32x4& m3)\n{\n    vfloat32m1_t res = vfmul_vf_f32m1(m0.val, v.val[0], 4);//vmuli_f32(m0.val, v.val, 0);\n    res = vfmacc_vf_f32m1(res, v.val[1], m1.val, 4);//vmulai_f32(res, m1.val, v.val, 1);\n    res = vfmacc_vf_f32m1(res, v.val[2], m2.val, 4);//vmulai_f32(res, m1.val, v.val, 1);\n    res = vfmacc_vf_f32m1(res, v.val[3], m3.val, 4);//vmulai_f32(res, m1.val, v.val, 1);\n    return v_float32x4(res);\n}\n\ninline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0,\n                               const v_float32x4& m1, const v_float32x4& m2,\n                               const v_float32x4& a)\n{\n    vfloat32m1_t res = vfmul_vf_f32m1(m0.val, v.val[0], 4);//vmuli_f32(m0.val, v.val, 0);\n    res = vfmacc_vf_f32m1(res, v.val[1], m1.val, 4);//vmulai_f32(res, m1.val, v.val, 1);\n    res = vfmacc_vf_f32m1(res, v.val[2], m2.val, 4);//vmulai_f32(res, m1.val, v.val, 1);\n    res = vfadd_vv_f32m1(res, a.val, 4);//vmulai_f32(res, m1.val, v.val, 1);\n    return v_float32x4(res);\n}\n\ninline v_float64x2 v_sqrt(const v_float64x2& x)\n{\n    return v_float64x2(vfsqrt_v_f64m1(x.val, 2));\n}\n\ninline v_float64x2 v_invsqrt(const v_float64x2& x)\n{\n    return v_float64x2(vfrdiv_vf_f64m1(vfsqrt_v_f64m1(x.val, 2), 1, 2));\n}\n\ninline v_float64x2 v_magnitude(const v_float64x2& a, const v_float64x2& b)\n{\n    v_float64x2 x(vfmacc_vv_f64m1(vfmul_vv_f64m1(a.val, a.val, 2), b.val, b.val, 2));\n    return v_sqrt(x);\n}\n\ninline v_float64x2 v_sqr_magnitude(const v_float64x2& a, const v_float64x2& b)\n{\n    return v_float64x2(vfmacc_vv_f64m1(vfmul_vv_f64m1(a.val, a.val, 2), b.val, b.val, 2));\n}\n\ninline v_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n    return v_float64x2(vfmacc_vv_f64m1(c.val, a.val, b.val, 2));\n}\n\ninline v_float64x2 v_muladd(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n    return v_fma(a, b, c);\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_LOGIC_OPN(_Tpvec, suffix, num) \\\n    OPENCV_HAL_IMPL_RISCVV_BIN_OPN(&, _Tpvec, vand_vv_##suffix, num) \\\n    OPENCV_HAL_IMPL_RISCVV_BIN_OPN(|, _Tpvec, vor_vv_##suffix, num) \\\n    OPENCV_HAL_IMPL_RISCVV_BIN_OPN(^, _Tpvec, vxor_vv_##suffix, num) \\\n    inline _Tpvec operator ~ (const _Tpvec & a) \\\n    { \\\n        return _Tpvec(vnot_v_##suffix(a.val, num)); \\\n    }\n\nOPENCV_HAL_IMPL_RISCVV_LOGIC_OPN(v_uint8x16, u8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_LOGIC_OPN(v_uint16x8, u16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_LOGIC_OPN(v_uint32x4, u32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_LOGIC_OPN(v_uint64x2, u64m1, 2)\nOPENCV_HAL_IMPL_RISCVV_LOGIC_OPN(v_int8x16,  i8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_LOGIC_OPN(v_int16x8,  i16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_LOGIC_OPN(v_int32x4,  i32m1, 4)\nOPENCV_HAL_IMPL_RISCVV_LOGIC_OPN(v_int64x2,  i64m1, 2)\n\n#define OPENCV_HAL_IMPL_RISCVV_FLT_BIT_OP(bin_op, intrin) \\\ninline v_float32x4 operator bin_op (const v_float32x4& a, const v_float32x4& b) \\\n{ \\\n    return v_float32x4(vfloat32m1_t(intrin(vint32m1_t(a.val), vint32m1_t(b.val), 4))); \\\n} \\\ninline v_float32x4& operator bin_op##= (v_float32x4& a, const v_float32x4& b) \\\n{ \\\n    a.val = vfloat32m1_t(intrin(vint32m1_t(a.val), vint32m1_t(b.val), 4)); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_FLT_BIT_OP(&, vand_vv_i32m1)\nOPENCV_HAL_IMPL_RISCVV_FLT_BIT_OP(|, vor_vv_i32m1)\nOPENCV_HAL_IMPL_RISCVV_FLT_BIT_OP(^, vxor_vv_i32m1)\n\ninline v_float32x4 operator ~ (const v_float32x4& a)\n{\n    return v_float32x4((vfloat32m1_t)(vnot_v_i32m1((vint32m1_t)(a.val), 4)));\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_FLT_64BIT_OP(bin_op, intrin) \\\ninline v_float64x2 operator bin_op (const v_float64x2& a, const v_float64x2& b) \\\n{ \\\n    return v_float64x2(vfloat64m1_t(intrin(vint64m1_t(a.val), vint64m1_t(b.val), 2))); \\\n} \\\ninline v_float64x2& operator bin_op##= (v_float64x2& a, const v_float64x2& b) \\\n{ \\\n    a.val = vfloat64m1_t(intrin(vint64m1_t(a.val), vint64m1_t(b.val), 2)); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_FLT_64BIT_OP(&, vand_vv_i64m1)\nOPENCV_HAL_IMPL_RISCVV_FLT_64BIT_OP(|, vor_vv_i64m1)\nOPENCV_HAL_IMPL_RISCVV_FLT_64BIT_OP(^, vxor_vv_i64m1)\n\ninline v_float64x2 operator ~ (const v_float64x2& a)\n{\n    return v_float64x2((vfloat64m1_t)(vnot_v_i64m1((vint64m1_t)(a.val), 2)));\n}\ninline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b)\n{\n    return v_int16x8(vmulh_vv_i16m1(a.val, b.val, 8));\n}\ninline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b)\n{\n    return v_uint16x8(vmulhu_vv_u16m1(a.val, b.val, 8));\n}\n\n//#define OPENCV_HAL_IMPL_RISCVV_ABS(_Tpuvec, _Tpsvec, usuffix, ssuffix) \\\n//inline _Tpuvec v_abs(const _Tpsvec& a) {    \\\n//    E##xm1_t mask=vmflt_vf_e32xm1_f32m1(x.val, 0.0, 4);\n\n//OPENCV_HAL_IMPL_RISCVV_ABS(v_uint8x16, v_int8x16, u8, s8)\n//OPENCV_HAL_IMPL_RISCVV_ABS(v_uint16x8, v_int16x8, u16, s16)\n//OPENCV_HAL_IMPL_RISCVV_ABS(v_uint32x4, v_int32x4, u32, s32)\n\ninline v_uint32x4 v_abs(v_int32x4 x)\n{\n    vbool32_t mask=vmslt_vx_i32m1_b32(x.val, 0, 4);\n    return v_uint32x4((vuint32m1_t)vrsub_vx_i32m1_m(mask, x.val, x.val, 0, 4));\n}\n\ninline v_uint16x8 v_abs(v_int16x8 x)\n{\n    vbool16_t mask=vmslt_vx_i16m1_b16(x.val, 0, 8);\n    return v_uint16x8((vuint16m1_t)vrsub_vx_i16m1_m(mask, x.val, x.val, 0, 8));\n}\n\ninline v_uint8x16 v_abs(v_int8x16 x)\n{\n    vbool8_t mask=vmslt_vx_i8m1_b8(x.val, 0, 16);\n    return v_uint8x16((vuint8m1_t)vrsub_vx_i8m1_m(mask, x.val, x.val, 0, 16));\n}\n\ninline v_float32x4 v_abs(v_float32x4 x)\n{\n    return (v_float32x4)vfsgnjx_vv_f32m1(x.val, x.val, 4);\n}\n\ninline v_float64x2 v_abs(v_float64x2 x)\n{\n    return (v_float64x2)vfsgnjx_vv_f64m1(x.val, x.val, 2);\n}\n\ninline v_float32x4 v_absdiff(const v_float32x4& a, const v_float32x4& b)\n{\n    vfloat32m1_t ret = vfsub_vv_f32m1(a.val, b.val, 4);\n    return (v_float32x4)vfsgnjx_vv_f32m1(ret, ret, 4);\n}\n\ninline v_float64x2 v_absdiff(const v_float64x2& a, const v_float64x2& b)\n{\n    vfloat64m1_t ret = vfsub_vv_f64m1(a.val, b.val, 2);\n    return (v_float64x2)vfsgnjx_vv_f64m1(ret, ret, 2);\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_ABSDIFF_U(bit, num) \\\ninline v_uint##bit##x##num v_absdiff(v_uint##bit##x##num a, v_uint##bit##x##num b){    \\\n    vuint##bit##m1_t vmax = vmaxu_vv_u##bit##m1(a.val, b.val, num);    \\\n    vuint##bit##m1_t vmin = vminu_vv_u##bit##m1(a.val, b.val, num);    \\\n    return v_uint##bit##x##num(vsub_vv_u##bit##m1(vmax, vmin, num));\\\n}\n\nOPENCV_HAL_IMPL_RISCVV_ABSDIFF_U(8, 16)\nOPENCV_HAL_IMPL_RISCVV_ABSDIFF_U(16, 8)\nOPENCV_HAL_IMPL_RISCVV_ABSDIFF_U(32, 4)\n\n/** Saturating absolute difference **/\ninline v_int8x16 v_absdiffs(v_int8x16 a, v_int8x16 b){\n    vint8m1_t vmax = vmax_vv_i8m1(a.val, b.val, 16);\n    vint8m1_t vmin = vmin_vv_i8m1(a.val, b.val, 16);\n    return v_int8x16(vssub_vv_i8m1(vmax, vmin, 16));\n}\ninline v_int16x8 v_absdiffs(v_int16x8 a, v_int16x8 b){\n    vint16m1_t vmax = vmax_vv_i16m1(a.val, b.val, 8);\n    vint16m1_t vmin = vmin_vv_i16m1(a.val, b.val, 8);\n    return v_int16x8(vssub_vv_i16m1(vmax, vmin, 8));\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_ABSDIFF(_Tpvec, _Tpv, num) \\\ninline v_uint##_Tpvec v_absdiff(v_int##_Tpvec a, v_int##_Tpvec b){    \\\n     vint##_Tpv##_t max = vmax_vv_i##_Tpv(a.val, b.val, num);\\\n     vint##_Tpv##_t min = vmin_vv_i##_Tpv(a.val, b.val, num);\\\n    return v_uint##_Tpvec((vuint##_Tpv##_t)vsub_vv_i##_Tpv(max, min, num));    \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_ABSDIFF(8x16, 8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_ABSDIFF(16x8, 16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_ABSDIFF(32x4, 32m1, 4)\n\n//  Multiply and expand\ninline void v_mul_expand(const v_int8x16& a, const v_int8x16& b,\n                         v_int16x8& c, v_int16x8& d)\n{\n    vint16m2_t res = vundefined_i16m2();\n    res = vwmul_vv_i16m2(a.val, b.val, 16);\n    c.val = vget_i16m2_i16m1(res, 0);\n    d.val = vget_i16m2_i16m1(res, 1);\n}\n\ninline void v_mul_expand(const v_uint8x16& a, const v_uint8x16& b,\n                         v_uint16x8& c, v_uint16x8& d)\n{\n    vuint16m2_t res = vundefined_u16m2();\n    res = vwmulu_vv_u16m2(a.val, b.val, 16);\n    c.val = vget_u16m2_u16m1(res, 0);\n    d.val = vget_u16m2_u16m1(res, 1);\n}\n\ninline void v_mul_expand(const v_int16x8& a, const v_int16x8& b,\n                         v_int32x4& c, v_int32x4& d)\n{\n    vint32m2_t res = vundefined_i32m2();\n    res = vwmul_vv_i32m2(a.val, b.val, 8);\n    c.val = vget_i32m2_i32m1(res, 0);\n    d.val = vget_i32m2_i32m1(res, 1);\n}\n\ninline void v_mul_expand(const v_uint16x8& a, const v_uint16x8& b,\n                         v_uint32x4& c, v_uint32x4& d)\n{\n    vuint32m2_t res = vundefined_u32m2();\n    res = vwmulu_vv_u32m2(a.val, b.val, 8);\n    c.val = vget_u32m2_u32m1(res, 0);\n    d.val = vget_u32m2_u32m1(res, 1);\n}\n\ninline void v_mul_expand(const v_int32x4& a, const v_int32x4& b,\n                         v_int64x2& c, v_int64x2& d)\n{\n    vint64m2_t res = vundefined_i64m2();\n    res = vwmul_vv_i64m2(a.val, b.val, 4);\n    c.val = vget_i64m2_i64m1(res, 0);\n    d.val = vget_i64m2_i64m1(res, 1);\n}\n\ninline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b,\n                         v_uint64x2& c, v_uint64x2& d)\n{\n    vuint64m2_t res = vundefined_u64m2();\n    res = vwmulu_vv_u64m2(a.val, b.val, 4);\n    c.val = vget_u64m2_u64m1(res, 0);\n    d.val = vget_u64m2_u64m1(res, 1);\n}\n\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint8x16, v_add_wrap, vadd_vv_u8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int8x16, v_add_wrap, vadd_vv_i8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint16x8, v_add_wrap, vadd_vv_u16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int16x8, v_add_wrap, vadd_vv_i16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint8x16, v_sub_wrap, vsub_vv_u8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int8x16, v_sub_wrap, vsub_vv_i8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint16x8, v_sub_wrap, vsub_vv_u16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int16x8, v_sub_wrap, vsub_vv_i16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint8x16, v_mul_wrap, vmul_vv_u8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int8x16, v_mul_wrap, vmul_vv_i8m1, 16)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_uint16x8, v_mul_wrap, vmul_vv_u16m1, 8)\nOPENCV_HAL_IMPL_RISCVV_BINN_FUNC(v_int16x8, v_mul_wrap, vmul_vv_i16m1, 8)\n//////// Dot Product ////////\n// 16 >> 32\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b)\n{\n    vint32m2_t res = vundefined_i32m2();\n    res = vwmul_vv_i32m2(a.val, b.val, 8);\n    res = vrgather_vv_i32m2(res, (vuint32m2_t){0, 2, 4, 6, 1, 3, 5, 7}, 8);\n    return v_int32x4(vadd_vv_i32m1(vget_i32m2_i32m1(res, 0), vget_i32m2_i32m1(res, 1), 4));\n}\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{\n    vint32m2_t res = vundefined_i32m2();\n    res = vwmul_vv_i32m2(a.val, b.val, 8);\n    res = vrgather_vv_i32m2(res, (vuint32m2_t){0, 2, 4, 6, 1, 3, 5, 7}, 8);\n    return v_int32x4(vadd_vv_i32m1(vadd_vv_i32m1(vget_i32m2_i32m1(res, 0),vget_i32m2_i32m1(res, 1), 4), c.val, 4));\n}\n\n// 32 >> 64\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b)\n{\n    vint64m2_t res = vundefined_i64m2();\n    res = vwmul_vv_i64m2(a.val, b.val, 4);\n    res = vrgather_vv_i64m2(res, (vuint64m2_t){0, 2, 1, 3}, 4);\n    return v_int64x2(vadd_vv_i64m1(vget_i64m2_i64m1(res, 0), vget_i64m2_i64m1(res, 1), 2));\n}\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{\n    vint64m2_t res = vundefined_i64m2();\n    res = vwmul_vv_i64m2(a.val, b.val, 4);\n    res = vrgather_vv_i64m2(res, (vuint64m2_t){0, 2, 1, 3}, 4);\n    return v_int64x2(vadd_vv_i64m1(vadd_vv_i64m1(vget_i64m2_i64m1(res, 0), vget_i64m2_i64m1(res, 1), 2), c.val, 2));\n}\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b)\n{\n    vuint16m2_t v1 = vundefined_u16m2();\n    vuint32m2_t v2 = vundefined_u32m2();\n    v1 = vwmulu_vv_u16m2(a.val, b.val, 16);\n    v1 = vrgather_vv_u16m2(v1, (vuint16m2_t){0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15}, 16);\n    v2 = vwaddu_vv_u32m2(vget_u16m2_u16m1(v1, 0), vget_u16m2_u16m1(v1, 1), 8);\n    return v_uint32x4(vadd_vv_u32m1(vget_u32m2_u32m1(v2, 0), vget_u32m2_u32m1(v2, 1), 4));\n}\n\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b,\n                                   const v_uint32x4& c)\n{\n    vuint16m2_t v1 = vundefined_u16m2();\n    vuint32m2_t v2 = vundefined_u32m2();\n    v1 = vwmulu_vv_u16m2(a.val, b.val, 16);\n    v1 = vrgather_vv_u16m2(v1, (vuint16m2_t){0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15}, 16);\n    v2 = vwaddu_vv_u32m2(vget_u16m2_u16m1(v1, 0), vget_u16m2_u16m1(v1, 1), 8);\n    return v_uint32x4(vadd_vv_u32m1(vadd_vv_u32m1(vget_u32m2_u32m1(v2, 0), vget_u32m2_u32m1(v2, 1), 4), c.val, 4));\n}\n\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b)\n{\n    vint16m2_t v1 = vundefined_i16m2();\n    vint32m2_t v2 = vundefined_i32m2();\n    v1 = vwmul_vv_i16m2(a.val, b.val, 16);\n    v1 = vrgather_vv_i16m2(v1, (vuint16m2_t){0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15}, 16);\n    v2 = vwadd_vv_i32m2(vget_i16m2_i16m1(v1, 0), vget_i16m2_i16m1(v1, 1), 8);\n    return v_int32x4(vadd_vv_i32m1(vget_i32m2_i32m1(v2, 0), vget_i32m2_i32m1(v2, 1), 4));\n}\n\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b,\n                                   const v_int32x4& c)\n{\n    vint16m2_t v1 = vundefined_i16m2();\n    vint32m2_t v2 = vundefined_i32m2();\n    v1 = vwmul_vv_i16m2(a.val, b.val, 16);\n    v1 = vrgather_vv_i16m2(v1, (vuint16m2_t){0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15}, 16);\n    v2 = vwadd_vv_i32m2(vget_i16m2_i16m1(v1, 0), vget_i16m2_i16m1(v1, 1), 8);\n    return v_int32x4(vadd_vv_i32m1(vadd_vv_i32m1(vget_i32m2_i32m1(v2, 0), vget_i32m2_i32m1(v2, 1), 4), c.val, 4));\n}\n\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b)\n{\n    vuint32m2_t v1 = vundefined_u32m2();\n    vuint64m2_t v2 = vundefined_u64m2();\n    v1 = vwmulu_vv_u32m2(a.val, b.val, 8);\n    v1 = vrgather_vv_u32m2(v1, (vuint32m2_t){0, 4, 1, 5, 2, 6, 3, 7}, 8);\n    v2 = vwaddu_vv_u64m2(vget_u32m2_u32m1(v1, 0), vget_u32m2_u32m1(v1, 1), 4);\n    return v_uint64x2(vadd_vv_u64m1(vget_u64m2_u64m1(v2, 0), vget_u64m2_u64m1(v2, 1), 2));\n}\n\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b,\n                                   const v_uint64x2& c)\n{\n    vuint32m2_t v1 = vundefined_u32m2();\n    vuint64m2_t v2 = vundefined_u64m2();\n    v1 = vwmulu_vv_u32m2(a.val, b.val, 8);\n    v1 = vrgather_vv_u32m2(v1, (vuint32m2_t){0, 4, 1, 5, 2, 6, 3, 7}, 8);\n    v2 = vwaddu_vv_u64m2(vget_u32m2_u32m1(v1, 0), vget_u32m2_u32m1(v1, 1), 4);\n    return v_uint64x2(vadd_vv_u64m1(vadd_vv_u64m1(vget_u64m2_u64m1(v2, 0), vget_u64m2_u64m1(v2, 1), 2), c.val, 2));\n}\n\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b)\n{\n    vint32m2_t v1 = vundefined_i32m2();\n    vint64m2_t v2 = vundefined_i64m2();\n    v1 = vwmul_vv_i32m2(a.val, b.val, 8);\n    v1 = vrgather_vv_i32m2(v1, (vuint32m2_t){0, 4, 1, 5, 2, 6, 3, 7}, 8);\n    v2 = vwadd_vv_i64m2(vget_i32m2_i32m1(v1, 0), vget_i32m2_i32m1(v1, 1), 4);\n    return v_int64x2(vadd_vv_i64m1(vget_i64m2_i64m1(v2, 0), vget_i64m2_i64m1(v2, 1), 2));\n}\n\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b,\n                                   const v_int64x2& c)\n{\n    vint32m2_t v1 = vundefined_i32m2();\n    vint64m2_t v2 = vundefined_i64m2();\n    v1 = vwmul_vv_i32m2(a.val, b.val, 8);\n    v1 = vrgather_vv_i32m2(v1, (vuint32m2_t){0, 4, 1, 5, 2, 6, 3, 7}, 8);\n    v2 = vwadd_vv_i64m2(vget_i32m2_i32m1(v1, 0), vget_i32m2_i32m1(v1, 1), 4);\n    return v_int64x2(vadd_vv_i64m1(vadd_vv_i64m1(vget_i64m2_i64m1(v2, 0), vget_i64m2_i64m1(v2, 1), 2), c.val, 2));\n}\n\n//////// Fast Dot Product ////////\n// 16 >> 32\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b)\n{\n    vint32m2_t v1 = vundefined_i32m2();\n    v1 = vwmul_vv_i32m2(a.val, b.val, 8);\n    return v_int32x4(vadd_vv_i32m1(vget_i32m2_i32m1(v1, 0), vget_i32m2_i32m1(v1, 1), 4));\n}\n\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{\n    vint32m2_t v1 = vundefined_i32m2();\n    v1 = vwmul_vv_i32m2(a.val, b.val, 8);\n    return v_int32x4(vadd_vv_i32m1(vadd_vv_i32m1(vget_i32m2_i32m1(v1, 0), vget_i32m2_i32m1(v1, 1), 4), c.val, 4));\n}\n\n// 32 >> 64\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b)\n{\n    vint64m2_t v1 = vundefined_i64m2();\n    v1 = vwmul_vv_i64m2(a.val, b.val, 4);\n    return v_int64x2(vadd_vv_i64m1(vget_i64m2_i64m1(v1, 0), vget_i64m2_i64m1(v1, 1), 2));\n}\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{\n    vint64m2_t v1 = vundefined_i64m2();\n    v1 = vwmul_vv_i64m2(a.val, b.val, 8);\n    return v_int64x2(vadd_vv_i64m1(vadd_vv_i64m1(vget_i64m2_i64m1(v1, 0), vget_i64m2_i64m1(v1, 1), 4), c.val, 4));\n}\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b)\n{\n    vuint16m2_t v1 = vundefined_u16m2();\n    vuint32m2_t v2 = vundefined_u32m2();\n    v1 = vwmulu_vv_u16m2(a.val, b.val, 16);\n    v2 = vwaddu_vv_u32m2(vget_u16m2_u16m1(v1, 0), vget_u16m2_u16m1(v1, 1), 8);\n    return v_uint32x4(vadd_vv_u32m1(vget_u32m2_u32m1(v2, 0), vget_u32m2_u32m1(v2, 1), 4));\n}\n\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{\n    vuint16m2_t v1 = vundefined_u16m2();\n    vuint32m2_t v2 = vundefined_u32m2();\n    v1 = vwmulu_vv_u16m2(a.val, b.val, 16);\n    v2 = vwaddu_vv_u32m2(vget_u16m2_u16m1(v1, 0), vget_u16m2_u16m1(v1, 1), 8);\n    return v_uint32x4(vadd_vv_u32m1(vadd_vv_u32m1(vget_u32m2_u32m1(v2, 0), vget_u32m2_u32m1(v2, 1), 4), c.val, 4));\n}\n\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b)\n{\n    vint16m2_t v1 = vundefined_i16m2();\n    vint32m2_t v2 = vundefined_i32m2();\n    v1 = vwmul_vv_i16m2(a.val, b.val, 16);\n    v2 = vwadd_vv_i32m2(vget_i16m2_i16m1(v1, 0), vget_i16m2_i16m1(v1, 1), 8);\n    return v_int32x4(vadd_vv_i32m1(vget_i32m2_i32m1(v2, 0), vget_i32m2_i32m1(v2, 1), 4));\n}\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{\n    vint16m2_t v1 = vundefined_i16m2();\n    vint32m2_t v2 = vundefined_i32m2();\n    v1 = vwmul_vv_i16m2(a.val, b.val, 16);\n    v2 = vwadd_vv_i32m2(vget_i16m2_i16m1(v1, 0), vget_i16m2_i16m1(v1, 1), 8);\n    return v_int32x4(vadd_vv_i32m1(vadd_vv_i32m1(vget_i32m2_i32m1(v2, 0), vget_i32m2_i32m1(v2, 1), 4), c.val, 4));\n}\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b)\n{\n    vuint32m2_t v1 = vundefined_u32m2();\n    vuint64m2_t v2 = vundefined_u64m2();\n    v1 = vwmulu_vv_u32m2(a.val, b.val, 8);\n    v2 = vwaddu_vv_u64m2(vget_u32m2_u32m1(v1, 0), vget_u32m2_u32m1(v1, 1), 4);\n    return v_uint64x2(vadd_vv_u64m1(vget_u64m2_u64m1(v2, 0), vget_u64m2_u64m1(v2, 1), 2));\n}\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{\n    vuint32m2_t v1 = vundefined_u32m2();\n    vuint64m2_t v2 = vundefined_u64m2();\n    v1 = vwmulu_vv_u32m2(a.val, b.val, 8);\n    v2 = vwaddu_vv_u64m2(vget_u32m2_u32m1(v1, 0), vget_u32m2_u32m1(v1, 1), 4);\n    return v_uint64x2(vadd_vv_u64m1(vadd_vv_u64m1(vget_u64m2_u64m1(v2, 0), vget_u64m2_u64m1(v2, 1), 2), c.val, 2));\n}\n\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b)\n{\n    vint32m2_t v1 = vundefined_i32m2();\n    vint64m2_t v2 = vundefined_i64m2();\n    v1 = vwmul_vv_i32m2(a.val, b.val, 8);\n    v2 = vwadd_vv_i64m2(vget_i32m2_i32m1(v1, 0), vget_i32m2_i32m1(v1, 1), 4);\n    return v_int64x2(vadd_vv_i64m1(vget_i64m2_i64m1(v2, 0), vget_i64m2_i64m1(v2, 1), 2));\n}\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{\n    vint32m2_t v1 = vundefined_i32m2();\n    vint64m2_t v2 = vundefined_i64m2();\n    v1 = vwmul_vv_i32m2(a.val, b.val, 8);\n    v2 = vwadd_vv_i64m2(vget_i32m2_i32m1(v1, 0), vget_i32m2_i32m1(v1, 1), 4);\n    return v_int64x2(vadd_vv_i64m1(vadd_vv_i64m1(vget_i64m2_i64m1(v2, 0), vget_i64m2_i64m1(v2, 1), 2), c.val, 2));\n}\n\n\n#define OPENCV_HAL_IMPL_RISCVV_REDUCE_OP_W(_Tpvec, _Tpvec2, len, scalartype, func, intrin, num) \\\ninline scalartype v_reduce_##func(const v_##_Tpvec##x##num& a) \\\n{\\\n    v##_Tpvec2##m1_t val = vmv_v_x_##len##m1(0, num); \\\n    val = intrin(val, a.val, val, num);    \\\n    return vmv_x_s_##len##m1_##len(val, num);    \\\n}\n\n\n#define OPENCV_HAL_IMPL_RISCVV_REDUCE_OP_(_Tpvec, _Tpvec2, scalartype, func, funcu, num) \\\ninline scalartype v_reduce_##func(const v_##_Tpvec##x##num& a) \\\n{\\\n    v##_Tpvec##m1_t val = (v##_Tpvec##m1_t)vmv_v_x_i8m1(0, num); \\\n    val = v##funcu##_vs_##_Tpvec2##m1_##_Tpvec2##m1(val, a.val, a.val, num);    \\\n    return val[0];    \\\n}\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_W(int8, int16, i16, int, sum, vwredsum_vs_i8m1_i16m1, 16)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_W(int16, int32, i32, int, sum, vwredsum_vs_i16m1_i32m1, 8)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_W(int32, int64, i64, int, sum, vwredsum_vs_i32m1_i64m1, 4)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_W(uint8, uint16, u16, unsigned, sum, vwredsumu_vs_u8m1_u16m1, 16)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_W(uint16, uint32, u32, unsigned, sum, vwredsumu_vs_u16m1_u32m1, 8)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_W(uint32, uint64, u64, unsigned, sum, vwredsumu_vs_u32m1_u64m1, 4)\ninline float v_reduce_sum(const v_float32x4& a) \\\n{\\\n    vfloat32m1_t val = vfmv_v_f_f32m1(0.0, 4); \\\n    val = vfredsum_vs_f32m1_f32m1(val, a.val, val, 4);    \\\n    return vfmv_f_s_f32m1_f32(val, 4);    \\\n}\ninline double v_reduce_sum(const v_float64x2& a) \\\n{\\\n    vfloat64m1_t val = vfmv_v_f_f64m1(0.0, 2); \\\n    val = vfredsum_vs_f64m1_f64m1(val, a.val, val, 2);    \\\n    return vfmv_f_s_f64m1_f64(val, 2);    \\\n}\ninline uint64 v_reduce_sum(const v_uint64x2& a)\n{ return vext_x_v_u64m1_u64((vuint64m1_t)a.val, 0, 2)+vext_x_v_u64m1_u64((vuint64m1_t)a.val, 1, 2); }\n\ninline int64 v_reduce_sum(const v_int64x2& a)\n{ return vext_x_v_i64m1_i64((vint64m1_t)a.val, 0, 2)+vext_x_v_i64m1_i64((vint64m1_t)a.val, 1, 2); }\n\n#define OPENCV_HAL_IMPL_RISCVV_REDUCE_OP(func)    \\\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_(int8,  i8, int, func, red##func, 16)    \\\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_(int16, i16, int, func, red##func, 8)    \\\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_(int32, i32, int, func, red##func, 4)    \\\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_(int64, i64, int, func, red##func, 2)    \\\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_(uint8,  u8, unsigned, func, red##func##u, 16)    \\\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_(uint16, u16, unsigned, func, red##func##u, 8)    \\\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_(uint32, u32, unsigned, func, red##func##u, 4)    \\\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP_(float32, f32, float, func, fred##func, 4)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP(max)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_OP(min)\n\ninline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b,\n                                 const v_float32x4& c, const v_float32x4& d)\n{\n    vfloat32m1_t a0 = vfmv_v_f_f32m1(0.0, 4);\n    vfloat32m1_t b0 = vfmv_v_f_f32m1(0.0, 4);\n    vfloat32m1_t c0 = vfmv_v_f_f32m1(0.0, 4);\n    vfloat32m1_t d0 = vfmv_v_f_f32m1(0.0, 4);\n    a0 = vfredsum_vs_f32m1_f32m1(a0, a.val, a0, 4);\n    b0 = vfredsum_vs_f32m1_f32m1(b0, b.val, b0, 4);\n    c0 = vfredsum_vs_f32m1_f32m1(c0, c.val, c0, 4);\n    d0 = vfredsum_vs_f32m1_f32m1(d0, d.val, d0, 4);\n    return v_float32x4(a0[0], b0[0], c0[0], d0[0]);\n}\n\ninline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b)\n{\n    vfloat32m1_t a0 = vfmv_v_f_f32m1(0.0, 4);\n    vfloat32m1_t x = vfsub_vv_f32m1(a.val, b.val, 4);\n    vbool32_t mask=vmflt_vf_f32m1_b32(x, 0, 4);\n    vfloat32m1_t val = vfrsub_vf_f32m1_m(mask, x, x, 0, 4);\n    a0 = vfredsum_vs_f32m1_f32m1(a0, val, a0, 4);\n    return a0[0];\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_REDUCE_SAD(_Tpvec, _Tpvec2) \\\ninline unsigned v_reduce_sad(const _Tpvec& a, const _Tpvec&b){    \\\n    _Tpvec2 x = v_absdiff(a, b);    \\\n    return v_reduce_sum(x);    \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_REDUCE_SAD(v_int8x16, v_uint8x16)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_SAD(v_uint8x16, v_uint8x16)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_SAD(v_int16x8, v_uint16x8)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_SAD(v_uint16x8, v_uint16x8)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_SAD(v_int32x4, v_uint32x4)\nOPENCV_HAL_IMPL_RISCVV_REDUCE_SAD(v_uint32x4, v_uint32x4)\n\n#define OPENCV_HAL_IMPL_RISCVV_INT_CMP_OP(_Tpvec, _Tp, _T, num, uv) \\\ninline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vbool##_T##_t mask = vmseq_vv_##_Tp##_b##_T(a.val, b.val, num);    \\\n    return _Tpvec(vmerge_vxm_##_Tp(mask, vmv_v_x_##_Tp(0, num), -1, num));    \\\n} \\\ninline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vbool##_T##_t mask = vmsne_vv_##_Tp##_b##_T(a.val, b.val, num);    \\\n    return _Tpvec(vmerge_vxm_##_Tp(mask, vmv_v_x_##_Tp(0, num), -1, num));    \\\n} \\\ninline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vbool##_T##_t mask = vmslt##uv##_Tp##_b##_T(a.val, b.val, num);    \\\n    return _Tpvec(vmerge_vxm_##_Tp(mask, vmv_v_x_##_Tp(0, num), -1, num));    \\\n} \\\ninline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vbool##_T##_t mask = vmslt##uv##_Tp##_b##_T(b.val, a.val, num);    \\\n    return _Tpvec(vmerge_vxm_##_Tp(mask, vmv_v_x_##_Tp(0, num), -1, num));    \\\n} \\\ninline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vbool##_T##_t mask = vmsle##uv##_Tp##_b##_T(a.val, b.val, num);    \\\n    return _Tpvec(vmerge_vxm_##_Tp(mask, vmv_v_x_##_Tp(0, num), -1, num));    \\\n} \\\ninline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    vbool##_T##_t mask = vmsle##uv##_Tp##_b##_T(b.val, a.val, num);    \\\n    return _Tpvec(vmerge_vxm_##_Tp(mask, vmv_v_x_##_Tp(0, num), -1, num));    \\\n} \\\n\nOPENCV_HAL_IMPL_RISCVV_INT_CMP_OP(v_int8x16, i8m1,  8, 16, _vv_)\nOPENCV_HAL_IMPL_RISCVV_INT_CMP_OP(v_int16x8, i16m1, 16, 8, _vv_)\nOPENCV_HAL_IMPL_RISCVV_INT_CMP_OP(v_int32x4, i32m1, 32, 4, _vv_)\nOPENCV_HAL_IMPL_RISCVV_INT_CMP_OP(v_int64x2, i64m1, 64, 2, _vv_)\nOPENCV_HAL_IMPL_RISCVV_INT_CMP_OP(v_uint8x16, u8m1, 8, 16, u_vv_)\nOPENCV_HAL_IMPL_RISCVV_INT_CMP_OP(v_uint16x8, u16m1, 16, 8, u_vv_)\nOPENCV_HAL_IMPL_RISCVV_INT_CMP_OP(v_uint32x4, u32m1, 32, 4, u_vv_)\nOPENCV_HAL_IMPL_RISCVV_INT_CMP_OP(v_uint64x2, u64m1, 64, 2, u_vv_)\n\n//TODO: ==\ninline v_float32x4 operator == (const v_float32x4& a, const v_float32x4& b)\n{\n    vbool32_t mask = vmfeq_vv_f32m1_b32(a.val, b.val, 4);\n    vint32m1_t res = vmerge_vxm_i32m1(mask, vmv_v_x_i32m1(0.0, 4), -1, 4);\n    return v_float32x4((vfloat32m1_t)res);\n}\ninline v_float32x4 operator != (const v_float32x4& a, const v_float32x4& b)\n{\n    vbool32_t mask = vmfne_vv_f32m1_b32(a.val, b.val, 4);\n    vint32m1_t res = vmerge_vxm_i32m1(mask, vmv_v_x_i32m1(0.0, 4), -1, 4);\n    return v_float32x4((vfloat32m1_t)res);\n}\ninline v_float32x4 operator < (const v_float32x4& a, const v_float32x4& b)\n{\n    vbool32_t mask = vmflt_vv_f32m1_b32(a.val, b.val, 4);\n    vint32m1_t res = vmerge_vxm_i32m1(mask, vmv_v_x_i32m1(0.0, 4), -1, 4);\n    return v_float32x4((vfloat32m1_t)res);\n}\ninline v_float32x4 operator <= (const v_float32x4& a, const v_float32x4& b)\n{\n    vbool32_t mask = vmfle_vv_f32m1_b32(a.val, b.val, 4);\n    vint32m1_t res = vmerge_vxm_i32m1(mask, vmv_v_x_i32m1(0.0, 4), -1, 4);\n    return v_float32x4((vfloat32m1_t)res);\n}\ninline v_float32x4 operator > (const v_float32x4& a, const v_float32x4& b)\n{\n    vbool32_t mask = vmfgt_vv_f32m1_b32(a.val, b.val, 4);\n    vint32m1_t res = vmerge_vxm_i32m1(mask, vmv_v_x_i32m1(0.0, 4), -1, 4);\n    return v_float32x4((vfloat32m1_t)res);\n}\ninline v_float32x4 operator >= (const v_float32x4& a, const v_float32x4& b)\n{\n    vbool32_t mask = vmfge_vv_f32m1_b32(a.val, b.val, 4);\n    vint32m1_t res = vmerge_vxm_i32m1(mask, vmv_v_x_i32m1(0.0, 4), -1, 4);\n    return v_float32x4((vfloat32m1_t)res);\n}\ninline v_float32x4 v_not_nan(const v_float32x4& a)\n{\n    vbool32_t mask = vmford_vv_f32m1_b32(a.val, a.val, 4);\n    vint32m1_t res = vmerge_vxm_i32m1(mask, vmv_v_x_i32m1(0.0, 4), -1, 4);\n    return v_float32x4((vfloat32m1_t)res);\n}\n\n//TODO: ==\ninline v_float64x2 operator == (const v_float64x2& a, const v_float64x2& b)\n{\n    vbool64_t mask = vmfeq_vv_f64m1_b64(a.val, b.val, 2);\n    vint64m1_t res = vmerge_vxm_i64m1(mask, vmv_v_x_i64m1(0.0, 2), -1, 2);\n    return v_float64x2((vfloat64m1_t)res);\n}\ninline v_float64x2 operator != (const v_float64x2& a, const v_float64x2& b)\n{\n    vbool64_t mask = vmfne_vv_f64m1_b64(a.val, b.val, 2);\n    vint64m1_t res = vmerge_vxm_i64m1(mask, vmv_v_x_i64m1(0.0, 2), -1, 2);\n    return v_float64x2((vfloat64m1_t)res);\n}\ninline v_float64x2 operator < (const v_float64x2& a, const v_float64x2& b)\n{\n    vbool64_t mask = vmflt_vv_f64m1_b64(a.val, b.val, 2);\n    vint64m1_t res = vmerge_vxm_i64m1(mask, vmv_v_x_i64m1(0.0, 2), -1, 2);\n    return v_float64x2((vfloat64m1_t)res);\n}\ninline v_float64x2 operator <= (const v_float64x2& a, const v_float64x2& b)\n{\n    vbool64_t mask = vmfle_vv_f64m1_b64(a.val, b.val, 2);\n    vint64m1_t res = vmerge_vxm_i64m1(mask, vmv_v_x_i64m1(0.0, 2), -1, 2);\n    return v_float64x2((vfloat64m1_t)res);\n}\ninline v_float64x2 operator > (const v_float64x2& a, const v_float64x2& b)\n{\n    vbool64_t mask = vmfgt_vv_f64m1_b64(a.val, b.val, 2);\n    vint64m1_t res = vmerge_vxm_i64m1(mask, vmv_v_x_i64m1(0.0, 2), -1, 2);\n    return v_float64x2((vfloat64m1_t)res);\n}\ninline v_float64x2 operator >= (const v_float64x2& a, const v_float64x2& b)\n{\n    vbool64_t mask = vmfge_vv_f64m1_b64(a.val, b.val, 2);\n    vint64m1_t res = vmerge_vxm_i64m1(mask, vmv_v_x_i64m1(0.0, 2), -1, 2);\n    return v_float64x2((vfloat64m1_t)res);\n}\ninline v_float64x2 v_not_nan(const v_float64x2& a)\n{\n    vbool64_t mask = vmford_vv_f64m1_b64(a.val, a.val, 2);\n    vint64m1_t res = vmerge_vxm_i64m1(mask, vmv_v_x_i64m1(0.0, 2), -1, 2);\n    return v_float64x2((vfloat64m1_t)res);\n}\n#define OPENCV_HAL_IMPL_RISCVV_TRANSPOSE4x4(_Tp, _T) \\\ninline void v_transpose4x4(const v_##_Tp##32x4& a0, const v_##_Tp##32x4& a1, \\\n                         const v_##_Tp##32x4& a2, const v_##_Tp##32x4& a3, \\\n                         v_##_Tp##32x4& b0, v_##_Tp##32x4& b1, \\\n                         v_##_Tp##32x4& b2, v_##_Tp##32x4& b3) \\\n{ \\\n    v##_Tp##32m4_t val = vundefined_##_T##m4();    \\\n    val = vset_##_T##m4(val, 0, a0.val);    \\\n    val = vset_##_T##m4(val, 1, a1.val);    \\\n    val = vset_##_T##m4(val, 2, a2.val);    \\\n    val = vset_##_T##m4(val, 3, a3.val);   \\\n    val = vrgather_vv_##_T##m4(val, (vuint32m4_t){0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15}, 16);    \\\n    b0.val = vget_##_T##m4_##_T##m1(val, 0);   \\\n    b1.val = vget_##_T##m4_##_T##m1(val, 1);   \\\n    b2.val = vget_##_T##m4_##_T##m1(val, 2);   \\\n    b3.val = vget_##_T##m4_##_T##m1(val, 3);   \\\n}\nOPENCV_HAL_IMPL_RISCVV_TRANSPOSE4x4(uint, u32)\nOPENCV_HAL_IMPL_RISCVV_TRANSPOSE4x4(int, i32)\nOPENCV_HAL_IMPL_RISCVV_TRANSPOSE4x4(float, f32)\n\n\n#define OPENCV_HAL_IMPL_RISCVV_SHIFT_LEFT(_Tpvec, suffix, _T, num) \\\ninline _Tpvec operator << (const _Tpvec& a, int n) \\\n{ return _Tpvec((vsll_vx_##_T##m1(a.val, n, num))); } \\\ntemplate<int n> inline _Tpvec v_shl(const _Tpvec& a) \\\n{ return _Tpvec((vsll_vx_##_T##m1(a.val, n, num))); }\n\n#define OPENCV_HAL_IMPL_RISCVV_SHIFT_RIGHT(_Tpvec, suffix, _T, num, intric) \\\ninline _Tpvec operator >> (const _Tpvec& a, int n) \\\n{ return _Tpvec((v##intric##_vx_##_T##m1(a.val, n, num))); } \\\ntemplate<int n> inline _Tpvec v_shr(const _Tpvec& a) \\\n{ return _Tpvec((v##intric##_vx_##_T##m1(a.val, n, num))); }\\\ntemplate<int n> inline _Tpvec v_rshr(const _Tpvec& a) \\\n{ return _Tpvec((v##intric##_vx_##_T##m1(vadd_vx_##_T##m1(a.val, 1<<(n-1), num), n, num))); }\n\n// trade efficiency for convenience\n#define OPENCV_HAL_IMPL_RISCVV_SHIFT_OP(suffix, _T, num, intrin) \\\nOPENCV_HAL_IMPL_RISCVV_SHIFT_LEFT(v_##suffix##x##num, suffix, _T, num) \\\nOPENCV_HAL_IMPL_RISCVV_SHIFT_RIGHT(v_##suffix##x##num, suffix, _T, num, intrin)\n\nOPENCV_HAL_IMPL_RISCVV_SHIFT_OP(uint8, u8, 16, srl)\nOPENCV_HAL_IMPL_RISCVV_SHIFT_OP(uint16, u16, 8, srl)\nOPENCV_HAL_IMPL_RISCVV_SHIFT_OP(uint32, u32, 4, srl)\nOPENCV_HAL_IMPL_RISCVV_SHIFT_OP(uint64, u64, 2, srl)\nOPENCV_HAL_IMPL_RISCVV_SHIFT_OP(int8, i8, 16, sra)\nOPENCV_HAL_IMPL_RISCVV_SHIFT_OP(int16, i16, 8, sra)\nOPENCV_HAL_IMPL_RISCVV_SHIFT_OP(int32, i32, 4, sra)\nOPENCV_HAL_IMPL_RISCVV_SHIFT_OP(int64, i64, 2, sra)\n\n#if 0\n#define VUP4(n) {0, 1, 2, 3}\n#define VUP8(n) {0, 1, 2, 3, 4, 5, 6, 7}\n#define VUP16(n) {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}\n#define VUP2(n) {0, 1}\n#endif\n#define OPENCV_HAL_IMPL_RISCVV_ROTATE_OP(_Tpvec, suffix, _T, num, num2, vmv, len) \\\ntemplate<int n> inline _Tpvec v_rotate_left(const _Tpvec& a) \\\n{    \\\n    suffix##m1_t tmp = vmv##_##_T##m1(0, num);\\\n        tmp = vslideup_vx_##_T##m1_m(vmset_m_##len(num), tmp, a.val, n, num);\\\n        return _Tpvec(tmp);\\\n} \\\ntemplate<int n> inline _Tpvec v_rotate_right(const _Tpvec& a) \\\n{     \\\n        return _Tpvec(vslidedown_vx_##_T##m1(a.val, n, num));\\\n} \\\ntemplate<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a) \\\n{ return a; } \\\ntemplate<int n> inline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    suffix##m2_t tmp = vundefined_##_T##m2();    \\\n    tmp = vset_##_T##m2(tmp, 0, a.val);          \\\n    tmp = vset_##_T##m2(tmp, 1, b.val);          \\\n        tmp = vslidedown_vx_##_T##m2(tmp, n, num2);\\\n        return _Tpvec(vget_##_T##m2_##_T##m1(tmp, 0));\\\n} \\\ntemplate<int n> inline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    suffix##m2_t tmp = vundefined_##_T##m2();    \\\n    tmp = vset_##_T##m2(tmp, 0, b.val);    \\\n    tmp = vset_##_T##m2(tmp, 1, a.val);    \\\n        tmp = vslideup_vx_##_T##m2(tmp, n, num2);\\\n        return _Tpvec(vget_##_T##m2_##_T##m1(tmp, 1));\\\n} \\\ntemplate<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    CV_UNUSED(b); return a; \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_uint8x16, vuint8, u8, 16, 32, vmv_v_x, b8)\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_int8x16, vint8, i8, 16, 32, vmv_v_x, b8)\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_uint16x8, vuint16, u16, 8, 16, vmv_v_x, b16)\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_int16x8, vint16, i16, 8, 16, vmv_v_x, b16)\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_uint32x4, vuint32, u32, 4, 8, vmv_v_x, b32)\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_int32x4, vint32, i32, 4, 8, vmv_v_x, b32)\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_uint64x2, vuint64, u64, 2, 4, vmv_v_x, b64)\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_int64x2, vint64, i64, 2, 4, vmv_v_x, b64)\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_float32x4, vfloat32, f32, 4, 8, vfmv_v_f, b32)\nOPENCV_HAL_IMPL_RISCVV_ROTATE_OP(v_float64x2, vfloat64, f64, 2, 4, vfmv_v_f, b64)\n\n#define OPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(_Tpvec, _Tp, _Tp2, len, hnum, num) \\\ninline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \\\n{ \\\n  typedef uint64 CV_DECL_ALIGNED(1) unaligned_uint64; \\\n  vuint64m1_t tmp = {*(unaligned_uint64*)ptr0, *(unaligned_uint64*)ptr1};\\\n    return _Tpvec(_Tp2##_t(tmp)); } \\\ninline _Tpvec v_load_low(const _Tp* ptr) \\\n{ return _Tpvec(vle_v_##len(ptr, hnum)); }\\\ninline _Tpvec v_load_aligned(const _Tp* ptr) \\\n{ return _Tpvec(vle_v_##len(ptr, num)); } \\\ninline _Tpvec v_load(const _Tp* ptr) \\\n{ return _Tpvec((_Tp2##_t)vle_v_##len((const _Tp *)ptr, num)); } \\\ninline void v_store_low(_Tp* ptr, const _Tpvec& a) \\\n{ vse_v_##len(ptr, a.val, hnum);}\\\ninline void v_store_high(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n  _Tp2##_t a0 = vslidedown_vx_##len(a.val, hnum, num);    \\\n  vse_v_##len(ptr, a0, hnum);}\\\ninline void v_store(_Tp* ptr, const _Tpvec& a) \\\n{ vse_v_##len(ptr, a.val, num); } \\\ninline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \\\n{ vse_v_##len(ptr, a.val, num); } \\\ninline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \\\n{ vse_v_##len(ptr, a.val, num); } \\\ninline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode /*mode*/) \\\n{ vse_v_##len(ptr, a.val, num); }\n\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_uint8x16, uchar, vuint8m1, u8m1, 8, 16)\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_int8x16,  schar, vint8m1, i8m1, 8, 16)\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_uint16x8, ushort, vuint16m1, u16m1, 4, 8)\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_int16x8,  short,  vint16m1, i16m1, 4, 8)\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_uint32x4, unsigned, vuint32m1, u32m1, 2, 4)\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_int32x4,  int,     vint32m1, i32m1, 2, 4)\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_uint64x2, unsigned long, vuint64m1, u64m1, 1, 2)\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_int64x2,  long,     vint64m1, i64m1, 1, 2)\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_float32x4, float, vfloat32m1, f32m1, 2, 4)\nOPENCV_HAL_IMPL_RISCVV_LOADSTORE_OP(v_float64x2, double, vfloat64m1, f64m1, 1, 2)\n\n\n////////////// Lookup table access ////////////////////\n\ninline v_int8x16 v_lut(const schar* tab, const int* idx)\n{\n#if 1\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[ 0]],\n        tab[idx[ 1]],\n        tab[idx[ 2]],\n        tab[idx[ 3]],\n        tab[idx[ 4]],\n        tab[idx[ 5]],\n        tab[idx[ 6]],\n        tab[idx[ 7]],\n        tab[idx[ 8]],\n        tab[idx[ 9]],\n        tab[idx[10]],\n        tab[idx[11]],\n        tab[idx[12]],\n        tab[idx[13]],\n        tab[idx[14]],\n        tab[idx[15]]\n    };\n    return v_int8x16(vle_v_i8m1(elems, 16));\n#else\n    int32xm4_t index32 = vlev_int32xm4(idx, 16);\n    vint16m2_t index16 = vnsra_vx_i16m2_int32xm4(index32, 0, 16);\n    vint8m1_t index = vnsra_vx_i8m1_i16m2(index16, 0, 16);\n    return v_int8x16(vlxbv_i8m1(tab, index, 16));\n#endif\n}\n\ninline v_int8x16 v_lut_pairs(const schar* tab, const int* idx){\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[3]],\n        tab[idx[3] + 1],\n        tab[idx[4]],\n        tab[idx[4] + 1],\n        tab[idx[5]],\n        tab[idx[5] + 1],\n        tab[idx[6]],\n        tab[idx[6] + 1],\n        tab[idx[7]],\n        tab[idx[7] + 1]\n    };\n    return v_int8x16(vle_v_i8m1(elems, 16));\n}\ninline v_int8x16 v_lut_quads(const schar* tab, const int* idx)\n{\n    schar CV_DECL_ALIGNED(32) elems[16] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[0] + 2],\n        tab[idx[0] + 3],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[1] + 2],\n        tab[idx[1] + 3],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[2] + 2],\n        tab[idx[2] + 3],\n        tab[idx[3]],\n        tab[idx[3] + 1],\n        tab[idx[3] + 2],\n        tab[idx[3] + 3]\n    };\n    return v_int8x16(vle_v_i8m1(elems, 16));\n}\n\ninline v_uint8x16 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((schar*)tab, idx)); }\ninline v_uint8x16 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((schar*)tab, idx)); }\ninline v_uint8x16 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((schar*)tab, idx)); }\n\ninline v_int16x8 v_lut(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]],\n        tab[idx[4]],\n        tab[idx[5]],\n        tab[idx[6]],\n        tab[idx[7]]\n    };\n    return v_int16x8(vle_v_i16m1(elems, 8));\n}\ninline v_int16x8 v_lut_pairs(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[2]],\n        tab[idx[2] + 1],\n        tab[idx[3]],\n        tab[idx[3] + 1]\n    };\n    return v_int16x8(vle_v_i16m1(elems, 8));\n}\ninline v_int16x8 v_lut_quads(const short* tab, const int* idx)\n{\n    short CV_DECL_ALIGNED(32) elems[8] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[0] + 2],\n        tab[idx[0] + 3],\n        tab[idx[1]],\n        tab[idx[1] + 1],\n        tab[idx[1] + 2],\n        tab[idx[1] + 3]\n    };\n    return v_int16x8(vle_v_i16m1(elems, 8));\n}\ninline v_uint16x8 v_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut((short*)tab, idx)); }\ninline v_uint16x8 v_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_pairs((short*)tab, idx)); }\ninline v_uint16x8 v_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_quads((short*)tab, idx)); }\n\ninline v_int32x4 v_lut(const int* tab, const int* idx)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]]\n    };\n    return v_int32x4(vle_v_i32m1(elems, 4));\n}\ninline v_int32x4 v_lut_pairs(const int* tab, const int* idx)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[0] + 1],\n        tab[idx[1]],\n        tab[idx[1] + 1]\n    };\n    return v_int32x4(vle_v_i32m1(elems, 4));\n}\ninline v_int32x4 v_lut_quads(const int* tab, const int* idx)\n{\n    return v_int32x4(vle_v_i32m1(tab+idx[0], 4));\n}\ninline v_uint32x4 v_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut((int*)tab, idx)); }\ninline v_uint32x4 v_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_pairs((int*)tab, idx)); }\ninline v_uint32x4 v_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_quads((int*)tab, idx)); }\n\ninline v_int64x2 v_lut(const int64_t* tab, const int* idx)\n{\n    vint64m1_t res = {tab[idx[0]], tab[idx[1]]};\n    return v_int64x2(res);\n}\ninline v_int64x2 v_lut_pairs(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(vle_v_i64m1(tab+idx[0], 2));\n}\n\ninline v_uint64x2 v_lut(const uint64_t* tab, const int* idx)\n{\n    vuint64m1_t res = {tab[idx[0]], tab[idx[1]]};\n    return v_uint64x2(res);\n}\ninline v_uint64x2 v_lut_pairs(const uint64_t* tab, const int* idx)\n{\n    return v_uint64x2(vle_v_u64m1(tab+idx[0], 2));\n}\n\ninline v_float32x4 v_lut(const float* tab, const int* idx)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[1]],\n        tab[idx[2]],\n        tab[idx[3]]\n    };\n    return v_float32x4(vle_v_f32m1(elems, 4));\n}\ninline v_float32x4 v_lut_pairs(const float* tab, const int* idx)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idx[0]],\n        tab[idx[0]+1],\n        tab[idx[1]],\n        tab[idx[1]+1]\n    };\n    return v_float32x4(vle_v_f32m1(elems, 4));\n}\ninline v_float32x4 v_lut_quads(const float* tab, const int* idx)\n{\n    return v_float32x4(vle_v_f32m1(tab + idx[0], 4));\n}\ninline v_float64x2 v_lut(const double* tab, const int* idx)\n{\n    vfloat64m1_t res = {tab[idx[0]], tab[idx[1]]};\n    return v_float64x2(res);\n}\ninline v_float64x2 v_lut_pairs(const double* tab, const int* idx)\n{\n    return v_float64x2(vle_v_f64m1(tab+idx[0], 2));\n}\n\ninline v_int32x4 v_lut(const int* tab, const v_int32x4& idxvec)\n{\n    int CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idxvec.val[0]],\n        tab[idxvec.val[1]],\n        tab[idxvec.val[2]],\n        tab[idxvec.val[3]]\n    };\n    return v_int32x4(vle_v_i32m1(elems, 4));\n}\n\ninline v_uint32x4 v_lut(const unsigned* tab, const v_int32x4& idxvec)\n{\n    unsigned CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idxvec.val[0]],\n        tab[idxvec.val[1]],\n        tab[idxvec.val[2]],\n        tab[idxvec.val[3]]\n    };\n    return v_uint32x4(vle_v_u32m1(elems, 4));\n}\n\ninline v_float32x4 v_lut(const float* tab, const v_int32x4& idxvec)\n{\n    float CV_DECL_ALIGNED(32) elems[4] =\n    {\n        tab[idxvec.val[0]],\n        tab[idxvec.val[1]],\n        tab[idxvec.val[2]],\n        tab[idxvec.val[3]]\n    };\n    return v_float32x4(vle_v_f32m1(elems, 4));\n}\ninline v_float64x2 v_lut(const double* tab, const v_int32x4& idxvec)\n{\n    vfloat64m1_t res = {tab[idxvec.val[0]], tab[idxvec.val[1]]};\n    return v_float64x2(res);\n}\ninline void v_lut_deinterleave(const float* tab, const v_int32x4& idxvec, v_float32x4& x, v_float32x4& y)\n{\n    vint32m1_t index_x = vmul_vx_i32m1(idxvec.val, 4, 4);\n    vint32m1_t index_y = vadd_vx_i32m1(index_x, 4, 4);\n\n    x.val = vlxe_v_f32m1(tab, index_x, 4);\n    y.val = vlxe_v_f32m1(tab, index_y, 4);\n}\n\ninline void v_lut_deinterleave(const double* tab, const v_int32x4& idxvec, v_float64x2& x, v_float64x2& y)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n\n    x = v_float64x2(tab[idx[0]], tab[idx[1]]);\n    y = v_float64x2(tab[idx[0]+1], tab[idx[1]+1]);\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_PACKS(_Tp, _Tp2, _T2, num2, _T1, num, intrin, shr, _Type) \\\ninline v_##_Tp##x##num v_pack(const v_##_Tp2##x##num2& a, const v_##_Tp2##x##num2& b) \\\n{ \\\n    v##_Tp2##m2_t  tmp = vundefined_##_T2##m2();    \\\n    tmp = vset_##_T2##m2(tmp, 0, a.val);    \\\n    tmp = vset_##_T2##m2(tmp, 1, b.val);    \\\n    return v_##_Tp##x##num(shr##_##_T1##m1(tmp, 0, num)); \\\n}\\\ntemplate<int n> inline \\\nv_##_Tp##x##num v_rshr_pack(const v_##_Tp2##x##num2& a, const v_##_Tp2##x##num2& b) \\\n{ \\\n    v##_Tp2##m2_t  tmp = vundefined_##_T2##m2();    \\\n    tmp = vset_##_T2##m2(tmp, 0, a.val);    \\\n    tmp = vset_##_T2##m2(tmp, 1, b.val);    \\\n    return v_##_Tp##x##num(intrin##_##_T1##m1(tmp, n, num)); \\\n}\\\ninline void v_pack_store(_Type* ptr, const v_##_Tp2##x##num2& a) \\\n{ \\\n    v##_Tp2##m2_t tmp = vundefined_##_T2##m2();    \\\n    tmp = vset_##_T2##m2(tmp, 0, a.val);    \\\n    tmp = vset_##_T2##m2(tmp, 1, vmv_v_x_##_T2##m1(0, num2));    \\\n    asm(\"\" ::: \"memory\");                                       \\\n    vse_v_##_T1##m1(ptr, shr##_##_T1##m1(tmp, 0, num), num2); \\\n}\\\ntemplate<int n> inline \\\nvoid v_rshr_pack_store(_Type* ptr, const v_##_Tp2##x##num2& a) \\\n{ \\\n    v##_Tp2##m2_t tmp = vundefined_##_T2##m2();    \\\n    tmp = vset_##_T2##m2(tmp, 0, a.val);    \\\n    tmp = vset_##_T2##m2(tmp, 1, vmv_v_x_##_T2##m1(0, num2));    \\\n    vse_v_##_T1##m1(ptr, intrin##_##_T1##m1(tmp, n, num), num2); \\\n}\nOPENCV_HAL_IMPL_RISCVV_PACKS(int8, int16, i16, 8, i8, 16, vnclip_vx, vnclip_vx, signed char)\nOPENCV_HAL_IMPL_RISCVV_PACKS(int16, int32, i32, 4, i16, 8, vnclip_vx, vnclip_vx, signed short)\nOPENCV_HAL_IMPL_RISCVV_PACKS(int32, int64, i64, 2, i32, 4, vnclip_vx, vnsra_vx, int)\nOPENCV_HAL_IMPL_RISCVV_PACKS(uint8, uint16, u16, 8, u8, 16, vnclipu_vx, vnclipu_vx, unsigned char)\nOPENCV_HAL_IMPL_RISCVV_PACKS(uint16, uint32, u32, 4, u16, 8, vnclipu_vx, vnclipu_vx, unsigned short)\nOPENCV_HAL_IMPL_RISCVV_PACKS(uint32, uint64, u64, 2, u32, 4, vnclipu_vx, vnsrl_vx, unsigned int)\n\n// pack boolean\ninline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b)\n{\n    vuint16m2_t tmp = vundefined_u16m2();    \\\n    tmp = vset_u16m2(tmp, 0, a.val);    \\\n    tmp = vset_u16m2(tmp, 1, b.val);    \\\n    return v_uint8x16(vnsrl_vx_u8m1(tmp, 0, 16));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b,\n                           const v_uint32x4& c, const v_uint32x4& d)\n{\n    vuint32m4_t vabcd = vundefined_u32m4();    \\\n    vuint16m2_t v16 = vundefined_u16m2();    \\\n    vabcd = vset_u32m4(vabcd, 0, a.val);    \\\n    vabcd = vset_u32m4(vabcd, 1, b.val);    \\\n    vabcd = vset_u32m4(vabcd, 2, c.val);    \\\n    vabcd = vset_u32m4(vabcd, 3, d.val);    \\\n    v16 = vnsrl_vx_u16m2(vabcd, 0, 16);\n    return v_uint8x16(vnsrl_vx_u8m1(v16, 0, 16));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c,\n                           const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f,\n                           const v_uint64x2& g, const v_uint64x2& h)\n{\n    vuint64m8_t v64 = vundefined_u64m8();    \\\n    vuint32m4_t v32 = vundefined_u32m4();    \\\n    vuint16m2_t v16 = vundefined_u16m2();    \\\n    v64 = vset_u64m8(v64, 0, a.val);    \\\n    v64 = vset_u64m8(v64, 1, b.val);    \\\n    v64 = vset_u64m8(v64, 2, c.val);    \\\n    v64 = vset_u64m8(v64, 3, d.val);    \\\n    v64 = vset_u64m8(v64, 4, e.val);    \\\n    v64 = vset_u64m8(v64, 5, f.val);    \\\n    v64 = vset_u64m8(v64, 6, g.val);    \\\n    v64 = vset_u64m8(v64, 7, h.val);    \\\n    v32 = vnsrl_vx_u32m4(v64, 0, 16);\n    v16 = vnsrl_vx_u16m2(v32, 0, 16);\n    return v_uint8x16(vnsrl_vx_u8m1(v16, 0, 16));\n}\n\n//inline v_uint8x16 v_pack_u(const v_int16x8& a, const v_int16x8& b) \\\n//{ \\\n//    int16xm2_u tmp;    \\\n//    tmp.m1[0] = (vint16m1_t)a.val;    \\\n//    tmp.m1[1] = (vint16m1_t)b.val;    \\\n//    e8xm1_t mask = (e8xm1_t)vmsge_vx_e16xm2_i16m2(tmp.v, 0, 16);\\\n//    return v_uint8x16(vnclipuvi_mask_u8m1_u16m2(vmv_v_x_u8m1(0, 16), (vuint16m2_t)tmp.v, 0, mask, 16));\n//}\n\n#define OPENCV_HAL_IMPL_RISCVV_PACK_U(tp1, num1, tp2, num2, _Tp) \\\ninline v_uint##tp1##x##num1 v_pack_u(const v_int##tp2##x##num2& a, const v_int##tp2##x##num2& b) \\\n{ \\\n    vint##tp2##m2_t tmp = vundefined_##i##tp2##m2();    \\\n    tmp = vset_##i##tp2##m2(tmp, 0, a.val);    \\\n    tmp = vset_##i##tp2##m2(tmp, 1, b.val);    \\\n    vint##tp2##m2_t val = vmax_vx_i##tp2##m2(tmp, 0, num1);\\\n    return v_uint##tp1##x##num1(vnclipu_vx_u##tp1##m1((vuint##tp2##m2_t)val, 0, num1));    \\\n} \\\ninline void v_pack_u_store(_Tp* ptr, const v_int##tp2##x##num2& a) \\\n{ \\\n    vint##tp2##m2_t tmp = vundefined_##i##tp2##m2();    \\\n    tmp = vset_##i##tp2##m2(tmp, 0, a.val);    \\\n    vint##tp2##m2_t val = vmax_vx_i##tp2##m2(tmp, 0, num1);\\\n    return vse_v_u##tp1##m1(ptr, vnclipu_vx_u##tp1##m1((vuint##tp2##m2_t)val, 0, num1), num2);    \\\n} \\\ntemplate<int n> inline \\\nv_uint##tp1##x##num1 v_rshr_pack_u(const v_int##tp2##x##num2& a, const v_int##tp2##x##num2& b) \\\n{ \\\n    vint##tp2##m2_t tmp = vundefined_##i##tp2##m2();    \\\n    tmp = vset_##i##tp2##m2(tmp, 0, a.val);    \\\n    tmp = vset_##i##tp2##m2(tmp, 1, b.val);    \\\n    vint##tp2##m2_t val = vmax_vx_i##tp2##m2(tmp, 0, num1);\\\n    return v_uint##tp1##x##num1(vnclipu_vx_u##tp1##m1((vuint##tp2##m2_t)val, n, num1));    \\\n} \\\ntemplate<int n> inline \\\nvoid v_rshr_pack_u_store(_Tp* ptr, const v_int##tp2##x##num2& a) \\\n{ \\\n    vint##tp2##m2_t tmp = vundefined_##i##tp2##m2();    \\\n    tmp = vset_##i##tp2##m2(tmp, 0, a.val);    \\\n    vint##tp2##m2_t val_ = vmax_vx_i##tp2##m2(tmp, 0, num1);\\\n    vuint##tp1##m1_t val = vnclipu_vx_u##tp1##m1((vuint##tp2##m2_t)val_, n, num1);    \\\n    return vse_v_u##tp1##m1(ptr, val, num2);\\\n}\nOPENCV_HAL_IMPL_RISCVV_PACK_U(8, 16, 16, 8, unsigned char )\nOPENCV_HAL_IMPL_RISCVV_PACK_U(16, 8, 32, 4, unsigned short)\n\n#ifdef __GNUC__\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wuninitialized\"\n#endif\n\n// saturating multiply 8-bit, 16-bit\n#define OPENCV_HAL_IMPL_RISCVV_MUL_SAT(_Tpvec, _Tpwvec)            \\\n    inline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b)  \\\n    {                                                            \\\n        _Tpwvec c, d;                                            \\\n        v_mul_expand(a, b, c, d);                                \\\n        return v_pack(c, d);                                     \\\n    }                                                            \\\n    inline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b)      \\\n    { a = a * b; return a; }\n\nOPENCV_HAL_IMPL_RISCVV_MUL_SAT(v_int8x16,  v_int16x8)\nOPENCV_HAL_IMPL_RISCVV_MUL_SAT(v_uint8x16, v_uint16x8)\nOPENCV_HAL_IMPL_RISCVV_MUL_SAT(v_int16x8,  v_int32x4)\nOPENCV_HAL_IMPL_RISCVV_MUL_SAT(v_uint16x8, v_uint32x4)\n\n#ifdef __GNUC__\n#pragma GCC diagnostic pop\n#endif\nstatic const signed char popCountTable[256] =\n{\n    0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8,\n};\n\ninline vuint8m1_t vcnt_u8(vuint8m1_t val){\n    vuint8m1_t v0 = val & 1;\n    return vlxe_v_u8m1((unsigned char*)popCountTable, val >> 1, 16)+v0;\n}\n\ninline v_uint8x16\nv_popcount(const v_uint8x16& a)\n{\n    return v_uint8x16(vcnt_u8(a.val));\n}\n\ninline v_uint8x16\nv_popcount(const v_int8x16& a)\n{\n    return v_uint8x16(vcnt_u8((vuint8m1_t)a.val));\n}\n\ninline v_uint16x8\nv_popcount(const v_uint16x8& a)\n{\n    vuint8m2_t tmp = vundefined_u8m2();\n    tmp = vset_u8m2(tmp, 0, vcnt_u8((vuint8m1_t)a.val));\n    vuint64m2_t mask = (vuint64m2_t){0x0E0C0A0806040200, 0, 0x0F0D0B0907050301, 0};\n    tmp = vrgather_vv_u8m2(tmp, (vuint8m2_t)mask, 32);    \\\n    vuint16m2_t res = vwaddu_vv_u16m2(vget_u8m2_u8m1(tmp, 0), vget_u8m2_u8m1(tmp, 1), 8);\n    return v_uint16x8(vget_u16m2_u16m1(res, 0));\n}\n\ninline v_uint16x8\nv_popcount(const v_int16x8& a)\n{\n    vuint8m2_t tmp = vundefined_u8m2();\n    tmp = vset_u8m2(tmp, 0, vcnt_u8((vuint8m1_t)a.val));\n    vuint64m2_t mask = (vuint64m2_t){0x0E0C0A0806040200, 0, 0x0F0D0B0907050301, 0};\n    tmp = vrgather_vv_u8m2(tmp, (vuint8m2_t)mask, 32);    \\\n    vuint16m2_t res = vwaddu_vv_u16m2(vget_u8m2_u8m1(tmp, 0), vget_u8m2_u8m1(tmp, 1), 8);\n    return v_uint16x8(vget_u16m2_u16m1(res, 0));\n}\n\ninline v_uint32x4\nv_popcount(const v_uint32x4& a)\n{\n    vuint8m2_t tmp = vundefined_u8m2();\n    tmp = vset_u8m2(tmp, 0, vcnt_u8((vuint8m1_t)a.val));\n    vuint64m2_t mask = (vuint64m2_t){0xFFFFFFFF0C080400, 0xFFFFFFFF0D090501,\n                     0xFFFFFFFF0E0A0602, 0xFFFFFFFF0F0B0703};\n    tmp = vrgather_vv_u8m2(tmp, (vuint8m2_t)mask, 32);    \\\n    vuint16m2_t res_ = vwaddu_vv_u16m2(vget_u8m2_u8m1(tmp, 0), vget_u8m2_u8m1(tmp, 1), 16);\n    vuint32m2_t res  = vwaddu_vv_u32m2(vget_u16m2_u16m1(res_, 0), vget_u16m2_u16m1(res_, 1), 8);\n    return v_uint32x4(vget_u32m2_u32m1(res, 0));\n}\n\ninline v_uint32x4\nv_popcount(const v_int32x4& a)\n{\n    vuint8m2_t tmp = vundefined_u8m2();\n    tmp = vset_u8m2(tmp, 0, vcnt_u8((vuint8m1_t)a.val));\n    vuint64m2_t mask = (vuint64m2_t){0xFFFFFFFF0C080400, 0xFFFFFFFF0D090501,\n                     0xFFFFFFFF0E0A0602, 0xFFFFFFFF0F0B0703};\n    tmp = vrgather_vv_u8m2(tmp, (vuint8m2_t)mask, 32);    \\\n    vuint16m2_t res_ = vwaddu_vv_u16m2(vget_u8m2_u8m1(tmp, 0), vget_u8m2_u8m1(tmp, 1), 16);\n    vuint32m2_t res  = vwaddu_vv_u32m2(vget_u16m2_u16m1(res_, 0), vget_u16m2_u16m1(res_, 1), 8);\n    return v_uint32x4(vget_u32m2_u32m1(res, 0));\n}\n\ninline v_uint64x2\nv_popcount(const v_uint64x2& a)\n{\n    vuint8m2_t tmp = vundefined_u8m2();\n    tmp = vset_u8m2(tmp, 0, vcnt_u8((vuint8m1_t)a.val));\n    vuint64m2_t mask = (vuint64m2_t){0x0706050403020100, 0x0000000000000000,\n                     0x0F0E0D0C0B0A0908, 0x0000000000000000};\n    tmp = vrgather_vv_u8m2(tmp, (vuint8m2_t)mask, 32);    \\\n    vuint8m1_t zero = vmv_v_x_u8m1(0, 16);\n    vuint8m1_t res1 = zero;\n    vuint8m1_t res2 = zero;\n    res1 = vredsum_vs_u8m1_u8m1(res1, vget_u8m2_u8m1(tmp, 0), zero, 8);\n    res2 = vredsum_vs_u8m1_u8m1(res2, vget_u8m2_u8m1(tmp, 1), zero, 8);\n\n    return v_uint64x2((unsigned long)vmv_x_s_u8m1_u8(res1, 8), (unsigned long)vmv_x_s_u8m1_u8(res2, 8));\n}\n\ninline v_uint64x2\nv_popcount(const v_int64x2& a)\n{\n    vuint8m2_t tmp = vundefined_u8m2();\n    tmp = vset_u8m2(tmp, 0, vcnt_u8((vuint8m1_t)a.val));\n    vuint64m2_t mask = (vuint64m2_t){0x0706050403020100, 0x0000000000000000,\n                     0x0F0E0D0C0B0A0908, 0x0000000000000000};\n    tmp = vrgather_vv_u8m2(tmp, (vuint8m2_t)mask, 32);    \\\n    vuint8m1_t zero = vmv_v_x_u8m1(0, 16);\n    vuint8m1_t res1 = zero;\n    vuint8m1_t res2 = zero;\n    res1 = vredsum_vs_u8m1_u8m1(res1, vget_u8m2_u8m1(tmp, 0), zero, 8);\n    res2 = vredsum_vs_u8m1_u8m1(res2, vget_u8m2_u8m1(tmp, 1), zero, 8);\n\n    return v_uint64x2((unsigned long)vmv_x_s_u8m1_u8(res1, 8), (unsigned long)vmv_x_s_u8m1_u8(res2, 8));\n}\n\n#define SMASK 1, 2, 4, 8, 16, 32, 64, 128\ninline int v_signmask(const v_uint8x16& a)\n{\n    vuint8m1_t t0  = vsrl_vx_u8m1(a.val, 7, 16);\n    vuint8m1_t m1  = (vuint8m1_t){SMASK, SMASK};\n    vuint16m2_t t1 = vwmulu_vv_u16m2(t0, m1, 16);\n    vuint32m1_t res = vmv_v_x_u32m1(0, 4);\n    vuint32m2_t t2 = vwmulu_vx_u32m2(vget_u16m2_u16m1(t1, 1), 256, 8);\n    res = vredsum_vs_u32m2_u32m1(res, t2, res, 8);\n    res = vwredsumu_vs_u16m1_u32m1(res, vget_u16m2_u16m1(t1, 0), res, 8);\n    return vmv_x_s_u32m1_u32(res, 8);\n}\ninline int v_signmask(const v_int8x16& a)\n{\n    vuint8m1_t t0 = vsrl_vx_u8m1((vuint8m1_t)a.val, 7, 16);\n    vuint8m1_t m1 = (vuint8m1_t){SMASK, SMASK};\n    vint16m2_t t1 = (vint16m2_t)vwmulu_vv_u16m2(t0, m1, 16);\n    vint32m1_t res = vmv_v_x_i32m1(0, 4);\n    vint32m2_t t2 = vwmul_vx_i32m2(vget_i16m2_i16m1(t1, 1), 256, 8);\n    res = vredsum_vs_i32m2_i32m1(res, t2, res, 8);\n    res = vwredsum_vs_i16m1_i32m1(res, vget_i16m2_i16m1(t1, 0), res, 8);\n    return vmv_x_s_i32m1_i32(res, 8);\n}\n\ninline int v_signmask(const v_int16x8& a)\n{\n    vint16m1_t t0 = (vint16m1_t)vsrl_vx_u16m1((vuint16m1_t)a.val, 15, 8);\n    vint16m1_t m1 = (vint16m1_t){SMASK};\n    vint16m1_t t1 = vmul_vv_i16m1(t0, m1, 8);\n    vint16m1_t res = vmv_v_x_i16m1(0, 8);\n    res = vredsum_vs_i16m1_i16m1(res, t1, res, 8);\n    return vmv_x_s_i16m1_i16(res, 8);\n}\ninline int v_signmask(const v_uint16x8& a)\n{\n    vint16m1_t t0 = (vint16m1_t)vsrl_vx_u16m1((vuint16m1_t)a.val, 15, 8);\n    vint16m1_t m1 = (vint16m1_t){SMASK};\n    vint16m1_t t1 = vmul_vv_i16m1(t0, m1, 8);\n    vint16m1_t res = vmv_v_x_i16m1(0, 8);\n    res = vredsum_vs_i16m1_i16m1(res, t1, res, 8);\n    return vmv_x_s_i16m1_i16(res, 8);\n}\ninline int v_signmask(const v_int32x4& a)\n{\n    vint32m1_t t0 = (vint32m1_t)vsrl_vx_u32m1((vuint32m1_t)a.val, 31, 4);\n    vint32m1_t m1 = (vint32m1_t){1, 2, 4, 8};\n    vint32m1_t res = vmv_v_x_i32m1(0, 4);\n    vint32m1_t t1 = vmul_vv_i32m1(t0, m1, 4);\n    res = vredsum_vs_i32m1_i32m1(res, t1, res, 4);\n    return vmv_x_s_i32m1_i32(res, 4);\n}\ninline int v_signmask(const v_uint32x4& a)\n{\n    vint32m1_t t0 = (vint32m1_t)vsrl_vx_u32m1(a.val, 31, 4);\n    vint32m1_t m1 = (vint32m1_t){1, 2, 4, 8};\n    vint32m1_t res = vmv_v_x_i32m1(0, 4);\n    vint32m1_t t1 = vmul_vv_i32m1(t0, m1, 4);\n    res = vredsum_vs_i32m1_i32m1(res, t1, res, 4);\n    return vmv_x_s_i32m1_i32(res, 4);\n}\ninline int v_signmask(const v_uint64x2& a)\n{\n    vuint64m1_t v0 = vsrl_vx_u64m1(a.val, 63, 2);\n    int res = (int)vext_x_v_u64m1_u64(v0, 0, 2) + ((int)vext_x_v_u64m1_u64(v0, 1, 2) << 1);\n    return res;\n}\ninline int v_signmask(const v_int64x2& a)\n{ return v_signmask(v_reinterpret_as_u64(a)); }\ninline int v_signmask(const v_float64x2& a)\n{ return v_signmask(v_reinterpret_as_u64(a)); }\ninline int v_signmask(const v_float32x4& a)\n{\n    vint32m1_t t0 = (vint32m1_t)vsrl_vx_u32m1((vuint32m1_t)a.val, 31, 4);\n    vint32m1_t m1 = (vint32m1_t){1, 2, 4, 8};\n    vint32m1_t res = vmv_v_x_i32m1(0, 4);\n    vint32m1_t t1 = vmul_vv_i32m1(t0, m1, 4);\n    res = vredsum_vs_i32m1_i32m1(res, t1, res, 4);\n    return vmv_x_s_i32m1_i32(res, 4);\n}\n\ninline int v_scan_forward(const v_int8x16& a) {\nint val = v_signmask(a);\nif(val==0) return 0;\nelse return trailingZeros32(val); }\ninline int v_scan_forward(const v_uint8x16& a) {\nint val = v_signmask(a);\nif(val==0) return 0;\nelse return trailingZeros32(val); }\ninline int v_scan_forward(const v_int16x8& a) {\nint val = v_signmask(a);\nif(val==0) return 0;\nelse return trailingZeros32(val); }\ninline int v_scan_forward(const v_uint16x8& a) {\nint val = v_signmask(a);\nif(val==0) return 0;\nelse return trailingZeros32(val); }\ninline int v_scan_forward(const v_int32x4& a) {\nint val = v_signmask(a);\nif(val==0) return 0;\nelse return trailingZeros32(val); }\ninline int v_scan_forward(const v_uint32x4& a) {\nint val = v_signmask(a);\nif(val==0) return 0;\nelse return trailingZeros32(val); }\ninline int v_scan_forward(const v_float32x4& a) {\nint val = v_signmask(a);\nif(val==0) return 0;\nelse return trailingZeros32(val); }\ninline int v_scan_forward(const v_int64x2& a) {\nint val = v_signmask(a);\nif(val==0) return 0;\nelse return trailingZeros32(val); }\ninline int v_scan_forward(const v_uint64x2& a) {\nint val = v_signmask(a);\nif(val==0) return 0;\nelse return trailingZeros32(val); }\n\n#define OPENCV_HAL_IMPL_RISCVV_CHECK_ALLANY(_Tpvec, suffix, _T, shift, num) \\\ninline bool v_check_all(const v_##_Tpvec& a) \\\n{ \\\n    suffix##m1_t v0 = vsrl_vx_##_T(vnot_v_##_T(a.val, num), shift, num); \\\n    vuint64m1_t v1 = vuint64m1_t(v0); \\\n    return (v1[0] | v1[1]) == 0; \\\n} \\\ninline bool v_check_any(const v_##_Tpvec& a) \\\n{ \\\n    suffix##m1_t v0 = vsrl_vx_##_T(a.val, shift, num); \\\n    vuint64m1_t v1 = vuint64m1_t(v0); \\\n    return (v1[0] | v1[1]) != 0; \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_CHECK_ALLANY(uint8x16, vuint8,  u8m1, 7, 16)\nOPENCV_HAL_IMPL_RISCVV_CHECK_ALLANY(uint16x8, vuint16, u16m1, 15, 8)\nOPENCV_HAL_IMPL_RISCVV_CHECK_ALLANY(uint32x4, vuint32, u32m1, 31, 4)\nOPENCV_HAL_IMPL_RISCVV_CHECK_ALLANY(uint64x2, vuint64, u64m1, 63, 2)\n\ninline bool v_check_all(const v_int8x16& a)\n{ return v_check_all(v_reinterpret_as_u8(a)); }\ninline bool v_check_all(const v_int16x8& a)\n{ return v_check_all(v_reinterpret_as_u16(a)); }\ninline bool v_check_all(const v_int32x4& a)\n{ return v_check_all(v_reinterpret_as_u32(a)); }\ninline bool v_check_all(const v_float32x4& a)\n{ return v_check_all(v_reinterpret_as_u32(a)); }\ninline bool v_check_all(const v_int64x2& a)\n{ return v_check_all(v_reinterpret_as_u64(a)); }\ninline bool v_check_all(const v_float64x2& a)\n{ return v_check_all(v_reinterpret_as_u64(a)); }\n\ninline bool v_check_any(const v_int8x16& a)\n{ return v_check_any(v_reinterpret_as_u8(a)); }\ninline bool v_check_any(const v_int16x8& a)\n{ return v_check_any(v_reinterpret_as_u16(a)); }\ninline bool v_check_any(const v_int32x4& a)\n{ return v_check_any(v_reinterpret_as_u32(a)); }\ninline bool v_check_any(const v_float32x4& a)\n{ return v_check_any(v_reinterpret_as_u32(a)); }\ninline bool v_check_any(const v_int64x2& a)\n{ return v_check_any(v_reinterpret_as_u64(a)); }\ninline bool v_check_any(const v_float64x2& a)\n{ return v_check_any(v_reinterpret_as_u64(a)); }\n\n#define OPENCV_HAL_IMPL_RISCVV_SELECT(_Tpvec, suffix, _Tpvec2, num) \\\ninline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(vmerge_vvm_##suffix(_Tpvec2(mask.val), b.val, a.val, num)); \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_SELECT(v_int8x16,  i8m1, vbool8_t, 16)\nOPENCV_HAL_IMPL_RISCVV_SELECT(v_int16x8,  i16m1, vbool16_t, 8)\nOPENCV_HAL_IMPL_RISCVV_SELECT(v_int32x4,  i32m1, vbool32_t, 4)\nOPENCV_HAL_IMPL_RISCVV_SELECT(v_uint8x16, u8m1, vbool8_t, 16)\nOPENCV_HAL_IMPL_RISCVV_SELECT(v_uint16x8, u16m1, vbool16_t, 8)\nOPENCV_HAL_IMPL_RISCVV_SELECT(v_uint32x4, u32m1, vbool32_t, 4)\ninline v_float32x4 v_select(const v_float32x4& mask, const v_float32x4& a, const v_float32x4& b)\n{\n    return v_float32x4((vfloat32m1_t)vmerge_vvm_u32m1((vbool32_t)mask.val, (vuint32m1_t)b.val, (vuint32m1_t)a.val, 4));\n}\ninline v_float64x2 v_select(const v_float64x2& mask, const v_float64x2& a, const v_float64x2& b)\n{\n    return v_float64x2((vfloat64m1_t)vmerge_vvm_u64m1((vbool64_t)mask.val, (vuint64m1_t)b.val, (vuint64m1_t)a.val, 2));\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_EXPAND(add, _Tpvec, _Tpwvec, _Tp, _Tp1, num1, _Tp2, num2, _T1, _T2) \\\ninline void v_expand(const _Tpvec& a, v_##_Tpwvec& b0, v_##_Tpwvec& b1) \\\n{ \\\n    _T1##_t b = vw##add##_vv_##_Tp2##m2(a.val, vmv_v_x_##_Tp1(0, num1), num1);    \\\n    b0.val = vget_##_Tp2##m2_##_Tp2##m1(b, 0);  \\\n    b1.val = vget_##_Tp2##m2_##_Tp2##m1(b, 1);  \\\n} \\\ninline v_##_Tpwvec v_expand_low(const _Tpvec& a) \\\n{ \\\n    _T1##_t b = vw##add##_vv_##_Tp2##m2(a.val, vmv_v_x_##_Tp1(0, num2), num2);    \\\n    return v_##_Tpwvec(vget_##_Tp2##m2_##_Tp2##m1(b, 0)); \\\n} \\\ninline v_##_Tpwvec v_expand_high(const _Tpvec& a) \\\n{ \\\n    _T1##_t b = vw##add##_vv_##_Tp2##m2(a.val, vmv_v_x_##_Tp1(0, num1), num1);    \\\n    return v_##_Tpwvec(vget_##_Tp2##m2_##_Tp2##m1(b, 1)); \\\n} \\\ninline v_##_Tpwvec v_load_expand(const _Tp* ptr) \\\n{ \\\n    _T2##_t val = vle##_v_##_Tp1(ptr, num2);    \\\n    _T1##_t b = vw##add##_vv_##_Tp2##m2(val, vmv_v_x_##_Tp1(0, num2), num2);    \\\n    return v_##_Tpwvec(vget_##_Tp2##m2_##_Tp2##m1(b, 0)); \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_EXPAND(addu, v_uint8x16, uint16x8, uchar, u8m1, 16, u16, 8, vuint16m2, vuint8m1)\nOPENCV_HAL_IMPL_RISCVV_EXPAND(addu, v_uint16x8, uint32x4, ushort,  u16m1, 8, u32, 4, vuint32m2, vuint16m1)\nOPENCV_HAL_IMPL_RISCVV_EXPAND(addu, v_uint32x4, uint64x2, uint,  u32m1, 4, u64, 2, vuint64m2, vuint32m1)\nOPENCV_HAL_IMPL_RISCVV_EXPAND(add, v_int8x16, int16x8, schar,  i8m1, 16, i16, 8, vint16m2, vint8m1)\nOPENCV_HAL_IMPL_RISCVV_EXPAND(add, v_int16x8, int32x4, short,  i16m1, 8, i32, 4, vint32m2, vint16m1)\nOPENCV_HAL_IMPL_RISCVV_EXPAND(add, v_int32x4, int64x2, int,  i32m1, 4, i64, 2, vint64m2, vint32m1)\n\ninline v_uint32x4 v_load_expand_q(const uchar* ptr)\n{\n    vuint16m2_t b = vundefined_u16m2();\n    vuint32m2_t c = vundefined_u32m2();\n    vuint8m1_t val = vle_v_u8m1(ptr, 4);    \\\n    b = vwaddu_vv_u16m2(val, vmv_v_x_u8m1(0, 4), 4);    \\\n    c = vwaddu_vv_u32m2(vget_u16m2_u16m1(b, 0), vmv_v_x_u16m1(0, 4), 4);    \\\n    return v_uint32x4(vget_u32m2_u32m1(c, 0));\n}\n\ninline v_int32x4 v_load_expand_q(const schar* ptr)\n{\n    vint16m2_t b = vundefined_i16m2();\n    vint32m2_t c = vundefined_i32m2();\n    vint8m1_t val = vle_v_i8m1(ptr, 4);    \\\n    b = vwadd_vv_i16m2(val, vmv_v_x_i8m1(0, 4), 4);    \\\n    c = vwadd_vv_i32m2(vget_i16m2_i16m1(b, 0), vmv_v_x_i16m1(0, 4), 4);    \\\n    return v_int32x4(vget_i32m2_i32m1(c, 0));\n}\n#define VITL_16 (vuint64m2_t){0x1303120211011000, 0x1707160615051404, 0x1B0B1A0A19091808, 0x1F0F1E0E1D0D1C0C}\n#define VITL_8 (vuint64m2_t){0x0009000100080000, 0x000B0003000A0002, 0x000D0005000C0004, 0x000F0007000E0006}\n#define VITL_4 (vuint64m2_t){0x0000000400000000, 0x0000000500000001, 0x0000000600000002, 0x0000000700000003}\n#define VITL_2 (vuint64m2_t){0, 2, 1, 3}\n#define LOW_4  0x0000000100000000, 0x0000000500000004\n#define LOW_8  0x0003000200010000, 0x000B000A00090008\n#define LOW_16 0x0706050403020100, 0x1716151413121110\n#define HIGH_4  0x0000000300000002, 0x0000000700000006\n#define HIGH_8  0x0007000600050004, 0x000F000E000D000C\n#define HIGH_16 0x0F0E0D0C0B0A0908,  0x1F1E1D1C1B1A1918\n#define OPENCV_HAL_IMPL_RISCVV_UNPACKS(_Tpvec, _Tp, _T, _UTp, _UT, num, num2, len, numh) \\\ninline void v_zip(const v_##_Tpvec& a0, const v_##_Tpvec& a1, v_##_Tpvec& b0, v_##_Tpvec& b1) \\\n{ \\\n    v##_Tp##m2_t tmp = vundefined_##_T##m2();\\\n    tmp = vset_##_T##m2(tmp, 0, a0.val); \\\n    tmp = vset_##_T##m2(tmp, 1, a1.val); \\\n    vuint64m2_t mask = VITL_##num;    \\\n    tmp = (v##_Tp##m2_t)vrgather_vv_##_T##m2((v##_Tp##m2_t)tmp, (v##_UTp##m2_t)mask, num2);    \\\n    b0.val = vget_##_T##m2_##_T##m1(tmp, 0); \\\n    b1.val = vget_##_T##m2_##_T##m1(tmp, 1); \\\n} \\\ninline v_##_Tpvec v_combine_low(const v_##_Tpvec& a, const v_##_Tpvec& b) \\\n{ \\\n    v##_Tp##m1_t b0 = vslideup_vx_##_T##m1_m(vmset_m_##len(num), a.val, b.val, numh, num);    \\\n    return v_##_Tpvec(b0);\\\n} \\\ninline v_##_Tpvec v_combine_high(const v_##_Tpvec& a, const v_##_Tpvec& b) \\\n{ \\\n    v##_Tp##m1_t b0 = vslidedown_vx_##_T##m1(b.val, numh, num);    \\\n    v##_Tp##m1_t a0 = vslidedown_vx_##_T##m1(a.val, numh, num);    \\\n    v##_Tp##m1_t b1 = vslideup_vx_##_T##m1_m(vmset_m_##len(num), a0, b0, numh, num);    \\\n    return v_##_Tpvec(b1);\\\n} \\\ninline void v_recombine(const v_##_Tpvec& a, const v_##_Tpvec& b, v_##_Tpvec& c, v_##_Tpvec& d) \\\n{ \\\n    c.val = vslideup_vx_##_T##m1_m(vmset_m_##len(num), a.val, b.val, numh, num);    \\\n    v##_Tp##m1_t b0 = vslidedown_vx_##_T##m1(b.val, numh, num);    \\\n    v##_Tp##m1_t a0 = vslidedown_vx_##_T##m1(a.val, numh, num);    \\\n    d.val = vslideup_vx_##_T##m1_m(vmset_m_##len(num), a0, b0, numh, num);    \\\n}\n\nOPENCV_HAL_IMPL_RISCVV_UNPACKS(uint8x16, uint8, u8, uint8, u8, 16, 32, b8, 8)\nOPENCV_HAL_IMPL_RISCVV_UNPACKS(int8x16, int8, i8, uint8, u8, 16, 32, b8, 8)\nOPENCV_HAL_IMPL_RISCVV_UNPACKS(uint16x8, uint16, u16, uint16, u16, 8, 16, b16, 4)\nOPENCV_HAL_IMPL_RISCVV_UNPACKS(int16x8, int16, i16, uint16, u16, 8, 16, b16, 4)\nOPENCV_HAL_IMPL_RISCVV_UNPACKS(uint32x4, uint32, u32, uint32, u32, 4, 8, b32, 2)\nOPENCV_HAL_IMPL_RISCVV_UNPACKS(int32x4, int32, i32, uint32, u32, 4, 8, b32, 2)\nOPENCV_HAL_IMPL_RISCVV_UNPACKS(float32x4, float32, f32, uint32, u32, 4, 8, b32, 2)\nOPENCV_HAL_IMPL_RISCVV_UNPACKS(float64x2, float64, f64, uint64, u64, 2, 4, b64, 1)\n\ninline v_uint8x16 v_reverse(const v_uint8x16 &a)\n{\n    vuint64m1_t mask = (vuint64m1_t){0x08090A0B0C0D0E0F, 0x0001020304050607};\n    return v_uint8x16(vrgather_vv_u8m1(a.val, (vuint8m1_t)mask, 16));\n}\ninline v_int8x16 v_reverse(const v_int8x16 &a)\n{\n    vint64m1_t mask = (vint64m1_t){0x08090A0B0C0D0E0F, 0x0001020304050607};\n    return v_int8x16(vrgather_vv_i8m1(a.val, (vuint8m1_t)mask, 16));\n}\n\ninline v_uint16x8 v_reverse(const v_uint16x8 &a)\n{\n    vuint64m1_t mask = (vuint64m1_t){0x0004000500060007, 0x000000100020003};\n    return v_uint16x8(vrgather_vv_u16m1(a.val, (vuint16m1_t)mask, 8));\n}\n\ninline v_int16x8 v_reverse(const v_int16x8 &a)\n{\n    vint64m1_t mask = (vint64m1_t){0x0004000500060007, 0x000000100020003};\n    return v_int16x8(vrgather_vv_i16m1(a.val, (vuint16m1_t)mask, 8));\n}\ninline v_uint32x4 v_reverse(const v_uint32x4 &a)\n{\n    return v_uint32x4(vrgather_vv_u32m1(a.val, (vuint32m1_t){3, 2, 1, 0}, 4));\n}\n\ninline v_int32x4 v_reverse(const v_int32x4 &a)\n{\n    return v_int32x4(vrgather_vv_i32m1(a.val, (vuint32m1_t){3, 2, 1, 0}, 4));\n}\n\ninline v_float32x4 v_reverse(const v_float32x4 &a)\n{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_uint64x2 v_reverse(const v_uint64x2 &a)\n{\n    return v_uint64x2(a.val[1], a.val[0]);\n}\n\ninline v_int64x2 v_reverse(const v_int64x2 &a)\n{\n    return v_int64x2(a.val[1], a.val[0]);\n}\n\ninline v_float64x2 v_reverse(const v_float64x2 &a)\n{\n    return v_float64x2(a.val[1], a.val[0]);\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_EXTRACT(_Tpvec, suffix, size) \\\ntemplate <int n> \\\ninline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) \\\n{ return v_rotate_right<n>(a, b);}\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_uint8x16, u8, 0)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_int8x16, s8, 0)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_uint16x8, u16, 1)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_int16x8, s16, 1)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_uint32x4, u32, 2)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_int32x4, s32, 2)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_uint64x2, u64, 3)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_int64x2, s64, 3)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_float32x4, f32, 2)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT(v_float64x2, f64, 3)\n\n\n#define OPENCV_HAL_IMPL_RISCVV_EXTRACT_N(_Tpvec, _Tp, suffix) \\\ntemplate<int i> inline _Tp v_extract_n(_Tpvec v) { return v.val[i]; }\n\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_int8x16, schar, s8)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_int16x8, short, s16)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_uint32x4, uint, u32)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_int32x4, int, s32)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_int64x2, int64, s64)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_float32x4, float, f32)\nOPENCV_HAL_IMPL_RISCVV_EXTRACT_N(v_float64x2, double, f64)\n\n#define OPENCV_HAL_IMPL_RISCVV_BROADCAST(_Tpvec, _Tp, num) \\\ntemplate<int i> inline _Tpvec v_broadcast_element(_Tpvec v) { return _Tpvec(vrgather_vx_##_Tp##m1(v.val, i, num)); }\n\nOPENCV_HAL_IMPL_RISCVV_BROADCAST(v_uint8x16, u8, 16)\nOPENCV_HAL_IMPL_RISCVV_BROADCAST(v_int8x16, i8, 16)\nOPENCV_HAL_IMPL_RISCVV_BROADCAST(v_uint16x8, u16, 8)\nOPENCV_HAL_IMPL_RISCVV_BROADCAST(v_int16x8, i16, 8)\nOPENCV_HAL_IMPL_RISCVV_BROADCAST(v_uint32x4, u32, 4)\nOPENCV_HAL_IMPL_RISCVV_BROADCAST(v_int32x4, i32, 4)\nOPENCV_HAL_IMPL_RISCVV_BROADCAST(v_uint64x2, u64, 2)\nOPENCV_HAL_IMPL_RISCVV_BROADCAST(v_int64x2, i64, 2)\nOPENCV_HAL_IMPL_RISCVV_BROADCAST(v_float32x4, f32, 4)\ninline v_int32x4 v_round(const v_float32x4& a)\n{\n    __builtin_riscv_fsrm(0);\n    vint32m1_t nan = vand_vx_i32m1((vint32m1_t)a.val, 0x7f800000, 4);\n    vbool32_t mask = vmsne_vx_i32m1_b32(nan, 0x7f800000, 4);\n    vint32m1_t val = vfcvt_x_f_v_i32m1_m(mask, vmv_v_x_i32m1(0, 4), a.val, 4);\n    __builtin_riscv_fsrm(0);\n    return v_int32x4(val);\n}\ninline v_int32x4 v_floor(const v_float32x4& a)\n{\n    __builtin_riscv_fsrm(2);\n    vint32m1_t nan = vand_vx_i32m1((vint32m1_t)a.val, 0x7f800000, 4);\n    vbool32_t mask = vmsne_vx_i32m1_b32(nan, 0x7f800000, 4);\n    vint32m1_t val = vfcvt_x_f_v_i32m1_m(mask, vmv_v_x_i32m1(0, 4), a.val, 4);\n    __builtin_riscv_fsrm(0);\n    return v_int32x4(val);\n}\n\ninline v_int32x4 v_ceil(const v_float32x4& a)\n{\n    __builtin_riscv_fsrm(3);\n    vint32m1_t nan = vand_vx_i32m1((vint32m1_t)a.val, 0x7f800000, 4);\n    vbool32_t mask = vmsne_vx_i32m1_b32(nan, 0x7f800000, 4);\n    vint32m1_t val = vfcvt_x_f_v_i32m1_m(mask, vmv_v_x_i32m1(0, 4), a.val, 4);\n    __builtin_riscv_fsrm(0);\n    return v_int32x4(val);\n}\n\ninline v_int32x4 v_trunc(const v_float32x4& a)\n{\n    __builtin_riscv_fsrm(1);\n    vint32m1_t nan = vand_vx_i32m1((vint32m1_t)a.val, 0x7f800000, 4);\n    vbool32_t mask = vmsne_vx_i32m1_b32(nan, 0x7f800000, 4);\n    vint32m1_t val = vfcvt_x_f_v_i32m1_m(mask, vmv_v_x_i32m1(0, 4), a.val, 4);\n    __builtin_riscv_fsrm(0);\n    return v_int32x4(val);\n}\n\ninline v_int32x4 v_round(const v_float64x2& a)\n{\n    __builtin_riscv_fsrm(0);\n    vfloat64m2_t _val = vundefined_f64m2();\n    _val = vset_f64m2(_val, 0, a.val);\n    //_val = vset_f64m2(_val, 1, a.val);\n    _val = vset_f64m2(_val, 1, vfmv_v_f_f64m1(0, 2));\n    vint32m1_t val = vfncvt_x_f_v_i32m1(_val, 4);\n    __builtin_riscv_fsrm(0);\n    return v_int32x4(val);\n}\ninline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b)\n{\n    __builtin_riscv_fsrm(0);\n    vfloat64m2_t _val = vundefined_f64m2();\n    _val = vset_f64m2(_val, 0, a.val);\n    _val = vset_f64m2(_val, 1, b.val);\n    vint32m1_t val = vfncvt_x_f_v_i32m1(_val, 4);\n    __builtin_riscv_fsrm(0);\n    return v_int32x4(val);\n}\ninline v_int32x4 v_floor(const v_float64x2& a)\n{\n    __builtin_riscv_fsrm(2);\n    vfloat64m2_t _val = vundefined_f64m2();\n    _val = vset_f64m2(_val, 0, a.val);\n    vfloat32m1_t aval = vfncvt_f_f_v_f32m1(_val, 2);\n\n    vint32m1_t nan = vand_vx_i32m1((vint32m1_t)aval, 0x7f800000, 4);\n    vbool32_t mask = vmsne_vx_i32m1_b32(nan, 0x7f800000, 4);\n    vint32m1_t val = vfcvt_x_f_v_i32m1_m(mask, vmv_v_x_i32m1(0, 4), aval, 4);\n    __builtin_riscv_fsrm(0);\n    return v_int32x4(val);\n}\n\ninline v_int32x4 v_ceil(const v_float64x2& a)\n{\n    __builtin_riscv_fsrm(3);\n    vfloat64m2_t _val = vundefined_f64m2();\n    _val = vset_f64m2(_val, 0, a.val);\n    vfloat32m1_t aval = vfncvt_f_f_v_f32m1(_val, 2);\n\n    vint32m1_t nan = vand_vx_i32m1((vint32m1_t)aval, 0x7f800000, 4);\n    vbool32_t mask = vmsne_vx_i32m1_b32(nan, 0x7f800000, 4);\n    vint32m1_t val = vfcvt_x_f_v_i32m1_m(mask, vmv_v_x_i32m1(0, 4), aval, 4);\n    __builtin_riscv_fsrm(0);\n    return v_int32x4(val);\n}\n\ninline v_int32x4 v_trunc(const v_float64x2& a)\n{\n    __builtin_riscv_fsrm(1);\n    vfloat64m2_t _val = vundefined_f64m2();\n    _val = vset_f64m2(_val, 0, a.val);\n    vfloat32m1_t aval = vfncvt_f_f_v_f32m1(_val, 2);\n\n    vint32m1_t nan = vand_vx_i32m1((vint32m1_t)aval, 0x7f800000, 4);\n    vbool32_t mask = vmsne_vx_i32m1_b32(nan, 0x7f800000, 4);\n    vint32m1_t val = vfcvt_x_f_v_i32m1_m(mask, vmv_v_x_i32m1(0, 4), aval, 4);\n    __builtin_riscv_fsrm(0);\n    return v_int32x4(val);\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_LOAD_DEINTERLEAVED(intrin, _Tpvec, num, _Tp, _T)    \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec##x##num& a, v_##_Tpvec##x##num& b) \\\n{ \\\n    v##_Tpvec##m1x2_t ret = intrin##2e_v_##_T##m1x2(ptr, num);\\\n    a.val = vget_##_T##m1x2_##_T##m1(ret, 0);  \\\n    b.val = vget_##_T##m1x2_##_T##m1(ret, 1);  \\\n} \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec##x##num& a, v_##_Tpvec##x##num& b, v_##_Tpvec##x##num& c) \\\n{ \\\n    v##_Tpvec##m1x3_t ret = intrin##3e_v_##_T##m1x3(ptr, num);\\\n    a.val = vget_##_T##m1x3_##_T##m1(ret, 0);  \\\n    b.val = vget_##_T##m1x3_##_T##m1(ret, 1);  \\\n    c.val = vget_##_T##m1x3_##_T##m1(ret, 2);  \\\n}\\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec##x##num& a, v_##_Tpvec##x##num& b, \\\n                                v_##_Tpvec##x##num& c, v_##_Tpvec##x##num& d) \\\n{ \\\n    v##_Tpvec##m1x4_t ret = intrin##4e_v_##_T##m1x4(ptr, num);\\\n    a.val = vget_##_T##m1x4_##_T##m1(ret, 0);  \\\n    b.val = vget_##_T##m1x4_##_T##m1(ret, 1);  \\\n    c.val = vget_##_T##m1x4_##_T##m1(ret, 2);  \\\n    d.val = vget_##_T##m1x4_##_T##m1(ret, 3);  \\\n} \\\n\n#define OPENCV_HAL_IMPL_RISCVV_STORE_INTERLEAVED(intrin, _Tpvec, num, _Tp, _T)    \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec##x##num& a, const v_##_Tpvec##x##num& b, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    v##_Tpvec##m1x2_t ret = vundefined_##_T##m1x2();      \\\n    ret = vset_##_T##m1x2(ret, 0, a.val);  \\\n    ret = vset_##_T##m1x2(ret, 1, b.val);  \\\n    intrin##2e_v_##_T##m1x2(ptr, ret, num); \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec##x##num& a, const v_##_Tpvec##x##num& b, \\\n                                const v_##_Tpvec##x##num& c, hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    v##_Tpvec##m1x3_t ret = vundefined_##_T##m1x3();       \\\n    ret = vset_##_T##m1x3(ret, 0, a.val);  \\\n    ret = vset_##_T##m1x3(ret, 1, b.val);  \\\n    ret = vset_##_T##m1x3(ret, 2, c.val);  \\\n    intrin##3e_v_##_T##m1x3(ptr, ret, num); \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec##x##num& a, const v_##_Tpvec##x##num& b, \\\n                                const v_##_Tpvec##x##num& c, const v_##_Tpvec##x##num& d, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED ) \\\n{ \\\n    v##_Tpvec##m1x4_t ret = vundefined_##_T##m1x4();             \\\n    ret = vset_##_T##m1x4(ret, 0, a.val);  \\\n    ret = vset_##_T##m1x4(ret, 1, b.val);  \\\n    ret = vset_##_T##m1x4(ret, 2, c.val);  \\\n    ret = vset_##_T##m1x4(ret, 3, d.val);  \\\n    intrin##4e_v_##_T##m1x4(ptr, ret, num); \\\n}\n\n#define OPENCV_HAL_IMPL_RISCVV_INTERLEAVED(_Tpvec, _Tp, num, ld, st, _T) \\\nOPENCV_HAL_IMPL_RISCVV_LOAD_DEINTERLEAVED(ld, _Tpvec, num, _Tp, _T)    \\\nOPENCV_HAL_IMPL_RISCVV_STORE_INTERLEAVED(st, _Tpvec, num, _Tp, _T)\n\n//OPENCV_HAL_IMPL_RISCVV_INTERLEAVED(uint8, uchar, )\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED(int8, schar, 16, vlseg, vsseg, i8)\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED(int16, short, 8, vlseg, vsseg, i16)\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED(int32, int, 4, vlseg, vsseg, i32)\n\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED(uint8, unsigned char, 16, vlseg, vsseg, u8)\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED(uint16, unsigned short, 8, vlseg, vsseg, u16)\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED(uint32, unsigned int, 4, vlseg, vsseg, u32)\n\n#define OPENCV_HAL_IMPL_RISCVV_INTERLEAVED_(_Tpvec, _Tp, num, _T) \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec##x##num& a, v_##_Tpvec##x##num& b) \\\n{ \\\n    v##_Tpvec##m1x2_t ret = vlseg2e_v_##_T##m1x2(ptr, num); \\\n    a.val = vget_##_T##m1x2_##_T##m1(ret, 0);  \\\n    b.val = vget_##_T##m1x2_##_T##m1(ret, 1);  \\\n} \\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec##x##num& a, v_##_Tpvec##x##num& b, v_##_Tpvec##x##num& c) \\\n{ \\\n    v##_Tpvec##m1x3_t ret = vlseg3e_v_##_T##m1x3(ptr, num);    \\\n    a.val = vget_##_T##m1x3_##_T##m1(ret, 0);  \\\n    b.val = vget_##_T##m1x3_##_T##m1(ret, 1);  \\\n    c.val = vget_##_T##m1x3_##_T##m1(ret, 2);  \\\n}\\\ninline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec##x##num& a, v_##_Tpvec##x##num& b, \\\n                                v_##_Tpvec##x##num& c, v_##_Tpvec##x##num& d) \\\n{ \\\n    v##_Tpvec##m1x4_t ret = vlseg4e_v_##_T##m1x4(ptr, num);    \\\n    a.val = vget_##_T##m1x4_##_T##m1(ret, 0);  \\\n    b.val = vget_##_T##m1x4_##_T##m1(ret, 1);  \\\n    c.val = vget_##_T##m1x4_##_T##m1(ret, 2);  \\\n    d.val = vget_##_T##m1x4_##_T##m1(ret, 3);  \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec##x##num& a, const v_##_Tpvec##x##num& b, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    v##_Tpvec##m1x2_t ret = vundefined_##_T##m1x2();    \\\n    ret = vset_##_T##m1x2(ret, 0, a.val);  \\\n    ret = vset_##_T##m1x2(ret, 1, b.val);  \\\n    vsseg2e_v_##_T##m1x2(ptr, ret, num);    \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec##x##num& a, const v_##_Tpvec##x##num& b, \\\n                                const v_##_Tpvec##x##num& c, hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ \\\n    v##_Tpvec##m1x3_t ret = vundefined_##_T##m1x3();    \\\n    ret = vset_##_T##m1x3(ret, 0, a.val);  \\\n    ret = vset_##_T##m1x3(ret, 1, b.val);  \\\n    ret = vset_##_T##m1x3(ret, 2, c.val);  \\\n    vsseg3e_v_##_T##m1x3(ptr, ret, num);    \\\n} \\\ninline void v_store_interleave( _Tp* ptr, const v_##_Tpvec##x##num& a, const v_##_Tpvec##x##num& b, \\\n                                const v_##_Tpvec##x##num& c, const v_##_Tpvec##x##num& d, \\\n                                hal::StoreMode /*mode*/=hal::STORE_UNALIGNED ) \\\n{ \\\n    v##_Tpvec##m1x4_t ret = vundefined_##_T##m1x4();    \\\n    ret = vset_##_T##m1x4(ret, 0, a.val);  \\\n    ret = vset_##_T##m1x4(ret, 1, b.val);  \\\n    ret = vset_##_T##m1x4(ret, 2, c.val);  \\\n    ret = vset_##_T##m1x4(ret, 3, d.val);  \\\n    vsseg4e_v_##_T##m1x4(ptr, ret, num);    \\\n}\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED_(float32, float, 4, f32)\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED_(float64, double, 2, f64)\n\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED_(uint64, unsigned long, 2, u64)\nOPENCV_HAL_IMPL_RISCVV_INTERLEAVED_(int64, long, 2, i64)\n\ninline v_float32x4 v_cvt_f32(const v_int32x4& a)\n{\n    return v_float32x4(vfcvt_f_x_v_f32m1(a.val, 4));\n}\n\n#if CV_SIMD128_64F\ninline v_float32x4 v_cvt_f32(const v_float64x2& a)\n{\n    vfloat64m2_t _val = vundefined_f64m2();\n    _val = vset_f64m2(_val, 0, a.val);\n    vfloat32m1_t aval = vfncvt_f_f_v_f32m1(_val, 2);\n    return v_float32x4(aval);\n}\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b)\n{\n    vfloat64m2_t _val = vundefined_f64m2();\n    _val = vset_f64m2(_val, 0, a.val);\n    _val = vset_f64m2(_val, 1, b.val);\n    vfloat32m1_t aval = vfncvt_f_f_v_f32m1(_val, 4);\n    return v_float32x4(aval);\n}\n\ninline v_float64x2 v_cvt_f64(const v_int32x4& a)\n{\n    vfloat32m1_t val = vfcvt_f_x_v_f32m1(a.val, 4);\n    vfloat64m2_t _val = vfwcvt_f_f_v_f64m2(val, 4);\n    return v_float64x2(vget_f64m2_f64m1(_val, 0));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_int32x4& a)\n{\n    vfloat32m1_t val = vfcvt_f_x_v_f32m1(a.val, 4);\n    vfloat64m2_t _val = vfwcvt_f_f_v_f64m2(val, 4);\n    return v_float64x2(vget_f64m2_f64m1(_val, 1));\n}\n\ninline v_float64x2 v_cvt_f64(const v_float32x4& a)\n{\n    vfloat64m2_t _val  = vfwcvt_f_f_v_f64m2(a.val, 4);\n    return v_float64x2(vget_f64m2_f64m1(_val, 0));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_float32x4& a)\n{\n    vfloat64m2_t _val  = vfwcvt_f_f_v_f64m2(a.val, 4);\n    return v_float64x2(vget_f64m2_f64m1(_val, 1));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int64x2& a)\n{\n    return v_float64x2(vfcvt_f_x_v_f64m1(a.val, 2));\n}\n\n#endif\ninline v_int8x16 v_interleave_pairs(const v_int8x16& vec)\n{\n    vuint64m1_t m0 = {0x0705060403010200, 0x0F0D0E0C0B090A08};\n    return v_int8x16(vrgather_vv_i8m1(vec.val, (vuint8m1_t)m0, 16));\n}\ninline v_uint8x16 v_interleave_pairs(const v_uint8x16& vec)\n{\n    return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec)));\n}\n\ninline v_int8x16 v_interleave_quads(const v_int8x16& vec)\n{\n    vuint64m1_t m0 = {0x0703060205010400, 0x0F0B0E0A0D090C08};\n    return v_int8x16(vrgather_vv_i8m1(vec.val, (vuint8m1_t)m0, 16));\n}\ninline v_uint8x16 v_interleave_quads(const v_uint8x16& vec)\n{\n    return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec)));\n}\n\ninline v_int16x8 v_interleave_pairs(const v_int16x8& vec)\n{\n    vuint64m1_t m0 = {0x0706030205040100, 0x0F0E0B0A0D0C0908};\n    return v_int16x8((vint16m1_t)vrgather_vv_u8m1((vuint8m1_t)vec.val, (vuint8m1_t)m0, 16));\n}\ninline v_uint16x8 v_interleave_pairs(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); }\ninline v_int16x8 v_interleave_quads(const v_int16x8& vec)\n{\n    vuint64m1_t m0 = {0x0B0A030209080100, 0x0F0E07060D0C0504};\n    return v_int16x8((vint16m1_t)vrgather_vv_u8m1((vuint8m1_t)(vec.val), (vuint8m1_t)m0, 16));\n}\ninline v_uint16x8 v_interleave_quads(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_interleave_pairs(const v_int32x4& vec)\n{\n    vuint64m1_t m0 = {0x0B0A090803020100, 0x0F0E0D0C07060504};\n    return v_int32x4((vint32m1_t)vrgather_vv_u8m1((vuint8m1_t)(vec.val), (vuint8m1_t)m0, 16));\n}\ninline v_uint32x4 v_interleave_pairs(const v_uint32x4& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\ninline v_float32x4 v_interleave_pairs(const v_float32x4& vec) { return v_reinterpret_as_f32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\ninline v_int8x16 v_pack_triplets(const v_int8x16& vec)\n{\n    vuint64m1_t m0 = {0x0908060504020100, 0xFFFFFFFF0E0D0C0A};\n    return v_int8x16((vint8m1_t)vrgather_vv_u8m1((vuint8m1_t)(vec.val), (vuint8m1_t)m0, 16));\n}\ninline v_uint8x16 v_pack_triplets(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_pack_triplets(const v_int16x8& vec)\n{\n    vuint64m1_t m0 = {0x0908050403020100, 0xFFFFFFFF0D0C0B0A};\n    return v_int16x8((vint16m1_t)vrgather_vv_u8m1((vuint8m1_t)(vec.val), (vuint8m1_t)m0, 16));\n}\ninline v_uint16x8 v_pack_triplets(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_pack_triplets(const v_int32x4& vec) { return vec; }\ninline v_uint32x4 v_pack_triplets(const v_uint32x4& vec) { return vec; }\ninline v_float32x4 v_pack_triplets(const v_float32x4& vec) { return vec; }\n\n#if CV_SIMD128_64F\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b)\n{ return v_cvt_f64(v_dotprod(a, b)); }\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a,   const v_int32x4& b,\n                                    const v_float64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b)\n{\n    vint64m2_t v1 = vwmul_vv_i64m2(a.val, b.val, 4);\n    vfloat64m1_t res = vfcvt_f_x_v_f64m1(vadd_vv_i64m1(vget_i64m2_i64m1(v1, 0), vget_i64m2_i64m1(v1, 1), 2), 2);\n    return v_float64x2(res);\n}\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ v_float64x2 res = v_dotprod_expand_fast(a, b);\n  return res + c; }\n#endif\n////// FP16 support ///////\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n    vfloat16m1_t v = vle_v_f16m1((__fp16*)ptr, 4);\n    vfloat32m2_t v32 = vfwcvt_f_f_v_f32m2(v, 4);\n    return v_float32x4(vget_f32m2_f32m1(v32, 0));\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n    vfloat32m2_t v32 = vundefined_f32m2();\n    v32 = vset_f32m2(v32, 0, v.val);\n    vfloat16m1_t hv = vfncvt_f_f_v_f16m1(v32, 4);\n    vse_v_f16m1((__fp16*)ptr, hv, 4);\n}\n\n\ninline void v_cleanup() {}\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n}\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_sse.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_HAL_SSE_HPP\n#define OPENCV_HAL_SSE_HPP\n\n#include <algorithm>\n#include \"opencv2/core/utility.hpp\"\n\n#define CV_SIMD128 1\n#define CV_SIMD128_64F 1\n#define CV_SIMD128_FP16 0  // no native operations with FP16 type.\n\nnamespace cv\n{\n\n//! @cond IGNORED\n\n//\n// Compilation troubleshooting:\n// - MSVC: error C2719: 'a': formal parameter with requested alignment of 16 won't be aligned\n//   Replace parameter declaration to const reference:\n//   -v_int32x4 a\n//   +const v_int32x4& a\n//\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n///////// Types ////////////\n\nstruct v_uint8x16\n{\n    typedef uchar lane_type;\n    typedef __m128i vector_type;\n    enum { nlanes = 16 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_uint8x16() {}\n    explicit v_uint8x16(__m128i v) : val(v) {}\n    v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7,\n               uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15)\n    {\n        val = _mm_setr_epi8((char)v0, (char)v1, (char)v2, (char)v3,\n                            (char)v4, (char)v5, (char)v6, (char)v7,\n                            (char)v8, (char)v9, (char)v10, (char)v11,\n                            (char)v12, (char)v13, (char)v14, (char)v15);\n    }\n\n    uchar get0() const\n    {\n        return (uchar)_mm_cvtsi128_si32(val);\n    }\n\n    __m128i val;\n};\n\nstruct v_int8x16\n{\n    typedef schar lane_type;\n    typedef __m128i vector_type;\n    enum { nlanes = 16 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_int8x16() {}\n    explicit v_int8x16(__m128i v) : val(v) {}\n    v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7,\n              schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15)\n    {\n        val = _mm_setr_epi8((char)v0, (char)v1, (char)v2, (char)v3,\n                            (char)v4, (char)v5, (char)v6, (char)v7,\n                            (char)v8, (char)v9, (char)v10, (char)v11,\n                            (char)v12, (char)v13, (char)v14, (char)v15);\n    }\n\n    schar get0() const\n    {\n        return (schar)_mm_cvtsi128_si32(val);\n    }\n\n    __m128i val;\n};\n\nstruct v_uint16x8\n{\n    typedef ushort lane_type;\n    typedef __m128i vector_type;\n    enum { nlanes = 8 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_uint16x8() {}\n    explicit v_uint16x8(__m128i v) : val(v) {}\n    v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)\n    {\n        val = _mm_setr_epi16((short)v0, (short)v1, (short)v2, (short)v3,\n                             (short)v4, (short)v5, (short)v6, (short)v7);\n    }\n\n    ushort get0() const\n    {\n        return (ushort)_mm_cvtsi128_si32(val);\n    }\n\n    __m128i val;\n};\n\nstruct v_int16x8\n{\n    typedef short lane_type;\n    typedef __m128i vector_type;\n    enum { nlanes = 8 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_int16x8() {}\n    explicit v_int16x8(__m128i v) : val(v) {}\n    v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)\n    {\n        val = _mm_setr_epi16((short)v0, (short)v1, (short)v2, (short)v3,\n                             (short)v4, (short)v5, (short)v6, (short)v7);\n    }\n\n    short get0() const\n    {\n        return (short)_mm_cvtsi128_si32(val);\n    }\n\n    __m128i val;\n};\n\nstruct v_uint32x4\n{\n    typedef unsigned lane_type;\n    typedef __m128i vector_type;\n    enum { nlanes = 4 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_uint32x4() {}\n    explicit v_uint32x4(__m128i v) : val(v) {}\n    v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3)\n    {\n        val = _mm_setr_epi32((int)v0, (int)v1, (int)v2, (int)v3);\n    }\n\n    unsigned get0() const\n    {\n        return (unsigned)_mm_cvtsi128_si32(val);\n    }\n\n    __m128i val;\n};\n\nstruct v_int32x4\n{\n    typedef int lane_type;\n    typedef __m128i vector_type;\n    enum { nlanes = 4 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_int32x4() {}\n    explicit v_int32x4(__m128i v) : val(v) {}\n    v_int32x4(int v0, int v1, int v2, int v3)\n    {\n        val = _mm_setr_epi32(v0, v1, v2, v3);\n    }\n\n    int get0() const\n    {\n        return _mm_cvtsi128_si32(val);\n    }\n\n    __m128i val;\n};\n\nstruct v_float32x4\n{\n    typedef float lane_type;\n    typedef __m128 vector_type;\n    enum { nlanes = 4 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_float32x4() {}\n    explicit v_float32x4(__m128 v) : val(v) {}\n    v_float32x4(float v0, float v1, float v2, float v3)\n    {\n        val = _mm_setr_ps(v0, v1, v2, v3);\n    }\n\n    float get0() const\n    {\n        return _mm_cvtss_f32(val);\n    }\n\n    __m128 val;\n};\n\nstruct v_uint64x2\n{\n    typedef uint64 lane_type;\n    typedef __m128i vector_type;\n    enum { nlanes = 2 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_uint64x2() {}\n    explicit v_uint64x2(__m128i v) : val(v) {}\n    v_uint64x2(uint64 v0, uint64 v1)\n    {\n        val = _mm_setr_epi32((int)v0, (int)(v0 >> 32), (int)v1, (int)(v1 >> 32));\n    }\n\n    uint64 get0() const\n    {\n    #if !defined(__x86_64__) && !defined(_M_X64)\n        int a = _mm_cvtsi128_si32(val);\n        int b = _mm_cvtsi128_si32(_mm_srli_epi64(val, 32));\n        return (unsigned)a | ((uint64)(unsigned)b << 32);\n    #else\n        return (uint64)_mm_cvtsi128_si64(val);\n    #endif\n    }\n\n    __m128i val;\n};\n\nstruct v_int64x2\n{\n    typedef int64 lane_type;\n    typedef __m128i vector_type;\n    enum { nlanes = 2 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_int64x2() {}\n    explicit v_int64x2(__m128i v) : val(v) {}\n    v_int64x2(int64 v0, int64 v1)\n    {\n        val = _mm_setr_epi32((int)v0, (int)(v0 >> 32), (int)v1, (int)(v1 >> 32));\n    }\n\n    int64 get0() const\n    {\n    #if !defined(__x86_64__) && !defined(_M_X64)\n        int a = _mm_cvtsi128_si32(val);\n        int b = _mm_cvtsi128_si32(_mm_srli_epi64(val, 32));\n        return (int64)((unsigned)a | ((uint64)(unsigned)b << 32));\n    #else\n        return _mm_cvtsi128_si64(val);\n    #endif\n    }\n\n    __m128i val;\n};\n\nstruct v_float64x2\n{\n    typedef double lane_type;\n    typedef __m128d vector_type;\n    enum { nlanes = 2 };\n\n    /* coverity[uninit_ctor]: suppress warning */\n    v_float64x2() {}\n    explicit v_float64x2(__m128d v) : val(v) {}\n    v_float64x2(double v0, double v1)\n    {\n        val = _mm_setr_pd(v0, v1);\n    }\n\n    double get0() const\n    {\n        return _mm_cvtsd_f64(val);\n    }\n\n    __m128d val;\n};\n\nnamespace hal_sse_internal\n{\n    template <typename to_sse_type, typename from_sse_type>\n    to_sse_type v_sse_reinterpret_as(const from_sse_type& val);\n\n#define OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(to_sse_type, from_sse_type, sse_cast_intrin) \\\n    template<> inline \\\n    to_sse_type v_sse_reinterpret_as(const from_sse_type& a) \\\n    { return sse_cast_intrin(a); }\n\n    OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128i, __m128i, OPENCV_HAL_NOP)\n    OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128i, __m128, _mm_castps_si128)\n    OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128i, __m128d, _mm_castpd_si128)\n    OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128, __m128i, _mm_castsi128_ps)\n    OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128, __m128, OPENCV_HAL_NOP)\n    OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128, __m128d, _mm_castpd_ps)\n    OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128d, __m128i, _mm_castsi128_pd)\n    OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128d, __m128, _mm_castps_pd)\n    OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128d, __m128d, OPENCV_HAL_NOP)\n}\n\n#define OPENCV_HAL_IMPL_SSE_INITVEC(_Tpvec, _Tp, suffix, zsuffix, ssuffix, _Tps, cast) \\\ninline _Tpvec v_setzero_##suffix() { return _Tpvec(_mm_setzero_##zsuffix()); } \\\ninline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(_mm_set1_##ssuffix((_Tps)v)); } \\\ntemplate<typename _Tpvec0> inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0& a) \\\n{ return _Tpvec(cast(a.val)); }\n\nOPENCV_HAL_IMPL_SSE_INITVEC(v_uint8x16, uchar, u8, si128, epi8, schar, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_INITVEC(v_int8x16, schar, s8, si128, epi8, schar, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_INITVEC(v_uint16x8, ushort, u16, si128, epi16, short, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_INITVEC(v_int16x8, short, s16, si128, epi16, short, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_INITVEC(v_uint32x4, unsigned, u32, si128, epi32, int, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_INITVEC(v_int32x4, int, s32, si128, epi32, int, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_INITVEC(v_float32x4, float, f32, ps, ps, float, _mm_castsi128_ps)\nOPENCV_HAL_IMPL_SSE_INITVEC(v_float64x2, double, f64, pd, pd, double, _mm_castsi128_pd)\n\ninline v_uint64x2 v_setzero_u64() { return v_uint64x2(_mm_setzero_si128()); }\ninline v_int64x2 v_setzero_s64() { return v_int64x2(_mm_setzero_si128()); }\ninline v_uint64x2 v_setall_u64(uint64 val) { return v_uint64x2(val, val); }\ninline v_int64x2 v_setall_s64(int64 val) { return v_int64x2(val, val); }\n\ntemplate<typename _Tpvec> inline\nv_uint64x2 v_reinterpret_as_u64(const _Tpvec& a) { return v_uint64x2(a.val); }\ntemplate<typename _Tpvec> inline\nv_int64x2 v_reinterpret_as_s64(const _Tpvec& a) { return v_int64x2(a.val); }\ninline v_float32x4 v_reinterpret_as_f32(const v_uint64x2& a)\n{ return v_float32x4(_mm_castsi128_ps(a.val)); }\ninline v_float32x4 v_reinterpret_as_f32(const v_int64x2& a)\n{ return v_float32x4(_mm_castsi128_ps(a.val)); }\ninline v_float64x2 v_reinterpret_as_f64(const v_uint64x2& a)\n{ return v_float64x2(_mm_castsi128_pd(a.val)); }\ninline v_float64x2 v_reinterpret_as_f64(const v_int64x2& a)\n{ return v_float64x2(_mm_castsi128_pd(a.val)); }\n\n#define OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(_Tpvec, suffix) \\\ninline _Tpvec v_reinterpret_as_##suffix(const v_float32x4& a) \\\n{ return _Tpvec(_mm_castps_si128(a.val)); } \\\ninline _Tpvec v_reinterpret_as_##suffix(const v_float64x2& a) \\\n{ return _Tpvec(_mm_castpd_si128(a.val)); }\n\nOPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint8x16, u8)\nOPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int8x16, s8)\nOPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint16x8, u16)\nOPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int16x8, s16)\nOPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint32x4, u32)\nOPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int32x4, s32)\nOPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint64x2, u64)\nOPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int64x2, s64)\n\ninline v_float32x4 v_reinterpret_as_f32(const v_float32x4& a) {return a; }\ninline v_float64x2 v_reinterpret_as_f64(const v_float64x2& a) {return a; }\ninline v_float32x4 v_reinterpret_as_f32(const v_float64x2& a) {return v_float32x4(_mm_castpd_ps(a.val)); }\ninline v_float64x2 v_reinterpret_as_f64(const v_float32x4& a) {return v_float64x2(_mm_castps_pd(a.val)); }\n\n//////////////// PACK ///////////////\ninline v_uint8x16 v_pack(const v_uint16x8& a, const v_uint16x8& b)\n{\n    __m128i delta = _mm_set1_epi16(255);\n    return v_uint8x16(_mm_packus_epi16(_mm_subs_epu16(a.val, _mm_subs_epu16(a.val, delta)),\n                                       _mm_subs_epu16(b.val, _mm_subs_epu16(b.val, delta))));\n}\n\ninline void v_pack_store(uchar* ptr, const v_uint16x8& a)\n{\n    __m128i delta = _mm_set1_epi16(255);\n    __m128i a1 = _mm_subs_epu16(a.val, _mm_subs_epu16(a.val, delta));\n    _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi16(a1, a1));\n}\n\ninline v_uint8x16 v_pack_u(const v_int16x8& a, const v_int16x8& b)\n{ return v_uint8x16(_mm_packus_epi16(a.val, b.val)); }\n\ninline void v_pack_u_store(uchar* ptr, const v_int16x8& a)\n{ _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi16(a.val, a.val)); }\n\ntemplate<int n> inline\nv_uint8x16 v_rshr_pack(const v_uint16x8& a, const v_uint16x8& b)\n{\n    // we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers.\n    __m128i delta = _mm_set1_epi16((short)(1 << (n-1)));\n    return v_uint8x16(_mm_packus_epi16(_mm_srli_epi16(_mm_adds_epu16(a.val, delta), n),\n                                       _mm_srli_epi16(_mm_adds_epu16(b.val, delta), n)));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(uchar* ptr, const v_uint16x8& a)\n{\n    __m128i delta = _mm_set1_epi16((short)(1 << (n-1)));\n    __m128i a1 = _mm_srli_epi16(_mm_adds_epu16(a.val, delta), n);\n    _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi16(a1, a1));\n}\n\ntemplate<int n> inline\nv_uint8x16 v_rshr_pack_u(const v_int16x8& a, const v_int16x8& b)\n{\n    __m128i delta = _mm_set1_epi16((short)(1 << (n-1)));\n    return v_uint8x16(_mm_packus_epi16(_mm_srai_epi16(_mm_adds_epi16(a.val, delta), n),\n                                       _mm_srai_epi16(_mm_adds_epi16(b.val, delta), n)));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_u_store(uchar* ptr, const v_int16x8& a)\n{\n    __m128i delta = _mm_set1_epi16((short)(1 << (n-1)));\n    __m128i a1 = _mm_srai_epi16(_mm_adds_epi16(a.val, delta), n);\n    _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi16(a1, a1));\n}\n\ninline v_int8x16 v_pack(const v_int16x8& a, const v_int16x8& b)\n{ return v_int8x16(_mm_packs_epi16(a.val, b.val)); }\n\ninline void v_pack_store(schar* ptr, const v_int16x8& a)\n{ _mm_storel_epi64((__m128i*)ptr, _mm_packs_epi16(a.val, a.val)); }\n\ntemplate<int n> inline\nv_int8x16 v_rshr_pack(const v_int16x8& a, const v_int16x8& b)\n{\n    // we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers.\n    __m128i delta = _mm_set1_epi16((short)(1 << (n-1)));\n    return v_int8x16(_mm_packs_epi16(_mm_srai_epi16(_mm_adds_epi16(a.val, delta), n),\n                                     _mm_srai_epi16(_mm_adds_epi16(b.val, delta), n)));\n}\ntemplate<int n> inline\nvoid v_rshr_pack_store(schar* ptr, const v_int16x8& a)\n{\n    // we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers.\n    __m128i delta = _mm_set1_epi16((short)(1 << (n-1)));\n    __m128i a1 = _mm_srai_epi16(_mm_adds_epi16(a.val, delta), n);\n    _mm_storel_epi64((__m128i*)ptr, _mm_packs_epi16(a1, a1));\n}\n\n\n// byte-wise \"mask ? a : b\"\ninline __m128i v_select_si128(__m128i mask, __m128i a, __m128i b)\n{\n#if CV_SSE4_1\n    return _mm_blendv_epi8(b, a, mask);\n#else\n    return _mm_xor_si128(b, _mm_and_si128(_mm_xor_si128(a, b), mask));\n#endif\n}\n\ninline v_uint16x8 v_pack(const v_uint32x4& a, const v_uint32x4& b)\n{ return v_uint16x8(_v128_packs_epu32(a.val, b.val)); }\n\ninline void v_pack_store(ushort* ptr, const v_uint32x4& a)\n{\n    __m128i z = _mm_setzero_si128(), maxval32 = _mm_set1_epi32(65535), delta32 = _mm_set1_epi32(32768);\n    __m128i a1 = _mm_sub_epi32(v_select_si128(_mm_cmpgt_epi32(z, a.val), maxval32, a.val), delta32);\n    __m128i r = _mm_packs_epi32(a1, a1);\n    _mm_storel_epi64((__m128i*)ptr, _mm_sub_epi16(r, _mm_set1_epi16(-32768)));\n}\n\ntemplate<int n> inline\nv_uint16x8 v_rshr_pack(const v_uint32x4& a, const v_uint32x4& b)\n{\n    __m128i delta = _mm_set1_epi32(1 << (n-1)), delta32 = _mm_set1_epi32(32768);\n    __m128i a1 = _mm_sub_epi32(_mm_srli_epi32(_mm_add_epi32(a.val, delta), n), delta32);\n    __m128i b1 = _mm_sub_epi32(_mm_srli_epi32(_mm_add_epi32(b.val, delta), n), delta32);\n    return v_uint16x8(_mm_sub_epi16(_mm_packs_epi32(a1, b1), _mm_set1_epi16(-32768)));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(ushort* ptr, const v_uint32x4& a)\n{\n    __m128i delta = _mm_set1_epi32(1 << (n-1)), delta32 = _mm_set1_epi32(32768);\n    __m128i a1 = _mm_sub_epi32(_mm_srli_epi32(_mm_add_epi32(a.val, delta), n), delta32);\n    __m128i a2 = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768));\n    _mm_storel_epi64((__m128i*)ptr, a2);\n}\n\ninline v_uint16x8 v_pack_u(const v_int32x4& a, const v_int32x4& b)\n{\n#if CV_SSE4_1\n    return v_uint16x8(_mm_packus_epi32(a.val, b.val));\n#else\n    __m128i delta32 = _mm_set1_epi32(32768);\n\n    // preliminary saturate negative values to zero\n    __m128i a1 = _mm_and_si128(a.val, _mm_cmpgt_epi32(a.val, _mm_set1_epi32(0)));\n    __m128i b1 = _mm_and_si128(b.val, _mm_cmpgt_epi32(b.val, _mm_set1_epi32(0)));\n\n    __m128i r = _mm_packs_epi32(_mm_sub_epi32(a1, delta32), _mm_sub_epi32(b1, delta32));\n    return v_uint16x8(_mm_sub_epi16(r, _mm_set1_epi16(-32768)));\n#endif\n}\n\ninline void v_pack_u_store(ushort* ptr, const v_int32x4& a)\n{\n#if CV_SSE4_1\n    _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi32(a.val, a.val));\n#else\n    __m128i delta32 = _mm_set1_epi32(32768);\n    __m128i a1 = _mm_sub_epi32(a.val, delta32);\n    __m128i r = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768));\n    _mm_storel_epi64((__m128i*)ptr, r);\n#endif\n}\n\ntemplate<int n> inline\nv_uint16x8 v_rshr_pack_u(const v_int32x4& a, const v_int32x4& b)\n{\n#if CV_SSE4_1\n    __m128i delta = _mm_set1_epi32(1 << (n - 1));\n    return v_uint16x8(_mm_packus_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n),\n                                       _mm_srai_epi32(_mm_add_epi32(b.val, delta), n)));\n#else\n    __m128i delta = _mm_set1_epi32(1 << (n-1)), delta32 = _mm_set1_epi32(32768);\n    __m128i a1 = _mm_sub_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n), delta32);\n    __m128i a2 = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768));\n    __m128i b1 = _mm_sub_epi32(_mm_srai_epi32(_mm_add_epi32(b.val, delta), n), delta32);\n    __m128i b2 = _mm_sub_epi16(_mm_packs_epi32(b1, b1), _mm_set1_epi16(-32768));\n    return v_uint16x8(_mm_unpacklo_epi64(a2, b2));\n#endif\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_u_store(ushort* ptr, const v_int32x4& a)\n{\n#if CV_SSE4_1\n    __m128i delta = _mm_set1_epi32(1 << (n - 1));\n    __m128i a1 = _mm_srai_epi32(_mm_add_epi32(a.val, delta), n);\n    _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi32(a1, a1));\n#else\n    __m128i delta = _mm_set1_epi32(1 << (n-1)), delta32 = _mm_set1_epi32(32768);\n    __m128i a1 = _mm_sub_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n), delta32);\n    __m128i a2 = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768));\n    _mm_storel_epi64((__m128i*)ptr, a2);\n#endif\n}\n\ninline v_int16x8 v_pack(const v_int32x4& a, const v_int32x4& b)\n{ return v_int16x8(_mm_packs_epi32(a.val, b.val)); }\n\ninline void v_pack_store(short* ptr, const v_int32x4& a)\n{\n    _mm_storel_epi64((__m128i*)ptr, _mm_packs_epi32(a.val, a.val));\n}\n\ntemplate<int n> inline\nv_int16x8 v_rshr_pack(const v_int32x4& a, const v_int32x4& b)\n{\n    __m128i delta = _mm_set1_epi32(1 << (n-1));\n    return v_int16x8(_mm_packs_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n),\n                                     _mm_srai_epi32(_mm_add_epi32(b.val, delta), n)));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(short* ptr, const v_int32x4& a)\n{\n    __m128i delta = _mm_set1_epi32(1 << (n-1));\n    __m128i a1 = _mm_srai_epi32(_mm_add_epi32(a.val, delta), n);\n    _mm_storel_epi64((__m128i*)ptr, _mm_packs_epi32(a1, a1));\n}\n\n\n// [a0 0 | b0 0]  [a1 0 | b1 0]\ninline v_uint32x4 v_pack(const v_uint64x2& a, const v_uint64x2& b)\n{\n    __m128i v0 = _mm_unpacklo_epi32(a.val, b.val); // a0 a1 0 0\n    __m128i v1 = _mm_unpackhi_epi32(a.val, b.val); // b0 b1 0 0\n    return v_uint32x4(_mm_unpacklo_epi32(v0, v1));\n}\n\ninline void v_pack_store(unsigned* ptr, const v_uint64x2& a)\n{\n    __m128i a1 = _mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 2, 2, 0));\n    _mm_storel_epi64((__m128i*)ptr, a1);\n}\n\n// [a0 0 | b0 0]  [a1 0 | b1 0]\ninline v_int32x4 v_pack(const v_int64x2& a, const v_int64x2& b)\n{\n    __m128i v0 = _mm_unpacklo_epi32(a.val, b.val); // a0 a1 0 0\n    __m128i v1 = _mm_unpackhi_epi32(a.val, b.val); // b0 b1 0 0\n    return v_int32x4(_mm_unpacklo_epi32(v0, v1));\n}\n\ninline void v_pack_store(int* ptr, const v_int64x2& a)\n{\n    __m128i a1 = _mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 2, 2, 0));\n    _mm_storel_epi64((__m128i*)ptr, a1);\n}\n\ntemplate<int n> inline\nv_uint32x4 v_rshr_pack(const v_uint64x2& a, const v_uint64x2& b)\n{\n    uint64 delta = (uint64)1 << (n-1);\n    v_uint64x2 delta2(delta, delta);\n    __m128i a1 = _mm_srli_epi64(_mm_add_epi64(a.val, delta2.val), n);\n    __m128i b1 = _mm_srli_epi64(_mm_add_epi64(b.val, delta2.val), n);\n    __m128i v0 = _mm_unpacklo_epi32(a1, b1); // a0 a1 0 0\n    __m128i v1 = _mm_unpackhi_epi32(a1, b1); // b0 b1 0 0\n    return v_uint32x4(_mm_unpacklo_epi32(v0, v1));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(unsigned* ptr, const v_uint64x2& a)\n{\n    uint64 delta = (uint64)1 << (n-1);\n    v_uint64x2 delta2(delta, delta);\n    __m128i a1 = _mm_srli_epi64(_mm_add_epi64(a.val, delta2.val), n);\n    __m128i a2 = _mm_shuffle_epi32(a1, _MM_SHUFFLE(0, 2, 2, 0));\n    _mm_storel_epi64((__m128i*)ptr, a2);\n}\n\ninline __m128i v_sign_epi64(__m128i a)\n{\n    return _mm_shuffle_epi32(_mm_srai_epi32(a, 31), _MM_SHUFFLE(3, 3, 1, 1)); // x m0 | x m1\n}\n\ninline __m128i v_srai_epi64(__m128i a, int imm)\n{\n    __m128i smask = v_sign_epi64(a);\n    return _mm_xor_si128(_mm_srli_epi64(_mm_xor_si128(a, smask), imm), smask);\n}\n\ntemplate<int n> inline\nv_int32x4 v_rshr_pack(const v_int64x2& a, const v_int64x2& b)\n{\n    int64 delta = (int64)1 << (n-1);\n    v_int64x2 delta2(delta, delta);\n    __m128i a1 = v_srai_epi64(_mm_add_epi64(a.val, delta2.val), n);\n    __m128i b1 = v_srai_epi64(_mm_add_epi64(b.val, delta2.val), n);\n    __m128i v0 = _mm_unpacklo_epi32(a1, b1); // a0 a1 0 0\n    __m128i v1 = _mm_unpackhi_epi32(a1, b1); // b0 b1 0 0\n    return v_int32x4(_mm_unpacklo_epi32(v0, v1));\n}\n\ntemplate<int n> inline\nvoid v_rshr_pack_store(int* ptr, const v_int64x2& a)\n{\n    int64 delta = (int64)1 << (n-1);\n    v_int64x2 delta2(delta, delta);\n    __m128i a1 = v_srai_epi64(_mm_add_epi64(a.val, delta2.val), n);\n    __m128i a2 = _mm_shuffle_epi32(a1, _MM_SHUFFLE(0, 2, 2, 0));\n    _mm_storel_epi64((__m128i*)ptr, a2);\n}\n\n// pack boolean\ninline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b)\n{\n    __m128i ab = _mm_packs_epi16(a.val, b.val);\n    return v_uint8x16(ab);\n}\n\ninline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b,\n                           const v_uint32x4& c, const v_uint32x4& d)\n{\n    __m128i ab = _mm_packs_epi32(a.val, b.val);\n    __m128i cd = _mm_packs_epi32(c.val, d.val);\n    return v_uint8x16(_mm_packs_epi16(ab, cd));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c,\n                           const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f,\n                           const v_uint64x2& g, const v_uint64x2& h)\n{\n    __m128i ab = _mm_packs_epi32(a.val, b.val);\n    __m128i cd = _mm_packs_epi32(c.val, d.val);\n    __m128i ef = _mm_packs_epi32(e.val, f.val);\n    __m128i gh = _mm_packs_epi32(g.val, h.val);\n\n    __m128i abcd = _mm_packs_epi32(ab, cd);\n    __m128i efgh = _mm_packs_epi32(ef, gh);\n    return v_uint8x16(_mm_packs_epi16(abcd, efgh));\n}\n\ninline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0,\n                            const v_float32x4& m1, const v_float32x4& m2,\n                            const v_float32x4& m3)\n{\n    __m128 v0 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(0, 0, 0, 0)), m0.val);\n    __m128 v1 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(1, 1, 1, 1)), m1.val);\n    __m128 v2 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(2, 2, 2, 2)), m2.val);\n    __m128 v3 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(3, 3, 3, 3)), m3.val);\n\n    return v_float32x4(_mm_add_ps(_mm_add_ps(v0, v1), _mm_add_ps(v2, v3)));\n}\n\ninline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0,\n                               const v_float32x4& m1, const v_float32x4& m2,\n                               const v_float32x4& a)\n{\n    __m128 v0 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(0, 0, 0, 0)), m0.val);\n    __m128 v1 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(1, 1, 1, 1)), m1.val);\n    __m128 v2 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(2, 2, 2, 2)), m2.val);\n\n    return v_float32x4(_mm_add_ps(_mm_add_ps(v0, v1), _mm_add_ps(v2, a.val)));\n}\n\n#define OPENCV_HAL_IMPL_SSE_BIN_OP(bin_op, _Tpvec, intrin) \\\n    inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \\\n    { \\\n        return _Tpvec(intrin(a.val, b.val)); \\\n    } \\\n    inline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \\\n    { \\\n        a.val = intrin(a.val, b.val); \\\n        return a; \\\n    }\n\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint8x16, _mm_adds_epu8)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint8x16, _mm_subs_epu8)\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int8x16, _mm_adds_epi8)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int8x16, _mm_subs_epi8)\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint16x8, _mm_adds_epu16)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint16x8, _mm_subs_epu16)\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int16x8, _mm_adds_epi16)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int16x8, _mm_subs_epi16)\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint32x4, _mm_add_epi32)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint32x4, _mm_sub_epi32)\nOPENCV_HAL_IMPL_SSE_BIN_OP(*, v_uint32x4, _v128_mullo_epi32)\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int32x4, _mm_add_epi32)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int32x4, _mm_sub_epi32)\nOPENCV_HAL_IMPL_SSE_BIN_OP(*, v_int32x4, _v128_mullo_epi32)\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_float32x4, _mm_add_ps)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_float32x4, _mm_sub_ps)\nOPENCV_HAL_IMPL_SSE_BIN_OP(*, v_float32x4, _mm_mul_ps)\nOPENCV_HAL_IMPL_SSE_BIN_OP(/, v_float32x4, _mm_div_ps)\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_float64x2, _mm_add_pd)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_float64x2, _mm_sub_pd)\nOPENCV_HAL_IMPL_SSE_BIN_OP(*, v_float64x2, _mm_mul_pd)\nOPENCV_HAL_IMPL_SSE_BIN_OP(/, v_float64x2, _mm_div_pd)\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint64x2, _mm_add_epi64)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint64x2, _mm_sub_epi64)\nOPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int64x2, _mm_add_epi64)\nOPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int64x2, _mm_sub_epi64)\n\n// saturating multiply 8-bit, 16-bit\n#define OPENCV_HAL_IMPL_SSE_MUL_SAT(_Tpvec, _Tpwvec)             \\\n    inline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b)  \\\n    {                                                            \\\n        _Tpwvec c, d;                                            \\\n        v_mul_expand(a, b, c, d);                                \\\n        return v_pack(c, d);                                     \\\n    }                                                            \\\n    inline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b)      \\\n    { a = a * b; return a; }\n\nOPENCV_HAL_IMPL_SSE_MUL_SAT(v_uint8x16, v_uint16x8)\nOPENCV_HAL_IMPL_SSE_MUL_SAT(v_int8x16,  v_int16x8)\nOPENCV_HAL_IMPL_SSE_MUL_SAT(v_uint16x8, v_uint32x4)\nOPENCV_HAL_IMPL_SSE_MUL_SAT(v_int16x8,  v_int32x4)\n\n//  Multiply and expand\ninline void v_mul_expand(const v_uint8x16& a, const v_uint8x16& b,\n                         v_uint16x8& c, v_uint16x8& d)\n{\n    v_uint16x8 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c = v_mul_wrap(a0, b0);\n    d = v_mul_wrap(a1, b1);\n}\n\ninline void v_mul_expand(const v_int8x16& a, const v_int8x16& b,\n                         v_int16x8& c, v_int16x8& d)\n{\n    v_int16x8 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c = v_mul_wrap(a0, b0);\n    d = v_mul_wrap(a1, b1);\n}\n\ninline void v_mul_expand(const v_int16x8& a, const v_int16x8& b,\n                         v_int32x4& c, v_int32x4& d)\n{\n    __m128i v0 = _mm_mullo_epi16(a.val, b.val);\n    __m128i v1 = _mm_mulhi_epi16(a.val, b.val);\n    c.val = _mm_unpacklo_epi16(v0, v1);\n    d.val = _mm_unpackhi_epi16(v0, v1);\n}\n\ninline void v_mul_expand(const v_uint16x8& a, const v_uint16x8& b,\n                         v_uint32x4& c, v_uint32x4& d)\n{\n    __m128i v0 = _mm_mullo_epi16(a.val, b.val);\n    __m128i v1 = _mm_mulhi_epu16(a.val, b.val);\n    c.val = _mm_unpacklo_epi16(v0, v1);\n    d.val = _mm_unpackhi_epi16(v0, v1);\n}\n\ninline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b,\n                         v_uint64x2& c, v_uint64x2& d)\n{\n    __m128i c0 = _mm_mul_epu32(a.val, b.val);\n    __m128i c1 = _mm_mul_epu32(_mm_srli_epi64(a.val, 32), _mm_srli_epi64(b.val, 32));\n    c.val = _mm_unpacklo_epi64(c0, c1);\n    d.val = _mm_unpackhi_epi64(c0, c1);\n}\n\ninline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b) { return v_int16x8(_mm_mulhi_epi16(a.val, b.val)); }\ninline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b) { return v_uint16x8(_mm_mulhi_epu16(a.val, b.val)); }\n\n//////// Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b)\n{ return v_int32x4(_mm_madd_epi16(a.val, b.val)); }\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{ return v_dotprod(a, b) + c; }\n\n// 32 >> 64\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b)\n{\n#if CV_SSE4_1\n    __m128i even = _mm_mul_epi32(a.val, b.val);\n    __m128i odd = _mm_mul_epi32(_mm_srli_epi64(a.val, 32), _mm_srli_epi64(b.val, 32));\n    return v_int64x2(_mm_add_epi64(even, odd));\n#else\n    __m128i even_u = _mm_mul_epu32(a.val, b.val);\n    __m128i odd_u = _mm_mul_epu32(_mm_srli_epi64(a.val, 32), _mm_srli_epi64(b.val, 32));\n    // convert unsigned to signed high multiplication (from: Agner Fog(veclib) and H S Warren: Hacker's delight, 2003, p. 132)\n    __m128i a_sign = _mm_srai_epi32(a.val, 31);\n    __m128i b_sign = _mm_srai_epi32(b.val, 31);\n    // |x * sign of x\n    __m128i axb  = _mm_and_si128(a.val, b_sign);\n    __m128i bxa  = _mm_and_si128(b.val, a_sign);\n    // sum of sign corrections\n    __m128i ssum = _mm_add_epi32(bxa, axb);\n    __m128i even_ssum = _mm_slli_epi64(ssum, 32);\n    __m128i odd_ssum = _mm_and_si128(ssum, _mm_set_epi32(-1, 0, -1, 0));\n    // convert to signed and prod\n    return v_int64x2(_mm_add_epi64(_mm_sub_epi64(even_u, even_ssum), _mm_sub_epi64(odd_u, odd_ssum)));\n#endif\n}\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{ return v_dotprod(a, b) + c; }\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b)\n{\n    __m128i a0 = _mm_srli_epi16(_mm_slli_si128(a.val, 1), 8); // even\n    __m128i a1 = _mm_srli_epi16(a.val, 8); // odd\n    __m128i b0 = _mm_srli_epi16(_mm_slli_si128(b.val, 1), 8);\n    __m128i b1 = _mm_srli_epi16(b.val, 8);\n    __m128i p0 = _mm_madd_epi16(a0, b0);\n    __m128i p1 = _mm_madd_epi16(a1, b1);\n    return v_uint32x4(_mm_add_epi32(p0, p1));\n}\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b)\n{\n    __m128i a0 = _mm_srai_epi16(_mm_slli_si128(a.val, 1), 8); // even\n    __m128i a1 = _mm_srai_epi16(a.val, 8); // odd\n    __m128i b0 = _mm_srai_epi16(_mm_slli_si128(b.val, 1), 8);\n    __m128i b1 = _mm_srai_epi16(b.val, 8);\n    __m128i p0 = _mm_madd_epi16(a0, b0);\n    __m128i p1 = _mm_madd_epi16(a1, b1);\n    return v_int32x4(_mm_add_epi32(p0, p1));\n}\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v_uint32x4 c, d;\n    v_mul_expand(a, b, c, d);\n\n    v_uint64x2 c0, c1, d0, d1;\n    v_expand(c, c0, c1);\n    v_expand(d, d0, d1);\n\n    c0 += c1; d0 += d1;\n    return v_uint64x2(_mm_add_epi64(\n        _mm_unpacklo_epi64(c0.val, d0.val),\n        _mm_unpackhi_epi64(c0.val, d0.val)\n    ));\n}\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b)\n{\n    v_int32x4 prod = v_dotprod(a, b);\n    v_int64x2 c, d;\n    v_expand(prod, c, d);\n    return v_int64x2(_mm_add_epi64(\n        _mm_unpacklo_epi64(c.val, d.val),\n        _mm_unpackhi_epi64(c.val, d.val)\n    ));\n}\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 32 >> 64f\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b)\n{\n#if CV_SSE4_1\n    return v_cvt_f64(v_dotprod(a, b));\n#else\n    v_float64x2 c = v_cvt_f64(a) * v_cvt_f64(b);\n    v_float64x2 d = v_cvt_f64_high(a) * v_cvt_f64_high(b);\n\n    return v_float64x2(_mm_add_pd(\n        _mm_unpacklo_pd(c.val, d.val),\n        _mm_unpackhi_pd(c.val, d.val)\n    ));\n#endif\n}\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n//////// Fast Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b)\n{ return v_dotprod(a, b); }\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{ return v_dotprod(a, b) + c; }\n\n// 32 >> 64\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_dotprod(a, b); }\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{ return v_dotprod_fast(a, b) + c; }\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b)\n{\n    __m128i a0 = v_expand_low(a).val;\n    __m128i a1 = v_expand_high(a).val;\n    __m128i b0 = v_expand_low(b).val;\n    __m128i b1 = v_expand_high(b).val;\n    __m128i p0 = _mm_madd_epi16(a0, b0);\n    __m128i p1 = _mm_madd_epi16(a1, b1);\n    return v_uint32x4(_mm_add_epi32(p0, p1));\n}\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b)\n{\n#if CV_SSE4_1\n    __m128i a0 = _mm_cvtepi8_epi16(a.val);\n    __m128i a1 = v_expand_high(a).val;\n    __m128i b0 = _mm_cvtepi8_epi16(b.val);\n    __m128i b1 = v_expand_high(b).val;\n    __m128i p0 = _mm_madd_epi16(a0, b0);\n    __m128i p1 = _mm_madd_epi16(a1, b1);\n    return v_int32x4(_mm_add_epi32(p0, p1));\n#else\n    return v_dotprod_expand(a, b);\n#endif\n}\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v_uint32x4 c, d;\n    v_mul_expand(a, b, c, d);\n\n    v_uint64x2 c0, c1, d0, d1;\n    v_expand(c, c0, c1);\n    v_expand(d, d0, d1);\n\n    c0 += c1; d0 += d1;\n    return c0 + d0;\n}\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b)\n{\n    v_int32x4 prod = v_dotprod(a, b);\n    v_int64x2 c, d;\n    v_expand(prod, c, d);\n    return c + d;\n}\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\n// 32 >> 64f\nv_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c);\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_fma(v_cvt_f64(a), v_cvt_f64(b), v_cvt_f64_high(a) * v_cvt_f64_high(b)); }\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a,   const v_int32x4& b, const v_float64x2& c)\n{ return v_fma(v_cvt_f64(a), v_cvt_f64(b), v_fma(v_cvt_f64_high(a), v_cvt_f64_high(b), c)); }\n\n#define OPENCV_HAL_IMPL_SSE_LOGIC_OP(_Tpvec, suffix, not_const) \\\n    OPENCV_HAL_IMPL_SSE_BIN_OP(&, _Tpvec, _mm_and_##suffix) \\\n    OPENCV_HAL_IMPL_SSE_BIN_OP(|, _Tpvec, _mm_or_##suffix) \\\n    OPENCV_HAL_IMPL_SSE_BIN_OP(^, _Tpvec, _mm_xor_##suffix) \\\n    inline _Tpvec operator ~ (const _Tpvec& a) \\\n    { \\\n        return _Tpvec(_mm_xor_##suffix(a.val, not_const)); \\\n    }\n\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint8x16, si128, _mm_set1_epi32(-1))\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int8x16, si128, _mm_set1_epi32(-1))\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint16x8, si128, _mm_set1_epi32(-1))\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int16x8, si128, _mm_set1_epi32(-1))\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint32x4, si128, _mm_set1_epi32(-1))\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int32x4, si128, _mm_set1_epi32(-1))\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint64x2, si128, _mm_set1_epi32(-1))\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int64x2, si128, _mm_set1_epi32(-1))\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_float32x4, ps, _mm_castsi128_ps(_mm_set1_epi32(-1)))\nOPENCV_HAL_IMPL_SSE_LOGIC_OP(v_float64x2, pd, _mm_castsi128_pd(_mm_set1_epi32(-1)))\n\ninline v_float32x4 v_sqrt(const v_float32x4& x)\n{ return v_float32x4(_mm_sqrt_ps(x.val)); }\n\ninline v_float32x4 v_invsqrt(const v_float32x4& x)\n{\n    const __m128 _0_5 = _mm_set1_ps(0.5f), _1_5 = _mm_set1_ps(1.5f);\n    __m128 t = x.val;\n    __m128 h = _mm_mul_ps(t, _0_5);\n    t = _mm_rsqrt_ps(t);\n    t = _mm_mul_ps(t, _mm_sub_ps(_1_5, _mm_mul_ps(_mm_mul_ps(t, t), h)));\n    return v_float32x4(t);\n}\n\ninline v_float64x2 v_sqrt(const v_float64x2& x)\n{ return v_float64x2(_mm_sqrt_pd(x.val)); }\n\ninline v_float64x2 v_invsqrt(const v_float64x2& x)\n{\n    const __m128d v_1 = _mm_set1_pd(1.);\n    return v_float64x2(_mm_div_pd(v_1, _mm_sqrt_pd(x.val)));\n}\n\n#define OPENCV_HAL_IMPL_SSE_ABS_INT_FUNC(_Tpuvec, _Tpsvec, func, suffix, subWidth) \\\ninline _Tpuvec v_abs(const _Tpsvec& x) \\\n{ return _Tpuvec(_mm_##func##_ep##suffix(x.val, _mm_sub_ep##subWidth(_mm_setzero_si128(), x.val))); }\n\nOPENCV_HAL_IMPL_SSE_ABS_INT_FUNC(v_uint8x16, v_int8x16, min, u8, i8)\nOPENCV_HAL_IMPL_SSE_ABS_INT_FUNC(v_uint16x8, v_int16x8, max, i16, i16)\ninline v_uint32x4 v_abs(const v_int32x4& x)\n{\n    __m128i s = _mm_srli_epi32(x.val, 31);\n    __m128i f = _mm_srai_epi32(x.val, 31);\n    return v_uint32x4(_mm_add_epi32(_mm_xor_si128(x.val, f), s));\n}\ninline v_float32x4 v_abs(const v_float32x4& x)\n{ return v_float32x4(_mm_and_ps(x.val, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)))); }\ninline v_float64x2 v_abs(const v_float64x2& x)\n{\n    return v_float64x2(_mm_and_pd(x.val,\n        _mm_castsi128_pd(_mm_srli_epi64(_mm_set1_epi32(-1), 1))));\n}\n\n// TODO: exp, log, sin, cos\n\n#define OPENCV_HAL_IMPL_SSE_BIN_FUNC(_Tpvec, func, intrin) \\\ninline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val)); \\\n}\n\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_min, _mm_min_epu8)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_max, _mm_max_epu8)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_min, _mm_min_epi16)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_max, _mm_max_epi16)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float32x4, v_min, _mm_min_ps)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float32x4, v_max, _mm_max_ps)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float64x2, v_min, _mm_min_pd)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float64x2, v_max, _mm_max_pd)\n\ninline v_int8x16 v_min(const v_int8x16& a, const v_int8x16& b)\n{\n#if CV_SSE4_1\n    return v_int8x16(_mm_min_epi8(a.val, b.val));\n#else\n    __m128i delta = _mm_set1_epi8((char)-128);\n    return v_int8x16(_mm_xor_si128(delta, _mm_min_epu8(_mm_xor_si128(a.val, delta),\n                                                       _mm_xor_si128(b.val, delta))));\n#endif\n}\ninline v_int8x16 v_max(const v_int8x16& a, const v_int8x16& b)\n{\n#if CV_SSE4_1\n    return v_int8x16(_mm_max_epi8(a.val, b.val));\n#else\n    __m128i delta = _mm_set1_epi8((char)-128);\n    return v_int8x16(_mm_xor_si128(delta, _mm_max_epu8(_mm_xor_si128(a.val, delta),\n                                                       _mm_xor_si128(b.val, delta))));\n#endif\n}\ninline v_uint16x8 v_min(const v_uint16x8& a, const v_uint16x8& b)\n{\n#if CV_SSE4_1\n    return v_uint16x8(_mm_min_epu16(a.val, b.val));\n#else\n    return v_uint16x8(_mm_subs_epu16(a.val, _mm_subs_epu16(a.val, b.val)));\n#endif\n}\ninline v_uint16x8 v_max(const v_uint16x8& a, const v_uint16x8& b)\n{\n#if CV_SSE4_1\n    return v_uint16x8(_mm_max_epu16(a.val, b.val));\n#else\n    return v_uint16x8(_mm_adds_epu16(_mm_subs_epu16(a.val, b.val), b.val));\n#endif\n}\ninline v_uint32x4 v_min(const v_uint32x4& a, const v_uint32x4& b)\n{\n#if CV_SSE4_1\n    return v_uint32x4(_mm_min_epu32(a.val, b.val));\n#else\n    __m128i delta = _mm_set1_epi32((int)0x80000000);\n    __m128i mask = _mm_cmpgt_epi32(_mm_xor_si128(a.val, delta), _mm_xor_si128(b.val, delta));\n    return v_uint32x4(v_select_si128(mask, b.val, a.val));\n#endif\n}\ninline v_uint32x4 v_max(const v_uint32x4& a, const v_uint32x4& b)\n{\n#if CV_SSE4_1\n    return v_uint32x4(_mm_max_epu32(a.val, b.val));\n#else\n    __m128i delta = _mm_set1_epi32((int)0x80000000);\n    __m128i mask = _mm_cmpgt_epi32(_mm_xor_si128(a.val, delta), _mm_xor_si128(b.val, delta));\n    return v_uint32x4(v_select_si128(mask, a.val, b.val));\n#endif\n}\ninline v_int32x4 v_min(const v_int32x4& a, const v_int32x4& b)\n{\n#if CV_SSE4_1\n    return v_int32x4(_mm_min_epi32(a.val, b.val));\n#else\n    return v_int32x4(v_select_si128(_mm_cmpgt_epi32(a.val, b.val), b.val, a.val));\n#endif\n}\ninline v_int32x4 v_max(const v_int32x4& a, const v_int32x4& b)\n{\n#if CV_SSE4_1\n    return v_int32x4(_mm_max_epi32(a.val, b.val));\n#else\n    return v_int32x4(v_select_si128(_mm_cmpgt_epi32(a.val, b.val), a.val, b.val));\n#endif\n}\n\n#define OPENCV_HAL_IMPL_SSE_INT_CMP_OP(_Tpuvec, _Tpsvec, suffix, sbit) \\\ninline _Tpuvec operator == (const _Tpuvec& a, const _Tpuvec& b) \\\n{ return _Tpuvec(_mm_cmpeq_##suffix(a.val, b.val)); } \\\ninline _Tpuvec operator != (const _Tpuvec& a, const _Tpuvec& b) \\\n{ \\\n    __m128i not_mask = _mm_set1_epi32(-1); \\\n    return _Tpuvec(_mm_xor_si128(_mm_cmpeq_##suffix(a.val, b.val), not_mask)); \\\n} \\\ninline _Tpsvec operator == (const _Tpsvec& a, const _Tpsvec& b) \\\n{ return _Tpsvec(_mm_cmpeq_##suffix(a.val, b.val)); } \\\ninline _Tpsvec operator != (const _Tpsvec& a, const _Tpsvec& b) \\\n{ \\\n    __m128i not_mask = _mm_set1_epi32(-1); \\\n    return _Tpsvec(_mm_xor_si128(_mm_cmpeq_##suffix(a.val, b.val), not_mask)); \\\n} \\\ninline _Tpuvec operator < (const _Tpuvec& a, const _Tpuvec& b) \\\n{ \\\n    __m128i smask = _mm_set1_##suffix(sbit); \\\n    return _Tpuvec(_mm_cmpgt_##suffix(_mm_xor_si128(b.val, smask), _mm_xor_si128(a.val, smask))); \\\n} \\\ninline _Tpuvec operator > (const _Tpuvec& a, const _Tpuvec& b) \\\n{ \\\n    __m128i smask = _mm_set1_##suffix(sbit); \\\n    return _Tpuvec(_mm_cmpgt_##suffix(_mm_xor_si128(a.val, smask), _mm_xor_si128(b.val, smask))); \\\n} \\\ninline _Tpuvec operator <= (const _Tpuvec& a, const _Tpuvec& b) \\\n{ \\\n    __m128i smask = _mm_set1_##suffix(sbit); \\\n    __m128i not_mask = _mm_set1_epi32(-1); \\\n    __m128i res = _mm_cmpgt_##suffix(_mm_xor_si128(a.val, smask), _mm_xor_si128(b.val, smask)); \\\n    return _Tpuvec(_mm_xor_si128(res, not_mask)); \\\n} \\\ninline _Tpuvec operator >= (const _Tpuvec& a, const _Tpuvec& b) \\\n{ \\\n    __m128i smask = _mm_set1_##suffix(sbit); \\\n    __m128i not_mask = _mm_set1_epi32(-1); \\\n    __m128i res = _mm_cmpgt_##suffix(_mm_xor_si128(b.val, smask), _mm_xor_si128(a.val, smask)); \\\n    return _Tpuvec(_mm_xor_si128(res, not_mask)); \\\n} \\\ninline _Tpsvec operator < (const _Tpsvec& a, const _Tpsvec& b) \\\n{ \\\n    return _Tpsvec(_mm_cmpgt_##suffix(b.val, a.val)); \\\n} \\\ninline _Tpsvec operator > (const _Tpsvec& a, const _Tpsvec& b) \\\n{ \\\n    return _Tpsvec(_mm_cmpgt_##suffix(a.val, b.val)); \\\n} \\\ninline _Tpsvec operator <= (const _Tpsvec& a, const _Tpsvec& b) \\\n{ \\\n    __m128i not_mask = _mm_set1_epi32(-1); \\\n    return _Tpsvec(_mm_xor_si128(_mm_cmpgt_##suffix(a.val, b.val), not_mask)); \\\n} \\\ninline _Tpsvec operator >= (const _Tpsvec& a, const _Tpsvec& b) \\\n{ \\\n    __m128i not_mask = _mm_set1_epi32(-1); \\\n    return _Tpsvec(_mm_xor_si128(_mm_cmpgt_##suffix(b.val, a.val), not_mask)); \\\n}\n\nOPENCV_HAL_IMPL_SSE_INT_CMP_OP(v_uint8x16, v_int8x16, epi8, (char)-128)\nOPENCV_HAL_IMPL_SSE_INT_CMP_OP(v_uint16x8, v_int16x8, epi16, (short)-32768)\nOPENCV_HAL_IMPL_SSE_INT_CMP_OP(v_uint32x4, v_int32x4, epi32, (int)0x80000000)\n\n#define OPENCV_HAL_IMPL_SSE_FLT_CMP_OP(_Tpvec, suffix) \\\ninline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(_mm_cmpeq_##suffix(a.val, b.val)); } \\\ninline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(_mm_cmpneq_##suffix(a.val, b.val)); } \\\ninline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(_mm_cmplt_##suffix(a.val, b.val)); } \\\ninline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(_mm_cmpgt_##suffix(a.val, b.val)); } \\\ninline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(_mm_cmple_##suffix(a.val, b.val)); } \\\ninline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(_mm_cmpge_##suffix(a.val, b.val)); }\n\nOPENCV_HAL_IMPL_SSE_FLT_CMP_OP(v_float32x4, ps)\nOPENCV_HAL_IMPL_SSE_FLT_CMP_OP(v_float64x2, pd)\n\n#if CV_SSE4_1\n#define OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(_Tpvec) \\\ninline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(_mm_cmpeq_epi64(a.val, b.val)); } \\\ninline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \\\n{ return ~(a == b); }\n#else\n#define OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(_Tpvec) \\\ninline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \\\n{ __m128i cmp = _mm_cmpeq_epi32(a.val, b.val); \\\n  return _Tpvec(_mm_and_si128(cmp, _mm_shuffle_epi32(cmp, _MM_SHUFFLE(2, 3, 0, 1)))); } \\\ninline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \\\n{ return ~(a == b); }\n#endif\n\nOPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(v_uint64x2)\nOPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(v_int64x2)\n\ninline v_float32x4 v_not_nan(const v_float32x4& a)\n{ return v_float32x4(_mm_cmpord_ps(a.val, a.val)); }\ninline v_float64x2 v_not_nan(const v_float64x2& a)\n{ return v_float64x2(_mm_cmpord_pd(a.val, a.val)); }\n\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_add_wrap, _mm_add_epi8)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int8x16, v_add_wrap, _mm_add_epi8)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint16x8, v_add_wrap, _mm_add_epi16)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_add_wrap, _mm_add_epi16)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_sub_wrap, _mm_sub_epi8)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int8x16, v_sub_wrap, _mm_sub_epi8)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint16x8, v_sub_wrap, _mm_sub_epi16)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_sub_wrap, _mm_sub_epi16)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint16x8, v_mul_wrap, _mm_mullo_epi16)\nOPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_mul_wrap, _mm_mullo_epi16)\n\ninline v_uint8x16 v_mul_wrap(const v_uint8x16& a, const v_uint8x16& b)\n{\n    __m128i ad = _mm_srai_epi16(a.val, 8);\n    __m128i bd = _mm_srai_epi16(b.val, 8);\n    __m128i p0 = _mm_mullo_epi16(a.val, b.val); // even\n    __m128i p1 = _mm_slli_epi16(_mm_mullo_epi16(ad, bd), 8); // odd\n    const __m128i b01 = _mm_set1_epi32(0xFF00FF00);\n    return v_uint8x16(_v128_blendv_epi8(p0, p1, b01));\n}\ninline v_int8x16 v_mul_wrap(const v_int8x16& a, const v_int8x16& b)\n{\n    return v_reinterpret_as_s8(v_mul_wrap(v_reinterpret_as_u8(a), v_reinterpret_as_u8(b)));\n}\n\n/** Absolute difference **/\n\ninline v_uint8x16 v_absdiff(const v_uint8x16& a, const v_uint8x16& b)\n{ return v_add_wrap(a - b,  b - a); }\ninline v_uint16x8 v_absdiff(const v_uint16x8& a, const v_uint16x8& b)\n{ return v_add_wrap(a - b,  b - a); }\ninline v_uint32x4 v_absdiff(const v_uint32x4& a, const v_uint32x4& b)\n{ return v_max(a, b) - v_min(a, b); }\n\ninline v_uint8x16 v_absdiff(const v_int8x16& a, const v_int8x16& b)\n{\n    v_int8x16 d = v_sub_wrap(a, b);\n    v_int8x16 m = a < b;\n    return v_reinterpret_as_u8(v_sub_wrap(d ^ m, m));\n}\ninline v_uint16x8 v_absdiff(const v_int16x8& a, const v_int16x8& b)\n{\n    return v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b)));\n}\ninline v_uint32x4 v_absdiff(const v_int32x4& a, const v_int32x4& b)\n{\n    v_int32x4 d = a - b;\n    v_int32x4 m = a < b;\n    return v_reinterpret_as_u32((d ^ m) - m);\n}\n\n/** Saturating absolute difference **/\ninline v_int8x16 v_absdiffs(const v_int8x16& a, const v_int8x16& b)\n{\n    v_int8x16 d = a - b;\n    v_int8x16 m = a < b;\n    return (d ^ m) - m;\n }\ninline v_int16x8 v_absdiffs(const v_int16x8& a, const v_int16x8& b)\n{ return v_max(a, b) - v_min(a, b); }\n\n\ninline v_int32x4 v_fma(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return a * b + c;\n}\n\ninline v_int32x4 v_muladd(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\ninline v_float32x4 v_fma(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n#if CV_FMA3\n    return v_float32x4(_mm_fmadd_ps(a.val, b.val, c.val));\n#else\n    return v_float32x4(_mm_add_ps(_mm_mul_ps(a.val, b.val), c.val));\n#endif\n}\n\ninline v_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n#if CV_FMA3\n    return v_float64x2(_mm_fmadd_pd(a.val, b.val, c.val));\n#else\n    return v_float64x2(_mm_add_pd(_mm_mul_pd(a.val, b.val), c.val));\n#endif\n}\n\n#define OPENCV_HAL_IMPL_SSE_MISC_FLT_OP(_Tpvec, _Tp, _Tpreg, suffix, absmask_vec) \\\ninline _Tpvec v_absdiff(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    _Tpreg absmask = _mm_castsi128_##suffix(absmask_vec); \\\n    return _Tpvec(_mm_and_##suffix(_mm_sub_##suffix(a.val, b.val), absmask)); \\\n} \\\ninline _Tpvec v_magnitude(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    _Tpvec res = v_fma(a, a, b*b); \\\n    return _Tpvec(_mm_sqrt_##suffix(res.val)); \\\n} \\\ninline _Tpvec v_sqr_magnitude(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return v_fma(a, a, b*b); \\\n} \\\ninline _Tpvec v_muladd(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c) \\\n{ \\\n    return v_fma(a, b, c); \\\n}\n\nOPENCV_HAL_IMPL_SSE_MISC_FLT_OP(v_float32x4, float, __m128, ps, _mm_set1_epi32((int)0x7fffffff))\nOPENCV_HAL_IMPL_SSE_MISC_FLT_OP(v_float64x2, double, __m128d, pd, _mm_srli_epi64(_mm_set1_epi32(-1), 1))\n\n#define OPENCV_HAL_IMPL_SSE_SHIFT_OP(_Tpuvec, _Tpsvec, suffix, srai) \\\ninline _Tpuvec operator << (const _Tpuvec& a, int imm) \\\n{ \\\n    return _Tpuvec(_mm_slli_##suffix(a.val, imm)); \\\n} \\\ninline _Tpsvec operator << (const _Tpsvec& a, int imm) \\\n{ \\\n    return _Tpsvec(_mm_slli_##suffix(a.val, imm)); \\\n} \\\ninline _Tpuvec operator >> (const _Tpuvec& a, int imm) \\\n{ \\\n    return _Tpuvec(_mm_srli_##suffix(a.val, imm)); \\\n} \\\ninline _Tpsvec operator >> (const _Tpsvec& a, int imm) \\\n{ \\\n    return _Tpsvec(srai(a.val, imm)); \\\n} \\\ntemplate<int imm> \\\ninline _Tpuvec v_shl(const _Tpuvec& a) \\\n{ \\\n    return _Tpuvec(_mm_slli_##suffix(a.val, imm)); \\\n} \\\ntemplate<int imm> \\\ninline _Tpsvec v_shl(const _Tpsvec& a) \\\n{ \\\n    return _Tpsvec(_mm_slli_##suffix(a.val, imm)); \\\n} \\\ntemplate<int imm> \\\ninline _Tpuvec v_shr(const _Tpuvec& a) \\\n{ \\\n    return _Tpuvec(_mm_srli_##suffix(a.val, imm)); \\\n} \\\ntemplate<int imm> \\\ninline _Tpsvec v_shr(const _Tpsvec& a) \\\n{ \\\n    return _Tpsvec(srai(a.val, imm)); \\\n}\n\nOPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint16x8, v_int16x8, epi16, _mm_srai_epi16)\nOPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint32x4, v_int32x4, epi32, _mm_srai_epi32)\nOPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint64x2, v_int64x2, epi64, v_srai_epi64)\n\nnamespace hal_sse_internal\n{\n    template <int imm,\n        bool is_invalid = ((imm < 0) || (imm > 16)),\n        bool is_first = (imm == 0),\n        bool is_half = (imm == 8),\n        bool is_second = (imm == 16),\n        bool is_other = (((imm > 0) && (imm < 8)) || ((imm > 8) && (imm < 16)))>\n    class v_sse_palignr_u8_class;\n\n    template <int imm>\n    class v_sse_palignr_u8_class<imm, true, false, false, false, false>;\n\n    template <int imm>\n    class v_sse_palignr_u8_class<imm, false, true, false, false, false>\n    {\n    public:\n        inline __m128i operator()(const __m128i& a, const __m128i&) const\n        {\n            return a;\n        }\n    };\n\n    template <int imm>\n    class v_sse_palignr_u8_class<imm, false, false, true, false, false>\n    {\n    public:\n        inline __m128i operator()(const __m128i& a, const __m128i& b) const\n        {\n            return _mm_unpacklo_epi64(_mm_unpackhi_epi64(a, a), b);\n        }\n    };\n\n    template <int imm>\n    class v_sse_palignr_u8_class<imm, false, false, false, true, false>\n    {\n    public:\n        inline __m128i operator()(const __m128i&, const __m128i& b) const\n        {\n            return b;\n        }\n    };\n\n    template <int imm>\n    class v_sse_palignr_u8_class<imm, false, false, false, false, true>\n    {\n#if CV_SSSE3\n    public:\n        inline __m128i operator()(const __m128i& a, const __m128i& b) const\n        {\n            return _mm_alignr_epi8(b, a, imm);\n        }\n#else\n    public:\n        inline __m128i operator()(const __m128i& a, const __m128i& b) const\n        {\n            enum { imm2 = (sizeof(__m128i) - imm) };\n            return _mm_or_si128(_mm_srli_si128(a, imm), _mm_slli_si128(b, imm2));\n        }\n#endif\n    };\n\n    template <int imm>\n    inline __m128i v_sse_palignr_u8(const __m128i& a, const __m128i& b)\n    {\n        CV_StaticAssert((imm >= 0) && (imm <= 16), \"Invalid imm for v_sse_palignr_u8.\");\n        return v_sse_palignr_u8_class<imm>()(a, b);\n    }\n}\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_right(const _Tpvec &a)\n{\n    using namespace hal_sse_internal;\n    enum { imm2 = (imm * sizeof(typename _Tpvec::lane_type)) };\n    return _Tpvec(v_sse_reinterpret_as<typename _Tpvec::vector_type>(\n        _mm_srli_si128(\n            v_sse_reinterpret_as<__m128i>(a.val), imm2)));\n}\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_left(const _Tpvec &a)\n{\n    using namespace hal_sse_internal;\n    enum { imm2 = (imm * sizeof(typename _Tpvec::lane_type)) };\n    return _Tpvec(v_sse_reinterpret_as<typename _Tpvec::vector_type>(\n        _mm_slli_si128(\n            v_sse_reinterpret_as<__m128i>(a.val), imm2)));\n}\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_right(const _Tpvec &a, const _Tpvec &b)\n{\n    using namespace hal_sse_internal;\n    enum { imm2 = (imm * sizeof(typename _Tpvec::lane_type)) };\n    return _Tpvec(v_sse_reinterpret_as<typename _Tpvec::vector_type>(\n        v_sse_palignr_u8<imm2>(\n            v_sse_reinterpret_as<__m128i>(a.val),\n            v_sse_reinterpret_as<__m128i>(b.val))));\n}\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_left(const _Tpvec &a, const _Tpvec &b)\n{\n    using namespace hal_sse_internal;\n    enum { imm2 = ((_Tpvec::nlanes - imm) * sizeof(typename _Tpvec::lane_type)) };\n    return _Tpvec(v_sse_reinterpret_as<typename _Tpvec::vector_type>(\n        v_sse_palignr_u8<imm2>(\n            v_sse_reinterpret_as<__m128i>(b.val),\n            v_sse_reinterpret_as<__m128i>(a.val))));\n}\n\n#define OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(_Tpvec, _Tp) \\\ninline _Tpvec v_load(const _Tp* ptr) \\\n{ return _Tpvec(_mm_loadu_si128((const __m128i*)ptr)); } \\\ninline _Tpvec v_load_aligned(const _Tp* ptr) \\\n{ return _Tpvec(_mm_load_si128((const __m128i*)ptr)); } \\\ninline _Tpvec v_load_low(const _Tp* ptr) \\\n{ return _Tpvec(_mm_loadl_epi64((const __m128i*)ptr)); } \\\ninline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \\\n{ \\\n    return _Tpvec(_mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i*)ptr0), \\\n                                     _mm_loadl_epi64((const __m128i*)ptr1))); \\\n} \\\ninline void v_store(_Tp* ptr, const _Tpvec& a) \\\n{ _mm_storeu_si128((__m128i*)ptr, a.val); } \\\ninline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \\\n{ _mm_store_si128((__m128i*)ptr, a.val); } \\\ninline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \\\n{ _mm_stream_si128((__m128i*)ptr, a.val); } \\\ninline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \\\n{ \\\n    if( mode == hal::STORE_UNALIGNED ) \\\n        _mm_storeu_si128((__m128i*)ptr, a.val); \\\n    else if( mode == hal::STORE_ALIGNED_NOCACHE )  \\\n        _mm_stream_si128((__m128i*)ptr, a.val); \\\n    else \\\n        _mm_store_si128((__m128i*)ptr, a.val); \\\n} \\\ninline void v_store_low(_Tp* ptr, const _Tpvec& a) \\\n{ _mm_storel_epi64((__m128i*)ptr, a.val); } \\\ninline void v_store_high(_Tp* ptr, const _Tpvec& a) \\\n{ _mm_storel_epi64((__m128i*)ptr, _mm_unpackhi_epi64(a.val, a.val)); }\n\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint8x16, uchar)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int8x16, schar)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint16x8, ushort)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int16x8, short)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint32x4, unsigned)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int32x4, int)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint64x2, uint64)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int64x2, int64)\n\n#define OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(_Tpvec, _Tp, suffix) \\\ninline _Tpvec v_load(const _Tp* ptr) \\\n{ return _Tpvec(_mm_loadu_##suffix(ptr)); } \\\ninline _Tpvec v_load_aligned(const _Tp* ptr) \\\n{ return _Tpvec(_mm_load_##suffix(ptr)); } \\\ninline _Tpvec v_load_low(const _Tp* ptr) \\\n{ return _Tpvec(_mm_castsi128_##suffix(_mm_loadl_epi64((const __m128i*)ptr))); } \\\ninline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \\\n{ \\\n    return _Tpvec(_mm_castsi128_##suffix( \\\n        _mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i*)ptr0), \\\n                           _mm_loadl_epi64((const __m128i*)ptr1)))); \\\n} \\\ninline void v_store(_Tp* ptr, const _Tpvec& a) \\\n{ _mm_storeu_##suffix(ptr, a.val); } \\\ninline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \\\n{ _mm_store_##suffix(ptr, a.val); } \\\ninline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \\\n{ _mm_stream_##suffix(ptr, a.val); } \\\ninline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \\\n{ \\\n    if( mode == hal::STORE_UNALIGNED ) \\\n        _mm_storeu_##suffix(ptr, a.val); \\\n    else if( mode == hal::STORE_ALIGNED_NOCACHE )  \\\n        _mm_stream_##suffix(ptr, a.val); \\\n    else \\\n        _mm_store_##suffix(ptr, a.val); \\\n} \\\ninline void v_store_low(_Tp* ptr, const _Tpvec& a) \\\n{ _mm_storel_epi64((__m128i*)ptr, _mm_cast##suffix##_si128(a.val)); } \\\ninline void v_store_high(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    __m128i a1 = _mm_cast##suffix##_si128(a.val); \\\n    _mm_storel_epi64((__m128i*)ptr, _mm_unpackhi_epi64(a1, a1)); \\\n}\n\nOPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float32x4, float, ps)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float64x2, double, pd)\n\ninline unsigned v_reduce_sum(const v_uint8x16& a)\n{\n    __m128i half = _mm_sad_epu8(a.val, _mm_setzero_si128());\n    return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(half, _mm_unpackhi_epi64(half, half)));\n}\ninline int v_reduce_sum(const v_int8x16& a)\n{\n    __m128i half = _mm_set1_epi8((schar)-128);\n    half = _mm_sad_epu8(_mm_xor_si128(a.val, half), _mm_setzero_si128());\n    return _mm_cvtsi128_si32(_mm_add_epi32(half, _mm_unpackhi_epi64(half, half))) - 2048;\n}\n#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_16(func) \\\ninline schar v_reduce_##func(const v_int8x16& a) \\\n{ \\\n    __m128i val = a.val; \\\n    __m128i smask = _mm_set1_epi8((schar)-128); \\\n    val = _mm_xor_si128(val, smask); \\\n    val = _mm_##func##_epu8(val, _mm_srli_si128(val,8)); \\\n    val = _mm_##func##_epu8(val, _mm_srli_si128(val,4)); \\\n    val = _mm_##func##_epu8(val, _mm_srli_si128(val,2)); \\\n    val = _mm_##func##_epu8(val, _mm_srli_si128(val,1)); \\\n    return (schar)_mm_cvtsi128_si32(val) ^ (schar)-128; \\\n} \\\ninline uchar v_reduce_##func(const v_uint8x16& a) \\\n{ \\\n    __m128i val = a.val; \\\n    val = _mm_##func##_epu8(val, _mm_srli_si128(val,8)); \\\n    val = _mm_##func##_epu8(val, _mm_srli_si128(val,4)); \\\n    val = _mm_##func##_epu8(val, _mm_srli_si128(val,2)); \\\n    val = _mm_##func##_epu8(val, _mm_srli_si128(val,1)); \\\n    return (uchar)_mm_cvtsi128_si32(val); \\\n}\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_16(max)\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_16(min)\n\n#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_8(_Tpvec, scalartype, func, suffix, sbit) \\\ninline scalartype v_reduce_##func(const v_##_Tpvec& a) \\\n{ \\\n    __m128i val = a.val; \\\n    val = _mm_##func##_##suffix(val, _mm_srli_si128(val,8)); \\\n    val = _mm_##func##_##suffix(val, _mm_srli_si128(val,4)); \\\n    val = _mm_##func##_##suffix(val, _mm_srli_si128(val,2)); \\\n    return (scalartype)_mm_cvtsi128_si32(val); \\\n} \\\ninline unsigned scalartype v_reduce_##func(const v_u##_Tpvec& a) \\\n{ \\\n    __m128i val = a.val; \\\n    __m128i smask = _mm_set1_epi16(sbit); \\\n    val = _mm_xor_si128(val, smask); \\\n    val = _mm_##func##_##suffix(val, _mm_srli_si128(val,8)); \\\n    val = _mm_##func##_##suffix(val, _mm_srli_si128(val,4)); \\\n    val = _mm_##func##_##suffix(val, _mm_srli_si128(val,2)); \\\n    return (unsigned scalartype)(_mm_cvtsi128_si32(val) ^  sbit); \\\n}\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_8(int16x8, short, max, epi16, (short)-32768)\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_8(int16x8, short, min, epi16, (short)-32768)\n\n#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(_Tpvec, scalartype, regtype, suffix, cast_from, cast_to, extract) \\\ninline scalartype v_reduce_sum(const _Tpvec& a) \\\n{ \\\n    regtype val = a.val; \\\n    val = _mm_add_##suffix(val, cast_to(_mm_srli_si128(cast_from(val), 8))); \\\n    val = _mm_add_##suffix(val, cast_to(_mm_srli_si128(cast_from(val), 4))); \\\n    return (scalartype)_mm_cvt##extract(val); \\\n}\n\n#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(_Tpvec, scalartype, func, scalar_func) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    scalartype CV_DECL_ALIGNED(16) buf[4]; \\\n    v_store_aligned(buf, a); \\\n    scalartype s0 = scalar_func(buf[0], buf[1]); \\\n    scalartype s1 = scalar_func(buf[2], buf[3]); \\\n    return scalar_func(s0, s1); \\\n}\n\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(v_uint32x4, unsigned, __m128i, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP, si128_si32)\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(v_int32x4, int, __m128i, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP, si128_si32)\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(v_float32x4, float, __m128, ps, _mm_castps_si128, _mm_castsi128_ps, ss_f32)\n\ninline int v_reduce_sum(const v_int16x8& a)\n{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); }\ninline unsigned v_reduce_sum(const v_uint16x8& a)\n{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); }\n\ninline uint64 v_reduce_sum(const v_uint64x2& a)\n{\n    uint64 CV_DECL_ALIGNED(32) idx[2];\n    v_store_aligned(idx, a);\n    return idx[0] + idx[1];\n}\ninline int64 v_reduce_sum(const v_int64x2& a)\n{\n    int64 CV_DECL_ALIGNED(32) idx[2];\n    v_store_aligned(idx, a);\n    return idx[0] + idx[1];\n}\ninline double v_reduce_sum(const v_float64x2& a)\n{\n    double CV_DECL_ALIGNED(32) idx[2];\n    v_store_aligned(idx, a);\n    return idx[0] + idx[1];\n}\n\ninline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b,\n                                 const v_float32x4& c, const v_float32x4& d)\n{\n#if CV_SSE3\n    __m128 ab = _mm_hadd_ps(a.val, b.val);\n    __m128 cd = _mm_hadd_ps(c.val, d.val);\n    return v_float32x4(_mm_hadd_ps(ab, cd));\n#else\n    __m128 ac = _mm_add_ps(_mm_unpacklo_ps(a.val, c.val), _mm_unpackhi_ps(a.val, c.val));\n    __m128 bd = _mm_add_ps(_mm_unpacklo_ps(b.val, d.val), _mm_unpackhi_ps(b.val, d.val));\n    return v_float32x4(_mm_add_ps(_mm_unpacklo_ps(ac, bd), _mm_unpackhi_ps(ac, bd)));\n#endif\n}\n\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_uint32x4, unsigned, max, std::max)\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_uint32x4, unsigned, min, std::min)\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_int32x4, int, max, std::max)\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_int32x4, int, min, std::min)\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, max, std::max)\nOPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, min, std::min)\n\ninline unsigned v_reduce_sad(const v_uint8x16& a, const v_uint8x16& b)\n{\n    __m128i half = _mm_sad_epu8(a.val, b.val);\n    return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(half, _mm_unpackhi_epi64(half, half)));\n}\ninline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b)\n{\n    __m128i half = _mm_set1_epi8(0x7f);\n    half = _mm_sad_epu8(_mm_add_epi8(a.val, half), _mm_add_epi8(b.val, half));\n    return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(half, _mm_unpackhi_epi64(half, half)));\n}\ninline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v_uint32x4 l, h;\n    v_expand(v_absdiff(a, b), l, h);\n    return v_reduce_sum(l + h);\n}\ninline unsigned v_reduce_sad(const v_int16x8& a, const v_int16x8& b)\n{\n    v_uint32x4 l, h;\n    v_expand(v_absdiff(a, b), l, h);\n    return v_reduce_sum(l + h);\n}\ninline unsigned v_reduce_sad(const v_uint32x4& a, const v_uint32x4& b)\n{\n    return v_reduce_sum(v_absdiff(a, b));\n}\ninline unsigned v_reduce_sad(const v_int32x4& a, const v_int32x4& b)\n{\n    return v_reduce_sum(v_absdiff(a, b));\n}\ninline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b)\n{\n    return v_reduce_sum(v_absdiff(a, b));\n}\n\ninline v_uint8x16 v_popcount(const v_uint8x16& a)\n{\n    __m128i m1 = _mm_set1_epi32(0x55555555);\n    __m128i m2 = _mm_set1_epi32(0x33333333);\n    __m128i m4 = _mm_set1_epi32(0x0f0f0f0f);\n    __m128i p = a.val;\n    p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 1), m1), _mm_and_si128(p, m1));\n    p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 2), m2), _mm_and_si128(p, m2));\n    p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 4), m4), _mm_and_si128(p, m4));\n    return v_uint8x16(p);\n}\ninline v_uint16x8 v_popcount(const v_uint16x8& a)\n{\n    v_uint8x16 p = v_popcount(v_reinterpret_as_u8(a));\n    p += v_rotate_right<1>(p);\n    return v_reinterpret_as_u16(p) & v_setall_u16(0x00ff);\n}\ninline v_uint32x4 v_popcount(const v_uint32x4& a)\n{\n    v_uint8x16 p = v_popcount(v_reinterpret_as_u8(a));\n    p += v_rotate_right<1>(p);\n    p += v_rotate_right<2>(p);\n    return v_reinterpret_as_u32(p) & v_setall_u32(0x000000ff);\n}\ninline v_uint64x2 v_popcount(const v_uint64x2& a)\n{\n    return v_uint64x2(_mm_sad_epu8(v_popcount(v_reinterpret_as_u8(a)).val, _mm_setzero_si128()));\n}\ninline v_uint8x16 v_popcount(const v_int8x16& a)\n{ return v_popcount(v_reinterpret_as_u8(a)); }\ninline v_uint16x8 v_popcount(const v_int16x8& a)\n{ return v_popcount(v_reinterpret_as_u16(a)); }\ninline v_uint32x4 v_popcount(const v_int32x4& a)\n{ return v_popcount(v_reinterpret_as_u32(a)); }\ninline v_uint64x2 v_popcount(const v_int64x2& a)\n{ return v_popcount(v_reinterpret_as_u64(a)); }\n\n#define OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(_Tpvec, suffix, cast_op, allmask) \\\ninline int v_signmask(const _Tpvec& a)   { return _mm_movemask_##suffix(cast_op(a.val)); } \\\ninline bool v_check_all(const _Tpvec& a) { return _mm_movemask_##suffix(cast_op(a.val)) == allmask; } \\\ninline bool v_check_any(const _Tpvec& a) { return _mm_movemask_##suffix(cast_op(a.val)) != 0; }\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint8x16, epi8, OPENCV_HAL_NOP, 65535)\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int8x16, epi8, OPENCV_HAL_NOP, 65535)\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint32x4, ps, _mm_castsi128_ps, 15)\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int32x4, ps, _mm_castsi128_ps, 15)\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint64x2, pd, _mm_castsi128_pd, 3)\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int64x2, pd, _mm_castsi128_pd, 3)\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float32x4, ps, OPENCV_HAL_NOP, 15)\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float64x2, pd, OPENCV_HAL_NOP, 3)\n\n#define OPENCV_HAL_IMPL_SSE_CHECK_SIGNS_SHORT(_Tpvec) \\\ninline int v_signmask(const _Tpvec& a) { return _mm_movemask_epi8(_mm_packs_epi16(a.val, a.val)) & 255; } \\\ninline bool v_check_all(const _Tpvec& a) { return (_mm_movemask_epi8(a.val) & 0xaaaa) == 0xaaaa; } \\\ninline bool v_check_any(const _Tpvec& a) { return (_mm_movemask_epi8(a.val) & 0xaaaa) != 0; }\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS_SHORT(v_uint16x8)\nOPENCV_HAL_IMPL_SSE_CHECK_SIGNS_SHORT(v_int16x8)\n\ninline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); }\ninline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); }\ninline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; }\ninline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; }\ninline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; }\ninline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; }\ninline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; }\ninline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; }\ninline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; }\ninline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; }\n\n#if CV_SSE4_1\n#define OPENCV_HAL_IMPL_SSE_SELECT(_Tpvec, cast_ret, cast, suffix) \\\ninline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(cast_ret(_mm_blendv_##suffix(cast(b.val), cast(a.val), cast(mask.val)))); \\\n}\n\nOPENCV_HAL_IMPL_SSE_SELECT(v_uint8x16, OPENCV_HAL_NOP, OPENCV_HAL_NOP, epi8)\nOPENCV_HAL_IMPL_SSE_SELECT(v_int8x16, OPENCV_HAL_NOP, OPENCV_HAL_NOP, epi8)\nOPENCV_HAL_IMPL_SSE_SELECT(v_uint16x8, OPENCV_HAL_NOP, OPENCV_HAL_NOP, epi8)\nOPENCV_HAL_IMPL_SSE_SELECT(v_int16x8, OPENCV_HAL_NOP, OPENCV_HAL_NOP, epi8)\nOPENCV_HAL_IMPL_SSE_SELECT(v_uint32x4, _mm_castps_si128, _mm_castsi128_ps, ps)\nOPENCV_HAL_IMPL_SSE_SELECT(v_int32x4, _mm_castps_si128, _mm_castsi128_ps, ps)\n// OPENCV_HAL_IMPL_SSE_SELECT(v_uint64x2, TBD, TBD, pd)\n// OPENCV_HAL_IMPL_SSE_SELECT(v_int64x2, TBD, TBD, ps)\nOPENCV_HAL_IMPL_SSE_SELECT(v_float32x4, OPENCV_HAL_NOP, OPENCV_HAL_NOP, ps)\nOPENCV_HAL_IMPL_SSE_SELECT(v_float64x2, OPENCV_HAL_NOP, OPENCV_HAL_NOP, pd)\n\n#else // CV_SSE4_1\n\n#define OPENCV_HAL_IMPL_SSE_SELECT(_Tpvec, suffix) \\\ninline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(_mm_xor_##suffix(b.val, _mm_and_##suffix(_mm_xor_##suffix(b.val, a.val), mask.val))); \\\n}\n\nOPENCV_HAL_IMPL_SSE_SELECT(v_uint8x16, si128)\nOPENCV_HAL_IMPL_SSE_SELECT(v_int8x16, si128)\nOPENCV_HAL_IMPL_SSE_SELECT(v_uint16x8, si128)\nOPENCV_HAL_IMPL_SSE_SELECT(v_int16x8, si128)\nOPENCV_HAL_IMPL_SSE_SELECT(v_uint32x4, si128)\nOPENCV_HAL_IMPL_SSE_SELECT(v_int32x4, si128)\n// OPENCV_HAL_IMPL_SSE_SELECT(v_uint64x2, si128)\n// OPENCV_HAL_IMPL_SSE_SELECT(v_int64x2, si128)\nOPENCV_HAL_IMPL_SSE_SELECT(v_float32x4, ps)\nOPENCV_HAL_IMPL_SSE_SELECT(v_float64x2, pd)\n#endif\n\n/* Expand */\n#define OPENCV_HAL_IMPL_SSE_EXPAND(_Tpvec, _Tpwvec, _Tp, intrin)    \\\n    inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \\\n    {                                                               \\\n        b0.val = intrin(a.val);                                     \\\n        b1.val = __CV_CAT(intrin, _high)(a.val);                    \\\n    }                                                               \\\n    inline _Tpwvec v_expand_low(const _Tpvec& a)                    \\\n    { return _Tpwvec(intrin(a.val)); }                              \\\n    inline _Tpwvec v_expand_high(const _Tpvec& a)                   \\\n    { return _Tpwvec(__CV_CAT(intrin, _high)(a.val)); }             \\\n    inline _Tpwvec v_load_expand(const _Tp* ptr)                    \\\n    {                                                               \\\n        __m128i a = _mm_loadl_epi64((const __m128i*)ptr);           \\\n        return _Tpwvec(intrin(a));                                  \\\n    }\n\nOPENCV_HAL_IMPL_SSE_EXPAND(v_uint8x16, v_uint16x8,  uchar,    _v128_cvtepu8_epi16)\nOPENCV_HAL_IMPL_SSE_EXPAND(v_int8x16,  v_int16x8,   schar,    _v128_cvtepi8_epi16)\nOPENCV_HAL_IMPL_SSE_EXPAND(v_uint16x8, v_uint32x4,  ushort,   _v128_cvtepu16_epi32)\nOPENCV_HAL_IMPL_SSE_EXPAND(v_int16x8,  v_int32x4,   short,    _v128_cvtepi16_epi32)\nOPENCV_HAL_IMPL_SSE_EXPAND(v_uint32x4, v_uint64x2,  unsigned, _v128_cvtepu32_epi64)\nOPENCV_HAL_IMPL_SSE_EXPAND(v_int32x4,  v_int64x2,   int,      _v128_cvtepi32_epi64)\n\n#define OPENCV_HAL_IMPL_SSE_EXPAND_Q(_Tpvec, _Tp, intrin)  \\\n    inline _Tpvec v_load_expand_q(const _Tp* ptr)          \\\n    {                                                      \\\n        __m128i a = _mm_cvtsi32_si128(*(const int*)ptr);   \\\n        return _Tpvec(intrin(a));                          \\\n    }\n\nOPENCV_HAL_IMPL_SSE_EXPAND_Q(v_uint32x4, uchar, _v128_cvtepu8_epi32)\nOPENCV_HAL_IMPL_SSE_EXPAND_Q(v_int32x4,  schar, _v128_cvtepi8_epi32)\n\n#define OPENCV_HAL_IMPL_SSE_UNPACKS(_Tpvec, suffix, cast_from, cast_to) \\\ninline void v_zip(const _Tpvec& a0, const _Tpvec& a1, _Tpvec& b0, _Tpvec& b1) \\\n{ \\\n    b0.val = _mm_unpacklo_##suffix(a0.val, a1.val); \\\n    b1.val = _mm_unpackhi_##suffix(a0.val, a1.val); \\\n} \\\ninline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    __m128i a1 = cast_from(a.val), b1 = cast_from(b.val); \\\n    return _Tpvec(cast_to(_mm_unpacklo_epi64(a1, b1))); \\\n} \\\ninline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    __m128i a1 = cast_from(a.val), b1 = cast_from(b.val); \\\n    return _Tpvec(cast_to(_mm_unpackhi_epi64(a1, b1))); \\\n} \\\ninline void v_recombine(const _Tpvec& a, const _Tpvec& b, _Tpvec& c, _Tpvec& d) \\\n{ \\\n    __m128i a1 = cast_from(a.val), b1 = cast_from(b.val); \\\n    c.val = cast_to(_mm_unpacklo_epi64(a1, b1)); \\\n    d.val = cast_to(_mm_unpackhi_epi64(a1, b1)); \\\n}\n\nOPENCV_HAL_IMPL_SSE_UNPACKS(v_uint8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_UNPACKS(v_int8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_UNPACKS(v_uint16x8, epi16, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_UNPACKS(v_int16x8, epi16, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_UNPACKS(v_uint32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_UNPACKS(v_int32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_UNPACKS(v_float32x4, ps, _mm_castps_si128, _mm_castsi128_ps)\nOPENCV_HAL_IMPL_SSE_UNPACKS(v_float64x2, pd, _mm_castpd_si128, _mm_castsi128_pd)\n\ninline v_uint8x16 v_reverse(const v_uint8x16 &a)\n{\n#if CV_SSSE3\n    static const __m128i perm = _mm_setr_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);\n    return v_uint8x16(_mm_shuffle_epi8(a.val, perm));\n#else\n    uchar CV_DECL_ALIGNED(32) d[16];\n    v_store_aligned(d, a);\n    return v_uint8x16(d[15], d[14], d[13], d[12], d[11], d[10], d[9], d[8], d[7], d[6], d[5], d[4], d[3], d[2], d[1], d[0]);\n#endif\n}\n\ninline v_int8x16 v_reverse(const v_int8x16 &a)\n{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); }\n\ninline v_uint16x8 v_reverse(const v_uint16x8 &a)\n{\n#if CV_SSSE3\n    static const __m128i perm = _mm_setr_epi8(14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1);\n    return v_uint16x8(_mm_shuffle_epi8(a.val, perm));\n#else\n    __m128i r = _mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 1, 2, 3));\n    r = _mm_shufflelo_epi16(r, _MM_SHUFFLE(2, 3, 0, 1));\n    r = _mm_shufflehi_epi16(r, _MM_SHUFFLE(2, 3, 0, 1));\n    return v_uint16x8(r);\n#endif\n}\n\ninline v_int16x8 v_reverse(const v_int16x8 &a)\n{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); }\n\ninline v_uint32x4 v_reverse(const v_uint32x4 &a)\n{\n    return v_uint32x4(_mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 1, 2, 3)));\n}\n\ninline v_int32x4 v_reverse(const v_int32x4 &a)\n{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_float32x4 v_reverse(const v_float32x4 &a)\n{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_uint64x2 v_reverse(const v_uint64x2 &a)\n{\n    return v_uint64x2(_mm_shuffle_epi32(a.val, _MM_SHUFFLE(1, 0, 3, 2)));\n}\n\ninline v_int64x2 v_reverse(const v_int64x2 &a)\n{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); }\n\ninline v_float64x2 v_reverse(const v_float64x2 &a)\n{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); }\n\ntemplate<int s, typename _Tpvec>\ninline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b)\n{\n    return v_rotate_right<s>(a, b);\n}\n\ninline v_int32x4 v_round(const v_float32x4& a)\n{ return v_int32x4(_mm_cvtps_epi32(a.val)); }\n\ninline v_int32x4 v_floor(const v_float32x4& a)\n{\n    __m128i a1 = _mm_cvtps_epi32(a.val);\n    __m128i mask = _mm_castps_si128(_mm_cmpgt_ps(_mm_cvtepi32_ps(a1), a.val));\n    return v_int32x4(_mm_add_epi32(a1, mask));\n}\n\ninline v_int32x4 v_ceil(const v_float32x4& a)\n{\n    __m128i a1 = _mm_cvtps_epi32(a.val);\n    __m128i mask = _mm_castps_si128(_mm_cmpgt_ps(a.val, _mm_cvtepi32_ps(a1)));\n    return v_int32x4(_mm_sub_epi32(a1, mask));\n}\n\ninline v_int32x4 v_trunc(const v_float32x4& a)\n{ return v_int32x4(_mm_cvttps_epi32(a.val)); }\n\ninline v_int32x4 v_round(const v_float64x2& a)\n{ return v_int32x4(_mm_cvtpd_epi32(a.val)); }\n\ninline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b)\n{\n    __m128i ai = _mm_cvtpd_epi32(a.val), bi = _mm_cvtpd_epi32(b.val);\n    return v_int32x4(_mm_unpacklo_epi64(ai, bi));\n}\n\ninline v_int32x4 v_floor(const v_float64x2& a)\n{\n    __m128i a1 = _mm_cvtpd_epi32(a.val);\n    __m128i mask = _mm_castpd_si128(_mm_cmpgt_pd(_mm_cvtepi32_pd(a1), a.val));\n    mask = _mm_srli_si128(_mm_slli_si128(mask, 4), 8); // m0 m0 m1 m1 => m0 m1 0 0\n    return v_int32x4(_mm_add_epi32(a1, mask));\n}\n\ninline v_int32x4 v_ceil(const v_float64x2& a)\n{\n    __m128i a1 = _mm_cvtpd_epi32(a.val);\n    __m128i mask = _mm_castpd_si128(_mm_cmpgt_pd(a.val, _mm_cvtepi32_pd(a1)));\n    mask = _mm_srli_si128(_mm_slli_si128(mask, 4), 8); // m0 m0 m1 m1 => m0 m1 0 0\n    return v_int32x4(_mm_sub_epi32(a1, mask));\n}\n\ninline v_int32x4 v_trunc(const v_float64x2& a)\n{ return v_int32x4(_mm_cvttpd_epi32(a.val)); }\n\n#define OPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(_Tpvec, suffix, cast_from, cast_to) \\\ninline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1, \\\n                           const _Tpvec& a2, const _Tpvec& a3, \\\n                           _Tpvec& b0, _Tpvec& b1, \\\n                           _Tpvec& b2, _Tpvec& b3) \\\n{ \\\n    __m128i t0 = cast_from(_mm_unpacklo_##suffix(a0.val, a1.val)); \\\n    __m128i t1 = cast_from(_mm_unpacklo_##suffix(a2.val, a3.val)); \\\n    __m128i t2 = cast_from(_mm_unpackhi_##suffix(a0.val, a1.val)); \\\n    __m128i t3 = cast_from(_mm_unpackhi_##suffix(a2.val, a3.val)); \\\n\\\n    b0.val = cast_to(_mm_unpacklo_epi64(t0, t1)); \\\n    b1.val = cast_to(_mm_unpackhi_epi64(t0, t1)); \\\n    b2.val = cast_to(_mm_unpacklo_epi64(t2, t3)); \\\n    b3.val = cast_to(_mm_unpackhi_epi64(t2, t3)); \\\n}\n\nOPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(v_uint32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(v_int32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)\nOPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(v_float32x4, ps, _mm_castps_si128, _mm_castsi128_ps)\n\n// load deinterleave\ninline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b)\n{\n    __m128i t00 = _mm_loadu_si128((const __m128i*)ptr);\n    __m128i t01 = _mm_loadu_si128((const __m128i*)(ptr + 16));\n\n    __m128i t10 = _mm_unpacklo_epi8(t00, t01);\n    __m128i t11 = _mm_unpackhi_epi8(t00, t01);\n\n    __m128i t20 = _mm_unpacklo_epi8(t10, t11);\n    __m128i t21 = _mm_unpackhi_epi8(t10, t11);\n\n    __m128i t30 = _mm_unpacklo_epi8(t20, t21);\n    __m128i t31 = _mm_unpackhi_epi8(t20, t21);\n\n    a.val = _mm_unpacklo_epi8(t30, t31);\n    b.val = _mm_unpackhi_epi8(t30, t31);\n}\n\ninline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b, v_uint8x16& c)\n{\n#if CV_SSE4_1\n    const __m128i m0 = _mm_setr_epi8(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0);\n    const __m128i m1 = _mm_setr_epi8(0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0);\n    __m128i s0 = _mm_loadu_si128((const __m128i*)ptr);\n    __m128i s1 = _mm_loadu_si128((const __m128i*)(ptr + 16));\n    __m128i s2 = _mm_loadu_si128((const __m128i*)(ptr + 32));\n    __m128i a0 = _mm_blendv_epi8(_mm_blendv_epi8(s0, s1, m0), s2, m1);\n    __m128i b0 = _mm_blendv_epi8(_mm_blendv_epi8(s1, s2, m0), s0, m1);\n    __m128i c0 = _mm_blendv_epi8(_mm_blendv_epi8(s2, s0, m0), s1, m1);\n    const __m128i sh_b = _mm_setr_epi8(0, 3, 6, 9, 12, 15, 2, 5, 8, 11, 14, 1, 4, 7, 10, 13);\n    const __m128i sh_g = _mm_setr_epi8(1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, 5, 8, 11, 14);\n    const __m128i sh_r = _mm_setr_epi8(2, 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15);\n    a0 = _mm_shuffle_epi8(a0, sh_b);\n    b0 = _mm_shuffle_epi8(b0, sh_g);\n    c0 = _mm_shuffle_epi8(c0, sh_r);\n    a.val = a0;\n    b.val = b0;\n    c.val = c0;\n#elif CV_SSSE3\n    const __m128i m0 = _mm_setr_epi8(0, 3, 6, 9, 12, 15, 1, 4, 7, 10, 13, 2, 5, 8, 11, 14);\n    const __m128i m1 = _mm_alignr_epi8(m0, m0, 11);\n    const __m128i m2 = _mm_alignr_epi8(m0, m0, 6);\n\n    __m128i t0 = _mm_loadu_si128((const __m128i*)ptr);\n    __m128i t1 = _mm_loadu_si128((const __m128i*)(ptr + 16));\n    __m128i t2 = _mm_loadu_si128((const __m128i*)(ptr + 32));\n\n    __m128i s0 = _mm_shuffle_epi8(t0, m0);\n    __m128i s1 = _mm_shuffle_epi8(t1, m1);\n    __m128i s2 = _mm_shuffle_epi8(t2, m2);\n\n    t0 = _mm_alignr_epi8(s1, _mm_slli_si128(s0, 10), 5);\n    a.val = _mm_alignr_epi8(s2, t0, 5);\n\n    t1 = _mm_alignr_epi8(_mm_srli_si128(s1, 5), _mm_slli_si128(s0, 5), 6);\n    b.val = _mm_alignr_epi8(_mm_srli_si128(s2, 5), t1, 5);\n\n    t2 = _mm_alignr_epi8(_mm_srli_si128(s2, 10), s1, 11);\n    c.val = _mm_alignr_epi8(t2, s0, 11);\n#else\n    __m128i t00 = _mm_loadu_si128((const __m128i*)ptr);\n    __m128i t01 = _mm_loadu_si128((const __m128i*)(ptr + 16));\n    __m128i t02 = _mm_loadu_si128((const __m128i*)(ptr + 32));\n\n    __m128i t10 = _mm_unpacklo_epi8(t00, _mm_unpackhi_epi64(t01, t01));\n    __m128i t11 = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t00, t00), t02);\n    __m128i t12 = _mm_unpacklo_epi8(t01, _mm_unpackhi_epi64(t02, t02));\n\n    __m128i t20 = _mm_unpacklo_epi8(t10, _mm_unpackhi_epi64(t11, t11));\n    __m128i t21 = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t10, t10), t12);\n    __m128i t22 = _mm_unpacklo_epi8(t11, _mm_unpackhi_epi64(t12, t12));\n\n    __m128i t30 = _mm_unpacklo_epi8(t20, _mm_unpackhi_epi64(t21, t21));\n    __m128i t31 = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t20, t20), t22);\n    __m128i t32 = _mm_unpacklo_epi8(t21, _mm_unpackhi_epi64(t22, t22));\n\n    a.val = _mm_unpacklo_epi8(t30, _mm_unpackhi_epi64(t31, t31));\n    b.val = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t30, t30), t32);\n    c.val = _mm_unpacklo_epi8(t31, _mm_unpackhi_epi64(t32, t32));\n#endif\n}\n\ninline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b, v_uint8x16& c, v_uint8x16& d)\n{\n    __m128i u0 = _mm_loadu_si128((const __m128i*)ptr); // a0 b0 c0 d0 a1 b1 c1 d1 ...\n    __m128i u1 = _mm_loadu_si128((const __m128i*)(ptr + 16)); // a4 b4 c4 d4 ...\n    __m128i u2 = _mm_loadu_si128((const __m128i*)(ptr + 32)); // a8 b8 c8 d8 ...\n    __m128i u3 = _mm_loadu_si128((const __m128i*)(ptr + 48)); // a12 b12 c12 d12 ...\n\n    __m128i v0 = _mm_unpacklo_epi8(u0, u2); // a0 a8 b0 b8 ...\n    __m128i v1 = _mm_unpackhi_epi8(u0, u2); // a2 a10 b2 b10 ...\n    __m128i v2 = _mm_unpacklo_epi8(u1, u3); // a4 a12 b4 b12 ...\n    __m128i v3 = _mm_unpackhi_epi8(u1, u3); // a6 a14 b6 b14 ...\n\n    u0 = _mm_unpacklo_epi8(v0, v2); // a0 a4 a8 a12 ...\n    u1 = _mm_unpacklo_epi8(v1, v3); // a2 a6 a10 a14 ...\n    u2 = _mm_unpackhi_epi8(v0, v2); // a1 a5 a9 a13 ...\n    u3 = _mm_unpackhi_epi8(v1, v3); // a3 a7 a11 a15 ...\n\n    v0 = _mm_unpacklo_epi8(u0, u1); // a0 a2 a4 a6 ...\n    v1 = _mm_unpacklo_epi8(u2, u3); // a1 a3 a5 a7 ...\n    v2 = _mm_unpackhi_epi8(u0, u1); // c0 c2 c4 c6 ...\n    v3 = _mm_unpackhi_epi8(u2, u3); // c1 c3 c5 c7 ...\n\n    a.val = _mm_unpacklo_epi8(v0, v1);\n    b.val = _mm_unpackhi_epi8(v0, v1);\n    c.val = _mm_unpacklo_epi8(v2, v3);\n    d.val = _mm_unpackhi_epi8(v2, v3);\n}\n\ninline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b)\n{\n    __m128i v0 = _mm_loadu_si128((__m128i*)(ptr));     // a0 b0 a1 b1 a2 b2 a3 b3\n    __m128i v1 = _mm_loadu_si128((__m128i*)(ptr + 8)); // a4 b4 a5 b5 a6 b6 a7 b7\n\n    __m128i v2 = _mm_unpacklo_epi16(v0, v1); // a0 a4 b0 b4 a1 a5 b1 b5\n    __m128i v3 = _mm_unpackhi_epi16(v0, v1); // a2 a6 b2 b6 a3 a7 b3 b7\n    __m128i v4 = _mm_unpacklo_epi16(v2, v3); // a0 a2 a4 a6 b0 b2 b4 b6\n    __m128i v5 = _mm_unpackhi_epi16(v2, v3); // a1 a3 a5 a7 b1 b3 b5 b7\n\n    a.val = _mm_unpacklo_epi16(v4, v5); // a0 a1 a2 a3 a4 a5 a6 a7\n    b.val = _mm_unpackhi_epi16(v4, v5); // b0 b1 ab b3 b4 b5 b6 b7\n}\n\ninline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b, v_uint16x8& c)\n{\n#if CV_SSE4_1\n    __m128i v0 = _mm_loadu_si128((__m128i*)(ptr));\n    __m128i v1 = _mm_loadu_si128((__m128i*)(ptr + 8));\n    __m128i v2 = _mm_loadu_si128((__m128i*)(ptr + 16));\n    __m128i a0 = _mm_blend_epi16(_mm_blend_epi16(v0, v1, 0x92), v2, 0x24);\n    __m128i b0 = _mm_blend_epi16(_mm_blend_epi16(v2, v0, 0x92), v1, 0x24);\n    __m128i c0 = _mm_blend_epi16(_mm_blend_epi16(v1, v2, 0x92), v0, 0x24);\n\n    const __m128i sh_a = _mm_setr_epi8(0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11);\n    const __m128i sh_b = _mm_setr_epi8(2, 3, 8, 9, 14, 15, 4, 5, 10, 11, 0, 1, 6, 7, 12, 13);\n    const __m128i sh_c = _mm_setr_epi8(4, 5, 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15);\n    a0 = _mm_shuffle_epi8(a0, sh_a);\n    b0 = _mm_shuffle_epi8(b0, sh_b);\n    c0 = _mm_shuffle_epi8(c0, sh_c);\n\n    a.val = a0;\n    b.val = b0;\n    c.val = c0;\n#else\n    __m128i t00 = _mm_loadu_si128((const __m128i*)ptr);\n    __m128i t01 = _mm_loadu_si128((const __m128i*)(ptr + 8));\n    __m128i t02 = _mm_loadu_si128((const __m128i*)(ptr + 16));\n\n    __m128i t10 = _mm_unpacklo_epi16(t00, _mm_unpackhi_epi64(t01, t01));\n    __m128i t11 = _mm_unpacklo_epi16(_mm_unpackhi_epi64(t00, t00), t02);\n    __m128i t12 = _mm_unpacklo_epi16(t01, _mm_unpackhi_epi64(t02, t02));\n\n    __m128i t20 = _mm_unpacklo_epi16(t10, _mm_unpackhi_epi64(t11, t11));\n    __m128i t21 = _mm_unpacklo_epi16(_mm_unpackhi_epi64(t10, t10), t12);\n    __m128i t22 = _mm_unpacklo_epi16(t11, _mm_unpackhi_epi64(t12, t12));\n\n    a.val = _mm_unpacklo_epi16(t20, _mm_unpackhi_epi64(t21, t21));\n    b.val = _mm_unpacklo_epi16(_mm_unpackhi_epi64(t20, t20), t22);\n    c.val = _mm_unpacklo_epi16(t21, _mm_unpackhi_epi64(t22, t22));\n#endif\n}\n\ninline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b, v_uint16x8& c, v_uint16x8& d)\n{\n    __m128i u0 = _mm_loadu_si128((const __m128i*)ptr); // a0 b0 c0 d0 a1 b1 c1 d1\n    __m128i u1 = _mm_loadu_si128((const __m128i*)(ptr + 8)); // a2 b2 c2 d2 ...\n    __m128i u2 = _mm_loadu_si128((const __m128i*)(ptr + 16)); // a4 b4 c4 d4 ...\n    __m128i u3 = _mm_loadu_si128((const __m128i*)(ptr + 24)); // a6 b6 c6 d6 ...\n\n    __m128i v0 = _mm_unpacklo_epi16(u0, u2); // a0 a4 b0 b4 ...\n    __m128i v1 = _mm_unpackhi_epi16(u0, u2); // a1 a5 b1 b5 ...\n    __m128i v2 = _mm_unpacklo_epi16(u1, u3); // a2 a6 b2 b6 ...\n    __m128i v3 = _mm_unpackhi_epi16(u1, u3); // a3 a7 b3 b7 ...\n\n    u0 = _mm_unpacklo_epi16(v0, v2); // a0 a2 a4 a6 ...\n    u1 = _mm_unpacklo_epi16(v1, v3); // a1 a3 a5 a7 ...\n    u2 = _mm_unpackhi_epi16(v0, v2); // c0 c2 c4 c6 ...\n    u3 = _mm_unpackhi_epi16(v1, v3); // c1 c3 c5 c7 ...\n\n    a.val = _mm_unpacklo_epi16(u0, u1);\n    b.val = _mm_unpackhi_epi16(u0, u1);\n    c.val = _mm_unpacklo_epi16(u2, u3);\n    d.val = _mm_unpackhi_epi16(u2, u3);\n}\n\ninline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b)\n{\n    __m128i v0 = _mm_loadu_si128((__m128i*)(ptr));     // a0 b0 a1 b1\n    __m128i v1 = _mm_loadu_si128((__m128i*)(ptr + 4)); // a2 b2 a3 b3\n\n    __m128i v2 = _mm_unpacklo_epi32(v0, v1); // a0 a2 b0 b2\n    __m128i v3 = _mm_unpackhi_epi32(v0, v1); // a1 a3 b1 b3\n\n    a.val = _mm_unpacklo_epi32(v2, v3); // a0 a1 a2 a3\n    b.val = _mm_unpackhi_epi32(v2, v3); // b0 b1 ab b3\n}\n\ninline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b, v_uint32x4& c)\n{\n    __m128i t00 = _mm_loadu_si128((const __m128i*)ptr);\n    __m128i t01 = _mm_loadu_si128((const __m128i*)(ptr + 4));\n    __m128i t02 = _mm_loadu_si128((const __m128i*)(ptr + 8));\n\n    __m128i t10 = _mm_unpacklo_epi32(t00, _mm_unpackhi_epi64(t01, t01));\n    __m128i t11 = _mm_unpacklo_epi32(_mm_unpackhi_epi64(t00, t00), t02);\n    __m128i t12 = _mm_unpacklo_epi32(t01, _mm_unpackhi_epi64(t02, t02));\n\n    a.val = _mm_unpacklo_epi32(t10, _mm_unpackhi_epi64(t11, t11));\n    b.val = _mm_unpacklo_epi32(_mm_unpackhi_epi64(t10, t10), t12);\n    c.val = _mm_unpacklo_epi32(t11, _mm_unpackhi_epi64(t12, t12));\n}\n\ninline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b, v_uint32x4& c, v_uint32x4& d)\n{\n    v_uint32x4 s0(_mm_loadu_si128((const __m128i*)ptr));        // a0 b0 c0 d0\n    v_uint32x4 s1(_mm_loadu_si128((const __m128i*)(ptr + 4)));  // a1 b1 c1 d1\n    v_uint32x4 s2(_mm_loadu_si128((const __m128i*)(ptr + 8)));  // a2 b2 c2 d2\n    v_uint32x4 s3(_mm_loadu_si128((const __m128i*)(ptr + 12))); // a3 b3 c3 d3\n\n    v_transpose4x4(s0, s1, s2, s3, a, b, c, d);\n}\n\ninline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b)\n{\n    __m128 u0 = _mm_loadu_ps(ptr);       // a0 b0 a1 b1\n    __m128 u1 = _mm_loadu_ps((ptr + 4)); // a2 b2 a3 b3\n\n    a.val = _mm_shuffle_ps(u0, u1, _MM_SHUFFLE(2, 0, 2, 0)); // a0 a1 a2 a3\n    b.val = _mm_shuffle_ps(u0, u1, _MM_SHUFFLE(3, 1, 3, 1)); // b0 b1 ab b3\n}\n\ninline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b, v_float32x4& c)\n{\n    __m128 t0 = _mm_loadu_ps(ptr + 0);\n    __m128 t1 = _mm_loadu_ps(ptr + 4);\n    __m128 t2 = _mm_loadu_ps(ptr + 8);\n\n    __m128 at12 = _mm_shuffle_ps(t1, t2, _MM_SHUFFLE(0, 1, 0, 2));\n    a.val = _mm_shuffle_ps(t0, at12, _MM_SHUFFLE(2, 0, 3, 0));\n\n    __m128 bt01 = _mm_shuffle_ps(t0, t1, _MM_SHUFFLE(0, 0, 0, 1));\n    __m128 bt12 = _mm_shuffle_ps(t1, t2, _MM_SHUFFLE(0, 2, 0, 3));\n    b.val = _mm_shuffle_ps(bt01, bt12, _MM_SHUFFLE(2, 0, 2, 0));\n\n    __m128 ct01 = _mm_shuffle_ps(t0, t1, _MM_SHUFFLE(0, 1, 0, 2));\n    c.val = _mm_shuffle_ps(ct01, t2, _MM_SHUFFLE(3, 0, 2, 0));\n}\n\ninline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b, v_float32x4& c, v_float32x4& d)\n{\n    __m128 t0 = _mm_loadu_ps(ptr +  0);\n    __m128 t1 = _mm_loadu_ps(ptr +  4);\n    __m128 t2 = _mm_loadu_ps(ptr +  8);\n    __m128 t3 = _mm_loadu_ps(ptr + 12);\n    __m128 t02lo = _mm_unpacklo_ps(t0, t2);\n    __m128 t13lo = _mm_unpacklo_ps(t1, t3);\n    __m128 t02hi = _mm_unpackhi_ps(t0, t2);\n    __m128 t13hi = _mm_unpackhi_ps(t1, t3);\n    a.val = _mm_unpacklo_ps(t02lo, t13lo);\n    b.val = _mm_unpackhi_ps(t02lo, t13lo);\n    c.val = _mm_unpacklo_ps(t02hi, t13hi);\n    d.val = _mm_unpackhi_ps(t02hi, t13hi);\n}\n\ninline void v_load_deinterleave(const uint64 *ptr, v_uint64x2& a, v_uint64x2& b)\n{\n    __m128i t0 = _mm_loadu_si128((const __m128i*)ptr);\n    __m128i t1 = _mm_loadu_si128((const __m128i*)(ptr + 2));\n\n    a = v_uint64x2(_mm_unpacklo_epi64(t0, t1));\n    b = v_uint64x2(_mm_unpackhi_epi64(t0, t1));\n}\n\ninline void v_load_deinterleave(const uint64 *ptr, v_uint64x2& a, v_uint64x2& b, v_uint64x2& c)\n{\n    __m128i t0 = _mm_loadu_si128((const __m128i*)ptr); // a0, b0\n    __m128i t1 = _mm_loadu_si128((const __m128i*)(ptr + 2)); // c0, a1\n    __m128i t2 = _mm_loadu_si128((const __m128i*)(ptr + 4)); // b1, c1\n\n    t1 = _mm_shuffle_epi32(t1, 0x4e); // a1, c0\n\n    a = v_uint64x2(_mm_unpacklo_epi64(t0, t1));\n    b = v_uint64x2(_mm_unpacklo_epi64(_mm_unpackhi_epi64(t0, t0), t2));\n    c = v_uint64x2(_mm_unpackhi_epi64(t1, t2));\n}\n\ninline void v_load_deinterleave(const uint64 *ptr, v_uint64x2& a,\n                                v_uint64x2& b, v_uint64x2& c, v_uint64x2& d)\n{\n    __m128i t0 = _mm_loadu_si128((const __m128i*)ptr); // a0 b0\n    __m128i t1 = _mm_loadu_si128((const __m128i*)(ptr + 2)); // c0 d0\n    __m128i t2 = _mm_loadu_si128((const __m128i*)(ptr + 4)); // a1 b1\n    __m128i t3 = _mm_loadu_si128((const __m128i*)(ptr + 6)); // c1 d1\n\n    a = v_uint64x2(_mm_unpacklo_epi64(t0, t2));\n    b = v_uint64x2(_mm_unpackhi_epi64(t0, t2));\n    c = v_uint64x2(_mm_unpacklo_epi64(t1, t3));\n    d = v_uint64x2(_mm_unpackhi_epi64(t1, t3));\n}\n\n// store interleave\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b,\n                                hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    __m128i v0 = _mm_unpacklo_epi8(a.val, b.val);\n    __m128i v1 = _mm_unpackhi_epi8(a.val, b.val);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 16), v1);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 16), v1);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 16), v1);\n    }\n}\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b,\n                                const v_uint8x16& c, hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n#if CV_SSE4_1\n    const __m128i sh_a = _mm_setr_epi8(0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15, 10, 5);\n    const __m128i sh_b = _mm_setr_epi8(5, 0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15, 10);\n    const __m128i sh_c = _mm_setr_epi8(10, 5, 0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15);\n    __m128i a0 = _mm_shuffle_epi8(a.val, sh_a);\n    __m128i b0 = _mm_shuffle_epi8(b.val, sh_b);\n    __m128i c0 = _mm_shuffle_epi8(c.val, sh_c);\n\n    const __m128i m0 = _mm_setr_epi8(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0);\n    const __m128i m1 = _mm_setr_epi8(0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0);\n    __m128i v0 = _mm_blendv_epi8(_mm_blendv_epi8(a0, b0, m1), c0, m0);\n    __m128i v1 = _mm_blendv_epi8(_mm_blendv_epi8(b0, c0, m1), a0, m0);\n    __m128i v2 = _mm_blendv_epi8(_mm_blendv_epi8(c0, a0, m1), b0, m0);\n#elif CV_SSSE3\n    const __m128i m0 = _mm_setr_epi8(0, 6, 11, 1, 7, 12, 2, 8, 13, 3, 9, 14, 4, 10, 15, 5);\n    const __m128i m1 = _mm_setr_epi8(5, 11, 0, 6, 12, 1, 7, 13, 2, 8, 14, 3, 9, 15, 4, 10);\n    const __m128i m2 = _mm_setr_epi8(10, 0, 5, 11, 1, 6, 12, 2, 7, 13, 3, 8, 14, 4, 9, 15);\n\n    __m128i t0 = _mm_alignr_epi8(b.val, _mm_slli_si128(a.val, 10), 5);\n    t0 = _mm_alignr_epi8(c.val, t0, 5);\n    __m128i v0 = _mm_shuffle_epi8(t0, m0);\n\n    __m128i t1 = _mm_alignr_epi8(_mm_srli_si128(b.val, 5), _mm_slli_si128(a.val, 5), 6);\n    t1 = _mm_alignr_epi8(_mm_srli_si128(c.val, 5), t1, 5);\n    __m128i v1 = _mm_shuffle_epi8(t1, m1);\n\n    __m128i t2 = _mm_alignr_epi8(_mm_srli_si128(c.val, 10), b.val, 11);\n    t2 = _mm_alignr_epi8(t2, a.val, 11);\n    __m128i v2 = _mm_shuffle_epi8(t2, m2);\n#else\n    __m128i z = _mm_setzero_si128();\n    __m128i ab0 = _mm_unpacklo_epi8(a.val, b.val);\n    __m128i ab1 = _mm_unpackhi_epi8(a.val, b.val);\n    __m128i c0 = _mm_unpacklo_epi8(c.val, z);\n    __m128i c1 = _mm_unpackhi_epi8(c.val, z);\n\n    __m128i p00 = _mm_unpacklo_epi16(ab0, c0);\n    __m128i p01 = _mm_unpackhi_epi16(ab0, c0);\n    __m128i p02 = _mm_unpacklo_epi16(ab1, c1);\n    __m128i p03 = _mm_unpackhi_epi16(ab1, c1);\n\n    __m128i p10 = _mm_unpacklo_epi32(p00, p01);\n    __m128i p11 = _mm_unpackhi_epi32(p00, p01);\n    __m128i p12 = _mm_unpacklo_epi32(p02, p03);\n    __m128i p13 = _mm_unpackhi_epi32(p02, p03);\n\n    __m128i p20 = _mm_unpacklo_epi64(p10, p11);\n    __m128i p21 = _mm_unpackhi_epi64(p10, p11);\n    __m128i p22 = _mm_unpacklo_epi64(p12, p13);\n    __m128i p23 = _mm_unpackhi_epi64(p12, p13);\n\n    p20 = _mm_slli_si128(p20, 1);\n    p22 = _mm_slli_si128(p22, 1);\n\n    __m128i p30 = _mm_slli_epi64(_mm_unpacklo_epi32(p20, p21), 8);\n    __m128i p31 = _mm_srli_epi64(_mm_unpackhi_epi32(p20, p21), 8);\n    __m128i p32 = _mm_slli_epi64(_mm_unpacklo_epi32(p22, p23), 8);\n    __m128i p33 = _mm_srli_epi64(_mm_unpackhi_epi32(p22, p23), 8);\n\n    __m128i p40 = _mm_unpacklo_epi64(p30, p31);\n    __m128i p41 = _mm_unpackhi_epi64(p30, p31);\n    __m128i p42 = _mm_unpacklo_epi64(p32, p33);\n    __m128i p43 = _mm_unpackhi_epi64(p32, p33);\n\n    __m128i v0 = _mm_or_si128(_mm_srli_si128(p40, 2), _mm_slli_si128(p41, 10));\n    __m128i v1 = _mm_or_si128(_mm_srli_si128(p41, 6), _mm_slli_si128(p42, 6));\n    __m128i v2 = _mm_or_si128(_mm_srli_si128(p42, 10), _mm_slli_si128(p43, 2));\n#endif\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 16), v1);\n        _mm_stream_si128((__m128i*)(ptr + 32), v2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 16), v1);\n        _mm_store_si128((__m128i*)(ptr + 32), v2);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 16), v1);\n        _mm_storeu_si128((__m128i*)(ptr + 32), v2);\n    }\n}\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b,\n                                const v_uint8x16& c, const v_uint8x16& d,\n                                hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    // a0 a1 a2 a3 ....\n    // b0 b1 b2 b3 ....\n    // c0 c1 c2 c3 ....\n    // d0 d1 d2 d3 ....\n    __m128i u0 = _mm_unpacklo_epi8(a.val, c.val); // a0 c0 a1 c1 ...\n    __m128i u1 = _mm_unpackhi_epi8(a.val, c.val); // a8 c8 a9 c9 ...\n    __m128i u2 = _mm_unpacklo_epi8(b.val, d.val); // b0 d0 b1 d1 ...\n    __m128i u3 = _mm_unpackhi_epi8(b.val, d.val); // b8 d8 b9 d9 ...\n\n    __m128i v0 = _mm_unpacklo_epi8(u0, u2); // a0 b0 c0 d0 ...\n    __m128i v1 = _mm_unpackhi_epi8(u0, u2); // a4 b4 c4 d4 ...\n    __m128i v2 = _mm_unpacklo_epi8(u1, u3); // a8 b8 c8 d8 ...\n    __m128i v3 = _mm_unpackhi_epi8(u1, u3); // a12 b12 c12 d12 ...\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 16), v1);\n        _mm_stream_si128((__m128i*)(ptr + 32), v2);\n        _mm_stream_si128((__m128i*)(ptr + 48), v3);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 16), v1);\n        _mm_store_si128((__m128i*)(ptr + 32), v2);\n        _mm_store_si128((__m128i*)(ptr + 48), v3);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 16), v1);\n        _mm_storeu_si128((__m128i*)(ptr + 32), v2);\n        _mm_storeu_si128((__m128i*)(ptr + 48), v3);\n    }\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x8& a, const v_uint16x8& b,\n                                hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    __m128i v0 = _mm_unpacklo_epi16(a.val, b.val);\n    __m128i v1 = _mm_unpackhi_epi16(a.val, b.val);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 8), v1);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 8), v1);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 8), v1);\n    }\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x8& a,\n                                const v_uint16x8& b, const v_uint16x8& c,\n                                hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n#if CV_SSE4_1\n    const __m128i sh_a = _mm_setr_epi8(0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11);\n    const __m128i sh_b = _mm_setr_epi8(10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5);\n    const __m128i sh_c = _mm_setr_epi8(4, 5, 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15);\n    __m128i a0 = _mm_shuffle_epi8(a.val, sh_a);\n    __m128i b0 = _mm_shuffle_epi8(b.val, sh_b);\n    __m128i c0 = _mm_shuffle_epi8(c.val, sh_c);\n\n    __m128i v0 = _mm_blend_epi16(_mm_blend_epi16(a0, b0, 0x92), c0, 0x24);\n    __m128i v1 = _mm_blend_epi16(_mm_blend_epi16(c0, a0, 0x92), b0, 0x24);\n    __m128i v2 = _mm_blend_epi16(_mm_blend_epi16(b0, c0, 0x92), a0, 0x24);\n#else\n    __m128i z = _mm_setzero_si128();\n    __m128i ab0 = _mm_unpacklo_epi16(a.val, b.val);\n    __m128i ab1 = _mm_unpackhi_epi16(a.val, b.val);\n    __m128i c0 = _mm_unpacklo_epi16(c.val, z);\n    __m128i c1 = _mm_unpackhi_epi16(c.val, z);\n\n    __m128i p10 = _mm_unpacklo_epi32(ab0, c0);\n    __m128i p11 = _mm_unpackhi_epi32(ab0, c0);\n    __m128i p12 = _mm_unpacklo_epi32(ab1, c1);\n    __m128i p13 = _mm_unpackhi_epi32(ab1, c1);\n\n    __m128i p20 = _mm_unpacklo_epi64(p10, p11);\n    __m128i p21 = _mm_unpackhi_epi64(p10, p11);\n    __m128i p22 = _mm_unpacklo_epi64(p12, p13);\n    __m128i p23 = _mm_unpackhi_epi64(p12, p13);\n\n    p20 = _mm_slli_si128(p20, 2);\n    p22 = _mm_slli_si128(p22, 2);\n\n    __m128i p30 = _mm_unpacklo_epi64(p20, p21);\n    __m128i p31 = _mm_unpackhi_epi64(p20, p21);\n    __m128i p32 = _mm_unpacklo_epi64(p22, p23);\n    __m128i p33 = _mm_unpackhi_epi64(p22, p23);\n\n    __m128i v0 = _mm_or_si128(_mm_srli_si128(p30, 2), _mm_slli_si128(p31, 10));\n    __m128i v1 = _mm_or_si128(_mm_srli_si128(p31, 6), _mm_slli_si128(p32, 6));\n    __m128i v2 = _mm_or_si128(_mm_srli_si128(p32, 10), _mm_slli_si128(p33, 2));\n#endif\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 8), v1);\n        _mm_stream_si128((__m128i*)(ptr + 16), v2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 8), v1);\n        _mm_store_si128((__m128i*)(ptr + 16), v2);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 8), v1);\n        _mm_storeu_si128((__m128i*)(ptr + 16), v2);\n    }\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x8& a, const v_uint16x8& b,\n                                const v_uint16x8& c, const v_uint16x8& d,\n                                hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    // a0 a1 a2 a3 ....\n    // b0 b1 b2 b3 ....\n    // c0 c1 c2 c3 ....\n    // d0 d1 d2 d3 ....\n    __m128i u0 = _mm_unpacklo_epi16(a.val, c.val); // a0 c0 a1 c1 ...\n    __m128i u1 = _mm_unpackhi_epi16(a.val, c.val); // a4 c4 a5 c5 ...\n    __m128i u2 = _mm_unpacklo_epi16(b.val, d.val); // b0 d0 b1 d1 ...\n    __m128i u3 = _mm_unpackhi_epi16(b.val, d.val); // b4 d4 b5 d5 ...\n\n    __m128i v0 = _mm_unpacklo_epi16(u0, u2); // a0 b0 c0 d0 ...\n    __m128i v1 = _mm_unpackhi_epi16(u0, u2); // a2 b2 c2 d2 ...\n    __m128i v2 = _mm_unpacklo_epi16(u1, u3); // a4 b4 c4 d4 ...\n    __m128i v3 = _mm_unpackhi_epi16(u1, u3); // a6 b6 c6 d6 ...\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 8), v1);\n        _mm_stream_si128((__m128i*)(ptr + 16), v2);\n        _mm_stream_si128((__m128i*)(ptr + 24), v3);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 8), v1);\n        _mm_store_si128((__m128i*)(ptr + 16), v2);\n        _mm_store_si128((__m128i*)(ptr + 24), v3);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 8), v1);\n        _mm_storeu_si128((__m128i*)(ptr + 16), v2);\n        _mm_storeu_si128((__m128i*)(ptr + 24), v3);\n    }\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b,\n                                hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    __m128i v0 = _mm_unpacklo_epi32(a.val, b.val);\n    __m128i v1 = _mm_unpackhi_epi32(a.val, b.val);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 4), v1);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 4), v1);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 4), v1);\n    }\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b,\n                                const v_uint32x4& c, hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    v_uint32x4 z = v_setzero_u32(), u0, u1, u2, u3;\n    v_transpose4x4(a, b, c, z, u0, u1, u2, u3);\n\n    __m128i v0 = _mm_or_si128(u0.val, _mm_slli_si128(u1.val, 12));\n    __m128i v1 = _mm_or_si128(_mm_srli_si128(u1.val, 4), _mm_slli_si128(u2.val, 8));\n    __m128i v2 = _mm_or_si128(_mm_srli_si128(u2.val, 8), _mm_slli_si128(u3.val, 4));\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 4), v1);\n        _mm_stream_si128((__m128i*)(ptr + 8), v2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 4), v1);\n        _mm_store_si128((__m128i*)(ptr + 8), v2);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 4), v1);\n        _mm_storeu_si128((__m128i*)(ptr + 8), v2);\n    }\n}\n\ninline void v_store_interleave(unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b,\n                               const v_uint32x4& c, const v_uint32x4& d,\n                               hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    v_uint32x4 v0, v1, v2, v3;\n    v_transpose4x4(a, b, c, d, v0, v1, v2, v3);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0.val);\n        _mm_stream_si128((__m128i*)(ptr + 4), v1.val);\n        _mm_stream_si128((__m128i*)(ptr + 8), v2.val);\n        _mm_stream_si128((__m128i*)(ptr + 12), v3.val);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0.val);\n        _mm_store_si128((__m128i*)(ptr + 4), v1.val);\n        _mm_store_si128((__m128i*)(ptr + 8), v2.val);\n        _mm_store_si128((__m128i*)(ptr + 12), v3.val);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0.val);\n        _mm_storeu_si128((__m128i*)(ptr + 4), v1.val);\n        _mm_storeu_si128((__m128i*)(ptr + 8), v2.val);\n        _mm_storeu_si128((__m128i*)(ptr + 12), v3.val);\n    }\n}\n\n// 2-channel, float only\ninline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b,\n                               hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    __m128 v0 = _mm_unpacklo_ps(a.val, b.val); // a0 b0 a1 b1\n    __m128 v1 = _mm_unpackhi_ps(a.val, b.val); // a2 b2 a3 b3\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_ps(ptr, v0);\n        _mm_stream_ps(ptr + 4, v1);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_ps(ptr, v0);\n        _mm_store_ps(ptr + 4, v1);\n    }\n    else\n    {\n        _mm_storeu_ps(ptr, v0);\n        _mm_storeu_ps(ptr + 4, v1);\n    }\n}\n\ninline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b,\n                               const v_float32x4& c, hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    __m128 u0 = _mm_shuffle_ps(a.val, b.val, _MM_SHUFFLE(0, 0, 0, 0));\n    __m128 u1 = _mm_shuffle_ps(c.val, a.val, _MM_SHUFFLE(1, 1, 0, 0));\n    __m128 v0 = _mm_shuffle_ps(u0, u1, _MM_SHUFFLE(2, 0, 2, 0));\n    __m128 u2 = _mm_shuffle_ps(b.val, c.val, _MM_SHUFFLE(1, 1, 1, 1));\n    __m128 u3 = _mm_shuffle_ps(a.val, b.val, _MM_SHUFFLE(2, 2, 2, 2));\n    __m128 v1 = _mm_shuffle_ps(u2, u3, _MM_SHUFFLE(2, 0, 2, 0));\n    __m128 u4 = _mm_shuffle_ps(c.val, a.val, _MM_SHUFFLE(3, 3, 2, 2));\n    __m128 u5 = _mm_shuffle_ps(b.val, c.val, _MM_SHUFFLE(3, 3, 3, 3));\n    __m128 v2 = _mm_shuffle_ps(u4, u5, _MM_SHUFFLE(2, 0, 2, 0));\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_ps(ptr, v0);\n        _mm_stream_ps(ptr + 4, v1);\n        _mm_stream_ps(ptr + 8, v2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_ps(ptr, v0);\n        _mm_store_ps(ptr + 4, v1);\n        _mm_store_ps(ptr + 8, v2);\n    }\n    else\n    {\n        _mm_storeu_ps(ptr, v0);\n        _mm_storeu_ps(ptr + 4, v1);\n        _mm_storeu_ps(ptr + 8, v2);\n    }\n}\n\ninline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b,\n                               const v_float32x4& c, const v_float32x4& d,\n                               hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    __m128 u0 = _mm_unpacklo_ps(a.val, c.val);\n    __m128 u1 = _mm_unpacklo_ps(b.val, d.val);\n    __m128 u2 = _mm_unpackhi_ps(a.val, c.val);\n    __m128 u3 = _mm_unpackhi_ps(b.val, d.val);\n    __m128 v0 = _mm_unpacklo_ps(u0, u1);\n    __m128 v2 = _mm_unpacklo_ps(u2, u3);\n    __m128 v1 = _mm_unpackhi_ps(u0, u1);\n    __m128 v3 = _mm_unpackhi_ps(u2, u3);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_ps(ptr, v0);\n        _mm_stream_ps(ptr + 4, v1);\n        _mm_stream_ps(ptr + 8, v2);\n        _mm_stream_ps(ptr + 12, v3);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_ps(ptr, v0);\n        _mm_store_ps(ptr + 4, v1);\n        _mm_store_ps(ptr + 8, v2);\n        _mm_store_ps(ptr + 12, v3);\n    }\n    else\n    {\n        _mm_storeu_ps(ptr, v0);\n        _mm_storeu_ps(ptr + 4, v1);\n        _mm_storeu_ps(ptr + 8, v2);\n        _mm_storeu_ps(ptr + 12, v3);\n    }\n}\n\ninline void v_store_interleave(uint64 *ptr, const v_uint64x2& a, const v_uint64x2& b,\n                               hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    __m128i v0 = _mm_unpacklo_epi64(a.val, b.val);\n    __m128i v1 = _mm_unpackhi_epi64(a.val, b.val);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 2), v1);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 2), v1);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 2), v1);\n    }\n}\n\ninline void v_store_interleave(uint64 *ptr, const v_uint64x2& a, const v_uint64x2& b,\n                               const v_uint64x2& c, hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    __m128i v0 = _mm_unpacklo_epi64(a.val, b.val);\n    __m128i v1 = _mm_unpacklo_epi64(c.val, _mm_unpackhi_epi64(a.val, a.val));\n    __m128i v2 = _mm_unpackhi_epi64(b.val, c.val);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 2), v1);\n        _mm_stream_si128((__m128i*)(ptr + 4), v2);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 2), v1);\n        _mm_store_si128((__m128i*)(ptr + 4), v2);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 2), v1);\n        _mm_storeu_si128((__m128i*)(ptr + 4), v2);\n    }\n}\n\ninline void v_store_interleave(uint64 *ptr, const v_uint64x2& a, const v_uint64x2& b,\n                               const v_uint64x2& c, const v_uint64x2& d,\n                               hal::StoreMode mode = hal::STORE_UNALIGNED)\n{\n    __m128i v0 = _mm_unpacklo_epi64(a.val, b.val);\n    __m128i v1 = _mm_unpacklo_epi64(c.val, d.val);\n    __m128i v2 = _mm_unpackhi_epi64(a.val, b.val);\n    __m128i v3 = _mm_unpackhi_epi64(c.val, d.val);\n\n    if( mode == hal::STORE_ALIGNED_NOCACHE )\n    {\n        _mm_stream_si128((__m128i*)(ptr), v0);\n        _mm_stream_si128((__m128i*)(ptr + 2), v1);\n        _mm_stream_si128((__m128i*)(ptr + 4), v2);\n        _mm_stream_si128((__m128i*)(ptr + 6), v3);\n    }\n    else if( mode == hal::STORE_ALIGNED )\n    {\n        _mm_store_si128((__m128i*)(ptr), v0);\n        _mm_store_si128((__m128i*)(ptr + 2), v1);\n        _mm_store_si128((__m128i*)(ptr + 4), v2);\n        _mm_store_si128((__m128i*)(ptr + 6), v3);\n    }\n    else\n    {\n        _mm_storeu_si128((__m128i*)(ptr), v0);\n        _mm_storeu_si128((__m128i*)(ptr + 2), v1);\n        _mm_storeu_si128((__m128i*)(ptr + 4), v2);\n        _mm_storeu_si128((__m128i*)(ptr + 6), v3);\n    }\n}\n\n#define OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(_Tpvec0, _Tp0, suffix0, _Tpvec1, _Tp1, suffix1) \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0 ) \\\n{ \\\n    _Tpvec1 a1, b1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n} \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0 ) \\\n{ \\\n    _Tpvec1 a1, b1, c1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n    c0 = v_reinterpret_as_##suffix0(c1); \\\n} \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0, _Tpvec0& d0 ) \\\n{ \\\n    _Tpvec1 a1, b1, c1, d1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1, d1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n    c0 = v_reinterpret_as_##suffix0(c1); \\\n    d0 = v_reinterpret_as_##suffix0(d1); \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                hal::StoreMode mode = hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, mode);      \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                const _Tpvec0& c0, hal::StoreMode mode = hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, c1, mode);  \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                const _Tpvec0& c0, const _Tpvec0& d0, \\\n                                hal::StoreMode mode = hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \\\n    _Tpvec1 d1 = v_reinterpret_as_##suffix1(d0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, c1, d1, mode); \\\n}\n\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int8x16, schar, s8, v_uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int16x8, short, s16, v_uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int32x4, int, s32, v_uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int64x2, int64, s64, v_uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_float64x2, double, f64, v_uint64x2, uint64, u64)\n\ninline v_float32x4 v_cvt_f32(const v_int32x4& a)\n{\n    return v_float32x4(_mm_cvtepi32_ps(a.val));\n}\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a)\n{\n    return v_float32x4(_mm_cvtpd_ps(a.val));\n}\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b)\n{\n    return v_float32x4(_mm_movelh_ps(_mm_cvtpd_ps(a.val), _mm_cvtpd_ps(b.val)));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int32x4& a)\n{\n    return v_float64x2(_mm_cvtepi32_pd(a.val));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_int32x4& a)\n{\n    return v_float64x2(_mm_cvtepi32_pd(_mm_srli_si128(a.val,8)));\n}\n\ninline v_float64x2 v_cvt_f64(const v_float32x4& a)\n{\n    return v_float64x2(_mm_cvtps_pd(a.val));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_float32x4& a)\n{\n    return v_float64x2(_mm_cvtps_pd(_mm_movehl_ps(a.val, a.val)));\n}\n\n// from (Mysticial and wim) https://stackoverflow.com/q/41144668\ninline v_float64x2 v_cvt_f64(const v_int64x2& v)\n{\n    // constants encoded as floating-point\n    __m128i magic_i_hi32 = _mm_set1_epi64x(0x4530000080000000); // 2^84 + 2^63\n    __m128i magic_i_all  = _mm_set1_epi64x(0x4530000080100000); // 2^84 + 2^63 + 2^52\n    __m128d magic_d_all  = _mm_castsi128_pd(magic_i_all);\n    // Blend the 32 lowest significant bits of v with magic_int_lo\n#if CV_SSE4_1\n    __m128i magic_i_lo   = _mm_set1_epi64x(0x4330000000000000); // 2^52\n    __m128i v_lo         = _mm_blend_epi16(v.val, magic_i_lo, 0xcc);\n#else\n    __m128i magic_i_lo   = _mm_set1_epi32(0x43300000); // 2^52\n    __m128i v_lo         = _mm_unpacklo_epi32(_mm_shuffle_epi32(v.val, _MM_SHUFFLE(0, 0, 2, 0)), magic_i_lo);\n#endif\n    // Extract the 32 most significant bits of v\n    __m128i v_hi         = _mm_srli_epi64(v.val, 32);\n    // Flip the msb of v_hi and blend with 0x45300000\n            v_hi         = _mm_xor_si128(v_hi, magic_i_hi32);\n    // Compute in double precision\n    __m128d v_hi_dbl     = _mm_sub_pd(_mm_castsi128_pd(v_hi), magic_d_all);\n    // (v_hi - magic_d_all) + v_lo  Do not assume associativity of floating point addition\n    __m128d result       = _mm_add_pd(v_hi_dbl, _mm_castsi128_pd(v_lo));\n    return v_float64x2(result);\n}\n\n////////////// Lookup table access ////////////////////\n\ninline v_int8x16 v_lut(const schar* tab, const int* idx)\n{\n#if defined(_MSC_VER)\n    return v_int8x16(_mm_setr_epi8(tab[idx[0]], tab[idx[1]], tab[idx[ 2]], tab[idx[ 3]], tab[idx[ 4]], tab[idx[ 5]], tab[idx[ 6]], tab[idx[ 7]],\n                                   tab[idx[8]], tab[idx[9]], tab[idx[10]], tab[idx[11]], tab[idx[12]], tab[idx[13]], tab[idx[14]], tab[idx[15]]));\n#else\n    return v_int8x16(_mm_setr_epi64(\n                        _mm_setr_pi8(tab[idx[0]], tab[idx[1]], tab[idx[ 2]], tab[idx[ 3]], tab[idx[ 4]], tab[idx[ 5]], tab[idx[ 6]], tab[idx[ 7]]),\n                        _mm_setr_pi8(tab[idx[8]], tab[idx[9]], tab[idx[10]], tab[idx[11]], tab[idx[12]], tab[idx[13]], tab[idx[14]], tab[idx[15]])\n                    ));\n#endif\n}\ninline v_int8x16 v_lut_pairs(const schar* tab, const int* idx)\n{\n#if defined(_MSC_VER)\n    return v_int8x16(_mm_setr_epi16(*(const short*)(tab + idx[0]), *(const short*)(tab + idx[1]), *(const short*)(tab + idx[2]), *(const short*)(tab + idx[3]),\n                                    *(const short*)(tab + idx[4]), *(const short*)(tab + idx[5]), *(const short*)(tab + idx[6]), *(const short*)(tab + idx[7])));\n#else\n    return v_int8x16(_mm_setr_epi64(\n                        _mm_setr_pi16(*(const short*)(tab + idx[0]), *(const short*)(tab + idx[1]), *(const short*)(tab + idx[2]), *(const short*)(tab + idx[3])),\n                        _mm_setr_pi16(*(const short*)(tab + idx[4]), *(const short*)(tab + idx[5]), *(const short*)(tab + idx[6]), *(const short*)(tab + idx[7]))\n                    ));\n#endif\n}\ninline v_int8x16 v_lut_quads(const schar* tab, const int* idx)\n{\n#if defined(_MSC_VER)\n    return v_int8x16(_mm_setr_epi32(*(const int*)(tab + idx[0]), *(const int*)(tab + idx[1]),\n                                    *(const int*)(tab + idx[2]), *(const int*)(tab + idx[3])));\n#else\n    return v_int8x16(_mm_setr_epi64(\n                        _mm_setr_pi32(*(const int*)(tab + idx[0]), *(const int*)(tab + idx[1])),\n                        _mm_setr_pi32(*(const int*)(tab + idx[2]), *(const int*)(tab + idx[3]))\n                    ));\n#endif\n}\ninline v_uint8x16 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((const schar *)tab, idx)); }\ninline v_uint8x16 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((const schar *)tab, idx)); }\ninline v_uint8x16 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((const schar *)tab, idx)); }\n\ninline v_int16x8 v_lut(const short* tab, const int* idx)\n{\n#if defined(_MSC_VER)\n    return v_int16x8(_mm_setr_epi16(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]],\n                                    tab[idx[4]], tab[idx[5]], tab[idx[6]], tab[idx[7]]));\n#else\n    return v_int16x8(_mm_setr_epi64(\n                        _mm_setr_pi16(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]),\n                        _mm_setr_pi16(tab[idx[4]], tab[idx[5]], tab[idx[6]], tab[idx[7]])\n                    ));\n#endif\n}\ninline v_int16x8 v_lut_pairs(const short* tab, const int* idx)\n{\n#if defined(_MSC_VER)\n    return v_int16x8(_mm_setr_epi32(*(const int*)(tab + idx[0]), *(const int*)(tab + idx[1]),\n                                    *(const int*)(tab + idx[2]), *(const int*)(tab + idx[3])));\n#else\n    return v_int16x8(_mm_setr_epi64(\n                        _mm_setr_pi32(*(const int*)(tab + idx[0]), *(const int*)(tab + idx[1])),\n                        _mm_setr_pi32(*(const int*)(tab + idx[2]), *(const int*)(tab + idx[3]))\n                    ));\n#endif\n}\ninline v_int16x8 v_lut_quads(const short* tab, const int* idx)\n{\n    return v_int16x8(_mm_set_epi64x(*(const int64_t*)(tab + idx[1]), *(const int64_t*)(tab + idx[0])));\n}\ninline v_uint16x8 v_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut((const short *)tab, idx)); }\ninline v_uint16x8 v_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_pairs((const short *)tab, idx)); }\ninline v_uint16x8 v_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_quads((const short *)tab, idx)); }\n\ninline v_int32x4 v_lut(const int* tab, const int* idx)\n{\n#if defined(_MSC_VER)\n    return v_int32x4(_mm_setr_epi32(tab[idx[0]], tab[idx[1]],\n                                    tab[idx[2]], tab[idx[3]]));\n#else\n    return v_int32x4(_mm_setr_epi64(\n                        _mm_setr_pi32(tab[idx[0]], tab[idx[1]]),\n                        _mm_setr_pi32(tab[idx[2]], tab[idx[3]])\n                    ));\n#endif\n}\ninline v_int32x4 v_lut_pairs(const int* tab, const int* idx)\n{\n    return v_int32x4(_mm_set_epi64x(*(const int64_t*)(tab + idx[1]), *(const int64_t*)(tab + idx[0])));\n}\ninline v_int32x4 v_lut_quads(const int* tab, const int* idx)\n{\n    return v_int32x4(_mm_loadu_si128((const __m128i*)(tab + idx[0])));\n}\ninline v_uint32x4 v_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut((const int *)tab, idx)); }\ninline v_uint32x4 v_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_pairs((const int *)tab, idx)); }\ninline v_uint32x4 v_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_quads((const int *)tab, idx)); }\n\ninline v_int64x2 v_lut(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(_mm_set_epi64x(tab[idx[1]], tab[idx[0]]));\n}\ninline v_int64x2 v_lut_pairs(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(_mm_loadu_si128((const __m128i*)(tab + idx[0])));\n}\ninline v_uint64x2 v_lut(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut((const int64_t *)tab, idx)); }\ninline v_uint64x2 v_lut_pairs(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut_pairs((const int64_t *)tab, idx)); }\n\ninline v_float32x4 v_lut(const float* tab, const int* idx)\n{\n    return v_float32x4(_mm_setr_ps(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]));\n}\ninline v_float32x4 v_lut_pairs(const float* tab, const int* idx) { return v_reinterpret_as_f32(v_lut_pairs((const int *)tab, idx)); }\ninline v_float32x4 v_lut_quads(const float* tab, const int* idx) { return v_reinterpret_as_f32(v_lut_quads((const int *)tab, idx)); }\n\ninline v_float64x2 v_lut(const double* tab, const int* idx)\n{\n    return v_float64x2(_mm_setr_pd(tab[idx[0]], tab[idx[1]]));\n}\ninline v_float64x2 v_lut_pairs(const double* tab, const int* idx) { return v_float64x2(_mm_castsi128_pd(_mm_loadu_si128((const __m128i*)(tab + idx[0])))); }\n\ninline v_int32x4 v_lut(const int* tab, const v_int32x4& idxvec)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n    return v_int32x4(_mm_setr_epi32(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]));\n}\n\ninline v_uint32x4 v_lut(const unsigned* tab, const v_int32x4& idxvec)\n{\n    return v_reinterpret_as_u32(v_lut((const int *)tab, idxvec));\n}\n\ninline v_float32x4 v_lut(const float* tab, const v_int32x4& idxvec)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n    return v_float32x4(_mm_setr_ps(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]));\n}\n\ninline v_float64x2 v_lut(const double* tab, const v_int32x4& idxvec)\n{\n    int idx[2];\n    v_store_low(idx, idxvec);\n    return v_float64x2(_mm_setr_pd(tab[idx[0]], tab[idx[1]]));\n}\n\n// loads pairs from the table and deinterleaves them, e.g. returns:\n//   x = (tab[idxvec[0], tab[idxvec[1]], tab[idxvec[2]], tab[idxvec[3]]),\n//   y = (tab[idxvec[0]+1], tab[idxvec[1]+1], tab[idxvec[2]+1], tab[idxvec[3]+1])\n// note that the indices are float's indices, not the float-pair indices.\n// in theory, this function can be used to implement bilinear interpolation,\n// when idxvec are the offsets within the image.\ninline void v_lut_deinterleave(const float* tab, const v_int32x4& idxvec, v_float32x4& x, v_float32x4& y)\n{\n    int CV_DECL_ALIGNED(32) idx[4];\n    v_store_aligned(idx, idxvec);\n    __m128 z = _mm_setzero_ps();\n    __m128 xy01 = _mm_loadl_pi(z, (__m64*)(tab + idx[0]));\n    __m128 xy23 = _mm_loadl_pi(z, (__m64*)(tab + idx[2]));\n    xy01 = _mm_loadh_pi(xy01, (__m64*)(tab + idx[1]));\n    xy23 = _mm_loadh_pi(xy23, (__m64*)(tab + idx[3]));\n    __m128 xxyy02 = _mm_unpacklo_ps(xy01, xy23);\n    __m128 xxyy13 = _mm_unpackhi_ps(xy01, xy23);\n    x = v_float32x4(_mm_unpacklo_ps(xxyy02, xxyy13));\n    y = v_float32x4(_mm_unpackhi_ps(xxyy02, xxyy13));\n}\n\ninline void v_lut_deinterleave(const double* tab, const v_int32x4& idxvec, v_float64x2& x, v_float64x2& y)\n{\n    int idx[2];\n    v_store_low(idx, idxvec);\n    __m128d xy0 = _mm_loadu_pd(tab + idx[0]);\n    __m128d xy1 = _mm_loadu_pd(tab + idx[1]);\n    x = v_float64x2(_mm_unpacklo_pd(xy0, xy1));\n    y = v_float64x2(_mm_unpackhi_pd(xy0, xy1));\n}\n\ninline v_int8x16 v_interleave_pairs(const v_int8x16& vec)\n{\n#if CV_SSSE3\n    return v_int8x16(_mm_shuffle_epi8(vec.val, _mm_set_epi64x(0x0f0d0e0c0b090a08, 0x0705060403010200)));\n#else\n    __m128i a = _mm_shufflelo_epi16(vec.val, _MM_SHUFFLE(3, 1, 2, 0));\n    a = _mm_shufflehi_epi16(a, _MM_SHUFFLE(3, 1, 2, 0));\n    a = _mm_shuffle_epi32(a, _MM_SHUFFLE(3, 1, 2, 0));\n    return v_int8x16(_mm_unpacklo_epi8(a, _mm_unpackhi_epi64(a, a)));\n#endif\n}\ninline v_uint8x16 v_interleave_pairs(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); }\ninline v_int8x16 v_interleave_quads(const v_int8x16& vec)\n{\n#if CV_SSSE3\n    return v_int8x16(_mm_shuffle_epi8(vec.val, _mm_set_epi64x(0x0f0b0e0a0d090c08, 0x0703060205010400)));\n#else\n    __m128i a = _mm_shuffle_epi32(vec.val, _MM_SHUFFLE(3, 1, 2, 0));\n    return v_int8x16(_mm_unpacklo_epi8(a, _mm_unpackhi_epi64(a, a)));\n#endif\n}\ninline v_uint8x16 v_interleave_quads(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_interleave_pairs(const v_int16x8& vec)\n{\n#if CV_SSSE3\n    return v_int16x8(_mm_shuffle_epi8(vec.val, _mm_set_epi64x(0x0f0e0b0a0d0c0908, 0x0706030205040100)));\n#else\n    __m128i a = _mm_shufflelo_epi16(vec.val, _MM_SHUFFLE(3, 1, 2, 0));\n    return v_int16x8(_mm_shufflehi_epi16(a, _MM_SHUFFLE(3, 1, 2, 0)));\n#endif\n}\ninline v_uint16x8 v_interleave_pairs(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); }\ninline v_int16x8 v_interleave_quads(const v_int16x8& vec)\n{\n#if CV_SSSE3\n    return v_int16x8(_mm_shuffle_epi8(vec.val, _mm_set_epi64x(0x0f0e07060d0c0504, 0x0b0a030209080100)));\n#else\n    return v_int16x8(_mm_unpacklo_epi16(vec.val, _mm_unpackhi_epi64(vec.val, vec.val)));\n#endif\n}\ninline v_uint16x8 v_interleave_quads(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_interleave_pairs(const v_int32x4& vec)\n{\n    return v_int32x4(_mm_shuffle_epi32(vec.val, _MM_SHUFFLE(3, 1, 2, 0)));\n}\ninline v_uint32x4 v_interleave_pairs(const v_uint32x4& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\ninline v_float32x4 v_interleave_pairs(const v_float32x4& vec) { return v_reinterpret_as_f32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\n\ninline v_int8x16 v_pack_triplets(const v_int8x16& vec)\n{\n#if CV_SSSE3\n    return v_int8x16(_mm_shuffle_epi8(vec.val, _mm_set_epi64x(0xffffff0f0e0d0c0a, 0x0908060504020100)));\n#else\n    __m128i mask = _mm_set1_epi64x(0x00000000FFFFFFFF);\n    __m128i a = _mm_srli_si128(_mm_or_si128(_mm_andnot_si128(mask, vec.val), _mm_and_si128(mask, _mm_sll_epi32(vec.val, _mm_set_epi64x(0, 8)))), 1);\n    return v_int8x16(_mm_srli_si128(_mm_shufflelo_epi16(a, _MM_SHUFFLE(2, 1, 0, 3)), 2));\n#endif\n}\ninline v_uint8x16 v_pack_triplets(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_pack_triplets(const v_int16x8& vec)\n{\n#if CV_SSSE3\n    return v_int16x8(_mm_shuffle_epi8(vec.val, _mm_set_epi64x(0xffff0f0e0d0c0b0a, 0x0908050403020100)));\n#else\n    return v_int16x8(_mm_srli_si128(_mm_shufflelo_epi16(vec.val, _MM_SHUFFLE(2, 1, 0, 3)), 2));\n#endif\n}\ninline v_uint16x8 v_pack_triplets(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_pack_triplets(const v_int32x4& vec) { return vec; }\ninline v_uint32x4 v_pack_triplets(const v_uint32x4& vec) { return vec; }\ninline v_float32x4 v_pack_triplets(const v_float32x4& vec) { return vec; }\n\ntemplate<int i>\ninline uchar v_extract_n(const v_uint8x16& v)\n{\n#if CV_SSE4_1\n    return (uchar)_mm_extract_epi8(v.val, i);\n#else\n    return v_rotate_right<i>(v).get0();\n#endif\n}\n\ntemplate<int i>\ninline schar v_extract_n(const v_int8x16& v)\n{\n    return (schar)v_extract_n<i>(v_reinterpret_as_u8(v));\n}\n\ntemplate<int i>\ninline ushort v_extract_n(const v_uint16x8& v)\n{\n    return (ushort)_mm_extract_epi16(v.val, i);\n}\n\ntemplate<int i>\ninline short v_extract_n(const v_int16x8& v)\n{\n    return (short)v_extract_n<i>(v_reinterpret_as_u16(v));\n}\n\ntemplate<int i>\ninline uint v_extract_n(const v_uint32x4& v)\n{\n#if CV_SSE4_1\n    return (uint)_mm_extract_epi32(v.val, i);\n#else\n    return v_rotate_right<i>(v).get0();\n#endif\n}\n\ntemplate<int i>\ninline int v_extract_n(const v_int32x4& v)\n{\n    return (int)v_extract_n<i>(v_reinterpret_as_u32(v));\n}\n\ntemplate<int i>\ninline uint64 v_extract_n(const v_uint64x2& v)\n{\n#ifdef CV__SIMD_NATIVE_mm_extract_epi64\n    return (uint64)_v128_extract_epi64<i>(v.val);\n#else\n    return v_rotate_right<i>(v).get0();\n#endif\n}\n\ntemplate<int i>\ninline int64 v_extract_n(const v_int64x2& v)\n{\n    return (int64)v_extract_n<i>(v_reinterpret_as_u64(v));\n}\n\ntemplate<int i>\ninline float v_extract_n(const v_float32x4& v)\n{\n    union { uint iv; float fv; } d;\n    d.iv = v_extract_n<i>(v_reinterpret_as_u32(v));\n    return d.fv;\n}\n\ntemplate<int i>\ninline double v_extract_n(const v_float64x2& v)\n{\n    union { uint64 iv; double dv; } d;\n    d.iv = v_extract_n<i>(v_reinterpret_as_u64(v));\n    return d.dv;\n}\n\ntemplate<int i>\ninline v_int32x4 v_broadcast_element(const v_int32x4& v)\n{\n    return v_int32x4(_mm_shuffle_epi32(v.val, _MM_SHUFFLE(i,i,i,i)));\n}\n\ntemplate<int i>\ninline v_uint32x4 v_broadcast_element(const v_uint32x4& v)\n{\n    return v_uint32x4(_mm_shuffle_epi32(v.val, _MM_SHUFFLE(i,i,i,i)));\n}\n\ntemplate<int i>\ninline v_float32x4 v_broadcast_element(const v_float32x4& v)\n{\n    return v_float32x4(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE((char)i,(char)i,(char)i,(char)i)));\n}\n\n////////////// FP16 support ///////////////////////////\n\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n#if CV_FP16\n    return v_float32x4(_mm_cvtph_ps(_mm_loadu_si128((const __m128i*)ptr)));\n#else\n    const __m128i z = _mm_setzero_si128(), delta = _mm_set1_epi32(0x38000000);\n    const __m128i signmask = _mm_set1_epi32(0x80000000), maxexp = _mm_set1_epi32(0x7c000000);\n    const __m128 deltaf = _mm_castsi128_ps(_mm_set1_epi32(0x38800000));\n    __m128i bits = _mm_unpacklo_epi16(z, _mm_loadl_epi64((const __m128i*)ptr)); // h << 16\n    __m128i e = _mm_and_si128(bits, maxexp), sign = _mm_and_si128(bits, signmask);\n    __m128i t = _mm_add_epi32(_mm_srli_epi32(_mm_xor_si128(bits, sign), 3), delta); // ((h & 0x7fff) << 13) + delta\n    __m128i zt = _mm_castps_si128(_mm_sub_ps(_mm_castsi128_ps(_mm_add_epi32(t, _mm_set1_epi32(1 << 23))), deltaf));\n\n    t = _mm_add_epi32(t, _mm_and_si128(delta, _mm_cmpeq_epi32(maxexp, e)));\n    __m128i zmask = _mm_cmpeq_epi32(e, z);\n    __m128i ft = v_select_si128(zmask, zt, t);\n    return v_float32x4(_mm_castsi128_ps(_mm_or_si128(ft, sign)));\n#endif\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n#if CV_FP16\n    __m128i fp16_value = _mm_cvtps_ph(v.val, 0);\n    _mm_storel_epi64((__m128i*)ptr, fp16_value);\n#else\n    const __m128i signmask = _mm_set1_epi32(0x80000000);\n    const __m128i rval = _mm_set1_epi32(0x3f000000);\n\n    __m128i t = _mm_castps_si128(v.val);\n    __m128i sign = _mm_srai_epi32(_mm_and_si128(t, signmask), 16);\n    t = _mm_andnot_si128(signmask, t);\n\n    __m128i finitemask = _mm_cmpgt_epi32(_mm_set1_epi32(0x47800000), t);\n    __m128i isnan = _mm_cmpgt_epi32(t, _mm_set1_epi32(0x7f800000));\n    __m128i naninf = v_select_si128(isnan, _mm_set1_epi32(0x7e00), _mm_set1_epi32(0x7c00));\n    __m128i tinymask = _mm_cmpgt_epi32(_mm_set1_epi32(0x38800000), t);\n    __m128i tt = _mm_castps_si128(_mm_add_ps(_mm_castsi128_ps(t), _mm_castsi128_ps(rval)));\n    tt = _mm_sub_epi32(tt, rval);\n    __m128i odd = _mm_and_si128(_mm_srli_epi32(t, 13), _mm_set1_epi32(1));\n    __m128i nt = _mm_add_epi32(t, _mm_set1_epi32(0xc8000fff));\n    nt = _mm_srli_epi32(_mm_add_epi32(nt, odd), 13);\n    t = v_select_si128(tinymask, tt, nt);\n    t = v_select_si128(finitemask, t, naninf);\n    t = _mm_or_si128(t, sign);\n    t = _mm_packs_epi32(t, t);\n    _mm_storel_epi64((__m128i*)ptr, t);\n#endif\n}\n\ninline void v_cleanup() {}\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_sse_em.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html\n\n#ifndef OPENCV_HAL_INTRIN_SSE_EM_HPP\n#define OPENCV_HAL_INTRIN_SSE_EM_HPP\n\nnamespace cv\n{\n\n//! @cond IGNORED\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n#define OPENCV_HAL_SSE_WRAP_1(fun, tp) \\\n    inline tp _v128_##fun(const tp& a) \\\n    { return _mm_##fun(a); }\n\n#define OPENCV_HAL_SSE_WRAP_2(fun, tp) \\\n    inline tp _v128_##fun(const tp& a, const tp& b) \\\n    { return _mm_##fun(a, b); }\n\n#define OPENCV_HAL_SSE_WRAP_3(fun, tp) \\\n    inline tp _v128_##fun(const tp& a, const tp& b, const tp& c) \\\n    { return _mm_##fun(a, b, c); }\n\n///////////////////////////// XOP /////////////////////////////\n\n// [todo] define CV_XOP\n#if 1 // CV_XOP\ninline __m128i _v128_comgt_epu32(const __m128i& a, const __m128i& b)\n{\n    const __m128i delta = _mm_set1_epi32((int)0x80000000);\n    return _mm_cmpgt_epi32(_mm_xor_si128(a, delta), _mm_xor_si128(b, delta));\n}\n// wrapping XOP\n#else\nOPENCV_HAL_SSE_WRAP_2(_v128_comgt_epu32, __m128i)\n#endif // !CV_XOP\n\n///////////////////////////// SSE4.1 /////////////////////////////\n\n#if !CV_SSE4_1\n\n/** Swizzle **/\ninline __m128i _v128_blendv_epi8(const __m128i& a, const __m128i& b, const __m128i& mask)\n{ return _mm_xor_si128(a, _mm_and_si128(_mm_xor_si128(b, a), mask)); }\n\n/** Convert **/\n// 8 >> 16\ninline __m128i _v128_cvtepu8_epi16(const __m128i& a)\n{\n    const __m128i z = _mm_setzero_si128();\n    return _mm_unpacklo_epi8(a, z);\n}\ninline __m128i _v128_cvtepi8_epi16(const __m128i& a)\n{ return _mm_srai_epi16(_mm_unpacklo_epi8(a, a), 8); }\n// 8 >> 32\ninline __m128i _v128_cvtepu8_epi32(const __m128i& a)\n{\n    const __m128i z = _mm_setzero_si128();\n    return _mm_unpacklo_epi16(_mm_unpacklo_epi8(a, z), z);\n}\ninline __m128i _v128_cvtepi8_epi32(const __m128i& a)\n{\n    __m128i r = _mm_unpacklo_epi8(a, a);\n    r = _mm_unpacklo_epi8(r, r);\n    return _mm_srai_epi32(r, 24);\n}\n// 16 >> 32\ninline __m128i _v128_cvtepu16_epi32(const __m128i& a)\n{\n    const __m128i z = _mm_setzero_si128();\n    return _mm_unpacklo_epi16(a, z);\n}\ninline __m128i _v128_cvtepi16_epi32(const __m128i& a)\n{ return _mm_srai_epi32(_mm_unpacklo_epi16(a, a), 16); }\n// 32 >> 64\ninline __m128i _v128_cvtepu32_epi64(const __m128i& a)\n{\n    const __m128i z = _mm_setzero_si128();\n    return _mm_unpacklo_epi32(a, z);\n}\ninline __m128i _v128_cvtepi32_epi64(const __m128i& a)\n{ return _mm_unpacklo_epi32(a, _mm_srai_epi32(a, 31)); }\n\n/** Arithmetic **/\ninline __m128i _v128_mullo_epi32(const __m128i& a, const __m128i& b)\n{\n    __m128i c0 = _mm_mul_epu32(a, b);\n    __m128i c1 = _mm_mul_epu32(_mm_srli_epi64(a, 32), _mm_srli_epi64(b, 32));\n    __m128i d0 = _mm_unpacklo_epi32(c0, c1);\n    __m128i d1 = _mm_unpackhi_epi32(c0, c1);\n    return _mm_unpacklo_epi64(d0, d1);\n}\n\n/** Math **/\ninline __m128i _v128_min_epu32(const __m128i& a, const __m128i& b)\n{ return _v128_blendv_epi8(a, b, _v128_comgt_epu32(a, b)); }\n\n// wrapping SSE4.1\n#else\nOPENCV_HAL_SSE_WRAP_1(cvtepu8_epi16, __m128i)\nOPENCV_HAL_SSE_WRAP_1(cvtepi8_epi16, __m128i)\nOPENCV_HAL_SSE_WRAP_1(cvtepu8_epi32, __m128i)\nOPENCV_HAL_SSE_WRAP_1(cvtepi8_epi32, __m128i)\nOPENCV_HAL_SSE_WRAP_1(cvtepu16_epi32, __m128i)\nOPENCV_HAL_SSE_WRAP_1(cvtepi16_epi32, __m128i)\nOPENCV_HAL_SSE_WRAP_1(cvtepu32_epi64, __m128i)\nOPENCV_HAL_SSE_WRAP_1(cvtepi32_epi64, __m128i)\nOPENCV_HAL_SSE_WRAP_2(min_epu32, __m128i)\nOPENCV_HAL_SSE_WRAP_2(mullo_epi32, __m128i)\nOPENCV_HAL_SSE_WRAP_3(blendv_epi8, __m128i)\n#endif // !CV_SSE4_1\n\n///////////////////////////// Revolutionary /////////////////////////////\n\n/** Convert **/\n// 16 << 8\ninline __m128i _v128_cvtepu8_epi16_high(const __m128i& a)\n{\n    const __m128i z = _mm_setzero_si128();\n    return _mm_unpackhi_epi8(a, z);\n}\ninline __m128i _v128_cvtepi8_epi16_high(const __m128i& a)\n{ return _mm_srai_epi16(_mm_unpackhi_epi8(a, a), 8); }\n// 32 << 16\ninline __m128i _v128_cvtepu16_epi32_high(const __m128i& a)\n{\n    const __m128i z = _mm_setzero_si128();\n    return _mm_unpackhi_epi16(a, z);\n}\ninline __m128i _v128_cvtepi16_epi32_high(const __m128i& a)\n{ return _mm_srai_epi32(_mm_unpackhi_epi16(a, a), 16); }\n// 64 << 32\ninline __m128i _v128_cvtepu32_epi64_high(const __m128i& a)\n{\n    const __m128i z = _mm_setzero_si128();\n    return _mm_unpackhi_epi32(a, z);\n}\ninline __m128i _v128_cvtepi32_epi64_high(const __m128i& a)\n{ return _mm_unpackhi_epi32(a, _mm_srai_epi32(a, 31)); }\n\n/** Miscellaneous **/\ninline __m128i _v128_packs_epu32(const __m128i& a, const __m128i& b)\n{\n    const __m128i m = _mm_set1_epi32(65535);\n    __m128i am = _v128_min_epu32(a, m);\n    __m128i bm = _v128_min_epu32(b, m);\n#if CV_SSE4_1\n    return _mm_packus_epi32(am, bm);\n#else\n    const __m128i d = _mm_set1_epi32(32768), nd = _mm_set1_epi16(-32768);\n    am = _mm_sub_epi32(am, d);\n    bm = _mm_sub_epi32(bm, d);\n    am = _mm_packs_epi32(am, bm);\n    return _mm_sub_epi16(am, nd);\n#endif\n}\n\ntemplate<int i>\ninline int64 _v128_extract_epi64(const __m128i& a)\n{\n#if defined(CV__SIMD_HAVE_mm_extract_epi64) || (CV_SSE4_1 && (defined(__x86_64__)/*GCC*/ || defined(_M_X64)/*MSVC*/))\n#define CV__SIMD_NATIVE_mm_extract_epi64 1\n    return _mm_extract_epi64(a, i);\n#else\n    CV_DECL_ALIGNED(16) int64 tmp[2];\n    _mm_store_si128((__m128i*)tmp, a);\n    return tmp[i];\n#endif\n}\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n} // cv::\n\n#endif // OPENCV_HAL_INTRIN_SSE_EM_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_vsx.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html\n\n#ifndef OPENCV_HAL_VSX_HPP\n#define OPENCV_HAL_VSX_HPP\n\n#include <algorithm>\n#include \"opencv2/core/utility.hpp\"\n\n#define CV_SIMD128 1\n#define CV_SIMD128_64F 1\n\nnamespace cv\n{\n\n//! @cond IGNORED\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n///////// Types ////////////\n\nstruct v_uint8x16\n{\n    typedef uchar lane_type;\n    enum { nlanes = 16 };\n    vec_uchar16 val;\n\n    explicit v_uint8x16(const vec_uchar16& v) : val(v)\n    {}\n    v_uint8x16()\n    {}\n    v_uint8x16(vec_bchar16 v) : val(vec_uchar16_c(v))\n    {}\n    v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7,\n               uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15)\n        : val(vec_uchar16_set(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15))\n    {}\n\n    static inline v_uint8x16 zero() { return v_uint8x16(vec_uchar16_z); }\n\n    uchar get0() const\n    { return vec_extract(val, 0); }\n};\n\nstruct v_int8x16\n{\n    typedef schar lane_type;\n    enum { nlanes = 16 };\n    vec_char16 val;\n\n    explicit v_int8x16(const vec_char16& v) : val(v)\n    {}\n    v_int8x16()\n    {}\n    v_int8x16(vec_bchar16 v) : val(vec_char16_c(v))\n    {}\n    v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7,\n              schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15)\n        : val(vec_char16_set(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15))\n    {}\n\n    static inline v_int8x16 zero() { return v_int8x16(vec_char16_z); }\n\n    schar get0() const\n    { return vec_extract(val, 0); }\n};\n\nstruct v_uint16x8\n{\n    typedef ushort lane_type;\n    enum { nlanes = 8 };\n    vec_ushort8 val;\n\n    explicit v_uint16x8(const vec_ushort8& v) : val(v)\n    {}\n    v_uint16x8()\n    {}\n    v_uint16x8(vec_bshort8 v) : val(vec_ushort8_c(v))\n    {}\n    v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)\n        : val(vec_ushort8_set(v0, v1, v2, v3, v4, v5, v6, v7))\n    {}\n\n    static inline v_uint16x8 zero() { return v_uint16x8(vec_ushort8_z); }\n\n    ushort get0() const\n    { return vec_extract(val, 0); }\n};\n\nstruct v_int16x8\n{\n    typedef short lane_type;\n    enum { nlanes = 8 };\n    vec_short8 val;\n\n    explicit v_int16x8(const vec_short8& v) : val(v)\n    {}\n    v_int16x8()\n    {}\n    v_int16x8(vec_bshort8 v) : val(vec_short8_c(v))\n    {}\n    v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)\n        : val(vec_short8_set(v0, v1, v2, v3, v4, v5, v6, v7))\n    {}\n\n    static inline v_int16x8 zero() { return v_int16x8(vec_short8_z); }\n\n    short get0() const\n    { return vec_extract(val, 0); }\n};\n\nstruct v_uint32x4\n{\n    typedef unsigned lane_type;\n    enum { nlanes = 4 };\n    vec_uint4 val;\n\n    explicit v_uint32x4(const vec_uint4& v) : val(v)\n    {}\n    v_uint32x4()\n    {}\n    v_uint32x4(vec_bint4 v) : val(vec_uint4_c(v))\n    {}\n    v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3) : val(vec_uint4_set(v0, v1, v2, v3))\n    {}\n\n    static inline v_uint32x4 zero() { return v_uint32x4(vec_uint4_z); }\n\n    uint get0() const\n    { return vec_extract(val, 0); }\n};\n\nstruct v_int32x4\n{\n    typedef int lane_type;\n    enum { nlanes = 4 };\n    vec_int4 val;\n\n    explicit v_int32x4(const vec_int4& v) : val(v)\n    {}\n    v_int32x4()\n    {}\n    v_int32x4(vec_bint4 v) : val(vec_int4_c(v))\n    {}\n    v_int32x4(int v0, int v1, int v2, int v3) : val(vec_int4_set(v0, v1, v2, v3))\n    {}\n\n    static inline v_int32x4 zero() { return v_int32x4(vec_int4_z); }\n\n    int get0() const\n    { return vec_extract(val, 0); }\n};\n\nstruct v_float32x4\n{\n    typedef float lane_type;\n    enum { nlanes = 4 };\n    vec_float4 val;\n\n    explicit v_float32x4(const vec_float4& v) : val(v)\n    {}\n    v_float32x4()\n    {}\n    v_float32x4(vec_bint4 v) : val(vec_float4_c(v))\n    {}\n    v_float32x4(float v0, float v1, float v2, float v3) : val(vec_float4_set(v0, v1, v2, v3))\n    {}\n\n    static inline v_float32x4 zero() { return v_float32x4(vec_float4_z); }\n\n    float get0() const\n    { return vec_extract(val, 0); }\n};\n\nstruct v_uint64x2\n{\n    typedef uint64 lane_type;\n    enum { nlanes = 2 };\n    vec_udword2 val;\n\n    explicit v_uint64x2(const vec_udword2& v) : val(v)\n    {}\n    v_uint64x2()\n    {}\n    v_uint64x2(vec_bdword2 v) : val(vec_udword2_c(v))\n    {}\n    v_uint64x2(uint64 v0, uint64 v1) : val(vec_udword2_set(v0, v1))\n    {}\n\n    static inline v_uint64x2 zero() { return v_uint64x2(vec_udword2_z); }\n\n    uint64 get0() const\n    { return vec_extract(val, 0); }\n};\n\nstruct v_int64x2\n{\n    typedef int64 lane_type;\n    enum { nlanes = 2 };\n    vec_dword2 val;\n\n    explicit v_int64x2(const vec_dword2& v) : val(v)\n    {}\n    v_int64x2()\n    {}\n    v_int64x2(vec_bdword2 v) : val(vec_dword2_c(v))\n    {}\n    v_int64x2(int64 v0, int64 v1) : val(vec_dword2_set(v0, v1))\n    {}\n\n    static inline v_int64x2 zero() { return v_int64x2(vec_dword2_z); }\n\n    int64 get0() const\n    { return vec_extract(val, 0); }\n};\n\nstruct v_float64x2\n{\n    typedef double lane_type;\n    enum { nlanes = 2 };\n    vec_double2 val;\n\n    explicit v_float64x2(const vec_double2& v) : val(v)\n    {}\n    v_float64x2()\n    {}\n    v_float64x2(vec_bdword2 v) : val(vec_double2_c(v))\n    {}\n    v_float64x2(double v0, double v1) : val(vec_double2_set(v0, v1))\n    {}\n\n    static inline v_float64x2 zero() { return v_float64x2(vec_double2_z); }\n\n    double get0() const\n    { return vec_extract(val, 0); }\n};\n\n#define OPENCV_HAL_IMPL_VSX_EXTRACT_N(_Tpvec, _Tp) \\\ntemplate<int i> inline _Tp v_extract_n(VSX_UNUSED(_Tpvec v)) { return vec_extract(v.val, i); }\n\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_uint8x16, uchar)\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_int8x16, schar)\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_uint16x8, ushort)\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_int16x8, short)\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_uint32x4, uint)\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_int32x4, int)\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_uint64x2, uint64)\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_int64x2, int64)\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_float32x4, float)\nOPENCV_HAL_IMPL_VSX_EXTRACT_N(v_float64x2, double)\n\n//////////////// Load and store operations ///////////////\n\n/*\n * clang-5 aborted during parse \"vec_xxx_c\" only if it's\n * inside a function template which is defined by preprocessor macro.\n *\n * if vec_xxx_c defined as C++ cast, clang-5 will pass it\n*/\n#define OPENCV_HAL_IMPL_VSX_INITVEC(_Tpvec, _Tp, suffix, cast)                        \\\ninline _Tpvec v_setzero_##suffix() { return _Tpvec(vec_splats((_Tp)0)); }             \\\ninline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(vec_splats((_Tp)v));}          \\\ntemplate<typename _Tpvec0> inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0 &a)  \\\n{ return _Tpvec((cast)a.val); }\n\nOPENCV_HAL_IMPL_VSX_INITVEC(v_uint8x16, uchar, u8, vec_uchar16)\nOPENCV_HAL_IMPL_VSX_INITVEC(v_int8x16, schar, s8, vec_char16)\nOPENCV_HAL_IMPL_VSX_INITVEC(v_uint16x8, ushort, u16, vec_ushort8)\nOPENCV_HAL_IMPL_VSX_INITVEC(v_int16x8, short, s16, vec_short8)\nOPENCV_HAL_IMPL_VSX_INITVEC(v_uint32x4, uint, u32, vec_uint4)\nOPENCV_HAL_IMPL_VSX_INITVEC(v_int32x4, int, s32, vec_int4)\nOPENCV_HAL_IMPL_VSX_INITVEC(v_uint64x2, uint64, u64, vec_udword2)\nOPENCV_HAL_IMPL_VSX_INITVEC(v_int64x2, int64, s64, vec_dword2)\nOPENCV_HAL_IMPL_VSX_INITVEC(v_float32x4, float, f32, vec_float4)\nOPENCV_HAL_IMPL_VSX_INITVEC(v_float64x2, double, f64, vec_double2)\n\n#define OPENCV_HAL_IMPL_VSX_LOADSTORE_C(_Tpvec, _Tp, ld, ld_a, st, st_a)    \\\ninline _Tpvec v_load(const _Tp* ptr)                                        \\\n{ return _Tpvec(ld(0, ptr)); }                                              \\\ninline _Tpvec v_load_aligned(VSX_UNUSED(const _Tp* ptr))                    \\\n{ return _Tpvec(ld_a(0, ptr)); }                                            \\\ninline _Tpvec v_load_low(const _Tp* ptr)                                    \\\n{ return _Tpvec(vec_ld_l8(ptr)); }                                          \\\ninline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1)               \\\n{ return _Tpvec(vec_mergesqh(vec_ld_l8(ptr0), vec_ld_l8(ptr1))); }          \\\ninline void v_store(_Tp* ptr, const _Tpvec& a)                              \\\n{ st(a.val, 0, ptr); }                                                      \\\ninline void v_store_aligned(VSX_UNUSED(_Tp* ptr), const _Tpvec& a)          \\\n{ st_a(a.val, 0, ptr); }                                                    \\\ninline void v_store_aligned_nocache(VSX_UNUSED(_Tp* ptr), const _Tpvec& a)  \\\n{ st_a(a.val, 0, ptr); }                                                    \\\ninline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode)         \\\n{ if(mode == hal::STORE_UNALIGNED) st(a.val, 0, ptr); else st_a(a.val, 0, ptr); } \\\ninline void v_store_low(_Tp* ptr, const _Tpvec& a)                          \\\n{ vec_st_l8(a.val, ptr); }                                                  \\\ninline void v_store_high(_Tp* ptr, const _Tpvec& a)                         \\\n{ vec_st_h8(a.val, ptr); }\n\n// working around gcc bug for aligned ld/st\n// if runtime check for vec_ld/st fail we failback to unaligned ld/st\n// https://github.com/opencv/opencv/issues/13211\n#ifdef CV_COMPILER_VSX_BROKEN_ALIGNED\n    #define OPENCV_HAL_IMPL_VSX_LOADSTORE(_Tpvec, _Tp) \\\n    OPENCV_HAL_IMPL_VSX_LOADSTORE_C(_Tpvec, _Tp, vsx_ld, vsx_ld, vsx_st, vsx_st)\n#else\n    #define OPENCV_HAL_IMPL_VSX_LOADSTORE(_Tpvec, _Tp) \\\n    OPENCV_HAL_IMPL_VSX_LOADSTORE_C(_Tpvec, _Tp, vsx_ld, vec_ld, vsx_st, vec_st)\n#endif\n\nOPENCV_HAL_IMPL_VSX_LOADSTORE(v_uint8x16,  uchar)\nOPENCV_HAL_IMPL_VSX_LOADSTORE(v_int8x16,   schar)\nOPENCV_HAL_IMPL_VSX_LOADSTORE(v_uint16x8,  ushort)\nOPENCV_HAL_IMPL_VSX_LOADSTORE(v_int16x8,   short)\nOPENCV_HAL_IMPL_VSX_LOADSTORE(v_uint32x4,  uint)\nOPENCV_HAL_IMPL_VSX_LOADSTORE(v_int32x4,   int)\nOPENCV_HAL_IMPL_VSX_LOADSTORE(v_float32x4, float)\n\nOPENCV_HAL_IMPL_VSX_LOADSTORE_C(v_float64x2, double, vsx_ld,  vsx_ld,  vsx_st,  vsx_st)\nOPENCV_HAL_IMPL_VSX_LOADSTORE_C(v_uint64x2,  uint64, vsx_ld2, vsx_ld2, vsx_st2, vsx_st2)\nOPENCV_HAL_IMPL_VSX_LOADSTORE_C(v_int64x2,    int64, vsx_ld2, vsx_ld2, vsx_st2, vsx_st2)\n\n//////////////// Value reordering ///////////////\n\n/* de&interleave */\n#define OPENCV_HAL_IMPL_VSX_INTERLEAVE(_Tp, _Tpvec)                          \\\ninline void v_load_deinterleave(const _Tp* ptr, _Tpvec& a, _Tpvec& b)        \\\n{ vec_ld_deinterleave(ptr, a.val, b.val);}                                   \\\ninline void v_load_deinterleave(const _Tp* ptr, _Tpvec& a,                   \\\n                                _Tpvec& b, _Tpvec& c)                        \\\n{ vec_ld_deinterleave(ptr, a.val, b.val, c.val); }                           \\\ninline void v_load_deinterleave(const _Tp* ptr, _Tpvec& a, _Tpvec& b,        \\\n                                                _Tpvec& c, _Tpvec& d)        \\\n{ vec_ld_deinterleave(ptr, a.val, b.val, c.val, d.val); }                    \\\ninline void v_store_interleave(_Tp* ptr, const _Tpvec& a, const _Tpvec& b,   \\\n                               hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ vec_st_interleave(a.val, b.val, ptr); }                                    \\\ninline void v_store_interleave(_Tp* ptr, const _Tpvec& a,                    \\\n                               const _Tpvec& b, const _Tpvec& c,             \\\n                               hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ vec_st_interleave(a.val, b.val, c.val, ptr); }                             \\\ninline void v_store_interleave(_Tp* ptr, const _Tpvec& a, const _Tpvec& b,   \\\n                                         const _Tpvec& c, const _Tpvec& d,   \\\n                               hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \\\n{ vec_st_interleave(a.val, b.val, c.val, d.val, ptr); }\n\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(uchar, v_uint8x16)\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(schar, v_int8x16)\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(ushort, v_uint16x8)\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(short, v_int16x8)\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(uint, v_uint32x4)\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(int, v_int32x4)\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(float, v_float32x4)\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(double, v_float64x2)\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(int64, v_int64x2)\nOPENCV_HAL_IMPL_VSX_INTERLEAVE(uint64, v_uint64x2)\n\n/* Expand */\n#define OPENCV_HAL_IMPL_VSX_EXPAND(_Tpvec, _Tpwvec, _Tp, fl, fh)  \\\ninline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1)   \\\n{                                                                 \\\n    b0.val = fh(a.val);                                           \\\n    b1.val = fl(a.val);                                           \\\n}                                                                 \\\ninline _Tpwvec v_expand_low(const _Tpvec& a)                      \\\n{ return _Tpwvec(fh(a.val)); }                                    \\\ninline _Tpwvec v_expand_high(const _Tpvec& a)                     \\\n{ return _Tpwvec(fl(a.val)); }                                    \\\ninline _Tpwvec v_load_expand(const _Tp* ptr)                      \\\n{ return _Tpwvec(fh(vec_ld_l8(ptr))); }\n\nOPENCV_HAL_IMPL_VSX_EXPAND(v_uint8x16, v_uint16x8, uchar, vec_unpacklu, vec_unpackhu)\nOPENCV_HAL_IMPL_VSX_EXPAND(v_int8x16, v_int16x8, schar, vec_unpackl, vec_unpackh)\nOPENCV_HAL_IMPL_VSX_EXPAND(v_uint16x8, v_uint32x4, ushort, vec_unpacklu, vec_unpackhu)\nOPENCV_HAL_IMPL_VSX_EXPAND(v_int16x8, v_int32x4, short, vec_unpackl, vec_unpackh)\nOPENCV_HAL_IMPL_VSX_EXPAND(v_uint32x4, v_uint64x2, uint, vec_unpacklu, vec_unpackhu)\nOPENCV_HAL_IMPL_VSX_EXPAND(v_int32x4, v_int64x2, int, vec_unpackl, vec_unpackh)\n\n/* Load and zero expand a 4 byte value into the second dword, first is don't care. */\n#if !defined(CV_COMPILER_VSX_BROKEN_ASM)\n    #define _LXSIWZX(out, ptr, T) __asm__ (\"lxsiwzx %x0, 0, %1\\r\\n\" : \"=wa\"(out) : \"r\" (ptr) : \"memory\");\n#else\n    /* This is compiler-agnostic, but will introduce an unneeded splat on the critical path. */\n    #define _LXSIWZX(out, ptr, T) out = (T)vec_udword2_sp(*(uint32_t*)(ptr));\n#endif\n\ninline v_uint32x4 v_load_expand_q(const uchar* ptr)\n{\n    // Zero-extend the extra 24B instead of unpacking. Usually faster in small kernel\n    // Likewise note, value is zero extended and upper 4 bytes are zero'ed.\n    vec_uchar16 pmu = {8, 12, 12, 12, 9, 12, 12, 12, 10, 12, 12, 12, 11, 12, 12, 12};\n    vec_uchar16 out;\n\n    _LXSIWZX(out, ptr, vec_uchar16);\n    out = vec_perm(out, out, pmu);\n    return v_uint32x4((vec_uint4)out);\n}\n\ninline v_int32x4 v_load_expand_q(const schar* ptr)\n{\n    vec_char16 out;\n    vec_short8 outs;\n    vec_int4 outw;\n\n    _LXSIWZX(out, ptr, vec_char16);\n    outs = vec_unpackl(out);\n    outw = vec_unpackh(outs);\n    return v_int32x4(outw);\n}\n\n/* pack */\n#define OPENCV_HAL_IMPL_VSX_PACK(_Tpvec, _Tp, _Tpwvec, _Tpvn, _Tpdel, sfnc, pkfnc, addfnc, pack)    \\\ninline _Tpvec v_##pack(const _Tpwvec& a, const _Tpwvec& b)                                          \\\n{                                                                                                   \\\n    return _Tpvec(pkfnc(a.val, b.val));                                                             \\\n}                                                                                                   \\\ninline void v_##pack##_store(_Tp* ptr, const _Tpwvec& a)                                            \\\n{                                                                                                   \\\n    vec_st_l8(pkfnc(a.val, a.val), ptr);                                                            \\\n}                                                                                                   \\\ntemplate<int n>                                                                                     \\\ninline _Tpvec v_rshr_##pack(const _Tpwvec& a, const _Tpwvec& b)                                     \\\n{                                                                                                   \\\n    const __vector _Tpvn vn = vec_splats((_Tpvn)n);                                                 \\\n    const __vector _Tpdel delta = vec_splats((_Tpdel)((_Tpdel)1 << (n-1)));                         \\\n    return _Tpvec(pkfnc(sfnc(addfnc(a.val, delta), vn), sfnc(addfnc(b.val, delta), vn)));           \\\n}                                                                                                   \\\ntemplate<int n>                                                                                     \\\ninline void v_rshr_##pack##_store(_Tp* ptr, const _Tpwvec& a)                                       \\\n{                                                                                                   \\\n    const __vector _Tpvn vn = vec_splats((_Tpvn)n);                                                 \\\n    const __vector _Tpdel delta = vec_splats((_Tpdel)((_Tpdel)1 << (n-1)));                         \\\n    vec_st_l8(pkfnc(sfnc(addfnc(a.val, delta), vn), delta), ptr);                                   \\\n}\n\nOPENCV_HAL_IMPL_VSX_PACK(v_uint8x16, uchar, v_uint16x8, unsigned short, unsigned short,\n                         vec_sr, vec_packs, vec_adds, pack)\nOPENCV_HAL_IMPL_VSX_PACK(v_int8x16, schar, v_int16x8, unsigned short, short,\n                         vec_sra, vec_packs, vec_adds, pack)\n\nOPENCV_HAL_IMPL_VSX_PACK(v_uint16x8, ushort, v_uint32x4, unsigned int, unsigned int,\n                         vec_sr, vec_packs, vec_add, pack)\nOPENCV_HAL_IMPL_VSX_PACK(v_int16x8, short, v_int32x4, unsigned int, int,\n                         vec_sra, vec_packs, vec_add, pack)\n\nOPENCV_HAL_IMPL_VSX_PACK(v_uint32x4, uint, v_uint64x2, unsigned long long, unsigned long long,\n                         vec_sr, vec_pack, vec_add, pack)\nOPENCV_HAL_IMPL_VSX_PACK(v_int32x4, int, v_int64x2, unsigned long long, long long,\n                         vec_sra, vec_pack, vec_add, pack)\n\nOPENCV_HAL_IMPL_VSX_PACK(v_uint8x16, uchar, v_int16x8, unsigned short, short,\n                         vec_sra, vec_packsu, vec_adds, pack_u)\nOPENCV_HAL_IMPL_VSX_PACK(v_uint16x8, ushort, v_int32x4, unsigned int, int,\n                         vec_sra, vec_packsu, vec_add, pack_u)\n// Following variant is not implemented on other platforms:\n//OPENCV_HAL_IMPL_VSX_PACK(v_uint32x4, uint, v_int64x2, unsigned long long, long long,\n//                         vec_sra, vec_packsu, vec_add, pack_u)\n\n// pack boolean\ninline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b)\n{\n    vec_uchar16 ab = vec_pack(a.val, b.val);\n    return v_uint8x16(ab);\n}\n\ninline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b,\n                           const v_uint32x4& c, const v_uint32x4& d)\n{\n    vec_ushort8 ab = vec_pack(a.val, b.val);\n    vec_ushort8 cd = vec_pack(c.val, d.val);\n    return v_uint8x16(vec_pack(ab, cd));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c,\n                           const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f,\n                           const v_uint64x2& g, const v_uint64x2& h)\n{\n    vec_uint4 ab = vec_pack(a.val, b.val);\n    vec_uint4 cd = vec_pack(c.val, d.val);\n    vec_uint4 ef = vec_pack(e.val, f.val);\n    vec_uint4 gh = vec_pack(g.val, h.val);\n\n    vec_ushort8 abcd = vec_pack(ab, cd);\n    vec_ushort8 efgh = vec_pack(ef, gh);\n    return v_uint8x16(vec_pack(abcd, efgh));\n}\n\n/* Recombine */\ntemplate <typename _Tpvec>\ninline void v_zip(const _Tpvec& a0, const _Tpvec& a1, _Tpvec& b0, _Tpvec& b1)\n{\n    b0.val = vec_mergeh(a0.val, a1.val);\n    b1.val = vec_mergel(a0.val, a1.val);\n}\n\ntemplate <typename _Tpvec>\ninline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b)\n{ return _Tpvec(vec_mergesql(a.val, b.val)); }\n\ntemplate <typename _Tpvec>\ninline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b)\n{ return _Tpvec(vec_mergesqh(a.val, b.val)); }\n\ntemplate <typename _Tpvec>\ninline void v_recombine(const _Tpvec& a, const _Tpvec& b, _Tpvec& c, _Tpvec& d)\n{\n    c.val = vec_mergesqh(a.val, b.val);\n    d.val = vec_mergesql(a.val, b.val);\n}\n\n////////// Arithmetic, bitwise and comparison operations /////////\n\n/* Element-wise binary and unary operations */\n/** Arithmetics **/\n#define OPENCV_HAL_IMPL_VSX_BIN_OP(bin_op, _Tpvec, intrin)       \\\ninline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(intrin(a.val, b.val)); }                         \\\ninline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b)   \\\n{ a.val = intrin(a.val, b.val); return a; }\n\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_uint8x16, vec_adds)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_uint8x16, vec_subs)\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_int8x16,  vec_adds)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_int8x16, vec_subs)\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_uint16x8, vec_adds)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_uint16x8, vec_subs)\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_int16x8, vec_adds)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_int16x8, vec_subs)\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_uint32x4, vec_add)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_uint32x4, vec_sub)\nOPENCV_HAL_IMPL_VSX_BIN_OP(*, v_uint32x4, vec_mul)\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_int32x4, vec_add)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_int32x4, vec_sub)\nOPENCV_HAL_IMPL_VSX_BIN_OP(*, v_int32x4, vec_mul)\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_float32x4, vec_add)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_float32x4, vec_sub)\nOPENCV_HAL_IMPL_VSX_BIN_OP(*, v_float32x4, vec_mul)\nOPENCV_HAL_IMPL_VSX_BIN_OP(/, v_float32x4, vec_div)\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_float64x2, vec_add)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_float64x2, vec_sub)\nOPENCV_HAL_IMPL_VSX_BIN_OP(*, v_float64x2, vec_mul)\nOPENCV_HAL_IMPL_VSX_BIN_OP(/, v_float64x2, vec_div)\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_uint64x2, vec_add)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_uint64x2, vec_sub)\nOPENCV_HAL_IMPL_VSX_BIN_OP(+, v_int64x2, vec_add)\nOPENCV_HAL_IMPL_VSX_BIN_OP(-, v_int64x2, vec_sub)\n\n// saturating multiply\n#define OPENCV_HAL_IMPL_VSX_MUL_SAT(_Tpvec, _Tpwvec)             \\\n    inline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b)  \\\n    {                                                            \\\n        _Tpwvec c, d;                                            \\\n        v_mul_expand(a, b, c, d);                                \\\n        return v_pack(c, d);                                     \\\n    }                                                            \\\n    inline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b)      \\\n    { a = a * b; return a; }\n\nOPENCV_HAL_IMPL_VSX_MUL_SAT(v_int8x16,  v_int16x8)\nOPENCV_HAL_IMPL_VSX_MUL_SAT(v_uint8x16, v_uint16x8)\nOPENCV_HAL_IMPL_VSX_MUL_SAT(v_int16x8,  v_int32x4)\nOPENCV_HAL_IMPL_VSX_MUL_SAT(v_uint16x8, v_uint32x4)\n\ntemplate<typename Tvec, typename Twvec>\ninline void v_mul_expand(const Tvec& a, const Tvec& b, Twvec& c, Twvec& d)\n{\n    Twvec p0 = Twvec(vec_mule(a.val, b.val));\n    Twvec p1 = Twvec(vec_mulo(a.val, b.val));\n    v_zip(p0, p1, c, d);\n}\n\ninline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b)\n{\n    vec_int4 p0 = vec_mule(a.val, b.val);\n    vec_int4 p1 = vec_mulo(a.val, b.val);\n    static const vec_uchar16 perm = {2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31};\n    return v_int16x8(vec_perm(vec_short8_c(p0), vec_short8_c(p1), perm));\n}\ninline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b)\n{\n    vec_uint4 p0 = vec_mule(a.val, b.val);\n    vec_uint4 p1 = vec_mulo(a.val, b.val);\n    static const vec_uchar16 perm = {2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31};\n    return v_uint16x8(vec_perm(vec_ushort8_c(p0), vec_ushort8_c(p1), perm));\n}\n\n/** Non-saturating arithmetics **/\n#define OPENCV_HAL_IMPL_VSX_BIN_FUNC(func, intrin)    \\\ntemplate<typename _Tpvec>                             \\\ninline _Tpvec func(const _Tpvec& a, const _Tpvec& b)  \\\n{ return _Tpvec(intrin(a.val, b.val)); }\n\nOPENCV_HAL_IMPL_VSX_BIN_FUNC(v_add_wrap, vec_add)\nOPENCV_HAL_IMPL_VSX_BIN_FUNC(v_sub_wrap, vec_sub)\nOPENCV_HAL_IMPL_VSX_BIN_FUNC(v_mul_wrap, vec_mul)\n\n/** Bitwise shifts **/\n#define OPENCV_HAL_IMPL_VSX_SHIFT_OP(_Tpvec, shr, splfunc)   \\\ninline _Tpvec operator << (const _Tpvec& a, int imm)         \\\n{ return _Tpvec(vec_sl(a.val, splfunc(imm))); }              \\\ninline _Tpvec operator >> (const _Tpvec& a, int imm)         \\\n{ return _Tpvec(shr(a.val, splfunc(imm))); }                 \\\ntemplate<int imm> inline _Tpvec v_shl(const _Tpvec& a)       \\\n{ return _Tpvec(vec_sl(a.val, splfunc(imm))); }              \\\ntemplate<int imm> inline _Tpvec v_shr(const _Tpvec& a)       \\\n{ return _Tpvec(shr(a.val, splfunc(imm))); }\n\nOPENCV_HAL_IMPL_VSX_SHIFT_OP(v_uint8x16, vec_sr, vec_uchar16_sp)\nOPENCV_HAL_IMPL_VSX_SHIFT_OP(v_uint16x8, vec_sr, vec_ushort8_sp)\nOPENCV_HAL_IMPL_VSX_SHIFT_OP(v_uint32x4, vec_sr, vec_uint4_sp)\nOPENCV_HAL_IMPL_VSX_SHIFT_OP(v_uint64x2, vec_sr, vec_udword2_sp)\n// algebraic right shift\nOPENCV_HAL_IMPL_VSX_SHIFT_OP(v_int8x16, vec_sra, vec_uchar16_sp)\nOPENCV_HAL_IMPL_VSX_SHIFT_OP(v_int16x8, vec_sra, vec_ushort8_sp)\nOPENCV_HAL_IMPL_VSX_SHIFT_OP(v_int32x4, vec_sra, vec_uint4_sp)\nOPENCV_HAL_IMPL_VSX_SHIFT_OP(v_int64x2, vec_sra, vec_udword2_sp)\n\n/** Bitwise logic **/\n#define OPENCV_HAL_IMPL_VSX_LOGIC_OP(_Tpvec)    \\\nOPENCV_HAL_IMPL_VSX_BIN_OP(&, _Tpvec, vec_and)  \\\nOPENCV_HAL_IMPL_VSX_BIN_OP(|, _Tpvec, vec_or)   \\\nOPENCV_HAL_IMPL_VSX_BIN_OP(^, _Tpvec, vec_xor)  \\\ninline _Tpvec operator ~ (const _Tpvec& a)      \\\n{ return _Tpvec(vec_not(a.val)); }\n\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_uint8x16)\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_int8x16)\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_uint16x8)\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_int16x8)\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_uint32x4)\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_int32x4)\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_uint64x2)\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_int64x2)\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_float32x4)\nOPENCV_HAL_IMPL_VSX_LOGIC_OP(v_float64x2)\n\n/** Bitwise select **/\n#define OPENCV_HAL_IMPL_VSX_SELECT(_Tpvec, cast)                             \\\ninline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(vec_sel(b.val, a.val, cast(mask.val))); }\n\nOPENCV_HAL_IMPL_VSX_SELECT(v_uint8x16, vec_bchar16_c)\nOPENCV_HAL_IMPL_VSX_SELECT(v_int8x16, vec_bchar16_c)\nOPENCV_HAL_IMPL_VSX_SELECT(v_uint16x8, vec_bshort8_c)\nOPENCV_HAL_IMPL_VSX_SELECT(v_int16x8, vec_bshort8_c)\nOPENCV_HAL_IMPL_VSX_SELECT(v_uint32x4, vec_bint4_c)\nOPENCV_HAL_IMPL_VSX_SELECT(v_int32x4, vec_bint4_c)\nOPENCV_HAL_IMPL_VSX_SELECT(v_float32x4, vec_bint4_c)\nOPENCV_HAL_IMPL_VSX_SELECT(v_float64x2, vec_bdword2_c)\n\n/** Comparison **/\n#define OPENCV_HAL_IMPL_VSX_INT_CMP_OP(_Tpvec)                 \\\ninline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b)   \\\n{ return _Tpvec(vec_cmpeq(a.val, b.val)); }                    \\\ninline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b)   \\\n{ return _Tpvec(vec_cmpne(a.val, b.val)); }                    \\\ninline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b)    \\\n{ return _Tpvec(vec_cmplt(a.val, b.val)); }                    \\\ninline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b)    \\\n{ return _Tpvec(vec_cmpgt(a.val, b.val)); }                    \\\ninline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b)   \\\n{ return _Tpvec(vec_cmple(a.val, b.val)); }                    \\\ninline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b)   \\\n{ return _Tpvec(vec_cmpge(a.val, b.val)); }\n\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_uint8x16)\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_int8x16)\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_uint16x8)\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_int16x8)\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_uint32x4)\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_int32x4)\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_float32x4)\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_float64x2)\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_uint64x2)\nOPENCV_HAL_IMPL_VSX_INT_CMP_OP(v_int64x2)\n\ninline v_float32x4 v_not_nan(const v_float32x4& a)\n{ return v_float32x4(vec_cmpeq(a.val, a.val)); }\ninline v_float64x2 v_not_nan(const v_float64x2& a)\n{ return v_float64x2(vec_cmpeq(a.val, a.val)); }\n\n/** min/max **/\nOPENCV_HAL_IMPL_VSX_BIN_FUNC(v_min, vec_min)\nOPENCV_HAL_IMPL_VSX_BIN_FUNC(v_max, vec_max)\n\n/** Rotate **/\n#define OPENCV_IMPL_VSX_ROTATE(_Tpvec, suffix, shf, cast)                       \\\ntemplate<int imm>                                                               \\\ninline _Tpvec v_rotate_##suffix(const _Tpvec& a)                                \\\n{                                                                               \\\n    const int wd = imm * sizeof(typename _Tpvec::lane_type);                    \\\n    if (wd > 15)                                                                \\\n        return _Tpvec::zero();                                                  \\\n    return _Tpvec((cast)shf(vec_uchar16_c(a.val), vec_uchar16_sp(wd << 3)));    \\\n}\n\n#define OPENCV_IMPL_VSX_ROTATE_LR(_Tpvec, cast)     \\\nOPENCV_IMPL_VSX_ROTATE(_Tpvec, left, vec_slo, cast) \\\nOPENCV_IMPL_VSX_ROTATE(_Tpvec, right, vec_sro, cast)\n\nOPENCV_IMPL_VSX_ROTATE_LR(v_uint8x16, vec_uchar16)\nOPENCV_IMPL_VSX_ROTATE_LR(v_int8x16,  vec_char16)\nOPENCV_IMPL_VSX_ROTATE_LR(v_uint16x8, vec_ushort8)\nOPENCV_IMPL_VSX_ROTATE_LR(v_int16x8,  vec_short8)\nOPENCV_IMPL_VSX_ROTATE_LR(v_uint32x4, vec_uint4)\nOPENCV_IMPL_VSX_ROTATE_LR(v_int32x4,  vec_int4)\nOPENCV_IMPL_VSX_ROTATE_LR(v_float32x4, vec_float4)\nOPENCV_IMPL_VSX_ROTATE_LR(v_uint64x2, vec_udword2)\nOPENCV_IMPL_VSX_ROTATE_LR(v_int64x2,  vec_dword2)\nOPENCV_IMPL_VSX_ROTATE_LR(v_float64x2, vec_double2)\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b)\n{\n    enum { CV_SHIFT = 16 - imm * (sizeof(typename _Tpvec::lane_type)) };\n    if (CV_SHIFT == 16)\n        return a;\n#ifdef __IBMCPP__\n    return _Tpvec(vec_sld(b.val, a.val, CV_SHIFT & 15));\n#else\n    return _Tpvec(vec_sld(b.val, a.val, CV_SHIFT));\n#endif\n}\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b)\n{\n    enum { CV_SHIFT = imm * (sizeof(typename _Tpvec::lane_type)) };\n    if (CV_SHIFT == 16)\n        return b;\n    return _Tpvec(vec_sld(a.val, b.val, CV_SHIFT));\n}\n\n#define OPENCV_IMPL_VSX_ROTATE_64_2RG(_Tpvec, suffix, rg1, rg2)   \\\ntemplate<int imm>                                                 \\\ninline _Tpvec v_rotate_##suffix(const _Tpvec& a, const _Tpvec& b) \\\n{                                                                 \\\n    if (imm == 1)                                                 \\\n        return _Tpvec(vec_permi(rg1.val, rg2.val, 2));            \\\n    return imm ? b : a;                                           \\\n}\n\n#define OPENCV_IMPL_VSX_ROTATE_64_2RG_LR(_Tpvec)    \\\nOPENCV_IMPL_VSX_ROTATE_64_2RG(_Tpvec, left,  b, a)  \\\nOPENCV_IMPL_VSX_ROTATE_64_2RG(_Tpvec, right, a, b)\n\nOPENCV_IMPL_VSX_ROTATE_64_2RG_LR(v_float64x2)\nOPENCV_IMPL_VSX_ROTATE_64_2RG_LR(v_uint64x2)\nOPENCV_IMPL_VSX_ROTATE_64_2RG_LR(v_int64x2)\n\n/* Reverse */\ninline v_uint8x16 v_reverse(const v_uint8x16 &a)\n{\n    static const vec_uchar16 perm = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};\n    vec_uchar16 vec = (vec_uchar16)a.val;\n    return v_uint8x16(vec_perm(vec, vec, perm));\n}\n\ninline v_int8x16 v_reverse(const v_int8x16 &a)\n{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); }\n\ninline v_uint16x8 v_reverse(const v_uint16x8 &a)\n{\n    static const vec_uchar16 perm = {14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1};\n    vec_uchar16 vec = (vec_uchar16)a.val;\n    return v_reinterpret_as_u16(v_uint8x16(vec_perm(vec, vec, perm)));\n}\n\ninline v_int16x8 v_reverse(const v_int16x8 &a)\n{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); }\n\ninline v_uint32x4 v_reverse(const v_uint32x4 &a)\n{\n    static const vec_uchar16 perm = {12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3};\n    vec_uchar16 vec = (vec_uchar16)a.val;\n    return v_reinterpret_as_u32(v_uint8x16(vec_perm(vec, vec, perm)));\n}\n\ninline v_int32x4 v_reverse(const v_int32x4 &a)\n{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_float32x4 v_reverse(const v_float32x4 &a)\n{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_uint64x2 v_reverse(const v_uint64x2 &a)\n{\n    static const vec_uchar16 perm = {8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7};\n    vec_uchar16 vec = (vec_uchar16)a.val;\n    return v_reinterpret_as_u64(v_uint8x16(vec_perm(vec, vec, perm)));\n}\n\ninline v_int64x2 v_reverse(const v_int64x2 &a)\n{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); }\n\ninline v_float64x2 v_reverse(const v_float64x2 &a)\n{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); }\n\n/* Extract */\ntemplate<int s, typename _Tpvec>\ninline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b)\n{ return v_rotate_right<s>(a, b); }\n\n////////// Reduce and mask /////////\n\n/** Reduce **/\ninline uint v_reduce_sum(const v_uint8x16& a)\n{\n    const vec_uint4 zero4 = vec_uint4_z;\n    vec_uint4 sum4 = vec_sum4s(a.val, zero4);\n    return (uint)vec_extract(vec_sums(vec_int4_c(sum4), vec_int4_c(zero4)), 3);\n}\ninline int v_reduce_sum(const v_int8x16& a)\n{\n    const vec_int4 zero4 = vec_int4_z;\n    vec_int4 sum4 = vec_sum4s(a.val, zero4);\n    return (int)vec_extract(vec_sums(sum4, zero4), 3);\n}\ninline int v_reduce_sum(const v_int16x8& a)\n{\n    const vec_int4 zero = vec_int4_z;\n    return saturate_cast<int>(vec_extract(vec_sums(vec_sum4s(a.val, zero), zero), 3));\n}\ninline uint v_reduce_sum(const v_uint16x8& a)\n{\n    const vec_int4 v4 = vec_int4_c(vec_unpackhu(vec_adds(a.val, vec_sld(a.val, a.val, 8))));\n    return saturate_cast<uint>(vec_extract(vec_sums(v4, vec_int4_z), 3));\n}\n\n#define OPENCV_HAL_IMPL_VSX_REDUCE_OP_4(_Tpvec, _Tpvec2, scalartype, suffix, func) \\\ninline scalartype v_reduce_##suffix(const _Tpvec& a)                               \\\n{                                                                                  \\\n    const _Tpvec2 rs = func(a.val, vec_sld(a.val, a.val, 8));                      \\\n    return vec_extract(func(rs, vec_sld(rs, rs, 4)), 0);                           \\\n}\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_uint32x4, vec_uint4, uint, sum, vec_add)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_uint32x4, vec_uint4, uint, max, vec_max)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_uint32x4, vec_uint4, uint, min, vec_min)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_int32x4, vec_int4, int, sum, vec_add)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_int32x4, vec_int4, int, max, vec_max)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_int32x4, vec_int4, int, min, vec_min)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_float32x4, vec_float4, float, sum, vec_add)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_float32x4, vec_float4, float, max, vec_max)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_float32x4, vec_float4, float, min, vec_min)\n\ninline uint64 v_reduce_sum(const v_uint64x2& a)\n{\n    return vec_extract(vec_add(a.val, vec_permi(a.val, a.val, 3)), 0);\n}\ninline int64 v_reduce_sum(const v_int64x2& a)\n{\n    return vec_extract(vec_add(a.val, vec_permi(a.val, a.val, 3)), 0);\n}\ninline double v_reduce_sum(const v_float64x2& a)\n{\n    return vec_extract(vec_add(a.val, vec_permi(a.val, a.val, 3)), 0);\n}\n\n#define OPENCV_HAL_IMPL_VSX_REDUCE_OP_8(_Tpvec, _Tpvec2, scalartype, suffix, func) \\\ninline scalartype v_reduce_##suffix(const _Tpvec& a)                               \\\n{                                                                                  \\\n    _Tpvec2 rs = func(a.val, vec_sld(a.val, a.val, 8));                            \\\n    rs = func(rs, vec_sld(rs, rs, 4));                                             \\\n    return vec_extract(func(rs, vec_sld(rs, rs, 2)), 0);                           \\\n}\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_uint16x8, vec_ushort8, ushort, max, vec_max)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_uint16x8, vec_ushort8, ushort, min, vec_min)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_int16x8, vec_short8, short, max, vec_max)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_int16x8, vec_short8, short, min, vec_min)\n\n#define OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(_Tpvec, _Tpvec2, scalartype, suffix, func) \\\ninline scalartype v_reduce_##suffix(const _Tpvec& a)                               \\\n{                                                                                  \\\n    _Tpvec2 rs = func(a.val, vec_sld(a.val, a.val, 8));                            \\\n    rs = func(rs, vec_sld(rs, rs, 4));                                             \\\n    rs = func(rs, vec_sld(rs, rs, 2));                                             \\\n    return vec_extract(func(rs, vec_sld(rs, rs, 1)), 0);                           \\\n}\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_uint8x16, vec_uchar16, uchar, max, vec_max)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_uint8x16, vec_uchar16, uchar, min, vec_min)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_int8x16, vec_char16, schar, max, vec_max)\nOPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_int8x16, vec_char16, schar, min, vec_min)\n\ninline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b,\n                                 const v_float32x4& c, const v_float32x4& d)\n{\n    vec_float4 ac = vec_add(vec_mergel(a.val, c.val), vec_mergeh(a.val, c.val));\n    ac = vec_add(ac, vec_sld(ac, ac, 8));\n\n    vec_float4 bd = vec_add(vec_mergel(b.val, d.val), vec_mergeh(b.val, d.val));\n    bd = vec_add(bd, vec_sld(bd, bd, 8));\n    return v_float32x4(vec_mergeh(ac, bd));\n}\n\ninline unsigned v_reduce_sad(const v_uint8x16& a, const v_uint8x16& b)\n{\n    const vec_uint4 zero4 = vec_uint4_z;\n    vec_uint4 sum4 = vec_sum4s(vec_absd(a.val, b.val), zero4);\n    return (unsigned)vec_extract(vec_sums(vec_int4_c(sum4), vec_int4_c(zero4)), 3);\n}\ninline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b)\n{\n    const vec_int4 zero4 = vec_int4_z;\n    vec_char16 ad = vec_abss(vec_subs(a.val, b.val));\n    vec_int4 sum4 = vec_sum4s(ad, zero4);\n    return (unsigned)vec_extract(vec_sums(sum4, zero4), 3);\n}\ninline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b)\n{\n    vec_ushort8 ad = vec_absd(a.val, b.val);\n    VSX_UNUSED(vec_int4) sum = vec_sums(vec_int4_c(vec_unpackhu(ad)) + vec_int4_c(vec_unpacklu(ad)), vec_int4_z);\n    return (unsigned)vec_extract(sum, 3);\n}\ninline unsigned v_reduce_sad(const v_int16x8& a, const v_int16x8& b)\n{\n    const vec_int4 zero4 = vec_int4_z;\n    vec_short8 ad = vec_abss(vec_subs(a.val, b.val));\n    vec_int4 sum4 = vec_sum4s(ad, zero4);\n    return (unsigned)vec_extract(vec_sums(sum4, zero4), 3);\n}\ninline unsigned v_reduce_sad(const v_uint32x4& a, const v_uint32x4& b)\n{\n    const vec_uint4 ad = vec_absd(a.val, b.val);\n    const vec_uint4 rd = vec_add(ad, vec_sld(ad, ad, 8));\n    return vec_extract(vec_add(rd, vec_sld(rd, rd, 4)), 0);\n}\ninline unsigned v_reduce_sad(const v_int32x4& a, const v_int32x4& b)\n{\n    vec_int4 ad = vec_abss(vec_sub(a.val, b.val));\n    return (unsigned)vec_extract(vec_sums(ad, vec_int4_z), 3);\n}\ninline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b)\n{\n    const vec_float4 ad = vec_abs(vec_sub(a.val, b.val));\n    const vec_float4 rd = vec_add(ad, vec_sld(ad, ad, 8));\n    return vec_extract(vec_add(rd, vec_sld(rd, rd, 4)), 0);\n}\n\n/** Popcount **/\ninline v_uint8x16 v_popcount(const v_uint8x16& a)\n{ return v_uint8x16(vec_popcntu(a.val)); }\ninline v_uint8x16 v_popcount(const v_int8x16& a)\n{ return v_uint8x16(vec_popcntu(a.val)); }\ninline v_uint16x8 v_popcount(const v_uint16x8& a)\n{ return v_uint16x8(vec_popcntu(a.val)); }\ninline v_uint16x8 v_popcount(const v_int16x8& a)\n{ return v_uint16x8(vec_popcntu(a.val)); }\ninline v_uint32x4 v_popcount(const v_uint32x4& a)\n{ return v_uint32x4(vec_popcntu(a.val)); }\ninline v_uint32x4 v_popcount(const v_int32x4& a)\n{ return v_uint32x4(vec_popcntu(a.val)); }\ninline v_uint64x2 v_popcount(const v_uint64x2& a)\n{ return v_uint64x2(vec_popcntu(a.val)); }\ninline v_uint64x2 v_popcount(const v_int64x2& a)\n{ return v_uint64x2(vec_popcntu(a.val)); }\n\n/** Mask **/\ninline int v_signmask(const v_uint8x16& a)\n{\n    static const vec_uchar16 qperm = {120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0};\n    return vec_extract((vec_int4)vec_vbpermq(v_reinterpret_as_u8(a).val, qperm), 2);\n}\ninline int v_signmask(const v_int8x16& a)\n{ return v_signmask(v_reinterpret_as_u8(a)); }\n\ninline int v_signmask(const v_int16x8& a)\n{\n    static const vec_uchar16 qperm = {112, 96, 80, 64, 48, 32, 16, 0, 128, 128, 128, 128, 128, 128, 128, 128};\n    return vec_extract((vec_int4)vec_vbpermq(v_reinterpret_as_u8(a).val, qperm), 2);\n}\ninline int v_signmask(const v_uint16x8& a)\n{ return v_signmask(v_reinterpret_as_s16(a)); }\n\ninline int v_signmask(const v_int32x4& a)\n{\n    static const vec_uchar16 qperm = {96, 64, 32, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128};\n    return vec_extract((vec_int4)vec_vbpermq(v_reinterpret_as_u8(a).val, qperm), 2);\n}\ninline int v_signmask(const v_uint32x4& a)\n{ return v_signmask(v_reinterpret_as_s32(a)); }\ninline int v_signmask(const v_float32x4& a)\n{ return v_signmask(v_reinterpret_as_s32(a)); }\n\ninline int v_signmask(const v_int64x2& a)\n{\n    VSX_UNUSED(const vec_dword2) sv = vec_sr(a.val, vec_udword2_sp(63));\n    return (int)vec_extract(sv, 0) | (int)vec_extract(sv, 1) << 1;\n}\ninline int v_signmask(const v_uint64x2& a)\n{ return v_signmask(v_reinterpret_as_s64(a)); }\ninline int v_signmask(const v_float64x2& a)\n{ return v_signmask(v_reinterpret_as_s64(a)); }\n\ninline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(a)); }\ninline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(a)); }\n\ntemplate<typename _Tpvec>\ninline bool v_check_all(const _Tpvec& a)\n{ return vec_all_lt(a.val, _Tpvec::zero().val); }\ninline bool v_check_all(const v_uint8x16& a)\n{ return v_check_all(v_reinterpret_as_s8(a)); }\ninline bool v_check_all(const v_uint16x8& a)\n{ return v_check_all(v_reinterpret_as_s16(a)); }\ninline bool v_check_all(const v_uint32x4& a)\n{ return v_check_all(v_reinterpret_as_s32(a)); }\ninline bool v_check_all(const v_uint64x2& a)\n{ return v_check_all(v_reinterpret_as_s64(a)); }\ninline bool v_check_all(const v_float32x4& a)\n{ return v_check_all(v_reinterpret_as_s32(a)); }\ninline bool v_check_all(const v_float64x2& a)\n{ return v_check_all(v_reinterpret_as_s64(a)); }\n\ntemplate<typename _Tpvec>\ninline bool v_check_any(const _Tpvec& a)\n{ return vec_any_lt(a.val, _Tpvec::zero().val); }\ninline bool v_check_any(const v_uint8x16& a)\n{ return v_check_any(v_reinterpret_as_s8(a)); }\ninline bool v_check_any(const v_uint16x8& a)\n{ return v_check_any(v_reinterpret_as_s16(a)); }\ninline bool v_check_any(const v_uint32x4& a)\n{ return v_check_any(v_reinterpret_as_s32(a)); }\ninline bool v_check_any(const v_uint64x2& a)\n{ return v_check_any(v_reinterpret_as_s64(a)); }\ninline bool v_check_any(const v_float32x4& a)\n{ return v_check_any(v_reinterpret_as_s32(a)); }\ninline bool v_check_any(const v_float64x2& a)\n{ return v_check_any(v_reinterpret_as_s64(a)); }\n\n////////// Other math /////////\n\n/** Some frequent operations **/\ninline v_float32x4 v_sqrt(const v_float32x4& x)\n{ return v_float32x4(vec_sqrt(x.val)); }\ninline v_float64x2 v_sqrt(const v_float64x2& x)\n{ return v_float64x2(vec_sqrt(x.val)); }\n\ninline v_float32x4 v_invsqrt(const v_float32x4& x)\n{ return v_float32x4(vec_rsqrt(x.val)); }\ninline v_float64x2 v_invsqrt(const v_float64x2& x)\n{ return v_float64x2(vec_rsqrt(x.val)); }\n\n#define OPENCV_HAL_IMPL_VSX_MULADD(_Tpvec)                                  \\\ninline _Tpvec v_magnitude(const _Tpvec& a, const _Tpvec& b)                 \\\n{ return _Tpvec(vec_sqrt(vec_madd(a.val, a.val, vec_mul(b.val, b.val)))); } \\\ninline _Tpvec v_sqr_magnitude(const _Tpvec& a, const _Tpvec& b)             \\\n{ return _Tpvec(vec_madd(a.val, a.val, vec_mul(b.val, b.val))); }           \\\ninline _Tpvec v_fma(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c)      \\\n{ return _Tpvec(vec_madd(a.val, b.val, c.val)); }                           \\\ninline _Tpvec v_muladd(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c)   \\\n{ return _Tpvec(vec_madd(a.val, b.val, c.val)); }\n\nOPENCV_HAL_IMPL_VSX_MULADD(v_float32x4)\nOPENCV_HAL_IMPL_VSX_MULADD(v_float64x2)\n\ninline v_int32x4 v_muladd(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{ return a * b + c; }\n\n// TODO: exp, log, sin, cos\n\n/** Absolute values **/\ninline v_uint8x16 v_abs(const v_int8x16& x)\n{ return v_uint8x16(vec_uchar16_c(vec_abs(x.val))); }\n\ninline v_uint16x8 v_abs(const v_int16x8& x)\n{ return v_uint16x8(vec_ushort8_c(vec_abs(x.val))); }\n\ninline v_uint32x4 v_abs(const v_int32x4& x)\n{ return v_uint32x4(vec_uint4_c(vec_abs(x.val))); }\n\ninline v_float32x4 v_abs(const v_float32x4& x)\n{ return v_float32x4(vec_abs(x.val)); }\n\ninline v_float64x2 v_abs(const v_float64x2& x)\n{ return v_float64x2(vec_abs(x.val)); }\n\n/** Absolute difference **/\n// unsigned\nOPENCV_HAL_IMPL_VSX_BIN_FUNC(v_absdiff, vec_absd)\n\ninline v_uint8x16 v_absdiff(const v_int8x16& a, const v_int8x16& b)\n{ return v_reinterpret_as_u8(v_sub_wrap(v_max(a, b), v_min(a, b))); }\ninline v_uint16x8 v_absdiff(const v_int16x8& a, const v_int16x8& b)\n{ return v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b))); }\ninline v_uint32x4 v_absdiff(const v_int32x4& a, const v_int32x4& b)\n{ return v_reinterpret_as_u32(v_max(a, b) - v_min(a, b)); }\n\ninline v_float32x4 v_absdiff(const v_float32x4& a, const v_float32x4& b)\n{ return v_abs(a - b); }\ninline v_float64x2 v_absdiff(const v_float64x2& a, const v_float64x2& b)\n{ return v_abs(a - b); }\n\n/** Absolute difference for signed integers **/\ninline v_int8x16 v_absdiffs(const v_int8x16& a, const v_int8x16& b)\n{ return v_int8x16(vec_abss(vec_subs(a.val, b.val))); }\ninline v_int16x8 v_absdiffs(const v_int16x8& a, const v_int16x8& b)\n{ return v_int16x8(vec_abss(vec_subs(a.val, b.val))); }\n\n////////// Conversions /////////\n\n/** Rounding **/\ninline v_int32x4 v_round(const v_float32x4& a)\n{ return v_int32x4(vec_cts(vec_rint(a.val))); }\n\ninline v_int32x4 v_round(const v_float64x2& a)\n{ return v_int32x4(vec_mergesqo(vec_ctso(vec_rint(a.val)), vec_int4_z)); }\n\ninline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b)\n{ return v_int32x4(vec_mergesqo(vec_ctso(vec_rint(a.val)), vec_ctso(vec_rint(b.val)))); }\n\ninline v_int32x4 v_floor(const v_float32x4& a)\n{ return v_int32x4(vec_cts(vec_floor(a.val))); }\n\ninline v_int32x4 v_floor(const v_float64x2& a)\n{ return v_int32x4(vec_mergesqo(vec_ctso(vec_floor(a.val)), vec_int4_z)); }\n\ninline v_int32x4 v_ceil(const v_float32x4& a)\n{ return v_int32x4(vec_cts(vec_ceil(a.val))); }\n\ninline v_int32x4 v_ceil(const v_float64x2& a)\n{ return v_int32x4(vec_mergesqo(vec_ctso(vec_ceil(a.val)), vec_int4_z)); }\n\ninline v_int32x4 v_trunc(const v_float32x4& a)\n{ return v_int32x4(vec_cts(a.val)); }\n\ninline v_int32x4 v_trunc(const v_float64x2& a)\n{ return v_int32x4(vec_mergesqo(vec_ctso(a.val), vec_int4_z)); }\n\n/** To float **/\ninline v_float32x4 v_cvt_f32(const v_int32x4& a)\n{ return v_float32x4(vec_ctf(a.val)); }\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a)\n{ return v_float32x4(vec_mergesqo(vec_cvfo(a.val), vec_float4_z)); }\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b)\n{ return v_float32x4(vec_mergesqo(vec_cvfo(a.val), vec_cvfo(b.val))); }\n\ninline v_float64x2 v_cvt_f64(const v_int32x4& a)\n{ return v_float64x2(vec_ctdo(vec_mergeh(a.val, a.val))); }\n\ninline v_float64x2 v_cvt_f64_high(const v_int32x4& a)\n{ return v_float64x2(vec_ctdo(vec_mergel(a.val, a.val))); }\n\ninline v_float64x2 v_cvt_f64(const v_float32x4& a)\n{ return v_float64x2(vec_cvfo(vec_mergeh(a.val, a.val))); }\n\ninline v_float64x2 v_cvt_f64_high(const v_float32x4& a)\n{ return v_float64x2(vec_cvfo(vec_mergel(a.val, a.val))); }\n\ninline v_float64x2 v_cvt_f64(const v_int64x2& a)\n{ return v_float64x2(vec_ctd(a.val)); }\n\n////////////// Lookup table access ////////////////////\n\ninline v_int8x16 v_lut(const schar* tab, const int* idx)\n{\n    return v_int8x16(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]], tab[idx[4]], tab[idx[5]], tab[idx[6]], tab[idx[7]],\n                     tab[idx[8]], tab[idx[9]], tab[idx[10]], tab[idx[11]], tab[idx[12]], tab[idx[13]], tab[idx[14]], tab[idx[15]]);\n}\ninline v_int8x16 v_lut_pairs(const schar* tab, const int* idx)\n{\n    return v_reinterpret_as_s8(v_int16x8(*(const short*)(tab+idx[0]), *(const short*)(tab+idx[1]), *(const short*)(tab+idx[2]), *(const short*)(tab+idx[3]),\n                                       *(const short*)(tab+idx[4]), *(const short*)(tab+idx[5]), *(const short*)(tab+idx[6]), *(const short*)(tab+idx[7])));\n}\ninline v_int8x16 v_lut_quads(const schar* tab, const int* idx)\n{\n    return v_reinterpret_as_s8(v_int32x4(*(const int*)(tab+idx[0]), *(const int*)(tab+idx[1]), *(const int*)(tab+idx[2]), *(const int*)(tab+idx[3])));\n}\ninline v_uint8x16 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((const schar*)tab, idx)); }\ninline v_uint8x16 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((const schar*)tab, idx)); }\ninline v_uint8x16 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((const schar*)tab, idx)); }\n\ninline v_int16x8 v_lut(const short* tab, const int* idx)\n{\n    return v_int16x8(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]], tab[idx[4]], tab[idx[5]], tab[idx[6]], tab[idx[7]]);\n}\ninline v_int16x8 v_lut_pairs(const short* tab, const int* idx)\n{\n    return v_reinterpret_as_s16(v_int32x4(*(const int*)(tab + idx[0]), *(const int*)(tab + idx[1]), *(const int*)(tab + idx[2]), *(const int*)(tab + idx[3])));\n}\ninline v_int16x8 v_lut_quads(const short* tab, const int* idx)\n{\n    return v_reinterpret_as_s16(v_int64x2(*(const int64*)(tab + idx[0]), *(const int64*)(tab + idx[1])));\n}\ninline v_uint16x8 v_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut((const short*)tab, idx)); }\ninline v_uint16x8 v_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_pairs((const short*)tab, idx)); }\ninline v_uint16x8 v_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_quads((const short*)tab, idx)); }\n\ninline v_int32x4 v_lut(const int* tab, const int* idx)\n{\n    return v_int32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n}\ninline v_int32x4 v_lut_pairs(const int* tab, const int* idx)\n{\n    return v_reinterpret_as_s32(v_int64x2(*(const int64*)(tab + idx[0]), *(const int64*)(tab + idx[1])));\n}\ninline v_int32x4 v_lut_quads(const int* tab, const int* idx)\n{\n    return v_int32x4(vsx_ld(0, tab + idx[0]));\n}\ninline v_uint32x4 v_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut((const int*)tab, idx)); }\ninline v_uint32x4 v_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_pairs((const int*)tab, idx)); }\ninline v_uint32x4 v_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_quads((const int*)tab, idx)); }\n\ninline v_int64x2 v_lut(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(tab[idx[0]], tab[idx[1]]);\n}\ninline v_int64x2 v_lut_pairs(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(vsx_ld2(0, tab + idx[0]));\n}\ninline v_uint64x2 v_lut(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut((const int64_t *)tab, idx)); }\ninline v_uint64x2 v_lut_pairs(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut_pairs((const int64_t *)tab, idx)); }\n\ninline v_float32x4 v_lut(const float* tab, const int* idx)\n{\n    return v_float32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n}\ninline v_float32x4 v_lut_pairs(const float* tab, const int* idx) { return v_reinterpret_as_f32(v_lut_pairs((const int*)tab, idx)); }\ninline v_float32x4 v_lut_quads(const float* tab, const int* idx) { return v_load(tab + *idx); }\n\ninline v_float64x2 v_lut(const double* tab, const int* idx)\n{\n    return v_float64x2(tab[idx[0]], tab[idx[1]]);\n}\ninline v_float64x2 v_lut_pairs(const double* tab, const int* idx) { return v_load(tab + *idx); }\n\ninline v_int32x4 v_lut(const int* tab, const v_int32x4& idxvec)\n{\n    const int idx[4] = {\n        vec_extract(idxvec.val, 0),\n        vec_extract(idxvec.val, 1),\n        vec_extract(idxvec.val, 2),\n        vec_extract(idxvec.val, 3)\n    };\n    return v_int32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n}\n\ninline v_uint32x4 v_lut(const unsigned* tab, const v_int32x4& idxvec)\n{\n    const int idx[4] = {\n        vec_extract(idxvec.val, 0),\n        vec_extract(idxvec.val, 1),\n        vec_extract(idxvec.val, 2),\n        vec_extract(idxvec.val, 3)\n    };\n    return v_uint32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n}\n\ninline v_float32x4 v_lut(const float* tab, const v_int32x4& idxvec)\n{\n    const int idx[4] = {\n        vec_extract(idxvec.val, 0),\n        vec_extract(idxvec.val, 1),\n        vec_extract(idxvec.val, 2),\n        vec_extract(idxvec.val, 3)\n    };\n    return v_float32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n}\n\ninline v_float64x2 v_lut(const double* tab, const v_int32x4& idxvec)\n{\n    const int idx[2] = {\n        vec_extract(idxvec.val, 0),\n        vec_extract(idxvec.val, 1)\n    };\n    return v_float64x2(tab[idx[0]], tab[idx[1]]);\n}\n\ninline void v_lut_deinterleave(const float* tab, const v_int32x4& idxvec, v_float32x4& x, v_float32x4& y)\n{\n    vec_float4 xy0 = vec_ld_l8(tab + vec_extract(idxvec.val, 0));\n    vec_float4 xy1 = vec_ld_l8(tab + vec_extract(idxvec.val, 1));\n    vec_float4 xy2 = vec_ld_l8(tab + vec_extract(idxvec.val, 2));\n    vec_float4 xy3 = vec_ld_l8(tab + vec_extract(idxvec.val, 3));\n    vec_float4 xy02 = vec_mergeh(xy0, xy2); // x0, x2, y0, y2\n    vec_float4 xy13 = vec_mergeh(xy1, xy3); // x1, x3, y1, y3\n    x.val = vec_mergeh(xy02, xy13);\n    y.val = vec_mergel(xy02, xy13);\n}\ninline void v_lut_deinterleave(const double* tab, const v_int32x4& idxvec, v_float64x2& x, v_float64x2& y)\n{\n    vec_double2 xy0 = vsx_ld(vec_extract(idxvec.val, 0), tab);\n    vec_double2 xy1 = vsx_ld(vec_extract(idxvec.val, 1), tab);\n    x.val = vec_mergeh(xy0, xy1);\n    y.val = vec_mergel(xy0, xy1);\n}\n\ninline v_int8x16 v_interleave_pairs(const v_int8x16& vec)\n{\n    static const vec_uchar16 perm = {0, 2, 1, 3, 4, 6, 5, 7, 8, 10, 9, 11, 12, 14, 13, 15};\n    return v_int8x16(vec_perm(vec.val, vec.val, perm));\n}\ninline v_uint8x16 v_interleave_pairs(const v_uint8x16& vec)\n{ return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); }\n\ninline v_int8x16 v_interleave_quads(const v_int8x16& vec)\n{\n    static const vec_uchar16 perm = {0, 4, 1, 5, 2, 6, 3, 7, 8, 12, 9, 13, 10, 14, 11, 15};\n    return v_int8x16(vec_perm(vec.val, vec.val, perm));\n}\ninline v_uint8x16 v_interleave_quads(const v_uint8x16& vec)\n{ return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_interleave_pairs(const v_int16x8& vec)\n{\n    static const vec_uchar16 perm = {0,1, 4,5, 2,3, 6,7, 8,9, 12,13, 10,11, 14,15};\n    return v_int16x8(vec_perm(vec.val, vec.val, perm));\n}\ninline v_uint16x8 v_interleave_pairs(const v_uint16x8& vec)\n{ return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); }\n\ninline v_int16x8 v_interleave_quads(const v_int16x8& vec)\n{\n    static const vec_uchar16 perm = {0,1, 8,9, 2,3, 10,11, 4,5, 12,13, 6,7, 14,15};\n    return v_int16x8(vec_perm(vec.val, vec.val, perm));\n}\ninline v_uint16x8 v_interleave_quads(const v_uint16x8& vec)\n{ return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_interleave_pairs(const v_int32x4& vec)\n{\n    static const vec_uchar16 perm = {0,1,2,3, 8,9,10,11, 4,5,6,7, 12,13,14,15};\n    return v_int32x4(vec_perm(vec.val, vec.val, perm));\n}\ninline v_uint32x4 v_interleave_pairs(const v_uint32x4& vec)\n{ return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\ninline v_float32x4 v_interleave_pairs(const v_float32x4& vec)\n{ return v_reinterpret_as_f32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\n\ninline v_int8x16 v_pack_triplets(const v_int8x16& vec)\n{\n    static const vec_uchar16 perm = {0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14, 15, 15, 15, 15};\n    return v_int8x16(vec_perm(vec.val, vec.val, perm));\n}\ninline v_uint8x16 v_pack_triplets(const v_uint8x16& vec)\n{ return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_pack_triplets(const v_int16x8& vec)\n{\n    static const vec_uchar16 perm = {0,1, 2,3, 4,5, 8,9, 10,11, 12,13, 14,15, 14,15};\n    return v_int16x8(vec_perm(vec.val, vec.val, perm));\n}\ninline v_uint16x8 v_pack_triplets(const v_uint16x8& vec)\n{ return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_pack_triplets(const v_int32x4& vec)\n{ return vec; }\ninline v_uint32x4 v_pack_triplets(const v_uint32x4& vec)\n{ return vec; }\ninline v_float32x4 v_pack_triplets(const v_float32x4& vec)\n{ return vec; }\n\n/////// FP16 support ////////\n\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n    vec_ushort8 vf16 = vec_ld_l8((const ushort*)ptr);\n#if CV_VSX3 && defined(vec_extract_fp_from_shorth)\n    return v_float32x4(vec_extract_fp_from_shorth(vf16));\n#elif CV_VSX3 && !defined(CV_COMPILER_VSX_BROKEN_ASM)\n    vec_float4 vf32;\n    __asm__ __volatile__ (\"xvcvhpsp %x0,%x1\" : \"=wa\" (vf32) : \"wa\" (vec_mergeh(vf16, vf16)));\n    return v_float32x4(vf32);\n#else\n    const vec_int4 z = vec_int4_z, delta = vec_int4_sp(0x38000000);\n    const vec_int4 signmask = vec_int4_sp(0x80000000);\n    const vec_int4 maxexp = vec_int4_sp(0x7c000000);\n    const vec_float4 deltaf = vec_float4_c(vec_int4_sp(0x38800000));\n\n    vec_int4 bits = vec_int4_c(vec_mergeh(vec_short8_c(z), vec_short8_c(vf16)));\n    vec_int4 e = vec_and(bits, maxexp), sign = vec_and(bits, signmask);\n    vec_int4 t = vec_add(vec_sr(vec_xor(bits, sign), vec_uint4_sp(3)), delta); // ((h & 0x7fff) << 13) + delta\n    vec_int4 zt = vec_int4_c(vec_sub(vec_float4_c(vec_add(t, vec_int4_sp(1 << 23))), deltaf));\n\n    t = vec_add(t, vec_and(delta, vec_cmpeq(maxexp, e)));\n    vec_bint4 zmask = vec_cmpeq(e, z);\n    vec_int4 ft = vec_sel(t, zt, zmask);\n    return v_float32x4(vec_float4_c(vec_or(ft, sign)));\n#endif\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n// fixme: Is there any builtin op or intrinsic that cover \"xvcvsphp\"?\n#if CV_VSX3 && !defined(CV_COMPILER_VSX_BROKEN_ASM)\n    vec_ushort8 vf16;\n    __asm__ __volatile__ (\"xvcvsphp %x0,%x1\" : \"=wa\" (vf16) : \"wa\" (v.val));\n    vec_st_l8(vec_mergesqe(vf16, vf16), ptr);\n#else\n    const vec_int4 signmask = vec_int4_sp(0x80000000);\n    const vec_int4 rval = vec_int4_sp(0x3f000000);\n\n    vec_int4 t = vec_int4_c(v.val);\n    vec_int4 sign = vec_sra(vec_and(t, signmask), vec_uint4_sp(16));\n    t = vec_and(vec_nor(signmask, signmask), t);\n\n    vec_bint4 finitemask = vec_cmpgt(vec_int4_sp(0x47800000), t);\n    vec_bint4 isnan = vec_cmpgt(t, vec_int4_sp(0x7f800000));\n    vec_int4 naninf = vec_sel(vec_int4_sp(0x7c00), vec_int4_sp(0x7e00), isnan);\n    vec_bint4 tinymask = vec_cmpgt(vec_int4_sp(0x38800000), t);\n    vec_int4 tt = vec_int4_c(vec_add(vec_float4_c(t), vec_float4_c(rval)));\n    tt = vec_sub(tt, rval);\n    vec_int4 odd = vec_and(vec_sr(t, vec_uint4_sp(13)), vec_int4_sp(1));\n    vec_int4 nt = vec_add(t, vec_int4_sp(0xc8000fff));\n    nt = vec_sr(vec_add(nt, odd), vec_uint4_sp(13));\n    t = vec_sel(nt, tt, tinymask);\n    t = vec_sel(naninf, t, finitemask);\n    t = vec_or(t, sign);\n    vec_st_l8(vec_packs(t, t), ptr);\n#endif\n}\n\ninline void v_cleanup() {}\n\n\n/** Reinterpret **/\n/** its up there with load and store operations **/\n\n////////// Matrix operations /////////\n\n//////// Dot Product ////////\n// 16 >> 32\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b)\n{ return v_int32x4(vec_msum(a.val, b.val, vec_int4_z)); }\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{ return v_int32x4(vec_msum(a.val, b.val, c.val)); }\n\n// 32 >> 64\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b)\n{\n    vec_dword2 even = vec_mule(a.val, b.val);\n    vec_dword2 odd = vec_mulo(a.val, b.val);\n    return v_int64x2(vec_add(even, odd));\n}\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{ return v_dotprod(a, b) + c; }\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{ return v_uint32x4(vec_msum(a.val, b.val, c.val)); }\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b)\n{ return v_uint32x4(vec_msum(a.val, b.val, vec_uint4_z)); }\n\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b)\n{\n    const vec_ushort8 eight = vec_ushort8_sp(8);\n    vec_short8 a0 = vec_sra((vec_short8)vec_sld(a.val, a.val, 1), eight); // even\n    vec_short8 a1 = vec_sra((vec_short8)a.val, eight); // odd\n    vec_short8 b0 = vec_sra((vec_short8)vec_sld(b.val, b.val, 1), eight);\n    vec_short8 b1 = vec_sra((vec_short8)b.val, eight);\n    return v_int32x4(vec_msum(a0, b0, vec_msum(a1, b1, vec_int4_z)));\n}\n\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{\n    const vec_ushort8 eight = vec_ushort8_sp(8);\n    vec_short8 a0 = vec_sra((vec_short8)vec_sld(a.val, a.val, 1), eight); // even\n    vec_short8 a1 = vec_sra((vec_short8)a.val, eight); // odd\n    vec_short8 b0 = vec_sra((vec_short8)vec_sld(b.val, b.val, 1), eight);\n    vec_short8 b1 = vec_sra((vec_short8)b.val, eight);\n    return v_int32x4(vec_msum(a0, b0, vec_msum(a1, b1, c.val)));\n}\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b)\n{\n    const vec_uint4 zero = vec_uint4_z;\n    vec_uint4 even = vec_mule(a.val, b.val);\n    vec_uint4 odd  = vec_mulo(a.val, b.val);\n    vec_udword2 e0 = (vec_udword2)vec_mergee(even, zero);\n    vec_udword2 e1 = (vec_udword2)vec_mergeo(even, zero);\n    vec_udword2 o0 = (vec_udword2)vec_mergee(odd, zero);\n    vec_udword2 o1 = (vec_udword2)vec_mergeo(odd, zero);\n    vec_udword2 s0 = vec_add(e0, o0);\n    vec_udword2 s1 = vec_add(e1, o1);\n    return v_uint64x2(vec_add(s0, s1));\n}\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b)\n{\n    v_int32x4 prod = v_dotprod(a, b);\n    v_int64x2 c, d;\n    v_expand(prod, c, d);\n    return v_int64x2(vec_add(vec_mergeh(c.val, d.val), vec_mergel(c.val, d.val)));\n}\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 32 >> 64f\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b)\n{ return v_cvt_f64(v_dotprod(a, b)); }\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n//////// Fast Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b)\n{ return v_dotprod(a, b); }\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{ return v_int32x4(vec_msum(a.val, b.val, vec_int4_z)) + c; }\n// 32 >> 64\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_dotprod(a, b); }\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{ return v_dotprod(a, b, c); }\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b)\n{ return v_dotprod_expand(a, b); }\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{ return v_uint32x4(vec_msum(a.val, b.val, vec_uint4_z)) + c; }\n\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b)\n{\n    vec_short8 a0 = vec_unpackh(a.val);\n    vec_short8 a1 = vec_unpackl(a.val);\n    vec_short8 b0 = vec_unpackh(b.val);\n    vec_short8 b1 = vec_unpackl(b.val);\n    return v_int32x4(vec_msum(a0, b0, vec_msum(a1, b1, vec_int4_z)));\n}\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b)\n{ return v_dotprod_expand(a, b); }\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{ return v_dotprod_expand(a, b, c); }\n\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b)\n{\n    v_int32x4 prod = v_dotprod(a, b);\n    v_int64x2 c, d;\n    v_expand(prod, c, d);\n    return c + d;\n}\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{ return v_dotprod_expand_fast(a, b) + c; }\n\n// 32 >> 64f\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_dotprod_expand(a, b); }\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ return v_dotprod_expand(a, b, c); }\n\ninline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0,\n                            const v_float32x4& m1, const v_float32x4& m2,\n                            const v_float32x4& m3)\n{\n    const vec_float4 v0 = vec_splat(v.val, 0);\n    const vec_float4 v1 = vec_splat(v.val, 1);\n    const vec_float4 v2 = vec_splat(v.val, 2);\n    VSX_UNUSED(const vec_float4) v3 = vec_splat(v.val, 3);\n    return v_float32x4(vec_madd(v0, m0.val, vec_madd(v1, m1.val, vec_madd(v2, m2.val, vec_mul(v3, m3.val)))));\n}\n\ninline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0,\n                               const v_float32x4& m1, const v_float32x4& m2,\n                               const v_float32x4& a)\n{\n    const vec_float4 v0 = vec_splat(v.val, 0);\n    const vec_float4 v1 = vec_splat(v.val, 1);\n    const vec_float4 v2 = vec_splat(v.val, 2);\n    return v_float32x4(vec_madd(v0, m0.val, vec_madd(v1, m1.val, vec_madd(v2, m2.val, a.val))));\n}\n\n#define OPENCV_HAL_IMPL_VSX_TRANSPOSE4x4(_Tpvec, _Tpvec2)                        \\\ninline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1,                   \\\n                           const _Tpvec& a2, const _Tpvec& a3,                   \\\n                           _Tpvec& b0, _Tpvec& b1, _Tpvec& b2, _Tpvec& b3)       \\\n{                                                                                \\\n    _Tpvec2 a02 = vec_mergeh(a0.val, a2.val);                                    \\\n    _Tpvec2 a13 = vec_mergeh(a1.val, a3.val);                                    \\\n    b0.val = vec_mergeh(a02, a13);                                               \\\n    b1.val = vec_mergel(a02, a13);                                               \\\n    a02 = vec_mergel(a0.val, a2.val);                                            \\\n    a13 = vec_mergel(a1.val, a3.val);                                            \\\n    b2.val  = vec_mergeh(a02, a13);                                              \\\n    b3.val  = vec_mergel(a02, a13);                                              \\\n}\nOPENCV_HAL_IMPL_VSX_TRANSPOSE4x4(v_uint32x4, vec_uint4)\nOPENCV_HAL_IMPL_VSX_TRANSPOSE4x4(v_int32x4, vec_int4)\nOPENCV_HAL_IMPL_VSX_TRANSPOSE4x4(v_float32x4, vec_float4)\n\ntemplate<int i, typename Tvec>\ninline Tvec v_broadcast_element(const Tvec& v)\n{ return Tvec(vec_splat(v.val, i)); }\n\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n}\n\n#endif // OPENCV_HAL_VSX_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/intrin_wasm.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_HAL_INTRIN_WASM_HPP\n#define OPENCV_HAL_INTRIN_WASM_HPP\n\n#include <limits>\n#include <cstring>\n#include <algorithm>\n#include \"opencv2/core/saturate.hpp\"\n\n#define CV_SIMD128 1\n#define CV_SIMD128_64F 0 // Now all implementation of f64 use fallback, so disable it.\n#define CV_SIMD128_FP16 0\n\nnamespace cv\n{\n\n//! @cond IGNORED\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN\n\n#if (__EMSCRIPTEN_major__ * 1000000 + __EMSCRIPTEN_minor__ * 1000 + __EMSCRIPTEN_tiny__) < (1038046)\n// handle renames: https://github.com/emscripten-core/emscripten/pull/9440 (https://github.com/emscripten-core/emscripten/commit/755d5b46cb84d0aa120c10981b11d05646c29673)\n#define wasm_i32x4_trunc_saturate_f32x4 wasm_trunc_saturate_i32x4_f32x4\n#define wasm_u32x4_trunc_saturate_f32x4 wasm_trunc_saturate_u32x4_f32x4\n#define wasm_i64x2_trunc_saturate_f64x2 wasm_trunc_saturate_i64x2_f64x2\n#define wasm_u64x2_trunc_saturate_f64x2 wasm_trunc_saturate_u64x2_f64x2\n#define wasm_f32x4_convert_i32x4 wasm_convert_f32x4_i32x4\n#define wasm_f32x4_convert_u32x4 wasm_convert_f32x4_u32x4\n#define wasm_f64x2_convert_i64x2 wasm_convert_f64x2_i64x2\n#define wasm_f64x2_convert_u64x2 wasm_convert_f64x2_u64x2\n#endif // COMPATIBILITY: <1.38.46\n\n///////// Types ///////////\n\nstruct v_uint8x16\n{\n    typedef uchar lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 16 };\n\n    v_uint8x16() {}\n    explicit v_uint8x16(v128_t v) : val(v) {}\n    v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7,\n            uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15)\n    {\n        uchar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        val = wasm_v128_load(v);\n    }\n\n    uchar get0() const\n    {\n        return (uchar)wasm_i8x16_extract_lane(val, 0);\n    }\n\n    v128_t val;\n};\n\nstruct v_int8x16\n{\n    typedef schar lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 16 };\n\n    v_int8x16() {}\n    explicit v_int8x16(v128_t v) : val(v) {}\n    v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7,\n            schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15)\n    {\n        schar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15};\n        val = wasm_v128_load(v);\n    }\n\n    schar get0() const\n    {\n        return wasm_i8x16_extract_lane(val, 0);\n    }\n\n    v128_t val;\n};\n\nstruct v_uint16x8\n{\n    typedef ushort lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 8 };\n\n    v_uint16x8() {}\n    explicit v_uint16x8(v128_t v) : val(v) {}\n    v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)\n    {\n        ushort v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        val = wasm_v128_load(v);\n    }\n\n    ushort get0() const\n    {\n        return (ushort)wasm_i16x8_extract_lane(val, 0);    // wasm_u16x8_extract_lane() unimplemented yet\n    }\n\n    v128_t val;\n};\n\nstruct v_int16x8\n{\n    typedef short lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 8 };\n\n    v_int16x8() {}\n    explicit v_int16x8(v128_t v) : val(v) {}\n    v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)\n    {\n        short v[] = {v0, v1, v2, v3, v4, v5, v6, v7};\n        val = wasm_v128_load(v);\n    }\n\n    short get0() const\n    {\n        return wasm_i16x8_extract_lane(val, 0);\n    }\n\n    v128_t val;\n};\n\nstruct v_uint32x4\n{\n    typedef unsigned lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 4 };\n\n    v_uint32x4() {}\n    explicit v_uint32x4(v128_t v) : val(v) {}\n    v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3)\n    {\n        unsigned v[] = {v0, v1, v2, v3};\n        val = wasm_v128_load(v);\n    }\n\n    unsigned get0() const\n    {\n        return (unsigned)wasm_i32x4_extract_lane(val, 0);\n    }\n\n    v128_t val;\n};\n\nstruct v_int32x4\n{\n    typedef int lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 4 };\n\n    v_int32x4() {}\n    explicit v_int32x4(v128_t v) : val(v) {}\n    v_int32x4(int v0, int v1, int v2, int v3)\n    {\n        int v[] = {v0, v1, v2, v3};\n        val = wasm_v128_load(v);\n    }\n\n    int get0() const\n    {\n        return wasm_i32x4_extract_lane(val, 0);\n    }\n\n    v128_t val;\n};\n\nstruct v_float32x4\n{\n    typedef float lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 4 };\n\n    v_float32x4() {}\n    explicit v_float32x4(v128_t v) : val(v) {}\n    v_float32x4(float v0, float v1, float v2, float v3)\n    {\n        float v[] = {v0, v1, v2, v3};\n        val = wasm_v128_load(v);\n    }\n\n    float get0() const\n    {\n        return wasm_f32x4_extract_lane(val, 0);\n    }\n\n    v128_t val;\n};\n\nstruct v_uint64x2\n{\n    typedef uint64 lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 2 };\n\n    v_uint64x2() {}\n    explicit v_uint64x2(v128_t v) : val(v) {}\n    v_uint64x2(uint64 v0, uint64 v1)\n    {\n        uint64 v[] = {v0, v1};\n        val = wasm_v128_load(v);\n    }\n\n    uint64 get0() const\n    {\n        return (uint64)wasm_i64x2_extract_lane(val, 0);\n    }\n\n    v128_t val;\n};\n\nstruct v_int64x2\n{\n    typedef int64 lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 2 };\n\n    v_int64x2() {}\n    explicit v_int64x2(v128_t v) : val(v) {}\n    v_int64x2(int64 v0, int64 v1)\n    {\n        int64 v[] = {v0, v1};\n        val = wasm_v128_load(v);\n    }\n\n    int64 get0() const\n    {\n        return wasm_i64x2_extract_lane(val, 0);\n    }\n\n    v128_t val;\n};\n\nstruct v_float64x2\n{\n    typedef double lane_type;\n    typedef v128_t vector_type;\n    enum { nlanes = 2 };\n\n    v_float64x2() {}\n    explicit v_float64x2(v128_t v) : val(v) {}\n    v_float64x2(double v0, double v1)\n    {\n        double v[] = {v0, v1};\n        val = wasm_v128_load(v);\n    }\n\n    double get0() const\n    {\n        return wasm_f64x2_extract_lane(val, 0);\n    }\n\n    v128_t val;\n};\n\nnamespace\n{\n#define OPENCV_HAL_IMPL_REINTERPRET_INT(ft, tt) \\\ninline tt reinterpret_int(ft x) { union { ft l; tt i; } v; v.l = x; return v.i; }\nOPENCV_HAL_IMPL_REINTERPRET_INT(uchar, schar)\nOPENCV_HAL_IMPL_REINTERPRET_INT(schar, schar)\nOPENCV_HAL_IMPL_REINTERPRET_INT(ushort, short)\nOPENCV_HAL_IMPL_REINTERPRET_INT(short, short)\nOPENCV_HAL_IMPL_REINTERPRET_INT(unsigned, int)\nOPENCV_HAL_IMPL_REINTERPRET_INT(int, int)\nOPENCV_HAL_IMPL_REINTERPRET_INT(float, int)\nOPENCV_HAL_IMPL_REINTERPRET_INT(uint64, int64)\nOPENCV_HAL_IMPL_REINTERPRET_INT(int64, int64)\nOPENCV_HAL_IMPL_REINTERPRET_INT(double, int64)\n\nstatic const unsigned char popCountTable[] =\n{\n    0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n    4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8,\n};\n}  // namespace\n\nstatic v128_t wasm_unpacklo_i8x16(v128_t a, v128_t b) {\n    return wasm_v8x16_shuffle(a, b, 0,16,1,17,2,18,3,19,4,20,5,21,6,22,7,23);\n}\n\nstatic v128_t wasm_unpacklo_i16x8(v128_t a, v128_t b) {\n    return wasm_v8x16_shuffle(a, b, 0,1,16,17,2,3,18,19,4,5,20,21,6,7,22,23);\n}\n\nstatic v128_t wasm_unpacklo_i32x4(v128_t a, v128_t b) {\n    return wasm_v8x16_shuffle(a, b, 0,1,2,3,16,17,18,19,4,5,6,7,20,21,22,23);\n}\n\nstatic v128_t wasm_unpacklo_i64x2(v128_t a, v128_t b) {\n    return wasm_v8x16_shuffle(a, b, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23);\n}\n\nstatic v128_t wasm_unpackhi_i8x16(v128_t a, v128_t b) {\n    return wasm_v8x16_shuffle(a, b, 8,24,9,25,10,26,11,27,12,28,13,29,14,30,15,31);\n}\n\nstatic v128_t wasm_unpackhi_i16x8(v128_t a, v128_t b) {\n    return wasm_v8x16_shuffle(a, b, 8,9,24,25,10,11,26,27,12,13,28,29,14,15,30,31);\n}\n\nstatic v128_t wasm_unpackhi_i32x4(v128_t a, v128_t b) {\n    return wasm_v8x16_shuffle(a, b, 8,9,10,11,24,25,26,27,12,13,14,15,28,29,30,31);\n}\n\nstatic v128_t wasm_unpackhi_i64x2(v128_t a, v128_t b) {\n    return wasm_v8x16_shuffle(a, b, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31);\n}\n\n/** Convert **/\n// 8 >> 16\ninline v128_t v128_cvtu8x16_i16x8(const v128_t& a)\n{\n    const v128_t z = wasm_i8x16_splat(0);\n    return wasm_unpacklo_i8x16(a, z);\n}\ninline v128_t v128_cvti8x16_i16x8(const v128_t& a)\n{ return wasm_i16x8_shr(wasm_unpacklo_i8x16(a, a), 8); }\n// 8 >> 32\ninline v128_t v128_cvtu8x16_i32x4(const v128_t& a)\n{\n    const v128_t z = wasm_i8x16_splat(0);\n    return wasm_unpacklo_i16x8(wasm_unpacklo_i8x16(a, z), z);\n}\ninline v128_t v128_cvti8x16_i32x4(const v128_t& a)\n{\n    v128_t r = wasm_unpacklo_i8x16(a, a);\n    r = wasm_unpacklo_i8x16(r, r);\n    return wasm_i32x4_shr(r, 24);\n}\n// 16 >> 32\ninline v128_t v128_cvtu16x8_i32x4(const v128_t& a)\n{\n    const v128_t z = wasm_i8x16_splat(0);\n    return wasm_unpacklo_i16x8(a, z);\n}\ninline v128_t v128_cvti16x8_i32x4(const v128_t& a)\n{ return wasm_i32x4_shr(wasm_unpacklo_i16x8(a, a), 16); }\n// 32 >> 64\ninline v128_t v128_cvtu32x4_i64x2(const v128_t& a)\n{\n    const v128_t z = wasm_i8x16_splat(0);\n    return wasm_unpacklo_i32x4(a, z);\n}\ninline v128_t v128_cvti32x4_i64x2(const v128_t& a)\n{ return wasm_unpacklo_i32x4(a, wasm_i32x4_shr(a, 31)); }\n\n// 16 << 8\ninline v128_t v128_cvtu8x16_i16x8_high(const v128_t& a)\n{\n    const v128_t z = wasm_i8x16_splat(0);\n    return wasm_unpackhi_i8x16(a, z);\n}\ninline v128_t v128_cvti8x16_i16x8_high(const v128_t& a)\n{ return wasm_i16x8_shr(wasm_unpackhi_i8x16(a, a), 8); }\n// 32 << 16\ninline v128_t v128_cvtu16x8_i32x4_high(const v128_t& a)\n{\n    const v128_t z = wasm_i8x16_splat(0);\n    return wasm_unpackhi_i16x8(a, z);\n}\ninline v128_t v128_cvti16x8_i32x4_high(const v128_t& a)\n{ return wasm_i32x4_shr(wasm_unpackhi_i16x8(a, a), 16); }\n// 64 << 32\ninline v128_t v128_cvtu32x4_i64x2_high(const v128_t& a)\n{\n    const v128_t z = wasm_i8x16_splat(0);\n    return wasm_unpackhi_i32x4(a, z);\n}\ninline v128_t v128_cvti32x4_i64x2_high(const v128_t& a)\n{ return wasm_unpackhi_i32x4(a, wasm_i32x4_shr(a, 31)); }\n\n#define OPENCV_HAL_IMPL_WASM_INITVEC(_Tpvec, _Tp, suffix, zsuffix, _Tps) \\\ninline _Tpvec v_setzero_##suffix() { return _Tpvec(wasm_##zsuffix##_splat((_Tps)0)); } \\\ninline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(wasm_##zsuffix##_splat((_Tps)v)); } \\\ntemplate<typename _Tpvec0> inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0& a) \\\n{ return _Tpvec(a.val); }\n\nOPENCV_HAL_IMPL_WASM_INITVEC(v_uint8x16, uchar, u8, i8x16, schar)\nOPENCV_HAL_IMPL_WASM_INITVEC(v_int8x16, schar, s8, i8x16, schar)\nOPENCV_HAL_IMPL_WASM_INITVEC(v_uint16x8, ushort, u16, i16x8, short)\nOPENCV_HAL_IMPL_WASM_INITVEC(v_int16x8, short, s16, i16x8, short)\nOPENCV_HAL_IMPL_WASM_INITVEC(v_uint32x4, unsigned, u32, i32x4, int)\nOPENCV_HAL_IMPL_WASM_INITVEC(v_int32x4, int, s32, i32x4, int)\nOPENCV_HAL_IMPL_WASM_INITVEC(v_float32x4, float, f32, f32x4, float)\nOPENCV_HAL_IMPL_WASM_INITVEC(v_uint64x2, uint64, u64, i64x2, int64)\nOPENCV_HAL_IMPL_WASM_INITVEC(v_int64x2, int64, s64, i64x2, int64)\nOPENCV_HAL_IMPL_WASM_INITVEC(v_float64x2, double, f64, f64x2, double)\n\n//////////////// PACK ///////////////\ninline v_uint8x16 v_pack(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v128_t maxval = wasm_i16x8_splat(255);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u16x8_gt(a.val, maxval));\n    v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_u16x8_gt(b.val, maxval));\n    return v_uint8x16(wasm_v8x16_shuffle(a1, b1, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30));\n}\ninline v_int8x16 v_pack(const v_int16x8& a, const v_int16x8& b)\n{\n    v128_t maxval = wasm_i16x8_splat(127);\n    v128_t minval = wasm_i16x8_splat(-128);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i16x8_gt(a.val, maxval));\n    v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_i16x8_gt(b.val, maxval));\n    v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i16x8_lt(a1, minval));\n    v128_t b2 = wasm_v128_bitselect(minval, b1, wasm_i16x8_lt(b1, minval));\n    return v_int8x16(wasm_v8x16_shuffle(a2, b2, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30));\n}\ninline v_uint16x8 v_pack(const v_uint32x4& a, const v_uint32x4& b)\n{\n    v128_t maxval = wasm_i32x4_splat(65535);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u32x4_gt(a.val, maxval));\n    v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_u32x4_gt(b.val, maxval));\n    return v_uint16x8(wasm_v8x16_shuffle(a1, b1, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29));\n}\ninline v_int16x8 v_pack(const v_int32x4& a, const v_int32x4& b)\n{\n    v128_t maxval = wasm_i32x4_splat(32767);\n    v128_t minval = wasm_i32x4_splat(-32768);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i32x4_gt(a.val, maxval));\n    v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_i32x4_gt(b.val, maxval));\n    v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i32x4_lt(a1, minval));\n    v128_t b2 = wasm_v128_bitselect(minval, b1, wasm_i32x4_lt(b1, minval));\n    return v_int16x8(wasm_v8x16_shuffle(a2, b2, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29));\n}\ninline v_uint32x4 v_pack(const v_uint64x2& a, const v_uint64x2& b)\n{\n    return v_uint32x4(wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27));\n}\ninline v_int32x4 v_pack(const v_int64x2& a, const v_int64x2& b)\n{\n    return v_int32x4(wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27));\n}\ninline v_uint8x16 v_pack_u(const v_int16x8& a, const v_int16x8& b)\n{\n    v128_t maxval = wasm_i16x8_splat(255);\n    v128_t minval = wasm_i16x8_splat(0);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i16x8_gt(a.val, maxval));\n    v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_i16x8_gt(b.val, maxval));\n    v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i16x8_lt(a1, minval));\n    v128_t b2 = wasm_v128_bitselect(minval, b1, wasm_i16x8_lt(b1, minval));\n    return v_uint8x16(wasm_v8x16_shuffle(a2, b2, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30));\n}\ninline v_uint16x8 v_pack_u(const v_int32x4& a, const v_int32x4& b)\n{\n    v128_t maxval = wasm_i32x4_splat(65535);\n    v128_t minval = wasm_i32x4_splat(0);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i32x4_gt(a.val, maxval));\n    v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_i32x4_gt(b.val, maxval));\n    v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i32x4_lt(a1, minval));\n    v128_t b2 = wasm_v128_bitselect(minval, b1, wasm_i32x4_lt(b1, minval));\n    return v_uint16x8(wasm_v8x16_shuffle(a2, b2, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29));\n}\n\ntemplate<int n>\ninline v_uint8x16 v_rshr_pack(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v128_t delta = wasm_i16x8_splat(((short)1 << (n-1)));\n    v128_t a1 = wasm_u16x8_shr(wasm_i16x8_add(a.val, delta), n);\n    v128_t b1 = wasm_u16x8_shr(wasm_i16x8_add(b.val, delta), n);\n    v128_t maxval = wasm_i16x8_splat(255);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_u16x8_gt(a1, maxval));\n    v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_u16x8_gt(b1, maxval));\n    return v_uint8x16(wasm_v8x16_shuffle(a2, b2, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30));\n}\ntemplate<int n>\ninline v_int8x16 v_rshr_pack(const v_int16x8& a, const v_int16x8& b)\n{\n    v128_t delta = wasm_i16x8_splat(((short)1 << (n-1)));\n    v128_t a1 = wasm_i16x8_shr(wasm_i16x8_add(a.val, delta), n);\n    v128_t b1 = wasm_i16x8_shr(wasm_i16x8_add(b.val, delta), n);\n    v128_t maxval = wasm_i16x8_splat(127);\n    v128_t minval = wasm_i16x8_splat(-128);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i16x8_gt(a1, maxval));\n    v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_i16x8_gt(b1, maxval));\n    v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i16x8_lt(a1, minval));\n    v128_t b3 = wasm_v128_bitselect(minval, b2, wasm_i16x8_lt(b1, minval));\n    return v_int8x16(wasm_v8x16_shuffle(a3, b3, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30));\n}\ntemplate<int n>\ninline v_uint16x8 v_rshr_pack(const v_uint32x4& a, const v_uint32x4& b)\n{\n    v128_t delta = wasm_i32x4_splat(((int)1 << (n-1)));\n    v128_t a1 = wasm_u32x4_shr(wasm_i32x4_add(a.val, delta), n);\n    v128_t b1 = wasm_u32x4_shr(wasm_i32x4_add(b.val, delta), n);\n    v128_t maxval = wasm_i32x4_splat(65535);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_u32x4_gt(a1, maxval));\n    v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_u32x4_gt(b1, maxval));\n    return v_uint16x8(wasm_v8x16_shuffle(a2, b2, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29));\n}\ntemplate<int n>\ninline v_int16x8 v_rshr_pack(const v_int32x4& a, const v_int32x4& b)\n{\n    v128_t delta = wasm_i32x4_splat(((int)1 << (n-1)));\n    v128_t a1 = wasm_i32x4_shr(wasm_i32x4_add(a.val, delta), n);\n    v128_t b1 = wasm_i32x4_shr(wasm_i32x4_add(b.val, delta), n);\n    v128_t maxval = wasm_i32x4_splat(32767);\n    v128_t minval = wasm_i16x8_splat(-32768);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i32x4_gt(a1, maxval));\n    v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_i32x4_gt(b1, maxval));\n    v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i32x4_lt(a1, minval));\n    v128_t b3 = wasm_v128_bitselect(minval, b2, wasm_i32x4_lt(b1, minval));\n    return v_int16x8(wasm_v8x16_shuffle(a3, b3, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29));\n}\ntemplate<int n>\ninline v_uint32x4 v_rshr_pack(const v_uint64x2& a, const v_uint64x2& b)\n{\n    v128_t delta = wasm_i64x2_splat(((int64)1 << (n-1)));\n    v128_t a1 = wasm_u64x2_shr(wasm_i64x2_add(a.val, delta), n);\n    v128_t b1 = wasm_u64x2_shr(wasm_i64x2_add(b.val, delta), n);\n    return v_uint32x4(wasm_v8x16_shuffle(a1, b1, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27));\n}\ntemplate<int n>\ninline v_int32x4 v_rshr_pack(const v_int64x2& a, const v_int64x2& b)\n{\n    v128_t delta = wasm_i64x2_splat(((int64)1 << (n-1)));\n    v128_t a1 = wasm_i64x2_shr(wasm_i64x2_add(a.val, delta), n);\n    v128_t b1 = wasm_i64x2_shr(wasm_i64x2_add(b.val, delta), n);\n    return v_int32x4(wasm_v8x16_shuffle(a1, b1, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27));\n}\ntemplate<int n>\ninline v_uint8x16 v_rshr_pack_u(const v_int16x8& a, const v_int16x8& b)\n{\n    v128_t delta = wasm_i16x8_splat(((short)1 << (n-1)));\n    v128_t a1 = wasm_i16x8_shr(wasm_i16x8_add(a.val, delta), n);\n    v128_t b1 = wasm_i16x8_shr(wasm_i16x8_add(b.val, delta), n);\n    v128_t maxval = wasm_i16x8_splat(255);\n    v128_t minval = wasm_i16x8_splat(0);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i16x8_gt(a1, maxval));\n    v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_i16x8_gt(b1, maxval));\n    v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i16x8_lt(a1, minval));\n    v128_t b3 = wasm_v128_bitselect(minval, b2, wasm_i16x8_lt(b1, minval));\n    return v_uint8x16(wasm_v8x16_shuffle(a3, b3, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30));\n}\ntemplate<int n>\ninline v_uint16x8 v_rshr_pack_u(const v_int32x4& a, const v_int32x4& b)\n{\n    v128_t delta = wasm_i32x4_splat(((int)1 << (n-1)));\n    v128_t a1 = wasm_i32x4_shr(wasm_i32x4_add(a.val, delta), n);\n    v128_t b1 = wasm_i32x4_shr(wasm_i32x4_add(b.val, delta), n);\n    v128_t maxval = wasm_i32x4_splat(65535);\n    v128_t minval = wasm_i16x8_splat(0);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i32x4_gt(a1, maxval));\n    v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_i32x4_gt(b1, maxval));\n    v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i32x4_lt(a1, minval));\n    v128_t b3 = wasm_v128_bitselect(minval, b2, wasm_i32x4_lt(b1, minval));\n    return v_uint16x8(wasm_v8x16_shuffle(a3, b3, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29));\n}\n\ninline void v_pack_store(uchar* ptr, const v_uint16x8& a)\n{\n    v128_t maxval = wasm_i16x8_splat(255);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u16x8_gt(a.val, maxval));\n    v128_t r = wasm_v8x16_shuffle(a1, a1, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14);\n    uchar t_ptr[16];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<8; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ninline void v_pack_store(schar* ptr, const v_int16x8& a)\n{\n    v128_t maxval = wasm_i16x8_splat(127);\n    v128_t minval = wasm_i16x8_splat(-128);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i16x8_gt(a.val, maxval));\n    v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i16x8_lt(a1, minval));\n    v128_t r = wasm_v8x16_shuffle(a2, a2, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14);\n    schar t_ptr[16];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<8; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ninline void v_pack_store(ushort* ptr, const v_uint32x4& a)\n{\n    v128_t maxval = wasm_i32x4_splat(65535);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u32x4_gt(a.val, maxval));\n    v128_t r = wasm_v8x16_shuffle(a1, a1, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13);\n    ushort t_ptr[8];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<4; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ninline void v_pack_store(short* ptr, const v_int32x4& a)\n{\n    v128_t maxval = wasm_i32x4_splat(32767);\n    v128_t minval = wasm_i32x4_splat(-32768);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i32x4_gt(a.val, maxval));\n    v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i32x4_lt(a1, minval));\n    v128_t r = wasm_v8x16_shuffle(a2, a2, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13);\n    short t_ptr[8];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<4; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ninline void v_pack_store(unsigned* ptr, const v_uint64x2& a)\n{\n    v128_t r = wasm_v8x16_shuffle(a.val, a.val, 0,1,2,3,8,9,10,11,0,1,2,3,8,9,10,11);\n    unsigned t_ptr[4];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<2; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ninline void v_pack_store(int* ptr, const v_int64x2& a)\n{\n    v128_t r = wasm_v8x16_shuffle(a.val, a.val, 0,1,2,3,8,9,10,11,0,1,2,3,8,9,10,11);\n    int t_ptr[4];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<2; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ninline void v_pack_u_store(uchar* ptr, const v_int16x8& a)\n{\n    v128_t maxval = wasm_i16x8_splat(255);\n    v128_t minval = wasm_i16x8_splat(0);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i16x8_gt(a.val, maxval));\n    v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i16x8_lt(a1, minval));\n    v128_t r = wasm_v8x16_shuffle(a2, a2, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14);\n    uchar t_ptr[16];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<8; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ninline void v_pack_u_store(ushort* ptr, const v_int32x4& a)\n{\n    v128_t maxval = wasm_i32x4_splat(65535);\n    v128_t minval = wasm_i32x4_splat(0);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i32x4_gt(a.val, maxval));\n    v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i32x4_lt(a1, minval));\n    v128_t r = wasm_v8x16_shuffle(a2, a2, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13);\n    ushort t_ptr[8];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<4; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\n\ntemplate<int n>\ninline void v_rshr_pack_store(uchar* ptr, const v_uint16x8& a)\n{\n    v128_t delta = wasm_i16x8_splat((short)(1 << (n-1)));\n    v128_t a1 = wasm_u16x8_shr(wasm_i16x8_add(a.val, delta), n);\n    v128_t maxval = wasm_i16x8_splat(255);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_u16x8_gt(a1, maxval));\n    v128_t r = wasm_v8x16_shuffle(a2, a2, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14);\n    uchar t_ptr[16];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<8; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ntemplate<int n>\ninline void v_rshr_pack_store(schar* ptr, const v_int16x8& a)\n{\n    v128_t delta = wasm_i16x8_splat(((short)1 << (n-1)));\n    v128_t a1 = wasm_i16x8_shr(wasm_i16x8_add(a.val, delta), n);\n    v128_t maxval = wasm_i16x8_splat(127);\n    v128_t minval = wasm_i16x8_splat(-128);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i16x8_gt(a1, maxval));\n    v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i16x8_lt(a1, minval));\n    v128_t r = wasm_v8x16_shuffle(a3, a3, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14);\n    schar t_ptr[16];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<8; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ntemplate<int n>\ninline void v_rshr_pack_store(ushort* ptr, const v_uint32x4& a)\n{\n    v128_t delta = wasm_i32x4_splat(((int)1 << (n-1)));\n    v128_t a1 = wasm_u32x4_shr(wasm_i32x4_add(a.val, delta), n);\n    v128_t maxval = wasm_i32x4_splat(65535);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_u32x4_gt(a1, maxval));\n    v128_t r = wasm_v8x16_shuffle(a2, a2, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13);\n    ushort t_ptr[8];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<4; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ntemplate<int n>\ninline void v_rshr_pack_store(short* ptr, const v_int32x4& a)\n{\n    v128_t delta = wasm_i32x4_splat(((int)1 << (n-1)));\n    v128_t a1 = wasm_i32x4_shr(wasm_i32x4_add(a.val, delta), n);\n    v128_t maxval = wasm_i32x4_splat(32767);\n    v128_t minval = wasm_i32x4_splat(-32768);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i32x4_gt(a1, maxval));\n    v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i32x4_lt(a1, minval));\n    v128_t r = wasm_v8x16_shuffle(a3, a3, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13);\n    short t_ptr[8];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<4; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ntemplate<int n>\ninline void v_rshr_pack_store(unsigned* ptr, const v_uint64x2& a)\n{\n    v128_t delta = wasm_i64x2_splat(((int64)1 << (n-1)));\n    v128_t a1 = wasm_u64x2_shr(wasm_i64x2_add(a.val, delta), n);\n    v128_t r = wasm_v8x16_shuffle(a1, a1, 0,1,2,3,8,9,10,11,0,1,2,3,8,9,10,11);\n    unsigned t_ptr[4];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<2; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ntemplate<int n>\ninline void v_rshr_pack_store(int* ptr, const v_int64x2& a)\n{\n    v128_t delta = wasm_i64x2_splat(((int64)1 << (n-1)));\n    v128_t a1 = wasm_i64x2_shr(wasm_i64x2_add(a.val, delta), n);\n    v128_t r = wasm_v8x16_shuffle(a1, a1, 0,1,2,3,8,9,10,11,0,1,2,3,8,9,10,11);\n    int t_ptr[4];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<2; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ntemplate<int n>\ninline void v_rshr_pack_u_store(uchar* ptr, const v_int16x8& a)\n{\n    v128_t delta = wasm_i16x8_splat(((short)1 << (n-1)));\n    v128_t a1 = wasm_i16x8_shr(wasm_i16x8_add(a.val, delta), n);\n    v128_t maxval = wasm_i16x8_splat(255);\n    v128_t minval = wasm_i16x8_splat(0);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i16x8_gt(a1, maxval));\n    v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i16x8_lt(a1, minval));\n    v128_t r = wasm_v8x16_shuffle(a3, a3, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14);\n    uchar t_ptr[16];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<8; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\ntemplate<int n>\ninline void v_rshr_pack_u_store(ushort* ptr, const v_int32x4& a)\n{\n    v128_t delta = wasm_i32x4_splat(((int)1 << (n-1)));\n    v128_t a1 = wasm_i32x4_shr(wasm_i32x4_add(a.val, delta), n);\n    v128_t maxval = wasm_i32x4_splat(65535);\n    v128_t minval = wasm_i32x4_splat(0);\n    v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i32x4_gt(a1, maxval));\n    v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i32x4_lt(a1, minval));\n    v128_t r = wasm_v8x16_shuffle(a3, a3, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13);\n    ushort t_ptr[8];\n    wasm_v128_store(t_ptr, r);\n    for (int i=0; i<4; ++i) {\n        ptr[i] = t_ptr[i];\n    }\n}\n\ninline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v128_t maxval = wasm_i16x8_splat(255);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u16x8_gt(a.val, maxval));\n    v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_u16x8_gt(b.val, maxval));\n    return v_uint8x16(wasm_v8x16_shuffle(a1, b1, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b,\n                           const v_uint32x4& c, const v_uint32x4& d)\n{\n    v128_t maxval = wasm_i32x4_splat(255);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u32x4_gt(a.val, maxval));\n    v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_u32x4_gt(b.val, maxval));\n    v128_t c1 = wasm_v128_bitselect(maxval, c.val, wasm_u32x4_gt(c.val, maxval));\n    v128_t d1 = wasm_v128_bitselect(maxval, d.val, wasm_u32x4_gt(d.val, maxval));\n    v128_t ab = wasm_v8x16_shuffle(a1, b1, 0,4,8,12,16,20,24,28,0,4,8,12,16,20,24,28);\n    v128_t cd = wasm_v8x16_shuffle(c1, d1, 0,4,8,12,16,20,24,28,0,4,8,12,16,20,24,28);\n    return v_uint8x16(wasm_v8x16_shuffle(ab, cd, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23));\n}\n\ninline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c,\n                           const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f,\n                           const v_uint64x2& g, const v_uint64x2& h)\n{\n    v128_t maxval = wasm_i32x4_splat(255);\n    v128_t a1 = wasm_v128_bitselect(maxval, a.val, ((__u64x2)(a.val) > (__u64x2)maxval));\n    v128_t b1 = wasm_v128_bitselect(maxval, b.val, ((__u64x2)(b.val) > (__u64x2)maxval));\n    v128_t c1 = wasm_v128_bitselect(maxval, c.val, ((__u64x2)(c.val) > (__u64x2)maxval));\n    v128_t d1 = wasm_v128_bitselect(maxval, d.val, ((__u64x2)(d.val) > (__u64x2)maxval));\n    v128_t e1 = wasm_v128_bitselect(maxval, e.val, ((__u64x2)(e.val) > (__u64x2)maxval));\n    v128_t f1 = wasm_v128_bitselect(maxval, f.val, ((__u64x2)(f.val) > (__u64x2)maxval));\n    v128_t g1 = wasm_v128_bitselect(maxval, g.val, ((__u64x2)(g.val) > (__u64x2)maxval));\n    v128_t h1 = wasm_v128_bitselect(maxval, h.val, ((__u64x2)(h.val) > (__u64x2)maxval));\n    v128_t ab = wasm_v8x16_shuffle(a1, b1, 0,8,16,24,0,8,16,24,0,8,16,24,0,8,16,24);\n    v128_t cd = wasm_v8x16_shuffle(c1, d1, 0,8,16,24,0,8,16,24,0,8,16,24,0,8,16,24);\n    v128_t ef = wasm_v8x16_shuffle(e1, f1, 0,8,16,24,0,8,16,24,0,8,16,24,0,8,16,24);\n    v128_t gh = wasm_v8x16_shuffle(g1, h1, 0,8,16,24,0,8,16,24,0,8,16,24,0,8,16,24);\n    v128_t abcd = wasm_v8x16_shuffle(ab, cd, 0,1,2,3,16,17,18,19,0,1,2,3,16,17,18,19);\n    v128_t efgh = wasm_v8x16_shuffle(ef, gh, 0,1,2,3,16,17,18,19,0,1,2,3,16,17,18,19);\n    return v_uint8x16(wasm_v8x16_shuffle(abcd, efgh, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23));\n}\n\ninline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0,\n                            const v_float32x4& m1, const v_float32x4& m2,\n                            const v_float32x4& m3)\n{\n    v128_t v0 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 0));\n    v128_t v1 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 1));\n    v128_t v2 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 2));\n    v128_t v3 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 3));\n    v0 = wasm_f32x4_mul(v0, m0.val);\n    v1 = wasm_f32x4_mul(v1, m1.val);\n    v2 = wasm_f32x4_mul(v2, m2.val);\n    v3 = wasm_f32x4_mul(v3, m3.val);\n\n    return v_float32x4(wasm_f32x4_add(wasm_f32x4_add(v0, v1), wasm_f32x4_add(v2, v3)));\n}\n\ninline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0,\n                               const v_float32x4& m1, const v_float32x4& m2,\n                               const v_float32x4& a)\n{\n    v128_t v0 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 0));\n    v128_t v1 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 1));\n    v128_t v2 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 2));\n    v0 = wasm_f32x4_mul(v0, m0.val);\n    v1 = wasm_f32x4_mul(v1, m1.val);\n    v2 = wasm_f32x4_mul(v2, m2.val);\n\n    return v_float32x4(wasm_f32x4_add(wasm_f32x4_add(v0, v1), wasm_f32x4_add(v2, a.val)));\n}\n\n#define OPENCV_HAL_IMPL_WASM_BIN_OP(bin_op, _Tpvec, intrin) \\\ninline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val)); \\\n} \\\ninline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \\\n{ \\\n    a.val = intrin(a.val, b.val); \\\n    return a; \\\n}\n\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_uint8x16, wasm_u8x16_add_saturate)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_uint8x16, wasm_u8x16_sub_saturate)\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_int8x16, wasm_i8x16_add_saturate)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_int8x16, wasm_i8x16_sub_saturate)\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_uint16x8, wasm_u16x8_add_saturate)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_uint16x8, wasm_u16x8_sub_saturate)\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_int16x8, wasm_i16x8_add_saturate)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_int16x8, wasm_i16x8_sub_saturate)\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_uint32x4, wasm_i32x4_add)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_uint32x4, wasm_i32x4_sub)\nOPENCV_HAL_IMPL_WASM_BIN_OP(*, v_uint32x4, wasm_i32x4_mul)\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_int32x4, wasm_i32x4_add)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_int32x4, wasm_i32x4_sub)\nOPENCV_HAL_IMPL_WASM_BIN_OP(*, v_int32x4, wasm_i32x4_mul)\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_float32x4, wasm_f32x4_add)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_float32x4, wasm_f32x4_sub)\nOPENCV_HAL_IMPL_WASM_BIN_OP(*, v_float32x4, wasm_f32x4_mul)\nOPENCV_HAL_IMPL_WASM_BIN_OP(/, v_float32x4, wasm_f32x4_div)\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_uint64x2, wasm_i64x2_add)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_uint64x2, wasm_i64x2_sub)\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_int64x2, wasm_i64x2_add)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_int64x2, wasm_i64x2_sub)\nOPENCV_HAL_IMPL_WASM_BIN_OP(+, v_float64x2, wasm_f64x2_add)\nOPENCV_HAL_IMPL_WASM_BIN_OP(-, v_float64x2, wasm_f64x2_sub)\nOPENCV_HAL_IMPL_WASM_BIN_OP(*, v_float64x2, wasm_f64x2_mul)\nOPENCV_HAL_IMPL_WASM_BIN_OP(/, v_float64x2, wasm_f64x2_div)\n\n// saturating multiply 8-bit, 16-bit\n#define OPENCV_HAL_IMPL_WASM_MUL_SAT(_Tpvec, _Tpwvec)        \\\ninline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b)  \\\n{                                                            \\\n    _Tpwvec c, d;                                            \\\n    v_mul_expand(a, b, c, d);                                \\\n    return v_pack(c, d);                                     \\\n}                                                            \\\ninline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b)      \\\n{ a = a * b; return a; }\n\nOPENCV_HAL_IMPL_WASM_MUL_SAT(v_uint8x16, v_uint16x8)\nOPENCV_HAL_IMPL_WASM_MUL_SAT(v_int8x16,  v_int16x8)\nOPENCV_HAL_IMPL_WASM_MUL_SAT(v_uint16x8, v_uint32x4)\nOPENCV_HAL_IMPL_WASM_MUL_SAT(v_int16x8,  v_int32x4)\n\n//  Multiply and expand\ninline void v_mul_expand(const v_uint8x16& a, const v_uint8x16& b,\n                         v_uint16x8& c, v_uint16x8& d)\n{\n    v_uint16x8 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c = v_mul_wrap(a0, b0);\n    d = v_mul_wrap(a1, b1);\n}\n\ninline void v_mul_expand(const v_int8x16& a, const v_int8x16& b,\n                         v_int16x8& c, v_int16x8& d)\n{\n    v_int16x8 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c = v_mul_wrap(a0, b0);\n    d = v_mul_wrap(a1, b1);\n}\n\ninline void v_mul_expand(const v_int16x8& a, const v_int16x8& b,\n                         v_int32x4& c, v_int32x4& d)\n{\n    v_int32x4 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c.val = wasm_i32x4_mul(a0.val, b0.val);\n    d.val = wasm_i32x4_mul(a1.val, b1.val);\n}\n\ninline void v_mul_expand(const v_uint16x8& a, const v_uint16x8& b,\n                         v_uint32x4& c, v_uint32x4& d)\n{\n    v_uint32x4 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c.val = wasm_i32x4_mul(a0.val, b0.val);\n    d.val = wasm_i32x4_mul(a1.val, b1.val);\n}\n\ninline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b,\n                         v_uint64x2& c, v_uint64x2& d)\n{\n    v_uint64x2 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    c.val = ((__u64x2)(a0.val) * (__u64x2)(b0.val));\n    d.val = ((__u64x2)(a1.val) * (__u64x2)(b1.val));\n}\n\ninline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b)\n{\n    v_int32x4 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    v128_t c = wasm_i32x4_mul(a0.val, b0.val);\n    v128_t d = wasm_i32x4_mul(a1.val, b1.val);\n    return v_int16x8(wasm_v8x16_shuffle(c, d, 2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31));\n}\ninline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v_uint32x4 a0, a1, b0, b1;\n    v_expand(a, a0, a1);\n    v_expand(b, b0, b1);\n    v128_t c = wasm_i32x4_mul(a0.val, b0.val);\n    v128_t d = wasm_i32x4_mul(a1.val, b1.val);\n    return v_uint16x8(wasm_v8x16_shuffle(c, d, 2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31));\n}\n\n//////// Dot Product ////////\n\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b)\n{\n    v128_t a0 = wasm_i32x4_shr(wasm_i32x4_shl(a.val, 16), 16);\n    v128_t a1 = wasm_i32x4_shr(a.val, 16);\n    v128_t b0 = wasm_i32x4_shr(wasm_i32x4_shl(b.val, 16), 16);\n    v128_t b1 = wasm_i32x4_shr(b.val, 16);\n    v128_t c = wasm_i32x4_mul(a0, b0);\n    v128_t d = wasm_i32x4_mul(a1, b1);\n    return v_int32x4(wasm_i32x4_add(c, d));\n}\n\ninline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{ return v_dotprod(a, b) + c; }\n\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b)\n{\n    v128_t a0 = wasm_i64x2_shr(wasm_i64x2_shl(a.val, 32), 32);\n    v128_t a1 = wasm_i64x2_shr(a.val, 32);\n    v128_t b0 = wasm_i64x2_shr(wasm_i64x2_shl(b.val, 32), 32);\n    v128_t b1 = wasm_i64x2_shr(b.val, 32);\n    v128_t c = (v128_t)((__i64x2)a0 * (__i64x2)b0);\n    v128_t d = (v128_t)((__i64x2)a1 * (__i64x2)b1);\n    return v_int64x2(wasm_i64x2_add(c, d));\n}\ninline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{\n    return v_dotprod(a, b) + c;\n}\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b)\n{\n    v128_t a0 = wasm_u16x8_shr(wasm_i16x8_shl(a.val, 8), 8);\n    v128_t a1 = wasm_u16x8_shr(a.val, 8);\n    v128_t b0 = wasm_u16x8_shr(wasm_i16x8_shl(b.val, 8), 8);\n    v128_t b1 = wasm_u16x8_shr(b.val, 8);\n    return v_uint32x4((\n        v_dotprod(v_int16x8(a0), v_int16x8(b0)) +\n        v_dotprod(v_int16x8(a1), v_int16x8(b1))).val\n    );\n}\ninline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b)\n{\n    v128_t a0 = wasm_i16x8_shr(wasm_i16x8_shl(a.val, 8), 8);\n    v128_t a1 = wasm_i16x8_shr(a.val, 8);\n    v128_t b0 = wasm_i16x8_shr(wasm_i16x8_shl(b.val, 8), 8);\n    v128_t b1 = wasm_i16x8_shr(b.val, 8);\n    return v_int32x4(\n        v_dotprod(v_int16x8(a0), v_int16x8(b0)) +\n        v_dotprod(v_int16x8(a1), v_int16x8(b1))\n    );\n}\ninline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v128_t a0 = wasm_u32x4_shr(wasm_i32x4_shl(a.val, 16), 16);\n    v128_t a1 = wasm_u32x4_shr(a.val, 16);\n    v128_t b0 = wasm_u32x4_shr(wasm_i32x4_shl(b.val, 16), 16);\n    v128_t b1 = wasm_u32x4_shr(b.val, 16);\n    return v_uint64x2((\n        v_dotprod(v_int32x4(a0), v_int32x4(b0)) +\n        v_dotprod(v_int32x4(a1), v_int32x4(b1))).val\n    );\n}\ninline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b)\n{\n    v128_t a0 = wasm_i32x4_shr(wasm_i32x4_shl(a.val, 16), 16);\n    v128_t a1 = wasm_i32x4_shr(a.val, 16);\n    v128_t b0 = wasm_i32x4_shr(wasm_i32x4_shl(b.val, 16), 16);\n    v128_t b1 = wasm_i32x4_shr(b.val, 16);\n    return v_int64x2((\n        v_dotprod(v_int32x4(a0), v_int32x4(b0)) +\n        v_dotprod(v_int32x4(a1), v_int32x4(b1)))\n    );\n}\n\ninline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n// 32 >> 64f\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b)\n{ return v_cvt_f64(v_dotprod(a, b)); }\ninline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ return v_dotprod_expand(a, b) + c; }\n\n//////// Fast Dot Product ////////\n\n// 16 >> 32\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b)\n{ return v_dotprod(a, b); }\ninline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c)\n{ return v_dotprod(a, b, c); }\n\n// 32 >> 64\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_dotprod(a, b); }\ninline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c)\n{ return v_dotprod(a, b, c); }\n\n// 8 >> 32\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b)\n{ return v_dotprod_expand(a, b); }\ninline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c)\n{ return v_dotprod_expand(a, b, c); }\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b)\n{ return v_dotprod_expand(a, b); }\ninline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c)\n{ return v_dotprod_expand(a, b, c); }\n\n// 16 >> 64\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b)\n{ return v_dotprod_expand(a, b); }\ninline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c)\n{ return v_dotprod_expand(a, b, c); }\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b)\n{ return v_dotprod_expand(a, b); }\ninline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c)\n{ return v_dotprod_expand(a, b, c); }\n\n// 32 >> 64f\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b)\n{ return v_dotprod_expand(a, b); }\ninline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c)\n{ return v_dotprod_expand(a, b, c); }\n\n#define OPENCV_HAL_IMPL_WASM_LOGIC_OP(_Tpvec) \\\nOPENCV_HAL_IMPL_WASM_BIN_OP(&, _Tpvec, wasm_v128_and) \\\nOPENCV_HAL_IMPL_WASM_BIN_OP(|, _Tpvec, wasm_v128_or) \\\nOPENCV_HAL_IMPL_WASM_BIN_OP(^, _Tpvec, wasm_v128_xor) \\\ninline _Tpvec operator ~ (const _Tpvec& a) \\\n{ \\\n    return _Tpvec(wasm_v128_not(a.val)); \\\n}\n\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_uint8x16)\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_int8x16)\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_uint16x8)\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_int16x8)\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_uint32x4)\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_int32x4)\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_uint64x2)\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_int64x2)\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_float32x4)\nOPENCV_HAL_IMPL_WASM_LOGIC_OP(v_float64x2)\n\ninline v_float32x4 v_sqrt(const v_float32x4& x)\n{\n    return v_float32x4(wasm_f32x4_sqrt(x.val));\n}\n\ninline v_float32x4 v_invsqrt(const v_float32x4& x)\n{\n    const v128_t _1_0 = wasm_f32x4_splat(1.0);\n    return v_float32x4(wasm_f32x4_div(_1_0, wasm_f32x4_sqrt(x.val)));\n}\n\ninline v_float64x2 v_sqrt(const v_float64x2& x)\n{\n    return v_float64x2(wasm_f64x2_sqrt(x.val));\n}\n\ninline v_float64x2 v_invsqrt(const v_float64x2& x)\n{\n    const v128_t _1_0 = wasm_f64x2_splat(1.0);\n    return v_float64x2(wasm_f64x2_div(_1_0, wasm_f64x2_sqrt(x.val)));\n}\n\n#define OPENCV_HAL_IMPL_WASM_ABS_INT_FUNC(_Tpuvec, _Tpsvec, suffix, zsuffix, shiftWidth) \\\ninline _Tpuvec v_abs(const _Tpsvec& x) \\\n{ \\\n    v128_t s = wasm_##suffix##_shr(x.val, shiftWidth); \\\n    v128_t f = wasm_##zsuffix##_shr(x.val, shiftWidth); \\\n    return _Tpuvec(wasm_##zsuffix##_add(wasm_v128_xor(x.val, f), s)); \\\n}\n\nOPENCV_HAL_IMPL_WASM_ABS_INT_FUNC(v_uint8x16, v_int8x16, u8x16, i8x16, 7)\nOPENCV_HAL_IMPL_WASM_ABS_INT_FUNC(v_uint16x8, v_int16x8, u16x8, i16x8, 15)\nOPENCV_HAL_IMPL_WASM_ABS_INT_FUNC(v_uint32x4, v_int32x4, u32x4, i32x4, 31)\n\ninline v_float32x4 v_abs(const v_float32x4& x)\n{ return v_float32x4(wasm_f32x4_abs(x.val)); }\ninline v_float64x2 v_abs(const v_float64x2& x)\n{\n    return v_float64x2(wasm_f64x2_abs(x.val));\n}\n\n// TODO: exp, log, sin, cos\n\n#define OPENCV_HAL_IMPL_WASM_BIN_FUNC(_Tpvec, func, intrin) \\\ninline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(intrin(a.val, b.val)); \\\n}\n\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_float32x4, v_min, wasm_f32x4_min)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_float32x4, v_max, wasm_f32x4_max)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_float64x2, v_min, wasm_f64x2_min)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_float64x2, v_max, wasm_f64x2_max)\n\n#define OPENCV_HAL_IMPL_WASM_MINMAX_S_INIT_FUNC(_Tpvec, suffix) \\\ninline _Tpvec v_min(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(wasm_v128_bitselect(b.val, a.val, wasm_##suffix##_gt(a.val, b.val))); \\\n} \\\ninline _Tpvec v_max(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(wasm_v128_bitselect(a.val, b.val, wasm_##suffix##_gt(a.val, b.val))); \\\n}\n\nOPENCV_HAL_IMPL_WASM_MINMAX_S_INIT_FUNC(v_int8x16, i8x16)\nOPENCV_HAL_IMPL_WASM_MINMAX_S_INIT_FUNC(v_int16x8, i16x8)\nOPENCV_HAL_IMPL_WASM_MINMAX_S_INIT_FUNC(v_int32x4, i32x4)\n\n#define OPENCV_HAL_IMPL_WASM_MINMAX_U_INIT_FUNC(_Tpvec, suffix, deltaNum) \\\ninline _Tpvec v_min(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    v128_t delta = wasm_##suffix##_splat(deltaNum); \\\n    v128_t mask = wasm_##suffix##_gt(wasm_v128_xor(a.val, delta), wasm_v128_xor(b.val, delta)); \\\n    return _Tpvec(wasm_v128_bitselect(b.val, a.val, mask)); \\\n} \\\ninline _Tpvec v_max(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    v128_t delta = wasm_##suffix##_splat(deltaNum); \\\n    v128_t mask = wasm_##suffix##_gt(wasm_v128_xor(a.val, delta), wasm_v128_xor(b.val, delta)); \\\n    return _Tpvec(wasm_v128_bitselect(a.val, b.val, mask)); \\\n}\n\nOPENCV_HAL_IMPL_WASM_MINMAX_U_INIT_FUNC(v_uint8x16, i8x16, (schar)0x80)\nOPENCV_HAL_IMPL_WASM_MINMAX_U_INIT_FUNC(v_uint16x8, i16x8, (short)0x8000)\nOPENCV_HAL_IMPL_WASM_MINMAX_U_INIT_FUNC(v_uint32x4, i32x4, (int)0x80000000)\n\n#define OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(_Tpvec, suffix, esuffix) \\\ninline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(wasm_##esuffix##_eq(a.val, b.val)); } \\\ninline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(wasm_##esuffix##_ne(a.val, b.val)); } \\\ninline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(wasm_##suffix##_lt(a.val, b.val)); } \\\ninline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(wasm_##suffix##_gt(a.val, b.val)); } \\\ninline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(wasm_##suffix##_le(a.val, b.val)); } \\\ninline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \\\n{ return _Tpvec(wasm_##suffix##_ge(a.val, b.val)); }\n\nOPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_uint8x16, u8x16, i8x16)\nOPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_int8x16, i8x16, i8x16)\nOPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_uint16x8, u16x8, i16x8)\nOPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_int16x8, i16x8, i16x8)\nOPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_uint32x4, u32x4, i32x4)\nOPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_int32x4, i32x4, i32x4)\nOPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_float32x4, f32x4, f32x4)\nOPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_float64x2, f64x2, f64x2)\n\n#define OPENCV_HAL_IMPL_WASM_64BIT_CMP_OP(_Tpvec, cast) \\\ninline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \\\n{ return cast(v_reinterpret_as_f64(a) == v_reinterpret_as_f64(b)); } \\\ninline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \\\n{ return cast(v_reinterpret_as_f64(a) != v_reinterpret_as_f64(b)); }\n\nOPENCV_HAL_IMPL_WASM_64BIT_CMP_OP(v_uint64x2, v_reinterpret_as_u64)\nOPENCV_HAL_IMPL_WASM_64BIT_CMP_OP(v_int64x2, v_reinterpret_as_s64)\n\ninline v_float32x4 v_not_nan(const v_float32x4& a)\n{\n    v128_t z = wasm_i32x4_splat(0x7fffffff);\n    v128_t t = wasm_i32x4_splat(0x7f800000);\n    return v_float32x4(wasm_u32x4_lt(wasm_v128_and(a.val, z), t));\n}\ninline v_float64x2 v_not_nan(const v_float64x2& a)\n{\n    v128_t z = wasm_i64x2_splat(0x7fffffffffffffff);\n    v128_t t = wasm_i64x2_splat(0x7ff0000000000000);\n    return v_float64x2((__u64x2)(wasm_v128_and(a.val, z)) < (__u64x2)t);\n}\n\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint8x16, v_add_wrap, wasm_i8x16_add)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int8x16, v_add_wrap, wasm_i8x16_add)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint16x8, v_add_wrap, wasm_i16x8_add)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int16x8, v_add_wrap, wasm_i16x8_add)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint8x16, v_sub_wrap, wasm_i8x16_sub)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int8x16, v_sub_wrap, wasm_i8x16_sub)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint16x8, v_sub_wrap, wasm_i16x8_sub)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int16x8, v_sub_wrap, wasm_i16x8_sub)\n#if (__EMSCRIPTEN_major__ * 1000000 + __EMSCRIPTEN_minor__ * 1000 + __EMSCRIPTEN_tiny__) >= (1039012)\n// details: https://github.com/opencv/opencv/issues/18097 ( https://github.com/emscripten-core/emscripten/issues/12018 )\n// 1.39.12: https://github.com/emscripten-core/emscripten/commit/cd801d0f110facfd694212a3c8b2ed2ffcd630e2\ninline v_uint8x16 v_mul_wrap(const v_uint8x16& a, const v_uint8x16& b)\n{\n    uchar a_[16], b_[16];\n    wasm_v128_store(a_, a.val);\n    wasm_v128_store(b_, b.val);\n    for (int i = 0; i < 16; i++)\n        a_[i] = (uchar)(a_[i] * b_[i]);\n    return v_uint8x16(wasm_v128_load(a_));\n}\ninline v_int8x16 v_mul_wrap(const v_int8x16& a, const v_int8x16& b)\n{\n    schar a_[16], b_[16];\n    wasm_v128_store(a_, a.val);\n    wasm_v128_store(b_, b.val);\n    for (int i = 0; i < 16; i++)\n        a_[i] = (schar)(a_[i] * b_[i]);\n    return v_int8x16(wasm_v128_load(a_));\n}\n#else\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint8x16, v_mul_wrap, wasm_i8x16_mul)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int8x16, v_mul_wrap, wasm_i8x16_mul)\n#endif\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint16x8, v_mul_wrap, wasm_i16x8_mul)\nOPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int16x8, v_mul_wrap, wasm_i16x8_mul)\n\n\n/** Absolute difference **/\n\ninline v_uint8x16 v_absdiff(const v_uint8x16& a, const v_uint8x16& b)\n{ return v_add_wrap(a - b,  b - a); }\ninline v_uint16x8 v_absdiff(const v_uint16x8& a, const v_uint16x8& b)\n{ return v_add_wrap(a - b,  b - a); }\ninline v_uint32x4 v_absdiff(const v_uint32x4& a, const v_uint32x4& b)\n{ return v_max(a, b) - v_min(a, b); }\n\ninline v_uint8x16 v_absdiff(const v_int8x16& a, const v_int8x16& b)\n{\n    v_int8x16 d = v_sub_wrap(a, b);\n    v_int8x16 m = a < b;\n    return v_reinterpret_as_u8(v_sub_wrap(d ^ m, m));\n}\ninline v_uint16x8 v_absdiff(const v_int16x8& a, const v_int16x8& b)\n{\n    return v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b)));\n}\ninline v_uint32x4 v_absdiff(const v_int32x4& a, const v_int32x4& b)\n{\n    v_int32x4 d = a - b;\n    v_int32x4 m = a < b;\n    return v_reinterpret_as_u32((d ^ m) - m);\n}\n\n/** Saturating absolute difference **/\ninline v_int8x16 v_absdiffs(const v_int8x16& a, const v_int8x16& b)\n{\n    v_int8x16 d = a - b;\n    v_int8x16 m = a < b;\n    return (d ^ m) - m;\n }\ninline v_int16x8 v_absdiffs(const v_int16x8& a, const v_int16x8& b)\n{ return v_max(a, b) - v_min(a, b); }\n\n\ninline v_int32x4 v_fma(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return a * b + c;\n}\n\ninline v_int32x4 v_muladd(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c)\n{\n    return v_fma(a, b, c);\n}\n\ninline v_float32x4 v_fma(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c)\n{\n    return a * b + c;\n}\n\ninline v_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c)\n{\n    return a * b + c;\n}\n\ninline v_float32x4 v_absdiff(const v_float32x4& a, const v_float32x4& b)\n{\n    v128_t absmask_vec = wasm_i32x4_splat(0x7fffffff);\n    return v_float32x4(wasm_v128_and(wasm_f32x4_sub(a.val, b.val), absmask_vec));\n}\ninline v_float64x2 v_absdiff(const v_float64x2& a, const v_float64x2& b)\n{\n    v128_t absmask_vec = wasm_u64x2_shr(wasm_i32x4_splat(-1), 1);\n    return v_float64x2(wasm_v128_and(wasm_f64x2_sub(a.val, b.val), absmask_vec));\n}\n\n#define OPENCV_HAL_IMPL_WASM_MISC_FLT_OP(_Tpvec, suffix) \\\ninline _Tpvec v_magnitude(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    v128_t a_Square = wasm_##suffix##_mul(a.val, a.val); \\\n    v128_t b_Square = wasm_##suffix##_mul(b.val, b.val); \\\n    return _Tpvec(wasm_##suffix##_sqrt(wasm_##suffix##_add(a_Square, b_Square))); \\\n} \\\ninline _Tpvec v_sqr_magnitude(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    v128_t a_Square = wasm_##suffix##_mul(a.val, a.val); \\\n    v128_t b_Square = wasm_##suffix##_mul(b.val, b.val); \\\n    return _Tpvec(wasm_##suffix##_add(a_Square, b_Square)); \\\n} \\\ninline _Tpvec v_muladd(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c) \\\n{ \\\n    return _Tpvec(wasm_##suffix##_add(wasm_##suffix##_mul(a.val, b.val), c.val)); \\\n}\n\nOPENCV_HAL_IMPL_WASM_MISC_FLT_OP(v_float32x4, f32x4)\nOPENCV_HAL_IMPL_WASM_MISC_FLT_OP(v_float64x2, f64x2)\n\n#define OPENCV_HAL_IMPL_WASM_SHIFT_OP(_Tpuvec, _Tpsvec, suffix, ssuffix) \\\ninline _Tpuvec operator << (const _Tpuvec& a, int imm) \\\n{ \\\n    return _Tpuvec(wasm_##suffix##_shl(a.val, imm)); \\\n} \\\ninline _Tpsvec operator << (const _Tpsvec& a, int imm) \\\n{ \\\n    return _Tpsvec(wasm_##suffix##_shl(a.val, imm)); \\\n} \\\ninline _Tpuvec operator >> (const _Tpuvec& a, int imm) \\\n{ \\\n    return _Tpuvec(wasm_##ssuffix##_shr(a.val, imm)); \\\n} \\\ninline _Tpsvec operator >> (const _Tpsvec& a, int imm) \\\n{ \\\n    return _Tpsvec(wasm_##suffix##_shr(a.val, imm)); \\\n} \\\ntemplate<int imm> \\\ninline _Tpuvec v_shl(const _Tpuvec& a) \\\n{ \\\n    return _Tpuvec(wasm_##suffix##_shl(a.val, imm)); \\\n} \\\ntemplate<int imm> \\\ninline _Tpsvec v_shl(const _Tpsvec& a) \\\n{ \\\n    return _Tpsvec(wasm_##suffix##_shl(a.val, imm)); \\\n} \\\ntemplate<int imm> \\\ninline _Tpuvec v_shr(const _Tpuvec& a) \\\n{ \\\n    return _Tpuvec(wasm_##ssuffix##_shr(a.val, imm)); \\\n} \\\ntemplate<int imm> \\\ninline _Tpsvec v_shr(const _Tpsvec& a) \\\n{ \\\n    return _Tpsvec(wasm_##suffix##_shr(a.val, imm)); \\\n}\n\nOPENCV_HAL_IMPL_WASM_SHIFT_OP(v_uint8x16, v_int8x16, i8x16, u8x16)\nOPENCV_HAL_IMPL_WASM_SHIFT_OP(v_uint16x8, v_int16x8, i16x8, u16x8)\nOPENCV_HAL_IMPL_WASM_SHIFT_OP(v_uint32x4, v_int32x4, i32x4, u32x4)\nOPENCV_HAL_IMPL_WASM_SHIFT_OP(v_uint64x2, v_int64x2, i64x2, u64x2)\n\nnamespace hal_wasm_internal\n{\n    template <int imm,\n        bool is_invalid = ((imm < 0) || (imm > 16)),\n        bool is_first = (imm == 0),\n        bool is_second = (imm == 16),\n        bool is_other = (((imm > 0) && (imm < 16)))>\n    class v_wasm_palignr_u8_class;\n\n    template <int imm>\n    class v_wasm_palignr_u8_class<imm, true, false, false, false>;\n\n    template <int imm>\n    class v_wasm_palignr_u8_class<imm, false, true, false, false>\n    {\n    public:\n        inline v128_t operator()(const v128_t& a, const v128_t&) const\n        {\n            return a;\n        }\n    };\n\n    template <int imm>\n    class v_wasm_palignr_u8_class<imm, false, false, true, false>\n    {\n    public:\n        inline v128_t operator()(const v128_t&, const v128_t& b) const\n        {\n            return b;\n        }\n    };\n\n    template <int imm>\n    class v_wasm_palignr_u8_class<imm, false, false, false, true>\n    {\n    public:\n        inline v128_t operator()(const v128_t& a, const v128_t& b) const\n        {\n            enum { imm2 = (sizeof(v128_t) - imm) };\n            return wasm_v8x16_shuffle(a, b,\n                                      imm, imm+1, imm+2, imm+3,\n                                      imm+4, imm+5, imm+6, imm+7,\n                                      imm+8, imm+9, imm+10, imm+11,\n                                      imm+12, imm+13, imm+14, imm+15);\n        }\n    };\n\n    template <int imm>\n    inline v128_t v_wasm_palignr_u8(const v128_t& a, const v128_t& b)\n    {\n        CV_StaticAssert((imm >= 0) && (imm <= 16), \"Invalid imm for v_wasm_palignr_u8.\");\n        return v_wasm_palignr_u8_class<imm>()(a, b);\n    }\n}\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_right(const _Tpvec &a)\n{\n    using namespace hal_wasm_internal;\n    enum { imm2 = (imm * sizeof(typename _Tpvec::lane_type)) };\n    v128_t z = wasm_i8x16_splat(0);\n    return _Tpvec(v_wasm_palignr_u8<imm2>(a.val, z));\n}\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_left(const _Tpvec &a)\n{\n    using namespace hal_wasm_internal;\n    enum { imm2 = ((_Tpvec::nlanes - imm) * sizeof(typename _Tpvec::lane_type)) };\n    v128_t z = wasm_i8x16_splat(0);\n    return _Tpvec(v_wasm_palignr_u8<imm2>(z, a.val));\n}\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_right(const _Tpvec &a, const _Tpvec &b)\n{\n    using namespace hal_wasm_internal;\n    enum { imm2 = (imm * sizeof(typename _Tpvec::lane_type)) };\n    return _Tpvec(v_wasm_palignr_u8<imm2>(a.val, b.val));\n}\n\ntemplate<int imm, typename _Tpvec>\ninline _Tpvec v_rotate_left(const _Tpvec &a, const _Tpvec &b)\n{\n    using namespace hal_wasm_internal;\n    enum { imm2 = ((_Tpvec::nlanes - imm) * sizeof(typename _Tpvec::lane_type)) };\n    return _Tpvec(v_wasm_palignr_u8<imm2>(b.val, a.val));\n}\n\n#define OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(_Tpvec, _Tp) \\\ninline _Tpvec v_load(const _Tp* ptr) \\\n{ return _Tpvec(wasm_v128_load(ptr)); } \\\ninline _Tpvec v_load_aligned(const _Tp* ptr) \\\n{ return _Tpvec(wasm_v128_load(ptr)); } \\\ninline _Tpvec v_load_low(const _Tp* ptr) \\\n{ \\\n    _Tp tmp[_Tpvec::nlanes] = {0}; \\\n    for (int i=0; i<_Tpvec::nlanes/2; ++i) { \\\n        tmp[i] = ptr[i]; \\\n    } \\\n    return _Tpvec(wasm_v128_load(tmp)); \\\n} \\\ninline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \\\n{ \\\n    _Tp tmp[_Tpvec::nlanes]; \\\n    for (int i=0; i<_Tpvec::nlanes/2; ++i) { \\\n        tmp[i] = ptr0[i]; \\\n        tmp[i+_Tpvec::nlanes/2] = ptr1[i]; \\\n    } \\\n    return _Tpvec(wasm_v128_load(tmp)); \\\n} \\\ninline void v_store(_Tp* ptr, const _Tpvec& a) \\\n{ wasm_v128_store(ptr, a.val); } \\\ninline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \\\n{ wasm_v128_store(ptr, a.val); } \\\ninline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \\\n{ wasm_v128_store(ptr, a.val); } \\\ninline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode /*mode*/) \\\n{ \\\n    wasm_v128_store(ptr, a.val); \\\n} \\\ninline void v_store_low(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    _Tpvec::lane_type a_[_Tpvec::nlanes]; \\\n    wasm_v128_store(a_, a.val); \\\n    for (int i = 0; i < (_Tpvec::nlanes / 2); i++) \\\n        ptr[i] = a_[i]; \\\n} \\\ninline void v_store_high(_Tp* ptr, const _Tpvec& a) \\\n{ \\\n    _Tpvec::lane_type a_[_Tpvec::nlanes]; \\\n    wasm_v128_store(a_, a.val); \\\n    for (int i = 0; i < (_Tpvec::nlanes / 2); i++) \\\n        ptr[i] = a_[i + (_Tpvec::nlanes / 2)]; \\\n}\n\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_uint8x16, uchar)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_int8x16, schar)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_uint16x8, ushort)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_int16x8, short)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_uint32x4, unsigned)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_int32x4, int)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_uint64x2, uint64)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_int64x2, int64)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_float32x4, float)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_float64x2, double)\n\n\n/** Reverse **/\ninline v_uint8x16 v_reverse(const v_uint8x16 &a)\n{ return v_uint8x16(wasm_v8x16_shuffle(a.val, a.val, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)); }\n\ninline v_int8x16 v_reverse(const v_int8x16 &a)\n{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); }\n\ninline v_uint16x8 v_reverse(const v_uint16x8 &a)\n{ return v_uint16x8(wasm_v8x16_shuffle(a.val, a.val, 14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1)); }\n\ninline v_int16x8 v_reverse(const v_int16x8 &a)\n{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); }\n\ninline v_uint32x4 v_reverse(const v_uint32x4 &a)\n{ return v_uint32x4(wasm_v8x16_shuffle(a.val, a.val, 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3)); }\n\ninline v_int32x4 v_reverse(const v_int32x4 &a)\n{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_float32x4 v_reverse(const v_float32x4 &a)\n{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); }\n\ninline v_uint64x2 v_reverse(const v_uint64x2 &a)\n{ return v_uint64x2(wasm_v8x16_shuffle(a.val, a.val, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7)); }\n\ninline v_int64x2 v_reverse(const v_int64x2 &a)\n{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); }\n\ninline v_float64x2 v_reverse(const v_float64x2 &a)\n{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); }\n\n\n#define OPENCV_HAL_IMPL_WASM_REDUCE_OP_4_SUM(_Tpvec, scalartype, regtype, suffix, esuffix) \\\ninline scalartype v_reduce_sum(const _Tpvec& a) \\\n{ \\\n    regtype val = a.val; \\\n    val = wasm_##suffix##_add(val, wasm_v8x16_shuffle(val, val, 8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)); \\\n    val = wasm_##suffix##_add(val, wasm_v8x16_shuffle(val, val, 4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3)); \\\n    return (scalartype)wasm_##esuffix##_extract_lane(val, 0); \\\n}\n\nOPENCV_HAL_IMPL_WASM_REDUCE_OP_4_SUM(v_uint32x4, unsigned, v128_t, i32x4, i32x4)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP_4_SUM(v_int32x4, int, v128_t, i32x4, i32x4)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP_4_SUM(v_float32x4, float, v128_t, f32x4, f32x4)\n\n// To do: Optimize v_reduce_sum with wasm intrin.\n//        Now use fallback implementation as there is no widening op in wasm intrin.\n\n#define OPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(_Tpvec, scalartype) \\\ninline scalartype v_reduce_sum(const _Tpvec& a) \\\n{ \\\n    _Tpvec::lane_type a_[_Tpvec::nlanes]; \\\n    wasm_v128_store(a_, a.val); \\\n    scalartype c = a_[0]; \\\n    for (int i = 1; i < _Tpvec::nlanes; i++) \\\n        c += a_[i]; \\\n    return c; \\\n}\n\nOPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(v_uint8x16, unsigned)\nOPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(v_int8x16, int)\nOPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(v_uint16x8, unsigned)\nOPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(v_int16x8, int)\n\n\n#define OPENCV_HAL_IMPL_WASM_REDUCE_OP_2_SUM(_Tpvec, scalartype, regtype, suffix, esuffix) \\\ninline scalartype v_reduce_sum(const _Tpvec& a) \\\n{ \\\n    regtype val = a.val; \\\n    val = wasm_##suffix##_add(val, wasm_v8x16_shuffle(val, val, 8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)); \\\n    return (scalartype)wasm_##esuffix##_extract_lane(val, 0); \\\n}\nOPENCV_HAL_IMPL_WASM_REDUCE_OP_2_SUM(v_uint64x2, uint64, v128_t, i64x2, i64x2)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP_2_SUM(v_int64x2, int64,  v128_t, i64x2, i64x2)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP_2_SUM(v_float64x2, double,  v128_t, f64x2,f64x2)\n\ninline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b,\n                                 const v_float32x4& c, const v_float32x4& d)\n{\n    v128_t ac = wasm_f32x4_add(wasm_unpacklo_i32x4(a.val, c.val), wasm_unpackhi_i32x4(a.val, c.val));\n    v128_t bd = wasm_f32x4_add(wasm_unpacklo_i32x4(b.val, d.val), wasm_unpackhi_i32x4(b.val, d.val));\n    return v_float32x4(wasm_f32x4_add(wasm_unpacklo_i32x4(ac, bd), wasm_unpackhi_i32x4(ac, bd)));\n}\n\n#define OPENCV_HAL_IMPL_WASM_REDUCE_OP(_Tpvec, scalartype, func, scalar_func) \\\ninline scalartype v_reduce_##func(const _Tpvec& a) \\\n{ \\\n    scalartype buf[_Tpvec::nlanes]; \\\n    v_store(buf, a); \\\n    scalartype tmp = buf[0]; \\\n    for (int i=1; i<_Tpvec::nlanes; ++i) { \\\n        tmp = scalar_func(tmp, buf[i]); \\\n    } \\\n    return tmp; \\\n}\n\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint8x16, uchar, max, std::max)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint8x16, uchar, min, std::min)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int8x16, schar, max, std::max)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int8x16, schar, min, std::min)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint16x8, ushort, max, std::max)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint16x8, ushort, min, std::min)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int16x8, short, max, std::max)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int16x8, short, min, std::min)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint32x4, unsigned, max, std::max)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint32x4, unsigned, min, std::min)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int32x4, int, max, std::max)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int32x4, int, min, std::min)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_float32x4, float, max, std::max)\nOPENCV_HAL_IMPL_WASM_REDUCE_OP(v_float32x4, float, min, std::min)\n\ninline unsigned v_reduce_sad(const v_uint8x16& a, const v_uint8x16& b)\n{\n    v_uint16x8 l16, h16;\n    v_uint32x4 l16_l32, l16_h32, h16_l32, h16_h32;\n    v_expand(v_absdiff(a, b), l16, h16);\n    v_expand(l16, l16_l32, l16_h32);\n    v_expand(h16, h16_l32, h16_h32);\n    return v_reduce_sum(l16_l32+l16_h32+h16_l32+h16_h32);\n}\ninline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b)\n{\n    v_uint16x8 l16, h16;\n    v_uint32x4 l16_l32, l16_h32, h16_l32, h16_h32;\n    v_expand(v_absdiff(a, b), l16, h16);\n    v_expand(l16, l16_l32, l16_h32);\n    v_expand(h16, h16_l32, h16_h32);\n    return v_reduce_sum(l16_l32+l16_h32+h16_l32+h16_h32);\n}\ninline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b)\n{\n    v_uint32x4 l, h;\n    v_expand(v_absdiff(a, b), l, h);\n    return v_reduce_sum(l + h);\n}\ninline unsigned v_reduce_sad(const v_int16x8& a, const v_int16x8& b)\n{\n    v_uint32x4 l, h;\n    v_expand(v_absdiff(a, b), l, h);\n    return v_reduce_sum(l + h);\n}\ninline unsigned v_reduce_sad(const v_uint32x4& a, const v_uint32x4& b)\n{\n    return v_reduce_sum(v_absdiff(a, b));\n}\ninline unsigned v_reduce_sad(const v_int32x4& a, const v_int32x4& b)\n{\n    return v_reduce_sum(v_absdiff(a, b));\n}\ninline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b)\n{\n    return v_reduce_sum(v_absdiff(a, b));\n}\n\ninline v_uint8x16 v_popcount(const v_uint8x16& a)\n{\n    v128_t m1 = wasm_i32x4_splat(0x55555555);\n    v128_t m2 = wasm_i32x4_splat(0x33333333);\n    v128_t m4 = wasm_i32x4_splat(0x0f0f0f0f);\n    v128_t p = a.val;\n    p = wasm_i32x4_add(wasm_v128_and(wasm_u32x4_shr(p, 1), m1), wasm_v128_and(p, m1));\n    p = wasm_i32x4_add(wasm_v128_and(wasm_u32x4_shr(p, 2), m2), wasm_v128_and(p, m2));\n    p = wasm_i32x4_add(wasm_v128_and(wasm_u32x4_shr(p, 4), m4), wasm_v128_and(p, m4));\n    return v_uint8x16(p);\n}\ninline v_uint16x8 v_popcount(const v_uint16x8& a)\n{\n    v_uint8x16 p = v_popcount(v_reinterpret_as_u8(a));\n    p += v_rotate_right<1>(p);\n    return v_reinterpret_as_u16(p) & v_setall_u16(0x00ff);\n}\ninline v_uint32x4 v_popcount(const v_uint32x4& a)\n{\n    v_uint8x16 p = v_popcount(v_reinterpret_as_u8(a));\n    p += v_rotate_right<1>(p);\n    p += v_rotate_right<2>(p);\n    return v_reinterpret_as_u32(p) & v_setall_u32(0x000000ff);\n}\ninline v_uint64x2 v_popcount(const v_uint64x2& a)\n{\n    uint64 a_[2], b_[2] = { 0 };\n    wasm_v128_store(a_, a.val);\n    for (int i = 0; i < 16; i++)\n        b_[i / 8] += popCountTable[((uint8_t*)a_)[i]];\n    return v_uint64x2(wasm_v128_load(b_));\n}\ninline v_uint8x16 v_popcount(const v_int8x16& a)\n{ return v_popcount(v_reinterpret_as_u8(a)); }\ninline v_uint16x8 v_popcount(const v_int16x8& a)\n{ return v_popcount(v_reinterpret_as_u16(a)); }\ninline v_uint32x4 v_popcount(const v_int32x4& a)\n{ return v_popcount(v_reinterpret_as_u32(a)); }\ninline v_uint64x2 v_popcount(const v_int64x2& a)\n{ return v_popcount(v_reinterpret_as_u64(a)); }\n\n#define OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(_Tpvec, suffix, scalarType) \\\ninline int v_signmask(const _Tpvec& a) \\\n{ \\\n    _Tpvec::lane_type a_[_Tpvec::nlanes]; \\\n    wasm_v128_store(a_, a.val); \\\n    int mask = 0; \\\n    for (int i = 0; i < _Tpvec::nlanes; i++) \\\n        mask |= (reinterpret_int(a_[i]) < 0) << i; \\\n    return mask; \\\n} \\\ninline bool v_check_all(const _Tpvec& a) \\\n{ return wasm_i8x16_all_true(wasm_##suffix##_lt(a.val, wasm_##suffix##_splat(0))); } \\\ninline bool v_check_any(const _Tpvec& a) \\\n{ return wasm_i8x16_any_true(wasm_##suffix##_lt(a.val, wasm_##suffix##_splat(0)));; }\n\nOPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_uint8x16, i8x16, schar)\nOPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_int8x16, i8x16, schar)\nOPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_uint16x8, i16x8, short)\nOPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_int16x8, i16x8, short)\nOPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_uint32x4, i32x4, int)\nOPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_int32x4, i32x4, int)\nOPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_float32x4, i32x4, float)\nOPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_float64x2, f64x2, double)\n\n#define OPENCV_HAL_IMPL_WASM_CHECK_ALL_ANY(_Tpvec, suffix, esuffix) \\\ninline bool v_check_all(const _Tpvec& a) \\\n{ \\\n    v128_t masked = v_reinterpret_as_##esuffix(a).val; \\\n    masked = wasm_i32x4_replace_lane(masked, 0, 0xffffffff); \\\n    masked = wasm_i32x4_replace_lane(masked, 2, 0xffffffff); \\\n    return wasm_i8x16_all_true(wasm_##suffix##_lt(masked, wasm_##suffix##_splat(0))); \\\n} \\\ninline bool v_check_any(const _Tpvec& a) \\\n{ \\\n    v128_t masked = v_reinterpret_as_##esuffix(a).val; \\\n    masked = wasm_i32x4_replace_lane(masked, 0, 0x0); \\\n    masked = wasm_i32x4_replace_lane(masked, 2, 0x0); \\\n    return wasm_i8x16_any_true(wasm_##suffix##_lt(masked, wasm_##suffix##_splat(0))); \\\n} \\\n\nOPENCV_HAL_IMPL_WASM_CHECK_ALL_ANY(v_int64x2, i32x4, s32)\nOPENCV_HAL_IMPL_WASM_CHECK_ALL_ANY(v_uint64x2, i32x4, u32)\n\n\ninline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); }\ninline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); }\ninline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; }\ninline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; }\ninline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; }\ninline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; }\ninline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; }\ninline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; }\ninline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; }\ninline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; }\n\n#define OPENCV_HAL_IMPL_WASM_SELECT(_Tpvec) \\\ninline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(wasm_v128_bitselect(a.val, b.val, mask.val)); \\\n}\n\nOPENCV_HAL_IMPL_WASM_SELECT(v_uint8x16)\nOPENCV_HAL_IMPL_WASM_SELECT(v_int8x16)\nOPENCV_HAL_IMPL_WASM_SELECT(v_uint16x8)\nOPENCV_HAL_IMPL_WASM_SELECT(v_int16x8)\nOPENCV_HAL_IMPL_WASM_SELECT(v_uint32x4)\nOPENCV_HAL_IMPL_WASM_SELECT(v_int32x4)\nOPENCV_HAL_IMPL_WASM_SELECT(v_uint64x2)\nOPENCV_HAL_IMPL_WASM_SELECT(v_int64x2)\nOPENCV_HAL_IMPL_WASM_SELECT(v_float32x4)\nOPENCV_HAL_IMPL_WASM_SELECT(v_float64x2)\n\n#define OPENCV_HAL_IMPL_WASM_EXPAND(_Tpvec, _Tpwvec, _Tp, intrin)    \\\ninline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1)      \\\n{                                                                    \\\n    b0.val = intrin(a.val);                                          \\\n    b1.val = __CV_CAT(intrin, _high)(a.val);                         \\\n}                                                                    \\\ninline _Tpwvec v_expand_low(const _Tpvec& a)                         \\\n{ return _Tpwvec(intrin(a.val)); }                                   \\\ninline _Tpwvec v_expand_high(const _Tpvec& a)                        \\\n{ return _Tpwvec(__CV_CAT(intrin, _high)(a.val)); }                  \\\ninline _Tpwvec v_load_expand(const _Tp* ptr)                         \\\n{                                                                    \\\n    v128_t a = wasm_v128_load(ptr);                                  \\\n    return _Tpwvec(intrin(a));                                       \\\n}\n\nOPENCV_HAL_IMPL_WASM_EXPAND(v_uint8x16, v_uint16x8, uchar, v128_cvtu8x16_i16x8)\nOPENCV_HAL_IMPL_WASM_EXPAND(v_int8x16,  v_int16x8,  schar, v128_cvti8x16_i16x8)\nOPENCV_HAL_IMPL_WASM_EXPAND(v_uint16x8, v_uint32x4, ushort, v128_cvtu16x8_i32x4)\nOPENCV_HAL_IMPL_WASM_EXPAND(v_int16x8,  v_int32x4,  short, v128_cvti16x8_i32x4)\nOPENCV_HAL_IMPL_WASM_EXPAND(v_uint32x4, v_uint64x2, unsigned, v128_cvtu32x4_i64x2)\nOPENCV_HAL_IMPL_WASM_EXPAND(v_int32x4,  v_int64x2,  int, v128_cvti32x4_i64x2)\n\n#define OPENCV_HAL_IMPL_WASM_EXPAND_Q(_Tpvec, _Tp, intrin)  \\\ninline _Tpvec v_load_expand_q(const _Tp* ptr)               \\\n{                                                           \\\n    v128_t a = wasm_v128_load(ptr);                         \\\n    return _Tpvec(intrin(a));                               \\\n}\n\nOPENCV_HAL_IMPL_WASM_EXPAND_Q(v_uint32x4, uchar, v128_cvtu8x16_i32x4)\nOPENCV_HAL_IMPL_WASM_EXPAND_Q(v_int32x4, schar, v128_cvti8x16_i32x4)\n\n#define OPENCV_HAL_IMPL_WASM_UNPACKS(_Tpvec, suffix) \\\ninline void v_zip(const _Tpvec& a0, const _Tpvec& a1, _Tpvec& b0, _Tpvec& b1) \\\n{ \\\n    b0.val = wasm_unpacklo_##suffix(a0.val, a1.val); \\\n    b1.val = wasm_unpackhi_##suffix(a0.val, a1.val); \\\n} \\\ninline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(wasm_unpacklo_i64x2(a.val, b.val)); \\\n} \\\ninline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b) \\\n{ \\\n    return _Tpvec(wasm_unpackhi_i64x2(a.val, b.val)); \\\n} \\\ninline void v_recombine(const _Tpvec& a, const _Tpvec& b, _Tpvec& c, _Tpvec& d) \\\n{ \\\n    c.val = wasm_unpacklo_i64x2(a.val, b.val); \\\n    d.val = wasm_unpackhi_i64x2(a.val, b.val); \\\n}\n\nOPENCV_HAL_IMPL_WASM_UNPACKS(v_uint8x16, i8x16)\nOPENCV_HAL_IMPL_WASM_UNPACKS(v_int8x16, i8x16)\nOPENCV_HAL_IMPL_WASM_UNPACKS(v_uint16x8, i16x8)\nOPENCV_HAL_IMPL_WASM_UNPACKS(v_int16x8, i16x8)\nOPENCV_HAL_IMPL_WASM_UNPACKS(v_uint32x4, i32x4)\nOPENCV_HAL_IMPL_WASM_UNPACKS(v_int32x4, i32x4)\nOPENCV_HAL_IMPL_WASM_UNPACKS(v_float32x4, i32x4)\nOPENCV_HAL_IMPL_WASM_UNPACKS(v_float64x2, i64x2)\n\ntemplate<int s, typename _Tpvec>\ninline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b)\n{\n    return v_rotate_right<s>(a, b);\n}\n\ninline v_int32x4 v_round(const v_float32x4& a)\n{\n    v128_t h = wasm_f32x4_splat(0.5);\n    return v_int32x4(wasm_i32x4_trunc_saturate_f32x4(wasm_f32x4_add(a.val, h)));\n}\n\ninline v_int32x4 v_floor(const v_float32x4& a)\n{\n    v128_t a1 = wasm_i32x4_trunc_saturate_f32x4(a.val);\n    v128_t mask = wasm_f32x4_lt(a.val, wasm_f32x4_convert_i32x4(a1));\n    return v_int32x4(wasm_i32x4_add(a1, mask));\n}\n\ninline v_int32x4 v_ceil(const v_float32x4& a)\n{\n    v128_t a1 = wasm_i32x4_trunc_saturate_f32x4(a.val);\n    v128_t mask = wasm_f32x4_gt(a.val, wasm_f32x4_convert_i32x4(a1));\n    return v_int32x4(wasm_i32x4_sub(a1, mask));\n}\n\ninline v_int32x4 v_trunc(const v_float32x4& a)\n{ return v_int32x4(wasm_i32x4_trunc_saturate_f32x4(a.val)); }\n\n#define OPENCV_HAL_IMPL_WASM_MATH_FUNC(func, cfunc) \\\ninline v_int32x4 func(const v_float64x2& a) \\\n{ \\\n    double a_[2]; \\\n    wasm_v128_store(a_, a.val); \\\n    int c_[4]; \\\n    c_[0] = cfunc(a_[0]); \\\n    c_[1] = cfunc(a_[1]); \\\n    c_[2] = 0; \\\n    c_[3] = 0; \\\n    return v_int32x4(wasm_v128_load(c_)); \\\n}\n\nOPENCV_HAL_IMPL_WASM_MATH_FUNC(v_round, cvRound)\nOPENCV_HAL_IMPL_WASM_MATH_FUNC(v_floor, cvFloor)\nOPENCV_HAL_IMPL_WASM_MATH_FUNC(v_ceil, cvCeil)\nOPENCV_HAL_IMPL_WASM_MATH_FUNC(v_trunc, int)\n\ninline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b)\n{\n    double a_[2], b_[2];\n    wasm_v128_store(a_, a.val);\n    wasm_v128_store(b_, b.val);\n    int c_[4];\n    c_[0] = cvRound(a_[0]);\n    c_[1] = cvRound(a_[1]);\n    c_[2] = cvRound(b_[0]);\n    c_[3] = cvRound(b_[1]);\n    return v_int32x4(wasm_v128_load(c_));\n}\n\n#define OPENCV_HAL_IMPL_WASM_TRANSPOSE4x4(_Tpvec, suffix) \\\ninline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1, \\\n                           const _Tpvec& a2, const _Tpvec& a3, \\\n                           _Tpvec& b0, _Tpvec& b1, \\\n                           _Tpvec& b2, _Tpvec& b3) \\\n{ \\\n    v128_t t0 = wasm_unpacklo_##suffix(a0.val, a1.val); \\\n    v128_t t1 = wasm_unpacklo_##suffix(a2.val, a3.val); \\\n    v128_t t2 = wasm_unpackhi_##suffix(a0.val, a1.val); \\\n    v128_t t3 = wasm_unpackhi_##suffix(a2.val, a3.val); \\\n\\\n    b0.val = wasm_unpacklo_i64x2(t0, t1); \\\n    b1.val = wasm_unpackhi_i64x2(t0, t1); \\\n    b2.val = wasm_unpacklo_i64x2(t2, t3); \\\n    b3.val = wasm_unpackhi_i64x2(t2, t3); \\\n}\n\nOPENCV_HAL_IMPL_WASM_TRANSPOSE4x4(v_uint32x4, i32x4)\nOPENCV_HAL_IMPL_WASM_TRANSPOSE4x4(v_int32x4, i32x4)\nOPENCV_HAL_IMPL_WASM_TRANSPOSE4x4(v_float32x4, i32x4)\n\n// load deinterleave\ninline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b)\n{\n    v128_t t00 = wasm_v128_load(ptr);\n    v128_t t01 = wasm_v128_load(ptr + 16);\n\n    a.val = wasm_v8x16_shuffle(t00, t01, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30);\n    b.val = wasm_v8x16_shuffle(t00, t01, 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31);\n}\n\ninline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b, v_uint8x16& c)\n{\n    v128_t t00 = wasm_v128_load(ptr);\n    v128_t t01 = wasm_v128_load(ptr + 16);\n    v128_t t02 = wasm_v128_load(ptr + 32);\n\n    v128_t t10 = wasm_v8x16_shuffle(t00, t01, 0,3,6,9,12,15,18,21,24,27,30,1,2,4,5,7);\n    v128_t t11 = wasm_v8x16_shuffle(t00, t01, 1,4,7,10,13,16,19,22,25,28,31,0,2,3,5,6);\n    v128_t t12 = wasm_v8x16_shuffle(t00, t01, 2,5,8,11,14,17,20,23,26,29,0,1,3,4,6,7);\n\n    a.val = wasm_v8x16_shuffle(t10, t02, 0,1,2,3,4,5,6,7,8,9,10,17,20,23,26,29);\n    b.val = wasm_v8x16_shuffle(t11, t02, 0,1,2,3,4,5,6,7,8,9,10,18,21,24,27,30);\n    c.val = wasm_v8x16_shuffle(t12, t02, 0,1,2,3,4,5,6,7,8,9,16,19,22,25,28,31);\n}\n\ninline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b, v_uint8x16& c, v_uint8x16& d)\n{\n    v128_t u0 = wasm_v128_load(ptr); // a0 b0 c0 d0 a1 b1 c1 d1 ...\n    v128_t u1 = wasm_v128_load(ptr + 16); // a4 b4 c4 d4 ...\n    v128_t u2 = wasm_v128_load(ptr + 32); // a8 b8 c8 d8 ...\n    v128_t u3 = wasm_v128_load(ptr + 48); // a12 b12 c12 d12 ...\n\n    v128_t v0 = wasm_v8x16_shuffle(u0, u1, 0,4,8,12,16,20,24,28,1,5,9,13,17,21,25,29);\n    v128_t v1 = wasm_v8x16_shuffle(u2, u3, 0,4,8,12,16,20,24,28,1,5,9,13,17,21,25,29);\n    v128_t v2 = wasm_v8x16_shuffle(u0, u1, 2,6,10,14,18,22,26,30,3,7,11,15,19,23,27,31);\n    v128_t v3 = wasm_v8x16_shuffle(u2, u3, 2,6,10,14,18,22,26,30,3,7,11,15,19,23,27,31);\n\n    a.val = wasm_v8x16_shuffle(v0, v1, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23);\n    b.val = wasm_v8x16_shuffle(v0, v1, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31);\n    c.val = wasm_v8x16_shuffle(v2, v3, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23);\n    d.val = wasm_v8x16_shuffle(v2, v3, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31);\n}\n\ninline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b)\n{\n    v128_t v0 = wasm_v128_load(ptr);     // a0 b0 a1 b1 a2 b2 a3 b3\n    v128_t v1 = wasm_v128_load(ptr + 8); // a4 b4 a5 b5 a6 b6 a7 b7\n\n    a.val = wasm_v8x16_shuffle(v0, v1, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29); // a0 a1 a2 a3 a4 a5 a6 a7\n    b.val = wasm_v8x16_shuffle(v0, v1, 2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31); // b0 b1 ab b3 b4 b5 b6 b7\n}\n\ninline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b, v_uint16x8& c)\n{\n    v128_t t00 = wasm_v128_load(ptr);        // a0 b0 c0 a1 b1 c1 a2 b2\n    v128_t t01 = wasm_v128_load(ptr + 8);    // c2 a3 b3 c3 a4 b4 c4 a5\n    v128_t t02 = wasm_v128_load(ptr + 16);  // b5 c5 a6 b6 c6 a7 b7 c7\n\n    v128_t t10 = wasm_v8x16_shuffle(t00, t01, 0,1,6,7,12,13,18,19,24,25,30,31,2,3,4,5);\n    v128_t t11 = wasm_v8x16_shuffle(t00, t01, 2,3,8,9,14,15,20,21,26,27,0,1,4,5,6,7);\n    v128_t t12 = wasm_v8x16_shuffle(t00, t01, 4,5,10,11,16,17,22,23,28,29,0,1,2,3,6,7);\n\n    a.val = wasm_v8x16_shuffle(t10, t02, 0,1,2,3,4,5,6,7,8,9,10,11,20,21,26,27);\n    b.val = wasm_v8x16_shuffle(t11, t02, 0,1,2,3,4,5,6,7,8,9,16,17,22,23,28,29);\n    c.val = wasm_v8x16_shuffle(t12, t02, 0,1,2,3,4,5,6,7,8,9,18,19,24,25,30,31);\n}\n\ninline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b, v_uint16x8& c, v_uint16x8& d)\n{\n    v128_t u0 = wasm_v128_load(ptr); // a0 b0 c0 d0 a1 b1 c1 d1\n    v128_t u1 = wasm_v128_load(ptr + 8); // a2 b2 c2 d2 ...\n    v128_t u2 = wasm_v128_load(ptr + 16); // a4 b4 c4 d4 ...\n    v128_t u3 = wasm_v128_load(ptr + 24); // a6 b6 c6 d6 ...\n\n    v128_t v0 = wasm_v8x16_shuffle(u0, u1, 0,1,8,9,16,17,24,25,2,3,10,11,18,19,26,27); // a0 a1 a2 a3 b0 b1 b2 b3\n    v128_t v1 = wasm_v8x16_shuffle(u2, u3, 0,1,8,9,16,17,24,25,2,3,10,11,18,19,26,27); // a4 a5 a6 a7 b4 b5 b6 b7\n    v128_t v2 = wasm_v8x16_shuffle(u0, u1, 4,5,12,13,20,21,28,29,6,7,14,15,22,23,30,31); // c0 c1 c2 c3 d0 d1 d2 d3\n    v128_t v3 = wasm_v8x16_shuffle(u2, u3, 4,5,12,13,20,21,28,29,6,7,14,15,22,23,30,31); // c4 c5 c6 c7 d4 d5 d6 d7\n\n    a.val = wasm_v8x16_shuffle(v0, v1, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23);\n    b.val = wasm_v8x16_shuffle(v0, v1, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31);\n    c.val = wasm_v8x16_shuffle(v2, v3, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23);\n    d.val = wasm_v8x16_shuffle(v2, v3, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31);\n}\n\ninline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b)\n{\n    v128_t v0 = wasm_v128_load(ptr);     // a0 b0 a1 b1\n    v128_t v1 = wasm_v128_load(ptr + 4); // a2 b2 a3 b3\n\n    a.val = wasm_v8x16_shuffle(v0, v1, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27); // a0 a1 a2 a3\n    b.val = wasm_v8x16_shuffle(v0, v1, 4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31); // b0 b1 b2 b3\n}\n\ninline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b, v_uint32x4& c)\n{\n    v128_t t00 = wasm_v128_load(ptr);        // a0 b0 c0 a1\n    v128_t t01 = wasm_v128_load(ptr + 4);     // b2 c2 a3 b3\n    v128_t t02 = wasm_v128_load(ptr + 8);    // c3 a4 b4 c4\n\n    v128_t t10 = wasm_v8x16_shuffle(t00, t01, 0,1,2,3,12,13,14,15,24,25,26,27,4,5,6,7);\n    v128_t t11 = wasm_v8x16_shuffle(t00, t01, 4,5,6,7,16,17,18,19,28,29,30,31,0,1,2,3);\n    v128_t t12 = wasm_v8x16_shuffle(t00, t01, 8,9,10,11,20,21,22,23,0,1,2,3,4,5,6,7);\n\n    a.val = wasm_v8x16_shuffle(t10, t02, 0,1,2,3,4,5,6,7,8,9,10,11,20,21,22,23);\n    b.val = wasm_v8x16_shuffle(t11, t02, 0,1,2,3,4,5,6,7,8,9,10,11,24,25,26,27);\n    c.val = wasm_v8x16_shuffle(t12, t02, 0,1,2,3,4,5,6,7,16,17,18,19,28,29,30,31);\n}\n\ninline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b, v_uint32x4& c, v_uint32x4& d)\n{\n    v_uint32x4 s0(wasm_v128_load(ptr));      // a0 b0 c0 d0\n    v_uint32x4 s1(wasm_v128_load(ptr + 4));  // a1 b1 c1 d1\n    v_uint32x4 s2(wasm_v128_load(ptr + 8));  // a2 b2 c2 d2\n    v_uint32x4 s3(wasm_v128_load(ptr + 12)); // a3 b3 c3 d3\n\n    v_transpose4x4(s0, s1, s2, s3, a, b, c, d);\n}\n\ninline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b)\n{\n    v128_t v0 = wasm_v128_load(ptr);       // a0 b0 a1 b1\n    v128_t v1 = wasm_v128_load((ptr + 4)); // a2 b2 a3 b3\n\n    a.val = wasm_v8x16_shuffle(v0, v1, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27); // a0 a1 a2 a3\n    b.val = wasm_v8x16_shuffle(v0, v1, 4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31); // b0 b1 b2 b3\n}\n\ninline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b, v_float32x4& c)\n{\n    v128_t t00 = wasm_v128_load(ptr);        // a0 b0 c0 a1\n    v128_t t01 = wasm_v128_load(ptr + 4);     // b2 c2 a3 b3\n    v128_t t02 = wasm_v128_load(ptr + 8);    // c3 a4 b4 c4\n\n    v128_t t10 = wasm_v8x16_shuffle(t00, t01, 0,1,2,3,12,13,14,15,24,25,26,27,4,5,6,7);\n    v128_t t11 = wasm_v8x16_shuffle(t00, t01, 4,5,6,7,16,17,18,19,28,29,30,31,0,1,2,3);\n    v128_t t12 = wasm_v8x16_shuffle(t00, t01, 8,9,10,11,20,21,22,23,0,1,2,3,4,5,6,7);\n\n    a.val = wasm_v8x16_shuffle(t10, t02, 0,1,2,3,4,5,6,7,8,9,10,11,20,21,22,23);\n    b.val = wasm_v8x16_shuffle(t11, t02, 0,1,2,3,4,5,6,7,8,9,10,11,24,25,26,27);\n    c.val = wasm_v8x16_shuffle(t12, t02, 0,1,2,3,4,5,6,7,16,17,18,19,28,29,30,31);\n}\n\ninline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b, v_float32x4& c, v_float32x4& d)\n{\n    v_float32x4 s0(wasm_v128_load(ptr));      // a0 b0 c0 d0\n    v_float32x4 s1(wasm_v128_load(ptr + 4));  // a1 b1 c1 d1\n    v_float32x4 s2(wasm_v128_load(ptr + 8));  // a2 b2 c2 d2\n    v_float32x4 s3(wasm_v128_load(ptr + 12)); // a3 b3 c3 d3\n\n    v_transpose4x4(s0, s1, s2, s3, a, b, c, d);\n}\n\ninline void v_load_deinterleave(const uint64 *ptr, v_uint64x2& a, v_uint64x2& b)\n{\n    v128_t t0 = wasm_v128_load(ptr);      // a0 b0\n    v128_t t1 = wasm_v128_load(ptr + 2);  // a1 b1\n\n    a.val = wasm_unpacklo_i64x2(t0, t1);\n    b.val = wasm_unpackhi_i64x2(t0, t1);\n}\n\ninline void v_load_deinterleave(const uint64 *ptr, v_uint64x2& a, v_uint64x2& b, v_uint64x2& c)\n{\n    v128_t t0 = wasm_v128_load(ptr);     // a0, b0\n    v128_t t1 = wasm_v128_load(ptr + 2); // c0, a1\n    v128_t t2 = wasm_v128_load(ptr + 4); // b1, c1\n\n    a.val = wasm_v8x16_shuffle(t0, t1, 0,1,2,3,4,5,6,7,24,25,26,27,28,29,30,31);\n    b.val = wasm_v8x16_shuffle(t0, t2, 8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23);\n    c.val = wasm_v8x16_shuffle(t1, t2, 0,1,2,3,4,5,6,7,24,25,26,27,28,29,30,31);\n}\n\ninline void v_load_deinterleave(const uint64 *ptr, v_uint64x2& a,\n                                v_uint64x2& b, v_uint64x2& c, v_uint64x2& d)\n{\n    v128_t t0 = wasm_v128_load(ptr);     // a0 b0\n    v128_t t1 = wasm_v128_load(ptr + 2); // c0 d0\n    v128_t t2 = wasm_v128_load(ptr + 4); // a1 b1\n    v128_t t3 = wasm_v128_load(ptr + 6); // c1 d1\n\n    a.val = wasm_unpacklo_i64x2(t0, t2);\n    b.val = wasm_unpackhi_i64x2(t0, t2);\n    c.val = wasm_unpacklo_i64x2(t1, t3);\n    d.val = wasm_unpackhi_i64x2(t1, t3);\n}\n\n// store interleave\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b,\n                                hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t v0 = wasm_unpacklo_i8x16(a.val, b.val);\n    v128_t v1 = wasm_unpackhi_i8x16(a.val, b.val);\n\n    wasm_v128_store(ptr, v0);\n    wasm_v128_store(ptr + 16, v1);\n}\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b,\n                                const v_uint8x16& c, hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t t00 = wasm_v8x16_shuffle(a.val, b.val, 0,16,0,1,17,0,2,18,0,3,19,0,4,20,0,5);\n    v128_t t01 = wasm_v8x16_shuffle(a.val, b.val, 21,0,6,22,0,7,23,0,8,24,0,9,25,0,10,26);\n    v128_t t02 = wasm_v8x16_shuffle(a.val, b.val, 0,11,27,0,12,28,0,13,29,0,14,30,0,15,31,0);\n\n    v128_t t10 = wasm_v8x16_shuffle(t00, c.val, 0,1,16,3,4,17,6,7,18,9,10,19,12,13,20,15);\n    v128_t t11 = wasm_v8x16_shuffle(t01, c.val, 0,21,2,3,22,5,6,23,8,9,24,11,12,25,14,15);\n    v128_t t12 = wasm_v8x16_shuffle(t02, c.val, 26,1,2,27,4,5,28,7,8,29,10,11,30,13,14,31);\n\n    wasm_v128_store(ptr, t10);\n    wasm_v128_store(ptr + 16, t11);\n    wasm_v128_store(ptr + 32, t12);\n}\n\ninline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b,\n                                const v_uint8x16& c, const v_uint8x16& d,\n                                hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    // a0 a1 a2 a3 ....\n    // b0 b1 b2 b3 ....\n    // c0 c1 c2 c3 ....\n    // d0 d1 d2 d3 ....\n    v128_t u0 = wasm_unpacklo_i8x16(a.val, c.val); // a0 c0 a1 c1 ...\n    v128_t u1 = wasm_unpackhi_i8x16(a.val, c.val); // a8 c8 a9 c9 ...\n    v128_t u2 = wasm_unpacklo_i8x16(b.val, d.val); // b0 d0 b1 d1 ...\n    v128_t u3 = wasm_unpackhi_i8x16(b.val, d.val); // b8 d8 b9 d9 ...\n\n    v128_t v0 = wasm_unpacklo_i8x16(u0, u2); // a0 b0 c0 d0 ...\n    v128_t v1 = wasm_unpackhi_i8x16(u0, u2); // a4 b4 c4 d4 ...\n    v128_t v2 = wasm_unpacklo_i8x16(u1, u3); // a8 b8 c8 d8 ...\n    v128_t v3 = wasm_unpackhi_i8x16(u1, u3); // a12 b12 c12 d12 ...\n\n    wasm_v128_store(ptr, v0);\n    wasm_v128_store(ptr + 16, v1);\n    wasm_v128_store(ptr + 32, v2);\n    wasm_v128_store(ptr + 48, v3);\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x8& a, const v_uint16x8& b,\n                                hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t v0 = wasm_unpacklo_i16x8(a.val, b.val);\n    v128_t v1 = wasm_unpackhi_i16x8(a.val, b.val);\n\n    wasm_v128_store(ptr, v0);\n    wasm_v128_store(ptr + 8, v1);\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x8& a,\n                                const v_uint16x8& b, const v_uint16x8& c,\n                                hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t t00 = wasm_v8x16_shuffle(a.val, b.val, 0,1,16,17,0,0,2,3,18,19,0,0,4,5,20,21);\n    v128_t t01 = wasm_v8x16_shuffle(a.val, b.val, 0,0,6,7,22,23,0,0,8,9,24,25,0,0,10,11);\n    v128_t t02 = wasm_v8x16_shuffle(a.val, b.val, 26,27,0,0,12,13,28,29,0,0,14,15,30,31,0,0);\n\n    v128_t t10 = wasm_v8x16_shuffle(t00, c.val, 0,1,2,3,16,17,6,7,8,9,18,19,12,13,14,15);\n    v128_t t11 = wasm_v8x16_shuffle(t01, c.val, 20,21,2,3,4,5,22,23,8,9,10,11,24,25,14,15);\n    v128_t t12 = wasm_v8x16_shuffle(t02, c.val, 0,1,26,27,4,5,6,7,28,29,10,11,12,13,30,31);\n\n    wasm_v128_store(ptr, t10);\n    wasm_v128_store(ptr + 8, t11);\n    wasm_v128_store(ptr + 16, t12);\n}\n\ninline void v_store_interleave( ushort* ptr, const v_uint16x8& a, const v_uint16x8& b,\n                                const v_uint16x8& c, const v_uint16x8& d,\n                                hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    // a0 a1 a2 a3 ....\n    // b0 b1 b2 b3 ....\n    // c0 c1 c2 c3 ....\n    // d0 d1 d2 d3 ....\n    v128_t u0 = wasm_unpacklo_i16x8(a.val, c.val); // a0 c0 a1 c1 ...\n    v128_t u1 = wasm_unpackhi_i16x8(a.val, c.val); // a4 c4 a5 c5 ...\n    v128_t u2 = wasm_unpacklo_i16x8(b.val, d.val); // b0 d0 b1 d1 ...\n    v128_t u3 = wasm_unpackhi_i16x8(b.val, d.val); // b4 d4 b5 d5 ...\n\n    v128_t v0 = wasm_unpacklo_i16x8(u0, u2); // a0 b0 c0 d0 ...\n    v128_t v1 = wasm_unpackhi_i16x8(u0, u2); // a2 b2 c2 d2 ...\n    v128_t v2 = wasm_unpacklo_i16x8(u1, u3); // a4 b4 c4 d4 ...\n    v128_t v3 = wasm_unpackhi_i16x8(u1, u3); // a6 b6 c6 d6 ...\n\n    wasm_v128_store(ptr, v0);\n    wasm_v128_store(ptr + 8, v1);\n    wasm_v128_store(ptr + 16, v2);\n    wasm_v128_store(ptr + 24, v3);\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b,\n                                hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t v0 = wasm_unpacklo_i32x4(a.val, b.val);\n    v128_t v1 = wasm_unpackhi_i32x4(a.val, b.val);\n\n    wasm_v128_store(ptr, v0);\n    wasm_v128_store(ptr + 4, v1);\n}\n\ninline void v_store_interleave( unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b,\n                                const v_uint32x4& c, hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t t00 = wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,16,17,18,19,0,0,0,0,4,5,6,7);\n    v128_t t01 = wasm_v8x16_shuffle(a.val, b.val, 20,21,22,23,0,0,0,0,8,9,10,11,24,25,26,27);\n    v128_t t02 = wasm_v8x16_shuffle(a.val, b.val, 0,0,0,0,12,13,14,15,28,29,30,31,0,0,0,0);\n\n    v128_t t10 = wasm_v8x16_shuffle(t00, c.val, 0,1,2,3,4,5,6,7,16,17,18,19,12,13,14,15);\n    v128_t t11 = wasm_v8x16_shuffle(t01, c.val, 0,1,2,3,20,21,22,23,8,9,10,11,12,13,14,15);\n    v128_t t12 = wasm_v8x16_shuffle(t02, c.val, 24,25,26,27,4,5,6,7,8,9,10,11,28,29,30,31);\n\n    wasm_v128_store(ptr, t10);\n    wasm_v128_store(ptr + 4, t11);\n    wasm_v128_store(ptr + 8, t12);\n}\n\ninline void v_store_interleave(unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b,\n                               const v_uint32x4& c, const v_uint32x4& d,\n                               hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v_uint32x4 v0, v1, v2, v3;\n    v_transpose4x4(a, b, c, d, v0, v1, v2, v3);\n\n    wasm_v128_store(ptr, v0.val);\n    wasm_v128_store(ptr + 4, v1.val);\n    wasm_v128_store(ptr + 8, v2.val);\n    wasm_v128_store(ptr + 12, v3.val);\n}\n\n// 2-channel, float only\ninline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b,\n                               hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t v0 = wasm_unpacklo_i32x4(a.val, b.val);\n    v128_t v1 = wasm_unpackhi_i32x4(a.val, b.val);\n\n    wasm_v128_store(ptr, v0);\n    wasm_v128_store(ptr + 4, v1);\n}\n\ninline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b,\n                               const v_float32x4& c, hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t t00 = wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,16,17,18,19,0,0,0,0,4,5,6,7);\n    v128_t t01 = wasm_v8x16_shuffle(a.val, b.val, 20,21,22,23,0,0,0,0,8,9,10,11,24,25,26,27);\n    v128_t t02 = wasm_v8x16_shuffle(a.val, b.val, 0,0,0,0,12,13,14,15,28,29,30,31,0,0,0,0);\n\n    v128_t t10 = wasm_v8x16_shuffle(t00, c.val, 0,1,2,3,4,5,6,7,16,17,18,19,12,13,14,15);\n    v128_t t11 = wasm_v8x16_shuffle(t01, c.val, 0,1,2,3,20,21,22,23,8,9,10,11,12,13,14,15);\n    v128_t t12 = wasm_v8x16_shuffle(t02, c.val, 24,25,26,27,4,5,6,7,8,9,10,11,28,29,30,31);\n\n    wasm_v128_store(ptr, t10);\n    wasm_v128_store(ptr + 4, t11);\n    wasm_v128_store(ptr + 8, t12);\n}\n\ninline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b,\n                               const v_float32x4& c, const v_float32x4& d,\n                               hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v_float32x4 v0, v1, v2, v3;\n    v_transpose4x4(a, b, c, d, v0, v1, v2, v3);\n\n    wasm_v128_store(ptr, v0.val);\n    wasm_v128_store(ptr + 4, v1.val);\n    wasm_v128_store(ptr + 8, v2.val);\n    wasm_v128_store(ptr + 12, v3.val);\n}\n\ninline void v_store_interleave(uint64 *ptr, const v_uint64x2& a, const v_uint64x2& b,\n                               hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t v0 = wasm_unpacklo_i64x2(a.val, b.val);\n    v128_t v1 = wasm_unpackhi_i64x2(a.val, b.val);\n\n    wasm_v128_store(ptr, v0);\n    wasm_v128_store(ptr + 2, v1);\n}\n\ninline void v_store_interleave(uint64 *ptr, const v_uint64x2& a, const v_uint64x2& b,\n                               const v_uint64x2& c, hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t v0 = wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23);\n    v128_t v1 = wasm_v8x16_shuffle(a.val, c.val, 16,17,18,19,20,21,22,23,8,9,10,11,12,13,14,15);\n    v128_t v2 = wasm_v8x16_shuffle(b.val, c.val, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31);\n\n    wasm_v128_store(ptr, v0);\n    wasm_v128_store(ptr + 2, v1);\n    wasm_v128_store(ptr + 4, v2);\n}\n\ninline void v_store_interleave(uint64 *ptr, const v_uint64x2& a, const v_uint64x2& b,\n                               const v_uint64x2& c, const v_uint64x2& d,\n                               hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED)\n{\n    v128_t v0 = wasm_unpacklo_i64x2(a.val, b.val);\n    v128_t v1 = wasm_unpacklo_i64x2(c.val, d.val);\n    v128_t v2 = wasm_unpackhi_i64x2(a.val, b.val);\n    v128_t v3 = wasm_unpackhi_i64x2(c.val, d.val);\n\n    wasm_v128_store(ptr, v0);\n    wasm_v128_store(ptr + 2, v1);\n    wasm_v128_store(ptr + 4, v2);\n    wasm_v128_store(ptr + 6, v3);\n}\n\n#define OPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(_Tpvec0, _Tp0, suffix0, _Tpvec1, _Tp1, suffix1) \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0 ) \\\n{ \\\n    _Tpvec1 a1, b1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n} \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0 ) \\\n{ \\\n    _Tpvec1 a1, b1, c1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n    c0 = v_reinterpret_as_##suffix0(c1); \\\n} \\\ninline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0, _Tpvec0& d0 ) \\\n{ \\\n    _Tpvec1 a1, b1, c1, d1; \\\n    v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1, d1); \\\n    a0 = v_reinterpret_as_##suffix0(a1); \\\n    b0 = v_reinterpret_as_##suffix0(b1); \\\n    c0 = v_reinterpret_as_##suffix0(c1); \\\n    d0 = v_reinterpret_as_##suffix0(d1); \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                hal::StoreMode mode = hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, mode);      \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                const _Tpvec0& c0, hal::StoreMode mode = hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, c1, mode);  \\\n} \\\ninline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \\\n                                const _Tpvec0& c0, const _Tpvec0& d0, \\\n                                hal::StoreMode mode = hal::STORE_UNALIGNED ) \\\n{ \\\n    _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \\\n    _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \\\n    _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \\\n    _Tpvec1 d1 = v_reinterpret_as_##suffix1(d0); \\\n    v_store_interleave((_Tp1*)ptr, a1, b1, c1, d1, mode); \\\n}\n\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_int8x16, schar, s8, v_uint8x16, uchar, u8)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_int16x8, short, s16, v_uint16x8, ushort, u16)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_int32x4, int, s32, v_uint32x4, unsigned, u32)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_int64x2, int64, s64, v_uint64x2, uint64, u64)\nOPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_float64x2, double, f64, v_uint64x2, uint64, u64)\n\ninline v_float32x4 v_cvt_f32(const v_int32x4& a)\n{\n    return v_float32x4(wasm_f32x4_convert_i32x4(a.val));\n}\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a)\n{\n    double a_[2];\n    wasm_v128_store(a_, a.val);\n    float c_[4];\n    c_[0] = (float)(a_[0]);\n    c_[1] = (float)(a_[1]);\n    c_[2] = 0;\n    c_[3] = 0;\n    return v_float32x4(wasm_v128_load(c_));\n}\n\ninline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b)\n{\n    double a_[2], b_[2];\n    wasm_v128_store(a_, a.val);\n    wasm_v128_store(b_, b.val);\n    float c_[4];\n    c_[0] = (float)(a_[0]);\n    c_[1] = (float)(a_[1]);\n    c_[2] = (float)(b_[0]);\n    c_[3] = (float)(b_[1]);\n    return v_float32x4(wasm_v128_load(c_));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int32x4& a)\n{\n#ifdef __wasm_unimplemented_simd128__\n    v128_t p = v128_cvti32x4_i64x2(a.val);\n    return v_float64x2(wasm_f64x2_convert_i64x2(p));\n#else\n    int a_[4];\n    wasm_v128_store(a_, a.val);\n    double c_[2];\n    c_[0] = (double)(a_[0]);\n    c_[1] = (double)(a_[1]);\n    return v_float64x2(wasm_v128_load(c_));\n#endif\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_int32x4& a)\n{\n#ifdef __wasm_unimplemented_simd128__\n    v128_t p = v128_cvti32x4_i64x2_high(a.val);\n    return v_float64x2(wasm_f64x2_convert_i64x2(p));\n#else\n    int a_[4];\n    wasm_v128_store(a_, a.val);\n    double c_[2];\n    c_[0] = (double)(a_[2]);\n    c_[1] = (double)(a_[3]);\n    return v_float64x2(wasm_v128_load(c_));\n#endif\n}\n\ninline v_float64x2 v_cvt_f64(const v_float32x4& a)\n{\n    float a_[4];\n    wasm_v128_store(a_, a.val);\n    double c_[2];\n    c_[0] = (double)(a_[0]);\n    c_[1] = (double)(a_[1]);\n    return v_float64x2(wasm_v128_load(c_));\n}\n\ninline v_float64x2 v_cvt_f64_high(const v_float32x4& a)\n{\n    float a_[4];\n    wasm_v128_store(a_, a.val);\n    double c_[2];\n    c_[0] = (double)(a_[2]);\n    c_[1] = (double)(a_[3]);\n    return v_float64x2(wasm_v128_load(c_));\n}\n\ninline v_float64x2 v_cvt_f64(const v_int64x2& a)\n{\n#ifdef __wasm_unimplemented_simd128__\n    return v_float64x2(wasm_f64x2_convert_i64x2(a.val));\n#else\n    int64 a_[2];\n    wasm_v128_store(a_, a.val);\n    double c_[2];\n    c_[0] = (double)(a_[0]);\n    c_[1] = (double)(a_[1]);\n    return v_float64x2(wasm_v128_load(c_));\n#endif\n}\n\n////////////// Lookup table access ////////////////////\n\ninline v_int8x16 v_lut(const schar* tab, const int* idx)\n{\n    return v_int8x16(tab[idx[0]], tab[idx[1]], tab[idx[ 2]], tab[idx[ 3]], tab[idx[ 4]], tab[idx[ 5]], tab[idx[ 6]], tab[idx[ 7]],\n                     tab[idx[8]], tab[idx[9]], tab[idx[10]], tab[idx[11]], tab[idx[12]], tab[idx[13]], tab[idx[14]], tab[idx[15]]);\n}\ninline v_int8x16 v_lut_pairs(const schar* tab, const int* idx)\n{\n    return v_int8x16(tab[idx[0]], tab[idx[0]+1], tab[idx[1]], tab[idx[1]+1], tab[idx[2]], tab[idx[2]+1], tab[idx[3]], tab[idx[3]+1],\n                     tab[idx[4]], tab[idx[4]+1], tab[idx[5]], tab[idx[5]+1], tab[idx[6]], tab[idx[6]+1], tab[idx[7]], tab[idx[7]+1]);\n}\ninline v_int8x16 v_lut_quads(const schar* tab, const int* idx)\n{\n    return v_int8x16(tab[idx[0]], tab[idx[0]+1], tab[idx[0]+2], tab[idx[0]+3], tab[idx[1]], tab[idx[1]+1], tab[idx[1]+2], tab[idx[1]+3],\n                     tab[idx[2]], tab[idx[2]+1], tab[idx[2]+2], tab[idx[2]+3], tab[idx[3]], tab[idx[3]+1], tab[idx[3]+2], tab[idx[3]+3]);\n}\ninline v_uint8x16 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((const schar *)tab, idx)); }\ninline v_uint8x16 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((const schar *)tab, idx)); }\ninline v_uint8x16 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((const schar *)tab, idx)); }\n\ninline v_int16x8 v_lut(const short* tab, const int* idx)\n{\n    return v_int16x8(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]],\n                     tab[idx[4]], tab[idx[5]], tab[idx[6]], tab[idx[7]]);\n}\ninline v_int16x8 v_lut_pairs(const short* tab, const int* idx)\n{\n    return v_int16x8(tab[idx[0]], tab[idx[0]+1], tab[idx[1]], tab[idx[1]+1],\n                     tab[idx[2]], tab[idx[2]+1], tab[idx[3]], tab[idx[3]+1]);\n}\ninline v_int16x8 v_lut_quads(const short* tab, const int* idx)\n{\n    return v_int16x8(tab[idx[0]], tab[idx[0]+1], tab[idx[0]+2], tab[idx[0]+3],\n                     tab[idx[1]], tab[idx[1]+1], tab[idx[1]+2], tab[idx[1]+3]);\n}\ninline v_uint16x8 v_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut((const short *)tab, idx)); }\ninline v_uint16x8 v_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_pairs((const short *)tab, idx)); }\ninline v_uint16x8 v_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_quads((const short *)tab, idx)); }\n\ninline v_int32x4 v_lut(const int* tab, const int* idx)\n{\n    return v_int32x4(tab[idx[0]], tab[idx[1]],\n                     tab[idx[2]], tab[idx[3]]);\n}\ninline v_int32x4 v_lut_pairs(const int* tab, const int* idx)\n{\n    return v_int32x4(tab[idx[0]], tab[idx[0]+1],\n                     tab[idx[1]], tab[idx[1]+1]);\n}\ninline v_int32x4 v_lut_quads(const int* tab, const int* idx)\n{\n    return v_int32x4(wasm_v128_load(tab + idx[0]));\n}\ninline v_uint32x4 v_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut((const int *)tab, idx)); }\ninline v_uint32x4 v_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_pairs((const int *)tab, idx)); }\ninline v_uint32x4 v_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_quads((const int *)tab, idx)); }\n\ninline v_int64x2 v_lut(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(tab[idx[0]], tab[idx[1]]);\n}\ninline v_int64x2 v_lut_pairs(const int64_t* tab, const int* idx)\n{\n    return v_int64x2(wasm_v128_load(tab + idx[0]));\n}\ninline v_uint64x2 v_lut(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut((const int64_t *)tab, idx)); }\ninline v_uint64x2 v_lut_pairs(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut_pairs((const int64_t *)tab, idx)); }\n\ninline v_float32x4 v_lut(const float* tab, const int* idx)\n{\n    return v_float32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]);\n}\ninline v_float32x4 v_lut_pairs(const float* tab, const int* idx) { return v_reinterpret_as_f32(v_lut_pairs((const int *)tab, idx)); }\ninline v_float32x4 v_lut_quads(const float* tab, const int* idx) { return v_reinterpret_as_f32(v_lut_quads((const int *)tab, idx)); }\n\ninline v_float64x2 v_lut(const double* tab, const int* idx)\n{\n    return v_float64x2(tab[idx[0]], tab[idx[1]]);\n}\ninline v_float64x2 v_lut_pairs(const double* tab, const int* idx)\n{\n    return v_float64x2(wasm_v128_load(tab + idx[0]));\n}\n\ninline v_int32x4 v_lut(const int* tab, const v_int32x4& idxvec)\n{\n    return v_int32x4(tab[wasm_i32x4_extract_lane(idxvec.val, 0)],\n                     tab[wasm_i32x4_extract_lane(idxvec.val, 1)],\n                     tab[wasm_i32x4_extract_lane(idxvec.val, 2)],\n                     tab[wasm_i32x4_extract_lane(idxvec.val, 3)]);\n}\n\ninline v_uint32x4 v_lut(const unsigned* tab, const v_int32x4& idxvec)\n{\n    return v_reinterpret_as_u32(v_lut((const int *)tab, idxvec));\n}\n\ninline v_float32x4 v_lut(const float* tab, const v_int32x4& idxvec)\n{\n    return v_float32x4(tab[wasm_i32x4_extract_lane(idxvec.val, 0)],\n                       tab[wasm_i32x4_extract_lane(idxvec.val, 1)],\n                       tab[wasm_i32x4_extract_lane(idxvec.val, 2)],\n                       tab[wasm_i32x4_extract_lane(idxvec.val, 3)]);\n}\n\ninline v_float64x2 v_lut(const double* tab, const v_int32x4& idxvec)\n{\n    return v_float64x2(tab[wasm_i32x4_extract_lane(idxvec.val, 0)],\n                       tab[wasm_i32x4_extract_lane(idxvec.val, 1)]);\n}\n\n// loads pairs from the table and deinterleaves them, e.g. returns:\n//   x = (tab[idxvec[0], tab[idxvec[1]], tab[idxvec[2]], tab[idxvec[3]]),\n//   y = (tab[idxvec[0]+1], tab[idxvec[1]+1], tab[idxvec[2]+1], tab[idxvec[3]+1])\n// note that the indices are float's indices, not the float-pair indices.\n// in theory, this function can be used to implement bilinear interpolation,\n// when idxvec are the offsets within the image.\ninline void v_lut_deinterleave(const float* tab, const v_int32x4& idxvec, v_float32x4& x, v_float32x4& y)\n{\n    x = v_float32x4(tab[wasm_i32x4_extract_lane(idxvec.val, 0)],\n                    tab[wasm_i32x4_extract_lane(idxvec.val, 1)],\n                    tab[wasm_i32x4_extract_lane(idxvec.val, 2)],\n                    tab[wasm_i32x4_extract_lane(idxvec.val, 3)]);\n    y = v_float32x4(tab[wasm_i32x4_extract_lane(idxvec.val, 0)+1],\n                    tab[wasm_i32x4_extract_lane(idxvec.val, 1)+1],\n                    tab[wasm_i32x4_extract_lane(idxvec.val, 2)+1],\n                    tab[wasm_i32x4_extract_lane(idxvec.val, 3)+1]);\n}\n\ninline void v_lut_deinterleave(const double* tab, const v_int32x4& idxvec, v_float64x2& x, v_float64x2& y)\n{\n    v128_t xy0 = wasm_v128_load(tab + wasm_i32x4_extract_lane(idxvec.val, 0));\n    v128_t xy1 = wasm_v128_load(tab + wasm_i32x4_extract_lane(idxvec.val, 1));\n    x.val = wasm_unpacklo_i64x2(xy0, xy1);\n    y.val = wasm_unpacklo_i64x2(xy0, xy1);\n}\n\ninline v_int8x16 v_interleave_pairs(const v_int8x16& vec)\n{\n    return v_int8x16(wasm_v8x16_shuffle(vec.val, vec.val, 0,2,1,3,4,6,5,7,8,10,9,11,12,14,13,15));\n}\ninline v_uint8x16 v_interleave_pairs(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); }\ninline v_int8x16 v_interleave_quads(const v_int8x16& vec)\n{\n    return v_int8x16(wasm_v8x16_shuffle(vec.val, vec.val, 0,4,1,5,2,6,3,7,8,12,9,13,10,14,11,15));\n}\ninline v_uint8x16 v_interleave_quads(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_interleave_pairs(const v_int16x8& vec)\n{\n    return v_int16x8(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,4,5,2,3,6,7,8,9,12,13,10,11,14,15));\n}\ninline v_uint16x8 v_interleave_pairs(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); }\ninline v_int16x8 v_interleave_quads(const v_int16x8& vec)\n{\n    return v_int16x8(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,8,9,2,3,10,11,4,5,12,13,6,7,14,15));\n}\ninline v_uint16x8 v_interleave_quads(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_interleave_pairs(const v_int32x4& vec)\n{\n    return v_int32x4(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,2,3,8,9,10,11,4,5,6,7,12,13,14,15));\n}\ninline v_uint32x4 v_interleave_pairs(const v_uint32x4& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); }\ninline v_float32x4 v_interleave_pairs(const v_float32x4& vec)\n{\n    return v_float32x4(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,2,3,8,9,10,11,4,5,6,7,12,13,14,15));\n}\n\ninline v_int8x16 v_pack_triplets(const v_int8x16& vec)\n{\n    return v_int8x16(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,2,4,5,6,8,9,10,12,13,14,16,16,16,16));\n}\ninline v_uint8x16 v_pack_triplets(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); }\n\ninline v_int16x8 v_pack_triplets(const v_int16x8& vec)\n{\n    return v_int16x8(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,2,3,4,5,8,9,10,11,12,13,14,15,6,7));\n}\ninline v_uint16x8 v_pack_triplets(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); }\n\ninline v_int32x4 v_pack_triplets(const v_int32x4& vec) { return vec; }\ninline v_uint32x4 v_pack_triplets(const v_uint32x4& vec) { return vec; }\ninline v_float32x4 v_pack_triplets(const v_float32x4& vec) { return vec; }\n\ntemplate<int i, typename _Tp>\ninline typename _Tp::lane_type v_extract_n(const _Tp& a)\n{\n    return v_rotate_right<i>(a).get0();\n}\n\ntemplate<int i>\ninline v_uint32x4 v_broadcast_element(const v_uint32x4& a)\n{\n    return v_setall_u32(v_extract_n<i>(a));\n}\ntemplate<int i>\ninline v_int32x4 v_broadcast_element(const v_int32x4& a)\n{\n    return v_setall_s32(v_extract_n<i>(a));\n}\ntemplate<int i>\ninline v_float32x4 v_broadcast_element(const v_float32x4& a)\n{\n    return v_setall_f32(v_extract_n<i>(a));\n}\n\n\n////////////// FP16 support ///////////////////////////\n\ninline v_float32x4 v_load_expand(const float16_t* ptr)\n{\n    float a[4];\n    for (int i = 0; i < 4; i++)\n        a[i] = ptr[i];\n    return v_float32x4(wasm_v128_load(a));\n}\n\ninline void v_pack_store(float16_t* ptr, const v_float32x4& v)\n{\n    double v_[4];\n    wasm_v128_store(v_, v.val);\n    ptr[0] = float16_t(v_[0]);\n    ptr[1] = float16_t(v_[1]);\n    ptr[2] = float16_t(v_[2]);\n    ptr[3] = float16_t(v_[3]);\n}\n\ninline void v_cleanup() {}\n\nCV_CPU_OPTIMIZATION_HAL_NAMESPACE_END\n\n//! @endcond\n\n}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/msa_macros.h",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_HAL_MSA_MACROS_H\n#define OPENCV_CORE_HAL_MSA_MACROS_H\n\n#ifdef __mips_msa\n#include \"msa.h\"\n#include <stdint.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* Define 64 bits vector types */\ntypedef signed char v8i8 __attribute__ ((vector_size(8), aligned(8)));\ntypedef unsigned char v8u8 __attribute__ ((vector_size(8), aligned(8)));\ntypedef short v4i16 __attribute__ ((vector_size(8), aligned(8)));\ntypedef unsigned short v4u16 __attribute__ ((vector_size(8), aligned(8)));\ntypedef int v2i32 __attribute__ ((vector_size(8), aligned(8)));\ntypedef unsigned int v2u32 __attribute__ ((vector_size(8), aligned(8)));\ntypedef long long v1i64 __attribute__ ((vector_size(8), aligned(8)));\ntypedef unsigned long long v1u64 __attribute__ ((vector_size(8), aligned(8)));\ntypedef float v2f32 __attribute__ ((vector_size(8), aligned(8)));\ntypedef double v1f64 __attribute__ ((vector_size(8), aligned(8)));\n\n\n/* Load values from the given memory a 64-bit vector. */\n#define msa_ld1_s8(__a)  (*((v8i8*)(__a)))\n#define msa_ld1_s16(__a) (*((v4i16*)(__a)))\n#define msa_ld1_s32(__a) (*((v2i32*)(__a)))\n#define msa_ld1_s64(__a) (*((v1i64*)(__a)))\n#define msa_ld1_u8(__a)  (*((v8u8*)(__a)))\n#define msa_ld1_u16(__a) (*((v4u16*)(__a)))\n#define msa_ld1_u32(__a) (*((v2u32*)(__a)))\n#define msa_ld1_u64(__a) (*((v1u64*)(__a)))\n#define msa_ld1_f32(__a) (*((v2f32*)(__a)))\n#define msa_ld1_f64(__a) (*((v1f64*)(__a)))\n\n/* Load values from the given memory address to a 128-bit vector */\n#define msa_ld1q_s8(__a)  ((v16i8)__builtin_msa_ld_b(__a, 0))\n#define msa_ld1q_s16(__a) ((v8i16)__builtin_msa_ld_h(__a, 0))\n#define msa_ld1q_s32(__a) ((v4i32)__builtin_msa_ld_w(__a, 0))\n#define msa_ld1q_s64(__a) ((v2i64)__builtin_msa_ld_d(__a, 0))\n#define msa_ld1q_u8(__a)  ((v16u8)__builtin_msa_ld_b(__a, 0))\n#define msa_ld1q_u16(__a) ((v8u16)__builtin_msa_ld_h(__a, 0))\n#define msa_ld1q_u32(__a) ((v4u32)__builtin_msa_ld_w(__a, 0))\n#define msa_ld1q_u64(__a) ((v2u64)__builtin_msa_ld_d(__a, 0))\n#define msa_ld1q_f32(__a) ((v4f32)__builtin_msa_ld_w(__a, 0))\n#define msa_ld1q_f64(__a) ((v2f64)__builtin_msa_ld_d(__a, 0))\n\n/* Store 64bits vector elements values to the given memory address. */\n#define msa_st1_s8(__a, __b)  (*((v8i8*)(__a)) = __b)\n#define msa_st1_s16(__a, __b) (*((v4i16*)(__a)) = __b)\n#define msa_st1_s32(__a, __b) (*((v2i32*)(__a)) = __b)\n#define msa_st1_s64(__a, __b) (*((v1i64*)(__a)) = __b)\n#define msa_st1_u8(__a, __b)  (*((v8u8*)(__a)) = __b)\n#define msa_st1_u16(__a, __b) (*((v4u16*)(__a)) = __b)\n#define msa_st1_u32(__a, __b) (*((v2u32*)(__a)) = __b)\n#define msa_st1_u64(__a, __b) (*((v1u64*)(__a)) = __b)\n#define msa_st1_f32(__a, __b) (*((v2f32*)(__a)) = __b)\n#define msa_st1_f64(__a, __b) (*((v1f64*)(__a)) = __b)\n\n/* Store the values of elements in the 128 bits vector __a to the given memory address __a. */\n#define msa_st1q_s8(__a, __b)  (__builtin_msa_st_b((v16i8)(__b), __a, 0))\n#define msa_st1q_s16(__a, __b) (__builtin_msa_st_h((v8i16)(__b), __a, 0))\n#define msa_st1q_s32(__a, __b) (__builtin_msa_st_w((v4i32)(__b), __a, 0))\n#define msa_st1q_s64(__a, __b) (__builtin_msa_st_d((v2i64)(__b), __a, 0))\n#define msa_st1q_u8(__a, __b)  (__builtin_msa_st_b((v16i8)(__b), __a, 0))\n#define msa_st1q_u16(__a, __b) (__builtin_msa_st_h((v8i16)(__b), __a, 0))\n#define msa_st1q_u32(__a, __b) (__builtin_msa_st_w((v4i32)(__b), __a, 0))\n#define msa_st1q_u64(__a, __b) (__builtin_msa_st_d((v2i64)(__b), __a, 0))\n#define msa_st1q_f32(__a, __b) (__builtin_msa_st_w((v4i32)(__b), __a, 0))\n#define msa_st1q_f64(__a, __b) (__builtin_msa_st_d((v2i64)(__b), __a, 0))\n\n/* Store the value of the element with the index __c in vector __a to the given memory address __a. */\n#define msa_st1_lane_s8(__a, __b, __c)   (*((int8_t*)(__a)) = __b[__c])\n#define msa_st1_lane_s16(__a, __b, __c)  (*((int16_t*)(__a)) = __b[__c])\n#define msa_st1_lane_s32(__a, __b, __c)  (*((int32_t*)(__a)) = __b[__c])\n#define msa_st1_lane_s64(__a, __b, __c)  (*((int64_t*)(__a)) = __b[__c])\n#define msa_st1_lane_u8(__a, __b, __c)   (*((uint8_t*)(__a)) = __b[__c])\n#define msa_st1_lane_u16(__a, __b, __c)  (*((uint16_t*)(__a)) = __b[__c])\n#define msa_st1_lane_u32(__a, __b, __c)  (*((uint32_t*)(__a)) = __b[__c])\n#define msa_st1_lane_u64(__a, __b, __c)  (*((uint64_t*)(__a)) = __b[__c])\n#define msa_st1_lane_f32(__a, __b, __c)  (*((float*)(__a)) = __b[__c])\n#define msa_st1_lane_f64(__a, __b, __c)  (*((double*)(__a)) = __b[__c])\n#define msa_st1q_lane_s8(__a, __b, __c)  (*((int8_t*)(__a)) = (int8_t)__builtin_msa_copy_s_b(__b, __c))\n#define msa_st1q_lane_s16(__a, __b, __c) (*((int16_t*)(__a)) = (int16_t)__builtin_msa_copy_s_h(__b, __c))\n#define msa_st1q_lane_s32(__a, __b, __c) (*((int32_t*)(__a)) = __builtin_msa_copy_s_w(__b, __c))\n#define msa_st1q_lane_s64(__a, __b, __c) (*((int64_t*)(__a)) = __builtin_msa_copy_s_d(__b, __c))\n#define msa_st1q_lane_u8(__a, __b, __c)  (*((uint8_t*)(__a)) = (uint8_t)__builtin_msa_copy_u_b((v16i8)(__b), __c))\n#define msa_st1q_lane_u16(__a, __b, __c) (*((uint16_t*)(__a)) = (uint16_t)__builtin_msa_copy_u_h((v8i16)(__b), __c))\n#define msa_st1q_lane_u32(__a, __b, __c) (*((uint32_t*)(__a)) = __builtin_msa_copy_u_w((v4i32)(__b), __c))\n#define msa_st1q_lane_u64(__a, __b, __c) (*((uint64_t*)(__a)) = __builtin_msa_copy_u_d((v2i64)(__b), __c))\n#define msa_st1q_lane_f32(__a, __b, __c) (*((float*)(__a)) = __b[__c])\n#define msa_st1q_lane_f64(__a, __b, __c) (*((double*)(__a)) = __b[__c])\n\n/* Duplicate elements for 64-bit doubleword vectors */\n#define msa_dup_n_s8(__a)  ((v8i8)__builtin_msa_copy_s_d((v2i64)__builtin_msa_fill_b((int32_t)(__a)), 0))\n#define msa_dup_n_s16(__a) ((v4i16)__builtin_msa_copy_s_d((v2i64)__builtin_msa_fill_h((int32_t)(__a)), 0))\n#define msa_dup_n_s32(__a) ((v2i32){__a, __a})\n#define msa_dup_n_s64(__a) ((v1i64){__a})\n#define msa_dup_n_u8(__a)  ((v8u8)__builtin_msa_copy_u_d((v2i64)__builtin_msa_fill_b((int32_t)(__a)), 0))\n#define msa_dup_n_u16(__a) ((v4u16)__builtin_msa_copy_u_d((v2i64)__builtin_msa_fill_h((int32_t)(__a)), 0))\n#define msa_dup_n_u32(__a) ((v2u32){__a, __a})\n#define msa_dup_n_u64(__a) ((v1u64){__a})\n#define msa_dup_n_f32(__a) ((v2f32){__a, __a})\n#define msa_dup_n_f64(__a) ((v1f64){__a})\n\n/* Duplicate elements for 128-bit quadword vectors */\n#define msa_dupq_n_s8(__a)  (__builtin_msa_fill_b((int32_t)(__a)))\n#define msa_dupq_n_s16(__a) (__builtin_msa_fill_h((int32_t)(__a)))\n#define msa_dupq_n_s32(__a) (__builtin_msa_fill_w((int32_t)(__a)))\n#define msa_dupq_n_s64(__a) (__builtin_msa_fill_d((int64_t)(__a)))\n#define msa_dupq_n_u8(__a)  ((v16u8)__builtin_msa_fill_b((int32_t)(__a)))\n#define msa_dupq_n_u16(__a) ((v8u16)__builtin_msa_fill_h((int32_t)(__a)))\n#define msa_dupq_n_u32(__a) ((v4u32)__builtin_msa_fill_w((int32_t)(__a)))\n#define msa_dupq_n_u64(__a) ((v2u64)__builtin_msa_fill_d((int64_t)(__a)))\n#define msa_dupq_n_f32(__a) ((v4f32){__a, __a, __a, __a})\n#define msa_dupq_n_f64(__a) ((v2f64){__a, __a})\n#define msa_dupq_lane_s8(__a, __b)  (__builtin_msa_splat_b(__a, __b))\n#define msa_dupq_lane_s16(__a, __b) (__builtin_msa_splat_h(__a, __b))\n#define msa_dupq_lane_s32(__a, __b) (__builtin_msa_splat_w(__a, __b))\n#define msa_dupq_lane_s64(__a, __b) (__builtin_msa_splat_d(__a, __b))\n#define msa_dupq_lane_u8(__a, __b)  ((v16u8)__builtin_msa_splat_b((v16i8)(__a), __b))\n#define msa_dupq_lane_u16(__a, __b) ((v8u16)__builtin_msa_splat_h((v8i16)(__a), __b))\n#define msa_dupq_lane_u32(__a, __b) ((v4u32)__builtin_msa_splat_w((v4i32)(__a), __b))\n#define msa_dupq_lane_u64(__a, __b) ((v2u64)__builtin_msa_splat_d((v2i64)(__a), __b))\n\n/* Create a 64 bits vector */\n#define msa_create_s8(__a)  ((v8i8)((uint64_t)(__a)))\n#define msa_create_s16(__a) ((v4i16)((uint64_t)(__a)))\n#define msa_create_s32(__a) ((v2i32)((uint64_t)(__a)))\n#define msa_create_s64(__a) ((v1i64)((uint64_t)(__a)))\n#define msa_create_u8(__a)  ((v8u8)((uint64_t)(__a)))\n#define msa_create_u16(__a) ((v4u16)((uint64_t)(__a)))\n#define msa_create_u32(__a) ((v2u32)((uint64_t)(__a)))\n#define msa_create_u64(__a) ((v1u64)((uint64_t)(__a)))\n#define msa_create_f32(__a) ((v2f32)((uint64_t)(__a)))\n#define msa_create_f64(__a) ((v1f64)((uint64_t)(__a)))\n\n/* Sign extends or zero extends each element in a 64 bits vector to twice its original length, and places the results in a 128 bits vector. */\n/*Transform v8i8 to v8i16*/\n#define msa_movl_s8(__a) \\\n((v8i16){(__a)[0], (__a)[1], (__a)[2], (__a)[3], \\\n         (__a)[4], (__a)[5], (__a)[6], (__a)[7]})\n\n/*Transform v8u8 to v8u16*/\n#define msa_movl_u8(__a) \\\n((v8u16){(__a)[0], (__a)[1], (__a)[2], (__a)[3], \\\n         (__a)[4], (__a)[5], (__a)[6], (__a)[7]})\n\n/*Transform v4i16 to v8i16*/\n#define msa_movl_s16(__a) ((v4i32){(__a)[0], (__a)[1], (__a)[2], (__a)[3]})\n\n/*Transform v2i32 to v4i32*/\n#define msa_movl_s32(__a) ((v2i64){(__a)[0], (__a)[1]})\n\n/*Transform v4u16 to v8u16*/\n#define msa_movl_u16(__a) ((v4u32){(__a)[0], (__a)[1], (__a)[2], (__a)[3]})\n\n/*Transform v2u32 to v4u32*/\n#define msa_movl_u32(__a) ((v2u64){(__a)[0], (__a)[1]})\n\n/* Copies the least significant half of each element of a 128 bits vector into the corresponding elements of a 64 bits vector. */\n#define msa_movn_s16(__a) \\\n({ \\\n  v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)(__a)); \\\n  (v8i8)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_movn_s32(__a) \\\n({ \\\n  v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)(__a)); \\\n  (v4i16)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_movn_s64(__a) \\\n({ \\\n  v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)(__a)); \\\n  (v2i32)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_movn_u16(__a) \\\n({ \\\n  v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)(__a)); \\\n  (v8u8)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n#define msa_movn_u32(__a) \\\n({ \\\n  v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)(__a)); \\\n  (v4u16)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n#define msa_movn_u64(__a) \\\n({ \\\n  v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)(__a)); \\\n  (v2u32)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n/* qmovn */\n#define msa_qmovn_s16(__a) \\\n({ \\\n  v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_s_h((v8i16)(__a), 7)); \\\n  (v8i8)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_qmovn_s32(__a) \\\n({ \\\n  v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_sat_s_w((v4i32)(__a), 15)); \\\n  (v4i16)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_qmovn_s64(__a) \\\n({ \\\n  v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_sat_s_d((v2i64)(__a), 31)); \\\n  (v2i32)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_qmovn_u16(__a) \\\n({ \\\n  v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_u_h((v8u16)(__a), 7)); \\\n  (v8u8)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n#define msa_qmovn_u32(__a) \\\n({ \\\n  v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_sat_u_w((v4u32)(__a), 15)); \\\n  (v4u16)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n#define msa_qmovn_u64(__a) \\\n({ \\\n  v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_sat_u_d((v2u64)(__a), 31)); \\\n  (v2u32)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n/* qmovun */\n#define msa_qmovun_s16(__a) \\\n({ \\\n  v8i16 __d = __builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a)); \\\n  v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_u_h((v8u16)__d, 7)); \\\n  (v8u8)__builtin_msa_copy_u_d((v2i64)__e, 0); \\\n})\n\n#define msa_qmovun_s32(__a) \\\n({ \\\n  v4i32 __d = __builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a)); \\\n  v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_sat_u_w((v4u32)__d, 15)); \\\n  (v4u16)__builtin_msa_copy_u_d((v2i64)__e, 0); \\\n})\n\n#define msa_qmovun_s64(__a) \\\n({ \\\n  v2i64 __d = __builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a)); \\\n  v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_sat_u_d((v2u64)__d, 31)); \\\n  (v2u32)__builtin_msa_copy_u_d((v2i64)__e, 0); \\\n})\n\n/* Right shift elements in a 128 bits vector by an immediate value, and places the results in a 64 bits vector. */\n#define msa_shrn_n_s16(__a, __b) \\\n({ \\\n  v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_srai_h((v8i16)(__a), (int)(__b))); \\\n  (v8i8)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_shrn_n_s32(__a, __b) \\\n({ \\\n  v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_srai_w((v4i32)(__a), (int)(__b))); \\\n  (v4i16)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_shrn_n_s64(__a, __b) \\\n({ \\\n  v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_srai_d((v2i64)(__a), (int)(__b))); \\\n  (v2i32)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_shrn_n_u16(__a, __b) \\\n({ \\\n  v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_srli_h((v8i16)(__a), (int)(__b))); \\\n  (v8u8)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n#define msa_shrn_n_u32(__a, __b) \\\n({ \\\n  v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_srli_w((v4i32)(__a), (int)(__b))); \\\n  (v4u16)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n#define msa_shrn_n_u64(__a, __b) \\\n({ \\\n  v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_srli_d((v2i64)(__a), (int)(__b))); \\\n  (v2u32)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n/* Right shift elements in a 128 bits vector by an immediate value, and places the results in a 64 bits vector. */\n#define msa_rshrn_n_s16(__a, __b) \\\n({ \\\n  v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_srari_h((v8i16)(__a), (int)__b)); \\\n  (v8i8)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_rshrn_n_s32(__a, __b) \\\n({ \\\n  v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_srari_w((v4i32)(__a), (int)__b)); \\\n  (v4i16)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_rshrn_n_s64(__a, __b) \\\n({ \\\n  v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_srari_d((v2i64)(__a), (int)__b)); \\\n  (v2i32)__builtin_msa_copy_s_d((v2i64)__d, 0); \\\n})\n\n#define msa_rshrn_n_u16(__a, __b) \\\n({ \\\n  v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_srlri_h((v8i16)(__a), (int)__b)); \\\n  (v8u8)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n#define msa_rshrn_n_u32(__a, __b) \\\n({ \\\n  v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_srlri_w((v4i32)(__a), (int)__b)); \\\n  (v4u16)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n#define msa_rshrn_n_u64(__a, __b) \\\n({ \\\n  v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_srlri_d((v2i64)(__a), (int)__b)); \\\n  (v2u32)__builtin_msa_copy_u_d((v2i64)__d, 0); \\\n})\n\n/* Right shift elements in a 128 bits vector by an immediate value, saturate the results and them in a 64 bits vector. */\n#define msa_qrshrn_n_s16(__a, __b) \\\n({ \\\n  v8i16 __d = __builtin_msa_sat_s_h(__builtin_msa_srari_h((v8i16)(__a), (int)(__b)), 7); \\\n  v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__d); \\\n  (v8i8)__builtin_msa_copy_s_d((v2i64)__e, 0); \\\n})\n\n#define msa_qrshrn_n_s32(__a, __b) \\\n({ \\\n  v4i32 __d = __builtin_msa_sat_s_w(__builtin_msa_srari_w((v4i32)(__a), (int)(__b)), 15); \\\n  v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__d); \\\n  (v4i16)__builtin_msa_copy_s_d((v2i64)__e, 0); \\\n})\n\n#define msa_qrshrn_n_s64(__a, __b) \\\n({ \\\n  v2i64 __d = __builtin_msa_sat_s_d(__builtin_msa_srari_d((v2i64)(__a), (int)(__b)), 31); \\\n  v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__d); \\\n  (v2i32)__builtin_msa_copy_s_d((v2i64)__e, 0); \\\n})\n\n#define msa_qrshrn_n_u16(__a, __b) \\\n({ \\\n  v8u16 __d = __builtin_msa_sat_u_h((v8u16)__builtin_msa_srlri_h((v8i16)(__a), (int)(__b)), 7); \\\n  v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__d); \\\n  (v8u8)__builtin_msa_copy_u_d((v2i64)__e, 0); \\\n})\n\n#define msa_qrshrn_n_u32(__a, __b) \\\n({ \\\n  v4u32 __d = __builtin_msa_sat_u_w((v4u32)__builtin_msa_srlri_w((v4i32)(__a), (int)(__b)), 15); \\\n  v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__d); \\\n  (v4u16)__builtin_msa_copy_u_d((v2i64)__e, 0); \\\n})\n\n#define msa_qrshrn_n_u64(__a, __b) \\\n({ \\\n  v2u64 __d = __builtin_msa_sat_u_d((v2u64)__builtin_msa_srlri_d((v2i64)(__a), (int)(__b)), 31); \\\n  v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__d); \\\n  (v2u32)__builtin_msa_copy_u_d((v2i64)__e, 0); \\\n})\n\n/* Right shift elements in a 128 bits vector by an immediate value, saturate the results and them in a 64 bits vector.\n   Input is signed and output is unsigned. */\n#define msa_qrshrun_n_s16(__a, __b) \\\n({ \\\n  v8i16 __d = __builtin_msa_srlri_h(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a)), (int)(__b)); \\\n  v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_u_h((v8u16)__d, 7)); \\\n  (v8u8)__builtin_msa_copy_u_d((v2i64)__e, 0); \\\n})\n\n#define msa_qrshrun_n_s32(__a, __b) \\\n({ \\\n  v4i32 __d = __builtin_msa_srlri_w(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a)), (int)(__b)); \\\n  v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_sat_u_w((v4u32)__d, 15)); \\\n  (v4u16)__builtin_msa_copy_u_d((v2i64)__e, 0); \\\n})\n\n#define msa_qrshrun_n_s64(__a, __b) \\\n({ \\\n  v2i64 __d = __builtin_msa_srlri_d(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a)), (int)(__b)); \\\n  v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_sat_u_d((v2u64)__d, 31)); \\\n  (v2u32)__builtin_msa_copy_u_d((v2i64)__e, 0); \\\n})\n\n/* pack */\n#define msa_pack_s16(__a, __b) (__builtin_msa_pckev_b((v16i8)(__b), (v16i8)(__a)))\n#define msa_pack_s32(__a, __b) (__builtin_msa_pckev_h((v8i16)(__b), (v8i16)(__a)))\n#define msa_pack_s64(__a, __b) (__builtin_msa_pckev_w((v4i32)(__b), (v4i32)(__a)))\n#define msa_pack_u16(__a, __b) ((v16u8)__builtin_msa_pckev_b((v16i8)(__b), (v16i8)(__a)))\n#define msa_pack_u32(__a, __b) ((v8u16)__builtin_msa_pckev_h((v8i16)(__b), (v8i16)(__a)))\n#define msa_pack_u64(__a, __b) ((v4u32)__builtin_msa_pckev_w((v4i32)(__b), (v4i32)(__a)))\n\n/* qpack */\n#define msa_qpack_s16(__a, __b) \\\n(__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_s_h((v8i16)(__b), 7), (v16i8)__builtin_msa_sat_s_h((v8i16)(__a), 7)))\n#define msa_qpack_s32(__a, __b) \\\n(__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_s_w((v4i32)(__b), 15), (v8i16)__builtin_msa_sat_s_w((v4i32)(__a), 15)))\n#define msa_qpack_s64(__a, __b) \\\n(__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_s_d((v2i64)(__b), 31), (v4i32)__builtin_msa_sat_s_d((v2i64)(__a), 31)))\n#define msa_qpack_u16(__a, __b) \\\n((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_u_h((v8u16)(__b), 7), (v16i8)__builtin_msa_sat_u_h((v8u16)(__a), 7)))\n#define msa_qpack_u32(__a, __b) \\\n((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_u_w((v4u32)(__b), 15), (v8i16)__builtin_msa_sat_u_w((v4u32)(__a), 15)))\n#define msa_qpack_u64(__a, __b) \\\n((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_u_d((v2u64)(__b), 31), (v4i32)__builtin_msa_sat_u_d((v2u64)(__a), 31)))\n\n/* qpacku */\n#define msa_qpacku_s16(__a, __b) \\\n((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_u_h((v8u16)(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__b))), 7), \\\n                              (v16i8)__builtin_msa_sat_u_h((v8u16)(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a))), 7)))\n#define msa_qpacku_s32(__a, __b) \\\n((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_u_w((v4u32)(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__b))), 15), \\\n                              (v8i16)__builtin_msa_sat_u_w((v4u32)(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a))), 15)))\n#define msa_qpacku_s64(__a, __b) \\\n((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_u_d((v2u64)(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__b))), 31), \\\n                              (v4i32)__builtin_msa_sat_u_d((v2u64)(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a))), 31)))\n\n/* packr */\n#define msa_packr_s16(__a, __b, __c) \\\n(__builtin_msa_pckev_b((v16i8)__builtin_msa_srai_h((v8i16)(__b), (int)(__c)), (v16i8)__builtin_msa_srai_h((v8i16)(__a), (int)(__c))))\n#define msa_packr_s32(__a, __b, __c) \\\n(__builtin_msa_pckev_h((v8i16)__builtin_msa_srai_w((v4i32)(__b), (int)(__c)), (v8i16)__builtin_msa_srai_w((v4i32)(__a), (int)(__c))))\n#define msa_packr_s64(__a, __b, __c) \\\n(__builtin_msa_pckev_w((v4i32)__builtin_msa_srai_d((v2i64)(__b), (int)(__c)), (v4i32)__builtin_msa_srai_d((v2i64)(__a), (int)(__c))))\n#define msa_packr_u16(__a, __b, __c) \\\n((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_srli_h((v8i16)(__b), (int)(__c)), (v16i8)__builtin_msa_srli_h((v8i16)(__a), (int)(__c))))\n#define msa_packr_u32(__a, __b, __c) \\\n((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_srli_w((v4i32)(__b), (int)(__c)), (v8i16)__builtin_msa_srli_w((v4i32)(__a), (int)(__c))))\n#define msa_packr_u64(__a, __b, __c) \\\n((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_srli_d((v2i64)(__b), (int)(__c)), (v4i32)__builtin_msa_srli_d((v2i64)(__a), (int)(__c))))\n\n/* rpackr */\n#define msa_rpackr_s16(__a, __b, __c) \\\n(__builtin_msa_pckev_b((v16i8)__builtin_msa_srari_h((v8i16)(__b), (int)(__c)), (v16i8)__builtin_msa_srari_h((v8i16)(__a), (int)(__c))))\n#define msa_rpackr_s32(__a, __b, __c) \\\n(__builtin_msa_pckev_h((v8i16)__builtin_msa_srari_w((v4i32)(__b), (int)(__c)), (v8i16)__builtin_msa_srari_w((v4i32)(__a), (int)(__c))))\n#define msa_rpackr_s64(__a, __b, __c) \\\n(__builtin_msa_pckev_w((v4i32)__builtin_msa_srari_d((v2i64)(__b), (int)(__c)), (v4i32)__builtin_msa_srari_d((v2i64)(__a), (int)(__c))))\n#define msa_rpackr_u16(__a, __b, __c) \\\n((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_srlri_h((v8i16)(__b), (int)(__c)), (v16i8)__builtin_msa_srlri_h((v8i16)(__a), (int)(__c))))\n#define msa_rpackr_u32(__a, __b, __c) \\\n((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_srlri_w((v4i32)(__b), (int)(__c)), (v8i16)__builtin_msa_srlri_w((v4i32)(__a), (int)(__c))))\n#define msa_rpackr_u64(__a, __b, __c) \\\n((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_srlri_d((v2i64)(__b), (int)(__c)), (v4i32)__builtin_msa_srlri_d((v2i64)(__a), (int)(__c))))\n\n/* qrpackr */\n#define msa_qrpackr_s16(__a, __b, __c) \\\n(__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_s_h(__builtin_msa_srari_h((v8i16)(__b), (int)(__c)), 7), \\\n                       (v16i8)__builtin_msa_sat_s_h(__builtin_msa_srari_h((v8i16)(__a), (int)(__c)), 7)))\n#define msa_qrpackr_s32(__a, __b, __c) \\\n(__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_s_w(__builtin_msa_srari_w((v4i32)(__b), (int)(__c)), 15), \\\n                       (v8i16)__builtin_msa_sat_s_w(__builtin_msa_srari_w((v4i32)(__a), (int)(__c)), 15)))\n#define msa_qrpackr_s64(__a, __b, __c) \\\n(__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_s_d(__builtin_msa_srari_d((v2i64)(__b), (int)(__c)), 31), \\\n                       (v4i32)__builtin_msa_sat_s_d(__builtin_msa_srari_d((v2i64)(__a), (int)(__c)), 31)))\n#define msa_qrpackr_u16(__a, __b, __c) \\\n((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_u_h((v8u16)__builtin_msa_srlri_h((v8i16)(__b), (int)(__c)), 7), \\\n                              (v16i8)__builtin_msa_sat_u_h((v8u16)__builtin_msa_srlri_h((v8i16)(__a), (int)(__c)), 7)))\n#define msa_qrpackr_u32(__a, __b, __c) \\\n((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_u_w((v4u32)__builtin_msa_srlri_w((v4i32)(__b), (int)(__c)), 15), \\\n                              (v8i16)__builtin_msa_sat_u_w((v4u32)__builtin_msa_srlri_w((v4i32)(__a), (int)(__c)), 15)))\n#define msa_qrpackr_u64(__a, __b, __c) \\\n((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_u_d((v2u64)__builtin_msa_srlri_d((v2i64)(__b), (int)(__c)), 31), \\\n                              (v4i32)__builtin_msa_sat_u_d((v2u64)__builtin_msa_srlri_d((v2i64)(__a), (int)(__c)), 31)))\n\n/* qrpackru */\n#define msa_qrpackru_s16(__a, __b, __c) \\\n({ \\\n  v8i16 __d = __builtin_msa_srlri_h(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a)), (int)(__c)); \\\n  v8i16 __e = __builtin_msa_srlri_h(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__b)), (int)(__c)); \\\n  (v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_u_h((v8u16)__e, 7), (v16i8)__builtin_msa_sat_u_h((v8u16)__d, 7)); \\\n})\n\n#define msa_qrpackru_s32(__a, __b, __c) \\\n({ \\\n  v4i32 __d = __builtin_msa_srlri_w(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a)), (int)(__c)); \\\n  v4i32 __e = __builtin_msa_srlri_w(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__b)), (int)(__c)); \\\n  (v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_u_w((v4u32)__e, 15), (v8i16)__builtin_msa_sat_u_w((v4u32)__d, 15)); \\\n})\n\n#define msa_qrpackru_s64(__a, __b, __c) \\\n({ \\\n  v2i64 __d = __builtin_msa_srlri_d(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a)), (int)(__c)); \\\n  v2i64 __e = __builtin_msa_srlri_d(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__b)), (int)(__c)); \\\n  (v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_u_d((v2u64)__e, 31), (v4i32)__builtin_msa_sat_u_d((v2u64)__d, 31)); \\\n})\n\n/* Minimum values between corresponding elements in the two vectors are written to the returned vector. */\n#define msa_minq_s8(__a, __b)  (__builtin_msa_min_s_b(__a, __b))\n#define msa_minq_s16(__a, __b) (__builtin_msa_min_s_h(__a, __b))\n#define msa_minq_s32(__a, __b) (__builtin_msa_min_s_w(__a, __b))\n#define msa_minq_s64(__a, __b) (__builtin_msa_min_s_d(__a, __b))\n#define msa_minq_u8(__a, __b)  ((v16u8)__builtin_msa_min_u_b(__a, __b))\n#define msa_minq_u16(__a, __b) ((v8u16)__builtin_msa_min_u_h(__a, __b))\n#define msa_minq_u32(__a, __b) ((v4u32)__builtin_msa_min_u_w(__a, __b))\n#define msa_minq_u64(__a, __b) ((v2u64)__builtin_msa_min_u_d(__a, __b))\n#define msa_minq_f32(__a, __b) (__builtin_msa_fmin_w(__a, __b))\n#define msa_minq_f64(__a, __b) (__builtin_msa_fmin_d(__a, __b))\n\n/* Maximum values between corresponding elements in the two vectors are written to the returned vector. */\n#define msa_maxq_s8(__a, __b)  (__builtin_msa_max_s_b(__a, __b))\n#define msa_maxq_s16(__a, __b) (__builtin_msa_max_s_h(__a, __b))\n#define msa_maxq_s32(__a, __b) (__builtin_msa_max_s_w(__a, __b))\n#define msa_maxq_s64(__a, __b) (__builtin_msa_max_s_d(__a, __b))\n#define msa_maxq_u8(__a, __b)  ((v16u8)__builtin_msa_max_u_b(__a, __b))\n#define msa_maxq_u16(__a, __b) ((v8u16)__builtin_msa_max_u_h(__a, __b))\n#define msa_maxq_u32(__a, __b) ((v4u32)__builtin_msa_max_u_w(__a, __b))\n#define msa_maxq_u64(__a, __b) ((v2u64)__builtin_msa_max_u_d(__a, __b))\n#define msa_maxq_f32(__a, __b) (__builtin_msa_fmax_w(__a, __b))\n#define msa_maxq_f64(__a, __b) (__builtin_msa_fmax_d(__a, __b))\n\n/* Vector type reinterpretion */\n#define MSA_TPV_REINTERPRET(_Tpv, Vec) ((_Tpv)(Vec))\n\n/* Add the odd elements in vector __a with the even elements in vector __b to double width elements in the returned vector. */\n/* v8i16 msa_hadd_s16 ((v16i8)__a, (v16i8)__b) */\n#define msa_hadd_s16(__a, __b) (__builtin_msa_hadd_s_h((v16i8)(__a), (v16i8)(__b)))\n/* v4i32 msa_hadd_s32 ((v8i16)__a, (v8i16)__b) */\n#define msa_hadd_s32(__a, __b) (__builtin_msa_hadd_s_w((v8i16)(__a), (v8i16)(__b)))\n/* v2i64 msa_hadd_s64 ((v4i32)__a, (v4i32)__b) */\n#define msa_hadd_s64(__a, __b) (__builtin_msa_hadd_s_d((v4i32)(__a), (v4i32)(__b)))\n\n/* Copy even elements in __a to the left half and even elements in __b to the right half and return the result vector. */\n#define msa_pckev_s8(__a, __b)  (__builtin_msa_pckev_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_pckev_s16(__a, __b) (__builtin_msa_pckev_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_pckev_s32(__a, __b) (__builtin_msa_pckev_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_pckev_s64(__a, __b) (__builtin_msa_pckev_d((v2i64)(__a), (v2i64)(__b)))\n\n/* Copy even elements in __a to the left half and even elements in __b to the right half and return the result vector. */\n#define msa_pckod_s8(__a, __b)  (__builtin_msa_pckod_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_pckod_s16(__a, __b) (__builtin_msa_pckod_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_pckod_s32(__a, __b) (__builtin_msa_pckod_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_pckod_s64(__a, __b) (__builtin_msa_pckod_d((v2i64)(__a), (v2i64)(__b)))\n\n#ifdef _MIPSEB\n#define LANE_IMM0_1(x)  (0b1 - ((x) & 0b1))\n#define LANE_IMM0_3(x)  (0b11 - ((x) & 0b11))\n#define LANE_IMM0_7(x)  (0b111 - ((x) & 0b111))\n#define LANE_IMM0_15(x) (0b1111 - ((x) & 0b1111))\n#else\n#define LANE_IMM0_1(x)  ((x) & 0b1)\n#define LANE_IMM0_3(x)  ((x) & 0b11)\n#define LANE_IMM0_7(x)  ((x) & 0b111)\n#define LANE_IMM0_15(x) ((x) & 0b1111)\n#endif\n\n#define msa_get_lane_u8(__a, __b)        ((uint8_t)(__a)[LANE_IMM0_7(__b)])\n#define msa_get_lane_s8(__a, __b)        ((int8_t)(__a)[LANE_IMM0_7(__b)])\n#define msa_get_lane_u16(__a, __b)       ((uint16_t)(__a)[LANE_IMM0_3(__b)])\n#define msa_get_lane_s16(__a, __b)       ((int16_t)(__a)[LANE_IMM0_3(__b)])\n#define msa_get_lane_u32(__a, __b)       ((uint32_t)(__a)[LANE_IMM0_1(__b)])\n#define msa_get_lane_s32(__a, __b)       ((int32_t)(__a)[LANE_IMM0_1(__b)])\n#define msa_get_lane_f32(__a, __b)       ((float)(__a)[LANE_IMM0_3(__b)])\n#define msa_get_lane_s64(__a, __b)       ((int64_t)(__a)[LANE_IMM0_1(__b)])\n#define msa_get_lane_u64(__a, __b)       ((uint64_t)(__a)[LANE_IMM0_1(__b)])\n#define msa_get_lane_f64(__a, __b)       ((double)(__a)[LANE_IMM0_1(__b)])\n#define msa_getq_lane_u8(__a, imm0_15)   ((uint8_t)__builtin_msa_copy_u_b((v16i8)(__a), imm0_15))\n#define msa_getq_lane_s8(__a, imm0_15)   ((int8_t)__builtin_msa_copy_s_b(__a, imm0_15))\n#define msa_getq_lane_u16(__a, imm0_7)   ((uint16_t)__builtin_msa_copy_u_h((v8i16)(__a), imm0_7))\n#define msa_getq_lane_s16(__a, imm0_7)   ((int16_t)__builtin_msa_copy_s_h(__a, imm0_7))\n#define msa_getq_lane_u32(__a, imm0_3)   __builtin_msa_copy_u_w((v4i32)(__a), imm0_3)\n#define msa_getq_lane_s32                __builtin_msa_copy_s_w\n#define msa_getq_lane_f32(__a, __b)      ((float)(__a)[LANE_IMM0_3(__b)])\n#define msa_getq_lane_f64(__a, __b)      ((double)(__a)[LANE_IMM0_1(__b)])\n#if (__mips == 64)\n#define msa_getq_lane_u64(__a, imm0_1)   __builtin_msa_copy_u_d((v2i64)(__a), imm0_1)\n#define msa_getq_lane_s64                __builtin_msa_copy_s_d\n#else\n#define msa_getq_lane_u64(__a, imm0_1)   ((uint64_t)(__a)[LANE_IMM0_1(imm0_1)])\n#define msa_getq_lane_s64(__a, imm0_1)   ((int64_t)(__a)[LANE_IMM0_1(imm0_1)])\n#endif\n\n/* combine */\n#if (__mips == 64)\n#define __COMBINE_64_64(__TYPE, a, b)    ((__TYPE)((v2u64){((v1u64)(a))[0], ((v1u64)(b))[0]}))\n#else\n#define __COMBINE_64_64(__TYPE, a, b)    ((__TYPE)((v4u32){((v2u32)(a))[0], ((v2u32)(a))[1],  \\\n                                                           ((v2u32)(b))[0], ((v2u32)(b))[1]}))\n#endif\n\n/* v16i8 msa_combine_s8 (v8i8 __a, v8i8 __b) */\n#define msa_combine_s8(__a, __b)  __COMBINE_64_64(v16i8, __a, __b)\n\n/* v8i16 msa_combine_s16(v4i16 __a, v4i16 __b) */\n#define msa_combine_s16(__a, __b)  __COMBINE_64_64(v8i16, __a, __b)\n\n/* v4i32 msa_combine_s32(v2i32 __a, v2i32 __b) */\n#define msa_combine_s32(__a, __b)  __COMBINE_64_64(v4i32, __a, __b)\n\n/* v2i64 msa_combine_s64(v1i64 __a, v1i64 __b) */\n#define msa_combine_s64(__a, __b)  __COMBINE_64_64(v2i64, __a, __b)\n\n/* v4f32 msa_combine_f32(v2f32 __a, v2f32 __b) */\n#define msa_combine_f32(__a, __b)  __COMBINE_64_64(v4f32, __a, __b)\n\n/* v16u8 msa_combine_u8(v8u8 __a, v8u8 __b) */\n#define msa_combine_u8(__a, __b)  __COMBINE_64_64(v16u8, __a, __b)\n\n/* v8u16 msa_combine_u16(v4u16 __a, v4u16 __b) */\n#define msa_combine_u16(__a, __b)  __COMBINE_64_64(v8u16, __a, __b)\n\n/* v4u32 msa_combine_u32(v2u32 __a, v2u32 __b) */\n#define msa_combine_u32(__a, __b)  __COMBINE_64_64(v4u32, __a, __b)\n\n/* v2u64 msa_combine_u64(v1u64 __a, v1u64 __b) */\n#define msa_combine_u64(__a, __b)  __COMBINE_64_64(v2u64, __a, __b)\n\n/* v2f64 msa_combine_f64(v1f64 __a, v1f64 __b) */\n#define msa_combine_f64(__a, __b)  __COMBINE_64_64(v2f64, __a, __b)\n\n/* get_low, get_high */\n#if (__mips == 64)\n#define __GET_LOW(__TYPE, a)   ((__TYPE)((v1u64)(__builtin_msa_copy_u_d((v2i64)(a), 0))))\n#define __GET_HIGH(__TYPE, a)  ((__TYPE)((v1u64)(__builtin_msa_copy_u_d((v2i64)(a), 1))))\n#else\n#define __GET_LOW(__TYPE, a)   ((__TYPE)(((v2u64)(a))[0]))\n#define __GET_HIGH(__TYPE, a)  ((__TYPE)(((v2u64)(a))[1]))\n#endif\n\n/* v8i8 msa_get_low_s8(v16i8 __a) */\n#define msa_get_low_s8(__a)  __GET_LOW(v8i8, __a)\n\n/* v4i16 msa_get_low_s16(v8i16 __a) */\n#define msa_get_low_s16(__a)  __GET_LOW(v4i16, __a)\n\n/* v2i32 msa_get_low_s32(v4i32 __a) */\n#define msa_get_low_s32(__a)  __GET_LOW(v2i32, __a)\n\n/* v1i64 msa_get_low_s64(v2i64 __a) */\n#define msa_get_low_s64(__a)  __GET_LOW(v1i64, __a)\n\n/* v8u8 msa_get_low_u8(v16u8 __a) */\n#define msa_get_low_u8(__a)  __GET_LOW(v8u8, __a)\n\n/* v4u16 msa_get_low_u16(v8u16 __a) */\n#define msa_get_low_u16(__a)  __GET_LOW(v4u16, __a)\n\n/* v2u32 msa_get_low_u32(v4u32 __a) */\n#define msa_get_low_u32(__a)  __GET_LOW(v2u32, __a)\n\n/* v1u64 msa_get_low_u64(v2u64 __a) */\n#define msa_get_low_u64(__a)  __GET_LOW(v1u64, __a)\n\n/* v2f32 msa_get_low_f32(v4f32 __a) */\n#define msa_get_low_f32(__a)  __GET_LOW(v2f32, __a)\n\n/* v1f64 msa_get_low_f64(v2f64 __a) */\n#define msa_get_low_f64(__a)  __GET_LOW(v1f64, __a)\n\n/* v8i8 msa_get_high_s8(v16i8 __a) */\n#define msa_get_high_s8(__a)  __GET_HIGH(v8i8, __a)\n\n/* v4i16 msa_get_high_s16(v8i16 __a) */\n#define msa_get_high_s16(__a)  __GET_HIGH(v4i16, __a)\n\n/* v2i32 msa_get_high_s32(v4i32 __a) */\n#define msa_get_high_s32(__a)  __GET_HIGH(v2i32, __a)\n\n/* v1i64 msa_get_high_s64(v2i64 __a) */\n#define msa_get_high_s64(__a)  __GET_HIGH(v1i64, __a)\n\n/* v8u8 msa_get_high_u8(v16u8 __a) */\n#define msa_get_high_u8(__a)  __GET_HIGH(v8u8, __a)\n\n/* v4u16 msa_get_high_u16(v8u16 __a) */\n#define msa_get_high_u16(__a)  __GET_HIGH(v4u16, __a)\n\n/* v2u32 msa_get_high_u32(v4u32 __a) */\n#define msa_get_high_u32(__a)  __GET_HIGH(v2u32, __a)\n\n/* v1u64 msa_get_high_u64(v2u64 __a) */\n#define msa_get_high_u64(__a)  __GET_HIGH(v1u64, __a)\n\n/* v2f32 msa_get_high_f32(v4f32 __a) */\n#define msa_get_high_f32(__a)  __GET_HIGH(v2f32, __a)\n\n/* v1f64 msa_get_high_f64(v2f64 __a) */\n#define msa_get_high_f64(__a)  __GET_HIGH(v1f64, __a)\n\n/* ri = ai * b[lane] */\n/* v4f32 msa_mulq_lane_f32(v4f32 __a, v4f32 __b, const int __lane) */\n#define msa_mulq_lane_f32(__a, __b, __lane)  ((__a) * msa_getq_lane_f32(__b, __lane))\n\n/* ri = ai + bi * c[lane] */\n/* v4f32 msa_mlaq_lane_f32(v4f32 __a, v4f32 __b, v4f32 __c, const int __lane) */\n#define msa_mlaq_lane_f32(__a, __b, __c, __lane)  ((__a) + ((__b) * msa_getq_lane_f32(__c, __lane)))\n\n/* uint16_t msa_sum_u16(v8u16 __a)*/\n#define msa_sum_u16(__a)                         \\\n({                                               \\\n  v4u32 _b;                                      \\\n  v2u64 _c;                                      \\\n  _b = __builtin_msa_hadd_u_w(__a, __a);         \\\n  _c = __builtin_msa_hadd_u_d(_b, _b);           \\\n  (uint16_t)(_c[0] + _c[1]);                     \\\n})\n\n/* int16_t msa_sum_s16(v8i16 __a) */\n#define msa_sum_s16(__a)                        \\\n({                                              \\\n  v4i32 _b;                                     \\\n  v2i64 _c;                                     \\\n  _b = __builtin_msa_hadd_s_w(__a, __a);        \\\n  _c = __builtin_msa_hadd_s_d(_b, _b);          \\\n  (int16_t)(_c[0] + _c[1]);                     \\\n})\n\n\n/* uint32_t msa_sum_u32(v4u32 __a)*/\n#define msa_sum_u32(__a)                       \\\n({                                             \\\n  v2u64 _b;                                    \\\n  _b = __builtin_msa_hadd_u_d(__a, __a);       \\\n  (uint32_t)(_b[0] + _b[1]);                   \\\n})\n\n/* int32_t  msa_sum_s32(v4i32 __a)*/\n#define msa_sum_s32(__a)                       \\\n({                                             \\\n  v2i64 _b;                                    \\\n  _b = __builtin_msa_hadd_s_d(__a, __a);       \\\n  (int32_t)(_b[0] + _b[1]);                    \\\n})\n\n/* uint8_t msa_sum_u8(v16u8 __a)*/\n#define msa_sum_u8(__a)                        \\\n({                                             \\\n  v8u16 _b16;                                    \\\n  v4u32 _c32;                                    \\\n  _b16 = __builtin_msa_hadd_u_h(__a, __a);       \\\n  _c32 = __builtin_msa_hadd_u_w(_b16, _b16);         \\\n  (uint8_t)msa_sum_u32(_c32);                    \\\n})\n\n/* int8_t msa_sum_s8(v16s8 __a)*/\n#define msa_sum_s8(__a)                        \\\n({                                             \\\n  v8i16 _b16;                                    \\\n  v4i32 _c32;                                    \\\n  _b16 = __builtin_msa_hadd_s_h(__a, __a);       \\\n  _c32 = __builtin_msa_hadd_s_w(_b16, _b16);         \\\n  (int8_t)msa_sum_s32(_c32);                     \\\n})\n\n/* float msa_sum_f32(v4f32 __a)*/\n#define msa_sum_f32(__a)  ((__a)[0] + (__a)[1] + (__a)[2] + (__a)[3])\n\n/* v8u16 msa_paddlq_u8(v16u8 __a) */\n#define msa_paddlq_u8(__a)  (__builtin_msa_hadd_u_h(__a, __a))\n\n/* v8i16 msa_paddlq_s8(v16i8 __a) */\n#define msa_paddlq_s8(__a)  (__builtin_msa_hadd_s_h(__a, __a))\n\n/* v4u32 msa_paddlq_u16 (v8u16 __a)*/\n#define msa_paddlq_u16(__a)  (__builtin_msa_hadd_u_w(__a, __a))\n\n/* v4i32 msa_paddlq_s16 (v8i16 __a)*/\n#define msa_paddlq_s16(__a)  (__builtin_msa_hadd_s_w(__a, __a))\n\n/* v2u64 msa_paddlq_u32(v4u32 __a) */\n#define msa_paddlq_u32(__a)  (__builtin_msa_hadd_u_d(__a, __a))\n\n/* v2i64 msa_paddlq_s32(v4i32 __a) */\n#define msa_paddlq_s32(__a)  (__builtin_msa_hadd_s_d(__a, __a))\n\n#define V8U8_2_V8U16(x)   {(uint16_t)x[0], (uint16_t)x[1], (uint16_t)x[2], (uint16_t)x[3], \\\n                           (uint16_t)x[4], (uint16_t)x[5], (uint16_t)x[6], (uint16_t)x[7]}\n#define V8U8_2_V8I16(x)   {(int16_t)x[0], (int16_t)x[1], (int16_t)x[2], (int16_t)x[3], \\\n                           (int16_t)x[4], (int16_t)x[5], (int16_t)x[6], (int16_t)x[7]}\n#define V8I8_2_V8I16(x)   {(int16_t)x[0], (int16_t)x[1], (int16_t)x[2], (int16_t)x[3], \\\n                           (int16_t)x[4], (int16_t)x[5], (int16_t)x[6], (int16_t)x[7]}\n#define V4U16_2_V4U32(x)  {(uint32_t)x[0], (uint32_t)x[1], (uint32_t)x[2], (uint32_t)x[3]}\n#define V4U16_2_V4I32(x)  {(int32_t)x[0], (int32_t)x[1], (int32_t)x[2], (int32_t)x[3]}\n#define V4I16_2_V4I32(x)  {(int32_t)x[0], (int32_t)x[1], (int32_t)x[2], (int32_t)x[3]}\n#define V2U32_2_V2U64(x)  {(uint64_t)x[0], (uint64_t)x[1]}\n#define V2U32_2_V2I64(x)  {(int64_t)x[0], (int64_t)x[1]}\n\n/* v8u16 msa_mull_u8(v8u8 __a, v8u8 __b) */\n#define msa_mull_u8(__a, __b)  ((v8u16)__builtin_msa_mulv_h((v8i16)V8U8_2_V8I16(__a), (v8i16)V8U8_2_V8I16(__b)))\n\n/* v8i16 msa_mull_s8(v8i8 __a, v8i8 __b)*/\n#define msa_mull_s8(__a, __b)  (__builtin_msa_mulv_h((v8i16)V8I8_2_V8I16(__a), (v8i16)V8I8_2_V8I16(__b)))\n\n/* v4u32 msa_mull_u16(v4u16 __a, v4u16 __b) */\n#define msa_mull_u16(__a, __b)  ((v4u32)__builtin_msa_mulv_w((v4i32)V4U16_2_V4I32(__a), (v4i32)V4U16_2_V4I32(__b)))\n\n/* v4i32 msa_mull_s16(v4i16 __a, v4i16 __b) */\n#define msa_mull_s16(__a, __b)  (__builtin_msa_mulv_w((v4i32)V4I16_2_V4I32(__a), (v4i32)V4I16_2_V4I32(__b)))\n\n/* v2u64 msa_mull_u32(v2u32 __a, v2u32 __b) */\n#define msa_mull_u32(__a, __b)  ((v2u64)__builtin_msa_mulv_d((v2i64)V2U32_2_V2I64(__a), (v2i64)V2U32_2_V2I64(__b)))\n\n/* bitwise and: __builtin_msa_and_v */\n#define msa_andq_u8(__a, __b)  ((v16u8)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_andq_s8(__a, __b)  ((v16i8)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_andq_u16(__a, __b) ((v8u16)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_andq_s16(__a, __b) ((v8i16)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_andq_u32(__a, __b) ((v4u32)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_andq_s32(__a, __b) ((v4i32)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_andq_u64(__a, __b) ((v2u64)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_andq_s64(__a, __b) ((v2i64)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))\n\n/* bitwise or: __builtin_msa_or_v */\n#define msa_orrq_u8(__a, __b)  ((v16u8)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_orrq_s8(__a, __b)  ((v16i8)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_orrq_u16(__a, __b) ((v8u16)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_orrq_s16(__a, __b) ((v8i16)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_orrq_u32(__a, __b) ((v4u32)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_orrq_s32(__a, __b) ((v4i32)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_orrq_u64(__a, __b) ((v2u64)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_orrq_s64(__a, __b) ((v2i64)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))\n\n/* bitwise xor: __builtin_msa_xor_v */\n#define msa_eorq_u8(__a, __b)  ((v16u8)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_eorq_s8(__a, __b)  ((v16i8)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_eorq_u16(__a, __b) ((v8u16)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_eorq_s16(__a, __b) ((v8i16)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_eorq_u32(__a, __b) ((v4u32)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_eorq_s32(__a, __b) ((v4i32)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_eorq_u64(__a, __b) ((v2u64)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))\n#define msa_eorq_s64(__a, __b) ((v2i64)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))\n\n/* bitwise not: v16u8 __builtin_msa_xori_b (v16u8, 0xff) */\n#define msa_mvnq_u8(__a)  ((v16u8)__builtin_msa_xori_b((v16u8)(__a), 0xFF))\n#define msa_mvnq_s8(__a)  ((v16i8)__builtin_msa_xori_b((v16u8)(__a), 0xFF))\n#define msa_mvnq_u16(__a) ((v8u16)__builtin_msa_xori_b((v16u8)(__a), 0xFF))\n#define msa_mvnq_s16(__a) ((v8i16)__builtin_msa_xori_b((v16u8)(__a), 0xFF))\n#define msa_mvnq_u32(__a) ((v4u32)__builtin_msa_xori_b((v16u8)(__a), 0xFF))\n#define msa_mvnq_s32(__a) ((v4i32)__builtin_msa_xori_b((v16u8)(__a), 0xFF))\n#define msa_mvnq_u64(__a) ((v2u64)__builtin_msa_xori_b((v16u8)(__a), 0xFF))\n#define msa_mvnq_s64(__a) ((v2i64)__builtin_msa_xori_b((v16u8)(__a), 0xFF))\n\n/* compare equal: ceq -> ri = ai == bi ? 1...1:0...0 */\n#define msa_ceqq_u8(__a, __b)  ((v16u8)__builtin_msa_ceq_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_ceqq_s8(__a, __b)  ((v16u8)__builtin_msa_ceq_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_ceqq_u16(__a, __b) ((v8u16)__builtin_msa_ceq_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_ceqq_s16(__a, __b) ((v8u16)__builtin_msa_ceq_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_ceqq_u32(__a, __b) ((v4u32)__builtin_msa_ceq_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_ceqq_s32(__a, __b) ((v4u32)__builtin_msa_ceq_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_ceqq_f32(__a, __b) ((v4u32)__builtin_msa_fceq_w((v4f32)(__a), (v4f32)(__b)))\n#define msa_ceqq_u64(__a, __b) ((v2u64)__builtin_msa_ceq_d((v2i64)(__a), (v2i64)(__b)))\n#define msa_ceqq_s64(__a, __b) ((v2u64)__builtin_msa_ceq_d((v2i64)(__a), (v2i64)(__b)))\n#define msa_ceqq_f64(__a, __b) ((v2u64)__builtin_msa_fceq_d((v2f64)(__a), (v2f64)(__b)))\n\n/* Compare less-than: clt -> ri = ai < bi ? 1...1:0...0 */\n#define msa_cltq_u8(__a, __b)  ((v16u8)__builtin_msa_clt_u_b((v16u8)(__a), (v16u8)(__b)))\n#define msa_cltq_s8(__a, __b)  ((v16u8)__builtin_msa_clt_s_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_cltq_u16(__a, __b) ((v8u16)__builtin_msa_clt_u_h((v8u16)(__a), (v8u16)(__b)))\n#define msa_cltq_s16(__a, __b) ((v8u16)__builtin_msa_clt_s_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_cltq_u32(__a, __b) ((v4u32)__builtin_msa_clt_u_w((v4u32)(__a), (v4u32)(__b)))\n#define msa_cltq_s32(__a, __b) ((v4u32)__builtin_msa_clt_s_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_cltq_f32(__a, __b) ((v4u32)__builtin_msa_fclt_w((v4f32)(__a), (v4f32)(__b)))\n#define msa_cltq_u64(__a, __b) ((v2u64)__builtin_msa_clt_u_d((v2u64)(__a), (v2u64)(__b)))\n#define msa_cltq_s64(__a, __b) ((v2u64)__builtin_msa_clt_s_d((v2i64)(__a), (v2i64)(__b)))\n#define msa_cltq_f64(__a, __b) ((v2u64)__builtin_msa_fclt_d((v2f64)(__a), (v2f64)(__b)))\n\n/* compare greater-than: cgt -> ri = ai > bi ? 1...1:0...0 */\n#define msa_cgtq_u8(__a, __b)  ((v16u8)__builtin_msa_clt_u_b((v16u8)(__b), (v16u8)(__a)))\n#define msa_cgtq_s8(__a, __b)  ((v16u8)__builtin_msa_clt_s_b((v16i8)(__b), (v16i8)(__a)))\n#define msa_cgtq_u16(__a, __b) ((v8u16)__builtin_msa_clt_u_h((v8u16)(__b), (v8u16)(__a)))\n#define msa_cgtq_s16(__a, __b) ((v8u16)__builtin_msa_clt_s_h((v8i16)(__b), (v8i16)(__a)))\n#define msa_cgtq_u32(__a, __b) ((v4u32)__builtin_msa_clt_u_w((v4u32)(__b), (v4u32)(__a)))\n#define msa_cgtq_s32(__a, __b) ((v4u32)__builtin_msa_clt_s_w((v4i32)(__b), (v4i32)(__a)))\n#define msa_cgtq_f32(__a, __b) ((v4u32)__builtin_msa_fclt_w((v4f32)(__b), (v4f32)(__a)))\n#define msa_cgtq_u64(__a, __b) ((v2u64)__builtin_msa_clt_u_d((v2u64)(__b), (v2u64)(__a)))\n#define msa_cgtq_s64(__a, __b) ((v2u64)__builtin_msa_clt_s_d((v2i64)(__b), (v2i64)(__a)))\n#define msa_cgtq_f64(__a, __b) ((v2u64)__builtin_msa_fclt_d((v2f64)(__b), (v2f64)(__a)))\n\n/* compare less-equal: cle -> ri = ai <= bi ? 1...1:0...0 */\n#define msa_cleq_u8(__a, __b)  ((v16u8)__builtin_msa_cle_u_b((v16u8)(__a), (v16u8)(__b)))\n#define msa_cleq_s8(__a, __b)  ((v16u8)__builtin_msa_cle_s_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_cleq_u16(__a, __b) ((v8u16)__builtin_msa_cle_u_h((v8u16)(__a), (v8u16)(__b)))\n#define msa_cleq_s16(__a, __b) ((v8u16)__builtin_msa_cle_s_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_cleq_u32(__a, __b) ((v4u32)__builtin_msa_cle_u_w((v4u32)(__a), (v4u32)(__b)))\n#define msa_cleq_s32(__a, __b) ((v4u32)__builtin_msa_cle_s_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_cleq_f32(__a, __b) ((v4u32)__builtin_msa_fcle_w((v4f32)(__a), (v4f32)(__b)))\n#define msa_cleq_u64(__a, __b) ((v2u64)__builtin_msa_cle_u_d((v2u64)(__a), (v2u64)(__b)))\n#define msa_cleq_s64(__a, __b) ((v2u64)__builtin_msa_cle_s_d((v2i64)(__a), (v2i64)(__b)))\n#define msa_cleq_f64(__a, __b) ((v2u64)__builtin_msa_fcle_d((v2f64)(__a), (v2f64)(__b)))\n\n/* compare greater-equal: cge -> ri = ai >= bi ? 1...1:0...0 */\n#define msa_cgeq_u8(__a, __b)  ((v16u8)__builtin_msa_cle_u_b((v16u8)(__b), (v16u8)(__a)))\n#define msa_cgeq_s8(__a, __b)  ((v16u8)__builtin_msa_cle_s_b((v16i8)(__b), (v16i8)(__a)))\n#define msa_cgeq_u16(__a, __b) ((v8u16)__builtin_msa_cle_u_h((v8u16)(__b), (v8u16)(__a)))\n#define msa_cgeq_s16(__a, __b) ((v8u16)__builtin_msa_cle_s_h((v8i16)(__b), (v8i16)(__a)))\n#define msa_cgeq_u32(__a, __b) ((v4u32)__builtin_msa_cle_u_w((v4u32)(__b), (v4u32)(__a)))\n#define msa_cgeq_s32(__a, __b) ((v4u32)__builtin_msa_cle_s_w((v4i32)(__b), (v4i32)(__a)))\n#define msa_cgeq_f32(__a, __b) ((v4u32)__builtin_msa_fcle_w((v4f32)(__b), (v4f32)(__a)))\n#define msa_cgeq_u64(__a, __b) ((v2u64)__builtin_msa_cle_u_d((v2u64)(__b), (v2u64)(__a)))\n#define msa_cgeq_s64(__a, __b) ((v2u64)__builtin_msa_cle_s_d((v2i64)(__b), (v2i64)(__a)))\n#define msa_cgeq_f64(__a, __b) ((v2u64)__builtin_msa_fcle_d((v2f64)(__b), (v2f64)(__a)))\n\n/* Shift Left Logical: shl -> ri = ai << bi; */\n#define msa_shlq_u8(__a, __b)  ((v16u8)__builtin_msa_sll_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_shlq_s8(__a, __b)  ((v16i8)__builtin_msa_sll_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_shlq_u16(__a, __b) ((v8u16)__builtin_msa_sll_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_shlq_s16(__a, __b) ((v8i16)__builtin_msa_sll_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_shlq_u32(__a, __b) ((v4u32)__builtin_msa_sll_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_shlq_s32(__a, __b) ((v4i32)__builtin_msa_sll_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_shlq_u64(__a, __b) ((v2u64)__builtin_msa_sll_d((v2i64)(__a), (v2i64)(__b)))\n#define msa_shlq_s64(__a, __b) ((v2i64)__builtin_msa_sll_d((v2i64)(__a), (v2i64)(__b)))\n\n/* Immediate Shift Left Logical: shl -> ri = ai << imm; */\n#define msa_shlq_n_u8(__a, __imm)  ((v16u8)__builtin_msa_slli_b((v16i8)(__a), __imm))\n#define msa_shlq_n_s8(__a, __imm)  ((v16i8)__builtin_msa_slli_b((v16i8)(__a), __imm))\n#define msa_shlq_n_u16(__a, __imm) ((v8u16)__builtin_msa_slli_h((v8i16)(__a), __imm))\n#define msa_shlq_n_s16(__a, __imm) ((v8i16)__builtin_msa_slli_h((v8i16)(__a), __imm))\n#define msa_shlq_n_u32(__a, __imm) ((v4u32)__builtin_msa_slli_w((v4i32)(__a), __imm))\n#define msa_shlq_n_s32(__a, __imm) ((v4i32)__builtin_msa_slli_w((v4i32)(__a), __imm))\n#define msa_shlq_n_u64(__a, __imm) ((v2u64)__builtin_msa_slli_d((v2i64)(__a), __imm))\n#define msa_shlq_n_s64(__a, __imm) ((v2i64)__builtin_msa_slli_d((v2i64)(__a), __imm))\n\n/* shift right: shrq -> ri = ai >> bi; */\n#define msa_shrq_u8(__a, __b)  ((v16u8)__builtin_msa_srl_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_shrq_s8(__a, __b)  ((v16i8)__builtin_msa_sra_b((v16i8)(__a), (v16i8)(__b)))\n#define msa_shrq_u16(__a, __b) ((v8u16)__builtin_msa_srl_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_shrq_s16(__a, __b) ((v8i16)__builtin_msa_sra_h((v8i16)(__a), (v8i16)(__b)))\n#define msa_shrq_u32(__a, __b) ((v4u32)__builtin_msa_srl_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_shrq_s32(__a, __b) ((v4i32)__builtin_msa_sra_w((v4i32)(__a), (v4i32)(__b)))\n#define msa_shrq_u64(__a, __b) ((v2u64)__builtin_msa_srl_d((v2i64)(__a), (v2i64)(__b)))\n#define msa_shrq_s64(__a, __b) ((v2i64)__builtin_msa_sra_d((v2i64)(__a), (v2i64)(__b)))\n\n/* Immediate Shift Right: shr -> ri = ai >> imm; */\n#define msa_shrq_n_u8(__a, __imm)  ((v16u8)__builtin_msa_srli_b((v16i8)(__a), __imm))\n#define msa_shrq_n_s8(__a, __imm)  ((v16i8)__builtin_msa_srai_b((v16i8)(__a), __imm))\n#define msa_shrq_n_u16(__a, __imm) ((v8u16)__builtin_msa_srli_h((v8i16)(__a), __imm))\n#define msa_shrq_n_s16(__a, __imm) ((v8i16)__builtin_msa_srai_h((v8i16)(__a), __imm))\n#define msa_shrq_n_u32(__a, __imm) ((v4u32)__builtin_msa_srli_w((v4i32)(__a), __imm))\n#define msa_shrq_n_s32(__a, __imm) ((v4i32)__builtin_msa_srai_w((v4i32)(__a), __imm))\n#define msa_shrq_n_u64(__a, __imm) ((v2u64)__builtin_msa_srli_d((v2i64)(__a), __imm))\n#define msa_shrq_n_s64(__a, __imm) ((v2i64)__builtin_msa_srai_d((v2i64)(__a), __imm))\n\n/* Immediate Shift Right Rounded: shr -> ri = ai >> (rounded)imm; */\n#define msa_rshrq_n_u8(__a, __imm)  ((v16u8)__builtin_msa_srlri_b((v16i8)(__a), __imm))\n#define msa_rshrq_n_s8(__a, __imm)  ((v16i8)__builtin_msa_srari_b((v16i8)(__a), __imm))\n#define msa_rshrq_n_u16(__a, __imm) ((v8u16)__builtin_msa_srlri_h((v8i16)(__a), __imm))\n#define msa_rshrq_n_s16(__a, __imm) ((v8i16)__builtin_msa_srari_h((v8i16)(__a), __imm))\n#define msa_rshrq_n_u32(__a, __imm) ((v4u32)__builtin_msa_srlri_w((v4i32)(__a), __imm))\n#define msa_rshrq_n_s32(__a, __imm) ((v4i32)__builtin_msa_srari_w((v4i32)(__a), __imm))\n#define msa_rshrq_n_u64(__a, __imm) ((v2u64)__builtin_msa_srlri_d((v2i64)(__a), __imm))\n#define msa_rshrq_n_s64(__a, __imm) ((v2i64)__builtin_msa_srari_d((v2i64)(__a), __imm))\n\n/* Vector saturating rounding shift left, qrshl -> ri = ai << bi; */\n#define msa_qrshrq_s32(a, b)  ((v4i32)__msa_srar_w((v4i32)(a), (v4i32)(b)))\n\n/* Rename the msa builtin func to unify the name style for intrin_msa.hpp */\n#define msa_qaddq_u8          __builtin_msa_adds_u_b\n#define msa_qaddq_s8          __builtin_msa_adds_s_b\n#define msa_qaddq_u16         __builtin_msa_adds_u_h\n#define msa_qaddq_s16         __builtin_msa_adds_s_h\n#define msa_qaddq_u32         __builtin_msa_adds_u_w\n#define msa_qaddq_s32         __builtin_msa_adds_s_w\n#define msa_qaddq_u64         __builtin_msa_adds_u_d\n#define msa_qaddq_s64         __builtin_msa_adds_s_d\n#define msa_addq_u8(a, b)     ((v16u8)__builtin_msa_addv_b((v16i8)(a), (v16i8)(b)))\n#define msa_addq_s8           __builtin_msa_addv_b\n#define msa_addq_u16(a, b)    ((v8u16)__builtin_msa_addv_h((v8i16)(a), (v8i16)(b)))\n#define msa_addq_s16          __builtin_msa_addv_h\n#define msa_addq_u32(a, b)    ((v4u32)__builtin_msa_addv_w((v4i32)(a), (v4i32)(b)))\n#define msa_addq_s32          __builtin_msa_addv_w\n#define msa_addq_f32          __builtin_msa_fadd_w\n#define msa_addq_u64(a, b)    ((v2u64)__builtin_msa_addv_d((v2i64)(a), (v2i64)(b)))\n#define msa_addq_s64          __builtin_msa_addv_d\n#define msa_addq_f64          __builtin_msa_fadd_d\n#define msa_qsubq_u8          __builtin_msa_subs_u_b\n#define msa_qsubq_s8          __builtin_msa_subs_s_b\n#define msa_qsubq_u16         __builtin_msa_subs_u_h\n#define msa_qsubq_s16         __builtin_msa_subs_s_h\n#define msa_subq_u8(a, b)     ((v16u8)__builtin_msa_subv_b((v16i8)(a), (v16i8)(b)))\n#define msa_subq_s8           __builtin_msa_subv_b\n#define msa_subq_u16(a, b)    ((v8u16)__builtin_msa_subv_h((v8i16)(a), (v8i16)(b)))\n#define msa_subq_s16          __builtin_msa_subv_h\n#define msa_subq_u32(a, b)    ((v4u32)__builtin_msa_subv_w((v4i32)(a), (v4i32)(b)))\n#define msa_subq_s32          __builtin_msa_subv_w\n#define msa_subq_f32          __builtin_msa_fsub_w\n#define msa_subq_u64(a, b)    ((v2u64)__builtin_msa_subv_d((v2i64)(a), (v2i64)(b)))\n#define msa_subq_s64          __builtin_msa_subv_d\n#define msa_subq_f64          __builtin_msa_fsub_d\n#define msa_mulq_u8(a, b)     ((v16u8)__builtin_msa_mulv_b((v16i8)(a), (v16i8)(b)))\n#define msa_mulq_s8(a, b)     ((v16i8)__builtin_msa_mulv_b((v16i8)(a), (v16i8)(b)))\n#define msa_mulq_u16(a, b)    ((v8u16)__builtin_msa_mulv_h((v8i16)(a), (v8i16)(b)))\n#define msa_mulq_s16(a, b)    ((v8i16)__builtin_msa_mulv_h((v8i16)(a), (v8i16)(b)))\n#define msa_mulq_u32(a, b)    ((v4u32)__builtin_msa_mulv_w((v4i32)(a), (v4i32)(b)))\n#define msa_mulq_s32(a, b)    ((v4i32)__builtin_msa_mulv_w((v4i32)(a), (v4i32)(b)))\n#define msa_mulq_u64(a, b)    ((v2u64)__builtin_msa_mulv_d((v2i64)(a), (v2i64)(b)))\n#define msa_mulq_s64(a, b)    ((v2i64)__builtin_msa_mulv_d((v2i64)(a), (v2i64)(b)))\n#define msa_mulq_f32          __builtin_msa_fmul_w\n#define msa_mulq_f64          __builtin_msa_fmul_d\n#define msa_divq_f32          __builtin_msa_fdiv_w\n#define msa_divq_f64          __builtin_msa_fdiv_d\n#define msa_dotp_s_h          __builtin_msa_dotp_s_h\n#define msa_dotp_s_w          __builtin_msa_dotp_s_w\n#define msa_dotp_s_d          __builtin_msa_dotp_s_d\n#define msa_dotp_u_h          __builtin_msa_dotp_u_h\n#define msa_dotp_u_w          __builtin_msa_dotp_u_w\n#define msa_dotp_u_d          __builtin_msa_dotp_u_d\n#define msa_dpadd_s_h         __builtin_msa_dpadd_s_h\n#define msa_dpadd_s_w         __builtin_msa_dpadd_s_w\n#define msa_dpadd_s_d         __builtin_msa_dpadd_s_d\n#define msa_dpadd_u_h         __builtin_msa_dpadd_u_h\n#define msa_dpadd_u_w         __builtin_msa_dpadd_u_w\n#define msa_dpadd_u_d         __builtin_msa_dpadd_u_d\n\n#define ILVRL_B2(RTYPE, in0, in1, low, hi) do {       \\\n      low = (RTYPE)__builtin_msa_ilvr_b((v16i8)(in0), (v16i8)(in1));  \\\n      hi  = (RTYPE)__builtin_msa_ilvl_b((v16i8)(in0), (v16i8)(in1));  \\\n    } while (0)\n#define ILVRL_B2_UB(...) ILVRL_B2(v16u8, __VA_ARGS__)\n#define ILVRL_B2_SB(...) ILVRL_B2(v16i8, __VA_ARGS__)\n#define ILVRL_B2_UH(...) ILVRL_B2(v8u16, __VA_ARGS__)\n#define ILVRL_B2_SH(...) ILVRL_B2(v8i16, __VA_ARGS__)\n#define ILVRL_B2_SW(...) ILVRL_B2(v4i32, __VA_ARGS__)\n\n#define ILVRL_H2(RTYPE, in0, in1, low, hi) do {       \\\n      low = (RTYPE)__builtin_msa_ilvr_h((v8i16)(in0), (v8i16)(in1));  \\\n      hi  = (RTYPE)__builtin_msa_ilvl_h((v8i16)(in0), (v8i16)(in1));  \\\n    } while (0)\n#define ILVRL_H2_UB(...) ILVRL_H2(v16u8, __VA_ARGS__)\n#define ILVRL_H2_SB(...) ILVRL_H2(v16i8, __VA_ARGS__)\n#define ILVRL_H2_UH(...) ILVRL_H2(v8u16, __VA_ARGS__)\n#define ILVRL_H2_SH(...) ILVRL_H2(v8i16, __VA_ARGS__)\n#define ILVRL_H2_SW(...) ILVRL_H2(v4i32, __VA_ARGS__)\n#define ILVRL_H2_UW(...) ILVRL_H2(v4u32, __VA_ARGS__)\n\n#define ILVRL_W2(RTYPE, in0, in1, low, hi) do {       \\\n      low = (RTYPE)__builtin_msa_ilvr_w((v4i32)(in0), (v4i32)(in1));  \\\n      hi  = (RTYPE)__builtin_msa_ilvl_w((v4i32)(in0), (v4i32)(in1));  \\\n    } while (0)\n#define ILVRL_W2_UB(...) ILVRL_W2(v16u8, __VA_ARGS__)\n#define ILVRL_W2_SH(...) ILVRL_W2(v8i16, __VA_ARGS__)\n#define ILVRL_W2_SW(...) ILVRL_W2(v4i32, __VA_ARGS__)\n#define ILVRL_W2_UW(...) ILVRL_W2(v4u32, __VA_ARGS__)\n\n/* absq, qabsq (r = |a|;) */\n#define msa_absq_s8(a)        __builtin_msa_add_a_b(a, __builtin_msa_fill_b(0))\n#define msa_absq_s16(a)       __builtin_msa_add_a_h(a, __builtin_msa_fill_h(0))\n#define msa_absq_s32(a)       __builtin_msa_add_a_w(a, __builtin_msa_fill_w(0))\n#define msa_absq_s64(a)       __builtin_msa_add_a_d(a, __builtin_msa_fill_d(0))\n#define msa_absq_f32(a)       ((v4f32)__builtin_msa_bclri_w((v4u32)(a), 31))\n#define msa_absq_f64(a)       ((v2f64)__builtin_msa_bclri_d((v2u64)(a), 63))\n#define msa_qabsq_s8(a)       __builtin_msa_adds_a_b(a, __builtin_msa_fill_b(0))\n#define msa_qabsq_s16(a)      __builtin_msa_adds_a_h(a, __builtin_msa_fill_h(0))\n#define msa_qabsq_s32(a)      __builtin_msa_adds_a_w(a, __builtin_msa_fill_w(0))\n#define msa_qabsq_s64(a)      __builtin_msa_adds_a_d(a, __builtin_msa_fill_d(0))\n\n/* abdq, qabdq (r = |a - b|;) */\n#define msa_abdq_u8           __builtin_msa_asub_u_b\n#define msa_abdq_s8           __builtin_msa_asub_s_b\n#define msa_abdq_u16          __builtin_msa_asub_u_h\n#define msa_abdq_s16          __builtin_msa_asub_s_h\n#define msa_abdq_u32          __builtin_msa_asub_u_w\n#define msa_abdq_s32          __builtin_msa_asub_s_w\n#define msa_abdq_u64          __builtin_msa_asub_u_d\n#define msa_abdq_s64          __builtin_msa_asub_s_d\n#define msa_abdq_f32(a, b)    msa_absq_f32(__builtin_msa_fsub_w(a, b))\n#define msa_abdq_f64(a, b)    msa_absq_f64(__builtin_msa_fsub_d(a, b))\n#define msa_qabdq_s8(a, b)    msa_qabsq_s8(__builtin_msa_subs_s_b(a, b))\n#define msa_qabdq_s16(a, b)   msa_qabsq_s16(__builtin_msa_subs_s_h(a, b))\n#define msa_qabdq_s32(a, b)   msa_qabsq_s32(__builtin_msa_subs_s_w(a, b))\n#define msa_qabdq_s64(a, b)   msa_qabsq_s64(__builtin_msa_subs_s_d(a, b))\n\n/* sqrtq, rsqrtq */\n#define msa_sqrtq_f32         __builtin_msa_fsqrt_w\n#define msa_sqrtq_f64         __builtin_msa_fsqrt_d\n#define msa_rsqrtq_f32        __builtin_msa_frsqrt_w\n#define msa_rsqrtq_f64        __builtin_msa_frsqrt_d\n\n\n/* mlaq: r = a + b * c; */\n__extension__ extern __inline v4i32\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))\nmsa_mlaq_s32(v4i32 __a, v4i32 __b, v4i32 __c)\n{\n  __asm__ volatile(\"maddv.w %w[__a], %w[__b], %w[__c]\\n\"\n               // Outputs\n               : [__a] \"+f\"(__a)\n               // Inputs\n               : [__b] \"f\"(__b), [__c] \"f\"(__c));\n  return __a;\n}\n\n__extension__ extern __inline v2i64\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))\nmsa_mlaq_s64(v2i64 __a, v2i64 __b, v2i64 __c)\n{\n  __asm__ volatile(\"maddv.d %w[__a], %w[__b], %w[__c]\\n\"\n               // Outputs\n               : [__a] \"+f\"(__a)\n               // Inputs\n               : [__b] \"f\"(__b), [__c] \"f\"(__c));\n  return __a;\n}\n\n__extension__ extern __inline v4f32\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))\nmsa_mlaq_f32(v4f32 __a, v4f32 __b, v4f32 __c)\n{\n  __asm__ volatile(\"fmadd.w %w[__a], %w[__b], %w[__c]\\n\"\n               // Outputs\n               : [__a] \"+f\"(__a)\n               // Inputs\n               : [__b] \"f\"(__b), [__c] \"f\"(__c));\n  return __a;\n}\n\n__extension__ extern __inline v2f64\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))\nmsa_mlaq_f64(v2f64 __a, v2f64 __b, v2f64 __c)\n{\n  __asm__ volatile(\"fmadd.d %w[__a], %w[__b], %w[__c]\\n\"\n               // Outputs\n               : [__a] \"+f\"(__a)\n               // Inputs\n               : [__b] \"f\"(__b), [__c] \"f\"(__c));\n  return __a;\n}\n\n/* cntq */\n#define msa_cntq_s8           __builtin_msa_pcnt_b\n#define msa_cntq_s16          __builtin_msa_pcnt_h\n#define msa_cntq_s32          __builtin_msa_pcnt_w\n#define msa_cntq_s64          __builtin_msa_pcnt_d\n\n/* bslq (a: mask; r = b(if a == 0); r = c(if a == 1);) */\n#define msa_bslq_u8           __builtin_msa_bsel_v\n\n/* ilvrq, ilvlq (For EL only, ilvrq: b0, a0, b1, a1; ilvlq: b2, a2, b3, a3;) */\n#define msa_ilvrq_s8          __builtin_msa_ilvr_b\n#define msa_ilvrq_s16         __builtin_msa_ilvr_h\n#define msa_ilvrq_s32         __builtin_msa_ilvr_w\n#define msa_ilvrq_s64         __builtin_msa_ilvr_d\n#define msa_ilvlq_s8          __builtin_msa_ilvl_b\n#define msa_ilvlq_s16         __builtin_msa_ilvl_h\n#define msa_ilvlq_s32         __builtin_msa_ilvl_w\n#define msa_ilvlq_s64         __builtin_msa_ilvl_d\n\n/* ilvevq, ilvodq (ilvevq: b0, a0, b2, a2; ilvodq: b1, a1, b3, a3; ) */\n#define msa_ilvevq_s8         __builtin_msa_ilvev_b\n#define msa_ilvevq_s16        __builtin_msa_ilvev_h\n#define msa_ilvevq_s32        __builtin_msa_ilvev_w\n#define msa_ilvevq_s64        __builtin_msa_ilvev_d\n#define msa_ilvodq_s8         __builtin_msa_ilvod_b\n#define msa_ilvodq_s16        __builtin_msa_ilvod_h\n#define msa_ilvodq_s32        __builtin_msa_ilvod_w\n#define msa_ilvodq_s64        __builtin_msa_ilvod_d\n\n/* extq (r = (a || b); a concatenation b and get elements from index c) */\n#ifdef _MIPSEB\n#define msa_extq_s8(a, b, c)  \\\n(__builtin_msa_vshf_b(__builtin_msa_subv_b((v16i8)((v2i64){0x1716151413121110, 0x1F1E1D1C1B1A1918}), __builtin_msa_fill_b(c)), a, b))\n#define msa_extq_s16(a, b, c) \\\n(__builtin_msa_vshf_h(__builtin_msa_subv_h((v8i16)((v2i64){0x000B000A00090008, 0x000F000E000D000C}), __builtin_msa_fill_h(c)), a, b))\n#define msa_extq_s32(a, b, c) \\\n(__builtin_msa_vshf_w(__builtin_msa_subv_w((v4i32)((v2i64){0x0000000500000004, 0x0000000700000006}), __builtin_msa_fill_w(c)), a, b))\n#define msa_extq_s64(a, b, c) \\\n(__builtin_msa_vshf_d(__builtin_msa_subv_d((v2i64){0x0000000000000002, 0x0000000000000003}, __builtin_msa_fill_d(c)), a, b))\n#else\n#define msa_extq_s8(a, b, c)  \\\n(__builtin_msa_vshf_b(__builtin_msa_addv_b((v16i8)((v2i64){0x0706050403020100, 0x0F0E0D0C0B0A0908}), __builtin_msa_fill_b(c)), b, a))\n#define msa_extq_s16(a, b, c) \\\n(__builtin_msa_vshf_h(__builtin_msa_addv_h((v8i16)((v2i64){0x0003000200010000, 0x0007000600050004}), __builtin_msa_fill_h(c)), b, a))\n#define msa_extq_s32(a, b, c) \\\n(__builtin_msa_vshf_w(__builtin_msa_addv_w((v4i32)((v2i64){0x0000000100000000, 0x0000000300000002}), __builtin_msa_fill_w(c)), b, a))\n#define msa_extq_s64(a, b, c) \\\n(__builtin_msa_vshf_d(__builtin_msa_addv_d((v2i64){0x0000000000000000, 0x0000000000000001}, __builtin_msa_fill_d(c)), b, a))\n#endif /* _MIPSEB */\n\n/* cvttruncq, cvttintq, cvtrintq */\n#define msa_cvttruncq_u32_f32 __builtin_msa_ftrunc_u_w\n#define msa_cvttruncq_s32_f32 __builtin_msa_ftrunc_s_w\n#define msa_cvttruncq_u64_f64 __builtin_msa_ftrunc_u_d\n#define msa_cvttruncq_s64_f64 __builtin_msa_ftrunc_s_d\n#define msa_cvttintq_u32_f32  __builtin_msa_ftint_u_w\n#define msa_cvttintq_s32_f32  __builtin_msa_ftint_s_w\n#define msa_cvttintq_u64_f64  __builtin_msa_ftint_u_d\n#define msa_cvttintq_s64_f64  __builtin_msa_ftint_s_d\n#define msa_cvtrintq_f32      __builtin_msa_frint_w\n#define msa_cvtrintq_f64      __builtin_msa_frint_d\n\n/* cvtfintq, cvtfq */\n#define msa_cvtfintq_f32_u32  __builtin_msa_ffint_u_w\n#define msa_cvtfintq_f32_s32  __builtin_msa_ffint_s_w\n#define msa_cvtfintq_f64_u64  __builtin_msa_ffint_u_d\n#define msa_cvtfintq_f64_s64  __builtin_msa_ffint_s_d\n#define msa_cvtfq_f32_f64     __builtin_msa_fexdo_w\n#define msa_cvtflq_f64_f32    __builtin_msa_fexupr_d\n#define msa_cvtfhq_f64_f32    __builtin_msa_fexupl_d\n\n#define msa_addl_u8(a, b)     ((v8u16)__builtin_msa_addv_h((v8i16)V8U8_2_V8I16(a), (v8i16)V8U8_2_V8I16(b)))\n#define msa_addl_s8(a, b)     (__builtin_msa_addv_h((v8i16)V8I8_2_V8I16(a), (v8i16)V8I8_2_V8I16(b)))\n#define msa_addl_u16(a, b)    ((v4u32)__builtin_msa_addv_w((v4i32)V4U16_2_V4I32(a), (v4i32)V4U16_2_V4I32(b)))\n#define msa_addl_s16(a, b)    (__builtin_msa_addv_w((v4i32)V4I16_2_V4I32(a), (v4i32)V4I16_2_V4I32(b)))\n#define msa_subl_s16(a, b)    (__builtin_msa_subv_w((v4i32)V4I16_2_V4I32(a), (v4i32)V4I16_2_V4I32(b)))\n#define msa_recpeq_f32        __builtin_msa_frcp_w\n#define msa_recpsq_f32(a, b)  (__builtin_msa_fsub_w(msa_dupq_n_f32(2.0f), __builtin_msa_fmul_w(a, b)))\n\n#define MSA_INTERLEAVED_IMPL_LOAD2_STORE2(_Tp, _Tpv, _Tpvs, suffix, df, nlanes) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_ld2q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b) \\\n{ \\\n  _Tpv v0 = msa_ld1q_##suffix(ptr); \\\n  _Tpv v1 = msa_ld1q_##suffix(ptr + nlanes); \\\n  *a = (_Tpv)__builtin_msa_pckev_##df((_Tpvs)v1, (_Tpvs)v0); \\\n  *b = (_Tpv)__builtin_msa_pckod_##df((_Tpvs)v1, (_Tpvs)v0); \\\n} \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st2q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b) \\\n{ \\\n  msa_st1q_##suffix(ptr, (_Tpv)__builtin_msa_ilvr_##df((_Tpvs)b, (_Tpvs)a)); \\\n  msa_st1q_##suffix(ptr + nlanes, (_Tpv)__builtin_msa_ilvl_##df((_Tpvs)b, (_Tpvs)a)); \\\n}\n\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint8_t, v16u8, v16i8, u8, b, 16)\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(int8_t, v16i8, v16i8, s8, b, 16)\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint16_t, v8u16, v8i16, u16, h, 8)\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(int16_t, v8i16, v8i16, s16, h, 8)\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint32_t, v4u32, v4i32, u32, w, 4)\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(int32_t, v4i32, v4i32, s32, w, 4)\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(float, v4f32, v4i32, f32, w, 4)\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint64_t, v2u64, v2i64, u64, d, 2)\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(int64_t, v2i64, v2i64, s64, d, 2)\nMSA_INTERLEAVED_IMPL_LOAD2_STORE2(double, v2f64, v2i64, f64, d, 2)\n\n#ifdef _MIPSEB\n#define MSA_INTERLEAVED_IMPL_LOAD3_8(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \\\n{ \\\n  _Tpv v0 = msa_ld1q_##suffix(ptr); \\\n  _Tpv v1 = msa_ld1q_##suffix(ptr + 16); \\\n  _Tpv v2 = msa_ld1q_##suffix(ptr + 32); \\\n  _Tpvs v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0704011F1F1F1F1F, 0x1F1C191613100D0A}), (_Tpvs)v0, (_Tpvs)v1); \\\n  *a = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x1716150E0B080502, 0x1F1E1D1C1B1A1918}), v3, (_Tpvs)v2); \\\n  v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0603001F1F1F1F1F, 0x1E1B1815120F0C09}), (_Tpvs)v0, (_Tpvs)v1); \\\n  *b = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x1716150D0A070401, 0x1F1E1D1C1B1A1918}), v3, (_Tpvs)v2); \\\n  v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x05021F1F1F1F1F1F, 0x1D1A1714110E0B08}), (_Tpvs)v0, (_Tpvs)v1); \\\n  *c = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x17160F0C09060300, 0x1F1E1D1C1B1A1918}), v3, (_Tpvs)v2); \\\n}\n#else\n#define MSA_INTERLEAVED_IMPL_LOAD3_8(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \\\n{ \\\n  _Tpv v0 = msa_ld1q_##suffix(ptr); \\\n  _Tpv v1 = msa_ld1q_##suffix(ptr + 16); \\\n  _Tpv v2 = msa_ld1q_##suffix(ptr + 32); \\\n  _Tpvs v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x15120F0C09060300, 0x00000000001E1B18}), (_Tpvs)v1, (_Tpvs)v0); \\\n  *a = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x0706050403020100, 0x1D1A1714110A0908}), (_Tpvs)v2, v3); \\\n  v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x1613100D0A070401, 0x00000000001F1C19}), (_Tpvs)v1, (_Tpvs)v0); \\\n  *b = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x0706050403020100, 0x1E1B1815120A0908}), (_Tpvs)v2, v3); \\\n  v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x1714110E0B080502, 0x0000000000001D1A}), (_Tpvs)v1, (_Tpvs)v0); \\\n  *c = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x0706050403020100, 0x1F1C191613100908}), (_Tpvs)v2, v3); \\\n}\n#endif\n\nMSA_INTERLEAVED_IMPL_LOAD3_8(uint8_t, v16u8, v16i8, u8)\nMSA_INTERLEAVED_IMPL_LOAD3_8(int8_t, v16i8, v16i8, s8)\n\n#ifdef _MIPSEB\n#define MSA_INTERLEAVED_IMPL_LOAD3_16(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \\\n{ \\\n  _Tpv v0 = msa_ld1q_##suffix(ptr); \\\n  _Tpv v1 = msa_ld1q_##suffix(ptr + 8); \\\n  _Tpv v2 = msa_ld1q_##suffix(ptr + 16); \\\n  _Tpvs v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x00030000000F000F, 0x000F000C00090006}), (_Tpvs)v1, (_Tpvs)v0); \\\n  *a = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B000A00050002, 0x000F000E000D000C}), (_Tpvs)v2, v3); \\\n  v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0002000F000F000F, 0x000E000B00080005}), (_Tpvs)v1, (_Tpvs)v0); \\\n  *b = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B000700040001, 0x000F000E000D000C}), (_Tpvs)v2, v3); \\\n  v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0001000F000F000F, 0x000D000A00070004}), (_Tpvs)v1, (_Tpvs)v0); \\\n  *c = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B000600030000, 0x000F000E000D000C}), (_Tpvs)v2, v3); \\\n}\n#else\n#define MSA_INTERLEAVED_IMPL_LOAD3_16(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \\\n{ \\\n  _Tpv v0 = msa_ld1q_##suffix(ptr); \\\n  _Tpv v1 = msa_ld1q_##suffix(ptr + 8); \\\n  _Tpv v2 = msa_ld1q_##suffix(ptr + 16); \\\n  _Tpvs v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0009000600030000, 0x00000000000F000C}), (_Tpvs)v1, (_Tpvs)v0); \\\n  *a = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x0003000200010000, 0x000D000A00050004}), (_Tpvs)v2, v3); \\\n  v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000A000700040001, 0x000000000000000D}), (_Tpvs)v1, (_Tpvs)v0); \\\n  *b = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x0003000200010000, 0x000E000B00080004}), (_Tpvs)v2, v3); \\\n  v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B000800050002, 0x000000000000000E}), (_Tpvs)v1, (_Tpvs)v0); \\\n  *c = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x0003000200010000, 0x000F000C00090004}), (_Tpvs)v2, v3); \\\n}\n#endif\n\nMSA_INTERLEAVED_IMPL_LOAD3_16(uint16_t, v8u16, v8i16, u16)\nMSA_INTERLEAVED_IMPL_LOAD3_16(int16_t, v8i16, v8i16, s16)\n\n#define MSA_INTERLEAVED_IMPL_LOAD3_32(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \\\n{ \\\n  _Tpv v00 = msa_ld1q_##suffix(ptr); \\\n  _Tpv v01 = msa_ld1q_##suffix(ptr + 4); \\\n  _Tpv v02 = msa_ld1q_##suffix(ptr + 8); \\\n  _Tpvs v10 = __builtin_msa_ilvr_w((_Tpvs)__builtin_msa_ilvl_d((v2i64)v01, (v2i64)v01), (_Tpvs)v00); \\\n  _Tpvs v11 = __builtin_msa_ilvr_w((_Tpvs)v02, (_Tpvs)__builtin_msa_ilvl_d((v2i64)v00, (v2i64)v00)); \\\n  _Tpvs v12 = __builtin_msa_ilvr_w((_Tpvs)__builtin_msa_ilvl_d((v2i64)v02, (v2i64)v02), (_Tpvs)v01); \\\n  *a = (_Tpv)__builtin_msa_ilvr_w((_Tpvs)__builtin_msa_ilvl_d((v2i64)v11, (v2i64)v11), v10); \\\n  *b = (_Tpv)__builtin_msa_ilvr_w(v12, (_Tpvs)__builtin_msa_ilvl_d((v2i64)v10, (v2i64)v10)); \\\n  *c = (_Tpv)__builtin_msa_ilvr_w((_Tpvs)__builtin_msa_ilvl_d((v2i64)v12, (v2i64)v12), v11); \\\n}\n\nMSA_INTERLEAVED_IMPL_LOAD3_32(uint32_t, v4u32, v4i32, u32)\nMSA_INTERLEAVED_IMPL_LOAD3_32(int32_t, v4i32, v4i32, s32)\nMSA_INTERLEAVED_IMPL_LOAD3_32(float, v4f32, v4i32, f32)\n\n#define MSA_INTERLEAVED_IMPL_LOAD3_64(_Tp, _Tpv, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \\\n{ \\\n  *((_Tp*)a) = *ptr;           *((_Tp*)b) = *(ptr + 1);     *((_Tp*)c) = *(ptr + 2);     \\\n  *((_Tp*)a + 1) = *(ptr + 3); *((_Tp*)b + 1) = *(ptr + 4); *((_Tp*)c + 1) = *(ptr + 5); \\\n}\n\nMSA_INTERLEAVED_IMPL_LOAD3_64(uint64_t, v2u64, u64)\nMSA_INTERLEAVED_IMPL_LOAD3_64(int64_t, v2i64, s64)\nMSA_INTERLEAVED_IMPL_LOAD3_64(double, v2f64, f64)\n\n#ifdef _MIPSEB\n#define MSA_INTERLEAVED_IMPL_STORE3_8(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \\\n{ \\\n  _Tpvs v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0F0E0D0C0B1F1F1F, 0x1F1E1D1C1B1A1F1F}), (_Tpvs)b, (_Tpvs)a); \\\n  _Tpvs v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0D1C140C1B130B1A, 0x1F170F1E160E1D15}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0A09080706051F1F, 0x19181716151F1F1F}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x1D14071C13061B12, 0x170A1F16091E1508}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x04030201001F1F1F, 0x14131211101F1F1F}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x15021C14011B1300, 0x051F17041E16031D}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 32, (_Tpv)v1); \\\n}\n#else\n#define MSA_INTERLEAVED_IMPL_STORE3_8(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \\\n{ \\\n  _Tpvs v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0000050403020100, 0x0000001413121110}), (_Tpvs)b, (_Tpvs)a); \\\n  _Tpvs v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0A02110901100800, 0x05140C04130B0312}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0000000A09080706, 0x00001A1918171615}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x170A011609001508, 0x0D04190C03180B02}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0000000F0E0D0C0B, 0x0000001F1E1D1C1B}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x021C09011B08001A, 0x1F0C041E0B031D0A}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 32, (_Tpv)v1); \\\n}\n#endif\n\nMSA_INTERLEAVED_IMPL_STORE3_8(uint8_t, v16u8, v16i8, u8)\nMSA_INTERLEAVED_IMPL_STORE3_8(int8_t, v16i8, v16i8, s8)\n\n#ifdef _MIPSEB\n#define MSA_INTERLEAVED_IMPL_STORE3_16(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \\\n{ \\\n  _Tpvs v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000700060005000F, 0x000F000E000D000F}), (_Tpvs)b, (_Tpvs)a); \\\n  _Tpvs v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000A0006000D0009, 0x000F000B0007000E}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x00040003000F000F, 0x000C000B000A000F}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000E000A0003000D, 0x0005000F000B0004}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000200010000000F, 0x00090008000F000F}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0001000E00090000, 0x000B0002000F000A}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \\\n}\n#else\n#define MSA_INTERLEAVED_IMPL_STORE3_16(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \\\n{ \\\n  _Tpvs v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0000000200010000, 0x0000000A00090008}), (_Tpvs)b, (_Tpvs)a); \\\n  _Tpvs v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0001000800040000, 0x0006000200090005}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0000000500040003, 0x00000000000C000B}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B00040000000A, 0x0002000C00050001}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0000000000070006, 0x0000000F000E000D}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x00050000000D0004, 0x000F00060001000E}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \\\n}\n#endif\n\nMSA_INTERLEAVED_IMPL_STORE3_16(uint16_t, v8u16, v8i16, u16)\nMSA_INTERLEAVED_IMPL_STORE3_16(int16_t, v8i16, v8i16, s16)\n\n#ifdef _MIPSEB\n#define MSA_INTERLEAVED_IMPL_STORE3_32(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \\\n{ \\\n  _Tpvs v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000300000007, 0x0000000700000006}), (_Tpvs)b, (_Tpvs)a); \\\n  _Tpvs v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000300000006, 0x0000000700000005}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000200000001, 0x0000000500000007}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000700000004, 0x0000000500000002}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 4, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000000000007, 0x0000000400000007}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000500000000, 0x0000000100000007}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \\\n}\n#else\n#define MSA_INTERLEAVED_IMPL_STORE3_32(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \\\n{ \\\n  _Tpvs v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000100000000, 0x0000000000000004}), (_Tpvs)b, (_Tpvs)a); \\\n  _Tpvs v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000200000000, 0x0000000100000004}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000000000002, 0x0000000600000005}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000500000002, 0x0000000300000000}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 4, (_Tpv)v1); \\\n  v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000000000003, 0x0000000000000007}), (_Tpvs)b, (_Tpvs)a); \\\n  v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000000000006, 0x0000000700000002}), (_Tpvs)c, (_Tpvs)v0); \\\n  msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \\\n}\n#endif\n\nMSA_INTERLEAVED_IMPL_STORE3_32(uint32_t, v4u32, v4i32, u32)\nMSA_INTERLEAVED_IMPL_STORE3_32(int32_t, v4i32, v4i32, s32)\nMSA_INTERLEAVED_IMPL_STORE3_32(float, v4f32, v4i32, f32)\n\n#define MSA_INTERLEAVED_IMPL_STORE3_64(_Tp, _Tpv, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \\\n{ \\\n  *ptr = a[0];       *(ptr + 1) = b[0]; *(ptr + 2) = c[0]; \\\n  *(ptr + 3) = a[1]; *(ptr + 4) = b[1]; *(ptr + 5) = c[1]; \\\n}\n\nMSA_INTERLEAVED_IMPL_STORE3_64(uint64_t, v2u64, u64)\nMSA_INTERLEAVED_IMPL_STORE3_64(int64_t, v2i64, s64)\nMSA_INTERLEAVED_IMPL_STORE3_64(double, v2f64, f64)\n\n#define MSA_INTERLEAVED_IMPL_LOAD4_STORE4(_Tp, _Tpv, _Tpvs, suffix, df, nlanes) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_ld4q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c, _Tpv* d) \\\n{ \\\n  _Tpv v0 = msa_ld1q_##suffix(ptr); \\\n  _Tpv v1 = msa_ld1q_##suffix(ptr + nlanes); \\\n  _Tpv v2 = msa_ld1q_##suffix(ptr + nlanes * 2); \\\n  _Tpv v3 = msa_ld1q_##suffix(ptr + nlanes * 3); \\\n  _Tpvs t0 = __builtin_msa_pckev_##df((_Tpvs)v1, (_Tpvs)v0); \\\n  _Tpvs t1 = __builtin_msa_pckev_##df((_Tpvs)v3, (_Tpvs)v2); \\\n  _Tpvs t2 = __builtin_msa_pckod_##df((_Tpvs)v1, (_Tpvs)v0); \\\n  _Tpvs t3 = __builtin_msa_pckod_##df((_Tpvs)v3, (_Tpvs)v2); \\\n  *a = (_Tpv)__builtin_msa_pckev_##df(t1, t0); \\\n  *b = (_Tpv)__builtin_msa_pckev_##df(t3, t2); \\\n  *c = (_Tpv)__builtin_msa_pckod_##df(t1, t0); \\\n  *d = (_Tpv)__builtin_msa_pckod_##df(t3, t2); \\\n} \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st4q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c, const _Tpv d) \\\n{ \\\n  _Tpvs v0 = __builtin_msa_ilvr_##df((_Tpvs)c, (_Tpvs)a); \\\n  _Tpvs v1 = __builtin_msa_ilvr_##df((_Tpvs)d, (_Tpvs)b); \\\n  _Tpvs v2 = __builtin_msa_ilvl_##df((_Tpvs)c, (_Tpvs)a); \\\n  _Tpvs v3 = __builtin_msa_ilvl_##df((_Tpvs)d, (_Tpvs)b); \\\n  msa_st1q_##suffix(ptr, (_Tpv)__builtin_msa_ilvr_##df(v1, v0)); \\\n  msa_st1q_##suffix(ptr + nlanes, (_Tpv)__builtin_msa_ilvl_##df(v1, v0)); \\\n  msa_st1q_##suffix(ptr + 2 * nlanes, (_Tpv)__builtin_msa_ilvr_##df(v3, v2)); \\\n  msa_st1q_##suffix(ptr + 3 * nlanes, (_Tpv)__builtin_msa_ilvl_##df(v3, v2)); \\\n}\n\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4(uint8_t, v16u8, v16i8, u8, b, 16)\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4(int8_t, v16i8, v16i8, s8, b, 16)\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4(uint16_t, v8u16, v8i16, u16, h, 8)\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4(int16_t, v8i16, v8i16, s16, h, 8)\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4(uint32_t, v4u32, v4i32, u32, w, 4)\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4(int32_t, v4i32, v4i32, s32, w, 4)\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4(float, v4f32, v4i32, f32, w, 4)\n\n#define MSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(_Tp, _Tpv, _Tpvs, suffix) \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_ld4q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c, _Tpv* d) \\\n{ \\\n  _Tpv v0 = msa_ld1q_##suffix(ptr); \\\n  _Tpv v1 = msa_ld1q_##suffix(ptr + 2); \\\n  _Tpv v2 = msa_ld1q_##suffix(ptr + 4); \\\n  _Tpv v3 = msa_ld1q_##suffix(ptr + 6); \\\n  *a = (_Tpv)__builtin_msa_ilvr_d((_Tpvs)v2, (_Tpvs)v0); \\\n  *b = (_Tpv)__builtin_msa_ilvl_d((_Tpvs)v2, (_Tpvs)v0); \\\n  *c = (_Tpv)__builtin_msa_ilvr_d((_Tpvs)v3, (_Tpvs)v1); \\\n  *d = (_Tpv)__builtin_msa_ilvl_d((_Tpvs)v3, (_Tpvs)v1); \\\n} \\\n__extension__ extern __inline void \\\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \\\nmsa_st4q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c, const _Tpv d) \\\n{ \\\n  msa_st1q_##suffix(ptr, (_Tpv)__builtin_msa_ilvr_d((_Tpvs)b, (_Tpvs)a)); \\\n  msa_st1q_##suffix(ptr + 2, (_Tpv)__builtin_msa_ilvr_d((_Tpvs)d, (_Tpvs)c)); \\\n  msa_st1q_##suffix(ptr + 4, (_Tpv)__builtin_msa_ilvl_d((_Tpvs)b, (_Tpvs)a)); \\\n  msa_st1q_##suffix(ptr + 6, (_Tpv)__builtin_msa_ilvl_d((_Tpvs)d, (_Tpvs)c)); \\\n}\n\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(uint64_t, v2u64, v2i64, u64)\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(int64_t, v2i64, v2i64, s64)\nMSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(double, v2f64, v2i64, f64)\n\n__extension__ extern __inline v8i16\n__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))\nmsa_qdmulhq_n_s16(v8i16 a, int16_t b)\n{\n  v8i16 a_lo, a_hi;\n  ILVRL_H2_SH(a, msa_dupq_n_s16(0), a_lo, a_hi);\n  return msa_packr_s32(msa_shlq_n_s32(msa_mulq_s32(msa_paddlq_s16(a_lo), msa_dupq_n_s32(b)), 1),\n                       msa_shlq_n_s32(msa_mulq_s32(msa_paddlq_s16(a_hi), msa_dupq_n_s32(b)), 1), 16);\n}\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n#endif /*__mips_msa*/\n#endif /* OPENCV_CORE_MSA_MACROS_H */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/hal/simd_utils.impl.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html\n\n// This header is not standalone. Don't include directly, use \"intrin.hpp\" instead.\n#ifdef OPENCV_HAL_INTRIN_HPP  // defined in intrin.hpp\n\n\n#if CV_SIMD128 || CV_SIMD128_CPP\n\ntemplate<typename _T> struct Type2Vec128_Traits;\n#define CV_INTRIN_DEF_TYPE2VEC128_TRAITS(type_, vec_type_) \\\n    template<> struct Type2Vec128_Traits<type_> \\\n    { \\\n        typedef vec_type_ vec_type; \\\n    }\n\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(uchar, v_uint8x16);\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(schar, v_int8x16);\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(ushort, v_uint16x8);\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(short, v_int16x8);\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(unsigned, v_uint32x4);\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(int, v_int32x4);\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(float, v_float32x4);\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(uint64, v_uint64x2);\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(int64, v_int64x2);\n#if CV_SIMD128_64F\nCV_INTRIN_DEF_TYPE2VEC128_TRAITS(double, v_float64x2);\n#endif\n\ntemplate<typename _T> static inline\ntypename Type2Vec128_Traits<_T>::vec_type v_setall(const _T& a);\n\ntemplate<> inline Type2Vec128_Traits< uchar>::vec_type v_setall< uchar>(const  uchar& a) { return v_setall_u8(a); }\ntemplate<> inline Type2Vec128_Traits< schar>::vec_type v_setall< schar>(const  schar& a) { return v_setall_s8(a); }\ntemplate<> inline Type2Vec128_Traits<ushort>::vec_type v_setall<ushort>(const ushort& a) { return v_setall_u16(a); }\ntemplate<> inline Type2Vec128_Traits< short>::vec_type v_setall< short>(const  short& a) { return v_setall_s16(a); }\ntemplate<> inline Type2Vec128_Traits<  uint>::vec_type v_setall<  uint>(const   uint& a) { return v_setall_u32(a); }\ntemplate<> inline Type2Vec128_Traits<   int>::vec_type v_setall<   int>(const    int& a) { return v_setall_s32(a); }\ntemplate<> inline Type2Vec128_Traits<uint64>::vec_type v_setall<uint64>(const uint64& a) { return v_setall_u64(a); }\ntemplate<> inline Type2Vec128_Traits< int64>::vec_type v_setall< int64>(const  int64& a) { return v_setall_s64(a); }\ntemplate<> inline Type2Vec128_Traits< float>::vec_type v_setall< float>(const  float& a) { return v_setall_f32(a); }\n#if CV_SIMD128_64F\ntemplate<> inline Type2Vec128_Traits<double>::vec_type v_setall<double>(const double& a) { return v_setall_f64(a); }\n#endif\n\n#endif  // SIMD128\n\n\n#if CV_SIMD256\n\ntemplate<typename _T> struct Type2Vec256_Traits;\n#define CV_INTRIN_DEF_TYPE2VEC256_TRAITS(type_, vec_type_) \\\n    template<> struct Type2Vec256_Traits<type_> \\\n    { \\\n        typedef vec_type_ vec_type; \\\n    }\n\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(uchar, v_uint8x32);\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(schar, v_int8x32);\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(ushort, v_uint16x16);\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(short, v_int16x16);\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(unsigned, v_uint32x8);\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(int, v_int32x8);\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(float, v_float32x8);\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(uint64, v_uint64x4);\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(int64, v_int64x4);\n#if CV_SIMD256_64F\nCV_INTRIN_DEF_TYPE2VEC256_TRAITS(double, v_float64x4);\n#endif\n\ntemplate<typename _T> static inline\ntypename Type2Vec256_Traits<_T>::vec_type v256_setall(const _T& a);\n\ntemplate<> inline Type2Vec256_Traits< uchar>::vec_type v256_setall< uchar>(const  uchar& a) { return v256_setall_u8(a); }\ntemplate<> inline Type2Vec256_Traits< schar>::vec_type v256_setall< schar>(const  schar& a) { return v256_setall_s8(a); }\ntemplate<> inline Type2Vec256_Traits<ushort>::vec_type v256_setall<ushort>(const ushort& a) { return v256_setall_u16(a); }\ntemplate<> inline Type2Vec256_Traits< short>::vec_type v256_setall< short>(const  short& a) { return v256_setall_s16(a); }\ntemplate<> inline Type2Vec256_Traits<  uint>::vec_type v256_setall<  uint>(const   uint& a) { return v256_setall_u32(a); }\ntemplate<> inline Type2Vec256_Traits<   int>::vec_type v256_setall<   int>(const    int& a) { return v256_setall_s32(a); }\ntemplate<> inline Type2Vec256_Traits<uint64>::vec_type v256_setall<uint64>(const uint64& a) { return v256_setall_u64(a); }\ntemplate<> inline Type2Vec256_Traits< int64>::vec_type v256_setall< int64>(const  int64& a) { return v256_setall_s64(a); }\ntemplate<> inline Type2Vec256_Traits< float>::vec_type v256_setall< float>(const  float& a) { return v256_setall_f32(a); }\n#if CV_SIMD256_64F\ntemplate<> inline Type2Vec256_Traits<double>::vec_type v256_setall<double>(const double& a) { return v256_setall_f64(a); }\n#endif\n\n#endif  // SIMD256\n\n\n#if CV_SIMD512\n\ntemplate<typename _T> struct Type2Vec512_Traits;\n#define CV_INTRIN_DEF_TYPE2VEC512_TRAITS(type_, vec_type_) \\\n    template<> struct Type2Vec512_Traits<type_> \\\n    { \\\n        typedef vec_type_ vec_type; \\\n    }\n\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(uchar, v_uint8x64);\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(schar, v_int8x64);\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(ushort, v_uint16x32);\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(short, v_int16x32);\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(unsigned, v_uint32x16);\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(int, v_int32x16);\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(float, v_float32x16);\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(uint64, v_uint64x8);\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(int64, v_int64x8);\n#if CV_SIMD512_64F\nCV_INTRIN_DEF_TYPE2VEC512_TRAITS(double, v_float64x8);\n#endif\n\ntemplate<typename _T> static inline\ntypename Type2Vec512_Traits<_T>::vec_type v512_setall(const _T& a);\n\ntemplate<> inline Type2Vec512_Traits< uchar>::vec_type v512_setall< uchar>(const  uchar& a) { return v512_setall_u8(a); }\ntemplate<> inline Type2Vec512_Traits< schar>::vec_type v512_setall< schar>(const  schar& a) { return v512_setall_s8(a); }\ntemplate<> inline Type2Vec512_Traits<ushort>::vec_type v512_setall<ushort>(const ushort& a) { return v512_setall_u16(a); }\ntemplate<> inline Type2Vec512_Traits< short>::vec_type v512_setall< short>(const  short& a) { return v512_setall_s16(a); }\ntemplate<> inline Type2Vec512_Traits<  uint>::vec_type v512_setall<  uint>(const   uint& a) { return v512_setall_u32(a); }\ntemplate<> inline Type2Vec512_Traits<   int>::vec_type v512_setall<   int>(const    int& a) { return v512_setall_s32(a); }\ntemplate<> inline Type2Vec512_Traits<uint64>::vec_type v512_setall<uint64>(const uint64& a) { return v512_setall_u64(a); }\ntemplate<> inline Type2Vec512_Traits< int64>::vec_type v512_setall< int64>(const  int64& a) { return v512_setall_s64(a); }\ntemplate<> inline Type2Vec512_Traits< float>::vec_type v512_setall< float>(const  float& a) { return v512_setall_f32(a); }\n#if CV_SIMD512_64F\ntemplate<> inline Type2Vec512_Traits<double>::vec_type v512_setall<double>(const double& a) { return v512_setall_f64(a); }\n#endif\n\n#endif  // SIMD512\n\n\n#if CV_SIMD_WIDTH == 16\ntemplate<typename _T> static inline\ntypename Type2Vec128_Traits<_T>::vec_type vx_setall(const _T& a) { return v_setall(a); }\n#elif CV_SIMD_WIDTH == 32\ntemplate<typename _T> static inline\ntypename Type2Vec256_Traits<_T>::vec_type vx_setall(const _T& a) { return v256_setall(a); }\n#elif CV_SIMD_WIDTH == 64\ntemplate<typename _T> static inline\ntypename Type2Vec512_Traits<_T>::vec_type vx_setall(const _T& a) { return v512_setall(a); }\n#else\n#error \"Build configuration error, unsupported CV_SIMD_WIDTH\"\n#endif\n\n\n#endif  // OPENCV_HAL_INTRIN_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/mat.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_MAT_HPP\n#define OPENCV_CORE_MAT_HPP\n\n#ifndef __cplusplus\n#  error mat.hpp header must be compiled as C++\n#endif\n\n#include \"opencv2/core/matx.hpp\"\n#include \"opencv2/core/types.hpp\"\n\n#include \"opencv2/core/bufferpool.hpp\"\n\n#include <type_traits>\n\nnamespace cv\n{\n\n//! @addtogroup core_basic\n//! @{\n\nenum AccessFlag { ACCESS_READ=1<<24, ACCESS_WRITE=1<<25,\n    ACCESS_RW=3<<24, ACCESS_MASK=ACCESS_RW, ACCESS_FAST=1<<26 };\nCV_ENUM_FLAGS(AccessFlag)\n__CV_ENUM_FLAGS_BITWISE_AND(AccessFlag, int, AccessFlag)\n\nCV__DEBUG_NS_BEGIN\n\nclass CV_EXPORTS _OutputArray;\n\n//////////////////////// Input/Output Array Arguments /////////////////////////////////\n\n/** @brief This is the proxy class for passing read-only input arrays into OpenCV functions.\n\nIt is defined as:\n@code\n    typedef const _InputArray& InputArray;\n@endcode\nwhere _InputArray is a class that can be constructed from `Mat`, `Mat_<T>`, `Matx<T, m, n>`,\n`std::vector<T>`, `std::vector<std::vector<T> >`, `std::vector<Mat>`, `std::vector<Mat_<T> >`,\n`UMat`, `std::vector<UMat>` or `double`. It can also be constructed from a matrix expression.\n\nSince this is mostly implementation-level class, and its interface may change in future versions, we\ndo not describe it in details. There are a few key things, though, that should be kept in mind:\n\n-   When you see in the reference manual or in OpenCV source code a function that takes\n    InputArray, it means that you can actually pass `Mat`, `Matx`, `vector<T>` etc. (see above the\n    complete list).\n-   Optional input arguments: If some of the input arrays may be empty, pass cv::noArray() (or\n    simply cv::Mat() as you probably did before).\n-   The class is designed solely for passing parameters. That is, normally you *should not*\n    declare class members, local and global variables of this type.\n-   If you want to design your own function or a class method that can operate of arrays of\n    multiple types, you can use InputArray (or OutputArray) for the respective parameters. Inside\n    a function you should use _InputArray::getMat() method to construct a matrix header for the\n    array (without copying data). _InputArray::kind() can be used to distinguish Mat from\n    `vector<>` etc., but normally it is not needed.\n\nHere is how you can use a function that takes InputArray :\n@code\n    std::vector<Point2f> vec;\n    // points or a circle\n    for( int i = 0; i < 30; i++ )\n        vec.push_back(Point2f((float)(100 + 30*cos(i*CV_PI*2/5)),\n                              (float)(100 - 30*sin(i*CV_PI*2/5))));\n    cv::transform(vec, vec, cv::Matx23f(0.707, -0.707, 10, 0.707, 0.707, 20));\n@endcode\nThat is, we form an STL vector containing points, and apply in-place affine transformation to the\nvector using the 2x3 matrix created inline as `Matx<float, 2, 3>` instance.\n\nHere is how such a function can be implemented (for simplicity, we implement a very specific case of\nit, according to the assertion statement inside) :\n@code\n    void myAffineTransform(InputArray _src, OutputArray _dst, InputArray _m)\n    {\n        // get Mat headers for input arrays. This is O(1) operation,\n        // unless _src and/or _m are matrix expressions.\n        Mat src = _src.getMat(), m = _m.getMat();\n        CV_Assert( src.type() == CV_32FC2 && m.type() == CV_32F && m.size() == Size(3, 2) );\n\n        // [re]create the output array so that it has the proper size and type.\n        // In case of Mat it calls Mat::create, in case of STL vector it calls vector::resize.\n        _dst.create(src.size(), src.type());\n        Mat dst = _dst.getMat();\n\n        for( int i = 0; i < src.rows; i++ )\n            for( int j = 0; j < src.cols; j++ )\n            {\n                Point2f pt = src.at<Point2f>(i, j);\n                dst.at<Point2f>(i, j) = Point2f(m.at<float>(0, 0)*pt.x +\n                                                m.at<float>(0, 1)*pt.y +\n                                                m.at<float>(0, 2),\n                                                m.at<float>(1, 0)*pt.x +\n                                                m.at<float>(1, 1)*pt.y +\n                                                m.at<float>(1, 2));\n            }\n    }\n@endcode\nThere is another related type, InputArrayOfArrays, which is currently defined as a synonym for\nInputArray:\n@code\n    typedef InputArray InputArrayOfArrays;\n@endcode\nIt denotes function arguments that are either vectors of vectors or vectors of matrices. A separate\nsynonym is needed to generate Python/Java etc. wrappers properly. At the function implementation\nlevel their use is similar, but _InputArray::getMat(idx) should be used to get header for the\nidx-th component of the outer vector and _InputArray::size().area() should be used to find the\nnumber of components (vectors/matrices) of the outer vector.\n\nIn general, type support is limited to cv::Mat types. Other types are forbidden.\nBut in some cases we need to support passing of custom non-general Mat types, like arrays of cv::KeyPoint, cv::DMatch, etc.\nThis data is not intended to be interpreted as an image data, or processed somehow like regular cv::Mat.\nTo pass such custom type use rawIn() / rawOut() / rawInOut() wrappers.\nCustom type is wrapped as Mat-compatible `CV_8UC<N>` values (N = sizeof(T), N <= CV_CN_MAX).\n */\nclass CV_EXPORTS _InputArray\n{\npublic:\n    enum KindFlag {\n        KIND_SHIFT = 16,\n        FIXED_TYPE = 0x8000 << KIND_SHIFT,\n        FIXED_SIZE = 0x4000 << KIND_SHIFT,\n        KIND_MASK = 31 << KIND_SHIFT,\n\n        NONE              = 0 << KIND_SHIFT,\n        MAT               = 1 << KIND_SHIFT,\n        MATX              = 2 << KIND_SHIFT,\n        STD_VECTOR        = 3 << KIND_SHIFT,\n        STD_VECTOR_VECTOR = 4 << KIND_SHIFT,\n        STD_VECTOR_MAT    = 5 << KIND_SHIFT,\n#if OPENCV_ABI_COMPATIBILITY < 500\n        EXPR              = 6 << KIND_SHIFT,  //!< removed: https://github.com/opencv/opencv/pull/17046\n#endif\n        OPENGL_BUFFER     = 7 << KIND_SHIFT,\n        CUDA_HOST_MEM     = 8 << KIND_SHIFT,\n        CUDA_GPU_MAT      = 9 << KIND_SHIFT,\n        UMAT              =10 << KIND_SHIFT,\n        STD_VECTOR_UMAT   =11 << KIND_SHIFT,\n        STD_BOOL_VECTOR   =12 << KIND_SHIFT,\n        STD_VECTOR_CUDA_GPU_MAT = 13 << KIND_SHIFT,\n#if OPENCV_ABI_COMPATIBILITY < 500\n        STD_ARRAY         =14 << KIND_SHIFT,  //!< removed: https://github.com/opencv/opencv/issues/18897\n#endif\n        STD_ARRAY_MAT     =15 << KIND_SHIFT\n    };\n\n    _InputArray();\n    _InputArray(int _flags, void* _obj);\n    _InputArray(const Mat& m);\n    _InputArray(const MatExpr& expr);\n    _InputArray(const std::vector<Mat>& vec);\n    template<typename _Tp> _InputArray(const Mat_<_Tp>& m);\n    template<typename _Tp> _InputArray(const std::vector<_Tp>& vec);\n    _InputArray(const std::vector<bool>& vec);\n    template<typename _Tp> _InputArray(const std::vector<std::vector<_Tp> >& vec);\n    _InputArray(const std::vector<std::vector<bool> >&) = delete;  // not supported\n    template<typename _Tp> _InputArray(const std::vector<Mat_<_Tp> >& vec);\n    template<typename _Tp> _InputArray(const _Tp* vec, int n);\n    template<typename _Tp, int m, int n> _InputArray(const Matx<_Tp, m, n>& matx);\n    _InputArray(const double& val);\n    _InputArray(const cuda::GpuMat& d_mat);\n    _InputArray(const std::vector<cuda::GpuMat>& d_mat_array);\n    _InputArray(const ogl::Buffer& buf);\n    _InputArray(const cuda::HostMem& cuda_mem);\n    template<typename _Tp> _InputArray(const cudev::GpuMat_<_Tp>& m);\n    _InputArray(const UMat& um);\n    _InputArray(const std::vector<UMat>& umv);\n\n    template<typename _Tp, std::size_t _Nm> _InputArray(const std::array<_Tp, _Nm>& arr);\n    template<std::size_t _Nm> _InputArray(const std::array<Mat, _Nm>& arr);\n\n    template<typename _Tp> static _InputArray rawIn(const std::vector<_Tp>& vec);\n    template<typename _Tp, std::size_t _Nm> static _InputArray rawIn(const std::array<_Tp, _Nm>& arr);\n\n    Mat getMat(int idx=-1) const;\n    Mat getMat_(int idx=-1) const;\n    UMat getUMat(int idx=-1) const;\n    void getMatVector(std::vector<Mat>& mv) const;\n    void getUMatVector(std::vector<UMat>& umv) const;\n    void getGpuMatVector(std::vector<cuda::GpuMat>& gpumv) const;\n    cuda::GpuMat getGpuMat() const;\n    ogl::Buffer getOGlBuffer() const;\n\n    int getFlags() const;\n    void* getObj() const;\n    Size getSz() const;\n\n    _InputArray::KindFlag kind() const;\n    int dims(int i=-1) const;\n    int cols(int i=-1) const;\n    int rows(int i=-1) const;\n    Size size(int i=-1) const;\n    int sizend(int* sz, int i=-1) const;\n    bool sameSize(const _InputArray& arr) const;\n    size_t total(int i=-1) const;\n    int type(int i=-1) const;\n    int depth(int i=-1) const;\n    int channels(int i=-1) const;\n    bool isContinuous(int i=-1) const;\n    bool isSubmatrix(int i=-1) const;\n    bool empty() const;\n    void copyTo(const _OutputArray& arr) const;\n    void copyTo(const _OutputArray& arr, const _InputArray & mask) const;\n    size_t offset(int i=-1) const;\n    size_t step(int i=-1) const;\n    bool isMat() const;\n    bool isUMat() const;\n    bool isMatVector() const;\n    bool isUMatVector() const;\n    bool isMatx() const;\n    bool isVector() const;\n    bool isGpuMat() const;\n    bool isGpuMatVector() const;\n    ~_InputArray();\n\nprotected:\n    int flags;\n    void* obj;\n    Size sz;\n\n    void init(int _flags, const void* _obj);\n    void init(int _flags, const void* _obj, Size _sz);\n};\nCV_ENUM_FLAGS(_InputArray::KindFlag)\n__CV_ENUM_FLAGS_BITWISE_AND(_InputArray::KindFlag, int, _InputArray::KindFlag)\n\n/** @brief This type is very similar to InputArray except that it is used for input/output and output function\nparameters.\n\nJust like with InputArray, OpenCV users should not care about OutputArray, they just pass `Mat`,\n`vector<T>` etc. to the functions. The same limitation as for `InputArray`: *Do not explicitly\ncreate OutputArray instances* applies here too.\n\nIf you want to make your function polymorphic (i.e. accept different arrays as output parameters),\nit is also not very difficult. Take the sample above as the reference. Note that\n_OutputArray::create() needs to be called before _OutputArray::getMat(). This way you guarantee\nthat the output array is properly allocated.\n\nOptional output parameters. If you do not need certain output array to be computed and returned to\nyou, pass cv::noArray(), just like you would in the case of optional input array. At the\nimplementation level, use _OutputArray::needed() to check if certain output array needs to be\ncomputed or not.\n\nThere are several synonyms for OutputArray that are used to assist automatic Python/Java/... wrapper\ngenerators:\n@code\n    typedef OutputArray OutputArrayOfArrays;\n    typedef OutputArray InputOutputArray;\n    typedef OutputArray InputOutputArrayOfArrays;\n@endcode\n */\nclass CV_EXPORTS _OutputArray : public _InputArray\n{\npublic:\n    enum DepthMask\n    {\n        DEPTH_MASK_8U = 1 << CV_8U,\n        DEPTH_MASK_8S = 1 << CV_8S,\n        DEPTH_MASK_16U = 1 << CV_16U,\n        DEPTH_MASK_16S = 1 << CV_16S,\n        DEPTH_MASK_32S = 1 << CV_32S,\n        DEPTH_MASK_32F = 1 << CV_32F,\n        DEPTH_MASK_64F = 1 << CV_64F,\n        DEPTH_MASK_16F = 1 << CV_16F,\n        DEPTH_MASK_ALL = (DEPTH_MASK_64F<<1)-1,\n        DEPTH_MASK_ALL_BUT_8S = DEPTH_MASK_ALL & ~DEPTH_MASK_8S,\n        DEPTH_MASK_ALL_16F = (DEPTH_MASK_16F<<1)-1,\n        DEPTH_MASK_FLT = DEPTH_MASK_32F + DEPTH_MASK_64F\n    };\n\n    _OutputArray();\n    _OutputArray(int _flags, void* _obj);\n    _OutputArray(Mat& m);\n    _OutputArray(std::vector<Mat>& vec);\n    _OutputArray(cuda::GpuMat& d_mat);\n    _OutputArray(std::vector<cuda::GpuMat>& d_mat);\n    _OutputArray(ogl::Buffer& buf);\n    _OutputArray(cuda::HostMem& cuda_mem);\n    template<typename _Tp> _OutputArray(cudev::GpuMat_<_Tp>& m);\n    template<typename _Tp> _OutputArray(std::vector<_Tp>& vec);\n    _OutputArray(std::vector<bool>& vec) = delete;  // not supported\n    template<typename _Tp> _OutputArray(std::vector<std::vector<_Tp> >& vec);\n    _OutputArray(std::vector<std::vector<bool> >&) = delete;  // not supported\n    template<typename _Tp> _OutputArray(std::vector<Mat_<_Tp> >& vec);\n    template<typename _Tp> _OutputArray(Mat_<_Tp>& m);\n    template<typename _Tp> _OutputArray(_Tp* vec, int n);\n    template<typename _Tp, int m, int n> _OutputArray(Matx<_Tp, m, n>& matx);\n    _OutputArray(UMat& m);\n    _OutputArray(std::vector<UMat>& vec);\n\n    _OutputArray(const Mat& m);\n    _OutputArray(const std::vector<Mat>& vec);\n    _OutputArray(const cuda::GpuMat& d_mat);\n    _OutputArray(const std::vector<cuda::GpuMat>& d_mat);\n    _OutputArray(const ogl::Buffer& buf);\n    _OutputArray(const cuda::HostMem& cuda_mem);\n    template<typename _Tp> _OutputArray(const cudev::GpuMat_<_Tp>& m);\n    template<typename _Tp> _OutputArray(const std::vector<_Tp>& vec);\n    template<typename _Tp> _OutputArray(const std::vector<std::vector<_Tp> >& vec);\n    template<typename _Tp> _OutputArray(const std::vector<Mat_<_Tp> >& vec);\n    template<typename _Tp> _OutputArray(const Mat_<_Tp>& m);\n    template<typename _Tp> _OutputArray(const _Tp* vec, int n);\n    template<typename _Tp, int m, int n> _OutputArray(const Matx<_Tp, m, n>& matx);\n    _OutputArray(const UMat& m);\n    _OutputArray(const std::vector<UMat>& vec);\n\n    template<typename _Tp, std::size_t _Nm> _OutputArray(std::array<_Tp, _Nm>& arr);\n    template<typename _Tp, std::size_t _Nm> _OutputArray(const std::array<_Tp, _Nm>& arr);\n    template<std::size_t _Nm> _OutputArray(std::array<Mat, _Nm>& arr);\n    template<std::size_t _Nm> _OutputArray(const std::array<Mat, _Nm>& arr);\n\n    template<typename _Tp> static _OutputArray rawOut(std::vector<_Tp>& vec);\n    template<typename _Tp, std::size_t _Nm> static _OutputArray rawOut(std::array<_Tp, _Nm>& arr);\n\n    bool fixedSize() const;\n    bool fixedType() const;\n    bool needed() const;\n    Mat& getMatRef(int i=-1) const;\n    UMat& getUMatRef(int i=-1) const;\n    cuda::GpuMat& getGpuMatRef() const;\n    std::vector<cuda::GpuMat>& getGpuMatVecRef() const;\n    ogl::Buffer& getOGlBufferRef() const;\n    cuda::HostMem& getHostMemRef() const;\n    void create(Size sz, int type, int i=-1, bool allowTransposed=false, _OutputArray::DepthMask fixedDepthMask=static_cast<_OutputArray::DepthMask>(0)) const;\n    void create(int rows, int cols, int type, int i=-1, bool allowTransposed=false, _OutputArray::DepthMask fixedDepthMask=static_cast<_OutputArray::DepthMask>(0)) const;\n    void create(int dims, const int* size, int type, int i=-1, bool allowTransposed=false, _OutputArray::DepthMask fixedDepthMask=static_cast<_OutputArray::DepthMask>(0)) const;\n    void createSameSize(const _InputArray& arr, int mtype) const;\n    void release() const;\n    void clear() const;\n    void setTo(const _InputArray& value, const _InputArray & mask = _InputArray()) const;\n\n    void assign(const UMat& u) const;\n    void assign(const Mat& m) const;\n\n    void assign(const std::vector<UMat>& v) const;\n    void assign(const std::vector<Mat>& v) const;\n\n    void move(UMat& u) const;\n    void move(Mat& m) const;\n};\n\n\nclass CV_EXPORTS _InputOutputArray : public _OutputArray\n{\npublic:\n    _InputOutputArray();\n    _InputOutputArray(int _flags, void* _obj);\n    _InputOutputArray(Mat& m);\n    _InputOutputArray(std::vector<Mat>& vec);\n    _InputOutputArray(cuda::GpuMat& d_mat);\n    _InputOutputArray(ogl::Buffer& buf);\n    _InputOutputArray(cuda::HostMem& cuda_mem);\n    template<typename _Tp> _InputOutputArray(cudev::GpuMat_<_Tp>& m);\n    template<typename _Tp> _InputOutputArray(std::vector<_Tp>& vec);\n    _InputOutputArray(std::vector<bool>& vec) = delete;  // not supported\n    template<typename _Tp> _InputOutputArray(std::vector<std::vector<_Tp> >& vec);\n    template<typename _Tp> _InputOutputArray(std::vector<Mat_<_Tp> >& vec);\n    template<typename _Tp> _InputOutputArray(Mat_<_Tp>& m);\n    template<typename _Tp> _InputOutputArray(_Tp* vec, int n);\n    template<typename _Tp, int m, int n> _InputOutputArray(Matx<_Tp, m, n>& matx);\n    _InputOutputArray(UMat& m);\n    _InputOutputArray(std::vector<UMat>& vec);\n\n    _InputOutputArray(const Mat& m);\n    _InputOutputArray(const std::vector<Mat>& vec);\n    _InputOutputArray(const cuda::GpuMat& d_mat);\n    _InputOutputArray(const std::vector<cuda::GpuMat>& d_mat);\n    _InputOutputArray(const ogl::Buffer& buf);\n    _InputOutputArray(const cuda::HostMem& cuda_mem);\n    template<typename _Tp> _InputOutputArray(const cudev::GpuMat_<_Tp>& m);\n    template<typename _Tp> _InputOutputArray(const std::vector<_Tp>& vec);\n    template<typename _Tp> _InputOutputArray(const std::vector<std::vector<_Tp> >& vec);\n    template<typename _Tp> _InputOutputArray(const std::vector<Mat_<_Tp> >& vec);\n    template<typename _Tp> _InputOutputArray(const Mat_<_Tp>& m);\n    template<typename _Tp> _InputOutputArray(const _Tp* vec, int n);\n    template<typename _Tp, int m, int n> _InputOutputArray(const Matx<_Tp, m, n>& matx);\n    _InputOutputArray(const UMat& m);\n    _InputOutputArray(const std::vector<UMat>& vec);\n\n    template<typename _Tp, std::size_t _Nm> _InputOutputArray(std::array<_Tp, _Nm>& arr);\n    template<typename _Tp, std::size_t _Nm> _InputOutputArray(const std::array<_Tp, _Nm>& arr);\n    template<std::size_t _Nm> _InputOutputArray(std::array<Mat, _Nm>& arr);\n    template<std::size_t _Nm> _InputOutputArray(const std::array<Mat, _Nm>& arr);\n\n    template<typename _Tp> static _InputOutputArray rawInOut(std::vector<_Tp>& vec);\n    template<typename _Tp, std::size_t _Nm> _InputOutputArray rawInOut(std::array<_Tp, _Nm>& arr);\n\n};\n\n/** Helper to wrap custom types. @see InputArray */\ntemplate<typename _Tp> static inline _InputArray rawIn(_Tp& v);\n/** Helper to wrap custom types. @see InputArray */\ntemplate<typename _Tp> static inline _OutputArray rawOut(_Tp& v);\n/** Helper to wrap custom types. @see InputArray */\ntemplate<typename _Tp> static inline _InputOutputArray rawInOut(_Tp& v);\n\nCV__DEBUG_NS_END\n\ntypedef const _InputArray& InputArray;\ntypedef InputArray InputArrayOfArrays;\ntypedef const _OutputArray& OutputArray;\ntypedef OutputArray OutputArrayOfArrays;\ntypedef const _InputOutputArray& InputOutputArray;\ntypedef InputOutputArray InputOutputArrayOfArrays;\n\nCV_EXPORTS InputOutputArray noArray();\n\n/////////////////////////////////// MatAllocator //////////////////////////////////////\n\n//! Usage flags for allocator\nenum UMatUsageFlags\n{\n    USAGE_DEFAULT = 0,\n\n    // buffer allocation policy is platform and usage specific\n    USAGE_ALLOCATE_HOST_MEMORY = 1 << 0,\n    USAGE_ALLOCATE_DEVICE_MEMORY = 1 << 1,\n    USAGE_ALLOCATE_SHARED_MEMORY = 1 << 2, // It is not equal to: USAGE_ALLOCATE_HOST_MEMORY | USAGE_ALLOCATE_DEVICE_MEMORY\n\n    __UMAT_USAGE_FLAGS_32BIT = 0x7fffffff // Binary compatibility hint\n};\n\nstruct CV_EXPORTS UMatData;\n\n/** @brief  Custom array allocator\n*/\nclass CV_EXPORTS MatAllocator\n{\npublic:\n    MatAllocator() {}\n    virtual ~MatAllocator() {}\n\n    // let's comment it off for now to detect and fix all the uses of allocator\n    //virtual void allocate(int dims, const int* sizes, int type, int*& refcount,\n    //                      uchar*& datastart, uchar*& data, size_t* step) = 0;\n    //virtual void deallocate(int* refcount, uchar* datastart, uchar* data) = 0;\n    virtual UMatData* allocate(int dims, const int* sizes, int type,\n                               void* data, size_t* step, AccessFlag flags, UMatUsageFlags usageFlags) const = 0;\n    virtual bool allocate(UMatData* data, AccessFlag accessflags, UMatUsageFlags usageFlags) const = 0;\n    virtual void deallocate(UMatData* data) const = 0;\n    virtual void map(UMatData* data, AccessFlag accessflags) const;\n    virtual void unmap(UMatData* data) const;\n    virtual void download(UMatData* data, void* dst, int dims, const size_t sz[],\n                          const size_t srcofs[], const size_t srcstep[],\n                          const size_t dststep[]) const;\n    virtual void upload(UMatData* data, const void* src, int dims, const size_t sz[],\n                        const size_t dstofs[], const size_t dststep[],\n                        const size_t srcstep[]) const;\n    virtual void copy(UMatData* srcdata, UMatData* dstdata, int dims, const size_t sz[],\n                      const size_t srcofs[], const size_t srcstep[],\n                      const size_t dstofs[], const size_t dststep[], bool sync) const;\n\n    // default implementation returns DummyBufferPoolController\n    virtual BufferPoolController* getBufferPoolController(const char* id = NULL) const;\n};\n\n\n//////////////////////////////// MatCommaInitializer //////////////////////////////////\n\n/** @brief  Comma-separated Matrix Initializer\n\n The class instances are usually not created explicitly.\n Instead, they are created on \"matrix << firstValue\" operator.\n\n The sample below initializes 2x2 rotation matrix:\n\n \\code\n double angle = 30, a = cos(angle*CV_PI/180), b = sin(angle*CV_PI/180);\n Mat R = (Mat_<double>(2,2) << a, -b, b, a);\n \\endcode\n*/\ntemplate<typename _Tp> class MatCommaInitializer_\n{\npublic:\n    //! the constructor, created by \"matrix << firstValue\" operator, where matrix is cv::Mat\n    MatCommaInitializer_(Mat_<_Tp>* _m);\n    //! the operator that takes the next value and put it to the matrix\n    template<typename T2> MatCommaInitializer_<_Tp>& operator , (T2 v);\n    //! another form of conversion operator\n    operator Mat_<_Tp>() const;\nprotected:\n    MatIterator_<_Tp> it;\n};\n\n\n/////////////////////////////////////// Mat ///////////////////////////////////////////\n\n// note that umatdata might be allocated together\n// with the matrix data, not as a separate object.\n// therefore, it does not have constructor or destructor;\n// it should be explicitly initialized using init().\nstruct CV_EXPORTS UMatData\n{\n    enum MemoryFlag { COPY_ON_MAP=1, HOST_COPY_OBSOLETE=2,\n        DEVICE_COPY_OBSOLETE=4, TEMP_UMAT=8, TEMP_COPIED_UMAT=24,\n        USER_ALLOCATED=32, DEVICE_MEM_MAPPED=64,\n        ASYNC_CLEANUP=128\n    };\n    UMatData(const MatAllocator* allocator);\n    ~UMatData();\n\n    // provide atomic access to the structure\n    void lock();\n    void unlock();\n\n    bool hostCopyObsolete() const;\n    bool deviceCopyObsolete() const;\n    bool deviceMemMapped() const;\n    bool copyOnMap() const;\n    bool tempUMat() const;\n    bool tempCopiedUMat() const;\n    void markHostCopyObsolete(bool flag);\n    void markDeviceCopyObsolete(bool flag);\n    void markDeviceMemMapped(bool flag);\n\n    const MatAllocator* prevAllocator;\n    const MatAllocator* currAllocator;\n    int urefcount;\n    int refcount;\n    uchar* data;\n    uchar* origdata;\n    size_t size;\n\n    UMatData::MemoryFlag flags;\n    void* handle;\n    void* userdata;\n    int allocatorFlags_;\n    int mapcount;\n    UMatData* originalUMatData;\n    std::shared_ptr<void> allocatorContext;\n};\nCV_ENUM_FLAGS(UMatData::MemoryFlag)\n\n\nstruct CV_EXPORTS MatSize\n{\n    explicit MatSize(int* _p) CV_NOEXCEPT;\n    int dims() const CV_NOEXCEPT;\n    Size operator()() const;\n    const int& operator[](int i) const;\n    int& operator[](int i);\n    operator const int*() const CV_NOEXCEPT;  // TODO OpenCV 4.0: drop this\n    bool operator == (const MatSize& sz) const CV_NOEXCEPT;\n    bool operator != (const MatSize& sz) const CV_NOEXCEPT;\n\n    int* p;\n};\n\nstruct CV_EXPORTS MatStep\n{\n    MatStep() CV_NOEXCEPT;\n    explicit MatStep(size_t s) CV_NOEXCEPT;\n    const size_t& operator[](int i) const CV_NOEXCEPT;\n    size_t& operator[](int i) CV_NOEXCEPT;\n    operator size_t() const;\n    MatStep& operator = (size_t s);\n\n    size_t* p;\n    size_t buf[2];\nprotected:\n    MatStep& operator = (const MatStep&);\n};\n\n/** @example samples/cpp/cout_mat.cpp\nAn example demonstrating the serial out capabilities of cv::Mat\n*/\n\n /** @brief n-dimensional dense array class \\anchor CVMat_Details\n\nThe class Mat represents an n-dimensional dense numerical single-channel or multi-channel array. It\ncan be used to store real or complex-valued vectors and matrices, grayscale or color images, voxel\nvolumes, vector fields, point clouds, tensors, histograms (though, very high-dimensional histograms\nmay be better stored in a SparseMat ). The data layout of the array `M` is defined by the array\n`M.step[]`, so that the address of element \\f$(i_0,...,i_{M.dims-1})\\f$, where \\f$0\\leq i_k<M.size[k]\\f$, is\ncomputed as:\n\\f[addr(M_{i_0,...,i_{M.dims-1}}) = M.data + M.step[0]*i_0 + M.step[1]*i_1 + ... + M.step[M.dims-1]*i_{M.dims-1}\\f]\nIn case of a 2-dimensional array, the above formula is reduced to:\n\\f[addr(M_{i,j}) = M.data + M.step[0]*i + M.step[1]*j\\f]\nNote that `M.step[i] >= M.step[i+1]` (in fact, `M.step[i] >= M.step[i+1]*M.size[i+1]` ). This means\nthat 2-dimensional matrices are stored row-by-row, 3-dimensional matrices are stored plane-by-plane,\nand so on. M.step[M.dims-1] is minimal and always equal to the element size M.elemSize() .\n\nSo, the data layout in Mat is compatible with the majority of dense array types from the standard\ntoolkits and SDKs, such as Numpy (ndarray), Win32 (independent device bitmaps), and others,\nthat is, with any array that uses *steps* (or *strides*) to compute the position of a pixel.\nDue to this compatibility, it is possible to make a Mat header for user-allocated data and process\nit in-place using OpenCV functions.\n\nThere are many different ways to create a Mat object. The most popular options are listed below:\n\n- Use the create(nrows, ncols, type) method or the similar Mat(nrows, ncols, type[, fillValue])\nconstructor. A new array of the specified size and type is allocated. type has the same meaning as\nin the cvCreateMat method. For example, CV_8UC1 means a 8-bit single-channel array, CV_32FC2\nmeans a 2-channel (complex) floating-point array, and so on.\n@code\n    // make a 7x7 complex matrix filled with 1+3j.\n    Mat M(7,7,CV_32FC2,Scalar(1,3));\n    // and now turn M to a 100x60 15-channel 8-bit matrix.\n    // The old content will be deallocated\n    M.create(100,60,CV_8UC(15));\n@endcode\nAs noted in the introduction to this chapter, create() allocates only a new array when the shape\nor type of the current array are different from the specified ones.\n\n- Create a multi-dimensional array:\n@code\n    // create a 100x100x100 8-bit array\n    int sz[] = {100, 100, 100};\n    Mat bigCube(3, sz, CV_8U, Scalar::all(0));\n@endcode\nIt passes the number of dimensions =1 to the Mat constructor but the created array will be\n2-dimensional with the number of columns set to 1. So, Mat::dims is always \\>= 2 (can also be 0\nwhen the array is empty).\n\n- Use a copy constructor or assignment operator where there can be an array or expression on the\nright side (see below). As noted in the introduction, the array assignment is an O(1) operation\nbecause it only copies the header and increases the reference counter. The Mat::clone() method can\nbe used to get a full (deep) copy of the array when you need it.\n\n- Construct a header for a part of another array. It can be a single row, single column, several\nrows, several columns, rectangular region in the array (called a *minor* in algebra) or a\ndiagonal. Such operations are also O(1) because the new header references the same data. You can\nactually modify a part of the array using this feature, for example:\n@code\n    // add the 5-th row, multiplied by 3 to the 3rd row\n    M.row(3) = M.row(3) + M.row(5)*3;\n    // now copy the 7-th column to the 1-st column\n    // M.col(1) = M.col(7); // this will not work\n    Mat M1 = M.col(1);\n    M.col(7).copyTo(M1);\n    // create a new 320x240 image\n    Mat img(Size(320,240),CV_8UC3);\n    // select a ROI\n    Mat roi(img, Rect(10,10,100,100));\n    // fill the ROI with (0,255,0) (which is green in RGB space);\n    // the original 320x240 image will be modified\n    roi = Scalar(0,255,0);\n@endcode\nDue to the additional datastart and dataend members, it is possible to compute a relative\nsub-array position in the main *container* array using locateROI():\n@code\n    Mat A = Mat::eye(10, 10, CV_32S);\n    // extracts A columns, 1 (inclusive) to 3 (exclusive).\n    Mat B = A(Range::all(), Range(1, 3));\n    // extracts B rows, 5 (inclusive) to 9 (exclusive).\n    // that is, C \\~ A(Range(5, 9), Range(1, 3))\n    Mat C = B(Range(5, 9), Range::all());\n    Size size; Point ofs;\n    C.locateROI(size, ofs);\n    // size will be (width=10,height=10) and the ofs will be (x=1, y=5)\n@endcode\nAs in case of whole matrices, if you need a deep copy, use the `clone()` method of the extracted\nsub-matrices.\n\n- Make a header for user-allocated data. It can be useful to do the following:\n    -# Process \"foreign\" data using OpenCV (for example, when you implement a DirectShow\\* filter or\n    a processing module for gstreamer, and so on). For example:\n    @code\n        Mat process_video_frame(const unsigned char* pixels,\n                                int width, int height, int step)\n        {\n            // wrap input buffer\n            Mat img(height, width, CV_8UC3, (unsigned char*)pixels, step);\n\n            Mat result;\n            GaussianBlur(img, result, Size(7, 7), 1.5, 1.5);\n\n            return result;\n        }\n    @endcode\n    -# Quickly initialize small matrices and/or get a super-fast element access.\n    @code\n        double m[3][3] = {{a, b, c}, {d, e, f}, {g, h, i}};\n        Mat M = Mat(3, 3, CV_64F, m).inv();\n    @endcode\n    .\n\n- Use MATLAB-style array initializers, zeros(), ones(), eye(), for example:\n@code\n    // create a double-precision identity matrix and add it to M.\n    M += Mat::eye(M.rows, M.cols, CV_64F);\n@endcode\n\n- Use a comma-separated initializer:\n@code\n    // create a 3x3 double-precision identity matrix\n    Mat M = (Mat_<double>(3,3) << 1, 0, 0, 0, 1, 0, 0, 0, 1);\n@endcode\nWith this approach, you first call a constructor of the Mat class with the proper parameters, and\nthen you just put `<< operator` followed by comma-separated values that can be constants,\nvariables, expressions, and so on. Also, note the extra parentheses required to avoid compilation\nerrors.\n\nOnce the array is created, it is automatically managed via a reference-counting mechanism. If the\narray header is built on top of user-allocated data, you should handle the data by yourself. The\narray data is deallocated when no one points to it. If you want to release the data pointed by a\narray header before the array destructor is called, use Mat::release().\n\nThe next important thing to learn about the array class is element access. This manual already\ndescribed how to compute an address of each array element. Normally, you are not required to use the\nformula directly in the code. If you know the array element type (which can be retrieved using the\nmethod Mat::type() ), you can access the element \\f$M_{ij}\\f$ of a 2-dimensional array as:\n@code\n    M.at<double>(i,j) += 1.f;\n@endcode\nassuming that `M` is a double-precision floating-point array. There are several variants of the method\nat for a different number of dimensions.\n\nIf you need to process a whole row of a 2D array, the most efficient way is to get the pointer to\nthe row first, and then just use the plain C operator [] :\n@code\n    // compute sum of positive matrix elements\n    // (assuming that M is a double-precision matrix)\n    double sum=0;\n    for(int i = 0; i < M.rows; i++)\n    {\n        const double* Mi = M.ptr<double>(i);\n        for(int j = 0; j < M.cols; j++)\n            sum += std::max(Mi[j], 0.);\n    }\n@endcode\nSome operations, like the one above, do not actually depend on the array shape. They just process\nelements of an array one by one (or elements from multiple arrays that have the same coordinates,\nfor example, array addition). Such operations are called *element-wise*. It makes sense to check\nwhether all the input/output arrays are continuous, namely, have no gaps at the end of each row. If\nyes, process them as a long single row:\n@code\n    // compute the sum of positive matrix elements, optimized variant\n    double sum=0;\n    int cols = M.cols, rows = M.rows;\n    if(M.isContinuous())\n    {\n        cols *= rows;\n        rows = 1;\n    }\n    for(int i = 0; i < rows; i++)\n    {\n        const double* Mi = M.ptr<double>(i);\n        for(int j = 0; j < cols; j++)\n            sum += std::max(Mi[j], 0.);\n    }\n@endcode\nIn case of the continuous matrix, the outer loop body is executed just once. So, the overhead is\nsmaller, which is especially noticeable in case of small matrices.\n\nFinally, there are STL-style iterators that are smart enough to skip gaps between successive rows:\n@code\n    // compute sum of positive matrix elements, iterator-based variant\n    double sum=0;\n    MatConstIterator_<double> it = M.begin<double>(), it_end = M.end<double>();\n    for(; it != it_end; ++it)\n        sum += std::max(*it, 0.);\n@endcode\nThe matrix iterators are random-access iterators, so they can be passed to any STL algorithm,\nincluding std::sort().\n\n@note Matrix Expressions and arithmetic see MatExpr\n*/\nclass CV_EXPORTS Mat\n{\npublic:\n    /**\n    These are various constructors that form a matrix. As noted in the AutomaticAllocation, often\n    the default constructor is enough, and the proper matrix will be allocated by an OpenCV function.\n    The constructed matrix can further be assigned to another matrix or matrix expression or can be\n    allocated with Mat::create . In the former case, the old content is de-referenced.\n     */\n    Mat() CV_NOEXCEPT;\n\n    /** @overload\n    @param rows Number of rows in a 2D array.\n    @param cols Number of columns in a 2D array.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    */\n    Mat(int rows, int cols, int type);\n\n    /** @overload\n    @param size 2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the\n    number of columns go in the reverse order.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n      */\n    Mat(Size size, int type);\n\n    /** @overload\n    @param rows Number of rows in a 2D array.\n    @param cols Number of columns in a 2D array.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    @param s An optional value to initialize each matrix element with. To set all the matrix elements to\n    the particular value after the construction, use the assignment operator\n    Mat::operator=(const Scalar& value) .\n    */\n    Mat(int rows, int cols, int type, const Scalar& s);\n\n    /** @overload\n    @param size 2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the\n    number of columns go in the reverse order.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    @param s An optional value to initialize each matrix element with. To set all the matrix elements to\n    the particular value after the construction, use the assignment operator\n    Mat::operator=(const Scalar& value) .\n      */\n    Mat(Size size, int type, const Scalar& s);\n\n    /** @overload\n    @param ndims Array dimensionality.\n    @param sizes Array of integers specifying an n-dimensional array shape.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    */\n    Mat(int ndims, const int* sizes, int type);\n\n    /** @overload\n    @param sizes Array of integers specifying an n-dimensional array shape.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    */\n    Mat(const std::vector<int>& sizes, int type);\n\n    /** @overload\n    @param ndims Array dimensionality.\n    @param sizes Array of integers specifying an n-dimensional array shape.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    @param s An optional value to initialize each matrix element with. To set all the matrix elements to\n    the particular value after the construction, use the assignment operator\n    Mat::operator=(const Scalar& value) .\n    */\n    Mat(int ndims, const int* sizes, int type, const Scalar& s);\n\n    /** @overload\n    @param sizes Array of integers specifying an n-dimensional array shape.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    @param s An optional value to initialize each matrix element with. To set all the matrix elements to\n    the particular value after the construction, use the assignment operator\n    Mat::operator=(const Scalar& value) .\n    */\n    Mat(const std::vector<int>& sizes, int type, const Scalar& s);\n\n\n    /** @overload\n    @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied\n    by these constructors. Instead, the header pointing to m data or its sub-array is constructed and\n    associated with it. The reference counter, if any, is incremented. So, when you modify the matrix\n    formed using such a constructor, you also modify the corresponding elements of m . If you want to\n    have an independent copy of the sub-array, use Mat::clone() .\n    */\n    Mat(const Mat& m);\n\n    /** @overload\n    @param rows Number of rows in a 2D array.\n    @param cols Number of columns in a 2D array.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    @param data Pointer to the user data. Matrix constructors that take data and step parameters do not\n    allocate matrix data. Instead, they just initialize the matrix header that points to the specified\n    data, which means that no data is copied. This operation is very efficient and can be used to\n    process external data using OpenCV functions. The external data is not automatically deallocated, so\n    you should take care of it.\n    @param step Number of bytes each matrix row occupies. The value should include the padding bytes at\n    the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed\n    and the actual step is calculated as cols*elemSize(). See Mat::elemSize.\n    */\n    Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP);\n\n    /** @overload\n    @param size 2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the\n    number of columns go in the reverse order.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    @param data Pointer to the user data. Matrix constructors that take data and step parameters do not\n    allocate matrix data. Instead, they just initialize the matrix header that points to the specified\n    data, which means that no data is copied. This operation is very efficient and can be used to\n    process external data using OpenCV functions. The external data is not automatically deallocated, so\n    you should take care of it.\n    @param step Number of bytes each matrix row occupies. The value should include the padding bytes at\n    the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed\n    and the actual step is calculated as cols*elemSize(). See Mat::elemSize.\n    */\n    Mat(Size size, int type, void* data, size_t step=AUTO_STEP);\n\n    /** @overload\n    @param ndims Array dimensionality.\n    @param sizes Array of integers specifying an n-dimensional array shape.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    @param data Pointer to the user data. Matrix constructors that take data and step parameters do not\n    allocate matrix data. Instead, they just initialize the matrix header that points to the specified\n    data, which means that no data is copied. This operation is very efficient and can be used to\n    process external data using OpenCV functions. The external data is not automatically deallocated, so\n    you should take care of it.\n    @param steps Array of ndims-1 steps in case of a multi-dimensional array (the last step is always\n    set to the element size). If not specified, the matrix is assumed to be continuous.\n    */\n    Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0);\n\n    /** @overload\n    @param sizes Array of integers specifying an n-dimensional array shape.\n    @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n    CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n    @param data Pointer to the user data. Matrix constructors that take data and step parameters do not\n    allocate matrix data. Instead, they just initialize the matrix header that points to the specified\n    data, which means that no data is copied. This operation is very efficient and can be used to\n    process external data using OpenCV functions. The external data is not automatically deallocated, so\n    you should take care of it.\n    @param steps Array of ndims-1 steps in case of a multi-dimensional array (the last step is always\n    set to the element size). If not specified, the matrix is assumed to be continuous.\n    */\n    Mat(const std::vector<int>& sizes, int type, void* data, const size_t* steps=0);\n\n    /** @overload\n    @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied\n    by these constructors. Instead, the header pointing to m data or its sub-array is constructed and\n    associated with it. The reference counter, if any, is incremented. So, when you modify the matrix\n    formed using such a constructor, you also modify the corresponding elements of m . If you want to\n    have an independent copy of the sub-array, use Mat::clone() .\n    @param rowRange Range of the m rows to take. As usual, the range start is inclusive and the range\n    end is exclusive. Use Range::all() to take all the rows.\n    @param colRange Range of the m columns to take. Use Range::all() to take all the columns.\n    */\n    Mat(const Mat& m, const Range& rowRange, const Range& colRange=Range::all());\n\n    /** @overload\n    @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied\n    by these constructors. Instead, the header pointing to m data or its sub-array is constructed and\n    associated with it. The reference counter, if any, is incremented. So, when you modify the matrix\n    formed using such a constructor, you also modify the corresponding elements of m . If you want to\n    have an independent copy of the sub-array, use Mat::clone() .\n    @param roi Region of interest.\n    */\n    Mat(const Mat& m, const Rect& roi);\n\n    /** @overload\n    @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied\n    by these constructors. Instead, the header pointing to m data or its sub-array is constructed and\n    associated with it. The reference counter, if any, is incremented. So, when you modify the matrix\n    formed using such a constructor, you also modify the corresponding elements of m . If you want to\n    have an independent copy of the sub-array, use Mat::clone() .\n    @param ranges Array of selected ranges of m along each dimensionality.\n    */\n    Mat(const Mat& m, const Range* ranges);\n\n    /** @overload\n    @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied\n    by these constructors. Instead, the header pointing to m data or its sub-array is constructed and\n    associated with it. The reference counter, if any, is incremented. So, when you modify the matrix\n    formed using such a constructor, you also modify the corresponding elements of m . If you want to\n    have an independent copy of the sub-array, use Mat::clone() .\n    @param ranges Array of selected ranges of m along each dimensionality.\n    */\n    Mat(const Mat& m, const std::vector<Range>& ranges);\n\n    /** @overload\n    @param vec STL vector whose elements form the matrix. The matrix has a single column and the number\n    of rows equal to the number of vector elements. Type of the matrix matches the type of vector\n    elements. The constructor can handle arbitrary types, for which there is a properly declared\n    DataType . This means that the vector elements must be primitive numbers or uni-type numerical\n    tuples of numbers. Mixed-type structures are not supported. The corresponding constructor is\n    explicit. Since STL vectors are not automatically converted to Mat instances, you should write\n    Mat(vec) explicitly. Unless you copy the data into the matrix ( copyData=true ), no new elements\n    will be added to the vector because it can potentially yield vector data reallocation, and, thus,\n    the matrix data pointer will be invalid.\n    @param copyData Flag to specify whether the underlying data of the STL vector should be copied\n    to (true) or shared with (false) the newly constructed matrix. When the data is copied, the\n    allocated buffer is managed using Mat reference counting mechanism. While the data is shared,\n    the reference counter is NULL, and you should not deallocate the data until the matrix is not\n    destructed.\n    */\n    template<typename _Tp> explicit Mat(const std::vector<_Tp>& vec, bool copyData=false);\n\n    /** @overload\n    */\n    template<typename _Tp, typename = typename std::enable_if<std::is_arithmetic<_Tp>::value>::type>\n    explicit Mat(const std::initializer_list<_Tp> list);\n\n    /** @overload\n    */\n    template<typename _Tp> explicit Mat(const std::initializer_list<int> sizes, const std::initializer_list<_Tp> list);\n\n    /** @overload\n    */\n    template<typename _Tp, size_t _Nm> explicit Mat(const std::array<_Tp, _Nm>& arr, bool copyData=false);\n\n    /** @overload\n    */\n    template<typename _Tp, int n> explicit Mat(const Vec<_Tp, n>& vec, bool copyData=true);\n\n    /** @overload\n    */\n    template<typename _Tp, int m, int n> explicit Mat(const Matx<_Tp, m, n>& mtx, bool copyData=true);\n\n    /** @overload\n    */\n    template<typename _Tp> explicit Mat(const Point_<_Tp>& pt, bool copyData=true);\n\n    /** @overload\n    */\n    template<typename _Tp> explicit Mat(const Point3_<_Tp>& pt, bool copyData=true);\n\n    /** @overload\n    */\n    template<typename _Tp> explicit Mat(const MatCommaInitializer_<_Tp>& commaInitializer);\n\n    //! download data from GpuMat\n    explicit Mat(const cuda::GpuMat& m);\n\n    //! destructor - calls release()\n    ~Mat();\n\n    /** @brief assignment operators\n\n    These are available assignment operators. Since they all are very different, make sure to read the\n    operator parameters description.\n    @param m Assigned, right-hand-side matrix. Matrix assignment is an O(1) operation. This means that\n    no data is copied but the data is shared and the reference counter, if any, is incremented. Before\n    assigning new data, the old data is de-referenced via Mat::release .\n     */\n    Mat& operator = (const Mat& m);\n\n    /** @overload\n    @param expr Assigned matrix expression object. As opposite to the first form of the assignment\n    operation, the second form can reuse already allocated matrix if it has the right size and type to\n    fit the matrix expression result. It is automatically handled by the real function that the matrix\n    expressions is expanded to. For example, C=A+B is expanded to add(A, B, C), and add takes care of\n    automatic C reallocation.\n    */\n    Mat& operator = (const MatExpr& expr);\n\n    //! retrieve UMat from Mat\n    UMat getUMat(AccessFlag accessFlags, UMatUsageFlags usageFlags = USAGE_DEFAULT) const;\n\n    /** @brief Creates a matrix header for the specified matrix row.\n\n    The method makes a new header for the specified matrix row and returns it. This is an O(1)\n    operation, regardless of the matrix size. The underlying data of the new matrix is shared with the\n    original matrix. Here is the example of one of the classical basic matrix processing operations,\n    axpy, used by LU and many other algorithms:\n    @code\n        inline void matrix_axpy(Mat& A, int i, int j, double alpha)\n        {\n            A.row(i) += A.row(j)*alpha;\n        }\n    @endcode\n    @note In the current implementation, the following code does not work as expected:\n    @code\n        Mat A;\n        ...\n        A.row(i) = A.row(j); // will not work\n    @endcode\n    This happens because A.row(i) forms a temporary header that is further assigned to another header.\n    Remember that each of these operations is O(1), that is, no data is copied. Thus, the above\n    assignment is not true if you may have expected the j-th row to be copied to the i-th row. To\n    achieve that, you should either turn this simple assignment into an expression or use the\n    Mat::copyTo method:\n    @code\n        Mat A;\n        ...\n        // works, but looks a bit obscure.\n        A.row(i) = A.row(j) + 0;\n        // this is a bit longer, but the recommended method.\n        A.row(j).copyTo(A.row(i));\n    @endcode\n    @param y A 0-based row index.\n     */\n    Mat row(int y) const;\n\n    /** @brief Creates a matrix header for the specified matrix column.\n\n    The method makes a new header for the specified matrix column and returns it. This is an O(1)\n    operation, regardless of the matrix size. The underlying data of the new matrix is shared with the\n    original matrix. See also the Mat::row description.\n    @param x A 0-based column index.\n     */\n    Mat col(int x) const;\n\n    /** @brief Creates a matrix header for the specified row span.\n\n    The method makes a new header for the specified row span of the matrix. Similarly to Mat::row and\n    Mat::col , this is an O(1) operation.\n    @param startrow An inclusive 0-based start index of the row span.\n    @param endrow An exclusive 0-based ending index of the row span.\n     */\n    Mat rowRange(int startrow, int endrow) const;\n\n    /** @overload\n    @param r Range structure containing both the start and the end indices.\n    */\n    Mat rowRange(const Range& r) const;\n\n    /** @brief Creates a matrix header for the specified column span.\n\n    The method makes a new header for the specified column span of the matrix. Similarly to Mat::row and\n    Mat::col , this is an O(1) operation.\n    @param startcol An inclusive 0-based start index of the column span.\n    @param endcol An exclusive 0-based ending index of the column span.\n     */\n    Mat colRange(int startcol, int endcol) const;\n\n    /** @overload\n    @param r Range structure containing both the start and the end indices.\n    */\n    Mat colRange(const Range& r) const;\n\n    /** @brief Extracts a diagonal from a matrix\n\n    The method makes a new header for the specified matrix diagonal. The new matrix is represented as a\n    single-column matrix. Similarly to Mat::row and Mat::col, this is an O(1) operation.\n    @param d index of the diagonal, with the following values:\n    - `d=0` is the main diagonal.\n    - `d<0` is a diagonal from the lower half. For example, d=-1 means the diagonal is set\n      immediately below the main one.\n    - `d>0` is a diagonal from the upper half. For example, d=1 means the diagonal is set\n      immediately above the main one.\n    For example:\n    @code\n        Mat m = (Mat_<int>(3,3) <<\n                    1,2,3,\n                    4,5,6,\n                    7,8,9);\n        Mat d0 = m.diag(0);\n        Mat d1 = m.diag(1);\n        Mat d_1 = m.diag(-1);\n    @endcode\n    The resulting matrices are\n    @code\n     d0 =\n       [1;\n        5;\n        9]\n     d1 =\n       [2;\n        6]\n     d_1 =\n       [4;\n        8]\n    @endcode\n     */\n    Mat diag(int d=0) const;\n\n    /** @brief creates a diagonal matrix\n\n    The method creates a square diagonal matrix from specified main diagonal.\n    @param d One-dimensional matrix that represents the main diagonal.\n     */\n    static Mat diag(const Mat& d);\n\n    /** @brief Creates a full copy of the array and the underlying data.\n\n    The method creates a full copy of the array. The original step[] is not taken into account. So, the\n    array copy is a continuous array occupying total()*elemSize() bytes.\n     */\n    Mat clone() const CV_NODISCARD;\n\n    /** @brief Copies the matrix to another one.\n\n    The method copies the matrix data to another matrix. Before copying the data, the method invokes :\n    @code\n        m.create(this->size(), this->type());\n    @endcode\n    so that the destination matrix is reallocated if needed. While m.copyTo(m); works flawlessly, the\n    function does not handle the case of a partial overlap between the source and the destination\n    matrices.\n\n    When the operation mask is specified, if the Mat::create call shown above reallocates the matrix,\n    the newly allocated matrix is initialized with all zeros before copying the data.\n    @param m Destination matrix. If it does not have a proper size or type before the operation, it is\n    reallocated.\n     */\n    void copyTo( OutputArray m ) const;\n\n    /** @overload\n    @param m Destination matrix. If it does not have a proper size or type before the operation, it is\n    reallocated.\n    @param mask Operation mask of the same size as \\*this. Its non-zero elements indicate which matrix\n    elements need to be copied. The mask has to be of type CV_8U and can have 1 or multiple channels.\n    */\n    void copyTo( OutputArray m, InputArray mask ) const;\n\n    /** @brief Converts an array to another data type with optional scaling.\n\n    The method converts source pixel values to the target data type. saturate_cast\\<\\> is applied at\n    the end to avoid possible overflows:\n\n    \\f[m(x,y) = saturate \\_ cast<rType>( \\alpha (*this)(x,y) +  \\beta )\\f]\n    @param m output matrix; if it does not have a proper size or type before the operation, it is\n    reallocated.\n    @param rtype desired output matrix type or, rather, the depth since the number of channels are the\n    same as the input has; if rtype is negative, the output matrix will have the same type as the input.\n    @param alpha optional scale factor.\n    @param beta optional delta added to the scaled values.\n     */\n    void convertTo( OutputArray m, int rtype, double alpha=1, double beta=0 ) const;\n\n    /** @brief Provides a functional form of convertTo.\n\n    This is an internally used method called by the @ref MatrixExpressions engine.\n    @param m Destination array.\n    @param type Desired destination array depth (or -1 if it should be the same as the source type).\n     */\n    void assignTo( Mat& m, int type=-1 ) const;\n\n    /** @brief Sets all or some of the array elements to the specified value.\n    @param s Assigned scalar converted to the actual array type.\n    */\n    Mat& operator = (const Scalar& s);\n\n    /** @brief Sets all or some of the array elements to the specified value.\n\n    This is an advanced variant of the Mat::operator=(const Scalar& s) operator.\n    @param value Assigned scalar converted to the actual array type.\n    @param mask Operation mask of the same size as \\*this. Its non-zero elements indicate which matrix\n    elements need to be copied. The mask has to be of type CV_8U and can have 1 or multiple channels\n     */\n    Mat& setTo(InputArray value, InputArray mask=noArray());\n\n    /** @brief Changes the shape and/or the number of channels of a 2D matrix without copying the data.\n\n    The method makes a new matrix header for \\*this elements. The new matrix may have a different size\n    and/or different number of channels. Any combination is possible if:\n    -   No extra elements are included into the new matrix and no elements are excluded. Consequently,\n        the product rows\\*cols\\*channels() must stay the same after the transformation.\n    -   No data is copied. That is, this is an O(1) operation. Consequently, if you change the number of\n        rows, or the operation changes the indices of elements row in some other way, the matrix must be\n        continuous. See Mat::isContinuous .\n\n    For example, if there is a set of 3D points stored as an STL vector, and you want to represent the\n    points as a 3xN matrix, do the following:\n    @code\n        std::vector<Point3f> vec;\n        ...\n        Mat pointMat = Mat(vec). // convert vector to Mat, O(1) operation\n                          reshape(1). // make Nx3 1-channel matrix out of Nx1 3-channel.\n                                      // Also, an O(1) operation\n                             t(); // finally, transpose the Nx3 matrix.\n                                  // This involves copying all the elements\n    @endcode\n    @param cn New number of channels. If the parameter is 0, the number of channels remains the same.\n    @param rows New number of rows. If the parameter is 0, the number of rows remains the same.\n     */\n    Mat reshape(int cn, int rows=0) const;\n\n    /** @overload */\n    Mat reshape(int cn, int newndims, const int* newsz) const;\n\n    /** @overload */\n    Mat reshape(int cn, const std::vector<int>& newshape) const;\n\n    /** @brief Transposes a matrix.\n\n    The method performs matrix transposition by means of matrix expressions. It does not perform the\n    actual transposition but returns a temporary matrix transposition object that can be further used as\n    a part of more complex matrix expressions or can be assigned to a matrix:\n    @code\n        Mat A1 = A + Mat::eye(A.size(), A.type())*lambda;\n        Mat C = A1.t()*A1; // compute (A + lambda*I)^t * (A + lamda*I)\n    @endcode\n     */\n    MatExpr t() const;\n\n    /** @brief Inverses a matrix.\n\n    The method performs a matrix inversion by means of matrix expressions. This means that a temporary\n    matrix inversion object is returned by the method and can be used further as a part of more complex\n    matrix expressions or can be assigned to a matrix.\n    @param method Matrix inversion method. One of cv::DecompTypes\n     */\n    MatExpr inv(int method=DECOMP_LU) const;\n\n    /** @brief Performs an element-wise multiplication or division of the two matrices.\n\n    The method returns a temporary object encoding per-element array multiplication, with optional\n    scale. Note that this is not a matrix multiplication that corresponds to a simpler \"\\*\" operator.\n\n    Example:\n    @code\n        Mat C = A.mul(5/B); // equivalent to divide(A, B, C, 5)\n    @endcode\n    @param m Another array of the same type and the same size as \\*this, or a matrix expression.\n    @param scale Optional scale factor.\n     */\n    MatExpr mul(InputArray m, double scale=1) const;\n\n    /** @brief Computes a cross-product of two 3-element vectors.\n\n    The method computes a cross-product of two 3-element vectors. The vectors must be 3-element\n    floating-point vectors of the same shape and size. The result is another 3-element vector of the\n    same shape and type as operands.\n    @param m Another cross-product operand.\n     */\n    Mat cross(InputArray m) const;\n\n    /** @brief Computes a dot-product of two vectors.\n\n    The method computes a dot-product of two matrices. If the matrices are not single-column or\n    single-row vectors, the top-to-bottom left-to-right scan ordering is used to treat them as 1D\n    vectors. The vectors must have the same size and type. If the matrices have more than one channel,\n    the dot products from all the channels are summed together.\n    @param m another dot-product operand.\n     */\n    double dot(InputArray m) const;\n\n    /** @brief Returns a zero array of the specified size and type.\n\n    The method returns a Matlab-style zero array initializer. It can be used to quickly form a constant\n    array as a function parameter, part of a matrix expression, or as a matrix initializer:\n    @code\n        Mat A;\n        A = Mat::zeros(3, 3, CV_32F);\n    @endcode\n    In the example above, a new matrix is allocated only if A is not a 3x3 floating-point matrix.\n    Otherwise, the existing matrix A is filled with zeros.\n    @param rows Number of rows.\n    @param cols Number of columns.\n    @param type Created matrix type.\n     */\n    static MatExpr zeros(int rows, int cols, int type);\n\n    /** @overload\n    @param size Alternative to the matrix size specification Size(cols, rows) .\n    @param type Created matrix type.\n    */\n    static MatExpr zeros(Size size, int type);\n\n    /** @overload\n    @param ndims Array dimensionality.\n    @param sz Array of integers specifying the array shape.\n    @param type Created matrix type.\n    */\n    static MatExpr zeros(int ndims, const int* sz, int type);\n\n    /** @brief Returns an array of all 1's of the specified size and type.\n\n    The method returns a Matlab-style 1's array initializer, similarly to Mat::zeros. Note that using\n    this method you can initialize an array with an arbitrary value, using the following Matlab idiom:\n    @code\n        Mat A = Mat::ones(100, 100, CV_8U)*3; // make 100x100 matrix filled with 3.\n    @endcode\n    The above operation does not form a 100x100 matrix of 1's and then multiply it by 3. Instead, it\n    just remembers the scale factor (3 in this case) and use it when actually invoking the matrix\n    initializer.\n    @note In case of multi-channels type, only the first channel will be initialized with 1's, the\n    others will be set to 0's.\n    @param rows Number of rows.\n    @param cols Number of columns.\n    @param type Created matrix type.\n     */\n    static MatExpr ones(int rows, int cols, int type);\n\n    /** @overload\n    @param size Alternative to the matrix size specification Size(cols, rows) .\n    @param type Created matrix type.\n    */\n    static MatExpr ones(Size size, int type);\n\n    /** @overload\n    @param ndims Array dimensionality.\n    @param sz Array of integers specifying the array shape.\n    @param type Created matrix type.\n    */\n    static MatExpr ones(int ndims, const int* sz, int type);\n\n    /** @brief Returns an identity matrix of the specified size and type.\n\n    The method returns a Matlab-style identity matrix initializer, similarly to Mat::zeros. Similarly to\n    Mat::ones, you can use a scale operation to create a scaled identity matrix efficiently:\n    @code\n        // make a 4x4 diagonal matrix with 0.1's on the diagonal.\n        Mat A = Mat::eye(4, 4, CV_32F)*0.1;\n    @endcode\n    @note In case of multi-channels type, identity matrix will be initialized only for the first channel,\n    the others will be set to 0's\n    @param rows Number of rows.\n    @param cols Number of columns.\n    @param type Created matrix type.\n     */\n    static MatExpr eye(int rows, int cols, int type);\n\n    /** @overload\n    @param size Alternative matrix size specification as Size(cols, rows) .\n    @param type Created matrix type.\n    */\n    static MatExpr eye(Size size, int type);\n\n    /** @brief Allocates new array data if needed.\n\n    This is one of the key Mat methods. Most new-style OpenCV functions and methods that produce arrays\n    call this method for each output array. The method uses the following algorithm:\n\n    -# If the current array shape and the type match the new ones, return immediately. Otherwise,\n       de-reference the previous data by calling Mat::release.\n    -# Initialize the new header.\n    -# Allocate the new data of total()\\*elemSize() bytes.\n    -# Allocate the new, associated with the data, reference counter and set it to 1.\n\n    Such a scheme makes the memory management robust and efficient at the same time and helps avoid\n    extra typing for you. This means that usually there is no need to explicitly allocate output arrays.\n    That is, instead of writing:\n    @code\n        Mat color;\n        ...\n        Mat gray(color.rows, color.cols, color.depth());\n        cvtColor(color, gray, COLOR_BGR2GRAY);\n    @endcode\n    you can simply write:\n    @code\n        Mat color;\n        ...\n        Mat gray;\n        cvtColor(color, gray, COLOR_BGR2GRAY);\n    @endcode\n    because cvtColor, as well as the most of OpenCV functions, calls Mat::create() for the output array\n    internally.\n    @param rows New number of rows.\n    @param cols New number of columns.\n    @param type New matrix type.\n     */\n    void create(int rows, int cols, int type);\n\n    /** @overload\n    @param size Alternative new matrix size specification: Size(cols, rows)\n    @param type New matrix type.\n    */\n    void create(Size size, int type);\n\n    /** @overload\n    @param ndims New array dimensionality.\n    @param sizes Array of integers specifying a new array shape.\n    @param type New matrix type.\n    */\n    void create(int ndims, const int* sizes, int type);\n\n    /** @overload\n    @param sizes Array of integers specifying a new array shape.\n    @param type New matrix type.\n    */\n    void create(const std::vector<int>& sizes, int type);\n\n    /** @brief Increments the reference counter.\n\n    The method increments the reference counter associated with the matrix data. If the matrix header\n    points to an external data set (see Mat::Mat ), the reference counter is NULL, and the method has no\n    effect in this case. Normally, to avoid memory leaks, the method should not be called explicitly. It\n    is called implicitly by the matrix assignment operator. The reference counter increment is an atomic\n    operation on the platforms that support it. Thus, it is safe to operate on the same matrices\n    asynchronously in different threads.\n     */\n    void addref();\n\n    /** @brief Decrements the reference counter and deallocates the matrix if needed.\n\n    The method decrements the reference counter associated with the matrix data. When the reference\n    counter reaches 0, the matrix data is deallocated and the data and the reference counter pointers\n    are set to NULL's. If the matrix header points to an external data set (see Mat::Mat ), the\n    reference counter is NULL, and the method has no effect in this case.\n\n    This method can be called manually to force the matrix data deallocation. But since this method is\n    automatically called in the destructor, or by any other method that changes the data pointer, it is\n    usually not needed. The reference counter decrement and check for 0 is an atomic operation on the\n    platforms that support it. Thus, it is safe to operate on the same matrices asynchronously in\n    different threads.\n     */\n    void release();\n\n    //! internal use function, consider to use 'release' method instead; deallocates the matrix data\n    void deallocate();\n    //! internal use function; properly re-allocates _size, _step arrays\n    void copySize(const Mat& m);\n\n    /** @brief Reserves space for the certain number of rows.\n\n    The method reserves space for sz rows. If the matrix already has enough space to store sz rows,\n    nothing happens. If the matrix is reallocated, the first Mat::rows rows are preserved. The method\n    emulates the corresponding method of the STL vector class.\n    @param sz Number of rows.\n     */\n    void reserve(size_t sz);\n\n    /** @brief Reserves space for the certain number of bytes.\n\n    The method reserves space for sz bytes. If the matrix already has enough space to store sz bytes,\n    nothing happens. If matrix has to be reallocated its previous content could be lost.\n    @param sz Number of bytes.\n    */\n    void reserveBuffer(size_t sz);\n\n    /** @brief Changes the number of matrix rows.\n\n    The methods change the number of matrix rows. If the matrix is reallocated, the first\n    min(Mat::rows, sz) rows are preserved. The methods emulate the corresponding methods of the STL\n    vector class.\n    @param sz New number of rows.\n     */\n    void resize(size_t sz);\n\n    /** @overload\n    @param sz New number of rows.\n    @param s Value assigned to the newly added elements.\n     */\n    void resize(size_t sz, const Scalar& s);\n\n    //! internal function\n    void push_back_(const void* elem);\n\n    /** @brief Adds elements to the bottom of the matrix.\n\n    The methods add one or more elements to the bottom of the matrix. They emulate the corresponding\n    method of the STL vector class. When elem is Mat , its type and the number of columns must be the\n    same as in the container matrix.\n    @param elem Added element(s).\n     */\n    template<typename _Tp> void push_back(const _Tp& elem);\n\n    /** @overload\n    @param elem Added element(s).\n    */\n    template<typename _Tp> void push_back(const Mat_<_Tp>& elem);\n\n    /** @overload\n    @param elem Added element(s).\n    */\n    template<typename _Tp> void push_back(const std::vector<_Tp>& elem);\n\n    /** @overload\n    @param m Added line(s).\n    */\n    void push_back(const Mat& m);\n\n    /** @brief Removes elements from the bottom of the matrix.\n\n    The method removes one or more rows from the bottom of the matrix.\n    @param nelems Number of removed rows. If it is greater than the total number of rows, an exception\n    is thrown.\n     */\n    void pop_back(size_t nelems=1);\n\n    /** @brief Locates the matrix header within a parent matrix.\n\n    After you extracted a submatrix from a matrix using Mat::row, Mat::col, Mat::rowRange,\n    Mat::colRange, and others, the resultant submatrix points just to the part of the original big\n    matrix. However, each submatrix contains information (represented by datastart and dataend\n    fields) that helps reconstruct the original matrix size and the position of the extracted\n    submatrix within the original matrix. The method locateROI does exactly that.\n    @param wholeSize Output parameter that contains the size of the whole matrix containing *this*\n    as a part.\n    @param ofs Output parameter that contains an offset of *this* inside the whole matrix.\n     */\n    void locateROI( Size& wholeSize, Point& ofs ) const;\n\n    /** @brief Adjusts a submatrix size and position within the parent matrix.\n\n    The method is complimentary to Mat::locateROI . The typical use of these functions is to determine\n    the submatrix position within the parent matrix and then shift the position somehow. Typically, it\n    can be required for filtering operations when pixels outside of the ROI should be taken into\n    account. When all the method parameters are positive, the ROI needs to grow in all directions by the\n    specified amount, for example:\n    @code\n        A.adjustROI(2, 2, 2, 2);\n    @endcode\n    In this example, the matrix size is increased by 4 elements in each direction. The matrix is shifted\n    by 2 elements to the left and 2 elements up, which brings in all the necessary pixels for the\n    filtering with the 5x5 kernel.\n\n    adjustROI forces the adjusted ROI to be inside of the parent matrix that is boundaries of the\n    adjusted ROI are constrained by boundaries of the parent matrix. For example, if the submatrix A is\n    located in the first row of a parent matrix and you called A.adjustROI(2, 2, 2, 2) then A will not\n    be increased in the upward direction.\n\n    The function is used internally by the OpenCV filtering functions, like filter2D , morphological\n    operations, and so on.\n    @param dtop Shift of the top submatrix boundary upwards.\n    @param dbottom Shift of the bottom submatrix boundary downwards.\n    @param dleft Shift of the left submatrix boundary to the left.\n    @param dright Shift of the right submatrix boundary to the right.\n    @sa copyMakeBorder\n     */\n    Mat& adjustROI( int dtop, int dbottom, int dleft, int dright );\n\n    /** @brief Extracts a rectangular submatrix.\n\n    The operators make a new header for the specified sub-array of \\*this . They are the most\n    generalized forms of Mat::row, Mat::col, Mat::rowRange, and Mat::colRange . For example,\n    `A(Range(0, 10), Range::all())` is equivalent to `A.rowRange(0, 10)`. Similarly to all of the above,\n    the operators are O(1) operations, that is, no matrix data is copied.\n    @param rowRange Start and end row of the extracted submatrix. The upper boundary is not included. To\n    select all the rows, use Range::all().\n    @param colRange Start and end column of the extracted submatrix. The upper boundary is not included.\n    To select all the columns, use Range::all().\n     */\n    Mat operator()( Range rowRange, Range colRange ) const;\n\n    /** @overload\n    @param roi Extracted submatrix specified as a rectangle.\n    */\n    Mat operator()( const Rect& roi ) const;\n\n    /** @overload\n    @param ranges Array of selected ranges along each array dimension.\n    */\n    Mat operator()( const Range* ranges ) const;\n\n    /** @overload\n    @param ranges Array of selected ranges along each array dimension.\n    */\n    Mat operator()(const std::vector<Range>& ranges) const;\n\n    template<typename _Tp> operator std::vector<_Tp>() const;\n    template<typename _Tp, int n> operator Vec<_Tp, n>() const;\n    template<typename _Tp, int m, int n> operator Matx<_Tp, m, n>() const;\n\n    template<typename _Tp, std::size_t _Nm> operator std::array<_Tp, _Nm>() const;\n\n    /** @brief Reports whether the matrix is continuous or not.\n\n    The method returns true if the matrix elements are stored continuously without gaps at the end of\n    each row. Otherwise, it returns false. Obviously, 1x1 or 1xN matrices are always continuous.\n    Matrices created with Mat::create are always continuous. But if you extract a part of the matrix\n    using Mat::col, Mat::diag, and so on, or constructed a matrix header for externally allocated data,\n    such matrices may no longer have this property.\n\n    The continuity flag is stored as a bit in the Mat::flags field and is computed automatically when\n    you construct a matrix header. Thus, the continuity check is a very fast operation, though\n    theoretically it could be done as follows:\n    @code\n        // alternative implementation of Mat::isContinuous()\n        bool myCheckMatContinuity(const Mat& m)\n        {\n            //return (m.flags & Mat::CONTINUOUS_FLAG) != 0;\n            return m.rows == 1 || m.step == m.cols*m.elemSize();\n        }\n    @endcode\n    The method is used in quite a few of OpenCV functions. The point is that element-wise operations\n    (such as arithmetic and logical operations, math functions, alpha blending, color space\n    transformations, and others) do not depend on the image geometry. Thus, if all the input and output\n    arrays are continuous, the functions can process them as very long single-row vectors. The example\n    below illustrates how an alpha-blending function can be implemented:\n    @code\n        template<typename T>\n        void alphaBlendRGBA(const Mat& src1, const Mat& src2, Mat& dst)\n        {\n            const float alpha_scale = (float)std::numeric_limits<T>::max(),\n                        inv_scale = 1.f/alpha_scale;\n\n            CV_Assert( src1.type() == src2.type() &&\n                       src1.type() == CV_MAKETYPE(traits::Depth<T>::value, 4) &&\n                       src1.size() == src2.size());\n            Size size = src1.size();\n            dst.create(size, src1.type());\n\n            // here is the idiom: check the arrays for continuity and,\n            // if this is the case,\n            // treat the arrays as 1D vectors\n            if( src1.isContinuous() && src2.isContinuous() && dst.isContinuous() )\n            {\n                size.width *= size.height;\n                size.height = 1;\n            }\n            size.width *= 4;\n\n            for( int i = 0; i < size.height; i++ )\n            {\n                // when the arrays are continuous,\n                // the outer loop is executed only once\n                const T* ptr1 = src1.ptr<T>(i);\n                const T* ptr2 = src2.ptr<T>(i);\n                T* dptr = dst.ptr<T>(i);\n\n                for( int j = 0; j < size.width; j += 4 )\n                {\n                    float alpha = ptr1[j+3]*inv_scale, beta = ptr2[j+3]*inv_scale;\n                    dptr[j] = saturate_cast<T>(ptr1[j]*alpha + ptr2[j]*beta);\n                    dptr[j+1] = saturate_cast<T>(ptr1[j+1]*alpha + ptr2[j+1]*beta);\n                    dptr[j+2] = saturate_cast<T>(ptr1[j+2]*alpha + ptr2[j+2]*beta);\n                    dptr[j+3] = saturate_cast<T>((1 - (1-alpha)*(1-beta))*alpha_scale);\n                }\n            }\n        }\n    @endcode\n    This approach, while being very simple, can boost the performance of a simple element-operation by\n    10-20 percents, especially if the image is rather small and the operation is quite simple.\n\n    Another OpenCV idiom in this function, a call of Mat::create for the destination array, that\n    allocates the destination array unless it already has the proper size and type. And while the newly\n    allocated arrays are always continuous, you still need to check the destination array because\n    Mat::create does not always allocate a new matrix.\n     */\n    bool isContinuous() const;\n\n    //! returns true if the matrix is a submatrix of another matrix\n    bool isSubmatrix() const;\n\n    /** @brief Returns the matrix element size in bytes.\n\n    The method returns the matrix element size in bytes. For example, if the matrix type is CV_16SC3 ,\n    the method returns 3\\*sizeof(short) or 6.\n     */\n    size_t elemSize() const;\n\n    /** @brief Returns the size of each matrix element channel in bytes.\n\n    The method returns the matrix element channel size in bytes, that is, it ignores the number of\n    channels. For example, if the matrix type is CV_16SC3 , the method returns sizeof(short) or 2.\n     */\n    size_t elemSize1() const;\n\n    /** @brief Returns the type of a matrix element.\n\n    The method returns a matrix element type. This is an identifier compatible with the CvMat type\n    system, like CV_16SC3 or 16-bit signed 3-channel array, and so on.\n     */\n    int type() const;\n\n    /** @brief Returns the depth of a matrix element.\n\n    The method returns the identifier of the matrix element depth (the type of each individual channel).\n    For example, for a 16-bit signed element array, the method returns CV_16S . A complete list of\n    matrix types contains the following values:\n    -   CV_8U - 8-bit unsigned integers ( 0..255 )\n    -   CV_8S - 8-bit signed integers ( -128..127 )\n    -   CV_16U - 16-bit unsigned integers ( 0..65535 )\n    -   CV_16S - 16-bit signed integers ( -32768..32767 )\n    -   CV_32S - 32-bit signed integers ( -2147483648..2147483647 )\n    -   CV_32F - 32-bit floating-point numbers ( -FLT_MAX..FLT_MAX, INF, NAN )\n    -   CV_64F - 64-bit floating-point numbers ( -DBL_MAX..DBL_MAX, INF, NAN )\n     */\n    int depth() const;\n\n    /** @brief Returns the number of matrix channels.\n\n    The method returns the number of matrix channels.\n     */\n    int channels() const;\n\n    /** @brief Returns a normalized step.\n\n    The method returns a matrix step divided by Mat::elemSize1() . It can be useful to quickly access an\n    arbitrary matrix element.\n     */\n    size_t step1(int i=0) const;\n\n    /** @brief Returns true if the array has no elements.\n\n    The method returns true if Mat::total() is 0 or if Mat::data is NULL. Because of pop_back() and\n    resize() methods `M.total() == 0` does not imply that `M.data == NULL`.\n     */\n    bool empty() const;\n\n    /** @brief Returns the total number of array elements.\n\n    The method returns the number of array elements (a number of pixels if the array represents an\n    image).\n     */\n    size_t total() const;\n\n    /** @brief Returns the total number of array elements.\n\n     The method returns the number of elements within a certain sub-array slice with startDim <= dim < endDim\n     */\n    size_t total(int startDim, int endDim=INT_MAX) const;\n\n    /**\n     * @param elemChannels Number of channels or number of columns the matrix should have.\n     *                     For a 2-D matrix, when the matrix has only 1 column, then it should have\n     *                     elemChannels channels; When the matrix has only 1 channel,\n     *                     then it should have elemChannels columns.\n     *                     For a 3-D matrix, it should have only one channel. Furthermore,\n     *                     if the number of planes is not one, then the number of rows\n     *                     within every plane has to be 1; if the number of rows within\n     *                     every plane is not 1, then the number of planes has to be 1.\n     * @param depth The depth the matrix should have. Set it to -1 when any depth is fine.\n     * @param requireContinuous Set it to true to require the matrix to be continuous\n     * @return -1 if the requirement is not satisfied.\n     *         Otherwise, it returns the number of elements in the matrix. Note\n     *         that an element may have multiple channels.\n     *\n     * The following code demonstrates its usage for a 2-d matrix:\n     * @snippet snippets/core_mat_checkVector.cpp example-2d\n     *\n     * The following code demonstrates its usage for a 3-d matrix:\n     * @snippet snippets/core_mat_checkVector.cpp example-3d\n     */\n    int checkVector(int elemChannels, int depth=-1, bool requireContinuous=true) const;\n\n    /** @brief Returns a pointer to the specified matrix row.\n\n    The methods return `uchar*` or typed pointer to the specified matrix row. See the sample in\n    Mat::isContinuous to know how to use these methods.\n    @param i0 A 0-based row index.\n     */\n    uchar* ptr(int i0=0);\n    /** @overload */\n    const uchar* ptr(int i0=0) const;\n\n    /** @overload\n    @param row Index along the dimension 0\n    @param col Index along the dimension 1\n    */\n    uchar* ptr(int row, int col);\n    /** @overload\n    @param row Index along the dimension 0\n    @param col Index along the dimension 1\n    */\n    const uchar* ptr(int row, int col) const;\n\n    /** @overload */\n    uchar* ptr(int i0, int i1, int i2);\n    /** @overload */\n    const uchar* ptr(int i0, int i1, int i2) const;\n\n    /** @overload */\n    uchar* ptr(const int* idx);\n    /** @overload */\n    const uchar* ptr(const int* idx) const;\n    /** @overload */\n    template<int n> uchar* ptr(const Vec<int, n>& idx);\n    /** @overload */\n    template<int n> const uchar* ptr(const Vec<int, n>& idx) const;\n\n    /** @overload */\n    template<typename _Tp> _Tp* ptr(int i0=0);\n    /** @overload */\n    template<typename _Tp> const _Tp* ptr(int i0=0) const;\n    /** @overload\n    @param row Index along the dimension 0\n    @param col Index along the dimension 1\n    */\n    template<typename _Tp> _Tp* ptr(int row, int col);\n    /** @overload\n    @param row Index along the dimension 0\n    @param col Index along the dimension 1\n    */\n    template<typename _Tp> const _Tp* ptr(int row, int col) const;\n    /** @overload */\n    template<typename _Tp> _Tp* ptr(int i0, int i1, int i2);\n    /** @overload */\n    template<typename _Tp> const _Tp* ptr(int i0, int i1, int i2) const;\n    /** @overload */\n    template<typename _Tp> _Tp* ptr(const int* idx);\n    /** @overload */\n    template<typename _Tp> const _Tp* ptr(const int* idx) const;\n    /** @overload */\n    template<typename _Tp, int n> _Tp* ptr(const Vec<int, n>& idx);\n    /** @overload */\n    template<typename _Tp, int n> const _Tp* ptr(const Vec<int, n>& idx) const;\n\n    /** @brief Returns a reference to the specified array element.\n\n    The template methods return a reference to the specified array element. For the sake of higher\n    performance, the index range checks are only performed in the Debug configuration.\n\n    Note that the variants with a single index (i) can be used to access elements of single-row or\n    single-column 2-dimensional arrays. That is, if, for example, A is a 1 x N floating-point matrix and\n    B is an M x 1 integer matrix, you can simply write `A.at<float>(k+4)` and `B.at<int>(2*i+1)`\n    instead of `A.at<float>(0,k+4)` and `B.at<int>(2*i+1,0)`, respectively.\n\n    The example below initializes a Hilbert matrix:\n    @code\n        Mat H(100, 100, CV_64F);\n        for(int i = 0; i < H.rows; i++)\n            for(int j = 0; j < H.cols; j++)\n                H.at<double>(i,j)=1./(i+j+1);\n    @endcode\n\n    Keep in mind that the size identifier used in the at operator cannot be chosen at random. It depends\n    on the image from which you are trying to retrieve the data. The table below gives a better insight in this:\n     - If matrix is of type `CV_8U` then use `Mat.at<uchar>(y,x)`.\n     - If matrix is of type `CV_8S` then use `Mat.at<schar>(y,x)`.\n     - If matrix is of type `CV_16U` then use `Mat.at<ushort>(y,x)`.\n     - If matrix is of type `CV_16S` then use `Mat.at<short>(y,x)`.\n     - If matrix is of type `CV_32S`  then use `Mat.at<int>(y,x)`.\n     - If matrix is of type `CV_32F`  then use `Mat.at<float>(y,x)`.\n     - If matrix is of type `CV_64F` then use `Mat.at<double>(y,x)`.\n\n    @param i0 Index along the dimension 0\n     */\n    template<typename _Tp> _Tp& at(int i0=0);\n    /** @overload\n    @param i0 Index along the dimension 0\n    */\n    template<typename _Tp> const _Tp& at(int i0=0) const;\n    /** @overload\n    @param row Index along the dimension 0\n    @param col Index along the dimension 1\n    */\n    template<typename _Tp> _Tp& at(int row, int col);\n    /** @overload\n    @param row Index along the dimension 0\n    @param col Index along the dimension 1\n    */\n    template<typename _Tp> const _Tp& at(int row, int col) const;\n\n    /** @overload\n    @param i0 Index along the dimension 0\n    @param i1 Index along the dimension 1\n    @param i2 Index along the dimension 2\n    */\n    template<typename _Tp> _Tp& at(int i0, int i1, int i2);\n    /** @overload\n    @param i0 Index along the dimension 0\n    @param i1 Index along the dimension 1\n    @param i2 Index along the dimension 2\n    */\n    template<typename _Tp> const _Tp& at(int i0, int i1, int i2) const;\n\n    /** @overload\n    @param idx Array of Mat::dims indices.\n    */\n    template<typename _Tp> _Tp& at(const int* idx);\n    /** @overload\n    @param idx Array of Mat::dims indices.\n    */\n    template<typename _Tp> const _Tp& at(const int* idx) const;\n\n    /** @overload */\n    template<typename _Tp, int n> _Tp& at(const Vec<int, n>& idx);\n    /** @overload */\n    template<typename _Tp, int n> const _Tp& at(const Vec<int, n>& idx) const;\n\n    /** @overload\n    special versions for 2D arrays (especially convenient for referencing image pixels)\n    @param pt Element position specified as Point(j,i) .\n    */\n    template<typename _Tp> _Tp& at(Point pt);\n    /** @overload\n    special versions for 2D arrays (especially convenient for referencing image pixels)\n    @param pt Element position specified as Point(j,i) .\n    */\n    template<typename _Tp> const _Tp& at(Point pt) const;\n\n    /** @brief Returns the matrix iterator and sets it to the first matrix element.\n\n    The methods return the matrix read-only or read-write iterators. The use of matrix iterators is very\n    similar to the use of bi-directional STL iterators. In the example below, the alpha blending\n    function is rewritten using the matrix iterators:\n    @code\n        template<typename T>\n        void alphaBlendRGBA(const Mat& src1, const Mat& src2, Mat& dst)\n        {\n            typedef Vec<T, 4> VT;\n\n            const float alpha_scale = (float)std::numeric_limits<T>::max(),\n                        inv_scale = 1.f/alpha_scale;\n\n            CV_Assert( src1.type() == src2.type() &&\n                       src1.type() == traits::Type<VT>::value &&\n                       src1.size() == src2.size());\n            Size size = src1.size();\n            dst.create(size, src1.type());\n\n            MatConstIterator_<VT> it1 = src1.begin<VT>(), it1_end = src1.end<VT>();\n            MatConstIterator_<VT> it2 = src2.begin<VT>();\n            MatIterator_<VT> dst_it = dst.begin<VT>();\n\n            for( ; it1 != it1_end; ++it1, ++it2, ++dst_it )\n            {\n                VT pix1 = *it1, pix2 = *it2;\n                float alpha = pix1[3]*inv_scale, beta = pix2[3]*inv_scale;\n                *dst_it = VT(saturate_cast<T>(pix1[0]*alpha + pix2[0]*beta),\n                             saturate_cast<T>(pix1[1]*alpha + pix2[1]*beta),\n                             saturate_cast<T>(pix1[2]*alpha + pix2[2]*beta),\n                             saturate_cast<T>((1 - (1-alpha)*(1-beta))*alpha_scale));\n            }\n        }\n    @endcode\n     */\n    template<typename _Tp> MatIterator_<_Tp> begin();\n    template<typename _Tp> MatConstIterator_<_Tp> begin() const;\n\n    /** @brief Same as begin() but for inverse traversal\n     */\n    template<typename _Tp> std::reverse_iterator<MatIterator_<_Tp>> rbegin();\n    template<typename _Tp> std::reverse_iterator<MatConstIterator_<_Tp>> rbegin() const;\n\n    /** @brief Returns the matrix iterator and sets it to the after-last matrix element.\n\n    The methods return the matrix read-only or read-write iterators, set to the point following the last\n    matrix element.\n     */\n    template<typename _Tp> MatIterator_<_Tp> end();\n    template<typename _Tp> MatConstIterator_<_Tp> end() const;\n\n    /** @brief Same as end() but for inverse traversal\n     */\n    template<typename _Tp> std::reverse_iterator< MatIterator_<_Tp>> rend();\n    template<typename _Tp> std::reverse_iterator< MatConstIterator_<_Tp>> rend() const;\n\n\n    /** @brief Runs the given functor over all matrix elements in parallel.\n\n    The operation passed as argument has to be a function pointer, a function object or a lambda(C++11).\n\n    Example 1. All of the operations below put 0xFF the first channel of all matrix elements:\n    @code\n        Mat image(1920, 1080, CV_8UC3);\n        typedef cv::Point3_<uint8_t> Pixel;\n\n        // first. raw pointer access.\n        for (int r = 0; r < image.rows; ++r) {\n            Pixel* ptr = image.ptr<Pixel>(r, 0);\n            const Pixel* ptr_end = ptr + image.cols;\n            for (; ptr != ptr_end; ++ptr) {\n                ptr->x = 255;\n            }\n        }\n\n        // Using MatIterator. (Simple but there are a Iterator's overhead)\n        for (Pixel &p : cv::Mat_<Pixel>(image)) {\n            p.x = 255;\n        }\n\n        // Parallel execution with function object.\n        struct Operator {\n            void operator ()(Pixel &pixel, const int * position) {\n                pixel.x = 255;\n            }\n        };\n        image.forEach<Pixel>(Operator());\n\n        // Parallel execution using C++11 lambda.\n        image.forEach<Pixel>([](Pixel &p, const int * position) -> void {\n            p.x = 255;\n        });\n    @endcode\n    Example 2. Using the pixel's position:\n    @code\n        // Creating 3D matrix (255 x 255 x 255) typed uint8_t\n        // and initialize all elements by the value which equals elements position.\n        // i.e. pixels (x,y,z) = (1,2,3) is (b,g,r) = (1,2,3).\n\n        int sizes[] = { 255, 255, 255 };\n        typedef cv::Point3_<uint8_t> Pixel;\n\n        Mat_<Pixel> image = Mat::zeros(3, sizes, CV_8UC3);\n\n        image.forEach<Pixel>([&](Pixel& pixel, const int position[]) -> void {\n            pixel.x = position[0];\n            pixel.y = position[1];\n            pixel.z = position[2];\n        });\n    @endcode\n     */\n    template<typename _Tp, typename Functor> void forEach(const Functor& operation);\n    /** @overload */\n    template<typename _Tp, typename Functor> void forEach(const Functor& operation) const;\n\n    Mat(Mat&& m);\n    Mat& operator = (Mat&& m);\n\n    enum { MAGIC_VAL  = 0x42FF0000, AUTO_STEP = 0, CONTINUOUS_FLAG = CV_MAT_CONT_FLAG, SUBMATRIX_FLAG = CV_SUBMAT_FLAG };\n    enum { MAGIC_MASK = 0xFFFF0000, TYPE_MASK = 0x00000FFF, DEPTH_MASK = 7 };\n\n    /*! includes several bit-fields:\n         - the magic signature\n         - continuity flag\n         - depth\n         - number of channels\n     */\n    int flags;\n    //! the matrix dimensionality, >= 2\n    int dims;\n    //! the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions\n    int rows, cols;\n    //! pointer to the data\n    uchar* data;\n\n    //! helper fields used in locateROI and adjustROI\n    const uchar* datastart;\n    const uchar* dataend;\n    const uchar* datalimit;\n\n    //! custom allocator\n    MatAllocator* allocator;\n    //! and the standard allocator\n    static MatAllocator* getStdAllocator();\n    static MatAllocator* getDefaultAllocator();\n    static void setDefaultAllocator(MatAllocator* allocator);\n\n    //! internal use method: updates the continuity flag\n    void updateContinuityFlag();\n\n    //! interaction with UMat\n    UMatData* u;\n\n    MatSize size;\n    MatStep step;\n\nprotected:\n    template<typename _Tp, typename Functor> void forEach_impl(const Functor& operation);\n};\n\n\n///////////////////////////////// Mat_<_Tp> ////////////////////////////////////\n\n/** @brief Template matrix class derived from Mat\n\n@code{.cpp}\n    template<typename _Tp> class Mat_ : public Mat\n    {\n    public:\n        // ... some specific methods\n        //         and\n        // no new extra fields\n    };\n@endcode\nThe class `Mat_<_Tp>` is a *thin* template wrapper on top of the Mat class. It does not have any\nextra data fields. Nor this class nor Mat has any virtual methods. Thus, references or pointers to\nthese two classes can be freely but carefully converted one to another. For example:\n@code{.cpp}\n    // create a 100x100 8-bit matrix\n    Mat M(100,100,CV_8U);\n    // this will be compiled fine. no any data conversion will be done.\n    Mat_<float>& M1 = (Mat_<float>&)M;\n    // the program is likely to crash at the statement below\n    M1(99,99) = 1.f;\n@endcode\nWhile Mat is sufficient in most cases, Mat_ can be more convenient if you use a lot of element\naccess operations and if you know matrix type at the compilation time. Note that\n`Mat::at(int y,int x)` and `Mat_::operator()(int y,int x)` do absolutely the same\nand run at the same speed, but the latter is certainly shorter:\n@code{.cpp}\n    Mat_<double> M(20,20);\n    for(int i = 0; i < M.rows; i++)\n        for(int j = 0; j < M.cols; j++)\n            M(i,j) = 1./(i+j+1);\n    Mat E, V;\n    eigen(M,E,V);\n    cout << E.at<double>(0,0)/E.at<double>(M.rows-1,0);\n@endcode\nTo use Mat_ for multi-channel images/matrices, pass Vec as a Mat_ parameter:\n@code{.cpp}\n    // allocate a 320x240 color image and fill it with green (in RGB space)\n    Mat_<Vec3b> img(240, 320, Vec3b(0,255,0));\n    // now draw a diagonal white line\n    for(int i = 0; i < 100; i++)\n        img(i,i)=Vec3b(255,255,255);\n    // and now scramble the 2nd (red) channel of each pixel\n    for(int i = 0; i < img.rows; i++)\n        for(int j = 0; j < img.cols; j++)\n            img(i,j)[2] ^= (uchar)(i ^ j);\n@endcode\nMat_ is fully compatible with C++11 range-based for loop. For example such loop\ncan be used to safely apply look-up table:\n@code{.cpp}\nvoid applyTable(Mat_<uchar>& I, const uchar* const table)\n{\n    for(auto& pixel : I)\n    {\n        pixel = table[pixel];\n    }\n}\n@endcode\n */\ntemplate<typename _Tp> class Mat_ : public Mat\n{\npublic:\n    typedef _Tp value_type;\n    typedef typename DataType<_Tp>::channel_type channel_type;\n    typedef MatIterator_<_Tp> iterator;\n    typedef MatConstIterator_<_Tp> const_iterator;\n\n    //! default constructor\n    Mat_() CV_NOEXCEPT;\n    //! equivalent to Mat(_rows, _cols, DataType<_Tp>::type)\n    Mat_(int _rows, int _cols);\n    //! constructor that sets each matrix element to specified value\n    Mat_(int _rows, int _cols, const _Tp& value);\n    //! equivalent to Mat(_size, DataType<_Tp>::type)\n    explicit Mat_(Size _size);\n    //! constructor that sets each matrix element to specified value\n    Mat_(Size _size, const _Tp& value);\n    //! n-dim array constructor\n    Mat_(int _ndims, const int* _sizes);\n    //! n-dim array constructor that sets each matrix element to specified value\n    Mat_(int _ndims, const int* _sizes, const _Tp& value);\n    //! copy/conversion constructor. If m is of different type, it's converted\n    Mat_(const Mat& m);\n    //! copy constructor\n    Mat_(const Mat_& m);\n    //! constructs a matrix on top of user-allocated data. step is in bytes(!!!), regardless of the type\n    Mat_(int _rows, int _cols, _Tp* _data, size_t _step=AUTO_STEP);\n    //! constructs n-dim matrix on top of user-allocated data. steps are in bytes(!!!), regardless of the type\n    Mat_(int _ndims, const int* _sizes, _Tp* _data, const size_t* _steps=0);\n    //! selects a submatrix\n    Mat_(const Mat_& m, const Range& rowRange, const Range& colRange=Range::all());\n    //! selects a submatrix\n    Mat_(const Mat_& m, const Rect& roi);\n    //! selects a submatrix, n-dim version\n    Mat_(const Mat_& m, const Range* ranges);\n    //! selects a submatrix, n-dim version\n    Mat_(const Mat_& m, const std::vector<Range>& ranges);\n    //! from a matrix expression\n    explicit Mat_(const MatExpr& e);\n    //! makes a matrix out of Vec, std::vector, Point_ or Point3_. The matrix will have a single column\n    explicit Mat_(const std::vector<_Tp>& vec, bool copyData=false);\n    template<int n> explicit Mat_(const Vec<typename DataType<_Tp>::channel_type, n>& vec, bool copyData=true);\n    template<int m, int n> explicit Mat_(const Matx<typename DataType<_Tp>::channel_type, m, n>& mtx, bool copyData=true);\n    explicit Mat_(const Point_<typename DataType<_Tp>::channel_type>& pt, bool copyData=true);\n    explicit Mat_(const Point3_<typename DataType<_Tp>::channel_type>& pt, bool copyData=true);\n    explicit Mat_(const MatCommaInitializer_<_Tp>& commaInitializer);\n\n    Mat_(std::initializer_list<_Tp> values);\n    explicit Mat_(const std::initializer_list<int> sizes, const std::initializer_list<_Tp> values);\n\n    template <std::size_t _Nm> explicit Mat_(const std::array<_Tp, _Nm>& arr, bool copyData=false);\n\n    Mat_& operator = (const Mat& m);\n    Mat_& operator = (const Mat_& m);\n    //! set all the elements to s.\n    Mat_& operator = (const _Tp& s);\n    //! assign a matrix expression\n    Mat_& operator = (const MatExpr& e);\n\n    //! iterators; they are smart enough to skip gaps in the end of rows\n    iterator begin();\n    iterator end();\n    const_iterator begin() const;\n    const_iterator end() const;\n\n    //reverse iterators\n    std::reverse_iterator<iterator> rbegin();\n    std::reverse_iterator<iterator> rend();\n    std::reverse_iterator<const_iterator> rbegin() const;\n    std::reverse_iterator<const_iterator> rend() const;\n\n    //! template methods for for operation over all matrix elements.\n    // the operations take care of skipping gaps in the end of rows (if any)\n    template<typename Functor> void forEach(const Functor& operation);\n    template<typename Functor> void forEach(const Functor& operation) const;\n\n    //! equivalent to Mat::create(_rows, _cols, DataType<_Tp>::type)\n    void create(int _rows, int _cols);\n    //! equivalent to Mat::create(_size, DataType<_Tp>::type)\n    void create(Size _size);\n    //! equivalent to Mat::create(_ndims, _sizes, DatType<_Tp>::type)\n    void create(int _ndims, const int* _sizes);\n    //! equivalent to Mat::release()\n    void release();\n    //! cross-product\n    Mat_ cross(const Mat_& m) const;\n    //! data type conversion\n    template<typename T2> operator Mat_<T2>() const;\n    //! overridden forms of Mat::row() etc.\n    Mat_ row(int y) const;\n    Mat_ col(int x) const;\n    Mat_ diag(int d=0) const;\n    Mat_ clone() const CV_NODISCARD;\n\n    //! overridden forms of Mat::elemSize() etc.\n    size_t elemSize() const;\n    size_t elemSize1() const;\n    int type() const;\n    int depth() const;\n    int channels() const;\n    size_t step1(int i=0) const;\n    //! returns step()/sizeof(_Tp)\n    size_t stepT(int i=0) const;\n\n    //! overridden forms of Mat::zeros() etc. Data type is omitted, of course\n    static MatExpr zeros(int rows, int cols);\n    static MatExpr zeros(Size size);\n    static MatExpr zeros(int _ndims, const int* _sizes);\n    static MatExpr ones(int rows, int cols);\n    static MatExpr ones(Size size);\n    static MatExpr ones(int _ndims, const int* _sizes);\n    static MatExpr eye(int rows, int cols);\n    static MatExpr eye(Size size);\n\n    //! some more overridden methods\n    Mat_& adjustROI( int dtop, int dbottom, int dleft, int dright );\n    Mat_ operator()( const Range& rowRange, const Range& colRange ) const;\n    Mat_ operator()( const Rect& roi ) const;\n    Mat_ operator()( const Range* ranges ) const;\n    Mat_ operator()(const std::vector<Range>& ranges) const;\n\n    //! more convenient forms of row and element access operators\n    _Tp* operator [](int y);\n    const _Tp* operator [](int y) const;\n\n    //! returns reference to the specified element\n    _Tp& operator ()(const int* idx);\n    //! returns read-only reference to the specified element\n    const _Tp& operator ()(const int* idx) const;\n\n    //! returns reference to the specified element\n    template<int n> _Tp& operator ()(const Vec<int, n>& idx);\n    //! returns read-only reference to the specified element\n    template<int n> const _Tp& operator ()(const Vec<int, n>& idx) const;\n\n    //! returns reference to the specified element (1D case)\n    _Tp& operator ()(int idx0);\n    //! returns read-only reference to the specified element (1D case)\n    const _Tp& operator ()(int idx0) const;\n    //! returns reference to the specified element (2D case)\n    _Tp& operator ()(int row, int col);\n    //! returns read-only reference to the specified element (2D case)\n    const _Tp& operator ()(int row, int col) const;\n    //! returns reference to the specified element (3D case)\n    _Tp& operator ()(int idx0, int idx1, int idx2);\n    //! returns read-only reference to the specified element (3D case)\n    const _Tp& operator ()(int idx0, int idx1, int idx2) const;\n\n    _Tp& operator ()(Point pt);\n    const _Tp& operator ()(Point pt) const;\n\n    //! conversion to vector.\n    operator std::vector<_Tp>() const;\n\n    //! conversion to array.\n    template<std::size_t _Nm> operator std::array<_Tp, _Nm>() const;\n\n    //! conversion to Vec\n    template<int n> operator Vec<typename DataType<_Tp>::channel_type, n>() const;\n    //! conversion to Matx\n    template<int m, int n> operator Matx<typename DataType<_Tp>::channel_type, m, n>() const;\n\n    Mat_(Mat_&& m);\n    Mat_& operator = (Mat_&& m);\n\n    Mat_(Mat&& m);\n    Mat_& operator = (Mat&& m);\n\n    Mat_(MatExpr&& e);\n};\n\ntypedef Mat_<uchar> Mat1b;\ntypedef Mat_<Vec2b> Mat2b;\ntypedef Mat_<Vec3b> Mat3b;\ntypedef Mat_<Vec4b> Mat4b;\n\ntypedef Mat_<short> Mat1s;\ntypedef Mat_<Vec2s> Mat2s;\ntypedef Mat_<Vec3s> Mat3s;\ntypedef Mat_<Vec4s> Mat4s;\n\ntypedef Mat_<ushort> Mat1w;\ntypedef Mat_<Vec2w> Mat2w;\ntypedef Mat_<Vec3w> Mat3w;\ntypedef Mat_<Vec4w> Mat4w;\n\ntypedef Mat_<int>   Mat1i;\ntypedef Mat_<Vec2i> Mat2i;\ntypedef Mat_<Vec3i> Mat3i;\ntypedef Mat_<Vec4i> Mat4i;\n\ntypedef Mat_<float> Mat1f;\ntypedef Mat_<Vec2f> Mat2f;\ntypedef Mat_<Vec3f> Mat3f;\ntypedef Mat_<Vec4f> Mat4f;\n\ntypedef Mat_<double> Mat1d;\ntypedef Mat_<Vec2d> Mat2d;\ntypedef Mat_<Vec3d> Mat3d;\ntypedef Mat_<Vec4d> Mat4d;\n\n/** @todo document */\nclass CV_EXPORTS UMat\n{\npublic:\n    //! default constructor\n    UMat(UMatUsageFlags usageFlags = USAGE_DEFAULT) CV_NOEXCEPT;\n    //! constructs 2D matrix of the specified size and type\n    // (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.)\n    UMat(int rows, int cols, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n    UMat(Size size, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n    //! constructs 2D matrix and fills it with the specified value _s.\n    UMat(int rows, int cols, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n    UMat(Size size, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n\n    //! constructs n-dimensional matrix\n    UMat(int ndims, const int* sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n    UMat(int ndims, const int* sizes, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n\n    //! copy constructor\n    UMat(const UMat& m);\n\n    //! creates a matrix header for a part of the bigger matrix\n    UMat(const UMat& m, const Range& rowRange, const Range& colRange=Range::all());\n    UMat(const UMat& m, const Rect& roi);\n    UMat(const UMat& m, const Range* ranges);\n    UMat(const UMat& m, const std::vector<Range>& ranges);\n\n    // FIXIT copyData=false is not implemented, drop this in favor of cv::Mat (OpenCV 5.0)\n    //! builds matrix from std::vector with or without copying the data\n    template<typename _Tp> explicit UMat(const std::vector<_Tp>& vec, bool copyData=false);\n\n    //! destructor - calls release()\n    ~UMat();\n    //! assignment operators\n    UMat& operator = (const UMat& m);\n\n    Mat getMat(AccessFlag flags) const;\n\n    //! returns a new matrix header for the specified row\n    UMat row(int y) const;\n    //! returns a new matrix header for the specified column\n    UMat col(int x) const;\n    //! ... for the specified row span\n    UMat rowRange(int startrow, int endrow) const;\n    UMat rowRange(const Range& r) const;\n    //! ... for the specified column span\n    UMat colRange(int startcol, int endcol) const;\n    UMat colRange(const Range& r) const;\n    //! ... for the specified diagonal\n    //! (d=0 - the main diagonal,\n    //!  >0 - a diagonal from the upper half,\n    //!  <0 - a diagonal from the lower half)\n    UMat diag(int d=0) const;\n    //! constructs a square diagonal matrix which main diagonal is vector \"d\"\n    static UMat diag(const UMat& d, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);\n    static UMat diag(const UMat& d) { return diag(d, USAGE_DEFAULT); }  // OpenCV 5.0: remove abi compatibility overload\n\n    //! returns deep copy of the matrix, i.e. the data is copied\n    UMat clone() const CV_NODISCARD;\n    //! copies the matrix content to \"m\".\n    // It calls m.create(this->size(), this->type()).\n    void copyTo( OutputArray m ) const;\n    //! copies those matrix elements to \"m\" that are marked with non-zero mask elements.\n    void copyTo( OutputArray m, InputArray mask ) const;\n    //! converts matrix to another datatype with optional scaling. See cvConvertScale.\n    void convertTo( OutputArray m, int rtype, double alpha=1, double beta=0 ) const;\n\n    void assignTo( UMat& m, int type=-1 ) const;\n\n    //! sets every matrix element to s\n    UMat& operator = (const Scalar& s);\n    //! sets some of the matrix elements to s, according to the mask\n    UMat& setTo(InputArray value, InputArray mask=noArray());\n    //! creates alternative matrix header for the same data, with different\n    // number of channels and/or different number of rows. see cvReshape.\n    UMat reshape(int cn, int rows=0) const;\n    UMat reshape(int cn, int newndims, const int* newsz) const;\n\n    //! matrix transposition by means of matrix expressions\n    UMat t() const;\n    //! matrix inversion by means of matrix expressions\n    UMat inv(int method=DECOMP_LU) const;\n    //! per-element matrix multiplication by means of matrix expressions\n    UMat mul(InputArray m, double scale=1) const;\n\n    //! computes dot-product\n    double dot(InputArray m) const;\n\n    //! Matlab-style matrix initialization\n    static UMat zeros(int rows, int cols, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);\n    static UMat zeros(Size size, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);\n    static UMat zeros(int ndims, const int* sz, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);\n    static UMat zeros(int rows, int cols, int type) { return zeros(rows, cols, type, USAGE_DEFAULT); }  // OpenCV 5.0: remove abi compatibility overload\n    static UMat zeros(Size size, int type) { return zeros(size, type, USAGE_DEFAULT); }  // OpenCV 5.0: remove abi compatibility overload\n    static UMat zeros(int ndims, const int* sz, int type) { return zeros(ndims, sz, type, USAGE_DEFAULT); }  // OpenCV 5.0: remove abi compatibility overload\n    static UMat ones(int rows, int cols, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);\n    static UMat ones(Size size, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);\n    static UMat ones(int ndims, const int* sz, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);\n    static UMat ones(int rows, int cols, int type) { return ones(rows, cols, type, USAGE_DEFAULT); }  // OpenCV 5.0: remove abi compatibility overload\n    static UMat ones(Size size, int type) { return ones(size, type, USAGE_DEFAULT); }  // OpenCV 5.0: remove abi compatibility overload\n    static UMat ones(int ndims, const int* sz, int type) { return ones(ndims, sz, type, USAGE_DEFAULT); }  // OpenCV 5.0: remove abi compatibility overload\n    static UMat eye(int rows, int cols, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);\n    static UMat eye(Size size, int type, UMatUsageFlags usageFlags /*= USAGE_DEFAULT*/);\n    static UMat eye(int rows, int cols, int type) { return eye(rows, cols, type, USAGE_DEFAULT); }  // OpenCV 5.0: remove abi compatibility overload\n    static UMat eye(Size size, int type) { return eye(size, type, USAGE_DEFAULT); }  // OpenCV 5.0: remove abi compatibility overload\n\n    //! allocates new matrix data unless the matrix already has specified size and type.\n    // previous data is unreferenced if needed.\n    void create(int rows, int cols, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n    void create(Size size, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n    void create(int ndims, const int* sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n    void create(const std::vector<int>& sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT);\n\n    //! increases the reference counter; use with care to avoid memleaks\n    void addref();\n    //! decreases reference counter;\n    // deallocates the data when reference counter reaches 0.\n    void release();\n\n    //! deallocates the matrix data\n    void deallocate();\n    //! internal use function; properly re-allocates _size, _step arrays\n    void copySize(const UMat& m);\n\n    //! locates matrix header within a parent matrix. See below\n    void locateROI( Size& wholeSize, Point& ofs ) const;\n    //! moves/resizes the current matrix ROI inside the parent matrix.\n    UMat& adjustROI( int dtop, int dbottom, int dleft, int dright );\n    //! extracts a rectangular sub-matrix\n    // (this is a generalized form of row, rowRange etc.)\n    UMat operator()( Range rowRange, Range colRange ) const;\n    UMat operator()( const Rect& roi ) const;\n    UMat operator()( const Range* ranges ) const;\n    UMat operator()(const std::vector<Range>& ranges) const;\n\n    //! returns true iff the matrix data is continuous\n    // (i.e. when there are no gaps between successive rows).\n    // similar to CV_IS_MAT_CONT(cvmat->type)\n    bool isContinuous() const;\n\n    //! returns true if the matrix is a submatrix of another matrix\n    bool isSubmatrix() const;\n\n    //! returns element size in bytes,\n    // similar to CV_ELEM_SIZE(cvmat->type)\n    size_t elemSize() const;\n    //! returns the size of element channel in bytes.\n    size_t elemSize1() const;\n    //! returns element type, similar to CV_MAT_TYPE(cvmat->type)\n    int type() const;\n    //! returns element type, similar to CV_MAT_DEPTH(cvmat->type)\n    int depth() const;\n    //! returns element type, similar to CV_MAT_CN(cvmat->type)\n    int channels() const;\n    //! returns step/elemSize1()\n    size_t step1(int i=0) const;\n    //! returns true if matrix data is NULL\n    bool empty() const;\n    //! returns the total number of matrix elements\n    size_t total() const;\n\n    //! returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise\n    int checkVector(int elemChannels, int depth=-1, bool requireContinuous=true) const;\n\n    UMat(UMat&& m);\n    UMat& operator = (UMat&& m);\n\n    /*! Returns the OpenCL buffer handle on which UMat operates on.\n        The UMat instance should be kept alive during the use of the handle to prevent the buffer to be\n        returned to the OpenCV buffer pool.\n     */\n    void* handle(AccessFlag accessFlags) const;\n    void ndoffset(size_t* ofs) const;\n\n    enum { MAGIC_VAL  = 0x42FF0000, AUTO_STEP = 0, CONTINUOUS_FLAG = CV_MAT_CONT_FLAG, SUBMATRIX_FLAG = CV_SUBMAT_FLAG };\n    enum { MAGIC_MASK = 0xFFFF0000, TYPE_MASK = 0x00000FFF, DEPTH_MASK = 7 };\n\n    /*! includes several bit-fields:\n         - the magic signature\n         - continuity flag\n         - depth\n         - number of channels\n     */\n    int flags;\n\n    //! the matrix dimensionality, >= 2\n    int dims;\n\n    //! number of rows in the matrix; -1 when the matrix has more than 2 dimensions\n    int rows;\n\n    //! number of columns in the matrix; -1 when the matrix has more than 2 dimensions\n    int cols;\n\n    //! custom allocator\n    MatAllocator* allocator;\n\n    //! usage flags for allocator; recommend do not set directly, instead set during construct/create/getUMat\n    UMatUsageFlags usageFlags;\n\n    //! and the standard allocator\n    static MatAllocator* getStdAllocator();\n\n    //! internal use method: updates the continuity flag\n    void updateContinuityFlag();\n\n    //! black-box container of UMat data\n    UMatData* u;\n\n    //! offset of the submatrix (or 0)\n    size_t offset;\n\n    //! dimensional size of the matrix; accessible in various formats\n    MatSize size;\n\n    //! number of bytes each matrix element/row/plane/dimension occupies\n    MatStep step;\n\nprotected:\n};\n\n\n/////////////////////////// multi-dimensional sparse matrix //////////////////////////\n\n/** @brief The class SparseMat represents multi-dimensional sparse numerical arrays.\n\nSuch a sparse array can store elements of any type that Mat can store. *Sparse* means that only\nnon-zero elements are stored (though, as a result of operations on a sparse matrix, some of its\nstored elements can actually become 0. It is up to you to detect such elements and delete them\nusing SparseMat::erase ). The non-zero elements are stored in a hash table that grows when it is\nfilled so that the search time is O(1) in average (regardless of whether element is there or not).\nElements can be accessed using the following methods:\n-   Query operations (SparseMat::ptr and the higher-level SparseMat::ref, SparseMat::value and\n    SparseMat::find), for example:\n    @code\n        const int dims = 5;\n        int size[5] = {10, 10, 10, 10, 10};\n        SparseMat sparse_mat(dims, size, CV_32F);\n        for(int i = 0; i < 1000; i++)\n        {\n            int idx[dims];\n            for(int k = 0; k < dims; k++)\n                idx[k] = rand() % size[k];\n            sparse_mat.ref<float>(idx) += 1.f;\n        }\n        cout << \"nnz = \" << sparse_mat.nzcount() << endl;\n    @endcode\n-   Sparse matrix iterators. They are similar to MatIterator but different from NAryMatIterator.\n    That is, the iteration loop is familiar to STL users:\n    @code\n        // prints elements of a sparse floating-point matrix\n        // and the sum of elements.\n        SparseMatConstIterator_<float>\n            it = sparse_mat.begin<float>(),\n            it_end = sparse_mat.end<float>();\n        double s = 0;\n        int dims = sparse_mat.dims();\n        for(; it != it_end; ++it)\n        {\n            // print element indices and the element value\n            const SparseMat::Node* n = it.node();\n            printf(\"(\");\n            for(int i = 0; i < dims; i++)\n                printf(\"%d%s\", n->idx[i], i < dims-1 ? \", \" : \")\");\n            printf(\": %g\\n\", it.value<float>());\n            s += *it;\n        }\n        printf(\"Element sum is %g\\n\", s);\n    @endcode\n    If you run this loop, you will notice that elements are not enumerated in a logical order\n    (lexicographical, and so on). They come in the same order as they are stored in the hash table\n    (semi-randomly). You may collect pointers to the nodes and sort them to get the proper ordering.\n    Note, however, that pointers to the nodes may become invalid when you add more elements to the\n    matrix. This may happen due to possible buffer reallocation.\n-   Combination of the above 2 methods when you need to process 2 or more sparse matrices\n    simultaneously. For example, this is how you can compute unnormalized cross-correlation of the 2\n    floating-point sparse matrices:\n    @code\n        double cross_corr(const SparseMat& a, const SparseMat& b)\n        {\n            const SparseMat *_a = &a, *_b = &b;\n            // if b contains less elements than a,\n            // it is faster to iterate through b\n            if(_a->nzcount() > _b->nzcount())\n                std::swap(_a, _b);\n            SparseMatConstIterator_<float> it = _a->begin<float>(),\n                                           it_end = _a->end<float>();\n            double ccorr = 0;\n            for(; it != it_end; ++it)\n            {\n                // take the next element from the first matrix\n                float avalue = *it;\n                const Node* anode = it.node();\n                // and try to find an element with the same index in the second matrix.\n                // since the hash value depends only on the element index,\n                // reuse the hash value stored in the node\n                float bvalue = _b->value<float>(anode->idx,&anode->hashval);\n                ccorr += avalue*bvalue;\n            }\n            return ccorr;\n        }\n    @endcode\n */\nclass CV_EXPORTS SparseMat\n{\npublic:\n    typedef SparseMatIterator iterator;\n    typedef SparseMatConstIterator const_iterator;\n\n    enum { MAGIC_VAL=0x42FD0000, MAX_DIM=32, HASH_SCALE=0x5bd1e995, HASH_BIT=0x80000000 };\n\n    //! the sparse matrix header\n    struct CV_EXPORTS Hdr\n    {\n        Hdr(int _dims, const int* _sizes, int _type);\n        void clear();\n        int refcount;\n        int dims;\n        int valueOffset;\n        size_t nodeSize;\n        size_t nodeCount;\n        size_t freeList;\n        std::vector<uchar> pool;\n        std::vector<size_t> hashtab;\n        int size[MAX_DIM];\n    };\n\n    //! sparse matrix node - element of a hash table\n    struct CV_EXPORTS Node\n    {\n        //! hash value\n        size_t hashval;\n        //! index of the next node in the same hash table entry\n        size_t next;\n        //! index of the matrix element\n        int idx[MAX_DIM];\n    };\n\n    /** @brief Various SparseMat constructors.\n     */\n    SparseMat();\n\n    /** @overload\n    @param dims Array dimensionality.\n    @param _sizes Sparce matrix size on all dementions.\n    @param _type Sparse matrix data type.\n    */\n    SparseMat(int dims, const int* _sizes, int _type);\n\n    /** @overload\n    @param m Source matrix for copy constructor. If m is dense matrix (ocvMat) then it will be converted\n    to sparse representation.\n    */\n    SparseMat(const SparseMat& m);\n\n    /** @overload\n    @param m Source matrix for copy constructor. If m is dense matrix (ocvMat) then it will be converted\n    to sparse representation.\n    */\n    explicit SparseMat(const Mat& m);\n\n    //! the destructor\n    ~SparseMat();\n\n    //! assignment operator. This is O(1) operation, i.e. no data is copied\n    SparseMat& operator = (const SparseMat& m);\n    //! equivalent to the corresponding constructor\n    SparseMat& operator = (const Mat& m);\n\n    //! creates full copy of the matrix\n    SparseMat clone() const CV_NODISCARD;\n\n    //! copies all the data to the destination matrix. All the previous content of m is erased\n    void copyTo( SparseMat& m ) const;\n    //! converts sparse matrix to dense matrix.\n    void copyTo( Mat& m ) const;\n    //! multiplies all the matrix elements by the specified scale factor alpha and converts the results to the specified data type\n    void convertTo( SparseMat& m, int rtype, double alpha=1 ) const;\n    //! converts sparse matrix to dense n-dim matrix with optional type conversion and scaling.\n    /*!\n        @param [out] m - output matrix; if it does not have a proper size or type before the operation,\n            it is reallocated\n        @param [in] rtype - desired output matrix type or, rather, the depth since the number of channels\n            are the same as the input has; if rtype is negative, the output matrix will have the\n            same type as the input.\n        @param [in] alpha - optional scale factor\n        @param [in] beta - optional delta added to the scaled values\n    */\n    void convertTo( Mat& m, int rtype, double alpha=1, double beta=0 ) const;\n\n    // not used now\n    void assignTo( SparseMat& m, int type=-1 ) const;\n\n    //! reallocates sparse matrix.\n    /*!\n        If the matrix already had the proper size and type,\n        it is simply cleared with clear(), otherwise,\n        the old matrix is released (using release()) and the new one is allocated.\n    */\n    void create(int dims, const int* _sizes, int _type);\n    //! sets all the sparse matrix elements to 0, which means clearing the hash table.\n    void clear();\n    //! manually increments the reference counter to the header.\n    void addref();\n    // decrements the header reference counter. When the counter reaches 0, the header and all the underlying data are deallocated.\n    void release();\n\n    //! converts sparse matrix to the old-style representation; all the elements are copied.\n    //operator CvSparseMat*() const;\n    //! returns the size of each element in bytes (not including the overhead - the space occupied by SparseMat::Node elements)\n    size_t elemSize() const;\n    //! returns elemSize()/channels()\n    size_t elemSize1() const;\n\n    //! returns type of sparse matrix elements\n    int type() const;\n    //! returns the depth of sparse matrix elements\n    int depth() const;\n    //! returns the number of channels\n    int channels() const;\n\n    //! returns the array of sizes, or NULL if the matrix is not allocated\n    const int* size() const;\n    //! returns the size of i-th matrix dimension (or 0)\n    int size(int i) const;\n    //! returns the matrix dimensionality\n    int dims() const;\n    //! returns the number of non-zero elements (=the number of hash table nodes)\n    size_t nzcount() const;\n\n    //! computes the element hash value (1D case)\n    size_t hash(int i0) const;\n    //! computes the element hash value (2D case)\n    size_t hash(int i0, int i1) const;\n    //! computes the element hash value (3D case)\n    size_t hash(int i0, int i1, int i2) const;\n    //! computes the element hash value (nD case)\n    size_t hash(const int* idx) const;\n\n    //!@{\n    /*!\n     specialized variants for 1D, 2D, 3D cases and the generic_type one for n-D case.\n     return pointer to the matrix element.\n      - if the element is there (it's non-zero), the pointer to it is returned\n      - if it's not there and createMissing=false, NULL pointer is returned\n      - if it's not there and createMissing=true, then the new element\n        is created and initialized with 0. Pointer to it is returned\n      - if the optional hashval pointer is not NULL, the element hash value is\n        not computed, but *hashval is taken instead.\n    */\n    //! returns pointer to the specified element (1D case)\n    uchar* ptr(int i0, bool createMissing, size_t* hashval=0);\n    //! returns pointer to the specified element (2D case)\n    uchar* ptr(int i0, int i1, bool createMissing, size_t* hashval=0);\n    //! returns pointer to the specified element (3D case)\n    uchar* ptr(int i0, int i1, int i2, bool createMissing, size_t* hashval=0);\n    //! returns pointer to the specified element (nD case)\n    uchar* ptr(const int* idx, bool createMissing, size_t* hashval=0);\n    //!@}\n\n    //!@{\n    /*!\n     return read-write reference to the specified sparse matrix element.\n\n     `ref<_Tp>(i0,...[,hashval])` is equivalent to `*(_Tp*)ptr(i0,...,true[,hashval])`.\n     The methods always return a valid reference.\n     If the element did not exist, it is created and initialized with 0.\n    */\n    //! returns reference to the specified element (1D case)\n    template<typename _Tp> _Tp& ref(int i0, size_t* hashval=0);\n    //! returns reference to the specified element (2D case)\n    template<typename _Tp> _Tp& ref(int i0, int i1, size_t* hashval=0);\n    //! returns reference to the specified element (3D case)\n    template<typename _Tp> _Tp& ref(int i0, int i1, int i2, size_t* hashval=0);\n    //! returns reference to the specified element (nD case)\n    template<typename _Tp> _Tp& ref(const int* idx, size_t* hashval=0);\n    //!@}\n\n    //!@{\n    /*!\n     return value of the specified sparse matrix element.\n\n     `value<_Tp>(i0,...[,hashval])` is equivalent to\n     @code\n     { const _Tp* p = find<_Tp>(i0,...[,hashval]); return p ? *p : _Tp(); }\n     @endcode\n\n     That is, if the element did not exist, the methods return 0.\n     */\n    //! returns value of the specified element (1D case)\n    template<typename _Tp> _Tp value(int i0, size_t* hashval=0) const;\n    //! returns value of the specified element (2D case)\n    template<typename _Tp> _Tp value(int i0, int i1, size_t* hashval=0) const;\n    //! returns value of the specified element (3D case)\n    template<typename _Tp> _Tp value(int i0, int i1, int i2, size_t* hashval=0) const;\n    //! returns value of the specified element (nD case)\n    template<typename _Tp> _Tp value(const int* idx, size_t* hashval=0) const;\n    //!@}\n\n    //!@{\n    /*!\n     Return pointer to the specified sparse matrix element if it exists\n\n     `find<_Tp>(i0,...[,hashval])` is equivalent to `(_const Tp*)ptr(i0,...false[,hashval])`.\n\n     If the specified element does not exist, the methods return NULL.\n    */\n    //! returns pointer to the specified element (1D case)\n    template<typename _Tp> const _Tp* find(int i0, size_t* hashval=0) const;\n    //! returns pointer to the specified element (2D case)\n    template<typename _Tp> const _Tp* find(int i0, int i1, size_t* hashval=0) const;\n    //! returns pointer to the specified element (3D case)\n    template<typename _Tp> const _Tp* find(int i0, int i1, int i2, size_t* hashval=0) const;\n    //! returns pointer to the specified element (nD case)\n    template<typename _Tp> const _Tp* find(const int* idx, size_t* hashval=0) const;\n    //!@}\n\n    //! erases the specified element (2D case)\n    void erase(int i0, int i1, size_t* hashval=0);\n    //! erases the specified element (3D case)\n    void erase(int i0, int i1, int i2, size_t* hashval=0);\n    //! erases the specified element (nD case)\n    void erase(const int* idx, size_t* hashval=0);\n\n    //!@{\n    /*!\n       return the sparse matrix iterator pointing to the first sparse matrix element\n    */\n    //! returns the sparse matrix iterator at the matrix beginning\n    SparseMatIterator begin();\n    //! returns the sparse matrix iterator at the matrix beginning\n    template<typename _Tp> SparseMatIterator_<_Tp> begin();\n    //! returns the read-only sparse matrix iterator at the matrix beginning\n    SparseMatConstIterator begin() const;\n    //! returns the read-only sparse matrix iterator at the matrix beginning\n    template<typename _Tp> SparseMatConstIterator_<_Tp> begin() const;\n    //!@}\n    /*!\n       return the sparse matrix iterator pointing to the element following the last sparse matrix element\n    */\n    //! returns the sparse matrix iterator at the matrix end\n    SparseMatIterator end();\n    //! returns the read-only sparse matrix iterator at the matrix end\n    SparseMatConstIterator end() const;\n    //! returns the typed sparse matrix iterator at the matrix end\n    template<typename _Tp> SparseMatIterator_<_Tp> end();\n    //! returns the typed read-only sparse matrix iterator at the matrix end\n    template<typename _Tp> SparseMatConstIterator_<_Tp> end() const;\n\n    //! returns the value stored in the sparse martix node\n    template<typename _Tp> _Tp& value(Node* n);\n    //! returns the value stored in the sparse martix node\n    template<typename _Tp> const _Tp& value(const Node* n) const;\n\n    ////////////// some internal-use methods ///////////////\n    Node* node(size_t nidx);\n    const Node* node(size_t nidx) const;\n\n    uchar* newNode(const int* idx, size_t hashval);\n    void removeNode(size_t hidx, size_t nidx, size_t previdx);\n    void resizeHashTab(size_t newsize);\n\n    int flags;\n    Hdr* hdr;\n};\n\n\n\n///////////////////////////////// SparseMat_<_Tp> ////////////////////////////////////\n\n/** @brief Template sparse n-dimensional array class derived from SparseMat\n\nSparseMat_ is a thin wrapper on top of SparseMat created in the same way as Mat_ . It simplifies\nnotation of some operations:\n@code\n    int sz[] = {10, 20, 30};\n    SparseMat_<double> M(3, sz);\n    ...\n    M.ref(1, 2, 3) = M(4, 5, 6) + M(7, 8, 9);\n@endcode\n */\ntemplate<typename _Tp> class SparseMat_ : public SparseMat\n{\npublic:\n    typedef SparseMatIterator_<_Tp> iterator;\n    typedef SparseMatConstIterator_<_Tp> const_iterator;\n\n    //! the default constructor\n    SparseMat_();\n    //! the full constructor equivalent to SparseMat(dims, _sizes, DataType<_Tp>::type)\n    SparseMat_(int dims, const int* _sizes);\n    //! the copy constructor. If DataType<_Tp>.type != m.type(), the m elements are converted\n    SparseMat_(const SparseMat& m);\n    //! the copy constructor. This is O(1) operation - no data is copied\n    SparseMat_(const SparseMat_& m);\n    //! converts dense matrix to the sparse form\n    SparseMat_(const Mat& m);\n    //! converts the old-style sparse matrix to the C++ class. All the elements are copied\n    //SparseMat_(const CvSparseMat* m);\n    //! the assignment operator. If DataType<_Tp>.type != m.type(), the m elements are converted\n    SparseMat_& operator = (const SparseMat& m);\n    //! the assignment operator. This is O(1) operation - no data is copied\n    SparseMat_& operator = (const SparseMat_& m);\n    //! converts dense matrix to the sparse form\n    SparseMat_& operator = (const Mat& m);\n\n    //! makes full copy of the matrix. All the elements are duplicated\n    SparseMat_ clone() const CV_NODISCARD;\n    //! equivalent to cv::SparseMat::create(dims, _sizes, DataType<_Tp>::type)\n    void create(int dims, const int* _sizes);\n    //! converts sparse matrix to the old-style CvSparseMat. All the elements are copied\n    //operator CvSparseMat*() const;\n\n    //! returns type of the matrix elements\n    int type() const;\n    //! returns depth of the matrix elements\n    int depth() const;\n    //! returns the number of channels in each matrix element\n    int channels() const;\n\n    //! equivalent to SparseMat::ref<_Tp>(i0, hashval)\n    _Tp& ref(int i0, size_t* hashval=0);\n    //! equivalent to SparseMat::ref<_Tp>(i0, i1, hashval)\n    _Tp& ref(int i0, int i1, size_t* hashval=0);\n    //! equivalent to SparseMat::ref<_Tp>(i0, i1, i2, hashval)\n    _Tp& ref(int i0, int i1, int i2, size_t* hashval=0);\n    //! equivalent to SparseMat::ref<_Tp>(idx, hashval)\n    _Tp& ref(const int* idx, size_t* hashval=0);\n\n    //! equivalent to SparseMat::value<_Tp>(i0, hashval)\n    _Tp operator()(int i0, size_t* hashval=0) const;\n    //! equivalent to SparseMat::value<_Tp>(i0, i1, hashval)\n    _Tp operator()(int i0, int i1, size_t* hashval=0) const;\n    //! equivalent to SparseMat::value<_Tp>(i0, i1, i2, hashval)\n    _Tp operator()(int i0, int i1, int i2, size_t* hashval=0) const;\n    //! equivalent to SparseMat::value<_Tp>(idx, hashval)\n    _Tp operator()(const int* idx, size_t* hashval=0) const;\n\n    //! returns sparse matrix iterator pointing to the first sparse matrix element\n    SparseMatIterator_<_Tp> begin();\n    //! returns read-only sparse matrix iterator pointing to the first sparse matrix element\n    SparseMatConstIterator_<_Tp> begin() const;\n    //! returns sparse matrix iterator pointing to the element following the last sparse matrix element\n    SparseMatIterator_<_Tp> end();\n    //! returns read-only sparse matrix iterator pointing to the element following the last sparse matrix element\n    SparseMatConstIterator_<_Tp> end() const;\n};\n\n\n\n////////////////////////////////// MatConstIterator //////////////////////////////////\n\nclass CV_EXPORTS MatConstIterator\n{\npublic:\n    typedef uchar* value_type;\n    typedef ptrdiff_t difference_type;\n    typedef const uchar** pointer;\n    typedef uchar* reference;\n\n    typedef std::random_access_iterator_tag iterator_category;\n\n    //! default constructor\n    MatConstIterator();\n    //! constructor that sets the iterator to the beginning of the matrix\n    MatConstIterator(const Mat* _m);\n    //! constructor that sets the iterator to the specified element of the matrix\n    MatConstIterator(const Mat* _m, int _row, int _col=0);\n    //! constructor that sets the iterator to the specified element of the matrix\n    MatConstIterator(const Mat* _m, Point _pt);\n    //! constructor that sets the iterator to the specified element of the matrix\n    MatConstIterator(const Mat* _m, const int* _idx);\n    //! copy constructor\n    MatConstIterator(const MatConstIterator& it);\n\n    //! copy operator\n    MatConstIterator& operator = (const MatConstIterator& it);\n    //! returns the current matrix element\n    const uchar* operator *() const;\n    //! returns the i-th matrix element, relative to the current\n    const uchar* operator [](ptrdiff_t i) const;\n\n    //! shifts the iterator forward by the specified number of elements\n    MatConstIterator& operator += (ptrdiff_t ofs);\n    //! shifts the iterator backward by the specified number of elements\n    MatConstIterator& operator -= (ptrdiff_t ofs);\n    //! decrements the iterator\n    MatConstIterator& operator --();\n    //! decrements the iterator\n    MatConstIterator operator --(int);\n    //! increments the iterator\n    MatConstIterator& operator ++();\n    //! increments the iterator\n    MatConstIterator operator ++(int);\n    //! returns the current iterator position\n    Point pos() const;\n    //! returns the current iterator position\n    void pos(int* _idx) const;\n\n    ptrdiff_t lpos() const;\n    void seek(ptrdiff_t ofs, bool relative = false);\n    void seek(const int* _idx, bool relative = false);\n\n    const Mat* m;\n    size_t elemSize;\n    const uchar* ptr;\n    const uchar* sliceStart;\n    const uchar* sliceEnd;\n};\n\n\n\n////////////////////////////////// MatConstIterator_ /////////////////////////////////\n\n/** @brief Matrix read-only iterator\n */\ntemplate<typename _Tp>\nclass MatConstIterator_ : public MatConstIterator\n{\npublic:\n    typedef _Tp value_type;\n    typedef ptrdiff_t difference_type;\n    typedef const _Tp* pointer;\n    typedef const _Tp& reference;\n\n    typedef std::random_access_iterator_tag iterator_category;\n\n    //! default constructor\n    MatConstIterator_();\n    //! constructor that sets the iterator to the beginning of the matrix\n    MatConstIterator_(const Mat_<_Tp>* _m);\n    //! constructor that sets the iterator to the specified element of the matrix\n    MatConstIterator_(const Mat_<_Tp>* _m, int _row, int _col=0);\n    //! constructor that sets the iterator to the specified element of the matrix\n    MatConstIterator_(const Mat_<_Tp>* _m, Point _pt);\n    //! constructor that sets the iterator to the specified element of the matrix\n    MatConstIterator_(const Mat_<_Tp>* _m, const int* _idx);\n    //! copy constructor\n    MatConstIterator_(const MatConstIterator_& it);\n\n    //! copy operator\n    MatConstIterator_& operator = (const MatConstIterator_& it);\n    //! returns the current matrix element\n    const _Tp& operator *() const;\n    //! returns the i-th matrix element, relative to the current\n    const _Tp& operator [](ptrdiff_t i) const;\n\n    //! shifts the iterator forward by the specified number of elements\n    MatConstIterator_& operator += (ptrdiff_t ofs);\n    //! shifts the iterator backward by the specified number of elements\n    MatConstIterator_& operator -= (ptrdiff_t ofs);\n    //! decrements the iterator\n    MatConstIterator_& operator --();\n    //! decrements the iterator\n    MatConstIterator_ operator --(int);\n    //! increments the iterator\n    MatConstIterator_& operator ++();\n    //! increments the iterator\n    MatConstIterator_ operator ++(int);\n    //! returns the current iterator position\n    Point pos() const;\n};\n\n\n\n//////////////////////////////////// MatIterator_ ////////////////////////////////////\n\n/** @brief Matrix read-write iterator\n*/\ntemplate<typename _Tp>\nclass MatIterator_ : public MatConstIterator_<_Tp>\n{\npublic:\n    typedef _Tp* pointer;\n    typedef _Tp& reference;\n\n    typedef std::random_access_iterator_tag iterator_category;\n\n    //! the default constructor\n    MatIterator_();\n    //! constructor that sets the iterator to the beginning of the matrix\n    MatIterator_(Mat_<_Tp>* _m);\n    //! constructor that sets the iterator to the specified element of the matrix\n    MatIterator_(Mat_<_Tp>* _m, int _row, int _col=0);\n    //! constructor that sets the iterator to the specified element of the matrix\n    MatIterator_(Mat_<_Tp>* _m, Point _pt);\n    //! constructor that sets the iterator to the specified element of the matrix\n    MatIterator_(Mat_<_Tp>* _m, const int* _idx);\n    //! copy constructor\n    MatIterator_(const MatIterator_& it);\n    //! copy operator\n    MatIterator_& operator = (const MatIterator_<_Tp>& it );\n\n    //! returns the current matrix element\n    _Tp& operator *() const;\n    //! returns the i-th matrix element, relative to the current\n    _Tp& operator [](ptrdiff_t i) const;\n\n    //! shifts the iterator forward by the specified number of elements\n    MatIterator_& operator += (ptrdiff_t ofs);\n    //! shifts the iterator backward by the specified number of elements\n    MatIterator_& operator -= (ptrdiff_t ofs);\n    //! decrements the iterator\n    MatIterator_& operator --();\n    //! decrements the iterator\n    MatIterator_ operator --(int);\n    //! increments the iterator\n    MatIterator_& operator ++();\n    //! increments the iterator\n    MatIterator_ operator ++(int);\n};\n\n\n\n/////////////////////////////// SparseMatConstIterator ///////////////////////////////\n\n/**  @brief Read-Only Sparse Matrix Iterator.\n\n Here is how to use the iterator to compute the sum of floating-point sparse matrix elements:\n\n \\code\n SparseMatConstIterator it = m.begin(), it_end = m.end();\n double s = 0;\n CV_Assert( m.type() == CV_32F );\n for( ; it != it_end; ++it )\n    s += it.value<float>();\n \\endcode\n*/\nclass CV_EXPORTS SparseMatConstIterator\n{\npublic:\n    //! the default constructor\n    SparseMatConstIterator();\n    //! the full constructor setting the iterator to the first sparse matrix element\n    SparseMatConstIterator(const SparseMat* _m);\n    //! the copy constructor\n    SparseMatConstIterator(const SparseMatConstIterator& it);\n\n    //! the assignment operator\n    SparseMatConstIterator& operator = (const SparseMatConstIterator& it);\n\n    //! template method returning the current matrix element\n    template<typename _Tp> const _Tp& value() const;\n    //! returns the current node of the sparse matrix. it.node->idx is the current element index\n    const SparseMat::Node* node() const;\n\n    //! moves iterator to the previous element\n    SparseMatConstIterator& operator --();\n    //! moves iterator to the previous element\n    SparseMatConstIterator operator --(int);\n    //! moves iterator to the next element\n    SparseMatConstIterator& operator ++();\n    //! moves iterator to the next element\n    SparseMatConstIterator operator ++(int);\n\n    //! moves iterator to the element after the last element\n    void seekEnd();\n\n    const SparseMat* m;\n    size_t hashidx;\n    uchar* ptr;\n};\n\n\n\n////////////////////////////////// SparseMatIterator /////////////////////////////////\n\n/** @brief  Read-write Sparse Matrix Iterator\n\n The class is similar to cv::SparseMatConstIterator,\n but can be used for in-place modification of the matrix elements.\n*/\nclass CV_EXPORTS SparseMatIterator : public SparseMatConstIterator\n{\npublic:\n    //! the default constructor\n    SparseMatIterator();\n    //! the full constructor setting the iterator to the first sparse matrix element\n    SparseMatIterator(SparseMat* _m);\n    //! the full constructor setting the iterator to the specified sparse matrix element\n    SparseMatIterator(SparseMat* _m, const int* idx);\n    //! the copy constructor\n    SparseMatIterator(const SparseMatIterator& it);\n\n    //! the assignment operator\n    SparseMatIterator& operator = (const SparseMatIterator& it);\n    //! returns read-write reference to the current sparse matrix element\n    template<typename _Tp> _Tp& value() const;\n    //! returns pointer to the current sparse matrix node. it.node->idx is the index of the current element (do not modify it!)\n    SparseMat::Node* node() const;\n\n    //! moves iterator to the next element\n    SparseMatIterator& operator ++();\n    //! moves iterator to the next element\n    SparseMatIterator operator ++(int);\n};\n\n\n\n/////////////////////////////// SparseMatConstIterator_ //////////////////////////////\n\n/** @brief  Template Read-Only Sparse Matrix Iterator Class.\n\n This is the derived from SparseMatConstIterator class that\n introduces more convenient operator *() for accessing the current element.\n*/\ntemplate<typename _Tp> class SparseMatConstIterator_ : public SparseMatConstIterator\n{\npublic:\n\n    typedef std::forward_iterator_tag iterator_category;\n\n    //! the default constructor\n    SparseMatConstIterator_();\n    //! the full constructor setting the iterator to the first sparse matrix element\n    SparseMatConstIterator_(const SparseMat_<_Tp>* _m);\n    SparseMatConstIterator_(const SparseMat* _m);\n    //! the copy constructor\n    SparseMatConstIterator_(const SparseMatConstIterator_& it);\n\n    //! the assignment operator\n    SparseMatConstIterator_& operator = (const SparseMatConstIterator_& it);\n    //! the element access operator\n    const _Tp& operator *() const;\n\n    //! moves iterator to the next element\n    SparseMatConstIterator_& operator ++();\n    //! moves iterator to the next element\n    SparseMatConstIterator_ operator ++(int);\n};\n\n\n\n///////////////////////////////// SparseMatIterator_ /////////////////////////////////\n\n/** @brief  Template Read-Write Sparse Matrix Iterator Class.\n\n This is the derived from cv::SparseMatConstIterator_ class that\n introduces more convenient operator *() for accessing the current element.\n*/\ntemplate<typename _Tp> class SparseMatIterator_ : public SparseMatConstIterator_<_Tp>\n{\npublic:\n\n    typedef std::forward_iterator_tag iterator_category;\n\n    //! the default constructor\n    SparseMatIterator_();\n    //! the full constructor setting the iterator to the first sparse matrix element\n    SparseMatIterator_(SparseMat_<_Tp>* _m);\n    SparseMatIterator_(SparseMat* _m);\n    //! the copy constructor\n    SparseMatIterator_(const SparseMatIterator_& it);\n\n    //! the assignment operator\n    SparseMatIterator_& operator = (const SparseMatIterator_& it);\n    //! returns the reference to the current element\n    _Tp& operator *() const;\n\n    //! moves the iterator to the next element\n    SparseMatIterator_& operator ++();\n    //! moves the iterator to the next element\n    SparseMatIterator_ operator ++(int);\n};\n\n\n\n/////////////////////////////////// NAryMatIterator //////////////////////////////////\n\n/** @brief n-ary multi-dimensional array iterator.\n\nUse the class to implement unary, binary, and, generally, n-ary element-wise operations on\nmulti-dimensional arrays. Some of the arguments of an n-ary function may be continuous arrays, some\nmay be not. It is possible to use conventional MatIterator 's for each array but incrementing all of\nthe iterators after each small operations may be a big overhead. In this case consider using\nNAryMatIterator to iterate through several matrices simultaneously as long as they have the same\ngeometry (dimensionality and all the dimension sizes are the same). On each iteration `it.planes[0]`,\n`it.planes[1]`,... will be the slices of the corresponding matrices.\n\nThe example below illustrates how you can compute a normalized and threshold 3D color histogram:\n@code\n    void computeNormalizedColorHist(const Mat& image, Mat& hist, int N, double minProb)\n    {\n        const int histSize[] = {N, N, N};\n\n        // make sure that the histogram has a proper size and type\n        hist.create(3, histSize, CV_32F);\n\n        // and clear it\n        hist = Scalar(0);\n\n        // the loop below assumes that the image\n        // is a 8-bit 3-channel. check it.\n        CV_Assert(image.type() == CV_8UC3);\n        MatConstIterator_<Vec3b> it = image.begin<Vec3b>(),\n                                 it_end = image.end<Vec3b>();\n        for( ; it != it_end; ++it )\n        {\n            const Vec3b& pix = *it;\n            hist.at<float>(pix[0]*N/256, pix[1]*N/256, pix[2]*N/256) += 1.f;\n        }\n\n        minProb *= image.rows*image.cols;\n\n        // initialize iterator (the style is different from STL).\n        // after initialization the iterator will contain\n        // the number of slices or planes the iterator will go through.\n        // it simultaneously increments iterators for several matrices\n        // supplied as a null terminated list of pointers\n        const Mat* arrays[] = {&hist, 0};\n        Mat planes[1];\n        NAryMatIterator itNAry(arrays, planes, 1);\n        double s = 0;\n        // iterate through the matrix. on each iteration\n        // itNAry.planes[i] (of type Mat) will be set to the current plane\n        // of the i-th n-dim matrix passed to the iterator constructor.\n        for(int p = 0; p < itNAry.nplanes; p++, ++itNAry)\n        {\n            threshold(itNAry.planes[0], itNAry.planes[0], minProb, 0, THRESH_TOZERO);\n            s += sum(itNAry.planes[0])[0];\n        }\n\n        s = 1./s;\n        itNAry = NAryMatIterator(arrays, planes, 1);\n        for(int p = 0; p < itNAry.nplanes; p++, ++itNAry)\n            itNAry.planes[0] *= s;\n    }\n@endcode\n */\nclass CV_EXPORTS NAryMatIterator\n{\npublic:\n    //! the default constructor\n    NAryMatIterator();\n    //! the full constructor taking arbitrary number of n-dim matrices\n    NAryMatIterator(const Mat** arrays, uchar** ptrs, int narrays=-1);\n    //! the full constructor taking arbitrary number of n-dim matrices\n    NAryMatIterator(const Mat** arrays, Mat* planes, int narrays=-1);\n    //! the separate iterator initialization method\n    void init(const Mat** arrays, Mat* planes, uchar** ptrs, int narrays=-1);\n\n    //! proceeds to the next plane of every iterated matrix\n    NAryMatIterator& operator ++();\n    //! proceeds to the next plane of every iterated matrix (postfix increment operator)\n    NAryMatIterator operator ++(int);\n\n    //! the iterated arrays\n    const Mat** arrays;\n    //! the current planes\n    Mat* planes;\n    //! data pointers\n    uchar** ptrs;\n    //! the number of arrays\n    int narrays;\n    //! the number of hyper-planes that the iterator steps through\n    size_t nplanes;\n    //! the size of each segment (in elements)\n    size_t size;\nprotected:\n    int iterdepth;\n    size_t idx;\n};\n\n\n\n///////////////////////////////// Matrix Expressions /////////////////////////////////\n\nclass CV_EXPORTS MatOp\n{\npublic:\n    MatOp();\n    virtual ~MatOp();\n\n    virtual bool elementWise(const MatExpr& expr) const;\n    virtual void assign(const MatExpr& expr, Mat& m, int type=-1) const = 0;\n    virtual void roi(const MatExpr& expr, const Range& rowRange,\n                     const Range& colRange, MatExpr& res) const;\n    virtual void diag(const MatExpr& expr, int d, MatExpr& res) const;\n    virtual void augAssignAdd(const MatExpr& expr, Mat& m) const;\n    virtual void augAssignSubtract(const MatExpr& expr, Mat& m) const;\n    virtual void augAssignMultiply(const MatExpr& expr, Mat& m) const;\n    virtual void augAssignDivide(const MatExpr& expr, Mat& m) const;\n    virtual void augAssignAnd(const MatExpr& expr, Mat& m) const;\n    virtual void augAssignOr(const MatExpr& expr, Mat& m) const;\n    virtual void augAssignXor(const MatExpr& expr, Mat& m) const;\n\n    virtual void add(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const;\n    virtual void add(const MatExpr& expr1, const Scalar& s, MatExpr& res) const;\n\n    virtual void subtract(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const;\n    virtual void subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const;\n\n    virtual void multiply(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res, double scale=1) const;\n    virtual void multiply(const MatExpr& expr1, double s, MatExpr& res) const;\n\n    virtual void divide(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res, double scale=1) const;\n    virtual void divide(double s, const MatExpr& expr, MatExpr& res) const;\n\n    virtual void abs(const MatExpr& expr, MatExpr& res) const;\n\n    virtual void transpose(const MatExpr& expr, MatExpr& res) const;\n    virtual void matmul(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const;\n    virtual void invert(const MatExpr& expr, int method, MatExpr& res) const;\n\n    virtual Size size(const MatExpr& expr) const;\n    virtual int type(const MatExpr& expr) const;\n};\n\n/** @brief Matrix expression representation\n@anchor MatrixExpressions\nThis is a list of implemented matrix operations that can be combined in arbitrary complex\nexpressions (here A, B stand for matrices ( Mat ), s for a scalar ( Scalar ), alpha for a\nreal-valued scalar ( double )):\n-   Addition, subtraction, negation: `A+B`, `A-B`, `A+s`, `A-s`, `s+A`, `s-A`, `-A`\n-   Scaling: `A*alpha`\n-   Per-element multiplication and division: `A.mul(B)`, `A/B`, `alpha/A`\n-   Matrix multiplication: `A*B`\n-   Transposition: `A.t()` (means A<sup>T</sup>)\n-   Matrix inversion and pseudo-inversion, solving linear systems and least-squares problems:\n    `A.inv([method]) (~ A<sup>-1</sup>)`,   `A.inv([method])*B (~ X: AX=B)`\n-   Comparison: `A cmpop B`, `A cmpop alpha`, `alpha cmpop A`, where *cmpop* is one of\n  `>`, `>=`, `==`, `!=`, `<=`, `<`. The result of comparison is an 8-bit single channel mask whose\n    elements are set to 255 (if the particular element or pair of elements satisfy the condition) or\n    0.\n-   Bitwise logical operations: `A logicop B`, `A logicop s`, `s logicop A`, `~A`, where *logicop* is one of\n  `&`, `|`, `^`.\n-   Element-wise minimum and maximum: `min(A, B)`, `min(A, alpha)`, `max(A, B)`, `max(A, alpha)`\n-   Element-wise absolute value: `abs(A)`\n-   Cross-product, dot-product: `A.cross(B)`, `A.dot(B)`\n-   Any function of matrix or matrices and scalars that returns a matrix or a scalar, such as norm,\n    mean, sum, countNonZero, trace, determinant, repeat, and others.\n-   Matrix initializers ( Mat::eye(), Mat::zeros(), Mat::ones() ), matrix comma-separated\n    initializers, matrix constructors and operators that extract sub-matrices (see Mat description).\n-   Mat_<destination_type>() constructors to cast the result to the proper type.\n@note Comma-separated initializers and probably some other operations may require additional\nexplicit Mat() or Mat_<T>() constructor calls to resolve a possible ambiguity.\n\nHere are examples of matrix expressions:\n@code\n    // compute pseudo-inverse of A, equivalent to A.inv(DECOMP_SVD)\n    SVD svd(A);\n    Mat pinvA = svd.vt.t()*Mat::diag(1./svd.w)*svd.u.t();\n\n    // compute the new vector of parameters in the Levenberg-Marquardt algorithm\n    x -= (A.t()*A + lambda*Mat::eye(A.cols,A.cols,A.type())).inv(DECOMP_CHOLESKY)*(A.t()*err);\n\n    // sharpen image using \"unsharp mask\" algorithm\n    Mat blurred; double sigma = 1, threshold = 5, amount = 1;\n    GaussianBlur(img, blurred, Size(), sigma, sigma);\n    Mat lowContrastMask = abs(img - blurred) < threshold;\n    Mat sharpened = img*(1+amount) + blurred*(-amount);\n    img.copyTo(sharpened, lowContrastMask);\n@endcode\n*/\nclass CV_EXPORTS MatExpr\n{\npublic:\n    MatExpr();\n    explicit MatExpr(const Mat& m);\n\n    MatExpr(const MatOp* _op, int _flags, const Mat& _a = Mat(), const Mat& _b = Mat(),\n            const Mat& _c = Mat(), double _alpha = 1, double _beta = 1, const Scalar& _s = Scalar());\n\n    operator Mat() const;\n    template<typename _Tp> operator Mat_<_Tp>() const;\n\n    Size size() const;\n    int type() const;\n\n    MatExpr row(int y) const;\n    MatExpr col(int x) const;\n    MatExpr diag(int d = 0) const;\n    MatExpr operator()( const Range& rowRange, const Range& colRange ) const;\n    MatExpr operator()( const Rect& roi ) const;\n\n    MatExpr t() const;\n    MatExpr inv(int method = DECOMP_LU) const;\n    MatExpr mul(const MatExpr& e, double scale=1) const;\n    MatExpr mul(const Mat& m, double scale=1) const;\n\n    Mat cross(const Mat& m) const;\n    double dot(const Mat& m) const;\n\n    void swap(MatExpr& b);\n\n    const MatOp* op;\n    int flags;\n\n    Mat a, b, c;\n    double alpha, beta;\n    Scalar s;\n};\n\n//! @} core_basic\n\n//! @relates cv::MatExpr\n//! @{\nCV_EXPORTS MatExpr operator + (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator + (const Mat& a, const Scalar& s);\nCV_EXPORTS MatExpr operator + (const Scalar& s, const Mat& a);\nCV_EXPORTS MatExpr operator + (const MatExpr& e, const Mat& m);\nCV_EXPORTS MatExpr operator + (const Mat& m, const MatExpr& e);\nCV_EXPORTS MatExpr operator + (const MatExpr& e, const Scalar& s);\nCV_EXPORTS MatExpr operator + (const Scalar& s, const MatExpr& e);\nCV_EXPORTS MatExpr operator + (const MatExpr& e1, const MatExpr& e2);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator + (const Mat& a, const Matx<_Tp, m, n>& b) { return a + Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator + (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) + b; }\n\nCV_EXPORTS MatExpr operator - (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator - (const Mat& a, const Scalar& s);\nCV_EXPORTS MatExpr operator - (const Scalar& s, const Mat& a);\nCV_EXPORTS MatExpr operator - (const MatExpr& e, const Mat& m);\nCV_EXPORTS MatExpr operator - (const Mat& m, const MatExpr& e);\nCV_EXPORTS MatExpr operator - (const MatExpr& e, const Scalar& s);\nCV_EXPORTS MatExpr operator - (const Scalar& s, const MatExpr& e);\nCV_EXPORTS MatExpr operator - (const MatExpr& e1, const MatExpr& e2);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator - (const Mat& a, const Matx<_Tp, m, n>& b) { return a - Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator - (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) - b; }\n\nCV_EXPORTS MatExpr operator - (const Mat& m);\nCV_EXPORTS MatExpr operator - (const MatExpr& e);\n\nCV_EXPORTS MatExpr operator * (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator * (const Mat& a, double s);\nCV_EXPORTS MatExpr operator * (double s, const Mat& a);\nCV_EXPORTS MatExpr operator * (const MatExpr& e, const Mat& m);\nCV_EXPORTS MatExpr operator * (const Mat& m, const MatExpr& e);\nCV_EXPORTS MatExpr operator * (const MatExpr& e, double s);\nCV_EXPORTS MatExpr operator * (double s, const MatExpr& e);\nCV_EXPORTS MatExpr operator * (const MatExpr& e1, const MatExpr& e2);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator * (const Mat& a, const Matx<_Tp, m, n>& b) { return a * Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator * (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) * b; }\n\nCV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator / (const Mat& a, double s);\nCV_EXPORTS MatExpr operator / (double s, const Mat& a);\nCV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m);\nCV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e);\nCV_EXPORTS MatExpr operator / (const MatExpr& e, double s);\nCV_EXPORTS MatExpr operator / (double s, const MatExpr& e);\nCV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator / (const Mat& a, const Matx<_Tp, m, n>& b) { return a / Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator / (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) / b; }\n\nCV_EXPORTS MatExpr operator < (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator < (const Mat& a, double s);\nCV_EXPORTS MatExpr operator < (double s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator < (const Mat& a, const Matx<_Tp, m, n>& b) { return a < Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator < (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) < b; }\n\nCV_EXPORTS MatExpr operator <= (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator <= (const Mat& a, double s);\nCV_EXPORTS MatExpr operator <= (double s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator <= (const Mat& a, const Matx<_Tp, m, n>& b) { return a <= Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator <= (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) <= b; }\n\nCV_EXPORTS MatExpr operator == (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator == (const Mat& a, double s);\nCV_EXPORTS MatExpr operator == (double s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator == (const Mat& a, const Matx<_Tp, m, n>& b) { return a == Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator == (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) == b; }\n\nCV_EXPORTS MatExpr operator != (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator != (const Mat& a, double s);\nCV_EXPORTS MatExpr operator != (double s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator != (const Mat& a, const Matx<_Tp, m, n>& b) { return a != Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator != (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) != b; }\n\nCV_EXPORTS MatExpr operator >= (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator >= (const Mat& a, double s);\nCV_EXPORTS MatExpr operator >= (double s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator >= (const Mat& a, const Matx<_Tp, m, n>& b) { return a >= Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator >= (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) >= b; }\n\nCV_EXPORTS MatExpr operator > (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator > (const Mat& a, double s);\nCV_EXPORTS MatExpr operator > (double s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator > (const Mat& a, const Matx<_Tp, m, n>& b) { return a > Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator > (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) > b; }\n\nCV_EXPORTS MatExpr operator & (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator & (const Mat& a, const Scalar& s);\nCV_EXPORTS MatExpr operator & (const Scalar& s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator & (const Mat& a, const Matx<_Tp, m, n>& b) { return a & Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator & (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) & b; }\n\nCV_EXPORTS MatExpr operator | (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator | (const Mat& a, const Scalar& s);\nCV_EXPORTS MatExpr operator | (const Scalar& s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator | (const Mat& a, const Matx<_Tp, m, n>& b) { return a | Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator | (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) | b; }\n\nCV_EXPORTS MatExpr operator ^ (const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr operator ^ (const Mat& a, const Scalar& s);\nCV_EXPORTS MatExpr operator ^ (const Scalar& s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator ^ (const Mat& a, const Matx<_Tp, m, n>& b) { return a ^ Mat(b); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr operator ^ (const Matx<_Tp, m, n>& a, const Mat& b) { return Mat(a) ^ b; }\n\nCV_EXPORTS MatExpr operator ~(const Mat& m);\n\nCV_EXPORTS MatExpr min(const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr min(const Mat& a, double s);\nCV_EXPORTS MatExpr min(double s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr min (const Mat& a, const Matx<_Tp, m, n>& b) { return min(a, Mat(b)); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr min (const Matx<_Tp, m, n>& a, const Mat& b) { return min(Mat(a), b); }\n\nCV_EXPORTS MatExpr max(const Mat& a, const Mat& b);\nCV_EXPORTS MatExpr max(const Mat& a, double s);\nCV_EXPORTS MatExpr max(double s, const Mat& a);\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr max (const Mat& a, const Matx<_Tp, m, n>& b) { return max(a, Mat(b)); }\ntemplate<typename _Tp, int m, int n> static inline\nMatExpr max (const Matx<_Tp, m, n>& a, const Mat& b) { return max(Mat(a), b); }\n\n/** @brief Calculates an absolute value of each matrix element.\n\nabs is a meta-function that is expanded to one of absdiff or convertScaleAbs forms:\n- C = abs(A-B) is equivalent to `absdiff(A, B, C)`\n- C = abs(A) is equivalent to `absdiff(A, Scalar::all(0), C)`\n- C = `Mat_<Vec<uchar,n> >(abs(A*alpha + beta))` is equivalent to `convertScaleAbs(A, C, alpha,\nbeta)`\n\nThe output matrix has the same size and the same type as the input one except for the last case,\nwhere C is depth=CV_8U .\n@param m matrix.\n@sa @ref MatrixExpressions, absdiff, convertScaleAbs\n */\nCV_EXPORTS MatExpr abs(const Mat& m);\n/** @overload\n@param e matrix expression.\n*/\nCV_EXPORTS MatExpr abs(const MatExpr& e);\n//! @} relates cv::MatExpr\n\n} // cv\n\n#include \"opencv2/core/mat.inl.hpp\"\n\n#endif // OPENCV_CORE_MAT_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/mat.inl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_MATRIX_OPERATIONS_HPP\n#define OPENCV_CORE_MATRIX_OPERATIONS_HPP\n\n#ifndef __cplusplus\n#  error mat.inl.hpp header must be compiled as C++\n#endif\n\n#ifdef _MSC_VER\n#pragma warning( push )\n#pragma warning( disable: 4127 )\n#endif\n\n#if defined(CV_SKIP_DISABLE_CLANG_ENUM_WARNINGS)\n  // nothing\n#elif defined(CV_FORCE_DISABLE_CLANG_ENUM_WARNINGS)\n  #define CV_DISABLE_CLANG_ENUM_WARNINGS\n#elif defined(__clang__) && defined(__has_warning)\n  #if __has_warning(\"-Wdeprecated-enum-enum-conversion\") && __has_warning(\"-Wdeprecated-anon-enum-enum-conversion\")\n    #define CV_DISABLE_CLANG_ENUM_WARNINGS\n  #endif\n#endif\n#ifdef CV_DISABLE_CLANG_ENUM_WARNINGS\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated-enum-enum-conversion\"\n#pragma clang diagnostic ignored \"-Wdeprecated-anon-enum-enum-conversion\"\n#endif\n\nnamespace cv\n{\nCV__DEBUG_NS_BEGIN\n\n\n//! @cond IGNORED\n\n////////////////////////// Custom (raw) type wrapper //////////////////////////\n\ntemplate<typename _Tp> static inline\nint rawType()\n{\n    CV_StaticAssert(sizeof(_Tp) <= CV_CN_MAX, \"sizeof(_Tp) is too large\");\n    const int elemSize = sizeof(_Tp);\n    return (int)CV_MAKETYPE(CV_8U, elemSize);\n}\n\n//////////////////////// Input/Output Arrays ////////////////////////\n\ninline void _InputArray::init(int _flags, const void* _obj)\n{ flags = _flags; obj = (void*)_obj; }\n\ninline void _InputArray::init(int _flags, const void* _obj, Size _sz)\n{ flags = _flags; obj = (void*)_obj; sz = _sz; }\n\ninline void* _InputArray::getObj() const { return obj; }\ninline int _InputArray::getFlags() const { return flags; }\ninline Size _InputArray::getSz() const { return sz; }\n\ninline _InputArray::_InputArray() { init(0 + NONE, 0); }\ninline _InputArray::_InputArray(int _flags, void* _obj) { init(_flags, _obj); }\ninline _InputArray::_InputArray(const Mat& m) { init(MAT+ACCESS_READ, &m); }\ninline _InputArray::_InputArray(const std::vector<Mat>& vec) { init(STD_VECTOR_MAT+ACCESS_READ, &vec); }\ninline _InputArray::_InputArray(const UMat& m) { init(UMAT+ACCESS_READ, &m); }\ninline _InputArray::_InputArray(const std::vector<UMat>& vec) { init(STD_VECTOR_UMAT+ACCESS_READ, &vec); }\n\ntemplate<typename _Tp> inline\n_InputArray::_InputArray(const std::vector<_Tp>& vec)\n{ init(FIXED_TYPE + STD_VECTOR + traits::Type<_Tp>::value + ACCESS_READ, &vec); }\n\ntemplate<typename _Tp, std::size_t _Nm> inline\n_InputArray::_InputArray(const std::array<_Tp, _Nm>& arr)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_READ, arr.data(), Size(1, _Nm)); }\n\ntemplate<std::size_t _Nm> inline\n_InputArray::_InputArray(const std::array<Mat, _Nm>& arr)\n{ init(STD_ARRAY_MAT + ACCESS_READ, arr.data(), Size(1, _Nm)); }\n\ninline\n_InputArray::_InputArray(const std::vector<bool>& vec)\n{ init(FIXED_TYPE + STD_BOOL_VECTOR + traits::Type<bool>::value + ACCESS_READ, &vec); }\n\ntemplate<typename _Tp> inline\n_InputArray::_InputArray(const std::vector<std::vector<_Tp> >& vec)\n{ init(FIXED_TYPE + STD_VECTOR_VECTOR + traits::Type<_Tp>::value + ACCESS_READ, &vec); }\n\ntemplate<typename _Tp> inline\n_InputArray::_InputArray(const std::vector<Mat_<_Tp> >& vec)\n{ init(FIXED_TYPE + STD_VECTOR_MAT + traits::Type<_Tp>::value + ACCESS_READ, &vec); }\n\ntemplate<typename _Tp, int m, int n> inline\n_InputArray::_InputArray(const Matx<_Tp, m, n>& mtx)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_READ, &mtx, Size(n, m)); }\n\ntemplate<typename _Tp> inline\n_InputArray::_InputArray(const _Tp* vec, int n)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_READ, vec, Size(n, 1)); }\n\ntemplate<typename _Tp> inline\n_InputArray::_InputArray(const Mat_<_Tp>& m)\n{ init(FIXED_TYPE + MAT + traits::Type<_Tp>::value + ACCESS_READ, &m); }\n\ninline _InputArray::_InputArray(const double& val)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + CV_64F + ACCESS_READ, &val, Size(1,1)); }\n\ninline _InputArray::_InputArray(const cuda::GpuMat& d_mat)\n{ init(CUDA_GPU_MAT + ACCESS_READ, &d_mat); }\n\ninline _InputArray::_InputArray(const std::vector<cuda::GpuMat>& d_mat)\n{\tinit(STD_VECTOR_CUDA_GPU_MAT + ACCESS_READ, &d_mat);}\n\ninline _InputArray::_InputArray(const ogl::Buffer& buf)\n{ init(OPENGL_BUFFER + ACCESS_READ, &buf); }\n\ninline _InputArray::_InputArray(const cuda::HostMem& cuda_mem)\n{ init(CUDA_HOST_MEM + ACCESS_READ, &cuda_mem); }\n\ntemplate<typename _Tp> inline\n_InputArray _InputArray::rawIn(const std::vector<_Tp>& vec)\n{\n    _InputArray v;\n    v.flags = _InputArray::FIXED_TYPE + _InputArray::STD_VECTOR + rawType<_Tp>() + ACCESS_READ;\n    v.obj = (void*)&vec;\n    return v;\n}\n\ntemplate<typename _Tp, std::size_t _Nm> inline\n_InputArray _InputArray::rawIn(const std::array<_Tp, _Nm>& arr)\n{\n    _InputArray v;\n    v.flags = FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_READ;\n    v.obj = (void*)arr.data();\n    v.sz = Size(1, _Nm);\n    return v;\n}\n\ninline _InputArray::~_InputArray() {}\n\ninline Mat _InputArray::getMat(int i) const\n{\n    if( kind() == MAT && i < 0 )\n        return *(const Mat*)obj;\n    return getMat_(i);\n}\n\ninline bool _InputArray::isMat() const { return kind() == _InputArray::MAT; }\ninline bool _InputArray::isUMat() const  { return kind() == _InputArray::UMAT; }\ninline bool _InputArray::isMatVector() const { return kind() == _InputArray::STD_VECTOR_MAT; }\ninline bool _InputArray::isUMatVector() const  { return kind() == _InputArray::STD_VECTOR_UMAT; }\ninline bool _InputArray::isMatx() const { return kind() == _InputArray::MATX; }\ninline bool _InputArray::isVector() const { return kind() == _InputArray::STD_VECTOR ||\n                                                   kind() == _InputArray::STD_BOOL_VECTOR ||\n                                                   (kind() == _InputArray::MATX && (sz.width <= 1 || sz.height <= 1)); }\ninline bool _InputArray::isGpuMat() const { return kind() == _InputArray::CUDA_GPU_MAT; }\ninline bool _InputArray::isGpuMatVector() const { return kind() == _InputArray::STD_VECTOR_CUDA_GPU_MAT; }\n\n////////////////////////////////////////////////////////////////////////////////////////\n\ninline _OutputArray::_OutputArray() { init(NONE + ACCESS_WRITE, 0); }\ninline _OutputArray::_OutputArray(int _flags, void* _obj) { init(_flags + ACCESS_WRITE, _obj); }\ninline _OutputArray::_OutputArray(Mat& m) { init(MAT+ACCESS_WRITE, &m); }\ninline _OutputArray::_OutputArray(std::vector<Mat>& vec) { init(STD_VECTOR_MAT + ACCESS_WRITE, &vec); }\ninline _OutputArray::_OutputArray(UMat& m) { init(UMAT + ACCESS_WRITE, &m); }\ninline _OutputArray::_OutputArray(std::vector<UMat>& vec) { init(STD_VECTOR_UMAT + ACCESS_WRITE, &vec); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(std::vector<_Tp>& vec)\n{ init(FIXED_TYPE + STD_VECTOR + traits::Type<_Tp>::value + ACCESS_WRITE, &vec); }\n\ntemplate<typename _Tp, std::size_t _Nm> inline\n_OutputArray::_OutputArray(std::array<_Tp, _Nm>& arr)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }\n\ntemplate<std::size_t _Nm> inline\n_OutputArray::_OutputArray(std::array<Mat, _Nm>& arr)\n{ init(STD_ARRAY_MAT + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(std::vector<std::vector<_Tp> >& vec)\n{ init(FIXED_TYPE + STD_VECTOR_VECTOR + traits::Type<_Tp>::value + ACCESS_WRITE, &vec); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(std::vector<Mat_<_Tp> >& vec)\n{ init(FIXED_TYPE + STD_VECTOR_MAT + traits::Type<_Tp>::value + ACCESS_WRITE, &vec); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(Mat_<_Tp>& m)\n{ init(FIXED_TYPE + MAT + traits::Type<_Tp>::value + ACCESS_WRITE, &m); }\n\ntemplate<typename _Tp, int m, int n> inline\n_OutputArray::_OutputArray(Matx<_Tp, m, n>& mtx)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE, &mtx, Size(n, m)); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(_Tp* vec, int n)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE, vec, Size(n, 1)); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(const std::vector<_Tp>& vec)\n{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR + traits::Type<_Tp>::value + ACCESS_WRITE, &vec); }\n\ntemplate<typename _Tp, std::size_t _Nm> inline\n_OutputArray::_OutputArray(const std::array<_Tp, _Nm>& arr)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }\n\ntemplate<std::size_t _Nm> inline\n_OutputArray::_OutputArray(const std::array<Mat, _Nm>& arr)\n{ init(FIXED_SIZE + STD_ARRAY_MAT + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(const std::vector<std::vector<_Tp> >& vec)\n{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_VECTOR + traits::Type<_Tp>::value + ACCESS_WRITE, &vec); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(const std::vector<Mat_<_Tp> >& vec)\n{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_MAT + traits::Type<_Tp>::value + ACCESS_WRITE, &vec); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(const Mat_<_Tp>& m)\n{ init(FIXED_TYPE + FIXED_SIZE + MAT + traits::Type<_Tp>::value + ACCESS_WRITE, &m); }\n\ntemplate<typename _Tp, int m, int n> inline\n_OutputArray::_OutputArray(const Matx<_Tp, m, n>& mtx)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE, &mtx, Size(n, m)); }\n\ntemplate<typename _Tp> inline\n_OutputArray::_OutputArray(const _Tp* vec, int n)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE, vec, Size(n, 1)); }\n\ninline _OutputArray::_OutputArray(cuda::GpuMat& d_mat)\n{ init(CUDA_GPU_MAT + ACCESS_WRITE, &d_mat); }\n\ninline _OutputArray::_OutputArray(std::vector<cuda::GpuMat>& d_mat)\n{\tinit(STD_VECTOR_CUDA_GPU_MAT + ACCESS_WRITE, &d_mat);}\n\ninline _OutputArray::_OutputArray(ogl::Buffer& buf)\n{ init(OPENGL_BUFFER + ACCESS_WRITE, &buf); }\n\ninline _OutputArray::_OutputArray(cuda::HostMem& cuda_mem)\n{ init(CUDA_HOST_MEM + ACCESS_WRITE, &cuda_mem); }\n\ninline _OutputArray::_OutputArray(const Mat& m)\n{ init(FIXED_TYPE + FIXED_SIZE + MAT + ACCESS_WRITE, &m); }\n\ninline _OutputArray::_OutputArray(const std::vector<Mat>& vec)\n{ init(FIXED_SIZE + STD_VECTOR_MAT + ACCESS_WRITE, &vec); }\n\ninline _OutputArray::_OutputArray(const UMat& m)\n{ init(FIXED_TYPE + FIXED_SIZE + UMAT + ACCESS_WRITE, &m); }\n\ninline _OutputArray::_OutputArray(const std::vector<UMat>& vec)\n{ init(FIXED_SIZE + STD_VECTOR_UMAT + ACCESS_WRITE, &vec); }\n\ninline _OutputArray::_OutputArray(const cuda::GpuMat& d_mat)\n{ init(FIXED_TYPE + FIXED_SIZE + CUDA_GPU_MAT + ACCESS_WRITE, &d_mat); }\n\n\ninline _OutputArray::_OutputArray(const ogl::Buffer& buf)\n{ init(FIXED_TYPE + FIXED_SIZE + OPENGL_BUFFER + ACCESS_WRITE, &buf); }\n\ninline _OutputArray::_OutputArray(const cuda::HostMem& cuda_mem)\n{ init(FIXED_TYPE + FIXED_SIZE + CUDA_HOST_MEM + ACCESS_WRITE, &cuda_mem); }\n\ntemplate<typename _Tp> inline\n_OutputArray _OutputArray::rawOut(std::vector<_Tp>& vec)\n{\n    _OutputArray v;\n    v.flags = _InputArray::FIXED_TYPE + _InputArray::STD_VECTOR + rawType<_Tp>() + ACCESS_WRITE;\n    v.obj = (void*)&vec;\n    return v;\n}\n\ntemplate<typename _Tp, std::size_t _Nm> inline\n_OutputArray _OutputArray::rawOut(std::array<_Tp, _Nm>& arr)\n{\n    _OutputArray v;\n    v.flags = FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE;\n    v.obj = (void*)arr.data();\n    v.sz = Size(1, _Nm);\n    return v;\n}\n\n///////////////////////////////////////////////////////////////////////////////////////////\n\ninline _InputOutputArray::_InputOutputArray() { init(0+ACCESS_RW, 0); }\ninline _InputOutputArray::_InputOutputArray(int _flags, void* _obj) { init(_flags+ACCESS_RW, _obj); }\ninline _InputOutputArray::_InputOutputArray(Mat& m) { init(MAT+ACCESS_RW, &m); }\ninline _InputOutputArray::_InputOutputArray(std::vector<Mat>& vec) { init(STD_VECTOR_MAT+ACCESS_RW, &vec); }\ninline _InputOutputArray::_InputOutputArray(UMat& m) { init(UMAT+ACCESS_RW, &m); }\ninline _InputOutputArray::_InputOutputArray(std::vector<UMat>& vec) { init(STD_VECTOR_UMAT+ACCESS_RW, &vec); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(std::vector<_Tp>& vec)\n{ init(FIXED_TYPE + STD_VECTOR + traits::Type<_Tp>::value + ACCESS_RW, &vec); }\n\ntemplate<typename _Tp, std::size_t _Nm> inline\n_InputOutputArray::_InputOutputArray(std::array<_Tp, _Nm>& arr)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW, arr.data(), Size(1, _Nm)); }\n\ntemplate<std::size_t _Nm> inline\n_InputOutputArray::_InputOutputArray(std::array<Mat, _Nm>& arr)\n{ init(STD_ARRAY_MAT + ACCESS_RW, arr.data(), Size(1, _Nm)); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(std::vector<std::vector<_Tp> >& vec)\n{ init(FIXED_TYPE + STD_VECTOR_VECTOR + traits::Type<_Tp>::value + ACCESS_RW, &vec); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(std::vector<Mat_<_Tp> >& vec)\n{ init(FIXED_TYPE + STD_VECTOR_MAT + traits::Type<_Tp>::value + ACCESS_RW, &vec); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(Mat_<_Tp>& m)\n{ init(FIXED_TYPE + MAT + traits::Type<_Tp>::value + ACCESS_RW, &m); }\n\ntemplate<typename _Tp, int m, int n> inline\n_InputOutputArray::_InputOutputArray(Matx<_Tp, m, n>& mtx)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW, &mtx, Size(n, m)); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(_Tp* vec, int n)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW, vec, Size(n, 1)); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(const std::vector<_Tp>& vec)\n{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR + traits::Type<_Tp>::value + ACCESS_RW, &vec); }\n\ntemplate<typename _Tp, std::size_t _Nm> inline\n_InputOutputArray::_InputOutputArray(const std::array<_Tp, _Nm>& arr)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW, arr.data(), Size(1, _Nm)); }\n\ntemplate<std::size_t _Nm> inline\n_InputOutputArray::_InputOutputArray(const std::array<Mat, _Nm>& arr)\n{ init(FIXED_SIZE + STD_ARRAY_MAT + ACCESS_RW, arr.data(), Size(1, _Nm)); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(const std::vector<std::vector<_Tp> >& vec)\n{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_VECTOR + traits::Type<_Tp>::value + ACCESS_RW, &vec); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(const std::vector<Mat_<_Tp> >& vec)\n{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_MAT + traits::Type<_Tp>::value + ACCESS_RW, &vec); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(const Mat_<_Tp>& m)\n{ init(FIXED_TYPE + FIXED_SIZE + MAT + traits::Type<_Tp>::value + ACCESS_RW, &m); }\n\ntemplate<typename _Tp, int m, int n> inline\n_InputOutputArray::_InputOutputArray(const Matx<_Tp, m, n>& mtx)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW, &mtx, Size(n, m)); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray::_InputOutputArray(const _Tp* vec, int n)\n{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW, vec, Size(n, 1)); }\n\ninline _InputOutputArray::_InputOutputArray(cuda::GpuMat& d_mat)\n{ init(CUDA_GPU_MAT + ACCESS_RW, &d_mat); }\n\ninline _InputOutputArray::_InputOutputArray(ogl::Buffer& buf)\n{ init(OPENGL_BUFFER + ACCESS_RW, &buf); }\n\ninline _InputOutputArray::_InputOutputArray(cuda::HostMem& cuda_mem)\n{ init(CUDA_HOST_MEM + ACCESS_RW, &cuda_mem); }\n\ninline _InputOutputArray::_InputOutputArray(const Mat& m)\n{ init(FIXED_TYPE + FIXED_SIZE + MAT + ACCESS_RW, &m); }\n\ninline _InputOutputArray::_InputOutputArray(const std::vector<Mat>& vec)\n{ init(FIXED_SIZE + STD_VECTOR_MAT + ACCESS_RW, &vec); }\n\ninline _InputOutputArray::_InputOutputArray(const UMat& m)\n{ init(FIXED_TYPE + FIXED_SIZE + UMAT + ACCESS_RW, &m); }\n\ninline _InputOutputArray::_InputOutputArray(const std::vector<UMat>& vec)\n{ init(FIXED_SIZE + STD_VECTOR_UMAT + ACCESS_RW, &vec); }\n\ninline _InputOutputArray::_InputOutputArray(const cuda::GpuMat& d_mat)\n{ init(FIXED_TYPE + FIXED_SIZE + CUDA_GPU_MAT + ACCESS_RW, &d_mat); }\n\ninline _InputOutputArray::_InputOutputArray(const std::vector<cuda::GpuMat>& d_mat)\n{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_CUDA_GPU_MAT + ACCESS_RW, &d_mat);}\n\ntemplate<> inline _InputOutputArray::_InputOutputArray(std::vector<cuda::GpuMat>& d_mat)\n{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_CUDA_GPU_MAT + ACCESS_RW, &d_mat);}\n\ninline _InputOutputArray::_InputOutputArray(const ogl::Buffer& buf)\n{ init(FIXED_TYPE + FIXED_SIZE + OPENGL_BUFFER + ACCESS_RW, &buf); }\n\ninline _InputOutputArray::_InputOutputArray(const cuda::HostMem& cuda_mem)\n{ init(FIXED_TYPE + FIXED_SIZE + CUDA_HOST_MEM + ACCESS_RW, &cuda_mem); }\n\ntemplate<typename _Tp> inline\n_InputOutputArray _InputOutputArray::rawInOut(std::vector<_Tp>& vec)\n{\n    _InputOutputArray v;\n    v.flags = _InputArray::FIXED_TYPE + _InputArray::STD_VECTOR + rawType<_Tp>() + ACCESS_RW;\n    v.obj = (void*)&vec;\n    return v;\n}\n\ntemplate<typename _Tp, std::size_t _Nm> inline\n_InputOutputArray _InputOutputArray::rawInOut(std::array<_Tp, _Nm>& arr)\n{\n    _InputOutputArray v;\n    v.flags = FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW;\n    v.obj = (void*)arr.data();\n    v.sz = Size(1, _Nm);\n    return v;\n}\n\n\ntemplate<typename _Tp> static inline _InputArray rawIn(_Tp& v) { return _InputArray::rawIn(v); }\ntemplate<typename _Tp> static inline _OutputArray rawOut(_Tp& v) { return _OutputArray::rawOut(v); }\ntemplate<typename _Tp> static inline _InputOutputArray rawInOut(_Tp& v) { return _InputOutputArray::rawInOut(v); }\n\nCV__DEBUG_NS_END\n\n//////////////////////////////////////////// Mat //////////////////////////////////////////\n\ntemplate<typename _Tp> inline\nMat::Mat(const std::vector<_Tp>& vec, bool copyData)\n    : flags(MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(2), rows((int)vec.size()),\n      cols(1), data(0), datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)\n{\n    if(vec.empty())\n        return;\n    if( !copyData )\n    {\n        step[0] = step[1] = sizeof(_Tp);\n        datastart = data = (uchar*)&vec[0];\n        datalimit = dataend = datastart + rows * step[0];\n    }\n    else\n        Mat((int)vec.size(), 1, traits::Type<_Tp>::value, (uchar*)&vec[0]).copyTo(*this);\n}\n\ntemplate<typename _Tp, typename> inline\nMat::Mat(const std::initializer_list<_Tp> list)\n    : Mat()\n{\n    CV_Assert(list.size() != 0);\n    Mat((int)list.size(), 1, traits::Type<_Tp>::value, (uchar*)list.begin()).copyTo(*this);\n}\n\ntemplate<typename _Tp> inline\nMat::Mat(const std::initializer_list<int> sizes, const std::initializer_list<_Tp> list)\n    : Mat()\n{\n    size_t size_total = 1;\n    for(auto s : sizes)\n        size_total *= s;\n    CV_Assert(list.size() != 0);\n    CV_Assert(size_total == list.size());\n    Mat((int)sizes.size(), (int*)sizes.begin(), traits::Type<_Tp>::value, (uchar*)list.begin()).copyTo(*this);\n}\n\ntemplate<typename _Tp, std::size_t _Nm> inline\nMat::Mat(const std::array<_Tp, _Nm>& arr, bool copyData)\n    : flags(MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(2), rows((int)arr.size()),\n      cols(1), data(0), datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)\n{\n    if(arr.empty())\n        return;\n    if( !copyData )\n    {\n        step[0] = step[1] = sizeof(_Tp);\n        datastart = data = (uchar*)arr.data();\n        datalimit = dataend = datastart + rows * step[0];\n    }\n    else\n        Mat((int)arr.size(), 1, traits::Type<_Tp>::value, (uchar*)arr.data()).copyTo(*this);\n}\n\ntemplate<typename _Tp, int n> inline\nMat::Mat(const Vec<_Tp, n>& vec, bool copyData)\n    : flags(MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(2), rows(n), cols(1), data(0),\n      datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)\n{\n    if( !copyData )\n    {\n        step[0] = step[1] = sizeof(_Tp);\n        datastart = data = (uchar*)vec.val;\n        datalimit = dataend = datastart + rows * step[0];\n    }\n    else\n        Mat(n, 1, traits::Type<_Tp>::value, (void*)vec.val).copyTo(*this);\n}\n\n\ntemplate<typename _Tp, int m, int n> inline\nMat::Mat(const Matx<_Tp,m,n>& M, bool copyData)\n    : flags(MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(2), rows(m), cols(n), data(0),\n      datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)\n{\n    if( !copyData )\n    {\n        step[0] = cols * sizeof(_Tp);\n        step[1] = sizeof(_Tp);\n        datastart = data = (uchar*)M.val;\n        datalimit = dataend = datastart + rows * step[0];\n    }\n    else\n        Mat(m, n, traits::Type<_Tp>::value, (uchar*)M.val).copyTo(*this);\n}\n\ntemplate<typename _Tp> inline\nMat::Mat(const Point_<_Tp>& pt, bool copyData)\n    : flags(MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(2), rows(2), cols(1), data(0),\n      datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)\n{\n    if( !copyData )\n    {\n        step[0] = step[1] = sizeof(_Tp);\n        datastart = data = (uchar*)&pt.x;\n        datalimit = dataend = datastart + rows * step[0];\n    }\n    else\n    {\n        create(2, 1, traits::Type<_Tp>::value);\n        ((_Tp*)data)[0] = pt.x;\n        ((_Tp*)data)[1] = pt.y;\n    }\n}\n\ntemplate<typename _Tp> inline\nMat::Mat(const Point3_<_Tp>& pt, bool copyData)\n    : flags(MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(2), rows(3), cols(1), data(0),\n      datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows), step(0)\n{\n    if( !copyData )\n    {\n        step[0] = step[1] = sizeof(_Tp);\n        datastart = data = (uchar*)&pt.x;\n        datalimit = dataend = datastart + rows * step[0];\n    }\n    else\n    {\n        create(3, 1, traits::Type<_Tp>::value);\n        ((_Tp*)data)[0] = pt.x;\n        ((_Tp*)data)[1] = pt.y;\n        ((_Tp*)data)[2] = pt.z;\n    }\n}\n\ntemplate<typename _Tp> inline\nMat::Mat(const MatCommaInitializer_<_Tp>& commaInitializer)\n    : flags(MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(0), rows(0), cols(0), data(0),\n      datastart(0), dataend(0), allocator(0), u(0), size(&rows)\n{\n    *this = commaInitializer.operator Mat_<_Tp>();\n}\n\ninline\nMat Mat::row(int y) const\n{\n    return Mat(*this, Range(y, y + 1), Range::all());\n}\n\ninline\nMat Mat::col(int x) const\n{\n    return Mat(*this, Range::all(), Range(x, x + 1));\n}\n\ninline\nMat Mat::rowRange(int startrow, int endrow) const\n{\n    return Mat(*this, Range(startrow, endrow), Range::all());\n}\n\ninline\nMat Mat::rowRange(const Range& r) const\n{\n    return Mat(*this, r, Range::all());\n}\n\ninline\nMat Mat::colRange(int startcol, int endcol) const\n{\n    return Mat(*this, Range::all(), Range(startcol, endcol));\n}\n\ninline\nMat Mat::colRange(const Range& r) const\n{\n    return Mat(*this, Range::all(), r);\n}\n\ninline\nMat Mat::operator()( Range _rowRange, Range _colRange ) const\n{\n    return Mat(*this, _rowRange, _colRange);\n}\n\ninline\nMat Mat::operator()( const Rect& roi ) const\n{\n    return Mat(*this, roi);\n}\n\ninline\nMat Mat::operator()(const Range* ranges) const\n{\n    return Mat(*this, ranges);\n}\n\ninline\nMat Mat::operator()(const std::vector<Range>& ranges) const\n{\n    return Mat(*this, ranges);\n}\n\ninline\nbool Mat::isContinuous() const\n{\n    return (flags & CONTINUOUS_FLAG) != 0;\n}\n\ninline\nbool Mat::isSubmatrix() const\n{\n    return (flags & SUBMATRIX_FLAG) != 0;\n}\n\ninline\nsize_t Mat::elemSize() const\n{\n    size_t res = dims > 0 ? step.p[dims - 1] : 0;\n    CV_DbgAssert(res != 0);\n    return res;\n}\n\ninline\nsize_t Mat::elemSize1() const\n{\n    return CV_ELEM_SIZE1(flags);\n}\n\ninline\nint Mat::type() const\n{\n    return CV_MAT_TYPE(flags);\n}\n\ninline\nint Mat::depth() const\n{\n    return CV_MAT_DEPTH(flags);\n}\n\ninline\nint Mat::channels() const\n{\n    return CV_MAT_CN(flags);\n}\n\ninline\nuchar* Mat::ptr(int y)\n{\n    CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) );\n    return data + step.p[0] * y;\n}\n\ninline\nconst uchar* Mat::ptr(int y) const\n{\n    CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) );\n    return data + step.p[0] * y;\n}\n\ntemplate<typename _Tp> inline\n_Tp* Mat::ptr(int y)\n{\n    CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) );\n    return (_Tp*)(data + step.p[0] * y);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* Mat::ptr(int y) const\n{\n    CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) );\n    return (const _Tp*)(data + step.p[0] * y);\n}\n\ninline\nuchar* Mat::ptr(int i0, int i1)\n{\n    CV_DbgAssert(dims >= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    return data + i0 * step.p[0] + i1 * step.p[1];\n}\n\ninline\nconst uchar* Mat::ptr(int i0, int i1) const\n{\n    CV_DbgAssert(dims >= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    return data + i0 * step.p[0] + i1 * step.p[1];\n}\n\ntemplate<typename _Tp> inline\n_Tp* Mat::ptr(int i0, int i1)\n{\n    CV_DbgAssert(dims >= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    return (_Tp*)(data + i0 * step.p[0] + i1 * step.p[1]);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* Mat::ptr(int i0, int i1) const\n{\n    CV_DbgAssert(dims >= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    return (const _Tp*)(data + i0 * step.p[0] + i1 * step.p[1]);\n}\n\ninline\nuchar* Mat::ptr(int i0, int i1, int i2)\n{\n    CV_DbgAssert(dims >= 3);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    CV_DbgAssert((unsigned)i2 < (unsigned)size.p[2]);\n    return data + i0 * step.p[0] + i1 * step.p[1] + i2 * step.p[2];\n}\n\ninline\nconst uchar* Mat::ptr(int i0, int i1, int i2) const\n{\n    CV_DbgAssert(dims >= 3);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    CV_DbgAssert((unsigned)i2 < (unsigned)size.p[2]);\n    return data + i0 * step.p[0] + i1 * step.p[1] + i2 * step.p[2];\n}\n\ntemplate<typename _Tp> inline\n_Tp* Mat::ptr(int i0, int i1, int i2)\n{\n    CV_DbgAssert(dims >= 3);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    CV_DbgAssert((unsigned)i2 < (unsigned)size.p[2]);\n    return (_Tp*)(data + i0 * step.p[0] + i1 * step.p[1] + i2 * step.p[2]);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* Mat::ptr(int i0, int i1, int i2) const\n{\n    CV_DbgAssert(dims >= 3);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    CV_DbgAssert((unsigned)i2 < (unsigned)size.p[2]);\n    return (const _Tp*)(data + i0 * step.p[0] + i1 * step.p[1] + i2 * step.p[2]);\n}\n\ninline\nuchar* Mat::ptr(const int* idx)\n{\n    int i, d = dims;\n    uchar* p = data;\n    CV_DbgAssert( d >= 1 && p );\n    for( i = 0; i < d; i++ )\n    {\n        CV_DbgAssert( (unsigned)idx[i] < (unsigned)size.p[i] );\n        p += idx[i] * step.p[i];\n    }\n    return p;\n}\n\ninline\nconst uchar* Mat::ptr(const int* idx) const\n{\n    int i, d = dims;\n    uchar* p = data;\n    CV_DbgAssert( d >= 1 && p );\n    for( i = 0; i < d; i++ )\n    {\n        CV_DbgAssert( (unsigned)idx[i] < (unsigned)size.p[i] );\n        p += idx[i] * step.p[i];\n    }\n    return p;\n}\n\ntemplate<typename _Tp> inline\n_Tp* Mat::ptr(const int* idx)\n{\n    int i, d = dims;\n    uchar* p = data;\n    CV_DbgAssert( d >= 1 && p );\n    for( i = 0; i < d; i++ )\n    {\n        CV_DbgAssert( (unsigned)idx[i] < (unsigned)size.p[i] );\n        p += idx[i] * step.p[i];\n    }\n    return (_Tp*)p;\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* Mat::ptr(const int* idx) const\n{\n    int i, d = dims;\n    uchar* p = data;\n    CV_DbgAssert( d >= 1 && p );\n    for( i = 0; i < d; i++ )\n    {\n        CV_DbgAssert( (unsigned)idx[i] < (unsigned)size.p[i] );\n        p += idx[i] * step.p[i];\n    }\n    return (const _Tp*)p;\n}\n\ntemplate<int n> inline\nuchar* Mat::ptr(const Vec<int, n>& idx)\n{\n    return Mat::ptr(idx.val);\n}\n\ntemplate<int n> inline\nconst uchar* Mat::ptr(const Vec<int, n>& idx) const\n{\n    return Mat::ptr(idx.val);\n}\n\ntemplate<typename _Tp, int n> inline\n_Tp* Mat::ptr(const Vec<int, n>& idx)\n{\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return Mat::ptr<_Tp>(idx.val);\n}\n\ntemplate<typename _Tp, int n> inline\nconst _Tp* Mat::ptr(const Vec<int, n>& idx) const\n{\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return Mat::ptr<_Tp>(idx.val);\n}\n\n\ntemplate<typename _Tp> inline\n_Tp& Mat::at(int i0, int i1)\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels()));\n    CV_DbgAssert(CV_ELEM_SIZE1(traits::Depth<_Tp>::value) == elemSize1());\n    return ((_Tp*)(data + step.p[0] * i0))[i1];\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat::at(int i0, int i1) const\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels()));\n    CV_DbgAssert(CV_ELEM_SIZE1(traits::Depth<_Tp>::value) == elemSize1());\n    return ((const _Tp*)(data + step.p[0] * i0))[i1];\n}\n\ntemplate<typename _Tp> inline\n_Tp& Mat::at(Point pt)\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)pt.y < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)(pt.x * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels()));\n    CV_DbgAssert(CV_ELEM_SIZE1(traits::Depth<_Tp>::value) == elemSize1());\n    return ((_Tp*)(data + step.p[0] * pt.y))[pt.x];\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat::at(Point pt) const\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)pt.y < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)(pt.x * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels()));\n    CV_DbgAssert(CV_ELEM_SIZE1(traits::Depth<_Tp>::value) == elemSize1());\n    return ((const _Tp*)(data + step.p[0] * pt.y))[pt.x];\n}\n\ntemplate<typename _Tp> inline\n_Tp& Mat::at(int i0)\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)(size.p[0] * size.p[1]));\n    CV_DbgAssert(elemSize() == sizeof(_Tp));\n    if( isContinuous() || size.p[0] == 1 )\n        return ((_Tp*)data)[i0];\n    if( size.p[1] == 1 )\n        return *(_Tp*)(data + step.p[0] * i0);\n    int i = i0 / cols, j = i0 - i * cols;\n    return ((_Tp*)(data + step.p[0] * i))[j];\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat::at(int i0) const\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)(size.p[0] * size.p[1]));\n    CV_DbgAssert(elemSize() == sizeof(_Tp));\n    if( isContinuous() || size.p[0] == 1 )\n        return ((const _Tp*)data)[i0];\n    if( size.p[1] == 1 )\n        return *(const _Tp*)(data + step.p[0] * i0);\n    int i = i0 / cols, j = i0 - i * cols;\n    return ((const _Tp*)(data + step.p[0] * i))[j];\n}\n\ntemplate<typename _Tp> inline\n_Tp& Mat::at(int i0, int i1, int i2)\n{\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return *(_Tp*)ptr(i0, i1, i2);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat::at(int i0, int i1, int i2) const\n{\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return *(const _Tp*)ptr(i0, i1, i2);\n}\n\ntemplate<typename _Tp> inline\n_Tp& Mat::at(const int* idx)\n{\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return *(_Tp*)ptr(idx);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat::at(const int* idx) const\n{\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return *(const _Tp*)ptr(idx);\n}\n\ntemplate<typename _Tp, int n> inline\n_Tp& Mat::at(const Vec<int, n>& idx)\n{\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return *(_Tp*)ptr(idx.val);\n}\n\ntemplate<typename _Tp, int n> inline\nconst _Tp& Mat::at(const Vec<int, n>& idx) const\n{\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return *(const _Tp*)ptr(idx.val);\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp> Mat::begin() const\n{\n    if (empty())\n        return MatConstIterator_<_Tp>();\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return MatConstIterator_<_Tp>((const Mat_<_Tp>*)this);\n}\n\ntemplate<typename _Tp> inline\nstd::reverse_iterator<MatConstIterator_<_Tp>> Mat::rbegin() const\n{\n    if (empty())\n        return std::reverse_iterator<MatConstIterator_<_Tp>>();\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    MatConstIterator_<_Tp> it((const Mat_<_Tp>*)this);\n    it += total();\n    return std::reverse_iterator<MatConstIterator_<_Tp>> (it);\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp> Mat::end() const\n{\n    if (empty())\n        return MatConstIterator_<_Tp>();\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    MatConstIterator_<_Tp> it((const Mat_<_Tp>*)this);\n    it += total();\n    return it;\n}\n\ntemplate<typename _Tp> inline\nstd::reverse_iterator<MatConstIterator_<_Tp>> Mat::rend() const\n{\n    if (empty())\n        return std::reverse_iterator<MatConstIterator_<_Tp>>();\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return std::reverse_iterator<MatConstIterator_<_Tp>>((const Mat_<_Tp>*)this);\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp> Mat::begin()\n{\n    if (empty())\n        return MatIterator_<_Tp>();\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return MatIterator_<_Tp>((Mat_<_Tp>*)this);\n}\n\ntemplate<typename _Tp> inline\nstd::reverse_iterator<MatIterator_<_Tp>> Mat::rbegin()\n{\n    if (empty())\n        return std::reverse_iterator<MatIterator_<_Tp>>();\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    MatIterator_<_Tp> it((Mat_<_Tp>*)this);\n    it += total();\n    return std::reverse_iterator<MatIterator_<_Tp>>(it);\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp> Mat::end()\n{\n    if (empty())\n        return MatIterator_<_Tp>();\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    MatIterator_<_Tp> it((Mat_<_Tp>*)this);\n    it += total();\n    return it;\n}\n\ntemplate<typename _Tp> inline\nstd::reverse_iterator<MatIterator_<_Tp>> Mat::rend()\n{\n    if (empty())\n        return std::reverse_iterator<MatIterator_<_Tp>>();\n    CV_DbgAssert( elemSize() == sizeof(_Tp) );\n    return std::reverse_iterator<MatIterator_<_Tp>>(MatIterator_<_Tp>((Mat_<_Tp>*)this));\n}\n\ntemplate<typename _Tp, typename Functor> inline\nvoid Mat::forEach(const Functor& operation) {\n    this->forEach_impl<_Tp>(operation);\n}\n\ntemplate<typename _Tp, typename Functor> inline\nvoid Mat::forEach(const Functor& operation) const {\n    // call as not const\n    (const_cast<Mat*>(this))->forEach<_Tp>(operation);\n}\n\ntemplate<typename _Tp> inline\nMat::operator std::vector<_Tp>() const\n{\n    std::vector<_Tp> v;\n    copyTo(v);\n    return v;\n}\n\ntemplate<typename _Tp, std::size_t _Nm> inline\nMat::operator std::array<_Tp, _Nm>() const\n{\n    std::array<_Tp, _Nm> v;\n    copyTo(v);\n    return v;\n}\n\ntemplate<typename _Tp, int n> inline\nMat::operator Vec<_Tp, n>() const\n{\n    CV_Assert( data && dims <= 2 && (rows == 1 || cols == 1) &&\n               rows + cols - 1 == n && channels() == 1 );\n\n    if( isContinuous() && type() == traits::Type<_Tp>::value )\n        return Vec<_Tp, n>((_Tp*)data);\n    Vec<_Tp, n> v;\n    Mat tmp(rows, cols, traits::Type<_Tp>::value, v.val);\n    convertTo(tmp, tmp.type());\n    return v;\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMat::operator Matx<_Tp, m, n>() const\n{\n    CV_Assert( data && dims <= 2 && rows == m && cols == n && channels() == 1 );\n\n    if( isContinuous() && type() == traits::Type<_Tp>::value )\n        return Matx<_Tp, m, n>((_Tp*)data);\n    Matx<_Tp, m, n> mtx;\n    Mat tmp(rows, cols, traits::Type<_Tp>::value, mtx.val);\n    convertTo(tmp, tmp.type());\n    return mtx;\n}\n\ntemplate<typename _Tp> inline\nvoid Mat::push_back(const _Tp& elem)\n{\n    if( !data )\n    {\n        *this = Mat(1, 1, traits::Type<_Tp>::value, (void*)&elem).clone();\n        return;\n    }\n    CV_Assert(traits::Type<_Tp>::value == type() && cols == 1\n              /* && dims == 2 (cols == 1 implies dims == 2) */);\n    const uchar* tmp = dataend + step[0];\n    if( !isSubmatrix() && isContinuous() && tmp <= datalimit )\n    {\n        *(_Tp*)(data + (size.p[0]++) * step.p[0]) = elem;\n        dataend = tmp;\n    }\n    else\n        push_back_(&elem);\n}\n\ntemplate<typename _Tp> inline\nvoid Mat::push_back(const Mat_<_Tp>& m)\n{\n    push_back((const Mat&)m);\n}\n\ntemplate<> inline\nvoid Mat::push_back(const MatExpr& expr)\n{\n    push_back(static_cast<Mat>(expr));\n}\n\n\ntemplate<typename _Tp> inline\nvoid Mat::push_back(const std::vector<_Tp>& v)\n{\n    push_back(Mat(v));\n}\n\n\n///////////////////////////// MatSize ////////////////////////////\n\ninline\nMatSize::MatSize(int* _p) CV_NOEXCEPT\n    : p(_p) {}\n\ninline\nint MatSize::dims() const CV_NOEXCEPT\n{\n    return (p - 1)[0];\n}\n\ninline\nSize MatSize::operator()() const\n{\n    CV_DbgAssert(dims() <= 2);\n    return Size(p[1], p[0]);\n}\n\ninline\nconst int& MatSize::operator[](int i) const\n{\n    CV_DbgAssert(i < dims());\n#ifdef __OPENCV_BUILD\n    CV_DbgAssert(i >= 0);\n#endif\n    return p[i];\n}\n\ninline\nint& MatSize::operator[](int i)\n{\n    CV_DbgAssert(i < dims());\n#ifdef __OPENCV_BUILD\n    CV_DbgAssert(i >= 0);\n#endif\n    return p[i];\n}\n\ninline\nMatSize::operator const int*() const CV_NOEXCEPT\n{\n    return p;\n}\n\ninline\nbool MatSize::operator != (const MatSize& sz) const CV_NOEXCEPT\n{\n    return !(*this == sz);\n}\n\n\n\n///////////////////////////// MatStep ////////////////////////////\n\ninline\nMatStep::MatStep() CV_NOEXCEPT\n{\n    p = buf; p[0] = p[1] = 0;\n}\n\ninline\nMatStep::MatStep(size_t s) CV_NOEXCEPT\n{\n    p = buf; p[0] = s; p[1] = 0;\n}\n\ninline\nconst size_t& MatStep::operator[](int i) const CV_NOEXCEPT\n{\n    return p[i];\n}\n\ninline\nsize_t& MatStep::operator[](int i) CV_NOEXCEPT\n{\n    return p[i];\n}\n\ninline MatStep::operator size_t() const\n{\n    CV_DbgAssert( p == buf );\n    return buf[0];\n}\n\ninline MatStep& MatStep::operator = (size_t s)\n{\n    CV_DbgAssert( p == buf );\n    buf[0] = s;\n    return *this;\n}\n\n\n\n////////////////////////////// Mat_<_Tp> ////////////////////////////\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_() CV_NOEXCEPT\n    : Mat()\n{\n    flags = (flags & ~CV_MAT_TYPE_MASK) + traits::Type<_Tp>::value;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(int _rows, int _cols)\n    : Mat(_rows, _cols, traits::Type<_Tp>::value)\n{\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(int _rows, int _cols, const _Tp& value)\n    : Mat(_rows, _cols, traits::Type<_Tp>::value)\n{\n    *this = value;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(Size _sz)\n    : Mat(_sz.height, _sz.width, traits::Type<_Tp>::value)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(Size _sz, const _Tp& value)\n    : Mat(_sz.height, _sz.width, traits::Type<_Tp>::value)\n{\n    *this = value;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(int _dims, const int* _sz)\n    : Mat(_dims, _sz, traits::Type<_Tp>::value)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(int _dims, const int* _sz, const _Tp& _s)\n    : Mat(_dims, _sz, traits::Type<_Tp>::value, Scalar(_s))\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(int _dims, const int* _sz, _Tp* _data, const size_t* _steps)\n    : Mat(_dims, _sz, traits::Type<_Tp>::value, _data, _steps)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const Mat_<_Tp>& m, const Range* ranges)\n    : Mat(m, ranges)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const Mat_<_Tp>& m, const std::vector<Range>& ranges)\n    : Mat(m, ranges)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const Mat& m)\n    : Mat()\n{\n    flags = (flags & ~CV_MAT_TYPE_MASK) + traits::Type<_Tp>::value;\n    *this = m;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const Mat_& m)\n    : Mat(m)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(int _rows, int _cols, _Tp* _data, size_t steps)\n    : Mat(_rows, _cols, traits::Type<_Tp>::value, _data, steps)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const Mat_& m, const Range& _rowRange, const Range& _colRange)\n    : Mat(m, _rowRange, _colRange)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const Mat_& m, const Rect& roi)\n    : Mat(m, roi)\n{}\n\ntemplate<typename _Tp> template<int n> inline\nMat_<_Tp>::Mat_(const Vec<typename DataType<_Tp>::channel_type, n>& vec, bool copyData)\n    : Mat(n / DataType<_Tp>::channels, 1, traits::Type<_Tp>::value, (void*)&vec)\n{\n    CV_Assert(n%DataType<_Tp>::channels == 0);\n    if( copyData )\n        *this = clone();\n}\n\ntemplate<typename _Tp> template<int m, int n> inline\nMat_<_Tp>::Mat_(const Matx<typename DataType<_Tp>::channel_type, m, n>& M, bool copyData)\n    : Mat(m, n / DataType<_Tp>::channels, traits::Type<_Tp>::value, (void*)&M)\n{\n    CV_Assert(n % DataType<_Tp>::channels == 0);\n    if( copyData )\n        *this = clone();\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const Point_<typename DataType<_Tp>::channel_type>& pt, bool copyData)\n    : Mat(2 / DataType<_Tp>::channels, 1, traits::Type<_Tp>::value, (void*)&pt)\n{\n    CV_Assert(2 % DataType<_Tp>::channels == 0);\n    if( copyData )\n        *this = clone();\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const Point3_<typename DataType<_Tp>::channel_type>& pt, bool copyData)\n    : Mat(3 / DataType<_Tp>::channels, 1, traits::Type<_Tp>::value, (void*)&pt)\n{\n    CV_Assert(3 % DataType<_Tp>::channels == 0);\n    if( copyData )\n        *this = clone();\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const MatCommaInitializer_<_Tp>& commaInitializer)\n    : Mat(commaInitializer)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const std::vector<_Tp>& vec, bool copyData)\n    : Mat(vec, copyData)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(std::initializer_list<_Tp> list)\n    : Mat(list)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const std::initializer_list<int> sizes, std::initializer_list<_Tp> list)\n    : Mat(sizes, list)\n{}\n\ntemplate<typename _Tp> template<std::size_t _Nm> inline\nMat_<_Tp>::Mat_(const std::array<_Tp, _Nm>& arr, bool copyData)\n    : Mat(arr, copyData)\n{}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>& Mat_<_Tp>::operator = (const Mat& m)\n{\n    if (m.empty())\n    {\n        release();\n        return *this;\n    }\n    if( traits::Type<_Tp>::value == m.type() )\n    {\n        Mat::operator = (m);\n        return *this;\n    }\n    if( traits::Depth<_Tp>::value == m.depth() )\n    {\n        return (*this = m.reshape(DataType<_Tp>::channels, m.dims, 0));\n    }\n    CV_Assert(DataType<_Tp>::channels == m.channels() || m.empty());\n    m.convertTo(*this, type());\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>& Mat_<_Tp>::operator = (const Mat_& m)\n{\n    Mat::operator=(m);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>& Mat_<_Tp>::operator = (const _Tp& s)\n{\n    typedef typename DataType<_Tp>::vec_type VT;\n    Mat::operator=(Scalar((const VT&)s));\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nvoid Mat_<_Tp>::create(int _rows, int _cols)\n{\n    Mat::create(_rows, _cols, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nvoid Mat_<_Tp>::create(Size _sz)\n{\n    Mat::create(_sz, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nvoid Mat_<_Tp>::create(int _dims, const int* _sz)\n{\n    Mat::create(_dims, _sz, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nvoid Mat_<_Tp>::release()\n{\n    Mat::release();\n    flags = (flags & ~CV_MAT_TYPE_MASK) + traits::Type<_Tp>::value;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp> Mat_<_Tp>::cross(const Mat_& m) const\n{\n    return Mat_<_Tp>(Mat::cross(m));\n}\n\ntemplate<typename _Tp> template<typename T2> inline\nMat_<_Tp>::operator Mat_<T2>() const\n{\n    return Mat_<T2>(static_cast<const Mat&>(*this));\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp> Mat_<_Tp>::row(int y) const\n{\n    return Mat_(*this, Range(y, y+1), Range::all());\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp> Mat_<_Tp>::col(int x) const\n{\n    return Mat_(*this, Range::all(), Range(x, x+1));\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp> Mat_<_Tp>::diag(int d) const\n{\n    return Mat_(Mat::diag(d));\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp> Mat_<_Tp>::clone() const\n{\n    return Mat_(Mat::clone());\n}\n\ntemplate<typename _Tp> inline\nsize_t Mat_<_Tp>::elemSize() const\n{\n    CV_DbgAssert( Mat::elemSize() == sizeof(_Tp) );\n    return sizeof(_Tp);\n}\n\ntemplate<typename _Tp> inline\nsize_t Mat_<_Tp>::elemSize1() const\n{\n    CV_DbgAssert( Mat::elemSize1() == sizeof(_Tp) / DataType<_Tp>::channels );\n    return sizeof(_Tp) / DataType<_Tp>::channels;\n}\n\ntemplate<typename _Tp> inline\nint Mat_<_Tp>::type() const\n{\n    CV_DbgAssert( Mat::type() == traits::Type<_Tp>::value );\n    return traits::Type<_Tp>::value;\n}\n\ntemplate<typename _Tp> inline\nint Mat_<_Tp>::depth() const\n{\n    CV_DbgAssert( Mat::depth() == traits::Depth<_Tp>::value );\n    return traits::Depth<_Tp>::value;\n}\n\ntemplate<typename _Tp> inline\nint Mat_<_Tp>::channels() const\n{\n    CV_DbgAssert( Mat::channels() == DataType<_Tp>::channels );\n    return DataType<_Tp>::channels;\n}\n\ntemplate<typename _Tp> inline\nsize_t Mat_<_Tp>::stepT(int i) const\n{\n    return step.p[i] / elemSize();\n}\n\ntemplate<typename _Tp> inline\nsize_t Mat_<_Tp>::step1(int i) const\n{\n    return step.p[i] / elemSize1();\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>& Mat_<_Tp>::adjustROI( int dtop, int dbottom, int dleft, int dright )\n{\n    return (Mat_<_Tp>&)(Mat::adjustROI(dtop, dbottom, dleft, dright));\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp> Mat_<_Tp>::operator()( const Range& _rowRange, const Range& _colRange ) const\n{\n    return Mat_<_Tp>(*this, _rowRange, _colRange);\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp> Mat_<_Tp>::operator()( const Rect& roi ) const\n{\n    return Mat_<_Tp>(*this, roi);\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp> Mat_<_Tp>::operator()( const Range* ranges ) const\n{\n    return Mat_<_Tp>(*this, ranges);\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp> Mat_<_Tp>::operator()(const std::vector<Range>& ranges) const\n{\n    return Mat_<_Tp>(*this, ranges);\n}\n\ntemplate<typename _Tp> inline\n_Tp* Mat_<_Tp>::operator [](int y)\n{\n    CV_DbgAssert( 0 <= y && y < size.p[0] );\n    return (_Tp*)(data + y*step.p[0]);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* Mat_<_Tp>::operator [](int y) const\n{\n    CV_DbgAssert( 0 <= y && y < size.p[0] );\n    return (const _Tp*)(data + y*step.p[0]);\n}\n\ntemplate<typename _Tp> inline\n_Tp& Mat_<_Tp>::operator ()(int i0, int i1)\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    CV_DbgAssert(type() == traits::Type<_Tp>::value);\n    return ((_Tp*)(data + step.p[0] * i0))[i1];\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat_<_Tp>::operator ()(int i0, int i1) const\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]);\n    CV_DbgAssert(type() == traits::Type<_Tp>::value);\n    return ((const _Tp*)(data + step.p[0] * i0))[i1];\n}\n\ntemplate<typename _Tp> inline\n_Tp& Mat_<_Tp>::operator ()(Point pt)\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)pt.y < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)pt.x < (unsigned)size.p[1]);\n    CV_DbgAssert(type() == traits::Type<_Tp>::value);\n    return ((_Tp*)(data + step.p[0] * pt.y))[pt.x];\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat_<_Tp>::operator ()(Point pt) const\n{\n    CV_DbgAssert(dims <= 2);\n    CV_DbgAssert(data);\n    CV_DbgAssert((unsigned)pt.y < (unsigned)size.p[0]);\n    CV_DbgAssert((unsigned)pt.x < (unsigned)size.p[1]);\n    CV_DbgAssert(type() == traits::Type<_Tp>::value);\n    return ((const _Tp*)(data + step.p[0] * pt.y))[pt.x];\n}\n\ntemplate<typename _Tp> inline\n_Tp& Mat_<_Tp>::operator ()(const int* idx)\n{\n    return Mat::at<_Tp>(idx);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat_<_Tp>::operator ()(const int* idx) const\n{\n    return Mat::at<_Tp>(idx);\n}\n\ntemplate<typename _Tp> template<int n> inline\n_Tp& Mat_<_Tp>::operator ()(const Vec<int, n>& idx)\n{\n    return Mat::at<_Tp>(idx);\n}\n\ntemplate<typename _Tp> template<int n> inline\nconst _Tp& Mat_<_Tp>::operator ()(const Vec<int, n>& idx) const\n{\n    return Mat::at<_Tp>(idx);\n}\n\ntemplate<typename _Tp> inline\n_Tp& Mat_<_Tp>::operator ()(int i0)\n{\n    return this->at<_Tp>(i0);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat_<_Tp>::operator ()(int i0) const\n{\n    return this->at<_Tp>(i0);\n}\n\ntemplate<typename _Tp> inline\n_Tp& Mat_<_Tp>::operator ()(int i0, int i1, int i2)\n{\n    return this->at<_Tp>(i0, i1, i2);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& Mat_<_Tp>::operator ()(int i0, int i1, int i2) const\n{\n    return this->at<_Tp>(i0, i1, i2);\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::operator std::vector<_Tp>() const\n{\n    std::vector<_Tp> v;\n    copyTo(v);\n    return v;\n}\n\ntemplate<typename _Tp> template<std::size_t _Nm> inline\nMat_<_Tp>::operator std::array<_Tp, _Nm>() const\n{\n    std::array<_Tp, _Nm> a;\n    copyTo(a);\n    return a;\n}\n\ntemplate<typename _Tp> template<int n> inline\nMat_<_Tp>::operator Vec<typename DataType<_Tp>::channel_type, n>() const\n{\n    CV_Assert(n % DataType<_Tp>::channels == 0);\n\n#if defined _MSC_VER\n    const Mat* pMat = (const Mat*)this; // workaround for MSVS <= 2012 compiler bugs (but GCC 4.6 dislikes this workaround)\n    return pMat->operator Vec<typename DataType<_Tp>::channel_type, n>();\n#else\n    return this->Mat::operator Vec<typename DataType<_Tp>::channel_type, n>();\n#endif\n}\n\ntemplate<typename _Tp> template<int m, int n> inline\nMat_<_Tp>::operator Matx<typename DataType<_Tp>::channel_type, m, n>() const\n{\n    CV_Assert(n % DataType<_Tp>::channels == 0);\n\n#if defined _MSC_VER\n    const Mat* pMat = (const Mat*)this; // workaround for MSVS <= 2012 compiler bugs (but GCC 4.6 dislikes this workaround)\n    Matx<typename DataType<_Tp>::channel_type, m, n> res = pMat->operator Matx<typename DataType<_Tp>::channel_type, m, n>();\n    return res;\n#else\n    Matx<typename DataType<_Tp>::channel_type, m, n> res = this->Mat::operator Matx<typename DataType<_Tp>::channel_type, m, n>();\n    return res;\n#endif\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp> Mat_<_Tp>::begin() const\n{\n    return Mat::begin<_Tp>();\n}\n\ntemplate<typename _Tp> inline\nstd::reverse_iterator<MatConstIterator_<_Tp>> Mat_<_Tp>::rbegin() const\n{\n    return Mat::rbegin<_Tp>();\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp> Mat_<_Tp>::end() const\n{\n    return Mat::end<_Tp>();\n}\n\ntemplate<typename _Tp> inline\nstd::reverse_iterator<MatConstIterator_<_Tp>> Mat_<_Tp>::rend() const\n{\n    return Mat::rend<_Tp>();\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp> Mat_<_Tp>::begin()\n{\n    return Mat::begin<_Tp>();\n}\n\ntemplate<typename _Tp> inline\nstd::reverse_iterator<MatIterator_<_Tp>> Mat_<_Tp>::rbegin()\n{\n    return Mat::rbegin<_Tp>();\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp> Mat_<_Tp>::end()\n{\n    return Mat::end<_Tp>();\n}\n\ntemplate<typename _Tp> inline\nstd::reverse_iterator<MatIterator_<_Tp>> Mat_<_Tp>::rend()\n{\n    return Mat::rend<_Tp>();\n}\n\ntemplate<typename _Tp> template<typename Functor> inline\nvoid Mat_<_Tp>::forEach(const Functor& operation) {\n    Mat::forEach<_Tp, Functor>(operation);\n}\n\ntemplate<typename _Tp> template<typename Functor> inline\nvoid Mat_<_Tp>::forEach(const Functor& operation) const {\n    Mat::forEach<_Tp, Functor>(operation);\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(Mat_&& m)\n    : Mat(std::move(m))\n{\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>& Mat_<_Tp>::operator = (Mat_&& m)\n{\n    Mat::operator = (std::move(m));\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(Mat&& m)\n    : Mat()\n{\n    flags = (flags & ~CV_MAT_TYPE_MASK) + traits::Type<_Tp>::value;\n    *this = std::move(m);\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>& Mat_<_Tp>::operator = (Mat&& m)\n{\n    if (m.empty())\n    {\n        release();\n        return *this;\n    }\n    if( traits::Type<_Tp>::value == m.type() )\n    {\n        Mat::operator = ((Mat&&)m);\n        return *this;\n    }\n    if( traits::Depth<_Tp>::value == m.depth() )\n    {\n        Mat::operator = ((Mat&&)m.reshape(DataType<_Tp>::channels, m.dims, 0));\n        return *this;\n    }\n    CV_DbgAssert(DataType<_Tp>::channels == m.channels());\n    m.convertTo(*this, type());\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(MatExpr&& e)\n    : Mat()\n{\n    flags = (flags & ~CV_MAT_TYPE_MASK) + traits::Type<_Tp>::value;\n    *this = Mat(e);\n}\n\n\n///////////////////////////// SparseMat /////////////////////////////\n\ninline\nSparseMat SparseMat::clone() const\n{\n    SparseMat temp;\n    this->copyTo(temp);\n    return temp;\n}\n\ninline\nsize_t SparseMat::elemSize() const\n{\n    return CV_ELEM_SIZE(flags);\n}\n\ninline\nsize_t SparseMat::elemSize1() const\n{\n    return CV_ELEM_SIZE1(flags);\n}\n\ninline\nint SparseMat::type() const\n{\n    return CV_MAT_TYPE(flags);\n}\n\ninline\nint SparseMat::depth() const\n{\n    return CV_MAT_DEPTH(flags);\n}\n\ninline\nint SparseMat::channels() const\n{\n    return CV_MAT_CN(flags);\n}\n\ninline\nconst int* SparseMat::size() const\n{\n    return hdr ? hdr->size : 0;\n}\n\ninline\nint SparseMat::size(int i) const\n{\n    if( hdr )\n    {\n        CV_DbgAssert((unsigned)i < (unsigned)hdr->dims);\n        return hdr->size[i];\n    }\n    return 0;\n}\n\ninline\nint SparseMat::dims() const\n{\n    return hdr ? hdr->dims : 0;\n}\n\ninline\nsize_t SparseMat::nzcount() const\n{\n    return hdr ? hdr->nodeCount : 0;\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMat::ref(int i0, size_t* hashval)\n{\n    return *(_Tp*)((SparseMat*)this)->ptr(i0, true, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMat::ref(int i0, int i1, size_t* hashval)\n{\n    return *(_Tp*)((SparseMat*)this)->ptr(i0, i1, true, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMat::ref(int i0, int i1, int i2, size_t* hashval)\n{\n    return *(_Tp*)((SparseMat*)this)->ptr(i0, i1, i2, true, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMat::ref(const int* idx, size_t* hashval)\n{\n    return *(_Tp*)((SparseMat*)this)->ptr(idx, true, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp SparseMat::value(int i0, size_t* hashval) const\n{\n    const _Tp* p = (const _Tp*)((SparseMat*)this)->ptr(i0, false, hashval);\n    return p ? *p : _Tp();\n}\n\ntemplate<typename _Tp> inline\n_Tp SparseMat::value(int i0, int i1, size_t* hashval) const\n{\n    const _Tp* p = (const _Tp*)((SparseMat*)this)->ptr(i0, i1, false, hashval);\n    return p ? *p : _Tp();\n}\n\ntemplate<typename _Tp> inline\n_Tp SparseMat::value(int i0, int i1, int i2, size_t* hashval) const\n{\n    const _Tp* p = (const _Tp*)((SparseMat*)this)->ptr(i0, i1, i2, false, hashval);\n    return p ? *p : _Tp();\n}\n\ntemplate<typename _Tp> inline\n_Tp SparseMat::value(const int* idx, size_t* hashval) const\n{\n    const _Tp* p = (const _Tp*)((SparseMat*)this)->ptr(idx, false, hashval);\n    return p ? *p : _Tp();\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* SparseMat::find(int i0, size_t* hashval) const\n{\n    return (const _Tp*)((SparseMat*)this)->ptr(i0, false, hashval);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* SparseMat::find(int i0, int i1, size_t* hashval) const\n{\n    return (const _Tp*)((SparseMat*)this)->ptr(i0, i1, false, hashval);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* SparseMat::find(int i0, int i1, int i2, size_t* hashval) const\n{\n    return (const _Tp*)((SparseMat*)this)->ptr(i0, i1, i2, false, hashval);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp* SparseMat::find(const int* idx, size_t* hashval) const\n{\n    return (const _Tp*)((SparseMat*)this)->ptr(idx, false, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMat::value(Node* n)\n{\n    return *(_Tp*)((uchar*)n + hdr->valueOffset);\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& SparseMat::value(const Node* n) const\n{\n    return *(const _Tp*)((const uchar*)n + hdr->valueOffset);\n}\n\ninline\nSparseMat::Node* SparseMat::node(size_t nidx)\n{\n    return (Node*)(void*)&hdr->pool[nidx];\n}\n\ninline\nconst SparseMat::Node* SparseMat::node(size_t nidx) const\n{\n    return (const Node*)(const void*)&hdr->pool[nidx];\n}\n\ninline\nSparseMatIterator SparseMat::begin()\n{\n    return SparseMatIterator(this);\n}\n\ninline\nSparseMatConstIterator SparseMat::begin() const\n{\n    return SparseMatConstIterator(this);\n}\n\ninline\nSparseMatIterator SparseMat::end()\n{\n    SparseMatIterator it(this);\n    it.seekEnd();\n    return it;\n}\n\ninline\nSparseMatConstIterator SparseMat::end() const\n{\n    SparseMatConstIterator it(this);\n    it.seekEnd();\n    return it;\n}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp> SparseMat::begin()\n{\n    return SparseMatIterator_<_Tp>(this);\n}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp> SparseMat::begin() const\n{\n    return SparseMatConstIterator_<_Tp>(this);\n}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp> SparseMat::end()\n{\n    SparseMatIterator_<_Tp> it(this);\n    it.seekEnd();\n    return it;\n}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp> SparseMat::end() const\n{\n    SparseMatConstIterator_<_Tp> it(this);\n    it.seekEnd();\n    return it;\n}\n\n\n\n///////////////////////////// SparseMat_ ////////////////////////////\n\ntemplate<typename _Tp> inline\nSparseMat_<_Tp>::SparseMat_()\n{\n    flags = MAGIC_VAL + traits::Type<_Tp>::value;\n}\n\ntemplate<typename _Tp> inline\nSparseMat_<_Tp>::SparseMat_(int _dims, const int* _sizes)\n    : SparseMat(_dims, _sizes, traits::Type<_Tp>::value)\n{}\n\ntemplate<typename _Tp> inline\nSparseMat_<_Tp>::SparseMat_(const SparseMat& m)\n{\n    if( m.type() == traits::Type<_Tp>::value )\n        *this = (const SparseMat_<_Tp>&)m;\n    else\n        m.convertTo(*this, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nSparseMat_<_Tp>::SparseMat_(const SparseMat_<_Tp>& m)\n{\n    this->flags = m.flags;\n    this->hdr = m.hdr;\n    if( this->hdr )\n        CV_XADD(&this->hdr->refcount, 1);\n}\n\ntemplate<typename _Tp> inline\nSparseMat_<_Tp>::SparseMat_(const Mat& m)\n{\n    SparseMat sm(m);\n    *this = sm;\n}\n\ntemplate<typename _Tp> inline\nSparseMat_<_Tp>& SparseMat_<_Tp>::operator = (const SparseMat_<_Tp>& m)\n{\n    if( this != &m )\n    {\n        if( m.hdr ) CV_XADD(&m.hdr->refcount, 1);\n        release();\n        flags = m.flags;\n        hdr = m.hdr;\n    }\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nSparseMat_<_Tp>& SparseMat_<_Tp>::operator = (const SparseMat& m)\n{\n    if( m.type() == traits::Type<_Tp>::value )\n        return (*this = (const SparseMat_<_Tp>&)m);\n    m.convertTo(*this, traits::Type<_Tp>::value);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nSparseMat_<_Tp>& SparseMat_<_Tp>::operator = (const Mat& m)\n{\n    return (*this = SparseMat(m));\n}\n\ntemplate<typename _Tp> inline\nSparseMat_<_Tp> SparseMat_<_Tp>::clone() const\n{\n    SparseMat_<_Tp> m;\n    this->copyTo(m);\n    return m;\n}\n\ntemplate<typename _Tp> inline\nvoid SparseMat_<_Tp>::create(int _dims, const int* _sizes)\n{\n    SparseMat::create(_dims, _sizes, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nint SparseMat_<_Tp>::type() const\n{\n    return traits::Type<_Tp>::value;\n}\n\ntemplate<typename _Tp> inline\nint SparseMat_<_Tp>::depth() const\n{\n    return traits::Depth<_Tp>::value;\n}\n\ntemplate<typename _Tp> inline\nint SparseMat_<_Tp>::channels() const\n{\n    return DataType<_Tp>::channels;\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMat_<_Tp>::ref(int i0, size_t* hashval)\n{\n    return SparseMat::ref<_Tp>(i0, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp SparseMat_<_Tp>::operator()(int i0, size_t* hashval) const\n{\n    return SparseMat::value<_Tp>(i0, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMat_<_Tp>::ref(int i0, int i1, size_t* hashval)\n{\n    return SparseMat::ref<_Tp>(i0, i1, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp SparseMat_<_Tp>::operator()(int i0, int i1, size_t* hashval) const\n{\n    return SparseMat::value<_Tp>(i0, i1, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMat_<_Tp>::ref(int i0, int i1, int i2, size_t* hashval)\n{\n    return SparseMat::ref<_Tp>(i0, i1, i2, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp SparseMat_<_Tp>::operator()(int i0, int i1, int i2, size_t* hashval) const\n{\n    return SparseMat::value<_Tp>(i0, i1, i2, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMat_<_Tp>::ref(const int* idx, size_t* hashval)\n{\n    return SparseMat::ref<_Tp>(idx, hashval);\n}\n\ntemplate<typename _Tp> inline\n_Tp SparseMat_<_Tp>::operator()(const int* idx, size_t* hashval) const\n{\n    return SparseMat::value<_Tp>(idx, hashval);\n}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp> SparseMat_<_Tp>::begin()\n{\n    return SparseMatIterator_<_Tp>(this);\n}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp> SparseMat_<_Tp>::begin() const\n{\n    return SparseMatConstIterator_<_Tp>(this);\n}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp> SparseMat_<_Tp>::end()\n{\n    SparseMatIterator_<_Tp> it(this);\n    it.seekEnd();\n    return it;\n}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp> SparseMat_<_Tp>::end() const\n{\n    SparseMatConstIterator_<_Tp> it(this);\n    it.seekEnd();\n    return it;\n}\n\n\n\n////////////////////////// MatConstIterator /////////////////////////\n\ninline\nMatConstIterator::MatConstIterator()\n    : m(0), elemSize(0), ptr(0), sliceStart(0), sliceEnd(0)\n{}\n\ninline\nMatConstIterator::MatConstIterator(const Mat* _m)\n    : m(_m), elemSize(_m->elemSize()), ptr(0), sliceStart(0), sliceEnd(0)\n{\n    if( m && m->isContinuous() )\n    {\n        CV_Assert(!m->empty());\n        sliceStart = m->ptr();\n        sliceEnd = sliceStart + m->total()*elemSize;\n    }\n    seek((const int*)0);\n}\n\ninline\nMatConstIterator::MatConstIterator(const Mat* _m, int _row, int _col)\n    : m(_m), elemSize(_m->elemSize()), ptr(0), sliceStart(0), sliceEnd(0)\n{\n    CV_Assert(m && m->dims <= 2);\n    if( m->isContinuous() )\n    {\n        CV_Assert(!m->empty());\n        sliceStart = m->ptr();\n        sliceEnd = sliceStart + m->total()*elemSize;\n    }\n    int idx[] = {_row, _col};\n    seek(idx);\n}\n\ninline\nMatConstIterator::MatConstIterator(const Mat* _m, Point _pt)\n    : m(_m), elemSize(_m->elemSize()), ptr(0), sliceStart(0), sliceEnd(0)\n{\n    CV_Assert(m && m->dims <= 2);\n    if( m->isContinuous() )\n    {\n        CV_Assert(!m->empty());\n        sliceStart = m->ptr();\n        sliceEnd = sliceStart + m->total()*elemSize;\n    }\n    int idx[] = {_pt.y, _pt.x};\n    seek(idx);\n}\n\ninline\nMatConstIterator::MatConstIterator(const MatConstIterator& it)\n    : m(it.m), elemSize(it.elemSize), ptr(it.ptr), sliceStart(it.sliceStart), sliceEnd(it.sliceEnd)\n{}\n\ninline\nMatConstIterator& MatConstIterator::operator = (const MatConstIterator& it )\n{\n    m = it.m; elemSize = it.elemSize; ptr = it.ptr;\n    sliceStart = it.sliceStart; sliceEnd = it.sliceEnd;\n    return *this;\n}\n\ninline\nconst uchar* MatConstIterator::operator *() const\n{\n    return ptr;\n}\n\ninline MatConstIterator& MatConstIterator::operator += (ptrdiff_t ofs)\n{\n    if( !m || ofs == 0 )\n        return *this;\n    ptrdiff_t ofsb = ofs*elemSize;\n    ptr += ofsb;\n    if( ptr < sliceStart || sliceEnd <= ptr )\n    {\n        ptr -= ofsb;\n        seek(ofs, true);\n    }\n    return *this;\n}\n\ninline\nMatConstIterator& MatConstIterator::operator -= (ptrdiff_t ofs)\n{\n    return (*this += -ofs);\n}\n\ninline\nMatConstIterator& MatConstIterator::operator --()\n{\n    if( m && (ptr -= elemSize) < sliceStart )\n    {\n        ptr += elemSize;\n        seek(-1, true);\n    }\n    return *this;\n}\n\ninline\nMatConstIterator MatConstIterator::operator --(int)\n{\n    MatConstIterator b = *this;\n    *this += -1;\n    return b;\n}\n\ninline\nMatConstIterator& MatConstIterator::operator ++()\n{\n    if( m && (ptr += elemSize) >= sliceEnd )\n    {\n        ptr -= elemSize;\n        seek(1, true);\n    }\n    return *this;\n}\n\ninline MatConstIterator MatConstIterator::operator ++(int)\n{\n    MatConstIterator b = *this;\n    *this += 1;\n    return b;\n}\n\n\nstatic inline\nbool operator == (const MatConstIterator& a, const MatConstIterator& b)\n{\n    return a.m == b.m && a.ptr == b.ptr;\n}\n\nstatic inline\nbool operator != (const MatConstIterator& a, const MatConstIterator& b)\n{\n    return !(a == b);\n}\n\nstatic inline\nbool operator < (const MatConstIterator& a, const MatConstIterator& b)\n{\n    return a.ptr < b.ptr;\n}\n\nstatic inline\nbool operator > (const MatConstIterator& a, const MatConstIterator& b)\n{\n    return a.ptr > b.ptr;\n}\n\nstatic inline\nbool operator <= (const MatConstIterator& a, const MatConstIterator& b)\n{\n    return a.ptr <= b.ptr;\n}\n\nstatic inline\nbool operator >= (const MatConstIterator& a, const MatConstIterator& b)\n{\n    return a.ptr >= b.ptr;\n}\n\nstatic inline\nptrdiff_t operator - (const MatConstIterator& b, const MatConstIterator& a)\n{\n    if( a.m != b.m )\n        return ((size_t)(-1) >> 1);\n    if( a.sliceEnd == b.sliceEnd )\n        return (b.ptr - a.ptr)/static_cast<ptrdiff_t>(b.elemSize);\n\n    return b.lpos() - a.lpos();\n}\n\nstatic inline\nMatConstIterator operator + (const MatConstIterator& a, ptrdiff_t ofs)\n{\n    MatConstIterator b = a;\n    return b += ofs;\n}\n\nstatic inline\nMatConstIterator operator + (ptrdiff_t ofs, const MatConstIterator& a)\n{\n    MatConstIterator b = a;\n    return b += ofs;\n}\n\nstatic inline\nMatConstIterator operator - (const MatConstIterator& a, ptrdiff_t ofs)\n{\n    MatConstIterator b = a;\n    return b += -ofs;\n}\n\n\ninline\nconst uchar* MatConstIterator::operator [](ptrdiff_t i) const\n{\n    return *(*this + i);\n}\n\n\n\n///////////////////////// MatConstIterator_ /////////////////////////\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>::MatConstIterator_()\n{}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>::MatConstIterator_(const Mat_<_Tp>* _m)\n    : MatConstIterator(_m)\n{}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>::MatConstIterator_(const Mat_<_Tp>* _m, int _row, int _col)\n    : MatConstIterator(_m, _row, _col)\n{}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>::MatConstIterator_(const Mat_<_Tp>* _m, Point _pt)\n    : MatConstIterator(_m, _pt)\n{}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>::MatConstIterator_(const MatConstIterator_& it)\n    : MatConstIterator(it)\n{}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator = (const MatConstIterator_& it )\n{\n    MatConstIterator::operator = (it);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& MatConstIterator_<_Tp>::operator *() const\n{\n    return *(_Tp*)(this->ptr);\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator += (ptrdiff_t ofs)\n{\n    MatConstIterator::operator += (ofs);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator -= (ptrdiff_t ofs)\n{\n    return (*this += -ofs);\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator --()\n{\n    MatConstIterator::operator --();\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp> MatConstIterator_<_Tp>::operator --(int)\n{\n    MatConstIterator_ b = *this;\n    MatConstIterator::operator --();\n    return b;\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator ++()\n{\n    MatConstIterator::operator ++();\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMatConstIterator_<_Tp> MatConstIterator_<_Tp>::operator ++(int)\n{\n    MatConstIterator_ b = *this;\n    MatConstIterator::operator ++();\n    return b;\n}\n\n\ntemplate<typename _Tp> inline\nPoint MatConstIterator_<_Tp>::pos() const\n{\n    if( !m )\n        return Point();\n    CV_DbgAssert( m->dims <= 2 );\n    if( m->isContinuous() )\n    {\n        ptrdiff_t ofs = (const _Tp*)ptr - (const _Tp*)m->data;\n        int y = (int)(ofs / m->cols);\n        int x = (int)(ofs - (ptrdiff_t)y * m->cols);\n        return Point(x, y);\n    }\n    else\n    {\n        ptrdiff_t ofs = (uchar*)ptr - m->data;\n        int y = (int)(ofs / m->step);\n        int x = (int)((ofs - y * m->step)/sizeof(_Tp));\n        return Point(x, y);\n    }\n}\n\n\ntemplate<typename _Tp> static inline\nbool operator == (const MatConstIterator_<_Tp>& a, const MatConstIterator_<_Tp>& b)\n{\n    return a.m == b.m && a.ptr == b.ptr;\n}\n\ntemplate<typename _Tp> static inline\nbool operator != (const MatConstIterator_<_Tp>& a, const MatConstIterator_<_Tp>& b)\n{\n    return a.m != b.m || a.ptr != b.ptr;\n}\n\ntemplate<typename _Tp> static inline\nMatConstIterator_<_Tp> operator + (const MatConstIterator_<_Tp>& a, ptrdiff_t ofs)\n{\n    MatConstIterator t = (const MatConstIterator&)a + ofs;\n    return (MatConstIterator_<_Tp>&)t;\n}\n\ntemplate<typename _Tp> static inline\nMatConstIterator_<_Tp> operator + (ptrdiff_t ofs, const MatConstIterator_<_Tp>& a)\n{\n    MatConstIterator t = (const MatConstIterator&)a + ofs;\n    return (MatConstIterator_<_Tp>&)t;\n}\n\ntemplate<typename _Tp> static inline\nMatConstIterator_<_Tp> operator - (const MatConstIterator_<_Tp>& a, ptrdiff_t ofs)\n{\n    MatConstIterator t = (const MatConstIterator&)a - ofs;\n    return (MatConstIterator_<_Tp>&)t;\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& MatConstIterator_<_Tp>::operator [](ptrdiff_t i) const\n{\n    return *(_Tp*)MatConstIterator::operator [](i);\n}\n\n\n\n//////////////////////////// MatIterator_ ///////////////////////////\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>::MatIterator_()\n    : MatConstIterator_<_Tp>()\n{}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m)\n    : MatConstIterator_<_Tp>(_m)\n{}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m, int _row, int _col)\n    : MatConstIterator_<_Tp>(_m, _row, _col)\n{}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m, Point _pt)\n    : MatConstIterator_<_Tp>(_m, _pt)\n{}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m, const int* _idx)\n    : MatConstIterator_<_Tp>(_m, _idx)\n{}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>::MatIterator_(const MatIterator_& it)\n    : MatConstIterator_<_Tp>(it)\n{}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>& MatIterator_<_Tp>::operator = (const MatIterator_<_Tp>& it )\n{\n    MatConstIterator::operator = (it);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\n_Tp& MatIterator_<_Tp>::operator *() const\n{\n    return *(_Tp*)(this->ptr);\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>& MatIterator_<_Tp>::operator += (ptrdiff_t ofs)\n{\n    MatConstIterator::operator += (ofs);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>& MatIterator_<_Tp>::operator -= (ptrdiff_t ofs)\n{\n    MatConstIterator::operator += (-ofs);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>& MatIterator_<_Tp>::operator --()\n{\n    MatConstIterator::operator --();\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp> MatIterator_<_Tp>::operator --(int)\n{\n    MatIterator_ b = *this;\n    MatConstIterator::operator --();\n    return b;\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp>& MatIterator_<_Tp>::operator ++()\n{\n    MatConstIterator::operator ++();\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMatIterator_<_Tp> MatIterator_<_Tp>::operator ++(int)\n{\n    MatIterator_ b = *this;\n    MatConstIterator::operator ++();\n    return b;\n}\n\ntemplate<typename _Tp> inline\n_Tp& MatIterator_<_Tp>::operator [](ptrdiff_t i) const\n{\n    return *(*this + i);\n}\n\n\ntemplate<typename _Tp> static inline\nbool operator == (const MatIterator_<_Tp>& a, const MatIterator_<_Tp>& b)\n{\n    return a.m == b.m && a.ptr == b.ptr;\n}\n\ntemplate<typename _Tp> static inline\nbool operator != (const MatIterator_<_Tp>& a, const MatIterator_<_Tp>& b)\n{\n    return a.m != b.m || a.ptr != b.ptr;\n}\n\ntemplate<typename _Tp> static inline\nMatIterator_<_Tp> operator + (const MatIterator_<_Tp>& a, ptrdiff_t ofs)\n{\n    MatConstIterator t = (const MatConstIterator&)a + ofs;\n    return (MatIterator_<_Tp>&)t;\n}\n\ntemplate<typename _Tp> static inline\nMatIterator_<_Tp> operator + (ptrdiff_t ofs, const MatIterator_<_Tp>& a)\n{\n    MatConstIterator t = (const MatConstIterator&)a + ofs;\n    return (MatIterator_<_Tp>&)t;\n}\n\ntemplate<typename _Tp> static inline\nMatIterator_<_Tp> operator - (const MatIterator_<_Tp>& a, ptrdiff_t ofs)\n{\n    MatConstIterator t = (const MatConstIterator&)a - ofs;\n    return (MatIterator_<_Tp>&)t;\n}\n\n\n\n/////////////////////// SparseMatConstIterator //////////////////////\n\ninline\nSparseMatConstIterator::SparseMatConstIterator()\n    : m(0), hashidx(0), ptr(0)\n{}\n\ninline\nSparseMatConstIterator::SparseMatConstIterator(const SparseMatConstIterator& it)\n    : m(it.m), hashidx(it.hashidx), ptr(it.ptr)\n{}\n\ninline SparseMatConstIterator& SparseMatConstIterator::operator = (const SparseMatConstIterator& it)\n{\n    if( this != &it )\n    {\n        m = it.m;\n        hashidx = it.hashidx;\n        ptr = it.ptr;\n    }\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& SparseMatConstIterator::value() const\n{\n    return *(const _Tp*)ptr;\n}\n\ninline\nconst SparseMat::Node* SparseMatConstIterator::node() const\n{\n    return (ptr && m && m->hdr) ? (const SparseMat::Node*)(const void*)(ptr - m->hdr->valueOffset) : 0;\n}\n\ninline\nSparseMatConstIterator SparseMatConstIterator::operator ++(int)\n{\n    SparseMatConstIterator it = *this;\n    ++*this;\n    return it;\n}\n\ninline\nvoid SparseMatConstIterator::seekEnd()\n{\n    if( m && m->hdr )\n    {\n        hashidx = m->hdr->hashtab.size();\n        ptr = 0;\n    }\n}\n\n\nstatic inline\nbool operator == (const SparseMatConstIterator& it1, const SparseMatConstIterator& it2)\n{\n    return it1.m == it2.m && it1.ptr == it2.ptr;\n}\n\nstatic inline\nbool operator != (const SparseMatConstIterator& it1, const SparseMatConstIterator& it2)\n{\n    return !(it1 == it2);\n}\n\n\n\n///////////////////////// SparseMatIterator /////////////////////////\n\ninline\nSparseMatIterator::SparseMatIterator()\n{}\n\ninline\nSparseMatIterator::SparseMatIterator(SparseMat* _m)\n    : SparseMatConstIterator(_m)\n{}\n\ninline\nSparseMatIterator::SparseMatIterator(const SparseMatIterator& it)\n    : SparseMatConstIterator(it)\n{}\n\ninline\nSparseMatIterator& SparseMatIterator::operator = (const SparseMatIterator& it)\n{\n    (SparseMatConstIterator&)*this = it;\n    return *this;\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMatIterator::value() const\n{\n    return *(_Tp*)ptr;\n}\n\ninline\nSparseMat::Node* SparseMatIterator::node() const\n{\n    return (SparseMat::Node*)SparseMatConstIterator::node();\n}\n\ninline\nSparseMatIterator& SparseMatIterator::operator ++()\n{\n    SparseMatConstIterator::operator ++();\n    return *this;\n}\n\ninline\nSparseMatIterator SparseMatIterator::operator ++(int)\n{\n    SparseMatIterator it = *this;\n    ++*this;\n    return it;\n}\n\n\n\n////////////////////// SparseMatConstIterator_ //////////////////////\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp>::SparseMatConstIterator_()\n{}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMat_<_Tp>* _m)\n    : SparseMatConstIterator(_m)\n{}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMat* _m)\n    : SparseMatConstIterator(_m)\n{\n    CV_Assert( _m->type() == traits::Type<_Tp>::value );\n}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMatConstIterator_<_Tp>& it)\n    : SparseMatConstIterator(it)\n{}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp>& SparseMatConstIterator_<_Tp>::operator = (const SparseMatConstIterator_<_Tp>& it)\n{\n    return reinterpret_cast<SparseMatConstIterator_<_Tp>&>\n         (*reinterpret_cast<SparseMatConstIterator*>(this) =\n           reinterpret_cast<const SparseMatConstIterator&>(it));\n}\n\ntemplate<typename _Tp> inline\nconst _Tp& SparseMatConstIterator_<_Tp>::operator *() const\n{\n    return *(const _Tp*)this->ptr;\n}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp>& SparseMatConstIterator_<_Tp>::operator ++()\n{\n    SparseMatConstIterator::operator ++();\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nSparseMatConstIterator_<_Tp> SparseMatConstIterator_<_Tp>::operator ++(int)\n{\n    SparseMatConstIterator_<_Tp> it = *this;\n    SparseMatConstIterator::operator ++();\n    return it;\n}\n\n\n\n///////////////////////// SparseMatIterator_ ////////////////////////\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp>::SparseMatIterator_()\n{}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp>::SparseMatIterator_(SparseMat_<_Tp>* _m)\n    : SparseMatConstIterator_<_Tp>(_m)\n{}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp>::SparseMatIterator_(SparseMat* _m)\n    : SparseMatConstIterator_<_Tp>(_m)\n{}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp>::SparseMatIterator_(const SparseMatIterator_<_Tp>& it)\n    : SparseMatConstIterator_<_Tp>(it)\n{}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp>& SparseMatIterator_<_Tp>::operator = (const SparseMatIterator_<_Tp>& it)\n{\n    return reinterpret_cast<SparseMatIterator_<_Tp>&>\n         (*reinterpret_cast<SparseMatConstIterator*>(this) =\n           reinterpret_cast<const SparseMatConstIterator&>(it));\n}\n\ntemplate<typename _Tp> inline\n_Tp& SparseMatIterator_<_Tp>::operator *() const\n{\n    return *(_Tp*)this->ptr;\n}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp>& SparseMatIterator_<_Tp>::operator ++()\n{\n    SparseMatConstIterator::operator ++();\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nSparseMatIterator_<_Tp> SparseMatIterator_<_Tp>::operator ++(int)\n{\n    SparseMatIterator_<_Tp> it = *this;\n    SparseMatConstIterator::operator ++();\n    return it;\n}\n\n\n\n//////////////////////// MatCommaInitializer_ ///////////////////////\n\ntemplate<typename _Tp> inline\nMatCommaInitializer_<_Tp>::MatCommaInitializer_(Mat_<_Tp>* _m)\n    : it(_m)\n{}\n\ntemplate<typename _Tp> template<typename T2> inline\nMatCommaInitializer_<_Tp>& MatCommaInitializer_<_Tp>::operator , (T2 v)\n{\n    CV_DbgAssert( this->it < ((const Mat_<_Tp>*)this->it.m)->end() );\n    *this->it = _Tp(v);\n    ++this->it;\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMatCommaInitializer_<_Tp>::operator Mat_<_Tp>() const\n{\n    CV_DbgAssert( this->it == ((const Mat_<_Tp>*)this->it.m)->end() );\n    return Mat_<_Tp>(*this->it.m);\n}\n\n\ntemplate<typename _Tp, typename T2> static inline\nMatCommaInitializer_<_Tp> operator << (const Mat_<_Tp>& m, T2 val)\n{\n    MatCommaInitializer_<_Tp> commaInitializer((Mat_<_Tp>*)&m);\n    return (commaInitializer, val);\n}\n\n\n\n///////////////////////// Matrix Expressions ////////////////////////\n\ninline\nMat& Mat::operator = (const MatExpr& e)\n{\n    e.op->assign(e, *this);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>::Mat_(const MatExpr& e)\n{\n    e.op->assign(e, *this, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nMat_<_Tp>& Mat_<_Tp>::operator = (const MatExpr& e)\n{\n    e.op->assign(e, *this, traits::Type<_Tp>::value);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nMatExpr Mat_<_Tp>::zeros(int rows, int cols)\n{\n    return Mat::zeros(rows, cols, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nMatExpr Mat_<_Tp>::zeros(Size sz)\n{\n    return Mat::zeros(sz, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nMatExpr Mat_<_Tp>::ones(int rows, int cols)\n{\n    return Mat::ones(rows, cols, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nMatExpr Mat_<_Tp>::ones(Size sz)\n{\n    return Mat::ones(sz, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nMatExpr Mat_<_Tp>::eye(int rows, int cols)\n{\n    return Mat::eye(rows, cols, traits::Type<_Tp>::value);\n}\n\ntemplate<typename _Tp> inline\nMatExpr Mat_<_Tp>::eye(Size sz)\n{\n    return Mat::eye(sz, traits::Type<_Tp>::value);\n}\n\ninline\nMatExpr::MatExpr()\n    : op(0), flags(0), a(Mat()), b(Mat()), c(Mat()), alpha(0), beta(0), s()\n{}\n\ninline\nMatExpr::MatExpr(const MatOp* _op, int _flags, const Mat& _a, const Mat& _b,\n                 const Mat& _c, double _alpha, double _beta, const Scalar& _s)\n    : op(_op), flags(_flags), a(_a), b(_b), c(_c), alpha(_alpha), beta(_beta), s(_s)\n{}\n\ninline\nMatExpr::operator Mat() const\n{\n    Mat m;\n    op->assign(*this, m);\n    return m;\n}\n\ntemplate<typename _Tp> inline\nMatExpr::operator Mat_<_Tp>() const\n{\n    Mat_<_Tp> m;\n    op->assign(*this, m, traits::Type<_Tp>::value);\n    return m;\n}\n\n\ntemplate<typename _Tp> static inline\nMatExpr min(const Mat_<_Tp>& a, const Mat_<_Tp>& b)\n{\n    return cv::min((const Mat&)a, (const Mat&)b);\n}\n\ntemplate<typename _Tp> static inline\nMatExpr min(const Mat_<_Tp>& a, double s)\n{\n    return cv::min((const Mat&)a, s);\n}\n\ntemplate<typename _Tp> static inline\nMatExpr min(double s, const Mat_<_Tp>& a)\n{\n    return cv::min((const Mat&)a, s);\n}\n\ntemplate<typename _Tp> static inline\nMatExpr max(const Mat_<_Tp>& a, const Mat_<_Tp>& b)\n{\n    return cv::max((const Mat&)a, (const Mat&)b);\n}\n\ntemplate<typename _Tp> static inline\nMatExpr max(const Mat_<_Tp>& a, double s)\n{\n    return cv::max((const Mat&)a, s);\n}\n\ntemplate<typename _Tp> static inline\nMatExpr max(double s, const Mat_<_Tp>& a)\n{\n    return cv::max((const Mat&)a, s);\n}\n\ntemplate<typename _Tp> static inline\nMatExpr abs(const Mat_<_Tp>& m)\n{\n    return cv::abs((const Mat&)m);\n}\n\n\nstatic inline\nMat& operator += (Mat& a, const MatExpr& b)\n{\n    b.op->augAssignAdd(b, a);\n    return a;\n}\n\nstatic inline\nconst Mat& operator += (const Mat& a, const MatExpr& b)\n{\n    b.op->augAssignAdd(b, (Mat&)a);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nMat_<_Tp>& operator += (Mat_<_Tp>& a, const MatExpr& b)\n{\n    b.op->augAssignAdd(b, a);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nconst Mat_<_Tp>& operator += (const Mat_<_Tp>& a, const MatExpr& b)\n{\n    b.op->augAssignAdd(b, (Mat&)a);\n    return a;\n}\n\nstatic inline\nMat& operator -= (Mat& a, const MatExpr& b)\n{\n    b.op->augAssignSubtract(b, a);\n    return a;\n}\n\nstatic inline\nconst Mat& operator -= (const Mat& a, const MatExpr& b)\n{\n    b.op->augAssignSubtract(b, (Mat&)a);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nMat_<_Tp>& operator -= (Mat_<_Tp>& a, const MatExpr& b)\n{\n    b.op->augAssignSubtract(b, a);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nconst Mat_<_Tp>& operator -= (const Mat_<_Tp>& a, const MatExpr& b)\n{\n    b.op->augAssignSubtract(b, (Mat&)a);\n    return a;\n}\n\nstatic inline\nMat& operator *= (Mat& a, const MatExpr& b)\n{\n    b.op->augAssignMultiply(b, a);\n    return a;\n}\n\nstatic inline\nconst Mat& operator *= (const Mat& a, const MatExpr& b)\n{\n    b.op->augAssignMultiply(b, (Mat&)a);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nMat_<_Tp>& operator *= (Mat_<_Tp>& a, const MatExpr& b)\n{\n    b.op->augAssignMultiply(b, a);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nconst Mat_<_Tp>& operator *= (const Mat_<_Tp>& a, const MatExpr& b)\n{\n    b.op->augAssignMultiply(b, (Mat&)a);\n    return a;\n}\n\nstatic inline\nMat& operator /= (Mat& a, const MatExpr& b)\n{\n    b.op->augAssignDivide(b, a);\n    return a;\n}\n\nstatic inline\nconst Mat& operator /= (const Mat& a, const MatExpr& b)\n{\n    b.op->augAssignDivide(b, (Mat&)a);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nMat_<_Tp>& operator /= (Mat_<_Tp>& a, const MatExpr& b)\n{\n    b.op->augAssignDivide(b, a);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nconst Mat_<_Tp>& operator /= (const Mat_<_Tp>& a, const MatExpr& b)\n{\n    b.op->augAssignDivide(b, (Mat&)a);\n    return a;\n}\n\n\n//////////////////////////////// UMat ////////////////////////////////\n\ntemplate<typename _Tp> inline\nUMat::UMat(const std::vector<_Tp>& vec, bool copyData)\n: flags(MAGIC_VAL + traits::Type<_Tp>::value + CV_MAT_CONT_FLAG), dims(2), rows((int)vec.size()),\ncols(1), allocator(0), usageFlags(USAGE_DEFAULT), u(0), offset(0), size(&rows)\n{\n    if(vec.empty())\n        return;\n    if( !copyData )\n    {\n        // !!!TODO!!!\n        CV_Error(Error::StsNotImplemented, \"\");\n    }\n    else\n        Mat((int)vec.size(), 1, traits::Type<_Tp>::value, (uchar*)&vec[0]).copyTo(*this);\n}\n\ninline\nUMat UMat::row(int y) const\n{\n    return UMat(*this, Range(y, y + 1), Range::all());\n}\n\ninline\nUMat UMat::col(int x) const\n{\n    return UMat(*this, Range::all(), Range(x, x + 1));\n}\n\ninline\nUMat UMat::rowRange(int startrow, int endrow) const\n{\n    return UMat(*this, Range(startrow, endrow), Range::all());\n}\n\ninline\nUMat UMat::rowRange(const Range& r) const\n{\n    return UMat(*this, r, Range::all());\n}\n\ninline\nUMat UMat::colRange(int startcol, int endcol) const\n{\n    return UMat(*this, Range::all(), Range(startcol, endcol));\n}\n\ninline\nUMat UMat::colRange(const Range& r) const\n{\n    return UMat(*this, Range::all(), r);\n}\n\ninline\nUMat UMat::operator()( Range _rowRange, Range _colRange ) const\n{\n    return UMat(*this, _rowRange, _colRange);\n}\n\ninline\nUMat UMat::operator()( const Rect& roi ) const\n{\n    return UMat(*this, roi);\n}\n\ninline\nUMat UMat::operator()(const Range* ranges) const\n{\n    return UMat(*this, ranges);\n}\n\ninline\nUMat UMat::operator()(const std::vector<Range>& ranges) const\n{\n    return UMat(*this, ranges);\n}\n\ninline\nbool UMat::isContinuous() const\n{\n    return (flags & CONTINUOUS_FLAG) != 0;\n}\n\ninline\nbool UMat::isSubmatrix() const\n{\n    return (flags & SUBMATRIX_FLAG) != 0;\n}\n\ninline\nsize_t UMat::elemSize() const\n{\n    size_t res = dims > 0 ? step.p[dims - 1] : 0;\n    CV_DbgAssert(res != 0);\n    return res;\n}\n\ninline\nsize_t UMat::elemSize1() const\n{\n    return CV_ELEM_SIZE1(flags);\n}\n\ninline\nint UMat::type() const\n{\n    return CV_MAT_TYPE(flags);\n}\n\ninline\nint UMat::depth() const\n{\n    return CV_MAT_DEPTH(flags);\n}\n\ninline\nint UMat::channels() const\n{\n    return CV_MAT_CN(flags);\n}\n\ninline\nsize_t UMat::step1(int i) const\n{\n    return step.p[i] / elemSize1();\n}\n\n\ninline bool UMatData::hostCopyObsolete() const { return (flags & HOST_COPY_OBSOLETE) != 0; }\ninline bool UMatData::deviceCopyObsolete() const { return (flags & DEVICE_COPY_OBSOLETE) != 0; }\ninline bool UMatData::deviceMemMapped() const { return (flags & DEVICE_MEM_MAPPED) != 0; }\ninline bool UMatData::copyOnMap() const { return (flags & COPY_ON_MAP) != 0; }\ninline bool UMatData::tempUMat() const { return (flags & TEMP_UMAT) != 0; }\ninline bool UMatData::tempCopiedUMat() const { return (flags & TEMP_COPIED_UMAT) == TEMP_COPIED_UMAT; }\n\ninline void UMatData::markDeviceMemMapped(bool flag)\n{\n  if(flag)\n    flags |= DEVICE_MEM_MAPPED;\n  else\n    flags &= ~DEVICE_MEM_MAPPED;\n}\n\ninline void UMatData::markHostCopyObsolete(bool flag)\n{\n    if(flag)\n        flags |= HOST_COPY_OBSOLETE;\n    else\n        flags &= ~HOST_COPY_OBSOLETE;\n}\ninline void UMatData::markDeviceCopyObsolete(bool flag)\n{\n    if(flag)\n        flags |= DEVICE_COPY_OBSOLETE;\n    else\n        flags &= ~DEVICE_COPY_OBSOLETE;\n}\n\n//! @endcond\n\nstatic inline\nvoid swap(MatExpr& a, MatExpr& b) { a.swap(b); }\n\n} //cv\n\n#ifdef _MSC_VER\n#pragma warning( pop )\n#endif\n\n#ifdef CV_DISABLE_CLANG_ENUM_WARNINGS\n#undef CV_DISABLE_CLANG_ENUM_WARNINGS\n#pragma clang diagnostic pop\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/matx.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_MATX_HPP\n#define OPENCV_CORE_MATX_HPP\n\n#ifndef __cplusplus\n#  error matx.hpp header must be compiled as C++\n#endif\n\n#include \"opencv2/core/cvdef.h\"\n#include \"opencv2/core/base.hpp\"\n#include \"opencv2/core/traits.hpp\"\n#include \"opencv2/core/saturate.hpp\"\n\n#include <initializer_list>\n\nnamespace cv\n{\n\n//! @addtogroup core_basic\n//! @{\n\n////////////////////////////// Small Matrix ///////////////////////////\n\n//! @cond IGNORED\n// FIXIT Remove this (especially CV_EXPORTS modifier)\nstruct CV_EXPORTS Matx_AddOp { Matx_AddOp() {} Matx_AddOp(const Matx_AddOp&) {} };\nstruct CV_EXPORTS Matx_SubOp { Matx_SubOp() {} Matx_SubOp(const Matx_SubOp&) {} };\nstruct CV_EXPORTS Matx_ScaleOp { Matx_ScaleOp() {} Matx_ScaleOp(const Matx_ScaleOp&) {} };\nstruct CV_EXPORTS Matx_MulOp { Matx_MulOp() {} Matx_MulOp(const Matx_MulOp&) {} };\nstruct CV_EXPORTS Matx_DivOp { Matx_DivOp() {} Matx_DivOp(const Matx_DivOp&) {} };\nstruct CV_EXPORTS Matx_MatMulOp { Matx_MatMulOp() {} Matx_MatMulOp(const Matx_MatMulOp&) {} };\nstruct CV_EXPORTS Matx_TOp { Matx_TOp() {} Matx_TOp(const Matx_TOp&) {} };\n//! @endcond\n\n/** @brief Template class for small matrices whose type and size are known at compilation time\n\nIf you need a more flexible type, use Mat . The elements of the matrix M are accessible using the\nM(i,j) notation. Most of the common matrix operations (see also @ref MatrixExpressions ) are\navailable. To do an operation on Matx that is not implemented, you can easily convert the matrix to\nMat and backwards:\n@code{.cpp}\n    Matx33f m(1, 2, 3,\n              4, 5, 6,\n              7, 8, 9);\n    cout << sum(Mat(m*m.t())) << endl;\n@endcode\nExcept of the plain constructor which takes a list of elements, Matx can be initialized from a C-array:\n@code{.cpp}\n    float values[] = { 1, 2, 3};\n    Matx31f m(values);\n@endcode\nIn case if C++11 features are available, std::initializer_list can be also used to initialize Matx:\n@code{.cpp}\n    Matx31f m = { 1, 2, 3};\n@endcode\n */\ntemplate<typename _Tp, int m, int n> class Matx\n{\npublic:\n    enum {\n           rows     = m,\n           cols     = n,\n           channels = rows*cols,\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           depth    = traits::Type<_Tp>::value,\n           type     = CV_MAKETYPE(depth, channels),\n#endif\n           shortdim = (m < n ? m : n)\n         };\n\n    typedef _Tp                           value_type;\n    typedef Matx<_Tp, m, n>               mat_type;\n    typedef Matx<_Tp, shortdim, 1> diag_type;\n\n    //! default constructor\n    Matx();\n\n    explicit Matx(_Tp v0); //!< 1x1 matrix\n    Matx(_Tp v0, _Tp v1); //!< 1x2 or 2x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2); //!< 1x3 or 3x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3); //!< 1x4, 2x2 or 4x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4); //!< 1x5 or 5x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5); //!< 1x6, 2x3, 3x2 or 6x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6); //!< 1x7 or 7x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7); //!< 1x8, 2x4, 4x2 or 8x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8); //!< 1x9, 3x3 or 9x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9); //!< 1x10, 2x5 or 5x2 or 10x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,\n         _Tp v4, _Tp v5, _Tp v6, _Tp v7,\n         _Tp v8, _Tp v9, _Tp v10, _Tp v11); //!< 1x12, 2x6, 3x4, 4x3, 6x2 or 12x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,\n         _Tp v4, _Tp v5, _Tp v6, _Tp v7,\n         _Tp v8, _Tp v9, _Tp v10, _Tp v11,\n         _Tp v12, _Tp v13); //!< 1x14, 2x7, 7x2 or 14x1 matrix\n    Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,\n         _Tp v4, _Tp v5, _Tp v6, _Tp v7,\n         _Tp v8, _Tp v9, _Tp v10, _Tp v11,\n         _Tp v12, _Tp v13, _Tp v14, _Tp v15); //!< 1x16, 4x4 or 16x1 matrix\n    explicit Matx(const _Tp* vals); //!< initialize from a plain array\n\n    Matx(std::initializer_list<_Tp>); //!< initialize from an initializer list\n\n    static Matx all(_Tp alpha);\n    static Matx zeros();\n    static Matx ones();\n    static Matx eye();\n    static Matx diag(const diag_type& d);\n    /** @brief Generates uniformly distributed random numbers\n    @param a Range boundary.\n    @param b The other range boundary (boundaries don't have to be ordered, the lower boundary is inclusive,\n    the upper one is exclusive).\n     */\n    static Matx randu(_Tp a, _Tp b);\n    /** @brief Generates normally distributed random numbers\n    @param a Mean value.\n    @param b Standard deviation.\n     */\n    static Matx randn(_Tp a, _Tp b);\n\n    //! dot product computed with the default precision\n    _Tp dot(const Matx<_Tp, m, n>& v) const;\n\n    //! dot product computed in double-precision arithmetics\n    double ddot(const Matx<_Tp, m, n>& v) const;\n\n    //! conversion to another data type\n    template<typename T2> operator Matx<T2, m, n>() const;\n\n    //! change the matrix shape\n    template<int m1, int n1> Matx<_Tp, m1, n1> reshape() const;\n\n    //! extract part of the matrix\n    template<int m1, int n1> Matx<_Tp, m1, n1> get_minor(int base_row, int base_col) const;\n\n    //! extract the matrix row\n    Matx<_Tp, 1, n> row(int i) const;\n\n    //! extract the matrix column\n    Matx<_Tp, m, 1> col(int i) const;\n\n    //! extract the matrix diagonal\n    diag_type diag() const;\n\n    //! transpose the matrix\n    Matx<_Tp, n, m> t() const;\n\n    //! invert the matrix\n    Matx<_Tp, n, m> inv(int method=DECOMP_LU, bool *p_is_ok = NULL) const;\n\n    //! solve linear system\n    template<int l> Matx<_Tp, n, l> solve(const Matx<_Tp, m, l>& rhs, int flags=DECOMP_LU) const;\n    Vec<_Tp, n> solve(const Vec<_Tp, m>& rhs, int method) const;\n\n    //! multiply two matrices element-wise\n    Matx<_Tp, m, n> mul(const Matx<_Tp, m, n>& a) const;\n\n    //! divide two matrices element-wise\n    Matx<_Tp, m, n> div(const Matx<_Tp, m, n>& a) const;\n\n    //! element access\n    const _Tp& operator ()(int row, int col) const;\n    _Tp& operator ()(int row, int col);\n\n    //! 1D element access\n    const _Tp& operator ()(int i) const;\n    _Tp& operator ()(int i);\n\n    Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_AddOp);\n    Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_SubOp);\n    template<typename _T2> Matx(const Matx<_Tp, m, n>& a, _T2 alpha, Matx_ScaleOp);\n    Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_MulOp);\n    Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_DivOp);\n    template<int l> Matx(const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b, Matx_MatMulOp);\n    Matx(const Matx<_Tp, n, m>& a, Matx_TOp);\n\n    _Tp val[m*n]; //< matrix elements\n};\n\ntypedef Matx<float, 1, 2> Matx12f;\ntypedef Matx<double, 1, 2> Matx12d;\ntypedef Matx<float, 1, 3> Matx13f;\ntypedef Matx<double, 1, 3> Matx13d;\ntypedef Matx<float, 1, 4> Matx14f;\ntypedef Matx<double, 1, 4> Matx14d;\ntypedef Matx<float, 1, 6> Matx16f;\ntypedef Matx<double, 1, 6> Matx16d;\n\ntypedef Matx<float, 2, 1> Matx21f;\ntypedef Matx<double, 2, 1> Matx21d;\ntypedef Matx<float, 3, 1> Matx31f;\ntypedef Matx<double, 3, 1> Matx31d;\ntypedef Matx<float, 4, 1> Matx41f;\ntypedef Matx<double, 4, 1> Matx41d;\ntypedef Matx<float, 6, 1> Matx61f;\ntypedef Matx<double, 6, 1> Matx61d;\n\ntypedef Matx<float, 2, 2> Matx22f;\ntypedef Matx<double, 2, 2> Matx22d;\ntypedef Matx<float, 2, 3> Matx23f;\ntypedef Matx<double, 2, 3> Matx23d;\ntypedef Matx<float, 3, 2> Matx32f;\ntypedef Matx<double, 3, 2> Matx32d;\n\ntypedef Matx<float, 3, 3> Matx33f;\ntypedef Matx<double, 3, 3> Matx33d;\n\ntypedef Matx<float, 3, 4> Matx34f;\ntypedef Matx<double, 3, 4> Matx34d;\ntypedef Matx<float, 4, 3> Matx43f;\ntypedef Matx<double, 4, 3> Matx43d;\n\ntypedef Matx<float, 4, 4> Matx44f;\ntypedef Matx<double, 4, 4> Matx44d;\ntypedef Matx<float, 6, 6> Matx66f;\ntypedef Matx<double, 6, 6> Matx66d;\n\n/*!\n  traits\n*/\ntemplate<typename _Tp, int m, int n> class DataType< Matx<_Tp, m, n> >\n{\npublic:\n    typedef Matx<_Tp, m, n>                               value_type;\n    typedef Matx<typename DataType<_Tp>::work_type, m, n> work_type;\n    typedef _Tp                                           channel_type;\n    typedef value_type                                    vec_type;\n\n    enum { generic_type = 0,\n           channels     = m * n,\n           fmt          = traits::SafeFmt<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n         };\n};\n\nnamespace traits {\ntemplate<typename _Tp, int m, int n>\nstruct Depth< Matx<_Tp, m, n> > { enum { value = Depth<_Tp>::value }; };\ntemplate<typename _Tp, int m, int n>\nstruct Type< Matx<_Tp, m, n> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, n*m) }; };\n} // namespace\n\n\n/** @brief  Comma-separated Matrix Initializer\n*/\ntemplate<typename _Tp, int m, int n> class MatxCommaInitializer\n{\npublic:\n    MatxCommaInitializer(Matx<_Tp, m, n>* _mtx);\n    template<typename T2> MatxCommaInitializer<_Tp, m, n>& operator , (T2 val);\n    Matx<_Tp, m, n> operator *() const;\n\n    Matx<_Tp, m, n>* dst;\n    int idx;\n};\n\n/*\n Utility methods\n*/\ntemplate<typename _Tp, int m> static double determinant(const Matx<_Tp, m, m>& a);\ntemplate<typename _Tp, int m, int n> static double trace(const Matx<_Tp, m, n>& a);\ntemplate<typename _Tp, int m, int n> static double norm(const Matx<_Tp, m, n>& M);\ntemplate<typename _Tp, int m, int n> static double norm(const Matx<_Tp, m, n>& M, int normType);\n\n\n\n/////////////////////// Vec (used as element of multi-channel images /////////////////////\n\n/** @brief Template class for short numerical vectors, a partial case of Matx\n\nThis template class represents short numerical vectors (of 1, 2, 3, 4 ... elements) on which you\ncan perform basic arithmetical operations, access individual elements using [] operator etc. The\nvectors are allocated on stack, as opposite to std::valarray, std::vector, cv::Mat etc., which\nelements are dynamically allocated in the heap.\n\nThe template takes 2 parameters:\n@tparam _Tp element type\n@tparam cn the number of elements\n\nIn addition to the universal notation like Vec<float, 3>, you can use shorter aliases\nfor the most popular specialized variants of Vec, e.g. Vec3f ~ Vec<float, 3>.\n\nIt is possible to convert Vec\\<T,2\\> to/from Point_, Vec\\<T,3\\> to/from Point3_ , and Vec\\<T,4\\>\nto CvScalar or Scalar_. Use operator[] to access the elements of Vec.\n\nAll the expected vector operations are also implemented:\n-   v1 = v2 + v3\n-   v1 = v2 - v3\n-   v1 = v2 \\* scale\n-   v1 = scale \\* v2\n-   v1 = -v2\n-   v1 += v2 and other augmenting operations\n-   v1 == v2, v1 != v2\n-   norm(v1) (euclidean norm)\nThe Vec class is commonly used to describe pixel types of multi-channel arrays. See Mat for details.\n*/\ntemplate<typename _Tp, int cn> class Vec : public Matx<_Tp, cn, 1>\n{\npublic:\n    typedef _Tp value_type;\n    enum {\n           channels = cn,\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           depth    = Matx<_Tp, cn, 1>::depth,\n           type     = CV_MAKETYPE(depth, channels),\n#endif\n           _dummy_enum_finalizer = 0\n         };\n\n    //! default constructor\n    Vec();\n\n    Vec(_Tp v0); //!< 1-element vector constructor\n    Vec(_Tp v0, _Tp v1); //!< 2-element vector constructor\n    Vec(_Tp v0, _Tp v1, _Tp v2); //!< 3-element vector constructor\n    Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3); //!< 4-element vector constructor\n    Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4); //!< 5-element vector constructor\n    Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5); //!< 6-element vector constructor\n    Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6); //!< 7-element vector constructor\n    Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7); //!< 8-element vector constructor\n    Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8); //!< 9-element vector constructor\n    Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9); //!< 10-element vector constructor\n    Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13); //!< 14-element vector constructor\n    explicit Vec(const _Tp* values);\n\n    Vec(std::initializer_list<_Tp>);\n\n    Vec(const Vec<_Tp, cn>& v);\n\n    static Vec all(_Tp alpha);\n\n    //! per-element multiplication\n    Vec mul(const Vec<_Tp, cn>& v) const;\n\n    //! conjugation (makes sense for complex numbers and quaternions)\n    Vec conj() const;\n\n    /*!\n      cross product of the two 3D vectors.\n\n      For other dimensionalities the exception is raised\n    */\n    Vec cross(const Vec& v) const;\n    //! conversion to another data type\n    template<typename T2> operator Vec<T2, cn>() const;\n\n    /*! element access */\n    const _Tp& operator [](int i) const;\n    _Tp& operator[](int i);\n    const _Tp& operator ()(int i) const;\n    _Tp& operator ()(int i);\n\n#ifdef CV_CXX11\n    Vec<_Tp, cn>& operator=(const Vec<_Tp, cn>& rhs) = default;\n#endif\n\n    Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_AddOp);\n    Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_SubOp);\n    template<typename _T2> Vec(const Matx<_Tp, cn, 1>& a, _T2 alpha, Matx_ScaleOp);\n};\n\n/** @name Shorter aliases for the most popular specializations of Vec<T,n>\n  @{\n*/\ntypedef Vec<uchar, 2> Vec2b;\ntypedef Vec<uchar, 3> Vec3b;\ntypedef Vec<uchar, 4> Vec4b;\n\ntypedef Vec<short, 2> Vec2s;\ntypedef Vec<short, 3> Vec3s;\ntypedef Vec<short, 4> Vec4s;\n\ntypedef Vec<ushort, 2> Vec2w;\ntypedef Vec<ushort, 3> Vec3w;\ntypedef Vec<ushort, 4> Vec4w;\n\ntypedef Vec<int, 2> Vec2i;\ntypedef Vec<int, 3> Vec3i;\ntypedef Vec<int, 4> Vec4i;\ntypedef Vec<int, 6> Vec6i;\ntypedef Vec<int, 8> Vec8i;\n\ntypedef Vec<float, 2> Vec2f;\ntypedef Vec<float, 3> Vec3f;\ntypedef Vec<float, 4> Vec4f;\ntypedef Vec<float, 6> Vec6f;\n\ntypedef Vec<double, 2> Vec2d;\ntypedef Vec<double, 3> Vec3d;\ntypedef Vec<double, 4> Vec4d;\ntypedef Vec<double, 6> Vec6d;\n/** @} */\n\n/*!\n  traits\n*/\ntemplate<typename _Tp, int cn> class DataType< Vec<_Tp, cn> >\n{\npublic:\n    typedef Vec<_Tp, cn>                               value_type;\n    typedef Vec<typename DataType<_Tp>::work_type, cn> work_type;\n    typedef _Tp                                        channel_type;\n    typedef value_type                                 vec_type;\n\n    enum { generic_type = 0,\n           channels     = cn,\n           fmt          = DataType<channel_type>::fmt + ((channels - 1) << 8),\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           depth        = DataType<channel_type>::depth,\n           type         = CV_MAKETYPE(depth, channels),\n#endif\n           _dummy_enum_finalizer = 0\n         };\n};\n\nnamespace traits {\ntemplate<typename _Tp, int cn>\nstruct Depth< Vec<_Tp, cn> > { enum { value = Depth<_Tp>::value }; };\ntemplate<typename _Tp, int cn>\nstruct Type< Vec<_Tp, cn> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, cn) }; };\n} // namespace\n\n\n/** @brief  Comma-separated Vec Initializer\n*/\ntemplate<typename _Tp, int m> class VecCommaInitializer : public MatxCommaInitializer<_Tp, m, 1>\n{\npublic:\n    VecCommaInitializer(Vec<_Tp, m>* _vec);\n    template<typename T2> VecCommaInitializer<_Tp, m>& operator , (T2 val);\n    Vec<_Tp, m> operator *() const;\n};\n\ntemplate<typename _Tp, int cn> static Vec<_Tp, cn> normalize(const Vec<_Tp, cn>& v);\n\n//! @} core_basic\n\n//! @cond IGNORED\n\n///////////////////////////////////// helper classes /////////////////////////////////////\nnamespace internal\n{\n\ntemplate<typename _Tp, int m> struct Matx_DetOp\n{\n    double operator ()(const Matx<_Tp, m, m>& a) const\n    {\n        Matx<_Tp, m, m> temp = a;\n        double p = LU(temp.val, m*sizeof(_Tp), m, 0, 0, 0);\n        if( p == 0 )\n            return p;\n        for( int i = 0; i < m; i++ )\n            p *= temp(i, i);\n        return p;\n    }\n};\n\ntemplate<typename _Tp> struct Matx_DetOp<_Tp, 1>\n{\n    double operator ()(const Matx<_Tp, 1, 1>& a) const\n    {\n        return a(0,0);\n    }\n};\n\ntemplate<typename _Tp> struct Matx_DetOp<_Tp, 2>\n{\n    double operator ()(const Matx<_Tp, 2, 2>& a) const\n    {\n        return a(0,0)*a(1,1) - a(0,1)*a(1,0);\n    }\n};\n\ntemplate<typename _Tp> struct Matx_DetOp<_Tp, 3>\n{\n    double operator ()(const Matx<_Tp, 3, 3>& a) const\n    {\n        return a(0,0)*(a(1,1)*a(2,2) - a(2,1)*a(1,2)) -\n            a(0,1)*(a(1,0)*a(2,2) - a(2,0)*a(1,2)) +\n            a(0,2)*(a(1,0)*a(2,1) - a(2,0)*a(1,1));\n    }\n};\n\ntemplate<typename _Tp> Vec<_Tp, 2> inline conjugate(const Vec<_Tp, 2>& v)\n{\n    return Vec<_Tp, 2>(v[0], -v[1]);\n}\n\ntemplate<typename _Tp> Vec<_Tp, 4> inline conjugate(const Vec<_Tp, 4>& v)\n{\n    return Vec<_Tp, 4>(v[0], -v[1], -v[2], -v[3]);\n}\n\n} // internal\n\n\n\n////////////////////////////////// Matx Implementation ///////////////////////////////////\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx()\n{\n    for(int i = 0; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0)\n{\n    val[0] = v0;\n    for(int i = 1; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0, _Tp v1)\n{\n    CV_StaticAssert(channels >= 2, \"Matx should have at least 2 elements.\");\n    val[0] = v0; val[1] = v1;\n    for(int i = 2; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2)\n{\n    CV_StaticAssert(channels >= 3, \"Matx should have at least 3 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2;\n    for(int i = 3; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3)\n{\n    CV_StaticAssert(channels >= 4, \"Matx should have at least 4 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;\n    for(int i = 4; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4)\n{\n    CV_StaticAssert(channels >= 5, \"Matx should have at least 5 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; val[4] = v4;\n    for(int i = 5; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5)\n{\n    CV_StaticAssert(channels >= 6, \"Matx should have at least 6 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;\n    val[4] = v4; val[5] = v5;\n    for(int i = 6; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6)\n{\n    CV_StaticAssert(channels >= 7, \"Matx should have at least 7 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;\n    val[4] = v4; val[5] = v5; val[6] = v6;\n    for(int i = 7; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7)\n{\n    CV_StaticAssert(channels >= 8, \"Matx should have at least 8 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;\n    val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;\n    for(int i = 8; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8)\n{\n    CV_StaticAssert(channels >= 9, \"Matx should have at least 9 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;\n    val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;\n    val[8] = v8;\n    for(int i = 9; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9)\n{\n    CV_StaticAssert(channels >= 10, \"Matx should have at least 10 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;\n    val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;\n    val[8] = v8; val[9] = v9;\n    for(int i = 10; i < channels; i++) val[i] = _Tp(0);\n}\n\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11)\n{\n    CV_StaticAssert(channels >= 12, \"Matx should have at least 12 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;\n    val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;\n    val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11;\n    for(int i = 12; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13)\n{\n    CV_StaticAssert(channels >= 14, \"Matx should have at least 14 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;\n    val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;\n    val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11;\n    val[12] = v12; val[13] = v13;\n    for (int i = 14; i < channels; i++) val[i] = _Tp(0);\n}\n\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13, _Tp v14, _Tp v15)\n{\n    CV_StaticAssert(channels >= 16, \"Matx should have at least 16 elements.\");\n    val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3;\n    val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7;\n    val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11;\n    val[12] = v12; val[13] = v13; val[14] = v14; val[15] = v15;\n    for(int i = 16; i < channels; i++) val[i] = _Tp(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(const _Tp* values)\n{\n    for( int i = 0; i < channels; i++ ) val[i] = values[i];\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n>::Matx(std::initializer_list<_Tp> list)\n{\n    CV_DbgAssert(list.size() == channels);\n    int i = 0;\n    for(const auto& elem : list)\n    {\n        val[i++] = elem;\n    }\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n> Matx<_Tp, m, n>::all(_Tp alpha)\n{\n    Matx<_Tp, m, n> M;\n    for( int i = 0; i < m*n; i++ ) M.val[i] = alpha;\n    return M;\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n> Matx<_Tp,m,n>::zeros()\n{\n    return all(0);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n> Matx<_Tp,m,n>::ones()\n{\n    return all(1);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n> Matx<_Tp,m,n>::eye()\n{\n    Matx<_Tp,m,n> M;\n    for(int i = 0; i < shortdim; i++)\n        M(i,i) = 1;\n    return M;\n}\n\ntemplate<typename _Tp, int m, int n> inline\n_Tp Matx<_Tp, m, n>::dot(const Matx<_Tp, m, n>& M) const\n{\n    _Tp s = 0;\n    for( int i = 0; i < channels; i++ ) s += val[i]*M.val[i];\n    return s;\n}\n\ntemplate<typename _Tp, int m, int n> inline\ndouble Matx<_Tp, m, n>::ddot(const Matx<_Tp, m, n>& M) const\n{\n    double s = 0;\n    for( int i = 0; i < channels; i++ ) s += (double)val[i]*M.val[i];\n    return s;\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n> Matx<_Tp,m,n>::diag(const typename Matx<_Tp,m,n>::diag_type& d)\n{\n    Matx<_Tp,m,n> M;\n    for(int i = 0; i < shortdim; i++)\n        M(i,i) = d(i, 0);\n    return M;\n}\n\ntemplate<typename _Tp, int m, int n> template<typename T2>\ninline Matx<_Tp, m, n>::operator Matx<T2, m, n>() const\n{\n    Matx<T2, m, n> M;\n    for( int i = 0; i < m*n; i++ ) M.val[i] = saturate_cast<T2>(val[i]);\n    return M;\n}\n\ntemplate<typename _Tp, int m, int n> template<int m1, int n1> inline\nMatx<_Tp, m1, n1> Matx<_Tp, m, n>::reshape() const\n{\n    CV_StaticAssert(m1*n1 == m*n, \"Input and destnarion matrices must have the same number of elements\");\n    return (const Matx<_Tp, m1, n1>&)*this;\n}\n\ntemplate<typename _Tp, int m, int n>\ntemplate<int m1, int n1> inline\nMatx<_Tp, m1, n1> Matx<_Tp, m, n>::get_minor(int base_row, int base_col) const\n{\n    CV_DbgAssert(0 <= base_row && base_row+m1 <= m && 0 <= base_col && base_col+n1 <= n);\n    Matx<_Tp, m1, n1> s;\n    for( int di = 0; di < m1; di++ )\n        for( int dj = 0; dj < n1; dj++ )\n            s(di, dj) = (*this)(base_row+di, base_col+dj);\n    return s;\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, 1, n> Matx<_Tp, m, n>::row(int i) const\n{\n    CV_DbgAssert((unsigned)i < (unsigned)m);\n    return Matx<_Tp, 1, n>(&val[i*n]);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, 1> Matx<_Tp, m, n>::col(int j) const\n{\n    CV_DbgAssert((unsigned)j < (unsigned)n);\n    Matx<_Tp, m, 1> v;\n    for( int i = 0; i < m; i++ )\n        v.val[i] = val[i*n + j];\n    return v;\n}\n\ntemplate<typename _Tp, int m, int n> inline\ntypename Matx<_Tp, m, n>::diag_type Matx<_Tp, m, n>::diag() const\n{\n    diag_type d;\n    for( int i = 0; i < shortdim; i++ )\n        d.val[i] = val[i*n + i];\n    return d;\n}\n\ntemplate<typename _Tp, int m, int n> inline\nconst _Tp& Matx<_Tp, m, n>::operator()(int row_idx, int col_idx) const\n{\n    CV_DbgAssert( (unsigned)row_idx < (unsigned)m && (unsigned)col_idx < (unsigned)n );\n    return this->val[row_idx*n + col_idx];\n}\n\ntemplate<typename _Tp, int m, int n> inline\n_Tp& Matx<_Tp, m, n>::operator ()(int row_idx, int col_idx)\n{\n    CV_DbgAssert( (unsigned)row_idx < (unsigned)m && (unsigned)col_idx < (unsigned)n );\n    return val[row_idx*n + col_idx];\n}\n\ntemplate<typename _Tp, int m, int n> inline\nconst _Tp& Matx<_Tp, m, n>::operator ()(int i) const\n{\n    CV_StaticAssert(m == 1 || n == 1, \"Single index indexation requires matrix to be a column or a row\");\n    CV_DbgAssert( (unsigned)i < (unsigned)(m+n-1) );\n    return val[i];\n}\n\ntemplate<typename _Tp, int m, int n> inline\n_Tp& Matx<_Tp, m, n>::operator ()(int i)\n{\n    CV_StaticAssert(m == 1 || n == 1, \"Single index indexation requires matrix to be a column or a row\");\n    CV_DbgAssert( (unsigned)i < (unsigned)(m+n-1) );\n    return val[i];\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_AddOp)\n{\n    for( int i = 0; i < channels; i++ )\n        val[i] = saturate_cast<_Tp>(a.val[i] + b.val[i]);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_SubOp)\n{\n    for( int i = 0; i < channels; i++ )\n        val[i] = saturate_cast<_Tp>(a.val[i] - b.val[i]);\n}\n\ntemplate<typename _Tp, int m, int n> template<typename _T2> inline\nMatx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, _T2 alpha, Matx_ScaleOp)\n{\n    for( int i = 0; i < channels; i++ )\n        val[i] = saturate_cast<_Tp>(a.val[i] * alpha);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_MulOp)\n{\n    for( int i = 0; i < channels; i++ )\n        val[i] = saturate_cast<_Tp>(a.val[i] * b.val[i]);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_DivOp)\n{\n    for( int i = 0; i < channels; i++ )\n        val[i] = saturate_cast<_Tp>(a.val[i] / b.val[i]);\n}\n\ntemplate<typename _Tp, int m, int n> template<int l> inline\nMatx<_Tp,m,n>::Matx(const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b, Matx_MatMulOp)\n{\n    for( int i = 0; i < m; i++ )\n        for( int j = 0; j < n; j++ )\n        {\n            _Tp s = 0;\n            for( int k = 0; k < l; k++ )\n                s += a(i, k) * b(k, j);\n            val[i*n + j] = s;\n        }\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n>::Matx(const Matx<_Tp, n, m>& a, Matx_TOp)\n{\n    for( int i = 0; i < m; i++ )\n        for( int j = 0; j < n; j++ )\n            val[i*n + j] = a(j, i);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n> Matx<_Tp, m, n>::mul(const Matx<_Tp, m, n>& a) const\n{\n    return Matx<_Tp, m, n>(*this, a, Matx_MulOp());\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n> Matx<_Tp, m, n>::div(const Matx<_Tp, m, n>& a) const\n{\n    return Matx<_Tp, m, n>(*this, a, Matx_DivOp());\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, n, m> Matx<_Tp, m, n>::t() const\n{\n    return Matx<_Tp, n, m>(*this, Matx_TOp());\n}\n\ntemplate<typename _Tp, int m, int n> inline\nVec<_Tp, n> Matx<_Tp, m, n>::solve(const Vec<_Tp, m>& rhs, int method) const\n{\n    Matx<_Tp, n, 1> x = solve((const Matx<_Tp, m, 1>&)(rhs), method);\n    return (Vec<_Tp, n>&)(x);\n}\n\ntemplate<typename _Tp, int m> static inline\ndouble determinant(const Matx<_Tp, m, m>& a)\n{\n    return cv::internal::Matx_DetOp<_Tp, m>()(a);\n}\n\ntemplate<typename _Tp, int m, int n> static inline\ndouble trace(const Matx<_Tp, m, n>& a)\n{\n    _Tp s = 0;\n    for( int i = 0; i < std::min(m, n); i++ )\n        s += a(i,i);\n    return s;\n}\n\ntemplate<typename _Tp, int m, int n> static inline\ndouble norm(const Matx<_Tp, m, n>& M)\n{\n    return std::sqrt(normL2Sqr<_Tp, double>(M.val, m*n));\n}\n\ntemplate<typename _Tp, int m, int n> static inline\ndouble norm(const Matx<_Tp, m, n>& M, int normType)\n{\n    switch(normType) {\n    case NORM_INF:\n        return (double)normInf<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n);\n    case NORM_L1:\n        return (double)normL1<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n);\n    case NORM_L2SQR:\n        return (double)normL2Sqr<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n);\n    default:\n    case NORM_L2:\n        return std::sqrt((double)normL2Sqr<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n));\n    }\n}\n\n\n\n//////////////////////////////// matx comma initializer //////////////////////////////////\n\ntemplate<typename _Tp, typename _T2, int m, int n> static inline\nMatxCommaInitializer<_Tp, m, n> operator << (const Matx<_Tp, m, n>& mtx, _T2 val)\n{\n    MatxCommaInitializer<_Tp, m, n> commaInitializer((Matx<_Tp, m, n>*)&mtx);\n    return (commaInitializer, val);\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatxCommaInitializer<_Tp, m, n>::MatxCommaInitializer(Matx<_Tp, m, n>* _mtx)\n    : dst(_mtx), idx(0)\n{}\n\ntemplate<typename _Tp, int m, int n> template<typename _T2> inline\nMatxCommaInitializer<_Tp, m, n>& MatxCommaInitializer<_Tp, m, n>::operator , (_T2 value)\n{\n    CV_DbgAssert( idx < m*n );\n    dst->val[idx++] = saturate_cast<_Tp>(value);\n    return *this;\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, m, n> MatxCommaInitializer<_Tp, m, n>::operator *() const\n{\n    CV_DbgAssert( idx == n*m );\n    return *dst;\n}\n\n\n\n/////////////////////////////////// Vec Implementation ///////////////////////////////////\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec() {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0)\n    : Matx<_Tp, cn, 1>(v0) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1)\n    : Matx<_Tp, cn, 1>(v0, v1) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2)\n    : Matx<_Tp, cn, 1>(v0, v1, v2) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3)\n    : Matx<_Tp, cn, 1>(v0, v1, v2, v3) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4)\n    : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5)\n    : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6)\n    : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7)\n    : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8)\n    : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9)\n    : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13)\n    : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(const _Tp* values)\n    : Matx<_Tp, cn, 1>(values) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(std::initializer_list<_Tp> list)\n    : Matx<_Tp, cn, 1>(list) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(const Vec<_Tp, cn>& m)\n    : Matx<_Tp, cn, 1>(m.val) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_AddOp op)\n    : Matx<_Tp, cn, 1>(a, b, op) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn>::Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_SubOp op)\n    : Matx<_Tp, cn, 1>(a, b, op) {}\n\ntemplate<typename _Tp, int cn> template<typename _T2> inline\nVec<_Tp, cn>::Vec(const Matx<_Tp, cn, 1>& a, _T2 alpha, Matx_ScaleOp op)\n    : Matx<_Tp, cn, 1>(a, alpha, op) {}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn> Vec<_Tp, cn>::all(_Tp alpha)\n{\n    Vec v;\n    for( int i = 0; i < cn; i++ ) v.val[i] = alpha;\n    return v;\n}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn> Vec<_Tp, cn>::mul(const Vec<_Tp, cn>& v) const\n{\n    Vec<_Tp, cn> w;\n    for( int i = 0; i < cn; i++ ) w.val[i] = saturate_cast<_Tp>(this->val[i]*v.val[i]);\n    return w;\n}\n\ntemplate<> inline\nVec<float, 2> Vec<float, 2>::conj() const\n{\n    return cv::internal::conjugate(*this);\n}\n\ntemplate<> inline\nVec<double, 2> Vec<double, 2>::conj() const\n{\n    return cv::internal::conjugate(*this);\n}\n\ntemplate<> inline\nVec<float, 4> Vec<float, 4>::conj() const\n{\n    return cv::internal::conjugate(*this);\n}\n\ntemplate<> inline\nVec<double, 4> Vec<double, 4>::conj() const\n{\n    return cv::internal::conjugate(*this);\n}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn> Vec<_Tp, cn>::cross(const Vec<_Tp, cn>&) const\n{\n    CV_StaticAssert(cn == 3, \"for arbitrary-size vector there is no cross-product defined\");\n    return Vec<_Tp, cn>();\n}\n\ntemplate<> inline\nVec<float, 3> Vec<float, 3>::cross(const Vec<float, 3>& v) const\n{\n    return Vec<float,3>(this->val[1]*v.val[2] - this->val[2]*v.val[1],\n                     this->val[2]*v.val[0] - this->val[0]*v.val[2],\n                     this->val[0]*v.val[1] - this->val[1]*v.val[0]);\n}\n\ntemplate<> inline\nVec<double, 3> Vec<double, 3>::cross(const Vec<double, 3>& v) const\n{\n    return Vec<double,3>(this->val[1]*v.val[2] - this->val[2]*v.val[1],\n                     this->val[2]*v.val[0] - this->val[0]*v.val[2],\n                     this->val[0]*v.val[1] - this->val[1]*v.val[0]);\n}\n\ntemplate<typename _Tp, int cn> template<typename T2> inline\nVec<_Tp, cn>::operator Vec<T2, cn>() const\n{\n    Vec<T2, cn> v;\n    for( int i = 0; i < cn; i++ ) v.val[i] = saturate_cast<T2>(this->val[i]);\n    return v;\n}\n\ntemplate<typename _Tp, int cn> inline\nconst _Tp& Vec<_Tp, cn>::operator [](int i) const\n{\n    CV_DbgAssert( (unsigned)i < (unsigned)cn );\n    return this->val[i];\n}\n\ntemplate<typename _Tp, int cn> inline\n_Tp& Vec<_Tp, cn>::operator [](int i)\n{\n    CV_DbgAssert( (unsigned)i < (unsigned)cn );\n    return this->val[i];\n}\n\ntemplate<typename _Tp, int cn> inline\nconst _Tp& Vec<_Tp, cn>::operator ()(int i) const\n{\n    CV_DbgAssert( (unsigned)i < (unsigned)cn );\n    return this->val[i];\n}\n\ntemplate<typename _Tp, int cn> inline\n_Tp& Vec<_Tp, cn>::operator ()(int i)\n{\n    CV_DbgAssert( (unsigned)i < (unsigned)cn );\n    return this->val[i];\n}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn> normalize(const Vec<_Tp, cn>& v)\n{\n    double nv = norm(v);\n    return v * (nv ? 1./nv : 0.);\n}\n\n\n\n//////////////////////////////// vec comma initializer //////////////////////////////////\n\n\ntemplate<typename _Tp, typename _T2, int cn> static inline\nVecCommaInitializer<_Tp, cn> operator << (const Vec<_Tp, cn>& vec, _T2 val)\n{\n    VecCommaInitializer<_Tp, cn> commaInitializer((Vec<_Tp, cn>*)&vec);\n    return (commaInitializer, val);\n}\n\ntemplate<typename _Tp, int cn> inline\nVecCommaInitializer<_Tp, cn>::VecCommaInitializer(Vec<_Tp, cn>* _vec)\n    : MatxCommaInitializer<_Tp, cn, 1>(_vec)\n{}\n\ntemplate<typename _Tp, int cn> template<typename _T2> inline\nVecCommaInitializer<_Tp, cn>& VecCommaInitializer<_Tp, cn>::operator , (_T2 value)\n{\n    CV_DbgAssert( this->idx < cn );\n    this->dst->val[this->idx++] = saturate_cast<_Tp>(value);\n    return *this;\n}\n\ntemplate<typename _Tp, int cn> inline\nVec<_Tp, cn> VecCommaInitializer<_Tp, cn>::operator *() const\n{\n    CV_DbgAssert( this->idx == cn );\n    return *this->dst;\n}\n\n//! @endcond\n\n///////////////////////////// Matx out-of-class operators ////////////////////////////////\n\n//! @relates cv::Matx\n//! @{\n\ntemplate<typename _Tp1, typename _Tp2, int m, int n> static inline\nMatx<_Tp1, m, n>& operator += (Matx<_Tp1, m, n>& a, const Matx<_Tp2, m, n>& b)\n{\n    for( int i = 0; i < m*n; i++ )\n        a.val[i] = saturate_cast<_Tp1>(a.val[i] + b.val[i]);\n    return a;\n}\n\ntemplate<typename _Tp1, typename _Tp2, int m, int n> static inline\nMatx<_Tp1, m, n>& operator -= (Matx<_Tp1, m, n>& a, const Matx<_Tp2, m, n>& b)\n{\n    for( int i = 0; i < m*n; i++ )\n        a.val[i] = saturate_cast<_Tp1>(a.val[i] - b.val[i]);\n    return a;\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator + (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b)\n{\n    return Matx<_Tp, m, n>(a, b, Matx_AddOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator - (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b)\n{\n    return Matx<_Tp, m, n>(a, b, Matx_SubOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a, int alpha)\n{\n    for( int i = 0; i < m*n; i++ )\n        a.val[i] = saturate_cast<_Tp>(a.val[i] * alpha);\n    return a;\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a, float alpha)\n{\n    for( int i = 0; i < m*n; i++ )\n        a.val[i] = saturate_cast<_Tp>(a.val[i] * alpha);\n    return a;\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a, double alpha)\n{\n    for( int i = 0; i < m*n; i++ )\n        a.val[i] = saturate_cast<_Tp>(a.val[i] * alpha);\n    return a;\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator * (const Matx<_Tp, m, n>& a, int alpha)\n{\n    return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator * (const Matx<_Tp, m, n>& a, float alpha)\n{\n    return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator * (const Matx<_Tp, m, n>& a, double alpha)\n{\n    return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator * (int alpha, const Matx<_Tp, m, n>& a)\n{\n    return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator * (float alpha, const Matx<_Tp, m, n>& a)\n{\n    return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator * (double alpha, const Matx<_Tp, m, n>& a)\n{\n    return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a, float alpha)\n{\n    for( int i = 0; i < m*n; i++ )\n        a.val[i] = a.val[i] / alpha;\n    return a;\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a, double alpha)\n{\n    for( int i = 0; i < m*n; i++ )\n        a.val[i] = a.val[i] / alpha;\n    return a;\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator / (const Matx<_Tp, m, n>& a, float alpha)\n{\n    return Matx<_Tp, m, n>(a, 1.f/alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator / (const Matx<_Tp, m, n>& a, double alpha)\n{\n    return Matx<_Tp, m, n>(a, 1./alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nMatx<_Tp, m, n> operator - (const Matx<_Tp, m, n>& a)\n{\n    return Matx<_Tp, m, n>(a, -1, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int m, int n, int l> static inline\nMatx<_Tp, m, n> operator * (const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b)\n{\n    return Matx<_Tp, m, n>(a, b, Matx_MatMulOp());\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nVec<_Tp, m> operator * (const Matx<_Tp, m, n>& a, const Vec<_Tp, n>& b)\n{\n    Matx<_Tp, m, 1> c(a, b, Matx_MatMulOp());\n    return (const Vec<_Tp, m>&)(c);\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nbool operator == (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b)\n{\n    for( int i = 0; i < m*n; i++ )\n        if( a.val[i] != b.val[i] ) return false;\n    return true;\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nbool operator != (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b)\n{\n    return !(a == b);\n}\n\n//! @}\n\n////////////////////////////// Vec out-of-class operators ////////////////////////////////\n\n//! @relates cv::Vec\n//! @{\n\ntemplate<typename _Tp1, typename _Tp2, int cn> static inline\nVec<_Tp1, cn>& operator += (Vec<_Tp1, cn>& a, const Vec<_Tp2, cn>& b)\n{\n    for( int i = 0; i < cn; i++ )\n        a.val[i] = saturate_cast<_Tp1>(a.val[i] + b.val[i]);\n    return a;\n}\n\ntemplate<typename _Tp1, typename _Tp2, int cn> static inline\nVec<_Tp1, cn>& operator -= (Vec<_Tp1, cn>& a, const Vec<_Tp2, cn>& b)\n{\n    for( int i = 0; i < cn; i++ )\n        a.val[i] = saturate_cast<_Tp1>(a.val[i] - b.val[i]);\n    return a;\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator + (const Vec<_Tp, cn>& a, const Vec<_Tp, cn>& b)\n{\n    return Vec<_Tp, cn>(a, b, Matx_AddOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator - (const Vec<_Tp, cn>& a, const Vec<_Tp, cn>& b)\n{\n    return Vec<_Tp, cn>(a, b, Matx_SubOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, int alpha)\n{\n    for( int i = 0; i < cn; i++ )\n        a[i] = saturate_cast<_Tp>(a[i]*alpha);\n    return a;\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, float alpha)\n{\n    for( int i = 0; i < cn; i++ )\n        a[i] = saturate_cast<_Tp>(a[i]*alpha);\n    return a;\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, double alpha)\n{\n    for( int i = 0; i < cn; i++ )\n        a[i] = saturate_cast<_Tp>(a[i]*alpha);\n    return a;\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a, int alpha)\n{\n    double ialpha = 1./alpha;\n    for( int i = 0; i < cn; i++ )\n        a[i] = saturate_cast<_Tp>(a[i]*ialpha);\n    return a;\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a, float alpha)\n{\n    float ialpha = 1.f/alpha;\n    for( int i = 0; i < cn; i++ )\n        a[i] = saturate_cast<_Tp>(a[i]*ialpha);\n    return a;\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a, double alpha)\n{\n    double ialpha = 1./alpha;\n    for( int i = 0; i < cn; i++ )\n        a[i] = saturate_cast<_Tp>(a[i]*ialpha);\n    return a;\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, int alpha)\n{\n    return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator * (int alpha, const Vec<_Tp, cn>& a)\n{\n    return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, float alpha)\n{\n    return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator * (float alpha, const Vec<_Tp, cn>& a)\n{\n    return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, double alpha)\n{\n    return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator * (double alpha, const Vec<_Tp, cn>& a)\n{\n    return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator / (const Vec<_Tp, cn>& a, int alpha)\n{\n    return Vec<_Tp, cn>(a, 1./alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator / (const Vec<_Tp, cn>& a, float alpha)\n{\n    return Vec<_Tp, cn>(a, 1.f/alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator / (const Vec<_Tp, cn>& a, double alpha)\n{\n    return Vec<_Tp, cn>(a, 1./alpha, Matx_ScaleOp());\n}\n\ntemplate<typename _Tp, int cn> static inline\nVec<_Tp, cn> operator - (const Vec<_Tp, cn>& a)\n{\n    Vec<_Tp,cn> t;\n    for( int i = 0; i < cn; i++ ) t.val[i] = saturate_cast<_Tp>(-a.val[i]);\n    return t;\n}\n\ntemplate<typename _Tp> inline Vec<_Tp, 4> operator * (const Vec<_Tp, 4>& v1, const Vec<_Tp, 4>& v2)\n{\n    return Vec<_Tp, 4>(saturate_cast<_Tp>(v1[0]*v2[0] - v1[1]*v2[1] - v1[2]*v2[2] - v1[3]*v2[3]),\n                       saturate_cast<_Tp>(v1[0]*v2[1] + v1[1]*v2[0] + v1[2]*v2[3] - v1[3]*v2[2]),\n                       saturate_cast<_Tp>(v1[0]*v2[2] - v1[1]*v2[3] + v1[2]*v2[0] + v1[3]*v2[1]),\n                       saturate_cast<_Tp>(v1[0]*v2[3] + v1[1]*v2[2] - v1[2]*v2[1] + v1[3]*v2[0]));\n}\n\ntemplate<typename _Tp> inline Vec<_Tp, 4>& operator *= (Vec<_Tp, 4>& v1, const Vec<_Tp, 4>& v2)\n{\n    v1 = v1 * v2;\n    return v1;\n}\n\n//! @}\n\n} // cv\n\n#endif // OPENCV_CORE_MATX_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/neon_utils.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_HAL_NEON_UTILS_HPP\n#define OPENCV_HAL_NEON_UTILS_HPP\n\n#include \"opencv2/core/cvdef.h\"\n\n//! @addtogroup core_utils_neon\n//! @{\n\n#if CV_NEON\n\ninline int32x2_t cv_vrnd_s32_f32(float32x2_t v)\n{\n    static int32x2_t v_sign = vdup_n_s32(1 << 31),\n        v_05 = vreinterpret_s32_f32(vdup_n_f32(0.5f));\n\n    int32x2_t v_addition = vorr_s32(v_05, vand_s32(v_sign, vreinterpret_s32_f32(v)));\n    return vcvt_s32_f32(vadd_f32(v, vreinterpret_f32_s32(v_addition)));\n}\n\ninline int32x4_t cv_vrndq_s32_f32(float32x4_t v)\n{\n    static int32x4_t v_sign = vdupq_n_s32(1 << 31),\n        v_05 = vreinterpretq_s32_f32(vdupq_n_f32(0.5f));\n\n    int32x4_t v_addition = vorrq_s32(v_05, vandq_s32(v_sign, vreinterpretq_s32_f32(v)));\n    return vcvtq_s32_f32(vaddq_f32(v, vreinterpretq_f32_s32(v_addition)));\n}\n\ninline uint32x2_t cv_vrnd_u32_f32(float32x2_t v)\n{\n    static float32x2_t v_05 = vdup_n_f32(0.5f);\n    return vcvt_u32_f32(vadd_f32(v, v_05));\n}\n\ninline uint32x4_t cv_vrndq_u32_f32(float32x4_t v)\n{\n    static float32x4_t v_05 = vdupq_n_f32(0.5f);\n    return vcvtq_u32_f32(vaddq_f32(v, v_05));\n}\n\ninline float32x4_t cv_vrecpq_f32(float32x4_t val)\n{\n    float32x4_t reciprocal = vrecpeq_f32(val);\n    reciprocal = vmulq_f32(vrecpsq_f32(val, reciprocal), reciprocal);\n    reciprocal = vmulq_f32(vrecpsq_f32(val, reciprocal), reciprocal);\n    return reciprocal;\n}\n\ninline float32x2_t cv_vrecp_f32(float32x2_t val)\n{\n    float32x2_t reciprocal = vrecpe_f32(val);\n    reciprocal = vmul_f32(vrecps_f32(val, reciprocal), reciprocal);\n    reciprocal = vmul_f32(vrecps_f32(val, reciprocal), reciprocal);\n    return reciprocal;\n}\n\ninline float32x4_t cv_vrsqrtq_f32(float32x4_t val)\n{\n    float32x4_t e = vrsqrteq_f32(val);\n    e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(e, e), val), e);\n    e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(e, e), val), e);\n    return e;\n}\n\ninline float32x2_t cv_vrsqrt_f32(float32x2_t val)\n{\n    float32x2_t e = vrsqrte_f32(val);\n    e = vmul_f32(vrsqrts_f32(vmul_f32(e, e), val), e);\n    e = vmul_f32(vrsqrts_f32(vmul_f32(e, e), val), e);\n    return e;\n}\n\ninline float32x4_t cv_vsqrtq_f32(float32x4_t val)\n{\n    return cv_vrecpq_f32(cv_vrsqrtq_f32(val));\n}\n\ninline float32x2_t cv_vsqrt_f32(float32x2_t val)\n{\n    return cv_vrecp_f32(cv_vrsqrt_f32(val));\n}\n\n#endif\n\n//! @}\n\n#endif // OPENCV_HAL_NEON_UTILS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/ocl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the OpenCV Foundation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_OPENCL_HPP\n#define OPENCV_OPENCL_HPP\n\n#include \"opencv2/core.hpp\"\n#include <typeinfo>\n#include <typeindex>\n\nnamespace cv { namespace ocl {\n\n//! @addtogroup core_opencl\n//! @{\n\nCV_EXPORTS_W bool haveOpenCL();\nCV_EXPORTS_W bool useOpenCL();\nCV_EXPORTS_W bool haveAmdBlas();\nCV_EXPORTS_W bool haveAmdFft();\nCV_EXPORTS_W void setUseOpenCL(bool flag);\nCV_EXPORTS_W void finish();\n\nCV_EXPORTS bool haveSVM();\n\nclass CV_EXPORTS Context;\nclass CV_EXPORTS_W_SIMPLE Device;\nclass CV_EXPORTS Kernel;\nclass CV_EXPORTS Program;\nclass CV_EXPORTS ProgramSource;\nclass CV_EXPORTS Queue;\nclass CV_EXPORTS PlatformInfo;\nclass CV_EXPORTS Image2D;\n\nclass CV_EXPORTS_W_SIMPLE Device\n{\npublic:\n    CV_WRAP Device() CV_NOEXCEPT;\n    explicit Device(void* d);\n    Device(const Device& d);\n    Device& operator = (const Device& d);\n    Device(Device&& d) CV_NOEXCEPT;\n    Device& operator = (Device&& d) CV_NOEXCEPT;\n    CV_WRAP ~Device();\n\n    void set(void* d);\n\n    enum\n    {\n        TYPE_DEFAULT     = (1 << 0),\n        TYPE_CPU         = (1 << 1),\n        TYPE_GPU         = (1 << 2),\n        TYPE_ACCELERATOR = (1 << 3),\n        TYPE_DGPU        = TYPE_GPU + (1 << 16),\n        TYPE_IGPU        = TYPE_GPU + (1 << 17),\n        TYPE_ALL         = 0xFFFFFFFF\n    };\n\n    CV_WRAP String name() const;\n    CV_WRAP String extensions() const;\n    CV_WRAP bool isExtensionSupported(const String& extensionName) const;\n    CV_WRAP String version() const;\n    CV_WRAP String vendorName() const;\n    CV_WRAP String OpenCL_C_Version() const;\n    CV_WRAP String OpenCLVersion() const;\n    CV_WRAP int deviceVersionMajor() const;\n    CV_WRAP int deviceVersionMinor() const;\n    CV_WRAP String driverVersion() const;\n    void* ptr() const;\n\n    CV_WRAP int type() const;\n\n    CV_WRAP int addressBits() const;\n    CV_WRAP bool available() const;\n    CV_WRAP bool compilerAvailable() const;\n    CV_WRAP bool linkerAvailable() const;\n\n    enum\n    {\n        FP_DENORM=(1 << 0),\n        FP_INF_NAN=(1 << 1),\n        FP_ROUND_TO_NEAREST=(1 << 2),\n        FP_ROUND_TO_ZERO=(1 << 3),\n        FP_ROUND_TO_INF=(1 << 4),\n        FP_FMA=(1 << 5),\n        FP_SOFT_FLOAT=(1 << 6),\n        FP_CORRECTLY_ROUNDED_DIVIDE_SQRT=(1 << 7)\n    };\n    CV_WRAP int doubleFPConfig() const;\n    CV_WRAP int singleFPConfig() const;\n    CV_WRAP int halfFPConfig() const;\n\n    CV_WRAP bool endianLittle() const;\n    CV_WRAP bool errorCorrectionSupport() const;\n\n    enum\n    {\n        EXEC_KERNEL=(1 << 0),\n        EXEC_NATIVE_KERNEL=(1 << 1)\n    };\n    CV_WRAP int executionCapabilities() const;\n\n    CV_WRAP size_t globalMemCacheSize() const;\n\n    enum\n    {\n        NO_CACHE=0,\n        READ_ONLY_CACHE=1,\n        READ_WRITE_CACHE=2\n    };\n    CV_WRAP int globalMemCacheType() const;\n    CV_WRAP int globalMemCacheLineSize() const;\n    CV_WRAP size_t globalMemSize() const;\n\n    CV_WRAP size_t localMemSize() const;\n    enum\n    {\n        NO_LOCAL_MEM=0,\n        LOCAL_IS_LOCAL=1,\n        LOCAL_IS_GLOBAL=2\n    };\n    CV_WRAP int localMemType() const;\n    CV_WRAP bool hostUnifiedMemory() const;\n\n    CV_WRAP bool imageSupport() const;\n\n    CV_WRAP bool imageFromBufferSupport() const;\n    uint imagePitchAlignment() const;\n    uint imageBaseAddressAlignment() const;\n\n    /// deprecated, use isExtensionSupported() method (probably with \"cl_khr_subgroups\" value)\n    CV_WRAP bool intelSubgroupsSupport() const;\n\n    CV_WRAP size_t image2DMaxWidth() const;\n    CV_WRAP size_t image2DMaxHeight() const;\n\n    CV_WRAP size_t image3DMaxWidth() const;\n    CV_WRAP size_t image3DMaxHeight() const;\n    CV_WRAP size_t image3DMaxDepth() const;\n\n    CV_WRAP size_t imageMaxBufferSize() const;\n    CV_WRAP size_t imageMaxArraySize() const;\n\n    enum\n    {\n        UNKNOWN_VENDOR=0,\n        VENDOR_AMD=1,\n        VENDOR_INTEL=2,\n        VENDOR_NVIDIA=3\n    };\n    CV_WRAP int vendorID() const;\n    // FIXIT\n    // dev.isAMD() doesn't work for OpenCL CPU devices from AMD OpenCL platform.\n    // This method should use platform name instead of vendor name.\n    // After fix restore code in arithm.cpp: ocl_compare()\n    CV_WRAP inline bool isAMD() const { return vendorID() == VENDOR_AMD; }\n    CV_WRAP inline bool isIntel() const { return vendorID() == VENDOR_INTEL; }\n    CV_WRAP inline bool isNVidia() const { return vendorID() == VENDOR_NVIDIA; }\n\n    CV_WRAP int maxClockFrequency() const;\n    CV_WRAP int maxComputeUnits() const;\n    CV_WRAP int maxConstantArgs() const;\n    CV_WRAP size_t maxConstantBufferSize() const;\n\n    CV_WRAP size_t maxMemAllocSize() const;\n    CV_WRAP size_t maxParameterSize() const;\n\n    CV_WRAP int maxReadImageArgs() const;\n    CV_WRAP int maxWriteImageArgs() const;\n    CV_WRAP int maxSamplers() const;\n\n    CV_WRAP size_t maxWorkGroupSize() const;\n    CV_WRAP int maxWorkItemDims() const;\n    void maxWorkItemSizes(size_t*) const;\n\n    CV_WRAP int memBaseAddrAlign() const;\n\n    CV_WRAP int nativeVectorWidthChar() const;\n    CV_WRAP int nativeVectorWidthShort() const;\n    CV_WRAP int nativeVectorWidthInt() const;\n    CV_WRAP int nativeVectorWidthLong() const;\n    CV_WRAP int nativeVectorWidthFloat() const;\n    CV_WRAP int nativeVectorWidthDouble() const;\n    CV_WRAP int nativeVectorWidthHalf() const;\n\n    CV_WRAP int preferredVectorWidthChar() const;\n    CV_WRAP int preferredVectorWidthShort() const;\n    CV_WRAP int preferredVectorWidthInt() const;\n    CV_WRAP int preferredVectorWidthLong() const;\n    CV_WRAP int preferredVectorWidthFloat() const;\n    CV_WRAP int preferredVectorWidthDouble() const;\n    CV_WRAP int preferredVectorWidthHalf() const;\n\n    CV_WRAP size_t printfBufferSize() const;\n    CV_WRAP size_t profilingTimerResolution() const;\n\n    CV_WRAP static const Device& getDefault();\n\n    /**\n     * @param d OpenCL handle (cl_device_id). clRetainDevice() is called on success.\n     */\n    static Device fromHandle(void* d);\n\n    struct Impl;\n    inline Impl* getImpl() const { return (Impl*)p; }\n    inline bool empty() const { return !p; }\nprotected:\n    Impl* p;\n};\n\n\nclass CV_EXPORTS Context\n{\npublic:\n    Context() CV_NOEXCEPT;\n    explicit Context(int dtype);  //!< @deprecated\n    ~Context();\n    Context(const Context& c);\n    Context& operator= (const Context& c);\n    Context(Context&& c) CV_NOEXCEPT;\n    Context& operator = (Context&& c) CV_NOEXCEPT;\n\n    /** @deprecated */\n    bool create();\n    /** @deprecated */\n    bool create(int dtype);\n\n    size_t ndevices() const;\n    Device& device(size_t idx) const;\n    Program getProg(const ProgramSource& prog,\n                    const String& buildopt, String& errmsg);\n    void unloadProg(Program& prog);\n\n\n    /** Get thread-local OpenCL context (initialize if necessary) */\n#if 0  // OpenCV 5.0\n    static Context& getDefault();\n#else\n    static Context& getDefault(bool initialize = true);\n#endif\n\n    /** @returns cl_context value */\n    void* ptr() const;\n\n    /**\n     * @brief Get OpenCL context property specified on context creation\n     * @param propertyId Property id (CL_CONTEXT_* as defined in cl_context_properties type)\n     * @returns Property value if property was specified on clCreateContext, or NULL if context created without the property\n     */\n    void* getOpenCLContextProperty(int propertyId) const;\n\n    bool useSVM() const;\n    void setUseSVM(bool enabled);\n\n    /**\n     * @param context OpenCL handle (cl_context). clRetainContext() is called on success\n     */\n    static Context fromHandle(void* context);\n    static Context fromDevice(const ocl::Device& device);\n    static Context create(const std::string& configuration);\n\n    void release();\n\n    class CV_EXPORTS UserContext {\n    public:\n        virtual ~UserContext();\n    };\n    template <typename T>\n    inline void setUserContext(const std::shared_ptr<T>& userContext) {\n        setUserContext(typeid(T), userContext);\n    }\n    template <typename T>\n    inline std::shared_ptr<T> getUserContext() {\n        return std::dynamic_pointer_cast<T>(getUserContext(typeid(T)));\n    }\n    void setUserContext(std::type_index typeId, const std::shared_ptr<UserContext>& userContext);\n    std::shared_ptr<UserContext> getUserContext(std::type_index typeId);\n\n    struct Impl;\n    inline Impl* getImpl() const { return (Impl*)p; }\n    inline bool empty() const { return !p; }\n// TODO OpenCV 5.0\n//protected:\n    Impl* p;\n};\n\n/** @deprecated */\nclass CV_EXPORTS Platform\n{\npublic:\n    Platform() CV_NOEXCEPT;\n    ~Platform();\n    Platform(const Platform& p);\n    Platform& operator = (const Platform& p);\n    Platform(Platform&& p) CV_NOEXCEPT;\n    Platform& operator = (Platform&& p) CV_NOEXCEPT;\n\n    void* ptr() const;\n\n    /** @deprecated */\n    static Platform& getDefault();\n\n    struct Impl;\n    inline Impl* getImpl() const { return (Impl*)p; }\n    inline bool empty() const { return !p; }\nprotected:\n    Impl* p;\n};\n\n/** @brief Attaches OpenCL context to OpenCV\n@note\n  OpenCV will check if available OpenCL platform has platformName name, then assign context to\n  OpenCV and call `clRetainContext` function. The deviceID device will be used as target device and\n  new command queue will be created.\n@param platformName name of OpenCL platform to attach, this string is used to check if platform is available to OpenCV at runtime\n@param platformID ID of platform attached context was created for\n@param context OpenCL context to be attached to OpenCV\n@param deviceID ID of device, must be created from attached context\n*/\nCV_EXPORTS void attachContext(const String& platformName, void* platformID, void* context, void* deviceID);\n\n/** @brief Convert OpenCL buffer to UMat\n@note\n  OpenCL buffer (cl_mem_buffer) should contain 2D image data, compatible with OpenCV. Memory\n  content is not copied from `clBuffer` to UMat. Instead, buffer handle assigned to UMat and\n  `clRetainMemObject` is called.\n@param cl_mem_buffer source clBuffer handle\n@param step num of bytes in single row\n@param rows number of rows\n@param cols number of cols\n@param type OpenCV type of image\n@param dst destination UMat\n*/\nCV_EXPORTS void convertFromBuffer(void* cl_mem_buffer, size_t step, int rows, int cols, int type, UMat& dst);\n\n/** @brief Convert OpenCL image2d_t to UMat\n@note\n  OpenCL `image2d_t` (cl_mem_image), should be compatible with OpenCV UMat formats. Memory content\n  is copied from image to UMat with `clEnqueueCopyImageToBuffer` function.\n@param cl_mem_image source image2d_t handle\n@param dst destination UMat\n*/\nCV_EXPORTS void convertFromImage(void* cl_mem_image, UMat& dst);\n\n// TODO Move to internal header\n/// @deprecated\nvoid initializeContextFromHandle(Context& ctx, void* platform, void* context, void* device);\n\nclass CV_EXPORTS Queue\n{\npublic:\n    Queue() CV_NOEXCEPT;\n    explicit Queue(const Context& c, const Device& d=Device());\n    ~Queue();\n    Queue(const Queue& q);\n    Queue& operator = (const Queue& q);\n    Queue(Queue&& q) CV_NOEXCEPT;\n    Queue& operator = (Queue&& q) CV_NOEXCEPT;\n\n    bool create(const Context& c=Context(), const Device& d=Device());\n    void finish();\n    void* ptr() const;\n    static Queue& getDefault();\n\n    /// @brief Returns OpenCL command queue with enable profiling mode support\n    const Queue& getProfilingQueue() const;\n\n    struct Impl; friend struct Impl;\n    inline Impl* getImpl() const { return p; }\n    inline bool empty() const { return !p; }\nprotected:\n    Impl* p;\n};\n\n\nclass CV_EXPORTS KernelArg\n{\npublic:\n    enum { LOCAL=1, READ_ONLY=2, WRITE_ONLY=4, READ_WRITE=6, CONSTANT=8, PTR_ONLY = 16, NO_SIZE=256 };\n    KernelArg(int _flags, UMat* _m, int wscale=1, int iwscale=1, const void* _obj=0, size_t _sz=0);\n    KernelArg() CV_NOEXCEPT;\n\n    static KernelArg Local(size_t localMemSize)\n    { return KernelArg(LOCAL, 0, 1, 1, 0, localMemSize); }\n    static KernelArg PtrWriteOnly(const UMat& m)\n    { return KernelArg(PTR_ONLY+WRITE_ONLY, (UMat*)&m); }\n    static KernelArg PtrReadOnly(const UMat& m)\n    { return KernelArg(PTR_ONLY+READ_ONLY, (UMat*)&m); }\n    static KernelArg PtrReadWrite(const UMat& m)\n    { return KernelArg(PTR_ONLY+READ_WRITE, (UMat*)&m); }\n    static KernelArg ReadWrite(const UMat& m, int wscale=1, int iwscale=1)\n    { return KernelArg(READ_WRITE, (UMat*)&m, wscale, iwscale); }\n    static KernelArg ReadWriteNoSize(const UMat& m, int wscale=1, int iwscale=1)\n    { return KernelArg(READ_WRITE+NO_SIZE, (UMat*)&m, wscale, iwscale); }\n    static KernelArg ReadOnly(const UMat& m, int wscale=1, int iwscale=1)\n    { return KernelArg(READ_ONLY, (UMat*)&m, wscale, iwscale); }\n    static KernelArg WriteOnly(const UMat& m, int wscale=1, int iwscale=1)\n    { return KernelArg(WRITE_ONLY, (UMat*)&m, wscale, iwscale); }\n    static KernelArg ReadOnlyNoSize(const UMat& m, int wscale=1, int iwscale=1)\n    { return KernelArg(READ_ONLY+NO_SIZE, (UMat*)&m, wscale, iwscale); }\n    static KernelArg WriteOnlyNoSize(const UMat& m, int wscale=1, int iwscale=1)\n    { return KernelArg(WRITE_ONLY+NO_SIZE, (UMat*)&m, wscale, iwscale); }\n    static KernelArg Constant(const Mat& m);\n    template<typename _Tp> static KernelArg Constant(const _Tp* arr, size_t n)\n    { return KernelArg(CONSTANT, 0, 1, 1, (void*)arr, n); }\n\n    int flags;\n    UMat* m;\n    const void* obj;\n    size_t sz;\n    int wscale, iwscale;\n};\n\n\nclass CV_EXPORTS Kernel\n{\npublic:\n    Kernel() CV_NOEXCEPT;\n    Kernel(const char* kname, const Program& prog);\n    Kernel(const char* kname, const ProgramSource& prog,\n           const String& buildopts = String(), String* errmsg=0);\n    ~Kernel();\n    Kernel(const Kernel& k);\n    Kernel& operator = (const Kernel& k);\n    Kernel(Kernel&& k) CV_NOEXCEPT;\n    Kernel& operator = (Kernel&& k) CV_NOEXCEPT;\n\n    bool empty() const;\n    bool create(const char* kname, const Program& prog);\n    bool create(const char* kname, const ProgramSource& prog,\n                const String& buildopts, String* errmsg=0);\n\n    int set(int i, const void* value, size_t sz);\n    int set(int i, const Image2D& image2D);\n    int set(int i, const UMat& m);\n    int set(int i, const KernelArg& arg);\n    template<typename _Tp> int set(int i, const _Tp& value)\n    { return set(i, &value, sizeof(value)); }\n\n\nprotected:\n    template<typename _Tp0> inline\n    int set_args_(int i, const _Tp0& a0) { return set(i, a0); }\n    template<typename _Tp0, typename... _Tps> inline\n    int set_args_(int i, const _Tp0& a0, const _Tps&... rest_args) { i = set(i, a0); return set_args_(i, rest_args...); }\npublic:\n    /** @brief Setup OpenCL Kernel arguments.\n    Avoid direct using of set(i, ...) methods.\n    @code\n    bool ok = kernel\n        .args(\n            srcUMat, dstUMat,\n            (float)some_float_param\n        ).run(ndims, globalSize, localSize);\n    if (!ok) return false;\n    @endcode\n    */\n    template<typename... _Tps> inline\n    Kernel& args(const _Tps&... kernel_args) { set_args_(0, kernel_args...); return *this; }\n\n\n    /** @brief Run the OpenCL kernel.\n    @param dims the work problem dimensions. It is the length of globalsize and localsize. It can be either 1, 2 or 3.\n    @param globalsize work items for each dimension. It is not the final globalsize passed to\n      OpenCL. Each dimension will be adjusted to the nearest integer divisible by the corresponding\n      value in localsize. If localsize is NULL, it will still be adjusted depending on dims. The\n      adjusted values are greater than or equal to the original values.\n    @param localsize work-group size for each dimension.\n    @param sync specify whether to wait for OpenCL computation to finish before return.\n    @param q command queue\n    */\n    bool run(int dims, size_t globalsize[],\n             size_t localsize[], bool sync, const Queue& q=Queue());\n    bool runTask(bool sync, const Queue& q=Queue());\n\n    /** @brief Similar to synchronized run() call with returning of kernel execution time\n     * Separate OpenCL command queue may be used (with CL_QUEUE_PROFILING_ENABLE)\n     * @return Execution time in nanoseconds or negative number on error\n     */\n    int64 runProfiling(int dims, size_t globalsize[], size_t localsize[], const Queue& q=Queue());\n\n    size_t workGroupSize() const;\n    size_t preferedWorkGroupSizeMultiple() const;\n    bool compileWorkGroupSize(size_t wsz[]) const;\n    size_t localMemSize() const;\n\n    void* ptr() const;\n    struct Impl;\n\nprotected:\n    Impl* p;\n};\n\nclass CV_EXPORTS Program\n{\npublic:\n    Program() CV_NOEXCEPT;\n    Program(const ProgramSource& src,\n            const String& buildflags, String& errmsg);\n    Program(const Program& prog);\n    Program& operator = (const Program& prog);\n    Program(Program&& prog) CV_NOEXCEPT;\n    Program& operator = (Program&& prog) CV_NOEXCEPT;\n    ~Program();\n\n    bool create(const ProgramSource& src,\n                const String& buildflags, String& errmsg);\n\n    void* ptr() const;\n\n    /**\n     * @brief Query device-specific program binary.\n     *\n     * Returns RAW OpenCL executable binary without additional attachments.\n     *\n     * @sa ProgramSource::fromBinary\n     *\n     * @param[out] binary output buffer\n     */\n    void getBinary(std::vector<char>& binary) const;\n\n    struct Impl; friend struct Impl;\n    inline Impl* getImpl() const { return (Impl*)p; }\n    inline bool empty() const { return !p; }\nprotected:\n    Impl* p;\npublic:\n#ifndef OPENCV_REMOVE_DEPRECATED_API\n    // TODO Remove this\n    CV_DEPRECATED bool read(const String& buf, const String& buildflags); // removed, use ProgramSource instead\n    CV_DEPRECATED bool write(String& buf) const; // removed, use getBinary() method instead (RAW OpenCL binary)\n    CV_DEPRECATED const ProgramSource& source() const; // implementation removed\n    CV_DEPRECATED String getPrefix() const; // deprecated, implementation replaced\n    CV_DEPRECATED static String getPrefix(const String& buildflags); // deprecated, implementation replaced\n#endif\n};\n\n\nclass CV_EXPORTS ProgramSource\n{\npublic:\n    typedef uint64 hash_t; // deprecated\n\n    ProgramSource() CV_NOEXCEPT;\n    explicit ProgramSource(const String& module, const String& name, const String& codeStr, const String& codeHash);\n    explicit ProgramSource(const String& prog); // deprecated\n    explicit ProgramSource(const char* prog); // deprecated\n    ~ProgramSource();\n    ProgramSource(const ProgramSource& prog);\n    ProgramSource& operator = (const ProgramSource& prog);\n    ProgramSource(ProgramSource&& prog) CV_NOEXCEPT;\n    ProgramSource& operator = (ProgramSource&& prog) CV_NOEXCEPT;\n\n    const String& source() const; // deprecated\n    hash_t hash() const; // deprecated\n\n\n    /** @brief Describe OpenCL program binary.\n     * Do not call clCreateProgramWithBinary() and/or clBuildProgram().\n     *\n     * Caller should guarantee binary buffer lifetime greater than ProgramSource object (and any of its copies).\n     *\n     * This kind of binary is not portable between platforms in general - it is specific to OpenCL vendor / device / driver version.\n     *\n     * @param module name of program owner module\n     * @param name unique name of program (module+name is used as key for OpenCL program caching)\n     * @param binary buffer address. See buffer lifetime requirement in description.\n     * @param size buffer size\n     * @param buildOptions additional program-related build options passed to clBuildProgram()\n     * @return created ProgramSource object\n     */\n    static ProgramSource fromBinary(const String& module, const String& name,\n            const unsigned char* binary, const size_t size,\n            const cv::String& buildOptions = cv::String());\n\n    /** @brief Describe OpenCL program in SPIR format.\n     * Do not call clCreateProgramWithBinary() and/or clBuildProgram().\n     *\n     * Supports SPIR 1.2 by default (pass '-spir-std=X.Y' in buildOptions to override this behavior)\n     *\n     * Caller should guarantee binary buffer lifetime greater than ProgramSource object (and any of its copies).\n     *\n     * Programs in this format are portable between OpenCL implementations with 'khr_spir' extension:\n     * https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/cl_khr_spir.html\n     * (but they are not portable between different platforms: 32-bit / 64-bit)\n     *\n     * Note: these programs can't support vendor specific extensions, like 'cl_intel_subgroups'.\n     *\n     * @param module name of program owner module\n     * @param name unique name of program (module+name is used as key for OpenCL program caching)\n     * @param binary buffer address. See buffer lifetime requirement in description.\n     * @param size buffer size\n     * @param buildOptions additional program-related build options passed to clBuildProgram()\n     *        (these options are added automatically: '-x spir' and '-spir-std=1.2')\n     * @return created ProgramSource object.\n     */\n    static ProgramSource fromSPIR(const String& module, const String& name,\n            const unsigned char* binary, const size_t size,\n            const cv::String& buildOptions = cv::String());\n\n    //OpenCL 2.1+ only\n    //static Program fromSPIRV(const String& module, const String& name,\n    //        const unsigned char* binary, const size_t size,\n    //        const cv::String& buildOptions = cv::String());\n\n    struct Impl; friend struct Impl;\n    inline Impl* getImpl() const { return (Impl*)p; }\n    inline bool empty() const { return !p; }\nprotected:\n    Impl* p;\n};\n\nclass CV_EXPORTS PlatformInfo\n{\npublic:\n    PlatformInfo() CV_NOEXCEPT;\n    /**\n     * @param id pointer cl_platform_id (cl_platform_id*)\n     */\n    explicit PlatformInfo(void* id);\n    ~PlatformInfo();\n\n    PlatformInfo(const PlatformInfo& i);\n    PlatformInfo& operator =(const PlatformInfo& i);\n    PlatformInfo(PlatformInfo&& i) CV_NOEXCEPT;\n    PlatformInfo& operator = (PlatformInfo&& i) CV_NOEXCEPT;\n\n    String name() const;\n    String vendor() const;\n\n    /// See CL_PLATFORM_VERSION\n    String version() const;\n    int versionMajor() const;\n    int versionMinor() const;\n\n    int deviceNumber() const;\n    void getDevice(Device& device, int d) const;\n\n    struct Impl;\n    bool empty() const { return !p; }\nprotected:\n    Impl* p;\n};\n\nCV_EXPORTS const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf);\nCV_EXPORTS const char* typeToStr(int t);\nCV_EXPORTS const char* memopTypeToStr(int t);\nCV_EXPORTS const char* vecopTypeToStr(int t);\nCV_EXPORTS const char* getOpenCLErrorString(int errorCode);\nCV_EXPORTS String kernelToStr(InputArray _kernel, int ddepth = -1, const char * name = NULL);\nCV_EXPORTS void getPlatfomsInfo(std::vector<PlatformInfo>& platform_info);\n\n\nenum OclVectorStrategy\n{\n    // all matrices have its own vector width\n    OCL_VECTOR_OWN = 0,\n    // all matrices have maximal vector width among all matrices\n    // (useful for cases when matrices have different data types)\n    OCL_VECTOR_MAX = 1,\n\n    // default strategy\n    OCL_VECTOR_DEFAULT = OCL_VECTOR_OWN\n};\n\nCV_EXPORTS int predictOptimalVectorWidth(InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(),\n                                         InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(),\n                                         InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray(),\n                                         OclVectorStrategy strat = OCL_VECTOR_DEFAULT);\n\nCV_EXPORTS int checkOptimalVectorWidth(const int *vectorWidths,\n                                       InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(),\n                                       InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(),\n                                       InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray(),\n                                       OclVectorStrategy strat = OCL_VECTOR_DEFAULT);\n\n// with OCL_VECTOR_MAX strategy\nCV_EXPORTS int predictOptimalVectorWidthMax(InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(),\n                                            InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(),\n                                            InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray());\n\nCV_EXPORTS void buildOptionsAddMatrixDescription(String& buildOptions, const String& name, InputArray _m);\n\nclass CV_EXPORTS Image2D\n{\npublic:\n    Image2D() CV_NOEXCEPT;\n\n    /**\n    @param src UMat object from which to get image properties and data\n    @param norm flag to enable the use of normalized channel data types\n    @param alias flag indicating that the image should alias the src UMat. If true, changes to the\n        image or src will be reflected in both objects.\n    */\n    explicit Image2D(const UMat &src, bool norm = false, bool alias = false);\n    Image2D(const Image2D & i);\n    ~Image2D();\n\n    Image2D & operator = (const Image2D & i);\n    Image2D(Image2D &&) CV_NOEXCEPT;\n    Image2D &operator=(Image2D &&) CV_NOEXCEPT;\n\n    /** Indicates if creating an aliased image should succeed.\n    Depends on the underlying platform and the dimensions of the UMat.\n    */\n    static bool canCreateAlias(const UMat &u);\n\n    /** Indicates if the image format is supported.\n    */\n    static bool isFormatSupported(int depth, int cn, bool norm);\n\n    void* ptr() const;\nprotected:\n    struct Impl;\n    Impl* p;\n};\n\nclass CV_EXPORTS Timer\n{\npublic:\n    Timer(const Queue& q);\n    ~Timer();\n    void start();\n    void stop();\n\n    uint64 durationNS() const; //< duration in nanoseconds\n\nprotected:\n    struct Impl;\n    Impl* const p;\n\nprivate:\n    Timer(const Timer&); // disabled\n    Timer& operator=(const Timer&); // disabled\n};\n\nCV_EXPORTS MatAllocator* getOpenCLAllocator();\n\n\nclass CV_EXPORTS_W OpenCLExecutionContext\n{\npublic:\n    OpenCLExecutionContext() = default;\n    ~OpenCLExecutionContext() = default;\n\n    OpenCLExecutionContext(const OpenCLExecutionContext&) = default;\n    OpenCLExecutionContext(OpenCLExecutionContext&&) = default;\n\n    OpenCLExecutionContext& operator=(const OpenCLExecutionContext&) = default;\n    OpenCLExecutionContext& operator=(OpenCLExecutionContext&&) = default;\n\n    /** Get associated ocl::Context */\n    Context& getContext() const;\n    /** Get the single default associated ocl::Device */\n    Device& getDevice() const;\n    /** Get the single ocl::Queue that is associated with the ocl::Context and\n     *  the single default ocl::Device\n     */\n    Queue& getQueue() const;\n\n    bool useOpenCL() const;\n    void setUseOpenCL(bool flag);\n\n    /** Get OpenCL execution context of current thread.\n     *\n     * Initialize OpenCL execution context if it is empty\n     * - create new\n     * - reuse context of the main thread (threadID = 0)\n     */\n    static OpenCLExecutionContext& getCurrent();\n\n    /** Get OpenCL execution context of current thread (can be empty) */\n    static OpenCLExecutionContext& getCurrentRef();\n\n    /** Bind this OpenCL execution context to current thread.\n     *\n     * Context can't be empty.\n     *\n     * @note clFinish is not called for queue of previous execution context\n     */\n    void bind() const;\n\n    /** Creates new execution context with same OpenCV context and device\n     *\n     * @param q OpenCL queue\n     */\n    OpenCLExecutionContext cloneWithNewQueue(const ocl::Queue& q) const;\n    /** @overload */\n    OpenCLExecutionContext cloneWithNewQueue() const;\n\n    /** @brief Creates OpenCL execution context\n     * OpenCV will check if available OpenCL platform has platformName name, then assign context to\n     * OpenCV and call `clRetainContext` function. The deviceID device will be used as target device and\n     * new command queue will be created.\n     *\n     * @note Lifetime of passed handles is transferred to OpenCV wrappers on success\n     *\n     * @param platformName name of OpenCL platform to attach, this string is used to check if platform is available to OpenCV at runtime\n     * @param platformID ID of platform attached context was created for (cl_platform_id)\n     * @param context OpenCL context to be attached to OpenCV (cl_context)\n     * @param deviceID OpenCL device (cl_device_id)\n     */\n    static OpenCLExecutionContext create(const std::string& platformName, void* platformID, void* context, void* deviceID);\n\n    /** @brief Creates OpenCL execution context\n     *\n     * @param context non-empty OpenCL context\n     * @param device non-empty OpenCL device (must be a part of context)\n     * @param queue non-empty OpenCL queue for provided context and device\n     */\n    static OpenCLExecutionContext create(const Context& context, const Device& device, const ocl::Queue& queue);\n    /** @overload */\n    static OpenCLExecutionContext create(const Context& context, const Device& device);\n\n    struct Impl;\n    inline bool empty() const { return !p; }\n    void release();\nprotected:\n    std::shared_ptr<Impl> p;\n};\n\nclass OpenCLExecutionContextScope\n{\n    OpenCLExecutionContext ctx_;\npublic:\n    inline OpenCLExecutionContextScope(const OpenCLExecutionContext& ctx)\n    {\n        CV_Assert(!ctx.empty());\n        ctx_ = OpenCLExecutionContext::getCurrentRef();\n        ctx.bind();\n    }\n\n    inline ~OpenCLExecutionContextScope()\n    {\n        if (!ctx_.empty())\n        {\n            ctx_.bind();\n        }\n    }\n};\n\n#ifdef __OPENCV_BUILD\nnamespace internal {\n\nCV_EXPORTS bool isOpenCLForced();\n#define OCL_FORCE_CHECK(condition) (cv::ocl::internal::isOpenCLForced() || (condition))\n\nCV_EXPORTS bool isPerformanceCheckBypassed();\n#define OCL_PERFORMANCE_CHECK(condition) (cv::ocl::internal::isPerformanceCheckBypassed() || (condition))\n\nCV_EXPORTS bool isCLBuffer(UMat& u);\n\n} // namespace internal\n#endif\n\n//! @}\n\n}}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/ocl_genbase.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the OpenCV Foundation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_OPENCL_GENBASE_HPP\n#define OPENCV_OPENCL_GENBASE_HPP\n\n//! @cond IGNORED\n\nnamespace cv {\nnamespace ocl {\n\nclass ProgramSource;\n\nnamespace internal {\n\nstruct CV_EXPORTS ProgramEntry\n{\n    const char* module;\n    const char* name;\n    const char* programCode;\n    const char* programHash;\n    ProgramSource* pProgramSource;\n\n    operator ProgramSource& () const;\n};\n\n} } } // namespace\n\n//! @endcond\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/ocl_defs.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n\n#ifndef OPENCV_CORE_OPENCL_DEFS_HPP\n#define OPENCV_CORE_OPENCL_DEFS_HPP\n\n#include \"opencv2/core/utility.hpp\"\n#include \"cvconfig.h\"\n\nnamespace cv { namespace ocl {\n#ifdef HAVE_OPENCL\n/// Call is similar to useOpenCL() but doesn't try to load OpenCL runtime or create OpenCL context\nCV_EXPORTS bool isOpenCLActivated();\n#else\nstatic inline bool isOpenCLActivated() { return false; }\n#endif\n}} // namespace\n\n\n//#define CV_OPENCL_RUN_ASSERT\n\n#ifdef HAVE_OPENCL\n\n#ifdef CV_OPENCL_RUN_VERBOSE\n#define CV_OCL_RUN_(condition, func, ...)                                   \\\n    {                                                                       \\\n        if (cv::ocl::isOpenCLActivated() && (condition) && func)            \\\n        {                                                                   \\\n            printf(\"%s: OpenCL implementation is running\\n\", CV_Func);      \\\n            fflush(stdout);                                                 \\\n            CV_IMPL_ADD(CV_IMPL_OCL);                                       \\\n            return __VA_ARGS__;                                             \\\n        }                                                                   \\\n        else                                                                \\\n        {                                                                   \\\n            printf(\"%s: Plain implementation is running\\n\", CV_Func);       \\\n            fflush(stdout);                                                 \\\n        }                                                                   \\\n    }\n#elif defined CV_OPENCL_RUN_ASSERT\n#define CV_OCL_RUN_(condition, func, ...)                                   \\\n    {                                                                       \\\n        if (cv::ocl::isOpenCLActivated() && (condition))                    \\\n        {                                                                   \\\n            if(func)                                                        \\\n            {                                                               \\\n                CV_IMPL_ADD(CV_IMPL_OCL);                                   \\\n            }                                                               \\\n            else                                                            \\\n            {                                                               \\\n                CV_Error(cv::Error::StsAssert, #func);                      \\\n            }                                                               \\\n            return __VA_ARGS__;                                             \\\n        }                                                                   \\\n    }\n#else\n#define CV_OCL_RUN_(condition, func, ...)                                   \\\ntry \\\n{ \\\n    if (cv::ocl::isOpenCLActivated() && (condition) && func)                \\\n    {                                                                       \\\n        CV_IMPL_ADD(CV_IMPL_OCL);                                           \\\n        return __VA_ARGS__;                                                 \\\n    } \\\n} \\\ncatch (const cv::Exception& e) \\\n{ \\\n    CV_UNUSED(e); /* TODO: Add some logging here */ \\\n}\n#endif\n\n#else\n#define CV_OCL_RUN_(condition, func, ...)\n#endif\n\n#define CV_OCL_RUN(condition, func) CV_OCL_RUN_(condition, func)\n\n#endif // OPENCV_CORE_OPENCL_DEFS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/opencl_info.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#include <iostream>\n\n#include <opencv2/core.hpp>\n#include <opencv2/core/ocl.hpp>\n\n#ifndef DUMP_CONFIG_PROPERTY\n#define DUMP_CONFIG_PROPERTY(...)\n#endif\n\n#ifndef DUMP_MESSAGE_STDOUT\n#define DUMP_MESSAGE_STDOUT(...) do { std::cout << __VA_ARGS__ << std::endl; } while (false)\n#endif\n\nnamespace cv {\n\nnamespace {\nstatic std::string bytesToStringRepr(size_t value)\n{\n    size_t b = value % 1024;\n    value /= 1024;\n\n    size_t kb = value % 1024;\n    value /= 1024;\n\n    size_t mb = value % 1024;\n    value /= 1024;\n\n    size_t gb = value;\n\n    std::ostringstream stream;\n\n    if (gb > 0)\n        stream << gb << \" GB \";\n    if (mb > 0)\n        stream << mb << \" MB \";\n    if (kb > 0)\n        stream << kb << \" KB \";\n    if (b > 0)\n        stream << b << \" B\";\n\n    std::string s = stream.str();\n    if (s[s.size() - 1] == ' ')\n        s = s.substr(0, s.size() - 1);\n    return s;\n}\n\nstatic String getDeviceTypeString(const cv::ocl::Device& device)\n{\n    if (device.type() == cv::ocl::Device::TYPE_CPU) {\n        return \"CPU\";\n    }\n\n    if (device.type() == cv::ocl::Device::TYPE_GPU) {\n        if (device.hostUnifiedMemory()) {\n            return \"iGPU\";\n        } else {\n            return \"dGPU\";\n        }\n    }\n\n    return \"unknown\";\n}\n} // namespace\n\nstatic void dumpOpenCLInformation()\n{\n    using namespace cv::ocl;\n\n    try\n    {\n        if (!haveOpenCL() || !useOpenCL())\n        {\n            DUMP_MESSAGE_STDOUT(\"OpenCL is disabled\");\n            DUMP_CONFIG_PROPERTY(\"cv_ocl\", \"disabled\");\n            return;\n        }\n\n        std::vector<PlatformInfo> platforms;\n        cv::ocl::getPlatfomsInfo(platforms);\n        if (platforms.empty())\n        {\n            DUMP_MESSAGE_STDOUT(\"OpenCL is not available\");\n            DUMP_CONFIG_PROPERTY(\"cv_ocl\", \"not available\");\n            return;\n        }\n\n        DUMP_MESSAGE_STDOUT(\"OpenCL Platforms: \");\n        for (size_t i = 0; i < platforms.size(); i++)\n        {\n            const PlatformInfo* platform = &platforms[i];\n            DUMP_MESSAGE_STDOUT(\"    \" << platform->name());\n            Device current_device;\n            for (int j = 0; j < platform->deviceNumber(); j++)\n            {\n                platform->getDevice(current_device, j);\n                String deviceTypeStr = getDeviceTypeString(current_device);\n                DUMP_MESSAGE_STDOUT( \"        \" << deviceTypeStr << \": \" << current_device.name() << \" (\" << current_device.version() << \")\");\n                DUMP_CONFIG_PROPERTY( cv::format(\"cv_ocl_platform_%d_device_%d\", (int)i, j ),\n                    cv::format(\"(Platform=%s)(Type=%s)(Name=%s)(Version=%s)\",\n                    platform->name().c_str(), deviceTypeStr.c_str(), current_device.name().c_str(), current_device.version().c_str()) );\n            }\n        }\n        const Device& device = Device::getDefault();\n        if (!device.available())\n            CV_Error(Error::OpenCLInitError, \"OpenCL device is not available\");\n\n        DUMP_MESSAGE_STDOUT(\"Current OpenCL device: \");\n\n        String deviceTypeStr = getDeviceTypeString(device);\n        DUMP_MESSAGE_STDOUT(\"    Type = \" << deviceTypeStr);\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_deviceType\", deviceTypeStr);\n\n        DUMP_MESSAGE_STDOUT(\"    Name = \" << device.name());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_deviceName\", device.name());\n\n        DUMP_MESSAGE_STDOUT(\"    Version = \" << device.version());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_deviceVersion\", device.version());\n\n        DUMP_MESSAGE_STDOUT(\"    Driver version = \" << device.driverVersion());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_driverVersion\", device.driverVersion());\n\n        DUMP_MESSAGE_STDOUT(\"    Address bits = \" << device.addressBits());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_addressBits\", device.addressBits());\n\n        DUMP_MESSAGE_STDOUT(\"    Compute units = \" << device.maxComputeUnits());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_maxComputeUnits\", device.maxComputeUnits());\n\n        DUMP_MESSAGE_STDOUT(\"    Max work group size = \" << device.maxWorkGroupSize());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_maxWorkGroupSize\", device.maxWorkGroupSize());\n\n        std::string localMemorySizeStr = bytesToStringRepr(device.localMemSize());\n        DUMP_MESSAGE_STDOUT(\"    Local memory size = \" << localMemorySizeStr);\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_localMemSize\", device.localMemSize());\n\n        std::string maxMemAllocSizeStr = bytesToStringRepr(device.maxMemAllocSize());\n        DUMP_MESSAGE_STDOUT(\"    Max memory allocation size = \" << maxMemAllocSizeStr);\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_maxMemAllocSize\", device.maxMemAllocSize());\n\n        const char* doubleSupportStr = device.doubleFPConfig() > 0 ? \"Yes\" : \"No\";\n        DUMP_MESSAGE_STDOUT(\"    Double support = \" << doubleSupportStr);\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_haveDoubleSupport\", device.doubleFPConfig() > 0);\n\n        const char* halfSupportStr = device.halfFPConfig() > 0 ? \"Yes\" : \"No\";\n        DUMP_MESSAGE_STDOUT(\"    Half support = \" << halfSupportStr);\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_haveHalfSupport\", device.halfFPConfig() > 0);\n\n        const char* isUnifiedMemoryStr = device.hostUnifiedMemory() ? \"Yes\" : \"No\";\n        DUMP_MESSAGE_STDOUT(\"    Host unified memory = \" << isUnifiedMemoryStr);\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_hostUnifiedMemory\", device.hostUnifiedMemory());\n\n        DUMP_MESSAGE_STDOUT(\"    Device extensions:\");\n        String extensionsStr = device.extensions();\n        size_t pos = 0;\n        while (pos < extensionsStr.size())\n        {\n            size_t pos2 = extensionsStr.find(' ', pos);\n            if (pos2 == String::npos)\n                pos2 = extensionsStr.size();\n            if (pos2 > pos)\n            {\n                String extensionName = extensionsStr.substr(pos, pos2 - pos);\n                DUMP_MESSAGE_STDOUT(\"        \" << extensionName);\n            }\n            pos = pos2 + 1;\n        }\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_extensions\", extensionsStr);\n\n        const char* haveAmdBlasStr = haveAmdBlas() ? \"Yes\" : \"No\";\n        DUMP_MESSAGE_STDOUT(\"    Has AMD Blas = \" << haveAmdBlasStr);\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_AmdBlas\", haveAmdBlas());\n\n        const char* haveAmdFftStr = haveAmdFft() ? \"Yes\" : \"No\";\n        DUMP_MESSAGE_STDOUT(\"    Has AMD Fft = \" << haveAmdFftStr);\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_AmdFft\", haveAmdFft());\n\n\n        DUMP_MESSAGE_STDOUT(\"    Preferred vector width char = \" << device.preferredVectorWidthChar());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_preferredVectorWidthChar\", device.preferredVectorWidthChar());\n\n        DUMP_MESSAGE_STDOUT(\"    Preferred vector width short = \" << device.preferredVectorWidthShort());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_preferredVectorWidthShort\", device.preferredVectorWidthShort());\n\n        DUMP_MESSAGE_STDOUT(\"    Preferred vector width int = \" << device.preferredVectorWidthInt());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_preferredVectorWidthInt\", device.preferredVectorWidthInt());\n\n        DUMP_MESSAGE_STDOUT(\"    Preferred vector width long = \" << device.preferredVectorWidthLong());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_preferredVectorWidthLong\", device.preferredVectorWidthLong());\n\n        DUMP_MESSAGE_STDOUT(\"    Preferred vector width float = \" << device.preferredVectorWidthFloat());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_preferredVectorWidthFloat\", device.preferredVectorWidthFloat());\n\n        DUMP_MESSAGE_STDOUT(\"    Preferred vector width double = \" << device.preferredVectorWidthDouble());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_preferredVectorWidthDouble\", device.preferredVectorWidthDouble());\n\n        DUMP_MESSAGE_STDOUT(\"    Preferred vector width half = \" << device.preferredVectorWidthHalf());\n        DUMP_CONFIG_PROPERTY(\"cv_ocl_current_preferredVectorWidthHalf\", device.preferredVectorWidthHalf());\n    }\n    catch (...)\n    {\n        DUMP_MESSAGE_STDOUT(\"Exception. Can't dump OpenCL info\");\n        DUMP_MESSAGE_STDOUT(\"OpenCL device not available\");\n        DUMP_CONFIG_PROPERTY(\"cv_ocl\", \"not available\");\n    }\n}\n#undef DUMP_MESSAGE_STDOUT\n#undef DUMP_CONFIG_PROPERTY\n\n} // namespace\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/opencl_svm.hpp",
    "content": "/* See LICENSE file in the root OpenCV directory */\n\n#ifndef OPENCV_CORE_OPENCL_SVM_HPP\n#define OPENCV_CORE_OPENCL_SVM_HPP\n\n//\n// Internal usage only (binary compatibility is not guaranteed)\n//\n#ifndef __OPENCV_BUILD\n#error Internal header file\n#endif\n\n#if defined(HAVE_OPENCL) && defined(HAVE_OPENCL_SVM)\n#include \"runtime/opencl_core.hpp\"\n#include \"runtime/opencl_svm_20.hpp\"\n#include \"runtime/opencl_svm_hsa_extension.hpp\"\n\nnamespace cv { namespace ocl { namespace svm {\n\nstruct SVMCapabilities\n{\n    enum Value\n    {\n        SVM_COARSE_GRAIN_BUFFER = (1 << 0),\n        SVM_FINE_GRAIN_BUFFER = (1 << 1),\n        SVM_FINE_GRAIN_SYSTEM = (1 << 2),\n        SVM_ATOMICS = (1 << 3),\n    };\n    int value_;\n\n    SVMCapabilities(int capabilities = 0) : value_(capabilities) { }\n    operator int() const { return value_; }\n\n    inline bool isNoSVMSupport() const { return value_ == 0; }\n    inline bool isSupportCoarseGrainBuffer() const { return (value_ & SVM_COARSE_GRAIN_BUFFER) != 0; }\n    inline bool isSupportFineGrainBuffer() const { return (value_ & SVM_FINE_GRAIN_BUFFER) != 0; }\n    inline bool isSupportFineGrainSystem() const { return (value_ & SVM_FINE_GRAIN_SYSTEM) != 0; }\n    inline bool isSupportAtomics() const { return (value_ & SVM_ATOMICS) != 0; }\n};\n\nCV_EXPORTS const SVMCapabilities getSVMCapabilitites(const ocl::Context& context);\n\nstruct SVMFunctions\n{\n    clSVMAllocAMD_fn fn_clSVMAlloc;\n    clSVMFreeAMD_fn fn_clSVMFree;\n    clSetKernelArgSVMPointerAMD_fn fn_clSetKernelArgSVMPointer;\n    //clSetKernelExecInfoAMD_fn fn_clSetKernelExecInfo;\n    //clEnqueueSVMFreeAMD_fn fn_clEnqueueSVMFree;\n    clEnqueueSVMMemcpyAMD_fn fn_clEnqueueSVMMemcpy;\n    clEnqueueSVMMemFillAMD_fn fn_clEnqueueSVMMemFill;\n    clEnqueueSVMMapAMD_fn fn_clEnqueueSVMMap;\n    clEnqueueSVMUnmapAMD_fn fn_clEnqueueSVMUnmap;\n\n    inline SVMFunctions()\n        : fn_clSVMAlloc(NULL), fn_clSVMFree(NULL),\n          fn_clSetKernelArgSVMPointer(NULL), /*fn_clSetKernelExecInfo(NULL),*/\n          /*fn_clEnqueueSVMFree(NULL),*/ fn_clEnqueueSVMMemcpy(NULL), fn_clEnqueueSVMMemFill(NULL),\n          fn_clEnqueueSVMMap(NULL), fn_clEnqueueSVMUnmap(NULL)\n    {\n        // nothing\n    }\n\n    inline bool isValid() const\n    {\n        return fn_clSVMAlloc != NULL && fn_clSVMFree && fn_clSetKernelArgSVMPointer &&\n                /*fn_clSetKernelExecInfo && fn_clEnqueueSVMFree &&*/ fn_clEnqueueSVMMemcpy &&\n                fn_clEnqueueSVMMemFill && fn_clEnqueueSVMMap && fn_clEnqueueSVMUnmap;\n    }\n};\n\n// We should guarantee that SVMFunctions lifetime is not less than context's lifetime\nCV_EXPORTS const SVMFunctions* getSVMFunctions(const ocl::Context& context);\n\nCV_EXPORTS bool useSVM(UMatUsageFlags usageFlags);\n\n}}} //namespace cv::ocl::svm\n#endif\n\n#endif // OPENCV_CORE_OPENCL_SVM_HPP\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/autogenerated/opencl_clblas.hpp",
    "content": "//\n// AUTOGENERATED, DO NOT EDIT\n//\n#ifndef OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP\n#error \"Invalid usage\"\n#endif\n\n// generated by parser_clblas.py\n#define clblasCaxpy clblasCaxpy_\n#define clblasCcopy clblasCcopy_\n#define clblasCdotc clblasCdotc_\n#define clblasCdotu clblasCdotu_\n#define clblasCgbmv clblasCgbmv_\n#define clblasCgemm clblasCgemm_\n#define clblasCgemv clblasCgemv_\n#define clblasCgerc clblasCgerc_\n#define clblasCgeru clblasCgeru_\n#define clblasChbmv clblasChbmv_\n#define clblasChemm clblasChemm_\n#define clblasChemv clblasChemv_\n#define clblasCher clblasCher_\n#define clblasCher2 clblasCher2_\n#define clblasCher2k clblasCher2k_\n#define clblasCherk clblasCherk_\n#define clblasChpmv clblasChpmv_\n#define clblasChpr clblasChpr_\n#define clblasChpr2 clblasChpr2_\n#define clblasCrotg clblasCrotg_\n#define clblasCscal clblasCscal_\n#define clblasCsrot clblasCsrot_\n#define clblasCsscal clblasCsscal_\n#define clblasCswap clblasCswap_\n#define clblasCsymm clblasCsymm_\n#define clblasCsyr2k clblasCsyr2k_\n#define clblasCsyrk clblasCsyrk_\n#define clblasCtbmv clblasCtbmv_\n#define clblasCtbsv clblasCtbsv_\n#define clblasCtpmv clblasCtpmv_\n#define clblasCtpsv clblasCtpsv_\n#define clblasCtrmm clblasCtrmm_\n#define clblasCtrmv clblasCtrmv_\n#define clblasCtrsm clblasCtrsm_\n#define clblasCtrsv clblasCtrsv_\n#define clblasDasum clblasDasum_\n#define clblasDaxpy clblasDaxpy_\n#define clblasDcopy clblasDcopy_\n#define clblasDdot clblasDdot_\n#define clblasDgbmv clblasDgbmv_\n#define clblasDgemm clblasDgemm_\n#define clblasDgemv clblasDgemv_\n#define clblasDger clblasDger_\n#define clblasDnrm2 clblasDnrm2_\n#define clblasDrot clblasDrot_\n#define clblasDrotg clblasDrotg_\n#define clblasDrotm clblasDrotm_\n#define clblasDrotmg clblasDrotmg_\n#define clblasDsbmv clblasDsbmv_\n#define clblasDscal clblasDscal_\n#define clblasDspmv clblasDspmv_\n#define clblasDspr clblasDspr_\n#define clblasDspr2 clblasDspr2_\n#define clblasDswap clblasDswap_\n#define clblasDsymm clblasDsymm_\n#define clblasDsymv clblasDsymv_\n#define clblasDsyr clblasDsyr_\n#define clblasDsyr2 clblasDsyr2_\n#define clblasDsyr2k clblasDsyr2k_\n#define clblasDsyrk clblasDsyrk_\n#define clblasDtbmv clblasDtbmv_\n#define clblasDtbsv clblasDtbsv_\n#define clblasDtpmv clblasDtpmv_\n#define clblasDtpsv clblasDtpsv_\n#define clblasDtrmm clblasDtrmm_\n#define clblasDtrmv clblasDtrmv_\n#define clblasDtrsm clblasDtrsm_\n#define clblasDtrsv clblasDtrsv_\n#define clblasDzasum clblasDzasum_\n#define clblasDznrm2 clblasDznrm2_\n#define clblasGetVersion clblasGetVersion_\n#define clblasSasum clblasSasum_\n#define clblasSaxpy clblasSaxpy_\n#define clblasScasum clblasScasum_\n#define clblasScnrm2 clblasScnrm2_\n#define clblasScopy clblasScopy_\n#define clblasSdot clblasSdot_\n#define clblasSetup clblasSetup_\n#define clblasSgbmv clblasSgbmv_\n#define clblasSgemm clblasSgemm_\n#define clblasSgemv clblasSgemv_\n#define clblasSger clblasSger_\n#define clblasSnrm2 clblasSnrm2_\n#define clblasSrot clblasSrot_\n#define clblasSrotg clblasSrotg_\n#define clblasSrotm clblasSrotm_\n#define clblasSrotmg clblasSrotmg_\n#define clblasSsbmv clblasSsbmv_\n#define clblasSscal clblasSscal_\n#define clblasSspmv clblasSspmv_\n#define clblasSspr clblasSspr_\n#define clblasSspr2 clblasSspr2_\n#define clblasSswap clblasSswap_\n#define clblasSsymm clblasSsymm_\n#define clblasSsymv clblasSsymv_\n#define clblasSsyr clblasSsyr_\n#define clblasSsyr2 clblasSsyr2_\n#define clblasSsyr2k clblasSsyr2k_\n#define clblasSsyrk clblasSsyrk_\n#define clblasStbmv clblasStbmv_\n#define clblasStbsv clblasStbsv_\n#define clblasStpmv clblasStpmv_\n#define clblasStpsv clblasStpsv_\n#define clblasStrmm clblasStrmm_\n#define clblasStrmv clblasStrmv_\n#define clblasStrsm clblasStrsm_\n#define clblasStrsv clblasStrsv_\n#define clblasTeardown clblasTeardown_\n#define clblasZaxpy clblasZaxpy_\n#define clblasZcopy clblasZcopy_\n#define clblasZdotc clblasZdotc_\n#define clblasZdotu clblasZdotu_\n#define clblasZdrot clblasZdrot_\n#define clblasZdscal clblasZdscal_\n#define clblasZgbmv clblasZgbmv_\n#define clblasZgemm clblasZgemm_\n#define clblasZgemv clblasZgemv_\n#define clblasZgerc clblasZgerc_\n#define clblasZgeru clblasZgeru_\n#define clblasZhbmv clblasZhbmv_\n#define clblasZhemm clblasZhemm_\n#define clblasZhemv clblasZhemv_\n#define clblasZher clblasZher_\n#define clblasZher2 clblasZher2_\n#define clblasZher2k clblasZher2k_\n#define clblasZherk clblasZherk_\n#define clblasZhpmv clblasZhpmv_\n#define clblasZhpr clblasZhpr_\n#define clblasZhpr2 clblasZhpr2_\n#define clblasZrotg clblasZrotg_\n#define clblasZscal clblasZscal_\n#define clblasZswap clblasZswap_\n#define clblasZsymm clblasZsymm_\n#define clblasZsyr2k clblasZsyr2k_\n#define clblasZsyrk clblasZsyrk_\n#define clblasZtbmv clblasZtbmv_\n#define clblasZtbsv clblasZtbsv_\n#define clblasZtpmv clblasZtpmv_\n#define clblasZtpsv clblasZtpsv_\n#define clblasZtrmm clblasZtrmm_\n#define clblasZtrmv clblasZtrmv_\n#define clblasZtrsm clblasZtrsm_\n#define clblasZtrsv clblasZtrsv_\n#define clblasiCamax clblasiCamax_\n#define clblasiDamax clblasiDamax_\n#define clblasiSamax clblasiSamax_\n#define clblasiZamax clblasiZamax_\n\n#include <clBLAS.h>\n\n// generated by parser_clblas.py\n#undef clblasCaxpy\n//#define clblasCaxpy clblasCaxpy_pfn\n#undef clblasCcopy\n//#define clblasCcopy clblasCcopy_pfn\n#undef clblasCdotc\n//#define clblasCdotc clblasCdotc_pfn\n#undef clblasCdotu\n//#define clblasCdotu clblasCdotu_pfn\n#undef clblasCgbmv\n//#define clblasCgbmv clblasCgbmv_pfn\n#undef clblasCgemm\n#define clblasCgemm clblasCgemm_pfn\n#undef clblasCgemv\n//#define clblasCgemv clblasCgemv_pfn\n#undef clblasCgerc\n//#define clblasCgerc clblasCgerc_pfn\n#undef clblasCgeru\n//#define clblasCgeru clblasCgeru_pfn\n#undef clblasChbmv\n//#define clblasChbmv clblasChbmv_pfn\n#undef clblasChemm\n//#define clblasChemm clblasChemm_pfn\n#undef clblasChemv\n//#define clblasChemv clblasChemv_pfn\n#undef clblasCher\n//#define clblasCher clblasCher_pfn\n#undef clblasCher2\n//#define clblasCher2 clblasCher2_pfn\n#undef clblasCher2k\n//#define clblasCher2k clblasCher2k_pfn\n#undef clblasCherk\n//#define clblasCherk clblasCherk_pfn\n#undef clblasChpmv\n//#define clblasChpmv clblasChpmv_pfn\n#undef clblasChpr\n//#define clblasChpr clblasChpr_pfn\n#undef clblasChpr2\n//#define clblasChpr2 clblasChpr2_pfn\n#undef clblasCrotg\n//#define clblasCrotg clblasCrotg_pfn\n#undef clblasCscal\n//#define clblasCscal clblasCscal_pfn\n#undef clblasCsrot\n//#define clblasCsrot clblasCsrot_pfn\n#undef clblasCsscal\n//#define clblasCsscal clblasCsscal_pfn\n#undef clblasCswap\n//#define clblasCswap clblasCswap_pfn\n#undef clblasCsymm\n//#define clblasCsymm clblasCsymm_pfn\n#undef clblasCsyr2k\n//#define clblasCsyr2k clblasCsyr2k_pfn\n#undef clblasCsyrk\n//#define clblasCsyrk clblasCsyrk_pfn\n#undef clblasCtbmv\n//#define clblasCtbmv clblasCtbmv_pfn\n#undef clblasCtbsv\n//#define clblasCtbsv clblasCtbsv_pfn\n#undef clblasCtpmv\n//#define clblasCtpmv clblasCtpmv_pfn\n#undef clblasCtpsv\n//#define clblasCtpsv clblasCtpsv_pfn\n#undef clblasCtrmm\n//#define clblasCtrmm clblasCtrmm_pfn\n#undef clblasCtrmv\n//#define clblasCtrmv clblasCtrmv_pfn\n#undef clblasCtrsm\n//#define clblasCtrsm clblasCtrsm_pfn\n#undef clblasCtrsv\n//#define clblasCtrsv clblasCtrsv_pfn\n#undef clblasDasum\n//#define clblasDasum clblasDasum_pfn\n#undef clblasDaxpy\n//#define clblasDaxpy clblasDaxpy_pfn\n#undef clblasDcopy\n//#define clblasDcopy clblasDcopy_pfn\n#undef clblasDdot\n//#define clblasDdot clblasDdot_pfn\n#undef clblasDgbmv\n//#define clblasDgbmv clblasDgbmv_pfn\n#undef clblasDgemm\n#define clblasDgemm clblasDgemm_pfn\n#undef clblasDgemv\n//#define clblasDgemv clblasDgemv_pfn\n#undef clblasDger\n//#define clblasDger clblasDger_pfn\n#undef clblasDnrm2\n//#define clblasDnrm2 clblasDnrm2_pfn\n#undef clblasDrot\n//#define clblasDrot clblasDrot_pfn\n#undef clblasDrotg\n//#define clblasDrotg clblasDrotg_pfn\n#undef clblasDrotm\n//#define clblasDrotm clblasDrotm_pfn\n#undef clblasDrotmg\n//#define clblasDrotmg clblasDrotmg_pfn\n#undef clblasDsbmv\n//#define clblasDsbmv clblasDsbmv_pfn\n#undef clblasDscal\n//#define clblasDscal clblasDscal_pfn\n#undef clblasDspmv\n//#define clblasDspmv clblasDspmv_pfn\n#undef clblasDspr\n//#define clblasDspr clblasDspr_pfn\n#undef clblasDspr2\n//#define clblasDspr2 clblasDspr2_pfn\n#undef clblasDswap\n//#define clblasDswap clblasDswap_pfn\n#undef clblasDsymm\n//#define clblasDsymm clblasDsymm_pfn\n#undef clblasDsymv\n//#define clblasDsymv clblasDsymv_pfn\n#undef clblasDsyr\n//#define clblasDsyr clblasDsyr_pfn\n#undef clblasDsyr2\n//#define clblasDsyr2 clblasDsyr2_pfn\n#undef clblasDsyr2k\n//#define clblasDsyr2k clblasDsyr2k_pfn\n#undef clblasDsyrk\n//#define clblasDsyrk clblasDsyrk_pfn\n#undef clblasDtbmv\n//#define clblasDtbmv clblasDtbmv_pfn\n#undef clblasDtbsv\n//#define clblasDtbsv clblasDtbsv_pfn\n#undef clblasDtpmv\n//#define clblasDtpmv clblasDtpmv_pfn\n#undef clblasDtpsv\n//#define clblasDtpsv clblasDtpsv_pfn\n#undef clblasDtrmm\n//#define clblasDtrmm clblasDtrmm_pfn\n#undef clblasDtrmv\n//#define clblasDtrmv clblasDtrmv_pfn\n#undef clblasDtrsm\n//#define clblasDtrsm clblasDtrsm_pfn\n#undef clblasDtrsv\n//#define clblasDtrsv clblasDtrsv_pfn\n#undef clblasDzasum\n//#define clblasDzasum clblasDzasum_pfn\n#undef clblasDznrm2\n//#define clblasDznrm2 clblasDznrm2_pfn\n#undef clblasGetVersion\n//#define clblasGetVersion clblasGetVersion_pfn\n#undef clblasSasum\n//#define clblasSasum clblasSasum_pfn\n#undef clblasSaxpy\n//#define clblasSaxpy clblasSaxpy_pfn\n#undef clblasScasum\n//#define clblasScasum clblasScasum_pfn\n#undef clblasScnrm2\n//#define clblasScnrm2 clblasScnrm2_pfn\n#undef clblasScopy\n//#define clblasScopy clblasScopy_pfn\n#undef clblasSdot\n//#define clblasSdot clblasSdot_pfn\n#undef clblasSetup\n#define clblasSetup clblasSetup_pfn\n#undef clblasSgbmv\n//#define clblasSgbmv clblasSgbmv_pfn\n#undef clblasSgemm\n#define clblasSgemm clblasSgemm_pfn\n#undef clblasSgemv\n//#define clblasSgemv clblasSgemv_pfn\n#undef clblasSger\n//#define clblasSger clblasSger_pfn\n#undef clblasSnrm2\n//#define clblasSnrm2 clblasSnrm2_pfn\n#undef clblasSrot\n//#define clblasSrot clblasSrot_pfn\n#undef clblasSrotg\n//#define clblasSrotg clblasSrotg_pfn\n#undef clblasSrotm\n//#define clblasSrotm clblasSrotm_pfn\n#undef clblasSrotmg\n//#define clblasSrotmg clblasSrotmg_pfn\n#undef clblasSsbmv\n//#define clblasSsbmv clblasSsbmv_pfn\n#undef clblasSscal\n//#define clblasSscal clblasSscal_pfn\n#undef clblasSspmv\n//#define clblasSspmv clblasSspmv_pfn\n#undef clblasSspr\n//#define clblasSspr clblasSspr_pfn\n#undef clblasSspr2\n//#define clblasSspr2 clblasSspr2_pfn\n#undef clblasSswap\n//#define clblasSswap clblasSswap_pfn\n#undef clblasSsymm\n//#define clblasSsymm clblasSsymm_pfn\n#undef clblasSsymv\n//#define clblasSsymv clblasSsymv_pfn\n#undef clblasSsyr\n//#define clblasSsyr clblasSsyr_pfn\n#undef clblasSsyr2\n//#define clblasSsyr2 clblasSsyr2_pfn\n#undef clblasSsyr2k\n//#define clblasSsyr2k clblasSsyr2k_pfn\n#undef clblasSsyrk\n//#define clblasSsyrk clblasSsyrk_pfn\n#undef clblasStbmv\n//#define clblasStbmv clblasStbmv_pfn\n#undef clblasStbsv\n//#define clblasStbsv clblasStbsv_pfn\n#undef clblasStpmv\n//#define clblasStpmv clblasStpmv_pfn\n#undef clblasStpsv\n//#define clblasStpsv clblasStpsv_pfn\n#undef clblasStrmm\n//#define clblasStrmm clblasStrmm_pfn\n#undef clblasStrmv\n//#define clblasStrmv clblasStrmv_pfn\n#undef clblasStrsm\n//#define clblasStrsm clblasStrsm_pfn\n#undef clblasStrsv\n//#define clblasStrsv clblasStrsv_pfn\n#undef clblasTeardown\n#define clblasTeardown clblasTeardown_pfn\n#undef clblasZaxpy\n//#define clblasZaxpy clblasZaxpy_pfn\n#undef clblasZcopy\n//#define clblasZcopy clblasZcopy_pfn\n#undef clblasZdotc\n//#define clblasZdotc clblasZdotc_pfn\n#undef clblasZdotu\n//#define clblasZdotu clblasZdotu_pfn\n#undef clblasZdrot\n//#define clblasZdrot clblasZdrot_pfn\n#undef clblasZdscal\n//#define clblasZdscal clblasZdscal_pfn\n#undef clblasZgbmv\n//#define clblasZgbmv clblasZgbmv_pfn\n#undef clblasZgemm\n#define clblasZgemm clblasZgemm_pfn\n#undef clblasZgemv\n//#define clblasZgemv clblasZgemv_pfn\n#undef clblasZgerc\n//#define clblasZgerc clblasZgerc_pfn\n#undef clblasZgeru\n//#define clblasZgeru clblasZgeru_pfn\n#undef clblasZhbmv\n//#define clblasZhbmv clblasZhbmv_pfn\n#undef clblasZhemm\n//#define clblasZhemm clblasZhemm_pfn\n#undef clblasZhemv\n//#define clblasZhemv clblasZhemv_pfn\n#undef clblasZher\n//#define clblasZher clblasZher_pfn\n#undef clblasZher2\n//#define clblasZher2 clblasZher2_pfn\n#undef clblasZher2k\n//#define clblasZher2k clblasZher2k_pfn\n#undef clblasZherk\n//#define clblasZherk clblasZherk_pfn\n#undef clblasZhpmv\n//#define clblasZhpmv clblasZhpmv_pfn\n#undef clblasZhpr\n//#define clblasZhpr clblasZhpr_pfn\n#undef clblasZhpr2\n//#define clblasZhpr2 clblasZhpr2_pfn\n#undef clblasZrotg\n//#define clblasZrotg clblasZrotg_pfn\n#undef clblasZscal\n//#define clblasZscal clblasZscal_pfn\n#undef clblasZswap\n//#define clblasZswap clblasZswap_pfn\n#undef clblasZsymm\n//#define clblasZsymm clblasZsymm_pfn\n#undef clblasZsyr2k\n//#define clblasZsyr2k clblasZsyr2k_pfn\n#undef clblasZsyrk\n//#define clblasZsyrk clblasZsyrk_pfn\n#undef clblasZtbmv\n//#define clblasZtbmv clblasZtbmv_pfn\n#undef clblasZtbsv\n//#define clblasZtbsv clblasZtbsv_pfn\n#undef clblasZtpmv\n//#define clblasZtpmv clblasZtpmv_pfn\n#undef clblasZtpsv\n//#define clblasZtpsv clblasZtpsv_pfn\n#undef clblasZtrmm\n//#define clblasZtrmm clblasZtrmm_pfn\n#undef clblasZtrmv\n//#define clblasZtrmv clblasZtrmv_pfn\n#undef clblasZtrsm\n//#define clblasZtrsm clblasZtrsm_pfn\n#undef clblasZtrsv\n//#define clblasZtrsv clblasZtrsv_pfn\n#undef clblasiCamax\n//#define clblasiCamax clblasiCamax_pfn\n#undef clblasiDamax\n//#define clblasiDamax clblasiDamax_pfn\n#undef clblasiSamax\n//#define clblasiSamax clblasiSamax_pfn\n#undef clblasiZamax\n//#define clblasiZamax clblasiZamax_pfn\n\n// generated by parser_clblas.py\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCaxpy)(size_t N, cl_float2 alpha, const cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCcopy)(size_t N, const cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCdotc)(size_t N, cl_mem dotProduct, size_t offDP, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCdotu)(size_t N, cl_mem dotProduct, size_t offDP, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCgbmv)(clblasOrder order, clblasTranspose trans, size_t M, size_t N, size_t KL, size_t KU, cl_float2 alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, cl_float2 beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\nextern CL_RUNTIME_EXPORT clblasStatus (*clblasCgemm)(clblasOrder order, clblasTranspose transA, clblasTranspose transB, size_t M, size_t N, size_t K, FloatComplex alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, FloatComplex beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCgemv)(clblasOrder order, clblasTranspose transA, size_t M, size_t N, FloatComplex alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem x, size_t offx, int incx, FloatComplex beta, cl_mem y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCgerc)(clblasOrder order, size_t M, size_t N, cl_float2 alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCgeru)(clblasOrder order, size_t M, size_t N, cl_float2 alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasChbmv)(clblasOrder order, clblasUplo uplo, size_t N, size_t K, cl_float2 alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, cl_float2 beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasChemm)(clblasOrder order, clblasSide side, clblasUplo uplo, size_t M, size_t N, cl_float2 alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem B, size_t offb, size_t ldb, cl_float2 beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasChemv)(clblasOrder order, clblasUplo uplo, size_t N, FloatComplex alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, FloatComplex beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCher)(clblasOrder order, clblasUplo uplo, size_t N, cl_float alpha, const cl_mem X, size_t offx, int incx, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCher2)(clblasOrder order, clblasUplo uplo, size_t N, cl_float2 alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCher2k)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, size_t N, size_t K, FloatComplex alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem B, size_t offb, size_t ldb, cl_float beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCherk)(clblasOrder order, clblasUplo uplo, clblasTranspose transA, size_t N, size_t K, float alpha, const cl_mem A, size_t offa, size_t lda, float beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasChpmv)(clblasOrder order, clblasUplo uplo, size_t N, cl_float2 alpha, const cl_mem AP, size_t offa, const cl_mem X, size_t offx, int incx, cl_float2 beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasChpr)(clblasOrder order, clblasUplo uplo, size_t N, cl_float alpha, const cl_mem X, size_t offx, int incx, cl_mem AP, size_t offa, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasChpr2)(clblasOrder order, clblasUplo uplo, size_t N, cl_float2 alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem AP, size_t offa, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCrotg)(cl_mem CA, size_t offCA, cl_mem CB, size_t offCB, cl_mem C, size_t offC, cl_mem S, size_t offS, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCscal)(size_t N, cl_float2 alpha, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCsrot)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_float C, cl_float S, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCsscal)(size_t N, cl_float alpha, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCswap)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCsymm)(clblasOrder order, clblasSide side, clblasUplo uplo, size_t M, size_t N, cl_float2 alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem B, size_t offb, size_t ldb, cl_float2 beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCsyr2k)(clblasOrder order, clblasUplo uplo, clblasTranspose transAB, size_t N, size_t K, FloatComplex alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, FloatComplex beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCsyrk)(clblasOrder order, clblasUplo uplo, clblasTranspose transA, size_t N, size_t K, FloatComplex alpha, const cl_mem A, size_t offA, size_t lda, FloatComplex beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCtbmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, size_t K, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCtbsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, size_t K, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCtpmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem AP, size_t offa, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCtpsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCtrmm)(clblasOrder order, clblasSide side, clblasUplo uplo, clblasTranspose transA, clblasDiag diag, size_t M, size_t N, FloatComplex alpha, const cl_mem A, size_t offA, size_t lda, cl_mem B, size_t offB, size_t ldb, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCtrmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCtrsm)(clblasOrder order, clblasSide side, clblasUplo uplo, clblasTranspose transA, clblasDiag diag, size_t M, size_t N, FloatComplex alpha, const cl_mem A, size_t offA, size_t lda, cl_mem B, size_t offB, size_t ldb, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasCtrsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDasum)(size_t N, cl_mem asum, size_t offAsum, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDaxpy)(size_t N, cl_double alpha, const cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDcopy)(size_t N, const cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDdot)(size_t N, cl_mem dotProduct, size_t offDP, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDgbmv)(clblasOrder order, clblasTranspose trans, size_t M, size_t N, size_t KL, size_t KU, cl_double alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, cl_double beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\nextern CL_RUNTIME_EXPORT clblasStatus (*clblasDgemm)(clblasOrder order, clblasTranspose transA, clblasTranspose transB, size_t M, size_t N, size_t K, cl_double alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, cl_double beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDgemv)(clblasOrder order, clblasTranspose transA, size_t M, size_t N, cl_double alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem x, size_t offx, int incx, cl_double beta, cl_mem y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDger)(clblasOrder order, size_t M, size_t N, cl_double alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDnrm2)(size_t N, cl_mem NRM2, size_t offNRM2, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDrot)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_double C, cl_double S, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDrotg)(cl_mem DA, size_t offDA, cl_mem DB, size_t offDB, cl_mem C, size_t offC, cl_mem S, size_t offS, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDrotm)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, const cl_mem DPARAM, size_t offDparam, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDrotmg)(cl_mem DD1, size_t offDD1, cl_mem DD2, size_t offDD2, cl_mem DX1, size_t offDX1, const cl_mem DY1, size_t offDY1, cl_mem DPARAM, size_t offDparam, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDsbmv)(clblasOrder order, clblasUplo uplo, size_t N, size_t K, cl_double alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, cl_double beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDscal)(size_t N, cl_double alpha, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDspmv)(clblasOrder order, clblasUplo uplo, size_t N, cl_double alpha, const cl_mem AP, size_t offa, const cl_mem X, size_t offx, int incx, cl_double beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDspr)(clblasOrder order, clblasUplo uplo, size_t N, cl_double alpha, const cl_mem X, size_t offx, int incx, cl_mem AP, size_t offa, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDspr2)(clblasOrder order, clblasUplo uplo, size_t N, cl_double alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem AP, size_t offa, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDswap)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDsymm)(clblasOrder order, clblasSide side, clblasUplo uplo, size_t M, size_t N, cl_double alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem B, size_t offb, size_t ldb, cl_double beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDsymv)(clblasOrder order, clblasUplo uplo, size_t N, cl_double alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem x, size_t offx, int incx, cl_double beta, cl_mem y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDsyr)(clblasOrder order, clblasUplo uplo, size_t N, cl_double alpha, const cl_mem X, size_t offx, int incx, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDsyr2)(clblasOrder order, clblasUplo uplo, size_t N, cl_double alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDsyr2k)(clblasOrder order, clblasUplo uplo, clblasTranspose transAB, size_t N, size_t K, cl_double alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, cl_double beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDsyrk)(clblasOrder order, clblasUplo uplo, clblasTranspose transA, size_t N, size_t K, cl_double alpha, const cl_mem A, size_t offA, size_t lda, cl_double beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDtbmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, size_t K, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDtbsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, size_t K, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDtpmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem AP, size_t offa, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDtpsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDtrmm)(clblasOrder order, clblasSide side, clblasUplo uplo, clblasTranspose transA, clblasDiag diag, size_t M, size_t N, cl_double alpha, const cl_mem A, size_t offA, size_t lda, cl_mem B, size_t offB, size_t ldb, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDtrmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDtrsm)(clblasOrder order, clblasSide side, clblasUplo uplo, clblasTranspose transA, clblasDiag diag, size_t M, size_t N, cl_double alpha, const cl_mem A, size_t offA, size_t lda, cl_mem B, size_t offB, size_t ldb, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDtrsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDzasum)(size_t N, cl_mem asum, size_t offAsum, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasDznrm2)(size_t N, cl_mem NRM2, size_t offNRM2, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasGetVersion)(cl_uint* major, cl_uint* minor, cl_uint* patch);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSasum)(size_t N, cl_mem asum, size_t offAsum, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSaxpy)(size_t N, cl_float alpha, const cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasScasum)(size_t N, cl_mem asum, size_t offAsum, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasScnrm2)(size_t N, cl_mem NRM2, size_t offNRM2, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasScopy)(size_t N, const cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSdot)(size_t N, cl_mem dotProduct, size_t offDP, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\nextern CL_RUNTIME_EXPORT clblasStatus (*clblasSetup)();\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSgbmv)(clblasOrder order, clblasTranspose trans, size_t M, size_t N, size_t KL, size_t KU, cl_float alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, cl_float beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\nextern CL_RUNTIME_EXPORT clblasStatus (*clblasSgemm)(clblasOrder order, clblasTranspose transA, clblasTranspose transB, size_t M, size_t N, size_t K, cl_float alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, cl_float beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSgemv)(clblasOrder order, clblasTranspose transA, size_t M, size_t N, cl_float alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem x, size_t offx, int incx, cl_float beta, cl_mem y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSger)(clblasOrder order, size_t M, size_t N, cl_float alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSnrm2)(size_t N, cl_mem NRM2, size_t offNRM2, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSrot)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_float C, cl_float S, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSrotg)(cl_mem SA, size_t offSA, cl_mem SB, size_t offSB, cl_mem C, size_t offC, cl_mem S, size_t offS, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSrotm)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, const cl_mem SPARAM, size_t offSparam, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSrotmg)(cl_mem SD1, size_t offSD1, cl_mem SD2, size_t offSD2, cl_mem SX1, size_t offSX1, const cl_mem SY1, size_t offSY1, cl_mem SPARAM, size_t offSparam, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSsbmv)(clblasOrder order, clblasUplo uplo, size_t N, size_t K, cl_float alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, cl_float beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSscal)(size_t N, cl_float alpha, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSspmv)(clblasOrder order, clblasUplo uplo, size_t N, cl_float alpha, const cl_mem AP, size_t offa, const cl_mem X, size_t offx, int incx, cl_float beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSspr)(clblasOrder order, clblasUplo uplo, size_t N, cl_float alpha, const cl_mem X, size_t offx, int incx, cl_mem AP, size_t offa, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSspr2)(clblasOrder order, clblasUplo uplo, size_t N, cl_float alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem AP, size_t offa, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSswap)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSsymm)(clblasOrder order, clblasSide side, clblasUplo uplo, size_t M, size_t N, cl_float alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem B, size_t offb, size_t ldb, cl_float beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSsymv)(clblasOrder order, clblasUplo uplo, size_t N, cl_float alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem x, size_t offx, int incx, cl_float beta, cl_mem y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSsyr)(clblasOrder order, clblasUplo uplo, size_t N, cl_float alpha, const cl_mem X, size_t offx, int incx, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSsyr2)(clblasOrder order, clblasUplo uplo, size_t N, cl_float alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSsyr2k)(clblasOrder order, clblasUplo uplo, clblasTranspose transAB, size_t N, size_t K, cl_float alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, cl_float beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasSsyrk)(clblasOrder order, clblasUplo uplo, clblasTranspose transA, size_t N, size_t K, cl_float alpha, const cl_mem A, size_t offA, size_t lda, cl_float beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasStbmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, size_t K, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasStbsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, size_t K, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasStpmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem AP, size_t offa, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasStpsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasStrmm)(clblasOrder order, clblasSide side, clblasUplo uplo, clblasTranspose transA, clblasDiag diag, size_t M, size_t N, cl_float alpha, const cl_mem A, size_t offA, size_t lda, cl_mem B, size_t offB, size_t ldb, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasStrmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasStrsm)(clblasOrder order, clblasSide side, clblasUplo uplo, clblasTranspose transA, clblasDiag diag, size_t M, size_t N, cl_float alpha, const cl_mem A, size_t offA, size_t lda, cl_mem B, size_t offB, size_t ldb, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasStrsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\nextern CL_RUNTIME_EXPORT void (*clblasTeardown)();\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZaxpy)(size_t N, cl_double2 alpha, const cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZcopy)(size_t N, const cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZdotc)(size_t N, cl_mem dotProduct, size_t offDP, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZdotu)(size_t N, cl_mem dotProduct, size_t offDP, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZdrot)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_double C, cl_double S, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZdscal)(size_t N, cl_double alpha, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZgbmv)(clblasOrder order, clblasTranspose trans, size_t M, size_t N, size_t KL, size_t KU, cl_double2 alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, cl_double2 beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\nextern CL_RUNTIME_EXPORT clblasStatus (*clblasZgemm)(clblasOrder order, clblasTranspose transA, clblasTranspose transB, size_t M, size_t N, size_t K, DoubleComplex alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, DoubleComplex beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZgemv)(clblasOrder order, clblasTranspose transA, size_t M, size_t N, DoubleComplex alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem x, size_t offx, int incx, DoubleComplex beta, cl_mem y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZgerc)(clblasOrder order, size_t M, size_t N, cl_double2 alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZgeru)(clblasOrder order, size_t M, size_t N, cl_double2 alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZhbmv)(clblasOrder order, clblasUplo uplo, size_t N, size_t K, cl_double2 alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, cl_double2 beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZhemm)(clblasOrder order, clblasSide side, clblasUplo uplo, size_t M, size_t N, cl_double2 alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem B, size_t offb, size_t ldb, cl_double2 beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZhemv)(clblasOrder order, clblasUplo uplo, size_t N, DoubleComplex alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem X, size_t offx, int incx, DoubleComplex beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZher)(clblasOrder order, clblasUplo uplo, size_t N, cl_double alpha, const cl_mem X, size_t offx, int incx, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZher2)(clblasOrder order, clblasUplo uplo, size_t N, cl_double2 alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem A, size_t offa, size_t lda, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZher2k)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, size_t N, size_t K, DoubleComplex alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem B, size_t offb, size_t ldb, cl_double beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZherk)(clblasOrder order, clblasUplo uplo, clblasTranspose transA, size_t N, size_t K, double alpha, const cl_mem A, size_t offa, size_t lda, double beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZhpmv)(clblasOrder order, clblasUplo uplo, size_t N, cl_double2 alpha, const cl_mem AP, size_t offa, const cl_mem X, size_t offx, int incx, cl_double2 beta, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZhpr)(clblasOrder order, clblasUplo uplo, size_t N, cl_double alpha, const cl_mem X, size_t offx, int incx, cl_mem AP, size_t offa, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZhpr2)(clblasOrder order, clblasUplo uplo, size_t N, cl_double2 alpha, const cl_mem X, size_t offx, int incx, const cl_mem Y, size_t offy, int incy, cl_mem AP, size_t offa, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZrotg)(cl_mem CA, size_t offCA, cl_mem CB, size_t offCB, cl_mem C, size_t offC, cl_mem S, size_t offS, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZscal)(size_t N, cl_double2 alpha, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZswap)(size_t N, cl_mem X, size_t offx, int incx, cl_mem Y, size_t offy, int incy, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZsymm)(clblasOrder order, clblasSide side, clblasUplo uplo, size_t M, size_t N, cl_double2 alpha, const cl_mem A, size_t offa, size_t lda, const cl_mem B, size_t offb, size_t ldb, cl_double2 beta, cl_mem C, size_t offc, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZsyr2k)(clblasOrder order, clblasUplo uplo, clblasTranspose transAB, size_t N, size_t K, DoubleComplex alpha, const cl_mem A, size_t offA, size_t lda, const cl_mem B, size_t offB, size_t ldb, DoubleComplex beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZsyrk)(clblasOrder order, clblasUplo uplo, clblasTranspose transA, size_t N, size_t K, DoubleComplex alpha, const cl_mem A, size_t offA, size_t lda, DoubleComplex beta, cl_mem C, size_t offC, size_t ldc, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZtbmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, size_t K, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZtbsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, size_t K, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZtpmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem AP, size_t offa, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZtpsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZtrmm)(clblasOrder order, clblasSide side, clblasUplo uplo, clblasTranspose transA, clblasDiag diag, size_t M, size_t N, DoubleComplex alpha, const cl_mem A, size_t offA, size_t lda, cl_mem B, size_t offB, size_t ldb, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZtrmv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZtrsm)(clblasOrder order, clblasSide side, clblasUplo uplo, clblasTranspose transA, clblasDiag diag, size_t M, size_t N, DoubleComplex alpha, const cl_mem A, size_t offA, size_t lda, cl_mem B, size_t offB, size_t ldb, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasZtrsv)(clblasOrder order, clblasUplo uplo, clblasTranspose trans, clblasDiag diag, size_t N, const cl_mem A, size_t offa, size_t lda, cl_mem X, size_t offx, int incx, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasiCamax)(size_t N, cl_mem iMax, size_t offiMax, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasiDamax)(size_t N, cl_mem iMax, size_t offiMax, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasiSamax)(size_t N, cl_mem iMax, size_t offiMax, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n//extern CL_RUNTIME_EXPORT clblasStatus (*clblasiZamax)(size_t N, cl_mem iMax, size_t offiMax, const cl_mem X, size_t offx, int incx, cl_mem scratchBuff, cl_uint numCommandQueues, cl_command_queue* commandQueues, cl_uint numEventsInWaitList, const cl_event* eventWaitList, cl_event* events);\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/autogenerated/opencl_clfft.hpp",
    "content": "//\n// AUTOGENERATED, DO NOT EDIT\n//\n#ifndef OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP\n#error \"Invalid usage\"\n#endif\n\n// generated by parser_clfft.py\n#define clfftBakePlan clfftBakePlan_\n#define clfftCopyPlan clfftCopyPlan_\n#define clfftCreateDefaultPlan clfftCreateDefaultPlan_\n#define clfftDestroyPlan clfftDestroyPlan_\n#define clfftEnqueueTransform clfftEnqueueTransform_\n#define clfftGetLayout clfftGetLayout_\n#define clfftGetPlanBatchSize clfftGetPlanBatchSize_\n#define clfftGetPlanContext clfftGetPlanContext_\n#define clfftGetPlanDim clfftGetPlanDim_\n#define clfftGetPlanDistance clfftGetPlanDistance_\n#define clfftGetPlanInStride clfftGetPlanInStride_\n#define clfftGetPlanLength clfftGetPlanLength_\n#define clfftGetPlanOutStride clfftGetPlanOutStride_\n#define clfftGetPlanPrecision clfftGetPlanPrecision_\n#define clfftGetPlanScale clfftGetPlanScale_\n#define clfftGetPlanTransposeResult clfftGetPlanTransposeResult_\n#define clfftGetResultLocation clfftGetResultLocation_\n#define clfftGetTmpBufSize clfftGetTmpBufSize_\n#define clfftGetVersion clfftGetVersion_\n#define clfftSetLayout clfftSetLayout_\n#define clfftSetPlanBatchSize clfftSetPlanBatchSize_\n#define clfftSetPlanCallback clfftSetPlanCallback_\n#define clfftSetPlanDim clfftSetPlanDim_\n#define clfftSetPlanDistance clfftSetPlanDistance_\n#define clfftSetPlanInStride clfftSetPlanInStride_\n#define clfftSetPlanLength clfftSetPlanLength_\n#define clfftSetPlanOutStride clfftSetPlanOutStride_\n#define clfftSetPlanPrecision clfftSetPlanPrecision_\n#define clfftSetPlanScale clfftSetPlanScale_\n#define clfftSetPlanTransposeResult clfftSetPlanTransposeResult_\n#define clfftSetResultLocation clfftSetResultLocation_\n#define clfftSetup clfftSetup_\n#define clfftTeardown clfftTeardown_\n\n#include <clFFT.h>\n\n// generated by parser_clfft.py\n#undef clfftBakePlan\n#define clfftBakePlan clfftBakePlan_pfn\n#undef clfftCopyPlan\n//#define clfftCopyPlan clfftCopyPlan_pfn\n#undef clfftCreateDefaultPlan\n#define clfftCreateDefaultPlan clfftCreateDefaultPlan_pfn\n#undef clfftDestroyPlan\n#define clfftDestroyPlan clfftDestroyPlan_pfn\n#undef clfftEnqueueTransform\n#define clfftEnqueueTransform clfftEnqueueTransform_pfn\n#undef clfftGetLayout\n//#define clfftGetLayout clfftGetLayout_pfn\n#undef clfftGetPlanBatchSize\n//#define clfftGetPlanBatchSize clfftGetPlanBatchSize_pfn\n#undef clfftGetPlanContext\n//#define clfftGetPlanContext clfftGetPlanContext_pfn\n#undef clfftGetPlanDim\n//#define clfftGetPlanDim clfftGetPlanDim_pfn\n#undef clfftGetPlanDistance\n//#define clfftGetPlanDistance clfftGetPlanDistance_pfn\n#undef clfftGetPlanInStride\n//#define clfftGetPlanInStride clfftGetPlanInStride_pfn\n#undef clfftGetPlanLength\n//#define clfftGetPlanLength clfftGetPlanLength_pfn\n#undef clfftGetPlanOutStride\n//#define clfftGetPlanOutStride clfftGetPlanOutStride_pfn\n#undef clfftGetPlanPrecision\n//#define clfftGetPlanPrecision clfftGetPlanPrecision_pfn\n#undef clfftGetPlanScale\n//#define clfftGetPlanScale clfftGetPlanScale_pfn\n#undef clfftGetPlanTransposeResult\n//#define clfftGetPlanTransposeResult clfftGetPlanTransposeResult_pfn\n#undef clfftGetResultLocation\n//#define clfftGetResultLocation clfftGetResultLocation_pfn\n#undef clfftGetTmpBufSize\n#define clfftGetTmpBufSize clfftGetTmpBufSize_pfn\n#undef clfftGetVersion\n#define clfftGetVersion clfftGetVersion_pfn\n#undef clfftSetLayout\n#define clfftSetLayout clfftSetLayout_pfn\n#undef clfftSetPlanBatchSize\n#define clfftSetPlanBatchSize clfftSetPlanBatchSize_pfn\n#undef clfftSetPlanCallback\n//#define clfftSetPlanCallback clfftSetPlanCallback_pfn\n#undef clfftSetPlanDim\n//#define clfftSetPlanDim clfftSetPlanDim_pfn\n#undef clfftSetPlanDistance\n#define clfftSetPlanDistance clfftSetPlanDistance_pfn\n#undef clfftSetPlanInStride\n#define clfftSetPlanInStride clfftSetPlanInStride_pfn\n#undef clfftSetPlanLength\n//#define clfftSetPlanLength clfftSetPlanLength_pfn\n#undef clfftSetPlanOutStride\n#define clfftSetPlanOutStride clfftSetPlanOutStride_pfn\n#undef clfftSetPlanPrecision\n#define clfftSetPlanPrecision clfftSetPlanPrecision_pfn\n#undef clfftSetPlanScale\n#define clfftSetPlanScale clfftSetPlanScale_pfn\n#undef clfftSetPlanTransposeResult\n//#define clfftSetPlanTransposeResult clfftSetPlanTransposeResult_pfn\n#undef clfftSetResultLocation\n#define clfftSetResultLocation clfftSetResultLocation_pfn\n#undef clfftSetup\n#define clfftSetup clfftSetup_pfn\n#undef clfftTeardown\n#define clfftTeardown clfftTeardown_pfn\n\n// generated by parser_clfft.py\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftBakePlan)(clfftPlanHandle plHandle, cl_uint numQueues, cl_command_queue* commQueueFFT, void (CL_CALLBACK* pfn_notify) (clfftPlanHandle plHandle, void* user_data), void* user_data);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftCopyPlan)(clfftPlanHandle* out_plHandle, cl_context new_context, clfftPlanHandle in_plHandle);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftCreateDefaultPlan)(clfftPlanHandle* plHandle, cl_context context, const clfftDim dim, const size_t* clLengths);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftDestroyPlan)(clfftPlanHandle* plHandle);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftEnqueueTransform)(clfftPlanHandle plHandle, clfftDirection dir, cl_uint numQueuesAndEvents, cl_command_queue* commQueues, cl_uint numWaitEvents, const cl_event* waitEvents, cl_event* outEvents, cl_mem* inputBuffers, cl_mem* outputBuffers, cl_mem tmpBuffer);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetLayout)(const clfftPlanHandle plHandle, clfftLayout* iLayout, clfftLayout* oLayout);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanBatchSize)(const clfftPlanHandle plHandle, size_t* batchSize);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanContext)(const clfftPlanHandle plHandle, cl_context* context);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanDim)(const clfftPlanHandle plHandle, clfftDim* dim, cl_uint* size);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanDistance)(const clfftPlanHandle plHandle, size_t* iDist, size_t* oDist);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanInStride)(const clfftPlanHandle plHandle, const clfftDim dim, size_t* clStrides);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanLength)(const clfftPlanHandle plHandle, const clfftDim dim, size_t* clLengths);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanOutStride)(const clfftPlanHandle plHandle, const clfftDim dim, size_t* clStrides);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanPrecision)(const clfftPlanHandle plHandle, clfftPrecision* precision);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanScale)(const clfftPlanHandle plHandle, clfftDirection dir, cl_float* scale);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetPlanTransposeResult)(const clfftPlanHandle plHandle, clfftResultTransposed* transposed);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftGetResultLocation)(const clfftPlanHandle plHandle, clfftResultLocation* placeness);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftGetTmpBufSize)(const clfftPlanHandle plHandle, size_t* buffersize);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftGetVersion)(cl_uint* major, cl_uint* minor, cl_uint* patch);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftSetLayout)(clfftPlanHandle plHandle, clfftLayout iLayout, clfftLayout oLayout);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanBatchSize)(clfftPlanHandle plHandle, size_t batchSize);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanCallback)(clfftPlanHandle plHandle, const char* funcName, const char* funcString, int localMemSize, clfftCallbackType callbackType, cl_mem* userdata, int numUserdataBuffers);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanDim)(clfftPlanHandle plHandle, const clfftDim dim);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanDistance)(clfftPlanHandle plHandle, size_t iDist, size_t oDist);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanInStride)(clfftPlanHandle plHandle, const clfftDim dim, size_t* clStrides);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanLength)(clfftPlanHandle plHandle, const clfftDim dim, const size_t* clLengths);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanOutStride)(clfftPlanHandle plHandle, const clfftDim dim, size_t* clStrides);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanPrecision)(clfftPlanHandle plHandle, clfftPrecision precision);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanScale)(clfftPlanHandle plHandle, clfftDirection dir, cl_float scale);\n//extern CL_RUNTIME_EXPORT clfftStatus (*clfftSetPlanTransposeResult)(clfftPlanHandle plHandle, clfftResultTransposed transposed);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftSetResultLocation)(clfftPlanHandle plHandle, clfftResultLocation placeness);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftSetup)(const clfftSetupData* setupData);\nextern CL_RUNTIME_EXPORT clfftStatus (*clfftTeardown)();\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp",
    "content": "//\n// AUTOGENERATED, DO NOT EDIT\n//\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP\n#error \"Invalid usage\"\n#endif\n\n// generated by parser_cl.py\n#define clBuildProgram clBuildProgram_\n#define clCompileProgram clCompileProgram_\n#define clCreateBuffer clCreateBuffer_\n#define clCreateCommandQueue clCreateCommandQueue_\n#define clCreateContext clCreateContext_\n#define clCreateContextFromType clCreateContextFromType_\n#define clCreateImage clCreateImage_\n#define clCreateImage2D clCreateImage2D_\n#define clCreateImage3D clCreateImage3D_\n#define clCreateKernel clCreateKernel_\n#define clCreateKernelsInProgram clCreateKernelsInProgram_\n#define clCreateProgramWithBinary clCreateProgramWithBinary_\n#define clCreateProgramWithBuiltInKernels clCreateProgramWithBuiltInKernels_\n#define clCreateProgramWithSource clCreateProgramWithSource_\n#define clCreateSampler clCreateSampler_\n#define clCreateSubBuffer clCreateSubBuffer_\n#define clCreateSubDevices clCreateSubDevices_\n#define clCreateUserEvent clCreateUserEvent_\n#define clEnqueueBarrier clEnqueueBarrier_\n#define clEnqueueBarrierWithWaitList clEnqueueBarrierWithWaitList_\n#define clEnqueueCopyBuffer clEnqueueCopyBuffer_\n#define clEnqueueCopyBufferRect clEnqueueCopyBufferRect_\n#define clEnqueueCopyBufferToImage clEnqueueCopyBufferToImage_\n#define clEnqueueCopyImage clEnqueueCopyImage_\n#define clEnqueueCopyImageToBuffer clEnqueueCopyImageToBuffer_\n#define clEnqueueFillBuffer clEnqueueFillBuffer_\n#define clEnqueueFillImage clEnqueueFillImage_\n#define clEnqueueMapBuffer clEnqueueMapBuffer_\n#define clEnqueueMapImage clEnqueueMapImage_\n#define clEnqueueMarker clEnqueueMarker_\n#define clEnqueueMarkerWithWaitList clEnqueueMarkerWithWaitList_\n#define clEnqueueMigrateMemObjects clEnqueueMigrateMemObjects_\n#define clEnqueueNDRangeKernel clEnqueueNDRangeKernel_\n#define clEnqueueNativeKernel clEnqueueNativeKernel_\n#define clEnqueueReadBuffer clEnqueueReadBuffer_\n#define clEnqueueReadBufferRect clEnqueueReadBufferRect_\n#define clEnqueueReadImage clEnqueueReadImage_\n#define clEnqueueTask clEnqueueTask_\n#define clEnqueueUnmapMemObject clEnqueueUnmapMemObject_\n#define clEnqueueWaitForEvents clEnqueueWaitForEvents_\n#define clEnqueueWriteBuffer clEnqueueWriteBuffer_\n#define clEnqueueWriteBufferRect clEnqueueWriteBufferRect_\n#define clEnqueueWriteImage clEnqueueWriteImage_\n#define clFinish clFinish_\n#define clFlush clFlush_\n#define clGetCommandQueueInfo clGetCommandQueueInfo_\n#define clGetContextInfo clGetContextInfo_\n#define clGetDeviceIDs clGetDeviceIDs_\n#define clGetDeviceInfo clGetDeviceInfo_\n#define clGetEventInfo clGetEventInfo_\n#define clGetEventProfilingInfo clGetEventProfilingInfo_\n#define clGetExtensionFunctionAddress clGetExtensionFunctionAddress_\n#define clGetExtensionFunctionAddressForPlatform clGetExtensionFunctionAddressForPlatform_\n#define clGetImageInfo clGetImageInfo_\n#define clGetKernelArgInfo clGetKernelArgInfo_\n#define clGetKernelInfo clGetKernelInfo_\n#define clGetKernelWorkGroupInfo clGetKernelWorkGroupInfo_\n#define clGetMemObjectInfo clGetMemObjectInfo_\n#define clGetPlatformIDs clGetPlatformIDs_\n#define clGetPlatformInfo clGetPlatformInfo_\n#define clGetProgramBuildInfo clGetProgramBuildInfo_\n#define clGetProgramInfo clGetProgramInfo_\n#define clGetSamplerInfo clGetSamplerInfo_\n#define clGetSupportedImageFormats clGetSupportedImageFormats_\n#define clLinkProgram clLinkProgram_\n#define clReleaseCommandQueue clReleaseCommandQueue_\n#define clReleaseContext clReleaseContext_\n#define clReleaseDevice clReleaseDevice_\n#define clReleaseEvent clReleaseEvent_\n#define clReleaseKernel clReleaseKernel_\n#define clReleaseMemObject clReleaseMemObject_\n#define clReleaseProgram clReleaseProgram_\n#define clReleaseSampler clReleaseSampler_\n#define clRetainCommandQueue clRetainCommandQueue_\n#define clRetainContext clRetainContext_\n#define clRetainDevice clRetainDevice_\n#define clRetainEvent clRetainEvent_\n#define clRetainKernel clRetainKernel_\n#define clRetainMemObject clRetainMemObject_\n#define clRetainProgram clRetainProgram_\n#define clRetainSampler clRetainSampler_\n#define clSetEventCallback clSetEventCallback_\n#define clSetKernelArg clSetKernelArg_\n#define clSetMemObjectDestructorCallback clSetMemObjectDestructorCallback_\n#define clSetUserEventStatus clSetUserEventStatus_\n#define clUnloadCompiler clUnloadCompiler_\n#define clUnloadPlatformCompiler clUnloadPlatformCompiler_\n#define clWaitForEvents clWaitForEvents_\n\n#if defined __APPLE__\n#define CL_SILENCE_DEPRECATION\n#include <OpenCL/cl.h>\n#else\n#include <CL/cl.h>\n#endif\n\n// generated by parser_cl.py\n#undef clBuildProgram\n#define clBuildProgram clBuildProgram_pfn\n#undef clCompileProgram\n#define clCompileProgram clCompileProgram_pfn\n#undef clCreateBuffer\n#define clCreateBuffer clCreateBuffer_pfn\n#undef clCreateCommandQueue\n#define clCreateCommandQueue clCreateCommandQueue_pfn\n#undef clCreateContext\n#define clCreateContext clCreateContext_pfn\n#undef clCreateContextFromType\n#define clCreateContextFromType clCreateContextFromType_pfn\n#undef clCreateImage\n#define clCreateImage clCreateImage_pfn\n#undef clCreateImage2D\n#define clCreateImage2D clCreateImage2D_pfn\n#undef clCreateImage3D\n#define clCreateImage3D clCreateImage3D_pfn\n#undef clCreateKernel\n#define clCreateKernel clCreateKernel_pfn\n#undef clCreateKernelsInProgram\n#define clCreateKernelsInProgram clCreateKernelsInProgram_pfn\n#undef clCreateProgramWithBinary\n#define clCreateProgramWithBinary clCreateProgramWithBinary_pfn\n#undef clCreateProgramWithBuiltInKernels\n#define clCreateProgramWithBuiltInKernels clCreateProgramWithBuiltInKernels_pfn\n#undef clCreateProgramWithSource\n#define clCreateProgramWithSource clCreateProgramWithSource_pfn\n#undef clCreateSampler\n#define clCreateSampler clCreateSampler_pfn\n#undef clCreateSubBuffer\n#define clCreateSubBuffer clCreateSubBuffer_pfn\n#undef clCreateSubDevices\n#define clCreateSubDevices clCreateSubDevices_pfn\n#undef clCreateUserEvent\n#define clCreateUserEvent clCreateUserEvent_pfn\n#undef clEnqueueBarrier\n#define clEnqueueBarrier clEnqueueBarrier_pfn\n#undef clEnqueueBarrierWithWaitList\n#define clEnqueueBarrierWithWaitList clEnqueueBarrierWithWaitList_pfn\n#undef clEnqueueCopyBuffer\n#define clEnqueueCopyBuffer clEnqueueCopyBuffer_pfn\n#undef clEnqueueCopyBufferRect\n#define clEnqueueCopyBufferRect clEnqueueCopyBufferRect_pfn\n#undef clEnqueueCopyBufferToImage\n#define clEnqueueCopyBufferToImage clEnqueueCopyBufferToImage_pfn\n#undef clEnqueueCopyImage\n#define clEnqueueCopyImage clEnqueueCopyImage_pfn\n#undef clEnqueueCopyImageToBuffer\n#define clEnqueueCopyImageToBuffer clEnqueueCopyImageToBuffer_pfn\n#undef clEnqueueFillBuffer\n#define clEnqueueFillBuffer clEnqueueFillBuffer_pfn\n#undef clEnqueueFillImage\n#define clEnqueueFillImage clEnqueueFillImage_pfn\n#undef clEnqueueMapBuffer\n#define clEnqueueMapBuffer clEnqueueMapBuffer_pfn\n#undef clEnqueueMapImage\n#define clEnqueueMapImage clEnqueueMapImage_pfn\n#undef clEnqueueMarker\n#define clEnqueueMarker clEnqueueMarker_pfn\n#undef clEnqueueMarkerWithWaitList\n#define clEnqueueMarkerWithWaitList clEnqueueMarkerWithWaitList_pfn\n#undef clEnqueueMigrateMemObjects\n#define clEnqueueMigrateMemObjects clEnqueueMigrateMemObjects_pfn\n#undef clEnqueueNDRangeKernel\n#define clEnqueueNDRangeKernel clEnqueueNDRangeKernel_pfn\n#undef clEnqueueNativeKernel\n#define clEnqueueNativeKernel clEnqueueNativeKernel_pfn\n#undef clEnqueueReadBuffer\n#define clEnqueueReadBuffer clEnqueueReadBuffer_pfn\n#undef clEnqueueReadBufferRect\n#define clEnqueueReadBufferRect clEnqueueReadBufferRect_pfn\n#undef clEnqueueReadImage\n#define clEnqueueReadImage clEnqueueReadImage_pfn\n#undef clEnqueueTask\n#define clEnqueueTask clEnqueueTask_pfn\n#undef clEnqueueUnmapMemObject\n#define clEnqueueUnmapMemObject clEnqueueUnmapMemObject_pfn\n#undef clEnqueueWaitForEvents\n#define clEnqueueWaitForEvents clEnqueueWaitForEvents_pfn\n#undef clEnqueueWriteBuffer\n#define clEnqueueWriteBuffer clEnqueueWriteBuffer_pfn\n#undef clEnqueueWriteBufferRect\n#define clEnqueueWriteBufferRect clEnqueueWriteBufferRect_pfn\n#undef clEnqueueWriteImage\n#define clEnqueueWriteImage clEnqueueWriteImage_pfn\n#undef clFinish\n#define clFinish clFinish_pfn\n#undef clFlush\n#define clFlush clFlush_pfn\n#undef clGetCommandQueueInfo\n#define clGetCommandQueueInfo clGetCommandQueueInfo_pfn\n#undef clGetContextInfo\n#define clGetContextInfo clGetContextInfo_pfn\n#undef clGetDeviceIDs\n#define clGetDeviceIDs clGetDeviceIDs_pfn\n#undef clGetDeviceInfo\n#define clGetDeviceInfo clGetDeviceInfo_pfn\n#undef clGetEventInfo\n#define clGetEventInfo clGetEventInfo_pfn\n#undef clGetEventProfilingInfo\n#define clGetEventProfilingInfo clGetEventProfilingInfo_pfn\n#undef clGetExtensionFunctionAddress\n#define clGetExtensionFunctionAddress clGetExtensionFunctionAddress_pfn\n#undef clGetExtensionFunctionAddressForPlatform\n#define clGetExtensionFunctionAddressForPlatform clGetExtensionFunctionAddressForPlatform_pfn\n#undef clGetImageInfo\n#define clGetImageInfo clGetImageInfo_pfn\n#undef clGetKernelArgInfo\n#define clGetKernelArgInfo clGetKernelArgInfo_pfn\n#undef clGetKernelInfo\n#define clGetKernelInfo clGetKernelInfo_pfn\n#undef clGetKernelWorkGroupInfo\n#define clGetKernelWorkGroupInfo clGetKernelWorkGroupInfo_pfn\n#undef clGetMemObjectInfo\n#define clGetMemObjectInfo clGetMemObjectInfo_pfn\n#undef clGetPlatformIDs\n#define clGetPlatformIDs clGetPlatformIDs_pfn\n#undef clGetPlatformInfo\n#define clGetPlatformInfo clGetPlatformInfo_pfn\n#undef clGetProgramBuildInfo\n#define clGetProgramBuildInfo clGetProgramBuildInfo_pfn\n#undef clGetProgramInfo\n#define clGetProgramInfo clGetProgramInfo_pfn\n#undef clGetSamplerInfo\n#define clGetSamplerInfo clGetSamplerInfo_pfn\n#undef clGetSupportedImageFormats\n#define clGetSupportedImageFormats clGetSupportedImageFormats_pfn\n#undef clLinkProgram\n#define clLinkProgram clLinkProgram_pfn\n#undef clReleaseCommandQueue\n#define clReleaseCommandQueue clReleaseCommandQueue_pfn\n#undef clReleaseContext\n#define clReleaseContext clReleaseContext_pfn\n#undef clReleaseDevice\n#define clReleaseDevice clReleaseDevice_pfn\n#undef clReleaseEvent\n#define clReleaseEvent clReleaseEvent_pfn\n#undef clReleaseKernel\n#define clReleaseKernel clReleaseKernel_pfn\n#undef clReleaseMemObject\n#define clReleaseMemObject clReleaseMemObject_pfn\n#undef clReleaseProgram\n#define clReleaseProgram clReleaseProgram_pfn\n#undef clReleaseSampler\n#define clReleaseSampler clReleaseSampler_pfn\n#undef clRetainCommandQueue\n#define clRetainCommandQueue clRetainCommandQueue_pfn\n#undef clRetainContext\n#define clRetainContext clRetainContext_pfn\n#undef clRetainDevice\n#define clRetainDevice clRetainDevice_pfn\n#undef clRetainEvent\n#define clRetainEvent clRetainEvent_pfn\n#undef clRetainKernel\n#define clRetainKernel clRetainKernel_pfn\n#undef clRetainMemObject\n#define clRetainMemObject clRetainMemObject_pfn\n#undef clRetainProgram\n#define clRetainProgram clRetainProgram_pfn\n#undef clRetainSampler\n#define clRetainSampler clRetainSampler_pfn\n#undef clSetEventCallback\n#define clSetEventCallback clSetEventCallback_pfn\n#undef clSetKernelArg\n#define clSetKernelArg clSetKernelArg_pfn\n#undef clSetMemObjectDestructorCallback\n#define clSetMemObjectDestructorCallback clSetMemObjectDestructorCallback_pfn\n#undef clSetUserEventStatus\n#define clSetUserEventStatus clSetUserEventStatus_pfn\n#undef clUnloadCompiler\n#define clUnloadCompiler clUnloadCompiler_pfn\n#undef clUnloadPlatformCompiler\n#define clUnloadPlatformCompiler clUnloadPlatformCompiler_pfn\n#undef clWaitForEvents\n#define clWaitForEvents clWaitForEvents_pfn\n\n// generated by parser_cl.py\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clBuildProgram)(cl_program, cl_uint, const cl_device_id*, const char*, void (CL_CALLBACK*) (cl_program, void*), void*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clCompileProgram)(cl_program, cl_uint, const cl_device_id*, const char*, cl_uint, const cl_program*, const char**, void (CL_CALLBACK*) (cl_program, void*), void*);\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateBuffer)(cl_context, cl_mem_flags, size_t, void*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_command_queue (CL_API_CALL*clCreateCommandQueue)(cl_context, cl_device_id, cl_command_queue_properties, cl_int*);\nextern CL_RUNTIME_EXPORT cl_context (CL_API_CALL*clCreateContext)(const cl_context_properties*, cl_uint, const cl_device_id*, void (CL_CALLBACK*) (const char*, const void*, size_t, void*), void*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_context (CL_API_CALL*clCreateContextFromType)(const cl_context_properties*, cl_device_type, void (CL_CALLBACK*) (const char*, const void*, size_t, void*), void*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateImage)(cl_context, cl_mem_flags, const cl_image_format*, const cl_image_desc*, void*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateImage2D)(cl_context, cl_mem_flags, const cl_image_format*, size_t, size_t, size_t, void*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateImage3D)(cl_context, cl_mem_flags, const cl_image_format*, size_t, size_t, size_t, size_t, size_t, void*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_kernel (CL_API_CALL*clCreateKernel)(cl_program, const char*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clCreateKernelsInProgram)(cl_program, cl_uint, cl_kernel*, cl_uint*);\nextern CL_RUNTIME_EXPORT cl_program (CL_API_CALL*clCreateProgramWithBinary)(cl_context, cl_uint, const cl_device_id*, const size_t*, const unsigned char**, cl_int*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_program (CL_API_CALL*clCreateProgramWithBuiltInKernels)(cl_context, cl_uint, const cl_device_id*, const char*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_program (CL_API_CALL*clCreateProgramWithSource)(cl_context, cl_uint, const char**, const size_t*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_sampler (CL_API_CALL*clCreateSampler)(cl_context, cl_bool, cl_addressing_mode, cl_filter_mode, cl_int*);\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateSubBuffer)(cl_mem, cl_mem_flags, cl_buffer_create_type, const void*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clCreateSubDevices)(cl_device_id, const cl_device_partition_property*, cl_uint, cl_device_id*, cl_uint*);\nextern CL_RUNTIME_EXPORT cl_event (CL_API_CALL*clCreateUserEvent)(cl_context, cl_int*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueBarrier)(cl_command_queue);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueBarrierWithWaitList)(cl_command_queue, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueCopyBuffer)(cl_command_queue, cl_mem, cl_mem, size_t, size_t, size_t, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueCopyBufferRect)(cl_command_queue, cl_mem, cl_mem, const size_t*, const size_t*, const size_t*, size_t, size_t, size_t, size_t, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueCopyBufferToImage)(cl_command_queue, cl_mem, cl_mem, size_t, const size_t*, const size_t*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueCopyImage)(cl_command_queue, cl_mem, cl_mem, const size_t*, const size_t*, const size_t*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueCopyImageToBuffer)(cl_command_queue, cl_mem, cl_mem, const size_t*, const size_t*, size_t, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueFillBuffer)(cl_command_queue, cl_mem, const void*, size_t, size_t, size_t, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueFillImage)(cl_command_queue, cl_mem, const void*, const size_t*, const size_t*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT void* (CL_API_CALL*clEnqueueMapBuffer)(cl_command_queue, cl_mem, cl_bool, cl_map_flags, size_t, size_t, cl_uint, const cl_event*, cl_event*, cl_int*);\nextern CL_RUNTIME_EXPORT void* (CL_API_CALL*clEnqueueMapImage)(cl_command_queue, cl_mem, cl_bool, cl_map_flags, const size_t*, const size_t*, size_t*, size_t*, cl_uint, const cl_event*, cl_event*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueMarker)(cl_command_queue, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueMarkerWithWaitList)(cl_command_queue, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueMigrateMemObjects)(cl_command_queue, cl_uint, const cl_mem*, cl_mem_migration_flags, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueNDRangeKernel)(cl_command_queue, cl_kernel, cl_uint, const size_t*, const size_t*, const size_t*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueNativeKernel)(cl_command_queue, void (CL_CALLBACK*) (void*), void*, size_t, cl_uint, const cl_mem*, const void**, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueReadBuffer)(cl_command_queue, cl_mem, cl_bool, size_t, size_t, void*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueReadBufferRect)(cl_command_queue, cl_mem, cl_bool, const size_t*, const size_t*, const size_t*, size_t, size_t, size_t, size_t, void*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueReadImage)(cl_command_queue, cl_mem, cl_bool, const size_t*, const size_t*, size_t, size_t, void*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueTask)(cl_command_queue, cl_kernel, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueUnmapMemObject)(cl_command_queue, cl_mem, void*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueWaitForEvents)(cl_command_queue, cl_uint, const cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueWriteBuffer)(cl_command_queue, cl_mem, cl_bool, size_t, size_t, const void*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueWriteBufferRect)(cl_command_queue, cl_mem, cl_bool, const size_t*, const size_t*, const size_t*, size_t, size_t, size_t, size_t, const void*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueWriteImage)(cl_command_queue, cl_mem, cl_bool, const size_t*, const size_t*, size_t, size_t, const void*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clFinish)(cl_command_queue);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clFlush)(cl_command_queue);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetCommandQueueInfo)(cl_command_queue, cl_command_queue_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetContextInfo)(cl_context, cl_context_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetDeviceIDs)(cl_platform_id, cl_device_type, cl_uint, cl_device_id*, cl_uint*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetDeviceInfo)(cl_device_id, cl_device_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetEventInfo)(cl_event, cl_event_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetEventProfilingInfo)(cl_event, cl_profiling_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT void* (CL_API_CALL*clGetExtensionFunctionAddress)(const char*);\nextern CL_RUNTIME_EXPORT void* (CL_API_CALL*clGetExtensionFunctionAddressForPlatform)(cl_platform_id, const char*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetImageInfo)(cl_mem, cl_image_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetKernelArgInfo)(cl_kernel, cl_uint, cl_kernel_arg_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetKernelInfo)(cl_kernel, cl_kernel_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetKernelWorkGroupInfo)(cl_kernel, cl_device_id, cl_kernel_work_group_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetMemObjectInfo)(cl_mem, cl_mem_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetPlatformIDs)(cl_uint, cl_platform_id*, cl_uint*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetPlatformInfo)(cl_platform_id, cl_platform_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetProgramBuildInfo)(cl_program, cl_device_id, cl_program_build_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetProgramInfo)(cl_program, cl_program_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetSamplerInfo)(cl_sampler, cl_sampler_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetSupportedImageFormats)(cl_context, cl_mem_flags, cl_mem_object_type, cl_uint, cl_image_format*, cl_uint*);\nextern CL_RUNTIME_EXPORT cl_program (CL_API_CALL*clLinkProgram)(cl_context, cl_uint, const cl_device_id*, const char*, cl_uint, const cl_program*, void (CL_CALLBACK*) (cl_program, void*), void*, cl_int*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clReleaseCommandQueue)(cl_command_queue);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clReleaseContext)(cl_context);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clReleaseDevice)(cl_device_id);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clReleaseEvent)(cl_event);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clReleaseKernel)(cl_kernel);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clReleaseMemObject)(cl_mem);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clReleaseProgram)(cl_program);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clReleaseSampler)(cl_sampler);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clRetainCommandQueue)(cl_command_queue);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clRetainContext)(cl_context);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clRetainDevice)(cl_device_id);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clRetainEvent)(cl_event);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clRetainKernel)(cl_kernel);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clRetainMemObject)(cl_mem);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clRetainProgram)(cl_program);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clRetainSampler)(cl_sampler);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clSetEventCallback)(cl_event, cl_int, void (CL_CALLBACK*) (cl_event, cl_int, void*), void*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clSetKernelArg)(cl_kernel, cl_uint, size_t, const void*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clSetMemObjectDestructorCallback)(cl_mem, void (CL_CALLBACK*) (cl_mem, void*), void*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clSetUserEventStatus)(cl_event, cl_int);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clUnloadCompiler)();\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clUnloadPlatformCompiler)(cl_platform_id);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clWaitForEvents)(cl_uint, const cl_event*);\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp",
    "content": "//\n// AUTOGENERATED, DO NOT EDIT\n//\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP\n#error \"Invalid usage\"\n#endif\n\n// generated by parser_cl.py\n#undef clBuildProgram\n#define clBuildProgram clBuildProgram_fn\ninline cl_int clBuildProgram(cl_program p0, cl_uint p1, const cl_device_id* p2, const char* p3, void (CL_CALLBACK*p4) (cl_program, void*), void* p5) { return clBuildProgram_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clCompileProgram\n#define clCompileProgram clCompileProgram_fn\ninline cl_int clCompileProgram(cl_program p0, cl_uint p1, const cl_device_id* p2, const char* p3, cl_uint p4, const cl_program* p5, const char** p6, void (CL_CALLBACK*p7) (cl_program, void*), void* p8) { return clCompileProgram_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clCreateBuffer\n#define clCreateBuffer clCreateBuffer_fn\ninline cl_mem clCreateBuffer(cl_context p0, cl_mem_flags p1, size_t p2, void* p3, cl_int* p4) { return clCreateBuffer_pfn(p0, p1, p2, p3, p4); }\n#undef clCreateCommandQueue\n#define clCreateCommandQueue clCreateCommandQueue_fn\ninline cl_command_queue clCreateCommandQueue(cl_context p0, cl_device_id p1, cl_command_queue_properties p2, cl_int* p3) { return clCreateCommandQueue_pfn(p0, p1, p2, p3); }\n#undef clCreateContext\n#define clCreateContext clCreateContext_fn\ninline cl_context clCreateContext(const cl_context_properties* p0, cl_uint p1, const cl_device_id* p2, void (CL_CALLBACK*p3) (const char*, const void*, size_t, void*), void* p4, cl_int* p5) { return clCreateContext_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clCreateContextFromType\n#define clCreateContextFromType clCreateContextFromType_fn\ninline cl_context clCreateContextFromType(const cl_context_properties* p0, cl_device_type p1, void (CL_CALLBACK*p2) (const char*, const void*, size_t, void*), void* p3, cl_int* p4) { return clCreateContextFromType_pfn(p0, p1, p2, p3, p4); }\n#undef clCreateImage\n#define clCreateImage clCreateImage_fn\ninline cl_mem clCreateImage(cl_context p0, cl_mem_flags p1, const cl_image_format* p2, const cl_image_desc* p3, void* p4, cl_int* p5) { return clCreateImage_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clCreateImage2D\n#define clCreateImage2D clCreateImage2D_fn\ninline cl_mem clCreateImage2D(cl_context p0, cl_mem_flags p1, const cl_image_format* p2, size_t p3, size_t p4, size_t p5, void* p6, cl_int* p7) { return clCreateImage2D_pfn(p0, p1, p2, p3, p4, p5, p6, p7); }\n#undef clCreateImage3D\n#define clCreateImage3D clCreateImage3D_fn\ninline cl_mem clCreateImage3D(cl_context p0, cl_mem_flags p1, const cl_image_format* p2, size_t p3, size_t p4, size_t p5, size_t p6, size_t p7, void* p8, cl_int* p9) { return clCreateImage3D_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); }\n#undef clCreateKernel\n#define clCreateKernel clCreateKernel_fn\ninline cl_kernel clCreateKernel(cl_program p0, const char* p1, cl_int* p2) { return clCreateKernel_pfn(p0, p1, p2); }\n#undef clCreateKernelsInProgram\n#define clCreateKernelsInProgram clCreateKernelsInProgram_fn\ninline cl_int clCreateKernelsInProgram(cl_program p0, cl_uint p1, cl_kernel* p2, cl_uint* p3) { return clCreateKernelsInProgram_pfn(p0, p1, p2, p3); }\n#undef clCreateProgramWithBinary\n#define clCreateProgramWithBinary clCreateProgramWithBinary_fn\ninline cl_program clCreateProgramWithBinary(cl_context p0, cl_uint p1, const cl_device_id* p2, const size_t* p3, const unsigned char** p4, cl_int* p5, cl_int* p6) { return clCreateProgramWithBinary_pfn(p0, p1, p2, p3, p4, p5, p6); }\n#undef clCreateProgramWithBuiltInKernels\n#define clCreateProgramWithBuiltInKernels clCreateProgramWithBuiltInKernels_fn\ninline cl_program clCreateProgramWithBuiltInKernels(cl_context p0, cl_uint p1, const cl_device_id* p2, const char* p3, cl_int* p4) { return clCreateProgramWithBuiltInKernels_pfn(p0, p1, p2, p3, p4); }\n#undef clCreateProgramWithSource\n#define clCreateProgramWithSource clCreateProgramWithSource_fn\ninline cl_program clCreateProgramWithSource(cl_context p0, cl_uint p1, const char** p2, const size_t* p3, cl_int* p4) { return clCreateProgramWithSource_pfn(p0, p1, p2, p3, p4); }\n#undef clCreateSampler\n#define clCreateSampler clCreateSampler_fn\ninline cl_sampler clCreateSampler(cl_context p0, cl_bool p1, cl_addressing_mode p2, cl_filter_mode p3, cl_int* p4) { return clCreateSampler_pfn(p0, p1, p2, p3, p4); }\n#undef clCreateSubBuffer\n#define clCreateSubBuffer clCreateSubBuffer_fn\ninline cl_mem clCreateSubBuffer(cl_mem p0, cl_mem_flags p1, cl_buffer_create_type p2, const void* p3, cl_int* p4) { return clCreateSubBuffer_pfn(p0, p1, p2, p3, p4); }\n#undef clCreateSubDevices\n#define clCreateSubDevices clCreateSubDevices_fn\ninline cl_int clCreateSubDevices(cl_device_id p0, const cl_device_partition_property* p1, cl_uint p2, cl_device_id* p3, cl_uint* p4) { return clCreateSubDevices_pfn(p0, p1, p2, p3, p4); }\n#undef clCreateUserEvent\n#define clCreateUserEvent clCreateUserEvent_fn\ninline cl_event clCreateUserEvent(cl_context p0, cl_int* p1) { return clCreateUserEvent_pfn(p0, p1); }\n#undef clEnqueueBarrier\n#define clEnqueueBarrier clEnqueueBarrier_fn\ninline cl_int clEnqueueBarrier(cl_command_queue p0) { return clEnqueueBarrier_pfn(p0); }\n#undef clEnqueueBarrierWithWaitList\n#define clEnqueueBarrierWithWaitList clEnqueueBarrierWithWaitList_fn\ninline cl_int clEnqueueBarrierWithWaitList(cl_command_queue p0, cl_uint p1, const cl_event* p2, cl_event* p3) { return clEnqueueBarrierWithWaitList_pfn(p0, p1, p2, p3); }\n#undef clEnqueueCopyBuffer\n#define clEnqueueCopyBuffer clEnqueueCopyBuffer_fn\ninline cl_int clEnqueueCopyBuffer(cl_command_queue p0, cl_mem p1, cl_mem p2, size_t p3, size_t p4, size_t p5, cl_uint p6, const cl_event* p7, cl_event* p8) { return clEnqueueCopyBuffer_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clEnqueueCopyBufferRect\n#define clEnqueueCopyBufferRect clEnqueueCopyBufferRect_fn\ninline cl_int clEnqueueCopyBufferRect(cl_command_queue p0, cl_mem p1, cl_mem p2, const size_t* p3, const size_t* p4, const size_t* p5, size_t p6, size_t p7, size_t p8, size_t p9, cl_uint p10, const cl_event* p11, cl_event* p12) { return clEnqueueCopyBufferRect_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); }\n#undef clEnqueueCopyBufferToImage\n#define clEnqueueCopyBufferToImage clEnqueueCopyBufferToImage_fn\ninline cl_int clEnqueueCopyBufferToImage(cl_command_queue p0, cl_mem p1, cl_mem p2, size_t p3, const size_t* p4, const size_t* p5, cl_uint p6, const cl_event* p7, cl_event* p8) { return clEnqueueCopyBufferToImage_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clEnqueueCopyImage\n#define clEnqueueCopyImage clEnqueueCopyImage_fn\ninline cl_int clEnqueueCopyImage(cl_command_queue p0, cl_mem p1, cl_mem p2, const size_t* p3, const size_t* p4, const size_t* p5, cl_uint p6, const cl_event* p7, cl_event* p8) { return clEnqueueCopyImage_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clEnqueueCopyImageToBuffer\n#define clEnqueueCopyImageToBuffer clEnqueueCopyImageToBuffer_fn\ninline cl_int clEnqueueCopyImageToBuffer(cl_command_queue p0, cl_mem p1, cl_mem p2, const size_t* p3, const size_t* p4, size_t p5, cl_uint p6, const cl_event* p7, cl_event* p8) { return clEnqueueCopyImageToBuffer_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clEnqueueFillBuffer\n#define clEnqueueFillBuffer clEnqueueFillBuffer_fn\ninline cl_int clEnqueueFillBuffer(cl_command_queue p0, cl_mem p1, const void* p2, size_t p3, size_t p4, size_t p5, cl_uint p6, const cl_event* p7, cl_event* p8) { return clEnqueueFillBuffer_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clEnqueueFillImage\n#define clEnqueueFillImage clEnqueueFillImage_fn\ninline cl_int clEnqueueFillImage(cl_command_queue p0, cl_mem p1, const void* p2, const size_t* p3, const size_t* p4, cl_uint p5, const cl_event* p6, cl_event* p7) { return clEnqueueFillImage_pfn(p0, p1, p2, p3, p4, p5, p6, p7); }\n#undef clEnqueueMapBuffer\n#define clEnqueueMapBuffer clEnqueueMapBuffer_fn\ninline void* clEnqueueMapBuffer(cl_command_queue p0, cl_mem p1, cl_bool p2, cl_map_flags p3, size_t p4, size_t p5, cl_uint p6, const cl_event* p7, cl_event* p8, cl_int* p9) { return clEnqueueMapBuffer_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); }\n#undef clEnqueueMapImage\n#define clEnqueueMapImage clEnqueueMapImage_fn\ninline void* clEnqueueMapImage(cl_command_queue p0, cl_mem p1, cl_bool p2, cl_map_flags p3, const size_t* p4, const size_t* p5, size_t* p6, size_t* p7, cl_uint p8, const cl_event* p9, cl_event* p10, cl_int* p11) { return clEnqueueMapImage_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); }\n#undef clEnqueueMarker\n#define clEnqueueMarker clEnqueueMarker_fn\ninline cl_int clEnqueueMarker(cl_command_queue p0, cl_event* p1) { return clEnqueueMarker_pfn(p0, p1); }\n#undef clEnqueueMarkerWithWaitList\n#define clEnqueueMarkerWithWaitList clEnqueueMarkerWithWaitList_fn\ninline cl_int clEnqueueMarkerWithWaitList(cl_command_queue p0, cl_uint p1, const cl_event* p2, cl_event* p3) { return clEnqueueMarkerWithWaitList_pfn(p0, p1, p2, p3); }\n#undef clEnqueueMigrateMemObjects\n#define clEnqueueMigrateMemObjects clEnqueueMigrateMemObjects_fn\ninline cl_int clEnqueueMigrateMemObjects(cl_command_queue p0, cl_uint p1, const cl_mem* p2, cl_mem_migration_flags p3, cl_uint p4, const cl_event* p5, cl_event* p6) { return clEnqueueMigrateMemObjects_pfn(p0, p1, p2, p3, p4, p5, p6); }\n#undef clEnqueueNDRangeKernel\n#define clEnqueueNDRangeKernel clEnqueueNDRangeKernel_fn\ninline cl_int clEnqueueNDRangeKernel(cl_command_queue p0, cl_kernel p1, cl_uint p2, const size_t* p3, const size_t* p4, const size_t* p5, cl_uint p6, const cl_event* p7, cl_event* p8) { return clEnqueueNDRangeKernel_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clEnqueueNativeKernel\n#define clEnqueueNativeKernel clEnqueueNativeKernel_fn\ninline cl_int clEnqueueNativeKernel(cl_command_queue p0, void (CL_CALLBACK*p1) (void*), void* p2, size_t p3, cl_uint p4, const cl_mem* p5, const void** p6, cl_uint p7, const cl_event* p8, cl_event* p9) { return clEnqueueNativeKernel_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); }\n#undef clEnqueueReadBuffer\n#define clEnqueueReadBuffer clEnqueueReadBuffer_fn\ninline cl_int clEnqueueReadBuffer(cl_command_queue p0, cl_mem p1, cl_bool p2, size_t p3, size_t p4, void* p5, cl_uint p6, const cl_event* p7, cl_event* p8) { return clEnqueueReadBuffer_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clEnqueueReadBufferRect\n#define clEnqueueReadBufferRect clEnqueueReadBufferRect_fn\ninline cl_int clEnqueueReadBufferRect(cl_command_queue p0, cl_mem p1, cl_bool p2, const size_t* p3, const size_t* p4, const size_t* p5, size_t p6, size_t p7, size_t p8, size_t p9, void* p10, cl_uint p11, const cl_event* p12, cl_event* p13) { return clEnqueueReadBufferRect_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); }\n#undef clEnqueueReadImage\n#define clEnqueueReadImage clEnqueueReadImage_fn\ninline cl_int clEnqueueReadImage(cl_command_queue p0, cl_mem p1, cl_bool p2, const size_t* p3, const size_t* p4, size_t p5, size_t p6, void* p7, cl_uint p8, const cl_event* p9, cl_event* p10) { return clEnqueueReadImage_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); }\n#undef clEnqueueTask\n#define clEnqueueTask clEnqueueTask_fn\ninline cl_int clEnqueueTask(cl_command_queue p0, cl_kernel p1, cl_uint p2, const cl_event* p3, cl_event* p4) { return clEnqueueTask_pfn(p0, p1, p2, p3, p4); }\n#undef clEnqueueUnmapMemObject\n#define clEnqueueUnmapMemObject clEnqueueUnmapMemObject_fn\ninline cl_int clEnqueueUnmapMemObject(cl_command_queue p0, cl_mem p1, void* p2, cl_uint p3, const cl_event* p4, cl_event* p5) { return clEnqueueUnmapMemObject_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clEnqueueWaitForEvents\n#define clEnqueueWaitForEvents clEnqueueWaitForEvents_fn\ninline cl_int clEnqueueWaitForEvents(cl_command_queue p0, cl_uint p1, const cl_event* p2) { return clEnqueueWaitForEvents_pfn(p0, p1, p2); }\n#undef clEnqueueWriteBuffer\n#define clEnqueueWriteBuffer clEnqueueWriteBuffer_fn\ninline cl_int clEnqueueWriteBuffer(cl_command_queue p0, cl_mem p1, cl_bool p2, size_t p3, size_t p4, const void* p5, cl_uint p6, const cl_event* p7, cl_event* p8) { return clEnqueueWriteBuffer_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clEnqueueWriteBufferRect\n#define clEnqueueWriteBufferRect clEnqueueWriteBufferRect_fn\ninline cl_int clEnqueueWriteBufferRect(cl_command_queue p0, cl_mem p1, cl_bool p2, const size_t* p3, const size_t* p4, const size_t* p5, size_t p6, size_t p7, size_t p8, size_t p9, const void* p10, cl_uint p11, const cl_event* p12, cl_event* p13) { return clEnqueueWriteBufferRect_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); }\n#undef clEnqueueWriteImage\n#define clEnqueueWriteImage clEnqueueWriteImage_fn\ninline cl_int clEnqueueWriteImage(cl_command_queue p0, cl_mem p1, cl_bool p2, const size_t* p3, const size_t* p4, size_t p5, size_t p6, const void* p7, cl_uint p8, const cl_event* p9, cl_event* p10) { return clEnqueueWriteImage_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); }\n#undef clFinish\n#define clFinish clFinish_fn\ninline cl_int clFinish(cl_command_queue p0) { return clFinish_pfn(p0); }\n#undef clFlush\n#define clFlush clFlush_fn\ninline cl_int clFlush(cl_command_queue p0) { return clFlush_pfn(p0); }\n#undef clGetCommandQueueInfo\n#define clGetCommandQueueInfo clGetCommandQueueInfo_fn\ninline cl_int clGetCommandQueueInfo(cl_command_queue p0, cl_command_queue_info p1, size_t p2, void* p3, size_t* p4) { return clGetCommandQueueInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetContextInfo\n#define clGetContextInfo clGetContextInfo_fn\ninline cl_int clGetContextInfo(cl_context p0, cl_context_info p1, size_t p2, void* p3, size_t* p4) { return clGetContextInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetDeviceIDs\n#define clGetDeviceIDs clGetDeviceIDs_fn\ninline cl_int clGetDeviceIDs(cl_platform_id p0, cl_device_type p1, cl_uint p2, cl_device_id* p3, cl_uint* p4) { return clGetDeviceIDs_pfn(p0, p1, p2, p3, p4); }\n#undef clGetDeviceInfo\n#define clGetDeviceInfo clGetDeviceInfo_fn\ninline cl_int clGetDeviceInfo(cl_device_id p0, cl_device_info p1, size_t p2, void* p3, size_t* p4) { return clGetDeviceInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetEventInfo\n#define clGetEventInfo clGetEventInfo_fn\ninline cl_int clGetEventInfo(cl_event p0, cl_event_info p1, size_t p2, void* p3, size_t* p4) { return clGetEventInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetEventProfilingInfo\n#define clGetEventProfilingInfo clGetEventProfilingInfo_fn\ninline cl_int clGetEventProfilingInfo(cl_event p0, cl_profiling_info p1, size_t p2, void* p3, size_t* p4) { return clGetEventProfilingInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetExtensionFunctionAddress\n#define clGetExtensionFunctionAddress clGetExtensionFunctionAddress_fn\ninline void* clGetExtensionFunctionAddress(const char* p0) { return clGetExtensionFunctionAddress_pfn(p0); }\n#undef clGetExtensionFunctionAddressForPlatform\n#define clGetExtensionFunctionAddressForPlatform clGetExtensionFunctionAddressForPlatform_fn\ninline void* clGetExtensionFunctionAddressForPlatform(cl_platform_id p0, const char* p1) { return clGetExtensionFunctionAddressForPlatform_pfn(p0, p1); }\n#undef clGetImageInfo\n#define clGetImageInfo clGetImageInfo_fn\ninline cl_int clGetImageInfo(cl_mem p0, cl_image_info p1, size_t p2, void* p3, size_t* p4) { return clGetImageInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetKernelArgInfo\n#define clGetKernelArgInfo clGetKernelArgInfo_fn\ninline cl_int clGetKernelArgInfo(cl_kernel p0, cl_uint p1, cl_kernel_arg_info p2, size_t p3, void* p4, size_t* p5) { return clGetKernelArgInfo_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clGetKernelInfo\n#define clGetKernelInfo clGetKernelInfo_fn\ninline cl_int clGetKernelInfo(cl_kernel p0, cl_kernel_info p1, size_t p2, void* p3, size_t* p4) { return clGetKernelInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetKernelWorkGroupInfo\n#define clGetKernelWorkGroupInfo clGetKernelWorkGroupInfo_fn\ninline cl_int clGetKernelWorkGroupInfo(cl_kernel p0, cl_device_id p1, cl_kernel_work_group_info p2, size_t p3, void* p4, size_t* p5) { return clGetKernelWorkGroupInfo_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clGetMemObjectInfo\n#define clGetMemObjectInfo clGetMemObjectInfo_fn\ninline cl_int clGetMemObjectInfo(cl_mem p0, cl_mem_info p1, size_t p2, void* p3, size_t* p4) { return clGetMemObjectInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetPlatformIDs\n#define clGetPlatformIDs clGetPlatformIDs_fn\ninline cl_int clGetPlatformIDs(cl_uint p0, cl_platform_id* p1, cl_uint* p2) { return clGetPlatformIDs_pfn(p0, p1, p2); }\n#undef clGetPlatformInfo\n#define clGetPlatformInfo clGetPlatformInfo_fn\ninline cl_int clGetPlatformInfo(cl_platform_id p0, cl_platform_info p1, size_t p2, void* p3, size_t* p4) { return clGetPlatformInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetProgramBuildInfo\n#define clGetProgramBuildInfo clGetProgramBuildInfo_fn\ninline cl_int clGetProgramBuildInfo(cl_program p0, cl_device_id p1, cl_program_build_info p2, size_t p3, void* p4, size_t* p5) { return clGetProgramBuildInfo_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clGetProgramInfo\n#define clGetProgramInfo clGetProgramInfo_fn\ninline cl_int clGetProgramInfo(cl_program p0, cl_program_info p1, size_t p2, void* p3, size_t* p4) { return clGetProgramInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetSamplerInfo\n#define clGetSamplerInfo clGetSamplerInfo_fn\ninline cl_int clGetSamplerInfo(cl_sampler p0, cl_sampler_info p1, size_t p2, void* p3, size_t* p4) { return clGetSamplerInfo_pfn(p0, p1, p2, p3, p4); }\n#undef clGetSupportedImageFormats\n#define clGetSupportedImageFormats clGetSupportedImageFormats_fn\ninline cl_int clGetSupportedImageFormats(cl_context p0, cl_mem_flags p1, cl_mem_object_type p2, cl_uint p3, cl_image_format* p4, cl_uint* p5) { return clGetSupportedImageFormats_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clLinkProgram\n#define clLinkProgram clLinkProgram_fn\ninline cl_program clLinkProgram(cl_context p0, cl_uint p1, const cl_device_id* p2, const char* p3, cl_uint p4, const cl_program* p5, void (CL_CALLBACK*p6) (cl_program, void*), void* p7, cl_int* p8) { return clLinkProgram_pfn(p0, p1, p2, p3, p4, p5, p6, p7, p8); }\n#undef clReleaseCommandQueue\n#define clReleaseCommandQueue clReleaseCommandQueue_fn\ninline cl_int clReleaseCommandQueue(cl_command_queue p0) { return clReleaseCommandQueue_pfn(p0); }\n#undef clReleaseContext\n#define clReleaseContext clReleaseContext_fn\ninline cl_int clReleaseContext(cl_context p0) { return clReleaseContext_pfn(p0); }\n#undef clReleaseDevice\n#define clReleaseDevice clReleaseDevice_fn\ninline cl_int clReleaseDevice(cl_device_id p0) { return clReleaseDevice_pfn(p0); }\n#undef clReleaseEvent\n#define clReleaseEvent clReleaseEvent_fn\ninline cl_int clReleaseEvent(cl_event p0) { return clReleaseEvent_pfn(p0); }\n#undef clReleaseKernel\n#define clReleaseKernel clReleaseKernel_fn\ninline cl_int clReleaseKernel(cl_kernel p0) { return clReleaseKernel_pfn(p0); }\n#undef clReleaseMemObject\n#define clReleaseMemObject clReleaseMemObject_fn\ninline cl_int clReleaseMemObject(cl_mem p0) { return clReleaseMemObject_pfn(p0); }\n#undef clReleaseProgram\n#define clReleaseProgram clReleaseProgram_fn\ninline cl_int clReleaseProgram(cl_program p0) { return clReleaseProgram_pfn(p0); }\n#undef clReleaseSampler\n#define clReleaseSampler clReleaseSampler_fn\ninline cl_int clReleaseSampler(cl_sampler p0) { return clReleaseSampler_pfn(p0); }\n#undef clRetainCommandQueue\n#define clRetainCommandQueue clRetainCommandQueue_fn\ninline cl_int clRetainCommandQueue(cl_command_queue p0) { return clRetainCommandQueue_pfn(p0); }\n#undef clRetainContext\n#define clRetainContext clRetainContext_fn\ninline cl_int clRetainContext(cl_context p0) { return clRetainContext_pfn(p0); }\n#undef clRetainDevice\n#define clRetainDevice clRetainDevice_fn\ninline cl_int clRetainDevice(cl_device_id p0) { return clRetainDevice_pfn(p0); }\n#undef clRetainEvent\n#define clRetainEvent clRetainEvent_fn\ninline cl_int clRetainEvent(cl_event p0) { return clRetainEvent_pfn(p0); }\n#undef clRetainKernel\n#define clRetainKernel clRetainKernel_fn\ninline cl_int clRetainKernel(cl_kernel p0) { return clRetainKernel_pfn(p0); }\n#undef clRetainMemObject\n#define clRetainMemObject clRetainMemObject_fn\ninline cl_int clRetainMemObject(cl_mem p0) { return clRetainMemObject_pfn(p0); }\n#undef clRetainProgram\n#define clRetainProgram clRetainProgram_fn\ninline cl_int clRetainProgram(cl_program p0) { return clRetainProgram_pfn(p0); }\n#undef clRetainSampler\n#define clRetainSampler clRetainSampler_fn\ninline cl_int clRetainSampler(cl_sampler p0) { return clRetainSampler_pfn(p0); }\n#undef clSetEventCallback\n#define clSetEventCallback clSetEventCallback_fn\ninline cl_int clSetEventCallback(cl_event p0, cl_int p1, void (CL_CALLBACK*p2) (cl_event, cl_int, void*), void* p3) { return clSetEventCallback_pfn(p0, p1, p2, p3); }\n#undef clSetKernelArg\n#define clSetKernelArg clSetKernelArg_fn\ninline cl_int clSetKernelArg(cl_kernel p0, cl_uint p1, size_t p2, const void* p3) { return clSetKernelArg_pfn(p0, p1, p2, p3); }\n#undef clSetMemObjectDestructorCallback\n#define clSetMemObjectDestructorCallback clSetMemObjectDestructorCallback_fn\ninline cl_int clSetMemObjectDestructorCallback(cl_mem p0, void (CL_CALLBACK*p1) (cl_mem, void*), void* p2) { return clSetMemObjectDestructorCallback_pfn(p0, p1, p2); }\n#undef clSetUserEventStatus\n#define clSetUserEventStatus clSetUserEventStatus_fn\ninline cl_int clSetUserEventStatus(cl_event p0, cl_int p1) { return clSetUserEventStatus_pfn(p0, p1); }\n#undef clUnloadCompiler\n#define clUnloadCompiler clUnloadCompiler_fn\ninline cl_int clUnloadCompiler() { return clUnloadCompiler_pfn(); }\n#undef clUnloadPlatformCompiler\n#define clUnloadPlatformCompiler clUnloadPlatformCompiler_fn\ninline cl_int clUnloadPlatformCompiler(cl_platform_id p0) { return clUnloadPlatformCompiler_pfn(p0); }\n#undef clWaitForEvents\n#define clWaitForEvents clWaitForEvents_fn\ninline cl_int clWaitForEvents(cl_uint p0, const cl_event* p1) { return clWaitForEvents_pfn(p0, p1); }\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp",
    "content": "//\n// AUTOGENERATED, DO NOT EDIT\n//\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP\n#error \"Invalid usage\"\n#endif\n\n// generated by parser_cl.py\n#define clCreateFromGLBuffer clCreateFromGLBuffer_\n#define clCreateFromGLRenderbuffer clCreateFromGLRenderbuffer_\n#define clCreateFromGLTexture clCreateFromGLTexture_\n#define clCreateFromGLTexture2D clCreateFromGLTexture2D_\n#define clCreateFromGLTexture3D clCreateFromGLTexture3D_\n#define clEnqueueAcquireGLObjects clEnqueueAcquireGLObjects_\n#define clEnqueueReleaseGLObjects clEnqueueReleaseGLObjects_\n#define clGetGLContextInfoKHR clGetGLContextInfoKHR_\n#define clGetGLObjectInfo clGetGLObjectInfo_\n#define clGetGLTextureInfo clGetGLTextureInfo_\n\n#if defined __APPLE__\n#include <OpenCL/cl_gl.h>\n#else\n#include <CL/cl_gl.h>\n#endif\n\n// generated by parser_cl.py\n#undef clCreateFromGLBuffer\n#define clCreateFromGLBuffer clCreateFromGLBuffer_pfn\n#undef clCreateFromGLRenderbuffer\n#define clCreateFromGLRenderbuffer clCreateFromGLRenderbuffer_pfn\n#undef clCreateFromGLTexture\n#define clCreateFromGLTexture clCreateFromGLTexture_pfn\n#undef clCreateFromGLTexture2D\n#define clCreateFromGLTexture2D clCreateFromGLTexture2D_pfn\n#undef clCreateFromGLTexture3D\n#define clCreateFromGLTexture3D clCreateFromGLTexture3D_pfn\n#undef clEnqueueAcquireGLObjects\n#define clEnqueueAcquireGLObjects clEnqueueAcquireGLObjects_pfn\n#undef clEnqueueReleaseGLObjects\n#define clEnqueueReleaseGLObjects clEnqueueReleaseGLObjects_pfn\n#undef clGetGLContextInfoKHR\n#define clGetGLContextInfoKHR clGetGLContextInfoKHR_pfn\n#undef clGetGLObjectInfo\n#define clGetGLObjectInfo clGetGLObjectInfo_pfn\n#undef clGetGLTextureInfo\n#define clGetGLTextureInfo clGetGLTextureInfo_pfn\n\n#ifdef cl_khr_gl_sharing\n\n// generated by parser_cl.py\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLBuffer)(cl_context, cl_mem_flags, cl_GLuint, int*);\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLRenderbuffer)(cl_context, cl_mem_flags, cl_GLuint, cl_int*);\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLTexture)(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int*);\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLTexture2D)(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int*);\nextern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLTexture3D)(cl_context, cl_mem_flags, cl_GLenum, cl_GLint, cl_GLuint, cl_int*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueAcquireGLObjects)(cl_command_queue, cl_uint, const cl_mem*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueReleaseGLObjects)(cl_command_queue, cl_uint, const cl_mem*, cl_uint, const cl_event*, cl_event*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetGLContextInfoKHR)(const cl_context_properties*, cl_gl_context_info, size_t, void*, size_t*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetGLObjectInfo)(cl_mem, cl_gl_object_type*, cl_GLuint*);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetGLTextureInfo)(cl_mem, cl_gl_texture_info, size_t, void*, size_t*);\n\n#endif // cl_khr_gl_sharing\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp",
    "content": "//\n// AUTOGENERATED, DO NOT EDIT\n//\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP\n#error \"Invalid usage\"\n#endif\n\n#ifdef cl_khr_gl_sharing\n\n// generated by parser_cl.py\n#undef clCreateFromGLBuffer\n#define clCreateFromGLBuffer clCreateFromGLBuffer_fn\ninline cl_mem clCreateFromGLBuffer(cl_context p0, cl_mem_flags p1, cl_GLuint p2, int* p3) { return clCreateFromGLBuffer_pfn(p0, p1, p2, p3); }\n#undef clCreateFromGLRenderbuffer\n#define clCreateFromGLRenderbuffer clCreateFromGLRenderbuffer_fn\ninline cl_mem clCreateFromGLRenderbuffer(cl_context p0, cl_mem_flags p1, cl_GLuint p2, cl_int* p3) { return clCreateFromGLRenderbuffer_pfn(p0, p1, p2, p3); }\n#undef clCreateFromGLTexture\n#define clCreateFromGLTexture clCreateFromGLTexture_fn\ninline cl_mem clCreateFromGLTexture(cl_context p0, cl_mem_flags p1, cl_GLenum p2, cl_GLint p3, cl_GLuint p4, cl_int* p5) { return clCreateFromGLTexture_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clCreateFromGLTexture2D\n#define clCreateFromGLTexture2D clCreateFromGLTexture2D_fn\ninline cl_mem clCreateFromGLTexture2D(cl_context p0, cl_mem_flags p1, cl_GLenum p2, cl_GLint p3, cl_GLuint p4, cl_int* p5) { return clCreateFromGLTexture2D_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clCreateFromGLTexture3D\n#define clCreateFromGLTexture3D clCreateFromGLTexture3D_fn\ninline cl_mem clCreateFromGLTexture3D(cl_context p0, cl_mem_flags p1, cl_GLenum p2, cl_GLint p3, cl_GLuint p4, cl_int* p5) { return clCreateFromGLTexture3D_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clEnqueueAcquireGLObjects\n#define clEnqueueAcquireGLObjects clEnqueueAcquireGLObjects_fn\ninline cl_int clEnqueueAcquireGLObjects(cl_command_queue p0, cl_uint p1, const cl_mem* p2, cl_uint p3, const cl_event* p4, cl_event* p5) { return clEnqueueAcquireGLObjects_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clEnqueueReleaseGLObjects\n#define clEnqueueReleaseGLObjects clEnqueueReleaseGLObjects_fn\ninline cl_int clEnqueueReleaseGLObjects(cl_command_queue p0, cl_uint p1, const cl_mem* p2, cl_uint p3, const cl_event* p4, cl_event* p5) { return clEnqueueReleaseGLObjects_pfn(p0, p1, p2, p3, p4, p5); }\n#undef clGetGLContextInfoKHR\n#define clGetGLContextInfoKHR clGetGLContextInfoKHR_fn\ninline cl_int clGetGLContextInfoKHR(const cl_context_properties* p0, cl_gl_context_info p1, size_t p2, void* p3, size_t* p4) { return clGetGLContextInfoKHR_pfn(p0, p1, p2, p3, p4); }\n#undef clGetGLObjectInfo\n#define clGetGLObjectInfo clGetGLObjectInfo_fn\ninline cl_int clGetGLObjectInfo(cl_mem p0, cl_gl_object_type* p1, cl_GLuint* p2) { return clGetGLObjectInfo_pfn(p0, p1, p2); }\n#undef clGetGLTextureInfo\n#define clGetGLTextureInfo clGetGLTextureInfo_fn\ninline cl_int clGetGLTextureInfo(cl_mem p0, cl_gl_texture_info p1, size_t p2, void* p3, size_t* p4) { return clGetGLTextureInfo_pfn(p0, p1, p2, p3, p4); }\n\n#endif // cl_khr_gl_sharing\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/opencl_clblas.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the OpenCV Foundation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP\n#define OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP\n\n#ifdef HAVE_CLAMDBLAS\n\n#include \"opencl_core.hpp\"\n\n#include \"autogenerated/opencl_clblas.hpp\"\n\n#endif // HAVE_CLAMDBLAS\n\n#endif // OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/opencl_clfft.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the OpenCV Foundation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP\n#define OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP\n\n#ifdef HAVE_CLAMDFFT\n\n#include \"opencl_core.hpp\"\n\n#include \"autogenerated/opencl_clfft.hpp\"\n\n#endif // HAVE_CLAMDFFT\n\n#endif // OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/opencl_core.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the OpenCV Foundation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP\n#define OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP\n\n#ifdef HAVE_OPENCL\n\n#ifndef CL_RUNTIME_EXPORT\n#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined _WIN32 || defined WINCE) && \\\n    !(defined(__OPENCV_BUILD) && defined(OPENCV_MODULE_IS_PART_OF_WORLD))\n#define CL_RUNTIME_EXPORT __declspec(dllimport)\n#else\n#define CL_RUNTIME_EXPORT\n#endif\n#endif\n\n#ifdef HAVE_OPENCL_SVM\n#define clSVMAlloc clSVMAlloc_\n#define clSVMFree clSVMFree_\n#define clSetKernelArgSVMPointer clSetKernelArgSVMPointer_\n#define clSetKernelExecInfo clSetKernelExecInfo_\n#define clEnqueueSVMFree clEnqueueSVMFree_\n#define clEnqueueSVMMemcpy clEnqueueSVMMemcpy_\n#define clEnqueueSVMMemFill clEnqueueSVMMemFill_\n#define clEnqueueSVMMap clEnqueueSVMMap_\n#define clEnqueueSVMUnmap clEnqueueSVMUnmap_\n#endif\n\n#include \"autogenerated/opencl_core.hpp\"\n\n#ifndef CL_DEVICE_DOUBLE_FP_CONFIG\n#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032\n#endif\n\n#ifndef CL_DEVICE_HALF_FP_CONFIG\n#define CL_DEVICE_HALF_FP_CONFIG 0x1033\n#endif\n\n#ifndef CL_VERSION_1_2\n#define CV_REQUIRE_OPENCL_1_2_ERROR CV_Error(cv::Error::OpenCLApiCallError, \"OpenCV compiled without OpenCL v1.2 support, so we can't use functionality from OpenCL v1.2\")\n#endif\n\n#endif // HAVE_OPENCL\n\n#endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the OpenCV Foundation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP\n#define OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP\n\n#include \"autogenerated/opencl_core_wrappers.hpp\"\n\n#endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/opencl_gl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the OpenCV Foundation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP\n#define OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP\n\n#if defined HAVE_OPENCL && defined HAVE_OPENGL\n\n#include \"opencl_core.hpp\"\n\n#include \"autogenerated/opencl_gl.hpp\"\n\n#endif // defined HAVE_OPENCL && defined HAVE_OPENGL\n\n#endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the OpenCV Foundation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP\n#define OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP\n\n#include \"autogenerated/opencl_gl_wrappers.hpp\"\n\n#endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/opencl_svm_20.hpp",
    "content": "/* See LICENSE file in the root OpenCV directory */\n\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_2_0_HPP\n#define OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_2_0_HPP\n\n#if defined(HAVE_OPENCL_SVM)\n#include \"opencl_core.hpp\"\n\n#include \"opencl_svm_definitions.hpp\"\n\n#undef clSVMAlloc\n#define clSVMAlloc clSVMAlloc_pfn\n#undef clSVMFree\n#define clSVMFree clSVMFree_pfn\n#undef clSetKernelArgSVMPointer\n#define clSetKernelArgSVMPointer clSetKernelArgSVMPointer_pfn\n#undef clSetKernelExecInfo\n//#define clSetKernelExecInfo clSetKernelExecInfo_pfn\n#undef clEnqueueSVMFree\n//#define clEnqueueSVMFree clEnqueueSVMFree_pfn\n#undef clEnqueueSVMMemcpy\n#define clEnqueueSVMMemcpy clEnqueueSVMMemcpy_pfn\n#undef clEnqueueSVMMemFill\n#define clEnqueueSVMMemFill clEnqueueSVMMemFill_pfn\n#undef clEnqueueSVMMap\n#define clEnqueueSVMMap clEnqueueSVMMap_pfn\n#undef clEnqueueSVMUnmap\n#define clEnqueueSVMUnmap clEnqueueSVMUnmap_pfn\n\nextern CL_RUNTIME_EXPORT void* (CL_API_CALL *clSVMAlloc)(cl_context context, cl_svm_mem_flags flags, size_t size, unsigned int alignment);\nextern CL_RUNTIME_EXPORT void (CL_API_CALL *clSVMFree)(cl_context context, void* svm_pointer);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clSetKernelArgSVMPointer)(cl_kernel kernel, cl_uint arg_index, const void* arg_value);\n//extern CL_RUNTIME_EXPORT void* (CL_API_CALL *clSetKernelExecInfo)(cl_kernel kernel, cl_kernel_exec_info param_name, size_t param_value_size, const void* param_value);\n//extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMFree)(cl_command_queue command_queue, cl_uint num_svm_pointers, void* svm_pointers[],\n//        void (CL_CALLBACK *pfn_free_func)(cl_command_queue queue, cl_uint num_svm_pointers, void* svm_pointers[], void* user_data), void* user_data,\n//        cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMMemcpy)(cl_command_queue command_queue, cl_bool blocking_copy, void* dst_ptr, const void* src_ptr, size_t size,\n        cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMMemFill)(cl_command_queue command_queue, void* svm_ptr, const void* pattern, size_t pattern_size, size_t size,\n        cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMMap)(cl_command_queue command_queue, cl_bool blocking_map, cl_map_flags map_flags, void* svm_ptr, size_t size,\n        cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);\nextern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMUnmap)(cl_command_queue command_queue, void* svm_ptr,\n        cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);\n\n#endif // HAVE_OPENCL_SVM\n\n#endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_2_0_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp",
    "content": "/* See LICENSE file in the root OpenCV directory */\n\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_DEFINITIONS_HPP\n#define OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_DEFINITIONS_HPP\n\n#if defined(HAVE_OPENCL_SVM)\n#if defined(CL_VERSION_2_0)\n\n// OpenCL 2.0 contains SVM definitions\n\n#else\n\ntypedef cl_bitfield cl_device_svm_capabilities;\ntypedef cl_bitfield cl_svm_mem_flags;\ntypedef cl_uint     cl_kernel_exec_info;\n\n//\n// TODO Add real values after OpenCL 2.0 release\n//\n\n#ifndef CL_DEVICE_SVM_CAPABILITIES\n#define CL_DEVICE_SVM_CAPABILITIES 0x1053\n\n#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER             (1 << 0)\n#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER               (1 << 1)\n#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM               (1 << 2)\n#define CL_DEVICE_SVM_ATOMICS                         (1 << 3)\n#endif\n\n#ifndef CL_MEM_SVM_FINE_GRAIN_BUFFER\n#define CL_MEM_SVM_FINE_GRAIN_BUFFER (1 << 10)\n#endif\n\n#ifndef CL_MEM_SVM_ATOMICS\n#define CL_MEM_SVM_ATOMICS (1 << 11)\n#endif\n\n\n#endif // CL_VERSION_2_0\n#endif // HAVE_OPENCL_SVM\n\n#endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_DEFINITIONS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp",
    "content": "/* See LICENSE file in the root OpenCV directory */\n\n#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_HSA_EXTENSION_HPP\n#define OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_HSA_EXTENSION_HPP\n\n#if defined(HAVE_OPENCL_SVM)\n#include \"opencl_core.hpp\"\n\n#ifndef CL_DEVICE_SVM_CAPABILITIES_AMD\n//\n//  Part of the file is an extract from the cl_ext.h file from AMD APP SDK package.\n//  Below is the original copyright.\n//\n/*******************************************************************************\n * Copyright (c) 2008-2013 The Khronos Group Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and/or associated documentation files (the\n * \"Materials\"), to deal in the Materials without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Materials, and to\n * permit persons to whom the Materials are furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Materials.\n *\n * THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n ******************************************************************************/\n\n/*******************************************\n * Shared Virtual Memory (SVM) extension\n *******************************************/\ntypedef cl_bitfield                      cl_device_svm_capabilities_amd;\ntypedef cl_bitfield                      cl_svm_mem_flags_amd;\ntypedef cl_uint                          cl_kernel_exec_info_amd;\n\n/* cl_device_info */\n#define CL_DEVICE_SVM_CAPABILITIES_AMD                     0x1053\n#define CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT_AMD  0x1054\n\n/* cl_device_svm_capabilities_amd */\n#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER_AMD             (1 << 0)\n#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER_AMD               (1 << 1)\n#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM_AMD               (1 << 2)\n#define CL_DEVICE_SVM_ATOMICS_AMD                         (1 << 3)\n\n/* cl_svm_mem_flags_amd */\n#define CL_MEM_SVM_FINE_GRAIN_BUFFER_AMD                  (1 << 10)\n#define CL_MEM_SVM_ATOMICS_AMD                            (1 << 11)\n\n/* cl_mem_info */\n#define CL_MEM_USES_SVM_POINTER_AMD                       0x1109\n\n/* cl_kernel_exec_info_amd */\n#define CL_KERNEL_EXEC_INFO_SVM_PTRS_AMD                  0x11B6\n#define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM_AMD     0x11B7\n\n/* cl_command_type */\n#define CL_COMMAND_SVM_FREE_AMD                           0x1209\n#define CL_COMMAND_SVM_MEMCPY_AMD                         0x120A\n#define CL_COMMAND_SVM_MEMFILL_AMD                        0x120B\n#define CL_COMMAND_SVM_MAP_AMD                            0x120C\n#define CL_COMMAND_SVM_UNMAP_AMD                          0x120D\n\ntypedef CL_API_ENTRY void*\n(CL_API_CALL * clSVMAllocAMD_fn)(\n    cl_context            /* context */,\n    cl_svm_mem_flags_amd  /* flags */,\n    size_t                /* size */,\n    unsigned int          /* alignment */\n) CL_EXT_SUFFIX__VERSION_1_2;\n\ntypedef CL_API_ENTRY void\n(CL_API_CALL * clSVMFreeAMD_fn)(\n    cl_context  /* context */,\n    void*       /* svm_pointer */\n) CL_EXT_SUFFIX__VERSION_1_2;\n\ntypedef CL_API_ENTRY cl_int\n(CL_API_CALL * clEnqueueSVMFreeAMD_fn)(\n    cl_command_queue /* command_queue */,\n    cl_uint          /* num_svm_pointers */,\n    void**           /* svm_pointers */,\n    void (CL_CALLBACK *)( /*pfn_free_func*/\n        cl_command_queue /* queue */,\n        cl_uint          /* num_svm_pointers */,\n        void**           /* svm_pointers */,\n        void*            /* user_data */),\n    void*             /* user_data */,\n    cl_uint           /* num_events_in_wait_list */,\n    const cl_event*   /* event_wait_list */,\n    cl_event*         /* event */\n) CL_EXT_SUFFIX__VERSION_1_2;\n\ntypedef CL_API_ENTRY cl_int\n(CL_API_CALL * clEnqueueSVMMemcpyAMD_fn)(\n    cl_command_queue /* command_queue */,\n    cl_bool          /* blocking_copy */,\n    void*            /* dst_ptr */,\n    const void*      /* src_ptr */,\n    size_t           /* size */,\n    cl_uint          /* num_events_in_wait_list */,\n    const cl_event*  /* event_wait_list */,\n    cl_event*        /* event */\n) CL_EXT_SUFFIX__VERSION_1_2;\n\ntypedef CL_API_ENTRY cl_int\n(CL_API_CALL * clEnqueueSVMMemFillAMD_fn)(\n    cl_command_queue /* command_queue */,\n    void*            /* svm_ptr */,\n    const void*      /* pattern */,\n    size_t           /* pattern_size */,\n    size_t           /* size */,\n    cl_uint          /* num_events_in_wait_list */,\n    const cl_event*  /* event_wait_list */,\n    cl_event*        /* event */\n) CL_EXT_SUFFIX__VERSION_1_2;\n\ntypedef CL_API_ENTRY cl_int\n(CL_API_CALL * clEnqueueSVMMapAMD_fn)(\n    cl_command_queue /* command_queue */,\n    cl_bool          /* blocking_map */,\n    cl_map_flags     /* map_flags */,\n    void*            /* svm_ptr */,\n    size_t           /* size */,\n    cl_uint          /* num_events_in_wait_list */,\n    const cl_event*  /* event_wait_list */,\n    cl_event*        /* event */\n) CL_EXT_SUFFIX__VERSION_1_2;\n\ntypedef CL_API_ENTRY cl_int\n(CL_API_CALL * clEnqueueSVMUnmapAMD_fn)(\n    cl_command_queue /* command_queue */,\n    void*            /* svm_ptr */,\n    cl_uint          /* num_events_in_wait_list */,\n    const cl_event*  /* event_wait_list */,\n    cl_event*        /* event */\n) CL_EXT_SUFFIX__VERSION_1_2;\n\ntypedef CL_API_ENTRY cl_int\n(CL_API_CALL * clSetKernelArgSVMPointerAMD_fn)(\n    cl_kernel     /* kernel */,\n    cl_uint       /* arg_index */,\n    const void *  /* arg_value */\n) CL_EXT_SUFFIX__VERSION_1_2;\n\ntypedef CL_API_ENTRY cl_int\n(CL_API_CALL * clSetKernelExecInfoAMD_fn)(\n     cl_kernel                /* kernel */,\n     cl_kernel_exec_info_amd  /* param_name */,\n     size_t                   /* param_value_size */,\n     const void *             /* param_value */\n) CL_EXT_SUFFIX__VERSION_1_2;\n\n#endif\n\n#endif // HAVE_OPENCL_SVM\n\n#endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_HSA_EXTENSION_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/opengl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_OPENGL_HPP\n#define OPENCV_CORE_OPENGL_HPP\n\n#ifndef __cplusplus\n#  error opengl.hpp header must be compiled as C++\n#endif\n\n#include \"opencv2/core.hpp\"\n#include \"ocl.hpp\"\n\nnamespace cv { namespace ogl {\n\n/** @addtogroup core_opengl\nThis section describes OpenGL interoperability.\n\nTo enable OpenGL support, configure OpenCV using CMake with WITH_OPENGL=ON . Currently OpenGL is\nsupported only with WIN32, GTK and Qt backends on Windows and Linux (MacOS and Android are not\nsupported). For GTK backend gtkglext-1.0 library is required.\n\nTo use OpenGL functionality you should first create OpenGL context (window or frame buffer). You can\ndo this with namedWindow function or with other OpenGL toolkit (GLUT, for example).\n*/\n//! @{\n\n/////////////////// OpenGL Objects ///////////////////\n\n/** @brief Smart pointer for OpenGL buffer object with reference counting.\n\nBuffer Objects are OpenGL objects that store an array of unformatted memory allocated by the OpenGL\ncontext. These can be used to store vertex data, pixel data retrieved from images or the\nframebuffer, and a variety of other things.\n\nogl::Buffer has interface similar with Mat interface and represents 2D array memory.\n\nogl::Buffer supports memory transfers between host and device and also can be mapped to CUDA memory.\n */\nclass CV_EXPORTS Buffer\n{\npublic:\n    /** @brief The target defines how you intend to use the buffer object.\n    */\n    enum Target\n    {\n        ARRAY_BUFFER         = 0x8892, //!< The buffer will be used as a source for vertex data\n        ELEMENT_ARRAY_BUFFER = 0x8893, //!< The buffer will be used for indices (in glDrawElements, for example)\n        PIXEL_PACK_BUFFER    = 0x88EB, //!< The buffer will be used for reading from OpenGL textures\n        PIXEL_UNPACK_BUFFER  = 0x88EC  //!< The buffer will be used for writing to OpenGL textures\n    };\n\n    enum Access\n    {\n        READ_ONLY  = 0x88B8,\n        WRITE_ONLY = 0x88B9,\n        READ_WRITE = 0x88BA\n    };\n\n    /** @brief The constructors.\n\n    Creates empty ogl::Buffer object, creates ogl::Buffer object from existed buffer ( abufId\n    parameter), allocates memory for ogl::Buffer object or copies from host/device memory.\n     */\n    Buffer();\n\n    /** @overload\n    @param arows Number of rows in a 2D array.\n    @param acols Number of columns in a 2D array.\n    @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details.\n    @param abufId Buffer object name.\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    Buffer(int arows, int acols, int atype, unsigned int abufId, bool autoRelease = false);\n\n    /** @overload\n    @param asize 2D array size.\n    @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details.\n    @param abufId Buffer object name.\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    Buffer(Size asize, int atype, unsigned int abufId, bool autoRelease = false);\n\n    /** @overload\n    @param arows Number of rows in a 2D array.\n    @param acols Number of columns in a 2D array.\n    @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details.\n    @param target Buffer usage. See cv::ogl::Buffer::Target .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    Buffer(int arows, int acols, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false);\n\n    /** @overload\n    @param asize 2D array size.\n    @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details.\n    @param target Buffer usage. See cv::ogl::Buffer::Target .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    Buffer(Size asize, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false);\n\n    /** @overload\n    @param arr Input array (host or device memory, it can be Mat , cuda::GpuMat or std::vector ).\n    @param target Buffer usage. See cv::ogl::Buffer::Target .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    explicit Buffer(InputArray arr, Target target = ARRAY_BUFFER, bool autoRelease = false);\n\n    /** @brief Allocates memory for ogl::Buffer object.\n\n    @param arows Number of rows in a 2D array.\n    @param acols Number of columns in a 2D array.\n    @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details.\n    @param target Buffer usage. See cv::ogl::Buffer::Target .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n     */\n    void create(int arows, int acols, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false);\n\n    /** @overload\n    @param asize 2D array size.\n    @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details.\n    @param target Buffer usage. See cv::ogl::Buffer::Target .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    void create(Size asize, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false);\n\n    /** @brief Decrements the reference counter and destroys the buffer object if needed.\n\n    The function will call setAutoRelease(true) .\n     */\n    void release();\n\n    /** @brief Sets auto release mode.\n\n    The lifetime of the OpenGL object is tied to the lifetime of the context. If OpenGL context was\n    bound to a window it could be released at any time (user can close a window). If object's destructor\n    is called after destruction of the context it will cause an error. Thus ogl::Buffer doesn't destroy\n    OpenGL object in destructor by default (all OpenGL resources will be released with OpenGL context).\n    This function can force ogl::Buffer destructor to destroy OpenGL object.\n    @param flag Auto release mode (if true, release will be called in object's destructor).\n     */\n    void setAutoRelease(bool flag);\n\n    /** @brief Copies from host/device memory to OpenGL buffer.\n    @param arr Input array (host or device memory, it can be Mat , cuda::GpuMat or std::vector ).\n    @param target Buffer usage. See cv::ogl::Buffer::Target .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n     */\n    void copyFrom(InputArray arr, Target target = ARRAY_BUFFER, bool autoRelease = false);\n\n    /** @overload */\n    void copyFrom(InputArray arr, cuda::Stream& stream, Target target = ARRAY_BUFFER, bool autoRelease = false);\n\n    /** @brief Copies from OpenGL buffer to host/device memory or another OpenGL buffer object.\n\n    @param arr Destination array (host or device memory, can be Mat , cuda::GpuMat , std::vector or\n    ogl::Buffer ).\n     */\n    void copyTo(OutputArray arr) const;\n\n    /** @overload */\n    void copyTo(OutputArray arr, cuda::Stream& stream) const;\n\n    /** @brief Creates a full copy of the buffer object and the underlying data.\n\n    @param target Buffer usage for destination buffer.\n    @param autoRelease Auto release mode for destination buffer.\n     */\n    Buffer clone(Target target = ARRAY_BUFFER, bool autoRelease = false) const;\n\n    /** @brief Binds OpenGL buffer to the specified buffer binding point.\n\n    @param target Binding point. See cv::ogl::Buffer::Target .\n     */\n    void bind(Target target) const;\n\n    /** @brief Unbind any buffers from the specified binding point.\n\n    @param target Binding point. See cv::ogl::Buffer::Target .\n     */\n    static void unbind(Target target);\n\n    /** @brief Maps OpenGL buffer to host memory.\n\n    mapHost maps to the client's address space the entire data store of the buffer object. The data can\n    then be directly read and/or written relative to the returned pointer, depending on the specified\n    access policy.\n\n    A mapped data store must be unmapped with ogl::Buffer::unmapHost before its buffer object is used.\n\n    This operation can lead to memory transfers between host and device.\n\n    Only one buffer object can be mapped at a time.\n    @param access Access policy, indicating whether it will be possible to read from, write to, or both\n    read from and write to the buffer object's mapped data store. The symbolic constant must be\n    ogl::Buffer::READ_ONLY , ogl::Buffer::WRITE_ONLY or ogl::Buffer::READ_WRITE .\n     */\n    Mat mapHost(Access access);\n\n    /** @brief Unmaps OpenGL buffer.\n    */\n    void unmapHost();\n\n    //! map to device memory (blocking)\n    cuda::GpuMat mapDevice();\n    void unmapDevice();\n\n    /** @brief Maps OpenGL buffer to CUDA device memory.\n\n    This operation doesn't copy data. Several buffer objects can be mapped to CUDA memory at a time.\n\n    A mapped data store must be unmapped with ogl::Buffer::unmapDevice before its buffer object is used.\n     */\n    cuda::GpuMat mapDevice(cuda::Stream& stream);\n\n    /** @brief Unmaps OpenGL buffer.\n    */\n    void unmapDevice(cuda::Stream& stream);\n\n    int rows() const;\n    int cols() const;\n    Size size() const;\n    bool empty() const;\n\n    int type() const;\n    int depth() const;\n    int channels() const;\n    int elemSize() const;\n    int elemSize1() const;\n\n    //! get OpenGL opject id\n    unsigned int bufId() const;\n\n    class Impl;\n\nprivate:\n    Ptr<Impl> impl_;\n    int rows_;\n    int cols_;\n    int type_;\n};\n\n/** @brief Smart pointer for OpenGL 2D texture memory with reference counting.\n */\nclass CV_EXPORTS Texture2D\n{\npublic:\n    /** @brief An Image Format describes the way that the images in Textures store their data.\n    */\n    enum Format\n    {\n        NONE            = 0,\n        DEPTH_COMPONENT = 0x1902, //!< Depth\n        RGB             = 0x1907, //!< Red, Green, Blue\n        RGBA            = 0x1908  //!< Red, Green, Blue, Alpha\n    };\n\n    /** @brief The constructors.\n\n    Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from\n    host/device memory.\n     */\n    Texture2D();\n\n    /** @overload */\n    Texture2D(int arows, int acols, Format aformat, unsigned int atexId, bool autoRelease = false);\n\n    /** @overload */\n    Texture2D(Size asize, Format aformat, unsigned int atexId, bool autoRelease = false);\n\n    /** @overload\n    @param arows Number of rows.\n    @param acols Number of columns.\n    @param aformat Image format. See cv::ogl::Texture2D::Format .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    Texture2D(int arows, int acols, Format aformat, bool autoRelease = false);\n\n    /** @overload\n    @param asize 2D array size.\n    @param aformat Image format. See cv::ogl::Texture2D::Format .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    Texture2D(Size asize, Format aformat, bool autoRelease = false);\n\n    /** @overload\n    @param arr Input array (host or device memory, it can be Mat , cuda::GpuMat or ogl::Buffer ).\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    explicit Texture2D(InputArray arr, bool autoRelease = false);\n\n    /** @brief Allocates memory for ogl::Texture2D object.\n\n    @param arows Number of rows.\n    @param acols Number of columns.\n    @param aformat Image format. See cv::ogl::Texture2D::Format .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n     */\n    void create(int arows, int acols, Format aformat, bool autoRelease = false);\n    /** @overload\n    @param asize 2D array size.\n    @param aformat Image format. See cv::ogl::Texture2D::Format .\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n    */\n    void create(Size asize, Format aformat, bool autoRelease = false);\n\n    /** @brief Decrements the reference counter and destroys the texture object if needed.\n\n    The function will call setAutoRelease(true) .\n     */\n    void release();\n\n    /** @brief Sets auto release mode.\n\n    @param flag Auto release mode (if true, release will be called in object's destructor).\n\n    The lifetime of the OpenGL object is tied to the lifetime of the context. If OpenGL context was\n    bound to a window it could be released at any time (user can close a window). If object's destructor\n    is called after destruction of the context it will cause an error. Thus ogl::Texture2D doesn't\n    destroy OpenGL object in destructor by default (all OpenGL resources will be released with OpenGL\n    context). This function can force ogl::Texture2D destructor to destroy OpenGL object.\n     */\n    void setAutoRelease(bool flag);\n\n    /** @brief Copies from host/device memory to OpenGL texture.\n\n    @param arr Input array (host or device memory, it can be Mat , cuda::GpuMat or ogl::Buffer ).\n    @param autoRelease Auto release mode (if true, release will be called in object's destructor).\n     */\n    void copyFrom(InputArray arr, bool autoRelease = false);\n\n    /** @brief Copies from OpenGL texture to host/device memory or another OpenGL texture object.\n\n    @param arr Destination array (host or device memory, can be Mat , cuda::GpuMat , ogl::Buffer or\n    ogl::Texture2D ).\n    @param ddepth Destination depth.\n    @param autoRelease Auto release mode for destination buffer (if arr is OpenGL buffer or texture).\n     */\n    void copyTo(OutputArray arr, int ddepth = CV_32F, bool autoRelease = false) const;\n\n    /** @brief Binds texture to current active texture unit for GL_TEXTURE_2D target.\n    */\n    void bind() const;\n\n    int rows() const;\n    int cols() const;\n    Size size() const;\n    bool empty() const;\n\n    Format format() const;\n\n    //! get OpenGL opject id\n    unsigned int texId() const;\n\n    class Impl;\n\nprivate:\n    Ptr<Impl> impl_;\n    int rows_;\n    int cols_;\n    Format format_;\n};\n\n/** @brief Wrapper for OpenGL Client-Side Vertex arrays.\n\nogl::Arrays stores vertex data in ogl::Buffer objects.\n */\nclass CV_EXPORTS Arrays\n{\npublic:\n    /** @brief Default constructor\n     */\n    Arrays();\n\n    /** @brief Sets an array of vertex coordinates.\n    @param vertex array with vertex coordinates, can be both host and device memory.\n    */\n    void setVertexArray(InputArray vertex);\n\n    /** @brief Resets vertex coordinates.\n    */\n    void resetVertexArray();\n\n    /** @brief Sets an array of vertex colors.\n    @param color array with vertex colors, can be both host and device memory.\n     */\n    void setColorArray(InputArray color);\n\n    /** @brief Resets vertex colors.\n    */\n    void resetColorArray();\n\n    /** @brief Sets an array of vertex normals.\n    @param normal array with vertex normals, can be both host and device memory.\n     */\n    void setNormalArray(InputArray normal);\n\n    /** @brief Resets vertex normals.\n    */\n    void resetNormalArray();\n\n    /** @brief Sets an array of vertex texture coordinates.\n    @param texCoord array with vertex texture coordinates, can be both host and device memory.\n     */\n    void setTexCoordArray(InputArray texCoord);\n\n    /** @brief Resets vertex texture coordinates.\n    */\n    void resetTexCoordArray();\n\n    /** @brief Releases all inner buffers.\n    */\n    void release();\n\n    /** @brief Sets auto release mode all inner buffers.\n    @param flag Auto release mode.\n     */\n    void setAutoRelease(bool flag);\n\n    /** @brief Binds all vertex arrays.\n    */\n    void bind() const;\n\n    /** @brief Returns the vertex count.\n    */\n    int size() const;\n    bool empty() const;\n\nprivate:\n    int size_;\n    Buffer vertex_;\n    Buffer color_;\n    Buffer normal_;\n    Buffer texCoord_;\n};\n\n/////////////////// Render Functions ///////////////////\n\n//! render mode\nenum RenderModes {\n    POINTS         = 0x0000,\n    LINES          = 0x0001,\n    LINE_LOOP      = 0x0002,\n    LINE_STRIP     = 0x0003,\n    TRIANGLES      = 0x0004,\n    TRIANGLE_STRIP = 0x0005,\n    TRIANGLE_FAN   = 0x0006,\n    QUADS          = 0x0007,\n    QUAD_STRIP     = 0x0008,\n    POLYGON        = 0x0009\n};\n\n/** @brief Render OpenGL texture or primitives.\n@param tex Texture to draw.\n@param wndRect Region of window, where to draw a texture (normalized coordinates).\n@param texRect Region of texture to draw (normalized coordinates).\n */\nCV_EXPORTS void render(const Texture2D& tex,\n    Rect_<double> wndRect = Rect_<double>(0.0, 0.0, 1.0, 1.0),\n    Rect_<double> texRect = Rect_<double>(0.0, 0.0, 1.0, 1.0));\n\n/** @overload\n@param arr Array of privitives vertices.\n@param mode Render mode. One of cv::ogl::RenderModes\n@param color Color for all vertices. Will be used if arr doesn't contain color array.\n*/\nCV_EXPORTS void render(const Arrays& arr, int mode = POINTS, Scalar color = Scalar::all(255));\n\n/** @overload\n@param arr Array of privitives vertices.\n@param indices Array of vertices indices (host or device memory).\n@param mode Render mode. One of cv::ogl::RenderModes\n@param color Color for all vertices. Will be used if arr doesn't contain color array.\n*/\nCV_EXPORTS void render(const Arrays& arr, InputArray indices, int mode = POINTS, Scalar color = Scalar::all(255));\n\n/////////////////// CL-GL Interoperability Functions ///////////////////\n\nnamespace ocl {\nusing namespace cv::ocl;\n\n// TODO static functions in the Context class\n/** @brief Creates OpenCL context from GL.\n@return Returns reference to OpenCL Context\n */\nCV_EXPORTS Context& initializeContextFromGL();\n\n} // namespace cv::ogl::ocl\n\n/** @brief Converts InputArray to Texture2D object.\n@param src     - source InputArray.\n@param texture - destination Texture2D object.\n */\nCV_EXPORTS void convertToGLTexture2D(InputArray src, Texture2D& texture);\n\n/** @brief Converts Texture2D object to OutputArray.\n@param texture - source Texture2D object.\n@param dst     - destination OutputArray.\n */\nCV_EXPORTS void convertFromGLTexture2D(const Texture2D& texture, OutputArray dst);\n\n/** @brief Maps Buffer object to process on CL side (convert to UMat).\n\nFunction creates CL buffer from GL one, and then constructs UMat that can be used\nto process buffer data with OpenCV functions. Note that in current implementation\nUMat constructed this way doesn't own corresponding GL buffer object, so it is\nthe user responsibility to close down CL/GL buffers relationships by explicitly\ncalling unmapGLBuffer() function.\n@param buffer      - source Buffer object.\n@param accessFlags - data access flags (ACCESS_READ|ACCESS_WRITE).\n@return Returns UMat object\n */\nCV_EXPORTS UMat mapGLBuffer(const Buffer& buffer, AccessFlag accessFlags = ACCESS_READ | ACCESS_WRITE);\n\n/** @brief Unmaps Buffer object (releases UMat, previously mapped from Buffer).\n\nFunction must be called explicitly by the user for each UMat previously constructed\nby the call to mapGLBuffer() function.\n@param u           - source UMat, created by mapGLBuffer().\n */\nCV_EXPORTS void unmapGLBuffer(UMat& u);\n\n//! @}\n}} // namespace cv::ogl\n\nnamespace cv { namespace cuda {\n\n/** @brief Sets a CUDA device and initializes it for the current thread with OpenGL interoperability.\n\nThis function should be explicitly called after OpenGL context creation and before any CUDA calls.\n@param device System index of a CUDA device starting with 0.\n@ingroup core_opengl\n */\nCV_EXPORTS void setGlDevice(int device = 0);\n\n}}\n\n//! @cond IGNORED\n\n////////////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////////////\n\ninline\ncv::ogl::Buffer::Buffer(int arows, int acols, int atype, Target target, bool autoRelease) : rows_(0), cols_(0), type_(0)\n{\n    create(arows, acols, atype, target, autoRelease);\n}\n\ninline\ncv::ogl::Buffer::Buffer(Size asize, int atype, Target target, bool autoRelease) : rows_(0), cols_(0), type_(0)\n{\n    create(asize, atype, target, autoRelease);\n}\n\ninline\nvoid cv::ogl::Buffer::create(Size asize, int atype, Target target, bool autoRelease)\n{\n    create(asize.height, asize.width, atype, target, autoRelease);\n}\n\ninline\nint cv::ogl::Buffer::rows() const\n{\n    return rows_;\n}\n\ninline\nint cv::ogl::Buffer::cols() const\n{\n    return cols_;\n}\n\ninline\ncv::Size cv::ogl::Buffer::size() const\n{\n    return Size(cols_, rows_);\n}\n\ninline\nbool cv::ogl::Buffer::empty() const\n{\n    return rows_ == 0 || cols_ == 0;\n}\n\ninline\nint cv::ogl::Buffer::type() const\n{\n    return type_;\n}\n\ninline\nint cv::ogl::Buffer::depth() const\n{\n    return CV_MAT_DEPTH(type_);\n}\n\ninline\nint cv::ogl::Buffer::channels() const\n{\n    return CV_MAT_CN(type_);\n}\n\ninline\nint cv::ogl::Buffer::elemSize() const\n{\n    return CV_ELEM_SIZE(type_);\n}\n\ninline\nint cv::ogl::Buffer::elemSize1() const\n{\n    return CV_ELEM_SIZE1(type_);\n}\n\n///////\n\ninline\ncv::ogl::Texture2D::Texture2D(int arows, int acols, Format aformat, bool autoRelease) : rows_(0), cols_(0), format_(NONE)\n{\n    create(arows, acols, aformat, autoRelease);\n}\n\ninline\ncv::ogl::Texture2D::Texture2D(Size asize, Format aformat, bool autoRelease) : rows_(0), cols_(0), format_(NONE)\n{\n    create(asize, aformat, autoRelease);\n}\n\ninline\nvoid cv::ogl::Texture2D::create(Size asize, Format aformat, bool autoRelease)\n{\n    create(asize.height, asize.width, aformat, autoRelease);\n}\n\ninline\nint cv::ogl::Texture2D::rows() const\n{\n    return rows_;\n}\n\ninline\nint cv::ogl::Texture2D::cols() const\n{\n    return cols_;\n}\n\ninline\ncv::Size cv::ogl::Texture2D::size() const\n{\n    return Size(cols_, rows_);\n}\n\ninline\nbool cv::ogl::Texture2D::empty() const\n{\n    return rows_ == 0 || cols_ == 0;\n}\n\ninline\ncv::ogl::Texture2D::Format cv::ogl::Texture2D::format() const\n{\n    return format_;\n}\n\n///////\n\ninline\ncv::ogl::Arrays::Arrays() : size_(0)\n{\n}\n\ninline\nint cv::ogl::Arrays::size() const\n{\n    return size_;\n}\n\ninline\nbool cv::ogl::Arrays::empty() const\n{\n    return size_ == 0;\n}\n\n//! @endcond\n\n#endif /* OPENCV_CORE_OPENGL_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/operations.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_OPERATIONS_HPP\n#define OPENCV_CORE_OPERATIONS_HPP\n\n#ifndef __cplusplus\n#  error operations.hpp header must be compiled as C++\n#endif\n\n#include <cstdio>\n\n#if defined(__GNUC__) || defined(__clang__) // at least GCC 3.1+, clang 3.5+\n#  if defined(__MINGW_PRINTF_FORMAT)  // https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/.\n#    define CV_FORMAT_PRINTF(string_idx, first_to_check) __attribute__ ((format (__MINGW_PRINTF_FORMAT, string_idx, first_to_check)))\n#  else\n#    define CV_FORMAT_PRINTF(string_idx, first_to_check) __attribute__ ((format (printf, string_idx, first_to_check)))\n#  endif\n#else\n#  define CV_FORMAT_PRINTF(A, B)\n#endif\n\n//! @cond IGNORED\n\nnamespace cv\n{\n\n////////////////////////////// Matx methods depending on core API /////////////////////////////\n\nnamespace internal\n{\n\ntemplate<typename _Tp, int m, int n> struct Matx_FastInvOp\n{\n    bool operator()(const Matx<_Tp, m, n>& a, Matx<_Tp, n, m>& b, int method) const\n    {\n        return invert(a, b, method) != 0;\n    }\n};\n\ntemplate<typename _Tp, int m> struct Matx_FastInvOp<_Tp, m, m>\n{\n    bool operator()(const Matx<_Tp, m, m>& a, Matx<_Tp, m, m>& b, int method) const\n    {\n        if (method == DECOMP_LU || method == DECOMP_CHOLESKY)\n        {\n            Matx<_Tp, m, m> temp = a;\n\n            // assume that b is all 0's on input => make it a unity matrix\n            for (int i = 0; i < m; i++)\n                b(i, i) = (_Tp)1;\n\n            if (method == DECOMP_CHOLESKY)\n                return Cholesky(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m);\n\n            return LU(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m) != 0;\n        }\n        else\n        {\n            return invert(a, b, method) != 0;\n        }\n    }\n};\n\ntemplate<typename _Tp> struct Matx_FastInvOp<_Tp, 2, 2>\n{\n    bool operator()(const Matx<_Tp, 2, 2>& a, Matx<_Tp, 2, 2>& b, int /*method*/) const\n    {\n        _Tp d = (_Tp)determinant(a);\n        if (d == 0)\n            return false;\n        d = 1/d;\n        b(1,1) = a(0,0)*d;\n        b(0,0) = a(1,1)*d;\n        b(0,1) = -a(0,1)*d;\n        b(1,0) = -a(1,0)*d;\n        return true;\n    }\n};\n\ntemplate<typename _Tp> struct Matx_FastInvOp<_Tp, 3, 3>\n{\n    bool operator()(const Matx<_Tp, 3, 3>& a, Matx<_Tp, 3, 3>& b, int /*method*/) const\n    {\n        _Tp d = (_Tp)determinant(a);\n        if (d == 0)\n            return false;\n        d = 1/d;\n        b(0,0) = (a(1,1) * a(2,2) - a(1,2) * a(2,1)) * d;\n        b(0,1) = (a(0,2) * a(2,1) - a(0,1) * a(2,2)) * d;\n        b(0,2) = (a(0,1) * a(1,2) - a(0,2) * a(1,1)) * d;\n\n        b(1,0) = (a(1,2) * a(2,0) - a(1,0) * a(2,2)) * d;\n        b(1,1) = (a(0,0) * a(2,2) - a(0,2) * a(2,0)) * d;\n        b(1,2) = (a(0,2) * a(1,0) - a(0,0) * a(1,2)) * d;\n\n        b(2,0) = (a(1,0) * a(2,1) - a(1,1) * a(2,0)) * d;\n        b(2,1) = (a(0,1) * a(2,0) - a(0,0) * a(2,1)) * d;\n        b(2,2) = (a(0,0) * a(1,1) - a(0,1) * a(1,0)) * d;\n        return true;\n    }\n};\n\n\ntemplate<typename _Tp, int m, int l, int n> struct Matx_FastSolveOp\n{\n    bool operator()(const Matx<_Tp, m, l>& a, const Matx<_Tp, m, n>& b,\n                    Matx<_Tp, l, n>& x, int method) const\n    {\n        return cv::solve(a, b, x, method);\n    }\n};\n\ntemplate<typename _Tp, int m, int n> struct Matx_FastSolveOp<_Tp, m, m, n>\n{\n    bool operator()(const Matx<_Tp, m, m>& a, const Matx<_Tp, m, n>& b,\n                    Matx<_Tp, m, n>& x, int method) const\n    {\n        if (method == DECOMP_LU || method == DECOMP_CHOLESKY)\n        {\n            Matx<_Tp, m, m> temp = a;\n            x = b;\n            if( method == DECOMP_CHOLESKY )\n                return Cholesky(temp.val, m*sizeof(_Tp), m, x.val, n*sizeof(_Tp), n);\n\n            return LU(temp.val, m*sizeof(_Tp), m, x.val, n*sizeof(_Tp), n) != 0;\n        }\n        else\n        {\n            return cv::solve(a, b, x, method);\n        }\n    }\n};\n\ntemplate<typename _Tp> struct Matx_FastSolveOp<_Tp, 2, 2, 1>\n{\n    bool operator()(const Matx<_Tp, 2, 2>& a, const Matx<_Tp, 2, 1>& b,\n                    Matx<_Tp, 2, 1>& x, int) const\n    {\n        _Tp d = (_Tp)determinant(a);\n        if (d == 0)\n            return false;\n        d = 1/d;\n        x(0) = (b(0)*a(1,1) - b(1)*a(0,1))*d;\n        x(1) = (b(1)*a(0,0) - b(0)*a(1,0))*d;\n        return true;\n    }\n};\n\ntemplate<typename _Tp> struct Matx_FastSolveOp<_Tp, 3, 3, 1>\n{\n    bool operator()(const Matx<_Tp, 3, 3>& a, const Matx<_Tp, 3, 1>& b,\n                    Matx<_Tp, 3, 1>& x, int) const\n    {\n        _Tp d = (_Tp)determinant(a);\n        if (d == 0)\n            return false;\n        d = 1/d;\n        x(0) = d*(b(0)*(a(1,1)*a(2,2) - a(1,2)*a(2,1)) -\n                a(0,1)*(b(1)*a(2,2) - a(1,2)*b(2)) +\n                a(0,2)*(b(1)*a(2,1) - a(1,1)*b(2)));\n\n        x(1) = d*(a(0,0)*(b(1)*a(2,2) - a(1,2)*b(2)) -\n                b(0)*(a(1,0)*a(2,2) - a(1,2)*a(2,0)) +\n                a(0,2)*(a(1,0)*b(2) - b(1)*a(2,0)));\n\n        x(2) = d*(a(0,0)*(a(1,1)*b(2) - b(1)*a(2,1)) -\n                a(0,1)*(a(1,0)*b(2) - b(1)*a(2,0)) +\n                b(0)*(a(1,0)*a(2,1) - a(1,1)*a(2,0)));\n        return true;\n    }\n};\n\n} // internal\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n> Matx<_Tp,m,n>::randu(_Tp a, _Tp b)\n{\n    Matx<_Tp,m,n> M;\n    cv::randu(M, Scalar(a), Scalar(b));\n    return M;\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp,m,n> Matx<_Tp,m,n>::randn(_Tp a, _Tp b)\n{\n    Matx<_Tp,m,n> M;\n    cv::randn(M, Scalar(a), Scalar(b));\n    return M;\n}\n\ntemplate<typename _Tp, int m, int n> inline\nMatx<_Tp, n, m> Matx<_Tp, m, n>::inv(int method, bool *p_is_ok /*= NULL*/) const\n{\n    Matx<_Tp, n, m> b;\n    bool ok = cv::internal::Matx_FastInvOp<_Tp, m, n>()(*this, b, method);\n    if (p_is_ok) *p_is_ok = ok;\n    return ok ? b : Matx<_Tp, n, m>::zeros();\n}\n\ntemplate<typename _Tp, int m, int n> template<int l> inline\nMatx<_Tp, n, l> Matx<_Tp, m, n>::solve(const Matx<_Tp, m, l>& rhs, int method) const\n{\n    Matx<_Tp, n, l> x;\n    bool ok = cv::internal::Matx_FastSolveOp<_Tp, m, n, l>()(*this, rhs, x, method);\n    return ok ? x : Matx<_Tp, n, l>::zeros();\n}\n\n\n\n////////////////////////// Augmenting algebraic & logical operations //////////////////////////\n\n#define CV_MAT_AUG_OPERATOR1(op, cvop, A, B) \\\n    static inline A& operator op (A& a, const B& b) { cvop; return a; }\n\n#define CV_MAT_AUG_OPERATOR(op, cvop, A, B)   \\\n    CV_MAT_AUG_OPERATOR1(op, cvop, A, B)      \\\n    CV_MAT_AUG_OPERATOR1(op, cvop, const A, B)\n\n#define CV_MAT_AUG_OPERATOR_T(op, cvop, A, B)                   \\\n    template<typename _Tp> CV_MAT_AUG_OPERATOR1(op, cvop, A, B) \\\n    template<typename _Tp> CV_MAT_AUG_OPERATOR1(op, cvop, const A, B)\n\n#define CV_MAT_AUG_OPERATOR_TN(op, cvop, A)                                \\\n    template<typename _Tp, int m, int n> static inline A& operator op (A& a, const Matx<_Tp,m,n>& b) { cvop; return a; } \\\n    template<typename _Tp, int m, int n> static inline const A& operator op (const A& a, const Matx<_Tp,m,n>& b) { cvop; return a; }\n\nCV_MAT_AUG_OPERATOR  (+=, cv::add(a, b, (const Mat&)a), Mat, Mat)\nCV_MAT_AUG_OPERATOR  (+=, cv::add(a, b, (const Mat&)a), Mat, Scalar)\nCV_MAT_AUG_OPERATOR_T(+=, cv::add(a, b, (const Mat&)a), Mat_<_Tp>, Mat)\nCV_MAT_AUG_OPERATOR_T(+=, cv::add(a, b, (const Mat&)a), Mat_<_Tp>, Scalar)\nCV_MAT_AUG_OPERATOR_T(+=, cv::add(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>)\nCV_MAT_AUG_OPERATOR_TN(+=, cv::add(a, Mat(b), (const Mat&)a), Mat)\nCV_MAT_AUG_OPERATOR_TN(+=, cv::add(a, Mat(b), (const Mat&)a), Mat_<_Tp>)\n\nCV_MAT_AUG_OPERATOR  (-=, cv::subtract(a, b, (const Mat&)a), Mat, Mat)\nCV_MAT_AUG_OPERATOR  (-=, cv::subtract(a, b, (const Mat&)a), Mat, Scalar)\nCV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a, b, (const Mat&)a), Mat_<_Tp>, Mat)\nCV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a, b, (const Mat&)a), Mat_<_Tp>, Scalar)\nCV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>)\nCV_MAT_AUG_OPERATOR_TN(-=, cv::subtract(a, Mat(b), (const Mat&)a), Mat)\nCV_MAT_AUG_OPERATOR_TN(-=, cv::subtract(a, Mat(b), (const Mat&)a), Mat_<_Tp>)\n\nCV_MAT_AUG_OPERATOR  (*=, cv::gemm(a, b, 1, Mat(), 0, a, 0), Mat, Mat)\nCV_MAT_AUG_OPERATOR_T(*=, cv::gemm(a, b, 1, Mat(), 0, a, 0), Mat_<_Tp>, Mat)\nCV_MAT_AUG_OPERATOR_T(*=, cv::gemm(a, b, 1, Mat(), 0, a, 0), Mat_<_Tp>, Mat_<_Tp>)\nCV_MAT_AUG_OPERATOR  (*=, a.convertTo(a, -1, b), Mat, double)\nCV_MAT_AUG_OPERATOR_T(*=, a.convertTo(a, -1, b), Mat_<_Tp>, double)\nCV_MAT_AUG_OPERATOR_TN(*=, cv::gemm(a, Mat(b), 1, Mat(), 0, a, 0), Mat)\nCV_MAT_AUG_OPERATOR_TN(*=, cv::gemm(a, Mat(b), 1, Mat(), 0, a, 0), Mat_<_Tp>)\n\nCV_MAT_AUG_OPERATOR  (/=, cv::divide(a, b, (const Mat&)a), Mat, Mat)\nCV_MAT_AUG_OPERATOR_T(/=, cv::divide(a, b, (const Mat&)a), Mat_<_Tp>, Mat)\nCV_MAT_AUG_OPERATOR_T(/=, cv::divide(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>)\nCV_MAT_AUG_OPERATOR  (/=, a.convertTo((Mat&)a, -1, 1./b), Mat, double)\nCV_MAT_AUG_OPERATOR_T(/=, a.convertTo((Mat&)a, -1, 1./b), Mat_<_Tp>, double)\nCV_MAT_AUG_OPERATOR_TN(/=, cv::divide(a, Mat(b), (const Mat&)a), Mat)\nCV_MAT_AUG_OPERATOR_TN(/=, cv::divide(a, Mat(b), (const Mat&)a), Mat_<_Tp>)\n\nCV_MAT_AUG_OPERATOR  (&=, cv::bitwise_and(a, b, (const Mat&)a), Mat, Mat)\nCV_MAT_AUG_OPERATOR  (&=, cv::bitwise_and(a, b, (const Mat&)a), Mat, Scalar)\nCV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a, b, (const Mat&)a), Mat_<_Tp>, Mat)\nCV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a, b, (const Mat&)a), Mat_<_Tp>, Scalar)\nCV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>)\nCV_MAT_AUG_OPERATOR_TN(&=, cv::bitwise_and(a, Mat(b), (const Mat&)a), Mat)\nCV_MAT_AUG_OPERATOR_TN(&=, cv::bitwise_and(a, Mat(b), (const Mat&)a), Mat_<_Tp>)\n\nCV_MAT_AUG_OPERATOR  (|=, cv::bitwise_or(a, b, (const Mat&)a), Mat, Mat)\nCV_MAT_AUG_OPERATOR  (|=, cv::bitwise_or(a, b, (const Mat&)a), Mat, Scalar)\nCV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a, b, (const Mat&)a), Mat_<_Tp>, Mat)\nCV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a, b, (const Mat&)a), Mat_<_Tp>, Scalar)\nCV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>)\nCV_MAT_AUG_OPERATOR_TN(|=, cv::bitwise_or(a, Mat(b), (const Mat&)a), Mat)\nCV_MAT_AUG_OPERATOR_TN(|=, cv::bitwise_or(a, Mat(b), (const Mat&)a), Mat_<_Tp>)\n\nCV_MAT_AUG_OPERATOR  (^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat, Mat)\nCV_MAT_AUG_OPERATOR  (^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat, Scalar)\nCV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat_<_Tp>, Mat)\nCV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat_<_Tp>, Scalar)\nCV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>)\nCV_MAT_AUG_OPERATOR_TN(^=, cv::bitwise_xor(a, Mat(b), (const Mat&)a), Mat)\nCV_MAT_AUG_OPERATOR_TN(^=, cv::bitwise_xor(a, Mat(b), (const Mat&)a), Mat_<_Tp>)\n\n#undef CV_MAT_AUG_OPERATOR_TN\n#undef CV_MAT_AUG_OPERATOR_T\n#undef CV_MAT_AUG_OPERATOR\n#undef CV_MAT_AUG_OPERATOR1\n\n\n\n///////////////////////////////////////////// SVD /////////////////////////////////////////////\n\ninline SVD::SVD() {}\ninline SVD::SVD( InputArray m, int flags ) { operator ()(m, flags); }\ninline void SVD::solveZ( InputArray m, OutputArray _dst )\n{\n    Mat mtx = m.getMat();\n    SVD svd(mtx, (mtx.rows >= mtx.cols ? 0 : SVD::FULL_UV));\n    _dst.create(svd.vt.cols, 1, svd.vt.type());\n    Mat dst = _dst.getMat();\n    svd.vt.row(svd.vt.rows-1).reshape(1,svd.vt.cols).copyTo(dst);\n}\n\ntemplate<typename _Tp, int m, int n, int nm> inline void\n    SVD::compute( const Matx<_Tp, m, n>& a, Matx<_Tp, nm, 1>& w, Matx<_Tp, m, nm>& u, Matx<_Tp, n, nm>& vt )\n{\n    CV_StaticAssert( nm == MIN(m, n), \"Invalid size of output vector.\");\n    Mat _a(a, false), _u(u, false), _w(w, false), _vt(vt, false);\n    SVD::compute(_a, _w, _u, _vt);\n    CV_Assert(_w.data == (uchar*)&w.val[0] && _u.data == (uchar*)&u.val[0] && _vt.data == (uchar*)&vt.val[0]);\n}\n\ntemplate<typename _Tp, int m, int n, int nm> inline void\nSVD::compute( const Matx<_Tp, m, n>& a, Matx<_Tp, nm, 1>& w )\n{\n    CV_StaticAssert( nm == MIN(m, n), \"Invalid size of output vector.\");\n    Mat _a(a, false), _w(w, false);\n    SVD::compute(_a, _w);\n    CV_Assert(_w.data == (uchar*)&w.val[0]);\n}\n\ntemplate<typename _Tp, int m, int n, int nm, int nb> inline void\nSVD::backSubst( const Matx<_Tp, nm, 1>& w, const Matx<_Tp, m, nm>& u,\n                const Matx<_Tp, n, nm>& vt, const Matx<_Tp, m, nb>& rhs,\n                Matx<_Tp, n, nb>& dst )\n{\n    CV_StaticAssert( nm == MIN(m, n), \"Invalid size of output vector.\");\n    Mat _u(u, false), _w(w, false), _vt(vt, false), _rhs(rhs, false), _dst(dst, false);\n    SVD::backSubst(_w, _u, _vt, _rhs, _dst);\n    CV_Assert(_dst.data == (uchar*)&dst.val[0]);\n}\n\n\n\n/////////////////////////////////// Multiply-with-Carry RNG ///////////////////////////////////\n\ninline RNG::RNG()              { state = 0xffffffff; }\ninline RNG::RNG(uint64 _state) { state = _state ? _state : 0xffffffff; }\n\ninline RNG::operator uchar()    { return (uchar)next(); }\ninline RNG::operator schar()    { return (schar)next(); }\ninline RNG::operator ushort()   { return (ushort)next(); }\ninline RNG::operator short()    { return (short)next(); }\ninline RNG::operator int()      { return (int)next(); }\ninline RNG::operator unsigned() { return next(); }\ninline RNG::operator float()    { return next()*2.3283064365386962890625e-10f; }\ninline RNG::operator double()   { unsigned t = next(); return (((uint64)t << 32) | next()) * 5.4210108624275221700372640043497e-20; }\n\ninline unsigned RNG::operator ()(unsigned N) { return (unsigned)uniform(0,N); }\ninline unsigned RNG::operator ()()           { return next(); }\n\ninline int    RNG::uniform(int a, int b)       { return a == b ? a : (int)(next() % (b - a) + a); }\ninline float  RNG::uniform(float a, float b)   { return ((float)*this)*(b - a) + a; }\ninline double RNG::uniform(double a, double b) { return ((double)*this)*(b - a) + a; }\n\ninline bool RNG::operator ==(const RNG& other) const { return state == other.state; }\n\ninline unsigned RNG::next()\n{\n    state = (uint64)(unsigned)state* /*CV_RNG_COEFF*/ 4164903690U + (unsigned)(state >> 32);\n    return (unsigned)state;\n}\n\n//! returns the next uniformly-distributed random number of the specified type\ntemplate<typename _Tp> static inline _Tp randu()\n{\n  return (_Tp)theRNG();\n}\n\n///////////////////////////////// Formatted string generation /////////////////////////////////\n\n/** @brief Returns a text string formatted using the printf-like expression.\n\nThe function acts like sprintf but forms and returns an STL string. It can be used to form an error\nmessage in the Exception constructor.\n@param fmt printf-compatible formatting specifiers.\n\n**Note**:\n|Type|Specifier|\n|-|-|\n|`const char*`|`%s`|\n|`char`|`%c`|\n|`float` / `double`|`%f`,`%g`|\n|`int`, `long`, `long long`|`%d`, `%ld`, ``%lld`|\n|`unsigned`, `unsigned long`, `unsigned long long`|`%u`, `%lu`, `%llu`|\n|`uint64` -> `uintmax_t`, `int64` -> `intmax_t`|`%ju`, `%jd`|\n|`size_t`|`%zu`|\n */\nCV_EXPORTS String format( const char* fmt, ... ) CV_FORMAT_PRINTF(1, 2);\n\n///////////////////////////////// Formatted output of cv::Mat /////////////////////////////////\n\nstatic inline\nPtr<Formatted> format(InputArray mtx, Formatter::FormatType fmt)\n{\n    return Formatter::get(fmt)->format(mtx.getMat());\n}\n\nstatic inline\nint print(Ptr<Formatted> fmtd, FILE* stream = stdout)\n{\n    int written = 0;\n    fmtd->reset();\n    for(const char* str = fmtd->next(); str; str = fmtd->next())\n        written += fputs(str, stream);\n\n    return written;\n}\n\nstatic inline\nint print(const Mat& mtx, FILE* stream = stdout)\n{\n    return print(Formatter::get()->format(mtx), stream);\n}\n\nstatic inline\nint print(const UMat& mtx, FILE* stream = stdout)\n{\n    return print(Formatter::get()->format(mtx.getMat(ACCESS_READ)), stream);\n}\n\ntemplate<typename _Tp> static inline\nint print(const std::vector<Point_<_Tp> >& vec, FILE* stream = stdout)\n{\n    return print(Formatter::get()->format(Mat(vec)), stream);\n}\n\ntemplate<typename _Tp> static inline\nint print(const std::vector<Point3_<_Tp> >& vec, FILE* stream = stdout)\n{\n    return print(Formatter::get()->format(Mat(vec)), stream);\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nint print(const Matx<_Tp, m, n>& matx, FILE* stream = stdout)\n{\n    return print(Formatter::get()->format(cv::Mat(matx)), stream);\n}\n\n//! @endcond\n\n/****************************************************************************************\\\n*                                  Auxiliary algorithms                                  *\n\\****************************************************************************************/\n\n/** @brief Splits an element set into equivalency classes.\n\nThe generic function partition implements an \\f$O(N^2)\\f$ algorithm for splitting a set of \\f$N\\f$ elements\ninto one or more equivalency classes, as described in\n<http://en.wikipedia.org/wiki/Disjoint-set_data_structure> . The function returns the number of\nequivalency classes.\n@param _vec Set of elements stored as a vector.\n@param labels Output vector of labels. It contains as many elements as vec. Each label labels[i] is\na 0-based cluster index of `vec[i]`.\n@param predicate Equivalence predicate (pointer to a boolean function of two arguments or an\ninstance of the class that has the method bool operator()(const _Tp& a, const _Tp& b) ). The\npredicate returns true when the elements are certainly in the same class, and returns false if they\nmay or may not be in the same class.\n@ingroup core_cluster\n*/\ntemplate<typename _Tp, class _EqPredicate> int\npartition( const std::vector<_Tp>& _vec, std::vector<int>& labels,\n          _EqPredicate predicate=_EqPredicate())\n{\n    int i, j, N = (int)_vec.size();\n    const _Tp* vec = &_vec[0];\n\n    const int PARENT=0;\n    const int RANK=1;\n\n    std::vector<int> _nodes(N*2);\n    int (*nodes)[2] = (int(*)[2])&_nodes[0];\n\n    // The first O(N) pass: create N single-vertex trees\n    for(i = 0; i < N; i++)\n    {\n        nodes[i][PARENT]=-1;\n        nodes[i][RANK] = 0;\n    }\n\n    // The main O(N^2) pass: merge connected components\n    for( i = 0; i < N; i++ )\n    {\n        int root = i;\n\n        // find root\n        while( nodes[root][PARENT] >= 0 )\n            root = nodes[root][PARENT];\n\n        for( j = 0; j < N; j++ )\n        {\n            if( i == j || !predicate(vec[i], vec[j]))\n                continue;\n            int root2 = j;\n\n            while( nodes[root2][PARENT] >= 0 )\n                root2 = nodes[root2][PARENT];\n\n            if( root2 != root )\n            {\n                // unite both trees\n                int rank = nodes[root][RANK], rank2 = nodes[root2][RANK];\n                if( rank > rank2 )\n                    nodes[root2][PARENT] = root;\n                else\n                {\n                    nodes[root][PARENT] = root2;\n                    nodes[root2][RANK] += rank == rank2;\n                    root = root2;\n                }\n                CV_Assert( nodes[root][PARENT] < 0 );\n\n                int k = j, parent;\n\n                // compress the path from node2 to root\n                while( (parent = nodes[k][PARENT]) >= 0 )\n                {\n                    nodes[k][PARENT] = root;\n                    k = parent;\n                }\n\n                // compress the path from node to root\n                k = i;\n                while( (parent = nodes[k][PARENT]) >= 0 )\n                {\n                    nodes[k][PARENT] = root;\n                    k = parent;\n                }\n            }\n        }\n    }\n\n    // Final O(N) pass: enumerate classes\n    labels.resize(N);\n    int nclasses = 0;\n\n    for( i = 0; i < N; i++ )\n    {\n        int root = i;\n        while( nodes[root][PARENT] >= 0 )\n            root = nodes[root][PARENT];\n        // re-use the rank as the class label\n        if( nodes[root][RANK] >= 0 )\n            nodes[root][RANK] = ~nclasses++;\n        labels[i] = ~nodes[root][RANK];\n    }\n\n    return nclasses;\n}\n\n} // cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/optim.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the OpenCV Foundation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_OPTIM_HPP\n#define OPENCV_OPTIM_HPP\n\n#include \"opencv2/core.hpp\"\n\nnamespace cv\n{\n\n/** @addtogroup core_optim\nThe algorithms in this section minimize or maximize function value within specified constraints or\nwithout any constraints.\n@{\n*/\n\n/** @brief Basic interface for all solvers\n */\nclass CV_EXPORTS MinProblemSolver : public Algorithm\n{\npublic:\n    /** @brief Represents function being optimized\n     */\n    class CV_EXPORTS Function\n    {\n    public:\n        virtual ~Function() {}\n        virtual int getDims() const = 0;\n        virtual double getGradientEps() const;\n        virtual double calc(const double* x) const = 0;\n        virtual void getGradient(const double* x,double* grad);\n    };\n\n    /** @brief Getter for the optimized function.\n\n    The optimized function is represented by Function interface, which requires derivatives to\n    implement the calc(double*) and getDim() methods to evaluate the function.\n\n    @return Smart-pointer to an object that implements Function interface - it represents the\n    function that is being optimized. It can be empty, if no function was given so far.\n     */\n    virtual Ptr<Function> getFunction() const = 0;\n\n    /** @brief Setter for the optimized function.\n\n    *It should be called at least once before the call to* minimize(), as default value is not usable.\n\n    @param f The new function to optimize.\n     */\n    virtual void setFunction(const Ptr<Function>& f) = 0;\n\n    /** @brief Getter for the previously set terminal criteria for this algorithm.\n\n    @return Deep copy of the terminal criteria used at the moment.\n     */\n    virtual TermCriteria getTermCriteria() const = 0;\n\n    /** @brief Set terminal criteria for solver.\n\n    This method *is not necessary* to be called before the first call to minimize(), as the default\n    value is sensible.\n\n    Algorithm stops when the number of function evaluations done exceeds termcrit.maxCount, when\n    the function values at the vertices of simplex are within termcrit.epsilon range or simplex\n    becomes so small that it can enclosed in a box with termcrit.epsilon sides, whatever comes\n    first.\n    @param termcrit Terminal criteria to be used, represented as cv::TermCriteria structure.\n     */\n    virtual void setTermCriteria(const TermCriteria& termcrit) = 0;\n\n    /** @brief actually runs the algorithm and performs the minimization.\n\n    The sole input parameter determines the centroid of the starting simplex (roughly, it tells\n    where to start), all the others (terminal criteria, initial step, function to be minimized) are\n    supposed to be set via the setters before the call to this method or the default values (not\n    always sensible) will be used.\n\n    @param x The initial point, that will become a centroid of an initial simplex. After the algorithm\n    will terminate, it will be set to the point where the algorithm stops, the point of possible\n    minimum.\n    @return The value of a function at the point found.\n     */\n    virtual double minimize(InputOutputArray x) = 0;\n};\n\n/** @brief This class is used to perform the non-linear non-constrained minimization of a function,\n\ndefined on an `n`-dimensional Euclidean space, using the **Nelder-Mead method**, also known as\n**downhill simplex method**. The basic idea about the method can be obtained from\n<http://en.wikipedia.org/wiki/Nelder-Mead_method>.\n\nIt should be noted, that this method, although deterministic, is rather a heuristic and therefore\nmay converge to a local minima, not necessary a global one. It is iterative optimization technique,\nwhich at each step uses an information about the values of a function evaluated only at `n+1`\npoints, arranged as a *simplex* in `n`-dimensional space (hence the second name of the method). At\neach step new point is chosen to evaluate function at, obtained value is compared with previous\nones and based on this information simplex changes it's shape , slowly moving to the local minimum.\nThus this method is using *only* function values to make decision, on contrary to, say, Nonlinear\nConjugate Gradient method (which is also implemented in optim).\n\nAlgorithm stops when the number of function evaluations done exceeds termcrit.maxCount, when the\nfunction values at the vertices of simplex are within termcrit.epsilon range or simplex becomes so\nsmall that it can enclosed in a box with termcrit.epsilon sides, whatever comes first, for some\ndefined by user positive integer termcrit.maxCount and positive non-integer termcrit.epsilon.\n\n@note DownhillSolver is a derivative of the abstract interface\ncv::MinProblemSolver, which in turn is derived from the Algorithm interface and is used to\nencapsulate the functionality, common to all non-linear optimization algorithms in the optim\nmodule.\n\n@note term criteria should meet following condition:\n@code\n    termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) && termcrit.epsilon > 0 && termcrit.maxCount > 0\n@endcode\n */\nclass CV_EXPORTS DownhillSolver : public MinProblemSolver\n{\npublic:\n    /** @brief Returns the initial step that will be used in downhill simplex algorithm.\n\n    @param step Initial step that will be used in algorithm. Note, that although corresponding setter\n    accepts column-vectors as well as row-vectors, this method will return a row-vector.\n    @see DownhillSolver::setInitStep\n     */\n    virtual void getInitStep(OutputArray step) const=0;\n\n    /** @brief Sets the initial step that will be used in downhill simplex algorithm.\n\n    Step, together with initial point (given in DownhillSolver::minimize) are two `n`-dimensional\n    vectors that are used to determine the shape of initial simplex. Roughly said, initial point\n    determines the position of a simplex (it will become simplex's centroid), while step determines the\n    spread (size in each dimension) of a simplex. To be more precise, if \\f$s,x_0\\in\\mathbb{R}^n\\f$ are\n    the initial step and initial point respectively, the vertices of a simplex will be:\n    \\f$v_0:=x_0-\\frac{1}{2} s\\f$ and \\f$v_i:=x_0+s_i\\f$ for \\f$i=1,2,\\dots,n\\f$ where \\f$s_i\\f$ denotes\n    projections of the initial step of *n*-th coordinate (the result of projection is treated to be\n    vector given by \\f$s_i:=e_i\\cdot\\left<e_i\\cdot s\\right>\\f$, where \\f$e_i\\f$ form canonical basis)\n\n    @param step Initial step that will be used in algorithm. Roughly said, it determines the spread\n    (size in each dimension) of an initial simplex.\n     */\n    virtual void setInitStep(InputArray step)=0;\n\n    /** @brief This function returns the reference to the ready-to-use DownhillSolver object.\n\n    All the parameters are optional, so this procedure can be called even without parameters at\n    all. In this case, the default values will be used. As default value for terminal criteria are\n    the only sensible ones, MinProblemSolver::setFunction() and DownhillSolver::setInitStep()\n    should be called upon the obtained object, if the respective parameters were not given to\n    create(). Otherwise, the two ways (give parameters to createDownhillSolver() or miss them out\n    and call the MinProblemSolver::setFunction() and DownhillSolver::setInitStep()) are absolutely\n    equivalent (and will drop the same errors in the same way, should invalid input be detected).\n    @param f Pointer to the function that will be minimized, similarly to the one you submit via\n    MinProblemSolver::setFunction.\n    @param initStep Initial step, that will be used to construct the initial simplex, similarly to the one\n    you submit via MinProblemSolver::setInitStep.\n    @param termcrit Terminal criteria to the algorithm, similarly to the one you submit via\n    MinProblemSolver::setTermCriteria.\n     */\n    static Ptr<DownhillSolver> create(const Ptr<MinProblemSolver::Function>& f=Ptr<MinProblemSolver::Function>(),\n                                      InputArray initStep=Mat_<double>(1,1,0.0),\n                                      TermCriteria termcrit=TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5000,0.000001));\n};\n\n/** @brief This class is used to perform the non-linear non-constrained minimization of a function\nwith known gradient,\n\ndefined on an *n*-dimensional Euclidean space, using the **Nonlinear Conjugate Gradient method**.\nThe implementation was done based on the beautifully clear explanatory article [An Introduction to\nthe Conjugate Gradient Method Without the Agonizing\nPain](http://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf) by Jonathan Richard\nShewchuk. The method can be seen as an adaptation of a standard Conjugate Gradient method (see, for\nexample <http://en.wikipedia.org/wiki/Conjugate_gradient_method>) for numerically solving the\nsystems of linear equations.\n\nIt should be noted, that this method, although deterministic, is rather a heuristic method and\ntherefore may converge to a local minima, not necessary a global one. What is even more disastrous,\nmost of its behaviour is ruled by gradient, therefore it essentially cannot distinguish between\nlocal minima and maxima. Therefore, if it starts sufficiently near to the local maximum, it may\nconverge to it. Another obvious restriction is that it should be possible to compute the gradient of\na function at any point, thus it is preferable to have analytic expression for gradient and\ncomputational burden should be born by the user.\n\nThe latter responsibility is accomplished via the getGradient method of a\nMinProblemSolver::Function interface (which represents function being optimized). This method takes\npoint a point in *n*-dimensional space (first argument represents the array of coordinates of that\npoint) and compute its gradient (it should be stored in the second argument as an array).\n\n@note class ConjGradSolver thus does not add any new methods to the basic MinProblemSolver interface.\n\n@note term criteria should meet following condition:\n@code\n    termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) && termcrit.epsilon > 0 && termcrit.maxCount > 0\n    // or\n    termcrit.type == TermCriteria::MAX_ITER) && termcrit.maxCount > 0\n@endcode\n */\nclass CV_EXPORTS ConjGradSolver : public MinProblemSolver\n{\npublic:\n    /** @brief This function returns the reference to the ready-to-use ConjGradSolver object.\n\n    All the parameters are optional, so this procedure can be called even without parameters at\n    all. In this case, the default values will be used. As default value for terminal criteria are\n    the only sensible ones, MinProblemSolver::setFunction() should be called upon the obtained\n    object, if the function was not given to create(). Otherwise, the two ways (submit it to\n    create() or miss it out and call the MinProblemSolver::setFunction()) are absolutely equivalent\n    (and will drop the same errors in the same way, should invalid input be detected).\n    @param f Pointer to the function that will be minimized, similarly to the one you submit via\n    MinProblemSolver::setFunction.\n    @param termcrit Terminal criteria to the algorithm, similarly to the one you submit via\n    MinProblemSolver::setTermCriteria.\n    */\n    static Ptr<ConjGradSolver> create(const Ptr<MinProblemSolver::Function>& f=Ptr<ConjGradSolver::Function>(),\n                                      TermCriteria termcrit=TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5000,0.000001));\n};\n\n//! return codes for cv::solveLP() function\nenum SolveLPResult\n{\n    SOLVELP_UNBOUNDED    = -2, //!< problem is unbounded (target function can achieve arbitrary high values)\n    SOLVELP_UNFEASIBLE    = -1, //!< problem is unfeasible (there are no points that satisfy all the constraints imposed)\n    SOLVELP_SINGLE    = 0, //!< there is only one maximum for target function\n    SOLVELP_MULTI    = 1 //!< there are multiple maxima for target function - the arbitrary one is returned\n};\n\n/** @brief Solve given (non-integer) linear programming problem using the Simplex Algorithm (Simplex Method).\n\nWhat we mean here by \"linear programming problem\" (or LP problem, for short) can be formulated as:\n\n\\f[\\mbox{Maximize } c\\cdot x\\\\\n \\mbox{Subject to:}\\\\\n Ax\\leq b\\\\\n x\\geq 0\\f]\n\nWhere \\f$c\\f$ is fixed `1`-by-`n` row-vector, \\f$A\\f$ is fixed `m`-by-`n` matrix, \\f$b\\f$ is fixed `m`-by-`1`\ncolumn vector and \\f$x\\f$ is an arbitrary `n`-by-`1` column vector, which satisfies the constraints.\n\nSimplex algorithm is one of many algorithms that are designed to handle this sort of problems\nefficiently. Although it is not optimal in theoretical sense (there exist algorithms that can solve\nany problem written as above in polynomial time, while simplex method degenerates to exponential\ntime for some special cases), it is well-studied, easy to implement and is shown to work well for\nreal-life purposes.\n\nThe particular implementation is taken almost verbatim from **Introduction to Algorithms, third\nedition** by T. H. Cormen, C. E. Leiserson, R. L. Rivest and Clifford Stein. In particular, the\nBland's rule <http://en.wikipedia.org/wiki/Bland%27s_rule> is used to prevent cycling.\n\n@param Func This row-vector corresponds to \\f$c\\f$ in the LP problem formulation (see above). It should\ncontain 32- or 64-bit floating point numbers. As a convenience, column-vector may be also submitted,\nin the latter case it is understood to correspond to \\f$c^T\\f$.\n@param Constr `m`-by-`n+1` matrix, whose rightmost column corresponds to \\f$b\\f$ in formulation above\nand the remaining to \\f$A\\f$. It should contain 32- or 64-bit floating point numbers.\n@param z The solution will be returned here as a column-vector - it corresponds to \\f$c\\f$ in the\nformulation above. It will contain 64-bit floating point numbers.\n@return One of cv::SolveLPResult\n */\nCV_EXPORTS_W int solveLP(InputArray Func, InputArray Constr, OutputArray z);\n\n//! @}\n\n}// cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/ovx.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n// Copyright (C) 2016, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n\n// OpenVX related definitions and declarations\n\n#pragma once\n#ifndef OPENCV_OVX_HPP\n#define OPENCV_OVX_HPP\n\n#include \"cvdef.h\"\n\nnamespace cv\n{\n/// Check if use of OpenVX is possible\nCV_EXPORTS_W bool haveOpenVX();\n\n/// Check if use of OpenVX is enabled\nCV_EXPORTS_W bool useOpenVX();\n\n/// Enable/disable use of OpenVX\nCV_EXPORTS_W void setUseOpenVX(bool flag);\n} // namespace cv\n\n#endif // OPENCV_OVX_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/parallel/backend/parallel_for.openmp.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_PARALLEL_FOR_OPENMP_HPP\n#define OPENCV_CORE_PARALLEL_FOR_OPENMP_HPP\n\n#include \"opencv2/core/parallel/parallel_backend.hpp\"\n\n#if !defined(_OPENMP) && !defined(OPENCV_SKIP_OPENMP_PRESENSE_CHECK)\n#error \"This file must be compiled with enabled OpenMP\"\n#endif\n\n#include <omp.h>\n\nnamespace cv { namespace parallel { namespace openmp {\n\n/** OpenMP parallel_for API implementation\n *\n * @sa setParallelForBackend\n * @ingroup core_parallel_backend\n */\nclass ParallelForBackend : public ParallelForAPI\n{\nprotected:\n    int numThreads;\n    int numThreadsMax;\npublic:\n    ParallelForBackend()\n    {\n        numThreads = 0;\n        numThreadsMax = omp_get_max_threads();\n    }\n\n    virtual ~ParallelForBackend() {}\n\n    virtual void parallel_for(int tasks, FN_parallel_for_body_cb_t body_callback, void* callback_data) CV_OVERRIDE\n    {\n#pragma omp parallel for schedule(dynamic) num_threads(numThreads > 0 ? numThreads : numThreadsMax)\n        for (int i = 0; i < tasks; ++i)\n            body_callback(i, i + 1, callback_data);\n    }\n\n    virtual int getThreadNum() const CV_OVERRIDE\n    {\n        return omp_get_thread_num();\n    }\n\n    virtual int getNumThreads() const CV_OVERRIDE\n    {\n        return numThreads > 0\n               ? numThreads\n               : numThreadsMax;\n    }\n\n    virtual int setNumThreads(int nThreads) CV_OVERRIDE\n    {\n        int oldNumThreads = numThreads;\n        numThreads = nThreads;\n        // nothing needed as numThreads is used in #pragma omp parallel for directly\n        return oldNumThreads;\n    }\n\n    const char* getName() const CV_OVERRIDE\n    {\n        return \"openmp\";\n    }\n};\n\n}}}  // namespace\n\n#endif  // OPENCV_CORE_PARALLEL_FOR_OPENMP_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/parallel/backend/parallel_for.tbb.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_PARALLEL_FOR_TBB_HPP\n#define OPENCV_CORE_PARALLEL_FOR_TBB_HPP\n\n#include \"opencv2/core/parallel/parallel_backend.hpp\"\n#include <opencv2/core/utils/logger.hpp>\n\n#ifndef TBB_SUPPRESS_DEPRECATED_MESSAGES  // supress warning\n#define TBB_SUPPRESS_DEPRECATED_MESSAGES 1\n#endif\n#include \"tbb/tbb.h\"\n#if !defined(TBB_INTERFACE_VERSION)\n#error \"Unknows/unsupported TBB version\"\n#endif\n\n#if TBB_INTERFACE_VERSION >= 8000\n#include \"tbb/task_arena.h\"\n#endif\n\nnamespace cv { namespace parallel { namespace tbb {\n\nusing namespace ::tbb;\n\n#if TBB_INTERFACE_VERSION >= 8000\nstatic tbb::task_arena& getArena()\n{\n    static tbb::task_arena tbbArena(tbb::task_arena::automatic);\n    return tbbArena;\n}\n#else\nstatic tbb::task_scheduler_init& getScheduler()\n{\n    static tbb::task_scheduler_init tbbScheduler(tbb::task_scheduler_init::deferred);\n    return tbbScheduler;\n}\n#endif\n\n/** OpenMP parallel_for API implementation\n *\n * @sa setParallelForBackend\n * @ingroup core_parallel_backend\n */\nclass ParallelForBackend : public ParallelForAPI\n{\nprotected:\n    int numThreads;\n    int numThreadsMax;\npublic:\n    ParallelForBackend()\n    {\n        CV_LOG_INFO(NULL, \"Initializing TBB parallel backend: TBB_INTERFACE_VERSION=\" << TBB_INTERFACE_VERSION);\n        numThreads = 0;\n#if TBB_INTERFACE_VERSION >= 8000\n        (void)getArena();\n#else\n        (void)getScheduler();\n#endif\n    }\n\n    virtual ~ParallelForBackend() {}\n\n    class CallbackProxy\n    {\n        const FN_parallel_for_body_cb_t& callback;\n        void* const callback_data;\n        const int tasks;\n    public:\n        inline CallbackProxy(int tasks_, FN_parallel_for_body_cb_t& callback_, void* callback_data_)\n            : callback(callback_), callback_data(callback_data_), tasks(tasks_)\n        {\n            // nothing\n        }\n\n        void operator()(const tbb::blocked_range<int>& range) const\n        {\n            this->callback(range.begin(), range.end(), callback_data);\n        }\n\n        void operator()() const\n        {\n            tbb::parallel_for(tbb::blocked_range<int>(0, tasks), *this);\n        }\n    };\n\n    virtual void parallel_for(int tasks, FN_parallel_for_body_cb_t body_callback, void* callback_data) CV_OVERRIDE\n    {\n        CallbackProxy task(tasks, body_callback, callback_data);\n#if TBB_INTERFACE_VERSION >= 8000\n        getArena().execute(task);\n#else\n        task();\n#endif\n    }\n\n    virtual int getThreadNum() const CV_OVERRIDE\n    {\n#if TBB_INTERFACE_VERSION >= 9100\n        return tbb::this_task_arena::current_thread_index();\n#elif TBB_INTERFACE_VERSION >= 8000\n        return tbb::task_arena::current_thread_index();\n#else\n        return 0;\n#endif\n    }\n\n    virtual int getNumThreads() const CV_OVERRIDE\n    {\n#if TBB_INTERFACE_VERSION >= 9100\n    return getArena().max_concurrency();\n#elif TBB_INTERFACE_VERSION >= 8000\n    return numThreads > 0\n        ? numThreads\n        : tbb::task_scheduler_init::default_num_threads();\n#else\n    return getScheduler().is_active()\n           ? numThreads\n           : tbb::task_scheduler_init::default_num_threads();\n#endif\n    }\n\n    virtual int setNumThreads(int nThreads) CV_OVERRIDE\n    {\n        int oldNumThreads = numThreads;\n        numThreads = nThreads;\n\n#if TBB_INTERFACE_VERSION >= 8000\n        auto& tbbArena = getArena();\n        if (tbbArena.is_active())\n            tbbArena.terminate();\n        if (numThreads > 0)\n            tbbArena.initialize(numThreads);\n#else\n        auto& tbbScheduler = getScheduler();\n        if (tbbScheduler.is_active())\n            tbbScheduler.terminate();\n        if (numThreads > 0)\n            tbbScheduler.initialize(numThreads);\n#endif\n        return oldNumThreads;\n    }\n\n    const char* getName() const CV_OVERRIDE\n    {\n        return \"tbb\";\n    }\n};\n\n}}}  // namespace\n\n#endif  // OPENCV_CORE_PARALLEL_FOR_TBB_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/parallel/parallel_backend.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_PARALLEL_BACKEND_HPP\n#define OPENCV_CORE_PARALLEL_BACKEND_HPP\n\n#include \"opencv2/core/cvdef.h\"\n#include <memory>\n\nnamespace cv { namespace parallel {\n#ifndef CV_API_CALL\n#define CV_API_CALL\n#endif\n\n/** @addtogroup core_parallel_backend\n * @{\n * API below is provided to resolve problem of CPU resource over-subscription by multiple thread pools from different multi-threading frameworks.\n * This is common problem for cases when OpenCV compiled threading framework is different from the Users Applications framework.\n *\n * Applications can replace OpenCV `parallel_for()` backend with own implementation (to reuse Application's thread pool).\n *\n *\n * ### Backend API usage examples\n *\n * #### Intel TBB\n *\n * - include header with simple implementation of TBB backend:\n *   @snippet parallel_backend/example-tbb.cpp tbb_include\n * - execute backend replacement code:\n *   @snippet parallel_backend/example-tbb.cpp tbb_backend\n * - configuration of compiler/linker options is responsibility of Application's scripts\n *\n * #### OpenMP\n *\n * - include header with simple implementation of OpenMP backend:\n *   @snippet parallel_backend/example-openmp.cpp openmp_include\n * - execute backend replacement code:\n *   @snippet parallel_backend/example-openmp.cpp openmp_backend\n * - Configuration of compiler/linker options is responsibility of Application's scripts\n *\n *\n * ### Plugins support\n *\n * Runtime configuration options:\n * - change backend priority: `OPENCV_PARALLEL_PRIORITY_<backend>=9999`\n * - disable backend: `OPENCV_PARALLEL_PRIORITY_<backend>=0`\n * - specify list of backends with high priority (>100000): `OPENCV_PARALLEL_PRIORITY_LIST=TBB,OPENMP`. Unknown backends are registered as new plugins.\n *\n */\n\n/** Interface for parallel_for backends implementations\n *\n * @sa setParallelForBackend\n */\nclass CV_EXPORTS ParallelForAPI\n{\npublic:\n    virtual ~ParallelForAPI();\n\n    typedef void (CV_API_CALL *FN_parallel_for_body_cb_t)(int start, int end, void* data);\n\n    virtual void parallel_for(int tasks, FN_parallel_for_body_cb_t body_callback, void* callback_data) = 0;\n\n    virtual int getThreadNum() const = 0;\n\n    virtual int getNumThreads() const = 0;\n\n    virtual int setNumThreads(int nThreads) = 0;\n\n    virtual const char* getName() const = 0;\n};\n\n/** @brief Replace OpenCV parallel_for backend\n *\n * Application can replace OpenCV `parallel_for()` backend with own implementation.\n *\n * @note This call is not thread-safe. Consider calling this function from the `main()` before any other OpenCV processing functions (and without any other created threads).\n */\nCV_EXPORTS void setParallelForBackend(const std::shared_ptr<ParallelForAPI>& api, bool propagateNumThreads = true);\n\n/** @brief Change OpenCV parallel_for backend\n *\n * @note This call is not thread-safe. Consider calling this function from the `main()` before any other OpenCV processing functions (and without any other created threads).\n */\nCV_EXPORTS_W bool setParallelForBackend(const std::string& backendName, bool propagateNumThreads = true);\n\n//! @}\n}}  // namespace\n#endif  // OPENCV_CORE_PARALLEL_BACKEND_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/persistence.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_PERSISTENCE_HPP\n#define OPENCV_CORE_PERSISTENCE_HPP\n\n#ifndef CV_DOXYGEN\n/// Define to support persistence legacy formats\n#define CV__LEGACY_PERSISTENCE\n#endif\n\n#ifndef __cplusplus\n#  error persistence.hpp header must be compiled as C++\n#endif\n\n//! @addtogroup core_c\n//! @{\n\n/** @brief \"black box\" representation of the file storage associated with a file on disk.\n\nSeveral functions that are described below take CvFileStorage\\* as inputs and allow the user to\nsave or to load hierarchical collections that consist of scalar values, standard CXCore objects\n(such as matrices, sequences, graphs), and user-defined objects.\n\nOpenCV can read and write data in XML (<http://www.w3c.org/XML>), YAML (<http://www.yaml.org>) or\nJSON (<http://www.json.org/>) formats. Below is an example of 3x3 floating-point identity matrix A,\nstored in XML and YAML files\nusing CXCore functions:\nXML:\n@code{.xml}\n    <?xml version=\"1.0\">\n    <opencv_storage>\n    <A type_id=\"opencv-matrix\">\n      <rows>3</rows>\n      <cols>3</cols>\n      <dt>f</dt>\n      <data>1. 0. 0. 0. 1. 0. 0. 0. 1.</data>\n    </A>\n    </opencv_storage>\n@endcode\nYAML:\n@code{.yaml}\n    %YAML:1.0\n    A: !!opencv-matrix\n      rows: 3\n      cols: 3\n      dt: f\n      data: [ 1., 0., 0., 0., 1., 0., 0., 0., 1.]\n@endcode\nAs it can be seen from the examples, XML uses nested tags to represent hierarchy, while YAML uses\nindentation for that purpose (similar to the Python programming language).\n\nThe same functions can read and write data in both formats; the particular format is determined by\nthe extension of the opened file, \".xml\" for XML files, \".yml\" or \".yaml\" for YAML and \".json\" for\nJSON.\n */\n\n//! @} core_c\n\n#include \"opencv2/core/types.hpp\"\n#include \"opencv2/core/mat.hpp\"\n\nnamespace cv {\n\n/** @addtogroup core_xml\n\nXML/YAML/JSON file storages.     {#xml_storage}\n=======================\nWriting to a file storage.\n--------------------------\nYou can store and then restore various OpenCV data structures to/from XML (<http://www.w3c.org/XML>),\nYAML (<http://www.yaml.org>) or JSON (<http://www.json.org/>) formats. Also, it is possible to store\nand load arbitrarily complex data structures, which include OpenCV data structures, as well as\nprimitive data types (integer and floating-point numbers and text strings) as their elements.\n\nUse the following procedure to write something to XML, YAML or JSON:\n-# Create new FileStorage and open it for writing. It can be done with a single call to\nFileStorage::FileStorage constructor that takes a filename, or you can use the default constructor\nand then call FileStorage::open. Format of the file (XML, YAML or JSON) is determined from the filename\nextension (\".xml\", \".yml\"/\".yaml\" and \".json\", respectively)\n-# Write all the data you want using the streaming operator `<<`, just like in the case of STL\nstreams.\n-# Close the file using FileStorage::release. FileStorage destructor also closes the file.\n\nHere is an example:\n@code\n    #include \"opencv2/core.hpp\"\n    #include <time.h>\n\n    using namespace cv;\n\n    int main(int, char** argv)\n    {\n        FileStorage fs(\"test.yml\", FileStorage::WRITE);\n\n        fs << \"frameCount\" << 5;\n        time_t rawtime; time(&rawtime);\n        fs << \"calibrationDate\" << asctime(localtime(&rawtime));\n        Mat cameraMatrix = (Mat_<double>(3,3) << 1000, 0, 320, 0, 1000, 240, 0, 0, 1);\n        Mat distCoeffs = (Mat_<double>(5,1) << 0.1, 0.01, -0.001, 0, 0);\n        fs << \"cameraMatrix\" << cameraMatrix << \"distCoeffs\" << distCoeffs;\n        fs << \"features\" << \"[\";\n        for( int i = 0; i < 3; i++ )\n        {\n            int x = rand() % 640;\n            int y = rand() % 480;\n            uchar lbp = rand() % 256;\n\n            fs << \"{:\" << \"x\" << x << \"y\" << y << \"lbp\" << \"[:\";\n            for( int j = 0; j < 8; j++ )\n                fs << ((lbp >> j) & 1);\n            fs << \"]\" << \"}\";\n        }\n        fs << \"]\";\n        fs.release();\n        return 0;\n    }\n@endcode\nThe sample above stores to YML an integer, a text string (calibration date), 2 matrices, and a custom\nstructure \"feature\", which includes feature coordinates and LBP (local binary pattern) value. Here\nis output of the sample:\n@code{.yaml}\n%YAML:1.0\nframeCount: 5\ncalibrationDate: \"Fri Jun 17 14:09:29 2011\\n\"\ncameraMatrix: !!opencv-matrix\n   rows: 3\n   cols: 3\n   dt: d\n   data: [ 1000., 0., 320., 0., 1000., 240., 0., 0., 1. ]\ndistCoeffs: !!opencv-matrix\n   rows: 5\n   cols: 1\n   dt: d\n   data: [ 1.0000000000000001e-01, 1.0000000000000000e-02,\n       -1.0000000000000000e-03, 0., 0. ]\nfeatures:\n   - { x:167, y:49, lbp:[ 1, 0, 0, 1, 1, 0, 1, 1 ] }\n   - { x:298, y:130, lbp:[ 0, 0, 0, 1, 0, 0, 1, 1 ] }\n   - { x:344, y:158, lbp:[ 1, 1, 0, 0, 0, 0, 1, 0 ] }\n@endcode\n\nAs an exercise, you can replace \".yml\" with \".xml\" or \".json\" in the sample above and see, how the\ncorresponding XML file will look like.\n\nSeveral things can be noted by looking at the sample code and the output:\n\n-   The produced YAML (and XML/JSON) consists of heterogeneous collections that can be nested. There are\n    2 types of collections: named collections (mappings) and unnamed collections (sequences). In mappings\n    each element has a name and is accessed by name. This is similar to structures and std::map in\n    C/C++ and dictionaries in Python. In sequences elements do not have names, they are accessed by\n    indices. This is similar to arrays and std::vector in C/C++ and lists, tuples in Python.\n    \"Heterogeneous\" means that elements of each single collection can have different types.\n\n    Top-level collection in YAML/XML/JSON is a mapping. Each matrix is stored as a mapping, and the matrix\n    elements are stored as a sequence. Then, there is a sequence of features, where each feature is\n    represented a mapping, and lbp value in a nested sequence.\n\n-   When you write to a mapping (a structure), you write element name followed by its value. When you\n    write to a sequence, you simply write the elements one by one. OpenCV data structures (such as\n    cv::Mat) are written in absolutely the same way as simple C data structures - using `<<`\n    operator.\n\n-   To write a mapping, you first write the special string `{` to the storage, then write the\n    elements as pairs (`fs << <element_name> << <element_value>`) and then write the closing\n    `}`.\n\n-   To write a sequence, you first write the special string `[`, then write the elements, then\n    write the closing `]`.\n\n-   In YAML/JSON (but not XML), mappings and sequences can be written in a compact Python-like inline\n    form. In the sample above matrix elements, as well as each feature, including its lbp value, is\n    stored in such inline form. To store a mapping/sequence in a compact form, put `:` after the\n    opening character, e.g. use `{:` instead of `{` and `[:` instead of `[`. When the\n    data is written to XML, those extra `:` are ignored.\n\nReading data from a file storage.\n---------------------------------\nTo read the previously written XML, YAML or JSON file, do the following:\n-#  Open the file storage using FileStorage::FileStorage constructor or FileStorage::open method.\n    In the current implementation the whole file is parsed and the whole representation of file\n    storage is built in memory as a hierarchy of file nodes (see FileNode)\n\n-#  Read the data you are interested in. Use FileStorage::operator [], FileNode::operator []\n    and/or FileNodeIterator.\n\n-#  Close the storage using FileStorage::release.\n\nHere is how to read the file created by the code sample above:\n@code\n    FileStorage fs2(\"test.yml\", FileStorage::READ);\n\n    // first method: use (type) operator on FileNode.\n    int frameCount = (int)fs2[\"frameCount\"];\n\n    String date;\n    // second method: use FileNode::operator >>\n    fs2[\"calibrationDate\"] >> date;\n\n    Mat cameraMatrix2, distCoeffs2;\n    fs2[\"cameraMatrix\"] >> cameraMatrix2;\n    fs2[\"distCoeffs\"] >> distCoeffs2;\n\n    cout << \"frameCount: \" << frameCount << endl\n         << \"calibration date: \" << date << endl\n         << \"camera matrix: \" << cameraMatrix2 << endl\n         << \"distortion coeffs: \" << distCoeffs2 << endl;\n\n    FileNode features = fs2[\"features\"];\n    FileNodeIterator it = features.begin(), it_end = features.end();\n    int idx = 0;\n    std::vector<uchar> lbpval;\n\n    // iterate through a sequence using FileNodeIterator\n    for( ; it != it_end; ++it, idx++ )\n    {\n        cout << \"feature #\" << idx << \": \";\n        cout << \"x=\" << (int)(*it)[\"x\"] << \", y=\" << (int)(*it)[\"y\"] << \", lbp: (\";\n        // you can also easily read numerical arrays using FileNode >> std::vector operator.\n        (*it)[\"lbp\"] >> lbpval;\n        for( int i = 0; i < (int)lbpval.size(); i++ )\n            cout << \" \" << (int)lbpval[i];\n        cout << \")\" << endl;\n    }\n    fs2.release();\n@endcode\n\nFormat specification    {#format_spec}\n--------------------\n`([count]{u|c|w|s|i|f|d})`... where the characters correspond to fundamental C++ types:\n-   `u` 8-bit unsigned number\n-   `c` 8-bit signed number\n-   `w` 16-bit unsigned number\n-   `s` 16-bit signed number\n-   `i` 32-bit signed number\n-   `f` single precision floating-point number\n-   `d` double precision floating-point number\n-   `r` pointer, 32 lower bits of which are written as a signed integer. The type can be used to\n    store structures with links between the elements.\n\n`count` is the optional counter of values of a given type. For example, `2if` means that each array\nelement is a structure of 2 integers, followed by a single-precision floating-point number. The\nequivalent notations of the above specification are `iif`, `2i1f` and so forth. Other examples: `u`\nmeans that the array consists of bytes, and `2d` means the array consists of pairs of doubles.\n\n@see @ref samples/cpp/filestorage.cpp\n*/\n\n//! @{\n\n/** @example samples/cpp/filestorage.cpp\nA complete example using the FileStorage interface\n*/\n\n////////////////////////// XML & YAML I/O //////////////////////////\n\nclass CV_EXPORTS FileNode;\nclass CV_EXPORTS FileNodeIterator;\n\n/** @brief XML/YAML/JSON file storage class that encapsulates all the information necessary for writing or\nreading data to/from a file.\n */\nclass CV_EXPORTS_W FileStorage\n{\npublic:\n    //! file storage mode\n    enum Mode\n    {\n        READ        = 0, //!< value, open the file for reading\n        WRITE       = 1, //!< value, open the file for writing\n        APPEND      = 2, //!< value, open the file for appending\n        MEMORY      = 4, //!< flag, read data from source or write data to the internal buffer (which is\n        //!< returned by FileStorage::release)\n        FORMAT_MASK = (7<<3), //!< mask for format flags\n        FORMAT_AUTO = 0,      //!< flag, auto format\n        FORMAT_XML  = (1<<3), //!< flag, XML format\n        FORMAT_YAML = (2<<3), //!< flag, YAML format\n        FORMAT_JSON = (3<<3), //!< flag, JSON format\n\n        BASE64      = 64,     //!< flag, write rawdata in Base64 by default. (consider using WRITE_BASE64)\n        WRITE_BASE64 = BASE64 | WRITE, //!< flag, enable both WRITE and BASE64\n    };\n    enum State\n    {\n        UNDEFINED      = 0,\n        VALUE_EXPECTED = 1,\n        NAME_EXPECTED  = 2,\n        INSIDE_MAP     = 4\n    };\n\n    /** @brief The constructors.\n\n     The full constructor opens the file. Alternatively you can use the default constructor and then\n     call FileStorage::open.\n     */\n    CV_WRAP FileStorage();\n\n    /** @overload\n     @copydoc open()\n     */\n    CV_WRAP FileStorage(const String& filename, int flags, const String& encoding=String());\n\n    //! the destructor. calls release()\n    virtual ~FileStorage();\n\n    /** @brief Opens a file.\n\n     See description of parameters in FileStorage::FileStorage. The method calls FileStorage::release\n     before opening the file.\n     @param filename Name of the file to open or the text string to read the data from.\n     Extension of the file (.xml, .yml/.yaml or .json) determines its format (XML, YAML or JSON\n     respectively). Also you can append .gz to work with compressed files, for example myHugeMatrix.xml.gz. If both\n     FileStorage::WRITE and FileStorage::MEMORY flags are specified, source is used just to specify\n     the output file format (e.g. mydata.xml, .yml etc.). A file name can also contain parameters.\n     You can use this format, \"*?base64\" (e.g. \"file.json?base64\" (case sensitive)), as an alternative to\n     FileStorage::BASE64 flag.\n     @param flags Mode of operation. One of FileStorage::Mode\n     @param encoding Encoding of the file. Note that UTF-16 XML encoding is not supported currently and\n     you should use 8-bit encoding instead of it.\n     */\n    CV_WRAP virtual bool open(const String& filename, int flags, const String& encoding=String());\n\n    /** @brief Checks whether the file is opened.\n\n     @returns true if the object is associated with the current file and false otherwise. It is a\n     good practice to call this method after you tried to open a file.\n     */\n    CV_WRAP virtual bool isOpened() const;\n\n    /** @brief Closes the file and releases all the memory buffers.\n\n     Call this method after all I/O operations with the storage are finished.\n     */\n    CV_WRAP virtual void release();\n\n    /** @brief Closes the file and releases all the memory buffers.\n\n     Call this method after all I/O operations with the storage are finished. If the storage was\n     opened for writing data and FileStorage::WRITE was specified\n     */\n    CV_WRAP virtual String releaseAndGetString();\n\n    /** @brief Returns the first element of the top-level mapping.\n     @returns The first element of the top-level mapping.\n     */\n    CV_WRAP FileNode getFirstTopLevelNode() const;\n\n    /** @brief Returns the top-level mapping\n     @param streamidx Zero-based index of the stream. In most cases there is only one stream in the file.\n     However, YAML supports multiple streams and so there can be several.\n     @returns The top-level mapping.\n     */\n    CV_WRAP FileNode root(int streamidx=0) const;\n\n    /** @brief Returns the specified element of the top-level mapping.\n     @param nodename Name of the file node.\n     @returns Node with the given name.\n     */\n    FileNode operator[](const String& nodename) const;\n\n    /** @overload */\n    CV_WRAP_AS(getNode) FileNode operator[](const char* nodename) const;\n\n    /**\n     * @brief Simplified writing API to use with bindings.\n     * @param name Name of the written object. When writing to sequences (a.k.a. \"arrays\"), pass an empty string.\n     * @param val Value of the written object.\n     */\n    CV_WRAP void write(const String& name, int val);\n    /// @overload\n    CV_WRAP void write(const String& name, double val);\n    /// @overload\n    CV_WRAP void write(const String& name, const String& val);\n    /// @overload\n    CV_WRAP void write(const String& name, const Mat& val);\n    /// @overload\n    CV_WRAP void write(const String& name, const std::vector<String>& val);\n\n    /** @brief Writes multiple numbers.\n\n     Writes one or more numbers of the specified format to the currently written structure. Usually it is\n     more convenient to use operator `<<` instead of this method.\n     @param fmt Specification of each array element, see @ref format_spec \"format specification\"\n     @param vec Pointer to the written array.\n     @param len Number of the uchar elements to write.\n     */\n    void writeRaw( const String& fmt, const void* vec, size_t len );\n\n    /** @brief Writes a comment.\n\n     The function writes a comment into file storage. The comments are skipped when the storage is read.\n     @param comment The written comment, single-line or multi-line\n     @param append If true, the function tries to put the comment at the end of current line.\n     Else if the comment is multi-line, or if it does not fit at the end of the current\n     line, the comment starts a new line.\n     */\n    CV_WRAP void writeComment(const String& comment, bool append = false);\n\n    /** @brief Starts to write a nested structure (sequence or a mapping).\n    @param name name of the structure. When writing to sequences (a.k.a. \"arrays\"), pass an empty string.\n    @param flags type of the structure (FileNode::MAP or FileNode::SEQ (both with optional FileNode::FLOW)).\n    @param typeName optional name of the type you store. The effect of setting this depends on the storage format.\n    I.e. if the format has a specification for storing type information, this parameter is used.\n    */\n    CV_WRAP void startWriteStruct(const String& name, int flags, const String& typeName=String());\n\n    /** @brief Finishes writing nested structure (should pair startWriteStruct())\n    */\n    CV_WRAP void endWriteStruct();\n\n    /** @brief Returns the normalized object name for the specified name of a file.\n    @param filename Name of a file\n    @returns The normalized object name.\n     */\n    static String getDefaultObjectName(const String& filename);\n\n    /** @brief Returns the current format.\n     * @returns The current format, see FileStorage::Mode\n     */\n    CV_WRAP int getFormat() const;\n\n    int state;\n    std::string elname;\n\n    class Impl;\n    Ptr<Impl> p;\n};\n\n/** @brief File Storage Node class.\n\nThe node is used to store each and every element of the file storage opened for reading. When\nXML/YAML file is read, it is first parsed and stored in the memory as a hierarchical collection of\nnodes. Each node can be a \"leaf\" that is contain a single number or a string, or be a collection of\nother nodes. There can be named collections (mappings) where each element has a name and it is\naccessed by a name, and ordered collections (sequences) where elements do not have names but rather\naccessed by index. Type of the file node can be determined using FileNode::type method.\n\nNote that file nodes are only used for navigating file storages opened for reading. When a file\nstorage is opened for writing, no data is stored in memory after it is written.\n */\nclass CV_EXPORTS_W_SIMPLE FileNode\n{\npublic:\n    //! type of the file storage node\n    enum\n    {\n        NONE      = 0, //!< empty node\n        INT       = 1, //!< an integer\n        REAL      = 2, //!< floating-point number\n        FLOAT     = REAL, //!< synonym or REAL\n        STR       = 3, //!< text string in UTF-8 encoding\n        STRING    = STR, //!< synonym for STR\n        SEQ       = 4, //!< sequence\n        MAP       = 5, //!< mapping\n        TYPE_MASK = 7,\n\n        FLOW      = 8,  //!< compact representation of a sequence or mapping. Used only by YAML writer\n        UNIFORM   = 8,  //!< if set, means that all the collection elements are numbers of the same type (real's or int's).\n        //!< UNIFORM is used only when reading FileStorage; FLOW is used only when writing. So they share the same bit\n        EMPTY     = 16, //!< empty structure (sequence or mapping)\n        NAMED     = 32  //!< the node has a name (i.e. it is element of a mapping).\n    };\n    /** @brief The constructors.\n\n     These constructors are used to create a default file node, construct it from obsolete structures or\n     from the another file node.\n     */\n    CV_WRAP FileNode();\n\n    /** @overload\n     @param fs Pointer to the file storage structure.\n     @param blockIdx Index of the memory block where the file node is stored\n     @param ofs Offset in bytes from the beginning of the serialized storage\n\n     @deprecated\n     */\n    FileNode(const FileStorage* fs, size_t blockIdx, size_t ofs);\n\n    /** @overload\n     @param node File node to be used as initialization for the created file node.\n     */\n    FileNode(const FileNode& node);\n\n    FileNode& operator=(const FileNode& node);\n\n    /** @brief Returns element of a mapping node or a sequence node.\n     @param nodename Name of an element in the mapping node.\n     @returns Returns the element with the given identifier.\n     */\n    FileNode operator[](const String& nodename) const;\n\n    /** @overload\n     @param nodename Name of an element in the mapping node.\n     */\n    CV_WRAP_AS(getNode) FileNode operator[](const char* nodename) const;\n\n    /** @overload\n     @param i Index of an element in the sequence node.\n     */\n    CV_WRAP_AS(at) FileNode operator[](int i) const;\n\n    /** @brief Returns keys of a mapping node.\n     @returns Keys of a mapping node.\n     */\n    CV_WRAP std::vector<String> keys() const;\n\n    /** @brief Returns type of the node.\n     @returns Type of the node. See FileNode::Type\n     */\n    CV_WRAP int type() const;\n\n    //! returns true if the node is empty\n    CV_WRAP bool empty() const;\n    //! returns true if the node is a \"none\" object\n    CV_WRAP bool isNone() const;\n    //! returns true if the node is a sequence\n    CV_WRAP bool isSeq() const;\n    //! returns true if the node is a mapping\n    CV_WRAP bool isMap() const;\n    //! returns true if the node is an integer\n    CV_WRAP bool isInt() const;\n    //! returns true if the node is a floating-point number\n    CV_WRAP bool isReal() const;\n    //! returns true if the node is a text string\n    CV_WRAP bool isString() const;\n    //! returns true if the node has a name\n    CV_WRAP bool isNamed() const;\n    //! returns the node name or an empty string if the node is nameless\n    CV_WRAP std::string name() const;\n    //! returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise.\n    CV_WRAP size_t size() const;\n    //! returns raw size of the FileNode in bytes\n    CV_WRAP size_t rawSize() const;\n    //! returns the node content as an integer. If the node stores floating-point number, it is rounded.\n    operator int() const;\n    //! returns the node content as float\n    operator float() const;\n    //! returns the node content as double\n    operator double() const;\n    //! returns the node content as text string\n    inline operator std::string() const { return this->string(); }\n\n    static bool isMap(int flags);\n    static bool isSeq(int flags);\n    static bool isCollection(int flags);\n    static bool isEmptyCollection(int flags);\n    static bool isFlow(int flags);\n\n    uchar* ptr();\n    const uchar* ptr() const;\n\n    //! returns iterator pointing to the first node element\n    FileNodeIterator begin() const;\n    //! returns iterator pointing to the element following the last node element\n    FileNodeIterator end() const;\n\n    /** @brief Reads node elements to the buffer with the specified format.\n\n    Usually it is more convenient to use operator `>>` instead of this method.\n    @param fmt Specification of each array element. See @ref format_spec \"format specification\"\n    @param vec Pointer to the destination array.\n    @param len Number of bytes to read (buffer size limit). If it is greater than number of\n               remaining elements then all of them will be read.\n     */\n    void readRaw( const String& fmt, void* vec, size_t len ) const;\n\n    /** Internal method used when reading FileStorage.\n     Sets the type (int, real or string) and value of the previously created node.\n     */\n    void setValue( int type, const void* value, int len=-1 );\n\n    //! Simplified reading API to use with bindings.\n    CV_WRAP double real() const;\n    //! Simplified reading API to use with bindings.\n    CV_WRAP std::string string() const;\n    //! Simplified reading API to use with bindings.\n    CV_WRAP Mat mat() const;\n\n    //protected:\n    FileNode(FileStorage::Impl* fs, size_t blockIdx, size_t ofs);\n\n    FileStorage::Impl* fs;\n    size_t blockIdx;\n    size_t ofs;\n};\n\n\n/** @brief used to iterate through sequences and mappings.\n\n A standard STL notation, with node.begin(), node.end() denoting the beginning and the end of a\n sequence, stored in node. See the data reading sample in the beginning of the section.\n */\nclass CV_EXPORTS FileNodeIterator\n{\npublic:\n    /** @brief The constructors.\n\n     These constructors are used to create a default iterator, set it to specific element in a file node\n     or construct it from another iterator.\n     */\n    FileNodeIterator();\n\n    /** @overload\n     @param node File node - the collection to iterate over;\n        it can be a scalar (equivalent to 1-element collection) or \"none\" (equivalent to empty collection).\n     @param seekEnd - true if iterator needs to be set after the last element of the node;\n        that is:\n            * node.begin() => FileNodeIterator(node, false)\n            * node.end() => FileNodeIterator(node, true)\n     */\n    FileNodeIterator(const FileNode& node, bool seekEnd);\n\n    /** @overload\n     @param it Iterator to be used as initialization for the created iterator.\n     */\n    FileNodeIterator(const FileNodeIterator& it);\n\n    FileNodeIterator& operator=(const FileNodeIterator& it);\n\n    //! returns the currently observed element\n    FileNode operator *() const;\n\n    //! moves iterator to the next node\n    FileNodeIterator& operator ++ ();\n    //! moves iterator to the next node\n    FileNodeIterator operator ++ (int);\n    //! moves iterator forward by the specified offset (possibly negative)\n    FileNodeIterator& operator += (int ofs);\n\n    /** @brief Reads node elements to the buffer with the specified format.\n\n    Usually it is more convenient to use operator `>>` instead of this method.\n    @param fmt Specification of each array element. See @ref format_spec \"format specification\"\n    @param vec Pointer to the destination array.\n    @param len Number of bytes to read (buffer size limit). If it is greater than number of\n               remaining elements then all of them will be read.\n     */\n    FileNodeIterator& readRaw( const String& fmt, void* vec,\n                               size_t len=(size_t)INT_MAX );\n\n    //! returns the number of remaining (not read yet) elements\n    size_t remaining() const;\n\n    bool equalTo(const FileNodeIterator& it) const;\n\nprotected:\n    FileStorage::Impl* fs;\n    size_t blockIdx;\n    size_t ofs;\n    size_t blockSize;\n    size_t nodeNElems;\n    size_t idx;\n};\n\n//! @} core_xml\n\n/////////////////// XML & YAML I/O implementation //////////////////\n\n//! @relates cv::FileStorage\n//! @{\n\nCV_EXPORTS void write( FileStorage& fs, const String& name, int value );\nCV_EXPORTS void write( FileStorage& fs, const String& name, float value );\nCV_EXPORTS void write( FileStorage& fs, const String& name, double value );\nCV_EXPORTS void write( FileStorage& fs, const String& name, const String& value );\nCV_EXPORTS void write( FileStorage& fs, const String& name, const Mat& value );\nCV_EXPORTS void write( FileStorage& fs, const String& name, const SparseMat& value );\n#ifdef CV__LEGACY_PERSISTENCE\nCV_EXPORTS void write( FileStorage& fs, const String& name, const std::vector<KeyPoint>& value);\nCV_EXPORTS void write( FileStorage& fs, const String& name, const std::vector<DMatch>& value);\n#endif\n\nCV_EXPORTS void writeScalar( FileStorage& fs, int value );\nCV_EXPORTS void writeScalar( FileStorage& fs, float value );\nCV_EXPORTS void writeScalar( FileStorage& fs, double value );\nCV_EXPORTS void writeScalar( FileStorage& fs, const String& value );\n\n//! @}\n\n//! @relates cv::FileNode\n//! @{\n\nCV_EXPORTS void read(const FileNode& node, int& value, int default_value);\nCV_EXPORTS void read(const FileNode& node, float& value, float default_value);\nCV_EXPORTS void read(const FileNode& node, double& value, double default_value);\nCV_EXPORTS void read(const FileNode& node, std::string& value, const std::string& default_value);\nCV_EXPORTS void read(const FileNode& node, Mat& mat, const Mat& default_mat = Mat() );\nCV_EXPORTS void read(const FileNode& node, SparseMat& mat, const SparseMat& default_mat = SparseMat() );\n#ifdef CV__LEGACY_PERSISTENCE\nCV_EXPORTS void read(const FileNode& node, std::vector<KeyPoint>& keypoints);\nCV_EXPORTS void read(const FileNode& node, std::vector<DMatch>& matches);\n#endif\nCV_EXPORTS void read(const FileNode& node, KeyPoint& value, const KeyPoint& default_value);\nCV_EXPORTS void read(const FileNode& node, DMatch& value, const DMatch& default_value);\n\ntemplate<typename _Tp> static inline void read(const FileNode& node, Point_<_Tp>& value, const Point_<_Tp>& default_value)\n{\n    std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp;\n    value = temp.size() != 2 ? default_value : Point_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]));\n}\n\ntemplate<typename _Tp> static inline void read(const FileNode& node, Point3_<_Tp>& value, const Point3_<_Tp>& default_value)\n{\n    std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp;\n    value = temp.size() != 3 ? default_value : Point3_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]),\n                                                            saturate_cast<_Tp>(temp[2]));\n}\n\ntemplate<typename _Tp> static inline void read(const FileNode& node, Size_<_Tp>& value, const Size_<_Tp>& default_value)\n{\n    std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp;\n    value = temp.size() != 2 ? default_value : Size_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]));\n}\n\ntemplate<typename _Tp> static inline void read(const FileNode& node, Complex<_Tp>& value, const Complex<_Tp>& default_value)\n{\n    std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp;\n    value = temp.size() != 2 ? default_value : Complex<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]));\n}\n\ntemplate<typename _Tp> static inline void read(const FileNode& node, Rect_<_Tp>& value, const Rect_<_Tp>& default_value)\n{\n    std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp;\n    value = temp.size() != 4 ? default_value : Rect_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]),\n                                                          saturate_cast<_Tp>(temp[2]), saturate_cast<_Tp>(temp[3]));\n}\n\ntemplate<typename _Tp, int cn> static inline void read(const FileNode& node, Vec<_Tp, cn>& value, const Vec<_Tp, cn>& default_value)\n{\n    std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp;\n    value = temp.size() != cn ? default_value : Vec<_Tp, cn>(&temp[0]);\n}\n\ntemplate<typename _Tp, int m, int n> static inline void read(const FileNode& node, Matx<_Tp, m, n>& value, const Matx<_Tp, m, n>& default_matx = Matx<_Tp, m, n>())\n{\n    Mat temp;\n    read(node, temp); // read as a Mat class\n\n    if (temp.empty())\n        value = default_matx;\n    else\n        value = Matx<_Tp, m, n>(temp);\n}\n\ntemplate<typename _Tp> static inline void read(const FileNode& node, Scalar_<_Tp>& value, const Scalar_<_Tp>& default_value)\n{\n    std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp;\n    value = temp.size() != 4 ? default_value : Scalar_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]),\n                                                            saturate_cast<_Tp>(temp[2]), saturate_cast<_Tp>(temp[3]));\n}\n\nstatic inline void read(const FileNode& node, Range& value, const Range& default_value)\n{\n    Point2i temp(value.start, value.end); const Point2i default_temp = Point2i(default_value.start, default_value.end);\n    read(node, temp, default_temp);\n    value.start = temp.x; value.end = temp.y;\n}\n\n//! @}\n\n/** @brief Writes string to a file storage.\n@relates cv::FileStorage\n */\nCV_EXPORTS FileStorage& operator << (FileStorage& fs, const String& str);\n\n//! @cond IGNORED\n\nnamespace internal\n{\n    class CV_EXPORTS WriteStructContext\n    {\n    public:\n        WriteStructContext(FileStorage& _fs, const String& name, int flags, const String& typeName = String());\n        ~WriteStructContext();\n    private:\n        FileStorage* fs;\n    };\n\n    template<typename _Tp, int numflag> class VecWriterProxy\n    {\n    public:\n        VecWriterProxy( FileStorage* _fs ) : fs(_fs) {}\n        void operator()(const std::vector<_Tp>& vec) const\n        {\n            size_t count = vec.size();\n            for (size_t i = 0; i < count; i++)\n                write(*fs, vec[i]);\n        }\n    private:\n        FileStorage* fs;\n    };\n\n    template<typename _Tp> class VecWriterProxy<_Tp, 1>\n    {\n    public:\n        VecWriterProxy( FileStorage* _fs ) : fs(_fs) {}\n        void operator()(const std::vector<_Tp>& vec) const\n        {\n            int _fmt = traits::SafeFmt<_Tp>::fmt;\n            char fmt[] = { (char)((_fmt >> 8) + '1'), (char)_fmt, '\\0' };\n            fs->writeRaw(fmt, !vec.empty() ? (uchar*)&vec[0] : 0, vec.size() * sizeof(_Tp));\n        }\n    private:\n        FileStorage* fs;\n    };\n\n    template<typename _Tp, int numflag> class VecReaderProxy\n    {\n    public:\n        VecReaderProxy( FileNodeIterator* _it ) : it(_it) {}\n        void operator()(std::vector<_Tp>& vec, size_t count) const\n        {\n            count = std::min(count, it->remaining());\n            vec.resize(count);\n            for (size_t i = 0; i < count; i++, ++(*it))\n                read(**it, vec[i], _Tp());\n        }\n    private:\n        FileNodeIterator* it;\n    };\n\n    template<typename _Tp> class VecReaderProxy<_Tp, 1>\n    {\n    public:\n        VecReaderProxy( FileNodeIterator* _it ) : it(_it) {}\n        void operator()(std::vector<_Tp>& vec, size_t count) const\n        {\n            size_t remaining = it->remaining();\n            size_t cn = DataType<_Tp>::channels;\n            int _fmt = traits::SafeFmt<_Tp>::fmt;\n            CV_Assert((_fmt >> 8) < 9);\n            char fmt[] = { (char)((_fmt >> 8)+'1'), (char)_fmt, '\\0' };\n            CV_Assert((remaining % cn) == 0);\n            size_t remaining1 = remaining / cn;\n            count = count > remaining1 ? remaining1 : count;\n            vec.resize(count);\n            it->readRaw(fmt, !vec.empty() ? (uchar*)&vec[0] : 0, count*sizeof(_Tp));\n        }\n    private:\n        FileNodeIterator* it;\n    };\n\n} // internal\n\n//! @endcond\n\n//! @relates cv::FileStorage\n//! @{\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const _Tp& value)\n{\n    write(fs, String(), value);\n}\n\ntemplate<> inline\nvoid write( FileStorage& fs, const int& value )\n{\n    writeScalar(fs, value);\n}\n\ntemplate<> inline\nvoid write( FileStorage& fs, const float& value )\n{\n    writeScalar(fs, value);\n}\n\ntemplate<> inline\nvoid write( FileStorage& fs, const double& value )\n{\n    writeScalar(fs, value);\n}\n\ntemplate<> inline\nvoid write( FileStorage& fs, const String& value )\n{\n    writeScalar(fs, value);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const Point_<_Tp>& pt )\n{\n    write(fs, pt.x);\n    write(fs, pt.y);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const Point3_<_Tp>& pt )\n{\n    write(fs, pt.x);\n    write(fs, pt.y);\n    write(fs, pt.z);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const Size_<_Tp>& sz )\n{\n    write(fs, sz.width);\n    write(fs, sz.height);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const Complex<_Tp>& c )\n{\n    write(fs, c.re);\n    write(fs, c.im);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const Rect_<_Tp>& r )\n{\n    write(fs, r.x);\n    write(fs, r.y);\n    write(fs, r.width);\n    write(fs, r.height);\n}\n\ntemplate<typename _Tp, int cn> static inline\nvoid write(FileStorage& fs, const Vec<_Tp, cn>& v )\n{\n    for(int i = 0; i < cn; i++)\n        write(fs, v.val[i]);\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nvoid write(FileStorage& fs, const Matx<_Tp, m, n>& x )\n{\n    write(fs, Mat(x)); // write as a Mat class\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const Scalar_<_Tp>& s )\n{\n    write(fs, s.val[0]);\n    write(fs, s.val[1]);\n    write(fs, s.val[2]);\n    write(fs, s.val[3]);\n}\n\nstatic inline\nvoid write(FileStorage& fs, const Range& r )\n{\n    write(fs, r.start);\n    write(fs, r.end);\n}\n\ntemplate<typename _Tp> static inline\nvoid write( FileStorage& fs, const std::vector<_Tp>& vec )\n{\n    cv::internal::VecWriterProxy<_Tp, traits::SafeFmt<_Tp>::fmt != 0> w(&fs);\n    w(vec);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const String& name, const Point_<_Tp>& pt )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, pt);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const String& name, const Point3_<_Tp>& pt )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, pt);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const String& name, const Size_<_Tp>& sz )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, sz);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const String& name, const Complex<_Tp>& c )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, c);\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const String& name, const Rect_<_Tp>& r )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, r);\n}\n\ntemplate<typename _Tp, int cn> static inline\nvoid write(FileStorage& fs, const String& name, const Vec<_Tp, cn>& v )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, v);\n}\n\ntemplate<typename _Tp, int m, int n> static inline\nvoid write(FileStorage& fs, const String& name, const Matx<_Tp, m, n>& x )\n{\n    write(fs, name, Mat(x)); // write as a Mat class\n}\n\ntemplate<typename _Tp> static inline\nvoid write(FileStorage& fs, const String& name, const Scalar_<_Tp>& s )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, s);\n}\n\nstatic inline\nvoid write(FileStorage& fs, const String& name, const Range& r )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, r);\n}\n\nstatic inline\nvoid write(FileStorage& fs, const String& name, const KeyPoint& kpt)\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, kpt.pt.x);\n    write(fs, kpt.pt.y);\n    write(fs, kpt.size);\n    write(fs, kpt.angle);\n    write(fs, kpt.response);\n    write(fs, kpt.octave);\n    write(fs, kpt.class_id);\n}\n\nstatic inline\nvoid write(FileStorage& fs, const String& name, const DMatch& m)\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW);\n    write(fs, m.queryIdx);\n    write(fs, m.trainIdx);\n    write(fs, m.imgIdx);\n    write(fs, m.distance);\n}\n\ntemplate<typename _Tp, typename std::enable_if< std::is_enum<_Tp>::value >::type* = nullptr>\nstatic inline void write( FileStorage& fs, const String& name, const _Tp& val )\n{\n    write(fs, name, static_cast<int>(val));\n}\n\ntemplate<typename _Tp> static inline\nvoid write( FileStorage& fs, const String& name, const std::vector<_Tp>& vec )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+(traits::SafeFmt<_Tp>::fmt != 0 ? FileNode::FLOW : 0));\n    write(fs, vec);\n}\n\ntemplate<typename _Tp> static inline\nvoid write( FileStorage& fs, const String& name, const std::vector< std::vector<_Tp> >& vec )\n{\n    cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ);\n    for(size_t i = 0; i < vec.size(); i++)\n    {\n        cv::internal::WriteStructContext ws_(fs, name, FileNode::SEQ+(traits::SafeFmt<_Tp>::fmt != 0 ? FileNode::FLOW : 0));\n        write(fs, vec[i]);\n    }\n}\n\n#ifdef CV__LEGACY_PERSISTENCE\n// This code is not needed anymore, but it is preserved here to keep source compatibility\n// Implementation is similar to templates instantiations\nstatic inline void write(FileStorage& fs, const KeyPoint& kpt) { write(fs, String(), kpt); }\nstatic inline void write(FileStorage& fs, const DMatch& m) { write(fs, String(), m); }\nstatic inline void write(FileStorage& fs, const std::vector<KeyPoint>& vec)\n{\n    cv::internal::VecWriterProxy<KeyPoint, 0> w(&fs);\n    w(vec);\n}\nstatic inline void write(FileStorage& fs, const std::vector<DMatch>& vec)\n{\n    cv::internal::VecWriterProxy<DMatch, 0> w(&fs);\n    w(vec);\n\n}\n#endif\n\n//! @} FileStorage\n\n//! @relates cv::FileNode\n//! @{\n\nstatic inline\nvoid read(const FileNode& node, bool& value, bool default_value)\n{\n    int temp;\n    read(node, temp, (int)default_value);\n    value = temp != 0;\n}\n\nstatic inline\nvoid read(const FileNode& node, uchar& value, uchar default_value)\n{\n    int temp;\n    read(node, temp, (int)default_value);\n    value = saturate_cast<uchar>(temp);\n}\n\nstatic inline\nvoid read(const FileNode& node, schar& value, schar default_value)\n{\n    int temp;\n    read(node, temp, (int)default_value);\n    value = saturate_cast<schar>(temp);\n}\n\nstatic inline\nvoid read(const FileNode& node, ushort& value, ushort default_value)\n{\n    int temp;\n    read(node, temp, (int)default_value);\n    value = saturate_cast<ushort>(temp);\n}\n\nstatic inline\nvoid read(const FileNode& node, short& value, short default_value)\n{\n    int temp;\n    read(node, temp, (int)default_value);\n    value = saturate_cast<short>(temp);\n}\n\ntemplate<typename _Tp> static inline\nvoid read( FileNodeIterator& it, std::vector<_Tp>& vec, size_t maxCount = (size_t)INT_MAX )\n{\n    cv::internal::VecReaderProxy<_Tp, traits::SafeFmt<_Tp>::fmt != 0> r(&it);\n    r(vec, maxCount);\n}\n\ntemplate<typename _Tp, typename std::enable_if< std::is_enum<_Tp>::value >::type* = nullptr>\nstatic inline void read(const FileNode& node, _Tp& value, const _Tp& default_value = static_cast<_Tp>(0))\n{\n    int temp;\n    read(node, temp, static_cast<int>(default_value));\n    value = static_cast<_Tp>(temp);\n}\n\ntemplate<typename _Tp> static inline\nvoid read( const FileNode& node, std::vector<_Tp>& vec, const std::vector<_Tp>& default_value = std::vector<_Tp>() )\n{\n    if(node.empty())\n        vec = default_value;\n    else\n    {\n        FileNodeIterator it = node.begin();\n        read( it, vec );\n    }\n}\n\nstatic inline\nvoid read( const FileNode& node, std::vector<KeyPoint>& vec, const std::vector<KeyPoint>& default_value )\n{\n    if(node.empty())\n        vec = default_value;\n    else\n        read(node, vec);\n}\n\nstatic inline\nvoid read( const FileNode& node, std::vector<DMatch>& vec, const std::vector<DMatch>& default_value )\n{\n    if(node.empty())\n        vec = default_value;\n    else\n        read(node, vec);\n}\n\n//! @} FileNode\n\n//! @relates cv::FileStorage\n//! @{\n\n/** @brief Writes data to a file storage.\n */\ntemplate<typename _Tp> static inline\nFileStorage& operator << (FileStorage& fs, const _Tp& value)\n{\n    if( !fs.isOpened() )\n        return fs;\n    if( fs.state == FileStorage::NAME_EXPECTED + FileStorage::INSIDE_MAP )\n        CV_Error( Error::StsError, \"No element name has been given\" );\n    write( fs, fs.elname, value );\n    if( fs.state & FileStorage::INSIDE_MAP )\n        fs.state = FileStorage::NAME_EXPECTED + FileStorage::INSIDE_MAP;\n    return fs;\n}\n\n/** @brief Writes data to a file storage.\n */\nstatic inline\nFileStorage& operator << (FileStorage& fs, const char* str)\n{\n    return (fs << String(str));\n}\n\n/** @brief Writes data to a file storage.\n */\nstatic inline\nFileStorage& operator << (FileStorage& fs, char* value)\n{\n    return (fs << String(value));\n}\n\n//! @} FileStorage\n\n//! @relates cv::FileNodeIterator\n//! @{\n\n/** @brief Reads data from a file storage.\n */\ntemplate<typename _Tp> static inline\nFileNodeIterator& operator >> (FileNodeIterator& it, _Tp& value)\n{\n    read( *it, value, _Tp());\n    return ++it;\n}\n\n/** @brief Reads data from a file storage.\n */\ntemplate<typename _Tp> static inline\nFileNodeIterator& operator >> (FileNodeIterator& it, std::vector<_Tp>& vec)\n{\n    cv::internal::VecReaderProxy<_Tp, traits::SafeFmt<_Tp>::fmt != 0> r(&it);\n    r(vec, (size_t)INT_MAX);\n    return it;\n}\n\n//! @} FileNodeIterator\n\n//! @relates cv::FileNode\n//! @{\n\n/** @brief Reads data from a file storage.\n */\ntemplate<typename _Tp> static inline\nvoid operator >> (const FileNode& n, _Tp& value)\n{\n    read( n, value, _Tp());\n}\n\n/** @brief Reads data from a file storage.\n */\ntemplate<typename _Tp> static inline\nvoid operator >> (const FileNode& n, std::vector<_Tp>& vec)\n{\n    FileNodeIterator it = n.begin();\n    it >> vec;\n}\n\n/** @brief Reads KeyPoint from a file storage.\n*/\n//It needs special handling because it contains two types of fields, int & float.\nstatic inline\nvoid operator >> (const FileNode& n, KeyPoint& kpt)\n{\n    FileNodeIterator it = n.begin();\n    it >> kpt.pt.x >> kpt.pt.y >> kpt.size >> kpt.angle >> kpt.response >> kpt.octave >> kpt.class_id;\n}\n\n#ifdef CV__LEGACY_PERSISTENCE\nstatic inline\nvoid operator >> (const FileNode& n, std::vector<KeyPoint>& vec)\n{\n    read(n, vec);\n}\nstatic inline\nvoid operator >> (const FileNode& n, std::vector<DMatch>& vec)\n{\n    read(n, vec);\n}\n#endif\n\n/** @brief Reads DMatch from a file storage.\n*/\n//It needs special handling because it contains two types of fields, int & float.\nstatic inline\nvoid operator >> (const FileNode& n, DMatch& m)\n{\n    FileNodeIterator it = n.begin();\n    it >> m.queryIdx >> m.trainIdx >> m.imgIdx >> m.distance;\n}\n\n//! @} FileNode\n\n//! @relates cv::FileNodeIterator\n//! @{\n\nCV_EXPORTS bool operator == (const FileNodeIterator& it1, const FileNodeIterator& it2);\nCV_EXPORTS bool operator != (const FileNodeIterator& it1, const FileNodeIterator& it2);\n\nstatic inline\nptrdiff_t operator - (const FileNodeIterator& it1, const FileNodeIterator& it2)\n{\n    return it2.remaining() - it1.remaining();\n}\n\nstatic inline\nbool operator < (const FileNodeIterator& it1, const FileNodeIterator& it2)\n{\n    return it1.remaining() > it2.remaining();\n}\n\n//! @} FileNodeIterator\n\n} // cv\n\n#endif // OPENCV_CORE_PERSISTENCE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/quaternion.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2020, Huawei Technologies Co., Ltd. All rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//       http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// Author: Liangqian Kong <chargerKong@126.com>\n//         Longbu Wang <riskiest@gmail.com>\n#ifndef OPENCV_CORE_QUATERNION_HPP\n#define OPENCV_CORE_QUATERNION_HPP\n\n#include <opencv2/core.hpp>\n#include <opencv2/core/utils/logger.hpp>\n#include <iostream>\nnamespace cv\n{\n//! @addtogroup core\n//! @{\n\n//! Unit quaternion flag\nenum QuatAssumeType\n{\n    /**\n     * This flag is specified by default.\n     * If this flag is specified, the input quaternions are assumed to be not unit quaternions.\n     * It can guarantee the correctness of the calculations,\n     * although the calculation speed will be slower than the flag QUAT_ASSUME_UNIT.\n     */\n    QUAT_ASSUME_NOT_UNIT,\n    /**\n     * If this flag is specified, the input quaternions are assumed to be unit quaternions which\n     * will save some computations. However, if this flag is specified without unit quaternion,\n     * the program correctness of the result will not be guaranteed.\n     */\n    QUAT_ASSUME_UNIT\n};\n\nclass QuatEnum\n{\npublic:\n    /** @brief Enum of Euler angles type.\n     *\n     * Without considering the possibility of using two different convertions for the definition of the rotation axes ,\n     * there exists twelve possible sequences of rotation axes, divided into two groups:\n     * - Proper Euler angles (Z-X-Z, X-Y-X, Y-Z-Y, Z-Y-Z, X-Z-X, Y-X-Y)\n     * - Tait–Bryan angles (X-Y-Z, Y-Z-X, Z-X-Y, X-Z-Y, Z-Y-X, Y-X-Z).\n     *\n     * The three elemental rotations may be [extrinsic](https://en.wikipedia.org/wiki/Euler_angles#Definition_by_extrinsic_rotations)\n     * (rotations about the axes *xyz* of the original coordinate system, which is assumed to remain motionless),\n     * or [intrinsic](https://en.wikipedia.org/wiki/Euler_angles#Definition_by_intrinsic_rotations)(rotations about the axes of the rotating coordinate system *XYZ*, solidary with the moving body, which changes its orientation after each elemental rotation).\n     *\n     *\n     * Extrinsic and intrinsic rotations are relevant.\n     *\n     * The definition of the Euler angles is as following,\n     * - \\f$\\theta_1 \\f$ represents the first rotation angle,\n     * - \\f$\\theta_2 \\f$ represents the second rotation angle,\n     * - \\f$\\theta_3 \\f$ represents the third rotation angle.\n     *\n     * For intrinsic rotations in the order of X-Y-Z, the rotation matrix R can be calculated by:\\f[R =X(\\theta_1) Y(\\theta_2) Z(\\theta_3) \\f]\n     * For extrinsic rotations in the order of X-Y-Z, the rotation matrix R can be calculated by:\\f[R =Z({\\theta_3}) Y({\\theta_2}) X({\\theta_1})\\f]\n     * where\n     * \\f[X({\\theta})={\\begin{bmatrix}1&0&0\\\\0&\\cos {\\theta_1} &-\\sin {\\theta_1} \\\\0&\\sin {\\theta_1} &\\cos {\\theta_1} \\\\\\end{bmatrix}},\n     * Y({\\theta})={\\begin{bmatrix}\\cos \\theta_{2}&0&\\sin \\theta_{2}\\\\0&1 &0 \\\\\\ -sin \\theta_2& 0&\\cos \\theta_{2} \\\\\\end{bmatrix}},\n     * Z({\\theta})={\\begin{bmatrix}\\cos\\theta_{3} &-\\sin \\theta_3&0\\\\\\sin \\theta_3 &\\cos \\theta_3 &0\\\\0&0&1\\\\\\end{bmatrix}}.\n     * \\f]\n     *\n     * The function is designed according to this set of conventions:\n     * - [Right handed](https://en.wikipedia.org/wiki/Right_hand_rule) reference frames are adopted, and the [right hand rule](https://en.wikipedia.org/wiki/Right_hand_rule) is used to determine the sign of angles.\n     * - Each matrix is meant to represent an [active rotation](https://en.wikipedia.org/wiki/Active_and_passive_transformation) (the composing and composed matrices\n     * are supposed to act on the coordinates of vectors defined in the initial fixed reference frame and give as a result the coordinates of a rotated vector defined in the same reference frame).\n     * - For \\f$\\theta_1\\f$ and \\f$\\theta_3\\f$, the valid range is (−π, π].\n     *\n     *   For \\f$\\theta_2\\f$, the valid range is [−π/2, π/2] or [0, π].\n     *\n     *   For Tait–Bryan angles, the valid range of \\f$\\theta_2\\f$ is [−π/2, π/2]. When transforming a quaternion to Euler angles, the solution of Euler angles is unique in condition of \\f$ \\theta_2 \\in (−π/2, π/2)\\f$ .\n     *   If \\f$\\theta_2 = −π/2 \\f$ or \\f$ \\theta_2 = π/2\\f$, there are infinite solutions. The common name for this situation is gimbal lock.\n     *   For Proper Euler angles,the valid range of \\f$\\theta_2\\f$ is in [0, π]. The solutions of Euler angles are unique in condition of  \\f$ \\theta_2 \\in (0, π)\\f$ . If \\f$\\theta_2 =0 \\f$ or \\f$\\theta_2 =π \\f$,\n     *   there are infinite solutions and gimbal lock will occur.\n     */\n    enum EulerAnglesType\n    {\n        INT_XYZ, ///< Intrinsic rotations with the Euler angles type X-Y-Z\n        INT_XZY, ///< Intrinsic rotations with the Euler angles type X-Z-Y\n        INT_YXZ, ///< Intrinsic rotations with the Euler angles type Y-X-Z\n        INT_YZX, ///< Intrinsic rotations with the Euler angles type Y-Z-X\n        INT_ZXY, ///< Intrinsic rotations with the Euler angles type Z-X-Y\n        INT_ZYX, ///< Intrinsic rotations with the Euler angles type Z-Y-X\n        INT_XYX, ///< Intrinsic rotations with the Euler angles type X-Y-X\n        INT_XZX, ///< Intrinsic rotations with the Euler angles type X-Z-X\n        INT_YXY, ///< Intrinsic rotations with the Euler angles type Y-X-Y\n        INT_YZY, ///< Intrinsic rotations with the Euler angles type Y-Z-Y\n        INT_ZXZ, ///< Intrinsic rotations with the Euler angles type Z-X-Z\n        INT_ZYZ, ///< Intrinsic rotations with the Euler angles type Z-Y-Z\n\n        EXT_XYZ, ///< Extrinsic rotations with the Euler angles type X-Y-Z\n        EXT_XZY, ///< Extrinsic rotations with the Euler angles type X-Z-Y\n        EXT_YXZ, ///< Extrinsic rotations with the Euler angles type Y-X-Z\n        EXT_YZX, ///< Extrinsic rotations with the Euler angles type Y-Z-X\n        EXT_ZXY, ///< Extrinsic rotations with the Euler angles type Z-X-Y\n        EXT_ZYX, ///< Extrinsic rotations with the Euler angles type Z-Y-X\n        EXT_XYX, ///< Extrinsic rotations with the Euler angles type X-Y-X\n        EXT_XZX, ///< Extrinsic rotations with the Euler angles type X-Z-X\n        EXT_YXY, ///< Extrinsic rotations with the Euler angles type Y-X-Y\n        EXT_YZY,  ///< Extrinsic rotations with the Euler angles type Y-Z-Y\n        EXT_ZXZ, ///< Extrinsic rotations with the Euler angles type Z-X-Z\n        EXT_ZYZ, ///< Extrinsic rotations with the Euler angles type Z-Y-Z\n        #ifndef CV_DOXYGEN\n            EULER_ANGLES_MAX_VALUE\n        #endif\n    };\n\n};\n\ntemplate <typename _Tp> class Quat;\ntemplate <typename _Tp> std::ostream& operator<<(std::ostream&, const Quat<_Tp>&);\n\n/**\n * Quaternion is a number system that extends the complex numbers. It can be expressed as a\n * rotation in three-dimensional space.\n * A quaternion is generally represented in the form:\n *      \\f[q = w + x\\boldsymbol{i} + y\\boldsymbol{j} + z\\boldsymbol{k}\\f]\n *      \\f[q = [w, x, y, z]\\f]\n *      \\f[q = [w, \\boldsymbol{v}] \\f]\n *      \\f[q = ||q||[\\cos\\psi, u_x\\sin\\psi,u_y\\sin\\psi,  u_z\\sin\\psi].\\f]\n *      \\f[q = ||q||[\\cos\\psi, \\boldsymbol{u}\\sin\\psi]\\f]\n * where \\f$\\psi = \\frac{\\theta}{2}\\f$, \\f$\\theta\\f$ represents rotation angle,\n * \\f$\\boldsymbol{u} = [u_x, u_y, u_z]\\f$ represents normalized rotation axis,\n * and \\f$||q||\\f$ represents the norm of \\f$q\\f$.\n *\n * A unit quaternion is usually represents rotation, which has the form:\n *      \\f[q = [\\cos\\psi, u_x\\sin\\psi,u_y\\sin\\psi,  u_z\\sin\\psi].\\f]\n *\n * To create a quaternion representing the rotation around the axis \\f$\\boldsymbol{u}\\f$\n * with angle \\f$\\theta\\f$, you can use\n * ```\n * using namespace cv;\n * double angle = CV_PI;\n * Vec3d axis = {0, 0, 1};\n * Quatd q = Quatd::createFromAngleAxis(angle, axis);\n * ```\n *\n * You can simply use four same type number to create a quaternion\n * ```\n * Quatd q(1, 2, 3, 4);\n * ```\n * Or use a Vec4d or Vec4f vector.\n * ```\n * Vec4d vec{1, 2, 3, 4};\n * Quatd q(vec);\n * ```\n *\n * ```\n * Vec4f vec{1, 2, 3, 4};\n * Quatf q(vec);\n * ```\n *\n * If you already have a 3x3 rotation matrix R, then you can use\n * ```\n * Quatd q = Quatd::createFromRotMat(R);\n * ```\n *\n * If you already have a rotation vector rvec which has the form of `angle * axis`, then you can use\n * ```\n * Quatd q = Quatd::createFromRvec(rvec);\n * ```\n *\n * To extract the rotation matrix from quaternion, see toRotMat3x3()\n *\n * To extract the Vec4d or Vec4f, see toVec()\n *\n * To extract the rotation vector, see toRotVec()\n *\n * If there are two quaternions \\f$q_0, q_1\\f$ are needed to interpolate, you can use nlerp(), slerp() or spline()\n * ```\n * Quatd::nlerp(q0, q1, t)\n *\n * Quatd::slerp(q0, q1, t)\n *\n * Quatd::spline(q0, q0, q1, q1, t)\n * ```\n * spline can smoothly connect rotations of  multiple quaternions\n *\n * Three ways to get an element in Quaternion\n * ```\n * Quatf q(1,2,3,4);\n * std::cout << q.w << std::endl; // w=1, x=2, y=3, z=4\n * std::cout << q[0] << std::endl; // q[0]=1, q[1]=2, q[2]=3, q[3]=4\n * std::cout << q.at(0) << std::endl;\n * ```\n */\ntemplate <typename _Tp>\nclass Quat\n{\n    static_assert(std::is_floating_point<_Tp>::value, \"Quaternion only make sense with type of float or double\");\n    using value_type = _Tp;\npublic:\n    static constexpr _Tp CV_QUAT_EPS = (_Tp)1.e-6;\n    static constexpr _Tp CV_QUAT_CONVERT_THRESHOLD = (_Tp)1.e-6;\n\n    Quat();\n\n    /**\n     * @brief From Vec4d or Vec4f.\n     */\n    explicit Quat(const Vec<_Tp, 4> &coeff);\n\n    /**\n     * @brief from four numbers.\n     */\n    Quat(_Tp w, _Tp x, _Tp y, _Tp z);\n\n    /**\n     * @brief from an angle, axis. Axis will be normalized in this function. And\n     * it generates\n     * \\f[q = [\\cos\\psi, u_x\\sin\\psi,u_y\\sin\\psi,  u_z\\sin\\psi].\\f]\n     * where \\f$\\psi = \\frac{\\theta}{2}\\f$, \\f$\\theta\\f$ is the rotation angle.\n     */\n    static Quat<_Tp> createFromAngleAxis(const _Tp angle, const Vec<_Tp, 3> &axis);\n\n    /**\n     * @brief from a 3x3 rotation matrix.\n     */\n    static Quat<_Tp> createFromRotMat(InputArray R);\n\n    /**\n     * @brief from a rotation vector\n     * \\f$r\\f$ has the form \\f$\\theta \\cdot \\boldsymbol{u}\\f$, where \\f$\\theta\\f$\n     * represents rotation angle and \\f$\\boldsymbol{u}\\f$ represents normalized rotation axis.\n     *\n     * Angle and axis could be easily derived as:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * \\psi &= ||r||\\\\\n     * \\boldsymbol{u} &= \\frac{r}{\\theta}\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     * Then a quaternion can be calculated by\n     *  \\f[q = [\\cos\\psi, \\boldsymbol{u}\\sin\\psi]\\f]\n     *  where \\f$\\psi = \\theta / 2 \\f$\n     */\n    static Quat<_Tp> createFromRvec(InputArray rvec);\n\n     /**\n     * @brief\n     * from Euler angles\n     *\n     * A quaternion can be generated from Euler angles by combining the quaternion representations of the Euler rotations.\n     *\n     * For example, if we use intrinsic rotations in the order of X-Y-Z,\\f$\\theta_1 \\f$ is rotation around the X-axis, \\f$\\theta_2 \\f$ is rotation around the Y-axis,\n     * \\f$\\theta_3 \\f$ is rotation around the Z-axis. The final quaternion q can be calculated by\n     *\n     * \\f[ {q} = q_{X, \\theta_1}  q_{Y, \\theta_2} q_{Z, \\theta_3}\\f]\n     * where \\f$ q_{X, \\theta_1} \\f$ is created from @ref createFromXRot,  \\f$ q_{Y, \\theta_2} \\f$ is created from @ref createFromYRot,\n     *  \\f$ q_{Z, \\theta_3} \\f$ is created from @ref createFromZRot.\n     * @param angles the Euler angles in a vector of length 3\n     * @param eulerAnglesType the convertion Euler angles type\n     */\n    static Quat<_Tp> createFromEulerAngles(const Vec<_Tp, 3> &angles, QuatEnum::EulerAnglesType eulerAnglesType);\n\n    /**\n     * @brief get a quaternion from a rotation about the Y-axis by \\f$\\theta\\f$ .\n     * \\f[q = \\cos(\\theta/2)+0 i+ sin(\\theta/2) j +0k \\f]\n     */\n    static Quat<_Tp> createFromYRot(const _Tp theta);\n\n    /**\n     * @brief get a quaternion from a rotation about the X-axis by \\f$\\theta\\f$ .\n     * \\f[q = \\cos(\\theta/2)+sin(\\theta/2) i +0 j +0 k \\f]\n     */\n    static Quat<_Tp> createFromXRot(const _Tp theta);\n\n    /**\n     * @brief get a quaternion from a rotation about the Z-axis by \\f$\\theta\\f$.\n     * \\f[q = \\cos(\\theta/2)+0 i +0 j +sin(\\theta/2) k \\f]\n     */\n    static Quat<_Tp> createFromZRot(const _Tp theta);\n\n    /**\n     * @brief a way to get element.\n     * @param index over a range [0, 3].\n     *\n     * A quaternion q\n     *\n     * q.at(0) is equivalent to q.w,\n     *\n     * q.at(1) is equivalent to q.x,\n     *\n     * q.at(2) is equivalent to q.y,\n     *\n     * q.at(3) is equivalent to q.z.\n     */\n    _Tp at(size_t index) const;\n\n    /**\n     * @brief return the conjugate of this quaternion.\n     * \\f[q.conjugate() = (w, -x, -y, -z).\\f]\n     */\n    Quat<_Tp> conjugate() const;\n\n    /**\n     *\n     * @brief return the value of exponential value.\n     * \\f[\\exp(q) = e^w (\\cos||\\boldsymbol{v}||+ \\frac{v}{||\\boldsymbol{v}||})\\sin||\\boldsymbol{v}||\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param q a quaternion.\n     *\n     * For example:\n     * ```\n     * Quatd q{1,2,3,4};\n     * cout << exp(q) << endl;\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> exp(const Quat<T> &q);\n\n    /**\n     * @brief return the value of exponential value.\n     * \\f[\\exp(q) = e^w (\\cos||\\boldsymbol{v}||+ \\frac{v}{||\\boldsymbol{v}||}\\sin||\\boldsymbol{v}||)\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     *\n     * For example\n     * ```\n     * Quatd q{1,2,3,4};\n     * cout << q.exp() << endl;\n     * ```\n     */\n    Quat<_Tp> exp() const;\n\n    /**\n     * @brief return the value of logarithm function.\n     * \\f[\\ln(q) = \\ln||q|| + \\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}\\arccos\\frac{w}{||q||}.\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param q a quaternion.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, q assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatd q1{1,2,3,4};\n     * cout << log(q1) << endl;\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> log(const Quat<T> &q, QuatAssumeType assumeUnit);\n\n    /**\n     * @brief return the value of logarithm function.\n     *  \\f[\\ln(q) = \\ln||q|| + \\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}\\arccos\\frac{w}{||q||}\\f].\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param assumeUnit if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.log();\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * Quatd q1(1,2,3,4);\n     * q1.normalize().log(assumeUnit);\n     * ```\n     */\n    Quat<_Tp> log(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return the value of power function with index \\f$x\\f$.\n     * \\f[q^x = ||q||(cos(x\\theta) + \\boldsymbol{u}sin(x\\theta))).\\f]\n     * @param q a quaternion.\n     * @param x index of exponentiation.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * power(q, 2.0);\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * double angle = CV_PI;\n     * Vec3d axis{0, 0, 1};\n     * Quatd q1 = Quatd::createFromAngleAxis(angle, axis); //generate a unit quat by axis and angle\n     * power(q1, 2.0, assumeUnit);//This assumeUnit means q1 is a unit quaternion.\n     * ```\n     * @note the type of the index should be the same as the quaternion.\n     */\n    template <typename T>\n    friend Quat<T> power(const Quat<T> &q, const T x, QuatAssumeType assumeUnit);\n\n    /**\n     * @brief return the value of power function with index \\f$x\\f$.\n     * \\f[q^x = ||q||(\\cos(x\\theta) + \\boldsymbol{u}\\sin(x\\theta))).\\f]\n     * @param x index of exponentiation.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.power(2.0);\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * double angle = CV_PI;\n     * Vec3d axis{0, 0, 1};\n     * Quatd q1 = Quatd::createFromAngleAxis(angle, axis); //generate a unit quat by axis and angle\n     * q1.power(2.0, assumeUnit); //This assumeUnt means q1 is a unit quaternion\n     * ```\n     */\n    Quat<_Tp> power(const _Tp x, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return \\f$\\sqrt{q}\\f$.\n     * @param q a quaternion.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatf q(1,2,3,4);\n     * sqrt(q);\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * q = {1,0,0,0};\n     * sqrt(q, assumeUnit); //This assumeUnit means q is a unit quaternion.\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> sqrt(const Quat<T> &q, QuatAssumeType assumeUnit);\n\n    /**\n     * @brief return \\f$\\sqrt{q}\\f$.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatf q(1,2,3,4);\n     * q.sqrt();\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * q = {1,0,0,0};\n     * q.sqrt(assumeUnit); //This assumeUnit means q is a unit quaternion\n     * ```\n     */\n    Quat<_Tp> sqrt(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return the value of power function with quaternion \\f$q\\f$.\n     * \\f[p^q = e^{q\\ln(p)}.\\f]\n     * @param p base quaternion of power function.\n     * @param q index quaternion of power function.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, quaternion \\f$p\\f$ assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatd p(1,2,3,4);\n     * Quatd q(5,6,7,8);\n     * power(p, q);\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * p = p.normalize();\n     * power(p, q, assumeUnit); //This assumeUnit means p is a unit quaternion\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> power(const Quat<T> &p, const Quat<T> &q, QuatAssumeType assumeUnit);\n\n    /**\n     * @brief return the value of power function with quaternion \\f$q\\f$.\n     * \\f[p^q = e^{q\\ln(p)}.\\f]\n     * @param q index quaternion of power function.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatd p(1,2,3,4);\n     * Quatd q(5,6,7,8);\n     * p.power(q);\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * p = p.normalize();\n     * p.power(q, assumeUnit); //This assumeUnit means p is a unit quaternion\n     * ```\n     */\n    Quat<_Tp> power(const Quat<_Tp> &q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return the crossProduct between \\f$p = (a, b, c, d) = (a, \\boldsymbol{u})\\f$ and \\f$q = (w, x, y, z) = (w, \\boldsymbol{v})\\f$.\n     * \\f[p \\times q = \\frac{pq- qp}{2}\\f]\n     * \\f[p \\times q = \\boldsymbol{u} \\times \\boldsymbol{v}\\f]\n     * \\f[p \\times q = (cz-dy)i + (dx-bz)j + (by-xc)k \\f]\n     *\n     * For example\n     * ```\n     * Quatd q{1,2,3,4};\n     * Quatd p{5,6,7,8};\n     * crossProduct(p, q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> crossProduct(const Quat<T> &p, const Quat<T> &q);\n\n    /**\n     * @brief return the crossProduct between \\f$p = (a, b, c, d) = (a, \\boldsymbol{u})\\f$ and \\f$q = (w, x, y, z) = (w, \\boldsymbol{v})\\f$.\n     * \\f[p \\times q = \\frac{pq- qp}{2}.\\f]\n     * \\f[p \\times q = \\boldsymbol{u} \\times \\boldsymbol{v}.\\f]\n     * \\f[p \\times q = (cz-dy)i + (dx-bz)j + (by-xc)k. \\f]\n     *\n     * For example\n     * ```\n     * Quatd q{1,2,3,4};\n     * Quatd p{5,6,7,8};\n     * p.crossProduct(q)\n     * ```\n     */\n    Quat<_Tp> crossProduct(const Quat<_Tp> &q) const;\n\n    /**\n     * @brief return the norm of quaternion.\n     * \\f[||q|| = \\sqrt{w^2 + x^2 + y^2 + z^2}.\\f]\n     */\n    _Tp norm() const;\n\n    /**\n     * @brief return a normalized \\f$p\\f$.\n     * \\f[p = \\frac{q}{||q||}\\f]\n     * where \\f$p\\f$ satisfies \\f$(p.x)^2 + (p.y)^2 + (p.z)^2 + (p.w)^2 = 1.\\f$\n     */\n    Quat<_Tp> normalize() const;\n\n    /**\n     * @brief return \\f$q^{-1}\\f$ which is an inverse of \\f$q\\f$\n     * which satisfies \\f$q * q^{-1} = 1\\f$.\n     * @param q a quaternion.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * inv(q);\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * q = q.normalize();\n     * inv(q, assumeUnit);//This assumeUnit means p is a unit quaternion\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> inv(const Quat<T> &q, QuatAssumeType assumeUnit);\n\n    /**\n     * @brief return \\f$q^{-1}\\f$ which is an inverse of \\f$q\\f$\n     * satisfying \\f$q * q^{-1} = 1\\f$.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.inv();\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * q = q.normalize();\n     * q.inv(assumeUnit);  //assumeUnit means p is a unit quaternion\n     * ```\n     */\n    Quat<_Tp> inv(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return sinh value of quaternion q, sinh could be calculated as:\n     * \\f[\\sinh(p) = \\sin(w)\\cos(||\\boldsymbol{v}||) + \\cosh(w)\\frac{v}{||\\boldsymbol{v}||}\\sin||\\boldsymbol{v}||\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * sinh(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> sinh(const Quat<T> &q);\n\n    /**\n     * @brief return sinh value of this quaternion, sinh could be calculated as:\n     * \\f$\\sinh(p) = \\sin(w)\\cos(||\\boldsymbol{v}||) + \\cosh(w)\\frac{v}{||\\boldsymbol{v}||}\\sin||\\boldsymbol{v}||\\f$\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.sinh();\n     * ```\n     */\n    Quat<_Tp> sinh() const;\n\n    /**\n     * @brief return cosh value of quaternion q, cosh could be calculated as:\n     * \\f[\\cosh(p) = \\cosh(w) * \\cos(||\\boldsymbol{v}||) + \\sinh(w)\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}\\sin(||\\boldsymbol{v}||)\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * cosh(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> cosh(const Quat<T> &q);\n\n    /**\n     * @brief return cosh value of this quaternion, cosh could be calculated as:\n     * \\f[\\cosh(p) = \\cosh(w) * \\cos(||\\boldsymbol{v}||) + \\sinh(w)\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}sin(||\\boldsymbol{v}||)\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.cosh();\n     * ```\n     */\n    Quat<_Tp> cosh() const;\n\n    /**\n     * @brief return tanh value of quaternion q, tanh could be calculated as:\n     * \\f[ \\tanh(q) = \\frac{\\sinh(q)}{\\cosh(q)}.\\f]\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * tanh(q);\n     * ```\n     * @sa sinh, cosh\n     */\n    template <typename T>\n    friend Quat<T> tanh(const Quat<T> &q);\n\n    /**\n     * @brief return tanh value of this quaternion, tanh could be calculated as:\n     * \\f[ \\tanh(q) = \\frac{\\sinh(q)}{\\cosh(q)}.\\f]\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.tanh();\n     * ```\n     * @sa sinh, cosh\n     */\n    Quat<_Tp> tanh() const;\n\n    /**\n     * @brief return tanh value of quaternion q, sin could be calculated as:\n     * \\f[\\sin(p) = \\sin(w) * \\cosh(||\\boldsymbol{v}||) + \\cos(w)\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}\\sinh(||\\boldsymbol{v}||)\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * sin(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> sin(const Quat<T> &q);\n\n    /**\n     * @brief return sin value of this quaternion, sin could be calculated as:\n     * \\f[\\sin(p) = \\sin(w) * \\cosh(||\\boldsymbol{v}||) + \\cos(w)\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}\\sinh(||\\boldsymbol{v}||)\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.sin();\n     * ```\n     */\n    Quat<_Tp> sin() const;\n\n    /**\n     * @brief return sin value of quaternion q, cos could be calculated as:\n     * \\f[\\cos(p) = \\cos(w) * \\cosh(||\\boldsymbol{v}||) - \\sin(w)\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}\\sinh(||\\boldsymbol{v}||)\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * cos(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> cos(const Quat<T> &q);\n\n    /**\n     * @brief return cos value of this quaternion, cos could be calculated as:\n     * \\f[\\cos(p) = \\cos(w) * \\cosh(||\\boldsymbol{v}||) - \\sin(w)\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}\\sinh(||\\boldsymbol{v}||)\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.cos();\n     * ```\n     */\n    Quat<_Tp> cos() const;\n\n    /**\n     * @brief return tan value of quaternion q, tan could be calculated as:\n     * \\f[\\tan(q) = \\frac{\\sin(q)}{\\cos(q)}.\\f]\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * tan(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> tan(const Quat<T> &q);\n\n    /**\n     * @brief return tan value of this quaternion, tan could be calculated as:\n     * \\f[\\tan(q) = \\frac{\\sin(q)}{\\cos(q)}.\\f]\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.tan();\n     * ```\n     */\n    Quat<_Tp> tan() const;\n\n    /**\n     * @brief return arcsin value of quaternion q, arcsin could be calculated as:\n     * \\f[\\arcsin(q) = -\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}arcsinh(q\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||})\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * asin(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> asin(const Quat<T> &q);\n\n    /**\n     * @brief return arcsin value of this quaternion, arcsin could be calculated as:\n     * \\f[\\arcsin(q) = -\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}arcsinh(q\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||})\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.asin();\n     * ```\n     */\n    Quat<_Tp> asin() const;\n\n    /**\n     * @brief return arccos value of quaternion q, arccos could be calculated as:\n     * \\f[\\arccos(q) = -\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}arccosh(q)\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * acos(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> acos(const Quat<T> &q);\n\n    /**\n     * @brief return arccos value of this quaternion, arccos could be calculated as:\n     * \\f[\\arccos(q) = -\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}arccosh(q)\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.acos();\n     * ```\n     */\n    Quat<_Tp> acos() const;\n\n    /**\n     * @brief return arctan value of quaternion q, arctan could be calculated as:\n     * \\f[\\arctan(q) = -\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}arctanh(q\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||})\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * atan(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> atan(const Quat<T> &q);\n\n    /**\n     * @brief return arctan value of this quaternion, arctan could be calculated as:\n     * \\f[\\arctan(q) = -\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||}arctanh(q\\frac{\\boldsymbol{v}}{||\\boldsymbol{v}||})\\f]\n     * where \\f$\\boldsymbol{v} = [x, y, z].\\f$\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.atan();\n     * ```\n     */\n    Quat<_Tp> atan() const;\n\n    /**\n     * @brief return arcsinh value of quaternion q, arcsinh could be calculated as:\n     * \\f[arcsinh(q) = \\ln(q + \\sqrt{q^2 + 1})\\f].\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * asinh(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> asinh(const Quat<T> &q);\n\n    /**\n     * @brief return arcsinh value of this quaternion, arcsinh could be calculated as:\n     * \\f[arcsinh(q) = \\ln(q + \\sqrt{q^2 + 1})\\f].\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.asinh();\n     * ```\n     */\n    Quat<_Tp> asinh() const;\n\n    /**\n     * @brief return arccosh value of quaternion q, arccosh could be calculated as:\n     * \\f[arccosh(q) = \\ln(q + \\sqrt{q^2 - 1})\\f].\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * acosh(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> acosh(const Quat<T> &q);\n\n    /**\n     * @brief return arccosh value of this quaternion, arccosh could be calculated as:\n     * \\f[arcosh(q) = \\ln(q + \\sqrt{q^2 - 1})\\f].\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.acosh();\n     * ```\n     */\n    Quat<_Tp> acosh() const;\n\n    /**\n     * @brief return arctanh value of quaternion q, arctanh could be calculated as:\n     * \\f[arctanh(q) = \\frac{\\ln(q + 1) - \\ln(1 - q)}{2}\\f].\n     * @param q a quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * atanh(q);\n     * ```\n     */\n    template <typename T>\n    friend Quat<T> atanh(const Quat<T> &q);\n\n    /**\n     * @brief return arctanh value of this quaternion, arctanh could be calculated as:\n     * \\f[arcsinh(q) = \\frac{\\ln(q + 1) - \\ln(1 - q)}{2}\\f].\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.atanh();\n     * ```\n     */\n    Quat<_Tp> atanh() const;\n\n    /**\n     * @brief return true if this quaternion is a unit quaternion.\n     * @param eps tolerance scope of normalization. The eps could be defined as\n     *\n     * \\f[eps = |1 - dotValue|\\f] where \\f[dotValue = (this.w^2 + this.x^2 + this,y^2 + this.z^2).\\f]\n     * And this function will consider it is normalized when the dotValue over a range \\f$[1-eps, 1+eps]\\f$.\n     */\n    bool isNormal(_Tp eps=CV_QUAT_EPS) const;\n\n    /**\n     * @brief to throw an error if this quaternion is not a unit quaternion.\n     * @param eps tolerance scope of normalization.\n     * @sa isNormal\n     */\n    void assertNormal(_Tp eps=CV_QUAT_EPS) const;\n\n    /**\n     * @brief transform a quaternion to a 3x3 rotation matrix.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and\n     * this function will save some computations. Otherwise, this function will normalize this\n     * quaternion at first then do the transformation.\n     *\n     * @note Matrix A which is to be rotated should have the form\n     * \\f[\\begin{bmatrix}\n     * x_0& x_1& x_2&...&x_n\\\\\n     * y_0& y_1& y_2&...&y_n\\\\\n     * z_0& z_1& z_2&...&z_n\n     * \\end{bmatrix}\\f]\n     * where the same subscript represents a point. The shape of A assume to be [3, n]\n     * The points matrix A can be rotated by toRotMat3x3() * A.\n     * The result has 3 rows and n columns too.\n\n     * For example\n     * ```\n     * double angle = CV_PI;\n     * Vec3d axis{0,0,1};\n     * Quatd q_unit = Quatd::createFromAngleAxis(angle, axis); //quaternion could also be get by interpolation by two or more quaternions.\n     *\n     * //assume there is two points (1,0,0) and (1,0,1) to be rotated\n     * Mat pointsA = (Mat_<double>(2, 3) << 1,0,0,1,0,1);\n     * //change the shape\n     * pointsA = pointsA.t();\n     * // rotate 180 degrees around the z axis\n     * Mat new_point = q_unit.toRotMat3x3() * pointsA;\n     * // print two points\n     * cout << new_point << endl;\n     * ```\n     */\n    Matx<_Tp, 3, 3> toRotMat3x3(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief transform a quaternion to a 4x4 rotation matrix.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and\n     * this function will save some computations. Otherwise, this function will normalize this\n     * quaternion at first then do the transformation.\n     *\n     * The operations is similar as toRotMat3x3\n     * except that the points matrix should have the form\n     * \\f[\\begin{bmatrix}\n     * x_0& x_1& x_2&...&x_n\\\\\n     * y_0& y_1& y_2&...&y_n\\\\\n     * z_0& z_1& z_2&...&z_n\\\\\n     * 0&0&0&...&0\n     * \\end{bmatrix}\\f]\n     *\n     * @sa toRotMat3x3\n     */\n\n    Matx<_Tp, 4, 4> toRotMat4x4(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief transform the this quaternion to a Vec<T, 4>.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.toVec();\n     * ```\n     */\n    Vec<_Tp, 4> toVec() const;\n\n    /**\n     * @brief transform this quaternion to a Rotation vector.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and\n     * this function will save some computations.\n     * Rotation vector rVec is defined as:\n     * \\f[ rVec = [\\theta v_x, \\theta v_y, \\theta v_z]\\f]\n     * where \\f$\\theta\\f$ represents rotation angle, and \\f$\\boldsymbol{v}\\f$ represents the normalized rotation axis.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.toRotVec();\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * q.normalize().toRotVec(assumeUnit); //answer is same as q.toRotVec().\n     * ```\n     */\n    Vec<_Tp, 3> toRotVec(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief get the angle of quaternion, it returns the rotation angle.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and\n     * this function will save some computations.\n     * \\f[\\psi = 2 *arccos(\\frac{w}{||q||})\\f]\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.getAngle();\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * q.normalize().getAngle(assumeUnit);//same as q.getAngle().\n     * ```\n     * @note It always return the value between \\f$[0, 2\\pi]\\f$.\n     */\n    _Tp getAngle(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief get the axis of quaternion, it returns a vector of length 3.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and\n     * this function will save some computations.\n     *\n     * the unit axis \\f$\\boldsymbol{u}\\f$ is defined by\n     * \\f[\\begin{equation}\n     *    \\begin{split}\n     *      \\boldsymbol{v}\n     *      &= \\boldsymbol{u} ||\\boldsymbol{v}||\\\\\n     *      &= \\boldsymbol{u}||q||sin(\\frac{\\theta}{2})\n     *    \\end{split}\n     *    \\end{equation}\\f]\n     *  where \\f$v=[x, y ,z]\\f$ and \\f$\\theta\\f$ represents rotation angle.\n     *\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * q.getAxis();\n     *\n     * QuatAssumeType assumeUnit = QUAT_ASSUME_UNIT;\n     * q.normalize().getAxis(assumeUnit);//same as q.getAxis()\n     * ```\n     */\n    Vec<_Tp, 3> getAxis(QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT) const;\n\n    /**\n     * @brief return the dot between quaternion \\f$q\\f$ and this quaternion.\n     *\n     * dot(p, q) is a good metric of how close the quaternions are.\n     * Indeed, consider the unit quaternion difference \\f$p^{-1} * q\\f$, its real part is dot(p, q).\n     * At the same time its real part is equal to \\f$\\cos(\\beta/2)\\f$ where \\f$\\beta\\f$ is\n     * an angle of rotation between p and q, i.e.,\n     * Therefore, the closer dot(p, q) to 1,\n     * the smaller rotation between them.\n     * \\f[p \\cdot q = p.w \\cdot q.w + p.x \\cdot q.x + p.y \\cdot q.y + p.z \\cdot q.z\\f]\n     * @param q the other quaternion.\n     *\n     * For example\n     * ```\n     * Quatd q(1,2,3,4);\n     * Quatd p(5,6,7,8);\n     * p.dot(q);\n     * ```\n     */\n    _Tp dot(Quat<_Tp> q) const;\n\n    /**\n     * @brief To calculate the interpolation from \\f$q_0\\f$ to \\f$q_1\\f$ by Linear Interpolation(Nlerp)\n     * For two quaternions, this interpolation curve can be displayed as:\n     * \\f[Lerp(q_0, q_1, t) = (1 - t)q_0 + tq_1.\\f]\n     * Obviously, the lerp will interpolate along a straight line if we think of \\f$q_0\\f$ and \\f$q_1\\f$ as a vector\n     * in a two-dimensional space. When \\f$t = 0\\f$, it returns \\f$q_0\\f$ and when \\f$t= 1\\f$, it returns \\f$q_1\\f$.\n     * \\f$t\\f$ should to be ranged in \\f$[0, 1]\\f$ normally.\n     * @param q0 a quaternion used in linear interpolation.\n     * @param q1 a quaternion used in linear interpolation.\n     * @param t percent of vector \\f$\\overrightarrow{q_0q_1}\\f$ over a range [0, 1].\n     * @note it returns a non-unit quaternion.\n     */\n    static Quat<_Tp> lerp(const Quat<_Tp> &q0, const Quat &q1, const _Tp t);\n\n    /**\n     * @brief To calculate the interpolation from \\f$q_0\\f$ to \\f$q_1\\f$ by Normalized Linear Interpolation(Nlerp).\n     * it returns a normalized quaternion of Linear Interpolation(Lerp).\n     * \\f[ Nlerp(q_0, q_1, t) = \\frac{(1 - t)q_0 + tq_1}{||(1 - t)q_0 + tq_1||}.\\f]\n     * The interpolation will always choose the shortest path but the constant speed is not guaranteed.\n     * @param q0 a quaternion used in normalized linear interpolation.\n     * @param q1 a quaternion used in normalized linear interpolation.\n     * @param t percent of vector \\f$\\overrightarrow{q_0q_1}\\f$ over a range [0, 1].\n     * @param assumeUnit if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternion. Otherwise, all inputs\n     quaternion will be normalized inside the function.\n     * @sa lerp\n     */\n    static Quat<_Tp> nlerp(const Quat<_Tp> &q0, const Quat &q1, const _Tp t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\n    /**\n     @brief To calculate the interpolation between \\f$q_0\\f$ and \\f$q_1\\f$ by Spherical Linear\n     Interpolation(Slerp), which can be defined as:\n    \\f[ Slerp(q_0, q_1, t) = \\frac{\\sin((1-t)\\theta)}{\\sin(\\theta)}q_0 + \\frac{\\sin(t\\theta)}{\\sin(\\theta)}q_1\\f]\n    where \\f$\\theta\\f$ can be calculated as:\n    \\f[\\theta=cos^{-1}(q_0\\cdot q_1)\\f]\n    resulting from the both of their norm is unit.\n    @param q0 a quaternion used in Slerp.\n    @param q1 a quaternion used in Slerp.\n    @param t percent of angle between \\f$q_0\\f$ and \\f$q_1\\f$ over a range [0, 1].\n    @param assumeUnit if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternions. Otherwise, all input\n    quaternions will be normalized inside the function.\n    @param directChange if QUAT_ASSUME_UNIT, the interpolation will choose the nearest path.\n    @note If the interpolation angle is small, the error between Nlerp and Slerp is not so large. To improve efficiency and\n    avoid zero division error, we use Nlerp instead of Slerp.\n    */\n    static Quat<_Tp> slerp(const Quat<_Tp> &q0, const Quat &q1, const _Tp t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT, bool directChange=true);\n\n    /**\n     * @brief To calculate the interpolation between \\f$q_0\\f$,\\f$q_1\\f$,\\f$q_2\\f$,\\f$q_3\\f$  by Spherical and quadrangle(Squad). This could be defined as:\n     * \\f[Squad(q_i, s_i, s_{i+1}, q_{i+1}, t) = Slerp(Slerp(q_i, q_{i+1}, t), Slerp(s_i, s_{i+1}, t), 2t(1-t))\\f]\n     * where\n     * \\f[s_i = q_i\\exp(-\\frac{\\log(q^*_iq_{i+1}) + \\log(q^*_iq_{i-1})}{4})\\f]\n     *\n     * The Squad expression is analogous to the \\f$B\\acute{e}zier\\f$ curve, but involves spherical linear\n     * interpolation instead of simple linear interpolation. Each \\f$s_i\\f$ needs to be calculated by three\n     * quaternions.\n     *\n     * @param q0 the first quaternion.\n     * @param s0 the second quaternion.\n     * @param s1 the third quaternion.\n     * @param q1 thr fourth quaternion.\n     * @param t interpolation parameter of quadratic and linear interpolation over a range \\f$[0, 1]\\f$.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternion. Otherwise, all input\n     * quaternions will be normalized inside the function.\n     * @param directChange if QUAT_ASSUME_UNIT, squad will find the nearest path to interpolate.\n     * @sa interPoint, spline\n     */\n    static Quat<_Tp> squad(const Quat<_Tp> &q0, const Quat<_Tp> &s0,\n                            const Quat<_Tp> &s1, const Quat<_Tp> &q1,\n                            const _Tp t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT,\n                            bool directChange=true);\n\n    /**\n     * @brief This is the part calculation of squad.\n     * To calculate the intermedia quaternion \\f$s_i\\f$ between each three quaternion\n     * \\f[s_i = q_i\\exp(-\\frac{\\log(q^*_iq_{i+1}) + \\log(q^*_iq_{i-1})}{4}).\\f]\n     * @param q0 the first quaternion.\n     * @param q1 the second quaternion.\n     * @param q2 the third quaternion.\n     * @param assumeUnit if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternion. Otherwise, all input\n     * quaternions will be normalized inside the function.\n     * @sa squad\n     */\n    static Quat<_Tp> interPoint(const Quat<_Tp> &q0, const Quat<_Tp> &q1,\n                                 const Quat<_Tp> &q2, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\n    /**\n     * @brief to calculate a quaternion which is the result of a \\f$C^1\\f$ continuous\n     * spline curve constructed by squad at the ratio t. Here, the interpolation values are\n     * between \\f$q_1\\f$ and \\f$q_2\\f$. \\f$q_0\\f$ and \\f$q_2\\f$ are used to ensure the \\f$C^1\\f$\n     * continuity. if t = 0, it returns \\f$q_1\\f$, if t = 1, it returns \\f$q_2\\f$.\n     * @param q0 the first input quaternion to ensure \\f$C^1\\f$ continuity.\n     * @param q1 the second input quaternion.\n     * @param q2 the third input quaternion.\n     * @param q3 the fourth input quaternion the same use of \\f$q1\\f$.\n     * @param t ratio over a range [0, 1].\n     * @param assumeUnit if QUAT_ASSUME_UNIT, \\f$q_0, q_1, q_2, q_3\\f$ assume to be unit quaternion. Otherwise, all input\n     * quaternions will be normalized inside the function.\n     *\n     * For example:\n     *\n     * If there are three double quaternions \\f$v_0, v_1, v_2\\f$ waiting to be interpolated.\n     *\n     * Interpolation between \\f$v_0\\f$ and \\f$v_1\\f$ with a ratio \\f$t_0\\f$ could be calculated as\n     * ```\n     * Quatd::spline(v0, v0, v1, v2, t0);\n     * ```\n     * Interpolation between \\f$v_1\\f$ and \\f$v_2\\f$ with a ratio \\f$t_0\\f$ could be calculated as\n     * ```\n     * Quatd::spline(v0, v1, v2, v2, t0);\n     * ```\n     * @sa squad, slerp\n     */\n    static Quat<_Tp> spline(const Quat<_Tp> &q0, const Quat<_Tp> &q1,\n                            const Quat<_Tp> &q2, const Quat<_Tp> &q3,\n                            const _Tp t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\n    /**\n     * @brief Return opposite quaternion \\f$-p\\f$\n     * which satisfies \\f$p + (-p) = 0.\\f$\n     *\n     * For example\n     * ```\n     * Quatd q{1, 2, 3, 4};\n     * std::cout << -q << std::endl; // [-1, -2, -3, -4]\n     * ```\n     */\n    Quat<_Tp> operator-() const;\n\n    /**\n     * @brief return true if two quaternions p and q are nearly equal, i.e. when the absolute\n     * value of each \\f$p_i\\f$ and \\f$q_i\\f$ is less than CV_QUAT_EPS.\n     */\n    bool operator==(const Quat<_Tp>&) const;\n\n    /**\n     * @brief Addition operator of two quaternions p and q.\n     * It returns a new quaternion that each value is the sum of \\f$p_i\\f$ and \\f$q_i\\f$.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * Quatd q{5, 6, 7, 8};\n     * std::cout << p + q << std::endl; //[6, 8, 10, 12]\n     * ```\n     */\n    Quat<_Tp> operator+(const Quat<_Tp>&) const;\n\n    /**\n     * @brief Addition assignment operator of two quaternions p and q.\n     * It adds right operand to the left operand and assign the result to left operand.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * Quatd q{5, 6, 7, 8};\n     * p += q; // equivalent to p = p + q\n     * std::cout << p << std::endl; //[6, 8, 10, 12]\n     *\n     * ```\n     */\n    Quat<_Tp>& operator+=(const Quat<_Tp>&);\n\n    /**\n     * @brief Subtraction operator of two quaternions p and q.\n     * It returns a new quaternion that each value is the sum of \\f$p_i\\f$ and \\f$-q_i\\f$.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * Quatd q{5, 6, 7, 8};\n     * std::cout << p - q << std::endl; //[-4, -4, -4, -4]\n     * ```\n     */\n    Quat<_Tp> operator-(const Quat<_Tp>&) const;\n\n    /**\n     * @brief Subtraction assignment operator of two quaternions p and q.\n     * It subtracts right operand from the left operand and assign the result to left operand.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * Quatd q{5, 6, 7, 8};\n     * p -= q; // equivalent to p = p - q\n     * std::cout << p << std::endl; //[-4, -4, -4, -4]\n     *\n     * ```\n     */\n    Quat<_Tp>& operator-=(const Quat<_Tp>&);\n\n    /**\n     * @brief Multiplication assignment operator of two quaternions q and p.\n     * It multiplies right operand with the left operand and assign the result to left operand.\n     *\n     * Rule of quaternion multiplication:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * q &= [p_0, \\boldsymbol{u}]*[q_0, \\boldsymbol{v}]\\\\\n     * &=[p_0q_0 - \\boldsymbol{u}\\cdot \\boldsymbol{v}, p_0\\boldsymbol{v} + q_0\\boldsymbol{u}+ \\boldsymbol{u}\\times \\boldsymbol{v}].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     * where \\f$\\cdot\\f$ means dot product and \\f$\\times \\f$ means cross product.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * Quatd q{5, 6, 7, 8};\n     * p *= q; // equivalent to p = p * q\n     * std::cout << p << std::endl; //[-60, 12, 30, 24]\n     * ```\n     */\n    Quat<_Tp>& operator*=(const Quat<_Tp>&);\n\n    /**\n     * @brief Multiplication assignment operator of a quaternions and a scalar.\n     * It multiplies right operand with the left operand and assign the result to left operand.\n     *\n     * Rule of quaternion multiplication with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * s &= [w, x, y, z] * s\\\\\n     * &=[w * s, x * s, y * s, z * s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * double s = 2.0;\n     * p *= s; // equivalent to p = p * s\n     * std::cout << p << std::endl; //[2.0, 4.0, 6.0, 8.0]\n     * ```\n     * @note the type of scalar should be equal to the quaternion.\n     */\n    Quat<_Tp>& operator*=(const _Tp s);\n\n    /**\n     * @brief Multiplication operator of two quaternions q and p.\n     * Multiplies values on either side of the operator.\n     *\n     * Rule of quaternion multiplication:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * q &= [p_0, \\boldsymbol{u}]*[q_0, \\boldsymbol{v}]\\\\\n     * &=[p_0q_0 - \\boldsymbol{u}\\cdot \\boldsymbol{v}, p_0\\boldsymbol{v} + q_0\\boldsymbol{u}+ \\boldsymbol{u}\\times \\boldsymbol{v}].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     * where \\f$\\cdot\\f$ means dot product and \\f$\\times \\f$ means cross product.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * Quatd q{5, 6, 7, 8};\n     * std::cout << p * q << std::endl; //[-60, 12, 30, 24]\n     * ```\n     */\n    Quat<_Tp> operator*(const Quat<_Tp>&) const;\n\n    /**\n     * @brief Division operator of a quaternions and a scalar.\n     * It divides left operand with the right operand and assign the result to left operand.\n     *\n     * Rule of quaternion division with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p / s &= [w, x, y, z] / s\\\\\n     * &=[w/s, x/s, y/s, z/s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * double s = 2.0;\n     * p /= s; // equivalent to p = p / s\n     * std::cout << p << std::endl; //[0.5, 1, 1.5, 2]\n     * ```\n     * @note the type of scalar should be equal to this quaternion.\n     */\n    Quat<_Tp> operator/(const _Tp s) const;\n\n    /**\n     * @brief Division operator of two quaternions p and q.\n     * Divides left hand operand by right hand operand.\n     *\n     * Rule of quaternion division with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p / q &= p * q.inv()\\\\\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * Quatd q{5, 6, 7, 8};\n     * std::cout << p / q << std::endl; // equivalent to p * q.inv()\n     * ```\n     */\n    Quat<_Tp> operator/(const Quat<_Tp>&) const;\n\n    /**\n     * @brief Division assignment operator of a quaternions and a scalar.\n     * It divides left operand with the right operand and assign the result to left operand.\n     *\n     * Rule of quaternion division with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p / s &= [w, x, y, z] / s\\\\\n     * &=[w / s, x / s, y / s, z / s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * double s = 2.0;;\n     * p /= s; // equivalent to p = p / s\n     * std::cout << p << std::endl; //[0.5, 1.0, 1.5, 2.0]\n     * ```\n     * @note the type of scalar should be equal to the quaternion.\n     */\n    Quat<_Tp>& operator/=(const _Tp s);\n\n    /**\n     * @brief Division assignment operator of two quaternions p and q;\n     * It divides left operand with the right operand and assign the result to left operand.\n     *\n     * Rule of quaternion division with a quaternion:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p / q&= p * q.inv()\\\\\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * Quatd q{5, 6, 7, 8};\n     * p /= q; // equivalent to p = p * q.inv()\n     * std::cout << p << std::endl;\n     * ```\n     */\n    Quat<_Tp>& operator/=(const Quat<_Tp>&);\n\n    _Tp& operator[](std::size_t n);\n\n    const _Tp& operator[](std::size_t n) const;\n\n    /**\n     * @brief Subtraction operator of a scalar and a quaternions.\n     * Subtracts right hand operand from left hand operand.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * double scalar = 2.0;\n     * std::cout << scalar - p << std::endl; //[1.0, -2, -3, -4]\n     * ```\n     * @note the type of scalar should be equal to the quaternion.\n     */\n    template <typename T>\n    friend Quat<T> cv::operator-(const T s, const Quat<T>&);\n\n    /**\n     * @brief Subtraction operator of a quaternions and a scalar.\n     * Subtracts right hand operand from left hand operand.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * double scalar = 2.0;\n     * std::cout << p - scalar << std::endl; //[-1.0, 2, 3, 4]\n     * ```\n     * @note the type of scalar should be equal to the quaternion.\n     */\n    template <typename T>\n    friend Quat<T> cv::operator-(const Quat<T>&, const T s);\n\n    /**\n     * @brief Addition operator of a quaternions and a scalar.\n     * Adds right hand operand from left hand operand.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * double scalar = 2.0;\n     * std::cout << scalar + p << std::endl; //[3.0, 2, 3, 4]\n     * ```\n     * @note the type of scalar should be equal to the quaternion.\n     */\n    template <typename T>\n    friend Quat<T> cv::operator+(const T s, const Quat<T>&);\n\n    /**\n     * @brief Addition operator of a quaternions and a scalar.\n     * Adds right hand operand from left hand operand.\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * double scalar = 2.0;\n     * std::cout << p + scalar << std::endl; //[3.0, 2, 3, 4]\n     * ```\n     * @note the type of scalar should be equal to the quaternion.\n     */\n    template <typename T>\n    friend Quat<T> cv::operator+(const Quat<T>&, const T s);\n\n    /**\n     * @brief Multiplication operator of a scalar and a quaternions.\n     * It multiplies right operand with the left operand and assign the result to left operand.\n     *\n     * Rule of quaternion multiplication with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * s &= [w, x, y, z] * s\\\\\n     * &=[w * s, x * s, y * s, z * s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * double s = 2.0;\n     * std::cout << s * p << std::endl; //[2.0, 4.0, 6.0, 8.0]\n     * ```\n     * @note the type of scalar should be equal to the quaternion.\n     */\n    template <typename T>\n    friend Quat<T> cv::operator*(const T s, const Quat<T>&);\n\n    /**\n     * @brief Multiplication operator of a quaternion and a scalar.\n     * It multiplies right operand with the left operand and assign the result to left operand.\n     *\n     * Rule of quaternion multiplication with a scalar:\n     * \\f[\n     * \\begin{equation}\n     * \\begin{split}\n     * p * s &= [w, x, y, z] * s\\\\\n     * &=[w * s, x * s, y * s, z * s].\n     * \\end{split}\n     * \\end{equation}\n     * \\f]\n     *\n     * For example\n     * ```\n     * Quatd p{1, 2, 3, 4};\n     * double s = 2.0;\n     * std::cout << p * s << std::endl; //[2.0, 4.0, 6.0, 8.0]\n     * ```\n     * @note the type of scalar should be equal to the quaternion.\n     */\n    template <typename T>\n    friend Quat<T> cv::operator*(const Quat<T>&, const T s);\n\n    template <typename S>\n    friend std::ostream& cv::operator<<(std::ostream&, const Quat<S>&);\n\n    /**\n     * @brief Transform a quaternion q to Euler angles.\n     *\n     *\n     * When transforming a quaternion \\f$q = w + x\\boldsymbol{i} + y\\boldsymbol{j} + z\\boldsymbol{k}\\f$ to Euler angles, rotation matrix M can be calculated by:\n     * \\f[ \\begin{aligned} {M} &={\\begin{bmatrix}1-2(y^{2}+z^{2})&2(xy-zx)&2(xz+yw)\\\\2(xy+zw)&1-2(x^{2}+z^{2})&2(yz-xw)\\\\2(xz-yw)&2(yz+xw)&1-2(x^{2}+y^{2})\\end{bmatrix}}\\end{aligned}.\\f]\n     * On the other hand, the rotation matrix can be obtained from Euler angles.\n     * Using intrinsic rotations with Euler angles type XYZ as an example,\n     * \\f$\\theta_1 \\f$, \\f$\\theta_2 \\f$, \\f$\\theta_3 \\f$ are three angles for Euler angles, the rotation matrix R can be calculated by:\\f[R =X(\\theta_1)Y(\\theta_2)Z(\\theta_3)\n     * ={\\begin{bmatrix}\\cos\\theta_{2}\\cos\\theta_{3}&-\\cos\\theta_{2}\\sin\\theta_{3}&\\sin\\theta_{2}\\\\\\cos\\theta_{1}\\sin\\theta_{3}+\\cos\\theta_{3}\\sin\\theta_{1}\\sin\\theta_{2}&\\cos\\theta_{1}\\cos\\theta_{3}-\\sin\\theta_{1}\\sin\\theta_{2}\\sin\\theta_{3}&-\\cos\\theta_{2}\\sin\\theta_{1}\\\\\\sin\\theta_{1}\\sin\\theta_{3}-\\cos\\theta_{1}\\cos\\theta_{3}\\sin\\theta_{2}&\\cos\\theta_{3}\\sin\\theta_{1}+\\cos\\theta_{1}\\sin\\theta_{2}\\sin\\theta_{3}&\\cos\\theta_{1}\\cos_{2}\\end{bmatrix}}\\f]\n     * Rotation matrix M and R are equal. As long as \\f$ s_{2} \\neq 1 \\f$, by comparing each element of two matrices ,the solution is\\f$\\begin{cases} \\theta_1 = \\arctan2(-m_{23},m_{33})\\\\\\theta_2 = arcsin(m_{13}) \\\\\\theta_3 = \\arctan2(-m_{12},m_{11}) \\end{cases}\\f$.\n     *\n     * When \\f$ s_{2}=1\\f$ or \\f$ s_{2}=-1\\f$, the gimbal lock occurs. The function will prompt \"WARNING: Gimbal Lock will occur. Euler angles is non-unique. For intrinsic rotations, we set the third angle to 0, and for external rotation, we set the first angle to 0.\".\n     *\n     * When \\f$ s_{2}=1\\f$ ,\n     * The rotation matrix R is \\f$R = {\\begin{bmatrix}0&0&1\\\\\\sin(\\theta_1+\\theta_3)&\\cos(\\theta_1+\\theta_3)&0\\\\-\\cos(\\theta_1+\\theta_3)&\\sin(\\theta_1+\\theta_3)&0\\end{bmatrix}}\\f$.\n     *\n     * The number of solutions is infinite with the condition \\f$\\begin{cases} \\theta_1+\\theta_3 = \\arctan2(m_{21},m_{22})\\\\ \\theta_2=\\pi/2 \\end{cases}\\ \\f$.\n     *\n     * We set \\f$ \\theta_3 = 0\\f$, the solution is \\f$\\begin{cases} \\theta_1=\\arctan2(m_{21},m_{22})\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=0 \\end{cases}\\f$.\n     *\n     * When \\f$ s_{2}=-1\\f$,\n     * The rotation matrix R is \\f$X_{1}Y_{2}Z_{3}={\\begin{bmatrix}0&0&-1\\\\-\\sin(\\theta_1-\\theta_3)&\\cos(\\theta_1-\\theta_3)&0\\\\\\cos(\\theta_1-\\theta_3)&\\sin(\\theta_1-\\theta_3)&0\\end{bmatrix}}\\f$.\n     *\n     * The number of solutions is infinite with the condition \\f$\\begin{cases} \\theta_1+\\theta_3 = \\arctan2(m_{32},m_{22})\\\\ \\theta_2=\\pi/2 \\end{cases}\\ \\f$.\n     *\n     * We set \\f$ \\theta_3 = 0\\f$, the solution is \\f$ \\begin{cases}\\theta_1=\\arctan2(m_{32},m_{22}) \\\\ \\theta_2=-\\pi/2\\\\  \\theta_3=0\\end{cases}\\f$.\n     *\n     * Since \\f$ sin \\theta\\in [-1,1] \\f$ and \\f$ cos \\theta \\in [-1,1] \\f$, the unnormalized quaternion will cause computational troubles. For this reason, this function will normalize the quaternion at first and @ref QuatAssumeType is not needed.\n     *\n     * When the gimbal lock occurs, we set \\f$\\theta_3 = 0\\f$ for intrinsic rotations or \\f$\\theta_1 = 0\\f$ for extrinsic rotations.\n     *\n     * As a result, for every Euler angles type, we can get solution as shown in the following table.\n     * EulerAnglesType  | Ordinary | \\f$\\theta_2 = π/2\\f$ | \\f$\\theta_2 = -π/2\\f$\n     * ------------- | -------------| -------------| -------------\n     * INT_XYZ|\\f$ \\theta_1 = \\arctan2(-m_{23},m_{33})\\\\\\theta_2 = \\arcsin(m_{13}) \\\\\\theta_3= \\arctan2(-m_{12},m_{11}) \\f$|\\f$ \\theta_1=\\arctan2(m_{21},m_{22})\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=0 \\f$|\\f$ \\theta_1=\\arctan2(m_{32},m_{22})\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=0 \\f$\n     * INT_XZY|\\f$ \\theta_1 = \\arctan2(m_{32},m_{22})\\\\\\theta_2 = -\\arcsin(m_{12}) \\\\\\theta_3= \\arctan2(m_{13},m_{11}) \\f$|\\f$ \\theta_1=\\arctan2(m_{31},m_{33})\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=0 \\f$|\\f$ \\theta_1=\\arctan2(-m_{23},m_{33})\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=0 \\f$\n     * INT_YXZ|\\f$ \\theta_1 = \\arctan2(m_{13},m_{33})\\\\\\theta_2 = -\\arcsin(m_{23}) \\\\\\theta_3= \\arctan2(m_{21},m_{22}) \\f$|\\f$ \\theta_1=\\arctan2(m_{12},m_{11})\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=0 \\f$|\\f$ \\theta_1=\\arctan2(-m_{12},m_{11})\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=0 \\f$\n     * INT_YZX|\\f$ \\theta_1 = \\arctan2(-m_{31},m_{11})\\\\\\theta_2 = \\arcsin(m_{21}) \\\\\\theta_3= \\arctan2(-m_{23},m_{22}) \\f$|\\f$ \\theta_1=\\arctan2(m_{13},m_{33})\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=0 \\f$|\\f$ \\theta_1=\\arctan2(m_{13},m_{12})\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=0 \\f$\n     * INT_ZXY|\\f$ \\theta_1 = \\arctan2(-m_{12},m_{22})\\\\\\theta_2 = \\arcsin(m_{32}) \\\\\\theta_3= \\arctan2(-m_{31},m_{33}) \\f$|\\f$ \\theta_1=\\arctan2(m_{21},m_{11})\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=0 \\f$|\\f$ \\theta_1=\\arctan2(m_{21},m_{11})\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=0 \\f$\n     * INT_ZYX|\\f$ \\theta_1 = \\arctan2(m_{21},m_{11})\\\\\\theta_2 = \\arcsin(-m_{31}) \\\\\\theta_3= \\arctan2(m_{32},m_{33}) \\f$|\\f$ \\theta_1=\\arctan2(m_{23},m_{22})\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=0 \\f$|\\f$ \\theta_1=\\arctan2(-m_{12},m_{22})\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=0 \\f$\n     * EXT_XYZ|\\f$ \\theta_1 = \\arctan2(m_{32},m_{33})\\\\\\theta_2 = \\arcsin(-m_{31}) \\\\\\ \\theta_3 = \\arctan2(m_{21},m_{11})\\f$|\\f$ \\theta_1= 0\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=\\arctan2(m_{23},m_{22}) \\f$|\\f$ \\theta_1=0\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=\\arctan2(-m_{12},m_{22}) \\f$\n     * EXT_XZY|\\f$ \\theta_1 = \\arctan2(-m_{23},m_{22})\\\\\\theta_2 = \\arcsin(m_{21}) \\\\\\theta_3=  \\arctan2(-m_{31},m_{11})\\f$|\\f$ \\theta_1= 0\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=\\arctan2(m_{13},m_{33}) \\f$|\\f$ \\theta_1=0\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=\\arctan2(m_{13},m_{12}) \\f$\n     * EXT_YXZ|\\f$ \\theta_1 = \\arctan2(-m_{31},m_{33}) \\\\\\theta_2 = \\arcsin(m_{32}) \\\\\\theta_3= \\arctan2(-m_{12},m_{22})\\f$|\\f$ \\theta_1= 0\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=\\arctan2(m_{21},m_{11}) \\f$|\\f$ \\theta_1=0\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=\\arctan2(m_{21},m_{11}) \\f$\n     * EXT_YZX|\\f$ \\theta_1 = \\arctan2(m_{13},m_{11})\\\\\\theta_2 = -\\arcsin(m_{12}) \\\\\\theta_3= \\arctan2(m_{32},m_{22})\\f$|\\f$ \\theta_1= 0\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=\\arctan2(m_{31},m_{33}) \\f$|\\f$ \\theta_1=0\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=\\arctan2(-m_{23},m_{33}) \\f$\n     * EXT_ZXY|\\f$ \\theta_1 = \\arctan2(m_{21},m_{22})\\\\\\theta_2 = -\\arcsin(m_{23}) \\\\\\theta_3= \\arctan2(m_{13},m_{33})\\f$|\\f$ \\theta_1= 0\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=\\arctan2(m_{12},m_{11}) \\f$|\\f$ \\theta_1= 0\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=\\arctan2(-m_{12},m_{11}) \\f$\n     * EXT_ZYX|\\f$ \\theta_1 = \\arctan2(-m_{12},m_{11})\\\\\\theta_2 = \\arcsin(m_{13}) \\\\\\theta_3= \\arctan2(-m_{23},m_{33})\\f$|\\f$ \\theta_1=0\\\\ \\theta_2=\\pi/2\\\\ \\theta_3=\\arctan2(m_{21},m_{22}) \\f$|\\f$ \\theta_1=0\\\\ \\theta_2=-\\pi/2\\\\ \\theta_3=\\arctan2(m_{32},m_{22}) \\f$\n     *\n     *  EulerAnglesType  | Ordinary | \\f$\\theta_2 = 0\\f$ | \\f$\\theta_2 = π\\f$\n     * ------------- | -------------| -------------| -------------\n     * INT_XYX| \\f$ \\theta_1 = \\arctan2(m_{21},-m_{31})\\\\\\theta_2 =\\arccos(m_{11}) \\\\\\theta_3 = \\arctan2(m_{12},m_{13}) \\f$| \\f$ \\theta_1=\\arctan2(m_{32},m_{33})\\\\ \\theta_2=0\\\\ \\theta_3=0 \\f$| \\f$ \\theta_1=\\arctan2(m_{23},m_{22})\\\\ \\theta_2=\\pi\\\\ \\theta_3=0 \\f$\n     * INT_XZX| \\f$ \\theta_1 = \\arctan2(m_{31},m_{21})\\\\\\theta_2 = \\arccos(m_{11}) \\\\\\theta_3 = \\arctan2(m_{13},-m_{12}) \\f$| \\f$ \\theta_1=\\arctan2(m_{32},m_{33})\\\\ \\theta_2=0\\\\ \\theta_3=0 \\f$| \\f$ \\theta_1=\\arctan2(-m_{32},m_{33})\\\\ \\theta_2=\\pi\\\\ \\theta_3=0 \\f$\n     * INT_YXY| \\f$ \\theta_1 = \\arctan2(m_{12},m_{32})\\\\\\theta_2 = \\arccos(m_{22}) \\\\\\theta_3 = \\arctan2(m_{21},-m_{23}) \\f$| \\f$ \\theta_1=\\arctan2(m_{13},m_{11})\\\\ \\theta_2=0\\\\ \\theta_3=0 \\f$| \\f$ \\theta_1=\\arctan2(-m_{31},m_{11})\\\\ \\theta_2=\\pi\\\\ \\theta_3=0 \\f$\n     * INT_YZY| \\f$ \\theta_1 = \\arctan2(m_{32},-m_{12})\\\\\\theta_2 = \\arccos(m_{22}) \\\\\\theta_3 =\\arctan2(m_{23},m_{21}) \\f$| \\f$ \\theta_1=\\arctan2(m_{13},m_{11})\\\\ \\theta_2=0\\\\ \\theta_3=0 \\f$| \\f$ \\theta_1=\\arctan2(m_{13},-m_{11})\\\\ \\theta_2=\\pi\\\\ \\theta_3=0 \\f$\n     * INT_ZXZ| \\f$ \\theta_1 = \\arctan2(-m_{13},m_{23})\\\\\\theta_2 = \\arccos(m_{33}) \\\\\\theta_3 =\\arctan2(m_{31},m_{32}) \\f$| \\f$ \\theta_1=\\arctan2(m_{21},m_{22})\\\\ \\theta_2=0\\\\ \\theta_3=0 \\f$| \\f$ \\theta_1=\\arctan2(m_{21},m_{11})\\\\ \\theta_2=\\pi\\\\ \\theta_3=0 \\f$\n     * INT_ZYZ| \\f$ \\theta_1 = \\arctan2(m_{23},m_{13})\\\\\\theta_2 = \\arccos(m_{33}) \\\\\\theta_3 = \\arctan2(m_{32},-m_{31}) \\f$| \\f$ \\theta_1=\\arctan2(m_{21},m_{11})\\\\ \\theta_2=0\\\\ \\theta_3=0 \\f$| \\f$ \\theta_1=\\arctan2(m_{21},m_{11})\\\\ \\theta_2=\\pi\\\\ \\theta_3=0 \\f$\n     * EXT_XYX| \\f$ \\theta_1 = \\arctan2(m_{12},m_{13}) \\\\\\theta_2 = \\arccos(m_{11}) \\\\\\theta_3 = \\arctan2(m_{21},-m_{31})\\f$| \\f$ \\theta_1=0\\\\ \\theta_2=0\\\\ \\theta_3=\\arctan2(m_{32},m_{33}) \\f$| \\f$ \\theta_1= 0\\\\ \\theta_2=\\pi\\\\ \\theta_3= \\arctan2(m_{23},m_{22}) \\f$\n     * EXT_XZX| \\f$ \\theta_1 = \\arctan2(m_{13},-m_{12})\\\\\\theta_2 = \\arccos(m_{11}) \\\\\\theta_3 = \\arctan2(m_{31},m_{21})\\f$| \\f$ \\theta_1= 0\\\\ \\theta_2=0\\\\ \\theta_3=\\arctan2(m_{32},m_{33}) \\f$| \\f$ \\theta_1= 0\\\\ \\theta_2=\\pi\\\\ \\theta_3=\\arctan2(-m_{32},m_{33}) \\f$\n     * EXT_YXY| \\f$ \\theta_1 = \\arctan2(m_{21},-m_{23})\\\\\\theta_2 = \\arccos(m_{22}) \\\\\\theta_3 = \\arctan2(m_{12},m_{32}) \\f$| \\f$ \\theta_1= 0\\\\ \\theta_2=0\\\\ \\theta_3=\\arctan2(m_{13},m_{11}) \\f$| \\f$ \\theta_1= 0\\\\ \\theta_2=\\pi\\\\ \\theta_3=\\arctan2(-m_{31},m_{11}) \\f$\n     * EXT_YZY| \\f$ \\theta_1 = \\arctan2(m_{23},m_{21}) \\\\\\theta_2 = \\arccos(m_{22}) \\\\\\theta_3 = \\arctan2(m_{32},-m_{12}) \\f$| \\f$ \\theta_1= 0\\\\ \\theta_2=0\\\\ \\theta_3=\\arctan2(m_{13},m_{11}) \\f$| \\f$ \\theta_1=0\\\\ \\theta_2=\\pi\\\\ \\theta_3=\\arctan2(m_{13},-m_{11}) \\f$\n     * EXT_ZXZ| \\f$ \\theta_1 = \\arctan2(m_{31},m_{32}) \\\\\\theta_2 = \\arccos(m_{33}) \\\\\\theta_3 = \\arctan2(-m_{13},m_{23})\\f$| \\f$ \\theta_1=0\\\\ \\theta_2=0\\\\ \\theta_3=\\arctan2(m_{21},m_{22}) \\f$| \\f$ \\theta_1= 0\\\\ \\theta_2=\\pi\\\\ \\theta_3=\\arctan2(m_{21},m_{11}) \\f$\n     * EXT_ZYZ| \\f$ \\theta_1 = \\arctan2(m_{32},-m_{31})\\\\\\theta_2 = \\arccos(m_{33}) \\\\\\theta_3 = \\arctan2(m_{23},m_{13}) \\f$| \\f$ \\theta_1=0\\\\ \\theta_2=0\\\\ \\theta_3=\\arctan2(m_{21},m_{11}) \\f$| \\f$ \\theta_1= 0\\\\ \\theta_2=\\pi\\\\ \\theta_3=\\arctan2(m_{21},m_{11}) \\f$\n     *\n     * @param eulerAnglesType the convertion Euler angles type\n     */\n\n    Vec<_Tp, 3> toEulerAngles(QuatEnum::EulerAnglesType eulerAnglesType);\n\n    _Tp w, x, y, z;\n\n};\n\ntemplate <typename T>\nQuat<T> inv(const Quat<T> &q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\ntemplate <typename T>\nQuat<T> sinh(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> cosh(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> tanh(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> sin(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> cos(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> tan(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> asinh(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> acosh(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> atanh(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> asin(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> acos(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> atan(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> power(const Quat<T> &q, const Quat<T> &p, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\ntemplate <typename T>\nQuat<T> exp(const Quat<T> &q);\n\ntemplate <typename T>\nQuat<T> log(const Quat<T> &q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\ntemplate <typename T>\nQuat<T> power(const Quat<T>& q, const T x, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\ntemplate <typename T>\nQuat<T> crossProduct(const Quat<T> &p, const Quat<T> &q);\n\ntemplate <typename S>\nQuat<S> sqrt(const Quat<S> &q, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT);\n\ntemplate <typename T>\nQuat<T> operator*(const T, const Quat<T>&);\n\ntemplate <typename T>\nQuat<T> operator*(const Quat<T>&, const T);\n\ntemplate <typename S>\nstd::ostream& operator<<(std::ostream&, const Quat<S>&);\n\nusing Quatd = Quat<double>;\nusing Quatf = Quat<float>;\n\n//! @} core\n}\n\n#include \"opencv2/core/quaternion.inl.hpp\"\n\n#endif /* OPENCV_CORE_QUATERNION_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/quaternion.inl.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2020, Huawei Technologies Co., Ltd. All rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//       http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// Author: Liangqian Kong <chargerKong@126.com>\n//         Longbu Wang <riskiest@gmail.com>\n\n#ifndef OPENCV_CORE_QUATERNION_INL_HPP\n#define OPENCV_CORE_QUATERNION_INL_HPP\n\n#ifndef OPENCV_CORE_QUATERNION_HPP\n#erorr This is not a standalone header. Include quaternion.hpp instead.\n#endif\n\n//@cond IGNORE\n///////////////////////////////////////////////////////////////////////////////////////\n//Implementation\nnamespace cv {\n\ntemplate <typename T>\nQuat<T>::Quat() : w(0), x(0), y(0), z(0) {}\n\ntemplate <typename T>\nQuat<T>::Quat(const Vec<T, 4> &coeff):w(coeff[0]), x(coeff[1]), y(coeff[2]), z(coeff[3]){}\n\ntemplate <typename T>\nQuat<T>::Quat(const T qw, const T qx, const T qy, const T qz):w(qw), x(qx), y(qy), z(qz){}\n\ntemplate <typename T>\nQuat<T> Quat<T>::createFromAngleAxis(const T angle, const Vec<T, 3> &axis)\n{\n    T w, x, y, z;\n    T vNorm = std::sqrt(axis.dot(axis));\n    if (vNorm < CV_QUAT_EPS)\n    {\n        CV_Error(Error::StsBadArg, \"this quaternion does not represent a rotation\");\n    }\n    const T angle_half = angle * 0.5;\n    w = std::cos(angle_half);\n    const T sin_v = std::sin(angle_half);\n    const T sin_norm = sin_v / vNorm;\n    x = sin_norm * axis[0];\n    y = sin_norm * axis[1];\n    z = sin_norm * axis[2];\n    return Quat<T>(w, x, y, z);\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::createFromRotMat(InputArray _R)\n{\n    CV_CheckTypeEQ(_R.type(), cv::traits::Type<T>::value, \"\");\n    if (_R.rows() != 3 || _R.cols() != 3)\n    {\n        CV_Error(Error::StsBadArg, \"Cannot convert matrix to quaternion: rotation matrix should be a 3x3 matrix\");\n    }\n    Matx<T, 3, 3> R;\n    _R.copyTo(R);\n\n    T S, w, x, y, z;\n    T trace = R(0, 0) + R(1, 1) + R(2, 2);\n    if (trace > 0)\n    {\n        S = std::sqrt(trace + 1) * 2;\n        x = (R(1, 2) - R(2, 1)) / S;\n        y = (R(2, 0) - R(0, 2)) / S;\n        z = (R(0, 1) - R(1, 0)) / S;\n        w = -0.25 * S;\n    }\n    else if (R(0, 0) > R(1, 1) && R(0, 0) > R(2, 2))\n    {\n\n        S = std::sqrt(1.0 + R(0, 0) - R(1, 1) - R(2, 2)) * 2;\n        x = -0.25 * S;\n        y = -(R(1, 0) + R(0, 1)) / S;\n        z = -(R(0, 2) + R(2, 0)) / S;\n        w = (R(1, 2) - R(2, 1)) / S;\n    }\n    else if (R(1, 1) > R(2, 2))\n    {\n        S = std::sqrt(1.0 - R(0, 0) + R(1, 1) - R(2, 2)) * 2;\n        x = (R(0, 1) + R(1, 0)) / S;\n        y = 0.25 * S;\n        z = (R(1, 2) + R(2, 1)) / S;\n        w = (R(0, 2) - R(2, 0)) / S;\n    }\n    else\n    {\n        S = std::sqrt(1.0 - R(0, 0) - R(1, 1) + R(2, 2)) * 2;\n        x = (R(0, 2) + R(2, 0)) / S;\n        y = (R(1, 2) + R(2, 1)) / S;\n        z = 0.25 * S;\n        w = -(R(0, 1) - R(1, 0)) / S;\n    }\n    return Quat<T> (w, x, y, z);\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::createFromRvec(InputArray _rvec)\n{\n    if (!((_rvec.cols() == 1 && _rvec.rows() == 3) || (_rvec.cols() == 3 && _rvec.rows() == 1))) {\n        CV_Error(Error::StsBadArg, \"Cannot convert rotation vector to quaternion: The length of rotation vector should be 3\");\n    }\n    Vec<T, 3> rvec;\n    _rvec.copyTo(rvec);\n    T psi = std::sqrt(rvec.dot(rvec));\n    if (abs(psi) < CV_QUAT_EPS) {\n        return Quat<T> (1, 0, 0, 0);\n    }\n    Vec<T, 3> axis = rvec / psi;\n    return createFromAngleAxis(psi, axis);\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::operator-() const\n{\n    return Quat<T>(-w, -x, -y, -z);\n}\n\n\ntemplate <typename T>\ninline bool Quat<T>::operator==(const Quat<T> &q) const\n{\n    return (abs(w - q.w) < CV_QUAT_EPS && abs(x - q.x) < CV_QUAT_EPS && abs(y - q.y) < CV_QUAT_EPS && abs(z - q.z) < CV_QUAT_EPS);\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::operator+(const Quat<T> &q1) const\n{\n    return Quat<T>(w + q1.w, x + q1.x, y + q1.y, z + q1.z);\n}\n\ntemplate <typename T>\ninline Quat<T> operator+(const T a, const Quat<T>& q)\n{\n    return Quat<T>(q.w + a, q.x, q.y, q.z);\n}\n\ntemplate <typename T>\ninline Quat<T> operator+(const Quat<T>& q, const T a)\n{\n    return Quat<T>(q.w + a, q.x, q.y, q.z);\n}\n\ntemplate <typename T>\ninline Quat<T> operator-(const T a, const Quat<T>& q)\n{\n    return Quat<T>(a - q.w, -q.x, -q.y, -q.z);\n}\n\ntemplate <typename T>\ninline Quat<T> operator-(const Quat<T>& q, const T a)\n{\n    return Quat<T>(q.w - a, q.x, q.y, q.z);\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::operator-(const Quat<T> &q1) const\n{\n    return Quat<T>(w - q1.w, x - q1.x, y - q1.y, z - q1.z);\n}\n\ntemplate <typename T>\ninline Quat<T>& Quat<T>::operator+=(const Quat<T> &q1)\n{\n    w += q1.w;\n    x += q1.x;\n    y += q1.y;\n    z += q1.z;\n    return *this;\n}\n\ntemplate <typename T>\ninline Quat<T>& Quat<T>::operator-=(const Quat<T> &q1)\n{\n    w -= q1.w;\n    x -= q1.x;\n    y -= q1.y;\n    z -= q1.z;\n    return *this;\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::operator*(const Quat<T> &q1) const\n{\n    Vec<T, 4> q{w, x, y, z};\n    Vec<T, 4> q2{q1.w, q1.x, q1.y, q1.z};\n    return Quat<T>(q * q2);\n}\n\n\ntemplate <typename T>\nQuat<T> operator*(const Quat<T> &q1, const T a)\n{\n    return Quat<T>(a * q1.w, a * q1.x, a * q1.y, a * q1.z);\n}\n\ntemplate <typename T>\nQuat<T> operator*(const T a, const Quat<T> &q1)\n{\n    return Quat<T>(a * q1.w, a * q1.x, a * q1.y, a * q1.z);\n}\n\ntemplate <typename T>\ninline Quat<T>& Quat<T>::operator*=(const Quat<T> &q1)\n{\n    T qw, qx, qy, qz;\n    qw = w * q1.w - x * q1.x - y * q1.y - z * q1.z;\n    qx = x * q1.w + w * q1.x + y * q1.z - z * q1.y;\n    qy = y * q1.w + w * q1.y + z * q1.x - x * q1.z;\n    qz = z * q1.w + w * q1.z + x * q1.y - y * q1.x;\n    w = qw;\n    x = qx;\n    y = qy;\n    z = qz;\n    return *this;\n}\n\ntemplate <typename T>\ninline Quat<T>& Quat<T>::operator/=(const Quat<T> &q1)\n{\n    Quat<T> q(*this * q1.inv());\n    w = q.w;\n    x = q.x;\n    y = q.y;\n    z = q.z;\n    return *this;\n}\ntemplate <typename T>\nQuat<T>& Quat<T>::operator*=(const T q1)\n{\n    w *= q1;\n    x *= q1;\n    y *= q1;\n    z *= q1;\n    return *this;\n}\n\ntemplate <typename T>\ninline Quat<T>& Quat<T>::operator/=(const T a)\n{\n    const T a_inv = 1.0 / a;\n    w *= a_inv;\n    x *= a_inv;\n    y *= a_inv;\n    z *= a_inv;\n    return *this;\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::operator/(const T a) const\n{\n    const T a_inv = 1.0 / a;\n    return Quat<T>(w * a_inv, x * a_inv, y * a_inv, z * a_inv);\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::operator/(const Quat<T> &q) const\n{\n    return *this * q.inv();\n}\n\ntemplate <typename T>\ninline const T& Quat<T>::operator[](std::size_t n) const\n{\n    switch (n) {\n        case 0:\n            return w;\n        case 1:\n            return x;\n        case 2:\n            return y;\n        case 3:\n            return z;\n        default:\n            CV_Error(Error::StsOutOfRange, \"subscript exceeds the index range\");\n    }\n}\n\ntemplate <typename T>\ninline T& Quat<T>::operator[](std::size_t n)\n{\n    switch (n) {\n        case 0:\n            return w;\n        case 1:\n            return x;\n        case 2:\n            return y;\n        case 3:\n            return z;\n        default:\n            CV_Error(Error::StsOutOfRange, \"subscript exceeds the index range\");\n    }\n}\n\ntemplate <typename T>\nstd::ostream & operator<<(std::ostream &os, const Quat<T> &q)\n{\n    os << \"Quat \" << Vec<T, 4>{q.w, q.x, q.y, q.z};\n    return os;\n}\n\ntemplate <typename T>\ninline T Quat<T>::at(size_t index) const\n{\n    return (*this)[index];\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::conjugate() const\n{\n    return Quat<T>(w, -x, -y, -z);\n}\n\ntemplate <typename T>\ninline T Quat<T>::norm() const\n{\n    return std::sqrt(dot(*this));\n}\n\ntemplate <typename T>\nQuat<T> exp(const Quat<T> &q)\n{\n    return q.exp();\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::exp() const\n{\n    Vec<T, 3> v{x, y, z};\n    T normV = std::sqrt(v.dot(v));\n    T k = normV < CV_QUAT_EPS ? 1 : std::sin(normV) / normV;\n    return std::exp(w) * Quat<T>(std::cos(normV), v[0] * k, v[1] * k, v[2] * k);\n}\n\ntemplate <typename T>\nQuat<T> log(const Quat<T> &q, QuatAssumeType assumeUnit)\n{\n    return q.log(assumeUnit);\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::log(QuatAssumeType assumeUnit) const\n{\n    Vec<T, 3> v{x, y, z};\n    T vNorm = std::sqrt(v.dot(v));\n    if (assumeUnit)\n    {\n        T k = vNorm < CV_QUAT_EPS ? 1 : std::acos(w) / vNorm;\n        return Quat<T>(0, v[0] * k, v[1] * k, v[2] * k);\n    }\n    T qNorm = norm();\n    if (qNorm < CV_QUAT_EPS)\n    {\n        CV_Error(Error::StsBadArg, \"Cannot apply this quaternion to log function: undefined\");\n    }\n    T k = vNorm < CV_QUAT_EPS ? 1 : std::acos(w / qNorm) / vNorm;\n    return Quat<T>(std::log(qNorm), v[0] * k, v[1] * k, v[2] *k);\n}\n\ntemplate <typename T>\ninline Quat<T> power(const Quat<T> &q1, const T alpha, QuatAssumeType assumeUnit)\n{\n    return q1.power(alpha, assumeUnit);\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::power(const T alpha, QuatAssumeType assumeUnit) const\n{\n    if (x * x + y * y + z * z > CV_QUAT_EPS)\n    {\n        T angle = getAngle(assumeUnit);\n        Vec<T, 3> axis = getAxis(assumeUnit);\n        if (assumeUnit)\n        {\n            return createFromAngleAxis(alpha * angle, axis);\n        }\n        return std::pow(norm(), alpha) * createFromAngleAxis(alpha * angle, axis);\n    }\n    else\n    {\n        return std::pow(norm(), alpha) * Quat<T>(w, x, y, z);\n    }\n}\n\n\ntemplate <typename T>\ninline Quat<T> sqrt(const Quat<T> &q, QuatAssumeType assumeUnit)\n{\n    return q.sqrt(assumeUnit);\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::sqrt(QuatAssumeType assumeUnit) const\n{\n    return power(0.5, assumeUnit);\n}\n\n\ntemplate <typename T>\ninline Quat<T> power(const Quat<T> &p, const Quat<T> &q, QuatAssumeType assumeUnit)\n{\n    return p.power(q, assumeUnit);\n}\n\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::power(const Quat<T> &q, QuatAssumeType assumeUnit) const\n{\n    return cv::exp(q * log(assumeUnit));\n}\n\ntemplate <typename T>\ninline T Quat<T>::dot(Quat<T> q1) const\n{\n    return w * q1.w + x * q1.x + y * q1.y + z * q1.z;\n}\n\n\ntemplate <typename T>\ninline Quat<T> crossProduct(const Quat<T> &p, const Quat<T> &q)\n{\n    return p.crossProduct(q);\n}\n\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::crossProduct(const Quat<T> &q) const\n{\n    return Quat<T> (0, y * q.z - z * q.y, z * q.x - x * q.z, x * q.y - q.x * y);\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::normalize() const\n{\n    T normVal = norm();\n    if (normVal < CV_QUAT_EPS)\n    {\n        CV_Error(Error::StsBadArg, \"Cannot normalize this quaternion: the norm is too small.\");\n    }\n    return Quat<T>(w / normVal, x / normVal, y / normVal, z / normVal) ;\n}\n\ntemplate <typename T>\ninline Quat<T> inv(const Quat<T> &q, QuatAssumeType assumeUnit)\n{\n    return q.inv(assumeUnit);\n}\n\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::inv(QuatAssumeType assumeUnit) const\n{\n    if (assumeUnit)\n    {\n        return conjugate();\n    }\n    T norm2 = dot(*this);\n    if (norm2 < CV_QUAT_EPS)\n    {\n        CV_Error(Error::StsBadArg, \"This quaternion do not have inverse quaternion\");\n    }\n    return conjugate() / norm2;\n}\n\ntemplate <typename T>\ninline Quat<T> sinh(const Quat<T> &q)\n{\n    return q.sinh();\n}\n\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::sinh() const\n{\n    Vec<T, 3> v{x, y ,z};\n    T vNorm = std::sqrt(v.dot(v));\n    T k = vNorm < CV_QUAT_EPS ? 1 : std::cosh(w) * std::sin(vNorm) / vNorm;\n    return Quat<T>(std::sinh(w) * std::cos(vNorm), v[0] * k, v[1] * k, v[2] * k);\n}\n\n\ntemplate <typename T>\ninline Quat<T> cosh(const Quat<T> &q)\n{\n    return q.cosh();\n}\n\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::cosh() const\n{\n    Vec<T, 3> v{x, y ,z};\n    T vNorm = std::sqrt(v.dot(v));\n    T k = vNorm < CV_QUAT_EPS ? 1 : std::sinh(w) * std::sin(vNorm) / vNorm;\n    return Quat<T>(std::cosh(w) * std::cos(vNorm), v[0] * k, v[1] * k, v[2] * k);\n}\n\ntemplate <typename T>\ninline Quat<T> tanh(const Quat<T> &q)\n{\n    return q.tanh();\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::tanh() const\n{\n    return sinh() * cosh().inv();\n}\n\n\ntemplate <typename T>\ninline Quat<T> sin(const Quat<T> &q)\n{\n    return q.sin();\n}\n\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::sin() const\n{\n    Vec<T, 3> v{x, y ,z};\n    T vNorm = std::sqrt(v.dot(v));\n    T k = vNorm < CV_QUAT_EPS ? 1 : std::cos(w) * std::sinh(vNorm) / vNorm;\n    return Quat<T>(std::sin(w) * std::cosh(vNorm), v[0] * k, v[1] * k, v[2] * k);\n}\n\ntemplate <typename T>\ninline Quat<T> cos(const Quat<T> &q)\n{\n    return q.cos();\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::cos() const\n{\n    Vec<T, 3> v{x, y ,z};\n    T vNorm = std::sqrt(v.dot(v));\n    T k = vNorm < CV_QUAT_EPS ? 1 : std::sin(w) * std::sinh(vNorm) / vNorm;\n    return Quat<T>(std::cos(w) * std::cosh(vNorm), -v[0] * k, -v[1] * k, -v[2] * k);\n}\n\ntemplate <typename T>\ninline Quat<T> tan(const Quat<T> &q)\n{\n    return q.tan();\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::tan() const\n{\n    return sin() * cos().inv();\n}\n\ntemplate <typename T>\ninline Quat<T> asinh(const Quat<T> &q)\n{\n    return q.asinh();\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::asinh() const\n{\n    return cv::log(*this + cv::power(*this * *this + Quat<T>(1, 0, 0, 0), 0.5));\n}\n\ntemplate <typename T>\ninline Quat<T> acosh(const Quat<T> &q)\n{\n    return q.acosh();\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::acosh() const\n{\n    return cv::log(*this + cv::power(*this * *this - Quat<T>(1,0,0,0), 0.5));\n}\n\ntemplate <typename T>\ninline Quat<T> atanh(const Quat<T> &q)\n{\n    return q.atanh();\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::atanh() const\n{\n    Quat<T> ident(1, 0, 0, 0);\n    Quat<T> c1 = (ident + *this).log();\n    Quat<T> c2 = (ident - *this).log();\n    return 0.5 * (c1 - c2);\n}\n\ntemplate <typename T>\ninline Quat<T> asin(const Quat<T> &q)\n{\n    return q.asin();\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::asin() const\n{\n    Quat<T> v(0, x, y, z);\n    T vNorm = v.norm();\n    T k = vNorm < CV_QUAT_EPS ? 1 : vNorm;\n    return -v / k * (*this * v / k).asinh();\n}\n\ntemplate <typename T>\ninline Quat<T> acos(const Quat<T> &q)\n{\n    return q.acos();\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::acos() const\n{\n    Quat<T> v(0, x, y, z);\n    T vNorm = v.norm();\n    T k = vNorm < CV_QUAT_EPS ? 1 : vNorm;\n    return -v / k * acosh();\n}\n\ntemplate <typename T>\ninline Quat<T> atan(const Quat<T> &q)\n{\n    return q.atan();\n}\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::atan() const\n{\n    Quat<T> v(0, x, y, z);\n    T vNorm = v.norm();\n    T k = vNorm < CV_QUAT_EPS ? 1 : vNorm;\n    return -v / k * (*this * v / k).atanh();\n}\n\ntemplate <typename T>\ninline T Quat<T>::getAngle(QuatAssumeType assumeUnit) const\n{\n    if (assumeUnit)\n    {\n        return 2 * std::acos(w);\n    }\n    if (norm() < CV_QUAT_EPS)\n    {\n        CV_Error(Error::StsBadArg, \"This quaternion does not represent a rotation\");\n    }\n    return 2 * std::acos(w / norm());\n}\n\ntemplate <typename T>\ninline Vec<T, 3> Quat<T>::getAxis(QuatAssumeType assumeUnit) const\n{\n    T angle = getAngle(assumeUnit);\n    const T sin_v = std::sin(angle * 0.5);\n    if (assumeUnit)\n    {\n        return Vec<T, 3>{x, y, z} / sin_v;\n    }\n    return Vec<T, 3> {x, y, z} / (norm() * sin_v);\n}\n\ntemplate <typename T>\nMatx<T, 4, 4> Quat<T>::toRotMat4x4(QuatAssumeType assumeUnit) const\n{\n    T a = w, b = x, c = y, d = z;\n    if (!assumeUnit)\n    {\n        Quat<T> qTemp = normalize();\n        a = qTemp.w;\n        b = qTemp.x;\n        c = qTemp.y;\n        d = qTemp.z;\n    }\n    Matx<T, 4, 4> R{\n        1 - 2 * (c * c + d * d), 2 * (b * c - a * d)    , 2 * (b * d + a * c)    , 0,\n        2 * (b * c + a * d)    , 1 - 2 * (b * b + d * d), 2 * (c * d - a * b)    , 0,\n        2 * (b * d - a * c)    , 2 * (c * d + a * b)    , 1 - 2 * (b * b + c * c), 0,\n        0                      , 0                      , 0                      , 1,\n    };\n    return R;\n}\n\ntemplate <typename T>\nMatx<T, 3, 3> Quat<T>::toRotMat3x3(QuatAssumeType assumeUnit) const\n{\n    T a = w, b = x, c = y, d = z;\n    if (!assumeUnit)\n    {\n        Quat<T> qTemp = normalize();\n        a = qTemp.w;\n        b = qTemp.x;\n        c = qTemp.y;\n        d = qTemp.z;\n    }\n    Matx<T, 3, 3> R{\n        1 - 2 * (c * c + d * d), 2 * (b * c - a * d)    , 2 * (b * d + a * c),\n        2 * (b * c + a * d)    , 1 - 2 * (b * b + d * d), 2 * (c * d - a * b),\n        2 * (b * d - a * c)    , 2 * (c * d + a * b)    , 1 - 2 * (b * b + c * c)\n    };\n    return R;\n}\n\ntemplate <typename T>\nVec<T, 3> Quat<T>::toRotVec(QuatAssumeType assumeUnit) const\n{\n    T angle = getAngle(assumeUnit);\n    Vec<T, 3> axis = getAxis(assumeUnit);\n    return angle * axis;\n}\n\ntemplate <typename T>\nVec<T, 4> Quat<T>::toVec() const\n{\n    return Vec<T, 4>{w, x, y, z};\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::lerp(const Quat<T> &q0, const Quat<T> &q1, const T t)\n{\n    return (1 - t) * q0 + t * q1;\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::slerp(const Quat<T> &q0, const Quat<T> &q1, const T t, QuatAssumeType assumeUnit, bool directChange)\n{\n    Quatd v0(q0);\n    Quatd v1(q1);\n    if (!assumeUnit)\n    {\n        v0 = v0.normalize();\n        v1 = v1.normalize();\n    }\n    T cosTheta = v0.dot(v1);\n    constexpr T DOT_THRESHOLD = 0.995;\n    if (cosTheta > DOT_THRESHOLD)\n    {\n        return nlerp(v0, v1, t, QUAT_ASSUME_UNIT);\n    }\n\n    if (directChange && cosTheta < 0)\n    {\n        v0 = -v0;\n        cosTheta = -cosTheta;\n    }\n    T sinTheta = std::sqrt(1 - cosTheta * cosTheta);\n    T angle = atan2(sinTheta, cosTheta);\n    return (std::sin((1 - t) * angle) / (sinTheta) * v0 + std::sin(t * angle) / (sinTheta) * v1).normalize();\n}\n\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::nlerp(const Quat<T> &q0, const Quat<T> &q1, const T t, QuatAssumeType assumeUnit)\n{\n    Quat<T> v0(q0), v1(q1);\n    if (v1.dot(v0) < 0)\n    {\n        v0 = -v0;\n    }\n    if (assumeUnit)\n    {\n        return ((1 - t) * v0 + t * v1).normalize();\n    }\n    v0 = v0.normalize();\n    v1 = v1.normalize();\n    return ((1 - t) * v0 + t * v1).normalize();\n}\n\n\ntemplate <typename T>\ninline bool Quat<T>::isNormal(T eps) const\n{\n\n    double normVar = norm();\n    if ((normVar > 1 - eps) && (normVar < 1 + eps))\n        return true;\n    return false;\n}\n\ntemplate <typename T>\ninline void Quat<T>::assertNormal(T eps) const\n{\n    if (!isNormal(eps))\n        CV_Error(Error::StsBadArg, \"Quaternion should be normalized\");\n}\n\n\ntemplate <typename T>\ninline Quat<T> Quat<T>::squad(const Quat<T> &q0, const Quat<T> &q1,\n                            const Quat<T> &q2, const Quat<T> &q3,\n                            const T t, QuatAssumeType assumeUnit,\n                            bool directChange)\n{\n    Quat<T> v0(q0), v1(q1), v2(q2), v3(q3);\n    if (!assumeUnit)\n    {\n        v0 = v0.normalize();\n        v1 = v1.normalize();\n        v2 = v2.normalize();\n        v3 = v3.normalize();\n    }\n\n    Quat<T> c0 = slerp(v0, v3, t, assumeUnit, directChange);\n    Quat<T> c1 = slerp(v1, v2, t, assumeUnit, directChange);\n    return slerp(c0, c1, 2 * t * (1 - t), assumeUnit, directChange);\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::interPoint(const Quat<T> &q0, const Quat<T> &q1,\n                            const Quat<T> &q2, QuatAssumeType assumeUnit)\n{\n    Quat<T> v0(q0), v1(q1), v2(q2);\n    if (!assumeUnit)\n    {\n        v0 = v0.normalize();\n        v1 = v1.normalize();\n        v2 = v2.normalize();\n    }\n    return v1 * cv::exp(-(cv::log(v1.conjugate() * v0, assumeUnit) + (cv::log(v1.conjugate() * v2, assumeUnit))) / 4);\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::spline(const Quat<T> &q0, const Quat<T> &q1, const Quat<T> &q2, const Quat<T> &q3, const T t, QuatAssumeType assumeUnit)\n{\n    Quatd v0(q0), v1(q1), v2(q2), v3(q3);\n    if (!assumeUnit)\n    {\n        v0 = v0.normalize();\n        v1 = v1.normalize();\n        v2 = v2.normalize();\n        v3 = v3.normalize();\n    }\n    T cosTheta;\n    std::vector<Quat<T>> vec{v0, v1, v2, v3};\n    for (size_t i = 0; i < 3; ++i)\n    {\n        cosTheta = vec[i].dot(vec[i + 1]);\n        if (cosTheta < 0)\n        {\n            vec[i + 1] = -vec[i + 1];\n        }\n    }\n    Quat<T> s1 = interPoint(vec[0], vec[1], vec[2], QUAT_ASSUME_UNIT);\n    Quat<T> s2 = interPoint(vec[1], vec[2], vec[3], QUAT_ASSUME_UNIT);\n    return squad(vec[1], s1, s2, vec[2], t, assumeUnit, QUAT_ASSUME_NOT_UNIT);\n}\n\nnamespace detail {\n\ntemplate <typename T> static\nQuat<T> createFromAxisRot(int axis, const T theta)\n{\n    if (axis == 0)\n        return Quat<T>::createFromXRot(theta);\n    if (axis == 1)\n        return Quat<T>::createFromYRot(theta);\n    if (axis == 2)\n        return Quat<T>::createFromZRot(theta);\n    CV_Assert(0);\n}\n\ninline bool isIntAngleType(QuatEnum::EulerAnglesType eulerAnglesType)\n{\n    return eulerAnglesType < QuatEnum::EXT_XYZ;\n}\n\ninline bool isTaitBryan(QuatEnum::EulerAnglesType eulerAnglesType)\n{\n    return eulerAnglesType/6 == 1 || eulerAnglesType/6 == 3;\n}\n}  // namespace detail\n\ntemplate <typename T>\nQuat<T> Quat<T>::createFromYRot(const T theta)\n{\n    return Quat<T>{std::cos(theta * 0.5f), 0, std::sin(theta * 0.5f), 0};\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::createFromXRot(const T theta){\n    return Quat<T>{std::cos(theta * 0.5f), std::sin(theta * 0.5f), 0, 0};\n}\n\ntemplate <typename T>\nQuat<T> Quat<T>::createFromZRot(const T theta){\n    return Quat<T>{std::cos(theta * 0.5f), 0, 0, std::sin(theta * 0.5f)};\n}\n\n\ntemplate <typename T>\nQuat<T> Quat<T>::createFromEulerAngles(const Vec<T, 3> &angles, QuatEnum::EulerAnglesType eulerAnglesType) {\n    CV_Assert(eulerAnglesType < QuatEnum::EulerAnglesType::EULER_ANGLES_MAX_VALUE);\n    static const int rotationAxis[24][3] = {\n        {0, 1, 2}, ///< Intrinsic rotations with the Euler angles type X-Y-Z\n        {0, 2, 1}, ///< Intrinsic rotations with the Euler angles type X-Z-Y\n        {1, 0, 2}, ///< Intrinsic rotations with the Euler angles type Y-X-Z\n        {1, 2, 0}, ///< Intrinsic rotations with the Euler angles type Y-Z-X\n        {2, 0, 1}, ///< Intrinsic rotations with the Euler angles type Z-X-Y\n        {2, 1, 0}, ///< Intrinsic rotations with the Euler angles type Z-Y-X\n        {0, 1, 0}, ///< Intrinsic rotations with the Euler angles type X-Y-X\n        {0, 2, 0}, ///< Intrinsic rotations with the Euler angles type X-Z-X\n        {1, 0, 1}, ///< Intrinsic rotations with the Euler angles type Y-X-Y\n        {1, 2, 1}, ///< Intrinsic rotations with the Euler angles type Y-Z-Y\n        {2, 0, 2}, ///< Intrinsic rotations with the Euler angles type Z-X-Z\n        {2, 1, 2}, ///< Intrinsic rotations with the Euler angles type Z-Y-Z\n        {0, 1, 2}, ///< Extrinsic rotations with the Euler angles type X-Y-Z\n        {0, 2, 1}, ///< Extrinsic rotations with the Euler angles type X-Z-Y\n        {1, 0, 2}, ///< Extrinsic rotations with the Euler angles type Y-X-Z\n        {1, 2, 0}, ///< Extrinsic rotations with the Euler angles type Y-Z-X\n        {2, 0, 1}, ///< Extrinsic rotations with the Euler angles type Z-X-Y\n        {2, 1, 0}, ///< Extrinsic rotations with the Euler angles type Z-Y-X\n        {0, 1, 0}, ///< Extrinsic rotations with the Euler angles type X-Y-X\n        {0, 2, 0}, ///< Extrinsic rotations with the Euler angles type X-Z-X\n        {1, 0, 1}, ///< Extrinsic rotations with the Euler angles type Y-X-Y\n        {1, 2, 1}, ///< Extrinsic rotations with the Euler angles type Y-Z-Y\n        {2, 0, 2}, ///< Extrinsic rotations with the Euler angles type Z-X-Z\n        {2, 1, 2}  ///< Extrinsic rotations with the Euler angles type Z-Y-Z\n    };\n    Quat<T> q1 = detail::createFromAxisRot(rotationAxis[eulerAnglesType][0], angles(0));\n    Quat<T> q2 = detail::createFromAxisRot(rotationAxis[eulerAnglesType][1], angles(1));\n    Quat<T> q3 = detail::createFromAxisRot(rotationAxis[eulerAnglesType][2], angles(2));\n    if (detail::isIntAngleType(eulerAnglesType))\n    {\n        return q1 * q2 * q3;\n    }\n    else // (!detail::isIntAngleType<T>(eulerAnglesType))\n    {\n        return q3 * q2 * q1;\n    }\n}\n\ntemplate <typename T>\nVec<T, 3> Quat<T>::toEulerAngles(QuatEnum::EulerAnglesType eulerAnglesType){\n    CV_Assert(eulerAnglesType < QuatEnum::EulerAnglesType::EULER_ANGLES_MAX_VALUE);\n    Matx33d R = toRotMat3x3();\n    enum {\n        C_ZERO,\n        C_PI,\n        C_PI_2,\n        N_CONSTANTS,\n        R_0_0 = N_CONSTANTS, R_0_1, R_0_2,\n        R_1_0, R_1_1, R_1_2,\n        R_2_0, R_2_1, R_2_2\n    };\n    static const T constants_[N_CONSTANTS] = {\n        0,  // C_ZERO\n        (T)CV_PI,  // C_PI\n        (T)(CV_PI * 0.5)  // C_PI_2, -C_PI_2\n    };\n    static const int rotationR_[24][12] = {\n        {+R_0_2,    +R_1_0, +R_1_1, C_PI_2,     +R_2_1, +R_1_1, -C_PI_2,    -R_1_2, +R_2_2,    +R_0_2,    -R_0_1, +R_0_0},  // INT_XYZ\n        {+R_0_1,    -R_1_2, +R_2_2, -C_PI_2,    +R_2_0, +R_2_2, C_PI_2,     +R_2_1, +R_1_1,    -R_0_1,    +R_0_2, +R_0_0},  // INT_XZY\n        {+R_1_2,    -R_0_1, +R_0_0, -C_PI_2,    +R_0_1, +R_0_0, C_PI_2,     +R_0_2, +R_2_2,    -R_1_2,    +R_1_0, +R_1_1},  // INT_YXZ\n        {+R_1_0,    +R_0_2, +R_2_2, C_PI_2,     +R_0_2, +R_0_1, -C_PI_2,    -R_2_0, +R_0_0,    +R_1_0,    -R_1_2, +R_1_1},  // INT_YZX\n        {+R_2_1,    +R_1_0, +R_0_0, C_PI_2,     +R_1_0, +R_0_0, -C_PI_2,    -R_0_1, +R_1_1,    +R_2_1,    -R_2_0, +R_2_2},  // INT_ZXY\n        {+R_2_0,    -R_0_1, +R_1_1, -C_PI_2,    +R_1_2, +R_1_1, C_PI_2,     +R_1_0, +R_0_0,    -R_2_0,    +R_2_1, +R_2_2},  // INT_ZYX\n        {+R_0_0,    +R_2_1, +R_2_2, C_ZERO,     +R_1_2, +R_1_1, C_PI,       +R_1_0, -R_2_0,    +R_0_0,    +R_0_1, +R_0_2},  // INT_XYX\n        {+R_0_0,    +R_2_1, +R_2_2, C_ZERO,     -R_2_1, +R_2_2, C_PI,       +R_2_0, +R_1_0,    +R_0_0,    +R_0_2, -R_0_1},  // INT_XZX\n        {+R_1_1,    +R_0_2, +R_0_0, C_ZERO,     -R_2_0, +R_0_0, C_PI,       +R_0_1, +R_2_1,    +R_1_1,    +R_1_0, -R_1_2},  // INT_YXY\n        {+R_1_1,    +R_0_2, +R_0_0, C_ZERO,     +R_0_2, -R_0_0, C_PI,       +R_2_1, -R_0_1,    +R_1_1,    +R_1_2, +R_1_0},  // INT_YZY\n        {+R_2_2,    +R_1_0, +R_1_1, C_ZERO,     +R_1_0, +R_0_0, C_PI,       +R_0_2, -R_1_2,    +R_2_2,    +R_2_0, +R_2_1},  // INT_ZXZ\n        {+R_2_2,    +R_1_0, +R_0_0, C_ZERO,     +R_1_0, +R_0_0, C_PI,       +R_1_2, +R_0_2,    +R_2_2,    +R_2_1, -R_2_0},  // INT_ZYZ\n\n        {+R_2_0,    -C_PI_2, -R_0_1, +R_1_1,    C_PI_2,  +R_1_2, +R_1_1,    +R_2_1, +R_2_2,    -R_2_0,    +R_1_0, +R_0_0},  // EXT_XYZ\n        {+R_1_0,    C_PI_2,  +R_0_2, +R_2_2,    -C_PI_2, +R_0_2, +R_0_1,    -R_1_2, +R_1_1,    +R_1_0,    -R_2_0, +R_0_0},  // EXT_XZY\n        {+R_2_1,    C_PI_2,  +R_1_0, +R_0_0,    -C_PI_2, +R_1_0, +R_0_0,    -R_2_0, +R_2_2,    +R_2_1,    -R_0_1, +R_1_1},  // EXT_YXZ\n        {+R_0_2,    -C_PI_2, -R_1_2, +R_2_2,    C_PI_2,  +R_2_0, +R_2_2,    +R_0_2, +R_0_0,    -R_0_1,    +R_2_1, +R_1_1},  // EXT_YZX\n        {+R_1_2,    -C_PI_2, -R_0_1, +R_0_0,    C_PI_2,  +R_0_1, +R_0_0,    +R_1_0, +R_1_1,    -R_1_2,    +R_0_2, +R_2_2},  // EXT_ZXY\n        {+R_0_2,    C_PI_2,  +R_1_0, +R_1_1,    -C_PI_2, +R_2_1, +R_1_1,    -R_0_1, +R_0_0,    +R_0_2,    -R_1_2, +R_2_2},  // EXT_ZYX\n        {+R_0_0,    C_ZERO,  +R_2_1, +R_2_2,    C_PI,    +R_1_2, +R_1_1,    +R_0_1, +R_0_2,    +R_0_0,    +R_1_0, -R_2_0},  // EXT_XYX\n        {+R_0_0,    C_ZERO,  +R_2_1, +R_2_2,    C_PI,    +R_2_1, +R_2_2,    +R_0_2, -R_0_1,    +R_0_0,    +R_2_0, +R_1_0},  // EXT_XZX\n        {+R_1_1,    C_ZERO,  +R_0_2, +R_0_0,    C_PI,    -R_2_0, +R_0_0,    +R_1_0, -R_1_2,    +R_1_1,    +R_0_1, +R_2_1},  // EXT_YXY\n        {+R_1_1,    C_ZERO,  +R_0_2, +R_0_0,    C_PI,    +R_0_2, -R_0_0,    +R_1_2, +R_1_0,    +R_1_1,    +R_2_1, -R_0_1},  // EXT_YZY\n        {+R_2_2,    C_ZERO,  +R_1_0, +R_1_1,    C_PI,    +R_1_0, +R_0_0,    +R_2_0, +R_2_1,    +R_2_2,    +R_0_2, -R_1_2},  // EXT_ZXZ\n        {+R_2_2,    C_ZERO,  +R_1_0, +R_0_0,    C_PI,    +R_1_0, +R_0_0,    +R_2_1, -R_2_0,    +R_2_2,    +R_1_2, +R_0_2},  // EXT_ZYZ\n    };\n    T rotationR[12];\n    for (int i = 0; i < 12; i++)\n    {\n        int id = rotationR_[eulerAnglesType][i];\n        unsigned idx = std::abs(id);\n        T value = 0.0f;\n        if (idx < N_CONSTANTS)\n        {\n            value = constants_[idx];\n        }\n        else\n        {\n            unsigned r_idx = idx - N_CONSTANTS;\n            CV_DbgAssert(r_idx < 9);\n            value = R.val[r_idx];\n        }\n        bool isNegative = id < 0;\n        if (isNegative)\n            value = -value;\n        rotationR[i] = value;\n    }\n    Vec<T, 3> angles;\n    if (detail::isIntAngleType(eulerAnglesType))\n    {\n        if (abs(rotationR[0] - 1) < CV_QUAT_CONVERT_THRESHOLD)\n        {\n            CV_LOG_WARNING(NULL,\"Gimbal Lock occurs. Euler angles are non-unique, we set the third angle to 0\");\n            angles = {std::atan2(rotationR[1], rotationR[2]), rotationR[3], 0};\n            return angles;\n        }\n        else if(abs(rotationR[0] + 1) < CV_QUAT_CONVERT_THRESHOLD)\n        {\n            CV_LOG_WARNING(NULL,\"Gimbal Lock occurs. Euler angles are non-unique, we set the third angle to 0\");\n            angles = {std::atan2(rotationR[4], rotationR[5]), rotationR[6], 0};\n            return angles;\n        }\n    }\n    else // (!detail::isIntAngleType<T>(eulerAnglesType))\n    {\n        if (abs(rotationR[0] - 1) < CV_QUAT_CONVERT_THRESHOLD)\n        {\n            CV_LOG_WARNING(NULL,\"Gimbal Lock occurs. Euler angles are non-unique, we set the first angle to 0\");\n            angles = {0, rotationR[1], std::atan2(rotationR[2], rotationR[3])};\n            return angles;\n        }\n        else if (abs(rotationR[0] + 1) < CV_QUAT_CONVERT_THRESHOLD)\n        {\n            CV_LOG_WARNING(NULL,\"Gimbal Lock occurs. Euler angles are non-unique, we set the first angle to 0\");\n            angles = {0, rotationR[4], std::atan2(rotationR[5], rotationR[6])};\n            return angles;\n        }\n    }\n\n    angles(0) = std::atan2(rotationR[7], rotationR[8]);\n    if (detail::isTaitBryan(eulerAnglesType))\n        angles(1) = std::acos(rotationR[9]);\n    else\n        angles(1) = std::asin(rotationR[9]);\n    angles(2) = std::atan2(rotationR[10], rotationR[11]);\n    return angles;\n}\n\n}  // namepsace\n//! @endcond\n\n#endif /*OPENCV_CORE_QUATERNION_INL_HPP*/\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/saturate.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2014, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_SATURATE_HPP\n#define OPENCV_CORE_SATURATE_HPP\n\n#include \"opencv2/core/cvdef.h\"\n#include \"opencv2/core/fast_math.hpp\"\n\nnamespace cv\n{\n\n//! @addtogroup core_utils\n//! @{\n\n/////////////// saturate_cast (used in image & signal processing) ///////////////////\n\n/** @brief Template function for accurate conversion from one primitive type to another.\n\n The function saturate_cast resembles the standard C++ cast operations, such as static_cast\\<T\\>()\n and others. It perform an efficient and accurate conversion from one primitive type to another\n (see the introduction chapter). saturate in the name means that when the input value v is out of the\n range of the target type, the result is not formed just by taking low bits of the input, but instead\n the value is clipped. For example:\n @code\n uchar a = saturate_cast<uchar>(-100); // a = 0 (UCHAR_MIN)\n short b = saturate_cast<short>(33333.33333); // b = 32767 (SHRT_MAX)\n @endcode\n Such clipping is done when the target type is unsigned char , signed char , unsigned short or\n signed short . For 32-bit integers, no clipping is done.\n\n When the parameter is a floating-point value and the target type is an integer (8-, 16- or 32-bit),\n the floating-point value is first rounded to the nearest integer and then clipped if needed (when\n the target type is 8- or 16-bit).\n\n @param v Function parameter.\n @sa add, subtract, multiply, divide, Mat::convertTo\n */\ntemplate<typename _Tp> static inline _Tp saturate_cast(uchar v)    { return _Tp(v); }\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(schar v)    { return _Tp(v); }\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(ushort v)   { return _Tp(v); }\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(short v)    { return _Tp(v); }\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(unsigned v) { return _Tp(v); }\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(int v)      { return _Tp(v); }\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(float v)    { return _Tp(v); }\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(double v)   { return _Tp(v); }\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(int64 v)    { return _Tp(v); }\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(uint64 v)   { return _Tp(v); }\n\ntemplate<> inline uchar saturate_cast<uchar>(schar v)        { return (uchar)std::max((int)v, 0); }\ntemplate<> inline uchar saturate_cast<uchar>(ushort v)       { return (uchar)std::min((unsigned)v, (unsigned)UCHAR_MAX); }\ntemplate<> inline uchar saturate_cast<uchar>(int v)          { return (uchar)((unsigned)v <= UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); }\ntemplate<> inline uchar saturate_cast<uchar>(short v)        { return saturate_cast<uchar>((int)v); }\ntemplate<> inline uchar saturate_cast<uchar>(unsigned v)     { return (uchar)std::min(v, (unsigned)UCHAR_MAX); }\ntemplate<> inline uchar saturate_cast<uchar>(float v)        { int iv = cvRound(v); return saturate_cast<uchar>(iv); }\ntemplate<> inline uchar saturate_cast<uchar>(double v)       { int iv = cvRound(v); return saturate_cast<uchar>(iv); }\ntemplate<> inline uchar saturate_cast<uchar>(int64 v)        { return (uchar)((uint64)v <= (uint64)UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); }\ntemplate<> inline uchar saturate_cast<uchar>(uint64 v)       { return (uchar)std::min(v, (uint64)UCHAR_MAX); }\n\ntemplate<> inline schar saturate_cast<schar>(uchar v)        { return (schar)std::min((int)v, SCHAR_MAX); }\ntemplate<> inline schar saturate_cast<schar>(ushort v)       { return (schar)std::min((unsigned)v, (unsigned)SCHAR_MAX); }\ntemplate<> inline schar saturate_cast<schar>(int v)          { return (schar)((unsigned)(v-SCHAR_MIN) <= (unsigned)UCHAR_MAX ? v : v > 0 ? SCHAR_MAX : SCHAR_MIN); }\ntemplate<> inline schar saturate_cast<schar>(short v)        { return saturate_cast<schar>((int)v); }\ntemplate<> inline schar saturate_cast<schar>(unsigned v)     { return (schar)std::min(v, (unsigned)SCHAR_MAX); }\ntemplate<> inline schar saturate_cast<schar>(float v)        { int iv = cvRound(v); return saturate_cast<schar>(iv); }\ntemplate<> inline schar saturate_cast<schar>(double v)       { int iv = cvRound(v); return saturate_cast<schar>(iv); }\ntemplate<> inline schar saturate_cast<schar>(int64 v)        { return (schar)((uint64)((int64)v-SCHAR_MIN) <= (uint64)UCHAR_MAX ? v : v > 0 ? SCHAR_MAX : SCHAR_MIN); }\ntemplate<> inline schar saturate_cast<schar>(uint64 v)       { return (schar)std::min(v, (uint64)SCHAR_MAX); }\n\ntemplate<> inline ushort saturate_cast<ushort>(schar v)      { return (ushort)std::max((int)v, 0); }\ntemplate<> inline ushort saturate_cast<ushort>(short v)      { return (ushort)std::max((int)v, 0); }\ntemplate<> inline ushort saturate_cast<ushort>(int v)        { return (ushort)((unsigned)v <= (unsigned)USHRT_MAX ? v : v > 0 ? USHRT_MAX : 0); }\ntemplate<> inline ushort saturate_cast<ushort>(unsigned v)   { return (ushort)std::min(v, (unsigned)USHRT_MAX); }\ntemplate<> inline ushort saturate_cast<ushort>(float v)      { int iv = cvRound(v); return saturate_cast<ushort>(iv); }\ntemplate<> inline ushort saturate_cast<ushort>(double v)     { int iv = cvRound(v); return saturate_cast<ushort>(iv); }\ntemplate<> inline ushort saturate_cast<ushort>(int64 v)      { return (ushort)((uint64)v <= (uint64)USHRT_MAX ? v : v > 0 ? USHRT_MAX : 0); }\ntemplate<> inline ushort saturate_cast<ushort>(uint64 v)     { return (ushort)std::min(v, (uint64)USHRT_MAX); }\n\ntemplate<> inline short saturate_cast<short>(ushort v)       { return (short)std::min((int)v, SHRT_MAX); }\ntemplate<> inline short saturate_cast<short>(int v)          { return (short)((unsigned)(v - SHRT_MIN) <= (unsigned)USHRT_MAX ? v : v > 0 ? SHRT_MAX : SHRT_MIN); }\ntemplate<> inline short saturate_cast<short>(unsigned v)     { return (short)std::min(v, (unsigned)SHRT_MAX); }\ntemplate<> inline short saturate_cast<short>(float v)        { int iv = cvRound(v); return saturate_cast<short>(iv); }\ntemplate<> inline short saturate_cast<short>(double v)       { int iv = cvRound(v); return saturate_cast<short>(iv); }\ntemplate<> inline short saturate_cast<short>(int64 v)        { return (short)((uint64)((int64)v - SHRT_MIN) <= (uint64)USHRT_MAX ? v : v > 0 ? SHRT_MAX : SHRT_MIN); }\ntemplate<> inline short saturate_cast<short>(uint64 v)       { return (short)std::min(v, (uint64)SHRT_MAX); }\n\ntemplate<> inline int saturate_cast<int>(unsigned v)         { return (int)std::min(v, (unsigned)INT_MAX); }\ntemplate<> inline int saturate_cast<int>(int64 v)            { return (int)((uint64)(v - INT_MIN) <= (uint64)UINT_MAX ? v : v > 0 ? INT_MAX : INT_MIN); }\ntemplate<> inline int saturate_cast<int>(uint64 v)           { return (int)std::min(v, (uint64)INT_MAX); }\ntemplate<> inline int saturate_cast<int>(float v)            { return cvRound(v); }\ntemplate<> inline int saturate_cast<int>(double v)           { return cvRound(v); }\n\ntemplate<> inline unsigned saturate_cast<unsigned>(schar v)  { return (unsigned)std::max(v, (schar)0); }\ntemplate<> inline unsigned saturate_cast<unsigned>(short v)  { return (unsigned)std::max(v, (short)0); }\ntemplate<> inline unsigned saturate_cast<unsigned>(int v)    { return (unsigned)std::max(v, (int)0); }\ntemplate<> inline unsigned saturate_cast<unsigned>(int64 v)  { return (unsigned)((uint64)v <= (uint64)UINT_MAX ? v : v > 0 ? UINT_MAX : 0); }\ntemplate<> inline unsigned saturate_cast<unsigned>(uint64 v) { return (unsigned)std::min(v, (uint64)UINT_MAX); }\n// we intentionally do not clip negative numbers, to make -1 become 0xffffffff etc.\ntemplate<> inline unsigned saturate_cast<unsigned>(float v)  { return static_cast<unsigned>(cvRound(v)); }\ntemplate<> inline unsigned saturate_cast<unsigned>(double v) { return static_cast<unsigned>(cvRound(v)); }\n\ntemplate<> inline uint64 saturate_cast<uint64>(schar v)      { return (uint64)std::max(v, (schar)0); }\ntemplate<> inline uint64 saturate_cast<uint64>(short v)      { return (uint64)std::max(v, (short)0); }\ntemplate<> inline uint64 saturate_cast<uint64>(int v)        { return (uint64)std::max(v, (int)0); }\ntemplate<> inline uint64 saturate_cast<uint64>(int64 v)      { return (uint64)std::max(v, (int64)0); }\n\ntemplate<> inline int64 saturate_cast<int64>(uint64 v)       { return (int64)std::min(v, (uint64)LLONG_MAX); }\n\n/** @overload */\ntemplate<typename _Tp> static inline _Tp saturate_cast(float16_t v) { return saturate_cast<_Tp>((float)v); }\n\n// in theory, we could use a LUT for 8u/8s->16f conversion,\n// but with hardware support for FP32->FP16 conversion the current approach is preferable\ntemplate<> inline float16_t saturate_cast<float16_t>(uchar v)   { return float16_t((float)v); }\ntemplate<> inline float16_t saturate_cast<float16_t>(schar v)   { return float16_t((float)v); }\ntemplate<> inline float16_t saturate_cast<float16_t>(ushort v)  { return float16_t((float)v); }\ntemplate<> inline float16_t saturate_cast<float16_t>(short v)   { return float16_t((float)v); }\ntemplate<> inline float16_t saturate_cast<float16_t>(unsigned v){ return float16_t((float)v); }\ntemplate<> inline float16_t saturate_cast<float16_t>(int v)     { return float16_t((float)v); }\ntemplate<> inline float16_t saturate_cast<float16_t>(uint64 v)  { return float16_t((float)v); }\ntemplate<> inline float16_t saturate_cast<float16_t>(int64 v)   { return float16_t((float)v); }\ntemplate<> inline float16_t saturate_cast<float16_t>(float v)   { return float16_t(v); }\ntemplate<> inline float16_t saturate_cast<float16_t>(double v)  { return float16_t((float)v); }\n\n//! @}\n\n} // cv\n\n#endif // OPENCV_CORE_SATURATE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/simd_intrinsics.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_SIMD_INTRINSICS_HPP\n#define OPENCV_CORE_SIMD_INTRINSICS_HPP\n\n/**\nHelper header to support SIMD intrinsics (universal intrinsics) in user code.\nIntrinsics documentation: https://docs.opencv.org/master/df/d91/group__core__hal__intrin.html\n\n\nChecks of target CPU instruction set based on compiler definitions don't work well enough.\nMore reliable solutions require utilization of configuration systems (like CMake).\n\nSo, probably you need to specify your own configuration.\n\nYou can do that via CMake in this way:\n    add_definitions(/DOPENCV_SIMD_CONFIG_HEADER=opencv_simd_config_custom.hpp)\nor\n    add_definitions(/DOPENCV_SIMD_CONFIG_INCLUDE_DIR=1)\n\nAdditionally you may need to add include directory to your files:\n    include_directories(\"${CMAKE_CURRENT_LIST_DIR}/opencv_config_${MYTARGET}\")\n\nThese files can be pre-generated for target configurations of your application\nor generated by CMake on the fly (use CMAKE_BINARY_DIR for that).\n\nNotes:\n- H/W capability checks are still responsibility of your application\n- runtime dispatching is not covered by this helper header\n*/\n\n#ifdef __OPENCV_BUILD\n#error \"Use core/hal/intrin.hpp during OpenCV build\"\n#endif\n\n#ifdef OPENCV_HAL_INTRIN_HPP\n#error \"core/simd_intrinsics.hpp must be included before core/hal/intrin.hpp\"\n#endif\n\n#include \"opencv2/core/cvdef.h\"\n\n#ifdef OPENCV_SIMD_CONFIG_HEADER\n#include CVAUX_STR(OPENCV_SIMD_CONFIG_HEADER)\n#elif defined(OPENCV_SIMD_CONFIG_INCLUDE_DIR)\n#include \"opencv_simd_config.hpp\"  // corresponding directory should be added via -I compiler parameter\n#else  // custom config headers\n\n#if (!defined(CV_AVX_512F) || !CV_AVX_512F) && (defined(__AVX512__) || defined(__AVX512F__))\n#  include <immintrin.h>\n#  undef CV_AVX_512F\n#  define CV_AVX_512F 1\n#  ifndef OPENCV_SIMD_DONT_ASSUME_SKX  // Skylake-X with AVX-512F/CD/BW/DQ/VL\n#    undef CV_AVX512_SKX\n#    define CV_AVX512_SKX 1\n#    undef CV_AVX_512CD\n#    define CV_AVX_512CD 1\n#    undef CV_AVX_512BW\n#    define CV_AVX_512BW 1\n#    undef CV_AVX_512DQ\n#    define CV_AVX_512DQ 1\n#    undef CV_AVX_512VL\n#    define CV_AVX_512VL 1\n#  endif\n#endif // AVX512\n\n// GCC/Clang: -mavx2\n// MSVC: /arch:AVX2\n#if defined __AVX2__\n#  include <immintrin.h>\n#  undef CV_AVX2\n#  define CV_AVX2 1\n#  if defined __F16C__\n#    undef CV_FP16\n#    define CV_FP16 1\n#  endif\n#endif\n\n#endif\n\n// SSE / NEON / VSX is handled by cv_cpu_dispatch.h compatibility block\n#include \"cv_cpu_dispatch.h\"\n\n#include \"hal/intrin.hpp\"\n\n#endif // OPENCV_CORE_SIMD_INTRINSICS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/softfloat.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html\n\n// This file is based on files from package issued with the following license:\n\n/*============================================================================\n\nThis C header file is part of the SoftFloat IEEE Floating-Point Arithmetic\nPackage, Release 3c, by John R. Hauser.\n\nCopyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 The Regents of the\nUniversity of California.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n    this list of conditions, and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n    this list of conditions, and the following disclaimer in the documentation\n    and/or other materials provided with the distribution.\n\n 3. Neither the name of the University nor the names of its contributors may\n    be used to endorse or promote products derived from this software without\n    specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS \"AS IS\", AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE\nDISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n=============================================================================*/\n\n#pragma once\n#ifndef softfloat_h\n#define softfloat_h 1\n\n#include \"cvdef.h\"\n\nnamespace cv\n{\n\n/** @addtogroup core_utils_softfloat\n\n  [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation\n  of floating-point calculations according to IEEE 754 standard.\n  All calculations are done in integers, that's why they are machine-independent and bit-exact.\n  This library can be useful in accuracy-critical parts like look-up tables generation, tests, etc.\n  OpenCV contains a subset of SoftFloat partially rewritten to C++.\n\n  ### Types\n\n  There are two basic types: @ref softfloat and @ref softdouble.\n  These types are binary compatible with float and double types respectively\n  and support conversions to/from them.\n  Other types from original SoftFloat library like fp16 or fp128 were thrown away\n  as well as quiet/signaling NaN support, on-the-fly rounding mode switch\n  and exception flags (though exceptions can be implemented in the future).\n\n  ### Operations\n\n  Both types support the following:\n  - Construction from signed and unsigned 32-bit and 64 integers,\n  float/double or raw binary representation\n  - Conversions between each other, to float or double and to int\n  using @ref cvRound, @ref cvTrunc, @ref cvFloor, @ref cvCeil or a bunch of\n  saturate_cast functions\n  - Add, subtract, multiply, divide, remainder, square root, FMA with absolute precision\n  - Comparison operations\n  - Explicit sign, exponent and significand manipulation through get/set methods,\n number state indicators (isInf, isNan, isSubnormal)\n  - Type-specific constants like eps, minimum/maximum value, best pi approximation, etc.\n  - min(), max(), abs(), exp(), log() and pow() functions\n\n*/\n//! @{\n\nstruct softfloat;\nstruct softdouble;\n\nstruct CV_EXPORTS softfloat\n{\npublic:\n    /** @brief Default constructor */\n    softfloat() { v = 0; }\n    /** @brief Copy constructor */\n    softfloat( const softfloat& c) { v = c.v; }\n    /** @brief Assign constructor */\n    softfloat& operator=( const softfloat& c )\n    {\n        if(&c != this) v = c.v;\n        return *this;\n    }\n    /** @brief Construct from raw\n\n    Builds new value from raw binary representation\n    */\n    static const softfloat fromRaw( const uint32_t a ) { softfloat x; x.v = a; return x; }\n\n    /** @brief Construct from integer */\n    explicit softfloat( const uint32_t );\n    explicit softfloat( const uint64_t );\n    explicit softfloat( const int32_t );\n    explicit softfloat( const int64_t );\n\n#ifdef CV_INT32_T_IS_LONG_INT\n    // for platforms with int32_t = long int\n    explicit softfloat( const int a ) { *this = softfloat(static_cast<int32_t>(a)); }\n#endif\n\n    /** @brief Construct from float */\n    explicit softfloat( const float a ) { Cv32suf s; s.f = a; v = s.u; }\n\n    /** @brief Type casts  */\n    operator softdouble() const;\n    operator float() const { Cv32suf s; s.u = v; return s.f; }\n\n    /** @brief Basic arithmetics */\n    softfloat operator + (const softfloat&) const;\n    softfloat operator - (const softfloat&) const;\n    softfloat operator * (const softfloat&) const;\n    softfloat operator / (const softfloat&) const;\n    softfloat operator - () const { softfloat x; x.v = v ^ (1U << 31); return x; }\n\n    /** @brief Remainder operator\n\n    A quote from original SoftFloat manual:\n\n    > The IEEE Standard remainder operation computes the value\n    > a - n * b, where n is the integer closest to a / b.\n    > If a / b is exactly halfway between two integers, n is the even integer\n    > closest to a / b. The IEEE Standard’s remainder operation is always exact and so requires no rounding.\n    > Depending on the relative magnitudes of the operands, the remainder functions\n    > can take considerably longer to execute than the other SoftFloat functions.\n    > This is an inherent characteristic of the remainder operation itself and is not a flaw\n    > in the SoftFloat implementation.\n    */\n    softfloat operator % (const softfloat&) const;\n\n    softfloat& operator += (const softfloat& a) { *this = *this + a; return *this; }\n    softfloat& operator -= (const softfloat& a) { *this = *this - a; return *this; }\n    softfloat& operator *= (const softfloat& a) { *this = *this * a; return *this; }\n    softfloat& operator /= (const softfloat& a) { *this = *this / a; return *this; }\n    softfloat& operator %= (const softfloat& a) { *this = *this % a; return *this; }\n\n    /** @brief Comparison operations\n\n     - Any operation with NaN produces false\n       + The only exception is when x is NaN: x != y for any y.\n     - Positive and negative zeros are equal\n    */\n    bool operator == ( const softfloat& ) const;\n    bool operator != ( const softfloat& ) const;\n    bool operator >  ( const softfloat& ) const;\n    bool operator >= ( const softfloat& ) const;\n    bool operator <  ( const softfloat& ) const;\n    bool operator <= ( const softfloat& ) const;\n\n    /** @brief NaN state indicator */\n    inline bool isNaN() const { return (v & 0x7fffffff)  > 0x7f800000; }\n    /** @brief Inf state indicator */\n    inline bool isInf() const { return (v & 0x7fffffff) == 0x7f800000; }\n    /** @brief Subnormal number indicator */\n    inline bool isSubnormal() const { return ((v >> 23) & 0xFF) == 0; }\n\n    /** @brief Get sign bit */\n    inline bool getSign() const { return (v >> 31) != 0; }\n    /** @brief Construct a copy with new sign bit */\n    inline softfloat setSign(bool sign) const { softfloat x; x.v = (v & ((1U << 31) - 1)) | ((uint32_t)sign << 31); return x; }\n    /** @brief Get 0-based exponent */\n    inline int getExp() const { return ((v >> 23) & 0xFF) - 127; }\n    /** @brief Construct a copy with new 0-based exponent */\n    inline softfloat setExp(int e) const { softfloat x; x.v = (v & 0x807fffff) | (((e + 127) & 0xFF) << 23 ); return x; }\n\n    /** @brief Get a fraction part\n\n    Returns a number 1 <= x < 2 with the same significand\n    */\n    inline softfloat getFrac() const\n    {\n        uint_fast32_t vv = (v & 0x007fffff) | (127 << 23);\n        return softfloat::fromRaw(vv);\n    }\n    /** @brief Construct a copy with provided significand\n\n    Constructs a copy of a number with significand taken from parameter\n    */\n    inline softfloat setFrac(const softfloat& s) const\n    {\n        softfloat x;\n        x.v = (v & 0xff800000) | (s.v & 0x007fffff);\n        return x;\n    }\n\n    /** @brief Zero constant */\n    static softfloat zero() { return softfloat::fromRaw( 0 ); }\n    /** @brief Positive infinity constant */\n    static softfloat  inf() { return softfloat::fromRaw( 0xFF << 23 ); }\n    /** @brief Default NaN constant */\n    static softfloat  nan() { return softfloat::fromRaw( 0x7fffffff ); }\n    /** @brief One constant */\n    static softfloat  one() { return softfloat::fromRaw(  127 << 23 ); }\n    /** @brief Smallest normalized value */\n    static softfloat  min() { return softfloat::fromRaw( 0x01 << 23 ); }\n    /** @brief Difference between 1 and next representable value */\n    static softfloat  eps() { return softfloat::fromRaw( (127 - 23) << 23 ); }\n    /** @brief Biggest finite value */\n    static softfloat  max() { return softfloat::fromRaw( (0xFF << 23) - 1 ); }\n    /** @brief Correct pi approximation */\n    static softfloat   pi() { return softfloat::fromRaw( 0x40490fdb ); }\n\n    uint32_t v;\n};\n\n/*----------------------------------------------------------------------------\n*----------------------------------------------------------------------------*/\n\nstruct CV_EXPORTS softdouble\n{\npublic:\n    /** @brief Default constructor */\n    softdouble() : v(0) { }\n    /** @brief Copy constructor */\n    softdouble( const softdouble& c) { v = c.v; }\n    /** @brief Assign constructor */\n    softdouble& operator=( const softdouble& c )\n    {\n        if(&c != this) v = c.v;\n        return *this;\n    }\n    /** @brief Construct from raw\n\n    Builds new value from raw binary representation\n    */\n    static softdouble fromRaw( const uint64_t a ) { softdouble x; x.v = a; return x; }\n\n    /** @brief Construct from integer */\n    explicit softdouble( const uint32_t );\n    explicit softdouble( const uint64_t );\n    explicit softdouble( const  int32_t );\n    explicit softdouble( const  int64_t );\n\n#ifdef CV_INT32_T_IS_LONG_INT\n    // for platforms with int32_t = long int\n    explicit softdouble( const int a ) { *this = softdouble(static_cast<int32_t>(a)); }\n#endif\n\n    /** @brief Construct from double */\n    explicit softdouble( const double a ) { Cv64suf s; s.f = a; v = s.u; }\n\n    /** @brief Type casts  */\n    operator softfloat() const;\n    operator double() const { Cv64suf s; s.u = v; return s.f; }\n\n    /** @brief Basic arithmetics */\n    softdouble operator + (const softdouble&) const;\n    softdouble operator - (const softdouble&) const;\n    softdouble operator * (const softdouble&) const;\n    softdouble operator / (const softdouble&) const;\n    softdouble operator - () const { softdouble x; x.v = v ^ (1ULL << 63); return x; }\n\n    /** @brief Remainder operator\n\n    A quote from original SoftFloat manual:\n\n    > The IEEE Standard remainder operation computes the value\n    > a - n * b, where n is the integer closest to a / b.\n    > If a / b is exactly halfway between two integers, n is the even integer\n    > closest to a / b. The IEEE Standard’s remainder operation is always exact and so requires no rounding.\n    > Depending on the relative magnitudes of the operands, the remainder functions\n    > can take considerably longer to execute than the other SoftFloat functions.\n    > This is an inherent characteristic of the remainder operation itself and is not a flaw\n    > in the SoftFloat implementation.\n    */\n    softdouble operator % (const softdouble&) const;\n\n    softdouble& operator += (const softdouble& a) { *this = *this + a; return *this; }\n    softdouble& operator -= (const softdouble& a) { *this = *this - a; return *this; }\n    softdouble& operator *= (const softdouble& a) { *this = *this * a; return *this; }\n    softdouble& operator /= (const softdouble& a) { *this = *this / a; return *this; }\n    softdouble& operator %= (const softdouble& a) { *this = *this % a; return *this; }\n\n    /** @brief Comparison operations\n\n     - Any operation with NaN produces false\n       + The only exception is when x is NaN: x != y for any y.\n     - Positive and negative zeros are equal\n    */\n    bool operator == ( const softdouble& ) const;\n    bool operator != ( const softdouble& ) const;\n    bool operator >  ( const softdouble& ) const;\n    bool operator >= ( const softdouble& ) const;\n    bool operator <  ( const softdouble& ) const;\n    bool operator <= ( const softdouble& ) const;\n\n    /** @brief NaN state indicator */\n    inline bool isNaN() const { return (v & 0x7fffffffffffffff)  > 0x7ff0000000000000; }\n    /** @brief Inf state indicator */\n    inline bool isInf() const { return (v & 0x7fffffffffffffff) == 0x7ff0000000000000; }\n    /** @brief Subnormal number indicator */\n    inline bool isSubnormal() const { return ((v >> 52) & 0x7FF) == 0; }\n\n    /** @brief Get sign bit */\n    inline bool getSign() const { return (v >> 63) != 0; }\n    /** @brief Construct a copy with new sign bit */\n    softdouble setSign(bool sign) const { softdouble x; x.v = (v & ((1ULL << 63) - 1)) | ((uint_fast64_t)(sign) << 63); return x; }\n    /** @brief Get 0-based exponent */\n    inline int getExp() const { return ((v >> 52) & 0x7FF) - 1023; }\n    /** @brief Construct a copy with new 0-based exponent */\n    inline softdouble setExp(int e) const\n    {\n        softdouble x;\n        x.v = (v & 0x800FFFFFFFFFFFFF) | ((uint_fast64_t)((e + 1023) & 0x7FF) << 52);\n        return x;\n    }\n\n    /** @brief Get a fraction part\n\n    Returns a number 1 <= x < 2 with the same significand\n    */\n    inline softdouble getFrac() const\n    {\n        uint_fast64_t vv = (v & 0x000FFFFFFFFFFFFF) | ((uint_fast64_t)(1023) << 52);\n        return softdouble::fromRaw(vv);\n    }\n    /** @brief Construct a copy with provided significand\n\n    Constructs a copy of a number with significand taken from parameter\n    */\n    inline softdouble setFrac(const softdouble& s) const\n    {\n        softdouble x;\n        x.v = (v & 0xFFF0000000000000) | (s.v & 0x000FFFFFFFFFFFFF);\n        return x;\n    }\n\n    /** @brief Zero constant */\n    static softdouble zero() { return softdouble::fromRaw( 0 ); }\n    /** @brief Positive infinity constant */\n    static softdouble  inf() { return softdouble::fromRaw( (uint_fast64_t)(0x7FF) << 52 ); }\n    /** @brief Default NaN constant */\n    static softdouble  nan() { return softdouble::fromRaw( CV_BIG_INT(0x7FFFFFFFFFFFFFFF) ); }\n    /** @brief One constant */\n    static softdouble  one() { return softdouble::fromRaw( (uint_fast64_t)( 1023) << 52 ); }\n    /** @brief Smallest normalized value */\n    static softdouble  min() { return softdouble::fromRaw( (uint_fast64_t)( 0x01) << 52 ); }\n    /** @brief Difference between 1 and next representable value */\n    static softdouble  eps() { return softdouble::fromRaw( (uint_fast64_t)( 1023 - 52 ) << 52 ); }\n    /** @brief Biggest finite value */\n    static softdouble  max() { return softdouble::fromRaw( ((uint_fast64_t)(0x7FF) << 52) - 1 ); }\n    /** @brief Correct pi approximation */\n    static softdouble   pi() { return softdouble::fromRaw( CV_BIG_INT(0x400921FB54442D18) ); }\n\n    uint64_t v;\n};\n\n/*----------------------------------------------------------------------------\n*----------------------------------------------------------------------------*/\n\n/** @brief Fused Multiplication and Addition\n\nComputes (a*b)+c with single rounding\n*/\nCV_EXPORTS softfloat  mulAdd( const softfloat&  a, const softfloat&  b, const softfloat & c);\nCV_EXPORTS softdouble mulAdd( const softdouble& a, const softdouble& b, const softdouble& c);\n\n/** @brief Square root */\nCV_EXPORTS softfloat  sqrt( const softfloat&  a );\nCV_EXPORTS softdouble sqrt( const softdouble& a );\n}\n\n/*----------------------------------------------------------------------------\n| Ported from OpenCV and added for usability\n*----------------------------------------------------------------------------*/\n\n/** @brief Truncates number to integer with minimum magnitude */\nCV_EXPORTS int cvTrunc(const cv::softfloat&  a);\nCV_EXPORTS int cvTrunc(const cv::softdouble& a);\n\n/** @brief Rounds a number to nearest even integer */\nCV_EXPORTS int cvRound(const cv::softfloat&  a);\nCV_EXPORTS int cvRound(const cv::softdouble& a);\n\n/** @brief Rounds a number to nearest even long long integer */\nCV_EXPORTS int64_t cvRound64(const cv::softdouble& a);\n\n/** @brief Rounds a number down to integer */\nCV_EXPORTS int cvFloor(const cv::softfloat&  a);\nCV_EXPORTS int cvFloor(const cv::softdouble& a);\n\n/** @brief Rounds number up to integer */\nCV_EXPORTS int  cvCeil(const cv::softfloat&  a);\nCV_EXPORTS int  cvCeil(const cv::softdouble& a);\n\nnamespace cv\n{\n/** @brief Saturate casts */\ntemplate<typename _Tp> static inline _Tp saturate_cast(softfloat  a) { return _Tp(a); }\ntemplate<typename _Tp> static inline _Tp saturate_cast(softdouble a) { return _Tp(a); }\n\ntemplate<> inline uchar saturate_cast<uchar>(softfloat  a) { return (uchar)std::max(std::min(cvRound(a), (int)UCHAR_MAX), 0); }\ntemplate<> inline uchar saturate_cast<uchar>(softdouble a) { return (uchar)std::max(std::min(cvRound(a), (int)UCHAR_MAX), 0); }\n\ntemplate<> inline schar saturate_cast<schar>(softfloat  a) { return (schar)std::min(std::max(cvRound(a), (int)SCHAR_MIN), (int)SCHAR_MAX); }\ntemplate<> inline schar saturate_cast<schar>(softdouble a) { return (schar)std::min(std::max(cvRound(a), (int)SCHAR_MIN), (int)SCHAR_MAX); }\n\ntemplate<> inline ushort saturate_cast<ushort>(softfloat  a) { return (ushort)std::max(std::min(cvRound(a), (int)USHRT_MAX), 0); }\ntemplate<> inline ushort saturate_cast<ushort>(softdouble a) { return (ushort)std::max(std::min(cvRound(a), (int)USHRT_MAX), 0); }\n\ntemplate<> inline short saturate_cast<short>(softfloat  a) { return (short)std::min(std::max(cvRound(a), (int)SHRT_MIN), (int)SHRT_MAX); }\ntemplate<> inline short saturate_cast<short>(softdouble a) { return (short)std::min(std::max(cvRound(a), (int)SHRT_MIN), (int)SHRT_MAX); }\n\ntemplate<> inline int saturate_cast<int>(softfloat  a) { return cvRound(a); }\ntemplate<> inline int saturate_cast<int>(softdouble a) { return cvRound(a); }\n\ntemplate<> inline int64_t saturate_cast<int64_t>(softfloat  a) { return cvRound(a); }\ntemplate<> inline int64_t saturate_cast<int64_t>(softdouble a) { return cvRound64(a); }\n\n/** @brief Saturate cast to unsigned integer and unsigned long long integer\nWe intentionally do not clip negative numbers, to make -1 become 0xffffffff etc.\n*/\ntemplate<> inline unsigned saturate_cast<unsigned>(softfloat  a) { return cvRound(a); }\ntemplate<> inline unsigned saturate_cast<unsigned>(softdouble a) { return cvRound(a); }\n\ntemplate<> inline uint64_t saturate_cast<uint64_t>(softfloat  a) { return cvRound(a); }\ntemplate<> inline uint64_t saturate_cast<uint64_t>(softdouble a) { return cvRound64(a); }\n\n/** @brief Min and Max functions */\ninline softfloat  min(const softfloat&  a, const softfloat&  b) { return (a > b) ? b : a; }\ninline softdouble min(const softdouble& a, const softdouble& b) { return (a > b) ? b : a; }\n\ninline softfloat  max(const softfloat&  a, const softfloat&  b) { return (a > b) ? a : b; }\ninline softdouble max(const softdouble& a, const softdouble& b) { return (a > b) ? a : b; }\n\n/** @brief Absolute value */\ninline softfloat  abs( softfloat  a) { softfloat  x; x.v = a.v & ((1U   << 31) - 1); return x; }\ninline softdouble abs( softdouble a) { softdouble x; x.v = a.v & ((1ULL << 63) - 1); return x; }\n\n/** @brief Exponent\n\nSpecial cases:\n- exp(NaN) is NaN\n- exp(-Inf) == 0\n- exp(+Inf) == +Inf\n*/\nCV_EXPORTS softfloat  exp( const softfloat&  a);\nCV_EXPORTS softdouble exp( const softdouble& a);\n\n/** @brief Natural logarithm\n\nSpecial cases:\n- log(NaN), log(x < 0) are NaN\n- log(0) == -Inf\n*/\nCV_EXPORTS softfloat  log( const softfloat&  a );\nCV_EXPORTS softdouble log( const softdouble& a );\n\n/** @brief Raising to the power\n\nSpecial cases:\n- x**NaN is NaN for any x\n- ( |x| == 1 )**Inf is NaN\n- ( |x|  > 1 )**+Inf or ( |x| < 1 )**-Inf is +Inf\n- ( |x|  > 1 )**-Inf or ( |x| < 1 )**+Inf is 0\n- x ** 0 == 1 for any x\n- x ** 1 == 1 for any x\n- NaN ** y is NaN for any other y\n- Inf**(y < 0) == 0\n- Inf ** y is +Inf for any other y\n- (x < 0)**y is NaN for any other y if x can't be correctly rounded to integer\n- 0 ** 0 == 1\n- 0 ** (y < 0) is +Inf\n- 0 ** (y > 0) is 0\n*/\nCV_EXPORTS softfloat  pow( const softfloat&  a, const softfloat&  b);\nCV_EXPORTS softdouble pow( const softdouble& a, const softdouble& b);\n\n/** @brief Cube root\n\nSpecial cases:\n- cbrt(NaN) is NaN\n- cbrt(+/-Inf) is +/-Inf\n*/\nCV_EXPORTS softfloat cbrt( const softfloat& a );\n\n/** @brief Sine\n\nSpecial cases:\n- sin(Inf) or sin(NaN) is NaN\n- sin(x) == x when sin(x) is close to zero\n*/\nCV_EXPORTS softdouble sin( const softdouble& a );\n\n/** @brief Cosine\n *\nSpecial cases:\n- cos(Inf) or cos(NaN) is NaN\n- cos(x) == +/- 1 when cos(x) is close to +/- 1\n*/\nCV_EXPORTS softdouble cos( const softdouble& a );\n\n//! @} core_utils_softfloat\n\n} // cv::\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/sse_utils.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_SSE_UTILS_HPP\n#define OPENCV_CORE_SSE_UTILS_HPP\n\n#ifndef __cplusplus\n#  error sse_utils.hpp header must be compiled as C++\n#endif\n\n#include \"opencv2/core/cvdef.h\"\n\n//! @addtogroup core_utils_sse\n//! @{\n\n#if CV_SSE2\n\ninline void _mm_deinterleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1)\n{\n    __m128i layer1_chunk0 = _mm_unpacklo_epi8(v_r0, v_g0);\n    __m128i layer1_chunk1 = _mm_unpackhi_epi8(v_r0, v_g0);\n    __m128i layer1_chunk2 = _mm_unpacklo_epi8(v_r1, v_g1);\n    __m128i layer1_chunk3 = _mm_unpackhi_epi8(v_r1, v_g1);\n\n    __m128i layer2_chunk0 = _mm_unpacklo_epi8(layer1_chunk0, layer1_chunk2);\n    __m128i layer2_chunk1 = _mm_unpackhi_epi8(layer1_chunk0, layer1_chunk2);\n    __m128i layer2_chunk2 = _mm_unpacklo_epi8(layer1_chunk1, layer1_chunk3);\n    __m128i layer2_chunk3 = _mm_unpackhi_epi8(layer1_chunk1, layer1_chunk3);\n\n    __m128i layer3_chunk0 = _mm_unpacklo_epi8(layer2_chunk0, layer2_chunk2);\n    __m128i layer3_chunk1 = _mm_unpackhi_epi8(layer2_chunk0, layer2_chunk2);\n    __m128i layer3_chunk2 = _mm_unpacklo_epi8(layer2_chunk1, layer2_chunk3);\n    __m128i layer3_chunk3 = _mm_unpackhi_epi8(layer2_chunk1, layer2_chunk3);\n\n    __m128i layer4_chunk0 = _mm_unpacklo_epi8(layer3_chunk0, layer3_chunk2);\n    __m128i layer4_chunk1 = _mm_unpackhi_epi8(layer3_chunk0, layer3_chunk2);\n    __m128i layer4_chunk2 = _mm_unpacklo_epi8(layer3_chunk1, layer3_chunk3);\n    __m128i layer4_chunk3 = _mm_unpackhi_epi8(layer3_chunk1, layer3_chunk3);\n\n    v_r0 = _mm_unpacklo_epi8(layer4_chunk0, layer4_chunk2);\n    v_r1 = _mm_unpackhi_epi8(layer4_chunk0, layer4_chunk2);\n    v_g0 = _mm_unpacklo_epi8(layer4_chunk1, layer4_chunk3);\n    v_g1 = _mm_unpackhi_epi8(layer4_chunk1, layer4_chunk3);\n}\n\ninline void _mm_deinterleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0,\n                                  __m128i & v_g1, __m128i & v_b0, __m128i & v_b1)\n{\n    __m128i layer1_chunk0 = _mm_unpacklo_epi8(v_r0, v_g1);\n    __m128i layer1_chunk1 = _mm_unpackhi_epi8(v_r0, v_g1);\n    __m128i layer1_chunk2 = _mm_unpacklo_epi8(v_r1, v_b0);\n    __m128i layer1_chunk3 = _mm_unpackhi_epi8(v_r1, v_b0);\n    __m128i layer1_chunk4 = _mm_unpacklo_epi8(v_g0, v_b1);\n    __m128i layer1_chunk5 = _mm_unpackhi_epi8(v_g0, v_b1);\n\n    __m128i layer2_chunk0 = _mm_unpacklo_epi8(layer1_chunk0, layer1_chunk3);\n    __m128i layer2_chunk1 = _mm_unpackhi_epi8(layer1_chunk0, layer1_chunk3);\n    __m128i layer2_chunk2 = _mm_unpacklo_epi8(layer1_chunk1, layer1_chunk4);\n    __m128i layer2_chunk3 = _mm_unpackhi_epi8(layer1_chunk1, layer1_chunk4);\n    __m128i layer2_chunk4 = _mm_unpacklo_epi8(layer1_chunk2, layer1_chunk5);\n    __m128i layer2_chunk5 = _mm_unpackhi_epi8(layer1_chunk2, layer1_chunk5);\n\n    __m128i layer3_chunk0 = _mm_unpacklo_epi8(layer2_chunk0, layer2_chunk3);\n    __m128i layer3_chunk1 = _mm_unpackhi_epi8(layer2_chunk0, layer2_chunk3);\n    __m128i layer3_chunk2 = _mm_unpacklo_epi8(layer2_chunk1, layer2_chunk4);\n    __m128i layer3_chunk3 = _mm_unpackhi_epi8(layer2_chunk1, layer2_chunk4);\n    __m128i layer3_chunk4 = _mm_unpacklo_epi8(layer2_chunk2, layer2_chunk5);\n    __m128i layer3_chunk5 = _mm_unpackhi_epi8(layer2_chunk2, layer2_chunk5);\n\n    __m128i layer4_chunk0 = _mm_unpacklo_epi8(layer3_chunk0, layer3_chunk3);\n    __m128i layer4_chunk1 = _mm_unpackhi_epi8(layer3_chunk0, layer3_chunk3);\n    __m128i layer4_chunk2 = _mm_unpacklo_epi8(layer3_chunk1, layer3_chunk4);\n    __m128i layer4_chunk3 = _mm_unpackhi_epi8(layer3_chunk1, layer3_chunk4);\n    __m128i layer4_chunk4 = _mm_unpacklo_epi8(layer3_chunk2, layer3_chunk5);\n    __m128i layer4_chunk5 = _mm_unpackhi_epi8(layer3_chunk2, layer3_chunk5);\n\n    v_r0 = _mm_unpacklo_epi8(layer4_chunk0, layer4_chunk3);\n    v_r1 = _mm_unpackhi_epi8(layer4_chunk0, layer4_chunk3);\n    v_g0 = _mm_unpacklo_epi8(layer4_chunk1, layer4_chunk4);\n    v_g1 = _mm_unpackhi_epi8(layer4_chunk1, layer4_chunk4);\n    v_b0 = _mm_unpacklo_epi8(layer4_chunk2, layer4_chunk5);\n    v_b1 = _mm_unpackhi_epi8(layer4_chunk2, layer4_chunk5);\n}\n\ninline void _mm_deinterleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1,\n                                  __m128i & v_b0, __m128i & v_b1, __m128i & v_a0, __m128i & v_a1)\n{\n    __m128i layer1_chunk0 = _mm_unpacklo_epi8(v_r0, v_b0);\n    __m128i layer1_chunk1 = _mm_unpackhi_epi8(v_r0, v_b0);\n    __m128i layer1_chunk2 = _mm_unpacklo_epi8(v_r1, v_b1);\n    __m128i layer1_chunk3 = _mm_unpackhi_epi8(v_r1, v_b1);\n    __m128i layer1_chunk4 = _mm_unpacklo_epi8(v_g0, v_a0);\n    __m128i layer1_chunk5 = _mm_unpackhi_epi8(v_g0, v_a0);\n    __m128i layer1_chunk6 = _mm_unpacklo_epi8(v_g1, v_a1);\n    __m128i layer1_chunk7 = _mm_unpackhi_epi8(v_g1, v_a1);\n\n    __m128i layer2_chunk0 = _mm_unpacklo_epi8(layer1_chunk0, layer1_chunk4);\n    __m128i layer2_chunk1 = _mm_unpackhi_epi8(layer1_chunk0, layer1_chunk4);\n    __m128i layer2_chunk2 = _mm_unpacklo_epi8(layer1_chunk1, layer1_chunk5);\n    __m128i layer2_chunk3 = _mm_unpackhi_epi8(layer1_chunk1, layer1_chunk5);\n    __m128i layer2_chunk4 = _mm_unpacklo_epi8(layer1_chunk2, layer1_chunk6);\n    __m128i layer2_chunk5 = _mm_unpackhi_epi8(layer1_chunk2, layer1_chunk6);\n    __m128i layer2_chunk6 = _mm_unpacklo_epi8(layer1_chunk3, layer1_chunk7);\n    __m128i layer2_chunk7 = _mm_unpackhi_epi8(layer1_chunk3, layer1_chunk7);\n\n    __m128i layer3_chunk0 = _mm_unpacklo_epi8(layer2_chunk0, layer2_chunk4);\n    __m128i layer3_chunk1 = _mm_unpackhi_epi8(layer2_chunk0, layer2_chunk4);\n    __m128i layer3_chunk2 = _mm_unpacklo_epi8(layer2_chunk1, layer2_chunk5);\n    __m128i layer3_chunk3 = _mm_unpackhi_epi8(layer2_chunk1, layer2_chunk5);\n    __m128i layer3_chunk4 = _mm_unpacklo_epi8(layer2_chunk2, layer2_chunk6);\n    __m128i layer3_chunk5 = _mm_unpackhi_epi8(layer2_chunk2, layer2_chunk6);\n    __m128i layer3_chunk6 = _mm_unpacklo_epi8(layer2_chunk3, layer2_chunk7);\n    __m128i layer3_chunk7 = _mm_unpackhi_epi8(layer2_chunk3, layer2_chunk7);\n\n    __m128i layer4_chunk0 = _mm_unpacklo_epi8(layer3_chunk0, layer3_chunk4);\n    __m128i layer4_chunk1 = _mm_unpackhi_epi8(layer3_chunk0, layer3_chunk4);\n    __m128i layer4_chunk2 = _mm_unpacklo_epi8(layer3_chunk1, layer3_chunk5);\n    __m128i layer4_chunk3 = _mm_unpackhi_epi8(layer3_chunk1, layer3_chunk5);\n    __m128i layer4_chunk4 = _mm_unpacklo_epi8(layer3_chunk2, layer3_chunk6);\n    __m128i layer4_chunk5 = _mm_unpackhi_epi8(layer3_chunk2, layer3_chunk6);\n    __m128i layer4_chunk6 = _mm_unpacklo_epi8(layer3_chunk3, layer3_chunk7);\n    __m128i layer4_chunk7 = _mm_unpackhi_epi8(layer3_chunk3, layer3_chunk7);\n\n    v_r0 = _mm_unpacklo_epi8(layer4_chunk0, layer4_chunk4);\n    v_r1 = _mm_unpackhi_epi8(layer4_chunk0, layer4_chunk4);\n    v_g0 = _mm_unpacklo_epi8(layer4_chunk1, layer4_chunk5);\n    v_g1 = _mm_unpackhi_epi8(layer4_chunk1, layer4_chunk5);\n    v_b0 = _mm_unpacklo_epi8(layer4_chunk2, layer4_chunk6);\n    v_b1 = _mm_unpackhi_epi8(layer4_chunk2, layer4_chunk6);\n    v_a0 = _mm_unpacklo_epi8(layer4_chunk3, layer4_chunk7);\n    v_a1 = _mm_unpackhi_epi8(layer4_chunk3, layer4_chunk7);\n}\n\ninline void _mm_interleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1)\n{\n    __m128i v_mask = _mm_set1_epi16(0x00ff);\n\n    __m128i layer4_chunk0 = _mm_packus_epi16(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask));\n    __m128i layer4_chunk2 = _mm_packus_epi16(_mm_srli_epi16(v_r0, 8), _mm_srli_epi16(v_r1, 8));\n    __m128i layer4_chunk1 = _mm_packus_epi16(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask));\n    __m128i layer4_chunk3 = _mm_packus_epi16(_mm_srli_epi16(v_g0, 8), _mm_srli_epi16(v_g1, 8));\n\n    __m128i layer3_chunk0 = _mm_packus_epi16(_mm_and_si128(layer4_chunk0, v_mask), _mm_and_si128(layer4_chunk1, v_mask));\n    __m128i layer3_chunk2 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk0, 8), _mm_srli_epi16(layer4_chunk1, 8));\n    __m128i layer3_chunk1 = _mm_packus_epi16(_mm_and_si128(layer4_chunk2, v_mask), _mm_and_si128(layer4_chunk3, v_mask));\n    __m128i layer3_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk2, 8), _mm_srli_epi16(layer4_chunk3, 8));\n\n    __m128i layer2_chunk0 = _mm_packus_epi16(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask));\n    __m128i layer2_chunk2 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk0, 8), _mm_srli_epi16(layer3_chunk1, 8));\n    __m128i layer2_chunk1 = _mm_packus_epi16(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask));\n    __m128i layer2_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk2, 8), _mm_srli_epi16(layer3_chunk3, 8));\n\n    __m128i layer1_chunk0 = _mm_packus_epi16(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask));\n    __m128i layer1_chunk2 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk0, 8), _mm_srli_epi16(layer2_chunk1, 8));\n    __m128i layer1_chunk1 = _mm_packus_epi16(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask));\n    __m128i layer1_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk2, 8), _mm_srli_epi16(layer2_chunk3, 8));\n\n    v_r0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask));\n    v_g0 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk0, 8), _mm_srli_epi16(layer1_chunk1, 8));\n    v_r1 = _mm_packus_epi16(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask));\n    v_g1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk2, 8), _mm_srli_epi16(layer1_chunk3, 8));\n}\n\ninline void _mm_interleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0,\n                                __m128i & v_g1, __m128i & v_b0, __m128i & v_b1)\n{\n    __m128i v_mask = _mm_set1_epi16(0x00ff);\n\n    __m128i layer4_chunk0 = _mm_packus_epi16(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask));\n    __m128i layer4_chunk3 = _mm_packus_epi16(_mm_srli_epi16(v_r0, 8), _mm_srli_epi16(v_r1, 8));\n    __m128i layer4_chunk1 = _mm_packus_epi16(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask));\n    __m128i layer4_chunk4 = _mm_packus_epi16(_mm_srli_epi16(v_g0, 8), _mm_srli_epi16(v_g1, 8));\n    __m128i layer4_chunk2 = _mm_packus_epi16(_mm_and_si128(v_b0, v_mask), _mm_and_si128(v_b1, v_mask));\n    __m128i layer4_chunk5 = _mm_packus_epi16(_mm_srli_epi16(v_b0, 8), _mm_srli_epi16(v_b1, 8));\n\n    __m128i layer3_chunk0 = _mm_packus_epi16(_mm_and_si128(layer4_chunk0, v_mask), _mm_and_si128(layer4_chunk1, v_mask));\n    __m128i layer3_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk0, 8), _mm_srli_epi16(layer4_chunk1, 8));\n    __m128i layer3_chunk1 = _mm_packus_epi16(_mm_and_si128(layer4_chunk2, v_mask), _mm_and_si128(layer4_chunk3, v_mask));\n    __m128i layer3_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk2, 8), _mm_srli_epi16(layer4_chunk3, 8));\n    __m128i layer3_chunk2 = _mm_packus_epi16(_mm_and_si128(layer4_chunk4, v_mask), _mm_and_si128(layer4_chunk5, v_mask));\n    __m128i layer3_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk4, 8), _mm_srli_epi16(layer4_chunk5, 8));\n\n    __m128i layer2_chunk0 = _mm_packus_epi16(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask));\n    __m128i layer2_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk0, 8), _mm_srli_epi16(layer3_chunk1, 8));\n    __m128i layer2_chunk1 = _mm_packus_epi16(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask));\n    __m128i layer2_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk2, 8), _mm_srli_epi16(layer3_chunk3, 8));\n    __m128i layer2_chunk2 = _mm_packus_epi16(_mm_and_si128(layer3_chunk4, v_mask), _mm_and_si128(layer3_chunk5, v_mask));\n    __m128i layer2_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk4, 8), _mm_srli_epi16(layer3_chunk5, 8));\n\n    __m128i layer1_chunk0 = _mm_packus_epi16(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask));\n    __m128i layer1_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk0, 8), _mm_srli_epi16(layer2_chunk1, 8));\n    __m128i layer1_chunk1 = _mm_packus_epi16(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask));\n    __m128i layer1_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk2, 8), _mm_srli_epi16(layer2_chunk3, 8));\n    __m128i layer1_chunk2 = _mm_packus_epi16(_mm_and_si128(layer2_chunk4, v_mask), _mm_and_si128(layer2_chunk5, v_mask));\n    __m128i layer1_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk4, 8), _mm_srli_epi16(layer2_chunk5, 8));\n\n    v_r0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask));\n    v_g1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk0, 8), _mm_srli_epi16(layer1_chunk1, 8));\n    v_r1 = _mm_packus_epi16(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask));\n    v_b0 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk2, 8), _mm_srli_epi16(layer1_chunk3, 8));\n    v_g0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk4, v_mask), _mm_and_si128(layer1_chunk5, v_mask));\n    v_b1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk4, 8), _mm_srli_epi16(layer1_chunk5, 8));\n}\n\ninline void _mm_interleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1,\n                                __m128i & v_b0, __m128i & v_b1, __m128i & v_a0, __m128i & v_a1)\n{\n    __m128i v_mask = _mm_set1_epi16(0x00ff);\n\n    __m128i layer4_chunk0 = _mm_packus_epi16(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask));\n    __m128i layer4_chunk4 = _mm_packus_epi16(_mm_srli_epi16(v_r0, 8), _mm_srli_epi16(v_r1, 8));\n    __m128i layer4_chunk1 = _mm_packus_epi16(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask));\n    __m128i layer4_chunk5 = _mm_packus_epi16(_mm_srli_epi16(v_g0, 8), _mm_srli_epi16(v_g1, 8));\n    __m128i layer4_chunk2 = _mm_packus_epi16(_mm_and_si128(v_b0, v_mask), _mm_and_si128(v_b1, v_mask));\n    __m128i layer4_chunk6 = _mm_packus_epi16(_mm_srli_epi16(v_b0, 8), _mm_srli_epi16(v_b1, 8));\n    __m128i layer4_chunk3 = _mm_packus_epi16(_mm_and_si128(v_a0, v_mask), _mm_and_si128(v_a1, v_mask));\n    __m128i layer4_chunk7 = _mm_packus_epi16(_mm_srli_epi16(v_a0, 8), _mm_srli_epi16(v_a1, 8));\n\n    __m128i layer3_chunk0 = _mm_packus_epi16(_mm_and_si128(layer4_chunk0, v_mask), _mm_and_si128(layer4_chunk1, v_mask));\n    __m128i layer3_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk0, 8), _mm_srli_epi16(layer4_chunk1, 8));\n    __m128i layer3_chunk1 = _mm_packus_epi16(_mm_and_si128(layer4_chunk2, v_mask), _mm_and_si128(layer4_chunk3, v_mask));\n    __m128i layer3_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk2, 8), _mm_srli_epi16(layer4_chunk3, 8));\n    __m128i layer3_chunk2 = _mm_packus_epi16(_mm_and_si128(layer4_chunk4, v_mask), _mm_and_si128(layer4_chunk5, v_mask));\n    __m128i layer3_chunk6 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk4, 8), _mm_srli_epi16(layer4_chunk5, 8));\n    __m128i layer3_chunk3 = _mm_packus_epi16(_mm_and_si128(layer4_chunk6, v_mask), _mm_and_si128(layer4_chunk7, v_mask));\n    __m128i layer3_chunk7 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk6, 8), _mm_srli_epi16(layer4_chunk7, 8));\n\n    __m128i layer2_chunk0 = _mm_packus_epi16(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask));\n    __m128i layer2_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk0, 8), _mm_srli_epi16(layer3_chunk1, 8));\n    __m128i layer2_chunk1 = _mm_packus_epi16(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask));\n    __m128i layer2_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk2, 8), _mm_srli_epi16(layer3_chunk3, 8));\n    __m128i layer2_chunk2 = _mm_packus_epi16(_mm_and_si128(layer3_chunk4, v_mask), _mm_and_si128(layer3_chunk5, v_mask));\n    __m128i layer2_chunk6 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk4, 8), _mm_srli_epi16(layer3_chunk5, 8));\n    __m128i layer2_chunk3 = _mm_packus_epi16(_mm_and_si128(layer3_chunk6, v_mask), _mm_and_si128(layer3_chunk7, v_mask));\n    __m128i layer2_chunk7 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk6, 8), _mm_srli_epi16(layer3_chunk7, 8));\n\n    __m128i layer1_chunk0 = _mm_packus_epi16(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask));\n    __m128i layer1_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk0, 8), _mm_srli_epi16(layer2_chunk1, 8));\n    __m128i layer1_chunk1 = _mm_packus_epi16(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask));\n    __m128i layer1_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk2, 8), _mm_srli_epi16(layer2_chunk3, 8));\n    __m128i layer1_chunk2 = _mm_packus_epi16(_mm_and_si128(layer2_chunk4, v_mask), _mm_and_si128(layer2_chunk5, v_mask));\n    __m128i layer1_chunk6 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk4, 8), _mm_srli_epi16(layer2_chunk5, 8));\n    __m128i layer1_chunk3 = _mm_packus_epi16(_mm_and_si128(layer2_chunk6, v_mask), _mm_and_si128(layer2_chunk7, v_mask));\n    __m128i layer1_chunk7 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk6, 8), _mm_srli_epi16(layer2_chunk7, 8));\n\n    v_r0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask));\n    v_b0 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk0, 8), _mm_srli_epi16(layer1_chunk1, 8));\n    v_r1 = _mm_packus_epi16(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask));\n    v_b1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk2, 8), _mm_srli_epi16(layer1_chunk3, 8));\n    v_g0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk4, v_mask), _mm_and_si128(layer1_chunk5, v_mask));\n    v_a0 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk4, 8), _mm_srli_epi16(layer1_chunk5, 8));\n    v_g1 = _mm_packus_epi16(_mm_and_si128(layer1_chunk6, v_mask), _mm_and_si128(layer1_chunk7, v_mask));\n    v_a1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk6, 8), _mm_srli_epi16(layer1_chunk7, 8));\n}\n\ninline void _mm_deinterleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1)\n{\n    __m128i layer1_chunk0 = _mm_unpacklo_epi16(v_r0, v_g0);\n    __m128i layer1_chunk1 = _mm_unpackhi_epi16(v_r0, v_g0);\n    __m128i layer1_chunk2 = _mm_unpacklo_epi16(v_r1, v_g1);\n    __m128i layer1_chunk3 = _mm_unpackhi_epi16(v_r1, v_g1);\n\n    __m128i layer2_chunk0 = _mm_unpacklo_epi16(layer1_chunk0, layer1_chunk2);\n    __m128i layer2_chunk1 = _mm_unpackhi_epi16(layer1_chunk0, layer1_chunk2);\n    __m128i layer2_chunk2 = _mm_unpacklo_epi16(layer1_chunk1, layer1_chunk3);\n    __m128i layer2_chunk3 = _mm_unpackhi_epi16(layer1_chunk1, layer1_chunk3);\n\n    __m128i layer3_chunk0 = _mm_unpacklo_epi16(layer2_chunk0, layer2_chunk2);\n    __m128i layer3_chunk1 = _mm_unpackhi_epi16(layer2_chunk0, layer2_chunk2);\n    __m128i layer3_chunk2 = _mm_unpacklo_epi16(layer2_chunk1, layer2_chunk3);\n    __m128i layer3_chunk3 = _mm_unpackhi_epi16(layer2_chunk1, layer2_chunk3);\n\n    v_r0 = _mm_unpacklo_epi16(layer3_chunk0, layer3_chunk2);\n    v_r1 = _mm_unpackhi_epi16(layer3_chunk0, layer3_chunk2);\n    v_g0 = _mm_unpacklo_epi16(layer3_chunk1, layer3_chunk3);\n    v_g1 = _mm_unpackhi_epi16(layer3_chunk1, layer3_chunk3);\n}\n\ninline void _mm_deinterleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0,\n                                   __m128i & v_g1, __m128i & v_b0, __m128i & v_b1)\n{\n    __m128i layer1_chunk0 = _mm_unpacklo_epi16(v_r0, v_g1);\n    __m128i layer1_chunk1 = _mm_unpackhi_epi16(v_r0, v_g1);\n    __m128i layer1_chunk2 = _mm_unpacklo_epi16(v_r1, v_b0);\n    __m128i layer1_chunk3 = _mm_unpackhi_epi16(v_r1, v_b0);\n    __m128i layer1_chunk4 = _mm_unpacklo_epi16(v_g0, v_b1);\n    __m128i layer1_chunk5 = _mm_unpackhi_epi16(v_g0, v_b1);\n\n    __m128i layer2_chunk0 = _mm_unpacklo_epi16(layer1_chunk0, layer1_chunk3);\n    __m128i layer2_chunk1 = _mm_unpackhi_epi16(layer1_chunk0, layer1_chunk3);\n    __m128i layer2_chunk2 = _mm_unpacklo_epi16(layer1_chunk1, layer1_chunk4);\n    __m128i layer2_chunk3 = _mm_unpackhi_epi16(layer1_chunk1, layer1_chunk4);\n    __m128i layer2_chunk4 = _mm_unpacklo_epi16(layer1_chunk2, layer1_chunk5);\n    __m128i layer2_chunk5 = _mm_unpackhi_epi16(layer1_chunk2, layer1_chunk5);\n\n    __m128i layer3_chunk0 = _mm_unpacklo_epi16(layer2_chunk0, layer2_chunk3);\n    __m128i layer3_chunk1 = _mm_unpackhi_epi16(layer2_chunk0, layer2_chunk3);\n    __m128i layer3_chunk2 = _mm_unpacklo_epi16(layer2_chunk1, layer2_chunk4);\n    __m128i layer3_chunk3 = _mm_unpackhi_epi16(layer2_chunk1, layer2_chunk4);\n    __m128i layer3_chunk4 = _mm_unpacklo_epi16(layer2_chunk2, layer2_chunk5);\n    __m128i layer3_chunk5 = _mm_unpackhi_epi16(layer2_chunk2, layer2_chunk5);\n\n    v_r0 = _mm_unpacklo_epi16(layer3_chunk0, layer3_chunk3);\n    v_r1 = _mm_unpackhi_epi16(layer3_chunk0, layer3_chunk3);\n    v_g0 = _mm_unpacklo_epi16(layer3_chunk1, layer3_chunk4);\n    v_g1 = _mm_unpackhi_epi16(layer3_chunk1, layer3_chunk4);\n    v_b0 = _mm_unpacklo_epi16(layer3_chunk2, layer3_chunk5);\n    v_b1 = _mm_unpackhi_epi16(layer3_chunk2, layer3_chunk5);\n}\n\ninline void _mm_deinterleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1,\n                                   __m128i & v_b0, __m128i & v_b1, __m128i & v_a0, __m128i & v_a1)\n{\n    __m128i layer1_chunk0 = _mm_unpacklo_epi16(v_r0, v_b0);\n    __m128i layer1_chunk1 = _mm_unpackhi_epi16(v_r0, v_b0);\n    __m128i layer1_chunk2 = _mm_unpacklo_epi16(v_r1, v_b1);\n    __m128i layer1_chunk3 = _mm_unpackhi_epi16(v_r1, v_b1);\n    __m128i layer1_chunk4 = _mm_unpacklo_epi16(v_g0, v_a0);\n    __m128i layer1_chunk5 = _mm_unpackhi_epi16(v_g0, v_a0);\n    __m128i layer1_chunk6 = _mm_unpacklo_epi16(v_g1, v_a1);\n    __m128i layer1_chunk7 = _mm_unpackhi_epi16(v_g1, v_a1);\n\n    __m128i layer2_chunk0 = _mm_unpacklo_epi16(layer1_chunk0, layer1_chunk4);\n    __m128i layer2_chunk1 = _mm_unpackhi_epi16(layer1_chunk0, layer1_chunk4);\n    __m128i layer2_chunk2 = _mm_unpacklo_epi16(layer1_chunk1, layer1_chunk5);\n    __m128i layer2_chunk3 = _mm_unpackhi_epi16(layer1_chunk1, layer1_chunk5);\n    __m128i layer2_chunk4 = _mm_unpacklo_epi16(layer1_chunk2, layer1_chunk6);\n    __m128i layer2_chunk5 = _mm_unpackhi_epi16(layer1_chunk2, layer1_chunk6);\n    __m128i layer2_chunk6 = _mm_unpacklo_epi16(layer1_chunk3, layer1_chunk7);\n    __m128i layer2_chunk7 = _mm_unpackhi_epi16(layer1_chunk3, layer1_chunk7);\n\n    __m128i layer3_chunk0 = _mm_unpacklo_epi16(layer2_chunk0, layer2_chunk4);\n    __m128i layer3_chunk1 = _mm_unpackhi_epi16(layer2_chunk0, layer2_chunk4);\n    __m128i layer3_chunk2 = _mm_unpacklo_epi16(layer2_chunk1, layer2_chunk5);\n    __m128i layer3_chunk3 = _mm_unpackhi_epi16(layer2_chunk1, layer2_chunk5);\n    __m128i layer3_chunk4 = _mm_unpacklo_epi16(layer2_chunk2, layer2_chunk6);\n    __m128i layer3_chunk5 = _mm_unpackhi_epi16(layer2_chunk2, layer2_chunk6);\n    __m128i layer3_chunk6 = _mm_unpacklo_epi16(layer2_chunk3, layer2_chunk7);\n    __m128i layer3_chunk7 = _mm_unpackhi_epi16(layer2_chunk3, layer2_chunk7);\n\n    v_r0 = _mm_unpacklo_epi16(layer3_chunk0, layer3_chunk4);\n    v_r1 = _mm_unpackhi_epi16(layer3_chunk0, layer3_chunk4);\n    v_g0 = _mm_unpacklo_epi16(layer3_chunk1, layer3_chunk5);\n    v_g1 = _mm_unpackhi_epi16(layer3_chunk1, layer3_chunk5);\n    v_b0 = _mm_unpacklo_epi16(layer3_chunk2, layer3_chunk6);\n    v_b1 = _mm_unpackhi_epi16(layer3_chunk2, layer3_chunk6);\n    v_a0 = _mm_unpacklo_epi16(layer3_chunk3, layer3_chunk7);\n    v_a1 = _mm_unpackhi_epi16(layer3_chunk3, layer3_chunk7);\n}\n\n#if CV_SSE4_1\n\ninline void _mm_interleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1)\n{\n    __m128i v_mask = _mm_set1_epi32(0x0000ffff);\n\n    __m128i layer3_chunk0 = _mm_packus_epi32(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask));\n    __m128i layer3_chunk2 = _mm_packus_epi32(_mm_srli_epi32(v_r0, 16), _mm_srli_epi32(v_r1, 16));\n    __m128i layer3_chunk1 = _mm_packus_epi32(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask));\n    __m128i layer3_chunk3 = _mm_packus_epi32(_mm_srli_epi32(v_g0, 16), _mm_srli_epi32(v_g1, 16));\n\n    __m128i layer2_chunk0 = _mm_packus_epi32(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask));\n    __m128i layer2_chunk2 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk0, 16), _mm_srli_epi32(layer3_chunk1, 16));\n    __m128i layer2_chunk1 = _mm_packus_epi32(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask));\n    __m128i layer2_chunk3 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk2, 16), _mm_srli_epi32(layer3_chunk3, 16));\n\n    __m128i layer1_chunk0 = _mm_packus_epi32(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask));\n    __m128i layer1_chunk2 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk0, 16), _mm_srli_epi32(layer2_chunk1, 16));\n    __m128i layer1_chunk1 = _mm_packus_epi32(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask));\n    __m128i layer1_chunk3 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk2, 16), _mm_srli_epi32(layer2_chunk3, 16));\n\n    v_r0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask));\n    v_g0 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk0, 16), _mm_srli_epi32(layer1_chunk1, 16));\n    v_r1 = _mm_packus_epi32(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask));\n    v_g1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk2, 16), _mm_srli_epi32(layer1_chunk3, 16));\n}\n\ninline void _mm_interleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0,\n                                 __m128i & v_g1, __m128i & v_b0, __m128i & v_b1)\n{\n    __m128i v_mask = _mm_set1_epi32(0x0000ffff);\n\n    __m128i layer3_chunk0 = _mm_packus_epi32(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask));\n    __m128i layer3_chunk3 = _mm_packus_epi32(_mm_srli_epi32(v_r0, 16), _mm_srli_epi32(v_r1, 16));\n    __m128i layer3_chunk1 = _mm_packus_epi32(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask));\n    __m128i layer3_chunk4 = _mm_packus_epi32(_mm_srli_epi32(v_g0, 16), _mm_srli_epi32(v_g1, 16));\n    __m128i layer3_chunk2 = _mm_packus_epi32(_mm_and_si128(v_b0, v_mask), _mm_and_si128(v_b1, v_mask));\n    __m128i layer3_chunk5 = _mm_packus_epi32(_mm_srli_epi32(v_b0, 16), _mm_srli_epi32(v_b1, 16));\n\n    __m128i layer2_chunk0 = _mm_packus_epi32(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask));\n    __m128i layer2_chunk3 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk0, 16), _mm_srli_epi32(layer3_chunk1, 16));\n    __m128i layer2_chunk1 = _mm_packus_epi32(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask));\n    __m128i layer2_chunk4 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk2, 16), _mm_srli_epi32(layer3_chunk3, 16));\n    __m128i layer2_chunk2 = _mm_packus_epi32(_mm_and_si128(layer3_chunk4, v_mask), _mm_and_si128(layer3_chunk5, v_mask));\n    __m128i layer2_chunk5 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk4, 16), _mm_srli_epi32(layer3_chunk5, 16));\n\n    __m128i layer1_chunk0 = _mm_packus_epi32(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask));\n    __m128i layer1_chunk3 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk0, 16), _mm_srli_epi32(layer2_chunk1, 16));\n    __m128i layer1_chunk1 = _mm_packus_epi32(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask));\n    __m128i layer1_chunk4 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk2, 16), _mm_srli_epi32(layer2_chunk3, 16));\n    __m128i layer1_chunk2 = _mm_packus_epi32(_mm_and_si128(layer2_chunk4, v_mask), _mm_and_si128(layer2_chunk5, v_mask));\n    __m128i layer1_chunk5 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk4, 16), _mm_srli_epi32(layer2_chunk5, 16));\n\n    v_r0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask));\n    v_g1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk0, 16), _mm_srli_epi32(layer1_chunk1, 16));\n    v_r1 = _mm_packus_epi32(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask));\n    v_b0 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk2, 16), _mm_srli_epi32(layer1_chunk3, 16));\n    v_g0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk4, v_mask), _mm_and_si128(layer1_chunk5, v_mask));\n    v_b1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk4, 16), _mm_srli_epi32(layer1_chunk5, 16));\n}\n\ninline void _mm_interleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1,\n                                 __m128i & v_b0, __m128i & v_b1, __m128i & v_a0, __m128i & v_a1)\n{\n    __m128i v_mask = _mm_set1_epi32(0x0000ffff);\n\n    __m128i layer3_chunk0 = _mm_packus_epi32(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask));\n    __m128i layer3_chunk4 = _mm_packus_epi32(_mm_srli_epi32(v_r0, 16), _mm_srli_epi32(v_r1, 16));\n    __m128i layer3_chunk1 = _mm_packus_epi32(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask));\n    __m128i layer3_chunk5 = _mm_packus_epi32(_mm_srli_epi32(v_g0, 16), _mm_srli_epi32(v_g1, 16));\n    __m128i layer3_chunk2 = _mm_packus_epi32(_mm_and_si128(v_b0, v_mask), _mm_and_si128(v_b1, v_mask));\n    __m128i layer3_chunk6 = _mm_packus_epi32(_mm_srli_epi32(v_b0, 16), _mm_srli_epi32(v_b1, 16));\n    __m128i layer3_chunk3 = _mm_packus_epi32(_mm_and_si128(v_a0, v_mask), _mm_and_si128(v_a1, v_mask));\n    __m128i layer3_chunk7 = _mm_packus_epi32(_mm_srli_epi32(v_a0, 16), _mm_srli_epi32(v_a1, 16));\n\n    __m128i layer2_chunk0 = _mm_packus_epi32(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask));\n    __m128i layer2_chunk4 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk0, 16), _mm_srli_epi32(layer3_chunk1, 16));\n    __m128i layer2_chunk1 = _mm_packus_epi32(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask));\n    __m128i layer2_chunk5 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk2, 16), _mm_srli_epi32(layer3_chunk3, 16));\n    __m128i layer2_chunk2 = _mm_packus_epi32(_mm_and_si128(layer3_chunk4, v_mask), _mm_and_si128(layer3_chunk5, v_mask));\n    __m128i layer2_chunk6 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk4, 16), _mm_srli_epi32(layer3_chunk5, 16));\n    __m128i layer2_chunk3 = _mm_packus_epi32(_mm_and_si128(layer3_chunk6, v_mask), _mm_and_si128(layer3_chunk7, v_mask));\n    __m128i layer2_chunk7 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk6, 16), _mm_srli_epi32(layer3_chunk7, 16));\n\n    __m128i layer1_chunk0 = _mm_packus_epi32(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask));\n    __m128i layer1_chunk4 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk0, 16), _mm_srli_epi32(layer2_chunk1, 16));\n    __m128i layer1_chunk1 = _mm_packus_epi32(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask));\n    __m128i layer1_chunk5 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk2, 16), _mm_srli_epi32(layer2_chunk3, 16));\n    __m128i layer1_chunk2 = _mm_packus_epi32(_mm_and_si128(layer2_chunk4, v_mask), _mm_and_si128(layer2_chunk5, v_mask));\n    __m128i layer1_chunk6 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk4, 16), _mm_srli_epi32(layer2_chunk5, 16));\n    __m128i layer1_chunk3 = _mm_packus_epi32(_mm_and_si128(layer2_chunk6, v_mask), _mm_and_si128(layer2_chunk7, v_mask));\n    __m128i layer1_chunk7 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk6, 16), _mm_srli_epi32(layer2_chunk7, 16));\n\n    v_r0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask));\n    v_b0 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk0, 16), _mm_srli_epi32(layer1_chunk1, 16));\n    v_r1 = _mm_packus_epi32(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask));\n    v_b1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk2, 16), _mm_srli_epi32(layer1_chunk3, 16));\n    v_g0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk4, v_mask), _mm_and_si128(layer1_chunk5, v_mask));\n    v_a0 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk4, 16), _mm_srli_epi32(layer1_chunk5, 16));\n    v_g1 = _mm_packus_epi32(_mm_and_si128(layer1_chunk6, v_mask), _mm_and_si128(layer1_chunk7, v_mask));\n    v_a1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk6, 16), _mm_srli_epi32(layer1_chunk7, 16));\n}\n\n#endif // CV_SSE4_1\n\ninline void _mm_deinterleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, __m128 & v_g1)\n{\n    __m128 layer1_chunk0 = _mm_unpacklo_ps(v_r0, v_g0);\n    __m128 layer1_chunk1 = _mm_unpackhi_ps(v_r0, v_g0);\n    __m128 layer1_chunk2 = _mm_unpacklo_ps(v_r1, v_g1);\n    __m128 layer1_chunk3 = _mm_unpackhi_ps(v_r1, v_g1);\n\n    __m128 layer2_chunk0 = _mm_unpacklo_ps(layer1_chunk0, layer1_chunk2);\n    __m128 layer2_chunk1 = _mm_unpackhi_ps(layer1_chunk0, layer1_chunk2);\n    __m128 layer2_chunk2 = _mm_unpacklo_ps(layer1_chunk1, layer1_chunk3);\n    __m128 layer2_chunk3 = _mm_unpackhi_ps(layer1_chunk1, layer1_chunk3);\n\n    v_r0 = _mm_unpacklo_ps(layer2_chunk0, layer2_chunk2);\n    v_r1 = _mm_unpackhi_ps(layer2_chunk0, layer2_chunk2);\n    v_g0 = _mm_unpacklo_ps(layer2_chunk1, layer2_chunk3);\n    v_g1 = _mm_unpackhi_ps(layer2_chunk1, layer2_chunk3);\n}\n\ninline void _mm_deinterleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0,\n                                __m128 & v_g1, __m128 & v_b0, __m128 & v_b1)\n{\n    __m128 layer1_chunk0 = _mm_unpacklo_ps(v_r0, v_g1);\n    __m128 layer1_chunk1 = _mm_unpackhi_ps(v_r0, v_g1);\n    __m128 layer1_chunk2 = _mm_unpacklo_ps(v_r1, v_b0);\n    __m128 layer1_chunk3 = _mm_unpackhi_ps(v_r1, v_b0);\n    __m128 layer1_chunk4 = _mm_unpacklo_ps(v_g0, v_b1);\n    __m128 layer1_chunk5 = _mm_unpackhi_ps(v_g0, v_b1);\n\n    __m128 layer2_chunk0 = _mm_unpacklo_ps(layer1_chunk0, layer1_chunk3);\n    __m128 layer2_chunk1 = _mm_unpackhi_ps(layer1_chunk0, layer1_chunk3);\n    __m128 layer2_chunk2 = _mm_unpacklo_ps(layer1_chunk1, layer1_chunk4);\n    __m128 layer2_chunk3 = _mm_unpackhi_ps(layer1_chunk1, layer1_chunk4);\n    __m128 layer2_chunk4 = _mm_unpacklo_ps(layer1_chunk2, layer1_chunk5);\n    __m128 layer2_chunk5 = _mm_unpackhi_ps(layer1_chunk2, layer1_chunk5);\n\n    v_r0 = _mm_unpacklo_ps(layer2_chunk0, layer2_chunk3);\n    v_r1 = _mm_unpackhi_ps(layer2_chunk0, layer2_chunk3);\n    v_g0 = _mm_unpacklo_ps(layer2_chunk1, layer2_chunk4);\n    v_g1 = _mm_unpackhi_ps(layer2_chunk1, layer2_chunk4);\n    v_b0 = _mm_unpacklo_ps(layer2_chunk2, layer2_chunk5);\n    v_b1 = _mm_unpackhi_ps(layer2_chunk2, layer2_chunk5);\n}\n\ninline void _mm_deinterleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, __m128 & v_g1,\n                                __m128 & v_b0, __m128 & v_b1, __m128 & v_a0, __m128 & v_a1)\n{\n    __m128 layer1_chunk0 = _mm_unpacklo_ps(v_r0, v_b0);\n    __m128 layer1_chunk1 = _mm_unpackhi_ps(v_r0, v_b0);\n    __m128 layer1_chunk2 = _mm_unpacklo_ps(v_r1, v_b1);\n    __m128 layer1_chunk3 = _mm_unpackhi_ps(v_r1, v_b1);\n    __m128 layer1_chunk4 = _mm_unpacklo_ps(v_g0, v_a0);\n    __m128 layer1_chunk5 = _mm_unpackhi_ps(v_g0, v_a0);\n    __m128 layer1_chunk6 = _mm_unpacklo_ps(v_g1, v_a1);\n    __m128 layer1_chunk7 = _mm_unpackhi_ps(v_g1, v_a1);\n\n    __m128 layer2_chunk0 = _mm_unpacklo_ps(layer1_chunk0, layer1_chunk4);\n    __m128 layer2_chunk1 = _mm_unpackhi_ps(layer1_chunk0, layer1_chunk4);\n    __m128 layer2_chunk2 = _mm_unpacklo_ps(layer1_chunk1, layer1_chunk5);\n    __m128 layer2_chunk3 = _mm_unpackhi_ps(layer1_chunk1, layer1_chunk5);\n    __m128 layer2_chunk4 = _mm_unpacklo_ps(layer1_chunk2, layer1_chunk6);\n    __m128 layer2_chunk5 = _mm_unpackhi_ps(layer1_chunk2, layer1_chunk6);\n    __m128 layer2_chunk6 = _mm_unpacklo_ps(layer1_chunk3, layer1_chunk7);\n    __m128 layer2_chunk7 = _mm_unpackhi_ps(layer1_chunk3, layer1_chunk7);\n\n    v_r0 = _mm_unpacklo_ps(layer2_chunk0, layer2_chunk4);\n    v_r1 = _mm_unpackhi_ps(layer2_chunk0, layer2_chunk4);\n    v_g0 = _mm_unpacklo_ps(layer2_chunk1, layer2_chunk5);\n    v_g1 = _mm_unpackhi_ps(layer2_chunk1, layer2_chunk5);\n    v_b0 = _mm_unpacklo_ps(layer2_chunk2, layer2_chunk6);\n    v_b1 = _mm_unpackhi_ps(layer2_chunk2, layer2_chunk6);\n    v_a0 = _mm_unpacklo_ps(layer2_chunk3, layer2_chunk7);\n    v_a1 = _mm_unpackhi_ps(layer2_chunk3, layer2_chunk7);\n}\n\ninline void _mm_interleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, __m128 & v_g1)\n{\n    enum { mask_lo = _MM_SHUFFLE(2, 0, 2, 0), mask_hi = _MM_SHUFFLE(3, 1, 3, 1) };\n\n    __m128 layer2_chunk0 = _mm_shuffle_ps(v_r0, v_r1, mask_lo);\n    __m128 layer2_chunk2 = _mm_shuffle_ps(v_r0, v_r1, mask_hi);\n    __m128 layer2_chunk1 = _mm_shuffle_ps(v_g0, v_g1, mask_lo);\n    __m128 layer2_chunk3 = _mm_shuffle_ps(v_g0, v_g1, mask_hi);\n\n    __m128 layer1_chunk0 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_lo);\n    __m128 layer1_chunk2 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_hi);\n    __m128 layer1_chunk1 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_lo);\n    __m128 layer1_chunk3 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_hi);\n\n    v_r0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_lo);\n    v_g0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_hi);\n    v_r1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_lo);\n    v_g1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_hi);\n}\n\ninline void _mm_interleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0,\n                              __m128 & v_g1, __m128 & v_b0, __m128 & v_b1)\n{\n    enum { mask_lo = _MM_SHUFFLE(2, 0, 2, 0), mask_hi = _MM_SHUFFLE(3, 1, 3, 1) };\n\n    __m128 layer2_chunk0 = _mm_shuffle_ps(v_r0, v_r1, mask_lo);\n    __m128 layer2_chunk3 = _mm_shuffle_ps(v_r0, v_r1, mask_hi);\n    __m128 layer2_chunk1 = _mm_shuffle_ps(v_g0, v_g1, mask_lo);\n    __m128 layer2_chunk4 = _mm_shuffle_ps(v_g0, v_g1, mask_hi);\n    __m128 layer2_chunk2 = _mm_shuffle_ps(v_b0, v_b1, mask_lo);\n    __m128 layer2_chunk5 = _mm_shuffle_ps(v_b0, v_b1, mask_hi);\n\n    __m128 layer1_chunk0 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_lo);\n    __m128 layer1_chunk3 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_hi);\n    __m128 layer1_chunk1 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_lo);\n    __m128 layer1_chunk4 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_hi);\n    __m128 layer1_chunk2 = _mm_shuffle_ps(layer2_chunk4, layer2_chunk5, mask_lo);\n    __m128 layer1_chunk5 = _mm_shuffle_ps(layer2_chunk4, layer2_chunk5, mask_hi);\n\n    v_r0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_lo);\n    v_g1 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_hi);\n    v_r1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_lo);\n    v_b0 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_hi);\n    v_g0 = _mm_shuffle_ps(layer1_chunk4, layer1_chunk5, mask_lo);\n    v_b1 = _mm_shuffle_ps(layer1_chunk4, layer1_chunk5, mask_hi);\n}\n\ninline void _mm_interleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, __m128 & v_g1,\n                              __m128 & v_b0, __m128 & v_b1, __m128 & v_a0, __m128 & v_a1)\n{\n    enum { mask_lo = _MM_SHUFFLE(2, 0, 2, 0), mask_hi = _MM_SHUFFLE(3, 1, 3, 1) };\n\n    __m128 layer2_chunk0 = _mm_shuffle_ps(v_r0, v_r1, mask_lo);\n    __m128 layer2_chunk4 = _mm_shuffle_ps(v_r0, v_r1, mask_hi);\n    __m128 layer2_chunk1 = _mm_shuffle_ps(v_g0, v_g1, mask_lo);\n    __m128 layer2_chunk5 = _mm_shuffle_ps(v_g0, v_g1, mask_hi);\n    __m128 layer2_chunk2 = _mm_shuffle_ps(v_b0, v_b1, mask_lo);\n    __m128 layer2_chunk6 = _mm_shuffle_ps(v_b0, v_b1, mask_hi);\n    __m128 layer2_chunk3 = _mm_shuffle_ps(v_a0, v_a1, mask_lo);\n    __m128 layer2_chunk7 = _mm_shuffle_ps(v_a0, v_a1, mask_hi);\n\n    __m128 layer1_chunk0 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_lo);\n    __m128 layer1_chunk4 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_hi);\n    __m128 layer1_chunk1 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_lo);\n    __m128 layer1_chunk5 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_hi);\n    __m128 layer1_chunk2 = _mm_shuffle_ps(layer2_chunk4, layer2_chunk5, mask_lo);\n    __m128 layer1_chunk6 = _mm_shuffle_ps(layer2_chunk4, layer2_chunk5, mask_hi);\n    __m128 layer1_chunk3 = _mm_shuffle_ps(layer2_chunk6, layer2_chunk7, mask_lo);\n    __m128 layer1_chunk7 = _mm_shuffle_ps(layer2_chunk6, layer2_chunk7, mask_hi);\n\n    v_r0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_lo);\n    v_b0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_hi);\n    v_r1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_lo);\n    v_b1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_hi);\n    v_g0 = _mm_shuffle_ps(layer1_chunk4, layer1_chunk5, mask_lo);\n    v_a0 = _mm_shuffle_ps(layer1_chunk4, layer1_chunk5, mask_hi);\n    v_g1 = _mm_shuffle_ps(layer1_chunk6, layer1_chunk7, mask_lo);\n    v_a1 = _mm_shuffle_ps(layer1_chunk6, layer1_chunk7, mask_hi);\n}\n\n#endif // CV_SSE2\n\n//! @}\n\n#endif //OPENCV_CORE_SSE_UTILS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/traits.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_TRAITS_HPP\n#define OPENCV_CORE_TRAITS_HPP\n\n#include \"opencv2/core/cvdef.h\"\n\nnamespace cv\n{\n\n//#define OPENCV_TRAITS_ENABLE_DEPRECATED\n\n//! @addtogroup core_basic\n//! @{\n\n/** @brief Template \"trait\" class for OpenCV primitive data types.\n\n@note Deprecated. This is replaced by \"single purpose\" traits: traits::Type and traits::Depth\n\nA primitive OpenCV data type is one of unsigned char, bool, signed char, unsigned short, signed\nshort, int, float, double, or a tuple of values of one of these types, where all the values in the\ntuple have the same type. Any primitive type from the list can be defined by an identifier in the\nform CV_\\<bit-depth\\>{U|S|F}C(\\<number_of_channels\\>), for example: uchar \\~ CV_8UC1, 3-element\nfloating-point tuple \\~ CV_32FC3, and so on. A universal OpenCV structure that is able to store a\nsingle instance of such a primitive data type is Vec. Multiple instances of such a type can be\nstored in a std::vector, Mat, Mat_, SparseMat, SparseMat_, or any other container that is able to\nstore Vec instances.\n\nThe DataType class is basically used to provide a description of such primitive data types without\nadding any fields or methods to the corresponding classes (and it is actually impossible to add\nanything to primitive C/C++ data types). This technique is known in C++ as class traits. It is not\nDataType itself that is used but its specialized versions, such as:\n@code\n    template<> class DataType<uchar>\n    {\n        typedef uchar value_type;\n        typedef int work_type;\n        typedef uchar channel_type;\n        enum { channel_type = CV_8U, channels = 1, fmt='u', type = CV_8U };\n    };\n    ...\n    template<typename _Tp> DataType<std::complex<_Tp> >\n    {\n        typedef std::complex<_Tp> value_type;\n        typedef std::complex<_Tp> work_type;\n        typedef _Tp channel_type;\n        // DataDepth is another helper trait class\n        enum { depth = DataDepth<_Tp>::value, channels=2,\n            fmt=(channels-1)*256+DataDepth<_Tp>::fmt,\n            type=CV_MAKETYPE(depth, channels) };\n    };\n    ...\n@endcode\nThe main purpose of this class is to convert compilation-time type information to an\nOpenCV-compatible data type identifier, for example:\n@code\n    // allocates a 30x40 floating-point matrix\n    Mat A(30, 40, DataType<float>::type);\n\n    Mat B = Mat_<std::complex<double> >(3, 3);\n    // the statement below will print 6, 2 , that is depth == CV_64F, channels == 2\n    cout << B.depth() << \", \" << B.channels() << endl;\n@endcode\nSo, such traits are used to tell OpenCV which data type you are working with, even if such a type is\nnot native to OpenCV. For example, the matrix B initialization above is compiled because OpenCV\ndefines the proper specialized template class DataType\\<complex\\<_Tp\\> \\> . This mechanism is also\nuseful (and used in OpenCV this way) for generic algorithms implementations.\n\n@note Default values were dropped to stop confusing developers about using of unsupported types (see #7599)\n*/\ntemplate<typename _Tp> class DataType\n{\npublic:\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n    typedef _Tp         value_type;\n    typedef value_type  work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 1,\n           depth        = -1,\n           channels     = 1,\n           fmt          = 0,\n           type = CV_MAKETYPE(depth, channels)\n         };\n#endif\n};\n\ntemplate<> class DataType<bool>\n{\npublic:\n    typedef bool        value_type;\n    typedef int         work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_8U,\n           channels     = 1,\n           fmt          = (int)'u',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\ntemplate<> class DataType<uchar>\n{\npublic:\n    typedef uchar       value_type;\n    typedef int         work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_8U,\n           channels     = 1,\n           fmt          = (int)'u',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\ntemplate<> class DataType<schar>\n{\npublic:\n    typedef schar       value_type;\n    typedef int         work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_8S,\n           channels     = 1,\n           fmt          = (int)'c',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\ntemplate<> class DataType<char>\n{\npublic:\n    typedef schar       value_type;\n    typedef int         work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_8S,\n           channels     = 1,\n           fmt          = (int)'c',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\ntemplate<> class DataType<ushort>\n{\npublic:\n    typedef ushort      value_type;\n    typedef int         work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_16U,\n           channels     = 1,\n           fmt          = (int)'w',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\ntemplate<> class DataType<short>\n{\npublic:\n    typedef short       value_type;\n    typedef int         work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_16S,\n           channels     = 1,\n           fmt          = (int)'s',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\ntemplate<> class DataType<int>\n{\npublic:\n    typedef int         value_type;\n    typedef value_type  work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_32S,\n           channels     = 1,\n           fmt          = (int)'i',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\ntemplate<> class DataType<float>\n{\npublic:\n    typedef float       value_type;\n    typedef value_type  work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_32F,\n           channels     = 1,\n           fmt          = (int)'f',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\ntemplate<> class DataType<double>\n{\npublic:\n    typedef double      value_type;\n    typedef value_type  work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_64F,\n           channels     = 1,\n           fmt          = (int)'d',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\ntemplate<> class DataType<float16_t>\n{\npublic:\n    typedef float16_t   value_type;\n    typedef float       work_type;\n    typedef value_type  channel_type;\n    typedef value_type  vec_type;\n    enum { generic_type = 0,\n           depth        = CV_16F,\n           channels     = 1,\n           fmt          = (int)'h',\n           type         = CV_MAKETYPE(depth, channels)\n         };\n};\n\n/** @brief A helper class for cv::DataType\n\nThe class is specialized for each fundamental numerical data type supported by OpenCV. It provides\nDataDepth<T>::value constant.\n*/\ntemplate<typename _Tp> class DataDepth\n{\npublic:\n    enum\n    {\n        value = DataType<_Tp>::depth,\n        fmt   = DataType<_Tp>::fmt\n    };\n};\n\n\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n\ntemplate<int _depth> class TypeDepth\n{\n#ifdef OPENCV_TRAITS_ENABLE_LEGACY_DEFAULTS\n    enum { depth = CV_USRTYPE1 };\n    typedef void value_type;\n#endif\n};\n\ntemplate<> class TypeDepth<CV_8U>\n{\n    enum { depth = CV_8U };\n    typedef uchar value_type;\n};\n\ntemplate<> class TypeDepth<CV_8S>\n{\n    enum { depth = CV_8S };\n    typedef schar value_type;\n};\n\ntemplate<> class TypeDepth<CV_16U>\n{\n    enum { depth = CV_16U };\n    typedef ushort value_type;\n};\n\ntemplate<> class TypeDepth<CV_16S>\n{\n    enum { depth = CV_16S };\n    typedef short value_type;\n};\n\ntemplate<> class TypeDepth<CV_32S>\n{\n    enum { depth = CV_32S };\n    typedef int value_type;\n};\n\ntemplate<> class TypeDepth<CV_32F>\n{\n    enum { depth = CV_32F };\n    typedef float value_type;\n};\n\ntemplate<> class TypeDepth<CV_64F>\n{\n    enum { depth = CV_64F };\n    typedef double value_type;\n};\n\ntemplate<> class TypeDepth<CV_16F>\n{\n    enum { depth = CV_16F };\n    typedef float16_t value_type;\n};\n\n#endif\n\n//! @}\n\nnamespace traits {\n\nnamespace internal {\n#define CV_CREATE_MEMBER_CHECK(X) \\\ntemplate<typename T> class CheckMember_##X { \\\n    struct Fallback { int X; }; \\\n    struct Derived : T, Fallback { }; \\\n    template<typename U, U> struct Check; \\\n    typedef char CV_NO[1]; \\\n    typedef char CV_YES[2]; \\\n    template<typename U> static CV_NO & func(Check<int Fallback::*, &U::X> *); \\\n    template<typename U> static CV_YES & func(...); \\\npublic: \\\n    typedef CheckMember_##X type; \\\n    enum { value = sizeof(func<Derived>(0)) == sizeof(CV_YES) }; \\\n};\n\nCV_CREATE_MEMBER_CHECK(fmt)\nCV_CREATE_MEMBER_CHECK(type)\n\n} // namespace internal\n\n\ntemplate<typename T>\nstruct Depth\n{ enum { value = DataType<T>::depth }; };\n\ntemplate<typename T>\nstruct Type\n{ enum { value = DataType<T>::type }; };\n\n/** Similar to traits::Type<T> but has value = -1 in case of unknown type (instead of compiler error) */\ntemplate<typename T, bool available = internal::CheckMember_type< DataType<T> >::value >\nstruct SafeType {};\n\ntemplate<typename T>\nstruct SafeType<T, false>\n{ enum { value = -1 }; };\n\ntemplate<typename T>\nstruct SafeType<T, true>\n{ enum { value = Type<T>::value }; };\n\n\ntemplate<typename T, bool available = internal::CheckMember_fmt< DataType<T> >::value >\nstruct SafeFmt {};\n\ntemplate<typename T>\nstruct SafeFmt<T, false>\n{ enum { fmt = 0 }; };\n\ntemplate<typename T>\nstruct SafeFmt<T, true>\n{ enum { fmt = DataType<T>::fmt }; };\n\n\n} // namespace\n\n} // cv\n\n#endif // OPENCV_CORE_TRAITS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/types.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_TYPES_HPP\n#define OPENCV_CORE_TYPES_HPP\n\n#ifndef __cplusplus\n#  error types.hpp header must be compiled as C++\n#endif\n\n#include <climits>\n#include <cfloat>\n#include <vector>\n#include <limits>\n\n#include \"opencv2/core/cvdef.h\"\n#include \"opencv2/core/cvstd.hpp\"\n#include \"opencv2/core/matx.hpp\"\n\nnamespace cv\n{\n\n//! @addtogroup core_basic\n//! @{\n\n//////////////////////////////// Complex //////////////////////////////\n\n/** @brief  A complex number class.\n\n  The template class is similar and compatible with std::complex, however it provides slightly\n  more convenient access to the real and imaginary parts using through the simple field access, as opposite\n  to std::complex::real() and std::complex::imag().\n*/\ntemplate<typename _Tp> class Complex\n{\npublic:\n\n    //! default constructor\n    Complex();\n    Complex( _Tp _re, _Tp _im = 0 );\n\n    //! conversion to another data type\n    template<typename T2> operator Complex<T2>() const;\n    //! conjugation\n    Complex conj() const;\n\n    _Tp re, im; //< the real and the imaginary parts\n};\n\ntypedef Complex<float> Complexf;\ntypedef Complex<double> Complexd;\n\ntemplate<typename _Tp> class DataType< Complex<_Tp> >\n{\npublic:\n    typedef Complex<_Tp> value_type;\n    typedef value_type   work_type;\n    typedef _Tp          channel_type;\n\n    enum { generic_type = 0,\n           channels     = 2,\n           fmt          = DataType<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n    };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nnamespace traits {\ntemplate<typename _Tp>\nstruct Depth< Complex<_Tp> > { enum { value = Depth<_Tp>::value }; };\ntemplate<typename _Tp>\nstruct Type< Complex<_Tp> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, 2) }; };\n} // namespace\n\n\n//////////////////////////////// Point_ ////////////////////////////////\n\n/** @brief Template class for 2D points specified by its coordinates `x` and `y`.\n\nAn instance of the class is interchangeable with C structures, CvPoint and CvPoint2D32f . There is\nalso a cast operator to convert point coordinates to the specified type. The conversion from\nfloating-point coordinates to integer coordinates is done by rounding. Commonly, the conversion\nuses this operation for each of the coordinates. Besides the class members listed in the\ndeclaration above, the following operations on points are implemented:\n@code\n    pt1 = pt2 + pt3;\n    pt1 = pt2 - pt3;\n    pt1 = pt2 * a;\n    pt1 = a * pt2;\n    pt1 = pt2 / a;\n    pt1 += pt2;\n    pt1 -= pt2;\n    pt1 *= a;\n    pt1 /= a;\n    double value = norm(pt); // L2 norm\n    pt1 == pt2;\n    pt1 != pt2;\n@endcode\nFor your convenience, the following type aliases are defined:\n@code\n    typedef Point_<int> Point2i;\n    typedef Point2i Point;\n    typedef Point_<float> Point2f;\n    typedef Point_<double> Point2d;\n@endcode\nExample:\n@code\n    Point2f a(0.3f, 0.f), b(0.f, 0.4f);\n    Point pt = (a + b)*10.f;\n    cout << pt.x << \", \" << pt.y << endl;\n@endcode\n*/\ntemplate<typename _Tp> class Point_\n{\npublic:\n    typedef _Tp value_type;\n\n    //! default constructor\n    Point_();\n    Point_(_Tp _x, _Tp _y);\n    Point_(const Point_& pt);\n    Point_(Point_&& pt) CV_NOEXCEPT;\n    Point_(const Size_<_Tp>& sz);\n    Point_(const Vec<_Tp, 2>& v);\n\n    Point_& operator = (const Point_& pt);\n    Point_& operator = (Point_&& pt) CV_NOEXCEPT;\n    //! conversion to another data type\n    template<typename _Tp2> operator Point_<_Tp2>() const;\n\n    //! conversion to the old-style C structures\n    operator Vec<_Tp, 2>() const;\n\n    //! dot product\n    _Tp dot(const Point_& pt) const;\n    //! dot product computed in double-precision arithmetics\n    double ddot(const Point_& pt) const;\n    //! cross-product\n    double cross(const Point_& pt) const;\n    //! checks whether the point is inside the specified rectangle\n    bool inside(const Rect_<_Tp>& r) const;\n    _Tp x; //!< x coordinate of the point\n    _Tp y; //!< y coordinate of the point\n};\n\ntypedef Point_<int> Point2i;\ntypedef Point_<int64> Point2l;\ntypedef Point_<float> Point2f;\ntypedef Point_<double> Point2d;\ntypedef Point2i Point;\n\ntemplate<typename _Tp> class DataType< Point_<_Tp> >\n{\npublic:\n    typedef Point_<_Tp>                               value_type;\n    typedef Point_<typename DataType<_Tp>::work_type> work_type;\n    typedef _Tp                                       channel_type;\n\n    enum { generic_type = 0,\n           channels     = 2,\n           fmt          = traits::SafeFmt<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nnamespace traits {\ntemplate<typename _Tp>\nstruct Depth< Point_<_Tp> > { enum { value = Depth<_Tp>::value }; };\ntemplate<typename _Tp>\nstruct Type< Point_<_Tp> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, 2) }; };\n} // namespace\n\n\n//////////////////////////////// Point3_ ////////////////////////////////\n\n/** @brief Template class for 3D points specified by its coordinates `x`, `y` and `z`.\n\nAn instance of the class is interchangeable with the C structure CvPoint2D32f . Similarly to\nPoint_ , the coordinates of 3D points can be converted to another type. The vector arithmetic and\ncomparison operations are also supported.\n\nThe following Point3_\\<\\> aliases are available:\n@code\n    typedef Point3_<int> Point3i;\n    typedef Point3_<float> Point3f;\n    typedef Point3_<double> Point3d;\n@endcode\n@see cv::Point3i, cv::Point3f and cv::Point3d\n*/\ntemplate<typename _Tp> class Point3_\n{\npublic:\n    typedef _Tp value_type;\n\n    //! default constructor\n    Point3_();\n    Point3_(_Tp _x, _Tp _y, _Tp _z);\n    Point3_(const Point3_& pt);\n    Point3_(Point3_&& pt) CV_NOEXCEPT;\n    explicit Point3_(const Point_<_Tp>& pt);\n    Point3_(const Vec<_Tp, 3>& v);\n\n    Point3_& operator = (const Point3_& pt);\n    Point3_& operator = (Point3_&& pt) CV_NOEXCEPT;\n    //! conversion to another data type\n    template<typename _Tp2> operator Point3_<_Tp2>() const;\n    //! conversion to cv::Vec<>\n    operator Vec<_Tp, 3>() const;\n\n    //! dot product\n    _Tp dot(const Point3_& pt) const;\n    //! dot product computed in double-precision arithmetics\n    double ddot(const Point3_& pt) const;\n    //! cross product of the 2 3D points\n    Point3_ cross(const Point3_& pt) const;\n    _Tp x; //!< x coordinate of the 3D point\n    _Tp y; //!< y coordinate of the 3D point\n    _Tp z; //!< z coordinate of the 3D point\n};\n\ntypedef Point3_<int> Point3i;\ntypedef Point3_<float> Point3f;\ntypedef Point3_<double> Point3d;\n\ntemplate<typename _Tp> class DataType< Point3_<_Tp> >\n{\npublic:\n    typedef Point3_<_Tp>                               value_type;\n    typedef Point3_<typename DataType<_Tp>::work_type> work_type;\n    typedef _Tp                                        channel_type;\n\n    enum { generic_type = 0,\n           channels     = 3,\n           fmt          = traits::SafeFmt<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nnamespace traits {\ntemplate<typename _Tp>\nstruct Depth< Point3_<_Tp> > { enum { value = Depth<_Tp>::value }; };\ntemplate<typename _Tp>\nstruct Type< Point3_<_Tp> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, 3) }; };\n} // namespace\n\n//////////////////////////////// Size_ ////////////////////////////////\n\n/** @brief Template class for specifying the size of an image or rectangle.\n\nThe class includes two members called width and height. The structure can be converted to and from\nthe old OpenCV structures CvSize and CvSize2D32f . The same set of arithmetic and comparison\noperations as for Point_ is available.\n\nOpenCV defines the following Size_\\<\\> aliases:\n@code\n    typedef Size_<int> Size2i;\n    typedef Size2i Size;\n    typedef Size_<float> Size2f;\n@endcode\n*/\ntemplate<typename _Tp> class Size_\n{\npublic:\n    typedef _Tp value_type;\n\n    //! default constructor\n    Size_();\n    Size_(_Tp _width, _Tp _height);\n    Size_(const Size_& sz);\n    Size_(Size_&& sz) CV_NOEXCEPT;\n    Size_(const Point_<_Tp>& pt);\n\n    Size_& operator = (const Size_& sz);\n    Size_& operator = (Size_&& sz) CV_NOEXCEPT;\n    //! the area (width*height)\n    _Tp area() const;\n    //! aspect ratio (width/height)\n    double aspectRatio() const;\n    //! true if empty\n    bool empty() const;\n\n    //! conversion of another data type.\n    template<typename _Tp2> operator Size_<_Tp2>() const;\n\n    _Tp width; //!< the width\n    _Tp height; //!< the height\n};\n\ntypedef Size_<int> Size2i;\ntypedef Size_<int64> Size2l;\ntypedef Size_<float> Size2f;\ntypedef Size_<double> Size2d;\ntypedef Size2i Size;\n\ntemplate<typename _Tp> class DataType< Size_<_Tp> >\n{\npublic:\n    typedef Size_<_Tp>                               value_type;\n    typedef Size_<typename DataType<_Tp>::work_type> work_type;\n    typedef _Tp                                      channel_type;\n\n    enum { generic_type = 0,\n           channels     = 2,\n           fmt          = DataType<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nnamespace traits {\ntemplate<typename _Tp>\nstruct Depth< Size_<_Tp> > { enum { value = Depth<_Tp>::value }; };\ntemplate<typename _Tp>\nstruct Type< Size_<_Tp> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, 2) }; };\n} // namespace\n\n//////////////////////////////// Rect_ ////////////////////////////////\n\n/** @brief Template class for 2D rectangles\n\ndescribed by the following parameters:\n-   Coordinates of the top-left corner. This is a default interpretation of Rect_::x and Rect_::y\n    in OpenCV. Though, in your algorithms you may count x and y from the bottom-left corner.\n-   Rectangle width and height.\n\nOpenCV typically assumes that the top and left boundary of the rectangle are inclusive, while the\nright and bottom boundaries are not. For example, the method Rect_::contains returns true if\n\n\\f[x  \\leq pt.x < x+width,\n      y  \\leq pt.y < y+height\\f]\n\nVirtually every loop over an image ROI in OpenCV (where ROI is specified by Rect_\\<int\\> ) is\nimplemented as:\n@code\n    for(int y = roi.y; y < roi.y + roi.height; y++)\n        for(int x = roi.x; x < roi.x + roi.width; x++)\n        {\n            // ...\n        }\n@endcode\nIn addition to the class members, the following operations on rectangles are implemented:\n-   \\f$\\texttt{rect} = \\texttt{rect} \\pm \\texttt{point}\\f$ (shifting a rectangle by a certain offset)\n-   \\f$\\texttt{rect} = \\texttt{rect} \\pm \\texttt{size}\\f$ (expanding or shrinking a rectangle by a\n    certain amount)\n-   rect += point, rect -= point, rect += size, rect -= size (augmenting operations)\n-   rect = rect1 & rect2 (rectangle intersection)\n-   rect = rect1 | rect2 (minimum area rectangle containing rect1 and rect2 )\n-   rect &= rect1, rect |= rect1 (and the corresponding augmenting operations)\n-   rect == rect1, rect != rect1 (rectangle comparison)\n\nThis is an example how the partial ordering on rectangles can be established (rect1 \\f$\\subseteq\\f$\nrect2):\n@code\n    template<typename _Tp> inline bool\n    operator <= (const Rect_<_Tp>& r1, const Rect_<_Tp>& r2)\n    {\n        return (r1 & r2) == r1;\n    }\n@endcode\nFor your convenience, the Rect_\\<\\> alias is available: cv::Rect\n*/\ntemplate<typename _Tp> class Rect_\n{\npublic:\n    typedef _Tp value_type;\n\n    //! default constructor\n    Rect_();\n    Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height);\n    Rect_(const Rect_& r);\n    Rect_(Rect_&& r) CV_NOEXCEPT;\n    Rect_(const Point_<_Tp>& org, const Size_<_Tp>& sz);\n    Rect_(const Point_<_Tp>& pt1, const Point_<_Tp>& pt2);\n\n    Rect_& operator = ( const Rect_& r );\n    Rect_& operator = ( Rect_&& r ) CV_NOEXCEPT;\n    //! the top-left corner\n    Point_<_Tp> tl() const;\n    //! the bottom-right corner\n    Point_<_Tp> br() const;\n\n    //! size (width, height) of the rectangle\n    Size_<_Tp> size() const;\n    //! area (width*height) of the rectangle\n    _Tp area() const;\n    //! true if empty\n    bool empty() const;\n\n    //! conversion to another data type\n    template<typename _Tp2> operator Rect_<_Tp2>() const;\n\n    //! checks whether the rectangle contains the point\n    bool contains(const Point_<_Tp>& pt) const;\n\n    _Tp x; //!< x coordinate of the top-left corner\n    _Tp y; //!< y coordinate of the top-left corner\n    _Tp width; //!< width of the rectangle\n    _Tp height; //!< height of the rectangle\n};\n\ntypedef Rect_<int> Rect2i;\ntypedef Rect_<float> Rect2f;\ntypedef Rect_<double> Rect2d;\ntypedef Rect2i Rect;\n\ntemplate<typename _Tp> class DataType< Rect_<_Tp> >\n{\npublic:\n    typedef Rect_<_Tp>                               value_type;\n    typedef Rect_<typename DataType<_Tp>::work_type> work_type;\n    typedef _Tp                                      channel_type;\n\n    enum { generic_type = 0,\n           channels     = 4,\n           fmt          = traits::SafeFmt<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nnamespace traits {\ntemplate<typename _Tp>\nstruct Depth< Rect_<_Tp> > { enum { value = Depth<_Tp>::value }; };\ntemplate<typename _Tp>\nstruct Type< Rect_<_Tp> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, 4) }; };\n} // namespace\n\n///////////////////////////// RotatedRect /////////////////////////////\n\n/** @brief The class represents rotated (i.e. not up-right) rectangles on a plane.\n\nEach rectangle is specified by the center point (mass center), length of each side (represented by\n#Size2f structure) and the rotation angle in degrees.\n\nThe sample below demonstrates how to use RotatedRect:\n@snippet snippets/core_various.cpp RotatedRect_demo\n![image](pics/rotatedrect.png)\n\n@sa CamShift, fitEllipse, minAreaRect, CvBox2D\n*/\nclass CV_EXPORTS RotatedRect\n{\npublic:\n    //! default constructor\n    RotatedRect();\n    /** full constructor\n    @param center The rectangle mass center.\n    @param size Width and height of the rectangle.\n    @param angle The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc.,\n    the rectangle becomes an up-right rectangle.\n    */\n    RotatedRect(const Point2f& center, const Size2f& size, float angle);\n    /**\n    Any 3 end points of the RotatedRect. They must be given in order (either clockwise or\n    anticlockwise).\n     */\n    RotatedRect(const Point2f& point1, const Point2f& point2, const Point2f& point3);\n\n    /** returns 4 vertices of the rectangle\n    @param pts The points array for storing rectangle vertices. The order is bottomLeft, topLeft, topRight, bottomRight.\n    */\n    void points(Point2f pts[]) const;\n    //! returns the minimal up-right integer rectangle containing the rotated rectangle\n    Rect boundingRect() const;\n    //! returns the minimal (exact) floating point rectangle containing the rotated rectangle, not intended for use with images\n    Rect_<float> boundingRect2f() const;\n    //! returns the rectangle mass center\n    Point2f center;\n    //! returns width and height of the rectangle\n    Size2f size;\n    //! returns the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.\n    float angle;\n};\n\ntemplate<> class DataType< RotatedRect >\n{\npublic:\n    typedef RotatedRect  value_type;\n    typedef value_type   work_type;\n    typedef float        channel_type;\n\n    enum { generic_type = 0,\n           channels     = (int)sizeof(value_type)/sizeof(channel_type), // 5\n           fmt          = traits::SafeFmt<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nnamespace traits {\ntemplate<>\nstruct Depth< RotatedRect > { enum { value = Depth<float>::value }; };\ntemplate<>\nstruct Type< RotatedRect > { enum { value = CV_MAKETYPE(Depth<float>::value, (int)sizeof(RotatedRect)/sizeof(float)) }; };\n} // namespace\n\n\n//////////////////////////////// Range /////////////////////////////////\n\n/** @brief Template class specifying a continuous subsequence (slice) of a sequence.\n\nThe class is used to specify a row or a column span in a matrix ( Mat ) and for many other purposes.\nRange(a,b) is basically the same as a:b in Matlab or a..b in Python. As in Python, start is an\ninclusive left boundary of the range and end is an exclusive right boundary of the range. Such a\nhalf-opened interval is usually denoted as \\f$[start,end)\\f$ .\n\nThe static method Range::all() returns a special variable that means \"the whole sequence\" or \"the\nwhole range\", just like \" : \" in Matlab or \" ... \" in Python. All the methods and functions in\nOpenCV that take Range support this special Range::all() value. But, of course, in case of your own\ncustom processing, you will probably have to check and handle it explicitly:\n@code\n    void my_function(..., const Range& r, ....)\n    {\n        if(r == Range::all()) {\n            // process all the data\n        }\n        else {\n            // process [r.start, r.end)\n        }\n    }\n@endcode\n*/\nclass CV_EXPORTS Range\n{\npublic:\n    Range();\n    Range(int _start, int _end);\n    int size() const;\n    bool empty() const;\n    static Range all();\n\n    int start, end;\n};\n\ntemplate<> class DataType<Range>\n{\npublic:\n    typedef Range      value_type;\n    typedef value_type work_type;\n    typedef int        channel_type;\n\n    enum { generic_type = 0,\n           channels     = 2,\n           fmt          = traits::SafeFmt<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nnamespace traits {\ntemplate<>\nstruct Depth< Range > { enum { value = Depth<int>::value }; };\ntemplate<>\nstruct Type< Range > { enum { value = CV_MAKETYPE(Depth<int>::value, 2) }; };\n} // namespace\n\n\n//////////////////////////////// Scalar_ ///////////////////////////////\n\n/** @brief Template class for a 4-element vector derived from Vec.\n\nBeing derived from Vec\\<_Tp, 4\\> , Scalar\\_ and Scalar can be used just as typical 4-element\nvectors. In addition, they can be converted to/from CvScalar . The type Scalar is widely used in\nOpenCV to pass pixel values.\n*/\ntemplate<typename _Tp> class Scalar_ : public Vec<_Tp, 4>\n{\npublic:\n    //! default constructor\n    Scalar_();\n    Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0);\n    Scalar_(_Tp v0);\n\n    Scalar_(const Scalar_& s);\n    Scalar_(Scalar_&& s) CV_NOEXCEPT;\n\n    Scalar_& operator=(const Scalar_& s);\n    Scalar_& operator=(Scalar_&& s) CV_NOEXCEPT;\n\n    template<typename _Tp2, int cn>\n    Scalar_(const Vec<_Tp2, cn>& v);\n\n    //! returns a scalar with all elements set to v0\n    static Scalar_<_Tp> all(_Tp v0);\n\n    //! conversion to another data type\n    template<typename T2> operator Scalar_<T2>() const;\n\n    //! per-element product\n    Scalar_<_Tp> mul(const Scalar_<_Tp>& a, double scale=1 ) const;\n\n    //! returns (v0, -v1, -v2, -v3)\n    Scalar_<_Tp> conj() const;\n\n    //! returns true iff v1 == v2 == v3 == 0\n    bool isReal() const;\n};\n\ntypedef Scalar_<double> Scalar;\n\ntemplate<typename _Tp> class DataType< Scalar_<_Tp> >\n{\npublic:\n    typedef Scalar_<_Tp>                               value_type;\n    typedef Scalar_<typename DataType<_Tp>::work_type> work_type;\n    typedef _Tp                                        channel_type;\n\n    enum { generic_type = 0,\n           channels     = 4,\n           fmt          = traits::SafeFmt<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nnamespace traits {\ntemplate<typename _Tp>\nstruct Depth< Scalar_<_Tp> > { enum { value = Depth<_Tp>::value }; };\ntemplate<typename _Tp>\nstruct Type< Scalar_<_Tp> > { enum { value = CV_MAKETYPE(Depth<_Tp>::value, 4) }; };\n} // namespace\n\n\n/////////////////////////////// KeyPoint ////////////////////////////////\n\n/** @brief Data structure for salient point detectors.\n\nThe class instance stores a keypoint, i.e. a point feature found by one of many available keypoint\ndetectors, such as Harris corner detector, #FAST, %StarDetector, %SURF, %SIFT etc.\n\nThe keypoint is characterized by the 2D position, scale (proportional to the diameter of the\nneighborhood that needs to be taken into account), orientation and some other parameters. The\nkeypoint neighborhood is then analyzed by another algorithm that builds a descriptor (usually\nrepresented as a feature vector). The keypoints representing the same object in different images\ncan then be matched using %KDTree or another method.\n*/\nclass CV_EXPORTS_W_SIMPLE KeyPoint\n{\npublic:\n    //! the default constructor\n    CV_WRAP KeyPoint();\n    /**\n    @param pt x & y coordinates of the keypoint\n    @param size keypoint diameter\n    @param angle keypoint orientation\n    @param response keypoint detector response on the keypoint (that is, strength of the keypoint)\n    @param octave pyramid octave in which the keypoint has been detected\n    @param class_id object id\n     */\n    KeyPoint(Point2f pt, float size, float angle=-1, float response=0, int octave=0, int class_id=-1);\n    /**\n    @param x x-coordinate of the keypoint\n    @param y y-coordinate of the keypoint\n    @param size keypoint diameter\n    @param angle keypoint orientation\n    @param response keypoint detector response on the keypoint (that is, strength of the keypoint)\n    @param octave pyramid octave in which the keypoint has been detected\n    @param class_id object id\n     */\n    CV_WRAP KeyPoint(float x, float y, float size, float angle=-1, float response=0, int octave=0, int class_id=-1);\n\n    size_t hash() const;\n\n    /**\n    This method converts vector of keypoints to vector of points or the reverse, where each keypoint is\n    assigned the same size and the same orientation.\n\n    @param keypoints Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORB\n    @param points2f Array of (x,y) coordinates of each keypoint\n    @param keypointIndexes Array of indexes of keypoints to be converted to points. (Acts like a mask to\n    convert only specified keypoints)\n    */\n    CV_WRAP static void convert(const std::vector<KeyPoint>& keypoints,\n                                CV_OUT std::vector<Point2f>& points2f,\n                                const std::vector<int>& keypointIndexes=std::vector<int>());\n    /** @overload\n    @param points2f Array of (x,y) coordinates of each keypoint\n    @param keypoints Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORB\n    @param size keypoint diameter\n    @param response keypoint detector response on the keypoint (that is, strength of the keypoint)\n    @param octave pyramid octave in which the keypoint has been detected\n    @param class_id object id\n    */\n    CV_WRAP static void convert(const std::vector<Point2f>& points2f,\n                                CV_OUT std::vector<KeyPoint>& keypoints,\n                                float size=1, float response=1, int octave=0, int class_id=-1);\n\n    /**\n    This method computes overlap for pair of keypoints. Overlap is the ratio between area of keypoint\n    regions' intersection and area of keypoint regions' union (considering keypoint region as circle).\n    If they don't overlap, we get zero. If they coincide at same location with same size, we get 1.\n    @param kp1 First keypoint\n    @param kp2 Second keypoint\n    */\n    CV_WRAP static float overlap(const KeyPoint& kp1, const KeyPoint& kp2);\n\n    CV_PROP_RW Point2f pt; //!< coordinates of the keypoints\n    CV_PROP_RW float size; //!< diameter of the meaningful keypoint neighborhood\n    CV_PROP_RW float angle; //!< computed orientation of the keypoint (-1 if not applicable);\n                            //!< it's in [0,360) degrees and measured relative to\n                            //!< image coordinate system, ie in clockwise.\n    CV_PROP_RW float response; //!< the response by which the most strong keypoints have been selected. Can be used for the further sorting or subsampling\n    CV_PROP_RW int octave; //!< octave (pyramid layer) from which the keypoint has been extracted\n    CV_PROP_RW int class_id; //!< object class (if the keypoints need to be clustered by an object they belong to)\n};\n\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\ntemplate<> class DataType<KeyPoint>\n{\npublic:\n    typedef KeyPoint      value_type;\n    typedef float         work_type;\n    typedef float         channel_type;\n\n    enum { generic_type = 0,\n           depth        = DataType<channel_type>::depth,\n           channels     = (int)(sizeof(value_type)/sizeof(channel_type)), // 7\n           fmt          = DataType<channel_type>::fmt + ((channels - 1) << 8),\n           type         = CV_MAKETYPE(depth, channels)\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n#endif\n\n\n//////////////////////////////// DMatch /////////////////////////////////\n\n/** @brief Class for matching keypoint descriptors\n\nquery descriptor index, train descriptor index, train image index, and distance between\ndescriptors.\n*/\nclass CV_EXPORTS_W_SIMPLE DMatch\n{\npublic:\n    CV_WRAP DMatch();\n    CV_WRAP DMatch(int _queryIdx, int _trainIdx, float _distance);\n    CV_WRAP DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance);\n\n    CV_PROP_RW int queryIdx; //!< query descriptor index\n    CV_PROP_RW int trainIdx; //!< train descriptor index\n    CV_PROP_RW int imgIdx;   //!< train image index\n\n    CV_PROP_RW float distance;\n\n    // less is better\n    bool operator<(const DMatch &m) const;\n};\n\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\ntemplate<> class DataType<DMatch>\n{\npublic:\n    typedef DMatch      value_type;\n    typedef int         work_type;\n    typedef int         channel_type;\n\n    enum { generic_type = 0,\n           depth        = DataType<channel_type>::depth,\n           channels     = (int)(sizeof(value_type)/sizeof(channel_type)), // 4\n           fmt          = DataType<channel_type>::fmt + ((channels - 1) << 8),\n           type         = CV_MAKETYPE(depth, channels)\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n#endif\n\n\n///////////////////////////// TermCriteria //////////////////////////////\n\n/** @brief The class defining termination criteria for iterative algorithms.\n\nYou can initialize it by default constructor and then override any parameters, or the structure may\nbe fully initialized using the advanced variant of the constructor.\n*/\nclass CV_EXPORTS TermCriteria\n{\npublic:\n    /**\n      Criteria type, can be one of: COUNT, EPS or COUNT + EPS\n    */\n    enum Type\n    {\n        COUNT=1, //!< the maximum number of iterations or elements to compute\n        MAX_ITER=COUNT, //!< ditto\n        EPS=2 //!< the desired accuracy or change in parameters at which the iterative algorithm stops\n    };\n\n    //! default constructor\n    TermCriteria();\n    /**\n    @param type The type of termination criteria, one of TermCriteria::Type\n    @param maxCount The maximum number of iterations or elements to compute.\n    @param epsilon The desired accuracy or change in parameters at which the iterative algorithm stops.\n    */\n    TermCriteria(int type, int maxCount, double epsilon);\n\n    inline bool isValid() const\n    {\n        const bool isCount = (type & COUNT) && maxCount > 0;\n        const bool isEps = (type & EPS) && !cvIsNaN(epsilon);\n        return isCount || isEps;\n    }\n\n    int type; //!< the type of termination criteria: COUNT, EPS or COUNT + EPS\n    int maxCount; //!< the maximum number of iterations/elements\n    double epsilon; //!< the desired accuracy\n};\n\n\n//! @} core_basic\n\n///////////////////////// raster image moments //////////////////////////\n\n//! @addtogroup imgproc_shape\n//! @{\n\n/** @brief struct returned by cv::moments\n\nThe spatial moments \\f$\\texttt{Moments::m}_{ji}\\f$ are computed as:\n\n\\f[\\texttt{m} _{ji}= \\sum _{x,y}  \\left ( \\texttt{array} (x,y)  \\cdot x^j  \\cdot y^i \\right )\\f]\n\nThe central moments \\f$\\texttt{Moments::mu}_{ji}\\f$ are computed as:\n\n\\f[\\texttt{mu} _{ji}= \\sum _{x,y}  \\left ( \\texttt{array} (x,y)  \\cdot (x -  \\bar{x} )^j  \\cdot (y -  \\bar{y} )^i \\right )\\f]\n\nwhere \\f$(\\bar{x}, \\bar{y})\\f$ is the mass center:\n\n\\f[\\bar{x} = \\frac{\\texttt{m}_{10}}{\\texttt{m}_{00}} , \\; \\bar{y} = \\frac{\\texttt{m}_{01}}{\\texttt{m}_{00}}\\f]\n\nThe normalized central moments \\f$\\texttt{Moments::nu}_{ij}\\f$ are computed as:\n\n\\f[\\texttt{nu} _{ji}= \\frac{\\texttt{mu}_{ji}}{\\texttt{m}_{00}^{(i+j)/2+1}} .\\f]\n\n@note\n\\f$\\texttt{mu}_{00}=\\texttt{m}_{00}\\f$, \\f$\\texttt{nu}_{00}=1\\f$\n\\f$\\texttt{nu}_{10}=\\texttt{mu}_{10}=\\texttt{mu}_{01}=\\texttt{mu}_{10}=0\\f$ , hence the values are not\nstored.\n\nThe moments of a contour are defined in the same way but computed using the Green's formula (see\n<http://en.wikipedia.org/wiki/Green_theorem>). So, due to a limited raster resolution, the moments\ncomputed for a contour are slightly different from the moments computed for the same rasterized\ncontour.\n\n@note\nSince the contour moments are computed using Green formula, you may get seemingly odd results for\ncontours with self-intersections, e.g. a zero area (m00) for butterfly-shaped contours.\n */\nclass CV_EXPORTS_W_MAP Moments\n{\npublic:\n    //! the default constructor\n    Moments();\n    //! the full constructor\n    Moments(double m00, double m10, double m01, double m20, double m11,\n            double m02, double m30, double m21, double m12, double m03 );\n    ////! the conversion from CvMoments\n    //Moments( const CvMoments& moments );\n    ////! the conversion to CvMoments\n    //operator CvMoments() const;\n\n    //! @name spatial moments\n    //! @{\n    CV_PROP_RW double  m00, m10, m01, m20, m11, m02, m30, m21, m12, m03;\n    //! @}\n\n    //! @name central moments\n    //! @{\n    CV_PROP_RW double  mu20, mu11, mu02, mu30, mu21, mu12, mu03;\n    //! @}\n\n    //! @name central normalized moments\n    //! @{\n    CV_PROP_RW double  nu20, nu11, nu02, nu30, nu21, nu12, nu03;\n    //! @}\n};\n\ntemplate<> class DataType<Moments>\n{\npublic:\n    typedef Moments     value_type;\n    typedef double      work_type;\n    typedef double      channel_type;\n\n    enum { generic_type = 0,\n           channels     = (int)(sizeof(value_type)/sizeof(channel_type)), // 24\n           fmt          = DataType<channel_type>::fmt + ((channels - 1) << 8)\n#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED\n           ,depth        = DataType<channel_type>::depth\n           ,type         = CV_MAKETYPE(depth, channels)\n#endif\n         };\n\n    typedef Vec<channel_type, channels> vec_type;\n};\n\nnamespace traits {\ntemplate<>\nstruct Depth< Moments > { enum { value = Depth<double>::value }; };\ntemplate<>\nstruct Type< Moments > { enum { value = CV_MAKETYPE(Depth<double>::value, (int)(sizeof(Moments)/sizeof(double))) }; };\n} // namespace\n\n//! @} imgproc_shape\n\n//! @cond IGNORED\n\n/////////////////////////////////////////////////////////////////////////\n///////////////////////////// Implementation ////////////////////////////\n/////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////// Complex ////////////////////////////////\n\ntemplate<typename _Tp> inline\nComplex<_Tp>::Complex()\n    : re(0), im(0) {}\n\ntemplate<typename _Tp> inline\nComplex<_Tp>::Complex( _Tp _re, _Tp _im )\n    : re(_re), im(_im) {}\n\ntemplate<typename _Tp> template<typename T2> inline\nComplex<_Tp>::operator Complex<T2>() const\n{\n    return Complex<T2>(saturate_cast<T2>(re), saturate_cast<T2>(im));\n}\n\ntemplate<typename _Tp> inline\nComplex<_Tp> Complex<_Tp>::conj() const\n{\n    return Complex<_Tp>(re, -im);\n}\n\n\ntemplate<typename _Tp> static inline\nbool operator == (const Complex<_Tp>& a, const Complex<_Tp>& b)\n{\n    return a.re == b.re && a.im == b.im;\n}\n\ntemplate<typename _Tp> static inline\nbool operator != (const Complex<_Tp>& a, const Complex<_Tp>& b)\n{\n    return a.re != b.re || a.im != b.im;\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator + (const Complex<_Tp>& a, const Complex<_Tp>& b)\n{\n    return Complex<_Tp>( a.re + b.re, a.im + b.im );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp>& operator += (Complex<_Tp>& a, const Complex<_Tp>& b)\n{\n    a.re += b.re; a.im += b.im;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator - (const Complex<_Tp>& a, const Complex<_Tp>& b)\n{\n    return Complex<_Tp>( a.re - b.re, a.im - b.im );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp>& operator -= (Complex<_Tp>& a, const Complex<_Tp>& b)\n{\n    a.re -= b.re; a.im -= b.im;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator - (const Complex<_Tp>& a)\n{\n    return Complex<_Tp>(-a.re, -a.im);\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator * (const Complex<_Tp>& a, const Complex<_Tp>& b)\n{\n    return Complex<_Tp>( a.re*b.re - a.im*b.im, a.re*b.im + a.im*b.re );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator * (const Complex<_Tp>& a, _Tp b)\n{\n    return Complex<_Tp>( a.re*b, a.im*b );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator * (_Tp b, const Complex<_Tp>& a)\n{\n    return Complex<_Tp>( a.re*b, a.im*b );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator + (const Complex<_Tp>& a, _Tp b)\n{\n    return Complex<_Tp>( a.re + b, a.im );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator - (const Complex<_Tp>& a, _Tp b)\n{ return Complex<_Tp>( a.re - b, a.im ); }\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator + (_Tp b, const Complex<_Tp>& a)\n{\n    return Complex<_Tp>( a.re + b, a.im );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator - (_Tp b, const Complex<_Tp>& a)\n{\n    return Complex<_Tp>( b - a.re, -a.im );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp>& operator += (Complex<_Tp>& a, _Tp b)\n{\n    a.re += b; return a;\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp>& operator -= (Complex<_Tp>& a, _Tp b)\n{\n    a.re -= b; return a;\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp>& operator *= (Complex<_Tp>& a, _Tp b)\n{\n    a.re *= b; a.im *= b; return a;\n}\n\ntemplate<typename _Tp> static inline\ndouble abs(const Complex<_Tp>& a)\n{\n    return std::sqrt( (double)a.re*a.re + (double)a.im*a.im);\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b)\n{\n    double t = 1./((double)b.re*b.re + (double)b.im*b.im);\n    return Complex<_Tp>( (_Tp)((a.re*b.re + a.im*b.im)*t),\n                        (_Tp)((-a.re*b.im + a.im*b.re)*t) );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp>& operator /= (Complex<_Tp>& a, const Complex<_Tp>& b)\n{\n    a = a / b;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator / (const Complex<_Tp>& a, _Tp b)\n{\n    _Tp t = (_Tp)1/b;\n    return Complex<_Tp>( a.re*t, a.im*t );\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator / (_Tp b, const Complex<_Tp>& a)\n{\n    return Complex<_Tp>(b)/a;\n}\n\ntemplate<typename _Tp> static inline\nComplex<_Tp> operator /= (const Complex<_Tp>& a, _Tp b)\n{\n    _Tp t = (_Tp)1/b;\n    a.re *= t; a.im *= t; return a;\n}\n\n\n\n//////////////////////////////// 2D Point ///////////////////////////////\n\ntemplate<typename _Tp> inline\nPoint_<_Tp>::Point_()\n    : x(0), y(0) {}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp>::Point_(_Tp _x, _Tp _y)\n    : x(_x), y(_y) {}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp>::Point_(const Point_& pt)\n    : x(pt.x), y(pt.y) {}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp>::Point_(Point_&& pt) CV_NOEXCEPT\n    : x(std::move(pt.x)), y(std::move(pt.y)) {}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp>::Point_(const Size_<_Tp>& sz)\n    : x(sz.width), y(sz.height) {}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp>::Point_(const Vec<_Tp,2>& v)\n    : x(v[0]), y(v[1]) {}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp>& Point_<_Tp>::operator = (const Point_& pt)\n{\n    x = pt.x; y = pt.y;\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp>& Point_<_Tp>::operator = (Point_&& pt) CV_NOEXCEPT\n{\n    x = std::move(pt.x); y = std::move(pt.y);\n    return *this;\n}\n\ntemplate<typename _Tp> template<typename _Tp2> inline\nPoint_<_Tp>::operator Point_<_Tp2>() const\n{\n    return Point_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y));\n}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp>::operator Vec<_Tp, 2>() const\n{\n    return Vec<_Tp, 2>(x, y);\n}\n\ntemplate<typename _Tp> inline\n_Tp Point_<_Tp>::dot(const Point_& pt) const\n{\n    return saturate_cast<_Tp>(x*pt.x + y*pt.y);\n}\n\ntemplate<typename _Tp> inline\ndouble Point_<_Tp>::ddot(const Point_& pt) const\n{\n    return (double)x*(double)(pt.x) + (double)y*(double)(pt.y);\n}\n\ntemplate<typename _Tp> inline\ndouble Point_<_Tp>::cross(const Point_& pt) const\n{\n    return (double)x*pt.y - (double)y*pt.x;\n}\n\ntemplate<typename _Tp> inline bool\nPoint_<_Tp>::inside( const Rect_<_Tp>& r ) const\n{\n    return r.contains(*this);\n}\n\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp>& operator += (Point_<_Tp>& a, const Point_<_Tp>& b)\n{\n    a.x += b.x;\n    a.y += b.y;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp>& operator -= (Point_<_Tp>& a, const Point_<_Tp>& b)\n{\n    a.x -= b.x;\n    a.y -= b.y;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp>& operator *= (Point_<_Tp>& a, int b)\n{\n    a.x = saturate_cast<_Tp>(a.x * b);\n    a.y = saturate_cast<_Tp>(a.y * b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp>& operator *= (Point_<_Tp>& a, float b)\n{\n    a.x = saturate_cast<_Tp>(a.x * b);\n    a.y = saturate_cast<_Tp>(a.y * b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp>& operator *= (Point_<_Tp>& a, double b)\n{\n    a.x = saturate_cast<_Tp>(a.x * b);\n    a.y = saturate_cast<_Tp>(a.y * b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp>& operator /= (Point_<_Tp>& a, int b)\n{\n    a.x = saturate_cast<_Tp>(a.x / b);\n    a.y = saturate_cast<_Tp>(a.y / b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp>& operator /= (Point_<_Tp>& a, float b)\n{\n    a.x = saturate_cast<_Tp>(a.x / b);\n    a.y = saturate_cast<_Tp>(a.y / b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp>& operator /= (Point_<_Tp>& a, double b)\n{\n    a.x = saturate_cast<_Tp>(a.x / b);\n    a.y = saturate_cast<_Tp>(a.y / b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\ndouble norm(const Point_<_Tp>& pt)\n{\n    return std::sqrt((double)pt.x*pt.x + (double)pt.y*pt.y);\n}\n\ntemplate<typename _Tp> static inline\nbool operator == (const Point_<_Tp>& a, const Point_<_Tp>& b)\n{\n    return a.x == b.x && a.y == b.y;\n}\n\ntemplate<typename _Tp> static inline\nbool operator != (const Point_<_Tp>& a, const Point_<_Tp>& b)\n{\n    return a.x != b.x || a.y != b.y;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator + (const Point_<_Tp>& a, const Point_<_Tp>& b)\n{\n    return Point_<_Tp>( saturate_cast<_Tp>(a.x + b.x), saturate_cast<_Tp>(a.y + b.y) );\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator - (const Point_<_Tp>& a, const Point_<_Tp>& b)\n{\n    return Point_<_Tp>( saturate_cast<_Tp>(a.x - b.x), saturate_cast<_Tp>(a.y - b.y) );\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator - (const Point_<_Tp>& a)\n{\n    return Point_<_Tp>( saturate_cast<_Tp>(-a.x), saturate_cast<_Tp>(-a.y) );\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator * (const Point_<_Tp>& a, int b)\n{\n    return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) );\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator * (int a, const Point_<_Tp>& b)\n{\n    return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) );\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator * (const Point_<_Tp>& a, float b)\n{\n    return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) );\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator * (float a, const Point_<_Tp>& b)\n{\n    return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) );\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator * (const Point_<_Tp>& a, double b)\n{\n    return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) );\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator * (double a, const Point_<_Tp>& b)\n{\n    return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) );\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator * (const Matx<_Tp, 2, 2>& a, const Point_<_Tp>& b)\n{\n    Matx<_Tp, 2, 1> tmp = a * Vec<_Tp,2>(b.x, b.y);\n    return Point_<_Tp>(tmp.val[0], tmp.val[1]);\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator * (const Matx<_Tp, 3, 3>& a, const Point_<_Tp>& b)\n{\n    Matx<_Tp, 3, 1> tmp = a * Vec<_Tp,3>(b.x, b.y, 1);\n    return Point3_<_Tp>(tmp.val[0], tmp.val[1], tmp.val[2]);\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator / (const Point_<_Tp>& a, int b)\n{\n    Point_<_Tp> tmp(a);\n    tmp /= b;\n    return tmp;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator / (const Point_<_Tp>& a, float b)\n{\n    Point_<_Tp> tmp(a);\n    tmp /= b;\n    return tmp;\n}\n\ntemplate<typename _Tp> static inline\nPoint_<_Tp> operator / (const Point_<_Tp>& a, double b)\n{\n    Point_<_Tp> tmp(a);\n    tmp /= b;\n    return tmp;\n}\n\n\ntemplate<typename _AccTp> static inline _AccTp normL2Sqr(const Point_<int>& pt);\ntemplate<typename _AccTp> static inline _AccTp normL2Sqr(const Point_<int64>& pt);\ntemplate<typename _AccTp> static inline _AccTp normL2Sqr(const Point_<float>& pt);\ntemplate<typename _AccTp> static inline _AccTp normL2Sqr(const Point_<double>& pt);\n\ntemplate<> inline int normL2Sqr<int>(const Point_<int>& pt) { return pt.dot(pt); }\ntemplate<> inline int64 normL2Sqr<int64>(const Point_<int64>& pt) { return pt.dot(pt); }\ntemplate<> inline float normL2Sqr<float>(const Point_<float>& pt) { return pt.dot(pt); }\ntemplate<> inline double normL2Sqr<double>(const Point_<int>& pt) { return pt.dot(pt); }\n\ntemplate<> inline double normL2Sqr<double>(const Point_<float>& pt) { return pt.ddot(pt); }\ntemplate<> inline double normL2Sqr<double>(const Point_<double>& pt) { return pt.ddot(pt); }\n\n\n\n//////////////////////////////// 3D Point ///////////////////////////////\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp>::Point3_()\n    : x(0), y(0), z(0) {}\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp>::Point3_(_Tp _x, _Tp _y, _Tp _z)\n    : x(_x), y(_y), z(_z) {}\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp>::Point3_(const Point3_& pt)\n    : x(pt.x), y(pt.y), z(pt.z) {}\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp>::Point3_(Point3_&& pt) CV_NOEXCEPT\n    : x(std::move(pt.x)), y(std::move(pt.y)), z(std::move(pt.z)) {}\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp>::Point3_(const Point_<_Tp>& pt)\n    : x(pt.x), y(pt.y), z(_Tp()) {}\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp>::Point3_(const Vec<_Tp, 3>& v)\n    : x(v[0]), y(v[1]), z(v[2]) {}\n\ntemplate<typename _Tp> template<typename _Tp2> inline\nPoint3_<_Tp>::operator Point3_<_Tp2>() const\n{\n    return Point3_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y), saturate_cast<_Tp2>(z));\n}\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp>::operator Vec<_Tp, 3>() const\n{\n    return Vec<_Tp, 3>(x, y, z);\n}\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp>& Point3_<_Tp>::operator = (const Point3_& pt)\n{\n    x = pt.x; y = pt.y; z = pt.z;\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp>& Point3_<_Tp>::operator = (Point3_&& pt) CV_NOEXCEPT\n{\n    x = std::move(pt.x); y = std::move(pt.y); z = std::move(pt.z);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\n_Tp Point3_<_Tp>::dot(const Point3_& pt) const\n{\n    return saturate_cast<_Tp>(x*pt.x + y*pt.y + z*pt.z);\n}\n\ntemplate<typename _Tp> inline\ndouble Point3_<_Tp>::ddot(const Point3_& pt) const\n{\n    return (double)x*pt.x + (double)y*pt.y + (double)z*pt.z;\n}\n\ntemplate<typename _Tp> inline\nPoint3_<_Tp> Point3_<_Tp>::cross(const Point3_<_Tp>& pt) const\n{\n    return Point3_<_Tp>(y*pt.z - z*pt.y, z*pt.x - x*pt.z, x*pt.y - y*pt.x);\n}\n\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp>& operator += (Point3_<_Tp>& a, const Point3_<_Tp>& b)\n{\n    a.x += b.x;\n    a.y += b.y;\n    a.z += b.z;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp>& operator -= (Point3_<_Tp>& a, const Point3_<_Tp>& b)\n{\n    a.x -= b.x;\n    a.y -= b.y;\n    a.z -= b.z;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp>& operator *= (Point3_<_Tp>& a, int b)\n{\n    a.x = saturate_cast<_Tp>(a.x * b);\n    a.y = saturate_cast<_Tp>(a.y * b);\n    a.z = saturate_cast<_Tp>(a.z * b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp>& operator *= (Point3_<_Tp>& a, float b)\n{\n    a.x = saturate_cast<_Tp>(a.x * b);\n    a.y = saturate_cast<_Tp>(a.y * b);\n    a.z = saturate_cast<_Tp>(a.z * b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp>& operator *= (Point3_<_Tp>& a, double b)\n{\n    a.x = saturate_cast<_Tp>(a.x * b);\n    a.y = saturate_cast<_Tp>(a.y * b);\n    a.z = saturate_cast<_Tp>(a.z * b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp>& operator /= (Point3_<_Tp>& a, int b)\n{\n    a.x = saturate_cast<_Tp>(a.x / b);\n    a.y = saturate_cast<_Tp>(a.y / b);\n    a.z = saturate_cast<_Tp>(a.z / b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp>& operator /= (Point3_<_Tp>& a, float b)\n{\n    a.x = saturate_cast<_Tp>(a.x / b);\n    a.y = saturate_cast<_Tp>(a.y / b);\n    a.z = saturate_cast<_Tp>(a.z / b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp>& operator /= (Point3_<_Tp>& a, double b)\n{\n    a.x = saturate_cast<_Tp>(a.x / b);\n    a.y = saturate_cast<_Tp>(a.y / b);\n    a.z = saturate_cast<_Tp>(a.z / b);\n    return a;\n}\n\ntemplate<typename _Tp> static inline\ndouble norm(const Point3_<_Tp>& pt)\n{\n    return std::sqrt((double)pt.x*pt.x + (double)pt.y*pt.y + (double)pt.z*pt.z);\n}\n\ntemplate<typename _Tp> static inline\nbool operator == (const Point3_<_Tp>& a, const Point3_<_Tp>& b)\n{\n    return a.x == b.x && a.y == b.y && a.z == b.z;\n}\n\ntemplate<typename _Tp> static inline\nbool operator != (const Point3_<_Tp>& a, const Point3_<_Tp>& b)\n{\n    return a.x != b.x || a.y != b.y || a.z != b.z;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator + (const Point3_<_Tp>& a, const Point3_<_Tp>& b)\n{\n    return Point3_<_Tp>( saturate_cast<_Tp>(a.x + b.x), saturate_cast<_Tp>(a.y + b.y), saturate_cast<_Tp>(a.z + b.z));\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator - (const Point3_<_Tp>& a, const Point3_<_Tp>& b)\n{\n    return Point3_<_Tp>( saturate_cast<_Tp>(a.x - b.x), saturate_cast<_Tp>(a.y - b.y), saturate_cast<_Tp>(a.z - b.z));\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator - (const Point3_<_Tp>& a)\n{\n    return Point3_<_Tp>( saturate_cast<_Tp>(-a.x), saturate_cast<_Tp>(-a.y), saturate_cast<_Tp>(-a.z) );\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator * (const Point3_<_Tp>& a, int b)\n{\n    return Point3_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b), saturate_cast<_Tp>(a.z*b) );\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator * (int a, const Point3_<_Tp>& b)\n{\n    return Point3_<_Tp>( saturate_cast<_Tp>(b.x * a), saturate_cast<_Tp>(b.y * a), saturate_cast<_Tp>(b.z * a) );\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator * (const Point3_<_Tp>& a, float b)\n{\n    return Point3_<_Tp>( saturate_cast<_Tp>(a.x * b), saturate_cast<_Tp>(a.y * b), saturate_cast<_Tp>(a.z * b) );\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator * (float a, const Point3_<_Tp>& b)\n{\n    return Point3_<_Tp>( saturate_cast<_Tp>(b.x * a), saturate_cast<_Tp>(b.y * a), saturate_cast<_Tp>(b.z * a) );\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator * (const Point3_<_Tp>& a, double b)\n{\n    return Point3_<_Tp>( saturate_cast<_Tp>(a.x * b), saturate_cast<_Tp>(a.y * b), saturate_cast<_Tp>(a.z * b) );\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator * (double a, const Point3_<_Tp>& b)\n{\n    return Point3_<_Tp>( saturate_cast<_Tp>(b.x * a), saturate_cast<_Tp>(b.y * a), saturate_cast<_Tp>(b.z * a) );\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator * (const Matx<_Tp, 3, 3>& a, const Point3_<_Tp>& b)\n{\n    Matx<_Tp, 3, 1> tmp = a * Vec<_Tp,3>(b.x, b.y, b.z);\n    return Point3_<_Tp>(tmp.val[0], tmp.val[1], tmp.val[2]);\n}\n\ntemplate<typename _Tp> static inline\nMatx<_Tp, 4, 1> operator * (const Matx<_Tp, 4, 4>& a, const Point3_<_Tp>& b)\n{\n    return a * Matx<_Tp, 4, 1>(b.x, b.y, b.z, 1);\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator / (const Point3_<_Tp>& a, int b)\n{\n    Point3_<_Tp> tmp(a);\n    tmp /= b;\n    return tmp;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator / (const Point3_<_Tp>& a, float b)\n{\n    Point3_<_Tp> tmp(a);\n    tmp /= b;\n    return tmp;\n}\n\ntemplate<typename _Tp> static inline\nPoint3_<_Tp> operator / (const Point3_<_Tp>& a, double b)\n{\n    Point3_<_Tp> tmp(a);\n    tmp /= b;\n    return tmp;\n}\n\n\n\n////////////////////////////////// Size /////////////////////////////////\n\ntemplate<typename _Tp> inline\nSize_<_Tp>::Size_()\n    : width(0), height(0) {}\n\ntemplate<typename _Tp> inline\nSize_<_Tp>::Size_(_Tp _width, _Tp _height)\n    : width(_width), height(_height) {}\n\ntemplate<typename _Tp> inline\nSize_<_Tp>::Size_(const Size_& sz)\n    : width(sz.width), height(sz.height) {}\n\ntemplate<typename _Tp> inline\nSize_<_Tp>::Size_(Size_&& sz) CV_NOEXCEPT\n    : width(std::move(sz.width)), height(std::move(sz.height)) {}\n\ntemplate<typename _Tp> inline\nSize_<_Tp>::Size_(const Point_<_Tp>& pt)\n    : width(pt.x), height(pt.y) {}\n\ntemplate<typename _Tp> template<typename _Tp2> inline\nSize_<_Tp>::operator Size_<_Tp2>() const\n{\n    return Size_<_Tp2>(saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height));\n}\n\ntemplate<typename _Tp> inline\nSize_<_Tp>& Size_<_Tp>::operator = (const Size_<_Tp>& sz)\n{\n    width = sz.width; height = sz.height;\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nSize_<_Tp>& Size_<_Tp>::operator = (Size_<_Tp>&& sz) CV_NOEXCEPT\n{\n    width = std::move(sz.width); height = std::move(sz.height);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\n_Tp Size_<_Tp>::area() const\n{\n    const _Tp result = width * height;\n    CV_DbgAssert(!std::numeric_limits<_Tp>::is_integer\n        || width == 0 || result / width == height); // make sure the result fits in the return value\n    return result;\n}\n\ntemplate<typename _Tp> inline\ndouble Size_<_Tp>::aspectRatio() const\n{\n    return width / static_cast<double>(height);\n}\n\ntemplate<typename _Tp> inline\nbool Size_<_Tp>::empty() const\n{\n    return width <= 0 || height <= 0;\n}\n\n\ntemplate<typename _Tp> static inline\nSize_<_Tp>& operator *= (Size_<_Tp>& a, _Tp b)\n{\n    a.width *= b;\n    a.height *= b;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nSize_<_Tp> operator * (const Size_<_Tp>& a, _Tp b)\n{\n    Size_<_Tp> tmp(a);\n    tmp *= b;\n    return tmp;\n}\n\ntemplate<typename _Tp> static inline\nSize_<_Tp>& operator /= (Size_<_Tp>& a, _Tp b)\n{\n    a.width /= b;\n    a.height /= b;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nSize_<_Tp> operator / (const Size_<_Tp>& a, _Tp b)\n{\n    Size_<_Tp> tmp(a);\n    tmp /= b;\n    return tmp;\n}\n\ntemplate<typename _Tp> static inline\nSize_<_Tp>& operator += (Size_<_Tp>& a, const Size_<_Tp>& b)\n{\n    a.width += b.width;\n    a.height += b.height;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nSize_<_Tp> operator + (const Size_<_Tp>& a, const Size_<_Tp>& b)\n{\n    Size_<_Tp> tmp(a);\n    tmp += b;\n    return tmp;\n}\n\ntemplate<typename _Tp> static inline\nSize_<_Tp>& operator -= (Size_<_Tp>& a, const Size_<_Tp>& b)\n{\n    a.width -= b.width;\n    a.height -= b.height;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nSize_<_Tp> operator - (const Size_<_Tp>& a, const Size_<_Tp>& b)\n{\n    Size_<_Tp> tmp(a);\n    tmp -= b;\n    return tmp;\n}\n\ntemplate<typename _Tp> static inline\nbool operator == (const Size_<_Tp>& a, const Size_<_Tp>& b)\n{\n    return a.width == b.width && a.height == b.height;\n}\n\ntemplate<typename _Tp> static inline\nbool operator != (const Size_<_Tp>& a, const Size_<_Tp>& b)\n{\n    return !(a == b);\n}\n\n\n\n////////////////////////////////// Rect /////////////////////////////////\n\ntemplate<typename _Tp> inline\nRect_<_Tp>::Rect_()\n    : x(0), y(0), width(0), height(0) {}\n\ntemplate<typename _Tp> inline\nRect_<_Tp>::Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height)\n    : x(_x), y(_y), width(_width), height(_height) {}\n\ntemplate<typename _Tp> inline\nRect_<_Tp>::Rect_(const Rect_<_Tp>& r)\n    : x(r.x), y(r.y), width(r.width), height(r.height) {}\n\ntemplate<typename _Tp> inline\nRect_<_Tp>::Rect_(Rect_<_Tp>&& r) CV_NOEXCEPT\n    : x(std::move(r.x)), y(std::move(r.y)), width(std::move(r.width)), height(std::move(r.height)) {}\n\ntemplate<typename _Tp> inline\nRect_<_Tp>::Rect_(const Point_<_Tp>& org, const Size_<_Tp>& sz)\n    : x(org.x), y(org.y), width(sz.width), height(sz.height) {}\n\ntemplate<typename _Tp> inline\nRect_<_Tp>::Rect_(const Point_<_Tp>& pt1, const Point_<_Tp>& pt2)\n{\n    x = std::min(pt1.x, pt2.x);\n    y = std::min(pt1.y, pt2.y);\n    width = std::max(pt1.x, pt2.x) - x;\n    height = std::max(pt1.y, pt2.y) - y;\n}\n\ntemplate<typename _Tp> inline\nRect_<_Tp>& Rect_<_Tp>::operator = ( const Rect_<_Tp>& r )\n{\n    x = r.x;\n    y = r.y;\n    width = r.width;\n    height = r.height;\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nRect_<_Tp>& Rect_<_Tp>::operator = ( Rect_<_Tp>&& r ) CV_NOEXCEPT\n{\n    x = std::move(r.x);\n    y = std::move(r.y);\n    width = std::move(r.width);\n    height = std::move(r.height);\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp> Rect_<_Tp>::tl() const\n{\n    return Point_<_Tp>(x,y);\n}\n\ntemplate<typename _Tp> inline\nPoint_<_Tp> Rect_<_Tp>::br() const\n{\n    return Point_<_Tp>(x + width, y + height);\n}\n\ntemplate<typename _Tp> inline\nSize_<_Tp> Rect_<_Tp>::size() const\n{\n    return Size_<_Tp>(width, height);\n}\n\ntemplate<typename _Tp> inline\n_Tp Rect_<_Tp>::area() const\n{\n    const _Tp result = width * height;\n    CV_DbgAssert(!std::numeric_limits<_Tp>::is_integer\n        || width == 0 || result / width == height); // make sure the result fits in the return value\n    return result;\n}\n\ntemplate<typename _Tp> inline\nbool Rect_<_Tp>::empty() const\n{\n    return width <= 0 || height <= 0;\n}\n\ntemplate<typename _Tp> template<typename _Tp2> inline\nRect_<_Tp>::operator Rect_<_Tp2>() const\n{\n    return Rect_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y), saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height));\n}\n\ntemplate<typename _Tp> inline\nbool Rect_<_Tp>::contains(const Point_<_Tp>& pt) const\n{\n    return x <= pt.x && pt.x < x + width && y <= pt.y && pt.y < y + height;\n}\n\n\ntemplate<typename _Tp> static inline\nRect_<_Tp>& operator += ( Rect_<_Tp>& a, const Point_<_Tp>& b )\n{\n    a.x += b.x;\n    a.y += b.y;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp>& operator -= ( Rect_<_Tp>& a, const Point_<_Tp>& b )\n{\n    a.x -= b.x;\n    a.y -= b.y;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp>& operator += ( Rect_<_Tp>& a, const Size_<_Tp>& b )\n{\n    a.width += b.width;\n    a.height += b.height;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp>& operator -= ( Rect_<_Tp>& a, const Size_<_Tp>& b )\n{\n    const _Tp width = a.width - b.width;\n    const _Tp height = a.height - b.height;\n    CV_DbgAssert(width >= 0 && height >= 0);\n    a.width = width;\n    a.height = height;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )\n{\n    _Tp x1 = std::max(a.x, b.x);\n    _Tp y1 = std::max(a.y, b.y);\n    a.width = std::min(a.x + a.width, b.x + b.width) - x1;\n    a.height = std::min(a.y + a.height, b.y + b.height) - y1;\n    a.x = x1;\n    a.y = y1;\n    if( a.width <= 0 || a.height <= 0 )\n        a = Rect();\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp>& operator |= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )\n{\n    if (a.empty()) {\n        a = b;\n    }\n    else if (!b.empty()) {\n        _Tp x1 = std::min(a.x, b.x);\n        _Tp y1 = std::min(a.y, b.y);\n        a.width = std::max(a.x + a.width, b.x + b.width) - x1;\n        a.height = std::max(a.y + a.height, b.y + b.height) - y1;\n        a.x = x1;\n        a.y = y1;\n    }\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nbool operator == (const Rect_<_Tp>& a, const Rect_<_Tp>& b)\n{\n    return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height;\n}\n\ntemplate<typename _Tp> static inline\nbool operator != (const Rect_<_Tp>& a, const Rect_<_Tp>& b)\n{\n    return a.x != b.x || a.y != b.y || a.width != b.width || a.height != b.height;\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp> operator + (const Rect_<_Tp>& a, const Point_<_Tp>& b)\n{\n    return Rect_<_Tp>( a.x + b.x, a.y + b.y, a.width, a.height );\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp> operator - (const Rect_<_Tp>& a, const Point_<_Tp>& b)\n{\n    return Rect_<_Tp>( a.x - b.x, a.y - b.y, a.width, a.height );\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp> operator + (const Rect_<_Tp>& a, const Size_<_Tp>& b)\n{\n    return Rect_<_Tp>( a.x, a.y, a.width + b.width, a.height + b.height );\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp> operator - (const Rect_<_Tp>& a, const Size_<_Tp>& b)\n{\n    const _Tp width = a.width - b.width;\n    const _Tp height = a.height - b.height;\n    CV_DbgAssert(width >= 0 && height >= 0);\n    return Rect_<_Tp>( a.x, a.y, width, height );\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp> operator & (const Rect_<_Tp>& a, const Rect_<_Tp>& b)\n{\n    Rect_<_Tp> c = a;\n    return c &= b;\n}\n\ntemplate<typename _Tp> static inline\nRect_<_Tp> operator | (const Rect_<_Tp>& a, const Rect_<_Tp>& b)\n{\n    Rect_<_Tp> c = a;\n    return c |= b;\n}\n\n/**\n * @brief measure dissimilarity between two sample sets\n *\n * computes the complement of the Jaccard Index as described in <https://en.wikipedia.org/wiki/Jaccard_index>.\n * For rectangles this reduces to computing the intersection over the union.\n */\ntemplate<typename _Tp> static inline\ndouble jaccardDistance(const Rect_<_Tp>& a, const Rect_<_Tp>& b) {\n    _Tp Aa = a.area();\n    _Tp Ab = b.area();\n\n    if ((Aa + Ab) <= std::numeric_limits<_Tp>::epsilon()) {\n        // jaccard_index = 1 -> distance = 0\n        return 0.0;\n    }\n\n    double Aab = (a & b).area();\n    // distance = 1 - jaccard_index\n    return 1.0 - Aab / (Aa + Ab - Aab);\n}\n\n////////////////////////////// RotatedRect //////////////////////////////\n\ninline\nRotatedRect::RotatedRect()\n    : center(), size(), angle(0) {}\n\ninline\nRotatedRect::RotatedRect(const Point2f& _center, const Size2f& _size, float _angle)\n    : center(_center), size(_size), angle(_angle) {}\n\n///////////////////////////////// Range /////////////////////////////////\n\ninline\nRange::Range()\n    : start(0), end(0) {}\n\ninline\nRange::Range(int _start, int _end)\n    : start(_start), end(_end) {}\n\ninline\nint Range::size() const\n{\n    return end - start;\n}\n\ninline\nbool Range::empty() const\n{\n    return start == end;\n}\n\ninline\nRange Range::all()\n{\n    return Range(INT_MIN, INT_MAX);\n}\n\n\nstatic inline\nbool operator == (const Range& r1, const Range& r2)\n{\n    return r1.start == r2.start && r1.end == r2.end;\n}\n\nstatic inline\nbool operator != (const Range& r1, const Range& r2)\n{\n    return !(r1 == r2);\n}\n\nstatic inline\nbool operator !(const Range& r)\n{\n    return r.start == r.end;\n}\n\nstatic inline\nRange operator & (const Range& r1, const Range& r2)\n{\n    Range r(std::max(r1.start, r2.start), std::min(r1.end, r2.end));\n    r.end = std::max(r.end, r.start);\n    return r;\n}\n\nstatic inline\nRange& operator &= (Range& r1, const Range& r2)\n{\n    r1 = r1 & r2;\n    return r1;\n}\n\nstatic inline\nRange operator + (const Range& r1, int delta)\n{\n    return Range(r1.start + delta, r1.end + delta);\n}\n\nstatic inline\nRange operator + (int delta, const Range& r1)\n{\n    return Range(r1.start + delta, r1.end + delta);\n}\n\nstatic inline\nRange operator - (const Range& r1, int delta)\n{\n    return r1 + (-delta);\n}\n\n\n\n///////////////////////////////// Scalar ////////////////////////////////\n\ntemplate<typename _Tp> inline\nScalar_<_Tp>::Scalar_()\n{\n    this->val[0] = this->val[1] = this->val[2] = this->val[3] = 0;\n}\n\ntemplate<typename _Tp> inline\nScalar_<_Tp>::Scalar_(_Tp v0, _Tp v1, _Tp v2, _Tp v3)\n{\n    this->val[0] = v0;\n    this->val[1] = v1;\n    this->val[2] = v2;\n    this->val[3] = v3;\n}\n\ntemplate<typename _Tp> inline\nScalar_<_Tp>::Scalar_(const Scalar_<_Tp>& s) : Vec<_Tp, 4>(s) {\n}\n\ntemplate<typename _Tp> inline\nScalar_<_Tp>::Scalar_(Scalar_<_Tp>&& s) CV_NOEXCEPT {\n    this->val[0] = std::move(s.val[0]);\n    this->val[1] = std::move(s.val[1]);\n    this->val[2] = std::move(s.val[2]);\n    this->val[3] = std::move(s.val[3]);\n}\n\ntemplate<typename _Tp> inline\nScalar_<_Tp>& Scalar_<_Tp>::operator=(const Scalar_<_Tp>& s) {\n    this->val[0] = s.val[0];\n    this->val[1] = s.val[1];\n    this->val[2] = s.val[2];\n    this->val[3] = s.val[3];\n    return *this;\n}\n\ntemplate<typename _Tp> inline\nScalar_<_Tp>& Scalar_<_Tp>::operator=(Scalar_<_Tp>&& s) CV_NOEXCEPT {\n    this->val[0] = std::move(s.val[0]);\n    this->val[1] = std::move(s.val[1]);\n    this->val[2] = std::move(s.val[2]);\n    this->val[3] = std::move(s.val[3]);\n    return *this;\n}\n\ntemplate<typename _Tp> template<typename _Tp2, int cn> inline\nScalar_<_Tp>::Scalar_(const Vec<_Tp2, cn>& v)\n{\n    int i;\n    for( i = 0; i < (cn < 4 ? cn : 4); i++ )\n        this->val[i] = cv::saturate_cast<_Tp>(v.val[i]);\n    for( ; i < 4; i++ )\n        this->val[i] = 0;\n}\n\ntemplate<typename _Tp> inline\nScalar_<_Tp>::Scalar_(_Tp v0)\n{\n    this->val[0] = v0;\n    this->val[1] = this->val[2] = this->val[3] = 0;\n}\n\ntemplate<typename _Tp> inline\nScalar_<_Tp> Scalar_<_Tp>::all(_Tp v0)\n{\n    return Scalar_<_Tp>(v0, v0, v0, v0);\n}\n\n\ntemplate<typename _Tp> inline\nScalar_<_Tp> Scalar_<_Tp>::mul(const Scalar_<_Tp>& a, double scale ) const\n{\n    return Scalar_<_Tp>(saturate_cast<_Tp>(this->val[0] * a.val[0] * scale),\n                        saturate_cast<_Tp>(this->val[1] * a.val[1] * scale),\n                        saturate_cast<_Tp>(this->val[2] * a.val[2] * scale),\n                        saturate_cast<_Tp>(this->val[3] * a.val[3] * scale));\n}\n\ntemplate<typename _Tp> inline\nScalar_<_Tp> Scalar_<_Tp>::conj() const\n{\n    return Scalar_<_Tp>(saturate_cast<_Tp>( this->val[0]),\n                        saturate_cast<_Tp>(-this->val[1]),\n                        saturate_cast<_Tp>(-this->val[2]),\n                        saturate_cast<_Tp>(-this->val[3]));\n}\n\ntemplate<typename _Tp> inline\nbool Scalar_<_Tp>::isReal() const\n{\n    return this->val[1] == 0 && this->val[2] == 0 && this->val[3] == 0;\n}\n\n\ntemplate<typename _Tp> template<typename T2> inline\nScalar_<_Tp>::operator Scalar_<T2>() const\n{\n    return Scalar_<T2>(saturate_cast<T2>(this->val[0]),\n                       saturate_cast<T2>(this->val[1]),\n                       saturate_cast<T2>(this->val[2]),\n                       saturate_cast<T2>(this->val[3]));\n}\n\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp>& operator += (Scalar_<_Tp>& a, const Scalar_<_Tp>& b)\n{\n    a.val[0] += b.val[0];\n    a.val[1] += b.val[1];\n    a.val[2] += b.val[2];\n    a.val[3] += b.val[3];\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp>& operator -= (Scalar_<_Tp>& a, const Scalar_<_Tp>& b)\n{\n    a.val[0] -= b.val[0];\n    a.val[1] -= b.val[1];\n    a.val[2] -= b.val[2];\n    a.val[3] -= b.val[3];\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp>& operator *= ( Scalar_<_Tp>& a, _Tp v )\n{\n    a.val[0] *= v;\n    a.val[1] *= v;\n    a.val[2] *= v;\n    a.val[3] *= v;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nbool operator == ( const Scalar_<_Tp>& a, const Scalar_<_Tp>& b )\n{\n    return a.val[0] == b.val[0] && a.val[1] == b.val[1] &&\n           a.val[2] == b.val[2] && a.val[3] == b.val[3];\n}\n\ntemplate<typename _Tp> static inline\nbool operator != ( const Scalar_<_Tp>& a, const Scalar_<_Tp>& b )\n{\n    return a.val[0] != b.val[0] || a.val[1] != b.val[1] ||\n           a.val[2] != b.val[2] || a.val[3] != b.val[3];\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp> operator + (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b)\n{\n    return Scalar_<_Tp>(a.val[0] + b.val[0],\n                        a.val[1] + b.val[1],\n                        a.val[2] + b.val[2],\n                        a.val[3] + b.val[3]);\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp> operator - (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b)\n{\n    return Scalar_<_Tp>(saturate_cast<_Tp>(a.val[0] - b.val[0]),\n                        saturate_cast<_Tp>(a.val[1] - b.val[1]),\n                        saturate_cast<_Tp>(a.val[2] - b.val[2]),\n                        saturate_cast<_Tp>(a.val[3] - b.val[3]));\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp> operator * (const Scalar_<_Tp>& a, _Tp alpha)\n{\n    return Scalar_<_Tp>(a.val[0] * alpha,\n                        a.val[1] * alpha,\n                        a.val[2] * alpha,\n                        a.val[3] * alpha);\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp> operator * (_Tp alpha, const Scalar_<_Tp>& a)\n{\n    return a*alpha;\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp> operator - (const Scalar_<_Tp>& a)\n{\n    return Scalar_<_Tp>(saturate_cast<_Tp>(-a.val[0]),\n                        saturate_cast<_Tp>(-a.val[1]),\n                        saturate_cast<_Tp>(-a.val[2]),\n                        saturate_cast<_Tp>(-a.val[3]));\n}\n\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp> operator * (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b)\n{\n    return Scalar_<_Tp>(saturate_cast<_Tp>(a[0]*b[0] - a[1]*b[1] - a[2]*b[2] - a[3]*b[3]),\n                        saturate_cast<_Tp>(a[0]*b[1] + a[1]*b[0] + a[2]*b[3] - a[3]*b[2]),\n                        saturate_cast<_Tp>(a[0]*b[2] - a[1]*b[3] + a[2]*b[0] + a[3]*b[1]),\n                        saturate_cast<_Tp>(a[0]*b[3] + a[1]*b[2] - a[2]*b[1] + a[3]*b[0]));\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp>& operator *= (Scalar_<_Tp>& a, const Scalar_<_Tp>& b)\n{\n    a = a * b;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha)\n{\n    return Scalar_<_Tp>(a.val[0] / alpha,\n                        a.val[1] / alpha,\n                        a.val[2] / alpha,\n                        a.val[3] / alpha);\n}\n\ntemplate<typename _Tp> static inline\nScalar_<float> operator / (const Scalar_<float>& a, float alpha)\n{\n    float s = 1 / alpha;\n    return Scalar_<float>(a.val[0] * s, a.val[1] * s, a.val[2] * s, a.val[3] * s);\n}\n\ntemplate<typename _Tp> static inline\nScalar_<double> operator / (const Scalar_<double>& a, double alpha)\n{\n    double s = 1 / alpha;\n    return Scalar_<double>(a.val[0] * s, a.val[1] * s, a.val[2] * s, a.val[3] * s);\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp>& operator /= (Scalar_<_Tp>& a, _Tp alpha)\n{\n    a = a / alpha;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b)\n{\n    _Tp s = a / (b[0]*b[0] + b[1]*b[1] + b[2]*b[2] + b[3]*b[3]);\n    return b.conj() * s;\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b)\n{\n    return a * ((_Tp)1 / b);\n}\n\ntemplate<typename _Tp> static inline\nScalar_<_Tp>& operator /= (Scalar_<_Tp>& a, const Scalar_<_Tp>& b)\n{\n    a = a / b;\n    return a;\n}\n\ntemplate<typename _Tp> static inline\nScalar operator * (const Matx<_Tp, 4, 4>& a, const Scalar& b)\n{\n    Matx<double, 4, 1> c((Matx<double, 4, 4>)a, b, Matx_MatMulOp());\n    return reinterpret_cast<const Scalar&>(c);\n}\n\ntemplate<> inline\nScalar operator * (const Matx<double, 4, 4>& a, const Scalar& b)\n{\n    Matx<double, 4, 1> c(a, b, Matx_MatMulOp());\n    return reinterpret_cast<const Scalar&>(c);\n}\n\n\n\n//////////////////////////////// KeyPoint ///////////////////////////////\n\ninline\nKeyPoint::KeyPoint()\n    : pt(0,0), size(0), angle(-1), response(0), octave(0), class_id(-1) {}\n\ninline\nKeyPoint::KeyPoint(Point2f _pt, float _size, float _angle, float _response, int _octave, int _class_id)\n    : pt(_pt), size(_size), angle(_angle), response(_response), octave(_octave), class_id(_class_id) {}\n\ninline\nKeyPoint::KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave, int _class_id)\n    : pt(x, y), size(_size), angle(_angle), response(_response), octave(_octave), class_id(_class_id) {}\n\n\n\n///////////////////////////////// DMatch ////////////////////////////////\n\ninline\nDMatch::DMatch()\n    : queryIdx(-1), trainIdx(-1), imgIdx(-1), distance(FLT_MAX) {}\n\ninline\nDMatch::DMatch(int _queryIdx, int _trainIdx, float _distance)\n    : queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(-1), distance(_distance) {}\n\ninline\nDMatch::DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance)\n    : queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(_imgIdx), distance(_distance) {}\n\ninline\nbool DMatch::operator < (const DMatch &m) const\n{\n    return distance < m.distance;\n}\n\n\n\n////////////////////////////// TermCriteria /////////////////////////////\n\ninline\nTermCriteria::TermCriteria()\n    : type(0), maxCount(0), epsilon(0) {}\n\ninline\nTermCriteria::TermCriteria(int _type, int _maxCount, double _epsilon)\n    : type(_type), maxCount(_maxCount), epsilon(_epsilon) {}\n\n//! @endcond\n\n} // cv\n\n#endif //OPENCV_CORE_TYPES_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/types_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_TYPES_H\n#define OPENCV_CORE_TYPES_H\n\n#ifdef CV__ENABLE_C_API_CTORS  // invalid C API ctors (must be removed)\n#if defined(_WIN32) && !defined(CV__SKIP_MESSAGE_MALFORMED_C_API_CTORS)\n#error \"C API ctors don't work on Win32: https://github.com/opencv/opencv/issues/15990\"\n#endif\n#endif\n\n//#define CV__VALIDATE_UNUNITIALIZED_VARS 1  // C++11 & GCC only\n\n#ifdef __cplusplus\n\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n#pragma GCC diagnostic ignored \"-Wmissing-field-initializers\"\n#define CV_STRUCT_INITIALIZER {0,}\n#else\n#if defined(__GNUC__) && __GNUC__ == 4  // GCC 4.x warns on \"= {}\" initialization, fixed in GCC 5.0\n#pragma GCC diagnostic ignored \"-Wmissing-field-initializers\"\n#endif\n#define CV_STRUCT_INITIALIZER {}\n#endif\n\n#else\n#define CV_STRUCT_INITIALIZER {0}\n#endif\n\n\n#ifdef HAVE_IPL\n#  ifndef __IPL_H__\n#    if defined _WIN32\n#      include <ipl.h>\n#    else\n#      include <ipl/ipl.h>\n#    endif\n#  endif\n#elif defined __IPL_H__\n#  define HAVE_IPL\n#endif\n\n#include \"opencv2/core/cvdef.h\"\n\n#ifndef SKIP_INCLUDES\n#include <assert.h>\n#include <stdlib.h>\n#include <string.h>\n#include <float.h>\n#endif // SKIP_INCLUDES\n\n#if defined _WIN32\n#  define CV_CDECL __cdecl\n#  define CV_STDCALL __stdcall\n#else\n#  define CV_CDECL\n#  define CV_STDCALL\n#endif\n\n#ifndef CV_DEFAULT\n#  ifdef __cplusplus\n#    define CV_DEFAULT(val) = val\n#  else\n#    define CV_DEFAULT(val)\n#  endif\n#endif\n\n#ifndef CV_EXTERN_C_FUNCPTR\n#  ifdef __cplusplus\n#    define CV_EXTERN_C_FUNCPTR(x) extern \"C\" { typedef x; }\n#  else\n#    define CV_EXTERN_C_FUNCPTR(x) typedef x\n#  endif\n#endif\n\n#ifndef CVAPI\n#  define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL\n#endif\n\n#ifndef CV_IMPL\n#  define CV_IMPL CV_EXTERN_C\n#endif\n\n#ifdef __cplusplus\n#  include \"opencv2/core.hpp\"\n#endif\n\n/** @addtogroup core_c\n    @{\n*/\n\n/** @brief This is the \"metatype\" used *only* as a function parameter.\n\nIt denotes that the function accepts arrays of multiple types, such as IplImage*, CvMat* or even\nCvSeq* sometimes. The particular array type is determined at runtime by analyzing the first 4\nbytes of the header. In C++ interface the role of CvArr is played by InputArray and OutputArray.\n */\ntypedef void CvArr;\n\ntypedef int CVStatus;\n\n/** @see cv::Error::Code */\nenum {\n CV_StsOk=                       0,  /**< everything is ok                */\n CV_StsBackTrace=               -1,  /**< pseudo error for back trace     */\n CV_StsError=                   -2,  /**< unknown /unspecified error      */\n CV_StsInternal=                -3,  /**< internal error (bad state)      */\n CV_StsNoMem=                   -4,  /**< insufficient memory             */\n CV_StsBadArg=                  -5,  /**< function arg/param is bad       */\n CV_StsBadFunc=                 -6,  /**< unsupported function            */\n CV_StsNoConv=                  -7,  /**< iter. didn't converge           */\n CV_StsAutoTrace=               -8,  /**< tracing                         */\n CV_HeaderIsNull=               -9,  /**< image header is NULL            */\n CV_BadImageSize=              -10,  /**< image size is invalid           */\n CV_BadOffset=                 -11,  /**< offset is invalid               */\n CV_BadDataPtr=                -12,  /**/\n CV_BadStep=                   -13,  /**< image step is wrong, this may happen for a non-continuous matrix */\n CV_BadModelOrChSeq=           -14,  /**/\n CV_BadNumChannels=            -15,  /**< bad number of channels, for example, some functions accept only single channel matrices */\n CV_BadNumChannel1U=           -16,  /**/\n CV_BadDepth=                  -17,  /**< input image depth is not supported by the function */\n CV_BadAlphaChannel=           -18,  /**/\n CV_BadOrder=                  -19,  /**< number of dimensions is out of range */\n CV_BadOrigin=                 -20,  /**< incorrect input origin               */\n CV_BadAlign=                  -21,  /**< incorrect input align                */\n CV_BadCallBack=               -22,  /**/\n CV_BadTileSize=               -23,  /**/\n CV_BadCOI=                    -24,  /**< input COI is not supported           */\n CV_BadROISize=                -25,  /**< incorrect input roi                  */\n CV_MaskIsTiled=               -26,  /**/\n CV_StsNullPtr=                -27,  /**< null pointer */\n CV_StsVecLengthErr=           -28,  /**< incorrect vector length */\n CV_StsFilterStructContentErr= -29,  /**< incorrect filter structure content */\n CV_StsKernelStructContentErr= -30,  /**< incorrect transform kernel content */\n CV_StsFilterOffsetErr=        -31,  /**< incorrect filter offset value */\n CV_StsBadSize=                -201, /**< the input/output structure size is incorrect  */\n CV_StsDivByZero=              -202, /**< division by zero */\n CV_StsInplaceNotSupported=    -203, /**< in-place operation is not supported */\n CV_StsObjectNotFound=         -204, /**< request can't be completed */\n CV_StsUnmatchedFormats=       -205, /**< formats of input/output arrays differ */\n CV_StsBadFlag=                -206, /**< flag is wrong or not supported */\n CV_StsBadPoint=               -207, /**< bad CvPoint */\n CV_StsBadMask=                -208, /**< bad format of mask (neither 8uC1 nor 8sC1)*/\n CV_StsUnmatchedSizes=         -209, /**< sizes of input/output structures do not match */\n CV_StsUnsupportedFormat=      -210, /**< the data format/type is not supported by the function*/\n CV_StsOutOfRange=             -211, /**< some of parameters are out of range */\n CV_StsParseError=             -212, /**< invalid syntax/structure of the parsed file */\n CV_StsNotImplemented=         -213, /**< the requested function/feature is not implemented */\n CV_StsBadMemBlock=            -214, /**< an allocated block has been corrupted */\n CV_StsAssert=                 -215, /**< assertion failed   */\n CV_GpuNotSupported=           -216, /**< no CUDA support    */\n CV_GpuApiCallError=           -217, /**< GPU API call error */\n CV_OpenGlNotSupported=        -218, /**< no OpenGL support  */\n CV_OpenGlApiCallError=        -219, /**< OpenGL API call error */\n CV_OpenCLApiCallError=        -220, /**< OpenCL API call error */\n CV_OpenCLDoubleNotSupported=  -221,\n CV_OpenCLInitError=           -222, /**< OpenCL initialization error */\n CV_OpenCLNoAMDBlasFft=        -223\n};\n\n/****************************************************************************************\\\n*                             Common macros and inline functions                         *\n\\****************************************************************************************/\n\n#define CV_SWAP(a,b,t) ((t) = (a), (a) = (b), (b) = (t))\n\n/** min & max without jumps */\n#define  CV_IMIN(a, b)  ((a) ^ (((a)^(b)) & (((a) < (b)) - 1)))\n\n#define  CV_IMAX(a, b)  ((a) ^ (((a)^(b)) & (((a) > (b)) - 1)))\n\n/** absolute value without jumps */\n#ifndef __cplusplus\n#  define  CV_IABS(a)     (((a) ^ ((a) < 0 ? -1 : 0)) - ((a) < 0 ? -1 : 0))\n#else\n#  define  CV_IABS(a)     abs(a)\n#endif\n#define  CV_CMP(a,b)    (((a) > (b)) - ((a) < (b)))\n#define  CV_SIGN(a)     CV_CMP((a),0)\n\n#define cvInvSqrt(value) ((float)(1./sqrt(value)))\n#define cvSqrt(value)  ((float)sqrt(value))\n\n\n/*************** Random number generation *******************/\n\ntypedef uint64 CvRNG;\n\n#define CV_RNG_COEFF 4164903690U\n\n/** @brief Initializes a random number generator state.\n\nThe function initializes a random number generator and returns the state. The pointer to the state\ncan be then passed to the cvRandInt, cvRandReal and cvRandArr functions. In the current\nimplementation a multiply-with-carry generator is used.\n@param seed 64-bit value used to initiate a random sequence\n@sa the C++ class RNG replaced CvRNG.\n */\nCV_INLINE CvRNG cvRNG( int64 seed CV_DEFAULT(-1))\n{\n    CvRNG rng = seed ? (uint64)seed : (uint64)(int64)-1;\n    return rng;\n}\n\n/** @brief Returns a 32-bit unsigned integer and updates RNG.\n\nThe function returns a uniformly-distributed random 32-bit unsigned integer and updates the RNG\nstate. It is similar to the rand() function from the C runtime library, except that OpenCV functions\nalways generates a 32-bit random number, regardless of the platform.\n@param rng CvRNG state initialized by cvRNG.\n */\nCV_INLINE unsigned cvRandInt( CvRNG* rng )\n{\n    uint64 temp = *rng;\n    temp = (uint64)(unsigned)temp*CV_RNG_COEFF + (temp >> 32);\n    *rng = temp;\n    return (unsigned)temp;\n}\n\n/** @brief Returns a floating-point random number and updates RNG.\n\nThe function returns a uniformly-distributed random floating-point number between 0 and 1 (1 is not\nincluded).\n@param rng RNG state initialized by cvRNG\n */\nCV_INLINE double cvRandReal( CvRNG* rng )\n{\n    return cvRandInt(rng)*2.3283064365386962890625e-10 /* 2^-32 */;\n}\n\n/****************************************************************************************\\\n*                                  Image type (IplImage)                                 *\n\\****************************************************************************************/\n\n#ifndef HAVE_IPL\n\n/*\n * The following definitions (until #endif)\n * is an extract from IPL headers.\n * Copyright (c) 1995 Intel Corporation.\n */\n#define IPL_DEPTH_SIGN 0x80000000\n\n#define IPL_DEPTH_1U     1\n#define IPL_DEPTH_8U     8\n#define IPL_DEPTH_16U   16\n#define IPL_DEPTH_32F   32\n\n#define IPL_DEPTH_8S  (IPL_DEPTH_SIGN| 8)\n#define IPL_DEPTH_16S (IPL_DEPTH_SIGN|16)\n#define IPL_DEPTH_32S (IPL_DEPTH_SIGN|32)\n\n#define IPL_DATA_ORDER_PIXEL  0\n#define IPL_DATA_ORDER_PLANE  1\n\n#define IPL_ORIGIN_TL 0\n#define IPL_ORIGIN_BL 1\n\n#define IPL_ALIGN_4BYTES   4\n#define IPL_ALIGN_8BYTES   8\n#define IPL_ALIGN_16BYTES 16\n#define IPL_ALIGN_32BYTES 32\n\n#define IPL_ALIGN_DWORD   IPL_ALIGN_4BYTES\n#define IPL_ALIGN_QWORD   IPL_ALIGN_8BYTES\n\n#define IPL_BORDER_CONSTANT   0\n#define IPL_BORDER_REPLICATE  1\n#define IPL_BORDER_REFLECT    2\n#define IPL_BORDER_WRAP       3\n\n#ifdef __cplusplus\ntypedef struct _IplImage IplImage;\nCV_EXPORTS _IplImage cvIplImage(const cv::Mat& m);\n#endif\n\n/** The IplImage is taken from the Intel Image Processing Library, in which the format is native. OpenCV\nonly supports a subset of possible IplImage formats, as outlined in the parameter list above.\n\nIn addition to the above restrictions, OpenCV handles ROIs differently. OpenCV functions require\nthat the image size or ROI size of all source and destination images match exactly. On the other\nhand, the Intel Image Processing Library processes the area of intersection between the source and\ndestination images (or ROIs), allowing them to vary independently.\n*/\ntypedef struct\n_IplImage\n{\n    int  nSize;             /**< sizeof(IplImage) */\n    int  ID;                /**< version (=0)*/\n    int  nChannels;         /**< Most of OpenCV functions support 1,2,3 or 4 channels */\n    int  alphaChannel;      /**< Ignored by OpenCV */\n    int  depth;             /**< Pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16S,\n                               IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported.  */\n    char colorModel[4];     /**< Ignored by OpenCV */\n    char channelSeq[4];     /**< ditto */\n    int  dataOrder;         /**< 0 - interleaved color channels, 1 - separate color channels.\n                               cvCreateImage can only create interleaved images */\n    int  origin;            /**< 0 - top-left origin,\n                               1 - bottom-left origin (Windows bitmaps style).  */\n    int  align;             /**< Alignment of image rows (4 or 8).\n                               OpenCV ignores it and uses widthStep instead.    */\n    int  width;             /**< Image width in pixels.                           */\n    int  height;            /**< Image height in pixels.                          */\n    struct _IplROI *roi;    /**< Image ROI. If NULL, the whole image is selected. */\n    struct _IplImage *maskROI;      /**< Must be NULL. */\n    void  *imageId;                 /**< \"           \" */\n    struct _IplTileInfo *tileInfo;  /**< \"           \" */\n    int  imageSize;         /**< Image data size in bytes\n                               (==image->height*image->widthStep\n                               in case of interleaved data)*/\n    char *imageData;        /**< Pointer to aligned image data.         */\n    int  widthStep;         /**< Size of aligned image row in bytes.    */\n    int  BorderMode[4];     /**< Ignored by OpenCV.                     */\n    int  BorderConst[4];    /**< Ditto.                                 */\n    char *imageDataOrigin;  /**< Pointer to very origin of image data\n                               (not necessarily aligned) -\n                               needed for correct deallocation */\n\n#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    _IplImage()\n    {\n        memset(this, 0, sizeof(*this));  // valid for POD structure\n        nSize = sizeof(IplImage);\n    }\n    _IplImage(const cv::Mat& m) { *this = cvIplImage(m); }\n#endif\n}\nIplImage;\n\nCV_INLINE IplImage cvIplImage()\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    IplImage self = CV_STRUCT_INITIALIZER; self.nSize = sizeof(IplImage); return self;\n#else\n    return _IplImage();\n#endif\n}\n\ntypedef struct _IplTileInfo IplTileInfo;\n\ntypedef struct _IplROI\n{\n    int  coi; /**< 0 - no COI (all channels are selected), 1 - 0th channel is selected ...*/\n    int  xOffset;\n    int  yOffset;\n    int  width;\n    int  height;\n}\nIplROI;\n\ntypedef struct _IplConvKernel\n{\n    int  nCols;\n    int  nRows;\n    int  anchorX;\n    int  anchorY;\n    int *values;\n    int  nShiftR;\n}\nIplConvKernel;\n\ntypedef struct _IplConvKernelFP\n{\n    int  nCols;\n    int  nRows;\n    int  anchorX;\n    int  anchorY;\n    float *values;\n}\nIplConvKernelFP;\n\n#define IPL_IMAGE_HEADER 1\n#define IPL_IMAGE_DATA   2\n#define IPL_IMAGE_ROI    4\n\n#endif/*HAVE_IPL*/\n\n/** extra border mode */\n#define IPL_BORDER_REFLECT_101    4\n#define IPL_BORDER_TRANSPARENT    5\n\n#define IPL_IMAGE_MAGIC_VAL  ((int)sizeof(IplImage))\n#define CV_TYPE_NAME_IMAGE \"opencv-image\"\n\n#define CV_IS_IMAGE_HDR(img) \\\n    ((img) != NULL && ((const IplImage*)(img))->nSize == sizeof(IplImage))\n\n#define CV_IS_IMAGE(img) \\\n    (CV_IS_IMAGE_HDR(img) && ((IplImage*)img)->imageData != NULL)\n\n/** for storing double-precision\n   floating point data in IplImage's */\n#define IPL_DEPTH_64F  64\n\n/** get reference to pixel at (col,row),\n   for multi-channel images (col) should be multiplied by number of channels */\n#define CV_IMAGE_ELEM( image, elemtype, row, col )       \\\n    (((elemtype*)((image)->imageData + (image)->widthStep*(row)))[(col)])\n\n/****************************************************************************************\\\n*                                  Matrix type (CvMat)                                   *\n\\****************************************************************************************/\n\n#define CV_AUTO_STEP  0x7fffffff\n#define CV_WHOLE_ARR  cvSlice( 0, 0x3fffffff )\n\n#define CV_MAGIC_MASK       0xFFFF0000\n#define CV_MAT_MAGIC_VAL    0x42420000\n#define CV_TYPE_NAME_MAT    \"opencv-matrix\"\n\n#ifdef __cplusplus\ntypedef struct CvMat CvMat;\nCV_INLINE CvMat cvMat(const cv::Mat& m);\n#endif\n\n/** Matrix elements are stored row by row. Element (i, j) (i - 0-based row index, j - 0-based column\nindex) of a matrix can be retrieved or modified using CV_MAT_ELEM macro:\n\n    uchar pixval = CV_MAT_ELEM(grayimg, uchar, i, j)\n    CV_MAT_ELEM(cameraMatrix, float, 0, 2) = image.width*0.5f;\n\nTo access multiple-channel matrices, you can use\nCV_MAT_ELEM(matrix, type, i, j\\*nchannels + channel_idx).\n\n@deprecated CvMat is now obsolete; consider using Mat instead.\n */\ntypedef struct CvMat\n{\n    int type;\n    int step;\n\n    /* for internal use only */\n    int* refcount;\n    int hdr_refcount;\n\n    union\n    {\n        uchar* ptr;\n        short* s;\n        int* i;\n        float* fl;\n        double* db;\n    } data;\n\n#ifdef __cplusplus\n    union\n    {\n        int rows;\n        int height;\n    };\n\n    union\n    {\n        int cols;\n        int width;\n    };\n#else\n    int rows;\n    int cols;\n#endif\n\n#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvMat() {}\n    CvMat(const cv::Mat& m) { *this = cvMat(m); }\n#endif\n}\nCvMat;\n\n\n#define CV_IS_MAT_HDR(mat) \\\n    ((mat) != NULL && \\\n    (((const CvMat*)(mat))->type & CV_MAGIC_MASK) == CV_MAT_MAGIC_VAL && \\\n    ((const CvMat*)(mat))->cols > 0 && ((const CvMat*)(mat))->rows > 0)\n\n#define CV_IS_MAT_HDR_Z(mat) \\\n    ((mat) != NULL && \\\n    (((const CvMat*)(mat))->type & CV_MAGIC_MASK) == CV_MAT_MAGIC_VAL && \\\n    ((const CvMat*)(mat))->cols >= 0 && ((const CvMat*)(mat))->rows >= 0)\n\n#define CV_IS_MAT(mat) \\\n    (CV_IS_MAT_HDR(mat) && ((const CvMat*)(mat))->data.ptr != NULL)\n\n#define CV_IS_MASK_ARR(mat) \\\n    (((mat)->type & (CV_MAT_TYPE_MASK & ~CV_8SC1)) == 0)\n\n#define CV_ARE_TYPES_EQ(mat1, mat2) \\\n    ((((mat1)->type ^ (mat2)->type) & CV_MAT_TYPE_MASK) == 0)\n\n#define CV_ARE_CNS_EQ(mat1, mat2) \\\n    ((((mat1)->type ^ (mat2)->type) & CV_MAT_CN_MASK) == 0)\n\n#define CV_ARE_DEPTHS_EQ(mat1, mat2) \\\n    ((((mat1)->type ^ (mat2)->type) & CV_MAT_DEPTH_MASK) == 0)\n\n#define CV_ARE_SIZES_EQ(mat1, mat2) \\\n    ((mat1)->rows == (mat2)->rows && (mat1)->cols == (mat2)->cols)\n\n#define CV_IS_MAT_CONST(mat)  \\\n    (((mat)->rows|(mat)->cols) == 1)\n\n#define IPL2CV_DEPTH(depth) \\\n    ((((CV_8U)+(CV_16U<<4)+(CV_32F<<8)+(CV_64F<<16)+(CV_8S<<20)+ \\\n    (CV_16S<<24)+(CV_32S<<28)) >> ((((depth) & 0xF0) >> 2) + \\\n    (((depth) & IPL_DEPTH_SIGN) ? 20 : 0))) & 15)\n\n/** Inline constructor. No data is allocated internally!!!\n * (Use together with cvCreateData, or use cvCreateMat instead to\n * get a matrix with allocated data):\n */\nCV_INLINE CvMat cvMat( int rows, int cols, int type, void* data CV_DEFAULT(NULL))\n{\n    CvMat m;\n\n    assert( (unsigned)CV_MAT_DEPTH(type) <= CV_64F );\n    type = CV_MAT_TYPE(type);\n    m.type = CV_MAT_MAGIC_VAL | CV_MAT_CONT_FLAG | type;\n    m.cols = cols;\n    m.rows = rows;\n    m.step = m.cols*CV_ELEM_SIZE(type);\n    m.data.ptr = (uchar*)data;\n    m.refcount = NULL;\n    m.hdr_refcount = 0;\n\n    return m;\n}\n\n#ifdef __cplusplus\n\nCV_INLINE CvMat cvMat(const cv::Mat& m)\n{\n    CvMat self;\n    CV_DbgAssert(m.dims <= 2);\n    self = cvMat(m.rows, m.dims == 1 ? 1 : m.cols, m.type(), m.data);\n    self.step = (int)m.step[0];\n    self.type = (self.type & ~cv::Mat::CONTINUOUS_FLAG) | (m.flags & cv::Mat::CONTINUOUS_FLAG);\n    return self;\n}\nCV_INLINE CvMat cvMat()\n{\n#if !defined(CV__ENABLE_C_API_CTORS)\n    CvMat self = CV_STRUCT_INITIALIZER; return self;\n#else\n    return CvMat();\n#endif\n}\nCV_INLINE CvMat cvMat(const CvMat& m)\n{\n#if !defined(CV__ENABLE_C_API_CTORS)\n    CvMat self = CV_STRUCT_INITIALIZER; memcpy(&self, &m, sizeof(self)); return self;\n#else\n    return CvMat(m);\n#endif\n}\n\n#endif // __cplusplus\n\n\n#define CV_MAT_ELEM_PTR_FAST( mat, row, col, pix_size )  \\\n    (assert( (unsigned)(row) < (unsigned)(mat).rows &&   \\\n             (unsigned)(col) < (unsigned)(mat).cols ),   \\\n     (mat).data.ptr + (size_t)(mat).step*(row) + (pix_size)*(col))\n\n#define CV_MAT_ELEM_PTR( mat, row, col )                 \\\n    CV_MAT_ELEM_PTR_FAST( mat, row, col, CV_ELEM_SIZE((mat).type) )\n\n#define CV_MAT_ELEM( mat, elemtype, row, col )           \\\n    (*(elemtype*)CV_MAT_ELEM_PTR_FAST( mat, row, col, sizeof(elemtype)))\n\n/** @brief Returns the particular element of single-channel floating-point matrix.\n\nThe function is a fast replacement for cvGetReal2D in the case of single-channel floating-point\nmatrices. It is faster because it is inline, it does fewer checks for array type and array element\ntype, and it checks for the row and column ranges only in debug mode.\n@param mat Input matrix\n@param row The zero-based index of row\n@param col The zero-based index of column\n */\nCV_INLINE  double  cvmGet( const CvMat* mat, int row, int col )\n{\n    int type;\n\n    type = CV_MAT_TYPE(mat->type);\n    assert( (unsigned)row < (unsigned)mat->rows &&\n            (unsigned)col < (unsigned)mat->cols );\n\n    if( type == CV_32FC1 )\n        return ((float*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col];\n    else\n    {\n        assert( type == CV_64FC1 );\n        return ((double*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col];\n    }\n}\n\n/** @brief Sets a specific element of a single-channel floating-point matrix.\n\nThe function is a fast replacement for cvSetReal2D in the case of single-channel floating-point\nmatrices. It is faster because it is inline, it does fewer checks for array type and array element\ntype, and it checks for the row and column ranges only in debug mode.\n@param mat The matrix\n@param row The zero-based index of row\n@param col The zero-based index of column\n@param value The new value of the matrix element\n */\nCV_INLINE  void  cvmSet( CvMat* mat, int row, int col, double value )\n{\n    int type;\n    type = CV_MAT_TYPE(mat->type);\n    assert( (unsigned)row < (unsigned)mat->rows &&\n            (unsigned)col < (unsigned)mat->cols );\n\n    if( type == CV_32FC1 )\n        ((float*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col] = (float)value;\n    else\n    {\n        assert( type == CV_64FC1 );\n        ((double*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col] = value;\n    }\n}\n\n\nCV_INLINE int cvIplDepth( int type )\n{\n    int depth = CV_MAT_DEPTH(type);\n    return CV_ELEM_SIZE1(depth)*8 | (depth == CV_8S || depth == CV_16S ||\n           depth == CV_32S ? IPL_DEPTH_SIGN : 0);\n}\n\n\n/****************************************************************************************\\\n*                       Multi-dimensional dense array (CvMatND)                          *\n\\****************************************************************************************/\n\n#define CV_MATND_MAGIC_VAL    0x42430000\n#define CV_TYPE_NAME_MATND    \"opencv-nd-matrix\"\n\n#define CV_MAX_DIM            32\n\n#ifdef __cplusplus\ntypedef struct CvMatND CvMatND;\nCV_EXPORTS CvMatND cvMatND(const cv::Mat& m);\n#endif\n\n/**\n  @deprecated consider using cv::Mat instead\n  */\ntypedef struct\nCvMatND\n{\n    int type;\n    int dims;\n\n    int* refcount;\n    int hdr_refcount;\n\n    union\n    {\n        uchar* ptr;\n        float* fl;\n        double* db;\n        int* i;\n        short* s;\n    } data;\n\n    struct\n    {\n        int size;\n        int step;\n    }\n    dim[CV_MAX_DIM];\n\n#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvMatND() {}\n    CvMatND(const cv::Mat& m) { *this = cvMatND(m); }\n#endif\n}\nCvMatND;\n\n\nCV_INLINE CvMatND cvMatND()\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvMatND self = CV_STRUCT_INITIALIZER; return self;\n#else\n    return CvMatND();\n#endif\n}\n\n#define CV_IS_MATND_HDR(mat) \\\n    ((mat) != NULL && (((const CvMatND*)(mat))->type & CV_MAGIC_MASK) == CV_MATND_MAGIC_VAL)\n\n#define CV_IS_MATND(mat) \\\n    (CV_IS_MATND_HDR(mat) && ((const CvMatND*)(mat))->data.ptr != NULL)\n\n\n/****************************************************************************************\\\n*                      Multi-dimensional sparse array (CvSparseMat)                      *\n\\****************************************************************************************/\n\n#define CV_SPARSE_MAT_MAGIC_VAL    0x42440000\n#define CV_TYPE_NAME_SPARSE_MAT    \"opencv-sparse-matrix\"\n\nstruct CvSet;\n\ntypedef struct CvSparseMat\n{\n    int type;\n    int dims;\n    int* refcount;\n    int hdr_refcount;\n\n    struct CvSet* heap;\n    void** hashtable;\n    int hashsize;\n    int valoffset;\n    int idxoffset;\n    int size[CV_MAX_DIM];\n\n#ifdef __cplusplus\n    CV_EXPORTS void copyToSparseMat(cv::SparseMat& m) const;\n#endif\n}\nCvSparseMat;\n\n#ifdef __cplusplus\nCV_EXPORTS CvSparseMat* cvCreateSparseMat(const cv::SparseMat& m);\n#endif\n\n#define CV_IS_SPARSE_MAT_HDR(mat) \\\n    ((mat) != NULL && \\\n    (((const CvSparseMat*)(mat))->type & CV_MAGIC_MASK) == CV_SPARSE_MAT_MAGIC_VAL)\n\n#define CV_IS_SPARSE_MAT(mat) \\\n    CV_IS_SPARSE_MAT_HDR(mat)\n\n/**************** iteration through a sparse array *****************/\n\ntypedef struct CvSparseNode\n{\n    unsigned hashval;\n    struct CvSparseNode* next;\n}\nCvSparseNode;\n\ntypedef struct CvSparseMatIterator\n{\n    CvSparseMat* mat;\n    CvSparseNode* node;\n    int curidx;\n}\nCvSparseMatIterator;\n\n#define CV_NODE_VAL(mat,node)   ((void*)((uchar*)(node) + (mat)->valoffset))\n#define CV_NODE_IDX(mat,node)   ((int*)((uchar*)(node) + (mat)->idxoffset))\n\n/****************************************************************************************\\\n*                                         Histogram                                      *\n\\****************************************************************************************/\n\ntypedef int CvHistType;\n\n#define CV_HIST_MAGIC_VAL     0x42450000\n#define CV_HIST_UNIFORM_FLAG  (1 << 10)\n\n/** indicates whether bin ranges are set already or not */\n#define CV_HIST_RANGES_FLAG   (1 << 11)\n\n#define CV_HIST_ARRAY         0\n#define CV_HIST_SPARSE        1\n#define CV_HIST_TREE          CV_HIST_SPARSE\n\n/** should be used as a parameter only,\n   it turns to CV_HIST_UNIFORM_FLAG of hist->type */\n#define CV_HIST_UNIFORM       1\n\ntypedef struct CvHistogram\n{\n    int     type;\n    CvArr*  bins;\n    float   thresh[CV_MAX_DIM][2];  /**< For uniform histograms.                      */\n    float** thresh2;                /**< For non-uniform histograms.                  */\n    CvMatND mat;                    /**< Embedded matrix header for array histograms. */\n}\nCvHistogram;\n\n#define CV_IS_HIST( hist ) \\\n    ((hist) != NULL  && \\\n     (((CvHistogram*)(hist))->type & CV_MAGIC_MASK) == CV_HIST_MAGIC_VAL && \\\n     (hist)->bins != NULL)\n\n#define CV_IS_UNIFORM_HIST( hist ) \\\n    (((hist)->type & CV_HIST_UNIFORM_FLAG) != 0)\n\n#define CV_IS_SPARSE_HIST( hist ) \\\n    CV_IS_SPARSE_MAT((hist)->bins)\n\n#define CV_HIST_HAS_RANGES( hist ) \\\n    (((hist)->type & CV_HIST_RANGES_FLAG) != 0)\n\n/****************************************************************************************\\\n*                      Other supplementary data type definitions                         *\n\\****************************************************************************************/\n\n/*************************************** CvRect *****************************************/\n/** @sa Rect_ */\ntypedef struct CvRect\n{\n    int x;\n    int y;\n    int width;\n    int height;\n\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvRect() __attribute__(( warning(\"Non-initialized variable\") )) {};\n    template<typename _Tp> CvRect(const std::initializer_list<_Tp> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 4);\n        x = y = width = height = 0;\n        if (list.size() == 4)\n        {\n            x = list.begin()[0]; y = list.begin()[1]; width = list.begin()[2]; height = list.begin()[3];\n        }\n    };\n#elif defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvRect(int _x = 0, int _y = 0, int w = 0, int h = 0): x(_x), y(_y), width(w), height(h) {}\n    template<typename _Tp>\n    CvRect(const cv::Rect_<_Tp>& r): x(cv::saturate_cast<int>(r.x)), y(cv::saturate_cast<int>(r.y)), width(cv::saturate_cast<int>(r.width)), height(cv::saturate_cast<int>(r.height)) {}\n#endif\n#ifdef __cplusplus\n    template<typename _Tp>\n    operator cv::Rect_<_Tp>() const { return cv::Rect_<_Tp>((_Tp)x, (_Tp)y, (_Tp)width, (_Tp)height); }\n#endif\n}\nCvRect;\n\n/** constructs CvRect structure. */\nCV_INLINE  CvRect  cvRect( int x, int y, int width, int height )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvRect r = {x, y, width, height};\n#else\n    CvRect r(x, y , width, height);\n#endif\n    return r;\n}\n#ifdef __cplusplus\nCV_INLINE CvRect cvRect(const cv::Rect& rc) { return cvRect(rc.x, rc.y, rc.width, rc.height); }\n#endif\n\nCV_INLINE  IplROI  cvRectToROI( CvRect rect, int coi )\n{\n    IplROI roi;\n    roi.xOffset = rect.x;\n    roi.yOffset = rect.y;\n    roi.width = rect.width;\n    roi.height = rect.height;\n    roi.coi = coi;\n\n    return roi;\n}\n\n\nCV_INLINE  CvRect  cvROIToRect( IplROI roi )\n{\n    return cvRect( roi.xOffset, roi.yOffset, roi.width, roi.height );\n}\n\n/*********************************** CvTermCriteria *************************************/\n\n#define CV_TERMCRIT_ITER    1\n#define CV_TERMCRIT_NUMBER  CV_TERMCRIT_ITER\n#define CV_TERMCRIT_EPS     2\n\n/** @sa TermCriteria\n */\ntypedef struct CvTermCriteria\n{\n    int    type;  /**< may be combination of\n                     CV_TERMCRIT_ITER\n                     CV_TERMCRIT_EPS */\n    int    max_iter;\n    double epsilon;\n#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvTermCriteria(int _type = 0, int _iter = 0, double _eps = 0) : type(_type), max_iter(_iter), epsilon(_eps)  {}\n    CvTermCriteria(const cv::TermCriteria& t) : type(t.type), max_iter(t.maxCount), epsilon(t.epsilon)  {}\n#endif\n#ifdef __cplusplus\n    operator cv::TermCriteria() const { return cv::TermCriteria(type, max_iter, epsilon); }\n#endif\n}\nCvTermCriteria;\n\nCV_INLINE  CvTermCriteria  cvTermCriteria( int type, int max_iter, double epsilon )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvTermCriteria t = { type, max_iter, (float)epsilon};\n#else\n    CvTermCriteria t(type, max_iter, epsilon);\n#endif\n    return t;\n}\n#ifdef __cplusplus\nCV_INLINE CvTermCriteria cvTermCriteria(const cv::TermCriteria& t) { return cvTermCriteria(t.type, t.maxCount, t.epsilon); }\n#endif\n\n\n/******************************* CvPoint and variants ***********************************/\n\ntypedef struct CvPoint\n{\n    int x;\n    int y;\n\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvPoint() __attribute__(( warning(\"Non-initialized variable\") )) {}\n    template<typename _Tp> CvPoint(const std::initializer_list<_Tp> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 2);\n        x = y = 0;\n        if (list.size() == 2)\n        {\n            x = list.begin()[0]; y = list.begin()[1];\n        }\n    };\n#elif defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvPoint(int _x = 0, int _y = 0): x(_x), y(_y) {}\n    template<typename _Tp>\n    CvPoint(const cv::Point_<_Tp>& pt): x((int)pt.x), y((int)pt.y) {}\n#endif\n#ifdef __cplusplus\n    template<typename _Tp>\n    operator cv::Point_<_Tp>() const { return cv::Point_<_Tp>(cv::saturate_cast<_Tp>(x), cv::saturate_cast<_Tp>(y)); }\n#endif\n}\nCvPoint;\n\n/** constructs CvPoint structure. */\nCV_INLINE  CvPoint  cvPoint( int x, int y )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvPoint p = {x, y};\n#else\n    CvPoint p(x, y);\n#endif\n    return p;\n}\n#ifdef __cplusplus\nCV_INLINE CvPoint cvPoint(const cv::Point& pt) { return cvPoint(pt.x, pt.y); }\n#endif\n\ntypedef struct CvPoint2D32f\n{\n    float x;\n    float y;\n\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvPoint2D32f() __attribute__(( warning(\"Non-initialized variable\") )) {}\n    template<typename _Tp> CvPoint2D32f(const std::initializer_list<_Tp> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 2);\n        x = y = 0;\n        if (list.size() == 2)\n        {\n            x = list.begin()[0]; y = list.begin()[1];\n        }\n    };\n#elif defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvPoint2D32f(float _x = 0, float _y = 0): x(_x), y(_y) {}\n    template<typename _Tp>\n    CvPoint2D32f(const cv::Point_<_Tp>& pt): x((float)pt.x), y((float)pt.y) {}\n#endif\n#ifdef __cplusplus\n    template<typename _Tp>\n    operator cv::Point_<_Tp>() const { return cv::Point_<_Tp>(cv::saturate_cast<_Tp>(x), cv::saturate_cast<_Tp>(y)); }\n#endif\n}\nCvPoint2D32f;\n\n/** constructs CvPoint2D32f structure. */\nCV_INLINE  CvPoint2D32f  cvPoint2D32f( double x, double y )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvPoint2D32f p = { (float)x, (float)y };\n#else\n    CvPoint2D32f p((float)x, (float)y);\n#endif\n    return p;\n}\n\n#ifdef __cplusplus\ntemplate<typename _Tp>\nCvPoint2D32f cvPoint2D32f(const cv::Point_<_Tp>& pt)\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvPoint2D32f p = { (float)pt.x, (float)pt.y };\n#else\n    CvPoint2D32f p((float)pt.x, (float)pt.y);\n#endif\n    return p;\n}\n#endif\n\n/** converts CvPoint to CvPoint2D32f. */\nCV_INLINE  CvPoint2D32f  cvPointTo32f( CvPoint point )\n{\n    return cvPoint2D32f( (float)point.x, (float)point.y );\n}\n\n/** converts CvPoint2D32f to CvPoint. */\nCV_INLINE  CvPoint  cvPointFrom32f( CvPoint2D32f point )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvPoint ipt = { cvRound(point.x), cvRound(point.y) };\n#else\n    CvPoint ipt(cvRound(point.x), cvRound(point.y));\n#endif\n    return ipt;\n}\n\n\ntypedef struct CvPoint3D32f\n{\n    float x;\n    float y;\n    float z;\n\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvPoint3D32f() __attribute__(( warning(\"Non-initialized variable\") )) {}\n    template<typename _Tp> CvPoint3D32f(const std::initializer_list<_Tp> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 3);\n        x = y = z = 0;\n        if (list.size() == 3)\n        {\n            x = list.begin()[0]; y = list.begin()[1]; z = list.begin()[2];\n        }\n    };\n#elif defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvPoint3D32f(float _x = 0, float _y = 0, float _z = 0): x(_x), y(_y), z(_z) {}\n    template<typename _Tp>\n    CvPoint3D32f(const cv::Point3_<_Tp>& pt): x((float)pt.x), y((float)pt.y), z((float)pt.z) {}\n#endif\n#ifdef __cplusplus\n    template<typename _Tp>\n    operator cv::Point3_<_Tp>() const { return cv::Point3_<_Tp>(cv::saturate_cast<_Tp>(x), cv::saturate_cast<_Tp>(y), cv::saturate_cast<_Tp>(z)); }\n#endif\n}\nCvPoint3D32f;\n\n/** constructs CvPoint3D32f structure. */\nCV_INLINE  CvPoint3D32f  cvPoint3D32f( double x, double y, double z )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvPoint3D32f p = { (float)x, (float)y, (float)z };\n#else\n    CvPoint3D32f p((float)x, (float)y, (float)z);\n#endif\n    return p;\n}\n\n#ifdef __cplusplus\ntemplate<typename _Tp>\nCvPoint3D32f cvPoint3D32f(const cv::Point3_<_Tp>& pt)\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvPoint3D32f p  = { (float)pt.x, (float)pt.y, (float)pt.z };\n#else\n    CvPoint3D32f p((float)pt.x, (float)pt.y, (float)pt.z);\n#endif\n    return p;\n}\n#endif\n\n\ntypedef struct CvPoint2D64f\n{\n    double x;\n    double y;\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvPoint2D64f() __attribute__(( warning(\"Non-initialized variable\") )) {}\n    template<typename _Tp> CvPoint2D64f(const std::initializer_list<_Tp> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 2);\n        x = y = 0;\n        if (list.size() == 2)\n        {\n            x = list.begin()[0]; y = list.begin()[1];\n        }\n    };\n#endif\n}\nCvPoint2D64f;\n\n/** constructs CvPoint2D64f structure.*/\nCV_INLINE  CvPoint2D64f  cvPoint2D64f( double x, double y )\n{\n    CvPoint2D64f p = { x, y };\n    return p;\n}\n\n\ntypedef struct CvPoint3D64f\n{\n    double x;\n    double y;\n    double z;\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvPoint3D64f() __attribute__(( warning(\"Non-initialized variable\") )) {}\n    template<typename _Tp> CvPoint3D64f(const std::initializer_list<_Tp> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 3);\n        x = y = z = 0;\n        if (list.size() == 3)\n        {\n            x = list.begin()[0]; y = list.begin()[1]; z = list.begin()[2];\n        }\n    };\n#endif\n}\nCvPoint3D64f;\n\n/** constructs CvPoint3D64f structure. */\nCV_INLINE  CvPoint3D64f  cvPoint3D64f( double x, double y, double z )\n{\n    CvPoint3D64f p = { x, y, z };\n    return p;\n}\n\n\n/******************************** CvSize's & CvBox **************************************/\n\ntypedef struct CvSize\n{\n    int width;\n    int height;\n\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvSize() __attribute__(( warning(\"Non-initialized variable\") )) {}\n    template<typename _Tp> CvSize(const std::initializer_list<_Tp> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 2);\n        width = 0; height = 0;\n        if (list.size() == 2)\n        {\n            width = list.begin()[0]; height = list.begin()[1];\n        }\n    };\n#elif defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvSize(int w = 0, int h = 0): width(w), height(h) {}\n    template<typename _Tp>\n    CvSize(const cv::Size_<_Tp>& sz): width(cv::saturate_cast<int>(sz.width)), height(cv::saturate_cast<int>(sz.height)) {}\n#endif\n#ifdef __cplusplus\n    template<typename _Tp>\n    operator cv::Size_<_Tp>() const { return cv::Size_<_Tp>(cv::saturate_cast<_Tp>(width), cv::saturate_cast<_Tp>(height)); }\n#endif\n}\nCvSize;\n\n/** constructs CvSize structure. */\nCV_INLINE  CvSize  cvSize( int width, int height )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvSize s = { width, height };\n#else\n    CvSize s(width, height);\n#endif\n    return s;\n}\n\n#ifdef __cplusplus\nCV_INLINE CvSize cvSize(const cv::Size& sz)\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvSize s = { sz.width, sz.height };\n#else\n    CvSize s(sz.width, sz.height);\n#endif\n    return s;\n}\n#endif\n\ntypedef struct CvSize2D32f\n{\n    float width;\n    float height;\n\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvSize2D32f() __attribute__(( warning(\"Non-initialized variable\") )) {}\n    template<typename _Tp> CvSize2D32f(const std::initializer_list<_Tp> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 2);\n        width = 0; height = 0;\n        if (list.size() == 2)\n        {\n            width = list.begin()[0]; height = list.begin()[1];\n        }\n    };\n#elif defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvSize2D32f(float w = 0, float h = 0): width(w), height(h) {}\n    template<typename _Tp>\n    CvSize2D32f(const cv::Size_<_Tp>& sz): width(cv::saturate_cast<float>(sz.width)), height(cv::saturate_cast<float>(sz.height)) {}\n#endif\n#ifdef __cplusplus\n    template<typename _Tp>\n    operator cv::Size_<_Tp>() const { return cv::Size_<_Tp>(cv::saturate_cast<_Tp>(width), cv::saturate_cast<_Tp>(height)); }\n#endif\n}\nCvSize2D32f;\n\n/** constructs CvSize2D32f structure. */\nCV_INLINE  CvSize2D32f  cvSize2D32f( double width, double height )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvSize2D32f s = { (float)width, (float)height };\n#else\n    CvSize2D32f s((float)width, (float)height);\n#endif\n    return s;\n}\n#ifdef __cplusplus\ntemplate<typename _Tp>\nCvSize2D32f cvSize2D32f(const cv::Size_<_Tp>& sz)\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvSize2D32f s = { (float)sz.width, (float)sz.height };\n#else\n    CvSize2D32f s((float)sz.width, (float)sz.height);\n#endif\n    return s;\n}\n#endif\n\n/** @sa RotatedRect\n */\ntypedef struct CvBox2D\n{\n    CvPoint2D32f center;  /**< Center of the box.                          */\n    CvSize2D32f  size;    /**< Box width and length.                       */\n    float angle;          /**< Angle between the horizontal axis           */\n                          /**< and the first side (i.e. length) in degrees */\n\n#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvBox2D(CvPoint2D32f c = CvPoint2D32f(), CvSize2D32f s = CvSize2D32f(), float a = 0) : center(c), size(s), angle(a) {}\n    CvBox2D(const cv::RotatedRect& rr) : center(rr.center), size(rr.size), angle(rr.angle) {}\n#endif\n#ifdef __cplusplus\n    operator cv::RotatedRect() const { return cv::RotatedRect(center, size, angle); }\n#endif\n}\nCvBox2D;\n\n\n#ifdef __cplusplus\nCV_INLINE CvBox2D cvBox2D(CvPoint2D32f c = CvPoint2D32f(), CvSize2D32f s = CvSize2D32f(), float a = 0)\n{\n    CvBox2D self;\n    self.center = c;\n    self.size = s;\n    self.angle = a;\n    return self;\n}\nCV_INLINE CvBox2D cvBox2D(const cv::RotatedRect& rr)\n{\n    CvBox2D self;\n    self.center = cvPoint2D32f(rr.center);\n    self.size = cvSize2D32f(rr.size);\n    self.angle = rr.angle;\n    return self;\n}\n#endif\n\n\n/** Line iterator state: */\ntypedef struct CvLineIterator\n{\n    /** Pointer to the current point: */\n    uchar* ptr;\n\n    /* Bresenham algorithm state: */\n    int  err;\n    int  plus_delta;\n    int  minus_delta;\n    int  plus_step;\n    int  minus_step;\n}\nCvLineIterator;\n\n\n\n/************************************* CvSlice ******************************************/\n#define CV_WHOLE_SEQ_END_INDEX 0x3fffffff\n#define CV_WHOLE_SEQ  cvSlice(0, CV_WHOLE_SEQ_END_INDEX)\n\ntypedef struct CvSlice\n{\n    int  start_index, end_index;\n\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvSlice() __attribute__(( warning(\"Non-initialized variable\") )) {}\n    template<typename _Tp> CvSlice(const std::initializer_list<_Tp> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 2);\n        start_index = end_index = 0;\n        if (list.size() == 2)\n        {\n            start_index = list.begin()[0]; end_index = list.begin()[1];\n        }\n    };\n#endif\n#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus) && !defined(__CUDACC__)\n    CvSlice(int start = 0, int end = 0) : start_index(start), end_index(end) {}\n    CvSlice(const cv::Range& r) { *this = (r.start != INT_MIN && r.end != INT_MAX) ? CvSlice(r.start, r.end) : CvSlice(0, CV_WHOLE_SEQ_END_INDEX); }\n    operator cv::Range() const { return (start_index == 0 && end_index == CV_WHOLE_SEQ_END_INDEX ) ? cv::Range::all() : cv::Range(start_index, end_index); }\n#endif\n}\nCvSlice;\n\nCV_INLINE  CvSlice  cvSlice( int start, int end )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus) && !defined(__CUDACC__))\n    CvSlice slice = { start, end };\n#else\n    CvSlice slice(start, end);\n#endif\n    return slice;\n}\n\n#if defined(__cplusplus)\nCV_INLINE  CvSlice  cvSlice(const cv::Range& r)\n{\n    CvSlice slice = (r.start != INT_MIN && r.end != INT_MAX) ? cvSlice(r.start, r.end) : cvSlice(0, CV_WHOLE_SEQ_END_INDEX);\n    return slice;\n}\n#endif\n\n\n/************************************* CvScalar *****************************************/\n/** @sa Scalar_\n */\ntypedef struct CvScalar\n{\n    double val[4];\n\n#ifdef CV__VALIDATE_UNUNITIALIZED_VARS\n    CvScalar() __attribute__(( warning(\"Non-initialized variable\") )) {}\n    CvScalar(const std::initializer_list<double> list)\n    {\n        CV_Assert(list.size() == 0 || list.size() == 4);\n        val[0] = val[1] = val[2] = val[3] = 0;\n        if (list.size() == 4)\n        {\n            val[0] = list.begin()[0]; val[1] = list.begin()[1]; val[2] = list.begin()[2]; val[3] = list.begin()[3];\n        }\n    };\n#elif defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvScalar() {}\n    CvScalar(double d0, double d1 = 0, double d2 = 0, double d3 = 0) { val[0] = d0; val[1] = d1; val[2] = d2; val[3] = d3; }\n    template<typename _Tp>\n    CvScalar(const cv::Scalar_<_Tp>& s) { val[0] = s.val[0]; val[1] = s.val[1]; val[2] = s.val[2]; val[3] = s.val[3]; }\n    template<typename _Tp, int cn>\n    CvScalar(const cv::Vec<_Tp, cn>& v)\n    {\n        int i;\n        for( i = 0; i < (cn < 4 ? cn : 4); i++ ) val[i] = v.val[i];\n        for( ; i < 4; i++ ) val[i] = 0;\n    }\n#endif\n#ifdef __cplusplus\n    template<typename _Tp>\n    operator cv::Scalar_<_Tp>() const { return cv::Scalar_<_Tp>(cv::saturate_cast<_Tp>(val[0]), cv::saturate_cast<_Tp>(val[1]), cv::saturate_cast<_Tp>(val[2]), cv::saturate_cast<_Tp>(val[3])); }\n#endif\n}\nCvScalar;\n\nCV_INLINE  CvScalar  cvScalar( double val0, double val1 CV_DEFAULT(0),\n                               double val2 CV_DEFAULT(0), double val3 CV_DEFAULT(0))\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvScalar scalar = CV_STRUCT_INITIALIZER;\n#else\n    CvScalar scalar;\n#endif\n    scalar.val[0] = val0; scalar.val[1] = val1;\n    scalar.val[2] = val2; scalar.val[3] = val3;\n    return scalar;\n}\n\n#ifdef __cplusplus\nCV_INLINE CvScalar cvScalar()\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvScalar scalar = CV_STRUCT_INITIALIZER;\n#else\n    CvScalar scalar;\n#endif\n    scalar.val[0] = scalar.val[1] = scalar.val[2] = scalar.val[3] = 0;\n    return scalar;\n}\nCV_INLINE CvScalar cvScalar(const cv::Scalar& s)\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvScalar scalar = CV_STRUCT_INITIALIZER;\n#else\n    CvScalar scalar;\n#endif\n    scalar.val[0] = s.val[0];\n    scalar.val[1] = s.val[1];\n    scalar.val[2] = s.val[2];\n    scalar.val[3] = s.val[3];\n    return scalar;\n}\n#endif\n\nCV_INLINE  CvScalar  cvRealScalar( double val0 )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvScalar scalar = CV_STRUCT_INITIALIZER;\n#else\n    CvScalar scalar;\n#endif\n    scalar.val[0] = val0;\n    scalar.val[1] = scalar.val[2] = scalar.val[3] = 0;\n    return scalar;\n}\n\nCV_INLINE  CvScalar  cvScalarAll( double val0123 )\n{\n#if !(defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus))\n    CvScalar scalar = CV_STRUCT_INITIALIZER;\n#else\n    CvScalar scalar;\n#endif\n    scalar.val[0] = val0123;\n    scalar.val[1] = val0123;\n    scalar.val[2] = val0123;\n    scalar.val[3] = val0123;\n    return scalar;\n}\n\n/****************************************************************************************\\\n*                                   Dynamic Data structures                              *\n\\****************************************************************************************/\n\n/******************************** Memory storage ****************************************/\n\ntypedef struct CvMemBlock\n{\n    struct CvMemBlock*  prev;\n    struct CvMemBlock*  next;\n}\nCvMemBlock;\n\n#define CV_STORAGE_MAGIC_VAL    0x42890000\n\ntypedef struct CvMemStorage\n{\n    int signature;\n    CvMemBlock* bottom;           /**< First allocated block.                   */\n    CvMemBlock* top;              /**< Current memory block - top of the stack. */\n    struct  CvMemStorage* parent; /**< We get new blocks from parent as needed. */\n    int block_size;               /**< Block size.                              */\n    int free_space;               /**< Remaining free space in current block.   */\n}\nCvMemStorage;\n\n#define CV_IS_STORAGE(storage)  \\\n    ((storage) != NULL &&       \\\n    (((CvMemStorage*)(storage))->signature & CV_MAGIC_MASK) == CV_STORAGE_MAGIC_VAL)\n\n\ntypedef struct CvMemStoragePos\n{\n    CvMemBlock* top;\n    int free_space;\n}\nCvMemStoragePos;\n\n\n/*********************************** Sequence *******************************************/\n\ntypedef struct CvSeqBlock\n{\n    struct CvSeqBlock*  prev; /**< Previous sequence block.                   */\n    struct CvSeqBlock*  next; /**< Next sequence block.                       */\n    int    start_index;       /**< Index of the first element in the block +  */\n                              /**< sequence->first->start_index.              */\n    int    count;             /**< Number of elements in the block.           */\n    schar* data;              /**< Pointer to the first element of the block. */\n}\nCvSeqBlock;\n\n\n#define CV_TREE_NODE_FIELDS(node_type)                               \\\n    int       flags;             /**< Miscellaneous flags.     */      \\\n    int       header_size;       /**< Size of sequence header. */      \\\n    struct    node_type* h_prev; /**< Previous sequence.       */      \\\n    struct    node_type* h_next; /**< Next sequence.           */      \\\n    struct    node_type* v_prev; /**< 2nd previous sequence.   */      \\\n    struct    node_type* v_next  /**< 2nd next sequence.       */\n\n/**\n   Read/Write sequence.\n   Elements can be dynamically inserted to or deleted from the sequence.\n*/\n#define CV_SEQUENCE_FIELDS()                                              \\\n    CV_TREE_NODE_FIELDS(CvSeq);                                           \\\n    int       total;          /**< Total number of elements.            */  \\\n    int       elem_size;      /**< Size of sequence element in bytes.   */  \\\n    schar*    block_max;      /**< Maximal bound of the last block.     */  \\\n    schar*    ptr;            /**< Current write pointer.               */  \\\n    int       delta_elems;    /**< Grow seq this many at a time.        */  \\\n    CvMemStorage* storage;    /**< Where the seq is stored.             */  \\\n    CvSeqBlock* free_blocks;  /**< Free blocks list.                    */  \\\n    CvSeqBlock* first;        /**< Pointer to the first sequence block. */\n\ntypedef struct CvSeq\n{\n    CV_SEQUENCE_FIELDS()\n}\nCvSeq;\n\n#define CV_TYPE_NAME_SEQ             \"opencv-sequence\"\n#define CV_TYPE_NAME_SEQ_TREE        \"opencv-sequence-tree\"\n\n/*************************************** Set ********************************************/\n/** @brief Set\n  Order is not preserved. There can be gaps between sequence elements.\n  After the element has been inserted it stays in the same place all the time.\n  The MSB(most-significant or sign bit) of the first field (flags) is 0 iff the element exists.\n*/\n#define CV_SET_ELEM_FIELDS(elem_type)   \\\n    int  flags;                         \\\n    struct elem_type* next_free;\n\ntypedef struct CvSetElem\n{\n    CV_SET_ELEM_FIELDS(CvSetElem)\n}\nCvSetElem;\n\n#define CV_SET_FIELDS()      \\\n    CV_SEQUENCE_FIELDS()     \\\n    CvSetElem* free_elems;   \\\n    int active_count;\n\ntypedef struct CvSet\n{\n    CV_SET_FIELDS()\n}\nCvSet;\n\n\n#define CV_SET_ELEM_IDX_MASK   ((1 << 26) - 1)\n#define CV_SET_ELEM_FREE_FLAG  (1 << (sizeof(int)*8-1))\n\n/** Checks whether the element pointed by ptr belongs to a set or not */\n#define CV_IS_SET_ELEM( ptr )  (((CvSetElem*)(ptr))->flags >= 0)\n\n/************************************* Graph ********************************************/\n\n/** @name Graph\n\nWe represent a graph as a set of vertices. Vertices contain their adjacency lists (more exactly,\npointers to first incoming or outcoming edge (or 0 if isolated vertex)). Edges are stored in\nanother set. There is a singly-linked list of incoming/outcoming edges for each vertex.\n\nEach edge consists of:\n\n- Two pointers to the starting and ending vertices (vtx[0] and vtx[1] respectively).\n\n    A graph may be oriented or not. In the latter case, edges between vertex i to vertex j are not\ndistinguished during search operations.\n\n- Two pointers to next edges for the starting and ending vertices, where next[0] points to the\nnext edge in the vtx[0] adjacency list and next[1] points to the next edge in the vtx[1]\nadjacency list.\n\n@see CvGraphEdge, CvGraphVtx, CvGraphVtx2D, CvGraph\n@{\n*/\n#define CV_GRAPH_EDGE_FIELDS()      \\\n    int flags;                      \\\n    float weight;                   \\\n    struct CvGraphEdge* next[2];    \\\n    struct CvGraphVtx* vtx[2];\n\n\n#define CV_GRAPH_VERTEX_FIELDS()    \\\n    int flags;                      \\\n    struct CvGraphEdge* first;\n\n\ntypedef struct CvGraphEdge\n{\n    CV_GRAPH_EDGE_FIELDS()\n}\nCvGraphEdge;\n\ntypedef struct CvGraphVtx\n{\n    CV_GRAPH_VERTEX_FIELDS()\n}\nCvGraphVtx;\n\ntypedef struct CvGraphVtx2D\n{\n    CV_GRAPH_VERTEX_FIELDS()\n    CvPoint2D32f* ptr;\n}\nCvGraphVtx2D;\n\n/**\n   Graph is \"derived\" from the set (this is set a of vertices)\n   and includes another set (edges)\n*/\n#define  CV_GRAPH_FIELDS()   \\\n    CV_SET_FIELDS()          \\\n    CvSet* edges;\n\ntypedef struct CvGraph\n{\n    CV_GRAPH_FIELDS()\n}\nCvGraph;\n\n#define CV_TYPE_NAME_GRAPH \"opencv-graph\"\n\n/** @} */\n\n/*********************************** Chain/Contour *************************************/\n\ntypedef struct CvChain\n{\n    CV_SEQUENCE_FIELDS()\n    CvPoint  origin;\n}\nCvChain;\n\n#define CV_CONTOUR_FIELDS()  \\\n    CV_SEQUENCE_FIELDS()     \\\n    CvRect rect;             \\\n    int color;               \\\n    int reserved[3];\n\ntypedef struct CvContour\n{\n    CV_CONTOUR_FIELDS()\n}\nCvContour;\n\ntypedef CvContour CvPoint2DSeq;\n\n/****************************************************************************************\\\n*                                    Sequence types                                      *\n\\****************************************************************************************/\n\n#define CV_SEQ_MAGIC_VAL             0x42990000\n\n#define CV_IS_SEQ(seq) \\\n    ((seq) != NULL && (((CvSeq*)(seq))->flags & CV_MAGIC_MASK) == CV_SEQ_MAGIC_VAL)\n\n#define CV_SET_MAGIC_VAL             0x42980000\n#define CV_IS_SET(set) \\\n    ((set) != NULL && (((CvSeq*)(set))->flags & CV_MAGIC_MASK) == CV_SET_MAGIC_VAL)\n\n#define CV_SEQ_ELTYPE_BITS           12\n#define CV_SEQ_ELTYPE_MASK           ((1 << CV_SEQ_ELTYPE_BITS) - 1)\n\n#define CV_SEQ_ELTYPE_POINT          CV_32SC2  /**< (x,y) */\n#define CV_SEQ_ELTYPE_CODE           CV_8UC1   /**< freeman code: 0..7 */\n#define CV_SEQ_ELTYPE_GENERIC        0\n#define CV_SEQ_ELTYPE_PTR            CV_MAKE_TYPE(CV_8U, 8 /*sizeof(void*)*/)\n#define CV_SEQ_ELTYPE_PPOINT         CV_SEQ_ELTYPE_PTR  /**< &(x,y) */\n#define CV_SEQ_ELTYPE_INDEX          CV_32SC1  /**< #(x,y) */\n#define CV_SEQ_ELTYPE_GRAPH_EDGE     0  /**< &next_o, &next_d, &vtx_o, &vtx_d */\n#define CV_SEQ_ELTYPE_GRAPH_VERTEX   0  /**< first_edge, &(x,y) */\n#define CV_SEQ_ELTYPE_TRIAN_ATR      0  /**< vertex of the binary tree   */\n#define CV_SEQ_ELTYPE_CONNECTED_COMP 0  /**< connected component  */\n#define CV_SEQ_ELTYPE_POINT3D        CV_32FC3  /**< (x,y,z)  */\n\n#define CV_SEQ_KIND_BITS        2\n#define CV_SEQ_KIND_MASK        (((1 << CV_SEQ_KIND_BITS) - 1)<<CV_SEQ_ELTYPE_BITS)\n\n/** types of sequences */\n#define CV_SEQ_KIND_GENERIC     (0 << CV_SEQ_ELTYPE_BITS)\n#define CV_SEQ_KIND_CURVE       (1 << CV_SEQ_ELTYPE_BITS)\n#define CV_SEQ_KIND_BIN_TREE    (2 << CV_SEQ_ELTYPE_BITS)\n\n/** types of sparse sequences (sets) */\n#define CV_SEQ_KIND_GRAPH       (1 << CV_SEQ_ELTYPE_BITS)\n#define CV_SEQ_KIND_SUBDIV2D    (2 << CV_SEQ_ELTYPE_BITS)\n\n#define CV_SEQ_FLAG_SHIFT       (CV_SEQ_KIND_BITS + CV_SEQ_ELTYPE_BITS)\n\n/** flags for curves */\n#define CV_SEQ_FLAG_CLOSED     (1 << CV_SEQ_FLAG_SHIFT)\n#define CV_SEQ_FLAG_SIMPLE     (0 << CV_SEQ_FLAG_SHIFT)\n#define CV_SEQ_FLAG_CONVEX     (0 << CV_SEQ_FLAG_SHIFT)\n#define CV_SEQ_FLAG_HOLE       (2 << CV_SEQ_FLAG_SHIFT)\n\n/** flags for graphs */\n#define CV_GRAPH_FLAG_ORIENTED (1 << CV_SEQ_FLAG_SHIFT)\n\n#define CV_GRAPH               CV_SEQ_KIND_GRAPH\n#define CV_ORIENTED_GRAPH      (CV_SEQ_KIND_GRAPH|CV_GRAPH_FLAG_ORIENTED)\n\n/** point sets */\n#define CV_SEQ_POINT_SET       (CV_SEQ_KIND_GENERIC| CV_SEQ_ELTYPE_POINT)\n#define CV_SEQ_POINT3D_SET     (CV_SEQ_KIND_GENERIC| CV_SEQ_ELTYPE_POINT3D)\n#define CV_SEQ_POLYLINE        (CV_SEQ_KIND_CURVE  | CV_SEQ_ELTYPE_POINT)\n#define CV_SEQ_POLYGON         (CV_SEQ_FLAG_CLOSED | CV_SEQ_POLYLINE )\n#define CV_SEQ_CONTOUR         CV_SEQ_POLYGON\n#define CV_SEQ_SIMPLE_POLYGON  (CV_SEQ_FLAG_SIMPLE | CV_SEQ_POLYGON  )\n\n/** chain-coded curves */\n#define CV_SEQ_CHAIN           (CV_SEQ_KIND_CURVE  | CV_SEQ_ELTYPE_CODE)\n#define CV_SEQ_CHAIN_CONTOUR   (CV_SEQ_FLAG_CLOSED | CV_SEQ_CHAIN)\n\n/** binary tree for the contour */\n#define CV_SEQ_POLYGON_TREE    (CV_SEQ_KIND_BIN_TREE  | CV_SEQ_ELTYPE_TRIAN_ATR)\n\n/** sequence of the connected components */\n#define CV_SEQ_CONNECTED_COMP  (CV_SEQ_KIND_GENERIC  | CV_SEQ_ELTYPE_CONNECTED_COMP)\n\n/** sequence of the integer numbers */\n#define CV_SEQ_INDEX           (CV_SEQ_KIND_GENERIC  | CV_SEQ_ELTYPE_INDEX)\n\n#define CV_SEQ_ELTYPE( seq )   ((seq)->flags & CV_SEQ_ELTYPE_MASK)\n#define CV_SEQ_KIND( seq )     ((seq)->flags & CV_SEQ_KIND_MASK )\n\n/** flag checking */\n#define CV_IS_SEQ_INDEX( seq )      ((CV_SEQ_ELTYPE(seq) == CV_SEQ_ELTYPE_INDEX) && \\\n                                     (CV_SEQ_KIND(seq) == CV_SEQ_KIND_GENERIC))\n\n#define CV_IS_SEQ_CURVE( seq )      (CV_SEQ_KIND(seq) == CV_SEQ_KIND_CURVE)\n#define CV_IS_SEQ_CLOSED( seq )     (((seq)->flags & CV_SEQ_FLAG_CLOSED) != 0)\n#define CV_IS_SEQ_CONVEX( seq )     0\n#define CV_IS_SEQ_HOLE( seq )       (((seq)->flags & CV_SEQ_FLAG_HOLE) != 0)\n#define CV_IS_SEQ_SIMPLE( seq )     1\n\n/** type checking macros */\n#define CV_IS_SEQ_POINT_SET( seq ) \\\n    ((CV_SEQ_ELTYPE(seq) == CV_32SC2 || CV_SEQ_ELTYPE(seq) == CV_32FC2))\n\n#define CV_IS_SEQ_POINT_SUBSET( seq ) \\\n    (CV_IS_SEQ_INDEX( seq ) || CV_SEQ_ELTYPE(seq) == CV_SEQ_ELTYPE_PPOINT)\n\n#define CV_IS_SEQ_POLYLINE( seq )   \\\n    (CV_SEQ_KIND(seq) == CV_SEQ_KIND_CURVE && CV_IS_SEQ_POINT_SET(seq))\n\n#define CV_IS_SEQ_POLYGON( seq )   \\\n    (CV_IS_SEQ_POLYLINE(seq) && CV_IS_SEQ_CLOSED(seq))\n\n#define CV_IS_SEQ_CHAIN( seq )   \\\n    (CV_SEQ_KIND(seq) == CV_SEQ_KIND_CURVE && (seq)->elem_size == 1)\n\n#define CV_IS_SEQ_CONTOUR( seq )   \\\n    (CV_IS_SEQ_CLOSED(seq) && (CV_IS_SEQ_POLYLINE(seq) || CV_IS_SEQ_CHAIN(seq)))\n\n#define CV_IS_SEQ_CHAIN_CONTOUR( seq ) \\\n    (CV_IS_SEQ_CHAIN( seq ) && CV_IS_SEQ_CLOSED( seq ))\n\n#define CV_IS_SEQ_POLYGON_TREE( seq ) \\\n    (CV_SEQ_ELTYPE (seq) ==  CV_SEQ_ELTYPE_TRIAN_ATR &&    \\\n    CV_SEQ_KIND( seq ) ==  CV_SEQ_KIND_BIN_TREE )\n\n#define CV_IS_GRAPH( seq )    \\\n    (CV_IS_SET(seq) && CV_SEQ_KIND((CvSet*)(seq)) == CV_SEQ_KIND_GRAPH)\n\n#define CV_IS_GRAPH_ORIENTED( seq )   \\\n    (((seq)->flags & CV_GRAPH_FLAG_ORIENTED) != 0)\n\n#define CV_IS_SUBDIV2D( seq )  \\\n    (CV_IS_SET(seq) && CV_SEQ_KIND((CvSet*)(seq)) == CV_SEQ_KIND_SUBDIV2D)\n\n/****************************************************************************************/\n/*                            Sequence writer & reader                                  */\n/****************************************************************************************/\n\n#define CV_SEQ_WRITER_FIELDS()                                     \\\n    int          header_size;                                      \\\n    CvSeq*       seq;        /**< the sequence written */            \\\n    CvSeqBlock*  block;      /**< current block */                   \\\n    schar*       ptr;        /**< pointer to free space */           \\\n    schar*       block_min;  /**< pointer to the beginning of block*/\\\n    schar*       block_max;  /**< pointer to the end of block */\n\ntypedef struct CvSeqWriter\n{\n    CV_SEQ_WRITER_FIELDS()\n}\nCvSeqWriter;\n\n\n#define CV_SEQ_READER_FIELDS()                                      \\\n    int          header_size;                                       \\\n    CvSeq*       seq;        /**< sequence, beign read */             \\\n    CvSeqBlock*  block;      /**< current block */                    \\\n    schar*       ptr;        /**< pointer to element be read next */  \\\n    schar*       block_min;  /**< pointer to the beginning of block */\\\n    schar*       block_max;  /**< pointer to the end of block */      \\\n    int          delta_index;/**< = seq->first->start_index   */      \\\n    schar*       prev_elem;  /**< pointer to previous element */\n\ntypedef struct CvSeqReader\n{\n    CV_SEQ_READER_FIELDS()\n}\nCvSeqReader;\n\n/****************************************************************************************/\n/*                                Operations on sequences                               */\n/****************************************************************************************/\n\n#define  CV_SEQ_ELEM( seq, elem_type, index )                    \\\n/** assert gives some guarantee that <seq> parameter is valid */  \\\n(   assert(sizeof((seq)->first[0]) == sizeof(CvSeqBlock) &&      \\\n    (seq)->elem_size == sizeof(elem_type)),                      \\\n    (elem_type*)((seq)->first && (unsigned)index <               \\\n    (unsigned)((seq)->first->count) ?                            \\\n    (seq)->first->data + (index) * sizeof(elem_type) :           \\\n    cvGetSeqElem( (CvSeq*)(seq), (index) )))\n#define CV_GET_SEQ_ELEM( elem_type, seq, index ) CV_SEQ_ELEM( (seq), elem_type, (index) )\n\n/** Add element to sequence: */\n#define CV_WRITE_SEQ_ELEM_VAR( elem_ptr, writer )     \\\n{                                                     \\\n    if( (writer).ptr >= (writer).block_max )          \\\n    {                                                 \\\n        cvCreateSeqBlock( &writer);                   \\\n    }                                                 \\\n    memcpy((writer).ptr, elem_ptr, (writer).seq->elem_size);\\\n    (writer).ptr += (writer).seq->elem_size;          \\\n}\n\n#define CV_WRITE_SEQ_ELEM( elem, writer )             \\\n{                                                     \\\n    assert( (writer).seq->elem_size == sizeof(elem)); \\\n    if( (writer).ptr >= (writer).block_max )          \\\n    {                                                 \\\n        cvCreateSeqBlock( &writer);                   \\\n    }                                                 \\\n    assert( (writer).ptr <= (writer).block_max - sizeof(elem));\\\n    memcpy((writer).ptr, &(elem), sizeof(elem));      \\\n    (writer).ptr += sizeof(elem);                     \\\n}\n\n\n/** Move reader position forward: */\n#define CV_NEXT_SEQ_ELEM( elem_size, reader )                 \\\n{                                                             \\\n    if( ((reader).ptr += (elem_size)) >= (reader).block_max ) \\\n    {                                                         \\\n        cvChangeSeqBlock( &(reader), 1 );                     \\\n    }                                                         \\\n}\n\n\n/** Move reader position backward: */\n#define CV_PREV_SEQ_ELEM( elem_size, reader )                \\\n{                                                            \\\n    if( ((reader).ptr -= (elem_size)) < (reader).block_min ) \\\n    {                                                        \\\n        cvChangeSeqBlock( &(reader), -1 );                   \\\n    }                                                        \\\n}\n\n/** Read element and move read position forward: */\n#define CV_READ_SEQ_ELEM( elem, reader )                       \\\n{                                                              \\\n    assert( (reader).seq->elem_size == sizeof(elem));          \\\n    memcpy( &(elem), (reader).ptr, sizeof((elem)));            \\\n    CV_NEXT_SEQ_ELEM( sizeof(elem), reader )                   \\\n}\n\n/** Read element and move read position backward: */\n#define CV_REV_READ_SEQ_ELEM( elem, reader )                     \\\n{                                                                \\\n    assert( (reader).seq->elem_size == sizeof(elem));            \\\n    memcpy(&(elem), (reader).ptr, sizeof((elem)));               \\\n    CV_PREV_SEQ_ELEM( sizeof(elem), reader )                     \\\n}\n\n\n#define CV_READ_CHAIN_POINT( _pt, reader )                              \\\n{                                                                       \\\n    (_pt) = (reader).pt;                                                \\\n    if( (reader).ptr )                                                  \\\n    {                                                                   \\\n        CV_READ_SEQ_ELEM( (reader).code, (reader));                     \\\n        assert( ((reader).code & ~7) == 0 );                            \\\n        (reader).pt.x += (reader).deltas[(int)(reader).code][0];        \\\n        (reader).pt.y += (reader).deltas[(int)(reader).code][1];        \\\n    }                                                                   \\\n}\n\n#define CV_CURRENT_POINT( reader )  (*((CvPoint*)((reader).ptr)))\n#define CV_PREV_POINT( reader )     (*((CvPoint*)((reader).prev_elem)))\n\n#define CV_READ_EDGE( pt1, pt2, reader )               \\\n{                                                      \\\n    assert( sizeof(pt1) == sizeof(CvPoint) &&          \\\n            sizeof(pt2) == sizeof(CvPoint) &&          \\\n            reader.seq->elem_size == sizeof(CvPoint)); \\\n    (pt1) = CV_PREV_POINT( reader );                   \\\n    (pt2) = CV_CURRENT_POINT( reader );                \\\n    (reader).prev_elem = (reader).ptr;                 \\\n    CV_NEXT_SEQ_ELEM( sizeof(CvPoint), (reader));      \\\n}\n\n/************ Graph macros ************/\n\n/** Return next graph edge for given vertex: */\n#define  CV_NEXT_GRAPH_EDGE( edge, vertex )                              \\\n     (assert((edge)->vtx[0] == (vertex) || (edge)->vtx[1] == (vertex)),  \\\n      (edge)->next[(edge)->vtx[1] == (vertex)])\n\n\n\n/****************************************************************************************\\\n*             Data structures for persistence (a.k.a serialization) functionality        *\n\\****************************************************************************************/\n\n#if 0\n\n/** \"black box\" file storage */\ntypedef struct CvFileStorage CvFileStorage;\n\n/** Storage flags: */\n#define CV_STORAGE_READ          0\n#define CV_STORAGE_WRITE         1\n#define CV_STORAGE_WRITE_TEXT    CV_STORAGE_WRITE\n#define CV_STORAGE_WRITE_BINARY  CV_STORAGE_WRITE\n#define CV_STORAGE_APPEND        2\n#define CV_STORAGE_MEMORY        4\n#define CV_STORAGE_FORMAT_MASK   (7<<3)\n#define CV_STORAGE_FORMAT_AUTO   0\n#define CV_STORAGE_FORMAT_XML    8\n#define CV_STORAGE_FORMAT_YAML  16\n#define CV_STORAGE_FORMAT_JSON  24\n#define CV_STORAGE_BASE64       64\n#define CV_STORAGE_WRITE_BASE64  (CV_STORAGE_BASE64 | CV_STORAGE_WRITE)\n\n/** @brief List of attributes. :\n\nIn the current implementation, attributes are used to pass extra parameters when writing user\nobjects (see cvWrite). XML attributes inside tags are not supported, aside from the object type\nspecification (type_id attribute).\n@see cvAttrList, cvAttrValue\n */\ntypedef struct CvAttrList\n{\n    const char** attr;         /**< NULL-terminated array of (attribute_name,attribute_value) pairs. */\n    struct CvAttrList* next;   /**< Pointer to next chunk of the attributes list.                    */\n}\nCvAttrList;\n\n/** initializes CvAttrList structure */\nCV_INLINE CvAttrList cvAttrList( const char** attr CV_DEFAULT(NULL),\n                                 CvAttrList* next CV_DEFAULT(NULL) )\n{\n    CvAttrList l;\n    l.attr = attr;\n    l.next = next;\n\n    return l;\n}\n\nstruct CvTypeInfo;\n\n#define CV_NODE_NONE        0\n#define CV_NODE_INT         1\n#define CV_NODE_INTEGER     CV_NODE_INT\n#define CV_NODE_REAL        2\n#define CV_NODE_FLOAT       CV_NODE_REAL\n#define CV_NODE_STR         3\n#define CV_NODE_STRING      CV_NODE_STR\n#define CV_NODE_REF         4 /**< not used */\n#define CV_NODE_SEQ         5\n#define CV_NODE_MAP         6\n#define CV_NODE_TYPE_MASK   7\n\n#define CV_NODE_TYPE(flags)  ((flags) & CV_NODE_TYPE_MASK)\n\n/** file node flags */\n#define CV_NODE_FLOW        8 /**<Used only for writing structures in YAML format. */\n#define CV_NODE_USER        16\n#define CV_NODE_EMPTY       32\n#define CV_NODE_NAMED       64\n\n#define CV_NODE_IS_INT(flags)        (CV_NODE_TYPE(flags) == CV_NODE_INT)\n#define CV_NODE_IS_REAL(flags)       (CV_NODE_TYPE(flags) == CV_NODE_REAL)\n#define CV_NODE_IS_STRING(flags)     (CV_NODE_TYPE(flags) == CV_NODE_STRING)\n#define CV_NODE_IS_SEQ(flags)        (CV_NODE_TYPE(flags) == CV_NODE_SEQ)\n#define CV_NODE_IS_MAP(flags)        (CV_NODE_TYPE(flags) == CV_NODE_MAP)\n#define CV_NODE_IS_COLLECTION(flags) (CV_NODE_TYPE(flags) >= CV_NODE_SEQ)\n#define CV_NODE_IS_FLOW(flags)       (((flags) & CV_NODE_FLOW) != 0)\n#define CV_NODE_IS_EMPTY(flags)      (((flags) & CV_NODE_EMPTY) != 0)\n#define CV_NODE_IS_USER(flags)       (((flags) & CV_NODE_USER) != 0)\n#define CV_NODE_HAS_NAME(flags)      (((flags) & CV_NODE_NAMED) != 0)\n\n#define CV_NODE_SEQ_SIMPLE 256\n#define CV_NODE_SEQ_IS_SIMPLE(seq) (((seq)->flags & CV_NODE_SEQ_SIMPLE) != 0)\n\ntypedef struct CvString\n{\n    int len;\n    char* ptr;\n}\nCvString;\n\n/** All the keys (names) of elements in the read file storage\n   are stored in the hash to speed up the lookup operations: */\ntypedef struct CvStringHashNode\n{\n    unsigned hashval;\n    CvString str;\n    struct CvStringHashNode* next;\n}\nCvStringHashNode;\n\ntypedef struct CvGenericHash CvFileNodeHash;\n\n/** Basic element of the file storage - scalar or collection: */\ntypedef struct CvFileNode\n{\n    int tag;\n    struct CvTypeInfo* info; /**< type information\n            (only for user-defined object, for others it is 0) */\n    union\n    {\n        double f; /**< scalar floating-point number */\n        int i;    /**< scalar integer number */\n        CvString str; /**< text string */\n        CvSeq* seq; /**< sequence (ordered collection of file nodes) */\n        CvFileNodeHash* map; /**< map (collection of named file nodes) */\n    } data;\n}\nCvFileNode;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\ntypedef int (CV_CDECL *CvIsInstanceFunc)( const void* struct_ptr );\ntypedef void (CV_CDECL *CvReleaseFunc)( void** struct_dblptr );\ntypedef void* (CV_CDECL *CvReadFunc)( CvFileStorage* storage, CvFileNode* node );\ntypedef void (CV_CDECL *CvWriteFunc)( CvFileStorage* storage, const char* name,\n                                      const void* struct_ptr, CvAttrList attributes );\ntypedef void* (CV_CDECL *CvCloneFunc)( const void* struct_ptr );\n#ifdef __cplusplus\n}\n#endif\n\n/** @brief Type information\n\nThe structure contains information about one of the standard or user-defined types. Instances of the\ntype may or may not contain a pointer to the corresponding CvTypeInfo structure. In any case, there\nis a way to find the type info structure for a given object using the cvTypeOf function.\nAlternatively, type info can be found by type name using cvFindType, which is used when an object\nis read from file storage. The user can register a new type with cvRegisterType that adds the type\ninformation structure into the beginning of the type list. Thus, it is possible to create\nspecialized types from generic standard types and override the basic methods.\n */\ntypedef struct CvTypeInfo\n{\n    int flags; /**< not used */\n    int header_size; /**< sizeof(CvTypeInfo) */\n    struct CvTypeInfo* prev; /**< previous registered type in the list */\n    struct CvTypeInfo* next; /**< next registered type in the list */\n    const char* type_name; /**< type name, written to file storage */\n    CvIsInstanceFunc is_instance; /**< checks if the passed object belongs to the type */\n    CvReleaseFunc release; /**< releases object (memory etc.) */\n    CvReadFunc read; /**< reads object from file storage */\n    CvWriteFunc write; /**< writes object to file storage */\n    CvCloneFunc clone; /**< creates a copy of the object */\n}\nCvTypeInfo;\n#endif\n\n/** @} */\n\n#endif /*OPENCV_CORE_TYPES_H*/\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utility.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_UTILITY_H\n#define OPENCV_CORE_UTILITY_H\n\n#ifndef __cplusplus\n#  error utility.hpp header must be compiled as C++\n#endif\n\n#if defined(check)\n#  warning Detected Apple 'check' macro definition, it can cause build conflicts. Please, include this header before any Apple headers.\n#endif\n\n#include \"opencv2/core.hpp\"\n#include <ostream>\n\n#include <functional>\n\n#if !defined(_M_CEE)\n#include <mutex>  // std::mutex, std::lock_guard\n#endif\n\nnamespace cv\n{\n\n//! @addtogroup core_utils\n//! @{\n\n/** @brief  Automatically Allocated Buffer Class\n\n The class is used for temporary buffers in functions and methods.\n If a temporary buffer is usually small (a few K's of memory),\n but its size depends on the parameters, it makes sense to create a small\n fixed-size array on stack and use it if it's large enough. If the required buffer size\n is larger than the fixed size, another buffer of sufficient size is allocated dynamically\n and released after the processing. Therefore, in typical cases, when the buffer size is small,\n there is no overhead associated with malloc()/free().\n At the same time, there is no limit on the size of processed data.\n\n This is what AutoBuffer does. The template takes 2 parameters - type of the buffer elements and\n the number of stack-allocated elements. Here is how the class is used:\n\n \\code\n void my_func(const cv::Mat& m)\n {\n    cv::AutoBuffer<float> buf(1000); // create automatic buffer containing 1000 floats\n\n    buf.allocate(m.rows); // if m.rows <= 1000, the pre-allocated buffer is used,\n                          // otherwise the buffer of \"m.rows\" floats will be allocated\n                          // dynamically and deallocated in cv::AutoBuffer destructor\n    ...\n }\n \\endcode\n*/\n#ifdef OPENCV_ENABLE_MEMORY_SANITIZER\ntemplate<typename _Tp, size_t fixed_size = 0> class AutoBuffer\n#else\ntemplate<typename _Tp, size_t fixed_size = 1024/sizeof(_Tp)+8> class AutoBuffer\n#endif\n{\npublic:\n    typedef _Tp value_type;\n\n    //! the default constructor\n    AutoBuffer();\n    //! constructor taking the real buffer size\n    explicit AutoBuffer(size_t _size);\n\n    //! the copy constructor\n    AutoBuffer(const AutoBuffer<_Tp, fixed_size>& buf);\n    //! the assignment operator\n    AutoBuffer<_Tp, fixed_size>& operator = (const AutoBuffer<_Tp, fixed_size>& buf);\n\n    //! destructor. calls deallocate()\n    ~AutoBuffer();\n\n    //! allocates the new buffer of size _size. if the _size is small enough, stack-allocated buffer is used\n    void allocate(size_t _size);\n    //! deallocates the buffer if it was dynamically allocated\n    void deallocate();\n    //! resizes the buffer and preserves the content\n    void resize(size_t _size);\n    //! returns the current buffer size\n    size_t size() const;\n    //! returns pointer to the real buffer, stack-allocated or heap-allocated\n    inline _Tp* data() { return ptr; }\n    //! returns read-only pointer to the real buffer, stack-allocated or heap-allocated\n    inline const _Tp* data() const { return ptr; }\n\n#if !defined(OPENCV_DISABLE_DEPRECATED_COMPATIBILITY) // use to .data() calls instead\n    //! returns pointer to the real buffer, stack-allocated or heap-allocated\n    operator _Tp* () { return ptr; }\n    //! returns read-only pointer to the real buffer, stack-allocated or heap-allocated\n    operator const _Tp* () const { return ptr; }\n#else\n    //! returns a reference to the element at specified location. No bounds checking is performed in Release builds.\n    inline _Tp& operator[] (size_t i) { CV_DbgCheckLT(i, sz, \"out of range\"); return ptr[i]; }\n    //! returns a reference to the element at specified location. No bounds checking is performed in Release builds.\n    inline const _Tp& operator[] (size_t i) const { CV_DbgCheckLT(i, sz, \"out of range\"); return ptr[i]; }\n#endif\n\nprotected:\n    //! pointer to the real buffer, can point to buf if the buffer is small enough\n    _Tp* ptr;\n    //! size of the real buffer\n    size_t sz;\n    //! pre-allocated buffer. At least 1 element to confirm C++ standard requirements\n    _Tp buf[(fixed_size > 0) ? fixed_size : 1];\n};\n\n/**  @brief Sets/resets the break-on-error mode.\n\nWhen the break-on-error mode is set, the default error handler issues a hardware exception, which\ncan make debugging more convenient.\n\n\\return the previous state\n */\nCV_EXPORTS bool setBreakOnError(bool flag);\n\nextern \"C\" typedef int (*ErrorCallback)( int status, const char* func_name,\n                                       const char* err_msg, const char* file_name,\n                                       int line, void* userdata );\n\n\n/** @brief Sets the new error handler and the optional user data.\n\n  The function sets the new error handler, called from cv::error().\n\n  \\param errCallback the new error handler. If NULL, the default error handler is used.\n  \\param userdata the optional user data pointer, passed to the callback.\n  \\param prevUserdata the optional output parameter where the previous user data pointer is stored\n\n  \\return the previous error handler\n*/\nCV_EXPORTS ErrorCallback redirectError( ErrorCallback errCallback, void* userdata=0, void** prevUserdata=0);\n\nCV_EXPORTS String tempfile( const char* suffix = 0);\nCV_EXPORTS void glob(String pattern, std::vector<String>& result, bool recursive = false);\n\n/** @brief OpenCV will try to set the number of threads for the next parallel region.\n\nIf threads == 0, OpenCV will disable threading optimizations and run all it's functions\nsequentially. Passing threads \\< 0 will reset threads number to system default. This function must\nbe called outside of parallel region.\n\nOpenCV will try to run its functions with specified threads number, but some behaviour differs from\nframework:\n-   `TBB` - User-defined parallel constructions will run with the same threads number, if\n    another is not specified. If later on user creates his own scheduler, OpenCV will use it.\n-   `OpenMP` - No special defined behaviour.\n-   `Concurrency` - If threads == 1, OpenCV will disable threading optimizations and run its\n    functions sequentially.\n-   `GCD` - Supports only values \\<= 0.\n-   `C=` - No special defined behaviour.\n@param nthreads Number of threads used by OpenCV.\n@sa getNumThreads, getThreadNum\n */\nCV_EXPORTS_W void setNumThreads(int nthreads);\n\n/** @brief Returns the number of threads used by OpenCV for parallel regions.\n\nAlways returns 1 if OpenCV is built without threading support.\n\nThe exact meaning of return value depends on the threading framework used by OpenCV library:\n- `TBB` - The number of threads, that OpenCV will try to use for parallel regions. If there is\n  any tbb::thread_scheduler_init in user code conflicting with OpenCV, then function returns\n  default number of threads used by TBB library.\n- `OpenMP` - An upper bound on the number of threads that could be used to form a new team.\n- `Concurrency` - The number of threads, that OpenCV will try to use for parallel regions.\n- `GCD` - Unsupported; returns the GCD thread pool limit (512) for compatibility.\n- `C=` - The number of threads, that OpenCV will try to use for parallel regions, if before\n  called setNumThreads with threads \\> 0, otherwise returns the number of logical CPUs,\n  available for the process.\n@sa setNumThreads, getThreadNum\n */\nCV_EXPORTS_W int getNumThreads();\n\n/** @brief Returns the index of the currently executed thread within the current parallel region. Always\nreturns 0 if called outside of parallel region.\n\n@deprecated Current implementation doesn't corresponding to this documentation.\n\nThe exact meaning of the return value depends on the threading framework used by OpenCV library:\n- `TBB` - Unsupported with current 4.1 TBB release. Maybe will be supported in future.\n- `OpenMP` - The thread number, within the current team, of the calling thread.\n- `Concurrency` - An ID for the virtual processor that the current context is executing on (0\n  for master thread and unique number for others, but not necessary 1,2,3,...).\n- `GCD` - System calling thread's ID. Never returns 0 inside parallel region.\n- `C=` - The index of the current parallel task.\n@sa setNumThreads, getNumThreads\n */\nCV_EXPORTS_W int getThreadNum();\n\n/** @brief Returns full configuration time cmake output.\n\nReturned value is raw cmake output including version control system revision, compiler version,\ncompiler flags, enabled modules and third party libraries, etc. Output format depends on target\narchitecture.\n */\nCV_EXPORTS_W const String& getBuildInformation();\n\n/** @brief Returns library version string\n\nFor example \"3.4.1-dev\".\n\n@sa getMajorVersion, getMinorVersion, getRevisionVersion\n*/\nCV_EXPORTS_W String getVersionString();\n\n/** @brief Returns major library version */\nCV_EXPORTS_W int getVersionMajor();\n\n/** @brief Returns minor library version */\nCV_EXPORTS_W int getVersionMinor();\n\n/** @brief Returns revision field of the library version */\nCV_EXPORTS_W int getVersionRevision();\n\n/** @brief Returns the number of ticks.\n\nThe function returns the number of ticks after the certain event (for example, when the machine was\nturned on). It can be used to initialize RNG or to measure a function execution time by reading the\ntick count before and after the function call.\n@sa getTickFrequency, TickMeter\n */\nCV_EXPORTS_W int64 getTickCount();\n\n/** @brief Returns the number of ticks per second.\n\nThe function returns the number of ticks per second. That is, the following code computes the\nexecution time in seconds:\n@code\n    double t = (double)getTickCount();\n    // do something ...\n    t = ((double)getTickCount() - t)/getTickFrequency();\n@endcode\n@sa getTickCount, TickMeter\n */\nCV_EXPORTS_W double getTickFrequency();\n\n/** @brief a Class to measure passing time.\n\nThe class computes passing time by counting the number of ticks per second. That is, the following code computes the\nexecution time in seconds:\n@snippet snippets/core_various.cpp TickMeter_total\n\nIt is also possible to compute the average time over multiple runs:\n@snippet snippets/core_various.cpp TickMeter_average\n\n@sa getTickCount, getTickFrequency\n*/\nclass CV_EXPORTS_W TickMeter\n{\npublic:\n    //! the default constructor\n    CV_WRAP TickMeter()\n    {\n        reset();\n    }\n\n    //! starts counting ticks.\n    CV_WRAP void start()\n    {\n        startTime = cv::getTickCount();\n    }\n\n    //! stops counting ticks.\n    CV_WRAP void stop()\n    {\n        int64 time = cv::getTickCount();\n        if (startTime == 0)\n            return;\n        ++counter;\n        sumTime += (time - startTime);\n        startTime = 0;\n    }\n\n    //! returns counted ticks.\n    CV_WRAP int64 getTimeTicks() const\n    {\n        return sumTime;\n    }\n\n    //! returns passed time in microseconds.\n    CV_WRAP double getTimeMicro() const\n    {\n        return getTimeMilli()*1e3;\n    }\n\n    //! returns passed time in milliseconds.\n    CV_WRAP double getTimeMilli() const\n    {\n        return getTimeSec()*1e3;\n    }\n\n    //! returns passed time in seconds.\n    CV_WRAP double getTimeSec()   const\n    {\n        return (double)getTimeTicks() / getTickFrequency();\n    }\n\n    //! returns internal counter value.\n    CV_WRAP int64 getCounter() const\n    {\n        return counter;\n    }\n\n    //! returns average FPS (frames per second) value.\n    CV_WRAP double getFPS() const\n    {\n        const double sec = getTimeSec();\n        if (sec < DBL_EPSILON)\n            return 0.;\n        return counter / sec;\n    }\n\n    //! returns average time in seconds\n    CV_WRAP double getAvgTimeSec() const\n    {\n        if (counter <= 0)\n            return 0.;\n        return getTimeSec() / counter;\n    }\n\n    //! returns average time in milliseconds\n    CV_WRAP double getAvgTimeMilli() const\n    {\n        return getAvgTimeSec() * 1e3;\n    }\n\n    //! resets internal values.\n    CV_WRAP void reset()\n    {\n        startTime = 0;\n        sumTime = 0;\n        counter = 0;\n    }\n\nprivate:\n    int64 counter;\n    int64 sumTime;\n    int64 startTime;\n};\n\n/** @brief output operator\n@code\nTickMeter tm;\ntm.start();\n// do something ...\ntm.stop();\nstd::cout << tm;\n@endcode\n*/\n\nstatic inline\nstd::ostream& operator << (std::ostream& out, const TickMeter& tm)\n{\n    return out << tm.getTimeSec() << \"sec\";\n}\n\n/** @brief Returns the number of CPU ticks.\n\nThe function returns the current number of CPU ticks on some architectures (such as x86, x64,\nPowerPC). On other platforms the function is equivalent to getTickCount. It can also be used for\nvery accurate time measurements, as well as for RNG initialization. Note that in case of multi-CPU\nsystems a thread, from which getCPUTickCount is called, can be suspended and resumed at another CPU\nwith its own counter. So, theoretically (and practically) the subsequent calls to the function do\nnot necessary return the monotonously increasing values. Also, since a modern CPU varies the CPU\nfrequency depending on the load, the number of CPU clocks spent in some code cannot be directly\nconverted to time units. Therefore, getTickCount is generally a preferable solution for measuring\nexecution time.\n */\nCV_EXPORTS_W int64 getCPUTickCount();\n\n/** @brief Returns true if the specified feature is supported by the host hardware.\n\nThe function returns true if the host hardware supports the specified feature. When user calls\nsetUseOptimized(false), the subsequent calls to checkHardwareSupport() will return false until\nsetUseOptimized(true) is called. This way user can dynamically switch on and off the optimized code\nin OpenCV.\n@param feature The feature of interest, one of cv::CpuFeatures\n */\nCV_EXPORTS_W bool checkHardwareSupport(int feature);\n\n/** @brief Returns feature name by ID\n\nReturns empty string if feature is not defined\n*/\nCV_EXPORTS_W String getHardwareFeatureName(int feature);\n\n/** @brief Returns list of CPU features enabled during compilation.\n\nReturned value is a string containing space separated list of CPU features with following markers:\n\n- no markers - baseline features\n- prefix `*` - features enabled in dispatcher\n- suffix `?` - features enabled but not available in HW\n\nExample: `SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2 *AVX512-SKX?`\n*/\nCV_EXPORTS_W std::string getCPUFeaturesLine();\n\n/** @brief Returns the number of logical CPUs available for the process.\n */\nCV_EXPORTS_W int getNumberOfCPUs();\n\n\n/** @brief Aligns a pointer to the specified number of bytes.\n\nThe function returns the aligned pointer of the same type as the input pointer:\n\\f[\\texttt{(_Tp*)(((size_t)ptr + n-1) & -n)}\\f]\n@param ptr Aligned pointer.\n@param n Alignment size that must be a power of two.\n */\ntemplate<typename _Tp> static inline _Tp* alignPtr(_Tp* ptr, int n=(int)sizeof(_Tp))\n{\n    CV_DbgAssert((n & (n - 1)) == 0); // n is a power of 2\n    return (_Tp*)(((size_t)ptr + n-1) & -n);\n}\n\n/** @brief Aligns a buffer size to the specified number of bytes.\n\nThe function returns the minimum number that is greater than or equal to sz and is divisible by n :\n\\f[\\texttt{(sz + n-1) & -n}\\f]\n@param sz Buffer size to align.\n@param n Alignment size that must be a power of two.\n */\nstatic inline size_t alignSize(size_t sz, int n)\n{\n    CV_DbgAssert((n & (n - 1)) == 0); // n is a power of 2\n    return (sz + n-1) & -n;\n}\n\n/** @brief Integer division with result round up.\n\nUse this function instead of `ceil((float)a / b)` expressions.\n\n@sa alignSize\n*/\nstatic inline int divUp(int a, unsigned int b)\n{\n    CV_DbgAssert(a >= 0);\n    return (a + b - 1) / b;\n}\n/** @overload */\nstatic inline size_t divUp(size_t a, unsigned int b)\n{\n    return (a + b - 1) / b;\n}\n\n/** @brief Round first value up to the nearest multiple of second value.\n\nUse this function instead of `ceil((float)a / b) * b` expressions.\n\n@sa divUp\n*/\nstatic inline int roundUp(int a, unsigned int b)\n{\n    CV_DbgAssert(a >= 0);\n    return a + b - 1 - (a + b -1) % b;\n}\n/** @overload */\nstatic inline size_t roundUp(size_t a, unsigned int b)\n{\n    return a + b - 1 - (a + b - 1) % b;\n}\n\n/** @brief Alignment check of passed values\n\nUsage: `isAligned<sizeof(int)>(...)`\n\n@note Alignment(N) must be a power of 2 (2**k, 2^k)\n*/\ntemplate<int N, typename T> static inline\nbool isAligned(const T& data)\n{\n    CV_StaticAssert((N & (N - 1)) == 0, \"\");  // power of 2\n    return (((size_t)data) & (N - 1)) == 0;\n}\n/** @overload */\ntemplate<int N> static inline\nbool isAligned(const void* p1)\n{\n    return isAligned<N>((size_t)p1);\n}\n/** @overload */\ntemplate<int N> static inline\nbool isAligned(const void* p1, const void* p2)\n{\n    return isAligned<N>(((size_t)p1)|((size_t)p2));\n}\n/** @overload */\ntemplate<int N> static inline\nbool isAligned(const void* p1, const void* p2, const void* p3)\n{\n    return isAligned<N>(((size_t)p1)|((size_t)p2)|((size_t)p3));\n}\n/** @overload */\ntemplate<int N> static inline\nbool isAligned(const void* p1, const void* p2, const void* p3, const void* p4)\n{\n    return isAligned<N>(((size_t)p1)|((size_t)p2)|((size_t)p3)|((size_t)p4));\n}\n\n/** @brief Enables or disables the optimized code.\n\nThe function can be used to dynamically turn on and off optimized dispatched code (code that uses SSE4.2, AVX/AVX2,\nand other instructions on the platforms that support it). It sets a global flag that is further\nchecked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only\nsafe to call the function on the very top level in your application where you can be sure that no\nother OpenCV function is currently executed.\n\nBy default, the optimized code is enabled unless you disable it in CMake. The current status can be\nretrieved using useOptimized.\n@param onoff The boolean flag specifying whether the optimized code should be used (onoff=true)\nor not (onoff=false).\n */\nCV_EXPORTS_W void setUseOptimized(bool onoff);\n\n/** @brief Returns the status of optimized code usage.\n\nThe function returns true if the optimized code is enabled. Otherwise, it returns false.\n */\nCV_EXPORTS_W bool useOptimized();\n\nstatic inline size_t getElemSize(int type) { return (size_t)CV_ELEM_SIZE(type); }\n\n/////////////////////////////// Parallel Primitives //////////////////////////////////\n\n/** @brief Base class for parallel data processors\n\n@ingroup core_parallel\n*/\nclass CV_EXPORTS ParallelLoopBody\n{\npublic:\n    virtual ~ParallelLoopBody();\n    virtual void operator() (const Range& range) const = 0;\n};\n\n/** @brief Parallel data processor\n\n@ingroup core_parallel\n*/\nCV_EXPORTS void parallel_for_(const Range& range, const ParallelLoopBody& body, double nstripes=-1.);\n\n//! @ingroup core_parallel\nclass ParallelLoopBodyLambdaWrapper : public ParallelLoopBody\n{\nprivate:\n    std::function<void(const Range&)> m_functor;\npublic:\n    inline\n    ParallelLoopBodyLambdaWrapper(std::function<void(const Range&)> functor)\n        : m_functor(functor)\n    {\n        // nothing\n    }\n\n    virtual void operator() (const cv::Range& range) const CV_OVERRIDE\n    {\n        m_functor(range);\n    }\n};\n\n//! @ingroup core_parallel\nstatic inline\nvoid parallel_for_(const Range& range, std::function<void(const Range&)> functor, double nstripes=-1.)\n{\n    parallel_for_(range, ParallelLoopBodyLambdaWrapper(functor), nstripes);\n}\n\n\n/////////////////////////////// forEach method of cv::Mat ////////////////////////////\ntemplate<typename _Tp, typename Functor> inline\nvoid Mat::forEach_impl(const Functor& operation) {\n    if (false) {\n        operation(*reinterpret_cast<_Tp*>(0), reinterpret_cast<int*>(0));\n        // If your compiler fails in this line.\n        // Please check that your functor signature is\n        //     (_Tp&, const int*)   <- multi-dimensional\n        //  or (_Tp&, void*)        <- in case you don't need current idx.\n    }\n\n    CV_Assert(!empty());\n    CV_Assert(this->total() / this->size[this->dims - 1] <= INT_MAX);\n    const int LINES = static_cast<int>(this->total() / this->size[this->dims - 1]);\n\n    class PixelOperationWrapper :public ParallelLoopBody\n    {\n    public:\n        PixelOperationWrapper(Mat_<_Tp>* const frame, const Functor& _operation)\n            : mat(frame), op(_operation) {}\n        virtual ~PixelOperationWrapper(){}\n        // ! Overloaded virtual operator\n        // convert range call to row call.\n        virtual void operator()(const Range &range) const CV_OVERRIDE\n        {\n            const int DIMS = mat->dims;\n            const int COLS = mat->size[DIMS - 1];\n            if (DIMS <= 2) {\n                for (int row = range.start; row < range.end; ++row) {\n                    this->rowCall2(row, COLS);\n                }\n            } else {\n                std::vector<int> idx(DIMS); /// idx is modified in this->rowCall\n                idx[DIMS - 2] = range.start - 1;\n\n                for (int line_num = range.start; line_num < range.end; ++line_num) {\n                    idx[DIMS - 2]++;\n                    for (int i = DIMS - 2; i >= 0; --i) {\n                        if (idx[i] >= mat->size[i]) {\n                            idx[i - 1] += idx[i] / mat->size[i];\n                            idx[i] %= mat->size[i];\n                            continue; // carry-over;\n                        }\n                        else {\n                            break;\n                        }\n                    }\n                    this->rowCall(&idx[0], COLS, DIMS);\n                }\n            }\n        }\n    private:\n        Mat_<_Tp>* const mat;\n        const Functor op;\n        // ! Call operator for each elements in this row.\n        inline void rowCall(int* const idx, const int COLS, const int DIMS) const {\n            int &col = idx[DIMS - 1];\n            col = 0;\n            _Tp* pixel = &(mat->template at<_Tp>(idx));\n\n            while (col < COLS) {\n                op(*pixel, const_cast<const int*>(idx));\n                pixel++; col++;\n            }\n            col = 0;\n        }\n        // ! Call operator for each elements in this row. 2d mat special version.\n        inline void rowCall2(const int row, const int COLS) const {\n            union Index{\n                int body[2];\n                operator const int*() const {\n                    return reinterpret_cast<const int*>(this);\n                }\n                int& operator[](const int i) {\n                    return body[i];\n                }\n            } idx = {{row, 0}};\n            // Special union is needed to avoid\n            // \"error: array subscript is above array bounds [-Werror=array-bounds]\"\n            // when call the functor `op` such that access idx[3].\n\n            _Tp* pixel = &(mat->template at<_Tp>(idx));\n            const _Tp* const pixel_end = pixel + COLS;\n            while(pixel < pixel_end) {\n                op(*pixel++, static_cast<const int*>(idx));\n                idx[1]++;\n            }\n        }\n        PixelOperationWrapper& operator=(const PixelOperationWrapper &) {\n            CV_Assert(false);\n            // We can not remove this implementation because Visual Studio warning C4822.\n            return *this;\n        }\n    };\n\n    parallel_for_(cv::Range(0, LINES), PixelOperationWrapper(reinterpret_cast<Mat_<_Tp>*>(this), operation));\n}\n\n/////////////////////////// Synchronization Primitives ///////////////////////////////\n\n#if !defined(_M_CEE)\ntypedef std::recursive_mutex Mutex;\ntypedef std::lock_guard<cv::Mutex> AutoLock;\n#endif\n\n\n/** @brief Designed for command line parsing\n\nThe sample below demonstrates how to use CommandLineParser:\n@code\n    CommandLineParser parser(argc, argv, keys);\n    parser.about(\"Application name v1.0.0\");\n\n    if (parser.has(\"help\"))\n    {\n        parser.printMessage();\n        return 0;\n    }\n\n    int N = parser.get<int>(\"N\");\n    double fps = parser.get<double>(\"fps\");\n    String path = parser.get<String>(\"path\");\n\n    use_time_stamp = parser.has(\"timestamp\");\n\n    String img1 = parser.get<String>(0);\n    String img2 = parser.get<String>(1);\n\n    int repeat = parser.get<int>(2);\n\n    if (!parser.check())\n    {\n        parser.printErrors();\n        return 0;\n    }\n@endcode\n\n### Keys syntax\n\nThe keys parameter is a string containing several blocks, each one is enclosed in curly braces and\ndescribes one argument. Each argument contains three parts separated by the `|` symbol:\n\n-# argument names is a space-separated list of option synonyms (to mark argument as positional, prefix it with the `@` symbol)\n-# default value will be used if the argument was not provided (can be empty)\n-# help message (can be empty)\n\nFor example:\n\n@code{.cpp}\n    const String keys =\n        \"{help h usage ? |      | print this message   }\"\n        \"{@image1        |      | image1 for compare   }\"\n        \"{@image2        |<none>| image2 for compare   }\"\n        \"{@repeat        |1     | number               }\"\n        \"{path           |.     | path to file         }\"\n        \"{fps            | -1.0 | fps for output video }\"\n        \"{N count        |100   | count of objects     }\"\n        \"{ts timestamp   |      | use time stamp       }\"\n        ;\n}\n@endcode\n\nNote that there are no default values for `help` and `timestamp` so we can check their presence using the `has()` method.\nArguments with default values are considered to be always present. Use the `get()` method in these cases to check their\nactual value instead.\n\nString keys like `get<String>(\"@image1\")` return the empty string `\"\"` by default - even with an empty default value.\nUse the special `<none>` default value to enforce that the returned string must not be empty. (like in `get<String>(\"@image2\")`)\n\n### Usage\n\nFor the described keys:\n\n@code{.sh}\n    # Good call (3 positional parameters: image1, image2 and repeat; N is 200, ts is true)\n    $ ./app -N=200 1.png 2.jpg 19 -ts\n\n    # Bad call\n    $ ./app -fps=aaa\n    ERRORS:\n    Parameter 'fps': can not convert: [aaa] to [double]\n@endcode\n */\nclass CV_EXPORTS CommandLineParser\n{\npublic:\n\n    /** @brief Constructor\n\n    Initializes command line parser object\n\n    @param argc number of command line arguments (from main())\n    @param argv array of command line arguments (from main())\n    @param keys string describing acceptable command line parameters (see class description for syntax)\n    */\n    CommandLineParser(int argc, const char* const argv[], const String& keys);\n\n    /** @brief Copy constructor */\n    CommandLineParser(const CommandLineParser& parser);\n\n    /** @brief Assignment operator */\n    CommandLineParser& operator = (const CommandLineParser& parser);\n\n    /** @brief Destructor */\n    ~CommandLineParser();\n\n    /** @brief Returns application path\n\n    This method returns the path to the executable from the command line (`argv[0]`).\n\n    For example, if the application has been started with such a command:\n    @code{.sh}\n    $ ./bin/my-executable\n    @endcode\n    this method will return `./bin`.\n    */\n    String getPathToApplication() const;\n\n    /** @brief Access arguments by name\n\n    Returns argument converted to selected type. If the argument is not known or can not be\n    converted to selected type, the error flag is set (can be checked with @ref check).\n\n    For example, define:\n    @code{.cpp}\n    String keys = \"{N count||}\";\n    @endcode\n\n    Call:\n    @code{.sh}\n    $ ./my-app -N=20\n    # or\n    $ ./my-app --count=20\n    @endcode\n\n    Access:\n    @code{.cpp}\n    int N = parser.get<int>(\"N\");\n    @endcode\n\n    @param name name of the argument\n    @param space_delete remove spaces from the left and right of the string\n    @tparam T the argument will be converted to this type if possible\n\n    @note You can access positional arguments by their `@`-prefixed name:\n    @code{.cpp}\n    parser.get<String>(\"@image\");\n    @endcode\n     */\n    template <typename T>\n    T get(const String& name, bool space_delete = true) const\n    {\n        T val = T();\n        getByName(name, space_delete, ParamType<T>::type, (void*)&val);\n        return val;\n    }\n\n    /** @brief Access positional arguments by index\n\n    Returns argument converted to selected type. Indexes are counted from zero.\n\n    For example, define:\n    @code{.cpp}\n    String keys = \"{@arg1||}{@arg2||}\"\n    @endcode\n\n    Call:\n    @code{.sh}\n    ./my-app abc qwe\n    @endcode\n\n    Access arguments:\n    @code{.cpp}\n    String val_1 = parser.get<String>(0); // returns \"abc\", arg1\n    String val_2 = parser.get<String>(1); // returns \"qwe\", arg2\n    @endcode\n\n    @param index index of the argument\n    @param space_delete remove spaces from the left and right of the string\n    @tparam T the argument will be converted to this type if possible\n     */\n    template <typename T>\n    T get(int index, bool space_delete = true) const\n    {\n        T val = T();\n        getByIndex(index, space_delete, ParamType<T>::type, (void*)&val);\n        return val;\n    }\n\n    /** @brief Check if field was provided in the command line\n\n    @param name argument name to check\n    */\n    bool has(const String& name) const;\n\n    /** @brief Check for parsing errors\n\n    Returns false if error occurred while accessing the parameters (bad conversion, missing arguments,\n    etc.). Call @ref printErrors to print error messages list.\n     */\n    bool check() const;\n\n    /** @brief Set the about message\n\n    The about message will be shown when @ref printMessage is called, right before arguments table.\n     */\n    void about(const String& message);\n\n    /** @brief Print help message\n\n    This method will print standard help message containing the about message and arguments description.\n\n    @sa about\n    */\n    void printMessage() const;\n\n    /** @brief Print list of errors occurred\n\n    @sa check\n    */\n    void printErrors() const;\n\nprotected:\n    void getByName(const String& name, bool space_delete, Param type, void* dst) const;\n    void getByIndex(int index, bool space_delete, Param type, void* dst) const;\n\n    struct Impl;\n    Impl* impl;\n};\n\n//! @} core_utils\n\n//! @cond IGNORED\n\n/////////////////////////////// AutoBuffer implementation ////////////////////////////////////////\n\ntemplate<typename _Tp, size_t fixed_size> inline\nAutoBuffer<_Tp, fixed_size>::AutoBuffer()\n{\n    ptr = buf;\n    sz = fixed_size;\n}\n\ntemplate<typename _Tp, size_t fixed_size> inline\nAutoBuffer<_Tp, fixed_size>::AutoBuffer(size_t _size)\n{\n    ptr = buf;\n    sz = fixed_size;\n    allocate(_size);\n}\n\ntemplate<typename _Tp, size_t fixed_size> inline\nAutoBuffer<_Tp, fixed_size>::AutoBuffer(const AutoBuffer<_Tp, fixed_size>& abuf )\n{\n    ptr = buf;\n    sz = fixed_size;\n    allocate(abuf.size());\n    for( size_t i = 0; i < sz; i++ )\n        ptr[i] = abuf.ptr[i];\n}\n\ntemplate<typename _Tp, size_t fixed_size> inline AutoBuffer<_Tp, fixed_size>&\nAutoBuffer<_Tp, fixed_size>::operator = (const AutoBuffer<_Tp, fixed_size>& abuf)\n{\n    if( this != &abuf )\n    {\n        deallocate();\n        allocate(abuf.size());\n        for( size_t i = 0; i < sz; i++ )\n            ptr[i] = abuf.ptr[i];\n    }\n    return *this;\n}\n\ntemplate<typename _Tp, size_t fixed_size> inline\nAutoBuffer<_Tp, fixed_size>::~AutoBuffer()\n{ deallocate(); }\n\ntemplate<typename _Tp, size_t fixed_size> inline void\nAutoBuffer<_Tp, fixed_size>::allocate(size_t _size)\n{\n    if(_size <= sz)\n    {\n        sz = _size;\n        return;\n    }\n    deallocate();\n    sz = _size;\n    if(_size > fixed_size)\n    {\n        ptr = new _Tp[_size];\n    }\n}\n\ntemplate<typename _Tp, size_t fixed_size> inline void\nAutoBuffer<_Tp, fixed_size>::deallocate()\n{\n    if( ptr != buf )\n    {\n        delete[] ptr;\n        ptr = buf;\n        sz = fixed_size;\n    }\n}\n\ntemplate<typename _Tp, size_t fixed_size> inline void\nAutoBuffer<_Tp, fixed_size>::resize(size_t _size)\n{\n    if(_size <= sz)\n    {\n        sz = _size;\n        return;\n    }\n    size_t i, prevsize = sz, minsize = MIN(prevsize, _size);\n    _Tp* prevptr = ptr;\n\n    ptr = _size > fixed_size ? new _Tp[_size] : buf;\n    sz = _size;\n\n    if( ptr != prevptr )\n        for( i = 0; i < minsize; i++ )\n            ptr[i] = prevptr[i];\n    for( i = prevsize; i < _size; i++ )\n        ptr[i] = _Tp();\n\n    if( prevptr != buf )\n        delete[] prevptr;\n}\n\ntemplate<typename _Tp, size_t fixed_size> inline size_t\nAutoBuffer<_Tp, fixed_size>::size() const\n{ return sz; }\n\n//! @endcond\n\n\n// Basic Node class for tree building\ntemplate<class OBJECT>\nclass CV_EXPORTS Node\n{\npublic:\n    Node()\n    {\n        m_pParent  = 0;\n    }\n    Node(OBJECT& payload) : m_payload(payload)\n    {\n        m_pParent  = 0;\n    }\n    ~Node()\n    {\n        removeChilds();\n        if (m_pParent)\n        {\n            int idx = m_pParent->findChild(this);\n            if (idx >= 0)\n                m_pParent->m_childs.erase(m_pParent->m_childs.begin() + idx);\n        }\n    }\n\n    Node<OBJECT>* findChild(OBJECT& payload) const\n    {\n        for(size_t i = 0; i < this->m_childs.size(); i++)\n        {\n            if(this->m_childs[i]->m_payload == payload)\n                return this->m_childs[i];\n        }\n        return NULL;\n    }\n\n    int findChild(Node<OBJECT> *pNode) const\n    {\n        for (size_t i = 0; i < this->m_childs.size(); i++)\n        {\n            if(this->m_childs[i] == pNode)\n                return (int)i;\n        }\n        return -1;\n    }\n\n    void addChild(Node<OBJECT> *pNode)\n    {\n        if(!pNode)\n            return;\n\n        CV_Assert(pNode->m_pParent == 0);\n        pNode->m_pParent = this;\n        this->m_childs.push_back(pNode);\n    }\n\n    void removeChilds()\n    {\n        for(size_t i = 0; i < m_childs.size(); i++)\n        {\n            m_childs[i]->m_pParent = 0; // avoid excessive parent vector trimming\n            delete m_childs[i];\n        }\n        m_childs.clear();\n    }\n\n    int getDepth()\n    {\n        int   count   = 0;\n        Node *pParent = m_pParent;\n        while(pParent) count++, pParent = pParent->m_pParent;\n        return count;\n    }\n\npublic:\n    OBJECT                     m_payload;\n    Node<OBJECT>*              m_pParent;\n    std::vector<Node<OBJECT>*> m_childs;\n};\n\n\nnamespace samples {\n\n//! @addtogroup core_utils_samples\n// This section describes utility functions for OpenCV samples.\n//\n// @note Implementation of these utilities is not thread-safe.\n//\n//! @{\n\n/** @brief Try to find requested data file\n\nSearch directories:\n\n1. Directories passed via `addSamplesDataSearchPath()`\n2. OPENCV_SAMPLES_DATA_PATH_HINT environment variable\n3. OPENCV_SAMPLES_DATA_PATH environment variable\n   If parameter value is not empty and nothing is found then stop searching.\n4. Detects build/install path based on:\n   a. current working directory (CWD)\n   b. and/or binary module location (opencv_core/opencv_world, doesn't work with static linkage)\n5. Scan `<source>/{,data,samples/data}` directories if build directory is detected or the current directory is in source tree.\n6. Scan `<install>/share/OpenCV` directory if install directory is detected.\n\n@see cv::utils::findDataFile\n\n@param relative_path Relative path to data file\n@param required Specify \"file not found\" handling.\n       If true, function prints information message and raises cv::Exception.\n       If false, function returns empty result\n@param silentMode Disables messages\n@return Returns path (absolute or relative to the current directory) or empty string if file is not found\n*/\nCV_EXPORTS_W cv::String findFile(const cv::String& relative_path, bool required = true, bool silentMode = false);\n\nCV_EXPORTS_W cv::String findFileOrKeep(const cv::String& relative_path, bool silentMode = false);\n\ninline cv::String findFileOrKeep(const cv::String& relative_path, bool silentMode)\n{\n    cv::String res = findFile(relative_path, false, silentMode);\n    if (res.empty())\n        return relative_path;\n    return res;\n}\n\n/** @brief Override search data path by adding new search location\n\nUse this only to override default behavior\nPassed paths are used in LIFO order.\n\n@param path Path to used samples data\n*/\nCV_EXPORTS_W void addSamplesDataSearchPath(const cv::String& path);\n\n/** @brief Append samples search data sub directory\n\nGeneral usage is to add OpenCV modules name (`<opencv_contrib>/modules/<name>/samples/data` -> `<name>/samples/data` + `modules/<name>/samples/data`).\nPassed subdirectories are used in LIFO order.\n\n@param subdir samples data sub directory\n*/\nCV_EXPORTS_W void addSamplesDataSearchSubDirectory(const cv::String& subdir);\n\n//! @}\n} // namespace samples\n\nnamespace utils {\n\nCV_EXPORTS int getThreadID();\n\n} // namespace\n\n} //namespace cv\n\n#ifdef CV_COLLECT_IMPL_DATA\n#include \"opencv2/core/utils/instrumentation.hpp\"\n#else\n/// Collect implementation data on OpenCV function call. Requires ENABLE_IMPL_COLLECTION build option.\n#define CV_IMPL_ADD(impl)\n#endif\n\n#endif //OPENCV_CORE_UTILITY_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utils/allocator_stats.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_ALLOCATOR_STATS_HPP\n#define OPENCV_CORE_ALLOCATOR_STATS_HPP\n\n#include \"../cvdef.h\"\n\nnamespace cv { namespace utils {\n\nclass AllocatorStatisticsInterface\n{\nprotected:\n    AllocatorStatisticsInterface() {}\n    virtual ~AllocatorStatisticsInterface() {}\npublic:\n    virtual uint64_t getCurrentUsage() const = 0;\n    virtual uint64_t getTotalUsage() const = 0;\n    virtual uint64_t getNumberOfAllocations() const = 0;\n    virtual uint64_t getPeakUsage() const = 0;\n\n    /** set peak usage = current usage */\n    virtual void resetPeakUsage() = 0;\n};\n\n}} // namespace\n\n#endif // OPENCV_CORE_ALLOCATOR_STATS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utils/allocator_stats.impl.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_ALLOCATOR_STATS_IMPL_HPP\n#define OPENCV_CORE_ALLOCATOR_STATS_IMPL_HPP\n\n#include \"./allocator_stats.hpp\"\n\n//#define OPENCV_DISABLE_ALLOCATOR_STATS\n\n#ifdef CV_CXX11\n\n#include <atomic>\n\n#ifndef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE\n#if defined(__GNUC__) && (\\\n        (defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4) || \\\n        (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)) \\\n    )\n#define OPENCV_ALLOCATOR_STATS_COUNTER_TYPE int\n#endif\n#endif\n\n#ifndef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE\n#define OPENCV_ALLOCATOR_STATS_COUNTER_TYPE long long\n#endif\n\n#else  // CV_CXX11\n\n#ifndef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE\n#define OPENCV_ALLOCATOR_STATS_COUNTER_TYPE int  // CV_XADD supports int only\n#endif\n\n#endif  // CV_CXX11\n\nnamespace cv { namespace utils {\n\n#ifdef CV__ALLOCATOR_STATS_LOG\nnamespace {\n#endif\n\nclass AllocatorStatistics : public AllocatorStatisticsInterface\n{\n#ifdef OPENCV_DISABLE_ALLOCATOR_STATS\n\npublic:\n    AllocatorStatistics() {}\n    ~AllocatorStatistics() CV_OVERRIDE {}\n\n    uint64_t getCurrentUsage() const CV_OVERRIDE { return 0; }\n    uint64_t getTotalUsage() const CV_OVERRIDE { return 0; }\n    uint64_t getNumberOfAllocations() const CV_OVERRIDE { return 0; }\n    uint64_t getPeakUsage() const CV_OVERRIDE { return 0; }\n\n    /** set peak usage = current usage */\n    void resetPeakUsage() CV_OVERRIDE {};\n\n    void onAllocate(size_t /*sz*/) {}\n    void onFree(size_t /*sz*/) {}\n\n#elif defined(CV_CXX11)\n\nprotected:\n    typedef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE counter_t;\n    std::atomic<counter_t> curr, total, total_allocs, peak;\npublic:\n    AllocatorStatistics() {}\n    ~AllocatorStatistics() CV_OVERRIDE {}\n\n    uint64_t getCurrentUsage() const CV_OVERRIDE { return (uint64_t)curr.load(); }\n    uint64_t getTotalUsage() const CV_OVERRIDE { return (uint64_t)total.load(); }\n    uint64_t getNumberOfAllocations() const CV_OVERRIDE { return (uint64_t)total_allocs.load(); }\n    uint64_t getPeakUsage() const CV_OVERRIDE { return (uint64_t)peak.load(); }\n\n    /** set peak usage = current usage */\n    void resetPeakUsage() CV_OVERRIDE { peak.store(curr.load()); }\n\n    // Controller interface\n    void onAllocate(size_t sz)\n    {\n#ifdef CV__ALLOCATOR_STATS_LOG\n        CV__ALLOCATOR_STATS_LOG(cv::format(\"allocate: %lld (curr=%lld)\", (long long int)sz, (long long int)curr.load()));\n#endif\n\n        counter_t new_curr = curr.fetch_add((counter_t)sz) + (counter_t)sz;\n\n        // peak = std::max((uint64_t)peak, new_curr);\n        auto prev_peak = peak.load();\n        while (prev_peak < new_curr)\n        {\n            if (peak.compare_exchange_weak(prev_peak, new_curr))\n                break;\n        }\n        // end of peak = max(...)\n\n        total += (counter_t)sz;\n        total_allocs++;\n    }\n    void onFree(size_t sz)\n    {\n#ifdef CV__ALLOCATOR_STATS_LOG\n        CV__ALLOCATOR_STATS_LOG(cv::format(\"free: %lld (curr=%lld)\", (long long int)sz, (long long int)curr.load()));\n#endif\n        curr -= (counter_t)sz;\n    }\n\n#else  // non C++11\n\nprotected:\n    typedef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE counter_t;\n    volatile counter_t curr, total, total_allocs, peak;  // overflow is possible, CV_XADD operates with 'int' only\npublic:\n    AllocatorStatistics()\n        : curr(0), total(0), total_allocs(0), peak(0)\n    {}\n    ~AllocatorStatistics() CV_OVERRIDE {}\n\n    uint64_t getCurrentUsage() const CV_OVERRIDE { return (uint64_t)curr; }\n    uint64_t getTotalUsage() const CV_OVERRIDE { return (uint64_t)total; }\n    uint64_t getNumberOfAllocations() const CV_OVERRIDE { return (uint64_t)total_allocs; }\n    uint64_t getPeakUsage() const CV_OVERRIDE { return (uint64_t)peak; }\n\n    void resetPeakUsage() CV_OVERRIDE { peak = curr; }\n\n    // Controller interface\n    void onAllocate(size_t sz)\n    {\n#ifdef CV__ALLOCATOR_STATS_LOG\n        CV__ALLOCATOR_STATS_LOG(cv::format(\"allocate: %lld (curr=%lld)\", (long long int)sz, (long long int)curr));\n#endif\n\n        counter_t new_curr = (counter_t)CV_XADD(&curr, (counter_t)sz) + (counter_t)sz;\n\n        peak = std::max((counter_t)peak, new_curr);  // non-thread safe\n\n        //CV_XADD(&total, (uint64_t)sz);  // overflow with int, non-reliable...\n        total += sz;\n\n        CV_XADD(&total_allocs, (counter_t)1);\n    }\n    void onFree(size_t sz)\n    {\n#ifdef CV__ALLOCATOR_STATS_LOG\n        CV__ALLOCATOR_STATS_LOG(cv::format(\"free: %lld (curr=%lld)\", (long long int)sz, (long long int)curr));\n#endif\n        CV_XADD(&curr, (counter_t)-sz);\n    }\n#endif\n};\n\n#ifdef CV__ALLOCATOR_STATS_LOG\n} // namespace\n#endif\n\n}} // namespace\n\n#endif // OPENCV_CORE_ALLOCATOR_STATS_IMPL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utils/filesystem.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_UTILS_FILESYSTEM_HPP\n#define OPENCV_UTILS_FILESYSTEM_HPP\n\nnamespace cv { namespace utils { namespace fs {\n\n\nCV_EXPORTS bool exists(const cv::String& path);\nCV_EXPORTS bool isDirectory(const cv::String& path);\n\nCV_EXPORTS void remove_all(const cv::String& path);\n\n\nCV_EXPORTS cv::String getcwd();\n\n/** @brief Converts path p to a canonical absolute path\n * Symlinks are processed if there is support for them on running platform.\n *\n * @param path input path. Target file/directory should exist.\n */\nCV_EXPORTS cv::String canonical(const cv::String& path);\n\n/** Join path components */\nCV_EXPORTS cv::String join(const cv::String& base, const cv::String& path);\n\n/** Get parent directory */\nCV_EXPORTS cv::String getParent(const cv::String &path);\nCV_EXPORTS std::wstring getParent(const std::wstring& path);\n\n/**\n * Generate a list of all files that match the globbing pattern.\n *\n * Result entries are prefixed by base directory path.\n *\n * @param directory base directory\n * @param pattern filter pattern (based on '*'/'?' symbols). Use empty string to disable filtering and return all results\n * @param[out] result result of globing.\n * @param recursive scan nested directories too\n * @param includeDirectories include directories into results list\n */\nCV_EXPORTS void glob(const cv::String& directory, const cv::String& pattern,\n        CV_OUT std::vector<cv::String>& result,\n        bool recursive = false, bool includeDirectories = false);\n\n/**\n * Generate a list of all files that match the globbing pattern.\n *\n * @param directory base directory\n * @param pattern filter pattern (based on '*'/'?' symbols). Use empty string to disable filtering and return all results\n * @param[out] result globbing result with relative paths from base directory\n * @param recursive scan nested directories too\n * @param includeDirectories include directories into results list\n */\nCV_EXPORTS void glob_relative(const cv::String& directory, const cv::String& pattern,\n        CV_OUT std::vector<cv::String>& result,\n        bool recursive = false, bool includeDirectories = false);\n\n\nCV_EXPORTS bool createDirectory(const cv::String& path);\nCV_EXPORTS bool createDirectories(const cv::String& path);\n\n#ifdef __OPENCV_BUILD\n// TODO\n//CV_EXPORTS cv::String getTempDirectory();\n\n/**\n * @brief Returns directory to store OpenCV cache files\n * Create sub-directory in common OpenCV cache directory if it doesn't exist.\n * @param sub_directory_name name of sub-directory. NULL or \"\" value asks to return root cache directory.\n * @param configuration_name optional name of configuration parameter name which overrides default behavior.\n * @return Path to cache directory. Returns empty string if cache directories support is not available. Returns \"disabled\" if cache disabled by user.\n */\nCV_EXPORTS cv::String getCacheDirectory(const char* sub_directory_name, const char* configuration_name = NULL);\n\n#endif\n\n}}} // namespace\n\n#endif // OPENCV_UTILS_FILESYSTEM_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utils/instrumentation.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_UTILS_INSTR_HPP\n#define OPENCV_UTILS_INSTR_HPP\n\n#include <opencv2/core/utility.hpp>\n#include <opencv2/core/utils/tls.hpp>\n\nnamespace cv {\n\n//! @addtogroup core_utils\n//! @{\n\n#ifdef CV_COLLECT_IMPL_DATA\nCV_EXPORTS void setImpl(int flags); // set implementation flags and reset storage arrays\nCV_EXPORTS void addImpl(int flag, const char* func = 0); // add implementation and function name to storage arrays\n// Get stored implementation flags and functions names arrays\n// Each implementation entry correspond to function name entry, so you can find which implementation was executed in which function\nCV_EXPORTS int getImpl(std::vector<int> &impl, std::vector<String> &funName);\n\nCV_EXPORTS bool useCollection(); // return implementation collection state\nCV_EXPORTS void setUseCollection(bool flag); // set implementation collection state\n\n#define CV_IMPL_PLAIN  0x01 // native CPU OpenCV implementation\n#define CV_IMPL_OCL    0x02 // OpenCL implementation\n#define CV_IMPL_IPP    0x04 // IPP implementation\n#define CV_IMPL_MT     0x10 // multithreaded implementation\n\n#undef CV_IMPL_ADD\n#define CV_IMPL_ADD(impl)                                                   \\\n    if(cv::useCollection())                                                 \\\n    {                                                                       \\\n        cv::addImpl(impl, CV_Func);                                         \\\n    }\n#endif\n\n// Instrumentation external interface\nnamespace instr\n{\n\n#if !defined OPENCV_ABI_CHECK\n\nenum TYPE\n{\n    TYPE_GENERAL = 0,   // OpenCV API function, e.g. exported function\n    TYPE_MARKER,        // Information marker\n    TYPE_WRAPPER,       // Wrapper function for implementation\n    TYPE_FUN,           // Simple function call\n};\n\nenum IMPL\n{\n    IMPL_PLAIN = 0,\n    IMPL_IPP,\n    IMPL_OPENCL,\n};\n\nstruct NodeDataTls\n{\n    NodeDataTls()\n    {\n        m_ticksTotal = 0;\n    }\n    uint64      m_ticksTotal;\n};\n\nclass CV_EXPORTS NodeData\n{\npublic:\n    NodeData(const char* funName = 0, const char* fileName = NULL, int lineNum = 0, void* retAddress = NULL, bool alwaysExpand = false, cv::instr::TYPE instrType = TYPE_GENERAL, cv::instr::IMPL implType = IMPL_PLAIN);\n    NodeData(NodeData &ref);\n    ~NodeData();\n    NodeData& operator=(const NodeData&);\n\n    cv::String          m_funName;\n    cv::instr::TYPE     m_instrType;\n    cv::instr::IMPL     m_implType;\n    const char*         m_fileName;\n    int                 m_lineNum;\n    void*               m_retAddress;\n    bool                m_alwaysExpand;\n    bool                m_funError;\n\n    volatile int         m_counter;\n    volatile uint64      m_ticksTotal;\n    TLSDataAccumulator<NodeDataTls> m_tls;\n    int                  m_threads;\n\n    // No synchronization\n    double getTotalMs()   const { return ((double)m_ticksTotal / cv::getTickFrequency()) * 1000; }\n    double getMeanMs()    const { return (((double)m_ticksTotal/m_counter) / cv::getTickFrequency()) * 1000; }\n};\nbool operator==(const NodeData& lhs, const NodeData& rhs);\n\ntypedef Node<NodeData> InstrNode;\n\nCV_EXPORTS InstrNode* getTrace();\n\n#endif // !defined OPENCV_ABI_CHECK\n\n\nCV_EXPORTS bool       useInstrumentation();\nCV_EXPORTS void       setUseInstrumentation(bool flag);\nCV_EXPORTS void       resetTrace();\n\nenum FLAGS\n{\n    FLAGS_NONE              = 0,\n    FLAGS_MAPPING           = 0x01,\n    FLAGS_EXPAND_SAME_NAMES = 0x02,\n};\n\nCV_EXPORTS void       setFlags(FLAGS modeFlags);\nstatic inline void    setFlags(int modeFlags) { setFlags((FLAGS)modeFlags); }\nCV_EXPORTS FLAGS      getFlags();\n\n} // namespace instr\n\n//! @}\n\n} // namespace\n\n#endif // OPENCV_UTILS_TLS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utils/logger.defines.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_LOGGER_DEFINES_HPP\n#define OPENCV_LOGGER_DEFINES_HPP\n\n//! @addtogroup core_logging\n//! @{\n\n// Supported logging levels and their semantic\n#define CV_LOG_LEVEL_SILENT 0          //!< for using in setLogLevel() call\n#define CV_LOG_LEVEL_FATAL 1           //!< Fatal (critical) error (unrecoverable internal error)\n#define CV_LOG_LEVEL_ERROR 2           //!< Error message\n#define CV_LOG_LEVEL_WARN 3            //!< Warning message\n#define CV_LOG_LEVEL_INFO 4            //!< Info message\n#define CV_LOG_LEVEL_DEBUG 5           //!< Debug message. Disabled in the \"Release\" build.\n#define CV_LOG_LEVEL_VERBOSE 6         //!< Verbose (trace) messages. Requires verbosity level. Disabled in the \"Release\" build.\n\nnamespace cv {\nnamespace utils {\nnamespace logging {\n\n//! Supported logging levels and their semantic\nenum LogLevel {\n    LOG_LEVEL_SILENT = 0,              //!< for using in setLogVevel() call\n    LOG_LEVEL_FATAL = 1,               //!< Fatal (critical) error (unrecoverable internal error)\n    LOG_LEVEL_ERROR = 2,               //!< Error message\n    LOG_LEVEL_WARNING = 3,             //!< Warning message\n    LOG_LEVEL_INFO = 4,                //!< Info message\n    LOG_LEVEL_DEBUG = 5,               //!< Debug message. Disabled in the \"Release\" build.\n    LOG_LEVEL_VERBOSE = 6,             //!< Verbose (trace) messages. Requires verbosity level. Disabled in the \"Release\" build.\n#ifndef CV_DOXYGEN\n    ENUM_LOG_LEVEL_FORCE_INT = INT_MAX\n#endif\n};\n\n}}} // namespace\n\n//! @}\n\n#endif // OPENCV_LOGGER_DEFINES_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utils/logger.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_LOGGER_HPP\n#define OPENCV_LOGGER_HPP\n\n#include <iostream>\n#include <sstream>\n#include <limits.h> // INT_MAX\n\n#include \"logger.defines.hpp\"\n#include \"logtag.hpp\"\n\nnamespace cv {\nnamespace utils {\nnamespace logging {\n\n//! @addtogroup core_logging\n//! @{\n\n/** Set global logging level\n@return previous logging level\n*/\nCV_EXPORTS LogLevel setLogLevel(LogLevel logLevel);\n/** Get global logging level */\nCV_EXPORTS LogLevel getLogLevel();\n\nCV_EXPORTS void registerLogTag(cv::utils::logging::LogTag* plogtag);\n\nCV_EXPORTS void setLogTagLevel(const char* tag, cv::utils::logging::LogLevel level);\n\nCV_EXPORTS cv::utils::logging::LogLevel getLogTagLevel(const char* tag);\n\nnamespace internal {\n\n/** Get global log tag */\nCV_EXPORTS cv::utils::logging::LogTag* getGlobalLogTag();\n\n/** Write log message */\nCV_EXPORTS void writeLogMessage(LogLevel logLevel, const char* message);\n\n/** Write log message */\nCV_EXPORTS void writeLogMessageEx(LogLevel logLevel, const char* tag, const char* file, int line, const char* func, const char* message);\n\n} // namespace\n\nstruct LogTagAuto\n    : public LogTag\n{\n    inline LogTagAuto(const char* _name, LogLevel _level)\n        : LogTag(_name, _level)\n    {\n        registerLogTag(this);\n    }\n};\n\n/**\n * \\def CV_LOG_STRIP_LEVEL\n *\n * Define CV_LOG_STRIP_LEVEL=CV_LOG_LEVEL_[DEBUG|INFO|WARN|ERROR|FATAL|SILENT] to compile out anything at that and before that logging level\n */\n#ifndef CV_LOG_STRIP_LEVEL\n# if defined NDEBUG\n#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG\n# else\n#   define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_VERBOSE\n# endif\n#endif\n\n#define CV_LOGTAG_PTR_CAST(expr) static_cast<const cv::utils::logging::LogTag*>(expr)\n\n// CV_LOGTAG_EXPAND_NAME is intended to be re-defined (undef and then define again)\n// to allows logging users to use a shorter name argument when calling\n// CV_LOG_WITH_TAG or its related macros such as CV_LOG_INFO.\n//\n// This macro is intended to modify the tag argument as a string (token), via\n// preprocessor token pasting or metaprogramming techniques. A typical usage\n// is to apply a prefix, such as\n// ...... #define CV_LOGTAG_EXPAND_NAME(tag) cv_logtag_##tag\n//\n// It is permitted to re-define to a hard-coded expression, ignoring the tag.\n// This would work identically like the CV_LOGTAG_FALLBACK macro.\n//\n// Important: When the logging macro is called with tag being NULL, a user-defined\n// CV_LOGTAG_EXPAND_NAME may expand it into cv_logtag_0, cv_logtag_NULL, or\n// cv_logtag_nullptr. Use with care. Also be mindful of C++ symbol redefinitions.\n//\n// If there is significant amount of logging code with tag being NULL, it is\n// recommended to use (re-define) CV_LOGTAG_FALLBACK to inject locally a default\n// tag at the beginning of a compilation unit, to minimize lines of code changes.\n//\n#define CV_LOGTAG_EXPAND_NAME(tag) tag\n\n// CV_LOGTAG_FALLBACK is intended to be re-defined (undef and then define again)\n// by any other compilation units to provide a log tag when the logging statement\n// does not specify one. The macro needs to expand into a C++ expression that can\n// be static_cast into (cv::utils::logging::LogTag*). Null (nullptr) is permitted.\n#define CV_LOGTAG_FALLBACK nullptr\n\n// CV_LOGTAG_GLOBAL is the tag used when a log tag is not specified in the logging\n// statement nor the compilation unit. The macro needs to expand into a C++\n// expression that can be static_cast into (cv::utils::logging::LogTag*). Must be\n// non-null. Do not re-define.\n#define CV_LOGTAG_GLOBAL cv::utils::logging::internal::getGlobalLogTag()\n\n#define CV_LOG_WITH_TAG(tag, msgLevel, extra_check0, extra_check1, ...) \\\n    for(;;) { \\\n        extra_check0; \\\n        const auto cv_temp_msglevel = (cv::utils::logging::LogLevel)(msgLevel); \\\n        if (cv_temp_msglevel >= (CV_LOG_STRIP_LEVEL)) break; \\\n        auto cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_EXPAND_NAME(tag)); \\\n        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_FALLBACK); \\\n        if (!cv_temp_logtagptr) cv_temp_logtagptr = CV_LOGTAG_PTR_CAST(CV_LOGTAG_GLOBAL); \\\n        if (cv_temp_logtagptr && (cv_temp_msglevel > cv_temp_logtagptr->level)) break; \\\n        extra_check1; \\\n        std::stringstream cv_temp_logstream; \\\n        cv_temp_logstream << __VA_ARGS__; \\\n        cv::utils::logging::internal::writeLogMessageEx( \\\n            cv_temp_msglevel, \\\n            (cv_temp_logtagptr ? cv_temp_logtagptr->name : nullptr), \\\n            __FILE__, \\\n            __LINE__, \\\n            CV_Func, \\\n            cv_temp_logstream.str().c_str()); \\\n        break; \\\n    }\n\n#define CV_LOG_FATAL(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_FATAL, , , __VA_ARGS__)\n#define CV_LOG_ERROR(tag, ...)   CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, , , __VA_ARGS__)\n#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , __VA_ARGS__)\n#define CV_LOG_INFO(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, , , __VA_ARGS__)\n#define CV_LOG_DEBUG(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_DEBUG, , , __VA_ARGS__)\n#define CV_LOG_VERBOSE(tag, v, ...) CV_LOG_WITH_TAG(tag, (cv::utils::logging::LOG_LEVEL_VERBOSE + (int)(v)), , , __VA_ARGS__)\n\n#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_INFO\n#undef CV_LOG_INFO\n#define CV_LOG_INFO(tag, ...)\n#endif\n\n#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_DEBUG\n#undef CV_LOG_DEBUG\n#define CV_LOG_DEBUG(tag, ...)\n#endif\n\n#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_VERBOSE\n#undef CV_LOG_VERBOSE\n#define CV_LOG_VERBOSE(tag, v, ...)\n#endif\n\n//! @cond IGNORED\n#define CV__LOG_ONCE_CHECK_PRE \\\n    static bool _cv_log_once_ ## __LINE__ = false; \\\n    if (_cv_log_once_ ## __LINE__) break;\n\n#define CV__LOG_ONCE_CHECK_POST \\\n    _cv_log_once_ ## __LINE__ = true;\n\n#define CV__LOG_IF_CHECK(logging_cond) \\\n    if (!(logging_cond)) break;\n\n//! @endcond\n\n\n// CV_LOG_ONCE_XXX macros\n\n#define CV_LOG_ONCE_ERROR(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, __VA_ARGS__)\n#define CV_LOG_ONCE_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, __VA_ARGS__)\n#define CV_LOG_ONCE_INFO(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, __VA_ARGS__)\n#define CV_LOG_ONCE_DEBUG(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_DEBUG, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, __VA_ARGS__)\n#define CV_LOG_ONCE_VERBOSE(tag, v, ...) CV_LOG_WITH_TAG(tag, (cv::utils::logging::LOG_LEVEL_VERBOSE + (int)(v)), CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, __VA_ARGS__)\n\n#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_INFO\n#undef CV_LOG_ONCE_INFO\n#define CV_LOG_ONCE_INFO(tag, ...)\n#endif\n\n#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_DEBUG\n#undef CV_LOG_ONCE_DEBUG\n#define CV_LOG_ONCE_DEBUG(tag, ...)\n#endif\n\n#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_VERBOSE\n#undef CV_LOG_ONCE_VERBOSE\n#define CV_LOG_ONCE_VERBOSE(tag, v, ...)\n#endif\n\n\n// CV_LOG_IF_XXX macros\n\n#define CV_LOG_IF_FATAL(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_FATAL, , CV__LOG_IF_CHECK(logging_cond), __VA_ARGS__)\n#define CV_LOG_IF_ERROR(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, , CV__LOG_IF_CHECK(logging_cond), __VA_ARGS__)\n#define CV_LOG_IF_WARNING(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , CV__LOG_IF_CHECK(logging_cond), __VA_ARGS__)\n#define CV_LOG_IF_INFO(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, , CV__LOG_IF_CHECK(logging_cond), __VA_ARGS__)\n#define CV_LOG_IF_DEBUG(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_DEBUG, , CV__LOG_IF_CHECK(logging_cond), __VA_ARGS__)\n#define CV_LOG_IF_VERBOSE(tag, v, logging_cond, ...) CV_LOG_WITH_TAG(tag, (cv::utils::logging::LOG_LEVEL_VERBOSE + (int)(v)), , CV__LOG_IF_CHECK(logging_cond), __VA_ARGS__)\n\n#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_INFO\n#undef CV_LOG_IF_INFO\n#define CV_LOG_IF_INFO(tag, logging_cond, ...)\n#endif\n\n#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_DEBUG\n#undef CV_LOG_IF_DEBUG\n#define CV_LOG_IF_DEBUG(tag, logging_cond, ...)\n#endif\n\n#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_VERBOSE\n#undef CV_LOG_IF_VERBOSE\n#define CV_LOG_IF_VERBOSE(tag, v, logging_cond, ...)\n#endif\n\n\n//! @}\n\n}}} // namespace\n\n#endif // OPENCV_LOGGER_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utils/logtag.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_CORE_LOGTAG_HPP\n#define OPENCV_CORE_LOGTAG_HPP\n\n#include \"opencv2/core/cvstd.hpp\"\n#include \"logger.defines.hpp\"\n\nnamespace cv {\nnamespace utils {\nnamespace logging {\n\nstruct LogTag\n{\n    const char* name;\n    LogLevel level;\n\n    inline LogTag(const char* _name, LogLevel _level)\n        : name(_name)\n        , level(_level)\n    {}\n};\n\n}}}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utils/tls.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_UTILS_TLS_HPP\n#define OPENCV_UTILS_TLS_HPP\n\n#ifndef OPENCV_CORE_UTILITY_H\n#error \"tls.hpp must be included after opencv2/core/utility.hpp or opencv2/core.hpp\"\n#endif\n\nnamespace cv {\n\n//! @addtogroup core_utils\n//! @{\n\nnamespace details { class TlsStorage; }\n\n/** TLS container base implementation\n *\n * Don't use directly.\n *\n * @sa TLSData, TLSDataAccumulator templates\n */\nclass CV_EXPORTS TLSDataContainer\n{\nprotected:\n    TLSDataContainer();\n    virtual ~TLSDataContainer();\n\n    /// @deprecated use detachData() instead\n    void  gatherData(std::vector<void*> &data) const;\n    /// get TLS data and detach all data from threads (similar to cleanup() call)\n    void  detachData(std::vector<void*>& data);\n\n    void* getData() const;\n    void  release();\n\nprotected:\n    virtual void* createDataInstance() const = 0;\n    virtual void  deleteDataInstance(void* pData) const = 0;\n\nprivate:\n    int key_;\n\n    friend class cv::details::TlsStorage;  // core/src/system.cpp\n\npublic:\n    void cleanup(); //!< Release created TLS data container objects. It is similar to release() call, but it keeps TLS container valid.\n\nprivate:\n    // Disable copy/assign (noncopyable pattern)\n    TLSDataContainer(TLSDataContainer &) = delete;\n    TLSDataContainer& operator =(const TLSDataContainer &) = delete;\n};\n\n\n/** @brief Simple TLS data class\n *\n * @sa TLSDataAccumulator\n */\ntemplate <typename T>\nclass TLSData : protected TLSDataContainer\n{\npublic:\n    inline TLSData() {}\n    inline ~TLSData() { release(); }\n\n    inline T* get() const   { return (T*)getData(); }  //!< Get data associated with key\n    inline T& getRef() const { T* ptr = (T*)getData(); CV_DbgAssert(ptr); return *ptr; }  //!< Get data associated with key\n\n    /// Release associated thread data\n    inline void cleanup()\n    {\n        TLSDataContainer::cleanup();\n    }\n\nprotected:\n    /// Wrapper to allocate data by template\n    virtual void* createDataInstance() const CV_OVERRIDE { return new T; }\n    /// Wrapper to release data by template\n    virtual void  deleteDataInstance(void* pData) const CV_OVERRIDE { delete (T*)pData; }\n};\n\n\n/// TLS data accumulator with gathering methods\ntemplate <typename T>\nclass TLSDataAccumulator : public TLSData<T>\n{\n    mutable cv::Mutex mutex;\n    mutable std::vector<T*> dataFromTerminatedThreads;\n    std::vector<T*> detachedData;\n    bool cleanupMode;\npublic:\n    TLSDataAccumulator() : cleanupMode(false) {}\n    ~TLSDataAccumulator()\n    {\n        release();\n    }\n\n    /** @brief Get data from all threads\n     * @deprecated replaced by detachData()\n     *\n     * Lifetime of vector data is valid until next detachData()/cleanup()/release() calls\n     *\n     * @param[out] data result buffer (should be empty)\n     */\n    void gather(std::vector<T*> &data) const\n    {\n        CV_Assert(cleanupMode == false);  // state is not valid\n        CV_Assert(data.empty());\n        {\n            std::vector<void*> &dataVoid = reinterpret_cast<std::vector<void*>&>(data);\n            TLSDataContainer::gatherData(dataVoid);\n        }\n        {\n            AutoLock lock(mutex);\n            data.reserve(data.size() + dataFromTerminatedThreads.size());\n            for (typename std::vector<T*>::const_iterator i = dataFromTerminatedThreads.begin(); i != dataFromTerminatedThreads.end(); ++i)\n            {\n                data.push_back((T*)*i);\n            }\n        }\n    }\n\n    /** @brief Get and detach data from all threads\n     *\n     * Call cleanupDetachedData() when returned vector is not needed anymore.\n     *\n     * @return Vector with associated data. Content is preserved (including lifetime of attached data pointers) until next detachData()/cleanupDetachedData()/cleanup()/release() calls\n     */\n    std::vector<T*>& detachData()\n    {\n        CV_Assert(cleanupMode == false);  // state is not valid\n        std::vector<void*> dataVoid;\n        {\n            TLSDataContainer::detachData(dataVoid);\n        }\n        {\n            AutoLock lock(mutex);\n            detachedData.reserve(dataVoid.size() + dataFromTerminatedThreads.size());\n            for (typename std::vector<T*>::const_iterator i = dataFromTerminatedThreads.begin(); i != dataFromTerminatedThreads.end(); ++i)\n            {\n                detachedData.push_back((T*)*i);\n            }\n            dataFromTerminatedThreads.clear();\n            for (typename std::vector<void*>::const_iterator i = dataVoid.begin(); i != dataVoid.end(); ++i)\n            {\n                detachedData.push_back((T*)(void*)*i);\n            }\n        }\n        dataVoid.clear();\n        return detachedData;\n    }\n\n    /// Release associated thread data returned by detachData() call\n    void cleanupDetachedData()\n    {\n        AutoLock lock(mutex);\n        cleanupMode = true;\n        _cleanupDetachedData();\n        cleanupMode = false;\n    }\n\n    /// Release associated thread data\n    void cleanup()\n    {\n        cleanupMode = true;\n        TLSDataContainer::cleanup();\n\n        AutoLock lock(mutex);\n        _cleanupDetachedData();\n        _cleanupTerminatedData();\n        cleanupMode = false;\n    }\n\n    /// Release associated thread data and free TLS key\n    void release()\n    {\n        cleanupMode = true;\n        TLSDataContainer::release();\n        {\n            AutoLock lock(mutex);\n            _cleanupDetachedData();\n            _cleanupTerminatedData();\n        }\n    }\n\nprotected:\n    // synchronized\n    void _cleanupDetachedData()\n    {\n        for (typename std::vector<T*>::iterator i = detachedData.begin(); i != detachedData.end(); ++i)\n        {\n            deleteDataInstance((T*)*i);\n        }\n        detachedData.clear();\n    }\n\n    // synchronized\n    void _cleanupTerminatedData()\n    {\n        for (typename std::vector<T*>::iterator i = dataFromTerminatedThreads.begin(); i != dataFromTerminatedThreads.end(); ++i)\n        {\n            deleteDataInstance((T*)*i);\n        }\n        dataFromTerminatedThreads.clear();\n    }\n\nprotected:\n    virtual void* createDataInstance() const CV_OVERRIDE\n    {\n        // Note: we can collect all allocated data here, but this would require raced mutex locks\n        return new T;\n    }\n    virtual void  deleteDataInstance(void* pData) const CV_OVERRIDE\n    {\n        if (cleanupMode)\n        {\n            delete (T*)pData;\n        }\n        else\n        {\n            AutoLock lock(mutex);\n            dataFromTerminatedThreads.push_back((T*)pData);\n        }\n    }\n};\n\n\n//! @}\n\n} // namespace\n\n#endif // OPENCV_UTILS_TLS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/utils/trace.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_TRACE_HPP\n#define OPENCV_TRACE_HPP\n\n#include <opencv2/core/cvdef.h>\n\nnamespace cv {\nnamespace utils {\nnamespace trace {\n\n//! @addtogroup core_logging\n//! @{\n\n//! Macro to trace function\n#define CV_TRACE_FUNCTION()\n\n#define CV_TRACE_FUNCTION_SKIP_NESTED()\n\n//! Trace code scope.\n//! @note Dynamic names are not supported in this macro (on stack or heap). Use string literals here only, like \"initialize\".\n#define CV_TRACE_REGION(name_as_static_string_literal)\n//! mark completed of the current opened region and create new one\n//! @note Dynamic names are not supported in this macro (on stack or heap). Use string literals here only, like \"step1\".\n#define CV_TRACE_REGION_NEXT(name_as_static_string_literal)\n\n//! Macro to trace argument value\n#define CV_TRACE_ARG(arg_id)\n\n//! Macro to trace argument value (expanded version)\n#define CV_TRACE_ARG_VALUE(arg_id, arg_name, value)\n\n//! @cond IGNORED\n#define CV_TRACE_NS cv::utils::trace\n\n#if !defined(OPENCV_DISABLE_TRACE) && defined(__EMSCRIPTEN__)\n#define OPENCV_DISABLE_TRACE 1\n#endif\n\nnamespace details {\n\n#ifndef __OPENCV_TRACE\n# if defined __OPENCV_BUILD && !defined __OPENCV_TESTS && !defined __OPENCV_APPS\n#   define __OPENCV_TRACE 1\n# else\n#   define __OPENCV_TRACE 0\n# endif\n#endif\n\n#ifndef CV_TRACE_FILENAME\n# define CV_TRACE_FILENAME __FILE__\n#endif\n\n#ifndef CV__TRACE_FUNCTION\n# if defined _MSC_VER\n#   define CV__TRACE_FUNCTION __FUNCSIG__\n# elif defined __GNUC__\n#   define CV__TRACE_FUNCTION __PRETTY_FUNCTION__\n# else\n#   define CV__TRACE_FUNCTION \"<unknown>\"\n# endif\n#endif\n\n//! Thread-local instance (usually allocated on stack)\nclass CV_EXPORTS Region\n{\npublic:\n    struct LocationExtraData;\n    struct LocationStaticStorage\n    {\n        LocationExtraData** ppExtra;   //< implementation specific data\n        const char* name;              //< region name (function name or other custom name)\n        const char* filename;          //< source code filename\n        int line;                      //< source code line\n        int flags;                     //< flags (implementation code path: Plain, IPP, OpenCL)\n    };\n\n    Region(const LocationStaticStorage& location);\n    inline ~Region()\n    {\n        if (implFlags != 0)\n            destroy();\n        CV_DbgAssert(implFlags == 0);\n        CV_DbgAssert(pImpl == NULL);\n    }\n\n    class Impl;\n    Impl* pImpl; // NULL if current region is not active\n    int implFlags; // see RegionFlag, 0 if region is ignored\n\n    bool isActive() const { return pImpl != NULL; }\n\n    void destroy();\nprivate:\n    Region(const Region&); // disabled\n    Region& operator= (const Region&); // disabled\n};\n\n//! Specify region flags\nenum RegionLocationFlag {\n    REGION_FLAG_FUNCTION = (1 << 0),             //< region is function (=1) / nested named region (=0)\n    REGION_FLAG_APP_CODE = (1 << 1),             //< region is Application code (=1) / OpenCV library code (=0)\n    REGION_FLAG_SKIP_NESTED = (1 << 2),          //< avoid processing of nested regions\n\n    REGION_FLAG_IMPL_IPP = (1 << 16),            //< region is part of IPP code path\n    REGION_FLAG_IMPL_OPENCL = (2 << 16),         //< region is part of OpenCL code path\n    REGION_FLAG_IMPL_OPENVX = (3 << 16),         //< region is part of OpenVX code path\n\n    REGION_FLAG_IMPL_MASK = (15 << 16),\n\n    REGION_FLAG_REGION_FORCE = (1 << 30),\n    REGION_FLAG_REGION_NEXT = (1 << 31),         //< close previous region (see #CV_TRACE_REGION_NEXT macro)\n\n    ENUM_REGION_FLAG_FORCE_INT = INT_MAX\n};\n\nstruct CV_EXPORTS TraceArg {\npublic:\n    struct ExtraData;\n    ExtraData** ppExtra;\n    const char* name;\n    int flags;\n};\n/** @brief Add meta information to current region (function)\n * See CV_TRACE_ARG macro\n * @param arg argument information structure (global static cache)\n * @param value argument value (can by dynamic string literal in case of string, static allocation is not required)\n */\nCV_EXPORTS void traceArg(const TraceArg& arg, const char* value);\n//! @overload\nCV_EXPORTS void traceArg(const TraceArg& arg, int value);\n//! @overload\nCV_EXPORTS void traceArg(const TraceArg& arg, int64 value);\n//! @overload\nCV_EXPORTS void traceArg(const TraceArg& arg, double value);\n\n#define CV__TRACE_LOCATION_VARNAME(loc_id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_trace_location_, loc_id), __LINE__)\n#define CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_trace_location_extra_, loc_id) , __LINE__)\n\n#define CV__TRACE_DEFINE_LOCATION_(loc_id, name, flags) \\\n    static CV_TRACE_NS::details::Region::LocationExtraData* CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id) = 0; \\\n    static const CV_TRACE_NS::details::Region::LocationStaticStorage \\\n        CV__TRACE_LOCATION_VARNAME(loc_id) = { &(CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id)), name, CV_TRACE_FILENAME, __LINE__, flags};\n\n#define CV__TRACE_DEFINE_LOCATION_FN(name, flags) CV__TRACE_DEFINE_LOCATION_(fn, name, ((flags) | CV_TRACE_NS::details::REGION_FLAG_FUNCTION))\n\n\n#define CV__TRACE_OPENCV_FUNCTION() \\\n    CV__TRACE_DEFINE_LOCATION_FN(CV__TRACE_FUNCTION, 0); \\\n    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));\n\n#define CV__TRACE_OPENCV_FUNCTION_NAME(name) \\\n    CV__TRACE_DEFINE_LOCATION_FN(name, 0); \\\n    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));\n\n#define CV__TRACE_APP_FUNCTION() \\\n    CV__TRACE_DEFINE_LOCATION_FN(CV__TRACE_FUNCTION, CV_TRACE_NS::details::REGION_FLAG_APP_CODE); \\\n    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));\n\n#define CV__TRACE_APP_FUNCTION_NAME(name) \\\n    CV__TRACE_DEFINE_LOCATION_FN(name, CV_TRACE_NS::details::REGION_FLAG_APP_CODE); \\\n    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));\n\n\n#define CV__TRACE_OPENCV_FUNCTION_SKIP_NESTED() \\\n    CV__TRACE_DEFINE_LOCATION_FN(CV__TRACE_FUNCTION, CV_TRACE_NS::details::REGION_FLAG_SKIP_NESTED); \\\n    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));\n\n#define CV__TRACE_OPENCV_FUNCTION_NAME_SKIP_NESTED(name) \\\n    CV__TRACE_DEFINE_LOCATION_FN(name, CV_TRACE_NS::details::REGION_FLAG_SKIP_NESTED); \\\n    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));\n\n#define CV__TRACE_APP_FUNCTION_SKIP_NESTED() \\\n    CV__TRACE_DEFINE_LOCATION_FN(CV__TRACE_FUNCTION, CV_TRACE_NS::details::REGION_FLAG_SKIP_NESTED | CV_TRACE_NS::details::REGION_FLAG_APP_CODE); \\\n    const CV_TRACE_NS::details::Region __region_fn(CV__TRACE_LOCATION_VARNAME(fn));\n\n\n#define CV__TRACE_REGION_(name_as_static_string_literal, flags) \\\n    CV__TRACE_DEFINE_LOCATION_(region, name_as_static_string_literal, flags); \\\n    CV_TRACE_NS::details::Region CVAUX_CONCAT(__region_, __LINE__)(CV__TRACE_LOCATION_VARNAME(region));\n\n#define CV__TRACE_REGION(name_as_static_string_literal) CV__TRACE_REGION_(name_as_static_string_literal, 0)\n#define CV__TRACE_REGION_NEXT(name_as_static_string_literal) CV__TRACE_REGION_(name_as_static_string_literal, CV_TRACE_NS::details::REGION_FLAG_REGION_NEXT)\n\n#define CV__TRACE_ARG_VARNAME(arg_id) CVAUX_CONCAT(__cv_trace_arg_ ## arg_id, __LINE__)\n#define CV__TRACE_ARG_EXTRA_VARNAME(arg_id) CVAUX_CONCAT(__cv_trace_arg_extra_ ## arg_id, __LINE__)\n\n#define CV__TRACE_DEFINE_ARG_(arg_id, name, flags) \\\n    static CV_TRACE_NS::details::TraceArg::ExtraData* CV__TRACE_ARG_EXTRA_VARNAME(arg_id) = 0; \\\n    static const CV_TRACE_NS::details::TraceArg \\\n        CV__TRACE_ARG_VARNAME(arg_id) = { &(CV__TRACE_ARG_EXTRA_VARNAME(arg_id)), name, flags };\n\n#define CV__TRACE_ARG_VALUE(arg_id, arg_name, value) \\\n        CV__TRACE_DEFINE_ARG_(arg_id, arg_name, 0); \\\n        CV_TRACE_NS::details::traceArg((CV__TRACE_ARG_VARNAME(arg_id)), value);\n\n#define CV__TRACE_ARG(arg_id) CV_TRACE_ARG_VALUE(arg_id, #arg_id, (arg_id))\n\n} // namespace\n\n#ifndef OPENCV_DISABLE_TRACE\n#undef CV_TRACE_FUNCTION\n#undef CV_TRACE_FUNCTION_SKIP_NESTED\n#if __OPENCV_TRACE\n#define CV_TRACE_FUNCTION CV__TRACE_OPENCV_FUNCTION\n#define CV_TRACE_FUNCTION_SKIP_NESTED CV__TRACE_OPENCV_FUNCTION_SKIP_NESTED\n#else\n#define CV_TRACE_FUNCTION CV__TRACE_APP_FUNCTION\n#define CV_TRACE_FUNCTION_SKIP_NESTED CV__TRACE_APP_FUNCTION_SKIP_NESTED\n#endif\n\n#undef CV_TRACE_REGION\n#define CV_TRACE_REGION CV__TRACE_REGION\n\n#undef CV_TRACE_REGION_NEXT\n#define CV_TRACE_REGION_NEXT CV__TRACE_REGION_NEXT\n\n#undef CV_TRACE_ARG_VALUE\n#define CV_TRACE_ARG_VALUE(arg_id, arg_name, value) \\\n        if (__region_fn.isActive()) \\\n        { \\\n            CV__TRACE_ARG_VALUE(arg_id, arg_name, value); \\\n        }\n\n#undef CV_TRACE_ARG\n#define CV_TRACE_ARG CV__TRACE_ARG\n\n#endif // OPENCV_DISABLE_TRACE\n\n#ifdef OPENCV_TRACE_VERBOSE\n#define CV_TRACE_FUNCTION_VERBOSE CV_TRACE_FUNCTION\n#define CV_TRACE_REGION_VERBOSE CV_TRACE_REGION\n#define CV_TRACE_REGION_NEXT_VERBOSE CV_TRACE_REGION_NEXT\n#define CV_TRACE_ARG_VALUE_VERBOSE CV_TRACE_ARG_VALUE\n#define CV_TRACE_ARG_VERBOSE CV_TRACE_ARG\n#else\n#define CV_TRACE_FUNCTION_VERBOSE(...)\n#define CV_TRACE_REGION_VERBOSE(...)\n#define CV_TRACE_REGION_NEXT_VERBOSE(...)\n#define CV_TRACE_ARG_VALUE_VERBOSE(...)\n#define CV_TRACE_ARG_VERBOSE(...)\n#endif\n\n//! @endcond\n\n//! @}\n\n}}} // namespace\n\n#endif // OPENCV_TRACE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/va_intel.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n// Copyright (C) 2015, Itseez, Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n\n#ifndef OPENCV_CORE_VA_INTEL_HPP\n#define OPENCV_CORE_VA_INTEL_HPP\n\n#ifndef __cplusplus\n#  error va_intel.hpp header must be compiled as C++\n#endif\n\n#include \"opencv2/core.hpp\"\n#include \"ocl.hpp\"\n\n#if defined(HAVE_VA)\n# include \"va/va.h\"\n#else  // HAVE_VA\n# if !defined(_VA_H_)\n    typedef void* VADisplay;\n    typedef unsigned int VASurfaceID;\n# endif // !_VA_H_\n#endif // HAVE_VA\n\nnamespace cv { namespace va_intel {\n\n/** @addtogroup core_va_intel\nThis section describes Intel VA-API/OpenCL (CL-VA) interoperability.\n\nTo enable basic VA interoperability build OpenCV with libva library integration enabled: `-DWITH_VA=ON` (corresponding dev package should be installed).\n\nTo enable advanced CL-VA interoperability support on Intel HW, enable option: `-DWITH_VA_INTEL=ON` (OpenCL integration should be enabled which is the default setting). Special runtime environment should be set up in order to use this feature: correct combination of [libva](https://github.com/intel/libva), [OpenCL runtime](https://github.com/intel/compute-runtime) and [media driver](https://github.com/intel/media-driver) should be installed.\n\nCheck usage example for details: samples/va_intel/va_intel_interop.cpp\n*/\n//! @{\n\n/////////////////// CL-VA Interoperability Functions ///////////////////\n\nnamespace ocl {\nusing namespace cv::ocl;\n\n// TODO static functions in the Context class\n/** @brief Creates OpenCL context from VA.\n@param display    - VADisplay for which CL interop should be established.\n@param tryInterop - try to set up for interoperability, if true; set up for use slow copy if false.\n@return Returns reference to OpenCL Context\n */\nCV_EXPORTS Context& initializeContextFromVA(VADisplay display, bool tryInterop = true);\n\n} // namespace cv::va_intel::ocl\n\n/** @brief Converts InputArray to VASurfaceID object.\n@param display - VADisplay object.\n@param src     - source InputArray.\n@param surface - destination VASurfaceID object.\n@param size    - size of image represented by VASurfaceID object.\n */\nCV_EXPORTS void convertToVASurface(VADisplay display, InputArray src, VASurfaceID surface, Size size);\n\n/** @brief Converts VASurfaceID object to OutputArray.\n@param display - VADisplay object.\n@param surface - source VASurfaceID object.\n@param size    - size of image represented by VASurfaceID object.\n@param dst     - destination OutputArray.\n */\nCV_EXPORTS void convertFromVASurface(VADisplay display, VASurfaceID surface, Size size, OutputArray dst);\n\n//! @}\n\n}} // namespace cv::va_intel\n\n#endif /* OPENCV_CORE_VA_INTEL_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/version.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_VERSION_HPP\n#define OPENCV_VERSION_HPP\n\n#define CV_VERSION_MAJOR    4\n#define CV_VERSION_MINOR    5\n#define CV_VERSION_REVISION 3\n#define CV_VERSION_STATUS   \"\"\n\n#define CVAUX_STR_EXP(__A)  #__A\n#define CVAUX_STR(__A)      CVAUX_STR_EXP(__A)\n\n#define CVAUX_STRW_EXP(__A)  L ## #__A\n#define CVAUX_STRW(__A)      CVAUX_STRW_EXP(__A)\n\n#define CV_VERSION          CVAUX_STR(CV_VERSION_MAJOR) \".\" CVAUX_STR(CV_VERSION_MINOR) \".\" CVAUX_STR(CV_VERSION_REVISION) CV_VERSION_STATUS\n\n/* old  style version constants*/\n#define CV_MAJOR_VERSION    CV_VERSION_MAJOR\n#define CV_MINOR_VERSION    CV_VERSION_MINOR\n#define CV_SUBMINOR_VERSION CV_VERSION_REVISION\n\n#endif // OPENCV_VERSION_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core/vsx_utils.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html\n\n#ifndef OPENCV_HAL_VSX_UTILS_HPP\n#define OPENCV_HAL_VSX_UTILS_HPP\n\n#include \"opencv2/core/cvdef.h\"\n\n#ifndef SKIP_INCLUDES\n#   include <assert.h>\n#endif\n\n//! @addtogroup core_utils_vsx\n//! @{\n#if CV_VSX\n\n#define __VSX_S16__(c, v) (c){v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v}\n#define __VSX_S8__(c, v)  (c){v, v, v, v, v, v, v, v}\n#define __VSX_S4__(c, v)  (c){v, v, v, v}\n#define __VSX_S2__(c, v)  (c){v, v}\n\ntypedef __vector unsigned char vec_uchar16;\n#define vec_uchar16_set(...) (vec_uchar16){__VA_ARGS__}\n#define vec_uchar16_sp(c)    (__VSX_S16__(vec_uchar16, (unsigned char)c))\n#define vec_uchar16_c(v)     ((vec_uchar16)(v))\n#define vec_uchar16_z        vec_uchar16_sp(0)\n\ntypedef __vector signed char vec_char16;\n#define vec_char16_set(...) (vec_char16){__VA_ARGS__}\n#define vec_char16_sp(c)    (__VSX_S16__(vec_char16, (signed char)c))\n#define vec_char16_c(v)     ((vec_char16)(v))\n#define vec_char16_z        vec_char16_sp(0)\n\ntypedef __vector unsigned short vec_ushort8;\n#define vec_ushort8_set(...) (vec_ushort8){__VA_ARGS__}\n#define vec_ushort8_sp(c)    (__VSX_S8__(vec_ushort8, (unsigned short)c))\n#define vec_ushort8_c(v)     ((vec_ushort8)(v))\n#define vec_ushort8_z        vec_ushort8_sp(0)\n\ntypedef __vector signed short vec_short8;\n#define vec_short8_set(...) (vec_short8){__VA_ARGS__}\n#define vec_short8_sp(c)    (__VSX_S8__(vec_short8, (signed short)c))\n#define vec_short8_c(v)     ((vec_short8)(v))\n#define vec_short8_z        vec_short8_sp(0)\n\ntypedef __vector unsigned int vec_uint4;\n#define vec_uint4_set(...) (vec_uint4){__VA_ARGS__}\n#define vec_uint4_sp(c)    (__VSX_S4__(vec_uint4, (unsigned int)c))\n#define vec_uint4_c(v)     ((vec_uint4)(v))\n#define vec_uint4_z        vec_uint4_sp(0)\n\ntypedef __vector signed int vec_int4;\n#define vec_int4_set(...)  (vec_int4){__VA_ARGS__}\n#define vec_int4_sp(c)     (__VSX_S4__(vec_int4, (signed int)c))\n#define vec_int4_c(v)      ((vec_int4)(v))\n#define vec_int4_z         vec_int4_sp(0)\n\ntypedef __vector float vec_float4;\n#define vec_float4_set(...)  (vec_float4){__VA_ARGS__}\n#define vec_float4_sp(c)     (__VSX_S4__(vec_float4, c))\n#define vec_float4_c(v)      ((vec_float4)(v))\n#define vec_float4_z         vec_float4_sp(0)\n\ntypedef __vector unsigned long long vec_udword2;\n#define vec_udword2_set(...) (vec_udword2){__VA_ARGS__}\n#define vec_udword2_sp(c)    (__VSX_S2__(vec_udword2, (unsigned long long)c))\n#define vec_udword2_c(v)     ((vec_udword2)(v))\n#define vec_udword2_z        vec_udword2_sp(0)\n\ntypedef __vector signed long long vec_dword2;\n#define vec_dword2_set(...) (vec_dword2){__VA_ARGS__}\n#define vec_dword2_sp(c)    (__VSX_S2__(vec_dword2, (signed long long)c))\n#define vec_dword2_c(v)     ((vec_dword2)(v))\n#define vec_dword2_z        vec_dword2_sp(0)\n\ntypedef  __vector double vec_double2;\n#define vec_double2_set(...) (vec_double2){__VA_ARGS__}\n#define vec_double2_c(v)     ((vec_double2)(v))\n#define vec_double2_sp(c)    (__VSX_S2__(vec_double2, c))\n#define vec_double2_z        vec_double2_sp(0)\n\n#define vec_bchar16           __vector __bool char\n#define vec_bchar16_set(...) (vec_bchar16){__VA_ARGS__}\n#define vec_bchar16_c(v)     ((vec_bchar16)(v))\n\n#define vec_bshort8           __vector __bool short\n#define vec_bshort8_set(...) (vec_bshort8){__VA_ARGS__}\n#define vec_bshort8_c(v)     ((vec_bshort8)(v))\n\n#define vec_bint4             __vector __bool int\n#define vec_bint4_set(...)   (vec_bint4){__VA_ARGS__}\n#define vec_bint4_c(v)       ((vec_bint4)(v))\n\n#define vec_bdword2            __vector __bool long long\n#define vec_bdword2_set(...)  (vec_bdword2){__VA_ARGS__}\n#define vec_bdword2_c(v)      ((vec_bdword2)(v))\n\n#define VSX_FINLINE(tp) extern inline tp __attribute__((always_inline))\n\n#define VSX_REDIRECT_1RG(rt, rg, fnm, fn2)   \\\nVSX_FINLINE(rt) fnm(const rg& a) { return fn2(a); }\n\n#define VSX_REDIRECT_2RG(rt, rg, fnm, fn2)   \\\nVSX_FINLINE(rt) fnm(const rg& a, const rg& b) { return fn2(a, b); }\n\n/*\n * GCC VSX compatibility\n**/\n#if defined(__GNUG__) && !defined(__clang__)\n\n// inline asm helper\n#define VSX_IMPL_1RG(rt, rg, opc, fnm) \\\nVSX_FINLINE(rt) fnm(const rg& a)       \\\n{ rt rs; __asm__ __volatile__(#opc\" %x0,%x1\" : \"=wa\" (rs) : \"wa\" (a)); return rs; }\n\n#define VSX_IMPL_1VRG(rt, rg, opc, fnm) \\\nVSX_FINLINE(rt) fnm(const rg& a)        \\\n{ rt rs; __asm__ __volatile__(#opc\" %0,%1\" : \"=v\" (rs) : \"v\" (a)); return rs; }\n\n#define VSX_IMPL_2VRG_F(rt, rg, fopc, fnm)     \\\nVSX_FINLINE(rt) fnm(const rg& a, const rg& b)  \\\n{ rt rs; __asm__ __volatile__(fopc : \"=v\" (rs) : \"v\" (a), \"v\" (b)); return rs; }\n\n#define VSX_IMPL_2VRG(rt, rg, opc, fnm) VSX_IMPL_2VRG_F(rt, rg, #opc\" %0,%1,%2\", fnm)\n\n#if __GNUG__ < 8\n\n    // Support for int4 -> dword2 expanding multiply was added in GCC 8.\n    #ifdef vec_mule\n        #undef vec_mule\n    #endif\n    #ifdef vec_mulo\n        #undef vec_mulo\n    #endif\n\n    VSX_REDIRECT_2RG(vec_ushort8,  vec_uchar16,  vec_mule, __builtin_vec_mule)\n    VSX_REDIRECT_2RG(vec_short8,  vec_char16,  vec_mule, __builtin_vec_mule)\n    VSX_REDIRECT_2RG(vec_int4,  vec_short8,  vec_mule, __builtin_vec_mule)\n    VSX_REDIRECT_2RG(vec_uint4,  vec_ushort8,  vec_mule, __builtin_vec_mule)\n    VSX_REDIRECT_2RG(vec_ushort8,  vec_uchar16,  vec_mulo, __builtin_vec_mulo)\n    VSX_REDIRECT_2RG(vec_short8,  vec_char16,  vec_mulo, __builtin_vec_mulo)\n    VSX_REDIRECT_2RG(vec_int4,  vec_short8,  vec_mulo, __builtin_vec_mulo)\n    VSX_REDIRECT_2RG(vec_uint4,  vec_ushort8,  vec_mulo, __builtin_vec_mulo)\n\n    // dword2 support arrived in ISA 2.07 and GCC 8+\n    VSX_IMPL_2VRG(vec_dword2,  vec_int4,  vmulosw, vec_mule)\n    VSX_IMPL_2VRG(vec_udword2, vec_uint4, vmulouw, vec_mule)\n    VSX_IMPL_2VRG(vec_dword2,  vec_int4,  vmulesw, vec_mulo)\n    VSX_IMPL_2VRG(vec_udword2, vec_uint4, vmuleuw, vec_mulo)\n\n#endif\n\n#if __GNUG__ < 7\n// up to GCC 6 vec_mul only supports precisions and llong\n#   ifdef vec_mul\n#       undef vec_mul\n#   endif\n/*\n * there's no a direct instruction for supporting 8-bit, 16-bit multiplication in ISA 2.07,\n * XLC Implement it by using instruction \"multiply even\", \"multiply odd\" and \"permute\"\n**/\n#   define VSX_IMPL_MULH(Tvec, cperm)                                        \\\n    VSX_FINLINE(Tvec) vec_mul(const Tvec& a, const Tvec& b)                  \\\n    {                                                                        \\\n        static const vec_uchar16 ev_od = {cperm};                            \\\n        return vec_perm((Tvec)vec_mule(a, b), (Tvec)vec_mulo(a, b), ev_od);  \\\n    }\n    #define VSX_IMPL_MULH_P16 0, 16, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30\n    VSX_IMPL_MULH(vec_char16,  VSX_IMPL_MULH_P16)\n    VSX_IMPL_MULH(vec_uchar16, VSX_IMPL_MULH_P16)\n    #define VSX_IMPL_MULH_P8 0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29\n    VSX_IMPL_MULH(vec_short8,  VSX_IMPL_MULH_P8)\n    VSX_IMPL_MULH(vec_ushort8, VSX_IMPL_MULH_P8)\n    // vmuluwm can be used for unsigned or signed integers, that's what they said\n    VSX_IMPL_2VRG(vec_int4,  vec_int4,  vmuluwm, vec_mul)\n    VSX_IMPL_2VRG(vec_uint4, vec_uint4, vmuluwm, vec_mul)\n    // redirect to GCC builtin vec_mul, since it already supports precisions and llong\n    VSX_REDIRECT_2RG(vec_float4,  vec_float4,  vec_mul, __builtin_vec_mul)\n    VSX_REDIRECT_2RG(vec_double2, vec_double2, vec_mul, __builtin_vec_mul)\n    VSX_REDIRECT_2RG(vec_dword2,  vec_dword2,  vec_mul, __builtin_vec_mul)\n    VSX_REDIRECT_2RG(vec_udword2, vec_udword2, vec_mul, __builtin_vec_mul)\n#endif // __GNUG__ < 7\n\n#if __GNUG__ < 6\n/*\n * Instruction \"compare greater than or equal\" in ISA 2.07 only supports single\n * and double precision.\n * In XLC and new versions of GCC implement integers by using instruction \"greater than\" and NOR.\n**/\n#   ifdef vec_cmpge\n#       undef vec_cmpge\n#   endif\n#   ifdef vec_cmple\n#       undef vec_cmple\n#   endif\n#   define vec_cmple(a, b) vec_cmpge(b, a)\n#   define VSX_IMPL_CMPGE(rt, rg, opc, fnm) \\\n    VSX_IMPL_2VRG_F(rt, rg, #opc\" %0,%2,%1\\n\\t xxlnor %x0,%x0,%x0\", fnm)\n\n    VSX_IMPL_CMPGE(vec_bchar16, vec_char16,  vcmpgtsb, vec_cmpge)\n    VSX_IMPL_CMPGE(vec_bchar16, vec_uchar16, vcmpgtub, vec_cmpge)\n    VSX_IMPL_CMPGE(vec_bshort8, vec_short8,  vcmpgtsh, vec_cmpge)\n    VSX_IMPL_CMPGE(vec_bshort8, vec_ushort8, vcmpgtuh, vec_cmpge)\n    VSX_IMPL_CMPGE(vec_bint4,   vec_int4,    vcmpgtsw, vec_cmpge)\n    VSX_IMPL_CMPGE(vec_bint4,   vec_uint4,   vcmpgtuw, vec_cmpge)\n    VSX_IMPL_CMPGE(vec_bdword2, vec_dword2,  vcmpgtsd, vec_cmpge)\n    VSX_IMPL_CMPGE(vec_bdword2, vec_udword2, vcmpgtud, vec_cmpge)\n\n// redirect to GCC builtin cmpge, since it already supports precisions\n    VSX_REDIRECT_2RG(vec_bint4,   vec_float4,  vec_cmpge, __builtin_vec_cmpge)\n    VSX_REDIRECT_2RG(vec_bdword2, vec_double2, vec_cmpge, __builtin_vec_cmpge)\n\n// up to gcc5 vec_nor doesn't support bool long long\n#   undef vec_nor\n    template<typename T>\n    VSX_REDIRECT_2RG(T, T, vec_nor, __builtin_vec_nor)\n\n    VSX_FINLINE(vec_bdword2) vec_nor(const vec_bdword2& a, const vec_bdword2& b)\n    { return vec_bdword2_c(__builtin_vec_nor(vec_dword2_c(a), vec_dword2_c(b))); }\n\n// vec_packs doesn't support double words in gcc4 and old versions of gcc5\n#   undef vec_packs\n    VSX_REDIRECT_2RG(vec_char16,  vec_short8,  vec_packs, __builtin_vec_packs)\n    VSX_REDIRECT_2RG(vec_uchar16, vec_ushort8, vec_packs, __builtin_vec_packs)\n    VSX_REDIRECT_2RG(vec_short8,  vec_int4,    vec_packs, __builtin_vec_packs)\n    VSX_REDIRECT_2RG(vec_ushort8, vec_uint4,   vec_packs, __builtin_vec_packs)\n\n    VSX_IMPL_2VRG_F(vec_int4,  vec_dword2,  \"vpksdss %0,%2,%1\", vec_packs)\n    VSX_IMPL_2VRG_F(vec_uint4, vec_udword2, \"vpkudus %0,%2,%1\", vec_packs)\n#endif // __GNUG__ < 6\n\n#if __GNUG__ < 5\n// vec_xxpermdi in gcc4 missing little-endian supports just like clang\n#   define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ (((c) & 1) << 1 | (c) >> 1)))\n// same as vec_xxpermdi\n#   undef vec_vbpermq\n    VSX_IMPL_2VRG(vec_udword2, vec_uchar16, vbpermq, vec_vbpermq)\n    VSX_IMPL_2VRG(vec_dword2,  vec_char16, vbpermq, vec_vbpermq)\n#else\n#   define vec_permi vec_xxpermdi\n#endif // __GNUG__ < 5\n\n// shift left double by word immediate\n#ifndef vec_sldw\n#   define vec_sldw __builtin_vsx_xxsldwi\n#endif\n\n// vector population count\nVSX_IMPL_1VRG(vec_uchar16, vec_uchar16, vpopcntb, vec_popcntu)\nVSX_IMPL_1VRG(vec_uchar16, vec_char16,  vpopcntb, vec_popcntu)\nVSX_IMPL_1VRG(vec_ushort8, vec_ushort8, vpopcnth, vec_popcntu)\nVSX_IMPL_1VRG(vec_ushort8, vec_short8,  vpopcnth, vec_popcntu)\nVSX_IMPL_1VRG(vec_uint4,   vec_uint4,   vpopcntw, vec_popcntu)\nVSX_IMPL_1VRG(vec_uint4,   vec_int4,    vpopcntw, vec_popcntu)\nVSX_IMPL_1VRG(vec_udword2, vec_udword2, vpopcntd, vec_popcntu)\nVSX_IMPL_1VRG(vec_udword2, vec_dword2,  vpopcntd, vec_popcntu)\n\n// converts between single and double-precision\nVSX_REDIRECT_1RG(vec_float4,  vec_double2, vec_cvfo, __builtin_vsx_xvcvdpsp)\nVSX_REDIRECT_1RG(vec_double2, vec_float4,  vec_cvfo, __builtin_vsx_xvcvspdp)\n\n// converts word and doubleword to double-precision\n#undef vec_ctd\nVSX_IMPL_1RG(vec_double2, vec_int4,    xvcvsxwdp, vec_ctdo)\nVSX_IMPL_1RG(vec_double2, vec_uint4,   xvcvuxwdp, vec_ctdo)\nVSX_IMPL_1RG(vec_double2, vec_dword2,  xvcvsxddp, vec_ctd)\nVSX_IMPL_1RG(vec_double2, vec_udword2, xvcvuxddp, vec_ctd)\n\n// converts word and doubleword to single-precision\n#undef vec_ctf\nVSX_IMPL_1RG(vec_float4, vec_int4,    xvcvsxwsp, vec_ctf)\nVSX_IMPL_1RG(vec_float4, vec_uint4,   xvcvuxwsp, vec_ctf)\nVSX_IMPL_1RG(vec_float4, vec_dword2,  xvcvsxdsp, vec_ctfo)\nVSX_IMPL_1RG(vec_float4, vec_udword2, xvcvuxdsp, vec_ctfo)\n\n// converts single and double precision to signed word\n#undef vec_cts\nVSX_IMPL_1RG(vec_int4,  vec_double2, xvcvdpsxws, vec_ctso)\nVSX_IMPL_1RG(vec_int4,  vec_float4,  xvcvspsxws, vec_cts)\n\n// converts single and double precision to unsigned word\n#undef vec_ctu\nVSX_IMPL_1RG(vec_uint4, vec_double2, xvcvdpuxws, vec_ctuo)\nVSX_IMPL_1RG(vec_uint4, vec_float4,  xvcvspuxws, vec_ctu)\n\n// converts single and double precision to signed doubleword\n#undef vec_ctsl\nVSX_IMPL_1RG(vec_dword2, vec_double2, xvcvdpsxds, vec_ctsl)\nVSX_IMPL_1RG(vec_dword2, vec_float4,  xvcvspsxds, vec_ctslo)\n\n// converts single and double precision to unsigned doubleword\n#undef vec_ctul\nVSX_IMPL_1RG(vec_udword2, vec_double2, xvcvdpuxds, vec_ctul)\nVSX_IMPL_1RG(vec_udword2, vec_float4,  xvcvspuxds, vec_ctulo)\n\n// just in case if GCC doesn't define it\n#ifndef vec_xl\n#   define vec_xl vec_vsx_ld\n#   define vec_xst vec_vsx_st\n#endif\n\n#endif // GCC VSX compatibility\n\n/*\n * CLANG VSX compatibility\n**/\n#if defined(__clang__) && !defined(__IBMCPP__)\n\n/*\n * CLANG doesn't support %x<n> in the inline asm template which fixes register number\n * when using any of the register constraints wa, wd, wf\n *\n * For more explanation checkout PowerPC and IBM RS6000 in https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html\n * Also there's already an open bug https://bugs.llvm.org/show_bug.cgi?id=31837\n *\n * So we're not able to use inline asm and only use built-in functions that CLANG supports\n * and use __builtin_convertvector if clang missing any of vector conversions built-in functions\n *\n * todo: clang asm template bug is fixed, need to reconsider the current workarounds.\n*/\n\n// convert vector helper\n#define VSX_IMPL_CONVERT(rt, rg, fnm) \\\nVSX_FINLINE(rt) fnm(const rg& a) { return __builtin_convertvector(a, rt); }\n\n#if __clang_major__ < 5\n// implement vec_permi in a dirty way\n#   define VSX_IMPL_CLANG_4_PERMI(Tvec)                                                 \\\n    VSX_FINLINE(Tvec) vec_permi(const Tvec& a, const Tvec& b, unsigned const char c)    \\\n    {                                                                                   \\\n        switch (c)                                                                      \\\n        {                                                                               \\\n        case 0:                                                                         \\\n            return vec_mergeh(a, b);                                                    \\\n        case 1:                                                                         \\\n            return vec_mergel(vec_mergeh(a, a), b);                                     \\\n        case 2:                                                                         \\\n            return vec_mergeh(vec_mergel(a, a), b);                                     \\\n        default:                                                                        \\\n            return vec_mergel(a, b);                                                    \\\n        }                                                                               \\\n    }\n    VSX_IMPL_CLANG_4_PERMI(vec_udword2)\n    VSX_IMPL_CLANG_4_PERMI(vec_dword2)\n    VSX_IMPL_CLANG_4_PERMI(vec_double2)\n\n// vec_xxsldwi is missing in clang 4\n#   define vec_xxsldwi(a, b, c) vec_sld(a, b, (c) * 4)\n#else\n// vec_xxpermdi is missing little-endian supports in clang 4 just like gcc4\n#   define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ (((c) & 1) << 1 | (c) >> 1)))\n#endif // __clang_major__ < 5\n\n// shift left double by word immediate\n#ifndef vec_sldw\n#   define vec_sldw vec_xxsldwi\n#endif\n\n// Implement vec_rsqrt since clang only supports vec_rsqrte\n#ifndef vec_rsqrt\n    VSX_FINLINE(vec_float4) vec_rsqrt(const vec_float4& a)\n    { return vec_div(vec_float4_sp(1), vec_sqrt(a)); }\n\n    VSX_FINLINE(vec_double2) vec_rsqrt(const vec_double2& a)\n    { return vec_div(vec_double2_sp(1), vec_sqrt(a)); }\n#endif\n\n// vec_promote missing support for doubleword\nVSX_FINLINE(vec_dword2) vec_promote(long long a, int b)\n{\n    vec_dword2 ret = vec_dword2_z;\n    ret[b & 1] = a;\n    return ret;\n}\n\nVSX_FINLINE(vec_udword2) vec_promote(unsigned long long a, int b)\n{\n    vec_udword2 ret = vec_udword2_z;\n    ret[b & 1] = a;\n    return ret;\n}\n\n// vec_popcnt should return unsigned but clang has different thought just like gcc in vec_vpopcnt\n#define VSX_IMPL_POPCNTU(Tvec, Tvec2, ucast)   \\\nVSX_FINLINE(Tvec) vec_popcntu(const Tvec2& a)  \\\n{ return ucast(vec_popcnt(a)); }\nVSX_IMPL_POPCNTU(vec_uchar16, vec_char16, vec_uchar16_c);\nVSX_IMPL_POPCNTU(vec_ushort8, vec_short8, vec_ushort8_c);\nVSX_IMPL_POPCNTU(vec_uint4,   vec_int4,   vec_uint4_c);\nVSX_IMPL_POPCNTU(vec_udword2, vec_dword2, vec_udword2_c);\n// redirect unsigned types\nVSX_REDIRECT_1RG(vec_uchar16, vec_uchar16, vec_popcntu, vec_popcnt)\nVSX_REDIRECT_1RG(vec_ushort8, vec_ushort8, vec_popcntu, vec_popcnt)\nVSX_REDIRECT_1RG(vec_uint4,   vec_uint4,   vec_popcntu, vec_popcnt)\nVSX_REDIRECT_1RG(vec_udword2, vec_udword2, vec_popcntu, vec_popcnt)\n\n// converts between single and double precision\nVSX_REDIRECT_1RG(vec_float4,  vec_double2, vec_cvfo, __builtin_vsx_xvcvdpsp)\nVSX_REDIRECT_1RG(vec_double2, vec_float4,  vec_cvfo, __builtin_vsx_xvcvspdp)\n\n// converts word and doubleword to double-precision\n#ifdef vec_ctd\n#   undef vec_ctd\n#endif\nVSX_REDIRECT_1RG(vec_double2, vec_int4,  vec_ctdo, __builtin_vsx_xvcvsxwdp)\nVSX_REDIRECT_1RG(vec_double2, vec_uint4, vec_ctdo, __builtin_vsx_xvcvuxwdp)\n\nVSX_IMPL_CONVERT(vec_double2, vec_dword2,  vec_ctd)\nVSX_IMPL_CONVERT(vec_double2, vec_udword2, vec_ctd)\n\n// converts word and doubleword to single-precision\n#if __clang_major__ > 4\n#   undef vec_ctf\n#endif\nVSX_IMPL_CONVERT(vec_float4, vec_int4,    vec_ctf)\nVSX_IMPL_CONVERT(vec_float4, vec_uint4,   vec_ctf)\nVSX_REDIRECT_1RG(vec_float4, vec_dword2,  vec_ctfo, __builtin_vsx_xvcvsxdsp)\nVSX_REDIRECT_1RG(vec_float4, vec_udword2, vec_ctfo, __builtin_vsx_xvcvuxdsp)\n\n// converts single and double precision to signed word\n#if __clang_major__ > 4\n#   undef vec_cts\n#endif\nVSX_REDIRECT_1RG(vec_int4,  vec_double2, vec_ctso, __builtin_vsx_xvcvdpsxws)\nVSX_IMPL_CONVERT(vec_int4,  vec_float4,  vec_cts)\n\n// converts single and double precision to unsigned word\n#if __clang_major__ > 4\n#   undef vec_ctu\n#endif\nVSX_REDIRECT_1RG(vec_uint4, vec_double2, vec_ctuo, __builtin_vsx_xvcvdpuxws)\nVSX_IMPL_CONVERT(vec_uint4, vec_float4,  vec_ctu)\n\n// converts single and double precision to signed doubleword\n#ifdef vec_ctsl\n#   undef vec_ctsl\n#endif\nVSX_IMPL_CONVERT(vec_dword2, vec_double2, vec_ctsl)\n// __builtin_convertvector unable to convert, xvcvspsxds is missing on it\nVSX_FINLINE(vec_dword2) vec_ctslo(const vec_float4& a)\n{ return vec_ctsl(vec_cvfo(a)); }\n\n// converts single and double precision to unsigned doubleword\n#ifdef vec_ctul\n#   undef vec_ctul\n#endif\nVSX_IMPL_CONVERT(vec_udword2, vec_double2, vec_ctul)\n// __builtin_convertvector unable to convert, xvcvspuxds is missing on it\nVSX_FINLINE(vec_udword2) vec_ctulo(const vec_float4& a)\n{ return vec_ctul(vec_cvfo(a)); }\n\n#endif // CLANG VSX compatibility\n\n/*\n * Common GCC, CLANG compatibility\n**/\n#if defined(__GNUG__) && !defined(__IBMCPP__)\n\n#ifdef vec_cvf\n#   undef vec_cvf\n#endif\n\n#define VSX_IMPL_CONV_EVEN_4_2(rt, rg, fnm, fn2) \\\nVSX_FINLINE(rt) fnm(const rg& a)                 \\\n{ return fn2(vec_sldw(a, a, 1)); }\n\nVSX_IMPL_CONV_EVEN_4_2(vec_double2, vec_float4, vec_cvf,  vec_cvfo)\nVSX_IMPL_CONV_EVEN_4_2(vec_double2, vec_int4,   vec_ctd,  vec_ctdo)\nVSX_IMPL_CONV_EVEN_4_2(vec_double2, vec_uint4,  vec_ctd,  vec_ctdo)\n\nVSX_IMPL_CONV_EVEN_4_2(vec_dword2,  vec_float4, vec_ctsl, vec_ctslo)\nVSX_IMPL_CONV_EVEN_4_2(vec_udword2, vec_float4, vec_ctul, vec_ctulo)\n\n#define VSX_IMPL_CONV_EVEN_2_4(rt, rg, fnm, fn2) \\\nVSX_FINLINE(rt) fnm(const rg& a)                 \\\n{                                                \\\n    rt v4 = fn2(a);                              \\\n    return vec_sldw(v4, v4, 3);                  \\\n}\n\nVSX_IMPL_CONV_EVEN_2_4(vec_float4, vec_double2, vec_cvf, vec_cvfo)\nVSX_IMPL_CONV_EVEN_2_4(vec_float4, vec_dword2,  vec_ctf, vec_ctfo)\nVSX_IMPL_CONV_EVEN_2_4(vec_float4, vec_udword2, vec_ctf, vec_ctfo)\n\nVSX_IMPL_CONV_EVEN_2_4(vec_int4,   vec_double2, vec_cts, vec_ctso)\nVSX_IMPL_CONV_EVEN_2_4(vec_uint4,  vec_double2, vec_ctu, vec_ctuo)\n\n// Only for Eigen!\n/*\n * changing behavior of conversion intrinsics for gcc has effect on Eigen\n * so we redefine old behavior again only on gcc, clang\n*/\n#if !defined(__clang__) || __clang_major__ > 4\n    // ignoring second arg since Eigen only truncates toward zero\n#   define VSX_IMPL_CONV_2VARIANT(rt, rg, fnm, fn2)     \\\n    VSX_FINLINE(rt) fnm(const rg& a, int only_truncate) \\\n    {                                                   \\\n        assert(only_truncate == 0);                     \\\n        CV_UNUSED(only_truncate);                       \\\n        return fn2(a);                                  \\\n    }\n    VSX_IMPL_CONV_2VARIANT(vec_int4,   vec_float4,  vec_cts, vec_cts)\n    VSX_IMPL_CONV_2VARIANT(vec_uint4,  vec_float4,  vec_ctu, vec_ctu)\n    VSX_IMPL_CONV_2VARIANT(vec_float4, vec_int4,    vec_ctf, vec_ctf)\n    VSX_IMPL_CONV_2VARIANT(vec_float4, vec_uint4,   vec_ctf, vec_ctf)\n    // define vec_cts for converting double precision to signed doubleword\n    // which isn't compatible with xlc but its okay since Eigen only uses it for gcc\n    VSX_IMPL_CONV_2VARIANT(vec_dword2, vec_double2, vec_cts, vec_ctsl)\n#endif // Eigen\n\n#endif // Common GCC, CLANG compatibility\n\n/*\n * XLC VSX compatibility\n**/\n#if defined(__IBMCPP__)\n\n// vector population count\n#define vec_popcntu vec_popcnt\n\n// overload and redirect with setting second arg to zero\n// since we only support conversions without the second arg\n#define VSX_IMPL_OVERLOAD_Z2(rt, rg, fnm) \\\nVSX_FINLINE(rt) fnm(const rg& a) { return fnm(a, 0); }\n\nVSX_IMPL_OVERLOAD_Z2(vec_double2, vec_int4,    vec_ctd)\nVSX_IMPL_OVERLOAD_Z2(vec_double2, vec_uint4,   vec_ctd)\nVSX_IMPL_OVERLOAD_Z2(vec_double2, vec_dword2,  vec_ctd)\nVSX_IMPL_OVERLOAD_Z2(vec_double2, vec_udword2, vec_ctd)\n\nVSX_IMPL_OVERLOAD_Z2(vec_float4,  vec_int4,    vec_ctf)\nVSX_IMPL_OVERLOAD_Z2(vec_float4,  vec_uint4,   vec_ctf)\nVSX_IMPL_OVERLOAD_Z2(vec_float4,  vec_dword2,  vec_ctf)\nVSX_IMPL_OVERLOAD_Z2(vec_float4,  vec_udword2, vec_ctf)\n\nVSX_IMPL_OVERLOAD_Z2(vec_int4,    vec_double2, vec_cts)\nVSX_IMPL_OVERLOAD_Z2(vec_int4,    vec_float4,  vec_cts)\n\nVSX_IMPL_OVERLOAD_Z2(vec_uint4,   vec_double2, vec_ctu)\nVSX_IMPL_OVERLOAD_Z2(vec_uint4,   vec_float4,  vec_ctu)\n\nVSX_IMPL_OVERLOAD_Z2(vec_dword2,  vec_double2, vec_ctsl)\nVSX_IMPL_OVERLOAD_Z2(vec_dword2,  vec_float4,  vec_ctsl)\n\nVSX_IMPL_OVERLOAD_Z2(vec_udword2, vec_double2, vec_ctul)\nVSX_IMPL_OVERLOAD_Z2(vec_udword2, vec_float4,  vec_ctul)\n\n// fixme: implement conversions of odd-numbered elements in a dirty way\n// since xlc doesn't support VSX registers operand in inline asm.\n#define VSX_IMPL_CONV_ODD_4_2(rt, rg, fnm, fn2) \\\nVSX_FINLINE(rt) fnm(const rg& a) { return fn2(vec_sldw(a, a, 3)); }\n\nVSX_IMPL_CONV_ODD_4_2(vec_double2, vec_float4, vec_cvfo,  vec_cvf)\nVSX_IMPL_CONV_ODD_4_2(vec_double2, vec_int4,   vec_ctdo,  vec_ctd)\nVSX_IMPL_CONV_ODD_4_2(vec_double2, vec_uint4,  vec_ctdo,  vec_ctd)\n\nVSX_IMPL_CONV_ODD_4_2(vec_dword2,  vec_float4, vec_ctslo, vec_ctsl)\nVSX_IMPL_CONV_ODD_4_2(vec_udword2, vec_float4, vec_ctulo, vec_ctul)\n\n#define VSX_IMPL_CONV_ODD_2_4(rt, rg, fnm, fn2)  \\\nVSX_FINLINE(rt) fnm(const rg& a)                 \\\n{                                                \\\n    rt v4 = fn2(a);                              \\\n    return vec_sldw(v4, v4, 1);                  \\\n}\n\nVSX_IMPL_CONV_ODD_2_4(vec_float4, vec_double2, vec_cvfo, vec_cvf)\nVSX_IMPL_CONV_ODD_2_4(vec_float4, vec_dword2,  vec_ctfo, vec_ctf)\nVSX_IMPL_CONV_ODD_2_4(vec_float4, vec_udword2, vec_ctfo, vec_ctf)\n\nVSX_IMPL_CONV_ODD_2_4(vec_int4,   vec_double2, vec_ctso, vec_cts)\nVSX_IMPL_CONV_ODD_2_4(vec_uint4,  vec_double2, vec_ctuo, vec_ctu)\n\n#endif // XLC VSX compatibility\n\n// ignore GCC warning that caused by -Wunused-but-set-variable in rare cases\n#if defined(__GNUG__) && !defined(__clang__)\n#   define VSX_UNUSED(Tvec) Tvec __attribute__((__unused__))\n#else // CLANG, XLC\n#   define VSX_UNUSED(Tvec) Tvec\n#endif\n\n// gcc can find his way in casting log int and XLC, CLANG ambiguous\n#if defined(__clang__) || defined(__IBMCPP__)\n    VSX_FINLINE(vec_udword2) vec_splats(uint64 v)\n    { return vec_splats((unsigned long long) v); }\n\n    VSX_FINLINE(vec_dword2) vec_splats(int64 v)\n    { return vec_splats((long long) v); }\n\n    VSX_FINLINE(vec_udword2) vec_promote(uint64 a, int b)\n    { return vec_promote((unsigned long long) a, b); }\n\n    VSX_FINLINE(vec_dword2) vec_promote(int64 a, int b)\n    { return vec_promote((long long) a, b); }\n#endif\n\n/*\n * implement vsx_ld(offset, pointer), vsx_st(vector, offset, pointer)\n * load and set using offset depend on the pointer type\n *\n * implement vsx_ldf(offset, pointer), vsx_stf(vector, offset, pointer)\n * load and set using offset depend on fixed bytes size\n *\n * Note: In clang vec_xl and vec_xst fails to load unaligned addresses\n * so we are using vec_vsx_ld, vec_vsx_st instead\n*/\n\n#if defined(__clang__) && !defined(__IBMCPP__)\n#   define vsx_ldf  vec_vsx_ld\n#   define vsx_stf  vec_vsx_st\n#else // GCC , XLC\n#   define vsx_ldf  vec_xl\n#   define vsx_stf  vec_xst\n#endif\n\n#define VSX_OFFSET(o, p) ((o) * sizeof(*(p)))\n#define vsx_ld(o, p) vsx_ldf(VSX_OFFSET(o, p), p)\n#define vsx_st(v, o, p) vsx_stf(v, VSX_OFFSET(o, p), p)\n\n/*\n * implement vsx_ld2(offset, pointer), vsx_st2(vector, offset, pointer) to load and store double words\n * In GCC vec_xl and vec_xst it maps to vec_vsx_ld, vec_vsx_st which doesn't support long long\n * and in CLANG we are using vec_vsx_ld, vec_vsx_st because vec_xl, vec_xst fails to load unaligned addresses\n *\n * In XLC vec_xl and vec_xst fail to cast int64(long int) to long long\n*/\n#if (defined(__GNUG__) || defined(__clang__)) && !defined(__IBMCPP__)\n    VSX_FINLINE(vec_udword2) vsx_ld2(long o, const uint64* p)\n    { return vec_udword2_c(vsx_ldf(VSX_OFFSET(o, p), (unsigned int*)p)); }\n\n    VSX_FINLINE(vec_dword2) vsx_ld2(long o, const int64* p)\n    { return vec_dword2_c(vsx_ldf(VSX_OFFSET(o, p), (int*)p)); }\n\n    VSX_FINLINE(void) vsx_st2(const vec_udword2& vec, long o, uint64* p)\n    { vsx_stf(vec_uint4_c(vec), VSX_OFFSET(o, p), (unsigned int*)p); }\n\n    VSX_FINLINE(void) vsx_st2(const vec_dword2& vec, long o, int64* p)\n    { vsx_stf(vec_int4_c(vec), VSX_OFFSET(o, p), (int*)p); }\n#else // XLC\n    VSX_FINLINE(vec_udword2) vsx_ld2(long o, const uint64* p)\n    { return vsx_ldf(VSX_OFFSET(o, p), (unsigned long long*)p); }\n\n    VSX_FINLINE(vec_dword2) vsx_ld2(long o, const int64* p)\n    { return vsx_ldf(VSX_OFFSET(o, p), (long long*)p); }\n\n    VSX_FINLINE(void) vsx_st2(const vec_udword2& vec, long o, uint64* p)\n    { vsx_stf(vec, VSX_OFFSET(o, p), (unsigned long long*)p); }\n\n    VSX_FINLINE(void) vsx_st2(const vec_dword2& vec, long o, int64* p)\n    { vsx_stf(vec, VSX_OFFSET(o, p), (long long*)p); }\n#endif\n\n// Store lower 8 byte\n#define vec_st_l8(v, p) *((uint64*)(p)) = vec_extract(vec_udword2_c(v), 0)\n\n// Store higher 8 byte\n#define vec_st_h8(v, p) *((uint64*)(p)) = vec_extract(vec_udword2_c(v), 1)\n\n// Load 64-bits of integer data to lower part\n#define VSX_IMPL_LOAD_L8(Tvec, Tp)                  \\\nVSX_FINLINE(Tvec) vec_ld_l8(const Tp *p)            \\\n{ return ((Tvec)vec_promote(*((uint64*)p), 0)); }\n\nVSX_IMPL_LOAD_L8(vec_uchar16, uchar)\nVSX_IMPL_LOAD_L8(vec_char16,  schar)\nVSX_IMPL_LOAD_L8(vec_ushort8, ushort)\nVSX_IMPL_LOAD_L8(vec_short8,  short)\nVSX_IMPL_LOAD_L8(vec_uint4,   uint)\nVSX_IMPL_LOAD_L8(vec_int4,    int)\nVSX_IMPL_LOAD_L8(vec_float4,  float)\nVSX_IMPL_LOAD_L8(vec_udword2, uint64)\nVSX_IMPL_LOAD_L8(vec_dword2,  int64)\nVSX_IMPL_LOAD_L8(vec_double2, double)\n\n// logical not\n#define vec_not(a) vec_nor(a, a)\n\n// power9 yaya\n// not equal\n#ifndef vec_cmpne\n#   define vec_cmpne(a, b) vec_not(vec_cmpeq(a, b))\n#endif\n\n// absolute difference\n#ifndef vec_absd\n#   define vec_absd(a, b) vec_sub(vec_max(a, b), vec_min(a, b))\n#endif\n\n/*\n * Implement vec_unpacklu and vec_unpackhu\n * since vec_unpackl, vec_unpackh only support signed integers\n**/\n#define VSX_IMPL_UNPACKU(rt, rg, zero)      \\\nVSX_FINLINE(rt) vec_unpacklu(const rg& a)   \\\n{ return (rt)(vec_mergel(a, zero)); }       \\\nVSX_FINLINE(rt) vec_unpackhu(const rg& a)   \\\n{ return (rt)(vec_mergeh(a, zero));  }\n\nVSX_IMPL_UNPACKU(vec_ushort8, vec_uchar16, vec_uchar16_z)\nVSX_IMPL_UNPACKU(vec_uint4,   vec_ushort8, vec_ushort8_z)\nVSX_IMPL_UNPACKU(vec_udword2, vec_uint4,   vec_uint4_z)\n\n/*\n * Implement vec_mergesqe and vec_mergesqo\n * Merges the sequence values of even and odd elements of two vectors\n*/\n#define VSX_IMPL_PERM(rt, fnm, ...)            \\\nVSX_FINLINE(rt) fnm(const rt& a, const rt& b)  \\\n{ static const vec_uchar16 perm = {__VA_ARGS__}; return vec_perm(a, b, perm); }\n\n// 16\n#define perm16_mergesqe 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30\n#define perm16_mergesqo 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31\nVSX_IMPL_PERM(vec_uchar16, vec_mergesqe, perm16_mergesqe)\nVSX_IMPL_PERM(vec_uchar16, vec_mergesqo, perm16_mergesqo)\nVSX_IMPL_PERM(vec_char16,  vec_mergesqe, perm16_mergesqe)\nVSX_IMPL_PERM(vec_char16,  vec_mergesqo, perm16_mergesqo)\n// 8\n#define perm8_mergesqe 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29\n#define perm8_mergesqo 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31\nVSX_IMPL_PERM(vec_ushort8, vec_mergesqe, perm8_mergesqe)\nVSX_IMPL_PERM(vec_ushort8, vec_mergesqo, perm8_mergesqo)\nVSX_IMPL_PERM(vec_short8,  vec_mergesqe, perm8_mergesqe)\nVSX_IMPL_PERM(vec_short8,  vec_mergesqo, perm8_mergesqo)\n// 4\n#define perm4_mergesqe 0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27\n#define perm4_mergesqo 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31\nVSX_IMPL_PERM(vec_uint4,  vec_mergesqe, perm4_mergesqe)\nVSX_IMPL_PERM(vec_uint4,  vec_mergesqo, perm4_mergesqo)\nVSX_IMPL_PERM(vec_int4,   vec_mergesqe, perm4_mergesqe)\nVSX_IMPL_PERM(vec_int4,   vec_mergesqo, perm4_mergesqo)\nVSX_IMPL_PERM(vec_float4, vec_mergesqe, perm4_mergesqe)\nVSX_IMPL_PERM(vec_float4, vec_mergesqo, perm4_mergesqo)\n// 2\nVSX_REDIRECT_2RG(vec_double2, vec_double2, vec_mergesqe, vec_mergeh)\nVSX_REDIRECT_2RG(vec_double2, vec_double2, vec_mergesqo, vec_mergel)\nVSX_REDIRECT_2RG(vec_dword2,  vec_dword2,  vec_mergesqe, vec_mergeh)\nVSX_REDIRECT_2RG(vec_dword2,  vec_dword2,  vec_mergesqo, vec_mergel)\nVSX_REDIRECT_2RG(vec_udword2, vec_udword2, vec_mergesqe, vec_mergeh)\nVSX_REDIRECT_2RG(vec_udword2, vec_udword2, vec_mergesqo, vec_mergel)\n\n/*\n * Implement vec_mergesqh and vec_mergesql\n * Merges the sequence most and least significant halves of two vectors\n*/\n#define VSX_IMPL_MERGESQHL(Tvec)                                    \\\nVSX_FINLINE(Tvec) vec_mergesqh(const Tvec& a, const Tvec& b)        \\\n{ return (Tvec)vec_mergeh(vec_udword2_c(a), vec_udword2_c(b)); }    \\\nVSX_FINLINE(Tvec) vec_mergesql(const Tvec& a, const Tvec& b)        \\\n{ return (Tvec)vec_mergel(vec_udword2_c(a), vec_udword2_c(b)); }\nVSX_IMPL_MERGESQHL(vec_uchar16)\nVSX_IMPL_MERGESQHL(vec_char16)\nVSX_IMPL_MERGESQHL(vec_ushort8)\nVSX_IMPL_MERGESQHL(vec_short8)\nVSX_IMPL_MERGESQHL(vec_uint4)\nVSX_IMPL_MERGESQHL(vec_int4)\nVSX_IMPL_MERGESQHL(vec_float4)\nVSX_REDIRECT_2RG(vec_udword2, vec_udword2, vec_mergesqh, vec_mergeh)\nVSX_REDIRECT_2RG(vec_udword2, vec_udword2, vec_mergesql, vec_mergel)\nVSX_REDIRECT_2RG(vec_dword2,  vec_dword2,  vec_mergesqh, vec_mergeh)\nVSX_REDIRECT_2RG(vec_dword2,  vec_dword2,  vec_mergesql, vec_mergel)\nVSX_REDIRECT_2RG(vec_double2, vec_double2, vec_mergesqh, vec_mergeh)\nVSX_REDIRECT_2RG(vec_double2, vec_double2, vec_mergesql, vec_mergel)\n\n\n// 2 and 4 channels interleave for all types except 2 lanes\n#define VSX_IMPL_ST_INTERLEAVE(Tp, Tvec)                                    \\\nVSX_FINLINE(void) vec_st_interleave(const Tvec& a, const Tvec& b, Tp* ptr)  \\\n{                                                                           \\\n    vsx_stf(vec_mergeh(a, b), 0, ptr);                                      \\\n    vsx_stf(vec_mergel(a, b), 16, ptr);                                     \\\n}                                                                           \\\nVSX_FINLINE(void) vec_st_interleave(const Tvec& a, const Tvec& b,           \\\n                                     const Tvec& c, const Tvec& d, Tp* ptr) \\\n{                                                                           \\\n    Tvec ac = vec_mergeh(a, c);                                             \\\n    Tvec bd = vec_mergeh(b, d);                                             \\\n    vsx_stf(vec_mergeh(ac, bd), 0, ptr);                                    \\\n    vsx_stf(vec_mergel(ac, bd), 16, ptr);                                   \\\n    ac = vec_mergel(a, c);                                                  \\\n    bd = vec_mergel(b, d);                                                  \\\n    vsx_stf(vec_mergeh(ac, bd), 32, ptr);                                   \\\n    vsx_stf(vec_mergel(ac, bd), 48, ptr);                                   \\\n}\nVSX_IMPL_ST_INTERLEAVE(uchar,  vec_uchar16)\nVSX_IMPL_ST_INTERLEAVE(schar,  vec_char16)\nVSX_IMPL_ST_INTERLEAVE(ushort, vec_ushort8)\nVSX_IMPL_ST_INTERLEAVE(short,  vec_short8)\nVSX_IMPL_ST_INTERLEAVE(uint,   vec_uint4)\nVSX_IMPL_ST_INTERLEAVE(int,    vec_int4)\nVSX_IMPL_ST_INTERLEAVE(float,  vec_float4)\n\n// 2 and 4 channels deinterleave for 16 lanes\n#define VSX_IMPL_ST_DINTERLEAVE_8(Tp, Tvec)                                 \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b)      \\\n{                                                                           \\\n    Tvec v0 = vsx_ld(0, ptr);                                               \\\n    Tvec v1 = vsx_ld(16, ptr);                                              \\\n    a = vec_mergesqe(v0, v1);                                               \\\n    b = vec_mergesqo(v0, v1);                                               \\\n}                                                                           \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b,      \\\n                                       Tvec& c, Tvec& d)                    \\\n{                                                                           \\\n    Tvec v0 = vsx_ld(0, ptr);                                               \\\n    Tvec v1 = vsx_ld(16, ptr);                                              \\\n    Tvec v2 = vsx_ld(32, ptr);                                              \\\n    Tvec v3 = vsx_ld(48, ptr);                                              \\\n    Tvec m0 = vec_mergesqe(v0, v1);                                         \\\n    Tvec m1 = vec_mergesqe(v2, v3);                                         \\\n    a = vec_mergesqe(m0, m1);                                               \\\n    c = vec_mergesqo(m0, m1);                                               \\\n    m0 = vec_mergesqo(v0, v1);                                              \\\n    m1 = vec_mergesqo(v2, v3);                                              \\\n    b = vec_mergesqe(m0, m1);                                               \\\n    d = vec_mergesqo(m0, m1);                                               \\\n}\nVSX_IMPL_ST_DINTERLEAVE_8(uchar, vec_uchar16)\nVSX_IMPL_ST_DINTERLEAVE_8(schar, vec_char16)\n\n// 2 and 4 channels deinterleave for 8 lanes\n#define VSX_IMPL_ST_DINTERLEAVE_16(Tp, Tvec)                                \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b)      \\\n{                                                                           \\\n    Tvec v0 = vsx_ld(0, ptr);                                               \\\n    Tvec v1 = vsx_ld(8, ptr);                                               \\\n    a = vec_mergesqe(v0, v1);                                               \\\n    b = vec_mergesqo(v0, v1);                                               \\\n}                                                                           \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b,      \\\n                                       Tvec& c, Tvec& d)                    \\\n{                                                                           \\\n    Tvec v0 = vsx_ld(0, ptr);                                               \\\n    Tvec v1 = vsx_ld(8, ptr);                                               \\\n    Tvec m0 = vec_mergeh(v0, v1);                                           \\\n    Tvec m1 = vec_mergel(v0, v1);                                           \\\n    Tvec ab0 = vec_mergeh(m0, m1);                                          \\\n    Tvec cd0 = vec_mergel(m0, m1);                                          \\\n    v0 = vsx_ld(16, ptr);                                                   \\\n    v1 = vsx_ld(24, ptr);                                                   \\\n    m0 = vec_mergeh(v0, v1);                                                \\\n    m1 = vec_mergel(v0, v1);                                                \\\n    Tvec ab1 = vec_mergeh(m0, m1);                                          \\\n    Tvec cd1 = vec_mergel(m0, m1);                                          \\\n    a = vec_mergesqh(ab0, ab1);                                             \\\n    b = vec_mergesql(ab0, ab1);                                             \\\n    c = vec_mergesqh(cd0, cd1);                                             \\\n    d = vec_mergesql(cd0, cd1);                                             \\\n}\nVSX_IMPL_ST_DINTERLEAVE_16(ushort, vec_ushort8)\nVSX_IMPL_ST_DINTERLEAVE_16(short,  vec_short8)\n\n// 2 and 4 channels deinterleave for 4 lanes\n#define VSX_IMPL_ST_DINTERLEAVE_32(Tp, Tvec)                                \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b)      \\\n{                                                                           \\\n    a = vsx_ld(0, ptr);                                                     \\\n    b = vsx_ld(4, ptr);                                                     \\\n    Tvec m0 = vec_mergeh(a, b);                                             \\\n    Tvec m1 = vec_mergel(a, b);                                             \\\n    a = vec_mergeh(m0, m1);                                                 \\\n    b = vec_mergel(m0, m1);                                                 \\\n}                                                                           \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b,      \\\n                                       Tvec& c, Tvec& d)                    \\\n{                                                                           \\\n    Tvec v0 = vsx_ld(0, ptr);                                               \\\n    Tvec v1 = vsx_ld(4, ptr);                                               \\\n    Tvec v2 = vsx_ld(8, ptr);                                               \\\n    Tvec v3 = vsx_ld(12, ptr);                                              \\\n    Tvec m0 = vec_mergeh(v0, v2);                                           \\\n    Tvec m1 = vec_mergeh(v1, v3);                                           \\\n    a = vec_mergeh(m0, m1);                                                 \\\n    b = vec_mergel(m0, m1);                                                 \\\n    m0 = vec_mergel(v0, v2);                                                \\\n    m1 = vec_mergel(v1, v3);                                                \\\n    c = vec_mergeh(m0, m1);                                                 \\\n    d = vec_mergel(m0, m1);                                                 \\\n}\nVSX_IMPL_ST_DINTERLEAVE_32(uint,  vec_uint4)\nVSX_IMPL_ST_DINTERLEAVE_32(int,   vec_int4)\nVSX_IMPL_ST_DINTERLEAVE_32(float, vec_float4)\n\n// 2 and 4 channels interleave and deinterleave for 2 lanes\n#define VSX_IMPL_ST_D_INTERLEAVE_64(Tp, Tvec, ld_func, st_func)             \\\nVSX_FINLINE(void) vec_st_interleave(const Tvec& a, const Tvec& b, Tp* ptr)  \\\n{                                                                           \\\n    st_func(vec_mergeh(a, b), 0, ptr);                                      \\\n    st_func(vec_mergel(a, b), 2, ptr);                                      \\\n}                                                                           \\\nVSX_FINLINE(void) vec_st_interleave(const Tvec& a, const Tvec& b,           \\\n                                     const Tvec& c, const Tvec& d, Tp* ptr) \\\n{                                                                           \\\n    st_func(vec_mergeh(a, b), 0, ptr);                                      \\\n    st_func(vec_mergeh(c, d), 2, ptr);                                      \\\n    st_func(vec_mergel(a, b), 4, ptr);                                      \\\n    st_func(vec_mergel(c, d), 6, ptr);                                      \\\n}                                                                           \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b)      \\\n{                                                                           \\\n    Tvec m0 = ld_func(0, ptr);                                              \\\n    Tvec m1 = ld_func(2, ptr);                                              \\\n    a = vec_mergeh(m0, m1);                                                 \\\n    b = vec_mergel(m0, m1);                                                 \\\n}                                                                           \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b,      \\\n                                       Tvec& c, Tvec& d)                    \\\n{                                                                           \\\n    Tvec v0 = ld_func(0, ptr);                                              \\\n    Tvec v1 = ld_func(2, ptr);                                              \\\n    Tvec v2 = ld_func(4, ptr);                                              \\\n    Tvec v3 = ld_func(6, ptr);                                              \\\n    a = vec_mergeh(v0, v2);                                                 \\\n    b = vec_mergel(v0, v2);                                                 \\\n    c = vec_mergeh(v1, v3);                                                 \\\n    d = vec_mergel(v1, v3);                                                 \\\n}\nVSX_IMPL_ST_D_INTERLEAVE_64(int64,  vec_dword2,  vsx_ld2, vsx_st2)\nVSX_IMPL_ST_D_INTERLEAVE_64(uint64, vec_udword2, vsx_ld2, vsx_st2)\nVSX_IMPL_ST_D_INTERLEAVE_64(double, vec_double2, vsx_ld,  vsx_st)\n\n/* 3 channels */\n#define VSX_IMPL_ST_INTERLEAVE_3CH_16(Tp, Tvec)                                                   \\\nVSX_FINLINE(void) vec_st_interleave(const Tvec& a, const Tvec& b,                                 \\\n                                     const Tvec& c, Tp* ptr)                                      \\\n{                                                                                                 \\\n    static const vec_uchar16 a12 = {0, 16, 0, 1, 17, 0, 2, 18, 0, 3, 19, 0, 4, 20, 0, 5};         \\\n    static const vec_uchar16 a123 = {0, 1, 16, 3, 4, 17, 6, 7, 18, 9, 10, 19, 12, 13, 20, 15};    \\\n    vsx_st(vec_perm(vec_perm(a, b, a12), c, a123), 0, ptr);                                       \\\n    static const vec_uchar16 b12 = {21, 0, 6, 22, 0, 7, 23, 0, 8, 24, 0, 9, 25, 0, 10, 26};       \\\n    static const vec_uchar16 b123 = {0, 21, 2, 3, 22, 5, 6, 23, 8, 9, 24, 11, 12, 25, 14, 15};    \\\n    vsx_st(vec_perm(vec_perm(a, b, b12), c, b123), 16, ptr);                                      \\\n    static const vec_uchar16 c12 = {0, 11, 27, 0, 12, 28, 0, 13, 29, 0, 14, 30, 0, 15, 31, 0};    \\\n    static const vec_uchar16 c123 = {26, 1, 2, 27, 4, 5, 28, 7, 8, 29, 10, 11, 30, 13, 14, 31};   \\\n    vsx_st(vec_perm(vec_perm(a, b, c12), c, c123), 32, ptr);                                      \\\n}                                                                                                 \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b, Tvec& c)                   \\\n{                                                                                                 \\\n    Tvec v1 = vsx_ld(0, ptr);                                                                     \\\n    Tvec v2 = vsx_ld(16, ptr);                                                                    \\\n    Tvec v3 = vsx_ld(32, ptr);                                                                    \\\n    static const vec_uchar16 a12_perm = {0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 0, 0, 0, 0, 0};  \\\n    static const vec_uchar16 a123_perm = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 17, 20, 23, 26, 29};  \\\n    a = vec_perm(vec_perm(v1, v2, a12_perm), v3, a123_perm);                                      \\\n    static const vec_uchar16 b12_perm = {1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 0, 0, 0, 0, 0}; \\\n    static const vec_uchar16 b123_perm = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 18, 21, 24, 27, 30};  \\\n    b = vec_perm(vec_perm(v1, v2, b12_perm), v3, b123_perm);                                      \\\n    static const vec_uchar16 c12_perm = {2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 0, 0, 0, 0, 0, 0};  \\\n    static const vec_uchar16 c123_perm = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16, 19, 22, 25, 28, 31};  \\\n    c = vec_perm(vec_perm(v1, v2, c12_perm), v3, c123_perm);                                      \\\n}\nVSX_IMPL_ST_INTERLEAVE_3CH_16(uchar, vec_uchar16)\nVSX_IMPL_ST_INTERLEAVE_3CH_16(schar, vec_char16)\n\n#define VSX_IMPL_ST_INTERLEAVE_3CH_8(Tp, Tvec)                                                    \\\nVSX_FINLINE(void) vec_st_interleave(const Tvec& a, const Tvec& b,                                 \\\n                                     const Tvec& c, Tp* ptr)                                      \\\n{                                                                                                 \\\n    static const vec_uchar16 a12 = {0, 1, 16, 17, 0, 0, 2, 3, 18, 19, 0, 0, 4, 5, 20, 21};        \\\n    static const vec_uchar16 a123 = {0, 1, 2, 3, 16, 17, 6, 7, 8, 9, 18, 19, 12, 13, 14, 15};     \\\n    vsx_st(vec_perm(vec_perm(a, b, a12), c, a123), 0, ptr);                                       \\\n    static const vec_uchar16 b12 = {0, 0, 6, 7, 22, 23, 0, 0, 8, 9, 24, 25, 0, 0, 10, 11};        \\\n    static const vec_uchar16 b123 = {20, 21, 2, 3, 4, 5, 22, 23, 8, 9, 10, 11, 24, 25, 14, 15};   \\\n    vsx_st(vec_perm(vec_perm(a, b, b12), c, b123), 8, ptr);                                       \\\n    static const vec_uchar16 c12 = {26, 27, 0, 0, 12, 13, 28, 29, 0, 0, 14, 15, 30, 31, 0, 0};    \\\n    static const vec_uchar16 c123 = {0, 1, 26, 27, 4, 5, 6, 7, 28, 29, 10, 11, 12, 13, 30, 31};   \\\n    vsx_st(vec_perm(vec_perm(a, b, c12), c, c123), 16, ptr);                                      \\\n}                                                                                                 \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b, Tvec& c)                   \\\n{                                                                                                 \\\n    Tvec v1 = vsx_ld(0, ptr);                                                                     \\\n    Tvec v2 = vsx_ld(8, ptr);                                                                     \\\n    Tvec v3 = vsx_ld(16, ptr);                                                                    \\\n    static const vec_uchar16 a12_perm = {0, 1, 6, 7, 12, 13, 18, 19, 24, 25, 30, 31, 0, 0, 0, 0}; \\\n    static const vec_uchar16 a123_perm = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 26, 27};  \\\n    a = vec_perm(vec_perm(v1, v2, a12_perm), v3, a123_perm);                                      \\\n    static const vec_uchar16 b12_perm = {2, 3, 8, 9, 14, 15, 20, 21, 26, 27, 0, 0, 0, 0, 0, 0};   \\\n    static const vec_uchar16 b123_perm = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16, 17, 22, 23, 28, 29};  \\\n    b = vec_perm(vec_perm(v1, v2, b12_perm), v3, b123_perm);                                      \\\n    static const vec_uchar16 c12_perm = {4, 5, 10, 11, 16, 17, 22, 23, 28, 29, 0, 0, 0, 0, 0, 0}; \\\n    static const vec_uchar16 c123_perm = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 18, 19, 24, 25, 30, 31};  \\\n    c = vec_perm(vec_perm(v1, v2, c12_perm), v3, c123_perm);                                      \\\n}\nVSX_IMPL_ST_INTERLEAVE_3CH_8(ushort, vec_ushort8)\nVSX_IMPL_ST_INTERLEAVE_3CH_8(short,  vec_short8)\n\n#define VSX_IMPL_ST_INTERLEAVE_3CH_4(Tp, Tvec)                                                     \\\nVSX_FINLINE(void) vec_st_interleave(const Tvec& a, const Tvec& b,                                  \\\n                                     const Tvec& c, Tp* ptr)                                       \\\n{                                                                                                  \\\n    Tvec hbc = vec_mergeh(b, c);                                                                   \\\n    static const vec_uchar16 ahbc = {0, 1, 2, 3, 16, 17, 18, 19, 20, 21, 22, 23, 4, 5, 6, 7};      \\\n    vsx_st(vec_perm(a, hbc, ahbc), 0, ptr);                                                        \\\n    Tvec lab = vec_mergel(a, b);                                                                   \\\n    vsx_st(vec_sld(lab, hbc, 8), 4, ptr);                                                          \\\n    static const vec_uchar16 clab = {8, 9, 10, 11, 24, 25, 26, 27, 28, 29, 30, 31, 12, 13, 14, 15};\\\n    vsx_st(vec_perm(c, lab, clab), 8, ptr);                                                        \\\n}                                                                                                  \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a, Tvec& b, Tvec& c)                    \\\n{                                                                                                  \\\n    Tvec v1 = vsx_ld(0, ptr);                                                                      \\\n    Tvec v2 = vsx_ld(4, ptr);                                                                      \\\n    Tvec v3 = vsx_ld(8, ptr);                                                                      \\\n    static const vec_uchar16 flp = {0, 1, 2, 3, 12, 13, 14, 15, 16, 17, 18, 19, 28, 29, 30, 31};   \\\n    a = vec_perm(v1, vec_sld(v3, v2, 8), flp);                                                     \\\n    static const vec_uchar16 flp2 = {28, 29, 30, 31, 0, 1, 2, 3, 12, 13, 14, 15, 16, 17, 18, 19};  \\\n    b = vec_perm(v2, vec_sld(v1, v3, 8), flp2);                                                    \\\n    c = vec_perm(vec_sld(v2, v1, 8), v3, flp);                                                     \\\n}\nVSX_IMPL_ST_INTERLEAVE_3CH_4(uint,  vec_uint4)\nVSX_IMPL_ST_INTERLEAVE_3CH_4(int,   vec_int4)\nVSX_IMPL_ST_INTERLEAVE_3CH_4(float, vec_float4)\n\n#define VSX_IMPL_ST_INTERLEAVE_3CH_2(Tp, Tvec, ld_func, st_func)     \\\nVSX_FINLINE(void) vec_st_interleave(const Tvec& a, const Tvec& b,    \\\n                                     const Tvec& c, Tp* ptr)         \\\n{                                                                    \\\n    st_func(vec_mergeh(a, b), 0, ptr);                               \\\n    st_func(vec_permi(c, a, 1), 2, ptr);                             \\\n    st_func(vec_mergel(b, c), 4, ptr);                               \\\n}                                                                    \\\nVSX_FINLINE(void) vec_ld_deinterleave(const Tp* ptr, Tvec& a,        \\\n                                       Tvec& b, Tvec& c)             \\\n{                                                                    \\\n    Tvec v1 = ld_func(0, ptr);                                       \\\n    Tvec v2 = ld_func(2, ptr);                                       \\\n    Tvec v3 = ld_func(4, ptr);                                       \\\n    a = vec_permi(v1, v2, 1);                                        \\\n    b = vec_permi(v1, v3, 2);                                        \\\n    c = vec_permi(v2, v3, 1);                                        \\\n}\nVSX_IMPL_ST_INTERLEAVE_3CH_2(int64,  vec_dword2,  vsx_ld2, vsx_st2)\nVSX_IMPL_ST_INTERLEAVE_3CH_2(uint64, vec_udword2, vsx_ld2, vsx_st2)\nVSX_IMPL_ST_INTERLEAVE_3CH_2(double, vec_double2, vsx_ld,  vsx_st)\n\n#endif // CV_VSX\n\n//! @}\n\n#endif // OPENCV_HAL_VSX_UTILS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/core.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2015, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2015, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2015, Itseez Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_CORE_HPP\n#define OPENCV_CORE_HPP\n\n#ifndef __cplusplus\n#  error core.hpp header must be compiled as C++\n#endif\n\n#include \"opencv2/core/cvdef.h\"\n#include \"opencv2/core/base.hpp\"\n#include \"opencv2/core/cvstd.hpp\"\n#include \"opencv2/core/traits.hpp\"\n#include \"opencv2/core/matx.hpp\"\n#include \"opencv2/core/types.hpp\"\n#include \"opencv2/core/mat.hpp\"\n#include \"opencv2/core/persistence.hpp\"\n\n/**\n@defgroup core Core functionality\n@{\n    @defgroup core_basic Basic structures\n    @defgroup core_c C structures and operations\n    @{\n        @defgroup core_c_glue Connections with C++\n    @}\n    @defgroup core_array Operations on arrays\n    @defgroup core_async Asynchronous API\n    @defgroup core_xml XML/YAML Persistence\n    @defgroup core_cluster Clustering\n    @defgroup core_utils Utility and system functions and macros\n    @{\n        @defgroup core_logging Logging facilities\n        @defgroup core_utils_sse SSE utilities\n        @defgroup core_utils_neon NEON utilities\n        @defgroup core_utils_vsx VSX utilities\n        @defgroup core_utils_softfloat Softfloat support\n        @defgroup core_utils_samples Utility functions for OpenCV samples\n    @}\n    @defgroup core_opengl OpenGL interoperability\n    @defgroup core_ipp Intel IPP Asynchronous C/C++ Converters\n    @defgroup core_optim Optimization Algorithms\n    @defgroup core_directx DirectX interoperability\n    @defgroup core_eigen Eigen support\n    @defgroup core_opencl OpenCL support\n    @defgroup core_va_intel Intel VA-API/OpenCL (CL-VA) interoperability\n    @defgroup core_hal Hardware Acceleration Layer\n    @{\n        @defgroup core_hal_functions Functions\n        @defgroup core_hal_interface Interface\n        @defgroup core_hal_intrin Universal intrinsics\n        @{\n            @defgroup core_hal_intrin_impl Private implementation helpers\n        @}\n        @defgroup core_lowlevel_api Low-level API for external libraries / plugins\n    @}\n    @defgroup core_parallel Parallel Processing\n    @{\n        @defgroup core_parallel_backend Parallel backends API\n    @}\n@}\n */\n\nnamespace cv {\n\n//! @addtogroup core_utils\n//! @{\n\n/*! @brief Class passed to an error.\n\nThis class encapsulates all or almost all necessary\ninformation about the error happened in the program. The exception is\nusually constructed and thrown implicitly via CV_Error and CV_Error_ macros.\n@see error\n */\nclass CV_EXPORTS Exception : public std::exception\n{\npublic:\n    /*!\n     Default constructor\n     */\n    Exception();\n    /*!\n     Full constructor. Normally the constructor is not called explicitly.\n     Instead, the macros CV_Error(), CV_Error_() and CV_Assert() are used.\n    */\n    Exception(int _code, const String& _err, const String& _func, const String& _file, int _line);\n    virtual ~Exception() throw();\n\n    /*!\n     \\return the error description and the context as a text string.\n    */\n    virtual const char *what() const throw() CV_OVERRIDE;\n    void formatMessage();\n\n    String msg; ///< the formatted error message\n\n    int code; ///< error code @see CVStatus\n    String err; ///< error description\n    String func; ///< function name. Available only when the compiler supports getting it\n    String file; ///< source file name where the error has occurred\n    int line; ///< line number in the source file where the error has occurred\n};\n\n/*! @brief Signals an error and raises the exception.\n\nBy default the function prints information about the error to stderr,\nthen it either stops if cv::setBreakOnError() had been called before or raises the exception.\nIt is possible to alternate error processing by using #redirectError().\n@param exc the exception raisen.\n@deprecated drop this version\n */\nCV_EXPORTS CV_NORETURN void error(const Exception& exc);\n\nenum SortFlags { SORT_EVERY_ROW    = 0, //!< each matrix row is sorted independently\n                 SORT_EVERY_COLUMN = 1, //!< each matrix column is sorted\n                                        //!< independently; this flag and the previous one are\n                                        //!< mutually exclusive.\n                 SORT_ASCENDING    = 0, //!< each matrix row is sorted in the ascending\n                                        //!< order.\n                 SORT_DESCENDING   = 16 //!< each matrix row is sorted in the\n                                        //!< descending order; this flag and the previous one are also\n                                        //!< mutually exclusive.\n               };\n\n//! @} core_utils\n\n//! @addtogroup core\n//! @{\n\n//! Covariation flags\nenum CovarFlags {\n    /** The output covariance matrix is calculated as:\n       \\f[\\texttt{scale}   \\cdot  [  \\texttt{vects}  [0]-  \\texttt{mean}  , \\texttt{vects}  [1]-  \\texttt{mean}  ,...]^T  \\cdot  [ \\texttt{vects}  [0]- \\texttt{mean}  , \\texttt{vects}  [1]- \\texttt{mean}  ,...],\\f]\n       The covariance matrix will be nsamples x nsamples. Such an unusual covariance matrix is used\n       for fast PCA of a set of very large vectors (see, for example, the EigenFaces technique for\n       face recognition). Eigenvalues of this \"scrambled\" matrix match the eigenvalues of the true\n       covariance matrix. The \"true\" eigenvectors can be easily calculated from the eigenvectors of\n       the \"scrambled\" covariance matrix. */\n    COVAR_SCRAMBLED = 0,\n    /**The output covariance matrix is calculated as:\n        \\f[\\texttt{scale}   \\cdot  [  \\texttt{vects}  [0]-  \\texttt{mean}  , \\texttt{vects}  [1]-  \\texttt{mean}  ,...]  \\cdot  [ \\texttt{vects}  [0]- \\texttt{mean}  , \\texttt{vects}  [1]- \\texttt{mean}  ,...]^T,\\f]\n        covar will be a square matrix of the same size as the total number of elements in each input\n        vector. One and only one of #COVAR_SCRAMBLED and #COVAR_NORMAL must be specified.*/\n    COVAR_NORMAL    = 1,\n    /** If the flag is specified, the function does not calculate mean from\n        the input vectors but, instead, uses the passed mean vector. This is useful if mean has been\n        pre-calculated or known in advance, or if the covariance matrix is calculated by parts. In\n        this case, mean is not a mean vector of the input sub-set of vectors but rather the mean\n        vector of the whole set.*/\n    COVAR_USE_AVG   = 2,\n    /** If the flag is specified, the covariance matrix is scaled. In the\n        \"normal\" mode, scale is 1./nsamples . In the \"scrambled\" mode, scale is the reciprocal of the\n        total number of elements in each input vector. By default (if the flag is not specified), the\n        covariance matrix is not scaled ( scale=1 ).*/\n    COVAR_SCALE     = 4,\n    /** If the flag is\n        specified, all the input vectors are stored as rows of the samples matrix. mean should be a\n        single-row vector in this case.*/\n    COVAR_ROWS      = 8,\n    /** If the flag is\n        specified, all the input vectors are stored as columns of the samples matrix. mean should be a\n        single-column vector in this case.*/\n    COVAR_COLS      = 16\n};\n\n//! @addtogroup core_cluster\n//!  @{\n\n//! k-Means flags\nenum KmeansFlags {\n    /** Select random initial centers in each attempt.*/\n    KMEANS_RANDOM_CENTERS     = 0,\n    /** Use kmeans++ center initialization by Arthur and Vassilvitskii [Arthur2007].*/\n    KMEANS_PP_CENTERS         = 2,\n    /** During the first (and possibly the only) attempt, use the\n        user-supplied labels instead of computing them from the initial centers. For the second and\n        further attempts, use the random or semi-random centers. Use one of KMEANS_\\*_CENTERS flag\n        to specify the exact method.*/\n    KMEANS_USE_INITIAL_LABELS = 1\n};\n\n//! @} core_cluster\n\n//! @addtogroup core_array\n//! @{\n\nenum ReduceTypes { REDUCE_SUM = 0, //!< the output is the sum of all rows/columns of the matrix.\n                   REDUCE_AVG = 1, //!< the output is the mean vector of all rows/columns of the matrix.\n                   REDUCE_MAX = 2, //!< the output is the maximum (column/row-wise) of all rows/columns of the matrix.\n                   REDUCE_MIN = 3  //!< the output is the minimum (column/row-wise) of all rows/columns of the matrix.\n                 };\n\n//! @} core_array\n\n/** @brief Swaps two matrices\n*/\nCV_EXPORTS void swap(Mat& a, Mat& b);\n/** @overload */\nCV_EXPORTS void swap( UMat& a, UMat& b );\n\n//! @} core\n\n//! @addtogroup core_array\n//! @{\n\n/** @brief Computes the source location of an extrapolated pixel.\n\nThe function computes and returns the coordinate of a donor pixel corresponding to the specified\nextrapolated pixel when using the specified extrapolation border mode. For example, if you use\ncv::BORDER_WRAP mode in the horizontal direction, cv::BORDER_REFLECT_101 in the vertical direction and\nwant to compute value of the \"virtual\" pixel Point(-5, 100) in a floating-point image img , it\nlooks like:\n@code{.cpp}\n    float val = img.at<float>(borderInterpolate(100, img.rows, cv::BORDER_REFLECT_101),\n                              borderInterpolate(-5, img.cols, cv::BORDER_WRAP));\n@endcode\nNormally, the function is not called directly. It is used inside filtering functions and also in\ncopyMakeBorder.\n@param p 0-based coordinate of the extrapolated pixel along one of the axes, likely \\<0 or \\>= len\n@param len Length of the array along the corresponding axis.\n@param borderType Border type, one of the #BorderTypes, except for #BORDER_TRANSPARENT and\n#BORDER_ISOLATED . When borderType==#BORDER_CONSTANT , the function always returns -1, regardless\nof p and len.\n\n@sa copyMakeBorder\n*/\nCV_EXPORTS_W int borderInterpolate(int p, int len, int borderType);\n\n/** @example samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp\nAn example using copyMakeBorder function.\nCheck @ref tutorial_copyMakeBorder \"the corresponding tutorial\" for more details\n*/\n\n/** @brief Forms a border around an image.\n\nThe function copies the source image into the middle of the destination image. The areas to the\nleft, to the right, above and below the copied source image will be filled with extrapolated\npixels. This is not what filtering functions based on it do (they extrapolate pixels on-fly), but\nwhat other more complex functions, including your own, may do to simplify image boundary handling.\n\nThe function supports the mode when src is already in the middle of dst . In this case, the\nfunction does not copy src itself but simply constructs the border, for example:\n\n@code{.cpp}\n    // let border be the same in all directions\n    int border=2;\n    // constructs a larger image to fit both the image and the border\n    Mat gray_buf(rgb.rows + border*2, rgb.cols + border*2, rgb.depth());\n    // select the middle part of it w/o copying data\n    Mat gray(gray_canvas, Rect(border, border, rgb.cols, rgb.rows));\n    // convert image from RGB to grayscale\n    cvtColor(rgb, gray, COLOR_RGB2GRAY);\n    // form a border in-place\n    copyMakeBorder(gray, gray_buf, border, border,\n                   border, border, BORDER_REPLICATE);\n    // now do some custom filtering ...\n    ...\n@endcode\n@note When the source image is a part (ROI) of a bigger image, the function will try to use the\npixels outside of the ROI to form a border. To disable this feature and always do extrapolation, as\nif src was not a ROI, use borderType | #BORDER_ISOLATED.\n\n@param src Source image.\n@param dst Destination image of the same type as src and the size Size(src.cols+left+right,\nsrc.rows+top+bottom) .\n@param top the top pixels\n@param bottom the bottom pixels\n@param left the left pixels\n@param right Parameter specifying how many pixels in each direction from the source image rectangle\nto extrapolate. For example, top=1, bottom=1, left=1, right=1 mean that 1 pixel-wide border needs\nto be built.\n@param borderType Border type. See borderInterpolate for details.\n@param value Border value if borderType==BORDER_CONSTANT .\n\n@sa  borderInterpolate\n*/\nCV_EXPORTS_W void copyMakeBorder(InputArray src, OutputArray dst,\n                                 int top, int bottom, int left, int right,\n                                 int borderType, const Scalar& value = Scalar() );\n\n/** @brief Calculates the per-element sum of two arrays or an array and a scalar.\n\nThe function add calculates:\n- Sum of two arrays when both input arrays have the same size and the same number of channels:\n\\f[\\texttt{dst}(I) =  \\texttt{saturate} ( \\texttt{src1}(I) +  \\texttt{src2}(I)) \\quad \\texttt{if mask}(I) \\ne0\\f]\n- Sum of an array and a scalar when src2 is constructed from Scalar or has the same number of\nelements as `src1.channels()`:\n\\f[\\texttt{dst}(I) =  \\texttt{saturate} ( \\texttt{src1}(I) +  \\texttt{src2} ) \\quad \\texttt{if mask}(I) \\ne0\\f]\n- Sum of a scalar and an array when src1 is constructed from Scalar or has the same number of\nelements as `src2.channels()`:\n\\f[\\texttt{dst}(I) =  \\texttt{saturate} ( \\texttt{src1} +  \\texttt{src2}(I) ) \\quad \\texttt{if mask}(I) \\ne0\\f]\nwhere `I` is a multi-dimensional index of array elements. In case of multi-channel arrays, each\nchannel is processed independently.\n\nThe first function in the list above can be replaced with matrix expressions:\n@code{.cpp}\n    dst = src1 + src2;\n    dst += src1; // equivalent to add(dst, src1, dst);\n@endcode\nThe input arrays and the output array can all have the same or different depths. For example, you\ncan add a 16-bit unsigned array to a 8-bit signed array and store the sum as a 32-bit\nfloating-point array. Depth of the output array is determined by the dtype parameter. In the second\nand third cases above, as well as in the first case, when src1.depth() == src2.depth(), dtype can\nbe set to the default -1. In this case, the output array will have the same depth as the input\narray, be it src1, src2 or both.\n@note Saturation is not applied when the output array has the depth CV_32S. You may even get\nresult of an incorrect sign in the case of overflow.\n@param src1 first input array or a scalar.\n@param src2 second input array or a scalar.\n@param dst output array that has the same size and number of channels as the input array(s); the\ndepth is defined by dtype or src1/src2.\n@param mask optional operation mask - 8-bit single channel array, that specifies elements of the\noutput array to be changed.\n@param dtype optional depth of the output array (see the discussion below).\n@sa subtract, addWeighted, scaleAdd, Mat::convertTo\n*/\nCV_EXPORTS_W void add(InputArray src1, InputArray src2, OutputArray dst,\n                      InputArray mask = noArray(), int dtype = -1);\n\n/** @brief Calculates the per-element difference between two arrays or array and a scalar.\n\nThe function subtract calculates:\n- Difference between two arrays, when both input arrays have the same size and the same number of\nchannels:\n    \\f[\\texttt{dst}(I) =  \\texttt{saturate} ( \\texttt{src1}(I) -  \\texttt{src2}(I)) \\quad \\texttt{if mask}(I) \\ne0\\f]\n- Difference between an array and a scalar, when src2 is constructed from Scalar or has the same\nnumber of elements as `src1.channels()`:\n    \\f[\\texttt{dst}(I) =  \\texttt{saturate} ( \\texttt{src1}(I) -  \\texttt{src2} ) \\quad \\texttt{if mask}(I) \\ne0\\f]\n- Difference between a scalar and an array, when src1 is constructed from Scalar or has the same\nnumber of elements as `src2.channels()`:\n    \\f[\\texttt{dst}(I) =  \\texttt{saturate} ( \\texttt{src1} -  \\texttt{src2}(I) ) \\quad \\texttt{if mask}(I) \\ne0\\f]\n- The reverse difference between a scalar and an array in the case of `SubRS`:\n    \\f[\\texttt{dst}(I) =  \\texttt{saturate} ( \\texttt{src2} -  \\texttt{src1}(I) ) \\quad \\texttt{if mask}(I) \\ne0\\f]\nwhere I is a multi-dimensional index of array elements. In case of multi-channel arrays, each\nchannel is processed independently.\n\nThe first function in the list above can be replaced with matrix expressions:\n@code{.cpp}\n    dst = src1 - src2;\n    dst -= src1; // equivalent to subtract(dst, src1, dst);\n@endcode\nThe input arrays and the output array can all have the same or different depths. For example, you\ncan subtract to 8-bit unsigned arrays and store the difference in a 16-bit signed array. Depth of\nthe output array is determined by dtype parameter. In the second and third cases above, as well as\nin the first case, when src1.depth() == src2.depth(), dtype can be set to the default -1. In this\ncase the output array will have the same depth as the input array, be it src1, src2 or both.\n@note Saturation is not applied when the output array has the depth CV_32S. You may even get\nresult of an incorrect sign in the case of overflow.\n@param src1 first input array or a scalar.\n@param src2 second input array or a scalar.\n@param dst output array of the same size and the same number of channels as the input array.\n@param mask optional operation mask; this is an 8-bit single channel array that specifies elements\nof the output array to be changed.\n@param dtype optional depth of the output array\n@sa  add, addWeighted, scaleAdd, Mat::convertTo\n  */\nCV_EXPORTS_W void subtract(InputArray src1, InputArray src2, OutputArray dst,\n                           InputArray mask = noArray(), int dtype = -1);\n\n\n/** @brief Calculates the per-element scaled product of two arrays.\n\nThe function multiply calculates the per-element product of two arrays:\n\n\\f[\\texttt{dst} (I)= \\texttt{saturate} ( \\texttt{scale} \\cdot \\texttt{src1} (I)  \\cdot \\texttt{src2} (I))\\f]\n\nThere is also a @ref MatrixExpressions -friendly variant of the first function. See Mat::mul .\n\nFor a not-per-element matrix product, see gemm .\n\n@note Saturation is not applied when the output array has the depth\nCV_32S. You may even get result of an incorrect sign in the case of\noverflow.\n@param src1 first input array.\n@param src2 second input array of the same size and the same type as src1.\n@param dst output array of the same size and type as src1.\n@param scale optional scale factor.\n@param dtype optional depth of the output array\n@sa add, subtract, divide, scaleAdd, addWeighted, accumulate, accumulateProduct, accumulateSquare,\nMat::convertTo\n*/\nCV_EXPORTS_W void multiply(InputArray src1, InputArray src2,\n                           OutputArray dst, double scale = 1, int dtype = -1);\n\n/** @brief Performs per-element division of two arrays or a scalar by an array.\n\nThe function cv::divide divides one array by another:\n\\f[\\texttt{dst(I) = saturate(src1(I)*scale/src2(I))}\\f]\nor a scalar by an array when there is no src1 :\n\\f[\\texttt{dst(I) = saturate(scale/src2(I))}\\f]\n\nDifferent channels of multi-channel arrays are processed independently.\n\nFor integer types when src2(I) is zero, dst(I) will also be zero.\n\n@note In case of floating point data there is no special defined behavior for zero src2(I) values.\nRegular floating-point division is used.\nExpect correct IEEE-754 behaviour for floating-point data (with NaN, Inf result values).\n\n@note Saturation is not applied when the output array has the depth CV_32S. You may even get\nresult of an incorrect sign in the case of overflow.\n@param src1 first input array.\n@param src2 second input array of the same size and type as src1.\n@param scale scalar factor.\n@param dst output array of the same size and type as src2.\n@param dtype optional depth of the output array; if -1, dst will have depth src2.depth(), but in\ncase of an array-by-array division, you can only pass -1 when src1.depth()==src2.depth().\n@sa  multiply, add, subtract\n*/\nCV_EXPORTS_W void divide(InputArray src1, InputArray src2, OutputArray dst,\n                         double scale = 1, int dtype = -1);\n\n/** @overload */\nCV_EXPORTS_W void divide(double scale, InputArray src2,\n                         OutputArray dst, int dtype = -1);\n\n/** @brief Calculates the sum of a scaled array and another array.\n\nThe function scaleAdd is one of the classical primitive linear algebra operations, known as DAXPY\nor SAXPY in [BLAS](http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms). It calculates\nthe sum of a scaled array and another array:\n\\f[\\texttt{dst} (I)= \\texttt{scale} \\cdot \\texttt{src1} (I) +  \\texttt{src2} (I)\\f]\nThe function can also be emulated with a matrix expression, for example:\n@code{.cpp}\n    Mat A(3, 3, CV_64F);\n    ...\n    A.row(0) = A.row(1)*2 + A.row(2);\n@endcode\n@param src1 first input array.\n@param alpha scale factor for the first array.\n@param src2 second input array of the same size and type as src1.\n@param dst output array of the same size and type as src1.\n@sa add, addWeighted, subtract, Mat::dot, Mat::convertTo\n*/\nCV_EXPORTS_W void scaleAdd(InputArray src1, double alpha, InputArray src2, OutputArray dst);\n\n/** @example samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp\nCheck @ref tutorial_trackbar \"the corresponding tutorial\" for more details\n*/\n\n/** @brief Calculates the weighted sum of two arrays.\n\nThe function addWeighted calculates the weighted sum of two arrays as follows:\n\\f[\\texttt{dst} (I)= \\texttt{saturate} ( \\texttt{src1} (I)* \\texttt{alpha} +  \\texttt{src2} (I)* \\texttt{beta} +  \\texttt{gamma} )\\f]\nwhere I is a multi-dimensional index of array elements. In case of multi-channel arrays, each\nchannel is processed independently.\nThe function can be replaced with a matrix expression:\n@code{.cpp}\n    dst = src1*alpha + src2*beta + gamma;\n@endcode\n@note Saturation is not applied when the output array has the depth CV_32S. You may even get\nresult of an incorrect sign in the case of overflow.\n@param src1 first input array.\n@param alpha weight of the first array elements.\n@param src2 second input array of the same size and channel number as src1.\n@param beta weight of the second array elements.\n@param gamma scalar added to each sum.\n@param dst output array that has the same size and number of channels as the input arrays.\n@param dtype optional depth of the output array; when both input arrays have the same depth, dtype\ncan be set to -1, which will be equivalent to src1.depth().\n@sa  add, subtract, scaleAdd, Mat::convertTo\n*/\nCV_EXPORTS_W void addWeighted(InputArray src1, double alpha, InputArray src2,\n                              double beta, double gamma, OutputArray dst, int dtype = -1);\n\n/** @brief Scales, calculates absolute values, and converts the result to 8-bit.\n\nOn each element of the input array, the function convertScaleAbs\nperforms three operations sequentially: scaling, taking an absolute\nvalue, conversion to an unsigned 8-bit type:\n\\f[\\texttt{dst} (I)= \\texttt{saturate\\_cast<uchar>} (| \\texttt{src} (I)* \\texttt{alpha} +  \\texttt{beta} |)\\f]\nIn case of multi-channel arrays, the function processes each channel\nindependently. When the output is not 8-bit, the operation can be\nemulated by calling the Mat::convertTo method (or by using matrix\nexpressions) and then by calculating an absolute value of the result.\nFor example:\n@code{.cpp}\n    Mat_<float> A(30,30);\n    randu(A, Scalar(-100), Scalar(100));\n    Mat_<float> B = A*5 + 3;\n    B = abs(B);\n    // Mat_<float> B = abs(A*5+3) will also do the job,\n    // but it will allocate a temporary matrix\n@endcode\n@param src input array.\n@param dst output array.\n@param alpha optional scale factor.\n@param beta optional delta added to the scaled values.\n@sa  Mat::convertTo, cv::abs(const Mat&)\n*/\nCV_EXPORTS_W void convertScaleAbs(InputArray src, OutputArray dst,\n                                  double alpha = 1, double beta = 0);\n\n/** @brief Converts an array to half precision floating number.\n\nThis function converts FP32 (single precision floating point) from/to FP16 (half precision floating point). CV_16S format is used to represent FP16 data.\nThere are two use modes (src -> dst): CV_32F -> CV_16S and CV_16S -> CV_32F. The input array has to have type of CV_32F or\nCV_16S to represent the bit depth. If the input array is neither of them, the function will raise an error.\nThe format of half precision floating point is defined in IEEE 754-2008.\n\n@param src input array.\n@param dst output array.\n*/\nCV_EXPORTS_W void convertFp16(InputArray src, OutputArray dst);\n\n/** @brief Performs a look-up table transform of an array.\n\nThe function LUT fills the output array with values from the look-up table. Indices of the entries\nare taken from the input array. That is, the function processes each element of src as follows:\n\\f[\\texttt{dst} (I)  \\leftarrow \\texttt{lut(src(I) + d)}\\f]\nwhere\n\\f[d =  \\fork{0}{if \\(\\texttt{src}\\) has depth \\(\\texttt{CV_8U}\\)}{128}{if \\(\\texttt{src}\\) has depth \\(\\texttt{CV_8S}\\)}\\f]\n@param src input array of 8-bit elements.\n@param lut look-up table of 256 elements; in case of multi-channel input array, the table should\neither have a single channel (in this case the same table is used for all channels) or the same\nnumber of channels as in the input array.\n@param dst output array of the same size and number of channels as src, and the same depth as lut.\n@sa  convertScaleAbs, Mat::convertTo\n*/\nCV_EXPORTS_W void LUT(InputArray src, InputArray lut, OutputArray dst);\n\n/** @brief Calculates the sum of array elements.\n\nThe function cv::sum calculates and returns the sum of array elements,\nindependently for each channel.\n@param src input array that must have from 1 to 4 channels.\n@sa  countNonZero, mean, meanStdDev, norm, minMaxLoc, reduce\n*/\nCV_EXPORTS_AS(sumElems) Scalar sum(InputArray src);\n\n/** @brief Counts non-zero array elements.\n\nThe function returns the number of non-zero elements in src :\n\\f[\\sum _{I: \\; \\texttt{src} (I) \\ne0 } 1\\f]\n@param src single-channel array.\n@sa  mean, meanStdDev, norm, minMaxLoc, calcCovarMatrix\n*/\nCV_EXPORTS_W int countNonZero( InputArray src );\n\n/** @brief Returns the list of locations of non-zero pixels\n\nGiven a binary matrix (likely returned from an operation such\nas threshold(), compare(), >, ==, etc, return all of\nthe non-zero indices as a cv::Mat or std::vector<cv::Point> (x,y)\nFor example:\n@code{.cpp}\n    cv::Mat binaryImage; // input, binary image\n    cv::Mat locations;   // output, locations of non-zero pixels\n    cv::findNonZero(binaryImage, locations);\n\n    // access pixel coordinates\n    Point pnt = locations.at<Point>(i);\n@endcode\nor\n@code{.cpp}\n    cv::Mat binaryImage; // input, binary image\n    vector<Point> locations;   // output, locations of non-zero pixels\n    cv::findNonZero(binaryImage, locations);\n\n    // access pixel coordinates\n    Point pnt = locations[i];\n@endcode\n@param src single-channel array\n@param idx the output array, type of cv::Mat or std::vector<Point>, corresponding to non-zero indices in the input\n*/\nCV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx );\n\n/** @brief Calculates an average (mean) of array elements.\n\nThe function cv::mean calculates the mean value M of array elements,\nindependently for each channel, and return it:\n\\f[\\begin{array}{l} N =  \\sum _{I: \\; \\texttt{mask} (I) \\ne 0} 1 \\\\ M_c =  \\left ( \\sum _{I: \\; \\texttt{mask} (I) \\ne 0}{ \\texttt{mtx} (I)_c} \\right )/N \\end{array}\\f]\nWhen all the mask elements are 0's, the function returns Scalar::all(0)\n@param src input array that should have from 1 to 4 channels so that the result can be stored in\nScalar_ .\n@param mask optional operation mask.\n@sa  countNonZero, meanStdDev, norm, minMaxLoc\n*/\nCV_EXPORTS_W Scalar mean(InputArray src, InputArray mask = noArray());\n\n/** Calculates a mean and standard deviation of array elements.\n\nThe function cv::meanStdDev calculates the mean and the standard deviation M\nof array elements independently for each channel and returns it via the\noutput parameters:\n\\f[\\begin{array}{l} N =  \\sum _{I, \\texttt{mask} (I)  \\ne 0} 1 \\\\ \\texttt{mean} _c =  \\frac{\\sum_{ I: \\; \\texttt{mask}(I) \\ne 0} \\texttt{src} (I)_c}{N} \\\\ \\texttt{stddev} _c =  \\sqrt{\\frac{\\sum_{ I: \\; \\texttt{mask}(I) \\ne 0} \\left ( \\texttt{src} (I)_c -  \\texttt{mean} _c \\right )^2}{N}} \\end{array}\\f]\nWhen all the mask elements are 0's, the function returns\nmean=stddev=Scalar::all(0).\n@note The calculated standard deviation is only the diagonal of the\ncomplete normalized covariance matrix. If the full matrix is needed, you\ncan reshape the multi-channel array M x N to the single-channel array\nM\\*N x mtx.channels() (only possible when the matrix is continuous) and\nthen pass the matrix to calcCovarMatrix .\n@param src input array that should have from 1 to 4 channels so that the results can be stored in\nScalar_ 's.\n@param mean output parameter: calculated mean value.\n@param stddev output parameter: calculated standard deviation.\n@param mask optional operation mask.\n@sa  countNonZero, mean, norm, minMaxLoc, calcCovarMatrix\n*/\nCV_EXPORTS_W void meanStdDev(InputArray src, OutputArray mean, OutputArray stddev,\n                             InputArray mask=noArray());\n\n/** @brief Calculates the  absolute norm of an array.\n\nThis version of #norm calculates the absolute norm of src1. The type of norm to calculate is specified using #NormTypes.\n\nAs example for one array consider the function \\f$r(x)= \\begin{pmatrix} x \\\\ 1-x \\end{pmatrix}, x \\in [-1;1]\\f$.\nThe \\f$ L_{1}, L_{2} \\f$ and \\f$ L_{\\infty} \\f$ norm for the sample value \\f$r(-1) = \\begin{pmatrix} -1 \\\\ 2 \\end{pmatrix}\\f$\nis calculated as follows\n\\f{align*}\n    \\| r(-1) \\|_{L_1} &= |-1| + |2| = 3 \\\\\n    \\| r(-1) \\|_{L_2} &= \\sqrt{(-1)^{2} + (2)^{2}} = \\sqrt{5} \\\\\n    \\| r(-1) \\|_{L_\\infty} &= \\max(|-1|,|2|) = 2\n\\f}\nand for \\f$r(0.5) = \\begin{pmatrix} 0.5 \\\\ 0.5 \\end{pmatrix}\\f$ the calculation is\n\\f{align*}\n    \\| r(0.5) \\|_{L_1} &= |0.5| + |0.5| = 1 \\\\\n    \\| r(0.5) \\|_{L_2} &= \\sqrt{(0.5)^{2} + (0.5)^{2}} = \\sqrt{0.5} \\\\\n    \\| r(0.5) \\|_{L_\\infty} &= \\max(|0.5|,|0.5|) = 0.5.\n\\f}\nThe following graphic shows all values for the three norm functions \\f$\\| r(x) \\|_{L_1}, \\| r(x) \\|_{L_2}\\f$ and \\f$\\| r(x) \\|_{L_\\infty}\\f$.\nIt is notable that the \\f$ L_{1} \\f$ norm forms the upper and the \\f$ L_{\\infty} \\f$ norm forms the lower border for the example function \\f$ r(x) \\f$.\n![Graphs for the different norm functions from the above example](pics/NormTypes_OneArray_1-2-INF.png)\n\nWhen the mask parameter is specified and it is not empty, the norm is\n\nIf normType is not specified, #NORM_L2 is used.\ncalculated only over the region specified by the mask.\n\nMulti-channel input arrays are treated as single-channel arrays, that is,\nthe results for all channels are combined.\n\nHamming norms can only be calculated with CV_8U depth arrays.\n\n@param src1 first input array.\n@param normType type of the norm (see #NormTypes).\n@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type.\n*/\nCV_EXPORTS_W double norm(InputArray src1, int normType = NORM_L2, InputArray mask = noArray());\n\n/** @brief Calculates an absolute difference norm or a relative difference norm.\n\nThis version of cv::norm calculates the absolute difference norm\nor the relative difference norm of arrays src1 and src2.\nThe type of norm to calculate is specified using #NormTypes.\n\n@param src1 first input array.\n@param src2 second input array of the same size and the same type as src1.\n@param normType type of the norm (see #NormTypes).\n@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type.\n*/\nCV_EXPORTS_W double norm(InputArray src1, InputArray src2,\n                         int normType = NORM_L2, InputArray mask = noArray());\n/** @overload\n@param src first input array.\n@param normType type of the norm (see #NormTypes).\n*/\nCV_EXPORTS double norm( const SparseMat& src, int normType );\n\n/** @brief Computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric.\n\nThis function calculates the Peak Signal-to-Noise Ratio (PSNR) image quality metric in decibels (dB),\nbetween two input arrays src1 and src2. The arrays must have the same type.\n\nThe PSNR is calculated as follows:\n\n\\f[\n\\texttt{PSNR} = 10 \\cdot \\log_{10}{\\left( \\frac{R^2}{MSE} \\right) }\n\\f]\n\nwhere R is the maximum integer value of depth (e.g. 255 in the case of CV_8U data)\nand MSE is the mean squared error between the two arrays.\n\n@param src1 first input array.\n@param src2 second input array of the same size as src1.\n@param R the maximum pixel value (255 by default)\n\n  */\nCV_EXPORTS_W double PSNR(InputArray src1, InputArray src2, double R=255.);\n\n/** @brief naive nearest neighbor finder\n\nsee http://en.wikipedia.org/wiki/Nearest_neighbor_search\n@todo document\n  */\nCV_EXPORTS_W void batchDistance(InputArray src1, InputArray src2,\n                                OutputArray dist, int dtype, OutputArray nidx,\n                                int normType = NORM_L2, int K = 0,\n                                InputArray mask = noArray(), int update = 0,\n                                bool crosscheck = false);\n\n/** @brief Normalizes the norm or value range of an array.\n\nThe function cv::normalize normalizes scale and shift the input array elements so that\n\\f[\\| \\texttt{dst} \\| _{L_p}= \\texttt{alpha}\\f]\n(where p=Inf, 1 or 2) when normType=NORM_INF, NORM_L1, or NORM_L2, respectively; or so that\n\\f[\\min _I  \\texttt{dst} (I)= \\texttt{alpha} , \\, \\, \\max _I  \\texttt{dst} (I)= \\texttt{beta}\\f]\n\nwhen normType=NORM_MINMAX (for dense arrays only). The optional mask specifies a sub-array to be\nnormalized. This means that the norm or min-n-max are calculated over the sub-array, and then this\nsub-array is modified to be normalized. If you want to only use the mask to calculate the norm or\nmin-max but modify the whole array, you can use norm and Mat::convertTo.\n\nIn case of sparse matrices, only the non-zero values are analyzed and transformed. Because of this,\nthe range transformation for sparse matrices is not allowed since it can shift the zero level.\n\nPossible usage with some positive example data:\n@code{.cpp}\n    vector<double> positiveData = { 2.0, 8.0, 10.0 };\n    vector<double> normalizedData_l1, normalizedData_l2, normalizedData_inf, normalizedData_minmax;\n\n    // Norm to probability (total count)\n    // sum(numbers) = 20.0\n    // 2.0      0.1     (2.0/20.0)\n    // 8.0      0.4     (8.0/20.0)\n    // 10.0     0.5     (10.0/20.0)\n    normalize(positiveData, normalizedData_l1, 1.0, 0.0, NORM_L1);\n\n    // Norm to unit vector: ||positiveData|| = 1.0\n    // 2.0      0.15\n    // 8.0      0.62\n    // 10.0     0.77\n    normalize(positiveData, normalizedData_l2, 1.0, 0.0, NORM_L2);\n\n    // Norm to max element\n    // 2.0      0.2     (2.0/10.0)\n    // 8.0      0.8     (8.0/10.0)\n    // 10.0     1.0     (10.0/10.0)\n    normalize(positiveData, normalizedData_inf, 1.0, 0.0, NORM_INF);\n\n    // Norm to range [0.0;1.0]\n    // 2.0      0.0     (shift to left border)\n    // 8.0      0.75    (6.0/8.0)\n    // 10.0     1.0     (shift to right border)\n    normalize(positiveData, normalizedData_minmax, 1.0, 0.0, NORM_MINMAX);\n@endcode\n\n@param src input array.\n@param dst output array of the same size as src .\n@param alpha norm value to normalize to or the lower range boundary in case of the range\nnormalization.\n@param beta upper range boundary in case of the range normalization; it is not used for the norm\nnormalization.\n@param norm_type normalization type (see cv::NormTypes).\n@param dtype when negative, the output array has the same type as src; otherwise, it has the same\nnumber of channels as src and the depth =CV_MAT_DEPTH(dtype).\n@param mask optional operation mask.\n@sa norm, Mat::convertTo, SparseMat::convertTo\n*/\nCV_EXPORTS_W void normalize( InputArray src, InputOutputArray dst, double alpha = 1, double beta = 0,\n                             int norm_type = NORM_L2, int dtype = -1, InputArray mask = noArray());\n\n/** @overload\n@param src input array.\n@param dst output array of the same size as src .\n@param alpha norm value to normalize to or the lower range boundary in case of the range\nnormalization.\n@param normType normalization type (see cv::NormTypes).\n*/\nCV_EXPORTS void normalize( const SparseMat& src, SparseMat& dst, double alpha, int normType );\n\n/** @brief Finds the global minimum and maximum in an array.\n\nThe function cv::minMaxLoc finds the minimum and maximum element values and their positions. The\nextremums are searched across the whole array or, if mask is not an empty array, in the specified\narray region.\n\nThe function do not work with multi-channel arrays. If you need to find minimum or maximum\nelements across all the channels, use Mat::reshape first to reinterpret the array as\nsingle-channel. Or you may extract the particular channel using either extractImageCOI , or\nmixChannels , or split .\n@param src input single-channel array.\n@param minVal pointer to the returned minimum value; NULL is used if not required.\n@param maxVal pointer to the returned maximum value; NULL is used if not required.\n@param minLoc pointer to the returned minimum location (in 2D case); NULL is used if not required.\n@param maxLoc pointer to the returned maximum location (in 2D case); NULL is used if not required.\n@param mask optional mask used to select a sub-array.\n@sa max, min, compare, inRange, extractImageCOI, mixChannels, split, Mat::reshape\n*/\nCV_EXPORTS_W void minMaxLoc(InputArray src, CV_OUT double* minVal,\n                            CV_OUT double* maxVal = 0, CV_OUT Point* minLoc = 0,\n                            CV_OUT Point* maxLoc = 0, InputArray mask = noArray());\n\n\n/** @brief Finds the global minimum and maximum in an array\n\nThe function cv::minMaxIdx finds the minimum and maximum element values and their positions. The\nextremums are searched across the whole array or, if mask is not an empty array, in the specified\narray region. The function does not work with multi-channel arrays. If you need to find minimum or\nmaximum elements across all the channels, use Mat::reshape first to reinterpret the array as\nsingle-channel. Or you may extract the particular channel using either extractImageCOI , or\nmixChannels , or split . In case of a sparse matrix, the minimum is found among non-zero elements\nonly.\n@note When minIdx is not NULL, it must have at least 2 elements (as well as maxIdx), even if src is\na single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2\ndimensions, i.e. single-column matrix is Mx1 matrix (and therefore minIdx/maxIdx will be\n(i1,0)/(i2,0)) and single-row matrix is 1xN matrix (and therefore minIdx/maxIdx will be\n(0,j1)/(0,j2)).\n@param src input single-channel array.\n@param minVal pointer to the returned minimum value; NULL is used if not required.\n@param maxVal pointer to the returned maximum value; NULL is used if not required.\n@param minIdx pointer to the returned minimum location (in nD case); NULL is used if not required;\nOtherwise, it must point to an array of src.dims elements, the coordinates of the minimum element\nin each dimension are stored there sequentially.\n@param maxIdx pointer to the returned maximum location (in nD case). NULL is used if not required.\n@param mask specified array region\n*/\nCV_EXPORTS void minMaxIdx(InputArray src, double* minVal, double* maxVal = 0,\n                          int* minIdx = 0, int* maxIdx = 0, InputArray mask = noArray());\n\n/** @overload\n@param a input single-channel array.\n@param minVal pointer to the returned minimum value; NULL is used if not required.\n@param maxVal pointer to the returned maximum value; NULL is used if not required.\n@param minIdx pointer to the returned minimum location (in nD case); NULL is used if not required;\nOtherwise, it must point to an array of src.dims elements, the coordinates of the minimum element\nin each dimension are stored there sequentially.\n@param maxIdx pointer to the returned maximum location (in nD case). NULL is used if not required.\n*/\nCV_EXPORTS void minMaxLoc(const SparseMat& a, double* minVal,\n                          double* maxVal, int* minIdx = 0, int* maxIdx = 0);\n\n/** @brief Reduces a matrix to a vector.\n\nThe function #reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of\n1D vectors and performing the specified operation on the vectors until a single row/column is\nobtained. For example, the function can be used to compute horizontal and vertical projections of a\nraster image. In case of #REDUCE_MAX and #REDUCE_MIN , the output image should have the same type as the source one.\nIn case of #REDUCE_SUM and #REDUCE_AVG , the output may have a larger element bit-depth to preserve accuracy.\nAnd multi-channel arrays are also supported in these two reduction modes.\n\nThe following code demonstrates its usage for a single channel matrix.\n@snippet snippets/core_reduce.cpp example\n\nAnd the following code demonstrates its usage for a two-channel matrix.\n@snippet snippets/core_reduce.cpp example2\n\n@param src input 2D matrix.\n@param dst output vector. Its size and type is defined by dim and dtype parameters.\n@param dim dimension index along which the matrix is reduced. 0 means that the matrix is reduced to\na single row. 1 means that the matrix is reduced to a single column.\n@param rtype reduction operation that could be one of #ReduceTypes\n@param dtype when negative, the output vector will have the same type as the input matrix,\notherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), src.channels()).\n@sa repeat\n*/\nCV_EXPORTS_W void reduce(InputArray src, OutputArray dst, int dim, int rtype, int dtype = -1);\n\n/** @brief Creates one multi-channel array out of several single-channel ones.\n\nThe function cv::merge merges several arrays to make a single multi-channel array. That is, each\nelement of the output array will be a concatenation of the elements of the input arrays, where\nelements of i-th input array are treated as mv[i].channels()-element vectors.\n\nThe function cv::split does the reverse operation. If you need to shuffle channels in some other\nadvanced way, use cv::mixChannels.\n\nThe following example shows how to merge 3 single channel matrices into a single 3-channel matrix.\n@snippet snippets/core_merge.cpp example\n\n@param mv input array of matrices to be merged; all the matrices in mv must have the same\nsize and the same depth.\n@param count number of input matrices when mv is a plain C array; it must be greater than zero.\n@param dst output array of the same size and the same depth as mv[0]; The number of channels will\nbe equal to the parameter count.\n@sa  mixChannels, split, Mat::reshape\n*/\nCV_EXPORTS void merge(const Mat* mv, size_t count, OutputArray dst);\n\n/** @overload\n@param mv input vector of matrices to be merged; all the matrices in mv must have the same\nsize and the same depth.\n@param dst output array of the same size and the same depth as mv[0]; The number of channels will\nbe the total number of channels in the matrix array.\n  */\nCV_EXPORTS_W void merge(InputArrayOfArrays mv, OutputArray dst);\n\n/** @brief Divides a multi-channel array into several single-channel arrays.\n\nThe function cv::split splits a multi-channel array into separate single-channel arrays:\n\\f[\\texttt{mv} [c](I) =  \\texttt{src} (I)_c\\f]\nIf you need to extract a single channel or do some other sophisticated channel permutation, use\nmixChannels .\n\nThe following example demonstrates how to split a 3-channel matrix into 3 single channel matrices.\n@snippet snippets/core_split.cpp example\n\n@param src input multi-channel array.\n@param mvbegin output array; the number of arrays must match src.channels(); the arrays themselves are\nreallocated, if needed.\n@sa merge, mixChannels, cvtColor\n*/\nCV_EXPORTS void split(const Mat& src, Mat* mvbegin);\n\n/** @overload\n@param m input multi-channel array.\n@param mv output vector of arrays; the arrays themselves are reallocated, if needed.\n*/\nCV_EXPORTS_W void split(InputArray m, OutputArrayOfArrays mv);\n\n/** @brief Copies specified channels from input arrays to the specified channels of\noutput arrays.\n\nThe function cv::mixChannels provides an advanced mechanism for shuffling image channels.\n\ncv::split,cv::merge,cv::extractChannel,cv::insertChannel and some forms of cv::cvtColor are partial cases of cv::mixChannels.\n\nIn the example below, the code splits a 4-channel BGRA image into a 3-channel BGR (with B and R\nchannels swapped) and a separate alpha-channel image:\n@code{.cpp}\n    Mat bgra( 100, 100, CV_8UC4, Scalar(255,0,0,255) );\n    Mat bgr( bgra.rows, bgra.cols, CV_8UC3 );\n    Mat alpha( bgra.rows, bgra.cols, CV_8UC1 );\n\n    // forming an array of matrices is a quite efficient operation,\n    // because the matrix data is not copied, only the headers\n    Mat out[] = { bgr, alpha };\n    // bgra[0] -> bgr[2], bgra[1] -> bgr[1],\n    // bgra[2] -> bgr[0], bgra[3] -> alpha[0]\n    int from_to[] = { 0,2, 1,1, 2,0, 3,3 };\n    mixChannels( &bgra, 1, out, 2, from_to, 4 );\n@endcode\n@note Unlike many other new-style C++ functions in OpenCV (see the introduction section and\nMat::create ), cv::mixChannels requires the output arrays to be pre-allocated before calling the\nfunction.\n@param src input array or vector of matrices; all of the matrices must have the same size and the\nsame depth.\n@param nsrcs number of matrices in `src`.\n@param dst output array or vector of matrices; all the matrices **must be allocated**; their size and\ndepth must be the same as in `src[0]`.\n@param ndsts number of matrices in `dst`.\n@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\\*2] is\na 0-based index of the input channel in src, fromTo[k\\*2+1] is an index of the output channel in\ndst; the continuous channel numbering is used: the first input image channels are indexed from 0 to\nsrc[0].channels()-1, the second input image channels are indexed from src[0].channels() to\nsrc[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image\nchannels; as a special case, when fromTo[k\\*2] is negative, the corresponding output channel is\nfilled with zero .\n@param npairs number of index pairs in `fromTo`.\n@sa split, merge, extractChannel, insertChannel, cvtColor\n*/\nCV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts,\n                            const int* fromTo, size_t npairs);\n\n/** @overload\n@param src input array or vector of matrices; all of the matrices must have the same size and the\nsame depth.\n@param dst output array or vector of matrices; all the matrices **must be allocated**; their size and\ndepth must be the same as in src[0].\n@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\\*2] is\na 0-based index of the input channel in src, fromTo[k\\*2+1] is an index of the output channel in\ndst; the continuous channel numbering is used: the first input image channels are indexed from 0 to\nsrc[0].channels()-1, the second input image channels are indexed from src[0].channels() to\nsrc[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image\nchannels; as a special case, when fromTo[k\\*2] is negative, the corresponding output channel is\nfilled with zero .\n@param npairs number of index pairs in fromTo.\n*/\nCV_EXPORTS void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,\n                            const int* fromTo, size_t npairs);\n\n/** @overload\n@param src input array or vector of matrices; all of the matrices must have the same size and the\nsame depth.\n@param dst output array or vector of matrices; all the matrices **must be allocated**; their size and\ndepth must be the same as in src[0].\n@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\\*2] is\na 0-based index of the input channel in src, fromTo[k\\*2+1] is an index of the output channel in\ndst; the continuous channel numbering is used: the first input image channels are indexed from 0 to\nsrc[0].channels()-1, the second input image channels are indexed from src[0].channels() to\nsrc[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image\nchannels; as a special case, when fromTo[k\\*2] is negative, the corresponding output channel is\nfilled with zero .\n*/\nCV_EXPORTS_W void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,\n                              const std::vector<int>& fromTo);\n\n/** @brief Extracts a single channel from src (coi is 0-based index)\n@param src input array\n@param dst output array\n@param coi index of channel to extract\n@sa mixChannels, split\n*/\nCV_EXPORTS_W void extractChannel(InputArray src, OutputArray dst, int coi);\n\n/** @brief Inserts a single channel to dst (coi is 0-based index)\n@param src input array\n@param dst output array\n@param coi index of channel for insertion\n@sa mixChannels, merge\n*/\nCV_EXPORTS_W void insertChannel(InputArray src, InputOutputArray dst, int coi);\n\n/** @brief Flips a 2D array around vertical, horizontal, or both axes.\n\nThe function cv::flip flips the array in one of three different ways (row\nand column indices are 0-based):\n\\f[\\texttt{dst} _{ij} =\n\\left\\{\n\\begin{array}{l l}\n\\texttt{src} _{\\texttt{src.rows}-i-1,j} & if\\;  \\texttt{flipCode} = 0 \\\\\n\\texttt{src} _{i, \\texttt{src.cols} -j-1} & if\\;  \\texttt{flipCode} > 0 \\\\\n\\texttt{src} _{ \\texttt{src.rows} -i-1, \\texttt{src.cols} -j-1} & if\\; \\texttt{flipCode} < 0 \\\\\n\\end{array}\n\\right.\\f]\nThe example scenarios of using the function are the following:\n*   Vertical flipping of the image (flipCode == 0) to switch between\n    top-left and bottom-left image origin. This is a typical operation\n    in video processing on Microsoft Windows\\* OS.\n*   Horizontal flipping of the image with the subsequent horizontal\n    shift and absolute difference calculation to check for a\n    vertical-axis symmetry (flipCode \\> 0).\n*   Simultaneous horizontal and vertical flipping of the image with\n    the subsequent shift and absolute difference calculation to check\n    for a central symmetry (flipCode \\< 0).\n*   Reversing the order of point arrays (flipCode \\> 0 or\n    flipCode == 0).\n@param src input array.\n@param dst output array of the same size and type as src.\n@param flipCode a flag to specify how to flip the array; 0 means\nflipping around the x-axis and positive value (for example, 1) means\nflipping around y-axis. Negative value (for example, -1) means flipping\naround both axes.\n@sa transpose , repeat , completeSymm\n*/\nCV_EXPORTS_W void flip(InputArray src, OutputArray dst, int flipCode);\n\nenum RotateFlags {\n    ROTATE_90_CLOCKWISE = 0, //!<Rotate 90 degrees clockwise\n    ROTATE_180 = 1, //!<Rotate 180 degrees clockwise\n    ROTATE_90_COUNTERCLOCKWISE = 2, //!<Rotate 270 degrees clockwise\n};\n/** @brief Rotates a 2D array in multiples of 90 degrees.\nThe function cv::rotate rotates the array in one of three different ways:\n*   Rotate by 90 degrees clockwise (rotateCode = ROTATE_90_CLOCKWISE).\n*   Rotate by 180 degrees clockwise (rotateCode = ROTATE_180).\n*   Rotate by 270 degrees clockwise (rotateCode = ROTATE_90_COUNTERCLOCKWISE).\n@param src input array.\n@param dst output array of the same type as src.  The size is the same with ROTATE_180,\nand the rows and cols are switched for ROTATE_90_CLOCKWISE and ROTATE_90_COUNTERCLOCKWISE.\n@param rotateCode an enum to specify how to rotate the array; see the enum #RotateFlags\n@sa transpose , repeat , completeSymm, flip, RotateFlags\n*/\nCV_EXPORTS_W void rotate(InputArray src, OutputArray dst, int rotateCode);\n\n/** @brief Fills the output array with repeated copies of the input array.\n\nThe function cv::repeat duplicates the input array one or more times along each of the two axes:\n\\f[\\texttt{dst} _{ij}= \\texttt{src} _{i\\mod src.rows, \\; j\\mod src.cols }\\f]\nThe second variant of the function is more convenient to use with @ref MatrixExpressions.\n@param src input array to replicate.\n@param ny Flag to specify how many times the `src` is repeated along the\nvertical axis.\n@param nx Flag to specify how many times the `src` is repeated along the\nhorizontal axis.\n@param dst output array of the same type as `src`.\n@sa cv::reduce\n*/\nCV_EXPORTS_W void repeat(InputArray src, int ny, int nx, OutputArray dst);\n\n/** @overload\n@param src input array to replicate.\n@param ny Flag to specify how many times the `src` is repeated along the\nvertical axis.\n@param nx Flag to specify how many times the `src` is repeated along the\nhorizontal axis.\n  */\nCV_EXPORTS Mat repeat(const Mat& src, int ny, int nx);\n\n/** @brief Applies horizontal concatenation to given matrices.\n\nThe function horizontally concatenates two or more cv::Mat matrices (with the same number of rows).\n@code{.cpp}\n    cv::Mat matArray[] = { cv::Mat(4, 1, CV_8UC1, cv::Scalar(1)),\n                           cv::Mat(4, 1, CV_8UC1, cv::Scalar(2)),\n                           cv::Mat(4, 1, CV_8UC1, cv::Scalar(3)),};\n\n    cv::Mat out;\n    cv::hconcat( matArray, 3, out );\n    //out:\n    //[1, 2, 3;\n    // 1, 2, 3;\n    // 1, 2, 3;\n    // 1, 2, 3]\n@endcode\n@param src input array or vector of matrices. all of the matrices must have the same number of rows and the same depth.\n@param nsrc number of matrices in src.\n@param dst output array. It has the same number of rows and depth as the src, and the sum of cols of the src.\n@sa cv::vconcat(const Mat*, size_t, OutputArray), @sa cv::vconcat(InputArrayOfArrays, OutputArray) and @sa cv::vconcat(InputArray, InputArray, OutputArray)\n*/\nCV_EXPORTS void hconcat(const Mat* src, size_t nsrc, OutputArray dst);\n/** @overload\n @code{.cpp}\n    cv::Mat_<float> A = (cv::Mat_<float>(3, 2) << 1, 4,\n                                                  2, 5,\n                                                  3, 6);\n    cv::Mat_<float> B = (cv::Mat_<float>(3, 2) << 7, 10,\n                                                  8, 11,\n                                                  9, 12);\n\n    cv::Mat C;\n    cv::hconcat(A, B, C);\n    //C:\n    //[1, 4, 7, 10;\n    // 2, 5, 8, 11;\n    // 3, 6, 9, 12]\n @endcode\n @param src1 first input array to be considered for horizontal concatenation.\n @param src2 second input array to be considered for horizontal concatenation.\n @param dst output array. It has the same number of rows and depth as the src1 and src2, and the sum of cols of the src1 and src2.\n */\nCV_EXPORTS void hconcat(InputArray src1, InputArray src2, OutputArray dst);\n/** @overload\n @code{.cpp}\n    std::vector<cv::Mat> matrices = { cv::Mat(4, 1, CV_8UC1, cv::Scalar(1)),\n                                      cv::Mat(4, 1, CV_8UC1, cv::Scalar(2)),\n                                      cv::Mat(4, 1, CV_8UC1, cv::Scalar(3)),};\n\n    cv::Mat out;\n    cv::hconcat( matrices, out );\n    //out:\n    //[1, 2, 3;\n    // 1, 2, 3;\n    // 1, 2, 3;\n    // 1, 2, 3]\n @endcode\n @param src input array or vector of matrices. all of the matrices must have the same number of rows and the same depth.\n @param dst output array. It has the same number of rows and depth as the src, and the sum of cols of the src.\nsame depth.\n */\nCV_EXPORTS_W void hconcat(InputArrayOfArrays src, OutputArray dst);\n\n/** @brief Applies vertical concatenation to given matrices.\n\nThe function vertically concatenates two or more cv::Mat matrices (with the same number of cols).\n@code{.cpp}\n    cv::Mat matArray[] = { cv::Mat(1, 4, CV_8UC1, cv::Scalar(1)),\n                           cv::Mat(1, 4, CV_8UC1, cv::Scalar(2)),\n                           cv::Mat(1, 4, CV_8UC1, cv::Scalar(3)),};\n\n    cv::Mat out;\n    cv::vconcat( matArray, 3, out );\n    //out:\n    //[1,   1,   1,   1;\n    // 2,   2,   2,   2;\n    // 3,   3,   3,   3]\n@endcode\n@param src input array or vector of matrices. all of the matrices must have the same number of cols and the same depth.\n@param nsrc number of matrices in src.\n@param dst output array. It has the same number of cols and depth as the src, and the sum of rows of the src.\n@sa cv::hconcat(const Mat*, size_t, OutputArray), @sa cv::hconcat(InputArrayOfArrays, OutputArray) and @sa cv::hconcat(InputArray, InputArray, OutputArray)\n*/\nCV_EXPORTS void vconcat(const Mat* src, size_t nsrc, OutputArray dst);\n/** @overload\n @code{.cpp}\n    cv::Mat_<float> A = (cv::Mat_<float>(3, 2) << 1, 7,\n                                                  2, 8,\n                                                  3, 9);\n    cv::Mat_<float> B = (cv::Mat_<float>(3, 2) << 4, 10,\n                                                  5, 11,\n                                                  6, 12);\n\n    cv::Mat C;\n    cv::vconcat(A, B, C);\n    //C:\n    //[1, 7;\n    // 2, 8;\n    // 3, 9;\n    // 4, 10;\n    // 5, 11;\n    // 6, 12]\n @endcode\n @param src1 first input array to be considered for vertical concatenation.\n @param src2 second input array to be considered for vertical concatenation.\n @param dst output array. It has the same number of cols and depth as the src1 and src2, and the sum of rows of the src1 and src2.\n */\nCV_EXPORTS void vconcat(InputArray src1, InputArray src2, OutputArray dst);\n/** @overload\n @code{.cpp}\n    std::vector<cv::Mat> matrices = { cv::Mat(1, 4, CV_8UC1, cv::Scalar(1)),\n                                      cv::Mat(1, 4, CV_8UC1, cv::Scalar(2)),\n                                      cv::Mat(1, 4, CV_8UC1, cv::Scalar(3)),};\n\n    cv::Mat out;\n    cv::vconcat( matrices, out );\n    //out:\n    //[1,   1,   1,   1;\n    // 2,   2,   2,   2;\n    // 3,   3,   3,   3]\n @endcode\n @param src input array or vector of matrices. all of the matrices must have the same number of cols and the same depth\n @param dst output array. It has the same number of cols and depth as the src, and the sum of rows of the src.\nsame depth.\n */\nCV_EXPORTS_W void vconcat(InputArrayOfArrays src, OutputArray dst);\n\n/** @brief computes bitwise conjunction of the two arrays (dst = src1 & src2)\nCalculates the per-element bit-wise conjunction of two arrays or an\narray and a scalar.\n\nThe function cv::bitwise_and calculates the per-element bit-wise logical conjunction for:\n*   Two arrays when src1 and src2 have the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  \\wedge \\texttt{src2} (I) \\quad \\texttt{if mask} (I) \\ne0\\f]\n*   An array and a scalar when src2 is constructed from Scalar or has\n    the same number of elements as `src1.channels()`:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  \\wedge \\texttt{src2} \\quad \\texttt{if mask} (I) \\ne0\\f]\n*   A scalar and an array when src1 is constructed from Scalar or has\n    the same number of elements as `src2.channels()`:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1}  \\wedge \\texttt{src2} (I) \\quad \\texttt{if mask} (I) \\ne0\\f]\nIn case of floating-point arrays, their machine-specific bit\nrepresentations (usually IEEE754-compliant) are used for the operation.\nIn case of multi-channel arrays, each channel is processed\nindependently. In the second and third cases above, the scalar is first\nconverted to the array type.\n@param src1 first input array or a scalar.\n@param src2 second input array or a scalar.\n@param dst output array that has the same size and type as the input\narrays.\n@param mask optional operation mask, 8-bit single channel array, that\nspecifies elements of the output array to be changed.\n*/\nCV_EXPORTS_W void bitwise_and(InputArray src1, InputArray src2,\n                              OutputArray dst, InputArray mask = noArray());\n\n/** @brief Calculates the per-element bit-wise disjunction of two arrays or an\narray and a scalar.\n\nThe function cv::bitwise_or calculates the per-element bit-wise logical disjunction for:\n*   Two arrays when src1 and src2 have the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  \\vee \\texttt{src2} (I) \\quad \\texttt{if mask} (I) \\ne0\\f]\n*   An array and a scalar when src2 is constructed from Scalar or has\n    the same number of elements as `src1.channels()`:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  \\vee \\texttt{src2} \\quad \\texttt{if mask} (I) \\ne0\\f]\n*   A scalar and an array when src1 is constructed from Scalar or has\n    the same number of elements as `src2.channels()`:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1}  \\vee \\texttt{src2} (I) \\quad \\texttt{if mask} (I) \\ne0\\f]\nIn case of floating-point arrays, their machine-specific bit\nrepresentations (usually IEEE754-compliant) are used for the operation.\nIn case of multi-channel arrays, each channel is processed\nindependently. In the second and third cases above, the scalar is first\nconverted to the array type.\n@param src1 first input array or a scalar.\n@param src2 second input array or a scalar.\n@param dst output array that has the same size and type as the input\narrays.\n@param mask optional operation mask, 8-bit single channel array, that\nspecifies elements of the output array to be changed.\n*/\nCV_EXPORTS_W void bitwise_or(InputArray src1, InputArray src2,\n                             OutputArray dst, InputArray mask = noArray());\n\n/** @brief Calculates the per-element bit-wise \"exclusive or\" operation on two\narrays or an array and a scalar.\n\nThe function cv::bitwise_xor calculates the per-element bit-wise logical \"exclusive-or\"\noperation for:\n*   Two arrays when src1 and src2 have the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  \\oplus \\texttt{src2} (I) \\quad \\texttt{if mask} (I) \\ne0\\f]\n*   An array and a scalar when src2 is constructed from Scalar or has\n    the same number of elements as `src1.channels()`:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  \\oplus \\texttt{src2} \\quad \\texttt{if mask} (I) \\ne0\\f]\n*   A scalar and an array when src1 is constructed from Scalar or has\n    the same number of elements as `src2.channels()`:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1}  \\oplus \\texttt{src2} (I) \\quad \\texttt{if mask} (I) \\ne0\\f]\nIn case of floating-point arrays, their machine-specific bit\nrepresentations (usually IEEE754-compliant) are used for the operation.\nIn case of multi-channel arrays, each channel is processed\nindependently. In the 2nd and 3rd cases above, the scalar is first\nconverted to the array type.\n@param src1 first input array or a scalar.\n@param src2 second input array or a scalar.\n@param dst output array that has the same size and type as the input\narrays.\n@param mask optional operation mask, 8-bit single channel array, that\nspecifies elements of the output array to be changed.\n*/\nCV_EXPORTS_W void bitwise_xor(InputArray src1, InputArray src2,\n                              OutputArray dst, InputArray mask = noArray());\n\n/** @brief  Inverts every bit of an array.\n\nThe function cv::bitwise_not calculates per-element bit-wise inversion of the input\narray:\n\\f[\\texttt{dst} (I) =  \\neg \\texttt{src} (I)\\f]\nIn case of a floating-point input array, its machine-specific bit\nrepresentation (usually IEEE754-compliant) is used for the operation. In\ncase of multi-channel arrays, each channel is processed independently.\n@param src input array.\n@param dst output array that has the same size and type as the input\narray.\n@param mask optional operation mask, 8-bit single channel array, that\nspecifies elements of the output array to be changed.\n*/\nCV_EXPORTS_W void bitwise_not(InputArray src, OutputArray dst,\n                              InputArray mask = noArray());\n\n/** @brief Calculates the per-element absolute difference between two arrays or between an array and a scalar.\n\nThe function cv::absdiff calculates:\n*   Absolute difference between two arrays when they have the same\n    size and type:\n    \\f[\\texttt{dst}(I) =  \\texttt{saturate} (| \\texttt{src1}(I) -  \\texttt{src2}(I)|)\\f]\n*   Absolute difference between an array and a scalar when the second\n    array is constructed from Scalar or has as many elements as the\n    number of channels in `src1`:\n    \\f[\\texttt{dst}(I) =  \\texttt{saturate} (| \\texttt{src1}(I) -  \\texttt{src2} |)\\f]\n*   Absolute difference between a scalar and an array when the first\n    array is constructed from Scalar or has as many elements as the\n    number of channels in `src2`:\n    \\f[\\texttt{dst}(I) =  \\texttt{saturate} (| \\texttt{src1} -  \\texttt{src2}(I) |)\\f]\n    where I is a multi-dimensional index of array elements. In case of\n    multi-channel arrays, each channel is processed independently.\n@note Saturation is not applied when the arrays have the depth CV_32S.\nYou may even get a negative value in the case of overflow.\n@param src1 first input array or a scalar.\n@param src2 second input array or a scalar.\n@param dst output array that has the same size and type as input arrays.\n@sa cv::abs(const Mat&)\n*/\nCV_EXPORTS_W void absdiff(InputArray src1, InputArray src2, OutputArray dst);\n\n/** @brief  This is an overloaded member function, provided for convenience (python)\nCopies the matrix to another one.\nWhen the operation mask is specified, if the Mat::create call shown above reallocates the matrix, the newly allocated matrix is initialized with all zeros before copying the data.\n@param src source matrix.\n@param dst Destination matrix. If it does not have a proper size or type before the operation, it is\nreallocated.\n@param mask Operation mask of the same size as \\*this. Its non-zero elements indicate which matrix\nelements need to be copied. The mask has to be of type CV_8U and can have 1 or multiple channels.\n*/\n\nvoid CV_EXPORTS_W copyTo(InputArray src, OutputArray dst, InputArray mask);\n/** @brief  Checks if array elements lie between the elements of two other arrays.\n\nThe function checks the range as follows:\n-   For every element of a single-channel input array:\n    \\f[\\texttt{dst} (I)= \\texttt{lowerb} (I)_0  \\leq \\texttt{src} (I)_0 \\leq  \\texttt{upperb} (I)_0\\f]\n-   For two-channel arrays:\n    \\f[\\texttt{dst} (I)= \\texttt{lowerb} (I)_0  \\leq \\texttt{src} (I)_0 \\leq  \\texttt{upperb} (I)_0  \\land \\texttt{lowerb} (I)_1  \\leq \\texttt{src} (I)_1 \\leq  \\texttt{upperb} (I)_1\\f]\n-   and so forth.\n\nThat is, dst (I) is set to 255 (all 1 -bits) if src (I) is within the\nspecified 1D, 2D, 3D, ... box and 0 otherwise.\n\nWhen the lower and/or upper boundary parameters are scalars, the indexes\n(I) at lowerb and upperb in the above formulas should be omitted.\n@param src first input array.\n@param lowerb inclusive lower boundary array or a scalar.\n@param upperb inclusive upper boundary array or a scalar.\n@param dst output array of the same size as src and CV_8U type.\n*/\nCV_EXPORTS_W void inRange(InputArray src, InputArray lowerb,\n                          InputArray upperb, OutputArray dst);\n\n/** @brief Performs the per-element comparison of two arrays or an array and scalar value.\n\nThe function compares:\n*   Elements of two arrays when src1 and src2 have the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  \\,\\texttt{cmpop}\\, \\texttt{src2} (I)\\f]\n*   Elements of src1 with a scalar src2 when src2 is constructed from\n    Scalar or has a single element:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1}(I) \\,\\texttt{cmpop}\\,  \\texttt{src2}\\f]\n*   src1 with elements of src2 when src1 is constructed from Scalar or\n    has a single element:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1}  \\,\\texttt{cmpop}\\, \\texttt{src2} (I)\\f]\nWhen the comparison result is true, the corresponding element of output\narray is set to 255. The comparison operations can be replaced with the\nequivalent matrix expressions:\n@code{.cpp}\n    Mat dst1 = src1 >= src2;\n    Mat dst2 = src1 < 8;\n    ...\n@endcode\n@param src1 first input array or a scalar; when it is an array, it must have a single channel.\n@param src2 second input array or a scalar; when it is an array, it must have a single channel.\n@param dst output array of type ref CV_8U that has the same size and the same number of channels as\n    the input arrays.\n@param cmpop a flag, that specifies correspondence between the arrays (cv::CmpTypes)\n@sa checkRange, min, max, threshold\n*/\nCV_EXPORTS_W void compare(InputArray src1, InputArray src2, OutputArray dst, int cmpop);\n\n/** @brief Calculates per-element minimum of two arrays or an array and a scalar.\n\nThe function cv::min calculates the per-element minimum of two arrays:\n\\f[\\texttt{dst} (I)= \\min ( \\texttt{src1} (I), \\texttt{src2} (I))\\f]\nor array and a scalar:\n\\f[\\texttt{dst} (I)= \\min ( \\texttt{src1} (I), \\texttt{value} )\\f]\n@param src1 first input array.\n@param src2 second input array of the same size and type as src1.\n@param dst output array of the same size and type as src1.\n@sa max, compare, inRange, minMaxLoc\n*/\nCV_EXPORTS_W void min(InputArray src1, InputArray src2, OutputArray dst);\n/** @overload\nneeded to avoid conflicts with const _Tp& std::min(const _Tp&, const _Tp&, _Compare)\n*/\nCV_EXPORTS void min(const Mat& src1, const Mat& src2, Mat& dst);\n/** @overload\nneeded to avoid conflicts with const _Tp& std::min(const _Tp&, const _Tp&, _Compare)\n*/\nCV_EXPORTS void min(const UMat& src1, const UMat& src2, UMat& dst);\n\n/** @brief Calculates per-element maximum of two arrays or an array and a scalar.\n\nThe function cv::max calculates the per-element maximum of two arrays:\n\\f[\\texttt{dst} (I)= \\max ( \\texttt{src1} (I), \\texttt{src2} (I))\\f]\nor array and a scalar:\n\\f[\\texttt{dst} (I)= \\max ( \\texttt{src1} (I), \\texttt{value} )\\f]\n@param src1 first input array.\n@param src2 second input array of the same size and type as src1 .\n@param dst output array of the same size and type as src1.\n@sa  min, compare, inRange, minMaxLoc, @ref MatrixExpressions\n*/\nCV_EXPORTS_W void max(InputArray src1, InputArray src2, OutputArray dst);\n/** @overload\nneeded to avoid conflicts with const _Tp& std::min(const _Tp&, const _Tp&, _Compare)\n*/\nCV_EXPORTS void max(const Mat& src1, const Mat& src2, Mat& dst);\n/** @overload\nneeded to avoid conflicts with const _Tp& std::min(const _Tp&, const _Tp&, _Compare)\n*/\nCV_EXPORTS void max(const UMat& src1, const UMat& src2, UMat& dst);\n\n/** @brief Calculates a square root of array elements.\n\nThe function cv::sqrt calculates a square root of each input array element.\nIn case of multi-channel arrays, each channel is processed\nindependently. The accuracy is approximately the same as of the built-in\nstd::sqrt .\n@param src input floating-point array.\n@param dst output array of the same size and type as src.\n*/\nCV_EXPORTS_W void sqrt(InputArray src, OutputArray dst);\n\n/** @brief Raises every array element to a power.\n\nThe function cv::pow raises every element of the input array to power :\n\\f[\\texttt{dst} (I) =  \\fork{\\texttt{src}(I)^{power}}{if \\(\\texttt{power}\\) is integer}{|\\texttt{src}(I)|^{power}}{otherwise}\\f]\n\nSo, for a non-integer power exponent, the absolute values of input array\nelements are used. However, it is possible to get true values for\nnegative values using some extra operations. In the example below,\ncomputing the 5th root of array src shows:\n@code{.cpp}\n    Mat mask = src < 0;\n    pow(src, 1./5, dst);\n    subtract(Scalar::all(0), dst, dst, mask);\n@endcode\nFor some values of power, such as integer values, 0.5 and -0.5,\nspecialized faster algorithms are used.\n\nSpecial values (NaN, Inf) are not handled.\n@param src input array.\n@param power exponent of power.\n@param dst output array of the same size and type as src.\n@sa sqrt, exp, log, cartToPolar, polarToCart\n*/\nCV_EXPORTS_W void pow(InputArray src, double power, OutputArray dst);\n\n/** @brief Calculates the exponent of every array element.\n\nThe function cv::exp calculates the exponent of every element of the input\narray:\n\\f[\\texttt{dst} [I] = e^{ src(I) }\\f]\n\nThe maximum relative error is about 7e-6 for single-precision input and\nless than 1e-10 for double-precision input. Currently, the function\nconverts denormalized values to zeros on output. Special values (NaN,\nInf) are not handled.\n@param src input array.\n@param dst output array of the same size and type as src.\n@sa log , cartToPolar , polarToCart , phase , pow , sqrt , magnitude\n*/\nCV_EXPORTS_W void exp(InputArray src, OutputArray dst);\n\n/** @brief Calculates the natural logarithm of every array element.\n\nThe function cv::log calculates the natural logarithm of every element of the input array:\n\\f[\\texttt{dst} (I) =  \\log (\\texttt{src}(I)) \\f]\n\nOutput on zero, negative and special (NaN, Inf) values is undefined.\n\n@param src input array.\n@param dst output array of the same size and type as src .\n@sa exp, cartToPolar, polarToCart, phase, pow, sqrt, magnitude\n*/\nCV_EXPORTS_W void log(InputArray src, OutputArray dst);\n\n/** @brief Calculates x and y coordinates of 2D vectors from their magnitude and angle.\n\nThe function cv::polarToCart calculates the Cartesian coordinates of each 2D\nvector represented by the corresponding elements of magnitude and angle:\n\\f[\\begin{array}{l} \\texttt{x} (I) =  \\texttt{magnitude} (I) \\cos ( \\texttt{angle} (I)) \\\\ \\texttt{y} (I) =  \\texttt{magnitude} (I) \\sin ( \\texttt{angle} (I)) \\\\ \\end{array}\\f]\n\nThe relative accuracy of the estimated coordinates is about 1e-6.\n@param magnitude input floating-point array of magnitudes of 2D vectors;\nit can be an empty matrix (=Mat()), in this case, the function assumes\nthat all the magnitudes are =1; if it is not empty, it must have the\nsame size and type as angle.\n@param angle input floating-point array of angles of 2D vectors.\n@param x output array of x-coordinates of 2D vectors; it has the same\nsize and type as angle.\n@param y output array of y-coordinates of 2D vectors; it has the same\nsize and type as angle.\n@param angleInDegrees when true, the input angles are measured in\ndegrees, otherwise, they are measured in radians.\n@sa cartToPolar, magnitude, phase, exp, log, pow, sqrt\n*/\nCV_EXPORTS_W void polarToCart(InputArray magnitude, InputArray angle,\n                              OutputArray x, OutputArray y, bool angleInDegrees = false);\n\n/** @brief Calculates the magnitude and angle of 2D vectors.\n\nThe function cv::cartToPolar calculates either the magnitude, angle, or both\nfor every 2D vector (x(I),y(I)):\n\\f[\\begin{array}{l} \\texttt{magnitude} (I)= \\sqrt{\\texttt{x}(I)^2+\\texttt{y}(I)^2} , \\\\ \\texttt{angle} (I)= \\texttt{atan2} ( \\texttt{y} (I), \\texttt{x} (I))[ \\cdot180 / \\pi ] \\end{array}\\f]\n\nThe angles are calculated with accuracy about 0.3 degrees. For the point\n(0,0), the angle is set to 0.\n@param x array of x-coordinates; this must be a single-precision or\ndouble-precision floating-point array.\n@param y array of y-coordinates, that must have the same size and same type as x.\n@param magnitude output array of magnitudes of the same size and type as x.\n@param angle output array of angles that has the same size and type as\nx; the angles are measured in radians (from 0 to 2\\*Pi) or in degrees (0 to 360 degrees).\n@param angleInDegrees a flag, indicating whether the angles are measured\nin radians (which is by default), or in degrees.\n@sa Sobel, Scharr\n*/\nCV_EXPORTS_W void cartToPolar(InputArray x, InputArray y,\n                              OutputArray magnitude, OutputArray angle,\n                              bool angleInDegrees = false);\n\n/** @brief Calculates the rotation angle of 2D vectors.\n\nThe function cv::phase calculates the rotation angle of each 2D vector that\nis formed from the corresponding elements of x and y :\n\\f[\\texttt{angle} (I) =  \\texttt{atan2} ( \\texttt{y} (I), \\texttt{x} (I))\\f]\n\nThe angle estimation accuracy is about 0.3 degrees. When x(I)=y(I)=0 ,\nthe corresponding angle(I) is set to 0.\n@param x input floating-point array of x-coordinates of 2D vectors.\n@param y input array of y-coordinates of 2D vectors; it must have the\nsame size and the same type as x.\n@param angle output array of vector angles; it has the same size and\nsame type as x .\n@param angleInDegrees when true, the function calculates the angle in\ndegrees, otherwise, they are measured in radians.\n*/\nCV_EXPORTS_W void phase(InputArray x, InputArray y, OutputArray angle,\n                        bool angleInDegrees = false);\n\n/** @brief Calculates the magnitude of 2D vectors.\n\nThe function cv::magnitude calculates the magnitude of 2D vectors formed\nfrom the corresponding elements of x and y arrays:\n\\f[\\texttt{dst} (I) =  \\sqrt{\\texttt{x}(I)^2 + \\texttt{y}(I)^2}\\f]\n@param x floating-point array of x-coordinates of the vectors.\n@param y floating-point array of y-coordinates of the vectors; it must\nhave the same size as x.\n@param magnitude output array of the same size and type as x.\n@sa cartToPolar, polarToCart, phase, sqrt\n*/\nCV_EXPORTS_W void magnitude(InputArray x, InputArray y, OutputArray magnitude);\n\n/** @brief Checks every element of an input array for invalid values.\n\nThe function cv::checkRange checks that every array element is neither NaN nor infinite. When minVal \\>\n-DBL_MAX and maxVal \\< DBL_MAX, the function also checks that each value is between minVal and\nmaxVal. In case of multi-channel arrays, each channel is processed independently. If some values\nare out of range, position of the first outlier is stored in pos (when pos != NULL). Then, the\nfunction either returns false (when quiet=true) or throws an exception.\n@param a input array.\n@param quiet a flag, indicating whether the functions quietly return false when the array elements\nare out of range or they throw an exception.\n@param pos optional output parameter, when not NULL, must be a pointer to array of src.dims\nelements.\n@param minVal inclusive lower boundary of valid values range.\n@param maxVal exclusive upper boundary of valid values range.\n*/\nCV_EXPORTS_W bool checkRange(InputArray a, bool quiet = true, CV_OUT Point* pos = 0,\n                            double minVal = -DBL_MAX, double maxVal = DBL_MAX);\n\n/** @brief converts NaNs to the given number\n@param a input/output matrix (CV_32F type).\n@param val value to convert the NaNs\n*/\nCV_EXPORTS_W void patchNaNs(InputOutputArray a, double val = 0);\n\n/** @brief Performs generalized matrix multiplication.\n\nThe function cv::gemm performs generalized matrix multiplication similar to the\ngemm functions in BLAS level 3. For example,\n`gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T)`\ncorresponds to\n\\f[\\texttt{dst} =  \\texttt{alpha} \\cdot \\texttt{src1} ^T  \\cdot \\texttt{src2} +  \\texttt{beta} \\cdot \\texttt{src3} ^T\\f]\n\nIn case of complex (two-channel) data, performed a complex matrix\nmultiplication.\n\nThe function can be replaced with a matrix expression. For example, the\nabove call can be replaced with:\n@code{.cpp}\n    dst = alpha*src1.t()*src2 + beta*src3.t();\n@endcode\n@param src1 first multiplied input matrix that could be real(CV_32FC1,\nCV_64FC1) or complex(CV_32FC2, CV_64FC2).\n@param src2 second multiplied input matrix of the same type as src1.\n@param alpha weight of the matrix product.\n@param src3 third optional delta matrix added to the matrix product; it\nshould have the same type as src1 and src2.\n@param beta weight of src3.\n@param dst output matrix; it has the proper size and the same type as\ninput matrices.\n@param flags operation flags (cv::GemmFlags)\n@sa mulTransposed , transform\n*/\nCV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha,\n                       InputArray src3, double beta, OutputArray dst, int flags = 0);\n\n/** @brief Calculates the product of a matrix and its transposition.\n\nThe function cv::mulTransposed calculates the product of src and its\ntransposition:\n\\f[\\texttt{dst} = \\texttt{scale} ( \\texttt{src} - \\texttt{delta} )^T ( \\texttt{src} - \\texttt{delta} )\\f]\nif aTa=true , and\n\\f[\\texttt{dst} = \\texttt{scale} ( \\texttt{src} - \\texttt{delta} ) ( \\texttt{src} - \\texttt{delta} )^T\\f]\notherwise. The function is used to calculate the covariance matrix. With\nzero delta, it can be used as a faster substitute for general matrix\nproduct A\\*B when B=A'\n@param src input single-channel matrix. Note that unlike gemm, the\nfunction can multiply not only floating-point matrices.\n@param dst output square matrix.\n@param aTa Flag specifying the multiplication ordering. See the\ndescription below.\n@param delta Optional delta matrix subtracted from src before the\nmultiplication. When the matrix is empty ( delta=noArray() ), it is\nassumed to be zero, that is, nothing is subtracted. If it has the same\nsize as src , it is simply subtracted. Otherwise, it is \"repeated\" (see\nrepeat ) to cover the full src and then subtracted. Type of the delta\nmatrix, when it is not empty, must be the same as the type of created\noutput matrix. See the dtype parameter description below.\n@param scale Optional scale factor for the matrix product.\n@param dtype Optional type of the output matrix. When it is negative,\nthe output matrix will have the same type as src . Otherwise, it will be\ntype=CV_MAT_DEPTH(dtype) that should be either CV_32F or CV_64F .\n@sa calcCovarMatrix, gemm, repeat, reduce\n*/\nCV_EXPORTS_W void mulTransposed( InputArray src, OutputArray dst, bool aTa,\n                                 InputArray delta = noArray(),\n                                 double scale = 1, int dtype = -1 );\n\n/** @brief Transposes a matrix.\n\nThe function cv::transpose transposes the matrix src :\n\\f[\\texttt{dst} (i,j) =  \\texttt{src} (j,i)\\f]\n@note No complex conjugation is done in case of a complex matrix. It\nshould be done separately if needed.\n@param src input array.\n@param dst output array of the same type as src.\n*/\nCV_EXPORTS_W void transpose(InputArray src, OutputArray dst);\n\n/** @brief Performs the matrix transformation of every array element.\n\nThe function cv::transform performs the matrix transformation of every\nelement of the array src and stores the results in dst :\n\\f[\\texttt{dst} (I) =  \\texttt{m} \\cdot \\texttt{src} (I)\\f]\n(when m.cols=src.channels() ), or\n\\f[\\texttt{dst} (I) =  \\texttt{m} \\cdot [ \\texttt{src} (I); 1]\\f]\n(when m.cols=src.channels()+1 )\n\nEvery element of the N -channel array src is interpreted as N -element\nvector that is transformed using the M x N or M x (N+1) matrix m to\nM-element vector - the corresponding element of the output array dst .\n\nThe function may be used for geometrical transformation of\nN -dimensional points, arbitrary linear color space transformation (such\nas various kinds of RGB to YUV transforms), shuffling the image\nchannels, and so forth.\n@param src input array that must have as many channels (1 to 4) as\nm.cols or m.cols-1.\n@param dst output array of the same size and depth as src; it has as\nmany channels as m.rows.\n@param m transformation 2x2 or 2x3 floating-point matrix.\n@sa perspectiveTransform, getAffineTransform, estimateAffine2D, warpAffine, warpPerspective\n*/\nCV_EXPORTS_W void transform(InputArray src, OutputArray dst, InputArray m );\n\n/** @brief Performs the perspective matrix transformation of vectors.\n\nThe function cv::perspectiveTransform transforms every element of src by\ntreating it as a 2D or 3D vector, in the following way:\n\\f[(x, y, z)  \\rightarrow (x'/w, y'/w, z'/w)\\f]\nwhere\n\\f[(x', y', z', w') =  \\texttt{mat} \\cdot \\begin{bmatrix} x & y & z & 1  \\end{bmatrix}\\f]\nand\n\\f[w =  \\fork{w'}{if \\(w' \\ne 0\\)}{\\infty}{otherwise}\\f]\n\nHere a 3D vector transformation is shown. In case of a 2D vector\ntransformation, the z component is omitted.\n\n@note The function transforms a sparse set of 2D or 3D vectors. If you\nwant to transform an image using perspective transformation, use\nwarpPerspective . If you have an inverse problem, that is, you want to\ncompute the most probable perspective transformation out of several\npairs of corresponding points, you can use getPerspectiveTransform or\nfindHomography .\n@param src input two-channel or three-channel floating-point array; each\nelement is a 2D/3D vector to be transformed.\n@param dst output array of the same size and type as src.\n@param m 3x3 or 4x4 floating-point transformation matrix.\n@sa  transform, warpPerspective, getPerspectiveTransform, findHomography\n*/\nCV_EXPORTS_W void perspectiveTransform(InputArray src, OutputArray dst, InputArray m );\n\n/** @brief Copies the lower or the upper half of a square matrix to its another half.\n\nThe function cv::completeSymm copies the lower or the upper half of a square matrix to\nits another half. The matrix diagonal remains unchanged:\n - \\f$\\texttt{m}_{ij}=\\texttt{m}_{ji}\\f$ for \\f$i > j\\f$ if\n    lowerToUpper=false\n - \\f$\\texttt{m}_{ij}=\\texttt{m}_{ji}\\f$ for \\f$i < j\\f$ if\n    lowerToUpper=true\n\n@param m input-output floating-point square matrix.\n@param lowerToUpper operation flag; if true, the lower half is copied to\nthe upper half. Otherwise, the upper half is copied to the lower half.\n@sa flip, transpose\n*/\nCV_EXPORTS_W void completeSymm(InputOutputArray m, bool lowerToUpper = false);\n\n/** @brief Initializes a scaled identity matrix.\n\nThe function cv::setIdentity initializes a scaled identity matrix:\n\\f[\\texttt{mtx} (i,j)= \\fork{\\texttt{value}}{ if \\(i=j\\)}{0}{otherwise}\\f]\n\nThe function can also be emulated using the matrix initializers and the\nmatrix expressions:\n@code\n    Mat A = Mat::eye(4, 3, CV_32F)*5;\n    // A will be set to [[5, 0, 0], [0, 5, 0], [0, 0, 5], [0, 0, 0]]\n@endcode\n@param mtx matrix to initialize (not necessarily square).\n@param s value to assign to diagonal elements.\n@sa Mat::zeros, Mat::ones, Mat::setTo, Mat::operator=\n*/\nCV_EXPORTS_W void setIdentity(InputOutputArray mtx, const Scalar& s = Scalar(1));\n\n/** @brief Returns the determinant of a square floating-point matrix.\n\nThe function cv::determinant calculates and returns the determinant of the\nspecified matrix. For small matrices ( mtx.cols=mtx.rows\\<=3 ), the\ndirect method is used. For larger matrices, the function uses LU\nfactorization with partial pivoting.\n\nFor symmetric positively-determined matrices, it is also possible to use\neigen decomposition to calculate the determinant.\n@param mtx input matrix that must have CV_32FC1 or CV_64FC1 type and\nsquare size.\n@sa trace, invert, solve, eigen, @ref MatrixExpressions\n*/\nCV_EXPORTS_W double determinant(InputArray mtx);\n\n/** @brief Returns the trace of a matrix.\n\nThe function cv::trace returns the sum of the diagonal elements of the\nmatrix mtx .\n\\f[\\mathrm{tr} ( \\texttt{mtx} ) =  \\sum _i  \\texttt{mtx} (i,i)\\f]\n@param mtx input matrix.\n*/\nCV_EXPORTS_W Scalar trace(InputArray mtx);\n\n/** @brief Finds the inverse or pseudo-inverse of a matrix.\n\nThe function cv::invert inverts the matrix src and stores the result in dst\n. When the matrix src is singular or non-square, the function calculates\nthe pseudo-inverse matrix (the dst matrix) so that norm(src\\*dst - I) is\nminimal, where I is an identity matrix.\n\nIn case of the #DECOMP_LU method, the function returns non-zero value if\nthe inverse has been successfully calculated and 0 if src is singular.\n\nIn case of the #DECOMP_SVD method, the function returns the inverse\ncondition number of src (the ratio of the smallest singular value to the\nlargest singular value) and 0 if src is singular. The SVD method\ncalculates a pseudo-inverse matrix if src is singular.\n\nSimilarly to #DECOMP_LU, the method #DECOMP_CHOLESKY works only with\nnon-singular square matrices that should also be symmetrical and\npositively defined. In this case, the function stores the inverted\nmatrix in dst and returns non-zero. Otherwise, it returns 0.\n\n@param src input floating-point M x N matrix.\n@param dst output matrix of N x M size and the same type as src.\n@param flags inversion method (cv::DecompTypes)\n@sa solve, SVD\n*/\nCV_EXPORTS_W double invert(InputArray src, OutputArray dst, int flags = DECOMP_LU);\n\n/** @brief Solves one or more linear systems or least-squares problems.\n\nThe function cv::solve solves a linear system or least-squares problem (the\nlatter is possible with SVD or QR methods, or by specifying the flag\n#DECOMP_NORMAL ):\n\\f[\\texttt{dst} =  \\arg \\min _X \\| \\texttt{src1} \\cdot \\texttt{X} -  \\texttt{src2} \\|\\f]\n\nIf #DECOMP_LU or #DECOMP_CHOLESKY method is used, the function returns 1\nif src1 (or \\f$\\texttt{src1}^T\\texttt{src1}\\f$ ) is non-singular. Otherwise,\nit returns 0. In the latter case, dst is not valid. Other methods find a\npseudo-solution in case of a singular left-hand side part.\n\n@note If you want to find a unity-norm solution of an under-defined\nsingular system \\f$\\texttt{src1}\\cdot\\texttt{dst}=0\\f$ , the function solve\nwill not do the work. Use SVD::solveZ instead.\n\n@param src1 input matrix on the left-hand side of the system.\n@param src2 input matrix on the right-hand side of the system.\n@param dst output solution.\n@param flags solution (matrix inversion) method (#DecompTypes)\n@sa invert, SVD, eigen\n*/\nCV_EXPORTS_W bool solve(InputArray src1, InputArray src2,\n                        OutputArray dst, int flags = DECOMP_LU);\n\n/** @brief Sorts each row or each column of a matrix.\n\nThe function cv::sort sorts each matrix row or each matrix column in\nascending or descending order. So you should pass two operation flags to\nget desired behaviour. If you want to sort matrix rows or columns\nlexicographically, you can use STL std::sort generic function with the\nproper comparison predicate.\n\n@param src input single-channel array.\n@param dst output array of the same size and type as src.\n@param flags operation flags, a combination of #SortFlags\n@sa sortIdx, randShuffle\n*/\nCV_EXPORTS_W void sort(InputArray src, OutputArray dst, int flags);\n\n/** @brief Sorts each row or each column of a matrix.\n\nThe function cv::sortIdx sorts each matrix row or each matrix column in the\nascending or descending order. So you should pass two operation flags to\nget desired behaviour. Instead of reordering the elements themselves, it\nstores the indices of sorted elements in the output array. For example:\n@code\n    Mat A = Mat::eye(3,3,CV_32F), B;\n    sortIdx(A, B, SORT_EVERY_ROW + SORT_ASCENDING);\n    // B will probably contain\n    // (because of equal elements in A some permutations are possible):\n    // [[1, 2, 0], [0, 2, 1], [0, 1, 2]]\n@endcode\n@param src input single-channel array.\n@param dst output integer array of the same size as src.\n@param flags operation flags that could be a combination of cv::SortFlags\n@sa sort, randShuffle\n*/\nCV_EXPORTS_W void sortIdx(InputArray src, OutputArray dst, int flags);\n\n/** @brief Finds the real roots of a cubic equation.\n\nThe function solveCubic finds the real roots of a cubic equation:\n-   if coeffs is a 4-element vector:\n\\f[\\texttt{coeffs} [0] x^3 +  \\texttt{coeffs} [1] x^2 +  \\texttt{coeffs} [2] x +  \\texttt{coeffs} [3] = 0\\f]\n-   if coeffs is a 3-element vector:\n\\f[x^3 +  \\texttt{coeffs} [0] x^2 +  \\texttt{coeffs} [1] x +  \\texttt{coeffs} [2] = 0\\f]\n\nThe roots are stored in the roots array.\n@param coeffs equation coefficients, an array of 3 or 4 elements.\n@param roots output array of real roots that has 1 or 3 elements.\n@return number of real roots. It can be 0, 1 or 2.\n*/\nCV_EXPORTS_W int solveCubic(InputArray coeffs, OutputArray roots);\n\n/** @brief Finds the real or complex roots of a polynomial equation.\n\nThe function cv::solvePoly finds real and complex roots of a polynomial equation:\n\\f[\\texttt{coeffs} [n] x^{n} +  \\texttt{coeffs} [n-1] x^{n-1} + ... +  \\texttt{coeffs} [1] x +  \\texttt{coeffs} [0] = 0\\f]\n@param coeffs array of polynomial coefficients.\n@param roots output (complex) array of roots.\n@param maxIters maximum number of iterations the algorithm does.\n*/\nCV_EXPORTS_W double solvePoly(InputArray coeffs, OutputArray roots, int maxIters = 300);\n\n/** @brief Calculates eigenvalues and eigenvectors of a symmetric matrix.\n\nThe function cv::eigen calculates just eigenvalues, or eigenvalues and eigenvectors of the symmetric\nmatrix src:\n@code\n    src*eigenvectors.row(i).t() = eigenvalues.at<srcType>(i)*eigenvectors.row(i).t()\n@endcode\n\n@note Use cv::eigenNonSymmetric for calculation of real eigenvalues and eigenvectors of non-symmetric matrix.\n\n@param src input matrix that must have CV_32FC1 or CV_64FC1 type, square size and be symmetrical\n(src ^T^ == src).\n@param eigenvalues output vector of eigenvalues of the same type as src; the eigenvalues are stored\nin the descending order.\n@param eigenvectors output matrix of eigenvectors; it has the same size and type as src; the\neigenvectors are stored as subsequent matrix rows, in the same order as the corresponding\neigenvalues.\n@sa eigenNonSymmetric, completeSymm , PCA\n*/\nCV_EXPORTS_W bool eigen(InputArray src, OutputArray eigenvalues,\n                        OutputArray eigenvectors = noArray());\n\n/** @brief Calculates eigenvalues and eigenvectors of a non-symmetric matrix (real eigenvalues only).\n\n@note Assumes real eigenvalues.\n\nThe function calculates eigenvalues and eigenvectors (optional) of the square matrix src:\n@code\n    src*eigenvectors.row(i).t() = eigenvalues.at<srcType>(i)*eigenvectors.row(i).t()\n@endcode\n\n@param src input matrix (CV_32FC1 or CV_64FC1 type).\n@param eigenvalues output vector of eigenvalues (type is the same type as src).\n@param eigenvectors output matrix of eigenvectors (type is the same type as src). The eigenvectors are stored as subsequent matrix rows, in the same order as the corresponding eigenvalues.\n@sa eigen\n*/\nCV_EXPORTS_W void eigenNonSymmetric(InputArray src, OutputArray eigenvalues,\n                                    OutputArray eigenvectors);\n\n/** @brief Calculates the covariance matrix of a set of vectors.\n\nThe function cv::calcCovarMatrix calculates the covariance matrix and, optionally, the mean vector of\nthe set of input vectors.\n@param samples samples stored as separate matrices\n@param nsamples number of samples\n@param covar output covariance matrix of the type ctype and square size.\n@param mean input or output (depending on the flags) array as the average value of the input vectors.\n@param flags operation flags as a combination of #CovarFlags\n@param ctype type of the matrixl; it equals 'CV_64F' by default.\n@sa PCA, mulTransposed, Mahalanobis\n@todo InputArrayOfArrays\n*/\nCV_EXPORTS void calcCovarMatrix( const Mat* samples, int nsamples, Mat& covar, Mat& mean,\n                                 int flags, int ctype = CV_64F);\n\n/** @overload\n@note use #COVAR_ROWS or #COVAR_COLS flag\n@param samples samples stored as rows/columns of a single matrix.\n@param covar output covariance matrix of the type ctype and square size.\n@param mean input or output (depending on the flags) array as the average value of the input vectors.\n@param flags operation flags as a combination of #CovarFlags\n@param ctype type of the matrixl; it equals 'CV_64F' by default.\n*/\nCV_EXPORTS_W void calcCovarMatrix( InputArray samples, OutputArray covar,\n                                   InputOutputArray mean, int flags, int ctype = CV_64F);\n\n/** wrap PCA::operator() */\nCV_EXPORTS_W void PCACompute(InputArray data, InputOutputArray mean,\n                             OutputArray eigenvectors, int maxComponents = 0);\n\n/** wrap PCA::operator() and add eigenvalues output parameter */\nCV_EXPORTS_AS(PCACompute2) void PCACompute(InputArray data, InputOutputArray mean,\n                                           OutputArray eigenvectors, OutputArray eigenvalues,\n                                           int maxComponents = 0);\n\n/** wrap PCA::operator() */\nCV_EXPORTS_W void PCACompute(InputArray data, InputOutputArray mean,\n                             OutputArray eigenvectors, double retainedVariance);\n\n/** wrap PCA::operator() and add eigenvalues output parameter */\nCV_EXPORTS_AS(PCACompute2) void PCACompute(InputArray data, InputOutputArray mean,\n                                           OutputArray eigenvectors, OutputArray eigenvalues,\n                                           double retainedVariance);\n\n/** wrap PCA::project */\nCV_EXPORTS_W void PCAProject(InputArray data, InputArray mean,\n                             InputArray eigenvectors, OutputArray result);\n\n/** wrap PCA::backProject */\nCV_EXPORTS_W void PCABackProject(InputArray data, InputArray mean,\n                                 InputArray eigenvectors, OutputArray result);\n\n/** wrap SVD::compute */\nCV_EXPORTS_W void SVDecomp( InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags = 0 );\n\n/** wrap SVD::backSubst */\nCV_EXPORTS_W void SVBackSubst( InputArray w, InputArray u, InputArray vt,\n                               InputArray rhs, OutputArray dst );\n\n/** @brief Calculates the Mahalanobis distance between two vectors.\n\nThe function cv::Mahalanobis calculates and returns the weighted distance between two vectors:\n\\f[d( \\texttt{vec1} , \\texttt{vec2} )= \\sqrt{\\sum_{i,j}{\\texttt{icovar(i,j)}\\cdot(\\texttt{vec1}(I)-\\texttt{vec2}(I))\\cdot(\\texttt{vec1(j)}-\\texttt{vec2(j)})} }\\f]\nThe covariance matrix may be calculated using the #calcCovarMatrix function and then inverted using\nthe invert function (preferably using the #DECOMP_SVD method, as the most accurate).\n@param v1 first 1D input vector.\n@param v2 second 1D input vector.\n@param icovar inverse covariance matrix.\n*/\nCV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar);\n\n/** @brief Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-point array.\n\nThe function cv::dft performs one of the following:\n-   Forward the Fourier transform of a 1D vector of N elements:\n    \\f[Y = F^{(N)}  \\cdot X,\\f]\n    where \\f$F^{(N)}_{jk}=\\exp(-2\\pi i j k/N)\\f$ and \\f$i=\\sqrt{-1}\\f$\n-   Inverse the Fourier transform of a 1D vector of N elements:\n    \\f[\\begin{array}{l} X'=  \\left (F^{(N)} \\right )^{-1}  \\cdot Y =  \\left (F^{(N)} \\right )^*  \\cdot y  \\\\ X = (1/N)  \\cdot X, \\end{array}\\f]\n    where \\f$F^*=\\left(\\textrm{Re}(F^{(N)})-\\textrm{Im}(F^{(N)})\\right)^T\\f$\n-   Forward the 2D Fourier transform of a M x N matrix:\n    \\f[Y = F^{(M)}  \\cdot X  \\cdot F^{(N)}\\f]\n-   Inverse the 2D Fourier transform of a M x N matrix:\n    \\f[\\begin{array}{l} X'=  \\left (F^{(M)} \\right )^*  \\cdot Y  \\cdot \\left (F^{(N)} \\right )^* \\\\ X =  \\frac{1}{M \\cdot N} \\cdot X' \\end{array}\\f]\n\nIn case of real (single-channel) data, the output spectrum of the forward Fourier transform or input\nspectrum of the inverse Fourier transform can be represented in a packed format called *CCS*\n(complex-conjugate-symmetrical). It was borrowed from IPL (Intel\\* Image Processing Library). Here\nis how 2D *CCS* spectrum looks:\n\\f[\\begin{bmatrix} Re Y_{0,0} & Re Y_{0,1} & Im Y_{0,1} & Re Y_{0,2} & Im Y_{0,2} &  \\cdots & Re Y_{0,N/2-1} & Im Y_{0,N/2-1} & Re Y_{0,N/2}  \\\\ Re Y_{1,0} & Re Y_{1,1} & Im Y_{1,1} & Re Y_{1,2} & Im Y_{1,2} &  \\cdots & Re Y_{1,N/2-1} & Im Y_{1,N/2-1} & Re Y_{1,N/2}  \\\\ Im Y_{1,0} & Re Y_{2,1} & Im Y_{2,1} & Re Y_{2,2} & Im Y_{2,2} &  \\cdots & Re Y_{2,N/2-1} & Im Y_{2,N/2-1} & Im Y_{1,N/2}  \\\\ \\hdotsfor{9} \\\\ Re Y_{M/2-1,0} &  Re Y_{M-3,1}  & Im Y_{M-3,1} &  \\hdotsfor{3} & Re Y_{M-3,N/2-1} & Im Y_{M-3,N/2-1}& Re Y_{M/2-1,N/2}  \\\\ Im Y_{M/2-1,0} &  Re Y_{M-2,1}  & Im Y_{M-2,1} &  \\hdotsfor{3} & Re Y_{M-2,N/2-1} & Im Y_{M-2,N/2-1}& Im Y_{M/2-1,N/2}  \\\\ Re Y_{M/2,0}  &  Re Y_{M-1,1} &  Im Y_{M-1,1} &  \\hdotsfor{3} & Re Y_{M-1,N/2-1} & Im Y_{M-1,N/2-1}& Re Y_{M/2,N/2} \\end{bmatrix}\\f]\n\nIn case of 1D transform of a real vector, the output looks like the first row of the matrix above.\n\nSo, the function chooses an operation mode depending on the flags and size of the input array:\n-   If #DFT_ROWS is set or the input array has a single row or single column, the function\n    performs a 1D forward or inverse transform of each row of a matrix when #DFT_ROWS is set.\n    Otherwise, it performs a 2D transform.\n-   If the input array is real and #DFT_INVERSE is not set, the function performs a forward 1D or\n    2D transform:\n    -   When #DFT_COMPLEX_OUTPUT is set, the output is a complex matrix of the same size as\n        input.\n    -   When #DFT_COMPLEX_OUTPUT is not set, the output is a real matrix of the same size as\n        input. In case of 2D transform, it uses the packed format as shown above. In case of a\n        single 1D transform, it looks like the first row of the matrix above. In case of\n        multiple 1D transforms (when using the #DFT_ROWS flag), each row of the output matrix\n        looks like the first row of the matrix above.\n-   If the input array is complex and either #DFT_INVERSE or #DFT_REAL_OUTPUT are not set, the\n    output is a complex array of the same size as input. The function performs a forward or\n    inverse 1D or 2D transform of the whole input array or each row of the input array\n    independently, depending on the flags DFT_INVERSE and DFT_ROWS.\n-   When #DFT_INVERSE is set and the input array is real, or it is complex but #DFT_REAL_OUTPUT\n    is set, the output is a real array of the same size as input. The function performs a 1D or 2D\n    inverse transformation of the whole input array or each individual row, depending on the flags\n    #DFT_INVERSE and #DFT_ROWS.\n\nIf #DFT_SCALE is set, the scaling is done after the transformation.\n\nUnlike dct , the function supports arrays of arbitrary size. But only those arrays are processed\nefficiently, whose sizes can be factorized in a product of small prime numbers (2, 3, and 5 in the\ncurrent implementation). Such an efficient DFT size can be calculated using the getOptimalDFTSize\nmethod.\n\nThe sample below illustrates how to calculate a DFT-based convolution of two 2D real arrays:\n@code\n    void convolveDFT(InputArray A, InputArray B, OutputArray C)\n    {\n        // reallocate the output array if needed\n        C.create(abs(A.rows - B.rows)+1, abs(A.cols - B.cols)+1, A.type());\n        Size dftSize;\n        // calculate the size of DFT transform\n        dftSize.width = getOptimalDFTSize(A.cols + B.cols - 1);\n        dftSize.height = getOptimalDFTSize(A.rows + B.rows - 1);\n\n        // allocate temporary buffers and initialize them with 0's\n        Mat tempA(dftSize, A.type(), Scalar::all(0));\n        Mat tempB(dftSize, B.type(), Scalar::all(0));\n\n        // copy A and B to the top-left corners of tempA and tempB, respectively\n        Mat roiA(tempA, Rect(0,0,A.cols,A.rows));\n        A.copyTo(roiA);\n        Mat roiB(tempB, Rect(0,0,B.cols,B.rows));\n        B.copyTo(roiB);\n\n        // now transform the padded A & B in-place;\n        // use \"nonzeroRows\" hint for faster processing\n        dft(tempA, tempA, 0, A.rows);\n        dft(tempB, tempB, 0, B.rows);\n\n        // multiply the spectrums;\n        // the function handles packed spectrum representations well\n        mulSpectrums(tempA, tempB, tempA);\n\n        // transform the product back from the frequency domain.\n        // Even though all the result rows will be non-zero,\n        // you need only the first C.rows of them, and thus you\n        // pass nonzeroRows == C.rows\n        dft(tempA, tempA, DFT_INVERSE + DFT_SCALE, C.rows);\n\n        // now copy the result back to C.\n        tempA(Rect(0, 0, C.cols, C.rows)).copyTo(C);\n\n        // all the temporary buffers will be deallocated automatically\n    }\n@endcode\nTo optimize this sample, consider the following approaches:\n-   Since nonzeroRows != 0 is passed to the forward transform calls and since A and B are copied to\n    the top-left corners of tempA and tempB, respectively, it is not necessary to clear the whole\n    tempA and tempB. It is only necessary to clear the tempA.cols - A.cols ( tempB.cols - B.cols)\n    rightmost columns of the matrices.\n-   This DFT-based convolution does not have to be applied to the whole big arrays, especially if B\n    is significantly smaller than A or vice versa. Instead, you can calculate convolution by parts.\n    To do this, you need to split the output array C into multiple tiles. For each tile, estimate\n    which parts of A and B are required to calculate convolution in this tile. If the tiles in C are\n    too small, the speed will decrease a lot because of repeated work. In the ultimate case, when\n    each tile in C is a single pixel, the algorithm becomes equivalent to the naive convolution\n    algorithm. If the tiles are too big, the temporary arrays tempA and tempB become too big and\n    there is also a slowdown because of bad cache locality. So, there is an optimal tile size\n    somewhere in the middle.\n-   If different tiles in C can be calculated in parallel and, thus, the convolution is done by\n    parts, the loop can be threaded.\n\nAll of the above improvements have been implemented in #matchTemplate and #filter2D . Therefore, by\nusing them, you can get the performance even better than with the above theoretically optimal\nimplementation. Though, those two functions actually calculate cross-correlation, not convolution,\nso you need to \"flip\" the second convolution operand B vertically and horizontally using flip .\n@note\n-   An example using the discrete fourier transform can be found at\n    opencv_source_code/samples/cpp/dft.cpp\n-   (Python) An example using the dft functionality to perform Wiener deconvolution can be found\n    at opencv_source/samples/python/deconvolution.py\n-   (Python) An example rearranging the quadrants of a Fourier image can be found at\n    opencv_source/samples/python/dft.py\n@param src input array that could be real or complex.\n@param dst output array whose size and type depends on the flags .\n@param flags transformation flags, representing a combination of the #DftFlags\n@param nonzeroRows when the parameter is not zero, the function assumes that only the first\nnonzeroRows rows of the input array (#DFT_INVERSE is not set) or only the first nonzeroRows of the\noutput array (#DFT_INVERSE is set) contain non-zeros, thus, the function can handle the rest of the\nrows more efficiently and save some time; this technique is very useful for calculating array\ncross-correlation or convolution using DFT.\n@sa dct , getOptimalDFTSize , mulSpectrums, filter2D , matchTemplate , flip , cartToPolar ,\nmagnitude , phase\n*/\nCV_EXPORTS_W void dft(InputArray src, OutputArray dst, int flags = 0, int nonzeroRows = 0);\n\n/** @brief Calculates the inverse Discrete Fourier Transform of a 1D or 2D array.\n\nidft(src, dst, flags) is equivalent to dft(src, dst, flags | #DFT_INVERSE) .\n@note None of dft and idft scales the result by default. So, you should pass #DFT_SCALE to one of\ndft or idft explicitly to make these transforms mutually inverse.\n@sa dft, dct, idct, mulSpectrums, getOptimalDFTSize\n@param src input floating-point real or complex array.\n@param dst output array whose size and type depend on the flags.\n@param flags operation flags (see dft and #DftFlags).\n@param nonzeroRows number of dst rows to process; the rest of the rows have undefined content (see\nthe convolution sample in dft description.\n*/\nCV_EXPORTS_W void idft(InputArray src, OutputArray dst, int flags = 0, int nonzeroRows = 0);\n\n/** @brief Performs a forward or inverse discrete Cosine transform of 1D or 2D array.\n\nThe function cv::dct performs a forward or inverse discrete Cosine transform (DCT) of a 1D or 2D\nfloating-point array:\n-   Forward Cosine transform of a 1D vector of N elements:\n    \\f[Y = C^{(N)}  \\cdot X\\f]\n    where\n    \\f[C^{(N)}_{jk}= \\sqrt{\\alpha_j/N} \\cos \\left ( \\frac{\\pi(2k+1)j}{2N} \\right )\\f]\n    and\n    \\f$\\alpha_0=1\\f$, \\f$\\alpha_j=2\\f$ for *j \\> 0*.\n-   Inverse Cosine transform of a 1D vector of N elements:\n    \\f[X =  \\left (C^{(N)} \\right )^{-1}  \\cdot Y =  \\left (C^{(N)} \\right )^T  \\cdot Y\\f]\n    (since \\f$C^{(N)}\\f$ is an orthogonal matrix, \\f$C^{(N)} \\cdot \\left(C^{(N)}\\right)^T = I\\f$ )\n-   Forward 2D Cosine transform of M x N matrix:\n    \\f[Y = C^{(N)}  \\cdot X  \\cdot \\left (C^{(N)} \\right )^T\\f]\n-   Inverse 2D Cosine transform of M x N matrix:\n    \\f[X =  \\left (C^{(N)} \\right )^T  \\cdot X  \\cdot C^{(N)}\\f]\n\nThe function chooses the mode of operation by looking at the flags and size of the input array:\n-   If (flags & #DCT_INVERSE) == 0 , the function does a forward 1D or 2D transform. Otherwise, it\n    is an inverse 1D or 2D transform.\n-   If (flags & #DCT_ROWS) != 0 , the function performs a 1D transform of each row.\n-   If the array is a single column or a single row, the function performs a 1D transform.\n-   If none of the above is true, the function performs a 2D transform.\n\n@note Currently dct supports even-size arrays (2, 4, 6 ...). For data analysis and approximation, you\ncan pad the array when necessary.\nAlso, the function performance depends very much, and not monotonically, on the array size (see\ngetOptimalDFTSize ). In the current implementation DCT of a vector of size N is calculated via DFT\nof a vector of size N/2 . Thus, the optimal DCT size N1 \\>= N can be calculated as:\n@code\n    size_t getOptimalDCTSize(size_t N) { return 2*getOptimalDFTSize((N+1)/2); }\n    N1 = getOptimalDCTSize(N);\n@endcode\n@param src input floating-point array.\n@param dst output array of the same size and type as src .\n@param flags transformation flags as a combination of cv::DftFlags (DCT_*)\n@sa dft , getOptimalDFTSize , idct\n*/\nCV_EXPORTS_W void dct(InputArray src, OutputArray dst, int flags = 0);\n\n/** @brief Calculates the inverse Discrete Cosine Transform of a 1D or 2D array.\n\nidct(src, dst, flags) is equivalent to dct(src, dst, flags | DCT_INVERSE).\n@param src input floating-point single-channel array.\n@param dst output array of the same size and type as src.\n@param flags operation flags.\n@sa  dct, dft, idft, getOptimalDFTSize\n*/\nCV_EXPORTS_W void idct(InputArray src, OutputArray dst, int flags = 0);\n\n/** @brief Performs the per-element multiplication of two Fourier spectrums.\n\nThe function cv::mulSpectrums performs the per-element multiplication of the two CCS-packed or complex\nmatrices that are results of a real or complex Fourier transform.\n\nThe function, together with dft and idft , may be used to calculate convolution (pass conjB=false )\nor correlation (pass conjB=true ) of two arrays rapidly. When the arrays are complex, they are\nsimply multiplied (per element) with an optional conjugation of the second-array elements. When the\narrays are real, they are assumed to be CCS-packed (see dft for details).\n@param a first input array.\n@param b second input array of the same size and type as src1 .\n@param c output array of the same size and type as src1 .\n@param flags operation flags; currently, the only supported flag is cv::DFT_ROWS, which indicates that\neach row of src1 and src2 is an independent 1D Fourier spectrum. If you do not want to use this flag, then simply add a `0` as value.\n@param conjB optional flag that conjugates the second input array before the multiplication (true)\nor not (false).\n*/\nCV_EXPORTS_W void mulSpectrums(InputArray a, InputArray b, OutputArray c,\n                               int flags, bool conjB = false);\n\n/** @brief Returns the optimal DFT size for a given vector size.\n\nDFT performance is not a monotonic function of a vector size. Therefore, when you calculate\nconvolution of two arrays or perform the spectral analysis of an array, it usually makes sense to\npad the input data with zeros to get a bit larger array that can be transformed much faster than the\noriginal one. Arrays whose size is a power-of-two (2, 4, 8, 16, 32, ...) are the fastest to process.\nThough, the arrays whose size is a product of 2's, 3's, and 5's (for example, 300 = 5\\*5\\*3\\*2\\*2)\nare also processed quite efficiently.\n\nThe function cv::getOptimalDFTSize returns the minimum number N that is greater than or equal to vecsize\nso that the DFT of a vector of size N can be processed efficiently. In the current implementation N\n= 2 ^p^ \\* 3 ^q^ \\* 5 ^r^ for some integer p, q, r.\n\nThe function returns a negative number if vecsize is too large (very close to INT_MAX ).\n\nWhile the function cannot be used directly to estimate the optimal vector size for DCT transform\n(since the current DCT implementation supports only even-size vectors), it can be easily processed\nas getOptimalDFTSize((vecsize+1)/2)\\*2.\n@param vecsize vector size.\n@sa dft , dct , idft , idct , mulSpectrums\n*/\nCV_EXPORTS_W int getOptimalDFTSize(int vecsize);\n\n/** @brief Returns the default random number generator.\n\nThe function cv::theRNG returns the default random number generator. For each thread, there is a\nseparate random number generator, so you can use the function safely in multi-thread environments.\nIf you just need to get a single random number using this generator or initialize an array, you can\nuse randu or randn instead. But if you are going to generate many random numbers inside a loop, it\nis much faster to use this function to retrieve the generator and then use RNG::operator _Tp() .\n@sa RNG, randu, randn\n*/\nCV_EXPORTS RNG& theRNG();\n\n/** @brief Sets state of default random number generator.\n\nThe function cv::setRNGSeed sets state of default random number generator to custom value.\n@param seed new state for default random number generator\n@sa RNG, randu, randn\n*/\nCV_EXPORTS_W void setRNGSeed(int seed);\n\n/** @brief Generates a single uniformly-distributed random number or an array of random numbers.\n\nNon-template variant of the function fills the matrix dst with uniformly-distributed\nrandom numbers from the specified range:\n\\f[\\texttt{low} _c  \\leq \\texttt{dst} (I)_c <  \\texttt{high} _c\\f]\n@param dst output array of random numbers; the array must be pre-allocated.\n@param low inclusive lower boundary of the generated random numbers.\n@param high exclusive upper boundary of the generated random numbers.\n@sa RNG, randn, theRNG\n*/\nCV_EXPORTS_W void randu(InputOutputArray dst, InputArray low, InputArray high);\n\n/** @brief Fills the array with normally distributed random numbers.\n\nThe function cv::randn fills the matrix dst with normally distributed random numbers with the specified\nmean vector and the standard deviation matrix. The generated random numbers are clipped to fit the\nvalue range of the output array data type.\n@param dst output array of random numbers; the array must be pre-allocated and have 1 to 4 channels.\n@param mean mean value (expectation) of the generated random numbers.\n@param stddev standard deviation of the generated random numbers; it can be either a vector (in\nwhich case a diagonal standard deviation matrix is assumed) or a square matrix.\n@sa RNG, randu\n*/\nCV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev);\n\n/** @brief Shuffles the array elements randomly.\n\nThe function cv::randShuffle shuffles the specified 1D array by randomly choosing pairs of elements and\nswapping them. The number of such swap operations will be dst.rows\\*dst.cols\\*iterFactor .\n@param dst input/output numerical 1D array.\n@param iterFactor scale factor that determines the number of random swap operations (see the details\nbelow).\n@param rng optional random number generator used for shuffling; if it is zero, theRNG () is used\ninstead.\n@sa RNG, sort\n*/\nCV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0);\n\n/** @brief Principal Component Analysis\n\nThe class is used to calculate a special basis for a set of vectors. The\nbasis will consist of eigenvectors of the covariance matrix calculated\nfrom the input set of vectors. The class %PCA can also transform\nvectors to/from the new coordinate space defined by the basis. Usually,\nin this new coordinate system, each vector from the original set (and\nany linear combination of such vectors) can be quite accurately\napproximated by taking its first few components, corresponding to the\neigenvectors of the largest eigenvalues of the covariance matrix.\nGeometrically it means that you calculate a projection of the vector to\na subspace formed by a few eigenvectors corresponding to the dominant\neigenvalues of the covariance matrix. And usually such a projection is\nvery close to the original vector. So, you can represent the original\nvector from a high-dimensional space with a much shorter vector\nconsisting of the projected vector's coordinates in the subspace. Such a\ntransformation is also known as Karhunen-Loeve Transform, or KLT.\nSee http://en.wikipedia.org/wiki/Principal_component_analysis\n\nThe sample below is the function that takes two matrices. The first\nfunction stores a set of vectors (a row per vector) that is used to\ncalculate PCA. The second function stores another \"test\" set of vectors\n(a row per vector). First, these vectors are compressed with PCA, then\nreconstructed back, and then the reconstruction error norm is computed\nand printed for each vector. :\n\n@code{.cpp}\nusing namespace cv;\n\nPCA compressPCA(const Mat& pcaset, int maxComponents,\n                const Mat& testset, Mat& compressed)\n{\n    PCA pca(pcaset, // pass the data\n            Mat(), // we do not have a pre-computed mean vector,\n                   // so let the PCA engine to compute it\n            PCA::DATA_AS_ROW, // indicate that the vectors\n                                // are stored as matrix rows\n                                // (use PCA::DATA_AS_COL if the vectors are\n                                // the matrix columns)\n            maxComponents // specify, how many principal components to retain\n            );\n    // if there is no test data, just return the computed basis, ready-to-use\n    if( !testset.data )\n        return pca;\n    CV_Assert( testset.cols == pcaset.cols );\n\n    compressed.create(testset.rows, maxComponents, testset.type());\n\n    Mat reconstructed;\n    for( int i = 0; i < testset.rows; i++ )\n    {\n        Mat vec = testset.row(i), coeffs = compressed.row(i), reconstructed;\n        // compress the vector, the result will be stored\n        // in the i-th row of the output matrix\n        pca.project(vec, coeffs);\n        // and then reconstruct it\n        pca.backProject(coeffs, reconstructed);\n        // and measure the error\n        printf(\"%d. diff = %g\\n\", i, norm(vec, reconstructed, NORM_L2));\n    }\n    return pca;\n}\n@endcode\n@sa calcCovarMatrix, mulTransposed, SVD, dft, dct\n*/\nclass CV_EXPORTS PCA\n{\npublic:\n    enum Flags { DATA_AS_ROW = 0, //!< indicates that the input samples are stored as matrix rows\n                 DATA_AS_COL = 1, //!< indicates that the input samples are stored as matrix columns\n                 USE_AVG     = 2  //!\n               };\n\n    /** @brief default constructor\n\n    The default constructor initializes an empty %PCA structure. The other\n    constructors initialize the structure and call PCA::operator()().\n    */\n    PCA();\n\n    /** @overload\n    @param data input samples stored as matrix rows or matrix columns.\n    @param mean optional mean value; if the matrix is empty (@c noArray()),\n    the mean is computed from the data.\n    @param flags operation flags; currently the parameter is only used to\n    specify the data layout (PCA::Flags)\n    @param maxComponents maximum number of components that %PCA should\n    retain; by default, all the components are retained.\n    */\n    PCA(InputArray data, InputArray mean, int flags, int maxComponents = 0);\n\n    /** @overload\n    @param data input samples stored as matrix rows or matrix columns.\n    @param mean optional mean value; if the matrix is empty (noArray()),\n    the mean is computed from the data.\n    @param flags operation flags; currently the parameter is only used to\n    specify the data layout (PCA::Flags)\n    @param retainedVariance Percentage of variance that PCA should retain.\n    Using this parameter will let the PCA decided how many components to\n    retain but it will always keep at least 2.\n    */\n    PCA(InputArray data, InputArray mean, int flags, double retainedVariance);\n\n    /** @brief performs %PCA\n\n    The operator performs %PCA of the supplied dataset. It is safe to reuse\n    the same PCA structure for multiple datasets. That is, if the structure\n    has been previously used with another dataset, the existing internal\n    data is reclaimed and the new @ref eigenvalues, @ref eigenvectors and @ref\n    mean are allocated and computed.\n\n    The computed @ref eigenvalues are sorted from the largest to the smallest and\n    the corresponding @ref eigenvectors are stored as eigenvectors rows.\n\n    @param data input samples stored as the matrix rows or as the matrix\n    columns.\n    @param mean optional mean value; if the matrix is empty (noArray()),\n    the mean is computed from the data.\n    @param flags operation flags; currently the parameter is only used to\n    specify the data layout. (Flags)\n    @param maxComponents maximum number of components that PCA should\n    retain; by default, all the components are retained.\n    */\n    PCA& operator()(InputArray data, InputArray mean, int flags, int maxComponents = 0);\n\n    /** @overload\n    @param data input samples stored as the matrix rows or as the matrix\n    columns.\n    @param mean optional mean value; if the matrix is empty (noArray()),\n    the mean is computed from the data.\n    @param flags operation flags; currently the parameter is only used to\n    specify the data layout. (PCA::Flags)\n    @param retainedVariance Percentage of variance that %PCA should retain.\n    Using this parameter will let the %PCA decided how many components to\n    retain but it will always keep at least 2.\n     */\n    PCA& operator()(InputArray data, InputArray mean, int flags, double retainedVariance);\n\n    /** @brief Projects vector(s) to the principal component subspace.\n\n    The methods project one or more vectors to the principal component\n    subspace, where each vector projection is represented by coefficients in\n    the principal component basis. The first form of the method returns the\n    matrix that the second form writes to the result. So the first form can\n    be used as a part of expression while the second form can be more\n    efficient in a processing loop.\n    @param vec input vector(s); must have the same dimensionality and the\n    same layout as the input data used at %PCA phase, that is, if\n    DATA_AS_ROW are specified, then `vec.cols==data.cols`\n    (vector dimensionality) and `vec.rows` is the number of vectors to\n    project, and the same is true for the PCA::DATA_AS_COL case.\n    */\n    Mat project(InputArray vec) const;\n\n    /** @overload\n    @param vec input vector(s); must have the same dimensionality and the\n    same layout as the input data used at PCA phase, that is, if\n    DATA_AS_ROW are specified, then `vec.cols==data.cols`\n    (vector dimensionality) and `vec.rows` is the number of vectors to\n    project, and the same is true for the PCA::DATA_AS_COL case.\n    @param result output vectors; in case of PCA::DATA_AS_COL, the\n    output matrix has as many columns as the number of input vectors, this\n    means that `result.cols==vec.cols` and the number of rows match the\n    number of principal components (for example, `maxComponents` parameter\n    passed to the constructor).\n     */\n    void project(InputArray vec, OutputArray result) const;\n\n    /** @brief Reconstructs vectors from their PC projections.\n\n    The methods are inverse operations to PCA::project. They take PC\n    coordinates of projected vectors and reconstruct the original vectors.\n    Unless all the principal components have been retained, the\n    reconstructed vectors are different from the originals. But typically,\n    the difference is small if the number of components is large enough (but\n    still much smaller than the original vector dimensionality). As a\n    result, PCA is used.\n    @param vec coordinates of the vectors in the principal component\n    subspace, the layout and size are the same as of PCA::project output\n    vectors.\n     */\n    Mat backProject(InputArray vec) const;\n\n    /** @overload\n    @param vec coordinates of the vectors in the principal component\n    subspace, the layout and size are the same as of PCA::project output\n    vectors.\n    @param result reconstructed vectors; the layout and size are the same as\n    of PCA::project input vectors.\n     */\n    void backProject(InputArray vec, OutputArray result) const;\n\n    /** @brief write PCA objects\n\n    Writes @ref eigenvalues @ref eigenvectors and @ref mean to specified FileStorage\n     */\n    void write(FileStorage& fs) const;\n\n    /** @brief load PCA objects\n\n    Loads @ref eigenvalues @ref eigenvectors and @ref mean from specified FileNode\n     */\n    void read(const FileNode& fn);\n\n    Mat eigenvectors; //!< eigenvectors of the covariation matrix\n    Mat eigenvalues; //!< eigenvalues of the covariation matrix\n    Mat mean; //!< mean value subtracted before the projection and added after the back projection\n};\n\n/** @example samples/cpp/pca.cpp\nAn example using %PCA for dimensionality reduction while maintaining an amount of variance\n*/\n\n/** @example samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp\nCheck @ref tutorial_introduction_to_pca \"the corresponding tutorial\" for more details\n*/\n\n/**\n@brief Linear Discriminant Analysis\n@todo document this class\n*/\nclass CV_EXPORTS LDA\n{\npublic:\n    /** @brief constructor\n    Initializes a LDA with num_components (default 0).\n    */\n    explicit LDA(int num_components = 0);\n\n    /** Initializes and performs a Discriminant Analysis with Fisher's\n     Optimization Criterion on given data in src and corresponding labels\n     in labels. If 0 (or less) number of components are given, they are\n     automatically determined for given data in computation.\n    */\n    LDA(InputArrayOfArrays src, InputArray labels, int num_components = 0);\n\n    /** Serializes this object to a given filename.\n      */\n    void save(const String& filename) const;\n\n    /** Deserializes this object from a given filename.\n      */\n    void load(const String& filename);\n\n    /** Serializes this object to a given cv::FileStorage.\n      */\n    void save(FileStorage& fs) const;\n\n    /** Deserializes this object from a given cv::FileStorage.\n      */\n    void load(const FileStorage& node);\n\n    /** destructor\n      */\n    ~LDA();\n\n    /** Compute the discriminants for data in src (row aligned) and labels.\n      */\n    void compute(InputArrayOfArrays src, InputArray labels);\n\n    /** Projects samples into the LDA subspace.\n        src may be one or more row aligned samples.\n      */\n    Mat project(InputArray src);\n\n    /** Reconstructs projections from the LDA subspace.\n        src may be one or more row aligned projections.\n      */\n    Mat reconstruct(InputArray src);\n\n    /** Returns the eigenvectors of this LDA.\n      */\n    Mat eigenvectors() const { return _eigenvectors; }\n\n    /** Returns the eigenvalues of this LDA.\n      */\n    Mat eigenvalues() const { return _eigenvalues; }\n\n    static Mat subspaceProject(InputArray W, InputArray mean, InputArray src);\n    static Mat subspaceReconstruct(InputArray W, InputArray mean, InputArray src);\n\nprotected:\n    int _num_components;\n    Mat _eigenvectors;\n    Mat _eigenvalues;\n    void lda(InputArrayOfArrays src, InputArray labels);\n};\n\n/** @brief Singular Value Decomposition\n\nClass for computing Singular Value Decomposition of a floating-point\nmatrix. The Singular Value Decomposition is used to solve least-square\nproblems, under-determined linear systems, invert matrices, compute\ncondition numbers, and so on.\n\nIf you want to compute a condition number of a matrix or an absolute value of\nits determinant, you do not need `u` and `vt`. You can pass\nflags=SVD::NO_UV|... . Another flag SVD::FULL_UV indicates that full-size u\nand vt must be computed, which is not necessary most of the time.\n\n@sa invert, solve, eigen, determinant\n*/\nclass CV_EXPORTS SVD\n{\npublic:\n    enum Flags {\n        /** allow the algorithm to modify the decomposed matrix; it can save space and speed up\n            processing. currently ignored. */\n        MODIFY_A = 1,\n        /** indicates that only a vector of singular values `w` is to be processed, while u and vt\n            will be set to empty matrices */\n        NO_UV    = 2,\n        /** when the matrix is not square, by default the algorithm produces u and vt matrices of\n            sufficiently large size for the further A reconstruction; if, however, FULL_UV flag is\n            specified, u and vt will be full-size square orthogonal matrices.*/\n        FULL_UV  = 4\n    };\n\n    /** @brief the default constructor\n\n    initializes an empty SVD structure\n      */\n    SVD();\n\n    /** @overload\n    initializes an empty SVD structure and then calls SVD::operator()\n    @param src decomposed matrix. The depth has to be CV_32F or CV_64F.\n    @param flags operation flags (SVD::Flags)\n      */\n    SVD( InputArray src, int flags = 0 );\n\n    /** @brief the operator that performs SVD. The previously allocated u, w and vt are released.\n\n    The operator performs the singular value decomposition of the supplied\n    matrix. The u,`vt` , and the vector of singular values w are stored in\n    the structure. The same SVD structure can be reused many times with\n    different matrices. Each time, if needed, the previous u,`vt` , and w\n    are reclaimed and the new matrices are created, which is all handled by\n    Mat::create.\n    @param src decomposed matrix. The depth has to be CV_32F or CV_64F.\n    @param flags operation flags (SVD::Flags)\n      */\n    SVD& operator ()( InputArray src, int flags = 0 );\n\n    /** @brief decomposes matrix and stores the results to user-provided matrices\n\n    The methods/functions perform SVD of matrix. Unlike SVD::SVD constructor\n    and SVD::operator(), they store the results to the user-provided\n    matrices:\n\n    @code{.cpp}\n    Mat A, w, u, vt;\n    SVD::compute(A, w, u, vt);\n    @endcode\n\n    @param src decomposed matrix. The depth has to be CV_32F or CV_64F.\n    @param w calculated singular values\n    @param u calculated left singular vectors\n    @param vt transposed matrix of right singular vectors\n    @param flags operation flags - see SVD::Flags.\n      */\n    static void compute( InputArray src, OutputArray w,\n                         OutputArray u, OutputArray vt, int flags = 0 );\n\n    /** @overload\n    computes singular values of a matrix\n    @param src decomposed matrix. The depth has to be CV_32F or CV_64F.\n    @param w calculated singular values\n    @param flags operation flags - see SVD::Flags.\n      */\n    static void compute( InputArray src, OutputArray w, int flags = 0 );\n\n    /** @brief performs back substitution\n      */\n    static void backSubst( InputArray w, InputArray u,\n                           InputArray vt, InputArray rhs,\n                           OutputArray dst );\n\n    /** @brief solves an under-determined singular linear system\n\n    The method finds a unit-length solution x of a singular linear system\n    A\\*x = 0. Depending on the rank of A, there can be no solutions, a\n    single solution or an infinite number of solutions. In general, the\n    algorithm solves the following problem:\n    \\f[dst =  \\arg \\min _{x:  \\| x \\| =1}  \\| src  \\cdot x  \\|\\f]\n    @param src left-hand-side matrix.\n    @param dst found solution.\n      */\n    static void solveZ( InputArray src, OutputArray dst );\n\n    /** @brief performs a singular value back substitution.\n\n    The method calculates a back substitution for the specified right-hand\n    side:\n\n    \\f[\\texttt{x} =  \\texttt{vt} ^T  \\cdot diag( \\texttt{w} )^{-1}  \\cdot \\texttt{u} ^T  \\cdot \\texttt{rhs} \\sim \\texttt{A} ^{-1}  \\cdot \\texttt{rhs}\\f]\n\n    Using this technique you can either get a very accurate solution of the\n    convenient linear system, or the best (in the least-squares terms)\n    pseudo-solution of an overdetermined linear system.\n\n    @param rhs right-hand side of a linear system (u\\*w\\*v')\\*dst = rhs to\n    be solved, where A has been previously decomposed.\n\n    @param dst found solution of the system.\n\n    @note Explicit SVD with the further back substitution only makes sense\n    if you need to solve many linear systems with the same left-hand side\n    (for example, src ). If all you need is to solve a single system\n    (possibly with multiple rhs immediately available), simply call solve\n    add pass #DECOMP_SVD there. It does absolutely the same thing.\n      */\n    void backSubst( InputArray rhs, OutputArray dst ) const;\n\n    /** @todo document */\n    template<typename _Tp, int m, int n, int nm> static\n    void compute( const Matx<_Tp, m, n>& a, Matx<_Tp, nm, 1>& w, Matx<_Tp, m, nm>& u, Matx<_Tp, n, nm>& vt );\n\n    /** @todo document */\n    template<typename _Tp, int m, int n, int nm> static\n    void compute( const Matx<_Tp, m, n>& a, Matx<_Tp, nm, 1>& w );\n\n    /** @todo document */\n    template<typename _Tp, int m, int n, int nm, int nb> static\n    void backSubst( const Matx<_Tp, nm, 1>& w, const Matx<_Tp, m, nm>& u, const Matx<_Tp, n, nm>& vt, const Matx<_Tp, m, nb>& rhs, Matx<_Tp, n, nb>& dst );\n\n    Mat u, w, vt;\n};\n\n/** @brief Random Number Generator\n\nRandom number generator. It encapsulates the state (currently, a 64-bit\ninteger) and has methods to return scalar random values and to fill\narrays with random values. Currently it supports uniform and Gaussian\n(normal) distributions. The generator uses Multiply-With-Carry\nalgorithm, introduced by G. Marsaglia (\n<http://en.wikipedia.org/wiki/Multiply-with-carry> ).\nGaussian-distribution random numbers are generated using the Ziggurat\nalgorithm ( <http://en.wikipedia.org/wiki/Ziggurat_algorithm> ),\nintroduced by G. Marsaglia and W. W. Tsang.\n*/\nclass CV_EXPORTS RNG\n{\npublic:\n    enum { UNIFORM = 0,\n           NORMAL  = 1\n         };\n\n    /** @brief constructor\n\n    These are the RNG constructors. The first form sets the state to some\n    pre-defined value, equal to 2\\*\\*32-1 in the current implementation. The\n    second form sets the state to the specified value. If you passed state=0\n    , the constructor uses the above default value instead to avoid the\n    singular random number sequence, consisting of all zeros.\n    */\n    RNG();\n    /** @overload\n    @param state 64-bit value used to initialize the RNG.\n    */\n    RNG(uint64 state);\n    /**The method updates the state using the MWC algorithm and returns the\n    next 32-bit random number.*/\n    unsigned next();\n\n    /**Each of the methods updates the state using the MWC algorithm and\n    returns the next random number of the specified type. In case of integer\n    types, the returned number is from the available value range for the\n    specified type. In case of floating-point types, the returned value is\n    from [0,1) range.\n    */\n    operator uchar();\n    /** @overload */\n    operator schar();\n    /** @overload */\n    operator ushort();\n    /** @overload */\n    operator short();\n    /** @overload */\n    operator unsigned();\n    /** @overload */\n    operator int();\n    /** @overload */\n    operator float();\n    /** @overload */\n    operator double();\n\n    /** @brief returns a random integer sampled uniformly from [0, N).\n\n    The methods transform the state using the MWC algorithm and return the\n    next random number. The first form is equivalent to RNG::next . The\n    second form returns the random number modulo N , which means that the\n    result is in the range [0, N) .\n    */\n    unsigned operator ()();\n    /** @overload\n    @param N upper non-inclusive boundary of the returned random number.\n    */\n    unsigned operator ()(unsigned N);\n\n    /** @brief returns uniformly distributed integer random number from [a,b) range\n\n    The methods transform the state using the MWC algorithm and return the\n    next uniformly-distributed random number of the specified type, deduced\n    from the input parameter type, from the range [a, b) . There is a nuance\n    illustrated by the following sample:\n\n    @code{.cpp}\n    RNG rng;\n\n    // always produces 0\n    double a = rng.uniform(0, 1);\n\n    // produces double from [0, 1)\n    double a1 = rng.uniform((double)0, (double)1);\n\n    // produces float from [0, 1)\n    float b = rng.uniform(0.f, 1.f);\n\n    // produces double from [0, 1)\n    double c = rng.uniform(0., 1.);\n\n    // may cause compiler error because of ambiguity:\n    //  RNG::uniform(0, (int)0.999999)? or RNG::uniform((double)0, 0.99999)?\n    double d = rng.uniform(0, 0.999999);\n    @endcode\n\n    The compiler does not take into account the type of the variable to\n    which you assign the result of RNG::uniform . The only thing that\n    matters to the compiler is the type of a and b parameters. So, if you\n    want a floating-point random number, but the range boundaries are\n    integer numbers, either put dots in the end, if they are constants, or\n    use explicit type cast operators, as in the a1 initialization above.\n    @param a lower inclusive boundary of the returned random number.\n    @param b upper non-inclusive boundary of the returned random number.\n    */\n    int uniform(int a, int b);\n    /** @overload */\n    float uniform(float a, float b);\n    /** @overload */\n    double uniform(double a, double b);\n\n    /** @brief Fills arrays with random numbers.\n\n    @param mat 2D or N-dimensional matrix; currently matrices with more than\n    4 channels are not supported by the methods, use Mat::reshape as a\n    possible workaround.\n    @param distType distribution type, RNG::UNIFORM or RNG::NORMAL.\n    @param a first distribution parameter; in case of the uniform\n    distribution, this is an inclusive lower boundary, in case of the normal\n    distribution, this is a mean value.\n    @param b second distribution parameter; in case of the uniform\n    distribution, this is a non-inclusive upper boundary, in case of the\n    normal distribution, this is a standard deviation (diagonal of the\n    standard deviation matrix or the full standard deviation matrix).\n    @param saturateRange pre-saturation flag; for uniform distribution only;\n    if true, the method will first convert a and b to the acceptable value\n    range (according to the mat datatype) and then will generate uniformly\n    distributed random numbers within the range [saturate(a), saturate(b)),\n    if saturateRange=false, the method will generate uniformly distributed\n    random numbers in the original range [a, b) and then will saturate them,\n    it means, for example, that\n    <tt>theRNG().fill(mat_8u, RNG::UNIFORM, -DBL_MAX, DBL_MAX)</tt> will likely\n    produce array mostly filled with 0's and 255's, since the range (0, 255)\n    is significantly smaller than [-DBL_MAX, DBL_MAX).\n\n    Each of the methods fills the matrix with the random values from the\n    specified distribution. As the new numbers are generated, the RNG state\n    is updated accordingly. In case of multiple-channel images, every\n    channel is filled independently, which means that RNG cannot generate\n    samples from the multi-dimensional Gaussian distribution with\n    non-diagonal covariance matrix directly. To do that, the method\n    generates samples from multi-dimensional standard Gaussian distribution\n    with zero mean and identity covariation matrix, and then transforms them\n    using transform to get samples from the specified Gaussian distribution.\n    */\n    void fill( InputOutputArray mat, int distType, InputArray a, InputArray b, bool saturateRange = false );\n\n    /** @brief Returns the next random number sampled from the Gaussian distribution\n    @param sigma standard deviation of the distribution.\n\n    The method transforms the state using the MWC algorithm and returns the\n    next random number from the Gaussian distribution N(0,sigma) . That is,\n    the mean value of the returned random numbers is zero and the standard\n    deviation is the specified sigma .\n    */\n    double gaussian(double sigma);\n\n    uint64 state;\n\n    bool operator ==(const RNG& other) const;\n};\n\n/** @brief Mersenne Twister random number generator\n\nInspired by http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c\n@todo document\n*/\nclass CV_EXPORTS RNG_MT19937\n{\npublic:\n    RNG_MT19937();\n    RNG_MT19937(unsigned s);\n    void seed(unsigned s);\n\n    unsigned next();\n\n    operator int();\n    operator unsigned();\n    operator float();\n    operator double();\n\n    unsigned operator ()(unsigned N);\n    unsigned operator ()();\n\n    /** @brief returns uniformly distributed integer random number from [a,b) range*/\n    int uniform(int a, int b);\n    /** @brief returns uniformly distributed floating-point random number from [a,b) range*/\n    float uniform(float a, float b);\n    /** @brief returns uniformly distributed double-precision floating-point random number from [a,b) range*/\n    double uniform(double a, double b);\n\nprivate:\n    enum PeriodParameters {N = 624, M = 397};\n    unsigned state[N];\n    int mti;\n};\n\n//! @} core_array\n\n//! @addtogroup core_cluster\n//!  @{\n\n/** @example samples/cpp/kmeans.cpp\nAn example on K-means clustering\n*/\n\n/** @brief Finds centers of clusters and groups input samples around the clusters.\n\nThe function kmeans implements a k-means algorithm that finds the centers of cluster_count clusters\nand groups the input samples around the clusters. As an output, \\f$\\texttt{bestLabels}_i\\f$ contains a\n0-based cluster index for the sample stored in the \\f$i^{th}\\f$ row of the samples matrix.\n\n@note\n-   (Python) An example on K-means clustering can be found at\n    opencv_source_code/samples/python/kmeans.py\n@param data Data for clustering. An array of N-Dimensional points with float coordinates is needed.\nExamples of this array can be:\n-   Mat points(count, 2, CV_32F);\n-   Mat points(count, 1, CV_32FC2);\n-   Mat points(1, count, CV_32FC2);\n-   std::vector\\<cv::Point2f\\> points(sampleCount);\n@param K Number of clusters to split the set by.\n@param bestLabels Input/output integer array that stores the cluster indices for every sample.\n@param criteria The algorithm termination criteria, that is, the maximum number of iterations and/or\nthe desired accuracy. The accuracy is specified as criteria.epsilon. As soon as each of the cluster\ncenters moves by less than criteria.epsilon on some iteration, the algorithm stops.\n@param attempts Flag to specify the number of times the algorithm is executed using different\ninitial labellings. The algorithm returns the labels that yield the best compactness (see the last\nfunction parameter).\n@param flags Flag that can take values of cv::KmeansFlags\n@param centers Output matrix of the cluster centers, one row per each cluster center.\n@return The function returns the compactness measure that is computed as\n\\f[\\sum _i  \\| \\texttt{samples} _i -  \\texttt{centers} _{ \\texttt{labels} _i} \\| ^2\\f]\nafter every attempt. The best (minimum) value is chosen and the corresponding labels and the\ncompactness value are returned by the function. Basically, you can use only the core of the\nfunction, set the number of attempts to 1, initialize labels each time using a custom algorithm,\npass them with the ( flags = #KMEANS_USE_INITIAL_LABELS ) flag, and then choose the best\n(most-compact) clustering.\n*/\nCV_EXPORTS_W double kmeans( InputArray data, int K, InputOutputArray bestLabels,\n                            TermCriteria criteria, int attempts,\n                            int flags, OutputArray centers = noArray() );\n\n//! @} core_cluster\n\n//! @addtogroup core_basic\n//! @{\n\n/////////////////////////////// Formatted output of cv::Mat ///////////////////////////\n\n/** @todo document */\nclass CV_EXPORTS Formatted\n{\npublic:\n    virtual const char* next() = 0;\n    virtual void reset() = 0;\n    virtual ~Formatted();\n};\n\n/** @todo document */\nclass CV_EXPORTS Formatter\n{\npublic:\n    enum FormatType {\n           FMT_DEFAULT = 0,\n           FMT_MATLAB  = 1,\n           FMT_CSV     = 2,\n           FMT_PYTHON  = 3,\n           FMT_NUMPY   = 4,\n           FMT_C       = 5\n         };\n\n    virtual ~Formatter();\n\n    virtual Ptr<Formatted> format(const Mat& mtx) const = 0;\n\n    virtual void set16fPrecision(int p = 4) = 0;\n    virtual void set32fPrecision(int p = 8) = 0;\n    virtual void set64fPrecision(int p = 16) = 0;\n    virtual void setMultiline(bool ml = true) = 0;\n\n    static Ptr<Formatter> get(Formatter::FormatType fmt = FMT_DEFAULT);\n\n};\n\nstatic inline\nString& operator << (String& out, Ptr<Formatted> fmtd)\n{\n    fmtd->reset();\n    for(const char* str = fmtd->next(); str; str = fmtd->next())\n        out += cv::String(str);\n    return out;\n}\n\nstatic inline\nString& operator << (String& out, const Mat& mtx)\n{\n    return out << Formatter::get()->format(mtx);\n}\n\n//////////////////////////////////////// Algorithm ////////////////////////////////////\n\nclass CV_EXPORTS Algorithm;\n\ntemplate<typename _Tp, typename _EnumTp = void> struct ParamType {};\n\n\n/** @brief This is a base class for all more or less complex algorithms in OpenCV\n\nespecially for classes of algorithms, for which there can be multiple implementations. The examples\nare stereo correspondence (for which there are algorithms like block matching, semi-global block\nmatching, graph-cut etc.), background subtraction (which can be done using mixture-of-gaussians\nmodels, codebook-based algorithm etc.), optical flow (block matching, Lucas-Kanade, Horn-Schunck\netc.).\n\nHere is example of SimpleBlobDetector use in your application via Algorithm interface:\n@snippet snippets/core_various.cpp Algorithm\n*/\nclass CV_EXPORTS_W Algorithm\n{\npublic:\n    Algorithm();\n    virtual ~Algorithm();\n\n    /** @brief Clears the algorithm state\n    */\n    CV_WRAP virtual void clear() {}\n\n    /** @brief Stores algorithm parameters in a file storage\n    */\n    virtual void write(FileStorage& fs) const { CV_UNUSED(fs); }\n\n    /** @brief simplified API for language bindings\n    * @overload\n    */\n    CV_WRAP void write(const Ptr<FileStorage>& fs, const String& name = String()) const;\n\n    /** @brief Reads algorithm parameters from a file storage\n    */\n    CV_WRAP virtual void read(const FileNode& fn) { CV_UNUSED(fn); }\n\n    /** @brief Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read\n    */\n    CV_WRAP virtual bool empty() const { return false; }\n\n    /** @brief Reads algorithm from the file node\n\n    This is static template method of Algorithm. It's usage is following (in the case of SVM):\n    @code\n    cv::FileStorage fsRead(\"example.xml\", FileStorage::READ);\n    Ptr<SVM> svm = Algorithm::read<SVM>(fsRead.root());\n    @endcode\n    In order to make this method work, the derived class must overwrite Algorithm::read(const\n    FileNode& fn) and also have static create() method without parameters\n    (or with all the optional parameters)\n    */\n    template<typename _Tp> static Ptr<_Tp> read(const FileNode& fn)\n    {\n        Ptr<_Tp> obj = _Tp::create();\n        obj->read(fn);\n        return !obj->empty() ? obj : Ptr<_Tp>();\n    }\n\n    /** @brief Loads algorithm from the file\n\n    @param filename Name of the file to read.\n    @param objname The optional name of the node to read (if empty, the first top-level node will be used)\n\n    This is static template method of Algorithm. It's usage is following (in the case of SVM):\n    @code\n    Ptr<SVM> svm = Algorithm::load<SVM>(\"my_svm_model.xml\");\n    @endcode\n    In order to make this method work, the derived class must overwrite Algorithm::read(const\n    FileNode& fn).\n    */\n    template<typename _Tp> static Ptr<_Tp> load(const String& filename, const String& objname=String())\n    {\n        FileStorage fs(filename, FileStorage::READ);\n        CV_Assert(fs.isOpened());\n        FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname];\n        if (fn.empty()) return Ptr<_Tp>();\n        Ptr<_Tp> obj = _Tp::create();\n        obj->read(fn);\n        return !obj->empty() ? obj : Ptr<_Tp>();\n    }\n\n    /** @brief Loads algorithm from a String\n\n    @param strModel The string variable containing the model you want to load.\n    @param objname The optional name of the node to read (if empty, the first top-level node will be used)\n\n    This is static template method of Algorithm. It's usage is following (in the case of SVM):\n    @code\n    Ptr<SVM> svm = Algorithm::loadFromString<SVM>(myStringModel);\n    @endcode\n    */\n    template<typename _Tp> static Ptr<_Tp> loadFromString(const String& strModel, const String& objname=String())\n    {\n        FileStorage fs(strModel, FileStorage::READ + FileStorage::MEMORY);\n        FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname];\n        Ptr<_Tp> obj = _Tp::create();\n        obj->read(fn);\n        return !obj->empty() ? obj : Ptr<_Tp>();\n    }\n\n    /** Saves the algorithm to a file.\n    In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs). */\n    CV_WRAP virtual void save(const String& filename) const;\n\n    /** Returns the algorithm string identifier.\n    This string is used as top level xml/yml node tag when the object is saved to a file or string. */\n    CV_WRAP virtual String getDefaultName() const;\n\nprotected:\n    void writeFormat(FileStorage& fs) const;\n};\n\nenum struct Param {\n    INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7,\n    UNSIGNED_INT=8, UINT64=9, UCHAR=11, SCALAR=12\n};\n\n\n\ntemplate<> struct ParamType<bool>\n{\n    typedef bool const_param_type;\n    typedef bool member_type;\n\n    static const Param type = Param::BOOLEAN;\n};\n\ntemplate<> struct ParamType<int>\n{\n    typedef int const_param_type;\n    typedef int member_type;\n\n    static const Param type = Param::INT;\n};\n\ntemplate<> struct ParamType<double>\n{\n    typedef double const_param_type;\n    typedef double member_type;\n\n    static const Param type = Param::REAL;\n};\n\ntemplate<> struct ParamType<String>\n{\n    typedef const String& const_param_type;\n    typedef String member_type;\n\n    static const Param type = Param::STRING;\n};\n\ntemplate<> struct ParamType<Mat>\n{\n    typedef const Mat& const_param_type;\n    typedef Mat member_type;\n\n    static const Param type = Param::MAT;\n};\n\ntemplate<> struct ParamType<std::vector<Mat> >\n{\n    typedef const std::vector<Mat>& const_param_type;\n    typedef std::vector<Mat> member_type;\n\n    static const Param type = Param::MAT_VECTOR;\n};\n\ntemplate<> struct ParamType<Algorithm>\n{\n    typedef const Ptr<Algorithm>& const_param_type;\n    typedef Ptr<Algorithm> member_type;\n\n    static const Param type = Param::ALGORITHM;\n};\n\ntemplate<> struct ParamType<float>\n{\n    typedef float const_param_type;\n    typedef float member_type;\n\n    static const Param type = Param::FLOAT;\n};\n\ntemplate<> struct ParamType<unsigned>\n{\n    typedef unsigned const_param_type;\n    typedef unsigned member_type;\n\n    static const Param type = Param::UNSIGNED_INT;\n};\n\ntemplate<> struct ParamType<uint64>\n{\n    typedef uint64 const_param_type;\n    typedef uint64 member_type;\n\n    static const Param type = Param::UINT64;\n};\n\ntemplate<> struct ParamType<uchar>\n{\n    typedef uchar const_param_type;\n    typedef uchar member_type;\n\n    static const Param type = Param::UCHAR;\n};\n\ntemplate<> struct ParamType<Scalar>\n{\n    typedef const Scalar& const_param_type;\n    typedef Scalar member_type;\n\n    static const Param type = Param::SCALAR;\n};\n\ntemplate<typename _Tp>\nstruct ParamType<_Tp, typename std::enable_if< std::is_enum<_Tp>::value >::type>\n{\n    typedef typename std::underlying_type<_Tp>::type const_param_type;\n    typedef typename std::underlying_type<_Tp>::type member_type;\n\n    static const Param type = Param::INT;\n};\n\n//! @} core_basic\n\n} //namespace cv\n\n#include \"opencv2/core/operations.hpp\"\n#include \"opencv2/core/cvstd.inl.hpp\"\n#include \"opencv2/core/utility.hpp\"\n#include \"opencv2/core/optim.hpp\"\n#include \"opencv2/core/ovx.hpp\"\n\n#endif /*OPENCV_CORE_HPP*/\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/cvconfig.h",
    "content": "#ifndef OPENCV_CVCONFIG_H_INCLUDED\n#define OPENCV_CVCONFIG_H_INCLUDED\n\n/* OpenCV compiled as static or dynamic libs */\n#define BUILD_SHARED_LIBS\n\n/* OpenCV intrinsics optimized code */\n#define CV_ENABLE_INTRINSICS\n\n/* OpenCV additional optimized code */\n/* #undef CV_DISABLE_OPTIMIZATION */\n\n/* Compile for 'real' NVIDIA GPU architectures */\n#define CUDA_ARCH_BIN \"\"\n\n/* NVIDIA GPU features are used */\n#define CUDA_ARCH_FEATURES \"\"\n\n/* Compile for 'virtual' NVIDIA PTX architectures */\n#define CUDA_ARCH_PTX \"\"\n\n/* AMD's Basic Linear Algebra Subprograms Library*/\n/* #undef HAVE_CLAMDBLAS */\n\n/* AMD's OpenCL Fast Fourier Transform Library*/\n/* #undef HAVE_CLAMDFFT */\n\n/* Clp support */\n/* #undef HAVE_CLP */\n\n/* NVIDIA CUDA Runtime API*/\n/* #undef HAVE_CUDA */\n\n/* NVIDIA CUDA Basic Linear Algebra Subprograms (BLAS) API*/\n/* #undef HAVE_CUBLAS */\n\n/* NVIDIA CUDA Deep Neural Network (cuDNN) API*/\n/* #undef HAVE_CUDNN */\n\n/* NVIDIA CUDA Fast Fourier Transform (FFT) API*/\n/* #undef HAVE_CUFFT */\n\n/* DirectX */\n/* #undef HAVE_DIRECTX */\n/* #undef HAVE_DIRECTX_NV12 */\n/* #undef HAVE_D3D11 */\n/* #undef HAVE_D3D10 */\n/* #undef HAVE_D3D9 */\n\n/* Eigen Matrix & Linear Algebra Library */\n/* #undef HAVE_EIGEN */\n\n/* Geospatial Data Abstraction Library */\n/* #undef HAVE_GDAL */\n\n/* Halide support */\n/* #undef HAVE_HALIDE */\n\n/* Vulkan support */\n/* #undef HAVE_VULKAN */\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#define HAVE_INTTYPES_H 1\n\n/* Intel Integrated Performance Primitives */\n#define HAVE_IPP\n#define HAVE_IPP_ICV\n#define HAVE_IPP_IW\n#define HAVE_IPP_IW_LL\n\n/* JPEG-2000 codec */\n#define HAVE_OPENJPEG\n/* #undef HAVE_JASPER */\n\n/* IJG JPEG codec */\n#define HAVE_JPEG\n\n/* libpng/png.h needs to be included */\n/* #undef HAVE_LIBPNG_PNG_H */\n\n/* GDCM DICOM codec */\n/* #undef HAVE_GDCM */\n\n/* NVIDIA Video Decoding API*/\n/* #undef HAVE_NVCUVID */\n/* #undef HAVE_NVCUVID_HEADER */\n/* #undef HAVE_DYNLINK_NVCUVID_HEADER */\n\n/* NVIDIA Video Encoding API*/\n/* #undef HAVE_NVCUVENC */\n\n/* OpenCL Support */\n#define HAVE_OPENCL\n/* #undef HAVE_OPENCL_STATIC */\n/* #undef HAVE_OPENCL_SVM */\n\n/* NVIDIA OpenCL D3D Extensions support */\n/* #undef HAVE_OPENCL_D3D11_NV */\n\n/* OpenEXR codec */\n#define HAVE_OPENEXR\n\n/* OpenGL support*/\n/* #undef HAVE_OPENGL */\n\n/* PNG codec */\n#define HAVE_PNG\n\n/* Posix threads (pthreads) */\n#define HAVE_PTHREAD\n\n/* parallel_for with pthreads */\n#define HAVE_PTHREADS_PF\n\n/* Intel Threading Building Blocks */\n/* #undef HAVE_TBB */\n\n/* Ste||ar Group High Performance ParallelX */\n/* #undef HAVE_HPX */\n\n/* TIFF codec */\n#define HAVE_TIFF\n\n/* Define if your processor stores words with the most significant byte\n   first (like Motorola and SPARC, unlike Intel and VAX). */\n/* #undef WORDS_BIGENDIAN */\n\n/* VA library (libva) */\n/* #undef HAVE_VA */\n\n/* Intel VA-API/OpenCL */\n/* #undef HAVE_VA_INTEL */\n\n/* Lapack */\n/* #undef HAVE_LAPACK */\n\n/* Library was compiled with functions instrumentation */\n/* #undef ENABLE_INSTRUMENTATION */\n\n/* OpenVX */\n/* #undef HAVE_OPENVX */\n\n/* OpenCV trace utilities */\n#define OPENCV_TRACE\n\n/* Library QR-code decoding */\n#define HAVE_QUIRC\n\n#endif // OPENCV_CVCONFIG_H_INCLUDED\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn/all_layers.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_DNN_DNN_ALL_LAYERS_HPP\n#define OPENCV_DNN_DNN_ALL_LAYERS_HPP\n#include <opencv2/dnn.hpp>\n\nnamespace cv {\nnamespace dnn {\nCV__DNN_INLINE_NS_BEGIN\n//! @addtogroup dnn\n//! @{\n\n/** @defgroup dnnLayerList Partial List of Implemented Layers\n  @{\n  This subsection of dnn module contains information about built-in layers and their descriptions.\n\n  Classes listed here, in fact, provides C++ API for creating instances of built-in layers.\n  In addition to this way of layers instantiation, there is a more common factory API (see @ref dnnLayerFactory), it allows to create layers dynamically (by name) and register new ones.\n  You can use both API, but factory API is less convenient for native C++ programming and basically designed for use inside importers (see @ref readNetFromCaffe(), @ref readNetFromTorch(), @ref readNetFromTensorflow()).\n\n  Built-in layers partially reproduce functionality of corresponding Caffe and Torch7 layers.\n  In particular, the following layers and Caffe importer were tested to reproduce <a href=\"http://caffe.berkeleyvision.org/tutorial/layers.html\">Caffe</a> functionality:\n  - Convolution\n  - Deconvolution\n  - Pooling\n  - InnerProduct\n  - TanH, ReLU, Sigmoid, BNLL, Power, AbsVal\n  - Softmax\n  - Reshape, Flatten, Slice, Split\n  - LRN\n  - MVN\n  - Dropout (since it does nothing on forward pass -))\n*/\n\n    class CV_EXPORTS BlankLayer : public Layer\n    {\n    public:\n        static Ptr<Layer> create(const LayerParams &params);\n    };\n\n    /**\n     * Constant layer produces the same data blob at an every forward pass.\n     */\n    class CV_EXPORTS ConstLayer : public Layer\n    {\n    public:\n        static Ptr<Layer> create(const LayerParams &params);\n    };\n\n    //! LSTM recurrent layer\n    class CV_EXPORTS LSTMLayer : public Layer\n    {\n    public:\n        /** Creates instance of LSTM layer */\n        static Ptr<LSTMLayer> create(const LayerParams& params);\n\n        /** @deprecated Use LayerParams::blobs instead.\n        @brief Set trained weights for LSTM layer.\n\n        LSTM behavior on each step is defined by current input, previous output, previous cell state and learned weights.\n\n        Let @f$x_t@f$ be current input, @f$h_t@f$ be current output, @f$c_t@f$ be current state.\n        Than current output and current cell state is computed as follows:\n        @f{eqnarray*}{\n        h_t &= o_t \\odot tanh(c_t),               \\\\\n        c_t &= f_t \\odot c_{t-1} + i_t \\odot g_t, \\\\\n        @f}\n        where @f$\\odot@f$ is per-element multiply operation and @f$i_t, f_t, o_t, g_t@f$ is internal gates that are computed using learned weights.\n\n        Gates are computed as follows:\n        @f{eqnarray*}{\n        i_t &= sigmoid&(W_{xi} x_t + W_{hi} h_{t-1} + b_i), \\\\\n        f_t &= sigmoid&(W_{xf} x_t + W_{hf} h_{t-1} + b_f), \\\\\n        o_t &= sigmoid&(W_{xo} x_t + W_{ho} h_{t-1} + b_o), \\\\\n        g_t &= tanh   &(W_{xg} x_t + W_{hg} h_{t-1} + b_g), \\\\\n        @f}\n        where @f$W_{x?}@f$, @f$W_{h?}@f$ and @f$b_{?}@f$ are learned weights represented as matrices:\n        @f$W_{x?} \\in R^{N_h \\times N_x}@f$, @f$W_{h?} \\in R^{N_h \\times N_h}@f$, @f$b_? \\in R^{N_h}@f$.\n\n        For simplicity and performance purposes we use @f$ W_x = [W_{xi}; W_{xf}; W_{xo}, W_{xg}] @f$\n        (i.e. @f$W_x@f$ is vertical concatenation of @f$ W_{x?} @f$), @f$ W_x \\in R^{4N_h \\times N_x} @f$.\n        The same for @f$ W_h = [W_{hi}; W_{hf}; W_{ho}, W_{hg}], W_h \\in R^{4N_h \\times N_h} @f$\n        and for @f$ b = [b_i; b_f, b_o, b_g]@f$, @f$b \\in R^{4N_h} @f$.\n\n        @param Wh is matrix defining how previous output is transformed to internal gates (i.e. according to above mentioned notation is @f$ W_h @f$)\n        @param Wx is matrix defining how current input is transformed to internal gates (i.e. according to above mentioned notation is @f$ W_x @f$)\n        @param b  is bias vector (i.e. according to above mentioned notation is @f$ b @f$)\n        */\n        CV_DEPRECATED virtual void setWeights(const Mat &Wh, const Mat &Wx, const Mat &b) = 0;\n\n        /** @brief Specifies shape of output blob which will be [[`T`], `N`] + @p outTailShape.\n          * @details If this parameter is empty or unset then @p outTailShape = [`Wh`.size(0)] will be used,\n          * where `Wh` is parameter from setWeights().\n          */\n        virtual void setOutShape(const MatShape &outTailShape = MatShape()) = 0;\n\n        /** @deprecated Use flag `produce_cell_output` in LayerParams.\n          * @brief Specifies either interpret first dimension of input blob as timestamp dimension either as sample.\n          *\n          * If flag is set to true then shape of input blob will be interpreted as [`T`, `N`, `[data dims]`] where `T` specifies number of timestamps, `N` is number of independent streams.\n          * In this case each forward() call will iterate through `T` timestamps and update layer's state `T` times.\n          *\n          * If flag is set to false then shape of input blob will be interpreted as [`N`, `[data dims]`].\n          * In this case each forward() call will make one iteration and produce one timestamp with shape [`N`, `[out dims]`].\n          */\n        CV_DEPRECATED virtual void setUseTimstampsDim(bool use = true) = 0;\n\n        /** @deprecated Use flag `use_timestamp_dim` in LayerParams.\n         * @brief If this flag is set to true then layer will produce @f$ c_t @f$ as second output.\n         * @details Shape of the second output is the same as first output.\n         */\n        CV_DEPRECATED virtual void setProduceCellOutput(bool produce = false) = 0;\n\n        /* In common case it use single input with @f$x_t@f$ values to compute output(s) @f$h_t@f$ (and @f$c_t@f$).\n         * @param input should contain packed values @f$x_t@f$\n         * @param output contains computed outputs: @f$h_t@f$ (and @f$c_t@f$ if setProduceCellOutput() flag was set to true).\n         *\n         * If setUseTimstampsDim() is set to true then @p input[0] should has at least two dimensions with the following shape: [`T`, `N`, `[data dims]`],\n         * where `T` specifies number of timestamps, `N` is number of independent streams (i.e. @f$ x_{t_0 + t}^{stream} @f$ is stored inside @p input[0][t, stream, ...]).\n         *\n         * If setUseTimstampsDim() is set to false then @p input[0] should contain single timestamp, its shape should has form [`N`, `[data dims]`] with at least one dimension.\n         * (i.e. @f$ x_{t}^{stream} @f$ is stored inside @p input[0][stream, ...]).\n        */\n\n        int inputNameToIndex(String inputName) CV_OVERRIDE;\n        int outputNameToIndex(const String& outputName) CV_OVERRIDE;\n    };\n\n    /** @brief Classical recurrent layer\n\n    Accepts two inputs @f$x_t@f$ and @f$h_{t-1}@f$ and compute two outputs @f$o_t@f$ and @f$h_t@f$.\n\n    - input: should contain packed input @f$x_t@f$.\n    - output: should contain output @f$o_t@f$ (and @f$h_t@f$ if setProduceHiddenOutput() is set to true).\n\n    input[0] should have shape [`T`, `N`, `data_dims`] where `T` and `N` is number of timestamps and number of independent samples of @f$x_t@f$ respectively.\n\n    output[0] will have shape [`T`, `N`, @f$N_o@f$], where @f$N_o@f$ is number of rows in @f$ W_{xo} @f$ matrix.\n\n    If setProduceHiddenOutput() is set to true then @p output[1] will contain a Mat with shape [`T`, `N`, @f$N_h@f$], where @f$N_h@f$ is number of rows in @f$ W_{hh} @f$ matrix.\n    */\n    class CV_EXPORTS RNNLayer : public Layer\n    {\n    public:\n        /** Creates instance of RNNLayer */\n        static Ptr<RNNLayer> create(const LayerParams& params);\n\n        /** Setups learned weights.\n\n        Recurrent-layer behavior on each step is defined by current input @f$ x_t @f$, previous state @f$ h_t @f$ and learned weights as follows:\n        @f{eqnarray*}{\n        h_t &= tanh&(W_{hh} h_{t-1} + W_{xh} x_t + b_h),  \\\\\n        o_t &= tanh&(W_{ho} h_t + b_o),\n        @f}\n\n        @param Wxh is @f$ W_{xh} @f$ matrix\n        @param bh  is @f$ b_{h}  @f$ vector\n        @param Whh is @f$ W_{hh} @f$ matrix\n        @param Who is @f$ W_{xo} @f$ matrix\n        @param bo  is @f$ b_{o}  @f$ vector\n        */\n        virtual void setWeights(const Mat &Wxh, const Mat &bh, const Mat &Whh, const Mat &Who, const Mat &bo) = 0;\n\n        /** @brief If this flag is set to true then layer will produce @f$ h_t @f$ as second output.\n         * @details Shape of the second output is the same as first output.\n         */\n        virtual void setProduceHiddenOutput(bool produce = false) = 0;\n\n    };\n\n    class CV_EXPORTS BaseConvolutionLayer : public Layer\n    {\n    public:\n        CV_DEPRECATED_EXTERNAL Size kernel, stride, pad, dilation, adjustPad;\n        std::vector<size_t> adjust_pads;\n        std::vector<size_t> kernel_size, strides, dilations;\n        std::vector<size_t> pads_begin, pads_end;\n        String padMode;\n        int numOutput;\n    };\n\n    class CV_EXPORTS ConvolutionLayer : public BaseConvolutionLayer\n    {\n    public:\n        static Ptr<BaseConvolutionLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS DeconvolutionLayer : public BaseConvolutionLayer\n    {\n    public:\n        static Ptr<BaseConvolutionLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS LRNLayer : public Layer\n    {\n    public:\n        int type;\n\n        int size;\n        float alpha, beta, bias;\n        bool normBySize;\n\n        static Ptr<LRNLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS PoolingLayer : public Layer\n    {\n    public:\n        int type;\n        std::vector<size_t> kernel_size, strides;\n        std::vector<size_t> pads_begin, pads_end;\n        bool globalPooling; //!< Flag is true if at least one of the axes is global pooled.\n        std::vector<bool> isGlobalPooling;\n        bool computeMaxIdx;\n        String padMode;\n        bool ceilMode;\n        // If true for average pooling with padding, divide an every output region\n        // by a whole kernel area. Otherwise exclude zero padded values and divide\n        // by number of real values.\n        bool avePoolPaddedArea;\n        // ROIPooling parameters.\n        Size pooledSize;\n        float spatialScale;\n        // PSROIPooling parameters.\n        int psRoiOutChannels;\n\n        static Ptr<PoolingLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS SoftmaxLayer : public Layer\n    {\n    public:\n        bool logSoftMax;\n\n        static Ptr<SoftmaxLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS InnerProductLayer : public Layer\n    {\n    public:\n        int axis;\n        static Ptr<InnerProductLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS MVNLayer : public Layer\n    {\n    public:\n        float eps;\n        bool normVariance, acrossChannels;\n\n        static Ptr<MVNLayer> create(const LayerParams& params);\n    };\n\n    /* Reshaping */\n\n    class CV_EXPORTS ReshapeLayer : public Layer\n    {\n    public:\n        MatShape newShapeDesc;\n        Range newShapeRange;\n\n        static Ptr<ReshapeLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS FlattenLayer : public Layer\n    {\n    public:\n        static Ptr<FlattenLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS ConcatLayer : public Layer\n    {\n    public:\n        int axis;\n        /**\n         * @brief Add zero padding in case of concatenation of blobs with different\n         * spatial sizes.\n         *\n         * Details: https://github.com/torch/nn/blob/master/doc/containers.md#depthconcat\n         */\n        bool padding;\n\n        static Ptr<ConcatLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS SplitLayer : public Layer\n    {\n    public:\n        int outputsCount; //!< Number of copies that will be produced (is ignored when negative).\n\n        static Ptr<SplitLayer> create(const LayerParams &params);\n    };\n\n    /**\n     * Slice layer has several modes:\n     * 1. Caffe mode\n     * @param[in] axis Axis of split operation\n     * @param[in] slice_point Array of split points\n     *\n     * Number of output blobs equals to number of split points plus one. The\n     * first blob is a slice on input from 0 to @p slice_point[0] - 1 by @p axis,\n     * the second output blob is a slice of input from @p slice_point[0] to\n     * @p slice_point[1] - 1 by @p axis and the last output blob is a slice of\n     * input from @p slice_point[-1] up to the end of @p axis size.\n     *\n     * 2. TensorFlow mode\n     * @param begin Vector of start indices\n     * @param size Vector of sizes\n     *\n     * More convenient numpy-like slice. One and only output blob\n     * is a slice `input[begin[0]:begin[0]+size[0], begin[1]:begin[1]+size[1], ...]`\n     *\n     * 3. Torch mode\n     * @param axis Axis of split operation\n     *\n     * Split input blob on the equal parts by @p axis.\n     */\n    class CV_EXPORTS SliceLayer : public Layer\n    {\n    public:\n        /**\n         * @brief Vector of slice ranges.\n         *\n         * The first dimension equals number of output blobs.\n         * Inner vector has slice ranges for the first number of input dimensions.\n         */\n        std::vector<std::vector<Range> > sliceRanges;\n        std::vector<std::vector<int> > sliceSteps;\n        int axis;\n        int num_split;\n\n        static Ptr<SliceLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS PermuteLayer : public Layer\n    {\n    public:\n        static Ptr<PermuteLayer> create(const LayerParams& params);\n    };\n\n    /**\n     * Permute channels of 4-dimensional input blob.\n     * @param group Number of groups to split input channels and pick in turns\n     *              into output blob.\n     *\n     * \\f[ groupSize = \\frac{number\\ of\\ channels}{group} \\f]\n     * \\f[ output(n, c, h, w) = input(n, groupSize \\times (c \\% group) + \\lfloor \\frac{c}{group} \\rfloor, h, w) \\f]\n     * Read more at https://arxiv.org/pdf/1707.01083.pdf\n     */\n    class CV_EXPORTS ShuffleChannelLayer : public Layer\n    {\n    public:\n        static Ptr<Layer> create(const LayerParams& params);\n\n        int group;\n    };\n\n    /**\n     * @brief Adds extra values for specific axes.\n     * @param paddings Vector of paddings in format\n     *                 @code\n     *                 [ pad_before, pad_after,  // [0]th dimension\n     *                   pad_before, pad_after,  // [1]st dimension\n     *                   ...\n     *                   pad_before, pad_after ] // [n]th dimension\n     *                 @endcode\n     *                 that represents number of padded values at every dimension\n     *                 starting from the first one. The rest of dimensions won't\n     *                 be padded.\n     * @param value Value to be padded. Defaults to zero.\n     * @param type Padding type: 'constant', 'reflect'\n     * @param input_dims Torch's parameter. If @p input_dims is not equal to the\n     *                   actual input dimensionality then the `[0]th` dimension\n     *                   is considered as a batch dimension and @p paddings are shifted\n     *                   to a one dimension. Defaults to `-1` that means padding\n     *                   corresponding to @p paddings.\n     */\n    class CV_EXPORTS PaddingLayer : public Layer\n    {\n    public:\n        static Ptr<PaddingLayer> create(const LayerParams& params);\n    };\n\n    /* Activations */\n    class CV_EXPORTS ActivationLayer : public Layer\n    {\n    public:\n        virtual void forwardSlice(const float* src, float* dst, int len,\n                                  size_t outPlaneSize, int cn0, int cn1) const = 0;\n    };\n\n    class CV_EXPORTS ReLULayer : public ActivationLayer\n    {\n    public:\n        float negativeSlope;\n\n        static Ptr<ReLULayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS ReLU6Layer : public ActivationLayer\n    {\n    public:\n        float minValue, maxValue;\n\n        static Ptr<ReLU6Layer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS ChannelsPReLULayer : public ActivationLayer\n    {\n    public:\n        static Ptr<Layer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS ELULayer : public ActivationLayer\n    {\n    public:\n        static Ptr<ELULayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS TanHLayer : public ActivationLayer\n    {\n    public:\n        static Ptr<TanHLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS SwishLayer : public ActivationLayer\n    {\n    public:\n        static Ptr<SwishLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS MishLayer : public ActivationLayer\n    {\n    public:\n        static Ptr<MishLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS SigmoidLayer : public ActivationLayer\n    {\n    public:\n        static Ptr<SigmoidLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS BNLLLayer : public ActivationLayer\n    {\n    public:\n        static Ptr<BNLLLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS AbsLayer : public ActivationLayer\n    {\n    public:\n        static Ptr<AbsLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS PowerLayer : public ActivationLayer\n    {\n    public:\n        float power, scale, shift;\n\n        static Ptr<PowerLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS ExpLayer : public ActivationLayer\n    {\n    public:\n        float base, scale, shift;\n\n        static Ptr<ExpLayer> create(const LayerParams &params);\n    };\n\n    /* Layers used in semantic segmentation */\n\n    class CV_EXPORTS CropLayer : public Layer\n    {\n    public:\n        static Ptr<Layer> create(const LayerParams &params);\n    };\n\n    /** @brief Element wise operation on inputs\n\n    Extra optional parameters:\n    - \"operation\" as string. Values are \"sum\" (default), \"prod\", \"max\", \"div\"\n    - \"coeff\" as float array. Specify weights of inputs for SUM operation\n    - \"output_channels_mode\" as string. Values are \"same\" (default, all input must have the same layout), \"input_0\", \"input_0_truncate\", \"max_input_channels\"\n    */\n    class CV_EXPORTS EltwiseLayer : public Layer\n    {\n    public:\n        static Ptr<EltwiseLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS BatchNormLayer : public ActivationLayer\n    {\n    public:\n        bool hasWeights, hasBias;\n        float epsilon;\n\n        static Ptr<BatchNormLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS MaxUnpoolLayer : public Layer\n    {\n    public:\n        Size poolKernel;\n        Size poolPad;\n        Size poolStride;\n\n        static Ptr<MaxUnpoolLayer> create(const LayerParams &params);\n    };\n\n    class CV_EXPORTS ScaleLayer : public Layer\n    {\n    public:\n        bool hasBias;\n        int axis;\n\n        static Ptr<ScaleLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS ShiftLayer : public Layer\n    {\n    public:\n        static Ptr<Layer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS DataAugmentationLayer : public Layer\n    {\n    public:\n        static Ptr<DataAugmentationLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS CorrelationLayer : public Layer\n    {\n    public:\n        static Ptr<CorrelationLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS AccumLayer : public Layer\n    {\n    public:\n        static Ptr<AccumLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS FlowWarpLayer : public Layer\n    {\n    public:\n        static Ptr<FlowWarpLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS PriorBoxLayer : public Layer\n    {\n    public:\n        static Ptr<PriorBoxLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS ReorgLayer : public Layer\n    {\n    public:\n        static Ptr<ReorgLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS RegionLayer : public Layer\n    {\n    public:\n        float nmsThreshold;\n\n        static Ptr<RegionLayer> create(const LayerParams& params);\n    };\n\n    /**\n     * @brief Detection output layer.\n     *\n     * The layer size is: @f$ (1 \\times 1 \\times N \\times 7) @f$\n     *    where N is [keep_top_k] parameter multiplied by batch size. Each row is:\n     *    [image_id, label, confidence, xmin, ymin, xmax, ymax]\n     *    where image_id is the index of image input in the batch.\n     */\n    class CV_EXPORTS DetectionOutputLayer : public Layer\n    {\n    public:\n        static Ptr<DetectionOutputLayer> create(const LayerParams& params);\n    };\n\n    /**\n     * @brief \\f$ L_p \\f$ - normalization layer.\n     * @param p Normalization factor. The most common `p = 1` for \\f$ L_1 \\f$ -\n     *          normalization or `p = 2` for \\f$ L_2 \\f$ - normalization or a custom one.\n     * @param eps Parameter \\f$ \\epsilon \\f$ to prevent a division by zero.\n     * @param across_spatial If true, normalize an input across all non-batch dimensions.\n     *                       Otherwise normalize an every channel separately.\n     *\n     * Across spatial:\n     * @f[\n     * norm = \\sqrt[p]{\\epsilon + \\sum_{x, y, c} |src(x, y, c)|^p } \\\\\n     * dst(x, y, c) = \\frac{ src(x, y, c) }{norm}\n     * @f]\n     *\n     * Channel wise normalization:\n     * @f[\n     * norm(c) = \\sqrt[p]{\\epsilon + \\sum_{x, y} |src(x, y, c)|^p } \\\\\n     * dst(x, y, c) = \\frac{ src(x, y, c) }{norm(c)}\n     * @f]\n     *\n     * Where `x, y` - spatial coordinates, `c` - channel.\n     *\n     * An every sample in the batch is normalized separately. Optionally,\n     * output is scaled by the trained parameters.\n     */\n    class CV_EXPORTS NormalizeBBoxLayer : public Layer\n    {\n    public:\n        float pnorm, epsilon;\n        CV_DEPRECATED_EXTERNAL bool acrossSpatial;\n\n        static Ptr<NormalizeBBoxLayer> create(const LayerParams& params);\n    };\n\n    /**\n     * @brief Resize input 4-dimensional blob by nearest neighbor or bilinear strategy.\n     *\n     * Layer is used to support TensorFlow's resize_nearest_neighbor and resize_bilinear ops.\n     */\n    class CV_EXPORTS ResizeLayer : public Layer\n    {\n    public:\n        static Ptr<ResizeLayer> create(const LayerParams& params);\n    };\n\n    /**\n     * @brief Bilinear resize layer from https://github.com/cdmh/deeplab-public-ver2\n     *\n     * It differs from @ref ResizeLayer in output shape and resize scales computations.\n     */\n    class CV_EXPORTS InterpLayer : public Layer\n    {\n    public:\n        static Ptr<Layer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS ProposalLayer : public Layer\n    {\n    public:\n        static Ptr<ProposalLayer> create(const LayerParams& params);\n    };\n\n    class CV_EXPORTS CropAndResizeLayer : public Layer\n    {\n    public:\n        static Ptr<Layer> create(const LayerParams& params);\n    };\n\n//! @}\n//! @}\nCV__DNN_INLINE_NS_END\n}\n}\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn/dict.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#include <opencv2/core.hpp>\n#include <map>\n#include <ostream>\n\n#include <opencv2/dnn/dnn.hpp>\n\n#ifndef OPENCV_DNN_DNN_DICT_HPP\n#define OPENCV_DNN_DNN_DICT_HPP\n\nnamespace cv {\nnamespace dnn {\nCV__DNN_INLINE_NS_BEGIN\n//! @addtogroup dnn\n//! @{\n\n/** @brief This struct stores the scalar value (or array) of one of the following type: double, cv::String or int64.\n *  @todo Maybe int64 is useless because double type exactly stores at least 2^52 integers.\n */\nstruct CV_EXPORTS_W DictValue\n{\n    DictValue(const DictValue &r);\n    DictValue(bool i)           : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i ? 1 : 0; }       //!< Constructs integer scalar\n    DictValue(int64 i = 0)      : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i; }       //!< Constructs integer scalar\n    CV_WRAP DictValue(int i)    : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i; }       //!< Constructs integer scalar\n    DictValue(unsigned p)       : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = p; }       //!< Constructs integer scalar\n    CV_WRAP DictValue(double p)         : type(Param::REAL), pd(new AutoBuffer<double,1>) { (*pd)[0] = p; }     //!< Constructs floating point scalar\n    CV_WRAP DictValue(const String &s)  : type(Param::STRING), ps(new AutoBuffer<String,1>) { (*ps)[0] = s; }   //!< Constructs string scalar\n    DictValue(const char *s)            : type(Param::STRING), ps(new AutoBuffer<String,1>) { (*ps)[0] = s; }   //!< @overload\n\n    template<typename TypeIter>\n    static DictValue arrayInt(TypeIter begin, int size);    //!< Constructs integer array\n    template<typename TypeIter>\n    static DictValue arrayReal(TypeIter begin, int size);   //!< Constructs floating point array\n    template<typename TypeIter>\n    static DictValue arrayString(TypeIter begin, int size); //!< Constructs array of strings\n\n    template<typename T>\n    T get(int idx = -1) const; //!< Tries to convert array element with specified index to requested type and returns its.\n\n    int size() const;\n\n    CV_WRAP bool isInt() const;\n    CV_WRAP bool isString() const;\n    CV_WRAP bool isReal() const;\n\n    CV_WRAP int getIntValue(int idx = -1) const;\n    CV_WRAP double getRealValue(int idx = -1) const;\n    CV_WRAP String getStringValue(int idx = -1) const;\n\n    DictValue &operator=(const DictValue &r);\n\n    friend std::ostream &operator<<(std::ostream &stream, const DictValue &dictv);\n\n    ~DictValue();\n\nprivate:\n\n    Param type;\n\n    union\n    {\n        AutoBuffer<int64, 1> *pi;\n        AutoBuffer<double, 1> *pd;\n        AutoBuffer<String, 1> *ps;\n        void *pv;\n    };\n\n    DictValue(Param _type, void *_p) : type(_type), pv(_p) {}\n    void release();\n};\n\n/** @brief This class implements name-value dictionary, values are instances of DictValue. */\nclass CV_EXPORTS Dict\n{\n    typedef std::map<String, DictValue> _Dict;\n    _Dict dict;\n\npublic:\n\n    //! Checks a presence of the @p key in the dictionary.\n    bool has(const String &key) const;\n\n    //! If the @p key in the dictionary then returns pointer to its value, else returns NULL.\n    DictValue *ptr(const String &key);\n\n    /** @overload */\n    const DictValue *ptr(const String &key) const;\n\n    //! If the @p key in the dictionary then returns its value, else an error will be generated.\n    const DictValue &get(const String &key) const;\n\n    /** @overload */\n    template <typename T>\n    T get(const String &key) const;\n\n    //! If the @p key in the dictionary then returns its value, else returns @p defaultValue.\n    template <typename T>\n    T get(const String &key, const T &defaultValue) const;\n\n    //! Sets new @p value for the @p key, or adds new key-value pair into the dictionary.\n    template<typename T>\n    const T &set(const String &key, const T &value);\n\n    //! Erase @p key from the dictionary.\n    void erase(const String &key);\n\n    friend std::ostream &operator<<(std::ostream &stream, const Dict &dict);\n\n    std::map<String, DictValue>::const_iterator begin() const;\n\n    std::map<String, DictValue>::const_iterator end() const;\n};\n\n//! @}\nCV__DNN_INLINE_NS_END\n}\n}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn/dnn.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_DNN_DNN_HPP\n#define OPENCV_DNN_DNN_HPP\n\n#include <vector>\n#include <opencv2/core.hpp>\n#include \"opencv2/core/async.hpp\"\n\n#include \"../dnn/version.hpp\"\n\n#include <opencv2/dnn/dict.hpp>\n\nnamespace cv {\nnamespace dnn {\nCV__DNN_INLINE_NS_BEGIN\n//! @addtogroup dnn\n//! @{\n\n    typedef std::vector<int> MatShape;\n\n    /**\n     * @brief Enum of computation backends supported by layers.\n     * @see Net::setPreferableBackend\n     */\n    enum Backend\n    {\n        //! DNN_BACKEND_DEFAULT equals to DNN_BACKEND_INFERENCE_ENGINE if\n        //! OpenCV is built with Intel's Inference Engine library or\n        //! DNN_BACKEND_OPENCV otherwise.\n        DNN_BACKEND_DEFAULT = 0,\n        DNN_BACKEND_HALIDE,\n        DNN_BACKEND_INFERENCE_ENGINE,            //!< Intel's Inference Engine computational backend\n                                                 //!< @sa setInferenceEngineBackendType\n        DNN_BACKEND_OPENCV,\n        DNN_BACKEND_VKCOM,\n        DNN_BACKEND_CUDA,\n#ifdef __OPENCV_BUILD\n        DNN_BACKEND_INFERENCE_ENGINE_NGRAPH = 1000000,     // internal - use DNN_BACKEND_INFERENCE_ENGINE + setInferenceEngineBackendType()\n        DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019,      // internal - use DNN_BACKEND_INFERENCE_ENGINE + setInferenceEngineBackendType()\n#endif\n    };\n\n    /**\n     * @brief Enum of target devices for computations.\n     * @see Net::setPreferableTarget\n     */\n    enum Target\n    {\n        DNN_TARGET_CPU = 0,\n        DNN_TARGET_OPENCL,\n        DNN_TARGET_OPENCL_FP16,\n        DNN_TARGET_MYRIAD,\n        DNN_TARGET_VULKAN,\n        DNN_TARGET_FPGA,  //!< FPGA device with CPU fallbacks using Inference Engine's Heterogeneous plugin.\n        DNN_TARGET_CUDA,\n        DNN_TARGET_CUDA_FP16,\n        DNN_TARGET_HDDL\n    };\n\n    CV_EXPORTS std::vector< std::pair<Backend, Target> > getAvailableBackends();\n    CV_EXPORTS_W std::vector<Target> getAvailableTargets(dnn::Backend be);\n\n    /**\n     * @brief Enables detailed logging of the DNN model loading with CV DNN API.\n     * @param[in] isDiagnosticsMode Indicates whether diagnostic mode should be set.\n     *\n     * Diagnostic mode provides detailed logging of the model loading stage to explore\n     * potential problems (ex.: not implemented layer type).\n     *\n     * @note In diagnostic mode series of assertions will be skipped, it can lead to the\n     * expected application crash.\n     */\n    CV_EXPORTS void enableModelDiagnostics(bool isDiagnosticsMode);\n\n    /** @brief This class provides all data needed to initialize layer.\n     *\n     * It includes dictionary with scalar params (which can be read by using Dict interface),\n     * blob params #blobs and optional meta information: #name and #type of layer instance.\n    */\n    class CV_EXPORTS LayerParams : public Dict\n    {\n    public:\n        //TODO: Add ability to name blob params\n        std::vector<Mat> blobs; //!< List of learned parameters stored as blobs.\n\n        String name; //!< Name of the layer instance (optional, can be used internal purposes).\n        String type; //!< Type name which was used for creating layer by layer factory (optional).\n    };\n\n   /**\n    * @brief Derivatives of this class encapsulates functions of certain backends.\n    */\n    class BackendNode\n    {\n    public:\n        BackendNode(int backendId);\n\n        virtual ~BackendNode(); //!< Virtual destructor to make polymorphism.\n\n        int backendId; //!< Backend identifier.\n    };\n\n    /**\n     * @brief Derivatives of this class wraps cv::Mat for different backends and targets.\n     */\n    class BackendWrapper\n    {\n    public:\n        BackendWrapper(int backendId, int targetId);\n\n        /**\n         * @brief Wrap cv::Mat for specific backend and target.\n         * @param[in] targetId Target identifier.\n         * @param[in] m cv::Mat for wrapping.\n         *\n         * Make CPU->GPU data transfer if it's require for the target.\n         */\n        BackendWrapper(int targetId, const cv::Mat& m);\n\n        /**\n         * @brief Make wrapper for reused cv::Mat.\n         * @param[in] base Wrapper of cv::Mat that will be reused.\n         * @param[in] shape Specific shape.\n         *\n         * Initialize wrapper from another one. It'll wrap the same host CPU\n         * memory and mustn't allocate memory on device(i.e. GPU). It might\n         * has different shape. Use in case of CPU memory reusing for reuse\n         * associated memory on device too.\n         */\n        BackendWrapper(const Ptr<BackendWrapper>& base, const MatShape& shape);\n\n        virtual ~BackendWrapper(); //!< Virtual destructor to make polymorphism.\n\n        /**\n         * @brief Transfer data to CPU host memory.\n         */\n        virtual void copyToHost() = 0;\n\n        /**\n         * @brief Indicate that an actual data is on CPU.\n         */\n        virtual void setHostDirty() = 0;\n\n        int backendId;  //!< Backend identifier.\n        int targetId;   //!< Target identifier.\n    };\n\n    class CV_EXPORTS ActivationLayer;\n\n    /** @brief This interface class allows to build new Layers - are building blocks of networks.\n     *\n     * Each class, derived from Layer, must implement allocate() methods to declare own outputs and forward() to compute outputs.\n     * Also before using the new layer into networks you must register your layer by using one of @ref dnnLayerFactory \"LayerFactory\" macros.\n     */\n    class CV_EXPORTS_W Layer : public Algorithm\n    {\n    public:\n\n        //! List of learned parameters must be stored here to allow read them by using Net::getParam().\n        CV_PROP_RW std::vector<Mat> blobs;\n\n        /** @brief Computes and sets internal parameters according to inputs, outputs and blobs.\n         *  @deprecated Use Layer::finalize(InputArrayOfArrays, OutputArrayOfArrays) instead\n         *  @param[in]  input  vector of already allocated input blobs\n         *  @param[out] output vector of already allocated output blobs\n         *\n         * If this method is called after network has allocated all memory for input and output blobs\n         * and before inferencing.\n         */\n        CV_DEPRECATED_EXTERNAL\n        virtual void finalize(const std::vector<Mat*> &input, std::vector<Mat> &output);\n\n        /** @brief Computes and sets internal parameters according to inputs, outputs and blobs.\n         *  @param[in]  inputs  vector of already allocated input blobs\n         *  @param[out] outputs vector of already allocated output blobs\n         *\n         * If this method is called after network has allocated all memory for input and output blobs\n         * and before inferencing.\n         */\n        CV_WRAP virtual void finalize(InputArrayOfArrays inputs, OutputArrayOfArrays outputs);\n\n        /** @brief Given the @p input blobs, computes the output @p blobs.\n         *  @deprecated Use Layer::forward(InputArrayOfArrays, OutputArrayOfArrays, OutputArrayOfArrays) instead\n         *  @param[in]  input  the input blobs.\n         *  @param[out] output allocated output blobs, which will store results of the computation.\n         *  @param[out] internals allocated internal blobs\n         */\n        CV_DEPRECATED_EXTERNAL\n        virtual void forward(std::vector<Mat*> &input, std::vector<Mat> &output, std::vector<Mat> &internals);\n\n        /** @brief Given the @p input blobs, computes the output @p blobs.\n         *  @param[in]  inputs  the input blobs.\n         *  @param[out] outputs allocated output blobs, which will store results of the computation.\n         *  @param[out] internals allocated internal blobs\n         */\n        virtual void forward(InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals);\n\n        /** @brief Given the @p input blobs, computes the output @p blobs.\n         *  @param[in]  inputs  the input blobs.\n         *  @param[out] outputs allocated output blobs, which will store results of the computation.\n         *  @param[out] internals allocated internal blobs\n         */\n        void forward_fallback(InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals);\n\n        /** @brief\n         * @overload\n         * @deprecated Use Layer::finalize(InputArrayOfArrays, OutputArrayOfArrays) instead\n         */\n        CV_DEPRECATED_EXTERNAL\n        void finalize(const std::vector<Mat> &inputs, CV_OUT std::vector<Mat> &outputs);\n\n        /** @brief\n         * @overload\n         * @deprecated Use Layer::finalize(InputArrayOfArrays, OutputArrayOfArrays) instead\n         */\n        CV_DEPRECATED std::vector<Mat> finalize(const std::vector<Mat> &inputs);\n\n        /** @brief Allocates layer and computes output.\n         *  @deprecated This method will be removed in the future release.\n         */\n        CV_DEPRECATED CV_WRAP void run(const std::vector<Mat> &inputs, CV_OUT std::vector<Mat> &outputs,\n                                       CV_IN_OUT std::vector<Mat> &internals);\n\n        /** @brief Returns index of input blob into the input array.\n         *  @param inputName label of input blob\n         *\n         * Each layer input and output can be labeled to easily identify them using \"%<layer_name%>[.output_name]\" notation.\n         * This method maps label of input blob to its index into input vector.\n         */\n        virtual int inputNameToIndex(String inputName);\n        /** @brief Returns index of output blob in output array.\n         *  @see inputNameToIndex()\n         */\n        CV_WRAP virtual int outputNameToIndex(const String& outputName);\n\n        /**\n         * @brief Ask layer if it support specific backend for doing computations.\n         * @param[in] backendId computation backend identifier.\n         * @see Backend\n         */\n        virtual bool supportBackend(int backendId);\n\n        /**\n         * @brief Returns Halide backend node.\n         * @param[in] inputs Input Halide buffers.\n         * @see BackendNode, BackendWrapper\n         *\n         * Input buffers should be exactly the same that will be used in forward invocations.\n         * Despite we can use Halide::ImageParam based on input shape only,\n         * it helps prevent some memory management issues (if something wrong,\n         * Halide tests will be failed).\n         */\n        virtual Ptr<BackendNode> initHalide(const std::vector<Ptr<BackendWrapper> > &inputs);\n\n        virtual Ptr<BackendNode> initInfEngine(const std::vector<Ptr<BackendWrapper> > &inputs);\n\n        virtual Ptr<BackendNode> initNgraph(const std::vector<Ptr<BackendWrapper> > &inputs, const std::vector<Ptr<BackendNode> >& nodes);\n\n        virtual Ptr<BackendNode> initVkCom(const std::vector<Ptr<BackendWrapper> > &inputs);\n\n        /**\n         * @brief Returns a CUDA backend node\n         *\n         * @param   context  void pointer to CSLContext object\n         * @param   inputs   layer inputs\n         * @param   outputs  layer outputs\n         */\n        virtual Ptr<BackendNode> initCUDA(\n            void *context,\n            const std::vector<Ptr<BackendWrapper>>& inputs,\n            const std::vector<Ptr<BackendWrapper>>& outputs\n        );\n\n       /**\n        * @brief Automatic Halide scheduling based on layer hyper-parameters.\n        * @param[in] node Backend node with Halide functions.\n        * @param[in] inputs Blobs that will be used in forward invocations.\n        * @param[in] outputs Blobs that will be used in forward invocations.\n        * @param[in] targetId Target identifier\n        * @see BackendNode, Target\n        *\n        * Layer don't use own Halide::Func members because we can have applied\n        * layers fusing. In this way the fused function should be scheduled.\n        */\n        virtual void applyHalideScheduler(Ptr<BackendNode>& node,\n                                          const std::vector<Mat*> &inputs,\n                                          const std::vector<Mat> &outputs,\n                                          int targetId) const;\n\n        /**\n         * @brief Implement layers fusing.\n         * @param[in] node Backend node of bottom layer.\n         * @see BackendNode\n         *\n         * Actual for graph-based backends. If layer attached successfully,\n         * returns non-empty cv::Ptr to node of the same backend.\n         * Fuse only over the last function.\n         */\n        virtual Ptr<BackendNode> tryAttach(const Ptr<BackendNode>& node);\n\n        /**\n         * @brief Tries to attach to the layer the subsequent activation layer, i.e. do the layer fusion in a partial case.\n         * @param[in] layer The subsequent activation layer.\n         *\n         * Returns true if the activation layer has been attached successfully.\n         */\n        virtual bool setActivation(const Ptr<ActivationLayer>& layer);\n\n        /**\n         * @brief Try to fuse current layer with a next one\n         * @param[in] top Next layer to be fused.\n         * @returns True if fusion was performed.\n         */\n        virtual bool tryFuse(Ptr<Layer>& top);\n\n        /**\n         * @brief Returns parameters of layers with channel-wise multiplication and addition.\n         * @param[out] scale Channel-wise multipliers. Total number of values should\n         *                   be equal to number of channels.\n         * @param[out] shift Channel-wise offsets. Total number of values should\n         *                   be equal to number of channels.\n         *\n         * Some layers can fuse their transformations with further layers.\n         * In example, convolution + batch normalization. This way base layer\n         * use weights from layer after it. Fused layer is skipped.\n         * By default, @p scale and @p shift are empty that means layer has no\n         * element-wise multiplications or additions.\n         */\n        virtual void getScaleShift(Mat& scale, Mat& shift) const;\n\n        /**\n         * @brief \"Deattaches\" all the layers, attached to particular layer.\n         */\n        virtual void unsetAttached();\n\n        virtual bool getMemoryShapes(const std::vector<MatShape> &inputs,\n                                     const int requiredOutputs,\n                                     std::vector<MatShape> &outputs,\n                                     std::vector<MatShape> &internals) const;\n\n        virtual int64 getFLOPS(const std::vector<MatShape> &inputs,\n                               const std::vector<MatShape> &outputs) const {CV_UNUSED(inputs); CV_UNUSED(outputs); return 0;}\n\n        virtual bool updateMemoryShapes(const std::vector<MatShape> &inputs);\n\n        CV_PROP String name; //!< Name of the layer instance, can be used for logging or other internal purposes.\n        CV_PROP String type; //!< Type name which was used for creating layer by layer factory.\n        CV_PROP int preferableTarget; //!< prefer target for layer forwarding\n\n        Layer();\n        explicit Layer(const LayerParams &params);      //!< Initializes only #name, #type and #blobs fields.\n        void setParamsFrom(const LayerParams &params);  //!< Initializes only #name, #type and #blobs fields.\n        virtual ~Layer();\n    };\n\n    /** @brief This class allows to create and manipulate comprehensive artificial neural networks.\n     *\n     * Neural network is presented as directed acyclic graph (DAG), where vertices are Layer instances,\n     * and edges specify relationships between layers inputs and outputs.\n     *\n     * Each network layer has unique integer id and unique string name inside its network.\n     * LayerId can store either layer name or layer id.\n     *\n     * This class supports reference counting of its instances, i. e. copies point to the same instance.\n     */\n    class CV_EXPORTS_W_SIMPLE Net\n    {\n    public:\n\n        CV_WRAP Net();  //!< Default constructor.\n        CV_WRAP ~Net(); //!< Destructor frees the net only if there aren't references to the net anymore.\n\n        /** @brief Create a network from Intel's Model Optimizer intermediate representation (IR).\n         *  @param[in] xml XML configuration file with network's topology.\n         *  @param[in] bin Binary file with trained weights.\n         *  Networks imported from Intel's Model Optimizer are launched in Intel's Inference Engine\n         *  backend.\n         */\n        CV_WRAP static Net readFromModelOptimizer(const String& xml, const String& bin);\n\n        /** @brief Create a network from Intel's Model Optimizer in-memory buffers with intermediate representation (IR).\n         *  @param[in] bufferModelConfig buffer with model's configuration.\n         *  @param[in] bufferWeights buffer with model's trained weights.\n         *  @returns Net object.\n         */\n        CV_WRAP static\n        Net readFromModelOptimizer(const std::vector<uchar>& bufferModelConfig, const std::vector<uchar>& bufferWeights);\n\n        /** @brief Create a network from Intel's Model Optimizer in-memory buffers with intermediate representation (IR).\n         *  @param[in] bufferModelConfigPtr buffer pointer of model's configuration.\n         *  @param[in] bufferModelConfigSize buffer size of model's configuration.\n         *  @param[in] bufferWeightsPtr buffer pointer of model's trained weights.\n         *  @param[in] bufferWeightsSize buffer size of model's trained weights.\n         *  @returns Net object.\n         */\n        static\n        Net readFromModelOptimizer(const uchar* bufferModelConfigPtr, size_t bufferModelConfigSize,\n                                            const uchar* bufferWeightsPtr, size_t bufferWeightsSize);\n\n        /** Returns true if there are no layers in the network. */\n        CV_WRAP bool empty() const;\n\n        /** @brief Dump net to String\n         *  @returns String with structure, hyperparameters, backend, target and fusion\n         *  Call method after setInput(). To see correct backend, target and fusion run after forward().\n         */\n        CV_WRAP String dump();\n        /** @brief Dump net structure, hyperparameters, backend, target and fusion to dot file\n         *  @param path   path to output file with .dot extension\n         *  @see dump()\n         */\n        CV_WRAP void dumpToFile(const String& path);\n        /** @brief Adds new layer to the net.\n         *  @param name   unique name of the adding layer.\n         *  @param type   typename of the adding layer (type must be registered in LayerRegister).\n         *  @param params parameters which will be used to initialize the creating layer.\n         *  @returns unique identifier of created layer, or -1 if a failure will happen.\n         */\n        int addLayer(const String &name, const String &type, LayerParams &params);\n        /** @brief Adds new layer and connects its first input to the first output of previously added layer.\n         *  @see addLayer()\n         */\n        int addLayerToPrev(const String &name, const String &type, LayerParams &params);\n\n        /** @brief Converts string name of the layer to the integer identifier.\n         *  @returns id of the layer, or -1 if the layer wasn't found.\n         */\n        CV_WRAP int getLayerId(const String &layer);\n\n        CV_WRAP std::vector<String> getLayerNames() const;\n\n        /** @brief Container for strings and integers. */\n        typedef DictValue LayerId;\n\n        /** @brief Returns pointer to layer with specified id or name which the network use. */\n        CV_WRAP Ptr<Layer> getLayer(LayerId layerId);\n\n        /** @brief Returns pointers to input layers of specific layer. */\n        std::vector<Ptr<Layer> > getLayerInputs(LayerId layerId); // FIXIT: CV_WRAP\n\n        /** @brief Connects output of the first layer to input of the second layer.\n         *  @param outPin descriptor of the first layer output.\n         *  @param inpPin descriptor of the second layer input.\n         *\n         * Descriptors have the following template <DFN>&lt;layer_name&gt;[.input_number]</DFN>:\n         * - the first part of the template <DFN>layer_name</DFN> is string name of the added layer.\n         *   If this part is empty then the network input pseudo layer will be used;\n         * - the second optional part of the template <DFN>input_number</DFN>\n         *   is either number of the layer input, either label one.\n         *   If this part is omitted then the first layer input will be used.\n         *\n         *  @see setNetInputs(), Layer::inputNameToIndex(), Layer::outputNameToIndex()\n         */\n        CV_WRAP void connect(String outPin, String inpPin);\n\n        /** @brief Connects #@p outNum output of the first layer to #@p inNum input of the second layer.\n         *  @param outLayerId identifier of the first layer\n         *  @param outNum number of the first layer output\n         *  @param inpLayerId identifier of the second layer\n         *  @param inpNum number of the second layer input\n         */\n        void connect(int outLayerId, int outNum, int inpLayerId, int inpNum);\n\n        /** @brief Sets outputs names of the network input pseudo layer.\n         *\n         * Each net always has special own the network input pseudo layer with id=0.\n         * This layer stores the user blobs only and don't make any computations.\n         * In fact, this layer provides the only way to pass user data into the network.\n         * As any other layer, this layer can label its outputs and this function provides an easy way to do this.\n         */\n        CV_WRAP void setInputsNames(const std::vector<String> &inputBlobNames);\n\n        /** @brief Specify shape of network input.\n         */\n        CV_WRAP void setInputShape(const String &inputName, const MatShape& shape);\n\n        /** @brief Runs forward pass to compute output of layer with name @p outputName.\n         *  @param outputName name for layer which output is needed to get\n         *  @return blob for first output of specified layer.\n         *  @details By default runs forward pass for the whole network.\n         */\n        CV_WRAP Mat forward(const String& outputName = String());\n\n        /** @brief Runs forward pass to compute output of layer with name @p outputName.\n         *  @param outputName name for layer which output is needed to get\n         *  @details By default runs forward pass for the whole network.\n         *\n         *  This is an asynchronous version of forward(const String&).\n         *  dnn::DNN_BACKEND_INFERENCE_ENGINE backend is required.\n         */\n        CV_WRAP AsyncArray forwardAsync(const String& outputName = String());\n\n        /** @brief Runs forward pass to compute output of layer with name @p outputName.\n         *  @param outputBlobs contains all output blobs for specified layer.\n         *  @param outputName name for layer which output is needed to get\n         *  @details If @p outputName is empty, runs forward pass for the whole network.\n         */\n        CV_WRAP void forward(OutputArrayOfArrays outputBlobs, const String& outputName = String());\n\n        /** @brief Runs forward pass to compute outputs of layers listed in @p outBlobNames.\n         *  @param outputBlobs contains blobs for first outputs of specified layers.\n         *  @param outBlobNames names for layers which outputs are needed to get\n         */\n        CV_WRAP void forward(OutputArrayOfArrays outputBlobs,\n                             const std::vector<String>& outBlobNames);\n\n        /** @brief Runs forward pass to compute outputs of layers listed in @p outBlobNames.\n         *  @param outputBlobs contains all output blobs for each layer specified in @p outBlobNames.\n         *  @param outBlobNames names for layers which outputs are needed to get\n         */\n        CV_WRAP_AS(forwardAndRetrieve) void forward(CV_OUT std::vector<std::vector<Mat> >& outputBlobs,\n                                                    const std::vector<String>& outBlobNames);\n\n        /**\n         * @brief Compile Halide layers.\n         * @param[in] scheduler Path to YAML file with scheduling directives.\n         * @see setPreferableBackend\n         *\n         * Schedule layers that support Halide backend. Then compile them for\n         * specific target. For layers that not represented in scheduling file\n         * or if no manual scheduling used at all, automatic scheduling will be applied.\n         */\n        CV_WRAP void setHalideScheduler(const String& scheduler);\n\n        /**\n         * @brief Ask network to use specific computation backend where it supported.\n         * @param[in] backendId backend identifier.\n         * @see Backend\n         *\n         * If OpenCV is compiled with Intel's Inference Engine library, DNN_BACKEND_DEFAULT\n         * means DNN_BACKEND_INFERENCE_ENGINE. Otherwise it equals to DNN_BACKEND_OPENCV.\n         */\n        CV_WRAP void setPreferableBackend(int backendId);\n\n        /**\n         * @brief Ask network to make computations on specific target device.\n         * @param[in] targetId target identifier.\n         * @see Target\n         *\n         * List of supported combinations backend / target:\n         * |                        | DNN_BACKEND_OPENCV | DNN_BACKEND_INFERENCE_ENGINE | DNN_BACKEND_HALIDE |  DNN_BACKEND_CUDA |\n         * |------------------------|--------------------|------------------------------|--------------------|-------------------|\n         * | DNN_TARGET_CPU         |                  + |                            + |                  + |                   |\n         * | DNN_TARGET_OPENCL      |                  + |                            + |                  + |                   |\n         * | DNN_TARGET_OPENCL_FP16 |                  + |                            + |                    |                   |\n         * | DNN_TARGET_MYRIAD      |                    |                            + |                    |                   |\n         * | DNN_TARGET_FPGA        |                    |                            + |                    |                   |\n         * | DNN_TARGET_CUDA        |                    |                              |                    |                 + |\n         * | DNN_TARGET_CUDA_FP16   |                    |                              |                    |                 + |\n         * | DNN_TARGET_HDDL        |                    |                            + |                    |                   |\n         */\n        CV_WRAP void setPreferableTarget(int targetId);\n\n        /** @brief Sets the new input value for the network\n         *  @param blob        A new blob. Should have CV_32F or CV_8U depth.\n         *  @param name        A name of input layer.\n         *  @param scalefactor An optional normalization scale.\n         *  @param mean        An optional mean subtraction values.\n         *  @see connect(String, String) to know format of the descriptor.\n         *\n         *  If scale or mean values are specified, a final input blob is computed\n         *  as:\n         * \\f[input(n,c,h,w) = scalefactor \\times (blob(n,c,h,w) - mean_c)\\f]\n         */\n        CV_WRAP void setInput(InputArray blob, const String& name = \"\",\n                              double scalefactor = 1.0, const Scalar& mean = Scalar());\n\n        /** @brief Sets the new value for the learned param of the layer.\n         *  @param layer name or id of the layer.\n         *  @param numParam index of the layer parameter in the Layer::blobs array.\n         *  @param blob the new value.\n         *  @see Layer::blobs\n         *  @note If shape of the new blob differs from the previous shape,\n         *  then the following forward pass may fail.\n        */\n        CV_WRAP void setParam(LayerId layer, int numParam, const Mat &blob);\n\n        /** @brief Returns parameter blob of the layer.\n         *  @param layer name or id of the layer.\n         *  @param numParam index of the layer parameter in the Layer::blobs array.\n         *  @see Layer::blobs\n         */\n        CV_WRAP Mat getParam(LayerId layer, int numParam = 0);\n\n        /** @brief Returns indexes of layers with unconnected outputs.\n         */\n        CV_WRAP std::vector<int> getUnconnectedOutLayers() const;\n\n        /** @brief Returns names of layers with unconnected outputs.\n         */\n        CV_WRAP std::vector<String> getUnconnectedOutLayersNames() const;\n\n        /** @brief Returns input and output shapes for all layers in loaded model;\n         *  preliminary inferencing isn't necessary.\n         *  @param netInputShapes shapes for all input blobs in net input layer.\n         *  @param layersIds output parameter for layer IDs.\n         *  @param inLayersShapes output parameter for input layers shapes;\n         * order is the same as in layersIds\n         *  @param outLayersShapes output parameter for output layers shapes;\n         * order is the same as in layersIds\n         */\n        CV_WRAP void getLayersShapes(const std::vector<MatShape>& netInputShapes,\n                                     CV_OUT std::vector<int>& layersIds,\n                                     CV_OUT std::vector<std::vector<MatShape> >& inLayersShapes,\n                                     CV_OUT std::vector<std::vector<MatShape> >& outLayersShapes) const;\n\n        /** @overload */\n        CV_WRAP void getLayersShapes(const MatShape& netInputShape,\n                                     CV_OUT std::vector<int>& layersIds,\n                                     CV_OUT std::vector<std::vector<MatShape> >& inLayersShapes,\n                                     CV_OUT std::vector<std::vector<MatShape> >& outLayersShapes) const;\n\n        /** @brief Returns input and output shapes for layer with specified\n         * id in loaded model; preliminary inferencing isn't necessary.\n         *  @param netInputShape shape input blob in net input layer.\n         *  @param layerId id for layer.\n         *  @param inLayerShapes output parameter for input layers shapes;\n         * order is the same as in layersIds\n         *  @param outLayerShapes output parameter for output layers shapes;\n         * order is the same as in layersIds\n         */\n        void getLayerShapes(const MatShape& netInputShape,\n                                    const int layerId,\n                                    CV_OUT std::vector<MatShape>& inLayerShapes,\n                                    CV_OUT std::vector<MatShape>& outLayerShapes) const; // FIXIT: CV_WRAP\n\n        /** @overload */\n        void getLayerShapes(const std::vector<MatShape>& netInputShapes,\n                                    const int layerId,\n                                    CV_OUT std::vector<MatShape>& inLayerShapes,\n                                    CV_OUT std::vector<MatShape>& outLayerShapes) const; // FIXIT: CV_WRAP\n\n        /** @brief Computes FLOP for whole loaded model with specified input shapes.\n         * @param netInputShapes vector of shapes for all net inputs.\n         * @returns computed FLOP.\n         */\n        CV_WRAP int64 getFLOPS(const std::vector<MatShape>& netInputShapes) const;\n        /** @overload */\n        CV_WRAP int64 getFLOPS(const MatShape& netInputShape) const;\n        /** @overload */\n        CV_WRAP int64 getFLOPS(const int layerId,\n                               const std::vector<MatShape>& netInputShapes) const;\n        /** @overload */\n        CV_WRAP int64 getFLOPS(const int layerId,\n                               const MatShape& netInputShape) const;\n\n        /** @brief Returns list of types for layer used in model.\n         * @param layersTypes output parameter for returning types.\n         */\n        CV_WRAP void getLayerTypes(CV_OUT std::vector<String>& layersTypes) const;\n\n        /** @brief Returns count of layers of specified type.\n         * @param layerType type.\n         * @returns count of layers\n         */\n        CV_WRAP int getLayersCount(const String& layerType) const;\n\n        /** @brief Computes bytes number which are required to store\n         * all weights and intermediate blobs for model.\n         * @param netInputShapes vector of shapes for all net inputs.\n         * @param weights output parameter to store resulting bytes for weights.\n         * @param blobs output parameter to store resulting bytes for intermediate blobs.\n         */\n        void getMemoryConsumption(const std::vector<MatShape>& netInputShapes,\n                                          CV_OUT size_t& weights, CV_OUT size_t& blobs) const; // FIXIT: CV_WRAP\n        /** @overload */\n        CV_WRAP void getMemoryConsumption(const MatShape& netInputShape,\n                                          CV_OUT size_t& weights, CV_OUT size_t& blobs) const;\n        /** @overload */\n        CV_WRAP void getMemoryConsumption(const int layerId,\n                                          const std::vector<MatShape>& netInputShapes,\n                                          CV_OUT size_t& weights, CV_OUT size_t& blobs) const;\n        /** @overload */\n        CV_WRAP void getMemoryConsumption(const int layerId,\n                                          const MatShape& netInputShape,\n                                          CV_OUT size_t& weights, CV_OUT size_t& blobs) const;\n\n        /** @brief Computes bytes number which are required to store\n         * all weights and intermediate blobs for each layer.\n         * @param netInputShapes vector of shapes for all net inputs.\n         * @param layerIds output vector to save layer IDs.\n         * @param weights output parameter to store resulting bytes for weights.\n         * @param blobs output parameter to store resulting bytes for intermediate blobs.\n         */\n        void getMemoryConsumption(const std::vector<MatShape>& netInputShapes,\n                                          CV_OUT std::vector<int>& layerIds,\n                                          CV_OUT std::vector<size_t>& weights,\n                                          CV_OUT std::vector<size_t>& blobs) const; // FIXIT: CV_WRAP\n        /** @overload */\n        void getMemoryConsumption(const MatShape& netInputShape,\n                                          CV_OUT std::vector<int>& layerIds,\n                                          CV_OUT std::vector<size_t>& weights,\n                                          CV_OUT std::vector<size_t>& blobs) const; // FIXIT: CV_WRAP\n\n        /** @brief Enables or disables layer fusion in the network.\n         * @param fusion true to enable the fusion, false to disable. The fusion is enabled by default.\n         */\n        CV_WRAP void enableFusion(bool fusion);\n\n        /** @brief Returns overall time for inference and timings (in ticks) for layers.\n         *\n         * Indexes in returned vector correspond to layers ids. Some layers can be fused with others,\n         * in this case zero ticks count will be return for that skipped layers. Supported by DNN_BACKEND_OPENCV on DNN_TARGET_CPU only.\n         *\n         * @param[out] timings vector for tick timings for all layers.\n         * @return overall ticks for model inference.\n         */\n        CV_WRAP int64 getPerfProfile(CV_OUT std::vector<double>& timings);\n\n    private:\n        struct Impl;\n        Ptr<Impl> impl;\n    };\n\n    /** @brief Reads a network model stored in <a href=\"https://pjreddie.com/darknet/\">Darknet</a> model files.\n    *  @param cfgFile      path to the .cfg file with text description of the network architecture.\n    *  @param darknetModel path to the .weights file with learned network.\n    *  @returns Network object that ready to do forward, throw an exception in failure cases.\n    *  @returns Net object.\n    */\n    CV_EXPORTS_W Net readNetFromDarknet(const String &cfgFile, const String &darknetModel = String());\n\n    /** @brief Reads a network model stored in <a href=\"https://pjreddie.com/darknet/\">Darknet</a> model files.\n     *  @param bufferCfg   A buffer contains a content of .cfg file with text description of the network architecture.\n     *  @param bufferModel A buffer contains a content of .weights file with learned network.\n     *  @returns Net object.\n     */\n    CV_EXPORTS_W Net readNetFromDarknet(const std::vector<uchar>& bufferCfg,\n                                        const std::vector<uchar>& bufferModel = std::vector<uchar>());\n\n    /** @brief Reads a network model stored in <a href=\"https://pjreddie.com/darknet/\">Darknet</a> model files.\n     *  @param bufferCfg   A buffer contains a content of .cfg file with text description of the network architecture.\n     *  @param lenCfg      Number of bytes to read from bufferCfg\n     *  @param bufferModel A buffer contains a content of .weights file with learned network.\n     *  @param lenModel    Number of bytes to read from bufferModel\n     *  @returns Net object.\n     */\n    CV_EXPORTS Net readNetFromDarknet(const char *bufferCfg, size_t lenCfg,\n                                      const char *bufferModel = NULL, size_t lenModel = 0);\n\n    /** @brief Reads a network model stored in <a href=\"http://caffe.berkeleyvision.org\">Caffe</a> framework's format.\n      * @param prototxt   path to the .prototxt file with text description of the network architecture.\n      * @param caffeModel path to the .caffemodel file with learned network.\n      * @returns Net object.\n      */\n    CV_EXPORTS_W Net readNetFromCaffe(const String &prototxt, const String &caffeModel = String());\n\n    /** @brief Reads a network model stored in Caffe model in memory.\n      * @param bufferProto buffer containing the content of the .prototxt file\n      * @param bufferModel buffer containing the content of the .caffemodel file\n      * @returns Net object.\n      */\n    CV_EXPORTS_W Net readNetFromCaffe(const std::vector<uchar>& bufferProto,\n                                      const std::vector<uchar>& bufferModel = std::vector<uchar>());\n\n    /** @brief Reads a network model stored in Caffe model in memory.\n      * @details This is an overloaded member function, provided for convenience.\n      * It differs from the above function only in what argument(s) it accepts.\n      * @param bufferProto buffer containing the content of the .prototxt file\n      * @param lenProto length of bufferProto\n      * @param bufferModel buffer containing the content of the .caffemodel file\n      * @param lenModel length of bufferModel\n      * @returns Net object.\n      */\n    CV_EXPORTS Net readNetFromCaffe(const char *bufferProto, size_t lenProto,\n                                    const char *bufferModel = NULL, size_t lenModel = 0);\n\n    /** @brief Reads a network model stored in <a href=\"https://www.tensorflow.org/\">TensorFlow</a> framework's format.\n      * @param model  path to the .pb file with binary protobuf description of the network architecture\n      * @param config path to the .pbtxt file that contains text graph definition in protobuf format.\n      *               Resulting Net object is built by text graph using weights from a binary one that\n      *               let us make it more flexible.\n      * @returns Net object.\n      */\n    CV_EXPORTS_W Net readNetFromTensorflow(const String &model, const String &config = String());\n\n    /** @brief Reads a network model stored in <a href=\"https://www.tensorflow.org/\">TensorFlow</a> framework's format.\n      * @param bufferModel buffer containing the content of the pb file\n      * @param bufferConfig buffer containing the content of the pbtxt file\n      * @returns Net object.\n      */\n    CV_EXPORTS_W Net readNetFromTensorflow(const std::vector<uchar>& bufferModel,\n                                           const std::vector<uchar>& bufferConfig = std::vector<uchar>());\n\n    /** @brief Reads a network model stored in <a href=\"https://www.tensorflow.org/\">TensorFlow</a> framework's format.\n      * @details This is an overloaded member function, provided for convenience.\n      * It differs from the above function only in what argument(s) it accepts.\n      * @param bufferModel buffer containing the content of the pb file\n      * @param lenModel length of bufferModel\n      * @param bufferConfig buffer containing the content of the pbtxt file\n      * @param lenConfig length of bufferConfig\n      */\n    CV_EXPORTS Net readNetFromTensorflow(const char *bufferModel, size_t lenModel,\n                                         const char *bufferConfig = NULL, size_t lenConfig = 0);\n\n    /**\n     *  @brief Reads a network model stored in <a href=\"http://torch.ch\">Torch7</a> framework's format.\n     *  @param model    path to the file, dumped from Torch by using torch.save() function.\n     *  @param isBinary specifies whether the network was serialized in ascii mode or binary.\n     *  @param evaluate specifies testing phase of network. If true, it's similar to evaluate() method in Torch.\n     *  @returns Net object.\n     *\n     *  @note Ascii mode of Torch serializer is more preferable, because binary mode extensively use `long` type of C language,\n     *  which has various bit-length on different systems.\n     *\n     * The loading file must contain serialized <a href=\"https://github.com/torch/nn/blob/master/doc/module.md\">nn.Module</a> object\n     * with importing network. Try to eliminate a custom objects from serialazing data to avoid importing errors.\n     *\n     * List of supported layers (i.e. object instances derived from Torch nn.Module class):\n     * - nn.Sequential\n     * - nn.Parallel\n     * - nn.Concat\n     * - nn.Linear\n     * - nn.SpatialConvolution\n     * - nn.SpatialMaxPooling, nn.SpatialAveragePooling\n     * - nn.ReLU, nn.TanH, nn.Sigmoid\n     * - nn.Reshape\n     * - nn.SoftMax, nn.LogSoftMax\n     *\n     * Also some equivalents of these classes from cunn, cudnn, and fbcunn may be successfully imported.\n     */\n     CV_EXPORTS_W Net readNetFromTorch(const String &model, bool isBinary = true, bool evaluate = true);\n\n     /**\n      * @brief Read deep learning network represented in one of the supported formats.\n      * @param[in] model Binary file contains trained weights. The following file\n      *                  extensions are expected for models from different frameworks:\n      *                  * `*.caffemodel` (Caffe, http://caffe.berkeleyvision.org/)\n      *                  * `*.pb` (TensorFlow, https://www.tensorflow.org/)\n      *                  * `*.t7` | `*.net` (Torch, http://torch.ch/)\n      *                  * `*.weights` (Darknet, https://pjreddie.com/darknet/)\n      *                  * `*.bin` (DLDT, https://software.intel.com/openvino-toolkit)\n      *                  * `*.onnx` (ONNX, https://onnx.ai/)\n      * @param[in] config Text file contains network configuration. It could be a\n      *                   file with the following extensions:\n      *                  * `*.prototxt` (Caffe, http://caffe.berkeleyvision.org/)\n      *                  * `*.pbtxt` (TensorFlow, https://www.tensorflow.org/)\n      *                  * `*.cfg` (Darknet, https://pjreddie.com/darknet/)\n      *                  * `*.xml` (DLDT, https://software.intel.com/openvino-toolkit)\n      * @param[in] framework Explicit framework name tag to determine a format.\n      * @returns Net object.\n      *\n      * This function automatically detects an origin framework of trained model\n      * and calls an appropriate function such @ref readNetFromCaffe, @ref readNetFromTensorflow,\n      * @ref readNetFromTorch or @ref readNetFromDarknet. An order of @p model and @p config\n      * arguments does not matter.\n      */\n     CV_EXPORTS_W Net readNet(const String& model, const String& config = \"\", const String& framework = \"\");\n\n     /**\n      * @brief Read deep learning network represented in one of the supported formats.\n      * @details This is an overloaded member function, provided for convenience.\n      *          It differs from the above function only in what argument(s) it accepts.\n      * @param[in] framework    Name of origin framework.\n      * @param[in] bufferModel  A buffer with a content of binary file with weights\n      * @param[in] bufferConfig A buffer with a content of text file contains network configuration.\n      * @returns Net object.\n      */\n     CV_EXPORTS_W Net readNet(const String& framework, const std::vector<uchar>& bufferModel,\n                              const std::vector<uchar>& bufferConfig = std::vector<uchar>());\n\n    /** @brief Loads blob which was serialized as torch.Tensor object of Torch7 framework.\n     *  @warning This function has the same limitations as readNetFromTorch().\n     */\n    CV_EXPORTS_W Mat readTorchBlob(const String &filename, bool isBinary = true);\n\n    /** @brief Load a network from Intel's Model Optimizer intermediate representation.\n     *  @param[in] xml XML configuration file with network's topology.\n     *  @param[in] bin Binary file with trained weights.\n     *  @returns Net object.\n     *  Networks imported from Intel's Model Optimizer are launched in Intel's Inference Engine\n     *  backend.\n     */\n    CV_EXPORTS_W\n    Net readNetFromModelOptimizer(const String &xml, const String &bin);\n\n    /** @brief Load a network from Intel's Model Optimizer intermediate representation.\n     *  @param[in] bufferModelConfig Buffer contains XML configuration with network's topology.\n     *  @param[in] bufferWeights Buffer contains binary data with trained weights.\n     *  @returns Net object.\n     *  Networks imported from Intel's Model Optimizer are launched in Intel's Inference Engine\n     *  backend.\n     */\n    CV_EXPORTS_W\n    Net readNetFromModelOptimizer(const std::vector<uchar>& bufferModelConfig, const std::vector<uchar>& bufferWeights);\n\n    /** @brief Load a network from Intel's Model Optimizer intermediate representation.\n     *  @param[in] bufferModelConfigPtr Pointer to buffer which contains XML configuration with network's topology.\n     *  @param[in] bufferModelConfigSize Binary size of XML configuration data.\n     *  @param[in] bufferWeightsPtr Pointer to buffer which contains binary data with trained weights.\n     *  @param[in] bufferWeightsSize Binary size of trained weights data.\n     *  @returns Net object.\n     *  Networks imported from Intel's Model Optimizer are launched in Intel's Inference Engine\n     *  backend.\n     */\n    CV_EXPORTS\n    Net readNetFromModelOptimizer(const uchar* bufferModelConfigPtr, size_t bufferModelConfigSize,\n                                           const uchar* bufferWeightsPtr, size_t bufferWeightsSize);\n\n    /** @brief Reads a network model <a href=\"https://onnx.ai/\">ONNX</a>.\n     *  @param onnxFile path to the .onnx file with text description of the network architecture.\n     *  @returns Network object that ready to do forward, throw an exception in failure cases.\n     */\n    CV_EXPORTS_W Net readNetFromONNX(const String &onnxFile);\n\n    /** @brief Reads a network model from <a href=\"https://onnx.ai/\">ONNX</a>\n     *         in-memory buffer.\n     *  @param buffer memory address of the first byte of the buffer.\n     *  @param sizeBuffer size of the buffer.\n     *  @returns Network object that ready to do forward, throw an exception\n     *        in failure cases.\n     */\n    CV_EXPORTS Net readNetFromONNX(const char* buffer, size_t sizeBuffer);\n\n    /** @brief Reads a network model from <a href=\"https://onnx.ai/\">ONNX</a>\n     *         in-memory buffer.\n     *  @param buffer in-memory buffer that stores the ONNX model bytes.\n     *  @returns Network object that ready to do forward, throw an exception\n     *        in failure cases.\n     */\n    CV_EXPORTS_W Net readNetFromONNX(const std::vector<uchar>& buffer);\n\n    /** @brief Creates blob from .pb file.\n     *  @param path to the .pb file with input tensor.\n     *  @returns Mat.\n     */\n    CV_EXPORTS_W Mat readTensorFromONNX(const String& path);\n\n    /** @brief Creates 4-dimensional blob from image. Optionally resizes and crops @p image from center,\n     *  subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels.\n     *  @param image input image (with 1-, 3- or 4-channels).\n     *  @param size spatial size for output image\n     *  @param mean scalar with mean values which are subtracted from channels. Values are intended\n     *  to be in (mean-R, mean-G, mean-B) order if @p image has BGR ordering and @p swapRB is true.\n     *  @param scalefactor multiplier for @p image values.\n     *  @param swapRB flag which indicates that swap first and last channels\n     *  in 3-channel image is necessary.\n     *  @param crop flag which indicates whether image will be cropped after resize or not\n     *  @param ddepth Depth of output blob. Choose CV_32F or CV_8U.\n     *  @details if @p crop is true, input image is resized so one side after resize is equal to corresponding\n     *  dimension in @p size and another one is equal or larger. Then, crop from the center is performed.\n     *  If @p crop is false, direct resize without cropping and preserving aspect ratio is performed.\n     *  @returns 4-dimensional Mat with NCHW dimensions order.\n     */\n    CV_EXPORTS_W Mat blobFromImage(InputArray image, double scalefactor=1.0, const Size& size = Size(),\n                                   const Scalar& mean = Scalar(), bool swapRB=false, bool crop=false,\n                                   int ddepth=CV_32F);\n\n    /** @brief Creates 4-dimensional blob from image.\n     *  @details This is an overloaded member function, provided for convenience.\n     *           It differs from the above function only in what argument(s) it accepts.\n     */\n    CV_EXPORTS void blobFromImage(InputArray image, OutputArray blob, double scalefactor=1.0,\n                                  const Size& size = Size(), const Scalar& mean = Scalar(),\n                                  bool swapRB=false, bool crop=false, int ddepth=CV_32F);\n\n\n    /** @brief Creates 4-dimensional blob from series of images. Optionally resizes and\n     *  crops @p images from center, subtract @p mean values, scales values by @p scalefactor,\n     *  swap Blue and Red channels.\n     *  @param images input images (all with 1-, 3- or 4-channels).\n     *  @param size spatial size for output image\n     *  @param mean scalar with mean values which are subtracted from channels. Values are intended\n     *  to be in (mean-R, mean-G, mean-B) order if @p image has BGR ordering and @p swapRB is true.\n     *  @param scalefactor multiplier for @p images values.\n     *  @param swapRB flag which indicates that swap first and last channels\n     *  in 3-channel image is necessary.\n     *  @param crop flag which indicates whether image will be cropped after resize or not\n     *  @param ddepth Depth of output blob. Choose CV_32F or CV_8U.\n     *  @details if @p crop is true, input image is resized so one side after resize is equal to corresponding\n     *  dimension in @p size and another one is equal or larger. Then, crop from the center is performed.\n     *  If @p crop is false, direct resize without cropping and preserving aspect ratio is performed.\n     *  @returns 4-dimensional Mat with NCHW dimensions order.\n     */\n    CV_EXPORTS_W Mat blobFromImages(InputArrayOfArrays images, double scalefactor=1.0,\n                                    Size size = Size(), const Scalar& mean = Scalar(), bool swapRB=false, bool crop=false,\n                                    int ddepth=CV_32F);\n\n    /** @brief Creates 4-dimensional blob from series of images.\n     *  @details This is an overloaded member function, provided for convenience.\n     *           It differs from the above function only in what argument(s) it accepts.\n     */\n    CV_EXPORTS void blobFromImages(InputArrayOfArrays images, OutputArray blob,\n                                   double scalefactor=1.0, Size size = Size(),\n                                   const Scalar& mean = Scalar(), bool swapRB=false, bool crop=false,\n                                   int ddepth=CV_32F);\n\n    /** @brief Parse a 4D blob and output the images it contains as 2D arrays through a simpler data structure\n     *  (std::vector<cv::Mat>).\n     *  @param[in] blob_ 4 dimensional array (images, channels, height, width) in floating point precision (CV_32F) from\n     *  which you would like to extract the images.\n     *  @param[out] images_ array of 2D Mat containing the images extracted from the blob in floating point precision\n     *  (CV_32F). They are non normalized neither mean added. The number of returned images equals the first dimension\n     *  of the blob (batch size). Every image has a number of channels equals to the second dimension of the blob (depth).\n     */\n    CV_EXPORTS_W void imagesFromBlob(const cv::Mat& blob_, OutputArrayOfArrays images_);\n\n    /** @brief Convert all weights of Caffe network to half precision floating point.\n     * @param src Path to origin model from Caffe framework contains single\n     *            precision floating point weights (usually has `.caffemodel` extension).\n     * @param dst Path to destination model with updated weights.\n     * @param layersTypes Set of layers types which parameters will be converted.\n     *                    By default, converts only Convolutional and Fully-Connected layers'\n     *                    weights.\n     *\n     * @note Shrinked model has no origin float32 weights so it can't be used\n     *       in origin Caffe framework anymore. However the structure of data\n     *       is taken from NVidia's Caffe fork: https://github.com/NVIDIA/caffe.\n     *       So the resulting model may be used there.\n     */\n    CV_EXPORTS_W void shrinkCaffeModel(const String& src, const String& dst,\n                                       const std::vector<String>& layersTypes = std::vector<String>());\n\n    /** @brief Create a text representation for a binary network stored in protocol buffer format.\n     *  @param[in] model  A path to binary network.\n     *  @param[in] output A path to output text file to be created.\n     *\n     *  @note To reduce output file size, trained weights are not included.\n     */\n    CV_EXPORTS_W void writeTextGraph(const String& model, const String& output);\n\n    /** @brief Performs non maximum suppression given boxes and corresponding scores.\n\n     * @param bboxes a set of bounding boxes to apply NMS.\n     * @param scores a set of corresponding confidences.\n     * @param score_threshold a threshold used to filter boxes by score.\n     * @param nms_threshold a threshold used in non maximum suppression.\n     * @param indices the kept indices of bboxes after NMS.\n     * @param eta a coefficient in adaptive threshold formula: \\f$nms\\_threshold_{i+1}=eta\\cdot nms\\_threshold_i\\f$.\n     * @param top_k if `>0`, keep at most @p top_k picked indices.\n     */\n    CV_EXPORTS void NMSBoxes(const std::vector<Rect>& bboxes, const std::vector<float>& scores,\n                               const float score_threshold, const float nms_threshold,\n                               CV_OUT std::vector<int>& indices,\n                               const float eta = 1.f, const int top_k = 0);\n\n    CV_EXPORTS_W void NMSBoxes(const std::vector<Rect2d>& bboxes, const std::vector<float>& scores,\n                               const float score_threshold, const float nms_threshold,\n                               CV_OUT std::vector<int>& indices,\n                               const float eta = 1.f, const int top_k = 0);\n\n    CV_EXPORTS_AS(NMSBoxesRotated) void NMSBoxes(const std::vector<RotatedRect>& bboxes, const std::vector<float>& scores,\n                             const float score_threshold, const float nms_threshold,\n                             CV_OUT std::vector<int>& indices,\n                             const float eta = 1.f, const int top_k = 0);\n\n\n     /** @brief This class is presented high-level API for neural networks.\n      *\n      * Model allows to set params for preprocessing input image.\n      * Model creates net from file with trained weights and config,\n      * sets preprocessing input and runs forward pass.\n      */\n     class CV_EXPORTS_W_SIMPLE Model\n     {\n     public:\n         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code, will be moved to \"protected\" (need to fix bindings first)\n         Model();\n\n         Model(const Model&) = default;\n         Model(Model&&) = default;\n         Model& operator=(const Model&) = default;\n         Model& operator=(Model&&) = default;\n\n         /**\n          * @brief Create model from deep learning network represented in one of the supported formats.\n          * An order of @p model and @p config arguments does not matter.\n          * @param[in] model Binary file contains trained weights.\n          * @param[in] config Text file contains network configuration.\n          */\n         CV_WRAP Model(const String& model, const String& config = \"\");\n\n         /**\n          * @brief Create model from deep learning network.\n          * @param[in] network Net object.\n          */\n         CV_WRAP Model(const Net& network);\n\n         /** @brief Set input size for frame.\n          *  @param[in] size New input size.\n          *  @note If shape of the new blob less than 0, then frame size not change.\n         */\n         CV_WRAP Model& setInputSize(const Size& size);\n\n         /** @overload\n         *  @param[in] width New input width.\n         *  @param[in] height New input height.\n         */\n         CV_WRAP inline\n         Model& setInputSize(int width, int height) { return setInputSize(Size(width, height)); }\n\n         /** @brief Set mean value for frame.\n          *  @param[in] mean Scalar with mean values which are subtracted from channels.\n         */\n         CV_WRAP Model& setInputMean(const Scalar& mean);\n\n         /** @brief Set scalefactor value for frame.\n          *  @param[in] scale Multiplier for frame values.\n         */\n         CV_WRAP Model& setInputScale(double scale);\n\n         /** @brief Set flag crop for frame.\n          *  @param[in] crop Flag which indicates whether image will be cropped after resize or not.\n         */\n         CV_WRAP Model& setInputCrop(bool crop);\n\n         /** @brief Set flag swapRB for frame.\n          *  @param[in] swapRB Flag which indicates that swap first and last channels.\n         */\n         CV_WRAP Model& setInputSwapRB(bool swapRB);\n\n         /** @brief Set preprocessing parameters for frame.\n         *  @param[in] size New input size.\n         *  @param[in] mean Scalar with mean values which are subtracted from channels.\n         *  @param[in] scale Multiplier for frame values.\n         *  @param[in] swapRB Flag which indicates that swap first and last channels.\n         *  @param[in] crop Flag which indicates whether image will be cropped after resize or not.\n         *  blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )\n         */\n         CV_WRAP void setInputParams(double scale = 1.0, const Size& size = Size(),\n                                     const Scalar& mean = Scalar(), bool swapRB = false, bool crop = false);\n\n         /** @brief Given the @p input frame, create input blob, run net and return the output @p blobs.\n          *  @param[in]  frame  The input image.\n          *  @param[out] outs Allocated output blobs, which will store results of the computation.\n          */\n         CV_WRAP void predict(InputArray frame, OutputArrayOfArrays outs) const;\n\n\n         // ============================== Net proxy methods ==============================\n         // Never expose methods with network implementation details, like:\n         // - addLayer, addLayerToPrev, connect, setInputsNames, setInputShape, setParam, getParam\n         // - getLayer*, getUnconnectedOutLayers, getUnconnectedOutLayersNames, getLayersShapes\n         // - forward* methods, setInput\n\n         /// @sa Net::setPreferableBackend\n         CV_WRAP Model& setPreferableBackend(dnn::Backend backendId);\n         /// @sa Net::setPreferableTarget\n         CV_WRAP Model& setPreferableTarget(dnn::Target targetId);\n\n         CV_DEPRECATED_EXTERNAL\n         operator Net&() const { return getNetwork_(); }\n\n     //protected: - internal/tests usage only\n         Net& getNetwork_() const;\n         inline Net& getNetwork_() { return const_cast<const Model*>(this)->getNetwork_(); }\n\n         struct Impl;\n         inline Impl* getImpl() const { return impl.get(); }\n         inline Impl& getImplRef() const { CV_DbgAssert(impl); return *impl.get(); }\n     protected:\n         Ptr<Impl> impl;\n     };\n\n     /** @brief This class represents high-level API for classification models.\n      *\n      * ClassificationModel allows to set params for preprocessing input image.\n      * ClassificationModel creates net from file with trained weights and config,\n      * sets preprocessing input, runs forward pass and return top-1 prediction.\n      */\n     class CV_EXPORTS_W_SIMPLE ClassificationModel : public Model\n     {\n     public:\n         /**\n          * @brief Create classification model from network represented in one of the supported formats.\n          * An order of @p model and @p config arguments does not matter.\n          * @param[in] model Binary file contains trained weights.\n          * @param[in] config Text file contains network configuration.\n          */\n          CV_WRAP ClassificationModel(const String& model, const String& config = \"\");\n\n         /**\n          * @brief Create model from deep learning network.\n          * @param[in] network Net object.\n          */\n         CV_WRAP ClassificationModel(const Net& network);\n\n         /** @brief Given the @p input frame, create input blob, run net and return top-1 prediction.\n          *  @param[in]  frame  The input image.\n          */\n         std::pair<int, float> classify(InputArray frame);\n\n         /** @overload */\n         CV_WRAP void classify(InputArray frame, CV_OUT int& classId, CV_OUT float& conf);\n     };\n\n     /** @brief This class represents high-level API for keypoints models\n      *\n      * KeypointsModel allows to set params for preprocessing input image.\n      * KeypointsModel creates net from file with trained weights and config,\n      * sets preprocessing input, runs forward pass and returns the x and y coordinates of each detected keypoint\n      */\n     class CV_EXPORTS_W_SIMPLE KeypointsModel: public Model\n     {\n     public:\n         /**\n          * @brief Create keypoints model from network represented in one of the supported formats.\n          * An order of @p model and @p config arguments does not matter.\n          * @param[in] model Binary file contains trained weights.\n          * @param[in] config Text file contains network configuration.\n          */\n          CV_WRAP KeypointsModel(const String& model, const String& config = \"\");\n\n         /**\n          * @brief Create model from deep learning network.\n          * @param[in] network Net object.\n          */\n         CV_WRAP KeypointsModel(const Net& network);\n\n         /** @brief Given the @p input frame, create input blob, run net\n          *  @param[in]  frame  The input image.\n          *  @param thresh minimum confidence threshold to select a keypoint\n          *  @returns a vector holding the x and y coordinates of each detected keypoint\n          *\n          */\n         CV_WRAP std::vector<Point2f> estimate(InputArray frame, float thresh=0.5);\n     };\n\n     /** @brief This class represents high-level API for segmentation  models\n      *\n      * SegmentationModel allows to set params for preprocessing input image.\n      * SegmentationModel creates net from file with trained weights and config,\n      * sets preprocessing input, runs forward pass and returns the class prediction for each pixel.\n      */\n     class CV_EXPORTS_W_SIMPLE SegmentationModel: public Model\n     {\n     public:\n         /**\n          * @brief Create segmentation model from network represented in one of the supported formats.\n          * An order of @p model and @p config arguments does not matter.\n          * @param[in] model Binary file contains trained weights.\n          * @param[in] config Text file contains network configuration.\n          */\n          CV_WRAP SegmentationModel(const String& model, const String& config = \"\");\n\n         /**\n          * @brief Create model from deep learning network.\n          * @param[in] network Net object.\n          */\n         CV_WRAP SegmentationModel(const Net& network);\n\n         /** @brief Given the @p input frame, create input blob, run net\n          *  @param[in]  frame  The input image.\n          *  @param[out] mask Allocated class prediction for each pixel\n          */\n         CV_WRAP void segment(InputArray frame, OutputArray mask);\n     };\n\n     /** @brief This class represents high-level API for object detection networks.\n      *\n      * DetectionModel allows to set params for preprocessing input image.\n      * DetectionModel creates net from file with trained weights and config,\n      * sets preprocessing input, runs forward pass and return result detections.\n      * For DetectionModel SSD, Faster R-CNN, YOLO topologies are supported.\n      */\n     class CV_EXPORTS_W_SIMPLE DetectionModel : public Model\n     {\n     public:\n         /**\n          * @brief Create detection model from network represented in one of the supported formats.\n          * An order of @p model and @p config arguments does not matter.\n          * @param[in] model Binary file contains trained weights.\n          * @param[in] config Text file contains network configuration.\n          */\n         CV_WRAP DetectionModel(const String& model, const String& config = \"\");\n\n         /**\n          * @brief Create model from deep learning network.\n          * @param[in] network Net object.\n          */\n         CV_WRAP DetectionModel(const Net& network);\n\n         CV_DEPRECATED_EXTERNAL  // avoid using in C++ code (need to fix bindings first)\n         DetectionModel();\n\n         /**\n          * @brief nmsAcrossClasses defaults to false,\n          * such that when non max suppression is used during the detect() function, it will do so per-class.\n          * This function allows you to toggle this behaviour.\n          * @param[in] value The new value for nmsAcrossClasses\n          */\n         CV_WRAP DetectionModel& setNmsAcrossClasses(bool value);\n\n         /**\n          * @brief Getter for nmsAcrossClasses. This variable defaults to false,\n          * such that when non max suppression is used during the detect() function, it will do so only per-class\n          */\n         CV_WRAP bool getNmsAcrossClasses();\n\n         /** @brief Given the @p input frame, create input blob, run net and return result detections.\n          *  @param[in]  frame  The input image.\n          *  @param[out] classIds Class indexes in result detection.\n          *  @param[out] confidences A set of corresponding confidences.\n          *  @param[out] boxes A set of bounding boxes.\n          *  @param[in] confThreshold A threshold used to filter boxes by confidences.\n          *  @param[in] nmsThreshold A threshold used in non maximum suppression.\n          */\n         CV_WRAP void detect(InputArray frame, CV_OUT std::vector<int>& classIds,\n                             CV_OUT std::vector<float>& confidences, CV_OUT std::vector<Rect>& boxes,\n                             float confThreshold = 0.5f, float nmsThreshold = 0.0f);\n     };\n\n\n/** @brief This class represents high-level API for text recognition networks.\n *\n * TextRecognitionModel allows to set params for preprocessing input image.\n * TextRecognitionModel creates net from file with trained weights and config,\n * sets preprocessing input, runs forward pass and return recognition result.\n * For TextRecognitionModel, CRNN-CTC is supported.\n */\nclass CV_EXPORTS_W_SIMPLE TextRecognitionModel : public Model\n{\npublic:\n    CV_DEPRECATED_EXTERNAL  // avoid using in C++ code, will be moved to \"protected\" (need to fix bindings first)\n    TextRecognitionModel();\n\n    /**\n     * @brief Create Text Recognition model from deep learning network\n     * Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method\n     * @param[in] network Net object\n     */\n    CV_WRAP TextRecognitionModel(const Net& network);\n\n    /**\n     * @brief Create text recognition model from network represented in one of the supported formats\n     * Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method\n     * @param[in] model Binary file contains trained weights\n     * @param[in] config Text file contains network configuration\n     */\n    CV_WRAP inline\n    TextRecognitionModel(const std::string& model, const std::string& config = \"\")\n        : TextRecognitionModel(readNet(model, config)) { /* nothing */ }\n\n    /**\n     * @brief Set the decoding method of translating the network output into string\n     * @param[in] decodeType The decoding method of translating the network output into string: {'CTC-greedy': greedy decoding for the output of CTC-based methods}\n     */\n    CV_WRAP\n    TextRecognitionModel& setDecodeType(const std::string& decodeType);\n\n    /**\n     * @brief Get the decoding method\n     * @return the decoding method\n     */\n    CV_WRAP\n    const std::string& getDecodeType() const;\n\n    /**\n     * @brief Set the vocabulary for recognition.\n     * @param[in] vocabulary the associated vocabulary of the network.\n     */\n    CV_WRAP\n    TextRecognitionModel& setVocabulary(const std::vector<std::string>& vocabulary);\n\n    /**\n     * @brief Get the vocabulary for recognition.\n     * @return vocabulary the associated vocabulary\n     */\n    CV_WRAP\n    const std::vector<std::string>& getVocabulary() const;\n\n    /**\n     * @brief Given the @p input frame, create input blob, run net and return recognition result\n     * @param[in] frame The input image\n     * @return The text recognition result\n     */\n    CV_WRAP\n    std::string recognize(InputArray frame) const;\n\n    /**\n     * @brief Given the @p input frame, create input blob, run net and return recognition result\n     * @param[in] frame The input image\n     * @param[in] roiRects List of text detection regions of interest (cv::Rect, CV_32SC4). ROIs is be cropped as the network inputs\n     * @param[out] results A set of text recognition results.\n     */\n    CV_WRAP\n    void recognize(InputArray frame, InputArrayOfArrays roiRects, CV_OUT std::vector<std::string>& results) const;\n};\n\n\n/** @brief Base class for text detection networks\n */\nclass CV_EXPORTS_W_SIMPLE TextDetectionModel : public Model\n{\nprotected:\n    CV_DEPRECATED_EXTERNAL  // avoid using in C++ code, will be moved to \"protected\" (need to fix bindings first)\n    TextDetectionModel();\n\npublic:\n\n    /** @brief Performs detection\n     *\n     * Given the input @p frame, prepare network input, run network inference, post-process network output and return result detections.\n     *\n     * Each result is quadrangle's 4 points in this order:\n     * - bottom-left\n     * - top-left\n     * - top-right\n     * - bottom-right\n     *\n     * Use cv::getPerspectiveTransform function to retrive image region without perspective transformations.\n     *\n     * @note If DL model doesn't support that kind of output then result may be derived from detectTextRectangles() output.\n     *\n     * @param[in] frame The input image\n     * @param[out] detections array with detections' quadrangles (4 points per result)\n     * @param[out] confidences array with detection confidences\n     */\n    CV_WRAP\n    void detect(\n            InputArray frame,\n            CV_OUT std::vector< std::vector<Point> >& detections,\n            CV_OUT std::vector<float>& confidences\n    ) const;\n\n    /** @overload */\n    CV_WRAP\n    void detect(\n            InputArray frame,\n            CV_OUT std::vector< std::vector<Point> >& detections\n    ) const;\n\n    /** @brief Performs detection\n     *\n     * Given the input @p frame, prepare network input, run network inference, post-process network output and return result detections.\n     *\n     * Each result is rotated rectangle.\n     *\n     * @note Result may be inaccurate in case of strong perspective transformations.\n     *\n     * @param[in] frame the input image\n     * @param[out] detections array with detections' RotationRect results\n     * @param[out] confidences array with detection confidences\n     */\n    CV_WRAP\n    void detectTextRectangles(\n            InputArray frame,\n            CV_OUT std::vector<cv::RotatedRect>& detections,\n            CV_OUT std::vector<float>& confidences\n    ) const;\n\n    /** @overload */\n    CV_WRAP\n    void detectTextRectangles(\n            InputArray frame,\n            CV_OUT std::vector<cv::RotatedRect>& detections\n    ) const;\n};\n\n/** @brief This class represents high-level API for text detection DL networks compatible with EAST model.\n *\n * Configurable parameters:\n * - (float) confThreshold - used to filter boxes by confidences, default: 0.5f\n * - (float) nmsThreshold - used in non maximum suppression, default: 0.0f\n */\nclass CV_EXPORTS_W_SIMPLE TextDetectionModel_EAST : public TextDetectionModel\n{\npublic:\n    CV_DEPRECATED_EXTERNAL  // avoid using in C++ code, will be moved to \"protected\" (need to fix bindings first)\n    TextDetectionModel_EAST();\n\n    /**\n     * @brief Create text detection algorithm from deep learning network\n     * @param[in] network Net object\n     */\n    CV_WRAP TextDetectionModel_EAST(const Net& network);\n\n    /**\n     * @brief Create text detection model from network represented in one of the supported formats.\n     * An order of @p model and @p config arguments does not matter.\n     * @param[in] model Binary file contains trained weights.\n     * @param[in] config Text file contains network configuration.\n     */\n    CV_WRAP inline\n    TextDetectionModel_EAST(const std::string& model, const std::string& config = \"\")\n        : TextDetectionModel_EAST(readNet(model, config)) { /* nothing */ }\n\n    /**\n     * @brief Set the detection confidence threshold\n     * @param[in] confThreshold A threshold used to filter boxes by confidences\n     */\n    CV_WRAP\n    TextDetectionModel_EAST& setConfidenceThreshold(float confThreshold);\n\n    /**\n     * @brief Get the detection confidence threshold\n     */\n    CV_WRAP\n    float getConfidenceThreshold() const;\n\n    /**\n     * @brief Set the detection NMS filter threshold\n     * @param[in] nmsThreshold A threshold used in non maximum suppression\n     */\n    CV_WRAP\n    TextDetectionModel_EAST& setNMSThreshold(float nmsThreshold);\n\n    /**\n     * @brief Get the detection confidence threshold\n     */\n    CV_WRAP\n    float getNMSThreshold() const;\n};\n\n/** @brief This class represents high-level API for text detection DL networks compatible with DB model.\n *\n * Related publications: @cite liao2020real\n * Paper: https://arxiv.org/abs/1911.08947\n * For more information about the hyper-parameters setting, please refer to https://github.com/MhLiao/DB\n *\n * Configurable parameters:\n * - (float) binaryThreshold - The threshold of the binary map. It is usually set to 0.3.\n * - (float) polygonThreshold - The threshold of text polygons. It is usually set to 0.5, 0.6, and 0.7. Default is 0.5f\n * - (double) unclipRatio - The unclip ratio of the detected text region, which determines the output size. It is usually set to 2.0.\n * - (int) maxCandidates - The max number of the output results.\n */\nclass CV_EXPORTS_W_SIMPLE TextDetectionModel_DB : public TextDetectionModel\n{\npublic:\n    CV_DEPRECATED_EXTERNAL  // avoid using in C++ code, will be moved to \"protected\" (need to fix bindings first)\n    TextDetectionModel_DB();\n\n    /**\n     * @brief Create text detection algorithm from deep learning network.\n     * @param[in] network Net object.\n     */\n    CV_WRAP TextDetectionModel_DB(const Net& network);\n\n    /**\n     * @brief Create text detection model from network represented in one of the supported formats.\n     * An order of @p model and @p config arguments does not matter.\n     * @param[in] model Binary file contains trained weights.\n     * @param[in] config Text file contains network configuration.\n     */\n    CV_WRAP inline\n    TextDetectionModel_DB(const std::string& model, const std::string& config = \"\")\n        : TextDetectionModel_DB(readNet(model, config)) { /* nothing */ }\n\n    CV_WRAP TextDetectionModel_DB& setBinaryThreshold(float binaryThreshold);\n    CV_WRAP float getBinaryThreshold() const;\n\n    CV_WRAP TextDetectionModel_DB& setPolygonThreshold(float polygonThreshold);\n    CV_WRAP float getPolygonThreshold() const;\n\n    CV_WRAP TextDetectionModel_DB& setUnclipRatio(double unclipRatio);\n    CV_WRAP double getUnclipRatio() const;\n\n    CV_WRAP TextDetectionModel_DB& setMaxCandidates(int maxCandidates);\n    CV_WRAP int getMaxCandidates() const;\n};\n\n//! @}\nCV__DNN_INLINE_NS_END\n}\n}\n\n#include <opencv2/dnn/layer.hpp>\n#include <opencv2/dnn/dnn.inl.hpp>\n\n/// @deprecated Include this header directly from application. Automatic inclusion will be removed\n#include <opencv2/dnn/utils/inference_engine.hpp>\n\n#endif  /* OPENCV_DNN_DNN_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn/dnn.inl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_DNN_DNN_INL_HPP\n#define OPENCV_DNN_DNN_INL_HPP\n\n#include <opencv2/dnn.hpp>\n\nnamespace cv {\nnamespace dnn {\nCV__DNN_INLINE_NS_BEGIN\n\ntemplate<typename TypeIter>\nDictValue DictValue::arrayInt(TypeIter begin, int size)\n{\n    DictValue res(Param::INT, new AutoBuffer<int64, 1>(size));\n    for (int j = 0; j < size; begin++, j++)\n        (*res.pi)[j] = *begin;\n    return res;\n}\n\ntemplate<typename TypeIter>\nDictValue DictValue::arrayReal(TypeIter begin, int size)\n{\n    DictValue res(Param::REAL, new AutoBuffer<double, 1>(size));\n    for (int j = 0; j < size; begin++, j++)\n        (*res.pd)[j] = *begin;\n    return res;\n}\n\ntemplate<typename TypeIter>\nDictValue DictValue::arrayString(TypeIter begin, int size)\n{\n    DictValue res(Param::STRING, new AutoBuffer<String, 1>(size));\n    for (int j = 0; j < size; begin++, j++)\n        (*res.ps)[j] = *begin;\n    return res;\n}\n\ntemplate<>\ninline DictValue DictValue::get<DictValue>(int idx) const\n{\n    CV_Assert(idx == -1);\n    return *this;\n}\n\ntemplate<>\ninline int64 DictValue::get<int64>(int idx) const\n{\n    CV_Assert((idx == -1 && size() == 1) || (idx >= 0 && idx < size()));\n    idx = (idx == -1) ? 0 : idx;\n\n    if (type == Param::INT)\n    {\n        return (*pi)[idx];\n    }\n    else if (type == Param::REAL)\n    {\n        double doubleValue = (*pd)[idx];\n\n        double fracpart, intpart;\n        fracpart = std::modf(doubleValue, &intpart);\n        CV_Assert(fracpart == 0.0);\n\n        return (int64)doubleValue;\n    }\n    else if (type == Param::STRING)\n    {\n        return std::atoi((*ps)[idx].c_str());\n    }\n    else\n    {\n        CV_Assert(isInt() || isReal() || isString());\n        return 0;\n    }\n}\n\ntemplate<>\ninline int DictValue::get<int>(int idx) const\n{\n    return (int)get<int64>(idx);\n}\n\ninline int DictValue::getIntValue(int idx) const\n{\n    return (int)get<int64>(idx);\n}\n\ntemplate<>\ninline unsigned DictValue::get<unsigned>(int idx) const\n{\n    return (unsigned)get<int64>(idx);\n}\n\ntemplate<>\ninline bool DictValue::get<bool>(int idx) const\n{\n    return (get<int64>(idx) != 0);\n}\n\ntemplate<>\ninline double DictValue::get<double>(int idx) const\n{\n    CV_Assert((idx == -1 && size() == 1) || (idx >= 0 && idx < size()));\n    idx = (idx == -1) ? 0 : idx;\n\n    if (type == Param::REAL)\n    {\n        return (*pd)[idx];\n    }\n    else if (type == Param::INT)\n    {\n        return (double)(*pi)[idx];\n    }\n    else if (type == Param::STRING)\n    {\n        return std::atof((*ps)[idx].c_str());\n    }\n    else\n    {\n        CV_Assert(isReal() || isInt() || isString());\n        return 0;\n    }\n}\n\ninline double DictValue::getRealValue(int idx) const\n{\n    return get<double>(idx);\n}\n\ntemplate<>\ninline float DictValue::get<float>(int idx) const\n{\n    return (float)get<double>(idx);\n}\n\ntemplate<>\ninline String DictValue::get<String>(int idx) const\n{\n    CV_Assert(isString());\n    CV_Assert((idx == -1 && ps->size() == 1) || (idx >= 0 && idx < (int)ps->size()));\n    return (*ps)[(idx == -1) ? 0 : idx];\n}\n\n\ninline String DictValue::getStringValue(int idx) const\n{\n    return get<String>(idx);\n}\n\ninline void DictValue::release()\n{\n    switch (type)\n    {\n    case Param::INT:\n        delete pi;\n        break;\n    case Param::STRING:\n        delete ps;\n        break;\n    case Param::REAL:\n        delete pd;\n        break;\n    case Param::BOOLEAN:\n    case Param::MAT:\n    case Param::MAT_VECTOR:\n    case Param::ALGORITHM:\n    case Param::FLOAT:\n    case Param::UNSIGNED_INT:\n    case Param::UINT64:\n    case Param::UCHAR:\n    case Param::SCALAR:\n        break; // unhandled\n    }\n}\n\ninline DictValue::~DictValue()\n{\n    release();\n}\n\ninline DictValue & DictValue::operator=(const DictValue &r)\n{\n    if (&r == this)\n        return *this;\n\n    if (r.type == Param::INT)\n    {\n        AutoBuffer<int64, 1> *tmp = new AutoBuffer<int64, 1>(*r.pi);\n        release();\n        pi = tmp;\n    }\n    else if (r.type == Param::STRING)\n    {\n        AutoBuffer<String, 1> *tmp = new AutoBuffer<String, 1>(*r.ps);\n        release();\n        ps = tmp;\n    }\n    else if (r.type == Param::REAL)\n    {\n        AutoBuffer<double, 1> *tmp = new AutoBuffer<double, 1>(*r.pd);\n        release();\n        pd = tmp;\n    }\n\n    type = r.type;\n\n    return *this;\n}\n\ninline DictValue::DictValue(const DictValue &r)\n    : pv(NULL)\n{\n    type = r.type;\n\n    if (r.type == Param::INT)\n        pi = new AutoBuffer<int64, 1>(*r.pi);\n    else if (r.type == Param::STRING)\n        ps = new AutoBuffer<String, 1>(*r.ps);\n    else if (r.type == Param::REAL)\n        pd = new AutoBuffer<double, 1>(*r.pd);\n}\n\ninline bool DictValue::isString() const\n{\n    return (type == Param::STRING);\n}\n\ninline bool DictValue::isInt() const\n{\n    return (type == Param::INT);\n}\n\ninline bool DictValue::isReal() const\n{\n    return (type == Param::REAL || type == Param::INT);\n}\n\ninline int DictValue::size() const\n{\n    switch (type)\n    {\n    case Param::INT:\n        return (int)pi->size();\n    case Param::STRING:\n        return (int)ps->size();\n    case Param::REAL:\n        return (int)pd->size();\n    case Param::BOOLEAN:\n    case Param::MAT:\n    case Param::MAT_VECTOR:\n    case Param::ALGORITHM:\n    case Param::FLOAT:\n    case Param::UNSIGNED_INT:\n    case Param::UINT64:\n    case Param::UCHAR:\n    case Param::SCALAR:\n        break; // unhandled\n    }\n    CV_Error_(Error::StsInternal, (\"Unhandled type (%d)\", static_cast<int>(type)));\n}\n\ninline std::ostream &operator<<(std::ostream &stream, const DictValue &dictv)\n{\n    int i;\n\n    if (dictv.isInt())\n    {\n        for (i = 0; i < dictv.size() - 1; i++)\n            stream << dictv.get<int64>(i) << \", \";\n        stream << dictv.get<int64>(i);\n    }\n    else if (dictv.isReal())\n    {\n        for (i = 0; i < dictv.size() - 1; i++)\n            stream << dictv.get<double>(i) << \", \";\n        stream << dictv.get<double>(i);\n    }\n    else if (dictv.isString())\n    {\n        for (i = 0; i < dictv.size() - 1; i++)\n            stream << \"\\\"\" << dictv.get<String>(i) << \"\\\", \";\n        stream << dictv.get<String>(i);\n    }\n\n    return stream;\n}\n\n/////////////////////////////////////////////////////////////////\n\ninline bool Dict::has(const String &key) const\n{\n    return dict.count(key) != 0;\n}\n\ninline DictValue *Dict::ptr(const String &key)\n{\n    _Dict::iterator i = dict.find(key);\n    return (i == dict.end()) ? NULL : &i->second;\n}\n\ninline const DictValue *Dict::ptr(const String &key) const\n{\n    _Dict::const_iterator i = dict.find(key);\n    return (i == dict.end()) ? NULL : &i->second;\n}\n\ninline const DictValue &Dict::get(const String &key) const\n{\n    _Dict::const_iterator i = dict.find(key);\n    if (i == dict.end())\n        CV_Error(Error::StsObjectNotFound, \"Required argument \\\"\" + key + \"\\\" not found into dictionary\");\n    return i->second;\n}\n\ntemplate <typename T>\ninline T Dict::get(const String &key) const\n{\n    return this->get(key).get<T>();\n}\n\ntemplate <typename T>\ninline T Dict::get(const String &key, const T &defaultValue) const\n{\n    _Dict::const_iterator i = dict.find(key);\n\n    if (i != dict.end())\n        return i->second.get<T>();\n    else\n        return defaultValue;\n}\n\ntemplate<typename T>\ninline const T &Dict::set(const String &key, const T &value)\n{\n    _Dict::iterator i = dict.find(key);\n\n    if (i != dict.end())\n        i->second = DictValue(value);\n    else\n        dict.insert(std::make_pair(key, DictValue(value)));\n\n    return value;\n}\n\ninline void Dict::erase(const String &key)\n{\n    dict.erase(key);\n}\n\ninline std::ostream &operator<<(std::ostream &stream, const Dict &dict)\n{\n    Dict::_Dict::const_iterator it;\n    for (it = dict.dict.begin(); it != dict.dict.end(); it++)\n        stream << it->first << \" : \" << it->second << \"\\n\";\n\n    return stream;\n}\n\ninline std::map<String, DictValue>::const_iterator Dict::begin() const\n{\n    return dict.begin();\n}\n\ninline std::map<String, DictValue>::const_iterator Dict::end() const\n{\n    return dict.end();\n}\n\nCV__DNN_INLINE_NS_END\n}\n}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn/layer.details.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n#ifndef OPENCV_DNN_LAYER_DETAILS_HPP\n#define OPENCV_DNN_LAYER_DETAILS_HPP\n\n#include <opencv2/dnn/layer.hpp>\n\nnamespace cv {\nnamespace dnn {\nCV__DNN_INLINE_NS_BEGIN\n\n/** @brief Registers layer constructor in runtime.\n*   @param type string, containing type name of the layer.\n*   @param constructorFunc pointer to the function of type LayerRegister::Constructor, which creates the layer.\n*   @details This macros must be placed inside the function code.\n*/\n#define CV_DNN_REGISTER_LAYER_FUNC(type, constructorFunc) \\\n    cv::dnn::LayerFactory::registerLayer(#type, constructorFunc);\n\n/** @brief Registers layer class in runtime.\n *  @param type string, containing type name of the layer.\n *  @param class C++ class, derived from Layer.\n *  @details This macros must be placed inside the function code.\n */\n#define CV_DNN_REGISTER_LAYER_CLASS(type, class) \\\n    cv::dnn::LayerFactory::registerLayer(#type, cv::dnn::details::_layerDynamicRegisterer<class>);\n\n/** @brief Registers layer constructor on module load time.\n*   @param type string, containing type name of the layer.\n*   @param constructorFunc pointer to the function of type LayerRegister::Constructor, which creates the layer.\n*   @details This macros must be placed outside the function code.\n*/\n#define CV_DNN_REGISTER_LAYER_FUNC_STATIC(type, constructorFunc) \\\nstatic cv::dnn::details::_LayerStaticRegisterer __LayerStaticRegisterer_##type(#type, constructorFunc);\n\n/** @brief Registers layer class on module load time.\n *  @param type string, containing type name of the layer.\n *  @param class C++ class, derived from Layer.\n *  @details This macros must be placed outside the function code.\n */\n#define CV_DNN_REGISTER_LAYER_CLASS_STATIC(type, class)                         \\\nPtr<Layer> __LayerStaticRegisterer_func_##type(LayerParams &params) \\\n    { return Ptr<Layer>(new class(params)); }                       \\\nstatic cv::dnn::details::_LayerStaticRegisterer __LayerStaticRegisterer_##type(#type, __LayerStaticRegisterer_func_##type);\n\nnamespace details {\n\ntemplate<typename LayerClass>\nPtr<Layer> _layerDynamicRegisterer(LayerParams &params)\n{\n    return Ptr<Layer>(LayerClass::create(params));\n}\n\n//allows automatically register created layer on module load time\nclass _LayerStaticRegisterer\n{\n    String type;\npublic:\n\n    _LayerStaticRegisterer(const String &layerType, LayerFactory::Constructor layerConstructor)\n    {\n        this->type = layerType;\n        LayerFactory::registerLayer(layerType, layerConstructor);\n    }\n\n    ~_LayerStaticRegisterer()\n    {\n        LayerFactory::unregisterLayer(type);\n    }\n};\n\n} // namespace\nCV__DNN_INLINE_NS_END\n}} // namespace\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn/layer.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_DNN_LAYER_HPP\n#define OPENCV_DNN_LAYER_HPP\n#include <opencv2/dnn.hpp>\n\nnamespace cv {\nnamespace dnn {\nCV__DNN_INLINE_NS_BEGIN\n//! @addtogroup dnn\n//! @{\n//!\n//! @defgroup dnnLayerFactory Utilities for New Layers Registration\n//! @{\n\n/** @brief %Layer factory allows to create instances of registered layers. */\nclass CV_EXPORTS LayerFactory\n{\npublic:\n\n    //! Each Layer class must provide this function to the factory\n    typedef Ptr<Layer>(*Constructor)(LayerParams &params);\n\n    //! Registers the layer class with typename @p type and specified @p constructor. Thread-safe.\n    static void registerLayer(const String &type, Constructor constructor);\n\n    //! Unregisters registered layer with specified type name. Thread-safe.\n    static void unregisterLayer(const String &type);\n\n    /** @brief Creates instance of registered layer.\n     *  @param type type name of creating layer.\n     *  @param params parameters which will be used for layer initialization.\n     *  @note Thread-safe.\n     */\n    static Ptr<Layer> createLayerInstance(const String &type, LayerParams& params);\n\nprivate:\n    LayerFactory();\n};\n\n//! @}\n//! @}\nCV__DNN_INLINE_NS_END\n}\n}\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn/shape_utils.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_DNN_DNN_SHAPE_UTILS_HPP\n#define OPENCV_DNN_DNN_SHAPE_UTILS_HPP\n\n#include <opencv2/dnn/dnn.hpp>\n#include <opencv2/core/types_c.h>  // CV_MAX_DIM\n#include <iostream>\n#include <ostream>\n#include <sstream>\n\nnamespace cv {\nnamespace dnn {\nCV__DNN_INLINE_NS_BEGIN\n\n//Slicing\n\nstruct _Range : public cv::Range\n{\n    _Range(const Range &r) : cv::Range(r) {}\n    _Range(int start_, int size_ = 1) : cv::Range(start_, start_ + size_) {}\n};\n\nstatic inline Mat slice(const Mat &m, const _Range &r0)\n{\n    Range ranges[CV_MAX_DIM];\n    for (int i = 1; i < m.dims; i++)\n        ranges[i] = Range::all();\n    ranges[0] = r0;\n    return m(&ranges[0]);\n}\n\nstatic inline Mat slice(const Mat &m, const _Range &r0, const _Range &r1)\n{\n    CV_Assert(m.dims >= 2);\n    Range ranges[CV_MAX_DIM];\n    for (int i = 2; i < m.dims; i++)\n        ranges[i] = Range::all();\n    ranges[0] = r0;\n    ranges[1] = r1;\n    return m(&ranges[0]);\n}\n\nstatic inline Mat slice(const Mat &m, const _Range &r0, const _Range &r1, const _Range &r2)\n{\n    CV_Assert(m.dims >= 3);\n    Range ranges[CV_MAX_DIM];\n    for (int i = 3; i < m.dims; i++)\n        ranges[i] = Range::all();\n    ranges[0] = r0;\n    ranges[1] = r1;\n    ranges[2] = r2;\n    return m(&ranges[0]);\n}\n\nstatic inline Mat slice(const Mat &m, const _Range &r0, const _Range &r1, const _Range &r2, const _Range &r3)\n{\n    CV_Assert(m.dims >= 4);\n    Range ranges[CV_MAX_DIM];\n    for (int i = 4; i < m.dims; i++)\n        ranges[i] = Range::all();\n    ranges[0] = r0;\n    ranges[1] = r1;\n    ranges[2] = r2;\n    ranges[3] = r3;\n    return m(&ranges[0]);\n}\n\nstatic inline Mat getPlane(const Mat &m, int n, int cn)\n{\n    CV_Assert(m.dims > 2);\n    int sz[CV_MAX_DIM];\n    for(int i = 2; i < m.dims; i++)\n    {\n        sz[i-2] = m.size.p[i];\n    }\n    return Mat(m.dims - 2, sz, m.type(), (void*)m.ptr<float>(n, cn));\n}\n\nstatic inline MatShape shape(const int* dims, const int n)\n{\n    MatShape shape;\n    shape.assign(dims, dims + n);\n    return shape;\n}\n\nstatic inline MatShape shape(const Mat& mat)\n{\n    return shape(mat.size.p, mat.dims);\n}\n\nstatic inline MatShape shape(const MatSize& sz)\n{\n    return shape(sz.p, sz.dims());\n}\n\nstatic inline MatShape shape(const UMat& mat)\n{\n    return shape(mat.size.p, mat.dims);\n}\n\n#if 0  // issues with MatExpr wrapped into InputArray\nstatic inline\nMatShape shape(InputArray input)\n{\n    int sz[CV_MAX_DIM];\n    int ndims = input.sizend(sz);\n    return shape(sz, ndims);\n}\n#endif\n\nnamespace {inline bool is_neg(int i) { return i < 0; }}\n\nstatic inline MatShape shape(int a0, int a1=-1, int a2=-1, int a3=-1)\n{\n    int dims[] = {a0, a1, a2, a3};\n    MatShape s = shape(dims, 4);\n    s.erase(std::remove_if(s.begin(), s.end(), is_neg), s.end());\n    return s;\n}\n\nstatic inline int total(const MatShape& shape, int start = -1, int end = -1)\n{\n    if (start == -1) start = 0;\n    if (end == -1) end = (int)shape.size();\n\n    if (shape.empty())\n        return 0;\n\n    int elems = 1;\n    CV_Assert(start <= (int)shape.size() && end <= (int)shape.size() &&\n              start <= end);\n    for(int i = start; i < end; i++)\n    {\n        elems *= shape[i];\n    }\n    return elems;\n}\n\nstatic inline MatShape concat(const MatShape& a, const MatShape& b)\n{\n    MatShape c = a;\n    c.insert(c.end(), b.begin(), b.end());\n\n    return c;\n}\n\nstatic inline std::string toString(const MatShape& shape, const String& name = \"\")\n{\n    std::ostringstream ss;\n    if (!name.empty())\n        ss << name << ' ';\n    ss << '[';\n    for(size_t i = 0, n = shape.size(); i < n; ++i)\n        ss << ' ' << shape[i];\n    ss << \" ]\";\n    return ss.str();\n}\nstatic inline void print(const MatShape& shape, const String& name = \"\")\n{\n    std::cout << toString(shape, name) << std::endl;\n}\nstatic inline std::ostream& operator<<(std::ostream &out, const MatShape& shape)\n{\n    out << toString(shape);\n    return out;\n}\n\n/// @brief Converts axis from `[-dims; dims)` (similar to Python's slice notation) to `[0; dims)` range.\nstatic inline\nint normalize_axis(int axis, int dims)\n{\n    CV_Check(axis, axis >= -dims && axis < dims, \"\");\n    axis = (axis < 0) ? (dims + axis) : axis;\n    CV_DbgCheck(axis, axis >= 0 && axis < dims, \"\");\n    return axis;\n}\n\nstatic inline\nint normalize_axis(int axis, const MatShape& shape)\n{\n    return normalize_axis(axis, (int)shape.size());\n}\n\nstatic inline\nRange normalize_axis_range(const Range& r, int axisSize)\n{\n    if (r == Range::all())\n        return Range(0, axisSize);\n    CV_CheckGE(r.start, 0, \"\");\n    Range clamped(r.start,\n                  r.end > 0 ? std::min(r.end, axisSize) : axisSize + r.end + 1);\n    CV_DbgCheckGE(clamped.start, 0, \"\");\n    CV_CheckLT(clamped.start, clamped.end, \"\");\n    CV_CheckLE(clamped.end, axisSize, \"\");\n    return clamped;\n}\n\nstatic inline\nbool isAllOnes(const MatShape &inputShape, int startPos, int endPos)\n{\n    CV_Assert(!inputShape.empty());\n\n    CV_CheckGE((int) inputShape.size(), startPos, \"\");\n    CV_CheckGE(startPos, 0, \"\");\n    CV_CheckLE(startPos, endPos, \"\");\n    CV_CheckLE((size_t)endPos, inputShape.size(), \"\");\n\n    for (size_t i = startPos; i < endPos; i++)\n    {\n        if (inputShape[i] != 1)\n            return false;\n    }\n    return true;\n}\n\nCV__DNN_INLINE_NS_END\n}\n}\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn/utils/inference_engine.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2019, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n\n#ifndef OPENCV_DNN_UTILS_INF_ENGINE_HPP\n#define OPENCV_DNN_UTILS_INF_ENGINE_HPP\n\n#include \"../dnn.hpp\"\n\nnamespace cv { namespace dnn {\nCV__DNN_INLINE_NS_BEGIN\n\n\n/* Values for 'OPENCV_DNN_BACKEND_INFERENCE_ENGINE_TYPE' parameter */\n#define CV_DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_API     \"NN_BUILDER\"\n#define CV_DNN_BACKEND_INFERENCE_ENGINE_NGRAPH             \"NGRAPH\"\n\n/** @brief Returns Inference Engine internal backend API.\n *\n * See values of `CV_DNN_BACKEND_INFERENCE_ENGINE_*` macros.\n *\n * Default value is controlled through `OPENCV_DNN_BACKEND_INFERENCE_ENGINE_TYPE` runtime parameter (environment variable).\n */\nCV_EXPORTS_W cv::String getInferenceEngineBackendType();\n\n/** @brief Specify Inference Engine internal backend API.\n *\n * See values of `CV_DNN_BACKEND_INFERENCE_ENGINE_*` macros.\n *\n * @returns previous value of internal backend API\n */\nCV_EXPORTS_W cv::String setInferenceEngineBackendType(const cv::String& newBackendType);\n\n\n/** @brief Release a Myriad device (binded by OpenCV).\n *\n * Single Myriad device cannot be shared across multiple processes which uses\n * Inference Engine's Myriad plugin.\n */\nCV_EXPORTS_W void resetMyriadDevice();\n\n\n/* Values for 'OPENCV_DNN_IE_VPU_TYPE' parameter */\n#define CV_DNN_INFERENCE_ENGINE_VPU_TYPE_UNSPECIFIED \"\"\n/// Intel(R) Movidius(TM) Neural Compute Stick, NCS (USB 03e7:2150), Myriad2 (https://software.intel.com/en-us/movidius-ncs)\n#define CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_2 \"Myriad2\"\n/// Intel(R) Neural Compute Stick 2, NCS2 (USB 03e7:2485), MyriadX (https://software.intel.com/ru-ru/neural-compute-stick)\n#define CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X \"MyriadX\"\n#define CV_DNN_INFERENCE_ENGINE_CPU_TYPE_ARM_COMPUTE \"ARM_COMPUTE\"\n#define CV_DNN_INFERENCE_ENGINE_CPU_TYPE_X86         \"X86\"\n\n\n/** @brief Returns Inference Engine VPU type.\n *\n * See values of `CV_DNN_INFERENCE_ENGINE_VPU_TYPE_*` macros.\n */\nCV_EXPORTS_W cv::String getInferenceEngineVPUType();\n\n/** @brief Returns Inference Engine CPU type.\n *\n * Specify OpenVINO plugin: CPU or ARM.\n */\nCV_EXPORTS_W cv::String getInferenceEngineCPUType();\n\n/** @brief Release a HDDL plugin.\n */\nCV_EXPORTS_W void releaseHDDLPlugin();\n\n\nCV__DNN_INLINE_NS_END\n}} // namespace\n\n#endif // OPENCV_DNN_UTILS_INF_ENGINE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn/version.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_DNN_VERSION_HPP\n#define OPENCV_DNN_VERSION_HPP\n\n/// Use with major OpenCV version only.\n#define OPENCV_DNN_API_VERSION 20210608\n\n#if !defined CV_DOXYGEN && !defined CV_STATIC_ANALYSIS && !defined CV_DNN_DONT_ADD_INLINE_NS\n#define CV__DNN_INLINE_NS __CV_CAT(dnn4_v, OPENCV_DNN_API_VERSION)\n#define CV__DNN_INLINE_NS_BEGIN namespace CV__DNN_INLINE_NS {\n#define CV__DNN_INLINE_NS_END }\nnamespace cv { namespace dnn { namespace CV__DNN_INLINE_NS { } using namespace CV__DNN_INLINE_NS; }}\n#else\n#define CV__DNN_INLINE_NS_BEGIN\n#define CV__DNN_INLINE_NS_END\n#endif\n\n#endif  // OPENCV_DNN_VERSION_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/dnn.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_DNN_HPP\n#define OPENCV_DNN_HPP\n\n// This is an umbrella header to include into you project.\n// We are free to change headers layout in dnn subfolder, so please include\n// this header for future compatibility\n\n\n/** @defgroup dnn Deep Neural Network module\n  @{\n    This module contains:\n        - API for new layers creation, layers are building bricks of neural networks;\n        - set of built-in most-useful Layers;\n        - API to construct and modify comprehensive neural networks from layers;\n        - functionality for loading serialized networks models from different frameworks.\n\n    Functionality of this module is designed only for forward pass computations (i.e. network testing).\n    A network training is in principle not supported.\n  @}\n*/\n/** @example samples/dnn/classification.cpp\nCheck @ref tutorial_dnn_googlenet \"the corresponding tutorial\" for more details\n*/\n/** @example samples/dnn/colorization.cpp\n*/\n/** @example samples/dnn/object_detection.cpp\nCheck @ref tutorial_dnn_yolo \"the corresponding tutorial\" for more details\n*/\n/** @example samples/dnn/openpose.cpp\n*/\n/** @example samples/dnn/segmentation.cpp\n*/\n/** @example samples/dnn/text_detection.cpp\n*/\n#include <opencv2/dnn/dnn.hpp>\n\n#endif /* OPENCV_DNN_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/features2d/features2d.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/features2d.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/features2d/hal/interface.h",
    "content": "#ifndef OPENCV_FEATURE2D_HAL_INTERFACE_H\n#define OPENCV_FEATURE2D_HAL_INTERFACE_H\n\n#include \"opencv2/core/cvdef.h\"\n//! @addtogroup features2d_hal_interface\n//! @{\n\n//! @name Fast feature detector types\n//! @sa cv::FastFeatureDetector\n//! @{\n#define CV_HAL_TYPE_5_8  0\n#define CV_HAL_TYPE_7_12 1\n#define CV_HAL_TYPE_9_16 2\n//! @}\n\n//! @name Key point\n//! @sa cv::KeyPoint\n//! @{\nstruct CV_EXPORTS cvhalKeyPoint\n{\n    float x;\n    float y;\n    float size;\n    float angle;\n    float response;\n    int octave;\n    int class_id;\n};\n//! @}\n\n//! @}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/features2d.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_FEATURES_2D_HPP\n#define OPENCV_FEATURES_2D_HPP\n\n#include \"opencv2/opencv_modules.hpp\"\n#include \"opencv2/core.hpp\"\n\n#ifdef HAVE_OPENCV_FLANN\n#include \"opencv2/flann/miniflann.hpp\"\n#endif\n\n/**\n  @defgroup features2d 2D Features Framework\n  @{\n    @defgroup features2d_main Feature Detection and Description\n    @defgroup features2d_match Descriptor Matchers\n\nMatchers of keypoint descriptors in OpenCV have wrappers with a common interface that enables you to\neasily switch between different algorithms solving the same problem. This section is devoted to\nmatching descriptors that are represented as vectors in a multidimensional space. All objects that\nimplement vector descriptor matchers inherit the DescriptorMatcher interface.\n\n    @defgroup features2d_draw Drawing Function of Keypoints and Matches\n    @defgroup features2d_category Object Categorization\n\nThis section describes approaches based on local 2D features and used to categorize objects.\n\n    @defgroup feature2d_hal Hardware Acceleration Layer\n    @{\n        @defgroup features2d_hal_interface Interface\n    @}\n  @}\n */\n\nnamespace cv\n{\n\n//! @addtogroup features2d_main\n//! @{\n\n// //! writes vector of keypoints to the file storage\n// CV_EXPORTS void write(FileStorage& fs, const String& name, const std::vector<KeyPoint>& keypoints);\n// //! reads vector of keypoints from the specified file storage node\n// CV_EXPORTS void read(const FileNode& node, CV_OUT std::vector<KeyPoint>& keypoints);\n\n/** @brief A class filters a vector of keypoints.\n\n Because now it is difficult to provide a convenient interface for all usage scenarios of the\n keypoints filter class, it has only several needed by now static methods.\n */\nclass CV_EXPORTS KeyPointsFilter\n{\npublic:\n    KeyPointsFilter(){}\n\n    /*\n     * Remove keypoints within borderPixels of an image edge.\n     */\n    static void runByImageBorder( std::vector<KeyPoint>& keypoints, Size imageSize, int borderSize );\n    /*\n     * Remove keypoints of sizes out of range.\n     */\n    static void runByKeypointSize( std::vector<KeyPoint>& keypoints, float minSize,\n                                   float maxSize=FLT_MAX );\n    /*\n     * Remove keypoints from some image by mask for pixels of this image.\n     */\n    static void runByPixelsMask( std::vector<KeyPoint>& keypoints, const Mat& mask );\n    /*\n     * Remove duplicated keypoints.\n     */\n    static void removeDuplicated( std::vector<KeyPoint>& keypoints );\n    /*\n     * Remove duplicated keypoints and sort the remaining keypoints\n     */\n    static void removeDuplicatedSorted( std::vector<KeyPoint>& keypoints );\n\n    /*\n     * Retain the specified number of the best keypoints (according to the response)\n     */\n    static void retainBest( std::vector<KeyPoint>& keypoints, int npoints );\n};\n\n\n/************************************ Base Classes ************************************/\n\n/** @brief Abstract base class for 2D image feature detectors and descriptor extractors\n*/\n#ifdef __EMSCRIPTEN__\nclass CV_EXPORTS_W Feature2D : public Algorithm\n#else\nclass CV_EXPORTS_W Feature2D : public virtual Algorithm\n#endif\n{\npublic:\n    virtual ~Feature2D();\n\n    /** @brief Detects keypoints in an image (first variant) or image set (second variant).\n\n    @param image Image.\n    @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set\n    of keypoints detected in images[i] .\n    @param mask Mask specifying where to look for keypoints (optional). It must be a 8-bit integer\n    matrix with non-zero values in the region of interest.\n     */\n    CV_WRAP virtual void detect( InputArray image,\n                                 CV_OUT std::vector<KeyPoint>& keypoints,\n                                 InputArray mask=noArray() );\n\n    /** @overload\n    @param images Image set.\n    @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set\n    of keypoints detected in images[i] .\n    @param masks Masks for each input image specifying where to look for keypoints (optional).\n    masks[i] is a mask for images[i].\n    */\n    CV_WRAP virtual void detect( InputArrayOfArrays images,\n                         CV_OUT std::vector<std::vector<KeyPoint> >& keypoints,\n                         InputArrayOfArrays masks=noArray() );\n\n    /** @brief Computes the descriptors for a set of keypoints detected in an image (first variant) or image set\n    (second variant).\n\n    @param image Image.\n    @param keypoints Input collection of keypoints. Keypoints for which a descriptor cannot be\n    computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint\n    with several dominant orientations (for each orientation).\n    @param descriptors Computed descriptors. In the second variant of the method descriptors[i] are\n    descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the\n    descriptor for keypoint j-th keypoint.\n     */\n    CV_WRAP virtual void compute( InputArray image,\n                                  CV_OUT CV_IN_OUT std::vector<KeyPoint>& keypoints,\n                                  OutputArray descriptors );\n\n    /** @overload\n\n    @param images Image set.\n    @param keypoints Input collection of keypoints. Keypoints for which a descriptor cannot be\n    computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint\n    with several dominant orientations (for each orientation).\n    @param descriptors Computed descriptors. In the second variant of the method descriptors[i] are\n    descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the\n    descriptor for keypoint j-th keypoint.\n    */\n    CV_WRAP virtual void compute( InputArrayOfArrays images,\n                          CV_OUT CV_IN_OUT std::vector<std::vector<KeyPoint> >& keypoints,\n                          OutputArrayOfArrays descriptors );\n\n    /** Detects keypoints and computes the descriptors */\n    CV_WRAP virtual void detectAndCompute( InputArray image, InputArray mask,\n                                           CV_OUT std::vector<KeyPoint>& keypoints,\n                                           OutputArray descriptors,\n                                           bool useProvidedKeypoints=false );\n\n    CV_WRAP virtual int descriptorSize() const;\n    CV_WRAP virtual int descriptorType() const;\n    CV_WRAP virtual int defaultNorm() const;\n\n    CV_WRAP void write( const String& fileName ) const;\n\n    CV_WRAP void read( const String& fileName );\n\n    virtual void write( FileStorage&) const CV_OVERRIDE;\n\n    // see corresponding cv::Algorithm method\n    CV_WRAP virtual void read( const FileNode&) CV_OVERRIDE;\n\n    //! Return true if detector object is empty\n    CV_WRAP virtual bool empty() const CV_OVERRIDE;\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n\n    // see corresponding cv::Algorithm method\n    CV_WRAP inline void write(const Ptr<FileStorage>& fs, const String& name = String()) const { Algorithm::write(fs, name); }\n};\n\n/** Feature detectors in OpenCV have wrappers with a common interface that enables you to easily switch\nbetween different algorithms solving the same problem. All objects that implement keypoint detectors\ninherit the FeatureDetector interface. */\ntypedef Feature2D FeatureDetector;\n\n/** Extractors of keypoint descriptors in OpenCV have wrappers with a common interface that enables you\nto easily switch between different algorithms solving the same problem. This section is devoted to\ncomputing descriptors represented as vectors in a multidimensional space. All objects that implement\nthe vector descriptor extractors inherit the DescriptorExtractor interface.\n */\ntypedef Feature2D DescriptorExtractor;\n\n\n/** @brief Class for implementing the wrapper which makes detectors and extractors to be affine invariant,\ndescribed as ASIFT in @cite YM11 .\n*/\nclass CV_EXPORTS_W AffineFeature : public Feature2D\n{\npublic:\n    /**\n    @param backend The detector/extractor you want to use as backend.\n    @param maxTilt The highest power index of tilt factor. 5 is used in the paper as tilt sampling range n.\n    @param minTilt The lowest power index of tilt factor. 0 is used in the paper.\n    @param tiltStep Tilt sampling step \\f$\\delta_t\\f$ in Algorithm 1 in the paper.\n    @param rotateStepBase Rotation sampling step factor b in Algorithm 1 in the paper.\n    */\n    CV_WRAP static Ptr<AffineFeature> create(const Ptr<Feature2D>& backend,\n        int maxTilt = 5, int minTilt = 0, float tiltStep = 1.4142135623730951f, float rotateStepBase = 72);\n\n    CV_WRAP virtual void setViewParams(const std::vector<float>& tilts, const std::vector<float>& rolls) = 0;\n    CV_WRAP virtual void getViewParams(std::vector<float>& tilts, std::vector<float>& rolls) const = 0;\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\ntypedef AffineFeature AffineFeatureDetector;\ntypedef AffineFeature AffineDescriptorExtractor;\n\n\n/** @brief Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform\n(SIFT) algorithm by D. Lowe @cite Lowe04 .\n*/\nclass CV_EXPORTS_W SIFT : public Feature2D\n{\npublic:\n    /**\n    @param nfeatures The number of best features to retain. The features are ranked by their scores\n    (measured in SIFT algorithm as the local contrast)\n\n    @param nOctaveLayers The number of layers in each octave. 3 is the value used in D. Lowe paper. The\n    number of octaves is computed automatically from the image resolution.\n\n    @param contrastThreshold The contrast threshold used to filter out weak features in semi-uniform\n    (low-contrast) regions. The larger the threshold, the less features are produced by the detector.\n\n    @note The contrast threshold will be divided by nOctaveLayers when the filtering is applied. When\n    nOctaveLayers is set to default and if you want to use the value used in D. Lowe paper, 0.03, set\n    this argument to 0.09.\n\n    @param edgeThreshold The threshold used to filter out edge-like features. Note that the its meaning\n    is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are\n    filtered out (more features are retained).\n\n    @param sigma The sigma of the Gaussian applied to the input image at the octave \\#0. If your image\n    is captured with a weak camera with soft lenses, you might want to reduce the number.\n    */\n    CV_WRAP static Ptr<SIFT> create(int nfeatures = 0, int nOctaveLayers = 3,\n        double contrastThreshold = 0.04, double edgeThreshold = 10,\n        double sigma = 1.6);\n\n    /** @brief Create SIFT with specified descriptorType.\n    @param nfeatures The number of best features to retain. The features are ranked by their scores\n    (measured in SIFT algorithm as the local contrast)\n\n    @param nOctaveLayers The number of layers in each octave. 3 is the value used in D. Lowe paper. The\n    number of octaves is computed automatically from the image resolution.\n\n    @param contrastThreshold The contrast threshold used to filter out weak features in semi-uniform\n    (low-contrast) regions. The larger the threshold, the less features are produced by the detector.\n\n    @note The contrast threshold will be divided by nOctaveLayers when the filtering is applied. When\n    nOctaveLayers is set to default and if you want to use the value used in D. Lowe paper, 0.03, set\n    this argument to 0.09.\n\n    @param edgeThreshold The threshold used to filter out edge-like features. Note that the its meaning\n    is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are\n    filtered out (more features are retained).\n\n    @param sigma The sigma of the Gaussian applied to the input image at the octave \\#0. If your image\n    is captured with a weak camera with soft lenses, you might want to reduce the number.\n\n    @param descriptorType The type of descriptors. Only CV_32F and CV_8U are supported.\n    */\n    CV_WRAP static Ptr<SIFT> create(int nfeatures, int nOctaveLayers,\n        double contrastThreshold, double edgeThreshold,\n        double sigma, int descriptorType);\n\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\ntypedef SIFT SiftFeatureDetector;\ntypedef SIFT SiftDescriptorExtractor;\n\n\n/** @brief Class implementing the BRISK keypoint detector and descriptor extractor, described in @cite LCS11 .\n */\nclass CV_EXPORTS_W BRISK : public Feature2D\n{\npublic:\n    /** @brief The BRISK constructor\n\n    @param thresh AGAST detection threshold score.\n    @param octaves detection octaves. Use 0 to do single scale.\n    @param patternScale apply this scale to the pattern used for sampling the neighbourhood of a\n    keypoint.\n     */\n    CV_WRAP static Ptr<BRISK> create(int thresh=30, int octaves=3, float patternScale=1.0f);\n\n    /** @brief The BRISK constructor for a custom pattern\n\n    @param radiusList defines the radii (in pixels) where the samples around a keypoint are taken (for\n    keypoint scale 1).\n    @param numberList defines the number of sampling points on the sampling circle. Must be the same\n    size as radiusList..\n    @param dMax threshold for the short pairings used for descriptor formation (in pixels for keypoint\n    scale 1).\n    @param dMin threshold for the long pairings used for orientation determination (in pixels for\n    keypoint scale 1).\n    @param indexChange index remapping of the bits. */\n    CV_WRAP static Ptr<BRISK> create(const std::vector<float> &radiusList, const std::vector<int> &numberList,\n        float dMax=5.85f, float dMin=8.2f, const std::vector<int>& indexChange=std::vector<int>());\n\n    /** @brief The BRISK constructor for a custom pattern, detection threshold and octaves\n\n    @param thresh AGAST detection threshold score.\n    @param octaves detection octaves. Use 0 to do single scale.\n    @param radiusList defines the radii (in pixels) where the samples around a keypoint are taken (for\n    keypoint scale 1).\n    @param numberList defines the number of sampling points on the sampling circle. Must be the same\n    size as radiusList..\n    @param dMax threshold for the short pairings used for descriptor formation (in pixels for keypoint\n    scale 1).\n    @param dMin threshold for the long pairings used for orientation determination (in pixels for\n    keypoint scale 1).\n    @param indexChange index remapping of the bits. */\n    CV_WRAP static Ptr<BRISK> create(int thresh, int octaves, const std::vector<float> &radiusList,\n        const std::vector<int> &numberList, float dMax=5.85f, float dMin=8.2f,\n        const std::vector<int>& indexChange=std::vector<int>());\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n\n    /** @brief Set detection threshold.\n    @param threshold AGAST detection threshold score.\n    */\n    CV_WRAP virtual void setThreshold(int threshold) { CV_UNUSED(threshold); return; }\n    CV_WRAP virtual int getThreshold() const { return -1; }\n\n    /** @brief Set detection octaves.\n    @param octaves detection octaves. Use 0 to do single scale.\n    */\n    CV_WRAP virtual void setOctaves(int octaves) { CV_UNUSED(octaves); return; }\n    CV_WRAP virtual int getOctaves() const { return -1; }\n};\n\n/** @brief Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor\n\ndescribed in @cite RRKB11 . The algorithm uses FAST in pyramids to detect stable keypoints, selects\nthe strongest features using FAST or Harris response, finds their orientation using first-order\nmoments and computes the descriptors using BRIEF (where the coordinates of random point pairs (or\nk-tuples) are rotated according to the measured orientation).\n */\nclass CV_EXPORTS_W ORB : public Feature2D\n{\npublic:\n    enum ScoreType { HARRIS_SCORE=0, FAST_SCORE=1 };\n    static const int kBytes = 32;\n\n    /** @brief The ORB constructor\n\n    @param nfeatures The maximum number of features to retain.\n    @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical\n    pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor\n    will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor\n    will mean that to cover certain scale range you will need more pyramid levels and so the speed\n    will suffer.\n    @param nlevels The number of pyramid levels. The smallest level will have linear size equal to\n    input_image_linear_size/pow(scaleFactor, nlevels - firstLevel).\n    @param edgeThreshold This is size of the border where the features are not detected. It should\n    roughly match the patchSize parameter.\n    @param firstLevel The level of pyramid to put source image to. Previous layers are filled\n    with upscaled source image.\n    @param WTA_K The number of points that produce each element of the oriented BRIEF descriptor. The\n    default value 2 means the BRIEF where we take a random point pair and compare their brightnesses,\n    so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3\n    random points (of course, those point coordinates are random, but they are generated from the\n    pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel\n    rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such\n    output will occupy 2 bits, and therefore it will need a special variant of Hamming distance,\n    denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each\n    bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3).\n    @param scoreType The default HARRIS_SCORE means that Harris algorithm is used to rank features\n    (the score is written to KeyPoint::score and is used to retain best nfeatures features);\n    FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints,\n    but it is a little faster to compute.\n    @param patchSize size of the patch used by the oriented BRIEF descriptor. Of course, on smaller\n    pyramid layers the perceived image area covered by a feature will be larger.\n    @param fastThreshold the fast threshold\n     */\n    CV_WRAP static Ptr<ORB> create(int nfeatures=500, float scaleFactor=1.2f, int nlevels=8, int edgeThreshold=31,\n        int firstLevel=0, int WTA_K=2, ORB::ScoreType scoreType=ORB::HARRIS_SCORE, int patchSize=31, int fastThreshold=20);\n\n    CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0;\n    CV_WRAP virtual int getMaxFeatures() const = 0;\n\n    CV_WRAP virtual void setScaleFactor(double scaleFactor) = 0;\n    CV_WRAP virtual double getScaleFactor() const = 0;\n\n    CV_WRAP virtual void setNLevels(int nlevels) = 0;\n    CV_WRAP virtual int getNLevels() const = 0;\n\n    CV_WRAP virtual void setEdgeThreshold(int edgeThreshold) = 0;\n    CV_WRAP virtual int getEdgeThreshold() const = 0;\n\n    CV_WRAP virtual void setFirstLevel(int firstLevel) = 0;\n    CV_WRAP virtual int getFirstLevel() const = 0;\n\n    CV_WRAP virtual void setWTA_K(int wta_k) = 0;\n    CV_WRAP virtual int getWTA_K() const = 0;\n\n    CV_WRAP virtual void setScoreType(ORB::ScoreType scoreType) = 0;\n    CV_WRAP virtual ORB::ScoreType getScoreType() const = 0;\n\n    CV_WRAP virtual void setPatchSize(int patchSize) = 0;\n    CV_WRAP virtual int getPatchSize() const = 0;\n\n    CV_WRAP virtual void setFastThreshold(int fastThreshold) = 0;\n    CV_WRAP virtual int getFastThreshold() const = 0;\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\n/** @brief Maximally stable extremal region extractor\n\nThe class encapsulates all the parameters of the %MSER extraction algorithm (see [wiki\narticle](http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions)).\n\n- there are two different implementation of %MSER: one for grey image, one for color image\n\n- the grey image algorithm is taken from: @cite nister2008linear ;  the paper claims to be faster\nthan union-find method; it actually get 1.5~2m/s on my centrino L7200 1.2GHz laptop.\n\n- the color image algorithm is taken from: @cite forssen2007maximally ; it should be much slower\nthan grey image method ( 3~4 times )\n\n- (Python) A complete example showing the use of the %MSER detector can be found at samples/python/mser.py\n*/\nclass CV_EXPORTS_W MSER : public Feature2D\n{\npublic:\n    /** @brief Full constructor for %MSER detector\n\n    @param delta it compares \\f$(size_{i}-size_{i-delta})/size_{i-delta}\\f$\n    @param min_area prune the area which smaller than minArea\n    @param max_area prune the area which bigger than maxArea\n    @param max_variation prune the area have similar size to its children\n    @param min_diversity for color image, trace back to cut off mser with diversity less than min_diversity\n    @param max_evolution  for color image, the evolution steps\n    @param area_threshold for color image, the area threshold to cause re-initialize\n    @param min_margin for color image, ignore too small margin\n    @param edge_blur_size for color image, the aperture size for edge blur\n     */\n    CV_WRAP static Ptr<MSER> create( int delta=5, int min_area=60, int max_area=14400,\n          double max_variation=0.25, double min_diversity=.2,\n          int max_evolution=200, double area_threshold=1.01,\n          double min_margin=0.003, int edge_blur_size=5 );\n\n    /** @brief Detect %MSER regions\n\n    @param image input image (8UC1, 8UC3 or 8UC4, must be greater or equal than 3x3)\n    @param msers resulting list of point sets\n    @param bboxes resulting bounding boxes\n    */\n    CV_WRAP virtual void detectRegions( InputArray image,\n                                        CV_OUT std::vector<std::vector<Point> >& msers,\n                                        CV_OUT std::vector<Rect>& bboxes ) = 0;\n\n    CV_WRAP virtual void setDelta(int delta) = 0;\n    CV_WRAP virtual int getDelta() const = 0;\n\n    CV_WRAP virtual void setMinArea(int minArea) = 0;\n    CV_WRAP virtual int getMinArea() const = 0;\n\n    CV_WRAP virtual void setMaxArea(int maxArea) = 0;\n    CV_WRAP virtual int getMaxArea() const = 0;\n\n    CV_WRAP virtual void setPass2Only(bool f) = 0;\n    CV_WRAP virtual bool getPass2Only() const = 0;\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\n//! @} features2d_main\n\n//! @addtogroup features2d_main\n//! @{\n\n/** @brief Wrapping class for feature detection using the FAST method. :\n */\nclass CV_EXPORTS_W FastFeatureDetector : public Feature2D\n{\npublic:\n    enum DetectorType\n    {\n        TYPE_5_8 = 0, TYPE_7_12 = 1, TYPE_9_16 = 2\n    };\n    enum\n    {\n        THRESHOLD = 10000, NONMAX_SUPPRESSION=10001, FAST_N=10002\n    };\n\n\n    CV_WRAP static Ptr<FastFeatureDetector> create( int threshold=10,\n                                                    bool nonmaxSuppression=true,\n                                                    FastFeatureDetector::DetectorType type=FastFeatureDetector::TYPE_9_16 );\n\n    CV_WRAP virtual void setThreshold(int threshold) = 0;\n    CV_WRAP virtual int getThreshold() const = 0;\n\n    CV_WRAP virtual void setNonmaxSuppression(bool f) = 0;\n    CV_WRAP virtual bool getNonmaxSuppression() const = 0;\n\n    CV_WRAP virtual void setType(FastFeatureDetector::DetectorType type) = 0;\n    CV_WRAP virtual FastFeatureDetector::DetectorType getType() const = 0;\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\n/** @overload */\nCV_EXPORTS void FAST( InputArray image, CV_OUT std::vector<KeyPoint>& keypoints,\n                      int threshold, bool nonmaxSuppression=true );\n\n/** @brief Detects corners using the FAST algorithm\n\n@param image grayscale image where keypoints (corners) are detected.\n@param keypoints keypoints detected on the image.\n@param threshold threshold on difference between intensity of the central pixel and pixels of a\ncircle around this pixel.\n@param nonmaxSuppression if true, non-maximum suppression is applied to detected corners\n(keypoints).\n@param type one of the three neighborhoods as defined in the paper:\nFastFeatureDetector::TYPE_9_16, FastFeatureDetector::TYPE_7_12,\nFastFeatureDetector::TYPE_5_8\n\nDetects corners using the FAST algorithm by @cite Rosten06 .\n\n@note In Python API, types are given as cv.FAST_FEATURE_DETECTOR_TYPE_5_8,\ncv.FAST_FEATURE_DETECTOR_TYPE_7_12 and cv.FAST_FEATURE_DETECTOR_TYPE_9_16. For corner\ndetection, use cv.FAST.detect() method.\n */\nCV_EXPORTS void FAST( InputArray image, CV_OUT std::vector<KeyPoint>& keypoints,\n                      int threshold, bool nonmaxSuppression, FastFeatureDetector::DetectorType type );\n\n//! @} features2d_main\n\n//! @addtogroup features2d_main\n//! @{\n\n/** @brief Wrapping class for feature detection using the AGAST method. :\n */\nclass CV_EXPORTS_W AgastFeatureDetector : public Feature2D\n{\npublic:\n    enum DetectorType\n    {\n        AGAST_5_8 = 0, AGAST_7_12d = 1, AGAST_7_12s = 2, OAST_9_16 = 3,\n    };\n\n    enum\n    {\n        THRESHOLD = 10000, NONMAX_SUPPRESSION = 10001,\n    };\n\n    CV_WRAP static Ptr<AgastFeatureDetector> create( int threshold=10,\n                                                     bool nonmaxSuppression=true,\n                                                     AgastFeatureDetector::DetectorType type = AgastFeatureDetector::OAST_9_16);\n\n    CV_WRAP virtual void setThreshold(int threshold) = 0;\n    CV_WRAP virtual int getThreshold() const = 0;\n\n    CV_WRAP virtual void setNonmaxSuppression(bool f) = 0;\n    CV_WRAP virtual bool getNonmaxSuppression() const = 0;\n\n    CV_WRAP virtual void setType(AgastFeatureDetector::DetectorType type) = 0;\n    CV_WRAP virtual AgastFeatureDetector::DetectorType getType() const = 0;\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\n/** @overload */\nCV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector<KeyPoint>& keypoints,\n                      int threshold, bool nonmaxSuppression=true );\n\n/** @brief Detects corners using the AGAST algorithm\n\n@param image grayscale image where keypoints (corners) are detected.\n@param keypoints keypoints detected on the image.\n@param threshold threshold on difference between intensity of the central pixel and pixels of a\ncircle around this pixel.\n@param nonmaxSuppression if true, non-maximum suppression is applied to detected corners\n(keypoints).\n@param type one of the four neighborhoods as defined in the paper:\nAgastFeatureDetector::AGAST_5_8, AgastFeatureDetector::AGAST_7_12d,\nAgastFeatureDetector::AGAST_7_12s, AgastFeatureDetector::OAST_9_16\n\nFor non-Intel platforms, there is a tree optimised variant of AGAST with same numerical results.\nThe 32-bit binary tree tables were generated automatically from original code using perl script.\nThe perl script and examples of tree generation are placed in features2d/doc folder.\nDetects corners using the AGAST algorithm by @cite mair2010_agast .\n\n */\nCV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector<KeyPoint>& keypoints,\n                      int threshold, bool nonmaxSuppression, AgastFeatureDetector::DetectorType type );\n\n/** @brief Wrapping class for feature detection using the goodFeaturesToTrack function. :\n */\nclass CV_EXPORTS_W GFTTDetector : public Feature2D\n{\npublic:\n    CV_WRAP static Ptr<GFTTDetector> create( int maxCorners=1000, double qualityLevel=0.01, double minDistance=1,\n                                             int blockSize=3, bool useHarrisDetector=false, double k=0.04 );\n    CV_WRAP static Ptr<GFTTDetector> create( int maxCorners, double qualityLevel, double minDistance,\n                                             int blockSize, int gradiantSize, bool useHarrisDetector=false, double k=0.04 );\n    CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0;\n    CV_WRAP virtual int getMaxFeatures() const = 0;\n\n    CV_WRAP virtual void setQualityLevel(double qlevel) = 0;\n    CV_WRAP virtual double getQualityLevel() const = 0;\n\n    CV_WRAP virtual void setMinDistance(double minDistance) = 0;\n    CV_WRAP virtual double getMinDistance() const = 0;\n\n    CV_WRAP virtual void setBlockSize(int blockSize) = 0;\n    CV_WRAP virtual int getBlockSize() const = 0;\n\n    CV_WRAP virtual void setHarrisDetector(bool val) = 0;\n    CV_WRAP virtual bool getHarrisDetector() const = 0;\n\n    CV_WRAP virtual void setK(double k) = 0;\n    CV_WRAP virtual double getK() const = 0;\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\n/** @brief Class for extracting blobs from an image. :\n\nThe class implements a simple algorithm for extracting blobs from an image:\n\n1.  Convert the source image to binary images by applying thresholding with several thresholds from\n    minThreshold (inclusive) to maxThreshold (exclusive) with distance thresholdStep between\n    neighboring thresholds.\n2.  Extract connected components from every binary image by findContours and calculate their\n    centers.\n3.  Group centers from several binary images by their coordinates. Close centers form one group that\n    corresponds to one blob, which is controlled by the minDistBetweenBlobs parameter.\n4.  From the groups, estimate final centers of blobs and their radiuses and return as locations and\n    sizes of keypoints.\n\nThis class performs several filtrations of returned blobs. You should set filterBy\\* to true/false\nto turn on/off corresponding filtration. Available filtrations:\n\n-   **By color**. This filter compares the intensity of a binary image at the center of a blob to\nblobColor. If they differ, the blob is filtered out. Use blobColor = 0 to extract dark blobs\nand blobColor = 255 to extract light blobs.\n-   **By area**. Extracted blobs have an area between minArea (inclusive) and maxArea (exclusive).\n-   **By circularity**. Extracted blobs have circularity\n(\\f$\\frac{4*\\pi*Area}{perimeter * perimeter}\\f$) between minCircularity (inclusive) and\nmaxCircularity (exclusive).\n-   **By ratio of the minimum inertia to maximum inertia**. Extracted blobs have this ratio\nbetween minInertiaRatio (inclusive) and maxInertiaRatio (exclusive).\n-   **By convexity**. Extracted blobs have convexity (area / area of blob convex hull) between\nminConvexity (inclusive) and maxConvexity (exclusive).\n\nDefault values of parameters are tuned to extract dark circular blobs.\n */\nclass CV_EXPORTS_W SimpleBlobDetector : public Feature2D\n{\npublic:\n  struct CV_EXPORTS_W_SIMPLE Params\n  {\n      CV_WRAP Params();\n      CV_PROP_RW float thresholdStep;\n      CV_PROP_RW float minThreshold;\n      CV_PROP_RW float maxThreshold;\n      CV_PROP_RW size_t minRepeatability;\n      CV_PROP_RW float minDistBetweenBlobs;\n\n      CV_PROP_RW bool filterByColor;\n      CV_PROP_RW uchar blobColor;\n\n      CV_PROP_RW bool filterByArea;\n      CV_PROP_RW float minArea, maxArea;\n\n      CV_PROP_RW bool filterByCircularity;\n      CV_PROP_RW float minCircularity, maxCircularity;\n\n      CV_PROP_RW bool filterByInertia;\n      CV_PROP_RW float minInertiaRatio, maxInertiaRatio;\n\n      CV_PROP_RW bool filterByConvexity;\n      CV_PROP_RW float minConvexity, maxConvexity;\n\n      void read( const FileNode& fn );\n      void write( FileStorage& fs ) const;\n  };\n\n  CV_WRAP static Ptr<SimpleBlobDetector>\n    create(const SimpleBlobDetector::Params &parameters = SimpleBlobDetector::Params());\n  CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\n//! @} features2d_main\n\n//! @addtogroup features2d_main\n//! @{\n\n/** @brief Class implementing the KAZE keypoint detector and descriptor extractor, described in @cite ABD12 .\n\n@note AKAZE descriptor can only be used with KAZE or AKAZE keypoints .. [ABD12] KAZE Features. Pablo\nF. Alcantarilla, Adrien Bartoli and Andrew J. Davison. In European Conference on Computer Vision\n(ECCV), Fiorenze, Italy, October 2012.\n*/\nclass CV_EXPORTS_W KAZE : public Feature2D\n{\npublic:\n    enum DiffusivityType\n    {\n        DIFF_PM_G1 = 0,\n        DIFF_PM_G2 = 1,\n        DIFF_WEICKERT = 2,\n        DIFF_CHARBONNIER = 3\n    };\n\n    /** @brief The KAZE constructor\n\n    @param extended Set to enable extraction of extended (128-byte) descriptor.\n    @param upright Set to enable use of upright descriptors (non rotation-invariant).\n    @param threshold Detector response threshold to accept point\n    @param nOctaves Maximum octave evolution of the image\n    @param nOctaveLayers Default number of sublevels per scale level\n    @param diffusivity Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or\n    DIFF_CHARBONNIER\n     */\n    CV_WRAP static Ptr<KAZE> create(bool extended=false, bool upright=false,\n                                    float threshold = 0.001f,\n                                    int nOctaves = 4, int nOctaveLayers = 4,\n                                    KAZE::DiffusivityType diffusivity = KAZE::DIFF_PM_G2);\n\n    CV_WRAP virtual void setExtended(bool extended) = 0;\n    CV_WRAP virtual bool getExtended() const = 0;\n\n    CV_WRAP virtual void setUpright(bool upright) = 0;\n    CV_WRAP virtual bool getUpright() const = 0;\n\n    CV_WRAP virtual void setThreshold(double threshold) = 0;\n    CV_WRAP virtual double getThreshold() const = 0;\n\n    CV_WRAP virtual void setNOctaves(int octaves) = 0;\n    CV_WRAP virtual int getNOctaves() const = 0;\n\n    CV_WRAP virtual void setNOctaveLayers(int octaveLayers) = 0;\n    CV_WRAP virtual int getNOctaveLayers() const = 0;\n\n    CV_WRAP virtual void setDiffusivity(KAZE::DiffusivityType diff) = 0;\n    CV_WRAP virtual KAZE::DiffusivityType getDiffusivity() const = 0;\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\n/** @brief Class implementing the AKAZE keypoint detector and descriptor extractor, described in @cite ANB13.\n\n@details AKAZE descriptors can only be used with KAZE or AKAZE keypoints. This class is thread-safe.\n\n@note When you need descriptors use Feature2D::detectAndCompute, which\nprovides better performance. When using Feature2D::detect followed by\nFeature2D::compute scale space pyramid is computed twice.\n\n@note AKAZE implements T-API. When image is passed as UMat some parts of the algorithm\nwill use OpenCL.\n\n@note [ANB13] Fast Explicit Diffusion for Accelerated Features in Nonlinear\nScale Spaces. Pablo F. Alcantarilla, Jesús Nuevo and Adrien Bartoli. In\nBritish Machine Vision Conference (BMVC), Bristol, UK, September 2013.\n\n*/\nclass CV_EXPORTS_W AKAZE : public Feature2D\n{\npublic:\n    // AKAZE descriptor type\n    enum DescriptorType\n    {\n        DESCRIPTOR_KAZE_UPRIGHT = 2, ///< Upright descriptors, not invariant to rotation\n        DESCRIPTOR_KAZE = 3,\n        DESCRIPTOR_MLDB_UPRIGHT = 4, ///< Upright descriptors, not invariant to rotation\n        DESCRIPTOR_MLDB = 5\n    };\n\n    /** @brief The AKAZE constructor\n\n    @param descriptor_type Type of the extracted descriptor: DESCRIPTOR_KAZE,\n    DESCRIPTOR_KAZE_UPRIGHT, DESCRIPTOR_MLDB or DESCRIPTOR_MLDB_UPRIGHT.\n    @param descriptor_size Size of the descriptor in bits. 0 -\\> Full size\n    @param descriptor_channels Number of channels in the descriptor (1, 2, 3)\n    @param threshold Detector response threshold to accept point\n    @param nOctaves Maximum octave evolution of the image\n    @param nOctaveLayers Default number of sublevels per scale level\n    @param diffusivity Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or\n    DIFF_CHARBONNIER\n     */\n    CV_WRAP static Ptr<AKAZE> create(AKAZE::DescriptorType descriptor_type = AKAZE::DESCRIPTOR_MLDB,\n                                     int descriptor_size = 0, int descriptor_channels = 3,\n                                     float threshold = 0.001f, int nOctaves = 4,\n                                     int nOctaveLayers = 4, KAZE::DiffusivityType diffusivity = KAZE::DIFF_PM_G2);\n\n    CV_WRAP virtual void setDescriptorType(AKAZE::DescriptorType dtype) = 0;\n    CV_WRAP virtual AKAZE::DescriptorType getDescriptorType() const = 0;\n\n    CV_WRAP virtual void setDescriptorSize(int dsize) = 0;\n    CV_WRAP virtual int getDescriptorSize() const = 0;\n\n    CV_WRAP virtual void setDescriptorChannels(int dch) = 0;\n    CV_WRAP virtual int getDescriptorChannels() const = 0;\n\n    CV_WRAP virtual void setThreshold(double threshold) = 0;\n    CV_WRAP virtual double getThreshold() const = 0;\n\n    CV_WRAP virtual void setNOctaves(int octaves) = 0;\n    CV_WRAP virtual int getNOctaves() const = 0;\n\n    CV_WRAP virtual void setNOctaveLayers(int octaveLayers) = 0;\n    CV_WRAP virtual int getNOctaveLayers() const = 0;\n\n    CV_WRAP virtual void setDiffusivity(KAZE::DiffusivityType diff) = 0;\n    CV_WRAP virtual KAZE::DiffusivityType getDiffusivity() const = 0;\n    CV_WRAP virtual String getDefaultName() const CV_OVERRIDE;\n};\n\n//! @} features2d_main\n\n/****************************************************************************************\\\n*                                      Distance                                          *\n\\****************************************************************************************/\n\ntemplate<typename T>\nstruct CV_EXPORTS Accumulator\n{\n    typedef T Type;\n};\n\ntemplate<> struct Accumulator<unsigned char>  { typedef float Type; };\ntemplate<> struct Accumulator<unsigned short> { typedef float Type; };\ntemplate<> struct Accumulator<char>   { typedef float Type; };\ntemplate<> struct Accumulator<short>  { typedef float Type; };\n\n/*\n * Squared Euclidean distance functor\n */\ntemplate<class T>\nstruct CV_EXPORTS SL2\n{\n    static const NormTypes normType = NORM_L2SQR;\n    typedef T ValueType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    ResultType operator()( const T* a, const T* b, int size ) const\n    {\n        return normL2Sqr<ValueType, ResultType>(a, b, size);\n    }\n};\n\n/*\n * Euclidean distance functor\n */\ntemplate<class T>\nstruct L2\n{\n    static const NormTypes normType = NORM_L2;\n    typedef T ValueType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    ResultType operator()( const T* a, const T* b, int size ) const\n    {\n        return (ResultType)std::sqrt((double)normL2Sqr<ValueType, ResultType>(a, b, size));\n    }\n};\n\n/*\n * Manhattan distance (city block distance) functor\n */\ntemplate<class T>\nstruct L1\n{\n    static const NormTypes normType = NORM_L1;\n    typedef T ValueType;\n    typedef typename Accumulator<T>::Type ResultType;\n\n    ResultType operator()( const T* a, const T* b, int size ) const\n    {\n        return normL1<ValueType, ResultType>(a, b, size);\n    }\n};\n\n/****************************************************************************************\\\n*                                  DescriptorMatcher                                     *\n\\****************************************************************************************/\n\n//! @addtogroup features2d_match\n//! @{\n\n/** @brief Abstract base class for matching keypoint descriptors.\n\nIt has two groups of match methods: for matching descriptors of an image with another image or with\nan image set.\n */\nclass CV_EXPORTS_W DescriptorMatcher : public Algorithm\n{\npublic:\n   enum MatcherType\n    {\n        FLANNBASED            = 1,\n        BRUTEFORCE            = 2,\n        BRUTEFORCE_L1         = 3,\n        BRUTEFORCE_HAMMING    = 4,\n        BRUTEFORCE_HAMMINGLUT = 5,\n        BRUTEFORCE_SL2        = 6\n    };\n\n    virtual ~DescriptorMatcher();\n\n    /** @brief Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor\n    collection.\n\n    If the collection is not empty, the new descriptors are added to existing train descriptors.\n\n    @param descriptors Descriptors to add. Each descriptors[i] is a set of descriptors from the same\n    train image.\n     */\n    CV_WRAP virtual void add( InputArrayOfArrays descriptors );\n\n    /** @brief Returns a constant link to the train descriptor collection trainDescCollection .\n     */\n    CV_WRAP const std::vector<Mat>& getTrainDescriptors() const;\n\n    /** @brief Clears the train descriptor collections.\n     */\n    CV_WRAP virtual void clear() CV_OVERRIDE;\n\n    /** @brief Returns true if there are no train descriptors in the both collections.\n     */\n    CV_WRAP virtual bool empty() const CV_OVERRIDE;\n\n    /** @brief Returns true if the descriptor matcher supports masking permissible matches.\n     */\n    CV_WRAP virtual bool isMaskSupported() const = 0;\n\n    /** @brief Trains a descriptor matcher\n\n    Trains a descriptor matcher (for example, the flann index). In all methods to match, the method\n    train() is run every time before matching. Some descriptor matchers (for example, BruteForceMatcher)\n    have an empty implementation of this method. Other matchers really train their inner structures (for\n    example, FlannBasedMatcher trains flann::Index ).\n     */\n    CV_WRAP virtual void train();\n\n    /** @brief Finds the best match for each descriptor from a query set.\n\n    @param queryDescriptors Query set of descriptors.\n    @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors\n    collection stored in the class object.\n    @param matches Matches. If a query descriptor is masked out in mask , no match is added for this\n    descriptor. So, matches size may be smaller than the query descriptors count.\n    @param mask Mask specifying permissible matches between an input query and train matrices of\n    descriptors.\n\n    In the first variant of this method, the train descriptors are passed as an input argument. In the\n    second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is\n    used. Optional mask (or masks) can be passed to specify which query and training descriptors can be\n    matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if\n    mask.at\\<uchar\\>(i,j) is non-zero.\n     */\n    CV_WRAP void match( InputArray queryDescriptors, InputArray trainDescriptors,\n                CV_OUT std::vector<DMatch>& matches, InputArray mask=noArray() ) const;\n\n    /** @brief Finds the k best matches for each descriptor from a query set.\n\n    @param queryDescriptors Query set of descriptors.\n    @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors\n    collection stored in the class object.\n    @param mask Mask specifying permissible matches between an input query and train matrices of\n    descriptors.\n    @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.\n    @param k Count of best matches found per each query descriptor or less if a query descriptor has\n    less than k possible matches in total.\n    @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is\n    false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,\n    the matches vector does not contain matches for fully masked-out query descriptors.\n\n    These extended variants of DescriptorMatcher::match methods find several best matches for each query\n    descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match\n    for the details about query and train descriptors.\n     */\n    CV_WRAP void knnMatch( InputArray queryDescriptors, InputArray trainDescriptors,\n                   CV_OUT std::vector<std::vector<DMatch> >& matches, int k,\n                   InputArray mask=noArray(), bool compactResult=false ) const;\n\n    /** @brief For each query descriptor, finds the training descriptors not farther than the specified distance.\n\n    @param queryDescriptors Query set of descriptors.\n    @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors\n    collection stored in the class object.\n    @param matches Found matches.\n    @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is\n    false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,\n    the matches vector does not contain matches for fully masked-out query descriptors.\n    @param maxDistance Threshold for the distance between matched descriptors. Distance means here\n    metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured\n    in Pixels)!\n    @param mask Mask specifying permissible matches between an input query and train matrices of\n    descriptors.\n\n    For each query descriptor, the methods find such training descriptors that the distance between the\n    query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are\n    returned in the distance increasing order.\n     */\n    CV_WRAP void radiusMatch( InputArray queryDescriptors, InputArray trainDescriptors,\n                      CV_OUT std::vector<std::vector<DMatch> >& matches, float maxDistance,\n                      InputArray mask=noArray(), bool compactResult=false ) const;\n\n    /** @overload\n    @param queryDescriptors Query set of descriptors.\n    @param matches Matches. If a query descriptor is masked out in mask , no match is added for this\n    descriptor. So, matches size may be smaller than the query descriptors count.\n    @param masks Set of masks. Each masks[i] specifies permissible matches between the input query\n    descriptors and stored train descriptors from the i-th image trainDescCollection[i].\n    */\n    CV_WRAP void match( InputArray queryDescriptors, CV_OUT std::vector<DMatch>& matches,\n                        InputArrayOfArrays masks=noArray() );\n    /** @overload\n    @param queryDescriptors Query set of descriptors.\n    @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.\n    @param k Count of best matches found per each query descriptor or less if a query descriptor has\n    less than k possible matches in total.\n    @param masks Set of masks. Each masks[i] specifies permissible matches between the input query\n    descriptors and stored train descriptors from the i-th image trainDescCollection[i].\n    @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is\n    false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,\n    the matches vector does not contain matches for fully masked-out query descriptors.\n    */\n    CV_WRAP void knnMatch( InputArray queryDescriptors, CV_OUT std::vector<std::vector<DMatch> >& matches, int k,\n                           InputArrayOfArrays masks=noArray(), bool compactResult=false );\n    /** @overload\n    @param queryDescriptors Query set of descriptors.\n    @param matches Found matches.\n    @param maxDistance Threshold for the distance between matched descriptors. Distance means here\n    metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured\n    in Pixels)!\n    @param masks Set of masks. Each masks[i] specifies permissible matches between the input query\n    descriptors and stored train descriptors from the i-th image trainDescCollection[i].\n    @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is\n    false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,\n    the matches vector does not contain matches for fully masked-out query descriptors.\n    */\n    CV_WRAP void radiusMatch( InputArray queryDescriptors, CV_OUT std::vector<std::vector<DMatch> >& matches, float maxDistance,\n                      InputArrayOfArrays masks=noArray(), bool compactResult=false );\n\n\n    CV_WRAP void write( const String& fileName ) const\n    {\n        FileStorage fs(fileName, FileStorage::WRITE);\n        write(fs);\n    }\n\n    CV_WRAP void read( const String& fileName )\n    {\n        FileStorage fs(fileName, FileStorage::READ);\n        read(fs.root());\n    }\n    // Reads matcher object from a file node\n    // see corresponding cv::Algorithm method\n    CV_WRAP virtual void read( const FileNode& ) CV_OVERRIDE;\n    // Writes matcher object to a file storage\n    virtual void write( FileStorage& ) const CV_OVERRIDE;\n\n    /** @brief Clones the matcher.\n\n    @param emptyTrainData If emptyTrainData is false, the method creates a deep copy of the object,\n    that is, copies both parameters and train data. If emptyTrainData is true, the method creates an\n    object copy with the current parameters but with empty train data.\n     */\n    CV_WRAP virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;\n\n    /** @brief Creates a descriptor matcher of a given type with the default parameters (using default\n    constructor).\n\n    @param descriptorMatcherType Descriptor matcher type. Now the following matcher types are\n    supported:\n    -   `BruteForce` (it uses L2 )\n    -   `BruteForce-L1`\n    -   `BruteForce-Hamming`\n    -   `BruteForce-Hamming(2)`\n    -   `FlannBased`\n     */\n    CV_WRAP static Ptr<DescriptorMatcher> create( const String& descriptorMatcherType );\n\n    CV_WRAP static Ptr<DescriptorMatcher> create( const DescriptorMatcher::MatcherType& matcherType );\n\n\n    // see corresponding cv::Algorithm method\n    CV_WRAP inline void write(const Ptr<FileStorage>& fs, const String& name = String()) const { Algorithm::write(fs, name); }\n\nprotected:\n    /**\n     * Class to work with descriptors from several images as with one merged matrix.\n     * It is used e.g. in FlannBasedMatcher.\n     */\n    class CV_EXPORTS DescriptorCollection\n    {\n    public:\n        DescriptorCollection();\n        DescriptorCollection( const DescriptorCollection& collection );\n        virtual ~DescriptorCollection();\n\n        // Vector of matrices \"descriptors\" will be merged to one matrix \"mergedDescriptors\" here.\n        void set( const std::vector<Mat>& descriptors );\n        virtual void clear();\n\n        const Mat& getDescriptors() const;\n        const Mat getDescriptor( int imgIdx, int localDescIdx ) const;\n        const Mat getDescriptor( int globalDescIdx ) const;\n        void getLocalIdx( int globalDescIdx, int& imgIdx, int& localDescIdx ) const;\n\n        int size() const;\n\n    protected:\n        Mat mergedDescriptors;\n        std::vector<int> startIdxs;\n    };\n\n    //! In fact the matching is implemented only by the following two methods. These methods suppose\n    //! that the class object has been trained already. Public match methods call these methods\n    //! after calling train().\n    virtual void knnMatchImpl( InputArray queryDescriptors, std::vector<std::vector<DMatch> >& matches, int k,\n        InputArrayOfArrays masks=noArray(), bool compactResult=false ) = 0;\n    virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector<std::vector<DMatch> >& matches, float maxDistance,\n        InputArrayOfArrays masks=noArray(), bool compactResult=false ) = 0;\n\n    static bool isPossibleMatch( InputArray mask, int queryIdx, int trainIdx );\n    static bool isMaskedOut( InputArrayOfArrays masks, int queryIdx );\n\n    static Mat clone_op( Mat m ) { return m.clone(); }\n    void checkMasks( InputArrayOfArrays masks, int queryDescriptorsCount ) const;\n\n    //! Collection of descriptors from train images.\n    std::vector<Mat> trainDescCollection;\n    std::vector<UMat> utrainDescCollection;\n};\n\n/** @brief Brute-force descriptor matcher.\n\nFor each descriptor in the first set, this matcher finds the closest descriptor in the second set\nby trying each one. This descriptor matcher supports masking permissible matches of descriptor\nsets.\n */\nclass CV_EXPORTS_W BFMatcher : public DescriptorMatcher\n{\npublic:\n    /** @brief Brute-force matcher constructor (obsolete). Please use BFMatcher.create()\n     *\n     *\n    */\n    CV_WRAP BFMatcher( int normType=NORM_L2, bool crossCheck=false );\n\n    virtual ~BFMatcher() {}\n\n    virtual bool isMaskSupported() const CV_OVERRIDE { return true; }\n\n    /** @brief Brute-force matcher create method.\n    @param normType One of NORM_L1, NORM_L2, NORM_HAMMING, NORM_HAMMING2. L1 and L2 norms are\n    preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and\n    BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor\n    description).\n    @param crossCheck If it is false, this is will be default BFMatcher behaviour when it finds the k\n    nearest neighbors for each query descriptor. If crossCheck==true, then the knnMatch() method with\n    k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the\n    matcher's collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent\n    pairs. Such technique usually produces best results with minimal number of outliers when there are\n    enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper.\n     */\n    CV_WRAP static Ptr<BFMatcher> create( int normType=NORM_L2, bool crossCheck=false ) ;\n\n    virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const CV_OVERRIDE;\nprotected:\n    virtual void knnMatchImpl( InputArray queryDescriptors, std::vector<std::vector<DMatch> >& matches, int k,\n        InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE;\n    virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector<std::vector<DMatch> >& matches, float maxDistance,\n        InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE;\n\n    int normType;\n    bool crossCheck;\n};\n\n#if defined(HAVE_OPENCV_FLANN) || defined(CV_DOXYGEN)\n\n/** @brief Flann-based descriptor matcher.\n\nThis matcher trains cv::flann::Index on a train descriptor collection and calls its nearest search\nmethods to find the best matches. So, this matcher may be faster when matching a large train\ncollection than the brute force matcher. FlannBasedMatcher does not support masking permissible\nmatches of descriptor sets because flann::Index does not support this. :\n */\nclass CV_EXPORTS_W FlannBasedMatcher : public DescriptorMatcher\n{\npublic:\n    CV_WRAP FlannBasedMatcher( const Ptr<flann::IndexParams>& indexParams=makePtr<flann::KDTreeIndexParams>(),\n                       const Ptr<flann::SearchParams>& searchParams=makePtr<flann::SearchParams>() );\n\n    virtual void add( InputArrayOfArrays descriptors ) CV_OVERRIDE;\n    virtual void clear() CV_OVERRIDE;\n\n    // Reads matcher object from a file node\n    virtual void read( const FileNode& ) CV_OVERRIDE;\n    // Writes matcher object to a file storage\n    virtual void write( FileStorage& ) const CV_OVERRIDE;\n\n    virtual void train() CV_OVERRIDE;\n    virtual bool isMaskSupported() const CV_OVERRIDE;\n\n    CV_WRAP static Ptr<FlannBasedMatcher> create();\n\n    virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const CV_OVERRIDE;\nprotected:\n    static void convertToDMatches( const DescriptorCollection& descriptors,\n                                   const Mat& indices, const Mat& distances,\n                                   std::vector<std::vector<DMatch> >& matches );\n\n    virtual void knnMatchImpl( InputArray queryDescriptors, std::vector<std::vector<DMatch> >& matches, int k,\n        InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE;\n    virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector<std::vector<DMatch> >& matches, float maxDistance,\n        InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE;\n\n    Ptr<flann::IndexParams> indexParams;\n    Ptr<flann::SearchParams> searchParams;\n    Ptr<flann::Index> flannIndex;\n\n    DescriptorCollection mergedDescriptors;\n    int addedDescCount;\n};\n\n#endif\n\n//! @} features2d_match\n\n/****************************************************************************************\\\n*                                   Drawing functions                                    *\n\\****************************************************************************************/\n\n//! @addtogroup features2d_draw\n//! @{\n\nenum struct DrawMatchesFlags\n{\n  DEFAULT = 0, //!< Output image matrix will be created (Mat::create),\n               //!< i.e. existing memory of output image may be reused.\n               //!< Two source image, matches and single keypoints will be drawn.\n               //!< For each keypoint only the center point will be drawn (without\n               //!< the circle around keypoint with keypoint size and orientation).\n  DRAW_OVER_OUTIMG = 1, //!< Output image matrix will not be created (Mat::create).\n                        //!< Matches will be drawn on existing content of output image.\n  NOT_DRAW_SINGLE_POINTS = 2, //!< Single keypoints will not be drawn.\n  DRAW_RICH_KEYPOINTS = 4 //!< For each keypoint the circle around keypoint with keypoint size and\n                          //!< orientation will be drawn.\n};\nCV_ENUM_FLAGS(DrawMatchesFlags)\n\n/** @brief Draws keypoints.\n\n@param image Source image.\n@param keypoints Keypoints from the source image.\n@param outImage Output image. Its content depends on the flags value defining what is drawn in the\noutput image. See possible flags bit values below.\n@param color Color of keypoints.\n@param flags Flags setting drawing features. Possible flags bit values are defined by\nDrawMatchesFlags. See details above in drawMatches .\n\n@note\nFor Python API, flags are modified as cv.DRAW_MATCHES_FLAGS_DEFAULT,\ncv.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS, cv.DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG,\ncv.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS\n */\nCV_EXPORTS_W void drawKeypoints( InputArray image, const std::vector<KeyPoint>& keypoints, InputOutputArray outImage,\n                               const Scalar& color=Scalar::all(-1), DrawMatchesFlags flags=DrawMatchesFlags::DEFAULT );\n\n/** @brief Draws the found matches of keypoints from two images.\n\n@param img1 First source image.\n@param keypoints1 Keypoints from the first source image.\n@param img2 Second source image.\n@param keypoints2 Keypoints from the second source image.\n@param matches1to2 Matches from the first image to the second one, which means that keypoints1[i]\nhas a corresponding point in keypoints2[matches[i]] .\n@param outImg Output image. Its content depends on the flags value defining what is drawn in the\noutput image. See possible flags bit values below.\n@param matchColor Color of matches (lines and connected keypoints). If matchColor==Scalar::all(-1)\n, the color is generated randomly.\n@param singlePointColor Color of single keypoints (circles), which means that keypoints do not\nhave the matches. If singlePointColor==Scalar::all(-1) , the color is generated randomly.\n@param matchesMask Mask determining which matches are drawn. If the mask is empty, all matches are\ndrawn.\n@param flags Flags setting drawing features. Possible flags bit values are defined by\nDrawMatchesFlags.\n\nThis function draws matches of keypoints from two images in the output image. Match is a line\nconnecting two keypoints (circles). See cv::DrawMatchesFlags.\n */\nCV_EXPORTS_W void drawMatches( InputArray img1, const std::vector<KeyPoint>& keypoints1,\n                             InputArray img2, const std::vector<KeyPoint>& keypoints2,\n                             const std::vector<DMatch>& matches1to2, InputOutputArray outImg,\n                             const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1),\n                             const std::vector<char>& matchesMask=std::vector<char>(), DrawMatchesFlags flags=DrawMatchesFlags::DEFAULT );\n\n/** @overload */\nCV_EXPORTS_W void drawMatches( InputArray img1, const std::vector<KeyPoint>& keypoints1,\n                             InputArray img2, const std::vector<KeyPoint>& keypoints2,\n                             const std::vector<DMatch>& matches1to2, InputOutputArray outImg,\n                             const int matchesThickness, const Scalar& matchColor=Scalar::all(-1),\n                             const Scalar& singlePointColor=Scalar::all(-1), const std::vector<char>& matchesMask=std::vector<char>(),\n                             DrawMatchesFlags flags=DrawMatchesFlags::DEFAULT );\n\nCV_EXPORTS_AS(drawMatchesKnn) void drawMatches( InputArray img1, const std::vector<KeyPoint>& keypoints1,\n                             InputArray img2, const std::vector<KeyPoint>& keypoints2,\n                             const std::vector<std::vector<DMatch> >& matches1to2, InputOutputArray outImg,\n                             const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1),\n                             const std::vector<std::vector<char> >& matchesMask=std::vector<std::vector<char> >(), DrawMatchesFlags flags=DrawMatchesFlags::DEFAULT );\n\n//! @} features2d_draw\n\n/****************************************************************************************\\\n*   Functions to evaluate the feature detectors and [generic] descriptor extractors      *\n\\****************************************************************************************/\n\nCV_EXPORTS void evaluateFeatureDetector( const Mat& img1, const Mat& img2, const Mat& H1to2,\n                                         std::vector<KeyPoint>* keypoints1, std::vector<KeyPoint>* keypoints2,\n                                         float& repeatability, int& correspCount,\n                                         const Ptr<FeatureDetector>& fdetector=Ptr<FeatureDetector>() );\n\nCV_EXPORTS void computeRecallPrecisionCurve( const std::vector<std::vector<DMatch> >& matches1to2,\n                                             const std::vector<std::vector<uchar> >& correctMatches1to2Mask,\n                                             std::vector<Point2f>& recallPrecisionCurve );\n\nCV_EXPORTS float getRecall( const std::vector<Point2f>& recallPrecisionCurve, float l_precision );\nCV_EXPORTS int getNearestPoint( const std::vector<Point2f>& recallPrecisionCurve, float l_precision );\n\n/****************************************************************************************\\\n*                                     Bag of visual words                                *\n\\****************************************************************************************/\n\n//! @addtogroup features2d_category\n//! @{\n\n/** @brief Abstract base class for training the *bag of visual words* vocabulary from a set of descriptors.\n\nFor details, see, for example, *Visual Categorization with Bags of Keypoints* by Gabriella Csurka,\nChristopher R. Dance, Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. :\n */\nclass CV_EXPORTS_W BOWTrainer\n{\npublic:\n    BOWTrainer();\n    virtual ~BOWTrainer();\n\n    /** @brief Adds descriptors to a training set.\n\n    @param descriptors Descriptors to add to a training set. Each row of the descriptors matrix is a\n    descriptor.\n\n    The training set is clustered using clustermethod to construct the vocabulary.\n     */\n    CV_WRAP void add( const Mat& descriptors );\n\n    /** @brief Returns a training set of descriptors.\n    */\n    CV_WRAP const std::vector<Mat>& getDescriptors() const;\n\n    /** @brief Returns the count of all descriptors stored in the training set.\n    */\n    CV_WRAP int descriptorsCount() const;\n\n    CV_WRAP virtual void clear();\n\n    /** @overload */\n    CV_WRAP virtual Mat cluster() const = 0;\n\n    /** @brief Clusters train descriptors.\n\n    @param descriptors Descriptors to cluster. Each row of the descriptors matrix is a descriptor.\n    Descriptors are not added to the inner train descriptor set.\n\n    The vocabulary consists of cluster centers. So, this method returns the vocabulary. In the first\n    variant of the method, train descriptors stored in the object are clustered. In the second variant,\n    input descriptors are clustered.\n     */\n    CV_WRAP virtual Mat cluster( const Mat& descriptors ) const = 0;\n\nprotected:\n    std::vector<Mat> descriptors;\n    int size;\n};\n\n/** @brief kmeans -based class to train visual vocabulary using the *bag of visual words* approach. :\n */\nclass CV_EXPORTS_W BOWKMeansTrainer : public BOWTrainer\n{\npublic:\n    /** @brief The constructor.\n\n    @see cv::kmeans\n    */\n    CV_WRAP BOWKMeansTrainer( int clusterCount, const TermCriteria& termcrit=TermCriteria(),\n                      int attempts=3, int flags=KMEANS_PP_CENTERS );\n    virtual ~BOWKMeansTrainer();\n\n    // Returns trained vocabulary (i.e. cluster centers).\n    CV_WRAP virtual Mat cluster() const CV_OVERRIDE;\n    CV_WRAP virtual Mat cluster( const Mat& descriptors ) const CV_OVERRIDE;\n\nprotected:\n\n    int clusterCount;\n    TermCriteria termcrit;\n    int attempts;\n    int flags;\n};\n\n/** @brief Class to compute an image descriptor using the *bag of visual words*.\n\nSuch a computation consists of the following steps:\n\n1.  Compute descriptors for a given image and its keypoints set.\n2.  Find the nearest visual words from the vocabulary for each keypoint descriptor.\n3.  Compute the bag-of-words image descriptor as is a normalized histogram of vocabulary words\nencountered in the image. The i-th bin of the histogram is a frequency of i-th word of the\nvocabulary in the given image.\n */\nclass CV_EXPORTS_W BOWImgDescriptorExtractor\n{\npublic:\n    /** @brief The constructor.\n\n    @param dextractor Descriptor extractor that is used to compute descriptors for an input image and\n    its keypoints.\n    @param dmatcher Descriptor matcher that is used to find the nearest word of the trained vocabulary\n    for each keypoint descriptor of the image.\n     */\n    CV_WRAP BOWImgDescriptorExtractor( const Ptr<DescriptorExtractor>& dextractor,\n                               const Ptr<DescriptorMatcher>& dmatcher );\n    /** @overload */\n    BOWImgDescriptorExtractor( const Ptr<DescriptorMatcher>& dmatcher );\n    virtual ~BOWImgDescriptorExtractor();\n\n    /** @brief Sets a visual vocabulary.\n\n    @param vocabulary Vocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the\n    vocabulary is a visual word (cluster center).\n     */\n    CV_WRAP void setVocabulary( const Mat& vocabulary );\n\n    /** @brief Returns the set vocabulary.\n    */\n    CV_WRAP const Mat& getVocabulary() const;\n\n    /** @brief Computes an image descriptor using the set visual vocabulary.\n\n    @param image Image, for which the descriptor is computed.\n    @param keypoints Keypoints detected in the input image.\n    @param imgDescriptor Computed output image descriptor.\n    @param pointIdxsOfClusters Indices of keypoints that belong to the cluster. This means that\n    pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary)\n    returned if it is non-zero.\n    @param descriptors Descriptors of the image keypoints that are returned if they are non-zero.\n     */\n    void compute( InputArray image, std::vector<KeyPoint>& keypoints, OutputArray imgDescriptor,\n                  std::vector<std::vector<int> >* pointIdxsOfClusters=0, Mat* descriptors=0 );\n    /** @overload\n    @param keypointDescriptors Computed descriptors to match with vocabulary.\n    @param imgDescriptor Computed output image descriptor.\n    @param pointIdxsOfClusters Indices of keypoints that belong to the cluster. This means that\n    pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary)\n    returned if it is non-zero.\n    */\n    void compute( InputArray keypointDescriptors, OutputArray imgDescriptor,\n                  std::vector<std::vector<int> >* pointIdxsOfClusters=0 );\n    // compute() is not constant because DescriptorMatcher::match is not constant\n\n    CV_WRAP_AS(compute) void compute2( const Mat& image, std::vector<KeyPoint>& keypoints, CV_OUT Mat& imgDescriptor )\n    { compute(image,keypoints,imgDescriptor); }\n\n    /** @brief Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0.\n    */\n    CV_WRAP int descriptorSize() const;\n\n    /** @brief Returns an image descriptor type.\n     */\n    CV_WRAP int descriptorType() const;\n\nprotected:\n    Mat vocabulary;\n    Ptr<DescriptorExtractor> dextractor;\n    Ptr<DescriptorMatcher> dmatcher;\n};\n\n//! @} features2d_category\n\n//! @} features2d\n\n} /* namespace cv */\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/all_indices.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_ALL_INDICES_H_\n#define OPENCV_FLANN_ALL_INDICES_H_\n\n//! @cond IGNORED\n\n#include \"general.h\"\n\n#include \"nn_index.h\"\n#include \"kdtree_index.h\"\n#include \"kdtree_single_index.h\"\n#include \"kmeans_index.h\"\n#include \"composite_index.h\"\n#include \"linear_index.h\"\n#include \"hierarchical_clustering_index.h\"\n#include \"lsh_index.h\"\n#include \"autotuned_index.h\"\n\n\nnamespace cvflann\n{\n\ntemplate<typename KDTreeCapability, typename VectorSpace, typename Distance>\nstruct index_creator\n{\n    static NNIndex<Distance>* create(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance)\n    {\n        flann_algorithm_t index_type = get_param<flann_algorithm_t>(params, \"algorithm\");\n\n        NNIndex<Distance>* nnIndex;\n        switch (index_type) {\n        case FLANN_INDEX_LINEAR:\n            nnIndex = new LinearIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_KDTREE_SINGLE:\n            nnIndex = new KDTreeSingleIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_KDTREE:\n            nnIndex = new KDTreeIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_KMEANS:\n            nnIndex = new KMeansIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_COMPOSITE:\n            nnIndex = new CompositeIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_AUTOTUNED:\n            nnIndex = new AutotunedIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_HIERARCHICAL:\n            nnIndex = new HierarchicalClusteringIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_LSH:\n            nnIndex = new LshIndex<Distance>(dataset, params, distance);\n            break;\n        default:\n            FLANN_THROW(cv::Error::StsBadArg, \"Unknown index type\");\n        }\n\n        return nnIndex;\n    }\n};\n\ntemplate<typename VectorSpace, typename Distance>\nstruct index_creator<False,VectorSpace,Distance>\n{\n    static NNIndex<Distance>* create(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance)\n    {\n        flann_algorithm_t index_type = get_param<flann_algorithm_t>(params, \"algorithm\");\n\n        NNIndex<Distance>* nnIndex;\n        switch (index_type) {\n        case FLANN_INDEX_LINEAR:\n            nnIndex = new LinearIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_KMEANS:\n            nnIndex = new KMeansIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_HIERARCHICAL:\n            nnIndex = new HierarchicalClusteringIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_LSH:\n            nnIndex = new LshIndex<Distance>(dataset, params, distance);\n            break;\n        default:\n            FLANN_THROW(cv::Error::StsBadArg, \"Unknown index type\");\n        }\n\n        return nnIndex;\n    }\n};\n\ntemplate<typename Distance>\nstruct index_creator<False,False,Distance>\n{\n    static NNIndex<Distance>* create(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance)\n    {\n        flann_algorithm_t index_type = get_param<flann_algorithm_t>(params, \"algorithm\");\n\n        NNIndex<Distance>* nnIndex;\n        switch (index_type) {\n        case FLANN_INDEX_LINEAR:\n            nnIndex = new LinearIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_KMEANS:\n            nnIndex = new KMeansIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_HIERARCHICAL:\n            nnIndex = new HierarchicalClusteringIndex<Distance>(dataset, params, distance);\n            break;\n        case FLANN_INDEX_LSH:\n            nnIndex = new LshIndex<Distance>(dataset, params, distance);\n            break;\n        default:\n            FLANN_THROW(cv::Error::StsBadArg, \"Unknown index type\");\n        }\n\n        return nnIndex;\n    }\n};\n\ntemplate<typename Distance>\nNNIndex<Distance>* create_index_by_type(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance)\n{\n    return index_creator<typename Distance::is_kdtree_distance,\n                         typename Distance::is_vector_space_distance,\n                         Distance>::create(dataset, params,distance);\n}\n\n}\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_ALL_INDICES_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/allocator.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_ALLOCATOR_H_\n#define OPENCV_FLANN_ALLOCATOR_H_\n\n//! @cond IGNORED\n\n#include <stdlib.h>\n#include <stdio.h>\n\n\nnamespace cvflann\n{\n\n/**\n * Allocates (using C's malloc) a generic type T.\n *\n * Params:\n *     count = number of instances to allocate.\n * Returns: pointer (of type T*) to memory buffer\n */\ntemplate <typename T>\nT* allocate(size_t count = 1)\n{\n    T* mem = (T*) ::malloc(sizeof(T)*count);\n    return mem;\n}\n\n\n/**\n * Pooled storage allocator\n *\n * The following routines allow for the efficient allocation of storage in\n * small chunks from a specified pool.  Rather than allowing each structure\n * to be freed individually, an entire pool of storage is freed at once.\n * This method has two advantages over just using malloc() and free().  First,\n * it is far more efficient for allocating small objects, as there is\n * no overhead for remembering all the information needed to free each\n * object or consolidating fragmented memory.  Second, the decision about\n * how long to keep an object is made at the time of allocation, and there\n * is no need to track down all the objects to free them.\n *\n */\n\nconst size_t     WORDSIZE=16;\nconst  size_t     BLOCKSIZE=8192;\n\nclass PooledAllocator\n{\n    /* We maintain memory alignment to word boundaries by requiring that all\n        allocations be in multiples of the machine wordsize.  */\n    /* Size of machine word in bytes.  Must be power of 2. */\n    /* Minimum number of bytes requested at a time from\tthe system.  Must be multiple of WORDSIZE. */\n\n\n    int     remaining;  /* Number of bytes left in current block of storage. */\n    void*   base;     /* Pointer to base of current block of storage. */\n    void*   loc;      /* Current location in block to next allocate memory. */\n    int     blocksize;\n\n\npublic:\n    int     usedMemory;\n    int     wastedMemory;\n\n    /**\n        Default constructor. Initializes a new pool.\n     */\n    PooledAllocator(int blockSize = BLOCKSIZE)\n    {\n        blocksize = blockSize;\n        remaining = 0;\n        base = NULL;\n        loc = NULL;\n\n        usedMemory = 0;\n        wastedMemory = 0;\n    }\n\n    /**\n     * Destructor. Frees all the memory allocated in this pool.\n     */\n    ~PooledAllocator()\n    {\n        void* prev;\n\n        while (base != NULL) {\n            prev = *((void**) base); /* Get pointer to prev block. */\n            ::free(base);\n            base = prev;\n        }\n    }\n\n    /**\n     * Returns a pointer to a piece of new memory of the given size in bytes\n     * allocated from the pool.\n     */\n    void* allocateMemory(int size)\n    {\n        int blockSize;\n\n        /* Round size up to a multiple of wordsize.  The following expression\n            only works for WORDSIZE that is a power of 2, by masking last bits of\n            incremented size to zero.\n         */\n        size = (size + (WORDSIZE - 1)) & ~(WORDSIZE - 1);\n\n        /* Check whether a new block must be allocated.  Note that the first word\n            of a block is reserved for a pointer to the previous block.\n         */\n        if (size > remaining) {\n\n            wastedMemory += remaining;\n\n            /* Allocate new storage. */\n            blockSize = (size + sizeof(void*) + (WORDSIZE-1) > BLOCKSIZE) ?\n                        size + sizeof(void*) + (WORDSIZE-1) : BLOCKSIZE;\n\n            // use the standard C malloc to allocate memory\n            void* m = ::malloc(blockSize);\n            if (!m) {\n                fprintf(stderr,\"Failed to allocate memory.\\n\");\n                return NULL;\n            }\n\n            /* Fill first word of new block with pointer to previous block. */\n            ((void**) m)[0] = base;\n            base = m;\n\n            int shift = 0;\n            //int shift = (WORDSIZE - ( (((size_t)m) + sizeof(void*)) & (WORDSIZE-1))) & (WORDSIZE-1);\n\n            remaining = blockSize - sizeof(void*) - shift;\n            loc = ((char*)m + sizeof(void*) + shift);\n        }\n        void* rloc = loc;\n        loc = (char*)loc + size;\n        remaining -= size;\n\n        usedMemory += size;\n\n        return rloc;\n    }\n\n    /**\n     * Allocates (using this pool) a generic type T.\n     *\n     * Params:\n     *     count = number of instances to allocate.\n     * Returns: pointer (of type T*) to memory buffer\n     */\n    template <typename T>\n    T* allocate(size_t count = 1)\n    {\n        T* mem = (T*) this->allocateMemory((int)(sizeof(T)*count));\n        return mem;\n    }\n\nprivate:\n    PooledAllocator(const PooledAllocator &); // copy disabled\n    PooledAllocator& operator=(const PooledAllocator &); // assign disabled\n};\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_ALLOCATOR_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/any.h",
    "content": "#ifndef OPENCV_FLANN_ANY_H_\n#define OPENCV_FLANN_ANY_H_\n/*\n * (C) Copyright Christopher Diggins 2005-2011\n * (C) Copyright Pablo Aguilar 2005\n * (C) Copyright Kevlin Henney 2001\n *\n * Distributed under the Boost Software License, Version 1.0. (See\n * accompanying file LICENSE_1_0.txt or copy at\n * http://www.boost.org/LICENSE_1_0.txt\n *\n * Adapted for FLANN by Marius Muja\n */\n\n//! @cond IGNORED\n\n#include \"defines.h\"\n#include <stdexcept>\n#include <ostream>\n#include <typeinfo>\n\nnamespace cvflann\n{\n\nnamespace anyimpl\n{\n\nstruct bad_any_cast\n{\n};\n\nstruct empty_any\n{\n};\n\ninline std::ostream& operator <<(std::ostream& out, const empty_any&)\n{\n    out << \"[empty_any]\";\n    return out;\n}\n\nstruct base_any_policy\n{\n    virtual void static_delete(void** x) = 0;\n    virtual void copy_from_value(void const* src, void** dest) = 0;\n    virtual void clone(void* const* src, void** dest) = 0;\n    virtual void move(void* const* src, void** dest) = 0;\n    virtual void* get_value(void** src) = 0;\n    virtual const void* get_value(void* const * src) = 0;\n    virtual ::size_t get_size() = 0;\n    virtual const std::type_info& type() = 0;\n    virtual void print(std::ostream& out, void* const* src) = 0;\n    virtual ~base_any_policy() {}\n};\n\ntemplate<typename T>\nstruct typed_base_any_policy : base_any_policy\n{\n    virtual ::size_t get_size() CV_OVERRIDE { return sizeof(T); }\n    virtual const std::type_info& type() CV_OVERRIDE { return typeid(T); }\n\n};\n\ntemplate<typename T>\nstruct small_any_policy CV_FINAL : typed_base_any_policy<T>\n{\n    virtual void static_delete(void**) CV_OVERRIDE { }\n    virtual void copy_from_value(void const* src, void** dest) CV_OVERRIDE\n    {\n        new (dest) T(* reinterpret_cast<T const*>(src));\n    }\n    virtual void clone(void* const* src, void** dest) CV_OVERRIDE { *dest = *src; }\n    virtual void move(void* const* src, void** dest) CV_OVERRIDE { *dest = *src; }\n    virtual void* get_value(void** src) CV_OVERRIDE { return reinterpret_cast<void*>(src); }\n    virtual const void* get_value(void* const * src) CV_OVERRIDE { return reinterpret_cast<const void*>(src); }\n    virtual void print(std::ostream& out, void* const* src) CV_OVERRIDE { out << *reinterpret_cast<T const*>(src); }\n};\n\ntemplate<typename T>\nstruct big_any_policy CV_FINAL : typed_base_any_policy<T>\n{\n    virtual void static_delete(void** x) CV_OVERRIDE\n    {\n        if (* x) delete (* reinterpret_cast<T**>(x));\n        *x = NULL;\n    }\n    virtual void copy_from_value(void const* src, void** dest) CV_OVERRIDE\n    {\n        *dest = new T(*reinterpret_cast<T const*>(src));\n    }\n    virtual void clone(void* const* src, void** dest) CV_OVERRIDE\n    {\n        *dest = new T(**reinterpret_cast<T* const*>(src));\n    }\n    virtual void move(void* const* src, void** dest) CV_OVERRIDE\n    {\n        (*reinterpret_cast<T**>(dest))->~T();\n        **reinterpret_cast<T**>(dest) = **reinterpret_cast<T* const*>(src);\n    }\n    virtual void* get_value(void** src) CV_OVERRIDE { return *src; }\n    virtual const void* get_value(void* const * src) CV_OVERRIDE { return *src; }\n    virtual void print(std::ostream& out, void* const* src) CV_OVERRIDE { out << *reinterpret_cast<T const*>(*src); }\n};\n\ntemplate<> inline void big_any_policy<flann_centers_init_t>::print(std::ostream& out, void* const* src)\n{\n    out << int(*reinterpret_cast<flann_centers_init_t const*>(*src));\n}\n\ntemplate<> inline void big_any_policy<flann_algorithm_t>::print(std::ostream& out, void* const* src)\n{\n    out << int(*reinterpret_cast<flann_algorithm_t const*>(*src));\n}\n\ntemplate<> inline void big_any_policy<cv::String>::print(std::ostream& out, void* const* src)\n{\n    out << (*reinterpret_cast<cv::String const*>(*src)).c_str();\n}\n\ntemplate<typename T>\nstruct choose_policy\n{\n    typedef big_any_policy<T> type;\n};\n\ntemplate<typename T>\nstruct choose_policy<T*>\n{\n    typedef small_any_policy<T*> type;\n};\n\nstruct any;\n\n/// Choosing the policy for an any type is illegal, but should never happen.\n/// This is designed to throw a compiler error.\ntemplate<>\nstruct choose_policy<any>\n{\n    typedef void type;\n};\n\n/// Specializations for small types.\n#define SMALL_POLICY(TYPE) \\\n    template<> \\\n    struct choose_policy<TYPE> { typedef small_any_policy<TYPE> type; \\\n    }\n\nSMALL_POLICY(signed char);\nSMALL_POLICY(unsigned char);\nSMALL_POLICY(signed short);\nSMALL_POLICY(unsigned short);\nSMALL_POLICY(signed int);\nSMALL_POLICY(unsigned int);\nSMALL_POLICY(signed long);\nSMALL_POLICY(unsigned long);\nSMALL_POLICY(float);\nSMALL_POLICY(bool);\n\n#undef SMALL_POLICY\n\ntemplate <typename T>\nclass SinglePolicy\n{\n    SinglePolicy();\n    SinglePolicy(const SinglePolicy& other);\n    SinglePolicy& operator=(const SinglePolicy& other);\n\npublic:\n    static base_any_policy* get_policy();\n};\n\n/// This function will return a different policy for each type.\ntemplate <typename T>\ninline base_any_policy* SinglePolicy<T>::get_policy()\n{\n    static typename choose_policy<T>::type policy;\n    return &policy;\n}\n\n} // namespace anyimpl\n\nstruct any\n{\nprivate:\n    // fields\n    anyimpl::base_any_policy* policy;\n    void* object;\n\npublic:\n    /// Initializing constructor.\n    template <typename T>\n    any(const T& x)\n        : policy(anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy()), object(NULL)\n    {\n        assign(x);\n    }\n\n    /// Empty constructor.\n    any()\n        : policy(anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy()), object(NULL)\n    { }\n\n    /// Special initializing constructor for string literals.\n    any(const char* x)\n        : policy(anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy()), object(NULL)\n    {\n        assign(x);\n    }\n\n    /// Copy constructor.\n    any(const any& x)\n        : policy(anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy()), object(NULL)\n    {\n        assign(x);\n    }\n\n    /// Destructor.\n    ~any()\n    {\n        policy->static_delete(&object);\n    }\n\n    /// Assignment function from another any.\n    any& assign(const any& x)\n    {\n        reset();\n        policy = x.policy;\n        policy->clone(&x.object, &object);\n        return *this;\n    }\n\n    /// Assignment function.\n    template <typename T>\n    any& assign(const T& x)\n    {\n        reset();\n        policy = anyimpl::SinglePolicy<T>::get_policy();\n        policy->copy_from_value(&x, &object);\n        return *this;\n    }\n\n    /// Assignment operator.\n    template<typename T>\n    any& operator=(const T& x)\n    {\n        return assign(x);\n    }\n\n    /// Assignment operator. Template-based version above doesn't work as expected. We need regular assignment operator here.\n    any& operator=(const any& x)\n    {\n        return assign(x);\n    }\n\n    /// Assignment operator, specialed for literal strings.\n    /// They have types like const char [6] which don't work as expected.\n    any& operator=(const char* x)\n    {\n        return assign(x);\n    }\n\n    /// Utility functions\n    any& swap(any& x)\n    {\n        std::swap(policy, x.policy);\n        std::swap(object, x.object);\n        return *this;\n    }\n\n    /// Cast operator. You can only cast to the original type.\n    template<typename T>\n    T& cast()\n    {\n        if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast();\n        T* r = reinterpret_cast<T*>(policy->get_value(&object));\n        return *r;\n    }\n\n    /// Cast operator. You can only cast to the original type.\n    template<typename T>\n    const T& cast() const\n    {\n        if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast();\n        const T* r = reinterpret_cast<const T*>(policy->get_value(&object));\n        return *r;\n    }\n\n    /// Returns true if the any contains no value.\n    bool empty() const\n    {\n        return policy->type() == typeid(anyimpl::empty_any);\n    }\n\n    /// Frees any allocated memory, and sets the value to NULL.\n    void reset()\n    {\n        policy->static_delete(&object);\n        policy = anyimpl::SinglePolicy<anyimpl::empty_any>::get_policy();\n    }\n\n    /// Returns true if the two types are the same.\n    bool compatible(const any& x) const\n    {\n        return policy->type() == x.policy->type();\n    }\n\n    /// Returns if the type is compatible with the policy\n    template<typename T>\n    bool has_type()\n    {\n        return policy->type() == typeid(T);\n    }\n\n    const std::type_info& type() const\n    {\n        return policy->type();\n    }\n\n    friend std::ostream& operator <<(std::ostream& out, const any& any_val);\n};\n\ninline std::ostream& operator <<(std::ostream& out, const any& any_val)\n{\n    any_val.policy->print(out,&any_val.object);\n    return out;\n}\n\n}\n\n//! @endcond\n\n#endif // OPENCV_FLANN_ANY_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/autotuned_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n#ifndef OPENCV_FLANN_AUTOTUNED_INDEX_H_\n#define OPENCV_FLANN_AUTOTUNED_INDEX_H_\n\n//! @cond IGNORED\n\n#include <sstream>\n\n#include \"nn_index.h\"\n#include \"ground_truth.h\"\n#include \"index_testing.h\"\n#include \"sampling.h\"\n#include \"kdtree_index.h\"\n#include \"kdtree_single_index.h\"\n#include \"kmeans_index.h\"\n#include \"composite_index.h\"\n#include \"linear_index.h\"\n#include \"logger.h\"\n\nnamespace cvflann\n{\n\ntemplate<typename Distance>\nNNIndex<Distance>* create_index_by_type(const Matrix<typename Distance::ElementType>& dataset, const IndexParams& params, const Distance& distance);\n\n\nstruct AutotunedIndexParams : public IndexParams\n{\n    AutotunedIndexParams(float target_precision = 0.8, float build_weight = 0.01, float memory_weight = 0, float sample_fraction = 0.1)\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_AUTOTUNED;\n        // precision desired (used for autotuning, -1 otherwise)\n        (*this)[\"target_precision\"] = target_precision;\n        // build tree time weighting factor\n        (*this)[\"build_weight\"] = build_weight;\n        // index memory weighting factor\n        (*this)[\"memory_weight\"] = memory_weight;\n        // what fraction of the dataset to use for autotuning\n        (*this)[\"sample_fraction\"] = sample_fraction;\n    }\n};\n\n\ntemplate <typename Distance>\nclass AutotunedIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n    AutotunedIndex(const Matrix<ElementType>& inputData, const IndexParams& params = AutotunedIndexParams(), Distance d = Distance()) :\n        dataset_(inputData), distance_(d)\n    {\n        target_precision_ = get_param(params, \"target_precision\",0.8f);\n        build_weight_ =  get_param(params,\"build_weight\", 0.01f);\n        memory_weight_ = get_param(params, \"memory_weight\", 0.0f);\n        sample_fraction_ = get_param(params,\"sample_fraction\", 0.1f);\n        bestIndex_ = NULL;\n        speedup_ = 0;\n    }\n\n    AutotunedIndex(const AutotunedIndex&);\n    AutotunedIndex& operator=(const AutotunedIndex&);\n\n    virtual ~AutotunedIndex()\n    {\n        if (bestIndex_ != NULL) {\n            delete bestIndex_;\n            bestIndex_ = NULL;\n        }\n    }\n\n    /**\n     *          Method responsible with building the index.\n     */\n    virtual void buildIndex() CV_OVERRIDE\n    {\n        std::ostringstream stream;\n        bestParams_ = estimateBuildParams();\n        print_params(bestParams_, stream);\n        Logger::info(\"----------------------------------------------------\\n\");\n        Logger::info(\"Autotuned parameters:\\n\");\n        Logger::info(\"%s\", stream.str().c_str());\n        Logger::info(\"----------------------------------------------------\\n\");\n\n        bestIndex_ = create_index_by_type(dataset_, bestParams_, distance_);\n        bestIndex_->buildIndex();\n        speedup_ = estimateSearchParams(bestSearchParams_);\n        stream.str(std::string());\n        print_params(bestSearchParams_, stream);\n        Logger::info(\"----------------------------------------------------\\n\");\n        Logger::info(\"Search parameters:\\n\");\n        Logger::info(\"%s\", stream.str().c_str());\n        Logger::info(\"----------------------------------------------------\\n\");\n    }\n\n    /**\n     *  Saves the index to a stream\n     */\n    virtual void saveIndex(FILE* stream) CV_OVERRIDE\n    {\n        save_value(stream, (int)bestIndex_->getType());\n        bestIndex_->saveIndex(stream);\n        save_value(stream, get_param<int>(bestSearchParams_, \"checks\"));\n    }\n\n    /**\n     *  Loads the index from a stream\n     */\n    virtual void loadIndex(FILE* stream) CV_OVERRIDE\n    {\n        int index_type;\n\n        load_value(stream, index_type);\n        IndexParams params;\n        params[\"algorithm\"] = (flann_algorithm_t)index_type;\n        bestIndex_ = create_index_by_type<Distance>(dataset_, params, distance_);\n        bestIndex_->loadIndex(stream);\n        int checks;\n        load_value(stream, checks);\n        bestSearchParams_[\"checks\"] = checks;\n    }\n\n    /**\n     *      Method that searches for nearest-neighbors\n     */\n    virtual void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE\n    {\n        int checks = get_param<int>(searchParams,\"checks\",FLANN_CHECKS_AUTOTUNED);\n        if (checks == FLANN_CHECKS_AUTOTUNED) {\n            bestIndex_->findNeighbors(result, vec, bestSearchParams_);\n        }\n        else {\n            bestIndex_->findNeighbors(result, vec, searchParams);\n        }\n    }\n\n\n    IndexParams getParameters() const CV_OVERRIDE\n    {\n        return bestIndex_->getParameters();\n    }\n\n    SearchParams getSearchParameters() const\n    {\n        return bestSearchParams_;\n    }\n\n    float getSpeedup() const\n    {\n        return speedup_;\n    }\n\n\n    /**\n     *      Number of features in this index.\n     */\n    virtual size_t size() const CV_OVERRIDE\n    {\n        return bestIndex_->size();\n    }\n\n    /**\n     *  The length of each vector in this index.\n     */\n    virtual size_t veclen() const CV_OVERRIDE\n    {\n        return bestIndex_->veclen();\n    }\n\n    /**\n     * The amount of memory (in bytes) this index uses.\n     */\n    virtual int usedMemory() const CV_OVERRIDE\n    {\n        return bestIndex_->usedMemory();\n    }\n\n    /**\n     * Algorithm name\n     */\n    virtual flann_algorithm_t getType() const CV_OVERRIDE\n    {\n        return FLANN_INDEX_AUTOTUNED;\n    }\n\nprivate:\n\n    struct CostData\n    {\n        float searchTimeCost;\n        float buildTimeCost;\n        float memoryCost;\n        float totalCost;\n        IndexParams params;\n    };\n\n    void evaluate_kmeans(CostData& cost)\n    {\n        StartStopTimer t;\n        int checks;\n        const int nn = 1;\n\n        Logger::info(\"KMeansTree using params: max_iterations=%d, branching=%d\\n\",\n                     get_param<int>(cost.params,\"iterations\"),\n                     get_param<int>(cost.params,\"branching\"));\n        KMeansIndex<Distance> kmeans(sampledDataset_, cost.params, distance_);\n        // measure index build time\n        t.start();\n        kmeans.buildIndex();\n        t.stop();\n        float buildTime = (float)t.value;\n\n        // measure search time\n        float searchTime = test_index_precision(kmeans, sampledDataset_, testDataset_, gt_matches_, target_precision_, checks, distance_, nn);\n\n        float datasetMemory = float(sampledDataset_.rows * sampledDataset_.cols * sizeof(float));\n        cost.memoryCost = (kmeans.usedMemory() + datasetMemory) / datasetMemory;\n        cost.searchTimeCost = searchTime;\n        cost.buildTimeCost = buildTime;\n        Logger::info(\"KMeansTree buildTime=%g, searchTime=%g, build_weight=%g\\n\", buildTime, searchTime, build_weight_);\n    }\n\n\n    void evaluate_kdtree(CostData& cost)\n    {\n        StartStopTimer t;\n        int checks;\n        const int nn = 1;\n\n        Logger::info(\"KDTree using params: trees=%d\\n\", get_param<int>(cost.params,\"trees\"));\n        KDTreeIndex<Distance> kdtree(sampledDataset_, cost.params, distance_);\n\n        t.start();\n        kdtree.buildIndex();\n        t.stop();\n        float buildTime = (float)t.value;\n\n        //measure search time\n        float searchTime = test_index_precision(kdtree, sampledDataset_, testDataset_, gt_matches_, target_precision_, checks, distance_, nn);\n\n        float datasetMemory = float(sampledDataset_.rows * sampledDataset_.cols * sizeof(float));\n        cost.memoryCost = (kdtree.usedMemory() + datasetMemory) / datasetMemory;\n        cost.searchTimeCost = searchTime;\n        cost.buildTimeCost = buildTime;\n        Logger::info(\"KDTree buildTime=%g, searchTime=%g\\n\", buildTime, searchTime);\n    }\n\n\n    //    struct KMeansSimpleDownhillFunctor {\n    //\n    //        Autotune& autotuner;\n    //        KMeansSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {}\n    //\n    //        float operator()(int* params) {\n    //\n    //            float maxFloat = numeric_limits<float>::max();\n    //\n    //            if (params[0]<2) return maxFloat;\n    //            if (params[1]<0) return maxFloat;\n    //\n    //            CostData c;\n    //            c.params[\"algorithm\"] = KMEANS;\n    //            c.params[\"centers-init\"] = CENTERS_RANDOM;\n    //            c.params[\"branching\"] = params[0];\n    //            c.params[\"max-iterations\"] = params[1];\n    //\n    //            autotuner.evaluate_kmeans(c);\n    //\n    //            return c.timeCost;\n    //\n    //        }\n    //    };\n    //\n    //    struct KDTreeSimpleDownhillFunctor {\n    //\n    //        Autotune& autotuner;\n    //        KDTreeSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {}\n    //\n    //        float operator()(int* params) {\n    //            float maxFloat = numeric_limits<float>::max();\n    //\n    //            if (params[0]<1) return maxFloat;\n    //\n    //            CostData c;\n    //            c.params[\"algorithm\"] = KDTREE;\n    //            c.params[\"trees\"] = params[0];\n    //\n    //            autotuner.evaluate_kdtree(c);\n    //\n    //            return c.timeCost;\n    //\n    //        }\n    //    };\n\n\n\n    void optimizeKMeans(std::vector<CostData>& costs)\n    {\n        Logger::info(\"KMEANS, Step 1: Exploring parameter space\\n\");\n\n        // explore kmeans parameters space using combinations of the parameters below\n        int maxIterations[] = { 1, 5, 10, 15 };\n        int branchingFactors[] = { 16, 32, 64, 128, 256 };\n\n        int kmeansParamSpaceSize = FLANN_ARRAY_LEN(maxIterations) * FLANN_ARRAY_LEN(branchingFactors);\n        costs.reserve(costs.size() + kmeansParamSpaceSize);\n\n        // evaluate kmeans for all parameter combinations\n        for (size_t i = 0; i < FLANN_ARRAY_LEN(maxIterations); ++i) {\n            for (size_t j = 0; j < FLANN_ARRAY_LEN(branchingFactors); ++j) {\n                CostData cost;\n                cost.params[\"algorithm\"] = FLANN_INDEX_KMEANS;\n                cost.params[\"centers_init\"] = FLANN_CENTERS_RANDOM;\n                cost.params[\"iterations\"] = maxIterations[i];\n                cost.params[\"branching\"] = branchingFactors[j];\n\n                evaluate_kmeans(cost);\n                costs.push_back(cost);\n            }\n        }\n\n        //         Logger::info(\"KMEANS, Step 2: simplex-downhill optimization\\n\");\n        //\n        //         const int n = 2;\n        //         // choose initial simplex points as the best parameters so far\n        //         int kmeansNMPoints[n*(n+1)];\n        //         float kmeansVals[n+1];\n        //         for (int i=0;i<n+1;++i) {\n        //             kmeansNMPoints[i*n] = (int)kmeansCosts[i].params[\"branching\"];\n        //             kmeansNMPoints[i*n+1] = (int)kmeansCosts[i].params[\"max-iterations\"];\n        //             kmeansVals[i] = kmeansCosts[i].timeCost;\n        //         }\n        //         KMeansSimpleDownhillFunctor kmeans_cost_func(*this);\n        //         // run optimization\n        //         optimizeSimplexDownhill(kmeansNMPoints,n,kmeans_cost_func,kmeansVals);\n        //         // store results\n        //         for (int i=0;i<n+1;++i) {\n        //             kmeansCosts[i].params[\"branching\"] = kmeansNMPoints[i*2];\n        //             kmeansCosts[i].params[\"max-iterations\"] = kmeansNMPoints[i*2+1];\n        //             kmeansCosts[i].timeCost = kmeansVals[i];\n        //         }\n    }\n\n\n    void optimizeKDTree(std::vector<CostData>& costs)\n    {\n        Logger::info(\"KD-TREE, Step 1: Exploring parameter space\\n\");\n\n        // explore kd-tree parameters space using the parameters below\n        int testTrees[] = { 1, 4, 8, 16, 32 };\n\n        // evaluate kdtree for all parameter combinations\n        for (size_t i = 0; i < FLANN_ARRAY_LEN(testTrees); ++i) {\n            CostData cost;\n            cost.params[\"algorithm\"] = FLANN_INDEX_KDTREE;\n            cost.params[\"trees\"] = testTrees[i];\n\n            evaluate_kdtree(cost);\n            costs.push_back(cost);\n        }\n\n        //         Logger::info(\"KD-TREE, Step 2: simplex-downhill optimization\\n\");\n        //\n        //         const int n = 1;\n        //         // choose initial simplex points as the best parameters so far\n        //         int kdtreeNMPoints[n*(n+1)];\n        //         float kdtreeVals[n+1];\n        //         for (int i=0;i<n+1;++i) {\n        //             kdtreeNMPoints[i] = (int)kdtreeCosts[i].params[\"trees\"];\n        //             kdtreeVals[i] = kdtreeCosts[i].timeCost;\n        //         }\n        //         KDTreeSimpleDownhillFunctor kdtree_cost_func(*this);\n        //         // run optimization\n        //         optimizeSimplexDownhill(kdtreeNMPoints,n,kdtree_cost_func,kdtreeVals);\n        //         // store results\n        //         for (int i=0;i<n+1;++i) {\n        //             kdtreeCosts[i].params[\"trees\"] = kdtreeNMPoints[i];\n        //             kdtreeCosts[i].timeCost = kdtreeVals[i];\n        //         }\n    }\n\n    /**\n     *  Chooses the best nearest-neighbor algorithm and estimates the optimal\n     *  parameters to use when building the index (for a given precision).\n     *  Returns a dictionary with the optimal parameters.\n     */\n    IndexParams estimateBuildParams()\n    {\n        std::vector<CostData> costs;\n\n        int sampleSize = int(sample_fraction_ * dataset_.rows);\n        int testSampleSize = std::min(sampleSize / 10, 1000);\n\n        Logger::info(\"Entering autotuning, dataset size: %d, sampleSize: %d, testSampleSize: %d, target precision: %g\\n\", dataset_.rows, sampleSize, testSampleSize, target_precision_);\n\n        // For a very small dataset, it makes no sense to build any fancy index, just\n        // use linear search\n        if (testSampleSize < 10) {\n            Logger::info(\"Choosing linear, dataset too small\\n\");\n            return LinearIndexParams();\n        }\n\n        // We use a fraction of the original dataset to speedup the autotune algorithm\n        sampledDataset_ = random_sample(dataset_, sampleSize);\n        // We use a cross-validation approach, first we sample a testset from the dataset\n        testDataset_ = random_sample(sampledDataset_, testSampleSize, true);\n\n        // We compute the ground truth using linear search\n        Logger::info(\"Computing ground truth... \\n\");\n        gt_matches_ = Matrix<int>(new int[testDataset_.rows], testDataset_.rows, 1);\n        StartStopTimer t;\n        t.start();\n        compute_ground_truth<Distance>(sampledDataset_, testDataset_, gt_matches_, 0, distance_);\n        t.stop();\n\n        CostData linear_cost;\n        linear_cost.searchTimeCost = (float)t.value;\n        linear_cost.buildTimeCost = 0;\n        linear_cost.memoryCost = 0;\n        linear_cost.params[\"algorithm\"] = FLANN_INDEX_LINEAR;\n\n        costs.push_back(linear_cost);\n\n        // Start parameter autotune process\n        Logger::info(\"Autotuning parameters...\\n\");\n\n        optimizeKMeans(costs);\n        optimizeKDTree(costs);\n\n        float bestTimeCost = costs[0].searchTimeCost;\n        for (size_t i = 0; i < costs.size(); ++i) {\n            float timeCost = costs[i].buildTimeCost * build_weight_ + costs[i].searchTimeCost;\n            if (timeCost < bestTimeCost) {\n                bestTimeCost = timeCost;\n            }\n        }\n\n        float bestCost = costs[0].searchTimeCost / bestTimeCost;\n        IndexParams bestParams = costs[0].params;\n        if (bestTimeCost > 0) {\n            for (size_t i = 0; i < costs.size(); ++i) {\n                float crtCost = (costs[i].buildTimeCost * build_weight_ + costs[i].searchTimeCost) / bestTimeCost +\n                                memory_weight_ * costs[i].memoryCost;\n                if (crtCost < bestCost) {\n                    bestCost = crtCost;\n                    bestParams = costs[i].params;\n                }\n            }\n        }\n\n        delete[] gt_matches_.data;\n        delete[] testDataset_.data;\n        delete[] sampledDataset_.data;\n\n        return bestParams;\n    }\n\n\n\n    /**\n     *  Estimates the search time parameters needed to get the desired precision.\n     *  Precondition: the index is built\n     *  Postcondition: the searchParams will have the optimum params set, also the speedup obtained over linear search.\n     */\n    float estimateSearchParams(SearchParams& searchParams)\n    {\n        const int nn = 1;\n        const size_t SAMPLE_COUNT = 1000;\n\n        CV_Assert(bestIndex_ != NULL && \"Requires a valid index\"); // must have a valid index\n\n        float speedup = 0;\n\n        int samples = (int)std::min(dataset_.rows / 10, SAMPLE_COUNT);\n        if (samples > 0) {\n            Matrix<ElementType> testDataset = random_sample(dataset_, samples);\n\n            Logger::info(\"Computing ground truth\\n\");\n\n            // we need to compute the ground truth first\n            Matrix<int> gt_matches(new int[testDataset.rows], testDataset.rows, 1);\n            StartStopTimer t;\n            t.start();\n            compute_ground_truth<Distance>(dataset_, testDataset, gt_matches, 1, distance_);\n            t.stop();\n            float linear = (float)t.value;\n\n            int checks;\n            Logger::info(\"Estimating number of checks\\n\");\n\n            float searchTime;\n            float cb_index;\n            if (bestIndex_->getType() == FLANN_INDEX_KMEANS) {\n                Logger::info(\"KMeans algorithm, estimating cluster border factor\\n\");\n                KMeansIndex<Distance>* kmeans = (KMeansIndex<Distance>*)bestIndex_;\n                float bestSearchTime = -1;\n                float best_cb_index = -1;\n                int best_checks = -1;\n                for (cb_index = 0; cb_index < 1.1f; cb_index += 0.2f) {\n                    kmeans->set_cb_index(cb_index);\n                    searchTime = test_index_precision(*kmeans, dataset_, testDataset, gt_matches, target_precision_, checks, distance_, nn, 1);\n                    if ((searchTime < bestSearchTime) || (bestSearchTime == -1)) {\n                        bestSearchTime = searchTime;\n                        best_cb_index = cb_index;\n                        best_checks = checks;\n                    }\n                }\n                searchTime = bestSearchTime;\n                cb_index = best_cb_index;\n                checks = best_checks;\n\n                kmeans->set_cb_index(best_cb_index);\n                Logger::info(\"Optimum cb_index: %g\\n\", cb_index);\n                bestParams_[\"cb_index\"] = cb_index;\n            }\n            else {\n                searchTime = test_index_precision(*bestIndex_, dataset_, testDataset, gt_matches, target_precision_, checks, distance_, nn, 1);\n            }\n\n            Logger::info(\"Required number of checks: %d \\n\", checks);\n            searchParams[\"checks\"] = checks;\n\n            speedup = linear / searchTime;\n\n            delete[] gt_matches.data;\n            delete[] testDataset.data;\n        }\n\n        return speedup;\n    }\n\nprivate:\n    NNIndex<Distance>* bestIndex_;\n\n    IndexParams bestParams_;\n    SearchParams bestSearchParams_;\n\n    Matrix<ElementType> sampledDataset_;\n    Matrix<ElementType> testDataset_;\n    Matrix<int> gt_matches_;\n\n    float speedup_;\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset_;\n\n    /**\n     * Index parameters\n     */\n    float target_precision_;\n    float build_weight_;\n    float memory_weight_;\n    float sample_fraction_;\n\n    Distance distance_;\n\n\n};\n}\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_AUTOTUNED_INDEX_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/composite_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_COMPOSITE_INDEX_H_\n#define OPENCV_FLANN_COMPOSITE_INDEX_H_\n\n//! @cond IGNORED\n\n#include \"nn_index.h\"\n#include \"kdtree_index.h\"\n#include \"kmeans_index.h\"\n\nnamespace cvflann\n{\n\n/**\n * Index parameters for the CompositeIndex.\n */\nstruct CompositeIndexParams : public IndexParams\n{\n    CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11,\n                         flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 )\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_KMEANS;\n        // number of randomized trees to use (for kdtree)\n        (*this)[\"trees\"] = trees;\n        // branching factor\n        (*this)[\"branching\"] = branching;\n        // max iterations to perform in one kmeans clustering (kmeans tree)\n        (*this)[\"iterations\"] = iterations;\n        // algorithm used for picking the initial cluster centers for kmeans tree\n        (*this)[\"centers_init\"] = centers_init;\n        // cluster boundary index. Used when searching the kmeans tree\n        (*this)[\"cb_index\"] = cb_index;\n    }\n};\n\n\n/**\n * This index builds a kd-tree index and a k-means index and performs nearest\n * neighbour search both indexes. This gives a slight boost in search performance\n * as some of the neighbours that are missed by one index are found by the other.\n */\ntemplate <typename Distance>\nclass CompositeIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n    /**\n     * Index constructor\n     * @param inputData dataset containing the points to index\n     * @param params Index parameters\n     * @param d Distance functor\n     * @return\n     */\n    CompositeIndex(const Matrix<ElementType>& inputData, const IndexParams& params = CompositeIndexParams(),\n                   Distance d = Distance()) : index_params_(params)\n    {\n        kdtree_index_ = new KDTreeIndex<Distance>(inputData, params, d);\n        kmeans_index_ = new KMeansIndex<Distance>(inputData, params, d);\n\n    }\n\n    CompositeIndex(const CompositeIndex&);\n    CompositeIndex& operator=(const CompositeIndex&);\n\n    virtual ~CompositeIndex()\n    {\n        delete kdtree_index_;\n        delete kmeans_index_;\n    }\n\n    /**\n     * @return The index type\n     */\n    flann_algorithm_t getType() const CV_OVERRIDE\n    {\n        return FLANN_INDEX_COMPOSITE;\n    }\n\n    /**\n     * @return Size of the index\n     */\n    size_t size() const CV_OVERRIDE\n    {\n        return kdtree_index_->size();\n    }\n\n    /**\n     * \\returns The dimensionality of the features in this index.\n     */\n    size_t veclen() const CV_OVERRIDE\n    {\n        return kdtree_index_->veclen();\n    }\n\n    /**\n     * \\returns The amount of memory (in bytes) used by the index.\n     */\n    int usedMemory() const CV_OVERRIDE\n    {\n        return kmeans_index_->usedMemory() + kdtree_index_->usedMemory();\n    }\n\n    /**\n     * \\brief Builds the index\n     */\n    void buildIndex() CV_OVERRIDE\n    {\n        Logger::info(\"Building kmeans tree...\\n\");\n        kmeans_index_->buildIndex();\n        Logger::info(\"Building kdtree tree...\\n\");\n        kdtree_index_->buildIndex();\n    }\n\n    /**\n     * \\brief Saves the index to a stream\n     * \\param stream The stream to save the index to\n     */\n    void saveIndex(FILE* stream) CV_OVERRIDE\n    {\n        kmeans_index_->saveIndex(stream);\n        kdtree_index_->saveIndex(stream);\n    }\n\n    /**\n     * \\brief Loads the index from a stream\n     * \\param stream The stream from which the index is loaded\n     */\n    void loadIndex(FILE* stream) CV_OVERRIDE\n    {\n        kmeans_index_->loadIndex(stream);\n        kdtree_index_->loadIndex(stream);\n    }\n\n    /**\n     * \\returns The index parameters\n     */\n    IndexParams getParameters() const CV_OVERRIDE\n    {\n        return index_params_;\n    }\n\n    /**\n     * \\brief Method that searches for nearest-neighbours\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE\n    {\n        kmeans_index_->findNeighbors(result, vec, searchParams);\n        kdtree_index_->findNeighbors(result, vec, searchParams);\n    }\n\nprivate:\n    /** The k-means index */\n    KMeansIndex<Distance>* kmeans_index_;\n\n    /** The kd-tree index */\n    KDTreeIndex<Distance>* kdtree_index_;\n\n    /** The index parameters */\n    const IndexParams index_params_;\n};\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_COMPOSITE_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/config.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2011  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2011  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_CONFIG_H_\n#define OPENCV_FLANN_CONFIG_H_\n\n//! @cond IGNORED\n\n#ifdef FLANN_VERSION_\n#undef FLANN_VERSION_\n#endif\n#define FLANN_VERSION_ \"1.6.10\"\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_CONFIG_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/defines.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2011  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2011  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_DEFINES_H_\n#define OPENCV_FLANN_DEFINES_H_\n\n//! @cond IGNORED\n\n#include \"config.h\"\n\n#ifdef FLANN_EXPORT\n#undef FLANN_EXPORT\n#endif\n#ifdef _WIN32\n/* win32 dll export/import directives */\n #ifdef FLANN_EXPORTS\n  #define FLANN_EXPORT __declspec(dllexport)\n #elif defined(FLANN_STATIC)\n  #define FLANN_EXPORT\n #else\n  #define FLANN_EXPORT __declspec(dllimport)\n #endif\n#else\n/* unix needs nothing */\n #define FLANN_EXPORT\n#endif\n\n\n#undef FLANN_PLATFORM_32_BIT\n#undef FLANN_PLATFORM_64_BIT\n#if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64\n#define FLANN_PLATFORM_64_BIT\n#else\n#define FLANN_PLATFORM_32_BIT\n#endif\n\n\n#undef FLANN_ARRAY_LEN\n#define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0]))\n\nnamespace cvflann {\n\n/* Nearest neighbour index algorithms */\nenum flann_algorithm_t\n{\n    FLANN_INDEX_LINEAR = 0,\n    FLANN_INDEX_KDTREE = 1,\n    FLANN_INDEX_KMEANS = 2,\n    FLANN_INDEX_COMPOSITE = 3,\n    FLANN_INDEX_KDTREE_SINGLE = 4,\n    FLANN_INDEX_HIERARCHICAL = 5,\n    FLANN_INDEX_LSH = 6,\n    FLANN_INDEX_SAVED = 254,\n    FLANN_INDEX_AUTOTUNED = 255,\n\n    // deprecated constants, should use the FLANN_INDEX_* ones instead\n    LINEAR = 0,\n    KDTREE = 1,\n    KMEANS = 2,\n    COMPOSITE = 3,\n    KDTREE_SINGLE = 4,\n    SAVED = 254,\n    AUTOTUNED = 255\n};\n\n\n\nenum flann_centers_init_t\n{\n    FLANN_CENTERS_RANDOM = 0,\n    FLANN_CENTERS_GONZALES = 1,\n    FLANN_CENTERS_KMEANSPP = 2,\n    FLANN_CENTERS_GROUPWISE = 3,\n\n    // deprecated constants, should use the FLANN_CENTERS_* ones instead\n    CENTERS_RANDOM = 0,\n    CENTERS_GONZALES = 1,\n    CENTERS_KMEANSPP = 2\n};\n\nenum flann_log_level_t\n{\n    FLANN_LOG_NONE = 0,\n    FLANN_LOG_FATAL = 1,\n    FLANN_LOG_ERROR = 2,\n    FLANN_LOG_WARN = 3,\n    FLANN_LOG_INFO = 4\n};\n\nenum flann_distance_t\n{\n    FLANN_DIST_EUCLIDEAN = 1,\n    FLANN_DIST_L2 = 1,\n    FLANN_DIST_MANHATTAN = 2,\n    FLANN_DIST_L1 = 2,\n    FLANN_DIST_MINKOWSKI = 3,\n    FLANN_DIST_MAX   = 4,\n    FLANN_DIST_HIST_INTERSECT   = 5,\n    FLANN_DIST_HELLINGER = 6,\n    FLANN_DIST_CHI_SQUARE = 7,\n    FLANN_DIST_CS         = 7,\n    FLANN_DIST_KULLBACK_LEIBLER  = 8,\n    FLANN_DIST_KL                = 8,\n    FLANN_DIST_HAMMING          = 9,\n    FLANN_DIST_DNAMMING          = 10,\n\n    // deprecated constants, should use the FLANN_DIST_* ones instead\n    EUCLIDEAN = 1,\n    MANHATTAN = 2,\n    MINKOWSKI = 3,\n    MAX_DIST   = 4,\n    HIST_INTERSECT   = 5,\n    HELLINGER = 6,\n    CS         = 7,\n    KL         = 8,\n    KULLBACK_LEIBLER  = 8\n};\n\nenum flann_datatype_t\n{\n    FLANN_INT8 = 0,\n    FLANN_INT16 = 1,\n    FLANN_INT32 = 2,\n    FLANN_INT64 = 3,\n    FLANN_UINT8 = 4,\n    FLANN_UINT16 = 5,\n    FLANN_UINT32 = 6,\n    FLANN_UINT64 = 7,\n    FLANN_FLOAT32 = 8,\n    FLANN_FLOAT64 = 9\n};\n\nenum\n{\n    FLANN_CHECKS_UNLIMITED = -1,\n    FLANN_CHECKS_AUTOTUNED = -2\n};\n\n}\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_DEFINES_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/dist.h",
    "content": "﻿/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_DIST_H_\n#define OPENCV_FLANN_DIST_H_\n\n//! @cond IGNORED\n\n#include <cmath>\n#include <cstdlib>\n#include <string.h>\n#ifdef _MSC_VER\ntypedef unsigned __int32 uint32_t;\ntypedef unsigned __int64 uint64_t;\n#else\n#include <stdint.h>\n#endif\n\n#include \"defines.h\"\n\n#if defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64))\n# include <Intrin.h>\n#endif\n\n#if defined(__ARM_NEON__) && !defined(__CUDACC__)\n# include \"arm_neon.h\"\n#endif\n\nnamespace cvflann\n{\n\ntemplate<typename T>\ninline T abs(T x) { return (x<0) ? -x : x; }\n\ntemplate<>\ninline int abs<int>(int x) { return ::abs(x); }\n\ntemplate<>\ninline float abs<float>(float x) { return fabsf(x); }\n\ntemplate<>\ninline double abs<double>(double x) { return fabs(x); }\n\n\ntemplate<typename TargetType>\ninline TargetType round(float x) { return static_cast<TargetType>(x); }\n\ntemplate<>\ninline unsigned int round<unsigned int>(float x) { return static_cast<unsigned int>(x + 0.5f); }\n\ntemplate<>\ninline unsigned short round<unsigned short>(float x) { return static_cast<unsigned short>(x + 0.5f); }\n\ntemplate<>\ninline unsigned char round<unsigned char>(float x) { return static_cast<unsigned char>(x + 0.5f); }\n\ntemplate<>\ninline long long round<long long>(float x) { return static_cast<long long>(x + 0.5f); }\n\ntemplate<>\ninline long round<long>(float x) { return static_cast<long>(x + 0.5f); }\n\ntemplate<>\ninline int round<int>(float x) { return static_cast<int>(x + 0.5f) - (x<0); }\n\ntemplate<>\ninline short round<short>(float x) { return static_cast<short>(x + 0.5f) - (x<0); }\n\ntemplate<>\ninline char round<char>(float x) { return static_cast<char>(x + 0.5f) - (x<0); }\n\n\ntemplate<typename TargetType>\ninline TargetType round(double x) { return static_cast<TargetType>(x); }\n\ntemplate<>\ninline unsigned int round<unsigned int>(double x) { return static_cast<unsigned int>(x + 0.5); }\n\ntemplate<>\ninline unsigned short round<unsigned short>(double x) { return static_cast<unsigned short>(x + 0.5); }\n\ntemplate<>\ninline unsigned char round<unsigned char>(double x) { return static_cast<unsigned char>(x + 0.5); }\n\ntemplate<>\ninline long long round<long long>(double x) { return static_cast<long long>(x + 0.5); }\n\ntemplate<>\ninline long round<long>(double x) { return static_cast<long>(x + 0.5); }\n\ntemplate<>\ninline int round<int>(double x) { return static_cast<int>(x + 0.5) - (x<0); }\n\ntemplate<>\ninline short round<short>(double x) { return static_cast<short>(x + 0.5) - (x<0); }\n\ntemplate<>\ninline char round<char>(double x) { return static_cast<char>(x + 0.5) - (x<0); }\n\n\ntemplate<typename T>\nstruct Accumulator { typedef T Type; };\ntemplate<>\nstruct Accumulator<unsigned char>  { typedef float Type; };\ntemplate<>\nstruct Accumulator<unsigned short> { typedef float Type; };\ntemplate<>\nstruct Accumulator<unsigned int> { typedef float Type; };\ntemplate<>\nstruct Accumulator<char>   { typedef float Type; };\ntemplate<>\nstruct Accumulator<short>  { typedef float Type; };\ntemplate<>\nstruct Accumulator<int> { typedef float Type; };\n\n#undef True\n#undef False\n\nclass True\n{\npublic:\n    static const bool val = true;\n};\n\nclass False\n{\npublic:\n    static const bool val = false;\n};\n\n\n/*\n * This is a \"zero iterator\". It basically behaves like a zero filled\n * array to all algorithms that use arrays as iterators (STL style).\n * It's useful when there's a need to compute the distance between feature\n * and origin it and allows for better compiler optimisation than using a\n * zero-filled array.\n */\ntemplate <typename T>\nstruct ZeroIterator\n{\n\n    T operator*()\n    {\n        return 0;\n    }\n\n    T operator[](int)\n    {\n        return 0;\n    }\n\n    const ZeroIterator<T>& operator ++()\n    {\n        return *this;\n    }\n\n    ZeroIterator<T> operator ++(int)\n    {\n        return *this;\n    }\n\n    ZeroIterator<T>& operator+=(int)\n    {\n        return *this;\n    }\n\n};\n\n\n\n/**\n * Squared Euclidean distance functor.\n *\n * This is the simpler, unrolled version. This is preferable for\n * very low dimensionality data (eg 3D points)\n */\ntemplate<class T>\nstruct L2_Simple\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n    typedef ResultType CentersType;\n\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff;\n        for(size_t i = 0; i < size; ++i ) {\n            diff = (ResultType)(*a++ - *b++);\n            result += diff*diff;\n        }\n        return result;\n    }\n\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return (a-b)*(a-b);\n    }\n};\n\n\n\n/**\n * Squared Euclidean distance functor, optimized version\n */\ntemplate<class T>\nstruct L2\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n    typedef ResultType CentersType;\n\n    /**\n     *  Compute the squared Euclidean distance between two vectors.\n     *\n     *\tThis is highly optimised, with loop unrolling, as it is one\n     *\tof the most expensive inner loops.\n     *\n     *\tThe computation of squared root at the end is omitted for\n     *\tefficiency.\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = (ResultType)(a[0] - b[0]);\n            diff1 = (ResultType)(a[1] - b[1]);\n            diff2 = (ResultType)(a[2] - b[2]);\n            diff3 = (ResultType)(a[3] - b[3]);\n            result += diff0 * diff0 + diff1 * diff1 + diff2 * diff2 + diff3 * diff3;\n            a += 4;\n            b += 4;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            diff0 = (ResultType)(*a++ - *b++);\n            result += diff0 * diff0;\n        }\n        return result;\n    }\n\n    /**\n     *\tPartial euclidean distance, using just one dimension. This is used by the\n     *\tkd-tree when computing partial distances while traversing the tree.\n     *\n     *\tSquared root is omitted for efficiency.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return (a-b)*(a-b);\n    }\n};\n\n\n/*\n * Manhattan distance functor, optimized version\n */\ntemplate<class T>\nstruct L1\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n    typedef ResultType CentersType;\n\n    /**\n     *  Compute the Manhattan (L_1) distance between two vectors.\n     *\n     *\tThis is highly optimised, with loop unrolling, as it is one\n     *\tof the most expensive inner loops.\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = (ResultType)abs(a[0] - b[0]);\n            diff1 = (ResultType)abs(a[1] - b[1]);\n            diff2 = (ResultType)abs(a[2] - b[2]);\n            diff3 = (ResultType)abs(a[3] - b[3]);\n            result += diff0 + diff1 + diff2 + diff3;\n            a += 4;\n            b += 4;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            diff0 = (ResultType)abs(*a++ - *b++);\n            result += diff0;\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return abs(a-b);\n    }\n};\n\n\n\ntemplate<class T>\nstruct MinkowskiDistance\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n    typedef ResultType CentersType;\n\n    int order;\n\n    MinkowskiDistance(int order_) : order(order_) {}\n\n    /**\n     *  Compute the Minkowsky (L_p) distance between two vectors.\n     *\n     *\tThis is highly optimised, with loop unrolling, as it is one\n     *\tof the most expensive inner loops.\n     *\n     *\tThe computation of squared root at the end is omitted for\n     *\tefficiency.\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = (ResultType)abs(a[0] - b[0]);\n            diff1 = (ResultType)abs(a[1] - b[1]);\n            diff2 = (ResultType)abs(a[2] - b[2]);\n            diff3 = (ResultType)abs(a[3] - b[3]);\n            result += pow(diff0,order) + pow(diff1,order) + pow(diff2,order) + pow(diff3,order);\n            a += 4;\n            b += 4;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            diff0 = (ResultType)abs(*a++ - *b++);\n            result += pow(diff0,order);\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return pow(static_cast<ResultType>(abs(a-b)),order);\n    }\n};\n\n\n\ntemplate<class T>\nstruct MaxDistance\n{\n    typedef False is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n    typedef ResultType CentersType;\n\n    /**\n     *  Compute the max distance (L_infinity) between two vectors.\n     *\n     *  This distance is not a valid kdtree distance, it's not dimensionwise additive.\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = abs(a[0] - b[0]);\n            diff1 = abs(a[1] - b[1]);\n            diff2 = abs(a[2] - b[2]);\n            diff3 = abs(a[3] - b[3]);\n            if (diff0>result) {result = diff0; }\n            if (diff1>result) {result = diff1; }\n            if (diff2>result) {result = diff2; }\n            if (diff3>result) {result = diff3; }\n            a += 4;\n            b += 4;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            diff0 = abs(*a++ - *b++);\n            result = (diff0>result) ? diff0 : result;\n        }\n        return result;\n    }\n\n    /* This distance functor is not dimension-wise additive, which\n     * makes it an invalid kd-tree distance, not implementing the accum_dist method */\n\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor\n * bit count of A exclusive XOR'ed with B\n */\nstruct HammingLUT\n{\n    typedef False is_kdtree_distance;\n    typedef False is_vector_space_distance;\n\n    typedef unsigned char ElementType;\n    typedef int ResultType;\n    typedef ElementType CentersType;\n\n    /** this will count the bits in a ^ b\n     */\n    template<typename Iterator2>\n    ResultType operator()(const unsigned char* a, const Iterator2 b, size_t size) const\n    {\n        static const uchar popCountTable[] =\n        {\n            0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8\n        };\n        ResultType result = 0;\n        const unsigned char* b2 = reinterpret_cast<const unsigned char*> (b);\n        for (size_t i = 0; i < size; i++) {\n            result += popCountTable[a[i] ^ b2[i]];\n        }\n        return result;\n    }\n\n\n    ResultType operator()(const unsigned char* a, const ZeroIterator<unsigned char> b, size_t size) const\n    {\n        (void)b;\n        static const uchar popCountTable[] =\n        {\n            0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,\n            3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8\n        };\n        ResultType result = 0;\n        for (size_t i = 0; i < size; i++) {\n            result += popCountTable[a[i]];\n        }\n        return result;\n    }\n};\n\n/**\n * Hamming distance functor (pop count between two binary vectors, i.e. xor them and count the number of bits set)\n * That code was taken from brief.cpp in OpenCV\n */\ntemplate<class T>\nstruct Hamming\n{\n    typedef False is_kdtree_distance;\n    typedef False is_vector_space_distance;\n\n\n    typedef T ElementType;\n    typedef int ResultType;\n    typedef ElementType CentersType;\n\n    template<typename Iterator1, typename Iterator2>\n    ResultType operator()(const Iterator1 a, const Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        ResultType result = 0;\n#if defined(__ARM_NEON__) && !defined(__CUDACC__)\n        {\n            const unsigned char* a2 = reinterpret_cast<const unsigned char*> (a);\n            const unsigned char* b2 = reinterpret_cast<const unsigned char*> (b);\n            uint32x4_t bits = vmovq_n_u32(0);\n            for (size_t i = 0; i < size; i += 16) {\n                uint8x16_t A_vec = vld1q_u8 (a2 + i);\n                uint8x16_t B_vec = vld1q_u8 (b2 + i);\n                uint8x16_t AxorB = veorq_u8 (A_vec, B_vec);\n                uint8x16_t bitsSet = vcntq_u8 (AxorB);\n                uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet);\n                uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8);\n                bits = vaddq_u32(bits, bitSet4);\n            }\n            uint64x2_t bitSet2 = vpaddlq_u32 (bits);\n            result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);\n            result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);\n        }\n#elif defined(__GNUC__)\n        {\n            //for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)\n            typedef unsigned long long pop_t;\n            const size_t modulo = size % sizeof(pop_t);\n            const pop_t* a2 = reinterpret_cast<const pop_t*> (a);\n            const pop_t* b2 = reinterpret_cast<const pop_t*> (b);\n            const pop_t* a2_end = a2 + (size / sizeof(pop_t));\n\n            for (; a2 != a2_end; ++a2, ++b2) result += __builtin_popcountll((*a2) ^ (*b2));\n\n            if (modulo) {\n                //in the case where size is not dividable by sizeof(size_t)\n                //need to mask off the bits at the end\n                pop_t a_final = 0, b_final = 0;\n                memcpy(&a_final, a2, modulo);\n                memcpy(&b_final, b2, modulo);\n                result += __builtin_popcountll(a_final ^ b_final);\n            }\n        }\n#else // NO NEON and NOT GNUC\n        HammingLUT lut;\n        result = lut(reinterpret_cast<const unsigned char*> (a),\n                     reinterpret_cast<const unsigned char*> (b), size);\n#endif\n        return result;\n    }\n\n\n    template<typename Iterator1>\n    ResultType operator()(const Iterator1 a, ZeroIterator<unsigned char> b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        (void)b;\n        ResultType result = 0;\n#if defined(__ARM_NEON__) && !defined(__CUDACC__)\n        {\n            const unsigned char* a2 = reinterpret_cast<const unsigned char*> (a);\n            uint32x4_t bits = vmovq_n_u32(0);\n            for (size_t i = 0; i < size; i += 16) {\n                uint8x16_t A_vec = vld1q_u8 (a2 + i);\n                uint8x16_t bitsSet = vcntq_u8 (A_vec);\n                uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet);\n                uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8);\n                bits = vaddq_u32(bits, bitSet4);\n            }\n            uint64x2_t bitSet2 = vpaddlq_u32 (bits);\n            result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);\n            result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);\n        }\n#elif defined(__GNUC__)\n        {\n            //for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)\n            typedef unsigned long long pop_t;\n            const size_t modulo = size % sizeof(pop_t);\n            const pop_t* a2 = reinterpret_cast<const pop_t*> (a);\n            const pop_t* a2_end = a2 + (size / sizeof(pop_t));\n\n            for (; a2 != a2_end; ++a2) result += __builtin_popcountll(*a2);\n\n            if (modulo) {\n                //in the case where size is not dividable by sizeof(size_t)\n                //need to mask off the bits at the end\n                pop_t a_final = 0;\n                memcpy(&a_final, a2, modulo);\n                result += __builtin_popcountll(a_final);\n            }\n        }\n#else // NO NEON and NOT GNUC\n        HammingLUT lut;\n        result = lut(reinterpret_cast<const unsigned char*> (a), b, size);\n#endif\n        return result;\n    }\n};\n\ntemplate<typename T>\nstruct Hamming2\n{\n    typedef False is_kdtree_distance;\n    typedef False is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef int ResultType;\n    typedef ElementType CentersType;\n\n    /** This is popcount_3() from:\n     * http://en.wikipedia.org/wiki/Hamming_weight */\n    unsigned int popcnt32(uint32_t n) const\n    {\n        n -= ((n >> 1) & 0x55555555);\n        n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n        return (((n + (n >> 4))& 0xF0F0F0F)* 0x1010101) >> 24;\n    }\n\n#ifdef FLANN_PLATFORM_64_BIT\n    unsigned int popcnt64(uint64_t n) const\n    {\n        n -= ((n >> 1) & 0x5555555555555555);\n        n = (n & 0x3333333333333333) + ((n >> 2) & 0x3333333333333333);\n        return (((n + (n >> 4))& 0x0f0f0f0f0f0f0f0f)* 0x0101010101010101) >> 56;\n    }\n#endif\n\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(const Iterator1 a, const Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        CV_DbgAssert(!(size % long_word_size_) && \"vectors size must be multiple of long words size (i.e. 8)\");\n\n#ifdef FLANN_PLATFORM_64_BIT\n        const uint64_t* pa = reinterpret_cast<const uint64_t*>(a);\n        const uint64_t* pb = reinterpret_cast<const uint64_t*>(b);\n        ResultType result = 0;\n        size /= long_word_size_;\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt64(*pa ^ *pb);\n            ++pa;\n            ++pb;\n        }\n#else\n        const uint32_t* pa = reinterpret_cast<const uint32_t*>(a);\n        const uint32_t* pb = reinterpret_cast<const uint32_t*>(b);\n        ResultType result = 0;\n        size /= long_word_size_;\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt32(*pa ^ *pb);\n            ++pa;\n            ++pb;\n        }\n#endif\n        return result;\n    }\n\n\n    template <typename Iterator1>\n    ResultType operator()(const Iterator1 a, ZeroIterator<unsigned char> b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        CV_DbgAssert(!(size % long_word_size_) && \"vectors size must be multiple of long words size (i.e. 8)\");\n\n        (void)b;\n#ifdef FLANN_PLATFORM_64_BIT\n        const uint64_t* pa = reinterpret_cast<const uint64_t*>(a);\n        ResultType result = 0;\n        size /= long_word_size_;\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt64(*pa);\n            ++pa;\n        }\n#else\n        const uint32_t* pa = reinterpret_cast<const uint32_t*>(a);\n        ResultType result = 0;\n        size /= long_word_size_;\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt32(*pa);\n            ++pa;\n        }\n#endif\n        return result;\n    }\n\nprivate:\n#ifdef FLANN_PLATFORM_64_BIT\n    static const size_t long_word_size_ = sizeof(uint64_t)/sizeof(unsigned char);\n#else\n    static const size_t long_word_size_ = sizeof(uint32_t)/sizeof(unsigned char);\n#endif\n};\n\n\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\nstruct DNAmmingLUT\n{\n    typedef False is_kdtree_distance;\n    typedef False is_vector_space_distance;\n\n    typedef unsigned char ElementType;\n    typedef int ResultType;\n    typedef ElementType CentersType;\n\n    /** this will count the bits in a ^ b\n     */\n    template<typename Iterator2>\n    ResultType operator()(const unsigned char* a, const Iterator2 b, size_t size) const\n    {\n        static const uchar popCountTable[] =\n        {\n            0, 1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3,\n            1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3,\n            1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4\n        };\n        ResultType result = 0;\n        const unsigned char* b2 = reinterpret_cast<const unsigned char*> (b);\n        for (size_t i = 0; i < size; i++) {\n            result += popCountTable[a[i] ^ b2[i]];\n        }\n        return result;\n    }\n\n\n    ResultType operator()(const unsigned char* a, const ZeroIterator<unsigned char> b, size_t size) const\n    {\n        (void)b;\n        static const uchar popCountTable[] =\n        {\n            0, 1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3,\n            1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3,\n            1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4,\n            2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4, 2, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 4, 4\n        };\n        ResultType result = 0;\n        for (size_t i = 0; i < size; i++) {\n            result += popCountTable[a[i]];\n        }\n        return result;\n    }\n};\n\n\ntemplate<typename T>\nstruct DNAmming2\n{\n    typedef False is_kdtree_distance;\n    typedef False is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef int ResultType;\n    typedef ElementType CentersType;\n\n    /** This is popcount_3() from:\n     * http://en.wikipedia.org/wiki/Hamming_weight */\n    unsigned int popcnt32(uint32_t n) const\n    {\n        n = ((n >> 1) | n) & 0x55555555;\n        n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n        return (((n + (n >> 4))& 0x0F0F0F0F)* 0x01010101) >> 24;\n    }\n\n#ifdef FLANN_PLATFORM_64_BIT\n    unsigned int popcnt64(uint64_t n) const\n    {\n        n = ((n >> 1) | n) & 0x5555555555555555;\n        n = (n & 0x3333333333333333) + ((n >> 2) & 0x3333333333333333);\n        return (((n + (n >> 4))& 0x0f0f0f0f0f0f0f0f)* 0x0101010101010101) >> 56;\n    }\n#endif\n\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(const Iterator1 a, const Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        CV_DbgAssert(!(size % long_word_size_) && \"vectors size must be multiple of long words size (i.e. 8)\");\n\n#ifdef FLANN_PLATFORM_64_BIT\n        const uint64_t* pa = reinterpret_cast<const uint64_t*>(a);\n        const uint64_t* pb = reinterpret_cast<const uint64_t*>(b);\n        ResultType result = 0;\n        size /= long_word_size_;\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt64(*pa ^ *pb);\n            ++pa;\n            ++pb;\n        }\n#else\n        const uint32_t* pa = reinterpret_cast<const uint32_t*>(a);\n        const uint32_t* pb = reinterpret_cast<const uint32_t*>(b);\n        ResultType result = 0;\n        size /= long_word_size_;\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt32(*pa ^ *pb);\n            ++pa;\n            ++pb;\n        }\n#endif\n        return result;\n    }\n\n\n    template <typename Iterator1>\n    ResultType operator()(const Iterator1 a, ZeroIterator<unsigned char> b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        CV_DbgAssert(!(size % long_word_size_) && \"vectors size must be multiple of long words size (i.e. 8)\");\n\n        (void)b;\n#ifdef FLANN_PLATFORM_64_BIT\n        const uint64_t* pa = reinterpret_cast<const uint64_t*>(a);\n        ResultType result = 0;\n        size /= long_word_size_;\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt64(*pa);\n            ++pa;\n        }\n#else\n        const uint32_t* pa = reinterpret_cast<const uint32_t*>(a);\n        ResultType result = 0;\n        size /= long_word_size_;\n        for(size_t i = 0; i < size; ++i ) {\n            result += popcnt32(*pa);\n            ++pa;\n        }\n#endif\n        return result;\n    }\n\nprivate:\n#ifdef FLANN_PLATFORM_64_BIT\n    static const size_t long_word_size_= sizeof(uint64_t)/sizeof(unsigned char);\n#else\n    static const size_t long_word_size_= sizeof(uint32_t)/sizeof(unsigned char);\n#endif\n};\n\n\n\ntemplate<class T>\nstruct HistIntersectionDistance\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n    typedef ResultType CentersType;\n\n    /**\n     *  Compute the histogram intersection distance\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType min0, min1, min2, min3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            min0 = (ResultType)(a[0] < b[0] ? a[0] : b[0]);\n            min1 = (ResultType)(a[1] < b[1] ? a[1] : b[1]);\n            min2 = (ResultType)(a[2] < b[2] ? a[2] : b[2]);\n            min3 = (ResultType)(a[3] < b[3] ? a[3] : b[3]);\n            result += min0 + min1 + min2 + min3;\n            a += 4;\n            b += 4;\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        /* Process last 0-3 pixels.  Not needed for standard vector lengths. */\n        while (a < last) {\n            min0 = (ResultType)(*a < *b ? *a : *b);\n            result += min0;\n            ++a;\n            ++b;\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        return a<b ? a : b;\n    }\n};\n\n\n\ntemplate<class T>\nstruct HellingerDistance\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n    typedef ResultType CentersType;\n\n    /**\n     *  Compute the Hellinger distance\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType diff0, diff1, diff2, diff3;\n        Iterator1 last = a + size;\n        Iterator1 lastgroup = last - 3;\n\n        /* Process 4 items with each loop for efficiency. */\n        while (a < lastgroup) {\n            diff0 = sqrt(static_cast<ResultType>(a[0])) - sqrt(static_cast<ResultType>(b[0]));\n            diff1 = sqrt(static_cast<ResultType>(a[1])) - sqrt(static_cast<ResultType>(b[1]));\n            diff2 = sqrt(static_cast<ResultType>(a[2])) - sqrt(static_cast<ResultType>(b[2]));\n            diff3 = sqrt(static_cast<ResultType>(a[3])) - sqrt(static_cast<ResultType>(b[3]));\n            result += diff0 * diff0 + diff1 * diff1 + diff2 * diff2 + diff3 * diff3;\n            a += 4;\n            b += 4;\n        }\n        while (a < last) {\n            diff0 = sqrt(static_cast<ResultType>(*a++)) - sqrt(static_cast<ResultType>(*b++));\n            result += diff0 * diff0;\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        ResultType diff = sqrt(static_cast<ResultType>(a)) - sqrt(static_cast<ResultType>(b));\n        return diff * diff;\n    }\n};\n\n\ntemplate<class T>\nstruct ChiSquareDistance\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n    typedef ResultType CentersType;\n\n    /**\n     *  Compute the chi-square distance\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        ResultType sum, diff;\n        Iterator1 last = a + size;\n\n        while (a < last) {\n            sum = (ResultType)(*a + *b);\n            if (sum>0) {\n                diff = (ResultType)(*a - *b);\n                result += diff*diff/sum;\n            }\n            ++a;\n            ++b;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        ResultType result = ResultType();\n        ResultType sum, diff;\n\n        sum = (ResultType)(a+b);\n        if (sum>0) {\n            diff = (ResultType)(a-b);\n            result = diff*diff/sum;\n        }\n        return result;\n    }\n};\n\n\ntemplate<class T>\nstruct KL_Divergence\n{\n    typedef True is_kdtree_distance;\n    typedef True is_vector_space_distance;\n\n    typedef T ElementType;\n    typedef typename Accumulator<T>::Type ResultType;\n    typedef ResultType CentersType;\n\n    /**\n     *  Compute the Kullback-Leibler divergence\n     */\n    template <typename Iterator1, typename Iterator2>\n    ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const\n    {\n        ResultType result = ResultType();\n        Iterator1 last = a + size;\n\n        while (a < last) {\n            if ( *a != 0 && *b != 0 ) {\n                ResultType ratio = (ResultType)(*a / *b);\n                if (ratio>0) {\n                    result += *a * log(ratio);\n                }\n            }\n            ++a;\n            ++b;\n\n            if ((worst_dist>0)&&(result>worst_dist)) {\n                return result;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * Partial distance, used by the kd-tree.\n     */\n    template <typename U, typename V>\n    inline ResultType accum_dist(const U& a, const V& b, int) const\n    {\n        ResultType result = ResultType();\n        if( a != 0 && b != 0 ) {\n            ResultType ratio = (ResultType)(a / b);\n            if (ratio>0) {\n                result = a * log(ratio);\n            }\n        }\n        return result;\n    }\n};\n\n\n/*\n * Depending on processed distances, some of them are already squared (e.g. L2)\n * and some are not (e.g.Hamming). In KMeans++ for instance we want to be sure\n * we are working on ^2 distances, thus following templates to ensure that.\n */\ntemplate <typename Distance, typename ElementType>\nstruct squareDistance\n{\n    typedef typename Distance::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist*dist; }\n};\n\n\ntemplate <typename ElementType>\nstruct squareDistance<L2_Simple<ElementType>, ElementType>\n{\n    typedef typename L2_Simple<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\ntemplate <typename ElementType>\nstruct squareDistance<L2<ElementType>, ElementType>\n{\n    typedef typename L2<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\n\ntemplate <typename ElementType>\nstruct squareDistance<MinkowskiDistance<ElementType>, ElementType>\n{\n    typedef typename MinkowskiDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\ntemplate <typename ElementType>\nstruct squareDistance<HellingerDistance<ElementType>, ElementType>\n{\n    typedef typename HellingerDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\ntemplate <typename ElementType>\nstruct squareDistance<ChiSquareDistance<ElementType>, ElementType>\n{\n    typedef typename ChiSquareDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\n\ntemplate <typename Distance>\ntypename Distance::ResultType ensureSquareDistance( typename Distance::ResultType dist )\n{\n    typedef typename Distance::ElementType ElementType;\n\n    squareDistance<Distance, ElementType> dummy;\n    return dummy( dist );\n}\n\n\n/*\n * ...a template to tell the user if the distance he is working with is actually squared\n */\n\ntemplate <typename Distance, typename ElementType>\nstruct isSquareDist\n{\n    bool operator()() { return false; }\n};\n\n\ntemplate <typename ElementType>\nstruct isSquareDist<L2_Simple<ElementType>, ElementType>\n{\n    bool operator()() { return true; }\n};\n\ntemplate <typename ElementType>\nstruct isSquareDist<L2<ElementType>, ElementType>\n{\n    bool operator()() { return true; }\n};\n\n\ntemplate <typename ElementType>\nstruct isSquareDist<MinkowskiDistance<ElementType>, ElementType>\n{\n    bool operator()() { return true; }\n};\n\ntemplate <typename ElementType>\nstruct isSquareDist<HellingerDistance<ElementType>, ElementType>\n{\n    bool operator()() { return true; }\n};\n\ntemplate <typename ElementType>\nstruct isSquareDist<ChiSquareDistance<ElementType>, ElementType>\n{\n    bool operator()() { return true; }\n};\n\n\ntemplate <typename Distance>\nbool isSquareDistance()\n{\n    typedef typename Distance::ElementType ElementType;\n\n    isSquareDist<Distance, ElementType> dummy;\n    return dummy();\n}\n\n/*\n * ...and a template to ensure the user that he will process the normal distance,\n * and not squared distance, without losing processing time calling sqrt(ensureSquareDistance)\n * that will result in doing actually sqrt(dist*dist) for L1 distance for instance.\n */\ntemplate <typename Distance, typename ElementType>\nstruct simpleDistance\n{\n    typedef typename Distance::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return dist; }\n};\n\n\ntemplate <typename ElementType>\nstruct simpleDistance<L2_Simple<ElementType>, ElementType>\n{\n    typedef typename L2_Simple<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\ntemplate <typename ElementType>\nstruct simpleDistance<L2<ElementType>, ElementType>\n{\n    typedef typename L2<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\n\ntemplate <typename ElementType>\nstruct simpleDistance<MinkowskiDistance<ElementType>, ElementType>\n{\n    typedef typename MinkowskiDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\ntemplate <typename ElementType>\nstruct simpleDistance<HellingerDistance<ElementType>, ElementType>\n{\n    typedef typename HellingerDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\ntemplate <typename ElementType>\nstruct simpleDistance<ChiSquareDistance<ElementType>, ElementType>\n{\n    typedef typename ChiSquareDistance<ElementType>::ResultType ResultType;\n    ResultType operator()( ResultType dist ) { return sqrt(dist); }\n};\n\n\ntemplate <typename Distance>\ntypename Distance::ResultType ensureSimpleDistance( typename Distance::ResultType dist )\n{\n    typedef typename Distance::ElementType ElementType;\n\n    simpleDistance<Distance, ElementType> dummy;\n    return dummy( dist );\n}\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_DIST_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/dummy.h",
    "content": "\n#ifndef OPENCV_FLANN_DUMMY_H_\n#define OPENCV_FLANN_DUMMY_H_\n\n//! @cond IGNORED\n\nnamespace cvflann\n{\n\nCV_DEPRECATED inline void dummyfunc() {}\n\n}\n\n//! @endcond\n\n#endif  /* OPENCV_FLANN_DUMMY_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/dynamic_bitset.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n/***********************************************************************\n * Author: Vincent Rabaud\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_DYNAMIC_BITSET_H_\n#define OPENCV_FLANN_DYNAMIC_BITSET_H_\n\n//! @cond IGNORED\n\n#ifndef FLANN_USE_BOOST\n#  define FLANN_USE_BOOST 0\n#endif\n//#define FLANN_USE_BOOST 1\n#if FLANN_USE_BOOST\n#include <boost/dynamic_bitset.hpp>\ntypedef boost::dynamic_bitset<> DynamicBitset;\n#else\n\n#include <limits.h>\n\n#include \"dist.h\"\n\nnamespace cvflann {\n\n/** Class re-implementing the boost version of it\n * This helps not depending on boost, it also does not do the bound checks\n * and has a way to reset a block for speed\n */\nclass DynamicBitset\n{\npublic:\n    /** default constructor\n     */\n    DynamicBitset() : size_(0)\n    {\n    }\n\n    /** only constructor we use in our code\n     * @param sz the size of the bitset (in bits)\n     */\n    DynamicBitset(size_t sz)\n    {\n        resize(sz);\n        reset();\n    }\n\n    /** Sets all the bits to 0\n     */\n    void clear()\n    {\n        std::fill(bitset_.begin(), bitset_.end(), 0);\n    }\n\n    /** @brief checks if the bitset is empty\n     * @return true if the bitset is empty\n     */\n    bool empty() const\n    {\n        return bitset_.empty();\n    }\n\n    /** set all the bits to 0\n     */\n    void reset()\n    {\n        std::fill(bitset_.begin(), bitset_.end(), 0);\n    }\n\n    /** @brief set one bit to 0\n     * @param index\n     */\n    void reset(size_t index)\n    {\n        bitset_[index / cell_bit_size_] &= ~(size_t(1) << (index % cell_bit_size_));\n    }\n\n    /** @brief sets a specific bit to 0, and more bits too\n     * This function is useful when resetting a given set of bits so that the\n     * whole bitset ends up being 0: if that's the case, we don't care about setting\n     * other bits to 0\n     * @param index\n     */\n    void reset_block(size_t index)\n    {\n        bitset_[index / cell_bit_size_] = 0;\n    }\n\n    /** resize the bitset so that it contains at least sz bits\n     * @param sz\n     */\n    void resize(size_t sz)\n    {\n        size_ = sz;\n        bitset_.resize(sz / cell_bit_size_ + 1);\n    }\n\n    /** set a bit to true\n     * @param index the index of the bit to set to 1\n     */\n    void set(size_t index)\n    {\n        bitset_[index / cell_bit_size_] |= size_t(1) << (index % cell_bit_size_);\n    }\n\n    /** gives the number of contained bits\n     */\n    size_t size() const\n    {\n        return size_;\n    }\n\n    /** check if a bit is set\n     * @param index the index of the bit to check\n     * @return true if the bit is set\n     */\n    bool test(size_t index) const\n    {\n        return (bitset_[index / cell_bit_size_] & (size_t(1) << (index % cell_bit_size_))) != 0;\n    }\n\nprivate:\n    std::vector<size_t> bitset_;\n    size_t size_;\n    static const unsigned int cell_bit_size_ = CHAR_BIT * sizeof(size_t);\n};\n\n} // namespace cvflann\n\n#endif\n\n//! @endcond\n\n#endif // OPENCV_FLANN_DYNAMIC_BITSET_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/flann.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/flann.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/flann_base.hpp",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_BASE_HPP_\n#define OPENCV_FLANN_BASE_HPP_\n\n//! @cond IGNORED\n\n#include <vector>\n#include <cstdio>\n\n#include \"general.h\"\n#include \"matrix.h\"\n#include \"params.h\"\n#include \"saving.h\"\n\n#include \"all_indices.h\"\n\nnamespace cvflann\n{\n\n/**\n * Sets the log level used for all flann functions\n * @param level Verbosity level\n */\ninline void log_verbosity(int level)\n{\n    if (level >= 0) {\n        Logger::setLevel(level);\n    }\n}\n\n/**\n * (Deprecated) Index parameters for creating a saved index.\n */\nstruct SavedIndexParams : public IndexParams\n{\n    SavedIndexParams(cv::String filename)\n    {\n        (* this)[\"algorithm\"] = FLANN_INDEX_SAVED;\n        (*this)[\"filename\"] = filename;\n    }\n};\n\n\ntemplate<typename Distance>\nNNIndex<Distance>* load_saved_index(const Matrix<typename Distance::ElementType>& dataset, const cv::String& filename, Distance distance)\n{\n    typedef typename Distance::ElementType ElementType;\n\n    FILE* fin = fopen(filename.c_str(), \"rb\");\n    if (fin == NULL) {\n        return NULL;\n    }\n    IndexHeader header = load_header(fin);\n    if (header.data_type != Datatype<ElementType>::type()) {\n        fclose(fin);\n        FLANN_THROW(cv::Error::StsError, \"Datatype of saved index is different than of the one to be created.\");\n    }\n    if ((size_t(header.rows) != dataset.rows)||(size_t(header.cols) != dataset.cols)) {\n        fclose(fin);\n        FLANN_THROW(cv::Error::StsError, \"The index saved belongs to a different dataset\");\n    }\n\n    IndexParams params;\n    params[\"algorithm\"] = header.index_type;\n    NNIndex<Distance>* nnIndex = create_index_by_type<Distance>(dataset, params, distance);\n    nnIndex->loadIndex(fin);\n    fclose(fin);\n\n    return nnIndex;\n}\n\n\ntemplate<typename Distance>\nclass Index : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n    Index(const Matrix<ElementType>& features, const IndexParams& params, Distance distance = Distance() )\n        : index_params_(params)\n    {\n        flann_algorithm_t index_type = get_param<flann_algorithm_t>(params,\"algorithm\");\n        loaded_ = false;\n\n        if (index_type == FLANN_INDEX_SAVED) {\n            nnIndex_ = load_saved_index<Distance>(features, get_param<cv::String>(params,\"filename\"), distance);\n            loaded_ = true;\n        }\n        else {\n            nnIndex_ = create_index_by_type<Distance>(features, params, distance);\n        }\n    }\n\n    ~Index()\n    {\n        delete nnIndex_;\n    }\n\n    /**\n     * Builds the index.\n     */\n    void buildIndex() CV_OVERRIDE\n    {\n        if (!loaded_) {\n            nnIndex_->buildIndex();\n        }\n    }\n\n    void save(cv::String filename)\n    {\n        FILE* fout = fopen(filename.c_str(), \"wb\");\n        if (fout == NULL) {\n            FLANN_THROW(cv::Error::StsError, \"Cannot open file\");\n        }\n        save_header(fout, *nnIndex_);\n        saveIndex(fout);\n        fclose(fout);\n    }\n\n    /**\n     * \\brief Saves the index to a stream\n     * \\param stream The stream to save the index to\n     */\n    virtual void saveIndex(FILE* stream) CV_OVERRIDE\n    {\n        nnIndex_->saveIndex(stream);\n    }\n\n    /**\n     * \\brief Loads the index from a stream\n     * \\param stream The stream from which the index is loaded\n     */\n    virtual void loadIndex(FILE* stream) CV_OVERRIDE\n    {\n        nnIndex_->loadIndex(stream);\n    }\n\n    /**\n     * \\returns number of features in this index.\n     */\n    size_t veclen() const CV_OVERRIDE\n    {\n        return nnIndex_->veclen();\n    }\n\n    /**\n     * \\returns The dimensionality of the features in this index.\n     */\n    size_t size() const CV_OVERRIDE\n    {\n        return nnIndex_->size();\n    }\n\n    /**\n     * \\returns The index type (kdtree, kmeans,...)\n     */\n    flann_algorithm_t getType() const CV_OVERRIDE\n    {\n        return nnIndex_->getType();\n    }\n\n    /**\n     * \\returns The amount of memory (in bytes) used by the index.\n     */\n    virtual int usedMemory() const CV_OVERRIDE\n    {\n        return nnIndex_->usedMemory();\n    }\n\n\n    /**\n     * \\returns The index parameters\n     */\n    IndexParams getParameters() const CV_OVERRIDE\n    {\n        return nnIndex_->getParameters();\n    }\n\n    /**\n     * \\brief Perform k-nearest neighbor search\n     * \\param[in] queries The query points for which to find the nearest neighbors\n     * \\param[out] indices The indices of the nearest neighbors found\n     * \\param[out] dists Distances to the nearest neighbors found\n     * \\param[in] knn Number of nearest neighbors to return\n     * \\param[in] params Search parameters\n     */\n    void knnSearch(const Matrix<ElementType>& queries, Matrix<int>& indices, Matrix<DistanceType>& dists, int knn, const SearchParams& params) CV_OVERRIDE\n    {\n        nnIndex_->knnSearch(queries, indices, dists, knn, params);\n    }\n\n    /**\n     * \\brief Perform radius search\n     * \\param[in] query The query point\n     * \\param[out] indices The indinces of the neighbors found within the given radius\n     * \\param[out] dists The distances to the nearest neighbors found\n     * \\param[in] radius The radius used for search\n     * \\param[in] params Search parameters\n     * \\returns Number of neighbors found\n     */\n    int radiusSearch(const Matrix<ElementType>& query, Matrix<int>& indices, Matrix<DistanceType>& dists, float radius, const SearchParams& params) CV_OVERRIDE\n    {\n        return nnIndex_->radiusSearch(query, indices, dists, radius, params);\n    }\n\n    /**\n     * \\brief Method that searches for nearest-neighbours\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE\n    {\n        nnIndex_->findNeighbors(result, vec, searchParams);\n    }\n\n    /**\n     * \\brief Returns actual index\n     */\n    CV_DEPRECATED NNIndex<Distance>* getIndex()\n    {\n        return nnIndex_;\n    }\n\n    /**\n     * \\brief Returns index parameters.\n     * \\deprecated use getParameters() instead.\n     */\n    CV_DEPRECATED  const IndexParams* getIndexParameters()\n    {\n        return &index_params_;\n    }\n\nprivate:\n    /** Pointer to actual index class */\n    NNIndex<Distance>* nnIndex_;\n    /** Indices if the index was loaded from a file */\n    bool loaded_;\n    /** Parameters passed to the index */\n    IndexParams index_params_;\n\n    Index(const Index &); // copy disabled\n    Index& operator=(const Index &); // assign disabled\n};\n\n/**\n * Performs a hierarchical clustering of the points passed as argument and then takes a cut in the\n * the clustering tree to return a flat clustering.\n * @param[in] points Points to be clustered\n * @param centers The computed cluster centres. Matrix should be preallocated and centers.rows is the\n *  number of clusters requested.\n * @param params Clustering parameters (The same as for cvflann::KMeansIndex)\n * @param d Distance to be used for clustering (eg: cvflann::L2)\n * @return number of clusters computed (can be different than clusters.rows and is the highest number\n * of the form (branching-1)*K+1 smaller than clusters.rows).\n */\ntemplate <typename Distance>\nint hierarchicalClustering(const Matrix<typename Distance::ElementType>& points, Matrix<typename Distance::CentersType>& centers,\n                           const KMeansIndexParams& params, Distance d = Distance())\n{\n    KMeansIndex<Distance> kmeans(points, params, d);\n    kmeans.buildIndex();\n\n    int clusterNum = kmeans.getClusterCenters(centers);\n    return clusterNum;\n}\n\n}\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_BASE_HPP_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/general.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_GENERAL_H_\n#define OPENCV_FLANN_GENERAL_H_\n\n#if CV_VERSION_MAJOR <= 4\n\n//! @cond IGNORED\n\n#include \"opencv2/core.hpp\"\n\nnamespace cvflann\n{\n\nclass FLANNException : public cv::Exception\n{\npublic:\n    FLANNException(const char* message) : cv::Exception(0, message, \"\", __FILE__, __LINE__) { }\n\n    FLANNException(const cv::String& message) : cv::Exception(0, message, \"\", __FILE__, __LINE__) { }\n};\n\n}\n\n#define FLANN_THROW(TYPE, STR) throw FLANNException(STR)\n\n#else\n\n#define FLANN_THROW(TYPE, STR) CV_Error(TYPE, STR)\n\n#endif\n\n//! @endcond\n\n#endif  /* OPENCV_FLANN_GENERAL_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/ground_truth.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_GROUND_TRUTH_H_\n#define OPENCV_FLANN_GROUND_TRUTH_H_\n\n//! @cond IGNORED\n\n#include \"dist.h\"\n#include \"matrix.h\"\n\n\nnamespace cvflann\n{\n\ntemplate <typename Distance>\nvoid find_nearest(const Matrix<typename Distance::ElementType>& dataset, typename Distance::ElementType* query, int* matches, int nn,\n                  int skip = 0, Distance distance = Distance())\n{\n    typedef typename Distance::ResultType DistanceType;\n    int n = nn + skip;\n\n    std::vector<int> match(n);\n    std::vector<DistanceType> dists(n);\n\n    dists[0] = distance(dataset[0], query, dataset.cols);\n    match[0] = 0;\n    int dcnt = 1;\n\n    for (size_t i=1; i<dataset.rows; ++i) {\n        DistanceType tmp = distance(dataset[i], query, dataset.cols);\n\n        if (dcnt<n) {\n            match[dcnt] = (int)i;\n            dists[dcnt++] = tmp;\n        }\n        else if (tmp < dists[dcnt-1]) {\n            dists[dcnt-1] = tmp;\n            match[dcnt-1] = (int)i;\n        }\n\n        int j = dcnt-1;\n        // bubble up\n        while (j>=1 && dists[j]<dists[j-1]) {\n            std::swap(dists[j],dists[j-1]);\n            std::swap(match[j],match[j-1]);\n            j--;\n        }\n    }\n\n    for (int i=0; i<nn; ++i) {\n        matches[i] = match[i+skip];\n    }\n}\n\n\ntemplate <typename Distance>\nvoid compute_ground_truth(const Matrix<typename Distance::ElementType>& dataset, const Matrix<typename Distance::ElementType>& testset, Matrix<int>& matches,\n                          int skip=0, Distance d = Distance())\n{\n    for (size_t i=0; i<testset.rows; ++i) {\n        find_nearest<Distance>(dataset, testset[i], matches[i], (int)matches.cols, skip, d);\n    }\n}\n\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_GROUND_TRUTH_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/hdf5.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_HDF5_H_\n#define OPENCV_FLANN_HDF5_H_\n\n//! @cond IGNORED\n\n#include <hdf5.h>\n\n#include \"matrix.h\"\n\n\nnamespace cvflann\n{\n\nnamespace\n{\n\ntemplate<typename T>\nhid_t get_hdf5_type()\n{\n    throw FLANNException(\"Unsupported type for IO operations\");\n}\n\ntemplate<>\nhid_t get_hdf5_type<char>() { return H5T_NATIVE_CHAR; }\ntemplate<>\nhid_t get_hdf5_type<unsigned char>() { return H5T_NATIVE_UCHAR; }\ntemplate<>\nhid_t get_hdf5_type<short int>() { return H5T_NATIVE_SHORT; }\ntemplate<>\nhid_t get_hdf5_type<unsigned short int>() { return H5T_NATIVE_USHORT; }\ntemplate<>\nhid_t get_hdf5_type<int>() { return H5T_NATIVE_INT; }\ntemplate<>\nhid_t get_hdf5_type<unsigned int>() { return H5T_NATIVE_UINT; }\ntemplate<>\nhid_t get_hdf5_type<long>() { return H5T_NATIVE_LONG; }\ntemplate<>\nhid_t get_hdf5_type<unsigned long>() { return H5T_NATIVE_ULONG; }\ntemplate<>\nhid_t get_hdf5_type<float>() { return H5T_NATIVE_FLOAT; }\ntemplate<>\nhid_t get_hdf5_type<double>() { return H5T_NATIVE_DOUBLE; }\n}\n\n\n#define CHECK_ERROR(x,y) if ((x)<0) throw FLANNException((y));\n\ntemplate<typename T>\nvoid save_to_file(const cvflann::Matrix<T>& dataset, const String& filename, const String& name)\n{\n\n#if H5Eset_auto_vers == 2\n    H5Eset_auto( H5E_DEFAULT, NULL, NULL );\n#else\n    H5Eset_auto( NULL, NULL );\n#endif\n\n    herr_t status;\n    hid_t file_id;\n    file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, H5P_DEFAULT);\n    if (file_id < 0) {\n        file_id = H5Fcreate(filename.c_str(), H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT);\n    }\n    CHECK_ERROR(file_id,\"Error creating hdf5 file.\");\n\n    hsize_t     dimsf[2];              // dataset dimensions\n    dimsf[0] = dataset.rows;\n    dimsf[1] = dataset.cols;\n\n    hid_t space_id = H5Screate_simple(2, dimsf, NULL);\n    hid_t memspace_id = H5Screate_simple(2, dimsf, NULL);\n\n    hid_t dataset_id;\n#if H5Dcreate_vers == 2\n    dataset_id = H5Dcreate2(file_id, name.c_str(), get_hdf5_type<T>(), space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);\n#else\n    dataset_id = H5Dcreate(file_id, name.c_str(), get_hdf5_type<T>(), space_id, H5P_DEFAULT);\n#endif\n\n    if (dataset_id<0) {\n#if H5Dopen_vers == 2\n        dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT);\n#else\n        dataset_id = H5Dopen(file_id, name.c_str());\n#endif\n    }\n    CHECK_ERROR(dataset_id,\"Error creating or opening dataset in file.\");\n\n    status = H5Dwrite(dataset_id, get_hdf5_type<T>(), memspace_id, space_id, H5P_DEFAULT, dataset.data );\n    CHECK_ERROR(status, \"Error writing to dataset\");\n\n    H5Sclose(memspace_id);\n    H5Sclose(space_id);\n    H5Dclose(dataset_id);\n    H5Fclose(file_id);\n\n}\n\n\ntemplate<typename T>\nvoid load_from_file(cvflann::Matrix<T>& dataset, const String& filename, const String& name)\n{\n    herr_t status;\n    hid_t file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, H5P_DEFAULT);\n    CHECK_ERROR(file_id,\"Error opening hdf5 file.\");\n\n    hid_t dataset_id;\n#if H5Dopen_vers == 2\n    dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT);\n#else\n    dataset_id = H5Dopen(file_id, name.c_str());\n#endif\n    CHECK_ERROR(dataset_id,\"Error opening dataset in file.\");\n\n    hid_t space_id = H5Dget_space(dataset_id);\n\n    hsize_t dims_out[2];\n    H5Sget_simple_extent_dims(space_id, dims_out, NULL);\n\n    dataset = cvflann::Matrix<T>(new T[dims_out[0]*dims_out[1]], dims_out[0], dims_out[1]);\n\n    status = H5Dread(dataset_id, get_hdf5_type<T>(), H5S_ALL, H5S_ALL, H5P_DEFAULT, dataset[0]);\n    CHECK_ERROR(status, \"Error reading dataset\");\n\n    H5Sclose(space_id);\n    H5Dclose(dataset_id);\n    H5Fclose(file_id);\n}\n\n\n#ifdef HAVE_MPI\n\nnamespace mpi\n{\n/**\n * Loads a the hyperslice corresponding to this processor from a hdf5 file.\n * @param flann_dataset Dataset where the data is loaded\n * @param filename HDF5 file name\n * @param name Name of dataset inside file\n */\ntemplate<typename T>\nvoid load_from_file(cvflann::Matrix<T>& dataset, const String& filename, const String& name)\n{\n    MPI_Comm comm  = MPI_COMM_WORLD;\n    MPI_Info info  = MPI_INFO_NULL;\n\n    int mpi_size, mpi_rank;\n    MPI_Comm_size(comm, &mpi_size);\n    MPI_Comm_rank(comm, &mpi_rank);\n\n    herr_t status;\n\n    hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS);\n    H5Pset_fapl_mpio(plist_id, comm, info);\n    hid_t file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, plist_id);\n    CHECK_ERROR(file_id,\"Error opening hdf5 file.\");\n    H5Pclose(plist_id);\n    hid_t dataset_id;\n#if H5Dopen_vers == 2\n    dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT);\n#else\n    dataset_id = H5Dopen(file_id, name.c_str());\n#endif\n    CHECK_ERROR(dataset_id,\"Error opening dataset in file.\");\n\n    hid_t space_id = H5Dget_space(dataset_id);\n    hsize_t dims[2];\n    H5Sget_simple_extent_dims(space_id, dims, NULL);\n\n    hsize_t count[2];\n    hsize_t offset[2];\n\n    hsize_t item_cnt = dims[0]/mpi_size+(dims[0]%mpi_size==0 ? 0 : 1);\n    hsize_t cnt = (mpi_rank<mpi_size-1 ? item_cnt : dims[0]-item_cnt*(mpi_size-1));\n\n    count[0] = cnt;\n    count[1] = dims[1];\n    offset[0] = mpi_rank*item_cnt;\n    offset[1] = 0;\n\n    hid_t memspace_id = H5Screate_simple(2,count,NULL);\n\n    H5Sselect_hyperslab(space_id, H5S_SELECT_SET, offset, NULL, count, NULL);\n\n    dataset.rows = count[0];\n    dataset.cols = count[1];\n    dataset.data = new T[dataset.rows*dataset.cols];\n\n    plist_id = H5Pcreate(H5P_DATASET_XFER);\n    H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE);\n    status = H5Dread(dataset_id, get_hdf5_type<T>(), memspace_id, space_id, plist_id, dataset.data);\n    CHECK_ERROR(status, \"Error reading dataset\");\n\n    H5Pclose(plist_id);\n    H5Sclose(space_id);\n    H5Sclose(memspace_id);\n    H5Dclose(dataset_id);\n    H5Fclose(file_id);\n}\n}\n#endif // HAVE_MPI\n} // namespace cvflann::mpi\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_HDF5_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/heap.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_HEAP_H_\n#define OPENCV_FLANN_HEAP_H_\n\n//! @cond IGNORED\n\n#include <algorithm>\n#include <vector>\n\nnamespace cvflann\n{\n\n/**\n * Priority Queue Implementation\n *\n * The priority queue is implemented with a heap.  A heap is a complete\n * (full) binary tree in which each parent is less than both of its\n * children, but the order of the children is unspecified.\n */\ntemplate <typename T>\nclass Heap\n{\n\n    /**\n     * Storage array for the heap.\n     * Type T must be comparable.\n     */\n    std::vector<T> heap;\n    int length;\n\n    /**\n     * Number of element in the heap\n     */\n    int count;\n\n\n\npublic:\n    /**\n     * Constructor.\n     *\n     * Params:\n     *     sz = heap size\n     */\n\n    Heap(int sz)\n    {\n        length = sz;\n        heap.reserve(length);\n        count = 0;\n    }\n\n    /**\n     *\n     * Returns: heap size\n     */\n    int size()\n    {\n        return count;\n    }\n\n    /**\n     * Tests if the heap is empty\n     *\n     * Returns: true is heap empty, false otherwise\n     */\n    bool empty()\n    {\n        return size()==0;\n    }\n\n    /**\n     * Clears the heap.\n     */\n    void clear()\n    {\n        heap.clear();\n        count = 0;\n    }\n\n    struct CompareT\n    {\n        bool operator()(const T& t_1, const T& t_2) const\n        {\n            return t_2 < t_1;\n        }\n    };\n\n    /**\n     * Insert a new element in the heap.\n     *\n     * We select the next empty leaf node, and then keep moving any larger\n     * parents down until the right location is found to store this element.\n     *\n     * Params:\n     *     value = the new element to be inserted in the heap\n     */\n    void insert(T value)\n    {\n        /* If heap is full, then return without adding this element. */\n        if (count == length) {\n            return;\n        }\n\n        heap.push_back(value);\n        static CompareT compareT;\n        std::push_heap(heap.begin(), heap.end(), compareT);\n        ++count;\n    }\n\n\n\n    /**\n     * Returns the node of minimum value from the heap (top of the heap).\n     *\n     * Params:\n     *     value = out parameter used to return the min element\n     * Returns: false if heap empty\n     */\n    bool popMin(T& value)\n    {\n        if (count == 0) {\n            return false;\n        }\n\n        value = heap[0];\n        static CompareT compareT;\n        std::pop_heap(heap.begin(), heap.end(), compareT);\n        heap.pop_back();\n        --count;\n\n        return true;  /* Return old last node. */\n    }\n};\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_HEAP_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/hierarchical_clustering_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2011  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2011  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_\n#define OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_\n\n//! @cond IGNORED\n\n#include <algorithm>\n#include <map>\n#include <limits>\n#include <cmath>\n\n#include \"general.h\"\n#include \"nn_index.h\"\n#include \"dist.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n\n\nnamespace cvflann\n{\n\nstruct HierarchicalClusteringIndexParams : public IndexParams\n{\n    HierarchicalClusteringIndexParams(int branching = 32,\n                                      flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM,\n                                      int trees = 4, int leaf_size = 100)\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_HIERARCHICAL;\n        // The branching factor used in the hierarchical clustering\n        (*this)[\"branching\"] = branching;\n        // Algorithm used for picking the initial cluster centers\n        (*this)[\"centers_init\"] = centers_init;\n        // number of parallel trees to build\n        (*this)[\"trees\"] = trees;\n        // maximum leaf size\n        (*this)[\"leaf_size\"] = leaf_size;\n    }\n};\n\n\n/**\n * Hierarchical index\n *\n * Contains a tree constructed through a hierarchical clustering\n * and other information for indexing a set of points for nearest-neighbour matching.\n */\ntemplate <typename Distance>\nclass HierarchicalClusteringIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\nprivate:\n\n\n    typedef void (HierarchicalClusteringIndex::* centersAlgFunction)(int, int*, int, int*, int&);\n\n    /**\n     * The function used for choosing the cluster centers.\n     */\n    centersAlgFunction chooseCenters;\n\n\n\n    /**\n     * Chooses the initial centers in the k-means clustering in a random manner.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     *     indices_length = length of indices vector\n     *\n     */\n    void chooseCentersRandom(int k, int* dsindices, int indices_length, int* centers, int& centers_length)\n    {\n        UniqueRandom r(indices_length);\n\n        int index;\n        for (index=0; index<k; ++index) {\n            bool duplicate = true;\n            int rnd;\n            while (duplicate) {\n                duplicate = false;\n                rnd = r.next();\n                if (rnd<0) {\n                    centers_length = index;\n                    return;\n                }\n\n                centers[index] = dsindices[rnd];\n\n                for (int j=0; j<index; ++j) {\n                    DistanceType sq = distance(dataset[centers[index]], dataset[centers[j]], dataset.cols);\n                    if (sq<1e-16) {\n                        duplicate = true;\n                    }\n                }\n            }\n        }\n\n        centers_length = index;\n    }\n\n\n    /**\n     * Chooses the initial centers in the k-means using Gonzales' algorithm\n     * so that the centers are spaced apart from each other.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     * Returns:\n     */\n    void chooseCentersGonzales(int k, int* dsindices, int indices_length, int* centers, int& centers_length)\n    {\n        int n = indices_length;\n\n        int rnd = rand_int(n);\n        CV_DbgAssert(rnd >=0 && rnd < n);\n\n        centers[0] = dsindices[rnd];\n\n        int index;\n        for (index=1; index<k; ++index) {\n\n            int best_index = -1;\n            DistanceType best_val = 0;\n            for (int j=0; j<n; ++j) {\n                DistanceType dist = distance(dataset[centers[0]],dataset[dsindices[j]],dataset.cols);\n                for (int i=1; i<index; ++i) {\n                    DistanceType tmp_dist = distance(dataset[centers[i]],dataset[dsindices[j]],dataset.cols);\n                    if (tmp_dist<dist) {\n                        dist = tmp_dist;\n                    }\n                }\n                if (dist>best_val) {\n                    best_val = dist;\n                    best_index = j;\n                }\n            }\n            if (best_index!=-1) {\n                centers[index] = dsindices[best_index];\n            }\n            else {\n                break;\n            }\n        }\n        centers_length = index;\n    }\n\n\n    /**\n     * Chooses the initial centers in the k-means using the algorithm\n     * proposed in the KMeans++ paper:\n     * Arthur, David; Vassilvitskii, Sergei - k-means++: The Advantages of Careful Seeding\n     *\n     * Implementation of this function was converted from the one provided in Arthur's code.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     * Returns:\n     */\n    void chooseCentersKMeanspp(int k, int* dsindices, int indices_length, int* centers, int& centers_length)\n    {\n        int n = indices_length;\n\n        double currentPot = 0;\n        DistanceType* closestDistSq = new DistanceType[n];\n\n        // Choose one random center and set the closestDistSq values\n        int index = rand_int(n);\n        CV_DbgAssert(index >=0 && index < n);\n        centers[0] = dsindices[index];\n\n        // Computing distance^2 will have the advantage of even higher probability further to pick new centers\n        // far from previous centers (and this complies to \"k-means++: the advantages of careful seeding\" article)\n        for (int i = 0; i < n; i++) {\n            closestDistSq[i] = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols);\n            closestDistSq[i] = ensureSquareDistance<Distance>( closestDistSq[i] );\n            currentPot += closestDistSq[i];\n        }\n\n\n        const int numLocalTries = 1;\n\n        // Choose each center\n        int centerCount;\n        for (centerCount = 1; centerCount < k; centerCount++) {\n\n            // Repeat several trials\n            double bestNewPot = -1;\n            int bestNewIndex = 0;\n            for (int localTrial = 0; localTrial < numLocalTries; localTrial++) {\n\n                // Choose our center - have to be slightly careful to return a valid answer even accounting\n                // for possible rounding errors\n                double randVal = rand_double(currentPot);\n                for (index = 0; index < n-1; index++) {\n                    if (randVal <= closestDistSq[index]) break;\n                    else randVal -= closestDistSq[index];\n                }\n\n                // Compute the new potential\n                double newPot = 0;\n                for (int i = 0; i < n; i++) {\n                    DistanceType dist = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols);\n                    newPot += std::min( ensureSquareDistance<Distance>(dist), closestDistSq[i] );\n                }\n\n                // Store the best result\n                if ((bestNewPot < 0)||(newPot < bestNewPot)) {\n                    bestNewPot = newPot;\n                    bestNewIndex = index;\n                }\n            }\n\n            // Add the appropriate center\n            centers[centerCount] = dsindices[bestNewIndex];\n            currentPot = bestNewPot;\n            for (int i = 0; i < n; i++) {\n                DistanceType dist = distance(dataset[dsindices[i]], dataset[dsindices[bestNewIndex]], dataset.cols);\n                closestDistSq[i] = std::min( ensureSquareDistance<Distance>(dist), closestDistSq[i] );\n            }\n        }\n\n        centers_length = centerCount;\n\n        delete[] closestDistSq;\n    }\n\n\n    /**\n     * Chooses the initial centers in a way inspired by Gonzales (by Pierre-Emmanuel Viel):\n     * select the first point of the list as a candidate, then parse the points list. If another\n     * point is further than current candidate from the other centers, test if it is a good center\n     * of a local aggregation. If it is, replace current candidate by this point. And so on...\n     *\n     * Used with KMeansIndex that computes centers coordinates by averaging positions of clusters points,\n     * this doesn't make a real difference with previous methods. But used with HierarchicalClusteringIndex\n     * class that pick centers among existing points instead of computing the barycenters, there is a real\n     * improvement.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     * Returns:\n     */\n    void GroupWiseCenterChooser(int k, int* dsindices, int indices_length, int* centers, int& centers_length)\n    {\n        const float kSpeedUpFactor = 1.3f;\n\n        int n = indices_length;\n\n        DistanceType* closestDistSq = new DistanceType[n];\n\n        // Choose one random center and set the closestDistSq values\n        int index = rand_int(n);\n        CV_DbgAssert(index >=0 && index < n);\n        centers[0] = dsindices[index];\n\n        for (int i = 0; i < n; i++) {\n            closestDistSq[i] = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols);\n        }\n\n\n        // Choose each center\n        int centerCount;\n        for (centerCount = 1; centerCount < k; centerCount++) {\n\n            // Repeat several trials\n            double bestNewPot = -1;\n            int bestNewIndex = 0;\n            DistanceType furthest = 0;\n            for (index = 0; index < n; index++) {\n\n                // We will test only the potential of the points further than current candidate\n                if( closestDistSq[index] > kSpeedUpFactor * (float)furthest ) {\n\n                    // Compute the new potential\n                    double newPot = 0;\n                    for (int i = 0; i < n; i++) {\n                        newPot += std::min( distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols)\n                                            , closestDistSq[i] );\n                    }\n\n                    // Store the best result\n                    if ((bestNewPot < 0)||(newPot <= bestNewPot)) {\n                        bestNewPot = newPot;\n                        bestNewIndex = index;\n                        furthest = closestDistSq[index];\n                    }\n                }\n            }\n\n            // Add the appropriate center\n            centers[centerCount] = dsindices[bestNewIndex];\n            for (int i = 0; i < n; i++) {\n                closestDistSq[i] = std::min( distance(dataset[dsindices[i]], dataset[dsindices[bestNewIndex]], dataset.cols)\n                                             , closestDistSq[i] );\n            }\n        }\n\n        centers_length = centerCount;\n\n        delete[] closestDistSq;\n    }\n\n\npublic:\n\n\n    /**\n     * Index constructor\n     *\n     * Params:\n     *          inputData = dataset with the input features\n     *          params = parameters passed to the hierarchical k-means algorithm\n     */\n    HierarchicalClusteringIndex(const Matrix<ElementType>& inputData, const IndexParams& index_params = HierarchicalClusteringIndexParams(),\n                                Distance d = Distance())\n        : dataset(inputData), params(index_params), root(NULL), indices(NULL), distance(d)\n    {\n        memoryCounter = 0;\n\n        size_ = dataset.rows;\n        veclen_ = dataset.cols;\n\n        branching_ = get_param(params,\"branching\",32);\n        centers_init_ = get_param(params,\"centers_init\", FLANN_CENTERS_RANDOM);\n        trees_ = get_param(params,\"trees\",4);\n        leaf_size_ = get_param(params,\"leaf_size\",100);\n\n        if (centers_init_==FLANN_CENTERS_RANDOM) {\n            chooseCenters = &HierarchicalClusteringIndex::chooseCentersRandom;\n        }\n        else if (centers_init_==FLANN_CENTERS_GONZALES) {\n            chooseCenters = &HierarchicalClusteringIndex::chooseCentersGonzales;\n        }\n        else if (centers_init_==FLANN_CENTERS_KMEANSPP) {\n            chooseCenters = &HierarchicalClusteringIndex::chooseCentersKMeanspp;\n        }\n        else if (centers_init_==FLANN_CENTERS_GROUPWISE) {\n            chooseCenters = &HierarchicalClusteringIndex::GroupWiseCenterChooser;\n        }\n        else {\n            FLANN_THROW(cv::Error::StsError, \"Unknown algorithm for choosing initial centers.\");\n        }\n\n        root = new NodePtr[trees_];\n        indices = new int*[trees_];\n\n        for (int i=0; i<trees_; ++i) {\n            root[i] = NULL;\n            indices[i] = NULL;\n        }\n    }\n\n    HierarchicalClusteringIndex(const HierarchicalClusteringIndex&);\n    HierarchicalClusteringIndex& operator=(const HierarchicalClusteringIndex&);\n\n    /**\n     * Index destructor.\n     *\n     * Release the memory used by the index.\n     */\n    virtual ~HierarchicalClusteringIndex()\n    {\n        if (root!=NULL) {\n            delete[] root;\n        }\n\n        if (indices!=NULL) {\n            free_indices();\n            delete[] indices;\n        }\n    }\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const CV_OVERRIDE\n    {\n        return size_;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const CV_OVERRIDE\n    {\n        return veclen_;\n    }\n\n\n    /**\n     * Computes the inde memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const CV_OVERRIDE\n    {\n        return pool.usedMemory+pool.wastedMemory+memoryCounter;\n    }\n\n    /**\n     * Builds the index\n     */\n    void buildIndex() CV_OVERRIDE\n    {\n        if (branching_<2) {\n            FLANN_THROW(cv::Error::StsError, \"Branching factor must be at least 2\");\n        }\n\n        free_indices();\n\n        for (int i=0; i<trees_; ++i) {\n            indices[i] = new int[size_];\n            for (size_t j=0; j<size_; ++j) {\n                indices[i][j] = (int)j;\n            }\n            root[i] = pool.allocate<Node>();\n            computeClustering(root[i], indices[i], (int)size_, branching_,0);\n        }\n    }\n\n\n    flann_algorithm_t getType() const CV_OVERRIDE\n    {\n        return FLANN_INDEX_HIERARCHICAL;\n    }\n\n\n    void saveIndex(FILE* stream) CV_OVERRIDE\n    {\n        save_value(stream, branching_);\n        save_value(stream, trees_);\n        save_value(stream, centers_init_);\n        save_value(stream, leaf_size_);\n        save_value(stream, memoryCounter);\n        for (int i=0; i<trees_; ++i) {\n            save_value(stream, *indices[i], size_);\n            save_tree(stream, root[i], i);\n        }\n\n    }\n\n\n    void loadIndex(FILE* stream) CV_OVERRIDE\n    {\n        if (root!=NULL) {\n            delete[] root;\n        }\n\n        if (indices!=NULL) {\n            free_indices();\n            delete[] indices;\n        }\n\n        load_value(stream, branching_);\n        load_value(stream, trees_);\n        load_value(stream, centers_init_);\n        load_value(stream, leaf_size_);\n        load_value(stream, memoryCounter);\n\n        indices = new int*[trees_];\n        root = new NodePtr[trees_];\n        for (int i=0; i<trees_; ++i) {\n            indices[i] = new int[size_];\n            load_value(stream, *indices[i], size_);\n            load_tree(stream, root[i], i);\n        }\n\n        params[\"algorithm\"] = getType();\n        params[\"branching\"] = branching_;\n        params[\"trees\"] = trees_;\n        params[\"centers_init\"] = centers_init_;\n        params[\"leaf_size\"] = leaf_size_;\n    }\n\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     searchParams = parameters that influence the search algorithm (checks)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE\n    {\n\n        const int maxChecks = get_param(searchParams,\"checks\",32);\n        const bool explore_all_trees = get_param(searchParams,\"explore_all_trees\",false);\n\n        // Priority queue storing intermediate branches in the best-bin-first search\n        Heap<BranchSt>* heap = new Heap<BranchSt>((int)size_);\n\n        std::vector<bool> checked(size_,false);\n        int checks = 0;\n        for (int i=0; i<trees_; ++i) {\n            findNN(root[i], result, vec, checks, maxChecks, heap, checked, explore_all_trees);\n            if (!explore_all_trees && (checks >= maxChecks) && result.full())\n                break;\n        }\n\n        BranchSt branch;\n        while (heap->popMin(branch) && (checks<maxChecks || !result.full())) {\n            NodePtr node = branch.node;\n            findNN(node, result, vec, checks, maxChecks, heap, checked, false);\n        }\n\n        delete heap;\n\n        CV_Assert(result.full());\n    }\n\n    IndexParams getParameters() const CV_OVERRIDE\n    {\n        return params;\n    }\n\n\nprivate:\n\n    /**\n     * Structure representing a node in the hierarchical k-means tree.\n     */\n    struct Node\n    {\n        /**\n         * The cluster center index\n         */\n        int pivot;\n        /**\n         * The cluster size (number of points in the cluster)\n         */\n        int size;\n        /**\n         * Child nodes (only for non-terminal nodes)\n         */\n        Node** childs;\n        /**\n         * Node points (only for terminal nodes)\n         */\n        int* indices;\n        /**\n         * Level\n         */\n        int level;\n    };\n    typedef Node* NodePtr;\n\n\n\n    /**\n     * Alias definition for a nicer syntax.\n     */\n    typedef BranchStruct<NodePtr, DistanceType> BranchSt;\n\n\n\n    void save_tree(FILE* stream, NodePtr node, int num)\n    {\n        save_value(stream, *node);\n        if (node->childs==NULL) {\n            int indices_offset = (int)(node->indices - indices[num]);\n            save_value(stream, indices_offset);\n        }\n        else {\n            for(int i=0; i<branching_; ++i) {\n                save_tree(stream, node->childs[i], num);\n            }\n        }\n    }\n\n\n    void load_tree(FILE* stream, NodePtr& node, int num)\n    {\n        node = pool.allocate<Node>();\n        load_value(stream, *node);\n        if (node->childs==NULL) {\n            int indices_offset;\n            load_value(stream, indices_offset);\n            node->indices = indices[num] + indices_offset;\n        }\n        else {\n            node->childs = pool.allocate<NodePtr>(branching_);\n            for(int i=0; i<branching_; ++i) {\n                load_tree(stream, node->childs[i], num);\n            }\n        }\n    }\n\n\n    /**\n     * Release the inner elements of indices[]\n     */\n    void free_indices()\n    {\n        if (indices!=NULL) {\n            for(int i=0; i<trees_; ++i) {\n                if (indices[i]!=NULL) {\n                    delete[] indices[i];\n                    indices[i] = NULL;\n                }\n            }\n        }\n    }\n\n\n    void computeLabels(int* dsindices, int indices_length,  int* centers, int centers_length, int* labels, DistanceType& cost)\n    {\n        cost = 0;\n        for (int i=0; i<indices_length; ++i) {\n            ElementType* point = dataset[dsindices[i]];\n            DistanceType dist = distance(point, dataset[centers[0]], veclen_);\n            labels[i] = 0;\n            for (int j=1; j<centers_length; ++j) {\n                DistanceType new_dist = distance(point, dataset[centers[j]], veclen_);\n                if (dist>new_dist) {\n                    labels[i] = j;\n                    dist = new_dist;\n                }\n            }\n            cost += dist;\n        }\n    }\n\n    /**\n     * The method responsible with actually doing the recursive hierarchical\n     * clustering\n     *\n     * Params:\n     *     node = the node to cluster\n     *     indices = indices of the points belonging to the current node\n     *     branching = the branching factor to use in the clustering\n     *\n     * TODO: for 1-sized clusters don't store a cluster center (it's the same as the single cluster point)\n     */\n    void computeClustering(NodePtr node, int* dsindices, int indices_length, int branching, int level)\n    {\n        node->size = indices_length;\n        node->level = level;\n\n        if (indices_length < leaf_size_) { // leaf node\n            node->indices = dsindices;\n            std::sort(node->indices,node->indices+indices_length);\n            node->childs = NULL;\n            return;\n        }\n\n        std::vector<int> centers(branching);\n        std::vector<int> labels(indices_length);\n\n        int centers_length;\n        (this->*chooseCenters)(branching, dsindices, indices_length, &centers[0], centers_length);\n\n        if (centers_length<branching) {\n            node->indices = dsindices;\n            std::sort(node->indices,node->indices+indices_length);\n            node->childs = NULL;\n            return;\n        }\n\n\n        //\tassign points to clusters\n        DistanceType cost;\n        computeLabels(dsindices, indices_length, &centers[0], centers_length, &labels[0], cost);\n\n        node->childs = pool.allocate<NodePtr>(branching);\n        int start = 0;\n        int end = start;\n        for (int i=0; i<branching; ++i) {\n            for (int j=0; j<indices_length; ++j) {\n                if (labels[j]==i) {\n                    std::swap(dsindices[j],dsindices[end]);\n                    std::swap(labels[j],labels[end]);\n                    end++;\n                }\n            }\n\n            node->childs[i] = pool.allocate<Node>();\n            node->childs[i]->pivot = centers[i];\n            node->childs[i]->indices = NULL;\n            computeClustering(node->childs[i],dsindices+start, end-start, branching, level+1);\n            start=end;\n        }\n    }\n\n\n\n    /**\n     * Performs one descent in the hierarchical k-means tree. The branches not\n     * visited are stored in a priority queue.\n     *\n     * Params:\n     *      node = node to explore\n     *      result = container for the k-nearest neighbors found\n     *      vec = query points\n     *      checks = how many points in the dataset have been checked so far\n     *      maxChecks = maximum dataset points to checks\n     */\n\n\n    void findNN(NodePtr node, ResultSet<DistanceType>& result, const ElementType* vec, int& checks, int maxChecks,\n                Heap<BranchSt>* heap, std::vector<bool>& checked, bool explore_all_trees = false)\n    {\n        if (node->childs==NULL) {\n            if (!explore_all_trees && (checks>=maxChecks) && result.full()) {\n                return;\n            }\n            for (int i=0; i<node->size; ++i) {\n                int index = node->indices[i];\n                if (!checked[index]) {\n                    DistanceType dist = distance(dataset[index], vec, veclen_);\n                    result.addPoint(dist, index);\n                    checked[index] = true;\n                    ++checks;\n                }\n            }\n        }\n        else {\n            DistanceType* domain_distances = new DistanceType[branching_];\n            int best_index = 0;\n            domain_distances[best_index] = distance(vec, dataset[node->childs[best_index]->pivot], veclen_);\n            for (int i=1; i<branching_; ++i) {\n                domain_distances[i] = distance(vec, dataset[node->childs[i]->pivot], veclen_);\n                if (domain_distances[i]<domain_distances[best_index]) {\n                    best_index = i;\n                }\n            }\n            for (int i=0; i<branching_; ++i) {\n                if (i!=best_index) {\n                    heap->insert(BranchSt(node->childs[i],domain_distances[i]));\n                }\n            }\n            delete[] domain_distances;\n            findNN(node->childs[best_index],result,vec, checks, maxChecks, heap, checked, explore_all_trees);\n        }\n    }\n\nprivate:\n\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset;\n\n    /**\n     * Parameters used by this index\n     */\n    IndexParams params;\n\n\n    /**\n     * Number of features in the dataset.\n     */\n    size_t size_;\n\n    /**\n     * Length of each feature.\n     */\n    size_t veclen_;\n\n    /**\n     * The root node in the tree.\n     */\n    NodePtr* root;\n\n    /**\n     *  Array of indices to vectors in the dataset.\n     */\n    int** indices;\n\n\n    /**\n     * The distance\n     */\n    Distance distance;\n\n    /**\n     * Pooled memory allocator.\n     *\n     * Using a pooled memory allocator is more efficient\n     * than allocating memory directly when there is a large\n     * number small of memory allocations.\n     */\n    PooledAllocator pool;\n\n    /**\n     * Memory occupied by the index.\n     */\n    int memoryCounter;\n\n    /** index parameters */\n    int branching_;\n    int trees_;\n    flann_centers_init_t centers_init_;\n    int leaf_size_;\n\n\n};\n\n}\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/index_testing.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_INDEX_TESTING_H_\n#define OPENCV_FLANN_INDEX_TESTING_H_\n\n//! @cond IGNORED\n\n#include <cstring>\n#include <cmath>\n\n#include \"matrix.h\"\n#include \"nn_index.h\"\n#include \"result_set.h\"\n#include \"logger.h\"\n#include \"timer.h\"\n\n\nnamespace cvflann\n{\n\ninline int countCorrectMatches(int* neighbors, int* groundTruth, int n)\n{\n    int count = 0;\n    for (int i=0; i<n; ++i) {\n        for (int k=0; k<n; ++k) {\n            if (neighbors[i]==groundTruth[k]) {\n                count++;\n                break;\n            }\n        }\n    }\n    return count;\n}\n\n\ntemplate <typename Distance>\ntypename Distance::ResultType computeDistanceRaport(const Matrix<typename Distance::ElementType>& inputData, typename Distance::ElementType* target,\n                                                    int* neighbors, int* groundTruth, int veclen, int n, const Distance& distance)\n{\n    typedef typename Distance::ResultType DistanceType;\n\n    DistanceType ret = 0;\n    for (int i=0; i<n; ++i) {\n        DistanceType den = distance(inputData[groundTruth[i]], target, veclen);\n        DistanceType num = distance(inputData[neighbors[i]], target, veclen);\n\n        if ((den==0)&&(num==0)) {\n            ret += 1;\n        }\n        else {\n            ret += num/den;\n        }\n    }\n\n    return ret;\n}\n\ntemplate <typename Distance>\nfloat search_with_ground_truth(NNIndex<Distance>& index, const Matrix<typename Distance::ElementType>& inputData,\n                               const Matrix<typename Distance::ElementType>& testData, const Matrix<int>& matches, int nn, int checks,\n                               float& time, typename Distance::ResultType& dist, const Distance& distance, int skipMatches)\n{\n    typedef typename Distance::ResultType DistanceType;\n\n    if (matches.cols<size_t(nn)) {\n        Logger::info(\"matches.cols=%d, nn=%d\\n\",matches.cols,nn);\n\n        FLANN_THROW(cv::Error::StsError, \"Ground truth is not computed for as many neighbors as requested\");\n    }\n\n    KNNResultSet<DistanceType> resultSet(nn+skipMatches);\n    SearchParams searchParams(checks);\n\n    std::vector<int> indices(nn+skipMatches);\n    std::vector<DistanceType> dists(nn+skipMatches);\n    int* neighbors = &indices[skipMatches];\n\n    int correct = 0;\n    DistanceType distR = 0;\n    StartStopTimer t;\n    int repeats = 0;\n    while (t.value<0.2) {\n        repeats++;\n        t.start();\n        correct = 0;\n        distR = 0;\n        for (size_t i = 0; i < testData.rows; i++) {\n            resultSet.init(&indices[0], &dists[0]);\n            index.findNeighbors(resultSet, testData[i], searchParams);\n\n            correct += countCorrectMatches(neighbors,matches[i], nn);\n            distR += computeDistanceRaport<Distance>(inputData, testData[i], neighbors, matches[i], (int)testData.cols, nn, distance);\n        }\n        t.stop();\n    }\n    time = float(t.value/repeats);\n\n    float precicion = (float)correct/(nn*testData.rows);\n\n    dist = distR/(testData.rows*nn);\n\n    Logger::info(\"%8d %10.4g %10.5g %10.5g %10.5g\\n\",\n                 checks, precicion, time, 1000.0 * time / testData.rows, dist);\n\n    return precicion;\n}\n\n\ntemplate <typename Distance>\nfloat test_index_checks(NNIndex<Distance>& index, const Matrix<typename Distance::ElementType>& inputData,\n                        const Matrix<typename Distance::ElementType>& testData, const Matrix<int>& matches,\n                        int checks, float& precision, const Distance& distance, int nn = 1, int skipMatches = 0)\n{\n    typedef typename Distance::ResultType DistanceType;\n\n    Logger::info(\"  Nodes  Precision(%)   Time(s)   Time/vec(ms)  Mean dist\\n\");\n    Logger::info(\"---------------------------------------------------------\\n\");\n\n    float time = 0;\n    DistanceType dist = 0;\n    precision = search_with_ground_truth(index, inputData, testData, matches, nn, checks, time, dist, distance, skipMatches);\n\n    return time;\n}\n\ntemplate <typename Distance>\nfloat test_index_precision(NNIndex<Distance>& index, const Matrix<typename Distance::ElementType>& inputData,\n                           const Matrix<typename Distance::ElementType>& testData, const Matrix<int>& matches,\n                           float precision, int& checks, const Distance& distance, int nn = 1, int skipMatches = 0)\n{\n    typedef typename Distance::ResultType DistanceType;\n    const float SEARCH_EPS = 0.001f;\n\n    Logger::info(\"  Nodes  Precision(%)   Time(s)   Time/vec(ms)  Mean dist\\n\");\n    Logger::info(\"---------------------------------------------------------\\n\");\n\n    int c2 = 1;\n    float p2;\n    int c1 = 1;\n    //float p1;\n    float time;\n    DistanceType dist;\n\n    p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches);\n\n    if (p2>precision) {\n        Logger::info(\"Got as close as I can\\n\");\n        checks = c2;\n        return time;\n    }\n\n    while (p2<precision) {\n        c1 = c2;\n        //p1 = p2;\n        c2 *=2;\n        p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches);\n    }\n\n    int cx;\n    float realPrecision;\n    if (fabs(p2-precision)>SEARCH_EPS) {\n        Logger::info(\"Start linear estimation\\n\");\n        // after we got to values in the vecinity of the desired precision\n        // use linear approximation get a better estimation\n\n        cx = (c1+c2)/2;\n        realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches);\n        while (fabs(realPrecision-precision)>SEARCH_EPS) {\n\n            if (realPrecision<precision) {\n                c1 = cx;\n            }\n            else {\n                c2 = cx;\n            }\n            cx = (c1+c2)/2;\n            if (cx==c1) {\n                Logger::info(\"Got as close as I can\\n\");\n                break;\n            }\n            realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches);\n        }\n\n        c2 = cx;\n        p2 = realPrecision;\n\n    }\n    else {\n        Logger::info(\"No need for linear estimation\\n\");\n        cx = c2;\n        realPrecision = p2;\n    }\n\n    checks = cx;\n    return time;\n}\n\n\ntemplate <typename Distance>\nvoid test_index_precisions(NNIndex<Distance>& index, const Matrix<typename Distance::ElementType>& inputData,\n                           const Matrix<typename Distance::ElementType>& testData, const Matrix<int>& matches,\n                           float* precisions, int precisions_length, const Distance& distance, int nn = 1, int skipMatches = 0, float maxTime = 0)\n{\n    typedef typename Distance::ResultType DistanceType;\n\n    const float SEARCH_EPS = 0.001;\n\n    // make sure precisions array is sorted\n    std::sort(precisions, precisions+precisions_length);\n\n    int pindex = 0;\n    float precision = precisions[pindex];\n\n    Logger::info(\"  Nodes  Precision(%)   Time(s)   Time/vec(ms)  Mean dist\\n\");\n    Logger::info(\"---------------------------------------------------------\\n\");\n\n    int c2 = 1;\n    float p2;\n\n    int c1 = 1;\n    float p1;\n\n    float time;\n    DistanceType dist;\n\n    p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches);\n\n    // if precision for 1 run down the tree is already\n    // better then some of the requested precisions, then\n    // skip those\n    while (precisions[pindex]<p2 && pindex<precisions_length) {\n        pindex++;\n    }\n\n    if (pindex==precisions_length) {\n        Logger::info(\"Got as close as I can\\n\");\n        return;\n    }\n\n    for (int i=pindex; i<precisions_length; ++i) {\n\n        precision = precisions[i];\n        while (p2<precision) {\n            c1 = c2;\n            p1 = p2;\n            c2 *=2;\n            p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches);\n            if ((maxTime> 0)&&(time > maxTime)&&(p2<precision)) return;\n        }\n\n        int cx;\n        float realPrecision;\n        if (fabs(p2-precision)>SEARCH_EPS) {\n            Logger::info(\"Start linear estimation\\n\");\n            // after we got to values in the vecinity of the desired precision\n            // use linear approximation get a better estimation\n\n            cx = (c1+c2)/2;\n            realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches);\n            while (fabs(realPrecision-precision)>SEARCH_EPS) {\n\n                if (realPrecision<precision) {\n                    c1 = cx;\n                }\n                else {\n                    c2 = cx;\n                }\n                cx = (c1+c2)/2;\n                if (cx==c1) {\n                    Logger::info(\"Got as close as I can\\n\");\n                    break;\n                }\n                realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches);\n            }\n\n            c2 = cx;\n            p2 = realPrecision;\n\n        }\n        else {\n            Logger::info(\"No need for linear estimation\\n\");\n            cx = c2;\n            realPrecision = p2;\n        }\n\n    }\n}\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_INDEX_TESTING_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/kdtree_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_KDTREE_INDEX_H_\n#define OPENCV_FLANN_KDTREE_INDEX_H_\n\n//! @cond IGNORED\n\n#include <algorithm>\n#include <map>\n#include <cstring>\n\n#include \"nn_index.h\"\n#include \"dynamic_bitset.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n\n\nnamespace cvflann\n{\n\nstruct KDTreeIndexParams : public IndexParams\n{\n    KDTreeIndexParams(int trees = 4)\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_KDTREE;\n        (*this)[\"trees\"] = trees;\n    }\n};\n\n\n/**\n * Randomized kd-tree index\n *\n * Contains the k-d trees and other information for indexing a set of points\n * for nearest-neighbor matching.\n */\ntemplate <typename Distance>\nclass KDTreeIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n\n    /**\n     * KDTree constructor\n     *\n     * Params:\n     *          inputData = dataset with the input features\n     *          params = parameters passed to the kdtree algorithm\n     */\n    KDTreeIndex(const Matrix<ElementType>& inputData, const IndexParams& params = KDTreeIndexParams(),\n                Distance d = Distance() ) :\n        dataset_(inputData), index_params_(params), distance_(d)\n    {\n        size_ = dataset_.rows;\n        veclen_ = dataset_.cols;\n\n        trees_ = get_param(index_params_,\"trees\",4);\n        tree_roots_ = new NodePtr[trees_];\n\n        // Create a permutable array of indices to the input vectors.\n        vind_.resize(size_);\n        for (size_t i = 0; i < size_; ++i) {\n            vind_[i] = int(i);\n        }\n\n        mean_ = new DistanceType[veclen_];\n        var_ = new DistanceType[veclen_];\n    }\n\n\n    KDTreeIndex(const KDTreeIndex&);\n    KDTreeIndex& operator=(const KDTreeIndex&);\n\n    /**\n     * Standard destructor\n     */\n    ~KDTreeIndex()\n    {\n        if (tree_roots_!=NULL) {\n            delete[] tree_roots_;\n        }\n        delete[] mean_;\n        delete[] var_;\n    }\n\n    /**\n     * Builds the index\n     */\n    void buildIndex() CV_OVERRIDE\n    {\n        /* Construct the randomized trees. */\n        for (int i = 0; i < trees_; i++) {\n            /* Randomize the order of vectors to allow for unbiased sampling. */\n#ifndef OPENCV_FLANN_USE_STD_RAND\n            cv::randShuffle(vind_);\n#else\n            std::random_shuffle(vind_.begin(), vind_.end());\n#endif\n\n            tree_roots_[i] = divideTree(&vind_[0], int(size_) );\n        }\n    }\n\n\n    flann_algorithm_t getType() const CV_OVERRIDE\n    {\n        return FLANN_INDEX_KDTREE;\n    }\n\n\n    void saveIndex(FILE* stream) CV_OVERRIDE\n    {\n        save_value(stream, trees_);\n        for (int i=0; i<trees_; ++i) {\n            save_tree(stream, tree_roots_[i]);\n        }\n    }\n\n\n\n    void loadIndex(FILE* stream) CV_OVERRIDE\n    {\n        load_value(stream, trees_);\n        if (tree_roots_!=NULL) {\n            delete[] tree_roots_;\n        }\n        tree_roots_ = new NodePtr[trees_];\n        for (int i=0; i<trees_; ++i) {\n            load_tree(stream,tree_roots_[i]);\n        }\n\n        index_params_[\"algorithm\"] = getType();\n        index_params_[\"trees\"] = tree_roots_;\n    }\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const CV_OVERRIDE\n    {\n        return size_;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const CV_OVERRIDE\n    {\n        return veclen_;\n    }\n\n    /**\n     * Computes the inde memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const CV_OVERRIDE\n    {\n        return int(pool_.usedMemory+pool_.wastedMemory+dataset_.rows*sizeof(int));  // pool memory and vind array memory\n    }\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     maxCheck = the maximum number of restarts (in a best-bin-first manner)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE\n    {\n        const int maxChecks = get_param(searchParams,\"checks\", 32);\n        const float epsError = 1+get_param(searchParams,\"eps\",0.0f);\n        const bool explore_all_trees = get_param(searchParams,\"explore_all_trees\",false);\n\n        if (maxChecks==FLANN_CHECKS_UNLIMITED) {\n            getExactNeighbors(result, vec, epsError);\n        }\n        else {\n            getNeighbors(result, vec, maxChecks, epsError, explore_all_trees);\n        }\n    }\n\n    IndexParams getParameters() const CV_OVERRIDE\n    {\n        return index_params_;\n    }\n\nprivate:\n\n\n    /*--------------------- Internal Data Structures --------------------------*/\n    struct Node\n    {\n        /**\n         * Dimension used for subdivision.\n         */\n        int divfeat;\n        /**\n         * The values used for subdivision.\n         */\n        DistanceType divval;\n        /**\n         * The child nodes.\n         */\n        Node* child1, * child2;\n    };\n    typedef Node* NodePtr;\n    typedef BranchStruct<NodePtr, DistanceType> BranchSt;\n    typedef BranchSt* Branch;\n\n\n\n    void save_tree(FILE* stream, NodePtr tree)\n    {\n        save_value(stream, *tree);\n        if (tree->child1!=NULL) {\n            save_tree(stream, tree->child1);\n        }\n        if (tree->child2!=NULL) {\n            save_tree(stream, tree->child2);\n        }\n    }\n\n\n    void load_tree(FILE* stream, NodePtr& tree)\n    {\n        tree = pool_.allocate<Node>();\n        load_value(stream, *tree);\n        if (tree->child1!=NULL) {\n            load_tree(stream, tree->child1);\n        }\n        if (tree->child2!=NULL) {\n            load_tree(stream, tree->child2);\n        }\n    }\n\n\n    /**\n     * Create a tree node that subdivides the list of vecs from vind[first]\n     * to vind[last].  The routine is called recursively on each sublist.\n     * Place a pointer to this new tree node in the location pTree.\n     *\n     * Params: pTree = the new node to create\n     *                  first = index of the first vector\n     *                  last = index of the last vector\n     */\n    NodePtr divideTree(int* ind, int count)\n    {\n        NodePtr node = pool_.allocate<Node>(); // allocate memory\n\n        /* If too few exemplars remain, then make this a leaf node. */\n        if ( count == 1) {\n            node->child1 = node->child2 = NULL;    /* Mark as leaf node. */\n            node->divfeat = *ind;    /* Store index of this vec. */\n        }\n        else {\n            int idx;\n            int cutfeat;\n            DistanceType cutval;\n            meanSplit(ind, count, idx, cutfeat, cutval);\n\n            node->divfeat = cutfeat;\n            node->divval = cutval;\n            node->child1 = divideTree(ind, idx);\n            node->child2 = divideTree(ind+idx, count-idx);\n        }\n\n        return node;\n    }\n\n\n    /**\n     * Choose which feature to use in order to subdivide this set of vectors.\n     * Make a random choice among those with the highest variance, and use\n     * its variance as the threshold value.\n     */\n    void meanSplit(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval)\n    {\n        memset(mean_,0,veclen_*sizeof(DistanceType));\n        memset(var_,0,veclen_*sizeof(DistanceType));\n\n        /* Compute mean values.  Only the first SAMPLE_MEAN values need to be\n            sampled to get a good estimate.\n         */\n        int cnt = std::min((int)SAMPLE_MEAN+1, count);\n        for (int j = 0; j < cnt; ++j) {\n            ElementType* v = dataset_[ind[j]];\n            for (size_t k=0; k<veclen_; ++k) {\n                mean_[k] += v[k];\n            }\n        }\n        for (size_t k=0; k<veclen_; ++k) {\n            mean_[k] /= cnt;\n        }\n\n        /* Compute variances (no need to divide by count). */\n        for (int j = 0; j < cnt; ++j) {\n            ElementType* v = dataset_[ind[j]];\n            for (size_t k=0; k<veclen_; ++k) {\n                DistanceType dist = v[k] - mean_[k];\n                var_[k] += dist * dist;\n            }\n        }\n        /* Select one of the highest variance indices at random. */\n        cutfeat = selectDivision(var_);\n        cutval = mean_[cutfeat];\n\n        int lim1, lim2;\n        planeSplit(ind, count, cutfeat, cutval, lim1, lim2);\n\n        if (lim1>count/2) index = lim1;\n        else if (lim2<count/2) index = lim2;\n        else index = count/2;\n\n        /* If either list is empty, it means that all remaining features\n         * are identical. Split in the middle to maintain a balanced tree.\n         */\n        if ((lim1==count)||(lim2==0)) index = count/2;\n    }\n\n\n    /**\n     * Select the top RAND_DIM largest values from v and return the index of\n     * one of these selected at random.\n     */\n    int selectDivision(DistanceType* v)\n    {\n        int num = 0;\n        size_t topind[RAND_DIM];\n\n        /* Create a list of the indices of the top RAND_DIM values. */\n        for (size_t i = 0; i < veclen_; ++i) {\n            if ((num < RAND_DIM)||(v[i] > v[topind[num-1]])) {\n                /* Put this element at end of topind. */\n                if (num < RAND_DIM) {\n                    topind[num++] = i;            /* Add to list. */\n                }\n                else {\n                    topind[num-1] = i;         /* Replace last element. */\n                }\n                /* Bubble end value down to right location by repeated swapping. */\n                int j = num - 1;\n                while (j > 0  &&  v[topind[j]] > v[topind[j-1]]) {\n                    std::swap(topind[j], topind[j-1]);\n                    --j;\n                }\n            }\n        }\n        /* Select a random integer in range [0,num-1], and return that index. */\n        int rnd = rand_int(num);\n        return (int)topind[rnd];\n    }\n\n\n    /**\n     *  Subdivide the list of points by a plane perpendicular on axe corresponding\n     *  to the 'cutfeat' dimension at 'cutval' position.\n     *\n     *  On return:\n     *  dataset[ind[0..lim1-1]][cutfeat]<cutval\n     *  dataset[ind[lim1..lim2-1]][cutfeat]==cutval\n     *  dataset[ind[lim2..count]][cutfeat]>cutval\n     */\n    void planeSplit(int* ind, int count, int cutfeat, DistanceType cutval, int& lim1, int& lim2)\n    {\n        /* Move vector indices for left subtree to front of list. */\n        int left = 0;\n        int right = count-1;\n        for (;; ) {\n            while (left<=right && dataset_[ind[left]][cutfeat]<cutval) ++left;\n            while (left<=right && dataset_[ind[right]][cutfeat]>=cutval) --right;\n            if (left>right) break;\n            std::swap(ind[left], ind[right]); ++left; --right;\n        }\n        lim1 = left;\n        right = count-1;\n        for (;; ) {\n            while (left<=right && dataset_[ind[left]][cutfeat]<=cutval) ++left;\n            while (left<=right && dataset_[ind[right]][cutfeat]>cutval) --right;\n            if (left>right) break;\n            std::swap(ind[left], ind[right]); ++left; --right;\n        }\n        lim2 = left;\n    }\n\n    /**\n     * Performs an exact nearest neighbor search. The exact search performs a full\n     * traversal of the tree.\n     */\n    void getExactNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, float epsError)\n    {\n        //\t\tcheckID -= 1;  /* Set a different unique ID for each search. */\n\n        if (trees_ > 1) {\n            fprintf(stderr,\"It doesn't make any sense to use more than one tree for exact search\");\n        }\n        if (trees_>0) {\n            searchLevelExact(result, vec, tree_roots_[0], 0.0, epsError);\n        }\n        CV_Assert(result.full());\n    }\n\n    /**\n     * Performs the approximate nearest-neighbor search. The search is approximate\n     * because the tree traversal is abandoned after a given number of descends in\n     * the tree.\n     */\n    void getNeighbors(ResultSet<DistanceType>& result, const ElementType* vec,\n                      int maxCheck, float epsError, bool explore_all_trees = false)\n    {\n        int i;\n        BranchSt branch;\n\n        int checkCount = 0;\n        Heap<BranchSt>* heap = new Heap<BranchSt>((int)size_);\n        DynamicBitset checked(size_);\n\n        /* Search once through each tree down to root. */\n        for (i = 0; i < trees_; ++i) {\n            searchLevel(result, vec, tree_roots_[i], 0, checkCount, maxCheck,\n                        epsError, heap, checked, explore_all_trees);\n            if (!explore_all_trees && (checkCount >= maxCheck) && result.full())\n                break;\n        }\n\n        /* Keep searching other branches from heap until finished. */\n        while ( heap->popMin(branch) && (checkCount < maxCheck || !result.full() )) {\n            searchLevel(result, vec, branch.node, branch.mindist, checkCount, maxCheck,\n                        epsError, heap, checked, false);\n        }\n\n        delete heap;\n\n        CV_Assert(result.full());\n    }\n\n\n    /**\n     *  Search starting from a given node of the tree.  Based on any mismatches at\n     *  higher levels, all exemplars below this level must have a distance of\n     *  at least \"mindistsq\".\n     */\n    void searchLevel(ResultSet<DistanceType>& result_set, const ElementType* vec, NodePtr node, DistanceType mindist, int& checkCount, int maxCheck,\n                     float epsError, Heap<BranchSt>* heap, DynamicBitset& checked, bool explore_all_trees = false)\n    {\n        if (result_set.worstDist()<mindist) {\n            //\t\t\tprintf(\"Ignoring branch, too far\\n\");\n            return;\n        }\n\n        /* If this is a leaf node, then do check and return. */\n        if ((node->child1 == NULL)&&(node->child2 == NULL)) {\n            /*  Do not check same node more than once when searching multiple trees.\n                Once a vector is checked, we set its location in vind to the\n                current checkID.\n             */\n            int index = node->divfeat;\n            if ( checked.test(index) ||\n                 (!explore_all_trees && (checkCount>=maxCheck) && result_set.full()) ) {\n                return;\n            }\n            checked.set(index);\n            checkCount++;\n\n            DistanceType dist = distance_(dataset_[index], vec, veclen_);\n            result_set.addPoint(dist,index);\n\n            return;\n        }\n\n        /* Which child branch should be taken first? */\n        ElementType val = vec[node->divfeat];\n        DistanceType diff = val - node->divval;\n        NodePtr bestChild = (diff < 0) ? node->child1 : node->child2;\n        NodePtr otherChild = (diff < 0) ? node->child2 : node->child1;\n\n        /* Create a branch record for the branch not taken.  Add distance\n            of this feature boundary (we don't attempt to correct for any\n            use of this feature in a parent node, which is unlikely to\n            happen and would have only a small effect).  Don't bother\n            adding more branches to heap after halfway point, as cost of\n            adding exceeds their value.\n         */\n\n        DistanceType new_distsq = mindist + distance_.accum_dist(val, node->divval, node->divfeat);\n        //\t\tif (2 * checkCount < maxCheck  ||  !result.full()) {\n        if ((new_distsq*epsError < result_set.worstDist())||  !result_set.full()) {\n            heap->insert( BranchSt(otherChild, new_distsq) );\n        }\n\n        /* Call recursively to search next level down. */\n        searchLevel(result_set, vec, bestChild, mindist, checkCount, maxCheck, epsError, heap, checked);\n    }\n\n    /**\n     * Performs an exact search in the tree starting from a node.\n     */\n    void searchLevelExact(ResultSet<DistanceType>& result_set, const ElementType* vec, const NodePtr node, DistanceType mindist, const float epsError)\n    {\n        /* If this is a leaf node, then do check and return. */\n        if ((node->child1 == NULL)&&(node->child2 == NULL)) {\n            int index = node->divfeat;\n            DistanceType dist = distance_(dataset_[index], vec, veclen_);\n            result_set.addPoint(dist,index);\n            return;\n        }\n\n        /* Which child branch should be taken first? */\n        ElementType val = vec[node->divfeat];\n        DistanceType diff = val - node->divval;\n        NodePtr bestChild = (diff < 0) ? node->child1 : node->child2;\n        NodePtr otherChild = (diff < 0) ? node->child2 : node->child1;\n\n        /* Create a branch record for the branch not taken.  Add distance\n            of this feature boundary (we don't attempt to correct for any\n            use of this feature in a parent node, which is unlikely to\n            happen and would have only a small effect).  Don't bother\n            adding more branches to heap after halfway point, as cost of\n            adding exceeds their value.\n         */\n\n        DistanceType new_distsq = mindist + distance_.accum_dist(val, node->divval, node->divfeat);\n\n        /* Call recursively to search next level down. */\n        searchLevelExact(result_set, vec, bestChild, mindist, epsError);\n\n        if (new_distsq*epsError<=result_set.worstDist()) {\n            searchLevelExact(result_set, vec, otherChild, new_distsq, epsError);\n        }\n    }\n\n\nprivate:\n\n    enum\n    {\n        /**\n         * To improve efficiency, only SAMPLE_MEAN random values are used to\n         * compute the mean and variance at each level when building a tree.\n         * A value of 100 seems to perform as well as using all values.\n         */\n        SAMPLE_MEAN = 100,\n        /**\n         * Top random dimensions to consider\n         *\n         * When creating random trees, the dimension on which to subdivide is\n         * selected at random from among the top RAND_DIM dimensions with the\n         * highest variance.  A value of 5 works well.\n         */\n        RAND_DIM=5\n    };\n\n\n    /**\n     * Number of randomized trees that are used\n     */\n    int trees_;\n\n    /**\n     *  Array of indices to vectors in the dataset.\n     */\n    std::vector<int> vind_;\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset_;\n\n    IndexParams index_params_;\n\n    size_t size_;\n    size_t veclen_;\n\n\n    DistanceType* mean_;\n    DistanceType* var_;\n\n\n    /**\n     * Array of k-d trees used to find neighbours.\n     */\n    NodePtr* tree_roots_;\n\n    /**\n     * Pooled memory allocator.\n     *\n     * Using a pooled memory allocator is more efficient\n     * than allocating memory directly when there is a large\n     * number small of memory allocations.\n     */\n    PooledAllocator pool_;\n\n    Distance distance_;\n\n\n};   // class KDTreeForest\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_KDTREE_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/kdtree_single_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_\n#define OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_\n\n//! @cond IGNORED\n\n#include <algorithm>\n#include <map>\n#include <cstring>\n\n#include \"nn_index.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n\nnamespace cvflann\n{\n\nstruct KDTreeSingleIndexParams : public IndexParams\n{\n    KDTreeSingleIndexParams(int leaf_max_size = 10, bool reorder = true, int dim = -1)\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_KDTREE_SINGLE;\n        (*this)[\"leaf_max_size\"] = leaf_max_size;\n        (*this)[\"reorder\"] = reorder;\n        (*this)[\"dim\"] = dim;\n    }\n};\n\n\n/**\n * Randomized kd-tree index\n *\n * Contains the k-d trees and other information for indexing a set of points\n * for nearest-neighbor matching.\n */\ntemplate <typename Distance>\nclass KDTreeSingleIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n\n    /**\n     * KDTree constructor\n     *\n     * Params:\n     *          inputData = dataset with the input features\n     *          params = parameters passed to the kdtree algorithm\n     */\n    KDTreeSingleIndex(const Matrix<ElementType>& inputData, const IndexParams& params = KDTreeSingleIndexParams(),\n                      Distance d = Distance() ) :\n        dataset_(inputData), index_params_(params), distance_(d)\n    {\n        size_ = dataset_.rows;\n        dim_ = dataset_.cols;\n        root_node_ = 0;\n        int dim_param = get_param(params,\"dim\",-1);\n        if (dim_param>0) dim_ = dim_param;\n        leaf_max_size_ = get_param(params,\"leaf_max_size\",10);\n        reorder_ = get_param(params,\"reorder\",true);\n\n        // Create a permutable array of indices to the input vectors.\n        vind_.resize(size_);\n        for (size_t i = 0; i < size_; i++) {\n            vind_[i] = (int)i;\n        }\n    }\n\n    KDTreeSingleIndex(const KDTreeSingleIndex&);\n    KDTreeSingleIndex& operator=(const KDTreeSingleIndex&);\n\n    /**\n     * Standard destructor\n     */\n    ~KDTreeSingleIndex()\n    {\n        if (reorder_) delete[] data_.data;\n    }\n\n    /**\n     * Builds the index\n     */\n    void buildIndex() CV_OVERRIDE\n    {\n        computeBoundingBox(root_bbox_);\n        root_node_ = divideTree(0, (int)size_, root_bbox_ );   // construct the tree\n\n        if (reorder_) {\n            delete[] data_.data;\n            data_ = cvflann::Matrix<ElementType>(new ElementType[size_*dim_], size_, dim_);\n            for (size_t i=0; i<size_; ++i) {\n                for (size_t j=0; j<dim_; ++j) {\n                    data_[i][j] = dataset_[vind_[i]][j];\n                }\n            }\n        }\n        else {\n            data_ = dataset_;\n        }\n    }\n\n    flann_algorithm_t getType() const CV_OVERRIDE\n    {\n        return FLANN_INDEX_KDTREE_SINGLE;\n    }\n\n\n    void saveIndex(FILE* stream) CV_OVERRIDE\n    {\n        save_value(stream, size_);\n        save_value(stream, dim_);\n        save_value(stream, root_bbox_);\n        save_value(stream, reorder_);\n        save_value(stream, leaf_max_size_);\n        save_value(stream, vind_);\n        if (reorder_) {\n            save_value(stream, data_);\n        }\n        save_tree(stream, root_node_);\n    }\n\n\n    void loadIndex(FILE* stream) CV_OVERRIDE\n    {\n        load_value(stream, size_);\n        load_value(stream, dim_);\n        load_value(stream, root_bbox_);\n        load_value(stream, reorder_);\n        load_value(stream, leaf_max_size_);\n        load_value(stream, vind_);\n        if (reorder_) {\n            load_value(stream, data_);\n        }\n        else {\n            data_ = dataset_;\n        }\n        load_tree(stream, root_node_);\n\n\n        index_params_[\"algorithm\"] = getType();\n        index_params_[\"leaf_max_size\"] = leaf_max_size_;\n        index_params_[\"reorder\"] = reorder_;\n    }\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const CV_OVERRIDE\n    {\n        return size_;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const CV_OVERRIDE\n    {\n        return dim_;\n    }\n\n    /**\n     * Computes the inde memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const CV_OVERRIDE\n    {\n        return (int)(pool_.usedMemory+pool_.wastedMemory+dataset_.rows*sizeof(int));  // pool memory and vind array memory\n    }\n\n\n    /**\n     * \\brief Perform k-nearest neighbor search\n     * \\param[in] queries The query points for which to find the nearest neighbors\n     * \\param[out] indices The indices of the nearest neighbors found\n     * \\param[out] dists Distances to the nearest neighbors found\n     * \\param[in] knn Number of nearest neighbors to return\n     * \\param[in] params Search parameters\n     */\n    void knnSearch(const Matrix<ElementType>& queries, Matrix<int>& indices, Matrix<DistanceType>& dists, int knn, const SearchParams& params) CV_OVERRIDE\n    {\n        CV_Assert(queries.cols == veclen());\n        CV_Assert(indices.rows >= queries.rows);\n        CV_Assert(dists.rows >= queries.rows);\n        CV_Assert(int(indices.cols) >= knn);\n        CV_Assert(int(dists.cols) >= knn);\n\n        KNNSimpleResultSet<DistanceType> resultSet(knn);\n        for (size_t i = 0; i < queries.rows; i++) {\n            resultSet.init(indices[i], dists[i]);\n            findNeighbors(resultSet, queries[i], params);\n        }\n    }\n\n    IndexParams getParameters() const CV_OVERRIDE\n    {\n        return index_params_;\n    }\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     maxCheck = the maximum number of restarts (in a best-bin-first manner)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE\n    {\n        float epsError = 1+get_param(searchParams,\"eps\",0.0f);\n\n        std::vector<DistanceType> dists(dim_,0);\n        DistanceType distsq = computeInitialDistances(vec, dists);\n        searchLevel(result, vec, root_node_, distsq, dists, epsError);\n    }\n\nprivate:\n\n\n    /*--------------------- Internal Data Structures --------------------------*/\n    struct Node\n    {\n        /**\n         * Indices of points in leaf node\n         */\n        int left, right;\n        /**\n         * Dimension used for subdivision.\n         */\n        int divfeat;\n        /**\n         * The values used for subdivision.\n         */\n        DistanceType divlow, divhigh;\n        /**\n         * The child nodes.\n         */\n        Node* child1, * child2;\n    };\n    typedef Node* NodePtr;\n\n\n    struct Interval\n    {\n        DistanceType low, high;\n    };\n\n    typedef std::vector<Interval> BoundingBox;\n\n    typedef BranchStruct<NodePtr, DistanceType> BranchSt;\n    typedef BranchSt* Branch;\n\n\n\n\n    void save_tree(FILE* stream, NodePtr tree)\n    {\n        save_value(stream, *tree);\n        if (tree->child1!=NULL) {\n            save_tree(stream, tree->child1);\n        }\n        if (tree->child2!=NULL) {\n            save_tree(stream, tree->child2);\n        }\n    }\n\n\n    void load_tree(FILE* stream, NodePtr& tree)\n    {\n        tree = pool_.allocate<Node>();\n        load_value(stream, *tree);\n        if (tree->child1!=NULL) {\n            load_tree(stream, tree->child1);\n        }\n        if (tree->child2!=NULL) {\n            load_tree(stream, tree->child2);\n        }\n    }\n\n\n    void computeBoundingBox(BoundingBox& bbox)\n    {\n        bbox.resize(dim_);\n        for (size_t i=0; i<dim_; ++i) {\n            bbox[i].low = (DistanceType)dataset_[0][i];\n            bbox[i].high = (DistanceType)dataset_[0][i];\n        }\n        for (size_t k=1; k<dataset_.rows; ++k) {\n            for (size_t i=0; i<dim_; ++i) {\n                if (dataset_[k][i]<bbox[i].low) bbox[i].low = (DistanceType)dataset_[k][i];\n                if (dataset_[k][i]>bbox[i].high) bbox[i].high = (DistanceType)dataset_[k][i];\n            }\n        }\n    }\n\n\n    /**\n     * Create a tree node that subdivides the list of vecs from vind[first]\n     * to vind[last].  The routine is called recursively on each sublist.\n     * Place a pointer to this new tree node in the location pTree.\n     *\n     * Params: pTree = the new node to create\n     *                  first = index of the first vector\n     *                  last = index of the last vector\n     */\n    NodePtr divideTree(int left, int right, BoundingBox& bbox)\n    {\n        NodePtr node = pool_.allocate<Node>(); // allocate memory\n\n        /* If too few exemplars remain, then make this a leaf node. */\n        if ( (right-left) <= leaf_max_size_) {\n            node->child1 = node->child2 = NULL;    /* Mark as leaf node. */\n            node->left = left;\n            node->right = right;\n\n            // compute bounding-box of leaf points\n            for (size_t i=0; i<dim_; ++i) {\n                bbox[i].low = (DistanceType)dataset_[vind_[left]][i];\n                bbox[i].high = (DistanceType)dataset_[vind_[left]][i];\n            }\n            for (int k=left+1; k<right; ++k) {\n                for (size_t i=0; i<dim_; ++i) {\n                    if (bbox[i].low>dataset_[vind_[k]][i]) bbox[i].low=(DistanceType)dataset_[vind_[k]][i];\n                    if (bbox[i].high<dataset_[vind_[k]][i]) bbox[i].high=(DistanceType)dataset_[vind_[k]][i];\n                }\n            }\n        }\n        else {\n            int idx;\n            int cutfeat;\n            DistanceType cutval;\n            middleSplit_(&vind_[0]+left, right-left, idx, cutfeat, cutval, bbox);\n\n            node->divfeat = cutfeat;\n\n            BoundingBox left_bbox(bbox);\n            left_bbox[cutfeat].high = cutval;\n            node->child1 = divideTree(left, left+idx, left_bbox);\n\n            BoundingBox right_bbox(bbox);\n            right_bbox[cutfeat].low = cutval;\n            node->child2 = divideTree(left+idx, right, right_bbox);\n\n            node->divlow = left_bbox[cutfeat].high;\n            node->divhigh = right_bbox[cutfeat].low;\n\n            for (size_t i=0; i<dim_; ++i) {\n                bbox[i].low = std::min(left_bbox[i].low, right_bbox[i].low);\n                bbox[i].high = std::max(left_bbox[i].high, right_bbox[i].high);\n            }\n        }\n\n        return node;\n    }\n\n    void computeMinMax(int* ind, int count, int dim, ElementType& min_elem, ElementType& max_elem)\n    {\n        min_elem = dataset_[ind[0]][dim];\n        max_elem = dataset_[ind[0]][dim];\n        for (int i=1; i<count; ++i) {\n            ElementType val = dataset_[ind[i]][dim];\n            if (val<min_elem) min_elem = val;\n            if (val>max_elem) max_elem = val;\n        }\n    }\n\n    void middleSplit(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval, const BoundingBox& bbox)\n    {\n        // find the largest span from the approximate bounding box\n        ElementType max_span = bbox[0].high-bbox[0].low;\n        cutfeat = 0;\n        cutval = (bbox[0].high+bbox[0].low)/2;\n        for (size_t i=1; i<dim_; ++i) {\n            ElementType span = bbox[i].high-bbox[i].low;\n            if (span>max_span) {\n                max_span = span;\n                cutfeat = i;\n                cutval = (bbox[i].high+bbox[i].low)/2;\n            }\n        }\n\n        // compute exact span on the found dimension\n        ElementType min_elem, max_elem;\n        computeMinMax(ind, count, cutfeat, min_elem, max_elem);\n        cutval = (min_elem+max_elem)/2;\n        max_span = max_elem - min_elem;\n\n        // check if a dimension of a largest span exists\n        size_t k = cutfeat;\n        for (size_t i=0; i<dim_; ++i) {\n            if (i==k) continue;\n            ElementType span = bbox[i].high-bbox[i].low;\n            if (span>max_span) {\n                computeMinMax(ind, count, i, min_elem, max_elem);\n                span = max_elem - min_elem;\n                if (span>max_span) {\n                    max_span = span;\n                    cutfeat = i;\n                    cutval = (min_elem+max_elem)/2;\n                }\n            }\n        }\n        int lim1, lim2;\n        planeSplit(ind, count, cutfeat, cutval, lim1, lim2);\n\n        if (lim1>count/2) index = lim1;\n        else if (lim2<count/2) index = lim2;\n        else index = count/2;\n    }\n\n\n    void middleSplit_(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval, const BoundingBox& bbox)\n    {\n        const float EPS=0.00001f;\n        DistanceType max_span = bbox[0].high-bbox[0].low;\n        for (size_t i=1; i<dim_; ++i) {\n            DistanceType span = bbox[i].high-bbox[i].low;\n            if (span>max_span) {\n                max_span = span;\n            }\n        }\n        DistanceType max_spread = -1;\n        cutfeat = 0;\n        for (size_t i=0; i<dim_; ++i) {\n            DistanceType span = bbox[i].high-bbox[i].low;\n            if (span>(DistanceType)((1-EPS)*max_span)) {\n                ElementType min_elem, max_elem;\n                computeMinMax(ind, count, (int)i, min_elem, max_elem);\n                DistanceType spread = (DistanceType)(max_elem-min_elem);\n                if (spread>max_spread) {\n                    cutfeat = (int)i;\n                    max_spread = spread;\n                }\n            }\n        }\n        // split in the middle\n        DistanceType split_val = (bbox[cutfeat].low+bbox[cutfeat].high)/2;\n        ElementType min_elem, max_elem;\n        computeMinMax(ind, count, cutfeat, min_elem, max_elem);\n\n        if (split_val<min_elem) cutval = (DistanceType)min_elem;\n        else if (split_val>max_elem) cutval = (DistanceType)max_elem;\n        else cutval = split_val;\n\n        int lim1, lim2;\n        planeSplit(ind, count, cutfeat, cutval, lim1, lim2);\n\n        if (lim1>count/2) index = lim1;\n        else if (lim2<count/2) index = lim2;\n        else index = count/2;\n    }\n\n\n    /**\n     *  Subdivide the list of points by a plane perpendicular on axe corresponding\n     *  to the 'cutfeat' dimension at 'cutval' position.\n     *\n     *  On return:\n     *  dataset[ind[0..lim1-1]][cutfeat]<cutval\n     *  dataset[ind[lim1..lim2-1]][cutfeat]==cutval\n     *  dataset[ind[lim2..count]][cutfeat]>cutval\n     */\n    void planeSplit(int* ind, int count, int cutfeat, DistanceType cutval, int& lim1, int& lim2)\n    {\n        /* Move vector indices for left subtree to front of list. */\n        int left = 0;\n        int right = count-1;\n        for (;; ) {\n            while (left<=right && dataset_[ind[left]][cutfeat]<cutval) ++left;\n            while (left<=right && dataset_[ind[right]][cutfeat]>=cutval) --right;\n            if (left>right) break;\n            std::swap(ind[left], ind[right]); ++left; --right;\n        }\n        /* If either list is empty, it means that all remaining features\n         * are identical. Split in the middle to maintain a balanced tree.\n         */\n        lim1 = left;\n        right = count-1;\n        for (;; ) {\n            while (left<=right && dataset_[ind[left]][cutfeat]<=cutval) ++left;\n            while (left<=right && dataset_[ind[right]][cutfeat]>cutval) --right;\n            if (left>right) break;\n            std::swap(ind[left], ind[right]); ++left; --right;\n        }\n        lim2 = left;\n    }\n\n    DistanceType computeInitialDistances(const ElementType* vec, std::vector<DistanceType>& dists)\n    {\n        DistanceType distsq = 0.0;\n\n        for (size_t i = 0; i < dim_; ++i) {\n            if (vec[i] < root_bbox_[i].low) {\n                dists[i] = distance_.accum_dist(vec[i], root_bbox_[i].low, (int)i);\n                distsq += dists[i];\n            }\n            if (vec[i] > root_bbox_[i].high) {\n                dists[i] = distance_.accum_dist(vec[i], root_bbox_[i].high, (int)i);\n                distsq += dists[i];\n            }\n        }\n\n        return distsq;\n    }\n\n    /**\n     * Performs an exact search in the tree starting from a node.\n     */\n    void searchLevel(ResultSet<DistanceType>& result_set, const ElementType* vec, const NodePtr node, DistanceType mindistsq,\n                     std::vector<DistanceType>& dists, const float epsError)\n    {\n        /* If this is a leaf node, then do check and return. */\n        if ((node->child1 == NULL)&&(node->child2 == NULL)) {\n            DistanceType worst_dist = result_set.worstDist();\n            if (reorder_) {\n                for (int i=node->left; i<node->right; ++i) {\n                    DistanceType dist = distance_(vec, data_[i], dim_, worst_dist);\n                    if (dist<worst_dist) {\n                        result_set.addPoint(dist,vind_[i]);\n                    }\n                }\n            } else {\n                for (int i=node->left; i<node->right; ++i) {\n                    DistanceType dist = distance_(vec, data_[vind_[i]], dim_, worst_dist);\n                    if (dist<worst_dist) {\n                        result_set.addPoint(dist,vind_[i]);\n                    }\n                }\n            }\n            return;\n        }\n\n        /* Which child branch should be taken first? */\n        int idx = node->divfeat;\n        ElementType val = vec[idx];\n        DistanceType diff1 = val - node->divlow;\n        DistanceType diff2 = val - node->divhigh;\n\n        NodePtr bestChild;\n        NodePtr otherChild;\n        DistanceType cut_dist;\n        if ((diff1+diff2)<0) {\n            bestChild = node->child1;\n            otherChild = node->child2;\n            cut_dist = distance_.accum_dist(val, node->divhigh, idx);\n        }\n        else {\n            bestChild = node->child2;\n            otherChild = node->child1;\n            cut_dist = distance_.accum_dist( val, node->divlow, idx);\n        }\n\n        /* Call recursively to search next level down. */\n        searchLevel(result_set, vec, bestChild, mindistsq, dists, epsError);\n\n        DistanceType dst = dists[idx];\n        mindistsq = mindistsq + cut_dist - dst;\n        dists[idx] = cut_dist;\n        if (mindistsq*epsError<=result_set.worstDist()) {\n            searchLevel(result_set, vec, otherChild, mindistsq, dists, epsError);\n        }\n        dists[idx] = dst;\n    }\n\nprivate:\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset_;\n\n    IndexParams index_params_;\n\n    int leaf_max_size_;\n    bool reorder_;\n\n\n    /**\n     *  Array of indices to vectors in the dataset.\n     */\n    std::vector<int> vind_;\n\n    Matrix<ElementType> data_;\n\n    size_t size_;\n    size_t dim_;\n\n    /**\n     * Array of k-d trees used to find neighbours.\n     */\n    NodePtr root_node_;\n\n    BoundingBox root_bbox_;\n\n    /**\n     * Pooled memory allocator.\n     *\n     * Using a pooled memory allocator is more efficient\n     * than allocating memory directly when there is a large\n     * number small of memory allocations.\n     */\n    PooledAllocator pool_;\n\n    Distance distance_;\n};   // class KDTree\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/kmeans_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_KMEANS_INDEX_H_\n#define OPENCV_FLANN_KMEANS_INDEX_H_\n\n//! @cond IGNORED\n\n#include <algorithm>\n#include <map>\n#include <limits>\n#include <cmath>\n\n#include \"general.h\"\n#include \"nn_index.h\"\n#include \"dist.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n#include \"logger.h\"\n\n#define BITS_PER_CHAR 8\n#define BITS_PER_BASE 2 // for DNA/RNA sequences\n#define BASE_PER_CHAR (BITS_PER_CHAR/BITS_PER_BASE)\n#define HISTOS_PER_BASE (1<<BITS_PER_BASE)\n\n\nnamespace cvflann\n{\n\nstruct KMeansIndexParams : public IndexParams\n{\n    KMeansIndexParams(int branching = 32, int iterations = 11,\n                      flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM,\n                      float cb_index = 0.2, int trees = 1 )\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_KMEANS;\n        // branching factor\n        (*this)[\"branching\"] = branching;\n        // max iterations to perform in one kmeans clustering (kmeans tree)\n        (*this)[\"iterations\"] = iterations;\n        // algorithm used for picking the initial cluster centers for kmeans tree\n        (*this)[\"centers_init\"] = centers_init;\n        // cluster boundary index. Used when searching the kmeans tree\n        (*this)[\"cb_index\"] = cb_index;\n        // number of kmeans trees to search in\n        (*this)[\"trees\"] = trees;\n    }\n};\n\n\n/**\n * Hierarchical kmeans index\n *\n * Contains a tree constructed through a hierarchical kmeans clustering\n * and other information for indexing a set of points for nearest-neighbour matching.\n */\ntemplate <typename Distance>\nclass KMeansIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n    typedef typename Distance::CentersType CentersType;\n\n    typedef typename Distance::is_kdtree_distance is_kdtree_distance;\n    typedef typename Distance::is_vector_space_distance is_vector_space_distance;\n\n\n\n    typedef void (KMeansIndex::* centersAlgFunction)(int, int*, int, int*, int&);\n\n    /**\n     * The function used for choosing the cluster centers.\n     */\n    centersAlgFunction chooseCenters;\n\n\n\n    /**\n     * Chooses the initial centers in the k-means clustering in a random manner.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     *     indices_length = length of indices vector\n     *\n     */\n    void chooseCentersRandom(int k, int* indices, int indices_length, int* centers, int& centers_length)\n    {\n        UniqueRandom r(indices_length);\n\n        int index;\n        for (index=0; index<k; ++index) {\n            bool duplicate = true;\n            int rnd;\n            while (duplicate) {\n                duplicate = false;\n                rnd = r.next();\n                if (rnd<0) {\n                    centers_length = index;\n                    return;\n                }\n\n                centers[index] = indices[rnd];\n\n                for (int j=0; j<index; ++j) {\n                    DistanceType sq = distance_(dataset_[centers[index]], dataset_[centers[j]], dataset_.cols);\n                    if (sq<1e-16) {\n                        duplicate = true;\n                    }\n                }\n            }\n        }\n\n        centers_length = index;\n    }\n\n\n    /**\n     * Chooses the initial centers in the k-means using Gonzales' algorithm\n     * so that the centers are spaced apart from each other.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     * Returns:\n     */\n    void chooseCentersGonzales(int k, int* indices, int indices_length, int* centers, int& centers_length)\n    {\n        int n = indices_length;\n\n        int rnd = rand_int(n);\n        CV_DbgAssert(rnd >=0 && rnd < n);\n\n        centers[0] = indices[rnd];\n\n        int index;\n        for (index=1; index<k; ++index) {\n\n            int best_index = -1;\n            DistanceType best_val = 0;\n            for (int j=0; j<n; ++j) {\n                DistanceType dist = distance_(dataset_[centers[0]],dataset_[indices[j]],dataset_.cols);\n                for (int i=1; i<index; ++i) {\n                    DistanceType tmp_dist = distance_(dataset_[centers[i]],dataset_[indices[j]],dataset_.cols);\n                    if (tmp_dist<dist) {\n                        dist = tmp_dist;\n                    }\n                }\n                if (dist>best_val) {\n                    best_val = dist;\n                    best_index = j;\n                }\n            }\n            if (best_index!=-1) {\n                centers[index] = indices[best_index];\n            }\n            else {\n                break;\n            }\n        }\n        centers_length = index;\n    }\n\n\n    /**\n     * Chooses the initial centers in the k-means using the algorithm\n     * proposed in the KMeans++ paper:\n     * Arthur, David; Vassilvitskii, Sergei - k-means++: The Advantages of Careful Seeding\n     *\n     * Implementation of this function was converted from the one provided in Arthur's code.\n     *\n     * Params:\n     *     k = number of centers\n     *     vecs = the dataset of points\n     *     indices = indices in the dataset\n     * Returns:\n     */\n    void chooseCentersKMeanspp(int k, int* indices, int indices_length, int* centers, int& centers_length)\n    {\n        int n = indices_length;\n\n        double currentPot = 0;\n        DistanceType* closestDistSq = new DistanceType[n];\n\n        // Choose one random center and set the closestDistSq values\n        int index = rand_int(n);\n        CV_DbgAssert(index >=0 && index < n);\n        centers[0] = indices[index];\n\n        for (int i = 0; i < n; i++) {\n            closestDistSq[i] = distance_(dataset_[indices[i]], dataset_[indices[index]], dataset_.cols);\n            closestDistSq[i] = ensureSquareDistance<Distance>( closestDistSq[i] );\n            currentPot += closestDistSq[i];\n        }\n\n\n        const int numLocalTries = 1;\n\n        // Choose each center\n        int centerCount;\n        for (centerCount = 1; centerCount < k; centerCount++) {\n\n            // Repeat several trials\n            double bestNewPot = -1;\n            int bestNewIndex = -1;\n            for (int localTrial = 0; localTrial < numLocalTries; localTrial++) {\n\n                // Choose our center - have to be slightly careful to return a valid answer even accounting\n                // for possible rounding errors\n                double randVal = rand_double(currentPot);\n                for (index = 0; index < n-1; index++) {\n                    if (randVal <= closestDistSq[index]) break;\n                    else randVal -= closestDistSq[index];\n                }\n\n                // Compute the new potential\n                double newPot = 0;\n                for (int i = 0; i < n; i++) {\n                    DistanceType dist = distance_(dataset_[indices[i]], dataset_[indices[index]], dataset_.cols);\n                    newPot += std::min( ensureSquareDistance<Distance>(dist), closestDistSq[i] );\n                }\n\n                // Store the best result\n                if ((bestNewPot < 0)||(newPot < bestNewPot)) {\n                    bestNewPot = newPot;\n                    bestNewIndex = index;\n                }\n            }\n\n            // Add the appropriate center\n            centers[centerCount] = indices[bestNewIndex];\n            currentPot = bestNewPot;\n            for (int i = 0; i < n; i++) {\n                DistanceType dist = distance_(dataset_[indices[i]], dataset_[indices[bestNewIndex]], dataset_.cols);\n                closestDistSq[i] = std::min( ensureSquareDistance<Distance>(dist), closestDistSq[i] );\n            }\n        }\n\n        centers_length = centerCount;\n\n        delete[] closestDistSq;\n    }\n\n\n\npublic:\n\n    flann_algorithm_t getType() const CV_OVERRIDE\n    {\n        return FLANN_INDEX_KMEANS;\n    }\n\n    template<class CentersContainerType>\n    class KMeansDistanceComputer : public cv::ParallelLoopBody\n    {\n    public:\n        KMeansDistanceComputer(Distance _distance, const Matrix<ElementType>& _dataset,\n            const int _branching, const int* _indices, const CentersContainerType& _dcenters,\n            const size_t _veclen, std::vector<int> &_new_centroids,\n            std::vector<DistanceType> &_sq_dists)\n            : distance(_distance)\n            , dataset(_dataset)\n            , branching(_branching)\n            , indices(_indices)\n            , dcenters(_dcenters)\n            , veclen(_veclen)\n            , new_centroids(_new_centroids)\n            , sq_dists(_sq_dists)\n        {\n        }\n\n        void operator()(const cv::Range& range) const CV_OVERRIDE\n        {\n            const int begin = range.start;\n            const int end = range.end;\n\n            for( int i = begin; i<end; ++i)\n            {\n                DistanceType sq_dist(distance(dataset[indices[i]], dcenters[0], veclen));\n                int new_centroid(0);\n                for (int j=1; j<branching; ++j) {\n                    DistanceType new_sq_dist = distance(dataset[indices[i]], dcenters[j], veclen);\n                    if (sq_dist>new_sq_dist) {\n                        new_centroid = j;\n                        sq_dist = new_sq_dist;\n                    }\n                }\n                sq_dists[i] = sq_dist;\n                new_centroids[i] = new_centroid;\n            }\n        }\n\n    private:\n        Distance distance;\n        const Matrix<ElementType>& dataset;\n        const int branching;\n        const int* indices;\n        const CentersContainerType& dcenters;\n        const size_t veclen;\n        std::vector<int> &new_centroids;\n        std::vector<DistanceType> &sq_dists;\n        KMeansDistanceComputer& operator=( const KMeansDistanceComputer & ) { return *this; }\n    };\n\n    /**\n     * Index constructor\n     *\n     * Params:\n     *          inputData = dataset with the input features\n     *          params = parameters passed to the hierarchical k-means algorithm\n     */\n    KMeansIndex(const Matrix<ElementType>& inputData, const IndexParams& params = KMeansIndexParams(),\n                Distance d = Distance())\n        : dataset_(inputData), index_params_(params), root_(NULL), indices_(NULL), distance_(d)\n    {\n        memoryCounter_ = 0;\n\n        size_ = dataset_.rows;\n        veclen_ = dataset_.cols;\n\n        branching_ = get_param(params,\"branching\",32);\n        trees_ = get_param(params,\"trees\",1);\n        iterations_ = get_param(params,\"iterations\",11);\n        if (iterations_<0) {\n            iterations_ = (std::numeric_limits<int>::max)();\n        }\n        centers_init_  = get_param(params,\"centers_init\",FLANN_CENTERS_RANDOM);\n\n        if (centers_init_==FLANN_CENTERS_RANDOM) {\n            chooseCenters = &KMeansIndex::chooseCentersRandom;\n        }\n        else if (centers_init_==FLANN_CENTERS_GONZALES) {\n            chooseCenters = &KMeansIndex::chooseCentersGonzales;\n        }\n        else if (centers_init_==FLANN_CENTERS_KMEANSPP) {\n            chooseCenters = &KMeansIndex::chooseCentersKMeanspp;\n        }\n        else {\n            FLANN_THROW(cv::Error::StsBadArg, \"Unknown algorithm for choosing initial centers.\");\n        }\n        cb_index_ = 0.4f;\n\n        root_ = new KMeansNodePtr[trees_];\n        indices_ = new int*[trees_];\n\n        for (int i=0; i<trees_; ++i) {\n            root_[i] = NULL;\n            indices_[i] = NULL;\n        }\n    }\n\n\n    KMeansIndex(const KMeansIndex&);\n    KMeansIndex& operator=(const KMeansIndex&);\n\n\n    /**\n     * Index destructor.\n     *\n     * Release the memory used by the index.\n     */\n    virtual ~KMeansIndex()\n    {\n        if (root_ != NULL) {\n            free_centers();\n            delete[] root_;\n        }\n        if (indices_!=NULL) {\n            free_indices();\n            delete[] indices_;\n        }\n    }\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const CV_OVERRIDE\n    {\n        return size_;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const CV_OVERRIDE\n    {\n        return veclen_;\n    }\n\n\n    void set_cb_index( float index)\n    {\n        cb_index_ = index;\n    }\n\n    /**\n     * Computes the inde memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const CV_OVERRIDE\n    {\n        return pool_.usedMemory+pool_.wastedMemory+memoryCounter_;\n    }\n\n    /**\n     * Builds the index\n     */\n    void buildIndex() CV_OVERRIDE\n    {\n        if (branching_<2) {\n            FLANN_THROW(cv::Error::StsError, \"Branching factor must be at least 2\");\n        }\n\n        free_indices();\n\n        for (int i=0; i<trees_; ++i) {\n            indices_[i] = new int[size_];\n            for (size_t j=0; j<size_; ++j) {\n                indices_[i][j] = int(j);\n            }\n            root_[i] = pool_.allocate<KMeansNode>();\n            std::memset(root_[i], 0, sizeof(KMeansNode));\n\n            Distance* dummy = NULL;\n            computeNodeStatistics(root_[i], indices_[i], (unsigned int)size_, dummy);\n\n            computeClustering(root_[i], indices_[i], (int)size_, branching_,0);\n        }\n    }\n\n\n    void saveIndex(FILE* stream) CV_OVERRIDE\n    {\n        save_value(stream, branching_);\n        save_value(stream, iterations_);\n        save_value(stream, memoryCounter_);\n        save_value(stream, cb_index_);\n        save_value(stream, trees_);\n        for (int i=0; i<trees_; ++i) {\n            save_value(stream, *indices_[i], (int)size_);\n            save_tree(stream, root_[i], i);\n        }\n    }\n\n\n    void loadIndex(FILE* stream) CV_OVERRIDE\n    {\n        if (indices_!=NULL) {\n            free_indices();\n            delete[] indices_;\n        }\n        if (root_!=NULL) {\n            free_centers();\n        }\n\n        load_value(stream, branching_);\n        load_value(stream, iterations_);\n        load_value(stream, memoryCounter_);\n        load_value(stream, cb_index_);\n        load_value(stream, trees_);\n\n        indices_ = new int*[trees_];\n        for (int i=0; i<trees_; ++i) {\n            indices_[i] = new int[size_];\n            load_value(stream, *indices_[i], size_);\n            load_tree(stream, root_[i], i);\n        }\n\n        index_params_[\"algorithm\"] = getType();\n        index_params_[\"branching\"] = branching_;\n        index_params_[\"trees\"] = trees_;\n        index_params_[\"iterations\"] = iterations_;\n        index_params_[\"centers_init\"] = centers_init_;\n        index_params_[\"cb_index\"] = cb_index_;\n    }\n\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     searchParams = parameters that influence the search algorithm (checks, cb_index)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE\n    {\n\n        const int maxChecks = get_param(searchParams,\"checks\",32);\n\n        if (maxChecks==FLANN_CHECKS_UNLIMITED) {\n            findExactNN(root_[0], result, vec);\n        }\n        else {\n            // Priority queue storing intermediate branches in the best-bin-first search\n            Heap<BranchSt>* heap = new Heap<BranchSt>((int)size_);\n\n            int checks = 0;\n            for (int i=0; i<trees_; ++i) {\n                findNN(root_[i], result, vec, checks, maxChecks, heap);\n                if ((checks >= maxChecks) && result.full())\n                    break;\n            }\n\n            BranchSt branch;\n            while (heap->popMin(branch) && (checks<maxChecks || !result.full())) {\n                KMeansNodePtr node = branch.node;\n                findNN(node, result, vec, checks, maxChecks, heap);\n            }\n            delete heap;\n\n            CV_Assert(result.full());\n        }\n    }\n\n    /**\n     * Clustering function that takes a cut in the hierarchical k-means\n     * tree and return the clusters centers of that clustering.\n     * Params:\n     *     numClusters = number of clusters to have in the clustering computed\n     * Returns: number of cluster centers\n     */\n    int getClusterCenters(Matrix<CentersType>& centers)\n    {\n        int numClusters = centers.rows;\n        if (numClusters<1) {\n            FLANN_THROW(cv::Error::StsBadArg, \"Number of clusters must be at least 1\");\n        }\n\n        DistanceType variance;\n        KMeansNodePtr* clusters = new KMeansNodePtr[numClusters];\n\n        int clusterCount = getMinVarianceClusters(root_[0], clusters, numClusters, variance);\n\n        Logger::info(\"Clusters requested: %d, returning %d\\n\",numClusters, clusterCount);\n\n        for (int i=0; i<clusterCount; ++i) {\n            CentersType* center = clusters[i]->pivot;\n            for (size_t j=0; j<veclen_; ++j) {\n                centers[i][j] = center[j];\n            }\n        }\n        delete[] clusters;\n\n        return clusterCount;\n    }\n\n    IndexParams getParameters() const CV_OVERRIDE\n    {\n        return index_params_;\n    }\n\n\nprivate:\n    /**\n     * Structure representing a node in the hierarchical k-means tree.\n     */\n    struct KMeansNode\n    {\n        /**\n         * The cluster center.\n         */\n        CentersType* pivot;\n        /**\n         * The cluster radius.\n         */\n        DistanceType radius;\n        /**\n         * The cluster mean radius.\n         */\n        DistanceType mean_radius;\n        /**\n         * The cluster variance.\n         */\n        DistanceType variance;\n        /**\n         * The cluster size (number of points in the cluster)\n         */\n        int size;\n        /**\n         * Child nodes (only for non-terminal nodes)\n         */\n        KMeansNode** childs;\n        /**\n         * Node points (only for terminal nodes)\n         */\n        int* indices;\n        /**\n         * Level\n         */\n        int level;\n    };\n    typedef KMeansNode* KMeansNodePtr;\n\n    /**\n     * Alias definition for a nicer syntax.\n     */\n    typedef BranchStruct<KMeansNodePtr, DistanceType> BranchSt;\n\n\n\n\n    void save_tree(FILE* stream, KMeansNodePtr node, int num)\n    {\n        save_value(stream, *node);\n        save_value(stream, *(node->pivot), (int)veclen_);\n        if (node->childs==NULL) {\n            int indices_offset = (int)(node->indices - indices_[num]);\n            save_value(stream, indices_offset);\n        }\n        else {\n            for(int i=0; i<branching_; ++i) {\n                save_tree(stream, node->childs[i], num);\n            }\n        }\n    }\n\n\n    void load_tree(FILE* stream, KMeansNodePtr& node, int num)\n    {\n        node = pool_.allocate<KMeansNode>();\n        load_value(stream, *node);\n        node->pivot = new CentersType[veclen_];\n        load_value(stream, *(node->pivot), (int)veclen_);\n        if (node->childs==NULL) {\n            int indices_offset;\n            load_value(stream, indices_offset);\n            node->indices = indices_[num] + indices_offset;\n        }\n        else {\n            node->childs = pool_.allocate<KMeansNodePtr>(branching_);\n            for(int i=0; i<branching_; ++i) {\n                load_tree(stream, node->childs[i], num);\n            }\n        }\n    }\n\n\n    /**\n     * Helper function\n     */\n    void free_centers(KMeansNodePtr node)\n    {\n        delete[] node->pivot;\n        if (node->childs!=NULL) {\n            for (int k=0; k<branching_; ++k) {\n                free_centers(node->childs[k]);\n            }\n        }\n    }\n\n    void free_centers()\n    {\n       if (root_ != NULL) {\n           for(int i=0; i<trees_; ++i) {\n               if (root_[i] != NULL) {\n                   free_centers(root_[i]);\n               }\n           }\n       }\n    }\n\n    /**\n     * Release the inner elements of indices[]\n     */\n    void free_indices()\n    {\n        if (indices_!=NULL) {\n            for(int i=0; i<trees_; ++i) {\n                if (indices_[i]!=NULL) {\n                    delete[] indices_[i];\n                    indices_[i] = NULL;\n                }\n            }\n        }\n    }\n\n    /**\n     * Computes the statistics of a node (mean, radius, variance).\n     *\n     * Params:\n     *     node = the node to use\n     *     indices = array of indices of the points belonging to the node\n     *     indices_length = number of indices in the array\n     */\n    void computeNodeStatistics(KMeansNodePtr node, int* indices, unsigned int indices_length)\n    {\n        DistanceType variance = 0;\n        CentersType* mean = new CentersType[veclen_];\n        memoryCounter_ += int(veclen_*sizeof(CentersType));\n\n        memset(mean,0,veclen_*sizeof(CentersType));\n\n        for (unsigned int i=0; i<indices_length; ++i) {\n            ElementType* vec = dataset_[indices[i]];\n            for (size_t j=0; j<veclen_; ++j) {\n                mean[j] += vec[j];\n            }\n            variance += distance_(vec, ZeroIterator<ElementType>(), veclen_);\n        }\n        float length = static_cast<float>(indices_length);\n        for (size_t j=0; j<veclen_; ++j) {\n            mean[j] = cvflann::round<CentersType>( mean[j] / static_cast<double>(indices_length) );\n        }\n        variance /= static_cast<DistanceType>( length );\n        variance -= distance_(mean, ZeroIterator<ElementType>(), veclen_);\n\n        DistanceType radius = 0;\n        for (unsigned int i=0; i<indices_length; ++i) {\n            DistanceType tmp = distance_(mean, dataset_[indices[i]], veclen_);\n            if (tmp>radius) {\n                radius = tmp;\n            }\n        }\n\n        node->variance = variance;\n        node->radius = radius;\n        node->pivot = mean;\n    }\n\n\n    void computeBitfieldNodeStatistics(KMeansNodePtr node, int* indices,\n                                       unsigned int indices_length)\n    {\n        const unsigned int accumulator_veclen = static_cast<unsigned int>(\n                                                veclen_*sizeof(CentersType)*BITS_PER_CHAR);\n\n        unsigned long long variance = 0ull;\n        CentersType* mean = new CentersType[veclen_];\n        memoryCounter_ += int(veclen_*sizeof(CentersType));\n        unsigned int* mean_accumulator = new unsigned int[accumulator_veclen];\n\n        memset(mean_accumulator, 0, sizeof(unsigned int)*accumulator_veclen);\n\n        for (unsigned int i=0; i<indices_length; ++i) {\n            variance += static_cast<unsigned long long>( ensureSquareDistance<Distance>(\n                        distance_(dataset_[indices[i]], ZeroIterator<ElementType>(), veclen_)));\n            unsigned char* vec = (unsigned char*)dataset_[indices[i]];\n            for (size_t k=0, l=0; k<accumulator_veclen; k+=BITS_PER_CHAR, ++l) {\n                mean_accumulator[k]   += (vec[l])    & 0x01;\n                mean_accumulator[k+1] += (vec[l]>>1) & 0x01;\n                mean_accumulator[k+2] += (vec[l]>>2) & 0x01;\n                mean_accumulator[k+3] += (vec[l]>>3) & 0x01;\n                mean_accumulator[k+4] += (vec[l]>>4) & 0x01;\n                mean_accumulator[k+5] += (vec[l]>>5) & 0x01;\n                mean_accumulator[k+6] += (vec[l]>>6) & 0x01;\n                mean_accumulator[k+7] += (vec[l]>>7) & 0x01;\n            }\n        }\n        double cnt = static_cast<double>(indices_length);\n        unsigned char* char_mean = (unsigned char*)mean;\n        for (size_t k=0, l=0; k<accumulator_veclen; k+=BITS_PER_CHAR, ++l) {\n            char_mean[l] = static_cast<unsigned char>(\n                              (((int)(0.5 + (double)(mean_accumulator[k])   / cnt)))\n                            | (((int)(0.5 + (double)(mean_accumulator[k+1]) / cnt))<<1)\n                            | (((int)(0.5 + (double)(mean_accumulator[k+2]) / cnt))<<2)\n                            | (((int)(0.5 + (double)(mean_accumulator[k+3]) / cnt))<<3)\n                            | (((int)(0.5 + (double)(mean_accumulator[k+4]) / cnt))<<4)\n                            | (((int)(0.5 + (double)(mean_accumulator[k+5]) / cnt))<<5)\n                            | (((int)(0.5 + (double)(mean_accumulator[k+6]) / cnt))<<6)\n                            | (((int)(0.5 + (double)(mean_accumulator[k+7]) / cnt))<<7));\n        }\n        variance = static_cast<unsigned long long>(\n                    0.5 + static_cast<double>(variance) / static_cast<double>(indices_length));\n        variance -= static_cast<unsigned long long>(\n                    ensureSquareDistance<Distance>(\n                        distance_(mean, ZeroIterator<ElementType>(), veclen_)));\n\n        DistanceType radius = 0;\n        for (unsigned int i=0; i<indices_length; ++i) {\n            DistanceType tmp = distance_(mean, dataset_[indices[i]], veclen_);\n            if (tmp>radius) {\n                radius = tmp;\n            }\n        }\n\n        node->variance = static_cast<DistanceType>(variance);\n        node->radius = radius;\n        node->pivot = mean;\n\n        delete[] mean_accumulator;\n    }\n\n\n    void computeDnaNodeStatistics(KMeansNodePtr node, int* indices,\n                                       unsigned int indices_length)\n    {\n        const unsigned int histos_veclen = static_cast<unsigned int>(\n                    veclen_*sizeof(CentersType)*(HISTOS_PER_BASE*BASE_PER_CHAR));\n\n        unsigned long long variance = 0ull;\n        unsigned int* histograms = new unsigned int[histos_veclen];\n        memset(histograms, 0, sizeof(unsigned int)*histos_veclen);\n\n        for (unsigned int i=0; i<indices_length; ++i) {\n            variance += static_cast<unsigned long long>( ensureSquareDistance<Distance>(\n                        distance_(dataset_[indices[i]], ZeroIterator<ElementType>(), veclen_)));\n\n            unsigned char* vec = (unsigned char*)dataset_[indices[i]];\n            for (size_t k=0, l=0; k<histos_veclen; k+=HISTOS_PER_BASE*BASE_PER_CHAR, ++l) {\n                histograms[k +     ((vec[l])    & 0x03)]++;\n                histograms[k + 4 + ((vec[l]>>2) & 0x03)]++;\n                histograms[k + 8 + ((vec[l]>>4) & 0x03)]++;\n                histograms[k +12 + ((vec[l]>>6) & 0x03)]++;\n            }\n        }\n\n        CentersType* mean = new CentersType[veclen_];\n        memoryCounter_ += int(veclen_*sizeof(CentersType));\n        unsigned char* char_mean = (unsigned char*)mean;\n        unsigned int* h = histograms;\n        for (size_t k=0, l=0; k<histos_veclen; k+=HISTOS_PER_BASE*BASE_PER_CHAR, ++l) {\n            char_mean[l] = (h[k] > h[k+1] ? h[k+2] > h[k+3] ? h[k]   > h[k+2] ? 0x00 : 0x10\n                                                            : h[k]   > h[k+3] ? 0x00 : 0x11\n                                          : h[k+2] > h[k+3] ? h[k+1] > h[k+2] ? 0x01 : 0x10\n                                                            : h[k+1] > h[k+3] ? 0x01 : 0x11)\n                         | (h[k+4]>h[k+5] ? h[k+6] > h[k+7] ? h[k+4] > h[k+6] ? 0x00   : 0x1000\n                                                            : h[k+4] > h[k+7] ? 0x00   : 0x1100\n                                          : h[k+6] > h[k+7] ? h[k+5] > h[k+6] ? 0x0100 : 0x1000\n                                                            : h[k+5] > h[k+7] ? 0x0100 : 0x1100)\n                         | (h[k+8]>h[k+9] ? h[k+10]>h[k+11] ? h[k+8] >h[k+10] ? 0x00   : 0x100000\n                                                            : h[k+8] >h[k+11] ? 0x00   : 0x110000\n                                          : h[k+10]>h[k+11] ? h[k+9] >h[k+10] ? 0x010000 : 0x100000\n                                                            : h[k+9] >h[k+11] ? 0x010000 : 0x110000)\n                         | (h[k+12]>h[k+13] ? h[k+14]>h[k+15] ? h[k+12] >h[k+14] ? 0x00   : 0x10000000\n                                                              : h[k+12] >h[k+15] ? 0x00   : 0x11000000\n                                            : h[k+14]>h[k+15] ? h[k+13] >h[k+14] ? 0x01000000 : 0x10000000\n                                                              : h[k+13] >h[k+15] ? 0x01000000 : 0x11000000);\n        }\n        variance = static_cast<unsigned long long>(\n                    0.5 + static_cast<double>(variance) / static_cast<double>(indices_length));\n        variance -= static_cast<unsigned long long>(\n                    ensureSquareDistance<Distance>(\n                        distance_(mean, ZeroIterator<ElementType>(), veclen_)));\n\n        DistanceType radius = 0;\n        for (unsigned int i=0; i<indices_length; ++i) {\n            DistanceType tmp = distance_(mean, dataset_[indices[i]], veclen_);\n            if (tmp>radius) {\n                radius = tmp;\n            }\n        }\n\n        node->variance = static_cast<DistanceType>(variance);\n        node->radius = radius;\n        node->pivot = mean;\n\n        delete[] histograms;\n    }\n\n\n    template<typename DistType>\n    void computeNodeStatistics(KMeansNodePtr node, int* indices,\n                               unsigned int indices_length,\n                               const DistType* identifier)\n    {\n        (void)identifier;\n        computeNodeStatistics(node, indices, indices_length);\n    }\n\n    void computeNodeStatistics(KMeansNodePtr node, int* indices,\n                               unsigned int indices_length,\n                               const cvflann::HammingLUT* identifier)\n    {\n        (void)identifier;\n        computeBitfieldNodeStatistics(node, indices, indices_length);\n    }\n\n    void computeNodeStatistics(KMeansNodePtr node, int* indices,\n                               unsigned int indices_length,\n                               const cvflann::Hamming<unsigned char>* identifier)\n    {\n        (void)identifier;\n        computeBitfieldNodeStatistics(node, indices, indices_length);\n    }\n\n    void computeNodeStatistics(KMeansNodePtr node, int* indices,\n                               unsigned int indices_length,\n                               const cvflann::Hamming2<unsigned char>* identifier)\n    {\n        (void)identifier;\n        computeBitfieldNodeStatistics(node, indices, indices_length);\n    }\n\n    void computeNodeStatistics(KMeansNodePtr node, int* indices,\n                               unsigned int indices_length,\n                               const cvflann::DNAmmingLUT* identifier)\n    {\n        (void)identifier;\n        computeDnaNodeStatistics(node, indices, indices_length);\n    }\n\n    void computeNodeStatistics(KMeansNodePtr node, int* indices,\n                               unsigned int indices_length,\n                               const cvflann::DNAmming2<unsigned char>* identifier)\n    {\n        (void)identifier;\n        computeDnaNodeStatistics(node, indices, indices_length);\n    }\n\n\n    void refineClustering(int* indices, int indices_length, int branching, CentersType** centers,\n                          std::vector<DistanceType>& radiuses, int* belongs_to, int* count)\n    {\n        cv::AutoBuffer<double> dcenters_buf(branching*veclen_);\n        Matrix<double> dcenters(dcenters_buf.data(), branching, veclen_);\n\n        bool converged = false;\n        int iteration = 0;\n        while (!converged && iteration<iterations_) {\n            converged = true;\n            iteration++;\n\n            // compute the new cluster centers\n            for (int i=0; i<branching; ++i) {\n                memset(dcenters[i],0,sizeof(double)*veclen_);\n                radiuses[i] = 0;\n            }\n            for (int i=0; i<indices_length; ++i) {\n                ElementType* vec = dataset_[indices[i]];\n                double* center = dcenters[belongs_to[i]];\n                for (size_t k=0; k<veclen_; ++k) {\n                    center[k] += vec[k];\n                }\n            }\n            for (int i=0; i<branching; ++i) {\n                int cnt = count[i];\n                for (size_t k=0; k<veclen_; ++k) {\n                    dcenters[i][k] /= cnt;\n                }\n            }\n\n            std::vector<int> new_centroids(indices_length);\n            std::vector<DistanceType> sq_dists(indices_length);\n\n            // reassign points to clusters\n            KMeansDistanceComputer<Matrix<double> > invoker(\n                        distance_, dataset_, branching, indices, dcenters, veclen_, new_centroids, sq_dists);\n            parallel_for_(cv::Range(0, (int)indices_length), invoker);\n\n            for (int i=0; i < (int)indices_length; ++i) {\n                DistanceType sq_dist(sq_dists[i]);\n                int new_centroid(new_centroids[i]);\n                if (sq_dist > radiuses[new_centroid]) {\n                    radiuses[new_centroid] = sq_dist;\n                }\n                if (new_centroid != belongs_to[i]) {\n                    count[belongs_to[i]]--;\n                    count[new_centroid]++;\n                    belongs_to[i] = new_centroid;\n                    converged = false;\n                }\n            }\n\n            for (int i=0; i<branching; ++i) {\n                // if one cluster converges to an empty cluster,\n                // move an element into that cluster\n                if (count[i]==0) {\n                    int j = (i+1)%branching;\n                    while (count[j]<=1) {\n                        j = (j+1)%branching;\n                    }\n\n                    for (int k=0; k<indices_length; ++k) {\n                        if (belongs_to[k]==j) {\n                            // for cluster j, we move the furthest element from the center to the empty cluster i\n                            if ( distance_(dataset_[indices[k]], dcenters[j], veclen_) == radiuses[j] ) {\n                                belongs_to[k] = i;\n                                count[j]--;\n                                count[i]++;\n                                break;\n                            }\n                        }\n                    }\n                    converged = false;\n                }\n            }\n        }\n\n       for (int i=0; i<branching; ++i) {\n           centers[i] = new CentersType[veclen_];\n           memoryCounter_ += (int)(veclen_*sizeof(CentersType));\n           for (size_t k=0; k<veclen_; ++k) {\n               centers[i][k] = (CentersType)dcenters[i][k];\n           }\n       }\n    }\n\n\n    void refineBitfieldClustering(int* indices, int indices_length, int branching, CentersType** centers,\n                                  std::vector<DistanceType>& radiuses, int* belongs_to, int* count)\n    {\n        for (int i=0; i<branching; ++i) {\n            centers[i] = new CentersType[veclen_];\n            memoryCounter_ += (int)(veclen_*sizeof(CentersType));\n        }\n\n        const unsigned int accumulator_veclen = static_cast<unsigned int>(\n                                                veclen_*sizeof(ElementType)*BITS_PER_CHAR);\n        cv::AutoBuffer<unsigned int> dcenters_buf(branching*accumulator_veclen);\n        Matrix<unsigned int> dcenters(dcenters_buf.data(), branching, accumulator_veclen);\n\n        bool converged = false;\n        int iteration = 0;\n        while (!converged && iteration<iterations_) {\n            converged = true;\n            iteration++;\n\n            // compute the new cluster centers\n            for (int i=0; i<branching; ++i) {\n                memset(dcenters[i],0,sizeof(unsigned int)*accumulator_veclen);\n                radiuses[i] = 0;\n            }\n            for (int i=0; i<indices_length; ++i) {\n                unsigned char* vec = (unsigned char*)dataset_[indices[i]];\n                unsigned int* dcenter = dcenters[belongs_to[i]];\n                for (size_t k=0, l=0; k<accumulator_veclen; k+=BITS_PER_CHAR, ++l) {\n                    dcenter[k]   += (vec[l])    & 0x01;\n                    dcenter[k+1] += (vec[l]>>1) & 0x01;\n                    dcenter[k+2] += (vec[l]>>2) & 0x01;\n                    dcenter[k+3] += (vec[l]>>3) & 0x01;\n                    dcenter[k+4] += (vec[l]>>4) & 0x01;\n                    dcenter[k+5] += (vec[l]>>5) & 0x01;\n                    dcenter[k+6] += (vec[l]>>6) & 0x01;\n                    dcenter[k+7] += (vec[l]>>7) & 0x01;\n                }\n            }\n            for (int i=0; i<branching; ++i) {\n                double cnt = static_cast<double>(count[i]);\n                unsigned int* dcenter = dcenters[i];\n                unsigned char* charCenter = (unsigned char*)centers[i];\n                for (size_t k=0, l=0; k<accumulator_veclen; k+=BITS_PER_CHAR, ++l) {\n                    charCenter[l] = static_cast<unsigned char>(\n                                      (((int)(0.5 + (double)(dcenter[k])   / cnt)))\n                                    | (((int)(0.5 + (double)(dcenter[k+1]) / cnt))<<1)\n                                    | (((int)(0.5 + (double)(dcenter[k+2]) / cnt))<<2)\n                                    | (((int)(0.5 + (double)(dcenter[k+3]) / cnt))<<3)\n                                    | (((int)(0.5 + (double)(dcenter[k+4]) / cnt))<<4)\n                                    | (((int)(0.5 + (double)(dcenter[k+5]) / cnt))<<5)\n                                    | (((int)(0.5 + (double)(dcenter[k+6]) / cnt))<<6)\n                                    | (((int)(0.5 + (double)(dcenter[k+7]) / cnt))<<7));\n                }\n            }\n\n            std::vector<int> new_centroids(indices_length);\n            std::vector<DistanceType> dists(indices_length);\n\n            // reassign points to clusters\n            KMeansDistanceComputer<ElementType**> invoker(\n                        distance_, dataset_, branching, indices, centers, veclen_, new_centroids, dists);\n            parallel_for_(cv::Range(0, (int)indices_length), invoker);\n\n            for (int i=0; i < indices_length; ++i) {\n                DistanceType dist(dists[i]);\n                int new_centroid(new_centroids[i]);\n                if (dist > radiuses[new_centroid]) {\n                    radiuses[new_centroid] = dist;\n                }\n                if (new_centroid != belongs_to[i]) {\n                    count[belongs_to[i]]--;\n                    count[new_centroid]++;\n                    belongs_to[i] = new_centroid;\n                    converged = false;\n                }\n            }\n\n            for (int i=0; i<branching; ++i) {\n                // if one cluster converges to an empty cluster,\n                // move an element into that cluster\n                if (count[i]==0) {\n                    int j = (i+1)%branching;\n                    while (count[j]<=1) {\n                        j = (j+1)%branching;\n                    }\n\n                    for (int k=0; k<indices_length; ++k) {\n                        if (belongs_to[k]==j) {\n                            // for cluster j, we move the furthest element from the center to the empty cluster i\n                            if ( distance_(dataset_[indices[k]], centers[j], veclen_) == radiuses[j] ) {\n                                belongs_to[k] = i;\n                                count[j]--;\n                                count[i]++;\n                                break;\n                            }\n                        }\n                    }\n                    converged = false;\n                }\n            }\n        }\n    }\n\n\n    void refineDnaClustering(int* indices, int indices_length, int branching, CentersType** centers,\n                                  std::vector<DistanceType>& radiuses, int* belongs_to, int* count)\n    {\n        for (int i=0; i<branching; ++i) {\n            centers[i] = new CentersType[veclen_];\n            memoryCounter_ += (int)(veclen_*sizeof(CentersType));\n        }\n\n        const unsigned int histos_veclen = static_cast<unsigned int>(\n                    veclen_*sizeof(CentersType)*(HISTOS_PER_BASE*BASE_PER_CHAR));\n        cv::AutoBuffer<unsigned int> histos_buf(branching*histos_veclen);\n        Matrix<unsigned int> histos(histos_buf.data(), branching, histos_veclen);\n\n        bool converged = false;\n        int iteration = 0;\n        while (!converged && iteration<iterations_) {\n            converged = true;\n            iteration++;\n\n            // compute the new cluster centers\n            for (int i=0; i<branching; ++i) {\n                memset(histos[i],0,sizeof(unsigned int)*histos_veclen);\n                radiuses[i] = 0;\n            }\n            for (int i=0; i<indices_length; ++i) {\n                unsigned char* vec = (unsigned char*)dataset_[indices[i]];\n                unsigned int* h = histos[belongs_to[i]];\n                for (size_t k=0, l=0; k<histos_veclen; k+=HISTOS_PER_BASE*BASE_PER_CHAR, ++l) {\n                    h[k +     ((vec[l])    & 0x03)]++;\n                    h[k + 4 + ((vec[l]>>2) & 0x03)]++;\n                    h[k + 8 + ((vec[l]>>4) & 0x03)]++;\n                    h[k +12 + ((vec[l]>>6) & 0x03)]++;\n                }\n            }\n            for (int i=0; i<branching; ++i) {\n                unsigned int* h = histos[i];\n                unsigned char* charCenter = (unsigned char*)centers[i];\n                for (size_t k=0, l=0; k<histos_veclen; k+=HISTOS_PER_BASE*BASE_PER_CHAR, ++l) {\n                    charCenter[l]= (h[k] > h[k+1] ? h[k+2] > h[k+3] ? h[k]   > h[k+2] ? 0x00 : 0x10\n                                                                    : h[k]   > h[k+3] ? 0x00 : 0x11\n                                                  : h[k+2] > h[k+3] ? h[k+1] > h[k+2] ? 0x01 : 0x10\n                                                                    : h[k+1] > h[k+3] ? 0x01 : 0x11)\n                                 | (h[k+4]>h[k+5] ? h[k+6] > h[k+7] ? h[k+4] > h[k+6] ? 0x00   : 0x1000\n                                                                    : h[k+4] > h[k+7] ? 0x00   : 0x1100\n                                                  : h[k+6] > h[k+7] ? h[k+5] > h[k+6] ? 0x0100 : 0x1000\n                                                                    : h[k+5] > h[k+7] ? 0x0100 : 0x1100)\n                                 | (h[k+8]>h[k+9] ? h[k+10]>h[k+11] ? h[k+8] >h[k+10] ? 0x00   : 0x100000\n                                                                    : h[k+8] >h[k+11] ? 0x00   : 0x110000\n                                                  : h[k+10]>h[k+11] ? h[k+9] >h[k+10] ? 0x010000 : 0x100000\n                                                                    : h[k+9] >h[k+11] ? 0x010000 : 0x110000)\n                                 | (h[k+12]>h[k+13] ? h[k+14]>h[k+15] ? h[k+12] >h[k+14] ? 0x00   : 0x10000000\n                                                                      : h[k+12] >h[k+15] ? 0x00   : 0x11000000\n                                                    : h[k+14]>h[k+15] ? h[k+13] >h[k+14] ? 0x01000000 : 0x10000000\n                                                                      : h[k+13] >h[k+15] ? 0x01000000 : 0x11000000);\n                }\n            }\n\n            std::vector<int> new_centroids(indices_length);\n            std::vector<DistanceType> dists(indices_length);\n\n            // reassign points to clusters\n            KMeansDistanceComputer<ElementType**> invoker(\n                        distance_, dataset_, branching, indices, centers, veclen_, new_centroids, dists);\n            parallel_for_(cv::Range(0, (int)indices_length), invoker);\n\n            for (int i=0; i < indices_length; ++i) {\n                DistanceType dist(dists[i]);\n                int new_centroid(new_centroids[i]);\n                if (dist > radiuses[new_centroid]) {\n                    radiuses[new_centroid] = dist;\n                }\n                if (new_centroid != belongs_to[i]) {\n                    count[belongs_to[i]]--;\n                    count[new_centroid]++;\n                    belongs_to[i] = new_centroid;\n                    converged = false;\n                }\n            }\n\n            for (int i=0; i<branching; ++i) {\n                // if one cluster converges to an empty cluster,\n                // move an element into that cluster\n                if (count[i]==0) {\n                    int j = (i+1)%branching;\n                    while (count[j]<=1) {\n                        j = (j+1)%branching;\n                    }\n\n                    for (int k=0; k<indices_length; ++k) {\n                        if (belongs_to[k]==j) {\n                            // for cluster j, we move the furthest element from the center to the empty cluster i\n                            if ( distance_(dataset_[indices[k]], centers[j], veclen_) == radiuses[j] ) {\n                                belongs_to[k] = i;\n                                count[j]--;\n                                count[i]++;\n                                break;\n                            }\n                        }\n                    }\n                    converged = false;\n                }\n            }\n        }\n    }\n\n\n    void computeSubClustering(KMeansNodePtr node, int* indices, int indices_length,\n                              int branching, int level, CentersType** centers,\n                              std::vector<DistanceType>& radiuses, int* belongs_to, int* count)\n    {\n        // compute kmeans clustering for each of the resulting clusters\n        node->childs = pool_.allocate<KMeansNodePtr>(branching);\n        int start = 0;\n        int end = start;\n        for (int c=0; c<branching; ++c) {\n            int s = count[c];\n\n            DistanceType variance = 0;\n            DistanceType mean_radius =0;\n            for (int i=0; i<indices_length; ++i) {\n                if (belongs_to[i]==c) {\n                    DistanceType d = distance_(dataset_[indices[i]], ZeroIterator<ElementType>(), veclen_);\n                    variance += d;\n                    mean_radius += static_cast<DistanceType>( sqrt(d) );\n                    std::swap(indices[i],indices[end]);\n                    std::swap(belongs_to[i],belongs_to[end]);\n                    end++;\n                }\n            }\n            variance /= s;\n            mean_radius /= s;\n            variance -= distance_(centers[c], ZeroIterator<ElementType>(), veclen_);\n\n            node->childs[c] = pool_.allocate<KMeansNode>();\n            std::memset(node->childs[c], 0, sizeof(KMeansNode));\n            node->childs[c]->radius = radiuses[c];\n            node->childs[c]->pivot = centers[c];\n            node->childs[c]->variance = variance;\n            node->childs[c]->mean_radius = mean_radius;\n            computeClustering(node->childs[c],indices+start, end-start, branching, level+1);\n            start=end;\n        }\n    }\n\n\n    void computeAnyBitfieldSubClustering(KMeansNodePtr node, int* indices, int indices_length,\n                              int branching, int level, CentersType** centers,\n                              std::vector<DistanceType>& radiuses, int* belongs_to, int* count)\n    {\n        // compute kmeans clustering for each of the resulting clusters\n        node->childs = pool_.allocate<KMeansNodePtr>(branching);\n        int start = 0;\n        int end = start;\n        for (int c=0; c<branching; ++c) {\n            int s = count[c];\n\n            unsigned long long variance = 0ull;\n            DistanceType mean_radius =0;\n            for (int i=0; i<indices_length; ++i) {\n                if (belongs_to[i]==c) {\n                    DistanceType d = distance_(dataset_[indices[i]], ZeroIterator<ElementType>(), veclen_);\n                    variance += static_cast<unsigned long long>( ensureSquareDistance<Distance>(d) );\n                    mean_radius += ensureSimpleDistance<Distance>(d);\n                    std::swap(indices[i],indices[end]);\n                    std::swap(belongs_to[i],belongs_to[end]);\n                    end++;\n                }\n            }\n            mean_radius = static_cast<DistanceType>(\n                        0.5f + static_cast<float>(mean_radius) / static_cast<float>(s));\n            variance = static_cast<unsigned long long>(\n                        0.5 + static_cast<double>(variance) / static_cast<double>(s));\n            variance -= static_cast<unsigned long long>(\n                        ensureSquareDistance<Distance>(\n                            distance_(centers[c], ZeroIterator<ElementType>(), veclen_)));\n\n            node->childs[c] = pool_.allocate<KMeansNode>();\n            std::memset(node->childs[c], 0, sizeof(KMeansNode));\n            node->childs[c]->radius = radiuses[c];\n            node->childs[c]->pivot = centers[c];\n            node->childs[c]->variance = static_cast<DistanceType>(variance);\n            node->childs[c]->mean_radius = mean_radius;\n            computeClustering(node->childs[c],indices+start, end-start, branching, level+1);\n            start=end;\n        }\n    }\n\n\n    template<typename DistType>\n    void refineAndSplitClustering(\n            KMeansNodePtr node, int* indices, int indices_length, int branching,\n            int level, CentersType** centers, std::vector<DistanceType>& radiuses,\n            int* belongs_to, int* count, const DistType* identifier)\n    {\n        (void)identifier;\n        refineClustering(indices, indices_length, branching, centers, radiuses, belongs_to, count);\n\n        computeSubClustering(node, indices, indices_length, branching,\n                             level, centers, radiuses, belongs_to, count);\n    }\n\n\n    /**\n     * The methods responsible with doing the recursive hierarchical clustering on\n     * binary vectors.\n     * As some might have heard that KMeans on binary data doesn't make sense,\n     * it's worth a little explanation why it actually fairly works. As\n     * with the Hierarchical Clustering algortihm, we seed several centers for the\n     * current node by picking some of its points. Then in a first pass each point\n     * of the node is then related to its closest center. Now let's have a look at\n     * the 5 central dimensions of the 9 following points:\n     *\n     * xxxxxx11100xxxxx (1)\n     * xxxxxx11010xxxxx (2)\n     * xxxxxx11001xxxxx (3)\n     * xxxxxx10110xxxxx (4)\n     * xxxxxx10101xxxxx (5)\n     * xxxxxx10011xxxxx (6)\n     * xxxxxx01110xxxxx (7)\n     * xxxxxx01101xxxxx (8)\n     * xxxxxx01011xxxxx (9)\n     * sum   _____\n     * of 1: 66555\n     *\n     * Even if the barycenter notion doesn't apply, we can set a center\n     * xxxxxx11111xxxxx that will better fit the five dimensions we are focusing\n     * on for these points.\n     *\n     * Note that convergence isn't ensured anymore. In practice, using Gonzales\n     * as seeding algorithm should be fine for getting convergence (\"iterations\"\n     * value can be set to -1). But with KMeans++ seeding you should definitely\n     * set a maximum number of iterations (but make it higher than the \"iterations\"\n     * default value of 11).\n     *\n     * Params:\n     *     node = the node to cluster\n     *     indices = indices of the points belonging to the current node\n     *     indices_length = number of points in the current node\n     *     branching = the branching factor to use in the clustering\n     *     level = 0 for the root node, it increases with the subdivision levels\n     *     centers = clusters centers to compute\n     *     radiuses = radiuses of clusters\n     *     belongs_to = LookUp Table returning, for a given indice id, the center id it belongs to\n     *     count = array storing the number of indices for a given center id\n     *     identifier = dummy pointer on an instance of Distance (use to branch correctly among templates)\n     */\n    void refineAndSplitClustering(\n            KMeansNodePtr node, int* indices, int indices_length, int branching,\n            int level, CentersType** centers, std::vector<DistanceType>& radiuses,\n            int* belongs_to, int* count, const cvflann::HammingLUT* identifier)\n    {\n        (void)identifier;\n        refineBitfieldClustering(\n                    indices, indices_length, branching, centers, radiuses, belongs_to, count);\n\n        computeAnyBitfieldSubClustering(node, indices, indices_length, branching,\n                                        level, centers, radiuses, belongs_to, count);\n    }\n\n\n    void refineAndSplitClustering(\n            KMeansNodePtr node, int* indices, int indices_length, int branching,\n            int level, CentersType** centers, std::vector<DistanceType>& radiuses,\n            int* belongs_to, int* count, const cvflann::Hamming<unsigned char>* identifier)\n    {\n        (void)identifier;\n        refineBitfieldClustering(\n                    indices, indices_length, branching, centers, radiuses, belongs_to, count);\n\n        computeAnyBitfieldSubClustering(node, indices, indices_length, branching,\n                                        level, centers, radiuses, belongs_to, count);\n    }\n\n\n    void refineAndSplitClustering(\n            KMeansNodePtr node, int* indices, int indices_length, int branching,\n            int level, CentersType** centers, std::vector<DistanceType>& radiuses,\n            int* belongs_to, int* count, const cvflann::Hamming2<unsigned char>* identifier)\n    {\n        (void)identifier;\n        refineBitfieldClustering(\n                    indices, indices_length, branching, centers, radiuses, belongs_to, count);\n\n        computeAnyBitfieldSubClustering(node, indices, indices_length, branching,\n                                        level, centers, radiuses, belongs_to, count);\n    }\n\n\n    void refineAndSplitClustering(\n            KMeansNodePtr node, int* indices, int indices_length, int branching,\n            int level, CentersType** centers, std::vector<DistanceType>& radiuses,\n            int* belongs_to, int* count, const cvflann::DNAmmingLUT* identifier)\n    {\n        (void)identifier;\n        refineDnaClustering(\n                    indices, indices_length, branching, centers, radiuses, belongs_to, count);\n\n        computeAnyBitfieldSubClustering(node, indices, indices_length, branching,\n                                        level, centers, radiuses, belongs_to, count);\n    }\n\n\n    void refineAndSplitClustering(\n            KMeansNodePtr node, int* indices, int indices_length, int branching,\n            int level, CentersType** centers, std::vector<DistanceType>& radiuses,\n            int* belongs_to, int* count, const cvflann::DNAmming2<unsigned char>* identifier)\n    {\n        (void)identifier;\n        refineDnaClustering(\n                    indices, indices_length, branching, centers, radiuses, belongs_to, count);\n\n        computeAnyBitfieldSubClustering(node, indices, indices_length, branching,\n                                        level, centers, radiuses, belongs_to, count);\n    }\n\n\n    /**\n     * The method responsible with actually doing the recursive hierarchical\n     * clustering\n     *\n     * Params:\n     *     node = the node to cluster\n     *     indices = indices of the points belonging to the current node\n     *     branching = the branching factor to use in the clustering\n     *\n     * TODO: for 1-sized clusters don't store a cluster center (it's the same as the single cluster point)\n     */\n    void computeClustering(KMeansNodePtr node, int* indices, int indices_length, int branching, int level)\n    {\n        node->size = indices_length;\n        node->level = level;\n\n        if (indices_length < branching) {\n            node->indices = indices;\n            std::sort(node->indices,node->indices+indices_length);\n            node->childs = NULL;\n            return;\n        }\n\n        cv::AutoBuffer<int> centers_idx_buf(branching);\n        int* centers_idx = centers_idx_buf.data();\n        int centers_length;\n        (this->*chooseCenters)(branching, indices, indices_length, centers_idx, centers_length);\n\n        if (centers_length<branching) {\n            node->indices = indices;\n            std::sort(node->indices,node->indices+indices_length);\n            node->childs = NULL;\n            return;\n        }\n\n\n        std::vector<DistanceType> radiuses(branching);\n        cv::AutoBuffer<int> count_buf(branching);\n        int* count = count_buf.data();\n        for (int i=0; i<branching; ++i) {\n            radiuses[i] = 0;\n            count[i] = 0;\n        }\n\n        //\tassign points to clusters\n        cv::AutoBuffer<int> belongs_to_buf(indices_length);\n        int* belongs_to = belongs_to_buf.data();\n        for (int i=0; i<indices_length; ++i) {\n            DistanceType sq_dist = distance_(dataset_[indices[i]], dataset_[centers_idx[0]], veclen_);\n            belongs_to[i] = 0;\n            for (int j=1; j<branching; ++j) {\n                DistanceType new_sq_dist = distance_(dataset_[indices[i]], dataset_[centers_idx[j]], veclen_);\n                if (sq_dist>new_sq_dist) {\n                    belongs_to[i] = j;\n                    sq_dist = new_sq_dist;\n                }\n            }\n            if (sq_dist>radiuses[belongs_to[i]]) {\n                radiuses[belongs_to[i]] = sq_dist;\n            }\n            count[belongs_to[i]]++;\n        }\n\n        CentersType** centers = new CentersType*[branching];\n\n        Distance* dummy = NULL;\n        refineAndSplitClustering(node, indices, indices_length, branching, level,\n                                 centers, radiuses, belongs_to, count, dummy);\n\n        delete[] centers;\n    }\n\n\n    /**\n     * Performs one descent in the hierarchical k-means tree. The branches not\n     * visited are stored in a priority queue.\n     *\n     * Params:\n     *      node = node to explore\n     *      result = container for the k-nearest neighbors found\n     *      vec = query points\n     *      checks = how many points in the dataset have been checked so far\n     *      maxChecks = maximum dataset points to checks\n     */\n\n\n    void findNN(KMeansNodePtr node, ResultSet<DistanceType>& result, const ElementType* vec, int& checks, int maxChecks,\n                Heap<BranchSt>* heap)\n    {\n        // Ignore those clusters that are too far away\n        {\n            DistanceType bsq = distance_(vec, node->pivot, veclen_);\n            DistanceType rsq = node->radius;\n            DistanceType wsq = result.worstDist();\n\n            if (isSquareDistance<Distance>())\n            {\n                DistanceType val = bsq-rsq-wsq;\n                if ((val>0) && (val*val > 4*rsq*wsq))\n                    return;\n            }\n            else\n            {\n                if (bsq-rsq > wsq)\n                    return;\n            }\n        }\n\n        if (node->childs==NULL) {\n            if ((checks>=maxChecks) && result.full()) {\n                return;\n            }\n            checks += node->size;\n            for (int i=0; i<node->size; ++i) {\n                int index = node->indices[i];\n                DistanceType dist = distance_(dataset_[index], vec, veclen_);\n                result.addPoint(dist, index);\n            }\n        }\n        else {\n            DistanceType* domain_distances = new DistanceType[branching_];\n            int closest_center = exploreNodeBranches(node, vec, domain_distances, heap);\n            delete[] domain_distances;\n            findNN(node->childs[closest_center],result,vec, checks, maxChecks, heap);\n        }\n    }\n\n    /**\n     * Helper function that computes the nearest childs of a node to a given query point.\n     * Params:\n     *     node = the node\n     *     q = the query point\n     *     distances = array with the distances to each child node.\n     * Returns:\n     */\n    int exploreNodeBranches(KMeansNodePtr node, const ElementType* q, DistanceType* domain_distances, Heap<BranchSt>* heap)\n    {\n\n        int best_index = 0;\n        domain_distances[best_index] = distance_(q, node->childs[best_index]->pivot, veclen_);\n        for (int i=1; i<branching_; ++i) {\n            domain_distances[i] = distance_(q, node->childs[i]->pivot, veclen_);\n            if (domain_distances[i]<domain_distances[best_index]) {\n                best_index = i;\n            }\n        }\n\n        //\t\tfloat* best_center = node->childs[best_index]->pivot;\n        for (int i=0; i<branching_; ++i) {\n            if (i != best_index) {\n                domain_distances[i] -= cvflann::round<DistanceType>(\n                                        cb_index_*node->childs[i]->variance );\n\n                //\t\t\t\tfloat dist_to_border = getDistanceToBorder(node.childs[i].pivot,best_center,q);\n                //\t\t\t\tif (domain_distances[i]<dist_to_border) {\n                //\t\t\t\t\tdomain_distances[i] = dist_to_border;\n                //\t\t\t\t}\n                heap->insert(BranchSt(node->childs[i],domain_distances[i]));\n            }\n        }\n\n        return best_index;\n    }\n\n\n    /**\n     * Function the performs exact nearest neighbor search by traversing the entire tree.\n     */\n    void findExactNN(KMeansNodePtr node, ResultSet<DistanceType>& result, const ElementType* vec)\n    {\n        // Ignore those clusters that are too far away\n        {\n            DistanceType bsq = distance_(vec, node->pivot, veclen_);\n            DistanceType rsq = node->radius;\n            DistanceType wsq = result.worstDist();\n\n            if (isSquareDistance<Distance>())\n            {\n                DistanceType val = bsq-rsq-wsq;\n                if ((val>0) && (val*val > 4*rsq*wsq))\n                    return;\n            }\n            else\n            {\n                if (bsq-rsq > wsq)\n                    return;\n            }\n        }\n\n\n        if (node->childs==NULL) {\n            for (int i=0; i<node->size; ++i) {\n                int index = node->indices[i];\n                DistanceType dist = distance_(dataset_[index], vec, veclen_);\n                result.addPoint(dist, index);\n            }\n        }\n        else {\n            int* sort_indices = new int[branching_];\n\n            getCenterOrdering(node, vec, sort_indices);\n\n            for (int i=0; i<branching_; ++i) {\n                findExactNN(node->childs[sort_indices[i]],result,vec);\n            }\n\n            delete[] sort_indices;\n        }\n    }\n\n\n    /**\n     * Helper function.\n     *\n     * I computes the order in which to traverse the child nodes of a particular node.\n     */\n    void getCenterOrdering(KMeansNodePtr node, const ElementType* q, int* sort_indices)\n    {\n        DistanceType* domain_distances = new DistanceType[branching_];\n        for (int i=0; i<branching_; ++i) {\n            DistanceType dist = distance_(q, node->childs[i]->pivot, veclen_);\n\n            int j=0;\n            while (domain_distances[j]<dist && j<i)\n                j++;\n            for (int k=i; k>j; --k) {\n                domain_distances[k] = domain_distances[k-1];\n                sort_indices[k] = sort_indices[k-1];\n            }\n            domain_distances[j] = dist;\n            sort_indices[j] = i;\n        }\n        delete[] domain_distances;\n    }\n\n    /**\n     * Method that computes the squared distance from the query point q\n     * from inside region with center c to the border between this\n     * region and the region with center p\n     */\n    DistanceType getDistanceToBorder(DistanceType* p, DistanceType* c, DistanceType* q)\n    {\n        DistanceType sum = 0;\n        DistanceType sum2 = 0;\n\n        for (int i=0; i<veclen_; ++i) {\n            DistanceType t = c[i]-p[i];\n            sum += t*(q[i]-(c[i]+p[i])/2);\n            sum2 += t*t;\n        }\n\n        return sum*sum/sum2;\n    }\n\n\n    /**\n     * Helper function the descends in the hierarchical k-means tree by splitting those clusters that minimize\n     * the overall variance of the clustering.\n     * Params:\n     *     root = root node\n     *     clusters = array with clusters centers (return value)\n     *     varianceValue = variance of the clustering (return value)\n     * Returns:\n     */\n    int getMinVarianceClusters(KMeansNodePtr root, KMeansNodePtr* clusters, int clusters_length, DistanceType& varianceValue)\n    {\n        int clusterCount = 1;\n        clusters[0] = root;\n\n        DistanceType meanVariance = root->variance*root->size;\n\n        while (clusterCount<clusters_length) {\n            DistanceType minVariance = (std::numeric_limits<DistanceType>::max)();\n            int splitIndex = -1;\n\n            for (int i=0; i<clusterCount; ++i) {\n                if (clusters[i]->childs != NULL) {\n\n                    DistanceType variance = meanVariance - clusters[i]->variance*clusters[i]->size;\n\n                    for (int j=0; j<branching_; ++j) {\n                        variance += clusters[i]->childs[j]->variance*clusters[i]->childs[j]->size;\n                    }\n                    if (variance<minVariance) {\n                        minVariance = variance;\n                        splitIndex = i;\n                    }\n                }\n            }\n\n            if (splitIndex==-1) break;\n            if ( (branching_+clusterCount-1) > clusters_length) break;\n\n            meanVariance = minVariance;\n\n            // split node\n            KMeansNodePtr toSplit = clusters[splitIndex];\n            clusters[splitIndex] = toSplit->childs[0];\n            for (int i=1; i<branching_; ++i) {\n                clusters[clusterCount++] = toSplit->childs[i];\n            }\n        }\n\n        varianceValue = meanVariance/root->size;\n        return clusterCount;\n    }\n\nprivate:\n    /** The branching factor used in the hierarchical k-means clustering */\n    int branching_;\n\n    /** Number of kmeans trees (default is one) */\n    int trees_;\n\n    /** Maximum number of iterations to use when performing k-means clustering */\n    int iterations_;\n\n    /** Algorithm for choosing the cluster centers */\n    flann_centers_init_t centers_init_;\n\n    /**\n     * Cluster border index. This is used in the tree search phase when determining\n     * the closest cluster to explore next. A zero value takes into account only\n     * the cluster centres, a value greater then zero also take into account the size\n     * of the cluster.\n     */\n    float cb_index_;\n\n    /**\n     * The dataset used by this index\n     */\n    const Matrix<ElementType> dataset_;\n\n    /** Index parameters */\n    IndexParams index_params_;\n\n    /**\n     * Number of features in the dataset.\n     */\n    size_t size_;\n\n    /**\n     * Length of each feature.\n     */\n    size_t veclen_;\n\n    /**\n     * The root node in the tree.\n     */\n    KMeansNodePtr* root_;\n\n    /**\n     *  Array of indices to vectors in the dataset.\n     */\n    int** indices_;\n\n    /**\n     * The distance\n     */\n    Distance distance_;\n\n    /**\n     * Pooled memory allocator.\n     */\n    PooledAllocator pool_;\n\n    /**\n     * Memory occupied by the index.\n     */\n    int memoryCounter_;\n};\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_KMEANS_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/linear_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_LINEAR_INDEX_H_\n#define OPENCV_FLANN_LINEAR_INDEX_H_\n\n//! @cond IGNORED\n\n#include \"nn_index.h\"\n\nnamespace cvflann\n{\n\nstruct LinearIndexParams : public IndexParams\n{\n    LinearIndexParams()\n    {\n        (* this)[\"algorithm\"] = FLANN_INDEX_LINEAR;\n    }\n};\n\ntemplate <typename Distance>\nclass LinearIndex : public NNIndex<Distance>\n{\npublic:\n\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n\n    LinearIndex(const Matrix<ElementType>& inputData, const IndexParams& params = LinearIndexParams(),\n                Distance d = Distance()) :\n        dataset_(inputData), index_params_(params), distance_(d)\n    {\n    }\n\n    LinearIndex(const LinearIndex&);\n    LinearIndex& operator=(const LinearIndex&);\n\n    flann_algorithm_t getType() const CV_OVERRIDE\n    {\n        return FLANN_INDEX_LINEAR;\n    }\n\n\n    size_t size() const CV_OVERRIDE\n    {\n        return dataset_.rows;\n    }\n\n    size_t veclen() const CV_OVERRIDE\n    {\n        return dataset_.cols;\n    }\n\n\n    int usedMemory() const CV_OVERRIDE\n    {\n        return 0;\n    }\n\n    void buildIndex() CV_OVERRIDE\n    {\n        /* nothing to do here for linear search */\n    }\n\n    void saveIndex(FILE*) CV_OVERRIDE\n    {\n        /* nothing to do here for linear search */\n    }\n\n\n    void loadIndex(FILE*) CV_OVERRIDE\n    {\n        /* nothing to do here for linear search */\n\n        index_params_[\"algorithm\"] = getType();\n    }\n\n    void findNeighbors(ResultSet<DistanceType>& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/) CV_OVERRIDE\n    {\n        ElementType* data = dataset_.data;\n        for (size_t i = 0; i < dataset_.rows; ++i, data += dataset_.cols) {\n            DistanceType dist = distance_(data, vec, dataset_.cols);\n            resultSet.addPoint(dist, (int)i);\n        }\n    }\n\n    IndexParams getParameters() const CV_OVERRIDE\n    {\n        return index_params_;\n    }\n\nprivate:\n    /** The dataset */\n    const Matrix<ElementType> dataset_;\n    /** Index parameters */\n    IndexParams index_params_;\n    /** Index distance */\n    Distance distance_;\n\n};\n\n}\n\n//! @endcond\n\n#endif // OPENCV_FLANN_LINEAR_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/logger.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_LOGGER_H\n#define OPENCV_FLANN_LOGGER_H\n\n//! @cond IGNORED\n\n#include <stdio.h>\n#include <stdarg.h>\n\n#include \"defines.h\"\n\n\nnamespace cvflann\n{\n\nclass Logger\n{\n    Logger() : stream(stdout), logLevel(FLANN_LOG_WARN) {}\n\n    ~Logger()\n    {\n        if ((stream!=NULL)&&(stream!=stdout)) {\n            fclose(stream);\n        }\n    }\n\n    static Logger& instance()\n    {\n        static Logger logger;\n        return logger;\n    }\n\n    void _setDestination(const char* name)\n    {\n        if (name==NULL) {\n            stream = stdout;\n        }\n        else {\n#ifdef _MSC_VER\n            if (fopen_s(&stream, name, \"w\") != 0)\n                stream = NULL;\n#else\n            stream = fopen(name,\"w\");\n#endif\n            if (stream == NULL) {\n                stream = stdout;\n            }\n        }\n    }\n\n    int _log(int level, const char* fmt, va_list arglist)\n    {\n        if (level > logLevel ) return -1;\n        int ret = vfprintf(stream, fmt, arglist);\n        return ret;\n    }\n\npublic:\n    /**\n     * Sets the logging level. All messages with lower priority will be ignored.\n     * @param level Logging level\n     */\n    static void setLevel(int level) { instance().logLevel = level; }\n\n    /**\n     * Sets the logging destination\n     * @param name Filename or NULL for console\n     */\n    static void setDestination(const char* name) { instance()._setDestination(name); }\n\n    /**\n     * Print log message\n     * @param level Log level\n     * @param fmt Message format\n     * @return\n     */\n    static int log(int level, const char* fmt, ...)\n    {\n        va_list arglist;\n        va_start(arglist, fmt);\n        int ret = instance()._log(level,fmt,arglist);\n        va_end(arglist);\n        return ret;\n    }\n\n#define LOG_METHOD(NAME,LEVEL) \\\n    static int NAME(const char* fmt, ...) \\\n    { \\\n        va_list ap; \\\n        va_start(ap, fmt); \\\n        int ret = instance()._log(LEVEL, fmt, ap); \\\n        va_end(ap); \\\n        return ret; \\\n    }\n\n    LOG_METHOD(fatal, FLANN_LOG_FATAL)\n    LOG_METHOD(error, FLANN_LOG_ERROR)\n    LOG_METHOD(warn, FLANN_LOG_WARN)\n    LOG_METHOD(info, FLANN_LOG_INFO)\n\nprivate:\n    FILE* stream;\n    int logLevel;\n};\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_LOGGER_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/lsh_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n/***********************************************************************\n * Author: Vincent Rabaud\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_LSH_INDEX_H_\n#define OPENCV_FLANN_LSH_INDEX_H_\n\n//! @cond IGNORED\n\n#include <algorithm>\n#include <cstring>\n#include <map>\n#include <vector>\n\n#include \"nn_index.h\"\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"heap.h\"\n#include \"lsh_table.h\"\n#include \"allocator.h\"\n#include \"random.h\"\n#include \"saving.h\"\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable: 4702) //disable unreachable code\n#endif\n\nnamespace cvflann\n{\n\nstruct LshIndexParams : public IndexParams\n{\n    LshIndexParams(int table_number = 12, int key_size = 20, int multi_probe_level = 2)\n    {\n        (*this)[\"algorithm\"] = FLANN_INDEX_LSH;\n        // The number of hash tables to use\n        (*this)[\"table_number\"] = table_number;\n        // The length of the key in the hash tables\n        (*this)[\"key_size\"] = key_size;\n        // Number of levels to use in multi-probe (0 for standard LSH)\n        (*this)[\"multi_probe_level\"] = multi_probe_level;\n    }\n};\n\n/**\n * Locality-sensitive hashing  index\n *\n * Contains the tables and other information for indexing a set of points\n * for nearest-neighbor matching.\n */\ntemplate<typename Distance>\nclass LshIndex : public NNIndex<Distance>\n{\npublic:\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\n    /** Constructor\n     * @param input_data dataset with the input features\n     * @param params parameters passed to the LSH algorithm\n     * @param d the distance used\n     */\n    LshIndex(const Matrix<ElementType>& input_data, const IndexParams& params = LshIndexParams(),\n             Distance d = Distance()) :\n        dataset_(input_data), index_params_(params), distance_(d)\n    {\n        // cv::flann::IndexParams sets integer params as 'int', so it is used with get_param\n        // in place of 'unsigned int'\n        table_number_ = get_param(index_params_,\"table_number\",12);\n        key_size_ = get_param(index_params_,\"key_size\",20);\n        multi_probe_level_ = get_param(index_params_,\"multi_probe_level\",2);\n\n        feature_size_ = (unsigned)dataset_.cols;\n        fill_xor_mask(0, key_size_, multi_probe_level_, xor_masks_);\n    }\n\n\n    LshIndex(const LshIndex&);\n    LshIndex& operator=(const LshIndex&);\n\n    /**\n     * Builds the index\n     */\n    void buildIndex() CV_OVERRIDE\n    {\n        tables_.resize(table_number_);\n        for (int i = 0; i < table_number_; ++i) {\n            lsh::LshTable<ElementType>& table = tables_[i];\n            table = lsh::LshTable<ElementType>(feature_size_, key_size_);\n\n            // Add the features to the table\n            table.add(dataset_);\n        }\n    }\n\n    flann_algorithm_t getType() const CV_OVERRIDE\n    {\n        return FLANN_INDEX_LSH;\n    }\n\n\n    void saveIndex(FILE* stream) CV_OVERRIDE\n    {\n        save_value(stream,table_number_);\n        save_value(stream,key_size_);\n        save_value(stream,multi_probe_level_);\n        save_value(stream, dataset_);\n    }\n\n    void loadIndex(FILE* stream) CV_OVERRIDE\n    {\n        load_value(stream, table_number_);\n        load_value(stream, key_size_);\n        load_value(stream, multi_probe_level_);\n        load_value(stream, dataset_);\n        // Building the index is so fast we can afford not storing it\n        buildIndex();\n\n        index_params_[\"algorithm\"] = getType();\n        index_params_[\"table_number\"] = table_number_;\n        index_params_[\"key_size\"] = key_size_;\n        index_params_[\"multi_probe_level\"] = multi_probe_level_;\n    }\n\n    /**\n     *  Returns size of index.\n     */\n    size_t size() const CV_OVERRIDE\n    {\n        return dataset_.rows;\n    }\n\n    /**\n     * Returns the length of an index feature.\n     */\n    size_t veclen() const CV_OVERRIDE\n    {\n        return feature_size_;\n    }\n\n    /**\n     * Computes the index memory usage\n     * Returns: memory used by the index\n     */\n    int usedMemory() const CV_OVERRIDE\n    {\n        return (int)(dataset_.rows * sizeof(int));\n    }\n\n\n    IndexParams getParameters() const CV_OVERRIDE\n    {\n        return index_params_;\n    }\n\n    /**\n     * \\brief Perform k-nearest neighbor search\n     * \\param[in] queries The query points for which to find the nearest neighbors\n     * \\param[out] indices The indices of the nearest neighbors found\n     * \\param[out] dists Distances to the nearest neighbors found\n     * \\param[in] knn Number of nearest neighbors to return\n     * \\param[in] params Search parameters\n     */\n    virtual void knnSearch(const Matrix<ElementType>& queries, Matrix<int>& indices, Matrix<DistanceType>& dists, int knn, const SearchParams& params) CV_OVERRIDE\n    {\n        CV_Assert(queries.cols == veclen());\n        CV_Assert(indices.rows >= queries.rows);\n        CV_Assert(dists.rows >= queries.rows);\n        CV_Assert(int(indices.cols) >= knn);\n        CV_Assert(int(dists.cols) >= knn);\n\n\n        KNNUniqueResultSet<DistanceType> resultSet(knn);\n        for (size_t i = 0; i < queries.rows; i++) {\n            resultSet.clear();\n            std::fill_n(indices[i], knn, -1);\n            std::fill_n(dists[i], knn, std::numeric_limits<DistanceType>::max());\n            findNeighbors(resultSet, queries[i], params);\n            if (get_param(params,\"sorted\",true)) resultSet.sortAndCopy(indices[i], dists[i], knn);\n            else resultSet.copy(indices[i], dists[i], knn);\n        }\n    }\n\n\n    /**\n     * Find set of nearest neighbors to vec. Their indices are stored inside\n     * the result object.\n     *\n     * Params:\n     *     result = the result object in which the indices of the nearest-neighbors are stored\n     *     vec = the vector for which to search the nearest neighbors\n     *     maxCheck = the maximum number of restarts (in a best-bin-first manner)\n     */\n    void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& /*searchParams*/) CV_OVERRIDE\n    {\n        getNeighbors(vec, result);\n    }\n\nprivate:\n    /** Defines the comparator on score and index\n     */\n    typedef std::pair<float, unsigned int> ScoreIndexPair;\n    struct SortScoreIndexPairOnSecond\n    {\n        bool operator()(const ScoreIndexPair& left, const ScoreIndexPair& right) const\n        {\n            return left.second < right.second;\n        }\n    };\n\n    /** Fills the different xor masks to use when getting the neighbors in multi-probe LSH\n     * @param key the key we build neighbors from\n     * @param lowest_index the lowest index of the bit set\n     * @param level the multi-probe level we are at\n     * @param xor_masks all the xor mask\n     */\n    void fill_xor_mask(lsh::BucketKey key, int lowest_index, unsigned int level,\n                       std::vector<lsh::BucketKey>& xor_masks)\n    {\n        xor_masks.push_back(key);\n        if (level == 0) return;\n        for (int index = lowest_index - 1; index >= 0; --index) {\n            // Create a new key\n            lsh::BucketKey new_key = key | (1 << index);\n            fill_xor_mask(new_key, index, level - 1, xor_masks);\n        }\n    }\n\n    /** Performs the approximate nearest-neighbor search.\n     * @param vec the feature to analyze\n     * @param do_radius flag indicating if we check the radius too\n     * @param radius the radius if it is a radius search\n     * @param do_k flag indicating if we limit the number of nn\n     * @param k_nn the number of nearest neighbors\n     * @param checked_average used for debugging\n     */\n    void getNeighbors(const ElementType* vec, bool /*do_radius*/, float radius, bool do_k, unsigned int k_nn,\n                      float& /*checked_average*/)\n    {\n        static std::vector<ScoreIndexPair> score_index_heap;\n\n        if (do_k) {\n            unsigned int worst_score = std::numeric_limits<unsigned int>::max();\n            typename std::vector<lsh::LshTable<ElementType> >::const_iterator table = tables_.begin();\n            typename std::vector<lsh::LshTable<ElementType> >::const_iterator table_end = tables_.end();\n            for (; table != table_end; ++table) {\n                size_t key = table->getKey(vec);\n                std::vector<lsh::BucketKey>::const_iterator xor_mask = xor_masks_.begin();\n                std::vector<lsh::BucketKey>::const_iterator xor_mask_end = xor_masks_.end();\n                for (; xor_mask != xor_mask_end; ++xor_mask) {\n                    size_t sub_key = key ^ (*xor_mask);\n                    const lsh::Bucket* bucket = table->getBucketFromKey(sub_key);\n                    if (bucket == 0) continue;\n\n                    // Go over each descriptor index\n                    std::vector<lsh::FeatureIndex>::const_iterator training_index = bucket->begin();\n                    std::vector<lsh::FeatureIndex>::const_iterator last_training_index = bucket->end();\n                    DistanceType hamming_distance;\n\n                    // Process the rest of the candidates\n                    for (; training_index < last_training_index; ++training_index) {\n                        hamming_distance = distance_(vec, dataset_[*training_index], dataset_.cols);\n\n                        if (hamming_distance < worst_score) {\n                            // Insert the new element\n                            score_index_heap.push_back(ScoreIndexPair(hamming_distance, training_index));\n                            std::push_heap(score_index_heap.begin(), score_index_heap.end());\n\n                            if (score_index_heap.size() > (unsigned int)k_nn) {\n                                // Remove the highest distance value as we have too many elements\n                                std::pop_heap(score_index_heap.begin(), score_index_heap.end());\n                                score_index_heap.pop_back();\n                                // Keep track of the worst score\n                                worst_score = score_index_heap.front().first;\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        else {\n            typename std::vector<lsh::LshTable<ElementType> >::const_iterator table = tables_.begin();\n            typename std::vector<lsh::LshTable<ElementType> >::const_iterator table_end = tables_.end();\n            for (; table != table_end; ++table) {\n                size_t key = table->getKey(vec);\n                std::vector<lsh::BucketKey>::const_iterator xor_mask = xor_masks_.begin();\n                std::vector<lsh::BucketKey>::const_iterator xor_mask_end = xor_masks_.end();\n                for (; xor_mask != xor_mask_end; ++xor_mask) {\n                    size_t sub_key = key ^ (*xor_mask);\n                    const lsh::Bucket* bucket = table->getBucketFromKey(sub_key);\n                    if (bucket == 0) continue;\n\n                    // Go over each descriptor index\n                    std::vector<lsh::FeatureIndex>::const_iterator training_index = bucket->begin();\n                    std::vector<lsh::FeatureIndex>::const_iterator last_training_index = bucket->end();\n                    DistanceType hamming_distance;\n\n                    // Process the rest of the candidates\n                    for (; training_index < last_training_index; ++training_index) {\n                        // Compute the Hamming distance\n                        hamming_distance = distance_(vec, dataset_[*training_index], dataset_.cols);\n                        if (hamming_distance < radius) score_index_heap.push_back(ScoreIndexPair(hamming_distance, training_index));\n                    }\n                }\n            }\n        }\n    }\n\n    /** Performs the approximate nearest-neighbor search.\n     * This is a slower version than the above as it uses the ResultSet\n     * @param vec the feature to analyze\n     */\n    void getNeighbors(const ElementType* vec, ResultSet<DistanceType>& result)\n    {\n        typename std::vector<lsh::LshTable<ElementType> >::const_iterator table = tables_.begin();\n        typename std::vector<lsh::LshTable<ElementType> >::const_iterator table_end = tables_.end();\n        for (; table != table_end; ++table) {\n            size_t key = table->getKey(vec);\n            std::vector<lsh::BucketKey>::const_iterator xor_mask = xor_masks_.begin();\n            std::vector<lsh::BucketKey>::const_iterator xor_mask_end = xor_masks_.end();\n            for (; xor_mask != xor_mask_end; ++xor_mask) {\n                size_t sub_key = key ^ (*xor_mask);\n                const lsh::Bucket* bucket = table->getBucketFromKey((lsh::BucketKey)sub_key);\n                if (bucket == 0) continue;\n\n                // Go over each descriptor index\n                std::vector<lsh::FeatureIndex>::const_iterator training_index = bucket->begin();\n                std::vector<lsh::FeatureIndex>::const_iterator last_training_index = bucket->end();\n                DistanceType hamming_distance;\n\n                // Process the rest of the candidates\n                for (; training_index < last_training_index; ++training_index) {\n                    // Compute the Hamming distance\n                    hamming_distance = distance_(vec, dataset_[*training_index], (int)dataset_.cols);\n                    result.addPoint(hamming_distance, *training_index);\n                }\n            }\n        }\n    }\n\n    /** The different hash tables */\n    std::vector<lsh::LshTable<ElementType> > tables_;\n\n    /** The data the LSH tables where built from */\n    Matrix<ElementType> dataset_;\n\n    /** The size of the features (as ElementType[]) */\n    unsigned int feature_size_;\n\n    IndexParams index_params_;\n\n    /** table number */\n    int table_number_;\n    /** key size */\n    int key_size_;\n    /** How far should we look for neighbors in multi-probe LSH */\n    int multi_probe_level_;\n\n    /** The XOR masks to apply to a key to get the neighboring buckets */\n    std::vector<lsh::BucketKey> xor_masks_;\n\n    Distance distance_;\n};\n}\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n//! @endcond\n\n#endif //OPENCV_FLANN_LSH_INDEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/lsh_table.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n/***********************************************************************\n * Author: Vincent Rabaud\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_LSH_TABLE_H_\n#define OPENCV_FLANN_LSH_TABLE_H_\n\n//! @cond IGNORED\n\n#include <algorithm>\n#include <iostream>\n#include <iomanip>\n#include <limits.h>\n// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP\n#ifdef __GXX_EXPERIMENTAL_CXX0X__\n#  define USE_UNORDERED_MAP 1\n#else\n#  define USE_UNORDERED_MAP 0\n#endif\n#if USE_UNORDERED_MAP\n#include <unordered_map>\n#else\n#include <map>\n#endif\n#include <math.h>\n#include <stddef.h>\n\n#include \"dynamic_bitset.h\"\n#include \"matrix.h\"\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable: 4702) //disable unreachable code\n#endif\n\n\nnamespace cvflann\n{\n\nnamespace lsh\n{\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** What is stored in an LSH bucket\n */\ntypedef uint32_t FeatureIndex;\n/** The id from which we can get a bucket back in an LSH table\n */\ntypedef unsigned int BucketKey;\n\n/** A bucket in an LSH table\n */\ntypedef std::vector<FeatureIndex> Bucket;\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** POD for stats about an LSH table\n */\nstruct LshStats\n{\n    std::vector<unsigned int> bucket_sizes_;\n    size_t n_buckets_;\n    size_t bucket_size_mean_;\n    size_t bucket_size_median_;\n    size_t bucket_size_min_;\n    size_t bucket_size_max_;\n    size_t bucket_size_std_dev;\n    /** Each contained vector contains three value: beginning/end for interval, number of elements in the bin\n     */\n    std::vector<std::vector<unsigned int> > size_histogram_;\n};\n\n/** Overload the << operator for LshStats\n * @param out the streams\n * @param stats the stats to display\n * @return the streams\n */\ninline std::ostream& operator <<(std::ostream& out, const LshStats& stats)\n{\n    int w = 20;\n    out << \"Lsh Table Stats:\\n\" << std::setw(w) << std::setiosflags(std::ios::right) << \"N buckets : \"\n    << stats.n_buckets_ << \"\\n\" << std::setw(w) << std::setiosflags(std::ios::right) << \"mean size : \"\n    << std::setiosflags(std::ios::left) << stats.bucket_size_mean_ << \"\\n\" << std::setw(w)\n    << std::setiosflags(std::ios::right) << \"median size : \" << stats.bucket_size_median_ << \"\\n\" << std::setw(w)\n    << std::setiosflags(std::ios::right) << \"min size : \" << std::setiosflags(std::ios::left)\n    << stats.bucket_size_min_ << \"\\n\" << std::setw(w) << std::setiosflags(std::ios::right) << \"max size : \"\n    << std::setiosflags(std::ios::left) << stats.bucket_size_max_;\n\n    // Display the histogram\n    out << std::endl << std::setw(w) << std::setiosflags(std::ios::right) << \"histogram : \"\n    << std::setiosflags(std::ios::left);\n    for (std::vector<std::vector<unsigned int> >::const_iterator iterator = stats.size_histogram_.begin(), end =\n             stats.size_histogram_.end(); iterator != end; ++iterator) out << (*iterator)[0] << \"-\" << (*iterator)[1] << \": \" << (*iterator)[2] << \",  \";\n\n    return out;\n}\n\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Lsh hash table. As its key is a sub-feature, and as usually\n * the size of it is pretty small, we keep it as a continuous memory array.\n * The value is an index in the corpus of features (we keep it as an unsigned\n * int for pure memory reasons, it could be a size_t)\n */\ntemplate<typename ElementType>\nclass LshTable\n{\npublic:\n    /** A container of all the feature indices. Optimized for space\n     */\n#if USE_UNORDERED_MAP\n    typedef std::unordered_map<BucketKey, Bucket> BucketsSpace;\n#else\n    typedef std::map<BucketKey, Bucket> BucketsSpace;\n#endif\n\n    /** A container of all the feature indices. Optimized for speed\n     */\n    typedef std::vector<Bucket> BucketsSpeed;\n\n    /** Default constructor\n     */\n    LshTable()\n    {\n        key_size_ = 0;\n        feature_size_ = 0;\n        speed_level_ = kArray;\n    }\n\n    /** Default constructor\n     * Create the mask and allocate the memory\n     * @param feature_size is the size of the feature (considered as a ElementType[])\n     * @param key_size is the number of bits that are turned on in the feature\n     */\n    LshTable(unsigned int feature_size, unsigned int key_size)\n    {\n        feature_size_ = feature_size;\n        CV_UNUSED(key_size);\n        CV_Error(cv::Error::StsUnsupportedFormat, \"LSH is not implemented for that type\" );\n    }\n\n    /** Add a feature to the table\n     * @param value the value to store for that feature\n     * @param feature the feature itself\n     */\n    void add(unsigned int value, const ElementType* feature)\n    {\n        // Add the value to the corresponding bucket\n        BucketKey key = (lsh::BucketKey)getKey(feature);\n\n        switch (speed_level_) {\n        case kArray:\n            // That means we get the buckets from an array\n            buckets_speed_[key].push_back(value);\n            break;\n        case kBitsetHash:\n            // That means we can check the bitset for the presence of a key\n            key_bitset_.set(key);\n            buckets_space_[key].push_back(value);\n            break;\n        case kHash:\n        {\n            // That means we have to check for the hash table for the presence of a key\n            buckets_space_[key].push_back(value);\n            break;\n        }\n        }\n    }\n\n    /** Add a set of features to the table\n     * @param dataset the values to store\n     */\n    void add(Matrix<ElementType> dataset)\n    {\n#if USE_UNORDERED_MAP\n        buckets_space_.rehash((buckets_space_.size() + dataset.rows) * 1.2);\n#endif\n        // Add the features to the table\n        for (unsigned int i = 0; i < dataset.rows; ++i) add(i, dataset[i]);\n        // Now that the table is full, optimize it for speed/space\n        optimize();\n    }\n\n    /** Get a bucket given the key\n     * @param key\n     * @return\n     */\n    inline const Bucket* getBucketFromKey(BucketKey key) const\n    {\n        // Generate other buckets\n        switch (speed_level_) {\n        case kArray:\n            // That means we get the buckets from an array\n            return &buckets_speed_[key];\n            break;\n        case kBitsetHash:\n            // That means we can check the bitset for the presence of a key\n            if (key_bitset_.test(key)) return &buckets_space_.find(key)->second;\n            else return 0;\n            break;\n        case kHash:\n        {\n            // That means we have to check for the hash table for the presence of a key\n            BucketsSpace::const_iterator bucket_it, bucket_end = buckets_space_.end();\n            bucket_it = buckets_space_.find(key);\n            // Stop here if that bucket does not exist\n            if (bucket_it == bucket_end) return 0;\n            else return &bucket_it->second;\n            break;\n        }\n        }\n        return 0;\n    }\n\n    /** Compute the sub-signature of a feature\n     */\n    size_t getKey(const ElementType* /*feature*/) const\n    {\n        CV_Error(cv::Error::StsUnsupportedFormat, \"LSH is not implemented for that type\" );\n        return 0;\n    }\n\n    /** Get statistics about the table\n     * @return\n     */\n    LshStats getStats() const;\n\nprivate:\n    /** defines the speed fo the implementation\n     * kArray uses a vector for storing data\n     * kBitsetHash uses a hash map but checks for the validity of a key with a bitset\n     * kHash uses a hash map only\n     */\n    enum SpeedLevel\n    {\n        kArray, kBitsetHash, kHash\n    };\n\n    /** Initialize some variables\n     */\n    void initialize(size_t key_size)\n    {\n        const size_t key_size_lower_bound = 1;\n        //a value (size_t(1) << key_size) must fit the size_t type so key_size has to be strictly less than size of size_t\n        const size_t key_size_upper_bound = (std::min)(sizeof(BucketKey) * CHAR_BIT + 1, sizeof(size_t) * CHAR_BIT);\n        if (key_size < key_size_lower_bound || key_size >= key_size_upper_bound)\n        {\n            CV_Error(cv::Error::StsBadArg, cv::format(\"Invalid key_size (=%d). Valid values for your system are %d <= key_size < %d.\", (int)key_size, (int)key_size_lower_bound, (int)key_size_upper_bound));\n        }\n\n        speed_level_ = kHash;\n        key_size_ = (unsigned)key_size;\n    }\n\n    /** Optimize the table for speed/space\n     */\n    void optimize()\n    {\n        // If we are already using the fast storage, no need to do anything\n        if (speed_level_ == kArray) return;\n\n        // Use an array if it will be more than half full\n        if (buckets_space_.size() > ((size_t(1) << key_size_) / 2)) {\n            speed_level_ = kArray;\n            // Fill the array version of it\n            buckets_speed_.resize(size_t(1) << key_size_);\n            for (BucketsSpace::const_iterator key_bucket = buckets_space_.begin(); key_bucket != buckets_space_.end(); ++key_bucket) buckets_speed_[key_bucket->first] = key_bucket->second;\n\n            // Empty the hash table\n            buckets_space_.clear();\n            return;\n        }\n\n        // If the bitset is going to use less than 10% of the RAM of the hash map (at least 1 size_t for the key and two\n        // for the vector) or less than 512MB (key_size_ <= 30)\n        if (((std::max(buckets_space_.size(), buckets_speed_.size()) * CHAR_BIT * 3 * sizeof(BucketKey)) / 10\n             >= (size_t(1) << key_size_)) || (key_size_ <= 32)) {\n            speed_level_ = kBitsetHash;\n            key_bitset_.resize(size_t(1) << key_size_);\n            key_bitset_.reset();\n            // Try with the BucketsSpace\n            for (BucketsSpace::const_iterator key_bucket = buckets_space_.begin(); key_bucket != buckets_space_.end(); ++key_bucket) key_bitset_.set(key_bucket->first);\n        }\n        else {\n            speed_level_ = kHash;\n            key_bitset_.clear();\n        }\n    }\n\n    /** The vector of all the buckets if they are held for speed\n     */\n    BucketsSpeed buckets_speed_;\n\n    /** The hash table of all the buckets in case we cannot use the speed version\n     */\n    BucketsSpace buckets_space_;\n\n    /** What is used to store the data */\n    SpeedLevel speed_level_;\n\n    /** If the subkey is small enough, it will keep track of which subkeys are set through that bitset\n     * That is just a speedup so that we don't look in the hash table (which can be mush slower that checking a bitset)\n     */\n    DynamicBitset key_bitset_;\n\n    /** The size of the sub-signature in bits\n     */\n    unsigned int key_size_;\n\n    unsigned int feature_size_;\n\n    // Members only used for the unsigned char specialization\n    /** The mask to apply to a feature to get the hash key\n     * Only used in the unsigned char case\n     */\n    std::vector<size_t> mask_;\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Specialization for unsigned char\n\ntemplate<>\ninline LshTable<unsigned char>::LshTable(unsigned int feature_size, unsigned int subsignature_size)\n{\n    feature_size_ = feature_size;\n    initialize(subsignature_size);\n    // Allocate the mask\n    mask_ = std::vector<size_t>((feature_size * sizeof(char) + sizeof(size_t) - 1) / sizeof(size_t), 0);\n\n    // A bit brutal but fast to code\n    std::vector<int> indices(feature_size * CHAR_BIT);\n    for (size_t i = 0; i < feature_size * CHAR_BIT; ++i) indices[i] = (int)i;\n#ifndef OPENCV_FLANN_USE_STD_RAND\n    cv::randShuffle(indices);\n#else\n    std::random_shuffle(indices.begin(), indices.end());\n#endif\n\n    // Generate a random set of order of subsignature_size_ bits\n    for (unsigned int i = 0; i < key_size_; ++i) {\n        size_t index = indices[i];\n\n        // Set that bit in the mask\n        size_t divisor = CHAR_BIT * sizeof(size_t);\n        size_t idx = index / divisor; //pick the right size_t index\n        mask_[idx] |= size_t(1) << (index % divisor); //use modulo to find the bit offset\n    }\n\n    // Set to 1 if you want to display the mask for debug\n#if 0\n    {\n        size_t bcount = 0;\n        BOOST_FOREACH(size_t mask_block, mask_){\n            out << std::setw(sizeof(size_t) * CHAR_BIT / 4) << std::setfill('0') << std::hex << mask_block\n                << std::endl;\n            bcount += __builtin_popcountll(mask_block);\n        }\n        out << \"bit count : \" << std::dec << bcount << std::endl;\n        out << \"mask size : \" << mask_.size() << std::endl;\n        return out;\n    }\n#endif\n}\n\n/** Return the Subsignature of a feature\n * @param feature the feature to analyze\n */\ntemplate<>\ninline size_t LshTable<unsigned char>::getKey(const unsigned char* feature) const\n{\n    // no need to check if T is dividable by sizeof(size_t) like in the Hamming\n    // distance computation as we have a mask\n    // FIXIT: This is bad assumption, because we reading tail bytes after of the allocated features buffer\n    const size_t* feature_block_ptr = reinterpret_cast<const size_t*> ((const void*)feature);\n\n    // Figure out the subsignature of the feature\n    // Given the feature ABCDEF, and the mask 001011, the output will be\n    // 000CEF\n    size_t subsignature = 0;\n    size_t bit_index = 1;\n\n    for (unsigned i = 0; i < feature_size_; i += sizeof(size_t)) {\n        // get the mask and signature blocks\n        size_t feature_block;\n        if (i <= feature_size_ - sizeof(size_t))\n        {\n            feature_block = *feature_block_ptr;\n        }\n        else\n        {\n            size_t tmp = 0;\n            memcpy(&tmp, feature_block_ptr, feature_size_ - i); // preserve bytes order\n            feature_block = tmp;\n        }\n        size_t mask_block = mask_[i / sizeof(size_t)];\n        while (mask_block) {\n            // Get the lowest set bit in the mask block\n            size_t lowest_bit = mask_block & (-(ptrdiff_t)mask_block);\n            // Add it to the current subsignature if necessary\n            subsignature += (feature_block & lowest_bit) ? bit_index : 0;\n            // Reset the bit in the mask block\n            mask_block ^= lowest_bit;\n            // increment the bit index for the subsignature\n            bit_index <<= 1;\n        }\n        // Check the next feature block\n        ++feature_block_ptr;\n    }\n    return subsignature;\n}\n\ntemplate<>\ninline LshStats LshTable<unsigned char>::getStats() const\n{\n    LshStats stats;\n    stats.bucket_size_mean_ = 0;\n    if ((buckets_speed_.empty()) && (buckets_space_.empty())) {\n        stats.n_buckets_ = 0;\n        stats.bucket_size_median_ = 0;\n        stats.bucket_size_min_ = 0;\n        stats.bucket_size_max_ = 0;\n        return stats;\n    }\n\n    if (!buckets_speed_.empty()) {\n        for (BucketsSpeed::const_iterator pbucket = buckets_speed_.begin(); pbucket != buckets_speed_.end(); ++pbucket) {\n            stats.bucket_sizes_.push_back((lsh::FeatureIndex)pbucket->size());\n            stats.bucket_size_mean_ += pbucket->size();\n        }\n        stats.bucket_size_mean_ /= buckets_speed_.size();\n        stats.n_buckets_ = buckets_speed_.size();\n    }\n    else {\n        for (BucketsSpace::const_iterator x = buckets_space_.begin(); x != buckets_space_.end(); ++x) {\n            stats.bucket_sizes_.push_back((lsh::FeatureIndex)x->second.size());\n            stats.bucket_size_mean_ += x->second.size();\n        }\n        stats.bucket_size_mean_ /= buckets_space_.size();\n        stats.n_buckets_ = buckets_space_.size();\n    }\n\n    std::sort(stats.bucket_sizes_.begin(), stats.bucket_sizes_.end());\n\n    //  BOOST_FOREACH(int size, stats.bucket_sizes_)\n    //          std::cout << size << \" \";\n    //  std::cout << std::endl;\n    stats.bucket_size_median_ = stats.bucket_sizes_[stats.bucket_sizes_.size() / 2];\n    stats.bucket_size_min_ = stats.bucket_sizes_.front();\n    stats.bucket_size_max_ = stats.bucket_sizes_.back();\n\n    // TODO compute mean and std\n    /*float mean, stddev;\n       stats.bucket_size_mean_ = mean;\n       stats.bucket_size_std_dev = stddev;*/\n\n    // Include a histogram of the buckets\n    unsigned int bin_start = 0;\n    unsigned int bin_end = 20;\n    bool is_new_bin = true;\n    for (std::vector<unsigned int>::iterator iterator = stats.bucket_sizes_.begin(), end = stats.bucket_sizes_.end(); iterator\n         != end; )\n        if (*iterator < bin_end) {\n            if (is_new_bin) {\n                stats.size_histogram_.push_back(std::vector<unsigned int>(3, 0));\n                stats.size_histogram_.back()[0] = bin_start;\n                stats.size_histogram_.back()[1] = bin_end - 1;\n                is_new_bin = false;\n            }\n            ++stats.size_histogram_.back()[2];\n            ++iterator;\n        }\n        else {\n            bin_start += 20;\n            bin_end += 20;\n            is_new_bin = true;\n        }\n\n    return stats;\n}\n\n// End the two namespaces\n}\n}\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_LSH_TABLE_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/matrix.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_DATASET_H_\n#define OPENCV_FLANN_DATASET_H_\n\n//! @cond IGNORED\n\n#include <stdio.h>\n\nnamespace cvflann\n{\n\n/**\n * Class that implements a simple rectangular matrix stored in a memory buffer and\n * provides convenient matrix-like access using the [] operators.\n */\ntemplate <typename T>\nclass Matrix\n{\npublic:\n    typedef T type;\n\n    size_t rows;\n    size_t cols;\n    size_t stride;\n    T* data;\n\n    Matrix() : rows(0), cols(0), stride(0), data(NULL)\n    {\n    }\n\n    Matrix(T* data_, size_t rows_, size_t cols_, size_t stride_ = 0) :\n        rows(rows_), cols(cols_),  stride(stride_), data(data_)\n    {\n        if (stride==0) stride = cols;\n    }\n\n    /**\n     * Convenience function for deallocating the storage data.\n     */\n    CV_DEPRECATED void free()\n    {\n        fprintf(stderr, \"The cvflann::Matrix<T>::free() method is deprecated \"\n                \"and it does not do any memory deallocation any more.  You are\"\n                \"responsible for deallocating the matrix memory (by doing\"\n                \"'delete[] matrix.data' for example)\");\n    }\n\n    /**\n     * Operator that return a (pointer to a) row of the data.\n     */\n    T* operator[](size_t index) const\n    {\n        return data+index*stride;\n    }\n};\n\n\nclass UntypedMatrix\n{\npublic:\n    size_t rows;\n    size_t cols;\n    void* data;\n    flann_datatype_t type;\n\n    UntypedMatrix(void* data_, long rows_, long cols_) :\n        rows(rows_), cols(cols_), data(data_)\n    {\n    }\n\n    ~UntypedMatrix()\n    {\n    }\n\n\n    template<typename T>\n    Matrix<T> as()\n    {\n        return Matrix<T>((T*)data, rows, cols);\n    }\n};\n\n\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_DATASET_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/miniflann.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_MINIFLANN_HPP\n#define OPENCV_MINIFLANN_HPP\n\n//! @cond IGNORED\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/flann/defines.h\"\n\nnamespace cv\n{\n\nnamespace flann\n{\n\nenum FlannIndexType {\n    FLANN_INDEX_TYPE_8U = CV_8U,\n    FLANN_INDEX_TYPE_8S = CV_8S,\n    FLANN_INDEX_TYPE_16U = CV_16U,\n    FLANN_INDEX_TYPE_16S = CV_16S,\n    FLANN_INDEX_TYPE_32S = CV_32S,\n    FLANN_INDEX_TYPE_32F = CV_32F,\n    FLANN_INDEX_TYPE_64F = CV_64F,\n    FLANN_INDEX_TYPE_STRING,\n    FLANN_INDEX_TYPE_BOOL,\n    FLANN_INDEX_TYPE_ALGORITHM,\n    LAST_VALUE_FLANN_INDEX_TYPE = FLANN_INDEX_TYPE_ALGORITHM\n};\n\nstruct CV_EXPORTS IndexParams\n{\n    IndexParams();\n    ~IndexParams();\n\n    String getString(const String& key, const String& defaultVal=String()) const;\n    int getInt(const String& key, int defaultVal=-1) const;\n    double getDouble(const String& key, double defaultVal=-1) const;\n\n    void setString(const String& key, const String& value);\n    void setInt(const String& key, int value);\n    void setDouble(const String& key, double value);\n    void setFloat(const String& key, float value);\n    void setBool(const String& key, bool value);\n    void setAlgorithm(int value);\n\n    // FIXIT: replace by void write(FileStorage& fs) const + read()\n    void getAll(std::vector<String>& names,\n                std::vector<FlannIndexType>& types,\n                std::vector<String>& strValues,\n                std::vector<double>& numValues) const;\n\n    void* params;\n\nprivate:\n    IndexParams(const IndexParams &); // copy disabled\n    IndexParams& operator=(const IndexParams &); // assign disabled\n};\n\nstruct CV_EXPORTS KDTreeIndexParams : public IndexParams\n{\n    KDTreeIndexParams(int trees=4);\n};\n\nstruct CV_EXPORTS LinearIndexParams : public IndexParams\n{\n    LinearIndexParams();\n};\n\nstruct CV_EXPORTS CompositeIndexParams : public IndexParams\n{\n    CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11,\n                         cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f );\n};\n\nstruct CV_EXPORTS AutotunedIndexParams : public IndexParams\n{\n    AutotunedIndexParams(float target_precision = 0.8f, float build_weight = 0.01f,\n                         float memory_weight = 0, float sample_fraction = 0.1f);\n};\n\nstruct CV_EXPORTS HierarchicalClusteringIndexParams : public IndexParams\n{\n    HierarchicalClusteringIndexParams(int branching = 32,\n                      cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, int trees = 4, int leaf_size = 100 );\n};\n\nstruct CV_EXPORTS KMeansIndexParams : public IndexParams\n{\n    KMeansIndexParams(int branching = 32, int iterations = 11,\n                      cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f );\n};\n\nstruct CV_EXPORTS LshIndexParams : public IndexParams\n{\n    LshIndexParams(int table_number, int key_size, int multi_probe_level);\n};\n\nstruct CV_EXPORTS SavedIndexParams : public IndexParams\n{\n    SavedIndexParams(const String& filename);\n};\n\nstruct CV_EXPORTS SearchParams : public IndexParams\n{\n    SearchParams( int checks, float eps, bool sorted, bool explore_all_trees );\n    SearchParams( int checks = 32, float eps = 0, bool sorted = true );\n};\n\nclass CV_EXPORTS_W Index\n{\npublic:\n    CV_WRAP Index();\n    CV_WRAP Index(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);\n    virtual ~Index();\n\n    CV_WRAP virtual void build(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);\n    CV_WRAP virtual void knnSearch(InputArray query, OutputArray indices,\n                   OutputArray dists, int knn, const SearchParams& params=SearchParams());\n\n    CV_WRAP virtual int radiusSearch(InputArray query, OutputArray indices,\n                             OutputArray dists, double radius, int maxResults,\n                             const SearchParams& params=SearchParams());\n\n    CV_WRAP virtual void save(const String& filename) const;\n    CV_WRAP virtual bool load(InputArray features, const String& filename);\n    CV_WRAP virtual void release();\n    CV_WRAP cvflann::flann_distance_t getDistance() const;\n    CV_WRAP cvflann::flann_algorithm_t getAlgorithm() const;\n\nprotected:\n    bool load_(const String& filename);\n\n    cvflann::flann_distance_t distType;\n    cvflann::flann_algorithm_t algo;\n    int featureType;\n    void* index;\n    Mat features_clone;  // index may store features pointer internally for searching, so avoid dangling pointers: https://github.com/opencv/opencv/issues/17553\n};\n\n} } // namespace cv::flann\n\n//! @endcond\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/nn_index.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_NNINDEX_H\n#define OPENCV_FLANN_NNINDEX_H\n\n#include \"matrix.h\"\n#include \"result_set.h\"\n#include \"params.h\"\n\n//! @cond IGNORED\n\nnamespace cvflann\n{\n\n/**\n * Nearest-neighbour index base class\n */\ntemplate <typename Distance>\nclass NNIndex\n{\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::ResultType DistanceType;\n\npublic:\n\n    virtual ~NNIndex() {}\n\n    /**\n     * \\brief Builds the index\n     */\n    virtual void buildIndex() = 0;\n\n    /**\n     * \\brief Perform k-nearest neighbor search\n     * \\param[in] queries The query points for which to find the nearest neighbors\n     * \\param[out] indices The indices of the nearest neighbors found\n     * \\param[out] dists Distances to the nearest neighbors found\n     * \\param[in] knn Number of nearest neighbors to return\n     * \\param[in] params Search parameters\n     */\n    virtual void knnSearch(const Matrix<ElementType>& queries, Matrix<int>& indices, Matrix<DistanceType>& dists, int knn, const SearchParams& params)\n    {\n        CV_Assert(queries.cols == veclen());\n        CV_Assert(indices.rows >= queries.rows);\n        CV_Assert(dists.rows >= queries.rows);\n        CV_Assert(int(indices.cols) >= knn);\n        CV_Assert(int(dists.cols) >= knn);\n\n#if 0\n        KNNResultSet<DistanceType> resultSet(knn);\n        for (size_t i = 0; i < queries.rows; i++) {\n            resultSet.init(indices[i], dists[i]);\n            findNeighbors(resultSet, queries[i], params);\n        }\n#else\n        KNNUniqueResultSet<DistanceType> resultSet(knn);\n        for (size_t i = 0; i < queries.rows; i++) {\n            resultSet.clear();\n            findNeighbors(resultSet, queries[i], params);\n            if (get_param(params,\"sorted\",true)) resultSet.sortAndCopy(indices[i], dists[i], knn);\n            else resultSet.copy(indices[i], dists[i], knn);\n        }\n#endif\n    }\n\n    /**\n     * \\brief Perform radius search\n     * \\param[in] query The query point\n     * \\param[out] indices The indinces of the neighbors found within the given radius\n     * \\param[out] dists The distances to the nearest neighbors found\n     * \\param[in] radius The radius used for search\n     * \\param[in] params Search parameters\n     * \\returns Number of neighbors found\n     */\n    virtual int radiusSearch(const Matrix<ElementType>& query, Matrix<int>& indices, Matrix<DistanceType>& dists, float radius, const SearchParams& params)\n    {\n        if (query.rows != 1) {\n            fprintf(stderr, \"I can only search one feature at a time for range search\\n\");\n            return -1;\n        }\n        assert(query.cols == veclen());\n        assert(indices.cols == dists.cols);\n\n        int n = 0;\n        int* indices_ptr = NULL;\n        DistanceType* dists_ptr = NULL;\n        if (indices.cols > 0) {\n            n = (int)indices.cols;\n            indices_ptr = indices[0];\n            dists_ptr = dists[0];\n        }\n\n        RadiusUniqueResultSet<DistanceType> resultSet((DistanceType)radius);\n        resultSet.clear();\n        findNeighbors(resultSet, query[0], params);\n        if (n>0) {\n            if (get_param(params,\"sorted\",true)) resultSet.sortAndCopy(indices_ptr, dists_ptr, n);\n            else resultSet.copy(indices_ptr, dists_ptr, n);\n        }\n\n        return (int)resultSet.size();\n    }\n\n    /**\n     * \\brief Saves the index to a stream\n     * \\param stream The stream to save the index to\n     */\n    virtual void saveIndex(FILE* stream) = 0;\n\n    /**\n     * \\brief Loads the index from a stream\n     * \\param stream The stream from which the index is loaded\n     */\n    virtual void loadIndex(FILE* stream) = 0;\n\n    /**\n     * \\returns number of features in this index.\n     */\n    virtual size_t size() const = 0;\n\n    /**\n     * \\returns The dimensionality of the features in this index.\n     */\n    virtual size_t veclen() const = 0;\n\n    /**\n     * \\returns The amount of memory (in bytes) used by the index.\n     */\n    virtual int usedMemory() const = 0;\n\n    /**\n     * \\returns The index type (kdtree, kmeans,...)\n     */\n    virtual flann_algorithm_t getType() const = 0;\n\n    /**\n     * \\returns The index parameters\n     */\n    virtual IndexParams getParameters() const = 0;\n\n\n    /**\n     * \\brief Method that searches for nearest-neighbours\n     */\n    virtual void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) = 0;\n};\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_NNINDEX_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/object_factory.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_OBJECT_FACTORY_H_\n#define OPENCV_FLANN_OBJECT_FACTORY_H_\n\n//! @cond IGNORED\n\n#include <map>\n\nnamespace cvflann\n{\n\nclass CreatorNotFound\n{\n};\n\ntemplate<typename BaseClass,\n         typename UniqueIdType,\n         typename ObjectCreator = BaseClass* (*)()>\nclass ObjectFactory\n{\n    typedef ObjectFactory<BaseClass,UniqueIdType,ObjectCreator> ThisClass;\n    typedef std::map<UniqueIdType, ObjectCreator> ObjectRegistry;\n\n    // singleton class, private constructor\n    ObjectFactory() {}\n\npublic:\n\n    bool subscribe(UniqueIdType id, ObjectCreator creator)\n    {\n        if (object_registry.find(id) != object_registry.end()) return false;\n\n        object_registry[id] = creator;\n        return true;\n    }\n\n    bool unregister(UniqueIdType id)\n    {\n        return object_registry.erase(id) == 1;\n    }\n\n    ObjectCreator create(UniqueIdType id)\n    {\n        typename ObjectRegistry::const_iterator iter = object_registry.find(id);\n\n        if (iter == object_registry.end()) {\n            throw CreatorNotFound();\n        }\n\n        return iter->second;\n    }\n\n    static ThisClass& instance()\n    {\n        static ThisClass the_factory;\n        return the_factory;\n    }\nprivate:\n    ObjectRegistry object_registry;\n};\n\n}\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_OBJECT_FACTORY_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/params.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2011  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2011  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_PARAMS_H_\n#define OPENCV_FLANN_PARAMS_H_\n\n//! @cond IGNORED\n\n#include \"any.h\"\n#include \"general.h\"\n#include <iostream>\n#include <map>\n\n\nnamespace cvflann\n{\n\ntypedef std::map<cv::String, any> IndexParams;\n\nstruct SearchParams : public IndexParams\n{\n    SearchParams(int checks = 32, float eps = 0, bool sorted = true )\n    {\n        init(checks, eps, sorted, false);\n    }\n\n    SearchParams(int checks, float eps, bool sorted, bool explore_all_trees )\n    {\n        init(checks, eps, sorted, explore_all_trees);\n    }\n\n    void init(int checks = 32, float eps = 0, bool sorted = true, bool explore_all_trees = false )\n    {\n        // how many leafs to visit when searching for neighbours (-1 for unlimited)\n        (*this)[\"checks\"] = checks;\n        // search for eps-approximate neighbours (default: 0)\n        (*this)[\"eps\"] = eps;\n        // only for radius search, require neighbours sorted by distance (default: true)\n        (*this)[\"sorted\"] = sorted;\n        // if false, search stops at the tree reaching the number of  max checks (original behavior).\n        // When true, we do a descent in each tree and. Like before the alternative paths\n        // stored in the heap are not be processed further when max checks is reached.\n        (*this)[\"explore_all_trees\"] = explore_all_trees;\n    }\n};\n\n\ntemplate<typename T>\nT get_param(const IndexParams& params, cv::String name, const T& default_value)\n{\n    IndexParams::const_iterator it = params.find(name);\n    if (it != params.end()) {\n        return it->second.cast<T>();\n    }\n    else {\n        return default_value;\n    }\n}\n\ntemplate<typename T>\nT get_param(const IndexParams& params, cv::String name)\n{\n    IndexParams::const_iterator it = params.find(name);\n    if (it != params.end()) {\n        return it->second.cast<T>();\n    }\n    else {\n        FLANN_THROW(cv::Error::StsBadArg, cv::String(\"Missing parameter '\")+name+cv::String(\"' in the parameters given\"));\n    }\n}\n\ninline void print_params(const IndexParams& params, std::ostream& stream)\n{\n    IndexParams::const_iterator it;\n\n    for(it=params.begin(); it!=params.end(); ++it) {\n        stream << it->first << \" : \" << it->second << std::endl;\n    }\n}\n\ninline void print_params(const IndexParams& params)\n{\n    print_params(params, std::cout);\n}\n\n}\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_PARAMS_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/random.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_RANDOM_H\n#define OPENCV_FLANN_RANDOM_H\n\n//! @cond IGNORED\n\n#include <algorithm>\n#include <cstdlib>\n#include <vector>\n\nnamespace cvflann\n{\n\ninline int rand()\n{\n#ifndef OPENCV_FLANN_USE_STD_RAND\n#   if INT_MAX == RAND_MAX\n    int v = cv::theRNG().next() & INT_MAX;\n#   else\n    int v = cv::theRNG().uniform(0, RAND_MAX + 1);\n#   endif\n#else\n    int v = std::rand();\n#endif // OPENCV_FLANN_USE_STD_RAND\n    return v;\n}\n\n/**\n * Seeds the random number generator\n *  @param seed Random seed\n */\ninline void seed_random(unsigned int seed)\n{\n#ifndef OPENCV_FLANN_USE_STD_RAND\n    cv::theRNG() = cv::RNG(seed);\n#else\n    std::srand(seed);\n#endif\n}\n\n/*\n * Generates a random double value.\n */\n/**\n * Generates a random double value.\n * @param high Upper limit\n * @param low Lower limit\n * @return Random double value\n */\ninline double rand_double(double high = 1.0, double low = 0)\n{\n    return low + ((high-low) * (rand() / (RAND_MAX + 1.0)));\n}\n\n/**\n * Generates a random integer value.\n * @param high Upper limit\n * @param low Lower limit\n * @return Random integer value\n */\ninline int rand_int(int high = RAND_MAX, int low = 0)\n{\n    return low + (int) ( double(high-low) * (rand() / (RAND_MAX + 1.0)));\n}\n\n/**\n * Random number generator that returns a distinct number from\n * the [0,n) interval each time.\n */\nclass UniqueRandom\n{\n    std::vector<int> vals_;\n    int size_;\n    int counter_;\n\npublic:\n    /**\n     * Constructor.\n     * @param n Size of the interval from which to generate\n     * @return\n     */\n    UniqueRandom(int n)\n    {\n        init(n);\n    }\n\n    /**\n     * Initializes the number generator.\n     * @param n the size of the interval from which to generate random numbers.\n     */\n    void init(int n)\n    {\n        // create and initialize an array of size n\n        vals_.resize(n);\n        size_ = n;\n        for (int i = 0; i < size_; ++i) vals_[i] = i;\n\n        // shuffle the elements in the array\n#ifndef OPENCV_FLANN_USE_STD_RAND\n        cv::randShuffle(vals_);\n#else\n        std::random_shuffle(vals_.begin(), vals_.end());\n#endif\n\n        counter_ = 0;\n    }\n\n    /**\n     * Return a distinct random integer in greater or equal to 0 and less\n     * than 'n' on each call. It should be called maximum 'n' times.\n     * Returns: a random integer\n     */\n    int next()\n    {\n        if (counter_ == size_) {\n            return -1;\n        }\n        else {\n            return vals_[counter_++];\n        }\n    }\n};\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_RANDOM_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/result_set.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_RESULTSET_H\n#define OPENCV_FLANN_RESULTSET_H\n\n//! @cond IGNORED\n\n#include <algorithm>\n#include <cstring>\n#include <iostream>\n#include <limits>\n#include <set>\n#include <vector>\n\nnamespace cvflann\n{\n\n/* This record represents a branch point when finding neighbors in\n    the tree.  It contains a record of the minimum distance to the query\n    point, as well as the node at which the search resumes.\n */\n\ntemplate <typename T, typename DistanceType>\nstruct BranchStruct\n{\n    T node;           /* Tree node at which search resumes */\n    DistanceType mindist;     /* Minimum distance to query for all nodes below. */\n\n    BranchStruct() {}\n    BranchStruct(const T& aNode, DistanceType dist) : node(aNode), mindist(dist) {}\n\n    bool operator<(const BranchStruct<T, DistanceType>& rhs) const\n    {\n        return mindist<rhs.mindist;\n    }\n};\n\n\ntemplate <typename DistanceType>\nclass ResultSet\n{\npublic:\n    virtual ~ResultSet() {}\n\n    virtual bool full() const = 0;\n\n    virtual void addPoint(DistanceType dist, int index) = 0;\n\n    virtual DistanceType worstDist() const = 0;\n\n};\n\n/**\n * KNNSimpleResultSet does not ensure that the element it holds are unique.\n * Is used in those cases where the nearest neighbour algorithm used does not\n * attempt to insert the same element multiple times.\n */\ntemplate <typename DistanceType>\nclass KNNSimpleResultSet : public ResultSet<DistanceType>\n{\n    int* indices;\n    DistanceType* dists;\n    int capacity;\n    int count;\n    DistanceType worst_distance_;\n\npublic:\n    KNNSimpleResultSet(int capacity_) : capacity(capacity_), count(0)\n    {\n    }\n\n    void init(int* indices_, DistanceType* dists_)\n    {\n        indices = indices_;\n        dists = dists_;\n        count = 0;\n        worst_distance_ = (std::numeric_limits<DistanceType>::max)();\n        dists[capacity-1] = worst_distance_;\n    }\n\n    size_t size() const\n    {\n        return count;\n    }\n\n    bool full() const CV_OVERRIDE\n    {\n        return count == capacity;\n    }\n\n\n    void addPoint(DistanceType dist, int index) CV_OVERRIDE\n    {\n        if (dist >= worst_distance_) return;\n        int i;\n        for (i=count; i>0; --i) {\n#ifdef FLANN_FIRST_MATCH\n            if ( (dists[i-1]>dist) || ((dist==dists[i-1])&&(indices[i-1]>index)) )\n#else\n            if (dists[i-1]>dist)\n#endif\n            {\n                if (i<capacity) {\n                    dists[i] = dists[i-1];\n                    indices[i] = indices[i-1];\n                }\n            }\n            else break;\n        }\n        if (count < capacity) ++count;\n        dists[i] = dist;\n        indices[i] = index;\n        worst_distance_ = dists[capacity-1];\n    }\n\n    DistanceType worstDist() const CV_OVERRIDE\n    {\n        return worst_distance_;\n    }\n};\n\n/**\n * K-Nearest neighbour result set. Ensures that the elements inserted are unique\n */\ntemplate <typename DistanceType>\nclass KNNResultSet : public ResultSet<DistanceType>\n{\n    int* indices;\n    DistanceType* dists;\n    int capacity;\n    int count;\n    DistanceType worst_distance_;\n\npublic:\n    KNNResultSet(int capacity_)\n        : indices(NULL), dists(NULL), capacity(capacity_), count(0), worst_distance_(0)\n    {\n    }\n\n    void init(int* indices_, DistanceType* dists_)\n    {\n        indices = indices_;\n        dists = dists_;\n        count = 0;\n        worst_distance_ = (std::numeric_limits<DistanceType>::max)();\n        dists[capacity-1] = worst_distance_;\n    }\n\n    size_t size() const\n    {\n        return count;\n    }\n\n    bool full() const CV_OVERRIDE\n    {\n        return count == capacity;\n    }\n\n\n    void addPoint(DistanceType dist, int index) CV_OVERRIDE\n    {\n        CV_DbgAssert(indices);\n        CV_DbgAssert(dists);\n        if (dist >= worst_distance_) return;\n        int i;\n        for (i = count; i > 0; --i) {\n#ifdef FLANN_FIRST_MATCH\n            if ( (dists[i-1]<=dist) && ((dist!=dists[i-1])||(indices[i-1]<=index)) )\n#else\n            if (dists[i-1]<=dist)\n#endif\n            {\n                // Check for duplicate indices\n                for (int j = i; dists[j] == dist && j--;) {\n                    if (indices[j] == index) {\n                        return;\n                    }\n                }\n                break;\n            }\n        }\n\n        if (count < capacity) ++count;\n        for (int j = count-1; j > i; --j) {\n            dists[j] = dists[j-1];\n            indices[j] = indices[j-1];\n        }\n        dists[i] = dist;\n        indices[i] = index;\n        worst_distance_ = dists[capacity-1];\n    }\n\n    DistanceType worstDist() const CV_OVERRIDE\n    {\n        return worst_distance_;\n    }\n};\n\n\n/**\n * A result-set class used when performing a radius based search.\n */\ntemplate <typename DistanceType>\nclass RadiusResultSet : public ResultSet<DistanceType>\n{\n    DistanceType radius;\n    int* indices;\n    DistanceType* dists;\n    size_t capacity;\n    size_t count;\n\npublic:\n    RadiusResultSet(DistanceType radius_, int* indices_, DistanceType* dists_, int capacity_) :\n        radius(radius_), indices(indices_), dists(dists_), capacity(capacity_)\n    {\n        init();\n    }\n\n    ~RadiusResultSet()\n    {\n    }\n\n    void init()\n    {\n        count = 0;\n    }\n\n    size_t size() const\n    {\n        return count;\n    }\n\n    bool full() const\n    {\n        return true;\n    }\n\n    void addPoint(DistanceType dist, int index)\n    {\n        if (dist<radius) {\n            if ((capacity>0)&&(count < capacity)) {\n                dists[count] = dist;\n                indices[count] = index;\n            }\n            count++;\n        }\n    }\n\n    DistanceType worstDist() const\n    {\n        return radius;\n    }\n\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Class that holds the k NN neighbors\n * Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays\n */\ntemplate<typename DistanceType>\nclass UniqueResultSet : public ResultSet<DistanceType>\n{\npublic:\n    struct DistIndex\n    {\n        DistIndex(DistanceType dist, unsigned int index) :\n            dist_(dist), index_(index)\n        {\n        }\n        bool operator<(const DistIndex dist_index) const\n        {\n            return (dist_ < dist_index.dist_) || ((dist_ == dist_index.dist_) && index_ < dist_index.index_);\n        }\n        DistanceType dist_;\n        unsigned int index_;\n    };\n\n    /** Default constructor */\n    UniqueResultSet() :\n        is_full_(false), worst_distance_(std::numeric_limits<DistanceType>::max())\n    {\n    }\n\n    /** Check the status of the set\n     * @return true if we have k NN\n     */\n    inline bool full() const CV_OVERRIDE\n    {\n        return is_full_;\n    }\n\n    /** Remove all elements in the set\n     */\n    virtual void clear() = 0;\n\n    /** Copy the set to two C arrays\n     * @param indices pointer to a C array of indices\n     * @param dist pointer to a C array of distances\n     * @param n_neighbors the number of neighbors to copy\n     */\n    virtual void copy(int* indices, DistanceType* dist, int n_neighbors = -1) const\n    {\n        if (n_neighbors < 0) {\n            for (typename std::set<DistIndex>::const_iterator dist_index = dist_indices_.begin(), dist_index_end =\n                     dist_indices_.end(); dist_index != dist_index_end; ++dist_index, ++indices, ++dist) {\n                *indices = dist_index->index_;\n                *dist = dist_index->dist_;\n            }\n        }\n        else {\n            int i = 0;\n            for (typename std::set<DistIndex>::const_iterator dist_index = dist_indices_.begin(), dist_index_end =\n                     dist_indices_.end(); (dist_index != dist_index_end) && (i < n_neighbors); ++dist_index, ++indices, ++dist, ++i) {\n                *indices = dist_index->index_;\n                *dist = dist_index->dist_;\n            }\n        }\n    }\n\n    /** Copy the set to two C arrays but sort it according to the distance first\n     * @param indices pointer to a C array of indices\n     * @param dist pointer to a C array of distances\n     * @param n_neighbors the number of neighbors to copy\n     */\n    virtual void sortAndCopy(int* indices, DistanceType* dist, int n_neighbors = -1) const\n    {\n        copy(indices, dist, n_neighbors);\n    }\n\n    /** The number of neighbors in the set\n     * @return\n     */\n    size_t size() const\n    {\n        return dist_indices_.size();\n    }\n\n    /** The distance of the furthest neighbor\n     * If we don't have enough neighbors, it returns the max possible value\n     * @return\n     */\n    inline DistanceType worstDist() const CV_OVERRIDE\n    {\n        return worst_distance_;\n    }\nprotected:\n    /** Flag to say if the set is full */\n    bool is_full_;\n\n    /** The worst distance found so far */\n    DistanceType worst_distance_;\n\n    /** The best candidates so far */\n    std::set<DistIndex> dist_indices_;\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Class that holds the k NN neighbors\n * Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays\n */\ntemplate<typename DistanceType>\nclass KNNUniqueResultSet : public UniqueResultSet<DistanceType>\n{\npublic:\n    /** Constructor\n     * @param capacity the number of neighbors to store at max\n     */\n    KNNUniqueResultSet(unsigned int capacity) : capacity_(capacity)\n    {\n        this->is_full_ = false;\n        this->clear();\n    }\n\n    /** Add a possible candidate to the best neighbors\n     * @param dist distance for that neighbor\n     * @param index index of that neighbor\n     */\n    inline void addPoint(DistanceType dist, int index) CV_OVERRIDE\n    {\n        // Don't do anything if we are worse than the worst\n        if (dist >= worst_distance_) return;\n        dist_indices_.insert(DistIndex(dist, index));\n\n        if (is_full_) {\n            if (dist_indices_.size() > capacity_) {\n                dist_indices_.erase(*dist_indices_.rbegin());\n                worst_distance_ = dist_indices_.rbegin()->dist_;\n            }\n        }\n        else if (dist_indices_.size() == capacity_) {\n            is_full_ = true;\n            worst_distance_ = dist_indices_.rbegin()->dist_;\n        }\n    }\n\n    /** Remove all elements in the set\n     */\n    void clear() CV_OVERRIDE\n    {\n        dist_indices_.clear();\n        worst_distance_ = std::numeric_limits<DistanceType>::max();\n        is_full_ = false;\n    }\n\nprotected:\n    typedef typename UniqueResultSet<DistanceType>::DistIndex DistIndex;\n    using UniqueResultSet<DistanceType>::is_full_;\n    using UniqueResultSet<DistanceType>::worst_distance_;\n    using UniqueResultSet<DistanceType>::dist_indices_;\n\n    /** The number of neighbors to keep */\n    unsigned int capacity_;\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Class that holds the radius nearest neighbors\n * It is more accurate than RadiusResult as it is not limited in the number of neighbors\n */\ntemplate<typename DistanceType>\nclass RadiusUniqueResultSet : public UniqueResultSet<DistanceType>\n{\npublic:\n    /** Constructor\n     * @param radius the maximum distance of a neighbor\n     */\n    RadiusUniqueResultSet(DistanceType radius) :\n        radius_(radius)\n    {\n        is_full_ = true;\n    }\n\n    /** Add a possible candidate to the best neighbors\n     * @param dist distance for that neighbor\n     * @param index index of that neighbor\n     */\n    void addPoint(DistanceType dist, int index) CV_OVERRIDE\n    {\n        if (dist <= radius_) dist_indices_.insert(DistIndex(dist, index));\n    }\n\n    /** Remove all elements in the set\n     */\n    inline void clear() CV_OVERRIDE\n    {\n        dist_indices_.clear();\n    }\n\n\n    /** Check the status of the set\n     * @return alwys false\n     */\n    inline bool full() const CV_OVERRIDE\n    {\n        return true;\n    }\n\n    /** The distance of the furthest neighbor\n     * If we don't have enough neighbors, it returns the max possible value\n     * @return\n     */\n    inline DistanceType worstDist() const CV_OVERRIDE\n    {\n        return radius_;\n    }\nprivate:\n    typedef typename UniqueResultSet<DistanceType>::DistIndex DistIndex;\n    using UniqueResultSet<DistanceType>::dist_indices_;\n    using UniqueResultSet<DistanceType>::is_full_;\n\n    /** The furthest distance a neighbor can be */\n    DistanceType radius_;\n};\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n/** Class that holds the k NN neighbors within a radius distance\n */\ntemplate<typename DistanceType>\nclass KNNRadiusUniqueResultSet : public KNNUniqueResultSet<DistanceType>\n{\npublic:\n    /** Constructor\n     * @param capacity the number of neighbors to store at max\n     * @param radius the maximum distance of a neighbor\n     */\n    KNNRadiusUniqueResultSet(unsigned int capacity, DistanceType radius)\n    {\n        this->capacity_ = capacity;\n        this->radius_ = radius;\n        this->dist_indices_.reserve(capacity_);\n        this->clear();\n    }\n\n    /** Remove all elements in the set\n     */\n    void clear()\n    {\n        dist_indices_.clear();\n        worst_distance_ = radius_;\n        is_full_ = false;\n    }\nprivate:\n    using KNNUniqueResultSet<DistanceType>::dist_indices_;\n    using KNNUniqueResultSet<DistanceType>::is_full_;\n    using KNNUniqueResultSet<DistanceType>::worst_distance_;\n\n    /** The maximum number of neighbors to consider */\n    unsigned int capacity_;\n\n    /** The maximum distance of a neighbor */\n    DistanceType radius_;\n};\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_RESULTSET_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/sampling.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n\n#ifndef OPENCV_FLANN_SAMPLING_H_\n#define OPENCV_FLANN_SAMPLING_H_\n\n//! @cond IGNORED\n\n#include \"matrix.h\"\n#include \"random.h\"\n\nnamespace cvflann\n{\n\ntemplate<typename T>\nMatrix<T> random_sample(Matrix<T>& srcMatrix, long size, bool remove = false)\n{\n    Matrix<T> newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols);\n\n    T* src,* dest;\n    for (long i=0; i<size; ++i) {\n        long r = rand_int((int)(srcMatrix.rows-i));\n        dest = newSet[i];\n        src = srcMatrix[r];\n        std::copy(src, src+srcMatrix.cols, dest);\n        if (remove) {\n            src = srcMatrix[srcMatrix.rows-i-1];\n            dest = srcMatrix[r];\n            std::copy(src, src+srcMatrix.cols, dest);\n        }\n    }\n    if (remove) {\n        srcMatrix.rows -= size;\n    }\n    return newSet;\n}\n\ntemplate<typename T>\nMatrix<T> random_sample(const Matrix<T>& srcMatrix, size_t size)\n{\n    UniqueRandom rand((int)srcMatrix.rows);\n    Matrix<T> newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols);\n\n    T* src,* dest;\n    for (size_t i=0; i<size; ++i) {\n        long r = rand.next();\n        dest = newSet[i];\n        src = srcMatrix[r];\n        std::copy(src, src+srcMatrix.cols, dest);\n    }\n    return newSet;\n}\n\n} // namespace\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_SAMPLING_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/saving.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE NNIndexGOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_SAVING_H_\n#define OPENCV_FLANN_SAVING_H_\n\n//! @cond IGNORED\n\n#include <cstring>\n#include <vector>\n\n#include \"general.h\"\n#include \"nn_index.h\"\n\n#ifdef FLANN_SIGNATURE_\n#undef FLANN_SIGNATURE_\n#endif\n#define FLANN_SIGNATURE_ \"FLANN_INDEX\"\n\nnamespace cvflann\n{\n\ntemplate <typename T>\nstruct Datatype {};\ntemplate<>\nstruct Datatype<char> { static flann_datatype_t type() { return FLANN_INT8; } };\ntemplate<>\nstruct Datatype<short> { static flann_datatype_t type() { return FLANN_INT16; } };\ntemplate<>\nstruct Datatype<int> { static flann_datatype_t type() { return FLANN_INT32; } };\ntemplate<>\nstruct Datatype<unsigned char> { static flann_datatype_t type() { return FLANN_UINT8; } };\ntemplate<>\nstruct Datatype<unsigned short> { static flann_datatype_t type() { return FLANN_UINT16; } };\ntemplate<>\nstruct Datatype<unsigned int> { static flann_datatype_t type() { return FLANN_UINT32; } };\ntemplate<>\nstruct Datatype<float> { static flann_datatype_t type() { return FLANN_FLOAT32; } };\ntemplate<>\nstruct Datatype<double> { static flann_datatype_t type() { return FLANN_FLOAT64; } };\n\n\n/**\n * Structure representing the index header.\n */\nstruct IndexHeader\n{\n    char signature[16];\n    char version[16];\n    flann_datatype_t data_type;\n    flann_algorithm_t index_type;\n    size_t rows;\n    size_t cols;\n};\n\n/**\n * Saves index header to stream\n *\n * @param stream - Stream to save to\n * @param index - The index to save\n */\ntemplate<typename Distance>\nvoid save_header(FILE* stream, const NNIndex<Distance>& index)\n{\n    IndexHeader header;\n    memset(header.signature, 0, sizeof(header.signature));\n    strcpy(header.signature, FLANN_SIGNATURE_);\n    memset(header.version, 0, sizeof(header.version));\n    strcpy(header.version, FLANN_VERSION_);\n    header.data_type = Datatype<typename Distance::ElementType>::type();\n    header.index_type = index.getType();\n    header.rows = index.size();\n    header.cols = index.veclen();\n\n    std::fwrite(&header, sizeof(header),1,stream);\n}\n\n\n/**\n *\n * @param stream - Stream to load from\n * @return Index header\n */\ninline IndexHeader load_header(FILE* stream)\n{\n    IndexHeader header;\n    size_t read_size = fread(&header,sizeof(header),1,stream);\n\n    if (read_size!=(size_t)1) {\n        FLANN_THROW(cv::Error::StsError, \"Invalid index file, cannot read\");\n    }\n\n    if (strcmp(header.signature,FLANN_SIGNATURE_)!=0) {\n        FLANN_THROW(cv::Error::StsError, \"Invalid index file, wrong signature\");\n    }\n\n    return header;\n\n}\n\n\ntemplate<typename T>\nvoid save_value(FILE* stream, const T& value, size_t count = 1)\n{\n    fwrite(&value, sizeof(value),count, stream);\n}\n\ntemplate<typename T>\nvoid save_value(FILE* stream, const cvflann::Matrix<T>& value)\n{\n    fwrite(&value, sizeof(value),1, stream);\n    fwrite(value.data, sizeof(T),value.rows*value.cols, stream);\n}\n\ntemplate<typename T>\nvoid save_value(FILE* stream, const std::vector<T>& value)\n{\n    size_t size = value.size();\n    fwrite(&size, sizeof(size_t), 1, stream);\n    fwrite(&value[0], sizeof(T), size, stream);\n}\n\ntemplate<typename T>\nvoid load_value(FILE* stream, T& value, size_t count = 1)\n{\n    size_t read_cnt = fread(&value, sizeof(value), count, stream);\n    if (read_cnt != count) {\n        FLANN_THROW(cv::Error::StsParseError, \"Cannot read from file\");\n    }\n}\n\ntemplate<typename T>\nvoid load_value(FILE* stream, cvflann::Matrix<T>& value)\n{\n    size_t read_cnt = fread(&value, sizeof(value), 1, stream);\n    if (read_cnt != 1) {\n        FLANN_THROW(cv::Error::StsParseError, \"Cannot read from file\");\n    }\n    value.data = new T[value.rows*value.cols];\n    read_cnt = fread(value.data, sizeof(T), value.rows*value.cols, stream);\n    if (read_cnt != (size_t)(value.rows*value.cols)) {\n        FLANN_THROW(cv::Error::StsParseError, \"Cannot read from file\");\n    }\n}\n\n\ntemplate<typename T>\nvoid load_value(FILE* stream, std::vector<T>& value)\n{\n    size_t size;\n    size_t read_cnt = fread(&size, sizeof(size_t), 1, stream);\n    if (read_cnt!=1) {\n        FLANN_THROW(cv::Error::StsError, \"Cannot read from file\");\n    }\n    value.resize(size);\n    read_cnt = fread(&value[0], sizeof(T), size, stream);\n    if (read_cnt != size) {\n        FLANN_THROW(cv::Error::StsError, \"Cannot read from file\");\n    }\n}\n\n}\n\n//! @endcond\n\n#endif /* OPENCV_FLANN_SAVING_H_ */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/simplex_downhill.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_SIMPLEX_DOWNHILL_H_\n#define OPENCV_FLANN_SIMPLEX_DOWNHILL_H_\n\n//! @cond IGNORED\n\nnamespace cvflann\n{\n\n/**\n    Adds val to array vals (and point to array points) and keeping the arrays sorted by vals.\n */\ntemplate <typename T>\nvoid addValue(int pos, float val, float* vals, T* point, T* points, int n)\n{\n    vals[pos] = val;\n    for (int i=0; i<n; ++i) {\n        points[pos*n+i] = point[i];\n    }\n\n    // bubble down\n    int j=pos;\n    while (j>0 && vals[j]<vals[j-1]) {\n        swap(vals[j],vals[j-1]);\n        for (int i=0; i<n; ++i) {\n            swap(points[j*n+i],points[(j-1)*n+i]);\n        }\n        --j;\n    }\n}\n\n\n/**\n    Simplex downhill optimization function.\n    Preconditions: points is a 2D mattrix of size (n+1) x n\n                    func is the cost function taking n an array of n params and returning float\n                    vals is the cost function in the n+1 simplex points, if NULL it will be computed\n\n    Postcondition: returns optimum value and points[0..n] are the optimum parameters\n */\ntemplate <typename T, typename F>\nfloat optimizeSimplexDownhill(T* points, int n, F func, float* vals = NULL )\n{\n    const int MAX_ITERATIONS = 10;\n\n    CV_DbgAssert(n>0);\n\n    T* p_o = new T[n];\n    T* p_r = new T[n];\n    T* p_e = new T[n];\n\n    int alpha = 1;\n\n    int iterations = 0;\n\n    bool ownVals = false;\n    if (vals == NULL) {\n        ownVals = true;\n        vals = new float[n+1];\n        for (int i=0; i<n+1; ++i) {\n            float val = func(points+i*n);\n            addValue(i, val, vals, points+i*n, points, n);\n        }\n    }\n    int nn = n*n;\n\n    while (true) {\n\n        if (iterations++ > MAX_ITERATIONS) break;\n\n        // compute average of simplex points (except the highest point)\n        for (int j=0; j<n; ++j) {\n            p_o[j] = 0;\n            for (int i=0; i<n; ++i) {\n                p_o[i] += points[j*n+i];\n            }\n        }\n        for (int i=0; i<n; ++i) {\n            p_o[i] /= n;\n        }\n\n        bool converged = true;\n        for (int i=0; i<n; ++i) {\n            if (p_o[i] != points[nn+i]) {\n                converged = false;\n            }\n        }\n        if (converged) break;\n\n        // trying a reflection\n        for (int i=0; i<n; ++i) {\n            p_r[i] = p_o[i] + alpha*(p_o[i]-points[nn+i]);\n        }\n        float val_r = func(p_r);\n\n        if ((val_r>=vals[0])&&(val_r<vals[n])) {\n            // reflection between second highest and lowest\n            // add it to the simplex\n            Logger::info(\"Choosing reflection\\n\");\n            addValue(n, val_r,vals, p_r, points, n);\n            continue;\n        }\n\n        if (val_r<vals[0]) {\n            // value is smaller than smallest in simplex\n\n            // expand some more to see if it drops further\n            for (int i=0; i<n; ++i) {\n                p_e[i] = 2*p_r[i]-p_o[i];\n            }\n            float val_e = func(p_e);\n\n            if (val_e<val_r) {\n                Logger::info(\"Choosing reflection and expansion\\n\");\n                addValue(n, val_e,vals,p_e,points,n);\n            }\n            else {\n                Logger::info(\"Choosing reflection\\n\");\n                addValue(n, val_r,vals,p_r,points,n);\n            }\n            continue;\n        }\n        if (val_r>=vals[n]) {\n            for (int i=0; i<n; ++i) {\n                p_e[i] = (p_o[i]+points[nn+i])/2;\n            }\n            float val_e = func(p_e);\n\n            if (val_e<vals[n]) {\n                Logger::info(\"Choosing contraction\\n\");\n                addValue(n,val_e,vals,p_e,points,n);\n                continue;\n            }\n        }\n        {\n            Logger::info(\"Full contraction\\n\");\n            for (int j=1; j<=n; ++j) {\n                for (int i=0; i<n; ++i) {\n                    points[j*n+i] = (points[j*n+i]+points[i])/2;\n                }\n                float val = func(points+j*n);\n                addValue(j,val,vals,points+j*n,points,n);\n            }\n        }\n    }\n\n    float bestVal = vals[0];\n\n    delete[] p_r;\n    delete[] p_o;\n    delete[] p_e;\n    if (ownVals) delete[] vals;\n\n    return bestVal;\n}\n\n}\n\n//! @endcond\n\n#endif //OPENCV_FLANN_SIMPLEX_DOWNHILL_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann/timer.h",
    "content": "/***********************************************************************\n * Software License Agreement (BSD License)\n *\n * Copyright 2008-2009  Marius Muja (mariusm@cs.ubc.ca). All rights reserved.\n * Copyright 2008-2009  David G. Lowe (lowe@cs.ubc.ca). All rights reserved.\n *\n * THE BSD LICENSE\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *************************************************************************/\n\n#ifndef OPENCV_FLANN_TIMER_H\n#define OPENCV_FLANN_TIMER_H\n\n//! @cond IGNORED\n\n#include <time.h>\n#include \"opencv2/core.hpp\"\n#include \"opencv2/core/utility.hpp\"\n\nnamespace cvflann\n{\n\n/**\n * A start-stop timer class.\n *\n * Can be used to time portions of code.\n */\nclass StartStopTimer\n{\n    int64 startTime;\n\npublic:\n    /**\n     * Value of the timer.\n     */\n    double value;\n\n\n    /**\n     * Constructor.\n     */\n    StartStopTimer()\n        : startTime(0)\n    {\n        reset();\n    }\n\n    /**\n     * Starts the timer.\n     */\n    void start()\n    {\n        startTime = cv::getTickCount();\n    }\n\n    /**\n     * Stops the timer and updates timer value.\n     */\n    void stop()\n    {\n        int64 stopTime = cv::getTickCount();\n        value += ( (double)stopTime - startTime) / cv::getTickFrequency();\n    }\n\n    /**\n     * Resets the timer value to 0.\n     */\n    void reset()\n    {\n        value = 0;\n    }\n\n};\n\n}\n\n//! @endcond\n\n#endif // FLANN_TIMER_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/flann.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_FLANN_HPP\n#define OPENCV_FLANN_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/flann/miniflann.hpp\"\n#include \"opencv2/flann/flann_base.hpp\"\n\n/**\n@defgroup flann Clustering and Search in Multi-Dimensional Spaces\n\nThis section documents OpenCV's interface to the FLANN library. FLANN (Fast Library for Approximate\nNearest Neighbors) is a library that contains a collection of algorithms optimized for fast nearest\nneighbor search in large datasets and for high dimensional features. More information about FLANN\ncan be found in @cite Muja2009 .\n*/\n\nnamespace cvflann\n{\n    CV_EXPORTS flann_distance_t flann_distance_type();\n    CV_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order);\n}\n\n\nnamespace cv\n{\nnamespace flann\n{\n\n\n//! @addtogroup flann\n//! @{\n\ntemplate <typename T> struct CvType {};\ntemplate <> struct CvType<unsigned char> { static int type() { return CV_8U; } };\ntemplate <> struct CvType<char> { static int type() { return CV_8S; } };\ntemplate <> struct CvType<unsigned short> { static int type() { return CV_16U; } };\ntemplate <> struct CvType<short> { static int type() { return CV_16S; } };\ntemplate <> struct CvType<int> { static int type() { return CV_32S; } };\ntemplate <> struct CvType<float> { static int type() { return CV_32F; } };\ntemplate <> struct CvType<double> { static int type() { return CV_64F; } };\n\n\n// bring the flann parameters into this namespace\nusing ::cvflann::get_param;\nusing ::cvflann::print_params;\n\n// bring the flann distances into this namespace\nusing ::cvflann::L2_Simple;\nusing ::cvflann::L2;\nusing ::cvflann::L1;\nusing ::cvflann::MinkowskiDistance;\nusing ::cvflann::MaxDistance;\nusing ::cvflann::HammingLUT;\nusing ::cvflann::Hamming;\nusing ::cvflann::Hamming2;\nusing ::cvflann::DNAmmingLUT;\nusing ::cvflann::DNAmming2;\nusing ::cvflann::HistIntersectionDistance;\nusing ::cvflann::HellingerDistance;\nusing ::cvflann::ChiSquareDistance;\nusing ::cvflann::KL_Divergence;\n\n\n/** @brief The FLANN nearest neighbor index class. This class is templated with the type of elements for which\nthe index is built.\n\n`Distance` functor specifies the metric to be used to calculate the distance between two points.\nThere are several `Distance` functors that are readily available:\n\ncv::cvflann::L2_Simple - Squared Euclidean distance functor.\nThis is the simpler, unrolled version. This is preferable for very low dimensionality data (eg 3D points)\n\ncv::flann::L2 - Squared Euclidean distance functor, optimized version.\n\ncv::flann::L1 - Manhattan distance functor, optimized version.\n\ncv::flann::MinkowskiDistance -  The Minkowsky distance functor.\nThis is highly optimised with loop unrolling.\nThe computation of squared root at the end is omitted for efficiency.\n\ncv::flann::MaxDistance - The max distance functor. It computes the\nmaximum distance between two vectors. This distance is not a valid kdtree distance, it's not\ndimensionwise additive.\n\ncv::flann::HammingLUT -  %Hamming distance functor. It counts the bit\ndifferences between two strings using a lookup table implementation.\n\ncv::flann::Hamming - %Hamming distance functor. Population count is\nperformed using library calls, if available. Lookup table implementation is used as a fallback.\n\ncv::flann::Hamming2 - %Hamming distance functor. Population count is\nimplemented in 12 arithmetic operations (one of which is multiplication).\n\ncv::flann::DNAmmingLUT -  %Adaptation of the Hamming distance functor to DNA comparison.\nAs the four bases A, C, G, T of the DNA (or A, G, C, U for RNA) can be coded on 2 bits,\nit counts the bits pairs differences between two sequences using a lookup table implementation.\n\ncv::flann::DNAmming2 - %Adaptation of the Hamming distance functor to DNA comparison.\nBases differences count are vectorised thanks to arithmetic operations using standard\nregisters (AVX2 and AVX-512 should come in a near future).\n\ncv::flann::HistIntersectionDistance - The histogram\nintersection distance functor.\n\ncv::flann::HellingerDistance - The Hellinger distance functor.\n\ncv::flann::ChiSquareDistance - The chi-square distance functor.\n\ncv::flann::KL_Divergence - The Kullback-Leibler divergence functor.\n\nAlthough the provided implementations cover a vast range of cases, it is also possible to use\na custom implementation. The distance functor is a class whose `operator()` computes the distance\nbetween two features. If the distance is also a kd-tree compatible distance, it should also provide an\n`accum_dist()` method that computes the distance between individual feature dimensions.\n\nIn addition to `operator()` and `accum_dist()`, a distance functor should also define the\n`ElementType` and the `ResultType` as the types of the elements it operates on and the type of the\nresult it computes. If a distance functor can be used as a kd-tree distance (meaning that the full\ndistance between a pair of features can be accumulated from the partial distances between the\nindividual dimensions) a typedef `is_kdtree_distance` should be present inside the distance functor.\nIf the distance is not a kd-tree distance, but it's a distance in a vector space (the individual\ndimensions of the elements it operates on can be accessed independently) a typedef\n`is_vector_space_distance` should be defined inside the functor. If neither typedef is defined, the\ndistance is assumed to be a metric distance and will only be used with indexes operating on\ngeneric metric distances.\n */\ntemplate <typename Distance>\nclass GenericIndex\n{\npublic:\n        typedef typename Distance::ElementType ElementType;\n        typedef typename Distance::ResultType DistanceType;\n\n        /** @brief Constructs a nearest neighbor search index for a given dataset.\n\n        @param features Matrix of containing the features(points) to index. The size of the matrix is\n        num_features x feature_dimensionality and the data type of the elements in the matrix must\n        coincide with the type of the index.\n        @param params Structure containing the index parameters. The type of index that will be\n        constructed depends on the type of this parameter. See the description.\n        @param distance\n\n        The method constructs a fast search structure from a set of features using the specified algorithm\n        with specified parameters, as defined by params. params is a reference to one of the following class\n        IndexParams descendants:\n\n        - **LinearIndexParams** When passing an object of this type, the index will perform a linear,\n        brute-force search. :\n        @code\n        struct LinearIndexParams : public IndexParams\n        {\n        };\n        @endcode\n        - **KDTreeIndexParams** When passing an object of this type the index constructed will consist of\n        a set of randomized kd-trees which will be searched in parallel. :\n        @code\n        struct KDTreeIndexParams : public IndexParams\n        {\n            KDTreeIndexParams( int trees = 4 );\n        };\n        @endcode\n        - **HierarchicalClusteringIndexParams** When passing an object of this type the index constructed\n        will be a hierarchical tree of clusters, dividing each set of points into n clusters whose centers\n        are picked among the points without further refinement of their position.\n        This algorithm fits both floating, integer and binary vectors. :\n        @code\n        struct HierarchicalClusteringIndexParams : public IndexParams\n        {\n            HierarchicalClusteringIndexParams(\n                int branching = 32,\n                flann_centers_init_t centers_init = CENTERS_RANDOM,\n                int trees = 4,\n                int leaf_size = 100);\n\n        };\n        @endcode\n        - **KMeansIndexParams** When passing an object of this type the index constructed will be a\n        hierarchical k-means tree (one tree by default), dividing each set of points into n clusters\n        whose barycenters are refined iteratively.\n        Note that this algorithm has been extended to the support of binary vectors as an alternative\n        to LSH when knn search speed is the criterium. It will also outperform LSH when processing\n        directly (i.e. without the use of MCA/PCA) datasets whose points share mostly the same values\n        for most of the dimensions. It is recommended to set more than one tree with binary data. :\n        @code\n        struct KMeansIndexParams : public IndexParams\n        {\n            KMeansIndexParams(\n                int branching = 32,\n                int iterations = 11,\n                flann_centers_init_t centers_init = CENTERS_RANDOM,\n                float cb_index = 0.2,\n                int trees = 1);\n        };\n        @endcode\n        - **CompositeIndexParams** When using a parameters object of this type the index created\n        combines the randomized kd-trees and the hierarchical k-means tree. :\n        @code\n        struct CompositeIndexParams : public IndexParams\n        {\n            CompositeIndexParams(\n                int trees = 4,\n                int branching = 32,\n                int iterations = 11,\n                flann_centers_init_t centers_init = CENTERS_RANDOM,\n                float cb_index = 0.2 );\n        };\n        @endcode\n        - **LshIndexParams** When using a parameters object of this type the index created uses\n        multi-probe LSH (by Multi-Probe LSH: Efficient Indexing for High-Dimensional Similarity Search\n        by Qin Lv, William Josephson, Zhe Wang, Moses Charikar, Kai Li., Proceedings of the 33rd\n        International Conference on Very Large Data Bases (VLDB). Vienna, Austria. September 2007).\n        This algorithm is designed for binary vectors. :\n        @code\n        struct LshIndexParams : public IndexParams\n        {\n            LshIndexParams(\n                int table_number,\n                int key_size,\n                int multi_probe_level );\n        };\n        @endcode\n        - **AutotunedIndexParams** When passing an object of this type the index created is\n        automatically tuned to offer the best performance, by choosing the optimal index type\n        (randomized kd-trees, hierarchical kmeans, linear) and parameters for the dataset provided. :\n        @code\n        struct AutotunedIndexParams : public IndexParams\n        {\n            AutotunedIndexParams(\n                float target_precision = 0.9,\n                float build_weight = 0.01,\n                float memory_weight = 0,\n                float sample_fraction = 0.1 );\n        };\n        @endcode\n        - **SavedIndexParams** This object type is used for loading a previously saved index from the\n        disk. :\n        @code\n        struct SavedIndexParams : public IndexParams\n        {\n            SavedIndexParams( String filename );\n        };\n        @endcode\n         */\n        GenericIndex(const Mat& features, const ::cvflann::IndexParams& params, Distance distance = Distance());\n\n        ~GenericIndex();\n\n        /** @brief Performs a K-nearest neighbor search for a given query point using the index.\n\n        @param query The query point\n        @param indices Vector that will contain the indices of the K-nearest neighbors found. It must have\n        at least knn size.\n        @param dists Vector that will contain the distances to the K-nearest neighbors found. It must have\n        at least knn size.\n        @param knn Number of nearest neighbors to search for.\n        @param params SearchParams\n         */\n        void knnSearch(const std::vector<ElementType>& query, std::vector<int>& indices,\n                       std::vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& params);\n        void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& params);\n\n        /** @brief Performs a radius nearest neighbor search for a given query point using the index.\n\n        @param query The query point.\n        @param indices Vector that will contain the indices of the nearest neighbors found.\n        @param dists Vector that will contain the distances to the nearest neighbors found. It has the same\n        number of elements as indices.\n        @param radius The search radius.\n        @param params SearchParams\n\n        This function returns the number of nearest neighbors found.\n        */\n        int radiusSearch(const std::vector<ElementType>& query, std::vector<int>& indices,\n                         std::vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& params);\n        int radiusSearch(const Mat& query, Mat& indices, Mat& dists,\n                         DistanceType radius, const ::cvflann::SearchParams& params);\n\n        void save(String filename) { nnIndex->save(filename); }\n\n        int veclen() const { return nnIndex->veclen(); }\n\n        int size() const { return (int)nnIndex->size(); }\n\n        ::cvflann::IndexParams getParameters() { return nnIndex->getParameters(); }\n\n        CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); }\n\nprivate:\n        ::cvflann::Index<Distance>* nnIndex;\n        Mat _dataset;\n};\n\n//! @cond IGNORED\n\n#define FLANN_DISTANCE_CHECK \\\n    if ( ::cvflann::flann_distance_type() != cvflann::FLANN_DIST_L2) { \\\n        printf(\"[WARNING] You are using cv::flann::Index (or cv::flann::GenericIndex) and have also changed \"\\\n        \"the distance using cvflann::set_distance_type. This is no longer working as expected \"\\\n        \"(cv::flann::Index always uses L2). You should create the index templated on the distance, \"\\\n        \"for example for L1 distance use: GenericIndex< L1<float> > \\n\"); \\\n    }\n\n\ntemplate <typename Distance>\nGenericIndex<Distance>::GenericIndex(const Mat& dataset, const ::cvflann::IndexParams& params, Distance distance)\n: _dataset(dataset)\n{\n    CV_Assert(dataset.type() == CvType<ElementType>::type());\n    CV_Assert(dataset.isContinuous());\n    ::cvflann::Matrix<ElementType> m_dataset((ElementType*)_dataset.ptr<ElementType>(0), _dataset.rows, _dataset.cols);\n\n    nnIndex = new ::cvflann::Index<Distance>(m_dataset, params, distance);\n\n    FLANN_DISTANCE_CHECK\n\n    nnIndex->buildIndex();\n}\n\ntemplate <typename Distance>\nGenericIndex<Distance>::~GenericIndex()\n{\n    delete nnIndex;\n}\n\ntemplate <typename Distance>\nvoid GenericIndex<Distance>::knnSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& searchParams)\n{\n    ::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());\n    ::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());\n    ::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());\n\n    FLANN_DISTANCE_CHECK\n\n    nnIndex->knnSearch(m_query,m_indices,m_dists,knn,searchParams);\n}\n\n\ntemplate <typename Distance>\nvoid GenericIndex<Distance>::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams)\n{\n    CV_Assert(queries.type() == CvType<ElementType>::type());\n    CV_Assert(queries.isContinuous());\n    ::cvflann::Matrix<ElementType> m_queries((ElementType*)queries.ptr<ElementType>(0), queries.rows, queries.cols);\n\n    CV_Assert(indices.type() == CV_32S);\n    CV_Assert(indices.isContinuous());\n    ::cvflann::Matrix<int> m_indices((int*)indices.ptr<int>(0), indices.rows, indices.cols);\n\n    CV_Assert(dists.type() == CvType<DistanceType>::type());\n    CV_Assert(dists.isContinuous());\n    ::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);\n\n    FLANN_DISTANCE_CHECK\n\n    nnIndex->knnSearch(m_queries,m_indices,m_dists,knn, searchParams);\n}\n\ntemplate <typename Distance>\nint GenericIndex<Distance>::radiusSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)\n{\n    ::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());\n    ::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());\n    ::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());\n\n    FLANN_DISTANCE_CHECK\n\n    return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n}\n\ntemplate <typename Distance>\nint GenericIndex<Distance>::radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)\n{\n    CV_Assert(query.type() == CvType<ElementType>::type());\n    CV_Assert(query.isContinuous());\n    ::cvflann::Matrix<ElementType> m_query((ElementType*)query.ptr<ElementType>(0), query.rows, query.cols);\n\n    CV_Assert(indices.type() == CV_32S);\n    CV_Assert(indices.isContinuous());\n    ::cvflann::Matrix<int> m_indices((int*)indices.ptr<int>(0), indices.rows, indices.cols);\n\n    CV_Assert(dists.type() == CvType<DistanceType>::type());\n    CV_Assert(dists.isContinuous());\n    ::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);\n\n    FLANN_DISTANCE_CHECK\n\n    return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n}\n\n/**\n * @deprecated Use GenericIndex class instead\n */\ntemplate <typename T>\nclass Index_\n{\npublic:\n    typedef typename L2<T>::ElementType ElementType;\n    typedef typename L2<T>::ResultType DistanceType;\n\n    CV_DEPRECATED Index_(const Mat& dataset, const ::cvflann::IndexParams& params)\n    {\n        printf(\"[WARNING] The cv::flann::Index_<T> class is deperecated, use cv::flann::GenericIndex<Distance> instead\\n\");\n\n        CV_Assert(dataset.type() == CvType<ElementType>::type());\n        CV_Assert(dataset.isContinuous());\n        ::cvflann::Matrix<ElementType> m_dataset((ElementType*)dataset.ptr<ElementType>(0), dataset.rows, dataset.cols);\n\n        if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) {\n            nnIndex_L1 = NULL;\n            nnIndex_L2 = new ::cvflann::Index< L2<ElementType> >(m_dataset, params);\n        }\n        else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) {\n            nnIndex_L1 = new ::cvflann::Index< L1<ElementType> >(m_dataset, params);\n            nnIndex_L2 = NULL;\n        }\n        else {\n            printf(\"[ERROR] cv::flann::Index_<T> only provides backwards compatibility for the L1 and L2 distances. \"\n                   \"For other distance types you must use cv::flann::GenericIndex<Distance>\\n\");\n            CV_Assert(0);\n        }\n        if (nnIndex_L1) nnIndex_L1->buildIndex();\n        if (nnIndex_L2) nnIndex_L2->buildIndex();\n    }\n    CV_DEPRECATED ~Index_()\n    {\n        if (nnIndex_L1) delete nnIndex_L1;\n        if (nnIndex_L2) delete nnIndex_L2;\n    }\n\n    CV_DEPRECATED void knnSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, int knn, const ::cvflann::SearchParams& searchParams)\n    {\n        ::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());\n        ::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());\n        ::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());\n\n        if (nnIndex_L1) nnIndex_L1->knnSearch(m_query,m_indices,m_dists,knn,searchParams);\n        if (nnIndex_L2) nnIndex_L2->knnSearch(m_query,m_indices,m_dists,knn,searchParams);\n    }\n    CV_DEPRECATED void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams)\n    {\n        CV_Assert(queries.type() == CvType<ElementType>::type());\n        CV_Assert(queries.isContinuous());\n        ::cvflann::Matrix<ElementType> m_queries((ElementType*)queries.ptr<ElementType>(0), queries.rows, queries.cols);\n\n        CV_Assert(indices.type() == CV_32S);\n        CV_Assert(indices.isContinuous());\n        ::cvflann::Matrix<int> m_indices((int*)indices.ptr<int>(0), indices.rows, indices.cols);\n\n        CV_Assert(dists.type() == CvType<DistanceType>::type());\n        CV_Assert(dists.isContinuous());\n        ::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);\n\n        if (nnIndex_L1) nnIndex_L1->knnSearch(m_queries,m_indices,m_dists,knn, searchParams);\n        if (nnIndex_L2) nnIndex_L2->knnSearch(m_queries,m_indices,m_dists,knn, searchParams);\n    }\n\n    CV_DEPRECATED int radiusSearch(const std::vector<ElementType>& query, std::vector<int>& indices, std::vector<DistanceType>& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)\n    {\n        ::cvflann::Matrix<ElementType> m_query((ElementType*)&query[0], 1, query.size());\n        ::cvflann::Matrix<int> m_indices(&indices[0], 1, indices.size());\n        ::cvflann::Matrix<DistanceType> m_dists(&dists[0], 1, dists.size());\n\n        if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n        if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n    }\n\n    CV_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams)\n    {\n        CV_Assert(query.type() == CvType<ElementType>::type());\n        CV_Assert(query.isContinuous());\n        ::cvflann::Matrix<ElementType> m_query((ElementType*)query.ptr<ElementType>(0), query.rows, query.cols);\n\n        CV_Assert(indices.type() == CV_32S);\n        CV_Assert(indices.isContinuous());\n        ::cvflann::Matrix<int> m_indices((int*)indices.ptr<int>(0), indices.rows, indices.cols);\n\n        CV_Assert(dists.type() == CvType<DistanceType>::type());\n        CV_Assert(dists.isContinuous());\n        ::cvflann::Matrix<DistanceType> m_dists((DistanceType*)dists.ptr<DistanceType>(0), dists.rows, dists.cols);\n\n        if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n        if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams);\n    }\n\n    CV_DEPRECATED void save(String filename)\n    {\n        if (nnIndex_L1) nnIndex_L1->save(filename);\n        if (nnIndex_L2) nnIndex_L2->save(filename);\n    }\n\n    CV_DEPRECATED int veclen() const\n    {\n        if (nnIndex_L1) return nnIndex_L1->veclen();\n        if (nnIndex_L2) return nnIndex_L2->veclen();\n    }\n\n    CV_DEPRECATED int size() const\n    {\n        if (nnIndex_L1) return nnIndex_L1->size();\n        if (nnIndex_L2) return nnIndex_L2->size();\n    }\n\n    CV_DEPRECATED ::cvflann::IndexParams getParameters()\n    {\n        if (nnIndex_L1) return nnIndex_L1->getParameters();\n        if (nnIndex_L2) return nnIndex_L2->getParameters();\n\n    }\n\n    CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters()\n    {\n        if (nnIndex_L1) return nnIndex_L1->getIndexParameters();\n        if (nnIndex_L2) return nnIndex_L2->getIndexParameters();\n    }\n\nprivate:\n    // providing backwards compatibility for L2 and L1 distances (most common)\n    ::cvflann::Index< L2<ElementType> >* nnIndex_L2;\n    ::cvflann::Index< L1<ElementType> >* nnIndex_L1;\n};\n\n//! @endcond\n\n/** @brief Clusters features using hierarchical k-means algorithm.\n\n@param features The points to be clustered. The matrix must have elements of type\nDistance::ElementType.\n@param centers The centers of the clusters obtained. The matrix must have type\nDistance::CentersType. The number of rows in this matrix represents the number of clusters desired,\nhowever, because of the way the cut in the hierarchical tree is chosen, the number of clusters\ncomputed will be the highest number of the form (branching-1)\\*k+1 that's lower than the number of\nclusters desired, where branching is the tree's branching factor (see description of the\nKMeansIndexParams).\n@param params Parameters used in the construction of the hierarchical k-means tree.\n@param d Distance to be used for clustering.\n\nThe method clusters the given feature vectors by constructing a hierarchical k-means tree and\nchoosing a cut in the tree that minimizes the cluster's variance. It returns the number of clusters\nfound.\n */\ntemplate <typename Distance>\nint hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params,\n                           Distance d = Distance())\n{\n    typedef typename Distance::ElementType ElementType;\n    typedef typename Distance::CentersType CentersType;\n\n    CV_Assert(features.type() == CvType<ElementType>::type());\n    CV_Assert(features.isContinuous());\n    ::cvflann::Matrix<ElementType> m_features((ElementType*)features.ptr<ElementType>(0), features.rows, features.cols);\n\n    CV_Assert(centers.type() == CvType<CentersType>::type());\n    CV_Assert(centers.isContinuous());\n    ::cvflann::Matrix<CentersType> m_centers((CentersType*)centers.ptr<CentersType>(0), centers.rows, centers.cols);\n\n    return ::cvflann::hierarchicalClustering<Distance>(m_features, m_centers, params, d);\n}\n\n//! @cond IGNORED\n\ntemplate <typename ELEM_TYPE, typename DIST_TYPE>\nCV_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params)\n{\n    printf(\"[WARNING] cv::flann::hierarchicalClustering<ELEM_TYPE,DIST_TYPE> is deprecated, use \"\n        \"cv::flann::hierarchicalClustering<Distance> instead\\n\");\n\n    if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) {\n        return hierarchicalClustering< L2<ELEM_TYPE> >(features, centers, params);\n    }\n    else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) {\n        return hierarchicalClustering< L1<ELEM_TYPE> >(features, centers, params);\n    }\n    else {\n        printf(\"[ERROR] cv::flann::hierarchicalClustering<ELEM_TYPE,DIST_TYPE> only provides backwards \"\n        \"compatibility for the L1 and L2 distances. \"\n        \"For other distance types you must use cv::flann::hierarchicalClustering<Distance>\\n\");\n        CV_Assert(0);\n    }\n}\n\n//! @endcond\n\n//! @} flann\n\n} } // namespace cv::flann\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/core.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_CORE_HPP\n#define OPENCV_GAPI_CORE_HPP\n\n#include <math.h>\n\n#include <utility> // std::tuple\n\n#include <opencv2/imgproc.hpp>\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/gscalar.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n#include <opencv2/gapi/streaming/format.hpp>\n\n/** \\defgroup gapi_core G-API Core functionality\n@{\n    @defgroup gapi_math Graph API: Math operations\n    @defgroup gapi_pixelwise Graph API: Pixelwise operations\n    @defgroup gapi_matrixop Graph API: Operations on matrices\n    @defgroup gapi_transform Graph API: Image and channel composition functions\n@}\n */\n\nnamespace cv { namespace gapi {\n/**\n * @brief This namespace contains G-API Operation Types for OpenCV\n * Core module functionality.\n */\nnamespace core {\n    using GMat2 = std::tuple<GMat,GMat>;\n    using GMat3 = std::tuple<GMat,GMat,GMat>; // FIXME: how to avoid this?\n    using GMat4 = std::tuple<GMat,GMat,GMat,GMat>;\n    using GMatScalar  = std::tuple<GMat, GScalar>;\n\n    G_TYPED_KERNEL(GAdd, <GMat(GMat, GMat, int)>, \"org.opencv.core.math.add\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc b, int ddepth) {\n            if (ddepth == -1)\n            {\n                // OpenCV: When the input arrays in add/subtract/multiply/divide\n                // functions have different depths, the output array depth must be\n                // explicitly specified!\n                // See artim_op() @ arithm.cpp\n                GAPI_Assert(a.chan == b.chan);\n                GAPI_Assert(a.depth == b.depth);\n                return a;\n            }\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GAddC, <GMat(GMat, GScalar, int)>, \"org.opencv.core.math.addC\") {\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc, int ddepth) {\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GSub, <GMat(GMat, GMat, int)>, \"org.opencv.core.math.sub\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc b, int ddepth) {\n            if (ddepth == -1)\n            {\n                // This macro should select a larger data depth from a and b\n                // considering the number of channels in the same\n                // FIXME!!! Clarify if it is valid for sub()\n                GAPI_Assert(a.chan == b.chan);\n                ddepth = std::max(a.depth, b.depth);\n            }\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GSubC, <GMat(GMat, GScalar, int)>, \"org.opencv.core.math.subC\") {\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc, int ddepth) {\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GSubRC,<GMat(GScalar, GMat, int)>, \"org.opencv.core.math.subRC\") {\n        static GMatDesc outMeta(GScalarDesc, GMatDesc b, int ddepth) {\n            return b.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GMul, <GMat(GMat, GMat, double, int)>, \"org.opencv.core.math.mul\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc, double, int ddepth) {\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GMulCOld, <GMat(GMat, double, int)>, \"org.opencv.core.math.mulCOld\") {\n        static GMatDesc outMeta(GMatDesc a, double, int ddepth) {\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GMulC, <GMat(GMat, GScalar, int)>, \"org.opencv.core.math.mulC\"){\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc, int ddepth) {\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GMulS, <GMat(GMat, GScalar)>, \"org.opencv.core.math.muls\") {\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a;\n        }\n    }; // FIXME: Merge with MulC\n\n    G_TYPED_KERNEL(GDiv, <GMat(GMat, GMat, double, int)>, \"org.opencv.core.math.div\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc b, double, int ddepth) {\n            if (ddepth == -1)\n            {\n                GAPI_Assert(a.depth == b.depth);\n                return b;\n            }\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GDivC, <GMat(GMat, GScalar, double, int)>, \"org.opencv.core.math.divC\") {\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc, double, int ddepth) {\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GDivRC, <GMat(GScalar, GMat, double, int)>, \"org.opencv.core.math.divRC\") {\n        static GMatDesc outMeta(GScalarDesc, GMatDesc b, double, int ddepth) {\n            return b.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GMean, <GScalar(GMat)>, \"org.opencv.core.math.mean\") {\n        static GScalarDesc outMeta(GMatDesc) {\n            return empty_scalar_desc();\n        }\n    };\n\n    G_TYPED_KERNEL_M(GPolarToCart, <GMat2(GMat, GMat, bool)>, \"org.opencv.core.math.polarToCart\") {\n        static std::tuple<GMatDesc, GMatDesc> outMeta(GMatDesc, GMatDesc a, bool) {\n            return std::make_tuple(a, a);\n        }\n    };\n\n    G_TYPED_KERNEL_M(GCartToPolar, <GMat2(GMat, GMat, bool)>, \"org.opencv.core.math.cartToPolar\") {\n        static std::tuple<GMatDesc, GMatDesc> outMeta(GMatDesc x, GMatDesc, bool) {\n            return std::make_tuple(x, x);\n        }\n    };\n\n    G_TYPED_KERNEL(GPhase, <GMat(GMat, GMat, bool)>, \"org.opencv.core.math.phase\") {\n        static GMatDesc outMeta(const GMatDesc &inx, const GMatDesc &, bool) {\n            return inx;\n        }\n    };\n\n    G_TYPED_KERNEL(GMask, <GMat(GMat,GMat)>, \"org.opencv.core.pixelwise.mask\") {\n        static GMatDesc outMeta(GMatDesc in, GMatDesc) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpGT, <GMat(GMat, GMat)>, \"org.opencv.core.pixelwise.compare.cmpGT\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpGE, <GMat(GMat, GMat)>, \"org.opencv.core.pixelwise.compare.cmpGE\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpLE, <GMat(GMat, GMat)>, \"org.opencv.core.pixelwise.compare.cmpLE\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpLT, <GMat(GMat, GMat)>, \"org.opencv.core.pixelwise.compare.cmpLT\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpEQ, <GMat(GMat, GMat)>, \"org.opencv.core.pixelwise.compare.cmpEQ\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpNE, <GMat(GMat, GMat)>, \"org.opencv.core.pixelwise.compare.cmpNE\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpGTScalar, <GMat(GMat, GScalar)>, \"org.opencv.core.pixelwise.compare.cmpGTScalar\"){\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpGEScalar, <GMat(GMat, GScalar)>, \"org.opencv.core.pixelwise.compare.cmpGEScalar\"){\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpLEScalar, <GMat(GMat, GScalar)>, \"org.opencv.core.pixelwise.compare.cmpLEScalar\"){\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpLTScalar, <GMat(GMat, GScalar)>, \"org.opencv.core.pixelwise.compare.cmpLTScalar\"){\n    static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpEQScalar, <GMat(GMat, GScalar)>, \"org.opencv.core.pixelwise.compare.cmpEQScalar\"){\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GCmpNEScalar, <GMat(GMat, GScalar)>, \"org.opencv.core.pixelwise.compare.cmpNEScalar\"){\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a.withDepth(CV_8U);\n        }\n    };\n\n    G_TYPED_KERNEL(GAnd, <GMat(GMat, GMat)>, \"org.opencv.core.pixelwise.bitwise_and\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GAndS, <GMat(GMat, GScalar)>, \"org.opencv.core.pixelwise.bitwise_andS\") {\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GOr, <GMat(GMat, GMat)>, \"org.opencv.core.pixelwise.bitwise_or\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GOrS, <GMat(GMat, GScalar)>, \"org.opencv.core.pixelwise.bitwise_orS\") {\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GXor, <GMat(GMat, GMat)>, \"org.opencv.core.pixelwise.bitwise_xor\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GXorS, <GMat(GMat, GScalar)>, \"org.opencv.core.pixelwise.bitwise_xorS\") {\n        static GMatDesc outMeta(GMatDesc a, GScalarDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GNot, <GMat(GMat)>, \"org.opencv.core.pixelwise.bitwise_not\") {\n        static GMatDesc outMeta(GMatDesc a) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GSelect, <GMat(GMat, GMat, GMat)>, \"org.opencv.core.pixelwise.select\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc, GMatDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GMin, <GMat(GMat, GMat)>, \"org.opencv.core.matrixop.min\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GMax, <GMat(GMat, GMat)>, \"org.opencv.core.matrixop.max\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GAbsDiff, <GMat(GMat, GMat)>, \"org.opencv.core.matrixop.absdiff\") {\n        static GMatDesc outMeta(GMatDesc a, GMatDesc) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GAbsDiffC, <GMat(GMat,GScalar)>, \"org.opencv.core.matrixop.absdiffC\") {\n        static GMatDesc outMeta(const GMatDesc& a, const GScalarDesc&) {\n            return a;\n        }\n    };\n\n    G_TYPED_KERNEL(GSum, <GScalar(GMat)>, \"org.opencv.core.matrixop.sum\") {\n        static GScalarDesc outMeta(GMatDesc) {\n            return empty_scalar_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GCountNonZero, <GOpaque<int>(GMat)>, \"org.opencv.core.matrixop.countNonZero\") {\n        static GOpaqueDesc outMeta(GMatDesc in) {\n            GAPI_Assert(in.chan == 1);\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GAddW, <GMat(GMat, double, GMat, double, double, int)>, \"org.opencv.core.matrixop.addweighted\") {\n        static GMatDesc outMeta(GMatDesc a, double, GMatDesc b, double, double, int ddepth) {\n            if (ddepth == -1)\n            {\n                // OpenCV: When the input arrays in add/subtract/multiply/divide\n                // functions have different depths, the output array depth must be\n                // explicitly specified!\n                // See artim_op() @ arithm.cpp\n                GAPI_Assert(a.chan == b.chan);\n                GAPI_Assert(a.depth == b.depth);\n                return a;\n            }\n            return a.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GNormL1, <GScalar(GMat)>, \"org.opencv.core.matrixop.norml1\") {\n        static GScalarDesc outMeta(GMatDesc) {\n            return empty_scalar_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GNormL2, <GScalar(GMat)>, \"org.opencv.core.matrixop.norml2\") {\n        static GScalarDesc outMeta(GMatDesc) {\n            return empty_scalar_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GNormInf, <GScalar(GMat)>, \"org.opencv.core.matrixop.norminf\") {\n        static GScalarDesc outMeta(GMatDesc) {\n            return empty_scalar_desc();\n        }\n    };\n\n    G_TYPED_KERNEL_M(GIntegral, <GMat2(GMat, int, int)>, \"org.opencv.core.matrixop.integral\") {\n        static std::tuple<GMatDesc, GMatDesc> outMeta(GMatDesc in, int sd, int sqd) {\n            return std::make_tuple(in.withSizeDelta(1,1).withDepth(sd),\n                                   in.withSizeDelta(1,1).withDepth(sqd));\n        }\n    };\n\n    G_TYPED_KERNEL(GThreshold, <GMat(GMat, GScalar, GScalar, int)>, \"org.opencv.core.matrixop.threshold\") {\n        static GMatDesc outMeta(GMatDesc in, GScalarDesc, GScalarDesc, int) {\n            return in;\n        }\n    };\n\n\n    G_TYPED_KERNEL_M(GThresholdOT, <GMatScalar(GMat, GScalar, int)>, \"org.opencv.core.matrixop.thresholdOT\") {\n        static std::tuple<GMatDesc,GScalarDesc> outMeta(GMatDesc in, GScalarDesc, int) {\n            return std::make_tuple(in, empty_scalar_desc());\n        }\n    };\n\n    G_TYPED_KERNEL(GInRange, <GMat(GMat, GScalar, GScalar)>, \"org.opencv.core.matrixop.inrange\") {\n        static GMatDesc outMeta(GMatDesc in, GScalarDesc, GScalarDesc) {\n            return in.withType(CV_8U, 1);\n        }\n    };\n\n    G_TYPED_KERNEL_M(GSplit3, <GMat3(GMat)>, \"org.opencv.core.transform.split3\") {\n        static std::tuple<GMatDesc, GMatDesc, GMatDesc> outMeta(GMatDesc in) {\n            const auto out_depth = in.depth;\n            const auto out_desc  = in.withType(out_depth, 1);\n            return std::make_tuple(out_desc, out_desc, out_desc);\n        }\n    };\n\n    G_TYPED_KERNEL_M(GSplit4, <GMat4(GMat)>,\"org.opencv.core.transform.split4\") {\n        static std::tuple<GMatDesc, GMatDesc, GMatDesc, GMatDesc> outMeta(GMatDesc in) {\n            const auto out_depth = in.depth;\n            const auto out_desc = in.withType(out_depth, 1);\n            return std::make_tuple(out_desc, out_desc, out_desc, out_desc);\n        }\n    };\n\n    G_TYPED_KERNEL(GResize, <GMat(GMat,Size,double,double,int)>, \"org.opencv.core.transform.resize\") {\n        static GMatDesc outMeta(GMatDesc in, Size sz, double fx, double fy, int) {\n            if (sz.width != 0 && sz.height != 0)\n            {\n                return in.withSize(sz);\n            }\n            else\n            {\n                int outSz_w = static_cast<int>(round(in.size.width  * fx));\n                int outSz_h = static_cast<int>(round(in.size.height * fy));\n                GAPI_Assert(outSz_w > 0 && outSz_h > 0);\n                return in.withSize(Size(outSz_w, outSz_h));\n            }\n        }\n    };\n\n    G_TYPED_KERNEL(GResizeP, <GMatP(GMatP,Size,int)>, \"org.opencv.core.transform.resizeP\") {\n        static GMatDesc outMeta(GMatDesc in, Size sz, int interp) {\n            GAPI_Assert(in.depth == CV_8U);\n            GAPI_Assert(in.chan == 3);\n            GAPI_Assert(in.planar);\n            GAPI_Assert(interp == cv::INTER_LINEAR);\n            return in.withSize(sz);\n        }\n    };\n\n    G_TYPED_KERNEL(GMerge3, <GMat(GMat,GMat,GMat)>, \"org.opencv.core.transform.merge3\") {\n        static GMatDesc outMeta(GMatDesc in, GMatDesc, GMatDesc) {\n            // Preserve depth and add channel component\n            return in.withType(in.depth, 3);\n        }\n    };\n\n    G_TYPED_KERNEL(GMerge4, <GMat(GMat,GMat,GMat,GMat)>, \"org.opencv.core.transform.merge4\") {\n        static GMatDesc outMeta(GMatDesc in, GMatDesc, GMatDesc, GMatDesc) {\n            // Preserve depth and add channel component\n            return in.withType(in.depth, 4);\n        }\n    };\n\n    G_TYPED_KERNEL(GRemap, <GMat(GMat, Mat, Mat, int, int, Scalar)>, \"org.opencv.core.transform.remap\") {\n        static GMatDesc outMeta(GMatDesc in, Mat m1, Mat, int, int, Scalar) {\n            return in.withSize(m1.size());\n        }\n    };\n\n    G_TYPED_KERNEL(GFlip, <GMat(GMat, int)>, \"org.opencv.core.transform.flip\") {\n        static GMatDesc outMeta(GMatDesc in, int) {\n            return in;\n        }\n    };\n\n    // TODO: eliminate the need in this kernel (streaming)\n    G_TYPED_KERNEL(GCrop, <GMat(GMat, Rect)>, \"org.opencv.core.transform.crop\") {\n        static GMatDesc outMeta(GMatDesc in, Rect rc) {\n            return in.withSize(Size(rc.width, rc.height));\n        }\n    };\n\n    G_TYPED_KERNEL(GConcatHor, <GMat(GMat, GMat)>, \"org.opencv.imgproc.transform.concatHor\") {\n        static GMatDesc outMeta(GMatDesc l, GMatDesc r) {\n            return l.withSizeDelta(+r.size.width, 0);\n        }\n    };\n\n    G_TYPED_KERNEL(GConcatVert, <GMat(GMat, GMat)>, \"org.opencv.imgproc.transform.concatVert\") {\n        static GMatDesc outMeta(GMatDesc t, GMatDesc b) {\n            return t.withSizeDelta(0, +b.size.height);\n        }\n    };\n\n    G_TYPED_KERNEL(GLUT, <GMat(GMat, Mat)>, \"org.opencv.core.transform.LUT\") {\n        static GMatDesc outMeta(GMatDesc in, Mat) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GConvertTo, <GMat(GMat, int, double, double)>, \"org.opencv.core.transform.convertTo\") {\n        static GMatDesc outMeta(GMatDesc in, int rdepth, double, double) {\n            return rdepth < 0 ? in : in.withDepth(rdepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GSqrt, <GMat(GMat)>, \"org.opencv.core.math.sqrt\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GNormalize, <GMat(GMat, double, double, int, int)>, \"org.opencv.core.normalize\") {\n        static GMatDesc outMeta(GMatDesc in, double, double, int, int ddepth) {\n            // unlike opencv doesn't have a mask as a parameter\n            return (ddepth < 0 ? in : in.withDepth(ddepth));\n        }\n    };\n\n    G_TYPED_KERNEL(GWarpPerspective, <GMat(GMat, const Mat&, Size, int, int, const cv::Scalar&)>, \"org.opencv.core.warpPerspective\") {\n        static GMatDesc outMeta(GMatDesc in, const Mat&, Size dsize, int, int borderMode, const cv::Scalar&) {\n            GAPI_Assert((borderMode == cv::BORDER_CONSTANT || borderMode == cv::BORDER_REPLICATE) &&\n                        \"cv::gapi::warpPerspective supports only cv::BORDER_CONSTANT and cv::BORDER_REPLICATE border modes\");\n            return in.withType(in.depth, in.chan).withSize(dsize);\n        }\n    };\n\n    G_TYPED_KERNEL(GWarpAffine, <GMat(GMat, const Mat&, Size, int, int, const cv::Scalar&)>, \"org.opencv.core.warpAffine\") {\n        static GMatDesc outMeta(GMatDesc in, const Mat&, Size dsize, int, int border_mode, const cv::Scalar&) {\n            GAPI_Assert(border_mode != cv::BORDER_TRANSPARENT &&\n                        \"cv::BORDER_TRANSPARENT mode is not supported in cv::gapi::warpAffine\");\n            return in.withType(in.depth, in.chan).withSize(dsize);\n        }\n    };\n\n    G_TYPED_KERNEL(\n        GKMeansND,\n        <std::tuple<GOpaque<double>,GMat,GMat>(GMat,int,GMat,TermCriteria,int,KmeansFlags)>,\n        \"org.opencv.core.kmeansND\") {\n\n        static std::tuple<GOpaqueDesc,GMatDesc,GMatDesc>\n        outMeta(const GMatDesc& in, int K, const GMatDesc& bestLabels, const TermCriteria&, int,\n                KmeansFlags flags) {\n            GAPI_Assert(in.depth == CV_32F);\n            std::vector<int> amount_n_dim = detail::checkVector(in);\n            int amount = amount_n_dim[0], dim = amount_n_dim[1];\n            if (amount == -1)   // Mat with height != 1, width != 1, channels != 1 given\n            {                   // which means that kmeans will consider the following:\n                amount = in.size.height;\n                dim    = in.size.width * in.chan;\n            }\n            // kmeans sets these labels' sizes when no bestLabels given:\n            GMatDesc out_labels(CV_32S, 1, Size{1, amount});\n            // kmeans always sets these centers' sizes:\n            GMatDesc centers   (CV_32F, 1, Size{dim, K});\n            if (flags & KMEANS_USE_INITIAL_LABELS)\n            {\n                GAPI_Assert(bestLabels.depth == CV_32S);\n                int labels_amount = detail::checkVector(bestLabels, 1u);\n                GAPI_Assert(labels_amount == amount);\n                out_labels = bestLabels;  // kmeans preserves bestLabels' sizes if given\n            }\n            return std::make_tuple(empty_gopaque_desc(), out_labels, centers);\n        }\n    };\n\n    G_TYPED_KERNEL(\n        GKMeansNDNoInit,\n        <std::tuple<GOpaque<double>,GMat,GMat>(GMat,int,TermCriteria,int,KmeansFlags)>,\n        \"org.opencv.core.kmeansNDNoInit\") {\n\n        static std::tuple<GOpaqueDesc,GMatDesc,GMatDesc>\n        outMeta(const GMatDesc& in, int K, const TermCriteria&, int, KmeansFlags flags) {\n            GAPI_Assert( !(flags & KMEANS_USE_INITIAL_LABELS) );\n            GAPI_Assert(in.depth == CV_32F);\n            std::vector<int> amount_n_dim = detail::checkVector(in);\n            int amount = amount_n_dim[0], dim = amount_n_dim[1];\n            if (amount == -1) // Mat with height != 1, width != 1, channels != 1 given\n            {                   // which means that kmeans will consider the following:\n                amount = in.size.height;\n                dim    = in.size.width * in.chan;\n            }\n            GMatDesc out_labels(CV_32S, 1, Size{1, amount});\n            GMatDesc centers   (CV_32F, 1, Size{dim, K});\n            return std::make_tuple(empty_gopaque_desc(), out_labels, centers);\n        }\n    };\n\n    G_TYPED_KERNEL(GKMeans2D, <std::tuple<GOpaque<double>,GArray<int>,GArray<Point2f>>\n                               (GArray<Point2f>,int,GArray<int>,TermCriteria,int,KmeansFlags)>,\n                   \"org.opencv.core.kmeans2D\") {\n        static std::tuple<GOpaqueDesc,GArrayDesc,GArrayDesc>\n        outMeta(const GArrayDesc&,int,const GArrayDesc&,const TermCriteria&,int,KmeansFlags) {\n            return std::make_tuple(empty_gopaque_desc(), empty_array_desc(), empty_array_desc());\n        }\n    };\n\n    G_TYPED_KERNEL(GKMeans3D, <std::tuple<GOpaque<double>,GArray<int>,GArray<Point3f>>\n                               (GArray<Point3f>,int,GArray<int>,TermCriteria,int,KmeansFlags)>,\n                   \"org.opencv.core.kmeans3D\") {\n        static std::tuple<GOpaqueDesc,GArrayDesc,GArrayDesc>\n        outMeta(const GArrayDesc&,int,const GArrayDesc&,const TermCriteria&,int,KmeansFlags) {\n            return std::make_tuple(empty_gopaque_desc(), empty_array_desc(), empty_array_desc());\n        }\n    };\n\n    G_TYPED_KERNEL(GTranspose, <GMat(GMat)>, \"org.opencv.core.transpose\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in.withSize({in.size.height, in.size.width});\n        }\n    };\n} // namespace core\n\nnamespace streaming {\n\n// Operations for Streaming (declared in this header for convenience)\nG_TYPED_KERNEL(GSize, <GOpaque<Size>(GMat)>, \"org.opencv.streaming.size\") {\n    static GOpaqueDesc outMeta(const GMatDesc&) {\n        return empty_gopaque_desc();\n    }\n};\n\nG_TYPED_KERNEL(GSizeR, <GOpaque<Size>(GOpaque<Rect>)>, \"org.opencv.streaming.sizeR\") {\n    static GOpaqueDesc outMeta(const GOpaqueDesc&) {\n        return empty_gopaque_desc();\n    }\n};\n\nG_TYPED_KERNEL(GSizeMF, <GOpaque<Size>(GFrame)>, \"org.opencv.streaming.sizeMF\") {\n    static GOpaqueDesc outMeta(const GFrameDesc&) {\n        return empty_gopaque_desc();\n    }\n};\n} // namespace streaming\n\n//! @addtogroup gapi_math\n//! @{\n\n/** @brief Calculates the per-element sum of two matrices.\n\nThe function add calculates sum of two matrices of the same size and the same number of channels:\n\\f[\\texttt{dst}(I) =  \\texttt{saturate} ( \\texttt{src1}(I) +  \\texttt{src2}(I)) \\quad \\texttt{if mask}(I) \\ne0\\f]\n\nThe function can be replaced with matrix expressions:\n    \\f[\\texttt{dst} =  \\texttt{src1} + \\texttt{src2}\\f]\n\nThe input matrices and the output matrix can all have the same or different depths. For example, you\ncan add a 16-bit unsigned matrix to a 8-bit signed matrix and store the sum as a 32-bit\nfloating-point matrix. Depth of the output matrix is determined by the ddepth parameter.\nIf src1.depth() == src2.depth(), ddepth can be set to the default -1. In this case, the output matrix will have\nthe same depth as the input matrices.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.add\"\n@param src1 first input matrix.\n@param src2 second input matrix.\n@param ddepth optional depth of the output matrix.\n@sa sub, addWeighted\n*/\nGAPI_EXPORTS_W GMat add(const GMat& src1, const GMat& src2, int ddepth = -1);\n\n/** @brief Calculates the per-element sum of matrix and given scalar.\n\nThe function addC adds a given scalar value to each element of given matrix.\nThe function can be replaced with matrix expressions:\n\n    \\f[\\texttt{dst} =  \\texttt{src1} + \\texttt{c}\\f]\n\nDepth of the output matrix is determined by the ddepth parameter.\nIf ddepth is set to default -1, the depth of output matrix will be the same as the depth of input matrix.\nThe matrices can be single or multi channel. Output matrix must have the same size and number of channels as the input matrix.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.addC\"\n@param src1 first input matrix.\n@param c scalar value to be added.\n@param ddepth optional depth of the output matrix.\n@sa sub, addWeighted\n*/\nGAPI_EXPORTS_W GMat addC(const GMat& src1, const GScalar& c, int ddepth = -1);\n//! @overload\nGAPI_EXPORTS GMat addC(const GScalar& c, const GMat& src1, int ddepth = -1);\n\n/** @brief Calculates the per-element difference between two matrices.\n\nThe function sub calculates difference between two matrices, when both matrices have the same size and the same number of\nchannels:\n    \\f[\\texttt{dst}(I) =   \\texttt{src1}(I) -  \\texttt{src2}(I)\\f]\n\nThe function can be replaced with matrix expressions:\n\\f[\\texttt{dst} =   \\texttt{src1} -  \\texttt{src2}\\f]\n\nThe input matrices and the output matrix can all have the same or different depths. For example, you\ncan subtract two 8-bit unsigned matrices store the result as a 16-bit signed matrix.\nDepth of the output matrix is determined by the ddepth parameter.\nIf src1.depth() == src2.depth(), ddepth can be set to the default -1. In this case, the output matrix will have\nthe same depth as the input matrices. The matrices can be single or multi channel.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.sub\"\n@param src1 first input matrix.\n@param src2 second input matrix.\n@param ddepth optional depth of the output matrix.\n@sa  add, addC\n  */\nGAPI_EXPORTS GMat sub(const GMat& src1, const GMat& src2, int ddepth = -1);\n\n/** @brief Calculates the per-element difference between matrix and given scalar.\n\nThe function can be replaced with matrix expressions:\n    \\f[\\texttt{dst} =  \\texttt{src} - \\texttt{c}\\f]\n\nDepth of the output matrix is determined by the ddepth parameter.\nIf ddepth is set to default -1, the depth of output matrix will be the same as the depth of input matrix.\nThe matrices can be single or multi channel. Output matrix must have the same size as src.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.subC\"\n@param src first input matrix.\n@param c scalar value to subtracted.\n@param ddepth optional depth of the output matrix.\n@sa  add, addC, subRC\n  */\nGAPI_EXPORTS GMat subC(const GMat& src, const GScalar& c, int ddepth = -1);\n\n/** @brief Calculates the per-element difference between given scalar and the matrix.\n\nThe function can be replaced with matrix expressions:\n    \\f[\\texttt{dst} =  \\texttt{val} - \\texttt{src}\\f]\n\nDepth of the output matrix is determined by the ddepth parameter.\nIf ddepth is set to default -1, the depth of output matrix will be the same as the depth of input matrix.\nThe matrices can be single or multi channel. Output matrix must have the same size as src.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.subRC\"\n@param c scalar value to subtract from.\n@param src input matrix to be subtracted.\n@param ddepth optional depth of the output matrix.\n@sa  add, addC, subC\n  */\nGAPI_EXPORTS GMat subRC(const GScalar& c, const GMat& src, int ddepth = -1);\n\n/** @brief Calculates the per-element scaled product of two matrices.\n\nThe function mul calculates the per-element product of two matrices:\n\n\\f[\\texttt{dst} (I)= \\texttt{saturate} ( \\texttt{scale} \\cdot \\texttt{src1} (I)  \\cdot \\texttt{src2} (I))\\f]\n\nIf src1.depth() == src2.depth(), ddepth can be set to the default -1. In this case, the output matrix will have\nthe same depth as the input matrices. The matrices can be single or multi channel.\nOutput matrix must have the same size as input matrices.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.mul\"\n@param src1 first input matrix.\n@param src2 second input matrix of the same size and the same depth as src1.\n@param scale optional scale factor.\n@param ddepth optional depth of the output matrix.\n@sa add, sub, div, addWeighted\n*/\nGAPI_EXPORTS GMat mul(const GMat& src1, const GMat& src2, double scale = 1.0, int ddepth = -1);\n\n/** @brief Multiplies matrix by scalar.\n\nThe function mulC multiplies each element of matrix src by given scalar value:\n\n\\f[\\texttt{dst} (I)= \\texttt{saturate} (  \\texttt{src1} (I)  \\cdot \\texttt{multiplier} )\\f]\n\nThe matrices can be single or multi channel. Output matrix must have the same size as src.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.mulC\"\n@param src input matrix.\n@param multiplier factor to be multiplied.\n@param ddepth optional depth of the output matrix. If -1, the depth of output matrix will be the same as input matrix depth.\n@sa add, sub, div, addWeighted\n*/\nGAPI_EXPORTS GMat mulC(const GMat& src, double multiplier, int ddepth = -1);\n//! @overload\nGAPI_EXPORTS GMat mulC(const GMat& src, const GScalar& multiplier, int ddepth = -1);   // FIXME: merge with mulc\n//! @overload\nGAPI_EXPORTS GMat mulC(const GScalar& multiplier, const GMat& src, int ddepth = -1);   // FIXME: merge with mulc\n\n/** @brief Performs per-element division of two matrices.\n\nThe function divides one matrix by another:\n\\f[\\texttt{dst(I) = saturate(src1(I)*scale/src2(I))}\\f]\n\nWhen src2(I) is zero, dst(I) will also be zero. Different channels of\nmulti-channel matrices are processed independently.\nThe matrices can be single or multi channel. Output matrix must have the same size and depth as src.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.div\"\n@param src1 first input matrix.\n@param src2 second input matrix of the same size and depth as src1.\n@param scale scalar factor.\n@param ddepth optional depth of the output matrix; you can only pass -1 when src1.depth() == src2.depth().\n@sa  mul, add, sub\n*/\nGAPI_EXPORTS GMat div(const GMat& src1, const GMat& src2, double scale, int ddepth = -1);\n\n/** @brief Divides matrix by scalar.\n\nThe function divC divides each element of matrix src by given scalar value:\n\n\\f[\\texttt{dst(I) = saturate(src(I)*scale/divisor)}\\f]\n\nWhen divisor is zero, dst(I) will also be zero. Different channels of\nmulti-channel matrices are processed independently.\nThe matrices can be single or multi channel. Output matrix must have the same size and depth as src.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.divC\"\n@param src input matrix.\n@param divisor number to be divided by.\n@param ddepth optional depth of the output matrix. If -1, the depth of output matrix will be the same as input matrix depth.\n@param scale scale factor.\n@sa add, sub, div, addWeighted\n*/\nGAPI_EXPORTS GMat divC(const GMat& src, const GScalar& divisor, double scale, int ddepth = -1);\n\n/** @brief Divides scalar by matrix.\n\nThe function divRC divides given scalar by each element of matrix src and keep the division result in new matrix of the same size and type as src:\n\n\\f[\\texttt{dst(I) = saturate(divident*scale/src(I))}\\f]\n\nWhen src(I) is zero, dst(I) will also be zero. Different channels of\nmulti-channel matrices are processed independently.\nThe matrices can be single or multi channel. Output matrix must have the same size and depth as src.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.divRC\"\n@param src input matrix.\n@param divident number to be divided.\n@param ddepth optional depth of the output matrix. If -1, the depth of output matrix will be the same as input matrix depth.\n@param scale scale factor\n@sa add, sub, div, addWeighted\n*/\nGAPI_EXPORTS GMat divRC(const GScalar& divident, const GMat& src, double scale, int ddepth = -1);\n\n/** @brief Applies a mask to a matrix.\n\nThe function mask set value from given matrix if the corresponding pixel value in mask matrix set to true,\nand set the matrix value to 0 otherwise.\n\nSupported src matrix data types are @ref CV_8UC1, @ref CV_16SC1, @ref CV_16UC1. Supported mask data type is @ref CV_8UC1.\n\n@note Function textual ID is \"org.opencv.core.math.mask\"\n@param src input matrix.\n@param mask input mask matrix.\n*/\nGAPI_EXPORTS GMat mask(const GMat& src, const GMat& mask);\n\n/** @brief Calculates an average (mean) of matrix elements.\n\nThe function mean calculates the mean value M of matrix elements,\nindependently for each channel, and return it.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.math.mean\"\n@param src input matrix.\n@sa  countNonZero, min, max\n*/\nGAPI_EXPORTS_W GScalar mean(const GMat& src);\n\n/** @brief Calculates x and y coordinates of 2D vectors from their magnitude and angle.\n\nThe function polarToCart calculates the Cartesian coordinates of each 2D\nvector represented by the corresponding elements of magnitude and angle:\n\\f[\\begin{array}{l} \\texttt{x} (I) =  \\texttt{magnitude} (I) \\cos ( \\texttt{angle} (I)) \\\\ \\texttt{y} (I) =  \\texttt{magnitude} (I) \\sin ( \\texttt{angle} (I)) \\\\ \\end{array}\\f]\n\nThe relative accuracy of the estimated coordinates is about 1e-6.\n\nFirst output is a matrix of x-coordinates of 2D vectors.\nSecond output is a matrix of y-coordinates of 2D vectors.\nBoth output must have the same size and depth as input matrices.\n\n@note Function textual ID is \"org.opencv.core.math.polarToCart\"\n\n@param magnitude input floating-point @ref CV_32FC1 matrix (1xN) of magnitudes of 2D vectors;\n@param angle input floating-point @ref CV_32FC1 matrix (1xN) of angles of 2D vectors.\n@param angleInDegrees when true, the input angles are measured in\ndegrees, otherwise, they are measured in radians.\n@sa cartToPolar, exp, log, pow, sqrt\n*/\nGAPI_EXPORTS std::tuple<GMat, GMat> polarToCart(const GMat& magnitude, const GMat& angle,\n                                              bool angleInDegrees = false);\n\n/** @brief Calculates the magnitude and angle of 2D vectors.\n\nThe function cartToPolar calculates either the magnitude, angle, or both\nfor every 2D vector (x(I),y(I)):\n\\f[\\begin{array}{l} \\texttt{magnitude} (I)= \\sqrt{\\texttt{x}(I)^2+\\texttt{y}(I)^2} , \\\\ \\texttt{angle} (I)= \\texttt{atan2} ( \\texttt{y} (I), \\texttt{x} (I))[ \\cdot180 / \\pi ] \\end{array}\\f]\n\nThe angles are calculated with accuracy about 0.3 degrees. For the point\n(0,0), the angle is set to 0.\n\nFirst output is a matrix of magnitudes of the same size and depth as input x.\nSecond output is a matrix of angles that has the same size and depth as\nx; the angles are measured in radians (from 0 to 2\\*Pi) or in degrees (0 to 360 degrees).\n\n@note Function textual ID is \"org.opencv.core.math.cartToPolar\"\n\n@param x matrix of @ref CV_32FC1 x-coordinates.\n@param y array of @ref CV_32FC1 y-coordinates.\n@param angleInDegrees a flag, indicating whether the angles are measured\nin radians (which is by default), or in degrees.\n@sa polarToCart\n*/\nGAPI_EXPORTS std::tuple<GMat, GMat> cartToPolar(const GMat& x, const GMat& y,\n                                              bool angleInDegrees = false);\n\n/** @brief Calculates the rotation angle of 2D vectors.\n\nThe function cv::phase calculates the rotation angle of each 2D vector that\nis formed from the corresponding elements of x and y :\n\\f[\\texttt{angle} (I) =  \\texttt{atan2} ( \\texttt{y} (I), \\texttt{x} (I))\\f]\n\nThe angle estimation accuracy is about 0.3 degrees. When x(I)=y(I)=0 ,\nthe corresponding angle(I) is set to 0.\n@param x input floating-point array of x-coordinates of 2D vectors.\n@param y input array of y-coordinates of 2D vectors; it must have the\nsame size and the same type as x.\n@param angleInDegrees when true, the function calculates the angle in\ndegrees, otherwise, they are measured in radians.\n@return array of vector angles; it has the same size and same type as x.\n*/\nGAPI_EXPORTS GMat phase(const GMat& x, const GMat &y, bool angleInDegrees = false);\n\n/** @brief Calculates a square root of array elements.\n\nThe function cv::gapi::sqrt calculates a square root of each input array element.\nIn case of multi-channel arrays, each channel is processed\nindependently. The accuracy is approximately the same as of the built-in\nstd::sqrt .\n@param src input floating-point array.\n@return output array of the same size and type as src.\n*/\nGAPI_EXPORTS GMat sqrt(const GMat &src);\n\n//! @} gapi_math\n//!\n//! @addtogroup gapi_pixelwise\n//! @{\n\n/** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are greater compare to elements in second.\n\nThe function compares elements of two matrices src1 and src2 of the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  > \\texttt{src2} (I)\\f]\n\nWhen the comparison result is true, the corresponding element of output\narray is set to 255. The comparison operations can be replaced with the\nequivalent matrix expressions:\n\\f[\\texttt{dst} =   \\texttt{src1} > \\texttt{src2}\\f]\n\nOutput matrix of depth @ref CV_8U must have the same size and the same number of channels as\n    the input matrices/matrix.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpGT\"\n@param src1 first input matrix.\n@param src2 second input matrix/scalar of the same depth as first input matrix.\n@sa min, max, threshold, cmpLE, cmpGE, cmpLT\n*/\nGAPI_EXPORTS GMat cmpGT(const GMat& src1, const GMat& src2);\n/** @overload\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpGTScalar\"\n*/\nGAPI_EXPORTS GMat cmpGT(const GMat& src1, const GScalar& src2);\n\n/** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are less than elements in second.\n\nThe function compares elements of two matrices src1 and src2 of the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  < \\texttt{src2} (I)\\f]\n\nWhen the comparison result is true, the corresponding element of output\narray is set to 255. The comparison operations can be replaced with the\nequivalent matrix expressions:\n    \\f[\\texttt{dst} =   \\texttt{src1} < \\texttt{src2}\\f]\n\nOutput matrix of depth @ref CV_8U must have the same size and the same number of channels as\n    the input matrices/matrix.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpLT\"\n@param src1 first input matrix.\n@param src2 second input matrix/scalar of the same depth as first input matrix.\n@sa min, max, threshold, cmpLE, cmpGE, cmpGT\n*/\nGAPI_EXPORTS GMat cmpLT(const GMat& src1, const GMat& src2);\n/** @overload\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpLTScalar\"\n*/\nGAPI_EXPORTS GMat cmpLT(const GMat& src1, const GScalar& src2);\n\n/** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are greater or equal compare to elements in second.\n\nThe function compares elements of two matrices src1 and src2 of the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  >= \\texttt{src2} (I)\\f]\n\nWhen the comparison result is true, the corresponding element of output\narray is set to 255. The comparison operations can be replaced with the\nequivalent matrix expressions:\n    \\f[\\texttt{dst} =   \\texttt{src1} >= \\texttt{src2}\\f]\n\nOutput matrix of depth @ref CV_8U must have the same size and the same number of channels as\n    the input matrices.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpGE\"\n@param src1 first input matrix.\n@param src2 second input matrix/scalar of the same depth as first input matrix.\n@sa min, max, threshold, cmpLE, cmpGT, cmpLT\n*/\nGAPI_EXPORTS GMat cmpGE(const GMat& src1, const GMat& src2);\n/** @overload\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpLGEcalar\"\n*/\nGAPI_EXPORTS GMat cmpGE(const GMat& src1, const GScalar& src2);\n\n/** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are less or equal compare to elements in second.\n\nThe function compares elements of two matrices src1 and src2 of the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  <=  \\texttt{src2} (I)\\f]\n\nWhen the comparison result is true, the corresponding element of output\narray is set to 255. The comparison operations can be replaced with the\nequivalent matrix expressions:\n    \\f[\\texttt{dst} =   \\texttt{src1} <= \\texttt{src2}\\f]\n\nOutput matrix of depth @ref CV_8U must have the same size and the same number of channels as\n    the input matrices.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpLE\"\n@param src1 first input matrix.\n@param src2 second input matrix/scalar of the same depth as first input matrix.\n@sa min, max, threshold, cmpGT, cmpGE, cmpLT\n*/\nGAPI_EXPORTS GMat cmpLE(const GMat& src1, const GMat& src2);\n/** @overload\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpLEScalar\"\n*/\nGAPI_EXPORTS GMat cmpLE(const GMat& src1, const GScalar& src2);\n\n/** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are equal to elements in second.\n\nThe function compares elements of two matrices src1 and src2 of the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  ==  \\texttt{src2} (I)\\f]\n\nWhen the comparison result is true, the corresponding element of output\narray is set to 255. The comparison operations can be replaced with the\nequivalent matrix expressions:\n    \\f[\\texttt{dst} =   \\texttt{src1} == \\texttt{src2}\\f]\n\nOutput matrix of depth @ref CV_8U must have the same size and the same number of channels as\n    the input matrices.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpEQ\"\n@param src1 first input matrix.\n@param src2 second input matrix/scalar of the same depth as first input matrix.\n@sa min, max, threshold, cmpNE\n*/\nGAPI_EXPORTS GMat cmpEQ(const GMat& src1, const GMat& src2);\n/** @overload\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpEQScalar\"\n*/\nGAPI_EXPORTS GMat cmpEQ(const GMat& src1, const GScalar& src2);\n\n/** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are not equal to elements in second.\n\nThe function compares elements of two matrices src1 and src2 of the same size:\n    \\f[\\texttt{dst} (I) =  \\texttt{src1} (I)  !=  \\texttt{src2} (I)\\f]\n\nWhen the comparison result is true, the corresponding element of output\narray is set to 255. The comparison operations can be replaced with the\nequivalent matrix expressions:\n    \\f[\\texttt{dst} =   \\texttt{src1} != \\texttt{src2}\\f]\n\nOutput matrix of depth @ref CV_8U must have the same size and the same number of channels as\n    the input matrices.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpNE\"\n@param src1 first input matrix.\n@param src2 second input matrix/scalar of the same depth as first input matrix.\n@sa min, max, threshold, cmpEQ\n*/\nGAPI_EXPORTS GMat cmpNE(const GMat& src1, const GMat& src2);\n/** @overload\n@note Function textual ID is \"org.opencv.core.pixelwise.compare.cmpNEScalar\"\n*/\nGAPI_EXPORTS GMat cmpNE(const GMat& src1, const GScalar& src2);\n\n/** @brief computes bitwise conjunction of the two matrixes (src1 & src2)\nCalculates the per-element bit-wise logical conjunction of two matrices of the same size.\n\nIn case of floating-point matrices, their machine-specific bit\nrepresentations (usually IEEE754-compliant) are used for the operation.\nIn case of multi-channel matrices, each channel is processed\nindependently. Output matrix must have the same size and depth as the input\nmatrices.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.bitwise_and\"\n\n@param src1 first input matrix.\n@param src2 second input matrix.\n*/\nGAPI_EXPORTS GMat bitwise_and(const GMat& src1, const GMat& src2);\n/** @overload\n@note Function textual ID is \"org.opencv.core.pixelwise.bitwise_andS\"\n@param src1 first input matrix.\n@param src2 scalar, which will be per-lemenetly conjuncted with elements of src1.\n*/\nGAPI_EXPORTS GMat bitwise_and(const GMat& src1, const GScalar& src2);\n\n/** @brief computes bitwise disjunction of the two matrixes (src1 | src2)\nCalculates the per-element bit-wise logical disjunction of two matrices of the same size.\n\nIn case of floating-point matrices, their machine-specific bit\nrepresentations (usually IEEE754-compliant) are used for the operation.\nIn case of multi-channel matrices, each channel is processed\nindependently. Output matrix must have the same size and depth as the input\nmatrices.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.bitwise_or\"\n\n@param src1 first input matrix.\n@param src2 second input matrix.\n*/\nGAPI_EXPORTS GMat bitwise_or(const GMat& src1, const GMat& src2);\n/** @overload\n@note Function textual ID is \"org.opencv.core.pixelwise.bitwise_orS\"\n@param src1 first input matrix.\n@param src2 scalar, which will be per-lemenetly disjuncted with elements of src1.\n*/\nGAPI_EXPORTS GMat bitwise_or(const GMat& src1, const GScalar& src2);\n\n\n/** @brief computes bitwise logical \"exclusive or\" of the two matrixes (src1 ^ src2)\nCalculates the per-element bit-wise logical \"exclusive or\" of two matrices of the same size.\n\nIn case of floating-point matrices, their machine-specific bit\nrepresentations (usually IEEE754-compliant) are used for the operation.\nIn case of multi-channel matrices, each channel is processed\nindependently. Output matrix must have the same size and depth as the input\nmatrices.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.bitwise_xor\"\n\n@param src1 first input matrix.\n@param src2 second input matrix.\n*/\nGAPI_EXPORTS GMat bitwise_xor(const GMat& src1, const GMat& src2);\n/** @overload\n@note Function textual ID is \"org.opencv.core.pixelwise.bitwise_xorS\"\n@param src1 first input matrix.\n@param src2 scalar, for which per-lemenet \"logical or\" operation on elements of src1 will be performed.\n*/\nGAPI_EXPORTS GMat bitwise_xor(const GMat& src1, const GScalar& src2);\n\n\n/** @brief Inverts every bit of an array.\n\nThe function bitwise_not calculates per-element bit-wise inversion of the input\nmatrix:\n\\f[\\texttt{dst} (I) =  \\neg \\texttt{src} (I)\\f]\n\nIn case of floating-point matrices, their machine-specific bit\nrepresentations (usually IEEE754-compliant) are used for the operation.\nIn case of multi-channel matrices, each channel is processed\nindependently. Output matrix must have the same size and depth as the input\nmatrix.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.bitwise_not\"\n\n@param src input matrix.\n*/\nGAPI_EXPORTS GMat bitwise_not(const GMat& src);\n\n/** @brief Select values from either first or second of input matrices by given mask.\nThe function set to the output matrix either the value from the first input matrix if corresponding value of mask matrix is 255,\n or value from the second input matrix (if value of mask matrix set to 0).\n\nInput mask matrix must be of @ref CV_8UC1 type, two other inout matrices and output matrix should be of the same type. The size should\nbe the same for all input and output matrices.\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.pixelwise.select\"\n\n@param src1 first input matrix.\n@param src2 second input matrix.\n@param mask mask input matrix.\n*/\nGAPI_EXPORTS GMat select(const GMat& src1, const GMat& src2, const GMat& mask);\n\n//! @} gapi_pixelwise\n\n\n//! @addtogroup gapi_matrixop\n//! @{\n/** @brief Calculates per-element minimum of two matrices.\n\nThe function min calculates the per-element minimum of two matrices of the same size, number of channels and depth:\n\\f[\\texttt{dst} (I)= \\min ( \\texttt{src1} (I), \\texttt{src2} (I))\\f]\n    where I is a multi-dimensional index of matrix elements. In case of\n    multi-channel matrices, each channel is processed independently.\nOutput matrix must be of the same size and depth as src1.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.min\"\n@param src1 first input matrix.\n@param src2 second input matrix of the same size and depth as src1.\n@sa max, cmpEQ, cmpLT, cmpLE\n*/\nGAPI_EXPORTS GMat min(const GMat& src1, const GMat& src2);\n\n/** @brief Calculates per-element maximum of two matrices.\n\nThe function max calculates the per-element maximum of two matrices of the same size, number of channels and depth:\n\\f[\\texttt{dst} (I)= \\max ( \\texttt{src1} (I), \\texttt{src2} (I))\\f]\n    where I is a multi-dimensional index of matrix elements. In case of\n    multi-channel matrices, each channel is processed independently.\nOutput matrix must be of the same size and depth as src1.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.max\"\n@param src1 first input matrix.\n@param src2 second input matrix of the same size and depth as src1.\n@sa min, compare, cmpEQ, cmpGT, cmpGE\n*/\nGAPI_EXPORTS GMat max(const GMat& src1, const GMat& src2);\n\n/** @brief Calculates the per-element absolute difference between two matrices.\n\nThe function absDiff calculates absolute difference between two matrices of the same size and depth:\n    \\f[\\texttt{dst}(I) =  \\texttt{saturate} (| \\texttt{src1}(I) -  \\texttt{src2}(I)|)\\f]\n    where I is a multi-dimensional index of matrix elements. In case of\n    multi-channel matrices, each channel is processed independently.\nOutput matrix must have the same size and depth as input matrices.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.absdiff\"\n@param src1 first input matrix.\n@param src2 second input matrix.\n@sa abs\n*/\nGAPI_EXPORTS GMat absDiff(const GMat& src1, const GMat& src2);\n\n/** @brief Calculates absolute value of matrix elements.\n\nThe function abs calculates absolute difference between matrix elements and given scalar value:\n    \\f[\\texttt{dst}(I) =  \\texttt{saturate} (| \\texttt{src1}(I) -  \\texttt{matC}(I)|)\\f]\n    where matC is constructed from given scalar c and has the same sizes and depth as input matrix src.\n\nOutput matrix must be of the same size and depth as src.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.absdiffC\"\n@param src input matrix.\n@param c scalar to be subtracted.\n@sa min, max\n*/\nGAPI_EXPORTS GMat absDiffC(const GMat& src, const GScalar& c);\n\n/** @brief Calculates sum of all matrix elements.\n\nThe function sum calculates sum of all matrix elements, independently for each channel.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.sum\"\n@param src input matrix.\n@sa countNonZero, mean, min, max\n*/\nGAPI_EXPORTS GScalar sum(const GMat& src);\n\n/** @brief Counts non-zero array elements.\n\nThe function returns the number of non-zero elements in src :\n\\f[\\sum _{I: \\; \\texttt{src} (I) \\ne0 } 1\\f]\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.countNonZero\"\n@param src input single-channel matrix.\n@sa  mean, min, max\n*/\nGAPI_EXPORTS GOpaque<int> countNonZero(const GMat& src);\n\n/** @brief Calculates the weighted sum of two matrices.\n\nThe function addWeighted calculates the weighted sum of two matrices as follows:\n\\f[\\texttt{dst} (I)= \\texttt{saturate} ( \\texttt{src1} (I)* \\texttt{alpha} +  \\texttt{src2} (I)* \\texttt{beta} +  \\texttt{gamma} )\\f]\nwhere I is a multi-dimensional index of array elements. In case of multi-channel matrices, each\nchannel is processed independently.\n\nThe function can be replaced with a matrix expression:\n    \\f[\\texttt{dst}(I) =  \\texttt{alpha} * \\texttt{src1}(I) - \\texttt{beta} * \\texttt{src2}(I) + \\texttt{gamma} \\f]\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.addweighted\"\n@param src1 first input matrix.\n@param alpha weight of the first matrix elements.\n@param src2 second input matrix of the same size and channel number as src1.\n@param beta weight of the second matrix elements.\n@param gamma scalar added to each sum.\n@param ddepth optional depth of the output matrix.\n@sa  add, sub\n*/\nGAPI_EXPORTS GMat addWeighted(const GMat& src1, double alpha, const GMat& src2, double beta, double gamma, int ddepth = -1);\n\n/** @brief Calculates the  absolute L1 norm of a matrix.\n\nThis version of normL1 calculates the absolute L1 norm of src.\n\nAs example for one array consider the function \\f$r(x)= \\begin{pmatrix} x \\\\ 1-x \\end{pmatrix}, x \\in [-1;1]\\f$.\nThe \\f$ L_{1} \\f$ norm for the sample value \\f$r(-1) = \\begin{pmatrix} -1 \\\\ 2 \\end{pmatrix}\\f$\nis calculated as follows\n\\f{align*}\n    \\| r(-1) \\|_{L_1} &= |-1| + |2| = 3 \\\\\n\\f}\nand for \\f$r(0.5) = \\begin{pmatrix} 0.5 \\\\ 0.5 \\end{pmatrix}\\f$ the calculation is\n\\f{align*}\n    \\| r(0.5) \\|_{L_1} &= |0.5| + |0.5| = 1 \\\\\n\\f}\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.norml1\"\n@param src input matrix.\n@sa normL2, normInf\n*/\nGAPI_EXPORTS GScalar normL1(const GMat& src);\n\n/** @brief Calculates the absolute L2 norm of a matrix.\n\nThis version of normL2 calculates the absolute L2 norm of src.\n\nAs example for one array consider the function \\f$r(x)= \\begin{pmatrix} x \\\\ 1-x \\end{pmatrix}, x \\in [-1;1]\\f$.\nThe \\f$ L_{2} \\f$  norm for the sample value \\f$r(-1) = \\begin{pmatrix} -1 \\\\ 2 \\end{pmatrix}\\f$\nis calculated as follows\n\\f{align*}\n    \\| r(-1) \\|_{L_2} &= \\sqrt{(-1)^{2} + (2)^{2}} = \\sqrt{5} \\\\\n\\f}\nand for \\f$r(0.5) = \\begin{pmatrix} 0.5 \\\\ 0.5 \\end{pmatrix}\\f$ the calculation is\n\\f{align*}\n    \\| r(0.5) \\|_{L_2} &= \\sqrt{(0.5)^{2} + (0.5)^{2}} = \\sqrt{0.5} \\\\\n\\f}\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n@note Function textual ID is \"org.opencv.core.matrixop.norml2\"\n@param src input matrix.\n@sa normL1, normInf\n*/\nGAPI_EXPORTS GScalar normL2(const GMat& src);\n\n/** @brief Calculates the absolute infinite norm of a matrix.\n\nThis version of normInf calculates the absolute infinite norm of src.\n\nAs example for one array consider the function \\f$r(x)= \\begin{pmatrix} x \\\\ 1-x \\end{pmatrix}, x \\in [-1;1]\\f$.\nThe \\f$ L_{\\infty} \\f$ norm for the sample value \\f$r(-1) = \\begin{pmatrix} -1 \\\\ 2 \\end{pmatrix}\\f$\nis calculated as follows\n\\f{align*}\n    \\| r(-1) \\|_{L_\\infty} &= \\max(|-1|,|2|) = 2\n\\f}\nand for \\f$r(0.5) = \\begin{pmatrix} 0.5 \\\\ 0.5 \\end{pmatrix}\\f$ the calculation is\n\\f{align*}\n    \\| r(0.5) \\|_{L_\\infty} &= \\max(|0.5|,|0.5|) = 0.5.\n\\f}\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.norminf\"\n@param src input matrix.\n@sa normL1, normL2\n*/\nGAPI_EXPORTS GScalar normInf(const GMat& src);\n\n/** @brief Calculates the integral of an image.\n\nThe function calculates one or more integral images for the source image as follows:\n\n\\f[\\texttt{sum} (X,Y) =  \\sum _{x<X,y<Y}  \\texttt{image} (x,y)\\f]\n\n\\f[\\texttt{sqsum} (X,Y) =  \\sum _{x<X,y<Y}  \\texttt{image} (x,y)^2\\f]\n\nThe function return integral image as \\f$(W+1)\\times (H+1)\\f$ , 32-bit integer or floating-point (32f or 64f) and\n integral image for squared pixel values; it is \\f$(W+1)\\times (H+)\\f$, double-precision floating-point (64f) array.\n\n@note Function textual ID is \"org.opencv.core.matrixop.integral\"\n\n@param src input image.\n@param sdepth desired depth of the integral and the tilted integral images, CV_32S, CV_32F, or\nCV_64F.\n@param sqdepth desired depth of the integral image of squared pixel values, CV_32F or CV_64F.\n */\nGAPI_EXPORTS std::tuple<GMat, GMat> integral(const GMat& src, int sdepth = -1, int sqdepth = -1);\n\n/** @brief Applies a fixed-level threshold to each matrix element.\n\nThe function applies fixed-level thresholding to a single- or multiple-channel matrix.\nThe function is typically used to get a bi-level (binary) image out of a grayscale image ( cmp functions could be also used for\nthis purpose) or for removing a noise, that is, filtering out pixels with too small or too large\nvalues. There are several types of thresholding supported by the function. They are determined by\ntype parameter.\n\nAlso, the special values cv::THRESH_OTSU or cv::THRESH_TRIANGLE may be combined with one of the\nabove values. In these cases, the function determines the optimal threshold value using the Otsu's\nor Triangle algorithm and uses it instead of the specified thresh . The function returns the\ncomputed threshold value in addititon to thresholded matrix.\nThe Otsu's and Triangle methods are implemented only for 8-bit matrices.\n\nInput image should be single channel only in case of cv::THRESH_OTSU or cv::THRESH_TRIANGLE flags.\nOutput matrix must be of the same size and depth as src.\n\n@note Function textual ID is \"org.opencv.core.matrixop.threshold\"\n\n@param src input matrix (@ref CV_8UC1, @ref CV_8UC3, or @ref CV_32FC1).\n@param thresh threshold value.\n@param maxval maximum value to use with the cv::THRESH_BINARY and cv::THRESH_BINARY_INV thresholding\ntypes.\n@param type thresholding type (see the cv::ThresholdTypes).\n\n@sa min, max, cmpGT, cmpLE, cmpGE, cmpLT\n */\nGAPI_EXPORTS GMat threshold(const GMat& src, const GScalar& thresh, const GScalar& maxval, int type);\n/** @overload\nThis function applicable for all threshold types except CV_THRESH_OTSU and CV_THRESH_TRIANGLE\n@note Function textual ID is \"org.opencv.core.matrixop.thresholdOT\"\n*/\nGAPI_EXPORTS_W std::tuple<GMat, GScalar> threshold(const GMat& src, const GScalar& maxval, int type);\n\n/** @brief Applies a range-level threshold to each matrix element.\n\nThe function applies range-level thresholding to a single- or multiple-channel matrix.\nIt sets output pixel value to OxFF if the corresponding pixel value of input matrix is in specified range,or 0 otherwise.\n\nInput and output matrices must be CV_8UC1.\n\n@note Function textual ID is \"org.opencv.core.matrixop.inRange\"\n\n@param src input matrix (CV_8UC1).\n@param threshLow lower boundary value.\n@param threshUp upper boundary value.\n\n@sa threshold\n */\nGAPI_EXPORTS GMat inRange(const GMat& src, const GScalar& threshLow, const GScalar& threshUp);\n\n//! @} gapi_matrixop\n\n//! @addtogroup gapi_transform\n//! @{\n/** @brief Resizes an image.\n\nThe function resizes the image src down to or up to the specified size.\n\nOutput image size will have the size dsize (when dsize is non-zero) or the size computed from\nsrc.size(), fx, and fy; the depth of output is the same as of src.\n\nIf you want to resize src so that it fits the pre-created dst,\nyou may call the function as follows:\n@code\n    // explicitly specify dsize=dst.size(); fx and fy will be computed from that.\n    resize(src, dst, dst.size(), 0, 0, interpolation);\n@endcode\nIf you want to decimate the image by factor of 2 in each direction, you can call the function this\nway:\n@code\n    // specify fx and fy and let the function compute the destination image size.\n    resize(src, dst, Size(), 0.5, 0.5, interpolation);\n@endcode\nTo shrink an image, it will generally look best with cv::INTER_AREA interpolation, whereas to\nenlarge an image, it will generally look best with cv::INTER_CUBIC (slow) or cv::INTER_LINEAR\n(faster but still looks OK).\n\n@note Function textual ID is \"org.opencv.core.transform.resize\"\n\n@param src input image.\n@param dsize output image size; if it equals zero, it is computed as:\n \\f[\\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\\f]\n Either dsize or both fx and fy must be non-zero.\n@param fx scale factor along the horizontal axis; when it equals 0, it is computed as\n\\f[\\texttt{(double)dsize.width/src.cols}\\f]\n@param fy scale factor along the vertical axis; when it equals 0, it is computed as\n\\f[\\texttt{(double)dsize.height/src.rows}\\f]\n@param interpolation interpolation method, see cv::InterpolationFlags\n\n@sa  warpAffine, warpPerspective, remap, resizeP\n */\nGAPI_EXPORTS_W GMat resize(const GMat& src, const Size& dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR);\n\n/** @brief Resizes a planar image.\n\nThe function resizes the image src down to or up to the specified size.\nPlanar image memory layout is three planes laying in the memory contiguously,\nso the image height should be plane_height*plane_number, image type is @ref CV_8UC1.\n\nOutput image size will have the size dsize, the depth of output is the same as of src.\n\n@note Function textual ID is \"org.opencv.core.transform.resizeP\"\n\n@param src input image, must be of @ref CV_8UC1 type;\n@param dsize output image size;\n@param interpolation interpolation method, only cv::INTER_LINEAR is supported at the moment\n\n@sa  warpAffine, warpPerspective, remap, resize\n */\nGAPI_EXPORTS GMatP resizeP(const GMatP& src, const Size& dsize, int interpolation = cv::INTER_LINEAR);\n\n/** @brief Creates one 4-channel matrix out of 4 single-channel ones.\n\nThe function merges several matrices to make a single multi-channel matrix. That is, each\nelement of the output matrix will be a concatenation of the elements of the input matrices, where\nelements of i-th input matrix are treated as mv[i].channels()-element vectors.\nOutput matrix must be of @ref CV_8UC4 type.\n\nThe function split4 does the reverse operation.\n\n@note\n - Function textual ID is \"org.opencv.core.transform.merge4\"\n\n@param src1 first input @ref CV_8UC1 matrix to be merged.\n@param src2 second input @ref CV_8UC1 matrix to be merged.\n@param src3 third input @ref CV_8UC1 matrix to be merged.\n@param src4 fourth input @ref CV_8UC1 matrix to be merged.\n@sa merge3, split4, split3\n*/\nGAPI_EXPORTS GMat merge4(const GMat& src1, const GMat& src2, const GMat& src3, const GMat& src4);\n\n/** @brief Creates one 3-channel matrix out of 3 single-channel ones.\n\nThe function merges several matrices to make a single multi-channel matrix. That is, each\nelement of the output matrix will be a concatenation of the elements of the input matrices, where\nelements of i-th input matrix are treated as mv[i].channels()-element vectors.\nOutput matrix must be of @ref CV_8UC3 type.\n\nThe function split3 does the reverse operation.\n\n@note\n - Function textual ID is \"org.opencv.core.transform.merge3\"\n\n@param src1 first input @ref CV_8UC1 matrix to be merged.\n@param src2 second input @ref CV_8UC1 matrix to be merged.\n@param src3 third input @ref CV_8UC1 matrix to be merged.\n@sa merge4, split4, split3\n*/\nGAPI_EXPORTS GMat merge3(const GMat& src1, const GMat& src2, const GMat& src3);\n\n/** @brief Divides a 4-channel matrix into 4 single-channel matrices.\n\nThe function splits a 4-channel matrix into 4 single-channel matrices:\n\\f[\\texttt{mv} [c](I) =  \\texttt{src} (I)_c\\f]\n\nAll output matrices must be of @ref CV_8UC1 type.\n\nThe function merge4 does the reverse operation.\n\n@note\n - Function textual ID is \"org.opencv.core.transform.split4\"\n\n@param src input @ref CV_8UC4 matrix.\n@sa split3, merge3, merge4\n*/\nGAPI_EXPORTS std::tuple<GMat, GMat, GMat,GMat> split4(const GMat& src);\n\n/** @brief Divides a 3-channel matrix into 3 single-channel matrices.\n\nThe function splits a 3-channel matrix into 3 single-channel matrices:\n\\f[\\texttt{mv} [c](I) =  \\texttt{src} (I)_c\\f]\n\nAll output matrices must be of @ref CV_8UC1 type.\n\nThe function merge3 does the reverse operation.\n\n@note\n - Function textual ID is \"org.opencv.core.transform.split3\"\n\n@param src input @ref CV_8UC3 matrix.\n@sa split4, merge3, merge4\n*/\nGAPI_EXPORTS_W std::tuple<GMat, GMat, GMat> split3(const GMat& src);\n\n/** @brief Applies a generic geometrical transformation to an image.\n\nThe function remap transforms the source image using the specified map:\n\n\\f[\\texttt{dst} (x,y) =  \\texttt{src} (map_x(x,y),map_y(x,y))\\f]\n\nwhere values of pixels with non-integer coordinates are computed using one of available\ninterpolation methods. \\f$map_x\\f$ and \\f$map_y\\f$ can be encoded as separate floating-point maps\nin \\f$map_1\\f$ and \\f$map_2\\f$ respectively, or interleaved floating-point maps of \\f$(x,y)\\f$ in\n\\f$map_1\\f$, or fixed-point maps created by using convertMaps. The reason you might want to\nconvert from floating to fixed-point representations of a map is that they can yield much faster\n(\\~2x) remapping operations. In the converted case, \\f$map_1\\f$ contains pairs (cvFloor(x),\ncvFloor(y)) and \\f$map_2\\f$ contains indices in a table of interpolation coefficients.\nOutput image must be of the same size and depth as input one.\n\n@note\n - Function textual ID is \"org.opencv.core.transform.remap\"\n - Due to current implementation limitations the size of an input and output images should be less than 32767x32767.\n\n@param src Source image.\n@param map1 The first map of either (x,y) points or just x values having the type CV_16SC2,\nCV_32FC1, or CV_32FC2.\n@param map2 The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map\nif map1 is (x,y) points), respectively.\n@param interpolation Interpolation method (see cv::InterpolationFlags). The methods #INTER_AREA\nand #INTER_LINEAR_EXACT are not supported by this function.\n@param borderMode Pixel extrapolation method (see cv::BorderTypes). When\nborderMode=BORDER_TRANSPARENT, it means that the pixels in the destination image that\ncorresponds to the \"outliers\" in the source image are not modified by the function.\n@param borderValue Value used in case of a constant border. By default, it is 0.\n */\nGAPI_EXPORTS GMat remap(const GMat& src, const Mat& map1, const Mat& map2,\n                      int interpolation, int borderMode = BORDER_CONSTANT,\n                      const Scalar& borderValue = Scalar());\n\n/** @brief Flips a 2D matrix around vertical, horizontal, or both axes.\n\nThe function flips the matrix in one of three different ways (row\nand column indices are 0-based):\n\\f[\\texttt{dst} _{ij} =\n\\left\\{\n\\begin{array}{l l}\n\\texttt{src} _{\\texttt{src.rows}-i-1,j} & if\\;  \\texttt{flipCode} = 0 \\\\\n\\texttt{src} _{i, \\texttt{src.cols} -j-1} & if\\;  \\texttt{flipCode} > 0 \\\\\n\\texttt{src} _{ \\texttt{src.rows} -i-1, \\texttt{src.cols} -j-1} & if\\; \\texttt{flipCode} < 0 \\\\\n\\end{array}\n\\right.\\f]\nThe example scenarios of using the function are the following:\n*   Vertical flipping of the image (flipCode == 0) to switch between\n    top-left and bottom-left image origin. This is a typical operation\n    in video processing on Microsoft Windows\\* OS.\n*   Horizontal flipping of the image with the subsequent horizontal\n    shift and absolute difference calculation to check for a\n    vertical-axis symmetry (flipCode \\> 0).\n*   Simultaneous horizontal and vertical flipping of the image with\n    the subsequent shift and absolute difference calculation to check\n    for a central symmetry (flipCode \\< 0).\n*   Reversing the order of point arrays (flipCode \\> 0 or\n    flipCode == 0).\nOutput image must be of the same depth as input one, size should be correct for given flipCode.\n\n@note Function textual ID is \"org.opencv.core.transform.flip\"\n\n@param src input matrix.\n@param flipCode a flag to specify how to flip the array; 0 means\nflipping around the x-axis and positive value (for example, 1) means\nflipping around y-axis. Negative value (for example, -1) means flipping\naround both axes.\n@sa remap\n*/\nGAPI_EXPORTS GMat flip(const GMat& src, int flipCode);\n\n/** @brief Crops a 2D matrix.\n\nThe function crops the matrix by given cv::Rect.\n\nOutput matrix must be of the same depth as input one, size is specified by given rect size.\n\n@note Function textual ID is \"org.opencv.core.transform.crop\"\n\n@param src input matrix.\n@param rect a rect to crop a matrix to\n@sa resize\n*/\nGAPI_EXPORTS GMat crop(const GMat& src, const Rect& rect);\n\n/** @brief Applies horizontal concatenation to given matrices.\n\nThe function horizontally concatenates two GMat matrices (with the same number of rows).\n@code{.cpp}\n    GMat A = { 1, 4,\n               2, 5,\n               3, 6 };\n    GMat B = { 7, 10,\n               8, 11,\n               9, 12 };\n\n    GMat C = gapi::concatHor(A, B);\n    //C:\n    //[1, 4, 7, 10;\n    // 2, 5, 8, 11;\n    // 3, 6, 9, 12]\n@endcode\nOutput matrix must the same number of rows and depth as the src1 and src2, and the sum of cols of the src1 and src2.\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.imgproc.transform.concatHor\"\n\n@param src1 first input matrix to be considered for horizontal concatenation.\n@param src2 second input matrix to be considered for horizontal concatenation.\n@sa concatVert\n*/\nGAPI_EXPORTS GMat concatHor(const GMat& src1, const GMat& src2);\n\n/** @overload\nThe function horizontally concatenates given number of GMat matrices (with the same number of columns).\nOutput matrix must the same number of columns and depth as the input matrices, and the sum of rows of input matrices.\n\n@param v vector of input matrices to be concatenated horizontally.\n*/\nGAPI_EXPORTS GMat concatHor(const std::vector<GMat> &v);\n\n/** @brief Applies vertical concatenation to given matrices.\n\nThe function vertically concatenates two GMat matrices (with the same number of cols).\n @code{.cpp}\n    GMat A = { 1, 7,\n               2, 8,\n               3, 9 };\n    GMat B = { 4, 10,\n               5, 11,\n               6, 12 };\n\n    GMat C = gapi::concatVert(A, B);\n    //C:\n    //[1, 7;\n    // 2, 8;\n    // 3, 9;\n    // 4, 10;\n    // 5, 11;\n    // 6, 12]\n @endcode\n\nOutput matrix must the same number of cols and depth as the src1 and src2, and the sum of rows of the src1 and src2.\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\n\n@note Function textual ID is \"org.opencv.imgproc.transform.concatVert\"\n\n@param src1 first input matrix to be considered for vertical concatenation.\n@param src2 second input matrix to be considered for vertical concatenation.\n@sa concatHor\n*/\nGAPI_EXPORTS GMat concatVert(const GMat& src1, const GMat& src2);\n\n/** @overload\nThe function vertically concatenates given number of GMat matrices (with the same number of columns).\nOutput matrix must the same number of columns and depth as the input matrices, and the sum of rows of input matrices.\n\n@param v vector of input matrices to be concatenated vertically.\n*/\nGAPI_EXPORTS GMat concatVert(const std::vector<GMat> &v);\n\n\n/** @brief Performs a look-up table transform of a matrix.\n\nThe function LUT fills the output matrix with values from the look-up table. Indices of the entries\nare taken from the input matrix. That is, the function processes each element of src as follows:\n\\f[\\texttt{dst} (I)  \\leftarrow \\texttt{lut(src(I))}\\f]\n\nSupported matrix data types are @ref CV_8UC1.\nOutput is a matrix of the same size and number of channels as src, and the same depth as lut.\n\n@note Function textual ID is \"org.opencv.core.transform.LUT\"\n\n@param src input matrix of 8-bit elements.\n@param lut look-up table of 256 elements; in case of multi-channel input array, the table should\neither have a single channel (in this case the same table is used for all channels) or the same\nnumber of channels as in the input matrix.\n*/\nGAPI_EXPORTS GMat LUT(const GMat& src, const Mat& lut);\n\n/** @brief Converts a matrix to another data depth with optional scaling.\n\nThe method converts source pixel values to the target data depth. saturate_cast\\<\\> is applied at\nthe end to avoid possible overflows:\n\n\\f[m(x,y) = saturate \\_ cast<rType>( \\alpha (*this)(x,y) +  \\beta )\\f]\nOutput matrix must be of the same size as input one.\n\n@note Function textual ID is \"org.opencv.core.transform.convertTo\"\n@param src input matrix to be converted from.\n@param rdepth desired output matrix depth or, rather, the depth since the number of channels are the\nsame as the input has; if rdepth is negative, the output matrix will have the same depth as the input.\n@param alpha optional scale factor.\n@param beta optional delta added to the scaled values.\n */\nGAPI_EXPORTS GMat convertTo(const GMat& src, int rdepth, double alpha=1, double beta=0);\n\n/** @brief Normalizes the norm or value range of an array.\n\nThe function normalizes scale and shift the input array elements so that\n\\f[\\| \\texttt{dst} \\| _{L_p}= \\texttt{alpha}\\f]\n(where p=Inf, 1 or 2) when normType=NORM_INF, NORM_L1, or NORM_L2, respectively; or so that\n\\f[\\min _I  \\texttt{dst} (I)= \\texttt{alpha} , \\, \\, \\max _I  \\texttt{dst} (I)= \\texttt{beta}\\f]\nwhen normType=NORM_MINMAX (for dense arrays only).\n\n@note Function textual ID is \"org.opencv.core.normalize\"\n\n@param src input array.\n@param alpha norm value to normalize to or the lower range boundary in case of the range\nnormalization.\n@param beta upper range boundary in case of the range normalization; it is not used for the norm\nnormalization.\n@param norm_type normalization type (see cv::NormTypes).\n@param ddepth when negative, the output array has the same type as src; otherwise, it has the same\nnumber of channels as src and the depth =ddepth.\n@sa norm, Mat::convertTo\n*/\nGAPI_EXPORTS GMat normalize(const GMat& src, double alpha, double beta,\n                            int norm_type, int ddepth = -1);\n\n/** @brief Applies a perspective transformation to an image.\n\nThe function warpPerspective transforms the source image using the specified matrix:\n\n\\f[\\texttt{dst} (x,y) =  \\texttt{src} \\left ( \\frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} ,\n     \\frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \\right )\\f]\n\nwhen the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert\nand then put in the formula above instead of M. The function cannot operate in-place.\n\n@param src input image.\n@param M \\f$3\\times 3\\f$ transformation matrix.\n@param dsize size of the output image.\n@param flags combination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the\noptional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation (\n\\f$\\texttt{dst}\\rightarrow\\texttt{src}\\f$ ).\n@param borderMode pixel extrapolation method (#BORDER_CONSTANT or #BORDER_REPLICATE).\n@param borderValue value used in case of a constant border; by default, it equals 0.\n\n@sa  warpAffine, resize, remap, getRectSubPix, perspectiveTransform\n */\nGAPI_EXPORTS GMat warpPerspective(const GMat& src, const Mat& M, const Size& dsize, int flags = cv::INTER_LINEAR,\n                                  int borderMode = cv::BORDER_CONSTANT, const Scalar& borderValue = Scalar());\n\n/** @brief Applies an affine transformation to an image.\n\nThe function warpAffine transforms the source image using the specified matrix:\n\n\\f[\\texttt{dst} (x,y) =  \\texttt{src} ( \\texttt{M} _{11} x +  \\texttt{M} _{12} y +  \\texttt{M} _{13}, \\texttt{M} _{21} x +  \\texttt{M} _{22} y +  \\texttt{M} _{23})\\f]\n\nwhen the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted\nwith #invertAffineTransform and then put in the formula above instead of M. The function cannot\noperate in-place.\n\n@param src input image.\n@param M \\f$2\\times 3\\f$ transformation matrix.\n@param dsize size of the output image.\n@param flags combination of interpolation methods (see #InterpolationFlags) and the optional\nflag #WARP_INVERSE_MAP that means that M is the inverse transformation (\n\\f$\\texttt{dst}\\rightarrow\\texttt{src}\\f$ ).\n@param borderMode pixel extrapolation method (see #BorderTypes);\nborderMode=#BORDER_TRANSPARENT isn't supported\n@param borderValue value used in case of a constant border; by default, it is 0.\n\n@sa  warpPerspective, resize, remap, getRectSubPix, transform\n */\nGAPI_EXPORTS GMat warpAffine(const GMat& src, const Mat& M, const Size& dsize, int flags = cv::INTER_LINEAR,\n                             int borderMode = cv::BORDER_CONSTANT, const Scalar& borderValue = Scalar());\n//! @} gapi_transform\n\n/** @brief Finds centers of clusters and groups input samples around the clusters.\n\nThe function kmeans implements a k-means algorithm that finds the centers of K clusters\nand groups the input samples around the clusters. As an output, \\f$\\texttt{bestLabels}_i\\f$\ncontains a 0-based cluster index for the \\f$i^{th}\\f$ sample.\n\n@note\n - Function textual ID is \"org.opencv.core.kmeansND\"\n - In case of an N-dimentional points' set given, input GMat can have the following traits:\n2 dimensions, a single row or column if there are N channels,\nor N columns if there is a single channel. Mat should have @ref CV_32F depth.\n - Although, if GMat with height != 1, width != 1, channels != 1 given as data, n-dimensional\nsamples are considered given in amount of A, where A = height, n = width * channels.\n - In case of GMat given as data:\n     - the output labels are returned as 1-channel GMat with sizes\nwidth = 1, height = A, where A is samples amount, or width = bestLabels.width,\nheight = bestLabels.height if bestLabels given;\n     - the cluster centers are returned as 1-channel GMat with sizes\nwidth = n, height = K, where n is samples' dimentionality and K is clusters' amount.\n - As one of possible usages, if you want to control the initial labels for each attempt\nby yourself, you can utilize just the core of the function. To do that, set the number\nof attempts to 1, initialize labels each time using a custom algorithm, pass them with the\n( flags = #KMEANS_USE_INITIAL_LABELS ) flag, and then choose the best (most-compact) clustering.\n\n@param data Data for clustering. An array of N-Dimensional points with float coordinates is needed.\nFunction can take GArray<Point2f>, GArray<Point3f> for 2D and 3D cases or GMat for any\ndimentionality and channels.\n@param K Number of clusters to split the set by.\n@param bestLabels Optional input integer array that can store the supposed initial cluster indices\nfor every sample. Used when ( flags = #KMEANS_USE_INITIAL_LABELS ) flag is set.\n@param criteria The algorithm termination criteria, that is, the maximum number of iterations\nand/or the desired accuracy. The accuracy is specified as criteria.epsilon. As soon as each of\nthe cluster centers moves by less than criteria.epsilon on some iteration, the algorithm stops.\n@param attempts Flag to specify the number of times the algorithm is executed using different\ninitial labellings. The algorithm returns the labels that yield the best compactness (see the first\nfunction return value).\n@param flags Flag that can take values of cv::KmeansFlags .\n\n@return\n - Compactness measure that is computed as\n\\f[\\sum _i  \\| \\texttt{samples} _i -  \\texttt{centers} _{ \\texttt{labels} _i} \\| ^2\\f]\nafter every attempt. The best (minimum) value is chosen and the corresponding labels and the\ncompactness value are returned by the function.\n - Integer array that stores the cluster indices for every sample.\n - Array of the cluster centers.\n*/\nGAPI_EXPORTS std::tuple<GOpaque<double>,GMat,GMat>\nkmeans(const GMat& data, const int K, const GMat& bestLabels,\n       const TermCriteria& criteria, const int attempts, const KmeansFlags flags);\n\n/** @overload\n@note\n - Function textual ID is \"org.opencv.core.kmeansNDNoInit\"\n - #KMEANS_USE_INITIAL_LABELS flag must not be set while using this overload.\n */\nGAPI_EXPORTS_W std::tuple<GOpaque<double>,GMat,GMat>\nkmeans(const GMat& data, const int K, const TermCriteria& criteria, const int attempts,\n       const KmeansFlags flags);\n\n/** @overload\n@note Function textual ID is \"org.opencv.core.kmeans2D\"\n */\nGAPI_EXPORTS_W std::tuple<GOpaque<double>,GArray<int>,GArray<Point2f>>\nkmeans(const GArray<Point2f>& data, const int K, const GArray<int>& bestLabels,\n       const TermCriteria& criteria, const int attempts, const KmeansFlags flags);\n\n/** @overload\n@note Function textual ID is \"org.opencv.core.kmeans3D\"\n */\nGAPI_EXPORTS std::tuple<GOpaque<double>,GArray<int>,GArray<Point3f>>\nkmeans(const GArray<Point3f>& data, const int K, const GArray<int>& bestLabels,\n       const TermCriteria& criteria, const int attempts, const KmeansFlags flags);\n\n\n/** @brief Transposes a matrix.\n\nThe function transposes the matrix:\n\\f[\\texttt{dst} (i,j) =  \\texttt{src} (j,i)\\f]\n\n@note\n - Function textual ID is \"org.opencv.core.transpose\"\n - No complex conjugation is done in case of a complex matrix. It should be done separately if needed.\n\n@param src input array.\n*/\nGAPI_EXPORTS GMat transpose(const GMat& src);\n\n\nnamespace streaming {\n/** @brief Gets dimensions from Mat.\n\n@note Function textual ID is \"org.opencv.streaming.size\"\n\n@param src Input tensor\n@return Size (tensor dimensions).\n*/\nGAPI_EXPORTS_W GOpaque<Size> size(const GMat& src);\n\n/** @overload\nGets dimensions from rectangle.\n\n@note Function textual ID is \"org.opencv.streaming.sizeR\"\n\n@param r Input rectangle.\n@return Size (rectangle dimensions).\n*/\nGAPI_EXPORTS_W GOpaque<Size> size(const GOpaque<Rect>& r);\n\n/** @brief Gets dimensions from MediaFrame.\n\n@note Function textual ID is \"org.opencv.streaming.sizeMF\"\n\n@param src Input frame\n@return Size (frame dimensions).\n*/\nGAPI_EXPORTS GOpaque<Size> size(const GFrame& src);\n} //namespace streaming\n} //namespace gapi\n} //namespace cv\n\n#endif //OPENCV_GAPI_CORE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/cpu/core.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_CPU_CORE_API_HPP\n#define OPENCV_GAPI_CPU_CORE_API_HPP\n\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n#include <opencv2/gapi/own/exports.hpp> // GAPI_EXPORTS\n\nnamespace cv {\nnamespace gapi {\nnamespace core {\nnamespace cpu {\n\nGAPI_EXPORTS_W cv::gapi::GKernelPackage kernels();\n\n} // namespace cpu\n} // namespace core\n} // namespace gapi\n} // namespace cv\n\n\n#endif // OPENCV_GAPI_CPU_CORE_API_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/cpu/gcpukernel.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GCPUKERNEL_HPP\n#define OPENCV_GAPI_GCPUKERNEL_HPP\n\n#include <functional>\n#include <unordered_map>\n#include <utility>\n#include <vector>\n\n#include <opencv2/core/mat.hpp>\n#include <opencv2/gapi/gcommon.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n#include <opencv2/gapi/garg.hpp>\n#include <opencv2/gapi/gmetaarg.hpp>\n#include <opencv2/gapi/util/compiler_hints.hpp> //suppress_unused_warning\n#include <opencv2/gapi/util/util.hpp>\n\n// FIXME: namespace scheme for backends?\nnamespace cv {\n\nnamespace gimpl\n{\n    // Forward-declare an internal class\n    class GCPUExecutable;\n\n    namespace render\n    {\n    namespace ocv\n    {\n        class GRenderExecutable;\n    }\n    }\n} // namespace gimpl\n\nnamespace gapi\n{\n/**\n * @brief This namespace contains G-API CPU backend functions,\n * structures, and symbols.\n */\nnamespace cpu\n{\n    /**\n     * \\addtogroup gapi_std_backends\n     * @{\n     *\n     * @brief G-API backends available in this OpenCV version\n     *\n     * G-API backends play a corner stone role in G-API execution\n     * stack. Every backend is hardware-oriented and thus can run its\n     * kernels efficiently on the target platform.\n     *\n     * Backends are usually \"black boxes\" for G-API users -- on the API\n     * side, all backends are represented as different objects of the\n     * same class cv::gapi::GBackend.\n     * User can manipulate with backends by specifying which kernels to use.\n     *\n     * @sa @ref gapi_hld\n     */\n\n    /**\n     * @brief Get a reference to CPU (OpenCV) backend.\n     *\n     * This is the default backend in G-API at the moment, providing\n     * broader functional coverage but losing some graph model\n     * advantages. Provided mostly for reference and prototyping\n     * purposes.\n     *\n     * @sa gapi_std_backends\n     */\n    GAPI_EXPORTS cv::gapi::GBackend backend();\n    /** @} */\n\n    class GOCVFunctor;\n\n    //! @cond IGNORED\n    template<typename K, typename Callable>\n    GOCVFunctor ocv_kernel(const Callable& c);\n\n    template<typename K, typename Callable>\n    GOCVFunctor ocv_kernel(Callable& c);\n    //! @endcond\n\n} // namespace cpu\n} // namespace gapi\n\n// Represents arguments which are passed to a wrapped CPU function\n// FIXME: put into detail?\nclass GAPI_EXPORTS GCPUContext\n{\npublic:\n    // Generic accessor API\n    template<typename T>\n    const T& inArg(int input) { return m_args.at(input).get<T>(); }\n\n    // Syntax sugar\n    const cv::Mat&   inMat(int input);\n    cv::Mat&         outMatR(int output); // FIXME: Avoid cv::Mat m = ctx.outMatR()\n\n    const cv::Scalar& inVal(int input);\n    cv::Scalar& outValR(int output); // FIXME: Avoid cv::Scalar s = ctx.outValR()\n    cv::MediaFrame& outFrame(int output);\n    template<typename T> std::vector<T>& outVecR(int output) // FIXME: the same issue\n    {\n        return outVecRef(output).wref<T>();\n    }\n    template<typename T> T& outOpaqueR(int output) // FIXME: the same issue\n    {\n        return outOpaqueRef(output).wref<T>();\n    }\n\n    GArg state()\n    {\n        return m_state;\n    }\n\nprotected:\n    detail::VectorRef& outVecRef(int output);\n    detail::OpaqueRef& outOpaqueRef(int output);\n\n    std::vector<GArg> m_args;\n    GArg m_state;\n\n    //FIXME: avoid conversion of arguments from internal representation to OpenCV one on each call\n    //to OCV kernel. (This can be achieved by a two single time conversions in GCPUExecutable::run,\n    //once on enter for input and output arguments, and once before return for output arguments only\n    std::unordered_map<std::size_t, GRunArgP> m_results;\n\n    friend class gimpl::GCPUExecutable;\n    friend class gimpl::render::ocv::GRenderExecutable;\n};\n\nclass GAPI_EXPORTS GCPUKernel\n{\npublic:\n    // This function is a kernel's execution entry point (does the processing work)\n    using RunF = std::function<void(GCPUContext &)>;\n    // This function is a stateful kernel's setup routine (configures state)\n    using SetupF = std::function<void(const GMetaArgs &, const GArgs &,\n                                      GArg &, const GCompileArgs &)>;\n\n    GCPUKernel();\n    GCPUKernel(const RunF& runF, const SetupF& setupF = nullptr);\n\n    RunF m_runF = nullptr;\n    SetupF m_setupF = nullptr;\n\n    bool m_isStateful = false;\n};\n\n// FIXME: This is an ugly ad-hoc implementation. TODO: refactor\n\nnamespace detail\n{\ntemplate<class T> struct get_in;\ntemplate<> struct get_in<cv::GMat>\n{\n    static cv::Mat    get(GCPUContext &ctx, int idx) { return ctx.inMat(idx); }\n};\ntemplate<> struct get_in<cv::GMatP>\n{\n    static cv::Mat    get(GCPUContext &ctx, int idx) { return get_in<cv::GMat>::get(ctx, idx); }\n};\ntemplate<> struct get_in<cv::GFrame>\n{\n    static cv::MediaFrame get(GCPUContext &ctx, int idx) { return ctx.inArg<cv::MediaFrame>(idx); }\n};\ntemplate<> struct get_in<cv::GScalar>\n{\n    static cv::Scalar get(GCPUContext &ctx, int idx) { return ctx.inVal(idx); }\n};\ntemplate<typename U> struct get_in<cv::GArray<U> >\n{\n    static const std::vector<U>& get(GCPUContext &ctx, int idx) { return ctx.inArg<VectorRef>(idx).rref<U>(); }\n};\ntemplate<typename U> struct get_in<cv::GOpaque<U> >\n{\n    static const U& get(GCPUContext &ctx, int idx) { return ctx.inArg<OpaqueRef>(idx).rref<U>(); }\n};\n\n//FIXME(dm): GArray<Mat>/GArray<GMat> conversion should be done more gracefully in the system\ntemplate<> struct get_in<cv::GArray<cv::GMat> >: public get_in<cv::GArray<cv::Mat> >\n{\n};\n\n//FIXME(dm): GArray<Scalar>/GArray<GScalar> conversion should be done more gracefully in the system\ntemplate<> struct get_in<cv::GArray<cv::GScalar> >: public get_in<cv::GArray<cv::Scalar> >\n{\n};\n\n// FIXME(dm): GArray<vector<U>>/GArray<GArray<U>> conversion should be done more gracefully in the system\ntemplate<typename U> struct get_in<cv::GArray<cv::GArray<U>> >: public get_in<cv::GArray<std::vector<U>> >\n{\n};\n\n//FIXME(dm): GOpaque<Mat>/GOpaque<GMat> conversion should be done more gracefully in the system\ntemplate<> struct get_in<cv::GOpaque<cv::GMat> >: public get_in<cv::GOpaque<cv::Mat> >\n{\n};\n\n//FIXME(dm): GOpaque<Scalar>/GOpaque<GScalar> conversion should be done more gracefully in the system\ntemplate<> struct get_in<cv::GOpaque<cv::GScalar> >: public get_in<cv::GOpaque<cv::Mat> >\n{\n};\n\ntemplate<class T> struct get_in\n{\n    static T get(GCPUContext &ctx, int idx) { return ctx.inArg<T>(idx); }\n};\n\nstruct tracked_cv_mat{\n    tracked_cv_mat(cv::Mat& m) : r{m}, original_data{m.data} {}\n    cv::Mat r;\n    uchar* original_data;\n\n    operator cv::Mat& (){ return r;}\n    void validate() const{\n        if (r.data != original_data)\n        {\n            util::throw_error\n                (std::logic_error\n                 (\"OpenCV kernel output parameter was reallocated. \\n\"\n                  \"Incorrect meta data was provided ?\"));\n        }\n    }\n};\n\ntemplate<typename... Outputs>\nvoid postprocess(Outputs&... outs)\n{\n    struct\n    {\n        void operator()(tracked_cv_mat* bm) { bm->validate();  }\n        void operator()(...)                {                  }\n\n    } validate;\n    //dummy array to unfold parameter pack\n    int dummy[] = { 0, (validate(&outs), 0)... };\n    cv::util::suppress_unused_warning(dummy);\n}\n\ntemplate<class T> struct get_out;\ntemplate<> struct get_out<cv::GMat>\n{\n    static tracked_cv_mat get(GCPUContext &ctx, int idx)\n    {\n        auto& r = ctx.outMatR(idx);\n        return {r};\n    }\n};\ntemplate<> struct get_out<cv::GMatP>\n{\n    static tracked_cv_mat get(GCPUContext &ctx, int idx)\n    {\n        return get_out<cv::GMat>::get(ctx, idx);\n    }\n};\ntemplate<> struct get_out<cv::GScalar>\n{\n    static cv::Scalar& get(GCPUContext &ctx, int idx)\n    {\n        return ctx.outValR(idx);\n    }\n};\ntemplate<> struct get_out<cv::GFrame>\n{\n    static cv::MediaFrame& get(GCPUContext &ctx, int idx)\n    {\n        return ctx.outFrame(idx);\n    }\n};\ntemplate<typename U> struct get_out<cv::GArray<U>>\n{\n    static std::vector<U>& get(GCPUContext &ctx, int idx)\n    {\n        return ctx.outVecR<U>(idx);\n    }\n};\n\n//FIXME(dm): GArray<Mat>/GArray<GMat> conversion should be done more gracefully in the system\ntemplate<> struct get_out<cv::GArray<cv::GMat> >: public get_out<cv::GArray<cv::Mat> >\n{\n};\n\n// FIXME(dm): GArray<vector<U>>/GArray<GArray<U>> conversion should be done more gracefully in the system\ntemplate<typename U> struct get_out<cv::GArray<cv::GArray<U>> >: public get_out<cv::GArray<std::vector<U>> >\n{\n};\n\ntemplate<typename U> struct get_out<cv::GOpaque<U>>\n{\n    static U& get(GCPUContext &ctx, int idx)\n    {\n        return ctx.outOpaqueR<U>(idx);\n    }\n};\n\ntemplate<typename, typename>\nstruct OCVSetupHelper;\n\ntemplate<typename Impl, typename... Ins>\nstruct OCVSetupHelper<Impl, std::tuple<Ins...>>\n{\n    // Using 'auto' return type and 'decltype' specifier in both 'setup_impl' versions\n    // to check existence of required 'Impl::setup' functions.\n    // While 'decltype' specifier accepts expression we pass expression with 'comma-operator'\n    // where first operand of comma-operator is call attempt to desired 'Impl::setup' and\n    // the second operand is 'void()' expression.\n    //\n    // SFINAE for 'Impl::setup' which accepts compile arguments.\n    template<int... IIs>\n    static auto setup_impl(const GMetaArgs &metaArgs, const GArgs &args,\n                           GArg &state, const GCompileArgs &compileArgs,\n                           detail::Seq<IIs...>) ->\n        decltype(Impl::setup(detail::get_in_meta<Ins>(metaArgs, args, IIs)...,\n                             std::declval<typename std::add_lvalue_reference<\n                                              std::shared_ptr<typename Impl::State>\n                                                                            >::type\n                                         >(),\n                            compileArgs)\n                 , void())\n    {\n        // TODO: unique_ptr <-> shared_ptr conversion ?\n        // To check: Conversion is possible only if the state which should be passed to\n        // 'setup' user callback isn't required to have previous value\n        std::shared_ptr<typename Impl::State> stPtr;\n        Impl::setup(detail::get_in_meta<Ins>(metaArgs, args, IIs)..., stPtr, compileArgs);\n        state = GArg(stPtr);\n    }\n\n    // SFINAE for 'Impl::setup' which doesn't accept compile arguments.\n    template<int... IIs>\n    static auto setup_impl(const GMetaArgs &metaArgs, const GArgs &args,\n                           GArg &state, const GCompileArgs &/* compileArgs */,\n                           detail::Seq<IIs...>) ->\n        decltype(Impl::setup(detail::get_in_meta<Ins>(metaArgs, args, IIs)...,\n                             std::declval<typename std::add_lvalue_reference<\n                                              std::shared_ptr<typename Impl::State>\n                                                                            >::type\n                                         >()\n                            )\n                 , void())\n    {\n        // The same comment as in 'setup' above.\n        std::shared_ptr<typename Impl::State> stPtr;\n        Impl::setup(detail::get_in_meta<Ins>(metaArgs, args, IIs)..., stPtr);\n        state = GArg(stPtr);\n    }\n\n    static void setup(const GMetaArgs &metaArgs, const GArgs &args,\n                      GArg& state, const GCompileArgs &compileArgs)\n    {\n        setup_impl(metaArgs, args, state, compileArgs,\n                   typename detail::MkSeq<sizeof...(Ins)>::type());\n    }\n};\n\n// OCVCallHelper is a helper class to call stateless OCV kernels and OCV kernel functors.\ntemplate<typename, typename, typename>\nstruct OCVCallHelper;\n\n// FIXME: probably can be simplified with std::apply or analogue.\ntemplate<typename Impl, typename... Ins, typename... Outs>\nstruct OCVCallHelper<Impl, std::tuple<Ins...>, std::tuple<Outs...>>\n{\n    template<typename... Inputs>\n    struct call_and_postprocess\n    {\n        template<typename... Outputs>\n        static void call(Inputs&&... ins, Outputs&&... outs)\n        {\n            //not using a std::forward on outs is deliberate in order to\n            //cause compilation error, by trying to bind rvalue references to lvalue references\n            Impl::run(std::forward<Inputs>(ins)..., outs...);\n            postprocess(outs...);\n        }\n\n        template<typename... Outputs>\n        static void call(Impl& impl, Inputs&&... ins, Outputs&&... outs)\n        {\n            impl(std::forward<Inputs>(ins)..., outs...);\n        }\n    };\n\n    template<int... IIs, int... OIs>\n    static void call_impl(GCPUContext &ctx, detail::Seq<IIs...>, detail::Seq<OIs...>)\n    {\n        //Make sure that OpenCV kernels do not reallocate memory for output parameters\n        //by comparing it's state (data ptr) before and after the call.\n        //This is done by converting each output Mat into tracked_cv_mat object, and binding\n        //them to parameters of ad-hoc function\n        call_and_postprocess<decltype(get_in<Ins>::get(ctx, IIs))...>\n            ::call(get_in<Ins>::get(ctx, IIs)..., get_out<Outs>::get(ctx, OIs)...);\n    }\n\n    template<int... IIs, int... OIs>\n    static void call_impl(cv::GCPUContext &ctx, Impl& impl,\n                          detail::Seq<IIs...>, detail::Seq<OIs...>)\n    {\n        call_and_postprocess<decltype(get_in<Ins>::get(ctx, IIs))...>\n            ::call(impl, get_in<Ins>::get(ctx, IIs)..., get_out<Outs>::get(ctx, OIs)...);\n    }\n\n    static void call(GCPUContext &ctx)\n    {\n        call_impl(ctx,\n                  typename detail::MkSeq<sizeof...(Ins)>::type(),\n                  typename detail::MkSeq<sizeof...(Outs)>::type());\n    }\n\n    // NB: Same as call but calling the object\n    // This necessary for kernel implementations that have a state\n    // and are represented as an object\n    static void callFunctor(cv::GCPUContext &ctx, Impl& impl)\n    {\n        call_impl(ctx, impl,\n                  typename detail::MkSeq<sizeof...(Ins)>::type(),\n                  typename detail::MkSeq<sizeof...(Outs)>::type());\n    }\n};\n\n// OCVStCallHelper is a helper class to call stateful OCV kernels.\ntemplate<typename, typename, typename>\nstruct OCVStCallHelper;\n\ntemplate<typename Impl, typename... Ins, typename... Outs>\nstruct OCVStCallHelper<Impl, std::tuple<Ins...>, std::tuple<Outs...>> :\n    OCVCallHelper<Impl, std::tuple<Ins...>, std::tuple<Outs...>>\n{\n    template<typename... Inputs>\n    struct call_and_postprocess\n    {\n        template<typename... Outputs>\n        static void call(typename Impl::State& st, Inputs&&... ins, Outputs&&... outs)\n        {\n            Impl::run(std::forward<Inputs>(ins)..., outs..., st);\n            postprocess(outs...);\n        }\n    };\n\n    template<int... IIs, int... OIs>\n    static void call_impl(GCPUContext &ctx, detail::Seq<IIs...>, detail::Seq<OIs...>)\n    {\n        auto& st = *ctx.state().get<std::shared_ptr<typename Impl::State>>();\n        call_and_postprocess<decltype(get_in<Ins>::get(ctx, IIs))...>\n            ::call(st, get_in<Ins>::get(ctx, IIs)..., get_out<Outs>::get(ctx, OIs)...);\n    }\n\n    static void call(GCPUContext &ctx)\n    {\n        call_impl(ctx,\n                  typename detail::MkSeq<sizeof...(Ins)>::type(),\n                  typename detail::MkSeq<sizeof...(Outs)>::type());\n    }\n};\n\n} // namespace detail\n\ntemplate<class Impl, class K>\nclass GCPUKernelImpl: public cv::detail::KernelTag\n{\n    using CallHelper = cv::detail::OCVCallHelper<Impl, typename K::InArgs, typename K::OutArgs>;\n\npublic:\n    using API = K;\n\n    static cv::gapi::GBackend backend() { return cv::gapi::cpu::backend(); }\n    static cv::GCPUKernel      kernel() { return GCPUKernel(&CallHelper::call); }\n};\n\ntemplate<class Impl, class K, class S>\nclass GCPUStKernelImpl: public cv::detail::KernelTag\n{\n    using StSetupHelper = detail::OCVSetupHelper<Impl, typename K::InArgs>;\n    using StCallHelper  = detail::OCVStCallHelper<Impl, typename K::InArgs, typename K::OutArgs>;\n\npublic:\n    using API = K;\n    using State = S;\n\n    static cv::gapi::GBackend backend() { return cv::gapi::cpu::backend(); }\n    static cv::GCPUKernel     kernel()  { return GCPUKernel(&StCallHelper::call,\n                                                            &StSetupHelper::setup); }\n};\n\n#define GAPI_OCV_KERNEL(Name, API) struct Name: public cv::GCPUKernelImpl<Name, API>\n\n// TODO: Reuse Anatoliy's logic for support of types with commas in macro.\n//       Retrieve the common part from Anatoliy's logic to the separate place.\n#define GAPI_OCV_KERNEL_ST(Name, API, State)                   \\\n    struct Name: public cv::GCPUStKernelImpl<Name, API, State> \\\n\n/// @private\nclass gapi::cpu::GOCVFunctor : public gapi::GFunctor\n{\npublic:\n    using Impl = std::function<void(GCPUContext &)>;\n    using Meta = cv::GKernel::M;\n\n    GOCVFunctor(const char* id, const Meta &meta, const Impl& impl)\n        : gapi::GFunctor(id), impl_{GCPUKernel(impl), meta}\n    {\n    }\n\n    GKernelImpl    impl()    const override { return impl_;                }\n    gapi::GBackend backend() const override { return gapi::cpu::backend(); }\n\nprivate:\n    GKernelImpl impl_;\n};\n\n//! @cond IGNORED\ntemplate<typename K, typename Callable>\ngapi::cpu::GOCVFunctor gapi::cpu::ocv_kernel(Callable& c)\n{\n    using P = cv::detail::OCVCallHelper<Callable, typename K::InArgs, typename K::OutArgs>;\n    return GOCVFunctor{ K::id()\n                      , &K::getOutMeta\n                      , std::bind(&P::callFunctor, std::placeholders::_1, std::ref(c))\n                      };\n}\n\ntemplate<typename K, typename Callable>\ngapi::cpu::GOCVFunctor gapi::cpu::ocv_kernel(const Callable& c)\n{\n    using P = cv::detail::OCVCallHelper<Callable, typename K::InArgs, typename K::OutArgs>;\n    return GOCVFunctor{ K::id()\n                      , &K::getOutMeta\n                      , std::bind(&P::callFunctor, std::placeholders::_1, c)\n                      };\n}\n//! @endcond\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GCPUKERNEL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/cpu/imgproc.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_CPU_IMGPROC_API_HPP\n#define OPENCV_GAPI_CPU_IMGPROC_API_HPP\n\n#include <opencv2/core/cvdef.h>     // GAPI_EXPORTS\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n\nnamespace cv {\nnamespace gapi {\nnamespace imgproc {\nnamespace cpu {\n\nGAPI_EXPORTS GKernelPackage kernels();\n\n} // namespace cpu\n} // namespace imgproc\n} // namespace gapi\n} // namespace cv\n\n\n#endif // OPENCV_GAPI_CPU_IMGPROC_API_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/cpu/stereo.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2021 Intel Corporation\n\n#ifndef OPENCV_GAPI_CPU_STEREO_API_HPP\n#define OPENCV_GAPI_CPU_STEREO_API_HPP\n\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n\nnamespace cv {\nnamespace gapi {\nnamespace calib3d {\nnamespace cpu {\n\nGAPI_EXPORTS GKernelPackage kernels();\n\n/** @brief Structure for the Stereo operation initialization parameters.*/\nstruct GAPI_EXPORTS StereoInitParam {\n    StereoInitParam(int nD, int bS, double bL, double f):\n        numDisparities(nD), blockSize(bS), baseline(bL), focus(f) {}\n\n    StereoInitParam() = default;\n\n    int numDisparities = 0;\n    int blockSize = 21;\n    double baseline = 63.5;\n    double focus = 3.6;\n};\n\n} // namespace cpu\n} // namespace calib3d\n} // namespace gapi\n\nnamespace detail {\n\n    template<> struct CompileArgTag<cv::gapi::calib3d::cpu::StereoInitParam> {\n    static const char* tag() {\n        return \"org.opencv.stereoInit\";\n    }\n};\n\n} // namespace detail\n} // namespace cv\n\n\n#endif // OPENCV_GAPI_CPU_STEREO_API_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/cpu/video.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n#ifndef OPENCV_GAPI_CPU_VIDEO_API_HPP\n#define OPENCV_GAPI_CPU_VIDEO_API_HPP\n\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n\nnamespace cv {\nnamespace gapi {\nnamespace video {\nnamespace cpu {\n\nGAPI_EXPORTS GKernelPackage kernels();\n\n} // namespace cpu\n} // namespace video\n} // namespace gapi\n} // namespace cv\n\n\n#endif // OPENCV_GAPI_CPU_VIDEO_API_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/fluid/core.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_FLUID_CORE_HPP\n#define OPENCV_GAPI_FLUID_CORE_HPP\n\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n#include <opencv2/gapi/own/exports.hpp> // GAPI_EXPORTS\n\nnamespace cv { namespace gapi { namespace core { namespace fluid {\n\nGAPI_EXPORTS_W cv::gapi::GKernelPackage kernels();\n\n}}}}\n\n#endif // OPENCV_GAPI_FLUID_CORE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/fluid/gfluidbuffer.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_FLUID_BUFFER_HPP\n#define OPENCV_GAPI_FLUID_BUFFER_HPP\n\n#include <list>\n#include <numeric> // accumulate\n#include <ostream> // ostream\n#include <cstdint> // uint8_t\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/gmat.hpp>\n\n#include <opencv2/gapi/util/optional.hpp>\n\nnamespace cv {\nnamespace gapi {\nnamespace fluid {\n\nstruct Border\n{\n    // This constructor is required to support existing kernels which are part of G-API\n    Border(int _type, cv::Scalar _val) : type(_type), value(_val) {};\n\n    int type;\n    cv::Scalar value;\n};\n\nusing BorderOpt = util::optional<Border>;\n\nbool operator == (const Border& b1, const Border& b2);\n\nclass GAPI_EXPORTS Buffer;\n\nclass GAPI_EXPORTS View\n{\npublic:\n    struct Cache\n    {\n        std::vector<const uint8_t*> m_linePtrs;\n        GMatDesc m_desc;\n        int m_border_size = 0;\n\n        inline const uint8_t* linePtr(int index) const\n        {\n            // \"out_of_window\" check:\n            // user must not request the lines which are outside of specified kernel window\n            GAPI_DbgAssert(index >= -m_border_size\n                        && index <  -m_border_size + static_cast<int>(m_linePtrs.size()));\n            return m_linePtrs[index + m_border_size];\n        }\n    };\n\n    const inline uint8_t* InLineB(int index) const // -(w-1)/2...0...+(w-1)/2 for Filters\n    {\n        return m_cache->linePtr(index);\n    }\n\n    template<typename T> const inline T* InLine(int i) const\n    {\n        const uint8_t* ptr = this->InLineB(i);\n        return reinterpret_cast<const T*>(ptr);\n    }\n\n    inline operator bool() const { return m_priv != nullptr; }\n    bool ready() const;\n    inline int length() const { return m_cache->m_desc.size.width; }\n    int y() const;\n\n    inline const GMatDesc& meta() const { return m_cache->m_desc; }\n\n    class GAPI_EXPORTS Priv;      // internal use only\n    Priv& priv();               // internal use only\n    const Priv& priv() const;   // internal use only\n\n    View();\n    View(std::unique_ptr<Priv>&& p);\n    View(View&& v);\n    View& operator=(View&& v);\n    ~View();\n\nprivate:\n    std::unique_ptr<Priv> m_priv;\n    const Cache* m_cache = nullptr;\n};\n\nclass GAPI_EXPORTS Buffer\n{\npublic:\n    struct Cache\n    {\n        std::vector<uint8_t*> m_linePtrs;\n        GMatDesc m_desc;\n    };\n\n    // Default constructor (executable creation stage,\n    // all following initialization performed in Priv::init())\n    Buffer();\n    // Scratch constructor (user kernels)\n    Buffer(const cv::GMatDesc &desc);\n\n    // Constructor for intermediate buffers (for tests)\n    Buffer(const cv::GMatDesc &desc,\n           int max_line_consumption, int border_size,\n           int skew,\n           int wlpi,\n           BorderOpt border);\n    // Constructor for in/out buffers (for tests)\n    Buffer(const cv::Mat &data, bool is_input);\n    ~Buffer();\n    Buffer& operator=(Buffer&&);\n\n    inline uint8_t* OutLineB(int index = 0)\n    {\n        return m_cache->m_linePtrs[index];\n    }\n\n    template<typename T> inline T* OutLine(int index = 0)\n    {\n        uint8_t* ptr = this->OutLineB(index);\n        return reinterpret_cast<T*>(ptr);\n    }\n\n    int y() const;\n\n    int linesReady() const;\n    void debug(std::ostream &os) const;\n    inline int length() const { return m_cache->m_desc.size.width; }\n    int lpi() const;  // LPI for WRITER\n\n    inline const GMatDesc& meta() const { return m_cache->m_desc; }\n\n    View mkView(int borderSize, bool ownStorage);\n    void addView(const View* v);\n\n    class GAPI_EXPORTS Priv;      // internal use only\n    Priv& priv();               // internal use only\n    const Priv& priv() const;   // internal use only\n\nprivate:\n    std::unique_ptr<Priv> m_priv;\n    const Cache* m_cache;\n};\n\n} // namespace cv::gapi::fluid\n} // namespace cv::gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_FLUID_BUFFER_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/fluid/gfluidkernel.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2019 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_FLUID_KERNEL_HPP\n#define OPENCV_GAPI_FLUID_KERNEL_HPP\n\n#include <vector>\n#include <functional>\n#include <map>\n#include <unordered_map>\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/gcommon.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n#include <opencv2/gapi/garg.hpp>\n\n#include <opencv2/gapi/fluid/gfluidbuffer.hpp>\n\n// FIXME: namespace scheme for backends?\nnamespace cv {\n\nnamespace gapi\n{\n/**\n * @brief This namespace contains G-API Fluid backend functions, structures, and symbols.\n */\nnamespace fluid\n{\n    /**\n     * \\addtogroup gapi_std_backends G-API Standard Backends\n     * @{\n     */\n    /**\n     * @brief Get a reference to Fluid backend.\n     *\n     * @sa gapi_std_backends\n     */\n    GAPI_EXPORTS cv::gapi::GBackend backend();\n    /** @} */\n} // namespace fluid\n} // namespace gapi\n\n\nclass GAPI_EXPORTS GFluidKernel\n{\npublic:\n    enum class Kind\n    {\n        Filter,\n        Resize,\n        YUV420toRGB //Color conversion of 4:2:0 chroma sub-sampling formats (NV12, I420 ..etc) to RGB\n    };\n\n    // This function is a generic \"doWork\" callback\n    using F = std::function<void(const cv::GArgs&, const std::vector<gapi::fluid::Buffer*> &)>;\n\n    // This function is a generic \"initScratch\" callback\n    using IS = std::function<void(const cv::GMetaArgs &, const cv::GArgs&, gapi::fluid::Buffer &)>;\n\n    // This function is a generic \"resetScratch\" callback\n    using RS = std::function<void(gapi::fluid::Buffer &)>;\n\n    // This function describes kernel metadata inference rule.\n    using M = std::function<GMetaArgs(const GMetaArgs &, const GArgs &)>;\n\n    // This function is a generic \"getBorder\" callback (extracts border-related data from kernel's input parameters)\n    using B = std::function<gapi::fluid::BorderOpt(const GMetaArgs&, const GArgs&)>;\n\n    // This function is a generic \"getWindow\" callback (extracts window-related data from kernel's input parameters)\n    using GW = std::function<int(const GMetaArgs&, const GArgs&)>;\n\n    // FIXME: move implementations out of header file\n    GFluidKernel() {}\n    GFluidKernel(Kind k, int l, bool scratch, const F& f, const IS &is, const RS &rs, const B& b, const GW& win)\n        : m_kind(k)\n        , m_lpi(l)\n        , m_scratch(scratch)\n        , m_f(f)\n        , m_is(is)\n        , m_rs(rs)\n        , m_b(b)\n        , m_gw(win) {}\n\n    Kind m_kind;\n    const int  m_lpi     = -1;\n    const bool m_scratch = false;\n\n    const F    m_f;\n    const IS   m_is;\n    const RS   m_rs;\n    const B    m_b;\n    const GW   m_gw;\n};\n\n// FIXME!!!\n// This is the temporary and experimental API\n// which should be replaced by runtime roi-based scheduling\n/** \\addtogroup gapi_compile_args\n * @{\n */\n/**\n * @brief This structure allows to control the output image region\n * which Fluid backend will produce in the graph.\n *\n * This feature is useful for external tiling and parallelism, but\n * will be deprecated in the future releases.\n */\nstruct GFluidOutputRois\n{\n    std::vector<cv::Rect> rois;\n};\n\n/**\n * @brief This structure forces Fluid backend to generate multiple\n * parallel output regions in the graph. These regions execute in parallel.\n *\n * This feature may be deprecated in the future releases.\n */\nstruct GFluidParallelOutputRois\n{\n    std::vector<GFluidOutputRois> parallel_rois;\n};\n\n/**\n * @brief This structure allows to customize the way how Fluid executes\n * parallel regions.\n *\n * For example, user can utilize his own threading runtime via this parameter.\n * The `parallel_for` member functor is called by the Fluid runtime with the\n * following arguments:\n *\n * @param size Size of the parallel range to process\n * @param f A function which should be called for every integer index\n *   in this range by the specified parallel_for implementation.\n *\n * This feature may be deprecated in the future releases.\n */\nstruct GFluidParallelFor\n{\n    //this function accepts:\n    // - size of the \"parallel\" range as the first argument\n    // - and a function to be called on the range items, designated by item index\n    std::function<void(std::size_t size, std::function<void(std::size_t index)>)> parallel_for;\n};\n/** @} gapi_compile_args */\n\nnamespace detail\n{\ntemplate<> struct CompileArgTag<GFluidOutputRois>\n{\n    static const char* tag() { return \"gapi.fluid.outputRois\"; }\n};\n\ntemplate<> struct CompileArgTag<GFluidParallelFor>\n{\n    static const char* tag() { return \"gapi.fluid.parallelFor\"; }\n};\n\ntemplate<> struct CompileArgTag<GFluidParallelOutputRois>\n{\n    static const char* tag() { return \"gapi.fluid.parallelOutputRois\"; }\n};\n\n} // namespace detail\n\nnamespace detail\n{\ntemplate<class T> struct fluid_get_in;\ntemplate<> struct fluid_get_in<cv::GMat>\n{\n    static const cv::gapi::fluid::View& get(const cv::GArgs &in_args, int idx)\n    {\n        return *in_args[idx].unsafe_get<cv::gapi::fluid::View*>();\n    }\n};\n\ntemplate<> struct fluid_get_in<cv::GScalar>\n{\n    // FIXME: change to return by reference when moved to own::Scalar\n    static const cv::Scalar get(const cv::GArgs &in_args, int idx)\n    {\n        return in_args[idx].unsafe_get<cv::Scalar>();\n    }\n};\n\ntemplate<typename U> struct fluid_get_in<cv::GArray<U>>\n{\n    static const std::vector<U>& get(const cv::GArgs &in_args, int idx)\n    {\n        return in_args.at(idx).unsafe_get<cv::detail::VectorRef>().rref<U>();\n    }\n};\n\ntemplate<typename U> struct fluid_get_in<cv::GOpaque<U>>\n{\n    static const U& get(const cv::GArgs &in_args, int idx)\n    {\n        return in_args.at(idx).unsafe_get<cv::detail::OpaqueRef>().rref<U>();\n    }\n};\n\ntemplate<class T> struct fluid_get_in\n{\n    static const T& get(const cv::GArgs &in_args, int idx)\n    {\n        return in_args[idx].unsafe_get<T>();\n    }\n};\n\ntemplate<bool, typename Impl, typename... Ins>\nstruct scratch_helper;\n\ntemplate<typename Impl, typename... Ins>\nstruct scratch_helper<true, Impl, Ins...>\n{\n    // Init\n    template<int... IIs>\n    static void help_init_impl(const cv::GMetaArgs &metas,\n                               const cv::GArgs     &in_args,\n                               gapi::fluid::Buffer &scratch_buf,\n                               detail::Seq<IIs...>)\n    {\n        Impl::initScratch(get_in_meta<Ins>(metas, in_args, IIs)..., scratch_buf);\n    }\n\n    static void help_init(const cv::GMetaArgs &metas,\n                          const cv::GArgs     &in_args,\n                          gapi::fluid::Buffer &b)\n    {\n        help_init_impl(metas, in_args, b, typename detail::MkSeq<sizeof...(Ins)>::type());\n    }\n\n    // Reset\n    static void help_reset(gapi::fluid::Buffer &b)\n    {\n        Impl::resetScratch(b);\n    }\n};\n\ntemplate<typename Impl, typename... Ins>\nstruct scratch_helper<false, Impl, Ins...>\n{\n    static void help_init(const cv::GMetaArgs &,\n                          const cv::GArgs     &,\n                          gapi::fluid::Buffer &)\n    {\n        GAPI_Assert(false);\n    }\n    static void help_reset(gapi::fluid::Buffer &)\n    {\n        GAPI_Assert(false);\n    }\n};\n\ntemplate<typename T> struct is_gmat_type\n{\n    static const constexpr bool value = std::is_same<cv::GMat, T>::value;\n};\n\ntemplate<bool CallCustomGetBorder, typename Impl, typename... Ins>\nstruct get_border_helper;\n\ntemplate<typename Impl, typename... Ins>\nstruct get_border_helper<true, Impl, Ins...>\n{\n    template<int... IIs>\n    static gapi::fluid::BorderOpt get_border_impl(const GMetaArgs &metas,\n                                                  const cv::GArgs &in_args,\n                                                  cv::detail::Seq<IIs...>)\n    {\n        return util::make_optional(Impl::getBorder(cv::detail::get_in_meta<Ins>(metas, in_args, IIs)...));\n    }\n\n    static gapi::fluid::BorderOpt help(const GMetaArgs &metas,\n                                       const cv::GArgs &in_args)\n    {\n        return get_border_impl(metas, in_args, typename detail::MkSeq<sizeof...(Ins)>::type());\n    }\n};\n\ntemplate<typename Impl, typename... Ins>\nstruct get_border_helper<false, Impl, Ins...>\n{\n    static gapi::fluid::BorderOpt help(const cv::GMetaArgs &,\n                                       const cv::GArgs     &)\n    {\n        return {};\n    }\n};\n\ntemplate<bool CallCustomGetWindow, typename, typename... Ins>\nstruct get_window_helper;\n\ntemplate<typename Impl, typename... Ins>\nstruct get_window_helper<true, Impl, Ins...>\n{\n    template<int... IIs>\n    static int get_window_impl(const GMetaArgs &metas,\n                               const cv::GArgs &in_args,\n                               cv::detail::Seq<IIs...>)\n    {\n        return Impl::getWindow(cv::detail::get_in_meta<Ins>(metas, in_args, IIs)...);\n    }\n\n    static int help(const GMetaArgs &metas, const cv::GArgs &in_args)\n    {\n        return get_window_impl(metas, in_args, typename detail::MkSeq<sizeof...(Ins)>::type());\n    }\n};\n\ntemplate<typename Impl, typename... Ins>\nstruct get_window_helper<false, Impl, Ins...>\n{\n    static int help(const cv::GMetaArgs &,\n                    const cv::GArgs     &)\n    {\n        return Impl::Window;\n    }\n};\n\ntemplate<typename C, typename T>\nstruct has_Window\n{\nprivate:\n    template<class U>\n    static constexpr auto Check(U*) -> typename std::is_same<decltype(U::Window), T>::type;\n\n    template<typename>\n    static constexpr std::false_type Check(...);\n\n    typedef decltype(Check<C>(0)) Result;\n\npublic:\n    static constexpr bool value = Result::value;\n};\n\ntemplate<bool hasWindow, typename Impl>\nstruct callCustomGetBorder;\n\ntemplate<typename Impl>\nstruct callCustomGetBorder<true, Impl>\n{\n    static constexpr bool value = (Impl::Window != 1);\n};\n\ntemplate<typename Impl>\nstruct callCustomGetBorder<false, Impl>\n{\n    static constexpr bool value = true;\n};\n\ntemplate<typename, typename, typename, bool UseScratch>\nstruct FluidCallHelper;\n\ntemplate<typename Impl, typename... Ins, typename... Outs, bool UseScratch>\nstruct FluidCallHelper<Impl, std::tuple<Ins...>, std::tuple<Outs...>, UseScratch>\n{\n    static_assert(all_satisfy<is_gmat_type, Outs...>::value, \"return type must be GMat\");\n    static_assert(contains<GMat, Ins...>::value, \"input must contain at least one GMat\");\n\n    // Execution dispatcher ////////////////////////////////////////////////////\n    template<int... IIs, int... OIs>\n    static void call_impl(const cv::GArgs &in_args,\n                          const std::vector<gapi::fluid::Buffer*> &out_bufs,\n                          detail::Seq<IIs...>,\n                          detail::Seq<OIs...>)\n    {\n        Impl::run(fluid_get_in<Ins>::get(in_args, IIs)..., *out_bufs[OIs]...);\n    }\n\n    static void call(const cv::GArgs &in_args,\n                     const std::vector<gapi::fluid::Buffer*> &out_bufs)\n    {\n        constexpr int numOuts = (sizeof...(Outs)) + (UseScratch ? 1 : 0);\n        call_impl(in_args, out_bufs,\n                  typename detail::MkSeq<sizeof...(Ins)>::type(),\n                  typename detail::MkSeq<numOuts>::type());\n    }\n\n    // Scratch buffer initialization dispatcher ////////////////////////////////\n    static void init_scratch(const GMetaArgs &metas,\n                             const cv::GArgs &in_args,\n                             gapi::fluid::Buffer &b)\n    {\n        scratch_helper<UseScratch, Impl, Ins...>::help_init(metas, in_args, b);\n    }\n\n    // Scratch buffer reset dispatcher /////////////////////////////////////////\n    static void reset_scratch(gapi::fluid::Buffer &scratch_buf)\n    {\n        scratch_helper<UseScratch, Impl, Ins...>::help_reset(scratch_buf);\n    }\n\n    static gapi::fluid::BorderOpt getBorder(const GMetaArgs &metas, const cv::GArgs &in_args)\n    {\n        constexpr bool hasWindow = has_Window<Impl, const int>::value;\n\n        // User must provide \"init\" callback if Window != 1\n        // TODO: move to constexpr if when we enable C++17\n        return get_border_helper<callCustomGetBorder<hasWindow, Impl>::value, Impl, Ins...>::help(metas, in_args);\n    }\n\n    static int getWindow(const GMetaArgs &metas, const cv::GArgs &in_args)\n    {\n        constexpr bool callCustomGetWindow = !(has_Window<Impl, const int>::value);\n        return get_window_helper<callCustomGetWindow, Impl, Ins...>::help(metas, in_args);\n    }\n};\n} // namespace detail\n\n\ntemplate<class Impl, class K, bool UseScratch>\nclass GFluidKernelImpl : public cv::detail::KernelTag\n{\n    static const int LPI = 1;\n    static const auto Kind = GFluidKernel::Kind::Filter;\n    using P = detail::FluidCallHelper<Impl, typename K::InArgs, typename K::OutArgs, UseScratch>;\n\npublic:\n    using API = K;\n\n    static GFluidKernel kernel()\n    {\n        // FIXME: call() and getOutMeta() needs to be renamed so it is clear these\n        // functions are internal wrappers, not user API\n        return GFluidKernel(Impl::Kind, Impl::LPI,\n                            UseScratch,\n                            &P::call, &P::init_scratch, &P::reset_scratch, &P::getBorder, &P::getWindow);\n    }\n\n    static cv::gapi::GBackend backend() { return cv::gapi::fluid::backend(); }\n};\n\n#define GAPI_FLUID_KERNEL(Name, API, Scratch) struct Name: public cv::GFluidKernelImpl<Name, API, Scratch>\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GCPUKERNEL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/fluid/imgproc.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_FLUID_IMGPROC_HPP\n#define OPENCV_GAPI_FLUID_IMGPROC_HPP\n\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n#include <opencv2/gapi/own/exports.hpp> // GAPI_EXPORTS\n\nnamespace cv { namespace gapi { namespace imgproc { namespace fluid {\n\nGAPI_EXPORTS GKernelPackage kernels();\n\n}}}}\n\n#endif // OPENCV_GAPI_FLUID_IMGPROC_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/garg.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GARG_HPP\n#define OPENCV_GAPI_GARG_HPP\n\n#include <vector>\n#include <unordered_map>\n#include <type_traits>\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/own/mat.hpp>\n#include <opencv2/gapi/media.hpp>\n\n#include <opencv2/gapi/util/util.hpp>\n#include <opencv2/gapi/util/any.hpp>\n#include <opencv2/gapi/util/variant.hpp>\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/gscalar.hpp>\n#include <opencv2/gapi/garray.hpp>\n#include <opencv2/gapi/gopaque.hpp>\n#include <opencv2/gapi/gframe.hpp>\n#include <opencv2/gapi/gtype_traits.hpp>\n#include <opencv2/gapi/gmetaarg.hpp>\n#include <opencv2/gapi/streaming/source.hpp>\n#include <opencv2/gapi/rmat.hpp>\n\nnamespace cv {\n\nclass GArg;\n\nnamespace detail {\n    template<typename T>\n    using is_garg = std::is_same<GArg, typename std::decay<T>::type>;\n}\n\n// Parameter holder class for a node\n// Depending on platform capabilities, can either support arbitrary types\n// (as `boost::any`) or a limited number of types (as `boot::variant`).\n// FIXME: put into \"details\" as a user shouldn't use it in his code\nclass GAPI_EXPORTS GArg\n{\npublic:\n    GArg() {}\n\n    template<typename T, typename std::enable_if<!detail::is_garg<T>::value, int>::type = 0>\n    explicit GArg(const T &t)\n        : kind(detail::GTypeTraits<T>::kind)\n        , opaque_kind(detail::GOpaqueTraits<T>::kind)\n        , value(detail::wrap_gapi_helper<T>::wrap(t))\n    {\n    }\n\n    template<typename T, typename std::enable_if<!detail::is_garg<T>::value, int>::type = 0>\n    explicit GArg(T &&t)\n        : kind(detail::GTypeTraits<typename std::decay<T>::type>::kind)\n        , opaque_kind(detail::GOpaqueTraits<typename std::decay<T>::type>::kind)\n        , value(detail::wrap_gapi_helper<T>::wrap(t))\n    {\n    }\n\n    template<typename T> inline T& get()\n    {\n        return util::any_cast<typename std::remove_reference<T>::type>(value);\n    }\n\n    template<typename T> inline const T& get() const\n    {\n        return util::any_cast<typename std::remove_reference<T>::type>(value);\n    }\n\n    template<typename T> inline T& unsafe_get()\n    {\n        return util::unsafe_any_cast<typename std::remove_reference<T>::type>(value);\n    }\n\n    template<typename T> inline const T& unsafe_get() const\n    {\n        return util::unsafe_any_cast<typename std::remove_reference<T>::type>(value);\n    }\n\n    detail::ArgKind kind = detail::ArgKind::OPAQUE_VAL;\n    detail::OpaqueKind opaque_kind = detail::OpaqueKind::CV_UNKNOWN;\n\nprotected:\n    util::any value;\n};\n\nusing GArgs = std::vector<GArg>;\n\n// FIXME: Express as M<GProtoArg...>::type\n// FIXME: Move to a separate file!\nusing GRunArgBase  = util::variant<\n#if !defined(GAPI_STANDALONE)\n    cv::UMat,\n#endif // !defined(GAPI_STANDALONE)\n    cv::RMat,\n    cv::gapi::wip::IStreamSource::Ptr,\n    cv::Mat,\n    cv::Scalar,\n    cv::detail::VectorRef,\n    cv::detail::OpaqueRef,\n    cv::MediaFrame\n    >;\n\nnamespace detail {\ntemplate<typename,typename>\nstruct in_variant;\n\ntemplate<typename T, typename... Types>\nstruct in_variant<T, util::variant<Types...> >\n    : std::integral_constant<bool, cv::detail::contains<T, Types...>::value > {\n};\n} // namespace detail\n\nstruct GAPI_EXPORTS GRunArg: public GRunArgBase\n{\n    // Metadata information here\n    using Meta = std::unordered_map<std::string, util::any>;\n    Meta meta;\n\n    // Mimic the old GRunArg semantics here, old of the times when\n    // GRunArg was an alias to variant<>\n    GRunArg();\n    GRunArg(const cv::GRunArg &arg);\n    GRunArg(cv::GRunArg &&arg);\n\n    GRunArg& operator= (const GRunArg &arg);\n    GRunArg& operator= (GRunArg &&arg);\n\n    template <typename T>\n    GRunArg(const T &t,\n            const Meta &m = Meta{},\n            typename std::enable_if< detail::in_variant<T, GRunArgBase>::value, int>::type = 0)\n        : GRunArgBase(t)\n        , meta(m)\n    {\n    }\n    template <typename T>\n    GRunArg(T &&t,\n            const Meta &m = Meta{},\n            typename std::enable_if< detail::in_variant<T, GRunArgBase>::value, int>::type = 0)\n        : GRunArgBase(std::move(t))\n        , meta(m)\n    {\n    }\n    template <typename T> auto operator= (const T &t)\n        -> typename std::enable_if< detail::in_variant<T, GRunArgBase>::value, cv::GRunArg>::type&\n    {\n        GRunArgBase::operator=(t);\n        return *this;\n    }\n    template <typename T> auto operator= (T&& t)\n        -> typename std::enable_if< detail::in_variant<T, GRunArgBase>::value, cv::GRunArg>::type&\n    {\n        GRunArgBase::operator=(std::move(t));\n        return *this;\n    }\n};\nusing GRunArgs = std::vector<GRunArg>;\n\n// TODO: Think about the addition operator\n/**\n * @brief This operator allows to complement the input vector at runtime.\n *\n * It's an ordinary overload of addition assignment operator.\n *\n * Example of usage:\n * @snippet dynamic_graph.cpp GRunArgs usage\n *\n */\ninline GRunArgs& operator += (GRunArgs &lhs, const GRunArgs &rhs)\n{\n    lhs.reserve(lhs.size() + rhs.size());\n    lhs.insert(lhs.end(), rhs.begin(), rhs.end());\n    return lhs;\n}\n\nnamespace gapi\n{\nnamespace wip\n{\n/**\n * @brief This aggregate type represents all types which G-API can\n * handle (via variant).\n *\n * It only exists to overcome C++ language limitations (where a\n * `using`-defined class can't be forward-declared).\n */\nstruct GAPI_EXPORTS Data: public GRunArg\n{\n    using GRunArg::GRunArg;\n    template <typename T>\n    Data& operator= (const T& t) { GRunArg::operator=(t); return *this; }\n    template <typename T>\n    Data& operator= (T&& t) { GRunArg::operator=(std::move(t)); return *this; }\n};\n} // namespace wip\n} // namespace gapi\n\nusing GRunArgP = util::variant<\n#if !defined(GAPI_STANDALONE)\n    cv::UMat*,\n#endif // !defined(GAPI_STANDALONE)\n    cv::Mat*,\n    cv::RMat*,\n    cv::Scalar*,\n    cv::MediaFrame*,\n    cv::detail::VectorRef,\n    cv::detail::OpaqueRef\n    >;\nusing GRunArgsP = std::vector<GRunArgP>;\n\n// TODO: Think about the addition operator\n/**\n * @brief This operator allows to complement the output vector at runtime.\n *\n * It's an ordinary overload of addition assignment operator.\n *\n * Example of usage:\n * @snippet dynamic_graph.cpp GRunArgsP usage\n *\n */\ninline GRunArgsP& operator += (GRunArgsP &lhs, const GRunArgsP &rhs)\n{\n    lhs.reserve(lhs.size() + rhs.size());\n    lhs.insert(lhs.end(), rhs.begin(), rhs.end());\n    return lhs;\n}\n\nnamespace gapi\n{\n    GAPI_EXPORTS cv::GRunArgsP bind(cv::GRunArgs &results);\n    GAPI_EXPORTS cv::GRunArg   bind(cv::GRunArgP &out);     // FIXME: think more about it\n}\n\ntemplate<typename... Ts> inline GRunArgs gin(const Ts&... args)\n{\n    return GRunArgs{ GRunArg(detail::wrap_host_helper<Ts>::wrap_in(args))... };\n}\n\ntemplate<typename... Ts> inline GRunArgsP gout(Ts&... args)\n{\n    return GRunArgsP{ GRunArgP(detail::wrap_host_helper<Ts>::wrap_out(args))... };\n}\n\nstruct GTypeInfo;\nusing GTypesInfo = std::vector<GTypeInfo>;\n\n// FIXME: Needed for python bridge, must be moved to more appropriate header\nnamespace detail {\nstruct ExtractArgsCallback\n{\n    cv::GRunArgs operator()(const cv::GTypesInfo& info) const { return c(info); }\n    using CallBackT = std::function<cv::GRunArgs(const cv::GTypesInfo& info)>;\n    CallBackT c;\n};\n\nstruct ExtractMetaCallback\n{\n    cv::GMetaArgs operator()(const cv::GTypesInfo& info) const { return c(info); }\n    using CallBackT = std::function<cv::GMetaArgs(const cv::GTypesInfo& info)>;\n    CallBackT c;\n};\n\nvoid constructGraphOutputs(const cv::GTypesInfo &out_info,\n                           cv::GRunArgs         &args,\n                           cv::GRunArgsP        &outs);\n} // namespace detail\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GARG_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/garray.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GARRAY_HPP\n#define OPENCV_GAPI_GARRAY_HPP\n\n#include <functional>\n#include <ostream>\n#include <vector>\n#include <memory>\n\n#include <opencv2/gapi/own/exports.hpp>\n#include <opencv2/gapi/opencv_includes.hpp>\n\n#include <opencv2/gapi/util/variant.hpp>\n#include <opencv2/gapi/util/throw.hpp>\n#include <opencv2/gapi/own/assert.hpp>\n\n#include <opencv2/gapi/gmat.hpp>    // flatten_g only!\n#include <opencv2/gapi/gscalar.hpp> // flatten_g only!\n\nnamespace cv\n{\n// Forward declaration; GNode and GOrigin are an internal\n// (user-inaccessible) classes.\nclass GNode;\nstruct GOrigin;\ntemplate<typename T> class GArray;\n\n/**\n * \\addtogroup gapi_meta_args\n * @{\n */\nstruct GAPI_EXPORTS_W_SIMPLE GArrayDesc\n{\n    // FIXME: Body\n    // FIXME: Also implement proper operator== then\n    bool operator== (const GArrayDesc&) const { return true; }\n};\ntemplate<typename U> GArrayDesc descr_of(const std::vector<U> &) { return {};}\nGAPI_EXPORTS_W inline GArrayDesc empty_array_desc() {return {}; }\n/** @} */\n\nstd::ostream& operator<<(std::ostream& os, const cv::GArrayDesc &desc);\n\nnamespace detail\n{\n    // ConstructVec is a callback which stores information about T and is used by\n    // G-API runtime to construct arrays in host memory (T remains opaque for G-API).\n    // ConstructVec is carried into G-API internals by GArrayU.\n    // Currently it is suitable for Host (CPU) plugins only, real offload may require\n    // more information for manual memory allocation on-device.\n    class VectorRef;\n    using ConstructVec = std::function<void(VectorRef&)>;\n\n    // This is the base struct for GArrayU type holder\n    struct TypeHintBase{virtual ~TypeHintBase() = default;};\n\n    // This class holds type of initial GArray to be checked from GArrayU\n    template <typename T>\n    struct TypeHint final : public TypeHintBase{};\n\n    // This class strips type information from GArray<T> and makes it usable\n    // in the G-API graph compiler (expression unrolling, graph generation, etc).\n    // Part of GProtoArg.\n    class GAPI_EXPORTS GArrayU\n    {\n    public:\n        GArrayU(const GNode &n, std::size_t out); // Operation result constructor\n\n        template <typename T>\n        bool holds() const;                       // Check if was created from GArray<T>\n\n        GOrigin& priv();                          // Internal use only\n        const GOrigin& priv() const;              // Internal use only\n\n    protected:\n        GArrayU();                                // Default constructor\n        GArrayU(const detail::VectorRef& vref);   // Constant value constructor\n        template<class> friend class cv::GArray;  //  (available to GArray<T> only)\n\n        void setConstructFcn(ConstructVec &&cv);  // Store T-aware constructor\n\n        template <typename T>\n        void specifyType();                       // Store type of initial GArray<T>\n\n        template <typename T>\n        void storeKind();\n\n        void setKind(cv::detail::OpaqueKind);\n\n        std::shared_ptr<GOrigin> m_priv;\n        std::shared_ptr<TypeHintBase> m_hint;\n    };\n\n    template <typename T>\n    bool GArrayU::holds() const{\n        GAPI_Assert(m_hint != nullptr);\n        using U = typename std::decay<T>::type;\n        return dynamic_cast<TypeHint<U>*>(m_hint.get()) != nullptr;\n    };\n\n    template <typename T>\n    void GArrayU::specifyType(){\n        m_hint.reset(new TypeHint<typename std::decay<T>::type>);\n    };\n\n    template <typename T>\n    void GArrayU::storeKind(){\n        setKind(cv::detail::GOpaqueTraits<T>::kind);\n    };\n\n    // This class represents a typed STL vector reference.\n    // Depending on origins, this reference may be either \"just a\" reference to\n    // an object created externally, OR actually own the underlying object\n    // (be value holder).\n    class BasicVectorRef\n    {\n    public:\n        // These fields are set by the derived class(es)\n        std::size_t    m_elemSize = 0ul;\n        cv::GArrayDesc m_desc;\n        virtual ~BasicVectorRef() {}\n\n        virtual void mov(BasicVectorRef &ref) = 0;\n        virtual const void* ptr() const = 0;\n        virtual std::size_t size() const = 0;\n    };\n\n    template<typename T> class VectorRefT final: public BasicVectorRef\n    {\n        using empty_t  = util::monostate;\n        using ro_ext_t = const std::vector<T> *;\n        using rw_ext_t =       std::vector<T> *;\n        using rw_own_t =       std::vector<T>  ;\n        util::variant<empty_t, ro_ext_t, rw_ext_t, rw_own_t> m_ref;\n\n        inline bool isEmpty() const { return util::holds_alternative<empty_t>(m_ref);  }\n        inline bool isROExt() const { return util::holds_alternative<ro_ext_t>(m_ref); }\n        inline bool isRWExt() const { return util::holds_alternative<rw_ext_t>(m_ref); }\n        inline bool isRWOwn() const { return util::holds_alternative<rw_own_t>(m_ref); }\n\n        void init(const std::vector<T>* vec = nullptr)\n        {\n            m_elemSize = sizeof(T);\n            if (vec) m_desc = cv::descr_of(*vec);\n        }\n\n    public:\n        VectorRefT() { init(); }\n        virtual ~VectorRefT() {}\n\n        explicit VectorRefT(const std::vector<T>& vec) : m_ref(&vec)      { init(&vec); }\n        explicit VectorRefT(std::vector<T>& vec)  : m_ref(&vec)           { init(&vec); }\n        explicit VectorRefT(std::vector<T>&& vec) : m_ref(std::move(vec)) { init(&vec); }\n\n        // Reset a VectorRefT. Called only for objects instantiated\n        // internally in G-API (e.g. temporary GArray<T>'s within a\n        // computation).  Reset here means both initialization\n        // (creating an object) and reset (discarding its existing\n        // content before the next execution).  Must never be called\n        // for external VectorRefTs.\n        void reset()\n        {\n            if (isEmpty())\n            {\n                std::vector<T> empty_vector;\n                m_desc = cv::descr_of(empty_vector);\n                m_ref  = std::move(empty_vector);\n                GAPI_Assert(isRWOwn());\n            }\n            else if (isRWOwn())\n            {\n                util::get<rw_own_t>(m_ref).clear();\n            }\n            else GAPI_Assert(false); // shouldn't be called in *EXT modes\n        }\n\n        // Obtain a WRITE reference to underlying object\n        // Used by CPU kernel API wrappers when a kernel execution frame\n        // is created\n        std::vector<T>& wref()\n        {\n            GAPI_Assert(isRWExt() || isRWOwn());\n            if (isRWExt()) return *util::get<rw_ext_t>(m_ref);\n            if (isRWOwn()) return  util::get<rw_own_t>(m_ref);\n            util::throw_error(std::logic_error(\"Impossible happened\"));\n        }\n\n        // Obtain a READ reference to underlying object\n        // Used by CPU kernel API wrappers when a kernel execution frame\n        // is created\n        const std::vector<T>& rref() const\n        {\n            // ANY vector can be accessed for reading, even if it declared for\n            // output. Example -- a GComputation from [in] to [out1,out2]\n            // where [out2] is a result of operation applied to [out1]:\n            //\n            //            GComputation boundary\n            //            . . . . . . .\n            //            .           .\n            //     [in] ----> foo() ----> [out1]\n            //            .           .    :\n            //            .           . . .:. . .\n            //            .                V    .\n            //            .              bar() ---> [out2]\n            //            . . . . . . . . . . . .\n            //\n            if (isROExt()) return *util::get<ro_ext_t>(m_ref);\n            if (isRWExt()) return *util::get<rw_ext_t>(m_ref);\n            if (isRWOwn()) return  util::get<rw_own_t>(m_ref);\n            util::throw_error(std::logic_error(\"Impossible happened\"));\n        }\n\n        virtual void mov(BasicVectorRef &v) override {\n            VectorRefT<T> *tv = dynamic_cast<VectorRefT<T>*>(&v);\n            GAPI_Assert(tv != nullptr);\n            wref() = std::move(tv->wref());\n        }\n\n        virtual const void* ptr() const override { return &rref(); }\n        virtual std::size_t size() const override { return rref().size(); }\n    };\n\n    // This class strips type information from VectorRefT<> and makes it usable\n    // in the G-API executables (carrying run-time data/information to kernels).\n    // Part of GRunArg.\n    // Its methods are typed proxies to VectorRefT<T>.\n    // VectorRef maintains \"reference\" semantics so two copies of VectoRef refer\n    // to the same underlying object.\n    // FIXME: Put a good explanation on why cv::OutputArray doesn't fit this role\n    class VectorRef\n    {\n        std::shared_ptr<BasicVectorRef> m_ref;\n        cv::detail::OpaqueKind m_kind;\n\n        template<typename T> inline void check() const\n        {\n            GAPI_DbgAssert(dynamic_cast<VectorRefT<T>*>(m_ref.get()) != nullptr);\n            GAPI_Assert(sizeof(T) == m_ref->m_elemSize);\n        }\n\n    public:\n        VectorRef() = default;\n        template<typename T> explicit VectorRef(const std::vector<T>& vec)\n            : m_ref(new VectorRefT<T>(vec))\n            , m_kind(GOpaqueTraits<T>::kind)\n        {}\n        template<typename T> explicit VectorRef(std::vector<T>& vec)\n            : m_ref(new VectorRefT<T>(vec))\n            , m_kind(GOpaqueTraits<T>::kind)\n        {}\n        template<typename T> explicit VectorRef(std::vector<T>&& vec)\n            : m_ref(new VectorRefT<T>(std::move(vec)))\n            , m_kind(GOpaqueTraits<T>::kind)\n        {}\n\n        cv::detail::OpaqueKind getKind() const\n        {\n            return m_kind;\n        }\n\n        template<typename T> void reset()\n        {\n            if (!m_ref) m_ref.reset(new VectorRefT<T>());\n            check<T>();\n            storeKind<T>();\n            static_cast<VectorRefT<T>&>(*m_ref).reset();\n        }\n\n        template <typename T>\n        void storeKind()\n        {\n            m_kind = cv::detail::GOpaqueTraits<T>::kind;\n        }\n\n        template<typename T> std::vector<T>& wref()\n        {\n            check<T>();\n            return static_cast<VectorRefT<T>&>(*m_ref).wref();\n        }\n\n        template<typename T> const std::vector<T>& rref() const\n        {\n            check<T>();\n            return static_cast<VectorRefT<T>&>(*m_ref).rref();\n        }\n\n        // Check if was created for/from std::vector<T>\n        template <typename T> bool holds() const\n        {\n            if (!m_ref) return false;\n            using U = typename std::decay<T>::type;\n            return dynamic_cast<VectorRefT<U>*>(m_ref.get()) != nullptr;\n        }\n\n        void mov(VectorRef &v)\n        {\n            m_ref->mov(*v.m_ref);\n        }\n\n        cv::GArrayDesc descr_of() const\n        {\n            return m_ref->m_desc;\n        }\n\n        std::size_t size() const\n        {\n            return m_ref->size();\n        }\n\n        // May be used to uniquely identify this object internally\n        const void *ptr() const { return m_ref->ptr(); }\n    };\n\n    // Helper (FIXME: work-around?)\n    // stripping G types to their host types\n    // like cv::GArray<GMat> would still map to std::vector<cv::Mat>\n    // but not to std::vector<cv::GMat>\n#if defined(GAPI_STANDALONE)\n#  define FLATTEN_NS cv::gapi::own\n#else\n#  define FLATTEN_NS cv\n#endif\n    template<class T> struct flatten_g;\n    template<> struct flatten_g<cv::GMat>         { using type = FLATTEN_NS::Mat; };\n    template<> struct flatten_g<cv::GScalar>      { using type = FLATTEN_NS::Scalar; };\n    template<class T> struct flatten_g<GArray<T>> { using type = std::vector<T>; };\n    template<class T> struct flatten_g            { using type = T; };\n#undef FLATTEN_NS\n    // FIXME: the above mainly duplicates \"ProtoToParam\" thing from gtyped.hpp\n    // but I decided not to include gtyped here - probably worth moving that stuff\n    // to some common place? (DM)\n} // namespace detail\n\n/** \\addtogroup gapi_data_objects\n * @{\n */\n/**\n * @brief `cv::GArray<T>` template class represents a list of objects\n * of class `T` in the graph.\n *\n * `cv::GArray<T>` describes a functional relationship between\n * operations consuming and producing arrays of objects of class\n * `T`. The primary purpose of `cv::GArray<T>` is to represent a\n * dynamic list of objects -- where the size of the list is not known\n * at the graph construction or compile time. Examples include: corner\n * and feature detectors (`cv::GArray<cv::Point>`), object detection\n * and tracking  results (`cv::GArray<cv::Rect>`). Programmers can use\n * their own types with `cv::GArray<T>` in the custom operations.\n *\n * Similar to `cv::GScalar`, `cv::GArray<T>` may be value-initialized\n * -- in this case a graph-constant value is associated with the object.\n *\n * `GArray<T>` is a virtual counterpart of `std::vector<T>`, which is\n * usually used to represent the `GArray<T>` data in G-API during the\n * execution.\n *\n * @sa `cv::GOpaque<T>`\n */\ntemplate<typename T> class GArray\n{\npublic:\n    // Host type (or Flat type) - the type this GArray is actually\n    // specified to.\n    /// @private\n    using HT = typename detail::flatten_g<typename std::decay<T>::type>::type;\n\n    /**\n     * @brief Constructs a value-initialized `cv::GArray<T>`\n     *\n     * `cv::GArray<T>` objects  may have their values\n     * be associated at graph construction time. It is useful when\n     * some operation has a `cv::GArray<T>` input which doesn't change during\n     * the program execution, and is set only once. In this case,\n     * there is no need to declare such `cv::GArray<T>` as a graph input.\n     *\n     * @note The value of `cv::GArray<T>` may be overwritten by assigning some\n     * other `cv::GArray<T>` to the object using `operator=` -- on the\n     * assigment, the old association or value is discarded.\n     *\n     * @param v a std::vector<T> to associate with this\n     * `cv::GArray<T>` object. Vector data is copied into the\n     * `cv::GArray<T>` (no reference to the passed data is held).\n     */\n    explicit GArray(const std::vector<HT>& v) // Constant value constructor\n        : m_ref(detail::GArrayU(detail::VectorRef(v))) { putDetails(); }\n\n    /**\n     * @overload\n     * @brief Constructs a value-initialized `cv::GArray<T>`\n     *\n     * @param v a std::vector<T> to associate with this\n     * `cv::GArray<T>` object. Vector data is moved into the `cv::GArray<T>`.\n     */\n    explicit GArray(std::vector<HT>&& v)      // Move-constructor\n        : m_ref(detail::GArrayU(detail::VectorRef(std::move(v)))) { putDetails(); }\n\n    /**\n     * @brief Constructs an empty `cv::GArray<T>`\n     *\n     * Normally, empty G-API data objects denote a starting point of\n     * the graph. When an empty `cv::GArray<T>` is assigned to a result\n     * of some operation, it obtains a functional link to this\n     * operation (and is not empty anymore).\n     */\n    GArray() { putDetails(); }                // Empty constructor\n\n    /// @private\n    explicit GArray(detail::GArrayU &&ref)    // GArrayU-based constructor\n        : m_ref(ref) { putDetails(); }        //   (used by GCall, not for users)\n\n    /// @private\n    detail::GArrayU strip() const {\n        return m_ref;\n    }\n    /// @private\n    static void VCtor(detail::VectorRef& vref) {\n        vref.reset<HT>();\n    }\n\nprivate:\n    void putDetails() {\n        m_ref.setConstructFcn(&VCtor);\n        m_ref.specifyType<HT>();  // FIXME: to unify those 2 to avoid excessive dynamic_cast\n        m_ref.storeKind<HT>();    //\n    }\n\n    detail::GArrayU m_ref;\n};\n\n/** @} */\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GARRAY_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gasync_context.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n\n#ifndef OPENCV_GAPI_GASYNC_CONTEXT_HPP\n#define OPENCV_GAPI_GASYNC_CONTEXT_HPP\n\n#if !defined(GAPI_STANDALONE)\n#  include <opencv2/core/cvdef.h>\n#else   // Without OpenCV\n#  include <opencv2/gapi/own/cvdefs.hpp>\n#endif // !defined(GAPI_STANDALONE)\n\n#include <opencv2/gapi/own/exports.hpp>\n\nnamespace cv {\nnamespace gapi{\n\n/**\n * @brief This namespace contains experimental G-API functionality,\n * functions or structures in this namespace are subjects to change or\n * removal in the future releases. This namespace also contains\n * functions which API is not stabilized yet.\n */\nnamespace wip {\n\n/**\n * @brief A class to group async requests to cancel them in a single shot.\n *\n * GAsyncContext is passed as an argument to async() and async_apply() functions\n */\n\nclass GAPI_EXPORTS GAsyncContext{\n    std::atomic<bool> cancelation_requested = {false};\npublic:\n    /**\n     * @brief Start cancellation process for an associated request.\n     *\n     * User still has to wait for each individual request (either via callback or according std::future object) to make sure it actually canceled.\n     *\n     * @return true if it was a first request to cancel the context\n     */\n    bool cancel();\n\n    /**\n    * @brief Returns true if cancellation was requested for this context.\n    *\n    * @return true if cancellation was requested for this context\n    */\n    bool isCanceled() const;\n};\n\nclass GAPI_EXPORTS GAsyncCanceled : public std::exception {\npublic:\n    virtual const char* what() const noexcept CV_OVERRIDE;\n};\n} // namespace wip\n} // namespace gapi\n} // namespace cv\n\n#endif //OPENCV_GAPI_GASYNC_CONTEXT_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gcall.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GCALL_HPP\n#define OPENCV_GAPI_GCALL_HPP\n\n#include <opencv2/gapi/garg.hpp>      // GArg\n#include <opencv2/gapi/gmat.hpp>      // GMat\n#include <opencv2/gapi/gscalar.hpp>   // GScalar\n#include <opencv2/gapi/gframe.hpp>    // GFrame\n#include <opencv2/gapi/garray.hpp>    // GArray<T>\n#include <opencv2/gapi/gopaque.hpp>   // GOpaque<T>\n\nnamespace cv {\n\nstruct GKernel;\n\n// The whole idea of this class is to represent an operation\n// which is applied to arguments. This is part of public API,\n// since it is what users should use to define kernel interfaces.\n\nclass GAPI_EXPORTS GCall final\n{\npublic:\n    class Priv;\n\n    explicit GCall(const GKernel &k);\n    ~GCall();\n\n    template<typename... Ts>\n    GCall& pass(Ts&&... args)\n    {\n        setArgs({cv::GArg(std::move(args))...});\n        return *this;\n    }\n\n    // A generic yield method - obtain a link to operator's particular GMat output\n    GMat    yield      (int output = 0);\n    GMatP   yieldP     (int output = 0);\n    GScalar yieldScalar(int output = 0);\n    GFrame  yieldFrame (int output = 0);\n\n    template<class T> GArray<T> yieldArray(int output = 0)\n    {\n        return GArray<T>(yieldArray(output));\n    }\n\n    template<class T> GOpaque<T> yieldOpaque(int output = 0)\n    {\n        return GOpaque<T>(yieldOpaque(output));\n    }\n\n    // Internal use only\n    Priv& priv();\n    const Priv& priv() const;\n\n    // GKernel and params can be modified, it's needed for infer<Generic>,\n    // because information about output shapes doesn't exist in compile time\n    GKernel& kernel();\n    cv::util::any& params();\n\n    void setArgs(std::vector<GArg> &&args);\n\nprotected:\n    std::shared_ptr<Priv> m_priv;\n\n    // Public versions return a typed array or opaque, those are implementation details\n    detail::GArrayU yieldArray(int output = 0);\n    detail::GOpaqueU yieldOpaque(int output = 0);\n};\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GCALL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gcommon.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GCOMMON_HPP\n#define OPENCV_GAPI_GCOMMON_HPP\n\n#include <functional>   // std::hash\n#include <vector>       // std::vector\n#include <type_traits>  // decay\n\n#include <opencv2/gapi/opencv_includes.hpp>\n\n#include <opencv2/gapi/util/any.hpp>\n#include <opencv2/gapi/util/optional.hpp>\n#include <opencv2/gapi/own/exports.hpp>\n#include <opencv2/gapi/own/assert.hpp>\n#include <opencv2/gapi/render/render_types.hpp>\n#include <opencv2/gapi/s11n/base.hpp>\n\nnamespace cv {\n\nclass GMat; // FIXME: forward declaration for GOpaqueTraits\n\nnamespace detail\n{\n    // This is a trait-like structure to mark backend-specific compile arguments\n    // with tags\n    template<typename T> struct CompileArgTag;\n\n    // These structures are tags which separate kernels and transformations\n    struct KernelTag\n    {};\n    struct TransformTag\n    {};\n\n    // This enum is utilized mostly by GArray and GOpaque to store and recognize their internal data\n    // types (aka Host type). Also it is widely used during serialization routine.\n    enum class OpaqueKind: int\n    {\n        CV_UNKNOWN,    // Unknown, generic, opaque-to-GAPI data type unsupported in graph seriallization\n        CV_BOOL,       // bool user G-API data\n        CV_INT,        // int user G-API data\n        CV_INT64,      // int64_t user G-API data\n        CV_DOUBLE,     // double user G-API data\n        CV_FLOAT,      // float user G-API data\n        CV_UINT64,     // uint64_t user G-API data\n        CV_STRING,     // std::string user G-API data\n        CV_POINT,      // cv::Point user G-API data\n        CV_POINT2F,    // cv::Point2f user G-API data\n        CV_SIZE,       // cv::Size user G-API data\n        CV_RECT,       // cv::Rect user G-API data\n        CV_SCALAR,     // cv::Scalar user G-API data\n        CV_MAT,        // cv::Mat user G-API data\n        CV_DRAW_PRIM,  // cv::gapi::wip::draw::Prim user G-API data\n    };\n\n    // Type traits helper which simplifies the extraction of kind from type\n    template<typename T> struct GOpaqueTraits;\n    template<typename T> struct GOpaqueTraits    { static constexpr const OpaqueKind kind = OpaqueKind::CV_UNKNOWN; };\n    template<> struct GOpaqueTraits<int>         { static constexpr const OpaqueKind kind = OpaqueKind::CV_INT; };\n    template<> struct GOpaqueTraits<int64_t>     { static constexpr const OpaqueKind kind = OpaqueKind::CV_INT64; };\n    template<> struct GOpaqueTraits<double>      { static constexpr const OpaqueKind kind = OpaqueKind::CV_DOUBLE; };\n    template<> struct GOpaqueTraits<float>       { static constexpr const OpaqueKind kind = OpaqueKind::CV_FLOAT; };\n    template<> struct GOpaqueTraits<uint64_t>    { static constexpr const OpaqueKind kind = OpaqueKind::CV_UINT64; };\n    template<> struct GOpaqueTraits<bool>        { static constexpr const OpaqueKind kind = OpaqueKind::CV_BOOL; };\n    template<> struct GOpaqueTraits<std::string> { static constexpr const OpaqueKind kind = OpaqueKind::CV_STRING; };\n    template<> struct GOpaqueTraits<cv::Size>    { static constexpr const OpaqueKind kind = OpaqueKind::CV_SIZE; };\n    template<> struct GOpaqueTraits<cv::Scalar>  { static constexpr const OpaqueKind kind = OpaqueKind::CV_SCALAR; };\n    template<> struct GOpaqueTraits<cv::Point>   { static constexpr const OpaqueKind kind = OpaqueKind::CV_POINT; };\n    template<> struct GOpaqueTraits<cv::Point2f> { static constexpr const OpaqueKind kind = OpaqueKind::CV_POINT2F; };\n    template<> struct GOpaqueTraits<cv::Mat>     { static constexpr const OpaqueKind kind = OpaqueKind::CV_MAT; };\n    template<> struct GOpaqueTraits<cv::Rect>    { static constexpr const OpaqueKind kind = OpaqueKind::CV_RECT; };\n    template<> struct GOpaqueTraits<cv::GMat>    { static constexpr const OpaqueKind kind = OpaqueKind::CV_MAT; };\n    template<> struct GOpaqueTraits<cv::gapi::wip::draw::Prim>\n                                                 { static constexpr const OpaqueKind kind = OpaqueKind::CV_DRAW_PRIM; };\n    using GOpaqueTraitsArrayTypes = std::tuple<int, double, float, uint64_t, bool, std::string, cv::Size, cv::Scalar, cv::Point, cv::Point2f,\n                                               cv::Mat, cv::Rect, cv::gapi::wip::draw::Prim>;\n    // GOpaque is not supporting cv::Mat and cv::Scalar since there are GScalar and GMat types\n    using GOpaqueTraitsOpaqueTypes = std::tuple<int, double, float, uint64_t, bool, std::string, cv::Size, cv::Point, cv::Point2f, cv::Rect,\n                                                cv::gapi::wip::draw::Prim>;\n} // namespace detail\n\n// This definition is here because it is reused by both public(?) and internal\n// modules. Keeping it here wouldn't expose public details (e.g., API-level)\n// to components which are internal and operate on a lower-level entities\n// (e.g., compiler, backends).\n// FIXME: merge with ArgKind?\n// FIXME: replace with variant[format desc]?\nenum class GShape: int\n{\n    GMAT,\n    GSCALAR,\n    GARRAY,\n    GOPAQUE,\n    GFRAME,\n};\n\nnamespace gapi {\nnamespace s11n {\nnamespace detail {\ntemplate<typename T> struct wrap_serialize;\n} // namespace detail\n} // namespace s11n\n} // namespace gapi\n\n\nstruct GCompileArg;\n\nnamespace detail {\n    template<typename T>\n    using is_compile_arg = std::is_same<GCompileArg, typename std::decay<T>::type>;\n} // namespace detail\n\n// CompileArg is an unified interface over backend-specific compilation\n// information\n// FIXME: Move to a separate file?\n/** \\addtogroup gapi_compile_args\n * @{\n *\n * @brief Compilation arguments: data structures controlling the\n * compilation process\n *\n * G-API comes with a number of graph compilation options which can be\n * passed to cv::GComputation::apply() or\n * cv::GComputation::compile(). Known compilation options are listed\n * in this page, while extra backends may introduce their own\n * compilation options (G-API transparently accepts _everything_ which\n * can be passed to cv::compile_args(), it depends on underlying\n * backends if an option would be interpreted or not).\n *\n * For example, if an example computation is executed like this:\n *\n * @snippet modules/gapi/samples/api_ref_snippets.cpp graph_decl_apply\n *\n * Extra parameter specifying which kernels to compile with can be\n * passed like this:\n *\n * @snippet modules/gapi/samples/api_ref_snippets.cpp apply_with_param\n */\n\n/**\n * @brief Represents an arbitrary compilation argument.\n *\n * Any value can be wrapped into cv::GCompileArg, but only known ones\n * (to G-API or its backends) can be interpreted correctly.\n *\n * Normally objects of this class shouldn't be created manually, use\n * cv::compile_args() function which automatically wraps everything\n * passed in (a variadic template parameter pack) into a vector of\n * cv::GCompileArg objects.\n */\nstruct GCompileArg\n{\npublic:\n    // NB: Required for pythnon bindings\n    GCompileArg() = default;\n\n    std::string tag;\n\n    // FIXME: use decay in GArg/other trait-based wrapper before leg is shot!\n    template<typename T, typename std::enable_if<!detail::is_compile_arg<T>::value, int>::type = 0>\n    explicit GCompileArg(T &&t)\n        : tag(detail::CompileArgTag<typename std::decay<T>::type>::tag())\n        , serializeF(cv::gapi::s11n::detail::has_S11N_spec<T>::value ?\n                     &cv::gapi::s11n::detail::wrap_serialize<T>::serialize :\n                     nullptr)\n        , arg(t)\n    {\n    }\n\n    template<typename T> T& get()\n    {\n        return util::any_cast<T>(arg);\n    }\n\n    template<typename T> const T& get() const\n    {\n        return util::any_cast<T>(arg);\n    }\n\n    void serialize(cv::gapi::s11n::IOStream& os) const\n    {\n        if (serializeF)\n        {\n            serializeF(os, *this);\n        }\n    }\n\nprivate:\n    std::function<void(cv::gapi::s11n::IOStream&, const GCompileArg&)> serializeF;\n    util::any arg;\n};\n\nusing GCompileArgs = std::vector<GCompileArg>;\n\ninline cv::GCompileArgs& operator += (      cv::GCompileArgs &lhs,\n                                      const cv::GCompileArgs &rhs)\n{\n    lhs.reserve(lhs.size() + rhs.size());\n    lhs.insert(lhs.end(), rhs.begin(), rhs.end());\n    return lhs;\n}\n\n/**\n * @brief Wraps a list of arguments (a parameter pack) into a vector of\n *        compilation arguments (cv::GCompileArg).\n */\ntemplate<typename... Ts> GCompileArgs compile_args(Ts&&... args)\n{\n    return GCompileArgs{ GCompileArg(args)... };\n}\n\nnamespace gapi\n{\n/**\n * @brief Retrieves particular compilation argument by its type from\n *        cv::GCompileArgs\n */\ntemplate<typename T>\ninline cv::util::optional<T> getCompileArg(const cv::GCompileArgs &args)\n{\n    for (auto &compile_arg : args)\n    {\n        if (compile_arg.tag == cv::detail::CompileArgTag<T>::tag())\n        {\n            return cv::util::optional<T>(compile_arg.get<T>());\n        }\n    }\n    return cv::util::optional<T>();\n}\n\nnamespace s11n {\nnamespace detail {\ntemplate<typename T> struct wrap_serialize\n{\n    static void serialize(IOStream& os, const GCompileArg& arg)\n    {\n        using DT = typename std::decay<T>::type;\n        S11N<DT>::serialize(os, arg.get<DT>());\n    }\n};\n} // namespace detail\n} // namespace s11n\n} // namespace gapi\n\n/**\n * @brief Ask G-API to dump compiled graph in Graphviz format under\n * the given file name.\n *\n * Specifies a graph dump path (path to .dot file to be generated).\n * G-API will dump a .dot file under specified path during a\n * compilation process if this flag is passed.\n */\nstruct graph_dump_path\n{\n    std::string m_dump_path;\n};\n/** @} */\n\nnamespace detail\n{\n    template<> struct CompileArgTag<cv::graph_dump_path>\n    {\n        static const char* tag() { return \"gapi.graph_dump_path\"; }\n    };\n}\n\n} // namespace cv\n\n// std::hash overload for GShape\nnamespace std\n{\ntemplate<> struct hash<cv::GShape>\n{\n    size_t operator() (cv::GShape sh) const\n    {\n        return std::hash<int>()(static_cast<int>(sh));\n    }\n};\n} // namespace std\n\n\n#endif // OPENCV_GAPI_GCOMMON_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gcompiled.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GCOMPILED_HPP\n#define OPENCV_GAPI_GCOMPILED_HPP\n\n#include <vector>\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/own/assert.hpp>\n#include <opencv2/gapi/garg.hpp>\n\nnamespace cv {\n\n// This class represents a compiled computation.\n// In theory (and ideally), it can be used w/o the rest of APIs.\n// In theory (and ideally), it can be serialized/deserialized.\n// It can enable scenarious like deployment to an autonomous devince, FuSa, etc.\n//\n// Currently GCompiled assumes all GMats you used to pass data to G-API\n// are valid and not destroyed while you use a GCompiled object.\n//\n// FIXME: In future, there should be a way to name I/O objects and specify it\n// to GCompiled externally (for example, when it is loaded on the target system).\n\n/**\n * \\addtogroup gapi_main_classes\n * @{\n */\n/**\n * @brief Represents a compiled computation (graph). Can only be used\n * with image / data formats & resolutions it was compiled for, with\n * some exceptions.\n *\n * This class represents a product of graph compilation (calling\n * cv::GComputation::compile()). Objects of this class actually do\n * data processing, and graph execution is incapsulated into objects\n * of this class. Execution model itself depends on kernels and\n * backends which were using during the compilation, see @ref\n * gapi_compile_args for details.\n *\n * In a general case, GCompiled objects can be applied to data only in\n * that formats/resolutions they were compiled for (see @ref\n * gapi_meta_args). However, if the underlying backends allow, a\n * compiled object can be _reshaped_ to handle data (images) of\n * different resolution, though formats and types must remain the same.\n *\n * GCompiled is very similar to `std::function<>` in its semantics --\n * running it looks like a function call in the user code.\n *\n * At the moment, GCompiled objects are not reentrant -- generally,\n * the objects are stateful since graph execution itself is a stateful\n * process and this state is now maintained in GCompiled's own memory\n * (not on the process stack).\n *\n * At the same time, two different GCompiled objects produced from the\n * single cv::GComputation are completely independent and can be used\n * concurrently.\n *\n * @sa GStreamingCompiled\n */\nclass GAPI_EXPORTS GCompiled\n{\npublic:\n    /// @private\n    class GAPI_EXPORTS Priv;\n\n    /**\n     * @brief Constructs an empty object\n     */\n    GCompiled();\n\n    /**\n     * @brief Run the compiled computation, a generic version.\n     *\n     * @param ins vector of inputs to process.\n     * @param outs vector of outputs to produce.\n     *\n     * Input/output vectors must have the same number of elements as\n     * defined in the cv::GComputation protocol (at the moment of its\n     * construction). Shapes of elements also must conform to protocol\n     * (e.g. cv::Mat needs to be passed where cv::GMat has been\n     * declared as input, and so on). Run-time exception is generated\n     * otherwise.\n     *\n     * Objects in output vector may remain empty (like cv::Mat) --\n     * G-API will automatically initialize output objects to proper formats.\n     *\n     * @note Don't construct GRunArgs/GRunArgsP objects manually, use\n     * cv::gin()/cv::gout() wrappers instead.\n     */\n    void operator() (GRunArgs &&ins, GRunArgsP &&outs);          // Generic arg-to-arg\n#if !defined(GAPI_STANDALONE)\n\n    /**\n     * @brief Execute an unary computation\n     *\n     * @overload\n     * @param in input cv::Mat for unary computation\n     * @param out output cv::Mat for unary computation\n     * process.\n     */\n    void operator() (cv::Mat in, cv::Mat &out);                  // Unary overload\n\n    /**\n     * @brief Execute an unary computation\n     *\n     * @overload\n     * @param in input cv::Mat for unary computation\n     * @param out output cv::Scalar for unary computation\n     * process.\n     */\n    void operator() (cv::Mat in, cv::Scalar &out);               // Unary overload (scalar)\n\n    /**\n     * @brief Execute a binary computation\n     *\n     * @overload\n     * @param in1 first input cv::Mat for binary computation\n     * @param in2 second input cv::Mat for binary computation\n     * @param out output cv::Mat for binary computation\n     * process.\n     */\n    void operator() (cv::Mat in1, cv::Mat in2, cv::Mat &out);    // Binary overload\n\n    /**\n     * @brief Execute an binary computation\n     *\n     * @overload\n     * @param in1 first input cv::Mat for binary computation\n     * @param in2 second input cv::Mat for binary computation\n     * @param out output cv::Scalar for binary computation\n     * process.\n     */\n    void operator() (cv::Mat in1, cv::Mat in2, cv::Scalar &out); // Binary overload (scalar)\n\n    /**\n     * @brief Execute a computation with arbitrary number of\n     * inputs/outputs.\n     *\n     * @overload\n     * @param ins vector of input cv::Mat objects to process by the\n     * computation.\n     * @param outs vector of output cv::Mat objects to produce by the\n     * computation.\n     *\n     * Numbers of elements in ins/outs vectors must match numbers of\n     * inputs/outputs which were used to define the source GComputation.\n     */\n    void operator() (const std::vector<cv::Mat> &ins,            // Compatibility overload\n                     const std::vector<cv::Mat> &outs);\n#endif  // !defined(GAPI_STANDALONE)\n    /// @private\n    Priv& priv();\n\n    /**\n     * @brief Check if compiled object is valid (non-empty)\n     *\n     * @return true if the object is runnable (valid), false otherwise\n     */\n    explicit operator bool () const;\n\n    /**\n     * @brief Vector of metadata this graph was compiled for.\n     *\n     * @return Unless _reshape_ is not supported, return value is the\n     * same vector which was passed to cv::GComputation::compile() to\n     * produce this compiled object. Otherwise, it is the latest\n     * metadata vector passed to reshape() (if that call was\n     * successful).\n     */\n    const GMetaArgs& metas() const; // Meta passed to compile()\n\n    /**\n     * @brief Vector of metadata descriptions of graph outputs\n     *\n     * @return vector with formats/resolutions of graph's output\n     * objects, auto-inferred from input metadata vector by\n     * operations which form this computation.\n     *\n     * @note GCompiled objects produced from the same\n     * cv::GComputiation graph with different input metas may return\n     * different values in this vector.\n     */\n    const GMetaArgs& outMetas() const;\n\n    /**\n     * @brief Check if the underlying backends support reshape or not.\n     *\n     * @return true if supported, false otherwise.\n     */\n    bool canReshape() const;\n\n    /**\n     * @brief Reshape a compiled graph to support new image\n     * resolutions.\n     *\n     * Throws an exception if an error occurs.\n     *\n     * @param inMetas new metadata to reshape on. Vector size and\n     * metadata shapes must match the computation's protocol.\n     * @param args compilation arguments to use.\n     */\n    // FIXME: Why it requires compile args?\n    void reshape(const GMetaArgs& inMetas, const GCompileArgs& args);\n\n    /**\n     * @brief Prepare inner kernels states for a new video-stream.\n     *\n     * GCompiled objects may be used to process video streams frame by frame.\n     * In this case, a GCompiled is called on every image frame individually.\n     * Starting OpenCV 4.4, some kernels in the graph may have their internal\n     * states (see GAPI_OCV_KERNEL_ST for the OpenCV backend).\n     * In this case, if user starts processing another video stream with\n     * this GCompiled, this method needs to be called to let kernels re-initialize\n     * their internal states to a new video stream.\n     */\n    void prepareForNewStream();\n\nprotected:\n    /// @private\n    std::shared_ptr<Priv> m_priv;\n};\n/** @} */\n\n}\n\n#endif // OPENCV_GAPI_GCOMPILED_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gcompiled_async.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GCOMPILED_ASYNC_HPP\n#define OPENCV_GAPI_GCOMPILED_ASYNC_HPP\n\n#include <future>           //for std::future\n#include <exception>        //for std::exception_ptr\n#include <functional>       //for std::function\n#include <opencv2/gapi/garg.hpp>\n#include <opencv2/gapi/own/exports.hpp>\n\nnamespace cv {\n    //fwd declaration\n    class GCompiled;\n\nnamespace gapi{\nnamespace wip {\n    class GAsyncContext;\n    /**\n    These functions asynchronously (i.e. probably on a separate thread of execution) call GCompiled::operator() member function of their first argument with copies of rest of arguments (except callback) passed in.\n    The difference between the function is the way to get the completion notification (via callback or a waiting on std::future object)\n    If exception is occurred during execution of apply it is transferred to the callback (via function parameter) or passed to future (and will be thrown on call to std::future::get)\n\n    N.B. :\n    Input arguments are copied on call to async function (actually on call to cv::gin) and thus do not have to outlive the actual completion of asynchronous activity.\n    While output arguments are \"captured\" by reference(pointer) and therefore _must_ outlive the asynchronous activity\n    (i.e. live at least until callback is called or future is unblocked)\n\n    @param gcmpld       Compiled computation (graph) to start asynchronously\n    @param callback     Callback to be called when execution of gcmpld is done\n    @param ins          Input parameters for gcmpld\n    @param outs         Output parameters for gcmpld\n    */\n    GAPI_EXPORTS void                async(GCompiled& gcmpld, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs);\n\n    /** @overload\n    @param gcmpld       Compiled computation (graph) to run asynchronously\n    @param callback     Callback to be called when execution of gcmpld is done\n    @param ins          Input parameters for gcmpld\n    @param outs         Output parameters for gcmpld\n    @param ctx          Context this request belongs to\n    @see   async GAsyncContext\n    */\n    GAPI_EXPORTS void                async(GCompiled& gcmpld, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs, GAsyncContext& ctx);\n\n    /** @overload\n    @param gcmpld       Compiled computation (graph) to run asynchronously\n    @param ins          Input parameters for gcmpld\n    @param outs         Output parameters for gcmpld\n    @return             std::future<void> object to wait for completion of async operation\n    @see async\n    */\n    GAPI_EXPORTS std::future<void>   async(GCompiled& gcmpld, GRunArgs &&ins, GRunArgsP &&outs);\n\n    /**\n    @param gcmpld       Compiled computation (graph) to run asynchronously\n    @param ins          Input parameters for gcmpld\n    @param outs         Output parameters for gcmpld\n    @param ctx          Context this request belongs to\n    @return             std::future<void> object to wait for completion of async operation\n    @see   async GAsyncContext\n    */\n    GAPI_EXPORTS std::future<void>   async(GCompiled& gcmpld, GRunArgs &&ins, GRunArgsP &&outs, GAsyncContext& ctx);\n} // namespace wip\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_GCOMPILED_ASYNC_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gcompoundkernel.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2019 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GCOMPOUNDKERNEL_HPP\n#define OPENCV_GAPI_GCOMPOUNDKERNEL_HPP\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/gcommon.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n#include <opencv2/gapi/garg.hpp>\n\nnamespace cv {\nnamespace gapi\n{\nnamespace compound\n{\n    // FIXME User does not need to know about this function\n    // Needs that user may define compound kernels(as cpu kernels)\n    GAPI_EXPORTS cv::gapi::GBackend backend();\n} // namespace compound\n} // namespace gapi\n\nnamespace detail\n{\n\nstruct GCompoundContext\n{\n    explicit GCompoundContext(const GArgs& in_args);\n    template<typename T>\n    const T& inArg(int input) { return m_args.at(input).get<T>(); }\n\n    GArgs m_args;\n    GArgs m_results;\n};\n\nclass GAPI_EXPORTS GCompoundKernel\n{\n// Compound kernel must use all of it's inputs\npublic:\n    using F = std::function<void(GCompoundContext& ctx)>;\n\n    explicit GCompoundKernel(const F& f);\n    void apply(GCompoundContext& ctx);\n\nprotected:\n    F m_f;\n};\n\ntemplate<typename T> struct get_compound_in\n{\n    static T get(GCompoundContext &ctx, int idx) { return ctx.inArg<T>(idx); }\n};\n\ntemplate<typename U> struct get_compound_in<cv::GArray<U>>\n{\n    static cv::GArray<U> get(GCompoundContext &ctx, int idx)\n    {\n        auto array = cv::GArray<U>();\n        ctx.m_args[idx] = GArg(array);\n        return array;\n    }\n};\n\ntemplate<typename U> struct get_compound_in<cv::GOpaque<U>>\n{\n    static cv::GOpaque<U> get(GCompoundContext &ctx, int idx)\n    {\n        auto opaq = cv::GOpaque<U>();\n        ctx.m_args[idx] = GArg(opaq);\n        return opaq;\n    }\n};\n\ntemplate<> struct get_compound_in<cv::GMatP>\n{\n    static cv::GMatP get(GCompoundContext &ctx, int idx)\n    {\n        auto mat = cv::GMatP();\n        ctx.m_args[idx] = GArg(mat);\n        return mat;\n    }\n};\n\ntemplate<typename, typename, typename>\nstruct GCompoundCallHelper;\n\ntemplate<typename Impl, typename... Ins, typename... Outs>\nstruct GCompoundCallHelper<Impl, std::tuple<Ins...>, std::tuple<Outs...> >\n{\n    template<int... IIs, int... OIs>\n    static void expand_impl(GCompoundContext &ctx, detail::Seq<IIs...>, detail::Seq<OIs...>)\n    {\n        auto result = Impl::expand(get_compound_in<Ins>::get(ctx, IIs)...);\n        auto tuple_return = tuple_wrap_helper<decltype(result)>::get(std::move(result));\n        ctx.m_results = { cv::GArg(std::get<OIs>(tuple_return))... };\n    }\n\n    static void expand(GCompoundContext &ctx)\n    {\n        expand_impl(ctx,\n                    typename detail::MkSeq<sizeof...(Ins)>::type(),\n                    typename detail::MkSeq<sizeof...(Outs)>::type());\n    }\n};\n\ntemplate<class Impl, class K>\nclass GCompoundKernelImpl: public cv::detail::GCompoundCallHelper<Impl, typename K::InArgs, typename K::OutArgs>,\n                           public cv::detail::KernelTag\n{\n    using P = cv::detail::GCompoundCallHelper<Impl, typename K::InArgs, typename K::OutArgs>;\n\npublic:\n    using API = K;\n\n    static cv::gapi::GBackend backend() { return cv::gapi::compound::backend(); }\n    static GCompoundKernel    kernel()  { return GCompoundKernel(&P::expand);   }\n};\n\n} // namespace detail\n\n\n/**\n * Declares a new compound kernel. See this\n * [documentation chapter](@ref gapi_kernel_compound)\n * on compound kernels for more details.\n *\n * @param Name type name for new kernel\n * @param API the interface this kernel implements\n */\n#define GAPI_COMPOUND_KERNEL(Name, API) \\\n    struct Name: public cv::detail::GCompoundKernelImpl<Name, API>\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GCOMPOUNDKERNEL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gcomputation.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GCOMPUTATION_HPP\n#define OPENCV_GAPI_GCOMPUTATION_HPP\n\n#include <functional>\n\n#include <opencv2/gapi/util/util.hpp>\n#include <opencv2/gapi/gcommon.hpp>\n#include <opencv2/gapi/gproto.hpp>\n#include <opencv2/gapi/garg.hpp>\n#include <opencv2/gapi/gcompiled.hpp>\n#include <opencv2/gapi/gstreaming.hpp>\n\nnamespace cv {\n\nnamespace detail\n{\n    // FIXME: move to algorithm, cover with separate tests\n    // FIXME: replace with O(1) version (both memory and compilation time)\n    template<typename...>\n    struct last_type;\n\n    template<typename T>\n    struct last_type<T> { using type = T;};\n\n    template<typename T, typename... Ts>\n    struct last_type<T, Ts...> { using type = typename last_type<Ts...>::type; };\n\n    template<typename... Ts>\n    using last_type_t = typename last_type<Ts...>::type;\n}\n\n// Forward-declare the serialization objects\nnamespace gapi {\nnamespace s11n {\n    struct IIStream;\n    struct IOStream;\n} // namespace s11n\n} // namespace gapi\n\n/**\n * \\addtogroup gapi_main_classes\n * @{\n *\n * @brief G-API classes for constructed and compiled graphs.\n */\n/**\n * @brief GComputation class represents a captured computation\n * graph. GComputation objects form boundaries for expression code\n * user writes with G-API, allowing to compile and execute it.\n *\n * G-API computations are defined with input/output data\n * objects. G-API will track automatically which operations connect\n * specified outputs to the inputs, forming up a call graph to be\n * executed. The below example expresses calculation of Sobel operator\n * for edge detection (\\f$G = \\sqrt{G_x^2 + G_y^2}\\f$):\n *\n * @snippet modules/gapi/samples/api_ref_snippets.cpp graph_def\n *\n * Full pipeline can be now captured with this object declaration:\n *\n * @snippet modules/gapi/samples/api_ref_snippets.cpp graph_cap_full\n *\n * Input/output data objects on which a call graph should be\n * reconstructed are passed using special wrappers cv::GIn and\n * cv::GOut. G-API will track automatically which operations form a\n * path from inputs to outputs and build the execution graph appropriately.\n *\n * Note that cv::GComputation doesn't take ownership on data objects\n * it is defined. Moreover, multiple GComputation objects may be\n * defined on the same expressions, e.g. a smaller pipeline which\n * expects that image gradients are already pre-calculated may be\n * defined like this:\n *\n * @snippet modules/gapi/samples/api_ref_snippets.cpp graph_cap_sub\n *\n * The resulting graph would expect two inputs and produce one\n * output. In this case, it doesn't matter if gx/gy data objects are\n * results of cv::gapi::Sobel operators -- G-API will stop unrolling\n * expressions and building the underlying graph one reaching this\n * data objects.\n *\n * The way how GComputation is defined is important as its definition\n * specifies graph _protocol_ -- the way how the graph should be\n * used. Protocol is defined by number of inputs, number of outputs,\n * and shapes of inputs and outputs.\n *\n * In the above example, sobelEdge expects one Mat on input and\n * produces one Mat; while sobelEdgeSub expects two Mats on input and\n * produces one Mat. GComputation's protocol defines how other\n * computation methods should be used -- cv::GComputation::compile() and\n * cv::GComputation::apply(). For example, if a graph is defined on\n * two GMat inputs, two cv::Mat objects have to be passed to apply()\n * for execution. GComputation checks protocol correctness in runtime\n * so passing a different number of objects in apply() or passing\n * cv::Scalar instead of cv::Mat there would compile well as a C++\n * source but raise an exception in run-time. G-API also comes with a\n * typed wrapper cv::GComputationT<> which introduces this type-checking in\n * compile-time.\n *\n * cv::GComputation itself is a thin object which just captures what\n * the graph is. The compiled graph (which actually process data) is\n * represented by class GCompiled. Use compile() method to generate a\n * compiled graph with given compile options. cv::GComputation can\n * also be used to process data with implicit graph compilation\n * on-the-fly, see apply() for details.\n *\n * GComputation is a reference-counted object -- once defined, all its\n * copies will refer to the same instance.\n *\n * @sa GCompiled\n */\nclass GAPI_EXPORTS_W GComputation\n{\npublic:\n    class Priv;\n    typedef std::function<GComputation()> Generator;\n\n    // Various constructors enable different ways to define a computation: /////\n    // 1. Generic constructors\n    /**\n     * @brief Define a computation using a generator function.\n     *\n     * Graph can be defined in-place directly at the moment of its\n     * construction with a lambda:\n     *\n     * @snippet modules/gapi/samples/api_ref_snippets.cpp graph_gen\n     *\n     * This may be useful since all temporary objects (cv::GMats) and\n     * namespaces can be localized to scope of lambda, without\n     * contaminating the parent scope with probably unnecessary objects\n     * and information.\n     *\n     * @param gen generator function which returns a cv::GComputation,\n     * see Generator.\n     */\n    GComputation(const Generator& gen);                // Generator\n                                                       // overload\n\n    /**\n     * @brief Generic GComputation constructor.\n     *\n     * Constructs a new graph with a given protocol, specified as a\n     * flow of operations connecting input/output objects. Throws if\n     * the passed boundaries are invalid, e.g. if there's no\n     * functional dependency (path) between given outputs and inputs.\n     *\n     * @param ins Input data vector.\n     * @param outs Output data vector.\n     *\n     * @note Don't construct GProtoInputArgs/GProtoOutputArgs objects\n     * directly, use cv::GIn()/cv::GOut() wrapper functions instead.\n     *\n     * @sa @ref gapi_data_objects\n     */\n    GAPI_WRAP GComputation(GProtoInputArgs &&ins,\n                           GProtoOutputArgs &&outs);             // Arg-to-arg overload\n\n    // 2. Syntax sugar and compatibility overloads\n    /**\n     * @brief Defines an unary (one input -- one output) computation\n     *\n     * @overload\n     * @param in input GMat of the defined unary computation\n     * @param out output GMat of the defined unary computation\n     */\n    GAPI_WRAP GComputation(GMat in, GMat out);  // Unary overload\n\n    /**\n     * @brief Defines an unary (one input -- one output) computation\n     *\n     * @overload\n     * @param in input GMat of the defined unary computation\n     * @param out output GScalar of the defined unary computation\n     */\n    GAPI_WRAP GComputation(GMat in, GScalar out);      // Unary overload (scalar)\n\n    /**\n     * @brief Defines a binary (two inputs -- one output) computation\n     *\n     * @overload\n     * @param in1 first input GMat of the defined binary computation\n     * @param in2 second input GMat of the defined binary computation\n     * @param out output GMat of the defined binary computation\n     */\n    GAPI_WRAP GComputation(GMat in1, GMat in2, GMat out);        // Binary overload\n\n    /**\n     * @brief Defines a binary (two inputs -- one output) computation\n     *\n     * @overload\n     * @param in1 first input GMat of the defined binary computation\n     * @param in2 second input GMat of the defined binary computation\n     * @param out output GScalar of the defined binary computation\n     */\n    GComputation(GMat in1, GMat in2, GScalar out);     // Binary\n                                                       // overload\n                                                       // (scalar)\n\n    /**\n     * @brief Defines a computation with arbitrary input/output number.\n     *\n     * @overload\n     * @param ins vector of inputs GMats for this computation\n     * @param outs vector of outputs GMats for this computation\n     *\n     * Use this overload for cases when number of computation\n     * inputs/outputs is not known in compile-time -- e.g. when graph\n     * is programmatically generated to build an image pyramid with\n     * the given number of levels, etc.\n     */\n    GComputation(const std::vector<GMat> &ins,         // Compatibility overload\n                 const std::vector<GMat> &outs);\n\n    // Various versions of apply(): ////////////////////////////////////////////\n    // 1. Generic apply()\n    /**\n     * @brief Compile graph on-the-fly and immediately execute it on\n     * the inputs data vectors.\n     *\n     * Number of input/output data objects must match GComputation's\n     * protocol, also types of host data objects (cv::Mat, cv::Scalar)\n     * must match the shapes of data objects from protocol (cv::GMat,\n     * cv::GScalar). If there's a mismatch, a run-time exception will\n     * be generated.\n     *\n     * Internally, a cv::GCompiled object is created for the given\n     * input format configuration, which then is executed on the input\n     * data immediately. cv::GComputation caches compiled objects\n     * produced within apply() -- if this method would be called next\n     * time with the same input parameters (image formats, image\n     * resolution, etc), the underlying compiled graph will be reused\n     * without recompilation. If new metadata doesn't match the cached\n     * one, the underlying compiled graph is regenerated.\n     *\n     * @note compile() always triggers a compilation process and\n     * produces a new GCompiled object regardless if a similar one has\n     * been cached via apply() or not.\n     *\n     * @param ins vector of input data to process. Don't create\n     * GRunArgs object manually, use cv::gin() wrapper instead.\n     * @param outs vector of output data to fill results in. cv::Mat\n     * objects may be empty in this vector, G-API will automatically\n     * initialize it with the required format & dimensions. Don't\n     * create GRunArgsP object manually, use cv::gout() wrapper instead.\n     * @param args a list of compilation arguments to pass to the\n     * underlying compilation process. Don't create GCompileArgs\n     * object manually, use cv::compile_args() wrapper instead.\n     *\n     * @sa @ref gapi_data_objects, @ref gapi_compile_args\n     */\n    void apply(GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args = {});       // Arg-to-arg overload\n\n    /// @private -- Exclude this function from OpenCV documentation\n    GAPI_WRAP GRunArgs apply(const cv::detail::ExtractArgsCallback  &callback,\n                                   GCompileArgs                    &&args = {});\n\n    /// @private -- Exclude this function from OpenCV documentation\n    void apply(const std::vector<cv::Mat>& ins,                                   // Compatibility overload\n               const std::vector<cv::Mat>& outs,\n               GCompileArgs &&args = {});\n\n    // 2. Syntax sugar and compatibility overloads\n#if !defined(GAPI_STANDALONE)\n    /**\n     * @brief Execute an unary computation (with compilation on the fly)\n     *\n     * @overload\n     * @param in input cv::Mat for unary computation\n     * @param out output cv::Mat for unary computation\n     * @param args compilation arguments for underlying compilation\n     * process.\n     */\n    void apply(cv::Mat in, cv::Mat &out, GCompileArgs &&args = {}); // Unary overload\n\n    /**\n     * @brief Execute an unary computation (with compilation on the fly)\n     *\n     * @overload\n     * @param in input cv::Mat for unary computation\n     * @param out output cv::Scalar for unary computation\n     * @param args compilation arguments for underlying compilation\n     * process.\n     */\n    void apply(cv::Mat in, cv::Scalar &out, GCompileArgs &&args = {}); // Unary overload (scalar)\n\n    /**\n     * @brief Execute a binary computation (with compilation on the fly)\n     *\n     * @overload\n     * @param in1 first input cv::Mat for binary computation\n     * @param in2 second input cv::Mat for binary computation\n     * @param out output cv::Mat for binary computation\n     * @param args compilation arguments for underlying compilation\n     * process.\n     */\n    void apply(cv::Mat in1, cv::Mat in2, cv::Mat &out, GCompileArgs &&args = {}); // Binary overload\n\n    /**\n     * @brief Execute an binary computation (with compilation on the fly)\n     *\n     * @overload\n     * @param in1 first input cv::Mat for binary computation\n     * @param in2 second input cv::Mat for binary computation\n     * @param out output cv::Scalar for binary computation\n     * @param args compilation arguments for underlying compilation\n     * process.\n     */\n    void apply(cv::Mat in1, cv::Mat in2, cv::Scalar &out, GCompileArgs &&args = {}); // Binary overload (scalar)\n\n    /**\n     * @brief Execute a computation with arbitrary number of\n     * inputs/outputs (with compilation on-the-fly).\n     *\n     * @overload\n     * @param ins vector of input cv::Mat objects to process by the\n     * computation.\n     * @param outs vector of output cv::Mat objects to produce by the\n     * computation.\n     * @param args compilation arguments for underlying compilation\n     * process.\n     *\n     * Numbers of elements in ins/outs vectors must match numbers of\n     * inputs/outputs which were used to define this GComputation.\n     */\n    void apply(const std::vector<cv::Mat>& ins,         // Compatibility overload\n                     std::vector<cv::Mat>& outs,\n               GCompileArgs &&args = {});\n#endif // !defined(GAPI_STANDALONE)\n    // Various versions of compile(): //////////////////////////////////////////\n    // 1. Generic compile() - requires metas to be passed as vector\n    /**\n     * @brief Compile the computation for specific input format(s).\n     *\n     * This method triggers compilation process and produces a new\n     * GCompiled object which then can process data of the given\n     * format. Passing data with different format to the compiled\n     * computation will generate a run-time exception.\n     *\n     * @param in_metas vector of input metadata configuration. Grab\n     * metadata from real data objects (like cv::Mat or cv::Scalar)\n     * using cv::descr_of(), or create it on your own.\n     * @param args compilation arguments for this compilation\n     * process. Compilation arguments directly affect what kind of\n     * executable object would be produced, e.g. which kernels (and\n     * thus, devices) would be used to execute computation.\n     *\n     * @return GCompiled, an executable computation compiled\n     * specifically for the given input parameters.\n     *\n     * @sa @ref gapi_compile_args\n     */\n    GCompiled compile(GMetaArgs &&in_metas, GCompileArgs &&args = {});\n\n    // 2. Syntax sugar - variadic list of metas, no extra compile args\n    // FIXME: SFINAE looks ugly in the generated documentation\n    /**\n     * @overload\n     *\n     * Takes a variadic parameter pack with metadata\n     * descriptors for which a compiled object needs to be produced.\n     *\n     * @return GCompiled, an executable computation compiled\n     * specifically for the given input parameters.\n     */\n    template<typename... Ts>\n    auto compile(const Ts&... metas) ->\n        typename std::enable_if<detail::are_meta_descrs<Ts...>::value, GCompiled>::type\n    {\n        return compile(GMetaArgs{GMetaArg(metas)...}, GCompileArgs());\n    }\n\n    // 3. Syntax sugar - variadic list of metas, extra compile args\n    // (seems optional parameters don't work well when there's an variadic template\n    // comes first)\n    //\n    // Ideally it should look like:\n    //\n    //     template<typename... Ts>\n    //     GCompiled compile(const Ts&... metas, GCompileArgs &&args)\n    //\n    // But not all compilers can handle this (and seems they shouldn't be able to).\n    // FIXME: SFINAE looks ugly in the generated documentation\n    /**\n     * @overload\n     *\n     * Takes a  variadic parameter pack with metadata\n     * descriptors for which a compiled object needs to be produced,\n     * followed by GCompileArgs object representing compilation\n     * arguments for this process.\n     *\n     * @return GCompiled, an executable computation compiled\n     * specifically for the given input parameters.\n     */\n    template<typename... Ts>\n    auto compile(const Ts&... meta_and_compile_args) ->\n        typename std::enable_if<detail::are_meta_descrs_but_last<Ts...>::value\n                                && std::is_same<GCompileArgs, detail::last_type_t<Ts...> >::value,\n                                GCompiled>::type\n    {\n        //FIXME: wrapping meta_and_compile_args into a tuple to unwrap them inside a helper function is the overkill\n        return compile(std::make_tuple(meta_and_compile_args...),\n                       typename detail::MkSeq<sizeof...(Ts)-1>::type());\n    }\n\n\n    // FIXME: Document properly in the Doxygen format\n    // Video-oriented pipeline compilation:\n    // 1. A generic version\n    /**\n     * @brief Compile the computation for streaming mode.\n     *\n     * This method triggers compilation process and produces a new\n     * GStreamingCompiled object which then can process video stream\n     * data of the given format. Passing a stream in a different\n     * format to the compiled computation will generate a run-time\n     * exception.\n     *\n     * @param in_metas vector of input metadata configuration. Grab\n     * metadata from real data objects (like cv::Mat or cv::Scalar)\n     * using cv::descr_of(), or create it on your own.\n     *\n     * @param args compilation arguments for this compilation\n     * process. Compilation arguments directly affect what kind of\n     * executable object would be produced, e.g. which kernels (and\n     * thus, devices) would be used to execute computation.\n     *\n     * @return GStreamingCompiled, a streaming-oriented executable\n     * computation compiled specifically for the given input\n     * parameters.\n     *\n     * @sa @ref gapi_compile_args\n     */\n    GStreamingCompiled compileStreaming(GMetaArgs &&in_metas, GCompileArgs &&args = {});\n\n    /// @private -- Exclude this function from OpenCV documentation\n    GAPI_WRAP GStreamingCompiled compileStreaming(const cv::detail::ExtractMetaCallback &callback,\n                                                        GCompileArgs                   &&args = {});\n\n    /**\n     * @brief Compile the computation for streaming mode.\n     *\n     * This method triggers compilation process and produces a new\n     * GStreamingCompiled object which then can process video stream\n     * data in any format. Underlying mechanisms will be adjusted to\n     * every new input video stream automatically, but please note that\n     * _not all_ existing backends support this (see reshape()).\n     *\n     * @param args compilation arguments for this compilation\n     * process. Compilation arguments directly affect what kind of\n     * executable object would be produced, e.g. which kernels (and\n     * thus, devices) would be used to execute computation.\n     *\n     * @return GStreamingCompiled, a streaming-oriented executable\n     * computation compiled for any input image format.\n     *\n     * @sa @ref gapi_compile_args\n     */\n    GAPI_WRAP GStreamingCompiled compileStreaming(GCompileArgs &&args = {});\n\n    // 2. Direct metadata version\n    /**\n     * @overload\n     *\n     * Takes a variadic parameter pack with metadata\n     * descriptors for which a compiled object needs to be produced.\n     *\n     * @return GStreamingCompiled, a streaming-oriented executable\n     * computation compiled specifically for the given input\n     * parameters.\n     */\n    template<typename... Ts>\n    auto compileStreaming(const Ts&... metas) ->\n        typename std::enable_if<detail::are_meta_descrs<Ts...>::value, GStreamingCompiled>::type\n    {\n        return compileStreaming(GMetaArgs{GMetaArg(metas)...}, GCompileArgs());\n    }\n\n    // 2. Direct metadata + compile arguments version\n    /**\n     * @overload\n     *\n     * Takes a  variadic parameter pack with metadata\n     * descriptors for which a compiled object needs to be produced,\n     * followed by GCompileArgs object representing compilation\n     * arguments for this process.\n     *\n     * @return GStreamingCompiled, a streaming-oriented executable\n     * computation compiled specifically for the given input\n     * parameters.\n     */\n    template<typename... Ts>\n    auto compileStreaming(const Ts&... meta_and_compile_args) ->\n        typename std::enable_if<detail::are_meta_descrs_but_last<Ts...>::value\n                                && std::is_same<GCompileArgs, detail::last_type_t<Ts...> >::value,\n                                GStreamingCompiled>::type\n    {\n        //FIXME: wrapping meta_and_compile_args into a tuple to unwrap them inside a helper function is the overkill\n        return compileStreaming(std::make_tuple(meta_and_compile_args...),\n                                typename detail::MkSeq<sizeof...(Ts)-1>::type());\n    }\n\n    // Internal use only\n    /// @private\n    Priv& priv();\n    /// @private\n    const Priv& priv() const;\n    /// @private\n    explicit GComputation(cv::gapi::s11n::IIStream &);\n    /// @private\n    void serialize(cv::gapi::s11n::IOStream &) const;\n\nprotected:\n\n    // 4. Helper methods for (3)\n    /// @private\n    template<typename... Ts, int... IIs>\n    GCompiled compile(const std::tuple<Ts...> &meta_and_compile_args, detail::Seq<IIs...>)\n    {\n        GMetaArgs meta_args = {GMetaArg(std::get<IIs>(meta_and_compile_args))...};\n        GCompileArgs comp_args = std::get<sizeof...(Ts)-1>(meta_and_compile_args);\n        return compile(std::move(meta_args), std::move(comp_args));\n    }\n    template<typename... Ts, int... IIs>\n    GStreamingCompiled compileStreaming(const std::tuple<Ts...> &meta_and_compile_args, detail::Seq<IIs...>)\n    {\n        GMetaArgs meta_args = {GMetaArg(std::get<IIs>(meta_and_compile_args))...};\n        GCompileArgs comp_args = std::get<sizeof...(Ts)-1>(meta_and_compile_args);\n        return compileStreaming(std::move(meta_args), std::move(comp_args));\n    }\n    void recompile(GMetaArgs&& in_metas, GCompileArgs &&args);\n    /// @private\n    std::shared_ptr<Priv> m_priv;\n};\n/** @} */\n\nnamespace gapi\n{\n    // FIXME: all these standalone functions need to be added to some\n    // common documentation section\n    /**\n     * @brief Define an tagged island (subgraph) within a computation.\n     *\n     * Declare an Island tagged with `name` and defined from `ins` to `outs`\n     * (exclusively, as ins/outs are data objects, and regioning is done on\n     * operations level).\n     * Throws if any operation between `ins` and `outs` are already assigned\n     * to another island.\n     *\n     * Islands allow to partition graph into subgraphs, fine-tuning\n     * the way it is scheduled by the underlying executor.\n     *\n     * @param name name of the Island to create\n     * @param ins vector of input data objects where the subgraph\n     * begins\n     * @param outs vector of output data objects where the subgraph\n     * ends.\n     *\n     * The way how an island is defined is similar to how\n     * cv::GComputation is defined on input/output data objects.\n     * Same rules apply here as well -- if there's no functional\n     * dependency between inputs and outputs or there's not enough\n     * input data objects were specified to properly calculate all\n     * outputs, an exception is thrown.\n     *\n     * Use cv::GIn() / cv::GOut() to specify input/output vectors.\n     */\n    void GAPI_EXPORTS island(const std::string &name,\n                             GProtoInputArgs  &&ins,\n                             GProtoOutputArgs &&outs);\n} // namespace gapi\n\n} // namespace cv\n#endif // OPENCV_GAPI_GCOMPUTATION_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gcomputation_async.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n\n#ifndef OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP\n#define OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP\n\n\n#include <future>                           //for std::future\n#include <exception>                        //for std::exception_ptr\n#include <functional>                       //for std::function\n#include <opencv2/gapi/garg.hpp>            //for GRunArgs, GRunArgsP\n#include <opencv2/gapi/gcommon.hpp>         //for GCompileArgs\n#include <opencv2/gapi/own/exports.hpp>\n\n\nnamespace cv {\n    //fwd declaration\n    class GComputation;\nnamespace gapi {\nnamespace wip  {\n    class GAsyncContext;\n    /** In contrast to async() functions, these do call GComputation::apply() member function of the GComputation passed in.\n\n    @param gcomp        Computation (graph) to run asynchronously\n    @param callback     Callback to be called when execution of gcomp is done\n    @param ins          Input parameters for gcomp\n    @param outs         Output parameters for gcomp\n    @param args         Compile arguments to pass to GComputation::apply()\n    @see                async\n    */\n    GAPI_EXPORTS void                async_apply(GComputation& gcomp, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args = {});\n    /** @overload\n    @param gcomp        Computation (graph) to run asynchronously\n    @param callback     Callback to be called when execution of gcomp is done\n    @param ins          Input parameters for gcomp\n    @param outs         Output parameters for gcomp\n    @param args         Compile arguments to pass to GComputation::apply()\n    @param ctx          Context this request belongs to\n    @see                async_apply async GAsyncContext\n    */\n    GAPI_EXPORTS void                async_apply(GComputation& gcomp, std::function<void(std::exception_ptr)>&& callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args, GAsyncContext& ctx);\n    /** @overload\n    @param gcomp        Computation (graph) to run asynchronously\n    @param ins          Input parameters for gcomp\n    @param outs         Output parameters for gcomp\n    @param args         Compile arguments to pass to GComputation::apply()\n    @return             std::future<void> object to wait for completion of async operation\n    @see                async_apply async\n    */\n    GAPI_EXPORTS std::future<void>   async_apply(GComputation& gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args = {});\n    /** @overload\n    @param gcomp        Computation (graph) to run asynchronously\n    @param ins          Input parameters for gcomp\n    @param outs         Output parameters for gcomp\n    @param args         Compile arguments to pass to GComputation::apply()\n    @param ctx          Context this request belongs to\n    @return             std::future<void> object to wait for completion of async operation\n    @see                async_apply async GAsyncContext\n    */\n    GAPI_EXPORTS std::future<void>   async_apply(GComputation& gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args,  GAsyncContext& ctx);\n} // namespace wip\n} // namespace gapi\n} // namespace cv\n\n\n#endif //OPENCV_GAPI_GCOMPUTATION_ASYNC_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gframe.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GFRAME_HPP\n#define OPENCV_GAPI_GFRAME_HPP\n\n#include <ostream>\n#include <memory>                 // std::shared_ptr\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/gcommon.hpp> // GShape\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/own/assert.hpp>\n\n// TODO GAPI_EXPORTS or so\nnamespace cv\n{\n// Forward declaration; GNode and GOrigin are an internal\n// (user-inaccessible) classes.\nclass GNode;\nstruct GOrigin;\n\n/** \\addtogroup gapi_data_objects\n * @{\n */\n/**\n * @brief GFrame class represents an image or media frame in the graph.\n *\n * GFrame doesn't store any data itself, instead it describes a\n * functional relationship between operations consuming and producing\n * GFrame objects.\n *\n * GFrame is introduced to handle various media formats (e.g., NV12 or\n * I420) under the same type. Various image formats may differ in the\n * number of planes (e.g. two for NV12, three for I420) and the pixel\n * layout inside. GFrame type allows to handle these media formats in\n * the graph uniformly -- the graph structure will not change if the\n * media format changes, e.g. a different camera or decoder is used\n * with the same graph. G-API provides a number of operations which\n * operate directly on GFrame, like `infer<>()` or\n * renderFrame(); these operations are expected to handle different\n * media formats inside. There is also a number of accessor\n * operations like BGR(), Y(), UV() -- these operations provide\n * access to frame's data in the familiar cv::GMat form, which can be\n * used with the majority of the existing G-API operations. These\n * accessor functions may perform color space converion on the fly if\n * the image format of the GFrame they are applied to differs from the\n * operation's semantic (e.g. the BGR() accessor is called on an NV12\n * image frame).\n *\n * GFrame is a virtual counterpart of cv::MediaFrame.\n *\n * @sa cv::MediaFrame, cv::GFrameDesc, BGR(), Y(), UV(), infer<>().\n */\nclass GAPI_EXPORTS_W_SIMPLE GFrame\n{\npublic:\n    /**\n     * @brief Constructs an empty GFrame\n     *\n     * Normally, empty G-API data objects denote a starting point of\n     * the graph. When an empty GFrame is assigned to a result of some\n     * operation, it obtains a functional link to this operation (and\n     * is not empty anymore).\n     */\n    GAPI_WRAP GFrame();                      // Empty constructor\n\n    /// @private\n    GFrame(const GNode &n, std::size_t out); // Operation result constructor\n    /// @private\n    GOrigin& priv();                         // Internal use only\n    /// @private\n    const GOrigin& priv()  const;            // Internal use only\n\nprivate:\n    std::shared_ptr<GOrigin> m_priv;\n};\n/** @} */\n\nenum class MediaFormat: int\n{\n    BGR = 0,\n    NV12,\n};\n\n/**\n * \\addtogroup gapi_meta_args\n * @{\n */\nstruct GAPI_EXPORTS GFrameDesc\n{\n    MediaFormat fmt;\n    cv::Size size;\n\n    bool operator== (const GFrameDesc &) const;\n};\nstatic inline GFrameDesc empty_gframe_desc() { return GFrameDesc{}; }\n/** @} */\n\nclass MediaFrame;\nGAPI_EXPORTS GFrameDesc descr_of(const MediaFrame &frame);\n\nGAPI_EXPORTS std::ostream& operator<<(std::ostream& os, const cv::GFrameDesc &desc);\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GFRAME_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gkernel.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2021 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GKERNEL_HPP\n#define OPENCV_GAPI_GKERNEL_HPP\n\n#include <functional>\n#include <iostream>\n#include <string>  // string\n#include <type_traits> // false_type, true_type\n#include <unordered_map> // map (for GKernelPackage)\n#include <utility> // tuple\n\n#include <opencv2/gapi/gcommon.hpp> // CompileArgTag\n#include <opencv2/gapi/util/util.hpp> // Seq\n#include <opencv2/gapi/gcall.hpp>\n#include <opencv2/gapi/garg.hpp>      // GArg\n#include <opencv2/gapi/gmetaarg.hpp>  // GMetaArg\n#include <opencv2/gapi/gtype_traits.hpp> // GTypeTraits\n#include <opencv2/gapi/util/compiler_hints.hpp> //suppress_unused_warning\n#include <opencv2/gapi/gtransform.hpp>\n\nnamespace cv {\n\nstruct GTypeInfo\n{\n    GShape                 shape;\n    cv::detail::OpaqueKind kind;\n    detail::HostCtor       ctor;\n};\n\nusing GShapes    = std::vector<GShape>;\nusing GKinds     = std::vector<cv::detail::OpaqueKind>;\nusing GCtors     = std::vector<detail::HostCtor>;\nusing GTypesInfo = std::vector<GTypeInfo>;\n\n// GKernel describes kernel API to the system\n// FIXME: add attributes of a kernel, (e.g. number and types\n// of inputs, etc)\nstruct GAPI_EXPORTS GKernel\n{\n    using M = std::function<GMetaArgs(const GMetaArgs &, const GArgs &)>;\n\n    std::string name;       // kernel ID, defined by its API (signature)\n    std::string tag;        // some (implementation-specific) tag\n    M           outMeta;    // generic adaptor to API::outMeta(...)\n    GShapes     outShapes;  // types (shapes) kernel's outputs\n    GKinds      inKinds;    // kinds of kernel's inputs (fixme: below)\n    GCtors      outCtors;   // captured constructors for template output types\n};\n// TODO: It's questionable if inKinds should really be here. Instead,\n// this information could come from meta.\n\n// GKernelImpl describes particular kernel implementation to the system\nstruct GAPI_EXPORTS GKernelImpl\n{\n    util::any         opaque;    // backend-specific opaque info\n    GKernel::M        outMeta;   // for deserialized graphs, the outMeta is taken here\n};\n\ntemplate<typename, typename> class GKernelTypeM;\n\nnamespace detail\n{\n    ////////////////////////////////////////////////////////////////////////////\n    // yield() is used in graph construction time as a generic method to obtain\n    // lazy \"return value\" of G-API operations\n    //\n    template<typename T> struct Yield;\n    template<> struct Yield<cv::GMat>\n    {\n        static inline cv::GMat yield(cv::GCall &call, int i) { return call.yield(i); }\n    };\n    template<> struct Yield<cv::GMatP>\n    {\n        static inline cv::GMatP yield(cv::GCall &call, int i) { return call.yieldP(i); }\n    };\n    template<> struct Yield<cv::GScalar>\n    {\n        static inline cv::GScalar yield(cv::GCall &call, int i) { return call.yieldScalar(i); }\n    };\n    template<typename U> struct Yield<cv::GArray<U> >\n    {\n        static inline cv::GArray<U> yield(cv::GCall &call, int i) { return call.yieldArray<U>(i); }\n    };\n    template<typename U> struct Yield<cv::GOpaque<U> >\n    {\n        static inline cv::GOpaque<U> yield(cv::GCall &call, int i) { return call.yieldOpaque<U>(i); }\n    };\n    template<> struct Yield<GFrame>\n    {\n        static inline cv::GFrame yield(cv::GCall &call, int i) { return call.yieldFrame(i); }\n    };\n\n    ////////////////////////////////////////////////////////////////////////////\n    // Helper classes which brings outputMeta() marshalling to kernel\n    // implementations\n    //\n    // 1. MetaType establishes G#Type -> G#Meta mapping between G-API dynamic\n    //    types and its metadata descriptor types.\n    //    This mapping is used to transform types to call outMeta() callback.\n    template<typename T> struct MetaType;\n    template<> struct MetaType<cv::GMat>    { using type = GMatDesc; };\n    template<> struct MetaType<cv::GMatP>   { using type = GMatDesc; };\n    template<> struct MetaType<cv::GFrame>  { using type = GFrameDesc; };\n    template<> struct MetaType<cv::GScalar> { using type = GScalarDesc; };\n    template<typename U> struct MetaType<cv::GArray<U> >  { using type = GArrayDesc; };\n    template<typename U> struct MetaType<cv::GOpaque<U> > { using type = GOpaqueDesc; };\n    template<typename T> struct MetaType    { using type = T; }; // opaque args passed as-is\n    // FIXME: Move it to type traits?\n\n    // 2. Hacky test based on MetaType to check if we operate on G-* type or not\n    template<typename T> using is_nongapi_type = std::is_same<T, typename MetaType<T>::type>;\n\n    // 3. Two ways to transform input arguments to its meta - for G-* and non-G* types:\n    template<typename T>\n    typename std::enable_if<!is_nongapi_type<T>::value, typename MetaType<T>::type>\n    ::type get_in_meta(const GMetaArgs &in_meta, const GArgs &, int idx)\n    {\n        return util::get<typename MetaType<T>::type>(in_meta.at(idx));\n    }\n\n    template<typename T>\n    typename std::enable_if<is_nongapi_type<T>::value, T>\n    ::type get_in_meta(const GMetaArgs &, const GArgs &in_args, int idx)\n    {\n        return in_args.at(idx).template get<T>();\n    }\n\n    // 4. The MetaHelper itself: an entity which generates outMeta() call\n    //    based on kernel signature, with arguments properly substituted.\n    // 4.1 - case for multiple return values\n    // FIXME: probably can be simplified with std::apply or analogue.\n    template<typename, typename, typename>\n    struct MetaHelper;\n\n    template<typename K, typename... Ins, typename... Outs>\n    struct MetaHelper<K, std::tuple<Ins...>, std::tuple<Outs...> >\n    {\n        template<int... IIs, int... OIs>\n        static GMetaArgs getOutMeta_impl(const GMetaArgs &in_meta,\n                                         const GArgs &in_args,\n                                         detail::Seq<IIs...>,\n                                         detail::Seq<OIs...>)\n        {\n            // FIXME: decay?\n            using R   = std::tuple<typename MetaType<Outs>::type...>;\n            const R r = K::outMeta( get_in_meta<Ins>(in_meta, in_args, IIs)... );\n            return GMetaArgs{ GMetaArg(std::get<OIs>(r))... };\n        }\n        // FIXME: help users identify how outMeta must look like (via default impl w/static_assert?)\n\n        static GMetaArgs getOutMeta(const GMetaArgs &in_meta,\n                                    const GArgs &in_args)\n        {\n            return getOutMeta_impl(in_meta,\n                                   in_args,\n                                   typename detail::MkSeq<sizeof...(Ins)>::type(),\n                                   typename detail::MkSeq<sizeof...(Outs)>::type());\n        }\n    };\n\n    // 4.1 - case for a single return value\n    // FIXME: How to avoid duplication here?\n    template<typename K, typename... Ins, typename Out>\n    struct MetaHelper<K, std::tuple<Ins...>, Out >\n    {\n        template<int... IIs>\n        static GMetaArgs getOutMeta_impl(const GMetaArgs &in_meta,\n                                         const GArgs &in_args,\n                                         detail::Seq<IIs...>)\n        {\n            // FIXME: decay?\n            using R = typename MetaType<Out>::type;\n            const R r = K::outMeta( get_in_meta<Ins>(in_meta, in_args, IIs)... );\n            return GMetaArgs{ GMetaArg(r) };\n        }\n        // FIXME: help users identify how outMeta must look like (via default impl w/static_assert?)\n\n        static GMetaArgs getOutMeta(const GMetaArgs &in_meta,\n                                    const GArgs &in_args)\n        {\n            return getOutMeta_impl(in_meta,\n                                   in_args,\n                                   typename detail::MkSeq<sizeof...(Ins)>::type());\n        }\n    };\n\n    ////////////////////////////////////////////////////////////////////////////\n    // Helper class to introduce tags to calls. By default there's no tag\n    struct NoTag {\n        static constexpr const char *tag() { return \"\"; }\n    };\n\n} // namespace detail\n\n// GKernelType and GKernelTypeM are base classes which implement typed ::on()\n// method based on kernel signature. GKernelTypeM stands for multiple-return-value kernels\n//\n// G_TYPED_KERNEL and G_TYPED_KERNEL_M macros inherit user classes from GKernelType and\n// GKernelTypeM respectively.\n\ntemplate<typename K, typename... R, typename... Args>\nclass GKernelTypeM<K, std::function<std::tuple<R...>(Args...)> >\n    : public detail::MetaHelper<K, std::tuple<Args...>, std::tuple<R...>>\n    , public detail::NoTag\n{\n    template<int... IIs>\n    static std::tuple<R...> yield(cv::GCall &call, detail::Seq<IIs...>)\n    {\n        return std::make_tuple(detail::Yield<R>::yield(call, IIs)...);\n    }\n\npublic:\n    using InArgs  = std::tuple<Args...>;\n    using OutArgs = std::tuple<R...>;\n\n    // TODO: Args&&... here?\n    static std::tuple<R...> on(Args... args)\n    {\n        cv::GCall call(GKernel{ K::id()\n                              , K::tag()\n                              , &K::getOutMeta\n                              , {detail::GTypeTraits<R>::shape...}\n                              , {detail::GTypeTraits<Args>::op_kind...}\n                              , {detail::GObtainCtor<R>::get()...}});\n        call.pass(args...); // TODO: std::forward() here?\n        return yield(call, typename detail::MkSeq<sizeof...(R)>::type());\n    }\n};\n\ntemplate<typename, typename> class GKernelType;\n\ntemplate<typename K, typename R, typename... Args>\nclass GKernelType<K, std::function<R(Args...)> >\n    : public detail::MetaHelper<K, std::tuple<Args...>, R>\n    , public detail::NoTag\n{\npublic:\n    using InArgs  = std::tuple<Args...>;\n    using OutArgs = std::tuple<R>;\n\n    static R on(Args... args)\n    {\n        cv::GCall call(GKernel{ K::id()\n                              , K::tag()\n                              , &K::getOutMeta\n                              , {detail::GTypeTraits<R>::shape}\n                              , {detail::GTypeTraits<Args>::op_kind...}\n                              , {detail::GObtainCtor<R>::get()}});\n        call.pass(args...);\n        return detail::Yield<R>::yield(call, 0);\n    }\n};\n\nnamespace detail {\n// This tiny class eliminates the semantic difference between\n// GKernelType and GKernelTypeM.\ntemplate<typename, typename> class KernelTypeMedium;\n\ntemplate<typename K, typename... R, typename... Args>\nclass KernelTypeMedium<K, std::function<std::tuple<R...>(Args...)>> :\n    public cv::GKernelTypeM<K, std::function<std::tuple<R...>(Args...)>> {};\n\ntemplate<typename K, typename R, typename... Args>\nclass KernelTypeMedium<K, std::function<R(Args...)>> :\n    public cv::GKernelType<K, std::function<R(Args...)>> {};\n} // namespace detail\n\n} // namespace cv\n\n\n// FIXME: I don't know a better way so far. Feel free to suggest one\n// The problem is that every typed kernel should have ::id() but body\n// of the class is defined by user (with outMeta, other stuff)\n\n//! @cond IGNORED\n#define G_ID_HELPER_CLASS(Class)  Class##IdHelper\n\n#define G_ID_HELPER_BODY(Class, Id)                                         \\\n    struct G_ID_HELPER_CLASS(Class)                                         \\\n    {                                                                       \\\n        static constexpr const char * id() {return Id;}                     \\\n    };                                                                      \\\n//! @endcond\n\n#define GET_G_TYPED_KERNEL(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, NAME, ...) NAME\n#define COMBINE_SIGNATURE(...) __VA_ARGS__\n// Ensure correct __VA_ARGS__ expansion on Windows\n#define __WRAP_VAARGS(x) x\n\n/**\n * Helper for G_TYPED_KERNEL declares a new G-API Operation. See [Kernel API](@ref gapi_kernel_api)\n * for more details.\n *\n * @param Class type name for this operation.\n * @param API an `std::function<>`-like signature for the operation;\n *        return type is a single value or a tuple of multiple values.\n * @param Id string identifier for the operation. Must be unique.\n */\n#define G_TYPED_KERNEL_HELPER(Class, API, Id)                                               \\\n    G_ID_HELPER_BODY(Class, Id)                                                             \\\n    struct Class final: public cv::detail::KernelTypeMedium<Class, std::function API >,     \\\n                        public G_ID_HELPER_CLASS(Class)\n// {body} is to be defined by user\n\n#define G_TYPED_KERNEL_HELPER_2(Class, _1, _2, Id) \\\nG_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2), Id)\n\n#define G_TYPED_KERNEL_HELPER_3(Class, _1, _2, _3, Id) \\\nG_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3), Id)\n\n#define G_TYPED_KERNEL_HELPER_4(Class, _1, _2, _3, _4, Id) \\\nG_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4), Id)\n\n#define G_TYPED_KERNEL_HELPER_5(Class, _1, _2, _3, _4, _5, Id) \\\nG_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5), Id)\n\n#define G_TYPED_KERNEL_HELPER_6(Class, _1, _2, _3, _4, _5, _6, Id) \\\nG_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5, _6), Id)\n\n#define G_TYPED_KERNEL_HELPER_7(Class, _1, _2, _3, _4, _5, _6, _7, Id) \\\nG_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5, _6, _7), Id)\n\n#define G_TYPED_KERNEL_HELPER_8(Class, _1, _2, _3, _4, _5, _6, _7, _8, Id) \\\nG_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5, _6, _7, _8), Id)\n\n#define G_TYPED_KERNEL_HELPER_9(Class, _1, _2, _3, _4, _5, _6, _7, _8, _9, Id) \\\nG_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5, _6, _7, _8, _9), Id)\n\n#define G_TYPED_KERNEL_HELPER_10(Class, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, Id) \\\nG_TYPED_KERNEL_HELPER(Class, COMBINE_SIGNATURE(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10), Id)\n\n/**\n * Declares a new G-API Operation. See [Kernel API](@ref gapi_kernel_api)\n * for more details.\n *\n * @param Class type name for this operation.\n */\n#define G_TYPED_KERNEL(Class, ...) __WRAP_VAARGS(GET_G_TYPED_KERNEL(__VA_ARGS__, \\\n                                                 G_TYPED_KERNEL_HELPER_10, \\\n                                                 G_TYPED_KERNEL_HELPER_9, \\\n                                                 G_TYPED_KERNEL_HELPER_8, \\\n                                                 G_TYPED_KERNEL_HELPER_7, \\\n                                                 G_TYPED_KERNEL_HELPER_6, \\\n                                                 G_TYPED_KERNEL_HELPER_5, \\\n                                                 G_TYPED_KERNEL_HELPER_4, \\\n                                                 G_TYPED_KERNEL_HELPER_3, \\\n                                                 G_TYPED_KERNEL_HELPER_2, \\\n                                                 G_TYPED_KERNEL_HELPER)(Class, __VA_ARGS__)) \\\n\n/**\n * Declares a new G-API Operation. See [Kernel API](@ref gapi_kernel_api) for more details.\n *\n * @deprecated This macro is deprecated in favor of `G_TYPED_KERNEL` that is used for declaring any\n * G-API Operation.\n *\n * @param Class type name for this operation.\n */\n#define G_TYPED_KERNEL_M G_TYPED_KERNEL\n\n#define G_API_OP   G_TYPED_KERNEL\n#define G_API_OP_M G_API_OP\n\nnamespace cv\n{\nnamespace gapi\n{\n    // Prework: model \"Device\" API before it gets to G-API headers.\n    // FIXME: Don't mix with internal Backends class!\n    /// @private\n    class GAPI_EXPORTS GBackend\n    {\n    public:\n        class Priv;\n\n        // TODO: make it template (call `new` within??)\n        GBackend();\n        explicit GBackend(std::shared_ptr<Priv> &&p);\n\n        Priv& priv();\n        const Priv& priv() const;\n        std::size_t hash() const;\n\n        bool operator== (const GBackend &rhs) const;\n\n    private:\n        std::shared_ptr<Priv> m_priv;\n    };\n\n    inline bool operator != (const GBackend &lhs, const GBackend &rhs)\n    {\n        return !(lhs == rhs);\n    }\n} // namespace gapi\n} // namespace cv\n\nnamespace std\n{\n    template<> struct hash<cv::gapi::GBackend>\n    {\n        std::size_t operator() (const cv::gapi::GBackend &b) const\n        {\n            return b.hash();\n        }\n    };\n} // namespace std\n\n\nnamespace cv {\nnamespace gapi {\n    /// @private\n    class GFunctor\n    {\n    public:\n        virtual cv::GKernelImpl impl()       const = 0;\n        virtual cv::gapi::GBackend backend() const = 0;\n        const char* id()                     const { return m_id; }\n\n        virtual ~GFunctor() = default;\n    protected:\n        GFunctor(const char* id) : m_id(id) { };\n    private:\n        const char* m_id;\n    };\n\n    /** \\addtogroup gapi_compile_args\n     * @{\n     */\n\n    // FIXME: Hide implementation\n    /**\n     * @brief A container class for heterogeneous kernel\n     * implementation collections and graph transformations.\n     *\n     * GKernelPackage is a special container class which stores kernel\n     * _implementations_ and graph _transformations_. Objects of this class\n     * are created and passed to cv::GComputation::compile() to specify\n     * which kernels to use and which transformations to apply in the\n     * compiled graph. GKernelPackage may contain kernels of\n     * different backends, e.g. be heterogeneous.\n     *\n     * The most easy way to create a kernel package is to use function\n     * cv::gapi::kernels(). This template functions takes kernel\n     * implementations in form of type list (variadic template) and\n     * generates a kernel package atop of that.\n     *\n     * Kernel packages can be also generated programmatically, starting\n     * with an empty package (created with the default constructor)\n     * and then by populating it with kernels via call to\n     * GKernelPackage::include(). Note this method is also a template\n     * one since G-API kernel and transformation implementations are _types_,\n     * not objects.\n     *\n     * Finally, two kernel packages can be combined into a new one\n     * with function cv::gapi::combine().\n     */\n    class GAPI_EXPORTS_W_SIMPLE GKernelPackage\n    {\n\n        /// @private\n        using M = std::unordered_map<std::string, std::pair<GBackend, GKernelImpl>>;\n\n        /// @private\n        M m_id_kernels;\n\n        /// @private\n        std::vector<GTransform> m_transformations;\n\n    protected:\n        /// @private\n        // Remove ALL implementations of the given API (identified by ID)\n        void removeAPI(const std::string &id);\n\n        /// @private\n        // Partial include() specialization for kernels\n        template <typename KImpl>\n        typename std::enable_if<(std::is_base_of<cv::detail::KernelTag, KImpl>::value), void>::type\n        includeHelper()\n        {\n            auto backend     = KImpl::backend();\n            auto kernel_id   = KImpl::API::id();\n            auto kernel_impl = GKernelImpl{KImpl::kernel(), &KImpl::API::getOutMeta};\n            removeAPI(kernel_id);\n\n            m_id_kernels[kernel_id] = std::make_pair(backend, kernel_impl);\n        }\n\n        /// @private\n        // Partial include() specialization for transformations\n        template <typename TImpl>\n        typename std::enable_if<(std::is_base_of<cv::detail::TransformTag, TImpl>::value), void>::type\n        includeHelper()\n        {\n            m_transformations.emplace_back(TImpl::transformation());\n        }\n\n    public:\n        void include(const GFunctor& functor)\n        {\n            m_id_kernels[functor.id()] = std::make_pair(functor.backend(), functor.impl());\n        }\n        /**\n         * @brief Returns total number of kernels\n         * in the package (across all backends included)\n         *\n         * @return a number of kernels in the package\n         */\n        std::size_t size() const;\n\n        /**\n         * @brief Returns vector of transformations included in the package\n         *\n         * @return vector of transformations included in the package\n         */\n        const std::vector<GTransform>& get_transformations() const;\n\n        /**\n         * @brief Returns vector of kernel ids included in the package\n         *\n         * @return vector of kernel ids included in the package\n         */\n        std::vector<std::string> get_kernel_ids() const;\n\n        /**\n         * @brief Test if a particular kernel _implementation_ KImpl is\n         * included in this kernel package.\n         *\n         * @sa includesAPI()\n         *\n         * @note cannot be applied to transformations\n         *\n         * @return true if there is such kernel, false otherwise.\n         */\n        template<typename KImpl>\n        bool includes() const\n        {\n            static_assert(std::is_base_of<cv::detail::KernelTag, KImpl>::value,\n                          \"includes() can be applied to kernels only\");\n\n            auto kernel_it = m_id_kernels.find(KImpl::API::id());\n            return kernel_it != m_id_kernels.end() &&\n                   kernel_it->second.first == KImpl::backend();\n        }\n\n        /**\n         * @brief Remove all kernels associated with the given backend\n         * from the package.\n         *\n         * Does nothing if there's no kernels of this backend in the package.\n         *\n         * @param backend backend which kernels to remove\n         */\n        void remove(const GBackend& backend);\n\n        /**\n         * @brief Remove all kernels implementing the given API from\n         * the package.\n         *\n         * Does nothing if there's no kernels implementing the given interface.\n         */\n        template<typename KAPI>\n        void remove()\n        {\n            removeAPI(KAPI::id());\n        }\n\n        // FIXME: Rename to includes() and distinguish API/impl case by\n        //     statically?\n        /**\n         * Check if package contains ANY implementation of a kernel API\n         * by API type.\n         */\n        template<typename KAPI>\n        bool includesAPI() const\n        {\n            return includesAPI(KAPI::id());\n        }\n\n        /// @private\n        bool includesAPI(const std::string &id) const;\n\n        // FIXME: The below comment is wrong, and who needs this function?\n        /**\n         * @brief Find a kernel (by its API)\n         *\n         * Returns implementation corresponding id.\n         * Throws if nothing found.\n         *\n         * @return Backend which hosts matching kernel implementation.\n         *\n         */\n        template<typename KAPI>\n        GBackend lookup() const\n        {\n            return lookup(KAPI::id()).first;\n        }\n\n        /// @private\n        std::pair<cv::gapi::GBackend, cv::GKernelImpl>\n        lookup(const std::string &id) const;\n\n        // FIXME: No overwrites allowed?\n        /**\n         * @brief Put a new kernel implementation or a new transformation\n         * KImpl into the package.\n         */\n        template<typename KImpl>\n        void include()\n        {\n            includeHelper<KImpl>();\n        }\n\n        /**\n         * @brief Adds a new kernel based on it's backend and id into the kernel package\n         *\n         * @param backend backend associated with the kernel\n         * @param kernel_id a name/id of the kernel\n         */\n        void include(const cv::gapi::GBackend& backend, const std::string& kernel_id)\n        {\n            removeAPI(kernel_id);\n            m_id_kernels[kernel_id] = std::make_pair(backend, GKernelImpl{{}, {}});\n        }\n\n        /**\n         * @brief Lists all backends which are included into package\n         *\n         * @return vector of backends\n         */\n        std::vector<GBackend> backends() const;\n\n        // TODO: Doxygen bug -- it wants me to place this comment\n        // here, not below.\n        /**\n         * @brief Create a new package based on `lhs` and `rhs`.\n         *\n         * @param lhs \"Left-hand-side\" package in the process\n         * @param rhs \"Right-hand-side\" package in the process\n         * @return a new kernel package.\n         */\n        friend GAPI_EXPORTS GKernelPackage combine(const GKernelPackage  &lhs,\n                                                   const GKernelPackage  &rhs);\n    };\n\n    /**\n     * @brief Create a kernel package object containing kernels\n     * and transformations specified in variadic template argument.\n     *\n     * In G-API, kernel implementations and transformations are _types_.\n     * Every backend has its own kernel API (like GAPI_OCV_KERNEL() and\n     * GAPI_FLUID_KERNEL()) but all of that APIs define a new type for\n     * each kernel implementation.\n     *\n     * Use this function to pass kernel implementations (defined in\n     * either way) and transformations to the system. Example:\n     *\n     * @snippet modules/gapi/samples/api_ref_snippets.cpp kernels_snippet\n     *\n     * Note that kernels() itself is a function returning object, not\n     * a type, so having `()` at the end is important -- it must be a\n     * function call.\n     */\n    template<typename... KK> GKernelPackage kernels()\n    {\n        // FIXME: currently there is no check that transformations' signatures are unique\n        // and won't be any intersection in graph compilation stage\n        static_assert(cv::detail::all_unique<typename KK::API...>::value, \"Kernels API must be unique\");\n\n        GKernelPackage pkg;\n\n        // For those who wonder - below is a trick to call a number of\n        // methods based on parameter pack (zeroes just help hiding these\n        // calls into a sequence which helps to expand this parameter pack).\n        // Just note that `f(),a` always equals to `a` (with f() called!)\n        // and parentheses are used to hide function call in the expanded sequence.\n        // Leading 0 helps to handle case when KK is an empty list (kernels<>()).\n        int unused[] = { 0, (pkg.include<KK>(), 0)... };\n        cv::util::suppress_unused_warning(unused);\n        return pkg;\n    };\n\n    template<typename... FF>\n    GKernelPackage kernels(FF&... functors)\n    {\n        GKernelPackage pkg;\n        int unused[] = { 0, (pkg.include(functors), 0)... };\n        cv::util::suppress_unused_warning(unused);\n        return pkg;\n    };\n\n    /** @} */\n\n    // FYI - this function is already commented above\n    GAPI_EXPORTS GKernelPackage combine(const GKernelPackage  &lhs,\n                                        const GKernelPackage  &rhs);\n\n    /**\n     * @brief Combines multiple G-API kernel packages into one\n     *\n     * @overload\n     *\n     * This function successively combines the passed kernel packages using a right fold.\n     * Calling `combine(a, b, c)` is equal to `combine(a, combine(b, c))`.\n     *\n     * @return The resulting kernel package\n     */\n    template<typename... Ps>\n    GKernelPackage combine(const GKernelPackage &a, const GKernelPackage &b, Ps&&... rest)\n    {\n        return combine(a, combine(b, rest...));\n    }\n\n    /** \\addtogroup gapi_compile_args\n     * @{\n     */\n    /**\n     * @brief cv::use_only() is a special combinator which hints G-API to use only\n     * kernels specified in cv::GComputation::compile() (and not to extend kernels available by\n     * default with that package).\n     */\n    struct GAPI_EXPORTS use_only\n    {\n        GKernelPackage pkg;\n    };\n    /** @} */\n\n} // namespace gapi\n\nnamespace detail\n{\n    template<> struct CompileArgTag<cv::gapi::GKernelPackage>\n    {\n        static const char* tag() { return \"gapi.kernel_package\"; }\n    };\n\n    template<> struct CompileArgTag<cv::gapi::use_only>\n    {\n        static const char* tag() { return \"gapi.use_only\"; }\n    };\n} // namespace detail\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GKERNEL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gmat.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GMAT_HPP\n#define OPENCV_GAPI_GMAT_HPP\n\n#include <ostream>\n#include <memory>                 // std::shared_ptr\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/gcommon.hpp> // GShape\n\n#include <opencv2/gapi/own/assert.hpp>\n\n// TODO GAPI_EXPORTS or so\nnamespace cv\n{\n// Forward declaration; GNode and GOrigin are an internal\n// (user-inaccessible) classes.\nclass GNode;\nstruct GOrigin;\n\n/** \\addtogroup gapi_data_objects\n * @{\n *\n * @brief G-API data objects used to build G-API expressions.\n *\n * These objects do not own any particular data (except compile-time\n * associated values like with cv::GScalar or `cv::GArray<T>`) and are\n * used only to construct graphs.\n *\n * Every graph in G-API starts and ends with data objects.\n *\n * Once constructed and compiled, G-API operates with regular host-side\n * data instead. Refer to the below table to find the mapping between\n * G-API and regular data types when passing input and output data\n * structures to G-API:\n *\n *    G-API data type    | I/O data type\n *    ------------------ | -------------\n *    cv::GMat           | cv::Mat, cv::UMat, cv::RMat\n *    cv::GScalar        | cv::Scalar\n *    `cv::GArray<T>`    | std::vector<T>\n *    `cv::GOpaque<T>`   | T\n *    cv::GFrame         | cv::MediaFrame\n */\n/**\n * @brief GMat class represents image or tensor data in the\n * graph.\n *\n * GMat doesn't store any data itself, instead it describes a\n * functional relationship between operations consuming and producing\n * GMat objects.\n *\n * GMat is a virtual counterpart of Mat and UMat, but it\n * doesn't mean G-API use Mat or UMat objects internally to represent\n * GMat objects -- the internal data representation may be\n * backend-specific or optimized out at all.\n *\n * @sa Mat, GMatDesc\n */\nclass GAPI_EXPORTS_W_SIMPLE GMat\n{\npublic:\n    /**\n     * @brief Constructs an empty GMat\n     *\n     * Normally, empty G-API data objects denote a starting point of\n     * the graph. When an empty GMat is assigned to a result of some\n     * operation, it obtains a functional link to this operation (and\n     * is not empty anymore).\n     */\n    GAPI_WRAP GMat();                       // Empty constructor\n\n    /// @private\n    GMat(const GNode &n, std::size_t out);  // Operation result constructor\n    /// @private\n    GOrigin& priv();                        // Internal use only\n    /// @private\n    const GOrigin& priv()  const;           // Internal use only\n\nprivate:\n    std::shared_ptr<GOrigin> m_priv;\n};\n\nclass GAPI_EXPORTS GMatP : public GMat\n{\npublic:\n    using GMat::GMat;\n};\n\nclass RMat;\n\n/** @} */\n\n/**\n * \\addtogroup gapi_meta_args\n * @{\n */\nstruct GAPI_EXPORTS_W_SIMPLE GMatDesc\n{\n    // FIXME: Default initializers in C++14\n    GAPI_PROP int depth;\n    GAPI_PROP int chan;\n    GAPI_PROP cv::Size size; // NB.: no multi-dimensional cases covered yet\n    GAPI_PROP bool planar;\n    GAPI_PROP std::vector<int> dims; // FIXME: Maybe it's real questionable to have it here\n\n    GAPI_WRAP GMatDesc(int d, int c, cv::Size s, bool p = false)\n        : depth(d), chan(c), size(s), planar(p) {}\n\n    GAPI_WRAP GMatDesc(int d, const std::vector<int> &dd)\n        : depth(d), chan(-1), size{-1,-1}, planar(false), dims(dd) {}\n\n    GAPI_WRAP GMatDesc(int d, std::vector<int> &&dd)\n        : depth(d), chan(-1), size{-1,-1}, planar(false), dims(std::move(dd)) {}\n\n    GAPI_WRAP GMatDesc() : GMatDesc(-1, -1, {-1,-1}) {}\n\n    inline bool operator== (const GMatDesc &rhs) const\n    {\n        return    depth  == rhs.depth\n               && chan   == rhs.chan\n               && size   == rhs.size\n               && planar == rhs.planar\n               && dims   == rhs.dims;\n    }\n\n    inline bool operator!= (const GMatDesc &rhs) const\n    {\n        return !(*this == rhs);\n    }\n\n    bool isND() const { return !dims.empty(); }\n\n    // Checks if the passed mat can be described by this descriptor\n    // (it handles the case when\n    // 1-channel mat can be reinterpreted as is (1-channel mat)\n    // and as a 3-channel planar mat with height divided by 3)\n    bool canDescribe(const cv::Mat& mat) const;\n\n    bool canDescribe(const cv::RMat& mat) const;\n\n    // Meta combinator: return a new GMatDesc which differs in size by delta\n    // (all other fields are taken unchanged from this GMatDesc)\n    // FIXME: a better name?\n    GAPI_WRAP GMatDesc withSizeDelta(cv::Size delta) const\n    {\n        GMatDesc desc(*this);\n        desc.size += delta;\n        return desc;\n    }\n    // Meta combinator: return a new GMatDesc which differs in size by delta\n    // (all other fields are taken unchanged from this GMatDesc)\n    //\n    // This is an overload.\n    GAPI_WRAP GMatDesc withSizeDelta(int dx, int dy) const\n    {\n        return withSizeDelta(cv::Size{dx,dy});\n    }\n\n    GAPI_WRAP GMatDesc withSize(cv::Size sz) const\n    {\n        GMatDesc desc(*this);\n        desc.size = sz;\n        return desc;\n    }\n\n    // Meta combinator: return a new GMatDesc with specified data depth.\n    // (all other fields are taken unchanged from this GMatDesc)\n    GAPI_WRAP GMatDesc withDepth(int ddepth) const\n    {\n        GAPI_Assert(CV_MAT_CN(ddepth) == 1 || ddepth == -1);\n        GMatDesc desc(*this);\n        if (ddepth != -1) desc.depth = ddepth;\n        return desc;\n    }\n\n    // Meta combinator: return a new GMatDesc with specified data depth\n    // and number of channels.\n    // (all other fields are taken unchanged from this GMatDesc)\n    GAPI_WRAP GMatDesc withType(int ddepth, int dchan) const\n    {\n        GAPI_Assert(CV_MAT_CN(ddepth) == 1 || ddepth == -1);\n        GMatDesc desc = withDepth(ddepth);\n        desc.chan = dchan;\n        return desc;\n    }\n\n    // Meta combinator: return a new GMatDesc with planar flag set\n    // (no size changes are performed, only channel interpretation is changed\n    // (interleaved -> planar)\n    GAPI_WRAP GMatDesc asPlanar() const\n    {\n        GAPI_Assert(planar == false);\n        GMatDesc desc(*this);\n        desc.planar = true;\n        return desc;\n    }\n\n    // Meta combinator: return a new GMatDesc\n    // reinterpreting 1-channel input as planar image\n    // (size height is divided by plane number)\n    GAPI_WRAP GMatDesc asPlanar(int planes) const\n    {\n        GAPI_Assert(planar == false);\n        GAPI_Assert(chan == 1);\n        GAPI_Assert(planes > 1);\n        GAPI_Assert(size.height % planes == 0);\n        GMatDesc desc(*this);\n        desc.size.height /=  planes;\n        desc.chan = planes;\n        return desc.asPlanar();\n    }\n\n    // Meta combinator: return a new GMatDesc with planar flag set to false\n    // (no size changes are performed, only channel interpretation is changed\n    // (planar -> interleaved)\n    GAPI_WRAP GMatDesc asInterleaved() const\n    {\n        GAPI_Assert(planar == true);\n        GMatDesc desc(*this);\n        desc.planar = false;\n        return desc;\n    }\n};\n\nstatic inline GMatDesc empty_gmat_desc() { return GMatDesc{-1,-1,{-1,-1}}; }\n\nnamespace gapi { namespace detail {\n/** Checks GMatDesc fields if the passed matrix is a set of n-dimentional points.\n@param in GMatDesc to check.\n@param n expected dimensionality.\n@return the amount of points. In case input matrix can't be described as vector of points\nof expected dimensionality, returns -1.\n */\nint checkVector(const GMatDesc& in, const size_t n);\n\n/** @overload\n\nChecks GMatDesc fields if the passed matrix can be described as a set of points of any\ndimensionality.\n\n@return array of two elements in form of std::vector<int>: the amount of points\nand their calculated dimensionality. In case input matrix can't be described as vector of points,\nreturns {-1, -1}.\n */\nstd::vector<int> checkVector(const GMatDesc& in);\n}} // namespace gapi::detail\n\n#if !defined(GAPI_STANDALONE)\nGAPI_EXPORTS GMatDesc descr_of(const cv::UMat &mat);\n#endif // !defined(GAPI_STANDALONE)\n\n//Fwd declarations\nnamespace gapi { namespace own {\n    class Mat;\n    GAPI_EXPORTS GMatDesc descr_of(const Mat &mat);\n}}//gapi::own\n\nGAPI_EXPORTS GMatDesc descr_of(const RMat &mat);\n\n#if !defined(GAPI_STANDALONE)\nGAPI_EXPORTS GMatDesc descr_of(const cv::Mat &mat);\n#else\nusing gapi::own::descr_of;\n#endif\n\n/** @} */\n\nGAPI_EXPORTS std::ostream& operator<<(std::ostream& os, const cv::GMatDesc &desc);\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GMAT_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gmetaarg.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GMETAARG_HPP\n#define OPENCV_GAPI_GMETAARG_HPP\n\n#include <vector>\n#include <type_traits>\n\n#include <opencv2/gapi/util/util.hpp>\n#include <opencv2/gapi/util/variant.hpp>\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/gscalar.hpp>\n#include <opencv2/gapi/garray.hpp>\n#include <opencv2/gapi/gopaque.hpp>\n#include <opencv2/gapi/gframe.hpp>\n\nnamespace cv\n{\n// FIXME: Rename to GMeta?\n// FIXME: user shouldn't deal with it - put to detail?\n// GMetaArg is an union type over descriptions of G-types which can serve as\n// GComputation's in/output slots.\n//\n// GMetaArg objects are passed as arguments to GComputation::compile()\n// to specify which data a compiled computation should be specialized on.\n// For manual compile(), user must supply this metadata, in case of apply()\n// this metadata is taken from arguments computation should operate on.\n//\n// The first type (monostate) is equal to \"uninitialized\"/\"unresolved\" meta.\nusing GMetaArg = util::variant\n    < util::monostate\n    , GMatDesc\n    , GScalarDesc\n    , GArrayDesc\n    , GOpaqueDesc\n    , GFrameDesc\n    >;\nGAPI_EXPORTS std::ostream& operator<<(std::ostream& os, const GMetaArg &);\n\nusing GMetaArgs = std::vector<GMetaArg>;\n\nnamespace detail\n{\n    // These traits are used by GComputation::compile()\n\n    // FIXME: is_constructible<T> doesn't work as variant doesn't do any SFINAE\n    // in its current template constructor\n\n    template<typename T> struct is_meta_descr    : std::false_type {};\n    template<> struct is_meta_descr<GMatDesc>    : std::true_type {};\n    template<> struct is_meta_descr<GScalarDesc> : std::true_type {};\n    template<> struct is_meta_descr<GArrayDesc>  : std::true_type {};\n    template<> struct is_meta_descr<GOpaqueDesc> : std::true_type {};\n\n    template<typename... Ts>\n    using are_meta_descrs = all_satisfy<is_meta_descr, Ts...>;\n\n    template<typename... Ts>\n    using are_meta_descrs_but_last = all_satisfy<is_meta_descr, typename all_but_last<Ts...>::type>;\n\n} // namespace detail\n\n// Note: descr_of(std::vector<..>) returns a GArrayDesc, while\n//       descrs_of(std::vector<..>) returns an array of Meta args!\nclass UMat;\nGAPI_EXPORTS cv::GMetaArgs descrs_of(const std::vector<cv::Mat> &vec);\nGAPI_EXPORTS cv::GMetaArgs descrs_of(const std::vector<cv::UMat> &vec);\nnamespace gapi { namespace own {\n    GAPI_EXPORTS cv::GMetaArgs descrs_of(const std::vector<Mat> &vec);\n}} // namespace gapi::own\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GMETAARG_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gopaque.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GOPAQUE_HPP\n#define OPENCV_GAPI_GOPAQUE_HPP\n\n#include <functional>\n#include <ostream>\n#include <memory>\n\n#include <opencv2/gapi/own/exports.hpp>\n#include <opencv2/gapi/opencv_includes.hpp>\n\n#include <opencv2/gapi/util/any.hpp>\n#include <opencv2/gapi/util/variant.hpp>\n#include <opencv2/gapi/util/throw.hpp>\n#include <opencv2/gapi/util/type_traits.hpp>\n#include <opencv2/gapi/own/assert.hpp>\n\n#include <opencv2/gapi/gcommon.hpp>  // OpaqueKind\n#include <opencv2/gapi/garray.hpp>  // TypeHintBase\n\nnamespace cv\n{\n// Forward declaration; GNode and GOrigin are an internal\n// (user-inaccessible) classes.\nclass GNode;\nstruct GOrigin;\ntemplate<typename T> class GOpaque;\n\n/**\n * \\addtogroup gapi_meta_args\n * @{\n */\nstruct GAPI_EXPORTS_W_SIMPLE GOpaqueDesc\n{\n    // FIXME: Body\n    // FIXME: Also implement proper operator== then\n    bool operator== (const GOpaqueDesc&) const { return true; }\n};\ntemplate<typename U> GOpaqueDesc descr_of(const U &) { return {};}\nGAPI_EXPORTS_W inline GOpaqueDesc empty_gopaque_desc() {return {}; }\n/** @} */\n\nstd::ostream& operator<<(std::ostream& os, const cv::GOpaqueDesc &desc);\n\nnamespace detail\n{\n    // ConstructOpaque is a callback which stores information about T and is used by\n    // G-API runtime to construct an object in host memory (T remains opaque for G-API).\n    // ConstructOpaque is carried into G-API internals by GOpaqueU.\n    // Currently it is suitable for Host (CPU) plugins only, real offload may require\n    // more information for manual memory allocation on-device.\n    class OpaqueRef;\n    using ConstructOpaque = std::function<void(OpaqueRef&)>;\n\n    // FIXME: garray.hpp already contains hint classes (for actual T type verification),\n    // need to think where it can be moved (currently opaque uses it from garray)\n\n    // This class strips type information from GOpaque<T> and makes it usable\n    // in the G-API graph compiler (expression unrolling, graph generation, etc).\n    // Part of GProtoArg.\n    class GAPI_EXPORTS GOpaqueU\n    {\n    public:\n        GOpaqueU(const GNode &n, std::size_t out); // Operation result constructor\n\n        template <typename T>\n        bool holds() const;                       // Check if was created from GOpaque<T>\n\n        GOrigin& priv();                          // Internal use only\n        const GOrigin& priv() const;              // Internal use only\n\n    protected:\n        GOpaqueU();                                // Default constructor\n        template<class> friend class cv::GOpaque;  // (available for GOpaque<T> only)\n\n        void setConstructFcn(ConstructOpaque &&cv);  // Store T-aware constructor\n\n        template <typename T>\n        void specifyType();                       // Store type of initial GOpaque<T>\n\n        template <typename T>\n        void storeKind();\n\n        void setKind(cv::detail::OpaqueKind);\n\n        std::shared_ptr<GOrigin> m_priv;\n        std::shared_ptr<TypeHintBase> m_hint;\n    };\n\n    template <typename T>\n    bool GOpaqueU::holds() const{\n        GAPI_Assert(m_hint != nullptr);\n        using U = util::decay_t<T>;\n        return dynamic_cast<TypeHint<U>*>(m_hint.get()) != nullptr;\n    };\n\n    template <typename T>\n    void GOpaqueU::specifyType(){\n        m_hint.reset(new TypeHint<util::decay_t<T>>);\n    };\n\n    template <typename T>\n    void GOpaqueU::storeKind(){\n        // FIXME: Add assert here on cv::Mat and cv::Scalar?\n        setKind(cv::detail::GOpaqueTraits<T>::kind);\n    };\n\n    // This class represents a typed object reference.\n    // Depending on origins, this reference may be either \"just a\" reference to\n    // an object created externally, OR actually own the underlying object\n    // (be value holder).\n    class BasicOpaqueRef\n    {\n    public:\n        cv::GOpaqueDesc m_desc;\n        virtual ~BasicOpaqueRef() {}\n\n        virtual void mov(BasicOpaqueRef &ref) = 0;\n        virtual const void* ptr() const = 0;\n        virtual void set(const cv::util::any &a) = 0;\n    };\n\n    template<typename T> class OpaqueRefT final: public BasicOpaqueRef\n    {\n        using empty_t  = util::monostate;\n        using ro_ext_t = const T *;\n        using rw_ext_t =       T *;\n        using rw_own_t =       T  ;\n        util::variant<empty_t, ro_ext_t, rw_ext_t, rw_own_t> m_ref;\n\n        inline bool isEmpty() const { return util::holds_alternative<empty_t>(m_ref);  }\n        inline bool isROExt() const { return util::holds_alternative<ro_ext_t>(m_ref); }\n        inline bool isRWExt() const { return util::holds_alternative<rw_ext_t>(m_ref); }\n        inline bool isRWOwn() const { return util::holds_alternative<rw_own_t>(m_ref); }\n\n        void init(const T* obj = nullptr)\n        {\n            if (obj) m_desc = cv::descr_of(*obj);\n        }\n\n    public:\n        OpaqueRefT() { init(); }\n        virtual ~OpaqueRefT() {}\n\n        explicit OpaqueRefT(const T&  obj) : m_ref(&obj)           { init(&obj); }\n        explicit OpaqueRefT(      T&  obj) : m_ref(&obj)           { init(&obj); }\n        explicit OpaqueRefT(      T&& obj) : m_ref(std::move(obj)) { init(&obj); }\n\n        // Reset a OpaqueRefT. Called only for objects instantiated\n        // internally in G-API (e.g. temporary GOpaque<T>'s within a\n        // computation).  Reset here means both initialization\n        // (creating an object) and reset (discarding its existing\n        // content before the next execution). Must never be called\n        // for external OpaqueRefTs.\n        void reset()\n        {\n            if (isEmpty())\n            {\n                T empty_obj{};\n                m_desc = cv::descr_of(empty_obj);\n                m_ref  = std::move(empty_obj);\n                GAPI_Assert(isRWOwn());\n            }\n            else if (isRWOwn())\n            {\n                util::get<rw_own_t>(m_ref) = {};\n            }\n            else GAPI_Assert(false); // shouldn't be called in *EXT modes\n        }\n\n        // Obtain a WRITE reference to underlying object\n        // Used by CPU kernel API wrappers when a kernel execution frame\n        // is created\n        T& wref()\n        {\n            GAPI_Assert(isRWExt() || isRWOwn());\n            if (isRWExt()) return *util::get<rw_ext_t>(m_ref);\n            if (isRWOwn()) return  util::get<rw_own_t>(m_ref);\n            util::throw_error(std::logic_error(\"Impossible happened\"));\n        }\n\n        // Obtain a READ reference to underlying object\n        // Used by CPU kernel API wrappers when a kernel execution frame\n        // is created\n        const T& rref() const\n        {\n            // ANY object can be accessed for reading, even if it declared for\n            // output. Example -- a GComputation from [in] to [out1,out2]\n            // where [out2] is a result of operation applied to [out1]:\n            //\n            //            GComputation boundary\n            //            . . . . . . .\n            //            .           .\n            //     [in] ----> foo() ----> [out1]\n            //            .           .    :\n            //            .           . . .:. . .\n            //            .                V    .\n            //            .              bar() ---> [out2]\n            //            . . . . . . . . . . . .\n            //\n            if (isROExt()) return *util::get<ro_ext_t>(m_ref);\n            if (isRWExt()) return *util::get<rw_ext_t>(m_ref);\n            if (isRWOwn()) return  util::get<rw_own_t>(m_ref);\n            util::throw_error(std::logic_error(\"Impossible happened\"));\n        }\n\n        virtual void mov(BasicOpaqueRef &v) override {\n            OpaqueRefT<T> *tv = dynamic_cast<OpaqueRefT<T>*>(&v);\n            GAPI_Assert(tv != nullptr);\n            wref() = std::move(tv->wref());\n        }\n\n        virtual const void* ptr() const override { return &rref(); }\n\n        virtual void set(const cv::util::any &a) override {\n            wref() = util::any_cast<T>(a);\n        }\n    };\n\n    // This class strips type information from OpaqueRefT<> and makes it usable\n    // in the G-API executables (carrying run-time data/information to kernels).\n    // Part of GRunArg.\n    // Its methods are typed proxies to OpaqueRefT<T>.\n    // OpaqueRef maintains \"reference\" semantics so two copies of OpaqueRef refer\n    // to the same underlying object.\n    class OpaqueRef\n    {\n        std::shared_ptr<BasicOpaqueRef> m_ref;\n        cv::detail::OpaqueKind m_kind;\n\n        template<typename T> inline void check() const\n        {\n            GAPI_DbgAssert(dynamic_cast<OpaqueRefT<T>*>(m_ref.get()) != nullptr);\n        }\n\n    public:\n        OpaqueRef() = default;\n\n        template<\n            typename T,\n            typename = util::are_different_t<OpaqueRef, T>\n        >\n        // FIXME: probably won't work with const object\n        explicit OpaqueRef(T&& obj) :\n            m_ref(new OpaqueRefT<util::decay_t<T>>(std::forward<T>(obj))),\n            m_kind(GOpaqueTraits<util::decay_t<T>>::kind) {}\n\n        cv::detail::OpaqueKind getKind() const\n        {\n            return m_kind;\n        }\n\n        template<typename T> void reset()\n        {\n            if (!m_ref) m_ref.reset(new OpaqueRefT<T>());\n            check<T>();\n            storeKind<T>();\n            static_cast<OpaqueRefT<T>&>(*m_ref).reset();\n        }\n\n        template <typename T>\n        void storeKind()\n        {\n            m_kind = cv::detail::GOpaqueTraits<T>::kind;\n        }\n\n        template<typename T> T& wref()\n        {\n            check<T>();\n            return static_cast<OpaqueRefT<T>&>(*m_ref).wref();\n        }\n\n        template<typename T> const T& rref() const\n        {\n            check<T>();\n            return static_cast<OpaqueRefT<T>&>(*m_ref).rref();\n        }\n\n        void mov(OpaqueRef &v)\n        {\n            m_ref->mov(*v.m_ref);\n        }\n\n        cv::GOpaqueDesc descr_of() const\n        {\n            return m_ref->m_desc;\n        }\n\n        // May be used to uniquely identify this object internally\n        const void *ptr() const { return m_ref->ptr(); }\n\n        // Introduced for in-graph meta handling\n        OpaqueRef& operator= (const cv::util::any &a)\n        {\n            m_ref->set(a);\n            return *this;\n        }\n    };\n} // namespace detail\n\n/** \\addtogroup gapi_data_objects\n * @{\n */\n/**\n * @brief `cv::GOpaque<T>` template class represents an object of\n * class `T` in the graph.\n *\n * `cv::GOpaque<T>` describes a functional relationship between operations\n * consuming and producing object of class `T`. `cv::GOpaque<T>` is\n * designed to extend G-API with user-defined data types, which are\n * often required with user-defined operations. G-API can't apply any\n * optimizations to user-defined types since these types are opaque to\n * the framework. However, there is a number of G-API operations\n * declared with `cv::GOpaque<T>` as a return type,\n * e.g. cv::gapi::streaming::timestamp() or cv::gapi::streaming::size().\n *\n * @sa `cv::GArray<T>`\n */\ntemplate<typename T> class GOpaque\n{\npublic:\n    // Host type (or Flat type) - the type this GOpaque is actually\n    // specified to.\n    /// @private\n    using HT = typename detail::flatten_g<util::decay_t<T>>::type;\n\n    /**\n     * @brief Constructs an empty `cv::GOpaque<T>`\n     *\n     * Normally, empty G-API data objects denote a starting point of\n     * the graph. When an empty `cv::GOpaque<T>` is assigned to a result\n     * of some operation, it obtains a functional link to this\n     * operation (and is not empty anymore).\n     */\n    GOpaque() { putDetails(); }              // Empty constructor\n\n    /// @private\n    explicit GOpaque(detail::GOpaqueU &&ref) // GOpaqueU-based constructor\n        : m_ref(ref) { putDetails(); }       // (used by GCall, not for users)\n\n    /// @private\n    detail::GOpaqueU strip() const {\n        return m_ref;\n    }\n    /// @private\n    static void Ctor(detail::OpaqueRef& ref) {\n        ref.reset<HT>();\n    }\nprivate:\n    void putDetails() {\n        m_ref.setConstructFcn(&Ctor);\n        m_ref.specifyType<HT>();\n        m_ref.storeKind<HT>();\n    }\n\n    detail::GOpaqueU m_ref;\n};\n\n/** @} */\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GOPAQUE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gproto.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GPROTO_HPP\n#define OPENCV_GAPI_GPROTO_HPP\n\n#include <type_traits>\n#include <vector>\n#include <ostream>\n\n#include <opencv2/gapi/util/variant.hpp>\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/gscalar.hpp>\n#include <opencv2/gapi/garray.hpp>\n#include <opencv2/gapi/gopaque.hpp>\n#include <opencv2/gapi/garg.hpp>\n#include <opencv2/gapi/gmetaarg.hpp>\n\nnamespace cv {\n\n// FIXME: user shouldn't deal with it - put to detail?\n// GProtoArg is an union type over G-types which can serve as\n// GComputation's in/output slots. In other words, GProtoArg\n// wraps any type which can serve as G-API exchange type.\n//\n// In Runtime, GProtoArgs are substituted with appropriate GRunArgs.\n//\n// GProtoArg objects are constructed in-place when user describes\n// (captures) computations, user doesn't interact with these types\n// directly.\nusing GProtoArg = util::variant\n    < GMat\n    , GMatP\n    , GFrame\n    , GScalar\n    , detail::GArrayU  // instead of GArray<T>\n    , detail::GOpaqueU // instead of GOpaque<T>\n    >;\n\nusing GProtoArgs = std::vector<GProtoArg>;\n\nnamespace detail\n{\ntemplate<typename... Ts> inline GProtoArgs packArgs(Ts... args)\n{\n    return GProtoArgs{ GProtoArg(wrap_gapi_helper<Ts>::wrap(args))... };\n}\n\n}\n\ntemplate<class Tag>\nstruct GIOProtoArgs\n{\npublic:\n    // NB: Used by python wrapper\n    GIOProtoArgs() = default;\n    explicit GIOProtoArgs(const GProtoArgs& args) : m_args(args) {}\n    explicit GIOProtoArgs(GProtoArgs &&args)      : m_args(std::move(args)) {}\n\n    GProtoArgs m_args;\n\n    // TODO: Think about the addition operator\n    /**\n     * @brief This operator allows to complement the proto vectors at runtime.\n     *\n     * It's an ordinary overload of addition assignment operator.\n     *\n     * Example of usage:\n     * @snippet dynamic_graph.cpp  GIOProtoArgs usage\n     *\n     */\n    template<typename Tg>\n    friend GIOProtoArgs<Tg>& operator += (GIOProtoArgs<Tg> &lhs, const GIOProtoArgs<Tg> &rhs);\n};\n\ntemplate<typename Tg>\ncv::GIOProtoArgs<Tg>& operator += (cv::GIOProtoArgs<Tg> &lhs, const cv::GIOProtoArgs<Tg> &rhs)\n{\n    lhs.m_args.reserve(lhs.m_args.size() + rhs.m_args.size());\n    lhs.m_args.insert(lhs.m_args.end(), rhs.m_args.begin(), rhs.m_args.end());\n    return lhs;\n}\n\nstruct In_Tag{};\nstruct Out_Tag{};\n\nusing GProtoInputArgs  = GIOProtoArgs<In_Tag>;\nusing GProtoOutputArgs = GIOProtoArgs<Out_Tag>;\n\n// Perfect forwarding\ntemplate<typename... Ts> inline GProtoInputArgs GIn(Ts&&... ts)\n{\n    return GProtoInputArgs(detail::packArgs(std::forward<Ts>(ts)...));\n}\n\ntemplate<typename... Ts> inline GProtoOutputArgs GOut(Ts&&... ts)\n{\n    return GProtoOutputArgs(detail::packArgs(std::forward<Ts>(ts)...));\n}\n\nnamespace detail\n{\n    // Extract elements form tuple\n    // FIXME: Someday utilize a generic tuple_to_vec<> routine\n    template<typename... Ts, int... Indexes>\n    static GProtoOutputArgs getGOut_impl(const std::tuple<Ts...>& ts, detail::Seq<Indexes...>)\n    {\n        return GProtoOutputArgs{ detail::packArgs(std::get<Indexes>(ts)...)};\n    }\n}\n\ntemplate<typename... Ts> inline GProtoOutputArgs GOut(const std::tuple<Ts...>& ts)\n{\n    // TODO: think of std::forward(ts)\n    return detail::getGOut_impl(ts, typename detail::MkSeq<sizeof...(Ts)>::type());\n}\n\n// Takes rvalue as input arg\ntemplate<typename... Ts> inline GProtoOutputArgs GOut(std::tuple<Ts...>&& ts)\n{\n    // TODO: think of std::forward(ts)\n    return detail::getGOut_impl(ts, typename detail::MkSeq<sizeof...(Ts)>::type());\n}\n\n// Extract run-time arguments from node origin\n// Can be used to extract constant values associated with G-objects\n// (like GScalar) at graph construction time\nGRunArg value_of(const GOrigin &origin);\n\n// Transform run-time computation arguments into a collection of metadata\n// extracted from that arguments\nGMetaArg  GAPI_EXPORTS descr_of(const GRunArg  &arg );\nGMetaArgs GAPI_EXPORTS descr_of(const GRunArgs &args);\n\n// Transform run-time operation result argument into metadata extracted from that argument\n// Used to compare the metadata, which generated at compile time with the metadata result operation in run time\nGMetaArg GAPI_EXPORTS descr_of(const GRunArgP& argp);\n\n// Checks if run-time computation argument can be described by metadata\nbool GAPI_EXPORTS can_describe(const GMetaArg&  meta,  const GRunArg&  arg);\nbool GAPI_EXPORTS can_describe(const GMetaArgs& metas, const GRunArgs& args);\n\n// Checks if run-time computation result argument can be described by metadata.\n// Used to check if the metadata generated at compile time\n// coincides with output arguments passed to computation in cpu and ocl backends\nbool GAPI_EXPORTS can_describe(const GMetaArg&  meta,  const GRunArgP& argp);\n\n// Validates input arguments\nvoid GAPI_EXPORTS validate_input_arg(const GRunArg& arg);\nvoid GAPI_EXPORTS validate_input_args(const GRunArgs& args);\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GPROTO_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gpu/core.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GPU_CORE_API_HPP\n#define OPENCV_GAPI_GPU_CORE_API_HPP\n/** @file\n* @deprecated Use <opencv2/gapi/ocl/core.hpp> instead.\n*/\n\n#include <opencv2/gapi/ocl/core.hpp>\n\nnamespace cv {\nnamespace gapi {\nnamespace core {\nnamespace gpu {\n    using namespace ocl;\n} // namespace gpu\n} // namespace core\n} // namespace gapi\n} // namespace cv\n\n\n#endif // OPENCV_GAPI_GPU_CORE_API_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gpu/ggpukernel.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GGPUKERNEL_HPP\n#define OPENCV_GAPI_GGPUKERNEL_HPP\n/** @file\n* @deprecated Use <opencv2/gapi/ocl/goclkernel.hpp> instead.\n*/\n\n#include <opencv2/gapi/ocl/goclkernel.hpp>\n#define GAPI_GPU_KERNEL GAPI_OCL_KERNEL\n\n\n#endif // OPENCV_GAPI_GGPUKERNEL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gpu/imgproc.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GPU_IMGPROC_API_HPP\n#define OPENCV_GAPI_GPU_IMGPROC_API_HPP\n/** @file\n* @deprecated Use <opencv2/gapi/ocl/imgproc.hpp> instead.\n*/\n\n#include <opencv2/gapi/ocl/imgproc.hpp>\n\n\nnamespace cv {\nnamespace gapi {\nnamespace imgproc {\nnamespace gpu {\n    using namespace ocl;\n} // namespace gpu\n} // namespace imgproc\n} // namespace gapi\n} // namespace cv\n\n\n#endif // OPENCV_GAPI_GPU_IMGPROC_API_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gscalar.hpp",
    "content": "// This file is part of OpenCV project.\n\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GSCALAR_HPP\n#define OPENCV_GAPI_GSCALAR_HPP\n\n#include <ostream>\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/gcommon.hpp> // GShape\n#include <opencv2/gapi/util/optional.hpp>\n\nnamespace cv\n{\n// Forward declaration; GNode and GOrigin are an internal\n// (user-inaccessible) classes.\nclass GNode;\nstruct GOrigin;\n\n/** \\addtogroup gapi_data_objects\n * @{\n */\n/**\n * @brief GScalar class represents cv::Scalar data in the graph.\n *\n * GScalar may be associated with a cv::Scalar value, which becomes\n * its constant value bound in graph compile time. cv::GScalar describes a\n * functional relationship between operations consuming and producing\n * GScalar objects.\n *\n * GScalar is a virtual counterpart of cv::Scalar, which is usually used\n * to represent the GScalar data in G-API during the execution.\n *\n * @sa Scalar\n */\nclass GAPI_EXPORTS_W_SIMPLE GScalar\n{\npublic:\n    /**\n     * @brief Constructs an empty GScalar\n     *\n     * Normally, empty G-API data objects denote a starting point of\n     * the graph. When an empty GScalar is assigned to a result of some\n     * operation, it obtains a functional link to this operation (and\n     * is not empty anymore).\n     */\n    GAPI_WRAP GScalar();\n\n    /**\n     * @brief Constructs a value-initialized GScalar\n     *\n     * In contrast with GMat (which can be either an explicit graph input\n     * or a result of some operation), GScalars may have their values\n     * be associated at graph construction time. It is useful when\n     * some operation has a GScalar input which doesn't change during\n     * the program execution, and is set only once. In this case,\n     * there is no need to declare such GScalar as a graph input.\n     *\n     * @note The value of GScalar may be overwritten by assigning some\n     * other GScalar to the object using `operator=` -- on the\n     * assigment, the old GScalar value is discarded.\n     *\n     * @param s a cv::Scalar value to associate with this GScalar object.\n     */\n    explicit GScalar(const cv::Scalar& s);\n\n    /**\n     * @overload\n     * @brief Constructs a value-initialized GScalar\n     *\n     * @param s a cv::Scalar value to associate with this GScalar object.\n     */\n    explicit GScalar(cv::Scalar&& s);       // Constant value move-constructor from cv::Scalar\n\n    /**\n     * @overload\n     * @brief Constructs a value-initialized GScalar\n     *\n     * @param v0 A `double` value to associate with this GScalar. Note\n     *  that only the first component of a four-component cv::Scalar is\n     *  set to this value, with others remain zeros.\n     *\n     * This constructor overload is not marked `explicit` and can be\n     * used in G-API expression code like this:\n     *\n     * @snippet modules/gapi/samples/api_ref_snippets.cpp gscalar_implicit\n     *\n     * Here operator+(GMat,GScalar) is used to wrap cv::gapi::addC()\n     * and a value-initialized GScalar is created on the fly.\n     *\n     * @overload\n     */\n    GScalar(double v0);                                // Constant value constructor from double\n\n    /// @private\n    GScalar(const GNode &n, std::size_t out);          // Operation result constructor\n    /// @private\n    GOrigin& priv();                                   // Internal use only\n    /// @private\n    const GOrigin& priv()  const;                      // Internal use only\n\nprivate:\n    std::shared_ptr<GOrigin> m_priv;\n};\n\n/** @} */\n\n/**\n * \\addtogroup gapi_meta_args\n * @{\n */\nstruct GAPI_EXPORTS_W_SIMPLE GScalarDesc\n{\n    // NB.: right now it is empty\n\n    inline bool operator== (const GScalarDesc &) const\n    {\n        return true; // NB: implement this method if GScalar meta appears\n    }\n\n    inline bool operator!= (const GScalarDesc &rhs) const\n    {\n        return !(*this == rhs);\n    }\n};\n\nGAPI_EXPORTS_W inline GScalarDesc empty_scalar_desc() { return GScalarDesc(); }\n\nGAPI_EXPORTS GScalarDesc descr_of(const cv::Scalar &scalar);\n\nstd::ostream& operator<<(std::ostream& os, const cv::GScalarDesc &desc);\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GSCALAR_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gstreaming.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GSTREAMING_COMPILED_HPP\n#define OPENCV_GAPI_GSTREAMING_COMPILED_HPP\n\n#include <memory>\n#include <vector>\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/own/assert.hpp>\n#include <opencv2/gapi/util/optional.hpp>\n#include <opencv2/gapi/garg.hpp>\n#include <opencv2/gapi/streaming/source.hpp>\n\nnamespace cv {\n\ntemplate<class T> using optional = cv::util::optional<T>;\n\nnamespace detail {\ntemplate<typename T> struct wref_spec {\n    using type = T;\n};\ntemplate<typename T> struct wref_spec<std::vector<T> > {\n    using type = T;\n};\n\ntemplate<typename RefHolder>\nstruct OptRef {\n    struct OptHolder {\n        virtual void mov(RefHolder &h) = 0;\n        virtual void reset() = 0;\n        virtual ~OptHolder() = default;\n        using Ptr = std::shared_ptr<OptHolder>;\n    };\n    template<class T> struct Holder final: OptHolder {\n        std::reference_wrapper<cv::optional<T> > m_opt_ref;\n\n        explicit Holder(cv::optional<T>& opt) : m_opt_ref(std::ref(opt)) {\n        }\n        virtual void mov(RefHolder &h) override {\n            using U = typename wref_spec<T>::type;\n            m_opt_ref.get() = cv::util::make_optional(std::move(h.template wref<U>()));\n        }\n        virtual void reset() override {\n            m_opt_ref.get().reset();\n        }\n    };\n    template<class T>\n    explicit OptRef(cv::optional<T>& t) : m_opt{new Holder<T>(t)} {}\n    void mov(RefHolder &h) { m_opt->mov(h); }\n    void reset()           { m_opt->reset();}\nprivate:\n    typename OptHolder::Ptr m_opt;\n};\nusing OptionalVectorRef = OptRef<cv::detail::VectorRef>;\nusing OptionalOpaqueRef = OptRef<cv::detail::OpaqueRef>;\n} // namespace detail\n\n// TODO: Keep it in sync with GRunArgP (derive the type automatically?)\nusing GOptRunArgP = util::variant<\n    optional<cv::Mat>*,\n    optional<cv::RMat>*,\n    optional<cv::Scalar>*,\n    cv::detail::OptionalVectorRef,\n    cv::detail::OptionalOpaqueRef\n>;\nusing GOptRunArgsP = std::vector<GOptRunArgP>;\n\nusing GOptRunArg = util::variant<\n    optional<cv::Mat>,\n    optional<cv::RMat>,\n    optional<cv::Scalar>,\n    optional<cv::detail::VectorRef>,\n    optional<cv::detail::OpaqueRef>\n>;\nusing GOptRunArgs = std::vector<GOptRunArg>;\n\nnamespace detail {\n\ntemplate<typename T> inline GOptRunArgP wrap_opt_arg(optional<T>& arg) {\n    // By default, T goes to an OpaqueRef. All other types are specialized\n    return GOptRunArgP{OptionalOpaqueRef(arg)};\n}\n\ntemplate<typename T> inline GOptRunArgP wrap_opt_arg(optional<std::vector<T> >& arg) {\n    return GOptRunArgP{OptionalVectorRef(arg)};\n}\n\ntemplate<> inline GOptRunArgP wrap_opt_arg(optional<cv::Mat> &m) {\n    return GOptRunArgP{&m};\n}\n\ntemplate<> inline GOptRunArgP wrap_opt_arg(optional<cv::Scalar> &s) {\n    return GOptRunArgP{&s};\n}\n\n} // namespace detail\n\n// Now cv::gout() may produce an empty vector (see \"dynamic graphs\"), so\n// there may be a conflict between these two. State here that Opt version\n// _must_ have at least one input for this overload\ntemplate<typename T, typename... Ts>\ninline GOptRunArgsP gout(optional<T>&arg, optional<Ts>&... args)\n{\n    return GOptRunArgsP{ detail::wrap_opt_arg(arg), detail::wrap_opt_arg(args)... };\n}\n\n/**\n * \\addtogroup gapi_main_classes\n * @{\n */\n/**\n * @brief Represents a computation (graph) compiled for streaming.\n *\n * This class represents a product of graph compilation (calling\n * cv::GComputation::compileStreaming()). Objects of this class\n * actually do stream processing, and the whole pipeline execution\n * complexity is incapsulated into objects of this class. Execution\n * model has two levels: at the very top, the execution of a\n * heterogeneous graph is aggressively pipelined; at the very bottom\n * the execution of every internal block is determined by its\n * associated backend. Backends are selected based on kernel packages\n * passed via compilation arguments ( see @ref gapi_compile_args,\n * GNetworkPackage, GKernelPackage for details).\n *\n * GStreamingCompiled objects have a \"player\" semantics -- there are\n * methods like start() and stop(). GStreamingCompiled has a full\n * control over a videostream and so is stateful. You need to specify the\n * input stream data using setSource() and then call start() to\n * actually start processing. After that, use pull() or try_pull() to\n * obtain next processed data frame from the graph in a blocking or\n * non-blocking way, respectively.\n *\n * Currently a single GStreamingCompiled can process only one video\n * streat at time. Produce multiple GStreamingCompiled objects to run the\n * same graph on multiple video streams.\n *\n * @sa GCompiled\n */\nclass GAPI_EXPORTS_W_SIMPLE GStreamingCompiled\n{\npublic:\n    class GAPI_EXPORTS Priv;\n    GAPI_WRAP GStreamingCompiled();\n\n    // FIXME: More overloads?\n    /**\n     * @brief Specify the input data to GStreamingCompiled for\n     * processing, a generic version.\n     *\n     * Use gin() to create an input parameter vector.\n     *\n     * Input vectors must have the same number of elements as defined\n     * in the cv::GComputation protocol (at the moment of its\n     * construction). Shapes of elements also must conform to protocol\n     * (e.g. cv::Mat needs to be passed where cv::GMat has been\n     * declared as input, and so on). Run-time exception is generated\n     * on type mismatch.\n     *\n     * In contrast with regular GCompiled, user can also pass an\n     * object of type GVideoCapture for a GMat parameter of the parent\n     * GComputation.  The compiled pipeline will start fetching data\n     * from that GVideoCapture and feeding it into the\n     * pipeline. Pipeline stops when a GVideoCapture marks end of the\n     * stream (or when stop() is called).\n     *\n     * Passing a regular Mat for a GMat parameter makes it \"infinite\"\n     * source -- pipeline may run forever feeding with this Mat until\n     * stopped explicitly.\n     *\n     * Currently only a single GVideoCapture is supported as input. If\n     * the parent GComputation is declared with multiple input GMat's,\n     * one of those can be specified as GVideoCapture but all others\n     * must be regular Mat objects.\n     *\n     * Throws if pipeline is already running. Use stop() and then\n     * setSource() to run the graph on a new video stream.\n     *\n     * @note This method is not thread-safe (with respect to the user\n     * side) at the moment. Protect the access if\n     * start()/stop()/setSource() may be called on the same object in\n     * multiple threads in your application.\n     *\n     * @param ins vector of inputs to process.\n     * @sa gin\n     */\n    void setSource(GRunArgs &&ins);\n\n    /// @private -- Exclude this function from OpenCV documentation\n    GAPI_WRAP void setSource(const cv::detail::ExtractArgsCallback& callback);\n\n    /**\n     * @brief Specify an input video stream for a single-input\n     * computation pipeline.\n     *\n     * Throws if pipeline is already running. Use stop() and then\n     * setSource() to run the graph on a new video stream.\n     *\n     * @overload\n     * @param s a shared pointer to IStreamSource representing the\n     * input video stream.\n     */\n    void setSource(const gapi::wip::IStreamSource::Ptr& s);\n\n    /**\n     * @brief Constructs and specifies an input video stream for a\n     * single-input computation pipeline with the given parameters.\n     *\n     * Throws if pipeline is already running. Use stop() and then\n     * setSource() to run the graph on a new video stream.\n     *\n     * @overload\n     * @param args arguments used to contruct and initialize a stream\n     * source.\n     */\n    template<typename T, typename... Args>\n    void setSource(Args&&... args) {\n        setSource(cv::gapi::wip::make_src<T>(std::forward<Args>(args)...));\n    }\n\n    /**\n     * @brief Start the pipeline execution.\n     *\n     * Use pull()/try_pull() to obtain data. Throws an exception if\n     * a video source was not specified.\n     *\n     * setSource() must be called first, even if the pipeline has been\n     * working already and then stopped (explicitly via stop() or due\n     * stream completion)\n     *\n     * @note This method is not thread-safe (with respect to the user\n     * side) at the moment. Protect the access if\n     * start()/stop()/setSource() may be called on the same object in\n     * multiple threads in your application.\n     */\n    GAPI_WRAP void start();\n\n    /**\n     * @brief Get the next processed frame from the pipeline.\n     *\n     * Use gout() to create an output parameter vector.\n     *\n     * Output vectors must have the same number of elements as defined\n     * in the cv::GComputation protocol (at the moment of its\n     * construction). Shapes of elements also must conform to protocol\n     * (e.g. cv::Mat needs to be passed where cv::GMat has been\n     * declared as output, and so on). Run-time exception is generated\n     * on type mismatch.\n     *\n     * This method writes new data into objects passed via output\n     * vector.  If there is no data ready yet, this method blocks. Use\n     * try_pull() if you need a non-blocking version.\n     *\n     * @param outs vector of output parameters to obtain.\n     * @return true if next result has been obtained,\n     *    false marks end of the stream.\n     */\n    bool pull(cv::GRunArgsP &&outs);\n\n    // NB: Used from python\n    /// @private -- Exclude this function from OpenCV documentation\n    GAPI_WRAP std::tuple<bool, cv::util::variant<cv::GRunArgs, cv::GOptRunArgs>> pull();\n\n    /**\n     * @brief Get some next available data from the pipeline.\n     *\n     * This method takes a vector of cv::optional object. An object is\n     * assigned to some value if this value is available (ready) at\n     * the time of the call, and resets the object to empty() if it is\n     * not.\n     *\n     * This is a blocking method which guarantees that some data has\n     * been written to the output vector on return.\n     *\n     * Using this method only makes sense if the graph has\n     * desynchronized parts (see cv::gapi::desync). If there is no\n     * desynchronized parts in the graph, the behavior of this\n     * method is identical to the regular pull() (all data objects are\n     * produced synchronously in the output vector).\n     *\n     * Use gout() to create an output parameter vector.\n     *\n     * Output vectors must have the same number of elements as defined\n     * in the cv::GComputation protocol (at the moment of its\n     * construction). Shapes of elements also must conform to protocol\n     * (e.g. cv::optional<cv::Mat> needs to be passed where cv::GMat\n     * has been declared as output, and so on). Run-time exception is\n     * generated on type mismatch.\n     *\n     * This method writes new data into objects passed via output\n     * vector.  If there is no data ready yet, this method blocks. Use\n     * try_pull() if you need a non-blocking version.\n     *\n     * @param outs vector of output parameters to obtain.\n     * @return true if next result has been obtained,\n     *    false marks end of the stream.\n     *\n     * @sa cv::gapi::desync\n     */\n    bool pull(cv::GOptRunArgsP &&outs);\n\n    /**\n     * @brief Try to get the next processed frame from the pipeline.\n     *\n     * Use gout() to create an output parameter vector.\n     *\n     * This method writes new data into objects passed via output\n     * vector.  If there is no data ready yet, the output vector\n     * remains unchanged and false is returned.\n     *\n     * @return true if data has been obtained, and false if it was\n     *    not. Note: false here doesn't mark the end of the stream.\n     */\n    bool try_pull(cv::GRunArgsP &&outs);\n\n    /**\n     * @brief Stop (abort) processing the pipeline.\n     *\n     * Note - it is not pause but a complete stop. Calling start()\n     * will cause G-API to start processing the stream from the early beginning.\n     *\n     * Throws if the pipeline is not running.\n     */\n    GAPI_WRAP void stop();\n\n    /**\n     * @brief Test if the pipeline is running.\n     *\n     * @note This method is not thread-safe (with respect to the user\n     * side) at the moment. Protect the access if\n     * start()/stop()/setSource() may be called on the same object in\n     * multiple threads in your application.\n     *\n     * @return true if the current stream is not over yet.\n     */\n    GAPI_WRAP bool running() const;\n\n    /// @private\n    Priv& priv();\n\n    /**\n     * @brief Check if compiled object is valid (non-empty)\n     *\n     * @return true if the object is runnable (valid), false otherwise\n     */\n    explicit operator bool () const;\n\n    /**\n     * @brief Vector of metadata this graph was compiled for.\n     *\n     * @return Unless _reshape_ is not supported, return value is the\n     * same vector which was passed to cv::GComputation::compile() to\n     * produce this compiled object. Otherwise, it is the latest\n     * metadata vector passed to reshape() (if that call was\n     * successful).\n     */\n    const GMetaArgs& metas() const; // Meta passed to compile()\n\n    /**\n     * @brief Vector of metadata descriptions of graph outputs\n     *\n     * @return vector with formats/resolutions of graph's output\n     * objects, auto-inferred from input metadata vector by\n     * operations which form this computation.\n     *\n     * @note GCompiled objects produced from the same\n     * cv::GComputiation graph with different input metas may return\n     * different values in this vector.\n     */\n    const GMetaArgs& outMetas() const;\n\nprotected:\n    /// @private\n    std::shared_ptr<Priv> m_priv;\n};\n/** @} */\n\nnamespace gapi {\n\n/**\n * @brief This namespace contains G-API functions, structures, and\n * symbols related to the Streaming execution mode.\n *\n * Some of the operations defined in this namespace (e.g. size(),\n * BGR(), etc.) can be used in the traditional execution mode too.\n */\nnamespace streaming {\n/**\n * @brief Specify queue capacity for streaming execution.\n *\n * In the streaming mode the pipeline steps are connected with queues\n * and this compile argument controls every queue's size.\n */\nstruct GAPI_EXPORTS queue_capacity\n{\n    explicit queue_capacity(size_t cap = 1) : capacity(cap) { };\n    size_t capacity;\n};\n/** @} */\n} // namespace streaming\n} // namespace gapi\n\nnamespace detail\n{\ntemplate<> struct CompileArgTag<cv::gapi::streaming::queue_capacity>\n{\n    static const char* tag() { return \"gapi.queue_capacity\"; }\n};\n}\n\n}\n\n#endif // OPENCV_GAPI_GSTREAMING_COMPILED_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gtransform.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n\n#ifndef OPENCV_GAPI_GTRANSFORM_HPP\n#define OPENCV_GAPI_GTRANSFORM_HPP\n\n#include <functional>\n#include <type_traits>\n#include <utility>\n\n#include <opencv2/gapi/gcommon.hpp>\n#include <opencv2/gapi/util/util.hpp>\n#include <opencv2/gapi/garg.hpp>\n#include <opencv2/gapi/gtype_traits.hpp>\n#include <opencv2/gapi/util/compiler_hints.hpp>\n#include <opencv2/gapi/gcomputation.hpp>\n\nnamespace cv\n{\n\nstruct GAPI_EXPORTS GTransform\n{\n    // FIXME: consider another simplified\n    // class instead of GComputation\n    using F = std::function<GComputation()>;\n\n    std::string description;\n    F pattern;\n    F substitute;\n\n    GTransform(const std::string& d, const F &p, const F &s) : description(d), pattern(p), substitute(s){};\n};\n\nnamespace detail\n{\n\ntemplate <typename, typename, typename>\nstruct TransHelper;\n\ntemplate <typename K, typename... Ins, typename Out>\nstruct TransHelper<K, std::tuple<Ins...>, Out>\n{\n    template <typename Callable, int... IIs, int... OIs>\n    static GComputation invoke(Callable f, Seq<IIs...>, Seq<OIs...>)\n    {\n        const std::tuple<Ins...> ins;\n        const auto r = tuple_wrap_helper<Out>::get(f(std::get<IIs>(ins)...));\n        return GComputation(cv::GIn(std::get<IIs>(ins)...),\n                            cv::GOut(std::get<OIs>(r)...));\n    }\n\n    static GComputation get_pattern()\n    {\n        return invoke(K::pattern, typename MkSeq<sizeof...(Ins)>::type(),\n                      typename MkSeq<std::tuple_size<typename tuple_wrap_helper<Out>::type>::value>::type());\n    }\n    static GComputation get_substitute()\n    {\n        return invoke(K::substitute, typename MkSeq<sizeof...(Ins)>::type(),\n                      typename MkSeq<std::tuple_size<typename tuple_wrap_helper<Out>::type>::value>::type());\n    }\n};\n} // namespace detail\n\ntemplate <typename, typename>\nclass GTransformImpl;\n\ntemplate <typename K, typename R, typename... Args>\nclass GTransformImpl<K, std::function<R(Args...)>> : public cv::detail::TransHelper<K, std::tuple<Args...>, R>,\n                                                     public cv::detail::TransformTag\n{\npublic:\n    // FIXME: currently there is no check that transformations' signatures are unique\n    // and won't be any intersection in graph compilation stage\n    using API = K;\n\n    static GTransform transformation()\n    {\n        return GTransform(K::descr(), &K::get_pattern, &K::get_substitute);\n    }\n};\n} // namespace cv\n\n#define G_DESCR_HELPER_CLASS(Class) Class##DescrHelper\n\n#define G_DESCR_HELPER_BODY(Class, Descr)                       \\\n    namespace detail                                            \\\n    {                                                           \\\n    struct G_DESCR_HELPER_CLASS(Class)                          \\\n    {                                                           \\\n        static constexpr const char *descr() { return Descr; }; \\\n    };                                                          \\\n    }\n\n#define GAPI_TRANSFORM(Class, API, Descr)                                     \\\n    G_DESCR_HELPER_BODY(Class, Descr)                                         \\\n    struct Class final : public cv::GTransformImpl<Class, std::function API>, \\\n                         public detail::G_DESCR_HELPER_CLASS(Class)\n\n#endif // OPENCV_GAPI_GTRANSFORM_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gtype_traits.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GTYPE_TRAITS_HPP\n#define OPENCV_GAPI_GTYPE_TRAITS_HPP\n\n#include <vector>\n#include <type_traits>\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/gscalar.hpp>\n#include <opencv2/gapi/garray.hpp>\n#include <opencv2/gapi/gopaque.hpp>\n#include <opencv2/gapi/gframe.hpp>\n#include <opencv2/gapi/streaming/source.hpp>\n#include <opencv2/gapi/media.hpp>\n#include <opencv2/gapi/gcommon.hpp>\n\nnamespace cv\n{\nnamespace detail\n{\n    // FIXME: These traits and enum and possible numerous switch(kind)\n    // block may be replaced with a special Handler<T> object or with\n    // a double dispatch\n    enum class ArgKind: int\n    {\n        OPAQUE_VAL,   // Unknown, generic, opaque-to-GAPI data type - STATIC\n                      // Note: OPAQUE is sometimes defined in Win sys headers\n#if !defined(OPAQUE) && !defined(CV_DOXYGEN)\n        OPAQUE = OPAQUE_VAL,  // deprecated value used for compatibility, use OPAQUE_VAL instead\n#endif\n        GOBJREF,      // <internal> reference to object\n        GMAT,         // a cv::GMat\n        GMATP,        // a cv::GMatP\n        GFRAME,       // a cv::GFrame\n        GSCALAR,      // a cv::GScalar\n        GARRAY,       // a cv::GArrayU  (note - exactly GArrayU,  not GArray<T>!)\n        GOPAQUE,      // a cv::GOpaqueU (note - exactly GOpaqueU, not GOpaque<T>!)\n    };\n\n    template<typename T>\n    constexpr const char* meta_to_string() noexcept;\n    template<>\n    constexpr const char* meta_to_string<cv::GMatDesc>() noexcept { return \"GMatDesc\"; }\n    template<>\n    constexpr const char* meta_to_string<cv::GScalarDesc>() noexcept { return \"GScalarDesc\"; }\n    template<>\n    constexpr const char* meta_to_string<cv::GArrayDesc>() noexcept { return \"GArrayDesc\"; }\n    template<>\n    constexpr const char* meta_to_string<cv::GOpaqueDesc>() noexcept { return \"GOpaqueDesc\"; }\n    template<>\n    constexpr const char* meta_to_string<cv::GFrameDesc>() noexcept { return \"GFrameDesc\";}\n\n    // Describe G-API types (G-types) with traits.  Mostly used by\n    // cv::GArg to store meta information about types passed into\n    // operation arguments. Please note that cv::GComputation is\n    // defined on GProtoArgs, not GArgs!\n    template<typename T> struct GTypeTraits;\n    template<typename T> struct GTypeTraits\n    {\n        static constexpr const ArgKind kind = ArgKind::OPAQUE_VAL;\n        static constexpr const OpaqueKind op_kind = OpaqueKind::CV_UNKNOWN;\n    };\n    template<>           struct GTypeTraits<cv::GMat>\n    {\n        static constexpr const ArgKind kind = ArgKind::GMAT;\n        static constexpr const GShape shape = GShape::GMAT;\n        static constexpr const OpaqueKind op_kind = OpaqueKind::CV_UNKNOWN;\n    };\n    template<>           struct GTypeTraits<cv::GMatP>\n    {\n        static constexpr const ArgKind kind = ArgKind::GMATP;\n        static constexpr const GShape shape = GShape::GMAT;\n        static constexpr const OpaqueKind op_kind = OpaqueKind::CV_UNKNOWN;\n    };\n    template<>           struct GTypeTraits<cv::GFrame>\n    {\n        static constexpr const ArgKind kind = ArgKind::GFRAME;\n        static constexpr const GShape shape = GShape::GFRAME;\n        static constexpr const OpaqueKind op_kind = OpaqueKind::CV_UNKNOWN;\n    };\n    template<>           struct GTypeTraits<cv::GScalar>\n    {\n        static constexpr const ArgKind kind = ArgKind::GSCALAR;\n        static constexpr const GShape shape = GShape::GSCALAR;\n        static constexpr const OpaqueKind op_kind = OpaqueKind::CV_UNKNOWN;\n    };\n    template<class T> struct GTypeTraits<cv::GArray<T> >\n    {\n        static constexpr const ArgKind kind = ArgKind::GARRAY;\n        static constexpr const GShape shape = GShape::GARRAY;\n        static constexpr const OpaqueKind op_kind = GOpaqueTraits<T>::kind;\n        using host_type  = std::vector<T>;\n        using strip_type = cv::detail::VectorRef;\n        static cv::detail::GArrayU   wrap_value(const cv::GArray<T>  &t) { return t.strip();}\n        static cv::detail::VectorRef wrap_in   (const std::vector<T> &t) { return detail::VectorRef(t); }\n        static cv::detail::VectorRef wrap_out  (      std::vector<T> &t) { return detail::VectorRef(t); }\n    };\n    template<class T> struct GTypeTraits<cv::GOpaque<T> >\n    {\n        static constexpr const ArgKind kind = ArgKind::GOPAQUE;\n        static constexpr const GShape shape = GShape::GOPAQUE;\n        static constexpr const OpaqueKind op_kind = GOpaqueTraits<T>::kind;\n        using host_type  = T;\n        using strip_type = cv::detail::OpaqueRef;\n        static cv::detail::GOpaqueU  wrap_value(const cv::GOpaque<T>  &t) { return t.strip();}\n        static cv::detail::OpaqueRef wrap_in   (const T &t) { return detail::OpaqueRef(t); }\n        static cv::detail::OpaqueRef wrap_out  (      T &t) { return detail::OpaqueRef(t); }\n    };\n\n    // Tests if Trait for type T requires extra marshalling (\"custom wrap\") or not.\n    // If Traits<T> has wrap_value() defined, it does.\n    template<class T> struct has_custom_wrap\n    {\n        template<class,class> class check;\n        template<typename C> static std::true_type  test(check<C, decltype(&GTypeTraits<C>::wrap_value)> *);\n        template<typename C> static std::false_type test(...);\n        using type = decltype(test<T>(nullptr));\n        static const constexpr bool value = std::is_same<std::true_type, decltype(test<T>(nullptr))>::value;\n    };\n\n    // Resolve a Host type back to its associated G-Type.\n    // FIXME: Probably it can be avoided\n    // FIXME: GMatP is not present here.\n    // (Actually these traits is used only to check\n    // if associated G-type has custom wrap functions\n    // and GMat behavior is correct for GMatP)\n    template<typename T> struct GTypeOf;\n#if !defined(GAPI_STANDALONE)\n    template<>           struct GTypeOf<cv::UMat>              { using type = cv::GMat;      };\n#endif // !defined(GAPI_STANDALONE)\n    template<>           struct GTypeOf<cv::Mat>               { using type = cv::GMat;      };\n    template<>           struct GTypeOf<cv::RMat>              { using type = cv::GMat;      };\n    template<>           struct GTypeOf<cv::Scalar>            { using type = cv::GScalar;   };\n    template<typename U> struct GTypeOf<std::vector<U> >       { using type = cv::GArray<U>; };\n    template<typename U> struct GTypeOf                        { using type = cv::GOpaque<U>;};\n    template<>           struct GTypeOf<cv::MediaFrame>        { using type = cv::GFrame;    };\n    // FIXME: This is not quite correct since IStreamSource may produce not only Mat but also Scalar\n    // and vector data. TODO: Extend the type dispatching on these types too.\n    template<>           struct GTypeOf<cv::gapi::wip::IStreamSource::Ptr> { using type = cv::GMat;};\n    template<class T> using g_type_of_t = typename GTypeOf<T>::type;\n\n    // Marshalling helper for G-types and its Host types. Helps G-API\n    // to store G types in internal generic containers for further\n    // processing. Implements the following callbacks:\n    //\n    // * wrap() - converts user-facing G-type into an internal one\n    //   for internal storage.\n    //   Used when G-API operation is instantiated (G<Kernel>::on(),\n    //   etc) during expressing a pipeline. Mostly returns input\n    //   value \"as is\" except the case when G-type is a template. For\n    //   template G-classes, calls custom wrap() from Traits.\n    //   The value returned by wrap() is then wrapped into GArg() and\n    //   stored in G-API metadata.\n    //\n    //   Example:\n    //   - cv::GMat arguments are passed as-is.\n    //   - integers, pointers, STL containers, user types are passed as-is.\n    //   - cv::GArray<T> is converted to cv::GArrayU.\n    //\n    // * wrap_in() / wrap_out() - convert Host type associated with\n    //   G-type to internal representation type.\n    //\n    //   - For \"simple\" (non-template) G-types, returns value as-is.\n    //     Example: cv::GMat has host type cv::Mat, when user passes a\n    //              cv::Mat, system stores it internally as cv::Mat.\n    //\n    //   - For \"complex\" (template) G-types, utilizes custom\n    //     wrap_in()/wrap_out() as described in Traits.\n    //     Example: cv::GArray<T> has host type std::vector<T>, when\n    //              user passes a std::vector<T>, system stores it\n    //              internally as VectorRef (with <T> stripped away).\n    template<typename T, class Custom = void> struct WrapValue\n    {\n        static auto wrap(const T& t) ->\n            typename std::remove_reference<T>::type\n        {\n            return static_cast<typename std::remove_reference<T>::type>(t);\n        }\n\n        template<typename U> static U  wrap_in (const U &u) { return  u;  }\n        template<typename U> static U* wrap_out(U &u)       { return &u;  }\n    };\n    template<typename T> struct WrapValue<T, typename std::enable_if<has_custom_wrap<T>::value>::type>\n    {\n        static auto wrap(const T& t) -> decltype(GTypeTraits<T>::wrap_value(t))\n        {\n            return GTypeTraits<T>::wrap_value(t);\n        }\n        template<typename U> static auto wrap_in (const U &u) -> typename GTypeTraits<T>::strip_type\n        {\n            return GTypeTraits<T>::wrap_in(u);\n        }\n        template<typename U> static auto wrap_out(U &u) -> typename GTypeTraits<T>::strip_type\n        {\n            return GTypeTraits<T>::wrap_out(u);\n        }\n    };\n\n    template<typename T> using wrap_gapi_helper = WrapValue<typename std::decay<T>::type>;\n    template<typename T> using wrap_host_helper = WrapValue<typename std::decay<g_type_of_t<T> >::type>;\n\n// Union type for various user-defined type constructors (GArray<T>,\n// GOpaque<T>, etc)\n//\n// TODO: Replace construct-only API with a more generic one (probably\n//    with bits of introspection)\n//\n// Not required for non-user-defined types (GMat, GScalar, etc)\nusing HostCtor = util::variant\n    < util::monostate\n    , detail::ConstructVec\n    , detail::ConstructOpaque\n    >;\n\ntemplate<typename T> struct GObtainCtor {\n    static HostCtor get() { return HostCtor{}; }\n};\ntemplate<typename T> struct GObtainCtor<GArray<T> > {\n    static HostCtor get() { return HostCtor{ConstructVec{&GArray<T>::VCtor}}; };\n};\ntemplate<typename T> struct GObtainCtor<GOpaque<T> > {\n    static HostCtor get() { return HostCtor{ConstructOpaque{&GOpaque<T>::Ctor}}; };\n};\n} // namespace detail\n} // namespace cv\n\n#endif // OPENCV_GAPI_GTYPE_TRAITS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/gtyped.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GTYPED_HPP\n#define OPENCV_GAPI_GTYPED_HPP\n#if !defined(GAPI_STANDALONE)\n\n#include <vector>\n\n#include <opencv2/gapi/gcomputation.hpp>\n#include <opencv2/gapi/gcompiled.hpp>\n#include <opencv2/gapi/gproto.hpp>\n#include <opencv2/gapi/gcommon.hpp>\n\nnamespace cv {\n\nnamespace detail\n{\n    // FIXME: How to prevent coolhackers from extending it by their own types?\n    // FIXME: ...Should we care?\n    template<typename T> struct ProtoToParam;\n    template<> struct ProtoToParam<cv::GMat>    { using type = cv::Mat; };\n    template<> struct ProtoToParam<cv::GScalar> { using type = cv::Scalar; };\n    template<typename U> struct ProtoToParam<cv::GArray<U> >  { using type = std::vector<U>; };\n    template<> struct ProtoToParam<cv::GArray<cv::GMat>>      { using type = std::vector<cv::Mat>; };\n    template<typename U> struct ProtoToParam<cv::GOpaque<U> > { using type = U; };\n    template<typename T> using ProtoToParamT = typename ProtoToParam<T>::type;\n\n    template<typename T> struct ProtoToMeta;\n    template<> struct ProtoToMeta<cv::GMat>     { using type = cv::GMatDesc; };\n    template<> struct ProtoToMeta<cv::GScalar>  { using type = cv::GScalarDesc; };\n    template<typename U> struct ProtoToMeta<cv::GArray<U> >  { using type = cv::GArrayDesc; };\n    template<typename U> struct ProtoToMeta<cv::GOpaque<U> > { using type = cv::GOpaqueDesc; };\n    template<> struct ProtoToMeta<cv::GFrame>  { using type = cv::GFrameDesc; };\n    template<typename T> using ProtoToMetaT = typename ProtoToMeta<T>::type;\n\n    //workaround for MSVC 19.0 bug\n    template <typename T>\n    auto make_default()->decltype(T{}) {return {};}\n}; // detail\n\n/**\n * @brief This class is a typed wrapper over a regular GComputation.\n *\n * `std::function<>`-like template parameter specifies the graph\n *  signature so methods so the object's constructor, methods like\n *  `apply()` and the derived `GCompiledT::operator()` also become\n *  typed.\n *\n *  There is no need to use cv::gin() or cv::gout() modifiers with\n *  objects of this class.  Instead, all input arguments are followed\n *  by all output arguments in the order from the template argument\n *  signature.\n *\n *  Refer to the following example. Regular (untyped) code is written this way:\n *\n *  @snippet modules/gapi/samples/api_ref_snippets.cpp Untyped_Example\n *\n *  Here:\n *\n *  - cv::GComputation object is created with a lambda constructor\n *    where it is defined as a two-input, one-output graph.\n *\n *  - Its method `apply()` in fact takes arbitrary number of arguments\n *    (as vectors) so user can pass wrong number of inputs/outputs\n *    here. C++ compiler wouldn't notice that since the cv::GComputation\n *    API is polymorphic, and only a run-time error will be generated.\n *\n *  Now the same code written with typed API:\n *\n *  @snippet modules/gapi/samples/api_ref_snippets.cpp Typed_Example\n *\n *  The key difference is:\n *\n *  - Now the constructor lambda *must take* parameters and *must\n *    return* values as defined in the `GComputationT<>` signature.\n *  - Its method `apply()` does not require any extra specifiers to\n *    separate input arguments from the output ones\n *  - A `GCompiledT` (compilation product) takes input/output\n *    arguments with no extra specifiers as well.\n */\ntemplate<typename> class GComputationT;\n\n// Single return value implementation\ntemplate<typename R, typename... Args> class GComputationT<R(Args...)>\n{\npublic:\n    typedef std::function<R(Args...)> Gen;\n\n    class GCompiledT\n    {\n    private:\n        friend class GComputationT<R(Args...)>;\n\n        cv::GCompiled m_comp;\n\n        explicit GCompiledT(const cv::GCompiled &comp) : m_comp(comp) {}\n\n    public:\n        GCompiledT() {}\n\n        void operator()(detail::ProtoToParamT<Args>... inArgs,\n                        detail::ProtoToParamT<R> &outArg)\n        {\n            m_comp(cv::gin(inArgs...), cv::gout(outArg));\n        }\n\n        explicit operator bool() const\n        {\n            return static_cast<bool>(m_comp);\n        }\n    };\n\nprivate:\n    typedef std::pair<R, GProtoInputArgs > Captured;\n\n    Captured capture(const Gen& g, Args... args)\n    {\n        return Captured(g(args...), cv::GIn(args...));\n    }\n\n    Captured m_capture;\n    cv::GComputation m_comp;\n\npublic:\n    GComputationT(const Gen &generator)\n        : m_capture(capture(generator, detail::make_default<Args>()...))\n        , m_comp(cv::GProtoInputArgs(std::move(m_capture.second)),\n                 cv::GOut(m_capture.first))\n    {\n    }\n\n    void apply(detail::ProtoToParamT<Args>... inArgs,\n               detail::ProtoToParamT<R> &outArg,\n               GCompileArgs &&args)\n    {\n        m_comp.apply(cv::gin(inArgs...), cv::gout(outArg), std::move(args));\n    }\n\n    void apply(detail::ProtoToParamT<Args>... inArgs,\n               detail::ProtoToParamT<R> &outArg)\n    {\n        apply(inArgs..., outArg, GCompileArgs());\n    }\n\n\n    GCompiledT compile(detail::ProtoToMetaT<Args>... inDescs)\n    {\n        GMetaArgs inMetas = { GMetaArg(inDescs)... };\n        return GCompiledT(m_comp.compile(std::move(inMetas), GCompileArgs()));\n    }\n\n    GCompiledT compile(detail::ProtoToMetaT<Args>... inDescs, GCompileArgs &&args)\n    {\n        GMetaArgs inMetas = { GMetaArg(inDescs)... };\n        return GCompiledT(m_comp.compile(std::move(inMetas), std::move(args)));\n    }\n};\n\n// Multiple (fixed) return value implementation. FIXME: How to avoid copy-paste?\ntemplate<typename... R, typename... Args> class GComputationT<std::tuple<R...>(Args...)>\n{\npublic:\n    typedef std::function<std::tuple<R...>(Args...)> Gen;\n\n    class GCompiledT\n    {\n    private:\n        friend class GComputationT<std::tuple<R...>(Args...)>;\n\n        cv::GCompiled m_comp;\n        explicit GCompiledT(const cv::GCompiled &comp) : m_comp(comp) {}\n\n    public:\n        GCompiledT() {}\n\n        void operator()(detail::ProtoToParamT<Args>... inArgs,\n                        detail::ProtoToParamT<R>&... outArgs)\n        {\n            m_comp(cv::gin(inArgs...), cv::gout(outArgs...));\n        }\n\n        explicit operator bool() const\n        {\n            return static_cast<bool>(m_comp);\n        }\n    };\n\nprivate:\n    typedef std::pair<GProtoArgs, GProtoArgs> Captured;\n\n    template<int... IIs>\n    Captured capture(GProtoArgs &&args, const std::tuple<R...> &rr, detail::Seq<IIs...>)\n    {\n        return Captured(cv::GOut(std::get<IIs>(rr)...).m_args, args);\n    }\n\n    Captured capture(const Gen& g, Args... args)\n    {\n        return capture(cv::GIn(args...).m_args, g(args...), typename detail::MkSeq<sizeof...(R)>::type());\n    }\n\n    Captured m_capture;\n    cv::GComputation m_comp;\n\npublic:\n    GComputationT(const Gen &generator)\n        : m_capture(capture(generator, detail::make_default<Args>()...))\n        , m_comp(cv::GProtoInputArgs(std::move(m_capture.second)),\n                 cv::GProtoOutputArgs(std::move(m_capture.first)))\n    {\n    }\n\n    void apply(detail::ProtoToParamT<Args>... inArgs,\n               detail::ProtoToParamT<R>&... outArgs,\n               GCompileArgs &&args)\n    {\n        m_comp.apply(cv::gin(inArgs...), cv::gout(outArgs...), std::move(args));\n    }\n\n    void apply(detail::ProtoToParamT<Args>... inArgs,\n               detail::ProtoToParamT<R>&... outArgs)\n    {\n        apply(inArgs..., outArgs..., GCompileArgs());\n    }\n\n\n    GCompiledT compile(detail::ProtoToMetaT<Args>... inDescs)\n    {\n        GMetaArgs inMetas = { GMetaArg(inDescs)... };\n        return GCompiledT(m_comp.compile(std::move(inMetas), GCompileArgs()));\n    }\n\n    GCompiledT compile(detail::ProtoToMetaT<Args>... inDescs, GCompileArgs &&args)\n    {\n        GMetaArgs inMetas = { GMetaArg(inDescs)... };\n        return GCompiledT(m_comp.compile(std::move(inMetas), std::move(args)));\n    }\n};\n\n} // namespace cv\n#endif // !defined(GAPI_STANDALONE)\n#endif // OPENCV_GAPI_GTYPED_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/imgproc.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_IMGPROC_HPP\n#define OPENCV_GAPI_IMGPROC_HPP\n\n#include <opencv2/imgproc.hpp>\n\n#include <utility> // std::tuple\n\n#include <opencv2/gapi/gkernel.hpp>\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/gscalar.hpp>\n\n\n/** \\defgroup gapi_imgproc G-API Image processing functionality\n@{\n    @defgroup gapi_filters Graph API: Image filters\n    @defgroup gapi_colorconvert Graph API: Converting image from one color space to another\n    @defgroup gapi_feature Graph API: Image Feature Detection\n    @defgroup gapi_shape Graph API: Image Structural Analysis and Shape Descriptors\n@}\n */\n\nnamespace {\nvoid validateFindingContoursMeta(const int depth, const int chan, const int mode)\n{\n    GAPI_Assert(chan == 1);\n    switch (mode)\n    {\n    case cv::RETR_CCOMP:\n        GAPI_Assert(depth == CV_8U || depth == CV_32S);\n        break;\n    case cv::RETR_FLOODFILL:\n        GAPI_Assert(depth == CV_32S);\n        break;\n    default:\n        GAPI_Assert(depth == CV_8U);\n        break;\n    }\n}\n} // anonymous namespace\n\nnamespace cv { namespace gapi {\n\n/**\n * @brief This namespace contains G-API Operation Types for OpenCV\n * ImgProc module functionality.\n */\nnamespace imgproc {\n    using GMat2 = std::tuple<GMat,GMat>;\n    using GMat3 = std::tuple<GMat,GMat,GMat>; // FIXME: how to avoid this?\n    using GFindContoursOutput = std::tuple<GArray<GArray<Point>>,GArray<Vec4i>>;\n\n    G_TYPED_KERNEL(GFilter2D, <GMat(GMat,int,Mat,Point,Scalar,int,Scalar)>,\"org.opencv.imgproc.filters.filter2D\") {\n        static GMatDesc outMeta(GMatDesc in, int ddepth, Mat, Point, Scalar, int, Scalar) {\n            return in.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GSepFilter, <GMat(GMat,int,Mat,Mat,Point,Scalar,int,Scalar)>, \"org.opencv.imgproc.filters.sepfilter\") {\n        static GMatDesc outMeta(GMatDesc in, int ddepth, Mat, Mat, Point, Scalar, int, Scalar) {\n            return in.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GBoxFilter, <GMat(GMat,int,Size,Point,bool,int,Scalar)>, \"org.opencv.imgproc.filters.boxfilter\") {\n        static GMatDesc outMeta(GMatDesc in, int ddepth, Size, Point, bool, int, Scalar) {\n            return in.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GBlur, <GMat(GMat,Size,Point,int,Scalar)>,         \"org.opencv.imgproc.filters.blur\"){\n        static GMatDesc outMeta(GMatDesc in, Size, Point, int, Scalar) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GGaussBlur, <GMat(GMat,Size,double,double,int,Scalar)>, \"org.opencv.imgproc.filters.gaussianBlur\") {\n        static GMatDesc outMeta(GMatDesc in, Size, double, double, int, Scalar) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GMedianBlur, <GMat(GMat,int)>, \"org.opencv.imgproc.filters.medianBlur\") {\n        static GMatDesc outMeta(GMatDesc in, int) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GErode, <GMat(GMat,Mat,Point,int,int,Scalar)>, \"org.opencv.imgproc.filters.erode\") {\n        static GMatDesc outMeta(GMatDesc in, Mat, Point, int, int, Scalar) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GDilate, <GMat(GMat,Mat,Point,int,int,Scalar)>, \"org.opencv.imgproc.filters.dilate\") {\n        static GMatDesc outMeta(GMatDesc in, Mat, Point, int, int, Scalar) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GMorphologyEx, <GMat(GMat,MorphTypes,Mat,Point,int,BorderTypes,Scalar)>,\n                   \"org.opencv.imgproc.filters.morphologyEx\") {\n        static GMatDesc outMeta(const GMatDesc &in, MorphTypes, Mat, Point, int,\n                                BorderTypes, Scalar) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GSobel, <GMat(GMat,int,int,int,int,double,double,int,Scalar)>, \"org.opencv.imgproc.filters.sobel\") {\n        static GMatDesc outMeta(GMatDesc in, int ddepth, int, int, int, double, double, int, Scalar) {\n            return in.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL_M(GSobelXY, <GMat2(GMat,int,int,int,double,double,int,Scalar)>, \"org.opencv.imgproc.filters.sobelxy\") {\n        static std::tuple<GMatDesc, GMatDesc> outMeta(GMatDesc in, int ddepth, int, int, double, double, int, Scalar) {\n            return std::make_tuple(in.withDepth(ddepth), in.withDepth(ddepth));\n        }\n    };\n\n    G_TYPED_KERNEL(GLaplacian, <GMat(GMat,int, int, double, double, int)>,\n                   \"org.opencv.imgproc.filters.laplacian\") {\n        static GMatDesc outMeta(GMatDesc in, int ddepth, int, double, double, int) {\n            return in.withDepth(ddepth);\n        }\n    };\n\n    G_TYPED_KERNEL(GBilateralFilter, <GMat(GMat,int, double, double, int)>,\n                   \"org.opencv.imgproc.filters.bilateralfilter\") {\n        static GMatDesc outMeta(GMatDesc in, int, double, double, int) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GEqHist, <GMat(GMat)>, \"org.opencv.imgproc.equalizeHist\"){\n        static GMatDesc outMeta(GMatDesc in) {\n            return in.withType(CV_8U, 1);\n        }\n    };\n\n    G_TYPED_KERNEL(GCanny, <GMat(GMat,double,double,int,bool)>, \"org.opencv.imgproc.feature.canny\"){\n        static GMatDesc outMeta(GMatDesc in, double, double, int, bool) {\n            return in.withType(CV_8U, 1);\n        }\n    };\n\n    G_TYPED_KERNEL(GGoodFeatures,\n                   <cv::GArray<cv::Point2f>(GMat,int,double,double,Mat,int,bool,double)>,\n                   \"org.opencv.imgproc.feature.goodFeaturesToTrack\") {\n        static GArrayDesc outMeta(GMatDesc, int, double, double, const Mat&, int, bool, double) {\n            return empty_array_desc();\n        }\n    };\n\n    using RetrMode = RetrievalModes;\n    using ContMethod = ContourApproximationModes;\n    G_TYPED_KERNEL(GFindContours, <GArray<GArray<Point>>(GMat,RetrMode,ContMethod,GOpaque<Point>)>,\n                   \"org.opencv.imgproc.shape.findContours\")\n    {\n        static GArrayDesc outMeta(GMatDesc in, RetrMode mode, ContMethod, GOpaqueDesc)\n        {\n            validateFindingContoursMeta(in.depth, in.chan, mode);\n            return empty_array_desc();\n        }\n    };\n\n    // FIXME oc: make default value offset = Point()\n    G_TYPED_KERNEL(GFindContoursNoOffset, <GArray<GArray<Point>>(GMat,RetrMode,ContMethod)>,\n                   \"org.opencv.imgproc.shape.findContoursNoOffset\")\n    {\n        static GArrayDesc outMeta(GMatDesc in, RetrMode mode, ContMethod)\n        {\n            validateFindingContoursMeta(in.depth, in.chan, mode);\n            return empty_array_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GFindContoursH,<GFindContoursOutput(GMat,RetrMode,ContMethod,GOpaque<Point>)>,\n                   \"org.opencv.imgproc.shape.findContoursH\")\n    {\n        static std::tuple<GArrayDesc,GArrayDesc>\n        outMeta(GMatDesc in, RetrMode mode, ContMethod, GOpaqueDesc)\n        {\n            validateFindingContoursMeta(in.depth, in.chan, mode);\n            return std::make_tuple(empty_array_desc(), empty_array_desc());\n        }\n    };\n\n    // FIXME oc: make default value offset = Point()\n    G_TYPED_KERNEL(GFindContoursHNoOffset,<GFindContoursOutput(GMat,RetrMode,ContMethod)>,\n                   \"org.opencv.imgproc.shape.findContoursHNoOffset\")\n    {\n        static std::tuple<GArrayDesc,GArrayDesc>\n        outMeta(GMatDesc in, RetrMode mode, ContMethod)\n        {\n            validateFindingContoursMeta(in.depth, in.chan, mode);\n            return std::make_tuple(empty_array_desc(), empty_array_desc());\n        }\n    };\n\n    G_TYPED_KERNEL(GBoundingRectMat, <GOpaque<Rect>(GMat)>,\n                   \"org.opencv.imgproc.shape.boundingRectMat\") {\n        static GOpaqueDesc outMeta(GMatDesc in) {\n            if (in.depth == CV_8U)\n            {\n                GAPI_Assert(in.chan == 1);\n            }\n            else\n            {\n                GAPI_Assert (in.depth == CV_32S || in.depth == CV_32F);\n                int amount = detail::checkVector(in, 2u);\n                GAPI_Assert(amount != -1 &&\n                            \"Input Mat can't be described as vector of 2-dimentional points\");\n            }\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GBoundingRectVector32S, <GOpaque<Rect>(GArray<Point2i>)>,\n                   \"org.opencv.imgproc.shape.boundingRectVector32S\") {\n        static GOpaqueDesc outMeta(GArrayDesc) {\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GBoundingRectVector32F, <GOpaque<Rect>(GArray<Point2f>)>,\n                   \"org.opencv.imgproc.shape.boundingRectVector32F\") {\n        static GOpaqueDesc outMeta(GArrayDesc) {\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GFitLine2DMat, <GOpaque<Vec4f>(GMat,DistanceTypes,double,double,double)>,\n                   \"org.opencv.imgproc.shape.fitLine2DMat\") {\n        static GOpaqueDesc outMeta(GMatDesc in,DistanceTypes,double,double,double) {\n            int amount = detail::checkVector(in, 2u);\n            GAPI_Assert(amount != -1 &&\n                        \"Input Mat can't be described as vector of 2-dimentional points\");\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GFitLine2DVector32S,\n                   <GOpaque<Vec4f>(GArray<Point2i>,DistanceTypes,double,double,double)>,\n                   \"org.opencv.imgproc.shape.fitLine2DVector32S\") {\n        static GOpaqueDesc outMeta(GArrayDesc,DistanceTypes,double,double,double) {\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GFitLine2DVector32F,\n                   <GOpaque<Vec4f>(GArray<Point2f>,DistanceTypes,double,double,double)>,\n                   \"org.opencv.imgproc.shape.fitLine2DVector32F\") {\n        static GOpaqueDesc outMeta(GArrayDesc,DistanceTypes,double,double,double) {\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GFitLine2DVector64F,\n                   <GOpaque<Vec4f>(GArray<Point2d>,DistanceTypes,double,double,double)>,\n                   \"org.opencv.imgproc.shape.fitLine2DVector64F\") {\n        static GOpaqueDesc outMeta(GArrayDesc,DistanceTypes,double,double,double) {\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GFitLine3DMat, <GOpaque<Vec6f>(GMat,DistanceTypes,double,double,double)>,\n                   \"org.opencv.imgproc.shape.fitLine3DMat\") {\n        static GOpaqueDesc outMeta(GMatDesc in,int,double,double,double) {\n            int amount = detail::checkVector(in, 3u);\n            GAPI_Assert(amount != -1 &&\n                        \"Input Mat can't be described as vector of 3-dimentional points\");\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GFitLine3DVector32S,\n                   <GOpaque<Vec6f>(GArray<Point3i>,DistanceTypes,double,double,double)>,\n                   \"org.opencv.imgproc.shape.fitLine3DVector32S\") {\n        static GOpaqueDesc outMeta(GArrayDesc,DistanceTypes,double,double,double) {\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GFitLine3DVector32F,\n                   <GOpaque<Vec6f>(GArray<Point3f>,DistanceTypes,double,double,double)>,\n                   \"org.opencv.imgproc.shape.fitLine3DVector32F\") {\n        static GOpaqueDesc outMeta(GArrayDesc,DistanceTypes,double,double,double) {\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GFitLine3DVector64F,\n                   <GOpaque<Vec6f>(GArray<Point3d>,DistanceTypes,double,double,double)>,\n                   \"org.opencv.imgproc.shape.fitLine3DVector64F\") {\n        static GOpaqueDesc outMeta(GArrayDesc,DistanceTypes,double,double,double) {\n            return empty_gopaque_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GBGR2RGB, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.bgr2rgb\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in; // type still remains CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GRGB2YUV, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.rgb2yuv\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in; // type still remains CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GYUV2RGB, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.yuv2rgb\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in; // type still remains CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GBGR2I420, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.bgr2i420\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            GAPI_Assert(in.depth == CV_8U);\n            GAPI_Assert(in.chan == 3);\n            GAPI_Assert(in.size.height % 2 == 0);\n            return in.withType(in.depth, 1).withSize(Size(in.size.width, in.size.height * 3 / 2));\n        }\n    };\n\n    G_TYPED_KERNEL(GRGB2I420, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.rgb2i420\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            GAPI_Assert(in.depth == CV_8U);\n            GAPI_Assert(in.chan == 3);\n            GAPI_Assert(in.size.height % 2 == 0);\n            return in.withType(in.depth, 1).withSize(Size(in.size.width, in.size.height * 3 / 2));\n        }\n    };\n\n    G_TYPED_KERNEL(GI4202BGR, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.i4202bgr\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            GAPI_Assert(in.depth == CV_8U);\n            GAPI_Assert(in.chan == 1);\n            GAPI_Assert(in.size.height % 3 == 0);\n            return in.withType(in.depth, 3).withSize(Size(in.size.width, in.size.height * 2 / 3));\n        }\n    };\n\n    G_TYPED_KERNEL(GI4202RGB, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.i4202rgb\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            GAPI_Assert(in.depth == CV_8U);\n            GAPI_Assert(in.chan == 1);\n            GAPI_Assert(in.size.height % 3 == 0);\n            return in.withType(in.depth, 3).withSize(Size(in.size.width, in.size.height * 2 / 3));\n        }\n    };\n\n    G_TYPED_KERNEL(GNV12toRGB, <GMat(GMat, GMat)>, \"org.opencv.imgproc.colorconvert.nv12torgb\") {\n        static GMatDesc outMeta(GMatDesc in_y, GMatDesc in_uv) {\n            GAPI_Assert(in_y.chan == 1);\n            GAPI_Assert(in_uv.chan == 2);\n            GAPI_Assert(in_y.depth == CV_8U);\n            GAPI_Assert(in_uv.depth == CV_8U);\n            // UV size should be aligned with Y\n            GAPI_Assert(in_y.size.width == 2 * in_uv.size.width);\n            GAPI_Assert(in_y.size.height == 2 * in_uv.size.height);\n            return in_y.withType(CV_8U, 3); // type will be CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GNV12toBGR, <GMat(GMat, GMat)>, \"org.opencv.imgproc.colorconvert.nv12tobgr\") {\n        static GMatDesc outMeta(GMatDesc in_y, GMatDesc in_uv) {\n            GAPI_Assert(in_y.chan == 1);\n            GAPI_Assert(in_uv.chan == 2);\n            GAPI_Assert(in_y.depth == CV_8U);\n            GAPI_Assert(in_uv.depth == CV_8U);\n            // UV size should be aligned with Y\n            GAPI_Assert(in_y.size.width == 2 * in_uv.size.width);\n            GAPI_Assert(in_y.size.height == 2 * in_uv.size.height);\n            return in_y.withType(CV_8U, 3); // type will be CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GRGB2Lab, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.rgb2lab\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in; // type still remains CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GBGR2LUV, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.bgr2luv\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in; // type still remains CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GLUV2BGR, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.luv2bgr\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in; // type still remains CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GYUV2BGR, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.yuv2bgr\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in; // type still remains CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GBGR2YUV, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.bgr2yuv\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in; // type still remains CV_8UC3;\n        }\n    };\n\n    G_TYPED_KERNEL(GRGB2Gray, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.rgb2gray\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in.withType(CV_8U, 1);\n        }\n    };\n\n    G_TYPED_KERNEL(GRGB2GrayCustom, <GMat(GMat,float,float,float)>, \"org.opencv.imgproc.colorconvert.rgb2graycustom\") {\n        static GMatDesc outMeta(GMatDesc in, float, float, float) {\n            return in.withType(CV_8U, 1);\n        }\n    };\n\n    G_TYPED_KERNEL(GBGR2Gray, <GMat(GMat)>, \"org.opencv.imgproc.colorconvert.bgr2gray\") {\n        static GMatDesc outMeta(GMatDesc in) {\n            return in.withType(CV_8U, 1);\n        }\n    };\n\n    G_TYPED_KERNEL(GBayerGR2RGB, <cv::GMat(cv::GMat)>, \"org.opencv.imgproc.colorconvert.bayergr2rgb\") {\n        static cv::GMatDesc outMeta(cv::GMatDesc in) {\n            return in.withType(CV_8U, 3);\n        }\n    };\n\n    G_TYPED_KERNEL(GRGB2HSV, <cv::GMat(cv::GMat)>, \"org.opencv.imgproc.colorconvert.rgb2hsv\") {\n        static cv::GMatDesc outMeta(cv::GMatDesc in) {\n            return in;\n        }\n    };\n\n    G_TYPED_KERNEL(GRGB2YUV422, <cv::GMat(cv::GMat)>, \"org.opencv.imgproc.colorconvert.rgb2yuv422\") {\n        static cv::GMatDesc outMeta(cv::GMatDesc in) {\n            GAPI_Assert(in.depth == CV_8U);\n            GAPI_Assert(in.chan == 3);\n            return in.withType(in.depth, 2);\n        }\n    };\n\n    G_TYPED_KERNEL(GNV12toRGBp, <GMatP(GMat,GMat)>, \"org.opencv.imgproc.colorconvert.nv12torgbp\") {\n        static GMatDesc outMeta(GMatDesc inY, GMatDesc inUV) {\n            GAPI_Assert(inY.depth == CV_8U);\n            GAPI_Assert(inUV.depth == CV_8U);\n            GAPI_Assert(inY.chan == 1);\n            GAPI_Assert(inY.planar == false);\n            GAPI_Assert(inUV.chan == 2);\n            GAPI_Assert(inUV.planar == false);\n            GAPI_Assert(inY.size.width  == 2 * inUV.size.width);\n            GAPI_Assert(inY.size.height == 2 * inUV.size.height);\n            return inY.withType(CV_8U, 3).asPlanar();\n        }\n    };\n\n    G_TYPED_KERNEL(GNV12toGray, <GMat(GMat,GMat)>, \"org.opencv.imgproc.colorconvert.nv12togray\") {\n        static GMatDesc outMeta(GMatDesc inY, GMatDesc inUV) {\n            GAPI_Assert(inY.depth   == CV_8U);\n            GAPI_Assert(inUV.depth  == CV_8U);\n            GAPI_Assert(inY.chan    == 1);\n            GAPI_Assert(inY.planar  == false);\n            GAPI_Assert(inUV.chan   == 2);\n            GAPI_Assert(inUV.planar == false);\n\n            GAPI_Assert(inY.size.width  == 2 * inUV.size.width);\n            GAPI_Assert(inY.size.height == 2 * inUV.size.height);\n            return inY.withType(CV_8U, 1);\n        }\n    };\n\n    G_TYPED_KERNEL(GNV12toBGRp, <GMatP(GMat,GMat)>, \"org.opencv.imgproc.colorconvert.nv12tobgrp\") {\n        static GMatDesc outMeta(GMatDesc inY, GMatDesc inUV) {\n            GAPI_Assert(inY.depth == CV_8U);\n            GAPI_Assert(inUV.depth == CV_8U);\n            GAPI_Assert(inY.chan == 1);\n            GAPI_Assert(inY.planar == false);\n            GAPI_Assert(inUV.chan == 2);\n            GAPI_Assert(inUV.planar == false);\n            GAPI_Assert(inY.size.width  == 2 * inUV.size.width);\n            GAPI_Assert(inY.size.height == 2 * inUV.size.height);\n            return inY.withType(CV_8U, 3).asPlanar();\n        }\n    };\n\n} //namespace imgproc\n\n//! @addtogroup gapi_filters\n//! @{\n/** @brief Applies a separable linear filter to a matrix(image).\n\nThe function applies a separable linear filter to the matrix. That is, first, every row of src is\nfiltered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D\nkernel kernelY. The final result is returned.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\nOutput image must have the same type, size, and number of channels as the input image.\n@note\n - In case of floating-point computation, rounding to nearest even is procedeed\nif hardware supports it (if not - to nearest value).\n - Function textual ID is \"org.opencv.imgproc.filters.sepfilter\"\n@param src Source image.\n@param ddepth desired depth of the destination image (the following combinations of src.depth() and ddepth are supported:\n\n        src.depth() = CV_8U, ddepth = -1/CV_16S/CV_32F/CV_64F\n        src.depth() = CV_16U/CV_16S, ddepth = -1/CV_32F/CV_64F\n        src.depth() = CV_32F, ddepth = -1/CV_32F/CV_64F\n        src.depth() = CV_64F, ddepth = -1/CV_64F\n\nwhen ddepth=-1, the output image will have the same depth as the source)\n@param kernelX Coefficients for filtering each row.\n@param kernelY Coefficients for filtering each column.\n@param anchor Anchor position within the kernel. The default value \\f$(-1,-1)\\f$ means that the anchor\nis at the kernel center.\n@param delta Value added to the filtered results before storing them.\n@param borderType Pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of constant border type\n@sa  boxFilter, gaussianBlur, medianBlur\n */\nGAPI_EXPORTS GMat sepFilter(const GMat& src, int ddepth, const Mat& kernelX, const Mat& kernelY, const Point& anchor /*FIXME: = Point(-1,-1)*/,\n                            const Scalar& delta /*FIXME = GScalar(0)*/, int borderType = BORDER_DEFAULT,\n                            const Scalar& borderValue = Scalar(0));\n\n/** @brief Convolves an image with the kernel.\n\nThe function applies an arbitrary linear filter to an image. When\nthe aperture is partially outside the image, the function interpolates outlier pixel values\naccording to the specified border mode.\n\nThe function does actually compute correlation, not the convolution:\n\n\\f[\\texttt{dst} (x,y) =  \\sum _{ \\substack{0\\leq x' < \\texttt{kernel.cols}\\\\{0\\leq y' < \\texttt{kernel.rows}}}}  \\texttt{kernel} (x',y')* \\texttt{src} (x+x'- \\texttt{anchor.x} ,y+y'- \\texttt{anchor.y} )\\f]\n\nThat is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip\nthe kernel using flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows -\nanchor.y - 1)`.\n\nSupported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\nOutput image must have the same size and number of channels an input image.\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.filter2D\"\n\n@param src input image.\n@param ddepth desired depth of the destination image\n@param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point\nmatrix; if you want to apply different kernels to different channels, split the image into\nseparate color planes using split and process them individually.\n@param anchor anchor of the kernel that indicates the relative position of a filtered point within\nthe kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor\nis at the kernel center.\n@param delta optional value added to the filtered pixels before storing them in dst.\n@param borderType pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of constant border type\n@sa  sepFilter\n */\nGAPI_EXPORTS GMat filter2D(const GMat& src, int ddepth, const Mat& kernel, const Point& anchor = Point(-1,-1), const Scalar& delta = Scalar(0),\n                           int borderType = BORDER_DEFAULT, const Scalar& borderValue = Scalar(0));\n\n\n/** @brief Blurs an image using the box filter.\n\nThe function smooths an image using the kernel:\n\n\\f[\\texttt{K} =  \\alpha \\begin{bmatrix} 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ \\hdotsfor{6} \\\\ 1 & 1 & 1 &  \\cdots & 1 & 1 \\end{bmatrix}\\f]\n\nwhere\n\n\\f[\\alpha = \\begin{cases} \\frac{1}{\\texttt{ksize.width*ksize.height}} & \\texttt{when } \\texttt{normalize=true}  \\\\1 & \\texttt{otherwise} \\end{cases}\\f]\n\nUnnormalized box filter is useful for computing various integral characteristics over each pixel\nneighborhood, such as covariance matrices of image derivatives (used in dense optical flow\nalgorithms, and so on). If you need to compute pixel sums over variable-size windows, use cv::integral.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\nOutput image must have the same type, size, and number of channels as the input image.\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.boxfilter\"\n\n@param src Source image.\n@param dtype the output image depth (-1 to set the input image data type).\n@param ksize blurring kernel size.\n@param anchor Anchor position within the kernel. The default value \\f$(-1,-1)\\f$ means that the anchor\nis at the kernel center.\n@param normalize flag, specifying whether the kernel is normalized by its area or not.\n@param borderType Pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of constant border type\n@sa  sepFilter, gaussianBlur, medianBlur, integral\n */\nGAPI_EXPORTS GMat boxFilter(const GMat& src, int dtype, const Size& ksize, const Point& anchor = Point(-1,-1),\n                            bool normalize = true, int borderType = BORDER_DEFAULT,\n                            const Scalar& borderValue = Scalar(0));\n\n/** @brief Blurs an image using the normalized box filter.\n\nThe function smooths an image using the kernel:\n\n\\f[\\texttt{K} =  \\frac{1}{\\texttt{ksize.width*ksize.height}} \\begin{bmatrix} 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ \\hdotsfor{6} \\\\ 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ \\end{bmatrix}\\f]\n\nThe call `blur(src, ksize, anchor, borderType)` is equivalent to `boxFilter(src, src.type(), ksize, anchor,\ntrue, borderType)`.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\nOutput image must have the same type, size, and number of channels as the input image.\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.blur\"\n\n@param src Source image.\n@param ksize blurring kernel size.\n@param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel\ncenter.\n@param borderType border mode used to extrapolate pixels outside of the image, see cv::BorderTypes\n@param borderValue border value in case of constant border type\n@sa  boxFilter, bilateralFilter, GaussianBlur, medianBlur\n */\nGAPI_EXPORTS GMat blur(const GMat& src, const Size& ksize, const Point& anchor = Point(-1,-1),\n                       int borderType = BORDER_DEFAULT, const Scalar& borderValue = Scalar(0));\n\n\n//GAPI_EXPORTS_W void blur( InputArray src, OutputArray dst,\n //                       Size ksize, Point anchor = Point(-1,-1),\n //                       int borderType = BORDER_DEFAULT );\n\n\n/** @brief Blurs an image using a Gaussian filter.\n\nThe function filter2Ds the source image with the specified Gaussian kernel.\nOutput image must have the same type and number of channels an input image.\n\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1.\nOutput image must have the same type, size, and number of channels as the input image.\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.gaussianBlur\"\n\n@param src input image;\n@param ksize Gaussian kernel size. ksize.width and ksize.height can differ but they both must be\npositive and odd. Or, they can be zero's and then they are computed from sigma.\n@param sigmaX Gaussian kernel standard deviation in X direction.\n@param sigmaY Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be\nequal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height,\nrespectively (see cv::getGaussianKernel for details); to fully control the result regardless of\npossible future modifications of all this semantics, it is recommended to specify all of ksize,\nsigmaX, and sigmaY.\n@param borderType pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of constant border type\n@sa  sepFilter, boxFilter, medianBlur\n */\nGAPI_EXPORTS GMat gaussianBlur(const GMat& src, const Size& ksize, double sigmaX, double sigmaY = 0,\n                               int borderType = BORDER_DEFAULT, const Scalar& borderValue = Scalar(0));\n\n/** @brief Blurs an image using the median filter.\n\nThe function smoothes an image using the median filter with the \\f$\\texttt{ksize} \\times\n\\texttt{ksize}\\f$ aperture. Each channel of a multi-channel image is processed independently.\nOutput image must have the same type, size, and number of channels as the input image.\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\nThe median filter uses cv::BORDER_REPLICATE internally to cope with border pixels, see cv::BorderTypes\n - Function textual ID is \"org.opencv.imgproc.filters.medianBlur\"\n\n@param src input matrix (image)\n@param ksize aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...\n@sa  boxFilter, gaussianBlur\n */\nGAPI_EXPORTS_W GMat medianBlur(const GMat& src, int ksize);\n\n/** @brief Erodes an image by using a specific structuring element.\n\nThe function erodes the source image using the specified structuring element that determines the\nshape of a pixel neighborhood over which the minimum is taken:\n\n\\f[\\texttt{dst} (x,y) =  \\min _{(x',y'):  \\, \\texttt{element} (x',y') \\ne0 } \\texttt{src} (x+x',y+y')\\f]\n\nErosion can be applied several (iterations) times. In case of multi-channel images, each channel is processed independently.\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, and @ref CV_32FC1.\nOutput image must have the same type, size, and number of channels as the input image.\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.erode\"\n\n@param src input image\n@param kernel structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular\nstructuring element is used. Kernel can be created using getStructuringElement.\n@param anchor position of the anchor within the element; default value (-1, -1) means that the\nanchor is at the element center.\n@param iterations number of times erosion is applied.\n@param borderType pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of a constant border\n@sa  dilate, morphologyEx\n */\nGAPI_EXPORTS GMat erode(const GMat& src, const Mat& kernel, const Point& anchor = Point(-1,-1), int iterations = 1,\n                        int borderType = BORDER_CONSTANT,\n                        const  Scalar& borderValue = morphologyDefaultBorderValue());\n\n/** @brief Erodes an image by using 3 by 3 rectangular structuring element.\n\nThe function erodes the source image using the rectangular structuring element with rectangle center as an anchor.\nErosion can be applied several (iterations) times. In case of multi-channel images, each channel is processed independently.\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, and @ref CV_32FC1.\nOutput image must have the same type, size, and number of channels as the input image.\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.erode\"\n\n@param src input image\n@param iterations number of times erosion is applied.\n@param borderType pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of a constant border\n@sa  erode, dilate3x3\n */\nGAPI_EXPORTS GMat erode3x3(const GMat& src, int iterations = 1,\n                           int borderType = BORDER_CONSTANT,\n                           const  Scalar& borderValue = morphologyDefaultBorderValue());\n\n/** @brief Dilates an image by using a specific structuring element.\n\nThe function dilates the source image using the specified structuring element that determines the\nshape of a pixel neighborhood over which the maximum is taken:\n\\f[\\texttt{dst} (x,y) =  \\max _{(x',y'):  \\, \\texttt{element} (x',y') \\ne0 } \\texttt{src} (x+x',y+y')\\f]\n\nDilation can be applied several (iterations) times. In case of multi-channel images, each channel is processed independently.\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, and @ref CV_32FC1.\nOutput image must have the same type, size, and number of channels as the input image.\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.dilate\"\n\n@param src input image.\n@param kernel structuring element used for dilation; if elemenat=Mat(), a 3 x 3 rectangular\nstructuring element is used. Kernel can be created using getStructuringElement\n@param anchor position of the anchor within the element; default value (-1, -1) means that the\nanchor is at the element center.\n@param iterations number of times dilation is applied.\n@param borderType pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of a constant border\n@sa  erode, morphologyEx, getStructuringElement\n */\nGAPI_EXPORTS GMat dilate(const GMat& src, const Mat& kernel, const Point& anchor = Point(-1,-1), int iterations = 1,\n                         int borderType = BORDER_CONSTANT,\n                         const  Scalar& borderValue = morphologyDefaultBorderValue());\n\n/** @brief Dilates an image by using 3 by 3 rectangular structuring element.\n\nThe function dilates the source image using the specified structuring element that determines the\nshape of a pixel neighborhood over which the maximum is taken:\n\\f[\\texttt{dst} (x,y) =  \\max _{(x',y'):  \\, \\texttt{element} (x',y') \\ne0 } \\texttt{src} (x+x',y+y')\\f]\n\nDilation can be applied several (iterations) times. In case of multi-channel images, each channel is processed independently.\nSupported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, and @ref CV_32FC1.\nOutput image must have the same type, size, and number of channels as the input image.\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.dilate\"\n\n@param src input image.\n@param iterations number of times dilation is applied.\n@param borderType pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of a constant border\n@sa  dilate, erode3x3\n */\n\nGAPI_EXPORTS GMat dilate3x3(const GMat& src, int iterations = 1,\n                            int borderType = BORDER_CONSTANT,\n                            const  Scalar& borderValue = morphologyDefaultBorderValue());\n\n/** @brief Performs advanced morphological transformations.\n\nThe function can perform advanced morphological transformations using an erosion and dilation as\nbasic operations.\n\nAny of the operations can be done in-place. In case of multi-channel images, each channel is\nprocessed independently.\n\n@note\n - Function textual ID is \"org.opencv.imgproc.filters.morphologyEx\"\n - The number of iterations is the number of times erosion or dilatation operation will be\napplied. For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to\napply successively: erode -> erode -> dilate -> dilate\n(and not erode -> dilate -> erode -> dilate).\n\n@param src Input image.\n@param op Type of a morphological operation, see #MorphTypes\n@param kernel Structuring element. It can be created using #getStructuringElement.\n@param anchor Anchor position within the element. Both negative values mean that the anchor is at\nthe kernel center.\n@param iterations Number of times erosion and dilation are applied.\n@param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n@param borderValue Border value in case of a constant border. The default value has a special\nmeaning.\n@sa  dilate, erode, getStructuringElement\n */\nGAPI_EXPORTS GMat morphologyEx(const GMat &src, const MorphTypes op, const Mat &kernel,\n                               const Point       &anchor      = Point(-1,-1),\n                               const int          iterations  = 1,\n                               const BorderTypes  borderType  = BORDER_CONSTANT,\n                               const Scalar      &borderValue = morphologyDefaultBorderValue());\n\n/** @brief Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.\n\nIn all cases except one, the \\f$\\texttt{ksize} \\times \\texttt{ksize}\\f$ separable kernel is used to\ncalculate the derivative. When \\f$\\texttt{ksize = 1}\\f$, the \\f$3 \\times 1\\f$ or \\f$1 \\times 3\\f$\nkernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first\nor the second x- or y- derivatives.\n\nThere is also the special value `ksize = FILTER_SCHARR (-1)` that corresponds to the \\f$3\\times3\\f$ Scharr\nfilter that may give more accurate results than the \\f$3\\times3\\f$ Sobel. The Scharr aperture is\n\n\\f[\\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\\f]\n\nfor the x-derivative, or transposed for the y-derivative.\n\nThe function calculates an image derivative by convolving the image with the appropriate kernel:\n\n\\f[\\texttt{dst} =  \\frac{\\partial^{xorder+yorder} \\texttt{src}}{\\partial x^{xorder} \\partial y^{yorder}}\\f]\n\nThe Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less\nresistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)\nor ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first\ncase corresponds to a kernel of:\n\n\\f[\\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\\f]\n\nThe second case corresponds to a kernel of:\n\n\\f[\\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\\f]\n\n@note\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.sobel\"\n\n@param src input image.\n@param ddepth output image depth, see @ref filter_depths \"combinations\"; in the case of\n    8-bit input images it will result in truncated derivatives.\n@param dx order of the derivative x.\n@param dy order of the derivative y.\n@param ksize size of the extended Sobel kernel; it must be odd.\n@param scale optional scale factor for the computed derivative values; by default, no scaling is\napplied (see cv::getDerivKernels for details).\n@param delta optional delta value that is added to the results prior to storing them in dst.\n@param borderType pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of constant border type\n@sa filter2D, gaussianBlur, cartToPolar\n */\nGAPI_EXPORTS GMat Sobel(const GMat& src, int ddepth, int dx, int dy, int ksize = 3,\n                        double scale = 1, double delta = 0,\n                        int borderType = BORDER_DEFAULT,\n                        const Scalar& borderValue = Scalar(0));\n\n/** @brief Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.\n\nIn all cases except one, the \\f$\\texttt{ksize} \\times \\texttt{ksize}\\f$ separable kernel is used to\ncalculate the derivative. When \\f$\\texttt{ksize = 1}\\f$, the \\f$3 \\times 1\\f$ or \\f$1 \\times 3\\f$\nkernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first\nor the second x- or y- derivatives.\n\nThere is also the special value `ksize = FILTER_SCHARR (-1)` that corresponds to the \\f$3\\times3\\f$ Scharr\nfilter that may give more accurate results than the \\f$3\\times3\\f$ Sobel. The Scharr aperture is\n\n\\f[\\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\\f]\n\nfor the x-derivative, or transposed for the y-derivative.\n\nThe function calculates an image derivative by convolving the image with the appropriate kernel:\n\n\\f[\\texttt{dst} =  \\frac{\\partial^{xorder+yorder} \\texttt{src}}{\\partial x^{xorder} \\partial y^{yorder}}\\f]\n\nThe Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less\nresistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)\nor ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first\ncase corresponds to a kernel of:\n\n\\f[\\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\\f]\n\nThe second case corresponds to a kernel of:\n\n\\f[\\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\\f]\n\n@note\n - First returned matrix correspons to dx derivative while the second one to dy.\n - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.\n - Function textual ID is \"org.opencv.imgproc.filters.sobelxy\"\n\n@param src input image.\n@param ddepth output image depth, see @ref filter_depths \"combinations\"; in the case of\n    8-bit input images it will result in truncated derivatives.\n@param order order of the derivatives.\n@param ksize size of the extended Sobel kernel; it must be odd.\n@param scale optional scale factor for the computed derivative values; by default, no scaling is\napplied (see cv::getDerivKernels for details).\n@param delta optional delta value that is added to the results prior to storing them in dst.\n@param borderType pixel extrapolation method, see cv::BorderTypes\n@param borderValue border value in case of constant border type\n@sa filter2D, gaussianBlur, cartToPolar\n */\nGAPI_EXPORTS std::tuple<GMat, GMat> SobelXY(const GMat& src, int ddepth, int order, int ksize = 3,\n                        double scale = 1, double delta = 0,\n                        int borderType = BORDER_DEFAULT,\n                        const Scalar& borderValue = Scalar(0));\n\n/** @brief Calculates the Laplacian of an image.\n\nThe function calculates the Laplacian of the source image by adding up the second x and y\nderivatives calculated using the Sobel operator:\n\n\\f[\\texttt{dst} =  \\Delta \\texttt{src} =  \\frac{\\partial^2 \\texttt{src}}{\\partial x^2} +  \\frac{\\partial^2 \\texttt{src}}{\\partial y^2}\\f]\n\nThis is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image\nwith the following \\f$3 \\times 3\\f$ aperture:\n\n\\f[\\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\\f]\n\n@note Function textual ID is \"org.opencv.imgproc.filters.laplacian\"\n\n@param src Source image.\n@param ddepth Desired depth of the destination image.\n@param ksize Aperture size used to compute the second-derivative filters. See #getDerivKernels for\ndetails. The size must be positive and odd.\n@param scale Optional scale factor for the computed Laplacian values. By default, no scaling is\napplied. See #getDerivKernels for details.\n@param delta Optional delta value that is added to the results prior to storing them in dst .\n@param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n@return Destination image of the same size and the same number of channels as src.\n@sa  Sobel, Scharr\n */\nGAPI_EXPORTS GMat Laplacian(const GMat& src, int ddepth, int ksize = 1,\n                            double scale = 1, double delta = 0, int borderType = BORDER_DEFAULT);\n\n/** @brief Applies the bilateral filter to an image.\n\nThe function applies bilateral filtering to the input image, as described in\nhttp://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html\nbilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is\nvery slow compared to most filters.\n\n_Sigma values_: For simplicity, you can set the 2 sigma values to be the same. If they are small (\\<\n10), the filter will not have much effect, whereas if they are large (\\> 150), they will have a very\nstrong effect, making the image look \"cartoonish\".\n\n_Filter size_: Large filters (d \\> 5) are very slow, so it is recommended to use d=5 for real-time\napplications, and perhaps d=9 for offline applications that need heavy noise filtering.\n\nThis filter does not work inplace.\n\n@note Function textual ID is \"org.opencv.imgproc.filters.bilateralfilter\"\n\n@param src Source 8-bit or floating-point, 1-channel or 3-channel image.\n@param d Diameter of each pixel neighborhood that is used during filtering. If it is non-positive,\nit is computed from sigmaSpace.\n@param sigmaColor Filter sigma in the color space. A larger value of the parameter means that\nfarther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting\nin larger areas of semi-equal color.\n@param sigmaSpace Filter sigma in the coordinate space. A larger value of the parameter means that\nfarther pixels will influence each other as long as their colors are close enough (see sigmaColor\n). When d\\>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is\nproportional to sigmaSpace.\n@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes\n@return Destination image of the same size and type as src.\n */\nGAPI_EXPORTS GMat bilateralFilter(const GMat& src, int d, double sigmaColor, double sigmaSpace,\n                                  int borderType = BORDER_DEFAULT);\n\n//! @} gapi_filters\n\n//! @addtogroup gapi_feature\n//! @{\n/** @brief Finds edges in an image using the Canny algorithm.\n\nThe function finds edges in the input image and marks them in the output map edges using the\nCanny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The\nlargest value is used to find initial segments of strong edges. See\n<http://en.wikipedia.org/wiki/Canny_edge_detector>\n\n@note Function textual ID is \"org.opencv.imgproc.feature.canny\"\n\n@param image 8-bit input image.\n@param threshold1 first threshold for the hysteresis procedure.\n@param threshold2 second threshold for the hysteresis procedure.\n@param apertureSize aperture size for the Sobel operator.\n@param L2gradient a flag, indicating whether a more accurate \\f$L_2\\f$ norm\n\\f$=\\sqrt{(dI/dx)^2 + (dI/dy)^2}\\f$ should be used to calculate the image gradient magnitude (\nL2gradient=true ), or whether the default \\f$L_1\\f$ norm \\f$=|dI/dx|+|dI/dy|\\f$ is enough (\nL2gradient=false ).\n */\nGAPI_EXPORTS GMat Canny(const GMat& image, double threshold1, double threshold2,\n                        int apertureSize = 3, bool L2gradient = false);\n\n/** @brief Determines strong corners on an image.\n\nThe function finds the most prominent corners in the image or in the specified image region, as\ndescribed in @cite Shi94\n\n-   Function calculates the corner quality measure at every source image pixel using the\n    #cornerMinEigenVal or #cornerHarris .\n-   Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are\n    retained).\n-   The corners with the minimal eigenvalue less than\n    \\f$\\texttt{qualityLevel} \\cdot \\max_{x,y} qualityMeasureMap(x,y)\\f$ are rejected.\n-   The remaining corners are sorted by the quality measure in the descending order.\n-   Function throws away each corner for which there is a stronger corner at a distance less than\n    maxDistance.\n\nThe function can be used to initialize a point-based tracker of an object.\n\n@note\n - If the function is called with different values A and B of the parameter qualityLevel , and\nA \\> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector\nwith qualityLevel=B .\n - Function textual ID is \"org.opencv.imgproc.feature.goodFeaturesToTrack\"\n\n@param image Input 8-bit or floating-point 32-bit, single-channel image.\n@param maxCorners Maximum number of corners to return. If there are more corners than are found,\nthe strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set\nand all detected corners are returned.\n@param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The\nparameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue\n(see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the\nquality measure less than the product are rejected. For example, if the best corner has the\nquality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure\nless than 15 are rejected.\n@param minDistance Minimum possible Euclidean distance between the returned corners.\n@param mask Optional region of interest. If the image is not empty (it needs to have the type\nCV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.\n@param blockSize Size of an average block for computing a derivative covariation matrix over each\npixel neighborhood. See cornerEigenValsAndVecs .\n@param useHarrisDetector Parameter indicating whether to use a Harris detector (see #cornerHarris)\nor #cornerMinEigenVal.\n@param k Free parameter of the Harris detector.\n\n@return vector of detected corners.\n */\nGAPI_EXPORTS_W GArray<Point2f> goodFeaturesToTrack(const GMat  &image,\n                                                       int    maxCorners,\n                                                       double qualityLevel,\n                                                       double minDistance,\n                                                 const Mat   &mask = Mat(),\n                                                       int    blockSize = 3,\n                                                       bool   useHarrisDetector = false,\n                                                       double k = 0.04);\n\n/** @brief Equalizes the histogram of a grayscale image.\n\n//! @} gapi_feature\n\nThe function equalizes the histogram of the input image using the following algorithm:\n\n- Calculate the histogram \\f$H\\f$ for src .\n- Normalize the histogram so that the sum of histogram bins is 255.\n- Compute the integral of the histogram:\n\\f[H'_i =  \\sum _{0  \\le j < i} H(j)\\f]\n- Transform the image using \\f$H'\\f$ as a look-up table: \\f$\\texttt{dst}(x,y) = H'(\\texttt{src}(x,y))\\f$\n\nThe algorithm normalizes the brightness and increases the contrast of the image.\n@note\n - The returned image is of the same size and type as input.\n - Function textual ID is \"org.opencv.imgproc.equalizeHist\"\n\n@param src Source 8-bit single channel image.\n */\nGAPI_EXPORTS GMat equalizeHist(const GMat& src);\n\n//! @addtogroup gapi_shape\n//! @{\n/** @brief Finds contours in a binary image.\n\nThe function retrieves contours from the binary image using the algorithm @cite Suzuki85 .\nThe contours are a useful tool for shape analysis and object detection and recognition.\nSee squares.cpp in the OpenCV sample directory.\n\n@note Function textual ID is \"org.opencv.imgproc.shape.findContours\"\n\n@param src Input gray-scale image @ref CV_8UC1. Non-zero pixels are treated as 1's. Zero\npixels remain 0's, so the image is treated as binary . You can use #compare, #inRange, #threshold ,\n#adaptiveThreshold, #Canny, and others to create a binary image out of a grayscale or color one.\nIf mode equals to #RETR_CCOMP, the input can also be a 32-bit integer\nimage of labels ( @ref CV_32SC1 ). If #RETR_FLOODFILL then @ref CV_32SC1 is supported only.\n@param mode Contour retrieval mode, see #RetrievalModes\n@param method Contour approximation method, see #ContourApproximationModes\n@param offset Optional offset by which every contour point is shifted. This is useful if the\ncontours are extracted from the image ROI and then they should be analyzed in the whole image\ncontext.\n\n@return GArray of detected contours. Each contour is stored as a GArray of points.\n */\nGAPI_EXPORTS GArray<GArray<Point>>\nfindContours(const GMat &src, const RetrievalModes mode, const ContourApproximationModes method,\n             const GOpaque<Point> &offset);\n\n// FIXME oc: make default value offset = Point()\n/** @overload\n@note Function textual ID is \"org.opencv.imgproc.shape.findContoursNoOffset\"\n */\nGAPI_EXPORTS GArray<GArray<Point>>\nfindContours(const GMat &src, const RetrievalModes mode, const ContourApproximationModes method);\n\n/** @brief Finds contours and their hierarchy in a binary image.\n\nThe function retrieves contours from the binary image using the algorithm @cite Suzuki85\nand calculates their hierarchy.\nThe contours are a useful tool for shape analysis and object detection and recognition.\nSee squares.cpp in the OpenCV sample directory.\n\n@note Function textual ID is \"org.opencv.imgproc.shape.findContoursH\"\n\n@param src Input gray-scale image @ref CV_8UC1. Non-zero pixels are treated as 1's. Zero\npixels remain 0's, so the image is treated as binary . You can use #compare, #inRange, #threshold ,\n#adaptiveThreshold, #Canny, and others to create a binary image out of a grayscale or color one.\nIf mode equals to #RETR_CCOMP, the input can also be a 32-bit integer\nimage of labels ( @ref CV_32SC1 ). If #RETR_FLOODFILL -- @ref CV_32SC1 supports only.\n@param mode Contour retrieval mode, see #RetrievalModes\n@param method Contour approximation method, see #ContourApproximationModes\n@param offset Optional offset by which every contour point is shifted. This is useful if the\ncontours are extracted from the image ROI and then they should be analyzed in the whole image\ncontext.\n\n@return\n - GArray of detected contours. Each contour is stored as a GArray of points.\n - Optional output GArray of cv::Vec4i, containing information about the image topology.\nIt has as many elements as the number of contours. For each i-th contour contours[i], the elements\nhierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , and hierarchy[i][3] are set to 0-based\nindices in contours of the next and previous contours at the same hierarchical level, the first\nchild contour and the parent contour, respectively. If for the contour i there are no next,\nprevious, parent, or nested contours, the corresponding elements of hierarchy[i] will be negative.\n */\nGAPI_EXPORTS std::tuple<GArray<GArray<Point>>,GArray<Vec4i>>\nfindContoursH(const GMat &src, const RetrievalModes mode, const ContourApproximationModes method,\n              const GOpaque<Point> &offset);\n\n// FIXME oc: make default value offset = Point()\n/** @overload\n@note Function textual ID is \"org.opencv.imgproc.shape.findContoursHNoOffset\"\n */\nGAPI_EXPORTS std::tuple<GArray<GArray<Point>>,GArray<Vec4i>>\nfindContoursH(const GMat &src, const RetrievalModes mode, const ContourApproximationModes method);\n\n/** @brief Calculates the up-right bounding rectangle of a point set or non-zero pixels\nof gray-scale image.\n\nThe function calculates and returns the minimal up-right bounding rectangle for the specified\npoint set or non-zero pixels of gray-scale image.\n\n@note\n - Function textual ID is \"org.opencv.imgproc.shape.boundingRectMat\"\n - In case of a 2D points' set given, Mat should be 2-dimensional, have a single row or column\nif there are 2 channels, or have 2 columns if there is a single channel. Mat should have either\n@ref CV_32S or @ref CV_32F depth\n\n@param src Input gray-scale image @ref CV_8UC1; or input set of @ref CV_32S or @ref CV_32F\n2D points stored in Mat.\n */\nGAPI_EXPORTS_W GOpaque<Rect> boundingRect(const GMat& src);\n\n/** @overload\n\nCalculates the up-right bounding rectangle of a point set.\n\n@note Function textual ID is \"org.opencv.imgproc.shape.boundingRectVector32S\"\n\n@param src Input 2D point set, stored in std::vector<cv::Point2i>.\n */\nGAPI_EXPORTS_W GOpaque<Rect> boundingRect(const GArray<Point2i>& src);\n\n/** @overload\n\nCalculates the up-right bounding rectangle of a point set.\n\n@note Function textual ID is \"org.opencv.imgproc.shape.boundingRectVector32F\"\n\n@param src Input 2D point set, stored in std::vector<cv::Point2f>.\n */\nGAPI_EXPORTS GOpaque<Rect> boundingRect(const GArray<Point2f>& src);\n\n/** @brief Fits a line to a 2D point set.\n\nThe function fits a line to a 2D point set by minimizing \\f$\\sum_i \\rho(r_i)\\f$ where\n\\f$r_i\\f$ is a distance between the \\f$i^{th}\\f$ point, the line and \\f$\\rho(r)\\f$ is a distance\nfunction, one of the following:\n-  DIST_L2\n\\f[\\rho (r) = r^2/2  \\quad \\text{(the simplest and the fastest least-squares method)}\\f]\n- DIST_L1\n\\f[\\rho (r) = r\\f]\n- DIST_L12\n\\f[\\rho (r) = 2  \\cdot ( \\sqrt{1 + \\frac{r^2}{2}} - 1)\\f]\n- DIST_FAIR\n\\f[\\rho \\left (r \\right ) = C^2  \\cdot \\left (  \\frac{r}{C} -  \\log{\\left(1 + \\frac{r}{C}\\right)} \\right )  \\quad \\text{where} \\quad C=1.3998\\f]\n- DIST_WELSCH\n\\f[\\rho \\left (r \\right ) =  \\frac{C^2}{2} \\cdot \\left ( 1 -  \\exp{\\left(-\\left(\\frac{r}{C}\\right)^2\\right)} \\right )  \\quad \\text{where} \\quad C=2.9846\\f]\n- DIST_HUBER\n\\f[\\rho (r) =  \\fork{r^2/2}{if \\(r < C\\)}{C \\cdot (r-C/2)}{otherwise} \\quad \\text{where} \\quad C=1.345\\f]\n\nThe algorithm is based on the M-estimator ( <http://en.wikipedia.org/wiki/M-estimator> ) technique\nthat iteratively fits the line using the weighted least-squares algorithm. After each iteration the\nweights \\f$w_i\\f$ are adjusted to be inversely proportional to \\f$\\rho(r_i)\\f$ .\n\n@note\n - Function textual ID is \"org.opencv.imgproc.shape.fitLine2DMat\"\n - In case of an N-dimentional points' set given, Mat should be 2-dimensional, have a single row\nor column if there are N channels, or have N columns if there is a single channel.\n\n@param src Input set of 2D points stored in one of possible containers: Mat,\nstd::vector<cv::Point2i>, std::vector<cv::Point2f>, std::vector<cv::Point2d>.\n@param distType Distance used by the M-estimator, see #DistanceTypes. @ref DIST_USER\nand @ref DIST_C are not suppored.\n@param param Numerical parameter ( C ) for some types of distances. If it is 0, an optimal value\nis chosen.\n@param reps Sufficient accuracy for the radius (distance between the coordinate origin and the\nline). 1.0 would be a good default value for reps. If it is 0, a default value is chosen.\n@param aeps Sufficient accuracy for the angle. 0.01 would be a good default value for aeps.\nIf it is 0, a default value is chosen.\n\n@return Output line parameters: a vector of 4 elements (like Vec4f) - (vx, vy, x0, y0),\nwhere (vx, vy) is a normalized vector collinear to the line and (x0, y0) is a point on the line.\n */\nGAPI_EXPORTS GOpaque<Vec4f> fitLine2D(const GMat& src, const DistanceTypes distType,\n                                      const double param = 0., const double reps = 0.,\n                                      const double aeps = 0.);\n\n/** @overload\n\n@note Function textual ID is \"org.opencv.imgproc.shape.fitLine2DVector32S\"\n\n */\nGAPI_EXPORTS GOpaque<Vec4f> fitLine2D(const GArray<Point2i>& src, const DistanceTypes distType,\n                                      const double param = 0., const double reps = 0.,\n                                      const double aeps = 0.);\n\n/** @overload\n\n@note Function textual ID is \"org.opencv.imgproc.shape.fitLine2DVector32F\"\n\n */\nGAPI_EXPORTS GOpaque<Vec4f> fitLine2D(const GArray<Point2f>& src, const DistanceTypes distType,\n                                      const double param = 0., const double reps = 0.,\n                                      const double aeps = 0.);\n\n/** @overload\n\n@note Function textual ID is \"org.opencv.imgproc.shape.fitLine2DVector64F\"\n\n */\nGAPI_EXPORTS GOpaque<Vec4f> fitLine2D(const GArray<Point2d>& src, const DistanceTypes distType,\n                                      const double param = 0., const double reps = 0.,\n                                      const double aeps = 0.);\n\n/** @brief Fits a line to a 3D point set.\n\nThe function fits a line to a 3D point set by minimizing \\f$\\sum_i \\rho(r_i)\\f$ where\n\\f$r_i\\f$ is a distance between the \\f$i^{th}\\f$ point, the line and \\f$\\rho(r)\\f$ is a distance\nfunction, one of the following:\n-  DIST_L2\n\\f[\\rho (r) = r^2/2  \\quad \\text{(the simplest and the fastest least-squares method)}\\f]\n- DIST_L1\n\\f[\\rho (r) = r\\f]\n- DIST_L12\n\\f[\\rho (r) = 2  \\cdot ( \\sqrt{1 + \\frac{r^2}{2}} - 1)\\f]\n- DIST_FAIR\n\\f[\\rho \\left (r \\right ) = C^2  \\cdot \\left (  \\frac{r}{C} -  \\log{\\left(1 + \\frac{r}{C}\\right)} \\right )  \\quad \\text{where} \\quad C=1.3998\\f]\n- DIST_WELSCH\n\\f[\\rho \\left (r \\right ) =  \\frac{C^2}{2} \\cdot \\left ( 1 -  \\exp{\\left(-\\left(\\frac{r}{C}\\right)^2\\right)} \\right )  \\quad \\text{where} \\quad C=2.9846\\f]\n- DIST_HUBER\n\\f[\\rho (r) =  \\fork{r^2/2}{if \\(r < C\\)}{C \\cdot (r-C/2)}{otherwise} \\quad \\text{where} \\quad C=1.345\\f]\n\nThe algorithm is based on the M-estimator ( <http://en.wikipedia.org/wiki/M-estimator> ) technique\nthat iteratively fits the line using the weighted least-squares algorithm. After each iteration the\nweights \\f$w_i\\f$ are adjusted to be inversely proportional to \\f$\\rho(r_i)\\f$ .\n\n@note\n - Function textual ID is \"org.opencv.imgproc.shape.fitLine3DMat\"\n - In case of an N-dimentional points' set given, Mat should be 2-dimensional, have a single row\nor column if there are N channels, or have N columns if there is a single channel.\n\n@param src Input set of 3D points stored in one of possible containers: Mat,\nstd::vector<cv::Point3i>, std::vector<cv::Point3f>, std::vector<cv::Point3d>.\n@param distType Distance used by the M-estimator, see #DistanceTypes. @ref DIST_USER\nand @ref DIST_C are not suppored.\n@param param Numerical parameter ( C ) for some types of distances. If it is 0, an optimal value\nis chosen.\n@param reps Sufficient accuracy for the radius (distance between the coordinate origin and the\nline). 1.0 would be a good default value for reps. If it is 0, a default value is chosen.\n@param aeps Sufficient accuracy for the angle. 0.01 would be a good default value for aeps.\nIf it is 0, a default value is chosen.\n\n@return Output line parameters: a vector of 6 elements (like Vec6f) - (vx, vy, vz, x0, y0, z0),\nwhere (vx, vy, vz) is a normalized vector collinear to the line and (x0, y0, z0) is a point on\nthe line.\n */\nGAPI_EXPORTS GOpaque<Vec6f> fitLine3D(const GMat& src, const DistanceTypes distType,\n                                      const double param = 0., const double reps = 0.,\n                                      const double aeps = 0.);\n\n/** @overload\n\n@note Function textual ID is \"org.opencv.imgproc.shape.fitLine3DVector32S\"\n\n */\nGAPI_EXPORTS GOpaque<Vec6f> fitLine3D(const GArray<Point3i>& src, const DistanceTypes distType,\n                                      const double param = 0., const double reps = 0.,\n                                      const double aeps = 0.);\n\n/** @overload\n\n@note Function textual ID is \"org.opencv.imgproc.shape.fitLine3DVector32F\"\n\n */\nGAPI_EXPORTS GOpaque<Vec6f> fitLine3D(const GArray<Point3f>& src, const DistanceTypes distType,\n                                      const double param = 0., const double reps = 0.,\n                                      const double aeps = 0.);\n\n/** @overload\n\n@note Function textual ID is \"org.opencv.imgproc.shape.fitLine3DVector64F\"\n\n */\nGAPI_EXPORTS GOpaque<Vec6f> fitLine3D(const GArray<Point3d>& src, const DistanceTypes distType,\n                                      const double param = 0., const double reps = 0.,\n                                      const double aeps = 0.);\n\n//! @} gapi_shape\n\n//! @addtogroup gapi_colorconvert\n//! @{\n/** @brief Converts an image from BGR color space to RGB color space.\n\nThe function converts an input image from BGR color space to RGB.\nThe conventional ranges for B, G, and R channel values are 0 to 255.\n\nOutput image is 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.bgr2rgb\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n@sa RGB2BGR\n*/\nGAPI_EXPORTS_W GMat BGR2RGB(const GMat& src);\n\n/** @brief Converts an image from RGB color space to gray-scaled.\n\nThe conventional ranges for R, G, and B channel values are 0 to 255.\nResulting gray color value computed as\n\\f[\\texttt{dst} (I)= \\texttt{0.299} * \\texttt{src}(I).R + \\texttt{0.587} * \\texttt{src}(I).G  + \\texttt{0.114} * \\texttt{src}(I).B \\f]\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.rgb2gray\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC1.\n@sa RGB2YUV\n */\nGAPI_EXPORTS_W GMat RGB2Gray(const GMat& src);\n\n/** @overload\nResulting gray color value computed as\n\\f[\\texttt{dst} (I)= \\texttt{rY} * \\texttt{src}(I).R + \\texttt{gY} * \\texttt{src}(I).G  + \\texttt{bY} * \\texttt{src}(I).B \\f]\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.rgb2graycustom\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC1.\n@param rY float multiplier for R channel.\n@param gY float multiplier for G channel.\n@param bY float multiplier for B channel.\n@sa RGB2YUV\n */\nGAPI_EXPORTS GMat RGB2Gray(const GMat& src, float rY, float gY, float bY);\n\n/** @brief Converts an image from BGR color space to gray-scaled.\n\nThe conventional ranges for B, G, and R channel values are 0 to 255.\nResulting gray color value computed as\n\\f[\\texttt{dst} (I)= \\texttt{0.114} * \\texttt{src}(I).B + \\texttt{0.587} * \\texttt{src}(I).G  + \\texttt{0.299} * \\texttt{src}(I).R \\f]\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.bgr2gray\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC1.\n@sa BGR2LUV\n */\nGAPI_EXPORTS GMat BGR2Gray(const GMat& src);\n\n/** @brief Converts an image from RGB color space to YUV color space.\n\nThe function converts an input image from RGB color space to YUV.\nThe conventional ranges for R, G, and B channel values are 0 to 255.\n\nIn case of linear transformations, the range does not matter. But in case of a non-linear\ntransformation, an input RGB image should be normalized to the proper value range to get the correct\nresults, like here, at RGB \\f$\\rightarrow\\f$ Y\\*u\\*v\\* transformation.\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.rgb2yuv\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n@sa YUV2RGB, RGB2Lab\n*/\nGAPI_EXPORTS GMat RGB2YUV(const GMat& src);\n\n/** @brief Converts an image from BGR color space to I420 color space.\n\nThe function converts an input image from BGR color space to I420.\nThe conventional ranges for R, G, and B channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 1-channel image. @ref CV_8UC1.\nWidth of I420 output image must be the same as width of input image.\nHeight of I420 output image must be equal 3/2 from height of input image.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.bgr2i420\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n@sa I4202BGR\n*/\nGAPI_EXPORTS GMat BGR2I420(const GMat& src);\n\n/** @brief Converts an image from RGB color space to I420 color space.\n\nThe function converts an input image from RGB color space to I420.\nThe conventional ranges for R, G, and B channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 1-channel image. @ref CV_8UC1.\nWidth of I420 output image must be the same as width of input image.\nHeight of I420 output image must be equal 3/2 from height of input image.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.rgb2i420\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n@sa I4202RGB\n*/\nGAPI_EXPORTS GMat RGB2I420(const GMat& src);\n\n/** @brief Converts an image from I420 color space to BGR color space.\n\nThe function converts an input image from I420 color space to BGR.\nThe conventional ranges for B, G, and R channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image. @ref CV_8UC3.\nWidth of BGR output image must be the same as width of input image.\nHeight of BGR output image must be equal 2/3 from height of input image.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.i4202bgr\"\n\n@param src input image: 8-bit unsigned 1-channel image @ref CV_8UC1.\n@sa BGR2I420\n*/\nGAPI_EXPORTS GMat I4202BGR(const GMat& src);\n\n/** @brief Converts an image from I420 color space to BGR color space.\n\nThe function converts an input image from I420 color space to BGR.\nThe conventional ranges for B, G, and R channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image. @ref CV_8UC3.\nWidth of RGB output image must be the same as width of input image.\nHeight of RGB output image must be equal 2/3 from height of input image.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.i4202rgb\"\n\n@param src input image: 8-bit unsigned 1-channel image @ref CV_8UC1.\n@sa RGB2I420\n*/\nGAPI_EXPORTS GMat I4202RGB(const GMat& src);\n\n/** @brief Converts an image from BGR color space to LUV color space.\n\nThe function converts an input image from BGR color space to LUV.\nThe conventional ranges for B, G, and R channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.bgr2luv\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n@sa RGB2Lab, RGB2LUV\n*/\nGAPI_EXPORTS GMat BGR2LUV(const GMat& src);\n\n/** @brief Converts an image from LUV color space to BGR color space.\n\nThe function converts an input image from LUV color space to BGR.\nThe conventional ranges for B, G, and R channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.luv2bgr\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n@sa BGR2LUV\n*/\nGAPI_EXPORTS GMat LUV2BGR(const GMat& src);\n\n/** @brief Converts an image from YUV color space to BGR color space.\n\nThe function converts an input image from YUV color space to BGR.\nThe conventional ranges for B, G, and R channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.yuv2bgr\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n@sa BGR2YUV\n*/\nGAPI_EXPORTS GMat YUV2BGR(const GMat& src);\n\n/** @brief Converts an image from BGR color space to YUV color space.\n\nThe function converts an input image from BGR color space to YUV.\nThe conventional ranges for B, G, and R channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.bgr2yuv\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n@sa YUV2BGR\n*/\nGAPI_EXPORTS GMat BGR2YUV(const GMat& src);\n\n/** @brief Converts an image from RGB color space to Lab color space.\n\nThe function converts an input image from BGR color space to Lab.\nThe conventional ranges for R, G, and B channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC1.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.rgb2lab\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC1.\n@sa RGB2YUV, RGB2LUV\n*/\nGAPI_EXPORTS GMat RGB2Lab(const GMat& src);\n\n/** @brief Converts an image from YUV color space to RGB.\nThe function converts an input image from YUV color space to RGB.\nThe conventional ranges for Y, U, and V channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.yuv2rgb\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@sa RGB2Lab, RGB2YUV\n*/\nGAPI_EXPORTS GMat YUV2RGB(const GMat& src);\n\n/** @brief Converts an image from NV12 (YUV420p) color space to RGB.\nThe function converts an input image from NV12 color space to RGB.\nThe conventional ranges for Y, U, and V channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.nv12torgb\"\n\n@param src_y input image: 8-bit unsigned 1-channel image @ref CV_8UC1.\n@param src_uv input image: 8-bit unsigned 2-channel image @ref CV_8UC2.\n\n@sa YUV2RGB, NV12toBGR\n*/\nGAPI_EXPORTS GMat NV12toRGB(const GMat& src_y, const GMat& src_uv);\n\n/** @brief Converts an image from NV12 (YUV420p) color space to gray-scaled.\nThe function converts an input image from NV12 color space to gray-scaled.\nThe conventional ranges for Y, U, and V channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 1-channel image @ref CV_8UC1.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.nv12togray\"\n\n@param src_y input image: 8-bit unsigned 1-channel image @ref CV_8UC1.\n@param src_uv input image: 8-bit unsigned 2-channel image @ref CV_8UC2.\n\n@sa YUV2RGB, NV12toBGR\n*/\nGAPI_EXPORTS GMat NV12toGray(const GMat& src_y, const GMat& src_uv);\n\n/** @brief Converts an image from NV12 (YUV420p) color space to BGR.\nThe function converts an input image from NV12 color space to RGB.\nThe conventional ranges for Y, U, and V channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.nv12tobgr\"\n\n@param src_y input image: 8-bit unsigned 1-channel image @ref CV_8UC1.\n@param src_uv input image: 8-bit unsigned 2-channel image @ref CV_8UC2.\n\n@sa YUV2BGR, NV12toRGB\n*/\nGAPI_EXPORTS GMat NV12toBGR(const GMat& src_y, const GMat& src_uv);\n\n/** @brief Converts an image from BayerGR color space to RGB.\nThe function converts an input image from BayerGR color space to RGB.\nThe conventional ranges for G, R, and B channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.bayergr2rgb\"\n\n@param src_gr input image: 8-bit unsigned 1-channel image @ref CV_8UC1.\n\n@sa YUV2BGR, NV12toRGB\n*/\nGAPI_EXPORTS GMat BayerGR2RGB(const GMat& src_gr);\n\n/** @brief Converts an image from RGB color space to HSV.\nThe function converts an input image from RGB color space to HSV.\nThe conventional ranges for R, G, and B channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.rgb2hsv\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@sa YUV2BGR, NV12toRGB\n*/\nGAPI_EXPORTS GMat RGB2HSV(const GMat& src);\n\n/** @brief Converts an image from RGB color space to YUV422.\nThe function converts an input image from RGB color space to YUV422.\nThe conventional ranges for R, G, and B channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned 2-channel image @ref CV_8UC2.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.rgb2yuv422\"\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n\n@sa YUV2BGR, NV12toRGB\n*/\nGAPI_EXPORTS GMat RGB2YUV422(const GMat& src);\n\n/** @brief Converts an image from NV12 (YUV420p) color space to RGB.\nThe function converts an input image from NV12 color space to RGB.\nThe conventional ranges for Y, U, and V channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned planar 3-channel image @ref CV_8UC1.\nPlanar image memory layout is three planes laying in the memory contiguously,\nso the image height should be plane_height*plane_number,\nimage type is @ref CV_8UC1.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.nv12torgbp\"\n\n@param src_y input image: 8-bit unsigned 1-channel image @ref CV_8UC1.\n@param src_uv input image: 8-bit unsigned 2-channel image @ref CV_8UC2.\n\n@sa YUV2RGB, NV12toBGRp, NV12toRGB\n*/\nGAPI_EXPORTS GMatP NV12toRGBp(const GMat &src_y, const GMat &src_uv);\n\n/** @brief Converts an image from NV12 (YUV420p) color space to BGR.\nThe function converts an input image from NV12 color space to BGR.\nThe conventional ranges for Y, U, and V channel values are 0 to 255.\n\nOutput image must be 8-bit unsigned planar 3-channel image @ref CV_8UC1.\nPlanar image memory layout is three planes laying in the memory contiguously,\nso the image height should be plane_height*plane_number,\nimage type is @ref CV_8UC1.\n\n@note Function textual ID is \"org.opencv.imgproc.colorconvert.nv12torgbp\"\n\n@param src_y input image: 8-bit unsigned 1-channel image @ref CV_8UC1.\n@param src_uv input image: 8-bit unsigned 2-channel image @ref CV_8UC2.\n\n@sa YUV2RGB, NV12toRGBp, NV12toBGR\n*/\nGAPI_EXPORTS GMatP NV12toBGRp(const GMat &src_y, const GMat &src_uv);\n\n//! @} gapi_colorconvert\n} //namespace gapi\n} //namespace cv\n\n#endif // OPENCV_GAPI_IMGPROC_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/infer/bindings_ie.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n#ifndef OPENCV_GAPI_INFER_BINDINGS_IE_HPP\n#define OPENCV_GAPI_INFER_BINDINGS_IE_HPP\n\n#include <opencv2/gapi/util/any.hpp>\n#include \"opencv2/gapi/own/exports.hpp\" // GAPI_EXPORTS\n#include <opencv2/gapi/gkernel.hpp>     // GKernelPackage\n#include <opencv2/gapi/infer/ie.hpp>    // Params\n\n#include <string>\n\nnamespace cv {\nnamespace gapi {\nnamespace ie {\n\n// NB: Used by python wrapper\n// This class can be marked as SIMPLE, because it's implemented as pimpl\nclass GAPI_EXPORTS_W_SIMPLE PyParams {\npublic:\n    PyParams() = default;\n\n    PyParams(const std::string &tag,\n             const std::string &model,\n             const std::string &weights,\n             const std::string &device);\n\n    PyParams(const std::string &tag,\n             const std::string &model,\n             const std::string &device);\n\n    GBackend      backend() const;\n    std::string   tag()     const;\n    cv::util::any params()  const;\n\nprivate:\n    std::shared_ptr<Params<cv::gapi::Generic>> m_priv;\n};\n\nGAPI_EXPORTS_W PyParams params(const std::string &tag,\n                               const std::string &model,\n                               const std::string &weights,\n                               const std::string &device);\n\nGAPI_EXPORTS_W PyParams params(const std::string &tag,\n                               const std::string &model,\n                               const std::string &device);\n} // namespace ie\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_INFER_BINDINGS_IE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/infer/ie.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019-2021 Intel Corporation\n\n#ifndef OPENCV_GAPI_INFER_IE_HPP\n#define OPENCV_GAPI_INFER_IE_HPP\n\n#include <unordered_map>\n#include <unordered_set>\n#include <string>\n#include <array>\n#include <tuple> // tuple, tuple_size\n#include <map>\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/util/any.hpp>\n\n#include <opencv2/core/cvdef.h>     // GAPI_EXPORTS\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n#include <opencv2/gapi/infer.hpp>   // Generic\n\nnamespace cv {\nnamespace gapi {\n// FIXME: introduce a new sub-namespace for NN?\n\n/**\n * @brief This namespace contains G-API OpenVINO backend functions,\n * structures, and symbols.\n */\nnamespace ie {\n\nGAPI_EXPORTS cv::gapi::GBackend backend();\n\n/**\n * Specifies how G-API and IE should trait input data\n *\n * In OpenCV, the same cv::Mat is used to represent both\n * image and tensor data. Sometimes those are hardly distinguishable,\n * so this extra parameter is used to give G-API a hint.\n *\n * This hint controls how G-API reinterprets the data when converting\n * it to IE Blob format (and which layout/etc is assigned to this data).\n */\nenum class TraitAs: int\n{\n    TENSOR, //!< G-API traits an associated cv::Mat as a raw tensor and passes dimensions as-is\n    IMAGE   //!< G-API traits an associated cv::Mat as an image so creates an \"image\" blob (NCHW/NHWC, etc)\n};\n\nusing IEConfig = std::map<std::string, std::string>;\n\nnamespace detail {\nstruct ParamDesc {\n    std::string model_path;\n    std::string weights_path;\n    std::string device_id;\n\n    std::vector<std::string> input_names;\n    std::vector<std::string> output_names;\n\n    using ConstInput = std::pair<cv::Mat, TraitAs>;\n    std::unordered_map<std::string, ConstInput> const_inputs;\n\n    std::size_t num_in;\n    std::size_t num_out;\n\n    enum class Kind {Load, Import};\n    Kind kind;\n    bool is_generic;\n    IEConfig config;\n\n    std::map<std::string, std::vector<std::size_t>> reshape_table;\n    std::unordered_set<std::string> layer_names_to_reshape;\n\n    // NB: Number of asyncrhonious infer requests\n    size_t nireq;\n\n    // NB: An optional config to setup RemoteContext for IE\n    cv::util::any context_config;\n};\n} // namespace detail\n\n// FIXME: this is probably a shared (reusable) thing\ntemplate<typename Net>\nstruct PortCfg {\n    using In = std::array\n        < std::string\n        , std::tuple_size<typename Net::InArgs>::value >;\n    using Out = std::array\n        < std::string\n        , std::tuple_size<typename Net::OutArgs>::value >;\n};\n\n/**\n * @brief This structure provides functions\n * that fill inference parameters for \"OpenVINO Toolkit\" model.\n */\ntemplate<typename Net> class Params {\npublic:\n    /** @brief Class constructor.\n\n    Constructs Params based on model information and specifies default values for other\n    inference description parameters. Model is loaded and compiled using \"OpenVINO Toolkit\".\n\n    @param model Path to topology IR (.xml file).\n    @param weights Path to weights (.bin file).\n    @param device target device to use.\n    */\n    Params(const std::string &model,\n           const std::string &weights,\n           const std::string &device)\n        : desc{ model, weights, device, {}, {}, {}\n              , std::tuple_size<typename Net::InArgs>::value  // num_in\n              , std::tuple_size<typename Net::OutArgs>::value // num_out\n              , detail::ParamDesc::Kind::Load\n              , false\n              , {}\n              , {}\n              , {}\n              , 1u\n              , {}} {\n    };\n\n    /** @overload\n    Use this constructor to work with pre-compiled network.\n    Model is imported from a pre-compiled blob.\n\n    @param model Path to model.\n    @param device target device to use.\n    */\n    Params(const std::string &model,\n           const std::string &device)\n        : desc{ model, {}, device, {}, {}, {}\n              , std::tuple_size<typename Net::InArgs>::value  // num_in\n              , std::tuple_size<typename Net::OutArgs>::value // num_out\n              , detail::ParamDesc::Kind::Import\n              , false\n              , {}\n              , {}\n              , {}\n              , 1u\n              , {}} {\n    };\n\n    /** @brief Specifies sequence of network input layers names for inference.\n\n    The function is used to associate cv::gapi::infer<> inputs with the model inputs.\n    Number of names has to match the number of network inputs as defined in G_API_NET().\n    In case a network has only single input layer, there is no need to specify name manually.\n\n    @param layer_names std::array<std::string, N> where N is the number of inputs\n    as defined in the @ref G_API_NET. Contains names of input layers.\n    @return reference to this parameter structure.\n    */\n    Params<Net>& cfgInputLayers(const typename PortCfg<Net>::In &layer_names) {\n        desc.input_names.clear();\n        desc.input_names.reserve(layer_names.size());\n        std::copy(layer_names.begin(), layer_names.end(),\n                  std::back_inserter(desc.input_names));\n        return *this;\n    }\n\n    /** @brief Specifies sequence of network output layers names for inference.\n\n    The function is used to associate cv::gapi::infer<> outputs with the model outputs.\n    Number of names has to match the number of network outputs as defined in G_API_NET().\n    In case a network has only single output layer, there is no need to specify name manually.\n\n    @param layer_names std::array<std::string, N> where N is the number of outputs\n    as defined in the @ref G_API_NET. Contains names of output layers.\n    @return reference to this parameter structure.\n    */\n    Params<Net>& cfgOutputLayers(const typename PortCfg<Net>::Out &layer_names) {\n        desc.output_names.clear();\n        desc.output_names.reserve(layer_names.size());\n        std::copy(layer_names.begin(), layer_names.end(),\n                  std::back_inserter(desc.output_names));\n        return *this;\n    }\n\n    /** @brief Specifies a constant input.\n\n    The function is used to set a constant input. This input has to be\n    a preprocessed tensor if its type is TENSOR. Need to provide name of the\n    network layer which will receive provided data.\n\n    @param layer_name Name of network layer.\n    @param data cv::Mat that contains data which will be associated with network layer.\n    @param hint Input type @sa cv::gapi::ie::TraitAs.\n    @return reference to this parameter structure.\n    */\n    Params<Net>& constInput(const std::string &layer_name,\n                            const cv::Mat &data,\n                            TraitAs hint = TraitAs::TENSOR) {\n        desc.const_inputs[layer_name] = {data, hint};\n        return *this;\n    }\n\n    /** @brief Specifies OpenVINO plugin configuration.\n\n    The function is used to set configuration for OpenVINO plugin. Some parameters\n    can be different for each plugin. Please follow https://docs.openvinotoolkit.org/latest/index.html\n    to check information about specific plugin.\n\n    @param cfg Map of pairs: (config parameter name, config parameter value).\n    @return reference to this parameter structure.\n    */\n       Params& pluginConfig(const IEConfig& cfg) {\n        desc.config = cfg;\n        return *this;\n    }\n\n    /** @overload\n    Function with a rvalue parameter.\n\n    @param cfg rvalue map of pairs: (config parameter name, config parameter value).\n    @return reference to this parameter structure.\n    */\n    Params& pluginConfig(IEConfig&& cfg) {\n        desc.config = std::move(cfg);\n        return *this;\n    }\n\n    /** @brief Specifies configuration for RemoteContext in InferenceEngine.\n\n    When RemoteContext is configured the backend imports the networks using the context.\n    It also expects cv::MediaFrames to be actually remote, to operate with blobs via the context.\n\n    @param ctx_cfg cv::util::any value which holds InferenceEngine::ParamMap.\n    @return reference to this parameter structure.\n    */\n    Params& cfgContextParams(const cv::util::any& ctx_cfg) {\n        desc.context_config = ctx_cfg;\n        return *this;\n    }\n\n    /** @overload\n    Function with an rvalue parameter.\n\n    @param ctx_cfg cv::util::any value which holds InferenceEngine::ParamMap.\n    @return reference to this parameter structure.\n    */\n    Params& cfgContextParams(cv::util::any&& ctx_cfg) {\n        desc.context_config = std::move(ctx_cfg);\n        return *this;\n    }\n\n    /** @brief Specifies number of asynchronous inference requests.\n\n    @param nireq Number of inference asynchronous requests.\n    @return reference to this parameter structure.\n    */\n    Params& cfgNumRequests(size_t nireq) {\n        GAPI_Assert(nireq > 0 && \"Number of infer requests must be greater than zero!\");\n        desc.nireq = nireq;\n        return *this;\n    }\n\n    /** @brief Specifies new input shapes for the network inputs.\n\n    The function is used to specify new input shapes for the network inputs.\n    Follow https://docs.openvinotoolkit.org/latest/classInferenceEngine_1_1networkNetwork.html\n    for additional information.\n\n    @param reshape_table Map of pairs: name of corresponding data and its dimension.\n    @return reference to this parameter structure.\n    */\n    Params<Net>& cfgInputReshape(const std::map<std::string, std::vector<std::size_t>>& reshape_table) {\n        desc.reshape_table = reshape_table;\n        return *this;\n    }\n\n    /** @overload */\n    Params<Net>& cfgInputReshape(std::map<std::string, std::vector<std::size_t>>&& reshape_table) {\n        desc.reshape_table = std::move(reshape_table);\n        return *this;\n    }\n\n    /** @overload\n\n    @param layer_name Name of layer.\n    @param layer_dims New dimensions for this layer.\n    @return reference to this parameter structure.\n    */\n    Params<Net>& cfgInputReshape(const std::string& layer_name, const std::vector<size_t>& layer_dims) {\n        desc.reshape_table.emplace(layer_name, layer_dims);\n        return *this;\n    }\n\n    /** @overload */\n    Params<Net>& cfgInputReshape(std::string&& layer_name, std::vector<size_t>&& layer_dims) {\n        desc.reshape_table.emplace(layer_name, layer_dims);\n        return *this;\n    }\n\n    /** @overload\n\n    @param layer_names set of names of network layers that will be used for network reshape.\n    @return reference to this parameter structure.\n    */\n    Params<Net>& cfgInputReshape(const std::unordered_set<std::string>& layer_names) {\n        desc.layer_names_to_reshape = layer_names;\n        return *this;\n    }\n\n    /** @overload\n\n    @param layer_names rvalue set of the selected layers will be reshaped automatically\n    its input image size.\n    @return reference to this parameter structure.\n    */\n    Params<Net>& cfgInputReshape(std::unordered_set<std::string>&& layer_names) {\n        desc.layer_names_to_reshape = std::move(layer_names);\n        return *this;\n    }\n\n    // BEGIN(G-API's network parametrization API)\n    GBackend      backend()    const { return cv::gapi::ie::backend();  }\n    std::string   tag()        const { return Net::tag(); }\n    cv::util::any params()     const { return { desc }; }\n    // END(G-API's network parametrization API)\n\nprotected:\n    detail::ParamDesc desc;\n};\n\n/*\n* @brief This structure provides functions for generic network type that\n* fill inference parameters.\n* @see struct Generic\n*/\ntemplate<>\nclass Params<cv::gapi::Generic> {\npublic:\n    /** @brief Class constructor.\n\n    Constructs Params based on model information and sets default values for other\n    inference description parameters. Model is loaded and compiled using OpenVINO Toolkit.\n\n    @param tag string tag of the network for which these parameters are intended.\n    @param model path to topology IR (.xml file).\n    @param weights path to weights (.bin file).\n    @param device target device to use.\n    */\n    Params(const std::string &tag,\n           const std::string &model,\n           const std::string &weights,\n           const std::string &device)\n        : desc{ model, weights, device, {}, {}, {}, 0u, 0u,\n                detail::ParamDesc::Kind::Load, true, {}, {}, {}, 1u,\n                {}},\n          m_tag(tag) {\n    };\n\n    /** @overload\n\n    This constructor for pre-compiled networks. Model is imported from pre-compiled\n    blob.\n\n    @param tag string tag of the network for which these parameters are intended.\n    @param model path to model.\n    @param device target device to use.\n    */\n    Params(const std::string &tag,\n           const std::string &model,\n           const std::string &device)\n        : desc{ model, {}, device, {}, {}, {}, 0u, 0u,\n                detail::ParamDesc::Kind::Import, true, {}, {}, {}, 1u,\n                {}},\n          m_tag(tag) {\n    };\n\n    /** @see ie::Params::pluginConfig. */\n    Params& pluginConfig(const IEConfig& cfg) {\n        desc.config = cfg;\n        return *this;\n    }\n\n    /** @overload */\n    Params& pluginConfig(IEConfig&& cfg) {\n        desc.config = std::move(cfg);\n        return *this;\n    }\n\n    /** @see ie::Params::constInput. */\n    Params& constInput(const std::string &layer_name,\n                       const cv::Mat &data,\n                       TraitAs hint = TraitAs::TENSOR) {\n        desc.const_inputs[layer_name] = {data, hint};\n        return *this;\n    }\n\n    /** @see ie::Params::cfgNumRequests. */\n    Params& cfgNumRequests(size_t nireq) {\n        GAPI_Assert(nireq > 0 && \"Number of infer requests must be greater than zero!\");\n        desc.nireq = nireq;\n        return *this;\n    }\n\n    /** @see ie::Params::cfgInputReshape */\n    Params& cfgInputReshape(const std::map<std::string, std::vector<std::size_t>>&reshape_table) {\n        desc.reshape_table = reshape_table;\n        return *this;\n    }\n\n    /** @overload */\n    Params& cfgInputReshape(std::map<std::string, std::vector<std::size_t>> && reshape_table) {\n        desc.reshape_table = std::move(reshape_table);\n        return *this;\n    }\n\n    /** @overload */\n    Params& cfgInputReshape(std::string && layer_name, std::vector<size_t> && layer_dims) {\n        desc.reshape_table.emplace(layer_name, layer_dims);\n        return *this;\n    }\n\n    /** @overload */\n    Params& cfgInputReshape(const std::string & layer_name, const std::vector<size_t>&layer_dims) {\n        desc.reshape_table.emplace(layer_name, layer_dims);\n        return *this;\n    }\n\n    /** @overload */\n    Params& cfgInputReshape(std::unordered_set<std::string> && layer_names) {\n        desc.layer_names_to_reshape = std::move(layer_names);\n        return *this;\n    }\n\n    /** @overload */\n    Params& cfgInputReshape(const std::unordered_set<std::string>&layer_names) {\n        desc.layer_names_to_reshape = layer_names;\n        return *this;\n    }\n\n    // BEGIN(G-API's network parametrization API)\n    GBackend      backend()    const { return cv::gapi::ie::backend();  }\n    std::string   tag()        const { return m_tag; }\n    cv::util::any params()     const { return { desc }; }\n    // END(G-API's network parametrization API)\n\nprotected:\n    detail::ParamDesc desc;\n    std::string m_tag;\n};\n\n} // namespace ie\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_INFER_IE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/infer/onnx.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020-2021 Intel Corporation\n\n#ifndef OPENCV_GAPI_INFER_ONNX_HPP\n#define OPENCV_GAPI_INFER_ONNX_HPP\n\n#include <unordered_map>\n#include <string>\n#include <array>\n#include <tuple> // tuple, tuple_size\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/util/any.hpp>\n\n#include <opencv2/core/cvdef.h>     // GAPI_EXPORTS\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n\nnamespace cv {\nnamespace gapi {\n\n/**\n * @brief This namespace contains G-API ONNX Runtime backend functions, structures, and symbols.\n */\nnamespace onnx {\n\nGAPI_EXPORTS cv::gapi::GBackend backend();\n\nenum class TraitAs: int {\n    TENSOR, //!< G-API traits an associated cv::Mat as a raw tensor\n            // and passes dimensions as-is\n    IMAGE   //!< G-API traits an associated cv::Mat as an image so\n            // creates an \"image\" blob (NCHW/NHWC, etc)\n};\n\nusing PostProc = std::function<void(const std::unordered_map<std::string, cv::Mat> &,\n                                          std::unordered_map<std::string, cv::Mat> &)>;\n\nnamespace detail {\n/**\n* @brief This structure contains description of inference parameters\n* which is specific to ONNX models.\n*/\nstruct ParamDesc {\n    std::string model_path; //!< Path to model.\n\n    // NB: nun_* may differ from topology's real input/output port numbers\n    // (e.g. topology's partial execution)\n    std::size_t num_in;  //!< How many inputs are defined in the operation\n    std::size_t num_out; //!< How many outputs are defined in the operation\n\n    // NB: Here order follows the `Net` API\n    std::vector<std::string> input_names; //!< Names of input network layers.\n    std::vector<std::string> output_names; //!< Names of output network layers.\n\n    using ConstInput = std::pair<cv::Mat, TraitAs>;\n    std::unordered_map<std::string, ConstInput> const_inputs; //!< Map with pair of name of network layer and ConstInput which will be associated with this.\n\n    std::vector<cv::Scalar> mean; //!< Mean values for preprocessing.\n    std::vector<cv::Scalar> stdev; //!< Standard deviation values for preprocessing.\n\n    std::vector<cv::GMatDesc> out_metas; //!< Out meta information about your output (type, dimension).\n    PostProc custom_post_proc; //!< Post processing function.\n\n    std::vector<bool> normalize; //!< Vector of bool values that enabled or disabled normalize of input data.\n\n    std::vector<std::string> names_to_remap; //!< Names of output layers that will be processed in PostProc function.\n};\n} // namespace detail\n\ntemplate<typename Net>\nstruct PortCfg {\n    using In = std::array\n        < std::string\n        , std::tuple_size<typename Net::InArgs>::value >;\n    using Out = std::array\n        < std::string\n        , std::tuple_size<typename Net::OutArgs>::value >;\n    using NormCoefs = std::array\n        < cv::Scalar\n        , std::tuple_size<typename Net::InArgs>::value >;\n    using Normalize = std::array\n        < bool\n        , std::tuple_size<typename Net::InArgs>::value >;\n};\n\n/**\n * Contains description of inference parameters and kit of functions that\n * fill this parameters.\n */\ntemplate<typename Net> class Params {\npublic:\n    /** @brief Class constructor.\n\n    Constructs Params based on model information and sets default values for other\n    inference description parameters.\n\n    @param model Path to model (.onnx file).\n    */\n    Params(const std::string &model) {\n        desc.model_path = model;\n        desc.num_in  = std::tuple_size<typename Net::InArgs>::value;\n        desc.num_out = std::tuple_size<typename Net::OutArgs>::value;\n    };\n\n    /** @brief Specifies sequence of network input layers names for inference.\n\n    The function is used to associate data of graph inputs with input layers of\n    network topology. Number of names has to match the number of network inputs. If a network\n    has only one input layer, there is no need to call it as the layer is\n    associated with input automatically but this doesn't prevent you from\n    doing it yourself. Count of names has to match to number of network inputs.\n\n    @param layer_names std::array<std::string, N> where N is the number of inputs\n    as defined in the @ref G_API_NET. Contains names of input layers.\n    @return the reference on modified object.\n    */\n    Params<Net>& cfgInputLayers(const typename PortCfg<Net>::In &layer_names) {\n        desc.input_names.assign(layer_names.begin(), layer_names.end());\n        return *this;\n    }\n\n    /** @brief Specifies sequence of output layers names for inference.\n\n     The function is used to associate data of graph outputs with output layers of\n    network topology. If a network has only one output layer, there is no need to call it\n    as the layer is associated with ouput automatically but this doesn't prevent\n    you from doing it yourself. Count of names has to match to number of network\n    outputs or you can set your own output but for this case you have to\n    additionally use @ref cfgPostProc function.\n\n    @param layer_names std::array<std::string, N> where N is the number of outputs\n    as defined in the @ref G_API_NET. Contains names of output layers.\n    @return the reference on modified object.\n    */\n    Params<Net>& cfgOutputLayers(const typename PortCfg<Net>::Out &layer_names) {\n        desc.output_names.assign(layer_names.begin(), layer_names.end());\n        return *this;\n    }\n\n    /** @brief Sets a constant input.\n\n    The function is used to set constant input. This input has to be\n    a prepared tensor since preprocessing is disabled for this case. You should\n    provide name of network layer which will receive provided data.\n\n    @param layer_name Name of network layer.\n    @param data cv::Mat that contains data which will be associated with network layer.\n    @param hint Type of input (TENSOR).\n    @return the reference on modified object.\n    */\n    Params<Net>& constInput(const std::string &layer_name,\n                            const cv::Mat &data,\n                            TraitAs hint = TraitAs::TENSOR) {\n        desc.const_inputs[layer_name] = {data, hint};\n        return *this;\n    }\n\n    /** @brief Specifies mean value and standard deviation for preprocessing.\n\n    The function is used to set mean value and standard deviation for preprocessing\n    of input data.\n\n    @param m std::array<cv::Scalar, N> where N is the number of inputs\n    as defined in the @ref G_API_NET. Contains mean values.\n    @param s std::array<cv::Scalar, N> where N is the number of inputs\n    as defined in the @ref G_API_NET. Contains standard deviation values.\n    @return the reference on modified object.\n    */\n    Params<Net>& cfgMeanStd(const typename PortCfg<Net>::NormCoefs &m,\n                            const typename PortCfg<Net>::NormCoefs &s) {\n        desc.mean.assign(m.begin(), m.end());\n        desc.stdev.assign(s.begin(), s.end());\n        return *this;\n    }\n\n    /** @brief Configures graph output and provides the post processing function from user.\n\n    The function is used when you work with networks with dynamic outputs.\n    Since we can't know dimensions of inference result needs provide them for\n    construction of graph output. This dimensions can differ from inference result.\n    So you have to provide @ref PostProc function that gets information from inference\n    result and fill output which is constructed by dimensions from out_metas.\n\n    @param out_metas Out meta information about your output (type, dimension).\n    @param remap_function Post processing function, which has two parameters. First is onnx\n    result, second is graph output. Both parameters is std::map that contain pair of\n    layer's name and cv::Mat.\n    @return the reference on modified object.\n    */\n    Params<Net>& cfgPostProc(const std::vector<cv::GMatDesc> &out_metas,\n                             const PostProc &remap_function) {\n        desc.out_metas        = out_metas;\n        desc.custom_post_proc = remap_function;\n        return *this;\n    }\n\n    /** @overload\n    Function with a rvalue parameters.\n\n    @param out_metas rvalue out meta information about your output (type, dimension).\n    @param remap_function rvalue post processing function, which has two parameters. First is onnx\n    result, second is graph output. Both parameters is std::map that contain pair of\n    layer's name and cv::Mat.\n    @return the reference on modified object.\n    */\n    Params<Net>& cfgPostProc(std::vector<cv::GMatDesc> &&out_metas,\n                             PostProc &&remap_function) {\n        desc.out_metas        = std::move(out_metas);\n        desc.custom_post_proc = std::move(remap_function);\n        return *this;\n    }\n\n    /** @overload\n    The function has additional parameter names_to_remap. This parameter provides\n    information about output layers which will be used for inference and post\n    processing function.\n\n    @param out_metas Out meta information.\n    @param remap_function Post processing function.\n    @param names_to_remap Names of output layers. network's inference will\n    be done on these layers. Inference's result will be processed in post processing\n    function using these names.\n    @return the reference on modified object.\n    */\n    Params<Net>& cfgPostProc(const std::vector<cv::GMatDesc> &out_metas,\n                             const PostProc &remap_function,\n                             const std::vector<std::string> &names_to_remap) {\n        desc.out_metas        = out_metas;\n        desc.custom_post_proc = remap_function;\n        desc.names_to_remap   = names_to_remap;\n        return *this;\n    }\n\n    /** @overload\n    Function with a rvalue parameters and additional parameter names_to_remap.\n\n    @param out_metas rvalue out meta information.\n    @param remap_function rvalue post processing function.\n    @param names_to_remap rvalue names of output layers. network's inference will\n    be done on these layers. Inference's result will be processed in post processing\n    function using these names.\n    @return the reference on modified object.\n    */\n    Params<Net>& cfgPostProc(std::vector<cv::GMatDesc> &&out_metas,\n                             PostProc &&remap_function,\n                             std::vector<std::string> &&names_to_remap) {\n        desc.out_metas        = std::move(out_metas);\n        desc.custom_post_proc = std::move(remap_function);\n        desc.names_to_remap   = std::move(names_to_remap);\n        return *this;\n    }\n\n    /** @brief Specifies normalize parameter for preprocessing.\n\n    The function is used to set normalize parameter for preprocessing of input data.\n\n    @param normalizations std::array<cv::Scalar, N> where N is the number of inputs\n    as defined in the @ref G_API_NET. Сontains bool values that enabled or disabled\n    normalize of input data.\n    @return the reference on modified object.\n    */\n    Params<Net>& cfgNormalize(const typename PortCfg<Net>::Normalize &normalizations) {\n        desc.normalize.assign(normalizations.begin(), normalizations.end());\n        return *this;\n    }\n\n    // BEGIN(G-API's network parametrization API)\n    GBackend      backend() const { return cv::gapi::onnx::backend(); }\n    std::string   tag()     const { return Net::tag(); }\n    cv::util::any params()  const { return { desc }; }\n    // END(G-API's network parametrization API)\n\nprotected:\n    detail::ParamDesc desc;\n};\n\n} // namespace onnx\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_INFER_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/infer/parsers.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_PARSERS_HPP\n#define OPENCV_GAPI_PARSERS_HPP\n\n#include <utility> // std::tuple\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n\nnamespace cv { namespace gapi {\nnamespace nn {\nnamespace parsers {\n    using GRects      = GArray<Rect>;\n    using GDetections = std::tuple<GArray<Rect>, GArray<int>>;\n\n    G_TYPED_KERNEL(GParseSSDBL, <GDetections(GMat, GOpaque<Size>, float, int)>,\n                   \"org.opencv.nn.parsers.parseSSD_BL\") {\n        static std::tuple<GArrayDesc,GArrayDesc> outMeta(const GMatDesc&, const GOpaqueDesc&, float, int) {\n            return std::make_tuple(empty_array_desc(), empty_array_desc());\n        }\n    };\n\n    G_TYPED_KERNEL(GParseSSD, <GRects(GMat, GOpaque<Size>, float, bool, bool)>,\n                   \"org.opencv.nn.parsers.parseSSD\") {\n        static GArrayDesc outMeta(const GMatDesc&, const GOpaqueDesc&, float, bool, bool) {\n            return empty_array_desc();\n        }\n    };\n\n    G_TYPED_KERNEL(GParseYolo, <GDetections(GMat, GOpaque<Size>, float, float, std::vector<float>)>,\n                   \"org.opencv.nn.parsers.parseYolo\") {\n        static std::tuple<GArrayDesc, GArrayDesc> outMeta(const GMatDesc&, const GOpaqueDesc&,\n                                                          float, float, const std::vector<float>&) {\n            return std::make_tuple(empty_array_desc(), empty_array_desc());\n        }\n        static const std::vector<float>& defaultAnchors() {\n            static std::vector<float> anchors {\n                0.57273f, 0.677385f, 1.87446f, 2.06253f, 3.33843f, 5.47434f, 7.88282f, 3.52778f, 9.77052f, 9.16828f\n            };\n            return anchors;\n        }\n    };\n} // namespace parsers\n} // namespace nn\n\n/** @brief Parses output of SSD network.\n\nExtracts detection information (box, confidence, label) from SSD output and\nfilters it by given confidence and label.\n\n@note Function textual ID is \"org.opencv.nn.parsers.parseSSD_BL\"\n\n@param in Input CV_32F tensor with {1,1,N,7} dimensions.\n@param inSz Size to project detected boxes to (size of the input image).\n@param confidenceThreshold If confidence of the\ndetection is smaller than confidence threshold, detection is rejected.\n@param filterLabel If provided (!= -1), only detections with\ngiven label will get to the output.\n@return a tuple with a vector of detected boxes and a vector of appropriate labels.\n*/\nGAPI_EXPORTS_W std::tuple<GArray<Rect>, GArray<int>> parseSSD(const GMat& in,\n                                                              const GOpaque<Size>& inSz,\n                                                              const float confidenceThreshold = 0.5f,\n                                                              const int   filterLabel = -1);\n\n/** @brief Parses output of SSD network.\n\nExtracts detection information (box, confidence) from SSD output and\nfilters it by given confidence and by going out of bounds.\n\n@note Function textual ID is \"org.opencv.nn.parsers.parseSSD\"\n\n@param in Input CV_32F tensor with {1,1,N,7} dimensions.\n@param inSz Size to project detected boxes to (size of the input image).\n@param confidenceThreshold If confidence of the\ndetection is smaller than confidence threshold, detection is rejected.\n@param alignmentToSquare If provided true, bounding boxes are extended to squares.\nThe center of the rectangle remains unchanged, the side of the square is\nthe larger side of the rectangle.\n@param filterOutOfBounds If provided true, out-of-frame boxes are filtered.\n@return a vector of detected bounding boxes.\n*/\nGAPI_EXPORTS_W GArray<Rect> parseSSD(const GMat& in,\n                                     const GOpaque<Size>& inSz,\n                                     const float confidenceThreshold,\n                                     const bool alignmentToSquare,\n                                     const bool filterOutOfBounds);\n\n/** @brief Parses output of Yolo network.\n\nExtracts detection information (box, confidence, label) from Yolo output,\nfilters it by given confidence and performs non-maximum supression for overlapping boxes.\n\n@note Function textual ID is \"org.opencv.nn.parsers.parseYolo\"\n\n@param in Input CV_32F tensor with {1,13,13,N} dimensions, N should satisfy:\n\\f[\\texttt{N} = (\\texttt{num_classes} + \\texttt{5}) * \\texttt{5},\\f]\nwhere num_classes - a number of classes Yolo network was trained with.\n@param inSz Size to project detected boxes to (size of the input image).\n@param confidenceThreshold If confidence of the\ndetection is smaller than confidence threshold, detection is rejected.\n@param nmsThreshold Non-maximum supression threshold which controls minimum\nrelative box intersection area required for rejecting the box with a smaller confidence.\nIf 1.f, nms is not performed and no boxes are rejected.\n@param anchors Anchors Yolo network was trained with.\n@note The default anchor values are specified for YOLO v2 Tiny as described in Intel Open Model Zoo\n<a href=\"https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/yolo-v2-tiny-tf/yolo-v2-tiny-tf.md\">documentation</a>.\n@return a tuple with a vector of detected boxes and a vector of appropriate labels.\n*/\nGAPI_EXPORTS_W std::tuple<GArray<Rect>, GArray<int>> parseYolo(const GMat& in,\n                                                               const GOpaque<Size>& inSz,\n                                                               const float confidenceThreshold = 0.5f,\n                                                               const float nmsThreshold = 0.5f,\n                                                               const std::vector<float>& anchors\n                                                                   = nn::parsers::GParseYolo::defaultAnchors());\n\n} // namespace gapi\n} // namespace cv\n\n// Reimport parseSSD & parseYolo under their initial namespace\nnamespace cv {\nnamespace gapi {\nnamespace streaming {\n\nusing cv::gapi::parseSSD;\nusing cv::gapi::parseYolo;\n\n} // namespace streaming\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_PARSERS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/infer.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019-2021 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_INFER_HPP\n#define OPENCV_GAPI_INFER_HPP\n\n// FIXME: Inference API is currently only available in full mode\n#if !defined(GAPI_STANDALONE)\n\n#include <functional>\n#include <string>  // string\n#include <utility> // tuple\n#include <type_traits> // is_same, false_type\n\n#include <opencv2/gapi/util/util.hpp> // all_satisfy\n#include <opencv2/gapi/util/any.hpp>  // any<>\n#include <opencv2/gapi/gkernel.hpp>   // GKernelType[M], GBackend\n#include <opencv2/gapi/garg.hpp>      // GArg\n#include <opencv2/gapi/gcommon.hpp>   // CompileArgTag\n#include <opencv2/gapi/gmetaarg.hpp>  // GMetaArg\n\nnamespace cv {\n\ntemplate<typename, typename> class GNetworkType;\n\nnamespace detail {\n\n// Infer ///////////////////////////////////////////////////////////////////////\ntemplate<typename T>\nstruct accepted_infer_types {\n    static constexpr const auto value =\n            std::is_same<typename std::decay<T>::type, cv::GMat>::value\n         || std::is_same<typename std::decay<T>::type, cv::GFrame>::value;\n};\n\ntemplate<typename... Ts>\nusing valid_infer_types = all_satisfy<accepted_infer_types, Ts...>;\n\n// Infer2 //////////////////////////////////////////////////////////////////////\n\ntemplate<typename, typename>\nstruct valid_infer2_types;\n\n// Terminal case 1 (50/50 success)\ntemplate<typename T>\nstruct valid_infer2_types< std::tuple<cv::GMat>, std::tuple<T> > {\n    // By default, Nets are limited to GMat argument types only\n    // for infer2, every GMat argument may translate to either\n    // GArray<GMat> or GArray<Rect>. GArray<> part is stripped\n    // already at this point.\n    static constexpr const auto value =\n            std::is_same<typename std::decay<T>::type, cv::GMat>::value\n         || std::is_same<typename std::decay<T>::type, cv::Rect>::value;\n};\n\n// Terminal case 2 (100% failure)\ntemplate<typename... Ts>\nstruct valid_infer2_types< std::tuple<>, std::tuple<Ts...> >\n    : public std::false_type {\n};\n\n// Terminal case 3 (100% failure)\ntemplate<typename... Ns>\nstruct valid_infer2_types< std::tuple<Ns...>, std::tuple<> >\n    : public std::false_type {\n};\n\n// Recursion -- generic\ntemplate<typename... Ns, typename T, typename...Ts>\nstruct valid_infer2_types< std::tuple<cv::GMat,Ns...>, std::tuple<T,Ts...> > {\n    static constexpr const auto value =\n           valid_infer2_types< std::tuple<cv::GMat>, std::tuple<T> >::value\n        && valid_infer2_types< std::tuple<Ns...>, std::tuple<Ts...> >::value;\n};\n\n// Struct stores network input/output names.\n// Used by infer<Generic>\nstruct InOutInfo\n{\n    std::vector<std::string> in_names;\n    std::vector<std::string> out_names;\n};\n\ntemplate <typename OutT>\nclass GInferOutputsTyped\n{\npublic:\n    GInferOutputsTyped() = default;\n    GInferOutputsTyped(std::shared_ptr<cv::GCall> call)\n        : m_priv(std::make_shared<Priv>(std::move(call)))\n    {\n    }\n\n    OutT at(const std::string& name)\n    {\n        auto it = m_priv->blobs.find(name);\n        if (it == m_priv->blobs.end()) {\n            // FIXME: Avoid modifying GKernel\n            auto shape = cv::detail::GTypeTraits<OutT>::shape;\n            m_priv->call->kernel().outShapes.push_back(shape);\n            m_priv->call->kernel().outCtors.emplace_back(cv::detail::GObtainCtor<OutT>::get());\n            auto out_idx = static_cast<int>(m_priv->blobs.size());\n            it = m_priv->blobs.emplace(name,\n                    cv::detail::Yield<OutT>::yield(*(m_priv->call), out_idx)).first;\n            m_priv->info->out_names.push_back(name);\n        }\n        return it->second;\n    }\nprivate:\n    struct Priv\n    {\n        Priv(std::shared_ptr<cv::GCall> c)\n            : call(std::move(c)), info(cv::util::any_cast<InOutInfo>(&call->params()))\n        {\n        }\n\n        std::shared_ptr<cv::GCall> call;\n        InOutInfo* info = nullptr;\n        std::unordered_map<std::string, OutT> blobs;\n    };\n\n    std::shared_ptr<Priv> m_priv;\n};\n\ntemplate <typename... Ts>\nclass GInferInputsTyped\n{\npublic:\n    GInferInputsTyped()\n        : m_priv(std::make_shared<Priv>())\n    {\n    }\n\n    template <typename U>\n    GInferInputsTyped<Ts...>& setInput(const std::string& name, U in)\n    {\n        m_priv->blobs.emplace(std::piecewise_construct,\n                              std::forward_as_tuple(name),\n                              std::forward_as_tuple(in));\n        return *this;\n    }\n\n    using StorageT = cv::util::variant<Ts...>;\n    StorageT& operator[](const std::string& name) {\n        return m_priv->blobs[name];\n    }\n\n    using Map = std::unordered_map<std::string, StorageT>;\n    const Map& getBlobs() const {\n        return m_priv->blobs;\n    }\n\nprivate:\n    struct Priv\n    {\n        std::unordered_map<std::string, StorageT> blobs;\n    };\n\n    std::shared_ptr<Priv> m_priv;\n};\n\ntemplate<typename InferT>\nstd::shared_ptr<cv::GCall> makeCall(const std::string         &tag,\n                                    std::vector<cv::GArg>    &&args,\n                                    std::vector<std::string> &&names,\n                                    cv::GKinds               &&kinds) {\n    auto call = std::make_shared<cv::GCall>(GKernel{\n                InferT::id(),\n                tag,\n                InferT::getOutMeta,\n                {}, // outShape will be filled later\n                std::move(kinds),\n                {}, // outCtors will be filled later\n            });\n\n    call->setArgs(std::move(args));\n    call->params() = cv::detail::InOutInfo{std::move(names), {}};\n\n    return call;\n}\n\n} // namespace detail\n\n// TODO: maybe tuple_wrap_helper from util.hpp may help with this.\n// Multiple-return-value network definition (specialized base class)\ntemplate<typename K, typename... R, typename... Args>\nclass GNetworkType<K, std::function<std::tuple<R...>(Args...)> >\n{\npublic:\n    using InArgs  = std::tuple<Args...>;\n    using OutArgs = std::tuple<R...>;\n\n    using Result  = OutArgs;\n    using API     = std::function<Result(Args...)>;\n\n    using ResultL = std::tuple< cv::GArray<R>... >;\n};\n\n// Single-return-value network definition (specialized base class)\ntemplate<typename K, typename R, typename... Args>\nclass GNetworkType<K, std::function<R(Args...)> >\n{\npublic:\n    using InArgs  = std::tuple<Args...>;\n    using OutArgs = std::tuple<R>;\n\n    using Result  = R;\n    using API     = std::function<R(Args...)>;\n\n    using ResultL = cv::GArray<R>;\n};\n\n// InferAPI: Accepts either GMat or GFrame for very individual network's input\ntemplate<class Net, class... Ts>\nstruct InferAPI {\n    using type = typename std::enable_if\n        <    detail::valid_infer_types<Ts...>::value\n          && std::tuple_size<typename Net::InArgs>::value == sizeof...(Ts)\n        , std::function<typename Net::Result(Ts...)>\n        >::type;\n};\n\n// InferAPIRoi: Accepts a rectangle and either GMat or GFrame\ntemplate<class Net, class T>\nstruct InferAPIRoi {\n    using type = typename std::enable_if\n        <    detail::valid_infer_types<T>::value\n          && std::tuple_size<typename Net::InArgs>::value == 1u\n          , std::function<typename Net::Result(cv::GOpaque<cv::Rect>, T)>\n        >::type;\n};\n\n// InferAPIList: Accepts a list of rectangles and list of GMat/GFrames;\n// crops every input.\ntemplate<class Net, class... Ts>\nstruct InferAPIList {\n    using type = typename std::enable_if\n        <    detail::valid_infer_types<Ts...>::value\n          && std::tuple_size<typename Net::InArgs>::value == sizeof...(Ts)\n        , std::function<typename Net::ResultL(cv::GArray<cv::Rect>, Ts...)>\n        >::type;\n};\n\n// APIList2 is also template to allow different calling options\n// (GArray<cv::Rect> vs GArray<cv::GMat> per input)\ntemplate<class Net, typename T, class... Ts>\nstruct InferAPIList2 {\n    using type = typename std::enable_if\n        < detail::valid_infer_types<T>::value &&\n          cv::detail::valid_infer2_types< typename Net::InArgs\n                                        , std::tuple<Ts...> >::value,\n          std::function<typename Net::ResultL(T, cv::GArray<Ts>...)>\n        >::type;\n};\n\n// Base \"Infer\" kernel. Note - for whatever network, kernel ID\n// is always the same. Different inference calls are distinguished by\n// network _tag_ (an extra field in GCall)\n//\n// getOutMeta is a stub callback collected by G-API kernel subsystem\n// automatically. This is a rare case when this callback is defined by\n// a particular backend, not by a network itself.\nstruct GInferBase {\n    static constexpr const char * id() {\n        return \"org.opencv.dnn.infer\";            // Universal stub\n    }\n    static GMetaArgs getOutMeta(const GMetaArgs &, const GArgs &) {\n        return GMetaArgs{};                       // One more universal stub\n    }\n};\n\n// Base \"InferROI\" kernel.\n// All notes from \"Infer\" kernel apply here as well.\nstruct GInferROIBase {\n    static constexpr const char * id() {\n        return \"org.opencv.dnn.infer-roi\";        // Universal stub\n    }\n    static GMetaArgs getOutMeta(const GMetaArgs &, const GArgs &) {\n        return GMetaArgs{};                       // One more universal stub\n    }\n};\n\n// Base \"Infer list\" kernel.\n// All notes from \"Infer\" kernel apply here as well.\nstruct GInferListBase {\n    static constexpr const char * id() {\n        return \"org.opencv.dnn.infer-roi-list-1\"; // Universal stub\n    }\n    static GMetaArgs getOutMeta(const GMetaArgs &, const GArgs &) {\n        return GMetaArgs{};                       // One more universal stub\n    }\n};\n\n// Base \"Infer list 2\" kernel.\n// All notes from \"Infer\" kernel apply here as well.\nstruct GInferList2Base {\n    static constexpr const char * id() {\n        return \"org.opencv.dnn.infer-roi-list-2\"; // Universal stub\n    }\n    static GMetaArgs getOutMeta(const GMetaArgs &, const GArgs &) {\n        return GMetaArgs{};                       // One more universal stub\n    }\n};\n\n// A generic inference kernel. API (::on()) is fully defined by the Net\n// template parameter.\n// Acts as a regular kernel in graph (via KernelTypeMedium).\ntemplate<typename Net, typename... Args>\nstruct GInfer final\n    : public GInferBase\n    , public detail::KernelTypeMedium< GInfer<Net, Args...>\n                                     , typename InferAPI<Net, Args...>::type > {\n    using GInferBase::getOutMeta; // FIXME: name lookup conflict workaround?\n\n    static constexpr const char* tag() { return Net::tag(); }\n};\n\n// A specific roi-inference kernel. API (::on()) is fixed here and\n// verified against Net.\ntemplate<typename Net, typename T>\nstruct GInferROI final\n    : public GInferROIBase\n    , public detail::KernelTypeMedium< GInferROI<Net, T>\n                                     , typename InferAPIRoi<Net, T>::type > {\n    using GInferROIBase::getOutMeta; // FIXME: name lookup conflict workaround?\n\n    static constexpr const char* tag() { return Net::tag(); }\n};\n\n\n// A generic roi-list inference kernel. API (::on()) is derived from\n// the Net template parameter (see more in infer<> overload).\ntemplate<typename Net, typename... Args>\nstruct GInferList final\n    : public GInferListBase\n    , public detail::KernelTypeMedium< GInferList<Net, Args...>\n                                     , typename InferAPIList<Net, Args...>::type > {\n    using GInferListBase::getOutMeta; // FIXME: name lookup conflict workaround?\n\n    static constexpr const char* tag() { return Net::tag(); }\n};\n\n// An even more generic roi-list inference kernel. API (::on()) is\n// derived from the Net template parameter (see more in infer<>\n// overload).\n// Takes an extra variadic template list to reflect how this network\n// was called (with Rects or GMats as array parameters)\ntemplate<typename Net, typename T, typename... Args>\nstruct GInferList2 final\n    : public GInferList2Base\n    , public detail::KernelTypeMedium< GInferList2<Net, T, Args...>\n                                     , typename InferAPIList2<Net, T, Args...>::type > {\n    using GInferList2Base::getOutMeta; // FIXME: name lookup conflict workaround?\n\n    static constexpr const char* tag() { return Net::tag(); }\n};\n\n/**\n * @brief G-API object used to collect network inputs\n */\nusing GInferInputs = cv::detail::GInferInputsTyped<cv::GMat, cv::GFrame>;\n\n/**\n * @brief G-API object used to collect the list of network inputs\n */\nusing GInferListInputs = cv::detail::GInferInputsTyped<cv::GArray<cv::GMat>, cv::GArray<cv::Rect>>;\n\n/**\n * @brief G-API object used to collect network outputs\n */\nusing GInferOutputs = cv::detail::GInferOutputsTyped<cv::GMat>;\n\n/**\n * @brief G-API object used to collect the list of network outputs\n */\nusing GInferListOutputs = cv::detail::GInferOutputsTyped<cv::GArray<cv::GMat>>;\n\nnamespace detail {\nvoid inline unpackBlobs(const cv::GInferInputs::Map& blobs,\n                        std::vector<cv::GArg>& args,\n                        std::vector<std::string>& names,\n                        cv::GKinds& kinds)\n{\n    for (auto&& p : blobs) {\n        names.emplace_back(p.first);\n        switch (p.second.index()) {\n            case cv::GInferInputs::StorageT::index_of<cv::GMat>():\n                args.emplace_back(cv::util::get<cv::GMat>(p.second));\n                kinds.emplace_back(cv::detail::OpaqueKind::CV_MAT);\n                break;\n            case cv::GInferInputs::StorageT::index_of<cv::GFrame>():\n                args.emplace_back(cv::util::get<cv::GFrame>(p.second));\n                kinds.emplace_back(cv::detail::OpaqueKind::CV_UNKNOWN);\n                break;\n            default:\n                GAPI_Assert(false);\n        }\n    }\n}\n\ntemplate <typename InferType>\nstruct InferROITraits;\n\ntemplate <>\nstruct InferROITraits<GInferROIBase>\n{\n    using outType = cv::GInferOutputs;\n    using inType  = cv::GOpaque<cv::Rect>;\n};\n\ntemplate <>\nstruct InferROITraits<GInferListBase>\n{\n    using outType = cv::GInferListOutputs;\n    using inType  = cv::GArray<cv::Rect>;\n};\n\ntemplate<typename InferType>\ntypename InferROITraits<InferType>::outType\ninferGenericROI(const std::string& tag,\n         const typename InferROITraits<InferType>::inType& in,\n         const cv::GInferInputs& inputs)\n{\n    std::vector<cv::GArg> args;\n    std::vector<std::string> names;\n    cv::GKinds kinds;\n\n    args.emplace_back(in);\n    kinds.emplace_back(cv::detail::OpaqueKind::CV_RECT);\n\n    unpackBlobs(inputs.getBlobs(), args, names, kinds);\n\n    auto call = cv::detail::makeCall<InferType>(tag,\n                                                std::move(args),\n                                                std::move(names),\n                                                std::move(kinds));\n\n    return {std::move(call)};\n}\n\n} // namespace detail\n} // namespace cv\n\n// FIXME: Probably the <API> signature makes a function/tuple/function round-trip\n#define G_API_NET(Class, API, Tag)                                      \\\n    struct Class final: public cv::GNetworkType<Class, std::function API> { \\\n        static constexpr const char * tag() { return Tag; }             \\\n    }\n\nnamespace cv {\nnamespace gapi {\n\n/** @brief Calculates response for the specified network (template\n *     parameter) for the specified region in the source image.\n *     Currently expects a single-input network only.\n *\n * @tparam A network type defined with G_API_NET() macro.\n * @param in input image where to take ROI from.\n * @param roi an object describing the region of interest\n *   in the source image. May be calculated in the same graph dynamically.\n * @return an object of return type as defined in G_API_NET().\n *   If a network has multiple return values (defined with a tuple), a tuple of\n *   objects of appropriate type is returned.\n * @sa  G_API_NET()\n */\ntemplate<typename Net, typename T>\ntypename Net::Result infer(cv::GOpaque<cv::Rect> roi, T in) {\n    return GInferROI<Net, T>::on(roi, in);\n}\n\n/** @brief Calculates responses for the specified network (template\n *     parameter) for every region in the source image.\n *\n * @tparam A network type defined with G_API_NET() macro.\n * @param roi a list of rectangles describing regions of interest\n *   in the source image. Usually an output of object detector or tracker.\n * @param args network's input parameters as specified in G_API_NET() macro.\n *   NOTE: verified to work reliably with 1-input topologies only.\n * @return a list of objects of return type as defined in G_API_NET().\n *   If a network has multiple return values (defined with a tuple), a tuple of\n *   GArray<> objects is returned with the appropriate types inside.\n * @sa  G_API_NET()\n */\ntemplate<typename Net, typename... Args>\ntypename Net::ResultL infer(cv::GArray<cv::Rect> roi, Args&&... args) {\n    return GInferList<Net, Args...>::on(roi, std::forward<Args>(args)...);\n}\n\n/** @brief Calculates responses for the specified network (template\n *     parameter) for every region in the source image, extended version.\n *\n * @tparam A network type defined with G_API_NET() macro.\n * @param image A source image containing regions of interest\n * @param args GArray<> objects of cv::Rect or cv::GMat, one per every\n * network input:\n * - If a cv::GArray<cv::Rect> is passed, the appropriate\n *   regions are taken from `image` and preprocessed to this particular\n *   network input;\n * - If a cv::GArray<cv::GMat> is passed, the underlying data traited\n *   as tensor (no automatic preprocessing happen).\n * @return a list of objects of return type as defined in G_API_NET().\n *   If a network has multiple return values (defined with a tuple), a tuple of\n *   GArray<> objects is returned with the appropriate types inside.\n * @sa  G_API_NET()\n */\n\ntemplate<typename Net, typename T, typename... Args>\ntypename Net::ResultL infer2(T image, cv::GArray<Args>... args) {\n    // FIXME: Declared as \"2\" because in the current form it steals\n    // overloads from the regular infer\n    return GInferList2<Net, T, Args...>::on(image, args...);\n}\n\n/**\n * @brief Calculates response for the specified network (template\n *     parameter) given the input data.\n *\n * @tparam A network type defined with G_API_NET() macro.\n * @param args network's input parameters as specified in G_API_NET() macro.\n * @return an object of return type as defined in G_API_NET().\n *   If a network has multiple return values (defined with a tuple), a tuple of\n *   objects of appropriate type is returned.\n * @sa  G_API_NET()\n */\ntemplate<typename Net, typename... Args>\ntypename Net::Result infer(Args&&... args) {\n    return GInfer<Net, Args...>::on(std::forward<Args>(args)...);\n}\n\n/**\n * @brief Generic network type: input and output layers are configured dynamically at runtime\n *\n * Unlike the network types defined with G_API_NET macro, this one\n * doesn't fix number of network inputs and outputs at the compilation stage\n * thus providing user with an opportunity to program them in runtime.\n */\nstruct Generic { };\n\n/**\n * @brief Calculates response for generic network\n *\n * @param tag a network tag\n * @param inputs networks's inputs\n * @return a GInferOutputs\n */\ntemplate<typename T = Generic> cv::GInferOutputs\ninfer(const std::string& tag, const cv::GInferInputs& inputs)\n{\n    std::vector<cv::GArg> args;\n    std::vector<std::string> names;\n    cv::GKinds kinds;\n\n    cv::detail::unpackBlobs(inputs.getBlobs(), args, names, kinds);\n\n    auto call = cv::detail::makeCall<GInferBase>(tag,\n                                                 std::move(args),\n                                                 std::move(names),\n                                                 std::move(kinds));\n\n    return cv::GInferOutputs{std::move(call)};\n}\n\n/** @brief Calculates response for the generic network\n *     for the specified region in the source image.\n *     Currently expects a single-input network only.\n *\n * @param tag a network tag\n * @param roi a an object describing the region of interest\n *   in the source image. May be calculated in the same graph dynamically.\n * @param inputs networks's inputs\n * @return a cv::GInferOutputs\n */\ntemplate<typename T = Generic> cv::GInferOutputs\ninfer(const std::string& tag, const cv::GOpaque<cv::Rect>& roi, const cv::GInferInputs& inputs)\n{\n    return cv::detail::inferGenericROI<GInferROIBase>(tag, roi, inputs);\n}\n\n/** @brief Calculates responses for the specified network\n *     for every region in the source image.\n *\n * @param tag a network tag\n * @param rois a list of rectangles describing regions of interest\n *   in the source image. Usually an output of object detector or tracker.\n * @param inputs networks's inputs\n * @return a cv::GInferListOutputs\n */\ntemplate<typename T = Generic> cv::GInferListOutputs\ninfer(const std::string& tag, const cv::GArray<cv::Rect>& rois, const cv::GInferInputs& inputs)\n{\n    return cv::detail::inferGenericROI<GInferListBase>(tag, rois, inputs);\n}\n\n/** @brief Calculates responses for the specified network\n *     for every region in the source image, extended version.\n *\n * @param tag a network tag\n * @param in a source image containing regions of interest.\n * @param inputs networks's inputs\n * @return a cv::GInferListOutputs\n */\ntemplate<typename T = Generic, typename Input>\ntypename std::enable_if<cv::detail::accepted_infer_types<Input>::value, cv::GInferListOutputs>::type\ninfer2(const std::string& tag,\n       const Input& in,\n       const cv::GInferListInputs& inputs)\n{\n    std::vector<cv::GArg> args;\n    std::vector<std::string> names;\n    cv::GKinds kinds;\n\n    args.emplace_back(in);\n    auto k = cv::detail::GOpaqueTraits<Input>::kind;\n    kinds.emplace_back(k);\n\n    for (auto&& p : inputs.getBlobs()) {\n        names.emplace_back(p.first);\n        switch (p.second.index()) {\n            case cv::GInferListInputs::StorageT::index_of<cv::GArray<cv::GMat>>():\n                args.emplace_back(cv::util::get<cv::GArray<cv::GMat>>(p.second));\n                kinds.emplace_back(cv::detail::OpaqueKind::CV_MAT);\n                break;\n            case cv::GInferListInputs::StorageT::index_of<cv::GArray<cv::Rect>>():\n                args.emplace_back(cv::util::get<cv::GArray<cv::Rect>>(p.second));\n                kinds.emplace_back(cv::detail::OpaqueKind::CV_RECT);\n                break;\n            default:\n                GAPI_Assert(false);\n        }\n    }\n\n    auto call = cv::detail::makeCall<GInferList2Base>(tag,\n                                                      std::move(args),\n                                                      std::move(names),\n                                                      std::move(kinds));\n\n    return cv::GInferListOutputs{std::move(call)};\n}\n\n} // namespace gapi\n} // namespace cv\n\n#endif // GAPI_STANDALONE\n\nnamespace cv {\nnamespace gapi {\n\n// Note: the below code _is_ part of STANDALONE build,\n// just to make our compiler code compileable.\n\n// A type-erased form of network parameters.\n// Similar to how a type-erased GKernel is represented and used.\n/// @private\nstruct GAPI_EXPORTS_W_SIMPLE GNetParam {\n    std::string tag;     // FIXME: const?\n    GBackend backend;    // Specifies the execution model\n    util::any params;    // Backend-interpreted parameter structure\n};\n\n/** \\addtogroup gapi_compile_args\n * @{\n */\n/**\n * @brief A container class for network configurations. Similar to\n * GKernelPackage. Use cv::gapi::networks() to construct this object.\n *\n * @sa cv::gapi::networks\n */\nstruct GAPI_EXPORTS_W_SIMPLE GNetPackage {\n    GAPI_WRAP GNetPackage() = default;\n    GAPI_WRAP explicit GNetPackage(std::vector<GNetParam> nets);\n    explicit GNetPackage(std::initializer_list<GNetParam> ii);\n    std::vector<GBackend> backends() const;\n    std::vector<GNetParam> networks;\n};\n/** @} gapi_compile_args */\n} // namespace gapi\n\nnamespace detail {\ntemplate<typename T>\ngapi::GNetParam strip(T&& t) {\n    return gapi::GNetParam { t.tag()\n                           , t.backend()\n                           , t.params()\n                           };\n}\n\ntemplate<> struct CompileArgTag<cv::gapi::GNetPackage> {\n    static const char* tag() { return \"gapi.net_package\"; }\n};\n\n} // namespace cv::detail\n\nnamespace gapi {\ntemplate<typename... Args>\ncv::gapi::GNetPackage networks(Args&&... args) {\n    return cv::gapi::GNetPackage({ cv::detail::strip(args)... });\n}\n\ninline cv::gapi::GNetPackage& operator += (      cv::gapi::GNetPackage& lhs,\n                                           const cv::gapi::GNetPackage& rhs) {\n    lhs.networks.reserve(lhs.networks.size() + rhs.networks.size());\n    lhs.networks.insert(lhs.networks.end(), rhs.networks.begin(), rhs.networks.end());\n    return lhs;\n}\n\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_INFER_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/media.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n#ifndef OPENCV_GAPI_MEDIA_HPP\n#define OPENCV_GAPI_MEDIA_HPP\n\n#include <memory>     // unique_ptr<>, shared_ptr<>\n#include <array>      // array<>\n#include <functional> // function<>\n#include <utility>    // forward<>()\n\n#include <opencv2/gapi/gframe.hpp>\n#include <opencv2/gapi/util/any.hpp>\n\nnamespace cv {\n\n/** \\addtogroup gapi_data_structures\n * @{\n *\n * @brief Extra G-API data structures used to pass input/output data\n * to the graph for processing.\n */\n/**\n * @brief cv::MediaFrame class represents an image/media frame\n * obtained from an external source.\n *\n * cv::MediaFrame represents image data as specified in\n * cv::MediaFormat. cv::MediaFrame is designed to be a thin wrapper over some\n * external memory of buffer; the class itself provides an uniform\n * interface over such types of memory. cv::MediaFrame wraps data from\n * a camera driver or from a media codec and provides an abstraction\n * layer over this memory to G-API. MediaFrame defines a compact interface\n * to access and manage the underlying data; the implementation is\n * fully defined by the associated Adapter (which is usually\n * user-defined).\n *\n * @sa cv::RMat\n */\nclass GAPI_EXPORTS MediaFrame {\npublic:\n    /// This enum defines different types of cv::MediaFrame provided\n    /// access to the underlying data. Note that different flags can't\n    /// be combined in this version.\n    enum class Access {\n        R, ///< Access data for reading\n        W, ///< Access data for writing\n    };\n    class IAdapter;\n    class View;\n    using AdapterPtr = std::unique_ptr<IAdapter>;\n\n    /**\n     * @brief Constructs an empty MediaFrame\n     *\n     * The constructed object has no any data associated with it.\n     */\n    MediaFrame();\n\n    /**\n     * @brief Constructs a MediaFrame with the given\n     * Adapter. MediaFrame takes ownership over the passed adapter.\n     *\n     * @param p an unique pointer to instance of IAdapter derived class.\n     */\n    explicit MediaFrame(AdapterPtr &&p);\n\n    /**\n     * @overload\n     * @brief Constructs a MediaFrame with the given parameters for\n     * the Adapter. The adapter of type `T` is costructed on the fly.\n     *\n     * @param args list of arguments to construct an adapter of type\n     * `T`.\n     */\n    template<class T, class... Args> static cv::MediaFrame Create(Args&&... args);\n\n    /**\n     * @brief Obtain access to the underlying data with the given\n     * mode.\n     *\n     * Depending on the associated Adapter and the data wrapped, this\n     * method may be cheap (e.g., the underlying memory is local) or\n     * costly (if the underlying memory is external or device\n     * memory).\n     *\n     * @param mode an access mode flag\n     * @return a MediaFrame::View object. The views should be handled\n     * carefully, refer to the MediaFrame::View documentation for details.\n     */\n    View access(Access mode) const;\n\n    /**\n     * @brief Returns a media frame descriptor -- the information\n     * about the media format, dimensions, etc.\n     * @return a cv::GFrameDesc\n     */\n    cv::GFrameDesc desc() const;\n\n    // FIXME: design a better solution\n    // Should be used only if the actual adapter provides implementation\n    /// @private -- exclude from the OpenCV documentation for now.\n    cv::util::any blobParams() const;\n\n    /**\n     * @brief Casts and returns the associated MediaFrame adapter to\n     * the particular adapter type `T`, returns nullptr if the type is\n     * different.\n     *\n     * This method may be useful if the adapter type is known by the\n     * caller, and some lower level access to the memory is required.\n     * Depending on the memory type, it may be more efficient than\n     * access().\n     *\n     * @return a pointer to the adapter object, nullptr if the adapter\n     * type is different.\n     */\n    template<typename T> T* get() const {\n        static_assert(std::is_base_of<IAdapter, T>::value,\n                      \"T is not derived from cv::MediaFrame::IAdapter!\");\n        auto* adapter = getAdapter();\n        GAPI_Assert(adapter != nullptr);\n        return dynamic_cast<T*>(adapter);\n    }\n\nprivate:\n    struct Priv;\n    std::shared_ptr<Priv> m;\n    IAdapter* getAdapter() const;\n};\n\ntemplate<class T, class... Args>\ninline cv::MediaFrame cv::MediaFrame::Create(Args&&... args) {\n    std::unique_ptr<T> ptr(new T(std::forward<Args>(args)...));\n    return cv::MediaFrame(std::move(ptr));\n}\n\n/**\n * @brief Provides access to the MediaFrame's underlying data.\n *\n * This object contains the necessary information to access the pixel\n * data of the associated MediaFrame: arrays of pointers and strides\n * (distance between every plane row, in bytes) for every image\n * plane, as defined in cv::MediaFormat.\n * There may be up to four image planes in MediaFrame.\n *\n * Depending on the MediaFrame::Access flag passed in\n * MediaFrame::access(), a MediaFrame::View may be read- or\n * write-only.\n *\n * Depending on the MediaFrame::IAdapter implementation associated\n * with the parent MediaFrame, writing to memory with\n * MediaFrame::Access::R flag may have no effect or lead to\n * undefined behavior. Same applies to reading the memory with\n * MediaFrame::Access::W flag -- again, depending on the IAdapter\n * implementation, the host-side buffer the view provides access to\n * may have no current data stored in (so in-place editing of the\n * buffer contents may not be possible).\n *\n * MediaFrame::View objects must be handled carefully, as an external\n * resource associated with MediaFrame may be locked for the time the\n * MediaFrame::View object exists. Obtaining MediaFrame::View should\n * be seen as \"map\" and destroying it as \"unmap\" in the \"map/unmap\"\n * idiom (applicable to OpenCL, device memory, remote\n * memory).\n *\n * When a MediaFrame buffer is accessed for writing, and the memory\n * under MediaFrame::View::Ptrs is altered, the data synchronization\n * of a host-side and device/remote buffer is not guaranteed until the\n * MediaFrame::View is destroyed. In other words, the real data on the\n * device or in a remote target may be updated at the MediaFrame::View\n * destruction only -- but it depends on the associated\n * MediaFrame::IAdapter implementation.\n */\nclass GAPI_EXPORTS MediaFrame::View final {\npublic:\n    static constexpr const size_t MAX_PLANES = 4;\n    using Ptrs     = std::array<void*, MAX_PLANES>;\n    using Strides  = std::array<std::size_t, MAX_PLANES>; // in bytes\n    using Callback = std::function<void()>;\n\n    /// @private\n    View(Ptrs&& ptrs, Strides&& strs, Callback &&cb = [](){});\n\n    /// @private\n    View(const View&) = delete;\n\n    /// @private\n    View(View&&) = default;\n\n    /// @private\n    View& operator = (const View&) = delete;\n\n    ~View();\n\n    Ptrs    ptr; ///< Array of image plane pointers\n    Strides stride; ///< Array of image plane strides, in bytes.\n\nprivate:\n    Callback m_cb;\n};\n\n/**\n * @brief An interface class for MediaFrame data adapters.\n *\n * Implement this interface to wrap media data in the MediaFrame. It\n * makes sense to implement this class if there is a custom\n * cv::gapi::wip::IStreamSource defined -- in this case, a stream\n * source can produce MediaFrame objects with this adapter and the\n * media data may be passed to graph without any copy. For example, a\n * GStreamer-based stream source can implement an adapter over\n * `GstBuffer` and G-API will transparently use it in the graph.\n */\nclass GAPI_EXPORTS MediaFrame::IAdapter {\npublic:\n    virtual ~IAdapter() = 0;\n    virtual cv::GFrameDesc meta() const = 0;\n    virtual MediaFrame::View access(MediaFrame::Access) = 0;\n    // FIXME: design a better solution\n    // The default implementation does nothing\n    virtual cv::util::any blobParams() const;\n};\n/** @} */\n\n} //namespace cv\n\n#endif // OPENCV_GAPI_MEDIA_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/ocl/core.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_OCL_CORE_API_HPP\n#define OPENCV_GAPI_OCL_CORE_API_HPP\n\n#include <opencv2/core/cvdef.h>     // GAPI_EXPORTS\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n\nnamespace cv {\nnamespace gapi {\nnamespace core {\nnamespace ocl {\n\n        GAPI_EXPORTS_W cv::gapi::GKernelPackage kernels();\n\n} // namespace ocl\n} // namespace core\n} // namespace gapi\n} // namespace cv\n\n\n#endif // OPENCV_GAPI_OCL_CORE_API_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/ocl/goclkernel.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GOCLKERNEL_HPP\n#define OPENCV_GAPI_GOCLKERNEL_HPP\n\n#include <vector>\n#include <functional>\n#include <map>\n#include <unordered_map>\n\n#include <opencv2/core/mat.hpp>\n#include <opencv2/gapi/gcommon.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n#include <opencv2/gapi/garg.hpp>\n\n// FIXME: namespace scheme for backends?\nnamespace cv {\n\nnamespace gimpl\n{\n    // Forward-declare an internal class\n    class GOCLExecutable;\n} // namespace gimpl\n\nnamespace gapi\n{\n/**\n * @brief This namespace contains G-API OpenCL backend functions, structures, and symbols.\n */\nnamespace ocl\n{\n    /**\n     * \\addtogroup gapi_std_backends G-API Standard Backends\n     * @{\n     */\n    /**\n     * @brief Get a reference to OCL backend.\n     *\n     * At the moment, the OCL backend is built atop of OpenCV\n     * \"Transparent API\" (T-API), see cv::UMat for details.\n     *\n     * @sa gapi_std_backends\n     */\n    GAPI_EXPORTS cv::gapi::GBackend backend();\n    /** @} */\n} // namespace ocl\n} // namespace gapi\n\n\n// Represents arguments which are passed to a wrapped OCL function\n// FIXME: put into detail?\nclass GAPI_EXPORTS GOCLContext\n{\npublic:\n    // Generic accessor API\n    template<typename T>\n    const T& inArg(int input) { return m_args.at(input).get<T>(); }\n\n    // Syntax sugar\n    const cv::UMat&  inMat(int input);\n    cv::UMat&  outMatR(int output); // FIXME: Avoid cv::Mat m = ctx.outMatR()\n\n    const cv::Scalar& inVal(int input);\n    cv::Scalar& outValR(int output); // FIXME: Avoid cv::Scalar s = ctx.outValR()\n    template<typename T> std::vector<T>& outVecR(int output) // FIXME: the same issue\n    {\n        return outVecRef(output).wref<T>();\n    }\n    template<typename T> T& outOpaqueR(int output) // FIXME: the same issue\n    {\n        return outOpaqueRef(output).wref<T>();\n    }\n\nprotected:\n    detail::VectorRef& outVecRef(int output);\n    detail::OpaqueRef& outOpaqueRef(int output);\n\n    std::vector<GArg> m_args;\n    std::unordered_map<std::size_t, GRunArgP> m_results;\n\n\n    friend class gimpl::GOCLExecutable;\n};\n\nclass GAPI_EXPORTS GOCLKernel\n{\npublic:\n    // This function is kernel's execution entry point (does the processing work)\n    using F = std::function<void(GOCLContext &)>;\n\n    GOCLKernel();\n    explicit GOCLKernel(const F& f);\n\n    void apply(GOCLContext &ctx);\n\nprotected:\n    F m_f;\n};\n\n// FIXME: This is an ugly ad-hoc implementation. TODO: refactor\n\nnamespace detail\n{\ntemplate<class T> struct ocl_get_in;\ntemplate<> struct ocl_get_in<cv::GMat>\n{\n    static cv::UMat    get(GOCLContext &ctx, int idx) { return ctx.inMat(idx); }\n};\ntemplate<> struct ocl_get_in<cv::GScalar>\n{\n    static cv::Scalar get(GOCLContext &ctx, int idx) { return ctx.inVal(idx); }\n};\ntemplate<typename U> struct ocl_get_in<cv::GArray<U> >\n{\n    static const std::vector<U>& get(GOCLContext &ctx, int idx) { return ctx.inArg<VectorRef>(idx).rref<U>(); }\n};\ntemplate<typename U> struct ocl_get_in<cv::GOpaque<U> >\n{\n    static const U& get(GOCLContext &ctx, int idx) { return ctx.inArg<OpaqueRef>(idx).rref<U>(); }\n};\ntemplate<class T> struct ocl_get_in\n{\n    static T get(GOCLContext &ctx, int idx) { return ctx.inArg<T>(idx); }\n};\n\nstruct tracked_cv_umat{\n    //TODO Think if T - API could reallocate UMat to a proper size - how do we handle this ?\n    //tracked_cv_umat(cv::UMat& m) : r{(m)}, original_data{m.getMat(ACCESS_RW).data} {}\n    tracked_cv_umat(cv::UMat& m) : r(m), original_data{ nullptr } {}\n    cv::UMat &r; // FIXME: It was a value (not a reference) before.\n                 // Actually OCL backend should allocate its internal data!\n    uchar* original_data;\n\n    operator cv::UMat& (){ return r;}\n    void validate() const{\n        //if (r.getMat(ACCESS_RW).data != original_data)\n        //{\n        //    util::throw_error\n        //        (std::logic_error\n        //         (\"OpenCV kernel output parameter was reallocated. \\n\"\n        //          \"Incorrect meta data was provided ?\"));\n        //}\n\n    }\n};\n\ntemplate<typename... Outputs>\nvoid postprocess_ocl(Outputs&... outs)\n{\n    struct\n    {\n        void operator()(tracked_cv_umat* bm) { bm->validate(); }\n        void operator()(...) {                  }\n\n    } validate;\n    //dummy array to unfold parameter pack\n    int dummy[] = { 0, (validate(&outs), 0)... };\n    cv::util::suppress_unused_warning(dummy);\n}\n\ntemplate<class T> struct ocl_get_out;\ntemplate<> struct ocl_get_out<cv::GMat>\n{\n    static tracked_cv_umat get(GOCLContext &ctx, int idx)\n    {\n        auto& r = ctx.outMatR(idx);\n        return{ r };\n    }\n};\ntemplate<> struct ocl_get_out<cv::GScalar>\n{\n    static cv::Scalar& get(GOCLContext &ctx, int idx)\n    {\n        return ctx.outValR(idx);\n    }\n};\ntemplate<typename U> struct ocl_get_out<cv::GArray<U> >\n{\n    static std::vector<U>& get(GOCLContext &ctx, int idx) { return ctx.outVecR<U>(idx);  }\n};\ntemplate<typename U> struct ocl_get_out<cv::GOpaque<U> >\n{\n    static U& get(GOCLContext &ctx, int idx) { return ctx.outOpaqueR<U>(idx);  }\n};\n\ntemplate<typename, typename, typename>\nstruct OCLCallHelper;\n\n// FIXME: probably can be simplified with std::apply or analogue.\ntemplate<typename Impl, typename... Ins, typename... Outs>\nstruct OCLCallHelper<Impl, std::tuple<Ins...>, std::tuple<Outs...> >\n{\n    template<typename... Inputs>\n    struct call_and_postprocess\n    {\n        template<typename... Outputs>\n        static void call(Inputs&&... ins, Outputs&&... outs)\n        {\n            //not using a std::forward on outs is deliberate in order to\n            //cause compilation error, by trying to bind rvalue references to lvalue references\n            Impl::run(std::forward<Inputs>(ins)..., outs...);\n\n            postprocess_ocl(outs...);\n        }\n    };\n\n    template<int... IIs, int... OIs>\n    static void call_impl(GOCLContext &ctx, detail::Seq<IIs...>, detail::Seq<OIs...>)\n    {\n        //TODO: Make sure that OpenCV kernels do not reallocate memory for output parameters\n        //by comparing it's state (data ptr) before and after the call.\n        //Convert own::Scalar to cv::Scalar before call kernel and run kernel\n        //convert cv::Scalar to own::Scalar after call kernel and write back results\n        call_and_postprocess<decltype(ocl_get_in<Ins>::get(ctx, IIs))...>::call(ocl_get_in<Ins>::get(ctx, IIs)..., ocl_get_out<Outs>::get(ctx, OIs)...);\n    }\n\n    static void call(GOCLContext &ctx)\n    {\n        call_impl(ctx,\n            typename detail::MkSeq<sizeof...(Ins)>::type(),\n            typename detail::MkSeq<sizeof...(Outs)>::type());\n    }\n};\n\n} // namespace detail\n\ntemplate<class Impl, class K>\nclass GOCLKernelImpl: public cv::detail::OCLCallHelper<Impl, typename K::InArgs, typename K::OutArgs>,\n                      public cv::detail::KernelTag\n{\n    using P = detail::OCLCallHelper<Impl, typename K::InArgs, typename K::OutArgs>;\n\npublic:\n    using API = K;\n\n    static cv::gapi::GBackend backend()  { return cv::gapi::ocl::backend(); }\n    static cv::GOCLKernel     kernel()   { return GOCLKernel(&P::call);     }\n};\n\n#define GAPI_OCL_KERNEL(Name, API) struct Name: public cv::GOCLKernelImpl<Name, API>\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GOCLKERNEL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/ocl/imgproc.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_OCL_IMGPROC_API_HPP\n#define OPENCV_GAPI_OCL_IMGPROC_API_HPP\n\n#include <opencv2/core/cvdef.h>     // GAPI_EXPORTS\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n\nnamespace cv {\nnamespace gapi {\nnamespace imgproc {\nnamespace ocl {\n\n    GAPI_EXPORTS GKernelPackage kernels();\n\n} // namespace ocl\n} // namespace imgproc\n} // namespace gapi\n} // namespace cv\n\n\n#endif // OPENCV_GAPI_OCL_IMGPROC_API_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/opencv_includes.hpp",
    "content": "// This file is part of OpenCV project.\n\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_OPENCV_INCLUDES_HPP\n#define OPENCV_GAPI_OPENCV_INCLUDES_HPP\n\n#if !defined(GAPI_STANDALONE)\n#  include <opencv2/core/mat.hpp>\n#  include <opencv2/core/cvdef.h>\n#  include <opencv2/core/types.hpp>\n#  include <opencv2/core/base.hpp>\n#else   // Without OpenCV\n#  include <opencv2/gapi/own/cvdefs.hpp>\n#  include <opencv2/gapi/own/types.hpp>  // cv::gapi::own::Rect/Size/Point\n#  include <opencv2/gapi/own/scalar.hpp> // cv::gapi::own::Scalar\n#  include <opencv2/gapi/own/mat.hpp>\n// replacement of cv's structures:\nnamespace cv {\n    using Rect    = gapi::own::Rect;\n    using Size    = gapi::own::Size;\n    using Point   = gapi::own::Point;\n    using Point2f = gapi::own::Point2f;\n    using Scalar  = gapi::own::Scalar;\n    using Mat     = gapi::own::Mat;\n}  // namespace cv\n#endif // !defined(GAPI_STANDALONE)\n\n#endif // OPENCV_GAPI_OPENCV_INCLUDES_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/operators.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_OPERATORS_HPP\n#define OPENCV_GAPI_OPERATORS_HPP\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/gscalar.hpp>\n\nnamespace cv\n{\nGAPI_EXPORTS cv::GMat operator+(const cv::GMat&    lhs, const cv::GMat&    rhs);\n\nGAPI_EXPORTS cv::GMat operator+(const cv::GMat&    lhs, const cv::GScalar& rhs);\nGAPI_EXPORTS cv::GMat operator+(const cv::GScalar& lhs, const cv::GMat&    rhs);\n\nGAPI_EXPORTS cv::GMat operator-(const cv::GMat&    lhs, const cv::GMat&    rhs);\n\nGAPI_EXPORTS cv::GMat operator-(const cv::GMat&    lhs, const cv::GScalar& rhs);\nGAPI_EXPORTS cv::GMat operator-(const cv::GScalar& lhs, const cv::GMat&    rhs);\n\nGAPI_EXPORTS cv::GMat operator*(const cv::GMat&    lhs, float              rhs);\nGAPI_EXPORTS cv::GMat operator*(float              lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator*(const cv::GMat&    lhs, const cv::GScalar& rhs);\nGAPI_EXPORTS cv::GMat operator*(const cv::GScalar& lhs, const cv::GMat&    rhs);\n\nGAPI_EXPORTS cv::GMat operator/(const cv::GMat&    lhs, const cv::GScalar& rhs);\nGAPI_EXPORTS cv::GMat operator/(const cv::GScalar& lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator/(const cv::GMat&    lhs, const cv::GMat&    rhs);\n\nGAPI_EXPORTS cv::GMat operator&(const cv::GMat&    lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator|(const cv::GMat&    lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator^(const cv::GMat&    lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator~(const cv::GMat&    lhs);\n\nGAPI_EXPORTS cv::GMat operator&(const cv::GScalar& lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator|(const cv::GScalar& lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator^(const cv::GScalar& lhs, const cv::GMat&    rhs);\n\nGAPI_EXPORTS cv::GMat operator&(const cv::GMat& lhs, const cv::GScalar&    rhs);\nGAPI_EXPORTS cv::GMat operator|(const cv::GMat& lhs, const cv::GScalar&    rhs);\nGAPI_EXPORTS cv::GMat operator^(const cv::GMat& lhs, const cv::GScalar&    rhs);\n\nGAPI_EXPORTS cv::GMat operator>(const cv::GMat&    lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator>=(const cv::GMat&   lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator<(const cv::GMat&    lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator<=(const cv::GMat&   lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator==(const cv::GMat&   lhs, const cv::GMat&    rhs);\nGAPI_EXPORTS cv::GMat operator!=(const cv::GMat&   lhs, const cv::GMat&    rhs);\n\nGAPI_EXPORTS cv::GMat operator>(const cv::GMat&    lhs, const cv::GScalar& rhs);\nGAPI_EXPORTS cv::GMat operator>=(const cv::GMat&   lhs, const cv::GScalar& rhs);\nGAPI_EXPORTS cv::GMat operator<(const cv::GMat&    lhs, const cv::GScalar& rhs);\nGAPI_EXPORTS cv::GMat operator<=(const cv::GMat&   lhs, const cv::GScalar& rhs);\nGAPI_EXPORTS cv::GMat operator==(const cv::GMat&   lhs, const cv::GScalar& rhs);\nGAPI_EXPORTS cv::GMat operator!=(const cv::GMat&   lhs, const cv::GScalar& rhs);\n\nGAPI_EXPORTS cv::GMat operator>(const cv::GScalar&    lhs, const cv::GMat& rhs);\nGAPI_EXPORTS cv::GMat operator>=(const cv::GScalar&   lhs, const cv::GMat& rhs);\nGAPI_EXPORTS cv::GMat operator<(const cv::GScalar&    lhs, const cv::GMat& rhs);\nGAPI_EXPORTS cv::GMat operator<=(const cv::GScalar&   lhs, const cv::GMat& rhs);\nGAPI_EXPORTS cv::GMat operator==(const cv::GScalar&   lhs, const cv::GMat& rhs);\nGAPI_EXPORTS cv::GMat operator!=(const cv::GScalar&   lhs, const cv::GMat& rhs);\n} // cv\n\n#endif // OPENCV_GAPI_OPERATORS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/own/assert.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_OWN_ASSERT_HPP\n#define OPENCV_GAPI_OWN_ASSERT_HPP\n\n#include <opencv2/gapi/util/compiler_hints.hpp>\n\n#define GAPI_DbgAssertNoOp(expr) {                  \\\n    constexpr bool _assert_tmp = false && (expr);   \\\n    cv::util::suppress_unused_warning(_assert_tmp); \\\n}\n\n#if !defined(GAPI_STANDALONE)\n#include <opencv2/core/base.hpp>\n#define GAPI_Assert CV_Assert\n\n#if defined _DEBUG || defined CV_STATIC_ANALYSIS\n#  define GAPI_DbgAssert CV_DbgAssert\n#else\n#  define GAPI_DbgAssert(expr) GAPI_DbgAssertNoOp(expr)\n#endif\n\n#else\n#include <stdexcept>\n#include <sstream>\n#include <opencv2/gapi/util/throw.hpp>\n\nnamespace detail\n{\n    [[noreturn]] inline void assert_abort(const char* str, int line, const char* file, const char* func)\n    {\n        std::stringstream ss;\n        ss << file << \":\" << line << \": Assertion \" << str << \" in function \" << func << \" failed\\n\";\n        cv::util::throw_error(std::logic_error(ss.str()));\n    }\n}\n\n#define GAPI_Assert(expr) \\\n{ if (!(expr)) ::detail::assert_abort(#expr, __LINE__, __FILE__, __func__); }\n\n\n#ifdef NDEBUG\n#  define GAPI_DbgAssert(expr) GAPI_DbgAssertNoOp(expr)\n#else\n#  define GAPI_DbgAssert(expr) GAPI_Assert(expr)\n#endif\n\n#endif // GAPI_STANDALONE\n\n#endif // OPENCV_GAPI_OWN_ASSERT_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/own/convert.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_OWN_CONVERT_HPP\n#define OPENCV_GAPI_OWN_CONVERT_HPP\n\n#if !defined(GAPI_STANDALONE)\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/own/mat.hpp>\n\nnamespace cv\n{\n    template<typename T>\n    std::vector<T> to_own(const cv::MatSize &sz) {\n        std::vector<T> result(sz.dims());\n        for (int i = 0; i < sz.dims(); i++) {\n            // Note: cv::MatSize is not iterable\n            result[i] = static_cast<T>(sz[i]);\n        }\n        return result;\n    }\n\n    cv::gapi::own::Mat to_own(Mat&&) = delete;\n\n    inline cv::gapi::own::Mat to_own(Mat const& m) {\n        return (m.dims == 2)\n            ?  cv::gapi::own::Mat{m.rows, m.cols, m.type(), m.data, m.step}\n            :  cv::gapi::own::Mat{to_own<int>(m.size), m.type(), m.data};\n    };\n\nnamespace gapi\n{\nnamespace own\n{\n\n    inline cv::Mat to_ocv(Mat const& m) {\n        return m.dims.empty()\n            ? cv::Mat{m.rows, m.cols, m.type(), m.data, m.step}\n            : cv::Mat{m.dims, m.type(), m.data};\n    }\n\n    cv::Mat to_ocv(Mat&&) = delete;\n\n} // namespace own\n} // namespace gapi\n} // namespace cv\n\n#endif // !defined(GAPI_STANDALONE)\n\n#endif // OPENCV_GAPI_OWN_CONVERT_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/own/cvdefs.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_CV_DEFS_HPP\n#define OPENCV_GAPI_CV_DEFS_HPP\n\n#if defined(GAPI_STANDALONE)\n// Simulate OpenCV definitions taken from various\n// OpenCV interface headers if G-API is built in a\n// standalone mode.\n\n// interface.h:\n\ntypedef unsigned char uchar;\ntypedef          char schar;\n\ntypedef unsigned short ushort;\n\n#define CV_CN_MAX     512\n#define CV_CN_SHIFT   3\n#define CV_DEPTH_MAX  (1 << CV_CN_SHIFT)\n\n\n#define CV_8U   0\n#define CV_8S   1\n#define CV_16U  2\n#define CV_16S  3\n#define CV_32S  4\n#define CV_32F  5\n#define CV_64F  6\n#define CV_USRTYPE1 7\n\n#define CV_MAT_DEPTH_MASK       (CV_DEPTH_MAX - 1)\n#define CV_MAT_DEPTH(flags)     ((flags) & CV_MAT_DEPTH_MASK)\n\n#define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))\n#define CV_MAKE_TYPE CV_MAKETYPE\n\n#define CV_8UC1 CV_MAKETYPE(CV_8U,1)\n#define CV_8UC2 CV_MAKETYPE(CV_8U,2)\n#define CV_8UC3 CV_MAKETYPE(CV_8U,3)\n#define CV_8UC4 CV_MAKETYPE(CV_8U,4)\n#define CV_8UC(n) CV_MAKETYPE(CV_8U,(n))\n\n#define CV_8SC1 CV_MAKETYPE(CV_8S,1)\n#define CV_8SC2 CV_MAKETYPE(CV_8S,2)\n#define CV_8SC3 CV_MAKETYPE(CV_8S,3)\n#define CV_8SC4 CV_MAKETYPE(CV_8S,4)\n#define CV_8SC(n) CV_MAKETYPE(CV_8S,(n))\n\n#define CV_16UC1 CV_MAKETYPE(CV_16U,1)\n#define CV_16UC2 CV_MAKETYPE(CV_16U,2)\n#define CV_16UC3 CV_MAKETYPE(CV_16U,3)\n#define CV_16UC4 CV_MAKETYPE(CV_16U,4)\n#define CV_16UC(n) CV_MAKETYPE(CV_16U,(n))\n\n#define CV_16SC1 CV_MAKETYPE(CV_16S,1)\n#define CV_16SC2 CV_MAKETYPE(CV_16S,2)\n#define CV_16SC3 CV_MAKETYPE(CV_16S,3)\n#define CV_16SC4 CV_MAKETYPE(CV_16S,4)\n#define CV_16SC(n) CV_MAKETYPE(CV_16S,(n))\n\n#define CV_32SC1 CV_MAKETYPE(CV_32S,1)\n#define CV_32SC2 CV_MAKETYPE(CV_32S,2)\n#define CV_32SC3 CV_MAKETYPE(CV_32S,3)\n#define CV_32SC4 CV_MAKETYPE(CV_32S,4)\n#define CV_32SC(n) CV_MAKETYPE(CV_32S,(n))\n\n#define CV_32FC1 CV_MAKETYPE(CV_32F,1)\n#define CV_32FC2 CV_MAKETYPE(CV_32F,2)\n#define CV_32FC3 CV_MAKETYPE(CV_32F,3)\n#define CV_32FC4 CV_MAKETYPE(CV_32F,4)\n#define CV_32FC(n) CV_MAKETYPE(CV_32F,(n))\n\n#define CV_64FC1 CV_MAKETYPE(CV_64F,1)\n#define CV_64FC2 CV_MAKETYPE(CV_64F,2)\n#define CV_64FC3 CV_MAKETYPE(CV_64F,3)\n#define CV_64FC4 CV_MAKETYPE(CV_64F,4)\n#define CV_64FC(n) CV_MAKETYPE(CV_64F,(n))\n\n// cvdef.h:\n\n#define CV_MAT_CN_MASK          ((CV_CN_MAX - 1) << CV_CN_SHIFT)\n#define CV_MAT_CN(flags)        ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)\n#define CV_MAT_TYPE_MASK        (CV_DEPTH_MAX*CV_CN_MAX - 1)\n#define CV_MAT_TYPE(flags)      ((flags) & CV_MAT_TYPE_MASK)\n#define CV_MAT_CONT_FLAG_SHIFT  14\n#define CV_MAT_CONT_FLAG        (1 << CV_MAT_CONT_FLAG_SHIFT)\n#define CV_IS_MAT_CONT(flags)   ((flags) & CV_MAT_CONT_FLAG)\n#define CV_IS_CONT_MAT          CV_IS_MAT_CONT\n#define CV_SUBMAT_FLAG_SHIFT    15\n#define CV_SUBMAT_FLAG          (1 << CV_SUBMAT_FLAG_SHIFT)\n#define CV_IS_SUBMAT(flags)     ((flags) & CV_MAT_SUBMAT_FLAG)\n\n///** Size of each channel item,\n//   0x8442211 = 1000 0100 0100 0010 0010 0001 0001 ~ array of sizeof(arr_type_elem) */\n//#define CV_ELEM_SIZE1(type) \\\n//    ((((sizeof(size_t)<<28)|0x8442211) >> CV_MAT_DEPTH(type)*4) & 15)\n\n#define CV_MAT_TYPE(flags)      ((flags) & CV_MAT_TYPE_MASK)\n\n/** 0x3a50 = 11 10 10 01 01 00 00 ~ array of log2(sizeof(arr_type_elem)) */\n#define CV_ELEM_SIZE(type) \\\n    (CV_MAT_CN(type) << ((((sizeof(size_t)/4+1)*16384|0x3a50) >> CV_MAT_DEPTH(type)*2) & 3))\n\n#ifndef CV_OVERRIDE\n#  define CV_OVERRIDE override\n#endif\n\n// base.h:\nnamespace cv\n{\nenum BorderTypes {\n    BORDER_CONSTANT    = 0, //!< `iiiiii|abcdefgh|iiiiiii`  with some specified `i`\n    BORDER_REPLICATE   = 1, //!< `aaaaaa|abcdefgh|hhhhhhh`\n    BORDER_REFLECT     = 2, //!< `fedcba|abcdefgh|hgfedcb`\n    BORDER_WRAP        = 3, //!< `cdefgh|abcdefgh|abcdefg`\n    BORDER_REFLECT_101 = 4, //!< `gfedcb|abcdefgh|gfedcba`\n    BORDER_TRANSPARENT = 5, //!< `uvwxyz|abcdefgh|ijklmno`\n\n    BORDER_REFLECT101  = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101\n    BORDER_DEFAULT     = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101\n    BORDER_ISOLATED    = 16 //!< do not look outside of ROI\n};\n// imgproc.hpp:\nenum InterpolationFlags{\n    INTER_NEAREST        = 0,\n    INTER_LINEAR         = 1,\n    INTER_CUBIC          = 2,\n    INTER_AREA           = 3,\n    INTER_LANCZOS4       = 4,\n    INTER_LINEAR_EXACT   = 5,\n    INTER_MAX            = 7,\n};\n} // namespace cv\n\nstatic inline int cvFloor( double value )\n{\n    int i = (int)value;\n    return i - (i > value);\n}\n\n#endif //  defined(GAPI_STANDALONE)\n\n#endif //  OPENCV_GAPI_CV_DEFS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/own/exports.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_OWN_TYPES_HPP\n#define OPENCV_GAPI_OWN_TYPES_HPP\n\n#   if defined(__OPENCV_BUILD)\n#       include <opencv2/core/base.hpp>\n#       define GAPI_EXPORTS CV_EXPORTS\n        /* special informative macros for wrapper generators */\n#       define GAPI_PROP CV_PROP\n#       define GAPI_PROP_RW CV_PROP_RW\n#       define GAPI_WRAP CV_WRAP\n#       define GAPI_EXPORTS_W_SIMPLE CV_EXPORTS_W_SIMPLE\n#       define GAPI_EXPORTS_W CV_EXPORTS_W\n#   else\n#       define GAPI_PROP\n#       define GAPI_PROP_RW\n#       define GAPI_WRAP\n#       define GAPI_EXPORTS\n#       define GAPI_EXPORTS_W_SIMPLE\n#       define GAPI_EXPORTS_W\n\n#if 0  // Note: the following version currently is not needed for non-OpenCV build\n#       if defined _WIN32\n#           define GAPI_EXPORTS __declspec(dllexport)\n#       elif defined __GNUC__ && __GNUC__ >= 4\n#           define GAPI_EXPORTS __attribute__ ((visibility (\"default\")))\n#       endif\n\n#       ifndef GAPI_EXPORTS\n#           define GAPI_EXPORTS\n#       endif\n#endif\n\n#   endif\n\n#endif // OPENCV_GAPI_OWN_TYPES_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/own/mat.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_OWN_MAT_HPP\n#define OPENCV_GAPI_OWN_MAT_HPP\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/own/types.hpp>\n#include <opencv2/gapi/own/scalar.hpp>\n#include <opencv2/gapi/own/saturate.hpp>\n#include <opencv2/gapi/own/assert.hpp>\n\n#include <memory>                   //std::shared_ptr\n#include <cstring>                  //std::memcpy\n#include <numeric>                  //std::accumulate\n#include <vector>\n#include <opencv2/gapi/util/throw.hpp>\n\nnamespace cv { namespace gapi { namespace own {\n    namespace detail {\n        template <typename T, unsigned char channels>\n        void assign_row(void* ptr, int cols, Scalar const& s)\n        {\n            auto p = static_cast<T*>(ptr);\n            for (int c = 0; c < cols; c++)\n            {\n                for (int ch = 0; ch < channels; ch++)\n                {\n                    p[c * channels + ch] = saturate<T>(s[ch], roundd);\n                }\n            }\n        }\n\n        inline size_t default_step(int type, int cols)\n        {\n            return CV_ELEM_SIZE(type) * cols;\n        }\n        //Matrix header, i.e. fields that are unique to each Mat object.\n        //Devoted class is needed to implement custom behavior on move (erasing state of moved from object)\n        struct MatHeader{\n            enum { AUTO_STEP = 0};\n            enum { TYPE_MASK = 0x00000FFF  };\n\n            MatHeader() = default;\n\n            MatHeader(int _rows, int _cols, int type, void* _data, size_t _step)\n            : flags((type & TYPE_MASK)), rows(_rows), cols(_cols), data((uchar*)_data), step(_step == AUTO_STEP ? detail::default_step(type, _cols) : _step)\n            {}\n\n            MatHeader(const std::vector<int> &_dims, int type, void* _data)\n            : flags((type & TYPE_MASK)), data((uchar*)_data), step(0), dims(_dims)\n            {}\n\n            MatHeader(const MatHeader& ) = default;\n            MatHeader(MatHeader&& src) : MatHeader(src) // reuse copy constructor here\n            {\n                MatHeader empty; //give it a name to call copy(not move) assignment below\n                src = empty;\n            }\n            MatHeader& operator=(const MatHeader& ) = default;\n            MatHeader& operator=(MatHeader&& src)\n            {\n                *this = src; //calling a copy assignment here, not move one\n                MatHeader empty; //give it a name to call copy(not move) assignment below\n                src = empty;\n                return *this;\n            }\n            /*! includes several bit-fields:\n                 - depth\n                 - number of channels\n             */\n            int flags = 0;\n\n            //! the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions\n            int rows = 0, cols = 0;\n            //! pointer to the data\n            uchar* data = nullptr;\n            size_t step = 0;\n            //! dimensions (ND-case)\n            std::vector<int> dims;\n        };\n    } // namespace detail\n    //concise version of cv::Mat suitable for GAPI needs (used when no dependence on OpenCV is required)\n    class Mat : public detail::MatHeader{\n    public:\n\n        Mat() = default;\n\n        /** @overload\n        @param _rows Number of rows in a 2D array.\n        @param _cols Number of columns in a 2D array.\n        @param _type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or\n        CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.\n        @param _data Pointer to the user data. Matrix constructors that take data and step parameters do not\n        allocate matrix data. Instead, they just initialize the matrix header that points to the specified\n        data, which means that no data is copied. This operation is very efficient and can be used to\n        process external data using OpenCV functions. The external data is not automatically deallocated, so\n        you should take care of it.\n        @param _step Number of bytes each matrix row occupies. The value should include the padding bytes at\n        the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed\n        and the actual step is calculated as cols*elemSize(). See Mat::elemSize.\n        */\n        Mat(int _rows, int _cols, int _type, void* _data, size_t _step = AUTO_STEP)\n        : MatHeader (_rows, _cols, _type, _data, _step)\n        {}\n\n        Mat(const std::vector<int> &_dims, int _type, void* _data)\n        : MatHeader (_dims, _type, _data)\n        {}\n\n        Mat(std::vector<int> &&_dims, int _type, void* _data)\n        : MatHeader (std::move(_dims), _type, _data)\n        {}\n\n        Mat(Mat const& src, const Rect& roi )\n        : Mat(src)\n        {\n           rows = roi.height;\n           cols = roi.width;\n           data = ptr(roi.y, roi.x);\n        }\n\n        Mat(Mat const& ) = default;\n        Mat(Mat&& ) = default;\n\n        Mat& operator=(Mat const& ) = default;\n        Mat& operator=(Mat&& ) = default;\n\n        /** @brief Sets all or some of the array elements to the specified value.\n        @param s Assigned scalar converted to the actual array type.\n        */\n        Mat& operator = (const Scalar& s)\n        {\n            constexpr unsigned max_channels = 4; //Scalar can't fit more than 4\n            using func_p_t = void (*)(void*, int, Scalar const&);\n            using detail::assign_row;\n            #define TABLE_ENTRY(type)  {assign_row<type, 1>, assign_row<type, 2>, assign_row<type, 3>, assign_row<type, 4>}\n            static constexpr func_p_t func_tbl[][max_channels] = {\n                    TABLE_ENTRY(uchar),\n                    TABLE_ENTRY(schar),\n                    TABLE_ENTRY(ushort),\n                    TABLE_ENTRY(short),\n                    TABLE_ENTRY(int),\n                    TABLE_ENTRY(float),\n                    TABLE_ENTRY(double)\n            };\n            #undef TABLE_ENTRY\n\n            static_assert(CV_8U == 0 && CV_8S == 1  && CV_16U == 2 && CV_16S == 3\n                       && CV_32S == 4 && CV_32F == 5 && CV_64F == 6,\n                       \"OCV type ids used as indexes to array, thus exact numbers are important!\"\n            );\n\n            const auto depth = static_cast<unsigned int>(this->depth());\n            GAPI_Assert(depth < sizeof(func_tbl)/sizeof(func_tbl[0]));\n\n            if (dims.empty())\n            {\n                const auto channels = static_cast<unsigned int>(this->channels());\n                GAPI_Assert(channels <= max_channels);\n\n                auto* f = func_tbl[depth][channels - 1];\n                for (int r = 0; r < rows; ++r)\n                {\n                    (*f)(static_cast<void *>(ptr(r)), cols, s );\n                }\n            }\n            else\n            {\n                auto* f = func_tbl[depth][0];\n                // FIXME: better to refactor assign_row to use std::size_t by default\n                (*f)(static_cast<void *>(data), static_cast<int>(total()), s);\n            }\n            return *this;\n        }\n\n        /** @brief Returns the matrix element size in bytes.\n\n        The method returns the matrix element size in bytes. For example, if the matrix type is CV_16SC3 ,\n        the method returns 3\\*sizeof(short) or 6.\n         */\n        size_t elemSize() const\n        {\n            return CV_ELEM_SIZE(type());\n        }\n        /** @brief Returns the type of a matrix element.\n\n        The method returns a matrix element type. This is an identifier compatible with the CvMat type\n        system, like CV_16SC3 or 16-bit signed 3-channel array, and so on.\n         */\n        int type() const            {return CV_MAT_TYPE(flags);}\n\n        /** @brief Returns the depth of a matrix element.\n\n        The method returns the identifier of the matrix element depth (the type of each individual channel).\n        For example, for a 16-bit signed element array, the method returns CV_16S . A complete list of\n        matrix types contains the following values:\n        -   CV_8U - 8-bit unsigned integers ( 0..255 )\n        -   CV_8S - 8-bit signed integers ( -128..127 )\n        -   CV_16U - 16-bit unsigned integers ( 0..65535 )\n        -   CV_16S - 16-bit signed integers ( -32768..32767 )\n        -   CV_32S - 32-bit signed integers ( -2147483648..2147483647 )\n        -   CV_32F - 32-bit floating-point numbers ( -FLT_MAX..FLT_MAX, INF, NAN )\n        -   CV_64F - 64-bit floating-point numbers ( -DBL_MAX..DBL_MAX, INF, NAN )\n         */\n        int depth() const           {return CV_MAT_DEPTH(flags);}\n\n        /** @brief Returns the number of matrix channels.\n\n        The method returns the number of matrix channels.\n        If matrix is N-dimensional, -1 is returned.\n         */\n        int channels() const        {return dims.empty() ? CV_MAT_CN(flags) : -1;}\n\n        /**\n        @param _rows New number of rows.\n        @param _cols New number of columns.\n        @param _type New matrix type.\n         */\n        void create(int _rows, int _cols, int _type)\n        {\n            create(Size{_cols, _rows}, _type);\n        }\n        /** @overload\n        @param _size Alternative new matrix size specification: Size(cols, rows)\n        @param _type New matrix type.\n        */\n        void create(Size _size, int _type)\n        {\n            GAPI_Assert(_size.height >= 0 && _size.width >= 0);\n            if (_size != Size{cols, rows} )\n            {\n                Mat tmp{_size.height, _size.width, _type, nullptr};\n                tmp.memory.reset(new uchar[ tmp.step * tmp.rows], [](uchar * p){delete[] p;});\n                tmp.data = tmp.memory.get();\n\n                *this = std::move(tmp);\n            }\n        }\n\n        void create(const std::vector<int> &_dims, int _type)\n        {\n            // FIXME: make a proper reallocation-on-demands\n            // WARNING: no tensor views, so no strides\n            Mat tmp{_dims, _type, nullptr};\n            // FIXME: this accumulate duplicates a lot\n            const auto sz = std::accumulate(_dims.begin(), _dims.end(), 1, std::multiplies<int>());\n            tmp.memory.reset(new uchar[CV_ELEM_SIZE(_type)*sz], [](uchar * p){delete[] p;});\n            tmp.data = tmp.memory.get();\n            *this = std::move(tmp);\n        }\n\n        /** @brief Creates a full copy of the matrix and the underlying data.\n\n        The method creates a full copy of the matrix. The original step[] is not taken into account.\n        So, the copy has a continuous buffer occupying total() * elemSize() bytes.\n         */\n        Mat clone() const\n        {\n            Mat m;\n            copyTo(m);\n            return m;\n        }\n\n        /** @brief Copies the matrix to another one.\n\n        The method copies the matrix data to another matrix. Before copying the data, the method invokes :\n        @code\n            m.create(this->size(), this->type());\n        @endcode\n        so that the destination matrix is reallocated if needed. While m.copyTo(m); works flawlessly, the\n        function does not handle the case of a partial overlap between the source and the destination\n        matrices.\n         */\n        void copyTo(Mat& dst) const\n        {\n            if (dims.empty())\n            {\n                dst.create(rows, cols, type());\n                for (int r = 0; r < rows; ++r)\n                {\n                    std::copy_n(ptr(r), detail::default_step(type(),cols), dst.ptr(r));\n                }\n            }\n            else\n            {\n                dst.create(dims, depth());\n                std::copy_n(data, total()*elemSize(), data);\n            }\n        }\n\n        /** @brief Returns true if the array has no elements.\n\n        The method returns true if Mat::total() is 0 or if Mat::data is NULL. Because of pop_back() and\n        resize() methods `M.total() == 0` does not imply that `M.data == NULL`.\n         */\n        bool empty() const\n        {\n            return data == 0 || total() == 0;\n        }\n\n        /** @brief Returns the total number of array elements.\n\n        The method returns the number of array elements (a number of pixels if the array represents an\n        image).\n         */\n        size_t total() const\n        {\n            return dims.empty()\n                 ? (static_cast<std::size_t>(rows) * cols)\n                 : std::accumulate(dims.begin(), dims.end(), static_cast<std::size_t>(1), std::multiplies<size_t>());\n        }\n\n        /** @overload\n        @param roi Extracted submatrix specified as a rectangle.\n        */\n        Mat operator()( const Rect& roi ) const\n        {\n            return Mat{*this, roi};\n        }\n\n\n        /** @brief Returns a pointer to the specified matrix row.\n\n        The methods return `uchar*` or typed pointer to the specified matrix row. See the sample in\n        Mat::isContinuous to know how to use these methods.\n        @param row Index along the dimension 0\n        @param col Index along the dimension 1\n        */\n        uchar* ptr(int row, int col = 0)\n        {\n            return const_cast<uchar*>(const_cast<const Mat*>(this)->ptr(row,col));\n        }\n        /** @overload */\n        const uchar* ptr(int row, int col = 0) const\n        {\n            return data + step * row + CV_ELEM_SIZE(type()) * col;\n        }\n\n\n    private:\n        //actual memory allocated for storage, or nullptr if object is non owning view to over memory\n        std::shared_ptr<uchar> memory;\n    };\n\n} //namespace own\n} //namespace gapi\n} //namespace cv\n\n#endif /* OPENCV_GAPI_OWN_MAT_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/own/saturate.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_OWN_SATURATE_HPP\n#define OPENCV_GAPI_OWN_SATURATE_HPP\n\n#include <math.h>\n\n#include <limits>\n#include <type_traits>\n\n#include <opencv2/gapi/own/assert.hpp>\n\nnamespace cv { namespace gapi { namespace own {\n//-----------------------------\n//\n// Numeric cast with saturation\n//\n//-----------------------------\n\ntemplate<typename DST, typename SRC>\nstatic inline DST saturate(SRC x)\n{\n    // only integral types please!\n    GAPI_DbgAssert(std::is_integral<DST>::value &&\n                   std::is_integral<SRC>::value);\n\n    if (std::is_same<DST, SRC>::value)\n        return static_cast<DST>(x);\n\n    if (sizeof(DST) > sizeof(SRC))\n        return static_cast<DST>(x);\n\n    // compiler must recognize this saturation,\n    // so compile saturate<s16>(a + b) with adds\n    // instruction (e.g.: _mm_adds_epi16 if x86)\n    return x < std::numeric_limits<DST>::min()?\n               std::numeric_limits<DST>::min():\n           x > std::numeric_limits<DST>::max()?\n               std::numeric_limits<DST>::max():\n           static_cast<DST>(x);\n}\n\n// Note, that OpenCV rounds differently:\n// - like std::round() for add, subtract\n// - like std::rint() for multiply, divide\ntemplate<typename DST, typename SRC, typename R>\nstatic inline DST saturate(SRC x, R round)\n{\n    if (std::is_floating_point<DST>::value)\n    {\n        return static_cast<DST>(x);\n    }\n    else if (std::is_integral<SRC>::value)\n    {\n        GAPI_DbgAssert(std::is_integral<DST>::value &&\n                       std::is_integral<SRC>::value);\n        return saturate<DST>(x);\n    }\n    else\n    {\n        GAPI_DbgAssert(std::is_integral<DST>::value &&\n                 std::is_floating_point<SRC>::value);\n#ifdef _WIN32\n// Suppress warning about converting x to floating-point\n// Note that x is already floating-point at this point\n#pragma warning(disable: 4244)\n#endif\n        int ix = static_cast<int>(round(x));\n#ifdef _WIN32\n#pragma warning(default: 4244)\n#endif\n        return saturate<DST>(ix);\n    }\n}\n\n// explicit suffix 'd' for double type\ninline double  ceild(double x) { return ceil(x); }\ninline double floord(double x) { return floor(x); }\ninline double roundd(double x) { return round(x); }\ninline double  rintd(double x) { return rint(x); }\n\n} //namespace own\n} //namespace gapi\n} //namespace cv\n#endif /* OPENCV_GAPI_OWN_SATURATE_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/own/scalar.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GAPI_OWN_SCALAR_HPP\n#define OPENCV_GAPI_GAPI_OWN_SCALAR_HPP\n\n#include <opencv2/gapi/own/exports.hpp>\n\nnamespace cv\n{\nnamespace gapi\n{\nnamespace own\n{\n\nclass GAPI_EXPORTS Scalar\n{\npublic:\n    Scalar() = default;\n    explicit Scalar(double v0) { val[0] = v0; };\n    Scalar(double v0, double v1, double v2 = 0, double v3 = 0)\n        : val{v0, v1, v2, v3}\n    {\n    }\n\n    const double& operator[](int i) const { return val[i]; }\n          double& operator[](int i)       { return val[i]; }\n\n    static Scalar all(double v0) { return Scalar(v0, v0, v0, v0); }\n\n    double val[4] = {0};\n};\n\ninline bool operator==(const Scalar& lhs, const Scalar& rhs)\n{\n    return std::equal(std::begin(lhs.val), std::end(lhs.val), std::begin(rhs.val));\n}\n\n} // namespace own\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_GAPI_OWN_SCALAR_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/own/types.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_TYPES_HPP\n#define OPENCV_GAPI_TYPES_HPP\n\n#include <algorithm>              // std::max, std::min\n#include <ostream>\n\nnamespace cv\n{\nnamespace gapi\n{\n\n/**\n * @brief This namespace contains G-API own data structures used in\n * its standalone mode build.\n */\nnamespace own\n{\n\nclass Point\n{\npublic:\n    Point() = default;\n    Point(int _x, int _y) : x(_x),  y(_y)  {};\n\n    int x = 0;\n    int y = 0;\n};\n\nclass Point2f\n{\npublic:\n    Point2f() = default;\n    Point2f(float _x, float _y) : x(_x),  y(_y)  {};\n\n    float x = 0.f;\n    float y = 0.f;\n};\n\nclass Rect\n{\npublic:\n    Rect() = default;\n    Rect(int _x, int _y, int _width, int _height) : x(_x), y(_y),   width(_width),  height(_height)  {};\n#if !defined(GAPI_STANDALONE)\n    Rect(const cv::Rect& other) : x(other.x), y(other.y), width(other.width), height(other.height) {};\n    inline Rect& operator=(const cv::Rect& other)\n    {\n        x = other.x;\n        y = other.x;\n        width  = other.width;\n        height = other.height;\n        return *this;\n    }\n#endif // !defined(GAPI_STANDALONE)\n\n    int x      = 0; //!< x coordinate of the top-left corner\n    int y      = 0; //!< y coordinate of the top-left corner\n    int width  = 0; //!< width of the rectangle\n    int height = 0; //!< height of the rectangle\n};\n\ninline bool operator==(const Rect& lhs, const Rect& rhs)\n{\n    return lhs.x == rhs.x && lhs.y == rhs.y && lhs.width == rhs.width && lhs.height == rhs.height;\n}\n\ninline bool operator!=(const Rect& lhs, const Rect& rhs)\n{\n    return !(lhs == rhs);\n}\n\ninline Rect& operator&=(Rect& lhs, const Rect& rhs)\n{\n    int x1 = std::max(lhs.x, rhs.x);\n    int y1 = std::max(lhs.y, rhs.y);\n    lhs.width  = std::min(lhs.x + lhs.width,  rhs.x + rhs.width) -  x1;\n    lhs.height = std::min(lhs.y + lhs.height, rhs.y + rhs.height) - y1;\n    lhs.x = x1;\n    lhs.y = y1;\n    if( lhs.width <= 0 || lhs.height <= 0 )\n        lhs = Rect();\n    return lhs;\n}\n\ninline const Rect operator&(const Rect& lhs, const Rect& rhs)\n{\n    Rect result = lhs;\n    return result &= rhs;\n}\n\ninline std::ostream& operator<<(std::ostream& o, const Rect& rect)\n{\n    return o << \"[\" << rect.width << \" x \" << rect.height << \" from (\" << rect.x << \", \" << rect.y << \")]\";\n}\n\nclass Size\n{\npublic:\n    Size() = default;\n    Size(int _width, int _height) : width(_width),  height(_height)  {};\n#if !defined(GAPI_STANDALONE)\n    Size(const cv::Size& other) : width(other.width), height(other.height) {};\n    inline Size& operator=(const cv::Size& rhs)\n    {\n        width  = rhs.width;\n        height = rhs.height;\n        return *this;\n    }\n#endif // !defined(GAPI_STANDALONE)\n\n    int width  = 0;\n    int height = 0;\n};\n\ninline Size& operator+=(Size& lhs, const Size& rhs)\n{\n    lhs.width  += rhs.width;\n    lhs.height += rhs.height;\n    return lhs;\n}\n\ninline bool operator==(const Size& lhs, const Size& rhs)\n{\n    return lhs.width == rhs.width && lhs.height == rhs.height;\n}\n\ninline bool operator!=(const Size& lhs, const Size& rhs)\n{\n    return !(lhs == rhs);\n}\n\n\ninline std::ostream& operator<<(std::ostream& o, const Size& s)\n{\n    o << \"[\" << s.width << \" x \" << s.height << \"]\";\n    return o;\n}\n\n} // namespace own\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_TYPES_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/plaidml/core.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_PLAIDML_CORE_HPP\n#define OPENCV_GAPI_PLAIDML_CORE_HPP\n\n#include <opencv2/gapi/gkernel.hpp>     // GKernelPackage\n#include <opencv2/gapi/own/exports.hpp> // GAPI_EXPORTS\n\nnamespace cv { namespace gapi { namespace core { namespace plaidml {\n\nGAPI_EXPORTS cv::gapi::GKernelPackage kernels();\n\n}}}}\n\n#endif // OPENCV_GAPI_PLAIDML_CORE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/plaidml/gplaidmlkernel.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n//\n\n\n#ifndef OPENCV_GAPI_GPLAIDMLKERNEL_HPP\n#define OPENCV_GAPI_GPLAIDMLKERNEL_HPP\n\n#include <opencv2/gapi/gkernel.hpp>\n#include <opencv2/gapi/garg.hpp>\n\nnamespace plaidml\n{\nnamespace edsl\n{\n    class Tensor;\n} // namespace edsl\n} // namespace plaidml\n\nnamespace cv\n{\nnamespace gapi\n{\nnamespace plaidml\n{\n\nGAPI_EXPORTS cv::gapi::GBackend backend();\n\n} // namespace plaidml\n} // namespace gapi\n\nstruct GPlaidMLContext\n{\n    // Generic accessor API\n    template<typename T>\n    const T& inArg(int input) { return m_args.at(input).get<T>(); }\n\n    // Syntax sugar\n    const plaidml::edsl::Tensor& inTensor(int input)\n    {\n        return inArg<plaidml::edsl::Tensor>(input);\n    }\n\n    plaidml::edsl::Tensor& outTensor(int output)\n    {\n        return *(m_results.at(output).get<plaidml::edsl::Tensor*>());\n    }\n\n    std::vector<GArg> m_args;\n    std::unordered_map<std::size_t, GArg> m_results;\n};\n\nclass GAPI_EXPORTS GPlaidMLKernel\n{\npublic:\n    using F = std::function<void(GPlaidMLContext &)>;\n\n    GPlaidMLKernel() = default;\n    explicit GPlaidMLKernel(const F& f) : m_f(f) {};\n\n    void apply(GPlaidMLContext &ctx) const\n    {\n        GAPI_Assert(m_f);\n        m_f(ctx);\n    }\n\nprotected:\n    F m_f;\n};\n\n\nnamespace detail\n{\n\ntemplate<class T> struct plaidml_get_in;\ntemplate<> struct plaidml_get_in<cv::GMat>\n{\n    static const plaidml::edsl::Tensor& get(GPlaidMLContext& ctx, int idx)\n    {\n        return ctx.inTensor(idx);\n    }\n};\n\ntemplate<class T> struct plaidml_get_in\n{\n    static T get(GPlaidMLContext &ctx, int idx) { return ctx.inArg<T>(idx); }\n};\n\ntemplate<class T> struct plaidml_get_out;\ntemplate<> struct plaidml_get_out<cv::GMat>\n{\n    static plaidml::edsl::Tensor& get(GPlaidMLContext& ctx, int idx)\n    {\n        return ctx.outTensor(idx);\n    }\n};\n\ntemplate<typename, typename, typename>\nstruct PlaidMLCallHelper;\n\ntemplate<typename Impl, typename... Ins, typename... Outs>\nstruct PlaidMLCallHelper<Impl, std::tuple<Ins...>, std::tuple<Outs...> >\n{\n    template<int... IIs, int... OIs>\n    static void call_impl(GPlaidMLContext &ctx, detail::Seq<IIs...>, detail::Seq<OIs...>)\n    {\n        Impl::run(plaidml_get_in<Ins>::get(ctx, IIs)..., plaidml_get_out<Outs>::get(ctx, OIs)...);\n    }\n\n    static void call(GPlaidMLContext& ctx)\n    {\n        call_impl(ctx,\n                  typename detail::MkSeq<sizeof...(Ins)>::type(),\n                  typename detail::MkSeq<sizeof...(Outs)>::type());\n    }\n};\n\n} // namespace detail\n\ntemplate<class Impl, class K>\nclass GPlaidMLKernelImpl: public cv::detail::PlaidMLCallHelper<Impl, typename K::InArgs, typename K::OutArgs>,\n                          public cv::detail::KernelTag\n{\n    using P = detail::PlaidMLCallHelper<Impl, typename K::InArgs, typename K::OutArgs>;\n\npublic:\n    using API = K;\n\n    static cv::gapi::GBackend backend()  { return cv::gapi::plaidml::backend(); }\n    static cv::GPlaidMLKernel kernel()   { return GPlaidMLKernel(&P::call);     }\n};\n\n#define GAPI_PLAIDML_KERNEL(Name, API) struct Name: public cv::GPlaidMLKernelImpl<Name, API>\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_GPLAIDMLKERNEL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/plaidml/plaidml.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_PLAIDML_PLAIDML_HPP\n#define OPENCV_GAPI_PLAIDML_PLAIDML_HPP\n\n#include <string>\n#include <opencv2/gapi/gcommon.hpp> // CompileArgTag\n\nnamespace cv\n{\nnamespace gapi\n{\n\n/**\n * @brief This namespace contains G-API PlaidML backend functions,\n * structures, and symbols.\n */\nnamespace plaidml\n{\n\n/** \\addtogroup gapi_compile_args\n * @{\n */\n/**\n * @brief This structure represents the basic parameters for the experimental\n * PlaidML backend.\n */\nstruct config\n{\n    std::string dev_id; //!< Device ID. Refer to PlaidML documentation for details.\n    std::string trg_id; //!< Target ID. Refer to PlaidML documentation for details.\n};\n/** @} gapi_compile_args */\n\n} // namespace plaidml\n} // namespace gapi\n\nnamespace detail\n{\n    template<> struct CompileArgTag<cv::gapi::plaidml::config>\n    {\n        static const char* tag() { return \"gapi.plaidml.config\"; }\n    };\n} // namespace detail\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_PLAIDML_PLAIDML_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/python/python.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2021 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_PYTHON_API_HPP\n#define OPENCV_GAPI_PYTHON_API_HPP\n\n#include <opencv2/gapi/gkernel.hpp>     // GKernelPackage\n#include <opencv2/gapi/own/exports.hpp> // GAPI_EXPORTS\n\nnamespace cv {\nnamespace gapi {\n\n/**\n * @brief This namespace contains G-API Python backend functions,\n * structures, and symbols.\n *\n * This functionality is required to enable G-API custom operations\n * and kernels when using G-API from Python, no need to use it in the\n * C++ form.\n */\nnamespace python {\n\nGAPI_EXPORTS cv::gapi::GBackend backend();\n\nstruct GPythonContext\n{\n    const cv::GArgs      &ins;\n    const cv::GMetaArgs  &in_metas;\n    const cv::GTypesInfo &out_info;\n};\n\nusing Impl = std::function<cv::GRunArgs(const GPythonContext&)>;\n\nclass GAPI_EXPORTS GPythonKernel\n{\npublic:\n    GPythonKernel() = default;\n    GPythonKernel(Impl run);\n\n    cv::GRunArgs operator()(const GPythonContext& ctx);\nprivate:\n    Impl m_run;\n};\n\nclass GAPI_EXPORTS GPythonFunctor : public cv::gapi::GFunctor\n{\npublic:\n    using Meta = cv::GKernel::M;\n\n    GPythonFunctor(const char* id, const Meta &meta, const Impl& impl);\n\n    GKernelImpl    impl()    const override;\n    gapi::GBackend backend() const override;\n\nprivate:\n    GKernelImpl impl_;\n};\n\n} // namespace python\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_PYTHON_API_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/render/render.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_RENDER_HPP\n#define OPENCV_GAPI_RENDER_HPP\n\n#include <opencv2/gapi/render/render_types.hpp>\n\n#include <opencv2/gapi.hpp>\n\n/** \\defgroup gapi_draw G-API Drawing and composition functionality\n *  @{\n *\n *  @brief Functions for in-graph drawing.\n *\n *  @note This is a Work in Progress functionality and APIs may\n *  change in the future releases.\n *\n *  G-API can do some in-graph drawing with a generic operations and a\n *  set of [rendering primitives](@ref gapi_draw_prims).\n *  In contrast with traditional OpenCV, in G-API user need to form a\n *  *rendering list* of primitives to draw. This list can be built\n *  manually or generated within a graph. This list is passed to\n *  [special operations or functions](@ref gapi_draw_api) where all\n *  primitives are interpreted and applied to the image.\n *\n *  For example, in a complex pipeline a list of detected objects\n *  can be translated in-graph to a list of cv::gapi::wip::draw::Rect\n *  primitives to highlight those with bounding boxes, or a list of\n *  detected faces can be translated in-graph to a list of\n *  cv::gapi::wip::draw::Mosaic primitives to hide sensitive content\n *  or protect privacy.\n *\n *  Like any other operations, rendering in G-API can be reimplemented\n *  by different backends. Currently only an OpenCV-based backend is\n *  available.\n *\n *  In addition to the graph-level operations, there are also regular\n *  (immediate) OpenCV-like functions are available -- see\n *  cv::gapi::wip::draw::render(). These functions are just wrappers\n *  over regular G-API and build the rendering graphs on the fly, so\n *  take compilation arguments as parameters.\n *\n *  Currently this API is more machine-oriented than human-oriented.\n *  The main purpose is to translate a set of domain-specific objects\n *  to a list of primitives to draw. For example, in order to generate\n *  a picture like this:\n *\n *  ![](modules/gapi/doc/pics/render_example.png)\n *\n *  Rendering list needs to be generated as follows:\n *\n *  @include modules/gapi/samples/draw_example.cpp\n *\n *  @defgroup gapi_draw_prims Drawing primitives\n *  @defgroup gapi_draw_api Drawing operations and functions\n *  @}\n */\n\nnamespace cv\n{\nnamespace gapi\n{\nnamespace wip\n{\nnamespace draw\n{\n\nusing GMat2     = std::tuple<cv::GMat,cv::GMat>;\nusing GMatDesc2 = std::tuple<cv::GMatDesc,cv::GMatDesc>;\n\n//! @addtogroup gapi_draw_api\n//! @{\n/** @brief The function renders on the input image passed drawing primitivies\n\n@param bgr input image: 8-bit unsigned 3-channel image @ref CV_8UC3.\n@param prims vector of drawing primitivies\n@param args graph compile time parameters\n*/\nvoid GAPI_EXPORTS_W render(cv::Mat& bgr,\n                           const Prims& prims,\n                           cv::GCompileArgs&& args = {});\n\n/** @brief The function renders on two NV12 planes passed drawing primitivies\n\n@param y_plane input image: 8-bit unsigned 1-channel image @ref CV_8UC1.\n@param uv_plane input image: 8-bit unsigned 2-channel image @ref CV_8UC2.\n@param prims vector of drawing primitivies\n@param args graph compile time parameters\n*/\nvoid GAPI_EXPORTS_W render(cv::Mat& y_plane,\n                           cv::Mat& uv_plane,\n                           const Prims& prims,\n                           cv::GCompileArgs&& args = {});\n\n/** @brief The function renders on the input media frame passed drawing primitivies\n\n@param frame input Media Frame :  @ref cv::MediaFrame.\n@param prims vector of drawing primitivies\n@param args graph compile time parameters\n*/\nvoid GAPI_EXPORTS render(cv::MediaFrame& frame,\n                         const Prims& prims,\n                         cv::GCompileArgs&& args = {});\n\n\nG_TYPED_KERNEL_M(GRenderNV12, <GMat2(cv::GMat,cv::GMat,cv::GArray<wip::draw::Prim>)>, \"org.opencv.render.nv12\")\n{\n     static GMatDesc2 outMeta(GMatDesc y_plane, GMatDesc uv_plane, GArrayDesc)\n     {\n         return std::make_tuple(y_plane, uv_plane);\n     }\n};\n\nG_TYPED_KERNEL(GRenderBGR, <cv::GMat(cv::GMat,cv::GArray<wip::draw::Prim>)>, \"org.opencv.render.bgr\")\n{\n     static GMatDesc outMeta(GMatDesc bgr, GArrayDesc)\n     {\n         return bgr;\n     }\n};\n\nG_TYPED_KERNEL(GRenderFrame, <cv::GFrame(cv::GFrame, cv::GArray<wip::draw::Prim>)>, \"org.opencv.render.frame\")\n{\n    static GFrameDesc outMeta(GFrameDesc desc, GArrayDesc)\n    {\n        return desc;\n    }\n};\n\n/** @brief Renders on 3 channels input\n\nOutput image must be 8-bit unsigned planar 3-channel image\n\n@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3\n@param prims draw primitives\n*/\nGAPI_EXPORTS_W GMat render3ch(const GMat& src, const GArray<Prim>& prims);\n\n/** @brief Renders on two planes\n\nOutput y image must be 8-bit unsigned planar 1-channel image @ref CV_8UC1\nuv image must be 8-bit unsigned planar 2-channel image @ref CV_8UC2\n\n@param y  input image: 8-bit unsigned 1-channel image @ref CV_8UC1\n@param uv input image: 8-bit unsigned 2-channel image @ref CV_8UC2\n@param prims draw primitives\n*/\nGAPI_EXPORTS_W GMat2 renderNV12(const GMat& y,\n                                const GMat& uv,\n                                const GArray<Prim>& prims);\n\n/** @brief Renders Media Frame\n\nOutput media frame frame cv::MediaFrame\n\n@param m_frame input image: cv::MediaFrame @ref cv::MediaFrame\n@param prims draw primitives\n*/\nGAPI_EXPORTS GFrame renderFrame(const GFrame& m_frame,\n                                const GArray<Prim>& prims);\n\n//! @} gapi_draw_api\n\n} // namespace draw\n} // namespace wip\n\n/**\n * @brief This namespace contains G-API CPU rendering backend functions,\n * structures, and symbols. See @ref gapi_draw for details.\n */\nnamespace render\n{\nnamespace ocv\n{\n    GAPI_EXPORTS_W cv::gapi::GKernelPackage kernels();\n\n} // namespace ocv\n} // namespace render\n} // namespace gapi\n\nnamespace detail\n{\n    template<> struct CompileArgTag<cv::gapi::wip::draw::freetype_font>\n    {\n        static const char* tag() { return \"gapi.freetype_font\"; }\n    };\n} // namespace detail\n\n} // namespace cv\n\n#endif // OPENCV_GAPI_RENDER_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/render/render_types.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_RENDER_TYPES_HPP\n#define OPENCV_GAPI_RENDER_TYPES_HPP\n\n#include <string>\n#include <vector>\n\n#include <opencv2/gapi/opencv_includes.hpp>\n#include <opencv2/gapi/util/variant.hpp>\n#include <opencv2/gapi/own/exports.hpp>\n\nnamespace cv\n{\nnamespace gapi\n{\nnamespace wip\n{\nnamespace draw\n{\n\n/**\n * @brief This structure specifies which FreeType font to use by FText primitives.\n */\nstruct freetype_font\n{\n    /*@{*/\n    std::string path; //!< The path to the font file (.ttf)\n    /*@{*/\n};\n\n//! @addtogroup gapi_draw_prims\n//! @{\n/**\n * @brief This structure represents a text string to draw.\n *\n * Parameters match cv::putText().\n */\nstruct GAPI_EXPORTS_W_SIMPLE Text\n{\n    /**\n     * @brief Text constructor\n     *\n     * @param text_               The text string to be drawn\n     * @param org_                The bottom-left corner of the text string in the image\n     * @param ff_                 The font type, see #HersheyFonts\n     * @param fs_                 The font scale factor that is multiplied by the font-specific base size\n     * @param color_              The text color\n     * @param thick_              The thickness of the lines used to draw a text\n     * @param lt_                 The line type. See #LineTypes\n     * @param bottom_left_origin_ When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner\n     */\n    GAPI_WRAP\n    Text(const std::string& text_,\n         const cv::Point& org_,\n         int ff_,\n         double fs_,\n         const cv::Scalar& color_,\n         int thick_ = 1,\n         int lt_ = 8,\n         bool bottom_left_origin_ = false) :\n        text(text_), org(org_), ff(ff_), fs(fs_),\n        color(color_), thick(thick_), lt(lt_), bottom_left_origin(bottom_left_origin_)\n    {\n    }\n\n    GAPI_WRAP\n    Text() = default;\n\n    /*@{*/\n    GAPI_PROP_RW std::string text;               //!< The text string to be drawn\n    GAPI_PROP_RW cv::Point   org;                //!< The bottom-left corner of the text string in the image\n    GAPI_PROP_RW int         ff;                 //!< The font type, see #HersheyFonts\n    GAPI_PROP_RW double      fs;                 //!< The font scale factor that is multiplied by the font-specific base size\n    GAPI_PROP_RW cv::Scalar  color;              //!< The text color\n    GAPI_PROP_RW int         thick;              //!< The thickness of the lines used to draw a text\n    GAPI_PROP_RW int         lt;                 //!< The line type. See #LineTypes\n    GAPI_PROP_RW bool        bottom_left_origin; //!< When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner\n    /*@{*/\n};\n\n/**\n * @brief This structure represents a text string to draw using\n * FreeType renderer.\n *\n * If OpenCV is built without FreeType support, this primitive will\n * fail at the execution stage.\n */\nstruct FText\n{\n    /**\n     * @brief FText constructor\n     *\n     * @param text_ The text string to be drawn\n     * @param org_  The bottom-left corner of the text string in the image\n     * @param fh_   The height of text\n     * @param color_ The text color\n     */\n    FText(const std::wstring& text_,\n          const cv::Point& org_,\n          int fh_,\n          const cv::Scalar& color_) :\n        text(text_), org(org_), fh(fh_), color(color_)\n    {\n    }\n\n    FText() = default;\n\n    /*@{*/\n    std::wstring text;              //!< The text string to be drawn\n    cv::Point    org;               //!< The bottom-left corner of the text string in the image\n    int          fh;                //!< The height of text\n    cv::Scalar   color;             //!< The text color\n    /*@{*/\n};\n\n/**\n * @brief This structure represents a rectangle to draw.\n *\n * Parameters match cv::rectangle().\n */\nstruct GAPI_EXPORTS_W_SIMPLE Rect\n{\n    /**\n     * @brief Rect constructor\n     *\n     * @param rect_   Coordinates of the rectangle\n     * @param color_  The bottom-left corner of the text string in the image\n     * @param thick_  The thickness of lines that make up the rectangle. Negative values, like #FILLED, mean that the function has to draw a filled rectangle\n     * @param lt_     The type of the line. See #LineTypes\n     * @param shift_  The number of fractional bits in the point coordinates\n     */\n    Rect(const cv::Rect& rect_,\n         const cv::Scalar& color_,\n         int thick_ = 1,\n         int lt_ = 8,\n         int shift_ = 0) :\n        rect(rect_), color(color_), thick(thick_), lt(lt_), shift(shift_)\n    {\n    }\n\n    GAPI_WRAP\n    Rect() = default;\n\n    /*@{*/\n    GAPI_PROP_RW cv::Rect   rect;  //!< Coordinates of the rectangle\n    GAPI_PROP_RW cv::Scalar color; //!< The rectangle color or brightness (grayscale image)\n    GAPI_PROP_RW int        thick; //!< The thickness of lines that make up the rectangle. Negative values, like #FILLED, mean that the function has to draw a filled rectangle\n    GAPI_PROP_RW int        lt;    //!< The type of the line. See #LineTypes\n    GAPI_PROP_RW int        shift; //!< The number of fractional bits in the point coordinates\n    /*@{*/\n};\n\n/**\n * @brief This structure represents a circle to draw.\n *\n * Parameters match cv::circle().\n */\nstruct GAPI_EXPORTS_W_SIMPLE Circle\n{\n    /**\n     * @brief Circle constructor\n     *\n     * @param  center_ The center of the circle\n     * @param  radius_ The radius of the circle\n     * @param  color_  The color of the  circle\n     * @param  thick_  The thickness of the circle outline, if positive. Negative values, like #FILLED, mean that a filled circle is to be drawn\n     * @param  lt_     The Type of the circle boundary. See #LineTypes\n     * @param  shift_  The Number of fractional bits in the coordinates of the center and in the radius value\n     */\n    GAPI_WRAP\n    Circle(const cv::Point& center_,\n           int radius_,\n           const cv::Scalar& color_,\n           int thick_ = 1,\n           int lt_ = 8,\n           int shift_ = 0) :\n        center(center_), radius(radius_), color(color_), thick(thick_), lt(lt_), shift(shift_)\n    {\n    }\n\n    GAPI_WRAP\n    Circle() = default;\n\n    /*@{*/\n    GAPI_PROP_RW cv::Point  center; //!< The center of the circle\n    GAPI_PROP_RW int        radius; //!< The radius of the circle\n    GAPI_PROP_RW cv::Scalar color;  //!< The color of the  circle\n    GAPI_PROP_RW int        thick;  //!< The thickness of the circle outline, if positive. Negative values, like #FILLED, mean that a filled circle is to be drawn\n    GAPI_PROP_RW int        lt;     //!< The Type of the circle boundary. See #LineTypes\n    GAPI_PROP_RW int        shift;  //!< The Number of fractional bits in the coordinates of the center and in the radius value\n    /*@{*/\n};\n\n/**\n * @brief This structure represents a line to draw.\n *\n * Parameters match cv::line().\n */\nstruct GAPI_EXPORTS_W_SIMPLE Line\n{\n    /**\n     * @brief Line constructor\n     *\n     * @param  pt1_    The first point of the line segment\n     * @param  pt2_    The second point of the line segment\n     * @param  color_  The line color\n     * @param  thick_  The thickness of line\n     * @param  lt_     The Type of the line. See #LineTypes\n     * @param  shift_  The number of fractional bits in the point coordinates\n    */\n    GAPI_WRAP\n    Line(const cv::Point& pt1_,\n         const cv::Point& pt2_,\n         const cv::Scalar& color_,\n         int thick_ = 1,\n         int lt_ = 8,\n         int shift_ = 0) :\n        pt1(pt1_), pt2(pt2_), color(color_), thick(thick_), lt(lt_), shift(shift_)\n    {\n    }\n\n    GAPI_WRAP\n    Line() = default;\n\n    /*@{*/\n    GAPI_PROP_RW cv::Point  pt1;    //!< The first point of the line segment\n    GAPI_PROP_RW cv::Point  pt2;    //!< The second point of the line segment\n    GAPI_PROP_RW cv::Scalar color;  //!< The line color\n    GAPI_PROP_RW int        thick;  //!< The thickness of line\n    GAPI_PROP_RW int        lt;     //!< The Type of the line. See #LineTypes\n    GAPI_PROP_RW int        shift;  //!< The number of fractional bits in the point coordinates\n    /*@{*/\n};\n\n/**\n * @brief This structure represents a mosaicing operation.\n *\n * Mosaicing is a very basic method to obfuscate regions in the image.\n */\nstruct GAPI_EXPORTS_W_SIMPLE Mosaic\n{\n    /**\n     * @brief Mosaic constructor\n     *\n     * @param mos_    Coordinates of the mosaic\n     * @param cellSz_ Cell size (same for X, Y)\n     * @param decim_  Decimation (0 stands for no decimation)\n    */\n    Mosaic(const cv::Rect& mos_,\n           int cellSz_,\n           int decim_) :\n        mos(mos_), cellSz(cellSz_), decim(decim_)\n    {\n    }\n\n    GAPI_WRAP\n    Mosaic() : cellSz(0), decim(0) {}\n\n    /*@{*/\n    GAPI_PROP_RW cv::Rect mos;    //!< Coordinates of the mosaic\n    GAPI_PROP_RW int      cellSz; //!< Cell size (same for X, Y)\n    GAPI_PROP_RW int      decim;  //!< Decimation (0 stands for no decimation)\n    /*@{*/\n};\n\n/**\n * @brief This structure represents an image to draw.\n *\n * Image is blended on a frame using the specified mask.\n */\nstruct GAPI_EXPORTS_W_SIMPLE Image\n{\n    /**\n     * @brief Mosaic constructor\n     *\n     * @param  org_   The bottom-left corner of the image\n     * @param  img_   Image to draw\n     * @param  alpha_ Alpha channel for image to draw (same size and number of channels)\n    */\n    GAPI_WRAP\n    Image(const cv::Point& org_,\n          const cv::Mat& img_,\n          const cv::Mat& alpha_) :\n        org(org_), img(img_), alpha(alpha_)\n    {\n    }\n\n    GAPI_WRAP\n    Image() = default;\n\n    /*@{*/\n    GAPI_PROP_RW cv::Point org;   //!< The bottom-left corner of the image\n    GAPI_PROP_RW cv::Mat   img;   //!< Image to draw\n    GAPI_PROP_RW cv::Mat   alpha; //!< Alpha channel for image to draw (same size and number of channels)\n    /*@{*/\n};\n\n/**\n * @brief This structure represents a polygon to draw.\n */\nstruct GAPI_EXPORTS_W_SIMPLE Poly\n{\n    /**\n     * @brief Mosaic constructor\n     *\n     * @param points_ Points to connect\n     * @param color_  The line color\n     * @param thick_  The thickness of line\n     * @param lt_     The Type of the line. See #LineTypes\n     * @param shift_  The number of fractional bits in the point coordinate\n    */\n    GAPI_WRAP\n    Poly(const std::vector<cv::Point>& points_,\n         const cv::Scalar& color_,\n         int thick_ = 1,\n         int lt_ = 8,\n         int shift_ = 0) :\n        points(points_), color(color_), thick(thick_), lt(lt_), shift(shift_)\n    {\n    }\n\n    GAPI_WRAP\n    Poly() = default;\n\n    /*@{*/\n    GAPI_PROP_RW std::vector<cv::Point> points;  //!< Points to connect\n    GAPI_PROP_RW cv::Scalar             color;   //!< The line color\n    GAPI_PROP_RW int                    thick;   //!< The thickness of line\n    GAPI_PROP_RW int                    lt;      //!< The Type of the line. See #LineTypes\n    GAPI_PROP_RW int                    shift;   //!< The number of fractional bits in the point coordinate\n    /*@{*/\n};\n\nusing Prim  = util::variant\n    < Text\n    , FText\n    , Rect\n    , Circle\n    , Line\n    , Mosaic\n    , Image\n    , Poly\n    >;\n\nusing Prims = std::vector<Prim>;\n//! @} gapi_draw_prims\n\n} // namespace draw\n} // namespace wip\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_RENDER_TYPES_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/render.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n\n#ifndef OPENCV_GAPI_RENDER_ROOT_HPP\n#define OPENCV_GAPI_RENDER_ROOT_HPP\n\n// This file is just a shortcut to render/render.hpp\n\n#include <opencv2/gapi/render/render.hpp>\n\n#endif // OPENCV_GAPI_RENDER_ROOT_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/rmat.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n#ifndef OPENCV_GAPI_RMAT_HPP\n#define OPENCV_GAPI_RMAT_HPP\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/own/exports.hpp>\n\n// Forward declaration\nnamespace cv {\nnamespace gapi {\nnamespace s11n {\n    struct IOStream;\n    struct IIStream;\n} // namespace s11n\n} // namespace gapi\n} // namespace cv\n\nnamespace cv {\n\n// \"Remote Mat\", a general class which provides an abstraction layer over the data\n// storage and placement (host, remote device etc) and allows to access this data.\n//\n// The device specific implementation is hidden in the RMat::Adapter class\n//\n// The basic flow is the following:\n// * Backend which is aware of the remote device:\n//   - Implements own AdapterT class which is derived from RMat::Adapter\n//   - Wraps device memory into RMat via make_rmat utility function:\n//         cv::RMat rmat = cv::make_rmat<AdapterT>(args);\n//\n// * End user:\n//   - Writes the code which works with RMats without any knowledge of the remote device:\n//     void func(const cv::RMat& in_rmat, cv::RMat& out_rmat) {\n//         // Fetch input data from the device, get mapped memory for output\n//         cv::RMat::View  in_view =  in_rmat.access(Access::R);\n//         cv::RMat::View out_view = out_rmat.access(Access::W);\n//         performCalculations(in_view, out_view);\n//         // data from out_view is transferred to the device when out_view is destroyed\n//     }\n/** \\addtogroup gapi_data_structures\n * @{\n */\nclass GAPI_EXPORTS RMat\n{\npublic:\n    // A lightweight wrapper on image data:\n    // - Doesn't own the memory;\n    // - Doesn't implement copy semantics (it's assumed that a view is created each time\n    // wrapped data is being accessed);\n    // - Has an optional callback which is called when the view is destroyed.\n    class GAPI_EXPORTS View\n    {\n    public:\n        using DestroyCallback = std::function<void()>;\n        using stepsT = std::vector<size_t>;\n\n        View() = default;\n        View(const GMatDesc& desc, uchar* data, const stepsT& steps = {}, DestroyCallback&& cb = nullptr);\n        View(const GMatDesc& desc, uchar* data, size_t step, DestroyCallback&& cb = nullptr);\n\n        View(const View&) = delete;\n        View& operator=(const View&) = delete;\n        View(View&&) = default;\n        View& operator=(View&& v);\n        ~View() { if (m_cb) m_cb(); }\n\n        cv::Size size() const { return m_desc.size; }\n        const std::vector<int>& dims() const { return m_desc.dims; }\n        int cols() const { return m_desc.size.width; }\n        int rows() const { return m_desc.size.height; }\n        int type() const;\n        int depth() const { return m_desc.depth; }\n        int chan() const { return m_desc.chan; }\n        size_t elemSize() const { return CV_ELEM_SIZE(type()); }\n\n        template<typename T = uchar> T* ptr(int y = 0) {\n            return reinterpret_cast<T*>(m_data + step()*y);\n        }\n        template<typename T = uchar> const T* ptr(int y = 0) const {\n            return reinterpret_cast<T*>(m_data + step()*y);\n        }\n        template<typename T = uchar> T* ptr(int y, int x) {\n            return reinterpret_cast<T*>(m_data + step()*y + step(1)*x);\n        }\n        template<typename T = uchar> const T* ptr(int y, int x) const {\n            return reinterpret_cast<const T*>(m_data + step()*y + step(1)*x);\n        }\n        size_t step(size_t i = 0) const { GAPI_DbgAssert(i<m_steps.size()); return m_steps[i]; }\n        const stepsT& steps() const { return m_steps; }\n\n    private:\n        GMatDesc m_desc;\n        uchar* m_data = nullptr;\n        stepsT m_steps = {0u};\n        DestroyCallback m_cb = nullptr;\n    };\n\n    enum class Access { R, W };\n    class Adapter\n    {\n    public:\n        virtual ~Adapter() = default;\n        virtual GMatDesc desc() const = 0;\n        // Implementation is responsible for setting the appropriate callback to\n        // the view when accessed for writing, to ensure that the data from the view\n        // is transferred to the device when the view is destroyed\n        virtual View access(Access) = 0;\n        virtual void serialize(cv::gapi::s11n::IOStream&) {\n            GAPI_Assert(false && \"Generic serialize method should never be called for RMat adapter\");\n        }\n        virtual void deserialize(cv::gapi::s11n::IIStream&) {\n            GAPI_Assert(false && \"Generic deserialize method should never be called for RMat adapter\");\n        }\n    };\n    using AdapterP = std::shared_ptr<Adapter>;\n\n    RMat() = default;\n    RMat(AdapterP&& a) : m_adapter(std::move(a)) {}\n    GMatDesc desc() const { return m_adapter->desc(); }\n\n    // Note: When accessed for write there is no guarantee that returned view\n    // will contain actual snapshot of the mapped device memory\n    // (no guarantee that fetch from a device is performed). The only\n    // guaranty is that when the view is destroyed, its data will be\n    // transferred to the device\n    View access(Access a) const { return m_adapter->access(a); }\n\n    // Cast underlying RMat adapter to the particular adapter type,\n    // return nullptr if underlying type is different\n    template<typename T> T* get() const\n    {\n        static_assert(std::is_base_of<Adapter, T>::value, \"T is not derived from Adapter!\");\n        GAPI_Assert(m_adapter != nullptr);\n        return dynamic_cast<T*>(m_adapter.get());\n    }\n\n    void serialize(cv::gapi::s11n::IOStream& os) const {\n        m_adapter->serialize(os);\n    }\n\nprivate:\n    AdapterP m_adapter = nullptr;\n};\n\ntemplate<typename T, typename... Ts>\nRMat make_rmat(Ts&&... args) { return { std::make_shared<T>(std::forward<Ts>(args)...) }; }\n/** @} */\n\n} //namespace cv\n\n#endif /* OPENCV_GAPI_RMAT_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/s11n/base.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n#ifndef OPENCV_GAPI_S11N_BASE_HPP\n#define OPENCV_GAPI_S11N_BASE_HPP\n\n#include <opencv2/gapi/own/assert.hpp>\n#include <opencv2/gapi/own/exports.hpp>\n\nnamespace cv {\nnamespace gapi {\n\n/**\n * @brief This namespace contains G-API serialization and\n * deserialization functions and data structures.\n */\nnamespace s11n {\nstruct IOStream;\nstruct IIStream;\n\nnamespace detail {\n\nstruct NotImplemented {\n};\n\n// The default S11N for custom types is NotImplemented\n// Don't! sublass from NotImplemented if you actually implement S11N.\ntemplate<typename T>\nstruct S11N: public NotImplemented {\n    static void serialize(IOStream &, const T &) {\n        GAPI_Assert(false && \"No serialization routine is provided!\");\n    }\n    static T deserialize(IIStream &) {\n        GAPI_Assert(false && \"No deserialization routine is provided!\");\n    }\n};\n\ntemplate<typename T> struct has_S11N_spec {\n    static constexpr bool value = !std::is_base_of<NotImplemented,\n                                        S11N<typename std::decay<T>::type>>::value;\n};\n\n} // namespace detail\n} // namespace s11n\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_S11N_BASE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/s11n.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020-2021 Intel Corporation\n\n#ifndef OPENCV_GAPI_S11N_HPP\n#define OPENCV_GAPI_S11N_HPP\n\n#include <vector>\n#include <map>\n#include <unordered_map>\n#include <opencv2/gapi/s11n/base.hpp>\n#include <opencv2/gapi/gcomputation.hpp>\n#include <opencv2/gapi/rmat.hpp>\n\nnamespace cv {\nnamespace gapi {\n\nnamespace detail {\n    GAPI_EXPORTS cv::GComputation getGraph(const std::vector<char> &p);\n\n    GAPI_EXPORTS cv::GMetaArgs getMetaArgs(const std::vector<char> &p);\n\n    GAPI_EXPORTS cv::GRunArgs getRunArgs(const std::vector<char> &p);\n\n    GAPI_EXPORTS std::vector<std::string> getVectorOfStrings(const std::vector<char> &p);\n\n    template<typename... Types>\n    cv::GCompileArgs getCompileArgs(const std::vector<char> &p);\n\n    template<typename RMatAdapterType>\n    cv::GRunArgs getRunArgsWithRMats(const std::vector<char> &p);\n} // namespace detail\n\nGAPI_EXPORTS std::vector<char> serialize(const cv::GComputation &c);\n//namespace{\n\ntemplate<typename T> static inline\nT deserialize(const std::vector<char> &p);\n\n//} //ananymous namespace\n\nGAPI_EXPORTS std::vector<char> serialize(const cv::GCompileArgs&);\nGAPI_EXPORTS std::vector<char> serialize(const cv::GMetaArgs&);\nGAPI_EXPORTS std::vector<char> serialize(const cv::GRunArgs&);\nGAPI_EXPORTS std::vector<char> serialize(const std::vector<std::string>&);\n\ntemplate<> inline\ncv::GComputation deserialize(const std::vector<char> &p) {\n    return detail::getGraph(p);\n}\n\ntemplate<> inline\ncv::GMetaArgs deserialize(const std::vector<char> &p) {\n    return detail::getMetaArgs(p);\n}\n\ntemplate<> inline\ncv::GRunArgs deserialize(const std::vector<char> &p) {\n    return detail::getRunArgs(p);\n}\n\ntemplate<> inline\nstd::vector<std::string> deserialize(const std::vector<char> &p) {\n    return detail::getVectorOfStrings(p);\n}\n\ntemplate<typename T, typename... Types> inline\ntypename std::enable_if<std::is_same<T, GCompileArgs>::value, GCompileArgs>::\ntype deserialize(const std::vector<char> &p) {\n    return detail::getCompileArgs<Types...>(p);\n}\n\ntemplate<typename T, typename RMatAdapterType> inline\ntypename std::enable_if<std::is_same<T, GRunArgs>::value, GRunArgs>::\ntype deserialize(const std::vector<char> &p) {\n    return detail::getRunArgsWithRMats<RMatAdapterType>(p);\n}\n} // namespace gapi\n} // namespace cv\n\nnamespace cv {\nnamespace gapi {\nnamespace s11n {\nstruct GAPI_EXPORTS IOStream {\n    virtual ~IOStream() = default;\n    // Define the native support for basic C++ types at the API level:\n    virtual IOStream& operator<< (bool) = 0;\n    virtual IOStream& operator<< (char) = 0;\n    virtual IOStream& operator<< (unsigned char) = 0;\n    virtual IOStream& operator<< (short) = 0;\n    virtual IOStream& operator<< (unsigned short) = 0;\n    virtual IOStream& operator<< (int) = 0;\n    virtual IOStream& operator<< (uint32_t) = 0;\n    virtual IOStream& operator<< (uint64_t) = 0;\n    virtual IOStream& operator<< (float) = 0;\n    virtual IOStream& operator<< (double) = 0;\n    virtual IOStream& operator<< (const std::string&) = 0;\n};\n\nstruct GAPI_EXPORTS IIStream {\n    virtual ~IIStream() = default;\n    virtual IIStream& operator>> (bool &) = 0;\n    virtual IIStream& operator>> (std::vector<bool>::reference) = 0;\n    virtual IIStream& operator>> (char &) = 0;\n    virtual IIStream& operator>> (unsigned char &) = 0;\n    virtual IIStream& operator>> (short &) = 0;\n    virtual IIStream& operator>> (unsigned short &) = 0;\n    virtual IIStream& operator>> (int &) = 0;\n    virtual IIStream& operator>> (float &) = 0;\n    virtual IIStream& operator>> (double &) = 0;\n    virtual IIStream& operator >> (uint32_t &) = 0;\n    virtual IIStream& operator >> (uint64_t &) = 0;\n    virtual IIStream& operator>> (std::string &) = 0;\n};\n\nnamespace detail {\nGAPI_EXPORTS std::unique_ptr<IIStream> getInStream(const std::vector<char> &p);\n} // namespace detail\n\n////////////////////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////////////////////\n// S11N operators\n// Note: operators for basic types are defined in IIStream/IOStream\n\n// OpenCV types ////////////////////////////////////////////////////////////////\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::Point &pt);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::Point &pt);\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::Point2f &pt);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::Point2f &pt);\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::Size &sz);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::Size &sz);\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::Rect &rc);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::Rect &rc);\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::Scalar &s);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::Scalar &s);\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::Mat &m);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::Mat &m);\n\n// FIXME: for GRunArgs serailization\n#if !defined(GAPI_STANDALONE)\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::UMat &);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::UMat &);\n#endif // !defined(GAPI_STANDALONE)\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::RMat &r);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::RMat &r);\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::gapi::wip::IStreamSource::Ptr &);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::gapi::wip::IStreamSource::Ptr &);\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::detail::VectorRef &);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::detail::VectorRef &);\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::detail::OpaqueRef &);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::detail::OpaqueRef &);\n\nGAPI_EXPORTS IOStream& operator<< (IOStream& os, const cv::MediaFrame &);\nGAPI_EXPORTS IIStream& operator>> (IIStream& is,       cv::MediaFrame &);\n\n// Generic STL types ////////////////////////////////////////////////////////////////\ntemplate<typename K, typename V>\nIOStream& operator<< (IOStream& os, const std::map<K, V> &m) {\n    const uint32_t sz = static_cast<uint32_t>(m.size());\n    os << sz;\n    for (const auto& it : m) os << it.first << it.second;\n    return os;\n}\ntemplate<typename K, typename V>\nIIStream& operator>> (IIStream& is, std::map<K, V> &m) {\n    m.clear();\n    uint32_t sz = 0u;\n    is >> sz;\n    for (std::size_t i = 0; i < sz; ++i) {\n        K k{};\n        V v{};\n        is >> k >> v;\n        m[k] = v;\n    }\n    return is;\n}\ntemplate<typename K, typename V>\nIOStream& operator<< (IOStream& os, const std::unordered_map<K, V> &m) {\n    const uint32_t sz = static_cast<uint32_t>(m.size());\n    os << sz;\n    for (auto &&it : m) os << it.first << it.second;\n    return os;\n}\ntemplate<typename K, typename V>\nIIStream& operator>> (IIStream& is, std::unordered_map<K, V> &m) {\n    m.clear();\n    uint32_t sz = 0u;\n    is >> sz;\n    for (std::size_t i = 0; i < sz; ++i) {\n        K k{};\n        V v{};\n        is >> k >> v;\n        m[k] = v;\n    }\n    return is;\n}\ntemplate<typename T>\nIOStream& operator<< (IOStream& os, const std::vector<T> &ts) {\n    const uint32_t sz = static_cast<uint32_t>(ts.size());\n    os << sz;\n    for (auto &&v : ts) os << v;\n    return os;\n}\ntemplate<typename T>\nIIStream& operator>> (IIStream& is, std::vector<T> &ts) {\n    uint32_t sz = 0u;\n    is >> sz;\n    if (sz == 0u) {\n        ts.clear();\n    }\n    else {\n        ts.resize(sz);\n        for (std::size_t i = 0; i < sz; ++i) is >> ts[i];\n    }\n    return is;\n}\n\n// Generic: variant serialization\nnamespace detail {\ntemplate<typename V>\nIOStream& put_v(IOStream&, const V&, std::size_t) {\n    GAPI_Assert(false && \"variant>>: requested index is invalid\");\n};\ntemplate<typename V, typename X, typename... Xs>\nIOStream& put_v(IOStream& os, const V& v, std::size_t x) {\n    return (x == 0u)\n        ? os << cv::util::get<X>(v)\n        : put_v<V, Xs...>(os, v, x-1);\n}\ntemplate<typename V>\nIIStream& get_v(IIStream&, V&, std::size_t, std::size_t) {\n    GAPI_Assert(false && \"variant<<: requested index is invalid\");\n}\ntemplate<typename V, typename X, typename... Xs>\nIIStream& get_v(IIStream& is, V& v, std::size_t i, std::size_t gi) {\n    if (i == gi) {\n        X x{};\n        is >> x;\n        v = V{std::move(x)};\n        return is;\n    } else return get_v<V, Xs...>(is, v, i+1, gi);\n}\n} // namespace detail\n\ntemplate<typename... Ts>\nIOStream& operator<< (IOStream& os, const cv::util::variant<Ts...> &v) {\n    os << static_cast<uint32_t>(v.index());\n    return detail::put_v<cv::util::variant<Ts...>, Ts...>(os, v, v.index());\n}\ntemplate<typename... Ts>\nIIStream& operator>> (IIStream& is, cv::util::variant<Ts...> &v) {\n    int idx = -1;\n    is >> idx;\n    GAPI_Assert(idx >= 0 && idx < (int)sizeof...(Ts));\n    return detail::get_v<cv::util::variant<Ts...>, Ts...>(is, v, 0u, idx);\n}\n\n// FIXME: consider a better solution\ntemplate<typename... Ts>\nvoid getRunArgByIdx (IIStream& is, cv::util::variant<Ts...> &v, uint32_t idx) {\n    is = detail::get_v<cv::util::variant<Ts...>, Ts...>(is, v, 0u, idx);\n}\n} // namespace s11n\n\nnamespace detail\n{\ntemplate<typename T> struct try_deserialize_comparg;\n\ntemplate<> struct try_deserialize_comparg<std::tuple<>> {\nstatic cv::util::optional<GCompileArg> exec(const std::string&, cv::gapi::s11n::IIStream&) {\n        return { };\n    }\n};\n\ntemplate<typename T, typename... Types>\nstruct try_deserialize_comparg<std::tuple<T, Types...>> {\nstatic cv::util::optional<GCompileArg> exec(const std::string& tag, cv::gapi::s11n::IIStream& is) {\n    if (tag == cv::detail::CompileArgTag<T>::tag()) {\n        static_assert(cv::gapi::s11n::detail::has_S11N_spec<T>::value,\n            \"cv::gapi::deserialize<GCompileArgs, Types...> expects Types to have S11N \"\n            \"specializations with deserialization callbacks!\");\n        return cv::util::optional<GCompileArg>(\n            GCompileArg { cv::gapi::s11n::detail::S11N<T>::deserialize(is) });\n    }\n    return try_deserialize_comparg<std::tuple<Types...>>::exec(tag, is);\n}\n};\n\ntemplate<typename T> struct deserialize_runarg;\n\ntemplate<typename RMatAdapterType>\nstruct deserialize_runarg {\nstatic GRunArg exec(cv::gapi::s11n::IIStream& is, uint32_t idx) {\n    if (idx == GRunArg::index_of<RMat>()) {\n        auto ptr = std::make_shared<RMatAdapterType>();\n        ptr->deserialize(is);\n        return GRunArg { RMat(std::move(ptr)) };\n    } else { // non-RMat arg - use default deserialization\n        GRunArg arg;\n        getRunArgByIdx(is, arg, idx);\n        return arg;\n    }\n}\n};\n\ntemplate<typename... Types>\ninline cv::util::optional<GCompileArg> tryDeserializeCompArg(const std::string& tag,\n                                                             const std::vector<char>& sArg) {\n    std::unique_ptr<cv::gapi::s11n::IIStream> pArgIs = cv::gapi::s11n::detail::getInStream(sArg);\n    return try_deserialize_comparg<std::tuple<Types...>>::exec(tag, *pArgIs);\n}\n\ntemplate<typename... Types>\ncv::GCompileArgs getCompileArgs(const std::vector<char> &sArgs) {\n    cv::GCompileArgs args;\n\n    std::unique_ptr<cv::gapi::s11n::IIStream> pIs = cv::gapi::s11n::detail::getInStream(sArgs);\n    cv::gapi::s11n::IIStream& is = *pIs;\n\n    uint32_t sz = 0;\n    is >> sz;\n    for (uint32_t i = 0; i < sz; ++i) {\n        std::string tag;\n        is >> tag;\n\n        std::vector<char> sArg;\n        is >> sArg;\n\n        cv::util::optional<GCompileArg> dArg =\n            cv::gapi::detail::tryDeserializeCompArg<Types...>(tag, sArg);\n\n        if (dArg.has_value())\n        {\n            args.push_back(dArg.value());\n        }\n    }\n\n    return args;\n}\n\ntemplate<typename RMatAdapterType>\ncv::GRunArgs getRunArgsWithRMats(const std::vector<char> &p) {\n    std::unique_ptr<cv::gapi::s11n::IIStream> pIs = cv::gapi::s11n::detail::getInStream(p);\n    cv::gapi::s11n::IIStream& is = *pIs;\n    cv::GRunArgs args;\n\n    uint32_t sz = 0;\n    is >> sz;\n    for (uint32_t i = 0; i < sz; ++i) {\n        uint32_t idx = 0;\n        is >> idx;\n        args.push_back(cv::gapi::detail::deserialize_runarg<RMatAdapterType>::exec(is, idx));\n    }\n\n    return args;\n}\n} // namespace detail\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_S11N_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/stereo.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distereoibution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2021 Intel Corporation\n\n#ifndef OPENCV_GAPI_STEREO_HPP\n#define OPENCV_GAPI_STEREO_HPP\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/gscalar.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n\nnamespace cv {\nnamespace gapi {\n\n/**\n * The enum specified format of result that you get from @ref cv::gapi::stereo.\n */\nenum class StereoOutputFormat {\n    DEPTH_FLOAT16, ///< Floating point 16 bit value, CV_16FC1.\n                   ///< This identifier is deprecated, use DEPTH_16F instead.\n    DEPTH_FLOAT32, ///< Floating point 32 bit value, CV_32FC1\n                   ///< This identifier is deprecated, use DEPTH_16F instead.\n    DISPARITY_FIXED16_11_5, ///< 16 bit signed: first bit for sign,\n                            ///< 10 bits for integer part,\n                            ///< 5 bits for fractional part.\n                            ///< This identifier is deprecated,\n                            ///< use DISPARITY_16Q_10_5 instead.\n    DISPARITY_FIXED16_12_4, ///< 16 bit signed: first bit for sign,\n                            ///< 11 bits for integer part,\n                            ///< 4 bits for fractional part.\n                            ///< This identifier is deprecated,\n                            ///< use DISPARITY_16Q_11_4 instead.\n    DEPTH_16F = DEPTH_FLOAT16, ///< Same as DEPTH_FLOAT16\n    DEPTH_32F = DEPTH_FLOAT32, ///< Same as DEPTH_FLOAT32\n    DISPARITY_16Q_10_5 = DISPARITY_FIXED16_11_5, ///< Same as DISPARITY_FIXED16_11_5\n    DISPARITY_16Q_11_4 = DISPARITY_FIXED16_12_4 ///< Same as DISPARITY_FIXED16_12_4\n};\n\n\n/**\n * @brief This namespace contains G-API Operation Types for Stereo and\n * related functionality.\n */\nnamespace calib3d {\n\nG_TYPED_KERNEL(GStereo, <GMat(GMat, GMat, const StereoOutputFormat)>, \"org.opencv.stereo\") {\n    static GMatDesc outMeta(const GMatDesc &left, const GMatDesc &right, const StereoOutputFormat of) {\n        GAPI_Assert(left.chan == 1);\n        GAPI_Assert(left.depth == CV_8U);\n\n        GAPI_Assert(right.chan == 1);\n        GAPI_Assert(right.depth == CV_8U);\n\n        switch(of) {\n            case StereoOutputFormat::DEPTH_FLOAT16:\n                return left.withDepth(CV_16FC1);\n            case StereoOutputFormat::DEPTH_FLOAT32:\n                return left.withDepth(CV_32FC1);\n            case StereoOutputFormat::DISPARITY_FIXED16_11_5:\n            case StereoOutputFormat::DISPARITY_FIXED16_12_4:\n                return left.withDepth(CV_16SC1);\n            default:\n                GAPI_Assert(false && \"Unknown output format!\");\n        }\n    }\n};\n\n} // namespace calib3d\n\n/** @brief Computes disparity/depth map for the specified stereo-pair.\nThe function computes disparity or depth map depending on passed StereoOutputFormat argument.\n\n@param left 8-bit single-channel left image of @ref CV_8UC1 type.\n@param right 8-bit single-channel right image of @ref CV_8UC1 type.\n@param of enum to specified output kind: depth or disparity and corresponding type\n*/\nGAPI_EXPORTS GMat stereo(const GMat& left,\n                         const GMat& right,\n                         const StereoOutputFormat of = StereoOutputFormat::DEPTH_FLOAT32);\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_STEREO_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/streaming/cap.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n\n#ifndef OPENCV_GAPI_STREAMING_CAP_HPP\n#define OPENCV_GAPI_STREAMING_CAP_HPP\n\n/**\n * YOUR ATTENTION PLEASE!\n *\n * This is a header-only implementation of cv::VideoCapture-based\n * Stream source.  It is not built by default with G-API as G-API\n * doesn't depend on videoio module.\n *\n * If you want to use it in your application, please make sure\n * videioio is available in your OpenCV package and is linked to your\n * application.\n *\n * Note for developers: please don't put videoio dependency in G-API\n * because of this file.\n */\n#include <chrono>\n\n#include <opencv2/videoio.hpp>\n#include <opencv2/gapi/garg.hpp>\n#include <opencv2/gapi/streaming/meta.hpp>\n\nnamespace cv {\nnamespace gapi {\nnamespace wip {\n\n/**\n * @brief OpenCV's VideoCapture-based streaming source.\n *\n * This class implements IStreamSource interface.\n * Its constructor takes the same parameters as cv::VideoCapture does.\n *\n * Please make sure that videoio OpenCV module is available before using\n * this in your application (G-API doesn't depend on it directly).\n *\n * @note stream sources are passed to G-API via shared pointers, so\n *  please gapi::make_src<> to create objects and ptr() to pass a\n *  GCaptureSource to cv::gin().\n */\nclass GCaptureSource: public IStreamSource\n{\npublic:\n    explicit GCaptureSource(int id) : cap(id) { prep(); }\n    explicit GCaptureSource(const std::string &path) : cap(path) { prep(); }\n\n    // TODO: Add more constructor overloads to make it\n    // fully compatible with VideoCapture's interface.\n\nprotected:\n    cv::VideoCapture cap;\n    cv::Mat first;\n    bool first_pulled = false;\n    int64_t counter = 0;\n\n    void prep()\n    {\n        // Prepare first frame to report its meta to engine\n        // when needed\n        GAPI_Assert(first.empty());\n        cv::Mat tmp;\n        if (!cap.read(tmp))\n        {\n            GAPI_Assert(false && \"Couldn't grab the very first frame\");\n        }\n        // NOTE: Some decode/media VideoCapture backends continue\n        // owning the video buffer under cv::Mat so in order to\n        // process it safely in a highly concurrent pipeline, clone()\n        // is the only right way.\n        first = tmp.clone();\n    }\n\n    virtual bool pull(cv::gapi::wip::Data &data) override\n    {\n        if (!first_pulled)\n        {\n            GAPI_Assert(!first.empty());\n            first_pulled = true;\n            data = first; // no need to clone here since it was cloned already\n        }\n        else\n        {\n            if (!cap.isOpened()) return false;\n\n            cv::Mat frame;\n            if (!cap.read(frame))\n            {\n                // end-of-stream happened\n                return false;\n            }\n            // Same reason to clone as in prep()\n            data = frame.clone();\n        }\n        // Tag data with seq_id/ts\n        const auto now = std::chrono::system_clock::now();\n        const auto dur = std::chrono::duration_cast<std::chrono::microseconds>\n            (now.time_since_epoch());\n        data.meta[cv::gapi::streaming::meta_tag::timestamp] = int64_t{dur.count()};\n        data.meta[cv::gapi::streaming::meta_tag::seq_id]    = int64_t{counter++};\n        return true;\n    }\n\n    virtual GMetaArg descr_of() const override\n    {\n        GAPI_Assert(!first.empty());\n        return cv::GMetaArg{cv::descr_of(first)};\n    }\n};\n\n// NB: Overload for using from python\nGAPI_EXPORTS_W cv::Ptr<IStreamSource> inline make_capture_src(const std::string& path)\n{\n    return make_src<GCaptureSource>(path);\n}\n\n} // namespace wip\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_STREAMING_CAP_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/streaming/desync.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GSTREAMING_DESYNC_HPP\n#define OPENCV_GAPI_GSTREAMING_DESYNC_HPP\n\n#include <tuple>\n\n#include <opencv2/gapi/util/util.hpp>\n#include <opencv2/gapi/gtype_traits.hpp>\n#include <opencv2/gapi/garg.hpp>\n#include <opencv2/gapi/gcall.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n\nnamespace cv {\nnamespace gapi {\nnamespace streaming {\n\nnamespace detail {\nstruct GDesync {\n    static const char *id() {\n        return \"org.opencv.streaming.desync\";\n    }\n\n    // An universal yield for desync.\n    // Yields output objects according to the input Types...\n    // Reuses gkernel machinery.\n    // FIXME: This function can be generic and declared in gkernel.hpp\n    //        (it is there already, but a part of GKernelType[M]\n    template<typename... R, int... IIs>\n    static std::tuple<R...> yield(cv::GCall &call, cv::detail::Seq<IIs...>) {\n        return std::make_tuple(cv::detail::Yield<R>::yield(call, IIs)...);\n    }\n};\n\ntemplate<typename G>\nG desync(const G &g) {\n    cv::GKernel k{\n          GDesync::id()                                     // kernel id\n        , \"\"                                                // kernel tag\n        , [](const GMetaArgs &a, const GArgs &) {return a;} // outMeta callback\n        , {cv::detail::GTypeTraits<G>::shape}               // output Shape\n        , {cv::detail::GTypeTraits<G>::op_kind}             // input data kinds\n        , {cv::detail::GObtainCtor<G>::get()}               // output template ctors\n    };\n    cv::GCall call(std::move(k));\n    call.pass(g);\n    return std::get<0>(GDesync::yield<G>(call, cv::detail::MkSeq<1>::type()));\n}\n} // namespace detail\n\n/**\n * @brief Starts a desynchronized branch in the graph.\n *\n * This operation takes a single G-API data object and returns a\n * graph-level \"duplicate\" of this object.\n *\n * Operations which use this data object can be desynchronized\n * from the rest of the graph.\n *\n * This operation has no effect when a GComputation is compiled with\n * regular cv::GComputation::compile(), since cv::GCompiled objects\n * always produce their full output vectors.\n *\n * This operation only makes sense when a GComputation is compiled in\n * straming mode with cv::GComputation::compileStreaming(). If this\n * operation is used and there are desynchronized outputs, the user\n * should use a special version of cv::GStreamingCompiled::pull()\n * which produces an array of cv::util::optional<> objects.\n *\n * @note This feature is highly experimental now and is currently\n * limited to a single GMat argument only.\n */\nGAPI_EXPORTS GMat desync(const GMat &g);\n\n} // namespace streaming\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_GSTREAMING_DESYNC_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/streaming/format.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n#ifndef OPENCV_GAPI_GSTREAMING_FORMAT_HPP\n#define OPENCV_GAPI_GSTREAMING_FORMAT_HPP\n\n#include <opencv2/gapi/gkernel.hpp> // GKernelPackage\n\nnamespace cv {\nnamespace gapi {\nnamespace streaming {\n\nGAPI_EXPORTS cv::gapi::GKernelPackage kernels();\n\nG_API_OP(GBGR, <GMat(GFrame)>, \"org.opencv.streaming.BGR\")\n{\n    static GMatDesc outMeta(const GFrameDesc& in) { return GMatDesc{CV_8U, 3, in.size}; }\n};\n\nG_API_OP(GY, <GMat(GFrame)>, \"org.opencv.streaming.Y\") {\n    static GMatDesc outMeta(const GFrameDesc& frameDesc) {\n        return GMatDesc { CV_8U, 1, frameDesc.size , false };\n    }\n};\n\nG_API_OP(GUV, <GMat(GFrame)>, \"org.opencv.streaming.UV\") {\n    static GMatDesc outMeta(const GFrameDesc& frameDesc) {\n        return GMatDesc { CV_8U, 2, cv::Size(frameDesc.size.width / 2, frameDesc.size.height / 2),\n                          false };\n    }\n};\n\n/** @brief Gets bgr plane from input frame\n\n@note Function textual ID is \"org.opencv.streaming.BGR\"\n\n@param in Input frame\n@return Image in BGR format\n*/\nGAPI_EXPORTS cv::GMat BGR(const cv::GFrame& in);\n\n/** @brief Extracts Y plane from media frame.\n\nOutput image is 8-bit 1-channel image of @ref CV_8UC1.\n\n@note Function textual ID is \"org.opencv.streaming.Y\"\n\n@param frame input media frame.\n*/\nGAPI_EXPORTS GMat Y(const cv::GFrame& frame);\n\n/** @brief Extracts UV plane from media frame.\n\nOutput image is 8-bit 2-channel image of @ref CV_8UC2.\n\n@note Function textual ID is \"org.opencv.streaming.UV\"\n\n@param frame input media frame.\n*/\nGAPI_EXPORTS GMat UV(const cv::GFrame& frame);\n} // namespace streaming\n\n//! @addtogroup gapi_transform\n//! @{\n/** @brief Makes a copy of the input image. Note that this copy may be not real\n(no actual data copied). Use this function to maintain graph contracts,\ne.g when graph's input needs to be passed directly to output, like in Streaming mode.\n\n@note Function textual ID is \"org.opencv.streaming.copy\"\n\n@param in Input image\n@return Copy of the input\n*/\nGAPI_EXPORTS_W GMat copy(const GMat& in);\n\n/** @brief Makes a copy of the input frame. Note that this copy may be not real\n(no actual data copied). Use this function to maintain graph contracts,\ne.g when graph's input needs to be passed directly to output, like in Streaming mode.\n\n@note Function textual ID is \"org.opencv.streaming.copy\"\n\n@param in Input frame\n@return Copy of the input\n*/\nGAPI_EXPORTS GFrame copy(const GFrame& in);\n//! @} gapi_transform\n\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_GSTREAMING_FORMAT_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/streaming/meta.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_GSTREAMING_META_HPP\n#define OPENCV_GAPI_GSTREAMING_META_HPP\n\n#include <opencv2/gapi/gopaque.hpp>\n#include <opencv2/gapi/gcall.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n#include <opencv2/gapi/gtype_traits.hpp>\n\nnamespace cv {\nnamespace gapi {\nnamespace streaming {\n\n// FIXME: the name is debatable\nnamespace meta_tag {\nstatic constexpr const char * timestamp = \"org.opencv.gapi.meta.timestamp\";\nstatic constexpr const char * seq_id    = \"org.opencv.gapi.meta.seq_id\";\n} // namespace meta_tag\n\nnamespace detail {\nstruct GMeta {\n    static const char *id() {\n        return \"org.opencv.streaming.meta\";\n    }\n    // A universal yield for meta(), same as in GDesync\n    template<typename... R, int... IIs>\n    static std::tuple<R...> yield(cv::GCall &call, cv::detail::Seq<IIs...>) {\n        return std::make_tuple(cv::detail::Yield<R>::yield(call, IIs)...);\n    }\n    // Also a universal outMeta stub here\n    static GMetaArgs getOutMeta(const GMetaArgs &args, const GArgs &) {\n        return args;\n    }\n};\n} // namespace detail\n\ntemplate<typename T, typename G>\ncv::GOpaque<T> meta(G g, const std::string &tag) {\n    using O = cv::GOpaque<T>;\n    cv::GKernel k{\n          detail::GMeta::id()                    // kernel id\n        , tag                                    // kernel tag. Use meta tag here\n        , &detail::GMeta::getOutMeta             // outMeta callback\n        , {cv::detail::GTypeTraits<O>::shape}    // output Shape\n        , {cv::detail::GTypeTraits<G>::op_kind}  // input data kinds\n        , {cv::detail::GObtainCtor<O>::get()}    // output template ctors\n    };\n    cv::GCall call(std::move(k));\n    call.pass(g);\n    return std::get<0>(detail::GMeta::yield<O>(call, cv::detail::MkSeq<1>::type()));\n}\n\ntemplate<typename G>\ncv::GOpaque<int64_t> timestamp(G g) {\n    return meta<int64_t>(g, meta_tag::timestamp);\n}\n\ntemplate<typename G>\ncv::GOpaque<int64_t> seq_id(G g) {\n    return meta<int64_t>(g, meta_tag::seq_id);\n}\n\ntemplate<typename G>\ncv::GOpaque<int64_t> seqNo(G g) {\n    // Old name, compatibility only\n    return seq_id(g);\n}\n\n} // namespace streaming\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_GSTREAMING_META_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/streaming/source.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2019 Intel Corporation\n\n#ifndef OPENCV_GAPI_STREAMING_SOURCE_HPP\n#define OPENCV_GAPI_STREAMING_SOURCE_HPP\n\n#include <memory>                      // shared_ptr\n#include <type_traits>                 // is_base_of\n\n#include <opencv2/gapi/gmetaarg.hpp>   // GMetaArg\n\n\nnamespace cv {\nnamespace gapi {\nnamespace wip {\n    struct Data; // \"forward-declaration\" of GRunArg\n\n/**\n * @brief Abstract streaming pipeline source.\n *\n * Implement this interface if you want customize the way how data is\n * streaming into GStreamingCompiled.\n *\n * Objects implementing this interface can be passed to\n * GStreamingCompiled using setSource() with cv::gin(). Regular\n * compiled graphs (GCompiled) don't support input objects of this\n * type.\n *\n * Default cv::VideoCapture-based implementation is available, see\n * cv::gapi::wip::GCaptureSource.\n *\n * @note stream sources are passed to G-API via shared pointers, so\n *  please use ptr() when passing a IStreamSource implementation to\n *  cv::gin().\n */\nclass IStreamSource: public std::enable_shared_from_this<IStreamSource>\n{\npublic:\n    using Ptr = std::shared_ptr<IStreamSource>;\n    Ptr ptr() { return shared_from_this(); }\n    virtual bool pull(Data &data) = 0;\n    virtual GMetaArg descr_of() const = 0;\n    virtual ~IStreamSource() = default;\n};\n\ntemplate<class T, class... Args>\nIStreamSource::Ptr inline make_src(Args&&... args)\n{\n    static_assert(std::is_base_of<IStreamSource, T>::value,\n                  \"T must implement the cv::gapi::IStreamSource interface!\");\n    auto src_ptr = std::make_shared<T>(std::forward<Args>(args)...);\n    return src_ptr->ptr();\n}\n\n} // namespace wip\n} // namespace gapi\n} // namespace cv\n\n#endif // OPENCV_GAPI_STREAMING_SOURCE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/streaming/sync.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2021 Intel Corporation\n\n#ifndef OPENCV_GAPI_STREAMING_SYNC_HPP\n#define OPENCV_GAPI_STREAMING_SYNC_HPP\n\nnamespace cv {\nnamespace gapi {\nnamespace streaming {\n\nenum class sync_policy {\n    dont_sync,\n    drop\n};\n\n} // namespace streaming\n} // namespace gapi\n\nnamespace detail {\n    template<> struct CompileArgTag<gapi::streaming::sync_policy> {\n        static const char* tag() { return \"gapi.streaming.sync_policy\"; }\n    };\n\n} // namespace detail\n} // namespace cv\n\n#endif // OPENCV_GAPI_STREAMING_SYNC_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/util/any.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_UTIL_ANY_HPP\n#define OPENCV_GAPI_UTIL_ANY_HPP\n\n#include <memory>\n#include <type_traits>\n#include <typeinfo>\n#include <utility>\n\n#include <opencv2/gapi/util/throw.hpp>\n\n#if defined(_MSC_VER)\n   // disable MSVC warning on \"multiple copy constructors specified\"\n#  pragma warning(disable: 4521)\n#endif\n\nnamespace cv\n{\n\nnamespace internal\n{\n    template <class T, class Source>\n    T down_cast(Source operand)\n    {\n#if defined(__GXX_RTTI) || defined(_CPPRTTI)\n       return dynamic_cast<T>(operand);\n#else\n    #warning used static cast instead of dynamic because RTTI is disabled\n       return static_cast<T>(operand);\n#endif\n    }\n}\n\nnamespace util\n{\n   class bad_any_cast : public std::bad_cast\n   {\n   public:\n       virtual const char* what() const noexcept override\n       {\n           return \"Bad any cast\";\n       }\n   };\n\n   //modeled against C++17 std::any\n\n   class any\n   {\n   private:\n      struct holder;\n      using holder_ptr = std::unique_ptr<holder>;\n      struct holder\n      {\n         virtual holder_ptr clone() = 0;\n         virtual ~holder() = default;\n      };\n\n      template <typename value_t>\n      struct holder_impl : holder\n      {\n         value_t v;\n         template<typename arg_t>\n         holder_impl(arg_t&& a) : v(std::forward<arg_t>(a)) {}\n         holder_ptr clone() override { return holder_ptr(new holder_impl (v));}\n      };\n\n      holder_ptr hldr;\n   public:\n      template<class value_t>\n      any(value_t&& arg) :  hldr(new holder_impl<typename std::decay<value_t>::type>( std::forward<value_t>(arg))) {}\n\n      any(any const& src) : hldr( src.hldr ? src.hldr->clone() : nullptr) {}\n      //simple hack in order not to write enable_if<not any> for the template constructor\n      any(any & src) : any (const_cast<any const&>(src)) {}\n\n      any()       = default;\n      any(any&& ) = default;\n\n      any& operator=(any&&) = default;\n\n      any& operator=(any const& src)\n      {\n         any copy(src);\n         swap(*this, copy);\n         return *this;\n      }\n\n      template<class value_t>\n      friend value_t* any_cast(any* operand);\n\n      template<class value_t>\n      friend const value_t* any_cast(const any* operand);\n\n      template<class value_t>\n      friend value_t& unsafe_any_cast(any& operand);\n\n      template<class value_t>\n      friend const value_t& unsafe_any_cast(const any& operand);\n\n      friend void swap(any & lhs, any& rhs)\n      {\n         swap(lhs.hldr, rhs.hldr);\n      }\n\n   };\n\n   template<class value_t>\n   value_t* any_cast(any* operand)\n   {\n      auto casted = internal::down_cast<any::holder_impl<typename std::decay<value_t>::type> *>(operand->hldr.get());\n      if (casted){\n         return & (casted->v);\n      }\n      return nullptr;\n   }\n\n   template<class value_t>\n   const value_t* any_cast(const any* operand)\n   {\n      auto casted = internal::down_cast<any::holder_impl<typename std::decay<value_t>::type> *>(operand->hldr.get());\n      if (casted){\n         return & (casted->v);\n      }\n      return nullptr;\n   }\n\n   template<class value_t>\n   value_t& any_cast(any& operand)\n   {\n      auto ptr = any_cast<value_t>(&operand);\n      if (ptr)\n      {\n         return *ptr;\n      }\n\n      throw_error(bad_any_cast());\n   }\n\n\n   template<class value_t>\n   const value_t& any_cast(const any& operand)\n   {\n      auto ptr = any_cast<value_t>(&operand);\n      if (ptr)\n      {\n         return *ptr;\n      }\n\n      throw_error(bad_any_cast());\n   }\n\n   template<class value_t>\n   inline value_t& unsafe_any_cast(any& operand)\n   {\n#ifdef DEBUG\n      return any_cast<value_t>(operand);\n#else\n      return static_cast<any::holder_impl<typename std::decay<value_t>::type> *>(operand.hldr.get())->v;\n#endif\n   }\n\n   template<class value_t>\n   inline const value_t& unsafe_any_cast(const any& operand)\n   {\n#ifdef DEBUG\n      return any_cast<value_t>(operand);\n#else\n      return static_cast<any::holder_impl<typename std::decay<value_t>::type> *>(operand.hldr.get())->v;\n#endif\n   }\n\n} // namespace util\n} // namespace cv\n\n#if defined(_MSC_VER)\n   // Enable \"multiple copy constructors specified\" back\n#  pragma warning(default: 4521)\n#endif\n\n#endif // OPENCV_GAPI_UTIL_ANY_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/util/compiler_hints.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n#ifndef OPENCV_GAPI_UTIL_COMPILER_HINTS_HPP\n#define OPENCV_GAPI_UTIL_COMPILER_HINTS_HPP\n\nnamespace cv\n{\nnamespace util\n{\n    //! Utility template function to prevent \"unused\" warnings by various compilers.\n    template<typename T> void suppress_unused_warning( const T& ) {}\n} // namespace util\n} // namespace cv\n\n#endif /* OPENCV_GAPI_UTIL_COMPILER_HINTS_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/util/copy_through_move.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n#ifndef OPENCV_GAPI_UTIL_COPY_THROUGH_MOVE_HPP\n#define OPENCV_GAPI_UTIL_COPY_THROUGH_MOVE_HPP\n\n#include <opencv2/gapi/util/type_traits.hpp> //decay_t\n\nnamespace cv\n{\nnamespace util\n{\n    //This is a tool to move initialize captures of a lambda in C++11\n    template<typename T>\n    struct copy_through_move_t{\n       T value;\n       const T& get() const {return value;}\n       T&       get()       {return value;}\n       copy_through_move_t(T&& g) : value(std::move(g)) {}\n       copy_through_move_t(copy_through_move_t&&) = default;\n       copy_through_move_t(copy_through_move_t const& lhs) : copy_through_move_t(std::move(const_cast<copy_through_move_t&>(lhs))) {}\n    };\n\n    template<typename T>\n    copy_through_move_t<util::decay_t<T>> copy_through_move(T&& t){\n        return std::forward<T>(t);\n    }\n} // namespace util\n} // namespace cv\n\n#endif /* OPENCV_GAPI_UTIL_COPY_THROUGH_MOVE_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/util/optional.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_UTIL_OPTIONAL_HPP\n#define OPENCV_GAPI_UTIL_OPTIONAL_HPP\n\n#include <opencv2/gapi/util/variant.hpp>\n\n// A poor man's `optional` implementation, incompletely modeled against C++17 spec.\nnamespace cv\n{\nnamespace util\n{\n    class bad_optional_access: public std::exception\n    {\n    public:\n        virtual const char *what() const noexcept override\n        {\n            return \"Bad optional access\";\n        }\n    };\n\n    // TODO: nullopt_t\n\n    // Interface ///////////////////////////////////////////////////////////////\n    template<typename T> class optional\n    {\n    public:\n        // Constructors\n        // NB.: there were issues with Clang 3.8 when =default() was used\n        // instead {}\n        optional() {};\n        optional(const optional&) = default;\n        explicit optional(T&&) noexcept;\n        explicit optional(const T&) noexcept;\n        optional(optional&&) noexcept;\n        // TODO: optional(nullopt_t) noexcept;\n        // TODO: optional(const optional<U> &)\n        // TODO: optional(optional<U> &&)\n        // TODO: optional(Args&&...)\n        // TODO: optional(initializer_list<U>)\n        // TODO: optional(U&& value);\n\n        // Assignment\n        optional& operator=(const optional&) = default;\n        optional& operator=(optional&&);\n\n        // Observers\n        T* operator-> ();\n        const T* operator-> () const;\n        T& operator* ();\n        const T& operator* () const;\n        // TODO: && versions\n\n        operator bool() const noexcept;\n        bool has_value() const noexcept;\n\n        T& value();\n        const T& value() const;\n        // TODO: && versions\n\n        template<class U>\n        T value_or(U &&default_value) const;\n\n        void swap(optional &other) noexcept;\n        void reset() noexcept;\n        // TODO: emplace\n\n        // TODO: operator==, !=, <, <=, >, >=\n\n    private:\n        struct nothing {};\n        util::variant<nothing, T> m_holder;\n    };\n\n    template<class T>\n    optional<typename std::decay<T>::type> make_optional(T&& value);\n\n    // TODO: Args... and initializer_list versions\n\n    // Implementation //////////////////////////////////////////////////////////\n    template<class T> optional<T>::optional(T &&v) noexcept\n        : m_holder(std::move(v))\n    {\n    }\n\n    template<class T> optional<T>::optional(const T &v) noexcept\n        : m_holder(v)\n    {\n    }\n\n    template<class T> optional<T>::optional(optional&& rhs) noexcept\n        : m_holder(std::move(rhs.m_holder))\n    {\n        rhs.reset();\n    }\n\n    template<class T> optional<T>& optional<T>::operator=(optional&& rhs)\n    {\n        m_holder = std::move(rhs.m_holder);\n        rhs.reset();\n        return *this;\n    }\n\n    template<class T> T* optional<T>::operator-> ()\n    {\n        return & *(*this);\n    }\n\n    template<class T> const T* optional<T>::operator-> () const\n    {\n        return & *(*this);\n    }\n\n    template<class T> T& optional<T>::operator* ()\n    {\n        return this->value();\n    }\n\n    template<class T> const T& optional<T>::operator* () const\n    {\n        return this->value();\n    }\n\n    template<class T> optional<T>::operator bool() const noexcept\n    {\n        return this->has_value();\n    }\n\n    template<class T> bool optional<T>::has_value() const noexcept\n    {\n        return util::holds_alternative<T>(m_holder);\n    }\n\n    template<class T> T& optional<T>::value()\n    {\n        if (!this->has_value())\n            throw_error(bad_optional_access());\n        return util::get<T>(m_holder);\n    }\n\n    template<class T> const T& optional<T>::value() const\n    {\n        if (!this->has_value())\n            throw_error(bad_optional_access());\n        return util::get<T>(m_holder);\n    }\n\n    template<class T>\n    template<class U> T optional<T>::value_or(U &&default_value) const\n    {\n        return (this->has_value() ? this->value() : T(default_value));\n    }\n\n    template<class T> void optional<T>::swap(optional<T> &other) noexcept\n    {\n        m_holder.swap(other.m_holder);\n    }\n\n    template<class T> void optional<T>::reset() noexcept\n    {\n        if (this->has_value())\n            m_holder = nothing{};\n    }\n\n    template<class T>\n    optional<typename std::decay<T>::type> make_optional(T&& value)\n    {\n        return optional<typename std::decay<T>::type>(std::forward<T>(value));\n    }\n} // namespace util\n} // namespace cv\n\n#endif // OPENCV_GAPI_UTIL_OPTIONAL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/util/throw.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_UTIL_THROW_HPP\n#define OPENCV_GAPI_UTIL_THROW_HPP\n\n#include <utility>  // std::forward\n\n#if !defined(__EXCEPTIONS)\n#include <stdlib.h>\n#include <stdio.h>\n#endif\n\nnamespace cv\n{\nnamespace util\n{\ntemplate <class ExceptionType>\n[[noreturn]] void throw_error(ExceptionType &&e)\n{\n#if defined(__EXCEPTIONS) || defined(_CPPUNWIND)\n    throw std::forward<ExceptionType>(e);\n#else\n    fprintf(stderr, \"An exception thrown! %s\\n\" , e.what());\n    fflush(stderr);\n    abort();\n#endif\n}\n} // namespace util\n} // namespace cv\n\n#endif // OPENCV_GAPI_UTIL_THROW_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/util/type_traits.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_UTIL_TYPE_TRAITS_HPP\n#define OPENCV_GAPI_UTIL_TYPE_TRAITS_HPP\n\n#include <type_traits>\n\nnamespace cv\n{\nnamespace util\n{\n    //these are C++14 parts of type_traits :\n    template< bool B, class T = void >\n    using enable_if_t = typename std::enable_if<B,T>::type;\n\n    template<typename T>\n    using decay_t = typename std::decay<T>::type;\n\n    //this is not part of C++14 but still, of pretty common usage\n    template<class T, class U, class V = void>\n    using are_different_t = enable_if_t< !std::is_same<decay_t<T>, decay_t<U>>::value, V>;\n\n} // namespace cv\n} // namespace util\n\n#endif // OPENCV_GAPI_UTIL_TYPE_TRAITS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/util/util.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018-2019 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_UTIL_HPP\n#define OPENCV_GAPI_UTIL_HPP\n\n#include <tuple>\n\n// \\cond HIDDEN_SYMBOLS\n// This header file contains some generic utility functions which are\n// used in other G-API Public API headers.\n//\n// PLEASE don't put any stuff here if it is NOT used in public API headers!\n\nnamespace cv\n{\nnamespace detail\n{\n    // Recursive integer sequence type, useful for enumerating elements of\n    // template parameter packs.\n    template<int... I> struct Seq     { using next = Seq<I..., sizeof...(I)>; };\n    template<int Sz>   struct MkSeq   { using type = typename MkSeq<Sz-1>::type::next; };\n    template<>         struct MkSeq<0>{ using type = Seq<>; };\n\n    // Checks if elements of variadic template satisfy the given Predicate.\n    // Implemented via tuple, with an interface to accept plain type lists\n    template<template<class> class, typename, typename...> struct all_satisfy;\n\n    template<template<class> class F, typename T, typename... Ts>\n    struct all_satisfy<F, std::tuple<T, Ts...> >\n    {\n        static const constexpr bool value = F<T>::value\n            && all_satisfy<F, std::tuple<Ts...> >::value;\n    };\n    template<template<class> class F, typename T>\n    struct all_satisfy<F, std::tuple<T> >\n    {\n        static const constexpr bool value = F<T>::value;\n    };\n\n    template<template<class> class F, typename T, typename... Ts>\n    struct all_satisfy: public all_satisfy<F, std::tuple<T, Ts...> > {};\n\n    // Permute given tuple type C with given integer sequence II\n    // Sequence may be less than tuple C size.\n    template<class, class> struct permute_tuple;\n\n    template<class C, int... IIs>\n    struct permute_tuple<C, Seq<IIs...> >\n    {\n        using type = std::tuple< typename std::tuple_element<IIs, C>::type... >;\n    };\n\n    // Given T..., generates a type sequence of sizeof...(T)-1 elements\n    // which is T... without its last element\n    // Implemented via tuple, with an interface to accept plain type lists\n    template<typename T, typename... Ts> struct all_but_last;\n\n    template<typename T, typename... Ts>\n    struct all_but_last<std::tuple<T, Ts...> >\n    {\n        using C    = std::tuple<T, Ts...>;\n        using S    = typename MkSeq<std::tuple_size<C>::value - 1>::type;\n        using type = typename permute_tuple<C, S>::type;\n    };\n\n    template<typename T, typename... Ts>\n    struct all_but_last: public all_but_last<std::tuple<T, Ts...> > {};\n\n    template<typename... Ts>\n    using all_but_last_t = typename all_but_last<Ts...>::type;\n\n    // NB.: This is here because there's no constexpr std::max in C++11\n    template<std::size_t S0, std::size_t... SS> struct max_of_t\n    {\n        static constexpr const std::size_t rest  = max_of_t<SS...>::value;\n        static constexpr const std::size_t value = rest > S0 ? rest : S0;\n    };\n    template<std::size_t S> struct max_of_t<S>\n    {\n        static constexpr const std::size_t value = S;\n    };\n\n    template <typename...>\n    struct contains : std::false_type{};\n\n    template <typename T1, typename T2, typename... Ts>\n    struct contains<T1, T2, Ts...> : std::integral_constant<bool, std::is_same<T1, T2>::value ||\n                                                                  contains<T1, Ts...>::value> {};\n    template<typename T, typename... Types>\n    struct contains<T, std::tuple<Types...>> : std::integral_constant<bool, contains<T, Types...>::value> {};\n\n    template <typename...>\n    struct all_unique : std::true_type{};\n\n    template <typename T1, typename... Ts>\n    struct all_unique<T1, Ts...> : std::integral_constant<bool, !contains<T1, Ts...>::value &&\n                                                                 all_unique<Ts...>::value> {};\n\n    template<typename>\n    struct tuple_wrap_helper;\n\n    template<typename T> struct tuple_wrap_helper\n    {\n        using type = std::tuple<T>;\n        static type get(T&& obj) { return std::make_tuple(std::move(obj)); }\n    };\n\n    template<typename... Objs>\n    struct tuple_wrap_helper<std::tuple<Objs...>>\n    {\n        using type = std::tuple<Objs...>;\n        static type get(std::tuple<Objs...>&& objs) { return std::forward<std::tuple<Objs...>>(objs); }\n    };\n} // namespace detail\n} // namespace cv\n\n// \\endcond\n\n#endif //  OPENCV_GAPI_UTIL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/util/variant.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_UTIL_VARIANT_HPP\n#define OPENCV_GAPI_UTIL_VARIANT_HPP\n\n#include <array>\n#include <type_traits>\n\n#include <opencv2/gapi/util/throw.hpp>\n#include <opencv2/gapi/util/util.hpp> // max_of_t\n#include <opencv2/gapi/util/type_traits.hpp>\n\n// A poor man's `variant` implementation, incompletely modeled against C++17 spec.\nnamespace cv\n{\nnamespace util\n{\n    namespace detail\n    {\n        template<std::size_t I, typename Target, typename First, typename... Remaining>\n        struct type_list_index_helper\n        {\n            static const constexpr bool is_same = std::is_same<Target, First>::value;\n            static const constexpr std::size_t value =\n                std::conditional<is_same, std::integral_constant<std::size_t, I>, type_list_index_helper<I + 1, Target, Remaining...>>::type::value;\n        };\n\n        template<std::size_t I, typename Target, typename First>\n        struct type_list_index_helper<I, Target, First>\n        {\n            static_assert(std::is_same<Target, First>::value, \"Type not found\");\n            static const constexpr std::size_t value = I;\n        };\n    }\n\n    template<typename Target, typename... Types>\n    struct type_list_index\n    {\n        static const constexpr std::size_t value = detail::type_list_index_helper<0, Target, Types...>::value;\n    };\n\n    class bad_variant_access: public std::exception\n    {\n    public:\n        virtual const char *what() const noexcept override\n        {\n            return \"Bad variant access\";\n        }\n    };\n\n    // Interface ///////////////////////////////////////////////////////////////\n    struct monostate {};\n    inline bool operator==(const util::monostate&, const util::monostate&)\n    {\n        return true;\n    }\n\n    template<typename... Ts> // FIXME: no references, arrays, and void\n    class variant\n    {\n        // FIXME: Replace with std::aligned_union after gcc4.8 support is dropped\n        static constexpr const std::size_t S = cv::detail::max_of_t<sizeof(Ts)...>::value;\n        static constexpr const std::size_t A = cv::detail::max_of_t<alignof(Ts)...>::value;\n        using Memory = typename std::aligned_storage<S, A>::type[1];\n\n        template<typename T> struct cctr_h {\n            static void help(Memory memory, const Memory from) {\n                new (memory) T(*reinterpret_cast<const T*>(from));\n            }\n        };\n\n        template<typename T> struct mctr_h {\n            static void help(Memory memory, void *pval) {\n                new (memory) T(std::move(*reinterpret_cast<T*>(pval)));\n            }\n        };\n\n        //FIXME: unify with cctr_h and mctr_h\n        template<typename T> struct cnvrt_ctor_h {\n            static void help(Memory memory, void* from) {\n                using util::decay_t;\n                new (memory) decay_t<T>(std::forward<T>(*reinterpret_cast<decay_t<T>*>(from)));\n            }\n        };\n\n        template<typename T> struct copy_h {\n            static void help(Memory to, const Memory from) {\n                *reinterpret_cast<T*>(to) = *reinterpret_cast<const T*>(from);\n            }\n        };\n\n        template<typename T> struct move_h {\n            static void help(Memory to, Memory from) {\n                *reinterpret_cast<T*>(to) = std::move(*reinterpret_cast<T*>(from));\n            }\n        };\n\n        //FIXME: unify with copy_h and move_h\n        template<typename T> struct cnvrt_assign_h {\n            static void help(Memory to, void* from) {\n                using util::decay_t;\n                *reinterpret_cast<decay_t<T>*>(to) = std::forward<T>(*reinterpret_cast<decay_t<T>*>(from));\n            }\n        };\n\n        template<typename T> struct swap_h {\n            static void help(Memory to, Memory from) {\n                std::swap(*reinterpret_cast<T*>(to), *reinterpret_cast<T*>(from));\n            }\n        };\n\n        template<typename T> struct dtor_h {\n            static void help(Memory memory) {\n                (void) memory; // MSCV warning\n                reinterpret_cast<T*>(memory)->~T();\n            }\n        };\n\n        template<typename T> struct equal_h {\n            static bool help(const Memory lhs, const Memory rhs) {\n                const T& t_lhs = *reinterpret_cast<const T*>(lhs);\n                const T& t_rhs = *reinterpret_cast<const T*>(rhs);\n                return t_lhs == t_rhs;\n            }\n        };\n\n        typedef void (*CCtr) (Memory, const Memory);  // Copy c-tor (variant)\n        typedef void (*MCtr) (Memory, void*);         // Generic move c-tor\n        typedef void (*Copy) (Memory, const Memory);  // Copy assignment\n        typedef void (*Move) (Memory, Memory);        // Move assignment\n\n        typedef void (*Swap) (Memory, Memory);        // Swap\n        typedef void (*Dtor) (Memory);                // Destructor\n\n        using  cnvrt_assgn_t   = void (*) (Memory, void*);  // Converting assignment (via std::forward)\n        using  cnvrt_ctor_t    = void (*) (Memory, void*);  // Converting constructor (via std::forward)\n\n        typedef bool (*Equal)(const Memory, const Memory); // Equality test (external)\n\n        static constexpr std::array<CCtr, sizeof...(Ts)> cctrs(){ return {{(&cctr_h<Ts>::help)...}};}\n        static constexpr std::array<MCtr, sizeof...(Ts)> mctrs(){ return {{(&mctr_h<Ts>::help)...}};}\n        static constexpr std::array<Copy, sizeof...(Ts)> cpyrs(){ return {{(&copy_h<Ts>::help)...}};}\n        static constexpr std::array<Move, sizeof...(Ts)> mvers(){ return {{(&move_h<Ts>::help)...}};}\n        static constexpr std::array<Swap, sizeof...(Ts)> swprs(){ return {{(&swap_h<Ts>::help)...}};}\n        static constexpr std::array<Dtor, sizeof...(Ts)> dtors(){ return {{(&dtor_h<Ts>::help)...}};}\n\n        template<bool cond, typename T>\n        struct conditional_ref : std::conditional<cond, typename std::remove_reference<T>::type&, typename std::remove_reference<T>::type > {};\n\n        template<bool cond, typename T>\n        using conditional_ref_t = typename conditional_ref<cond, T>::type;\n\n\n        template<bool is_lvalue_arg>\n        static constexpr std::array<cnvrt_assgn_t, sizeof...(Ts)> cnvrt_assgnrs(){\n            return {{(&cnvrt_assign_h<conditional_ref_t<is_lvalue_arg,Ts>>::help)...}};\n        }\n\n        template<bool is_lvalue_arg>\n        static constexpr std::array<cnvrt_ctor_t, sizeof...(Ts)> cnvrt_ctors(){\n            return {{(&cnvrt_ctor_h<conditional_ref_t<is_lvalue_arg,Ts>>::help)...}};\n        }\n\n        std::size_t m_index = 0;\n\n    protected:\n        template<typename T, typename... Us> friend T& get(variant<Us...> &v);\n        template<typename T, typename... Us> friend const T& get(const variant<Us...> &v);\n        template<typename T, typename... Us> friend T* get_if(variant<Us...> *v) noexcept;\n        template<typename T, typename... Us> friend const T* get_if(const variant<Us...> *v) noexcept;\n\n        template<typename... Us> friend bool operator==(const variant<Us...> &lhs,\n                                                        const variant<Us...> &rhs);\n        Memory memory;\n\n    public:\n        // Constructors\n        variant() noexcept;\n        variant(const variant& other);\n        variant(variant&& other) noexcept;\n        // are_different_t is a SFINAE trick to avoid variant(T &&t) with T=variant\n        // for some reason, this version is called instead of variant(variant&& o) when\n        // variant is used in STL containers (examples: vector assignment).\n        template<\n            typename T,\n            typename = util::are_different_t<variant, T>\n        >\n        explicit variant(T&& t);\n        // template<class T, class... Args> explicit variant(Args&&... args);\n        // FIXME: other constructors\n\n        // Destructor\n        ~variant();\n\n        // Assignment\n        variant& operator=(const variant& rhs);\n        variant& operator=(variant &&rhs) noexcept;\n\n        // SFINAE trick to avoid operator=(T&&) with T=variant<>, see comment above\n        template<\n            typename T,\n            typename = util::are_different_t<variant, T>\n        >\n        variant& operator=(T&& t) noexcept;\n\n        // Observers\n        std::size_t index() const noexcept;\n        // FIXME: valueless_by_exception()\n\n        // Modifiers\n        // FIXME: emplace()\n        void swap(variant &rhs) noexcept;\n\n        // Non-C++17x!\n        template<typename T> static constexpr std::size_t index_of();\n    };\n\n    // FIMXE: visit\n    template<typename T, typename... Types>\n    T* get_if(util::variant<Types...>* v) noexcept;\n\n    template<typename T, typename... Types>\n    const T* get_if(const util::variant<Types...>* v) noexcept;\n\n    template<typename T, typename... Types>\n    T& get(util::variant<Types...> &v);\n\n    template<typename T, typename... Types>\n    const T& get(const util::variant<Types...> &v);\n\n    template<typename T, typename... Types>\n    bool holds_alternative(const util::variant<Types...> &v) noexcept;\n\n    // FIXME: T&&, const TT&& versions.\n\n    // Implementation //////////////////////////////////////////////////////////\n    template<typename... Ts>\n    variant<Ts...>::variant() noexcept\n    {\n        typedef typename std::tuple_element<0, std::tuple<Ts...> >::type TFirst;\n        new (memory) TFirst();\n    }\n\n    template<typename... Ts>\n    variant<Ts...>::variant(const variant &other)\n        : m_index(other.m_index)\n    {\n        (cctrs()[m_index])(memory, other.memory);\n    }\n\n    template<typename... Ts>\n    variant<Ts...>::variant(variant &&other) noexcept\n        : m_index(other.m_index)\n    {\n        (mctrs()[m_index])(memory, other.memory);\n    }\n\n    template<typename... Ts>\n    template<class T, typename>\n    variant<Ts...>::variant(T&& t)\n        : m_index(util::type_list_index<util::decay_t<T>, Ts...>::value)\n    {\n        const constexpr bool is_lvalue_arg =  std::is_lvalue_reference<T>::value;\n        (cnvrt_ctors<is_lvalue_arg>()[m_index])(memory, const_cast<util::decay_t<T> *>(&t));\n    }\n\n    template<typename... Ts>\n    variant<Ts...>::~variant()\n    {\n        (dtors()[m_index])(memory);\n    }\n\n    template<typename... Ts>\n    variant<Ts...>& variant<Ts...>::operator=(const variant<Ts...> &rhs)\n    {\n        if (m_index != rhs.m_index)\n        {\n            (dtors()[    m_index])(memory);\n            (cctrs()[rhs.m_index])(memory, rhs.memory);\n            m_index = rhs.m_index;\n        }\n        else\n        {\n            (cpyrs()[rhs.m_index])(memory, rhs.memory);\n        }\n        return *this;\n    }\n\n    template<typename... Ts>\n    variant<Ts...>& variant<Ts...>::operator=(variant<Ts...> &&rhs) noexcept\n    {\n        if (m_index != rhs.m_index)\n        {\n            (dtors()[    m_index])(memory);\n            (mctrs()[rhs.m_index])(memory, rhs.memory);\n            m_index = rhs.m_index;\n        }\n        else\n        {\n            (mvers()[rhs.m_index])(memory, rhs.memory);\n        }\n        return *this;\n    }\n\n    template<typename... Ts>\n    template<typename T, typename>\n    variant<Ts...>& variant<Ts...>::operator=(T&& t) noexcept\n    {\n        using decayed_t = util::decay_t<T>;\n        // FIXME: No version with implicit type conversion available!\n        const constexpr std::size_t t_index =\n            util::type_list_index<decayed_t, Ts...>::value;\n\n        const constexpr bool is_lvalue_arg =  std::is_lvalue_reference<T>::value;\n\n        if (t_index != m_index)\n        {\n            (dtors()[m_index])(memory);\n            (cnvrt_ctors<is_lvalue_arg>()[t_index])(memory, &t);\n            m_index = t_index;\n        }\n        else\n        {\n            (cnvrt_assgnrs<is_lvalue_arg>()[m_index])(memory, &t);\n        }\n        return *this;\n\n    }\n\n    template<typename... Ts>\n    std::size_t util::variant<Ts...>::index() const noexcept\n    {\n        return m_index;\n    }\n\n    template<typename... Ts>\n    void variant<Ts...>::swap(variant<Ts...> &rhs) noexcept\n    {\n        if (m_index == rhs.index())\n        {\n            (swprs()[m_index](memory, rhs.memory));\n        }\n        else\n        {\n            variant<Ts...> tmp(std::move(*this));\n            *this = std::move(rhs);\n            rhs   = std::move(tmp);\n        }\n    }\n\n    template<typename... Ts>\n    template<typename T>\n    constexpr std::size_t variant<Ts...>::index_of()\n    {\n        return util::type_list_index<T, Ts...>::value; // FIXME: tests!\n    }\n\n    template<typename T, typename... Types>\n    T* get_if(util::variant<Types...>* v) noexcept\n    {\n        const constexpr std::size_t t_index =\n            util::type_list_index<T, Types...>::value;\n\n        if (v && v->index() == t_index)\n            return (T*)(&v->memory);  // workaround for ICC 2019\n            // original code: return reinterpret_cast<T&>(v.memory);\n        return nullptr;\n    }\n\n    template<typename T, typename... Types>\n    const T* get_if(const util::variant<Types...>* v) noexcept\n    {\n        const constexpr std::size_t t_index =\n            util::type_list_index<T, Types...>::value;\n\n        if (v && v->index() == t_index)\n            return (const T*)(&v->memory);  // workaround for ICC 2019\n            // original code: return reinterpret_cast<const T&>(v.memory);\n        return nullptr;\n    }\n\n    template<typename T, typename... Types>\n    T& get(util::variant<Types...> &v)\n    {\n        if (auto* p = get_if<T>(&v))\n            return *p;\n        else\n            throw_error(bad_variant_access());\n    }\n\n    template<typename T, typename... Types>\n    const T& get(const util::variant<Types...> &v)\n    {\n        if (auto* p = get_if<T>(&v))\n            return *p;\n        else\n            throw_error(bad_variant_access());\n    }\n\n    template<typename T, typename... Types>\n    bool holds_alternative(const util::variant<Types...> &v) noexcept\n    {\n        return v.index() == util::variant<Types...>::template index_of<T>();\n    }\n\n    template<typename... Us> bool operator==(const variant<Us...> &lhs,\n                                             const variant<Us...> &rhs)\n    {\n        using V = variant<Us...>;\n\n        // Instantiate table only here since it requires operator== for <Us...>\n        // <Us...> should have operator== only if this one is used, not in general\n        static const std::array<typename V::Equal, sizeof...(Us)> eqs = {\n            {(&V::template equal_h<Us>::help)...}\n        };\n        if (lhs.index() != rhs.index())\n            return false;\n        return (eqs[lhs.index()])(lhs.memory, rhs.memory);\n    }\n\n    template<typename... Us> bool operator!=(const variant<Us...> &lhs,\n                                             const variant<Us...> &rhs)\n    {\n        return !(lhs == rhs);\n    }\n} // namespace cv\n} // namespace util\n\n#endif // OPENCV_GAPI_UTIL_VARIANT_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/video.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2020 Intel Corporation\n\n#ifndef OPENCV_GAPI_VIDEO_HPP\n#define OPENCV_GAPI_VIDEO_HPP\n\n#include <utility> // std::tuple\n\n#include <opencv2/gapi/gkernel.hpp>\n\n\n/** \\defgroup gapi_video G-API Video processing functionality\n */\n\nnamespace cv { namespace gapi {\n\n/** @brief Structure for the Kalman filter's initialization parameters.*/\n\nstruct GAPI_EXPORTS KalmanParams\n{\n    // initial state\n\n    //! corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))\n    Mat state;\n    //! posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)\n    Mat errorCov;\n\n    // dynamic system description\n\n    //! state transition matrix (A)\n    Mat transitionMatrix;\n    //! measurement matrix (H)\n    Mat measurementMatrix;\n    //! process noise covariance matrix (Q)\n    Mat processNoiseCov;\n    //! measurement noise covariance matrix (R)\n    Mat measurementNoiseCov;\n    //! control matrix (B) (Optional: not used if there's no control)\n    Mat controlMatrix;\n};\n\n/**\n * @brief This namespace contains G-API Operations and functions for\n * video-oriented algorithms, like optical flow and background subtraction.\n */\nnamespace  video\n{\nusing GBuildPyrOutput  = std::tuple<GArray<GMat>, GScalar>;\n\nusing GOptFlowLKOutput = std::tuple<cv::GArray<cv::Point2f>,\n                                    cv::GArray<uchar>,\n                                    cv::GArray<float>>;\n\nG_TYPED_KERNEL(GBuildOptFlowPyramid, <GBuildPyrOutput(GMat,Size,GScalar,bool,int,int,bool)>,\n               \"org.opencv.video.buildOpticalFlowPyramid\")\n{\n    static std::tuple<GArrayDesc,GScalarDesc>\n            outMeta(GMatDesc,const Size&,GScalarDesc,bool,int,int,bool)\n    {\n        return std::make_tuple(empty_array_desc(), empty_scalar_desc());\n    }\n};\n\nG_TYPED_KERNEL(GCalcOptFlowLK,\n               <GOptFlowLKOutput(GMat,GMat,cv::GArray<cv::Point2f>,cv::GArray<cv::Point2f>,Size,\n                                 GScalar,TermCriteria,int,double)>,\n               \"org.opencv.video.calcOpticalFlowPyrLK\")\n{\n    static std::tuple<GArrayDesc,GArrayDesc,GArrayDesc> outMeta(GMatDesc,GMatDesc,GArrayDesc,\n                                                                GArrayDesc,const Size&,GScalarDesc,\n                                                                const TermCriteria&,int,double)\n    {\n        return std::make_tuple(empty_array_desc(), empty_array_desc(), empty_array_desc());\n    }\n\n};\n\nG_TYPED_KERNEL(GCalcOptFlowLKForPyr,\n               <GOptFlowLKOutput(cv::GArray<cv::GMat>,cv::GArray<cv::GMat>,\n                                 cv::GArray<cv::Point2f>,cv::GArray<cv::Point2f>,Size,GScalar,\n                                 TermCriteria,int,double)>,\n               \"org.opencv.video.calcOpticalFlowPyrLKForPyr\")\n{\n    static std::tuple<GArrayDesc,GArrayDesc,GArrayDesc> outMeta(GArrayDesc,GArrayDesc,\n                                                                GArrayDesc,GArrayDesc,\n                                                                const Size&,GScalarDesc,\n                                                                const TermCriteria&,int,double)\n    {\n        return std::make_tuple(empty_array_desc(), empty_array_desc(), empty_array_desc());\n    }\n};\n\nenum BackgroundSubtractorType\n{\n    TYPE_BS_MOG2,\n    TYPE_BS_KNN\n};\n\n/** @brief Structure for the Background Subtractor operation's initialization parameters.*/\n\nstruct BackgroundSubtractorParams\n{\n    //! Type of the Background Subtractor operation.\n    BackgroundSubtractorType operation = TYPE_BS_MOG2;\n\n    //! Length of the history.\n    int history = 500;\n\n    //! For MOG2: Threshold on the squared Mahalanobis distance between the pixel\n    //! and the model to decide whether a pixel is well described by\n    //! the background model.\n    //! For KNN: Threshold on the squared distance between the pixel and the sample\n    //! to decide whether a pixel is close to that sample.\n    double threshold = 16;\n\n    //! If true, the algorithm will detect shadows and mark them.\n    bool detectShadows = true;\n\n    //! The value between 0 and 1 that indicates how fast\n    //! the background model is learnt.\n    //! Negative parameter value makes the algorithm use some automatically\n    //! chosen learning rate.\n    double learningRate = -1;\n\n    //! default constructor\n    BackgroundSubtractorParams() {}\n\n    /** Full constructor\n    @param op MOG2/KNN Background Subtractor type.\n    @param histLength Length of the history.\n    @param thrshld For MOG2: Threshold on the squared Mahalanobis distance between\n    the pixel and the model to decide whether a pixel is well described by the background model.\n    For KNN: Threshold on the squared distance between the pixel and the sample to decide\n    whether a pixel is close to that sample.\n    @param detect If true, the algorithm will detect shadows and mark them. It decreases the\n    speed a bit, so if you do not need this feature, set the parameter to false.\n    @param lRate The value between 0 and 1 that indicates how fast the background model is learnt.\n    Negative parameter value makes the algorithm to use some automatically chosen learning rate.\n    */\n    BackgroundSubtractorParams(BackgroundSubtractorType op, int histLength,\n                               double thrshld, bool detect, double lRate) : operation(op),\n                                                                            history(histLength),\n                                                                            threshold(thrshld),\n                                                                            detectShadows(detect),\n                                                                            learningRate(lRate){}\n};\n\nG_TYPED_KERNEL(GBackgroundSubtractor, <GMat(GMat, BackgroundSubtractorParams)>,\n               \"org.opencv.video.BackgroundSubtractor\")\n{\n    static GMatDesc outMeta(const GMatDesc& in, const BackgroundSubtractorParams& bsParams)\n    {\n        GAPI_Assert(bsParams.history >= 0);\n        GAPI_Assert(bsParams.learningRate <= 1);\n        return in.withType(CV_8U, 1);\n    }\n};\n\nvoid checkParams(const cv::gapi::KalmanParams& kfParams,\n                 const cv::GMatDesc& measurement, const cv::GMatDesc& control = {});\n\nG_TYPED_KERNEL(GKalmanFilter, <GMat(GMat, GOpaque<bool>, GMat, KalmanParams)>,\n               \"org.opencv.video.KalmanFilter\")\n{\n    static GMatDesc outMeta(const GMatDesc& measurement, const GOpaqueDesc&,\n                            const GMatDesc& control, const KalmanParams& kfParams)\n    {\n        checkParams(kfParams, measurement, control);\n        return measurement.withSize(Size(1, kfParams.transitionMatrix.rows));\n    }\n};\n\nG_TYPED_KERNEL(GKalmanFilterNoControl, <GMat(GMat, GOpaque<bool>, KalmanParams)>, \"org.opencv.video.KalmanFilterNoControl\")\n{\n    static GMatDesc outMeta(const GMatDesc& measurement, const GOpaqueDesc&, const KalmanParams& kfParams)\n    {\n        checkParams(kfParams, measurement);\n        return measurement.withSize(Size(1, kfParams.transitionMatrix.rows));\n    }\n};\n} //namespace video\n\n//! @addtogroup gapi_video\n//! @{\n/** @brief Constructs the image pyramid which can be passed to calcOpticalFlowPyrLK.\n\n@note Function textual ID is \"org.opencv.video.buildOpticalFlowPyramid\"\n\n@param img                8-bit input image.\n@param winSize            window size of optical flow algorithm. Must be not less than winSize\n                          argument of calcOpticalFlowPyrLK. It is needed to calculate required\n                          padding for pyramid levels.\n@param maxLevel           0-based maximal pyramid level number.\n@param withDerivatives    set to precompute gradients for the every pyramid level. If pyramid is\n                          constructed without the gradients then calcOpticalFlowPyrLK will calculate\n                          them internally.\n@param pyrBorder          the border mode for pyramid layers.\n@param derivBorder        the border mode for gradients.\n@param tryReuseInputImage put ROI of input image into the pyramid if possible. You can pass false\n                          to force data copying.\n\n@return\n - output pyramid.\n - number of levels in constructed pyramid. Can be less than maxLevel.\n */\nGAPI_EXPORTS std::tuple<GArray<GMat>, GScalar>\nbuildOpticalFlowPyramid(const GMat     &img,\n                        const Size     &winSize,\n                        const GScalar  &maxLevel,\n                              bool      withDerivatives    = true,\n                              int       pyrBorder          = BORDER_REFLECT_101,\n                              int       derivBorder        = BORDER_CONSTANT,\n                              bool      tryReuseInputImage = true);\n\n/** @brief Calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade\nmethod with pyramids.\n\nSee @cite Bouguet00 .\n\n@note Function textual ID is \"org.opencv.video.calcOpticalFlowPyrLK\"\n\n@param prevImg first 8-bit input image (GMat) or pyramid (GArray<GMat>) constructed by\nbuildOpticalFlowPyramid.\n@param nextImg second input image (GMat) or pyramid (GArray<GMat>) of the same size and the same\ntype as prevImg.\n@param prevPts GArray of 2D points for which the flow needs to be found; point coordinates must be\nsingle-precision floating-point numbers.\n@param predPts GArray of 2D points initial for the flow search; make sense only when\nOPTFLOW_USE_INITIAL_FLOW flag is passed; in that case the vector must have the same size as in\nthe input.\n@param winSize size of the search window at each pyramid level.\n@param maxLevel 0-based maximal pyramid level number; if set to 0, pyramids are not used (single\nlevel), if set to 1, two levels are used, and so on; if pyramids are passed to input then\nalgorithm will use as many levels as pyramids have but no more than maxLevel.\n@param criteria parameter, specifying the termination criteria of the iterative search algorithm\n(after the specified maximum number of iterations criteria.maxCount or when the search window\nmoves by less than criteria.epsilon).\n@param flags operation flags:\n -   **OPTFLOW_USE_INITIAL_FLOW** uses initial estimations, stored in nextPts; if the flag is\n     not set, then prevPts is copied to nextPts and is considered the initial estimate.\n -   **OPTFLOW_LK_GET_MIN_EIGENVALS** use minimum eigen values as an error measure (see\n     minEigThreshold description); if the flag is not set, then L1 distance between patches\n     around the original and a moved point, divided by number of pixels in a window, is used as a\n     error measure.\n@param minEigThresh the algorithm calculates the minimum eigen value of a 2x2 normal matrix of\noptical flow equations (this matrix is called a spatial gradient matrix in @cite Bouguet00), divided\nby number of pixels in a window; if this value is less than minEigThreshold, then a corresponding\nfeature is filtered out and its flow is not processed, so it allows to remove bad points and get a\nperformance boost.\n\n@return\n - GArray of 2D points (with single-precision floating-point coordinates)\ncontaining the calculated new positions of input features in the second image.\n - status GArray (of unsigned chars); each element of the vector is set to 1 if\nthe flow for the corresponding features has been found, otherwise, it is set to 0.\n - GArray of errors (doubles); each element of the vector is set to an error for the\ncorresponding feature, type of the error measure can be set in flags parameter; if the flow wasn't\nfound then the error is not defined (use the status parameter to find such cases).\n */\nGAPI_EXPORTS std::tuple<GArray<Point2f>, GArray<uchar>, GArray<float>>\ncalcOpticalFlowPyrLK(const GMat            &prevImg,\n                     const GMat            &nextImg,\n                     const GArray<Point2f> &prevPts,\n                     const GArray<Point2f> &predPts,\n                     const Size            &winSize      = Size(21, 21),\n                     const GScalar         &maxLevel     = 3,\n                     const TermCriteria    &criteria     = TermCriteria(TermCriteria::COUNT |\n                                                                        TermCriteria::EPS,\n                                                                        30, 0.01),\n                           int              flags        = 0,\n                           double           minEigThresh = 1e-4);\n\n/**\n@overload\n@note Function textual ID is \"org.opencv.video.calcOpticalFlowPyrLKForPyr\"\n*/\nGAPI_EXPORTS std::tuple<GArray<Point2f>, GArray<uchar>, GArray<float>>\ncalcOpticalFlowPyrLK(const GArray<GMat>    &prevPyr,\n                     const GArray<GMat>    &nextPyr,\n                     const GArray<Point2f> &prevPts,\n                     const GArray<Point2f> &predPts,\n                     const Size            &winSize      = Size(21, 21),\n                     const GScalar         &maxLevel     = 3,\n                     const TermCriteria    &criteria     = TermCriteria(TermCriteria::COUNT |\n                                                                        TermCriteria::EPS,\n                                                                        30, 0.01),\n                           int              flags        = 0,\n                           double           minEigThresh = 1e-4);\n\n/** @brief Gaussian Mixture-based or K-nearest neighbours-based Background/Foreground Segmentation Algorithm.\nThe operation generates a foreground mask.\n\n@return Output image is foreground mask, i.e. 8-bit unsigned 1-channel (binary) matrix @ref CV_8UC1.\n\n@note Functional textual ID is \"org.opencv.video.BackgroundSubtractor\"\n\n@param src input image: Floating point frame is used without scaling and should be in range [0,255].\n@param bsParams Set of initialization parameters for Background Subtractor kernel.\n*/\nGAPI_EXPORTS GMat BackgroundSubtractor(const GMat& src, const cv::gapi::video::BackgroundSubtractorParams& bsParams);\n\n/** @brief Standard Kalman filter algorithm <http://en.wikipedia.org/wiki/Kalman_filter>.\n\n@note Functional textual ID is \"org.opencv.video.KalmanFilter\"\n\n@param measurement input matrix: 32-bit or 64-bit float 1-channel matrix containing measurements.\n@param haveMeasurement dynamic input flag that indicates whether we get measurements\nat a particular iteration .\n@param control input matrix: 32-bit or 64-bit float 1-channel matrix contains control data\nfor changing dynamic system.\n@param kfParams Set of initialization parameters for Kalman filter kernel.\n\n@return Output matrix is predicted or corrected state. They can be 32-bit or 64-bit float\n1-channel matrix @ref CV_32FC1 or @ref CV_64FC1.\n\n@details If measurement matrix is given (haveMeasurements == true), corrected state will\nbe returned which corresponds to the pipeline\ncv::KalmanFilter::predict(control) -> cv::KalmanFilter::correct(measurement).\nOtherwise, predicted state will be returned which corresponds to the call of\ncv::KalmanFilter::predict(control).\n@sa cv::KalmanFilter\n*/\nGAPI_EXPORTS GMat KalmanFilter(const GMat& measurement, const GOpaque<bool>& haveMeasurement,\n                               const GMat& control, const cv::gapi::KalmanParams& kfParams);\n\n/** @overload\nThe case of Standard Kalman filter algorithm when there is no control in a dynamic system.\nIn this case the controlMatrix is empty and control vector is absent.\n\n@note Function textual ID is \"org.opencv.video.KalmanFilterNoControl\"\n\n@param measurement input matrix: 32-bit or 64-bit float 1-channel matrix containing measurements.\n@param haveMeasurement dynamic input flag that indicates whether we get measurements\nat a particular iteration.\n@param kfParams Set of initialization parameters for Kalman filter kernel.\n\n@return Output matrix is predicted or corrected state. They can be 32-bit or 64-bit float\n1-channel matrix @ref CV_32FC1 or @ref CV_64FC1.\n\n@sa cv::KalmanFilter\n */\nGAPI_EXPORTS GMat KalmanFilter(const GMat& measurement, const GOpaque<bool>& haveMeasurement,\n                               const cv::gapi::KalmanParams& kfParams);\n\n//! @} gapi_video\n} //namespace gapi\n} //namespace cv\n\n\nnamespace cv { namespace detail {\ntemplate<> struct CompileArgTag<cv::gapi::video::BackgroundSubtractorParams>\n{\n    static const char* tag()\n    {\n        return \"org.opencv.video.background_substractor_params\";\n    }\n};\n}  // namespace detail\n}  // namespace cv\n\n#endif // OPENCV_GAPI_VIDEO_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n\n#ifndef OPENCV_GAPI_HPP\n#define OPENCV_GAPI_HPP\n\n#include <memory>\n\n/** \\defgroup gapi G-API framework\n@{\n    @defgroup gapi_main_classes G-API Main Classes\n    @defgroup gapi_data_objects G-API Data Types\n    @{\n      @defgroup gapi_meta_args G-API Metadata Descriptors\n    @}\n    @defgroup gapi_std_backends G-API Standard Backends\n    @defgroup gapi_compile_args G-API Graph Compilation Arguments\n@}\n */\n\n#include <opencv2/gapi/gmat.hpp>\n#include <opencv2/gapi/garray.hpp>\n#include <opencv2/gapi/gscalar.hpp>\n#include <opencv2/gapi/gopaque.hpp>\n#include <opencv2/gapi/gframe.hpp>\n#include <opencv2/gapi/gcomputation.hpp>\n#include <opencv2/gapi/gcompiled.hpp>\n#include <opencv2/gapi/gtyped.hpp>\n#include <opencv2/gapi/gkernel.hpp>\n#include <opencv2/gapi/operators.hpp>\n\n// Include these files here to avoid cyclic dependency between\n// Desync & GKernel & GComputation & GStreamingCompiled.\n#include <opencv2/gapi/streaming/desync.hpp>\n#include <opencv2/gapi/streaming/format.hpp>\n\n#endif // OPENCV_GAPI_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/highgui/highgui.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/highgui.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/highgui/highgui_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_HIGHGUI_H\n#define OPENCV_HIGHGUI_H\n\n#include \"opencv2/core/core_c.h\"\n#include \"opencv2/imgproc/imgproc_c.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/** @addtogroup highgui_c\n  @{\n  */\n\n/****************************************************************************************\\\n*                                  Basic GUI functions                                   *\n\\****************************************************************************************/\n//YV\n//-----------New for Qt\n/* For font */\nenum {  CV_FONT_LIGHT           = 25,//QFont::Light,\n        CV_FONT_NORMAL          = 50,//QFont::Normal,\n        CV_FONT_DEMIBOLD        = 63,//QFont::DemiBold,\n        CV_FONT_BOLD            = 75,//QFont::Bold,\n        CV_FONT_BLACK           = 87 //QFont::Black\n};\n\nenum {  CV_STYLE_NORMAL         = 0,//QFont::StyleNormal,\n        CV_STYLE_ITALIC         = 1,//QFont::StyleItalic,\n        CV_STYLE_OBLIQUE        = 2 //QFont::StyleOblique\n};\n/* ---------*/\n\n//for color cvScalar(blue_component, green_component, red_component[, alpha_component])\n//and alpha= 0 <-> 0xFF (not transparent <-> transparent)\nCVAPI(CvFont) cvFontQt(const char* nameFont, int pointSize CV_DEFAULT(-1), CvScalar color CV_DEFAULT(cvScalarAll(0)), int weight CV_DEFAULT(CV_FONT_NORMAL),  int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0));\n\nCVAPI(void) cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont *arg2);\n\nCVAPI(void) cvDisplayOverlay(const char* name, const char* text, int delayms CV_DEFAULT(0));\nCVAPI(void) cvDisplayStatusBar(const char* name, const char* text, int delayms CV_DEFAULT(0));\n\nCVAPI(void) cvSaveWindowParameters(const char* name);\nCVAPI(void) cvLoadWindowParameters(const char* name);\nCVAPI(int) cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);\nCVAPI(void) cvStopLoop( void );\n\ntypedef void (CV_CDECL *CvButtonCallback)(int state, void* userdata);\nenum {CV_PUSH_BUTTON = 0, CV_CHECKBOX = 1, CV_RADIOBOX = 2};\nCVAPI(int) cvCreateButton( const char* button_name CV_DEFAULT(NULL),CvButtonCallback on_change CV_DEFAULT(NULL), void* userdata CV_DEFAULT(NULL) , int button_type CV_DEFAULT(CV_PUSH_BUTTON), int initial_button_state CV_DEFAULT(0));\n//----------------------\n\n\n/* this function is used to set some external parameters in case of X Window */\nCVAPI(int) cvInitSystem( int argc, char** argv );\n\nCVAPI(int) cvStartWindowThread( void );\n\n// ---------  YV ---------\nenum\n{\n    //These 3 flags are used by cvSet/GetWindowProperty\n    CV_WND_PROP_FULLSCREEN = 0, //to change/get window's fullscreen property\n    CV_WND_PROP_AUTOSIZE   = 1, //to change/get window's autosize property\n    CV_WND_PROP_ASPECTRATIO= 2, //to change/get window's aspectratio property\n    CV_WND_PROP_OPENGL     = 3, //to change/get window's opengl support\n    CV_WND_PROP_VISIBLE    = 4,\n\n    //These 2 flags are used by cvNamedWindow and cvSet/GetWindowProperty\n    CV_WINDOW_NORMAL       = 0x00000000, //the user can resize the window (no constraint)  / also use to switch a fullscreen window to a normal size\n    CV_WINDOW_AUTOSIZE     = 0x00000001, //the user cannot resize the window, the size is constrainted by the image displayed\n    CV_WINDOW_OPENGL       = 0x00001000, //window with opengl support\n\n    //Those flags are only for Qt\n    CV_GUI_EXPANDED         = 0x00000000, //status bar and tool bar\n    CV_GUI_NORMAL           = 0x00000010, //old fashious way\n\n    //These 3 flags are used by cvNamedWindow and cvSet/GetWindowProperty\n    CV_WINDOW_FULLSCREEN   = 1,//change the window to fullscreen\n    CV_WINDOW_FREERATIO    = 0x00000100,//the image expends as much as it can (no ratio constraint)\n    CV_WINDOW_KEEPRATIO    = 0x00000000//the ration image is respected.\n};\n\n/* create window */\nCVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOSIZE) );\n\n/* Set and Get Property of the window */\nCVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value);\nCVAPI(double) cvGetWindowProperty(const char* name, int prop_id);\n\n#ifdef __cplusplus  // FIXIT remove in OpenCV 4.0\n/* Get window image rectangle coordinates, width and height */\nCVAPI(cv::Rect)cvGetWindowImageRect(const char* name);\n#endif\n\n/* display image within window (highgui windows remember their content) */\nCVAPI(void) cvShowImage( const char* name, const CvArr* image );\n\n/* resize/move window */\nCVAPI(void) cvResizeWindow( const char* name, int width, int height );\nCVAPI(void) cvMoveWindow( const char* name, int x, int y );\n\n\n/* destroy window and all the trackers associated with it */\nCVAPI(void) cvDestroyWindow( const char* name );\n\nCVAPI(void) cvDestroyAllWindows(void);\n\n/* get native window handle (HWND in case of Win32 and Widget in case of X Window) */\nCVAPI(void*) cvGetWindowHandle( const char* name );\n\n/* get name of highgui window given its native handle */\nCVAPI(const char*) cvGetWindowName( void* window_handle );\n\n\ntypedef void (CV_CDECL *CvTrackbarCallback)(int pos);\n\n/* create trackbar and display it on top of given window, set callback */\nCVAPI(int) cvCreateTrackbar( const char* trackbar_name, const char* window_name,\n                             int* value, int count, CvTrackbarCallback on_change CV_DEFAULT(NULL));\n\ntypedef void (CV_CDECL *CvTrackbarCallback2)(int pos, void* userdata);\n\nCVAPI(int) cvCreateTrackbar2( const char* trackbar_name, const char* window_name,\n                              int* value, int count, CvTrackbarCallback2 on_change,\n                              void* userdata CV_DEFAULT(0));\n\n/* retrieve or set trackbar position */\nCVAPI(int) cvGetTrackbarPos( const char* trackbar_name, const char* window_name );\nCVAPI(void) cvSetTrackbarPos( const char* trackbar_name, const char* window_name, int pos );\nCVAPI(void) cvSetTrackbarMax(const char* trackbar_name, const char* window_name, int maxval);\nCVAPI(void) cvSetTrackbarMin(const char* trackbar_name, const char* window_name, int minval);\n\nenum\n{\n    CV_EVENT_MOUSEMOVE      =0,\n    CV_EVENT_LBUTTONDOWN    =1,\n    CV_EVENT_RBUTTONDOWN    =2,\n    CV_EVENT_MBUTTONDOWN    =3,\n    CV_EVENT_LBUTTONUP      =4,\n    CV_EVENT_RBUTTONUP      =5,\n    CV_EVENT_MBUTTONUP      =6,\n    CV_EVENT_LBUTTONDBLCLK  =7,\n    CV_EVENT_RBUTTONDBLCLK  =8,\n    CV_EVENT_MBUTTONDBLCLK  =9,\n    CV_EVENT_MOUSEWHEEL     =10,\n    CV_EVENT_MOUSEHWHEEL    =11\n};\n\nenum\n{\n    CV_EVENT_FLAG_LBUTTON   =1,\n    CV_EVENT_FLAG_RBUTTON   =2,\n    CV_EVENT_FLAG_MBUTTON   =4,\n    CV_EVENT_FLAG_CTRLKEY   =8,\n    CV_EVENT_FLAG_SHIFTKEY  =16,\n    CV_EVENT_FLAG_ALTKEY    =32\n};\n\n\n#define CV_GET_WHEEL_DELTA(flags) ((short)((flags >> 16) & 0xffff)) // upper 16 bits\n\ntypedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, void* param);\n\n/* assign callback for mouse events */\nCVAPI(void) cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse,\n                                void* param CV_DEFAULT(NULL));\n\n/* wait for key event infinitely (delay<=0) or for \"delay\" milliseconds */\nCVAPI(int) cvWaitKey(int delay CV_DEFAULT(0));\n\n// OpenGL support\n\ntypedef void (CV_CDECL *CvOpenGlDrawCallback)(void* userdata);\nCVAPI(void) cvSetOpenGlDrawCallback(const char* window_name, CvOpenGlDrawCallback callback, void* userdata CV_DEFAULT(NULL));\n\nCVAPI(void) cvSetOpenGlContext(const char* window_name);\nCVAPI(void) cvUpdateWindow(const char* window_name);\n\n\n/****************************************************************************************\\\n\n*                              Obsolete functions/synonyms                               *\n\\****************************************************************************************/\n\n#define cvAddSearchPath(path)\n#define cvvInitSystem cvInitSystem\n#define cvvNamedWindow cvNamedWindow\n#define cvvShowImage cvShowImage\n#define cvvResizeWindow cvResizeWindow\n#define cvvDestroyWindow cvDestroyWindow\n#define cvvCreateTrackbar cvCreateTrackbar\n#define cvvAddSearchPath cvAddSearchPath\n#define cvvWaitKey(name) cvWaitKey(0)\n#define cvvWaitKeyEx(name,delay) cvWaitKey(delay)\n#define HG_AUTOSIZE CV_WINDOW_AUTOSIZE\n#define set_preprocess_func cvSetPreprocessFuncWin32\n#define set_postprocess_func cvSetPostprocessFuncWin32\n\n#if defined _WIN32\n\nCVAPI(void) cvSetPreprocessFuncWin32_(const void* callback);\nCVAPI(void) cvSetPostprocessFuncWin32_(const void* callback);\n#define cvSetPreprocessFuncWin32(callback) cvSetPreprocessFuncWin32_((const void*)(callback))\n#define cvSetPostprocessFuncWin32(callback) cvSetPostprocessFuncWin32_((const void*)(callback))\n\n#endif\n\n/** @} highgui_c */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/highgui.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_HIGHGUI_HPP\n#define OPENCV_HIGHGUI_HPP\n\n#include \"opencv2/core.hpp\"\n#ifdef HAVE_OPENCV_IMGCODECS\n#include \"opencv2/imgcodecs.hpp\"\n#endif\n#ifdef HAVE_OPENCV_VIDEOIO\n#include \"opencv2/videoio.hpp\"\n#endif\n\n/**\n@defgroup highgui High-level GUI\n\nWhile OpenCV was designed for use in full-scale applications and can be used within functionally\nrich UI frameworks (such as Qt\\*, WinForms\\*, or Cocoa\\*) or without any UI at all, sometimes there\nit is required to try functionality quickly and visualize the results. This is what the HighGUI\nmodule has been designed for.\n\nIt provides easy interface to:\n\n-   Create and manipulate windows that can display images and \"remember\" their content (no need to\n    handle repaint events from OS).\n-   Add trackbars to the windows, handle simple mouse events as well as keyboard commands.\n\n@{\n    @defgroup highgui_window_flags Flags related creating and manipulating HighGUI windows and mouse events\n    @defgroup highgui_opengl OpenGL support\n    @defgroup highgui_qt Qt New Functions\n\n    ![image](pics/qtgui.png)\n\n    This figure explains new functionality implemented with Qt\\* GUI. The new GUI provides a statusbar,\n    a toolbar, and a control panel. The control panel can have trackbars and buttonbars attached to it.\n    If you cannot see the control panel, press Ctrl+P or right-click any Qt window and select **Display\n    properties window**.\n\n    -   To attach a trackbar, the window name parameter must be NULL.\n\n    -   To attach a buttonbar, a button must be created. If the last bar attached to the control panel\n        is a buttonbar, the new button is added to the right of the last button. If the last bar\n        attached to the control panel is a trackbar, or the control panel is empty, a new buttonbar is\n        created. Then, a new button is attached to it.\n\n    See below the example used to generate the figure:\n    @code\n        int main(int argc, char *argv[])\n        {\n\n            int value = 50;\n            int value2 = 0;\n\n\n            namedWindow(\"main1\",WINDOW_NORMAL);\n            namedWindow(\"main2\",WINDOW_AUTOSIZE | WINDOW_GUI_NORMAL);\n            createTrackbar( \"track1\", \"main1\", &value, 255,  NULL);\n\n            String nameb1 = \"button1\";\n            String nameb2 = \"button2\";\n\n            createButton(nameb1,callbackButton,&nameb1,QT_CHECKBOX,1);\n            createButton(nameb2,callbackButton,NULL,QT_CHECKBOX,0);\n            createTrackbar( \"track2\", NULL, &value2, 255, NULL);\n            createButton(\"button5\",callbackButton1,NULL,QT_RADIOBOX,0);\n            createButton(\"button6\",callbackButton2,NULL,QT_RADIOBOX,1);\n\n            setMouseCallback( \"main2\",on_mouse,NULL );\n\n            Mat img1 = imread(\"files/flower.jpg\");\n            VideoCapture video;\n            video.open(\"files/hockey.avi\");\n\n            Mat img2,img3;\n\n            while( waitKey(33) != 27 )\n            {\n                img1.convertTo(img2,-1,1,value);\n                video >> img3;\n\n                imshow(\"main1\",img2);\n                imshow(\"main2\",img3);\n            }\n\n            destroyAllWindows();\n\n            return 0;\n        }\n    @endcode\n\n\n    @defgroup highgui_winrt WinRT support\n\n    This figure explains new functionality implemented with WinRT GUI. The new GUI provides an Image control,\n    and a slider panel. Slider panel holds trackbars attached to it.\n\n    Sliders are attached below the image control. Every new slider is added below the previous one.\n\n    See below the example used to generate the figure:\n    @code\n        void sample_app::MainPage::ShowWindow()\n        {\n            static cv::String windowName(\"sample\");\n            cv::winrt_initContainer(this->cvContainer);\n            cv::namedWindow(windowName); // not required\n\n            cv::Mat image = cv::imread(\"Assets/sample.jpg\");\n            cv::Mat converted = cv::Mat(image.rows, image.cols, CV_8UC4);\n            cv::cvtColor(image, converted, COLOR_BGR2BGRA);\n            cv::imshow(windowName, converted); // this will create window if it hasn't been created before\n\n            int state = 42;\n            cv::TrackbarCallback callback = [](int pos, void* userdata)\n            {\n                if (pos == 0) {\n                    cv::destroyWindow(windowName);\n                }\n            };\n            cv::TrackbarCallback callbackTwin = [](int pos, void* userdata)\n            {\n                if (pos >= 70) {\n                    cv::destroyAllWindows();\n                }\n            };\n            cv::createTrackbar(\"Sample trackbar\", windowName, &state, 100, callback);\n            cv::createTrackbar(\"Twin brother\", windowName, &state, 100, callbackTwin);\n        }\n    @endcode\n\n    @defgroup highgui_c C API\n@}\n*/\n\n///////////////////////// graphical user interface //////////////////////////\nnamespace cv\n{\n\n//! @addtogroup highgui\n//! @{\n\n//! @addtogroup highgui_window_flags\n//! @{\n\n//! Flags for cv::namedWindow\nenum WindowFlags {\n       WINDOW_NORMAL     = 0x00000000, //!< the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size.\n       WINDOW_AUTOSIZE   = 0x00000001, //!< the user cannot resize the window, the size is constrainted by the image displayed.\n       WINDOW_OPENGL     = 0x00001000, //!< window with opengl support.\n\n       WINDOW_FULLSCREEN = 1,          //!< change the window to fullscreen.\n       WINDOW_FREERATIO  = 0x00000100, //!< the image expends as much as it can (no ratio constraint).\n       WINDOW_KEEPRATIO  = 0x00000000, //!< the ratio of the image is respected.\n       WINDOW_GUI_EXPANDED=0x00000000, //!< status bar and tool bar\n       WINDOW_GUI_NORMAL = 0x00000010, //!< old fashious way\n    };\n\n//! Flags for cv::setWindowProperty / cv::getWindowProperty\nenum WindowPropertyFlags {\n       WND_PROP_FULLSCREEN   = 0, //!< fullscreen property    (can be WINDOW_NORMAL or WINDOW_FULLSCREEN).\n       WND_PROP_AUTOSIZE     = 1, //!< autosize property      (can be WINDOW_NORMAL or WINDOW_AUTOSIZE).\n       WND_PROP_ASPECT_RATIO = 2, //!< window's aspect ration (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO).\n       WND_PROP_OPENGL       = 3, //!< opengl support.\n       WND_PROP_VISIBLE      = 4, //!< checks whether the window exists and is visible\n       WND_PROP_TOPMOST      = 5, //!< property to toggle normal window being topmost or not\n       WND_PROP_VSYNC        = 6  //!< enable or disable VSYNC (in OpenGL mode)\n     };\n\n//! Mouse Events see cv::MouseCallback\nenum MouseEventTypes {\n       EVENT_MOUSEMOVE      = 0, //!< indicates that the mouse pointer has moved over the window.\n       EVENT_LBUTTONDOWN    = 1, //!< indicates that the left mouse button is pressed.\n       EVENT_RBUTTONDOWN    = 2, //!< indicates that the right mouse button is pressed.\n       EVENT_MBUTTONDOWN    = 3, //!< indicates that the middle mouse button is pressed.\n       EVENT_LBUTTONUP      = 4, //!< indicates that left mouse button is released.\n       EVENT_RBUTTONUP      = 5, //!< indicates that right mouse button is released.\n       EVENT_MBUTTONUP      = 6, //!< indicates that middle mouse button is released.\n       EVENT_LBUTTONDBLCLK  = 7, //!< indicates that left mouse button is double clicked.\n       EVENT_RBUTTONDBLCLK  = 8, //!< indicates that right mouse button is double clicked.\n       EVENT_MBUTTONDBLCLK  = 9, //!< indicates that middle mouse button is double clicked.\n       EVENT_MOUSEWHEEL     = 10,//!< positive and negative values mean forward and backward scrolling, respectively.\n       EVENT_MOUSEHWHEEL    = 11 //!< positive and negative values mean right and left scrolling, respectively.\n     };\n\n//! Mouse Event Flags see cv::MouseCallback\nenum MouseEventFlags {\n       EVENT_FLAG_LBUTTON   = 1, //!< indicates that the left mouse button is down.\n       EVENT_FLAG_RBUTTON   = 2, //!< indicates that the right mouse button is down.\n       EVENT_FLAG_MBUTTON   = 4, //!< indicates that the middle mouse button is down.\n       EVENT_FLAG_CTRLKEY   = 8, //!< indicates that CTRL Key is pressed.\n       EVENT_FLAG_SHIFTKEY  = 16,//!< indicates that SHIFT Key is pressed.\n       EVENT_FLAG_ALTKEY    = 32 //!< indicates that ALT Key is pressed.\n     };\n\n//! @} highgui_window_flags\n\n//! @addtogroup highgui_qt\n//! @{\n\n//! Qt font weight\nenum QtFontWeights {\n        QT_FONT_LIGHT           = 25, //!< Weight of 25\n        QT_FONT_NORMAL          = 50, //!< Weight of 50\n        QT_FONT_DEMIBOLD        = 63, //!< Weight of 63\n        QT_FONT_BOLD            = 75, //!< Weight of 75\n        QT_FONT_BLACK           = 87  //!< Weight of 87\n     };\n\n//! Qt font style\nenum QtFontStyles {\n        QT_STYLE_NORMAL         = 0, //!< Normal font.\n        QT_STYLE_ITALIC         = 1, //!< Italic font.\n        QT_STYLE_OBLIQUE        = 2  //!< Oblique font.\n     };\n\n//! Qt \"button\" type\nenum QtButtonTypes {\n       QT_PUSH_BUTTON   = 0,    //!< Push button.\n       QT_CHECKBOX      = 1,    //!< Checkbox button.\n       QT_RADIOBOX      = 2,    //!< Radiobox button.\n       QT_NEW_BUTTONBAR = 1024  //!< Button should create a new buttonbar\n     };\n\n//! @} highgui_qt\n\n/** @brief Callback function for mouse events. see cv::setMouseCallback\n@param event one of the cv::MouseEventTypes constants.\n@param x The x-coordinate of the mouse event.\n@param y The y-coordinate of the mouse event.\n@param flags one of the cv::MouseEventFlags constants.\n@param userdata The optional parameter.\n */\ntypedef void (*MouseCallback)(int event, int x, int y, int flags, void* userdata);\n\n/** @brief Callback function for Trackbar see cv::createTrackbar\n@param pos current position of the specified trackbar.\n@param userdata The optional parameter.\n */\ntypedef void (*TrackbarCallback)(int pos, void* userdata);\n\n/** @brief Callback function defined to be called every frame. See cv::setOpenGlDrawCallback\n@param userdata The optional parameter.\n */\ntypedef void (*OpenGlDrawCallback)(void* userdata);\n\n/** @brief Callback function for a button created by cv::createButton\n@param state current state of the button. It could be -1 for a push button, 0 or 1 for a check/radio box button.\n@param userdata The optional parameter.\n */\ntypedef void (*ButtonCallback)(int state, void* userdata);\n\n/** @brief Creates a window.\n\nThe function namedWindow creates a window that can be used as a placeholder for images and\ntrackbars. Created windows are referred to by their names.\n\nIf a window with the same name already exists, the function does nothing.\n\nYou can call cv::destroyWindow or cv::destroyAllWindows to close the window and de-allocate any associated\nmemory usage. For a simple program, you do not really have to call these functions because all the\nresources and windows of the application are closed automatically by the operating system upon exit.\n\n@note\n\nQt backend supports additional flags:\n -   **WINDOW_NORMAL or WINDOW_AUTOSIZE:** WINDOW_NORMAL enables you to resize the\n     window, whereas WINDOW_AUTOSIZE adjusts automatically the window size to fit the\n     displayed image (see imshow ), and you cannot change the window size manually.\n -   **WINDOW_FREERATIO or WINDOW_KEEPRATIO:** WINDOW_FREERATIO adjusts the image\n     with no respect to its ratio, whereas WINDOW_KEEPRATIO keeps the image ratio.\n -   **WINDOW_GUI_NORMAL or WINDOW_GUI_EXPANDED:** WINDOW_GUI_NORMAL is the old way to draw the window\n     without statusbar and toolbar, whereas WINDOW_GUI_EXPANDED is a new enhanced GUI.\nBy default, flags == WINDOW_AUTOSIZE | WINDOW_KEEPRATIO | WINDOW_GUI_EXPANDED\n\n@param winname Name of the window in the window caption that may be used as a window identifier.\n@param flags Flags of the window. The supported flags are: (cv::WindowFlags)\n */\nCV_EXPORTS_W void namedWindow(const String& winname, int flags = WINDOW_AUTOSIZE);\n\n/** @brief Destroys the specified window.\n\nThe function destroyWindow destroys the window with the given name.\n\n@param winname Name of the window to be destroyed.\n */\nCV_EXPORTS_W void destroyWindow(const String& winname);\n\n/** @brief Destroys all of the HighGUI windows.\n\nThe function destroyAllWindows destroys all of the opened HighGUI windows.\n */\nCV_EXPORTS_W void destroyAllWindows();\n\nCV_EXPORTS_W int startWindowThread();\n\n/** @brief Similar to #waitKey, but returns full key code.\n\n@note\n\nKey code is implementation specific and depends on used backend: QT/GTK/Win32/etc\n\n*/\nCV_EXPORTS_W int waitKeyEx(int delay = 0);\n\n/** @brief Waits for a pressed key.\n\nThe function waitKey waits for a key event infinitely (when \\f$\\texttt{delay}\\leq 0\\f$ ) or for delay\nmilliseconds, when it is positive. Since the OS has a minimum time between switching threads, the\nfunction will not wait exactly delay ms, it will wait at least delay ms, depending on what else is\nrunning on your computer at that time. It returns the code of the pressed key or -1 if no key was\npressed before the specified time had elapsed. To check for a key press but not wait for it, use\n#pollKey.\n\n@note The functions #waitKey and #pollKey are the only methods in HighGUI that can fetch and handle\nGUI events, so one of them needs to be called periodically for normal event processing unless\nHighGUI is used within an environment that takes care of event processing.\n\n@note The function only works if there is at least one HighGUI window created and the window is\nactive. If there are several HighGUI windows, any of them can be active.\n\n@param delay Delay in milliseconds. 0 is the special value that means \"forever\".\n */\nCV_EXPORTS_W int waitKey(int delay = 0);\n\n/** @brief Polls for a pressed key.\n\nThe function pollKey polls for a key event without waiting. It returns the code of the pressed key\nor -1 if no key was pressed since the last invocation. To wait until a key was pressed, use #waitKey.\n\n@note The functions #waitKey and #pollKey are the only methods in HighGUI that can fetch and handle\nGUI events, so one of them needs to be called periodically for normal event processing unless\nHighGUI is used within an environment that takes care of event processing.\n\n@note The function only works if there is at least one HighGUI window created and the window is\nactive. If there are several HighGUI windows, any of them can be active.\n */\nCV_EXPORTS_W int pollKey();\n\n/** @brief Displays an image in the specified window.\n\nThe function imshow displays an image in the specified window. If the window was created with the\ncv::WINDOW_AUTOSIZE flag, the image is shown with its original size, however it is still limited by the screen resolution.\nOtherwise, the image is scaled to fit the window. The function may scale the image, depending on its depth:\n\n-   If the image is 8-bit unsigned, it is displayed as is.\n-   If the image is 16-bit unsigned or 32-bit integer, the pixels are divided by 256. That is, the\n    value range [0,255\\*256] is mapped to [0,255].\n-   If the image is 32-bit or 64-bit floating-point, the pixel values are multiplied by 255. That is, the\n    value range [0,1] is mapped to [0,255].\n\nIf window was created with OpenGL support, cv::imshow also support ogl::Buffer , ogl::Texture2D and\ncuda::GpuMat as input.\n\nIf the window was not created before this function, it is assumed creating a window with cv::WINDOW_AUTOSIZE.\n\nIf you need to show an image that is bigger than the screen resolution, you will need to call namedWindow(\"\", WINDOW_NORMAL) before the imshow.\n\n@note This function should be followed by a call to cv::waitKey or cv::pollKey to perform GUI\nhousekeeping tasks that are necessary to actually show the given image and make the window respond\nto mouse and keyboard events. Otherwise, it won't display the image and the window might lock up.\nFor example, **waitKey(0)** will display the window infinitely until any keypress (it is suitable\nfor image display). **waitKey(25)** will display a frame and wait approximately 25 ms for a key\npress (suitable for displaying a video frame-by-frame). To remove the window, use cv::destroyWindow.\n\n@note\n\n[__Windows Backend Only__] Pressing Ctrl+C will copy the image to the clipboard.\n\n[__Windows Backend Only__] Pressing Ctrl+S will show a dialog to save the image.\n\n@param winname Name of the window.\n@param mat Image to be shown.\n */\nCV_EXPORTS_W void imshow(const String& winname, InputArray mat);\n\n/** @brief Resizes the window to the specified size\n\n@note\n\n-   The specified window size is for the image area. Toolbars are not counted.\n-   Only windows created without cv::WINDOW_AUTOSIZE flag can be resized.\n\n@param winname Window name.\n@param width The new window width.\n@param height The new window height.\n */\nCV_EXPORTS_W void resizeWindow(const String& winname, int width, int height);\n\n/** @overload\n@param winname Window name.\n@param size The new window size.\n*/\nCV_EXPORTS_W void resizeWindow(const String& winname, const cv::Size& size);\n\n/** @brief Moves the window to the specified position\n\n@param winname Name of the window.\n@param x The new x-coordinate of the window.\n@param y The new y-coordinate of the window.\n */\nCV_EXPORTS_W void moveWindow(const String& winname, int x, int y);\n\n/** @brief Changes parameters of a window dynamically.\n\nThe function setWindowProperty enables changing properties of a window.\n\n@param winname Name of the window.\n@param prop_id Window property to edit. The supported operation flags are: (cv::WindowPropertyFlags)\n@param prop_value New value of the window property. The supported flags are: (cv::WindowFlags)\n */\nCV_EXPORTS_W void setWindowProperty(const String& winname, int prop_id, double prop_value);\n\n/** @brief Updates window title\n@param winname Name of the window.\n@param title New title.\n*/\nCV_EXPORTS_W void setWindowTitle(const String& winname, const String& title);\n\n/** @brief Provides parameters of a window.\n\nThe function getWindowProperty returns properties of a window.\n\n@param winname Name of the window.\n@param prop_id Window property to retrieve. The following operation flags are available: (cv::WindowPropertyFlags)\n\n@sa setWindowProperty\n */\nCV_EXPORTS_W double getWindowProperty(const String& winname, int prop_id);\n\n/** @brief Provides rectangle of image in the window.\n\nThe function getWindowImageRect returns the client screen coordinates, width and height of the image rendering area.\n\n@param winname Name of the window.\n\n@sa resizeWindow moveWindow\n */\nCV_EXPORTS_W Rect getWindowImageRect(const String& winname);\n\n/** @example samples/cpp/create_mask.cpp\nThis program demonstrates using mouse events and how to make and use a mask image (black and white) .\n*/\n/** @brief Sets mouse handler for the specified window\n\n@param winname Name of the window.\n@param onMouse Callback function for mouse events. See OpenCV samples on how to specify and use the callback.\n@param userdata The optional parameter passed to the callback.\n */\nCV_EXPORTS void setMouseCallback(const String& winname, MouseCallback onMouse, void* userdata = 0);\n\n/** @brief Gets the mouse-wheel motion delta, when handling mouse-wheel events cv::EVENT_MOUSEWHEEL and\ncv::EVENT_MOUSEHWHEEL.\n\nFor regular mice with a scroll-wheel, delta will be a multiple of 120. The value 120 corresponds to\na one notch rotation of the wheel or the threshold for action to be taken and one such action should\noccur for each delta. Some high-precision mice with higher-resolution freely-rotating wheels may\ngenerate smaller values.\n\nFor cv::EVENT_MOUSEWHEEL positive and negative values mean forward and backward scrolling,\nrespectively. For cv::EVENT_MOUSEHWHEEL, where available, positive and negative values mean right and\nleft scrolling, respectively.\n\n@note\n\nMouse-wheel events are currently supported only on Windows.\n\n@param flags The mouse callback flags parameter.\n */\nCV_EXPORTS int getMouseWheelDelta(int flags);\n\n/** @brief Allows users to select a ROI on the given image.\n\nThe function creates a window and allows users to select a ROI using the mouse.\nControls: use `space` or `enter` to finish selection, use key `c` to cancel selection (function will return the zero cv::Rect).\n\n@param windowName name of the window where selection process will be shown.\n@param img image to select a ROI.\n@param showCrosshair if true crosshair of selection rectangle will be shown.\n@param fromCenter if true center of selection will match initial mouse position. In opposite case a corner of\nselection rectangle will correspont to the initial mouse position.\n@return selected ROI or empty rect if selection canceled.\n\n@note The function sets it's own mouse callback for specified window using cv::setMouseCallback(windowName, ...).\nAfter finish of work an empty callback will be set for the used window.\n */\nCV_EXPORTS_W Rect selectROI(const String& windowName, InputArray img, bool showCrosshair = true, bool fromCenter = false);\n\n/** @overload\n */\nCV_EXPORTS_W Rect selectROI(InputArray img, bool showCrosshair = true, bool fromCenter = false);\n\n/** @brief Allows users to select multiple ROIs on the given image.\n\nThe function creates a window and allows users to select multiple ROIs using the mouse.\nControls: use `space` or `enter` to finish current selection and start a new one,\nuse `esc` to terminate multiple ROI selection process.\n\n@param windowName name of the window where selection process will be shown.\n@param img image to select a ROI.\n@param boundingBoxes selected ROIs.\n@param showCrosshair if true crosshair of selection rectangle will be shown.\n@param fromCenter if true center of selection will match initial mouse position. In opposite case a corner of\nselection rectangle will correspont to the initial mouse position.\n\n@note The function sets it's own mouse callback for specified window using cv::setMouseCallback(windowName, ...).\nAfter finish of work an empty callback will be set for the used window.\n */\nCV_EXPORTS_W void selectROIs(const String& windowName, InputArray img,\n                             CV_OUT std::vector<Rect>& boundingBoxes, bool showCrosshair = true, bool fromCenter = false);\n\n/** @brief Creates a trackbar and attaches it to the specified window.\n\nThe function createTrackbar creates a trackbar (a slider or range control) with the specified name\nand range, assigns a variable value to be a position synchronized with the trackbar and specifies\nthe callback function onChange to be called on the trackbar position change. The created trackbar is\ndisplayed in the specified window winname.\n\n@note\n\n[__Qt Backend Only__] winname can be empty if the trackbar should be attached to the\ncontrol panel.\n\nClicking the label of each trackbar enables editing the trackbar values manually.\n\n@param trackbarname Name of the created trackbar.\n@param winname Name of the window that will be used as a parent of the created trackbar.\n@param value Optional pointer to an integer variable whose value reflects the position of the\nslider. Upon creation, the slider position is defined by this variable.\n@param count Maximal position of the slider. The minimal position is always 0.\n@param onChange Pointer to the function to be called every time the slider changes position. This\nfunction should be prototyped as void Foo(int,void\\*); , where the first parameter is the trackbar\nposition and the second parameter is the user data (see the next parameter). If the callback is\nthe NULL pointer, no callbacks are called, but only value is updated.\n@param userdata User data that is passed as is to the callback. It can be used to handle trackbar\nevents without using global variables.\n */\nCV_EXPORTS int createTrackbar(const String& trackbarname, const String& winname,\n                              int* value, int count,\n                              TrackbarCallback onChange = 0,\n                              void* userdata = 0);\n\n/** @brief Returns the trackbar position.\n\nThe function returns the current position of the specified trackbar.\n\n@note\n\n[__Qt Backend Only__] winname can be empty if the trackbar is attached to the control\npanel.\n\n@param trackbarname Name of the trackbar.\n@param winname Name of the window that is the parent of the trackbar.\n */\nCV_EXPORTS_W int getTrackbarPos(const String& trackbarname, const String& winname);\n\n/** @brief Sets the trackbar position.\n\nThe function sets the position of the specified trackbar in the specified window.\n\n@note\n\n[__Qt Backend Only__] winname can be empty if the trackbar is attached to the control\npanel.\n\n@param trackbarname Name of the trackbar.\n@param winname Name of the window that is the parent of trackbar.\n@param pos New position.\n */\nCV_EXPORTS_W void setTrackbarPos(const String& trackbarname, const String& winname, int pos);\n\n/** @brief Sets the trackbar maximum position.\n\nThe function sets the maximum position of the specified trackbar in the specified window.\n\n@note\n\n[__Qt Backend Only__] winname can be empty if the trackbar is attached to the control\npanel.\n\n@param trackbarname Name of the trackbar.\n@param winname Name of the window that is the parent of trackbar.\n@param maxval New maximum position.\n */\nCV_EXPORTS_W void setTrackbarMax(const String& trackbarname, const String& winname, int maxval);\n\n/** @brief Sets the trackbar minimum position.\n\nThe function sets the minimum position of the specified trackbar in the specified window.\n\n@note\n\n[__Qt Backend Only__] winname can be empty if the trackbar is attached to the control\npanel.\n\n@param trackbarname Name of the trackbar.\n@param winname Name of the window that is the parent of trackbar.\n@param minval New minimum position.\n */\nCV_EXPORTS_W void setTrackbarMin(const String& trackbarname, const String& winname, int minval);\n\n//! @addtogroup highgui_opengl OpenGL support\n//! @{\n\n/** @brief Displays OpenGL 2D texture in the specified window.\n\n@param winname Name of the window.\n@param tex OpenGL 2D texture data.\n */\nCV_EXPORTS void imshow(const String& winname, const ogl::Texture2D& tex);\n\n/** @brief Sets a callback function to be called to draw on top of displayed image.\n\nThe function setOpenGlDrawCallback can be used to draw 3D data on the window. See the example of\ncallback function below:\n@code\n    void on_opengl(void* param)\n    {\n        glLoadIdentity();\n\n        glTranslated(0.0, 0.0, -1.0);\n\n        glRotatef( 55, 1, 0, 0 );\n        glRotatef( 45, 0, 1, 0 );\n        glRotatef( 0, 0, 0, 1 );\n\n        static const int coords[6][4][3] = {\n            { { +1, -1, -1 }, { -1, -1, -1 }, { -1, +1, -1 }, { +1, +1, -1 } },\n            { { +1, +1, -1 }, { -1, +1, -1 }, { -1, +1, +1 }, { +1, +1, +1 } },\n            { { +1, -1, +1 }, { +1, -1, -1 }, { +1, +1, -1 }, { +1, +1, +1 } },\n            { { -1, -1, -1 }, { -1, -1, +1 }, { -1, +1, +1 }, { -1, +1, -1 } },\n            { { +1, -1, +1 }, { -1, -1, +1 }, { -1, -1, -1 }, { +1, -1, -1 } },\n            { { -1, -1, +1 }, { +1, -1, +1 }, { +1, +1, +1 }, { -1, +1, +1 } }\n        };\n\n        for (int i = 0; i < 6; ++i) {\n                    glColor3ub( i*20, 100+i*10, i*42 );\n                    glBegin(GL_QUADS);\n                    for (int j = 0; j < 4; ++j) {\n                            glVertex3d(0.2 * coords[i][j][0], 0.2 * coords[i][j][1], 0.2 * coords[i][j][2]);\n                    }\n                    glEnd();\n        }\n    }\n@endcode\n\n@param winname Name of the window.\n@param onOpenGlDraw Pointer to the function to be called every frame. This function should be\nprototyped as void Foo(void\\*) .\n@param userdata Pointer passed to the callback function.(__Optional__)\n */\nCV_EXPORTS void setOpenGlDrawCallback(const String& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata = 0);\n\n/** @brief Sets the specified window as current OpenGL context.\n\n@param winname Name of the window.\n */\nCV_EXPORTS void setOpenGlContext(const String& winname);\n\n/** @brief Force window to redraw its context and call draw callback ( See cv::setOpenGlDrawCallback ).\n\n@param winname Name of the window.\n */\nCV_EXPORTS void updateWindow(const String& winname);\n\n//! @} highgui_opengl\n\n//! @addtogroup highgui_qt\n//! @{\n\n/** @brief QtFont available only for Qt. See cv::fontQt\n */\nstruct QtFont\n{\n    const char* nameFont;  //!< Name of the font\n    Scalar      color;     //!< Color of the font. Scalar(blue_component, green_component, red_component[, alpha_component])\n    int         font_face; //!< See cv::QtFontStyles\n    const int*  ascii;     //!< font data and metrics\n    const int*  greek;\n    const int*  cyrillic;\n    float       hscale, vscale;\n    float       shear;     //!< slope coefficient: 0 - normal, >0 - italic\n    int         thickness; //!< See cv::QtFontWeights\n    float       dx;        //!< horizontal interval between letters\n    int         line_type; //!< PointSize\n};\n\n/** @brief Creates the font to draw a text on an image.\n\nThe function fontQt creates a cv::QtFont object. This cv::QtFont is not compatible with putText .\n\nA basic usage of this function is the following: :\n@code\n    QtFont font = fontQt(\"Times\");\n    addText( img1, \"Hello World !\", Point(50,50), font);\n@endcode\n\n@param nameFont Name of the font. The name should match the name of a system font (such as\n*Times*). If the font is not found, a default one is used.\n@param pointSize Size of the font. If not specified, equal zero or negative, the point size of the\nfont is set to a system-dependent default value. Generally, this is 12 points.\n@param color Color of the font in BGRA where A = 255 is fully transparent. Use the macro CV_RGB\nfor simplicity.\n@param weight Font weight. Available operation flags are : cv::QtFontWeights You can also specify a positive integer for better control.\n@param style Font style. Available operation flags are : cv::QtFontStyles\n@param spacing Spacing between characters. It can be negative or positive.\n */\nCV_EXPORTS QtFont fontQt(const String& nameFont, int pointSize = -1,\n                         Scalar color = Scalar::all(0), int weight = QT_FONT_NORMAL,\n                         int style = QT_STYLE_NORMAL, int spacing = 0);\n\n/** @brief Draws a text on the image.\n\nThe function addText draws *text* on the image *img* using a specific font *font* (see example cv::fontQt\n)\n\n@param img 8-bit 3-channel image where the text should be drawn.\n@param text Text to write on an image.\n@param org Point(x,y) where the text should start on an image.\n@param font Font to use to draw a text.\n */\nCV_EXPORTS void addText( const Mat& img, const String& text, Point org, const QtFont& font);\n\n/** @brief Draws a text on the image.\n\n@param img 8-bit 3-channel image where the text should be drawn.\n@param text Text to write on an image.\n@param org Point(x,y) where the text should start on an image.\n@param nameFont Name of the font. The name should match the name of a system font (such as\n*Times*). If the font is not found, a default one is used.\n@param pointSize Size of the font. If not specified, equal zero or negative, the point size of the\nfont is set to a system-dependent default value. Generally, this is 12 points.\n@param color Color of the font in BGRA where A = 255 is fully transparent.\n@param weight Font weight. Available operation flags are : cv::QtFontWeights You can also specify a positive integer for better control.\n@param style Font style. Available operation flags are : cv::QtFontStyles\n@param spacing Spacing between characters. It can be negative or positive.\n */\nCV_EXPORTS_W void addText(const Mat& img, const String& text, Point org, const String& nameFont, int pointSize = -1, Scalar color = Scalar::all(0),\n        int weight = QT_FONT_NORMAL, int style = QT_STYLE_NORMAL, int spacing = 0);\n\n/** @brief Displays a text on a window image as an overlay for a specified duration.\n\nThe function displayOverlay displays useful information/tips on top of the window for a certain\namount of time *delayms*. The function does not modify the image, displayed in the window, that is,\nafter the specified delay the original content of the window is restored.\n\n@param winname Name of the window.\n@param text Overlay text to write on a window image.\n@param delayms The period (in milliseconds), during which the overlay text is displayed. If this\nfunction is called before the previous overlay text timed out, the timer is restarted and the text\nis updated. If this value is zero, the text never disappears.\n */\nCV_EXPORTS_W void displayOverlay(const String& winname, const String& text, int delayms = 0);\n\n/** @brief Displays a text on the window statusbar during the specified period of time.\n\nThe function displayStatusBar displays useful information/tips on top of the window for a certain\namount of time *delayms* . This information is displayed on the window statusbar (the window must be\ncreated with the CV_GUI_EXPANDED flags).\n\n@param winname Name of the window.\n@param text Text to write on the window statusbar.\n@param delayms Duration (in milliseconds) to display the text. If this function is called before\nthe previous text timed out, the timer is restarted and the text is updated. If this value is\nzero, the text never disappears.\n */\nCV_EXPORTS_W void displayStatusBar(const String& winname, const String& text, int delayms = 0);\n\n/** @brief Saves parameters of the specified window.\n\nThe function saveWindowParameters saves size, location, flags, trackbars value, zoom and panning\nlocation of the window windowName.\n\n@param windowName Name of the window.\n */\nCV_EXPORTS void saveWindowParameters(const String& windowName);\n\n/** @brief Loads parameters of the specified window.\n\nThe function loadWindowParameters loads size, location, flags, trackbars value, zoom and panning\nlocation of the window windowName.\n\n@param windowName Name of the window.\n */\nCV_EXPORTS void loadWindowParameters(const String& windowName);\n\nCV_EXPORTS  int startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);\n\nCV_EXPORTS  void stopLoop();\n\n/** @brief Attaches a button to the control panel.\n\nThe function createButton attaches a button to the control panel. Each button is added to a\nbuttonbar to the right of the last button. A new buttonbar is created if nothing was attached to the\ncontrol panel before, or if the last element attached to the control panel was a trackbar or if the\nQT_NEW_BUTTONBAR flag is added to the type.\n\nSee below various examples of the cv::createButton function call: :\n@code\n    createButton(\"\",callbackButton);//create a push button \"button 0\", that will call callbackButton.\n    createButton(\"button2\",callbackButton,NULL,QT_CHECKBOX,0);\n    createButton(\"button3\",callbackButton,&value);\n    createButton(\"button5\",callbackButton1,NULL,QT_RADIOBOX);\n    createButton(\"button6\",callbackButton2,NULL,QT_PUSH_BUTTON,1);\n    createButton(\"button6\",callbackButton2,NULL,QT_PUSH_BUTTON|QT_NEW_BUTTONBAR);// create a push button in a new row\n@endcode\n\n@param  bar_name Name of the button.\n@param on_change Pointer to the function to be called every time the button changes its state.\nThis function should be prototyped as void Foo(int state,\\*void); . *state* is the current state\nof the button. It could be -1 for a push button, 0 or 1 for a check/radio box button.\n@param userdata Pointer passed to the callback function.\n@param type Optional type of the button. Available types are: (cv::QtButtonTypes)\n@param initial_button_state Default state of the button. Use for checkbox and radiobox. Its\nvalue could be 0 or 1. (__Optional__)\n*/\nCV_EXPORTS int createButton( const String& bar_name, ButtonCallback on_change,\n                             void* userdata = 0, int type = QT_PUSH_BUTTON,\n                             bool initial_button_state = false);\n\n//! @} highgui_qt\n\n//! @} highgui\n\n} // cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgcodecs/imgcodecs.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/imgcodecs.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgcodecs/imgcodecs_c.h",
    "content": "#error \"This header with legacy C API declarations has been removed from OpenCV. Legacy constants are available from legacy/constants_c.h file.\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgcodecs/ios.h",
    "content": "\n/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#import <UIKit/UIKit.h>\n#import <Accelerate/Accelerate.h>\n#import <AVFoundation/AVFoundation.h>\n#import <ImageIO/ImageIO.h>\n#include \"opencv2/core.hpp\"\n\n//! @addtogroup imgcodecs_ios\n//! @{\n\nCV_EXPORTS CGImageRef MatToCGImage(const cv::Mat& image) CF_RETURNS_RETAINED;\nCV_EXPORTS void CGImageToMat(const CGImageRef image, cv::Mat& m, bool alphaExist = false);\nCV_EXPORTS UIImage* MatToUIImage(const cv::Mat& image);\nCV_EXPORTS void UIImageToMat(const UIImage* image,\n                             cv::Mat& m, bool alphaExist = false);\n\n//! @}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgcodecs/legacy/constants_c.h",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_IMGCODECS_LEGACY_CONSTANTS_H\n#define OPENCV_IMGCODECS_LEGACY_CONSTANTS_H\n\n/* duplicate of \"ImreadModes\" enumeration for better compatibility with OpenCV 3.x */\nenum\n{\n/* 8bit, color or not */\n    CV_LOAD_IMAGE_UNCHANGED  =-1,\n/* 8bit, gray */\n    CV_LOAD_IMAGE_GRAYSCALE  =0,\n/* ?, color */\n    CV_LOAD_IMAGE_COLOR      =1,\n/* any depth, ? */\n    CV_LOAD_IMAGE_ANYDEPTH   =2,\n/* ?, any color */\n    CV_LOAD_IMAGE_ANYCOLOR   =4,\n/* ?, no rotate */\n    CV_LOAD_IMAGE_IGNORE_ORIENTATION  =128\n};\n\n/* duplicate of \"ImwriteFlags\" enumeration for better compatibility with OpenCV 3.x */\nenum\n{\n    CV_IMWRITE_JPEG_QUALITY =1,\n    CV_IMWRITE_JPEG_PROGRESSIVE =2,\n    CV_IMWRITE_JPEG_OPTIMIZE =3,\n    CV_IMWRITE_JPEG_RST_INTERVAL =4,\n    CV_IMWRITE_JPEG_LUMA_QUALITY =5,\n    CV_IMWRITE_JPEG_CHROMA_QUALITY =6,\n    CV_IMWRITE_PNG_COMPRESSION =16,\n    CV_IMWRITE_PNG_STRATEGY =17,\n    CV_IMWRITE_PNG_BILEVEL =18,\n    CV_IMWRITE_PNG_STRATEGY_DEFAULT =0,\n    CV_IMWRITE_PNG_STRATEGY_FILTERED =1,\n    CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,\n    CV_IMWRITE_PNG_STRATEGY_RLE =3,\n    CV_IMWRITE_PNG_STRATEGY_FIXED =4,\n    CV_IMWRITE_PXM_BINARY =32,\n    CV_IMWRITE_EXR_TYPE = 48,\n    CV_IMWRITE_WEBP_QUALITY =64,\n    CV_IMWRITE_PAM_TUPLETYPE = 128,\n    CV_IMWRITE_PAM_FORMAT_NULL = 0,\n    CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1,\n    CV_IMWRITE_PAM_FORMAT_GRAYSCALE = 2,\n    CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3,\n    CV_IMWRITE_PAM_FORMAT_RGB = 4,\n    CV_IMWRITE_PAM_FORMAT_RGB_ALPHA = 5,\n};\n\n#endif // OPENCV_IMGCODECS_LEGACY_CONSTANTS_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgcodecs/macosx.h",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#if !defined(__APPLE__) || !defined(__MACH__)\n#error This header should be used in macOS ObjC/Swift projects.\n#endif\n\n#import <AppKit/AppKit.h>\n#include \"opencv2/core.hpp\"\n\n//! @addtogroup imgcodecs_macosx\n//! @{\n\nCV_EXPORTS CGImageRef MatToCGImage(const cv::Mat& image) CF_RETURNS_RETAINED;\nCV_EXPORTS void CGImageToMat(const CGImageRef image, cv::Mat& m, bool alphaExist = false);\nCV_EXPORTS NSImage* MatToNSImage(const cv::Mat& image);\nCV_EXPORTS void NSImageToMat(const NSImage* image, cv::Mat& m, bool alphaExist = false);\n\n//! @}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgcodecs.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_IMGCODECS_HPP\n#define OPENCV_IMGCODECS_HPP\n\n#include \"opencv2/core.hpp\"\n\n/**\n  @defgroup imgcodecs Image file reading and writing\n  @{\n    @defgroup imgcodecs_c C API\n    @defgroup imgcodecs_flags Flags used for image file reading and writing\n    @defgroup imgcodecs_ios iOS glue\n    @defgroup imgcodecs_macosx MacOS(OSX) glue\n  @}\n*/\n\n//////////////////////////////// image codec ////////////////////////////////\nnamespace cv\n{\n\n//! @addtogroup imgcodecs\n//! @{\n\n//! @addtogroup imgcodecs_flags\n//! @{\n\n//! Imread flags\nenum ImreadModes {\n       IMREAD_UNCHANGED            = -1, //!< If set, return the loaded image as is (with alpha channel, otherwise it gets cropped). Ignore EXIF orientation.\n       IMREAD_GRAYSCALE            = 0,  //!< If set, always convert image to the single channel grayscale image (codec internal conversion).\n       IMREAD_COLOR                = 1,  //!< If set, always convert image to the 3 channel BGR color image.\n       IMREAD_ANYDEPTH             = 2,  //!< If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.\n       IMREAD_ANYCOLOR             = 4,  //!< If set, the image is read in any possible color format.\n       IMREAD_LOAD_GDAL            = 8,  //!< If set, use the gdal driver for loading the image.\n       IMREAD_REDUCED_GRAYSCALE_2  = 16, //!< If set, always convert image to the single channel grayscale image and the image size reduced 1/2.\n       IMREAD_REDUCED_COLOR_2      = 17, //!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/2.\n       IMREAD_REDUCED_GRAYSCALE_4  = 32, //!< If set, always convert image to the single channel grayscale image and the image size reduced 1/4.\n       IMREAD_REDUCED_COLOR_4      = 33, //!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/4.\n       IMREAD_REDUCED_GRAYSCALE_8  = 64, //!< If set, always convert image to the single channel grayscale image and the image size reduced 1/8.\n       IMREAD_REDUCED_COLOR_8      = 65, //!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/8.\n       IMREAD_IGNORE_ORIENTATION   = 128 //!< If set, do not rotate the image according to EXIF's orientation flag.\n     };\n\n//! Imwrite flags\nenum ImwriteFlags {\n       IMWRITE_JPEG_QUALITY        = 1,  //!< For JPEG, it can be a quality from 0 to 100 (the higher is the better). Default value is 95.\n       IMWRITE_JPEG_PROGRESSIVE    = 2,  //!< Enable JPEG features, 0 or 1, default is False.\n       IMWRITE_JPEG_OPTIMIZE       = 3,  //!< Enable JPEG features, 0 or 1, default is False.\n       IMWRITE_JPEG_RST_INTERVAL   = 4,  //!< JPEG restart interval, 0 - 65535, default is 0 - no restart.\n       IMWRITE_JPEG_LUMA_QUALITY   = 5,  //!< Separate luma quality level, 0 - 100, default is 0 - don't use.\n       IMWRITE_JPEG_CHROMA_QUALITY = 6,  //!< Separate chroma quality level, 0 - 100, default is 0 - don't use.\n       IMWRITE_PNG_COMPRESSION     = 16, //!< For PNG, it can be the compression level from 0 to 9. A higher value means a smaller size and longer compression time. If specified, strategy is changed to IMWRITE_PNG_STRATEGY_DEFAULT (Z_DEFAULT_STRATEGY). Default value is 1 (best speed setting).\n       IMWRITE_PNG_STRATEGY        = 17, //!< One of cv::ImwritePNGFlags, default is IMWRITE_PNG_STRATEGY_RLE.\n       IMWRITE_PNG_BILEVEL         = 18, //!< Binary level PNG, 0 or 1, default is 0.\n       IMWRITE_PXM_BINARY          = 32, //!< For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1.\n       IMWRITE_EXR_TYPE            = (3 << 4) + 0, /* 48 */ //!< override EXR storage type (FLOAT (FP32) is default)\n       IMWRITE_EXR_COMPRESSION     = (3 << 4) + 1, /* 49 */ //!< override EXR compression type (ZIP_COMPRESSION = 3 is default)\n       IMWRITE_WEBP_QUALITY        = 64, //!< For WEBP, it can be a quality from 1 to 100 (the higher is the better). By default (without any parameter) and for quality above 100 the lossless compression is used.\n       IMWRITE_PAM_TUPLETYPE       = 128,//!< For PAM, sets the TUPLETYPE field to the corresponding string value that is defined for the format\n       IMWRITE_TIFF_RESUNIT = 256,//!< For TIFF, use to specify which DPI resolution unit to set; see libtiff documentation for valid values\n       IMWRITE_TIFF_XDPI = 257,//!< For TIFF, use to specify the X direction DPI\n       IMWRITE_TIFF_YDPI = 258, //!< For TIFF, use to specify the Y direction DPI\n       IMWRITE_TIFF_COMPRESSION = 259, //!< For TIFF, use to specify the image compression scheme. See libtiff for integer constants corresponding to compression formats. Note, for images whose depth is CV_32F, only libtiff's SGILOG compression scheme is used. For other supported depths, the compression scheme can be specified by this flag; LZW compression is the default.\n       IMWRITE_JPEG2000_COMPRESSION_X1000 = 272 //!< For JPEG2000, use to specify the target compression rate (multiplied by 1000). The value can be from 0 to 1000. Default is 1000.\n     };\n\nenum ImwriteEXRTypeFlags {\n       /*IMWRITE_EXR_TYPE_UNIT = 0, //!< not supported */\n       IMWRITE_EXR_TYPE_HALF = 1,   //!< store as HALF (FP16)\n       IMWRITE_EXR_TYPE_FLOAT = 2   //!< store as FP32 (default)\n     };\n\nenum ImwriteEXRCompressionFlags {\n       IMWRITE_EXR_COMPRESSION_NO    = 0, //!< no compression\n       IMWRITE_EXR_COMPRESSION_RLE   = 1, //!< run length encoding\n       IMWRITE_EXR_COMPRESSION_ZIPS  = 2, //!< zlib compression, one scan line at a time\n       IMWRITE_EXR_COMPRESSION_ZIP   = 3, //!< zlib compression, in blocks of 16 scan lines\n       IMWRITE_EXR_COMPRESSION_PIZ   = 4, //!< piz-based wavelet compression\n       IMWRITE_EXR_COMPRESSION_PXR24 = 5, //!< lossy 24-bit float compression\n       IMWRITE_EXR_COMPRESSION_B44   = 6, //!< lossy 4-by-4 pixel block compression, fixed compression rate\n       IMWRITE_EXR_COMPRESSION_B44A  = 7, //!< lossy 4-by-4 pixel block compression, flat fields are compressed more\n       IMWRITE_EXR_COMPRESSION_DWAA  = 8, //!< lossy DCT based compression, in blocks of 32 scanlines. More efficient for partial buffer access. Supported since OpenEXR 2.2.0.\n       IMWRITE_EXR_COMPRESSION_DWAB  = 9, //!< lossy DCT based compression, in blocks of 256 scanlines. More efficient space wise and faster to decode full frames than DWAA_COMPRESSION. Supported since OpenEXR 2.2.0.\n     };\n\n//! Imwrite PNG specific flags used to tune the compression algorithm.\n/** These flags will be modify the way of PNG image compression and will be passed to the underlying zlib processing stage.\n\n-   The effect of IMWRITE_PNG_STRATEGY_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between IMWRITE_PNG_STRATEGY_DEFAULT and IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY.\n-   IMWRITE_PNG_STRATEGY_RLE is designed to be almost as fast as IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY, but give better compression for PNG image data.\n-   The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately.\n-   IMWRITE_PNG_STRATEGY_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications.\n*/\nenum ImwritePNGFlags {\n       IMWRITE_PNG_STRATEGY_DEFAULT      = 0, //!< Use this value for normal data.\n       IMWRITE_PNG_STRATEGY_FILTERED     = 1, //!< Use this value for data produced by a filter (or predictor).Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better.\n       IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY = 2, //!< Use this value to force Huffman encoding only (no string match).\n       IMWRITE_PNG_STRATEGY_RLE          = 3, //!< Use this value to limit match distances to one (run-length encoding).\n       IMWRITE_PNG_STRATEGY_FIXED        = 4  //!< Using this value prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications.\n     };\n\n//! Imwrite PAM specific tupletype flags used to define the 'TUPETYPE' field of a PAM file.\nenum ImwritePAMFlags {\n       IMWRITE_PAM_FORMAT_NULL = 0,\n       IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1,\n       IMWRITE_PAM_FORMAT_GRAYSCALE = 2,\n       IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3,\n       IMWRITE_PAM_FORMAT_RGB = 4,\n       IMWRITE_PAM_FORMAT_RGB_ALPHA = 5,\n     };\n\n//! @} imgcodecs_flags\n\n/** @brief Loads an image from a file.\n\n@anchor imread\n\nThe function imread loads an image from the specified file and returns it. If the image cannot be\nread (because of missing file, improper permissions, unsupported or invalid format), the function\nreturns an empty matrix ( Mat::data==NULL ).\n\nCurrently, the following file formats are supported:\n\n-   Windows bitmaps - \\*.bmp, \\*.dib (always supported)\n-   JPEG files - \\*.jpeg, \\*.jpg, \\*.jpe (see the *Note* section)\n-   JPEG 2000 files - \\*.jp2 (see the *Note* section)\n-   Portable Network Graphics - \\*.png (see the *Note* section)\n-   WebP - \\*.webp (see the *Note* section)\n-   Portable image format - \\*.pbm, \\*.pgm, \\*.ppm \\*.pxm, \\*.pnm (always supported)\n-   PFM files - \\*.pfm (see the *Note* section)\n-   Sun rasters - \\*.sr, \\*.ras (always supported)\n-   TIFF files - \\*.tiff, \\*.tif (see the *Note* section)\n-   OpenEXR Image files - \\*.exr (see the *Note* section)\n-   Radiance HDR - \\*.hdr, \\*.pic (always supported)\n-   Raster and Vector geospatial data supported by GDAL (see the *Note* section)\n\n@note\n-   The function determines the type of an image by the content, not by the file extension.\n-   In the case of color images, the decoded images will have the channels stored in **B G R** order.\n-   When using IMREAD_GRAYSCALE, the codec's internal grayscale conversion will be used, if available.\n    Results may differ to the output of cvtColor()\n-   On Microsoft Windows\\* OS and MacOSX\\*, the codecs shipped with an OpenCV image (libjpeg,\n    libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs,\n    and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware\n    that currently these native image loaders give images with different pixel values because of\n    the color management embedded into MacOSX.\n-   On Linux\\*, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for\n    codecs supplied with an OS image. Install the relevant packages (do not forget the development\n    files, for example, \"libjpeg-dev\", in Debian\\* and Ubuntu\\*) to get the codec support or turn\n    on the OPENCV_BUILD_3RDPARTY_LIBS flag in CMake.\n-   In the case you set *WITH_GDAL* flag to true in CMake and @ref IMREAD_LOAD_GDAL to load the image,\n    then the [GDAL](http://www.gdal.org) driver will be used in order to decode the image, supporting\n    the following formats: [Raster](http://www.gdal.org/formats_list.html),\n    [Vector](http://www.gdal.org/ogr_formats.html).\n-   If EXIF information is embedded in the image file, the EXIF orientation will be taken into account\n    and thus the image will be rotated accordingly except if the flags @ref IMREAD_IGNORE_ORIENTATION\n    or @ref IMREAD_UNCHANGED are passed.\n-   Use the IMREAD_UNCHANGED flag to keep the floating point values from PFM image.\n-   By default number of pixels must be less than 2^30. Limit can be set using system\n    variable OPENCV_IO_MAX_IMAGE_PIXELS\n\n@param filename Name of file to be loaded.\n@param flags Flag that can take values of cv::ImreadModes\n*/\nCV_EXPORTS_W Mat imread( const String& filename, int flags = IMREAD_COLOR );\n\n/** @brief Loads a multi-page image from a file.\n\nThe function imreadmulti loads a multi-page image from the specified file into a vector of Mat objects.\n@param filename Name of file to be loaded.\n@param flags Flag that can take values of cv::ImreadModes, default with cv::IMREAD_ANYCOLOR.\n@param mats A vector of Mat objects holding each page, if more than one.\n@sa cv::imread\n*/\nCV_EXPORTS_W bool imreadmulti(const String& filename, CV_OUT std::vector<Mat>& mats, int flags = IMREAD_ANYCOLOR);\n\n/** @brief Loads a of images of a multi-page image from a file.\n\nThe function imreadmulti loads a specified range from a multi-page image from the specified file into a vector of Mat objects.\n@param filename Name of file to be loaded.\n@param start Start index of the image to load\n@param count Count number of images to load\n@param flags Flag that can take values of cv::ImreadModes, default with cv::IMREAD_ANYCOLOR.\n@param mats A vector of Mat objects holding each page, if more than one.\n@sa cv::imread\n*/\nCV_EXPORTS_W bool imreadmulti(const String& filename, CV_OUT std::vector<Mat>& mats, int start, int count, int flags = IMREAD_ANYCOLOR);\n\n/** @brief Returns the number of images inside the give file\n\nThe function imcount will return the number of pages in a multi-page image, or 1 for single-page images\n@param filename Name of file to be loaded.\n@param flags Flag that can take values of cv::ImreadModes, default with cv::IMREAD_ANYCOLOR.\n*/\nCV_EXPORTS_W size_t imcount(const String& filename, int flags = IMREAD_ANYCOLOR);\n\n/** @brief Saves an image to a specified file.\n\nThe function imwrite saves the image to the specified file. The image format is chosen based on the\nfilename extension (see cv::imread for the list of extensions). In general, only 8-bit\nsingle-channel or 3-channel (with 'BGR' channel order) images\ncan be saved using this function, with these exceptions:\n\n- 16-bit unsigned (CV_16U) images can be saved in the case of PNG, JPEG 2000, and TIFF formats\n- 32-bit float (CV_32F) images can be saved in PFM, TIFF, OpenEXR, and Radiance HDR formats;\n  3-channel (CV_32FC3) TIFF images will be saved using the LogLuv high dynamic range encoding\n  (4 bytes per pixel)\n- PNG images with an alpha channel can be saved using this function. To do this, create\n8-bit (or 16-bit) 4-channel image BGRA, where the alpha channel goes last. Fully transparent pixels\nshould have alpha set to 0, fully opaque pixels should have alpha set to 255/65535 (see the code sample below).\n- Multiple images (vector of Mat) can be saved in TIFF format (see the code sample below).\n\nIf the image format is not supported, the image will be converted to 8-bit unsigned (CV_8U) and saved that way.\n\nIf the format, depth or channel order is different, use\nMat::convertTo and cv::cvtColor to convert it before saving. Or, use the universal FileStorage I/O\nfunctions to save the image to XML or YAML format.\n\nThe sample below shows how to create a BGRA image, how to set custom compression parameters and save it to a PNG file.\nIt also demonstrates how to save multiple images in a TIFF file:\n@include snippets/imgcodecs_imwrite.cpp\n@param filename Name of the file.\n@param img (Mat or vector of Mat) Image or Images to be saved.\n@param params Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::ImwriteFlags\n*/\nCV_EXPORTS_W bool imwrite( const String& filename, InputArray img,\n              const std::vector<int>& params = std::vector<int>());\n\n/// @overload multi-image overload for bindings\nCV_WRAP static inline\nbool imwritemulti(const String& filename, InputArrayOfArrays img,\n                  const std::vector<int>& params = std::vector<int>())\n{\n    return imwrite(filename, img, params);\n}\n\n/** @brief Reads an image from a buffer in memory.\n\nThe function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or\ncontains invalid data, the function returns an empty matrix ( Mat::data==NULL ).\n\nSee cv::imread for the list of supported formats and flags description.\n\n@note In the case of color images, the decoded images will have the channels stored in **B G R** order.\n@param buf Input array or vector of bytes.\n@param flags The same flags as in cv::imread, see cv::ImreadModes.\n*/\nCV_EXPORTS_W Mat imdecode( InputArray buf, int flags );\n\n/** @overload\n@param buf\n@param flags\n@param dst The optional output placeholder for the decoded matrix. It can save the image\nreallocations when the function is called repeatedly for images of the same size.\n*/\nCV_EXPORTS Mat imdecode( InputArray buf, int flags, Mat* dst);\n\n/** @brief Encodes an image into a memory buffer.\n\nThe function imencode compresses the image and stores it in the memory buffer that is resized to fit the\nresult. See cv::imwrite for the list of supported formats and flags description.\n\n@param ext File extension that defines the output format.\n@param img Image to be written.\n@param buf Output buffer resized to fit the compressed image.\n@param params Format-specific parameters. See cv::imwrite and cv::ImwriteFlags.\n*/\nCV_EXPORTS_W bool imencode( const String& ext, InputArray img,\n                            CV_OUT std::vector<uchar>& buf,\n                            const std::vector<int>& params = std::vector<int>());\n\n/** @brief Returns true if the specified image can be decoded by OpenCV\n\n@param filename File name of the image\n*/\nCV_EXPORTS_W bool haveImageReader( const String& filename );\n\n/** @brief Returns true if an image with the specified filename can be encoded by OpenCV\n\n @param filename File name of the image\n */\nCV_EXPORTS_W bool haveImageWriter( const String& filename );\n\n\n//! @} imgcodecs\n\n} // cv\n\n#endif //OPENCV_IMGCODECS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgproc/bindings.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_IMGPROC_BINDINGS_HPP\n#define OPENCV_IMGPROC_BINDINGS_HPP\n\n// This file contains special overloads for OpenCV bindings\n// No need to use these functions in C++ code.\n\nnamespace cv {\n\n/** @brief Finds lines in a binary image using the standard Hough transform and get accumulator.\n *\n * @note This function is for bindings use only. Use original function in C++ code\n *\n * @sa HoughLines\n */\nCV_WRAP static inline\nvoid HoughLinesWithAccumulator(\n        InputArray image, OutputArray lines,\n        double rho, double theta, int threshold,\n        double srn = 0, double stn = 0,\n        double min_theta = 0, double max_theta = CV_PI\n)\n{\n    std::vector<Vec3f> lines_acc;\n    HoughLines(image, lines_acc, rho, theta, threshold, srn, stn, min_theta, max_theta);\n    Mat(lines_acc).copyTo(lines);\n}\n\n}  // namespace\n\n#endif  // OPENCV_IMGPROC_BINDINGS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgproc/detail/gcgraph.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_IMGPROC_DETAIL_GCGRAPH_HPP\n#define OPENCV_IMGPROC_DETAIL_GCGRAPH_HPP\n\n//! @cond IGNORED\n\nnamespace cv { namespace detail {\ntemplate <class TWeight> class GCGraph\n{\npublic:\n    GCGraph();\n    GCGraph( unsigned int vtxCount, unsigned int edgeCount );\n    ~GCGraph();\n    void create( unsigned int vtxCount, unsigned int edgeCount );\n    int addVtx();\n    void addEdges( int i, int j, TWeight w, TWeight revw );\n    void addTermWeights( int i, TWeight sourceW, TWeight sinkW );\n    TWeight maxFlow();\n    bool inSourceSegment( int i );\nprivate:\n    class Vtx\n    {\n    public:\n        Vtx *next; // initialized and used in maxFlow() only\n        int parent;\n        int first;\n        int ts;\n        int dist;\n        TWeight weight;\n        uchar t;\n    };\n    class Edge\n    {\n    public:\n        int dst;\n        int next;\n        TWeight weight;\n    };\n\n    std::vector<Vtx> vtcs;\n    std::vector<Edge> edges;\n    TWeight flow;\n};\n\ntemplate <class TWeight>\nGCGraph<TWeight>::GCGraph()\n{\n    flow = 0;\n}\ntemplate <class TWeight>\nGCGraph<TWeight>::GCGraph( unsigned int vtxCount, unsigned int edgeCount )\n{\n    create( vtxCount, edgeCount );\n}\ntemplate <class TWeight>\nGCGraph<TWeight>::~GCGraph()\n{\n}\ntemplate <class TWeight>\nvoid GCGraph<TWeight>::create( unsigned int vtxCount, unsigned int edgeCount )\n{\n    vtcs.reserve( vtxCount );\n    edges.reserve( edgeCount + 2 );\n    flow = 0;\n}\n\ntemplate <class TWeight>\nint GCGraph<TWeight>::addVtx()\n{\n    Vtx v;\n    memset( &v, 0, sizeof(Vtx));\n    vtcs.push_back(v);\n    return (int)vtcs.size() - 1;\n}\n\ntemplate <class TWeight>\nvoid GCGraph<TWeight>::addEdges( int i, int j, TWeight w, TWeight revw )\n{\n    CV_Assert( i>=0 && i<(int)vtcs.size() );\n    CV_Assert( j>=0 && j<(int)vtcs.size() );\n    CV_Assert( w>=0 && revw>=0 );\n    CV_Assert( i != j );\n\n    if( !edges.size() )\n        edges.resize( 2 );\n\n    Edge fromI, toI;\n    fromI.dst = j;\n    fromI.next = vtcs[i].first;\n    fromI.weight = w;\n    vtcs[i].first = (int)edges.size();\n    edges.push_back( fromI );\n\n    toI.dst = i;\n    toI.next = vtcs[j].first;\n    toI.weight = revw;\n    vtcs[j].first = (int)edges.size();\n    edges.push_back( toI );\n}\n\ntemplate <class TWeight>\nvoid GCGraph<TWeight>::addTermWeights( int i, TWeight sourceW, TWeight sinkW )\n{\n    CV_Assert( i>=0 && i<(int)vtcs.size() );\n\n    TWeight dw = vtcs[i].weight;\n    if( dw > 0 )\n        sourceW += dw;\n    else\n        sinkW -= dw;\n    flow += (sourceW < sinkW) ? sourceW : sinkW;\n    vtcs[i].weight = sourceW - sinkW;\n}\n\ntemplate <class TWeight>\nTWeight GCGraph<TWeight>::maxFlow()\n{\n    CV_Assert(!vtcs.empty());\n    CV_Assert(!edges.empty());\n    const int TERMINAL = -1, ORPHAN = -2;\n    Vtx stub, *nilNode = &stub, *first = nilNode, *last = nilNode;\n    int curr_ts = 0;\n    stub.next = nilNode;\n    Vtx *vtxPtr = &vtcs[0];\n    Edge *edgePtr = &edges[0];\n\n    std::vector<Vtx*> orphans;\n\n    // initialize the active queue and the graph vertices\n    for( int i = 0; i < (int)vtcs.size(); i++ )\n    {\n        Vtx* v = vtxPtr + i;\n        v->ts = 0;\n        if( v->weight != 0 )\n        {\n            last = last->next = v;\n            v->dist = 1;\n            v->parent = TERMINAL;\n            v->t = v->weight < 0;\n        }\n        else\n            v->parent = 0;\n    }\n    first = first->next;\n    last->next = nilNode;\n    nilNode->next = 0;\n\n    // run the search-path -> augment-graph -> restore-trees loop\n    for(;;)\n    {\n        Vtx* v, *u;\n        int e0 = -1, ei = 0, ej = 0;\n        TWeight minWeight, weight;\n        uchar vt;\n\n        // grow S & T search trees, find an edge connecting them\n        while( first != nilNode )\n        {\n            v = first;\n            if( v->parent )\n            {\n                vt = v->t;\n                for( ei = v->first; ei != 0; ei = edgePtr[ei].next )\n                {\n                    if( edgePtr[ei^vt].weight == 0 )\n                        continue;\n                    u = vtxPtr+edgePtr[ei].dst;\n                    if( !u->parent )\n                    {\n                        u->t = vt;\n                        u->parent = ei ^ 1;\n                        u->ts = v->ts;\n                        u->dist = v->dist + 1;\n                        if( !u->next )\n                        {\n                            u->next = nilNode;\n                            last = last->next = u;\n                        }\n                        continue;\n                    }\n\n                    if( u->t != vt )\n                    {\n                        e0 = ei ^ vt;\n                        break;\n                    }\n\n                    if( u->dist > v->dist+1 && u->ts <= v->ts )\n                    {\n                        // reassign the parent\n                        u->parent = ei ^ 1;\n                        u->ts = v->ts;\n                        u->dist = v->dist + 1;\n                    }\n                }\n                if( e0 > 0 )\n                    break;\n            }\n            // exclude the vertex from the active list\n            first = first->next;\n            v->next = 0;\n        }\n\n        if( e0 <= 0 )\n            break;\n\n        // find the minimum edge weight along the path\n        minWeight = edgePtr[e0].weight;\n        CV_Assert( minWeight > 0 );\n        // k = 1: source tree, k = 0: destination tree\n        for( int k = 1; k >= 0; k-- )\n        {\n            for( v = vtxPtr+edgePtr[e0^k].dst;; v = vtxPtr+edgePtr[ei].dst )\n            {\n                if( (ei = v->parent) < 0 )\n                    break;\n                weight = edgePtr[ei^k].weight;\n                minWeight = MIN(minWeight, weight);\n                CV_Assert( minWeight > 0 );\n            }\n            weight = fabs(v->weight);\n            minWeight = MIN(minWeight, weight);\n            CV_Assert( minWeight > 0 );\n        }\n\n        // modify weights of the edges along the path and collect orphans\n        edgePtr[e0].weight -= minWeight;\n        edgePtr[e0^1].weight += minWeight;\n        flow += minWeight;\n\n        // k = 1: source tree, k = 0: destination tree\n        for( int k = 1; k >= 0; k-- )\n        {\n            for( v = vtxPtr+edgePtr[e0^k].dst;; v = vtxPtr+edgePtr[ei].dst )\n            {\n                if( (ei = v->parent) < 0 )\n                    break;\n                edgePtr[ei^(k^1)].weight += minWeight;\n                if( (edgePtr[ei^k].weight -= minWeight) == 0 )\n                {\n                    orphans.push_back(v);\n                    v->parent = ORPHAN;\n                }\n            }\n\n            v->weight = v->weight + minWeight*(1-k*2);\n            if( v->weight == 0 )\n            {\n               orphans.push_back(v);\n               v->parent = ORPHAN;\n            }\n        }\n\n        // restore the search trees by finding new parents for the orphans\n        curr_ts++;\n        while( !orphans.empty() )\n        {\n            Vtx* v2 = orphans.back();\n            orphans.pop_back();\n\n            int d, minDist = INT_MAX;\n            e0 = 0;\n            vt = v2->t;\n\n            for( ei = v2->first; ei != 0; ei = edgePtr[ei].next )\n            {\n                if( edgePtr[ei^(vt^1)].weight == 0 )\n                    continue;\n                u = vtxPtr+edgePtr[ei].dst;\n                if( u->t != vt || u->parent == 0 )\n                    continue;\n                // compute the distance to the tree root\n                for( d = 0;; )\n                {\n                    if( u->ts == curr_ts )\n                    {\n                        d += u->dist;\n                        break;\n                    }\n                    ej = u->parent;\n                    d++;\n                    if( ej < 0 )\n                    {\n                        if( ej == ORPHAN )\n                            d = INT_MAX-1;\n                        else\n                        {\n                            u->ts = curr_ts;\n                            u->dist = 1;\n                        }\n                        break;\n                    }\n                    u = vtxPtr+edgePtr[ej].dst;\n                }\n\n                // update the distance\n                if( ++d < INT_MAX )\n                {\n                    if( d < minDist )\n                    {\n                        minDist = d;\n                        e0 = ei;\n                    }\n                    for( u = vtxPtr+edgePtr[ei].dst; u->ts != curr_ts; u = vtxPtr+edgePtr[u->parent].dst )\n                    {\n                        u->ts = curr_ts;\n                        u->dist = --d;\n                    }\n                }\n            }\n\n            if( (v2->parent = e0) > 0 )\n            {\n                v2->ts = curr_ts;\n                v2->dist = minDist;\n                continue;\n            }\n\n            /* no parent is found */\n            v2->ts = 0;\n            for( ei = v2->first; ei != 0; ei = edgePtr[ei].next )\n            {\n                u = vtxPtr+edgePtr[ei].dst;\n                ej = u->parent;\n                if( u->t != vt || !ej )\n                    continue;\n                if( edgePtr[ei^(vt^1)].weight && !u->next )\n                {\n                    u->next = nilNode;\n                    last = last->next = u;\n                }\n                if( ej > 0 && vtxPtr+edgePtr[ej].dst == v2 )\n                {\n                    orphans.push_back(u);\n                    u->parent = ORPHAN;\n                }\n            }\n        }\n    }\n    return flow;\n}\n\ntemplate <class TWeight>\nbool GCGraph<TWeight>::inSourceSegment( int i )\n{\n    CV_Assert( i>=0 && i<(int)vtcs.size() );\n    return vtcs[i].t == 0;\n}\n\n}} // namespace detail, cv\n\n\n//! @endcond\n\n#endif  // OPENCV_IMGPROC_DETAIL_GCGRAPH_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgproc/hal/hal.hpp",
    "content": "#ifndef CV_IMGPROC_HAL_HPP\n#define CV_IMGPROC_HAL_HPP\n\n#include \"opencv2/core/cvdef.h\"\n#include \"opencv2/core/cvstd.hpp\"\n#include \"opencv2/core/hal/interface.h\"\n\nnamespace cv { namespace hal {\n\n//! @addtogroup imgproc_hal_functions\n//! @{\n\n//---------------------------\n//! @cond IGNORED\n\nstruct CV_EXPORTS Filter2D\n{\n    CV_DEPRECATED static Ptr<hal::Filter2D> create(uchar * , size_t , int ,\n                                     int , int ,\n                                     int , int ,\n                                     int , int ,\n                                     int , double ,\n                                     int , int ,\n                                     bool , bool );\n    virtual void apply(uchar * , size_t ,\n                       uchar * , size_t ,\n                       int , int ,\n                       int , int ,\n                       int , int ) = 0;\n    virtual ~Filter2D() {}\n};\n\nstruct CV_EXPORTS SepFilter2D\n{\n    CV_DEPRECATED static Ptr<hal::SepFilter2D> create(int , int , int ,\n                                        uchar * , int ,\n                                        uchar * , int ,\n                                        int , int ,\n                                        double , int );\n    virtual void apply(uchar * , size_t ,\n                       uchar * , size_t ,\n                       int , int ,\n                       int , int ,\n                       int , int ) = 0;\n    virtual ~SepFilter2D() {}\n};\n\n\nstruct CV_EXPORTS Morph\n{\n    CV_DEPRECATED static Ptr<hal::Morph> create(int , int , int , int , int ,\n                                    int , uchar * , size_t ,\n                                    int , int ,\n                                    int , int ,\n                                    int , const double *,\n                                    int , bool , bool );\n    virtual void apply(uchar * , size_t , uchar * , size_t , int , int ,\n                       int , int , int , int ,\n                       int , int , int , int ) = 0;\n    virtual ~Morph() {}\n};\n\n//! @endcond\n//---------------------------\n\nCV_EXPORTS void filter2D(int stype, int dtype, int kernel_type,\n                         uchar * src_data, size_t src_step,\n                         uchar * dst_data, size_t dst_step,\n                         int width, int height,\n                         int full_width, int full_height,\n                         int offset_x, int offset_y,\n                         uchar * kernel_data, size_t kernel_step,\n                         int kernel_width, int kernel_height,\n                         int anchor_x, int anchor_y,\n                         double delta, int borderType,\n                         bool isSubmatrix);\n\nCV_EXPORTS void sepFilter2D(int stype, int dtype, int ktype,\n                            uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int full_width, int full_height,\n                            int offset_x, int offset_y,\n                            uchar * kernelx_data, int kernelx_len,\n                            uchar * kernely_data, int kernely_len,\n                            int anchor_x, int anchor_y,\n                            double delta, int borderType);\n\nCV_EXPORTS void morph(int op, int src_type, int dst_type,\n                      uchar * src_data, size_t src_step,\n                      uchar * dst_data, size_t dst_step,\n                      int width, int height,\n                      int roi_width, int roi_height, int roi_x, int roi_y,\n                      int roi_width2, int roi_height2, int roi_x2, int roi_y2,\n                      int kernel_type, uchar * kernel_data, size_t kernel_step,\n                      int kernel_width, int kernel_height, int anchor_x, int anchor_y,\n                      int borderType, const double borderValue[4],\n                      int iterations, bool isSubmatrix);\n\n\nCV_EXPORTS void resize(int src_type,\n                       const uchar * src_data, size_t src_step, int src_width, int src_height,\n                       uchar * dst_data, size_t dst_step, int dst_width, int dst_height,\n                       double inv_scale_x, double inv_scale_y, int interpolation);\n\nCV_EXPORTS void warpAffine(int src_type,\n                           const uchar * src_data, size_t src_step, int src_width, int src_height,\n                           uchar * dst_data, size_t dst_step, int dst_width, int dst_height,\n                           const double M[6], int interpolation, int borderType, const double borderValue[4]);\n\nCV_EXPORTS void warpPerspective(int src_type,\n                               const uchar * src_data, size_t src_step, int src_width, int src_height,\n                               uchar * dst_data, size_t dst_step, int dst_width, int dst_height,\n                               const double M[9], int interpolation, int borderType, const double borderValue[4]);\n\nCV_EXPORTS void cvtBGRtoBGR(const uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int depth, int scn, int dcn, bool swapBlue);\n\nCV_EXPORTS void cvtBGRtoBGR5x5(const uchar * src_data, size_t src_step,\n                               uchar * dst_data, size_t dst_step,\n                               int width, int height,\n                               int scn, bool swapBlue, int greenBits);\n\nCV_EXPORTS void cvtBGR5x5toBGR(const uchar * src_data, size_t src_step,\n                               uchar * dst_data, size_t dst_step,\n                               int width, int height,\n                               int dcn, bool swapBlue, int greenBits);\n\nCV_EXPORTS void cvtBGRtoGray(const uchar * src_data, size_t src_step,\n                             uchar * dst_data, size_t dst_step,\n                             int width, int height,\n                             int depth, int scn, bool swapBlue);\n\nCV_EXPORTS void cvtGraytoBGR(const uchar * src_data, size_t src_step,\n                             uchar * dst_data, size_t dst_step,\n                             int width, int height,\n                             int depth, int dcn);\n\nCV_EXPORTS void cvtBGR5x5toGray(const uchar * src_data, size_t src_step,\n                                uchar * dst_data, size_t dst_step,\n                                int width, int height,\n                                int greenBits);\n\nCV_EXPORTS void cvtGraytoBGR5x5(const uchar * src_data, size_t src_step,\n                                uchar * dst_data, size_t dst_step,\n                                int width, int height,\n                                int greenBits);\nCV_EXPORTS void cvtBGRtoYUV(const uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int depth, int scn, bool swapBlue, bool isCbCr);\n\nCV_EXPORTS void cvtYUVtoBGR(const uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int depth, int dcn, bool swapBlue, bool isCbCr);\n\nCV_EXPORTS void cvtBGRtoXYZ(const uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int depth, int scn, bool swapBlue);\n\nCV_EXPORTS void cvtXYZtoBGR(const uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int depth, int dcn, bool swapBlue);\n\nCV_EXPORTS void cvtBGRtoHSV(const uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int depth, int scn, bool swapBlue, bool isFullRange, bool isHSV);\n\nCV_EXPORTS void cvtHSVtoBGR(const uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int depth, int dcn, bool swapBlue, bool isFullRange, bool isHSV);\n\nCV_EXPORTS void cvtBGRtoLab(const uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int depth, int scn, bool swapBlue, bool isLab, bool srgb);\n\nCV_EXPORTS void cvtLabtoBGR(const uchar * src_data, size_t src_step,\n                            uchar * dst_data, size_t dst_step,\n                            int width, int height,\n                            int depth, int dcn, bool swapBlue, bool isLab, bool srgb);\n\nCV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step,\n                                    uchar * dst_data, size_t dst_step,\n                                    int dst_width, int dst_height,\n                                    int dcn, bool swapBlue, int uIdx);\n\n//! Separate Y and UV planes\nCV_EXPORTS void cvtTwoPlaneYUVtoBGR(const uchar * y_data, const uchar * uv_data, size_t src_step,\n                                    uchar * dst_data, size_t dst_step,\n                                    int dst_width, int dst_height,\n                                    int dcn, bool swapBlue, int uIdx);\n\nCV_EXPORTS void cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step,\n                                      uchar * dst_data, size_t dst_step,\n                                      int dst_width, int dst_height,\n                                      int dcn, bool swapBlue, int uIdx);\n\nCV_EXPORTS void cvtBGRtoThreePlaneYUV(const uchar * src_data, size_t src_step,\n                                      uchar * dst_data, size_t dst_step,\n                                      int width, int height,\n                                      int scn, bool swapBlue, int uIdx);\n\n//! Separate Y and UV planes\nCV_EXPORTS void cvtBGRtoTwoPlaneYUV(const uchar * src_data, size_t src_step,\n                                    uchar * y_data, uchar * uv_data, size_t dst_step,\n                                    int width, int height,\n                                    int scn, bool swapBlue, int uIdx);\n\nCV_EXPORTS void cvtOnePlaneYUVtoBGR(const uchar * src_data, size_t src_step,\n                                    uchar * dst_data, size_t dst_step,\n                                    int width, int height,\n                                    int dcn, bool swapBlue, int uIdx, int ycn);\n\nCV_EXPORTS void cvtRGBAtoMultipliedRGBA(const uchar * src_data, size_t src_step,\n                                        uchar * dst_data, size_t dst_step,\n                                        int width, int height);\n\nCV_EXPORTS void cvtMultipliedRGBAtoRGBA(const uchar * src_data, size_t src_step,\n                                        uchar * dst_data, size_t dst_step,\n                                        int width, int height);\n\nCV_EXPORTS void integral(int depth, int sdepth, int sqdepth,\n                         const uchar* src, size_t srcstep,\n                         uchar* sum, size_t sumstep,\n                         uchar* sqsum, size_t sqsumstep,\n                         uchar* tilted, size_t tstep,\n                         int width, int height, int cn);\n\n//! @}\n\n}}\n\n#endif // CV_IMGPROC_HAL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgproc/hal/interface.h",
    "content": "#ifndef OPENCV_IMGPROC_HAL_INTERFACE_H\n#define OPENCV_IMGPROC_HAL_INTERFACE_H\n\n//! @addtogroup imgproc_hal_interface\n//! @{\n\n//! @name Interpolation modes\n//! @sa cv::InterpolationFlags\n//! @{\n#define CV_HAL_INTER_NEAREST 0\n#define CV_HAL_INTER_LINEAR 1\n#define CV_HAL_INTER_CUBIC 2\n#define CV_HAL_INTER_AREA 3\n#define CV_HAL_INTER_LANCZOS4 4\n//! @}\n\n//! @name Morphology operations\n//! @sa cv::MorphTypes\n//! @{\n#define CV_HAL_MORPH_ERODE 0\n#define CV_HAL_MORPH_DILATE 1\n//! @}\n\n//! @name Threshold types\n//! @sa cv::ThresholdTypes\n//! @{\n#define CV_HAL_THRESH_BINARY      0\n#define CV_HAL_THRESH_BINARY_INV  1\n#define CV_HAL_THRESH_TRUNC       2\n#define CV_HAL_THRESH_TOZERO      3\n#define CV_HAL_THRESH_TOZERO_INV  4\n#define CV_HAL_THRESH_MASK        7\n#define CV_HAL_THRESH_OTSU        8\n#define CV_HAL_THRESH_TRIANGLE    16\n//! @}\n\n//! @name Adaptive threshold algorithm\n//! @sa cv::AdaptiveThresholdTypes\n//! @{\n#define CV_HAL_ADAPTIVE_THRESH_MEAN_C     0\n#define CV_HAL_ADAPTIVE_THRESH_GAUSSIAN_C 1\n//! @}\n\n//! @}\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgproc/imgproc.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/imgproc.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgproc/imgproc_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_IMGPROC_IMGPROC_C_H\n#define OPENCV_IMGPROC_IMGPROC_C_H\n\n#include \"opencv2/imgproc/types_c.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** @addtogroup imgproc_c\n@{\n*/\n\n/*********************** Background statistics accumulation *****************************/\n\n/** @brief Adds image to accumulator\n@see cv::accumulate\n*/\nCVAPI(void)  cvAcc( const CvArr* image, CvArr* sum,\n                   const CvArr* mask CV_DEFAULT(NULL) );\n\n/** @brief Adds squared image to accumulator\n@see cv::accumulateSquare\n*/\nCVAPI(void)  cvSquareAcc( const CvArr* image, CvArr* sqsum,\n                         const CvArr* mask CV_DEFAULT(NULL) );\n\n/** @brief Adds a product of two images to accumulator\n@see cv::accumulateProduct\n*/\nCVAPI(void)  cvMultiplyAcc( const CvArr* image1, const CvArr* image2, CvArr* acc,\n                           const CvArr* mask CV_DEFAULT(NULL) );\n\n/** @brief Adds image to accumulator with weights: acc = acc*(1-alpha) + image*alpha\n@see cv::accumulateWeighted\n*/\nCVAPI(void)  cvRunningAvg( const CvArr* image, CvArr* acc, double alpha,\n                          const CvArr* mask CV_DEFAULT(NULL) );\n\n/****************************************************************************************\\\n*                                    Image Processing                                    *\n\\****************************************************************************************/\n\n/** Copies source 2D array inside of the larger destination array and\n   makes a border of the specified type (IPL_BORDER_*) around the copied area. */\nCVAPI(void) cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset,\n                              int bordertype, CvScalar value CV_DEFAULT(cvScalarAll(0)));\n\n/** @brief Smooths the image in one of several ways.\n\n@param src The source image\n@param dst The destination image\n@param smoothtype Type of the smoothing, see SmoothMethod_c\n@param size1 The first parameter of the smoothing operation, the aperture width. Must be a\npositive odd number (1, 3, 5, ...)\n@param size2 The second parameter of the smoothing operation, the aperture height. Ignored by\nCV_MEDIAN and CV_BILATERAL methods. In the case of simple scaled/non-scaled and Gaussian blur if\nsize2 is zero, it is set to size1. Otherwise it must be a positive odd number.\n@param sigma1 In the case of a Gaussian parameter this parameter may specify Gaussian \\f$\\sigma\\f$\n(standard deviation). If it is zero, it is calculated from the kernel size:\n\\f[\\sigma  = 0.3 (n/2 - 1) + 0.8  \\quad   \\text{where}   \\quad  n= \\begin{array}{l l} \\mbox{\\texttt{size1} for horizontal kernel} \\\\ \\mbox{\\texttt{size2} for vertical kernel} \\end{array}\\f]\nUsing standard sigma for small kernels ( \\f$3\\times 3\\f$ to \\f$7\\times 7\\f$ ) gives better speed. If\nsigma1 is not zero, while size1 and size2 are zeros, the kernel size is calculated from the\nsigma (to provide accurate enough operation).\n@param sigma2 additional parameter for bilateral filtering\n\n@see cv::GaussianBlur, cv::blur, cv::medianBlur, cv::bilateralFilter.\n */\nCVAPI(void) cvSmooth( const CvArr* src, CvArr* dst,\n                      int smoothtype CV_DEFAULT(CV_GAUSSIAN),\n                      int size1 CV_DEFAULT(3),\n                      int size2 CV_DEFAULT(0),\n                      double sigma1 CV_DEFAULT(0),\n                      double sigma2 CV_DEFAULT(0));\n\n/** @brief Convolves an image with the kernel.\n\n@param src input image.\n@param dst output image of the same size and the same number of channels as src.\n@param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point\nmatrix; if you want to apply different kernels to different channels, split the image into\nseparate color planes using split and process them individually.\n@param anchor anchor of the kernel that indicates the relative position of a filtered point within\nthe kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor\nis at the kernel center.\n\n@see cv::filter2D\n */\nCVAPI(void) cvFilter2D( const CvArr* src, CvArr* dst, const CvMat* kernel,\n                        CvPoint anchor CV_DEFAULT(cvPoint(-1,-1)));\n\n/** @brief Finds integral image: SUM(X,Y) = sum(x<X,y<Y)I(x,y)\n@see cv::integral\n*/\nCVAPI(void) cvIntegral( const CvArr* image, CvArr* sum,\n                       CvArr* sqsum CV_DEFAULT(NULL),\n                       CvArr* tilted_sum CV_DEFAULT(NULL));\n\n/** @brief Smoothes the input image with gaussian kernel and then down-samples it.\n\n   dst_width = floor(src_width/2)[+1],\n   dst_height = floor(src_height/2)[+1]\n   @see cv::pyrDown\n*/\nCVAPI(void)  cvPyrDown( const CvArr* src, CvArr* dst,\n                        int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );\n\n/** @brief Up-samples image and smoothes the result with gaussian kernel.\n\n   dst_width = src_width*2,\n   dst_height = src_height*2\n   @see cv::pyrUp\n*/\nCVAPI(void)  cvPyrUp( const CvArr* src, CvArr* dst,\n                      int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );\n\n/** @brief Builds pyramid for an image\n@see buildPyramid\n*/\nCVAPI(CvMat**) cvCreatePyramid( const CvArr* img, int extra_layers, double rate,\n                                const CvSize* layer_sizes CV_DEFAULT(0),\n                                CvArr* bufarr CV_DEFAULT(0),\n                                int calc CV_DEFAULT(1),\n                                int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );\n\n/** @brief Releases pyramid */\nCVAPI(void)  cvReleasePyramid( CvMat*** pyramid, int extra_layers );\n\n\n/** @brief Filters image using meanshift algorithm\n@see cv::pyrMeanShiftFiltering\n*/\nCVAPI(void) cvPyrMeanShiftFiltering( const CvArr* src, CvArr* dst,\n    double sp, double sr, int max_level CV_DEFAULT(1),\n    CvTermCriteria termcrit CV_DEFAULT(cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,5,1)));\n\n/** @brief Segments image using seed \"markers\"\n@see cv::watershed\n*/\nCVAPI(void) cvWatershed( const CvArr* image, CvArr* markers );\n\n/** @brief Calculates an image derivative using generalized Sobel\n\n   (aperture_size = 1,3,5,7) or Scharr (aperture_size = -1) operator.\n   Scharr can be used only for the first dx or dy derivative\n@see cv::Sobel\n*/\nCVAPI(void) cvSobel( const CvArr* src, CvArr* dst,\n                    int xorder, int yorder,\n                    int aperture_size CV_DEFAULT(3));\n\n/** @brief Calculates the image Laplacian: (d2/dx + d2/dy)I\n@see cv::Laplacian\n*/\nCVAPI(void) cvLaplace( const CvArr* src, CvArr* dst,\n                      int aperture_size CV_DEFAULT(3) );\n\n/** @brief Converts input array pixels from one color space to another\n@see cv::cvtColor\n*/\nCVAPI(void)  cvCvtColor( const CvArr* src, CvArr* dst, int code );\n\n\n/** @brief Resizes image (input array is resized to fit the destination array)\n@see cv::resize\n*/\nCVAPI(void)  cvResize( const CvArr* src, CvArr* dst,\n                       int interpolation CV_DEFAULT( CV_INTER_LINEAR ));\n\n/** @brief Warps image with affine transform\n@note ::cvGetQuadrangleSubPix is similar to ::cvWarpAffine, but the outliers are extrapolated using\nreplication border mode.\n@see cv::warpAffine\n*/\nCVAPI(void)  cvWarpAffine( const CvArr* src, CvArr* dst, const CvMat* map_matrix,\n                           int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),\n                           CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );\n\n/** @brief Computes affine transform matrix for mapping src[i] to dst[i] (i=0,1,2)\n@see cv::getAffineTransform\n*/\nCVAPI(CvMat*) cvGetAffineTransform( const CvPoint2D32f * src,\n                                    const CvPoint2D32f * dst,\n                                    CvMat * map_matrix );\n\n/** @brief Computes rotation_matrix matrix\n@see cv::getRotationMatrix2D\n*/\nCVAPI(CvMat*)  cv2DRotationMatrix( CvPoint2D32f center, double angle,\n                                   double scale, CvMat* map_matrix );\n\n/** @brief Warps image with perspective (projective) transform\n@see cv::warpPerspective\n*/\nCVAPI(void)  cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* map_matrix,\n                                int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),\n                                CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );\n\n/** @brief Computes perspective transform matrix for mapping src[i] to dst[i] (i=0,1,2,3)\n@see cv::getPerspectiveTransform\n*/\nCVAPI(CvMat*) cvGetPerspectiveTransform( const CvPoint2D32f* src,\n                                         const CvPoint2D32f* dst,\n                                         CvMat* map_matrix );\n\n/** @brief Performs generic geometric transformation using the specified coordinate maps\n@see cv::remap\n*/\nCVAPI(void)  cvRemap( const CvArr* src, CvArr* dst,\n                      const CvArr* mapx, const CvArr* mapy,\n                      int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),\n                      CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );\n\n/** @brief Converts mapx & mapy from floating-point to integer formats for cvRemap\n@see cv::convertMaps\n*/\nCVAPI(void)  cvConvertMaps( const CvArr* mapx, const CvArr* mapy,\n                            CvArr* mapxy, CvArr* mapalpha );\n\n/** @brief Performs forward or inverse log-polar image transform\n@see cv::warpPolar\n*/\nCVAPI(void)  cvLogPolar( const CvArr* src, CvArr* dst,\n                         CvPoint2D32f center, double M,\n                         int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS));\n\n/** Performs forward or inverse linear-polar image transform\n@see cv::warpPolar\n*/\nCVAPI(void)  cvLinearPolar( const CvArr* src, CvArr* dst,\n                         CvPoint2D32f center, double maxRadius,\n                         int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS));\n\n/** @brief Returns a structuring element of the specified size and shape for morphological operations.\n\n@note the created structuring element IplConvKernel\\* element must be released in the end using\n`cvReleaseStructuringElement(&element)`.\n\n@param cols Width of the structuring element\n@param rows Height of the structuring element\n@param anchor_x x-coordinate of the anchor\n@param anchor_y y-coordinate of the anchor\n@param shape element shape that could be one of the cv::MorphShapes_c\n@param values integer array of cols*rows elements that specifies the custom shape of the\nstructuring element, when shape=CV_SHAPE_CUSTOM.\n\n@see cv::getStructuringElement\n */\n CVAPI(IplConvKernel*)  cvCreateStructuringElementEx(\n            int cols, int  rows, int  anchor_x, int  anchor_y,\n            int shape, int* values CV_DEFAULT(NULL) );\n\n/** @brief releases structuring element\n@see cvCreateStructuringElementEx\n*/\nCVAPI(void)  cvReleaseStructuringElement( IplConvKernel** element );\n\n/** @brief erodes input image (applies minimum filter) one or more times.\n   If element pointer is NULL, 3x3 rectangular element is used\n@see cv::erode\n*/\nCVAPI(void)  cvErode( const CvArr* src, CvArr* dst,\n                      IplConvKernel* element CV_DEFAULT(NULL),\n                      int iterations CV_DEFAULT(1) );\n\n/** @brief dilates input image (applies maximum filter) one or more times.\n\n   If element pointer is NULL, 3x3 rectangular element is used\n@see cv::dilate\n*/\nCVAPI(void)  cvDilate( const CvArr* src, CvArr* dst,\n                       IplConvKernel* element CV_DEFAULT(NULL),\n                       int iterations CV_DEFAULT(1) );\n\n/** @brief Performs complex morphological transformation\n@see cv::morphologyEx\n*/\nCVAPI(void)  cvMorphologyEx( const CvArr* src, CvArr* dst,\n                             CvArr* temp, IplConvKernel* element,\n                             int operation, int iterations CV_DEFAULT(1) );\n\n/** @brief Calculates all spatial and central moments up to the 3rd order\n@see cv::moments\n*/\nCVAPI(void) cvMoments( const CvArr* arr, CvMoments* moments, int binary CV_DEFAULT(0));\n\n/** @brief Retrieve spatial moments */\nCVAPI(double)  cvGetSpatialMoment( CvMoments* moments, int x_order, int y_order );\n/** @brief Retrieve central moments */\nCVAPI(double)  cvGetCentralMoment( CvMoments* moments, int x_order, int y_order );\n/** @brief Retrieve normalized central moments */\nCVAPI(double)  cvGetNormalizedCentralMoment( CvMoments* moments,\n                                             int x_order, int y_order );\n\n/** @brief Calculates 7 Hu's invariants from precalculated spatial and central moments\n@see cv::HuMoments\n*/\nCVAPI(void) cvGetHuMoments( CvMoments*  moments, CvHuMoments*  hu_moments );\n\n/*********************************** data sampling **************************************/\n\n/** @brief Fetches pixels that belong to the specified line segment and stores them to the buffer.\n\n   Returns the number of retrieved points.\n@see cv::LineSegmentDetector\n*/\nCVAPI(int)  cvSampleLine( const CvArr* image, CvPoint pt1, CvPoint pt2, void* buffer,\n                          int connectivity CV_DEFAULT(8));\n\n/** @brief Retrieves the rectangular image region with specified center from the input array.\n\n dst(x,y) <- src(x + center.x - dst_width/2, y + center.y - dst_height/2).\n Values of pixels with fractional coordinates are retrieved using bilinear interpolation\n@see cv::getRectSubPix\n*/\nCVAPI(void)  cvGetRectSubPix( const CvArr* src, CvArr* dst, CvPoint2D32f center );\n\n\n/** @brief Retrieves quadrangle from the input array.\n\n    matrixarr = ( a11  a12 | b1 )   dst(x,y) <- src(A[x y]' + b)\n                ( a21  a22 | b2 )   (bilinear interpolation is used to retrieve pixels\n                                     with fractional coordinates)\n@see cvWarpAffine\n*/\nCVAPI(void)  cvGetQuadrangleSubPix( const CvArr* src, CvArr* dst,\n                                    const CvMat* map_matrix );\n\n/** @brief Measures similarity between template and overlapped windows in the source image\n   and fills the resultant image with the measurements\n@see cv::matchTemplate\n*/\nCVAPI(void)  cvMatchTemplate( const CvArr* image, const CvArr* templ,\n                              CvArr* result, int method );\n\n/** @brief Computes earth mover distance between\n   two weighted point sets (called signatures)\n@see cv::EMD\n*/\nCVAPI(float)  cvCalcEMD2( const CvArr* signature1,\n                          const CvArr* signature2,\n                          int distance_type,\n                          CvDistanceFunction distance_func CV_DEFAULT(NULL),\n                          const CvArr* cost_matrix CV_DEFAULT(NULL),\n                          CvArr* flow CV_DEFAULT(NULL),\n                          float* lower_bound CV_DEFAULT(NULL),\n                          void* userdata CV_DEFAULT(NULL));\n\n/****************************************************************************************\\\n*                              Contours retrieving                                       *\n\\****************************************************************************************/\n\n/** @brief Retrieves outer and optionally inner boundaries of white (non-zero) connected\n   components in the black (zero) background\n@see cv::findContours, cvStartFindContours, cvFindNextContour, cvSubstituteContour, cvEndFindContours\n*/\nCVAPI(int)  cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** first_contour,\n                            int header_size CV_DEFAULT(sizeof(CvContour)),\n                            int mode CV_DEFAULT(CV_RETR_LIST),\n                            int method CV_DEFAULT(CV_CHAIN_APPROX_SIMPLE),\n                            CvPoint offset CV_DEFAULT(cvPoint(0,0)));\n\n/** @brief Initializes contour retrieving process.\n\n   Calls cvStartFindContours.\n   Calls cvFindNextContour until null pointer is returned\n   or some other condition becomes true.\n   Calls cvEndFindContours at the end.\n@see cvFindContours\n*/\nCVAPI(CvContourScanner)  cvStartFindContours( CvArr* image, CvMemStorage* storage,\n                            int header_size CV_DEFAULT(sizeof(CvContour)),\n                            int mode CV_DEFAULT(CV_RETR_LIST),\n                            int method CV_DEFAULT(CV_CHAIN_APPROX_SIMPLE),\n                            CvPoint offset CV_DEFAULT(cvPoint(0,0)));\n\n/** @brief Retrieves next contour\n@see cvFindContours\n*/\nCVAPI(CvSeq*)  cvFindNextContour( CvContourScanner scanner );\n\n\n/** @brief Substitutes the last retrieved contour with the new one\n\n   (if the substitutor is null, the last retrieved contour is removed from the tree)\n@see cvFindContours\n*/\nCVAPI(void)   cvSubstituteContour( CvContourScanner scanner, CvSeq* new_contour );\n\n\n/** @brief Releases contour scanner and returns pointer to the first outer contour\n@see cvFindContours\n*/\nCVAPI(CvSeq*)  cvEndFindContours( CvContourScanner* scanner );\n\n/** @brief Approximates Freeman chain(s) with a polygonal curve.\n\nThis is a standalone contour approximation routine, not represented in the new interface. When\ncvFindContours retrieves contours as Freeman chains, it calls the function to get approximated\ncontours, represented as polygons.\n\n@param src_seq Pointer to the approximated Freeman chain that can refer to other chains.\n@param storage Storage location for the resulting polylines.\n@param method Approximation method (see the description of the function :ocvFindContours ).\n@param parameter Method parameter (not used now).\n@param minimal_perimeter Approximates only those contours whose perimeters are not less than\nminimal_perimeter . Other chains are removed from the resulting structure.\n@param recursive Recursion flag. If it is non-zero, the function approximates all chains that can\nbe obtained from chain by using the h_next or v_next links. Otherwise, the single input chain is\napproximated.\n@see cvStartReadChainPoints, cvReadChainPoint\n */\nCVAPI(CvSeq*) cvApproxChains( CvSeq* src_seq, CvMemStorage* storage,\n                            int method CV_DEFAULT(CV_CHAIN_APPROX_SIMPLE),\n                            double parameter CV_DEFAULT(0),\n                            int  minimal_perimeter CV_DEFAULT(0),\n                            int  recursive CV_DEFAULT(0));\n\n/** @brief Initializes Freeman chain reader.\n\n   The reader is used to iteratively get coordinates of all the chain points.\n   If the Freeman codes should be read as is, a simple sequence reader should be used\n@see cvApproxChains\n*/\nCVAPI(void) cvStartReadChainPoints( CvChain* chain, CvChainPtReader* reader );\n\n/** @brief Retrieves the next chain point\n@see cvApproxChains\n*/\nCVAPI(CvPoint) cvReadChainPoint( CvChainPtReader* reader );\n\n\n/****************************************************************************************\\\n*                            Contour Processing and Shape Analysis                       *\n\\****************************************************************************************/\n\n/** @brief Approximates a single polygonal curve (contour) or\n   a tree of polygonal curves (contours)\n@see cv::approxPolyDP\n*/\nCVAPI(CvSeq*)  cvApproxPoly( const void* src_seq,\n                             int header_size, CvMemStorage* storage,\n                             int method, double eps,\n                             int recursive CV_DEFAULT(0));\n\n/** @brief Calculates perimeter of a contour or length of a part of contour\n@see cv::arcLength\n*/\nCVAPI(double)  cvArcLength( const void* curve,\n                            CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),\n                            int is_closed CV_DEFAULT(-1));\n\n/** same as cvArcLength for closed contour\n*/\nCV_INLINE double cvContourPerimeter( const void* contour )\n{\n    return cvArcLength( contour, CV_WHOLE_SEQ, 1 );\n}\n\n\n/** @brief Calculates contour bounding rectangle (update=1) or\n   just retrieves pre-calculated rectangle (update=0)\n@see cv::boundingRect\n*/\nCVAPI(CvRect)  cvBoundingRect( CvArr* points, int update CV_DEFAULT(0) );\n\n/** @brief Calculates area of a contour or contour segment\n@see cv::contourArea\n*/\nCVAPI(double)  cvContourArea( const CvArr* contour,\n                              CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),\n                              int oriented CV_DEFAULT(0));\n\n/** @brief Finds minimum area rotated rectangle bounding a set of points\n@see cv::minAreaRect\n*/\nCVAPI(CvBox2D)  cvMinAreaRect2( const CvArr* points,\n                                CvMemStorage* storage CV_DEFAULT(NULL));\n\n/** @brief Finds minimum enclosing circle for a set of points\n@see cv::minEnclosingCircle\n*/\nCVAPI(int)  cvMinEnclosingCircle( const CvArr* points,\n                                  CvPoint2D32f* center, float* radius );\n\n/** @brief Compares two contours by matching their moments\n@see cv::matchShapes\n*/\nCVAPI(double)  cvMatchShapes( const void* object1, const void* object2,\n                              int method, double parameter CV_DEFAULT(0));\n\n/** @brief Calculates exact convex hull of 2d point set\n@see cv::convexHull\n*/\nCVAPI(CvSeq*) cvConvexHull2( const CvArr* input,\n                             void* hull_storage CV_DEFAULT(NULL),\n                             int orientation CV_DEFAULT(CV_CLOCKWISE),\n                             int return_points CV_DEFAULT(0));\n\n/** @brief Checks whether the contour is convex or not (returns 1 if convex, 0 if not)\n@see cv::isContourConvex\n*/\nCVAPI(int)  cvCheckContourConvexity( const CvArr* contour );\n\n\n/** @brief Finds convexity defects for the contour\n@see cv::convexityDefects\n*/\nCVAPI(CvSeq*)  cvConvexityDefects( const CvArr* contour, const CvArr* convexhull,\n                                   CvMemStorage* storage CV_DEFAULT(NULL));\n\n/** @brief Fits ellipse into a set of 2d points\n@see cv::fitEllipse\n*/\nCVAPI(CvBox2D) cvFitEllipse2( const CvArr* points );\n\n/** @brief Finds minimum rectangle containing two given rectangles */\nCVAPI(CvRect)  cvMaxRect( const CvRect* rect1, const CvRect* rect2 );\n\n/** @brief Finds coordinates of the box vertices */\nCVAPI(void) cvBoxPoints( CvBox2D box, CvPoint2D32f pt[4] );\n\n/** @brief Initializes sequence header for a matrix (column or row vector) of points\n\n   a wrapper for cvMakeSeqHeaderForArray (it does not initialize bounding rectangle!!!) */\nCVAPI(CvSeq*) cvPointSeqFromMat( int seq_kind, const CvArr* mat,\n                                 CvContour* contour_header,\n                                 CvSeqBlock* block );\n\n/** @brief Checks whether the point is inside polygon, outside, on an edge (at a vertex).\n\n   Returns positive, negative or zero value, correspondingly.\n   Optionally, measures a signed distance between\n   the point and the nearest polygon edge (measure_dist=1)\n@see cv::pointPolygonTest\n*/\nCVAPI(double) cvPointPolygonTest( const CvArr* contour,\n                                  CvPoint2D32f pt, int measure_dist );\n\n/****************************************************************************************\\\n*                                  Histogram functions                                   *\n\\****************************************************************************************/\n\n/** @brief Creates a histogram.\n\nThe function creates a histogram of the specified size and returns a pointer to the created\nhistogram. If the array ranges is 0, the histogram bin ranges must be specified later via the\nfunction cvSetHistBinRanges. Though cvCalcHist and cvCalcBackProject may process 8-bit images\nwithout setting bin ranges, they assume they are equally spaced in 0 to 255 bins.\n\n@param dims Number of histogram dimensions.\n@param sizes Array of the histogram dimension sizes.\n@param type Histogram representation format. CV_HIST_ARRAY means that the histogram data is\nrepresented as a multi-dimensional dense array CvMatND. CV_HIST_SPARSE means that histogram data\nis represented as a multi-dimensional sparse array CvSparseMat.\n@param ranges Array of ranges for the histogram bins. Its meaning depends on the uniform parameter\nvalue. The ranges are used when the histogram is calculated or backprojected to determine which\nhistogram bin corresponds to which value/tuple of values from the input image(s).\n@param uniform Uniformity flag. If not zero, the histogram has evenly spaced bins and for every\n\\f$0<=i<cDims\\f$ ranges[i] is an array of two numbers: lower and upper boundaries for the i-th\nhistogram dimension. The whole range [lower,upper] is then split into dims[i] equal parts to\ndetermine the i-th input tuple value ranges for every histogram bin. And if uniform=0 , then the\ni-th element of the ranges array contains dims[i]+1 elements: \\f$\\texttt{lower}_0,\n\\texttt{upper}_0, \\texttt{lower}_1, \\texttt{upper}_1 = \\texttt{lower}_2,\n...\n\\texttt{upper}_{dims[i]-1}\\f$ where \\f$\\texttt{lower}_j\\f$ and \\f$\\texttt{upper}_j\\f$ are lower\nand upper boundaries of the i-th input tuple value for the j-th bin, respectively. In either\ncase, the input values that are beyond the specified range for a histogram bin are not counted\nby cvCalcHist and filled with 0 by cvCalcBackProject.\n */\nCVAPI(CvHistogram*)  cvCreateHist( int dims, int* sizes, int type,\n                                   float** ranges CV_DEFAULT(NULL),\n                                   int uniform CV_DEFAULT(1));\n\n/** @brief Sets the bounds of the histogram bins.\n\nThis is a standalone function for setting bin ranges in the histogram. For a more detailed\ndescription of the parameters ranges and uniform, see the :ocvCalcHist function that can initialize\nthe ranges as well. Ranges for the histogram bins must be set before the histogram is calculated or\nthe backproject of the histogram is calculated.\n\n@param hist Histogram.\n@param ranges Array of bin ranges arrays. See :ocvCreateHist for details.\n@param uniform Uniformity flag. See :ocvCreateHist for details.\n */\nCVAPI(void)  cvSetHistBinRanges( CvHistogram* hist, float** ranges,\n                                int uniform CV_DEFAULT(1));\n\n/** @brief Makes a histogram out of an array.\n\nThe function initializes the histogram, whose header and bins are allocated by the user.\ncvReleaseHist does not need to be called afterwards. Only dense histograms can be initialized this\nway. The function returns hist.\n\n@param dims Number of the histogram dimensions.\n@param sizes Array of the histogram dimension sizes.\n@param hist Histogram header initialized by the function.\n@param data Array used to store histogram bins.\n@param ranges Histogram bin ranges. See cvCreateHist for details.\n@param uniform Uniformity flag. See cvCreateHist for details.\n */\nCVAPI(CvHistogram*)  cvMakeHistHeaderForArray(\n                            int  dims, int* sizes, CvHistogram* hist,\n                            float* data, float** ranges CV_DEFAULT(NULL),\n                            int uniform CV_DEFAULT(1));\n\n/** @brief Releases the histogram.\n\nThe function releases the histogram (header and the data). The pointer to the histogram is cleared\nby the function. If \\*hist pointer is already NULL, the function does nothing.\n\n@param hist Double pointer to the released histogram.\n */\nCVAPI(void)  cvReleaseHist( CvHistogram** hist );\n\n/** @brief Clears the histogram.\n\nThe function sets all of the histogram bins to 0 in case of a dense histogram and removes all\nhistogram bins in case of a sparse array.\n\n@param hist Histogram.\n */\nCVAPI(void)  cvClearHist( CvHistogram* hist );\n\n/** @brief Finds the minimum and maximum histogram bins.\n\nThe function finds the minimum and maximum histogram bins and their positions. All of output\narguments are optional. Among several extremas with the same value the ones with the minimum index\n(in the lexicographical order) are returned. In case of several maximums or minimums, the earliest\nin the lexicographical order (extrema locations) is returned.\n\n@param hist Histogram.\n@param min_value Pointer to the minimum value of the histogram.\n@param max_value Pointer to the maximum value of the histogram.\n@param min_idx Pointer to the array of coordinates for the minimum.\n@param max_idx Pointer to the array of coordinates for the maximum.\n */\nCVAPI(void)  cvGetMinMaxHistValue( const CvHistogram* hist,\n                                   float* min_value, float* max_value,\n                                   int* min_idx CV_DEFAULT(NULL),\n                                   int* max_idx CV_DEFAULT(NULL));\n\n\n/** @brief Normalizes the histogram.\n\nThe function normalizes the histogram bins by scaling them so that the sum of the bins becomes equal\nto factor.\n\n@param hist Pointer to the histogram.\n@param factor Normalization factor.\n */\nCVAPI(void)  cvNormalizeHist( CvHistogram* hist, double factor );\n\n\n/** @brief Thresholds the histogram.\n\nThe function clears histogram bins that are below the specified threshold.\n\n@param hist Pointer to the histogram.\n@param threshold Threshold level.\n */\nCVAPI(void)  cvThreshHist( CvHistogram* hist, double threshold );\n\n\n/** Compares two histogram */\nCVAPI(double)  cvCompareHist( const CvHistogram* hist1,\n                              const CvHistogram* hist2,\n                              int method);\n\n/** @brief Copies a histogram.\n\nThe function makes a copy of the histogram. If the second histogram pointer \\*dst is NULL, a new\nhistogram of the same size as src is created. Otherwise, both histograms must have equal types and\nsizes. Then the function copies the bin values of the source histogram to the destination histogram\nand sets the same bin value ranges as in src.\n\n@param src Source histogram.\n@param dst Pointer to the destination histogram.\n */\nCVAPI(void)  cvCopyHist( const CvHistogram* src, CvHistogram** dst );\n\n\n/** @brief Calculates bayesian probabilistic histograms\n   (each or src and dst is an array of _number_ histograms */\nCVAPI(void)  cvCalcBayesianProb( CvHistogram** src, int number,\n                                CvHistogram** dst);\n\n/** @brief Calculates array histogram\n@see cv::calcHist\n*/\nCVAPI(void)  cvCalcArrHist( CvArr** arr, CvHistogram* hist,\n                            int accumulate CV_DEFAULT(0),\n                            const CvArr* mask CV_DEFAULT(NULL) );\n\n/** @overload */\nCV_INLINE  void  cvCalcHist( IplImage** image, CvHistogram* hist,\n                             int accumulate CV_DEFAULT(0),\n                             const CvArr* mask CV_DEFAULT(NULL) )\n{\n    cvCalcArrHist( (CvArr**)image, hist, accumulate, mask );\n}\n\n/** @brief Calculates back project\n@see cvCalcBackProject, cv::calcBackProject\n*/\nCVAPI(void)  cvCalcArrBackProject( CvArr** image, CvArr* dst,\n                                   const CvHistogram* hist );\n\n#define  cvCalcBackProject(image, dst, hist) cvCalcArrBackProject((CvArr**)image, dst, hist)\n\n\n/** @brief Locates a template within an image by using a histogram comparison.\n\nThe function calculates the back projection by comparing histograms of the source image patches with\nthe given histogram. The function is similar to matchTemplate, but instead of comparing the raster\npatch with all its possible positions within the search window, the function CalcBackProjectPatch\ncompares histograms. See the algorithm diagram below:\n\n![image](pics/backprojectpatch.png)\n\n@param image Source images (though, you may pass CvMat\\*\\* as well).\n@param dst Destination image.\n@param range\n@param hist Histogram.\n@param method Comparison method passed to cvCompareHist (see the function description).\n@param factor Normalization factor for histograms that affects the normalization scale of the\ndestination image. Pass 1 if not sure.\n\n@see cvCalcBackProjectPatch\n */\nCVAPI(void)  cvCalcArrBackProjectPatch( CvArr** image, CvArr* dst, CvSize range,\n                                        CvHistogram* hist, int method,\n                                        double factor );\n\n#define  cvCalcBackProjectPatch( image, dst, range, hist, method, factor ) \\\n     cvCalcArrBackProjectPatch( (CvArr**)image, dst, range, hist, method, factor )\n\n\n/** @brief Divides one histogram by another.\n\nThe function calculates the object probability density from two histograms as:\n\n\\f[\\texttt{disthist} (I)= \\forkthree{0}{if \\(\\texttt{hist1}(I)=0\\)}{\\texttt{scale}}{if \\(\\texttt{hist1}(I) \\ne 0\\) and \\(\\texttt{hist2}(I) > \\texttt{hist1}(I)\\)}{\\frac{\\texttt{hist2}(I) \\cdot \\texttt{scale}}{\\texttt{hist1}(I)}}{if \\(\\texttt{hist1}(I) \\ne 0\\) and \\(\\texttt{hist2}(I) \\le \\texttt{hist1}(I)\\)}\\f]\n\n@param hist1 First histogram (the divisor).\n@param hist2 Second histogram.\n@param dst_hist Destination histogram.\n@param scale Scale factor for the destination histogram.\n */\nCVAPI(void)  cvCalcProbDensity( const CvHistogram* hist1, const CvHistogram* hist2,\n                                CvHistogram* dst_hist, double scale CV_DEFAULT(255) );\n\n/** @brief equalizes histogram of 8-bit single-channel image\n@see cv::equalizeHist\n*/\nCVAPI(void)  cvEqualizeHist( const CvArr* src, CvArr* dst );\n\n\n/** @brief Applies distance transform to binary image\n@see cv::distanceTransform\n*/\nCVAPI(void)  cvDistTransform( const CvArr* src, CvArr* dst,\n                              int distance_type CV_DEFAULT(CV_DIST_L2),\n                              int mask_size CV_DEFAULT(3),\n                              const float* mask CV_DEFAULT(NULL),\n                              CvArr* labels CV_DEFAULT(NULL),\n                              int labelType CV_DEFAULT(CV_DIST_LABEL_CCOMP));\n\n\n/** @brief Applies fixed-level threshold to grayscale image.\n\n   This is a basic operation applied before retrieving contours\n@see cv::threshold\n*/\nCVAPI(double)  cvThreshold( const CvArr*  src, CvArr*  dst,\n                            double  threshold, double  max_value,\n                            int threshold_type );\n\n/** @brief Applies adaptive threshold to grayscale image.\n\n   The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and\n   CV_ADAPTIVE_THRESH_GAUSSIAN_C are:\n   neighborhood size (3, 5, 7 etc.),\n   and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...)\n@see cv::adaptiveThreshold\n*/\nCVAPI(void)  cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double max_value,\n                                  int adaptive_method CV_DEFAULT(CV_ADAPTIVE_THRESH_MEAN_C),\n                                  int threshold_type CV_DEFAULT(CV_THRESH_BINARY),\n                                  int block_size CV_DEFAULT(3),\n                                  double param1 CV_DEFAULT(5));\n\n/** @brief Fills the connected component until the color difference gets large enough\n@see cv::floodFill\n*/\nCVAPI(void)  cvFloodFill( CvArr* image, CvPoint seed_point,\n                          CvScalar new_val, CvScalar lo_diff CV_DEFAULT(cvScalarAll(0)),\n                          CvScalar up_diff CV_DEFAULT(cvScalarAll(0)),\n                          CvConnectedComp* comp CV_DEFAULT(NULL),\n                          int flags CV_DEFAULT(4),\n                          CvArr* mask CV_DEFAULT(NULL));\n\n/****************************************************************************************\\\n*                                  Feature detection                                     *\n\\****************************************************************************************/\n\n/** @brief Runs canny edge detector\n@see cv::Canny\n*/\nCVAPI(void)  cvCanny( const CvArr* image, CvArr* edges, double threshold1,\n                      double threshold2, int  aperture_size CV_DEFAULT(3) );\n\n/** @brief Calculates constraint image for corner detection\n\n   Dx^2 * Dyy + Dxx * Dy^2 - 2 * Dx * Dy * Dxy.\n   Applying threshold to the result gives coordinates of corners\n@see cv::preCornerDetect\n*/\nCVAPI(void) cvPreCornerDetect( const CvArr* image, CvArr* corners,\n                               int aperture_size CV_DEFAULT(3) );\n\n/** @brief Calculates eigen values and vectors of 2x2\n   gradient covariation matrix at every image pixel\n@see cv::cornerEigenValsAndVecs\n*/\nCVAPI(void)  cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv,\n                                       int block_size, int aperture_size CV_DEFAULT(3) );\n\n/** @brief Calculates minimal eigenvalue for 2x2 gradient covariation matrix at\n   every image pixel\n@see cv::cornerMinEigenVal\n*/\nCVAPI(void)  cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval,\n                                  int block_size, int aperture_size CV_DEFAULT(3) );\n\n/** @brief Harris corner detector:\n\n   Calculates det(M) - k*(trace(M)^2), where M is 2x2 gradient covariation matrix for each pixel\n@see cv::cornerHarris\n*/\nCVAPI(void)  cvCornerHarris( const CvArr* image, CvArr* harris_response,\n                             int block_size, int aperture_size CV_DEFAULT(3),\n                             double k CV_DEFAULT(0.04) );\n\n/** @brief Adjust corner position using some sort of gradient search\n@see cv::cornerSubPix\n*/\nCVAPI(void)  cvFindCornerSubPix( const CvArr* image, CvPoint2D32f* corners,\n                                 int count, CvSize win, CvSize zero_zone,\n                                 CvTermCriteria  criteria );\n\n/** @brief Finds a sparse set of points within the selected region\n   that seem to be easy to track\n@see cv::goodFeaturesToTrack\n*/\nCVAPI(void)  cvGoodFeaturesToTrack( const CvArr* image, CvArr* eig_image,\n                                    CvArr* temp_image, CvPoint2D32f* corners,\n                                    int* corner_count, double  quality_level,\n                                    double  min_distance,\n                                    const CvArr* mask CV_DEFAULT(NULL),\n                                    int block_size CV_DEFAULT(3),\n                                    int use_harris CV_DEFAULT(0),\n                                    double k CV_DEFAULT(0.04) );\n\n/** @brief Finds lines on binary image using one of several methods.\n\n   line_storage is either memory storage or 1 x _max number of lines_ CvMat, its\n   number of columns is changed by the function.\n   method is one of CV_HOUGH_*;\n   rho, theta and threshold are used for each of those methods;\n   param1 ~ line length, param2 ~ line gap - for probabilistic,\n   param1 ~ srn, param2 ~ stn - for multi-scale\n@see cv::HoughLines\n*/\nCVAPI(CvSeq*)  cvHoughLines2( CvArr* image, void* line_storage, int method,\n                              double rho, double theta, int threshold,\n                              double param1 CV_DEFAULT(0), double param2 CV_DEFAULT(0),\n                              double min_theta CV_DEFAULT(0), double max_theta CV_DEFAULT(CV_PI));\n\n/** @brief Finds circles in the image\n@see cv::HoughCircles\n*/\nCVAPI(CvSeq*) cvHoughCircles( CvArr* image, void* circle_storage,\n                              int method, double dp, double min_dist,\n                              double param1 CV_DEFAULT(100),\n                              double param2 CV_DEFAULT(100),\n                              int min_radius CV_DEFAULT(0),\n                              int max_radius CV_DEFAULT(0));\n\n/** @brief Fits a line into set of 2d or 3d points in a robust way (M-estimator technique)\n@see cv::fitLine\n*/\nCVAPI(void)  cvFitLine( const CvArr* points, int dist_type, double param,\n                        double reps, double aeps, float* line );\n\n/****************************************************************************************\\\n*                                     Drawing                                            *\n\\****************************************************************************************/\n\n/****************************************************************************************\\\n*       Drawing functions work with images/matrices of arbitrary type.                   *\n*       For color images the channel order is BGR[A]                                     *\n*       Antialiasing is supported only for 8-bit image now.                              *\n*       All the functions include parameter color that means rgb value (that may be      *\n*       constructed with CV_RGB macro) for color images and brightness                   *\n*       for grayscale images.                                                            *\n*       If a drawn figure is partially or completely outside of the image, it is clipped.*\n\\****************************************************************************************/\n\n#define CV_FILLED -1\n\n#define CV_AA 16\n\n/** @brief Draws 4-connected, 8-connected or antialiased line segment connecting two points\n@see cv::line\n*/\nCVAPI(void)  cvLine( CvArr* img, CvPoint pt1, CvPoint pt2,\n                     CvScalar color, int thickness CV_DEFAULT(1),\n                     int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) );\n\n/** @brief Draws a rectangle given two opposite corners of the rectangle (pt1 & pt2)\n\n   if thickness<0 (e.g. thickness == CV_FILLED), the filled box is drawn\n@see cv::rectangle\n*/\nCVAPI(void)  cvRectangle( CvArr* img, CvPoint pt1, CvPoint pt2,\n                          CvScalar color, int thickness CV_DEFAULT(1),\n                          int line_type CV_DEFAULT(8),\n                          int shift CV_DEFAULT(0));\n\n/** @brief Draws a rectangle specified by a CvRect structure\n@see cv::rectangle\n*/\nCVAPI(void)  cvRectangleR( CvArr* img, CvRect r,\n                           CvScalar color, int thickness CV_DEFAULT(1),\n                           int line_type CV_DEFAULT(8),\n                           int shift CV_DEFAULT(0));\n\n\n/** @brief Draws a circle with specified center and radius.\n\n   Thickness works in the same way as with cvRectangle\n@see cv::circle\n*/\nCVAPI(void)  cvCircle( CvArr* img, CvPoint center, int radius,\n                       CvScalar color, int thickness CV_DEFAULT(1),\n                       int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));\n\n/** @brief Draws ellipse outline, filled ellipse, elliptic arc or filled elliptic sector\n\n   depending on _thickness_, _start_angle_ and _end_angle_ parameters. The resultant figure\n   is rotated by _angle_. All the angles are in degrees\n@see cv::ellipse\n*/\nCVAPI(void)  cvEllipse( CvArr* img, CvPoint center, CvSize axes,\n                        double angle, double start_angle, double end_angle,\n                        CvScalar color, int thickness CV_DEFAULT(1),\n                        int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));\n\nCV_INLINE  void  cvEllipseBox( CvArr* img, CvBox2D box, CvScalar color,\n                               int thickness CV_DEFAULT(1),\n                               int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) )\n{\n    CvSize axes = cvSize(\n        cvRound(box.size.width*0.5),\n        cvRound(box.size.height*0.5)\n    );\n\n    cvEllipse( img, cvPointFrom32f( box.center ), axes, box.angle,\n               0, 360, color, thickness, line_type, shift );\n}\n\n/** @brief Fills convex or monotonous polygon.\n@see cv::fillConvexPoly\n*/\nCVAPI(void)  cvFillConvexPoly( CvArr* img, const CvPoint* pts, int npts, CvScalar color,\n                               int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));\n\n/** @brief Fills an area bounded by one or more arbitrary polygons\n@see cv::fillPoly\n*/\nCVAPI(void)  cvFillPoly( CvArr* img, CvPoint** pts, const int* npts,\n                         int contours, CvScalar color,\n                         int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) );\n\n/** @brief Draws one or more polygonal curves\n@see cv::polylines\n*/\nCVAPI(void)  cvPolyLine( CvArr* img, CvPoint** pts, const int* npts, int contours,\n                         int is_closed, CvScalar color, int thickness CV_DEFAULT(1),\n                         int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) );\n\n#define cvDrawRect cvRectangle\n#define cvDrawLine cvLine\n#define cvDrawCircle cvCircle\n#define cvDrawEllipse cvEllipse\n#define cvDrawPolyLine cvPolyLine\n\n/** @brief Clips the line segment connecting *pt1 and *pt2\n   by the rectangular window\n\n   (0<=x<img_size.width, 0<=y<img_size.height).\n@see cv::clipLine\n*/\nCVAPI(int) cvClipLine( CvSize img_size, CvPoint* pt1, CvPoint* pt2 );\n\n/** @brief Initializes line iterator.\n\nInitially, line_iterator->ptr will point to pt1 (or pt2, see left_to_right description) location in\nthe image. Returns the number of pixels on the line between the ending points.\n@see cv::LineIterator\n*/\nCVAPI(int)  cvInitLineIterator( const CvArr* image, CvPoint pt1, CvPoint pt2,\n                                CvLineIterator* line_iterator,\n                                int connectivity CV_DEFAULT(8),\n                                int left_to_right CV_DEFAULT(0));\n\n#define CV_NEXT_LINE_POINT( line_iterator )                     \\\n{                                                               \\\n    int _line_iterator_mask = (line_iterator).err < 0 ? -1 : 0; \\\n    (line_iterator).err += (line_iterator).minus_delta +        \\\n        ((line_iterator).plus_delta & _line_iterator_mask);     \\\n    (line_iterator).ptr += (line_iterator).minus_step +         \\\n        ((line_iterator).plus_step & _line_iterator_mask);      \\\n}\n\n\n#define CV_FONT_HERSHEY_SIMPLEX         0\n#define CV_FONT_HERSHEY_PLAIN           1\n#define CV_FONT_HERSHEY_DUPLEX          2\n#define CV_FONT_HERSHEY_COMPLEX         3\n#define CV_FONT_HERSHEY_TRIPLEX         4\n#define CV_FONT_HERSHEY_COMPLEX_SMALL   5\n#define CV_FONT_HERSHEY_SCRIPT_SIMPLEX  6\n#define CV_FONT_HERSHEY_SCRIPT_COMPLEX  7\n\n#define CV_FONT_ITALIC                 16\n\n#define CV_FONT_VECTOR0    CV_FONT_HERSHEY_SIMPLEX\n\n\n/** Font structure */\ntypedef struct CvFont\n{\n  const char* nameFont;   //Qt:nameFont\n  CvScalar color;       //Qt:ColorFont -> cvScalar(blue_component, green_component, red_component[, alpha_component])\n    int         font_face;    //Qt: bool italic         /** =CV_FONT_* */\n    const int*  ascii;      //!< font data and metrics\n    const int*  greek;\n    const int*  cyrillic;\n    float       hscale, vscale;\n    float       shear;      //!< slope coefficient: 0 - normal, >0 - italic\n    int         thickness;    //!< Qt: weight               /** letters thickness */\n    float       dx;       //!< horizontal interval between letters\n    int         line_type;    //!< Qt: PointSize\n}\nCvFont;\n\n/** @brief Initializes font structure (OpenCV 1.x API).\n\nThe function initializes the font structure that can be passed to text rendering functions.\n\n@param font Pointer to the font structure initialized by the function\n@param font_face Font name identifier. See cv::HersheyFonts and corresponding old CV_* identifiers.\n@param hscale Horizontal scale. If equal to 1.0f , the characters have the original width\ndepending on the font type. If equal to 0.5f , the characters are of half the original width.\n@param vscale Vertical scale. If equal to 1.0f , the characters have the original height depending\non the font type. If equal to 0.5f , the characters are of half the original height.\n@param shear Approximate tangent of the character slope relative to the vertical line. A zero\nvalue means a non-italic font, 1.0f means about a 45 degree slope, etc.\n@param thickness Thickness of the text strokes\n@param line_type Type of the strokes, see line description\n\n@sa cvPutText\n */\nCVAPI(void)  cvInitFont( CvFont* font, int font_face,\n                         double hscale, double vscale,\n                         double shear CV_DEFAULT(0),\n                         int thickness CV_DEFAULT(1),\n                         int line_type CV_DEFAULT(8));\n\nCV_INLINE CvFont cvFont( double scale, int thickness CV_DEFAULT(1) )\n{\n    CvFont font;\n    cvInitFont( &font, CV_FONT_HERSHEY_PLAIN, scale, scale, 0, thickness, CV_AA );\n    return font;\n}\n\n/** @brief Renders text stroke with specified font and color at specified location.\n   CvFont should be initialized with cvInitFont\n@see cvInitFont, cvGetTextSize, cvFont, cv::putText\n*/\nCVAPI(void)  cvPutText( CvArr* img, const char* text, CvPoint org,\n                        const CvFont* font, CvScalar color );\n\n/** @brief Calculates bounding box of text stroke (useful for alignment)\n@see cv::getTextSize\n*/\nCVAPI(void)  cvGetTextSize( const char* text_string, const CvFont* font,\n                            CvSize* text_size, int* baseline );\n\n/** @brief Unpacks color value\n\nif arrtype is CV_8UC?, _color_ is treated as packed color value, otherwise the first channels\n(depending on arrtype) of destination scalar are set to the same value = _color_\n*/\nCVAPI(CvScalar)  cvColorToScalar( double packed_color, int arrtype );\n\n/** @brief Returns the polygon points which make up the given ellipse.\n\nThe ellipse is define by the box of size 'axes' rotated 'angle' around the 'center'. A partial\nsweep of the ellipse arc can be done by specifying arc_start and arc_end to be something other than\n0 and 360, respectively. The input array 'pts' must be large enough to hold the result. The total\nnumber of points stored into 'pts' is returned by this function.\n@see cv::ellipse2Poly\n*/\nCVAPI(int) cvEllipse2Poly( CvPoint center, CvSize axes,\n                 int angle, int arc_start, int arc_end, CvPoint * pts, int delta );\n\n/** @brief Draws contour outlines or filled interiors on the image\n@see cv::drawContours\n*/\nCVAPI(void)  cvDrawContours( CvArr *img, CvSeq* contour,\n                             CvScalar external_color, CvScalar hole_color,\n                             int max_level, int thickness CV_DEFAULT(1),\n                             int line_type CV_DEFAULT(8),\n                             CvPoint offset CV_DEFAULT(cvPoint(0,0)));\n\n/** @} */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgproc/segmentation.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_IMGPROC_SEGMENTATION_HPP\n#define OPENCV_IMGPROC_SEGMENTATION_HPP\n\n#include \"opencv2/imgproc.hpp\"\n\nnamespace cv {\n\nnamespace segmentation {\n\n//! @addtogroup imgproc_segmentation\n//! @{\n\n\n/** @brief Intelligent Scissors image segmentation\n *\n * This class is used to find the path (contour) between two points\n * which can be used for image segmentation.\n *\n * Usage example:\n * @snippet snippets/imgproc_segmentation.cpp usage_example_intelligent_scissors\n *\n * Reference: <a href=\"http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.138.3811&rep=rep1&type=pdf\">\"Intelligent Scissors for Image Composition\"</a>\n * algorithm designed by Eric N. Mortensen and William A. Barrett, Brigham Young University\n * @cite Mortensen95intelligentscissors\n */\nclass CV_EXPORTS_W_SIMPLE IntelligentScissorsMB\n{\npublic:\n    CV_WRAP\n    IntelligentScissorsMB();\n\n    /** @brief Specify weights of feature functions\n     *\n     * Consider keeping weights normalized (sum of weights equals to 1.0)\n     * Discrete dynamic programming (DP) goal is minimization of costs between pixels.\n     *\n     * @param weight_non_edge Specify cost of non-edge pixels (default: 0.43f)\n     * @param weight_gradient_direction Specify cost of gradient direction function (default: 0.43f)\n     * @param weight_gradient_magnitude Specify cost of gradient magnitude function (default: 0.14f)\n     */\n    CV_WRAP\n    IntelligentScissorsMB& setWeights(float weight_non_edge, float weight_gradient_direction, float weight_gradient_magnitude);\n\n    /** @brief Specify gradient magnitude max value threshold\n     *\n     * Zero limit value is used to disable gradient magnitude thresholding (default behavior, as described in original article).\n     * Otherwize pixels with `gradient magnitude >= threshold` have zero cost.\n     *\n     * @note Thresholding should be used for images with irregular regions (to avoid stuck on parameters from high-contract areas, like embedded logos).\n     *\n     * @param gradient_magnitude_threshold_max Specify gradient magnitude max value threshold (default: 0, disabled)\n     */\n    CV_WRAP\n    IntelligentScissorsMB& setGradientMagnitudeMaxLimit(float gradient_magnitude_threshold_max = 0.0f);\n\n    /** @brief Switch to \"Laplacian Zero-Crossing\" edge feature extractor and specify its parameters\n     *\n     * This feature extractor is used by default according to article.\n     *\n     * Implementation has additional filtering for regions with low-amplitude noise.\n     * This filtering is enabled through parameter of minimal gradient amplitude (use some small value 4, 8, 16).\n     *\n     * @note Current implementation of this feature extractor is based on processing of grayscale images (color image is converted to grayscale image first).\n     *\n     * @note Canny edge detector is a bit slower, but provides better results (especially on color images): use setEdgeFeatureCannyParameters().\n     *\n     * @param gradient_magnitude_min_value Minimal gradient magnitude value for edge pixels (default: 0, check is disabled)\n     */\n    CV_WRAP\n    IntelligentScissorsMB& setEdgeFeatureZeroCrossingParameters(float gradient_magnitude_min_value = 0.0f);\n\n    /** @brief Switch edge feature extractor to use Canny edge detector\n     *\n     * @note \"Laplacian Zero-Crossing\" feature extractor is used by default (following to original article)\n     *\n     * @sa Canny\n     */\n    CV_WRAP\n    IntelligentScissorsMB& setEdgeFeatureCannyParameters(\n            double threshold1, double threshold2,\n            int apertureSize = 3, bool L2gradient = false\n    );\n\n    /** @brief Specify input image and extract image features\n     *\n     * @param image input image. Type is #CV_8UC1 / #CV_8UC3\n     */\n    CV_WRAP\n    IntelligentScissorsMB& applyImage(InputArray image);\n\n    /** @brief Specify custom features of imput image\n     *\n     * Customized advanced variant of applyImage() call.\n     *\n     * @param non_edge Specify cost of non-edge pixels. Type is CV_8UC1. Expected values are `{0, 1}`.\n     * @param gradient_direction Specify gradient direction feature. Type is CV_32FC2. Values are expected to be normalized: `x^2 + y^2 == 1`\n     * @param gradient_magnitude Specify cost of gradient magnitude function: Type is CV_32FC1. Values should be in range `[0, 1]`.\n     * @param image **Optional parameter**. Must be specified if subset of features is specified (non-specified features are calculated internally)\n     */\n    CV_WRAP\n    IntelligentScissorsMB& applyImageFeatures(\n            InputArray non_edge, InputArray gradient_direction, InputArray gradient_magnitude,\n            InputArray image = noArray()\n    );\n\n    /** @brief Prepares a map of optimal paths for the given source point on the image\n     *\n     * @note applyImage() / applyImageFeatures() must be called before this call\n     *\n     * @param sourcePt The source point used to find the paths\n     */\n    CV_WRAP void buildMap(const Point& sourcePt);\n\n    /** @brief Extracts optimal contour for the given target point on the image\n     *\n     * @note buildMap() must be called before this call\n     *\n     * @param targetPt The target point\n     * @param[out] contour The list of pixels which contains optimal path between the source and the target points of the image. Type is CV_32SC2 (compatible with `std::vector<Point>`)\n     * @param backward Flag to indicate reverse order of retrived pixels (use \"true\" value to fetch points from the target to the source point)\n     */\n    CV_WRAP void getContour(const Point& targetPt, OutputArray contour, bool backward = false) const;\n\n#ifndef CV_DOXYGEN\n    struct Impl;\n    inline Impl* getImpl() const { return impl.get(); }\nprotected:\n    std::shared_ptr<Impl> impl;\n#endif\n};\n\n//! @}\n\n}  // namespace segmentation\n}  // namespace cv\n\n#endif // OPENCV_IMGPROC_SEGMENTATION_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgproc/types_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_IMGPROC_TYPES_C_H\n#define OPENCV_IMGPROC_TYPES_C_H\n\n#include \"opencv2/core/core_c.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** @addtogroup imgproc_c\n  @{\n*/\n\n/** Connected component structure */\ntypedef struct CvConnectedComp\n{\n    double area;    /**<area of the connected component  */\n    CvScalar value; /**<average color of the connected component */\n    CvRect rect;    /**<ROI of the component  */\n    CvSeq* contour; /**<optional component boundary\n                      (the contour might have child contours corresponding to the holes)*/\n}\nCvConnectedComp;\n\n/** Image smooth methods */\nenum SmoothMethod_c\n{\n    /** linear convolution with \\f$\\texttt{size1}\\times\\texttt{size2}\\f$ box kernel (all 1's). If\n    you want to smooth different pixels with different-size box kernels, you can use the integral\n    image that is computed using integral */\n    CV_BLUR_NO_SCALE =0,\n    /** linear convolution with \\f$\\texttt{size1}\\times\\texttt{size2}\\f$ box kernel (all\n    1's) with subsequent scaling by \\f$1/(\\texttt{size1}\\cdot\\texttt{size2})\\f$ */\n    CV_BLUR  =1,\n    /** linear convolution with a \\f$\\texttt{size1}\\times\\texttt{size2}\\f$ Gaussian kernel */\n    CV_GAUSSIAN  =2,\n    /** median filter with a \\f$\\texttt{size1}\\times\\texttt{size1}\\f$ square aperture */\n    CV_MEDIAN =3,\n    /** bilateral filter with a \\f$\\texttt{size1}\\times\\texttt{size1}\\f$ square aperture, color\n    sigma= sigma1 and spatial sigma= sigma2. If size1=0, the aperture square side is set to\n    cvRound(sigma2\\*1.5)\\*2+1. See cv::bilateralFilter */\n    CV_BILATERAL =4\n};\n\n/** Filters used in pyramid decomposition */\nenum\n{\n    CV_GAUSSIAN_5x5 = 7\n};\n\n/** Special filters */\nenum\n{\n    CV_SCHARR =-1,\n    CV_MAX_SOBEL_KSIZE =7\n};\n\n/** Constants for color conversion */\nenum\n{\n    CV_BGR2BGRA    =0,\n    CV_RGB2RGBA    =CV_BGR2BGRA,\n\n    CV_BGRA2BGR    =1,\n    CV_RGBA2RGB    =CV_BGRA2BGR,\n\n    CV_BGR2RGBA    =2,\n    CV_RGB2BGRA    =CV_BGR2RGBA,\n\n    CV_RGBA2BGR    =3,\n    CV_BGRA2RGB    =CV_RGBA2BGR,\n\n    CV_BGR2RGB     =4,\n    CV_RGB2BGR     =CV_BGR2RGB,\n\n    CV_BGRA2RGBA   =5,\n    CV_RGBA2BGRA   =CV_BGRA2RGBA,\n\n    CV_BGR2GRAY    =6,\n    CV_RGB2GRAY    =7,\n    CV_GRAY2BGR    =8,\n    CV_GRAY2RGB    =CV_GRAY2BGR,\n    CV_GRAY2BGRA   =9,\n    CV_GRAY2RGBA   =CV_GRAY2BGRA,\n    CV_BGRA2GRAY   =10,\n    CV_RGBA2GRAY   =11,\n\n    CV_BGR2BGR565  =12,\n    CV_RGB2BGR565  =13,\n    CV_BGR5652BGR  =14,\n    CV_BGR5652RGB  =15,\n    CV_BGRA2BGR565 =16,\n    CV_RGBA2BGR565 =17,\n    CV_BGR5652BGRA =18,\n    CV_BGR5652RGBA =19,\n\n    CV_GRAY2BGR565 =20,\n    CV_BGR5652GRAY =21,\n\n    CV_BGR2BGR555  =22,\n    CV_RGB2BGR555  =23,\n    CV_BGR5552BGR  =24,\n    CV_BGR5552RGB  =25,\n    CV_BGRA2BGR555 =26,\n    CV_RGBA2BGR555 =27,\n    CV_BGR5552BGRA =28,\n    CV_BGR5552RGBA =29,\n\n    CV_GRAY2BGR555 =30,\n    CV_BGR5552GRAY =31,\n\n    CV_BGR2XYZ     =32,\n    CV_RGB2XYZ     =33,\n    CV_XYZ2BGR     =34,\n    CV_XYZ2RGB     =35,\n\n    CV_BGR2YCrCb   =36,\n    CV_RGB2YCrCb   =37,\n    CV_YCrCb2BGR   =38,\n    CV_YCrCb2RGB   =39,\n\n    CV_BGR2HSV     =40,\n    CV_RGB2HSV     =41,\n\n    CV_BGR2Lab     =44,\n    CV_RGB2Lab     =45,\n\n    CV_BayerBG2BGR =46,\n    CV_BayerGB2BGR =47,\n    CV_BayerRG2BGR =48,\n    CV_BayerGR2BGR =49,\n\n    CV_BayerBG2RGB =CV_BayerRG2BGR,\n    CV_BayerGB2RGB =CV_BayerGR2BGR,\n    CV_BayerRG2RGB =CV_BayerBG2BGR,\n    CV_BayerGR2RGB =CV_BayerGB2BGR,\n\n    CV_BGR2Luv     =50,\n    CV_RGB2Luv     =51,\n    CV_BGR2HLS     =52,\n    CV_RGB2HLS     =53,\n\n    CV_HSV2BGR     =54,\n    CV_HSV2RGB     =55,\n\n    CV_Lab2BGR     =56,\n    CV_Lab2RGB     =57,\n    CV_Luv2BGR     =58,\n    CV_Luv2RGB     =59,\n    CV_HLS2BGR     =60,\n    CV_HLS2RGB     =61,\n\n    CV_BayerBG2BGR_VNG =62,\n    CV_BayerGB2BGR_VNG =63,\n    CV_BayerRG2BGR_VNG =64,\n    CV_BayerGR2BGR_VNG =65,\n\n    CV_BayerBG2RGB_VNG =CV_BayerRG2BGR_VNG,\n    CV_BayerGB2RGB_VNG =CV_BayerGR2BGR_VNG,\n    CV_BayerRG2RGB_VNG =CV_BayerBG2BGR_VNG,\n    CV_BayerGR2RGB_VNG =CV_BayerGB2BGR_VNG,\n\n    CV_BGR2HSV_FULL = 66,\n    CV_RGB2HSV_FULL = 67,\n    CV_BGR2HLS_FULL = 68,\n    CV_RGB2HLS_FULL = 69,\n\n    CV_HSV2BGR_FULL = 70,\n    CV_HSV2RGB_FULL = 71,\n    CV_HLS2BGR_FULL = 72,\n    CV_HLS2RGB_FULL = 73,\n\n    CV_LBGR2Lab     = 74,\n    CV_LRGB2Lab     = 75,\n    CV_LBGR2Luv     = 76,\n    CV_LRGB2Luv     = 77,\n\n    CV_Lab2LBGR     = 78,\n    CV_Lab2LRGB     = 79,\n    CV_Luv2LBGR     = 80,\n    CV_Luv2LRGB     = 81,\n\n    CV_BGR2YUV      = 82,\n    CV_RGB2YUV      = 83,\n    CV_YUV2BGR      = 84,\n    CV_YUV2RGB      = 85,\n\n    CV_BayerBG2GRAY = 86,\n    CV_BayerGB2GRAY = 87,\n    CV_BayerRG2GRAY = 88,\n    CV_BayerGR2GRAY = 89,\n\n    //YUV 4:2:0 formats family\n    CV_YUV2RGB_NV12 = 90,\n    CV_YUV2BGR_NV12 = 91,\n    CV_YUV2RGB_NV21 = 92,\n    CV_YUV2BGR_NV21 = 93,\n    CV_YUV420sp2RGB = CV_YUV2RGB_NV21,\n    CV_YUV420sp2BGR = CV_YUV2BGR_NV21,\n\n    CV_YUV2RGBA_NV12 = 94,\n    CV_YUV2BGRA_NV12 = 95,\n    CV_YUV2RGBA_NV21 = 96,\n    CV_YUV2BGRA_NV21 = 97,\n    CV_YUV420sp2RGBA = CV_YUV2RGBA_NV21,\n    CV_YUV420sp2BGRA = CV_YUV2BGRA_NV21,\n\n    CV_YUV2RGB_YV12 = 98,\n    CV_YUV2BGR_YV12 = 99,\n    CV_YUV2RGB_IYUV = 100,\n    CV_YUV2BGR_IYUV = 101,\n    CV_YUV2RGB_I420 = CV_YUV2RGB_IYUV,\n    CV_YUV2BGR_I420 = CV_YUV2BGR_IYUV,\n    CV_YUV420p2RGB = CV_YUV2RGB_YV12,\n    CV_YUV420p2BGR = CV_YUV2BGR_YV12,\n\n    CV_YUV2RGBA_YV12 = 102,\n    CV_YUV2BGRA_YV12 = 103,\n    CV_YUV2RGBA_IYUV = 104,\n    CV_YUV2BGRA_IYUV = 105,\n    CV_YUV2RGBA_I420 = CV_YUV2RGBA_IYUV,\n    CV_YUV2BGRA_I420 = CV_YUV2BGRA_IYUV,\n    CV_YUV420p2RGBA = CV_YUV2RGBA_YV12,\n    CV_YUV420p2BGRA = CV_YUV2BGRA_YV12,\n\n    CV_YUV2GRAY_420 = 106,\n    CV_YUV2GRAY_NV21 = CV_YUV2GRAY_420,\n    CV_YUV2GRAY_NV12 = CV_YUV2GRAY_420,\n    CV_YUV2GRAY_YV12 = CV_YUV2GRAY_420,\n    CV_YUV2GRAY_IYUV = CV_YUV2GRAY_420,\n    CV_YUV2GRAY_I420 = CV_YUV2GRAY_420,\n    CV_YUV420sp2GRAY = CV_YUV2GRAY_420,\n    CV_YUV420p2GRAY = CV_YUV2GRAY_420,\n\n    //YUV 4:2:2 formats family\n    CV_YUV2RGB_UYVY = 107,\n    CV_YUV2BGR_UYVY = 108,\n    //CV_YUV2RGB_VYUY = 109,\n    //CV_YUV2BGR_VYUY = 110,\n    CV_YUV2RGB_Y422 = CV_YUV2RGB_UYVY,\n    CV_YUV2BGR_Y422 = CV_YUV2BGR_UYVY,\n    CV_YUV2RGB_UYNV = CV_YUV2RGB_UYVY,\n    CV_YUV2BGR_UYNV = CV_YUV2BGR_UYVY,\n\n    CV_YUV2RGBA_UYVY = 111,\n    CV_YUV2BGRA_UYVY = 112,\n    //CV_YUV2RGBA_VYUY = 113,\n    //CV_YUV2BGRA_VYUY = 114,\n    CV_YUV2RGBA_Y422 = CV_YUV2RGBA_UYVY,\n    CV_YUV2BGRA_Y422 = CV_YUV2BGRA_UYVY,\n    CV_YUV2RGBA_UYNV = CV_YUV2RGBA_UYVY,\n    CV_YUV2BGRA_UYNV = CV_YUV2BGRA_UYVY,\n\n    CV_YUV2RGB_YUY2 = 115,\n    CV_YUV2BGR_YUY2 = 116,\n    CV_YUV2RGB_YVYU = 117,\n    CV_YUV2BGR_YVYU = 118,\n    CV_YUV2RGB_YUYV = CV_YUV2RGB_YUY2,\n    CV_YUV2BGR_YUYV = CV_YUV2BGR_YUY2,\n    CV_YUV2RGB_YUNV = CV_YUV2RGB_YUY2,\n    CV_YUV2BGR_YUNV = CV_YUV2BGR_YUY2,\n\n    CV_YUV2RGBA_YUY2 = 119,\n    CV_YUV2BGRA_YUY2 = 120,\n    CV_YUV2RGBA_YVYU = 121,\n    CV_YUV2BGRA_YVYU = 122,\n    CV_YUV2RGBA_YUYV = CV_YUV2RGBA_YUY2,\n    CV_YUV2BGRA_YUYV = CV_YUV2BGRA_YUY2,\n    CV_YUV2RGBA_YUNV = CV_YUV2RGBA_YUY2,\n    CV_YUV2BGRA_YUNV = CV_YUV2BGRA_YUY2,\n\n    CV_YUV2GRAY_UYVY = 123,\n    CV_YUV2GRAY_YUY2 = 124,\n    //CV_YUV2GRAY_VYUY = CV_YUV2GRAY_UYVY,\n    CV_YUV2GRAY_Y422 = CV_YUV2GRAY_UYVY,\n    CV_YUV2GRAY_UYNV = CV_YUV2GRAY_UYVY,\n    CV_YUV2GRAY_YVYU = CV_YUV2GRAY_YUY2,\n    CV_YUV2GRAY_YUYV = CV_YUV2GRAY_YUY2,\n    CV_YUV2GRAY_YUNV = CV_YUV2GRAY_YUY2,\n\n    // alpha premultiplication\n    CV_RGBA2mRGBA = 125,\n    CV_mRGBA2RGBA = 126,\n\n    CV_RGB2YUV_I420 = 127,\n    CV_BGR2YUV_I420 = 128,\n    CV_RGB2YUV_IYUV = CV_RGB2YUV_I420,\n    CV_BGR2YUV_IYUV = CV_BGR2YUV_I420,\n\n    CV_RGBA2YUV_I420 = 129,\n    CV_BGRA2YUV_I420 = 130,\n    CV_RGBA2YUV_IYUV = CV_RGBA2YUV_I420,\n    CV_BGRA2YUV_IYUV = CV_BGRA2YUV_I420,\n    CV_RGB2YUV_YV12  = 131,\n    CV_BGR2YUV_YV12  = 132,\n    CV_RGBA2YUV_YV12 = 133,\n    CV_BGRA2YUV_YV12 = 134,\n\n    // Edge-Aware Demosaicing\n    CV_BayerBG2BGR_EA = 135,\n    CV_BayerGB2BGR_EA = 136,\n    CV_BayerRG2BGR_EA = 137,\n    CV_BayerGR2BGR_EA = 138,\n\n    CV_BayerBG2RGB_EA = CV_BayerRG2BGR_EA,\n    CV_BayerGB2RGB_EA = CV_BayerGR2BGR_EA,\n    CV_BayerRG2RGB_EA = CV_BayerBG2BGR_EA,\n    CV_BayerGR2RGB_EA = CV_BayerGB2BGR_EA,\n\n    CV_BayerBG2BGRA =139,\n    CV_BayerGB2BGRA =140,\n    CV_BayerRG2BGRA =141,\n    CV_BayerGR2BGRA =142,\n\n    CV_BayerBG2RGBA =CV_BayerRG2BGRA,\n    CV_BayerGB2RGBA =CV_BayerGR2BGRA,\n    CV_BayerRG2RGBA =CV_BayerBG2BGRA,\n    CV_BayerGR2RGBA =CV_BayerGB2BGRA,\n\n    CV_COLORCVT_MAX  = 143\n};\n\n\n/** Sub-pixel interpolation methods */\nenum\n{\n    CV_INTER_NN        =0,\n    CV_INTER_LINEAR    =1,\n    CV_INTER_CUBIC     =2,\n    CV_INTER_AREA      =3,\n    CV_INTER_LANCZOS4  =4\n};\n\n/** ... and other image warping flags */\nenum\n{\n    CV_WARP_FILL_OUTLIERS =8,\n    CV_WARP_INVERSE_MAP  =16\n};\n\n/** Shapes of a structuring element for morphological operations\n@see cv::MorphShapes, cv::getStructuringElement\n*/\nenum MorphShapes_c\n{\n    CV_SHAPE_RECT      =0,\n    CV_SHAPE_CROSS     =1,\n    CV_SHAPE_ELLIPSE   =2,\n    CV_SHAPE_CUSTOM    =100 //!< custom structuring element\n};\n\n/** Morphological operations */\nenum\n{\n    CV_MOP_ERODE        =0,\n    CV_MOP_DILATE       =1,\n    CV_MOP_OPEN         =2,\n    CV_MOP_CLOSE        =3,\n    CV_MOP_GRADIENT     =4,\n    CV_MOP_TOPHAT       =5,\n    CV_MOP_BLACKHAT     =6\n};\n\n/** Spatial and central moments */\ntypedef struct CvMoments\n{\n    double  m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; /**< spatial moments */\n    double  mu20, mu11, mu02, mu30, mu21, mu12, mu03; /**< central moments */\n    double  inv_sqrt_m00; /**< m00 != 0 ? 1/sqrt(m00) : 0 */\n\n#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)\n    CvMoments(){}\n    CvMoments(const cv::Moments& m)\n    {\n        m00 = m.m00; m10 = m.m10; m01 = m.m01;\n        m20 = m.m20; m11 = m.m11; m02 = m.m02;\n        m30 = m.m30; m21 = m.m21; m12 = m.m12; m03 = m.m03;\n        mu20 = m.mu20; mu11 = m.mu11; mu02 = m.mu02;\n        mu30 = m.mu30; mu21 = m.mu21; mu12 = m.mu12; mu03 = m.mu03;\n        double am00 = std::abs(m.m00);\n        inv_sqrt_m00 = am00 > DBL_EPSILON ? 1./std::sqrt(am00) : 0;\n    }\n    operator cv::Moments() const\n    {\n        return cv::Moments(m00, m10, m01, m20, m11, m02, m30, m21, m12, m03);\n    }\n#endif\n}\nCvMoments;\n\n#ifdef __cplusplus\n} // extern \"C\"\n\nCV_INLINE CvMoments cvMoments()\n{\n#if !defined(CV__ENABLE_C_API_CTORS)\n    CvMoments self = CV_STRUCT_INITIALIZER; return self;\n#else\n    return CvMoments();\n#endif\n}\n\nCV_INLINE CvMoments cvMoments(const cv::Moments& m)\n{\n#if !defined(CV__ENABLE_C_API_CTORS)\n    double am00 = std::abs(m.m00);\n    CvMoments self = {\n        m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03,\n        m.mu20, m.mu11, m.mu02, m.mu30, m.mu21, m.mu12, m.mu03,\n        am00 > DBL_EPSILON ? 1./std::sqrt(am00) : 0\n    };\n    return self;\n#else\n    return CvMoments(m);\n#endif\n}\n\nextern \"C\" {\n#endif // __cplusplus\n\n/** Hu invariants */\ntypedef struct CvHuMoments\n{\n    double hu1, hu2, hu3, hu4, hu5, hu6, hu7; /**< Hu invariants */\n}\nCvHuMoments;\n\n/** Template matching methods */\nenum\n{\n    CV_TM_SQDIFF        =0,\n    CV_TM_SQDIFF_NORMED =1,\n    CV_TM_CCORR         =2,\n    CV_TM_CCORR_NORMED  =3,\n    CV_TM_CCOEFF        =4,\n    CV_TM_CCOEFF_NORMED =5\n};\n\ntypedef float (CV_CDECL * CvDistanceFunction)( const float* a, const float* b, void* user_param );\n\n/** Contour retrieval modes */\nenum\n{\n    CV_RETR_EXTERNAL=0,\n    CV_RETR_LIST=1,\n    CV_RETR_CCOMP=2,\n    CV_RETR_TREE=3,\n    CV_RETR_FLOODFILL=4\n};\n\n/** Contour approximation methods */\nenum\n{\n    CV_CHAIN_CODE=0,\n    CV_CHAIN_APPROX_NONE=1,\n    CV_CHAIN_APPROX_SIMPLE=2,\n    CV_CHAIN_APPROX_TC89_L1=3,\n    CV_CHAIN_APPROX_TC89_KCOS=4,\n    CV_LINK_RUNS=5\n};\n\n/*\nInternal structure that is used for sequential retrieving contours from the image.\nIt supports both hierarchical and plane variants of Suzuki algorithm.\n*/\ntypedef struct _CvContourScanner* CvContourScanner;\n\n/** Freeman chain reader state */\ntypedef struct CvChainPtReader\n{\n    CV_SEQ_READER_FIELDS()\n    char      code;\n    CvPoint   pt;\n    schar     deltas[8][2];\n}\nCvChainPtReader;\n\n/** initializes 8-element array for fast access to 3x3 neighborhood of a pixel */\n#define  CV_INIT_3X3_DELTAS( deltas, step, nch )            \\\n    ((deltas)[0] =  (nch),  (deltas)[1] = -(step) + (nch),  \\\n     (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch),  \\\n     (deltas)[4] = -(nch),  (deltas)[5] =  (step) - (nch),  \\\n     (deltas)[6] =  (step), (deltas)[7] =  (step) + (nch))\n\n\n/** Contour approximation algorithms */\nenum\n{\n    CV_POLY_APPROX_DP = 0\n};\n\n/** Shape matching methods */\nenum\n{\n    CV_CONTOURS_MATCH_I1  =1, //!< \\f[I_1(A,B) =  \\sum _{i=1...7}  \\left |  \\frac{1}{m^A_i} -  \\frac{1}{m^B_i} \\right |\\f]\n    CV_CONTOURS_MATCH_I2  =2, //!< \\f[I_2(A,B) =  \\sum _{i=1...7}  \\left | m^A_i - m^B_i  \\right |\\f]\n    CV_CONTOURS_MATCH_I3  =3  //!< \\f[I_3(A,B) =  \\max _{i=1...7}  \\frac{ \\left| m^A_i - m^B_i \\right| }{ \\left| m^A_i \\right| }\\f]\n};\n\n/** Shape orientation */\nenum\n{\n    CV_CLOCKWISE         =1,\n    CV_COUNTER_CLOCKWISE =2\n};\n\n\n/** Convexity defect */\ntypedef struct CvConvexityDefect\n{\n    CvPoint* start; /**< point of the contour where the defect begins */\n    CvPoint* end; /**< point of the contour where the defect ends */\n    CvPoint* depth_point; /**< the farthest from the convex hull point within the defect */\n    float depth; /**< distance between the farthest point and the convex hull */\n} CvConvexityDefect;\n\n\n/** Histogram comparison methods */\nenum\n{\n    CV_COMP_CORREL        =0,\n    CV_COMP_CHISQR        =1,\n    CV_COMP_INTERSECT     =2,\n    CV_COMP_BHATTACHARYYA =3,\n    CV_COMP_HELLINGER     =CV_COMP_BHATTACHARYYA,\n    CV_COMP_CHISQR_ALT    =4,\n    CV_COMP_KL_DIV        =5\n};\n\n/** Mask size for distance transform */\nenum\n{\n    CV_DIST_MASK_3   =3,\n    CV_DIST_MASK_5   =5,\n    CV_DIST_MASK_PRECISE =0\n};\n\n/** Content of output label array: connected components or pixels */\nenum\n{\n  CV_DIST_LABEL_CCOMP = 0,\n  CV_DIST_LABEL_PIXEL = 1\n};\n\n/** Distance types for Distance Transform and M-estimators */\nenum\n{\n    CV_DIST_USER    =-1,  /**< User defined distance */\n    CV_DIST_L1      =1,   /**< distance = |x1-x2| + |y1-y2| */\n    CV_DIST_L2      =2,   /**< the simple euclidean distance */\n    CV_DIST_C       =3,   /**< distance = max(|x1-x2|,|y1-y2|) */\n    CV_DIST_L12     =4,   /**< L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) */\n    CV_DIST_FAIR    =5,   /**< distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 */\n    CV_DIST_WELSCH  =6,   /**< distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 */\n    CV_DIST_HUBER   =7    /**< distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345 */\n};\n\n\n/** Threshold types */\nenum\n{\n    CV_THRESH_BINARY      =0,  /**< value = value > threshold ? max_value : 0       */\n    CV_THRESH_BINARY_INV  =1,  /**< value = value > threshold ? 0 : max_value       */\n    CV_THRESH_TRUNC       =2,  /**< value = value > threshold ? threshold : value   */\n    CV_THRESH_TOZERO      =3,  /**< value = value > threshold ? value : 0           */\n    CV_THRESH_TOZERO_INV  =4,  /**< value = value > threshold ? 0 : value           */\n    CV_THRESH_MASK        =7,\n    CV_THRESH_OTSU        =8, /**< use Otsu algorithm to choose the optimal threshold value;\n                                 combine the flag with one of the above CV_THRESH_* values */\n    CV_THRESH_TRIANGLE    =16  /**< use Triangle algorithm to choose the optimal threshold value;\n                                 combine the flag with one of the above CV_THRESH_* values, but not\n                                 with CV_THRESH_OTSU */\n};\n\n/** Adaptive threshold methods */\nenum\n{\n    CV_ADAPTIVE_THRESH_MEAN_C  =0,\n    CV_ADAPTIVE_THRESH_GAUSSIAN_C  =1\n};\n\n/** FloodFill flags */\nenum\n{\n    CV_FLOODFILL_FIXED_RANGE =(1 << 16),\n    CV_FLOODFILL_MASK_ONLY   =(1 << 17)\n};\n\n\n/** Canny edge detector flags */\nenum\n{\n    CV_CANNY_L2_GRADIENT  =(1 << 31)\n};\n\n/** Variants of a Hough transform */\nenum\n{\n    CV_HOUGH_STANDARD =0,\n    CV_HOUGH_PROBABILISTIC =1,\n    CV_HOUGH_MULTI_SCALE =2,\n    CV_HOUGH_GRADIENT =3\n};\n\n\n/* Fast search data structures  */\nstruct CvFeatureTree;\nstruct CvLSH;\nstruct CvLSHOperations;\n\n/** @} */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/imgproc.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_IMGPROC_HPP\n#define OPENCV_IMGPROC_HPP\n\n#include \"opencv2/core.hpp\"\n\n/**\n  @defgroup imgproc Image Processing\n\nThis module includes image-processing functions.\n\n  @{\n    @defgroup imgproc_filter Image Filtering\n\nFunctions and classes described in this section are used to perform various linear or non-linear\nfiltering operations on 2D images (represented as Mat's). It means that for each pixel location\n\\f$(x,y)\\f$ in the source image (normally, rectangular), its neighborhood is considered and used to\ncompute the response. In case of a linear filter, it is a weighted sum of pixel values. In case of\nmorphological operations, it is the minimum or maximum values, and so on. The computed response is\nstored in the destination image at the same location \\f$(x,y)\\f$. It means that the output image\nwill be of the same size as the input image. Normally, the functions support multi-channel arrays,\nin which case every channel is processed independently. Therefore, the output image will also have\nthe same number of channels as the input one.\n\nAnother common feature of the functions and classes described in this section is that, unlike\nsimple arithmetic functions, they need to extrapolate values of some non-existing pixels. For\nexample, if you want to smooth an image using a Gaussian \\f$3 \\times 3\\f$ filter, then, when\nprocessing the left-most pixels in each row, you need pixels to the left of them, that is, outside\nof the image. You can let these pixels be the same as the left-most image pixels (\"replicated\nborder\" extrapolation method), or assume that all the non-existing pixels are zeros (\"constant\nborder\" extrapolation method), and so on. OpenCV enables you to specify the extrapolation method.\nFor details, see #BorderTypes\n\n@anchor filter_depths\n### Depth combinations\nInput depth (src.depth()) | Output depth (ddepth)\n--------------------------|----------------------\nCV_8U                     | -1/CV_16S/CV_32F/CV_64F\nCV_16U/CV_16S             | -1/CV_32F/CV_64F\nCV_32F                    | -1/CV_32F/CV_64F\nCV_64F                    | -1/CV_64F\n\n@note when ddepth=-1, the output image will have the same depth as the source.\n\n    @defgroup imgproc_transform Geometric Image Transformations\n\nThe functions in this section perform various geometrical transformations of 2D images. They do not\nchange the image content but deform the pixel grid and map this deformed grid to the destination\nimage. In fact, to avoid sampling artifacts, the mapping is done in the reverse order, from\ndestination to the source. That is, for each pixel \\f$(x, y)\\f$ of the destination image, the\nfunctions compute coordinates of the corresponding \"donor\" pixel in the source image and copy the\npixel value:\n\n\\f[\\texttt{dst} (x,y)= \\texttt{src} (f_x(x,y), f_y(x,y))\\f]\n\nIn case when you specify the forward mapping \\f$\\left<g_x, g_y\\right>: \\texttt{src} \\rightarrow\n\\texttt{dst}\\f$, the OpenCV functions first compute the corresponding inverse mapping\n\\f$\\left<f_x, f_y\\right>: \\texttt{dst} \\rightarrow \\texttt{src}\\f$ and then use the above formula.\n\nThe actual implementations of the geometrical transformations, from the most generic remap and to\nthe simplest and the fastest resize, need to solve two main problems with the above formula:\n\n- Extrapolation of non-existing pixels. Similarly to the filtering functions described in the\nprevious section, for some \\f$(x,y)\\f$, either one of \\f$f_x(x,y)\\f$, or \\f$f_y(x,y)\\f$, or both\nof them may fall outside of the image. In this case, an extrapolation method needs to be used.\nOpenCV provides the same selection of extrapolation methods as in the filtering functions. In\naddition, it provides the method #BORDER_TRANSPARENT. This means that the corresponding pixels in\nthe destination image will not be modified at all.\n\n- Interpolation of pixel values. Usually \\f$f_x(x,y)\\f$ and \\f$f_y(x,y)\\f$ are floating-point\nnumbers. This means that \\f$\\left<f_x, f_y\\right>\\f$ can be either an affine or perspective\ntransformation, or radial lens distortion correction, and so on. So, a pixel value at fractional\ncoordinates needs to be retrieved. In the simplest case, the coordinates can be just rounded to the\nnearest integer coordinates and the corresponding pixel can be used. This is called a\nnearest-neighbor interpolation. However, a better result can be achieved by using more\nsophisticated [interpolation methods](http://en.wikipedia.org/wiki/Multivariate_interpolation) ,\nwhere a polynomial function is fit into some neighborhood of the computed pixel \\f$(f_x(x,y),\nf_y(x,y))\\f$, and then the value of the polynomial at \\f$(f_x(x,y), f_y(x,y))\\f$ is taken as the\ninterpolated pixel value. In OpenCV, you can choose between several interpolation methods. See\nresize for details.\n\n@note The geometrical transformations do not work with `CV_8S` or `CV_32S` images.\n\n    @defgroup imgproc_misc Miscellaneous Image Transformations\n    @defgroup imgproc_draw Drawing Functions\n\nDrawing functions work with matrices/images of arbitrary depth. The boundaries of the shapes can be\nrendered with antialiasing (implemented only for 8-bit images for now). All the functions include\nthe parameter color that uses an RGB value (that may be constructed with the Scalar constructor )\nfor color images and brightness for grayscale images. For color images, the channel ordering is\nnormally *Blue, Green, Red*. This is what imshow, imread, and imwrite expect. So, if you form a\ncolor using the Scalar constructor, it should look like:\n\n\\f[\\texttt{Scalar} (blue \\_ component, green \\_ component, red \\_ component[, alpha \\_ component])\\f]\n\nIf you are using your own image rendering and I/O functions, you can use any channel ordering. The\ndrawing functions process each channel independently and do not depend on the channel order or even\non the used color space. The whole image can be converted from BGR to RGB or to a different color\nspace using cvtColor .\n\nIf a drawn figure is partially or completely outside the image, the drawing functions clip it. Also,\nmany drawing functions can handle pixel coordinates specified with sub-pixel accuracy. This means\nthat the coordinates can be passed as fixed-point numbers encoded as integers. The number of\nfractional bits is specified by the shift parameter and the real point coordinates are calculated as\n\\f$\\texttt{Point}(x,y)\\rightarrow\\texttt{Point2f}(x*2^{-shift},y*2^{-shift})\\f$ . This feature is\nespecially effective when rendering antialiased shapes.\n\n@note The functions do not support alpha-transparency when the target image is 4-channel. In this\ncase, the color[3] is simply copied to the repainted pixels. Thus, if you want to paint\nsemi-transparent shapes, you can paint them in a separate buffer and then blend it with the main\nimage.\n\n    @defgroup imgproc_color_conversions Color Space Conversions\n    @defgroup imgproc_colormap ColorMaps in OpenCV\n\nThe human perception isn't built for observing fine changes in grayscale images. Human eyes are more\nsensitive to observing changes between colors, so you often need to recolor your grayscale images to\nget a clue about them. OpenCV now comes with various colormaps to enhance the visualization in your\ncomputer vision application.\n\nIn OpenCV you only need applyColorMap to apply a colormap on a given image. The following sample\ncode reads the path to an image from command line, applies a Jet colormap on it and shows the\nresult:\n\n@include snippets/imgproc_applyColorMap.cpp\n\n@see #ColormapTypes\n\n    @defgroup imgproc_subdiv2d Planar Subdivision\n\nThe Subdiv2D class described in this section is used to perform various planar subdivision on\na set of 2D points (represented as vector of Point2f). OpenCV subdivides a plane into triangles\nusing the Delaunay's algorithm, which corresponds to the dual graph of the Voronoi diagram.\nIn the figure below, the Delaunay's triangulation is marked with black lines and the Voronoi\ndiagram with red lines.\n\n![Delaunay triangulation (black) and Voronoi (red)](pics/delaunay_voronoi.png)\n\nThe subdivisions can be used for the 3D piece-wise transformation of a plane, morphing, fast\nlocation of points on the plane, building special graphs (such as NNG,RNG), and so forth.\n\n    @defgroup imgproc_hist Histograms\n    @defgroup imgproc_shape Structural Analysis and Shape Descriptors\n    @defgroup imgproc_motion Motion Analysis and Object Tracking\n    @defgroup imgproc_feature Feature Detection\n    @defgroup imgproc_object Object Detection\n    @defgroup imgproc_segmentation Image Segmentation\n    @defgroup imgproc_c C API\n    @defgroup imgproc_hal Hardware Acceleration Layer\n    @{\n        @defgroup imgproc_hal_functions Functions\n        @defgroup imgproc_hal_interface Interface\n    @}\n  @}\n*/\n\nnamespace cv\n{\n\n/** @addtogroup imgproc\n@{\n*/\n\n//! @addtogroup imgproc_filter\n//! @{\n\nenum SpecialFilter {\n    FILTER_SCHARR = -1\n};\n\n//! type of morphological operation\nenum MorphTypes{\n    MORPH_ERODE    = 0, //!< see #erode\n    MORPH_DILATE   = 1, //!< see #dilate\n    MORPH_OPEN     = 2, //!< an opening operation\n                        //!< \\f[\\texttt{dst} = \\mathrm{open} ( \\texttt{src} , \\texttt{element} )= \\mathrm{dilate} ( \\mathrm{erode} ( \\texttt{src} , \\texttt{element} ))\\f]\n    MORPH_CLOSE    = 3, //!< a closing operation\n                        //!< \\f[\\texttt{dst} = \\mathrm{close} ( \\texttt{src} , \\texttt{element} )= \\mathrm{erode} ( \\mathrm{dilate} ( \\texttt{src} , \\texttt{element} ))\\f]\n    MORPH_GRADIENT = 4, //!< a morphological gradient\n                        //!< \\f[\\texttt{dst} = \\mathrm{morph\\_grad} ( \\texttt{src} , \\texttt{element} )= \\mathrm{dilate} ( \\texttt{src} , \\texttt{element} )- \\mathrm{erode} ( \\texttt{src} , \\texttt{element} )\\f]\n    MORPH_TOPHAT   = 5, //!< \"top hat\"\n                        //!< \\f[\\texttt{dst} = \\mathrm{tophat} ( \\texttt{src} , \\texttt{element} )= \\texttt{src} - \\mathrm{open} ( \\texttt{src} , \\texttt{element} )\\f]\n    MORPH_BLACKHAT = 6, //!< \"black hat\"\n                        //!< \\f[\\texttt{dst} = \\mathrm{blackhat} ( \\texttt{src} , \\texttt{element} )= \\mathrm{close} ( \\texttt{src} , \\texttt{element} )- \\texttt{src}\\f]\n    MORPH_HITMISS  = 7  //!< \"hit or miss\"\n                        //!<   .- Only supported for CV_8UC1 binary images. A tutorial can be found in the documentation\n};\n\n//! shape of the structuring element\nenum MorphShapes {\n    MORPH_RECT    = 0, //!< a rectangular structuring element:  \\f[E_{ij}=1\\f]\n    MORPH_CROSS   = 1, //!< a cross-shaped structuring element:\n                       //!< \\f[E_{ij} = \\begin{cases} 1 & \\texttt{if } {i=\\texttt{anchor.y } {or } {j=\\texttt{anchor.x}}} \\\\0 & \\texttt{otherwise} \\end{cases}\\f]\n    MORPH_ELLIPSE = 2 //!< an elliptic structuring element, that is, a filled ellipse inscribed\n                      //!< into the rectangle Rect(0, 0, esize.width, 0.esize.height)\n};\n\n//! @} imgproc_filter\n\n//! @addtogroup imgproc_transform\n//! @{\n\n//! interpolation algorithm\nenum InterpolationFlags{\n    /** nearest neighbor interpolation */\n    INTER_NEAREST        = 0,\n    /** bilinear interpolation */\n    INTER_LINEAR         = 1,\n    /** bicubic interpolation */\n    INTER_CUBIC          = 2,\n    /** resampling using pixel area relation. It may be a preferred method for image decimation, as\n    it gives moire'-free results. But when the image is zoomed, it is similar to the INTER_NEAREST\n    method. */\n    INTER_AREA           = 3,\n    /** Lanczos interpolation over 8x8 neighborhood */\n    INTER_LANCZOS4       = 4,\n    /** Bit exact bilinear interpolation */\n    INTER_LINEAR_EXACT = 5,\n    /** Bit exact nearest neighbor interpolation. This will produce same results as\n    the nearest neighbor method in PIL, scikit-image or Matlab. */\n    INTER_NEAREST_EXACT  = 6,\n    /** mask for interpolation codes */\n    INTER_MAX            = 7,\n    /** flag, fills all of the destination image pixels. If some of them correspond to outliers in the\n    source image, they are set to zero */\n    WARP_FILL_OUTLIERS   = 8,\n    /** flag, inverse transformation\n\n    For example, #linearPolar or #logPolar transforms:\n    - flag is __not__ set: \\f$dst( \\rho , \\phi ) = src(x,y)\\f$\n    - flag is set: \\f$dst(x,y) = src( \\rho , \\phi )\\f$\n    */\n    WARP_INVERSE_MAP     = 16\n};\n\n/** \\brief Specify the polar mapping mode\n@sa warpPolar\n*/\nenum WarpPolarMode\n{\n    WARP_POLAR_LINEAR = 0, ///< Remaps an image to/from polar space.\n    WARP_POLAR_LOG = 256   ///< Remaps an image to/from semilog-polar space.\n};\n\nenum InterpolationMasks {\n       INTER_BITS      = 5,\n       INTER_BITS2     = INTER_BITS * 2,\n       INTER_TAB_SIZE  = 1 << INTER_BITS,\n       INTER_TAB_SIZE2 = INTER_TAB_SIZE * INTER_TAB_SIZE\n     };\n\n//! @} imgproc_transform\n\n//! @addtogroup imgproc_misc\n//! @{\n\n//! Distance types for Distance Transform and M-estimators\n//! @see distanceTransform, fitLine\nenum DistanceTypes {\n    DIST_USER    = -1,  //!< User defined distance\n    DIST_L1      = 1,   //!< distance = |x1-x2| + |y1-y2|\n    DIST_L2      = 2,   //!< the simple euclidean distance\n    DIST_C       = 3,   //!< distance = max(|x1-x2|,|y1-y2|)\n    DIST_L12     = 4,   //!< L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1))\n    DIST_FAIR    = 5,   //!< distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998\n    DIST_WELSCH  = 6,   //!< distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846\n    DIST_HUBER   = 7    //!< distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345\n};\n\n//! Mask size for distance transform\nenum DistanceTransformMasks {\n    DIST_MASK_3       = 3, //!< mask=3\n    DIST_MASK_5       = 5, //!< mask=5\n    DIST_MASK_PRECISE = 0  //!<\n};\n\n//! type of the threshold operation\n//! ![threshold types](pics/threshold.png)\nenum ThresholdTypes {\n    THRESH_BINARY     = 0, //!< \\f[\\texttt{dst} (x,y) =  \\fork{\\texttt{maxval}}{if \\(\\texttt{src}(x,y) > \\texttt{thresh}\\)}{0}{otherwise}\\f]\n    THRESH_BINARY_INV = 1, //!< \\f[\\texttt{dst} (x,y) =  \\fork{0}{if \\(\\texttt{src}(x,y) > \\texttt{thresh}\\)}{\\texttt{maxval}}{otherwise}\\f]\n    THRESH_TRUNC      = 2, //!< \\f[\\texttt{dst} (x,y) =  \\fork{\\texttt{threshold}}{if \\(\\texttt{src}(x,y) > \\texttt{thresh}\\)}{\\texttt{src}(x,y)}{otherwise}\\f]\n    THRESH_TOZERO     = 3, //!< \\f[\\texttt{dst} (x,y) =  \\fork{\\texttt{src}(x,y)}{if \\(\\texttt{src}(x,y) > \\texttt{thresh}\\)}{0}{otherwise}\\f]\n    THRESH_TOZERO_INV = 4, //!< \\f[\\texttt{dst} (x,y) =  \\fork{0}{if \\(\\texttt{src}(x,y) > \\texttt{thresh}\\)}{\\texttt{src}(x,y)}{otherwise}\\f]\n    THRESH_MASK       = 7,\n    THRESH_OTSU       = 8, //!< flag, use Otsu algorithm to choose the optimal threshold value\n    THRESH_TRIANGLE   = 16 //!< flag, use Triangle algorithm to choose the optimal threshold value\n};\n\n//! adaptive threshold algorithm\n//! @see adaptiveThreshold\nenum AdaptiveThresholdTypes {\n    /** the threshold value \\f$T(x,y)\\f$ is a mean of the \\f$\\texttt{blockSize} \\times\n    \\texttt{blockSize}\\f$ neighborhood of \\f$(x, y)\\f$ minus C */\n    ADAPTIVE_THRESH_MEAN_C     = 0,\n    /** the threshold value \\f$T(x, y)\\f$ is a weighted sum (cross-correlation with a Gaussian\n    window) of the \\f$\\texttt{blockSize} \\times \\texttt{blockSize}\\f$ neighborhood of \\f$(x, y)\\f$\n    minus C . The default sigma (standard deviation) is used for the specified blockSize . See\n    #getGaussianKernel*/\n    ADAPTIVE_THRESH_GAUSSIAN_C = 1\n};\n\n//! class of the pixel in GrabCut algorithm\nenum GrabCutClasses {\n    GC_BGD    = 0,  //!< an obvious background pixels\n    GC_FGD    = 1,  //!< an obvious foreground (object) pixel\n    GC_PR_BGD = 2,  //!< a possible background pixel\n    GC_PR_FGD = 3   //!< a possible foreground pixel\n};\n\n//! GrabCut algorithm flags\nenum GrabCutModes {\n    /** The function initializes the state and the mask using the provided rectangle. After that it\n    runs iterCount iterations of the algorithm. */\n    GC_INIT_WITH_RECT  = 0,\n    /** The function initializes the state using the provided mask. Note that GC_INIT_WITH_RECT\n    and GC_INIT_WITH_MASK can be combined. Then, all the pixels outside of the ROI are\n    automatically initialized with GC_BGD .*/\n    GC_INIT_WITH_MASK  = 1,\n    /** The value means that the algorithm should just resume. */\n    GC_EVAL            = 2,\n    /** The value means that the algorithm should just run the grabCut algorithm (a single iteration) with the fixed model */\n    GC_EVAL_FREEZE_MODEL = 3\n};\n\n//! distanceTransform algorithm flags\nenum DistanceTransformLabelTypes {\n    /** each connected component of zeros in src (as well as all the non-zero pixels closest to the\n    connected component) will be assigned the same label */\n    DIST_LABEL_CCOMP = 0,\n    /** each zero pixel (and all the non-zero pixels closest to it) gets its own label. */\n    DIST_LABEL_PIXEL = 1\n};\n\n//! floodfill algorithm flags\nenum FloodFillFlags {\n    /** If set, the difference between the current pixel and seed pixel is considered. Otherwise,\n    the difference between neighbor pixels is considered (that is, the range is floating). */\n    FLOODFILL_FIXED_RANGE = 1 << 16,\n    /** If set, the function does not change the image ( newVal is ignored), and only fills the\n    mask with the value specified in bits 8-16 of flags as described above. This option only make\n    sense in function variants that have the mask parameter. */\n    FLOODFILL_MASK_ONLY   = 1 << 17\n};\n\n//! @} imgproc_misc\n\n//! @addtogroup imgproc_shape\n//! @{\n\n//! connected components statistics\nenum ConnectedComponentsTypes {\n    CC_STAT_LEFT   = 0, //!< The leftmost (x) coordinate which is the inclusive start of the bounding\n                        //!< box in the horizontal direction.\n    CC_STAT_TOP    = 1, //!< The topmost (y) coordinate which is the inclusive start of the bounding\n                        //!< box in the vertical direction.\n    CC_STAT_WIDTH  = 2, //!< The horizontal size of the bounding box\n    CC_STAT_HEIGHT = 3, //!< The vertical size of the bounding box\n    CC_STAT_AREA   = 4, //!< The total area (in pixels) of the connected component\n#ifndef CV_DOXYGEN\n    CC_STAT_MAX    = 5 //!< Max enumeration value. Used internally only for memory allocation\n#endif\n};\n\n//! connected components algorithm\nenum ConnectedComponentsAlgorithmsTypes {\n    CCL_DEFAULT   = -1, //!< BBDT @cite Grana2010 algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity. The parallel implementation described in @cite Bolelli2017 is available for both BBDT and SAUF.\n    CCL_WU        = 0,  //!< SAUF @cite Wu2009 algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity. The parallel implementation described in @cite Bolelli2017 is available for SAUF.\n    CCL_GRANA     = 1,  //!< BBDT @cite Grana2010 algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity. The parallel implementation described in @cite Bolelli2017 is available for both BBDT and SAUF.\n    CCL_BOLELLI   = 2,  //!< Spaghetti @cite Bolelli2019 algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity.\n    CCL_SAUF      = 3,  //!< Same as CCL_WU. It is preferable to use the flag with the name of the algorithm (CCL_SAUF) rather than the one with the name of the first author (CCL_WU).\n    CCL_BBDT      = 4,  //!< Same as CCL_GRANA. It is preferable to use the flag with the name of the algorithm (CCL_BBDT) rather than the one with the name of the first author (CCL_GRANA).\n    CCL_SPAGHETTI = 5,  //!< Same as CCL_BOLELLI. It is preferable to use the flag with the name of the algorithm (CCL_SPAGHETTI) rather than the one with the name of the first author (CCL_BOLELLI).\n};\n\n//! mode of the contour retrieval algorithm\nenum RetrievalModes {\n    /** retrieves only the extreme outer contours. It sets `hierarchy[i][2]=hierarchy[i][3]=-1` for\n    all the contours. */\n    RETR_EXTERNAL  = 0,\n    /** retrieves all of the contours without establishing any hierarchical relationships. */\n    RETR_LIST      = 1,\n    /** retrieves all of the contours and organizes them into a two-level hierarchy. At the top\n    level, there are external boundaries of the components. At the second level, there are\n    boundaries of the holes. If there is another contour inside a hole of a connected component, it\n    is still put at the top level. */\n    RETR_CCOMP     = 2,\n    /** retrieves all of the contours and reconstructs a full hierarchy of nested contours.*/\n    RETR_TREE      = 3,\n    RETR_FLOODFILL = 4 //!<\n};\n\n//! the contour approximation algorithm\nenum ContourApproximationModes {\n    /** stores absolutely all the contour points. That is, any 2 subsequent points (x1,y1) and\n    (x2,y2) of the contour will be either horizontal, vertical or diagonal neighbors, that is,\n    max(abs(x1-x2),abs(y2-y1))==1. */\n    CHAIN_APPROX_NONE      = 1,\n    /** compresses horizontal, vertical, and diagonal segments and leaves only their end points.\n    For example, an up-right rectangular contour is encoded with 4 points. */\n    CHAIN_APPROX_SIMPLE    = 2,\n    /** applies one of the flavors of the Teh-Chin chain approximation algorithm @cite TehChin89 */\n    CHAIN_APPROX_TC89_L1   = 3,\n    /** applies one of the flavors of the Teh-Chin chain approximation algorithm @cite TehChin89 */\n    CHAIN_APPROX_TC89_KCOS = 4\n};\n\n/** @brief Shape matching methods\n\n\\f$A\\f$ denotes object1,\\f$B\\f$ denotes object2\n\n\\f$\\begin{array}{l} m^A_i =  \\mathrm{sign} (h^A_i)  \\cdot \\log{h^A_i} \\\\ m^B_i =  \\mathrm{sign} (h^B_i)  \\cdot \\log{h^B_i} \\end{array}\\f$\n\nand \\f$h^A_i, h^B_i\\f$ are the Hu moments of \\f$A\\f$ and \\f$B\\f$ , respectively.\n*/\nenum ShapeMatchModes {\n    CONTOURS_MATCH_I1  =1, //!< \\f[I_1(A,B) =  \\sum _{i=1...7}  \\left |  \\frac{1}{m^A_i} -  \\frac{1}{m^B_i} \\right |\\f]\n    CONTOURS_MATCH_I2  =2, //!< \\f[I_2(A,B) =  \\sum _{i=1...7}  \\left | m^A_i - m^B_i  \\right |\\f]\n    CONTOURS_MATCH_I3  =3  //!< \\f[I_3(A,B) =  \\max _{i=1...7}  \\frac{ \\left| m^A_i - m^B_i \\right| }{ \\left| m^A_i \\right| }\\f]\n};\n\n//! @} imgproc_shape\n\n//! @addtogroup imgproc_feature\n//! @{\n\n//! Variants of a Hough transform\nenum HoughModes {\n\n    /** classical or standard Hough transform. Every line is represented by two floating-point\n    numbers \\f$(\\rho, \\theta)\\f$ , where \\f$\\rho\\f$ is a distance between (0,0) point and the line,\n    and \\f$\\theta\\f$ is the angle between x-axis and the normal to the line. Thus, the matrix must\n    be (the created sequence will be) of CV_32FC2 type */\n    HOUGH_STANDARD      = 0,\n    /** probabilistic Hough transform (more efficient in case if the picture contains a few long\n    linear segments). It returns line segments rather than the whole line. Each segment is\n    represented by starting and ending points, and the matrix must be (the created sequence will\n    be) of the CV_32SC4 type. */\n    HOUGH_PROBABILISTIC = 1,\n    /** multi-scale variant of the classical Hough transform. The lines are encoded the same way as\n    HOUGH_STANDARD. */\n    HOUGH_MULTI_SCALE   = 2,\n    HOUGH_GRADIENT      = 3, //!< basically *21HT*, described in @cite Yuen90\n    HOUGH_GRADIENT_ALT  = 4, //!< variation of HOUGH_GRADIENT to get better accuracy\n};\n\n//! Variants of Line Segment %Detector\nenum LineSegmentDetectorModes {\n    LSD_REFINE_NONE = 0, //!< No refinement applied\n    LSD_REFINE_STD  = 1, //!< Standard refinement is applied. E.g. breaking arches into smaller straighter line approximations.\n    LSD_REFINE_ADV  = 2  //!< Advanced refinement. Number of false alarms is calculated, lines are\n                         //!< refined through increase of precision, decrement in size, etc.\n};\n\n//! @} imgproc_feature\n\n/** Histogram comparison methods\n  @ingroup imgproc_hist\n*/\nenum HistCompMethods {\n    /** Correlation\n    \\f[d(H_1,H_2) =  \\frac{\\sum_I (H_1(I) - \\bar{H_1}) (H_2(I) - \\bar{H_2})}{\\sqrt{\\sum_I(H_1(I) - \\bar{H_1})^2 \\sum_I(H_2(I) - \\bar{H_2})^2}}\\f]\n    where\n    \\f[\\bar{H_k} =  \\frac{1}{N} \\sum _J H_k(J)\\f]\n    and \\f$N\\f$ is a total number of histogram bins. */\n    HISTCMP_CORREL        = 0,\n    /** Chi-Square\n    \\f[d(H_1,H_2) =  \\sum _I  \\frac{\\left(H_1(I)-H_2(I)\\right)^2}{H_1(I)}\\f] */\n    HISTCMP_CHISQR        = 1,\n    /** Intersection\n    \\f[d(H_1,H_2) =  \\sum _I  \\min (H_1(I), H_2(I))\\f] */\n    HISTCMP_INTERSECT     = 2,\n    /** Bhattacharyya distance\n    (In fact, OpenCV computes Hellinger distance, which is related to Bhattacharyya coefficient.)\n    \\f[d(H_1,H_2) =  \\sqrt{1 - \\frac{1}{\\sqrt{\\bar{H_1} \\bar{H_2} N^2}} \\sum_I \\sqrt{H_1(I) \\cdot H_2(I)}}\\f] */\n    HISTCMP_BHATTACHARYYA = 3,\n    HISTCMP_HELLINGER     = HISTCMP_BHATTACHARYYA, //!< Synonym for HISTCMP_BHATTACHARYYA\n    /** Alternative Chi-Square\n    \\f[d(H_1,H_2) =  2 * \\sum _I  \\frac{\\left(H_1(I)-H_2(I)\\right)^2}{H_1(I)+H_2(I)}\\f]\n    This alternative formula is regularly used for texture comparison. See e.g. @cite Puzicha1997 */\n    HISTCMP_CHISQR_ALT    = 4,\n    /** Kullback-Leibler divergence\n    \\f[d(H_1,H_2) = \\sum _I H_1(I) \\log \\left(\\frac{H_1(I)}{H_2(I)}\\right)\\f] */\n    HISTCMP_KL_DIV        = 5\n};\n\n/** the color conversion codes\n@see @ref imgproc_color_conversions\n@ingroup imgproc_color_conversions\n */\nenum ColorConversionCodes {\n    COLOR_BGR2BGRA     = 0, //!< add alpha channel to RGB or BGR image\n    COLOR_RGB2RGBA     = COLOR_BGR2BGRA,\n\n    COLOR_BGRA2BGR     = 1, //!< remove alpha channel from RGB or BGR image\n    COLOR_RGBA2RGB     = COLOR_BGRA2BGR,\n\n    COLOR_BGR2RGBA     = 2, //!< convert between RGB and BGR color spaces (with or without alpha channel)\n    COLOR_RGB2BGRA     = COLOR_BGR2RGBA,\n\n    COLOR_RGBA2BGR     = 3,\n    COLOR_BGRA2RGB     = COLOR_RGBA2BGR,\n\n    COLOR_BGR2RGB      = 4,\n    COLOR_RGB2BGR      = COLOR_BGR2RGB,\n\n    COLOR_BGRA2RGBA    = 5,\n    COLOR_RGBA2BGRA    = COLOR_BGRA2RGBA,\n\n    COLOR_BGR2GRAY     = 6, //!< convert between RGB/BGR and grayscale, @ref color_convert_rgb_gray \"color conversions\"\n    COLOR_RGB2GRAY     = 7,\n    COLOR_GRAY2BGR     = 8,\n    COLOR_GRAY2RGB     = COLOR_GRAY2BGR,\n    COLOR_GRAY2BGRA    = 9,\n    COLOR_GRAY2RGBA    = COLOR_GRAY2BGRA,\n    COLOR_BGRA2GRAY    = 10,\n    COLOR_RGBA2GRAY    = 11,\n\n    COLOR_BGR2BGR565   = 12, //!< convert between RGB/BGR and BGR565 (16-bit images)\n    COLOR_RGB2BGR565   = 13,\n    COLOR_BGR5652BGR   = 14,\n    COLOR_BGR5652RGB   = 15,\n    COLOR_BGRA2BGR565  = 16,\n    COLOR_RGBA2BGR565  = 17,\n    COLOR_BGR5652BGRA  = 18,\n    COLOR_BGR5652RGBA  = 19,\n\n    COLOR_GRAY2BGR565  = 20, //!< convert between grayscale to BGR565 (16-bit images)\n    COLOR_BGR5652GRAY  = 21,\n\n    COLOR_BGR2BGR555   = 22,  //!< convert between RGB/BGR and BGR555 (16-bit images)\n    COLOR_RGB2BGR555   = 23,\n    COLOR_BGR5552BGR   = 24,\n    COLOR_BGR5552RGB   = 25,\n    COLOR_BGRA2BGR555  = 26,\n    COLOR_RGBA2BGR555  = 27,\n    COLOR_BGR5552BGRA  = 28,\n    COLOR_BGR5552RGBA  = 29,\n\n    COLOR_GRAY2BGR555  = 30, //!< convert between grayscale and BGR555 (16-bit images)\n    COLOR_BGR5552GRAY  = 31,\n\n    COLOR_BGR2XYZ      = 32, //!< convert RGB/BGR to CIE XYZ, @ref color_convert_rgb_xyz \"color conversions\"\n    COLOR_RGB2XYZ      = 33,\n    COLOR_XYZ2BGR      = 34,\n    COLOR_XYZ2RGB      = 35,\n\n    COLOR_BGR2YCrCb    = 36, //!< convert RGB/BGR to luma-chroma (aka YCC), @ref color_convert_rgb_ycrcb \"color conversions\"\n    COLOR_RGB2YCrCb    = 37,\n    COLOR_YCrCb2BGR    = 38,\n    COLOR_YCrCb2RGB    = 39,\n\n    COLOR_BGR2HSV      = 40, //!< convert RGB/BGR to HSV (hue saturation value) with H range 0..180 if 8 bit image, @ref color_convert_rgb_hsv \"color conversions\"\n    COLOR_RGB2HSV      = 41,\n\n    COLOR_BGR2Lab      = 44, //!< convert RGB/BGR to CIE Lab, @ref color_convert_rgb_lab \"color conversions\"\n    COLOR_RGB2Lab      = 45,\n\n    COLOR_BGR2Luv      = 50, //!< convert RGB/BGR to CIE Luv, @ref color_convert_rgb_luv \"color conversions\"\n    COLOR_RGB2Luv      = 51,\n    COLOR_BGR2HLS      = 52, //!< convert RGB/BGR to HLS (hue lightness saturation) with H range 0..180 if 8 bit image, @ref color_convert_rgb_hls \"color conversions\"\n    COLOR_RGB2HLS      = 53,\n\n    COLOR_HSV2BGR      = 54, //!< backward conversions HSV to RGB/BGR with H range 0..180 if 8 bit image\n    COLOR_HSV2RGB      = 55,\n\n    COLOR_Lab2BGR      = 56,\n    COLOR_Lab2RGB      = 57,\n    COLOR_Luv2BGR      = 58,\n    COLOR_Luv2RGB      = 59,\n    COLOR_HLS2BGR      = 60, //!< backward conversions HLS to RGB/BGR with H range 0..180 if 8 bit image\n    COLOR_HLS2RGB      = 61,\n\n    COLOR_BGR2HSV_FULL = 66, //!< convert RGB/BGR to HSV (hue saturation value) with H range 0..255 if 8 bit image, @ref color_convert_rgb_hsv \"color conversions\"\n    COLOR_RGB2HSV_FULL = 67,\n    COLOR_BGR2HLS_FULL = 68, //!< convert RGB/BGR to HLS (hue lightness saturation) with H range 0..255 if 8 bit image, @ref color_convert_rgb_hls \"color conversions\"\n    COLOR_RGB2HLS_FULL = 69,\n\n    COLOR_HSV2BGR_FULL = 70, //!< backward conversions HSV to RGB/BGR with H range 0..255 if 8 bit image\n    COLOR_HSV2RGB_FULL = 71,\n    COLOR_HLS2BGR_FULL = 72, //!< backward conversions HLS to RGB/BGR with H range 0..255 if 8 bit image\n    COLOR_HLS2RGB_FULL = 73,\n\n    COLOR_LBGR2Lab     = 74,\n    COLOR_LRGB2Lab     = 75,\n    COLOR_LBGR2Luv     = 76,\n    COLOR_LRGB2Luv     = 77,\n\n    COLOR_Lab2LBGR     = 78,\n    COLOR_Lab2LRGB     = 79,\n    COLOR_Luv2LBGR     = 80,\n    COLOR_Luv2LRGB     = 81,\n\n    COLOR_BGR2YUV      = 82, //!< convert between RGB/BGR and YUV\n    COLOR_RGB2YUV      = 83,\n    COLOR_YUV2BGR      = 84,\n    COLOR_YUV2RGB      = 85,\n\n    //! YUV 4:2:0 family to RGB\n    COLOR_YUV2RGB_NV12  = 90,\n    COLOR_YUV2BGR_NV12  = 91,\n    COLOR_YUV2RGB_NV21  = 92,\n    COLOR_YUV2BGR_NV21  = 93,\n    COLOR_YUV420sp2RGB  = COLOR_YUV2RGB_NV21,\n    COLOR_YUV420sp2BGR  = COLOR_YUV2BGR_NV21,\n\n    COLOR_YUV2RGBA_NV12 = 94,\n    COLOR_YUV2BGRA_NV12 = 95,\n    COLOR_YUV2RGBA_NV21 = 96,\n    COLOR_YUV2BGRA_NV21 = 97,\n    COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21,\n    COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21,\n\n    COLOR_YUV2RGB_YV12  = 98,\n    COLOR_YUV2BGR_YV12  = 99,\n    COLOR_YUV2RGB_IYUV  = 100,\n    COLOR_YUV2BGR_IYUV  = 101,\n    COLOR_YUV2RGB_I420  = COLOR_YUV2RGB_IYUV,\n    COLOR_YUV2BGR_I420  = COLOR_YUV2BGR_IYUV,\n    COLOR_YUV420p2RGB   = COLOR_YUV2RGB_YV12,\n    COLOR_YUV420p2BGR   = COLOR_YUV2BGR_YV12,\n\n    COLOR_YUV2RGBA_YV12 = 102,\n    COLOR_YUV2BGRA_YV12 = 103,\n    COLOR_YUV2RGBA_IYUV = 104,\n    COLOR_YUV2BGRA_IYUV = 105,\n    COLOR_YUV2RGBA_I420 = COLOR_YUV2RGBA_IYUV,\n    COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV,\n    COLOR_YUV420p2RGBA  = COLOR_YUV2RGBA_YV12,\n    COLOR_YUV420p2BGRA  = COLOR_YUV2BGRA_YV12,\n\n    COLOR_YUV2GRAY_420  = 106,\n    COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420,\n    COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420,\n    COLOR_YUV2GRAY_YV12 = COLOR_YUV2GRAY_420,\n    COLOR_YUV2GRAY_IYUV = COLOR_YUV2GRAY_420,\n    COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420,\n    COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420,\n    COLOR_YUV420p2GRAY  = COLOR_YUV2GRAY_420,\n\n    //! YUV 4:2:2 family to RGB\n    COLOR_YUV2RGB_UYVY = 107,\n    COLOR_YUV2BGR_UYVY = 108,\n    //COLOR_YUV2RGB_VYUY = 109,\n    //COLOR_YUV2BGR_VYUY = 110,\n    COLOR_YUV2RGB_Y422 = COLOR_YUV2RGB_UYVY,\n    COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY,\n    COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY,\n    COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY,\n\n    COLOR_YUV2RGBA_UYVY = 111,\n    COLOR_YUV2BGRA_UYVY = 112,\n    //COLOR_YUV2RGBA_VYUY = 113,\n    //COLOR_YUV2BGRA_VYUY = 114,\n    COLOR_YUV2RGBA_Y422 = COLOR_YUV2RGBA_UYVY,\n    COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY,\n    COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY,\n    COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY,\n\n    COLOR_YUV2RGB_YUY2 = 115,\n    COLOR_YUV2BGR_YUY2 = 116,\n    COLOR_YUV2RGB_YVYU = 117,\n    COLOR_YUV2BGR_YVYU = 118,\n    COLOR_YUV2RGB_YUYV = COLOR_YUV2RGB_YUY2,\n    COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2,\n    COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2,\n    COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2,\n\n    COLOR_YUV2RGBA_YUY2 = 119,\n    COLOR_YUV2BGRA_YUY2 = 120,\n    COLOR_YUV2RGBA_YVYU = 121,\n    COLOR_YUV2BGRA_YVYU = 122,\n    COLOR_YUV2RGBA_YUYV = COLOR_YUV2RGBA_YUY2,\n    COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2,\n    COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2,\n    COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2,\n\n    COLOR_YUV2GRAY_UYVY = 123,\n    COLOR_YUV2GRAY_YUY2 = 124,\n    //CV_YUV2GRAY_VYUY    = CV_YUV2GRAY_UYVY,\n    COLOR_YUV2GRAY_Y422 = COLOR_YUV2GRAY_UYVY,\n    COLOR_YUV2GRAY_UYNV = COLOR_YUV2GRAY_UYVY,\n    COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2,\n    COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2,\n    COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2,\n\n    //! alpha premultiplication\n    COLOR_RGBA2mRGBA    = 125,\n    COLOR_mRGBA2RGBA    = 126,\n\n    //! RGB to YUV 4:2:0 family\n    COLOR_RGB2YUV_I420  = 127,\n    COLOR_BGR2YUV_I420  = 128,\n    COLOR_RGB2YUV_IYUV  = COLOR_RGB2YUV_I420,\n    COLOR_BGR2YUV_IYUV  = COLOR_BGR2YUV_I420,\n\n    COLOR_RGBA2YUV_I420 = 129,\n    COLOR_BGRA2YUV_I420 = 130,\n    COLOR_RGBA2YUV_IYUV = COLOR_RGBA2YUV_I420,\n    COLOR_BGRA2YUV_IYUV = COLOR_BGRA2YUV_I420,\n    COLOR_RGB2YUV_YV12  = 131,\n    COLOR_BGR2YUV_YV12  = 132,\n    COLOR_RGBA2YUV_YV12 = 133,\n    COLOR_BGRA2YUV_YV12 = 134,\n\n    //! Demosaicing\n    COLOR_BayerBG2BGR = 46,\n    COLOR_BayerGB2BGR = 47,\n    COLOR_BayerRG2BGR = 48,\n    COLOR_BayerGR2BGR = 49,\n\n    COLOR_BayerBG2RGB = COLOR_BayerRG2BGR,\n    COLOR_BayerGB2RGB = COLOR_BayerGR2BGR,\n    COLOR_BayerRG2RGB = COLOR_BayerBG2BGR,\n    COLOR_BayerGR2RGB = COLOR_BayerGB2BGR,\n\n    COLOR_BayerBG2GRAY = 86,\n    COLOR_BayerGB2GRAY = 87,\n    COLOR_BayerRG2GRAY = 88,\n    COLOR_BayerGR2GRAY = 89,\n\n    //! Demosaicing using Variable Number of Gradients\n    COLOR_BayerBG2BGR_VNG = 62,\n    COLOR_BayerGB2BGR_VNG = 63,\n    COLOR_BayerRG2BGR_VNG = 64,\n    COLOR_BayerGR2BGR_VNG = 65,\n\n    COLOR_BayerBG2RGB_VNG = COLOR_BayerRG2BGR_VNG,\n    COLOR_BayerGB2RGB_VNG = COLOR_BayerGR2BGR_VNG,\n    COLOR_BayerRG2RGB_VNG = COLOR_BayerBG2BGR_VNG,\n    COLOR_BayerGR2RGB_VNG = COLOR_BayerGB2BGR_VNG,\n\n    //! Edge-Aware Demosaicing\n    COLOR_BayerBG2BGR_EA  = 135,\n    COLOR_BayerGB2BGR_EA  = 136,\n    COLOR_BayerRG2BGR_EA  = 137,\n    COLOR_BayerGR2BGR_EA  = 138,\n\n    COLOR_BayerBG2RGB_EA  = COLOR_BayerRG2BGR_EA,\n    COLOR_BayerGB2RGB_EA  = COLOR_BayerGR2BGR_EA,\n    COLOR_BayerRG2RGB_EA  = COLOR_BayerBG2BGR_EA,\n    COLOR_BayerGR2RGB_EA  = COLOR_BayerGB2BGR_EA,\n\n    //! Demosaicing with alpha channel\n    COLOR_BayerBG2BGRA = 139,\n    COLOR_BayerGB2BGRA = 140,\n    COLOR_BayerRG2BGRA = 141,\n    COLOR_BayerGR2BGRA = 142,\n\n    COLOR_BayerBG2RGBA = COLOR_BayerRG2BGRA,\n    COLOR_BayerGB2RGBA = COLOR_BayerGR2BGRA,\n    COLOR_BayerRG2RGBA = COLOR_BayerBG2BGRA,\n    COLOR_BayerGR2RGBA = COLOR_BayerGB2BGRA,\n\n    COLOR_COLORCVT_MAX  = 143\n};\n\n//! @addtogroup imgproc_shape\n//! @{\n\n//! types of intersection between rectangles\nenum RectanglesIntersectTypes {\n    INTERSECT_NONE = 0, //!< No intersection\n    INTERSECT_PARTIAL  = 1, //!< There is a partial intersection\n    INTERSECT_FULL  = 2 //!< One of the rectangle is fully enclosed in the other\n};\n\n/** types of line\n@ingroup imgproc_draw\n*/\nenum LineTypes {\n    FILLED  = -1,\n    LINE_4  = 4, //!< 4-connected line\n    LINE_8  = 8, //!< 8-connected line\n    LINE_AA = 16 //!< antialiased line\n};\n\n/** Only a subset of Hershey fonts <https://en.wikipedia.org/wiki/Hershey_fonts> are supported\n@ingroup imgproc_draw\n*/\nenum HersheyFonts {\n    FONT_HERSHEY_SIMPLEX        = 0, //!< normal size sans-serif font\n    FONT_HERSHEY_PLAIN          = 1, //!< small size sans-serif font\n    FONT_HERSHEY_DUPLEX         = 2, //!< normal size sans-serif font (more complex than FONT_HERSHEY_SIMPLEX)\n    FONT_HERSHEY_COMPLEX        = 3, //!< normal size serif font\n    FONT_HERSHEY_TRIPLEX        = 4, //!< normal size serif font (more complex than FONT_HERSHEY_COMPLEX)\n    FONT_HERSHEY_COMPLEX_SMALL  = 5, //!< smaller version of FONT_HERSHEY_COMPLEX\n    FONT_HERSHEY_SCRIPT_SIMPLEX = 6, //!< hand-writing style font\n    FONT_HERSHEY_SCRIPT_COMPLEX = 7, //!< more complex variant of FONT_HERSHEY_SCRIPT_SIMPLEX\n    FONT_ITALIC                 = 16 //!< flag for italic font\n};\n\n/** Possible set of marker types used for the cv::drawMarker function\n@ingroup imgproc_draw\n*/\nenum MarkerTypes\n{\n    MARKER_CROSS = 0,           //!< A crosshair marker shape\n    MARKER_TILTED_CROSS = 1,    //!< A 45 degree tilted crosshair marker shape\n    MARKER_STAR = 2,            //!< A star marker shape, combination of cross and tilted cross\n    MARKER_DIAMOND = 3,         //!< A diamond marker shape\n    MARKER_SQUARE = 4,          //!< A square marker shape\n    MARKER_TRIANGLE_UP = 5,     //!< An upwards pointing triangle marker shape\n    MARKER_TRIANGLE_DOWN = 6    //!< A downwards pointing triangle marker shape\n};\n\n/** @brief finds arbitrary template in the grayscale image using Generalized Hough Transform\n*/\nclass CV_EXPORTS_W GeneralizedHough : public Algorithm\n{\npublic:\n    //! set template to search\n    CV_WRAP virtual void setTemplate(InputArray templ, Point templCenter = Point(-1, -1)) = 0;\n    CV_WRAP virtual void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter = Point(-1, -1)) = 0;\n\n    //! find template on image\n    CV_WRAP virtual void detect(InputArray image, OutputArray positions, OutputArray votes = noArray()) = 0;\n    CV_WRAP virtual void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes = noArray()) = 0;\n\n    //! Canny low threshold.\n    CV_WRAP virtual void setCannyLowThresh(int cannyLowThresh) = 0;\n    CV_WRAP virtual int getCannyLowThresh() const = 0;\n\n    //! Canny high threshold.\n    CV_WRAP virtual void setCannyHighThresh(int cannyHighThresh) = 0;\n    CV_WRAP virtual int getCannyHighThresh() const = 0;\n\n    //! Minimum distance between the centers of the detected objects.\n    CV_WRAP virtual void setMinDist(double minDist) = 0;\n    CV_WRAP virtual double getMinDist() const = 0;\n\n    //! Inverse ratio of the accumulator resolution to the image resolution.\n    CV_WRAP virtual void setDp(double dp) = 0;\n    CV_WRAP virtual double getDp() const = 0;\n\n    //! Maximal size of inner buffers.\n    CV_WRAP virtual void setMaxBufferSize(int maxBufferSize) = 0;\n    CV_WRAP virtual int getMaxBufferSize() const = 0;\n};\n\n/** @brief finds arbitrary template in the grayscale image using Generalized Hough Transform\n\nDetects position only without translation and rotation @cite Ballard1981 .\n*/\nclass CV_EXPORTS_W GeneralizedHoughBallard : public GeneralizedHough\n{\npublic:\n    //! R-Table levels.\n    CV_WRAP virtual void setLevels(int levels) = 0;\n    CV_WRAP virtual int getLevels() const = 0;\n\n    //! The accumulator threshold for the template centers at the detection stage. The smaller it is, the more false positions may be detected.\n    CV_WRAP virtual void setVotesThreshold(int votesThreshold) = 0;\n    CV_WRAP virtual int getVotesThreshold() const = 0;\n};\n\n/** @brief finds arbitrary template in the grayscale image using Generalized Hough Transform\n\nDetects position, translation and rotation @cite Guil1999 .\n*/\nclass CV_EXPORTS_W GeneralizedHoughGuil : public GeneralizedHough\n{\npublic:\n    //! Angle difference in degrees between two points in feature.\n    CV_WRAP virtual void setXi(double xi) = 0;\n    CV_WRAP virtual double getXi() const = 0;\n\n    //! Feature table levels.\n    CV_WRAP virtual void setLevels(int levels) = 0;\n    CV_WRAP virtual int getLevels() const = 0;\n\n    //! Maximal difference between angles that treated as equal.\n    CV_WRAP virtual void setAngleEpsilon(double angleEpsilon) = 0;\n    CV_WRAP virtual double getAngleEpsilon() const = 0;\n\n    //! Minimal rotation angle to detect in degrees.\n    CV_WRAP virtual void setMinAngle(double minAngle) = 0;\n    CV_WRAP virtual double getMinAngle() const = 0;\n\n    //! Maximal rotation angle to detect in degrees.\n    CV_WRAP virtual void setMaxAngle(double maxAngle) = 0;\n    CV_WRAP virtual double getMaxAngle() const = 0;\n\n    //! Angle step in degrees.\n    CV_WRAP virtual void setAngleStep(double angleStep) = 0;\n    CV_WRAP virtual double getAngleStep() const = 0;\n\n    //! Angle votes threshold.\n    CV_WRAP virtual void setAngleThresh(int angleThresh) = 0;\n    CV_WRAP virtual int getAngleThresh() const = 0;\n\n    //! Minimal scale to detect.\n    CV_WRAP virtual void setMinScale(double minScale) = 0;\n    CV_WRAP virtual double getMinScale() const = 0;\n\n    //! Maximal scale to detect.\n    CV_WRAP virtual void setMaxScale(double maxScale) = 0;\n    CV_WRAP virtual double getMaxScale() const = 0;\n\n    //! Scale step.\n    CV_WRAP virtual void setScaleStep(double scaleStep) = 0;\n    CV_WRAP virtual double getScaleStep() const = 0;\n\n    //! Scale votes threshold.\n    CV_WRAP virtual void setScaleThresh(int scaleThresh) = 0;\n    CV_WRAP virtual int getScaleThresh() const = 0;\n\n    //! Position votes threshold.\n    CV_WRAP virtual void setPosThresh(int posThresh) = 0;\n    CV_WRAP virtual int getPosThresh() const = 0;\n};\n\n//! @} imgproc_shape\n\n//! @addtogroup imgproc_hist\n//! @{\n\n/** @brief Base class for Contrast Limited Adaptive Histogram Equalization.\n*/\nclass CV_EXPORTS_W CLAHE : public Algorithm\n{\npublic:\n    /** @brief Equalizes the histogram of a grayscale image using Contrast Limited Adaptive Histogram Equalization.\n\n    @param src Source image of type CV_8UC1 or CV_16UC1.\n    @param dst Destination image.\n     */\n    CV_WRAP virtual void apply(InputArray src, OutputArray dst) = 0;\n\n    /** @brief Sets threshold for contrast limiting.\n\n    @param clipLimit threshold value.\n    */\n    CV_WRAP virtual void setClipLimit(double clipLimit) = 0;\n\n    //! Returns threshold value for contrast limiting.\n    CV_WRAP virtual double getClipLimit() const = 0;\n\n    /** @brief Sets size of grid for histogram equalization. Input image will be divided into\n    equally sized rectangular tiles.\n\n    @param tileGridSize defines the number of tiles in row and column.\n    */\n    CV_WRAP virtual void setTilesGridSize(Size tileGridSize) = 0;\n\n    //!@brief Returns Size defines the number of tiles in row and column.\n    CV_WRAP virtual Size getTilesGridSize() const = 0;\n\n    CV_WRAP virtual void collectGarbage() = 0;\n};\n\n//! @} imgproc_hist\n\n//! @addtogroup imgproc_subdiv2d\n//! @{\n\nclass CV_EXPORTS_W Subdiv2D\n{\npublic:\n    /** Subdiv2D point location cases */\n    enum { PTLOC_ERROR        = -2, //!< Point location error\n           PTLOC_OUTSIDE_RECT = -1, //!< Point outside the subdivision bounding rect\n           PTLOC_INSIDE       = 0, //!< Point inside some facet\n           PTLOC_VERTEX       = 1, //!< Point coincides with one of the subdivision vertices\n           PTLOC_ON_EDGE      = 2  //!< Point on some edge\n         };\n\n    /** Subdiv2D edge type navigation (see: getEdge()) */\n    enum { NEXT_AROUND_ORG   = 0x00,\n           NEXT_AROUND_DST   = 0x22,\n           PREV_AROUND_ORG   = 0x11,\n           PREV_AROUND_DST   = 0x33,\n           NEXT_AROUND_LEFT  = 0x13,\n           NEXT_AROUND_RIGHT = 0x31,\n           PREV_AROUND_LEFT  = 0x20,\n           PREV_AROUND_RIGHT = 0x02\n         };\n\n    /** creates an empty Subdiv2D object.\n    To create a new empty Delaunay subdivision you need to use the #initDelaunay function.\n     */\n    CV_WRAP Subdiv2D();\n\n    /** @overload\n\n    @param rect Rectangle that includes all of the 2D points that are to be added to the subdivision.\n\n    The function creates an empty Delaunay subdivision where 2D points can be added using the function\n    insert() . All of the points to be added must be within the specified rectangle, otherwise a runtime\n    error is raised.\n     */\n    CV_WRAP Subdiv2D(Rect rect);\n\n    /** @brief Creates a new empty Delaunay subdivision\n\n    @param rect Rectangle that includes all of the 2D points that are to be added to the subdivision.\n\n     */\n    CV_WRAP void initDelaunay(Rect rect);\n\n    /** @brief Insert a single point into a Delaunay triangulation.\n\n    @param pt Point to insert.\n\n    The function inserts a single point into a subdivision and modifies the subdivision topology\n    appropriately. If a point with the same coordinates exists already, no new point is added.\n    @returns the ID of the point.\n\n    @note If the point is outside of the triangulation specified rect a runtime error is raised.\n     */\n    CV_WRAP int insert(Point2f pt);\n\n    /** @brief Insert multiple points into a Delaunay triangulation.\n\n    @param ptvec Points to insert.\n\n    The function inserts a vector of points into a subdivision and modifies the subdivision topology\n    appropriately.\n     */\n    CV_WRAP void insert(const std::vector<Point2f>& ptvec);\n\n    /** @brief Returns the location of a point within a Delaunay triangulation.\n\n    @param pt Point to locate.\n    @param edge Output edge that the point belongs to or is located to the right of it.\n    @param vertex Optional output vertex the input point coincides with.\n\n    The function locates the input point within the subdivision and gives one of the triangle edges\n    or vertices.\n\n    @returns an integer which specify one of the following five cases for point location:\n    -  The point falls into some facet. The function returns #PTLOC_INSIDE and edge will contain one of\n       edges of the facet.\n    -  The point falls onto the edge. The function returns #PTLOC_ON_EDGE and edge will contain this edge.\n    -  The point coincides with one of the subdivision vertices. The function returns #PTLOC_VERTEX and\n       vertex will contain a pointer to the vertex.\n    -  The point is outside the subdivision reference rectangle. The function returns #PTLOC_OUTSIDE_RECT\n       and no pointers are filled.\n    -  One of input arguments is invalid. A runtime error is raised or, if silent or \"parent\" error\n       processing mode is selected, #PTLOC_ERROR is returned.\n     */\n    CV_WRAP int locate(Point2f pt, CV_OUT int& edge, CV_OUT int& vertex);\n\n    /** @brief Finds the subdivision vertex closest to the given point.\n\n    @param pt Input point.\n    @param nearestPt Output subdivision vertex point.\n\n    The function is another function that locates the input point within the subdivision. It finds the\n    subdivision vertex that is the closest to the input point. It is not necessarily one of vertices\n    of the facet containing the input point, though the facet (located using locate() ) is used as a\n    starting point.\n\n    @returns vertex ID.\n     */\n    CV_WRAP int findNearest(Point2f pt, CV_OUT Point2f* nearestPt = 0);\n\n    /** @brief Returns a list of all edges.\n\n    @param edgeList Output vector.\n\n    The function gives each edge as a 4 numbers vector, where each two are one of the edge\n    vertices. i.e. org_x = v[0], org_y = v[1], dst_x = v[2], dst_y = v[3].\n     */\n    CV_WRAP void getEdgeList(CV_OUT std::vector<Vec4f>& edgeList) const;\n\n    /** @brief Returns a list of the leading edge ID connected to each triangle.\n\n    @param leadingEdgeList Output vector.\n\n    The function gives one edge ID for each triangle.\n     */\n    CV_WRAP void getLeadingEdgeList(CV_OUT std::vector<int>& leadingEdgeList) const;\n\n    /** @brief Returns a list of all triangles.\n\n    @param triangleList Output vector.\n\n    The function gives each triangle as a 6 numbers vector, where each two are one of the triangle\n    vertices. i.e. p1_x = v[0], p1_y = v[1], p2_x = v[2], p2_y = v[3], p3_x = v[4], p3_y = v[5].\n     */\n    CV_WRAP void getTriangleList(CV_OUT std::vector<Vec6f>& triangleList) const;\n\n    /** @brief Returns a list of all Voronoi facets.\n\n    @param idx Vector of vertices IDs to consider. For all vertices you can pass empty vector.\n    @param facetList Output vector of the Voronoi facets.\n    @param facetCenters Output vector of the Voronoi facets center points.\n\n     */\n    CV_WRAP void getVoronoiFacetList(const std::vector<int>& idx, CV_OUT std::vector<std::vector<Point2f> >& facetList,\n                                     CV_OUT std::vector<Point2f>& facetCenters);\n\n    /** @brief Returns vertex location from vertex ID.\n\n    @param vertex vertex ID.\n    @param firstEdge Optional. The first edge ID which is connected to the vertex.\n    @returns vertex (x,y)\n\n     */\n    CV_WRAP Point2f getVertex(int vertex, CV_OUT int* firstEdge = 0) const;\n\n    /** @brief Returns one of the edges related to the given edge.\n\n    @param edge Subdivision edge ID.\n    @param nextEdgeType Parameter specifying which of the related edges to return.\n    The following values are possible:\n    -   NEXT_AROUND_ORG next around the edge origin ( eOnext on the picture below if e is the input edge)\n    -   NEXT_AROUND_DST next around the edge vertex ( eDnext )\n    -   PREV_AROUND_ORG previous around the edge origin (reversed eRnext )\n    -   PREV_AROUND_DST previous around the edge destination (reversed eLnext )\n    -   NEXT_AROUND_LEFT next around the left facet ( eLnext )\n    -   NEXT_AROUND_RIGHT next around the right facet ( eRnext )\n    -   PREV_AROUND_LEFT previous around the left facet (reversed eOnext )\n    -   PREV_AROUND_RIGHT previous around the right facet (reversed eDnext )\n\n    ![sample output](pics/quadedge.png)\n\n    @returns edge ID related to the input edge.\n     */\n    CV_WRAP int getEdge( int edge, int nextEdgeType ) const;\n\n    /** @brief Returns next edge around the edge origin.\n\n    @param edge Subdivision edge ID.\n\n    @returns an integer which is next edge ID around the edge origin: eOnext on the\n    picture above if e is the input edge).\n     */\n    CV_WRAP int nextEdge(int edge) const;\n\n    /** @brief Returns another edge of the same quad-edge.\n\n    @param edge Subdivision edge ID.\n    @param rotate Parameter specifying which of the edges of the same quad-edge as the input\n    one to return. The following values are possible:\n    -   0 - the input edge ( e on the picture below if e is the input edge)\n    -   1 - the rotated edge ( eRot )\n    -   2 - the reversed edge (reversed e (in green))\n    -   3 - the reversed rotated edge (reversed eRot (in green))\n\n    @returns one of the edges ID of the same quad-edge as the input edge.\n     */\n    CV_WRAP int rotateEdge(int edge, int rotate) const;\n    CV_WRAP int symEdge(int edge) const;\n\n    /** @brief Returns the edge origin.\n\n    @param edge Subdivision edge ID.\n    @param orgpt Output vertex location.\n\n    @returns vertex ID.\n     */\n    CV_WRAP int edgeOrg(int edge, CV_OUT Point2f* orgpt = 0) const;\n\n    /** @brief Returns the edge destination.\n\n    @param edge Subdivision edge ID.\n    @param dstpt Output vertex location.\n\n    @returns vertex ID.\n     */\n    CV_WRAP int edgeDst(int edge, CV_OUT Point2f* dstpt = 0) const;\n\nprotected:\n    int newEdge();\n    void deleteEdge(int edge);\n    int newPoint(Point2f pt, bool isvirtual, int firstEdge = 0);\n    void deletePoint(int vtx);\n    void setEdgePoints( int edge, int orgPt, int dstPt );\n    void splice( int edgeA, int edgeB );\n    int connectEdges( int edgeA, int edgeB );\n    void swapEdges( int edge );\n    int isRightOf(Point2f pt, int edge) const;\n    void calcVoronoi();\n    void clearVoronoi();\n    void checkSubdiv() const;\n\n    struct CV_EXPORTS Vertex\n    {\n        Vertex();\n        Vertex(Point2f pt, bool isvirtual, int firstEdge=0);\n        bool isvirtual() const;\n        bool isfree() const;\n\n        int firstEdge;\n        int type;\n        Point2f pt;\n    };\n\n    struct CV_EXPORTS QuadEdge\n    {\n        QuadEdge();\n        QuadEdge(int edgeidx);\n        bool isfree() const;\n\n        int next[4];\n        int pt[4];\n    };\n\n    //! All of the vertices\n    std::vector<Vertex> vtx;\n    //! All of the edges\n    std::vector<QuadEdge> qedges;\n    int freeQEdge;\n    int freePoint;\n    bool validGeometry;\n\n    int recentEdge;\n    //! Top left corner of the bounding rect\n    Point2f topLeft;\n    //! Bottom right corner of the bounding rect\n    Point2f bottomRight;\n};\n\n//! @} imgproc_subdiv2d\n\n//! @addtogroup imgproc_feature\n//! @{\n\n/** @brief Line segment detector class\n\nfollowing the algorithm described at @cite Rafael12 .\n\n@note Implementation has been removed due original code license conflict\n\n*/\nclass CV_EXPORTS_W LineSegmentDetector : public Algorithm\n{\npublic:\n\n    /** @brief Finds lines in the input image.\n\n    This is the output of the default parameters of the algorithm on the above shown image.\n\n    ![image](pics/building_lsd.png)\n\n    @param image A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:\n    `lsd_ptr-\\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);`\n    @param lines A vector of Vec4i or Vec4f elements specifying the beginning and ending point of a line. Where\n    Vec4i/Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly\n    oriented depending on the gradient.\n    @param width Vector of widths of the regions, where the lines are found. E.g. Width of line.\n    @param prec Vector of precisions with which the lines are found.\n    @param nfa Vector containing number of false alarms in the line region, with precision of 10%. The\n    bigger the value, logarithmically better the detection.\n    - -1 corresponds to 10 mean false alarms\n    - 0 corresponds to 1 mean false alarm\n    - 1 corresponds to 0.1 mean false alarms\n    This vector will be calculated only when the objects type is #LSD_REFINE_ADV.\n    */\n    CV_WRAP virtual void detect(InputArray image, OutputArray lines,\n                        OutputArray width = noArray(), OutputArray prec = noArray(),\n                        OutputArray nfa = noArray()) = 0;\n\n    /** @brief Draws the line segments on a given image.\n    @param image The image, where the lines will be drawn. Should be bigger or equal to the image,\n    where the lines were found.\n    @param lines A vector of the lines that needed to be drawn.\n     */\n    CV_WRAP virtual void drawSegments(InputOutputArray image, InputArray lines) = 0;\n\n    /** @brief Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.\n\n    @param size The size of the image, where lines1 and lines2 were found.\n    @param lines1 The first group of lines that needs to be drawn. It is visualized in blue color.\n    @param lines2 The second group of lines. They visualized in red color.\n    @param image Optional image, where the lines will be drawn. The image should be color(3-channel)\n    in order for lines1 and lines2 to be drawn in the above mentioned colors.\n     */\n    CV_WRAP virtual int compareSegments(const Size& size, InputArray lines1, InputArray lines2, InputOutputArray image = noArray()) = 0;\n\n    virtual ~LineSegmentDetector() { }\n};\n\n/** @brief Creates a smart pointer to a LineSegmentDetector object and initializes it.\n\nThe LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want\nto edit those, as to tailor it for their own application.\n\n@param refine The way found lines will be refined, see #LineSegmentDetectorModes\n@param scale The scale of the image that will be used to find the lines. Range (0..1].\n@param sigma_scale Sigma for Gaussian filter. It is computed as sigma = sigma_scale/scale.\n@param quant Bound to the quantization error on the gradient norm.\n@param ang_th Gradient angle tolerance in degrees.\n@param log_eps Detection threshold: -log10(NFA) \\> log_eps. Used only when advance refinement is chosen.\n@param density_th Minimal density of aligned region points in the enclosing rectangle.\n@param n_bins Number of bins in pseudo-ordering of gradient modulus.\n\n@note Implementation has been removed due original code license conflict\n */\nCV_EXPORTS_W Ptr<LineSegmentDetector> createLineSegmentDetector(\n    int refine = LSD_REFINE_STD, double scale = 0.8,\n    double sigma_scale = 0.6, double quant = 2.0, double ang_th = 22.5,\n    double log_eps = 0, double density_th = 0.7, int n_bins = 1024);\n\n//! @} imgproc_feature\n\n//! @addtogroup imgproc_filter\n//! @{\n\n/** @brief Returns Gaussian filter coefficients.\n\nThe function computes and returns the \\f$\\texttt{ksize} \\times 1\\f$ matrix of Gaussian filter\ncoefficients:\n\n\\f[G_i= \\alpha *e^{-(i-( \\texttt{ksize} -1)/2)^2/(2* \\texttt{sigma}^2)},\\f]\n\nwhere \\f$i=0..\\texttt{ksize}-1\\f$ and \\f$\\alpha\\f$ is the scale factor chosen so that \\f$\\sum_i G_i=1\\f$.\n\nTwo of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize\nsmoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly.\nYou may also use the higher-level GaussianBlur.\n@param ksize Aperture size. It should be odd ( \\f$\\texttt{ksize} \\mod 2 = 1\\f$ ) and positive.\n@param sigma Gaussian standard deviation. If it is non-positive, it is computed from ksize as\n`sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8`.\n@param ktype Type of filter coefficients. It can be CV_32F or CV_64F .\n@sa  sepFilter2D, getDerivKernels, getStructuringElement, GaussianBlur\n */\nCV_EXPORTS_W Mat getGaussianKernel( int ksize, double sigma, int ktype = CV_64F );\n\n/** @brief Returns filter coefficients for computing spatial image derivatives.\n\nThe function computes and returns the filter coefficients for spatial image derivatives. When\n`ksize=FILTER_SCHARR`, the Scharr \\f$3 \\times 3\\f$ kernels are generated (see #Scharr). Otherwise, Sobel\nkernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to\n\n@param kx Output matrix of row filter coefficients. It has the type ktype .\n@param ky Output matrix of column filter coefficients. It has the type ktype .\n@param dx Derivative order in respect of x.\n@param dy Derivative order in respect of y.\n@param ksize Aperture size. It can be FILTER_SCHARR, 1, 3, 5, or 7.\n@param normalize Flag indicating whether to normalize (scale down) the filter coefficients or not.\nTheoretically, the coefficients should have the denominator \\f$=2^{ksize*2-dx-dy-2}\\f$. If you are\ngoing to filter floating-point images, you are likely to use the normalized kernels. But if you\ncompute derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve\nall the fractional bits, you may want to set normalize=false .\n@param ktype Type of filter coefficients. It can be CV_32f or CV_64F .\n */\nCV_EXPORTS_W void getDerivKernels( OutputArray kx, OutputArray ky,\n                                   int dx, int dy, int ksize,\n                                   bool normalize = false, int ktype = CV_32F );\n\n/** @brief Returns Gabor filter coefficients.\n\nFor more details about gabor filter equations and parameters, see: [Gabor\nFilter](http://en.wikipedia.org/wiki/Gabor_filter).\n\n@param ksize Size of the filter returned.\n@param sigma Standard deviation of the gaussian envelope.\n@param theta Orientation of the normal to the parallel stripes of a Gabor function.\n@param lambd Wavelength of the sinusoidal factor.\n@param gamma Spatial aspect ratio.\n@param psi Phase offset.\n@param ktype Type of filter coefficients. It can be CV_32F or CV_64F .\n */\nCV_EXPORTS_W Mat getGaborKernel( Size ksize, double sigma, double theta, double lambd,\n                                 double gamma, double psi = CV_PI*0.5, int ktype = CV_64F );\n\n//! returns \"magic\" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.\nstatic inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); }\n\n/** @brief Returns a structuring element of the specified size and shape for morphological operations.\n\nThe function constructs and returns the structuring element that can be further passed to #erode,\n#dilate or #morphologyEx. But you can also construct an arbitrary binary mask yourself and use it as\nthe structuring element.\n\n@param shape Element shape that could be one of #MorphShapes\n@param ksize Size of the structuring element.\n@param anchor Anchor position within the element. The default value \\f$(-1, -1)\\f$ means that the\nanchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor\nposition. In other cases the anchor just regulates how much the result of the morphological\noperation is shifted.\n */\nCV_EXPORTS_W Mat getStructuringElement(int shape, Size ksize, Point anchor = Point(-1,-1));\n\n/** @example samples/cpp/tutorial_code/ImgProc/Smoothing/Smoothing.cpp\nSample code for simple filters\n![Sample screenshot](Smoothing_Tutorial_Result_Median_Filter.jpg)\nCheck @ref tutorial_gausian_median_blur_bilateral_filter \"the corresponding tutorial\" for more details\n */\n\n/** @brief Blurs an image using the median filter.\n\nThe function smoothes an image using the median filter with the \\f$\\texttt{ksize} \\times\n\\texttt{ksize}\\f$ aperture. Each channel of a multi-channel image is processed independently.\nIn-place operation is supported.\n\n@note The median filter uses #BORDER_REPLICATE internally to cope with border pixels, see #BorderTypes\n\n@param src input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be\nCV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.\n@param dst destination array of the same size and type as src.\n@param ksize aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...\n@sa  bilateralFilter, blur, boxFilter, GaussianBlur\n */\nCV_EXPORTS_W void medianBlur( InputArray src, OutputArray dst, int ksize );\n\n/** @brief Blurs an image using a Gaussian filter.\n\nThe function convolves the source image with the specified Gaussian kernel. In-place filtering is\nsupported.\n\n@param src input image; the image can have any number of channels, which are processed\nindependently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.\n@param dst output image of the same size and type as src.\n@param ksize Gaussian kernel size. ksize.width and ksize.height can differ but they both must be\npositive and odd. Or, they can be zero's and then they are computed from sigma.\n@param sigmaX Gaussian kernel standard deviation in X direction.\n@param sigmaY Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be\nequal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height,\nrespectively (see #getGaussianKernel for details); to fully control the result regardless of\npossible future modifications of all this semantics, it is recommended to specify all of ksize,\nsigmaX, and sigmaY.\n@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n\n@sa  sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur\n */\nCV_EXPORTS_W void GaussianBlur( InputArray src, OutputArray dst, Size ksize,\n                                double sigmaX, double sigmaY = 0,\n                                int borderType = BORDER_DEFAULT );\n\n/** @brief Applies the bilateral filter to an image.\n\nThe function applies bilateral filtering to the input image, as described in\nhttp://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html\nbilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is\nvery slow compared to most filters.\n\n_Sigma values_: For simplicity, you can set the 2 sigma values to be the same. If they are small (\\<\n10), the filter will not have much effect, whereas if they are large (\\> 150), they will have a very\nstrong effect, making the image look \"cartoonish\".\n\n_Filter size_: Large filters (d \\> 5) are very slow, so it is recommended to use d=5 for real-time\napplications, and perhaps d=9 for offline applications that need heavy noise filtering.\n\nThis filter does not work inplace.\n@param src Source 8-bit or floating-point, 1-channel or 3-channel image.\n@param dst Destination image of the same size and type as src .\n@param d Diameter of each pixel neighborhood that is used during filtering. If it is non-positive,\nit is computed from sigmaSpace.\n@param sigmaColor Filter sigma in the color space. A larger value of the parameter means that\nfarther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting\nin larger areas of semi-equal color.\n@param sigmaSpace Filter sigma in the coordinate space. A larger value of the parameter means that\nfarther pixels will influence each other as long as their colors are close enough (see sigmaColor\n). When d\\>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is\nproportional to sigmaSpace.\n@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes\n */\nCV_EXPORTS_W void bilateralFilter( InputArray src, OutputArray dst, int d,\n                                   double sigmaColor, double sigmaSpace,\n                                   int borderType = BORDER_DEFAULT );\n\n/** @brief Blurs an image using the box filter.\n\nThe function smooths an image using the kernel:\n\n\\f[\\texttt{K} =  \\alpha \\begin{bmatrix} 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ \\hdotsfor{6} \\\\ 1 & 1 & 1 &  \\cdots & 1 & 1 \\end{bmatrix}\\f]\n\nwhere\n\n\\f[\\alpha = \\begin{cases} \\frac{1}{\\texttt{ksize.width*ksize.height}} & \\texttt{when } \\texttt{normalize=true}  \\\\1 & \\texttt{otherwise}\\end{cases}\\f]\n\nUnnormalized box filter is useful for computing various integral characteristics over each pixel\nneighborhood, such as covariance matrices of image derivatives (used in dense optical flow\nalgorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.\n\n@param src input image.\n@param dst output image of the same size and type as src.\n@param ddepth the output image depth (-1 to use src.depth()).\n@param ksize blurring kernel size.\n@param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel\ncenter.\n@param normalize flag, specifying whether the kernel is normalized by its area or not.\n@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported.\n@sa  blur, bilateralFilter, GaussianBlur, medianBlur, integral\n */\nCV_EXPORTS_W void boxFilter( InputArray src, OutputArray dst, int ddepth,\n                             Size ksize, Point anchor = Point(-1,-1),\n                             bool normalize = true,\n                             int borderType = BORDER_DEFAULT );\n\n/** @brief Calculates the normalized sum of squares of the pixel values overlapping the filter.\n\nFor every pixel \\f$ (x, y) \\f$ in the source image, the function calculates the sum of squares of those neighboring\npixel values which overlap the filter placed over the pixel \\f$ (x, y) \\f$.\n\nThe unnormalized square box filter can be useful in computing local image statistics such as the the local\nvariance and standard deviation around the neighborhood of a pixel.\n\n@param src input image\n@param dst output image of the same size and type as src\n@param ddepth the output image depth (-1 to use src.depth())\n@param ksize kernel size\n@param anchor kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at the kernel\ncenter.\n@param normalize flag, specifying whether the kernel is to be normalized by it's area or not.\n@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported.\n@sa boxFilter\n*/\nCV_EXPORTS_W void sqrBoxFilter( InputArray src, OutputArray dst, int ddepth,\n                                Size ksize, Point anchor = Point(-1, -1),\n                                bool normalize = true,\n                                int borderType = BORDER_DEFAULT );\n\n/** @brief Blurs an image using the normalized box filter.\n\nThe function smooths an image using the kernel:\n\n\\f[\\texttt{K} =  \\frac{1}{\\texttt{ksize.width*ksize.height}} \\begin{bmatrix} 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ \\hdotsfor{6} \\\\ 1 & 1 & 1 &  \\cdots & 1 & 1  \\\\ \\end{bmatrix}\\f]\n\nThe call `blur(src, dst, ksize, anchor, borderType)` is equivalent to `boxFilter(src, dst, src.type(), ksize,\nanchor, true, borderType)`.\n\n@param src input image; it can have any number of channels, which are processed independently, but\nthe depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.\n@param dst output image of the same size and type as src.\n@param ksize blurring kernel size.\n@param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel\ncenter.\n@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported.\n@sa  boxFilter, bilateralFilter, GaussianBlur, medianBlur\n */\nCV_EXPORTS_W void blur( InputArray src, OutputArray dst,\n                        Size ksize, Point anchor = Point(-1,-1),\n                        int borderType = BORDER_DEFAULT );\n\n/** @brief Convolves an image with the kernel.\n\nThe function applies an arbitrary linear filter to an image. In-place operation is supported. When\nthe aperture is partially outside the image, the function interpolates outlier pixel values\naccording to the specified border mode.\n\nThe function does actually compute correlation, not the convolution:\n\n\\f[\\texttt{dst} (x,y) =  \\sum _{ \\substack{0\\leq x' < \\texttt{kernel.cols}\\\\{0\\leq y' < \\texttt{kernel.rows}}}}  \\texttt{kernel} (x',y')* \\texttt{src} (x+x'- \\texttt{anchor.x} ,y+y'- \\texttt{anchor.y} )\\f]\n\nThat is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip\nthe kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows -\nanchor.y - 1)`.\n\nThe function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or\nlarger) and the direct algorithm for small kernels.\n\n@param src input image.\n@param dst output image of the same size and the same number of channels as src.\n@param ddepth desired depth of the destination image, see @ref filter_depths \"combinations\"\n@param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point\nmatrix; if you want to apply different kernels to different channels, split the image into\nseparate color planes using split and process them individually.\n@param anchor anchor of the kernel that indicates the relative position of a filtered point within\nthe kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor\nis at the kernel center.\n@param delta optional value added to the filtered pixels before storing them in dst.\n@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n@sa  sepFilter2D, dft, matchTemplate\n */\nCV_EXPORTS_W void filter2D( InputArray src, OutputArray dst, int ddepth,\n                            InputArray kernel, Point anchor = Point(-1,-1),\n                            double delta = 0, int borderType = BORDER_DEFAULT );\n\n/** @brief Applies a separable linear filter to an image.\n\nThe function applies a separable linear filter to the image. That is, first, every row of src is\nfiltered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D\nkernel kernelY. The final result shifted by delta is stored in dst .\n\n@param src Source image.\n@param dst Destination image of the same size and the same number of channels as src .\n@param ddepth Destination image depth, see @ref filter_depths \"combinations\"\n@param kernelX Coefficients for filtering each row.\n@param kernelY Coefficients for filtering each column.\n@param anchor Anchor position within the kernel. The default value \\f$(-1,-1)\\f$ means that the anchor\nis at the kernel center.\n@param delta Value added to the filtered results before storing them.\n@param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n@sa  filter2D, Sobel, GaussianBlur, boxFilter, blur\n */\nCV_EXPORTS_W void sepFilter2D( InputArray src, OutputArray dst, int ddepth,\n                               InputArray kernelX, InputArray kernelY,\n                               Point anchor = Point(-1,-1),\n                               double delta = 0, int borderType = BORDER_DEFAULT );\n\n/** @example samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp\nSample code using Sobel and/or Scharr OpenCV functions to make a simple Edge Detector\n![Sample screenshot](Sobel_Derivatives_Tutorial_Result.jpg)\nCheck @ref tutorial_sobel_derivatives \"the corresponding tutorial\" for more details\n*/\n\n/** @brief Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.\n\nIn all cases except one, the \\f$\\texttt{ksize} \\times \\texttt{ksize}\\f$ separable kernel is used to\ncalculate the derivative. When \\f$\\texttt{ksize = 1}\\f$, the \\f$3 \\times 1\\f$ or \\f$1 \\times 3\\f$\nkernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first\nor the second x- or y- derivatives.\n\nThere is also the special value `ksize = #FILTER_SCHARR (-1)` that corresponds to the \\f$3\\times3\\f$ Scharr\nfilter that may give more accurate results than the \\f$3\\times3\\f$ Sobel. The Scharr aperture is\n\n\\f[\\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\\f]\n\nfor the x-derivative, or transposed for the y-derivative.\n\nThe function calculates an image derivative by convolving the image with the appropriate kernel:\n\n\\f[\\texttt{dst} =  \\frac{\\partial^{xorder+yorder} \\texttt{src}}{\\partial x^{xorder} \\partial y^{yorder}}\\f]\n\nThe Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less\nresistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)\nor ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first\ncase corresponds to a kernel of:\n\n\\f[\\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\\f]\n\nThe second case corresponds to a kernel of:\n\n\\f[\\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\\f]\n\n@param src input image.\n@param dst output image of the same size and the same number of channels as src .\n@param ddepth output image depth, see @ref filter_depths \"combinations\"; in the case of\n    8-bit input images it will result in truncated derivatives.\n@param dx order of the derivative x.\n@param dy order of the derivative y.\n@param ksize size of the extended Sobel kernel; it must be 1, 3, 5, or 7.\n@param scale optional scale factor for the computed derivative values; by default, no scaling is\napplied (see #getDerivKernels for details).\n@param delta optional delta value that is added to the results prior to storing them in dst.\n@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n@sa  Scharr, Laplacian, sepFilter2D, filter2D, GaussianBlur, cartToPolar\n */\nCV_EXPORTS_W void Sobel( InputArray src, OutputArray dst, int ddepth,\n                         int dx, int dy, int ksize = 3,\n                         double scale = 1, double delta = 0,\n                         int borderType = BORDER_DEFAULT );\n\n/** @brief Calculates the first order image derivative in both x and y using a Sobel operator\n\nEquivalent to calling:\n\n@code\nSobel( src, dx, CV_16SC1, 1, 0, 3 );\nSobel( src, dy, CV_16SC1, 0, 1, 3 );\n@endcode\n\n@param src input image.\n@param dx output image with first-order derivative in x.\n@param dy output image with first-order derivative in y.\n@param ksize size of Sobel kernel. It must be 3.\n@param borderType pixel extrapolation method, see #BorderTypes.\n                  Only #BORDER_DEFAULT=#BORDER_REFLECT_101 and #BORDER_REPLICATE are supported.\n\n@sa Sobel\n */\n\nCV_EXPORTS_W void spatialGradient( InputArray src, OutputArray dx,\n                                   OutputArray dy, int ksize = 3,\n                                   int borderType = BORDER_DEFAULT );\n\n/** @brief Calculates the first x- or y- image derivative using Scharr operator.\n\nThe function computes the first x- or y- spatial image derivative using the Scharr operator. The\ncall\n\n\\f[\\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}\\f]\n\nis equivalent to\n\n\\f[\\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER_SCHARR, scale, delta, borderType)} .\\f]\n\n@param src input image.\n@param dst output image of the same size and the same number of channels as src.\n@param ddepth output image depth, see @ref filter_depths \"combinations\"\n@param dx order of the derivative x.\n@param dy order of the derivative y.\n@param scale optional scale factor for the computed derivative values; by default, no scaling is\napplied (see #getDerivKernels for details).\n@param delta optional delta value that is added to the results prior to storing them in dst.\n@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n@sa  cartToPolar\n */\nCV_EXPORTS_W void Scharr( InputArray src, OutputArray dst, int ddepth,\n                          int dx, int dy, double scale = 1, double delta = 0,\n                          int borderType = BORDER_DEFAULT );\n\n/** @example samples/cpp/laplace.cpp\nAn example using Laplace transformations for edge detection\n*/\n\n/** @brief Calculates the Laplacian of an image.\n\nThe function calculates the Laplacian of the source image by adding up the second x and y\nderivatives calculated using the Sobel operator:\n\n\\f[\\texttt{dst} =  \\Delta \\texttt{src} =  \\frac{\\partial^2 \\texttt{src}}{\\partial x^2} +  \\frac{\\partial^2 \\texttt{src}}{\\partial y^2}\\f]\n\nThis is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image\nwith the following \\f$3 \\times 3\\f$ aperture:\n\n\\f[\\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\\f]\n\n@param src Source image.\n@param dst Destination image of the same size and the same number of channels as src .\n@param ddepth Desired depth of the destination image.\n@param ksize Aperture size used to compute the second-derivative filters. See #getDerivKernels for\ndetails. The size must be positive and odd.\n@param scale Optional scale factor for the computed Laplacian values. By default, no scaling is\napplied. See #getDerivKernels for details.\n@param delta Optional delta value that is added to the results prior to storing them in dst .\n@param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n@sa  Sobel, Scharr\n */\nCV_EXPORTS_W void Laplacian( InputArray src, OutputArray dst, int ddepth,\n                             int ksize = 1, double scale = 1, double delta = 0,\n                             int borderType = BORDER_DEFAULT );\n\n//! @} imgproc_filter\n\n//! @addtogroup imgproc_feature\n//! @{\n\n/** @example samples/cpp/edge.cpp\nThis program demonstrates usage of the Canny edge detector\n\nCheck @ref tutorial_canny_detector \"the corresponding tutorial\" for more details\n*/\n\n/** @brief Finds edges in an image using the Canny algorithm @cite Canny86 .\n\nThe function finds edges in the input image and marks them in the output map edges using the\nCanny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The\nlargest value is used to find initial segments of strong edges. See\n<http://en.wikipedia.org/wiki/Canny_edge_detector>\n\n@param image 8-bit input image.\n@param edges output edge map; single channels 8-bit image, which has the same size as image .\n@param threshold1 first threshold for the hysteresis procedure.\n@param threshold2 second threshold for the hysteresis procedure.\n@param apertureSize aperture size for the Sobel operator.\n@param L2gradient a flag, indicating whether a more accurate \\f$L_2\\f$ norm\n\\f$=\\sqrt{(dI/dx)^2 + (dI/dy)^2}\\f$ should be used to calculate the image gradient magnitude (\nL2gradient=true ), or whether the default \\f$L_1\\f$ norm \\f$=|dI/dx|+|dI/dy|\\f$ is enough (\nL2gradient=false ).\n */\nCV_EXPORTS_W void Canny( InputArray image, OutputArray edges,\n                         double threshold1, double threshold2,\n                         int apertureSize = 3, bool L2gradient = false );\n\n/** \\overload\n\nFinds edges in an image using the Canny algorithm with custom image gradient.\n\n@param dx 16-bit x derivative of input image (CV_16SC1 or CV_16SC3).\n@param dy 16-bit y derivative of input image (same type as dx).\n@param edges output edge map; single channels 8-bit image, which has the same size as image .\n@param threshold1 first threshold for the hysteresis procedure.\n@param threshold2 second threshold for the hysteresis procedure.\n@param L2gradient a flag, indicating whether a more accurate \\f$L_2\\f$ norm\n\\f$=\\sqrt{(dI/dx)^2 + (dI/dy)^2}\\f$ should be used to calculate the image gradient magnitude (\nL2gradient=true ), or whether the default \\f$L_1\\f$ norm \\f$=|dI/dx|+|dI/dy|\\f$ is enough (\nL2gradient=false ).\n */\nCV_EXPORTS_W void Canny( InputArray dx, InputArray dy,\n                         OutputArray edges,\n                         double threshold1, double threshold2,\n                         bool L2gradient = false );\n\n/** @brief Calculates the minimal eigenvalue of gradient matrices for corner detection.\n\nThe function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal\neigenvalue of the covariance matrix of derivatives, that is, \\f$\\min(\\lambda_1, \\lambda_2)\\f$ in terms\nof the formulae in the cornerEigenValsAndVecs description.\n\n@param src Input single-channel 8-bit or floating-point image.\n@param dst Image to store the minimal eigenvalues. It has the type CV_32FC1 and the same size as\nsrc .\n@param blockSize Neighborhood size (see the details on #cornerEigenValsAndVecs ).\n@param ksize Aperture parameter for the Sobel operator.\n@param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported.\n */\nCV_EXPORTS_W void cornerMinEigenVal( InputArray src, OutputArray dst,\n                                     int blockSize, int ksize = 3,\n                                     int borderType = BORDER_DEFAULT );\n\n/** @brief Harris corner detector.\n\nThe function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and\ncornerEigenValsAndVecs , for each pixel \\f$(x, y)\\f$ it calculates a \\f$2\\times2\\f$ gradient covariance\nmatrix \\f$M^{(x,y)}\\f$ over a \\f$\\texttt{blockSize} \\times \\texttt{blockSize}\\f$ neighborhood. Then, it\ncomputes the following characteristic:\n\n\\f[\\texttt{dst} (x,y) =  \\mathrm{det} M^{(x,y)} - k  \\cdot \\left ( \\mathrm{tr} M^{(x,y)} \\right )^2\\f]\n\nCorners in the image can be found as the local maxima of this response map.\n\n@param src Input single-channel 8-bit or floating-point image.\n@param dst Image to store the Harris detector responses. It has the type CV_32FC1 and the same\nsize as src .\n@param blockSize Neighborhood size (see the details on #cornerEigenValsAndVecs ).\n@param ksize Aperture parameter for the Sobel operator.\n@param k Harris detector free parameter. See the formula above.\n@param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported.\n */\nCV_EXPORTS_W void cornerHarris( InputArray src, OutputArray dst, int blockSize,\n                                int ksize, double k,\n                                int borderType = BORDER_DEFAULT );\n\n/** @brief Calculates eigenvalues and eigenvectors of image blocks for corner detection.\n\nFor every pixel \\f$p\\f$ , the function cornerEigenValsAndVecs considers a blockSize \\f$\\times\\f$ blockSize\nneighborhood \\f$S(p)\\f$ . It calculates the covariation matrix of derivatives over the neighborhood as:\n\n\\f[M =  \\begin{bmatrix} \\sum _{S(p)}(dI/dx)^2 &  \\sum _{S(p)}dI/dx dI/dy  \\\\ \\sum _{S(p)}dI/dx dI/dy &  \\sum _{S(p)}(dI/dy)^2 \\end{bmatrix}\\f]\n\nwhere the derivatives are computed using the Sobel operator.\n\nAfter that, it finds eigenvectors and eigenvalues of \\f$M\\f$ and stores them in the destination image as\n\\f$(\\lambda_1, \\lambda_2, x_1, y_1, x_2, y_2)\\f$ where\n\n-   \\f$\\lambda_1, \\lambda_2\\f$ are the non-sorted eigenvalues of \\f$M\\f$\n-   \\f$x_1, y_1\\f$ are the eigenvectors corresponding to \\f$\\lambda_1\\f$\n-   \\f$x_2, y_2\\f$ are the eigenvectors corresponding to \\f$\\lambda_2\\f$\n\nThe output of the function can be used for robust edge or corner detection.\n\n@param src Input single-channel 8-bit or floating-point image.\n@param dst Image to store the results. It has the same size as src and the type CV_32FC(6) .\n@param blockSize Neighborhood size (see details below).\n@param ksize Aperture parameter for the Sobel operator.\n@param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported.\n\n@sa  cornerMinEigenVal, cornerHarris, preCornerDetect\n */\nCV_EXPORTS_W void cornerEigenValsAndVecs( InputArray src, OutputArray dst,\n                                          int blockSize, int ksize,\n                                          int borderType = BORDER_DEFAULT );\n\n/** @brief Calculates a feature map for corner detection.\n\nThe function calculates the complex spatial derivative-based function of the source image\n\n\\f[\\texttt{dst} = (D_x  \\texttt{src} )^2  \\cdot D_{yy}  \\texttt{src} + (D_y  \\texttt{src} )^2  \\cdot D_{xx}  \\texttt{src} - 2 D_x  \\texttt{src} \\cdot D_y  \\texttt{src} \\cdot D_{xy}  \\texttt{src}\\f]\n\nwhere \\f$D_x\\f$,\\f$D_y\\f$ are the first image derivatives, \\f$D_{xx}\\f$,\\f$D_{yy}\\f$ are the second image\nderivatives, and \\f$D_{xy}\\f$ is the mixed derivative.\n\nThe corners can be found as local maximums of the functions, as shown below:\n@code\n    Mat corners, dilated_corners;\n    preCornerDetect(image, corners, 3);\n    // dilation with 3x3 rectangular structuring element\n    dilate(corners, dilated_corners, Mat(), 1);\n    Mat corner_mask = corners == dilated_corners;\n@endcode\n\n@param src Source single-channel 8-bit of floating-point image.\n@param dst Output image that has the type CV_32F and the same size as src .\n@param ksize %Aperture size of the Sobel .\n@param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported.\n */\nCV_EXPORTS_W void preCornerDetect( InputArray src, OutputArray dst, int ksize,\n                                   int borderType = BORDER_DEFAULT );\n\n/** @brief Refines the corner locations.\n\nThe function iterates to find the sub-pixel accurate location of corners or radial saddle\npoints as described in @cite forstner1987fast, and as shown on the figure below.\n\n![image](pics/cornersubpix.png)\n\nSub-pixel accurate corner locator is based on the observation that every vector from the center \\f$q\\f$\nto a point \\f$p\\f$ located within a neighborhood of \\f$q\\f$ is orthogonal to the image gradient at \\f$p\\f$\nsubject to image and measurement noise. Consider the expression:\n\n\\f[\\epsilon _i = {DI_{p_i}}^T  \\cdot (q - p_i)\\f]\n\nwhere \\f${DI_{p_i}}\\f$ is an image gradient at one of the points \\f$p_i\\f$ in a neighborhood of \\f$q\\f$ . The\nvalue of \\f$q\\f$ is to be found so that \\f$\\epsilon_i\\f$ is minimized. A system of equations may be set up\nwith \\f$\\epsilon_i\\f$ set to zero:\n\n\\f[\\sum _i(DI_{p_i}  \\cdot {DI_{p_i}}^T) \\cdot q -  \\sum _i(DI_{p_i}  \\cdot {DI_{p_i}}^T  \\cdot p_i)\\f]\n\nwhere the gradients are summed within a neighborhood (\"search window\") of \\f$q\\f$ . Calling the first\ngradient term \\f$G\\f$ and the second gradient term \\f$b\\f$ gives:\n\n\\f[q = G^{-1}  \\cdot b\\f]\n\nThe algorithm sets the center of the neighborhood window at this new center \\f$q\\f$ and then iterates\nuntil the center stays within a set threshold.\n\n@param image Input single-channel, 8-bit or float image.\n@param corners Initial coordinates of the input corners and refined coordinates provided for\noutput.\n@param winSize Half of the side length of the search window. For example, if winSize=Size(5,5) ,\nthen a \\f$(5*2+1) \\times (5*2+1) = 11 \\times 11\\f$ search window is used.\n@param zeroZone Half of the size of the dead region in the middle of the search zone over which\nthe summation in the formula below is not done. It is used sometimes to avoid possible\nsingularities of the autocorrelation matrix. The value of (-1,-1) indicates that there is no such\na size.\n@param criteria Criteria for termination of the iterative process of corner refinement. That is,\nthe process of corner position refinement stops either after criteria.maxCount iterations or when\nthe corner position moves by less than criteria.epsilon on some iteration.\n */\nCV_EXPORTS_W void cornerSubPix( InputArray image, InputOutputArray corners,\n                                Size winSize, Size zeroZone,\n                                TermCriteria criteria );\n\n/** @brief Determines strong corners on an image.\n\nThe function finds the most prominent corners in the image or in the specified image region, as\ndescribed in @cite Shi94\n\n-   Function calculates the corner quality measure at every source image pixel using the\n    #cornerMinEigenVal or #cornerHarris .\n-   Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are\n    retained).\n-   The corners with the minimal eigenvalue less than\n    \\f$\\texttt{qualityLevel} \\cdot \\max_{x,y} qualityMeasureMap(x,y)\\f$ are rejected.\n-   The remaining corners are sorted by the quality measure in the descending order.\n-   Function throws away each corner for which there is a stronger corner at a distance less than\n    maxDistance.\n\nThe function can be used to initialize a point-based tracker of an object.\n\n@note If the function is called with different values A and B of the parameter qualityLevel , and\nA \\> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector\nwith qualityLevel=B .\n\n@param image Input 8-bit or floating-point 32-bit, single-channel image.\n@param corners Output vector of detected corners.\n@param maxCorners Maximum number of corners to return. If there are more corners than are found,\nthe strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set\nand all detected corners are returned.\n@param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The\nparameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue\n(see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the\nquality measure less than the product are rejected. For example, if the best corner has the\nquality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure\nless than 15 are rejected.\n@param minDistance Minimum possible Euclidean distance between the returned corners.\n@param mask Optional region of interest. If the image is not empty (it needs to have the type\nCV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.\n@param blockSize Size of an average block for computing a derivative covariation matrix over each\npixel neighborhood. See cornerEigenValsAndVecs .\n@param useHarrisDetector Parameter indicating whether to use a Harris detector (see #cornerHarris)\nor #cornerMinEigenVal.\n@param k Free parameter of the Harris detector.\n\n@sa  cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform,\n */\n\nCV_EXPORTS_W void goodFeaturesToTrack( InputArray image, OutputArray corners,\n                                     int maxCorners, double qualityLevel, double minDistance,\n                                     InputArray mask = noArray(), int blockSize = 3,\n                                     bool useHarrisDetector = false, double k = 0.04 );\n\nCV_EXPORTS_W void goodFeaturesToTrack( InputArray image, OutputArray corners,\n                                     int maxCorners, double qualityLevel, double minDistance,\n                                     InputArray mask, int blockSize,\n                                     int gradientSize, bool useHarrisDetector = false,\n                                     double k = 0.04 );\n\n/** @brief Same as above, but returns also quality measure of the detected corners.\n\n@param image Input 8-bit or floating-point 32-bit, single-channel image.\n@param corners Output vector of detected corners.\n@param maxCorners Maximum number of corners to return. If there are more corners than are found,\nthe strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set\nand all detected corners are returned.\n@param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The\nparameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue\n(see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the\nquality measure less than the product are rejected. For example, if the best corner has the\nquality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure\nless than 15 are rejected.\n@param minDistance Minimum possible Euclidean distance between the returned corners.\n@param mask Region of interest. If the image is not empty (it needs to have the type\nCV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.\n@param cornersQuality Output vector of quality measure of the detected corners.\n@param blockSize Size of an average block for computing a derivative covariation matrix over each\npixel neighborhood. See cornerEigenValsAndVecs .\n@param gradientSize Aperture parameter for the Sobel operator used for derivatives computation.\nSee cornerEigenValsAndVecs .\n@param useHarrisDetector Parameter indicating whether to use a Harris detector (see #cornerHarris)\nor #cornerMinEigenVal.\n@param k Free parameter of the Harris detector.\n */\nCV_EXPORTS CV_WRAP_AS(goodFeaturesToTrackWithQuality) void goodFeaturesToTrack(\n        InputArray image, OutputArray corners,\n        int maxCorners, double qualityLevel, double minDistance,\n        InputArray mask, OutputArray cornersQuality, int blockSize = 3,\n        int gradientSize = 3, bool useHarrisDetector = false, double k = 0.04);\n\n/** @example samples/cpp/tutorial_code/ImgTrans/houghlines.cpp\nAn example using the Hough line detector\n![Sample input image](Hough_Lines_Tutorial_Original_Image.jpg) ![Output image](Hough_Lines_Tutorial_Result.jpg)\n*/\n\n/** @brief Finds lines in a binary image using the standard Hough transform.\n\nThe function implements the standard or standard multi-scale Hough transform algorithm for line\ndetection. See <http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough\ntransform.\n\n@param image 8-bit, single-channel binary source image. The image may be modified by the function.\n@param lines Output vector of lines. Each line is represented by a 2 or 3 element vector\n\\f$(\\rho, \\theta)\\f$ or \\f$(\\rho, \\theta, \\textrm{votes})\\f$ . \\f$\\rho\\f$ is the distance from the coordinate origin \\f$(0,0)\\f$ (top-left corner of\nthe image). \\f$\\theta\\f$ is the line rotation angle in radians (\n\\f$0 \\sim \\textrm{vertical line}, \\pi/2 \\sim \\textrm{horizontal line}\\f$ ).\n\\f$\\textrm{votes}\\f$ is the value of accumulator.\n@param rho Distance resolution of the accumulator in pixels.\n@param theta Angle resolution of the accumulator in radians.\n@param threshold Accumulator threshold parameter. Only those lines are returned that get enough\nvotes ( \\f$>\\texttt{threshold}\\f$ ).\n@param srn For the multi-scale Hough transform, it is a divisor for the distance resolution rho .\nThe coarse accumulator distance resolution is rho and the accurate accumulator resolution is\nrho/srn . If both srn=0 and stn=0 , the classical Hough transform is used. Otherwise, both these\nparameters should be positive.\n@param stn For the multi-scale Hough transform, it is a divisor for the distance resolution theta.\n@param min_theta For standard and multi-scale Hough transform, minimum angle to check for lines.\nMust fall between 0 and max_theta.\n@param max_theta For standard and multi-scale Hough transform, maximum angle to check for lines.\nMust fall between min_theta and CV_PI.\n */\nCV_EXPORTS_W void HoughLines( InputArray image, OutputArray lines,\n                              double rho, double theta, int threshold,\n                              double srn = 0, double stn = 0,\n                              double min_theta = 0, double max_theta = CV_PI );\n\n/** @brief Finds line segments in a binary image using the probabilistic Hough transform.\n\nThe function implements the probabilistic Hough transform algorithm for line detection, described\nin @cite Matas00\n\nSee the line detection example below:\n@include snippets/imgproc_HoughLinesP.cpp\nThis is a sample picture the function parameters have been tuned for:\n\n![image](pics/building.jpg)\n\nAnd this is the output of the above program in case of the probabilistic Hough transform:\n\n![image](pics/houghp.png)\n\n@param image 8-bit, single-channel binary source image. The image may be modified by the function.\n@param lines Output vector of lines. Each line is represented by a 4-element vector\n\\f$(x_1, y_1, x_2, y_2)\\f$ , where \\f$(x_1,y_1)\\f$ and \\f$(x_2, y_2)\\f$ are the ending points of each detected\nline segment.\n@param rho Distance resolution of the accumulator in pixels.\n@param theta Angle resolution of the accumulator in radians.\n@param threshold Accumulator threshold parameter. Only those lines are returned that get enough\nvotes ( \\f$>\\texttt{threshold}\\f$ ).\n@param minLineLength Minimum line length. Line segments shorter than that are rejected.\n@param maxLineGap Maximum allowed gap between points on the same line to link them.\n\n@sa LineSegmentDetector\n */\nCV_EXPORTS_W void HoughLinesP( InputArray image, OutputArray lines,\n                               double rho, double theta, int threshold,\n                               double minLineLength = 0, double maxLineGap = 0 );\n\n/** @brief Finds lines in a set of points using the standard Hough transform.\n\nThe function finds lines in a set of points using a modification of the Hough transform.\n@include snippets/imgproc_HoughLinesPointSet.cpp\n@param point Input vector of points. Each vector must be encoded as a Point vector \\f$(x,y)\\f$. Type must be CV_32FC2 or CV_32SC2.\n@param lines Output vector of found lines. Each vector is encoded as a vector<Vec3d> \\f$(votes, rho, theta)\\f$.\nThe larger the value of 'votes', the higher the reliability of the Hough line.\n@param lines_max Max count of hough lines.\n@param threshold Accumulator threshold parameter. Only those lines are returned that get enough\nvotes ( \\f$>\\texttt{threshold}\\f$ )\n@param min_rho Minimum Distance value of the accumulator in pixels.\n@param max_rho Maximum Distance value of the accumulator in pixels.\n@param rho_step Distance resolution of the accumulator in pixels.\n@param min_theta Minimum angle value of the accumulator in radians.\n@param max_theta Maximum angle value of the accumulator in radians.\n@param theta_step Angle resolution of the accumulator in radians.\n */\nCV_EXPORTS_W void HoughLinesPointSet( InputArray point, OutputArray lines, int lines_max, int threshold,\n                                      double min_rho, double max_rho, double rho_step,\n                                      double min_theta, double max_theta, double theta_step );\n\n/** @example samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp\nAn example using the Hough circle detector\n*/\n\n/** @brief Finds circles in a grayscale image using the Hough transform.\n\nThe function finds circles in a grayscale image using a modification of the Hough transform.\n\nExample: :\n@include snippets/imgproc_HoughLinesCircles.cpp\n\n@note Usually the function detects the centers of circles well. However, it may fail to find correct\nradii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if\nyou know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number\nto return centers only without radius search, and find the correct radius using an additional procedure.\n\nIt also helps to smooth image a bit unless it's already soft. For example,\nGaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.\n\n@param image 8-bit, single-channel, grayscale input image.\n@param circles Output vector of found circles. Each vector is encoded as  3 or 4 element\nfloating-point vector \\f$(x, y, radius)\\f$ or \\f$(x, y, radius, votes)\\f$ .\n@param method Detection method, see #HoughModes. The available methods are #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT.\n@param dp Inverse ratio of the accumulator resolution to the image resolution. For example, if\ndp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has\nhalf as big width and height. For #HOUGH_GRADIENT_ALT the recommended value is dp=1.5,\nunless some small very circles need to be detected.\n@param minDist Minimum distance between the centers of the detected circles. If the parameter is\ntoo small, multiple neighbor circles may be falsely detected in addition to a true one. If it is\ntoo large, some circles may be missed.\n@param param1 First method-specific parameter. In case of #HOUGH_GRADIENT and #HOUGH_GRADIENT_ALT,\nit is the higher threshold of the two passed to the Canny edge detector (the lower one is twice smaller).\nNote that #HOUGH_GRADIENT_ALT uses #Scharr algorithm to compute image derivatives, so the threshold value\nshough normally be higher, such as 300 or normally exposed and contrasty images.\n@param param2 Second method-specific parameter. In case of #HOUGH_GRADIENT, it is the\naccumulator threshold for the circle centers at the detection stage. The smaller it is, the more\nfalse circles may be detected. Circles, corresponding to the larger accumulator values, will be\nreturned first. In the case of #HOUGH_GRADIENT_ALT algorithm, this is the circle \"perfectness\" measure.\nThe closer it to 1, the better shaped circles algorithm selects. In most cases 0.9 should be fine.\nIf you want get better detection of small circles, you may decrease it to 0.85, 0.8 or even less.\nBut then also try to limit the search range [minRadius, maxRadius] to avoid many false circles.\n@param minRadius Minimum circle radius.\n@param maxRadius Maximum circle radius. If <= 0, uses the maximum image dimension. If < 0, #HOUGH_GRADIENT returns\ncenters without finding the radius. #HOUGH_GRADIENT_ALT always computes circle radiuses.\n\n@sa fitEllipse, minEnclosingCircle\n */\nCV_EXPORTS_W void HoughCircles( InputArray image, OutputArray circles,\n                               int method, double dp, double minDist,\n                               double param1 = 100, double param2 = 100,\n                               int minRadius = 0, int maxRadius = 0 );\n\n//! @} imgproc_feature\n\n//! @addtogroup imgproc_filter\n//! @{\n\n/** @example samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp\nAdvanced morphology Transformations sample code\n![Sample screenshot](Morphology_2_Tutorial_Result.jpg)\nCheck @ref tutorial_opening_closing_hats \"the corresponding tutorial\" for more details\n*/\n\n/** @brief Erodes an image by using a specific structuring element.\n\nThe function erodes the source image using the specified structuring element that determines the\nshape of a pixel neighborhood over which the minimum is taken:\n\n\\f[\\texttt{dst} (x,y) =  \\min _{(x',y'):  \\, \\texttt{element} (x',y') \\ne0 } \\texttt{src} (x+x',y+y')\\f]\n\nThe function supports the in-place mode. Erosion can be applied several ( iterations ) times. In\ncase of multi-channel images, each channel is processed independently.\n\n@param src input image; the number of channels can be arbitrary, but the depth should be one of\nCV_8U, CV_16U, CV_16S, CV_32F or CV_64F.\n@param dst output image of the same size and type as src.\n@param kernel structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular\nstructuring element is used. Kernel can be created using #getStructuringElement.\n@param anchor position of the anchor within the element; default value (-1, -1) means that the\nanchor is at the element center.\n@param iterations number of times erosion is applied.\n@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n@param borderValue border value in case of a constant border\n@sa  dilate, morphologyEx, getStructuringElement\n */\nCV_EXPORTS_W void erode( InputArray src, OutputArray dst, InputArray kernel,\n                         Point anchor = Point(-1,-1), int iterations = 1,\n                         int borderType = BORDER_CONSTANT,\n                         const Scalar& borderValue = morphologyDefaultBorderValue() );\n\n/** @example samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp\nErosion and Dilation sample code\n![Sample Screenshot-Erosion](Morphology_1_Tutorial_Erosion_Result.jpg)![Sample Screenshot-Dilation](Morphology_1_Tutorial_Dilation_Result.jpg)\nCheck @ref tutorial_erosion_dilatation \"the corresponding tutorial\" for more details\n*/\n\n/** @brief Dilates an image by using a specific structuring element.\n\nThe function dilates the source image using the specified structuring element that determines the\nshape of a pixel neighborhood over which the maximum is taken:\n\\f[\\texttt{dst} (x,y) =  \\max _{(x',y'):  \\, \\texttt{element} (x',y') \\ne0 } \\texttt{src} (x+x',y+y')\\f]\n\nThe function supports the in-place mode. Dilation can be applied several ( iterations ) times. In\ncase of multi-channel images, each channel is processed independently.\n\n@param src input image; the number of channels can be arbitrary, but the depth should be one of\nCV_8U, CV_16U, CV_16S, CV_32F or CV_64F.\n@param dst output image of the same size and type as src.\n@param kernel structuring element used for dilation; if elemenat=Mat(), a 3 x 3 rectangular\nstructuring element is used. Kernel can be created using #getStructuringElement\n@param anchor position of the anchor within the element; default value (-1, -1) means that the\nanchor is at the element center.\n@param iterations number of times dilation is applied.\n@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not suported.\n@param borderValue border value in case of a constant border\n@sa  erode, morphologyEx, getStructuringElement\n */\nCV_EXPORTS_W void dilate( InputArray src, OutputArray dst, InputArray kernel,\n                          Point anchor = Point(-1,-1), int iterations = 1,\n                          int borderType = BORDER_CONSTANT,\n                          const Scalar& borderValue = morphologyDefaultBorderValue() );\n\n/** @brief Performs advanced morphological transformations.\n\nThe function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as\nbasic operations.\n\nAny of the operations can be done in-place. In case of multi-channel images, each channel is\nprocessed independently.\n\n@param src Source image. The number of channels can be arbitrary. The depth should be one of\nCV_8U, CV_16U, CV_16S, CV_32F or CV_64F.\n@param dst Destination image of the same size and type as source image.\n@param op Type of a morphological operation, see #MorphTypes\n@param kernel Structuring element. It can be created using #getStructuringElement.\n@param anchor Anchor position with the kernel. Negative values mean that the anchor is at the\nkernel center.\n@param iterations Number of times erosion and dilation are applied.\n@param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.\n@param borderValue Border value in case of a constant border. The default value has a special\nmeaning.\n@sa  dilate, erode, getStructuringElement\n@note The number of iterations is the number of times erosion or dilatation operation will be applied.\nFor instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply\nsuccessively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).\n */\nCV_EXPORTS_W void morphologyEx( InputArray src, OutputArray dst,\n                                int op, InputArray kernel,\n                                Point anchor = Point(-1,-1), int iterations = 1,\n                                int borderType = BORDER_CONSTANT,\n                                const Scalar& borderValue = morphologyDefaultBorderValue() );\n\n//! @} imgproc_filter\n\n//! @addtogroup imgproc_transform\n//! @{\n\n/** @brief Resizes an image.\n\nThe function resize resizes the image src down to or up to the specified size. Note that the\ninitial dst type or size are not taken into account. Instead, the size and type are derived from\nthe `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst,\nyou may call the function as follows:\n@code\n    // explicitly specify dsize=dst.size(); fx and fy will be computed from that.\n    resize(src, dst, dst.size(), 0, 0, interpolation);\n@endcode\nIf you want to decimate the image by factor of 2 in each direction, you can call the function this\nway:\n@code\n    // specify fx and fy and let the function compute the destination image size.\n    resize(src, dst, Size(), 0.5, 0.5, interpolation);\n@endcode\nTo shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to\nenlarge an image, it will generally look best with c#INTER_CUBIC (slow) or #INTER_LINEAR\n(faster but still looks OK).\n\n@param src input image.\n@param dst output image; it has the size dsize (when it is non-zero) or the size computed from\nsrc.size(), fx, and fy; the type of dst is the same as of src.\n@param dsize output image size; if it equals zero, it is computed as:\n \\f[\\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\\f]\n Either dsize or both fx and fy must be non-zero.\n@param fx scale factor along the horizontal axis; when it equals 0, it is computed as\n\\f[\\texttt{(double)dsize.width/src.cols}\\f]\n@param fy scale factor along the vertical axis; when it equals 0, it is computed as\n\\f[\\texttt{(double)dsize.height/src.rows}\\f]\n@param interpolation interpolation method, see #InterpolationFlags\n\n@sa  warpAffine, warpPerspective, remap\n */\nCV_EXPORTS_W void resize( InputArray src, OutputArray dst,\n                          Size dsize, double fx = 0, double fy = 0,\n                          int interpolation = INTER_LINEAR );\n\n/** @brief Applies an affine transformation to an image.\n\nThe function warpAffine transforms the source image using the specified matrix:\n\n\\f[\\texttt{dst} (x,y) =  \\texttt{src} ( \\texttt{M} _{11} x +  \\texttt{M} _{12} y +  \\texttt{M} _{13}, \\texttt{M} _{21} x +  \\texttt{M} _{22} y +  \\texttt{M} _{23})\\f]\n\nwhen the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted\nwith #invertAffineTransform and then put in the formula above instead of M. The function cannot\noperate in-place.\n\n@param src input image.\n@param dst output image that has the size dsize and the same type as src .\n@param M \\f$2\\times 3\\f$ transformation matrix.\n@param dsize size of the output image.\n@param flags combination of interpolation methods (see #InterpolationFlags) and the optional\nflag #WARP_INVERSE_MAP that means that M is the inverse transformation (\n\\f$\\texttt{dst}\\rightarrow\\texttt{src}\\f$ ).\n@param borderMode pixel extrapolation method (see #BorderTypes); when\nborderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image corresponding to\nthe \"outliers\" in the source image are not modified by the function.\n@param borderValue value used in case of a constant border; by default, it is 0.\n\n@sa  warpPerspective, resize, remap, getRectSubPix, transform\n */\nCV_EXPORTS_W void warpAffine( InputArray src, OutputArray dst,\n                              InputArray M, Size dsize,\n                              int flags = INTER_LINEAR,\n                              int borderMode = BORDER_CONSTANT,\n                              const Scalar& borderValue = Scalar());\n\n/** @example samples/cpp/warpPerspective_demo.cpp\nAn example program shows using cv::getPerspectiveTransform and cv::warpPerspective for image warping\n*/\n\n/** @brief Applies a perspective transformation to an image.\n\nThe function warpPerspective transforms the source image using the specified matrix:\n\n\\f[\\texttt{dst} (x,y) =  \\texttt{src} \\left ( \\frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} ,\n     \\frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \\right )\\f]\n\nwhen the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert\nand then put in the formula above instead of M. The function cannot operate in-place.\n\n@param src input image.\n@param dst output image that has the size dsize and the same type as src .\n@param M \\f$3\\times 3\\f$ transformation matrix.\n@param dsize size of the output image.\n@param flags combination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the\noptional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation (\n\\f$\\texttt{dst}\\rightarrow\\texttt{src}\\f$ ).\n@param borderMode pixel extrapolation method (#BORDER_CONSTANT or #BORDER_REPLICATE).\n@param borderValue value used in case of a constant border; by default, it equals 0.\n\n@sa  warpAffine, resize, remap, getRectSubPix, perspectiveTransform\n */\nCV_EXPORTS_W void warpPerspective( InputArray src, OutputArray dst,\n                                   InputArray M, Size dsize,\n                                   int flags = INTER_LINEAR,\n                                   int borderMode = BORDER_CONSTANT,\n                                   const Scalar& borderValue = Scalar());\n\n/** @brief Applies a generic geometrical transformation to an image.\n\nThe function remap transforms the source image using the specified map:\n\n\\f[\\texttt{dst} (x,y) =  \\texttt{src} (map_x(x,y),map_y(x,y))\\f]\n\nwhere values of pixels with non-integer coordinates are computed using one of available\ninterpolation methods. \\f$map_x\\f$ and \\f$map_y\\f$ can be encoded as separate floating-point maps\nin \\f$map_1\\f$ and \\f$map_2\\f$ respectively, or interleaved floating-point maps of \\f$(x,y)\\f$ in\n\\f$map_1\\f$, or fixed-point maps created by using convertMaps. The reason you might want to\nconvert from floating to fixed-point representations of a map is that they can yield much faster\n(\\~2x) remapping operations. In the converted case, \\f$map_1\\f$ contains pairs (cvFloor(x),\ncvFloor(y)) and \\f$map_2\\f$ contains indices in a table of interpolation coefficients.\n\nThis function cannot operate in-place.\n\n@param src Source image.\n@param dst Destination image. It has the same size as map1 and the same type as src .\n@param map1 The first map of either (x,y) points or just x values having the type CV_16SC2 ,\nCV_32FC1, or CV_32FC2. See convertMaps for details on converting a floating point\nrepresentation to fixed-point for speed.\n@param map2 The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map\nif map1 is (x,y) points), respectively.\n@param interpolation Interpolation method (see #InterpolationFlags). The methods #INTER_AREA\nand #INTER_LINEAR_EXACT are not supported by this function.\n@param borderMode Pixel extrapolation method (see #BorderTypes). When\nborderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image that\ncorresponds to the \"outliers\" in the source image are not modified by the function.\n@param borderValue Value used in case of a constant border. By default, it is 0.\n@note\nDue to current implementation limitations the size of an input and output images should be less than 32767x32767.\n */\nCV_EXPORTS_W void remap( InputArray src, OutputArray dst,\n                         InputArray map1, InputArray map2,\n                         int interpolation, int borderMode = BORDER_CONSTANT,\n                         const Scalar& borderValue = Scalar());\n\n/** @brief Converts image transformation maps from one representation to another.\n\nThe function converts a pair of maps for remap from one representation to another. The following\noptions ( (map1.type(), map2.type()) \\f$\\rightarrow\\f$ (dstmap1.type(), dstmap2.type()) ) are\nsupported:\n\n- \\f$\\texttt{(CV_32FC1, CV_32FC1)} \\rightarrow \\texttt{(CV_16SC2, CV_16UC1)}\\f$. This is the\nmost frequently used conversion operation, in which the original floating-point maps (see remap )\nare converted to a more compact and much faster fixed-point representation. The first output array\ncontains the rounded coordinates and the second array (created only when nninterpolation=false )\ncontains indices in the interpolation tables.\n\n- \\f$\\texttt{(CV_32FC2)} \\rightarrow \\texttt{(CV_16SC2, CV_16UC1)}\\f$. The same as above but\nthe original maps are stored in one 2-channel matrix.\n\n- Reverse conversion. Obviously, the reconstructed floating-point maps will not be exactly the same\nas the originals.\n\n@param map1 The first input map of type CV_16SC2, CV_32FC1, or CV_32FC2 .\n@param map2 The second input map of type CV_16UC1, CV_32FC1, or none (empty matrix),\nrespectively.\n@param dstmap1 The first output map that has the type dstmap1type and the same size as src .\n@param dstmap2 The second output map.\n@param dstmap1type Type of the first output map that should be CV_16SC2, CV_32FC1, or\nCV_32FC2 .\n@param nninterpolation Flag indicating whether the fixed-point maps are used for the\nnearest-neighbor or for a more complex interpolation.\n\n@sa  remap, undistort, initUndistortRectifyMap\n */\nCV_EXPORTS_W void convertMaps( InputArray map1, InputArray map2,\n                               OutputArray dstmap1, OutputArray dstmap2,\n                               int dstmap1type, bool nninterpolation = false );\n\n/** @brief Calculates an affine matrix of 2D rotation.\n\nThe function calculates the following matrix:\n\n\\f[\\begin{bmatrix} \\alpha &  \\beta & (1- \\alpha )  \\cdot \\texttt{center.x} -  \\beta \\cdot \\texttt{center.y} \\\\ - \\beta &  \\alpha &  \\beta \\cdot \\texttt{center.x} + (1- \\alpha )  \\cdot \\texttt{center.y} \\end{bmatrix}\\f]\n\nwhere\n\n\\f[\\begin{array}{l} \\alpha =  \\texttt{scale} \\cdot \\cos \\texttt{angle} , \\\\ \\beta =  \\texttt{scale} \\cdot \\sin \\texttt{angle} \\end{array}\\f]\n\nThe transformation maps the rotation center to itself. If this is not the target, adjust the shift.\n\n@param center Center of the rotation in the source image.\n@param angle Rotation angle in degrees. Positive values mean counter-clockwise rotation (the\ncoordinate origin is assumed to be the top-left corner).\n@param scale Isotropic scale factor.\n\n@sa  getAffineTransform, warpAffine, transform\n */\nCV_EXPORTS_W Mat getRotationMatrix2D(Point2f center, double angle, double scale);\n\n/** @sa getRotationMatrix2D */\nCV_EXPORTS Matx23d getRotationMatrix2D_(Point2f center, double angle, double scale);\n\ninline\nMat getRotationMatrix2D(Point2f center, double angle, double scale)\n{\n    return Mat(getRotationMatrix2D_(center, angle, scale), true);\n}\n\n/** @brief Calculates an affine transform from three pairs of the corresponding points.\n\nThe function calculates the \\f$2 \\times 3\\f$ matrix of an affine transform so that:\n\n\\f[\\begin{bmatrix} x'_i \\\\ y'_i \\end{bmatrix} = \\texttt{map_matrix} \\cdot \\begin{bmatrix} x_i \\\\ y_i \\\\ 1 \\end{bmatrix}\\f]\n\nwhere\n\n\\f[dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2\\f]\n\n@param src Coordinates of triangle vertices in the source image.\n@param dst Coordinates of the corresponding triangle vertices in the destination image.\n\n@sa  warpAffine, transform\n */\nCV_EXPORTS Mat getAffineTransform( const Point2f src[], const Point2f dst[] );\n\n/** @brief Inverts an affine transformation.\n\nThe function computes an inverse affine transformation represented by \\f$2 \\times 3\\f$ matrix M:\n\n\\f[\\begin{bmatrix} a_{11} & a_{12} & b_1  \\\\ a_{21} & a_{22} & b_2 \\end{bmatrix}\\f]\n\nThe result is also a \\f$2 \\times 3\\f$ matrix of the same type as M.\n\n@param M Original affine transformation.\n@param iM Output reverse affine transformation.\n */\nCV_EXPORTS_W void invertAffineTransform( InputArray M, OutputArray iM );\n\n/** @brief Calculates a perspective transform from four pairs of the corresponding points.\n\nThe function calculates the \\f$3 \\times 3\\f$ matrix of a perspective transform so that:\n\n\\f[\\begin{bmatrix} t_i x'_i \\\\ t_i y'_i \\\\ t_i \\end{bmatrix} = \\texttt{map_matrix} \\cdot \\begin{bmatrix} x_i \\\\ y_i \\\\ 1 \\end{bmatrix}\\f]\n\nwhere\n\n\\f[dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3\\f]\n\n@param src Coordinates of quadrangle vertices in the source image.\n@param dst Coordinates of the corresponding quadrangle vertices in the destination image.\n@param solveMethod method passed to cv::solve (#DecompTypes)\n\n@sa  findHomography, warpPerspective, perspectiveTransform\n */\nCV_EXPORTS_W Mat getPerspectiveTransform(InputArray src, InputArray dst, int solveMethod = DECOMP_LU);\n\n/** @overload */\nCV_EXPORTS Mat getPerspectiveTransform(const Point2f src[], const Point2f dst[], int solveMethod = DECOMP_LU);\n\n\nCV_EXPORTS_W Mat getAffineTransform( InputArray src, InputArray dst );\n\n/** @brief Retrieves a pixel rectangle from an image with sub-pixel accuracy.\n\nThe function getRectSubPix extracts pixels from src:\n\n\\f[patch(x, y) = src(x +  \\texttt{center.x} - ( \\texttt{dst.cols} -1)*0.5, y +  \\texttt{center.y} - ( \\texttt{dst.rows} -1)*0.5)\\f]\n\nwhere the values of the pixels at non-integer coordinates are retrieved using bilinear\ninterpolation. Every channel of multi-channel images is processed independently. Also\nthe image should be a single channel or three channel image. While the center of the\nrectangle must be inside the image, parts of the rectangle may be outside.\n\n@param image Source image.\n@param patchSize Size of the extracted patch.\n@param center Floating point coordinates of the center of the extracted rectangle within the\nsource image. The center must be inside the image.\n@param patch Extracted patch that has the size patchSize and the same number of channels as src .\n@param patchType Depth of the extracted pixels. By default, they have the same depth as src .\n\n@sa  warpAffine, warpPerspective\n */\nCV_EXPORTS_W void getRectSubPix( InputArray image, Size patchSize,\n                                 Point2f center, OutputArray patch, int patchType = -1 );\n\n/** @example samples/cpp/polar_transforms.cpp\nAn example using the cv::linearPolar and cv::logPolar operations\n*/\n\n/** @brief Remaps an image to semilog-polar coordinates space.\n\n@deprecated This function produces same result as cv::warpPolar(src, dst, src.size(), center, maxRadius, flags+WARP_POLAR_LOG);\n\n@internal\nTransform the source image using the following transformation (See @ref polar_remaps_reference_image \"Polar remaps reference image d)\"):\n\\f[\\begin{array}{l}\n  dst( \\rho , \\phi ) = src(x,y) \\\\\n  dst.size() \\leftarrow src.size()\n\\end{array}\\f]\n\nwhere\n\\f[\\begin{array}{l}\n  I = (dx,dy) = (x - center.x,y - center.y) \\\\\n  \\rho = M \\cdot log_e(\\texttt{magnitude} (I)) ,\\\\\n  \\phi = Kangle \\cdot \\texttt{angle} (I) \\\\\n\\end{array}\\f]\n\nand\n\\f[\\begin{array}{l}\n  M = src.cols / log_e(maxRadius) \\\\\n  Kangle = src.rows / 2\\Pi \\\\\n\\end{array}\\f]\n\nThe function emulates the human \"foveal\" vision and can be used for fast scale and\nrotation-invariant template matching, for object tracking and so forth.\n@param src Source image\n@param dst Destination image. It will have same size and type as src.\n@param center The transformation center; where the output precision is maximal\n@param M Magnitude scale parameter. It determines the radius of the bounding circle to transform too.\n@param flags A combination of interpolation methods, see #InterpolationFlags\n\n@note\n-   The function can not operate in-place.\n-   To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.\n\n@sa cv::linearPolar\n@endinternal\n*/\nCV_EXPORTS_W void logPolar( InputArray src, OutputArray dst,\n                            Point2f center, double M, int flags );\n\n/** @brief Remaps an image to polar coordinates space.\n\n@deprecated This function produces same result as cv::warpPolar(src, dst, src.size(), center, maxRadius, flags)\n\n@internal\nTransform the source image using the following transformation (See @ref polar_remaps_reference_image \"Polar remaps reference image c)\"):\n\\f[\\begin{array}{l}\n  dst( \\rho , \\phi ) = src(x,y) \\\\\n  dst.size() \\leftarrow src.size()\n\\end{array}\\f]\n\nwhere\n\\f[\\begin{array}{l}\n  I = (dx,dy) = (x - center.x,y - center.y) \\\\\n  \\rho = Kmag \\cdot \\texttt{magnitude} (I) ,\\\\\n  \\phi = angle \\cdot \\texttt{angle} (I)\n\\end{array}\\f]\n\nand\n\\f[\\begin{array}{l}\n  Kx = src.cols / maxRadius \\\\\n  Ky = src.rows / 2\\Pi\n\\end{array}\\f]\n\n\n@param src Source image\n@param dst Destination image. It will have same size and type as src.\n@param center The transformation center;\n@param maxRadius The radius of the bounding circle to transform. It determines the inverse magnitude scale parameter too.\n@param flags A combination of interpolation methods, see #InterpolationFlags\n\n@note\n-   The function can not operate in-place.\n-   To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.\n\n@sa cv::logPolar\n@endinternal\n*/\nCV_EXPORTS_W void linearPolar( InputArray src, OutputArray dst,\n                               Point2f center, double maxRadius, int flags );\n\n\n/** \\brief Remaps an image to polar or semilog-polar coordinates space\n\n@anchor polar_remaps_reference_image\n![Polar remaps reference](pics/polar_remap_doc.png)\n\nTransform the source image using the following transformation:\n\\f[\ndst(\\rho , \\phi ) = src(x,y)\n\\f]\n\nwhere\n\\f[\n\\begin{array}{l}\n\\vec{I} = (x - center.x, \\;y - center.y) \\\\\n\\phi = Kangle \\cdot \\texttt{angle} (\\vec{I}) \\\\\n\\rho = \\left\\{\\begin{matrix}\nKlin \\cdot \\texttt{magnitude} (\\vec{I}) & default \\\\\nKlog \\cdot log_e(\\texttt{magnitude} (\\vec{I})) & if \\; semilog \\\\\n\\end{matrix}\\right.\n\\end{array}\n\\f]\n\nand\n\\f[\n\\begin{array}{l}\nKangle = dsize.height / 2\\Pi \\\\\nKlin = dsize.width / maxRadius \\\\\nKlog = dsize.width / log_e(maxRadius) \\\\\n\\end{array}\n\\f]\n\n\n\\par Linear vs semilog mapping\n\nPolar mapping can be linear or semi-log. Add one of #WarpPolarMode to `flags` to specify the polar mapping mode.\n\nLinear is the default mode.\n\nThe semilog mapping emulates the human \"foveal\" vision that permit very high acuity on the line of sight (central vision)\nin contrast to peripheral vision where acuity is minor.\n\n\\par Option on `dsize`:\n\n- if both values in `dsize <=0 ` (default),\nthe destination image will have (almost) same area of source bounding circle:\n\\f[\\begin{array}{l}\ndsize.area  \\leftarrow (maxRadius^2 \\cdot \\Pi) \\\\\ndsize.width = \\texttt{cvRound}(maxRadius) \\\\\ndsize.height = \\texttt{cvRound}(maxRadius \\cdot \\Pi) \\\\\n\\end{array}\\f]\n\n\n- if only `dsize.height <= 0`,\nthe destination image area will be proportional to the bounding circle area but scaled by `Kx * Kx`:\n\\f[\\begin{array}{l}\ndsize.height = \\texttt{cvRound}(dsize.width \\cdot \\Pi) \\\\\n\\end{array}\n\\f]\n\n- if both values in `dsize > 0 `,\nthe destination image will have the given size therefore the area of the bounding circle will be scaled to `dsize`.\n\n\n\\par Reverse mapping\n\nYou can get reverse mapping adding #WARP_INVERSE_MAP to `flags`\n\\snippet polar_transforms.cpp InverseMap\n\nIn addiction, to calculate the original coordinate from a polar mapped coordinate \\f$(rho, phi)->(x, y)\\f$:\n\\snippet polar_transforms.cpp InverseCoordinate\n\n@param src Source image.\n@param dst Destination image. It will have same type as src.\n@param dsize The destination image size (see description for valid options).\n@param center The transformation center.\n@param maxRadius The radius of the bounding circle to transform. It determines the inverse magnitude scale parameter too.\n@param flags A combination of interpolation methods, #InterpolationFlags + #WarpPolarMode.\n            - Add #WARP_POLAR_LINEAR to select linear polar mapping (default)\n            - Add #WARP_POLAR_LOG to select semilog polar mapping\n            - Add #WARP_INVERSE_MAP for reverse mapping.\n@note\n-  The function can not operate in-place.\n-  To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.\n-  This function uses #remap. Due to current implementation limitations the size of an input and output images should be less than 32767x32767.\n\n@sa cv::remap\n*/\nCV_EXPORTS_W void warpPolar(InputArray src, OutputArray dst, Size dsize,\n                            Point2f center, double maxRadius, int flags);\n\n\n//! @} imgproc_transform\n\n//! @addtogroup imgproc_misc\n//! @{\n\n/** @overload */\nCV_EXPORTS_W void integral( InputArray src, OutputArray sum, int sdepth = -1 );\n\n/** @overload */\nCV_EXPORTS_AS(integral2) void integral( InputArray src, OutputArray sum,\n                                        OutputArray sqsum, int sdepth = -1, int sqdepth = -1 );\n\n/** @brief Calculates the integral of an image.\n\nThe function calculates one or more integral images for the source image as follows:\n\n\\f[\\texttt{sum} (X,Y) =  \\sum _{x<X,y<Y}  \\texttt{image} (x,y)\\f]\n\n\\f[\\texttt{sqsum} (X,Y) =  \\sum _{x<X,y<Y}  \\texttt{image} (x,y)^2\\f]\n\n\\f[\\texttt{tilted} (X,Y) =  \\sum _{y<Y,abs(x-X+1) \\leq Y-y-1}  \\texttt{image} (x,y)\\f]\n\nUsing these integral images, you can calculate sum, mean, and standard deviation over a specific\nup-right or rotated rectangular region of the image in a constant time, for example:\n\n\\f[\\sum _{x_1 \\leq x < x_2,  \\, y_1  \\leq y < y_2}  \\texttt{image} (x,y) =  \\texttt{sum} (x_2,y_2)- \\texttt{sum} (x_1,y_2)- \\texttt{sum} (x_2,y_1)+ \\texttt{sum} (x_1,y_1)\\f]\n\nIt makes possible to do a fast blurring or fast block correlation with a variable window size, for\nexample. In case of multi-channel images, sums for each channel are accumulated independently.\n\nAs a practical example, the next figure shows the calculation of the integral of a straight\nrectangle Rect(3,3,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the\noriginal image are shown, as well as the relative pixels in the integral images sum and tilted .\n\n![integral calculation example](pics/integral.png)\n\n@param src input image as \\f$W \\times H\\f$, 8-bit or floating-point (32f or 64f).\n@param sum integral image as \\f$(W+1)\\times (H+1)\\f$ , 32-bit integer or floating-point (32f or 64f).\n@param sqsum integral image for squared pixel values; it is \\f$(W+1)\\times (H+1)\\f$, double-precision\nfloating-point (64f) array.\n@param tilted integral for the image rotated by 45 degrees; it is \\f$(W+1)\\times (H+1)\\f$ array with\nthe same data type as sum.\n@param sdepth desired depth of the integral and the tilted integral images, CV_32S, CV_32F, or\nCV_64F.\n@param sqdepth desired depth of the integral image of squared pixel values, CV_32F or CV_64F.\n */\nCV_EXPORTS_AS(integral3) void integral( InputArray src, OutputArray sum,\n                                        OutputArray sqsum, OutputArray tilted,\n                                        int sdepth = -1, int sqdepth = -1 );\n\n//! @} imgproc_misc\n\n//! @addtogroup imgproc_motion\n//! @{\n\n/** @brief Adds an image to the accumulator image.\n\nThe function adds src or some of its elements to dst :\n\n\\f[\\texttt{dst} (x,y)  \\leftarrow \\texttt{dst} (x,y) +  \\texttt{src} (x,y)  \\quad \\text{if} \\quad \\texttt{mask} (x,y)  \\ne 0\\f]\n\nThe function supports multi-channel images. Each channel is processed independently.\n\nThe function cv::accumulate can be used, for example, to collect statistics of a scene background\nviewed by a still camera and for the further foreground-background segmentation.\n\n@param src Input image of type CV_8UC(n), CV_16UC(n), CV_32FC(n) or CV_64FC(n), where n is a positive integer.\n@param dst %Accumulator image with the same number of channels as input image, and a depth of CV_32F or CV_64F.\n@param mask Optional operation mask.\n\n@sa  accumulateSquare, accumulateProduct, accumulateWeighted\n */\nCV_EXPORTS_W void accumulate( InputArray src, InputOutputArray dst,\n                              InputArray mask = noArray() );\n\n/** @brief Adds the square of a source image to the accumulator image.\n\nThe function adds the input image src or its selected region, raised to a power of 2, to the\naccumulator dst :\n\n\\f[\\texttt{dst} (x,y)  \\leftarrow \\texttt{dst} (x,y) +  \\texttt{src} (x,y)^2  \\quad \\text{if} \\quad \\texttt{mask} (x,y)  \\ne 0\\f]\n\nThe function supports multi-channel images. Each channel is processed independently.\n\n@param src Input image as 1- or 3-channel, 8-bit or 32-bit floating point.\n@param dst %Accumulator image with the same number of channels as input image, 32-bit or 64-bit\nfloating-point.\n@param mask Optional operation mask.\n\n@sa  accumulateSquare, accumulateProduct, accumulateWeighted\n */\nCV_EXPORTS_W void accumulateSquare( InputArray src, InputOutputArray dst,\n                                    InputArray mask = noArray() );\n\n/** @brief Adds the per-element product of two input images to the accumulator image.\n\nThe function adds the product of two images or their selected regions to the accumulator dst :\n\n\\f[\\texttt{dst} (x,y)  \\leftarrow \\texttt{dst} (x,y) +  \\texttt{src1} (x,y)  \\cdot \\texttt{src2} (x,y)  \\quad \\text{if} \\quad \\texttt{mask} (x,y)  \\ne 0\\f]\n\nThe function supports multi-channel images. Each channel is processed independently.\n\n@param src1 First input image, 1- or 3-channel, 8-bit or 32-bit floating point.\n@param src2 Second input image of the same type and the same size as src1 .\n@param dst %Accumulator image with the same number of channels as input images, 32-bit or 64-bit\nfloating-point.\n@param mask Optional operation mask.\n\n@sa  accumulate, accumulateSquare, accumulateWeighted\n */\nCV_EXPORTS_W void accumulateProduct( InputArray src1, InputArray src2,\n                                     InputOutputArray dst, InputArray mask=noArray() );\n\n/** @brief Updates a running average.\n\nThe function calculates the weighted sum of the input image src and the accumulator dst so that dst\nbecomes a running average of a frame sequence:\n\n\\f[\\texttt{dst} (x,y)  \\leftarrow (1- \\texttt{alpha} )  \\cdot \\texttt{dst} (x,y) +  \\texttt{alpha} \\cdot \\texttt{src} (x,y)  \\quad \\text{if} \\quad \\texttt{mask} (x,y)  \\ne 0\\f]\n\nThat is, alpha regulates the update speed (how fast the accumulator \"forgets\" about earlier images).\nThe function supports multi-channel images. Each channel is processed independently.\n\n@param src Input image as 1- or 3-channel, 8-bit or 32-bit floating point.\n@param dst %Accumulator image with the same number of channels as input image, 32-bit or 64-bit\nfloating-point.\n@param alpha Weight of the input image.\n@param mask Optional operation mask.\n\n@sa  accumulate, accumulateSquare, accumulateProduct\n */\nCV_EXPORTS_W void accumulateWeighted( InputArray src, InputOutputArray dst,\n                                      double alpha, InputArray mask = noArray() );\n\n/** @brief The function is used to detect translational shifts that occur between two images.\n\nThe operation takes advantage of the Fourier shift theorem for detecting the translational shift in\nthe frequency domain. It can be used for fast image registration as well as motion estimation. For\nmore information please see <http://en.wikipedia.org/wiki/Phase_correlation>\n\nCalculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed\nwith getOptimalDFTSize.\n\nThe function performs the following equations:\n- First it applies a Hanning window (see <http://en.wikipedia.org/wiki/Hann_function>) to each\nimage to remove possible edge effects. This window is cached until the array size changes to speed\nup processing time.\n- Next it computes the forward DFTs of each source array:\n\\f[\\mathbf{G}_a = \\mathcal{F}\\{src_1\\}, \\; \\mathbf{G}_b = \\mathcal{F}\\{src_2\\}\\f]\nwhere \\f$\\mathcal{F}\\f$ is the forward DFT.\n- It then computes the cross-power spectrum of each frequency domain array:\n\\f[R = \\frac{ \\mathbf{G}_a \\mathbf{G}_b^*}{|\\mathbf{G}_a \\mathbf{G}_b^*|}\\f]\n- Next the cross-correlation is converted back into the time domain via the inverse DFT:\n\\f[r = \\mathcal{F}^{-1}\\{R\\}\\f]\n- Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to\nachieve sub-pixel accuracy.\n\\f[(\\Delta x, \\Delta y) = \\texttt{weightedCentroid} \\{\\arg \\max_{(x, y)}\\{r\\}\\}\\f]\n- If non-zero, the response parameter is computed as the sum of the elements of r within the 5x5\ncentroid around the peak location. It is normalized to a maximum of 1 (meaning there is a single\npeak) and will be smaller when there are multiple peaks.\n\n@param src1 Source floating point array (CV_32FC1 or CV_64FC1)\n@param src2 Source floating point array (CV_32FC1 or CV_64FC1)\n@param window Floating point array with windowing coefficients to reduce edge effects (optional).\n@param response Signal power within the 5x5 centroid around the peak, between 0 and 1 (optional).\n@returns detected phase shift (sub-pixel) between the two arrays.\n\n@sa dft, getOptimalDFTSize, idft, mulSpectrums createHanningWindow\n */\nCV_EXPORTS_W Point2d phaseCorrelate(InputArray src1, InputArray src2,\n                                    InputArray window = noArray(), CV_OUT double* response = 0);\n\n/** @brief This function computes a Hanning window coefficients in two dimensions.\n\nSee (http://en.wikipedia.org/wiki/Hann_function) and (http://en.wikipedia.org/wiki/Window_function)\nfor more information.\n\nAn example is shown below:\n@code\n    // create hanning window of size 100x100 and type CV_32F\n    Mat hann;\n    createHanningWindow(hann, Size(100, 100), CV_32F);\n@endcode\n@param dst Destination array to place Hann coefficients in\n@param winSize The window size specifications (both width and height must be > 1)\n@param type Created array type\n */\nCV_EXPORTS_W void createHanningWindow(OutputArray dst, Size winSize, int type);\n\n/** @brief Performs the per-element division of the first Fourier spectrum by the second Fourier spectrum.\n\nThe function cv::divSpectrums performs the per-element division of the first array by the second array.\nThe arrays are CCS-packed or complex matrices that are results of a real or complex Fourier transform.\n\n@param a first input array.\n@param b second input array of the same size and type as src1 .\n@param c output array of the same size and type as src1 .\n@param flags operation flags; currently, the only supported flag is cv::DFT_ROWS, which indicates that\neach row of src1 and src2 is an independent 1D Fourier spectrum. If you do not want to use this flag, then simply add a `0` as value.\n@param conjB optional flag that conjugates the second input array before the multiplication (true)\nor not (false).\n*/\nCV_EXPORTS_W void divSpectrums(InputArray a, InputArray b, OutputArray c,\n                               int flags, bool conjB = false);\n\n//! @} imgproc_motion\n\n//! @addtogroup imgproc_misc\n//! @{\n\n/** @brief Applies a fixed-level threshold to each array element.\n\nThe function applies fixed-level thresholding to a multiple-channel array. The function is typically\nused to get a bi-level (binary) image out of a grayscale image ( #compare could be also used for\nthis purpose) or for removing a noise, that is, filtering out pixels with too small or too large\nvalues. There are several types of thresholding supported by the function. They are determined by\ntype parameter.\n\nAlso, the special values #THRESH_OTSU or #THRESH_TRIANGLE may be combined with one of the\nabove values. In these cases, the function determines the optimal threshold value using the Otsu's\nor Triangle algorithm and uses it instead of the specified thresh.\n\n@note Currently, the Otsu's and Triangle methods are implemented only for 8-bit single-channel images.\n\n@param src input array (multiple-channel, 8-bit or 32-bit floating point).\n@param dst output array of the same size  and type and the same number of channels as src.\n@param thresh threshold value.\n@param maxval maximum value to use with the #THRESH_BINARY and #THRESH_BINARY_INV thresholding\ntypes.\n@param type thresholding type (see #ThresholdTypes).\n@return the computed threshold value if Otsu's or Triangle methods used.\n\n@sa  adaptiveThreshold, findContours, compare, min, max\n */\nCV_EXPORTS_W double threshold( InputArray src, OutputArray dst,\n                               double thresh, double maxval, int type );\n\n\n/** @brief Applies an adaptive threshold to an array.\n\nThe function transforms a grayscale image to a binary image according to the formulae:\n-   **THRESH_BINARY**\n    \\f[dst(x,y) =  \\fork{\\texttt{maxValue}}{if \\(src(x,y) > T(x,y)\\)}{0}{otherwise}\\f]\n-   **THRESH_BINARY_INV**\n    \\f[dst(x,y) =  \\fork{0}{if \\(src(x,y) > T(x,y)\\)}{\\texttt{maxValue}}{otherwise}\\f]\nwhere \\f$T(x,y)\\f$ is a threshold calculated individually for each pixel (see adaptiveMethod parameter).\n\nThe function can process the image in-place.\n\n@param src Source 8-bit single-channel image.\n@param dst Destination image of the same size and the same type as src.\n@param maxValue Non-zero value assigned to the pixels for which the condition is satisfied\n@param adaptiveMethod Adaptive thresholding algorithm to use, see #AdaptiveThresholdTypes.\nThe #BORDER_REPLICATE | #BORDER_ISOLATED is used to process boundaries.\n@param thresholdType Thresholding type that must be either #THRESH_BINARY or #THRESH_BINARY_INV,\nsee #ThresholdTypes.\n@param blockSize Size of a pixel neighborhood that is used to calculate a threshold value for the\npixel: 3, 5, 7, and so on.\n@param C Constant subtracted from the mean or weighted mean (see the details below). Normally, it\nis positive but may be zero or negative as well.\n\n@sa  threshold, blur, GaussianBlur\n */\nCV_EXPORTS_W void adaptiveThreshold( InputArray src, OutputArray dst,\n                                     double maxValue, int adaptiveMethod,\n                                     int thresholdType, int blockSize, double C );\n\n//! @} imgproc_misc\n\n//! @addtogroup imgproc_filter\n//! @{\n\n/** @example samples/cpp/tutorial_code/ImgProc/Pyramids/Pyramids.cpp\nAn example using pyrDown and pyrUp functions\n*/\n\n/** @brief Blurs an image and downsamples it.\n\nBy default, size of the output image is computed as `Size((src.cols+1)/2, (src.rows+1)/2)`, but in\nany case, the following conditions should be satisfied:\n\n\\f[\\begin{array}{l} | \\texttt{dstsize.width} *2-src.cols| \\leq 2 \\\\ | \\texttt{dstsize.height} *2-src.rows| \\leq 2 \\end{array}\\f]\n\nThe function performs the downsampling step of the Gaussian pyramid construction. First, it\nconvolves the source image with the kernel:\n\n\\f[\\frac{1}{256} \\begin{bmatrix} 1 & 4 & 6 & 4 & 1  \\\\ 4 & 16 & 24 & 16 & 4  \\\\ 6 & 24 & 36 & 24 & 6  \\\\ 4 & 16 & 24 & 16 & 4  \\\\ 1 & 4 & 6 & 4 & 1 \\end{bmatrix}\\f]\n\nThen, it downsamples the image by rejecting even rows and columns.\n\n@param src input image.\n@param dst output image; it has the specified size and the same type as src.\n@param dstsize size of the output image.\n@param borderType Pixel extrapolation method, see #BorderTypes (#BORDER_CONSTANT isn't supported)\n */\nCV_EXPORTS_W void pyrDown( InputArray src, OutputArray dst,\n                           const Size& dstsize = Size(), int borderType = BORDER_DEFAULT );\n\n/** @brief Upsamples an image and then blurs it.\n\nBy default, size of the output image is computed as `Size(src.cols\\*2, (src.rows\\*2)`, but in any\ncase, the following conditions should be satisfied:\n\n\\f[\\begin{array}{l} | \\texttt{dstsize.width} -src.cols*2| \\leq  ( \\texttt{dstsize.width}   \\mod  2)  \\\\ | \\texttt{dstsize.height} -src.rows*2| \\leq  ( \\texttt{dstsize.height}   \\mod  2) \\end{array}\\f]\n\nThe function performs the upsampling step of the Gaussian pyramid construction, though it can\nactually be used to construct the Laplacian pyramid. First, it upsamples the source image by\ninjecting even zero rows and columns and then convolves the result with the same kernel as in\npyrDown multiplied by 4.\n\n@param src input image.\n@param dst output image. It has the specified size and the same type as src .\n@param dstsize size of the output image.\n@param borderType Pixel extrapolation method, see #BorderTypes (only #BORDER_DEFAULT is supported)\n */\nCV_EXPORTS_W void pyrUp( InputArray src, OutputArray dst,\n                         const Size& dstsize = Size(), int borderType = BORDER_DEFAULT );\n\n/** @brief Constructs the Gaussian pyramid for an image.\n\nThe function constructs a vector of images and builds the Gaussian pyramid by recursively applying\npyrDown to the previously built pyramid layers, starting from `dst[0]==src`.\n\n@param src Source image. Check pyrDown for the list of supported types.\n@param dst Destination vector of maxlevel+1 images of the same type as src. dst[0] will be the\nsame as src. dst[1] is the next pyramid layer, a smoothed and down-sized src, and so on.\n@param maxlevel 0-based index of the last (the smallest) pyramid layer. It must be non-negative.\n@param borderType Pixel extrapolation method, see #BorderTypes (#BORDER_CONSTANT isn't supported)\n */\nCV_EXPORTS void buildPyramid( InputArray src, OutputArrayOfArrays dst,\n                              int maxlevel, int borderType = BORDER_DEFAULT );\n\n//! @} imgproc_filter\n\n//! @addtogroup imgproc_hist\n//! @{\n\n/** @example samples/cpp/demhist.cpp\nAn example for creating histograms of an image\n*/\n\n/** @brief Calculates a histogram of a set of arrays.\n\nThe function cv::calcHist calculates the histogram of one or more arrays. The elements of a tuple used\nto increment a histogram bin are taken from the corresponding input arrays at the same location. The\nsample below shows how to compute a 2D Hue-Saturation histogram for a color image. :\n@include snippets/imgproc_calcHist.cpp\n\n@param images Source arrays. They all should have the same depth, CV_8U, CV_16U or CV_32F , and the same\nsize. Each of them can have an arbitrary number of channels.\n@param nimages Number of source images.\n@param channels List of the dims channels used to compute the histogram. The first array channels\nare numerated from 0 to images[0].channels()-1 , the second array channels are counted from\nimages[0].channels() to images[0].channels() + images[1].channels()-1, and so on.\n@param mask Optional mask. If the matrix is not empty, it must be an 8-bit array of the same size\nas images[i] . The non-zero mask elements mark the array elements counted in the histogram.\n@param hist Output histogram, which is a dense or sparse dims -dimensional array.\n@param dims Histogram dimensionality that must be positive and not greater than CV_MAX_DIMS\n(equal to 32 in the current OpenCV version).\n@param histSize Array of histogram sizes in each dimension.\n@param ranges Array of the dims arrays of the histogram bin boundaries in each dimension. When the\nhistogram is uniform ( uniform =true), then for each dimension i it is enough to specify the lower\n(inclusive) boundary \\f$L_0\\f$ of the 0-th histogram bin and the upper (exclusive) boundary\n\\f$U_{\\texttt{histSize}[i]-1}\\f$ for the last histogram bin histSize[i]-1 . That is, in case of a\nuniform histogram each of ranges[i] is an array of 2 elements. When the histogram is not uniform (\nuniform=false ), then each of ranges[i] contains histSize[i]+1 elements:\n\\f$L_0, U_0=L_1, U_1=L_2, ..., U_{\\texttt{histSize[i]}-2}=L_{\\texttt{histSize[i]}-1}, U_{\\texttt{histSize[i]}-1}\\f$\n. The array elements, that are not between \\f$L_0\\f$ and \\f$U_{\\texttt{histSize[i]}-1}\\f$ , are not\ncounted in the histogram.\n@param uniform Flag indicating whether the histogram is uniform or not (see above).\n@param accumulate Accumulation flag. If it is set, the histogram is not cleared in the beginning\nwhen it is allocated. This feature enables you to compute a single histogram from several sets of\narrays, or to update the histogram in time.\n*/\nCV_EXPORTS void calcHist( const Mat* images, int nimages,\n                          const int* channels, InputArray mask,\n                          OutputArray hist, int dims, const int* histSize,\n                          const float** ranges, bool uniform = true, bool accumulate = false );\n\n/** @overload\n\nthis variant uses %SparseMat for output\n*/\nCV_EXPORTS void calcHist( const Mat* images, int nimages,\n                          const int* channels, InputArray mask,\n                          SparseMat& hist, int dims,\n                          const int* histSize, const float** ranges,\n                          bool uniform = true, bool accumulate = false );\n\n/** @overload */\nCV_EXPORTS_W void calcHist( InputArrayOfArrays images,\n                            const std::vector<int>& channels,\n                            InputArray mask, OutputArray hist,\n                            const std::vector<int>& histSize,\n                            const std::vector<float>& ranges,\n                            bool accumulate = false );\n\n/** @brief Calculates the back projection of a histogram.\n\nThe function cv::calcBackProject calculates the back project of the histogram. That is, similarly to\n#calcHist , at each location (x, y) the function collects the values from the selected channels\nin the input images and finds the corresponding histogram bin. But instead of incrementing it, the\nfunction reads the bin value, scales it by scale , and stores in backProject(x,y) . In terms of\nstatistics, the function computes probability of each element value in respect with the empirical\nprobability distribution represented by the histogram. See how, for example, you can find and track\na bright-colored object in a scene:\n\n- Before tracking, show the object to the camera so that it covers almost the whole frame.\nCalculate a hue histogram. The histogram may have strong maximums, corresponding to the dominant\ncolors in the object.\n\n- When tracking, calculate a back projection of a hue plane of each input video frame using that\npre-computed histogram. Threshold the back projection to suppress weak colors. It may also make\nsense to suppress pixels with non-sufficient color saturation and too dark or too bright pixels.\n\n- Find connected components in the resulting picture and choose, for example, the largest\ncomponent.\n\nThis is an approximate algorithm of the CamShift color object tracker.\n\n@param images Source arrays. They all should have the same depth, CV_8U, CV_16U or CV_32F , and the same\nsize. Each of them can have an arbitrary number of channels.\n@param nimages Number of source images.\n@param channels The list of channels used to compute the back projection. The number of channels\nmust match the histogram dimensionality. The first array channels are numerated from 0 to\nimages[0].channels()-1 , the second array channels are counted from images[0].channels() to\nimages[0].channels() + images[1].channels()-1, and so on.\n@param hist Input histogram that can be dense or sparse.\n@param backProject Destination back projection array that is a single-channel array of the same\nsize and depth as images[0] .\n@param ranges Array of arrays of the histogram bin boundaries in each dimension. See #calcHist .\n@param scale Optional scale factor for the output back projection.\n@param uniform Flag indicating whether the histogram is uniform or not (see above).\n\n@sa calcHist, compareHist\n */\nCV_EXPORTS void calcBackProject( const Mat* images, int nimages,\n                                 const int* channels, InputArray hist,\n                                 OutputArray backProject, const float** ranges,\n                                 double scale = 1, bool uniform = true );\n\n/** @overload */\nCV_EXPORTS void calcBackProject( const Mat* images, int nimages,\n                                 const int* channels, const SparseMat& hist,\n                                 OutputArray backProject, const float** ranges,\n                                 double scale = 1, bool uniform = true );\n\n/** @overload */\nCV_EXPORTS_W void calcBackProject( InputArrayOfArrays images, const std::vector<int>& channels,\n                                   InputArray hist, OutputArray dst,\n                                   const std::vector<float>& ranges,\n                                   double scale );\n\n/** @brief Compares two histograms.\n\nThe function cv::compareHist compares two dense or two sparse histograms using the specified method.\n\nThe function returns \\f$d(H_1, H_2)\\f$ .\n\nWhile the function works well with 1-, 2-, 3-dimensional dense histograms, it may not be suitable\nfor high-dimensional sparse histograms. In such histograms, because of aliasing and sampling\nproblems, the coordinates of non-zero histogram bins can slightly shift. To compare such histograms\nor more general sparse configurations of weighted points, consider using the #EMD function.\n\n@param H1 First compared histogram.\n@param H2 Second compared histogram of the same size as H1 .\n@param method Comparison method, see #HistCompMethods\n */\nCV_EXPORTS_W double compareHist( InputArray H1, InputArray H2, int method );\n\n/** @overload */\nCV_EXPORTS double compareHist( const SparseMat& H1, const SparseMat& H2, int method );\n\n/** @brief Equalizes the histogram of a grayscale image.\n\nThe function equalizes the histogram of the input image using the following algorithm:\n\n- Calculate the histogram \\f$H\\f$ for src .\n- Normalize the histogram so that the sum of histogram bins is 255.\n- Compute the integral of the histogram:\n\\f[H'_i =  \\sum _{0  \\le j < i} H(j)\\f]\n- Transform the image using \\f$H'\\f$ as a look-up table: \\f$\\texttt{dst}(x,y) = H'(\\texttt{src}(x,y))\\f$\n\nThe algorithm normalizes the brightness and increases the contrast of the image.\n\n@param src Source 8-bit single channel image.\n@param dst Destination image of the same size and type as src .\n */\nCV_EXPORTS_W void equalizeHist( InputArray src, OutputArray dst );\n\n/** @brief Creates a smart pointer to a cv::CLAHE class and initializes it.\n\n@param clipLimit Threshold for contrast limiting.\n@param tileGridSize Size of grid for histogram equalization. Input image will be divided into\nequally sized rectangular tiles. tileGridSize defines the number of tiles in row and column.\n */\nCV_EXPORTS_W Ptr<CLAHE> createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8));\n\n/** @brief Computes the \"minimal work\" distance between two weighted point configurations.\n\nThe function computes the earth mover distance and/or a lower boundary of the distance between the\ntwo weighted point configurations. One of the applications described in @cite RubnerSept98,\n@cite Rubner2000 is multi-dimensional histogram comparison for image retrieval. EMD is a transportation\nproblem that is solved using some modification of a simplex algorithm, thus the complexity is\nexponential in the worst case, though, on average it is much faster. In the case of a real metric\nthe lower boundary can be calculated even faster (using linear-time algorithm) and it can be used\nto determine roughly whether the two signatures are far enough so that they cannot relate to the\nsame object.\n\n@param signature1 First signature, a \\f$\\texttt{size1}\\times \\texttt{dims}+1\\f$ floating-point matrix.\nEach row stores the point weight followed by the point coordinates. The matrix is allowed to have\na single column (weights only) if the user-defined cost matrix is used. The weights must be\nnon-negative and have at least one non-zero value.\n@param signature2 Second signature of the same format as signature1 , though the number of rows\nmay be different. The total weights may be different. In this case an extra \"dummy\" point is added\nto either signature1 or signature2. The weights must be non-negative and have at least one non-zero\nvalue.\n@param distType Used metric. See #DistanceTypes.\n@param cost User-defined \\f$\\texttt{size1}\\times \\texttt{size2}\\f$ cost matrix. Also, if a cost matrix\nis used, lower boundary lowerBound cannot be calculated because it needs a metric function.\n@param lowerBound Optional input/output parameter: lower boundary of a distance between the two\nsignatures that is a distance between mass centers. The lower boundary may not be calculated if\nthe user-defined cost matrix is used, the total weights of point configurations are not equal, or\nif the signatures consist of weights only (the signature matrices have a single column). You\n**must** initialize \\*lowerBound . If the calculated distance between mass centers is greater or\nequal to \\*lowerBound (it means that the signatures are far enough), the function does not\ncalculate EMD. In any case \\*lowerBound is set to the calculated distance between mass centers on\nreturn. Thus, if you want to calculate both distance between mass centers and EMD, \\*lowerBound\nshould be set to 0.\n@param flow Resultant \\f$\\texttt{size1} \\times \\texttt{size2}\\f$ flow matrix: \\f$\\texttt{flow}_{i,j}\\f$ is\na flow from \\f$i\\f$ -th point of signature1 to \\f$j\\f$ -th point of signature2 .\n */\nCV_EXPORTS float EMD( InputArray signature1, InputArray signature2,\n                      int distType, InputArray cost=noArray(),\n                      float* lowerBound = 0, OutputArray flow = noArray() );\n\nCV_EXPORTS_AS(EMD) float wrapperEMD( InputArray signature1, InputArray signature2,\n                      int distType, InputArray cost=noArray(),\n                      CV_IN_OUT Ptr<float> lowerBound = Ptr<float>(), OutputArray flow = noArray() );\n\n//! @} imgproc_hist\n\n//! @addtogroup imgproc_segmentation\n//! @{\n\n/** @example samples/cpp/watershed.cpp\nAn example using the watershed algorithm\n*/\n\n/** @brief Performs a marker-based image segmentation using the watershed algorithm.\n\nThe function implements one of the variants of watershed, non-parametric marker-based segmentation\nalgorithm, described in @cite Meyer92 .\n\nBefore passing the image to the function, you have to roughly outline the desired regions in the\nimage markers with positive (\\>0) indices. So, every region is represented as one or more connected\ncomponents with the pixel values 1, 2, 3, and so on. Such markers can be retrieved from a binary\nmask using #findContours and #drawContours (see the watershed.cpp demo). The markers are \"seeds\" of\nthe future image regions. All the other pixels in markers , whose relation to the outlined regions\nis not known and should be defined by the algorithm, should be set to 0's. In the function output,\neach pixel in markers is set to a value of the \"seed\" components or to -1 at boundaries between the\nregions.\n\n@note Any two neighbor connected components are not necessarily separated by a watershed boundary\n(-1's pixels); for example, they can touch each other in the initial marker image passed to the\nfunction.\n\n@param image Input 8-bit 3-channel image.\n@param markers Input/output 32-bit single-channel image (map) of markers. It should have the same\nsize as image .\n\n@sa findContours\n */\nCV_EXPORTS_W void watershed( InputArray image, InputOutputArray markers );\n\n//! @} imgproc_segmentation\n\n//! @addtogroup imgproc_filter\n//! @{\n\n/** @brief Performs initial step of meanshift segmentation of an image.\n\nThe function implements the filtering stage of meanshift segmentation, that is, the output of the\nfunction is the filtered \"posterized\" image with color gradients and fine-grain texture flattened.\nAt every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes\nmeanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is\nconsidered:\n\n\\f[(x,y): X- \\texttt{sp} \\le x  \\le X+ \\texttt{sp} , Y- \\texttt{sp} \\le y  \\le Y+ \\texttt{sp} , ||(R,G,B)-(r,g,b)||   \\le \\texttt{sr}\\f]\n\nwhere (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively\n(though, the algorithm does not depend on the color space used, so any 3-component color space can\nbe used instead). Over the neighborhood the average spatial value (X',Y') and average color vector\n(R',G',B') are found and they act as the neighborhood center on the next iteration:\n\n\\f[(X,Y)~(X',Y'), (R,G,B)~(R',G',B').\\f]\n\nAfter the iterations over, the color components of the initial pixel (that is, the pixel from where\nthe iterations started) are set to the final value (average color at the last iteration):\n\n\\f[I(X,Y) <- (R*,G*,B*)\\f]\n\nWhen maxLevel \\> 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is\nrun on the smallest layer first. After that, the results are propagated to the larger layer and the\niterations are run again only on those pixels where the layer colors differ by more than sr from the\nlower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the\nresults will be actually different from the ones obtained by running the meanshift procedure on the\nwhole original image (i.e. when maxLevel==0).\n\n@param src The source 8-bit, 3-channel image.\n@param dst The destination image of the same format and the same size as the source.\n@param sp The spatial window radius.\n@param sr The color window radius.\n@param maxLevel Maximum level of the pyramid for the segmentation.\n@param termcrit Termination criteria: when to stop meanshift iterations.\n */\nCV_EXPORTS_W void pyrMeanShiftFiltering( InputArray src, OutputArray dst,\n                                         double sp, double sr, int maxLevel = 1,\n                                         TermCriteria termcrit=TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5,1) );\n\n//! @}\n\n//! @addtogroup imgproc_segmentation\n//! @{\n\n/** @example samples/cpp/grabcut.cpp\nAn example using the GrabCut algorithm\n![Sample Screenshot](grabcut_output1.jpg)\n*/\n\n/** @brief Runs the GrabCut algorithm.\n\nThe function implements the [GrabCut image segmentation algorithm](http://en.wikipedia.org/wiki/GrabCut).\n\n@param img Input 8-bit 3-channel image.\n@param mask Input/output 8-bit single-channel mask. The mask is initialized by the function when\nmode is set to #GC_INIT_WITH_RECT. Its elements may have one of the #GrabCutClasses.\n@param rect ROI containing a segmented object. The pixels outside of the ROI are marked as\n\"obvious background\". The parameter is only used when mode==#GC_INIT_WITH_RECT .\n@param bgdModel Temporary array for the background model. Do not modify it while you are\nprocessing the same image.\n@param fgdModel Temporary arrays for the foreground model. Do not modify it while you are\nprocessing the same image.\n@param iterCount Number of iterations the algorithm should make before returning the result. Note\nthat the result can be refined with further calls with mode==#GC_INIT_WITH_MASK or\nmode==GC_EVAL .\n@param mode Operation mode that could be one of the #GrabCutModes\n */\nCV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, Rect rect,\n                           InputOutputArray bgdModel, InputOutputArray fgdModel,\n                           int iterCount, int mode = GC_EVAL );\n\n//! @} imgproc_segmentation\n\n//! @addtogroup imgproc_misc\n//! @{\n\n/** @example samples/cpp/distrans.cpp\nAn example on using the distance transform\n*/\n\n/** @brief Calculates the distance to the closest zero pixel for each pixel of the source image.\n\nThe function cv::distanceTransform calculates the approximate or precise distance from every binary\nimage pixel to the nearest zero pixel. For zero image pixels, the distance will obviously be zero.\n\nWhen maskSize == #DIST_MASK_PRECISE and distanceType == #DIST_L2 , the function runs the\nalgorithm described in @cite Felzenszwalb04 . This algorithm is parallelized with the TBB library.\n\nIn other cases, the algorithm @cite Borgefors86 is used. This means that for a pixel the function\nfinds the shortest path to the nearest zero pixel consisting of basic shifts: horizontal, vertical,\ndiagonal, or knight's move (the latest is available for a \\f$5\\times 5\\f$ mask). The overall\ndistance is calculated as a sum of these basic distances. Since the distance function should be\nsymmetric, all of the horizontal and vertical shifts must have the same cost (denoted as a ), all\nthe diagonal shifts must have the same cost (denoted as `b`), and all knight's moves must have the\nsame cost (denoted as `c`). For the #DIST_C and #DIST_L1 types, the distance is calculated\nprecisely, whereas for #DIST_L2 (Euclidean distance) the distance can be calculated only with a\nrelative error (a \\f$5\\times 5\\f$ mask gives more accurate results). For `a`,`b`, and `c`, OpenCV\nuses the values suggested in the original paper:\n- DIST_L1: `a = 1, b = 2`\n- DIST_L2:\n    - `3 x 3`: `a=0.955, b=1.3693`\n    - `5 x 5`: `a=1, b=1.4, c=2.1969`\n- DIST_C: `a = 1, b = 1`\n\nTypically, for a fast, coarse distance estimation #DIST_L2, a \\f$3\\times 3\\f$ mask is used. For a\nmore accurate distance estimation #DIST_L2, a \\f$5\\times 5\\f$ mask or the precise algorithm is used.\nNote that both the precise and the approximate algorithms are linear on the number of pixels.\n\nThis variant of the function does not only compute the minimum distance for each pixel \\f$(x, y)\\f$\nbut also identifies the nearest connected component consisting of zero pixels\n(labelType==#DIST_LABEL_CCOMP) or the nearest zero pixel (labelType==#DIST_LABEL_PIXEL). Index of the\ncomponent/pixel is stored in `labels(x, y)`. When labelType==#DIST_LABEL_CCOMP, the function\nautomatically finds connected components of zero pixels in the input image and marks them with\ndistinct labels. When labelType==#DIST_LABEL_PIXEL, the function scans through the input image and\nmarks all the zero pixels with distinct labels.\n\nIn this mode, the complexity is still linear. That is, the function provides a very fast way to\ncompute the Voronoi diagram for a binary image. Currently, the second variant can use only the\napproximate distance transform algorithm, i.e. maskSize=#DIST_MASK_PRECISE is not supported\nyet.\n\n@param src 8-bit, single-channel (binary) source image.\n@param dst Output image with calculated distances. It is a 8-bit or 32-bit floating-point,\nsingle-channel image of the same size as src.\n@param labels Output 2D array of labels (the discrete Voronoi diagram). It has the type\nCV_32SC1 and the same size as src.\n@param distanceType Type of distance, see #DistanceTypes\n@param maskSize Size of the distance transform mask, see #DistanceTransformMasks.\n#DIST_MASK_PRECISE is not supported by this variant. In case of the #DIST_L1 or #DIST_C distance type,\nthe parameter is forced to 3 because a \\f$3\\times 3\\f$ mask gives the same result as \\f$5\\times\n5\\f$ or any larger aperture.\n@param labelType Type of the label array to build, see #DistanceTransformLabelTypes.\n */\nCV_EXPORTS_AS(distanceTransformWithLabels) void distanceTransform( InputArray src, OutputArray dst,\n                                     OutputArray labels, int distanceType, int maskSize,\n                                     int labelType = DIST_LABEL_CCOMP );\n\n/** @overload\n@param src 8-bit, single-channel (binary) source image.\n@param dst Output image with calculated distances. It is a 8-bit or 32-bit floating-point,\nsingle-channel image of the same size as src .\n@param distanceType Type of distance, see #DistanceTypes\n@param maskSize Size of the distance transform mask, see #DistanceTransformMasks. In case of the\n#DIST_L1 or #DIST_C distance type, the parameter is forced to 3 because a \\f$3\\times 3\\f$ mask gives\nthe same result as \\f$5\\times 5\\f$ or any larger aperture.\n@param dstType Type of output image. It can be CV_8U or CV_32F. Type CV_8U can be used only for\nthe first variant of the function and distanceType == #DIST_L1.\n*/\nCV_EXPORTS_W void distanceTransform( InputArray src, OutputArray dst,\n                                     int distanceType, int maskSize, int dstType=CV_32F);\n\n/** @example samples/cpp/ffilldemo.cpp\nAn example using the FloodFill technique\n*/\n\n/** @overload\n\nvariant without `mask` parameter\n*/\nCV_EXPORTS int floodFill( InputOutputArray image,\n                          Point seedPoint, Scalar newVal, CV_OUT Rect* rect = 0,\n                          Scalar loDiff = Scalar(), Scalar upDiff = Scalar(),\n                          int flags = 4 );\n\n/** @brief Fills a connected component with the given color.\n\nThe function cv::floodFill fills a connected component starting from the seed point with the specified\ncolor. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The\npixel at \\f$(x,y)\\f$ is considered to belong to the repainted domain if:\n\n- in case of a grayscale image and floating range\n\\f[\\texttt{src} (x',y')- \\texttt{loDiff} \\leq \\texttt{src} (x,y)  \\leq \\texttt{src} (x',y')+ \\texttt{upDiff}\\f]\n\n\n- in case of a grayscale image and fixed range\n\\f[\\texttt{src} ( \\texttt{seedPoint} .x, \\texttt{seedPoint} .y)- \\texttt{loDiff} \\leq \\texttt{src} (x,y)  \\leq \\texttt{src} ( \\texttt{seedPoint} .x, \\texttt{seedPoint} .y)+ \\texttt{upDiff}\\f]\n\n\n- in case of a color image and floating range\n\\f[\\texttt{src} (x',y')_r- \\texttt{loDiff} _r \\leq \\texttt{src} (x,y)_r \\leq \\texttt{src} (x',y')_r+ \\texttt{upDiff} _r,\\f]\n\\f[\\texttt{src} (x',y')_g- \\texttt{loDiff} _g \\leq \\texttt{src} (x,y)_g \\leq \\texttt{src} (x',y')_g+ \\texttt{upDiff} _g\\f]\nand\n\\f[\\texttt{src} (x',y')_b- \\texttt{loDiff} _b \\leq \\texttt{src} (x,y)_b \\leq \\texttt{src} (x',y')_b+ \\texttt{upDiff} _b\\f]\n\n\n- in case of a color image and fixed range\n\\f[\\texttt{src} ( \\texttt{seedPoint} .x, \\texttt{seedPoint} .y)_r- \\texttt{loDiff} _r \\leq \\texttt{src} (x,y)_r \\leq \\texttt{src} ( \\texttt{seedPoint} .x, \\texttt{seedPoint} .y)_r+ \\texttt{upDiff} _r,\\f]\n\\f[\\texttt{src} ( \\texttt{seedPoint} .x, \\texttt{seedPoint} .y)_g- \\texttt{loDiff} _g \\leq \\texttt{src} (x,y)_g \\leq \\texttt{src} ( \\texttt{seedPoint} .x, \\texttt{seedPoint} .y)_g+ \\texttt{upDiff} _g\\f]\nand\n\\f[\\texttt{src} ( \\texttt{seedPoint} .x, \\texttt{seedPoint} .y)_b- \\texttt{loDiff} _b \\leq \\texttt{src} (x,y)_b \\leq \\texttt{src} ( \\texttt{seedPoint} .x, \\texttt{seedPoint} .y)_b+ \\texttt{upDiff} _b\\f]\n\n\nwhere \\f$src(x',y')\\f$ is the value of one of pixel neighbors that is already known to belong to the\ncomponent. That is, to be added to the connected component, a color/brightness of the pixel should\nbe close enough to:\n- Color/brightness of one of its neighbors that already belong to the connected component in case\nof a floating range.\n- Color/brightness of the seed point in case of a fixed range.\n\nUse these functions to either mark a connected component with the specified color in-place, or build\na mask and then extract the contour, or copy the region to another image, and so on.\n\n@param image Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the\nfunction unless the #FLOODFILL_MASK_ONLY flag is set in the second variant of the function. See\nthe details below.\n@param mask Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels\ntaller than image. Since this is both an input and output parameter, you must take responsibility\nof initializing it. Flood-filling cannot go across non-zero pixels in the input mask. For example,\nan edge detector output can be used as a mask to stop filling at edges. On output, pixels in the\nmask corresponding to filled pixels in the image are set to 1 or to the a value specified in flags\nas described below. Additionally, the function fills the border of the mask with ones to simplify\ninternal processing. It is therefore possible to use the same mask in multiple calls to the function\nto make sure the filled areas do not overlap.\n@param seedPoint Starting point.\n@param newVal New value of the repainted domain pixels.\n@param loDiff Maximal lower brightness/color difference between the currently observed pixel and\none of its neighbors belonging to the component, or a seed pixel being added to the component.\n@param upDiff Maximal upper brightness/color difference between the currently observed pixel and\none of its neighbors belonging to the component, or a seed pixel being added to the component.\n@param rect Optional output parameter set by the function to the minimum bounding rectangle of the\nrepainted domain.\n@param flags Operation flags. The first 8 bits contain a connectivity value. The default value of\n4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A\nconnectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner)\nwill be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill\nthe mask (the default value is 1). For example, 4 | ( 255 \\<\\< 8 ) will consider 4 nearest\nneighbours and fill the mask with a value of 255. The following additional options occupy higher\nbits and therefore may be further combined with the connectivity and mask fill values using\nbit-wise or (|), see #FloodFillFlags.\n\n@note Since the mask is larger than the filled image, a pixel \\f$(x, y)\\f$ in image corresponds to the\npixel \\f$(x+1, y+1)\\f$ in the mask .\n\n@sa findContours\n */\nCV_EXPORTS_W int floodFill( InputOutputArray image, InputOutputArray mask,\n                            Point seedPoint, Scalar newVal, CV_OUT Rect* rect=0,\n                            Scalar loDiff = Scalar(), Scalar upDiff = Scalar(),\n                            int flags = 4 );\n\n//! Performs linear blending of two images:\n//! \\f[ \\texttt{dst}(i,j) = \\texttt{weights1}(i,j)*\\texttt{src1}(i,j) + \\texttt{weights2}(i,j)*\\texttt{src2}(i,j) \\f]\n//! @param src1 It has a type of CV_8UC(n) or CV_32FC(n), where n is a positive integer.\n//! @param src2 It has the same type and size as src1.\n//! @param weights1 It has a type of CV_32FC1 and the same size with src1.\n//! @param weights2 It has a type of CV_32FC1 and the same size with src1.\n//! @param dst It is created if it does not have the same size and type with src1.\nCV_EXPORTS_W void blendLinear(InputArray src1, InputArray src2, InputArray weights1, InputArray weights2, OutputArray dst);\n\n//! @} imgproc_misc\n\n//! @addtogroup imgproc_color_conversions\n//! @{\n\n/** @brief Converts an image from one color space to another.\n\nThe function converts an input image from one color space to another. In case of a transformation\nto-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR). Note\nthat the default color format in OpenCV is often referred to as RGB but it is actually BGR (the\nbytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue\ncomponent, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and\nsixth bytes would then be the second pixel (Blue, then Green, then Red), and so on.\n\nThe conventional ranges for R, G, and B channel values are:\n-   0 to 255 for CV_8U images\n-   0 to 65535 for CV_16U images\n-   0 to 1 for CV_32F images\n\nIn case of linear transformations, the range does not matter. But in case of a non-linear\ntransformation, an input RGB image should be normalized to the proper value range to get the correct\nresults, for example, for RGB \\f$\\rightarrow\\f$ L\\*u\\*v\\* transformation. For example, if you have a\n32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will\nhave the 0..255 value range instead of 0..1 assumed by the function. So, before calling #cvtColor ,\nyou need first to scale the image down:\n@code\n    img *= 1./255;\n    cvtColor(img, img, COLOR_BGR2Luv);\n@endcode\nIf you use #cvtColor with 8-bit images, the conversion will have some information lost. For many\napplications, this will not be noticeable but it is recommended to use 32-bit images in applications\nthat need the full range of colors or that convert an image before an operation and then convert\nback.\n\nIf conversion adds the alpha channel, its value will set to the maximum of corresponding channel\nrange: 255 for CV_8U, 65535 for CV_16U, 1 for CV_32F.\n\n@param src input image: 8-bit unsigned, 16-bit unsigned ( CV_16UC... ), or single-precision\nfloating-point.\n@param dst output image of the same size and depth as src.\n@param code color space conversion code (see #ColorConversionCodes).\n@param dstCn number of channels in the destination image; if the parameter is 0, the number of the\nchannels is derived automatically from src and code.\n\n@see @ref imgproc_color_conversions\n */\nCV_EXPORTS_W void cvtColor( InputArray src, OutputArray dst, int code, int dstCn = 0 );\n\n/** @brief Converts an image from one color space to another where the source image is\nstored in two planes.\n\nThis function only supports YUV420 to RGB conversion as of now.\n\n@param src1: 8-bit image (#CV_8U) of the Y plane.\n@param src2: image containing interleaved U/V plane.\n@param dst: output image.\n@param code: Specifies the type of conversion. It can take any of the following values:\n- #COLOR_YUV2BGR_NV12\n- #COLOR_YUV2RGB_NV12\n- #COLOR_YUV2BGRA_NV12\n- #COLOR_YUV2RGBA_NV12\n- #COLOR_YUV2BGR_NV21\n- #COLOR_YUV2RGB_NV21\n- #COLOR_YUV2BGRA_NV21\n- #COLOR_YUV2RGBA_NV21\n*/\nCV_EXPORTS_W void cvtColorTwoPlane( InputArray src1, InputArray src2, OutputArray dst, int code );\n\n/** @brief main function for all demosaicing processes\n\n@param src input image: 8-bit unsigned or 16-bit unsigned.\n@param dst output image of the same size and depth as src.\n@param code Color space conversion code (see the description below).\n@param dstCn number of channels in the destination image; if the parameter is 0, the number of the\nchannels is derived automatically from src and code.\n\nThe function can do the following transformations:\n\n-   Demosaicing using bilinear interpolation\n\n    #COLOR_BayerBG2BGR , #COLOR_BayerGB2BGR , #COLOR_BayerRG2BGR , #COLOR_BayerGR2BGR\n\n    #COLOR_BayerBG2GRAY , #COLOR_BayerGB2GRAY , #COLOR_BayerRG2GRAY , #COLOR_BayerGR2GRAY\n\n-   Demosaicing using Variable Number of Gradients.\n\n    #COLOR_BayerBG2BGR_VNG , #COLOR_BayerGB2BGR_VNG , #COLOR_BayerRG2BGR_VNG , #COLOR_BayerGR2BGR_VNG\n\n-   Edge-Aware Demosaicing.\n\n    #COLOR_BayerBG2BGR_EA , #COLOR_BayerGB2BGR_EA , #COLOR_BayerRG2BGR_EA , #COLOR_BayerGR2BGR_EA\n\n-   Demosaicing with alpha channel\n\n    #COLOR_BayerBG2BGRA , #COLOR_BayerGB2BGRA , #COLOR_BayerRG2BGRA , #COLOR_BayerGR2BGRA\n\n@sa cvtColor\n*/\nCV_EXPORTS_W void demosaicing(InputArray src, OutputArray dst, int code, int dstCn = 0);\n\n//! @} imgproc_color_conversions\n\n//! @addtogroup imgproc_shape\n//! @{\n\n/** @brief Calculates all of the moments up to the third order of a polygon or rasterized shape.\n\nThe function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The\nresults are returned in the structure cv::Moments.\n\n@param array Raster image (single-channel, 8-bit or floating-point 2D array) or an array (\n\\f$1 \\times N\\f$ or \\f$N \\times 1\\f$ ) of 2D points (Point or Point2f ).\n@param binaryImage If it is true, all non-zero image pixels are treated as 1's. The parameter is\nused for images only.\n@returns moments.\n\n@note Only applicable to contour moments calculations from Python bindings: Note that the numpy\ntype for the input array should be either np.int32 or np.float32.\n\n@sa  contourArea, arcLength\n */\nCV_EXPORTS_W Moments moments( InputArray array, bool binaryImage = false );\n\n/** @brief Calculates seven Hu invariants.\n\nThe function calculates seven Hu invariants (introduced in @cite Hu62; see also\n<http://en.wikipedia.org/wiki/Image_moment>) defined as:\n\n\\f[\\begin{array}{l} hu[0]= \\eta _{20}+ \\eta _{02} \\\\ hu[1]=( \\eta _{20}- \\eta _{02})^{2}+4 \\eta _{11}^{2} \\\\ hu[2]=( \\eta _{30}-3 \\eta _{12})^{2}+ (3 \\eta _{21}- \\eta _{03})^{2} \\\\ hu[3]=( \\eta _{30}+ \\eta _{12})^{2}+ ( \\eta _{21}+ \\eta _{03})^{2} \\\\ hu[4]=( \\eta _{30}-3 \\eta _{12})( \\eta _{30}+ \\eta _{12})[( \\eta _{30}+ \\eta _{12})^{2}-3( \\eta _{21}+ \\eta _{03})^{2}]+(3 \\eta _{21}- \\eta _{03})( \\eta _{21}+ \\eta _{03})[3( \\eta _{30}+ \\eta _{12})^{2}-( \\eta _{21}+ \\eta _{03})^{2}] \\\\ hu[5]=( \\eta _{20}- \\eta _{02})[( \\eta _{30}+ \\eta _{12})^{2}- ( \\eta _{21}+ \\eta _{03})^{2}]+4 \\eta _{11}( \\eta _{30}+ \\eta _{12})( \\eta _{21}+ \\eta _{03}) \\\\ hu[6]=(3 \\eta _{21}- \\eta _{03})( \\eta _{21}+ \\eta _{03})[3( \\eta _{30}+ \\eta _{12})^{2}-( \\eta _{21}+ \\eta _{03})^{2}]-( \\eta _{30}-3 \\eta _{12})( \\eta _{21}+ \\eta _{03})[3( \\eta _{30}+ \\eta _{12})^{2}-( \\eta _{21}+ \\eta _{03})^{2}] \\\\ \\end{array}\\f]\n\nwhere \\f$\\eta_{ji}\\f$ stands for \\f$\\texttt{Moments::nu}_{ji}\\f$ .\n\nThese values are proved to be invariants to the image scale, rotation, and reflection except the\nseventh one, whose sign is changed by reflection. This invariance is proved with the assumption of\ninfinite image resolution. In case of raster images, the computed Hu invariants for the original and\ntransformed images are a bit different.\n\n@param moments Input moments computed with moments .\n@param hu Output Hu invariants.\n\n@sa matchShapes\n */\nCV_EXPORTS void HuMoments( const Moments& moments, double hu[7] );\n\n/** @overload */\nCV_EXPORTS_W void HuMoments( const Moments& m, OutputArray hu );\n\n//! @} imgproc_shape\n\n//! @addtogroup imgproc_object\n//! @{\n\n//! type of the template matching operation\nenum TemplateMatchModes {\n    TM_SQDIFF        = 0, /*!< \\f[R(x,y)= \\sum _{x',y'} (T(x',y')-I(x+x',y+y'))^2\\f]\n                               with mask:\n                               \\f[R(x,y)= \\sum _{x',y'} \\left( (T(x',y')-I(x+x',y+y')) \\cdot\n                                  M(x',y') \\right)^2\\f] */\n    TM_SQDIFF_NORMED = 1, /*!< \\f[R(x,y)= \\frac{\\sum_{x',y'} (T(x',y')-I(x+x',y+y'))^2}{\\sqrt{\\sum_{\n                                  x',y'}T(x',y')^2 \\cdot \\sum_{x',y'} I(x+x',y+y')^2}}\\f]\n                               with mask:\n                               \\f[R(x,y)= \\frac{\\sum _{x',y'} \\left( (T(x',y')-I(x+x',y+y')) \\cdot\n                                  M(x',y') \\right)^2}{\\sqrt{\\sum_{x',y'} \\left( T(x',y') \\cdot\n                                  M(x',y') \\right)^2 \\cdot \\sum_{x',y'} \\left( I(x+x',y+y') \\cdot\n                                  M(x',y') \\right)^2}}\\f] */\n    TM_CCORR         = 2, /*!< \\f[R(x,y)= \\sum _{x',y'} (T(x',y') \\cdot I(x+x',y+y'))\\f]\n                               with mask:\n                               \\f[R(x,y)= \\sum _{x',y'} (T(x',y') \\cdot I(x+x',y+y') \\cdot M(x',y')\n                                  ^2)\\f] */\n    TM_CCORR_NORMED  = 3, /*!< \\f[R(x,y)= \\frac{\\sum_{x',y'} (T(x',y') \\cdot I(x+x',y+y'))}{\\sqrt{\n                                  \\sum_{x',y'}T(x',y')^2 \\cdot \\sum_{x',y'} I(x+x',y+y')^2}}\\f]\n                               with mask:\n                               \\f[R(x,y)= \\frac{\\sum_{x',y'} (T(x',y') \\cdot I(x+x',y+y') \\cdot\n                                  M(x',y')^2)}{\\sqrt{\\sum_{x',y'} \\left( T(x',y') \\cdot M(x',y')\n                                  \\right)^2 \\cdot \\sum_{x',y'} \\left( I(x+x',y+y') \\cdot M(x',y')\n                                  \\right)^2}}\\f] */\n    TM_CCOEFF        = 4, /*!< \\f[R(x,y)= \\sum _{x',y'} (T'(x',y') \\cdot I'(x+x',y+y'))\\f]\n                               where\n                               \\f[\\begin{array}{l} T'(x',y')=T(x',y') - 1/(w \\cdot h) \\cdot \\sum _{\n                                  x'',y''} T(x'',y'') \\\\ I'(x+x',y+y')=I(x+x',y+y') - 1/(w \\cdot h)\n                                  \\cdot \\sum _{x'',y''} I(x+x'',y+y'') \\end{array}\\f]\n                               with mask:\n                               \\f[\\begin{array}{l} T'(x',y')=M(x',y') \\cdot \\left( T(x',y') -\n                                  \\frac{1}{\\sum _{x'',y''} M(x'',y'')} \\cdot \\sum _{x'',y''}\n                                  (T(x'',y'') \\cdot M(x'',y'')) \\right) \\\\ I'(x+x',y+y')=M(x',y')\n                                  \\cdot \\left( I(x+x',y+y') - \\frac{1}{\\sum _{x'',y''} M(x'',y'')}\n                                  \\cdot \\sum _{x'',y''} (I(x+x'',y+y'') \\cdot M(x'',y'')) \\right)\n                                  \\end{array} \\f] */\n    TM_CCOEFF_NORMED = 5  /*!< \\f[R(x,y)= \\frac{ \\sum_{x',y'} (T'(x',y') \\cdot I'(x+x',y+y')) }{\n                                  \\sqrt{\\sum_{x',y'}T'(x',y')^2 \\cdot \\sum_{x',y'} I'(x+x',y+y')^2}\n                                  }\\f] */\n};\n\n/** @example samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp\nAn example using Template Matching algorithm\n*/\n\n/** @brief Compares a template against overlapped image regions.\n\nThe function slides through image , compares the overlapped patches of size \\f$w \\times h\\f$ against\ntempl using the specified method and stores the comparison results in result . #TemplateMatchModes\ndescribes the formulae for the available comparison methods ( \\f$I\\f$ denotes image, \\f$T\\f$\ntemplate, \\f$R\\f$ result, \\f$M\\f$ the optional mask ). The summation is done over template and/or\nthe image patch: \\f$x' = 0...w-1, y' = 0...h-1\\f$\n\nAfter the function finishes the comparison, the best matches can be found as global minimums (when\n#TM_SQDIFF was used) or maximums (when #TM_CCORR or #TM_CCOEFF was used) using the\n#minMaxLoc function. In case of a color image, template summation in the numerator and each sum in\nthe denominator is done over all of the channels and separate mean values are used for each channel.\nThat is, the function can take a color template and a color image. The result will still be a\nsingle-channel image, which is easier to analyze.\n\n@param image Image where the search is running. It must be 8-bit or 32-bit floating-point.\n@param templ Searched template. It must be not greater than the source image and have the same\ndata type.\n@param result Map of comparison results. It must be single-channel 32-bit floating-point. If image\nis \\f$W \\times H\\f$ and templ is \\f$w \\times h\\f$ , then result is \\f$(W-w+1) \\times (H-h+1)\\f$ .\n@param method Parameter specifying the comparison method, see #TemplateMatchModes\n@param mask Optional mask. It must have the same size as templ. It must either have the same number\n            of channels as template or only one channel, which is then used for all template and\n            image channels. If the data type is #CV_8U, the mask is interpreted as a binary mask,\n            meaning only elements where mask is nonzero are used and are kept unchanged independent\n            of the actual mask value (weight equals 1). For data tpye #CV_32F, the mask values are\n            used as weights. The exact formulas are documented in #TemplateMatchModes.\n */\nCV_EXPORTS_W void matchTemplate( InputArray image, InputArray templ,\n                                 OutputArray result, int method, InputArray mask = noArray() );\n\n//! @}\n\n//! @addtogroup imgproc_shape\n//! @{\n\n/** @example samples/cpp/connected_components.cpp\nThis program demonstrates connected components and use of the trackbar\n*/\n\n/** @brief computes the connected components labeled image of boolean image\n\nimage with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0\nrepresents the background label. ltype specifies the output label image type, an important\nconsideration based on the total number of labels or alternatively the total number of pixels in\nthe source image. ccltype specifies the connected components labeling algorithm to use, currently\nGrana (BBDT) and Wu's (SAUF) @cite Wu2009 algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes\nfor details. Note that SAUF algorithm forces a row major ordering of labels while BBDT does not.\nThis function uses parallel version of both Grana and Wu's algorithms if at least one allowed\nparallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs.\n\n@param image the 8-bit single-channel image to be labeled\n@param labels destination labeled image\n@param connectivity 8 or 4 for 8-way or 4-way connectivity respectively\n@param ltype output image label type. Currently CV_32S and CV_16U are supported.\n@param ccltype connected components algorithm type (see the #ConnectedComponentsAlgorithmsTypes).\n*/\nCV_EXPORTS_AS(connectedComponentsWithAlgorithm) int connectedComponents(InputArray image, OutputArray labels,\n                                                                        int connectivity, int ltype, int ccltype);\n\n\n/** @overload\n\n@param image the 8-bit single-channel image to be labeled\n@param labels destination labeled image\n@param connectivity 8 or 4 for 8-way or 4-way connectivity respectively\n@param ltype output image label type. Currently CV_32S and CV_16U are supported.\n*/\nCV_EXPORTS_W int connectedComponents(InputArray image, OutputArray labels,\n                                     int connectivity = 8, int ltype = CV_32S);\n\n\n/** @brief computes the connected components labeled image of boolean image and also produces a statistics output for each label\n\nimage with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0\nrepresents the background label. ltype specifies the output label image type, an important\nconsideration based on the total number of labels or alternatively the total number of pixels in\nthe source image. ccltype specifies the connected components labeling algorithm to use, currently\nGrana's (BBDT) and Wu's (SAUF) @cite Wu2009 algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes\nfor details. Note that SAUF algorithm forces a row major ordering of labels while BBDT does not.\nThis function uses parallel version of both Grana and Wu's algorithms (statistics included) if at least one allowed\nparallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs.\n\n@param image the 8-bit single-channel image to be labeled\n@param labels destination labeled image\n@param stats statistics output for each label, including the background label.\nStatistics are accessed via stats(label, COLUMN) where COLUMN is one of\n#ConnectedComponentsTypes, selecting the statistic. The data type is CV_32S.\n@param centroids centroid output for each label, including the background label. Centroids are\naccessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F.\n@param connectivity 8 or 4 for 8-way or 4-way connectivity respectively\n@param ltype output image label type. Currently CV_32S and CV_16U are supported.\n@param ccltype connected components algorithm type (see #ConnectedComponentsAlgorithmsTypes).\n*/\nCV_EXPORTS_AS(connectedComponentsWithStatsWithAlgorithm) int connectedComponentsWithStats(InputArray image, OutputArray labels,\n                                                                                          OutputArray stats, OutputArray centroids,\n                                                                                          int connectivity, int ltype, int ccltype);\n\n/** @overload\n@param image the 8-bit single-channel image to be labeled\n@param labels destination labeled image\n@param stats statistics output for each label, including the background label.\nStatistics are accessed via stats(label, COLUMN) where COLUMN is one of\n#ConnectedComponentsTypes, selecting the statistic. The data type is CV_32S.\n@param centroids centroid output for each label, including the background label. Centroids are\naccessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F.\n@param connectivity 8 or 4 for 8-way or 4-way connectivity respectively\n@param ltype output image label type. Currently CV_32S and CV_16U are supported.\n*/\nCV_EXPORTS_W int connectedComponentsWithStats(InputArray image, OutputArray labels,\n                                              OutputArray stats, OutputArray centroids,\n                                              int connectivity = 8, int ltype = CV_32S);\n\n\n/** @brief Finds contours in a binary image.\n\nThe function retrieves contours from the binary image using the algorithm @cite Suzuki85 . The contours\nare a useful tool for shape analysis and object detection and recognition. See squares.cpp in the\nOpenCV sample directory.\n@note Since opencv 3.2 source image is not modified by this function.\n\n@param image Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero\npixels remain 0's, so the image is treated as binary . You can use #compare, #inRange, #threshold ,\n#adaptiveThreshold, #Canny, and others to create a binary image out of a grayscale or color one.\nIf mode equals to #RETR_CCOMP or #RETR_FLOODFILL, the input can also be a 32-bit integer image of labels (CV_32SC1).\n@param contours Detected contours. Each contour is stored as a vector of points (e.g.\nstd::vector<std::vector<cv::Point> >).\n@param hierarchy Optional output vector (e.g. std::vector<cv::Vec4i>), containing information about the image topology. It has\nas many elements as the number of contours. For each i-th contour contours[i], the elements\nhierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , and hierarchy[i][3] are set to 0-based indices\nin contours of the next and previous contours at the same hierarchical level, the first child\ncontour and the parent contour, respectively. If for the contour i there are no next, previous,\nparent, or nested contours, the corresponding elements of hierarchy[i] will be negative.\n@param mode Contour retrieval mode, see #RetrievalModes\n@param method Contour approximation method, see #ContourApproximationModes\n@param offset Optional offset by which every contour point is shifted. This is useful if the\ncontours are extracted from the image ROI and then they should be analyzed in the whole image\ncontext.\n */\nCV_EXPORTS_W void findContours( InputArray image, OutputArrayOfArrays contours,\n                              OutputArray hierarchy, int mode,\n                              int method, Point offset = Point());\n\n/** @overload */\nCV_EXPORTS void findContours( InputArray image, OutputArrayOfArrays contours,\n                              int mode, int method, Point offset = Point());\n\n/** @example samples/cpp/squares.cpp\nA program using pyramid scaling, Canny, contours and contour simplification to find\nsquares in a list of images (pic1-6.png). Returns sequence of squares detected on the image.\n*/\n\n/** @example samples/tapi/squares.cpp\nA program using pyramid scaling, Canny, contours and contour simplification to find\nsquares in the input image.\n*/\n\n/** @brief Approximates a polygonal curve(s) with the specified precision.\n\nThe function cv::approxPolyDP approximates a curve or a polygon with another curve/polygon with less\nvertices so that the distance between them is less or equal to the specified precision. It uses the\nDouglas-Peucker algorithm <http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm>\n\n@param curve Input vector of a 2D point stored in std::vector or Mat\n@param approxCurve Result of the approximation. The type should match the type of the input curve.\n@param epsilon Parameter specifying the approximation accuracy. This is the maximum distance\nbetween the original curve and its approximation.\n@param closed If true, the approximated curve is closed (its first and last vertices are\nconnected). Otherwise, it is not closed.\n */\nCV_EXPORTS_W void approxPolyDP( InputArray curve,\n                                OutputArray approxCurve,\n                                double epsilon, bool closed );\n\n/** @brief Calculates a contour perimeter or a curve length.\n\nThe function computes a curve length or a closed contour perimeter.\n\n@param curve Input vector of 2D points, stored in std::vector or Mat.\n@param closed Flag indicating whether the curve is closed or not.\n */\nCV_EXPORTS_W double arcLength( InputArray curve, bool closed );\n\n/** @brief Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image.\n\nThe function calculates and returns the minimal up-right bounding rectangle for the specified point set or\nnon-zero pixels of gray-scale image.\n\n@param array Input gray-scale image or 2D point set, stored in std::vector or Mat.\n */\nCV_EXPORTS_W Rect boundingRect( InputArray array );\n\n/** @brief Calculates a contour area.\n\nThe function computes a contour area. Similarly to moments , the area is computed using the Green\nformula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using\n#drawContours or #fillPoly , can be different. Also, the function will most certainly give a wrong\nresults for contours with self-intersections.\n\nExample:\n@code\n    vector<Point> contour;\n    contour.push_back(Point2f(0, 0));\n    contour.push_back(Point2f(10, 0));\n    contour.push_back(Point2f(10, 10));\n    contour.push_back(Point2f(5, 4));\n\n    double area0 = contourArea(contour);\n    vector<Point> approx;\n    approxPolyDP(contour, approx, 5, true);\n    double area1 = contourArea(approx);\n\n    cout << \"area0 =\" << area0 << endl <<\n            \"area1 =\" << area1 << endl <<\n            \"approx poly vertices\" << approx.size() << endl;\n@endcode\n@param contour Input vector of 2D points (contour vertices), stored in std::vector or Mat.\n@param oriented Oriented area flag. If it is true, the function returns a signed area value,\ndepending on the contour orientation (clockwise or counter-clockwise). Using this feature you can\ndetermine orientation of a contour by taking the sign of an area. By default, the parameter is\nfalse, which means that the absolute value is returned.\n */\nCV_EXPORTS_W double contourArea( InputArray contour, bool oriented = false );\n\n/** @brief Finds a rotated rectangle of the minimum area enclosing the input 2D point set.\n\nThe function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a\nspecified point set. Developer should keep in mind that the returned RotatedRect can contain negative\nindices when data is close to the containing Mat element boundary.\n\n@param points Input vector of 2D points, stored in std::vector\\<\\> or Mat\n */\nCV_EXPORTS_W RotatedRect minAreaRect( InputArray points );\n\n/** @brief Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.\n\nThe function finds the four vertices of a rotated rectangle. This function is useful to draw the\nrectangle. In C++, instead of using this function, you can directly use RotatedRect::points method. Please\nvisit the @ref tutorial_bounding_rotated_ellipses \"tutorial on Creating Bounding rotated boxes and ellipses for contours\" for more information.\n\n@param box The input rotated rectangle. It may be the output of\n@param points The output array of four vertices of rectangles.\n */\nCV_EXPORTS_W void boxPoints(RotatedRect box, OutputArray points);\n\n/** @brief Finds a circle of the minimum area enclosing a 2D point set.\n\nThe function finds the minimal enclosing circle of a 2D point set using an iterative algorithm.\n\n@param points Input vector of 2D points, stored in std::vector\\<\\> or Mat\n@param center Output center of the circle.\n@param radius Output radius of the circle.\n */\nCV_EXPORTS_W void minEnclosingCircle( InputArray points,\n                                      CV_OUT Point2f& center, CV_OUT float& radius );\n\n/** @example samples/cpp/minarea.cpp\n*/\n\n/** @brief Finds a triangle of minimum area enclosing a 2D point set and returns its area.\n\nThe function finds a triangle of minimum area enclosing the given set of 2D points and returns its\narea. The output for a given 2D point set is shown in the image below. 2D points are depicted in\n*red* and the enclosing triangle in *yellow*.\n\n![Sample output of the minimum enclosing triangle function](pics/minenclosingtriangle.png)\n\nThe implementation of the algorithm is based on O'Rourke's @cite ORourke86 and Klee and Laskowski's\n@cite KleeLaskowski85 papers. O'Rourke provides a \\f$\\theta(n)\\f$ algorithm for finding the minimal\nenclosing triangle of a 2D convex polygon with n vertices. Since the #minEnclosingTriangle function\ntakes a 2D point set as input an additional preprocessing step of computing the convex hull of the\n2D point set is required. The complexity of the #convexHull function is \\f$O(n log(n))\\f$ which is higher\nthan \\f$\\theta(n)\\f$. Thus the overall complexity of the function is \\f$O(n log(n))\\f$.\n\n@param points Input vector of 2D points with depth CV_32S or CV_32F, stored in std::vector\\<\\> or Mat\n@param triangle Output vector of three 2D points defining the vertices of the triangle. The depth\nof the OutputArray must be CV_32F.\n */\nCV_EXPORTS_W double minEnclosingTriangle( InputArray points, CV_OUT OutputArray triangle );\n\n/** @brief Compares two shapes.\n\nThe function compares two shapes. All three implemented methods use the Hu invariants (see #HuMoments)\n\n@param contour1 First contour or grayscale image.\n@param contour2 Second contour or grayscale image.\n@param method Comparison method, see #ShapeMatchModes\n@param parameter Method-specific parameter (not supported now).\n */\nCV_EXPORTS_W double matchShapes( InputArray contour1, InputArray contour2,\n                                 int method, double parameter );\n\n/** @example samples/cpp/convexhull.cpp\nAn example using the convexHull functionality\n*/\n\n/** @brief Finds the convex hull of a point set.\n\nThe function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm @cite Sklansky82\nthat has *O(N logN)* complexity in the current implementation.\n\n@param points Input 2D point set, stored in std::vector or Mat.\n@param hull Output convex hull. It is either an integer vector of indices or vector of points. In\nthe first case, the hull elements are 0-based indices of the convex hull points in the original\narray (since the set of convex hull points is a subset of the original point set). In the second\ncase, hull elements are the convex hull points themselves.\n@param clockwise Orientation flag. If it is true, the output convex hull is oriented clockwise.\nOtherwise, it is oriented counter-clockwise. The assumed coordinate system has its X axis pointing\nto the right, and its Y axis pointing upwards.\n@param returnPoints Operation flag. In case of a matrix, when the flag is true, the function\nreturns convex hull points. Otherwise, it returns indices of the convex hull points. When the\noutput array is std::vector, the flag is ignored, and the output depends on the type of the\nvector: std::vector\\<int\\> implies returnPoints=false, std::vector\\<Point\\> implies\nreturnPoints=true.\n\n@note `points` and `hull` should be different arrays, inplace processing isn't supported.\n\nCheck @ref tutorial_hull \"the corresponding tutorial\" for more details.\n\nuseful links:\n\nhttps://www.learnopencv.com/convex-hull-using-opencv-in-python-and-c/\n */\nCV_EXPORTS_W void convexHull( InputArray points, OutputArray hull,\n                              bool clockwise = false, bool returnPoints = true );\n\n/** @brief Finds the convexity defects of a contour.\n\nThe figure below displays convexity defects of a hand contour:\n\n![image](pics/defects.png)\n\n@param contour Input contour.\n@param convexhull Convex hull obtained using convexHull that should contain indices of the contour\npoints that make the hull.\n@param convexityDefects The output vector of convexity defects. In C++ and the new Python/Java\ninterface each convexity defect is represented as 4-element integer vector (a.k.a. #Vec4i):\n(start_index, end_index, farthest_pt_index, fixpt_depth), where indices are 0-based indices\nin the original contour of the convexity defect beginning, end and the farthest point, and\nfixpt_depth is fixed-point approximation (with 8 fractional bits) of the distance between the\nfarthest contour point and the hull. That is, to get the floating-point value of the depth will be\nfixpt_depth/256.0.\n */\nCV_EXPORTS_W void convexityDefects( InputArray contour, InputArray convexhull, OutputArray convexityDefects );\n\n/** @brief Tests a contour convexity.\n\nThe function tests whether the input contour is convex or not. The contour must be simple, that is,\nwithout self-intersections. Otherwise, the function output is undefined.\n\n@param contour Input vector of 2D points, stored in std::vector\\<\\> or Mat\n */\nCV_EXPORTS_W bool isContourConvex( InputArray contour );\n\n/** @example samples/cpp/intersectExample.cpp\nExamples of how intersectConvexConvex works\n*/\n\n/** @brief Finds intersection of two convex polygons\n\n@param p1 First polygon\n@param p2 Second polygon\n@param p12 Output polygon describing the intersecting area\n@param handleNested When true, an intersection is found if one of the polygons is fully enclosed in the other.\nWhen false, no intersection is found. If the polygons share a side or the vertex of one polygon lies on an edge\nof the other, they are not considered nested and an intersection will be found regardless of the value of handleNested.\n\n@returns Absolute value of area of intersecting polygon\n\n@note intersectConvexConvex doesn't confirm that both polygons are convex and will return invalid results if they aren't.\n */\nCV_EXPORTS_W float intersectConvexConvex( InputArray p1, InputArray p2,\n                                          OutputArray p12, bool handleNested = true );\n\n/** @example samples/cpp/fitellipse.cpp\nAn example using the fitEllipse technique\n*/\n\n/** @brief Fits an ellipse around a set of 2D points.\n\nThe function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of\nall. It returns the rotated rectangle in which the ellipse is inscribed. The first algorithm described by @cite Fitzgibbon95\nis used. Developer should keep in mind that it is possible that the returned\nellipse/rotatedRect data contains negative indices, due to the data points being close to the\nborder of the containing Mat element.\n\n@param points Input 2D point set, stored in std::vector\\<\\> or Mat\n */\nCV_EXPORTS_W RotatedRect fitEllipse( InputArray points );\n\n/** @brief Fits an ellipse around a set of 2D points.\n\n The function calculates the ellipse that fits a set of 2D points.\n It returns the rotated rectangle in which the ellipse is inscribed.\n The Approximate Mean Square (AMS) proposed by @cite Taubin1991 is used.\n\n For an ellipse, this basis set is \\f$ \\chi= \\left(x^2, x y, y^2, x, y, 1\\right) \\f$,\n which is a set of six free coefficients \\f$ A^T=\\left\\{A_{\\text{xx}},A_{\\text{xy}},A_{\\text{yy}},A_x,A_y,A_0\\right\\} \\f$.\n However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths \\f$ (a,b) \\f$,\n the position \\f$ (x_0,y_0) \\f$, and the orientation \\f$ \\theta \\f$. This is because the basis set includes lines,\n quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits.\n If the fit is found to be a parabolic or hyperbolic function then the standard #fitEllipse method is used.\n The AMS method restricts the fit to parabolic, hyperbolic and elliptical curves\n by imposing the condition that \\f$ A^T ( D_x^T D_x  +   D_y^T D_y) A = 1 \\f$ where\n the matrices \\f$ Dx \\f$ and \\f$ Dy \\f$ are the partial derivatives of the design matrix \\f$ D \\f$ with\n respect to x and y. The matrices are formed row by row applying the following to\n each of the points in the set:\n \\f{align*}{\n D(i,:)&=\\left\\{x_i^2, x_i y_i, y_i^2, x_i, y_i, 1\\right\\} &\n D_x(i,:)&=\\left\\{2 x_i,y_i,0,1,0,0\\right\\} &\n D_y(i,:)&=\\left\\{0,x_i,2 y_i,0,1,0\\right\\}\n \\f}\n The AMS method minimizes the cost function\n \\f{equation*}{\n \\epsilon ^2=\\frac{ A^T D^T D A }{ A^T (D_x^T D_x +  D_y^T D_y) A^T }\n \\f}\n\n The minimum cost is found by solving the generalized eigenvalue problem.\n\n \\f{equation*}{\n D^T D A = \\lambda  \\left( D_x^T D_x +  D_y^T D_y\\right) A\n \\f}\n\n @param points Input 2D point set, stored in std::vector\\<\\> or Mat\n */\nCV_EXPORTS_W RotatedRect fitEllipseAMS( InputArray points );\n\n\n/** @brief Fits an ellipse around a set of 2D points.\n\n The function calculates the ellipse that fits a set of 2D points.\n It returns the rotated rectangle in which the ellipse is inscribed.\n The Direct least square (Direct) method by @cite Fitzgibbon1999 is used.\n\n For an ellipse, this basis set is \\f$ \\chi= \\left(x^2, x y, y^2, x, y, 1\\right) \\f$,\n which is a set of six free coefficients \\f$ A^T=\\left\\{A_{\\text{xx}},A_{\\text{xy}},A_{\\text{yy}},A_x,A_y,A_0\\right\\} \\f$.\n However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths \\f$ (a,b) \\f$,\n the position \\f$ (x_0,y_0) \\f$, and the orientation \\f$ \\theta \\f$. This is because the basis set includes lines,\n quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits.\n The Direct method confines the fit to ellipses by ensuring that \\f$ 4 A_{xx} A_{yy}- A_{xy}^2 > 0 \\f$.\n The condition imposed is that \\f$ 4 A_{xx} A_{yy}- A_{xy}^2=1 \\f$ which satisfies the inequality\n and as the coefficients can be arbitrarily scaled is not overly restrictive.\n\n \\f{equation*}{\n \\epsilon ^2= A^T D^T D A \\quad \\text{with} \\quad A^T C A =1 \\quad \\text{and} \\quad C=\\left(\\begin{matrix}\n 0 & 0  & 2  & 0  & 0  &  0  \\\\\n 0 & -1  & 0  & 0  & 0  &  0 \\\\\n 2 & 0  & 0  & 0  & 0  &  0 \\\\\n 0 & 0  & 0  & 0  & 0  &  0 \\\\\n 0 & 0  & 0  & 0  & 0  &  0 \\\\\n 0 & 0  & 0  & 0  & 0  &  0\n \\end{matrix} \\right)\n \\f}\n\n The minimum cost is found by solving the generalized eigenvalue problem.\n\n \\f{equation*}{\n D^T D A = \\lambda  \\left( C\\right) A\n \\f}\n\n The system produces only one positive eigenvalue \\f$ \\lambda\\f$ which is chosen as the solution\n with its eigenvector \\f$\\mathbf{u}\\f$. These are used to find the coefficients\n\n \\f{equation*}{\n A = \\sqrt{\\frac{1}{\\mathbf{u}^T C \\mathbf{u}}}  \\mathbf{u}\n \\f}\n The scaling factor guarantees that  \\f$A^T C A =1\\f$.\n\n @param points Input 2D point set, stored in std::vector\\<\\> or Mat\n */\nCV_EXPORTS_W RotatedRect fitEllipseDirect( InputArray points );\n\n/** @brief Fits a line to a 2D or 3D point set.\n\nThe function fitLine fits a line to a 2D or 3D point set by minimizing \\f$\\sum_i \\rho(r_i)\\f$ where\n\\f$r_i\\f$ is a distance between the \\f$i^{th}\\f$ point, the line and \\f$\\rho(r)\\f$ is a distance function, one\nof the following:\n-  DIST_L2\n\\f[\\rho (r) = r^2/2  \\quad \\text{(the simplest and the fastest least-squares method)}\\f]\n- DIST_L1\n\\f[\\rho (r) = r\\f]\n- DIST_L12\n\\f[\\rho (r) = 2  \\cdot ( \\sqrt{1 + \\frac{r^2}{2}} - 1)\\f]\n- DIST_FAIR\n\\f[\\rho \\left (r \\right ) = C^2  \\cdot \\left (  \\frac{r}{C} -  \\log{\\left(1 + \\frac{r}{C}\\right)} \\right )  \\quad \\text{where} \\quad C=1.3998\\f]\n- DIST_WELSCH\n\\f[\\rho \\left (r \\right ) =  \\frac{C^2}{2} \\cdot \\left ( 1 -  \\exp{\\left(-\\left(\\frac{r}{C}\\right)^2\\right)} \\right )  \\quad \\text{where} \\quad C=2.9846\\f]\n- DIST_HUBER\n\\f[\\rho (r) =  \\fork{r^2/2}{if \\(r < C\\)}{C \\cdot (r-C/2)}{otherwise} \\quad \\text{where} \\quad C=1.345\\f]\n\nThe algorithm is based on the M-estimator ( <http://en.wikipedia.org/wiki/M-estimator> ) technique\nthat iteratively fits the line using the weighted least-squares algorithm. After each iteration the\nweights \\f$w_i\\f$ are adjusted to be inversely proportional to \\f$\\rho(r_i)\\f$ .\n\n@param points Input vector of 2D or 3D points, stored in std::vector\\<\\> or Mat.\n@param line Output line parameters. In case of 2D fitting, it should be a vector of 4 elements\n(like Vec4f) - (vx, vy, x0, y0), where (vx, vy) is a normalized vector collinear to the line and\n(x0, y0) is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like\nVec6f) - (vx, vy, vz, x0, y0, z0), where (vx, vy, vz) is a normalized vector collinear to the line\nand (x0, y0, z0) is a point on the line.\n@param distType Distance used by the M-estimator, see #DistanceTypes\n@param param Numerical parameter ( C ) for some types of distances. If it is 0, an optimal value\nis chosen.\n@param reps Sufficient accuracy for the radius (distance between the coordinate origin and the line).\n@param aeps Sufficient accuracy for the angle. 0.01 would be a good default value for reps and aeps.\n */\nCV_EXPORTS_W void fitLine( InputArray points, OutputArray line, int distType,\n                           double param, double reps, double aeps );\n\n/** @brief Performs a point-in-contour test.\n\nThe function determines whether the point is inside a contour, outside, or lies on an edge (or\ncoincides with a vertex). It returns positive (inside), negative (outside), or zero (on an edge)\nvalue, correspondingly. When measureDist=false , the return value is +1, -1, and 0, respectively.\nOtherwise, the return value is a signed distance between the point and the nearest contour edge.\n\nSee below a sample output of the function where each image pixel is tested against the contour:\n\n![sample output](pics/pointpolygon.png)\n\n@param contour Input contour.\n@param pt Point tested against the contour.\n@param measureDist If true, the function estimates the signed distance from the point to the\nnearest contour edge. Otherwise, the function only checks if the point is inside a contour or not.\n */\nCV_EXPORTS_W double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist );\n\n/** @brief Finds out if there is any intersection between two rotated rectangles.\n\nIf there is then the vertices of the intersecting region are returned as well.\n\nBelow are some examples of intersection configurations. The hatched pattern indicates the\nintersecting region and the red vertices are returned by the function.\n\n![intersection examples](pics/intersection.png)\n\n@param rect1 First rectangle\n@param rect2 Second rectangle\n@param intersectingRegion The output array of the vertices of the intersecting region. It returns\nat most 8 vertices. Stored as std::vector\\<cv::Point2f\\> or cv::Mat as Mx1 of type CV_32FC2.\n@returns One of #RectanglesIntersectTypes\n */\nCV_EXPORTS_W int rotatedRectangleIntersection( const RotatedRect& rect1, const RotatedRect& rect2, OutputArray intersectingRegion  );\n\n/** @brief Creates a smart pointer to a cv::GeneralizedHoughBallard class and initializes it.\n*/\nCV_EXPORTS_W Ptr<GeneralizedHoughBallard> createGeneralizedHoughBallard();\n\n/** @brief Creates a smart pointer to a cv::GeneralizedHoughGuil class and initializes it.\n*/\nCV_EXPORTS_W Ptr<GeneralizedHoughGuil> createGeneralizedHoughGuil();\n\n//! @} imgproc_shape\n\n//! @addtogroup imgproc_colormap\n//! @{\n\n//! GNU Octave/MATLAB equivalent colormaps\nenum ColormapTypes\n{\n    COLORMAP_AUTUMN = 0, //!< ![autumn](pics/colormaps/colorscale_autumn.jpg)\n    COLORMAP_BONE = 1, //!< ![bone](pics/colormaps/colorscale_bone.jpg)\n    COLORMAP_JET = 2, //!< ![jet](pics/colormaps/colorscale_jet.jpg)\n    COLORMAP_WINTER = 3, //!< ![winter](pics/colormaps/colorscale_winter.jpg)\n    COLORMAP_RAINBOW = 4, //!< ![rainbow](pics/colormaps/colorscale_rainbow.jpg)\n    COLORMAP_OCEAN = 5, //!< ![ocean](pics/colormaps/colorscale_ocean.jpg)\n    COLORMAP_SUMMER = 6, //!< ![summer](pics/colormaps/colorscale_summer.jpg)\n    COLORMAP_SPRING = 7, //!< ![spring](pics/colormaps/colorscale_spring.jpg)\n    COLORMAP_COOL = 8, //!< ![cool](pics/colormaps/colorscale_cool.jpg)\n    COLORMAP_HSV = 9, //!< ![HSV](pics/colormaps/colorscale_hsv.jpg)\n    COLORMAP_PINK = 10, //!< ![pink](pics/colormaps/colorscale_pink.jpg)\n    COLORMAP_HOT = 11, //!< ![hot](pics/colormaps/colorscale_hot.jpg)\n    COLORMAP_PARULA = 12, //!< ![parula](pics/colormaps/colorscale_parula.jpg)\n    COLORMAP_MAGMA = 13, //!< ![magma](pics/colormaps/colorscale_magma.jpg)\n    COLORMAP_INFERNO = 14, //!< ![inferno](pics/colormaps/colorscale_inferno.jpg)\n    COLORMAP_PLASMA = 15, //!< ![plasma](pics/colormaps/colorscale_plasma.jpg)\n    COLORMAP_VIRIDIS = 16, //!< ![viridis](pics/colormaps/colorscale_viridis.jpg)\n    COLORMAP_CIVIDIS = 17, //!< ![cividis](pics/colormaps/colorscale_cividis.jpg)\n    COLORMAP_TWILIGHT = 18, //!< ![twilight](pics/colormaps/colorscale_twilight.jpg)\n    COLORMAP_TWILIGHT_SHIFTED = 19, //!< ![twilight shifted](pics/colormaps/colorscale_twilight_shifted.jpg)\n    COLORMAP_TURBO = 20, //!< ![turbo](pics/colormaps/colorscale_turbo.jpg)\n    COLORMAP_DEEPGREEN = 21  //!< ![deepgreen](pics/colormaps/colorscale_deepgreen.jpg)\n};\n\n/** @example samples/cpp/falsecolor.cpp\nAn example using applyColorMap function\n*/\n\n/** @brief Applies a GNU Octave/MATLAB equivalent colormap on a given image.\n\n@param src The source image, grayscale or colored of type CV_8UC1 or CV_8UC3.\n@param dst The result is the colormapped source image. Note: Mat::create is called on dst.\n@param colormap The colormap to apply, see #ColormapTypes\n*/\nCV_EXPORTS_W void applyColorMap(InputArray src, OutputArray dst, int colormap);\n\n/** @brief Applies a user colormap on a given image.\n\n@param src The source image, grayscale or colored of type CV_8UC1 or CV_8UC3.\n@param dst The result is the colormapped source image. Note: Mat::create is called on dst.\n@param userColor The colormap to apply of type CV_8UC1 or CV_8UC3 and size 256\n*/\nCV_EXPORTS_W void applyColorMap(InputArray src, OutputArray dst, InputArray userColor);\n\n//! @} imgproc_colormap\n\n//! @addtogroup imgproc_draw\n//! @{\n\n\n/** OpenCV color channel order is BGR[A] */\n#define CV_RGB(r, g, b)  cv::Scalar((b), (g), (r), 0)\n\n/** @brief Draws a line segment connecting two points.\n\nThe function line draws the line segment between pt1 and pt2 points in the image. The line is\nclipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected\nor 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased\nlines are drawn using Gaussian filtering.\n\n@param img Image.\n@param pt1 First point of the line segment.\n@param pt2 Second point of the line segment.\n@param color Line color.\n@param thickness Line thickness.\n@param lineType Type of the line. See #LineTypes.\n@param shift Number of fractional bits in the point coordinates.\n */\nCV_EXPORTS_W void line(InputOutputArray img, Point pt1, Point pt2, const Scalar& color,\n                     int thickness = 1, int lineType = LINE_8, int shift = 0);\n\n/** @brief Draws a arrow segment pointing from the first point to the second one.\n\nThe function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.\n\n@param img Image.\n@param pt1 The point the arrow starts from.\n@param pt2 The point the arrow points to.\n@param color Line color.\n@param thickness Line thickness.\n@param line_type Type of the line. See #LineTypes\n@param shift Number of fractional bits in the point coordinates.\n@param tipLength The length of the arrow tip in relation to the arrow length\n */\nCV_EXPORTS_W void arrowedLine(InputOutputArray img, Point pt1, Point pt2, const Scalar& color,\n                     int thickness=1, int line_type=8, int shift=0, double tipLength=0.1);\n\n/** @brief Draws a simple, thick, or filled up-right rectangle.\n\nThe function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners\nare pt1 and pt2.\n\n@param img Image.\n@param pt1 Vertex of the rectangle.\n@param pt2 Vertex of the rectangle opposite to pt1 .\n@param color Rectangle color or brightness (grayscale image).\n@param thickness Thickness of lines that make up the rectangle. Negative values, like #FILLED,\nmean that the function has to draw a filled rectangle.\n@param lineType Type of the line. See #LineTypes\n@param shift Number of fractional bits in the point coordinates.\n */\nCV_EXPORTS_W void rectangle(InputOutputArray img, Point pt1, Point pt2,\n                          const Scalar& color, int thickness = 1,\n                          int lineType = LINE_8, int shift = 0);\n\n/** @overload\n\nuse `rec` parameter as alternative specification of the drawn rectangle: `r.tl() and\nr.br()-Point(1,1)` are opposite corners\n*/\nCV_EXPORTS_W void rectangle(InputOutputArray img, Rect rec,\n                          const Scalar& color, int thickness = 1,\n                          int lineType = LINE_8, int shift = 0);\n\n/** @example samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_2.cpp\nAn example using drawing functions\n*/\n\n/** @brief Draws a circle.\n\nThe function cv::circle draws a simple or filled circle with a given center and radius.\n@param img Image where the circle is drawn.\n@param center Center of the circle.\n@param radius Radius of the circle.\n@param color Circle color.\n@param thickness Thickness of the circle outline, if positive. Negative values, like #FILLED,\nmean that a filled circle is to be drawn.\n@param lineType Type of the circle boundary. See #LineTypes\n@param shift Number of fractional bits in the coordinates of the center and in the radius value.\n */\nCV_EXPORTS_W void circle(InputOutputArray img, Point center, int radius,\n                       const Scalar& color, int thickness = 1,\n                       int lineType = LINE_8, int shift = 0);\n\n/** @brief Draws a simple or thick elliptic arc or fills an ellipse sector.\n\nThe function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic\narc, or a filled ellipse sector. The drawing code uses general parametric form.\nA piecewise-linear curve is used to approximate the elliptic arc\nboundary. If you need more control of the ellipse rendering, you can retrieve the curve using\n#ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first\nvariant of the function and want to draw the whole ellipse, not an arc, pass `startAngle=0` and\n`endAngle=360`. If `startAngle` is greater than `endAngle`, they are swapped. The figure below explains\nthe meaning of the parameters to draw the blue arc.\n\n![Parameters of Elliptic Arc](pics/ellipse.svg)\n\n@param img Image.\n@param center Center of the ellipse.\n@param axes Half of the size of the ellipse main axes.\n@param angle Ellipse rotation angle in degrees.\n@param startAngle Starting angle of the elliptic arc in degrees.\n@param endAngle Ending angle of the elliptic arc in degrees.\n@param color Ellipse color.\n@param thickness Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that\na filled ellipse sector is to be drawn.\n@param lineType Type of the ellipse boundary. See #LineTypes\n@param shift Number of fractional bits in the coordinates of the center and values of axes.\n */\nCV_EXPORTS_W void ellipse(InputOutputArray img, Point center, Size axes,\n                        double angle, double startAngle, double endAngle,\n                        const Scalar& color, int thickness = 1,\n                        int lineType = LINE_8, int shift = 0);\n\n/** @overload\n@param img Image.\n@param box Alternative ellipse representation via RotatedRect. This means that the function draws\nan ellipse inscribed in the rotated rectangle.\n@param color Ellipse color.\n@param thickness Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that\na filled ellipse sector is to be drawn.\n@param lineType Type of the ellipse boundary. See #LineTypes\n*/\nCV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color,\n                        int thickness = 1, int lineType = LINE_8);\n\n/* ----------------------------------------------------------------------------------------- */\n/* ADDING A SET OF PREDEFINED MARKERS WHICH COULD BE USED TO HIGHLIGHT POSITIONS IN AN IMAGE */\n/* ----------------------------------------------------------------------------------------- */\n\n/** @brief Draws a marker on a predefined position in an image.\n\nThe function cv::drawMarker draws a marker on a given position in the image. For the moment several\nmarker types are supported, see #MarkerTypes for more information.\n\n@param img Image.\n@param position The point where the crosshair is positioned.\n@param color Line color.\n@param markerType The specific type of marker you want to use, see #MarkerTypes\n@param thickness Line thickness.\n@param line_type Type of the line, See #LineTypes\n@param markerSize The length of the marker axis [default = 20 pixels]\n */\nCV_EXPORTS_W void drawMarker(InputOutputArray img, Point position, const Scalar& color,\n                             int markerType = MARKER_CROSS, int markerSize=20, int thickness=1,\n                             int line_type=8);\n\n/* ----------------------------------------------------------------------------------------- */\n/* END OF MARKER SECTION */\n/* ----------------------------------------------------------------------------------------- */\n\n/** @overload */\nCV_EXPORTS void fillConvexPoly(InputOutputArray img, const Point* pts, int npts,\n                               const Scalar& color, int lineType = LINE_8,\n                               int shift = 0);\n\n/** @brief Fills a convex polygon.\n\nThe function cv::fillConvexPoly draws a filled convex polygon. This function is much faster than the\nfunction #fillPoly . It can fill not only convex polygons but any monotonic polygon without\nself-intersections, that is, a polygon whose contour intersects every horizontal line (scan line)\ntwice at the most (though, its top-most and/or the bottom edge could be horizontal).\n\n@param img Image.\n@param points Polygon vertices.\n@param color Polygon color.\n@param lineType Type of the polygon boundaries. See #LineTypes\n@param shift Number of fractional bits in the vertex coordinates.\n */\nCV_EXPORTS_W void fillConvexPoly(InputOutputArray img, InputArray points,\n                                 const Scalar& color, int lineType = LINE_8,\n                                 int shift = 0);\n\n/** @overload */\nCV_EXPORTS void fillPoly(InputOutputArray img, const Point** pts,\n                         const int* npts, int ncontours,\n                         const Scalar& color, int lineType = LINE_8, int shift = 0,\n                         Point offset = Point() );\n\n/** @example samples/cpp/tutorial_code/ImgProc/basic_drawing/Drawing_1.cpp\nAn example using drawing functions\nCheck @ref tutorial_random_generator_and_text \"the corresponding tutorial\" for more details\n*/\n\n/** @brief Fills the area bounded by one or more polygons.\n\nThe function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill\ncomplex areas, for example, areas with holes, contours with self-intersections (some of their\nparts), and so forth.\n\n@param img Image.\n@param pts Array of polygons where each polygon is represented as an array of points.\n@param color Polygon color.\n@param lineType Type of the polygon boundaries. See #LineTypes\n@param shift Number of fractional bits in the vertex coordinates.\n@param offset Optional offset of all points of the contours.\n */\nCV_EXPORTS_W void fillPoly(InputOutputArray img, InputArrayOfArrays pts,\n                           const Scalar& color, int lineType = LINE_8, int shift = 0,\n                           Point offset = Point() );\n\n/** @overload */\nCV_EXPORTS void polylines(InputOutputArray img, const Point* const* pts, const int* npts,\n                          int ncontours, bool isClosed, const Scalar& color,\n                          int thickness = 1, int lineType = LINE_8, int shift = 0 );\n\n/** @brief Draws several polygonal curves.\n\n@param img Image.\n@param pts Array of polygonal curves.\n@param isClosed Flag indicating whether the drawn polylines are closed or not. If they are closed,\nthe function draws a line from the last vertex of each curve to its first vertex.\n@param color Polyline color.\n@param thickness Thickness of the polyline edges.\n@param lineType Type of the line segments. See #LineTypes\n@param shift Number of fractional bits in the vertex coordinates.\n\nThe function cv::polylines draws one or more polygonal curves.\n */\nCV_EXPORTS_W void polylines(InputOutputArray img, InputArrayOfArrays pts,\n                            bool isClosed, const Scalar& color,\n                            int thickness = 1, int lineType = LINE_8, int shift = 0 );\n\n/** @example samples/cpp/contours2.cpp\nAn example program illustrates the use of cv::findContours and cv::drawContours\n\\image html WindowsQtContoursOutput.png \"Screenshot of the program\"\n*/\n\n/** @example samples/cpp/segment_objects.cpp\nAn example using drawContours to clean up a background segmentation result\n*/\n\n/** @brief Draws contours outlines or filled contours.\n\nThe function draws contour outlines in the image if \\f$\\texttt{thickness} \\ge 0\\f$ or fills the area\nbounded by the contours if \\f$\\texttt{thickness}<0\\f$ . The example below shows how to retrieve\nconnected components from the binary image and label them: :\n@include snippets/imgproc_drawContours.cpp\n\n@param image Destination image.\n@param contours All the input contours. Each contour is stored as a point vector.\n@param contourIdx Parameter indicating a contour to draw. If it is negative, all the contours are drawn.\n@param color Color of the contours.\n@param thickness Thickness of lines the contours are drawn with. If it is negative (for example,\nthickness=#FILLED ), the contour interiors are drawn.\n@param lineType Line connectivity. See #LineTypes\n@param hierarchy Optional information about hierarchy. It is only needed if you want to draw only\nsome of the contours (see maxLevel ).\n@param maxLevel Maximal level for drawn contours. If it is 0, only the specified contour is drawn.\nIf it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function\ndraws the contours, all the nested contours, all the nested-to-nested contours, and so on. This\nparameter is only taken into account when there is hierarchy available.\n@param offset Optional contour shift parameter. Shift all the drawn contours by the specified\n\\f$\\texttt{offset}=(dx,dy)\\f$ .\n@note When thickness=#FILLED, the function is designed to handle connected components with holes correctly\neven when no hierarchy date is provided. This is done by analyzing all the outlines together\nusing even-odd rule. This may give incorrect results if you have a joint collection of separately retrieved\ncontours. In order to solve this problem, you need to call #drawContours separately for each sub-group\nof contours, or iterate over the collection using contourIdx parameter.\n */\nCV_EXPORTS_W void drawContours( InputOutputArray image, InputArrayOfArrays contours,\n                              int contourIdx, const Scalar& color,\n                              int thickness = 1, int lineType = LINE_8,\n                              InputArray hierarchy = noArray(),\n                              int maxLevel = INT_MAX, Point offset = Point() );\n\n/** @brief Clips the line against the image rectangle.\n\nThe function cv::clipLine calculates a part of the line segment that is entirely within the specified\nrectangle. it returns false if the line segment is completely outside the rectangle. Otherwise,\nit returns true .\n@param imgSize Image size. The image rectangle is Rect(0, 0, imgSize.width, imgSize.height) .\n@param pt1 First line point.\n@param pt2 Second line point.\n */\nCV_EXPORTS bool clipLine(Size imgSize, CV_IN_OUT Point& pt1, CV_IN_OUT Point& pt2);\n\n/** @overload\n@param imgSize Image size. The image rectangle is Rect(0, 0, imgSize.width, imgSize.height) .\n@param pt1 First line point.\n@param pt2 Second line point.\n*/\nCV_EXPORTS bool clipLine(Size2l imgSize, CV_IN_OUT Point2l& pt1, CV_IN_OUT Point2l& pt2);\n\n/** @overload\n@param imgRect Image rectangle.\n@param pt1 First line point.\n@param pt2 Second line point.\n*/\nCV_EXPORTS_W bool clipLine(Rect imgRect, CV_OUT CV_IN_OUT Point& pt1, CV_OUT CV_IN_OUT Point& pt2);\n\n/** @brief Approximates an elliptic arc with a polyline.\n\nThe function ellipse2Poly computes the vertices of a polyline that approximates the specified\nelliptic arc. It is used by #ellipse. If `arcStart` is greater than `arcEnd`, they are swapped.\n\n@param center Center of the arc.\n@param axes Half of the size of the ellipse main axes. See #ellipse for details.\n@param angle Rotation angle of the ellipse in degrees. See #ellipse for details.\n@param arcStart Starting angle of the elliptic arc in degrees.\n@param arcEnd Ending angle of the elliptic arc in degrees.\n@param delta Angle between the subsequent polyline vertices. It defines the approximation\naccuracy.\n@param pts Output vector of polyline vertices.\n */\nCV_EXPORTS_W void ellipse2Poly( Point center, Size axes, int angle,\n                                int arcStart, int arcEnd, int delta,\n                                CV_OUT std::vector<Point>& pts );\n\n/** @overload\n@param center Center of the arc.\n@param axes Half of the size of the ellipse main axes. See #ellipse for details.\n@param angle Rotation angle of the ellipse in degrees. See #ellipse for details.\n@param arcStart Starting angle of the elliptic arc in degrees.\n@param arcEnd Ending angle of the elliptic arc in degrees.\n@param delta Angle between the subsequent polyline vertices. It defines the approximation accuracy.\n@param pts Output vector of polyline vertices.\n*/\nCV_EXPORTS void ellipse2Poly(Point2d center, Size2d axes, int angle,\n                             int arcStart, int arcEnd, int delta,\n                             CV_OUT std::vector<Point2d>& pts);\n\n/** @brief Draws a text string.\n\nThe function cv::putText renders the specified text string in the image. Symbols that cannot be rendered\nusing the specified font are replaced by question marks. See #getTextSize for a text rendering code\nexample.\n\n@param img Image.\n@param text Text string to be drawn.\n@param org Bottom-left corner of the text string in the image.\n@param fontFace Font type, see #HersheyFonts.\n@param fontScale Font scale factor that is multiplied by the font-specific base size.\n@param color Text color.\n@param thickness Thickness of the lines used to draw a text.\n@param lineType Line type. See #LineTypes\n@param bottomLeftOrigin When true, the image data origin is at the bottom-left corner. Otherwise,\nit is at the top-left corner.\n */\nCV_EXPORTS_W void putText( InputOutputArray img, const String& text, Point org,\n                         int fontFace, double fontScale, Scalar color,\n                         int thickness = 1, int lineType = LINE_8,\n                         bool bottomLeftOrigin = false );\n\n/** @brief Calculates the width and height of a text string.\n\nThe function cv::getTextSize calculates and returns the size of a box that contains the specified text.\nThat is, the following code renders some text, the tight box surrounding it, and the baseline: :\n@code\n    String text = \"Funny text inside the box\";\n    int fontFace = FONT_HERSHEY_SCRIPT_SIMPLEX;\n    double fontScale = 2;\n    int thickness = 3;\n\n    Mat img(600, 800, CV_8UC3, Scalar::all(0));\n\n    int baseline=0;\n    Size textSize = getTextSize(text, fontFace,\n                                fontScale, thickness, &baseline);\n    baseline += thickness;\n\n    // center the text\n    Point textOrg((img.cols - textSize.width)/2,\n                  (img.rows + textSize.height)/2);\n\n    // draw the box\n    rectangle(img, textOrg + Point(0, baseline),\n              textOrg + Point(textSize.width, -textSize.height),\n              Scalar(0,0,255));\n    // ... and the baseline first\n    line(img, textOrg + Point(0, thickness),\n         textOrg + Point(textSize.width, thickness),\n         Scalar(0, 0, 255));\n\n    // then put the text itself\n    putText(img, text, textOrg, fontFace, fontScale,\n            Scalar::all(255), thickness, 8);\n@endcode\n\n@param text Input text string.\n@param fontFace Font to use, see #HersheyFonts.\n@param fontScale Font scale factor that is multiplied by the font-specific base size.\n@param thickness Thickness of lines used to render the text. See #putText for details.\n@param[out] baseLine y-coordinate of the baseline relative to the bottom-most text\npoint.\n@return The size of a box that contains the specified text.\n\n@see putText\n */\nCV_EXPORTS_W Size getTextSize(const String& text, int fontFace,\n                            double fontScale, int thickness,\n                            CV_OUT int* baseLine);\n\n\n/** @brief Calculates the font-specific size to use to achieve a given height in pixels.\n\n@param fontFace Font to use, see cv::HersheyFonts.\n@param pixelHeight Pixel height to compute the fontScale for\n@param thickness Thickness of lines used to render the text.See putText for details.\n@return The fontSize to use for cv::putText\n\n@see cv::putText\n*/\nCV_EXPORTS_W double getFontScaleFromHeight(const int fontFace,\n                                           const int pixelHeight,\n                                           const int thickness = 1);\n\n/** @brief Line iterator\n\nThe class is used to iterate over all the pixels on the raster line\nsegment connecting two specified points.\n\nThe class LineIterator is used to get each pixel of a raster line. It\ncan be treated as versatile implementation of the Bresenham algorithm\nwhere you can stop at each pixel and do some extra processing, for\nexample, grab pixel values along the line or draw a line with an effect\n(for example, with XOR operation).\n\nThe number of pixels along the line is stored in LineIterator::count.\nThe method LineIterator::pos returns the current position in the image:\n\n@code{.cpp}\n// grabs pixels along the line (pt1, pt2)\n// from 8-bit 3-channel image to the buffer\nLineIterator it(img, pt1, pt2, 8);\nLineIterator it2 = it;\nvector<Vec3b> buf(it.count);\n\nfor(int i = 0; i < it.count; i++, ++it)\n    buf[i] = *(const Vec3b*)*it;\n\n// alternative way of iterating through the line\nfor(int i = 0; i < it2.count; i++, ++it2)\n{\n    Vec3b val = img.at<Vec3b>(it2.pos());\n    CV_Assert(buf[i] == val);\n}\n@endcode\n*/\nclass CV_EXPORTS LineIterator\n{\npublic:\n    /** @brief initializes the iterator\n\n    creates iterators for the line connecting pt1 and pt2\n    the line will be clipped on the image boundaries\n    the line is 8-connected or 4-connected\n    If leftToRight=true, then the iteration is always done\n    from the left-most point to the right most,\n    not to depend on the ordering of pt1 and pt2 parameters;\n    */\n    LineIterator( const Mat& img, Point pt1, Point pt2,\n                  int connectivity = 8, bool leftToRight = false )\n    {\n        init(&img, Rect(0, 0, img.cols, img.rows), pt1, pt2, connectivity, leftToRight);\n        ptmode = false;\n    }\n    LineIterator( Point pt1, Point pt2,\n                  int connectivity = 8, bool leftToRight = false )\n    {\n        init(0, Rect(std::min(pt1.x, pt2.x),\n                     std::min(pt1.y, pt2.y),\n                     std::max(pt1.x, pt2.x) - std::min(pt1.x, pt2.x) + 1,\n                     std::max(pt1.y, pt2.y) - std::min(pt1.y, pt2.y) + 1),\n             pt1, pt2, connectivity, leftToRight);\n        ptmode = true;\n    }\n    LineIterator( Size boundingAreaSize, Point pt1, Point pt2,\n                  int connectivity = 8, bool leftToRight = false )\n    {\n        init(0, Rect(0, 0, boundingAreaSize.width, boundingAreaSize.height),\n             pt1, pt2, connectivity, leftToRight);\n        ptmode = true;\n    }\n    LineIterator( Rect boundingAreaRect, Point pt1, Point pt2,\n                  int connectivity = 8, bool leftToRight = false )\n    {\n        init(0, boundingAreaRect, pt1, pt2, connectivity, leftToRight);\n        ptmode = true;\n    }\n    void init(const Mat* img, Rect boundingAreaRect, Point pt1, Point pt2, int connectivity, bool leftToRight);\n\n    /** @brief returns pointer to the current pixel\n    */\n    uchar* operator *();\n    /** @brief prefix increment operator (++it). shifts iterator to the next pixel\n    */\n    LineIterator& operator ++();\n    /** @brief postfix increment operator (it++). shifts iterator to the next pixel\n    */\n    LineIterator operator ++(int);\n    /** @brief returns coordinates of the current pixel\n    */\n    Point pos() const;\n\n    uchar* ptr;\n    const uchar* ptr0;\n    int step, elemSize;\n    int err, count;\n    int minusDelta, plusDelta;\n    int minusStep, plusStep;\n    int minusShift, plusShift;\n    Point p;\n    bool ptmode;\n};\n\n//! @cond IGNORED\n\n// === LineIterator implementation ===\n\ninline\nuchar* LineIterator::operator *()\n{\n    return ptmode ? 0 : ptr;\n}\n\ninline\nLineIterator& LineIterator::operator ++()\n{\n    int mask = err < 0 ? -1 : 0;\n    err += minusDelta + (plusDelta & mask);\n    if(!ptmode)\n    {\n        ptr += minusStep + (plusStep & mask);\n    }\n    else\n    {\n        p.x += minusShift + (plusShift & mask);\n        p.y += minusStep + (plusStep & mask);\n    }\n    return *this;\n}\n\ninline\nLineIterator LineIterator::operator ++(int)\n{\n    LineIterator it = *this;\n    ++(*this);\n    return it;\n}\n\ninline\nPoint LineIterator::pos() const\n{\n    if(!ptmode)\n    {\n        size_t offset = (size_t)(ptr - ptr0);\n        int y = (int)(offset/step);\n        int x = (int)((offset - (size_t)y*step)/elemSize);\n        return Point(x, y);\n    }\n    return p;\n}\n\n//! @endcond\n\n//! @} imgproc_draw\n\n//! @} imgproc\n\n} // cv\n\n\n#include \"./imgproc/segmentation.hpp\"\n\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/ml/ml.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/ml.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/ml/ml.inl.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_ML_INL_HPP\n#define OPENCV_ML_INL_HPP\n\nnamespace cv { namespace ml {\n\n// declared in ml.hpp\ntemplate<class SimulatedAnnealingSolverSystem>\nint simulatedAnnealingSolver(SimulatedAnnealingSolverSystem& solverSystem,\n     double initialTemperature, double finalTemperature, double coolingRatio,\n     size_t iterationsPerStep,\n     CV_OUT double* lastTemperature,\n     cv::RNG& rngEnergy\n)\n{\n    CV_Assert(finalTemperature > 0);\n    CV_Assert(initialTemperature > finalTemperature);\n    CV_Assert(iterationsPerStep > 0);\n    CV_Assert(coolingRatio < 1.0f);\n    double Ti = initialTemperature;\n    double previousEnergy = solverSystem.energy();\n    int exchange = 0;\n    while (Ti > finalTemperature)\n    {\n        for (size_t i = 0; i < iterationsPerStep; i++)\n        {\n            solverSystem.changeState();\n            double newEnergy = solverSystem.energy();\n            if (newEnergy < previousEnergy)\n            {\n                previousEnergy = newEnergy;\n                exchange++;\n            }\n            else\n            {\n                double r = rngEnergy.uniform(0.0, 1.0);\n                if (r < std::exp(-(newEnergy - previousEnergy) / Ti))\n                {\n                    previousEnergy = newEnergy;\n                    exchange++;\n                }\n                else\n                {\n                    solverSystem.reverseState();\n                }\n            }\n        }\n        Ti *= coolingRatio;\n    }\n    if (lastTemperature)\n        *lastTemperature = Ti;\n    return exchange;\n}\n\n}} //namespace\n\n#endif // OPENCV_ML_INL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/ml.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Copyright (C) 2014, Itseez Inc, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_ML_HPP\n#define OPENCV_ML_HPP\n\n#ifdef __cplusplus\n#  include \"opencv2/core.hpp\"\n#endif\n\n#ifdef __cplusplus\n\n#include <float.h>\n#include <map>\n#include <iostream>\n\n/**\n  @defgroup ml Machine Learning\n\n  The Machine Learning Library (MLL) is a set of classes and functions for statistical\n  classification, regression, and clustering of data.\n\n  Most of the classification and regression algorithms are implemented as C++ classes. As the\n  algorithms have different sets of features (like an ability to handle missing measurements or\n  categorical input variables), there is a little common ground between the classes. This common\n  ground is defined by the class cv::ml::StatModel that all the other ML classes are derived from.\n\n  See detailed overview here: @ref ml_intro.\n */\n\nnamespace cv\n{\n\nnamespace ml\n{\n\n//! @addtogroup ml\n//! @{\n\n/** @brief Variable types */\nenum VariableTypes\n{\n    VAR_NUMERICAL    =0, //!< same as VAR_ORDERED\n    VAR_ORDERED      =0, //!< ordered variables\n    VAR_CATEGORICAL  =1  //!< categorical variables\n};\n\n/** @brief %Error types */\nenum ErrorTypes\n{\n    TEST_ERROR = 0,\n    TRAIN_ERROR = 1\n};\n\n/** @brief Sample types */\nenum SampleTypes\n{\n    ROW_SAMPLE = 0, //!< each training sample is a row of samples\n    COL_SAMPLE = 1  //!< each training sample occupies a column of samples\n};\n\n/** @brief The structure represents the logarithmic grid range of statmodel parameters.\n\nIt is used for optimizing statmodel accuracy by varying model parameters, the accuracy estimate\nbeing computed by cross-validation.\n */\nclass CV_EXPORTS_W ParamGrid\n{\npublic:\n    /** @brief Default constructor */\n    ParamGrid();\n    /** @brief Constructor with parameters */\n    ParamGrid(double _minVal, double _maxVal, double _logStep);\n\n    CV_PROP_RW double minVal; //!< Minimum value of the statmodel parameter. Default value is 0.\n    CV_PROP_RW double maxVal; //!< Maximum value of the statmodel parameter. Default value is 0.\n    /** @brief Logarithmic step for iterating the statmodel parameter.\n\n    The grid determines the following iteration sequence of the statmodel parameter values:\n    \\f[(minVal, minVal*step, minVal*{step}^2, \\dots,  minVal*{logStep}^n),\\f]\n    where \\f$n\\f$ is the maximal index satisfying\n    \\f[\\texttt{minVal} * \\texttt{logStep} ^n <  \\texttt{maxVal}\\f]\n    The grid is logarithmic, so logStep must always be greater than 1. Default value is 1.\n    */\n    CV_PROP_RW double logStep;\n\n    /** @brief Creates a ParamGrid Ptr that can be given to the %SVM::trainAuto method\n\n    @param minVal minimum value of the parameter grid\n    @param maxVal maximum value of the parameter grid\n    @param logstep Logarithmic step for iterating the statmodel parameter\n    */\n    CV_WRAP static Ptr<ParamGrid> create(double minVal=0., double maxVal=0., double logstep=1.);\n};\n\n/** @brief Class encapsulating training data.\n\nPlease note that the class only specifies the interface of training data, but not implementation.\nAll the statistical model classes in _ml_ module accepts Ptr\\<TrainData\\> as parameter. In other\nwords, you can create your own class derived from TrainData and pass smart pointer to the instance\nof this class into StatModel::train.\n\n@sa @ref ml_intro_data\n */\nclass CV_EXPORTS_W TrainData\n{\npublic:\n    static inline float missingValue() { return FLT_MAX; }\n    virtual ~TrainData();\n\n    CV_WRAP virtual int getLayout() const = 0;\n    CV_WRAP virtual int getNTrainSamples() const = 0;\n    CV_WRAP virtual int getNTestSamples() const = 0;\n    CV_WRAP virtual int getNSamples() const = 0;\n    CV_WRAP virtual int getNVars() const = 0;\n    CV_WRAP virtual int getNAllVars() const = 0;\n\n    CV_WRAP virtual void getSample(InputArray varIdx, int sidx, float* buf) const = 0;\n    CV_WRAP virtual Mat getSamples() const = 0;\n    CV_WRAP virtual Mat getMissing() const = 0;\n\n    /** @brief Returns matrix of train samples\n\n    @param layout The requested layout. If it's different from the initial one, the matrix is\n        transposed. See ml::SampleTypes.\n    @param compressSamples if true, the function returns only the training samples (specified by\n        sampleIdx)\n    @param compressVars if true, the function returns the shorter training samples, containing only\n        the active variables.\n\n    In current implementation the function tries to avoid physical data copying and returns the\n    matrix stored inside TrainData (unless the transposition or compression is needed).\n     */\n    CV_WRAP virtual Mat getTrainSamples(int layout=ROW_SAMPLE,\n                                bool compressSamples=true,\n                                bool compressVars=true) const = 0;\n\n    /** @brief Returns the vector of responses\n\n    The function returns ordered or the original categorical responses. Usually it's used in\n    regression algorithms.\n     */\n    CV_WRAP virtual Mat getTrainResponses() const = 0;\n\n    /** @brief Returns the vector of normalized categorical responses\n\n    The function returns vector of responses. Each response is integer from `0` to `<number of\n    classes>-1`. The actual label value can be retrieved then from the class label vector, see\n    TrainData::getClassLabels.\n     */\n    CV_WRAP virtual Mat getTrainNormCatResponses() const = 0;\n    CV_WRAP virtual Mat getTestResponses() const = 0;\n    CV_WRAP virtual Mat getTestNormCatResponses() const = 0;\n    CV_WRAP virtual Mat getResponses() const = 0;\n    CV_WRAP virtual Mat getNormCatResponses() const = 0;\n    CV_WRAP virtual Mat getSampleWeights() const = 0;\n    CV_WRAP virtual Mat getTrainSampleWeights() const = 0;\n    CV_WRAP virtual Mat getTestSampleWeights() const = 0;\n    CV_WRAP virtual Mat getVarIdx() const = 0;\n    CV_WRAP virtual Mat getVarType() const = 0;\n    CV_WRAP virtual Mat getVarSymbolFlags() const = 0;\n    CV_WRAP virtual int getResponseType() const = 0;\n    CV_WRAP virtual Mat getTrainSampleIdx() const = 0;\n    CV_WRAP virtual Mat getTestSampleIdx() const = 0;\n    CV_WRAP virtual void getValues(int vi, InputArray sidx, float* values) const = 0;\n    virtual void getNormCatValues(int vi, InputArray sidx, int* values) const = 0;\n    CV_WRAP virtual Mat getDefaultSubstValues() const = 0;\n\n    CV_WRAP virtual int getCatCount(int vi) const = 0;\n\n    /** @brief Returns the vector of class labels\n\n    The function returns vector of unique labels occurred in the responses.\n     */\n    CV_WRAP virtual Mat getClassLabels() const = 0;\n\n    CV_WRAP virtual Mat getCatOfs() const = 0;\n    CV_WRAP virtual Mat getCatMap() const = 0;\n\n    /** @brief Splits the training data into the training and test parts\n    @sa TrainData::setTrainTestSplitRatio\n     */\n    CV_WRAP virtual void setTrainTestSplit(int count, bool shuffle=true) = 0;\n\n    /** @brief Splits the training data into the training and test parts\n\n    The function selects a subset of specified relative size and then returns it as the training\n    set. If the function is not called, all the data is used for training. Please, note that for\n    each of TrainData::getTrain\\* there is corresponding TrainData::getTest\\*, so that the test\n    subset can be retrieved and processed as well.\n    @sa TrainData::setTrainTestSplit\n     */\n    CV_WRAP virtual void setTrainTestSplitRatio(double ratio, bool shuffle=true) = 0;\n    CV_WRAP virtual void shuffleTrainTest() = 0;\n\n    /** @brief Returns matrix of test samples */\n    CV_WRAP virtual Mat getTestSamples() const = 0;\n\n    /** @brief Returns vector of symbolic names captured in loadFromCSV() */\n    CV_WRAP virtual void getNames(std::vector<String>& names) const = 0;\n\n    /** @brief Extract from 1D vector elements specified by passed indexes.\n    @param vec input vector (supported types: CV_32S, CV_32F, CV_64F)\n    @param idx 1D index vector\n     */\n    static CV_WRAP Mat getSubVector(const Mat& vec, const Mat& idx);\n\n    /** @brief Extract from matrix rows/cols specified by passed indexes.\n    @param matrix input matrix (supported types: CV_32S, CV_32F, CV_64F)\n    @param idx 1D index vector\n    @param layout specifies to extract rows (cv::ml::ROW_SAMPLES) or to extract columns (cv::ml::COL_SAMPLES)\n     */\n    static CV_WRAP Mat getSubMatrix(const Mat& matrix, const Mat& idx, int layout);\n\n    /** @brief Reads the dataset from a .csv file and returns the ready-to-use training data.\n\n    @param filename The input file name\n    @param headerLineCount The number of lines in the beginning to skip; besides the header, the\n        function also skips empty lines and lines staring with `#`\n    @param responseStartIdx Index of the first output variable. If -1, the function considers the\n        last variable as the response\n    @param responseEndIdx Index of the last output variable + 1. If -1, then there is single\n        response variable at responseStartIdx.\n    @param varTypeSpec The optional text string that specifies the variables' types. It has the\n        format `ord[n1-n2,n3,n4-n5,...]cat[n6,n7-n8,...]`. That is, variables from `n1 to n2`\n        (inclusive range), `n3`, `n4 to n5` ... are considered ordered and `n6`, `n7 to n8` ... are\n        considered as categorical. The range `[n1..n2] + [n3] + [n4..n5] + ... + [n6] + [n7..n8]`\n        should cover all the variables. If varTypeSpec is not specified, then algorithm uses the\n        following rules:\n        - all input variables are considered ordered by default. If some column contains has non-\n          numerical values, e.g. 'apple', 'pear', 'apple', 'apple', 'mango', the corresponding\n          variable is considered categorical.\n        - if there are several output variables, they are all considered as ordered. Error is\n          reported when non-numerical values are used.\n        - if there is a single output variable, then if its values are non-numerical or are all\n          integers, then it's considered categorical. Otherwise, it's considered ordered.\n    @param delimiter The character used to separate values in each line.\n    @param missch The character used to specify missing measurements. It should not be a digit.\n        Although it's a non-numerical value, it surely does not affect the decision of whether the\n        variable ordered or categorical.\n    @note If the dataset only contains input variables and no responses, use responseStartIdx = -2\n        and responseEndIdx = 0. The output variables vector will just contain zeros.\n     */\n    static Ptr<TrainData> loadFromCSV(const String& filename,\n                                      int headerLineCount,\n                                      int responseStartIdx=-1,\n                                      int responseEndIdx=-1,\n                                      const String& varTypeSpec=String(),\n                                      char delimiter=',',\n                                      char missch='?');\n\n    /** @brief Creates training data from in-memory arrays.\n\n    @param samples matrix of samples. It should have CV_32F type.\n    @param layout see ml::SampleTypes.\n    @param responses matrix of responses. If the responses are scalar, they should be stored as a\n        single row or as a single column. The matrix should have type CV_32F or CV_32S (in the\n        former case the responses are considered as ordered by default; in the latter case - as\n        categorical)\n    @param varIdx vector specifying which variables to use for training. It can be an integer vector\n        (CV_32S) containing 0-based variable indices or byte vector (CV_8U) containing a mask of\n        active variables.\n    @param sampleIdx vector specifying which samples to use for training. It can be an integer\n        vector (CV_32S) containing 0-based sample indices or byte vector (CV_8U) containing a mask\n        of training samples.\n    @param sampleWeights optional vector with weights for each sample. It should have CV_32F type.\n    @param varType optional vector of type CV_8U and size `<number_of_variables_in_samples> +\n        <number_of_variables_in_responses>`, containing types of each input and output variable. See\n        ml::VariableTypes.\n     */\n    CV_WRAP static Ptr<TrainData> create(InputArray samples, int layout, InputArray responses,\n                                 InputArray varIdx=noArray(), InputArray sampleIdx=noArray(),\n                                 InputArray sampleWeights=noArray(), InputArray varType=noArray());\n};\n\n/** @brief Base class for statistical models in OpenCV ML.\n */\nclass CV_EXPORTS_W StatModel : public Algorithm\n{\npublic:\n    /** Predict options */\n    enum Flags {\n        UPDATE_MODEL = 1,\n        RAW_OUTPUT=1, //!< makes the method return the raw results (the sum), not the class label\n        COMPRESSED_INPUT=2,\n        PREPROCESSED_INPUT=4\n    };\n\n    /** @brief Returns the number of variables in training samples */\n    CV_WRAP virtual int getVarCount() const = 0;\n\n    CV_WRAP virtual bool empty() const CV_OVERRIDE;\n\n    /** @brief Returns true if the model is trained */\n    CV_WRAP virtual bool isTrained() const = 0;\n    /** @brief Returns true if the model is classifier */\n    CV_WRAP virtual bool isClassifier() const = 0;\n\n    /** @brief Trains the statistical model\n\n    @param trainData training data that can be loaded from file using TrainData::loadFromCSV or\n        created with TrainData::create.\n    @param flags optional flags, depending on the model. Some of the models can be updated with the\n        new training samples, not completely overwritten (such as NormalBayesClassifier or ANN_MLP).\n     */\n    CV_WRAP virtual bool train( const Ptr<TrainData>& trainData, int flags=0 );\n\n    /** @brief Trains the statistical model\n\n    @param samples training samples\n    @param layout See ml::SampleTypes.\n    @param responses vector of responses associated with the training samples.\n    */\n    CV_WRAP virtual bool train( InputArray samples, int layout, InputArray responses );\n\n    /** @brief Computes error on the training or test dataset\n\n    @param data the training data\n    @param test if true, the error is computed over the test subset of the data, otherwise it's\n        computed over the training subset of the data. Please note that if you loaded a completely\n        different dataset to evaluate already trained classifier, you will probably want not to set\n        the test subset at all with TrainData::setTrainTestSplitRatio and specify test=false, so\n        that the error is computed for the whole new set. Yes, this sounds a bit confusing.\n    @param resp the optional output responses.\n\n    The method uses StatModel::predict to compute the error. For regression models the error is\n    computed as RMS, for classifiers - as a percent of missclassified samples (0%-100%).\n     */\n    CV_WRAP virtual float calcError( const Ptr<TrainData>& data, bool test, OutputArray resp ) const;\n\n    /** @brief Predicts response(s) for the provided sample(s)\n\n    @param samples The input samples, floating-point matrix\n    @param results The optional output matrix of results.\n    @param flags The optional flags, model-dependent. See cv::ml::StatModel::Flags.\n     */\n    CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const = 0;\n\n    /** @brief Create and train model with default parameters\n\n    The class must implement static `create()` method with no parameters or with all default parameter values\n    */\n    template<typename _Tp> static Ptr<_Tp> train(const Ptr<TrainData>& data, int flags=0)\n    {\n        Ptr<_Tp> model = _Tp::create();\n        return !model.empty() && model->train(data, flags) ? model : Ptr<_Tp>();\n    }\n};\n\n/****************************************************************************************\\\n*                                 Normal Bayes Classifier                                *\n\\****************************************************************************************/\n\n/** @brief Bayes classifier for normally distributed data.\n\n@sa @ref ml_intro_bayes\n */\nclass CV_EXPORTS_W NormalBayesClassifier : public StatModel\n{\npublic:\n    /** @brief Predicts the response for sample(s).\n\n    The method estimates the most probable classes for input vectors. Input vectors (one or more)\n    are stored as rows of the matrix inputs. In case of multiple input vectors, there should be one\n    output vector outputs. The predicted class for a single input vector is returned by the method.\n    The vector outputProbs contains the output probabilities corresponding to each element of\n    result.\n     */\n    CV_WRAP virtual float predictProb( InputArray inputs, OutputArray outputs,\n                               OutputArray outputProbs, int flags=0 ) const = 0;\n\n    /** Creates empty model\n    Use StatModel::train to train the model after creation. */\n    CV_WRAP static Ptr<NormalBayesClassifier> create();\n\n    /** @brief Loads and creates a serialized NormalBayesClassifier from a file\n     *\n     * Use NormalBayesClassifier::save to serialize and store an NormalBayesClassifier to disk.\n     * Load the NormalBayesClassifier from this file again, by calling this function with the path to the file.\n     * Optionally specify the node for the file containing the classifier\n     *\n     * @param filepath path to serialized NormalBayesClassifier\n     * @param nodeName name of node containing the classifier\n     */\n    CV_WRAP static Ptr<NormalBayesClassifier> load(const String& filepath , const String& nodeName = String());\n};\n\n/****************************************************************************************\\\n*                          K-Nearest Neighbour Classifier                                *\n\\****************************************************************************************/\n\n/** @brief The class implements K-Nearest Neighbors model\n\n@sa @ref ml_intro_knn\n */\nclass CV_EXPORTS_W KNearest : public StatModel\n{\npublic:\n\n    /** Default number of neighbors to use in predict method. */\n    /** @see setDefaultK */\n    CV_WRAP virtual int getDefaultK() const = 0;\n    /** @copybrief getDefaultK @see getDefaultK */\n    CV_WRAP virtual void setDefaultK(int val) = 0;\n\n    /** Whether classification or regression model should be trained. */\n    /** @see setIsClassifier */\n    CV_WRAP virtual bool getIsClassifier() const = 0;\n    /** @copybrief getIsClassifier @see getIsClassifier */\n    CV_WRAP virtual void setIsClassifier(bool val) = 0;\n\n    /** Parameter for KDTree implementation. */\n    /** @see setEmax */\n    CV_WRAP virtual int getEmax() const = 0;\n    /** @copybrief getEmax @see getEmax */\n    CV_WRAP virtual void setEmax(int val) = 0;\n\n    /** %Algorithm type, one of KNearest::Types. */\n    /** @see setAlgorithmType */\n    CV_WRAP virtual int getAlgorithmType() const = 0;\n    /** @copybrief getAlgorithmType @see getAlgorithmType */\n    CV_WRAP virtual void setAlgorithmType(int val) = 0;\n\n    /** @brief Finds the neighbors and predicts responses for input vectors.\n\n    @param samples Input samples stored by rows. It is a single-precision floating-point matrix of\n        `<number_of_samples> * k` size.\n    @param k Number of used nearest neighbors. Should be greater than 1.\n    @param results Vector with results of prediction (regression or classification) for each input\n        sample. It is a single-precision floating-point vector with `<number_of_samples>` elements.\n    @param neighborResponses Optional output values for corresponding neighbors. It is a single-\n        precision floating-point matrix of `<number_of_samples> * k` size.\n    @param dist Optional output distances from the input vectors to the corresponding neighbors. It\n        is a single-precision floating-point matrix of `<number_of_samples> * k` size.\n\n    For each input vector (a row of the matrix samples), the method finds the k nearest neighbors.\n    In case of regression, the predicted result is a mean value of the particular vector's neighbor\n    responses. In case of classification, the class is determined by voting.\n\n    For each input vector, the neighbors are sorted by their distances to the vector.\n\n    In case of C++ interface you can use output pointers to empty matrices and the function will\n    allocate memory itself.\n\n    If only a single input vector is passed, all output matrices are optional and the predicted\n    value is returned by the method.\n\n    The function is parallelized with the TBB library.\n     */\n    CV_WRAP virtual float findNearest( InputArray samples, int k,\n                               OutputArray results,\n                               OutputArray neighborResponses=noArray(),\n                               OutputArray dist=noArray() ) const = 0;\n\n    /** @brief Implementations of KNearest algorithm\n       */\n    enum Types\n    {\n        BRUTE_FORCE=1,\n        KDTREE=2\n    };\n\n    /** @brief Creates the empty model\n\n    The static method creates empty %KNearest classifier. It should be then trained using StatModel::train method.\n     */\n    CV_WRAP static Ptr<KNearest> create();\n    /** @brief Loads and creates a serialized knearest from a file\n     *\n     * Use KNearest::save to serialize and store an KNearest to disk.\n     * Load the KNearest from this file again, by calling this function with the path to the file.\n     *\n     * @param filepath path to serialized KNearest\n     */\n    CV_WRAP static Ptr<KNearest> load(const String& filepath);\n};\n\n/****************************************************************************************\\\n*                                   Support Vector Machines                              *\n\\****************************************************************************************/\n\n/** @brief Support Vector Machines.\n\n@sa @ref ml_intro_svm\n */\nclass CV_EXPORTS_W SVM : public StatModel\n{\npublic:\n\n    class CV_EXPORTS Kernel : public Algorithm\n    {\n    public:\n        virtual int getType() const = 0;\n        virtual void calc( int vcount, int n, const float* vecs, const float* another, float* results ) = 0;\n    };\n\n    /** Type of a %SVM formulation.\n    See SVM::Types. Default value is SVM::C_SVC. */\n    /** @see setType */\n    CV_WRAP virtual int getType() const = 0;\n    /** @copybrief getType @see getType */\n    CV_WRAP virtual void setType(int val) = 0;\n\n    /** Parameter \\f$\\gamma\\f$ of a kernel function.\n    For SVM::POLY, SVM::RBF, SVM::SIGMOID or SVM::CHI2. Default value is 1. */\n    /** @see setGamma */\n    CV_WRAP virtual double getGamma() const = 0;\n    /** @copybrief getGamma @see getGamma */\n    CV_WRAP virtual void setGamma(double val) = 0;\n\n    /** Parameter _coef0_ of a kernel function.\n    For SVM::POLY or SVM::SIGMOID. Default value is 0.*/\n    /** @see setCoef0 */\n    CV_WRAP virtual double getCoef0() const = 0;\n    /** @copybrief getCoef0 @see getCoef0 */\n    CV_WRAP virtual void setCoef0(double val) = 0;\n\n    /** Parameter _degree_ of a kernel function.\n    For SVM::POLY. Default value is 0. */\n    /** @see setDegree */\n    CV_WRAP virtual double getDegree() const = 0;\n    /** @copybrief getDegree @see getDegree */\n    CV_WRAP virtual void setDegree(double val) = 0;\n\n    /** Parameter _C_ of a %SVM optimization problem.\n    For SVM::C_SVC, SVM::EPS_SVR or SVM::NU_SVR. Default value is 0. */\n    /** @see setC */\n    CV_WRAP virtual double getC() const = 0;\n    /** @copybrief getC @see getC */\n    CV_WRAP virtual void setC(double val) = 0;\n\n    /** Parameter \\f$\\nu\\f$ of a %SVM optimization problem.\n    For SVM::NU_SVC, SVM::ONE_CLASS or SVM::NU_SVR. Default value is 0. */\n    /** @see setNu */\n    CV_WRAP virtual double getNu() const = 0;\n    /** @copybrief getNu @see getNu */\n    CV_WRAP virtual void setNu(double val) = 0;\n\n    /** Parameter \\f$\\epsilon\\f$ of a %SVM optimization problem.\n    For SVM::EPS_SVR. Default value is 0. */\n    /** @see setP */\n    CV_WRAP virtual double getP() const = 0;\n    /** @copybrief getP @see getP */\n    CV_WRAP virtual void setP(double val) = 0;\n\n    /** Optional weights in the SVM::C_SVC problem, assigned to particular classes.\n    They are multiplied by _C_ so the parameter _C_ of class _i_ becomes `classWeights(i) * C`. Thus\n    these weights affect the misclassification penalty for different classes. The larger weight,\n    the larger penalty on misclassification of data from the corresponding class. Default value is\n    empty Mat. */\n    /** @see setClassWeights */\n    CV_WRAP virtual cv::Mat getClassWeights() const = 0;\n    /** @copybrief getClassWeights @see getClassWeights */\n    CV_WRAP virtual void setClassWeights(const cv::Mat &val) = 0;\n\n    /** Termination criteria of the iterative %SVM training procedure which solves a partial\n    case of constrained quadratic optimization problem.\n    You can specify tolerance and/or the maximum number of iterations. Default value is\n    `TermCriteria( TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, FLT_EPSILON )`; */\n    /** @see setTermCriteria */\n    CV_WRAP virtual cv::TermCriteria getTermCriteria() const = 0;\n    /** @copybrief getTermCriteria @see getTermCriteria */\n    CV_WRAP virtual void setTermCriteria(const cv::TermCriteria &val) = 0;\n\n    /** Type of a %SVM kernel.\n    See SVM::KernelTypes. Default value is SVM::RBF. */\n    CV_WRAP virtual int getKernelType() const = 0;\n\n    /** Initialize with one of predefined kernels.\n    See SVM::KernelTypes. */\n    CV_WRAP virtual void setKernel(int kernelType) = 0;\n\n    /** Initialize with custom kernel.\n    See SVM::Kernel class for implementation details */\n    virtual void setCustomKernel(const Ptr<Kernel> &_kernel) = 0;\n\n    //! %SVM type\n    enum Types {\n        /** C-Support Vector Classification. n-class classification (n \\f$\\geq\\f$ 2), allows\n        imperfect separation of classes with penalty multiplier C for outliers. */\n        C_SVC=100,\n        /** \\f$\\nu\\f$-Support Vector Classification. n-class classification with possible\n        imperfect separation. Parameter \\f$\\nu\\f$ (in the range 0..1, the larger the value, the smoother\n        the decision boundary) is used instead of C. */\n        NU_SVC=101,\n        /** Distribution Estimation (One-class %SVM). All the training data are from\n        the same class, %SVM builds a boundary that separates the class from the rest of the feature\n        space. */\n        ONE_CLASS=102,\n        /** \\f$\\epsilon\\f$-Support Vector Regression. The distance between feature vectors\n        from the training set and the fitting hyper-plane must be less than p. For outliers the\n        penalty multiplier C is used. */\n        EPS_SVR=103,\n        /** \\f$\\nu\\f$-Support Vector Regression. \\f$\\nu\\f$ is used instead of p.\n        See @cite LibSVM for details. */\n        NU_SVR=104\n    };\n\n    /** @brief %SVM kernel type\n\n    A comparison of different kernels on the following 2D test case with four classes. Four\n    SVM::C_SVC SVMs have been trained (one against rest) with auto_train. Evaluation on three\n    different kernels (SVM::CHI2, SVM::INTER, SVM::RBF). The color depicts the class with max score.\n    Bright means max-score \\> 0, dark means max-score \\< 0.\n    ![image](pics/SVM_Comparison.png)\n    */\n    enum KernelTypes {\n        /** Returned by SVM::getKernelType in case when custom kernel has been set */\n        CUSTOM=-1,\n        /** Linear kernel. No mapping is done, linear discrimination (or regression) is\n        done in the original feature space. It is the fastest option. \\f$K(x_i, x_j) = x_i^T x_j\\f$. */\n        LINEAR=0,\n        /** Polynomial kernel:\n        \\f$K(x_i, x_j) = (\\gamma x_i^T x_j + coef0)^{degree}, \\gamma > 0\\f$. */\n        POLY=1,\n        /** Radial basis function (RBF), a good choice in most cases.\n        \\f$K(x_i, x_j) = e^{-\\gamma ||x_i - x_j||^2}, \\gamma > 0\\f$. */\n        RBF=2,\n        /** Sigmoid kernel: \\f$K(x_i, x_j) = \\tanh(\\gamma x_i^T x_j + coef0)\\f$. */\n        SIGMOID=3,\n        /** Exponential Chi2 kernel, similar to the RBF kernel:\n        \\f$K(x_i, x_j) = e^{-\\gamma \\chi^2(x_i,x_j)}, \\chi^2(x_i,x_j) = (x_i-x_j)^2/(x_i+x_j), \\gamma > 0\\f$. */\n        CHI2=4,\n        /** Histogram intersection kernel. A fast kernel. \\f$K(x_i, x_j) = min(x_i,x_j)\\f$. */\n        INTER=5\n    };\n\n    //! %SVM params type\n    enum ParamTypes {\n        C=0,\n        GAMMA=1,\n        P=2,\n        NU=3,\n        COEF=4,\n        DEGREE=5\n    };\n\n    /** @brief Trains an %SVM with optimal parameters.\n\n    @param data the training data that can be constructed using TrainData::create or\n        TrainData::loadFromCSV.\n    @param kFold Cross-validation parameter. The training set is divided into kFold subsets. One\n        subset is used to test the model, the others form the train set. So, the %SVM algorithm is\n        executed kFold times.\n    @param Cgrid grid for C\n    @param gammaGrid grid for gamma\n    @param pGrid grid for p\n    @param nuGrid grid for nu\n    @param coeffGrid grid for coeff\n    @param degreeGrid grid for degree\n    @param balanced If true and the problem is 2-class classification then the method creates more\n        balanced cross-validation subsets that is proportions between classes in subsets are close\n        to such proportion in the whole train dataset.\n\n    The method trains the %SVM model automatically by choosing the optimal parameters C, gamma, p,\n    nu, coef0, degree. Parameters are considered optimal when the cross-validation\n    estimate of the test set error is minimal.\n\n    If there is no need to optimize a parameter, the corresponding grid step should be set to any\n    value less than or equal to 1. For example, to avoid optimization in gamma, set `gammaGrid.step\n    = 0`, `gammaGrid.minVal`, `gamma_grid.maxVal` as arbitrary numbers. In this case, the value\n    `Gamma` is taken for gamma.\n\n    And, finally, if the optimization in a parameter is required but the corresponding grid is\n    unknown, you may call the function SVM::getDefaultGrid. To generate a grid, for example, for\n    gamma, call `SVM::getDefaultGrid(SVM::GAMMA)`.\n\n    This function works for the classification (SVM::C_SVC or SVM::NU_SVC) as well as for the\n    regression (SVM::EPS_SVR or SVM::NU_SVR). If it is SVM::ONE_CLASS, no optimization is made and\n    the usual %SVM with parameters specified in params is executed.\n     */\n    virtual bool trainAuto( const Ptr<TrainData>& data, int kFold = 10,\n                    ParamGrid Cgrid = getDefaultGrid(C),\n                    ParamGrid gammaGrid  = getDefaultGrid(GAMMA),\n                    ParamGrid pGrid      = getDefaultGrid(P),\n                    ParamGrid nuGrid     = getDefaultGrid(NU),\n                    ParamGrid coeffGrid  = getDefaultGrid(COEF),\n                    ParamGrid degreeGrid = getDefaultGrid(DEGREE),\n                    bool balanced=false) = 0;\n\n    /** @brief Trains an %SVM with optimal parameters\n\n    @param samples training samples\n    @param layout See ml::SampleTypes.\n    @param responses vector of responses associated with the training samples.\n    @param kFold Cross-validation parameter. The training set is divided into kFold subsets. One\n        subset is used to test the model, the others form the train set. So, the %SVM algorithm is\n    @param Cgrid grid for C\n    @param gammaGrid grid for gamma\n    @param pGrid grid for p\n    @param nuGrid grid for nu\n    @param coeffGrid grid for coeff\n    @param degreeGrid grid for degree\n    @param balanced If true and the problem is 2-class classification then the method creates more\n        balanced cross-validation subsets that is proportions between classes in subsets are close\n        to such proportion in the whole train dataset.\n\n    The method trains the %SVM model automatically by choosing the optimal parameters C, gamma, p,\n    nu, coef0, degree. Parameters are considered optimal when the cross-validation\n    estimate of the test set error is minimal.\n\n    This function only makes use of SVM::getDefaultGrid for parameter optimization and thus only\n    offers rudimentary parameter options.\n\n    This function works for the classification (SVM::C_SVC or SVM::NU_SVC) as well as for the\n    regression (SVM::EPS_SVR or SVM::NU_SVR). If it is SVM::ONE_CLASS, no optimization is made and\n    the usual %SVM with parameters specified in params is executed.\n    */\n    CV_WRAP virtual bool trainAuto(InputArray samples,\n            int layout,\n            InputArray responses,\n            int kFold = 10,\n            Ptr<ParamGrid> Cgrid = SVM::getDefaultGridPtr(SVM::C),\n            Ptr<ParamGrid> gammaGrid  = SVM::getDefaultGridPtr(SVM::GAMMA),\n            Ptr<ParamGrid> pGrid      = SVM::getDefaultGridPtr(SVM::P),\n            Ptr<ParamGrid> nuGrid     = SVM::getDefaultGridPtr(SVM::NU),\n            Ptr<ParamGrid> coeffGrid  = SVM::getDefaultGridPtr(SVM::COEF),\n            Ptr<ParamGrid> degreeGrid = SVM::getDefaultGridPtr(SVM::DEGREE),\n            bool balanced=false) = 0;\n\n    /** @brief Retrieves all the support vectors\n\n    The method returns all the support vectors as a floating-point matrix, where support vectors are\n    stored as matrix rows.\n     */\n    CV_WRAP virtual Mat getSupportVectors() const = 0;\n\n    /** @brief Retrieves all the uncompressed support vectors of a linear %SVM\n\n    The method returns all the uncompressed support vectors of a linear %SVM that the compressed\n    support vector, used for prediction, was derived from. They are returned in a floating-point\n    matrix, where the support vectors are stored as matrix rows.\n     */\n    CV_WRAP virtual Mat getUncompressedSupportVectors() const = 0;\n\n    /** @brief Retrieves the decision function\n\n    @param i the index of the decision function. If the problem solved is regression, 1-class or\n        2-class classification, then there will be just one decision function and the index should\n        always be 0. Otherwise, in the case of N-class classification, there will be \\f$N(N-1)/2\\f$\n        decision functions.\n    @param alpha the optional output vector for weights, corresponding to different support vectors.\n        In the case of linear %SVM all the alpha's will be 1's.\n    @param svidx the optional output vector of indices of support vectors within the matrix of\n        support vectors (which can be retrieved by SVM::getSupportVectors). In the case of linear\n        %SVM each decision function consists of a single \"compressed\" support vector.\n\n    The method returns rho parameter of the decision function, a scalar subtracted from the weighted\n    sum of kernel responses.\n     */\n    CV_WRAP virtual double getDecisionFunction(int i, OutputArray alpha, OutputArray svidx) const = 0;\n\n    /** @brief Generates a grid for %SVM parameters.\n\n    @param param_id %SVM parameters IDs that must be one of the SVM::ParamTypes. The grid is\n    generated for the parameter with this ID.\n\n    The function generates a grid for the specified parameter of the %SVM algorithm. The grid may be\n    passed to the function SVM::trainAuto.\n     */\n    static ParamGrid getDefaultGrid( int param_id );\n\n    /** @brief Generates a grid for %SVM parameters.\n\n    @param param_id %SVM parameters IDs that must be one of the SVM::ParamTypes. The grid is\n    generated for the parameter with this ID.\n\n    The function generates a grid pointer for the specified parameter of the %SVM algorithm.\n    The grid may be passed to the function SVM::trainAuto.\n     */\n    CV_WRAP static Ptr<ParamGrid> getDefaultGridPtr( int param_id );\n\n    /** Creates empty model.\n    Use StatModel::train to train the model. Since %SVM has several parameters, you may want to\n    find the best parameters for your problem, it can be done with SVM::trainAuto. */\n    CV_WRAP static Ptr<SVM> create();\n\n    /** @brief Loads and creates a serialized svm from a file\n     *\n     * Use SVM::save to serialize and store an SVM to disk.\n     * Load the SVM from this file again, by calling this function with the path to the file.\n     *\n     * @param filepath path to serialized svm\n     */\n    CV_WRAP static Ptr<SVM> load(const String& filepath);\n};\n\n/****************************************************************************************\\\n*                              Expectation - Maximization                                *\n\\****************************************************************************************/\n\n/** @brief The class implements the Expectation Maximization algorithm.\n\n@sa @ref ml_intro_em\n */\nclass CV_EXPORTS_W EM : public StatModel\n{\npublic:\n    //! Type of covariation matrices\n    enum Types {\n        /** A scaled identity matrix \\f$\\mu_k * I\\f$. There is the only\n        parameter \\f$\\mu_k\\f$ to be estimated for each matrix. The option may be used in special cases,\n        when the constraint is relevant, or as a first step in the optimization (for example in case\n        when the data is preprocessed with PCA). The results of such preliminary estimation may be\n        passed again to the optimization procedure, this time with\n        covMatType=EM::COV_MAT_DIAGONAL. */\n        COV_MAT_SPHERICAL=0,\n        /** A diagonal matrix with positive diagonal elements. The number of\n        free parameters is d for each matrix. This is most commonly used option yielding good\n        estimation results. */\n        COV_MAT_DIAGONAL=1,\n        /** A symmetric positively defined matrix. The number of free\n        parameters in each matrix is about \\f$d^2/2\\f$. It is not recommended to use this option, unless\n        there is pretty accurate initial estimation of the parameters and/or a huge number of\n        training samples. */\n        COV_MAT_GENERIC=2,\n        COV_MAT_DEFAULT=COV_MAT_DIAGONAL\n    };\n\n    //! Default parameters\n    enum {DEFAULT_NCLUSTERS=5, DEFAULT_MAX_ITERS=100};\n\n    //! The initial step\n    enum {START_E_STEP=1, START_M_STEP=2, START_AUTO_STEP=0};\n\n    /** The number of mixture components in the Gaussian mixture model.\n    Default value of the parameter is EM::DEFAULT_NCLUSTERS=5. Some of %EM implementation could\n    determine the optimal number of mixtures within a specified value range, but that is not the\n    case in ML yet. */\n    /** @see setClustersNumber */\n    CV_WRAP virtual int getClustersNumber() const = 0;\n    /** @copybrief getClustersNumber @see getClustersNumber */\n    CV_WRAP virtual void setClustersNumber(int val) = 0;\n\n    /** Constraint on covariance matrices which defines type of matrices.\n    See EM::Types. */\n    /** @see setCovarianceMatrixType */\n    CV_WRAP virtual int getCovarianceMatrixType() const = 0;\n    /** @copybrief getCovarianceMatrixType @see getCovarianceMatrixType */\n    CV_WRAP virtual void setCovarianceMatrixType(int val) = 0;\n\n    /** The termination criteria of the %EM algorithm.\n    The %EM algorithm can be terminated by the number of iterations termCrit.maxCount (number of\n    M-steps) or when relative change of likelihood logarithm is less than termCrit.epsilon. Default\n    maximum number of iterations is EM::DEFAULT_MAX_ITERS=100. */\n    /** @see setTermCriteria */\n    CV_WRAP virtual TermCriteria getTermCriteria() const = 0;\n    /** @copybrief getTermCriteria @see getTermCriteria */\n    CV_WRAP virtual void setTermCriteria(const TermCriteria &val) = 0;\n\n    /** @brief Returns weights of the mixtures\n\n    Returns vector with the number of elements equal to the number of mixtures.\n     */\n    CV_WRAP virtual Mat getWeights() const = 0;\n    /** @brief Returns the cluster centers (means of the Gaussian mixture)\n\n    Returns matrix with the number of rows equal to the number of mixtures and number of columns\n    equal to the space dimensionality.\n     */\n    CV_WRAP virtual Mat getMeans() const = 0;\n    /** @brief Returns covariation matrices\n\n    Returns vector of covariation matrices. Number of matrices is the number of gaussian mixtures,\n    each matrix is a square floating-point matrix NxN, where N is the space dimensionality.\n     */\n    CV_WRAP virtual void getCovs(CV_OUT std::vector<Mat>& covs) const = 0;\n\n    /** @brief Returns posterior probabilities for the provided samples\n\n    @param samples The input samples, floating-point matrix\n    @param results The optional output \\f$ nSamples \\times nClusters\\f$ matrix of results. It contains\n    posterior probabilities for each sample from the input\n    @param flags This parameter will be ignored\n     */\n    CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const CV_OVERRIDE = 0;\n\n    /** @brief Returns a likelihood logarithm value and an index of the most probable mixture component\n    for the given sample.\n\n    @param sample A sample for classification. It should be a one-channel matrix of\n        \\f$1 \\times dims\\f$ or \\f$dims \\times 1\\f$ size.\n    @param probs Optional output matrix that contains posterior probabilities of each component\n        given the sample. It has \\f$1 \\times nclusters\\f$ size and CV_64FC1 type.\n\n    The method returns a two-element double vector. Zero element is a likelihood logarithm value for\n    the sample. First element is an index of the most probable mixture component for the given\n    sample.\n     */\n    CV_WRAP virtual Vec2d predict2(InputArray sample, OutputArray probs) const = 0;\n\n    /** @brief Estimate the Gaussian mixture parameters from a samples set.\n\n    This variation starts with Expectation step. Initial values of the model parameters will be\n    estimated by the k-means algorithm.\n\n    Unlike many of the ML models, %EM is an unsupervised learning algorithm and it does not take\n    responses (class labels or function values) as input. Instead, it computes the *Maximum\n    Likelihood Estimate* of the Gaussian mixture parameters from an input sample set, stores all the\n    parameters inside the structure: \\f$p_{i,k}\\f$ in probs, \\f$a_k\\f$ in means , \\f$S_k\\f$ in\n    covs[k], \\f$\\pi_k\\f$ in weights , and optionally computes the output \"class label\" for each\n    sample: \\f$\\texttt{labels}_i=\\texttt{arg max}_k(p_{i,k}), i=1..N\\f$ (indices of the most\n    probable mixture component for each sample).\n\n    The trained model can be used further for prediction, just like any other classifier. The\n    trained model is similar to the NormalBayesClassifier.\n\n    @param samples Samples from which the Gaussian mixture model will be estimated. It should be a\n        one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type\n        it will be converted to the inner matrix of such type for the further computing.\n    @param logLikelihoods The optional output matrix that contains a likelihood logarithm value for\n        each sample. It has \\f$nsamples \\times 1\\f$ size and CV_64FC1 type.\n    @param labels The optional output \"class label\" for each sample:\n        \\f$\\texttt{labels}_i=\\texttt{arg max}_k(p_{i,k}), i=1..N\\f$ (indices of the most probable\n        mixture component for each sample). It has \\f$nsamples \\times 1\\f$ size and CV_32SC1 type.\n    @param probs The optional output matrix that contains posterior probabilities of each Gaussian\n        mixture component given the each sample. It has \\f$nsamples \\times nclusters\\f$ size and\n        CV_64FC1 type.\n     */\n    CV_WRAP virtual bool trainEM(InputArray samples,\n                         OutputArray logLikelihoods=noArray(),\n                         OutputArray labels=noArray(),\n                         OutputArray probs=noArray()) = 0;\n\n    /** @brief Estimate the Gaussian mixture parameters from a samples set.\n\n    This variation starts with Expectation step. You need to provide initial means \\f$a_k\\f$ of\n    mixture components. Optionally you can pass initial weights \\f$\\pi_k\\f$ and covariance matrices\n    \\f$S_k\\f$ of mixture components.\n\n    @param samples Samples from which the Gaussian mixture model will be estimated. It should be a\n        one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type\n        it will be converted to the inner matrix of such type for the further computing.\n    @param means0 Initial means \\f$a_k\\f$ of mixture components. It is a one-channel matrix of\n        \\f$nclusters \\times dims\\f$ size. If the matrix does not have CV_64F type it will be\n        converted to the inner matrix of such type for the further computing.\n    @param covs0 The vector of initial covariance matrices \\f$S_k\\f$ of mixture components. Each of\n        covariance matrices is a one-channel matrix of \\f$dims \\times dims\\f$ size. If the matrices\n        do not have CV_64F type they will be converted to the inner matrices of such type for the\n        further computing.\n    @param weights0 Initial weights \\f$\\pi_k\\f$ of mixture components. It should be a one-channel\n        floating-point matrix with \\f$1 \\times nclusters\\f$ or \\f$nclusters \\times 1\\f$ size.\n    @param logLikelihoods The optional output matrix that contains a likelihood logarithm value for\n        each sample. It has \\f$nsamples \\times 1\\f$ size and CV_64FC1 type.\n    @param labels The optional output \"class label\" for each sample:\n        \\f$\\texttt{labels}_i=\\texttt{arg max}_k(p_{i,k}), i=1..N\\f$ (indices of the most probable\n        mixture component for each sample). It has \\f$nsamples \\times 1\\f$ size and CV_32SC1 type.\n    @param probs The optional output matrix that contains posterior probabilities of each Gaussian\n        mixture component given the each sample. It has \\f$nsamples \\times nclusters\\f$ size and\n        CV_64FC1 type.\n    */\n    CV_WRAP virtual bool trainE(InputArray samples, InputArray means0,\n                        InputArray covs0=noArray(),\n                        InputArray weights0=noArray(),\n                        OutputArray logLikelihoods=noArray(),\n                        OutputArray labels=noArray(),\n                        OutputArray probs=noArray()) = 0;\n\n    /** @brief Estimate the Gaussian mixture parameters from a samples set.\n\n    This variation starts with Maximization step. You need to provide initial probabilities\n    \\f$p_{i,k}\\f$ to use this option.\n\n    @param samples Samples from which the Gaussian mixture model will be estimated. It should be a\n        one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type\n        it will be converted to the inner matrix of such type for the further computing.\n    @param probs0 the probabilities\n    @param logLikelihoods The optional output matrix that contains a likelihood logarithm value for\n        each sample. It has \\f$nsamples \\times 1\\f$ size and CV_64FC1 type.\n    @param labels The optional output \"class label\" for each sample:\n        \\f$\\texttt{labels}_i=\\texttt{arg max}_k(p_{i,k}), i=1..N\\f$ (indices of the most probable\n        mixture component for each sample). It has \\f$nsamples \\times 1\\f$ size and CV_32SC1 type.\n    @param probs The optional output matrix that contains posterior probabilities of each Gaussian\n        mixture component given the each sample. It has \\f$nsamples \\times nclusters\\f$ size and\n        CV_64FC1 type.\n    */\n    CV_WRAP virtual bool trainM(InputArray samples, InputArray probs0,\n                        OutputArray logLikelihoods=noArray(),\n                        OutputArray labels=noArray(),\n                        OutputArray probs=noArray()) = 0;\n\n    /** Creates empty %EM model.\n    The model should be trained then using StatModel::train(traindata, flags) method. Alternatively, you\n    can use one of the EM::train\\* methods or load it from file using Algorithm::load\\<EM\\>(filename).\n     */\n    CV_WRAP static Ptr<EM> create();\n\n    /** @brief Loads and creates a serialized EM from a file\n     *\n     * Use EM::save to serialize and store an EM to disk.\n     * Load the EM from this file again, by calling this function with the path to the file.\n     * Optionally specify the node for the file containing the classifier\n     *\n     * @param filepath path to serialized EM\n     * @param nodeName name of node containing the classifier\n     */\n    CV_WRAP static Ptr<EM> load(const String& filepath , const String& nodeName = String());\n};\n\n/****************************************************************************************\\\n*                                      Decision Tree                                     *\n\\****************************************************************************************/\n\n/** @brief The class represents a single decision tree or a collection of decision trees.\n\nThe current public interface of the class allows user to train only a single decision tree, however\nthe class is capable of storing multiple decision trees and using them for prediction (by summing\nresponses or using a voting schemes), and the derived from DTrees classes (such as RTrees and Boost)\nuse this capability to implement decision tree ensembles.\n\n@sa @ref ml_intro_trees\n*/\nclass CV_EXPORTS_W DTrees : public StatModel\n{\npublic:\n    /** Predict options */\n    enum Flags { PREDICT_AUTO=0, PREDICT_SUM=(1<<8), PREDICT_MAX_VOTE=(2<<8), PREDICT_MASK=(3<<8) };\n\n    /** Cluster possible values of a categorical variable into K\\<=maxCategories clusters to\n    find a suboptimal split.\n    If a discrete variable, on which the training procedure tries to make a split, takes more than\n    maxCategories values, the precise best subset estimation may take a very long time because the\n    algorithm is exponential. Instead, many decision trees engines (including our implementation)\n    try to find sub-optimal split in this case by clustering all the samples into maxCategories\n    clusters that is some categories are merged together. The clustering is applied only in n \\>\n    2-class classification problems for categorical variables with N \\> max_categories possible\n    values. In case of regression and 2-class classification the optimal split can be found\n    efficiently without employing clustering, thus the parameter is not used in these cases.\n    Default value is 10.*/\n    /** @see setMaxCategories */\n    CV_WRAP virtual int getMaxCategories() const = 0;\n    /** @copybrief getMaxCategories @see getMaxCategories */\n    CV_WRAP virtual void setMaxCategories(int val) = 0;\n\n    /** The maximum possible depth of the tree.\n    That is the training algorithms attempts to split a node while its depth is less than maxDepth.\n    The root node has zero depth. The actual depth may be smaller if the other termination criteria\n    are met (see the outline of the training procedure @ref ml_intro_trees \"here\"), and/or if the\n    tree is pruned. Default value is INT_MAX.*/\n    /** @see setMaxDepth */\n    CV_WRAP virtual int getMaxDepth() const = 0;\n    /** @copybrief getMaxDepth @see getMaxDepth */\n    CV_WRAP virtual void setMaxDepth(int val) = 0;\n\n    /** If the number of samples in a node is less than this parameter then the node will not be split.\n\n    Default value is 10.*/\n    /** @see setMinSampleCount */\n    CV_WRAP virtual int getMinSampleCount() const = 0;\n    /** @copybrief getMinSampleCount @see getMinSampleCount */\n    CV_WRAP virtual void setMinSampleCount(int val) = 0;\n\n    /** If CVFolds \\> 1 then algorithms prunes the built decision tree using K-fold\n    cross-validation procedure where K is equal to CVFolds.\n    Default value is 10.*/\n    /** @see setCVFolds */\n    CV_WRAP virtual int getCVFolds() const = 0;\n    /** @copybrief getCVFolds @see getCVFolds */\n    CV_WRAP virtual void setCVFolds(int val) = 0;\n\n    /** If true then surrogate splits will be built.\n    These splits allow to work with missing data and compute variable importance correctly.\n    Default value is false.\n    @note currently it's not implemented.*/\n    /** @see setUseSurrogates */\n    CV_WRAP virtual bool getUseSurrogates() const = 0;\n    /** @copybrief getUseSurrogates @see getUseSurrogates */\n    CV_WRAP virtual void setUseSurrogates(bool val) = 0;\n\n    /** If true then a pruning will be harsher.\n    This will make a tree more compact and more resistant to the training data noise but a bit less\n    accurate. Default value is true.*/\n    /** @see setUse1SERule */\n    CV_WRAP virtual bool getUse1SERule() const = 0;\n    /** @copybrief getUse1SERule @see getUse1SERule */\n    CV_WRAP virtual void setUse1SERule(bool val) = 0;\n\n    /** If true then pruned branches are physically removed from the tree.\n    Otherwise they are retained and it is possible to get results from the original unpruned (or\n    pruned less aggressively) tree. Default value is true.*/\n    /** @see setTruncatePrunedTree */\n    CV_WRAP virtual bool getTruncatePrunedTree() const = 0;\n    /** @copybrief getTruncatePrunedTree @see getTruncatePrunedTree */\n    CV_WRAP virtual void setTruncatePrunedTree(bool val) = 0;\n\n    /** Termination criteria for regression trees.\n    If all absolute differences between an estimated value in a node and values of train samples\n    in this node are less than this parameter then the node will not be split further. Default\n    value is 0.01f*/\n    /** @see setRegressionAccuracy */\n    CV_WRAP virtual float getRegressionAccuracy() const = 0;\n    /** @copybrief getRegressionAccuracy @see getRegressionAccuracy */\n    CV_WRAP virtual void setRegressionAccuracy(float val) = 0;\n\n    /** @brief The array of a priori class probabilities, sorted by the class label value.\n\n    The parameter can be used to tune the decision tree preferences toward a certain class. For\n    example, if you want to detect some rare anomaly occurrence, the training base will likely\n    contain much more normal cases than anomalies, so a very good classification performance\n    will be achieved just by considering every case as normal. To avoid this, the priors can be\n    specified, where the anomaly probability is artificially increased (up to 0.5 or even\n    greater), so the weight of the misclassified anomalies becomes much bigger, and the tree is\n    adjusted properly.\n\n    You can also think about this parameter as weights of prediction categories which determine\n    relative weights that you give to misclassification. That is, if the weight of the first\n    category is 1 and the weight of the second category is 10, then each mistake in predicting\n    the second category is equivalent to making 10 mistakes in predicting the first category.\n    Default value is empty Mat.*/\n    /** @see setPriors */\n    CV_WRAP virtual cv::Mat getPriors() const = 0;\n    /** @copybrief getPriors @see getPriors */\n    CV_WRAP virtual void setPriors(const cv::Mat &val) = 0;\n\n    /** @brief The class represents a decision tree node.\n     */\n    class CV_EXPORTS Node\n    {\n    public:\n        Node();\n        double value; //!< Value at the node: a class label in case of classification or estimated\n                      //!< function value in case of regression.\n        int classIdx; //!< Class index normalized to 0..class_count-1 range and assigned to the\n                      //!< node. It is used internally in classification trees and tree ensembles.\n        int parent; //!< Index of the parent node\n        int left; //!< Index of the left child node\n        int right; //!< Index of right child node\n        int defaultDir; //!< Default direction where to go (-1: left or +1: right). It helps in the\n                        //!< case of missing values.\n        int split; //!< Index of the first split\n    };\n\n    /** @brief The class represents split in a decision tree.\n     */\n    class CV_EXPORTS Split\n    {\n    public:\n        Split();\n        int varIdx; //!< Index of variable on which the split is created.\n        bool inversed; //!< If true, then the inverse split rule is used (i.e. left and right\n                       //!< branches are exchanged in the rule expressions below).\n        float quality; //!< The split quality, a positive number. It is used to choose the best split.\n        int next; //!< Index of the next split in the list of splits for the node\n        float c; /**< The threshold value in case of split on an ordered variable.\n                      The rule is:\n                      @code{.none}\n                      if var_value < c\n                        then next_node <- left\n                        else next_node <- right\n                      @endcode */\n        int subsetOfs; /**< Offset of the bitset used by the split on a categorical variable.\n                            The rule is:\n                            @code{.none}\n                            if bitset[var_value] == 1\n                                then next_node <- left\n                                else next_node <- right\n                            @endcode */\n    };\n\n    /** @brief Returns indices of root nodes\n    */\n    virtual const std::vector<int>& getRoots() const = 0;\n    /** @brief Returns all the nodes\n\n    all the node indices are indices in the returned vector\n     */\n    virtual const std::vector<Node>& getNodes() const = 0;\n    /** @brief Returns all the splits\n\n    all the split indices are indices in the returned vector\n     */\n    virtual const std::vector<Split>& getSplits() const = 0;\n    /** @brief Returns all the bitsets for categorical splits\n\n    Split::subsetOfs is an offset in the returned vector\n     */\n    virtual const std::vector<int>& getSubsets() const = 0;\n\n    /** @brief Creates the empty model\n\n    The static method creates empty decision tree with the specified parameters. It should be then\n    trained using train method (see StatModel::train). Alternatively, you can load the model from\n    file using Algorithm::load\\<DTrees\\>(filename).\n     */\n    CV_WRAP static Ptr<DTrees> create();\n\n    /** @brief Loads and creates a serialized DTrees from a file\n     *\n     * Use DTree::save to serialize and store an DTree to disk.\n     * Load the DTree from this file again, by calling this function with the path to the file.\n     * Optionally specify the node for the file containing the classifier\n     *\n     * @param filepath path to serialized DTree\n     * @param nodeName name of node containing the classifier\n     */\n    CV_WRAP static Ptr<DTrees> load(const String& filepath , const String& nodeName = String());\n};\n\n/****************************************************************************************\\\n*                                   Random Trees Classifier                              *\n\\****************************************************************************************/\n\n/** @brief The class implements the random forest predictor.\n\n@sa @ref ml_intro_rtrees\n */\nclass CV_EXPORTS_W RTrees : public DTrees\n{\npublic:\n\n    /** If true then variable importance will be calculated and then it can be retrieved by RTrees::getVarImportance.\n    Default value is false.*/\n    /** @see setCalculateVarImportance */\n    CV_WRAP virtual bool getCalculateVarImportance() const = 0;\n    /** @copybrief getCalculateVarImportance @see getCalculateVarImportance */\n    CV_WRAP virtual void setCalculateVarImportance(bool val) = 0;\n\n    /** The size of the randomly selected subset of features at each tree node and that are used\n    to find the best split(s).\n    If you set it to 0 then the size will be set to the square root of the total number of\n    features. Default value is 0.*/\n    /** @see setActiveVarCount */\n    CV_WRAP virtual int getActiveVarCount() const = 0;\n    /** @copybrief getActiveVarCount @see getActiveVarCount */\n    CV_WRAP virtual void setActiveVarCount(int val) = 0;\n\n    /** The termination criteria that specifies when the training algorithm stops.\n    Either when the specified number of trees is trained and added to the ensemble or when\n    sufficient accuracy (measured as OOB error) is achieved. Typically the more trees you have the\n    better the accuracy. However, the improvement in accuracy generally diminishes and asymptotes\n    pass a certain number of trees. Also to keep in mind, the number of tree increases the\n    prediction time linearly. Default value is TermCriteria(TermCriteria::MAX_ITERS +\n    TermCriteria::EPS, 50, 0.1)*/\n    /** @see setTermCriteria */\n    CV_WRAP virtual TermCriteria getTermCriteria() const = 0;\n    /** @copybrief getTermCriteria @see getTermCriteria */\n    CV_WRAP virtual void setTermCriteria(const TermCriteria &val) = 0;\n\n    /** Returns the variable importance array.\n    The method returns the variable importance vector, computed at the training stage when\n    CalculateVarImportance is set to true. If this flag was set to false, the empty matrix is\n    returned.\n     */\n    CV_WRAP virtual Mat getVarImportance() const = 0;\n\n    /** Returns the result of each individual tree in the forest.\n    In case the model is a regression problem, the method will return each of the trees'\n    results for each of the sample cases. If the model is a classifier, it will return\n    a Mat with samples + 1 rows, where the first row gives the class number and the\n    following rows return the votes each class had for each sample.\n        @param samples Array containing the samples for which votes will be calculated.\n        @param results Array where the result of the calculation will be written.\n        @param flags Flags for defining the type of RTrees.\n    */\n    CV_WRAP virtual void getVotes(InputArray samples, OutputArray results, int flags) const = 0;\n\n    /** Returns the OOB error value, computed at the training stage when calcOOBError is set to true.\n     * If this flag was set to false, 0 is returned. The OOB error is also scaled by sample weighting.\n     */\n#if CV_VERSION_MAJOR == 4\n    CV_WRAP virtual double getOOBError() const { return 0; }\n#else\n    /*CV_WRAP*/ virtual double getOOBError() const = 0;\n#endif\n\n    /** Creates the empty model.\n    Use StatModel::train to train the model, StatModel::train to create and train the model,\n    Algorithm::load to load the pre-trained model.\n     */\n    CV_WRAP static Ptr<RTrees> create();\n\n    /** @brief Loads and creates a serialized RTree from a file\n     *\n     * Use RTree::save to serialize and store an RTree to disk.\n     * Load the RTree from this file again, by calling this function with the path to the file.\n     * Optionally specify the node for the file containing the classifier\n     *\n     * @param filepath path to serialized RTree\n     * @param nodeName name of node containing the classifier\n     */\n    CV_WRAP static Ptr<RTrees> load(const String& filepath , const String& nodeName = String());\n};\n\n/****************************************************************************************\\\n*                                   Boosted tree classifier                              *\n\\****************************************************************************************/\n\n/** @brief Boosted tree classifier derived from DTrees\n\n@sa @ref ml_intro_boost\n */\nclass CV_EXPORTS_W Boost : public DTrees\n{\npublic:\n    /** Type of the boosting algorithm.\n    See Boost::Types. Default value is Boost::REAL. */\n    /** @see setBoostType */\n    CV_WRAP virtual int getBoostType() const = 0;\n    /** @copybrief getBoostType @see getBoostType */\n    CV_WRAP virtual void setBoostType(int val) = 0;\n\n    /** The number of weak classifiers.\n    Default value is 100. */\n    /** @see setWeakCount */\n    CV_WRAP virtual int getWeakCount() const = 0;\n    /** @copybrief getWeakCount @see getWeakCount */\n    CV_WRAP virtual void setWeakCount(int val) = 0;\n\n    /** A threshold between 0 and 1 used to save computational time.\n    Samples with summary weight \\f$\\leq 1 - weight_trim_rate\\f$ do not participate in the *next*\n    iteration of training. Set this parameter to 0 to turn off this functionality. Default value is 0.95.*/\n    /** @see setWeightTrimRate */\n    CV_WRAP virtual double getWeightTrimRate() const = 0;\n    /** @copybrief getWeightTrimRate @see getWeightTrimRate */\n    CV_WRAP virtual void setWeightTrimRate(double val) = 0;\n\n    /** Boosting type.\n    Gentle AdaBoost and Real AdaBoost are often the preferable choices. */\n    enum Types {\n        DISCRETE=0, //!< Discrete AdaBoost.\n        REAL=1, //!< Real AdaBoost. It is a technique that utilizes confidence-rated predictions\n                //!< and works well with categorical data.\n        LOGIT=2, //!< LogitBoost. It can produce good regression fits.\n        GENTLE=3 //!< Gentle AdaBoost. It puts less weight on outlier data points and for that\n                 //!<reason is often good with regression data.\n    };\n\n    /** Creates the empty model.\n    Use StatModel::train to train the model, Algorithm::load\\<Boost\\>(filename) to load the pre-trained model. */\n    CV_WRAP static Ptr<Boost> create();\n\n    /** @brief Loads and creates a serialized Boost from a file\n     *\n     * Use Boost::save to serialize and store an RTree to disk.\n     * Load the Boost from this file again, by calling this function with the path to the file.\n     * Optionally specify the node for the file containing the classifier\n     *\n     * @param filepath path to serialized Boost\n     * @param nodeName name of node containing the classifier\n     */\n    CV_WRAP static Ptr<Boost> load(const String& filepath , const String& nodeName = String());\n};\n\n/****************************************************************************************\\\n*                                   Gradient Boosted Trees                               *\n\\****************************************************************************************/\n\n/*class CV_EXPORTS_W GBTrees : public DTrees\n{\npublic:\n    struct CV_EXPORTS_W_MAP Params : public DTrees::Params\n    {\n        CV_PROP_RW int weakCount;\n        CV_PROP_RW int lossFunctionType;\n        CV_PROP_RW float subsamplePortion;\n        CV_PROP_RW float shrinkage;\n\n        Params();\n        Params( int lossFunctionType, int weakCount, float shrinkage,\n                float subsamplePortion, int maxDepth, bool useSurrogates );\n    };\n\n    enum {SQUARED_LOSS=0, ABSOLUTE_LOSS, HUBER_LOSS=3, DEVIANCE_LOSS};\n\n    virtual void setK(int k) = 0;\n\n    virtual float predictSerial( InputArray samples,\n                                 OutputArray weakResponses, int flags) const = 0;\n\n    static Ptr<GBTrees> create(const Params& p);\n};*/\n\n/****************************************************************************************\\\n*                              Artificial Neural Networks (ANN)                          *\n\\****************************************************************************************/\n\n/////////////////////////////////// Multi-Layer Perceptrons //////////////////////////////\n\n/** @brief Artificial Neural Networks - Multi-Layer Perceptrons.\n\nUnlike many other models in ML that are constructed and trained at once, in the MLP model these\nsteps are separated. First, a network with the specified topology is created using the non-default\nconstructor or the method ANN_MLP::create. All the weights are set to zeros. Then, the network is\ntrained using a set of input and output vectors. The training procedure can be repeated more than\nonce, that is, the weights can be adjusted based on the new training data.\n\nAdditional flags for StatModel::train are available: ANN_MLP::TrainFlags.\n\n@sa @ref ml_intro_ann\n */\nclass CV_EXPORTS_W ANN_MLP : public StatModel\n{\npublic:\n    /** Available training methods */\n    enum TrainingMethods {\n        BACKPROP=0, //!< The back-propagation algorithm.\n        RPROP = 1, //!< The RPROP algorithm. See @cite RPROP93 for details.\n        ANNEAL = 2 //!< The simulated annealing algorithm. See @cite Kirkpatrick83 for details.\n    };\n\n    /** Sets training method and common parameters.\n    @param method Default value is ANN_MLP::RPROP. See ANN_MLP::TrainingMethods.\n    @param param1 passed to setRpropDW0 for ANN_MLP::RPROP and to setBackpropWeightScale for ANN_MLP::BACKPROP and to initialT for ANN_MLP::ANNEAL.\n    @param param2 passed to setRpropDWMin for ANN_MLP::RPROP and to setBackpropMomentumScale for ANN_MLP::BACKPROP and to finalT for ANN_MLP::ANNEAL.\n    */\n    CV_WRAP virtual void setTrainMethod(int method, double param1 = 0, double param2 = 0) = 0;\n\n    /** Returns current training method */\n    CV_WRAP virtual int getTrainMethod() const = 0;\n\n    /** Initialize the activation function for each neuron.\n    Currently the default and the only fully supported activation function is ANN_MLP::SIGMOID_SYM.\n    @param type The type of activation function. See ANN_MLP::ActivationFunctions.\n    @param param1 The first parameter of the activation function, \\f$\\alpha\\f$. Default value is 0.\n    @param param2 The second parameter of the activation function, \\f$\\beta\\f$. Default value is 0.\n    */\n    CV_WRAP virtual void setActivationFunction(int type, double param1 = 0, double param2 = 0) = 0;\n\n    /**  Integer vector specifying the number of neurons in each layer including the input and output layers.\n    The very first element specifies the number of elements in the input layer.\n    The last element - number of elements in the output layer. Default value is empty Mat.\n    @sa getLayerSizes */\n    CV_WRAP virtual void setLayerSizes(InputArray _layer_sizes) = 0;\n\n    /**  Integer vector specifying the number of neurons in each layer including the input and output layers.\n    The very first element specifies the number of elements in the input layer.\n    The last element - number of elements in the output layer.\n    @sa setLayerSizes */\n    CV_WRAP virtual cv::Mat getLayerSizes() const = 0;\n\n    /** Termination criteria of the training algorithm.\n    You can specify the maximum number of iterations (maxCount) and/or how much the error could\n    change between the iterations to make the algorithm continue (epsilon). Default value is\n    TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, 0.01).*/\n    /** @see setTermCriteria */\n    CV_WRAP virtual TermCriteria getTermCriteria() const = 0;\n    /** @copybrief getTermCriteria @see getTermCriteria */\n    CV_WRAP virtual void setTermCriteria(TermCriteria val) = 0;\n\n    /** BPROP: Strength of the weight gradient term.\n    The recommended value is about 0.1. Default value is 0.1.*/\n    /** @see setBackpropWeightScale */\n    CV_WRAP virtual double getBackpropWeightScale() const = 0;\n    /** @copybrief getBackpropWeightScale @see getBackpropWeightScale */\n    CV_WRAP virtual void setBackpropWeightScale(double val) = 0;\n\n    /** BPROP: Strength of the momentum term (the difference between weights on the 2 previous iterations).\n    This parameter provides some inertia to smooth the random fluctuations of the weights. It can\n    vary from 0 (the feature is disabled) to 1 and beyond. The value 0.1 or so is good enough.\n    Default value is 0.1.*/\n    /** @see setBackpropMomentumScale */\n    CV_WRAP virtual double getBackpropMomentumScale() const = 0;\n    /** @copybrief getBackpropMomentumScale @see getBackpropMomentumScale */\n    CV_WRAP virtual void setBackpropMomentumScale(double val) = 0;\n\n    /** RPROP: Initial value \\f$\\Delta_0\\f$ of update-values \\f$\\Delta_{ij}\\f$.\n    Default value is 0.1.*/\n    /** @see setRpropDW0 */\n    CV_WRAP virtual double getRpropDW0() const = 0;\n    /** @copybrief getRpropDW0 @see getRpropDW0 */\n    CV_WRAP virtual void setRpropDW0(double val) = 0;\n\n    /** RPROP: Increase factor \\f$\\eta^+\\f$.\n    It must be \\>1. Default value is 1.2.*/\n    /** @see setRpropDWPlus */\n    CV_WRAP virtual double getRpropDWPlus() const = 0;\n    /** @copybrief getRpropDWPlus @see getRpropDWPlus */\n    CV_WRAP virtual void setRpropDWPlus(double val) = 0;\n\n    /** RPROP: Decrease factor \\f$\\eta^-\\f$.\n    It must be \\<1. Default value is 0.5.*/\n    /** @see setRpropDWMinus */\n    CV_WRAP virtual double getRpropDWMinus() const = 0;\n    /** @copybrief getRpropDWMinus @see getRpropDWMinus */\n    CV_WRAP virtual void setRpropDWMinus(double val) = 0;\n\n    /** RPROP: Update-values lower limit \\f$\\Delta_{min}\\f$.\n    It must be positive. Default value is FLT_EPSILON.*/\n    /** @see setRpropDWMin */\n    CV_WRAP virtual double getRpropDWMin() const = 0;\n    /** @copybrief getRpropDWMin @see getRpropDWMin */\n    CV_WRAP virtual void setRpropDWMin(double val) = 0;\n\n    /** RPROP: Update-values upper limit \\f$\\Delta_{max}\\f$.\n    It must be \\>1. Default value is 50.*/\n    /** @see setRpropDWMax */\n    CV_WRAP virtual double getRpropDWMax() const = 0;\n    /** @copybrief getRpropDWMax @see getRpropDWMax */\n    CV_WRAP virtual void setRpropDWMax(double val) = 0;\n\n    /** ANNEAL: Update initial temperature.\n    It must be \\>=0. Default value is 10.*/\n    /** @see setAnnealInitialT */\n    CV_WRAP virtual double getAnnealInitialT() const = 0;\n    /** @copybrief getAnnealInitialT @see getAnnealInitialT */\n    CV_WRAP virtual void setAnnealInitialT(double val) = 0;\n\n    /** ANNEAL: Update final temperature.\n    It must be \\>=0 and less than initialT. Default value is 0.1.*/\n    /** @see setAnnealFinalT */\n    CV_WRAP virtual double getAnnealFinalT() const = 0;\n    /** @copybrief getAnnealFinalT @see getAnnealFinalT */\n    CV_WRAP virtual void setAnnealFinalT(double val) = 0;\n\n    /** ANNEAL: Update cooling ratio.\n    It must be \\>0 and less than 1. Default value is 0.95.*/\n    /** @see setAnnealCoolingRatio */\n    CV_WRAP virtual double getAnnealCoolingRatio() const = 0;\n    /** @copybrief getAnnealCoolingRatio @see getAnnealCoolingRatio */\n    CV_WRAP virtual void setAnnealCoolingRatio(double val) = 0;\n\n    /** ANNEAL: Update iteration per step.\n    It must be \\>0 . Default value is 10.*/\n    /** @see setAnnealItePerStep */\n    CV_WRAP virtual int getAnnealItePerStep() const = 0;\n    /** @copybrief getAnnealItePerStep @see getAnnealItePerStep */\n    CV_WRAP virtual void setAnnealItePerStep(int val) = 0;\n\n    /** @brief Set/initialize anneal RNG */\n    virtual void setAnnealEnergyRNG(const RNG& rng) = 0;\n\n    /** possible activation functions */\n    enum ActivationFunctions {\n        /** Identity function: \\f$f(x)=x\\f$ */\n        IDENTITY = 0,\n        /** Symmetrical sigmoid: \\f$f(x)=\\beta*(1-e^{-\\alpha x})/(1+e^{-\\alpha x})\\f$\n        @note\n        If you are using the default sigmoid activation function with the default parameter values\n        fparam1=0 and fparam2=0 then the function used is y = 1.7159\\*tanh(2/3 \\* x), so the output\n        will range from [-1.7159, 1.7159], instead of [0,1].*/\n        SIGMOID_SYM = 1,\n        /** Gaussian function: \\f$f(x)=\\beta e^{-\\alpha x*x}\\f$ */\n        GAUSSIAN = 2,\n        /** ReLU function: \\f$f(x)=max(0,x)\\f$ */\n        RELU = 3,\n        /** Leaky ReLU function: for x>0 \\f$f(x)=x \\f$ and x<=0 \\f$f(x)=\\alpha x \\f$*/\n        LEAKYRELU= 4\n    };\n\n    /** Train options */\n    enum TrainFlags {\n        /** Update the network weights, rather than compute them from scratch. In the latter case\n        the weights are initialized using the Nguyen-Widrow algorithm. */\n        UPDATE_WEIGHTS = 1,\n        /** Do not normalize the input vectors. If this flag is not set, the training algorithm\n        normalizes each input feature independently, shifting its mean value to 0 and making the\n        standard deviation equal to 1. If the network is assumed to be updated frequently, the new\n        training data could be much different from original one. In this case, you should take care\n        of proper normalization. */\n        NO_INPUT_SCALE = 2,\n        /** Do not normalize the output vectors. If the flag is not set, the training algorithm\n        normalizes each output feature independently, by transforming it to the certain range\n        depending on the used activation function. */\n        NO_OUTPUT_SCALE = 4\n    };\n\n    CV_WRAP virtual Mat getWeights(int layerIdx) const = 0;\n\n    /** @brief Creates empty model\n\n    Use StatModel::train to train the model, Algorithm::load\\<ANN_MLP\\>(filename) to load the pre-trained model.\n    Note that the train method has optional flags: ANN_MLP::TrainFlags.\n     */\n    CV_WRAP static Ptr<ANN_MLP> create();\n\n    /** @brief Loads and creates a serialized ANN from a file\n     *\n     * Use ANN::save to serialize and store an ANN to disk.\n     * Load the ANN from this file again, by calling this function with the path to the file.\n     *\n     * @param filepath path to serialized ANN\n     */\n    CV_WRAP static Ptr<ANN_MLP> load(const String& filepath);\n\n};\n\n#ifndef DISABLE_OPENCV_3_COMPATIBILITY\ntypedef ANN_MLP ANN_MLP_ANNEAL;\n#endif\n\n/****************************************************************************************\\\n*                           Logistic Regression                                          *\n\\****************************************************************************************/\n\n/** @brief Implements Logistic Regression classifier.\n\n@sa @ref ml_intro_lr\n */\nclass CV_EXPORTS_W LogisticRegression : public StatModel\n{\npublic:\n\n    /** Learning rate. */\n    /** @see setLearningRate */\n    CV_WRAP virtual double getLearningRate() const = 0;\n    /** @copybrief getLearningRate @see getLearningRate */\n    CV_WRAP virtual void setLearningRate(double val) = 0;\n\n    /** Number of iterations. */\n    /** @see setIterations */\n    CV_WRAP virtual int getIterations() const = 0;\n    /** @copybrief getIterations @see getIterations */\n    CV_WRAP virtual void setIterations(int val) = 0;\n\n    /** Kind of regularization to be applied. See LogisticRegression::RegKinds. */\n    /** @see setRegularization */\n    CV_WRAP virtual int getRegularization() const = 0;\n    /** @copybrief getRegularization @see getRegularization */\n    CV_WRAP virtual void setRegularization(int val) = 0;\n\n    /** Kind of training method used. See LogisticRegression::Methods. */\n    /** @see setTrainMethod */\n    CV_WRAP virtual int getTrainMethod() const = 0;\n    /** @copybrief getTrainMethod @see getTrainMethod */\n    CV_WRAP virtual void setTrainMethod(int val) = 0;\n\n    /** Specifies the number of training samples taken in each step of Mini-Batch Gradient\n    Descent. Will only be used if using LogisticRegression::MINI_BATCH training algorithm. It\n    has to take values less than the total number of training samples. */\n    /** @see setMiniBatchSize */\n    CV_WRAP virtual int getMiniBatchSize() const = 0;\n    /** @copybrief getMiniBatchSize @see getMiniBatchSize */\n    CV_WRAP virtual void setMiniBatchSize(int val) = 0;\n\n    /** Termination criteria of the algorithm. */\n    /** @see setTermCriteria */\n    CV_WRAP virtual TermCriteria getTermCriteria() const = 0;\n    /** @copybrief getTermCriteria @see getTermCriteria */\n    CV_WRAP virtual void setTermCriteria(TermCriteria val) = 0;\n\n    //! Regularization kinds\n    enum RegKinds {\n        REG_DISABLE = -1, //!< Regularization disabled\n        REG_L1 = 0, //!< %L1 norm\n        REG_L2 = 1 //!< %L2 norm\n    };\n\n    //! Training methods\n    enum Methods {\n        BATCH = 0,\n        MINI_BATCH = 1 //!< Set MiniBatchSize to a positive integer when using this method.\n    };\n\n    /** @brief Predicts responses for input samples and returns a float type.\n\n    @param samples The input data for the prediction algorithm. Matrix [m x n], where each row\n        contains variables (features) of one object being classified. Should have data type CV_32F.\n    @param results Predicted labels as a column matrix of type CV_32S.\n    @param flags Not used.\n     */\n    CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const CV_OVERRIDE = 0;\n\n    /** @brief This function returns the trained parameters arranged across rows.\n\n    For a two class classification problem, it returns a row matrix. It returns learnt parameters of\n    the Logistic Regression as a matrix of type CV_32F.\n     */\n    CV_WRAP virtual Mat get_learnt_thetas() const = 0;\n\n    /** @brief Creates empty model.\n\n    Creates Logistic Regression model with parameters given.\n     */\n    CV_WRAP static Ptr<LogisticRegression> create();\n\n    /** @brief Loads and creates a serialized LogisticRegression from a file\n     *\n     * Use LogisticRegression::save to serialize and store an LogisticRegression to disk.\n     * Load the LogisticRegression from this file again, by calling this function with the path to the file.\n     * Optionally specify the node for the file containing the classifier\n     *\n     * @param filepath path to serialized LogisticRegression\n     * @param nodeName name of node containing the classifier\n     */\n    CV_WRAP static Ptr<LogisticRegression> load(const String& filepath , const String& nodeName = String());\n};\n\n\n/****************************************************************************************\\\n*                        Stochastic Gradient Descent SVM Classifier                      *\n\\****************************************************************************************/\n\n/*!\n@brief Stochastic Gradient Descent SVM classifier\n\nSVMSGD provides a fast and easy-to-use implementation of the SVM classifier using the Stochastic Gradient Descent approach,\nas presented in @cite bottou2010large.\n\nThe classifier has following parameters:\n- model type,\n- margin type,\n- margin regularization (\\f$\\lambda\\f$),\n- initial step size (\\f$\\gamma_0\\f$),\n- step decreasing power (\\f$c\\f$),\n- and termination criteria.\n\nThe model type may have one of the following values: \\ref SGD and \\ref ASGD.\n\n- \\ref SGD is the classic version of SVMSGD classifier: every next step is calculated by the formula\n  \\f[w_{t+1} = w_t - \\gamma(t) \\frac{dQ_i}{dw} |_{w = w_t}\\f]\n  where\n  - \\f$w_t\\f$ is the weights vector for decision function at step \\f$t\\f$,\n  - \\f$\\gamma(t)\\f$ is the step size of model parameters at the iteration \\f$t\\f$, it is decreased on each step by the formula\n    \\f$\\gamma(t) = \\gamma_0  (1 + \\lambda  \\gamma_0 t) ^ {-c}\\f$\n  - \\f$Q_i\\f$ is the target functional from SVM task for sample with number \\f$i\\f$, this sample is chosen stochastically on each step of the algorithm.\n\n- \\ref ASGD is Average Stochastic Gradient Descent SVM Classifier. ASGD classifier averages weights vector on each step of algorithm by the formula\n\\f$\\widehat{w}_{t+1} = \\frac{t}{1+t}\\widehat{w}_{t} + \\frac{1}{1+t}w_{t+1}\\f$\n\nThe recommended model type is ASGD (following @cite bottou2010large).\n\nThe margin type may have one of the following values: \\ref SOFT_MARGIN or \\ref HARD_MARGIN.\n\n- You should use \\ref HARD_MARGIN type, if you have linearly separable sets.\n- You should use \\ref SOFT_MARGIN type, if you have non-linearly separable sets or sets with outliers.\n- In the general case (if you know nothing about linear separability of your sets), use SOFT_MARGIN.\n\nThe other parameters may be described as follows:\n- Margin regularization parameter is responsible for weights decreasing at each step and for the strength of restrictions on outliers\n  (the less the parameter, the less probability that an outlier will be ignored).\n  Recommended value for SGD model is 0.0001, for ASGD model is 0.00001.\n\n- Initial step size parameter is the initial value for the step size \\f$\\gamma(t)\\f$.\n  You will have to find the best initial step for your problem.\n\n- Step decreasing power is the power parameter for \\f$\\gamma(t)\\f$ decreasing by the formula, mentioned above.\n  Recommended value for SGD model is 1, for ASGD model is 0.75.\n\n- Termination criteria can be TermCriteria::COUNT, TermCriteria::EPS or TermCriteria::COUNT + TermCriteria::EPS.\n  You will have to find the best termination criteria for your problem.\n\nNote that the parameters margin regularization, initial step size, and step decreasing power should be positive.\n\nTo use SVMSGD algorithm do as follows:\n\n- first, create the SVMSGD object. The algorithm will set optimal parameters by default, but you can set your own parameters via functions setSvmsgdType(),\n  setMarginType(), setMarginRegularization(), setInitialStepSize(), and setStepDecreasingPower().\n\n- then the SVM model can be trained using the train features and the correspondent labels by the method train().\n\n- after that, the label of a new feature vector can be predicted using the method predict().\n\n@code\n// Create empty object\ncv::Ptr<SVMSGD> svmsgd = SVMSGD::create();\n\n// Train the Stochastic Gradient Descent SVM\nsvmsgd->train(trainData);\n\n// Predict labels for the new samples\nsvmsgd->predict(samples, responses);\n@endcode\n\n*/\n\nclass CV_EXPORTS_W SVMSGD : public cv::ml::StatModel\n{\npublic:\n\n    /** SVMSGD type.\n    ASGD is often the preferable choice. */\n    enum SvmsgdType\n    {\n        SGD, //!< Stochastic Gradient Descent\n        ASGD //!< Average Stochastic Gradient Descent\n    };\n\n    /** Margin type.*/\n    enum MarginType\n    {\n        SOFT_MARGIN, //!< General case, suits to the case of non-linearly separable sets, allows outliers.\n        HARD_MARGIN  //!< More accurate for the case of linearly separable sets.\n    };\n\n    /**\n     * @return the weights of the trained model (decision function f(x) = weights * x + shift).\n    */\n    CV_WRAP virtual Mat getWeights() = 0;\n\n    /**\n     * @return the shift of the trained model (decision function f(x) = weights * x + shift).\n    */\n    CV_WRAP virtual float getShift() = 0;\n\n    /** @brief Creates empty model.\n     * Use StatModel::train to train the model. Since %SVMSGD has several parameters, you may want to\n     * find the best parameters for your problem or use setOptimalParameters() to set some default parameters.\n    */\n    CV_WRAP static Ptr<SVMSGD> create();\n\n    /** @brief Loads and creates a serialized SVMSGD from a file\n     *\n     * Use SVMSGD::save to serialize and store an SVMSGD to disk.\n     * Load the SVMSGD from this file again, by calling this function with the path to the file.\n     * Optionally specify the node for the file containing the classifier\n     *\n     * @param filepath path to serialized SVMSGD\n     * @param nodeName name of node containing the classifier\n     */\n    CV_WRAP static Ptr<SVMSGD> load(const String& filepath , const String& nodeName = String());\n\n    /** @brief Function sets optimal parameters values for chosen SVM SGD model.\n     * @param svmsgdType is the type of SVMSGD classifier.\n     * @param marginType is the type of margin constraint.\n    */\n    CV_WRAP virtual void setOptimalParameters(int svmsgdType = SVMSGD::ASGD, int marginType = SVMSGD::SOFT_MARGIN) = 0;\n\n    /** @brief %Algorithm type, one of SVMSGD::SvmsgdType. */\n    /** @see setSvmsgdType */\n    CV_WRAP virtual int getSvmsgdType() const = 0;\n    /** @copybrief getSvmsgdType @see getSvmsgdType */\n    CV_WRAP virtual void setSvmsgdType(int svmsgdType) = 0;\n\n    /** @brief %Margin type, one of SVMSGD::MarginType. */\n    /** @see setMarginType */\n    CV_WRAP virtual int getMarginType() const = 0;\n    /** @copybrief getMarginType @see getMarginType */\n    CV_WRAP virtual void setMarginType(int marginType) = 0;\n\n    /** @brief Parameter marginRegularization of a %SVMSGD optimization problem. */\n    /** @see setMarginRegularization */\n    CV_WRAP virtual float getMarginRegularization() const = 0;\n    /** @copybrief getMarginRegularization @see getMarginRegularization */\n    CV_WRAP virtual void setMarginRegularization(float marginRegularization) = 0;\n\n    /** @brief Parameter initialStepSize of a %SVMSGD optimization problem. */\n    /** @see setInitialStepSize */\n    CV_WRAP virtual float getInitialStepSize() const = 0;\n    /** @copybrief getInitialStepSize @see getInitialStepSize */\n    CV_WRAP virtual void setInitialStepSize(float InitialStepSize) = 0;\n\n    /** @brief Parameter stepDecreasingPower of a %SVMSGD optimization problem. */\n    /** @see setStepDecreasingPower */\n    CV_WRAP virtual float getStepDecreasingPower() const = 0;\n    /** @copybrief getStepDecreasingPower @see getStepDecreasingPower */\n    CV_WRAP virtual void setStepDecreasingPower(float stepDecreasingPower) = 0;\n\n    /** @brief Termination criteria of the training algorithm.\n    You can specify the maximum number of iterations (maxCount) and/or how much the error could\n    change between the iterations to make the algorithm continue (epsilon).*/\n    /** @see setTermCriteria */\n    CV_WRAP virtual TermCriteria getTermCriteria() const = 0;\n    /** @copybrief getTermCriteria @see getTermCriteria */\n    CV_WRAP virtual void setTermCriteria(const cv::TermCriteria &val) = 0;\n};\n\n\n/****************************************************************************************\\\n*                           Auxiliary functions declarations                              *\n\\****************************************************************************************/\n\n/** @brief Generates _sample_ from multivariate normal distribution\n\n@param mean an average row vector\n@param cov symmetric covariation matrix\n@param nsamples returned samples count\n@param samples returned samples array\n*/\nCV_EXPORTS void randMVNormal( InputArray mean, InputArray cov, int nsamples, OutputArray samples);\n\n/** @brief Creates test set */\nCV_EXPORTS void createConcentricSpheresTestSet( int nsamples, int nfeatures, int nclasses,\n                                                OutputArray samples, OutputArray responses);\n\n\n/****************************************************************************************\\\n*                                   Simulated annealing solver                             *\n\\****************************************************************************************/\n\n#ifdef CV_DOXYGEN\n/** @brief This class declares example interface for system state used in simulated annealing optimization algorithm.\n\n@note This class is not defined in C++ code and can't be use directly - you need your own implementation with the same methods.\n*/\nstruct SimulatedAnnealingSolverSystem\n{\n    /** Give energy value for a state of system.*/\n    double energy() const;\n    /** Function which change the state of system (random perturbation).*/\n    void changeState();\n    /** Function to reverse to the previous state. Can be called once only after changeState(). */\n    void reverseState();\n};\n#endif // CV_DOXYGEN\n\n/** @brief The class implements simulated annealing for optimization.\n\n@cite Kirkpatrick83 for details\n\n@param solverSystem optimization system (see SimulatedAnnealingSolverSystem)\n@param initialTemperature initial temperature\n@param finalTemperature final temperature\n@param coolingRatio temperature step multiplies\n@param iterationsPerStep number of iterations per temperature changing step\n@param lastTemperature optional output for last used temperature\n@param rngEnergy specify custom random numbers generator (cv::theRNG() by default)\n*/\ntemplate<class SimulatedAnnealingSolverSystem>\nint simulatedAnnealingSolver(SimulatedAnnealingSolverSystem& solverSystem,\n     double initialTemperature, double finalTemperature, double coolingRatio,\n     size_t iterationsPerStep,\n     CV_OUT double* lastTemperature = NULL,\n     cv::RNG& rngEnergy = cv::theRNG()\n);\n\n//! @} ml\n\n}\n}\n\n#include <opencv2/ml/ml.inl.hpp>\n\n#endif // __cplusplus\n#endif // OPENCV_ML_HPP\n\n/* End of file. */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/objdetect/detection_based_tracker.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_OBJDETECT_DBT_HPP\n#define OPENCV_OBJDETECT_DBT_HPP\n\n#include <opencv2/core.hpp>\n\n#include <vector>\n\nnamespace cv\n{\n\n//! @addtogroup objdetect\n//! @{\n\nclass CV_EXPORTS DetectionBasedTracker\n{\n    public:\n        struct CV_EXPORTS Parameters\n        {\n            int maxTrackLifetime;\n            int minDetectionPeriod; //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0\n\n            Parameters();\n        };\n\n        class IDetector\n        {\n            public:\n                IDetector():\n                    minObjSize(96, 96),\n                    maxObjSize(INT_MAX, INT_MAX),\n                    minNeighbours(2),\n                    scaleFactor(1.1f)\n                {}\n\n                virtual void detect(const cv::Mat& image, std::vector<cv::Rect>& objects) = 0;\n\n                void setMinObjectSize(const cv::Size& min)\n                {\n                    minObjSize = min;\n                }\n                void setMaxObjectSize(const cv::Size& max)\n                {\n                    maxObjSize = max;\n                }\n                cv::Size getMinObjectSize() const\n                {\n                    return minObjSize;\n                }\n                cv::Size getMaxObjectSize() const\n                {\n                    return maxObjSize;\n                }\n                float getScaleFactor()\n                {\n                    return scaleFactor;\n                }\n                void setScaleFactor(float value)\n                {\n                    scaleFactor = value;\n                }\n                int getMinNeighbours()\n                {\n                    return minNeighbours;\n                }\n                void setMinNeighbours(int value)\n                {\n                    minNeighbours = value;\n                }\n                virtual ~IDetector() {}\n\n            protected:\n                cv::Size minObjSize;\n                cv::Size maxObjSize;\n                int minNeighbours;\n                float scaleFactor;\n        };\n\n        DetectionBasedTracker(cv::Ptr<IDetector> mainDetector, cv::Ptr<IDetector> trackingDetector, const Parameters& params);\n        virtual ~DetectionBasedTracker();\n\n        virtual bool run();\n        virtual void stop();\n        virtual void resetTracking();\n\n        virtual void process(const cv::Mat& imageGray);\n\n        bool setParameters(const Parameters& params);\n        const Parameters& getParameters() const;\n\n\n        typedef std::pair<cv::Rect, int> Object;\n        virtual void getObjects(std::vector<cv::Rect>& result) const;\n        virtual void getObjects(std::vector<Object>& result) const;\n\n        enum ObjectStatus\n        {\n            DETECTED_NOT_SHOWN_YET,\n            DETECTED,\n            DETECTED_TEMPORARY_LOST,\n            WRONG_OBJECT\n        };\n        struct ExtObject\n        {\n            int id;\n            cv::Rect location;\n            ObjectStatus status;\n            ExtObject(int _id, cv::Rect _location, ObjectStatus _status)\n                :id(_id), location(_location), status(_status)\n            {\n            }\n        };\n        virtual void getObjects(std::vector<ExtObject>& result) const;\n\n\n        virtual int addObject(const cv::Rect& location); //returns id of the new object\n\n    protected:\n        class SeparateDetectionWork;\n        cv::Ptr<SeparateDetectionWork> separateDetectionWork;\n        friend void* workcycleObjectDetectorFunction(void* p);\n\n        struct InnerParameters\n        {\n            int numLastPositionsToTrack;\n            int numStepsToWaitBeforeFirstShow;\n            int numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown;\n            int numStepsToShowWithoutDetecting;\n\n            float coeffTrackingWindowSize;\n            float coeffObjectSizeToTrack;\n            float coeffObjectSpeedUsingInPrediction;\n\n            InnerParameters();\n        };\n        Parameters parameters;\n        InnerParameters innerParameters;\n\n        struct TrackedObject\n        {\n            typedef std::vector<cv::Rect> PositionsVector;\n\n            PositionsVector lastPositions;\n\n            int numDetectedFrames;\n            int numFramesNotDetected;\n            int id;\n\n            TrackedObject(const cv::Rect& rect):numDetectedFrames(1), numFramesNotDetected(0)\n            {\n                lastPositions.push_back(rect);\n                id=getNextId();\n            };\n\n            static int getNextId()\n            {\n                static int _id=0;\n                return _id++;\n            }\n        };\n\n        int numTrackedSteps;\n        std::vector<TrackedObject> trackedObjects;\n\n        std::vector<float> weightsPositionsSmoothing;\n        std::vector<float> weightsSizesSmoothing;\n\n        cv::Ptr<IDetector> cascadeForTracking;\n\n        void updateTrackedObjects(const std::vector<cv::Rect>& detectedObjects);\n        cv::Rect calcTrackedObjectPositionToShow(int i) const;\n        cv::Rect calcTrackedObjectPositionToShow(int i, ObjectStatus& status) const;\n        void detectInRegion(const cv::Mat& img, const cv::Rect& r, std::vector<cv::Rect>& detectedObjectsInRegions);\n};\n\n//! @} objdetect\n\n} //end of cv namespace\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/objdetect/objdetect.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/objdetect.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/objdetect.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_OBJDETECT_HPP\n#define OPENCV_OBJDETECT_HPP\n\n#include \"opencv2/core.hpp\"\n\n/**\n@defgroup objdetect Object Detection\n\nHaar Feature-based Cascade Classifier for Object Detection\n----------------------------------------------------------\n\nThe object detector described below has been initially proposed by Paul Viola @cite Viola01 and\nimproved by Rainer Lienhart @cite Lienhart02 .\n\nFirst, a classifier (namely a *cascade of boosted classifiers working with haar-like features*) is\ntrained with a few hundred sample views of a particular object (i.e., a face or a car), called\npositive examples, that are scaled to the same size (say, 20x20), and negative examples - arbitrary\nimages of the same size.\n\nAfter a classifier is trained, it can be applied to a region of interest (of the same size as used\nduring the training) in an input image. The classifier outputs a \"1\" if the region is likely to show\nthe object (i.e., face/car), and \"0\" otherwise. To search for the object in the whole image one can\nmove the search window across the image and check every location using the classifier. The\nclassifier is designed so that it can be easily \"resized\" in order to be able to find the objects of\ninterest at different sizes, which is more efficient than resizing the image itself. So, to find an\nobject of an unknown size in the image the scan procedure should be done several times at different\nscales.\n\nThe word \"cascade\" in the classifier name means that the resultant classifier consists of several\nsimpler classifiers (*stages*) that are applied subsequently to a region of interest until at some\nstage the candidate is rejected or all the stages are passed. The word \"boosted\" means that the\nclassifiers at every stage of the cascade are complex themselves and they are built out of basic\nclassifiers using one of four different boosting techniques (weighted voting). Currently Discrete\nAdaboost, Real Adaboost, Gentle Adaboost and Logitboost are supported. The basic classifiers are\ndecision-tree classifiers with at least 2 leaves. Haar-like features are the input to the basic\nclassifiers, and are calculated as described below. The current algorithm uses the following\nHaar-like features:\n\n![image](pics/haarfeatures.png)\n\nThe feature used in a particular classifier is specified by its shape (1a, 2b etc.), position within\nthe region of interest and the scale (this scale is not the same as the scale used at the detection\nstage, though these two scales are multiplied). For example, in the case of the third line feature\n(2c) the response is calculated as the difference between the sum of image pixels under the\nrectangle covering the whole feature (including the two white stripes and the black stripe in the\nmiddle) and the sum of the image pixels under the black stripe multiplied by 3 in order to\ncompensate for the differences in the size of areas. The sums of pixel values over a rectangular\nregions are calculated rapidly using integral images (see below and the integral description).\n\nTo see the object detector at work, have a look at the facedetect demo:\n<https://github.com/opencv/opencv/tree/master/samples/cpp/dbt_face_detection.cpp>\n\nThe following reference is for the detection part only. There is a separate application called\nopencv_traincascade that can train a cascade of boosted classifiers from a set of samples.\n\n@note In the new C++ interface it is also possible to use LBP (local binary pattern) features in\naddition to Haar-like features. .. [Viola01] Paul Viola and Michael J. Jones. Rapid Object Detection\nusing a Boosted Cascade of Simple Features. IEEE CVPR, 2001. The paper is available online at\n<http://research.microsoft.com/en-us/um/people/viola/Pubs/Detect/violaJones_CVPR2001.pdf>\n\n@{\n    @defgroup objdetect_c C API\n@}\n */\n\ntypedef struct CvHaarClassifierCascade CvHaarClassifierCascade;\n\nnamespace cv\n{\n\n//! @addtogroup objdetect\n//! @{\n\n///////////////////////////// Object Detection ////////////////////////////\n\n//! class for grouping object candidates, detected by Cascade Classifier, HOG etc.\n//! instance of the class is to be passed to cv::partition (see cxoperations.hpp)\nclass CV_EXPORTS SimilarRects\n{\npublic:\n    SimilarRects(double _eps) : eps(_eps) {}\n    inline bool operator()(const Rect& r1, const Rect& r2) const\n    {\n        double delta = eps * ((std::min)(r1.width, r2.width) + (std::min)(r1.height, r2.height)) * 0.5;\n        return std::abs(r1.x - r2.x) <= delta &&\n            std::abs(r1.y - r2.y) <= delta &&\n            std::abs(r1.x + r1.width - r2.x - r2.width) <= delta &&\n            std::abs(r1.y + r1.height - r2.y - r2.height) <= delta;\n    }\n    double eps;\n};\n\n/** @brief Groups the object candidate rectangles.\n\n@param rectList Input/output vector of rectangles. Output vector includes retained and grouped\nrectangles. (The Python list is not modified in place.)\n@param groupThreshold Minimum possible number of rectangles minus 1. The threshold is used in a\ngroup of rectangles to retain it.\n@param eps Relative difference between sides of the rectangles to merge them into a group.\n\nThe function is a wrapper for the generic function partition . It clusters all the input rectangles\nusing the rectangle equivalence criteria that combines rectangles with similar sizes and similar\nlocations. The similarity is defined by eps. When eps=0 , no clustering is done at all. If\n\\f$\\texttt{eps}\\rightarrow +\\inf\\f$ , all the rectangles are put in one cluster. Then, the small\nclusters containing less than or equal to groupThreshold rectangles are rejected. In each other\ncluster, the average rectangle is computed and put into the output rectangle list.\n */\nCV_EXPORTS   void groupRectangles(std::vector<Rect>& rectList, int groupThreshold, double eps = 0.2);\n/** @overload */\nCV_EXPORTS_W void groupRectangles(CV_IN_OUT std::vector<Rect>& rectList, CV_OUT std::vector<int>& weights,\n                                  int groupThreshold, double eps = 0.2);\n/** @overload */\nCV_EXPORTS   void groupRectangles(std::vector<Rect>& rectList, int groupThreshold,\n                                  double eps, std::vector<int>* weights, std::vector<double>* levelWeights );\n/** @overload */\nCV_EXPORTS   void groupRectangles(std::vector<Rect>& rectList, std::vector<int>& rejectLevels,\n                                  std::vector<double>& levelWeights, int groupThreshold, double eps = 0.2);\n/** @overload */\nCV_EXPORTS   void groupRectangles_meanshift(std::vector<Rect>& rectList, std::vector<double>& foundWeights,\n                                            std::vector<double>& foundScales,\n                                            double detectThreshold = 0.0, Size winDetSize = Size(64, 128));\n\ntemplate<> struct DefaultDeleter<CvHaarClassifierCascade>{ CV_EXPORTS void operator ()(CvHaarClassifierCascade* obj) const; };\n\nenum { CASCADE_DO_CANNY_PRUNING    = 1,\n       CASCADE_SCALE_IMAGE         = 2,\n       CASCADE_FIND_BIGGEST_OBJECT = 4,\n       CASCADE_DO_ROUGH_SEARCH     = 8\n     };\n\nclass CV_EXPORTS_W BaseCascadeClassifier : public Algorithm\n{\npublic:\n    virtual ~BaseCascadeClassifier();\n    virtual bool empty() const CV_OVERRIDE = 0;\n    virtual bool load( const String& filename ) = 0;\n    virtual void detectMultiScale( InputArray image,\n                           CV_OUT std::vector<Rect>& objects,\n                           double scaleFactor,\n                           int minNeighbors, int flags,\n                           Size minSize, Size maxSize ) = 0;\n\n    virtual void detectMultiScale( InputArray image,\n                           CV_OUT std::vector<Rect>& objects,\n                           CV_OUT std::vector<int>& numDetections,\n                           double scaleFactor,\n                           int minNeighbors, int flags,\n                           Size minSize, Size maxSize ) = 0;\n\n    virtual void detectMultiScale( InputArray image,\n                                   CV_OUT std::vector<Rect>& objects,\n                                   CV_OUT std::vector<int>& rejectLevels,\n                                   CV_OUT std::vector<double>& levelWeights,\n                                   double scaleFactor,\n                                   int minNeighbors, int flags,\n                                   Size minSize, Size maxSize,\n                                   bool outputRejectLevels ) = 0;\n\n    virtual bool isOldFormatCascade() const = 0;\n    virtual Size getOriginalWindowSize() const = 0;\n    virtual int getFeatureType() const = 0;\n    virtual void* getOldCascade() = 0;\n\n    class CV_EXPORTS MaskGenerator\n    {\n    public:\n        virtual ~MaskGenerator() {}\n        virtual Mat generateMask(const Mat& src)=0;\n        virtual void initializeMask(const Mat& /*src*/) { }\n    };\n    virtual void setMaskGenerator(const Ptr<MaskGenerator>& maskGenerator) = 0;\n    virtual Ptr<MaskGenerator> getMaskGenerator() = 0;\n};\n\n/** @example samples/cpp/facedetect.cpp\nThis program demonstrates usage of the Cascade classifier class\n\\image html Cascade_Classifier_Tutorial_Result_Haar.jpg \"Sample screenshot\" width=321 height=254\n*/\n/** @brief Cascade classifier class for object detection.\n */\nclass CV_EXPORTS_W CascadeClassifier\n{\npublic:\n    CV_WRAP CascadeClassifier();\n    /** @brief Loads a classifier from a file.\n\n    @param filename Name of the file from which the classifier is loaded.\n     */\n    CV_WRAP CascadeClassifier(const String& filename);\n    ~CascadeClassifier();\n    /** @brief Checks whether the classifier has been loaded.\n    */\n    CV_WRAP bool empty() const;\n    /** @brief Loads a classifier from a file.\n\n    @param filename Name of the file from which the classifier is loaded. The file may contain an old\n    HAAR classifier trained by the haartraining application or a new cascade classifier trained by the\n    traincascade application.\n     */\n    CV_WRAP bool load( const String& filename );\n    /** @brief Reads a classifier from a FileStorage node.\n\n    @note The file may contain a new cascade classifier (trained traincascade application) only.\n     */\n    CV_WRAP bool read( const FileNode& node );\n\n    /** @brief Detects objects of different sizes in the input image. The detected objects are returned as a list\n    of rectangles.\n\n    @param image Matrix of the type CV_8U containing an image where objects are detected.\n    @param objects Vector of rectangles where each rectangle contains the detected object, the\n    rectangles may be partially outside the original image.\n    @param scaleFactor Parameter specifying how much the image size is reduced at each image scale.\n    @param minNeighbors Parameter specifying how many neighbors each candidate rectangle should have\n    to retain it.\n    @param flags Parameter with the same meaning for an old cascade as in the function\n    cvHaarDetectObjects. It is not used for a new cascade.\n    @param minSize Minimum possible object size. Objects smaller than that are ignored.\n    @param maxSize Maximum possible object size. Objects larger than that are ignored. If `maxSize == minSize` model is evaluated on single scale.\n\n    The function is parallelized with the TBB library.\n\n    @note\n       -   (Python) A face detection example using cascade classifiers can be found at\n            opencv_source_code/samples/python/facedetect.py\n    */\n    CV_WRAP void detectMultiScale( InputArray image,\n                          CV_OUT std::vector<Rect>& objects,\n                          double scaleFactor = 1.1,\n                          int minNeighbors = 3, int flags = 0,\n                          Size minSize = Size(),\n                          Size maxSize = Size() );\n\n    /** @overload\n    @param image Matrix of the type CV_8U containing an image where objects are detected.\n    @param objects Vector of rectangles where each rectangle contains the detected object, the\n    rectangles may be partially outside the original image.\n    @param numDetections Vector of detection numbers for the corresponding objects. An object's number\n    of detections is the number of neighboring positively classified rectangles that were joined\n    together to form the object.\n    @param scaleFactor Parameter specifying how much the image size is reduced at each image scale.\n    @param minNeighbors Parameter specifying how many neighbors each candidate rectangle should have\n    to retain it.\n    @param flags Parameter with the same meaning for an old cascade as in the function\n    cvHaarDetectObjects. It is not used for a new cascade.\n    @param minSize Minimum possible object size. Objects smaller than that are ignored.\n    @param maxSize Maximum possible object size. Objects larger than that are ignored. If `maxSize == minSize` model is evaluated on single scale.\n    */\n    CV_WRAP_AS(detectMultiScale2) void detectMultiScale( InputArray image,\n                          CV_OUT std::vector<Rect>& objects,\n                          CV_OUT std::vector<int>& numDetections,\n                          double scaleFactor=1.1,\n                          int minNeighbors=3, int flags=0,\n                          Size minSize=Size(),\n                          Size maxSize=Size() );\n\n    /** @overload\n    This function allows you to retrieve the final stage decision certainty of classification.\n    For this, one needs to set `outputRejectLevels` on true and provide the `rejectLevels` and `levelWeights` parameter.\n    For each resulting detection, `levelWeights` will then contain the certainty of classification at the final stage.\n    This value can then be used to separate strong from weaker classifications.\n\n    A code sample on how to use it efficiently can be found below:\n    @code\n    Mat img;\n    vector<double> weights;\n    vector<int> levels;\n    vector<Rect> detections;\n    CascadeClassifier model(\"/path/to/your/model.xml\");\n    model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true);\n    cerr << \"Detection \" << detections[0] << \" with weight \" << weights[0] << endl;\n    @endcode\n    */\n    CV_WRAP_AS(detectMultiScale3) void detectMultiScale( InputArray image,\n                                  CV_OUT std::vector<Rect>& objects,\n                                  CV_OUT std::vector<int>& rejectLevels,\n                                  CV_OUT std::vector<double>& levelWeights,\n                                  double scaleFactor = 1.1,\n                                  int minNeighbors = 3, int flags = 0,\n                                  Size minSize = Size(),\n                                  Size maxSize = Size(),\n                                  bool outputRejectLevels = false );\n\n    CV_WRAP bool isOldFormatCascade() const;\n    CV_WRAP Size getOriginalWindowSize() const;\n    CV_WRAP int getFeatureType() const;\n    void* getOldCascade();\n\n    CV_WRAP static bool convert(const String& oldcascade, const String& newcascade);\n\n    void setMaskGenerator(const Ptr<BaseCascadeClassifier::MaskGenerator>& maskGenerator);\n    Ptr<BaseCascadeClassifier::MaskGenerator> getMaskGenerator();\n\n    Ptr<BaseCascadeClassifier> cc;\n};\n\nCV_EXPORTS Ptr<BaseCascadeClassifier::MaskGenerator> createFaceDetectionMaskGenerator();\n\n//////////////// HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector //////////////\n\n//! struct for detection region of interest (ROI)\nstruct DetectionROI\n{\n   //! scale(size) of the bounding box\n   double scale;\n   //! set of requested locations to be evaluated\n   std::vector<cv::Point> locations;\n   //! vector that will contain confidence values for each location\n   std::vector<double> confidences;\n};\n\n/**@brief Implementation of HOG (Histogram of Oriented Gradients) descriptor and object detector.\n\nthe HOG descriptor algorithm introduced by Navneet Dalal and Bill Triggs @cite Dalal2005 .\n\nuseful links:\n\nhttps://hal.inria.fr/inria-00548512/document/\n\nhttps://en.wikipedia.org/wiki/Histogram_of_oriented_gradients\n\nhttps://software.intel.com/en-us/ipp-dev-reference-histogram-of-oriented-gradients-hog-descriptor\n\nhttp://www.learnopencv.com/histogram-of-oriented-gradients\n\nhttp://www.learnopencv.com/handwritten-digits-classification-an-opencv-c-python-tutorial\n\n */\nstruct CV_EXPORTS_W HOGDescriptor\n{\npublic:\n    enum HistogramNormType { L2Hys = 0 //!< Default histogramNormType\n         };\n    enum { DEFAULT_NLEVELS = 64 //!< Default nlevels value.\n         };\n    enum DescriptorStorageFormat { DESCR_FORMAT_COL_BY_COL, DESCR_FORMAT_ROW_BY_ROW };\n\n    /**@brief Creates the HOG descriptor and detector with default params.\n\n    aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )\n    */\n    CV_WRAP HOGDescriptor() : winSize(64,128), blockSize(16,16), blockStride(8,8),\n        cellSize(8,8), nbins(9), derivAperture(1), winSigma(-1),\n        histogramNormType(HOGDescriptor::L2Hys), L2HysThreshold(0.2), gammaCorrection(true),\n        free_coef(-1.f), nlevels(HOGDescriptor::DEFAULT_NLEVELS), signedGradient(false)\n    {}\n\n    /** @overload\n    @param _winSize sets winSize with given value.\n    @param _blockSize sets blockSize with given value.\n    @param _blockStride sets blockStride with given value.\n    @param _cellSize sets cellSize with given value.\n    @param _nbins sets nbins with given value.\n    @param _derivAperture sets derivAperture with given value.\n    @param _winSigma sets winSigma with given value.\n    @param _histogramNormType sets histogramNormType with given value.\n    @param _L2HysThreshold sets L2HysThreshold with given value.\n    @param _gammaCorrection sets gammaCorrection with given value.\n    @param _nlevels sets nlevels with given value.\n    @param _signedGradient sets signedGradient with given value.\n    */\n    CV_WRAP HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride,\n                  Size _cellSize, int _nbins, int _derivAperture=1, double _winSigma=-1,\n                  HOGDescriptor::HistogramNormType _histogramNormType=HOGDescriptor::L2Hys,\n                  double _L2HysThreshold=0.2, bool _gammaCorrection=false,\n                  int _nlevels=HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient=false)\n    : winSize(_winSize), blockSize(_blockSize), blockStride(_blockStride), cellSize(_cellSize),\n    nbins(_nbins), derivAperture(_derivAperture), winSigma(_winSigma),\n    histogramNormType(_histogramNormType), L2HysThreshold(_L2HysThreshold),\n    gammaCorrection(_gammaCorrection), free_coef(-1.f), nlevels(_nlevels), signedGradient(_signedGradient)\n    {}\n\n    /** @overload\n    @param filename The file name containing HOGDescriptor properties and coefficients for the linear SVM classifier.\n    */\n    CV_WRAP HOGDescriptor(const String& filename)\n    {\n        load(filename);\n    }\n\n    /** @overload\n    @param d the HOGDescriptor which cloned to create a new one.\n    */\n    HOGDescriptor(const HOGDescriptor& d)\n    {\n        d.copyTo(*this);\n    }\n\n    /**@brief Default destructor.\n    */\n    virtual ~HOGDescriptor() {}\n\n    /**@brief Returns the number of coefficients required for the classification.\n    */\n    CV_WRAP size_t getDescriptorSize() const;\n\n    /** @brief Checks if detector size equal to descriptor size.\n    */\n    CV_WRAP bool checkDetectorSize() const;\n\n    /** @brief Returns winSigma value\n    */\n    CV_WRAP double getWinSigma() const;\n\n    /**@example samples/cpp/peopledetect.cpp\n    */\n    /**@brief Sets coefficients for the linear SVM classifier.\n    @param svmdetector coefficients for the linear SVM classifier.\n    */\n    CV_WRAP virtual void setSVMDetector(InputArray svmdetector);\n\n    /** @brief Reads HOGDescriptor parameters from a cv::FileNode.\n    @param fn File node\n    */\n    virtual bool read(FileNode& fn);\n\n    /** @brief Stores HOGDescriptor parameters in a cv::FileStorage.\n    @param fs File storage\n    @param objname Object name\n    */\n    virtual void write(FileStorage& fs, const String& objname) const;\n\n    /** @brief loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.\n    @param filename Path of the file to read.\n    @param objname The optional name of the node to read (if empty, the first top-level node will be used).\n    */\n    CV_WRAP virtual bool load(const String& filename, const String& objname = String());\n\n    /** @brief saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file\n    @param filename File name\n    @param objname Object name\n    */\n    CV_WRAP virtual void save(const String& filename, const String& objname = String()) const;\n\n    /** @brief clones the HOGDescriptor\n    @param c cloned HOGDescriptor\n    */\n    virtual void copyTo(HOGDescriptor& c) const;\n\n    /**@example samples/cpp/train_HOG.cpp\n    */\n    /** @brief Computes HOG descriptors of given image.\n    @param img Matrix of the type CV_8U containing an image where HOG features will be calculated.\n    @param descriptors Matrix of the type CV_32F\n    @param winStride Window stride. It must be a multiple of block stride.\n    @param padding Padding\n    @param locations Vector of Point\n    */\n    CV_WRAP virtual void compute(InputArray img,\n                         CV_OUT std::vector<float>& descriptors,\n                         Size winStride = Size(), Size padding = Size(),\n                         const std::vector<Point>& locations = std::vector<Point>()) const;\n\n    /** @brief Performs object detection without a multi-scale window.\n    @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.\n    @param foundLocations Vector of point where each point contains left-top corner point of detected object boundaries.\n    @param weights Vector that will contain confidence values for each detected object.\n    @param hitThreshold Threshold for the distance between features and SVM classifying plane.\n    Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).\n    But if the free coefficient is omitted (which is allowed), you can specify it manually here.\n    @param winStride Window stride. It must be a multiple of block stride.\n    @param padding Padding\n    @param searchLocations Vector of Point includes set of requested locations to be evaluated.\n    */\n    CV_WRAP virtual void detect(InputArray img, CV_OUT std::vector<Point>& foundLocations,\n                        CV_OUT std::vector<double>& weights,\n                        double hitThreshold = 0, Size winStride = Size(),\n                        Size padding = Size(),\n                        const std::vector<Point>& searchLocations = std::vector<Point>()) const;\n\n    /** @brief Performs object detection without a multi-scale window.\n    @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.\n    @param foundLocations Vector of point where each point contains left-top corner point of detected object boundaries.\n    @param hitThreshold Threshold for the distance between features and SVM classifying plane.\n    Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).\n    But if the free coefficient is omitted (which is allowed), you can specify it manually here.\n    @param winStride Window stride. It must be a multiple of block stride.\n    @param padding Padding\n    @param searchLocations Vector of Point includes locations to search.\n    */\n    virtual void detect(InputArray img, CV_OUT std::vector<Point>& foundLocations,\n                        double hitThreshold = 0, Size winStride = Size(),\n                        Size padding = Size(),\n                        const std::vector<Point>& searchLocations=std::vector<Point>()) const;\n\n    /** @brief Detects objects of different sizes in the input image. The detected objects are returned as a list\n    of rectangles.\n    @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.\n    @param foundLocations Vector of rectangles where each rectangle contains the detected object.\n    @param foundWeights Vector that will contain confidence values for each detected object.\n    @param hitThreshold Threshold for the distance between features and SVM classifying plane.\n    Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).\n    But if the free coefficient is omitted (which is allowed), you can specify it manually here.\n    @param winStride Window stride. It must be a multiple of block stride.\n    @param padding Padding\n    @param scale Coefficient of the detection window increase.\n    @param finalThreshold Final threshold\n    @param useMeanshiftGrouping indicates grouping algorithm\n    */\n    CV_WRAP virtual void detectMultiScale(InputArray img, CV_OUT std::vector<Rect>& foundLocations,\n                                  CV_OUT std::vector<double>& foundWeights, double hitThreshold = 0,\n                                  Size winStride = Size(), Size padding = Size(), double scale = 1.05,\n                                  double finalThreshold = 2.0,bool useMeanshiftGrouping = false) const;\n\n    /** @brief Detects objects of different sizes in the input image. The detected objects are returned as a list\n    of rectangles.\n    @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.\n    @param foundLocations Vector of rectangles where each rectangle contains the detected object.\n    @param hitThreshold Threshold for the distance between features and SVM classifying plane.\n    Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).\n    But if the free coefficient is omitted (which is allowed), you can specify it manually here.\n    @param winStride Window stride. It must be a multiple of block stride.\n    @param padding Padding\n    @param scale Coefficient of the detection window increase.\n    @param finalThreshold Final threshold\n    @param useMeanshiftGrouping indicates grouping algorithm\n    */\n    virtual void detectMultiScale(InputArray img, CV_OUT std::vector<Rect>& foundLocations,\n                                  double hitThreshold = 0, Size winStride = Size(),\n                                  Size padding = Size(), double scale = 1.05,\n                                  double finalThreshold = 2.0, bool useMeanshiftGrouping = false) const;\n\n    /** @brief  Computes gradients and quantized gradient orientations.\n    @param img Matrix contains the image to be computed\n    @param grad Matrix of type CV_32FC2 contains computed gradients\n    @param angleOfs Matrix of type CV_8UC2 contains quantized gradient orientations\n    @param paddingTL Padding from top-left\n    @param paddingBR Padding from bottom-right\n    */\n    CV_WRAP virtual void computeGradient(InputArray img, InputOutputArray grad, InputOutputArray angleOfs,\n                                 Size paddingTL = Size(), Size paddingBR = Size()) const;\n\n    /** @brief Returns coefficients of the classifier trained for people detection (for 64x128 windows).\n    */\n    CV_WRAP static std::vector<float> getDefaultPeopleDetector();\n\n    /**@example samples/tapi/hog.cpp\n    */\n    /** @brief Returns coefficients of the classifier trained for people detection (for 48x96 windows).\n    */\n    CV_WRAP static std::vector<float> getDaimlerPeopleDetector();\n\n    //! Detection window size. Align to block size and block stride. Default value is Size(64,128).\n    CV_PROP Size winSize;\n\n    //! Block size in pixels. Align to cell size. Default value is Size(16,16).\n    CV_PROP Size blockSize;\n\n    //! Block stride. It must be a multiple of cell size. Default value is Size(8,8).\n    CV_PROP Size blockStride;\n\n    //! Cell size. Default value is Size(8,8).\n    CV_PROP Size cellSize;\n\n    //! Number of bins used in the calculation of histogram of gradients. Default value is 9.\n    CV_PROP int nbins;\n\n    //! not documented\n    CV_PROP int derivAperture;\n\n    //! Gaussian smoothing window parameter.\n    CV_PROP double winSigma;\n\n    //! histogramNormType\n    CV_PROP HOGDescriptor::HistogramNormType histogramNormType;\n\n    //! L2-Hys normalization method shrinkage.\n    CV_PROP double L2HysThreshold;\n\n    //! Flag to specify whether the gamma correction preprocessing is required or not.\n    CV_PROP bool gammaCorrection;\n\n    //! coefficients for the linear SVM classifier.\n    CV_PROP std::vector<float> svmDetector;\n\n    //! coefficients for the linear SVM classifier used when OpenCL is enabled\n    UMat oclSvmDetector;\n\n    //! not documented\n    float free_coef;\n\n    //! Maximum number of detection window increases. Default value is 64\n    CV_PROP int nlevels;\n\n    //! Indicates signed gradient will be used or not\n    CV_PROP bool signedGradient;\n\n    /** @brief evaluate specified ROI and return confidence value for each location\n    @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.\n    @param locations Vector of Point\n    @param foundLocations Vector of Point where each Point is detected object's top-left point.\n    @param confidences confidences\n    @param hitThreshold Threshold for the distance between features and SVM classifying plane. Usually\n    it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if\n    the free coefficient is omitted (which is allowed), you can specify it manually here\n    @param winStride winStride\n    @param padding padding\n    */\n    virtual void detectROI(InputArray img, const std::vector<cv::Point> &locations,\n                                   CV_OUT std::vector<cv::Point>& foundLocations, CV_OUT std::vector<double>& confidences,\n                                   double hitThreshold = 0, cv::Size winStride = Size(),\n                                   cv::Size padding = Size()) const;\n\n    /** @brief evaluate specified ROI and return confidence value for each location in multiple scales\n    @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.\n    @param foundLocations Vector of rectangles where each rectangle contains the detected object.\n    @param locations Vector of DetectionROI\n    @param hitThreshold Threshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified\n    in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.\n    @param groupThreshold Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.\n    */\n    virtual void detectMultiScaleROI(InputArray img,\n                                     CV_OUT std::vector<cv::Rect>& foundLocations,\n                                     std::vector<DetectionROI>& locations,\n                                     double hitThreshold = 0,\n                                     int groupThreshold = 0) const;\n\n    /** @brief Groups the object candidate rectangles.\n    @param rectList  Input/output vector of rectangles. Output vector includes retained and grouped rectangles. (The Python list is not modified in place.)\n    @param weights Input/output vector of weights of rectangles. Output vector includes weights of retained and grouped rectangles. (The Python list is not modified in place.)\n    @param groupThreshold Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.\n    @param eps Relative difference between sides of the rectangles to merge them into a group.\n    */\n    void groupRectangles(std::vector<cv::Rect>& rectList, std::vector<double>& weights, int groupThreshold, double eps) const;\n};\n\nclass CV_EXPORTS_W QRCodeDetector\n{\npublic:\n    CV_WRAP QRCodeDetector();\n    ~QRCodeDetector();\n\n    /** @brief sets the epsilon used during the horizontal scan of QR code stop marker detection.\n     @param epsX Epsilon neighborhood, which allows you to determine the horizontal pattern\n     of the scheme 1:1:3:1:1 according to QR code standard.\n    */\n    CV_WRAP void setEpsX(double epsX);\n    /** @brief sets the epsilon used during the vertical scan of QR code stop marker detection.\n     @param epsY Epsilon neighborhood, which allows you to determine the vertical pattern\n     of the scheme 1:1:3:1:1 according to QR code standard.\n     */\n    CV_WRAP void setEpsY(double epsY);\n\n    /** @brief Detects QR code in image and returns the quadrangle containing the code.\n     @param img grayscale or color (BGR) image containing (or not) QR code.\n     @param points Output vector of vertices of the minimum-area quadrangle containing the code.\n     */\n    CV_WRAP bool detect(InputArray img, OutputArray points) const;\n\n    /** @brief Decodes QR code in image once it's found by the detect() method.\n\n     Returns UTF8-encoded output string or empty string if the code cannot be decoded.\n     @param img grayscale or color (BGR) image containing QR code.\n     @param points Quadrangle vertices found by detect() method (or some other algorithm).\n     @param straight_qrcode The optional output image containing rectified and binarized QR code\n     */\n    CV_WRAP std::string decode(InputArray img, InputArray points, OutputArray straight_qrcode = noArray());\n\n    /** @brief Decodes QR code on a curved surface in image once it's found by the detect() method.\n\n     Returns UTF8-encoded output string or empty string if the code cannot be decoded.\n     @param img grayscale or color (BGR) image containing QR code.\n     @param points Quadrangle vertices found by detect() method (or some other algorithm).\n     @param straight_qrcode The optional output image containing rectified and binarized QR code\n     */\n    CV_WRAP cv::String decodeCurved(InputArray img, InputArray points, OutputArray straight_qrcode = noArray());\n\n    /** @brief Both detects and decodes QR code\n\n     @param img grayscale or color (BGR) image containing QR code.\n     @param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.\n     @param straight_qrcode The optional output image containing rectified and binarized QR code\n     */\n    CV_WRAP std::string detectAndDecode(InputArray img, OutputArray points=noArray(),\n                                        OutputArray straight_qrcode = noArray());\n\n    /** @brief Both detects and decodes QR code on a curved surface\n\n     @param img grayscale or color (BGR) image containing QR code.\n     @param points optional output array of vertices of the found QR code quadrangle. Will be empty if not found.\n     @param straight_qrcode The optional output image containing rectified and binarized QR code\n     */\n    CV_WRAP std::string detectAndDecodeCurved(InputArray img, OutputArray points=noArray(),\n                                              OutputArray straight_qrcode = noArray());\n\n    /** @brief Detects QR codes in image and returns the vector of the quadrangles containing the codes.\n     @param img grayscale or color (BGR) image containing (or not) QR codes.\n     @param points Output vector of vector of vertices of the minimum-area quadrangle containing the codes.\n     */\n    CV_WRAP\n    bool detectMulti(InputArray img, OutputArray points) const;\n\n    /** @brief Decodes QR codes in image once it's found by the detect() method.\n     @param img grayscale or color (BGR) image containing QR codes.\n     @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.\n     @param points vector of Quadrangle vertices found by detect() method (or some other algorithm).\n     @param straight_qrcode The optional output vector of images containing rectified and binarized QR codes\n     */\n    CV_WRAP\n    bool decodeMulti(\n            InputArray img, InputArray points,\n            CV_OUT std::vector<std::string>& decoded_info,\n            OutputArrayOfArrays straight_qrcode = noArray()\n    ) const;\n\n    /** @brief Both detects and decodes QR codes\n    @param img grayscale or color (BGR) image containing QR codes.\n    @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.\n    @param points optional output vector of vertices of the found QR code quadrangles. Will be empty if not found.\n    @param straight_qrcode The optional output vector of images containing rectified and binarized QR codes\n    */\n    CV_WRAP\n    bool detectAndDecodeMulti(\n            InputArray img, CV_OUT std::vector<std::string>& decoded_info,\n            OutputArray points = noArray(),\n            OutputArrayOfArrays straight_qrcode = noArray()\n    ) const;\n\nprotected:\n    struct Impl;\n    Ptr<Impl> p;\n};\n\n//! @} objdetect\n}\n\n#include \"opencv2/objdetect/detection_based_tracker.hpp\"\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/opencv.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_ALL_HPP\n#define OPENCV_ALL_HPP\n\n// File that defines what modules where included during the build of OpenCV\n// These are purely the defines of the correct HAVE_OPENCV_modulename values\n#include \"opencv2/opencv_modules.hpp\"\n\n// Then the list of defines is checked to include the correct headers\n// Core library is always included --> without no OpenCV functionality available\n#include \"opencv2/core.hpp\"\n\n// Then the optional modules are checked\n#ifdef HAVE_OPENCV_CALIB3D\n#include \"opencv2/calib3d.hpp\"\n#endif\n#ifdef HAVE_OPENCV_FEATURES2D\n#include \"opencv2/features2d.hpp\"\n#endif\n#ifdef HAVE_OPENCV_DNN\n#include \"opencv2/dnn.hpp\"\n#endif\n#ifdef HAVE_OPENCV_FLANN\n#include \"opencv2/flann.hpp\"\n#endif\n#ifdef HAVE_OPENCV_HIGHGUI\n#include \"opencv2/highgui.hpp\"\n#endif\n#ifdef HAVE_OPENCV_IMGCODECS\n#include \"opencv2/imgcodecs.hpp\"\n#endif\n#ifdef HAVE_OPENCV_IMGPROC\n#include \"opencv2/imgproc.hpp\"\n#endif\n#ifdef HAVE_OPENCV_ML\n#include \"opencv2/ml.hpp\"\n#endif\n#ifdef HAVE_OPENCV_OBJDETECT\n#include \"opencv2/objdetect.hpp\"\n#endif\n#ifdef HAVE_OPENCV_PHOTO\n#include \"opencv2/photo.hpp\"\n#endif\n#ifdef HAVE_OPENCV_STITCHING\n#include \"opencv2/stitching.hpp\"\n#endif\n#ifdef HAVE_OPENCV_VIDEO\n#include \"opencv2/video.hpp\"\n#endif\n#ifdef HAVE_OPENCV_VIDEOIO\n#include \"opencv2/videoio.hpp\"\n#endif\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/opencv_modules.hpp",
    "content": "/*\n *      ** File generated automatically, do not modify **\n *\n * This file defines the list of modules available in current build configuration\n *\n *\n*/\n\n// This definition means that OpenCV is built with enabled non-free code.\n// For example, patented algorithms for non-profit/non-commercial use only.\n/* #undef OPENCV_ENABLE_NONFREE */\n\n#define HAVE_OPENCV_CALIB3D\n#define HAVE_OPENCV_CORE\n#define HAVE_OPENCV_DNN\n#define HAVE_OPENCV_FEATURES2D\n#define HAVE_OPENCV_FLANN\n#define HAVE_OPENCV_GAPI\n#define HAVE_OPENCV_HIGHGUI\n#define HAVE_OPENCV_IMGCODECS\n#define HAVE_OPENCV_IMGPROC\n#define HAVE_OPENCV_ML\n#define HAVE_OPENCV_OBJDETECT\n#define HAVE_OPENCV_PHOTO\n#define HAVE_OPENCV_STITCHING\n#define HAVE_OPENCV_VIDEO\n#define HAVE_OPENCV_VIDEOIO\n\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/photo/cuda.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_PHOTO_CUDA_HPP\n#define OPENCV_PHOTO_CUDA_HPP\n\n#include \"opencv2/core/cuda.hpp\"\n\nnamespace cv { namespace cuda {\n\n//! @addtogroup photo_denoise\n//! @{\n\n/** @brief Performs pure non local means denoising without any simplification, and thus it is not fast.\n\n@param src Source image. Supports only CV_8UC1, CV_8UC2 and CV_8UC3.\n@param dst Destination image.\n@param h Filter sigma regulating filter strength for color.\n@param search_window Size of search window.\n@param block_size Size of block used for computing weights.\n@param borderMode Border type. See borderInterpolate for details. BORDER_REFLECT101 ,\nBORDER_REPLICATE , BORDER_CONSTANT , BORDER_REFLECT and BORDER_WRAP are supported for now.\n@param stream Stream for the asynchronous version.\n\n@sa\n   fastNlMeansDenoising\n */\nCV_EXPORTS void nonLocalMeans(InputArray src, OutputArray dst,\n                              float h,\n                              int search_window = 21,\n                              int block_size = 7,\n                              int borderMode = BORDER_DEFAULT,\n                              Stream& stream = Stream::Null());\n\n/** @brief Perform image denoising using Non-local Means Denoising algorithm\n<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising> with several computational\noptimizations. Noise expected to be a gaussian white noise\n\n@param src Input 8-bit 1-channel, 2-channel or 3-channel image.\n@param dst Output image with the same size and type as src .\n@param h Parameter regulating filter strength. Big h value perfectly removes noise but also\nremoves image details, smaller h value preserves details but also preserves some noise\n@param search_window Size in pixels of the window that is used to compute weighted average for\ngiven pixel. Should be odd. Affect performance linearly: greater search_window - greater\ndenoising time. Recommended value 21 pixels\n@param block_size Size in pixels of the template patch that is used to compute weights. Should be\nodd. Recommended value 7 pixels\n@param stream Stream for the asynchronous invocations.\n\nThis function expected to be applied to grayscale images. For colored images look at\nFastNonLocalMeansDenoising::labMethod.\n\n@sa\n   fastNlMeansDenoising\n */\nCV_EXPORTS void fastNlMeansDenoising(InputArray src, OutputArray dst,\n                                     float h,\n                                     int search_window = 21,\n                                     int block_size = 7,\n                                     Stream& stream = Stream::Null());\n\n/** @brief Modification of fastNlMeansDenoising function for colored images\n\n@param src Input 8-bit 3-channel image.\n@param dst Output image with the same size and type as src .\n@param h_luminance Parameter regulating filter strength. Big h value perfectly removes noise but\nalso removes image details, smaller h value preserves details but also preserves some noise\n@param photo_render float The same as h but for color components. For most images value equals 10 will be\nenough to remove colored noise and do not distort colors\n@param search_window Size in pixels of the window that is used to compute weighted average for\ngiven pixel. Should be odd. Affect performance linearly: greater search_window - greater\ndenoising time. Recommended value 21 pixels\n@param block_size Size in pixels of the template patch that is used to compute weights. Should be\nodd. Recommended value 7 pixels\n@param stream Stream for the asynchronous invocations.\n\nThe function converts image to CIELAB colorspace and then separately denoise L and AB components\nwith given h parameters using FastNonLocalMeansDenoising::simpleMethod function.\n\n@sa\n   fastNlMeansDenoisingColored\n */\nCV_EXPORTS void fastNlMeansDenoisingColored(InputArray src, OutputArray dst,\n                                            float h_luminance, float photo_render,\n                                            int search_window = 21,\n                                            int block_size = 7,\n                                            Stream& stream = Stream::Null());\n\n//! @} photo\n\n}} // namespace cv { namespace cuda {\n\n#endif /* OPENCV_PHOTO_CUDA_HPP */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/photo/legacy/constants_c.h",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_PHOTO_LEGACY_CONSTANTS_H\n#define OPENCV_PHOTO_LEGACY_CONSTANTS_H\n\nenum InpaintingModes\n{\n    CV_INPAINT_NS      =0,\n    CV_INPAINT_TELEA   =1\n};\n\n#endif // OPENCV_PHOTO_LEGACY_CONSTANTS_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/photo/photo.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/photo.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/photo.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                           License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_PHOTO_HPP\n#define OPENCV_PHOTO_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/imgproc.hpp\"\n\n/**\n@defgroup photo Computational Photography\n\nThis module includes photo processing algorithms\n@{\n    @defgroup photo_inpaint Inpainting\n    @defgroup photo_denoise Denoising\n    @defgroup photo_hdr HDR imaging\n\nThis section describes high dynamic range imaging algorithms namely tonemapping, exposure alignment,\ncamera calibration with multiple exposures and exposure fusion.\n\n    @defgroup photo_decolor Contrast Preserving Decolorization\n\nUseful links:\n\nhttp://www.cse.cuhk.edu.hk/leojia/projects/color2gray/index.html\n\n    @defgroup photo_clone Seamless Cloning\n\nUseful links:\n\nhttps://www.learnopencv.com/seamless-cloning-using-opencv-python-cpp\n\n    @defgroup photo_render Non-Photorealistic Rendering\n\nUseful links:\n\nhttp://www.inf.ufrgs.br/~eslgastal/DomainTransform\n\nhttps://www.learnopencv.com/non-photorealistic-rendering-using-opencv-python-c/\n\n    @defgroup photo_c C API\n@}\n  */\n\nnamespace cv\n{\n\n//! @addtogroup photo\n//! @{\n\n//! @addtogroup photo_inpaint\n//! @{\n//! the inpainting algorithm\nenum\n{\n    INPAINT_NS    = 0, //!< Use Navier-Stokes based method\n    INPAINT_TELEA = 1 //!< Use the algorithm proposed by Alexandru Telea @cite Telea04\n};\n\n/** @brief Restores the selected region in an image using the region neighborhood.\n\n@param src Input 8-bit, 16-bit unsigned or 32-bit float 1-channel or 8-bit 3-channel image.\n@param inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that\nneeds to be inpainted.\n@param dst Output image with the same size and type as src .\n@param inpaintRadius Radius of a circular neighborhood of each point inpainted that is considered\nby the algorithm.\n@param flags Inpainting method that could be cv::INPAINT_NS or cv::INPAINT_TELEA\n\nThe function reconstructs the selected image area from the pixel near the area boundary. The\nfunction may be used to remove dust and scratches from a scanned photo, or to remove undesirable\nobjects from still images or video. See <http://en.wikipedia.org/wiki/Inpainting> for more details.\n\n@note\n   -   An example using the inpainting technique can be found at\n        opencv_source_code/samples/cpp/inpaint.cpp\n   -   (Python) An example using the inpainting technique can be found at\n        opencv_source_code/samples/python/inpaint.py\n */\nCV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask,\n        OutputArray dst, double inpaintRadius, int flags );\n\n//! @} photo_inpaint\n\n//! @addtogroup photo_denoise\n//! @{\n\n/** @brief Perform image denoising using Non-local Means Denoising algorithm\n<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational\noptimizations. Noise expected to be a gaussian white noise\n\n@param src Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.\n@param dst Output image with the same size and type as src .\n@param templateWindowSize Size in pixels of the template patch that is used to compute weights.\nShould be odd. Recommended value 7 pixels\n@param searchWindowSize Size in pixels of the window that is used to compute weighted average for\ngiven pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater\ndenoising time. Recommended value 21 pixels\n@param h Parameter regulating filter strength. Big h value perfectly removes noise but also\nremoves image details, smaller h value preserves details but also preserves some noise\n\nThis function expected to be applied to grayscale images. For colored images look at\nfastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored\nimage in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting\nimage to CIELAB colorspace and then separately denoise L and AB components with different h\nparameter.\n */\nCV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float h = 3,\n        int templateWindowSize = 7, int searchWindowSize = 21);\n\n/** @brief Perform image denoising using Non-local Means Denoising algorithm\n<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational\noptimizations. Noise expected to be a gaussian white noise\n\n@param src Input 8-bit or 16-bit (only with NORM_L1) 1-channel,\n2-channel, 3-channel or 4-channel image.\n@param dst Output image with the same size and type as src .\n@param templateWindowSize Size in pixels of the template patch that is used to compute weights.\nShould be odd. Recommended value 7 pixels\n@param searchWindowSize Size in pixels of the window that is used to compute weighted average for\ngiven pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater\ndenoising time. Recommended value 21 pixels\n@param h Array of parameters regulating filter strength, either one\nparameter applied to all channels or one per channel in dst. Big h value\nperfectly removes noise but also removes image details, smaller h\nvalue preserves details but also preserves some noise\n@param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1\n\nThis function expected to be applied to grayscale images. For colored images look at\nfastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored\nimage in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting\nimage to CIELAB colorspace and then separately denoise L and AB components with different h\nparameter.\n */\nCV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst,\n                                        const std::vector<float>& h,\n                                        int templateWindowSize = 7, int searchWindowSize = 21,\n                                        int normType = NORM_L2);\n\n/** @brief Modification of fastNlMeansDenoising function for colored images\n\n@param src Input 8-bit 3-channel image.\n@param dst Output image with the same size and type as src .\n@param templateWindowSize Size in pixels of the template patch that is used to compute weights.\nShould be odd. Recommended value 7 pixels\n@param searchWindowSize Size in pixels of the window that is used to compute weighted average for\ngiven pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater\ndenoising time. Recommended value 21 pixels\n@param h Parameter regulating filter strength for luminance component. Bigger h value perfectly\nremoves noise but also removes image details, smaller h value preserves details but also preserves\nsome noise\n@param hColor The same as h but for color components. For most images value equals 10\nwill be enough to remove colored noise and do not distort colors\n\nThe function converts image to CIELAB colorspace and then separately denoise L and AB components\nwith given h parameters using fastNlMeansDenoising function.\n */\nCV_EXPORTS_W void fastNlMeansDenoisingColored( InputArray src, OutputArray dst,\n        float h = 3, float hColor = 3,\n        int templateWindowSize = 7, int searchWindowSize = 21);\n\n/** @brief Modification of fastNlMeansDenoising function for images sequence where consecutive images have been\ncaptured in small period of time. For example video. This version of the function is for grayscale\nimages or for manual manipulation with colorspaces. For more details see\n<http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131.6394>\n\n@param srcImgs Input 8-bit 1-channel, 2-channel, 3-channel or\n4-channel images sequence. All images should have the same type and\nsize.\n@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence\n@param temporalWindowSize Number of surrounding images to use for target image denoising. Should\nbe odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to\nimgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise\nsrcImgs[imgToDenoiseIndex] image.\n@param dst Output image with the same size and type as srcImgs images.\n@param templateWindowSize Size in pixels of the template patch that is used to compute weights.\nShould be odd. Recommended value 7 pixels\n@param searchWindowSize Size in pixels of the window that is used to compute weighted average for\ngiven pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater\ndenoising time. Recommended value 21 pixels\n@param h Parameter regulating filter strength. Bigger h value\nperfectly removes noise but also removes image details, smaller h\nvalue preserves details but also preserves some noise\n */\nCV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst,\n        int imgToDenoiseIndex, int temporalWindowSize,\n        float h = 3, int templateWindowSize = 7, int searchWindowSize = 21);\n\n/** @brief Modification of fastNlMeansDenoising function for images sequence where consecutive images have been\ncaptured in small period of time. For example video. This version of the function is for grayscale\nimages or for manual manipulation with colorspaces. For more details see\n<http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131.6394>\n\n@param srcImgs Input 8-bit or 16-bit (only with NORM_L1) 1-channel,\n2-channel, 3-channel or 4-channel images sequence. All images should\nhave the same type and size.\n@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence\n@param temporalWindowSize Number of surrounding images to use for target image denoising. Should\nbe odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to\nimgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise\nsrcImgs[imgToDenoiseIndex] image.\n@param dst Output image with the same size and type as srcImgs images.\n@param templateWindowSize Size in pixels of the template patch that is used to compute weights.\nShould be odd. Recommended value 7 pixels\n@param searchWindowSize Size in pixels of the window that is used to compute weighted average for\ngiven pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater\ndenoising time. Recommended value 21 pixels\n@param h Array of parameters regulating filter strength, either one\nparameter applied to all channels or one per channel in dst. Big h value\nperfectly removes noise but also removes image details, smaller h\nvalue preserves details but also preserves some noise\n@param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1\n */\nCV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst,\n                                             int imgToDenoiseIndex, int temporalWindowSize,\n                                             const std::vector<float>& h,\n                                             int templateWindowSize = 7, int searchWindowSize = 21,\n                                             int normType = NORM_L2);\n\n/** @brief Modification of fastNlMeansDenoisingMulti function for colored images sequences\n\n@param srcImgs Input 8-bit 3-channel images sequence. All images should have the same type and\nsize.\n@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence\n@param temporalWindowSize Number of surrounding images to use for target image denoising. Should\nbe odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to\nimgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise\nsrcImgs[imgToDenoiseIndex] image.\n@param dst Output image with the same size and type as srcImgs images.\n@param templateWindowSize Size in pixels of the template patch that is used to compute weights.\nShould be odd. Recommended value 7 pixels\n@param searchWindowSize Size in pixels of the window that is used to compute weighted average for\ngiven pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater\ndenoising time. Recommended value 21 pixels\n@param h Parameter regulating filter strength for luminance component. Bigger h value perfectly\nremoves noise but also removes image details, smaller h value preserves details but also preserves\nsome noise.\n@param hColor The same as h but for color components.\n\nThe function converts images to CIELAB colorspace and then separately denoise L and AB components\nwith given h parameters using fastNlMeansDenoisingMulti function.\n */\nCV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst,\n        int imgToDenoiseIndex, int temporalWindowSize,\n        float h = 3, float hColor = 3,\n        int templateWindowSize = 7, int searchWindowSize = 21);\n\n/** @brief Primal-dual algorithm is an algorithm for solving special types of variational problems (that is,\nfinding a function to minimize some functional). As the image denoising, in particular, may be seen\nas the variational problem, primal-dual algorithm then can be used to perform denoising and this is\nexactly what is implemented.\n\nIt should be noted, that this implementation was taken from the July 2013 blog entry\n@cite MA13 , which also contained (slightly more general) ready-to-use source code on Python.\nSubsequently, that code was rewritten on C++ with the usage of openCV by Vadim Pisarevsky at the end\nof July 2013 and finally it was slightly adapted by later authors.\n\nAlthough the thorough discussion and justification of the algorithm involved may be found in\n@cite ChambolleEtAl, it might make sense to skim over it here, following @cite MA13 . To begin\nwith, we consider the 1-byte gray-level images as the functions from the rectangular domain of\npixels (it may be seen as set\n\\f$\\left\\{(x,y)\\in\\mathbb{N}\\times\\mathbb{N}\\mid 1\\leq x\\leq n,\\;1\\leq y\\leq m\\right\\}\\f$ for some\n\\f$m,\\;n\\in\\mathbb{N}\\f$) into \\f$\\{0,1,\\dots,255\\}\\f$. We shall denote the noised images as \\f$f_i\\f$ and with\nthis view, given some image \\f$x\\f$ of the same size, we may measure how bad it is by the formula\n\n\\f[\\left\\|\\left\\|\\nabla x\\right\\|\\right\\| + \\lambda\\sum_i\\left\\|\\left\\|x-f_i\\right\\|\\right\\|\\f]\n\n\\f$\\|\\|\\cdot\\|\\|\\f$ here denotes \\f$L_2\\f$-norm and as you see, the first addend states that we want our\nimage to be smooth (ideally, having zero gradient, thus being constant) and the second states that\nwe want our result to be close to the observations we've got. If we treat \\f$x\\f$ as a function, this is\nexactly the functional what we seek to minimize and here the Primal-Dual algorithm comes into play.\n\n@param observations This array should contain one or more noised versions of the image that is to\nbe restored.\n@param result Here the denoised image will be stored. There is no need to do pre-allocation of\nstorage space, as it will be automatically allocated, if necessary.\n@param lambda Corresponds to \\f$\\lambda\\f$ in the formulas above. As it is enlarged, the smooth\n(blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly\nspeaking, as it becomes smaller, the result will be more blur but more sever outliers will be\nremoved.\n@param niters Number of iterations that the algorithm will run. Of course, as more iterations as\nbetter, but it is hard to quantitatively refine this statement, so just use the default and\nincrease it if the results are poor.\n */\nCV_EXPORTS_W void denoise_TVL1(const std::vector<Mat>& observations,Mat& result, double lambda=1.0, int niters=30);\n\n//! @} photo_denoise\n\n//! @addtogroup photo_hdr\n//! @{\n\nenum { LDR_SIZE = 256 };\n\n/** @brief Base class for tonemapping algorithms - tools that are used to map HDR image to 8-bit range.\n */\nclass CV_EXPORTS_W Tonemap : public Algorithm\n{\npublic:\n    /** @brief Tonemaps image\n\n    @param src source image - CV_32FC3 Mat (float 32 bits 3 channels)\n    @param dst destination image - CV_32FC3 Mat with values in [0, 1] range\n     */\n    CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0;\n\n    CV_WRAP virtual float getGamma() const = 0;\n    CV_WRAP virtual void setGamma(float gamma) = 0;\n};\n\n/** @brief Creates simple linear mapper with gamma correction\n\n@param gamma positive value for gamma correction. Gamma value of 1.0 implies no correction, gamma\nequal to 2.2f is suitable for most displays.\nGenerally gamma \\> 1 brightens the image and gamma \\< 1 darkens it.\n */\nCV_EXPORTS_W Ptr<Tonemap> createTonemap(float gamma = 1.0f);\n\n/** @brief Adaptive logarithmic mapping is a fast global tonemapping algorithm that scales the image in\nlogarithmic domain.\n\nSince it's a global operator the same function is applied to all the pixels, it is controlled by the\nbias parameter.\n\nOptional saturation enhancement is possible as described in @cite FL02 .\n\nFor more information see @cite DM03 .\n */\nclass CV_EXPORTS_W TonemapDrago : public Tonemap\n{\npublic:\n\n    CV_WRAP virtual float getSaturation() const = 0;\n    CV_WRAP virtual void setSaturation(float saturation) = 0;\n\n    CV_WRAP virtual float getBias() const = 0;\n    CV_WRAP virtual void setBias(float bias) = 0;\n};\n\n/** @brief Creates TonemapDrago object\n\n@param gamma gamma value for gamma correction. See createTonemap\n@param saturation positive saturation enhancement value. 1.0 preserves saturation, values greater\nthan 1 increase saturation and values less than 1 decrease it.\n@param bias value for bias function in [0, 1] range. Values from 0.7 to 0.9 usually give best\nresults, default value is 0.85.\n */\nCV_EXPORTS_W Ptr<TonemapDrago> createTonemapDrago(float gamma = 1.0f, float saturation = 1.0f, float bias = 0.85f);\n\n\n/** @brief This is a global tonemapping operator that models human visual system.\n\nMapping function is controlled by adaptation parameter, that is computed using light adaptation and\ncolor adaptation.\n\nFor more information see @cite RD05 .\n */\nclass CV_EXPORTS_W TonemapReinhard : public Tonemap\n{\npublic:\n    CV_WRAP virtual float getIntensity() const = 0;\n    CV_WRAP virtual void setIntensity(float intensity) = 0;\n\n    CV_WRAP virtual float getLightAdaptation() const = 0;\n    CV_WRAP virtual void setLightAdaptation(float light_adapt) = 0;\n\n    CV_WRAP virtual float getColorAdaptation() const = 0;\n    CV_WRAP virtual void setColorAdaptation(float color_adapt) = 0;\n};\n\n/** @brief Creates TonemapReinhard object\n\n@param gamma gamma value for gamma correction. See createTonemap\n@param intensity result intensity in [-8, 8] range. Greater intensity produces brighter results.\n@param light_adapt light adaptation in [0, 1] range. If 1 adaptation is based only on pixel\nvalue, if 0 it's global, otherwise it's a weighted mean of this two cases.\n@param color_adapt chromatic adaptation in [0, 1] range. If 1 channels are treated independently,\nif 0 adaptation level is the same for each channel.\n */\nCV_EXPORTS_W Ptr<TonemapReinhard>\ncreateTonemapReinhard(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f);\n\n/** @brief This algorithm transforms image to contrast using gradients on all levels of gaussian pyramid,\ntransforms contrast values to HVS response and scales the response. After this the image is\nreconstructed from new contrast values.\n\nFor more information see @cite MM06 .\n */\nclass CV_EXPORTS_W TonemapMantiuk : public Tonemap\n{\npublic:\n    CV_WRAP virtual float getScale() const = 0;\n    CV_WRAP virtual void setScale(float scale) = 0;\n\n    CV_WRAP virtual float getSaturation() const = 0;\n    CV_WRAP virtual void setSaturation(float saturation) = 0;\n};\n\n/** @brief Creates TonemapMantiuk object\n\n@param gamma gamma value for gamma correction. See createTonemap\n@param scale contrast scale factor. HVS response is multiplied by this parameter, thus compressing\ndynamic range. Values from 0.6 to 0.9 produce best results.\n@param saturation saturation enhancement value. See createTonemapDrago\n */\nCV_EXPORTS_W Ptr<TonemapMantiuk>\ncreateTonemapMantiuk(float gamma = 1.0f, float scale = 0.7f, float saturation = 1.0f);\n\n/** @brief The base class for algorithms that align images of the same scene with different exposures\n */\nclass CV_EXPORTS_W AlignExposures : public Algorithm\n{\npublic:\n    /** @brief Aligns images\n\n    @param src vector of input images\n    @param dst vector of aligned images\n    @param times vector of exposure time values for each image\n    @param response 256x1 matrix with inverse camera response function for each pixel value, it should\n    have the same number of channels as images.\n     */\n    CV_WRAP virtual void process(InputArrayOfArrays src, std::vector<Mat>& dst,\n                                 InputArray times, InputArray response) = 0;\n};\n\n/** @brief This algorithm converts images to median threshold bitmaps (1 for pixels brighter than median\nluminance and 0 otherwise) and than aligns the resulting bitmaps using bit operations.\n\nIt is invariant to exposure, so exposure values and camera response are not necessary.\n\nIn this implementation new image regions are filled with zeros.\n\nFor more information see @cite GW03 .\n */\nclass CV_EXPORTS_W AlignMTB : public AlignExposures\n{\npublic:\n    CV_WRAP virtual void process(InputArrayOfArrays src, std::vector<Mat>& dst,\n                                 InputArray times, InputArray response) CV_OVERRIDE = 0;\n\n    /** @brief Short version of process, that doesn't take extra arguments.\n\n    @param src vector of input images\n    @param dst vector of aligned images\n     */\n    CV_WRAP virtual void process(InputArrayOfArrays src, std::vector<Mat>& dst) = 0;\n\n    /** @brief Calculates shift between two images, i. e. how to shift the second image to correspond it with the\n    first.\n\n    @param img0 first image\n    @param img1 second image\n     */\n    CV_WRAP virtual Point calculateShift(InputArray img0, InputArray img1) = 0;\n    /** @brief Helper function, that shift Mat filling new regions with zeros.\n\n    @param src input image\n    @param dst result image\n    @param shift shift value\n     */\n    CV_WRAP virtual void shiftMat(InputArray src, OutputArray dst, const Point shift) = 0;\n    /** @brief Computes median threshold and exclude bitmaps of given image.\n\n    @param img input image\n    @param tb median threshold bitmap\n    @param eb exclude bitmap\n     */\n    CV_WRAP virtual void computeBitmaps(InputArray img, OutputArray tb, OutputArray eb) = 0;\n\n    CV_WRAP virtual int getMaxBits() const = 0;\n    CV_WRAP virtual void setMaxBits(int max_bits) = 0;\n\n    CV_WRAP virtual int getExcludeRange() const = 0;\n    CV_WRAP virtual void setExcludeRange(int exclude_range) = 0;\n\n    CV_WRAP virtual bool getCut() const = 0;\n    CV_WRAP virtual void setCut(bool value) = 0;\n};\n\n/** @brief Creates AlignMTB object\n\n@param max_bits logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are\nusually good enough (31 and 63 pixels shift respectively).\n@param exclude_range range for exclusion bitmap that is constructed to suppress noise around the\nmedian value.\n@param cut if true cuts images, otherwise fills the new regions with zeros.\n */\nCV_EXPORTS_W Ptr<AlignMTB> createAlignMTB(int max_bits = 6, int exclude_range = 4, bool cut = true);\n\n/** @brief The base class for camera response calibration algorithms.\n */\nclass CV_EXPORTS_W CalibrateCRF : public Algorithm\n{\npublic:\n    /** @brief Recovers inverse camera response.\n\n    @param src vector of input images\n    @param dst 256x1 matrix with inverse camera response function\n    @param times vector of exposure time values for each image\n     */\n    CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0;\n};\n\n/** @brief Inverse camera response function is extracted for each brightness value by minimizing an objective\nfunction as linear system. Objective function is constructed using pixel values on the same position\nin all images, extra term is added to make the result smoother.\n\nFor more information see @cite DM97 .\n */\nclass CV_EXPORTS_W CalibrateDebevec : public CalibrateCRF\n{\npublic:\n    CV_WRAP virtual float getLambda() const = 0;\n    CV_WRAP virtual void setLambda(float lambda) = 0;\n\n    CV_WRAP virtual int getSamples() const = 0;\n    CV_WRAP virtual void setSamples(int samples) = 0;\n\n    CV_WRAP virtual bool getRandom() const = 0;\n    CV_WRAP virtual void setRandom(bool random) = 0;\n};\n\n/** @brief Creates CalibrateDebevec object\n\n@param samples number of pixel locations to use\n@param lambda smoothness term weight. Greater values produce smoother results, but can alter the\nresponse.\n@param random if true sample pixel locations are chosen at random, otherwise they form a\nrectangular grid.\n */\nCV_EXPORTS_W Ptr<CalibrateDebevec> createCalibrateDebevec(int samples = 70, float lambda = 10.0f, bool random = false);\n\n/** @brief Inverse camera response function is extracted for each brightness value by minimizing an objective\nfunction as linear system. This algorithm uses all image pixels.\n\nFor more information see @cite RB99 .\n */\nclass CV_EXPORTS_W CalibrateRobertson : public CalibrateCRF\n{\npublic:\n    CV_WRAP virtual int getMaxIter() const = 0;\n    CV_WRAP virtual void setMaxIter(int max_iter) = 0;\n\n    CV_WRAP virtual float getThreshold() const = 0;\n    CV_WRAP virtual void setThreshold(float threshold) = 0;\n\n    CV_WRAP virtual Mat getRadiance() const = 0;\n};\n\n/** @brief Creates CalibrateRobertson object\n\n@param max_iter maximal number of Gauss-Seidel solver iterations.\n@param threshold target difference between results of two successive steps of the minimization.\n */\nCV_EXPORTS_W Ptr<CalibrateRobertson> createCalibrateRobertson(int max_iter = 30, float threshold = 0.01f);\n\n/** @brief The base class algorithms that can merge exposure sequence to a single image.\n */\nclass CV_EXPORTS_W MergeExposures : public Algorithm\n{\npublic:\n    /** @brief Merges images.\n\n    @param src vector of input images\n    @param dst result image\n    @param times vector of exposure time values for each image\n    @param response 256x1 matrix with inverse camera response function for each pixel value, it should\n    have the same number of channels as images.\n     */\n    CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,\n                                 InputArray times, InputArray response) = 0;\n};\n\n/** @brief The resulting HDR image is calculated as weighted average of the exposures considering exposure\nvalues and camera response.\n\nFor more information see @cite DM97 .\n */\nclass CV_EXPORTS_W MergeDebevec : public MergeExposures\n{\npublic:\n    CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,\n                                 InputArray times, InputArray response) CV_OVERRIDE = 0;\n    CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0;\n};\n\n/** @brief Creates MergeDebevec object\n */\nCV_EXPORTS_W Ptr<MergeDebevec> createMergeDebevec();\n\n/** @brief Pixels are weighted using contrast, saturation and well-exposedness measures, than images are\ncombined using laplacian pyramids.\n\nThe resulting image weight is constructed as weighted average of contrast, saturation and\nwell-exposedness measures.\n\nThe resulting image doesn't require tonemapping and can be converted to 8-bit image by multiplying\nby 255, but it's recommended to apply gamma correction and/or linear tonemapping.\n\nFor more information see @cite MK07 .\n */\nclass CV_EXPORTS_W MergeMertens : public MergeExposures\n{\npublic:\n    CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,\n                                 InputArray times, InputArray response) CV_OVERRIDE = 0;\n    /** @brief Short version of process, that doesn't take extra arguments.\n\n    @param src vector of input images\n    @param dst result image\n     */\n    CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst) = 0;\n\n    CV_WRAP virtual float getContrastWeight() const = 0;\n    CV_WRAP virtual void setContrastWeight(float contrast_weiht) = 0;\n\n    CV_WRAP virtual float getSaturationWeight() const = 0;\n    CV_WRAP virtual void setSaturationWeight(float saturation_weight) = 0;\n\n    CV_WRAP virtual float getExposureWeight() const = 0;\n    CV_WRAP virtual void setExposureWeight(float exposure_weight) = 0;\n};\n\n/** @brief Creates MergeMertens object\n\n@param contrast_weight contrast measure weight. See MergeMertens.\n@param saturation_weight saturation measure weight\n@param exposure_weight well-exposedness measure weight\n */\nCV_EXPORTS_W Ptr<MergeMertens>\ncreateMergeMertens(float contrast_weight = 1.0f, float saturation_weight = 1.0f, float exposure_weight = 0.0f);\n\n/** @brief The resulting HDR image is calculated as weighted average of the exposures considering exposure\nvalues and camera response.\n\nFor more information see @cite RB99 .\n */\nclass CV_EXPORTS_W MergeRobertson : public MergeExposures\n{\npublic:\n    CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,\n                                 InputArray times, InputArray response) CV_OVERRIDE = 0;\n    CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0;\n};\n\n/** @brief Creates MergeRobertson object\n */\nCV_EXPORTS_W Ptr<MergeRobertson> createMergeRobertson();\n\n//! @} photo_hdr\n\n//! @addtogroup photo_decolor\n//! @{\n\n/** @brief Transforms a color image to a grayscale image. It is a basic tool in digital printing, stylized\nblack-and-white photograph rendering, and in many single channel image processing applications\n@cite CL12 .\n\n@param src Input 8-bit 3-channel image.\n@param grayscale Output 8-bit 1-channel image.\n@param color_boost Output 8-bit 3-channel image.\n\nThis function is to be applied on color images.\n */\nCV_EXPORTS_W void decolor( InputArray src, OutputArray grayscale, OutputArray color_boost);\n\n//! @} photo_decolor\n\n//! @addtogroup photo_clone\n//! @{\n\n\n//! seamlessClone algorithm flags\nenum\n{\n    /** The power of the method is fully expressed when inserting objects with complex outlines into a new background*/\n    NORMAL_CLONE = 1,\n    /** The classic method, color-based selection and alpha masking might be time consuming and often leaves an undesirable\n    halo. Seamless cloning, even averaged with the original image, is not effective. Mixed seamless cloning based on a loose selection proves effective.*/\n    MIXED_CLONE  = 2,\n    /** Monochrome transfer allows the user to easily replace certain features of one object by alternative features.*/\n    MONOCHROME_TRANSFER = 3};\n\n\n/** @example samples/cpp/tutorial_code/photo/seamless_cloning/cloning_demo.cpp\nAn example using seamlessClone function\n*/\n/** @brief Image editing tasks concern either global changes (color/intensity corrections, filters,\ndeformations) or local changes concerned to a selection. Here we are interested in achieving local\nchanges, ones that are restricted to a region manually selected (ROI), in a seamless and effortless\nmanner. The extent of the changes ranges from slight distortions to complete replacement by novel\ncontent @cite PM03 .\n\n@param src Input 8-bit 3-channel image.\n@param dst Input 8-bit 3-channel image.\n@param mask Input 8-bit 1 or 3-channel image.\n@param p Point in dst image where object is placed.\n@param blend Output image with the same size and type as dst.\n@param flags Cloning method that could be cv::NORMAL_CLONE, cv::MIXED_CLONE or cv::MONOCHROME_TRANSFER\n */\nCV_EXPORTS_W void seamlessClone( InputArray src, InputArray dst, InputArray mask, Point p,\n        OutputArray blend, int flags);\n\n/** @brief Given an original color image, two differently colored versions of this image can be mixed\nseamlessly.\n\n@param src Input 8-bit 3-channel image.\n@param mask Input 8-bit 1 or 3-channel image.\n@param dst Output image with the same size and type as src .\n@param red_mul R-channel multiply factor.\n@param green_mul G-channel multiply factor.\n@param blue_mul B-channel multiply factor.\n\nMultiplication factor is between .5 to 2.5.\n */\nCV_EXPORTS_W void colorChange(InputArray src, InputArray mask, OutputArray dst, float red_mul = 1.0f,\n        float green_mul = 1.0f, float blue_mul = 1.0f);\n\n/** @brief Applying an appropriate non-linear transformation to the gradient field inside the selection and\nthen integrating back with a Poisson solver, modifies locally the apparent illumination of an image.\n\n@param src Input 8-bit 3-channel image.\n@param mask Input 8-bit 1 or 3-channel image.\n@param dst Output image with the same size and type as src.\n@param alpha Value ranges between 0-2.\n@param beta Value ranges between 0-2.\n\nThis is useful to highlight under-exposed foreground objects or to reduce specular reflections.\n */\nCV_EXPORTS_W void illuminationChange(InputArray src, InputArray mask, OutputArray dst,\n        float alpha = 0.2f, float beta = 0.4f);\n\n/** @brief By retaining only the gradients at edge locations, before integrating with the Poisson solver, one\nwashes out the texture of the selected region, giving its contents a flat aspect. Here Canny Edge %Detector is used.\n\n@param src Input 8-bit 3-channel image.\n@param mask Input 8-bit 1 or 3-channel image.\n@param dst Output image with the same size and type as src.\n@param low_threshold %Range from 0 to 100.\n@param high_threshold Value \\> 100.\n@param kernel_size The size of the Sobel kernel to be used.\n\n@note\nThe algorithm assumes that the color of the source image is close to that of the destination. This\nassumption means that when the colors don't match, the source image color gets tinted toward the\ncolor of the destination image.\n */\nCV_EXPORTS_W void textureFlattening(InputArray src, InputArray mask, OutputArray dst,\n        float low_threshold = 30, float high_threshold = 45,\n        int kernel_size = 3);\n\n//! @} photo_clone\n\n//! @addtogroup photo_render\n//! @{\n\n//! Edge preserving filters\nenum\n{\n    RECURS_FILTER = 1, //!< Recursive Filtering\n    NORMCONV_FILTER = 2 //!< Normalized Convolution Filtering\n};\n\n/** @brief Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing\nfilters are used in many different applications @cite EM11 .\n\n@param src Input 8-bit 3-channel image.\n@param dst Output 8-bit 3-channel image.\n@param flags Edge preserving filters: cv::RECURS_FILTER or cv::NORMCONV_FILTER\n@param sigma_s %Range between 0 to 200.\n@param sigma_r %Range between 0 to 1.\n */\nCV_EXPORTS_W void edgePreservingFilter(InputArray src, OutputArray dst, int flags = 1,\n        float sigma_s = 60, float sigma_r = 0.4f);\n\n/** @brief This filter enhances the details of a particular image.\n\n@param src Input 8-bit 3-channel image.\n@param dst Output image with the same size and type as src.\n@param sigma_s %Range between 0 to 200.\n@param sigma_r %Range between 0 to 1.\n */\nCV_EXPORTS_W void detailEnhance(InputArray src, OutputArray dst, float sigma_s = 10,\n        float sigma_r = 0.15f);\n\n/** @example samples/cpp/tutorial_code/photo/non_photorealistic_rendering/npr_demo.cpp\nAn example using non-photorealistic line drawing functions\n*/\n/** @brief Pencil-like non-photorealistic line drawing\n\n@param src Input 8-bit 3-channel image.\n@param dst1 Output 8-bit 1-channel image.\n@param dst2 Output image with the same size and type as src.\n@param sigma_s %Range between 0 to 200.\n@param sigma_r %Range between 0 to 1.\n@param shade_factor %Range between 0 to 0.1.\n */\nCV_EXPORTS_W void pencilSketch(InputArray src, OutputArray dst1, OutputArray dst2,\n        float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f);\n\n/** @brief Stylization aims to produce digital imagery with a wide variety of effects not focused on\nphotorealism. Edge-aware filters are ideal for stylization, as they can abstract regions of low\ncontrast while preserving, or enhancing, high-contrast features.\n\n@param src Input 8-bit 3-channel image.\n@param dst Output image with the same size and type as src.\n@param sigma_s %Range between 0 to 200.\n@param sigma_r %Range between 0 to 1.\n */\nCV_EXPORTS_W void stylization(InputArray src, OutputArray dst, float sigma_s = 60,\n        float sigma_r = 0.45f);\n\n//! @} photo_render\n\n//! @} photo\n\n} // cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/autocalib.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_AUTOCALIB_HPP\n#define OPENCV_STITCHING_AUTOCALIB_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"matchers.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching_autocalib\n//! @{\n\n/** @brief Tries to estimate focal lengths from the given homography under the assumption that the camera\nundergoes rotations around its centre only.\n\n@param H Homography.\n@param f0 Estimated focal length along X axis.\n@param f1 Estimated focal length along Y axis.\n@param f0_ok True, if f0 was estimated successfully, false otherwise.\n@param f1_ok True, if f1 was estimated successfully, false otherwise.\n\nSee \"Construction of Panoramic Image Mosaics with Global and Local Alignment\"\nby Heung-Yeung Shum and Richard Szeliski.\n */\nvoid CV_EXPORTS_W focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok);\n\n/** @brief Estimates focal lengths for each given camera.\n\n@param features Features of images.\n@param pairwise_matches Matches between all image pairs.\n@param focals Estimated focal lengths for each camera.\n */\nvoid CV_EXPORTS estimateFocal(const std::vector<ImageFeatures> &features,\n                              const std::vector<MatchesInfo> &pairwise_matches,\n                              std::vector<double> &focals);\n\nbool CV_EXPORTS_W calibrateRotatingCamera(const std::vector<Mat> &Hs,CV_OUT Mat &K);\n\n//! @} stitching_autocalib\n\n} // namespace detail\n} // namespace cv\n\n#endif // OPENCV_STITCHING_AUTOCALIB_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/blenders.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_BLENDERS_HPP\n#define OPENCV_STITCHING_BLENDERS_HPP\n\n#if defined(NO)\n#  warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers.\n#endif\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/core/cuda.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching_blend\n//! @{\n\n/** @brief Base class for all blenders.\n\nSimple blender which puts one image over another\n*/\nclass CV_EXPORTS_W Blender\n{\npublic:\n    virtual ~Blender() {}\n\n    enum { NO, FEATHER, MULTI_BAND };\n    CV_WRAP static Ptr<Blender> createDefault(int type, bool try_gpu = false);\n\n    /** @brief Prepares the blender for blending.\n\n    @param corners Source images top-left corners\n    @param sizes Source image sizes\n     */\n    CV_WRAP virtual void prepare(const std::vector<Point> &corners, const std::vector<Size> &sizes);\n    /** @overload */\n    CV_WRAP virtual void prepare(Rect dst_roi);\n    /** @brief Processes the image.\n\n    @param img Source image\n    @param mask Source image mask\n    @param tl Source image top-left corners\n     */\n    CV_WRAP virtual void feed(InputArray img, InputArray mask, Point tl);\n    /** @brief Blends and returns the final pano.\n\n    @param dst Final pano\n    @param dst_mask Final pano mask\n     */\n    CV_WRAP virtual void blend(CV_IN_OUT InputOutputArray dst,CV_IN_OUT  InputOutputArray dst_mask);\n\nprotected:\n    UMat dst_, dst_mask_;\n    Rect dst_roi_;\n};\n\n/** @brief Simple blender which mixes images at its borders.\n */\nclass CV_EXPORTS_W FeatherBlender : public Blender\n{\npublic:\n    CV_WRAP FeatherBlender(float sharpness = 0.02f);\n\n    CV_WRAP float sharpness() const { return sharpness_; }\n    CV_WRAP void setSharpness(float val) { sharpness_ = val; }\n\n    CV_WRAP void prepare(Rect dst_roi) CV_OVERRIDE;\n    CV_WRAP void feed(InputArray img, InputArray mask, Point tl) CV_OVERRIDE;\n    CV_WRAP void blend(InputOutputArray dst, InputOutputArray dst_mask) CV_OVERRIDE;\n\n    //! Creates weight maps for fixed set of source images by their masks and top-left corners.\n    //! Final image can be obtained by simple weighting of the source images.\n    CV_WRAP Rect createWeightMaps(const std::vector<UMat> &masks, const std::vector<Point> &corners,\n        CV_IN_OUT std::vector<UMat> &weight_maps);\n\nprivate:\n    float sharpness_;\n    UMat weight_map_;\n    UMat dst_weight_map_;\n};\n\ninline FeatherBlender::FeatherBlender(float _sharpness) { setSharpness(_sharpness); }\n\n/** @brief Blender which uses multi-band blending algorithm (see @cite BA83).\n */\nclass CV_EXPORTS_W MultiBandBlender : public Blender\n{\npublic:\n    CV_WRAP MultiBandBlender(int try_gpu = false, int num_bands = 5, int weight_type = CV_32F);\n\n    CV_WRAP int numBands() const { return actual_num_bands_; }\n    CV_WRAP void setNumBands(int val) { actual_num_bands_ = val; }\n\n    CV_WRAP void prepare(Rect dst_roi) CV_OVERRIDE;\n    CV_WRAP void feed(InputArray img, InputArray mask, Point tl) CV_OVERRIDE;\n    CV_WRAP void blend(CV_IN_OUT InputOutputArray dst, CV_IN_OUT InputOutputArray dst_mask) CV_OVERRIDE;\n\nprivate:\n    int actual_num_bands_, num_bands_;\n    std::vector<UMat> dst_pyr_laplace_;\n    std::vector<UMat> dst_band_weights_;\n    Rect dst_roi_final_;\n    bool can_use_gpu_;\n    int weight_type_; //CV_32F or CV_16S\n#if defined(HAVE_OPENCV_CUDAARITHM) && defined(HAVE_OPENCV_CUDAWARPING)\n    std::vector<cuda::GpuMat> gpu_dst_pyr_laplace_;\n    std::vector<cuda::GpuMat> gpu_dst_band_weights_;\n    std::vector<Point> gpu_tl_points_;\n    std::vector<cuda::GpuMat> gpu_imgs_with_border_;\n    std::vector<std::vector<cuda::GpuMat> > gpu_weight_pyr_gauss_vec_;\n    std::vector<std::vector<cuda::GpuMat> > gpu_src_pyr_laplace_vec_;\n    std::vector<std::vector<cuda::GpuMat> > gpu_ups_;\n    cuda::GpuMat gpu_dst_mask_;\n    cuda::GpuMat gpu_mask_;\n    cuda::GpuMat gpu_img_;\n    cuda::GpuMat gpu_weight_map_;\n    cuda::GpuMat gpu_add_mask_;\n    int gpu_feed_idx_;\n    bool gpu_initialized_;\n#endif\n};\n\n\n//////////////////////////////////////////////////////////////////////////////\n// Auxiliary functions\n\nvoid CV_EXPORTS_W normalizeUsingWeightMap(InputArray weight, CV_IN_OUT InputOutputArray src);\n\nvoid CV_EXPORTS_W createWeightMap(InputArray mask, float sharpness, CV_IN_OUT InputOutputArray weight);\n\nvoid CV_EXPORTS_W createLaplacePyr(InputArray img, int num_levels, CV_IN_OUT std::vector<UMat>& pyr);\nvoid CV_EXPORTS_W createLaplacePyrGpu(InputArray img, int num_levels, CV_IN_OUT std::vector<UMat>& pyr);\n\n// Restores source image\nvoid CV_EXPORTS_W restoreImageFromLaplacePyr(CV_IN_OUT std::vector<UMat>& pyr);\nvoid CV_EXPORTS_W restoreImageFromLaplacePyrGpu(CV_IN_OUT std::vector<UMat>& pyr);\n\n//! @}\n\n} // namespace detail\n} // namespace cv\n\n#endif // OPENCV_STITCHING_BLENDERS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/camera.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_CAMERA_HPP\n#define OPENCV_STITCHING_CAMERA_HPP\n\n#include \"opencv2/core.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching\n//! @{\n\n/** @brief Describes camera parameters.\n\n@note Translation is assumed to be zero during the whole stitching pipeline. :\n */\nstruct CV_EXPORTS_W_SIMPLE CameraParams\n{\n    CameraParams();\n    CameraParams(const CameraParams& other);\n    CameraParams& operator =(const CameraParams& other);\n    CV_WRAP Mat K() const;\n\n    CV_PROP_RW double focal; // Focal length\n    CV_PROP_RW double aspect; // Aspect ratio\n    CV_PROP_RW double ppx; // Principal point X\n    CV_PROP_RW double ppy; // Principal point Y\n    CV_PROP_RW Mat R; // Rotation\n    CV_PROP_RW Mat t; // Translation\n};\n\n//! @}\n\n} // namespace detail\n} // namespace cv\n\n#endif // #ifndef OPENCV_STITCHING_CAMERA_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/exposure_compensate.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP\n#define OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP\n\n#if defined(NO)\n#  warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers.\n#endif\n\n#include \"opencv2/core.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching_exposure\n//! @{\n\n/** @brief Base class for all exposure compensators.\n */\nclass CV_EXPORTS_W ExposureCompensator\n{\npublic:\n    ExposureCompensator(): updateGain(true) {}\n    virtual ~ExposureCompensator() {}\n\n    enum { NO, GAIN, GAIN_BLOCKS, CHANNELS, CHANNELS_BLOCKS };\n    CV_WRAP static Ptr<ExposureCompensator> createDefault(int type);\n\n    /**\n    @param corners Source image top-left corners\n    @param images Source images\n    @param masks Image masks to update (second value in pair specifies the value which should be used\n    to detect where image is)\n        */\n    CV_WRAP void feed(const std::vector<Point> &corners, const std::vector<UMat> &images,\n        const std::vector<UMat> &masks);\n    /** @overload */\n    virtual void feed(const std::vector<Point> &corners, const std::vector<UMat> &images,\n        const std::vector<std::pair<UMat, uchar> > &masks) = 0;\n    /** @brief Compensate exposure in the specified image.\n\n    @param index Image index\n    @param corner Image top-left corner\n    @param image Image to process\n    @param mask Image mask\n        */\n    CV_WRAP virtual void apply(int index, Point corner, InputOutputArray image, InputArray mask) = 0;\n    CV_WRAP virtual void getMatGains(CV_OUT std::vector<Mat>& ) {CV_Error(Error::StsInternal, \"\");};\n    CV_WRAP virtual void setMatGains(std::vector<Mat>& ) { CV_Error(Error::StsInternal, \"\"); };\n    CV_WRAP void setUpdateGain(bool b) { updateGain = b; };\n    CV_WRAP bool getUpdateGain() { return updateGain; };\nprotected :\n    bool updateGain;\n};\n\n/** @brief Stub exposure compensator which does nothing.\n */\nclass CV_EXPORTS_W NoExposureCompensator : public ExposureCompensator\n{\npublic:\n    void feed(const std::vector<Point> &/*corners*/, const std::vector<UMat> &/*images*/,\n              const std::vector<std::pair<UMat,uchar> > &/*masks*/) CV_OVERRIDE { }\n    CV_WRAP void apply(int /*index*/, Point /*corner*/, InputOutputArray /*image*/, InputArray /*mask*/) CV_OVERRIDE { }\n    CV_WRAP void getMatGains(CV_OUT std::vector<Mat>& umv) CV_OVERRIDE { umv.clear(); return; };\n    CV_WRAP void setMatGains(std::vector<Mat>& umv) CV_OVERRIDE { umv.clear(); return; };\n};\n\n/** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image\nintensities, see @cite BL07 and @cite WJ10 for details.\n */\nclass CV_EXPORTS_W GainCompensator : public ExposureCompensator\n{\npublic:\n    // This Constructor only exists to make source level compatibility detector happy\n    CV_WRAP GainCompensator()\n            : GainCompensator(1) {}\n    CV_WRAP GainCompensator(int nr_feeds)\n            : nr_feeds_(nr_feeds), similarity_threshold_(1) {}\n    void feed(const std::vector<Point> &corners, const std::vector<UMat> &images,\n              const std::vector<std::pair<UMat,uchar> > &masks) CV_OVERRIDE;\n    void singleFeed(const std::vector<Point> &corners, const std::vector<UMat> &images,\n                    const std::vector<std::pair<UMat,uchar> > &masks);\n    CV_WRAP void apply(int index, Point corner, InputOutputArray image, InputArray mask) CV_OVERRIDE;\n    CV_WRAP void getMatGains(CV_OUT std::vector<Mat>& umv) CV_OVERRIDE ;\n    CV_WRAP void setMatGains(std::vector<Mat>& umv) CV_OVERRIDE ;\n    CV_WRAP void setNrFeeds(int nr_feeds) { nr_feeds_ = nr_feeds; }\n    CV_WRAP int getNrFeeds() { return nr_feeds_; }\n    CV_WRAP void setSimilarityThreshold(double similarity_threshold) { similarity_threshold_ = similarity_threshold; }\n    CV_WRAP double getSimilarityThreshold() const { return similarity_threshold_; }\n    void prepareSimilarityMask(const std::vector<Point> &corners, const std::vector<UMat> &images);\n    std::vector<double> gains() const;\n\nprivate:\n    UMat buildSimilarityMask(InputArray src_array1, InputArray src_array2);\n\n    Mat_<double> gains_;\n    int nr_feeds_;\n    double similarity_threshold_;\n    std::vector<UMat> similarities_;\n};\n\n/** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image\nintensities on each channel independently.\n */\nclass CV_EXPORTS_W ChannelsCompensator : public ExposureCompensator\n{\npublic:\n    CV_WRAP ChannelsCompensator(int nr_feeds=1)\n        : nr_feeds_(nr_feeds), similarity_threshold_(1) {}\n    void feed(const std::vector<Point> &corners, const std::vector<UMat> &images,\n              const std::vector<std::pair<UMat,uchar> > &masks) CV_OVERRIDE;\n    CV_WRAP void apply(int index, Point corner, InputOutputArray image, InputArray mask) CV_OVERRIDE;\n    CV_WRAP void getMatGains(CV_OUT std::vector<Mat>& umv) CV_OVERRIDE;\n    CV_WRAP void setMatGains(std::vector<Mat>& umv) CV_OVERRIDE;\n    CV_WRAP void setNrFeeds(int nr_feeds) { nr_feeds_ = nr_feeds; }\n    CV_WRAP int getNrFeeds() { return nr_feeds_; }\n    CV_WRAP void setSimilarityThreshold(double similarity_threshold) { similarity_threshold_ = similarity_threshold; }\n    CV_WRAP double getSimilarityThreshold() const { return similarity_threshold_; }\n    std::vector<Scalar> gains() const { return gains_; }\n\nprivate:\n    std::vector<Scalar> gains_;\n    int nr_feeds_;\n    double similarity_threshold_;\n};\n\n/** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image blocks.\n */\nclass CV_EXPORTS_W BlocksCompensator : public ExposureCompensator\n{\npublic:\n    BlocksCompensator(int bl_width=32, int bl_height=32, int nr_feeds=1)\n            : bl_width_(bl_width), bl_height_(bl_height), nr_feeds_(nr_feeds), nr_gain_filtering_iterations_(2),\n              similarity_threshold_(1) {}\n    CV_WRAP void apply(int index, Point corner, InputOutputArray image, InputArray mask) CV_OVERRIDE;\n    CV_WRAP void getMatGains(CV_OUT std::vector<Mat>& umv) CV_OVERRIDE;\n    CV_WRAP void setMatGains(std::vector<Mat>& umv) CV_OVERRIDE;\n    CV_WRAP void setNrFeeds(int nr_feeds) { nr_feeds_ = nr_feeds; }\n    CV_WRAP int getNrFeeds() { return nr_feeds_; }\n    CV_WRAP void setSimilarityThreshold(double similarity_threshold) { similarity_threshold_ = similarity_threshold; }\n    CV_WRAP double getSimilarityThreshold() const { return similarity_threshold_; }\n    CV_WRAP void setBlockSize(int width, int height) { bl_width_ = width; bl_height_ = height; }\n    CV_WRAP void setBlockSize(Size size) { setBlockSize(size.width, size.height); }\n    CV_WRAP Size getBlockSize() const { return Size(bl_width_, bl_height_); }\n    CV_WRAP void setNrGainsFilteringIterations(int nr_iterations) { nr_gain_filtering_iterations_ = nr_iterations; }\n    CV_WRAP int getNrGainsFilteringIterations() const { return nr_gain_filtering_iterations_; }\n\nprotected:\n    template<class Compensator>\n    void feed(const std::vector<Point> &corners, const std::vector<UMat> &images,\n              const std::vector<std::pair<UMat,uchar> > &masks);\n\nprivate:\n    UMat getGainMap(const GainCompensator& compensator, int bl_idx, Size bl_per_img);\n    UMat getGainMap(const ChannelsCompensator& compensator, int bl_idx, Size bl_per_img);\n\n    int bl_width_, bl_height_;\n    std::vector<UMat> gain_maps_;\n    int nr_feeds_;\n    int nr_gain_filtering_iterations_;\n    double similarity_threshold_;\n};\n\n/** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image block\nintensities, see @cite UES01 for details.\n */\nclass CV_EXPORTS_W BlocksGainCompensator : public BlocksCompensator\n{\npublic:\n    // This Constructor only exists to make source level compatibility detector happy\n    CV_WRAP BlocksGainCompensator(int bl_width = 32, int bl_height = 32)\n            : BlocksGainCompensator(bl_width, bl_height, 1) {}\n    CV_WRAP BlocksGainCompensator(int bl_width, int bl_height, int nr_feeds)\n            : BlocksCompensator(bl_width, bl_height, nr_feeds) {}\n\n    void feed(const std::vector<Point> &corners, const std::vector<UMat> &images,\n              const std::vector<std::pair<UMat,uchar> > &masks) CV_OVERRIDE;\n\n    // This function only exists to make source level compatibility detector happy\n    CV_WRAP void apply(int index, Point corner, InputOutputArray image, InputArray mask) CV_OVERRIDE {\n        BlocksCompensator::apply(index, corner, image, mask); }\n    // This function only exists to make source level compatibility detector happy\n    CV_WRAP void getMatGains(CV_OUT std::vector<Mat>& umv) CV_OVERRIDE { BlocksCompensator::getMatGains(umv); }\n    // This function only exists to make source level compatibility detector happy\n    CV_WRAP void setMatGains(std::vector<Mat>& umv) CV_OVERRIDE { BlocksCompensator::setMatGains(umv); }\n};\n\n/** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image block\non each channel.\n */\nclass CV_EXPORTS_W BlocksChannelsCompensator : public BlocksCompensator\n{\npublic:\n    CV_WRAP BlocksChannelsCompensator(int bl_width=32, int bl_height=32, int nr_feeds=1)\n            : BlocksCompensator(bl_width, bl_height, nr_feeds) {}\n\n    void feed(const std::vector<Point> &corners, const std::vector<UMat> &images,\n              const std::vector<std::pair<UMat,uchar> > &masks) CV_OVERRIDE;\n};\n//! @}\n\n} // namespace detail\n} // namespace cv\n\n#endif // OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/matchers.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_MATCHERS_HPP\n#define OPENCV_STITCHING_MATCHERS_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/features2d.hpp\"\n\n#include \"opencv2/opencv_modules.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching_match\n//! @{\n\n/** @brief Structure containing image keypoints and descriptors. */\nstruct CV_EXPORTS_W_SIMPLE ImageFeatures\n{\n    CV_PROP_RW int img_idx;\n    CV_PROP_RW Size img_size;\n    std::vector<KeyPoint> keypoints;\n    CV_PROP_RW UMat descriptors;\n    CV_WRAP std::vector<KeyPoint> getKeypoints() { return keypoints; };\n};\n/** @brief\n\n@param featuresFinder\n@param images\n@param features\n@param masks\n*/\nCV_EXPORTS_W void computeImageFeatures(\n    const Ptr<Feature2D> &featuresFinder,\n    InputArrayOfArrays  images,\n    CV_OUT std::vector<ImageFeatures> &features,\n    InputArrayOfArrays masks = noArray());\n\n/** @brief\n\n@param featuresFinder\n@param image\n@param features\n@param mask\n*/\nCV_EXPORTS_AS(computeImageFeatures2) void computeImageFeatures(\n    const Ptr<Feature2D> &featuresFinder,\n    InputArray image,\n    CV_OUT ImageFeatures &features,\n    InputArray mask = noArray());\n\n/** @brief Structure containing information about matches between two images.\n\nIt's assumed that there is a transformation between those images. Transformation may be\nhomography or affine transformation based on selected matcher.\n\n@sa detail::FeaturesMatcher\n*/\nstruct CV_EXPORTS_W_SIMPLE MatchesInfo\n{\n    MatchesInfo();\n    MatchesInfo(const MatchesInfo &other);\n    MatchesInfo& operator =(const MatchesInfo &other);\n\n    CV_PROP_RW int src_img_idx;\n    CV_PROP_RW int dst_img_idx;       //!< Images indices (optional)\n    std::vector<DMatch> matches;\n    std::vector<uchar> inliers_mask;    //!< Geometrically consistent matches mask\n    CV_PROP_RW int num_inliers;                    //!< Number of geometrically consistent matches\n    CV_PROP_RW Mat H;                              //!< Estimated transformation\n    CV_PROP_RW double confidence;                  //!< Confidence two images are from the same panorama\n    CV_WRAP std::vector<DMatch> getMatches() { return matches; };\n    CV_WRAP std::vector<uchar> getInliers() { return inliers_mask; };\n};\n\n/** @brief Feature matchers base class. */\nclass CV_EXPORTS_W FeaturesMatcher\n{\npublic:\n    CV_WRAP virtual ~FeaturesMatcher() {}\n\n    /** @overload\n    @param features1 First image features\n    @param features2 Second image features\n    @param matches_info Found matches\n    */\n    CV_WRAP_AS(apply) void operator ()(const ImageFeatures &features1, const ImageFeatures &features2,\n                     CV_OUT MatchesInfo& matches_info) { match(features1, features2, matches_info); }\n\n    /** @brief Performs images matching.\n\n    @param features Features of the source images\n    @param pairwise_matches Found pairwise matches\n    @param mask Mask indicating which image pairs must be matched\n\n    The function is parallelized with the TBB library.\n\n    @sa detail::MatchesInfo\n    */\n    CV_WRAP_AS(apply2) void operator ()(const std::vector<ImageFeatures> &features, CV_OUT std::vector<MatchesInfo> &pairwise_matches,\n                     const cv::UMat &mask = cv::UMat());\n\n    /** @return True, if it's possible to use the same matcher instance in parallel, false otherwise\n    */\n   CV_WRAP bool isThreadSafe() const { return is_thread_safe_; }\n\n    /** @brief Frees unused memory allocated before if there is any.\n    */\n   CV_WRAP virtual void collectGarbage() {}\n\nprotected:\n    FeaturesMatcher(bool is_thread_safe = false) : is_thread_safe_(is_thread_safe) {}\n\n    /** @brief This method must implement matching logic in order to make the wrappers\n    detail::FeaturesMatcher::operator()_ work.\n\n    @param features1 first image features\n    @param features2 second image features\n    @param matches_info found matches\n     */\n    virtual void match(const ImageFeatures &features1, const ImageFeatures &features2,\n                       MatchesInfo& matches_info) = 0;\n\n    bool is_thread_safe_;\n};\n\n/** @brief Features matcher which finds two best matches for each feature and leaves the best one only if the\nratio between descriptor distances is greater than the threshold match_conf\n\n@sa detail::FeaturesMatcher\n */\nclass CV_EXPORTS_W BestOf2NearestMatcher : public FeaturesMatcher\n{\npublic:\n    /** @brief Constructs a \"best of 2 nearest\" matcher.\n\n    @param try_use_gpu Should try to use GPU or not\n    @param match_conf Match distances ration threshold\n    @param num_matches_thresh1 Minimum number of matches required for the 2D projective transform\n    estimation used in the inliers classification step\n    @param num_matches_thresh2 Minimum number of matches required for the 2D projective transform\n    re-estimation on inliers\n     */\n    CV_WRAP BestOf2NearestMatcher(bool try_use_gpu = false, float match_conf = 0.3f, int num_matches_thresh1 = 6,\n                          int num_matches_thresh2 = 6);\n\n    CV_WRAP void collectGarbage() CV_OVERRIDE;\n    CV_WRAP static Ptr<BestOf2NearestMatcher> create(bool try_use_gpu = false, float match_conf = 0.3f, int num_matches_thresh1 = 6,\n        int num_matches_thresh2 = 6);\n\nprotected:\n\n    void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info) CV_OVERRIDE;\n    int num_matches_thresh1_;\n    int num_matches_thresh2_;\n    Ptr<FeaturesMatcher> impl_;\n};\n\nclass CV_EXPORTS_W BestOf2NearestRangeMatcher : public BestOf2NearestMatcher\n{\npublic:\n    CV_WRAP BestOf2NearestRangeMatcher(int range_width = 5, bool try_use_gpu = false, float match_conf = 0.3f,\n                            int num_matches_thresh1 = 6, int num_matches_thresh2 = 6);\n\n    void operator ()(const std::vector<ImageFeatures> &features, std::vector<MatchesInfo> &pairwise_matches,\n                     const cv::UMat &mask = cv::UMat());\n\n\nprotected:\n    int range_width_;\n};\n\n/** @brief Features matcher similar to cv::detail::BestOf2NearestMatcher which\nfinds two best matches for each feature and leaves the best one only if the\nratio between descriptor distances is greater than the threshold match_conf.\n\nUnlike cv::detail::BestOf2NearestMatcher this matcher uses affine\ntransformation (affine transformation estimate will be placed in matches_info).\n\n@sa cv::detail::FeaturesMatcher cv::detail::BestOf2NearestMatcher\n */\nclass CV_EXPORTS_W AffineBestOf2NearestMatcher : public BestOf2NearestMatcher\n{\npublic:\n    /** @brief Constructs a \"best of 2 nearest\" matcher that expects affine transformation\n    between images\n\n    @param full_affine whether to use full affine transformation with 6 degress of freedom or reduced\n    transformation with 4 degrees of freedom using only rotation, translation and uniform scaling\n    @param try_use_gpu Should try to use GPU or not\n    @param match_conf Match distances ration threshold\n    @param num_matches_thresh1 Minimum number of matches required for the 2D affine transform\n    estimation used in the inliers classification step\n\n    @sa cv::estimateAffine2D cv::estimateAffinePartial2D\n     */\n    CV_WRAP AffineBestOf2NearestMatcher(bool full_affine = false, bool try_use_gpu = false,\n                                float match_conf = 0.3f, int num_matches_thresh1 = 6) :\n        BestOf2NearestMatcher(try_use_gpu, match_conf, num_matches_thresh1, num_matches_thresh1),\n        full_affine_(full_affine) {}\n\nprotected:\n    void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info) CV_OVERRIDE;\n\n    bool full_affine_;\n};\n\n//! @} stitching_match\n\n} // namespace detail\n} // namespace cv\n\n#endif // OPENCV_STITCHING_MATCHERS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/motion_estimators.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_MOTION_ESTIMATORS_HPP\n#define OPENCV_STITCHING_MOTION_ESTIMATORS_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"matchers.hpp\"\n#include \"util.hpp\"\n#include \"camera.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching_rotation\n//! @{\n\n/** @brief Rotation estimator base class.\n\nIt takes features of all images, pairwise matches between all images and estimates rotations of all\ncameras.\n\n@note The coordinate system origin is implementation-dependent, but you can always normalize the\nrotations in respect to the first camera, for instance. :\n */\nclass CV_EXPORTS_W Estimator\n{\npublic:\n    virtual ~Estimator() {}\n\n    /** @brief Estimates camera parameters.\n\n    @param features Features of images\n    @param pairwise_matches Pairwise matches of images\n    @param cameras Estimated camera parameters\n    @return True in case of success, false otherwise\n     */\n    CV_WRAP_AS(apply) bool operator ()(const std::vector<ImageFeatures> &features,\n        const std::vector<MatchesInfo> &pairwise_matches,\n        CV_OUT CV_IN_OUT std::vector<CameraParams> &cameras)\n    {\n        return estimate(features, pairwise_matches, cameras);\n    }\n\nprotected:\n    /** @brief This method must implement camera parameters estimation logic in order to make the wrapper\n    detail::Estimator::operator()_ work.\n\n    @param features Features of images\n    @param pairwise_matches Pairwise matches of images\n    @param cameras Estimated camera parameters\n    @return True in case of success, false otherwise\n     */\n    virtual bool estimate(const std::vector<ImageFeatures> &features,\n                          const std::vector<MatchesInfo> &pairwise_matches,\n                          CV_OUT std::vector<CameraParams> &cameras) = 0;\n};\n\n/** @brief Homography based rotation estimator.\n */\nclass CV_EXPORTS_W HomographyBasedEstimator : public Estimator\n{\npublic:\n    CV_WRAP HomographyBasedEstimator(bool is_focals_estimated = false)\n        : is_focals_estimated_(is_focals_estimated) {}\n\nprivate:\n    virtual bool estimate(const std::vector<ImageFeatures> &features,\n                          const std::vector<MatchesInfo> &pairwise_matches,\n                          std::vector<CameraParams> &cameras) CV_OVERRIDE;\n\n    bool is_focals_estimated_;\n};\n\n/** @brief Affine transformation based estimator.\n\nThis estimator uses pairwise transformations estimated by matcher to estimate\nfinal transformation for each camera.\n\n@sa cv::detail::HomographyBasedEstimator\n */\nclass CV_EXPORTS_W AffineBasedEstimator : public Estimator\n{\npublic:\n    CV_WRAP AffineBasedEstimator(){}\nprivate:\n    virtual bool estimate(const std::vector<ImageFeatures> &features,\n                          const std::vector<MatchesInfo> &pairwise_matches,\n                          std::vector<CameraParams> &cameras) CV_OVERRIDE;\n};\n\n/** @brief Base class for all camera parameters refinement methods.\n */\nclass CV_EXPORTS_W BundleAdjusterBase : public Estimator\n{\npublic:\n    CV_WRAP const Mat refinementMask() const { return refinement_mask_.clone(); }\n    CV_WRAP void setRefinementMask(const Mat &mask)\n    {\n        CV_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3));\n        refinement_mask_ = mask.clone();\n    }\n\n    CV_WRAP double confThresh() const { return conf_thresh_; }\n    CV_WRAP void setConfThresh(double conf_thresh) { conf_thresh_ = conf_thresh; }\n\n    CV_WRAP TermCriteria termCriteria() { return term_criteria_; }\n    CV_WRAP void setTermCriteria(const TermCriteria& term_criteria) { term_criteria_ = term_criteria; }\n\nprotected:\n    /** @brief Construct a bundle adjuster base instance.\n\n    @param num_params_per_cam Number of parameters per camera\n    @param num_errs_per_measurement Number of error terms (components) per match\n     */\n    BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement)\n        : num_images_(0), total_num_matches_(0),\n          num_params_per_cam_(num_params_per_cam),\n          num_errs_per_measurement_(num_errs_per_measurement),\n          features_(0), pairwise_matches_(0), conf_thresh_(0)\n    {\n        setRefinementMask(Mat::ones(3, 3, CV_8U));\n        setConfThresh(1.);\n        setTermCriteria(TermCriteria(TermCriteria::EPS + TermCriteria::COUNT, 1000, DBL_EPSILON));\n    }\n\n    // Runs bundle adjustment\n    virtual bool estimate(const std::vector<ImageFeatures> &features,\n                          const std::vector<MatchesInfo> &pairwise_matches,\n                          std::vector<CameraParams> &cameras) CV_OVERRIDE;\n\n    /** @brief Sets initial camera parameter to refine.\n\n    @param cameras Camera parameters\n     */\n    virtual void setUpInitialCameraParams(const std::vector<CameraParams> &cameras) = 0;\n    /** @brief Gets the refined camera parameters.\n\n    @param cameras Refined camera parameters\n     */\n    virtual void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const = 0;\n    /** @brief Calculates error vector.\n\n    @param err Error column-vector of length total_num_matches \\* num_errs_per_measurement\n     */\n    virtual void calcError(Mat &err) = 0;\n    /** @brief Calculates the cost function jacobian.\n\n    @param jac Jacobian matrix of dimensions\n    (total_num_matches \\* num_errs_per_measurement) x (num_images \\* num_params_per_cam)\n     */\n    virtual void calcJacobian(Mat &jac) = 0;\n\n    // 3x3 8U mask, where 0 means don't refine respective parameter, != 0 means refine\n    Mat refinement_mask_;\n\n    int num_images_;\n    int total_num_matches_;\n\n    int num_params_per_cam_;\n    int num_errs_per_measurement_;\n\n    const ImageFeatures *features_;\n    const MatchesInfo *pairwise_matches_;\n\n    // Threshold to filter out poorly matched image pairs\n    double conf_thresh_;\n\n    //Levenberg-Marquardt algorithm termination criteria\n    TermCriteria term_criteria_;\n\n    // Camera parameters matrix (CV_64F)\n    Mat cam_params_;\n\n    // Connected images pairs\n    std::vector<std::pair<int,int> > edges_;\n};\n\n\n/** @brief Stub bundle adjuster that does nothing.\n */\nclass CV_EXPORTS_W NoBundleAdjuster : public BundleAdjusterBase\n{\npublic:\n    CV_WRAP NoBundleAdjuster() : BundleAdjusterBase(0, 0) {}\n\nprivate:\n    bool estimate(const std::vector<ImageFeatures> &, const std::vector<MatchesInfo> &,\n                  std::vector<CameraParams> &) CV_OVERRIDE\n    {\n        return true;\n    }\n    void setUpInitialCameraParams(const std::vector<CameraParams> &) CV_OVERRIDE {}\n    void obtainRefinedCameraParams(std::vector<CameraParams> &) const CV_OVERRIDE {}\n    void calcError(Mat &) CV_OVERRIDE {}\n    void calcJacobian(Mat &) CV_OVERRIDE {}\n};\n\n\n/** @brief Implementation of the camera parameters refinement algorithm which minimizes sum of the reprojection\nerror squares\n\nIt can estimate focal length, aspect ratio, principal point.\nYou can affect only on them via the refinement mask.\n */\nclass CV_EXPORTS_W BundleAdjusterReproj : public BundleAdjusterBase\n{\npublic:\n    CV_WRAP BundleAdjusterReproj() : BundleAdjusterBase(7, 2) {}\n\nprivate:\n    void setUpInitialCameraParams(const std::vector<CameraParams> &cameras) CV_OVERRIDE;\n    void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const CV_OVERRIDE;\n    void calcError(Mat &err) CV_OVERRIDE;\n    void calcJacobian(Mat &jac) CV_OVERRIDE;\n\n    Mat err1_, err2_;\n};\n\n\n/** @brief Implementation of the camera parameters refinement algorithm which minimizes sum of the distances\nbetween the rays passing through the camera center and a feature. :\n\nIt can estimate focal length. It ignores the refinement mask for now.\n */\nclass CV_EXPORTS_W BundleAdjusterRay : public BundleAdjusterBase\n{\npublic:\n    CV_WRAP BundleAdjusterRay() : BundleAdjusterBase(4, 3) {}\n\nprivate:\n    void setUpInitialCameraParams(const std::vector<CameraParams> &cameras) CV_OVERRIDE;\n    void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const CV_OVERRIDE;\n    void calcError(Mat &err) CV_OVERRIDE;\n    void calcJacobian(Mat &jac) CV_OVERRIDE;\n\n    Mat err1_, err2_;\n};\n\n\n/** @brief Bundle adjuster that expects affine transformation\nrepresented in homogeneous coordinates in R for each camera param. Implements\ncamera parameters refinement algorithm which minimizes sum of the reprojection\nerror squares\n\nIt estimates all transformation parameters. Refinement mask is ignored.\n\n@sa AffineBasedEstimator AffineBestOf2NearestMatcher BundleAdjusterAffinePartial\n */\nclass CV_EXPORTS_W BundleAdjusterAffine : public BundleAdjusterBase\n{\npublic:\n    CV_WRAP BundleAdjusterAffine() : BundleAdjusterBase(6, 2) {}\n\nprivate:\n    void setUpInitialCameraParams(const std::vector<CameraParams> &cameras) CV_OVERRIDE;\n    void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const CV_OVERRIDE;\n    void calcError(Mat &err) CV_OVERRIDE;\n    void calcJacobian(Mat &jac) CV_OVERRIDE;\n\n    Mat err1_, err2_;\n};\n\n\n/** @brief Bundle adjuster that expects affine transformation with 4 DOF\nrepresented in homogeneous coordinates in R for each camera param. Implements\ncamera parameters refinement algorithm which minimizes sum of the reprojection\nerror squares\n\nIt estimates all transformation parameters. Refinement mask is ignored.\n\n@sa AffineBasedEstimator AffineBestOf2NearestMatcher BundleAdjusterAffine\n */\nclass CV_EXPORTS_W BundleAdjusterAffinePartial : public BundleAdjusterBase\n{\npublic:\n    CV_WRAP BundleAdjusterAffinePartial() : BundleAdjusterBase(4, 2) {}\n\nprivate:\n    void setUpInitialCameraParams(const std::vector<CameraParams> &cameras) CV_OVERRIDE;\n    void obtainRefinedCameraParams(std::vector<CameraParams> &cameras) const CV_OVERRIDE;\n    void calcError(Mat &err) CV_OVERRIDE;\n    void calcJacobian(Mat &jac) CV_OVERRIDE;\n\n    Mat err1_, err2_;\n};\n\n\nenum WaveCorrectKind\n{\n    WAVE_CORRECT_HORIZ,\n    WAVE_CORRECT_VERT,\n    WAVE_CORRECT_AUTO\n};\n\n/** @brief Tries to detect the wave correction kind depending\non whether a panorama spans horizontally or vertically\n\n@param rmats Camera rotation matrices.\n@return The correction kind to use for this panorama\n */\nCV_EXPORTS\nWaveCorrectKind autoDetectWaveCorrectKind(const std::vector<Mat> &rmats);\n\n/** @brief Tries to make panorama more horizontal (or vertical).\n\n@param rmats Camera rotation matrices.\n@param kind Correction kind, see detail::WaveCorrectKind.\n */\nvoid CV_EXPORTS_W waveCorrect(CV_IN_OUT std::vector<Mat> &rmats, WaveCorrectKind kind);\n\n\n//////////////////////////////////////////////////////////////////////////////\n// Auxiliary functions\n\n// Returns matches graph representation in DOT language\nString CV_EXPORTS_W matchesGraphAsString(std::vector<String> &pathes, std::vector<MatchesInfo> &pairwise_matches,\n                                            float conf_threshold);\n\nCV_EXPORTS_W std::vector<int>  leaveBiggestComponent(\n        std::vector<ImageFeatures> &features,\n        std::vector<MatchesInfo> &pairwise_matches,\n        float conf_threshold);\n\nvoid CV_EXPORTS findMaxSpanningTree(\n        int num_images, const std::vector<MatchesInfo> &pairwise_matches,\n        Graph &span_tree, std::vector<int> &centers);\n\n//! @} stitching_rotation\n\n} // namespace detail\n} // namespace cv\n\n#endif // OPENCV_STITCHING_MOTION_ESTIMATORS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/seam_finders.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_SEAM_FINDERS_HPP\n#define OPENCV_STITCHING_SEAM_FINDERS_HPP\n\n#include <set>\n#include \"opencv2/core.hpp\"\n#include \"opencv2/opencv_modules.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching_seam\n//! @{\n\n/** @brief Base class for a seam estimator.\n */\nclass CV_EXPORTS_W SeamFinder\n{\npublic:\n    CV_WRAP  virtual ~SeamFinder() {}\n    enum { NO, VORONOI_SEAM, DP_SEAM };\n    /** @brief Estimates seams.\n\n    @param src Source images\n    @param corners Source image top-left corners\n    @param masks Source image masks to update\n     */\n    CV_WRAP virtual void find(const std::vector<UMat> &src, const std::vector<Point> &corners,\n                      CV_IN_OUT std::vector<UMat> &masks) = 0;\n    CV_WRAP static Ptr<SeamFinder> createDefault(int type);\n};\n\n/** @brief Stub seam estimator which does nothing.\n */\nclass CV_EXPORTS_W NoSeamFinder : public SeamFinder\n{\npublic:\n    CV_WRAP void find(const std::vector<UMat>&, const std::vector<Point>&, CV_IN_OUT std::vector<UMat>&) CV_OVERRIDE {}\n};\n\n/** @brief Base class for all pairwise seam estimators.\n */\nclass CV_EXPORTS_W PairwiseSeamFinder : public SeamFinder\n{\npublic:\n    CV_WRAP virtual void find(const std::vector<UMat> &src, const std::vector<Point> &corners,\n                      CV_IN_OUT std::vector<UMat> &masks) CV_OVERRIDE;\n\nprotected:\n    void run();\n    /** @brief Resolves masks intersection of two specified images in the given ROI.\n\n    @param first First image index\n    @param second Second image index\n    @param roi Region of interest\n     */\n    virtual void findInPair(size_t first, size_t second, Rect roi) = 0;\n\n    std::vector<UMat> images_;\n    std::vector<Size> sizes_;\n    std::vector<Point> corners_;\n    std::vector<UMat> masks_;\n};\n\n/** @brief Voronoi diagram-based seam estimator.\n */\nclass CV_EXPORTS_W VoronoiSeamFinder : public PairwiseSeamFinder\n{\npublic:\n    CV_WRAP virtual void find(const std::vector<UMat> &src, const std::vector<Point> &corners,\n                      CV_IN_OUT std::vector<UMat> &masks) CV_OVERRIDE;\n    virtual void find(const std::vector<Size> &size, const std::vector<Point> &corners,\n                      std::vector<UMat> &masks);\nprivate:\n    void findInPair(size_t first, size_t second, Rect roi) CV_OVERRIDE;\n};\n\n\nclass CV_EXPORTS_W DpSeamFinder : public SeamFinder\n{\npublic:\n    enum CostFunction { COLOR, COLOR_GRAD };\n\n    DpSeamFinder(CostFunction costFunc = COLOR);\n    CV_WRAP DpSeamFinder(String costFunc );\n\n    CostFunction costFunction() const { return costFunc_; }\n    void setCostFunction(CostFunction val) { costFunc_ = val; }\n    CV_WRAP void setCostFunction(String val);\n\n    virtual void find(const std::vector<UMat> &src, const std::vector<Point> &corners,\n                      std::vector<UMat> &masks) CV_OVERRIDE;\n\nprivate:\n    enum ComponentState\n    {\n        FIRST = 1, SECOND = 2, INTERS = 4,\n        INTERS_FIRST = INTERS | FIRST,\n        INTERS_SECOND = INTERS | SECOND\n    };\n\n    class ImagePairLess\n    {\n    public:\n        ImagePairLess(const std::vector<Mat> &images, const std::vector<Point> &corners)\n            : src_(&images[0]), corners_(&corners[0]) {}\n\n        bool operator() (const std::pair<size_t, size_t> &l, const std::pair<size_t, size_t> &r) const\n        {\n            Point c1 = corners_[l.first] + Point(src_[l.first].cols / 2, src_[l.first].rows / 2);\n            Point c2 = corners_[l.second] + Point(src_[l.second].cols / 2, src_[l.second].rows / 2);\n            int d1 = (c1 - c2).dot(c1 - c2);\n\n            c1 = corners_[r.first] + Point(src_[r.first].cols / 2, src_[r.first].rows / 2);\n            c2 = corners_[r.second] + Point(src_[r.second].cols / 2, src_[r.second].rows / 2);\n            int d2 = (c1 - c2).dot(c1 - c2);\n\n            return d1 < d2;\n        }\n\n    private:\n        const Mat *src_;\n        const Point *corners_;\n    };\n\n    class ClosePoints\n    {\n    public:\n        ClosePoints(int minDist) : minDist_(minDist) {}\n\n        bool operator() (const Point &p1, const Point &p2) const\n        {\n            int dist2 = (p1.x-p2.x) * (p1.x-p2.x) + (p1.y-p2.y) * (p1.y-p2.y);\n            return dist2 < minDist_ * minDist_;\n        }\n\n    private:\n        int minDist_;\n    };\n\n    void process(\n            const Mat &image1, const Mat &image2, Point tl1, Point tl2,  Mat &mask1, Mat &mask2);\n\n    void findComponents();\n\n    void findEdges();\n\n    void resolveConflicts(\n            const Mat &image1, const Mat &image2, Point tl1, Point tl2, Mat &mask1, Mat &mask2);\n\n    void computeGradients(const Mat &image1, const Mat &image2);\n\n    bool hasOnlyOneNeighbor(int comp);\n\n    bool closeToContour(int y, int x, const Mat_<uchar> &contourMask);\n\n    bool getSeamTips(int comp1, int comp2, Point &p1, Point &p2);\n\n    void computeCosts(\n            const Mat &image1, const Mat &image2, Point tl1, Point tl2,\n            int comp, Mat_<float> &costV, Mat_<float> &costH);\n\n    bool estimateSeam(\n            const Mat &image1, const Mat &image2, Point tl1, Point tl2, int comp,\n            Point p1, Point p2, std::vector<Point> &seam, bool &isHorizontal);\n\n    void updateLabelsUsingSeam(\n            int comp1, int comp2, const std::vector<Point> &seam, bool isHorizontalSeam);\n\n    CostFunction costFunc_;\n\n    // processing images pair data\n    Point unionTl_, unionBr_;\n    Size unionSize_;\n    Mat_<uchar> mask1_, mask2_;\n    Mat_<uchar> contour1mask_, contour2mask_;\n    Mat_<float> gradx1_, grady1_;\n    Mat_<float> gradx2_, grady2_;\n\n    // components data\n    int ncomps_;\n    Mat_<int> labels_;\n    std::vector<ComponentState> states_;\n    std::vector<Point> tls_, brs_;\n    std::vector<std::vector<Point> > contours_;\n    std::set<std::pair<int, int> > edges_;\n};\n\n/** @brief Base class for all minimum graph-cut-based seam estimators.\n */\nclass CV_EXPORTS GraphCutSeamFinderBase\n{\npublic:\n    enum CostType { COST_COLOR, COST_COLOR_GRAD };\n};\n\n/** @brief Minimum graph cut-based seam estimator. See details in @cite V03 .\n */\nclass CV_EXPORTS_W GraphCutSeamFinder : public GraphCutSeamFinderBase, public SeamFinder\n{\npublic:\n    GraphCutSeamFinder(int cost_type = COST_COLOR_GRAD, float terminal_cost = 10000.f,\n                       float bad_region_penalty = 1000.f);\n    CV_WRAP GraphCutSeamFinder(String cost_type,float terminal_cost = 10000.f,\n        float bad_region_penalty = 1000.f);\n\n    ~GraphCutSeamFinder();\n\n    CV_WRAP void find(const std::vector<UMat> &src, const std::vector<Point> &corners,\n              std::vector<UMat> &masks) CV_OVERRIDE;\n\nprivate:\n    // To avoid GCGraph dependency\n    class Impl;\n    Ptr<PairwiseSeamFinder> impl_;\n};\n\n\n#ifdef HAVE_OPENCV_CUDALEGACY\nclass CV_EXPORTS GraphCutSeamFinderGpu : public GraphCutSeamFinderBase, public PairwiseSeamFinder\n{\npublic:\n    GraphCutSeamFinderGpu(int cost_type = COST_COLOR_GRAD, float terminal_cost = 10000.f,\n                          float bad_region_penalty = 1000.f)\n                          : cost_type_(cost_type), terminal_cost_(terminal_cost),\n                            bad_region_penalty_(bad_region_penalty) {}\n\n    void find(const std::vector<cv::UMat> &src, const std::vector<cv::Point> &corners,\n              std::vector<cv::UMat> &masks) CV_OVERRIDE;\n    void findInPair(size_t first, size_t second, Rect roi) CV_OVERRIDE;\n\nprivate:\n    void setGraphWeightsColor(const cv::Mat &img1, const cv::Mat &img2, const cv::Mat &mask1, const cv::Mat &mask2,\n                              cv::Mat &terminals, cv::Mat &leftT, cv::Mat &rightT, cv::Mat &top, cv::Mat &bottom);\n    void setGraphWeightsColorGrad(const cv::Mat &img1, const cv::Mat &img2, const cv::Mat &dx1, const cv::Mat &dx2,\n                                  const cv::Mat &dy1, const cv::Mat &dy2, const cv::Mat &mask1, const cv::Mat &mask2,\n                                  cv::Mat &terminals, cv::Mat &leftT, cv::Mat &rightT, cv::Mat &top, cv::Mat &bottom);\n    std::vector<Mat> dx_, dy_;\n    int cost_type_;\n    float terminal_cost_;\n    float bad_region_penalty_;\n};\n#endif\n\n//! @}\n\n} // namespace detail\n} // namespace cv\n\n#endif // OPENCV_STITCHING_SEAM_FINDERS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/timelapsers.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n\n#ifndef OPENCV_STITCHING_TIMELAPSERS_HPP\n#define OPENCV_STITCHING_TIMELAPSERS_HPP\n\n#include \"opencv2/core.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching\n//! @{\n\n//  Base Timelapser class, takes a sequence of images, applies appropriate shift, stores result in dst_.\n\nclass CV_EXPORTS_W Timelapser\n{\npublic:\n\n    enum {AS_IS, CROP};\n\n    virtual ~Timelapser() {}\n\n    CV_WRAP static Ptr<Timelapser> createDefault(int type);\n\n    CV_WRAP virtual void initialize(const std::vector<Point> &corners, const std::vector<Size> &sizes);\n    CV_WRAP virtual void process(InputArray img, InputArray mask, Point tl);\n    CV_WRAP virtual const UMat& getDst() {return dst_;}\n\nprotected:\n\n    virtual bool test_point(Point pt);\n\n    UMat dst_;\n    Rect dst_roi_;\n};\n\n\nclass CV_EXPORTS_W TimelapserCrop : public Timelapser\n{\npublic:\n    virtual void initialize(const std::vector<Point> &corners, const std::vector<Size> &sizes) CV_OVERRIDE;\n};\n\n//! @}\n\n} // namespace detail\n} // namespace cv\n\n#endif // OPENCV_STITCHING_TIMELAPSERS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/util.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_UTIL_HPP\n#define OPENCV_STITCHING_UTIL_HPP\n\n#include <list>\n#include \"opencv2/core.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching\n//! @{\n\nclass CV_EXPORTS DisjointSets\n{\npublic:\n    DisjointSets(int elem_count = 0) { createOneElemSets(elem_count); }\n\n    void createOneElemSets(int elem_count);\n    int findSetByElem(int elem);\n    int mergeSets(int set1, int set2);\n\n    std::vector<int> parent;\n    std::vector<int> size;\n\nprivate:\n    std::vector<int> rank_;\n};\n\n\nstruct CV_EXPORTS GraphEdge\n{\n    GraphEdge(int from, int to, float weight);\n    bool operator <(const GraphEdge& other) const { return weight < other.weight; }\n    bool operator >(const GraphEdge& other) const { return weight > other.weight; }\n\n    int from, to;\n    float weight;\n};\n\ninline GraphEdge::GraphEdge(int _from, int _to, float _weight) : from(_from), to(_to), weight(_weight) {}\n\n\nclass CV_EXPORTS Graph\n{\npublic:\n    Graph(int num_vertices = 0) { create(num_vertices); }\n    void create(int num_vertices) { edges_.assign(num_vertices, std::list<GraphEdge>()); }\n    int numVertices() const { return static_cast<int>(edges_.size()); }\n    void addEdge(int from, int to, float weight);\n    template <typename B> B forEach(B body) const;\n    template <typename B> B walkBreadthFirst(int from, B body) const;\n\nprivate:\n    std::vector< std::list<GraphEdge> > edges_;\n};\n\n\n//////////////////////////////////////////////////////////////////////////////\n// Auxiliary functions\n\nCV_EXPORTS_W bool overlapRoi(Point tl1, Point tl2, Size sz1, Size sz2, Rect &roi);\nCV_EXPORTS_W Rect resultRoi(const std::vector<Point> &corners, const std::vector<UMat> &images);\nCV_EXPORTS_W Rect resultRoi(const std::vector<Point> &corners, const std::vector<Size> &sizes);\nCV_EXPORTS_W Rect resultRoiIntersection(const std::vector<Point> &corners, const std::vector<Size> &sizes);\nCV_EXPORTS_W Point resultTl(const std::vector<Point> &corners);\n\n// Returns random 'count' element subset of the {0,1,...,size-1} set\nCV_EXPORTS_W void selectRandomSubset(int count, int size, std::vector<int> &subset);\n\nCV_EXPORTS_W int& stitchingLogLevel();\n\n//! @}\n\n} // namespace detail\n} // namespace cv\n\n#include \"util_inl.hpp\"\n\n#endif // OPENCV_STITCHING_UTIL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/util_inl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_UTIL_INL_HPP\n#define OPENCV_STITCHING_UTIL_INL_HPP\n\n#include <queue>\n#include \"opencv2/core.hpp\"\n#include \"util.hpp\" // Make your IDE see declarations\n\n//! @cond IGNORED\n\nnamespace cv {\nnamespace detail {\n\ntemplate <typename B>\nB Graph::forEach(B body) const\n{\n    for (int i = 0; i < numVertices(); ++i)\n    {\n        std::list<GraphEdge>::const_iterator edge = edges_[i].begin();\n        for (; edge != edges_[i].end(); ++edge)\n            body(*edge);\n    }\n    return body;\n}\n\n\ntemplate <typename B>\nB Graph::walkBreadthFirst(int from, B body) const\n{\n    std::vector<bool> was(numVertices(), false);\n    std::queue<int> vertices;\n\n    was[from] = true;\n    vertices.push(from);\n\n    while (!vertices.empty())\n    {\n        int vertex = vertices.front();\n        vertices.pop();\n\n        std::list<GraphEdge>::const_iterator edge = edges_[vertex].begin();\n        for (; edge != edges_[vertex].end(); ++edge)\n        {\n            if (!was[edge->to])\n            {\n                body(*edge);\n                was[edge->to] = true;\n                vertices.push(edge->to);\n            }\n        }\n    }\n\n    return body;\n}\n\n\n//////////////////////////////////////////////////////////////////////////////\n// Some auxiliary math functions\n\nstatic inline\nfloat normL2(const Point3f& a)\n{\n    return a.x * a.x + a.y * a.y + a.z * a.z;\n}\n\n\nstatic inline\nfloat normL2(const Point3f& a, const Point3f& b)\n{\n    return normL2(a - b);\n}\n\n\nstatic inline\ndouble normL2sq(const Mat &r)\n{\n    return r.dot(r);\n}\n\n\nstatic inline int sqr(int x) { return x * x; }\nstatic inline float sqr(float x) { return x * x; }\nstatic inline double sqr(double x) { return x * x; }\n\n} // namespace detail\n} // namespace cv\n\n//! @endcond\n\n#endif // OPENCV_STITCHING_UTIL_INL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/warpers.hpp",
    "content": " /*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_WARPERS_HPP\n#define OPENCV_STITCHING_WARPERS_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/core/cuda.hpp\"\n#include \"opencv2/imgproc.hpp\"\n#include \"opencv2/opencv_modules.hpp\"\n\nnamespace cv {\nnamespace detail {\n\n//! @addtogroup stitching_warp\n//! @{\n\n/** @brief Rotation-only model image warper interface.\n */\nclass CV_EXPORTS RotationWarper\n{\npublic:\n    virtual ~RotationWarper() {}\n\n    /** @brief Projects the image point.\n\n    @param pt Source point\n    @param K Camera intrinsic parameters\n    @param R Camera rotation matrix\n    @return Projected point\n     */\n    virtual Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) = 0;\n\n    /** @brief Projects the image point backward.\n\n    @param pt Projected point\n    @param K Camera intrinsic parameters\n    @param R Camera rotation matrix\n    @return Backward-projected point\n    */\n#if CV_VERSION_MAJOR == 4\n    virtual Point2f warpPointBackward(const Point2f& pt, InputArray K, InputArray R)\n    {\n        CV_UNUSED(pt); CV_UNUSED(K); CV_UNUSED(R);\n        CV_Error(Error::StsNotImplemented, \"\");\n    }\n#else\n    virtual Point2f warpPointBackward(const Point2f& pt, InputArray K, InputArray R) = 0;\n#endif\n\n    /** @brief Builds the projection maps according to the given camera data.\n\n    @param src_size Source image size\n    @param K Camera intrinsic parameters\n    @param R Camera rotation matrix\n    @param xmap Projection map for the x axis\n    @param ymap Projection map for the y axis\n    @return Projected image minimum bounding box\n     */\n    virtual Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) = 0;\n\n    /** @brief Projects the image.\n\n    @param src Source image\n    @param K Camera intrinsic parameters\n    @param R Camera rotation matrix\n    @param interp_mode Interpolation mode\n    @param border_mode Border extrapolation mode\n    @param dst Projected image\n    @return Project image top-left corner\n     */\n    virtual Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n                       CV_OUT OutputArray dst) = 0;\n\n    /** @brief Projects the image backward.\n\n    @param src Projected image\n    @param K Camera intrinsic parameters\n    @param R Camera rotation matrix\n    @param interp_mode Interpolation mode\n    @param border_mode Border extrapolation mode\n    @param dst_size Backward-projected image size\n    @param dst Backward-projected image\n     */\n    virtual void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n                              Size dst_size, CV_OUT OutputArray dst) = 0;\n\n    /**\n    @param src_size Source image bounding box\n    @param K Camera intrinsic parameters\n    @param R Camera rotation matrix\n    @return Projected image minimum bounding box\n     */\n    virtual Rect warpRoi(Size src_size, InputArray K, InputArray R) = 0;\n\n    virtual float getScale() const { return 1.f; }\n    virtual void setScale(float) {}\n};\n\n/** @brief Base class for warping logic implementation.\n */\nstruct CV_EXPORTS_W_SIMPLE ProjectorBase\n{\n    void setCameraParams(InputArray K = Mat::eye(3, 3, CV_32F),\n                         InputArray R = Mat::eye(3, 3, CV_32F),\n                         InputArray T = Mat::zeros(3, 1, CV_32F));\n\n    float scale;\n    float k[9];\n    float rinv[9];\n    float r_kinv[9];\n    float k_rinv[9];\n    float t[3];\n};\n\n/** @brief Base class for rotation-based warper using a detail::ProjectorBase_ derived class.\n */\ntemplate <class P>\nclass CV_EXPORTS_TEMPLATE RotationWarperBase : public RotationWarper\n{\npublic:\n    Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) CV_OVERRIDE;\n\n    Point2f warpPointBackward(const Point2f &pt, InputArray K, InputArray R) CV_OVERRIDE;\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE;\n\n    Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n               OutputArray dst) CV_OVERRIDE;\n\n    void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n                      Size dst_size, OutputArray dst) CV_OVERRIDE;\n\n    Rect warpRoi(Size src_size, InputArray K, InputArray R) CV_OVERRIDE;\n\n    float getScale() const  CV_OVERRIDE{ return projector_.scale; }\n    void setScale(float val) CV_OVERRIDE { projector_.scale = val; }\n\nprotected:\n\n    // Detects ROI of the destination image. It's correct for any projection.\n    virtual void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br);\n\n    // Detects ROI of the destination image by walking over image border.\n    // Correctness for any projection isn't guaranteed.\n    void detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br);\n\n    P projector_;\n};\n\n\nstruct CV_EXPORTS PlaneProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n/** @brief Warper that maps an image onto the z = 1 plane.\n */\nclass CV_EXPORTS PlaneWarper : public RotationWarperBase<PlaneProjector>\n{\npublic:\n    /** @brief Construct an instance of the plane warper class.\n\n    @param scale Projected image scale multiplier\n     */\n    PlaneWarper(float scale = 1.f) { projector_.scale = scale; }\n\n    Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) CV_OVERRIDE;\n    Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R, InputArray T);\n\n    Point2f warpPointBackward(const Point2f& pt, InputArray K, InputArray R) CV_OVERRIDE;\n    Point2f warpPointBackward(const Point2f& pt, InputArray K, InputArray R, InputArray T);\n\n    virtual Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, CV_OUT OutputArray xmap, CV_OUT OutputArray ymap);\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, CV_OUT OutputArray xmap, CV_OUT OutputArray ymap) CV_OVERRIDE;\n\n    Point warp(InputArray src, InputArray K, InputArray R,\n               int interp_mode, int border_mode, CV_OUT OutputArray dst) CV_OVERRIDE;\n    virtual Point warp(InputArray src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode,\n        CV_OUT OutputArray dst);\n\n    Rect warpRoi(Size src_size, InputArray K, InputArray R) CV_OVERRIDE;\n    Rect warpRoi(Size src_size, InputArray K, InputArray R, InputArray T);\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE;\n};\n\n\n/** @brief Affine warper that uses rotations and translations\n\n Uses affine transformation in homogeneous coordinates to represent both rotation and\n translation in camera rotation matrix.\n */\nclass CV_EXPORTS AffineWarper : public PlaneWarper\n{\npublic:\n    /** @brief Construct an instance of the affine warper class.\n\n    @param scale Projected image scale multiplier\n     */\n    AffineWarper(float scale = 1.f) : PlaneWarper(scale) {}\n\n    /** @brief Projects the image point.\n\n    @param pt Source point\n    @param K Camera intrinsic parameters\n    @param H Camera extrinsic parameters\n    @return Projected point\n     */\n    Point2f warpPoint(const Point2f &pt, InputArray K, InputArray H) CV_OVERRIDE;\n\n    /** @brief Projects the image point backward.\n\n    @param pt Projected point\n    @param K Camera intrinsic parameters\n    @param H Camera extrinsic parameters\n    @return Backward-projected point\n    */\n    Point2f warpPointBackward(const Point2f &pt, InputArray K, InputArray H) CV_OVERRIDE;\n\n    /** @brief Builds the projection maps according to the given camera data.\n\n    @param src_size Source image size\n    @param K Camera intrinsic parameters\n    @param H Camera extrinsic parameters\n    @param xmap Projection map for the x axis\n    @param ymap Projection map for the y axis\n    @return Projected image minimum bounding box\n     */\n    Rect buildMaps(Size src_size, InputArray K, InputArray H, OutputArray xmap, OutputArray ymap) CV_OVERRIDE;\n\n    /** @brief Projects the image.\n\n    @param src Source image\n    @param K Camera intrinsic parameters\n    @param H Camera extrinsic parameters\n    @param interp_mode Interpolation mode\n    @param border_mode Border extrapolation mode\n    @param dst Projected image\n    @return Project image top-left corner\n     */\n    Point warp(InputArray src, InputArray K, InputArray H,\n               int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE;\n\n    /**\n    @param src_size Source image bounding box\n    @param K Camera intrinsic parameters\n    @param H Camera extrinsic parameters\n    @return Projected image minimum bounding box\n     */\n    Rect warpRoi(Size src_size, InputArray K, InputArray H) CV_OVERRIDE;\n\nprotected:\n    /** @brief Extracts rotation and translation matrices from matrix H representing\n        affine transformation in homogeneous coordinates\n     */\n    void getRTfromHomogeneous(InputArray H, Mat &R, Mat &T);\n};\n\n\nstruct CV_EXPORTS_W_SIMPLE SphericalProjector : ProjectorBase\n{\n    CV_WRAP void mapForward(float x, float y, float &u, float &v);\n    CV_WRAP void mapBackward(float u, float v, float &x, float &y);\n};\n\n\n/** @brief Warper that maps an image onto the unit sphere located at the origin.\n\n Projects image onto unit sphere with origin at (0, 0, 0) and radius scale, measured in pixels.\n A 360 panorama would therefore have a resulting width of 2 * scale * PI pixels.\n Poles are located at (0, -1, 0) and (0, 1, 0) points.\n*/\nclass CV_EXPORTS SphericalWarper : public RotationWarperBase<SphericalProjector>\n{\npublic:\n    /** @brief Construct an instance of the spherical warper class.\n\n    @param scale Radius of the projected sphere, in pixels. An image spanning the\n                 whole sphere will have a width of 2 * scale * PI pixels.\n     */\n    SphericalWarper(float scale) { projector_.scale = scale; }\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE;\n    Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE;\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE;\n};\n\n\nstruct CV_EXPORTS CylindricalProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\n/** @brief Warper that maps an image onto the x\\*x + z\\*z = 1 cylinder.\n */\nclass CV_EXPORTS CylindricalWarper : public RotationWarperBase<CylindricalProjector>\n{\npublic:\n    /** @brief Construct an instance of the cylindrical warper class.\n\n    @param scale Projected image scale multiplier\n     */\n    CylindricalWarper(float scale) { projector_.scale = scale; }\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE;\n    Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE;\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE\n    {\n        RotationWarperBase<CylindricalProjector>::detectResultRoiByBorder(src_size, dst_tl, dst_br);\n    }\n};\n\n\nstruct CV_EXPORTS FisheyeProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS FisheyeWarper : public RotationWarperBase<FisheyeProjector>\n{\npublic:\n    FisheyeWarper(float scale) { projector_.scale = scale; }\n};\n\n\nstruct CV_EXPORTS StereographicProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS StereographicWarper : public RotationWarperBase<StereographicProjector>\n{\npublic:\n    StereographicWarper(float scale) { projector_.scale = scale; }\n};\n\n\nstruct CV_EXPORTS CompressedRectilinearProjector : ProjectorBase\n{\n    float a, b;\n\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS CompressedRectilinearWarper : public RotationWarperBase<CompressedRectilinearProjector>\n{\npublic:\n    CompressedRectilinearWarper(float scale, float A = 1, float B = 1)\n    {\n        projector_.a = A;\n        projector_.b = B;\n        projector_.scale = scale;\n    }\n};\n\n\nstruct CV_EXPORTS CompressedRectilinearPortraitProjector : ProjectorBase\n{\n    float a, b;\n\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS CompressedRectilinearPortraitWarper : public RotationWarperBase<CompressedRectilinearPortraitProjector>\n{\npublic:\n   CompressedRectilinearPortraitWarper(float scale, float A = 1, float B = 1)\n   {\n       projector_.a = A;\n       projector_.b = B;\n       projector_.scale = scale;\n   }\n};\n\n\nstruct CV_EXPORTS PaniniProjector : ProjectorBase\n{\n    float a, b;\n\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS PaniniWarper : public RotationWarperBase<PaniniProjector>\n{\npublic:\n   PaniniWarper(float scale, float A = 1, float B = 1)\n   {\n       projector_.a = A;\n       projector_.b = B;\n       projector_.scale = scale;\n   }\n};\n\n\nstruct CV_EXPORTS PaniniPortraitProjector : ProjectorBase\n{\n    float a, b;\n\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS PaniniPortraitWarper : public RotationWarperBase<PaniniPortraitProjector>\n{\npublic:\n   PaniniPortraitWarper(float scale, float A = 1, float B = 1)\n   {\n       projector_.a = A;\n       projector_.b = B;\n       projector_.scale = scale;\n   }\n\n};\n\n\nstruct CV_EXPORTS MercatorProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS MercatorWarper : public RotationWarperBase<MercatorProjector>\n{\npublic:\n    MercatorWarper(float scale) { projector_.scale = scale; }\n};\n\n\nstruct CV_EXPORTS TransverseMercatorProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS TransverseMercatorWarper : public RotationWarperBase<TransverseMercatorProjector>\n{\npublic:\n    TransverseMercatorWarper(float scale) { projector_.scale = scale; }\n};\n\n\nclass CV_EXPORTS PlaneWarperGpu : public PlaneWarper\n{\npublic:\n    PlaneWarperGpu(float scale = 1.f) : PlaneWarper(scale) {}\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE\n    {\n        Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_);\n        d_xmap_.download(xmap);\n        d_ymap_.download(ymap);\n        return result;\n    }\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, OutputArray xmap, OutputArray ymap) CV_OVERRIDE\n    {\n        Rect result = buildMaps(src_size, K, R, T, d_xmap_, d_ymap_);\n        d_xmap_.download(xmap);\n        d_ymap_.download(ymap);\n        return result;\n    }\n\n    Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n               OutputArray dst) CV_OVERRIDE\n    {\n        d_src_.upload(src);\n        Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_);\n        d_dst_.download(dst);\n        return result;\n    }\n\n    Point warp(InputArray src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode,\n               OutputArray dst) CV_OVERRIDE\n    {\n        d_src_.upload(src);\n        Point result = warp(d_src_, K, R, T, interp_mode, border_mode, d_dst_);\n        d_dst_.download(dst);\n        return result;\n    }\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, cuda::GpuMat & xmap, cuda::GpuMat & ymap);\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, cuda::GpuMat & xmap, cuda::GpuMat & ymap);\n\n    Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, int interp_mode, int border_mode,\n               cuda::GpuMat & dst);\n\n    Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode,\n               cuda::GpuMat & dst);\n\nprivate:\n    cuda::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_;\n};\n\n\nclass CV_EXPORTS SphericalWarperGpu : public SphericalWarper\n{\npublic:\n    SphericalWarperGpu(float scale) : SphericalWarper(scale) {}\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE\n    {\n        Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_);\n        d_xmap_.download(xmap);\n        d_ymap_.download(ymap);\n        return result;\n    }\n\n    Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n               OutputArray dst) CV_OVERRIDE\n    {\n        d_src_.upload(src);\n        Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_);\n        d_dst_.download(dst);\n        return result;\n    }\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, cuda::GpuMat & xmap, cuda::GpuMat & ymap);\n\n    Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, int interp_mode, int border_mode,\n               cuda::GpuMat & dst);\n\nprivate:\n    cuda::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_;\n};\n\n\nclass CV_EXPORTS CylindricalWarperGpu : public CylindricalWarper\n{\npublic:\n    CylindricalWarperGpu(float scale) : CylindricalWarper(scale) {}\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE\n    {\n        Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_);\n        d_xmap_.download(xmap);\n        d_ymap_.download(ymap);\n        return result;\n    }\n\n    Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n               OutputArray dst) CV_OVERRIDE\n    {\n        d_src_.upload(src);\n        Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_);\n        d_dst_.download(dst);\n        return result;\n    }\n\n    Rect buildMaps(Size src_size, InputArray K, InputArray R, cuda::GpuMat & xmap, cuda::GpuMat & ymap);\n\n    Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, int interp_mode, int border_mode,\n               cuda::GpuMat & dst);\n\nprivate:\n    cuda::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_;\n};\n\n\nstruct CV_EXPORTS SphericalPortraitProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\n// Projects image onto unit sphere with origin at (0, 0, 0).\n// Poles are located NOT at (0, -1, 0) and (0, 1, 0) points, BUT at (1, 0, 0) and (-1, 0, 0) points.\nclass CV_EXPORTS SphericalPortraitWarper : public RotationWarperBase<SphericalPortraitProjector>\n{\npublic:\n    SphericalPortraitWarper(float scale) { projector_.scale = scale; }\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE;\n};\n\nstruct CV_EXPORTS CylindricalPortraitProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS CylindricalPortraitWarper : public RotationWarperBase<CylindricalPortraitProjector>\n{\npublic:\n    CylindricalPortraitWarper(float scale) { projector_.scale = scale; }\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE\n    {\n        RotationWarperBase<CylindricalPortraitProjector>::detectResultRoiByBorder(src_size, dst_tl, dst_br);\n    }\n};\n\nstruct CV_EXPORTS PlanePortraitProjector : ProjectorBase\n{\n    void mapForward(float x, float y, float &u, float &v);\n    void mapBackward(float u, float v, float &x, float &y);\n};\n\n\nclass CV_EXPORTS PlanePortraitWarper : public RotationWarperBase<PlanePortraitProjector>\n{\npublic:\n    PlanePortraitWarper(float scale) { projector_.scale = scale; }\n\nprotected:\n    void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE\n    {\n        RotationWarperBase<PlanePortraitProjector>::detectResultRoiByBorder(src_size, dst_tl, dst_br);\n    }\n};\n\n//! @} stitching_warp\n\n} // namespace detail\n} // namespace cv\n\n#include \"warpers_inl.hpp\"\n\n#endif // OPENCV_STITCHING_WARPERS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/detail/warpers_inl.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_WARPERS_INL_HPP\n#define OPENCV_STITCHING_WARPERS_INL_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"warpers.hpp\" // Make your IDE see declarations\n#include <limits>\n\n//! @cond IGNORED\n\nnamespace cv {\nnamespace detail {\n\ntemplate <class P>\nPoint2f RotationWarperBase<P>::warpPoint(const Point2f &pt, InputArray K, InputArray R)\n{\n    projector_.setCameraParams(K, R);\n    Point2f uv;\n    projector_.mapForward(pt.x, pt.y, uv.x, uv.y);\n    return uv;\n}\n\ntemplate <class P>\nPoint2f RotationWarperBase<P>::warpPointBackward(const Point2f& pt, InputArray K, InputArray R)\n{\n    projector_.setCameraParams(K, R);\n    Point2f xy;\n    projector_.mapBackward(pt.x, pt.y, xy.x, xy.y);\n    return xy;\n}\n\ntemplate <class P>\nRect RotationWarperBase<P>::buildMaps(Size src_size, InputArray K, InputArray R, OutputArray _xmap, OutputArray _ymap)\n{\n    projector_.setCameraParams(K, R);\n\n    Point dst_tl, dst_br;\n    detectResultRoi(src_size, dst_tl, dst_br);\n\n    _xmap.create(dst_br.y - dst_tl.y + 1, dst_br.x - dst_tl.x + 1, CV_32F);\n    _ymap.create(dst_br.y - dst_tl.y + 1, dst_br.x - dst_tl.x + 1, CV_32F);\n\n    Mat xmap = _xmap.getMat(), ymap = _ymap.getMat();\n\n    float x, y;\n    for (int v = dst_tl.y; v <= dst_br.y; ++v)\n    {\n        for (int u = dst_tl.x; u <= dst_br.x; ++u)\n        {\n            projector_.mapBackward(static_cast<float>(u), static_cast<float>(v), x, y);\n            xmap.at<float>(v - dst_tl.y, u - dst_tl.x) = x;\n            ymap.at<float>(v - dst_tl.y, u - dst_tl.x) = y;\n        }\n    }\n\n    return Rect(dst_tl, dst_br);\n}\n\n\ntemplate <class P>\nPoint RotationWarperBase<P>::warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n                                  OutputArray dst)\n{\n    UMat xmap, ymap;\n    Rect dst_roi = buildMaps(src.size(), K, R, xmap, ymap);\n\n    dst.create(dst_roi.height + 1, dst_roi.width + 1, src.type());\n    remap(src, dst, xmap, ymap, interp_mode, border_mode);\n\n    return dst_roi.tl();\n}\n\n\ntemplate <class P>\nvoid RotationWarperBase<P>::warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n                                         Size dst_size, OutputArray dst)\n{\n    projector_.setCameraParams(K, R);\n\n    Point src_tl, src_br;\n    detectResultRoi(dst_size, src_tl, src_br);\n\n    Size size = src.size();\n    CV_Assert(src_br.x - src_tl.x + 1 == size.width && src_br.y - src_tl.y + 1 == size.height);\n\n    Mat xmap(dst_size, CV_32F);\n    Mat ymap(dst_size, CV_32F);\n\n    float u, v;\n    for (int y = 0; y < dst_size.height; ++y)\n    {\n        for (int x = 0; x < dst_size.width; ++x)\n        {\n            projector_.mapForward(static_cast<float>(x), static_cast<float>(y), u, v);\n            xmap.at<float>(y, x) = u - src_tl.x;\n            ymap.at<float>(y, x) = v - src_tl.y;\n        }\n    }\n\n    dst.create(dst_size, src.type());\n    remap(src, dst, xmap, ymap, interp_mode, border_mode);\n}\n\n\ntemplate <class P>\nRect RotationWarperBase<P>::warpRoi(Size src_size, InputArray K, InputArray R)\n{\n    projector_.setCameraParams(K, R);\n\n    Point dst_tl, dst_br;\n    detectResultRoi(src_size, dst_tl, dst_br);\n\n    return Rect(dst_tl, Point(dst_br.x + 1, dst_br.y + 1));\n}\n\n\ntemplate <class P>\nvoid RotationWarperBase<P>::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br)\n{\n    float tl_uf = (std::numeric_limits<float>::max)();\n    float tl_vf = (std::numeric_limits<float>::max)();\n    float br_uf = -(std::numeric_limits<float>::max)();\n    float br_vf = -(std::numeric_limits<float>::max)();\n\n    float u, v;\n    for (int y = 0; y < src_size.height; ++y)\n    {\n        for (int x = 0; x < src_size.width; ++x)\n        {\n            projector_.mapForward(static_cast<float>(x), static_cast<float>(y), u, v);\n            tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);\n            br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);\n        }\n    }\n\n    dst_tl.x = static_cast<int>(tl_uf);\n    dst_tl.y = static_cast<int>(tl_vf);\n    dst_br.x = static_cast<int>(br_uf);\n    dst_br.y = static_cast<int>(br_vf);\n}\n\n\ntemplate <class P>\nvoid RotationWarperBase<P>::detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br)\n{\n    float tl_uf = (std::numeric_limits<float>::max)();\n    float tl_vf = (std::numeric_limits<float>::max)();\n    float br_uf = -(std::numeric_limits<float>::max)();\n    float br_vf = -(std::numeric_limits<float>::max)();\n\n    float u, v;\n    for (float x = 0; x < src_size.width; ++x)\n    {\n        projector_.mapForward(static_cast<float>(x), 0, u, v);\n        tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);\n        br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);\n\n        projector_.mapForward(static_cast<float>(x), static_cast<float>(src_size.height - 1), u, v);\n        tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);\n        br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);\n    }\n    for (int y = 0; y < src_size.height; ++y)\n    {\n        projector_.mapForward(0, static_cast<float>(y), u, v);\n        tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);\n        br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);\n\n        projector_.mapForward(static_cast<float>(src_size.width - 1), static_cast<float>(y), u, v);\n        tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v);\n        br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v);\n    }\n\n    dst_tl.x = static_cast<int>(tl_uf);\n    dst_tl.y = static_cast<int>(tl_vf);\n    dst_br.x = static_cast<int>(br_uf);\n    dst_br.y = static_cast<int>(br_vf);\n}\n\n\ninline\nvoid PlaneProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    x_ = t[0] + x_ / z_ * (1 - t[2]);\n    y_ = t[1] + y_ / z_ * (1 - t[2]);\n\n    u = scale * x_;\n    v = scale * y_;\n}\n\n\ninline\nvoid PlaneProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u = u / scale - t[0];\n    v = v / scale - t[1];\n\n    float z;\n    x = k_rinv[0] * u + k_rinv[1] * v + k_rinv[2] * (1 - t[2]);\n    y = k_rinv[3] * u + k_rinv[4] * v + k_rinv[5] * (1 - t[2]);\n    z = k_rinv[6] * u + k_rinv[7] * v + k_rinv[8] * (1 - t[2]);\n\n    x /= z;\n    y /= z;\n}\n\n\ninline\nvoid SphericalProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    u = scale * atan2f(x_, z_);\n    float w = y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_);\n    v = scale * (static_cast<float>(CV_PI) - acosf(w == w ? w : 0));\n}\n\n\ninline\nvoid SphericalProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float sinv = sinf(static_cast<float>(CV_PI) - v);\n    float x_ = sinv * sinf(u);\n    float y_ = cosf(static_cast<float>(CV_PI) - v);\n    float z_ = sinv * cosf(u);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\n\ninline\nvoid CylindricalProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    u = scale * atan2f(x_, z_);\n    v = scale * y_ / sqrtf(x_ * x_ + z_ * z_);\n}\n\n\ninline\nvoid CylindricalProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float x_ = sinf(u);\n    float y_ = v;\n    float z_ = cosf(u);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid FisheyeProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = (float)CV_PI - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    u = scale * v_ * cosf(u_);\n    v = scale * v_ * sinf(u_);\n}\n\ninline\nvoid FisheyeProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float u_ = atan2f(v, u);\n    float v_ = sqrtf(u*u + v*v);\n\n    float sinv = sinf((float)CV_PI - v_);\n    float x_ = sinv * sinf(u_);\n    float y_ = cosf((float)CV_PI - v_);\n    float z_ = sinv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid StereographicProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = (float)CV_PI - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    float r = sinf(v_) / (1 - cosf(v_));\n\n    u = scale * r * std::cos(u_);\n    v = scale * r * std::sin(u_);\n}\n\ninline\nvoid StereographicProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float u_ = atan2f(v, u);\n    float r = sqrtf(u*u + v*v);\n    float v_ = 2 * atanf(1.f / r);\n\n    float sinv = sinf((float)CV_PI - v_);\n    float x_ = sinv * sinf(u_);\n    float y_ = cosf((float)CV_PI - v_);\n    float z_ = sinv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid CompressedRectilinearProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    u = scale * a * tanf(u_ / a);\n    v = scale * b * tanf(v_) / cosf(u_);\n}\n\ninline\nvoid CompressedRectilinearProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float aatg = a * atanf(u / a);\n    float u_ = aatg;\n    float v_ = atanf(v * cosf(aatg) / b);\n\n    float cosv = cosf(v_);\n    float x_ = cosv * sinf(u_);\n    float y_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid CompressedRectilinearPortraitProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float y_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float x_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    u = - scale * a * tanf(u_ / a);\n    v = scale * b * tanf(v_) / cosf(u_);\n}\n\ninline\nvoid CompressedRectilinearPortraitProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= - scale;\n    v /= scale;\n\n    float aatg = a * atanf(u / a);\n    float u_ = aatg;\n    float v_ = atanf(v * cosf( aatg ) / b);\n\n    float cosv = cosf(v_);\n    float y_ = cosv * sinf(u_);\n    float x_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid PaniniProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    float tg = a * tanf(u_ / a);\n    u = scale * tg;\n\n    float sinu = sinf(u_);\n    if ( fabs(sinu) < 1E-7 )\n        v = scale * b * tanf(v_);\n    else\n        v = scale * b * tg * tanf(v_) / sinu;\n}\n\ninline\nvoid PaniniProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float lamda = a * atanf(u / a);\n    float u_ = lamda;\n\n    float v_;\n    if ( fabs(lamda) > 1E-7)\n        v_ = atanf(v * sinf(lamda) / (b * a * tanf(lamda / a)));\n    else\n        v_ = atanf(v / b);\n\n    float cosv = cosf(v_);\n    float x_ = cosv * sinf(u_);\n    float y_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid PaniniPortraitProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float y_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float x_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    float tg = a * tanf(u_ / a);\n    u = - scale * tg;\n\n    float sinu = sinf( u_ );\n    if ( fabs(sinu) < 1E-7 )\n        v = scale * b * tanf(v_);\n    else\n        v = scale * b * tg * tanf(v_) / sinu;\n}\n\ninline\nvoid PaniniPortraitProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= - scale;\n    v /= scale;\n\n    float lamda = a * atanf(u / a);\n    float u_ = lamda;\n\n    float v_;\n    if ( fabs(lamda) > 1E-7)\n        v_ = atanf(v * sinf(lamda) / (b * a * tanf(lamda/a)));\n    else\n        v_ = atanf(v / b);\n\n    float cosv = cosf(v_);\n    float y_ = cosv * sinf(u_);\n    float x_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid MercatorProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    u = scale * u_;\n    v = scale * logf( tanf( (float)(CV_PI/4) + v_/2 ) );\n}\n\ninline\nvoid MercatorProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float v_ = atanf( sinhf(v) );\n    float u_ = u;\n\n    float cosv = cosf(v_);\n    float x_ = cosv * sinf(u_);\n    float y_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid TransverseMercatorProjector::mapForward(float x, float y, float &u, float &v)\n{\n    float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float u_ = atan2f(x_, z_);\n    float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_));\n\n    float B = cosf(v_) * sinf(u_);\n\n    u = scale / 2 * logf( (1+B) / (1-B) );\n    v = scale * atan2f(tanf(v_), cosf(u_));\n}\n\ninline\nvoid TransverseMercatorProjector::mapBackward(float u, float v, float &x, float &y)\n{\n    u /= scale;\n    v /= scale;\n\n    float v_ = asinf( sinf(v) / coshf(u) );\n    float u_ = atan2f( sinhf(u), std::cos(v) );\n\n    float cosv = cosf(v_);\n    float x_ = cosv * sinf(u_);\n    float y_ = sinf(v_);\n    float z_ = cosv * cosf(u_);\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid SphericalPortraitProjector::mapForward(float x, float y, float &u0, float &v0)\n{\n    float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float x_ = y0_;\n    float y_ = x0_;\n    float u, v;\n\n    u = scale * atan2f(x_, z_);\n    v = scale * (static_cast<float>(CV_PI) - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)));\n\n    u0 = -u;//v;\n    v0 = v;//u;\n}\n\n\ninline\nvoid SphericalPortraitProjector::mapBackward(float u0, float v0, float &x, float &y)\n{\n    float u, v;\n    u = -u0;//v0;\n    v = v0;//u0;\n\n    u /= scale;\n    v /= scale;\n\n    float sinv = sinf(static_cast<float>(CV_PI) - v);\n    float x0_ = sinv * sinf(u);\n    float y0_ = cosf(static_cast<float>(CV_PI) - v);\n    float z_ = sinv * cosf(u);\n\n    float x_ = y0_;\n    float y_ = x0_;\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid CylindricalPortraitProjector::mapForward(float x, float y, float &u0, float &v0)\n{\n    float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_  = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float x_ = y0_;\n    float y_ = x0_;\n    float u, v;\n\n    u = scale * atan2f(x_, z_);\n    v = scale * y_ / sqrtf(x_ * x_ + z_ * z_);\n\n    u0 = -u;//v;\n    v0 = v;//u;\n}\n\n\ninline\nvoid CylindricalPortraitProjector::mapBackward(float u0, float v0, float &x, float &y)\n{\n    float u, v;\n    u = -u0;//v0;\n    v = v0;//u0;\n\n    u /= scale;\n    v /= scale;\n\n    float x0_ = sinf(u);\n    float y0_ = v;\n    float z_  = cosf(u);\n\n    float x_ = y0_;\n    float y_ = x0_;\n\n    float z;\n    x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_;\n    y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_;\n    z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_;\n\n    if (z > 0) { x /= z; y /= z; }\n    else x = y = -1;\n}\n\ninline\nvoid PlanePortraitProjector::mapForward(float x, float y, float &u0, float &v0)\n{\n    float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2];\n    float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5];\n    float z_  = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8];\n\n    float x_ = y0_;\n    float y_ = x0_;\n\n    x_ = t[0] + x_ / z_ * (1 - t[2]);\n    y_ = t[1] + y_ / z_ * (1 - t[2]);\n\n    float u,v;\n    u = scale * x_;\n    v = scale * y_;\n\n    u0 = -u;\n    v0 = v;\n}\n\n\ninline\nvoid PlanePortraitProjector::mapBackward(float u0, float v0, float &x, float &y)\n{\n    float u, v;\n    u = -u0;\n    v = v0;\n\n    u = u / scale - t[0];\n    v = v / scale - t[1];\n\n    float z;\n    x = k_rinv[0] * v + k_rinv[1] * u + k_rinv[2] * (1 - t[2]);\n    y = k_rinv[3] * v + k_rinv[4] * u + k_rinv[5] * (1 - t[2]);\n    z = k_rinv[6] * v + k_rinv[7] * u + k_rinv[8] * (1 - t[2]);\n\n    x /= z;\n    y /= z;\n}\n\n\n} // namespace detail\n} // namespace cv\n\n//! @endcond\n\n#endif // OPENCV_STITCHING_WARPERS_INL_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching/warpers.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_WARPER_CREATORS_HPP\n#define OPENCV_STITCHING_WARPER_CREATORS_HPP\n\n#include \"opencv2/stitching/detail/warpers.hpp\"\n#include <string>\n\nnamespace cv {\n    class CV_EXPORTS_W PyRotationWarper\n    {\n        Ptr<detail::RotationWarper> rw;\n\n    public:\n        CV_WRAP PyRotationWarper(String type, float scale);\n        CV_WRAP PyRotationWarper() {};\n        ~PyRotationWarper() {}\n\n        /** @brief Projects the image point.\n\n        @param pt Source point\n        @param K Camera intrinsic parameters\n        @param R Camera rotation matrix\n        @return Projected point\n        */\n        CV_WRAP Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R);\n\n        /** @brief Projects the image point backward.\n\n        @param pt Projected point\n        @param K Camera intrinsic parameters\n        @param R Camera rotation matrix\n        @return Backward-projected point\n        */\n#if CV_VERSION_MAJOR == 4\n        CV_WRAP Point2f warpPointBackward(const Point2f& pt, InputArray K, InputArray R)\n        {\n            CV_UNUSED(pt); CV_UNUSED(K); CV_UNUSED(R);\n            CV_Error(Error::StsNotImplemented, \"\");\n        }\n#else\n        CV_WRAP Point2f warpPointBackward(const Point2f &pt, InputArray K, InputArray R);\n#endif\n        /** @brief Builds the projection maps according to the given camera data.\n\n        @param src_size Source image size\n        @param K Camera intrinsic parameters\n        @param R Camera rotation matrix\n        @param xmap Projection map for the x axis\n        @param ymap Projection map for the y axis\n        @return Projected image minimum bounding box\n        */\n        CV_WRAP Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap);\n\n        /** @brief Projects the image.\n\n        @param src Source image\n        @param K Camera intrinsic parameters\n        @param R Camera rotation matrix\n        @param interp_mode Interpolation mode\n        @param border_mode Border extrapolation mode\n        @param dst Projected image\n        @return Project image top-left corner\n        */\n        CV_WRAP Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n            CV_OUT OutputArray dst);\n\n        /** @brief Projects the image backward.\n\n        @param src Projected image\n        @param K Camera intrinsic parameters\n        @param R Camera rotation matrix\n        @param interp_mode Interpolation mode\n        @param border_mode Border extrapolation mode\n        @param dst_size Backward-projected image size\n        @param dst Backward-projected image\n        */\n        CV_WRAP void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode,\n            Size dst_size, CV_OUT OutputArray dst);\n\n        /**\n        @param src_size Source image bounding box\n        @param K Camera intrinsic parameters\n        @param R Camera rotation matrix\n        @return Projected image minimum bounding box\n        */\n        CV_WRAP Rect warpRoi(Size src_size, InputArray K, InputArray R);\n\n        CV_WRAP float getScale() const { return 1.f; }\n        CV_WRAP void setScale(float) {}\n    };\n\n//! @addtogroup stitching_warp\n//! @{\n\n/** @brief Image warper factories base class.\n */\n\nclass CV_EXPORTS_W WarperCreator\n{\npublic:\n    CV_WRAP virtual ~WarperCreator() {}\n    virtual Ptr<detail::RotationWarper> create(float scale) const = 0;\n};\n\n\n/** @brief Plane warper factory class.\n  @sa detail::PlaneWarper\n */\nclass CV_EXPORTS  PlaneWarper : public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::PlaneWarper>(scale); }\n};\n\n/** @brief Affine warper factory class.\n  @sa detail::AffineWarper\n */\nclass CV_EXPORTS  AffineWarper : public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::AffineWarper>(scale); }\n};\n\n/** @brief Cylindrical warper factory class.\n@sa detail::CylindricalWarper\n*/\nclass CV_EXPORTS CylindricalWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::CylindricalWarper>(scale); }\n};\n\n/** @brief Spherical warper factory class */\nclass CV_EXPORTS SphericalWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::SphericalWarper>(scale); }\n};\n\nclass CV_EXPORTS FisheyeWarper : public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::FisheyeWarper>(scale); }\n};\n\nclass CV_EXPORTS StereographicWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::StereographicWarper>(scale); }\n};\n\nclass CV_EXPORTS CompressedRectilinearWarper: public WarperCreator\n{\n    float a, b;\npublic:\n    CompressedRectilinearWarper(float A = 1, float B = 1)\n    {\n        a = A; b = B;\n    }\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::CompressedRectilinearWarper>(scale, a, b); }\n};\n\nclass CV_EXPORTS CompressedRectilinearPortraitWarper: public WarperCreator\n{\n    float a, b;\npublic:\n    CompressedRectilinearPortraitWarper(float A = 1, float B = 1)\n    {\n        a = A; b = B;\n    }\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::CompressedRectilinearPortraitWarper>(scale, a, b); }\n};\n\nclass CV_EXPORTS PaniniWarper: public WarperCreator\n{\n    float a, b;\npublic:\n    PaniniWarper(float A = 1, float B = 1)\n    {\n        a = A; b = B;\n    }\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::PaniniWarper>(scale, a, b); }\n};\n\nclass CV_EXPORTS PaniniPortraitWarper: public WarperCreator\n{\n    float a, b;\npublic:\n    PaniniPortraitWarper(float A = 1, float B = 1)\n    {\n        a = A; b = B;\n    }\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::PaniniPortraitWarper>(scale, a, b); }\n};\n\nclass CV_EXPORTS MercatorWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::MercatorWarper>(scale); }\n};\n\nclass CV_EXPORTS TransverseMercatorWarper: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::TransverseMercatorWarper>(scale); }\n};\n\n\n\n#ifdef HAVE_OPENCV_CUDAWARPING\nclass PlaneWarperGpu: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::PlaneWarperGpu>(scale); }\n};\n\n\nclass CylindricalWarperGpu: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::CylindricalWarperGpu>(scale); }\n};\n\n\nclass SphericalWarperGpu: public WarperCreator\n{\npublic:\n    Ptr<detail::RotationWarper> create(float scale) const CV_OVERRIDE { return makePtr<detail::SphericalWarperGpu>(scale); }\n};\n#endif\n\n//! @} stitching_warp\n\n} // namespace cv\n\n#endif // OPENCV_STITCHING_WARPER_CREATORS_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/stitching.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_STITCHING_STITCHER_HPP\n#define OPENCV_STITCHING_STITCHER_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/features2d.hpp\"\n#include \"opencv2/stitching/warpers.hpp\"\n#include \"opencv2/stitching/detail/matchers.hpp\"\n#include \"opencv2/stitching/detail/motion_estimators.hpp\"\n#include \"opencv2/stitching/detail/exposure_compensate.hpp\"\n#include \"opencv2/stitching/detail/seam_finders.hpp\"\n#include \"opencv2/stitching/detail/blenders.hpp\"\n#include \"opencv2/stitching/detail/camera.hpp\"\n\n\n#if defined(Status)\n#  warning Detected X11 'Status' macro definition, it can cause build conflicts. Please, include this header before any X11 headers.\n#endif\n\n\n/**\n@defgroup stitching Images stitching\n\nThis figure illustrates the stitching module pipeline implemented in the Stitcher class. Using that\nclass it's possible to configure/remove some steps, i.e. adjust the stitching pipeline according to\nthe particular needs. All building blocks from the pipeline are available in the detail namespace,\none can combine and use them separately.\n\nThe implemented stitching pipeline is very similar to the one proposed in @cite BL07 .\n\n![stitching pipeline](StitchingPipeline.jpg)\n\nCamera models\n-------------\n\nThere are currently 2 camera models implemented in stitching pipeline.\n\n- _Homography model_ expecting perspective transformations between images\n  implemented in @ref cv::detail::BestOf2NearestMatcher cv::detail::HomographyBasedEstimator\n  cv::detail::BundleAdjusterReproj cv::detail::BundleAdjusterRay\n- _Affine model_ expecting affine transformation with 6 DOF or 4 DOF implemented in\n  @ref cv::detail::AffineBestOf2NearestMatcher cv::detail::AffineBasedEstimator\n  cv::detail::BundleAdjusterAffine cv::detail::BundleAdjusterAffinePartial cv::AffineWarper\n\nHomography model is useful for creating photo panoramas captured by camera,\nwhile affine-based model can be used to stitch scans and object captured by\nspecialized devices. Use @ref cv::Stitcher::create to get preconfigured pipeline for one\nof those models.\n\n@note\nCertain detailed settings of @ref cv::Stitcher might not make sense. Especially\nyou should not mix classes implementing affine model and classes implementing\nHomography model, as they work with different transformations.\n\n@{\n    @defgroup stitching_match Features Finding and Images Matching\n    @defgroup stitching_rotation Rotation Estimation\n    @defgroup stitching_autocalib Autocalibration\n    @defgroup stitching_warp Images Warping\n    @defgroup stitching_seam Seam Estimation\n    @defgroup stitching_exposure Exposure Compensation\n    @defgroup stitching_blend Image Blenders\n@}\n  */\n\nnamespace cv {\n\n//! @addtogroup stitching\n//! @{\n\n/** @example samples/cpp/stitching.cpp\nA basic example on image stitching\n*/\n\n/** @example samples/python/stitching.py\nA basic example on image stitching in Python.\n*/\n\n/** @example samples/cpp/stitching_detailed.cpp\nA detailed example on image stitching\n*/\n\n/** @brief High level image stitcher.\n\nIt's possible to use this class without being aware of the entire stitching pipeline. However, to\nbe able to achieve higher stitching stability and quality of the final images at least being\nfamiliar with the theory is recommended.\n\n@note\n-   A basic example on image stitching can be found at\n    opencv_source_code/samples/cpp/stitching.cpp\n-   A basic example on image stitching in Python can be found at\n    opencv_source_code/samples/python/stitching.py\n-   A detailed example on image stitching can be found at\n    opencv_source_code/samples/cpp/stitching_detailed.cpp\n */\nclass CV_EXPORTS_W Stitcher\n{\npublic:\n    /**\n     * When setting a resolution for stitching, this values is a placeholder\n     * for preserving the original resolution.\n     */\n#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)\n    static constexpr double ORIG_RESOL = -1.0;\n#else\n    // support MSVS 2013\n    static const double ORIG_RESOL; // Initialized in stitcher.cpp\n#endif\n\n    enum Status\n    {\n        OK = 0,\n        ERR_NEED_MORE_IMGS = 1,\n        ERR_HOMOGRAPHY_EST_FAIL = 2,\n        ERR_CAMERA_PARAMS_ADJUST_FAIL = 3\n    };\n\n    enum Mode\n    {\n        /** Mode for creating photo panoramas. Expects images under perspective\n        transformation and projects resulting pano to sphere.\n\n        @sa detail::BestOf2NearestMatcher SphericalWarper\n        */\n        PANORAMA = 0,\n        /** Mode for composing scans. Expects images under affine transformation does\n        not compensate exposure by default.\n\n        @sa detail::AffineBestOf2NearestMatcher AffineWarper\n        */\n        SCANS = 1,\n\n    };\n\n    /** @brief Creates a Stitcher configured in one of the stitching modes.\n\n    @param mode Scenario for stitcher operation. This is usually determined by source of images\n    to stitch and their transformation. Default parameters will be chosen for operation in given\n    scenario.\n    @return Stitcher class instance.\n     */\n    CV_WRAP static Ptr<Stitcher> create(Mode mode = Stitcher::PANORAMA);\n\n    CV_WRAP double registrationResol() const { return registr_resol_; }\n    CV_WRAP void setRegistrationResol(double resol_mpx) { registr_resol_ = resol_mpx; }\n\n    CV_WRAP double seamEstimationResol() const { return seam_est_resol_; }\n    CV_WRAP void setSeamEstimationResol(double resol_mpx) { seam_est_resol_ = resol_mpx; }\n\n    CV_WRAP double compositingResol() const { return compose_resol_; }\n    CV_WRAP void setCompositingResol(double resol_mpx) { compose_resol_ = resol_mpx; }\n\n    CV_WRAP double panoConfidenceThresh() const { return conf_thresh_; }\n    CV_WRAP void setPanoConfidenceThresh(double conf_thresh) { conf_thresh_ = conf_thresh; }\n\n    CV_WRAP bool waveCorrection() const { return do_wave_correct_; }\n    CV_WRAP void setWaveCorrection(bool flag) { do_wave_correct_ = flag; }\n\n    CV_WRAP InterpolationFlags interpolationFlags() const { return interp_flags_; }\n    CV_WRAP void setInterpolationFlags(InterpolationFlags interp_flags) { interp_flags_ = interp_flags; }\n\n    detail::WaveCorrectKind waveCorrectKind() const { return wave_correct_kind_; }\n    void setWaveCorrectKind(detail::WaveCorrectKind kind) { wave_correct_kind_ = kind; }\n\n    Ptr<Feature2D> featuresFinder() { return features_finder_; }\n    const Ptr<Feature2D> featuresFinder() const { return features_finder_; }\n    void setFeaturesFinder(Ptr<Feature2D> features_finder)\n        { features_finder_ = features_finder; }\n\n    Ptr<detail::FeaturesMatcher> featuresMatcher() { return features_matcher_; }\n    const Ptr<detail::FeaturesMatcher> featuresMatcher() const { return features_matcher_; }\n    void setFeaturesMatcher(Ptr<detail::FeaturesMatcher> features_matcher)\n        { features_matcher_ = features_matcher; }\n\n    const cv::UMat& matchingMask() const { return matching_mask_; }\n    void setMatchingMask(const cv::UMat &mask)\n    {\n        CV_Assert(mask.type() == CV_8U && mask.cols == mask.rows);\n        matching_mask_ = mask.clone();\n    }\n\n    Ptr<detail::BundleAdjusterBase> bundleAdjuster() { return bundle_adjuster_; }\n    const Ptr<detail::BundleAdjusterBase> bundleAdjuster() const { return bundle_adjuster_; }\n    void setBundleAdjuster(Ptr<detail::BundleAdjusterBase> bundle_adjuster)\n        { bundle_adjuster_ = bundle_adjuster; }\n\n    Ptr<detail::Estimator> estimator() { return estimator_; }\n    const Ptr<detail::Estimator> estimator() const { return estimator_; }\n    void setEstimator(Ptr<detail::Estimator> estimator)\n        { estimator_ = estimator; }\n\n    Ptr<WarperCreator> warper() { return warper_; }\n    const Ptr<WarperCreator> warper() const { return warper_; }\n    void setWarper(Ptr<WarperCreator> creator) { warper_ = creator; }\n\n    Ptr<detail::ExposureCompensator> exposureCompensator() { return exposure_comp_; }\n    const Ptr<detail::ExposureCompensator> exposureCompensator() const { return exposure_comp_; }\n    void setExposureCompensator(Ptr<detail::ExposureCompensator> exposure_comp)\n        { exposure_comp_ = exposure_comp; }\n\n    Ptr<detail::SeamFinder> seamFinder() { return seam_finder_; }\n    const Ptr<detail::SeamFinder> seamFinder() const { return seam_finder_; }\n    void setSeamFinder(Ptr<detail::SeamFinder> seam_finder) { seam_finder_ = seam_finder; }\n\n    Ptr<detail::Blender> blender() { return blender_; }\n    const Ptr<detail::Blender> blender() const { return blender_; }\n    void setBlender(Ptr<detail::Blender> b) { blender_ = b; }\n\n    /** @brief These functions try to match the given images and to estimate rotations of each camera.\n\n    @note Use the functions only if you're aware of the stitching pipeline, otherwise use\n    Stitcher::stitch.\n\n    @param images Input images.\n    @param masks Masks for each input image specifying where to look for keypoints (optional).\n    @return Status code.\n     */\n    CV_WRAP Status estimateTransform(InputArrayOfArrays images, InputArrayOfArrays masks = noArray());\n\n    /** @brief These function restors camera rotation and camera intrinsics of each camera\n     *  that can be got with @ref Stitcher::cameras call\n\n    @param images Input images.\n    @param cameras Estimated rotation of cameras for each of the input images.\n    @param component Indices (0-based) of images constituting the final panorama (optional).\n    @return Status code.\n     */\n    Status setTransform(InputArrayOfArrays images,\n                        const std::vector<detail::CameraParams> &cameras,\n                        const std::vector<int> &component);\n    /** @overload */\n    Status setTransform(InputArrayOfArrays images, const std::vector<detail::CameraParams> &cameras);\n\n    /** @overload */\n    CV_WRAP Status composePanorama(OutputArray pano);\n    /** @brief These functions try to compose the given images (or images stored internally from the other function\n    calls) into the final pano under the assumption that the image transformations were estimated\n    before.\n\n    @note Use the functions only if you're aware of the stitching pipeline, otherwise use\n    Stitcher::stitch.\n\n    @param images Input images.\n    @param pano Final pano.\n    @return Status code.\n     */\n    CV_WRAP Status composePanorama(InputArrayOfArrays images, OutputArray pano);\n\n    /** @overload */\n    CV_WRAP Status stitch(InputArrayOfArrays images, OutputArray pano);\n    /** @brief These functions try to stitch the given images.\n\n    @param images Input images.\n    @param masks Masks for each input image specifying where to look for keypoints (optional).\n    @param pano Final pano.\n    @return Status code.\n     */\n    CV_WRAP Status stitch(InputArrayOfArrays images, InputArrayOfArrays masks, OutputArray pano);\n\n    std::vector<int> component() const { return indices_; }\n    std::vector<detail::CameraParams> cameras() const { return cameras_; }\n    CV_WRAP double workScale() const { return work_scale_; }\n    UMat resultMask() const { return result_mask_; }\n\nprivate:\n    Status matchImages();\n    Status estimateCameraParams();\n\n    double registr_resol_;\n    double seam_est_resol_;\n    double compose_resol_;\n    double conf_thresh_;\n    InterpolationFlags interp_flags_;\n    Ptr<Feature2D> features_finder_;\n    Ptr<detail::FeaturesMatcher> features_matcher_;\n    cv::UMat matching_mask_;\n    Ptr<detail::BundleAdjusterBase> bundle_adjuster_;\n    Ptr<detail::Estimator> estimator_;\n    bool do_wave_correct_;\n    detail::WaveCorrectKind wave_correct_kind_;\n    Ptr<WarperCreator> warper_;\n    Ptr<detail::ExposureCompensator> exposure_comp_;\n    Ptr<detail::SeamFinder> seam_finder_;\n    Ptr<detail::Blender> blender_;\n\n    std::vector<cv::UMat> imgs_;\n    std::vector<cv::UMat> masks_;\n    std::vector<cv::Size> full_img_sizes_;\n    std::vector<detail::ImageFeatures> features_;\n    std::vector<detail::MatchesInfo> pairwise_matches_;\n    std::vector<cv::UMat> seam_est_imgs_;\n    std::vector<int> indices_;\n    std::vector<detail::CameraParams> cameras_;\n    UMat result_mask_;\n    double work_scale_;\n    double seam_scale_;\n    double seam_work_aspect_;\n    double warped_image_scale_;\n};\n\n/**\n * @deprecated use Stitcher::create\n */\nCV_DEPRECATED Ptr<Stitcher> createStitcher(bool try_use_gpu = false);\n\n/**\n * @deprecated use Stitcher::create\n */\nCV_DEPRECATED Ptr<Stitcher> createStitcherScans(bool try_use_gpu = false);\n\n//! @} stitching\n\n} // namespace cv\n\n#endif // OPENCV_STITCHING_STITCHER_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/video/background_segm.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_BACKGROUND_SEGM_HPP\n#define OPENCV_BACKGROUND_SEGM_HPP\n\n#include \"opencv2/core.hpp\"\n\nnamespace cv\n{\n\n//! @addtogroup video_motion\n//! @{\n\n/** @brief Base class for background/foreground segmentation. :\n\nThe class is only used to define the common interface for the whole family of background/foreground\nsegmentation algorithms.\n */\nclass CV_EXPORTS_W BackgroundSubtractor : public Algorithm\n{\npublic:\n    /** @brief Computes a foreground mask.\n\n    @param image Next video frame.\n    @param fgmask The output foreground mask as an 8-bit binary image.\n    @param learningRate The value between 0 and 1 that indicates how fast the background model is\n    learnt. Negative parameter value makes the algorithm to use some automatically chosen learning\n    rate. 0 means that the background model is not updated at all, 1 means that the background model\n    is completely reinitialized from the last frame.\n     */\n    CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) = 0;\n\n    /** @brief Computes a background image.\n\n    @param backgroundImage The output background image.\n\n    @note Sometimes the background image can be very blurry, as it contain the average background\n    statistics.\n     */\n    CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const = 0;\n};\n\n\n/** @brief Gaussian Mixture-based Background/Foreground Segmentation Algorithm.\n\nThe class implements the Gaussian mixture model background subtraction described in @cite Zivkovic2004\nand @cite Zivkovic2006 .\n */\nclass CV_EXPORTS_W BackgroundSubtractorMOG2 : public BackgroundSubtractor\n{\npublic:\n    /** @brief Returns the number of last frames that affect the background model\n    */\n    CV_WRAP virtual int getHistory() const = 0;\n    /** @brief Sets the number of last frames that affect the background model\n    */\n    CV_WRAP virtual void setHistory(int history) = 0;\n\n    /** @brief Returns the number of gaussian components in the background model\n    */\n    CV_WRAP virtual int getNMixtures() const = 0;\n    /** @brief Sets the number of gaussian components in the background model.\n\n    The model needs to be reinitalized to reserve memory.\n    */\n    CV_WRAP virtual void setNMixtures(int nmixtures) = 0;//needs reinitialization!\n\n    /** @brief Returns the \"background ratio\" parameter of the algorithm\n\n    If a foreground pixel keeps semi-constant value for about backgroundRatio\\*history frames, it's\n    considered background and added to the model as a center of a new component. It corresponds to TB\n    parameter in the paper.\n     */\n    CV_WRAP virtual double getBackgroundRatio() const = 0;\n    /** @brief Sets the \"background ratio\" parameter of the algorithm\n    */\n    CV_WRAP virtual void setBackgroundRatio(double ratio) = 0;\n\n    /** @brief Returns the variance threshold for the pixel-model match\n\n    The main threshold on the squared Mahalanobis distance to decide if the sample is well described by\n    the background model or not. Related to Cthr from the paper.\n     */\n    CV_WRAP virtual double getVarThreshold() const = 0;\n    /** @brief Sets the variance threshold for the pixel-model match\n    */\n    CV_WRAP virtual void setVarThreshold(double varThreshold) = 0;\n\n    /** @brief Returns the variance threshold for the pixel-model match used for new mixture component generation\n\n    Threshold for the squared Mahalanobis distance that helps decide when a sample is close to the\n    existing components (corresponds to Tg in the paper). If a pixel is not close to any component, it\n    is considered foreground or added as a new component. 3 sigma =\\> Tg=3\\*3=9 is default. A smaller Tg\n    value generates more components. A higher Tg value may result in a small number of components but\n    they can grow too large.\n     */\n    CV_WRAP virtual double getVarThresholdGen() const = 0;\n    /** @brief Sets the variance threshold for the pixel-model match used for new mixture component generation\n    */\n    CV_WRAP virtual void setVarThresholdGen(double varThresholdGen) = 0;\n\n    /** @brief Returns the initial variance of each gaussian component\n    */\n    CV_WRAP virtual double getVarInit() const = 0;\n    /** @brief Sets the initial variance of each gaussian component\n    */\n    CV_WRAP virtual void setVarInit(double varInit) = 0;\n\n    CV_WRAP virtual double getVarMin() const = 0;\n    CV_WRAP virtual void setVarMin(double varMin) = 0;\n\n    CV_WRAP virtual double getVarMax() const = 0;\n    CV_WRAP virtual void setVarMax(double varMax) = 0;\n\n    /** @brief Returns the complexity reduction threshold\n\n    This parameter defines the number of samples needed to accept to prove the component exists. CT=0.05\n    is a default value for all the samples. By setting CT=0 you get an algorithm very similar to the\n    standard Stauffer&Grimson algorithm.\n     */\n    CV_WRAP virtual double getComplexityReductionThreshold() const = 0;\n    /** @brief Sets the complexity reduction threshold\n    */\n    CV_WRAP virtual void setComplexityReductionThreshold(double ct) = 0;\n\n    /** @brief Returns the shadow detection flag\n\n    If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorMOG2 for\n    details.\n     */\n    CV_WRAP virtual bool getDetectShadows() const = 0;\n    /** @brief Enables or disables shadow detection\n    */\n    CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0;\n\n    /** @brief Returns the shadow value\n\n    Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0\n    in the mask always means background, 255 means foreground.\n     */\n    CV_WRAP virtual int getShadowValue() const = 0;\n    /** @brief Sets the shadow value\n    */\n    CV_WRAP virtual void setShadowValue(int value) = 0;\n\n    /** @brief Returns the shadow threshold\n\n    A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in\n    the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel\n    is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara,\n    *Detecting Moving Shadows...*, IEEE PAMI,2003.\n     */\n    CV_WRAP virtual double getShadowThreshold() const = 0;\n    /** @brief Sets the shadow threshold\n    */\n    CV_WRAP virtual void setShadowThreshold(double threshold) = 0;\n\n    /** @brief Computes a foreground mask.\n\n    @param image Next video frame. Floating point frame will be used without scaling and should be in range \\f$[0,255]\\f$.\n    @param fgmask The output foreground mask as an 8-bit binary image.\n    @param learningRate The value between 0 and 1 that indicates how fast the background model is\n    learnt. Negative parameter value makes the algorithm to use some automatically chosen learning\n    rate. 0 means that the background model is not updated at all, 1 means that the background model\n    is completely reinitialized from the last frame.\n     */\n    CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0;\n};\n\n/** @brief Creates MOG2 Background Subtractor\n\n@param history Length of the history.\n@param varThreshold Threshold on the squared Mahalanobis distance between the pixel and the model\nto decide whether a pixel is well described by the background model. This parameter does not\naffect the background update.\n@param detectShadows If true, the algorithm will detect shadows and mark them. It decreases the\nspeed a bit, so if you do not need this feature, set the parameter to false.\n */\nCV_EXPORTS_W Ptr<BackgroundSubtractorMOG2>\n    createBackgroundSubtractorMOG2(int history=500, double varThreshold=16,\n                                   bool detectShadows=true);\n\n/** @brief K-nearest neighbours - based Background/Foreground Segmentation Algorithm.\n\nThe class implements the K-nearest neighbours background subtraction described in @cite Zivkovic2006 .\nVery efficient if number of foreground pixels is low.\n */\nclass CV_EXPORTS_W BackgroundSubtractorKNN : public BackgroundSubtractor\n{\npublic:\n    /** @brief Returns the number of last frames that affect the background model\n    */\n    CV_WRAP virtual int getHistory() const = 0;\n    /** @brief Sets the number of last frames that affect the background model\n    */\n    CV_WRAP virtual void setHistory(int history) = 0;\n\n    /** @brief Returns the number of data samples in the background model\n    */\n    CV_WRAP virtual int getNSamples() const = 0;\n    /** @brief Sets the number of data samples in the background model.\n\n    The model needs to be reinitalized to reserve memory.\n    */\n    CV_WRAP virtual void setNSamples(int _nN) = 0;//needs reinitialization!\n\n    /** @brief Returns the threshold on the squared distance between the pixel and the sample\n\n    The threshold on the squared distance between the pixel and the sample to decide whether a pixel is\n    close to a data sample.\n     */\n    CV_WRAP virtual double getDist2Threshold() const = 0;\n    /** @brief Sets the threshold on the squared distance\n    */\n    CV_WRAP virtual void setDist2Threshold(double _dist2Threshold) = 0;\n\n    /** @brief Returns the number of neighbours, the k in the kNN.\n\n    K is the number of samples that need to be within dist2Threshold in order to decide that that\n    pixel is matching the kNN background model.\n     */\n    CV_WRAP virtual int getkNNSamples() const = 0;\n    /** @brief Sets the k in the kNN. How many nearest neighbours need to match.\n    */\n    CV_WRAP virtual void setkNNSamples(int _nkNN) = 0;\n\n    /** @brief Returns the shadow detection flag\n\n    If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for\n    details.\n     */\n    CV_WRAP virtual bool getDetectShadows() const = 0;\n    /** @brief Enables or disables shadow detection\n    */\n    CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0;\n\n    /** @brief Returns the shadow value\n\n    Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0\n    in the mask always means background, 255 means foreground.\n     */\n    CV_WRAP virtual int getShadowValue() const = 0;\n    /** @brief Sets the shadow value\n    */\n    CV_WRAP virtual void setShadowValue(int value) = 0;\n\n    /** @brief Returns the shadow threshold\n\n    A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in\n    the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel\n    is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara,\n    *Detecting Moving Shadows...*, IEEE PAMI,2003.\n     */\n    CV_WRAP virtual double getShadowThreshold() const = 0;\n    /** @brief Sets the shadow threshold\n     */\n    CV_WRAP virtual void setShadowThreshold(double threshold) = 0;\n};\n\n/** @brief Creates KNN Background Subtractor\n\n@param history Length of the history.\n@param dist2Threshold Threshold on the squared distance between the pixel and the sample to decide\nwhether a pixel is close to that sample. This parameter does not affect the background update.\n@param detectShadows If true, the algorithm will detect shadows and mark them. It decreases the\nspeed a bit, so if you do not need this feature, set the parameter to false.\n */\nCV_EXPORTS_W Ptr<BackgroundSubtractorKNN>\n    createBackgroundSubtractorKNN(int history=500, double dist2Threshold=400.0,\n                                   bool detectShadows=true);\n\n//! @} video_motion\n\n} // cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/video/detail/tracking.detail.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_VIDEO_DETAIL_TRACKING_HPP\n#define OPENCV_VIDEO_DETAIL_TRACKING_HPP\n\n/*\n * Partially based on:\n * ====================================================================================================================\n *  - [AAM] S. Salti, A. Cavallaro, L. Di Stefano, Adaptive Appearance Modeling for Video Tracking: Survey and Evaluation\n *  - [AMVOT] X. Li, W. Hu, C. Shen, Z. Zhang, A. Dick, A. van den Hengel, A Survey of Appearance Models in Visual Object Tracking\n *\n * This Tracking API has been designed with PlantUML. If you modify this API please change UML files under modules/tracking/doc/uml\n *\n */\n\n#include \"opencv2/core.hpp\"\n\nnamespace cv {\nnamespace detail {\ninline namespace tracking {\n\n/** @addtogroup tracking_detail\n@{\n*/\n\n/************************************ TrackerFeature Base Classes ************************************/\n\n/** @brief Abstract base class for TrackerFeature that represents the feature.\n*/\nclass CV_EXPORTS TrackerFeature\n{\npublic:\n    virtual ~TrackerFeature();\n\n    /** @brief Compute the features in the images collection\n    @param images The images\n    @param response The output response\n    */\n    void compute(const std::vector<Mat>& images, Mat& response);\n\nprotected:\n    virtual bool computeImpl(const std::vector<Mat>& images, Mat& response) = 0;\n};\n\n/** @brief Class that manages the extraction and selection of features\n\n@cite AAM Feature Extraction and Feature Set Refinement (Feature Processing and Feature Selection).\nSee table I and section III C @cite AMVOT Appearance modelling -\\> Visual representation (Table II,\nsection 3.1 - 3.2)\n\nTrackerFeatureSet is an aggregation of TrackerFeature\n\n@sa\n   TrackerFeature\n\n*/\nclass CV_EXPORTS TrackerFeatureSet\n{\npublic:\n    TrackerFeatureSet();\n\n    ~TrackerFeatureSet();\n\n    /** @brief Extract features from the images collection\n    @param images The input images\n    */\n    void extraction(const std::vector<Mat>& images);\n\n    /** @brief Add TrackerFeature in the collection. Return true if TrackerFeature is added, false otherwise\n    @param feature The TrackerFeature class\n    */\n    bool addTrackerFeature(const Ptr<TrackerFeature>& feature);\n\n    /** @brief Get the TrackerFeature collection (TrackerFeature name, TrackerFeature pointer)\n    */\n    const std::vector<Ptr<TrackerFeature>>& getTrackerFeatures() const;\n\n    /** @brief Get the responses\n    @note Be sure to call extraction before getResponses Example TrackerFeatureSet::getResponses\n    */\n    const std::vector<Mat>& getResponses() const;\n\nprivate:\n    void clearResponses();\n    bool blockAddTrackerFeature;\n\n    std::vector<Ptr<TrackerFeature>> features;  // list of features\n    std::vector<Mat> responses;  // list of response after compute\n};\n\n/************************************ TrackerSampler Base Classes ************************************/\n\n/** @brief Abstract base class for TrackerSamplerAlgorithm that represents the algorithm for the specific\nsampler.\n*/\nclass CV_EXPORTS TrackerSamplerAlgorithm\n{\npublic:\n    virtual ~TrackerSamplerAlgorithm();\n\n    /** @brief Computes the regions starting from a position in an image.\n\n    Return true if samples are computed, false otherwise\n\n    @param image The current frame\n    @param boundingBox The bounding box from which regions can be calculated\n\n    @param sample The computed samples @cite AAM Fig. 1 variable Sk\n    */\n    virtual bool sampling(const Mat& image, const Rect& boundingBox, std::vector<Mat>& sample) = 0;\n};\n\n/**\n * \\brief Class that manages the sampler in order to select regions for the update the model of the tracker\n * [AAM] Sampling e Labeling. See table I and section III B\n */\n\n/** @brief Class that manages the sampler in order to select regions for the update the model of the tracker\n\n@cite AAM Sampling e Labeling. See table I and section III B\n\nTrackerSampler is an aggregation of TrackerSamplerAlgorithm\n@sa\n   TrackerSamplerAlgorithm\n */\nclass CV_EXPORTS TrackerSampler\n{\npublic:\n    TrackerSampler();\n\n    ~TrackerSampler();\n\n    /** @brief Computes the regions starting from a position in an image\n    @param image The current frame\n    @param boundingBox The bounding box from which regions can be calculated\n    */\n    void sampling(const Mat& image, Rect boundingBox);\n\n    /** @brief Return the collection of the TrackerSamplerAlgorithm\n    */\n    const std::vector<Ptr<TrackerSamplerAlgorithm>>& getSamplers() const;\n\n    /** @brief Return the samples from all TrackerSamplerAlgorithm, @cite AAM Fig. 1 variable Sk\n    */\n    const std::vector<Mat>& getSamples() const;\n\n    /** @brief Add TrackerSamplerAlgorithm in the collection. Return true if sampler is added, false otherwise\n    @param sampler The TrackerSamplerAlgorithm\n    */\n    bool addTrackerSamplerAlgorithm(const Ptr<TrackerSamplerAlgorithm>& sampler);\n\nprivate:\n    std::vector<Ptr<TrackerSamplerAlgorithm>> samplers;\n    std::vector<Mat> samples;\n    bool blockAddTrackerSampler;\n\n    void clearSamples();\n};\n\n/************************************ TrackerModel Base Classes ************************************/\n\n/** @brief Abstract base class for TrackerTargetState that represents a possible state of the target.\n\nSee @cite AAM \\f$\\hat{x}^{i}_{k}\\f$ all the states candidates.\n\nInherits this class with your Target state, In own implementation you can add scale variation,\nwidth, height, orientation, etc.\n*/\nclass CV_EXPORTS TrackerTargetState\n{\npublic:\n    virtual ~TrackerTargetState() {};\n    /** @brief Get the position\n    * @return The position\n    */\n    Point2f getTargetPosition() const;\n\n    /** @brief Set the position\n    * @param position The position\n    */\n    void setTargetPosition(const Point2f& position);\n    /** @brief Get the width of the target\n    * @return The width of the target\n    */\n    int getTargetWidth() const;\n\n    /** @brief Set the width of the target\n    * @param width The width of the target\n    */\n    void setTargetWidth(int width);\n    /** @brief Get the height of the target\n    * @return The height of the target\n    */\n    int getTargetHeight() const;\n\n    /** @brief Set the height of the target\n    * @param height The height of the target\n    */\n    void setTargetHeight(int height);\n\nprotected:\n    Point2f targetPosition;\n    int targetWidth;\n    int targetHeight;\n};\n\n/** @brief Represents the model of the target at frame \\f$k\\f$ (all states and scores)\n\nSee @cite AAM The set of the pair \\f$\\langle \\hat{x}^{i}_{k}, C^{i}_{k} \\rangle\\f$\n@sa TrackerTargetState\n*/\ntypedef std::vector<std::pair<Ptr<TrackerTargetState>, float>> ConfidenceMap;\n\n/** @brief Represents the estimate states for all frames\n\n@cite AAM \\f$x_{k}\\f$ is the trajectory of the target up to time \\f$k\\f$\n\n@sa TrackerTargetState\n*/\ntypedef std::vector<Ptr<TrackerTargetState>> Trajectory;\n\n/** @brief Abstract base class for TrackerStateEstimator that estimates the most likely target state.\n\nSee @cite AAM State estimator\n\nSee @cite AMVOT Statistical modeling (Fig. 3), Table III (generative) - IV (discriminative) - V (hybrid)\n*/\nclass CV_EXPORTS TrackerStateEstimator\n{\npublic:\n    virtual ~TrackerStateEstimator();\n\n    /** @brief Estimate the most likely target state, return the estimated state\n    @param confidenceMaps The overall appearance model as a list of :cConfidenceMap\n    */\n    Ptr<TrackerTargetState> estimate(const std::vector<ConfidenceMap>& confidenceMaps);\n\n    /** @brief Update the ConfidenceMap with the scores\n    @param confidenceMaps The overall appearance model as a list of :cConfidenceMap\n    */\n    void update(std::vector<ConfidenceMap>& confidenceMaps);\n\n    /** @brief Create TrackerStateEstimator by tracker state estimator type\n    @param trackeStateEstimatorType The TrackerStateEstimator name\n\n    The modes available now:\n\n    -   \"BOOSTING\" -- Boosting-based discriminative appearance models. See @cite AMVOT section 4.4\n\n    The modes available soon:\n\n    -   \"SVM\" -- SVM-based discriminative appearance models. See @cite AMVOT section 4.5\n    */\n    static Ptr<TrackerStateEstimator> create(const String& trackeStateEstimatorType);\n\n    /** @brief Get the name of the specific TrackerStateEstimator\n    */\n    String getClassName() const;\n\nprotected:\n    virtual Ptr<TrackerTargetState> estimateImpl(const std::vector<ConfidenceMap>& confidenceMaps) = 0;\n    virtual void updateImpl(std::vector<ConfidenceMap>& confidenceMaps) = 0;\n    String className;\n};\n\n/** @brief Abstract class that represents the model of the target.\n\nIt must be instantiated by specialized tracker\n\nSee @cite AAM Ak\n\nInherits this with your TrackerModel\n*/\nclass CV_EXPORTS TrackerModel\n{\npublic:\n    TrackerModel();\n\n    virtual ~TrackerModel();\n\n    /** @brief Set TrackerEstimator, return true if the tracker state estimator is added, false otherwise\n    @param trackerStateEstimator The TrackerStateEstimator\n    @note You can add only one TrackerStateEstimator\n    */\n    bool setTrackerStateEstimator(Ptr<TrackerStateEstimator> trackerStateEstimator);\n\n    /** @brief Estimate the most likely target location\n\n    @cite AAM ME, Model Estimation table I\n    @param responses Features extracted from TrackerFeatureSet\n    */\n    void modelEstimation(const std::vector<Mat>& responses);\n\n    /** @brief Update the model\n\n    @cite AAM MU, Model Update table I\n    */\n    void modelUpdate();\n\n    /** @brief Run the TrackerStateEstimator, return true if is possible to estimate a new state, false otherwise\n    */\n    bool runStateEstimator();\n\n    /** @brief Set the current TrackerTargetState in the Trajectory\n    @param lastTargetState The current TrackerTargetState\n    */\n    void setLastTargetState(const Ptr<TrackerTargetState>& lastTargetState);\n\n    /** @brief Get the last TrackerTargetState from Trajectory\n    */\n    Ptr<TrackerTargetState> getLastTargetState() const;\n\n    /** @brief Get the list of the ConfidenceMap\n    */\n    const std::vector<ConfidenceMap>& getConfidenceMaps() const;\n\n    /** @brief Get the last ConfidenceMap for the current frame\n    */\n    const ConfidenceMap& getLastConfidenceMap() const;\n\n    /** @brief Get the TrackerStateEstimator\n    */\n    Ptr<TrackerStateEstimator> getTrackerStateEstimator() const;\n\nprivate:\n    void clearCurrentConfidenceMap();\n\nprotected:\n    std::vector<ConfidenceMap> confidenceMaps;\n    Ptr<TrackerStateEstimator> stateEstimator;\n    ConfidenceMap currentConfidenceMap;\n    Trajectory trajectory;\n    int maxCMLength;\n\n    virtual void modelEstimationImpl(const std::vector<Mat>& responses) = 0;\n    virtual void modelUpdateImpl() = 0;\n};\n\n/************************************ Specific TrackerStateEstimator Classes ************************************/\n\n// None\n\n/************************************ Specific TrackerSamplerAlgorithm Classes ************************************/\n\n/** @brief TrackerSampler based on CSC (current state centered), used by MIL algorithm TrackerMIL\n */\nclass CV_EXPORTS TrackerSamplerCSC : public TrackerSamplerAlgorithm\n{\npublic:\n    ~TrackerSamplerCSC();\n\n    enum MODE\n    {\n        MODE_INIT_POS = 1,  //!< mode for init positive samples\n        MODE_INIT_NEG = 2,  //!< mode for init negative samples\n        MODE_TRACK_POS = 3,  //!< mode for update positive samples\n        MODE_TRACK_NEG = 4,  //!< mode for update negative samples\n        MODE_DETECT = 5  //!< mode for detect samples\n    };\n\n    struct CV_EXPORTS Params\n    {\n        Params();\n        float initInRad;  //!< radius for gathering positive instances during init\n        float trackInPosRad;  //!< radius for gathering positive instances during tracking\n        float searchWinSize;  //!< size of search window\n        int initMaxNegNum;  //!< # negative samples to use during init\n        int trackMaxPosNum;  //!< # positive samples to use during training\n        int trackMaxNegNum;  //!< # negative samples to use during training\n    };\n\n    /** @brief Constructor\n    @param parameters TrackerSamplerCSC parameters TrackerSamplerCSC::Params\n    */\n    TrackerSamplerCSC(const TrackerSamplerCSC::Params& parameters = TrackerSamplerCSC::Params());\n\n    /** @brief Set the sampling mode of TrackerSamplerCSC\n    @param samplingMode The sampling mode\n\n    The modes are:\n\n    -   \"MODE_INIT_POS = 1\" -- for the positive sampling in initialization step\n    -   \"MODE_INIT_NEG = 2\" -- for the negative sampling in initialization step\n    -   \"MODE_TRACK_POS = 3\" -- for the positive sampling in update step\n    -   \"MODE_TRACK_NEG = 4\" -- for the negative sampling in update step\n    -   \"MODE_DETECT = 5\" -- for the sampling in detection step\n    */\n    void setMode(int samplingMode);\n\n    bool sampling(const Mat& image, const Rect& boundingBox, std::vector<Mat>& sample) CV_OVERRIDE;\n\nprivate:\n    Params params;\n    int mode;\n    RNG rng;\n\n    std::vector<Mat> sampleImage(const Mat& img, int x, int y, int w, int h, float inrad, float outrad = 0, int maxnum = 1000000);\n};\n\n//! @}\n\n}}}  // namespace cv::detail::tracking\n\n#endif  // OPENCV_VIDEO_DETAIL_TRACKING_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/video/legacy/constants_c.h",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_VIDEO_LEGACY_CONSTANTS_H\n#define OPENCV_VIDEO_LEGACY_CONSTANTS_H\n\nenum\n{\n    CV_LKFLOW_PYR_A_READY = 1,\n    CV_LKFLOW_PYR_B_READY = 2,\n    CV_LKFLOW_INITIAL_GUESSES = 4,\n    CV_LKFLOW_GET_MIN_EIGENVALS = 8\n};\n\n#endif // OPENCV_VIDEO_LEGACY_CONSTANTS_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/video/tracking.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_TRACKING_HPP\n#define OPENCV_TRACKING_HPP\n\n#include \"opencv2/core.hpp\"\n#include \"opencv2/imgproc.hpp\"\n\nnamespace cv\n{\n\n//! @addtogroup video_track\n//! @{\n\nenum { OPTFLOW_USE_INITIAL_FLOW     = 4,\n       OPTFLOW_LK_GET_MIN_EIGENVALS = 8,\n       OPTFLOW_FARNEBACK_GAUSSIAN   = 256\n     };\n\n/** @brief Finds an object center, size, and orientation.\n\n@param probImage Back projection of the object histogram. See calcBackProject.\n@param window Initial search window.\n@param criteria Stop criteria for the underlying meanShift.\nreturns\n(in old interfaces) Number of iterations CAMSHIFT took to converge\nThe function implements the CAMSHIFT object tracking algorithm @cite Bradski98 . First, it finds an\nobject center using meanShift and then adjusts the window size and finds the optimal rotation. The\nfunction returns the rotated rectangle structure that includes the object position, size, and\norientation. The next position of the search window can be obtained with RotatedRect::boundingRect()\n\nSee the OpenCV sample camshiftdemo.c that tracks colored objects.\n\n@note\n-   (Python) A sample explaining the camshift tracking algorithm can be found at\n    opencv_source_code/samples/python/camshift.py\n */\nCV_EXPORTS_W RotatedRect CamShift( InputArray probImage, CV_IN_OUT Rect& window,\n                                   TermCriteria criteria );\n/** @example samples/cpp/camshiftdemo.cpp\nAn example using the mean-shift tracking algorithm\n*/\n\n/** @brief Finds an object on a back projection image.\n\n@param probImage Back projection of the object histogram. See calcBackProject for details.\n@param window Initial search window.\n@param criteria Stop criteria for the iterative search algorithm.\nreturns\n:   Number of iterations CAMSHIFT took to converge.\nThe function implements the iterative object search algorithm. It takes the input back projection of\nan object and the initial position. The mass center in window of the back projection image is\ncomputed and the search window center shifts to the mass center. The procedure is repeated until the\nspecified number of iterations criteria.maxCount is done or until the window center shifts by less\nthan criteria.epsilon. The algorithm is used inside CamShift and, unlike CamShift , the search\nwindow size or orientation do not change during the search. You can simply pass the output of\ncalcBackProject to this function. But better results can be obtained if you pre-filter the back\nprojection and remove the noise. For example, you can do this by retrieving connected components\nwith findContours , throwing away contours with small area ( contourArea ), and rendering the\nremaining contours with drawContours.\n\n */\nCV_EXPORTS_W int meanShift( InputArray probImage, CV_IN_OUT Rect& window, TermCriteria criteria );\n\n/** @brief Constructs the image pyramid which can be passed to calcOpticalFlowPyrLK.\n\n@param img 8-bit input image.\n@param pyramid output pyramid.\n@param winSize window size of optical flow algorithm. Must be not less than winSize argument of\ncalcOpticalFlowPyrLK. It is needed to calculate required padding for pyramid levels.\n@param maxLevel 0-based maximal pyramid level number.\n@param withDerivatives set to precompute gradients for the every pyramid level. If pyramid is\nconstructed without the gradients then calcOpticalFlowPyrLK will calculate them internally.\n@param pyrBorder the border mode for pyramid layers.\n@param derivBorder the border mode for gradients.\n@param tryReuseInputImage put ROI of input image into the pyramid if possible. You can pass false\nto force data copying.\n@return number of levels in constructed pyramid. Can be less than maxLevel.\n */\nCV_EXPORTS_W int buildOpticalFlowPyramid( InputArray img, OutputArrayOfArrays pyramid,\n                                          Size winSize, int maxLevel, bool withDerivatives = true,\n                                          int pyrBorder = BORDER_REFLECT_101,\n                                          int derivBorder = BORDER_CONSTANT,\n                                          bool tryReuseInputImage = true );\n\n/** @example samples/cpp/lkdemo.cpp\nAn example using the Lucas-Kanade optical flow algorithm\n*/\n\n/** @brief Calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with\npyramids.\n\n@param prevImg first 8-bit input image or pyramid constructed by buildOpticalFlowPyramid.\n@param nextImg second input image or pyramid of the same size and the same type as prevImg.\n@param prevPts vector of 2D points for which the flow needs to be found; point coordinates must be\nsingle-precision floating-point numbers.\n@param nextPts output vector of 2D points (with single-precision floating-point coordinates)\ncontaining the calculated new positions of input features in the second image; when\nOPTFLOW_USE_INITIAL_FLOW flag is passed, the vector must have the same size as in the input.\n@param status output status vector (of unsigned chars); each element of the vector is set to 1 if\nthe flow for the corresponding features has been found, otherwise, it is set to 0.\n@param err output vector of errors; each element of the vector is set to an error for the\ncorresponding feature, type of the error measure can be set in flags parameter; if the flow wasn't\nfound then the error is not defined (use the status parameter to find such cases).\n@param winSize size of the search window at each pyramid level.\n@param maxLevel 0-based maximal pyramid level number; if set to 0, pyramids are not used (single\nlevel), if set to 1, two levels are used, and so on; if pyramids are passed to input then\nalgorithm will use as many levels as pyramids have but no more than maxLevel.\n@param criteria parameter, specifying the termination criteria of the iterative search algorithm\n(after the specified maximum number of iterations criteria.maxCount or when the search window\nmoves by less than criteria.epsilon.\n@param flags operation flags:\n -   **OPTFLOW_USE_INITIAL_FLOW** uses initial estimations, stored in nextPts; if the flag is\n     not set, then prevPts is copied to nextPts and is considered the initial estimate.\n -   **OPTFLOW_LK_GET_MIN_EIGENVALS** use minimum eigen values as an error measure (see\n     minEigThreshold description); if the flag is not set, then L1 distance between patches\n     around the original and a moved point, divided by number of pixels in a window, is used as a\n     error measure.\n@param minEigThreshold the algorithm calculates the minimum eigen value of a 2x2 normal matrix of\noptical flow equations (this matrix is called a spatial gradient matrix in @cite Bouguet00), divided\nby number of pixels in a window; if this value is less than minEigThreshold, then a corresponding\nfeature is filtered out and its flow is not processed, so it allows to remove bad points and get a\nperformance boost.\n\nThe function implements a sparse iterative version of the Lucas-Kanade optical flow in pyramids. See\n@cite Bouguet00 . The function is parallelized with the TBB library.\n\n@note\n\n-   An example using the Lucas-Kanade optical flow algorithm can be found at\n    opencv_source_code/samples/cpp/lkdemo.cpp\n-   (Python) An example using the Lucas-Kanade optical flow algorithm can be found at\n    opencv_source_code/samples/python/lk_track.py\n-   (Python) An example using the Lucas-Kanade tracker for homography matching can be found at\n    opencv_source_code/samples/python/lk_homography.py\n */\nCV_EXPORTS_W void calcOpticalFlowPyrLK( InputArray prevImg, InputArray nextImg,\n                                        InputArray prevPts, InputOutputArray nextPts,\n                                        OutputArray status, OutputArray err,\n                                        Size winSize = Size(21,21), int maxLevel = 3,\n                                        TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01),\n                                        int flags = 0, double minEigThreshold = 1e-4 );\n\n/** @brief Computes a dense optical flow using the Gunnar Farneback's algorithm.\n\n@param prev first 8-bit single-channel input image.\n@param next second input image of the same size and the same type as prev.\n@param flow computed flow image that has the same size as prev and type CV_32FC2.\n@param pyr_scale parameter, specifying the image scale (\\<1) to build pyramids for each image;\npyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous\none.\n@param levels number of pyramid layers including the initial image; levels=1 means that no extra\nlayers are created and only the original images are used.\n@param winsize averaging window size; larger values increase the algorithm robustness to image\nnoise and give more chances for fast motion detection, but yield more blurred motion field.\n@param iterations number of iterations the algorithm does at each pyramid level.\n@param poly_n size of the pixel neighborhood used to find polynomial expansion in each pixel;\nlarger values mean that the image will be approximated with smoother surfaces, yielding more\nrobust algorithm and more blurred motion field, typically poly_n =5 or 7.\n@param poly_sigma standard deviation of the Gaussian that is used to smooth derivatives used as a\nbasis for the polynomial expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a\ngood value would be poly_sigma=1.5.\n@param flags operation flags that can be a combination of the following:\n -   **OPTFLOW_USE_INITIAL_FLOW** uses the input flow as an initial flow approximation.\n -   **OPTFLOW_FARNEBACK_GAUSSIAN** uses the Gaussian \\f$\\texttt{winsize}\\times\\texttt{winsize}\\f$\n     filter instead of a box filter of the same size for optical flow estimation; usually, this\n     option gives z more accurate flow than with a box filter, at the cost of lower speed;\n     normally, winsize for a Gaussian window should be set to a larger value to achieve the same\n     level of robustness.\n\nThe function finds an optical flow for each prev pixel using the @cite Farneback2003 algorithm so that\n\n\\f[\\texttt{prev} (y,x)  \\sim \\texttt{next} ( y + \\texttt{flow} (y,x)[1],  x + \\texttt{flow} (y,x)[0])\\f]\n\n@note\n\n-   An example using the optical flow algorithm described by Gunnar Farneback can be found at\n    opencv_source_code/samples/cpp/fback.cpp\n-   (Python) An example using the optical flow algorithm described by Gunnar Farneback can be\n    found at opencv_source_code/samples/python/opt_flow.py\n */\nCV_EXPORTS_W void calcOpticalFlowFarneback( InputArray prev, InputArray next, InputOutputArray flow,\n                                            double pyr_scale, int levels, int winsize,\n                                            int iterations, int poly_n, double poly_sigma,\n                                            int flags );\n\n/** @brief Computes an optimal affine transformation between two 2D point sets.\n\n@param src First input 2D point set stored in std::vector or Mat, or an image stored in Mat.\n@param dst Second input 2D point set of the same size and the same type as A, or another image.\n@param fullAffine If true, the function finds an optimal affine transformation with no additional\nrestrictions (6 degrees of freedom). Otherwise, the class of transformations to choose from is\nlimited to combinations of translation, rotation, and uniform scaling (4 degrees of freedom).\n\nThe function finds an optimal affine transform *[A|b]* (a 2 x 3 floating-point matrix) that\napproximates best the affine transformation between:\n\n*   Two point sets\n*   Two raster images. In this case, the function first finds some features in the src image and\n    finds the corresponding features in dst image. After that, the problem is reduced to the first\n    case.\nIn case of point sets, the problem is formulated as follows: you need to find a 2x2 matrix *A* and\n2x1 vector *b* so that:\n\n\\f[[A^*|b^*] = arg  \\min _{[A|b]}  \\sum _i  \\| \\texttt{dst}[i] - A { \\texttt{src}[i]}^T - b  \\| ^2\\f]\nwhere src[i] and dst[i] are the i-th points in src and dst, respectively\n\\f$[A|b]\\f$ can be either arbitrary (when fullAffine=true ) or have a form of\n\\f[\\begin{bmatrix} a_{11} & a_{12} & b_1  \\\\ -a_{12} & a_{11} & b_2  \\end{bmatrix}\\f]\nwhen fullAffine=false.\n\n@deprecated Use cv::estimateAffine2D, cv::estimateAffinePartial2D instead. If you are using this function\nwith images, extract points using cv::calcOpticalFlowPyrLK and then use the estimation functions.\n\n@sa\nestimateAffine2D, estimateAffinePartial2D, getAffineTransform, getPerspectiveTransform, findHomography\n */\nCV_DEPRECATED CV_EXPORTS Mat estimateRigidTransform( InputArray src, InputArray dst, bool fullAffine );\n\nenum\n{\n    MOTION_TRANSLATION = 0,\n    MOTION_EUCLIDEAN   = 1,\n    MOTION_AFFINE      = 2,\n    MOTION_HOMOGRAPHY  = 3\n};\n\n/** @brief Computes the Enhanced Correlation Coefficient value between two images @cite EP08 .\n\n@param templateImage single-channel template image; CV_8U or CV_32F array.\n@param inputImage single-channel input image to be warped to provide an image similar to\n templateImage, same type as templateImage.\n@param inputMask An optional mask to indicate valid values of inputImage.\n\n@sa\nfindTransformECC\n */\n\nCV_EXPORTS_W double computeECC(InputArray templateImage, InputArray inputImage, InputArray inputMask = noArray());\n\n/** @example samples/cpp/image_alignment.cpp\nAn example using the image alignment ECC algorithm\n*/\n\n/** @brief Finds the geometric transform (warp) between two images in terms of the ECC criterion @cite EP08 .\n\n@param templateImage single-channel template image; CV_8U or CV_32F array.\n@param inputImage single-channel input image which should be warped with the final warpMatrix in\norder to provide an image similar to templateImage, same type as templateImage.\n@param warpMatrix floating-point \\f$2\\times 3\\f$ or \\f$3\\times 3\\f$ mapping matrix (warp).\n@param motionType parameter, specifying the type of motion:\n -   **MOTION_TRANSLATION** sets a translational motion model; warpMatrix is \\f$2\\times 3\\f$ with\n     the first \\f$2\\times 2\\f$ part being the unity matrix and the rest two parameters being\n     estimated.\n -   **MOTION_EUCLIDEAN** sets a Euclidean (rigid) transformation as motion model; three\n     parameters are estimated; warpMatrix is \\f$2\\times 3\\f$.\n -   **MOTION_AFFINE** sets an affine motion model (DEFAULT); six parameters are estimated;\n     warpMatrix is \\f$2\\times 3\\f$.\n -   **MOTION_HOMOGRAPHY** sets a homography as a motion model; eight parameters are\n     estimated;\\`warpMatrix\\` is \\f$3\\times 3\\f$.\n@param criteria parameter, specifying the termination criteria of the ECC algorithm;\ncriteria.epsilon defines the threshold of the increment in the correlation coefficient between two\niterations (a negative criteria.epsilon makes criteria.maxcount the only termination criterion).\nDefault values are shown in the declaration above.\n@param inputMask An optional mask to indicate valid values of inputImage.\n@param gaussFiltSize An optional value indicating size of gaussian blur filter; (DEFAULT: 5)\n\nThe function estimates the optimum transformation (warpMatrix) with respect to ECC criterion\n(@cite EP08), that is\n\n\\f[\\texttt{warpMatrix} = \\arg\\max_{W} \\texttt{ECC}(\\texttt{templateImage}(x,y),\\texttt{inputImage}(x',y'))\\f]\n\nwhere\n\n\\f[\\begin{bmatrix} x' \\\\ y' \\end{bmatrix} = W \\cdot \\begin{bmatrix} x \\\\ y \\\\ 1 \\end{bmatrix}\\f]\n\n(the equation holds with homogeneous coordinates for homography). It returns the final enhanced\ncorrelation coefficient, that is the correlation coefficient between the template image and the\nfinal warped input image. When a \\f$3\\times 3\\f$ matrix is given with motionType =0, 1 or 2, the third\nrow is ignored.\n\nUnlike findHomography and estimateRigidTransform, the function findTransformECC implements an\narea-based alignment that builds on intensity similarities. In essence, the function updates the\ninitial transformation that roughly aligns the images. If this information is missing, the identity\nwarp (unity matrix) is used as an initialization. Note that if images undergo strong\ndisplacements/rotations, an initial transformation that roughly aligns the images is necessary\n(e.g., a simple euclidean/similarity transform that allows for the images showing the same image\ncontent approximately). Use inverse warping in the second image to take an image close to the first\none, i.e. use the flag WARP_INVERSE_MAP with warpAffine or warpPerspective. See also the OpenCV\nsample image_alignment.cpp that demonstrates the use of the function. Note that the function throws\nan exception if algorithm does not converges.\n\n@sa\ncomputeECC, estimateAffine2D, estimateAffinePartial2D, findHomography\n */\nCV_EXPORTS_W double findTransformECC( InputArray templateImage, InputArray inputImage,\n                                      InputOutputArray warpMatrix, int motionType,\n                                      TermCriteria criteria,\n                                      InputArray inputMask, int gaussFiltSize);\n\n/** @overload */\nCV_EXPORTS_W\ndouble findTransformECC(InputArray templateImage, InputArray inputImage,\n    InputOutputArray warpMatrix, int motionType = MOTION_AFFINE,\n    TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001),\n    InputArray inputMask = noArray());\n\n/** @example samples/cpp/kalman.cpp\nAn example using the standard Kalman filter\n*/\n\n/** @brief Kalman filter class.\n\nThe class implements a standard Kalman filter <http://en.wikipedia.org/wiki/Kalman_filter>,\n@cite Welch95 . However, you can modify transitionMatrix, controlMatrix, and measurementMatrix to get\nan extended Kalman filter functionality.\n@note In C API when CvKalman\\* kalmanFilter structure is not needed anymore, it should be released\nwith cvReleaseKalman(&kalmanFilter)\n */\nclass CV_EXPORTS_W KalmanFilter\n{\npublic:\n    CV_WRAP KalmanFilter();\n    /** @overload\n    @param dynamParams Dimensionality of the state.\n    @param measureParams Dimensionality of the measurement.\n    @param controlParams Dimensionality of the control vector.\n    @param type Type of the created matrices that should be CV_32F or CV_64F.\n    */\n    CV_WRAP KalmanFilter( int dynamParams, int measureParams, int controlParams = 0, int type = CV_32F );\n\n    /** @brief Re-initializes Kalman filter. The previous content is destroyed.\n\n    @param dynamParams Dimensionality of the state.\n    @param measureParams Dimensionality of the measurement.\n    @param controlParams Dimensionality of the control vector.\n    @param type Type of the created matrices that should be CV_32F or CV_64F.\n     */\n    void init( int dynamParams, int measureParams, int controlParams = 0, int type = CV_32F );\n\n    /** @brief Computes a predicted state.\n\n    @param control The optional input control\n     */\n    CV_WRAP const Mat& predict( const Mat& control = Mat() );\n\n    /** @brief Updates the predicted state from the measurement.\n\n    @param measurement The measured system parameters\n     */\n    CV_WRAP const Mat& correct( const Mat& measurement );\n\n    CV_PROP_RW Mat statePre;           //!< predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k)\n    CV_PROP_RW Mat statePost;          //!< corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))\n    CV_PROP_RW Mat transitionMatrix;   //!< state transition matrix (A)\n    CV_PROP_RW Mat controlMatrix;      //!< control matrix (B) (not used if there is no control)\n    CV_PROP_RW Mat measurementMatrix;  //!< measurement matrix (H)\n    CV_PROP_RW Mat processNoiseCov;    //!< process noise covariance matrix (Q)\n    CV_PROP_RW Mat measurementNoiseCov;//!< measurement noise covariance matrix (R)\n    CV_PROP_RW Mat errorCovPre;        //!< priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/\n    CV_PROP_RW Mat gain;               //!< Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)\n    CV_PROP_RW Mat errorCovPost;       //!< posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)\n\n    // temporary matrices\n    Mat temp1;\n    Mat temp2;\n    Mat temp3;\n    Mat temp4;\n    Mat temp5;\n};\n\n\n/** @brief Read a .flo file\n\n @param path Path to the file to be loaded\n\n The function readOpticalFlow loads a flow field from a file and returns it as a single matrix.\n Resulting Mat has a type CV_32FC2 - floating-point, 2-channel. First channel corresponds to the\n flow in the horizontal direction (u), second - vertical (v).\n */\nCV_EXPORTS_W Mat readOpticalFlow( const String& path );\n/** @brief Write a .flo to disk\n\n @param path Path to the file to be written\n @param flow Flow field to be stored\n\n The function stores a flow field in a file, returns true on success, false otherwise.\n The flow field must be a 2-channel, floating-point matrix (CV_32FC2). First channel corresponds\n to the flow in the horizontal direction (u), second - vertical (v).\n */\nCV_EXPORTS_W bool writeOpticalFlow( const String& path, InputArray flow );\n\n/**\n   Base class for dense optical flow algorithms\n*/\nclass CV_EXPORTS_W DenseOpticalFlow : public Algorithm\n{\npublic:\n    /** @brief Calculates an optical flow.\n\n    @param I0 first 8-bit single-channel input image.\n    @param I1 second input image of the same size and the same type as prev.\n    @param flow computed flow image that has the same size as prev and type CV_32FC2.\n     */\n    CV_WRAP virtual void calc( InputArray I0, InputArray I1, InputOutputArray flow ) = 0;\n    /** @brief Releases all inner buffers.\n    */\n    CV_WRAP virtual void collectGarbage() = 0;\n};\n\n/** @brief Base interface for sparse optical flow algorithms.\n */\nclass CV_EXPORTS_W SparseOpticalFlow : public Algorithm\n{\npublic:\n    /** @brief Calculates a sparse optical flow.\n\n    @param prevImg First input image.\n    @param nextImg Second input image of the same size and the same type as prevImg.\n    @param prevPts Vector of 2D points for which the flow needs to be found.\n    @param nextPts Output vector of 2D points containing the calculated new positions of input features in the second image.\n    @param status Output status vector. Each element of the vector is set to 1 if the\n                  flow for the corresponding features has been found. Otherwise, it is set to 0.\n    @param err Optional output vector that contains error response for each point (inverse confidence).\n     */\n    CV_WRAP virtual void calc(InputArray prevImg, InputArray nextImg,\n                      InputArray prevPts, InputOutputArray nextPts,\n                      OutputArray status,\n                      OutputArray err = cv::noArray()) = 0;\n};\n\n\n/** @brief Class computing a dense optical flow using the Gunnar Farneback's algorithm.\n */\nclass CV_EXPORTS_W FarnebackOpticalFlow : public DenseOpticalFlow\n{\npublic:\n    CV_WRAP virtual int getNumLevels() const = 0;\n    CV_WRAP virtual void setNumLevels(int numLevels) = 0;\n\n    CV_WRAP virtual double getPyrScale() const = 0;\n    CV_WRAP virtual void setPyrScale(double pyrScale) = 0;\n\n    CV_WRAP virtual bool getFastPyramids() const = 0;\n    CV_WRAP virtual void setFastPyramids(bool fastPyramids) = 0;\n\n    CV_WRAP virtual int getWinSize() const = 0;\n    CV_WRAP virtual void setWinSize(int winSize) = 0;\n\n    CV_WRAP virtual int getNumIters() const = 0;\n    CV_WRAP virtual void setNumIters(int numIters) = 0;\n\n    CV_WRAP virtual int getPolyN() const = 0;\n    CV_WRAP virtual void setPolyN(int polyN) = 0;\n\n    CV_WRAP virtual double getPolySigma() const = 0;\n    CV_WRAP virtual void setPolySigma(double polySigma) = 0;\n\n    CV_WRAP virtual int getFlags() const = 0;\n    CV_WRAP virtual void setFlags(int flags) = 0;\n\n    CV_WRAP static Ptr<FarnebackOpticalFlow> create(\n            int numLevels = 5,\n            double pyrScale = 0.5,\n            bool fastPyramids = false,\n            int winSize = 13,\n            int numIters = 10,\n            int polyN = 5,\n            double polySigma = 1.1,\n            int flags = 0);\n};\n\n/** @brief Variational optical flow refinement\n\nThis class implements variational refinement of the input flow field, i.e.\nit uses input flow to initialize the minimization of the following functional:\n\\f$E(U) = \\int_{\\Omega} \\delta \\Psi(E_I) + \\gamma \\Psi(E_G) + \\alpha \\Psi(E_S) \\f$,\nwhere \\f$E_I,E_G,E_S\\f$ are color constancy, gradient constancy and smoothness terms\nrespectively. \\f$\\Psi(s^2)=\\sqrt{s^2+\\epsilon^2}\\f$ is a robust penalizer to limit the\ninfluence of outliers. A complete formulation and a description of the minimization\nprocedure can be found in @cite Brox2004\n*/\nclass CV_EXPORTS_W VariationalRefinement : public DenseOpticalFlow\n{\npublic:\n    /** @brief @ref calc function overload to handle separate horizontal (u) and vertical (v) flow components\n    (to avoid extra splits/merges) */\n    CV_WRAP virtual void calcUV(InputArray I0, InputArray I1, InputOutputArray flow_u, InputOutputArray flow_v) = 0;\n\n    /** @brief Number of outer (fixed-point) iterations in the minimization procedure.\n    @see setFixedPointIterations */\n    CV_WRAP virtual int getFixedPointIterations() const = 0;\n    /** @copybrief getFixedPointIterations @see getFixedPointIterations */\n    CV_WRAP virtual void setFixedPointIterations(int val) = 0;\n\n    /** @brief Number of inner successive over-relaxation (SOR) iterations\n        in the minimization procedure to solve the respective linear system.\n    @see setSorIterations */\n    CV_WRAP virtual int getSorIterations() const = 0;\n    /** @copybrief getSorIterations @see getSorIterations */\n    CV_WRAP virtual void setSorIterations(int val) = 0;\n\n    /** @brief Relaxation factor in SOR\n    @see setOmega */\n    CV_WRAP virtual float getOmega() const = 0;\n    /** @copybrief getOmega @see getOmega */\n    CV_WRAP virtual void setOmega(float val) = 0;\n\n    /** @brief Weight of the smoothness term\n    @see setAlpha */\n    CV_WRAP virtual float getAlpha() const = 0;\n    /** @copybrief getAlpha @see getAlpha */\n    CV_WRAP virtual void setAlpha(float val) = 0;\n\n    /** @brief Weight of the color constancy term\n    @see setDelta */\n    CV_WRAP virtual float getDelta() const = 0;\n    /** @copybrief getDelta @see getDelta */\n    CV_WRAP virtual void setDelta(float val) = 0;\n\n    /** @brief Weight of the gradient constancy term\n    @see setGamma */\n    CV_WRAP virtual float getGamma() const = 0;\n    /** @copybrief getGamma @see getGamma */\n    CV_WRAP virtual void setGamma(float val) = 0;\n\n    /** @brief Creates an instance of VariationalRefinement\n    */\n    CV_WRAP static Ptr<VariationalRefinement> create();\n};\n\n/** @brief DIS optical flow algorithm.\n\nThis class implements the Dense Inverse Search (DIS) optical flow algorithm. More\ndetails about the algorithm can be found at @cite Kroeger2016 . Includes three presets with preselected\nparameters to provide reasonable trade-off between speed and quality. However, even the slowest preset is\nstill relatively fast, use DeepFlow if you need better quality and don't care about speed.\n\nThis implementation includes several additional features compared to the algorithm described in the paper,\nincluding spatial propagation of flow vectors (@ref getUseSpatialPropagation), as well as an option to\nutilize an initial flow approximation passed to @ref calc (which is, essentially, temporal propagation,\nif the previous frame's flow field is passed).\n*/\nclass CV_EXPORTS_W DISOpticalFlow : public DenseOpticalFlow\n{\npublic:\n    enum\n    {\n        PRESET_ULTRAFAST = 0,\n        PRESET_FAST = 1,\n        PRESET_MEDIUM = 2\n    };\n\n    /** @brief Finest level of the Gaussian pyramid on which the flow is computed (zero level\n        corresponds to the original image resolution). The final flow is obtained by bilinear upscaling.\n        @see setFinestScale */\n    CV_WRAP virtual int getFinestScale() const = 0;\n    /** @copybrief getFinestScale @see getFinestScale */\n    CV_WRAP virtual void setFinestScale(int val) = 0;\n\n    /** @brief Size of an image patch for matching (in pixels). Normally, default 8x8 patches work well\n        enough in most cases.\n        @see setPatchSize */\n    CV_WRAP virtual int getPatchSize() const = 0;\n    /** @copybrief getPatchSize @see getPatchSize */\n    CV_WRAP virtual void setPatchSize(int val) = 0;\n\n    /** @brief Stride between neighbor patches. Must be less than patch size. Lower values correspond\n        to higher flow quality.\n        @see setPatchStride */\n    CV_WRAP virtual int getPatchStride() const = 0;\n    /** @copybrief getPatchStride @see getPatchStride */\n    CV_WRAP virtual void setPatchStride(int val) = 0;\n\n    /** @brief Maximum number of gradient descent iterations in the patch inverse search stage. Higher values\n        may improve quality in some cases.\n        @see setGradientDescentIterations */\n    CV_WRAP virtual int getGradientDescentIterations() const = 0;\n    /** @copybrief getGradientDescentIterations @see getGradientDescentIterations */\n    CV_WRAP virtual void setGradientDescentIterations(int val) = 0;\n\n    /** @brief Number of fixed point iterations of variational refinement per scale. Set to zero to\n        disable variational refinement completely. Higher values will typically result in more smooth and\n        high-quality flow.\n    @see setGradientDescentIterations */\n    CV_WRAP virtual int getVariationalRefinementIterations() const = 0;\n    /** @copybrief getGradientDescentIterations @see getGradientDescentIterations */\n    CV_WRAP virtual void setVariationalRefinementIterations(int val) = 0;\n\n    /** @brief Weight of the smoothness term\n    @see setVariationalRefinementAlpha */\n    CV_WRAP virtual float getVariationalRefinementAlpha() const = 0;\n    /** @copybrief getVariationalRefinementAlpha @see getVariationalRefinementAlpha */\n    CV_WRAP virtual void setVariationalRefinementAlpha(float val) = 0;\n\n    /** @brief Weight of the color constancy term\n    @see setVariationalRefinementDelta */\n    CV_WRAP virtual float getVariationalRefinementDelta() const = 0;\n    /** @copybrief getVariationalRefinementDelta @see getVariationalRefinementDelta */\n    CV_WRAP virtual void setVariationalRefinementDelta(float val) = 0;\n\n    /** @brief Weight of the gradient constancy term\n    @see setVariationalRefinementGamma */\n    CV_WRAP virtual float getVariationalRefinementGamma() const = 0;\n    /** @copybrief getVariationalRefinementGamma @see getVariationalRefinementGamma */\n    CV_WRAP virtual void setVariationalRefinementGamma(float val) = 0;\n\n\n    /** @brief Whether to use mean-normalization of patches when computing patch distance. It is turned on\n        by default as it typically provides a noticeable quality boost because of increased robustness to\n        illumination variations. Turn it off if you are certain that your sequence doesn't contain any changes\n        in illumination.\n    @see setUseMeanNormalization */\n    CV_WRAP virtual bool getUseMeanNormalization() const = 0;\n    /** @copybrief getUseMeanNormalization @see getUseMeanNormalization */\n    CV_WRAP virtual void setUseMeanNormalization(bool val) = 0;\n\n    /** @brief Whether to use spatial propagation of good optical flow vectors. This option is turned on by\n        default, as it tends to work better on average and can sometimes help recover from major errors\n        introduced by the coarse-to-fine scheme employed by the DIS optical flow algorithm. Turning this\n        option off can make the output flow field a bit smoother, however.\n    @see setUseSpatialPropagation */\n    CV_WRAP virtual bool getUseSpatialPropagation() const = 0;\n    /** @copybrief getUseSpatialPropagation @see getUseSpatialPropagation */\n    CV_WRAP virtual void setUseSpatialPropagation(bool val) = 0;\n\n    /** @brief Creates an instance of DISOpticalFlow\n\n    @param preset one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM\n    */\n    CV_WRAP static Ptr<DISOpticalFlow> create(int preset = DISOpticalFlow::PRESET_FAST);\n};\n\n/** @brief Class used for calculating a sparse optical flow.\n\nThe class can calculate an optical flow for a sparse feature set using the\niterative Lucas-Kanade method with pyramids.\n\n@sa calcOpticalFlowPyrLK\n\n*/\nclass CV_EXPORTS_W SparsePyrLKOpticalFlow : public SparseOpticalFlow\n{\npublic:\n    CV_WRAP virtual Size getWinSize() const = 0;\n    CV_WRAP virtual void setWinSize(Size winSize) = 0;\n\n    CV_WRAP virtual int getMaxLevel() const = 0;\n    CV_WRAP virtual void setMaxLevel(int maxLevel) = 0;\n\n    CV_WRAP virtual TermCriteria getTermCriteria() const = 0;\n    CV_WRAP virtual void setTermCriteria(TermCriteria& crit) = 0;\n\n    CV_WRAP virtual int getFlags() const = 0;\n    CV_WRAP virtual void setFlags(int flags) = 0;\n\n    CV_WRAP virtual double getMinEigThreshold() const = 0;\n    CV_WRAP virtual void setMinEigThreshold(double minEigThreshold) = 0;\n\n    CV_WRAP static Ptr<SparsePyrLKOpticalFlow> create(\n            Size winSize = Size(21, 21),\n            int maxLevel = 3, TermCriteria crit =\n            TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01),\n            int flags = 0,\n            double minEigThreshold = 1e-4);\n};\n\n\n\n\n/** @brief Base abstract class for the long-term tracker\n */\nclass CV_EXPORTS_W Tracker\n{\nprotected:\n    Tracker();\npublic:\n    virtual ~Tracker();\n\n    /** @brief Initialize the tracker with a known bounding box that surrounded the target\n    @param image The initial frame\n    @param boundingBox The initial bounding box\n    */\n    CV_WRAP virtual\n    void init(InputArray image, const Rect& boundingBox) = 0;\n\n    /** @brief Update the tracker, find the new most likely bounding box for the target\n    @param image The current frame\n    @param boundingBox The bounding box that represent the new target location, if true was returned, not\n    modified otherwise\n\n    @return True means that target was located and false means that tracker cannot locate target in\n    current frame. Note, that latter *does not* imply that tracker has failed, maybe target is indeed\n    missing from the frame (say, out of sight)\n    */\n    CV_WRAP virtual\n    bool update(InputArray image, CV_OUT Rect& boundingBox) = 0;\n};\n\n\n\n/** @brief The MIL algorithm trains a classifier in an online manner to separate the object from the\nbackground.\n\nMultiple Instance Learning avoids the drift problem for a robust tracking. The implementation is\nbased on @cite MIL .\n\nOriginal code can be found here <http://vision.ucsd.edu/~bbabenko/project_miltrack.shtml>\n */\nclass CV_EXPORTS_W TrackerMIL : public Tracker\n{\nprotected:\n    TrackerMIL();  // use ::create()\npublic:\n    virtual ~TrackerMIL() CV_OVERRIDE;\n\n    struct CV_EXPORTS_W_SIMPLE Params\n    {\n        CV_WRAP Params();\n        //parameters for sampler\n        CV_PROP_RW float samplerInitInRadius;  //!< radius for gathering positive instances during init\n        CV_PROP_RW int samplerInitMaxNegNum;  //!< # negative samples to use during init\n        CV_PROP_RW float samplerSearchWinSize;  //!< size of search window\n        CV_PROP_RW float samplerTrackInRadius;  //!< radius for gathering positive instances during tracking\n        CV_PROP_RW int samplerTrackMaxPosNum;  //!< # positive samples to use during tracking\n        CV_PROP_RW int samplerTrackMaxNegNum;  //!< # negative samples to use during tracking\n        CV_PROP_RW int featureSetNumFeatures;  //!< # features\n    };\n\n    /** @brief Create MIL tracker instance\n     *  @param parameters MIL parameters TrackerMIL::Params\n     */\n    static CV_WRAP\n    Ptr<TrackerMIL> create(const TrackerMIL::Params &parameters = TrackerMIL::Params());\n\n    //void init(InputArray image, const Rect& boundingBox) CV_OVERRIDE;\n    //bool update(InputArray image, CV_OUT Rect& boundingBox) CV_OVERRIDE;\n};\n\n\n\n/** @brief the GOTURN (Generic Object Tracking Using Regression Networks) tracker\n *\n *  GOTURN (@cite GOTURN) is kind of trackers based on Convolutional Neural Networks (CNN). While taking all advantages of CNN trackers,\n *  GOTURN is much faster due to offline training without online fine-tuning nature.\n *  GOTURN tracker addresses the problem of single target tracking: given a bounding box label of an object in the first frame of the video,\n *  we track that object through the rest of the video. NOTE: Current method of GOTURN does not handle occlusions; however, it is fairly\n *  robust to viewpoint changes, lighting changes, and deformations.\n *  Inputs of GOTURN are two RGB patches representing Target and Search patches resized to 227x227.\n *  Outputs of GOTURN are predicted bounding box coordinates, relative to Search patch coordinate system, in format X1,Y1,X2,Y2.\n *  Original paper is here: <http://davheld.github.io/GOTURN/GOTURN.pdf>\n *  As long as original authors implementation: <https://github.com/davheld/GOTURN#train-the-tracker>\n *  Implementation of training algorithm is placed in separately here due to 3d-party dependencies:\n *  <https://github.com/Auron-X/GOTURN_Training_Toolkit>\n *  GOTURN architecture goturn.prototxt and trained model goturn.caffemodel are accessible on opencv_extra GitHub repository.\n */\nclass CV_EXPORTS_W TrackerGOTURN : public Tracker\n{\nprotected:\n    TrackerGOTURN();  // use ::create()\npublic:\n    virtual ~TrackerGOTURN() CV_OVERRIDE;\n\n    struct CV_EXPORTS_W_SIMPLE Params\n    {\n        CV_WRAP Params();\n        CV_PROP_RW std::string modelTxt;\n        CV_PROP_RW std::string modelBin;\n    };\n\n    /** @brief Constructor\n    @param parameters GOTURN parameters TrackerGOTURN::Params\n    */\n    static CV_WRAP\n    Ptr<TrackerGOTURN> create(const TrackerGOTURN::Params& parameters = TrackerGOTURN::Params());\n\n    //void init(InputArray image, const Rect& boundingBox) CV_OVERRIDE;\n    //bool update(InputArray image, CV_OUT Rect& boundingBox) CV_OVERRIDE;\n};\n\nclass CV_EXPORTS_W TrackerDaSiamRPN : public Tracker\n{\nprotected:\n    TrackerDaSiamRPN();  // use ::create()\npublic:\n    virtual ~TrackerDaSiamRPN() CV_OVERRIDE;\n\n    struct CV_EXPORTS_W_SIMPLE Params\n    {\n        CV_WRAP Params();\n        CV_PROP_RW std::string model;\n        CV_PROP_RW std::string kernel_cls1;\n        CV_PROP_RW std::string kernel_r1;\n        CV_PROP_RW int backend;\n        CV_PROP_RW int target;\n    };\n\n    /** @brief Constructor\n    @param parameters DaSiamRPN parameters TrackerDaSiamRPN::Params\n    */\n    static CV_WRAP\n    Ptr<TrackerDaSiamRPN> create(const TrackerDaSiamRPN::Params& parameters = TrackerDaSiamRPN::Params());\n\n    /** @brief Return tracking score\n    */\n    CV_WRAP virtual float getTrackingScore() = 0;\n\n    //void init(InputArray image, const Rect& boundingBox) CV_OVERRIDE;\n    //bool update(InputArray image, CV_OUT Rect& boundingBox) CV_OVERRIDE;\n};\n\n\n//! @} video_track\n\n} // cv\n\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/video/video.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/video.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/video.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_VIDEO_HPP\n#define OPENCV_VIDEO_HPP\n\n/**\n  @defgroup video Video Analysis\n  @{\n    @defgroup video_motion Motion Analysis\n    @defgroup video_track Object Tracking\n    @defgroup video_c C API\n  @}\n*/\n\n#include \"opencv2/video/tracking.hpp\"\n#include \"opencv2/video/background_segm.hpp\"\n\n#endif //OPENCV_VIDEO_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/videoio/cap_ios.h",
    "content": "/*  For iOS video I/O\n *  by Eduard Feicho on 29/07/12\n *  Copyright 2012. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n *    this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the documentation\n *    and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n *    derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\n * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n */\n\n#import <UIKit/UIKit.h>\n#import <Accelerate/Accelerate.h>\n#import <AVFoundation/AVFoundation.h>\n#import <ImageIO/ImageIO.h>\n#include \"opencv2/core.hpp\"\n\n//! @addtogroup videoio_ios\n//! @{\n\n/////////////////////////////////////// CvAbstractCamera /////////////////////////////////////\n\n@class CvAbstractCamera;\n\nCV_EXPORTS @interface CvAbstractCamera : NSObject\n{\n    UIDeviceOrientation currentDeviceOrientation;\n\n    BOOL cameraAvailable;\n}\n\n@property (nonatomic, strong) AVCaptureSession* captureSession;\n@property (nonatomic, strong) AVCaptureConnection* videoCaptureConnection;\n\n@property (nonatomic, readonly) BOOL running;\n@property (nonatomic, readonly) BOOL captureSessionLoaded;\n\n@property (nonatomic, assign) int defaultFPS;\n@property (nonatomic, readonly) AVCaptureVideoPreviewLayer *captureVideoPreviewLayer;\n@property (nonatomic, assign) AVCaptureDevicePosition defaultAVCaptureDevicePosition;\n@property (nonatomic, assign) AVCaptureVideoOrientation defaultAVCaptureVideoOrientation;\n@property (nonatomic, assign) BOOL useAVCaptureVideoPreviewLayer;\n@property (nonatomic, strong) NSString *const defaultAVCaptureSessionPreset;\n\n@property (nonatomic, assign) int imageWidth;\n@property (nonatomic, assign) int imageHeight;\n\n@property (nonatomic, strong) UIView* parentView;\n\n- CV_UNUSED(start);\n- CV_UNUSED(stop);\n- CV_UNUSED(switchCameras);\n\n- (id)initWithParentView:(UIView*)parent;\n\n- CV_UNUSED(createCaptureOutput);\n- CV_UNUSED(createVideoPreviewLayer);\n- CV_UNUSED(updateOrientation);\n\n- CV_UNUSED(lockFocus);\n- CV_UNUSED(unlockFocus);\n- CV_UNUSED(lockExposure);\n- CV_UNUSED(unlockExposure);\n- CV_UNUSED(lockBalance);\n- CV_UNUSED(unlockBalance);\n\n@end\n\n///////////////////////////////// CvVideoCamera ///////////////////////////////////////////\n\n@class CvVideoCamera;\n\nCV_EXPORTS @protocol CvVideoCameraDelegate <NSObject>\n\n#ifdef __cplusplus\n// delegate method for processing image frames\n- (void)processImage:(cv::Mat&)image;\n#endif\n\n@end\n\nCV_EXPORTS @interface CvVideoCamera : CvAbstractCamera<AVCaptureVideoDataOutputSampleBufferDelegate>\n{\n    AVCaptureVideoDataOutput *videoDataOutput;\n\n    dispatch_queue_t videoDataOutputQueue;\n    CALayer *customPreviewLayer;\n\n    CMTime lastSampleTime;\n\n}\n\n@property (nonatomic, weak) id<CvVideoCameraDelegate> delegate;\n@property (nonatomic, assign) BOOL grayscaleMode;\n\n@property (nonatomic, assign) BOOL recordVideo;\n@property (nonatomic, assign) BOOL rotateVideo;\n@property (nonatomic, strong) AVAssetWriterInput* recordAssetWriterInput;\n@property (nonatomic, strong) AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor;\n@property (nonatomic, strong) AVAssetWriter* recordAssetWriter;\n\n- (void)adjustLayoutToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;\n- CV_UNUSED(layoutPreviewLayer);\n- CV_UNUSED(saveVideo);\n- (NSURL *)videoFileURL;\n- (NSString *)videoFileString;\n\n\n@end\n\n///////////////////////////////// CvPhotoCamera ///////////////////////////////////////////\n\n@class CvPhotoCamera;\n\nCV_EXPORTS @protocol CvPhotoCameraDelegate <NSObject>\n\n- (void)photoCamera:(CvPhotoCamera*)photoCamera capturedImage:(UIImage *)image;\n- (void)photoCameraCancel:(CvPhotoCamera*)photoCamera;\n\n@end\n\nCV_EXPORTS @interface CvPhotoCamera : CvAbstractCamera\n{\n    AVCaptureStillImageOutput *stillImageOutput;\n}\n\n@property (nonatomic, weak) id<CvPhotoCameraDelegate> delegate;\n\n- CV_UNUSED(takePicture);\n\n@end\n\n//! @} videoio_ios\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/videoio/legacy/constants_c.h",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_VIDEOIO_LEGACY_CONSTANTS_H\n#define OPENCV_VIDEOIO_LEGACY_CONSTANTS_H\n\nenum\n{\n    CV_CAP_ANY      =0,     // autodetect\n\n    CV_CAP_MIL      =100,   // MIL proprietary drivers\n\n    CV_CAP_VFW      =200,   // platform native\n    CV_CAP_V4L      =200,\n    CV_CAP_V4L2     =200,\n\n    CV_CAP_FIREWARE =300,   // IEEE 1394 drivers\n    CV_CAP_FIREWIRE =300,\n    CV_CAP_IEEE1394 =300,\n    CV_CAP_DC1394   =300,\n    CV_CAP_CMU1394  =300,\n\n    CV_CAP_STEREO   =400,   // TYZX proprietary drivers\n    CV_CAP_TYZX     =400,\n    CV_TYZX_LEFT    =400,\n    CV_TYZX_RIGHT   =401,\n    CV_TYZX_COLOR   =402,\n    CV_TYZX_Z       =403,\n\n    CV_CAP_QT       =500,   // QuickTime\n\n    CV_CAP_UNICAP   =600,   // Unicap drivers\n\n    CV_CAP_DSHOW    =700,   // DirectShow (via videoInput)\n    CV_CAP_MSMF     =1400,  // Microsoft Media Foundation (via videoInput)\n\n    CV_CAP_PVAPI    =800,   // PvAPI, Prosilica GigE SDK\n\n    CV_CAP_OPENNI   =900,   // OpenNI (for Kinect)\n    CV_CAP_OPENNI_ASUS =910,   // OpenNI (for Asus Xtion)\n\n    CV_CAP_ANDROID  =1000,  // Android - not used\n    CV_CAP_ANDROID_BACK =CV_CAP_ANDROID+99, // Android back camera - not used\n    CV_CAP_ANDROID_FRONT =CV_CAP_ANDROID+98, // Android front camera - not used\n\n    CV_CAP_XIAPI    =1100,   // XIMEA Camera API\n\n    CV_CAP_AVFOUNDATION = 1200,  // AVFoundation framework for iOS (OS X Lion will have the same API)\n\n    CV_CAP_GIGANETIX = 1300,  // Smartek Giganetix GigEVisionSDK\n\n    CV_CAP_INTELPERC = 1500, // Intel Perceptual Computing\n\n    CV_CAP_OPENNI2 = 1600,   // OpenNI2 (for Kinect)\n    CV_CAP_GPHOTO2 = 1700,\n    CV_CAP_GSTREAMER = 1800, // GStreamer\n    CV_CAP_FFMPEG = 1900,    // FFMPEG\n    CV_CAP_IMAGES = 2000,    // OpenCV Image Sequence (e.g. img_%02d.jpg)\n\n    CV_CAP_ARAVIS = 2100     // Aravis GigE SDK\n};\n\nenum\n{\n    // modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)\n    // every feature can have only one mode turned on at a time\n    CV_CAP_PROP_DC1394_OFF         = -4,  //turn the feature off (not controlled manually nor automatically)\n    CV_CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user\n    CV_CAP_PROP_DC1394_MODE_AUTO = -2,\n    CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,\n    CV_CAP_PROP_POS_MSEC       =0,\n    CV_CAP_PROP_POS_FRAMES     =1,\n    CV_CAP_PROP_POS_AVI_RATIO  =2,\n    CV_CAP_PROP_FRAME_WIDTH    =3,\n    CV_CAP_PROP_FRAME_HEIGHT   =4,\n    CV_CAP_PROP_FPS            =5,\n    CV_CAP_PROP_FOURCC         =6,\n    CV_CAP_PROP_FRAME_COUNT    =7,\n    CV_CAP_PROP_FORMAT         =8,\n    CV_CAP_PROP_MODE           =9,\n    CV_CAP_PROP_BRIGHTNESS    =10,\n    CV_CAP_PROP_CONTRAST      =11,\n    CV_CAP_PROP_SATURATION    =12,\n    CV_CAP_PROP_HUE           =13,\n    CV_CAP_PROP_GAIN          =14,\n    CV_CAP_PROP_EXPOSURE      =15,\n    CV_CAP_PROP_CONVERT_RGB   =16,\n    CV_CAP_PROP_WHITE_BALANCE_BLUE_U =17,\n    CV_CAP_PROP_RECTIFICATION =18,\n    CV_CAP_PROP_MONOCHROME    =19,\n    CV_CAP_PROP_SHARPNESS     =20,\n    CV_CAP_PROP_AUTO_EXPOSURE =21, // exposure control done by camera,\n                                   // user can adjust reference level\n                                   // using this feature\n    CV_CAP_PROP_GAMMA         =22,\n    CV_CAP_PROP_TEMPERATURE   =23,\n    CV_CAP_PROP_TRIGGER       =24,\n    CV_CAP_PROP_TRIGGER_DELAY =25,\n    CV_CAP_PROP_WHITE_BALANCE_RED_V =26,\n    CV_CAP_PROP_ZOOM          =27,\n    CV_CAP_PROP_FOCUS         =28,\n    CV_CAP_PROP_GUID          =29,\n    CV_CAP_PROP_ISO_SPEED     =30,\n    CV_CAP_PROP_MAX_DC1394    =31,\n    CV_CAP_PROP_BACKLIGHT     =32,\n    CV_CAP_PROP_PAN           =33,\n    CV_CAP_PROP_TILT          =34,\n    CV_CAP_PROP_ROLL          =35,\n    CV_CAP_PROP_IRIS          =36,\n    CV_CAP_PROP_SETTINGS      =37,\n    CV_CAP_PROP_BUFFERSIZE    =38,\n    CV_CAP_PROP_AUTOFOCUS     =39,\n    CV_CAP_PROP_SAR_NUM       =40,\n    CV_CAP_PROP_SAR_DEN       =41,\n\n    CV_CAP_PROP_AUTOGRAB      =1024, // property for videoio class CvCapture_Android only\n    CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // readonly, tricky property, returns cpnst char* indeed\n    CV_CAP_PROP_PREVIEW_FORMAT=1026, // readonly, tricky property, returns cpnst char* indeed\n\n    // OpenNI map generators\n    CV_CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,\n    CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,\n    CV_CAP_OPENNI_IR_GENERATOR    = 1 << 29,\n    CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_OPENNI_IR_GENERATOR,\n\n    // Properties of cameras available through OpenNI interfaces\n    CV_CAP_PROP_OPENNI_OUTPUT_MODE     = 100,\n    CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm\n    CV_CAP_PROP_OPENNI_BASELINE        = 102, // in mm\n    CV_CAP_PROP_OPENNI_FOCAL_LENGTH    = 103, // in pixels\n    CV_CAP_PROP_OPENNI_REGISTRATION    = 104, // flag\n    CV_CAP_PROP_OPENNI_REGISTRATION_ON = CV_CAP_PROP_OPENNI_REGISTRATION, // flag that synchronizes the remapping depth map to image map\n                                                                          // by changing depth generator's view point (if the flag is \"on\") or\n                                                                          // sets this view point to its normal one (if the flag is \"off\").\n    CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,\n    CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE   = 106,\n    CV_CAP_PROP_OPENNI_CIRCLE_BUFFER     = 107,\n    CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108,\n\n    CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109,\n    CV_CAP_PROP_OPENNI2_SYNC = 110,\n    CV_CAP_PROP_OPENNI2_MIRROR = 111,\n\n    CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT         = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,\n    CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE     = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE,\n    CV_CAP_OPENNI_DEPTH_GENERATOR_PRESENT         = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,\n    CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE,\n    CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH,\n    CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION,\n    CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,\n    CV_CAP_OPENNI_IR_GENERATOR_PRESENT            = CV_CAP_OPENNI_IR_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,\n\n    // Properties of cameras available through GStreamer interface\n    CV_CAP_GSTREAMER_QUEUE_LENGTH           = 200, // default is 1\n\n    // PVAPI\n    CV_CAP_PROP_PVAPI_MULTICASTIP           = 300, // ip for anable multicast master mode. 0 for disable multicast\n    CV_CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, // FrameStartTriggerMode: Determines how a frame is initiated\n    CV_CAP_PROP_PVAPI_DECIMATIONHORIZONTAL  = 302, // Horizontal sub-sampling of the image\n    CV_CAP_PROP_PVAPI_DECIMATIONVERTICAL    = 303, // Vertical sub-sampling of the image\n    CV_CAP_PROP_PVAPI_BINNINGX              = 304, // Horizontal binning factor\n    CV_CAP_PROP_PVAPI_BINNINGY              = 305, // Vertical binning factor\n    CV_CAP_PROP_PVAPI_PIXELFORMAT           = 306, // Pixel format\n\n    // Properties of cameras available through XIMEA SDK interface\n    CV_CAP_PROP_XI_DOWNSAMPLING                                 = 400, // Change image resolution by binning or skipping.\n    CV_CAP_PROP_XI_DATA_FORMAT                                  = 401, // Output data format.\n    CV_CAP_PROP_XI_OFFSET_X                                     = 402, // Horizontal offset from the origin to the area of interest (in pixels).\n    CV_CAP_PROP_XI_OFFSET_Y                                     = 403, // Vertical offset from the origin to the area of interest (in pixels).\n    CV_CAP_PROP_XI_TRG_SOURCE                                   = 404, // Defines source of trigger.\n    CV_CAP_PROP_XI_TRG_SOFTWARE                                 = 405, // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.\n    CV_CAP_PROP_XI_GPI_SELECTOR                                 = 406, // Selects general purpose input\n    CV_CAP_PROP_XI_GPI_MODE                                     = 407, // Set general purpose input mode\n    CV_CAP_PROP_XI_GPI_LEVEL                                    = 408, // Get general purpose level\n    CV_CAP_PROP_XI_GPO_SELECTOR                                 = 409, // Selects general purpose output\n    CV_CAP_PROP_XI_GPO_MODE                                     = 410, // Set general purpose output mode\n    CV_CAP_PROP_XI_LED_SELECTOR                                 = 411, // Selects camera signalling LED\n    CV_CAP_PROP_XI_LED_MODE                                     = 412, // Define camera signalling LED functionality\n    CV_CAP_PROP_XI_MANUAL_WB                                    = 413, // Calculates White Balance(must be called during acquisition)\n    CV_CAP_PROP_XI_AUTO_WB                                      = 414, // Automatic white balance\n    CV_CAP_PROP_XI_AEAG                                         = 415, // Automatic exposure/gain\n    CV_CAP_PROP_XI_EXP_PRIORITY                                 = 416, // Exposure priority (0.5 - exposure 50%, gain 50%).\n    CV_CAP_PROP_XI_AE_MAX_LIMIT                                 = 417, // Maximum limit of exposure in AEAG procedure\n    CV_CAP_PROP_XI_AG_MAX_LIMIT                                 = 418,  // Maximum limit of gain in AEAG procedure\n    CV_CAP_PROP_XI_AEAG_LEVEL                                   = 419, // Average intensity of output signal AEAG should achieve(in %)\n    CV_CAP_PROP_XI_TIMEOUT                                      = 420, // Image capture timeout in milliseconds\n    CV_CAP_PROP_XI_EXPOSURE                                     = 421, // Exposure time in microseconds\n    CV_CAP_PROP_XI_EXPOSURE_BURST_COUNT                         = 422, // Sets the number of times of exposure in one frame.\n    CV_CAP_PROP_XI_GAIN_SELECTOR                                = 423, // Gain selector for parameter Gain allows to select different type of gains.\n    CV_CAP_PROP_XI_GAIN                                         = 424, // Gain in dB\n    CV_CAP_PROP_XI_DOWNSAMPLING_TYPE                            = 426, // Change image downsampling type.\n    CV_CAP_PROP_XI_BINNING_SELECTOR                             = 427, // Binning engine selector.\n    CV_CAP_PROP_XI_BINNING_VERTICAL                             = 428, // Vertical Binning - number of vertical photo-sensitive cells to combine together.\n    CV_CAP_PROP_XI_BINNING_HORIZONTAL                           = 429, // Horizontal Binning - number of horizontal photo-sensitive cells to combine together.\n    CV_CAP_PROP_XI_BINNING_PATTERN                              = 430, // Binning pattern type.\n    CV_CAP_PROP_XI_DECIMATION_SELECTOR                          = 431, // Decimation engine selector.\n    CV_CAP_PROP_XI_DECIMATION_VERTICAL                          = 432, // Vertical Decimation - vertical sub-sampling of the image - reduces the vertical resolution of the image by the specified vertical decimation factor.\n    CV_CAP_PROP_XI_DECIMATION_HORIZONTAL                        = 433, // Horizontal Decimation - horizontal sub-sampling of the image - reduces the horizontal resolution of the image by the specified vertical decimation factor.\n    CV_CAP_PROP_XI_DECIMATION_PATTERN                           = 434, // Decimation pattern type.\n    CV_CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR              = 587, // Selects which test pattern generator is controlled by the TestPattern feature.\n    CV_CAP_PROP_XI_TEST_PATTERN                                 = 588, // Selects which test pattern type is generated by the selected generator.\n    CV_CAP_PROP_XI_IMAGE_DATA_FORMAT                            = 435, // Output data format.\n    CV_CAP_PROP_XI_SHUTTER_TYPE                                 = 436, // Change sensor shutter type(CMOS sensor).\n    CV_CAP_PROP_XI_SENSOR_TAPS                                  = 437, // Number of taps\n    CV_CAP_PROP_XI_AEAG_ROI_OFFSET_X                            = 439, // Automatic exposure/gain ROI offset X\n    CV_CAP_PROP_XI_AEAG_ROI_OFFSET_Y                            = 440, // Automatic exposure/gain ROI offset Y\n    CV_CAP_PROP_XI_AEAG_ROI_WIDTH                               = 441, // Automatic exposure/gain ROI Width\n    CV_CAP_PROP_XI_AEAG_ROI_HEIGHT                              = 442, // Automatic exposure/gain ROI Height\n    CV_CAP_PROP_XI_BPC                                          = 445, // Correction of bad pixels\n    CV_CAP_PROP_XI_WB_KR                                        = 448, // White balance red coefficient\n    CV_CAP_PROP_XI_WB_KG                                        = 449, // White balance green coefficient\n    CV_CAP_PROP_XI_WB_KB                                        = 450, // White balance blue coefficient\n    CV_CAP_PROP_XI_WIDTH                                        = 451, // Width of the Image provided by the device (in pixels).\n    CV_CAP_PROP_XI_HEIGHT                                       = 452, // Height of the Image provided by the device (in pixels).\n    CV_CAP_PROP_XI_REGION_SELECTOR                              = 589, // Selects Region in Multiple ROI which parameters are set by width, height, ... ,region mode\n    CV_CAP_PROP_XI_REGION_MODE                                  = 595, // Activates/deactivates Region selected by Region Selector\n    CV_CAP_PROP_XI_LIMIT_BANDWIDTH                              = 459, // Set/get bandwidth(datarate)(in Megabits)\n    CV_CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH                        = 460, // Sensor output data bit depth.\n    CV_CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH                        = 461, // Device output data bit depth.\n    CV_CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH                         = 462, // bitdepth of data returned by function xiGetImage\n    CV_CAP_PROP_XI_OUTPUT_DATA_PACKING                          = 463, // Device output data packing (or grouping) enabled. Packing could be enabled if output_data_bit_depth > 8 and packing capability is available.\n    CV_CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE                     = 464, // Data packing type. Some cameras supports only specific packing type.\n    CV_CAP_PROP_XI_IS_COOLED                                    = 465, // Returns 1 for cameras that support cooling.\n    CV_CAP_PROP_XI_COOLING                                      = 466, // Start camera cooling.\n    CV_CAP_PROP_XI_TARGET_TEMP                                  = 467, // Set sensor target temperature for cooling.\n    CV_CAP_PROP_XI_CHIP_TEMP                                    = 468, // Camera sensor temperature\n    CV_CAP_PROP_XI_HOUS_TEMP                                    = 469, // Camera housing temperature\n    CV_CAP_PROP_XI_HOUS_BACK_SIDE_TEMP                          = 590, // Camera housing back side temperature\n    CV_CAP_PROP_XI_SENSOR_BOARD_TEMP                            = 596, // Camera sensor board temperature\n    CV_CAP_PROP_XI_CMS                                          = 470, // Mode of color management system.\n    CV_CAP_PROP_XI_APPLY_CMS                                    = 471, // Enable applying of CMS profiles to xiGetImage (see XI_PRM_INPUT_CMS_PROFILE, XI_PRM_OUTPUT_CMS_PROFILE).\n    CV_CAP_PROP_XI_IMAGE_IS_COLOR                               = 474, // Returns 1 for color cameras.\n    CV_CAP_PROP_XI_COLOR_FILTER_ARRAY                           = 475, // Returns color filter array type of RAW data.\n    CV_CAP_PROP_XI_GAMMAY                                       = 476, // Luminosity gamma\n    CV_CAP_PROP_XI_GAMMAC                                       = 477, // Chromaticity gamma\n    CV_CAP_PROP_XI_SHARPNESS                                    = 478, // Sharpness Strength\n    CV_CAP_PROP_XI_CC_MATRIX_00                                 = 479, // Color Correction Matrix element [0][0]\n    CV_CAP_PROP_XI_CC_MATRIX_01                                 = 480, // Color Correction Matrix element [0][1]\n    CV_CAP_PROP_XI_CC_MATRIX_02                                 = 481, // Color Correction Matrix element [0][2]\n    CV_CAP_PROP_XI_CC_MATRIX_03                                 = 482, // Color Correction Matrix element [0][3]\n    CV_CAP_PROP_XI_CC_MATRIX_10                                 = 483, // Color Correction Matrix element [1][0]\n    CV_CAP_PROP_XI_CC_MATRIX_11                                 = 484, // Color Correction Matrix element [1][1]\n    CV_CAP_PROP_XI_CC_MATRIX_12                                 = 485, // Color Correction Matrix element [1][2]\n    CV_CAP_PROP_XI_CC_MATRIX_13                                 = 486, // Color Correction Matrix element [1][3]\n    CV_CAP_PROP_XI_CC_MATRIX_20                                 = 487, // Color Correction Matrix element [2][0]\n    CV_CAP_PROP_XI_CC_MATRIX_21                                 = 488, // Color Correction Matrix element [2][1]\n    CV_CAP_PROP_XI_CC_MATRIX_22                                 = 489, // Color Correction Matrix element [2][2]\n    CV_CAP_PROP_XI_CC_MATRIX_23                                 = 490, // Color Correction Matrix element [2][3]\n    CV_CAP_PROP_XI_CC_MATRIX_30                                 = 491, // Color Correction Matrix element [3][0]\n    CV_CAP_PROP_XI_CC_MATRIX_31                                 = 492, // Color Correction Matrix element [3][1]\n    CV_CAP_PROP_XI_CC_MATRIX_32                                 = 493, // Color Correction Matrix element [3][2]\n    CV_CAP_PROP_XI_CC_MATRIX_33                                 = 494, // Color Correction Matrix element [3][3]\n    CV_CAP_PROP_XI_DEFAULT_CC_MATRIX                            = 495, // Set default Color Correction Matrix\n    CV_CAP_PROP_XI_TRG_SELECTOR                                 = 498, // Selects the type of trigger.\n    CV_CAP_PROP_XI_ACQ_FRAME_BURST_COUNT                        = 499, // Sets number of frames acquired by burst. This burst is used only if trigger is set to FrameBurstStart\n    CV_CAP_PROP_XI_DEBOUNCE_EN                                  = 507, // Enable/Disable debounce to selected GPI\n    CV_CAP_PROP_XI_DEBOUNCE_T0                                  = 508, // Debounce time (x * 10us)\n    CV_CAP_PROP_XI_DEBOUNCE_T1                                  = 509, // Debounce time (x * 10us)\n    CV_CAP_PROP_XI_DEBOUNCE_POL                                 = 510, // Debounce polarity (pol = 1 t0 - falling edge, t1 - rising edge)\n    CV_CAP_PROP_XI_LENS_MODE                                    = 511, // Status of lens control interface. This shall be set to XI_ON before any Lens operations.\n    CV_CAP_PROP_XI_LENS_APERTURE_VALUE                          = 512, // Current lens aperture value in stops. Examples: 2.8, 4, 5.6, 8, 11\n    CV_CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE                    = 513, // Lens current focus movement value to be used by XI_PRM_LENS_FOCUS_MOVE in motor steps.\n    CV_CAP_PROP_XI_LENS_FOCUS_MOVE                              = 514, // Moves lens focus motor by steps set in XI_PRM_LENS_FOCUS_MOVEMENT_VALUE.\n    CV_CAP_PROP_XI_LENS_FOCUS_DISTANCE                          = 515, // Lens focus distance in cm.\n    CV_CAP_PROP_XI_LENS_FOCAL_LENGTH                            = 516, // Lens focal distance in mm.\n    CV_CAP_PROP_XI_LENS_FEATURE_SELECTOR                        = 517, // Selects the current feature which is accessible by XI_PRM_LENS_FEATURE.\n    CV_CAP_PROP_XI_LENS_FEATURE                                 = 518, // Allows access to lens feature value currently selected by XI_PRM_LENS_FEATURE_SELECTOR.\n    CV_CAP_PROP_XI_DEVICE_MODEL_ID                              = 521, // Return device model id\n    CV_CAP_PROP_XI_DEVICE_SN                                    = 522, // Return device serial number\n    CV_CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA                = 529, // The alpha channel of RGB32 output image format.\n    CV_CAP_PROP_XI_IMAGE_PAYLOAD_SIZE                           = 530, // Buffer size in bytes sufficient for output image returned by xiGetImage\n    CV_CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT                       = 531, // Current format of pixels on transport layer.\n    CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ                         = 532, // Sensor clock frequency in Hz.\n    CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX                      = 533, // Sensor clock frequency index. Sensor with selected frequencies have possibility to set the frequency only by this index.\n    CV_CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT                  = 534, // Number of output channels from sensor used for data transfer.\n    CV_CAP_PROP_XI_FRAMERATE                                    = 535, // Define framerate in Hz\n    CV_CAP_PROP_XI_COUNTER_SELECTOR                             = 536, // Select counter\n    CV_CAP_PROP_XI_COUNTER_VALUE                                = 537, // Counter status\n    CV_CAP_PROP_XI_ACQ_TIMING_MODE                              = 538, // Type of sensor frames timing.\n    CV_CAP_PROP_XI_AVAILABLE_BANDWIDTH                          = 539, // Calculate and return available interface bandwidth(int Megabits)\n    CV_CAP_PROP_XI_BUFFER_POLICY                                = 540, // Data move policy\n    CV_CAP_PROP_XI_LUT_EN                                       = 541, // Activates LUT.\n    CV_CAP_PROP_XI_LUT_INDEX                                    = 542, // Control the index (offset) of the coefficient to access in the LUT.\n    CV_CAP_PROP_XI_LUT_VALUE                                    = 543, // Value at entry LUTIndex of the LUT\n    CV_CAP_PROP_XI_TRG_DELAY                                    = 544, // Specifies the delay in microseconds (us) to apply after the trigger reception before activating it.\n    CV_CAP_PROP_XI_TS_RST_MODE                                  = 545, // Defines how time stamp reset engine will be armed\n    CV_CAP_PROP_XI_TS_RST_SOURCE                                = 546, // Defines which source will be used for timestamp reset. Writing this parameter will trigger settings of engine (arming)\n    CV_CAP_PROP_XI_IS_DEVICE_EXIST                              = 547, // Returns 1 if camera connected and works properly.\n    CV_CAP_PROP_XI_ACQ_BUFFER_SIZE                              = 548, // Acquisition buffer size in buffer_size_unit. Default bytes.\n    CV_CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT                         = 549, // Acquisition buffer size unit in bytes. Default 1. E.g. Value 1024 means that buffer_size is in KiBytes\n    CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE                    = 550, // Acquisition transport buffer size in bytes\n    CV_CAP_PROP_XI_BUFFERS_QUEUE_SIZE                           = 551, // Queue of field/frame buffers\n    CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT                  = 552, // Number of buffers to commit to low level\n    CV_CAP_PROP_XI_RECENT_FRAME                                 = 553, // GetImage returns most recent frame\n    CV_CAP_PROP_XI_DEVICE_RESET                                 = 554, // Resets the camera to default state.\n    CV_CAP_PROP_XI_COLUMN_FPN_CORRECTION                        = 555, // Correction of column FPN\n    CV_CAP_PROP_XI_ROW_FPN_CORRECTION                           = 591, // Correction of row FPN\n    CV_CAP_PROP_XI_SENSOR_MODE                                  = 558, // Current sensor mode. Allows to select sensor mode by one integer. Setting of this parameter affects: image dimensions and downsampling.\n    CV_CAP_PROP_XI_HDR                                          = 559, // Enable High Dynamic Range feature.\n    CV_CAP_PROP_XI_HDR_KNEEPOINT_COUNT                          = 560, // The number of kneepoints in the PWLR.\n    CV_CAP_PROP_XI_HDR_T1                                       = 561, // position of first kneepoint(in % of XI_PRM_EXPOSURE)\n    CV_CAP_PROP_XI_HDR_T2                                       = 562, // position of second kneepoint (in % of XI_PRM_EXPOSURE)\n    CV_CAP_PROP_XI_KNEEPOINT1                                   = 563, // value of first kneepoint (% of sensor saturation)\n    CV_CAP_PROP_XI_KNEEPOINT2                                   = 564, // value of second kneepoint (% of sensor saturation)\n    CV_CAP_PROP_XI_IMAGE_BLACK_LEVEL                            = 565, // Last image black level counts. Can be used for Offline processing to recall it.\n    CV_CAP_PROP_XI_HW_REVISION                                  = 571, // Returns hardware revision number.\n    CV_CAP_PROP_XI_DEBUG_LEVEL                                  = 572, // Set debug level\n    CV_CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION                   = 573, // Automatic bandwidth calculation,\n    CV_CAP_PROP_XI_FFS_FILE_ID                                  = 594, // File number.\n    CV_CAP_PROP_XI_FFS_FILE_SIZE                                = 580, // Size of file.\n    CV_CAP_PROP_XI_FREE_FFS_SIZE                                = 581, // Size of free camera FFS.\n    CV_CAP_PROP_XI_USED_FFS_SIZE                                = 582, // Size of used camera FFS.\n    CV_CAP_PROP_XI_FFS_ACCESS_KEY                               = 583, // Setting of key enables file operations on some cameras.\n    CV_CAP_PROP_XI_SENSOR_FEATURE_SELECTOR                      = 585, // Selects the current feature which is accessible by XI_PRM_SENSOR_FEATURE_VALUE.\n    CV_CAP_PROP_XI_SENSOR_FEATURE_VALUE                         = 586, // Allows access to sensor feature value currently selected by XI_PRM_SENSOR_FEATURE_SELECTOR.\n\n\n    // Properties for Android cameras\n    CV_CAP_PROP_ANDROID_FLASH_MODE = 8001,\n    CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002,\n    CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003,\n    CV_CAP_PROP_ANDROID_ANTIBANDING = 8004,\n    CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005,\n    CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006,\n    CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007,\n    CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008,\n    CV_CAP_PROP_ANDROID_EXPOSE_LOCK = 8009,\n    CV_CAP_PROP_ANDROID_WHITEBALANCE_LOCK = 8010,\n\n    // Properties of cameras available through AVFOUNDATION interface\n    CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001,\n    CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002,\n    CV_CAP_PROP_IOS_DEVICE_FLASH = 9003,\n    CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,\n    CV_CAP_PROP_IOS_DEVICE_TORCH = 9005,\n\n    // Properties of cameras available through Smartek Giganetix Ethernet Vision interface\n    /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */\n    CV_CAP_PROP_GIGA_FRAME_OFFSET_X = 10001,\n    CV_CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002,\n    CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003,\n    CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004,\n    CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,\n    CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006,\n\n    CV_CAP_PROP_INTELPERC_PROFILE_COUNT               = 11001,\n    CV_CAP_PROP_INTELPERC_PROFILE_IDX                 = 11002,\n    CV_CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE  = 11003,\n    CV_CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE      = 11004,\n    CV_CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD  = 11005,\n    CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ     = 11006,\n    CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT     = 11007,\n\n    // Intel PerC streams\n    CV_CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29,\n    CV_CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28,\n    CV_CAP_INTELPERC_GENERATORS_MASK = CV_CAP_INTELPERC_DEPTH_GENERATOR + CV_CAP_INTELPERC_IMAGE_GENERATOR\n};\n\nenum\n{\n    // Data given from depth generator.\n    CV_CAP_OPENNI_DEPTH_MAP                 = 0, // Depth values in mm (CV_16UC1)\n    CV_CAP_OPENNI_POINT_CLOUD_MAP           = 1, // XYZ in meters (CV_32FC3)\n    CV_CAP_OPENNI_DISPARITY_MAP             = 2, // Disparity in pixels (CV_8UC1)\n    CV_CAP_OPENNI_DISPARITY_MAP_32F         = 3, // Disparity in pixels (CV_32FC1)\n    CV_CAP_OPENNI_VALID_DEPTH_MASK          = 4, // CV_8UC1\n\n    // Data given from RGB image generator.\n    CV_CAP_OPENNI_BGR_IMAGE                 = 5,\n    CV_CAP_OPENNI_GRAY_IMAGE                = 6,\n\n    // Data given from IR image generator.\n    CV_CAP_OPENNI_IR_IMAGE                  = 7\n};\n\n// Supported output modes of OpenNI image generator\nenum\n{\n    CV_CAP_OPENNI_VGA_30HZ     = 0,\n    CV_CAP_OPENNI_SXGA_15HZ    = 1,\n    CV_CAP_OPENNI_SXGA_30HZ    = 2,\n    CV_CAP_OPENNI_QVGA_30HZ    = 3,\n    CV_CAP_OPENNI_QVGA_60HZ    = 4\n};\n\nenum\n{\n    CV_CAP_INTELPERC_DEPTH_MAP              = 0, // Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth.\n    CV_CAP_INTELPERC_UVDEPTH_MAP            = 1, // Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates.\n    CV_CAP_INTELPERC_IR_MAP                 = 2, // Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.\n    CV_CAP_INTELPERC_IMAGE                  = 3\n};\n\n// gPhoto2 properties, if propertyId is less than 0 then work on widget with that __additive inversed__ camera setting ID\n// Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE.\n// @see CvCaptureCAM_GPHOTO2 for more info\nenum\n{\n    CV_CAP_PROP_GPHOTO2_PREVIEW           = 17001, // Capture only preview from liveview mode.\n    CV_CAP_PROP_GPHOTO2_WIDGET_ENUMERATE  = 17002, // Readonly, returns (const char *).\n    CV_CAP_PROP_GPHOTO2_RELOAD_CONFIG     = 17003, // Trigger, only by set. Reload camera settings.\n    CV_CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE  = 17004, // Reload all settings on set.\n    CV_CAP_PROP_GPHOTO2_COLLECT_MSGS      = 17005, // Collect messages with details.\n    CV_CAP_PROP_GPHOTO2_FLUSH_MSGS        = 17006, // Readonly, returns (const char *).\n    CV_CAP_PROP_SPEED                     = 17007, // Exposure speed. Can be readonly, depends on camera program.\n    CV_CAP_PROP_APERTURE                  = 17008, // Aperture. Can be readonly, depends on camera program.\n    CV_CAP_PROP_EXPOSUREPROGRAM           = 17009, // Camera exposure program.\n    CV_CAP_PROP_VIEWFINDER                = 17010  // Enter liveview mode.\n};\n\n//! Macro to construct the fourcc code of the codec. Same as CV_FOURCC()\n#define CV_FOURCC_MACRO(c1, c2, c3, c4) (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24))\n\n/** @brief Constructs the fourcc code of the codec function\n\nSimply call it with 4 chars fourcc code like `CV_FOURCC('I', 'Y', 'U', 'V')`\n\nList of codes can be obtained at [Video Codecs by FOURCC](http://www.fourcc.org/codecs.php) page.\nFFMPEG backend with MP4 container natively uses other values as fourcc code:\nsee [ObjectType](http://mp4ra.org/#/codecs).\n*/\nCV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4)\n{\n    return CV_FOURCC_MACRO(c1, c2, c3, c4);\n}\n\n//! (Windows only) Open Codec Selection Dialog\n#define CV_FOURCC_PROMPT -1\n//! (Linux only) Use default codec for specified filename\n#define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V')\n\n#endif // OPENCV_VIDEOIO_LEGACY_CONSTANTS_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/videoio/registry.hpp",
    "content": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n\n#ifndef OPENCV_VIDEOIO_REGISTRY_HPP\n#define OPENCV_VIDEOIO_REGISTRY_HPP\n\n#include <opencv2/videoio.hpp>\n\nnamespace cv { namespace videoio_registry {\n/** @addtogroup videoio_registry\nThis section contains API description how to query/configure available Video I/O backends.\n\nRuntime configuration options:\n- enable debug mode: `OPENCV_VIDEOIO_DEBUG=1`\n- change backend priority: `OPENCV_VIDEOIO_PRIORITY_<backend>=9999`\n- disable backend: `OPENCV_VIDEOIO_PRIORITY_<backend>=0`\n- specify list of backends with high priority (>100000): `OPENCV_VIDEOIO_PRIORITY_LIST=FFMPEG,GSTREAMER`\n\n@{\n */\n\n\n/** @brief Returns backend API name or \"UnknownVideoAPI(xxx)\"\n@param api backend ID (#VideoCaptureAPIs)\n*/\nCV_EXPORTS_W cv::String getBackendName(VideoCaptureAPIs api);\n\n/** @brief Returns list of all available backends */\nCV_EXPORTS_W std::vector<VideoCaptureAPIs> getBackends();\n\n/** @brief Returns list of available backends which works via `cv::VideoCapture(int index)` */\nCV_EXPORTS_W std::vector<VideoCaptureAPIs> getCameraBackends();\n\n/** @brief Returns list of available backends which works via `cv::VideoCapture(filename)` */\nCV_EXPORTS_W std::vector<VideoCaptureAPIs> getStreamBackends();\n\n/** @brief Returns list of available backends which works via `cv::VideoWriter()` */\nCV_EXPORTS_W std::vector<VideoCaptureAPIs> getWriterBackends();\n\n/** @brief Returns true if backend is available */\nCV_EXPORTS_W bool hasBackend(VideoCaptureAPIs api);\n\n/** @brief Returns true if backend is built in (false if backend is used as plugin) */\nCV_EXPORTS_W bool isBackendBuiltIn(VideoCaptureAPIs api);\n\n/** @brief Returns description and ABI/API version of videoio plugin's camera interface */\nCV_EXPORTS_W std::string getCameraBackendPluginVersion(\n    VideoCaptureAPIs api,\n    CV_OUT int& version_ABI,\n    CV_OUT int& version_API\n);\n\n/** @brief Returns description and ABI/API version of videoio plugin's stream capture interface */\nCV_EXPORTS_W std::string getStreamBackendPluginVersion(\n    VideoCaptureAPIs api,\n    CV_OUT int& version_ABI,\n    CV_OUT int& version_API\n);\n\n/** @brief Returns description and ABI/API version of videoio plugin's writer interface */\nCV_EXPORTS_W std::string getWriterBackendPluginVersion(\n    VideoCaptureAPIs api,\n    CV_OUT int& version_ABI,\n    CV_OUT int& version_API\n);\n\n\n//! @}\n}} // namespace\n\n#endif // OPENCV_VIDEOIO_REGISTRY_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/videoio/videoio.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Copyright (C) 2013, OpenCV Foundation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifdef __OPENCV_BUILD\n#error this is a compatibility header which should not be used inside the OpenCV library\n#endif\n\n#include \"opencv2/videoio.hpp\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/videoio/videoio_c.h",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                        Intel License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000, Intel Corporation, all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of Intel Corporation may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_VIDEOIO_H\n#define OPENCV_VIDEOIO_H\n\n#include \"opencv2/core/core_c.h\"\n\n#include \"opencv2/videoio/legacy/constants_c.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/**\n  @addtogroup videoio_c\n  @{\n*/\n\n/****************************************************************************************\\\n*                         Working with Video Files and Cameras                           *\n\\****************************************************************************************/\n\n/** @brief \"black box\" capture structure\n\nIn C++ use cv::VideoCapture\n*/\ntypedef struct CvCapture CvCapture;\n\n/** @brief start capturing frames from video file\n*/\nCVAPI(CvCapture*) cvCreateFileCapture( const char* filename );\n\n/** @brief start capturing frames from video file. allows specifying a preferred API to use\n*/\nCVAPI(CvCapture*) cvCreateFileCaptureWithPreference( const char* filename , int apiPreference);\n\n/** @brief start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*)\n*/\nCVAPI(CvCapture*) cvCreateCameraCapture( int index );\n\n/** @brief grab a frame, return 1 on success, 0 on fail.\n\n  this function is thought to be fast\n*/\nCVAPI(int) cvGrabFrame( CvCapture* capture );\n\n/** @brief get the frame grabbed with cvGrabFrame(..)\n\n  This function may apply some frame processing like\n  frame decompression, flipping etc.\n  @warning !!!DO NOT RELEASE or MODIFY the retrieved frame!!!\n*/\nCVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture, int streamIdx CV_DEFAULT(0) );\n\n/** @brief Just a combination of cvGrabFrame and cvRetrieveFrame\n\n  @warning !!!DO NOT RELEASE or MODIFY the retrieved frame!!!\n*/\nCVAPI(IplImage*) cvQueryFrame( CvCapture* capture );\n\n/** @brief stop capturing/reading and free resources\n*/\nCVAPI(void) cvReleaseCapture( CvCapture** capture );\n\n/** @brief retrieve capture properties\n*/\nCVAPI(double) cvGetCaptureProperty( CvCapture* capture, int property_id );\n/** @brief set capture properties\n*/\nCVAPI(int)    cvSetCaptureProperty( CvCapture* capture, int property_id, double value );\n\n/** @brief Return the type of the capturer (eg, ::CV_CAP_VFW, ::CV_CAP_UNICAP)\n\nIt is unknown if created with ::CV_CAP_ANY\n*/\nCVAPI(int)    cvGetCaptureDomain( CvCapture* capture);\n\n/** @brief \"black box\" video file writer structure\n\nIn C++ use cv::VideoWriter\n*/\ntypedef struct CvVideoWriter CvVideoWriter;\n\n/** @brief initialize video file writer\n*/\nCVAPI(CvVideoWriter*) cvCreateVideoWriter( const char* filename, int fourcc,\n                                           double fps, CvSize frame_size,\n                                           int is_color CV_DEFAULT(1));\n\n/** @brief write frame to video file\n*/\nCVAPI(int) cvWriteFrame( CvVideoWriter* writer, const IplImage* image );\n\n/** @brief close video file writer\n*/\nCVAPI(void) cvReleaseVideoWriter( CvVideoWriter** writer );\n\n// ***************************************************************************************\n//! @name Obsolete functions/synonyms\n//! @{\n#define cvCaptureFromCAM cvCreateCameraCapture //!< @deprecated use cvCreateCameraCapture() instead\n#define cvCaptureFromFile cvCreateFileCapture  //!< @deprecated use cvCreateFileCapture() instead\n#define cvCaptureFromAVI cvCaptureFromFile     //!< @deprecated use cvCreateFileCapture() instead\n#define cvCreateAVIWriter cvCreateVideoWriter  //!< @deprecated use cvCreateVideoWriter() instead\n#define cvWriteToAVI cvWriteFrame              //!< @deprecated use cvWriteFrame() instead\n//!  @} Obsolete...\n\n//! @} videoio_c\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //OPENCV_VIDEOIO_H\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/include/opencv2/videoio.hpp",
    "content": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n//  By downloading, copying, installing or using the software you agree to this license.\n//  If you do not agree to this license, do not download, install,\n//  copy or use the software.\n//\n//\n//                          License Agreement\n//                For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n//   * Redistribution's of source code must retain the above copyright notice,\n//     this list of conditions and the following disclaimer.\n//\n//   * Redistribution's in binary form must reproduce the above copyright notice,\n//     this list of conditions and the following disclaimer in the documentation\n//     and/or other materials provided with the distribution.\n//\n//   * The name of the copyright holders may not be used to endorse or promote products\n//     derived from this software without specific prior written permission.\n//\n// This software is provided by the copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_VIDEOIO_HPP\n#define OPENCV_VIDEOIO_HPP\n\n#include \"opencv2/core.hpp\"\n\n/**\n  @defgroup videoio Video I/O\n\n  @brief Read and write video or images sequence with OpenCV\n\n  ### See also:\n  - @ref videoio_overview\n  - Tutorials: @ref tutorial_table_of_content_app\n  @{\n    @defgroup videoio_flags_base Flags for video I/O\n    @defgroup videoio_flags_others Additional flags for video I/O API backends\n    @defgroup videoio_hwaccel Hardware-accelerated video decoding and encoding\n    @defgroup videoio_c C API for video I/O\n    @defgroup videoio_ios iOS glue for video I/O\n    @defgroup videoio_winrt WinRT glue for video I/O\n    @defgroup videoio_registry Query I/O API backends registry\n  @}\n*/\n\n////////////////////////////////// video io /////////////////////////////////\n\ntypedef struct CvCapture CvCapture;\ntypedef struct CvVideoWriter CvVideoWriter;\n\nnamespace cv\n{\n\n//! @addtogroup videoio\n//! @{\n\n//! @addtogroup videoio_flags_base\n//! @{\n\n\n/** @brief cv::VideoCapture API backends identifier.\n\nSelect preferred API for a capture object.\nTo be used in the VideoCapture::VideoCapture() constructor or VideoCapture::open()\n\n@note Backends are available only if they have been built with your OpenCV binaries.\nSee @ref videoio_overview for more information.\n*/\nenum VideoCaptureAPIs {\n       CAP_ANY          = 0,            //!< Auto detect == 0\n       CAP_VFW          = 200,          //!< Video For Windows (obsolete, removed)\n       CAP_V4L          = 200,          //!< V4L/V4L2 capturing support\n       CAP_V4L2         = CAP_V4L,      //!< Same as CAP_V4L\n       CAP_FIREWIRE     = 300,          //!< IEEE 1394 drivers\n       CAP_FIREWARE     = CAP_FIREWIRE, //!< Same value as CAP_FIREWIRE\n       CAP_IEEE1394     = CAP_FIREWIRE, //!< Same value as CAP_FIREWIRE\n       CAP_DC1394       = CAP_FIREWIRE, //!< Same value as CAP_FIREWIRE\n       CAP_CMU1394      = CAP_FIREWIRE, //!< Same value as CAP_FIREWIRE\n       CAP_QT           = 500,          //!< QuickTime (obsolete, removed)\n       CAP_UNICAP       = 600,          //!< Unicap drivers (obsolete, removed)\n       CAP_DSHOW        = 700,          //!< DirectShow (via videoInput)\n       CAP_PVAPI        = 800,          //!< PvAPI, Prosilica GigE SDK\n       CAP_OPENNI       = 900,          //!< OpenNI (for Kinect)\n       CAP_OPENNI_ASUS  = 910,          //!< OpenNI (for Asus Xtion)\n       CAP_ANDROID      = 1000,         //!< Android - not used\n       CAP_XIAPI        = 1100,         //!< XIMEA Camera API\n       CAP_AVFOUNDATION = 1200,         //!< AVFoundation framework for iOS (OS X Lion will have the same API)\n       CAP_GIGANETIX    = 1300,         //!< Smartek Giganetix GigEVisionSDK\n       CAP_MSMF         = 1400,         //!< Microsoft Media Foundation (via videoInput)\n       CAP_WINRT        = 1410,         //!< Microsoft Windows Runtime using Media Foundation\n       CAP_INTELPERC    = 1500,         //!< RealSense (former Intel Perceptual Computing SDK)\n       CAP_REALSENSE    = 1500,         //!< Synonym for CAP_INTELPERC\n       CAP_OPENNI2      = 1600,         //!< OpenNI2 (for Kinect)\n       CAP_OPENNI2_ASUS = 1610,         //!< OpenNI2 (for Asus Xtion and Occipital Structure sensors)\n       CAP_OPENNI2_ASTRA= 1620,         //!< OpenNI2 (for Orbbec Astra)\n       CAP_GPHOTO2      = 1700,         //!< gPhoto2 connection\n       CAP_GSTREAMER    = 1800,         //!< GStreamer\n       CAP_FFMPEG       = 1900,         //!< Open and record video file or stream using the FFMPEG library\n       CAP_IMAGES       = 2000,         //!< OpenCV Image Sequence (e.g. img_%02d.jpg)\n       CAP_ARAVIS       = 2100,         //!< Aravis SDK\n       CAP_OPENCV_MJPEG = 2200,         //!< Built-in OpenCV MotionJPEG codec\n       CAP_INTEL_MFX    = 2300,         //!< Intel MediaSDK\n       CAP_XINE         = 2400,         //!< XINE engine (Linux)\n       CAP_UEYE         = 2500,         //!< uEye Camera API\n     };\n\n/** @brief cv::VideoCapture generic properties identifier.\n\n Reading / writing properties involves many layers. Some unexpected result might happens along this chain.\n Effective behaviour depends from device hardware, driver and API Backend.\n @sa videoio_flags_others, VideoCapture::get(), VideoCapture::set()\n*/\nenum VideoCaptureProperties {\n       CAP_PROP_POS_MSEC       =0, //!< Current position of the video file in milliseconds.\n       CAP_PROP_POS_FRAMES     =1, //!< 0-based index of the frame to be decoded/captured next.\n       CAP_PROP_POS_AVI_RATIO  =2, //!< Relative position of the video file: 0=start of the film, 1=end of the film.\n       CAP_PROP_FRAME_WIDTH    =3, //!< Width of the frames in the video stream.\n       CAP_PROP_FRAME_HEIGHT   =4, //!< Height of the frames in the video stream.\n       CAP_PROP_FPS            =5, //!< Frame rate.\n       CAP_PROP_FOURCC         =6, //!< 4-character code of codec. see VideoWriter::fourcc .\n       CAP_PROP_FRAME_COUNT    =7, //!< Number of frames in the video file.\n       CAP_PROP_FORMAT         =8, //!< Format of the %Mat objects (see Mat::type()) returned by VideoCapture::retrieve().\n                                   //!< Set value -1 to fetch undecoded RAW video streams (as Mat 8UC1).\n       CAP_PROP_MODE           =9, //!< Backend-specific value indicating the current capture mode.\n       CAP_PROP_BRIGHTNESS    =10, //!< Brightness of the image (only for those cameras that support).\n       CAP_PROP_CONTRAST      =11, //!< Contrast of the image (only for cameras).\n       CAP_PROP_SATURATION    =12, //!< Saturation of the image (only for cameras).\n       CAP_PROP_HUE           =13, //!< Hue of the image (only for cameras).\n       CAP_PROP_GAIN          =14, //!< Gain of the image (only for those cameras that support).\n       CAP_PROP_EXPOSURE      =15, //!< Exposure (only for those cameras that support).\n       CAP_PROP_CONVERT_RGB   =16, //!< Boolean flags indicating whether images should be converted to RGB. <br/>\n                                   //!< *GStreamer note*: The flag is ignored in case if custom pipeline is used. It's user responsibility to interpret pipeline output.\n       CAP_PROP_WHITE_BALANCE_BLUE_U =17, //!< Currently unsupported.\n       CAP_PROP_RECTIFICATION =18, //!< Rectification flag for stereo cameras (note: only supported by DC1394 v 2.x backend currently).\n       CAP_PROP_MONOCHROME    =19,\n       CAP_PROP_SHARPNESS     =20,\n       CAP_PROP_AUTO_EXPOSURE =21, //!< DC1394: exposure control done by camera, user can adjust reference level using this feature.\n       CAP_PROP_GAMMA         =22,\n       CAP_PROP_TEMPERATURE   =23,\n       CAP_PROP_TRIGGER       =24,\n       CAP_PROP_TRIGGER_DELAY =25,\n       CAP_PROP_WHITE_BALANCE_RED_V =26,\n       CAP_PROP_ZOOM          =27,\n       CAP_PROP_FOCUS         =28,\n       CAP_PROP_GUID          =29,\n       CAP_PROP_ISO_SPEED     =30,\n       CAP_PROP_BACKLIGHT     =32,\n       CAP_PROP_PAN           =33,\n       CAP_PROP_TILT          =34,\n       CAP_PROP_ROLL          =35,\n       CAP_PROP_IRIS          =36,\n       CAP_PROP_SETTINGS      =37, //!< Pop up video/camera filter dialog (note: only supported by DSHOW backend currently. The property value is ignored)\n       CAP_PROP_BUFFERSIZE    =38,\n       CAP_PROP_AUTOFOCUS     =39,\n       CAP_PROP_SAR_NUM       =40, //!< Sample aspect ratio: num/den (num)\n       CAP_PROP_SAR_DEN       =41, //!< Sample aspect ratio: num/den (den)\n       CAP_PROP_BACKEND       =42, //!< Current backend (enum VideoCaptureAPIs). Read-only property\n       CAP_PROP_CHANNEL       =43, //!< Video input or Channel Number (only for those cameras that support)\n       CAP_PROP_AUTO_WB       =44, //!< enable/ disable auto white-balance\n       CAP_PROP_WB_TEMPERATURE=45, //!< white-balance color temperature\n       CAP_PROP_CODEC_PIXEL_FORMAT =46,    //!< (read-only) codec's pixel format. 4-character code - see VideoWriter::fourcc . Subset of [AV_PIX_FMT_*](https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/raw.c) or -1 if unknown\n       CAP_PROP_BITRATE       =47, //!< (read-only) Video bitrate in kbits/s\n       CAP_PROP_ORIENTATION_META=48, //!< (read-only) Frame rotation defined by stream meta (applicable for FFmpeg back-end only)\n       CAP_PROP_ORIENTATION_AUTO=49, //!< if true - rotates output frames of CvCapture considering video file's metadata  (applicable for FFmpeg back-end only) (https://github.com/opencv/opencv/issues/15499)\n       CAP_PROP_HW_ACCELERATION=50, //!< (**open-only**) Hardware acceleration type (see #VideoAccelerationType). Setting supported only via `params` parameter in cv::VideoCapture constructor / .open() method. Default value is backend-specific.\n       CAP_PROP_HW_DEVICE      =51, //!< (**open-only**) Hardware device index (select GPU if multiple available). Device enumeration is acceleration type specific.\n       CAP_PROP_HW_ACCELERATION_USE_OPENCL=52, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between HW accelerated decoder and cv::UMat.\n#ifndef CV_DOXYGEN\n       CV__CAP_PROP_LATEST\n#endif\n     };\n\n/** @brief cv::VideoWriter generic properties identifier.\n @sa VideoWriter::get(), VideoWriter::set()\n*/\nenum VideoWriterProperties {\n  VIDEOWRITER_PROP_QUALITY = 1,    //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.\n  VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.\n  VIDEOWRITER_PROP_NSTRIPES = 3,   //!< Number of stripes for parallel encoding. -1 for auto detection.\n  VIDEOWRITER_PROP_IS_COLOR = 4,   //!< If it is not zero, the encoder will expect and encode color frames, otherwise it\n                                   //!< will work with grayscale frames.\n  VIDEOWRITER_PROP_DEPTH = 5,      //!< Defaults to CV_8U.\n  VIDEOWRITER_PROP_HW_ACCELERATION = 6, //!< (**open-only**) Hardware acceleration type (see #VideoAccelerationType). Setting supported only via `params` parameter in VideoWriter constructor / .open() method. Default value is backend-specific.\n  VIDEOWRITER_PROP_HW_DEVICE       = 7, //!< (**open-only**) Hardware device index (select GPU if multiple available). Device enumeration is acceleration type specific.\n  VIDEOWRITER_PROP_HW_ACCELERATION_USE_OPENCL= 8, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between cv::UMat and HW accelerated encoder.\n#ifndef CV_DOXYGEN\n  CV__VIDEOWRITER_PROP_LATEST\n#endif\n};\n\n//! @} videoio_flags_base\n\n//! @addtogroup videoio_flags_others\n//! @{\n\n/** @name Hardware acceleration support\n    @{\n*/\n\n/** @brief Video Acceleration type\n *\n * Used as value in #CAP_PROP_HW_ACCELERATION and #VIDEOWRITER_PROP_HW_ACCELERATION\n *\n * @note In case of FFmpeg backend, it translated to enum AVHWDeviceType (https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/hwcontext.h)\n */\nenum VideoAccelerationType\n{\n    VIDEO_ACCELERATION_NONE     =  0,  //!< Do not require any specific H/W acceleration, prefer software processing.\n                                       //!< Reading of this value means that special H/W accelerated handling is not added or not detected by OpenCV.\n\n    VIDEO_ACCELERATION_ANY      =  1,  //!< Prefer to use H/W acceleration. If no one supported, then fallback to software processing.\n                                       //!< @note H/W acceleration may require special configuration of used environment.\n                                       //!< @note Results in encoding scenario may differ between software and hardware accelerated encoders.\n\n    VIDEO_ACCELERATION_D3D11    =  2,  //!< DirectX 11\n    VIDEO_ACCELERATION_VAAPI    =  3,  //!< VAAPI\n    VIDEO_ACCELERATION_MFX      =  4,  //!< libmfx (Intel MediaSDK/oneVPL)\n};\n\n//! @} Hardware acceleration support\n\n/** @name IEEE 1394 drivers\n    @{\n*/\n\n/** @brief Modes of the IEEE 1394 controlling registers\n(can be: auto, manual, auto single push, absolute Latter allowed with any other mode)\nevery feature can have only one mode turned on at a time\n*/\nenum { CAP_PROP_DC1394_OFF                = -4, //!< turn the feature off (not controlled manually nor automatically).\n       CAP_PROP_DC1394_MODE_MANUAL        = -3, //!< set automatically when a value of the feature is set by the user.\n       CAP_PROP_DC1394_MODE_AUTO          = -2,\n       CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,\n       CAP_PROP_DC1394_MAX                = 31\n     };\n\n//! @} IEEE 1394 drivers\n\n/** @name OpenNI (for Kinect)\n    @{\n*/\n\n//! OpenNI map generators\nenum { CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,\n       CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,\n       CAP_OPENNI_IR_GENERATOR    = 1 << 29,\n       CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR + CAP_OPENNI_IR_GENERATOR\n     };\n\n//! Properties of cameras available through OpenNI backend\nenum { CAP_PROP_OPENNI_OUTPUT_MODE       = 100,\n       CAP_PROP_OPENNI_FRAME_MAX_DEPTH   = 101, //!< In mm\n       CAP_PROP_OPENNI_BASELINE          = 102, //!< In mm\n       CAP_PROP_OPENNI_FOCAL_LENGTH      = 103, //!< In pixels\n       CAP_PROP_OPENNI_REGISTRATION      = 104, //!< Flag that synchronizes the remapping depth map to image map\n                                                //!< by changing depth generator's view point (if the flag is \"on\") or\n                                                //!< sets this view point to its normal one (if the flag is \"off\").\n       CAP_PROP_OPENNI_REGISTRATION_ON   = CAP_PROP_OPENNI_REGISTRATION,\n       CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,\n       CAP_PROP_OPENNI_MAX_BUFFER_SIZE   = 106,\n       CAP_PROP_OPENNI_CIRCLE_BUFFER     = 107,\n       CAP_PROP_OPENNI_MAX_TIME_DURATION = 108,\n       CAP_PROP_OPENNI_GENERATOR_PRESENT = 109,\n       CAP_PROP_OPENNI2_SYNC             = 110,\n       CAP_PROP_OPENNI2_MIRROR           = 111\n     };\n\n//! OpenNI shortcuts\nenum { CAP_OPENNI_IMAGE_GENERATOR_PRESENT         = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,\n       CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE     = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE,\n       CAP_OPENNI_DEPTH_GENERATOR_PRESENT         = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,\n       CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE,\n       CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH    = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH,\n       CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION    = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION,\n       CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,\n       CAP_OPENNI_IR_GENERATOR_PRESENT            = CAP_OPENNI_IR_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,\n     };\n\n//! OpenNI data given from depth generator\nenum { CAP_OPENNI_DEPTH_MAP         = 0, //!< Depth values in mm (CV_16UC1)\n       CAP_OPENNI_POINT_CLOUD_MAP   = 1, //!< XYZ in meters (CV_32FC3)\n       CAP_OPENNI_DISPARITY_MAP     = 2, //!< Disparity in pixels (CV_8UC1)\n       CAP_OPENNI_DISPARITY_MAP_32F = 3, //!< Disparity in pixels (CV_32FC1)\n       CAP_OPENNI_VALID_DEPTH_MASK  = 4, //!< CV_8UC1\n\n       CAP_OPENNI_BGR_IMAGE         = 5, //!< Data given from RGB image generator\n       CAP_OPENNI_GRAY_IMAGE        = 6, //!< Data given from RGB image generator\n\n       CAP_OPENNI_IR_IMAGE          = 7  //!< Data given from IR image generator\n     };\n\n//! Supported output modes of OpenNI image generator\nenum { CAP_OPENNI_VGA_30HZ  = 0,\n       CAP_OPENNI_SXGA_15HZ = 1,\n       CAP_OPENNI_SXGA_30HZ = 2,\n       CAP_OPENNI_QVGA_30HZ = 3,\n       CAP_OPENNI_QVGA_60HZ = 4\n     };\n\n//! @} OpenNI\n\n/** @name GStreamer\n    @{\n*/\n\nenum { CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200 //!< Default is 1\n     };\n\n//! @} GStreamer\n\n/** @name PvAPI, Prosilica GigE SDK\n    @{\n*/\n\n//! PVAPI\nenum { CAP_PROP_PVAPI_MULTICASTIP           = 300, //!< IP for enable multicast master mode. 0 for disable multicast.\n       CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, //!< FrameStartTriggerMode: Determines how a frame is initiated.\n       CAP_PROP_PVAPI_DECIMATIONHORIZONTAL  = 302, //!< Horizontal sub-sampling of the image.\n       CAP_PROP_PVAPI_DECIMATIONVERTICAL    = 303, //!< Vertical sub-sampling of the image.\n       CAP_PROP_PVAPI_BINNINGX              = 304, //!< Horizontal binning factor.\n       CAP_PROP_PVAPI_BINNINGY              = 305, //!< Vertical binning factor.\n       CAP_PROP_PVAPI_PIXELFORMAT           = 306  //!< Pixel format.\n     };\n\n//! PVAPI: FrameStartTriggerMode\nenum { CAP_PVAPI_FSTRIGMODE_FREERUN     = 0,    //!< Freerun\n       CAP_PVAPI_FSTRIGMODE_SYNCIN1     = 1,    //!< SyncIn1\n       CAP_PVAPI_FSTRIGMODE_SYNCIN2     = 2,    //!< SyncIn2\n       CAP_PVAPI_FSTRIGMODE_FIXEDRATE   = 3,    //!< FixedRate\n       CAP_PVAPI_FSTRIGMODE_SOFTWARE    = 4     //!< Software\n     };\n\n//! PVAPI: DecimationHorizontal, DecimationVertical\nenum { CAP_PVAPI_DECIMATION_OFF       = 1,    //!< Off\n       CAP_PVAPI_DECIMATION_2OUTOF4   = 2,    //!< 2 out of 4 decimation\n       CAP_PVAPI_DECIMATION_2OUTOF8   = 4,    //!< 2 out of 8 decimation\n       CAP_PVAPI_DECIMATION_2OUTOF16  = 8     //!< 2 out of 16 decimation\n     };\n\n//! PVAPI: PixelFormat\nenum { CAP_PVAPI_PIXELFORMAT_MONO8    = 1,    //!< Mono8\n       CAP_PVAPI_PIXELFORMAT_MONO16   = 2,    //!< Mono16\n       CAP_PVAPI_PIXELFORMAT_BAYER8   = 3,    //!< Bayer8\n       CAP_PVAPI_PIXELFORMAT_BAYER16  = 4,    //!< Bayer16\n       CAP_PVAPI_PIXELFORMAT_RGB24    = 5,    //!< Rgb24\n       CAP_PVAPI_PIXELFORMAT_BGR24    = 6,    //!< Bgr24\n       CAP_PVAPI_PIXELFORMAT_RGBA32   = 7,    //!< Rgba32\n       CAP_PVAPI_PIXELFORMAT_BGRA32   = 8,    //!< Bgra32\n     };\n\n//! @} PvAPI\n\n/** @name XIMEA Camera API\n    @{\n*/\n\n//! Properties of cameras available through XIMEA SDK backend\nenum { CAP_PROP_XI_DOWNSAMPLING                                 = 400, //!< Change image resolution by binning or skipping.\n       CAP_PROP_XI_DATA_FORMAT                                  = 401, //!< Output data format.\n       CAP_PROP_XI_OFFSET_X                                     = 402, //!< Horizontal offset from the origin to the area of interest (in pixels).\n       CAP_PROP_XI_OFFSET_Y                                     = 403, //!< Vertical offset from the origin to the area of interest (in pixels).\n       CAP_PROP_XI_TRG_SOURCE                                   = 404, //!< Defines source of trigger.\n       CAP_PROP_XI_TRG_SOFTWARE                                 = 405, //!< Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.\n       CAP_PROP_XI_GPI_SELECTOR                                 = 406, //!< Selects general purpose input.\n       CAP_PROP_XI_GPI_MODE                                     = 407, //!< Set general purpose input mode.\n       CAP_PROP_XI_GPI_LEVEL                                    = 408, //!< Get general purpose level.\n       CAP_PROP_XI_GPO_SELECTOR                                 = 409, //!< Selects general purpose output.\n       CAP_PROP_XI_GPO_MODE                                     = 410, //!< Set general purpose output mode.\n       CAP_PROP_XI_LED_SELECTOR                                 = 411, //!< Selects camera signalling LED.\n       CAP_PROP_XI_LED_MODE                                     = 412, //!< Define camera signalling LED functionality.\n       CAP_PROP_XI_MANUAL_WB                                    = 413, //!< Calculates White Balance(must be called during acquisition).\n       CAP_PROP_XI_AUTO_WB                                      = 414, //!< Automatic white balance.\n       CAP_PROP_XI_AEAG                                         = 415, //!< Automatic exposure/gain.\n       CAP_PROP_XI_EXP_PRIORITY                                 = 416, //!< Exposure priority (0.5 - exposure 50%, gain 50%).\n       CAP_PROP_XI_AE_MAX_LIMIT                                 = 417, //!< Maximum limit of exposure in AEAG procedure.\n       CAP_PROP_XI_AG_MAX_LIMIT                                 = 418, //!< Maximum limit of gain in AEAG procedure.\n       CAP_PROP_XI_AEAG_LEVEL                                   = 419, //!< Average intensity of output signal AEAG should achieve(in %).\n       CAP_PROP_XI_TIMEOUT                                      = 420, //!< Image capture timeout in milliseconds.\n       CAP_PROP_XI_EXPOSURE                                     = 421, //!< Exposure time in microseconds.\n       CAP_PROP_XI_EXPOSURE_BURST_COUNT                         = 422, //!< Sets the number of times of exposure in one frame.\n       CAP_PROP_XI_GAIN_SELECTOR                                = 423, //!< Gain selector for parameter Gain allows to select different type of gains.\n       CAP_PROP_XI_GAIN                                         = 424, //!< Gain in dB.\n       CAP_PROP_XI_DOWNSAMPLING_TYPE                            = 426, //!< Change image downsampling type.\n       CAP_PROP_XI_BINNING_SELECTOR                             = 427, //!< Binning engine selector.\n       CAP_PROP_XI_BINNING_VERTICAL                             = 428, //!< Vertical Binning - number of vertical photo-sensitive cells to combine together.\n       CAP_PROP_XI_BINNING_HORIZONTAL                           = 429, //!< Horizontal Binning - number of horizontal photo-sensitive cells to combine together.\n       CAP_PROP_XI_BINNING_PATTERN                              = 430, //!< Binning pattern type.\n       CAP_PROP_XI_DECIMATION_SELECTOR                          = 431, //!< Decimation engine selector.\n       CAP_PROP_XI_DECIMATION_VERTICAL                          = 432, //!< Vertical Decimation - vertical sub-sampling of the image - reduces the vertical resolution of the image by the specified vertical decimation factor.\n       CAP_PROP_XI_DECIMATION_HORIZONTAL                        = 433, //!< Horizontal Decimation - horizontal sub-sampling of the image - reduces the horizontal resolution of the image by the specified vertical decimation factor.\n       CAP_PROP_XI_DECIMATION_PATTERN                           = 434, //!< Decimation pattern type.\n       CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR              = 587, //!< Selects which test pattern generator is controlled by the TestPattern feature.\n       CAP_PROP_XI_TEST_PATTERN                                 = 588, //!< Selects which test pattern type is generated by the selected generator.\n       CAP_PROP_XI_IMAGE_DATA_FORMAT                            = 435, //!< Output data format.\n       CAP_PROP_XI_SHUTTER_TYPE                                 = 436, //!< Change sensor shutter type(CMOS sensor).\n       CAP_PROP_XI_SENSOR_TAPS                                  = 437, //!< Number of taps.\n       CAP_PROP_XI_AEAG_ROI_OFFSET_X                            = 439, //!< Automatic exposure/gain ROI offset X.\n       CAP_PROP_XI_AEAG_ROI_OFFSET_Y                            = 440, //!< Automatic exposure/gain ROI offset Y.\n       CAP_PROP_XI_AEAG_ROI_WIDTH                               = 441, //!< Automatic exposure/gain ROI Width.\n       CAP_PROP_XI_AEAG_ROI_HEIGHT                              = 442, //!< Automatic exposure/gain ROI Height.\n       CAP_PROP_XI_BPC                                          = 445, //!< Correction of bad pixels.\n       CAP_PROP_XI_WB_KR                                        = 448, //!< White balance red coefficient.\n       CAP_PROP_XI_WB_KG                                        = 449, //!< White balance green coefficient.\n       CAP_PROP_XI_WB_KB                                        = 450, //!< White balance blue coefficient.\n       CAP_PROP_XI_WIDTH                                        = 451, //!< Width of the Image provided by the device (in pixels).\n       CAP_PROP_XI_HEIGHT                                       = 452, //!< Height of the Image provided by the device (in pixels).\n       CAP_PROP_XI_REGION_SELECTOR                              = 589, //!< Selects Region in Multiple ROI which parameters are set by width, height, ... ,region mode.\n       CAP_PROP_XI_REGION_MODE                                  = 595, //!< Activates/deactivates Region selected by Region Selector.\n       CAP_PROP_XI_LIMIT_BANDWIDTH                              = 459, //!< Set/get bandwidth(datarate)(in Megabits).\n       CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH                        = 460, //!< Sensor output data bit depth.\n       CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH                        = 461, //!< Device output data bit depth.\n       CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH                         = 462, //!< bitdepth of data returned by function xiGetImage.\n       CAP_PROP_XI_OUTPUT_DATA_PACKING                          = 463, //!< Device output data packing (or grouping) enabled. Packing could be enabled if output_data_bit_depth > 8 and packing capability is available.\n       CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE                     = 464, //!< Data packing type. Some cameras supports only specific packing type.\n       CAP_PROP_XI_IS_COOLED                                    = 465, //!< Returns 1 for cameras that support cooling.\n       CAP_PROP_XI_COOLING                                      = 466, //!< Start camera cooling.\n       CAP_PROP_XI_TARGET_TEMP                                  = 467, //!< Set sensor target temperature for cooling.\n       CAP_PROP_XI_CHIP_TEMP                                    = 468, //!< Camera sensor temperature.\n       CAP_PROP_XI_HOUS_TEMP                                    = 469, //!< Camera housing temperature.\n       CAP_PROP_XI_HOUS_BACK_SIDE_TEMP                          = 590, //!< Camera housing back side temperature.\n       CAP_PROP_XI_SENSOR_BOARD_TEMP                            = 596, //!< Camera sensor board temperature.\n       CAP_PROP_XI_CMS                                          = 470, //!< Mode of color management system.\n       CAP_PROP_XI_APPLY_CMS                                    = 471, //!< Enable applying of CMS profiles to xiGetImage (see XI_PRM_INPUT_CMS_PROFILE, XI_PRM_OUTPUT_CMS_PROFILE).\n       CAP_PROP_XI_IMAGE_IS_COLOR                               = 474, //!< Returns 1 for color cameras.\n       CAP_PROP_XI_COLOR_FILTER_ARRAY                           = 475, //!< Returns color filter array type of RAW data.\n       CAP_PROP_XI_GAMMAY                                       = 476, //!< Luminosity gamma.\n       CAP_PROP_XI_GAMMAC                                       = 477, //!< Chromaticity gamma.\n       CAP_PROP_XI_SHARPNESS                                    = 478, //!< Sharpness Strength.\n       CAP_PROP_XI_CC_MATRIX_00                                 = 479, //!< Color Correction Matrix element [0][0].\n       CAP_PROP_XI_CC_MATRIX_01                                 = 480, //!< Color Correction Matrix element [0][1].\n       CAP_PROP_XI_CC_MATRIX_02                                 = 481, //!< Color Correction Matrix element [0][2].\n       CAP_PROP_XI_CC_MATRIX_03                                 = 482, //!< Color Correction Matrix element [0][3].\n       CAP_PROP_XI_CC_MATRIX_10                                 = 483, //!< Color Correction Matrix element [1][0].\n       CAP_PROP_XI_CC_MATRIX_11                                 = 484, //!< Color Correction Matrix element [1][1].\n       CAP_PROP_XI_CC_MATRIX_12                                 = 485, //!< Color Correction Matrix element [1][2].\n       CAP_PROP_XI_CC_MATRIX_13                                 = 486, //!< Color Correction Matrix element [1][3].\n       CAP_PROP_XI_CC_MATRIX_20                                 = 487, //!< Color Correction Matrix element [2][0].\n       CAP_PROP_XI_CC_MATRIX_21                                 = 488, //!< Color Correction Matrix element [2][1].\n       CAP_PROP_XI_CC_MATRIX_22                                 = 489, //!< Color Correction Matrix element [2][2].\n       CAP_PROP_XI_CC_MATRIX_23                                 = 490, //!< Color Correction Matrix element [2][3].\n       CAP_PROP_XI_CC_MATRIX_30                                 = 491, //!< Color Correction Matrix element [3][0].\n       CAP_PROP_XI_CC_MATRIX_31                                 = 492, //!< Color Correction Matrix element [3][1].\n       CAP_PROP_XI_CC_MATRIX_32                                 = 493, //!< Color Correction Matrix element [3][2].\n       CAP_PROP_XI_CC_MATRIX_33                                 = 494, //!< Color Correction Matrix element [3][3].\n       CAP_PROP_XI_DEFAULT_CC_MATRIX                            = 495, //!< Set default Color Correction Matrix.\n       CAP_PROP_XI_TRG_SELECTOR                                 = 498, //!< Selects the type of trigger.\n       CAP_PROP_XI_ACQ_FRAME_BURST_COUNT                        = 499, //!< Sets number of frames acquired by burst. This burst is used only if trigger is set to FrameBurstStart.\n       CAP_PROP_XI_DEBOUNCE_EN                                  = 507, //!< Enable/Disable debounce to selected GPI.\n       CAP_PROP_XI_DEBOUNCE_T0                                  = 508, //!< Debounce time (x * 10us).\n       CAP_PROP_XI_DEBOUNCE_T1                                  = 509, //!< Debounce time (x * 10us).\n       CAP_PROP_XI_DEBOUNCE_POL                                 = 510, //!< Debounce polarity (pol = 1 t0 - falling edge, t1 - rising edge).\n       CAP_PROP_XI_LENS_MODE                                    = 511, //!< Status of lens control interface. This shall be set to XI_ON before any Lens operations.\n       CAP_PROP_XI_LENS_APERTURE_VALUE                          = 512, //!< Current lens aperture value in stops. Examples: 2.8, 4, 5.6, 8, 11.\n       CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE                    = 513, //!< Lens current focus movement value to be used by XI_PRM_LENS_FOCUS_MOVE in motor steps.\n       CAP_PROP_XI_LENS_FOCUS_MOVE                              = 514, //!< Moves lens focus motor by steps set in XI_PRM_LENS_FOCUS_MOVEMENT_VALUE.\n       CAP_PROP_XI_LENS_FOCUS_DISTANCE                          = 515, //!< Lens focus distance in cm.\n       CAP_PROP_XI_LENS_FOCAL_LENGTH                            = 516, //!< Lens focal distance in mm.\n       CAP_PROP_XI_LENS_FEATURE_SELECTOR                        = 517, //!< Selects the current feature which is accessible by XI_PRM_LENS_FEATURE.\n       CAP_PROP_XI_LENS_FEATURE                                 = 518, //!< Allows access to lens feature value currently selected by XI_PRM_LENS_FEATURE_SELECTOR.\n       CAP_PROP_XI_DEVICE_MODEL_ID                              = 521, //!< Returns device model id.\n       CAP_PROP_XI_DEVICE_SN                                    = 522, //!< Returns device serial number.\n       CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA                = 529, //!< The alpha channel of RGB32 output image format.\n       CAP_PROP_XI_IMAGE_PAYLOAD_SIZE                           = 530, //!< Buffer size in bytes sufficient for output image returned by xiGetImage.\n       CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT                       = 531, //!< Current format of pixels on transport layer.\n       CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ                         = 532, //!< Sensor clock frequency in Hz.\n       CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX                      = 533, //!< Sensor clock frequency index. Sensor with selected frequencies have possibility to set the frequency only by this index.\n       CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT                  = 534, //!< Number of output channels from sensor used for data transfer.\n       CAP_PROP_XI_FRAMERATE                                    = 535, //!< Define framerate in Hz.\n       CAP_PROP_XI_COUNTER_SELECTOR                             = 536, //!< Select counter.\n       CAP_PROP_XI_COUNTER_VALUE                                = 537, //!< Counter status.\n       CAP_PROP_XI_ACQ_TIMING_MODE                              = 538, //!< Type of sensor frames timing.\n       CAP_PROP_XI_AVAILABLE_BANDWIDTH                          = 539, //!< Calculate and returns available interface bandwidth(int Megabits).\n       CAP_PROP_XI_BUFFER_POLICY                                = 540, //!< Data move policy.\n       CAP_PROP_XI_LUT_EN                                       = 541, //!< Activates LUT.\n       CAP_PROP_XI_LUT_INDEX                                    = 542, //!< Control the index (offset) of the coefficient to access in the LUT.\n       CAP_PROP_XI_LUT_VALUE                                    = 543, //!< Value at entry LUTIndex of the LUT.\n       CAP_PROP_XI_TRG_DELAY                                    = 544, //!< Specifies the delay in microseconds (us) to apply after the trigger reception before activating it.\n       CAP_PROP_XI_TS_RST_MODE                                  = 545, //!< Defines how time stamp reset engine will be armed.\n       CAP_PROP_XI_TS_RST_SOURCE                                = 546, //!< Defines which source will be used for timestamp reset. Writing this parameter will trigger settings of engine (arming).\n       CAP_PROP_XI_IS_DEVICE_EXIST                              = 547, //!< Returns 1 if camera connected and works properly.\n       CAP_PROP_XI_ACQ_BUFFER_SIZE                              = 548, //!< Acquisition buffer size in buffer_size_unit. Default bytes.\n       CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT                         = 549, //!< Acquisition buffer size unit in bytes. Default 1. E.g. Value 1024 means that buffer_size is in KiBytes.\n       CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE                    = 550, //!< Acquisition transport buffer size in bytes.\n       CAP_PROP_XI_BUFFERS_QUEUE_SIZE                           = 551, //!< Queue of field/frame buffers.\n       CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT                  = 552, //!< Number of buffers to commit to low level.\n       CAP_PROP_XI_RECENT_FRAME                                 = 553, //!< GetImage returns most recent frame.\n       CAP_PROP_XI_DEVICE_RESET                                 = 554, //!< Resets the camera to default state.\n       CAP_PROP_XI_COLUMN_FPN_CORRECTION                        = 555, //!< Correction of column FPN.\n       CAP_PROP_XI_ROW_FPN_CORRECTION                           = 591, //!< Correction of row FPN.\n       CAP_PROP_XI_SENSOR_MODE                                  = 558, //!< Current sensor mode. Allows to select sensor mode by one integer. Setting of this parameter affects: image dimensions and downsampling.\n       CAP_PROP_XI_HDR                                          = 559, //!< Enable High Dynamic Range feature.\n       CAP_PROP_XI_HDR_KNEEPOINT_COUNT                          = 560, //!< The number of kneepoints in the PWLR.\n       CAP_PROP_XI_HDR_T1                                       = 561, //!< Position of first kneepoint(in % of XI_PRM_EXPOSURE).\n       CAP_PROP_XI_HDR_T2                                       = 562, //!< Position of second kneepoint (in % of XI_PRM_EXPOSURE).\n       CAP_PROP_XI_KNEEPOINT1                                   = 563, //!< Value of first kneepoint (% of sensor saturation).\n       CAP_PROP_XI_KNEEPOINT2                                   = 564, //!< Value of second kneepoint (% of sensor saturation).\n       CAP_PROP_XI_IMAGE_BLACK_LEVEL                            = 565, //!< Last image black level counts. Can be used for Offline processing to recall it.\n       CAP_PROP_XI_HW_REVISION                                  = 571, //!< Returns hardware revision number.\n       CAP_PROP_XI_DEBUG_LEVEL                                  = 572, //!< Set debug level.\n       CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION                   = 573, //!< Automatic bandwidth calculation.\n       CAP_PROP_XI_FFS_FILE_ID                                  = 594, //!< File number.\n       CAP_PROP_XI_FFS_FILE_SIZE                                = 580, //!< Size of file.\n       CAP_PROP_XI_FREE_FFS_SIZE                                = 581, //!< Size of free camera FFS.\n       CAP_PROP_XI_USED_FFS_SIZE                                = 582, //!< Size of used camera FFS.\n       CAP_PROP_XI_FFS_ACCESS_KEY                               = 583, //!< Setting of key enables file operations on some cameras.\n       CAP_PROP_XI_SENSOR_FEATURE_SELECTOR                      = 585, //!< Selects the current feature which is accessible by XI_PRM_SENSOR_FEATURE_VALUE.\n       CAP_PROP_XI_SENSOR_FEATURE_VALUE                         = 586, //!< Allows access to sensor feature value currently selected by XI_PRM_SENSOR_FEATURE_SELECTOR.\n     };\n\n//! @} XIMEA\n\n\n/** @name ARAVIS Camera API\n    @{\n*/\n\n//! Properties of cameras available through ARAVIS backend\nenum { CAP_PROP_ARAVIS_AUTOTRIGGER                              = 600 //!< Automatically trigger frame capture if camera is configured with software trigger\n};\n\n//! @} ARAVIS\n\n/** @name AVFoundation framework for iOS\n    @{\n*/\n\n//! Properties of cameras available through AVFOUNDATION backend\nenum { CAP_PROP_IOS_DEVICE_FOCUS        = 9001,\n       CAP_PROP_IOS_DEVICE_EXPOSURE     = 9002,\n       CAP_PROP_IOS_DEVICE_FLASH        = 9003,\n       CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,\n       CAP_PROP_IOS_DEVICE_TORCH        = 9005\n     };\n\n//! @} AVFoundation framework for iOS\n\n\n/** @name Smartek Giganetix GigEVisionSDK\n    @{\n*/\n\n//! Properties of cameras available through Smartek Giganetix Ethernet Vision backend\n/* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */\nenum { CAP_PROP_GIGA_FRAME_OFFSET_X   = 10001,\n       CAP_PROP_GIGA_FRAME_OFFSET_Y   = 10002,\n       CAP_PROP_GIGA_FRAME_WIDTH_MAX  = 10003,\n       CAP_PROP_GIGA_FRAME_HEIGH_MAX  = 10004,\n       CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,\n       CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006\n     };\n\n//! @} Smartek\n\n/** @name Intel Perceptual Computing SDK\n    @{\n*/\nenum { CAP_PROP_INTELPERC_PROFILE_COUNT               = 11001,\n       CAP_PROP_INTELPERC_PROFILE_IDX                 = 11002,\n       CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE  = 11003,\n       CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE      = 11004,\n       CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD  = 11005,\n       CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ     = 11006,\n       CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT     = 11007\n     };\n\n//! Intel Perceptual Streams\nenum { CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29,\n       CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28,\n       CAP_INTELPERC_IR_GENERATOR    = 1 << 27,\n       CAP_INTELPERC_GENERATORS_MASK = CAP_INTELPERC_DEPTH_GENERATOR + CAP_INTELPERC_IMAGE_GENERATOR + CAP_INTELPERC_IR_GENERATOR\n     };\n\nenum { CAP_INTELPERC_DEPTH_MAP              = 0, //!< Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth.\n       CAP_INTELPERC_UVDEPTH_MAP            = 1, //!< Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates.\n       CAP_INTELPERC_IR_MAP                 = 2, //!< Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.\n       CAP_INTELPERC_IMAGE                  = 3\n     };\n\n//! @} Intel Perceptual\n\n/** @name gPhoto2 connection\n    @{\n*/\n\n/** @brief gPhoto2 properties\n\nIf `propertyId` is less than 0 then work on widget with that __additive inversed__ camera setting ID\nGet IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE.\n@see CvCaptureCAM_GPHOTO2 for more info\n*/\nenum { CAP_PROP_GPHOTO2_PREVIEW           = 17001, //!< Capture only preview from liveview mode.\n       CAP_PROP_GPHOTO2_WIDGET_ENUMERATE  = 17002, //!< Readonly, returns (const char *).\n       CAP_PROP_GPHOTO2_RELOAD_CONFIG     = 17003, //!< Trigger, only by set. Reload camera settings.\n       CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE  = 17004, //!< Reload all settings on set.\n       CAP_PROP_GPHOTO2_COLLECT_MSGS      = 17005, //!< Collect messages with details.\n       CAP_PROP_GPHOTO2_FLUSH_MSGS        = 17006, //!< Readonly, returns (const char *).\n       CAP_PROP_SPEED                     = 17007, //!< Exposure speed. Can be readonly, depends on camera program.\n       CAP_PROP_APERTURE                  = 17008, //!< Aperture. Can be readonly, depends on camera program.\n       CAP_PROP_EXPOSUREPROGRAM           = 17009, //!< Camera exposure program.\n       CAP_PROP_VIEWFINDER                = 17010  //!< Enter liveview mode.\n     };\n\n//! @} gPhoto2\n\n\n/** @name Images backend\n    @{\n*/\n\n/** @brief Images backend properties\n\n*/\nenum { CAP_PROP_IMAGES_BASE = 18000,\n       CAP_PROP_IMAGES_LAST = 19000 // excluding\n     };\n\n//! @} Images\n\n//! @} videoio_flags_others\n\n\nclass IVideoCapture;\n//! @cond IGNORED\nnamespace internal { class VideoCapturePrivateAccessor; }\n//! @endcond IGNORED\n\n/** @brief Class for video capturing from video files, image sequences or cameras.\n\nThe class provides C++ API for capturing video from cameras or for reading video files and image sequences.\n\nHere is how the class can be used:\n@include samples/cpp/videocapture_basic.cpp\n\n@note In @ref videoio_c \"C API\" the black-box structure `CvCapture` is used instead of %VideoCapture.\n@note\n-   (C++) A basic sample on using the %VideoCapture interface can be found at\n    `OPENCV_SOURCE_CODE/samples/cpp/videocapture_starter.cpp`\n-   (Python) A basic sample on using the %VideoCapture interface can be found at\n    `OPENCV_SOURCE_CODE/samples/python/video.py`\n-   (Python) A multi threaded video processing sample can be found at\n    `OPENCV_SOURCE_CODE/samples/python/video_threaded.py`\n-   (Python) %VideoCapture sample showcasing some features of the Video4Linux2 backend\n    `OPENCV_SOURCE_CODE/samples/python/video_v4l2.py`\n */\nclass CV_EXPORTS_W VideoCapture\n{\npublic:\n    /** @brief Default constructor\n    @note In @ref videoio_c \"C API\", when you finished working with video, release CvCapture structure with\n    cvReleaseCapture(), or use Ptr\\<CvCapture\\> that calls cvReleaseCapture() automatically in the\n    destructor.\n     */\n    CV_WRAP VideoCapture();\n\n    /** @overload\n    @brief  Opens a video file or a capturing device or an IP video stream for video capturing with API Preference\n\n    @param filename it can be:\n    - name of video file (eg. `video.avi`)\n    - or image sequence (eg. `img_%02d.jpg`, which will read samples like `img_00.jpg, img_01.jpg, img_02.jpg, ...`)\n    - or URL of video stream (eg. `protocol://host:port/script_name?script_params|auth`)\n    - or GStreamer pipeline string in gst-launch tool format in case if GStreamer is used as backend\n      Note that each video stream or IP camera feed has its own URL scheme. Please refer to the\n      documentation of source stream to know the right URL.\n    @param apiPreference preferred Capture API backends to use. Can be used to enforce a specific reader\n    implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW.\n\n    @sa cv::VideoCaptureAPIs\n    */\n    CV_WRAP explicit VideoCapture(const String& filename, int apiPreference = CAP_ANY);\n\n    /** @overload\n    @brief Opens a video file or a capturing device or an IP video stream for video capturing with API Preference and parameters\n\n    The `params` parameter allows to specify extra parameters encoded as pairs `(paramId_1, paramValue_1, paramId_2, paramValue_2, ...)`.\n    See cv::VideoCaptureProperties\n    */\n    CV_WRAP explicit VideoCapture(const String& filename, int apiPreference, const std::vector<int>& params);\n\n    /** @overload\n    @brief  Opens a camera for video capturing\n\n    @param index id of the video capturing device to open. To open default camera using default backend just pass 0.\n    (to backward compatibility usage of camera_id + domain_offset (CAP_*) is valid when apiPreference is CAP_ANY)\n    @param apiPreference preferred Capture API backends to use. Can be used to enforce a specific reader\n    implementation if multiple are available: e.g. cv::CAP_DSHOW or cv::CAP_MSMF or cv::CAP_V4L.\n\n    @sa cv::VideoCaptureAPIs\n    */\n    CV_WRAP explicit VideoCapture(int index, int apiPreference = CAP_ANY);\n\n    /** @overload\n    @brief Opens a camera for video capturing with API Preference and parameters\n\n    The `params` parameter allows to specify extra parameters encoded as pairs `(paramId_1, paramValue_1, paramId_2, paramValue_2, ...)`.\n    See cv::VideoCaptureProperties\n    */\n    CV_WRAP explicit VideoCapture(int index, int apiPreference, const std::vector<int>& params);\n\n    /** @brief Default destructor\n\n    The method first calls VideoCapture::release to close the already opened file or camera.\n    */\n    virtual ~VideoCapture();\n\n    /** @brief  Opens a video file or a capturing device or an IP video stream for video capturing.\n\n    @overload\n\n    Parameters are same as the constructor VideoCapture(const String& filename, int apiPreference = CAP_ANY)\n    @return `true` if the file has been successfully opened\n\n    The method first calls VideoCapture::release to close the already opened file or camera.\n     */\n    CV_WRAP virtual bool open(const String& filename, int apiPreference = CAP_ANY);\n\n    /** @brief  Opens a camera for video capturing\n\n    @overload\n\n    The `params` parameter allows to specify extra parameters encoded as pairs `(paramId_1, paramValue_1, paramId_2, paramValue_2, ...)`.\n    See cv::VideoCaptureProperties\n\n    @return `true` if the file has been successfully opened\n\n    The method first calls VideoCapture::release to close the already opened file or camera.\n     */\n    CV_WRAP virtual bool open(const String& filename, int apiPreference, const std::vector<int>& params);\n\n    /** @brief  Opens a camera for video capturing\n\n    @overload\n\n    Parameters are same as the constructor VideoCapture(int index, int apiPreference = CAP_ANY)\n    @return `true` if the camera has been successfully opened.\n\n    The method first calls VideoCapture::release to close the already opened file or camera.\n    */\n    CV_WRAP virtual bool open(int index, int apiPreference = CAP_ANY);\n\n    /** @brief Returns true if video capturing has been initialized already.\n\n    @overload\n\n    The `params` parameter allows to specify extra parameters encoded as pairs `(paramId_1, paramValue_1, paramId_2, paramValue_2, ...)`.\n    See cv::VideoCaptureProperties\n\n    @return `true` if the camera has been successfully opened.\n\n    The method first calls VideoCapture::release to close the already opened file or camera.\n    */\n    CV_WRAP virtual bool open(int index, int apiPreference, const std::vector<int>& params);\n\n    /** @brief Returns true if video capturing has been initialized already.\n\n    If the previous call to VideoCapture constructor or VideoCapture::open() succeeded, the method returns\n    true.\n     */\n    CV_WRAP virtual bool isOpened() const;\n\n    /** @brief Closes video file or capturing device.\n\n    The method is automatically called by subsequent VideoCapture::open and by VideoCapture\n    destructor.\n\n    The C function also deallocates memory and clears \\*capture pointer.\n     */\n    CV_WRAP virtual void release();\n\n    /** @brief Grabs the next frame from video file or capturing device.\n\n    @return `true` (non-zero) in the case of success.\n\n    The method/function grabs the next frame from video file or camera and returns true (non-zero) in\n    the case of success.\n\n    The primary use of the function is in multi-camera environments, especially when the cameras do not\n    have hardware synchronization. That is, you call VideoCapture::grab() for each camera and after that\n    call the slower method VideoCapture::retrieve() to decode and get frame from each camera. This way\n    the overhead on demosaicing or motion jpeg decompression etc. is eliminated and the retrieved frames\n    from different cameras will be closer in time.\n\n    Also, when a connected camera is multi-head (for example, a stereo camera or a Kinect device), the\n    correct way of retrieving data from it is to call VideoCapture::grab() first and then call\n    VideoCapture::retrieve() one or more times with different values of the channel parameter.\n\n    @ref tutorial_kinect_openni\n     */\n    CV_WRAP virtual bool grab();\n\n    /** @brief Decodes and returns the grabbed video frame.\n\n    @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty.\n    @param flag it could be a frame index or a driver specific flag\n    @return `false` if no frames has been grabbed\n\n    The method decodes and returns the just grabbed frame. If no frames has been grabbed\n    (camera has been disconnected, or there are no more frames in video file), the method returns false\n    and the function returns an empty image (with %cv::Mat, test it with Mat::empty()).\n\n    @sa read()\n\n    @note In @ref videoio_c \"C API\", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video\n    capturing structure. It is not allowed to modify or release the image! You can copy the frame using\n    cvCloneImage and then do whatever you want with the copy.\n     */\n    CV_WRAP virtual bool retrieve(OutputArray image, int flag = 0);\n\n    /** @brief Stream operator to read the next video frame.\n    @sa read()\n    */\n    virtual VideoCapture& operator >> (CV_OUT Mat& image);\n\n    /** @overload\n    @sa read()\n    */\n    virtual VideoCapture& operator >> (CV_OUT UMat& image);\n\n    /** @brief Grabs, decodes and returns the next video frame.\n\n    @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty.\n    @return `false` if no frames has been grabbed\n\n    The method/function combines VideoCapture::grab() and VideoCapture::retrieve() in one call. This is the\n    most convenient method for reading video files or capturing data from decode and returns the just\n    grabbed frame. If no frames has been grabbed (camera has been disconnected, or there are no more\n    frames in video file), the method returns false and the function returns empty image (with %cv::Mat, test it with Mat::empty()).\n\n    @note In @ref videoio_c \"C API\", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video\n    capturing structure. It is not allowed to modify or release the image! You can copy the frame using\n    cvCloneImage and then do whatever you want with the copy.\n     */\n    CV_WRAP virtual bool read(OutputArray image);\n\n    /** @brief Sets a property in the VideoCapture.\n\n    @param propId Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...)\n    or one from @ref videoio_flags_others\n    @param value Value of the property.\n    @return `true` if the property is supported by backend used by the VideoCapture instance.\n    @note Even if it returns `true` this doesn't ensure that the property\n    value has been accepted by the capture device. See note in VideoCapture::get()\n     */\n    CV_WRAP virtual bool set(int propId, double value);\n\n    /** @brief Returns the specified VideoCapture property\n\n    @param propId Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...)\n    or one from @ref videoio_flags_others\n    @return Value for the specified property. Value 0 is returned when querying a property that is\n    not supported by the backend used by the VideoCapture instance.\n\n    @note Reading / writing properties involves many layers. Some unexpected result might happens\n    along this chain.\n    @code{.txt}\n    VideoCapture -> API Backend -> Operating System -> Device Driver -> Device Hardware\n    @endcode\n    The returned value might be different from what really used by the device or it could be encoded\n    using device dependent rules (eg. steps or percentage). Effective behaviour depends from device\n    driver and API Backend\n\n    */\n    CV_WRAP virtual double get(int propId) const;\n\n    /** @brief Returns used backend API name\n\n     @note Stream should be opened.\n     */\n    CV_WRAP String getBackendName() const;\n\n    /** Switches exceptions mode\n     *\n     * methods raise exceptions if not successful instead of returning an error code\n     */\n    CV_WRAP void setExceptionMode(bool enable) { throwOnFail = enable; }\n\n    /// query if exception mode is active\n    CV_WRAP bool getExceptionMode() { return throwOnFail; }\n\n\n    /** @brief Wait for ready frames from VideoCapture.\n\n    @param streams input video streams\n    @param readyIndex stream indexes with grabbed frames (ready to use .retrieve() to fetch actual frame)\n    @param timeoutNs number of nanoseconds (0 - infinite)\n    @return `true` if streamReady is not empty\n\n    @throws Exception %Exception on stream errors (check .isOpened() to filter out malformed streams) or VideoCapture type is not supported\n\n    The primary use of the function is in multi-camera environments.\n    The method fills the ready state vector, grabs video frame, if camera is ready.\n\n    After this call use VideoCapture::retrieve() to decode and fetch frame data.\n    */\n    static /*CV_WRAP*/\n    bool waitAny(\n            const std::vector<VideoCapture>& streams,\n            CV_OUT std::vector<int>& readyIndex,\n            int64 timeoutNs = 0);\n\nprotected:\n    Ptr<CvCapture> cap;\n    Ptr<IVideoCapture> icap;\n    bool throwOnFail;\n\n    friend class internal::VideoCapturePrivateAccessor;\n};\n\nclass IVideoWriter;\n\n/** @example samples/cpp/tutorial_code/videoio/video-write/video-write.cpp\nCheck @ref tutorial_video_write \"the corresponding tutorial\" for more details\n*/\n\n/** @example samples/cpp/videowriter_basic.cpp\nAn example using VideoCapture and VideoWriter class\n*/\n\n/** @brief Video writer class.\n\nThe class provides C++ API for writing video files or image sequences.\n*/\nclass CV_EXPORTS_W VideoWriter\n{\npublic:\n    /** @brief Default constructors\n\n    The constructors/functions initialize video writers.\n    -   On Linux FFMPEG is used to write videos;\n    -   On Windows FFMPEG or MSWF or DSHOW is used;\n    -   On MacOSX AVFoundation is used.\n     */\n    CV_WRAP VideoWriter();\n\n    /** @overload\n    @param filename Name of the output video file.\n    @param fourcc 4-character code of codec used to compress the frames. For example,\n    VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a\n    motion-jpeg codec etc. List of codes can be obtained at [Video Codecs by\n    FOURCC](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses\n    other values as fourcc code: see [ObjectType](http://mp4ra.org/#/codecs),\n    so you may receive a warning message from OpenCV about fourcc code conversion.\n    @param fps Framerate of the created video stream.\n    @param frameSize Size of the video frames.\n    @param isColor If it is not zero, the encoder will expect and encode color frames, otherwise it\n    will work with grayscale frames.\n\n    @b Tips:\n    - With some backends `fourcc=-1` pops up the codec selection dialog from the system.\n    - To save image sequence use a proper filename (eg. `img_%02d.jpg`) and `fourcc=0`\n      OR `fps=0`. Use uncompressed image format (eg. `img_%02d.BMP`) to save raw frames.\n    - Most codecs are lossy. If you want lossless video file you need to use a lossless codecs\n      (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)\n    - If FFMPEG is enabled, using `codec=0; fps=0;` you can create an uncompressed (raw) video file.\n    */\n    CV_WRAP VideoWriter(const String& filename, int fourcc, double fps,\n                Size frameSize, bool isColor = true);\n\n    /** @overload\n    The `apiPreference` parameter allows to specify API backends to use. Can be used to enforce a specific reader implementation\n    if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_GSTREAMER.\n     */\n    CV_WRAP VideoWriter(const String& filename, int apiPreference, int fourcc, double fps,\n                Size frameSize, bool isColor = true);\n\n    /** @overload\n     * The `params` parameter allows to specify extra encoder parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .)\n     * see cv::VideoWriterProperties\n     */\n    CV_WRAP VideoWriter(const String& filename, int fourcc, double fps, const Size& frameSize,\n                        const std::vector<int>& params);\n\n    /** @overload\n     */\n    CV_WRAP VideoWriter(const String& filename, int apiPreference, int fourcc, double fps,\n                        const Size& frameSize, const std::vector<int>& params);\n\n    /** @brief Default destructor\n\n    The method first calls VideoWriter::release to close the already opened file.\n    */\n    virtual ~VideoWriter();\n\n    /** @brief Initializes or reinitializes video writer.\n\n    The method opens video writer. Parameters are the same as in the constructor\n    VideoWriter::VideoWriter.\n    @return `true` if video writer has been successfully initialized\n\n    The method first calls VideoWriter::release to close the already opened file.\n     */\n    CV_WRAP virtual bool open(const String& filename, int fourcc, double fps,\n                      Size frameSize, bool isColor = true);\n\n    /** @overload\n     */\n    CV_WRAP bool open(const String& filename, int apiPreference, int fourcc, double fps,\n                      Size frameSize, bool isColor = true);\n\n    /** @overload\n     */\n    CV_WRAP bool open(const String& filename, int fourcc, double fps, const Size& frameSize,\n                      const std::vector<int>& params);\n\n    /** @overload\n     */\n    CV_WRAP bool open(const String& filename, int apiPreference, int fourcc, double fps,\n                      const Size& frameSize, const std::vector<int>& params);\n\n    /** @brief Returns true if video writer has been successfully initialized.\n    */\n    CV_WRAP virtual bool isOpened() const;\n\n    /** @brief Closes the video writer.\n\n    The method is automatically called by subsequent VideoWriter::open and by the VideoWriter\n    destructor.\n     */\n    CV_WRAP virtual void release();\n\n    /** @brief Stream operator to write the next video frame.\n    @sa write\n    */\n    virtual VideoWriter& operator << (const Mat& image);\n\n    /** @overload\n    @sa write\n    */\n    virtual VideoWriter& operator << (const UMat& image);\n\n    /** @brief Writes the next video frame\n\n    @param image The written frame. In general, color images are expected in BGR format.\n\n    The function/method writes the specified image to video file. It must have the same size as has\n    been specified when opening the video writer.\n     */\n    CV_WRAP virtual void write(InputArray image);\n\n    /** @brief Sets a property in the VideoWriter.\n\n     @param propId Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY)\n     or one of @ref videoio_flags_others\n\n     @param value Value of the property.\n     @return  `true` if the property is supported by the backend used by the VideoWriter instance.\n     */\n    CV_WRAP virtual bool set(int propId, double value);\n\n    /** @brief Returns the specified VideoWriter property\n\n     @param propId Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY)\n     or one of @ref videoio_flags_others\n\n     @return Value for the specified property. Value 0 is returned when querying a property that is\n     not supported by the backend used by the VideoWriter instance.\n     */\n    CV_WRAP virtual double get(int propId) const;\n\n    /** @brief Concatenates 4 chars to a fourcc code\n\n    @return a fourcc code\n\n    This static method constructs the fourcc code of the codec to be used in the constructor\n    VideoWriter::VideoWriter or VideoWriter::open.\n     */\n    CV_WRAP static int fourcc(char c1, char c2, char c3, char c4);\n\n    /** @brief Returns used backend API name\n\n     @note Stream should be opened.\n     */\n    CV_WRAP String getBackendName() const;\n\nprotected:\n    Ptr<CvVideoWriter> writer;\n    Ptr<IVideoWriter> iwriter;\n\n    static Ptr<IVideoWriter> create(const String& filename, int fourcc, double fps,\n                                    Size frameSize, bool isColor = true);\n};\n\n//! @cond IGNORED\ntemplate<> struct DefaultDeleter<CvCapture>{ CV_EXPORTS void operator ()(CvCapture* obj) const; };\ntemplate<> struct DefaultDeleter<CvVideoWriter>{ CV_EXPORTS void operator ()(CvVideoWriter* obj) const; };\n//! @endcond IGNORED\n\n//! @} videoio\n\n} // cv\n\n#endif //OPENCV_VIDEOIO_HPP\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/lib64/cmake/opencv4/OpenCVConfig-version.cmake",
    "content": "set(OpenCV_VERSION 4.5.3)\nset(PACKAGE_VERSION ${OpenCV_VERSION})\n\nset(PACKAGE_VERSION_EXACT False)\nset(PACKAGE_VERSION_COMPATIBLE False)\n\nif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)\n  set(PACKAGE_VERSION_EXACT True)\n  set(PACKAGE_VERSION_COMPATIBLE True)\nendif()\n\nif(PACKAGE_FIND_VERSION_MAJOR EQUAL 4\n   AND PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION)\n  set(PACKAGE_VERSION_COMPATIBLE True)\nendif()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/lib64/cmake/opencv4/OpenCVConfig.cmake",
    "content": "# ===================================================================================\n#  The OpenCV CMake configuration file\n#\n#             ** File generated automatically, do not modify **\n#\n#  Usage from an external project:\n#    In your CMakeLists.txt, add these lines:\n#\n#    find_package(OpenCV REQUIRED)\n#    include_directories(${OpenCV_INCLUDE_DIRS}) # Not needed for CMake >= 2.8.11\n#    target_link_libraries(MY_TARGET_NAME ${OpenCV_LIBS})\n#\n#    Or you can search for specific OpenCV modules:\n#\n#    find_package(OpenCV REQUIRED core videoio)\n#\n#    You can also mark OpenCV components as optional:\n\n#    find_package(OpenCV REQUIRED core OPTIONAL_COMPONENTS viz)\n#\n#    If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.\n#\n#    This file will define the following variables:\n#      - OpenCV_LIBS                     : The list of all imported targets for OpenCV modules.\n#      - OpenCV_INCLUDE_DIRS             : The OpenCV include directories.\n#      - OpenCV_COMPUTE_CAPABILITIES     : The version of compute capability.\n#      - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API.\n#      - OpenCV_VERSION                  : The version of this OpenCV build: \"4.5.3\"\n#      - OpenCV_VERSION_MAJOR            : Major version part of OpenCV_VERSION: \"4\"\n#      - OpenCV_VERSION_MINOR            : Minor version part of OpenCV_VERSION: \"5\"\n#      - OpenCV_VERSION_PATCH            : Patch version part of OpenCV_VERSION: \"3\"\n#      - OpenCV_VERSION_STATUS           : Development status of this build: \"\"\n#\n#    Advanced variables:\n#      - OpenCV_SHARED                   : Use OpenCV as shared library\n#      - OpenCV_INSTALL_PATH             : OpenCV location\n#      - OpenCV_LIB_COMPONENTS           : Present OpenCV modules list\n#      - OpenCV_USE_MANGLED_PATHS        : Mangled OpenCV path flag\n#\n#    Deprecated variables:\n#      - OpenCV_VERSION_TWEAK            : Always \"0\"\n#\n# ===================================================================================\n\n# ======================================================\n#  Version variables:\n# ======================================================\nSET(OpenCV_VERSION 4.5.3)\nSET(OpenCV_VERSION_MAJOR  4)\nSET(OpenCV_VERSION_MINOR  5)\nSET(OpenCV_VERSION_PATCH  3)\nSET(OpenCV_VERSION_TWEAK  0)\nSET(OpenCV_VERSION_STATUS \"\")\n\ninclude(FindPackageHandleStandardArgs)\n\nif(NOT CMAKE_VERSION VERSION_LESS 2.8.8\n    AND OpenCV_FIND_COMPONENTS  # prevent excessive output\n)\n  # HANDLE_COMPONENTS was introduced in CMake 2.8.8\n  list(APPEND _OpenCV_FPHSA_ARGS HANDLE_COMPONENTS)\n  # The missing components will be handled by the FindPackageHandleStandardArgs\n  # module.\n  set(_OpenCV_HANDLE_COMPONENTS_MANUALLY FALSE)\nelse()\n  # The missing components will be handled by this config.\n  set(_OpenCV_HANDLE_COMPONENTS_MANUALLY TRUE)\nendif()\n\n# Extract directory name from full path of the file currently being processed.\n# Note that CMake 2.8.3 introduced CMAKE_CURRENT_LIST_DIR. We reimplement it\n# for older versions of CMake to support these as well.\nif(CMAKE_VERSION VERSION_LESS \"2.8.3\")\n  get_filename_component(CMAKE_CURRENT_LIST_DIR \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\nendif()\n\n# Extract the directory where *this* file has been installed (determined at cmake run-time)\n# Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings\nget_filename_component(OpenCV_CONFIG_PATH \"${CMAKE_CURRENT_LIST_DIR}\" REALPATH)\nget_filename_component(OpenCV_INSTALL_PATH \"${OpenCV_CONFIG_PATH}/../../../\" REALPATH)\n\n# Search packages for host system instead of packages for target system.\n# in case of cross compilation this macro should be defined by toolchain file\nif(NOT COMMAND find_host_package)\n    macro(find_host_package)\n        find_package(${ARGN})\n    endmacro()\nendif()\nif(NOT COMMAND find_host_program)\n    macro(find_host_program)\n        find_program(${ARGN})\n    endmacro()\nendif()\n\n\n\n\n\n\n\n\n# Some additional settings are required if OpenCV is built as static libs\nset(OpenCV_SHARED ON)\n\n# Enables mangled install paths, that help with side by side installs\nset(OpenCV_USE_MANGLED_PATHS FALSE)\n\nset(OpenCV_LIB_COMPONENTS opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio)\nset(__OpenCV_INCLUDE_DIRS \"${OpenCV_INSTALL_PATH}/include/opencv4\")\n\nset(OpenCV_INCLUDE_DIRS \"\")\nforeach(d ${__OpenCV_INCLUDE_DIRS})\n  get_filename_component(__d \"${d}\" REALPATH)\n  if(NOT EXISTS \"${__d}\")\n    if(NOT OpenCV_FIND_QUIETLY)\n      message(WARNING \"OpenCV: Include directory doesn't exist: '${d}'. OpenCV installation may be broken. Skip...\")\n    endif()\n  else()\n    list(APPEND OpenCV_INCLUDE_DIRS \"${__d}\")\n  endif()\nendforeach()\nunset(__d)\n\n\nif(NOT TARGET opencv_core)\n  include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${OpenCV_MODULES_SUFFIX}.cmake)\nendif()\n\nif(NOT CMAKE_VERSION VERSION_LESS \"2.8.11\")\n  # Target property INTERFACE_INCLUDE_DIRECTORIES available since 2.8.11:\n  # * http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:INTERFACE_INCLUDE_DIRECTORIES\n  foreach(__component ${OpenCV_LIB_COMPONENTS})\n    if(TARGET ${__component})\n      set_target_properties(\n          ${__component}\n          PROPERTIES\n          INTERFACE_INCLUDE_DIRECTORIES \"${OpenCV_INCLUDE_DIRS}\"\n      )\n    endif()\n  endforeach()\nendif()\n\n\nif(NOT DEFINED OPENCV_MAP_IMPORTED_CONFIG)\n  if(CMAKE_GENERATOR MATCHES \"Visual Studio\" OR MSVC)\n    # OpenCV supports Debug and Release builds only.\n    # But MSVS has 'RelWithDebInfo' 'MinSizeRel' configurations for applications.\n    # By default CMake maps these configuration on the first available (Debug) which is wrong.\n    # Non-Debug build of Application can't be used with OpenCV Debug build (ABI mismatch problem)\n    # Add mapping of RelWithDebInfo and MinSizeRel to Release here\n    set(OPENCV_MAP_IMPORTED_CONFIG \"RELWITHDEBINFO=!Release;MINSIZEREL=!Release\")\n  endif()\nendif()\nset(__remap_warnings \"\")\nmacro(ocv_map_imported_config target)\n  if(DEFINED OPENCV_MAP_IMPORTED_CONFIG) # list, \"RELWITHDEBINFO=Release;MINSIZEREL=Release\"\n    get_target_property(__available_configurations ${target} IMPORTED_CONFIGURATIONS)\n    foreach(remap ${OPENCV_MAP_IMPORTED_CONFIG})\n      if(remap MATCHES \"^(.+)=(!?)([^!]+)$\")\n        set(__remap_config \"${CMAKE_MATCH_1}\")\n        set(__final_config \"${CMAKE_MATCH_3}\")\n        set(__force_flag \"${CMAKE_MATCH_2}\")\n        string(TOUPPER \"${__final_config}\" __final_config_upper)\n        string(TOUPPER \"${__remap_config}\" __remap_config_upper)\n        if(\";${__available_configurations};\" MATCHES \";${__remap_config_upper};\" AND NOT \"${__force_flag}\" STREQUAL \"!\")\n          # configuration already exists, skip remap\n          set(__remap_warnings \"${__remap_warnings}... Configuration already exists ${__remap_config} (skip mapping ${__remap_config} => ${__final_config}) (available configurations: ${__available_configurations})\\n\")\n          continue()\n        endif()\n        if(__available_configurations AND NOT \";${__available_configurations};\" MATCHES \";${__final_config_upper};\")\n          # skip, configuration is not available\n          if(NOT \"${__force_flag}\" STREQUAL \"!\")\n            set(__remap_warnings \"${__remap_warnings}... Configuration is not available '${__final_config}' for ${target}, build may fail (available configurations: ${__available_configurations})\\n\")\n          endif()\n        endif()\n        set_target_properties(${target} PROPERTIES\n            MAP_IMPORTED_CONFIG_${__remap_config} \"${__final_config}\"\n        )\n      else()\n        message(WARNING \"Invalid entry of OPENCV_MAP_IMPORTED_CONFIG: '${remap}' (${OPENCV_MAP_IMPORTED_CONFIG})\")\n      endif()\n    endforeach()\n  endif()\nendmacro()\n\n\n# ==============================================================\n#  Form list of modules (components) to find\n# ==============================================================\nif(NOT OpenCV_FIND_COMPONENTS)\n  set(OpenCV_FIND_COMPONENTS ${OpenCV_LIB_COMPONENTS})\n  list(REMOVE_ITEM OpenCV_FIND_COMPONENTS opencv_java)\n  if(GTest_FOUND OR GTEST_FOUND)\n    list(REMOVE_ITEM OpenCV_FIND_COMPONENTS opencv_ts)\n  endif()\nendif()\n\nset(OpenCV_WORLD_COMPONENTS )\n\n# expand short module names and see if requested components exist\nforeach(__cvcomponent ${OpenCV_FIND_COMPONENTS})\n  # Store the name of the original component so we can set the\n  # OpenCV_<component>_FOUND variable which can be checked by the user.\n  set (__original_cvcomponent ${__cvcomponent})\n  if(NOT __cvcomponent MATCHES \"^opencv_\")\n    set(__cvcomponent opencv_${__cvcomponent})\n  endif()\n  list(FIND OpenCV_LIB_COMPONENTS ${__cvcomponent} __cvcomponentIdx)\n  if(__cvcomponentIdx LESS 0)\n    if(_OpenCV_HANDLE_COMPONENTS_MANUALLY)\n      # Either the component is required or the user did not set any components at\n      # all. In the latter case, the OpenCV_FIND_REQUIRED_<component> variable\n      # will not be defined since it is not set by this config. So let's assume\n      # the implicitly set components are always required.\n      if(NOT DEFINED OpenCV_FIND_REQUIRED_${__original_cvcomponent} OR\n          OpenCV_FIND_REQUIRED_${__original_cvcomponent})\n        message(FATAL_ERROR \"${__cvcomponent} is required but was not found\")\n      elseif(NOT OpenCV_FIND_QUIETLY)\n        # The component was marked as optional using OPTIONAL_COMPONENTS\n        message(WARNING \"Optional component ${__cvcomponent} was not found\")\n      endif()\n    endif(_OpenCV_HANDLE_COMPONENTS_MANUALLY)\n    #indicate that module is NOT found\n    string(TOUPPER \"${__cvcomponent}\" __cvcomponentUP)\n    set(${__cvcomponentUP}_FOUND \"${__cvcomponentUP}_FOUND-NOTFOUND\")\n    set(OpenCV_${__original_cvcomponent}_FOUND FALSE)\n  else()\n    # Not using list(APPEND) here, because OpenCV_LIBS may not exist yet.\n    # Also not clearing OpenCV_LIBS anywhere, so that multiple calls\n    # to find_package(OpenCV) with different component lists add up.\n    set(OpenCV_LIBS ${OpenCV_LIBS} \"${__cvcomponent}\")\n    #indicate that module is found\n    string(TOUPPER \"${__cvcomponent}\" __cvcomponentUP)\n    set(${__cvcomponentUP}_FOUND 1)\n    set(OpenCV_${__original_cvcomponent}_FOUND TRUE)\n  endif()\n  if(OpenCV_SHARED AND \";${OpenCV_WORLD_COMPONENTS};\" MATCHES \";${__cvcomponent};\" AND NOT TARGET ${__cvcomponent})\n    get_target_property(__implib_dbg opencv_world IMPORTED_IMPLIB_DEBUG)\n    get_target_property(__implib_release opencv_world  IMPORTED_IMPLIB_RELEASE)\n    get_target_property(__location_dbg opencv_world IMPORTED_LOCATION_DEBUG)\n    get_target_property(__location_release opencv_world  IMPORTED_LOCATION_RELEASE)\n    get_target_property(__include_dir opencv_world INTERFACE_INCLUDE_DIRECTORIES)\n    add_library(${__cvcomponent} SHARED IMPORTED)\n    set_target_properties(${__cvcomponent} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES \"${__include_dir}\")\n    if(__location_dbg)\n      set_property(TARGET ${__cvcomponent} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)\n      set_target_properties(${__cvcomponent} PROPERTIES\n        IMPORTED_IMPLIB_DEBUG \"${__implib_dbg}\"\n        IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG \"\"\n        IMPORTED_LOCATION_DEBUG \"${__location_dbg}\"\n      )\n    endif()\n    if(__location_release)\n      set_property(TARGET ${__cvcomponent} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\n      set_target_properties(${__cvcomponent} PROPERTIES\n        IMPORTED_IMPLIB_RELEASE \"${__implib_release}\"\n        IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE \"\"\n        IMPORTED_LOCATION_RELEASE \"${__location_release}\"\n      )\n    endif()\n  endif()\n  if(TARGET ${__cvcomponent})\n    ocv_map_imported_config(${__cvcomponent})\n  endif()\nendforeach()\n\nif(__remap_warnings AND NOT OpenCV_FIND_QUIETLY)\n  message(\"OpenCV: configurations remap warnings:\\n${__remap_warnings}OpenCV: Check variable OPENCV_MAP_IMPORTED_CONFIG=${OPENCV_MAP_IMPORTED_CONFIG}\")\nendif()\n\n# ==============================================================\n# Compatibility stuff\n# ==============================================================\nset(OpenCV_LIBRARIES ${OpenCV_LIBS})\n\n# Require C++11 features for OpenCV modules\nif(CMAKE_VERSION VERSION_LESS \"3.1\")\n  if(NOT OpenCV_FIND_QUIETLY AND NOT OPENCV_HIDE_WARNING_COMPILE_FEATURES)\n    message(STATUS \"OpenCV: CMake version is low (${CMAKE_VERSION}, required 3.1+). Can't enable C++11 features: https://github.com/opencv/opencv/issues/13000\")\n  endif()\nelse()\n  set(__target opencv_core)\n  if(TARGET opencv_world)\n    set(__target opencv_world)\n  endif()\n  set(__compile_features cxx_std_11)  # CMake 3.8+\n  if(DEFINED OPENCV_COMPILE_FEATURES)\n    set(__compile_features ${OPENCV_COMPILE_FEATURES})  # custom override\n  elseif(CMAKE_VERSION VERSION_LESS \"3.8\")\n    set(__compile_features cxx_auto_type cxx_rvalue_references cxx_lambdas)\n  endif()\n  if(__compile_features)\n    # Simulate exported result of target_compile_features(opencv_core PUBLIC ...)\n    set_target_properties(${__target} PROPERTIES\n        INTERFACE_COMPILE_FEATURES \"${__compile_features}\"\n    )\n  endif()\n  unset(__target)\n  unset(__compile_features)\nendif()\n\n#\n# Some macros for samples\n#\nmacro(ocv_check_dependencies)\n  set(OCV_DEPENDENCIES_FOUND TRUE)\n  foreach(d ${ARGN})\n    if(NOT TARGET ${d})\n      message(WARNING \"OpenCV: Can't resolve dependency: ${d}\")\n      set(OCV_DEPENDENCIES_FOUND FALSE)\n      break()\n    endif()\n  endforeach()\nendmacro()\n\n# adds include directories in such way that directories from the OpenCV source tree go first\nfunction(ocv_include_directories)\n  set(__add_before \"\")\n  file(TO_CMAKE_PATH \"${OpenCV_INSTALL_PATH}\" __baseDir)\n  foreach(dir ${ARGN})\n    get_filename_component(__abs_dir \"${dir}\" ABSOLUTE)\n    if(\"${__abs_dir}\" MATCHES \"^${__baseDir}\")\n      list(APPEND __add_before \"${dir}\")\n    else()\n      include_directories(AFTER SYSTEM \"${dir}\")\n    endif()\n  endforeach()\n  include_directories(BEFORE ${__add_before})\nendfunction()\n\nmacro(ocv_include_modules)\n  include_directories(BEFORE \"${OpenCV_INCLUDE_DIRS}\")\nendmacro()\n\nmacro(ocv_include_modules_recurse)\n  include_directories(BEFORE \"${OpenCV_INCLUDE_DIRS}\")\nendmacro()\n\nmacro(ocv_target_link_libraries)\n  target_link_libraries(${ARGN})\nendmacro()\n\n# remove all matching elements from the list\nmacro(ocv_list_filterout lst regex)\n  foreach(item ${${lst}})\n    if(item MATCHES \"${regex}\")\n      list(REMOVE_ITEM ${lst} \"${item}\")\n    endif()\n  endforeach()\nendmacro()\n\n# We do not actually need REQUIRED_VARS to be checked for. Just use the\n# installation directory for the status.\nfind_package_handle_standard_args(OpenCV REQUIRED_VARS OpenCV_INSTALL_PATH\n                                  VERSION_VAR OpenCV_VERSION ${_OpenCV_FPHSA_ARGS})\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/lib64/cmake/opencv4/OpenCVModules-release.cmake",
    "content": "#----------------------------------------------------------------\n# Generated CMake target import file for configuration \"RELEASE\".\n#----------------------------------------------------------------\n\n# Commands may need to know the format version.\nset(CMAKE_IMPORT_FILE_VERSION 1)\n\n# Import target \"opencv_core\" for configuration \"RELEASE\"\nset_property(TARGET opencv_core APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_core PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_core.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_core.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_core )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_core \"${_IMPORT_PREFIX}/lib64/libopencv_core.so.4.5.3\" )\n\n# Import target \"opencv_flann\" for configuration \"RELEASE\"\nset_property(TARGET opencv_flann APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_flann PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_flann.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_flann.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_flann )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_flann \"${_IMPORT_PREFIX}/lib64/libopencv_flann.so.4.5.3\" )\n\n# Import target \"opencv_imgproc\" for configuration \"RELEASE\"\nset_property(TARGET opencv_imgproc APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_imgproc PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_imgproc.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_imgproc.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_imgproc )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_imgproc \"${_IMPORT_PREFIX}/lib64/libopencv_imgproc.so.4.5.3\" )\n\n# Import target \"opencv_ml\" for configuration \"RELEASE\"\nset_property(TARGET opencv_ml APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_ml PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_ml.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_ml.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_ml )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_ml \"${_IMPORT_PREFIX}/lib64/libopencv_ml.so.4.5.3\" )\n\n# Import target \"opencv_photo\" for configuration \"RELEASE\"\nset_property(TARGET opencv_photo APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_photo PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_photo.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_photo.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_photo )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_photo \"${_IMPORT_PREFIX}/lib64/libopencv_photo.so.4.5.3\" )\n\n# Import target \"opencv_dnn\" for configuration \"RELEASE\"\nset_property(TARGET opencv_dnn APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_dnn PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_dnn.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_dnn.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_dnn )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_dnn \"${_IMPORT_PREFIX}/lib64/libopencv_dnn.so.4.5.3\" )\n\n# Import target \"opencv_features2d\" for configuration \"RELEASE\"\nset_property(TARGET opencv_features2d APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_features2d PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_features2d.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_features2d.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_features2d )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_features2d \"${_IMPORT_PREFIX}/lib64/libopencv_features2d.so.4.5.3\" )\n\n# Import target \"opencv_imgcodecs\" for configuration \"RELEASE\"\nset_property(TARGET opencv_imgcodecs APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_imgcodecs PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_imgcodecs.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_imgcodecs.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_imgcodecs )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_imgcodecs \"${_IMPORT_PREFIX}/lib64/libopencv_imgcodecs.so.4.5.3\" )\n\n# Import target \"opencv_videoio\" for configuration \"RELEASE\"\nset_property(TARGET opencv_videoio APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_videoio PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_videoio.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_videoio.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_videoio )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_videoio \"${_IMPORT_PREFIX}/lib64/libopencv_videoio.so.4.5.3\" )\n\n# Import target \"opencv_calib3d\" for configuration \"RELEASE\"\nset_property(TARGET opencv_calib3d APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_calib3d PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_calib3d.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_calib3d.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_calib3d )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_calib3d \"${_IMPORT_PREFIX}/lib64/libopencv_calib3d.so.4.5.3\" )\n\n# Import target \"opencv_highgui\" for configuration \"RELEASE\"\nset_property(TARGET opencv_highgui APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_highgui PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_highgui.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_highgui.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_highgui )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_highgui \"${_IMPORT_PREFIX}/lib64/libopencv_highgui.so.4.5.3\" )\n\n# Import target \"opencv_objdetect\" for configuration \"RELEASE\"\nset_property(TARGET opencv_objdetect APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_objdetect PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_objdetect.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_objdetect.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_objdetect )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_objdetect \"${_IMPORT_PREFIX}/lib64/libopencv_objdetect.so.4.5.3\" )\n\n# Import target \"opencv_stitching\" for configuration \"RELEASE\"\nset_property(TARGET opencv_stitching APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_stitching PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_stitching.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_stitching.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_stitching )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_stitching \"${_IMPORT_PREFIX}/lib64/libopencv_stitching.so.4.5.3\" )\n\n# Import target \"opencv_video\" for configuration \"RELEASE\"\nset_property(TARGET opencv_video APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_video PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_video.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_video.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_video )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_video \"${_IMPORT_PREFIX}/lib64/libopencv_video.so.4.5.3\" )\n\n# Import target \"opencv_gapi\" for configuration \"RELEASE\"\nset_property(TARGET opencv_gapi APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)\nset_target_properties(opencv_gapi PROPERTIES\n  IMPORTED_LOCATION_RELEASE \"${_IMPORT_PREFIX}/lib64/libopencv_gapi.so.4.5.3\"\n  IMPORTED_SONAME_RELEASE \"libopencv_gapi.so.4.5\"\n  )\n\nlist(APPEND _IMPORT_CHECK_TARGETS opencv_gapi )\nlist(APPEND _IMPORT_CHECK_FILES_FOR_opencv_gapi \"${_IMPORT_PREFIX}/lib64/libopencv_gapi.so.4.5.3\" )\n\n# Commands beyond this point should not need to know the version.\nset(CMAKE_IMPORT_FILE_VERSION)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/lib64/cmake/opencv4/OpenCVModules.cmake",
    "content": "# Generated by CMake\n\nif(\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" LESS 2.5)\n   message(FATAL_ERROR \"CMake >= 2.6.0 required\")\nendif()\ncmake_policy(PUSH)\ncmake_policy(VERSION 2.6...3.18)\n#----------------------------------------------------------------\n# Generated CMake target import file.\n#----------------------------------------------------------------\n\n# Commands may need to know the format version.\nset(CMAKE_IMPORT_FILE_VERSION 1)\n\n# Protect against multiple inclusion, which would fail when already imported targets are added once more.\nset(_targetsDefined)\nset(_targetsNotDefined)\nset(_expectedTargets)\nforeach(_expectedTarget opencv_core opencv_flann opencv_imgproc opencv_ml opencv_photo opencv_dnn opencv_features2d opencv_imgcodecs opencv_videoio opencv_calib3d opencv_highgui opencv_objdetect opencv_stitching opencv_video opencv_gapi)\n  list(APPEND _expectedTargets ${_expectedTarget})\n  if(NOT TARGET ${_expectedTarget})\n    list(APPEND _targetsNotDefined ${_expectedTarget})\n  endif()\n  if(TARGET ${_expectedTarget})\n    list(APPEND _targetsDefined ${_expectedTarget})\n  endif()\nendforeach()\nif(\"${_targetsDefined}\" STREQUAL \"${_expectedTargets}\")\n  unset(_targetsDefined)\n  unset(_targetsNotDefined)\n  unset(_expectedTargets)\n  set(CMAKE_IMPORT_FILE_VERSION)\n  cmake_policy(POP)\n  return()\nendif()\nif(NOT \"${_targetsDefined}\" STREQUAL \"\")\n  message(FATAL_ERROR \"Some (but not all) targets in this export set were already defined.\\nTargets Defined: ${_targetsDefined}\\nTargets not yet defined: ${_targetsNotDefined}\\n\")\nendif()\nunset(_targetsDefined)\nunset(_targetsNotDefined)\nunset(_expectedTargets)\n\n\n# Compute the installation prefix relative to this file.\nget_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)\nif(_IMPORT_PREFIX STREQUAL \"/\")\n  set(_IMPORT_PREFIX \"\")\nendif()\n\n# Create imported target opencv_core\nadd_library(opencv_core SHARED IMPORTED)\n\n# Create imported target opencv_flann\nadd_library(opencv_flann SHARED IMPORTED)\n\nset_target_properties(opencv_flann PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core\"\n)\n\n# Create imported target opencv_imgproc\nadd_library(opencv_imgproc SHARED IMPORTED)\n\nset_target_properties(opencv_imgproc PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core\"\n)\n\n# Create imported target opencv_ml\nadd_library(opencv_ml SHARED IMPORTED)\n\nset_target_properties(opencv_ml PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core\"\n)\n\n# Create imported target opencv_photo\nadd_library(opencv_photo SHARED IMPORTED)\n\nset_target_properties(opencv_photo PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_imgproc\"\n)\n\n# Create imported target opencv_dnn\nadd_library(opencv_dnn SHARED IMPORTED)\n\nset_target_properties(opencv_dnn PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_imgproc\"\n)\n\n# Create imported target opencv_features2d\nadd_library(opencv_features2d SHARED IMPORTED)\n\nset_target_properties(opencv_features2d PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_flann;opencv_imgproc\"\n)\n\n# Create imported target opencv_imgcodecs\nadd_library(opencv_imgcodecs SHARED IMPORTED)\n\nset_target_properties(opencv_imgcodecs PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_imgproc\"\n)\n\n# Create imported target opencv_videoio\nadd_library(opencv_videoio SHARED IMPORTED)\n\nset_target_properties(opencv_videoio PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_imgproc;opencv_imgcodecs\"\n)\n\n# Create imported target opencv_calib3d\nadd_library(opencv_calib3d SHARED IMPORTED)\n\nset_target_properties(opencv_calib3d PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_flann;opencv_imgproc;opencv_features2d\"\n)\n\n# Create imported target opencv_highgui\nadd_library(opencv_highgui SHARED IMPORTED)\n\nset_target_properties(opencv_highgui PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_imgproc;opencv_imgcodecs;opencv_videoio\"\n)\n\n# Create imported target opencv_objdetect\nadd_library(opencv_objdetect SHARED IMPORTED)\n\nset_target_properties(opencv_objdetect PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_flann;opencv_imgproc;opencv_features2d;opencv_calib3d\"\n)\n\n# Create imported target opencv_stitching\nadd_library(opencv_stitching SHARED IMPORTED)\n\nset_target_properties(opencv_stitching PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_flann;opencv_imgproc;opencv_features2d;opencv_calib3d\"\n)\n\n# Create imported target opencv_video\nadd_library(opencv_video SHARED IMPORTED)\n\nset_target_properties(opencv_video PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_flann;opencv_imgproc;opencv_dnn;opencv_features2d;opencv_calib3d\"\n)\n\n# Create imported target opencv_gapi\nadd_library(opencv_gapi SHARED IMPORTED)\n\nset_target_properties(opencv_gapi PROPERTIES\n  INTERFACE_LINK_LIBRARIES \"opencv_core;opencv_flann;opencv_imgproc;opencv_dnn;opencv_features2d;opencv_calib3d;opencv_video\"\n)\n\nif(CMAKE_VERSION VERSION_LESS 2.8.12)\n  message(FATAL_ERROR \"This file relies on consumers using CMake 2.8.12 or greater.\")\nendif()\n\n# Load information for each installed configuration.\nget_filename_component(_DIR \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\nfile(GLOB CONFIG_FILES \"${_DIR}/OpenCVModules-*.cmake\")\nforeach(f ${CONFIG_FILES})\n  include(${f})\nendforeach()\n\n# Cleanup temporary variables.\nset(_IMPORT_PREFIX)\n\n# Loop over all imported files and verify that they actually exist\nforeach(target ${_IMPORT_CHECK_TARGETS} )\n  foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )\n    if(NOT EXISTS \"${file}\" )\n      message(FATAL_ERROR \"The imported target \\\"${target}\\\" references the file\n   \\\"${file}\\\"\nbut this file does not exist.  Possible reasons include:\n* The file was deleted, renamed, or moved to another location.\n* An install or uninstall procedure did not complete successfully.\n* The installation package was faulty and contained\n   \\\"${CMAKE_CURRENT_LIST_FILE}\\\"\nbut not all the files it references.\n\")\n    endif()\n  endforeach()\n  unset(_IMPORT_CHECK_FILES_FOR_${target})\nendforeach()\nunset(_IMPORT_CHECK_TARGETS)\n\n# This file does not depend on other imported targets which have\n# been exported from the same project but in a separate export set.\n\n# Commands beyond this point should not need to know the version.\nset(CMAKE_IMPORT_FILE_VERSION)\ncmake_policy(POP)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/opencv4/lib64/pkgconfig/opencv4.pc",
    "content": "# Package Information for pkg-config\n\nprefix=/data/workspace/src/git.code.oa.com/youtu_sdk/yt-sdk-deps-opencv\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib64\nincludedir=${prefix}/include/opencv4\n\nName: OpenCV\nDescription: Open Source Computer Vision Library\nVersion: 4.5.3\nLibs: -L${exec_prefix}/lib64 -lopencv_gapi -lopencv_highgui -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_video -lopencv_calib3d -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_videoio -lopencv_imgcodecs -lopencv_imgproc -lopencv_core\nLibs.private: -ldl -lm -lpthread -lrt\nCflags: -I${includedir}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/any.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_ANY_H__\n#define GOOGLE_PROTOBUF_ANY_H__\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/descriptor.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/arenastring.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// Helper class used to implement google::protobuf::Any.\nclass LIBPROTOBUF_EXPORT AnyMetadata {\n  typedef ArenaStringPtr UrlType;\n  typedef ArenaStringPtr ValueType;\n public:\n  // AnyMetadata does not take ownership of \"type_url\" and \"value\".\n  AnyMetadata(UrlType* type_url, ValueType* value);\n\n  // Packs a message using the default type URL prefix: \"type.googleapis.com\".\n  // The resulted type URL will be \"type.googleapis.com/<message_full_name>\".\n  void PackFrom(const Message& message);\n  // Packs a message using the given type URL prefix. The type URL will be\n  // constructed by concatenating the message type's full name to the prefix\n  // with an optional \"/\" separator if the prefix doesn't already end up \"/\".\n  // For example, both PackFrom(message, \"type.googleapis.com\") and\n  // PackFrom(message, \"type.googleapis.com/\") yield the same result type\n  // URL: \"type.googleapis.com/<message_full_name>\".\n  void PackFrom(const Message& message, const string& type_url_prefix);\n\n  // Unpacks the payload into the given message. Returns false if the message's\n  // type doesn't match the type specified in the type URL (i.e., the full\n  // name after the last \"/\" of the type URL doesn't match the message's actual\n  // full name) or parsing the payload has failed.\n  bool UnpackTo(Message* message) const;\n\n  // Checks whether the type specified in the type URL matches the given type.\n  // A type is consdiered matching if its full name matches the full name after\n  // the last \"/\" in the type URL.\n  template<typename T>\n  bool Is() const {\n    return InternalIs(T::default_instance().GetDescriptor());\n  }\n\n private:\n  bool InternalIs(const Descriptor* message) const;\n\n  UrlType* type_url_;\n  ValueType* value_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AnyMetadata);\n};\n\nextern const char kAnyFullTypeName[];          // \"google.protobuf.Any\".\nextern const char kTypeGoogleApisComPrefix[];  // \"type.googleapis.com/\".\nextern const char kTypeGoogleProdComPrefix[];  // \"type.googleprod.com/\".\n\n// Get the proto type name from Any::type_url value. For example, passing\n// \"type.googleapis.com/rpc.QueryOrigin\" will return \"rpc.QueryOrigin\" in\n// *full_type_name. Returns false if the type_url does not have a \"/\"\n// in the type url separating the full type name.\n//\n// NOTE: this function is available publicly as:\n//   google::protobuf::Any()  // static method on the generated message type.\nbool ParseAnyTypeUrl(const string& type_url, string* full_type_name);\n\n// Get the proto type name and prefix from Any::type_url value. For example,\n// passing \"type.googleapis.com/rpc.QueryOrigin\" will return\n// \"type.googleapis.com/\" in *url_prefix and \"rpc.QueryOrigin\" in\n// *full_type_name. Returns false if the type_url does not have a \"/\" in the\n// type url separating the full type name.\nbool ParseAnyTypeUrl(const string& type_url, string* url_prefix,\n                     string* full_type_name);\n\n// See if message is of type google.protobuf.Any, if so, return the descriptors\n// for \"type_url\" and \"value\" fields.\nbool GetAnyFieldDescriptors(const Message& message,\n                            const FieldDescriptor** type_url_field,\n                            const FieldDescriptor** value_field);\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_ANY_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/any.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/any.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/unknown_field_set.h>\n#include <google/protobuf/any.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fany_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2fany_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[1];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2fany_2eproto\nnamespace google {\nnamespace protobuf {\nclass Any;\nclass AnyDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Any* Arena::CreateMaybeMessage<::google::protobuf::Any>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT Any : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Any) */ {\n public:\n  Any();\n  virtual ~Any();\n\n  Any(const Any& from);\n\n  inline Any& operator=(const Any& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Any(Any&& from) noexcept\n    : Any() {\n    *this = ::std::move(from);\n  }\n\n  inline Any& operator=(Any&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Any& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Any* internal_default_instance() {\n    return reinterpret_cast<const Any*>(\n               &_Any_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  // implements Any -----------------------------------------------\n\n  void PackFrom(const ::google::protobuf::Message& message);\n  void PackFrom(const ::google::protobuf::Message& message,\n                const ::std::string& type_url_prefix);\n  bool UnpackTo(::google::protobuf::Message* message) const;\n  template<typename T> bool Is() const {\n    return _any_metadata_.Is<T>();\n  }\n  static bool ParseAnyTypeUrl(const string& type_url,\n                              string* full_type_name);\n\n  void Swap(Any* other);\n  friend void swap(Any& a, Any& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Any* New() const final {\n    return CreateMaybeMessage<Any>(NULL);\n  }\n\n  Any* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Any>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Any& from);\n  void MergeFrom(const Any& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Any* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // string type_url = 1;\n  void clear_type_url();\n  static const int kTypeUrlFieldNumber = 1;\n  const ::std::string& type_url() const;\n  void set_type_url(const ::std::string& value);\n  #if LANG_CXX11\n  void set_type_url(::std::string&& value);\n  #endif\n  void set_type_url(const char* value);\n  void set_type_url(const char* value, size_t size);\n  ::std::string* mutable_type_url();\n  ::std::string* release_type_url();\n  void set_allocated_type_url(::std::string* type_url);\n\n  // bytes value = 2;\n  void clear_value();\n  static const int kValueFieldNumber = 2;\n  const ::std::string& value() const;\n  void set_value(const ::std::string& value);\n  #if LANG_CXX11\n  void set_value(::std::string&& value);\n  #endif\n  void set_value(const char* value);\n  void set_value(const void* value, size_t size);\n  ::std::string* mutable_value();\n  ::std::string* release_value();\n  void set_allocated_value(::std::string* value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Any)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::ArenaStringPtr type_url_;\n  ::google::protobuf::internal::ArenaStringPtr value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::internal::AnyMetadata _any_metadata_;\n  friend struct ::protobuf_google_2fprotobuf_2fany_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// Any\n\n// string type_url = 1;\ninline void Any::clear_type_url() {\n  type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& Any::type_url() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Any.type_url)\n  return type_url_.GetNoArena();\n}\ninline void Any::set_type_url(const ::std::string& value) {\n  \n  type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.Any.type_url)\n}\n#if LANG_CXX11\ninline void Any::set_type_url(::std::string&& value) {\n  \n  type_url_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Any.type_url)\n}\n#endif\ninline void Any::set_type_url(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url)\n}\ninline void Any::set_type_url(const char* value, size_t size) {\n  \n  type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.type_url)\n}\ninline ::std::string* Any::mutable_type_url() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Any.type_url)\n  return type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Any::release_type_url() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Any.type_url)\n  \n  return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Any::set_allocated_type_url(::std::string* type_url) {\n  if (type_url != NULL) {\n    \n  } else {\n    \n  }\n  type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url)\n}\n\n// bytes value = 2;\ninline void Any::clear_value() {\n  value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& Any::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Any.value)\n  return value_.GetNoArena();\n}\ninline void Any::set_value(const ::std::string& value) {\n  \n  value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.Any.value)\n}\n#if LANG_CXX11\ninline void Any::set_value(::std::string&& value) {\n  \n  value_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Any.value)\n}\n#endif\ninline void Any::set_value(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Any.value)\n}\ninline void Any::set_value(const void* value, size_t size) {\n  \n  value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Any.value)\n}\ninline ::std::string* Any::mutable_value() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Any.value)\n  return value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Any::release_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Any.value)\n  \n  return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Any::set_allocated_value(::std::string* value) {\n  if (value != NULL) {\n    \n  } else {\n    \n  }\n  value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value)\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2fany_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/any.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"github.com/golang/protobuf/ptypes/any\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"AnyProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n// `Any` contains an arbitrary serialized protocol buffer message along with a\n// URL that describes the type of the serialized message.\n//\n// Protobuf library provides support to pack/unpack Any values in the form\n// of utility functions or additional generated methods of the Any type.\n//\n// Example 1: Pack and unpack a message in C++.\n//\n//     Foo foo = ...;\n//     Any any;\n//     any.PackFrom(foo);\n//     ...\n//     if (any.UnpackTo(&foo)) {\n//       ...\n//     }\n//\n// Example 2: Pack and unpack a message in Java.\n//\n//     Foo foo = ...;\n//     Any any = Any.pack(foo);\n//     ...\n//     if (any.is(Foo.class)) {\n//       foo = any.unpack(Foo.class);\n//     }\n//\n//  Example 3: Pack and unpack a message in Python.\n//\n//     foo = Foo(...)\n//     any = Any()\n//     any.Pack(foo)\n//     ...\n//     if any.Is(Foo.DESCRIPTOR):\n//       any.Unpack(foo)\n//       ...\n//\n//  Example 4: Pack and unpack a message in Go\n//\n//      foo := &pb.Foo{...}\n//      any, err := ptypes.MarshalAny(foo)\n//      ...\n//      foo := &pb.Foo{}\n//      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n//        ...\n//      }\n//\n// The pack methods provided by protobuf library will by default use\n// 'type.googleapis.com/full.type.name' as the type URL and the unpack\n// methods only use the fully qualified type name after the last '/'\n// in the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n// name \"y.z\".\n//\n//\n// JSON\n// ====\n// The JSON representation of an `Any` value uses the regular\n// representation of the deserialized, embedded message, with an\n// additional field `@type` which contains the type URL. Example:\n//\n//     package google.profile;\n//     message Person {\n//       string first_name = 1;\n//       string last_name = 2;\n//     }\n//\n//     {\n//       \"@type\": \"type.googleapis.com/google.profile.Person\",\n//       \"firstName\": <string>,\n//       \"lastName\": <string>\n//     }\n//\n// If the embedded message type is well-known and has a custom JSON\n// representation, that representation will be embedded adding a field\n// `value` which holds the custom JSON in addition to the `@type`\n// field. Example (for message [google.protobuf.Duration][]):\n//\n//     {\n//       \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n//       \"value\": \"1.212s\"\n//     }\n//\nmessage Any {\n  // A URL/resource name that uniquely identifies the type of the serialized\n  // protocol buffer message. The last segment of the URL's path must represent\n  // the fully qualified name of the type (as in\n  // `path/google.protobuf.Duration`). The name should be in a canonical form\n  // (e.g., leading \".\" is not accepted).\n  //\n  // In practice, teams usually precompile into the binary all types that they\n  // expect it to use in the context of Any. However, for URLs which use the\n  // scheme `http`, `https`, or no scheme, one can optionally set up a type\n  // server that maps type URLs to message definitions as follows:\n  //\n  // * If no scheme is provided, `https` is assumed.\n  // * An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  //   value in binary format, or produce an error.\n  // * Applications are allowed to cache lookup results based on the\n  //   URL, or have them precompiled into a binary to avoid any\n  //   lookup. Therefore, binary compatibility needs to be preserved\n  //   on changes to types. (Use versioned type names to manage\n  //   breaking changes.)\n  //\n  // Note: this functionality is not currently available in the official\n  // protobuf release, and it is not used for type URLs beginning with\n  // type.googleapis.com.\n  //\n  // Schemes other than `http`, `https` (or the empty scheme) might be\n  // used with implementation specific semantics.\n  //\n  string type_url = 1;\n\n  // Must be a valid serialized protocol buffer of the above specified type.\n  bytes value = 2;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/api.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/api.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/unknown_field_set.h>\n#include <google/protobuf/source_context.pb.h>\n#include <google/protobuf/type.pb.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fapi_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2fapi_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[3];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2fapi_2eproto\nnamespace google {\nnamespace protobuf {\nclass Api;\nclass ApiDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern ApiDefaultTypeInternal _Api_default_instance_;\nclass Method;\nclass MethodDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern MethodDefaultTypeInternal _Method_default_instance_;\nclass Mixin;\nclass MixinDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern MixinDefaultTypeInternal _Mixin_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Api* Arena::CreateMaybeMessage<::google::protobuf::Api>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Method* Arena::CreateMaybeMessage<::google::protobuf::Method>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Mixin* Arena::CreateMaybeMessage<::google::protobuf::Mixin>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Api) */ {\n public:\n  Api();\n  virtual ~Api();\n\n  Api(const Api& from);\n\n  inline Api& operator=(const Api& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Api(Api&& from) noexcept\n    : Api() {\n    *this = ::std::move(from);\n  }\n\n  inline Api& operator=(Api&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Api& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Api* internal_default_instance() {\n    return reinterpret_cast<const Api*>(\n               &_Api_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void Swap(Api* other);\n  friend void swap(Api& a, Api& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Api* New() const final {\n    return CreateMaybeMessage<Api>(NULL);\n  }\n\n  Api* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Api>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Api& from);\n  void MergeFrom(const Api& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Api* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.Method methods = 2;\n  int methods_size() const;\n  void clear_methods();\n  static const int kMethodsFieldNumber = 2;\n  ::google::protobuf::Method* mutable_methods(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >*\n      mutable_methods();\n  const ::google::protobuf::Method& methods(int index) const;\n  ::google::protobuf::Method* add_methods();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >&\n      methods() const;\n\n  // repeated .google.protobuf.Option options = 3;\n  int options_size() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 3;\n  ::google::protobuf::Option* mutable_options(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\n      mutable_options();\n  const ::google::protobuf::Option& options(int index) const;\n  ::google::protobuf::Option* add_options();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\n      options() const;\n\n  // repeated .google.protobuf.Mixin mixins = 6;\n  int mixins_size() const;\n  void clear_mixins();\n  static const int kMixinsFieldNumber = 6;\n  ::google::protobuf::Mixin* mutable_mixins(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >*\n      mutable_mixins();\n  const ::google::protobuf::Mixin& mixins(int index) const;\n  ::google::protobuf::Mixin* add_mixins();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >&\n      mixins() const;\n\n  // string name = 1;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n\n  // string version = 4;\n  void clear_version();\n  static const int kVersionFieldNumber = 4;\n  const ::std::string& version() const;\n  void set_version(const ::std::string& value);\n  #if LANG_CXX11\n  void set_version(::std::string&& value);\n  #endif\n  void set_version(const char* value);\n  void set_version(const char* value, size_t size);\n  ::std::string* mutable_version();\n  ::std::string* release_version();\n  void set_allocated_version(::std::string* version);\n\n  // .google.protobuf.SourceContext source_context = 5;\n  bool has_source_context() const;\n  void clear_source_context();\n  static const int kSourceContextFieldNumber = 5;\n  private:\n  const ::google::protobuf::SourceContext& _internal_source_context() const;\n  public:\n  const ::google::protobuf::SourceContext& source_context() const;\n  ::google::protobuf::SourceContext* release_source_context();\n  ::google::protobuf::SourceContext* mutable_source_context();\n  void set_allocated_source_context(::google::protobuf::SourceContext* source_context);\n\n  // .google.protobuf.Syntax syntax = 7;\n  void clear_syntax();\n  static const int kSyntaxFieldNumber = 7;\n  ::google::protobuf::Syntax syntax() const;\n  void set_syntax(::google::protobuf::Syntax value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Api)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method > methods_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin > mixins_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::internal::ArenaStringPtr version_;\n  ::google::protobuf::SourceContext* source_context_;\n  int syntax_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Method) */ {\n public:\n  Method();\n  virtual ~Method();\n\n  Method(const Method& from);\n\n  inline Method& operator=(const Method& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Method(Method&& from) noexcept\n    : Method() {\n    *this = ::std::move(from);\n  }\n\n  inline Method& operator=(Method&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Method& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Method* internal_default_instance() {\n    return reinterpret_cast<const Method*>(\n               &_Method_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    1;\n\n  void Swap(Method* other);\n  friend void swap(Method& a, Method& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Method* New() const final {\n    return CreateMaybeMessage<Method>(NULL);\n  }\n\n  Method* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Method>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Method& from);\n  void MergeFrom(const Method& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Method* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.Option options = 6;\n  int options_size() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 6;\n  ::google::protobuf::Option* mutable_options(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\n      mutable_options();\n  const ::google::protobuf::Option& options(int index) const;\n  ::google::protobuf::Option* add_options();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\n      options() const;\n\n  // string name = 1;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n\n  // string request_type_url = 2;\n  void clear_request_type_url();\n  static const int kRequestTypeUrlFieldNumber = 2;\n  const ::std::string& request_type_url() const;\n  void set_request_type_url(const ::std::string& value);\n  #if LANG_CXX11\n  void set_request_type_url(::std::string&& value);\n  #endif\n  void set_request_type_url(const char* value);\n  void set_request_type_url(const char* value, size_t size);\n  ::std::string* mutable_request_type_url();\n  ::std::string* release_request_type_url();\n  void set_allocated_request_type_url(::std::string* request_type_url);\n\n  // string response_type_url = 4;\n  void clear_response_type_url();\n  static const int kResponseTypeUrlFieldNumber = 4;\n  const ::std::string& response_type_url() const;\n  void set_response_type_url(const ::std::string& value);\n  #if LANG_CXX11\n  void set_response_type_url(::std::string&& value);\n  #endif\n  void set_response_type_url(const char* value);\n  void set_response_type_url(const char* value, size_t size);\n  ::std::string* mutable_response_type_url();\n  ::std::string* release_response_type_url();\n  void set_allocated_response_type_url(::std::string* response_type_url);\n\n  // bool request_streaming = 3;\n  void clear_request_streaming();\n  static const int kRequestStreamingFieldNumber = 3;\n  bool request_streaming() const;\n  void set_request_streaming(bool value);\n\n  // bool response_streaming = 5;\n  void clear_response_streaming();\n  static const int kResponseStreamingFieldNumber = 5;\n  bool response_streaming() const;\n  void set_response_streaming(bool value);\n\n  // .google.protobuf.Syntax syntax = 7;\n  void clear_syntax();\n  static const int kSyntaxFieldNumber = 7;\n  ::google::protobuf::Syntax syntax() const;\n  void set_syntax(::google::protobuf::Syntax value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Method)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::internal::ArenaStringPtr request_type_url_;\n  ::google::protobuf::internal::ArenaStringPtr response_type_url_;\n  bool request_streaming_;\n  bool response_streaming_;\n  int syntax_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT Mixin : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Mixin) */ {\n public:\n  Mixin();\n  virtual ~Mixin();\n\n  Mixin(const Mixin& from);\n\n  inline Mixin& operator=(const Mixin& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Mixin(Mixin&& from) noexcept\n    : Mixin() {\n    *this = ::std::move(from);\n  }\n\n  inline Mixin& operator=(Mixin&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Mixin& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Mixin* internal_default_instance() {\n    return reinterpret_cast<const Mixin*>(\n               &_Mixin_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    2;\n\n  void Swap(Mixin* other);\n  friend void swap(Mixin& a, Mixin& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Mixin* New() const final {\n    return CreateMaybeMessage<Mixin>(NULL);\n  }\n\n  Mixin* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Mixin>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Mixin& from);\n  void MergeFrom(const Mixin& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Mixin* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // string name = 1;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n\n  // string root = 2;\n  void clear_root();\n  static const int kRootFieldNumber = 2;\n  const ::std::string& root() const;\n  void set_root(const ::std::string& value);\n  #if LANG_CXX11\n  void set_root(::std::string&& value);\n  #endif\n  void set_root(const char* value);\n  void set_root(const char* value, size_t size);\n  ::std::string* mutable_root();\n  ::std::string* release_root();\n  void set_allocated_root(::std::string* root);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Mixin)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::internal::ArenaStringPtr root_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fapi_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// Api\n\n// string name = 1;\ninline void Api::clear_name() {\n  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& Api::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Api.name)\n  return name_.GetNoArena();\n}\ninline void Api::set_name(const ::std::string& value) {\n  \n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.Api.name)\n}\n#if LANG_CXX11\ninline void Api::set_name(::std::string&& value) {\n  \n  name_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Api.name)\n}\n#endif\ninline void Api::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Api.name)\n}\ninline void Api::set_name(const char* value, size_t size) {\n  \n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Api.name)\n}\ninline ::std::string* Api::mutable_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.name)\n  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Api::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Api.name)\n  \n  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Api::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.name)\n}\n\n// repeated .google.protobuf.Method methods = 2;\ninline int Api::methods_size() const {\n  return methods_.size();\n}\ninline void Api::clear_methods() {\n  methods_.Clear();\n}\ninline ::google::protobuf::Method* Api::mutable_methods(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.methods)\n  return methods_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >*\nApi::mutable_methods() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.methods)\n  return &methods_;\n}\ninline const ::google::protobuf::Method& Api::methods(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Api.methods)\n  return methods_.Get(index);\n}\ninline ::google::protobuf::Method* Api::add_methods() {\n  // @@protoc_insertion_point(field_add:google.protobuf.Api.methods)\n  return methods_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Method >&\nApi::methods() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Api.methods)\n  return methods_;\n}\n\n// repeated .google.protobuf.Option options = 3;\ninline int Api::options_size() const {\n  return options_.size();\n}\ninline ::google::protobuf::Option* Api::mutable_options(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.options)\n  return options_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\nApi::mutable_options() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.options)\n  return &options_;\n}\ninline const ::google::protobuf::Option& Api::options(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Api.options)\n  return options_.Get(index);\n}\ninline ::google::protobuf::Option* Api::add_options() {\n  // @@protoc_insertion_point(field_add:google.protobuf.Api.options)\n  return options_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\nApi::options() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Api.options)\n  return options_;\n}\n\n// string version = 4;\ninline void Api::clear_version() {\n  version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& Api::version() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Api.version)\n  return version_.GetNoArena();\n}\ninline void Api::set_version(const ::std::string& value) {\n  \n  version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.Api.version)\n}\n#if LANG_CXX11\ninline void Api::set_version(::std::string&& value) {\n  \n  version_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Api.version)\n}\n#endif\ninline void Api::set_version(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Api.version)\n}\ninline void Api::set_version(const char* value, size_t size) {\n  \n  version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Api.version)\n}\ninline ::std::string* Api::mutable_version() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.version)\n  return version_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Api::release_version() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Api.version)\n  \n  return version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Api::set_allocated_version(::std::string* version) {\n  if (version != NULL) {\n    \n  } else {\n    \n  }\n  version_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), version);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.version)\n}\n\n// .google.protobuf.SourceContext source_context = 5;\ninline bool Api::has_source_context() const {\n  return this != internal_default_instance() && source_context_ != NULL;\n}\ninline const ::google::protobuf::SourceContext& Api::_internal_source_context() const {\n  return *source_context_;\n}\ninline const ::google::protobuf::SourceContext& Api::source_context() const {\n  const ::google::protobuf::SourceContext* p = source_context_;\n  // @@protoc_insertion_point(field_get:google.protobuf.Api.source_context)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::SourceContext*>(\n      &::google::protobuf::_SourceContext_default_instance_);\n}\ninline ::google::protobuf::SourceContext* Api::release_source_context() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Api.source_context)\n  \n  ::google::protobuf::SourceContext* temp = source_context_;\n  source_context_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::SourceContext* Api::mutable_source_context() {\n  \n  if (source_context_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::SourceContext>(GetArenaNoVirtual());\n    source_context_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.source_context)\n  return source_context_;\n}\ninline void Api::set_allocated_source_context(::google::protobuf::SourceContext* source_context) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_context_);\n  }\n  if (source_context) {\n    ::google::protobuf::Arena* submessage_arena = NULL;\n    if (message_arena != submessage_arena) {\n      source_context = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, source_context, submessage_arena);\n    }\n    \n  } else {\n    \n  }\n  source_context_ = source_context;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.source_context)\n}\n\n// repeated .google.protobuf.Mixin mixins = 6;\ninline int Api::mixins_size() const {\n  return mixins_.size();\n}\ninline void Api::clear_mixins() {\n  mixins_.Clear();\n}\ninline ::google::protobuf::Mixin* Api::mutable_mixins(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Api.mixins)\n  return mixins_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >*\nApi::mutable_mixins() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.mixins)\n  return &mixins_;\n}\ninline const ::google::protobuf::Mixin& Api::mixins(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Api.mixins)\n  return mixins_.Get(index);\n}\ninline ::google::protobuf::Mixin* Api::add_mixins() {\n  // @@protoc_insertion_point(field_add:google.protobuf.Api.mixins)\n  return mixins_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Mixin >&\nApi::mixins() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Api.mixins)\n  return mixins_;\n}\n\n// .google.protobuf.Syntax syntax = 7;\ninline void Api::clear_syntax() {\n  syntax_ = 0;\n}\ninline ::google::protobuf::Syntax Api::syntax() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Api.syntax)\n  return static_cast< ::google::protobuf::Syntax >(syntax_);\n}\ninline void Api::set_syntax(::google::protobuf::Syntax value) {\n  \n  syntax_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Api.syntax)\n}\n\n// -------------------------------------------------------------------\n\n// Method\n\n// string name = 1;\ninline void Method::clear_name() {\n  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& Method::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Method.name)\n  return name_.GetNoArena();\n}\ninline void Method::set_name(const ::std::string& value) {\n  \n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.Method.name)\n}\n#if LANG_CXX11\ninline void Method::set_name(::std::string&& value) {\n  \n  name_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Method.name)\n}\n#endif\ninline void Method::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Method.name)\n}\ninline void Method::set_name(const char* value, size_t size) {\n  \n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Method.name)\n}\ninline ::std::string* Method::mutable_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Method.name)\n  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Method::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Method.name)\n  \n  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Method::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.name)\n}\n\n// string request_type_url = 2;\ninline void Method::clear_request_type_url() {\n  request_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& Method::request_type_url() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Method.request_type_url)\n  return request_type_url_.GetNoArena();\n}\ninline void Method::set_request_type_url(const ::std::string& value) {\n  \n  request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.Method.request_type_url)\n}\n#if LANG_CXX11\ninline void Method::set_request_type_url(::std::string&& value) {\n  \n  request_type_url_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Method.request_type_url)\n}\n#endif\ninline void Method::set_request_type_url(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Method.request_type_url)\n}\ninline void Method::set_request_type_url(const char* value, size_t size) {\n  \n  request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Method.request_type_url)\n}\ninline ::std::string* Method::mutable_request_type_url() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Method.request_type_url)\n  return request_type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Method::release_request_type_url() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Method.request_type_url)\n  \n  return request_type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Method::set_allocated_request_type_url(::std::string* request_type_url) {\n  if (request_type_url != NULL) {\n    \n  } else {\n    \n  }\n  request_type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), request_type_url);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.request_type_url)\n}\n\n// bool request_streaming = 3;\ninline void Method::clear_request_streaming() {\n  request_streaming_ = false;\n}\ninline bool Method::request_streaming() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Method.request_streaming)\n  return request_streaming_;\n}\ninline void Method::set_request_streaming(bool value) {\n  \n  request_streaming_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Method.request_streaming)\n}\n\n// string response_type_url = 4;\ninline void Method::clear_response_type_url() {\n  response_type_url_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& Method::response_type_url() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Method.response_type_url)\n  return response_type_url_.GetNoArena();\n}\ninline void Method::set_response_type_url(const ::std::string& value) {\n  \n  response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.Method.response_type_url)\n}\n#if LANG_CXX11\ninline void Method::set_response_type_url(::std::string&& value) {\n  \n  response_type_url_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Method.response_type_url)\n}\n#endif\ninline void Method::set_response_type_url(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Method.response_type_url)\n}\ninline void Method::set_response_type_url(const char* value, size_t size) {\n  \n  response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Method.response_type_url)\n}\ninline ::std::string* Method::mutable_response_type_url() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Method.response_type_url)\n  return response_type_url_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Method::release_response_type_url() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Method.response_type_url)\n  \n  return response_type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Method::set_allocated_response_type_url(::std::string* response_type_url) {\n  if (response_type_url != NULL) {\n    \n  } else {\n    \n  }\n  response_type_url_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), response_type_url);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.response_type_url)\n}\n\n// bool response_streaming = 5;\ninline void Method::clear_response_streaming() {\n  response_streaming_ = false;\n}\ninline bool Method::response_streaming() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Method.response_streaming)\n  return response_streaming_;\n}\ninline void Method::set_response_streaming(bool value) {\n  \n  response_streaming_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Method.response_streaming)\n}\n\n// repeated .google.protobuf.Option options = 6;\ninline int Method::options_size() const {\n  return options_.size();\n}\ninline ::google::protobuf::Option* Method::mutable_options(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Method.options)\n  return options_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\nMethod::mutable_options() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Method.options)\n  return &options_;\n}\ninline const ::google::protobuf::Option& Method::options(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Method.options)\n  return options_.Get(index);\n}\ninline ::google::protobuf::Option* Method::add_options() {\n  // @@protoc_insertion_point(field_add:google.protobuf.Method.options)\n  return options_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\nMethod::options() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Method.options)\n  return options_;\n}\n\n// .google.protobuf.Syntax syntax = 7;\ninline void Method::clear_syntax() {\n  syntax_ = 0;\n}\ninline ::google::protobuf::Syntax Method::syntax() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Method.syntax)\n  return static_cast< ::google::protobuf::Syntax >(syntax_);\n}\ninline void Method::set_syntax(::google::protobuf::Syntax value) {\n  \n  syntax_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Method.syntax)\n}\n\n// -------------------------------------------------------------------\n\n// Mixin\n\n// string name = 1;\ninline void Mixin::clear_name() {\n  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& Mixin::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Mixin.name)\n  return name_.GetNoArena();\n}\ninline void Mixin::set_name(const ::std::string& value) {\n  \n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.Mixin.name)\n}\n#if LANG_CXX11\ninline void Mixin::set_name(::std::string&& value) {\n  \n  name_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Mixin.name)\n}\n#endif\ninline void Mixin::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Mixin.name)\n}\ninline void Mixin::set_name(const char* value, size_t size) {\n  \n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Mixin.name)\n}\ninline ::std::string* Mixin::mutable_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.name)\n  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Mixin::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Mixin.name)\n  \n  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Mixin::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.name)\n}\n\n// string root = 2;\ninline void Mixin::clear_root() {\n  root_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& Mixin::root() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Mixin.root)\n  return root_.GetNoArena();\n}\ninline void Mixin::set_root(const ::std::string& value) {\n  \n  root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.Mixin.root)\n}\n#if LANG_CXX11\ninline void Mixin::set_root(::std::string&& value) {\n  \n  root_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Mixin.root)\n}\n#endif\ninline void Mixin::set_root(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Mixin.root)\n}\ninline void Mixin::set_root(const char* value, size_t size) {\n  \n  root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Mixin.root)\n}\ninline ::std::string* Mixin::mutable_root() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Mixin.root)\n  return root_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Mixin::release_root() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Mixin.root)\n  \n  return root_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Mixin::set_allocated_root(::std::string* root) {\n  if (root != NULL) {\n    \n  } else {\n    \n  }\n  root_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), root);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.root)\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2fapi_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/api.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\nimport \"google/protobuf/source_context.proto\";\nimport \"google/protobuf/type.proto\";\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"ApiProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption go_package = \"google.golang.org/genproto/protobuf/api;api\";\n\n// Api is a light-weight descriptor for an API Interface.\n//\n// Interfaces are also described as \"protocol buffer services\" in some contexts,\n// such as by the \"service\" keyword in a .proto file, but they are different\n// from API Services, which represent a concrete implementation of an interface\n// as opposed to simply a description of methods and bindings. They are also\n// sometimes simply referred to as \"APIs\" in other contexts, such as the name of\n// this message itself. See https://cloud.google.com/apis/design/glossary for\n// detailed terminology.\nmessage Api {\n\n  // The fully qualified name of this interface, including package name\n  // followed by the interface's simple name.\n  string name = 1;\n\n  // The methods of this interface, in unspecified order.\n  repeated Method methods = 2;\n\n  // Any metadata attached to the interface.\n  repeated Option options = 3;\n\n  // A version string for this interface. If specified, must have the form\n  // `major-version.minor-version`, as in `1.10`. If the minor version is\n  // omitted, it defaults to zero. If the entire version field is empty, the\n  // major version is derived from the package name, as outlined below. If the\n  // field is not empty, the version in the package name will be verified to be\n  // consistent with what is provided here.\n  //\n  // The versioning schema uses [semantic\n  // versioning](http://semver.org) where the major version number\n  // indicates a breaking change and the minor version an additive,\n  // non-breaking change. Both version numbers are signals to users\n  // what to expect from different versions, and should be carefully\n  // chosen based on the product plan.\n  //\n  // The major version is also reflected in the package name of the\n  // interface, which must end in `v<major-version>`, as in\n  // `google.feature.v1`. For major versions 0 and 1, the suffix can\n  // be omitted. Zero major versions must only be used for\n  // experimental, non-GA interfaces.\n  //\n  //\n  string version = 4;\n\n  // Source context for the protocol buffer service represented by this\n  // message.\n  SourceContext source_context = 5;\n\n  // Included interfaces. See [Mixin][].\n  repeated Mixin mixins = 6;\n\n  // The source syntax of the service.\n  Syntax syntax = 7;\n}\n\n// Method represents a method of an API interface.\nmessage Method {\n\n  // The simple name of this method.\n  string name = 1;\n\n  // A URL of the input message type.\n  string request_type_url = 2;\n\n  // If true, the request is streamed.\n  bool request_streaming = 3;\n\n  // The URL of the output message type.\n  string response_type_url = 4;\n\n  // If true, the response is streamed.\n  bool response_streaming = 5;\n\n  // Any metadata attached to the method.\n  repeated Option options = 6;\n\n  // The source syntax of this method.\n  Syntax syntax = 7;\n}\n\n// Declares an API Interface to be included in this interface. The including\n// interface must redeclare all the methods from the included interface, but\n// documentation and options are inherited as follows:\n//\n// - If after comment and whitespace stripping, the documentation\n//   string of the redeclared method is empty, it will be inherited\n//   from the original method.\n//\n// - Each annotation belonging to the service config (http,\n//   visibility) which is not set in the redeclared method will be\n//   inherited.\n//\n// - If an http annotation is inherited, the path pattern will be\n//   modified as follows. Any version prefix will be replaced by the\n//   version of the including interface plus the [root][] path if\n//   specified.\n//\n// Example of a simple mixin:\n//\n//     package google.acl.v1;\n//     service AccessControl {\n//       // Get the underlying ACL object.\n//       rpc GetAcl(GetAclRequest) returns (Acl) {\n//         option (google.api.http).get = \"/v1/{resource=**}:getAcl\";\n//       }\n//     }\n//\n//     package google.storage.v2;\n//     service Storage {\n//       rpc GetAcl(GetAclRequest) returns (Acl);\n//\n//       // Get a data record.\n//       rpc GetData(GetDataRequest) returns (Data) {\n//         option (google.api.http).get = \"/v2/{resource=**}\";\n//       }\n//     }\n//\n// Example of a mixin configuration:\n//\n//     apis:\n//     - name: google.storage.v2.Storage\n//       mixins:\n//       - name: google.acl.v1.AccessControl\n//\n// The mixin construct implies that all methods in `AccessControl` are\n// also declared with same name and request/response types in\n// `Storage`. A documentation generator or annotation processor will\n// see the effective `Storage.GetAcl` method after inherting\n// documentation and annotations as follows:\n//\n//     service Storage {\n//       // Get the underlying ACL object.\n//       rpc GetAcl(GetAclRequest) returns (Acl) {\n//         option (google.api.http).get = \"/v2/{resource=**}:getAcl\";\n//       }\n//       ...\n//     }\n//\n// Note how the version in the path pattern changed from `v1` to `v2`.\n//\n// If the `root` field in the mixin is specified, it should be a\n// relative path under which inherited HTTP paths are placed. Example:\n//\n//     apis:\n//     - name: google.storage.v2.Storage\n//       mixins:\n//       - name: google.acl.v1.AccessControl\n//         root: acls\n//\n// This implies the following inherited HTTP annotation:\n//\n//     service Storage {\n//       // Get the underlying ACL object.\n//       rpc GetAcl(GetAclRequest) returns (Acl) {\n//         option (google.api.http).get = \"/v2/acls/{resource=**}:getAcl\";\n//       }\n//       ...\n//     }\nmessage Mixin {\n  // The fully qualified name of the interface which is included.\n  string name = 1;\n\n  // If non-empty specifies a path under which inherited HTTP paths\n  // are rooted.\n  string root = 2;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/arena.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// This file defines an Arena allocator for better allocation performance.\n\n#ifndef GOOGLE_PROTOBUF_ARENA_H__\n#define GOOGLE_PROTOBUF_ARENA_H__\n\n#include <limits>\n#ifdef max\n#undef max  // Visual Studio defines this macro\n#endif\n#if defined(_MSC_VER) && !defined(_LIBCPP_STD_VER) && !_HAS_EXCEPTIONS\n// Work around bugs in MSVC <typeinfo> header when _HAS_EXCEPTIONS=0.\n#include <exception>\n#include <typeinfo>\nnamespace std {\nusing type_info = ::type_info;\n}\n#else\n#include <typeinfo>\n#endif\n\n#include <google/protobuf/arena_impl.h>\n#include <google/protobuf/stubs/port.h>\n#include <type_traits>\n\nnamespace google {\nnamespace protobuf {\n\nstruct ArenaOptions;  // defined below\n\n}  // namespace protobuf\n\nnamespace quality_webanswers {\n\nvoid TempPrivateWorkAround(::google::protobuf::ArenaOptions* arena_options);\n\n}  // namespace quality_webanswers\n\nnamespace protobuf {\n\nclass Arena;          // defined below\nclass Message;        // defined in message.h\nclass MessageLite;\n\nnamespace arena_metrics {\n\nvoid EnableArenaMetrics(::google::protobuf::ArenaOptions* options);\n\n}  // namespace arena_metrics\n\nnamespace internal {\n\nstruct ArenaStringPtr;     // defined in arenastring.h\nclass LazyField;           // defined in lazy_field.h\n\ntemplate <typename Type>\nclass GenericTypeHandler;  // defined in repeated_field.h\n\n// Templated cleanup methods.\ntemplate <typename T>\nvoid arena_destruct_object(void* object) {\n  reinterpret_cast<T*>(object)->~T();\n}\ntemplate <typename T>\nvoid arena_delete_object(void* object) {\n  delete reinterpret_cast<T*>(object);\n}\ninline void arena_free(void* object, size_t size) {\n#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)\n  ::operator delete(object, size);\n#else\n  (void)size;\n  ::operator delete(object);\n#endif\n}\n\n}  // namespace internal\n\n// ArenaOptions provides optional additional parameters to arena construction\n// that control its block-allocation behavior.\nstruct ArenaOptions {\n  // This defines the size of the first block requested from the system malloc.\n  // Subsequent block sizes will increase in a geometric series up to a maximum.\n  size_t start_block_size;\n\n  // This defines the maximum block size requested from system malloc (unless an\n  // individual arena allocation request occurs with a size larger than this\n  // maximum). Requested block sizes increase up to this value, then remain\n  // here.\n  size_t max_block_size;\n\n  // An initial block of memory for the arena to use, or NULL for none. If\n  // provided, the block must live at least as long as the arena itself. The\n  // creator of the Arena retains ownership of the block after the Arena is\n  // destroyed.\n  char* initial_block;\n\n  // The size of the initial block, if provided.\n  size_t initial_block_size;\n\n  // A function pointer to an alloc method that returns memory blocks of size\n  // requested. By default, it contains a ptr to the malloc function.\n  //\n  // NOTE: block_alloc and dealloc functions are expected to behave like\n  // malloc and free, including Asan poisoning.\n  void* (*block_alloc)(size_t);\n  // A function pointer to a dealloc method that takes ownership of the blocks\n  // from the arena. By default, it contains a ptr to a wrapper function that\n  // calls free.\n  void (*block_dealloc)(void*, size_t);\n\n  ArenaOptions()\n      : start_block_size(kDefaultStartBlockSize),\n        max_block_size(kDefaultMaxBlockSize),\n        initial_block(NULL),\n        initial_block_size(0),\n        block_alloc(&::operator new),\n        block_dealloc(&internal::arena_free),\n        on_arena_init(NULL),\n        on_arena_reset(NULL),\n        on_arena_destruction(NULL),\n        on_arena_allocation(NULL) {}\n\n private:\n  // Hooks for adding external functionality such as user-specific metrics\n  // collection, specific debugging abilities, etc.\n  // Init hook may return a pointer to a cookie to be stored in the arena.\n  // reset and destruction hooks will then be called with the same cookie\n  // pointer. This allows us to save an external object per arena instance and\n  // use it on the other hooks (Note: It is just as legal for init to return\n  // NULL and not use the cookie feature).\n  // on_arena_reset and on_arena_destruction also receive the space used in\n  // the arena just before the reset.\n  void* (*on_arena_init)(Arena* arena);\n  void (*on_arena_reset)(Arena* arena, void* cookie, uint64 space_used);\n  void (*on_arena_destruction)(Arena* arena, void* cookie, uint64 space_used);\n\n  // type_info is promised to be static - its lifetime extends to\n  // match program's lifetime (It is given by typeid operator).\n  // Note: typeid(void) will be passed as allocated_type every time we\n  // intentionally want to avoid monitoring an allocation. (i.e. internal\n  // allocations for managing the arena)\n  void (*on_arena_allocation)(const std::type_info* allocated_type,\n                              uint64 alloc_size, void* cookie);\n\n  // Constants define default starting block size and max block size for\n  // arena allocator behavior -- see descriptions above.\n  static const size_t kDefaultStartBlockSize = 256;\n  static const size_t kDefaultMaxBlockSize = 8192;\n\n  friend void ::google::protobuf::arena_metrics::EnableArenaMetrics(ArenaOptions*);\n  friend void quality_webanswers::TempPrivateWorkAround(ArenaOptions*);\n  friend class Arena;\n  friend class ArenaOptionsTestFriend;\n};\n\n// Support for non-RTTI environments. (The metrics hooks API uses type\n// information.)\n#ifndef GOOGLE_PROTOBUF_NO_RTTI\n#define RTTI_TYPE_ID(type) (&typeid(type))\n#else\n#define RTTI_TYPE_ID(type) (NULL)\n#endif\n\n// Arena allocator. Arena allocation replaces ordinary (heap-based) allocation\n// with new/delete, and improves performance by aggregating allocations into\n// larger blocks and freeing allocations all at once. Protocol messages are\n// allocated on an arena by using Arena::CreateMessage<T>(Arena*), below, and\n// are automatically freed when the arena is destroyed.\n//\n// This is a thread-safe implementation: multiple threads may allocate from the\n// arena concurrently. Destruction is not thread-safe and the destructing\n// thread must synchronize with users of the arena first.\n//\n// An arena provides two allocation interfaces: CreateMessage<T>, which works\n// for arena-enabled proto2 message types as well as other types that satisfy\n// the appropriate protocol (described below), and Create<T>, which works for\n// any arbitrary type T. CreateMessage<T> is better when the type T supports it,\n// because this interface (i) passes the arena pointer to the created object so\n// that its sub-objects and internal allocations can use the arena too, and (ii)\n// elides the object's destructor call when possible. Create<T> does not place\n// any special requirements on the type T, and will invoke the object's\n// destructor when the arena is destroyed.\n//\n// The arena message allocation protocol, required by CreateMessage<T>, is as\n// follows:\n//\n// - The type T must have (at least) two constructors: a constructor with no\n//   arguments, called when a T is allocated on the heap; and a constructor with\n//   a google::protobuf::Arena* argument, called when a T is allocated on an arena. If the\n//   second constructor is called with a NULL arena pointer, it must be\n//   equivalent to invoking the first (no-argument) constructor.\n//\n// - The type T must have a particular type trait: a nested type\n//   |InternalArenaConstructable_|. This is usually a typedef to |void|. If no\n//   such type trait exists, then the instantiation CreateMessage<T> will fail\n//   to compile.\n//\n// - The type T *may* have the type trait |DestructorSkippable_|. If this type\n//   trait is present in the type, then its destructor will not be called if and\n//   only if it was passed a non-NULL arena pointer. If this type trait is not\n//   present on the type, then its destructor is always called when the\n//   containing arena is destroyed.\n//\n// - One- and two-user-argument forms of CreateMessage<T>() also exist that\n//   forward these constructor arguments to T's constructor: for example,\n//   CreateMessage<T>(Arena*, arg1, arg2) forwards to a constructor T(Arena*,\n//   arg1, arg2).\n//\n// This protocol is implemented by all arena-enabled proto2 message classes as\n// well as RepeatedPtrField.\n//\n// Do NOT subclass Arena. This class will be marked as final when C++11 is\n// enabled.\nclass LIBPROTOBUF_EXPORT Arena {\n public:\n  // Arena constructor taking custom options. See ArenaOptions below for\n  // descriptions of the options available.\n  explicit Arena(const ArenaOptions& options) : impl_(options) {\n    Init(options);\n  }\n\n  // Block overhead.  Use this as a guide for how much to over-allocate the\n  // initial block if you want an allocation of size N to fit inside it.\n  //\n  // WARNING: if you allocate multiple objects, it is difficult to guarantee\n  // that a series of allocations will fit in the initial block, especially if\n  // Arena changes its alignment guarantees in the future!\n  static const size_t kBlockOverhead = internal::ArenaImpl::kBlockHeaderSize +\n                                       internal::ArenaImpl::kSerialArenaSize;\n\n  // Default constructor with sensible default options, tuned for average\n  // use-cases.\n  Arena() : impl_(ArenaOptions()) { Init(ArenaOptions()); }\n\n  ~Arena() {\n    if (hooks_cookie_) {\n      CallDestructorHooks();\n    }\n  }\n\n  void Init(const ArenaOptions& options) {\n    on_arena_allocation_ = options.on_arena_allocation;\n    on_arena_reset_ = options.on_arena_reset;\n    on_arena_destruction_ = options.on_arena_destruction;\n    // Call the initialization hook\n    if (options.on_arena_init != NULL) {\n      hooks_cookie_ = options.on_arena_init(this);\n    } else {\n      hooks_cookie_ = NULL;\n    }\n  }\n\n  // API to create proto2 message objects on the arena. If the arena passed in\n  // is NULL, then a heap allocated object is returned. Type T must be a message\n  // defined in a .proto file with cc_enable_arenas set to true, otherwise a\n  // compilation error will occur.\n  //\n  // RepeatedField and RepeatedPtrField may also be instantiated directly on an\n  // arena with this method.\n  //\n  // This function also accepts any type T that satisfies the arena message\n  // allocation protocol, documented above.\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateMessage(\n      Arena* arena, Args&&... args) {\n    static_assert(\n        InternalHelper<T>::is_arena_constructable::value,\n        \"CreateMessage can only construct types that are ArenaConstructable\");\n    // We must delegate to CreateMaybeMessage() and NOT CreateMessageInternal()\n    // because protobuf generated classes specialize CreateMaybeMessage() and we\n    // need to use that specialization for code size reasons.\n    return Arena::CreateMaybeMessage<T>(arena, std::forward<Args>(args)...);\n  }\n\n  // API to create any objects on the arena. Note that only the object will\n  // be created on the arena; the underlying ptrs (in case of a proto2 message)\n  // will be still heap allocated. Proto messages should usually be allocated\n  // with CreateMessage<T>() instead.\n  //\n  // Note that even if T satisfies the arena message construction protocol\n  // (InternalArenaConstructable_ trait and optional DestructorSkippable_\n  // trait), as described above, this function does not follow the protocol;\n  // instead, it treats T as a black-box type, just as if it did not have these\n  // traits. Specifically, T's constructor arguments will always be only those\n  // passed to Create<T>() -- no additional arena pointer is implicitly added.\n  // Furthermore, the destructor will always be called at arena destruction time\n  // (unless the destructor is trivial). Hence, from T's point of view, it is as\n  // if the object were allocated on the heap (except that the underlying memory\n  // is obtained from the arena).\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* Create(Arena* arena,\n                                                           Args&&... args) {\n    return CreateNoMessage<T>(arena, is_arena_constructable<T>(),\n                              std::forward<Args>(args)...);\n  }\n\n  // Create an array of object type T on the arena *without* invoking the\n  // constructor of T. If `arena` is null, then the return value should be freed\n  // with `delete[] x;` (or `::operator delete[](x);`).\n  // To ensure safe uses, this function checks at compile time\n  // (when compiled as C++11) that T is trivially default-constructible and\n  // trivially destructible.\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateArray(\n      Arena* arena, size_t num_elements) {\n    static_assert(std::is_pod<T>::value,\n                  \"CreateArray requires a trivially constructible type\");\n    static_assert(std::is_trivially_destructible<T>::value,\n                  \"CreateArray requires a trivially destructible type\");\n    GOOGLE_CHECK_LE(num_elements, std::numeric_limits<size_t>::max() / sizeof(T))\n        << \"Requested size is too large to fit into size_t.\";\n    if (arena == NULL) {\n      return static_cast<T*>(::operator new[](num_elements * sizeof(T)));\n    } else {\n      return arena->CreateInternalRawArray<T>(num_elements);\n    }\n  }\n\n  // Returns the total space allocated by the arena, which is the sum of the\n  // sizes of the underlying blocks. This method is relatively fast; a counter\n  // is kept as blocks are allocated.\n  uint64 SpaceAllocated() const { return impl_.SpaceAllocated(); }\n  // Returns the total space used by the arena. Similar to SpaceAllocated but\n  // does not include free space and block overhead. The total space returned\n  // may not include space used by other threads executing concurrently with\n  // the call to this method.\n  uint64 SpaceUsed() const { return impl_.SpaceUsed(); }\n  // DEPRECATED. Please use SpaceAllocated() and SpaceUsed().\n  //\n  // Combines SpaceAllocated and SpaceUsed. Returns a pair of\n  // <space_allocated, space_used>.\n  PROTOBUF_RUNTIME_DEPRECATED(\"Please use SpaceAllocated() and SpaceUsed()\")\n  std::pair<uint64, uint64> SpaceAllocatedAndUsed() const {\n    return std::make_pair(SpaceAllocated(), SpaceUsed());\n  }\n\n  // Frees all storage allocated by this arena after calling destructors\n  // registered with OwnDestructor() and freeing objects registered with Own().\n  // Any objects allocated on this arena are unusable after this call. It also\n  // returns the total space used by the arena which is the sums of the sizes\n  // of the allocated blocks. This method is not thread-safe.\n  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE uint64 Reset() {\n    // Call the reset hook\n    if (on_arena_reset_ != NULL) {\n      on_arena_reset_(this, hooks_cookie_, impl_.SpaceAllocated());\n    }\n    return impl_.Reset();\n  }\n\n  // Adds |object| to a list of heap-allocated objects to be freed with |delete|\n  // when the arena is destroyed or reset.\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE void Own(T* object) {\n    OwnInternal(object, std::is_convertible<T*, Message*>());\n  }\n\n  // Adds |object| to a list of objects whose destructors will be manually\n  // called when the arena is destroyed or reset. This differs from Own() in\n  // that it does not free the underlying memory with |delete|; hence, it is\n  // normally only used for objects that are placement-newed into\n  // arena-allocated memory.\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE void OwnDestructor(T* object) {\n    if (object != NULL) {\n      impl_.AddCleanup(object, &internal::arena_destruct_object<T>);\n    }\n  }\n\n  // Adds a custom member function on an object to the list of destructors that\n  // will be manually called when the arena is destroyed or reset. This differs\n  // from OwnDestructor() in that any member function may be specified, not only\n  // the class destructor.\n  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE void OwnCustomDestructor(\n      void* object, void (*destruct)(void*)) {\n    impl_.AddCleanup(object, destruct);\n  }\n\n  // Retrieves the arena associated with |value| if |value| is an arena-capable\n  // message, or NULL otherwise. This differs from value->GetArena() in that the\n  // latter is a virtual call, while this method is a templated call that\n  // resolves at compile-time.\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static Arena* GetArena(\n      const T* value) {\n    return GetArenaInternal(value, is_arena_constructable<T>());\n  }\n\n  template <typename T>\n  class InternalHelper {\n    template <typename U>\n    static char DestructorSkippable(const typename U::DestructorSkippable_*);\n    template <typename U>\n    static double DestructorSkippable(...);\n\n    typedef std::integral_constant<\n        bool, sizeof(DestructorSkippable<T>(static_cast<const T*>(0))) ==\n                      sizeof(char) ||\n                  std::is_trivially_destructible<T>::value>\n        is_destructor_skippable;\n\n    template <typename U>\n    static char ArenaConstructable(\n        const typename U::InternalArenaConstructable_*);\n    template <typename U>\n    static double ArenaConstructable(...);\n\n    typedef std::integral_constant<bool, sizeof(ArenaConstructable<T>(\n                                             static_cast<const T*>(0))) ==\n                                             sizeof(char)>\n        is_arena_constructable;\n\n    template <typename... Args>\n    static T* Construct(void* ptr, Args&&... args) {\n      return new (ptr) T(std::forward<Args>(args)...);\n    }\n\n    static Arena* GetArena(const T* p) { return p->GetArenaNoVirtual(); }\n\n    friend class Arena;\n  };\n\n  // Helper typetraits that indicates support for arenas in a type T at compile\n  // time. This is public only to allow construction of higher-level templated\n  // utilities.\n  //\n  // is_arena_constructable<T>::value is true if the message type T has arena\n  // support enabled, and false otherwise.\n  //\n  // is_destructor_skippable<T>::value is true if the message type T has told\n  // the arena that it is safe to skip the destructor, and false otherwise.\n  //\n  // This is inside Arena because only Arena has the friend relationships\n  // necessary to see the underlying generated code traits.\n  template <typename T>\n  struct is_arena_constructable : InternalHelper<T>::is_arena_constructable {};\n  template <typename T>\n  struct is_destructor_skippable : InternalHelper<T>::is_destructor_skippable {\n  };\n\n private:\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateMessageInternal(\n      Arena* arena, Args&&... args) {\n    static_assert(\n        InternalHelper<T>::is_arena_constructable::value,\n        \"CreateMessage can only construct types that are ArenaConstructable\");\n    if (arena == NULL) {\n      return new T(nullptr, std::forward<Args>(args)...);\n    } else {\n      return arena->DoCreateMessage<T>(std::forward<Args>(args)...);\n    }\n  }\n\n  // This specialization for no arguments is necessary, because its behavior is\n  // slightly different.  When the arena pointer is nullptr, it calls T()\n  // instead of T(nullptr).\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateMessageInternal(\n      Arena* arena) {\n    static_assert(\n        InternalHelper<T>::is_arena_constructable::value,\n        \"CreateMessage can only construct types that are ArenaConstructable\");\n    if (arena == NULL) {\n      return new T();\n    } else {\n      return arena->DoCreateMessage<T>();\n    }\n  }\n\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateInternal(\n      Arena* arena, Args&&... args) {\n    if (arena == NULL) {\n      return new T(std::forward<Args>(args)...);\n    } else {\n      return arena->DoCreate<T>(std::is_trivially_destructible<T>::value,\n                                std::forward<Args>(args)...);\n    }\n  }\n\n  void CallDestructorHooks();\n  void OnArenaAllocation(const std::type_info* allocated_type, size_t n) const;\n  inline void AllocHook(const std::type_info* allocated_type, size_t n) const {\n    if (GOOGLE_PREDICT_FALSE(hooks_cookie_ != NULL)) {\n      OnArenaAllocation(allocated_type, n);\n    }\n  }\n\n  // Allocate and also optionally call on_arena_allocation callback with the\n  // allocated type info when the hooks are in place in ArenaOptions and\n  // the cookie is not null.\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void* AllocateInternal(\n      bool skip_explicit_ownership) {\n    const size_t n = internal::AlignUpTo8(sizeof(T));\n    AllocHook(RTTI_TYPE_ID(T), n);\n    // Monitor allocation if needed.\n    if (skip_explicit_ownership) {\n      return impl_.AllocateAligned(n);\n    } else {\n      return impl_.AllocateAlignedAndAddCleanup(\n          n, &internal::arena_destruct_object<T>);\n    }\n  }\n\n  // CreateMessage<T> requires that T supports arenas, but this private method\n  // works whether or not T supports arenas. These are not exposed to user code\n  // as it can cause confusing API usages, and end up having double free in\n  // user code. These are used only internally from LazyField and Repeated\n  // fields, since they are designed to work in all mode combinations.\n  template <typename Msg, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static Msg* DoCreateMaybeMessage(\n      Arena* arena, std::true_type, Args&&... args) {\n    return CreateMessageInternal<Msg>(arena, std::forward<Args>(args)...);\n  }\n\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* DoCreateMaybeMessage(\n      Arena* arena, std::false_type, Args&&... args) {\n    return CreateInternal<T>(arena, std::forward<Args>(args)...);\n  }\n\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateMaybeMessage(\n      Arena* arena, Args&&... args) {\n    return DoCreateMaybeMessage<T>(arena, is_arena_constructable<T>(),\n                                   std::forward<Args>(args)...);\n  }\n\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateNoMessage(\n      Arena* arena, std::true_type, Args&&... args) {\n    // User is constructing with Create() despite the fact that T supports arena\n    // construction.  In this case we have to delegate to CreateInternal(), and\n    // we can't use any CreateMaybeMessage() specialization that may be defined.\n    return CreateInternal<T>(arena, std::forward<Args>(args)...);\n  }\n\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static T* CreateNoMessage(\n      Arena* arena, std::false_type, Args&&... args) {\n    // User is constructing with Create() and the type does not support arena\n    // construction.  In this case we can delegate to CreateMaybeMessage() and\n    // use any specialization that may be available for that.\n    return CreateMaybeMessage<T>(arena, std::forward<Args>(args)...);\n  }\n\n  // Just allocate the required size for the given type assuming the\n  // type has a trivial constructor.\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* CreateInternalRawArray(\n      size_t num_elements) {\n    GOOGLE_CHECK_LE(num_elements, std::numeric_limits<size_t>::max() / sizeof(T))\n        << \"Requested size is too large to fit into size_t.\";\n    const size_t n = internal::AlignUpTo8(sizeof(T) * num_elements);\n    // Monitor allocation if needed.\n    AllocHook(RTTI_TYPE_ID(T), n);\n    return static_cast<T*>(impl_.AllocateAligned(n));\n  }\n\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* DoCreate(\n      bool skip_explicit_ownership, Args&&... args) {\n    return new (AllocateInternal<T>(skip_explicit_ownership))\n        T(std::forward<Args>(args)...);\n  }\n  template <typename T, typename... Args>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* DoCreateMessage(Args&&... args) {\n    return InternalHelper<T>::Construct(\n        AllocateInternal<T>(InternalHelper<T>::is_destructor_skippable::value),\n        this, std::forward<Args>(args)...);\n  }\n\n  // CreateInArenaStorage is used to implement map field. Without it,\n  // google::protobuf::Map need to call generated message's protected arena constructor,\n  // which needs to declare google::protobuf::Map as friend of generated message.\n  template <typename T>\n  static void CreateInArenaStorage(T* ptr, Arena* arena) {\n    CreateInArenaStorageInternal(ptr, arena,\n                                 typename is_arena_constructable<T>::type());\n    RegisterDestructorInternal(\n        ptr, arena,\n        typename InternalHelper<T>::is_destructor_skippable::type());\n  }\n\n  template <typename T>\n  static void CreateInArenaStorageInternal(T* ptr, Arena* arena,\n                                           std::true_type) {\n    InternalHelper<T>::Construct(ptr, arena);\n  }\n  template <typename T>\n  static void CreateInArenaStorageInternal(T* ptr, Arena* /* arena */,\n                                           std::false_type) {\n    new (ptr) T();\n  }\n\n  template <typename T>\n  static void RegisterDestructorInternal(T* /* ptr */, Arena* /* arena */,\n                                         std::true_type) {}\n  template <typename T>\n  static void RegisterDestructorInternal(T* ptr, Arena* arena,\n                                         std::false_type) {\n    arena->OwnDestructor(ptr);\n  }\n\n  // These implement Own(), which registers an object for deletion (destructor\n  // call and operator delete()). The second parameter has type 'true_type' if T\n  // is a subtype of ::google::protobuf::Message and 'false_type' otherwise. Collapsing\n  // all template instantiations to one for generic Message reduces code size,\n  // using the virtual destructor instead.\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void OwnInternal(T* object,\n                                                           std::true_type) {\n    if (object != NULL) {\n      impl_.AddCleanup(object, &internal::arena_delete_object<Message>);\n    }\n  }\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void OwnInternal(T* object,\n                                                           std::false_type) {\n    if (object != NULL) {\n      impl_.AddCleanup(object, &internal::arena_delete_object<T>);\n    }\n  }\n\n  // Implementation for GetArena(). Only message objects with\n  // InternalArenaConstructable_ tags can be associated with an arena, and such\n  // objects must implement a GetArenaNoVirtual() method.\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static Arena* GetArenaInternal(\n      const T* value, std::true_type) {\n    return InternalHelper<T>::GetArena(value);\n  }\n\n  template <typename T>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE static Arena* GetArenaInternal(\n      const T* /* value */, std::false_type) {\n    return NULL;\n  }\n\n  // For friends of arena.\n  void* AllocateAligned(size_t n) {\n    AllocHook(NULL, n);\n    return impl_.AllocateAligned(internal::AlignUpTo8(n));\n  }\n\n  internal::ArenaImpl impl_;\n\n  void (*on_arena_allocation_)(const std::type_info* allocated_type,\n                               uint64 alloc_size, void* cookie);\n  void (*on_arena_reset_)(Arena* arena, void* cookie, uint64 space_used);\n  void (*on_arena_destruction_)(Arena* arena, void* cookie, uint64 space_used);\n\n  // The arena may save a cookie it receives from the external on_init hook\n  // and then use it when calling the on_reset and on_destruction hooks.\n  void* hooks_cookie_;\n\n  template <typename Type>\n  friend class internal::GenericTypeHandler;\n  friend struct internal::ArenaStringPtr;  // For AllocateAligned.\n  friend class internal::LazyField;        // For CreateMaybeMessage.\n  friend class MessageLite;\n  template <typename Key, typename T>\n  friend class Map;\n};\n\n// Defined above for supporting environments without RTTI.\n#undef RTTI_TYPE_ID\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_ARENA_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/arena_impl.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// This file defines an Arena allocator for better allocation performance.\n\n#ifndef GOOGLE_PROTOBUF_ARENA_IMPL_H__\n#define GOOGLE_PROTOBUF_ARENA_IMPL_H__\n\n#include <atomic>\n#include <limits>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/logging.h>\n\n#include <google/protobuf/stubs/port.h>\n\n#ifdef ADDRESS_SANITIZER\n#include <sanitizer/asan_interface.h>\n#endif  // ADDRESS_SANITIZER\n\nnamespace google {\n\nnamespace protobuf {\nnamespace internal {\n\ninline size_t AlignUpTo8(size_t n) {\n  // Align n to next multiple of 8 (from Hacker's Delight, Chapter 3.)\n  return (n + 7) & -8;\n}\n\n// This class provides the core Arena memory allocation library. Different\n// implementations only need to implement the public interface below.\n// Arena is not a template type as that would only be useful if all protos\n// in turn would be templates, which will/cannot happen. However separating\n// the memory allocation part from the cruft of the API users expect we can\n// use #ifdef the select the best implementation based on hardware / OS.\nclass LIBPROTOBUF_EXPORT ArenaImpl {\n public:\n  struct Options {\n    size_t start_block_size;\n    size_t max_block_size;\n    char* initial_block;\n    size_t initial_block_size;\n    void* (*block_alloc)(size_t);\n    void (*block_dealloc)(void*, size_t);\n\n    template <typename O>\n    explicit Options(const O& options)\n      : start_block_size(options.start_block_size),\n        max_block_size(options.max_block_size),\n        initial_block(options.initial_block),\n        initial_block_size(options.initial_block_size),\n        block_alloc(options.block_alloc),\n        block_dealloc(options.block_dealloc) {}\n  };\n\n  template <typename O>\n  explicit ArenaImpl(const O& options) : options_(options) {\n    if (options_.initial_block != NULL && options_.initial_block_size > 0) {\n      GOOGLE_CHECK_GE(options_.initial_block_size, sizeof(Block))\n          << \": Initial block size too small for header.\";\n      initial_block_ = reinterpret_cast<Block*>(options_.initial_block);\n    } else {\n      initial_block_ = NULL;\n    }\n\n    Init();\n  }\n\n  // Destructor deletes all owned heap allocated objects, and destructs objects\n  // that have non-trivial destructors, except for proto2 message objects whose\n  // destructors can be skipped. Also, frees all blocks except the initial block\n  // if it was passed in.\n  ~ArenaImpl();\n\n  uint64 Reset();\n\n  uint64 SpaceAllocated() const;\n  uint64 SpaceUsed() const;\n\n  void* AllocateAligned(size_t n);\n\n  void* AllocateAlignedAndAddCleanup(size_t n, void (*cleanup)(void*));\n\n  // Add object pointer and cleanup function pointer to the list.\n  void AddCleanup(void* elem, void (*cleanup)(void*));\n\n private:\n  void* AllocateAlignedFallback(size_t n);\n  void* AllocateAlignedAndAddCleanupFallback(size_t n, void (*cleanup)(void*));\n  void AddCleanupFallback(void* elem, void (*cleanup)(void*));\n\n  // Node contains the ptr of the object to be cleaned up and the associated\n  // cleanup function ptr.\n  struct CleanupNode {\n    void* elem;              // Pointer to the object to be cleaned up.\n    void (*cleanup)(void*);  // Function pointer to the destructor or deleter.\n  };\n\n  // Cleanup uses a chunked linked list, to reduce pointer chasing.\n  struct CleanupChunk {\n    static size_t SizeOf(size_t i) {\n      return sizeof(CleanupChunk) + (sizeof(CleanupNode) * (i - 1));\n    }\n    size_t size;           // Total elements in the list.\n    CleanupChunk* next;    // Next node in the list.\n    CleanupNode nodes[1];  // True length is |size|.\n  };\n\n  class Block;\n\n  // A thread-unsafe Arena that can only be used within its owning thread.\n  class LIBPROTOBUF_EXPORT SerialArena {\n   public:\n    // The allocate/free methods here are a little strange, since SerialArena is\n    // allocated inside a Block which it also manages.  This is to avoid doing\n    // an extra allocation for the SerialArena itself.\n\n    // Creates a new SerialArena inside Block* and returns it.\n    static SerialArena* New(Block* b, void* owner, ArenaImpl* arena);\n\n    // Destroys this SerialArena, freeing all blocks with the given dealloc\n    // function, except any block equal to |initial_block|.\n    static uint64 Free(SerialArena* serial, Block* initial_block,\n                       void (*block_dealloc)(void*, size_t));\n\n    void CleanupList();\n    uint64 SpaceUsed() const;\n\n    void* AllocateAligned(size_t n) {\n      GOOGLE_DCHECK_EQ(internal::AlignUpTo8(n), n);  // Must be already aligned.\n      GOOGLE_DCHECK_GE(limit_, ptr_);\n      if (GOOGLE_PREDICT_FALSE(static_cast<size_t>(limit_ - ptr_) < n)) {\n        return AllocateAlignedFallback(n);\n      }\n      void* ret = ptr_;\n      ptr_ += n;\n#ifdef ADDRESS_SANITIZER\n      ASAN_UNPOISON_MEMORY_REGION(ret, n);\n#endif  // ADDRESS_SANITIZER\n      return ret;\n    }\n\n    void AddCleanup(void* elem, void (*cleanup)(void*)) {\n      if (GOOGLE_PREDICT_FALSE(cleanup_ptr_ == cleanup_limit_)) {\n        AddCleanupFallback(elem, cleanup);\n        return;\n      }\n      cleanup_ptr_->elem = elem;\n      cleanup_ptr_->cleanup = cleanup;\n      cleanup_ptr_++;\n    }\n\n    void* AllocateAlignedAndAddCleanup(size_t n, void (*cleanup)(void*)) {\n      void* ret = AllocateAligned(n);\n      AddCleanup(ret, cleanup);\n      return ret;\n    }\n\n    void* owner() const { return owner_; }\n    SerialArena* next() const { return next_; }\n    void set_next(SerialArena* next) { next_ = next; }\n\n   private:\n    void* AllocateAlignedFallback(size_t n);\n    void AddCleanupFallback(void* elem, void (*cleanup)(void*));\n    void CleanupListFallback();\n\n    ArenaImpl* arena_;        // Containing arena.\n    void* owner_;             // &ThreadCache of this thread;\n    Block* head_;             // Head of linked list of blocks.\n    CleanupChunk* cleanup_;   // Head of cleanup list.\n    SerialArena* next_;       // Next SerialArena in this linked list.\n\n    // Next pointer to allocate from.  Always 8-byte aligned.  Points inside\n    // head_ (and head_->pos will always be non-canonical).  We keep these\n    // here to reduce indirection.\n    char* ptr_;\n    char* limit_;\n\n    // Next CleanupList members to append to.  These point inside cleanup_.\n    CleanupNode* cleanup_ptr_;\n    CleanupNode* cleanup_limit_;\n  };\n\n  // Blocks are variable length malloc-ed objects.  The following structure\n  // describes the common header for all blocks.\n  class LIBPROTOBUF_EXPORT Block {\n   public:\n    Block(size_t size, Block* next);\n\n    char* Pointer(size_t n) {\n      GOOGLE_DCHECK(n <= size_);\n      return reinterpret_cast<char*>(this) + n;\n    }\n\n    Block* next() const { return next_; }\n    size_t pos() const { return pos_; }\n    size_t size() const { return size_; }\n    void set_pos(size_t pos) { pos_ = pos; }\n\n   private:\n    Block* next_;   // Next block for this thread.\n    size_t pos_;\n    size_t size_;\n    // data follows\n  };\n\n  struct ThreadCache {\n#if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL)\n    // If we are using the ThreadLocalStorage class to store the ThreadCache,\n    // then the ThreadCache's default constructor has to be responsible for\n    // initializing it.\n    ThreadCache() : last_lifecycle_id_seen(-1), last_serial_arena(NULL) {}\n#endif\n\n    // The ThreadCache is considered valid as long as this matches the\n    // lifecycle_id of the arena being used.\n    int64 last_lifecycle_id_seen;\n    SerialArena* last_serial_arena;\n  };\n  static std::atomic<int64> lifecycle_id_generator_;\n#if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL)\n  // Android ndk does not support GOOGLE_THREAD_LOCAL keyword so we use a custom thread\n  // local storage class we implemented.\n  // iOS also does not support the GOOGLE_THREAD_LOCAL keyword.\n  static ThreadCache& thread_cache();\n#elif defined(PROTOBUF_USE_DLLS)\n  // Thread local variables cannot be exposed through DLL interface but we can\n  // wrap them in static functions.\n  static ThreadCache& thread_cache();\n#else\n  static GOOGLE_THREAD_LOCAL ThreadCache thread_cache_;\n  static ThreadCache& thread_cache() { return thread_cache_; }\n#endif\n\n  void Init();\n\n  // Free all blocks and return the total space used which is the sums of sizes\n  // of the all the allocated blocks.\n  uint64 FreeBlocks();\n  // Delete or Destruct all objects owned by the arena.\n  void CleanupList();\n\n  inline void CacheSerialArena(SerialArena* serial) {\n    thread_cache().last_serial_arena = serial;\n    thread_cache().last_lifecycle_id_seen = lifecycle_id_;\n    // TODO(haberman): evaluate whether we would gain efficiency by getting rid\n    // of hint_.  It's the only write we do to ArenaImpl in the allocation path,\n    // which will dirty the cache line.\n\n    hint_.store(serial, std::memory_order_release);\n  }\n\n\n  std::atomic<SerialArena*>\n      threads_;                     // Pointer to a linked list of SerialArena.\n  std::atomic<SerialArena*> hint_;  // Fast thread-local block access\n  std::atomic<size_t> space_allocated_;  // Total size of all allocated blocks.\n\n  Block *initial_block_;     // If non-NULL, points to the block that came from\n                             // user data.\n\n  Block* NewBlock(Block* last_block, size_t min_bytes);\n\n  SerialArena* GetSerialArena();\n  bool GetSerialArenaFast(SerialArena** arena);\n  SerialArena* GetSerialArenaFallback(void* me);\n  int64 lifecycle_id_;  // Unique for each arena. Changes on Reset().\n\n  Options options_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ArenaImpl);\n  // All protos have pointers back to the arena hence Arena must have\n  // pointer stability.\n  ArenaImpl(ArenaImpl&&) = delete;\n  ArenaImpl& operator=(ArenaImpl&&) = delete;\n\n public:\n  // kBlockHeaderSize is sizeof(Block), aligned up to the nearest multiple of 8\n  // to protect the invariant that pos is always at a multiple of 8.\n  static const size_t kBlockHeaderSize = (sizeof(Block) + 7) & -8;\n  static const size_t kSerialArenaSize = (sizeof(SerialArena) + 7) & -8;\n  static_assert(kBlockHeaderSize % 8 == 0,\n                \"kBlockHeaderSize must be a multiple of 8.\");\n  static_assert(kSerialArenaSize % 8 == 0,\n                \"kSerialArenaSize must be a multiple of 8.\");\n};\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_ARENA_IMPL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/arenastring.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_ARENASTRING_H__\n#define GOOGLE_PROTOBUF_ARENASTRING_H__\n\n#include <string>\n\n#include <google/protobuf/arena.h>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/fastmem.h>\n#include <google/protobuf/stubs/logging.h>\n#include <google/protobuf/stubs/port.h>\n\n// This is the implementation of arena string fields written for the open-source\n// release. The ArenaStringPtr struct below is an internal implementation class\n// and *should not be used* by user code. It is used to collect string\n// operations together into one place and abstract away the underlying\n// string-field pointer representation, so that (for example) an alternate\n// implementation that knew more about ::std::string's internals could integrate more\n// closely with the arena allocator.\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\ntemplate <typename T>\nclass TaggedPtr {\n public:\n  void Set(T* p) { ptr_ = reinterpret_cast<uintptr_t>(p); }\n  T* Get() const { return reinterpret_cast<T*>(ptr_); }\n\n  bool IsNull() { return ptr_ == 0; }\n\n private:\n  uintptr_t ptr_;\n};\n\nstruct LIBPROTOBUF_EXPORT ArenaStringPtr {\n  inline void Set(const ::std::string* default_value,\n                  const ::std::string& value, ::google::protobuf::Arena* arena) {\n    if (ptr_ == default_value) {\n      CreateInstance(arena, &value);\n    } else {\n      *ptr_ = value;\n    }\n  }\n\n  inline void SetLite(const ::std::string* default_value,\n                      const ::std::string& value,\n                      ::google::protobuf::Arena* arena) {\n    Set(default_value, value, arena);\n  }\n\n  // Basic accessors.\n  inline const ::std::string& Get() const { return *ptr_; }\n\n  inline ::std::string* Mutable(const ::std::string* default_value,\n                           ::google::protobuf::Arena* arena) {\n    if (ptr_ == default_value) {\n      CreateInstance(arena, default_value);\n    }\n    return ptr_;\n  }\n\n  // Release returns a ::std::string* instance that is heap-allocated and is not\n  // Own()'d by any arena. If the field was not set, it returns NULL. The caller\n  // retains ownership. Clears this field back to NULL state. Used to implement\n  // release_<field>() methods on generated classes.\n  inline ::std::string* Release(const ::std::string* default_value,\n                           ::google::protobuf::Arena* arena) {\n    if (ptr_ == default_value) {\n      return NULL;\n    }\n    return ReleaseNonDefault(default_value, arena);\n  }\n\n  // Similar to Release, but ptr_ cannot be the default_value.\n  inline ::std::string* ReleaseNonDefault(\n      const ::std::string* default_value, ::google::protobuf::Arena* arena) {\n    GOOGLE_DCHECK(!IsDefault(default_value));\n    ::std::string* released = NULL;\n    if (arena != NULL) {\n      // ptr_ is owned by the arena.\n      released = new ::std::string;\n      released->swap(*ptr_);\n    } else {\n      released = ptr_;\n    }\n    ptr_ = const_cast< ::std::string* >(default_value);\n    return released;\n  }\n\n  // UnsafeArenaRelease returns a ::std::string*, but it may be arena-owned (i.e.\n  // have its destructor already registered) if arena != NULL. If the field was\n  // not set, this returns NULL. This method clears this field back to NULL\n  // state. Used to implement unsafe_arena_release_<field>() methods on\n  // generated classes.\n  inline ::std::string* UnsafeArenaRelease(const ::std::string* default_value,\n                                      ::google::protobuf::Arena* /* arena */) {\n    if (ptr_ == default_value) {\n      return NULL;\n    }\n    ::std::string* released = ptr_;\n    ptr_ = const_cast< ::std::string* >(default_value);\n    return released;\n  }\n\n  // Takes a string that is heap-allocated, and takes ownership. The string's\n  // destructor is registered with the arena. Used to implement\n  // set_allocated_<field> in generated classes.\n  inline void SetAllocated(const ::std::string* default_value,\n                           ::std::string* value, ::google::protobuf::Arena* arena) {\n    if (arena == NULL && ptr_ != default_value) {\n      Destroy(default_value, arena);\n    }\n    if (value != NULL) {\n      ptr_ = value;\n      if (arena != NULL) {\n        arena->Own(value);\n      }\n    } else {\n      ptr_ = const_cast< ::std::string* >(default_value);\n    }\n  }\n\n  // Takes a string that has lifetime equal to the arena's lifetime. The arena\n  // must be non-null. It is safe only to pass this method a value returned by\n  // UnsafeArenaRelease() on another field of a message in the same arena. Used\n  // to implement unsafe_arena_set_allocated_<field> in generated classes.\n  inline void UnsafeArenaSetAllocated(const ::std::string* default_value,\n                                      ::std::string* value,\n                                      ::google::protobuf::Arena* /* arena */) {\n    if (value != NULL) {\n      ptr_ = value;\n    } else {\n      ptr_ = const_cast< ::std::string* >(default_value);\n    }\n  }\n\n  // Swaps internal pointers. Arena-safety semantics: this is guarded by the\n  // logic in Swap()/UnsafeArenaSwap() at the message level, so this method is\n  // 'unsafe' if called directly.\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Swap(ArenaStringPtr* other) {\n    std::swap(ptr_, other->ptr_);\n  }\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Swap(\n      ArenaStringPtr* other, const ::std::string* default_value, Arena* arena) {\n#ifndef NDEBUG\n    // For debug builds, we swap the contents of the string, rather than the\n    // string instances themselves.  This invalidates previously taken const\n    // references that are (per our documentation) invalidated by calling Swap()\n    // on the message.\n    //\n    // If both strings are the default_value, swapping is uninteresting.\n    // Otherwise, we use ArenaStringPtr::Mutable() to access the string, to\n    // ensure that we do not try to mutate default_value itself.\n    if (IsDefault(default_value) && other->IsDefault(default_value)) {\n      return;\n    }\n\n    ::std::string* this_ptr = Mutable(default_value, arena);\n    ::std::string* other_ptr = other->Mutable(default_value, arena);\n\n    this_ptr->swap(*other_ptr);\n#else\n    std::swap(ptr_, other->ptr_);\n#endif\n  }\n\n  // Frees storage (if not on an arena).\n  inline void Destroy(const ::std::string* default_value,\n                      ::google::protobuf::Arena* arena) {\n    if (arena == NULL && ptr_ != default_value) {\n      delete ptr_;\n    }\n  }\n\n  // Clears content, but keeps allocated string if arena != NULL, to avoid the\n  // overhead of heap operations. After this returns, the content (as seen by\n  // the user) will always be the empty string. Assumes that |default_value|\n  // is an empty string.\n  inline void ClearToEmpty(const ::std::string* default_value,\n                           ::google::protobuf::Arena* /* arena */) {\n    if (ptr_ == default_value) {\n      // Already set to default (which is empty) -- do nothing.\n    } else {\n      ptr_->clear();\n    }\n  }\n\n  // Clears content, assuming that the current value is not the empty string\n  // default.\n  inline void ClearNonDefaultToEmpty() {\n    ptr_->clear();\n  }\n  inline void ClearNonDefaultToEmptyNoArena() {\n    ptr_->clear();\n  }\n\n  // Clears content, but keeps allocated string if arena != NULL, to avoid the\n  // overhead of heap operations. After this returns, the content (as seen by\n  // the user) will always be equal to |default_value|.\n  inline void ClearToDefault(const ::std::string* default_value,\n                             ::google::protobuf::Arena* /* arena */) {\n    if (ptr_ == default_value) {\n      // Already set to default -- do nothing.\n    } else {\n      // Have another allocated string -- rather than throwing this away and\n      // resetting ptr_ to the canonical default string instance, we just reuse\n      // this instance.\n      *ptr_ = *default_value;\n    }\n  }\n\n  // Called from generated code / reflection runtime only. Resets value to point\n  // to a default string pointer, with the semantics that this ArenaStringPtr\n  // does not own the pointed-to memory. Disregards initial value of ptr_ (so\n  // this is the *ONLY* safe method to call after construction or when\n  // reinitializing after becoming the active field in a oneof union).\n  inline void UnsafeSetDefault(const ::std::string* default_value) {\n    // Casting away 'const' is safe here: accessors ensure that ptr_ is only\n    // returned as a const if it is equal to default_value.\n    ptr_ = const_cast< ::std::string* >(default_value);\n  }\n\n  // The 'NoArena' variants of methods below assume arena == NULL and are\n  // optimized to provide very little overhead relative to a raw string pointer\n  // (while still being in-memory compatible with other code that assumes\n  // ArenaStringPtr). Note the invariant that a class instance that has only\n  // ever been mutated by NoArena methods must *only* be in the String state\n  // (i.e., tag bits are not used), *NEVER* ArenaString. This allows all\n  // tagged-pointer manipulations to be avoided.\n  inline void SetNoArena(const ::std::string* default_value,\n                         const ::std::string& value) {\n    if (ptr_ == default_value) {\n      CreateInstanceNoArena(&value);\n    } else {\n      *ptr_ = value;\n    }\n  }\n\n#if LANG_CXX11\n  void SetNoArena(const ::std::string* default_value, ::std::string&& value) {\n    if (IsDefault(default_value)) {\n      ptr_ = new ::std::string(std::move(value));\n    } else {\n      *ptr_ = std::move(value);\n    }\n  }\n#endif\n\n  void AssignWithDefault(const ::std::string* default_value, ArenaStringPtr value);\n\n  inline const ::std::string& GetNoArena() const { return *ptr_; }\n\n  inline ::std::string* MutableNoArena(const ::std::string* default_value) {\n    if (ptr_ == default_value) {\n      CreateInstanceNoArena(default_value);\n    }\n    return ptr_;\n  }\n\n  inline ::std::string* ReleaseNoArena(const ::std::string* default_value) {\n    if (ptr_ == default_value) {\n      return NULL;\n    } else {\n      return ReleaseNonDefaultNoArena(default_value);\n    }\n  }\n\n  inline ::std::string* ReleaseNonDefaultNoArena(\n      const ::std::string* default_value) {\n    GOOGLE_DCHECK(!IsDefault(default_value));\n    ::std::string* released = ptr_;\n    ptr_ = const_cast< ::std::string* >(default_value);\n    return released;\n  }\n\n\n  inline void SetAllocatedNoArena(const ::std::string* default_value,\n                                  ::std::string* value) {\n    if (ptr_ != default_value) {\n      delete ptr_;\n    }\n    if (value != NULL) {\n      ptr_ = value;\n    } else {\n      ptr_ = const_cast< ::std::string* >(default_value);\n    }\n  }\n\n  inline void DestroyNoArena(const ::std::string* default_value) {\n    if (ptr_ != default_value) {\n      delete ptr_;\n    }\n  }\n\n  inline void ClearToEmptyNoArena(const ::std::string* default_value) {\n    if (ptr_ == default_value) {\n      // Nothing: already equal to default (which is the empty string).\n    } else {\n      ptr_->clear();\n    }\n  }\n\n  inline void ClearToDefaultNoArena(const ::std::string* default_value) {\n    if (ptr_ == default_value) {\n      // Nothing: already set to default.\n    } else {\n      // Reuse existing allocated instance.\n      *ptr_ = *default_value;\n    }\n  }\n\n  // Internal accessor used only at parse time to provide direct access to the\n  // raw pointer from the shared parse routine (in the non-arenas case). The\n  // parse routine does the string allocation in order to save code size in the\n  // generated parsing code.\n  inline ::std::string** UnsafeRawStringPointer() {\n    return &ptr_;\n  }\n\n  inline bool IsDefault(const ::std::string* default_value) const {\n    return ptr_ == default_value;\n  }\n\n  // Internal accessors!!!!\n  void UnsafeSetTaggedPointer(TaggedPtr< ::std::string> value) {\n    ptr_ = value.Get();\n  }\n  // Generated code only! An optimization, in certain cases the generated\n  // code is certain we can obtain a string with no default checks and\n  // tag tests.\n  ::std::string* UnsafeMutablePointer() { return ptr_; }\n\n private:\n  ::std::string* ptr_;\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE\n  void CreateInstance(::google::protobuf::Arena* arena,\n                      const ::std::string* initial_value) {\n    GOOGLE_DCHECK(initial_value != NULL);\n    // uses \"new ::std::string\" when arena is nullptr\n    ptr_ = Arena::Create< ::std::string >(arena, *initial_value);\n  }\n  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE\n  void CreateInstanceNoArena(const ::std::string* initial_value) {\n    GOOGLE_DCHECK(initial_value != NULL);\n    ptr_ = new ::std::string(*initial_value);\n  }\n};\n\n}  // namespace internal\n}  // namespace protobuf\n\n\n\nnamespace protobuf {\nnamespace internal {\n\ninline void ArenaStringPtr::AssignWithDefault(const ::std::string* default_value,\n                                       ArenaStringPtr value) {\n  const ::std::string* me = *UnsafeRawStringPointer();\n  const ::std::string* other = *value.UnsafeRawStringPointer();\n  // If the pointers are the same then do nothing.\n  if (me != other) {\n    SetNoArena(default_value, value.GetNoArena());\n  }\n}\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_ARENASTRING_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/code_generator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Defines the abstract interface implemented by each of the language-specific\n// code generators.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_H__\n#define GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_H__\n\n#include <google/protobuf/stubs/common.h>\n#include <string>\n#include <vector>\n#include <utility>\n\nnamespace google {\nnamespace protobuf {\n\nnamespace io { class ZeroCopyOutputStream; }\nclass FileDescriptor;\n\nnamespace compiler {\nclass AccessInfoMap;\n\nclass Version;\n\n// Defined in this file.\nclass CodeGenerator;\nclass GeneratorContext;\n\n// The abstract interface to a class which generates code implementing a\n// particular proto file in a particular language.  A number of these may\n// be registered with CommandLineInterface to support various languages.\nclass LIBPROTOC_EXPORT CodeGenerator {\n public:\n  inline CodeGenerator() {}\n  virtual ~CodeGenerator();\n\n  // Generates code for the given proto file, generating one or more files in\n  // the given output directory.\n  //\n  // A parameter to be passed to the generator can be specified on the command\n  // line. This is intended to be used to pass generator specific parameters.\n  // It is empty if no parameter was given. ParseGeneratorParameter (below),\n  // can be used to accept multiple parameters within the single parameter\n  // command line flag.\n  //\n  // Returns true if successful.  Otherwise, sets *error to a description of\n  // the problem (e.g. \"invalid parameter\") and returns false.\n  virtual bool Generate(const FileDescriptor* file,\n                        const string& parameter,\n                        GeneratorContext* generator_context,\n                        string* error) const = 0;\n\n  // Generates code for all given proto files.\n  //\n  // WARNING: The canonical code generator design produces one or two output\n  // files per input .proto file, and we do not wish to encourage alternate\n  // designs.\n  //\n  // A parameter is given as passed on the command line, as in |Generate()|\n  // above.\n  //\n  // Returns true if successful.  Otherwise, sets *error to a description of\n  // the problem (e.g. \"invalid parameter\") and returns false.\n  virtual bool GenerateAll(const std::vector<const FileDescriptor*>& files,\n                           const string& parameter,\n                           GeneratorContext* generator_context,\n                           string* error) const;\n\n  // This is no longer used, but this class is part of the opensource protobuf\n  // library, so it has to remain to keep vtables the same for the current\n  // version of the library. When protobufs does a api breaking change, the\n  // method can be removed.\n  virtual bool HasGenerateAll() const { return true; }\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CodeGenerator);\n};\n\n// CodeGenerators generate one or more files in a given directory.  This\n// abstract interface represents the directory to which the CodeGenerator is\n// to write and other information about the context in which the Generator\n// runs.\nclass LIBPROTOC_EXPORT GeneratorContext {\n public:\n  inline GeneratorContext() {\n  }\n  virtual ~GeneratorContext();\n\n  // Opens the given file, truncating it if it exists, and returns a\n  // ZeroCopyOutputStream that writes to the file.  The caller takes ownership\n  // of the returned object.  This method never fails (a dummy stream will be\n  // returned instead).\n  //\n  // The filename given should be relative to the root of the source tree.\n  // E.g. the C++ generator, when generating code for \"foo/bar.proto\", will\n  // generate the files \"foo/bar.pb.h\" and \"foo/bar.pb.cc\"; note that\n  // \"foo/\" is included in these filenames.  The filename is not allowed to\n  // contain \".\" or \"..\" components.\n  virtual io::ZeroCopyOutputStream* Open(const string& filename) = 0;\n\n  // Similar to Open() but the output will be appended to the file if exists\n  virtual io::ZeroCopyOutputStream* OpenForAppend(const string& filename);\n\n  // Creates a ZeroCopyOutputStream which will insert code into the given file\n  // at the given insertion point.  See plugin.proto (plugin.pb.h) for more\n  // information on insertion points.  The default implementation\n  // assert-fails -- it exists only for backwards-compatibility.\n  //\n  // WARNING:  This feature is currently EXPERIMENTAL and is subject to change.\n  virtual io::ZeroCopyOutputStream* OpenForInsert(\n      const string& filename, const string& insertion_point);\n\n  // Returns a vector of FileDescriptors for all the files being compiled\n  // in this run.  Useful for languages, such as Go, that treat files\n  // differently when compiled as a set rather than individually.\n  virtual void ListParsedFiles(std::vector<const FileDescriptor*>* output);\n\n  // Retrieves the version number of the protocol compiler associated with\n  // this GeneratorContext.\n  virtual void GetCompilerVersion(Version* version) const;\n\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GeneratorContext);\n};\n\n// The type GeneratorContext was once called OutputDirectory. This typedef\n// provides backward compatibility.\ntypedef GeneratorContext OutputDirectory;\n\n// Several code generators treat the parameter argument as holding a\n// list of options separated by commas.  This helper function parses\n// a set of comma-delimited name/value pairs: e.g.,\n//   \"foo=bar,baz,qux=corge\"\n// parses to the pairs:\n//   (\"foo\", \"bar\"), (\"baz\", \"\"), (\"qux\", \"corge\")\nLIBPROTOC_EXPORT void ParseGeneratorParameter(\n    const string&, std::vector<std::pair<string, string> >*);\n\n}  // namespace compiler\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/command_line_interface.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Implements the Protocol Compiler front-end such that it may be reused by\n// custom compilers written to support other languages.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_COMMAND_LINE_INTERFACE_H__\n#define GOOGLE_PROTOBUF_COMPILER_COMMAND_LINE_INTERFACE_H__\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/hash.h>\n#include <string>\n#include <vector>\n#include <map>\n#include <set>\n#include <utility>\n\nnamespace google {\nnamespace protobuf {\n\nclass Descriptor;            // descriptor.h\nclass DescriptorPool;        // descriptor.h\nclass FileDescriptor;        // descriptor.h\nclass FileDescriptorSet;     // descriptor.h\nclass FileDescriptorProto;   // descriptor.pb.h\ntemplate<typename T> class RepeatedPtrField;  // repeated_field.h\nclass SimpleDescriptorDatabase;               // descriptor_database.h\n\nnamespace compiler {\n\nclass CodeGenerator;     // code_generator.h\nclass GeneratorContext;  // code_generator.h\nclass DiskSourceTree;    // importer.h\n\n// This class implements the command-line interface to the protocol compiler.\n// It is designed to make it very easy to create a custom protocol compiler\n// supporting the languages of your choice.  For example, if you wanted to\n// create a custom protocol compiler binary which includes both the regular\n// C++ support plus support for your own custom output \"Foo\", you would\n// write a class \"FooGenerator\" which implements the CodeGenerator interface,\n// then write a main() procedure like this:\n//\n//   int main(int argc, char* argv[]) {\n//     google::protobuf::compiler::CommandLineInterface cli;\n//\n//     // Support generation of C++ source and headers.\n//     google::protobuf::compiler::cpp::CppGenerator cpp_generator;\n//     cli.RegisterGenerator(\"--cpp_out\", &cpp_generator,\n//       \"Generate C++ source and header.\");\n//\n//     // Support generation of Foo code.\n//     FooGenerator foo_generator;\n//     cli.RegisterGenerator(\"--foo_out\", &foo_generator,\n//       \"Generate Foo file.\");\n//\n//     return cli.Run(argc, argv);\n//   }\n//\n// The compiler is invoked with syntax like:\n//   protoc --cpp_out=outdir --foo_out=outdir --proto_path=src src/foo.proto\n//\n// The .proto file to compile can be specified on the command line using either\n// its physical file path, or a virtual path relative to a diretory specified\n// in --proto_path. For example, for src/foo.proto, the following two protoc\n// invocations work the same way:\n//   1. protoc --proto_path=src src/foo.proto (physical file path)\n//   2. protoc --proto_path=src foo.proto (virtual path relative to src)\n//\n// If a file path can be interpreted both as a physical file path and as a\n// relative virtual path, the physical file path takes precendence.\n//\n// For a full description of the command-line syntax, invoke it with --help.\nclass LIBPROTOC_EXPORT CommandLineInterface {\n public:\n  static const char* const kPathSeparator;\n\n  CommandLineInterface();\n  ~CommandLineInterface();\n\n  // Register a code generator for a language.\n  //\n  // Parameters:\n  // * flag_name: The command-line flag used to specify an output file of\n  //   this type.  The name must start with a '-'.  If the name is longer\n  //   than one letter, it must start with two '-'s.\n  // * generator: The CodeGenerator which will be called to generate files\n  //   of this type.\n  // * help_text: Text describing this flag in the --help output.\n  //\n  // Some generators accept extra parameters.  You can specify this parameter\n  // on the command-line by placing it before the output directory, separated\n  // by a colon:\n  //   protoc --foo_out=enable_bar:outdir\n  // The text before the colon is passed to CodeGenerator::Generate() as the\n  // \"parameter\".\n  void RegisterGenerator(const string& flag_name,\n                         CodeGenerator* generator,\n                         const string& help_text);\n\n  // Register a code generator for a language.\n  // Besides flag_name you can specify another option_flag_name that could be\n  // used to pass extra parameters to the registered code generator.\n  // Suppose you have registered a generator by calling:\n  //   command_line_interface.RegisterGenerator(\"--foo_out\", \"--foo_opt\", ...)\n  // Then you could invoke the compiler with a command like:\n  //   protoc --foo_out=enable_bar:outdir --foo_opt=enable_baz\n  // This will pass \"enable_bar,enable_baz\" as the parameter to the generator.\n  void RegisterGenerator(const string& flag_name,\n                         const string& option_flag_name,\n                         CodeGenerator* generator,\n                         const string& help_text);\n\n  // Enables \"plugins\".  In this mode, if a command-line flag ends with \"_out\"\n  // but does not match any registered generator, the compiler will attempt to\n  // find a \"plugin\" to implement the generator.  Plugins are just executables.\n  // They should live somewhere in the PATH.\n  //\n  // The compiler determines the executable name to search for by concatenating\n  // exe_name_prefix with the unrecognized flag name, removing \"_out\".  So, for\n  // example, if exe_name_prefix is \"protoc-\" and you pass the flag --foo_out,\n  // the compiler will try to run the program \"protoc-foo\".\n  //\n  // The plugin program should implement the following usage:\n  //   plugin [--out=OUTDIR] [--parameter=PARAMETER] PROTO_FILES < DESCRIPTORS\n  // --out indicates the output directory (as passed to the --foo_out\n  // parameter); if omitted, the current directory should be used.  --parameter\n  // gives the generator parameter, if any was provided (see below).  The\n  // PROTO_FILES list the .proto files which were given on the compiler\n  // command-line; these are the files for which the plugin is expected to\n  // generate output code.  Finally, DESCRIPTORS is an encoded FileDescriptorSet\n  // (as defined in descriptor.proto).  This is piped to the plugin's stdin.\n  // The set will include descriptors for all the files listed in PROTO_FILES as\n  // well as all files that they import.  The plugin MUST NOT attempt to read\n  // the PROTO_FILES directly -- it must use the FileDescriptorSet.\n  //\n  // The plugin should generate whatever files are necessary, as code generators\n  // normally do.  It should write the names of all files it generates to\n  // stdout.  The names should be relative to the output directory, NOT absolute\n  // names or relative to the current directory.  If any errors occur, error\n  // messages should be written to stderr.  If an error is fatal, the plugin\n  // should exit with a non-zero exit code.\n  //\n  // Plugins can have generator parameters similar to normal built-in\n  // generators. Extra generator parameters can be passed in via a matching\n  // \"_opt\" parameter. For example:\n  //   protoc --plug_out=enable_bar:outdir --plug_opt=enable_baz\n  // This will pass \"enable_bar,enable_baz\" as the parameter to the plugin.\n  //\n  void AllowPlugins(const string& exe_name_prefix);\n\n  // Run the Protocol Compiler with the given command-line parameters.\n  // Returns the error code which should be returned by main().\n  //\n  // It may not be safe to call Run() in a multi-threaded environment because\n  // it calls strerror().  I'm not sure why you'd want to do this anyway.\n  int Run(int argc, const char* const argv[]);\n\n  // DEPRECATED. Calling this method has no effect. Protocol compiler now\n  // always try to find the .proto file relative to the current directory\n  // first and if the file is not found, it will then treat the input path\n  // as a virutal path.\n  void SetInputsAreProtoPathRelative(bool /* enable */) {}\n\n  // Provides some text which will be printed when the --version flag is\n  // used.  The version of libprotoc will also be printed on the next line\n  // after this text.\n  void SetVersionInfo(const string& text) {\n    version_info_ = text;\n  }\n\n\n private:\n  // -----------------------------------------------------------------\n\n  class ErrorPrinter;\n  class GeneratorContextImpl;\n  class MemoryOutputStream;\n  typedef hash_map<string, GeneratorContextImpl*> GeneratorContextMap;\n\n  // Clear state from previous Run().\n  void Clear();\n\n  // Remaps each file in input_files_ so that it is relative to one of the\n  // directories in proto_path_.  Returns false if an error occurred.  This\n  // is only used if inputs_are_proto_path_relative_ is false.\n  bool MakeInputsBeProtoPathRelative(\n    DiskSourceTree* source_tree);\n\n  // Return status for ParseArguments() and InterpretArgument().\n  enum ParseArgumentStatus {\n    PARSE_ARGUMENT_DONE_AND_CONTINUE,\n    PARSE_ARGUMENT_DONE_AND_EXIT,\n    PARSE_ARGUMENT_FAIL\n  };\n\n  // Parse all command-line arguments.\n  ParseArgumentStatus ParseArguments(int argc, const char* const argv[]);\n\n  // Read an argument file and append the file's content to the list of\n  // arguments. Return false if the file cannot be read.\n  bool ExpandArgumentFile(const string& file, std::vector<string>* arguments);\n\n  // Parses a command-line argument into a name/value pair.  Returns\n  // true if the next argument in the argv should be used as the value,\n  // false otherwise.\n  //\n  // Examples:\n  //   \"-Isrc/protos\" ->\n  //     name = \"-I\", value = \"src/protos\"\n  //   \"--cpp_out=src/foo.pb2.cc\" ->\n  //     name = \"--cpp_out\", value = \"src/foo.pb2.cc\"\n  //   \"foo.proto\" ->\n  //     name = \"\", value = \"foo.proto\"\n  bool ParseArgument(const char* arg, string* name, string* value);\n\n  // Interprets arguments parsed with ParseArgument.\n  ParseArgumentStatus InterpretArgument(const string& name,\n                                        const string& value);\n\n  // Print the --help text to stderr.\n  void PrintHelpText();\n\n  // Loads proto_path_ into the provided source_tree.\n  bool InitializeDiskSourceTree(DiskSourceTree* source_tree);\n\n  // Loads descriptor_set_in into the provided database\n  bool PopulateSimpleDescriptorDatabase(SimpleDescriptorDatabase* database);\n\n  // Parses input_files_ into parsed_files\n  bool ParseInputFiles(DescriptorPool* descriptor_pool,\n                       std::vector<const FileDescriptor*>* parsed_files);\n\n  // Generate the given output file from the given input.\n  struct OutputDirective;  // see below\n  bool GenerateOutput(const std::vector<const FileDescriptor*>& parsed_files,\n                      const OutputDirective& output_directive,\n                      GeneratorContext* generator_context);\n  bool GeneratePluginOutput(\n      const std::vector<const FileDescriptor*>& parsed_files,\n      const string& plugin_name, const string& parameter,\n      GeneratorContext* generator_context, string* error);\n\n  // Implements --encode and --decode.\n  bool EncodeOrDecode(const DescriptorPool* pool);\n\n  // Implements the --descriptor_set_out option.\n  bool WriteDescriptorSet(\n      const std::vector<const FileDescriptor*>& parsed_files);\n\n  // Implements the --dependency_out option\n  bool GenerateDependencyManifestFile(\n      const std::vector<const FileDescriptor*>& parsed_files,\n      const GeneratorContextMap& output_directories,\n      DiskSourceTree* source_tree);\n\n  // Get all transitive dependencies of the given file (including the file\n  // itself), adding them to the given list of FileDescriptorProtos.  The\n  // protos will be ordered such that every file is listed before any file that\n  // depends on it, so that you can call DescriptorPool::BuildFile() on them\n  // in order.  Any files in *already_seen will not be added, and each file\n  // added will be inserted into *already_seen.  If include_source_code_info is\n  // true then include the source code information in the FileDescriptorProtos.\n  // If include_json_name is true, populate the json_name field of\n  // FieldDescriptorProto for all fields.\n  static void GetTransitiveDependencies(\n      const FileDescriptor* file,\n      bool include_json_name,\n      bool include_source_code_info,\n      std::set<const FileDescriptor*>* already_seen,\n      RepeatedPtrField<FileDescriptorProto>* output);\n\n  // Implements the --print_free_field_numbers. This function prints free field\n  // numbers into stdout for the message and it's nested message types in\n  // post-order, i.e. nested types first. Printed range are left-right\n  // inclusive, i.e. [a, b].\n  //\n  // Groups:\n  // For historical reasons, groups are considered to share the same\n  // field number space with the parent message, thus it will not print free\n  // field numbers for groups. The field numbers used in the groups are\n  // excluded in the free field numbers of the parent message.\n  //\n  // Extension Ranges:\n  // Extension ranges are considered ocuppied field numbers and they will not be\n  // listed as free numbers in the output.\n  void PrintFreeFieldNumbers(const Descriptor* descriptor);\n\n  // -----------------------------------------------------------------\n\n  // The name of the executable as invoked (i.e. argv[0]).\n  string executable_name_;\n\n  // Version info set with SetVersionInfo().\n  string version_info_;\n\n  // Registered generators.\n  struct GeneratorInfo {\n    string flag_name;\n    string option_flag_name;\n    CodeGenerator* generator;\n    string help_text;\n  };\n  typedef std::map<string, GeneratorInfo> GeneratorMap;\n  GeneratorMap generators_by_flag_name_;\n  GeneratorMap generators_by_option_name_;\n  // A map from generator names to the parameters specified using the option\n  // flag. For example, if the user invokes the compiler with:\n  //   protoc --foo_out=outputdir --foo_opt=enable_bar ...\n  // Then there will be an entry (\"--foo_out\", \"enable_bar\") in this map.\n  std::map<string, string> generator_parameters_;\n  // Similar to generator_parameters_, but stores the parameters for plugins.\n  std::map<string, string> plugin_parameters_;\n\n  // See AllowPlugins().  If this is empty, plugins aren't allowed.\n  string plugin_prefix_;\n\n  // Maps specific plugin names to files.  When executing a plugin, this map\n  // is searched first to find the plugin executable.  If not found here, the\n  // PATH (or other OS-specific search strategy) is searched.\n  std::map<string, string> plugins_;\n\n  // Stuff parsed from command line.\n  enum Mode {\n    MODE_COMPILE,  // Normal mode:  parse .proto files and compile them.\n    MODE_ENCODE,   // --encode:  read text from stdin, write binary to stdout.\n    MODE_DECODE,   // --decode:  read binary from stdin, write text to stdout.\n    MODE_PRINT,    // Print mode: print info of the given .proto files and exit.\n  };\n\n  Mode mode_;\n\n  enum PrintMode {\n    PRINT_NONE,               // Not in MODE_PRINT\n    PRINT_FREE_FIELDS,        // --print_free_fields\n  };\n\n  PrintMode print_mode_;\n\n  enum ErrorFormat {\n    ERROR_FORMAT_GCC,   // GCC error output format (default).\n    ERROR_FORMAT_MSVS   // Visual Studio output (--error_format=msvs).\n  };\n\n  ErrorFormat error_format_;\n\n  std::vector<std::pair<string, string> >\n      proto_path_;                   // Search path for proto files.\n  std::vector<string> input_files_;  // Names of the input proto files.\n\n  // Names of proto files which are allowed to be imported. Used by build\n  // systems to enforce depend-on-what-you-import.\n  std::set<string> direct_dependencies_;\n  bool direct_dependencies_explicitly_set_;\n\n  // If there's a violation of depend-on-what-you-import, this string will be\n  // presented to the user. \"%s\" will be replaced with the violating import.\n  string direct_dependencies_violation_msg_;\n\n  // output_directives_ lists all the files we are supposed to output and what\n  // generator to use for each.\n  struct OutputDirective {\n    string name;                // E.g. \"--foo_out\"\n    CodeGenerator* generator;   // NULL for plugins\n    string parameter;\n    string output_location;\n  };\n  std::vector<OutputDirective> output_directives_;\n\n  // When using --encode or --decode, this names the type we are encoding or\n  // decoding.  (Empty string indicates --decode_raw.)\n  string codec_type_;\n\n  // If --descriptor_set_in was given, these are filenames containing\n  // parsed FileDescriptorSets to be used for loading protos.  Otherwise, empty.\n  std::vector<string> descriptor_set_in_names_;\n\n  // If --descriptor_set_out was given, this is the filename to which the\n  // FileDescriptorSet should be written.  Otherwise, empty.\n  string descriptor_set_out_name_;\n\n  // If --dependency_out was given, this is the path to the file where the\n  // dependency file will be written. Otherwise, empty.\n  string dependency_out_name_;\n\n  // True if --include_imports was given, meaning that we should\n  // write all transitive dependencies to the DescriptorSet.  Otherwise, only\n  // the .proto files listed on the command-line are added.\n  bool imports_in_descriptor_set_;\n\n  // True if --include_source_info was given, meaning that we should not strip\n  // SourceCodeInfo from the DescriptorSet.\n  bool source_info_in_descriptor_set_;\n\n  // Was the --disallow_services flag used?\n  bool disallow_services_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CommandLineInterface);\n};\n\n}  // namespace compiler\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_COMMAND_LINE_INTERFACE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/cpp/cpp_generator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Generates C++ code for a given .proto file.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__\n#define GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__\n\n#include <string>\n#include <google/protobuf/compiler/code_generator.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\nnamespace cpp {\n\n// CodeGenerator implementation which generates a C++ source file and\n// header.  If you create your own protocol compiler binary and you want\n// it to support C++ output, you can do so by registering an instance of this\n// CodeGenerator with the CommandLineInterface in your main() function.\nclass LIBPROTOC_EXPORT CppGenerator : public CodeGenerator {\n public:\n  CppGenerator();\n  ~CppGenerator();\n\n  // implements CodeGenerator ----------------------------------------\n  bool Generate(const FileDescriptor* file,\n                const string& parameter,\n                GeneratorContext* generator_context,\n                string* error) const;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CppGenerator);\n};\n\n}  // namespace cpp\n}  // namespace compiler\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/csharp/csharp_generator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Generates C# code for a given .proto file.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__\n#define GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__\n\n#include <string>\n\n#include <google/protobuf/compiler/code_generator.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\nnamespace csharp {\n\n// CodeGenerator implementation which generates a C# source file and\n// header.  If you create your own protocol compiler binary and you want\n// it to support C# output, you can do so by registering an instance of this\n// CodeGenerator with the CommandLineInterface in your main() function.\nclass LIBPROTOC_EXPORT Generator\n    : public google::protobuf::compiler::CodeGenerator {\npublic:\n  virtual bool Generate(\n      const FileDescriptor* file,\n      const string& parameter,\n      GeneratorContext* generator_context,\n      string* error) const;\n};\n\n}  // namespace csharp\n}  // namespace compiler\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/csharp/csharp_names.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Provides a mechanism for mapping a descriptor to the\n// fully-qualified name of the corresponding C# class.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__\n#define GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__\n\n#include <string>\n#include <google/protobuf/stubs/port.h>\n\nnamespace google {\nnamespace protobuf {\n\nclass Descriptor;\nclass EnumDescriptor;\nclass FileDescriptor;\nclass ServiceDescriptor;\n\nnamespace compiler {\nnamespace csharp {\n\n// Requires:\n//   descriptor != NULL\n//\n// Returns:\n//   The namespace to use for given file descriptor.\nstring LIBPROTOC_EXPORT GetFileNamespace(const FileDescriptor* descriptor);\n\n// Requires:\n//   descriptor != NULL\n//\n// Returns:\n//   The fully-qualified C# class name.\nstring LIBPROTOC_EXPORT GetClassName(const Descriptor* descriptor);\n\n// Requires:\n//   descriptor != NULL\n//\n// Returns:\n//   The fully-qualified name of the C# class that provides\n//   access to the file descriptor. Proto compiler generates\n//   such class for each .proto file processed.\nstring LIBPROTOC_EXPORT GetReflectionClassName(const FileDescriptor* descriptor);\n\n// Generates output file name for given file descriptor. If generate_directories\n// is true, the output file will be put under directory corresponding to file's\n// namespace. base_namespace can be used to strip some of the top level\n// directories. E.g. for file with namespace \"Bar.Foo\" and base_namespace=\"Bar\",\n// the resulting file will be put under directory \"Foo\" (and not \"Bar/Foo\").\n//\n// Requires:\n//   descriptor != NULL\n//   error != NULL\n//\n//  Returns:\n//    The file name to use as output file for given file descriptor. In case\n//    of failure, this function will return empty string and error parameter\n//    will contain the error message.\nstring LIBPROTOC_EXPORT GetOutputFile(\n    const google::protobuf::FileDescriptor* descriptor,\n    const string file_extension,\n    const bool generate_directories,\n    const string base_namespace,\n    string* error);\n\n}  // namespace csharp\n}  // namespace compiler\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/importer.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This file is the public interface to the .proto file parser.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_IMPORTER_H__\n#define GOOGLE_PROTOBUF_COMPILER_IMPORTER_H__\n\n#include <string>\n#include <vector>\n#include <set>\n#include <utility>\n#include <google/protobuf/descriptor.h>\n#include <google/protobuf/descriptor_database.h>\n#include <google/protobuf/compiler/parser.h>\n\nnamespace google {\nnamespace protobuf {\n\nnamespace io { class ZeroCopyInputStream; }\n\nnamespace compiler {\n\n// Defined in this file.\nclass Importer;\nclass MultiFileErrorCollector;\nclass SourceTree;\nclass DiskSourceTree;\n\n// TODO(kenton):  Move all SourceTree stuff to a separate file?\n\n// An implementation of DescriptorDatabase which loads files from a SourceTree\n// and parses them.\n//\n// Note:  This class is not thread-safe since it maintains a table of source\n//   code locations for error reporting.  However, when a DescriptorPool wraps\n//   a DescriptorDatabase, it uses mutex locking to make sure only one method\n//   of the database is called at a time, even if the DescriptorPool is used\n//   from multiple threads.  Therefore, there is only a problem if you create\n//   multiple DescriptorPools wrapping the same SourceTreeDescriptorDatabase\n//   and use them from multiple threads.\n//\n// Note:  This class does not implement FindFileContainingSymbol() or\n//   FindFileContainingExtension(); these will always return false.\nclass LIBPROTOBUF_EXPORT SourceTreeDescriptorDatabase : public DescriptorDatabase {\n public:\n  SourceTreeDescriptorDatabase(SourceTree* source_tree);\n  ~SourceTreeDescriptorDatabase();\n\n  // Instructs the SourceTreeDescriptorDatabase to report any parse errors\n  // to the given MultiFileErrorCollector.  This should be called before\n  // parsing.  error_collector must remain valid until either this method\n  // is called again or the SourceTreeDescriptorDatabase is destroyed.\n  void RecordErrorsTo(MultiFileErrorCollector* error_collector) {\n    error_collector_ = error_collector;\n  }\n\n  // Gets a DescriptorPool::ErrorCollector which records errors to the\n  // MultiFileErrorCollector specified with RecordErrorsTo().  This collector\n  // has the ability to determine exact line and column numbers of errors\n  // from the information given to it by the DescriptorPool.\n  DescriptorPool::ErrorCollector* GetValidationErrorCollector() {\n    using_validation_error_collector_ = true;\n    return &validation_error_collector_;\n  }\n\n  // implements DescriptorDatabase -----------------------------------\n  bool FindFileByName(const string& filename, FileDescriptorProto* output);\n  bool FindFileContainingSymbol(const string& symbol_name,\n                                FileDescriptorProto* output);\n  bool FindFileContainingExtension(const string& containing_type,\n                                   int field_number,\n                                   FileDescriptorProto* output);\n\n private:\n  class SingleFileErrorCollector;\n\n  SourceTree* source_tree_;\n  MultiFileErrorCollector* error_collector_;\n\n  class LIBPROTOBUF_EXPORT ValidationErrorCollector : public DescriptorPool::ErrorCollector {\n   public:\n    ValidationErrorCollector(SourceTreeDescriptorDatabase* owner);\n    ~ValidationErrorCollector();\n\n    // implements ErrorCollector ---------------------------------------\n    void AddError(const string& filename,\n                  const string& element_name,\n                  const Message* descriptor,\n                  ErrorLocation location,\n                  const string& message);\n\n    virtual void AddWarning(const string& filename,\n                            const string& element_name,\n                            const Message* descriptor,\n                            ErrorLocation location,\n                            const string& message);\n\n   private:\n    SourceTreeDescriptorDatabase* owner_;\n  };\n  friend class ValidationErrorCollector;\n\n  bool using_validation_error_collector_;\n  SourceLocationTable source_locations_;\n  ValidationErrorCollector validation_error_collector_;\n};\n\n// Simple interface for parsing .proto files.  This wraps the process\n// of opening the file, parsing it with a Parser, recursively parsing all its\n// imports, and then cross-linking the results to produce a FileDescriptor.\n//\n// This is really just a thin wrapper around SourceTreeDescriptorDatabase.\n// You may find that SourceTreeDescriptorDatabase is more flexible.\n//\n// TODO(kenton):  I feel like this class is not well-named.\nclass LIBPROTOBUF_EXPORT Importer {\n public:\n  Importer(SourceTree* source_tree,\n           MultiFileErrorCollector* error_collector);\n  ~Importer();\n\n  // Import the given file and build a FileDescriptor representing it.  If\n  // the file is already in the DescriptorPool, the existing FileDescriptor\n  // will be returned.  The FileDescriptor is property of the DescriptorPool,\n  // and will remain valid until it is destroyed.  If any errors occur, they\n  // will be reported using the error collector and Import() will return NULL.\n  //\n  // A particular Importer object will only report errors for a particular\n  // file once.  All future attempts to import the same file will return NULL\n  // without reporting any errors.  The idea is that you might want to import\n  // a lot of files without seeing the same errors over and over again.  If\n  // you want to see errors for the same files repeatedly, you can use a\n  // separate Importer object to import each one (but use the same\n  // DescriptorPool so that they can be cross-linked).\n  const FileDescriptor* Import(const string& filename);\n\n  // The DescriptorPool in which all imported FileDescriptors and their\n  // contents are stored.\n  inline const DescriptorPool* pool() const {\n    return &pool_;\n  }\n\n  void AddUnusedImportTrackFile(const string& file_name);\n  void ClearUnusedImportTrackFiles();\n\n\n private:\n  SourceTreeDescriptorDatabase database_;\n  DescriptorPool pool_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Importer);\n};\n\n// If the importer encounters problems while trying to import the proto files,\n// it reports them to a MultiFileErrorCollector.\nclass LIBPROTOBUF_EXPORT MultiFileErrorCollector {\n public:\n  inline MultiFileErrorCollector() {}\n  virtual ~MultiFileErrorCollector();\n\n  // Line and column numbers are zero-based.  A line number of -1 indicates\n  // an error with the entire file (e.g. \"not found\").\n  virtual void AddError(const string& filename, int line, int column,\n                        const string& message) = 0;\n\n  virtual void AddWarning(const string& filename, int line, int column,\n                          const string& message) {}\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MultiFileErrorCollector);\n};\n\n// Abstract interface which represents a directory tree containing proto files.\n// Used by the default implementation of Importer to resolve import statements\n// Most users will probably want to use the DiskSourceTree implementation,\n// below.\nclass LIBPROTOBUF_EXPORT SourceTree {\n public:\n  inline SourceTree() {}\n  virtual ~SourceTree();\n\n  // Open the given file and return a stream that reads it, or NULL if not\n  // found.  The caller takes ownership of the returned object.  The filename\n  // must be a path relative to the root of the source tree and must not\n  // contain \".\" or \"..\" components.\n  virtual io::ZeroCopyInputStream* Open(const string& filename) = 0;\n\n  // If Open() returns NULL, calling this method immediately will return an\n  // description of the error.\n  // Subclasses should implement this method and return a meaningful value for\n  // better error reporting.\n  // TODO(xiaofeng): change this to a pure virtual function.\n  virtual string GetLastErrorMessage();\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(SourceTree);\n};\n\n// An implementation of SourceTree which loads files from locations on disk.\n// Multiple mappings can be set up to map locations in the DiskSourceTree to\n// locations in the physical filesystem.\nclass LIBPROTOBUF_EXPORT DiskSourceTree : public SourceTree {\n public:\n  DiskSourceTree();\n  ~DiskSourceTree();\n\n  // Map a path on disk to a location in the SourceTree.  The path may be\n  // either a file or a directory.  If it is a directory, the entire tree\n  // under it will be mapped to the given virtual location.  To map a directory\n  // to the root of the source tree, pass an empty string for virtual_path.\n  //\n  // If multiple mapped paths apply when opening a file, they will be searched\n  // in order.  For example, if you do:\n  //   MapPath(\"bar\", \"foo/bar\");\n  //   MapPath(\"\", \"baz\");\n  // and then you do:\n  //   Open(\"bar/qux\");\n  // the DiskSourceTree will first try to open foo/bar/qux, then baz/bar/qux,\n  // returning the first one that opens successfuly.\n  //\n  // disk_path may be an absolute path or relative to the current directory,\n  // just like a path you'd pass to open().\n  void MapPath(const string& virtual_path, const string& disk_path);\n\n  // Return type for DiskFileToVirtualFile().\n  enum DiskFileToVirtualFileResult {\n    SUCCESS,\n    SHADOWED,\n    CANNOT_OPEN,\n    NO_MAPPING\n  };\n\n  // Given a path to a file on disk, find a virtual path mapping to that\n  // file.  The first mapping created with MapPath() whose disk_path contains\n  // the filename is used.  However, that virtual path may not actually be\n  // usable to open the given file.  Possible return values are:\n  // * SUCCESS: The mapping was found.  *virtual_file is filled in so that\n  //   calling Open(*virtual_file) will open the file named by disk_file.\n  // * SHADOWED: A mapping was found, but using Open() to open this virtual\n  //   path will end up returning some different file.  This is because some\n  //   other mapping with a higher precedence also matches this virtual path\n  //   and maps it to a different file that exists on disk.  *virtual_file\n  //   is filled in as it would be in the SUCCESS case.  *shadowing_disk_file\n  //   is filled in with the disk path of the file which would be opened if\n  //   you were to call Open(*virtual_file).\n  // * CANNOT_OPEN: The mapping was found and was not shadowed, but the\n  //   file specified cannot be opened.  When this value is returned,\n  //   errno will indicate the reason the file cannot be opened.  *virtual_file\n  //   will be set to the virtual path as in the SUCCESS case, even though\n  //   it is not useful.\n  // * NO_MAPPING: Indicates that no mapping was found which contains this\n  //   file.\n  DiskFileToVirtualFileResult\n    DiskFileToVirtualFile(const string& disk_file,\n                          string* virtual_file,\n                          string* shadowing_disk_file);\n\n  // Given a virtual path, find the path to the file on disk.\n  // Return true and update disk_file with the on-disk path if the file exists.\n  // Return false and leave disk_file untouched if the file doesn't exist.\n  bool VirtualFileToDiskFile(const string& virtual_file, string* disk_file);\n\n  // implements SourceTree -------------------------------------------\n  virtual io::ZeroCopyInputStream* Open(const string& filename);\n\n  virtual string GetLastErrorMessage();\n\n private:\n  struct Mapping {\n    string virtual_path;\n    string disk_path;\n\n    inline Mapping(const string& virtual_path_param,\n                   const string& disk_path_param)\n      : virtual_path(virtual_path_param), disk_path(disk_path_param) {}\n  };\n  std::vector<Mapping> mappings_;\n  string last_error_message_;\n\n  // Like Open(), but returns the on-disk path in disk_file if disk_file is\n  // non-NULL and the file could be successfully opened.\n  io::ZeroCopyInputStream* OpenVirtualFile(const string& virtual_file,\n                                           string* disk_file);\n\n  // Like Open() but given the actual on-disk path.\n  io::ZeroCopyInputStream* OpenDiskFile(const string& filename);\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DiskSourceTree);\n};\n\n}  // namespace compiler\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_IMPORTER_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/java/java_generator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Generates Java code for a given .proto file.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__\n#define GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__\n\n#include <string>\n#include <google/protobuf/compiler/code_generator.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\nnamespace java {\n\n// CodeGenerator implementation which generates Java code.  If you create your\n// own protocol compiler binary and you want it to support Java output, you\n// can do so by registering an instance of this CodeGenerator with the\n// CommandLineInterface in your main() function.\nclass LIBPROTOC_EXPORT JavaGenerator : public CodeGenerator {\n public:\n  JavaGenerator();\n  ~JavaGenerator();\n\n  // implements CodeGenerator ----------------------------------------\n  bool Generate(const FileDescriptor* file,\n                const string& parameter,\n                GeneratorContext* context,\n                string* error) const;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JavaGenerator);\n};\n\n}  // namespace java\n}  // namespace compiler\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/java/java_names.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Provides a mechanism for mapping a descriptor to the\n// fully-qualified name of the corresponding Java class.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_NAMES_H__\n#define GOOGLE_PROTOBUF_COMPILER_JAVA_NAMES_H__\n\n#include <string>\n\nnamespace google {\nnamespace protobuf {\n\nclass Descriptor;\nclass EnumDescriptor;\nclass FileDescriptor;\nclass ServiceDescriptor;\n\nnamespace compiler {\nnamespace java {\n\n// Requires:\n//   descriptor != NULL\n//\n// Returns:\n//   The fully-qualified Java class name.\nstring ClassName(const Descriptor* descriptor);\n\n// Requires:\n//   descriptor != NULL\n//\n// Returns:\n//   The fully-qualified Java class name.\nstring ClassName(const EnumDescriptor* descriptor);\n\n// Requires:\n//   descriptor != NULL\n//\n// Returns:\n//   The fully-qualified Java class name.\nstring ClassName(const FileDescriptor* descriptor);\n\n// Requires:\n//   descriptor != NULL\n//\n// Returns:\n//   The fully-qualified Java class name.\nstring ClassName(const ServiceDescriptor* descriptor);\n\n}  // namespace java\n}  // namespace compiler\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_COMPILER_JAVA_NAMES_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/js/js_generator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Generates JavaScript code for a given .proto file.\n//\n#ifndef GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__\n#define GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__\n\n#include <string>\n#include <set>\n\n#include <google/protobuf/stubs/logging.h>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/compiler/code_generator.h>\n\nnamespace google {\nnamespace protobuf {\n\nclass Descriptor;\nclass EnumDescriptor;\nclass FieldDescriptor;\nclass OneofDescriptor;\nclass FileDescriptor;\n\nnamespace io { class Printer; }\n\nnamespace compiler {\nnamespace js {\n\nstruct GeneratorOptions {\n  // Output path.\n  string output_dir;\n  // Namespace prefix.\n  string namespace_prefix;\n  // Enable binary-format support?\n  bool binary;\n  // What style of imports should be used.\n  enum ImportStyle {\n    kImportClosure,   // goog.require()\n    kImportCommonJs,  // require()\n    kImportBrowser,   // no import statements\n    kImportEs6,       // import { member } from ''\n  } import_style;\n\n  GeneratorOptions()\n      : output_dir(\".\"),\n        namespace_prefix(\"\"),\n        binary(false),\n        import_style(kImportClosure),\n        add_require_for_enums(false),\n        testonly(false),\n        library(\"\"),\n        error_on_name_conflict(false),\n        extension(\".js\"),\n        one_output_file_per_input_file(false),\n        annotate_code(false) {}\n\n  bool ParseFromOptions(\n      const std::vector< std::pair< string, string > >& options,\n      string* error);\n\n  // Returns the file name extension to use for generated code.\n  string GetFileNameExtension() const {\n    return import_style == kImportClosure ? extension : \"_pb.js\";\n  }\n\n  enum OutputMode {\n    // Create an output file for each input .proto file.\n    kOneOutputFilePerInputFile,\n    // Create an output file for each type.\n    kOneOutputFilePerType,\n    // Put everything in a single file named by the library option.\n    kEverythingInOneFile,\n  };\n\n  // Indicates how to output the generated code based on the provided options.\n  OutputMode output_mode() const;\n\n  // The remaining options are only relevant when we are using kImportClosure.\n\n  // Add a `goog.requires()` call for each enum type used. If not set, a\n  // forward declaration with `goog.forwardDeclare` is produced instead.\n  bool add_require_for_enums;\n  // Set this as a test-only module via `goog.setTestOnly();`.\n  bool testonly;\n  // Create a library with name <name>_lib.js rather than a separate .js file\n  // per type?\n  string library;\n  // Error if there are two types that would generate the same output file?\n  bool error_on_name_conflict;\n  // The extension to use for output file names.\n  string extension;\n  // Create a separate output file for each input file?\n  bool one_output_file_per_input_file;\n  // If true, we should build .meta files that contain annotations for\n  // generated code. See GeneratedCodeInfo in descriptor.proto.\n  bool annotate_code;\n};\n\n// CodeGenerator implementation which generates a JavaScript source file and\n// header.  If you create your own protocol compiler binary and you want it to\n// support JavaScript output, you can do so by registering an instance of this\n// CodeGenerator with the CommandLineInterface in your main() function.\nclass LIBPROTOC_EXPORT Generator : public CodeGenerator {\n public:\n  Generator() {}\n  virtual ~Generator() {}\n\n  virtual bool Generate(const FileDescriptor* file,\n                        const string& parameter,\n                        GeneratorContext* context,\n                        string* error) const {\n    *error = \"Unimplemented Generate() method. Call GenerateAll() instead.\";\n    return false;\n  }\n\n  virtual bool HasGenerateAll() const { return true; }\n\n  virtual bool GenerateAll(const std::vector<const FileDescriptor*>& files,\n                           const string& parameter,\n                           GeneratorContext* context,\n                           string* error) const;\n\n private:\n  void GenerateHeader(const GeneratorOptions& options,\n                      io::Printer* printer) const;\n\n  // Generate goog.provides() calls.\n  void FindProvides(const GeneratorOptions& options,\n                    io::Printer* printer,\n                    const std::vector<const FileDescriptor*>& file,\n                    std::set<string>* provided) const;\n  void FindProvidesForFile(const GeneratorOptions& options,\n                           io::Printer* printer,\n                           const FileDescriptor* file,\n                           std::set<string>* provided) const;\n  void FindProvidesForMessage(const GeneratorOptions& options,\n                              io::Printer* printer,\n                              const Descriptor* desc,\n                              std::set<string>* provided) const;\n  void FindProvidesForEnum(const GeneratorOptions& options,\n                           io::Printer* printer,\n                           const EnumDescriptor* enumdesc,\n                           std::set<string>* provided) const;\n  // For extension fields at file scope.\n  void FindProvidesForFields(const GeneratorOptions& options,\n                             io::Printer* printer,\n                             const std::vector<const FieldDescriptor*>& fields,\n                             std::set<string>* provided) const;\n  // Print the goog.provides() found by the methods above.\n  void GenerateProvides(const GeneratorOptions& options,\n                        io::Printer* printer,\n                        std::set<string>* provided) const;\n\n  // Generate goog.setTestOnly() if indicated.\n  void GenerateTestOnly(const GeneratorOptions& options,\n                        io::Printer* printer) const;\n\n  // Generate goog.requires() calls.\n  void GenerateRequiresForLibrary(\n      const GeneratorOptions& options, io::Printer* printer,\n      const std::vector<const FileDescriptor*>& files,\n      std::set<string>* provided) const;\n  void GenerateRequiresForMessage(const GeneratorOptions& options,\n                        io::Printer* printer,\n                        const Descriptor* desc,\n                        std::set<string>* provided) const;\n  // For extension fields at file scope.\n  void GenerateRequiresForExtensions(\n      const GeneratorOptions& options, io::Printer* printer,\n      const std::vector<const FieldDescriptor*>& fields,\n      std::set<string>* provided) const;\n  void GenerateRequiresImpl(const GeneratorOptions& options,\n                            io::Printer* printer, std::set<string>* required,\n                            std::set<string>* forwards,\n                            std::set<string>* provided, bool require_jspb,\n                            bool require_extension, bool require_map) const;\n  void FindRequiresForMessage(const GeneratorOptions& options,\n                              const Descriptor* desc,\n                              std::set<string>* required,\n                              std::set<string>* forwards,\n                              bool* have_message) const;\n  void FindRequiresForField(const GeneratorOptions& options,\n                            const FieldDescriptor* field,\n                            std::set<string>* required,\n                            std::set<string>* forwards) const;\n  void FindRequiresForExtension(const GeneratorOptions& options,\n                                const FieldDescriptor* field,\n                                std::set<string>* required,\n                                std::set<string>* forwards) const;\n\n  void GenerateFile(const GeneratorOptions& options,\n                    io::Printer* printer,\n                    const FileDescriptor* file) const;\n\n  // Generate definitions for all message classes and enums in all files,\n  // processing the files in dependence order.\n  void GenerateFilesInDepOrder(\n      const GeneratorOptions& options, io::Printer* printer,\n      const std::vector<const FileDescriptor*>& file) const;\n  // Helper for above.\n  void GenerateFileAndDeps(const GeneratorOptions& options,\n                           io::Printer* printer,\n                           const FileDescriptor* root,\n                           std::set<const FileDescriptor*>* all_files,\n                           std::set<const FileDescriptor*>* generated) const;\n\n  // Generate definitions for all message classes and enums.\n  void GenerateClassesAndEnums(const GeneratorOptions& options,\n                               io::Printer* printer,\n                               const FileDescriptor* file) const;\n\n  void GenerateFieldValueExpression(io::Printer* printer,\n                                    const char* obj_reference,\n                                    const FieldDescriptor* field,\n                                    bool use_default) const;\n\n  // Generate definition for one class.\n  void GenerateClass(const GeneratorOptions& options,\n                     io::Printer* printer,\n                     const Descriptor* desc) const;\n  void GenerateClassConstructor(const GeneratorOptions& options,\n                                io::Printer* printer,\n                                const Descriptor* desc) const;\n  void GenerateClassFieldInfo(const GeneratorOptions& options,\n                              io::Printer* printer,\n                              const Descriptor* desc) const;\n  void GenerateClassXid(const GeneratorOptions& options,\n                        io::Printer* printer,\n                        const Descriptor* desc) const;\n  void GenerateOneofCaseDefinition(const GeneratorOptions& options,\n                                   io::Printer* printer,\n                                   const OneofDescriptor* oneof) const;\n  void GenerateClassToObject(const GeneratorOptions& options,\n                             io::Printer* printer,\n                             const Descriptor* desc) const;\n  void GenerateClassFieldToObject(const GeneratorOptions& options,\n                                  io::Printer* printer,\n                                  const FieldDescriptor* field) const;\n  void GenerateClassFromObject(const GeneratorOptions& options,\n                               io::Printer* printer,\n                               const Descriptor* desc) const;\n  void GenerateClassFieldFromObject(const GeneratorOptions& options,\n                                    io::Printer* printer,\n                                    const FieldDescriptor* field) const;\n  void GenerateClassClone(const GeneratorOptions& options,\n                          io::Printer* printer,\n                          const Descriptor* desc) const;\n  void GenerateClassRegistration(const GeneratorOptions& options,\n                                 io::Printer* printer,\n                                 const Descriptor* desc) const;\n  void GenerateClassFields(const GeneratorOptions& options,\n                           io::Printer* printer,\n                           const Descriptor* desc) const;\n  void GenerateClassField(const GeneratorOptions& options,\n                          io::Printer* printer,\n                          const FieldDescriptor* desc) const;\n  void GenerateClassExtensionFieldInfo(const GeneratorOptions& options,\n                                       io::Printer* printer,\n                                       const Descriptor* desc) const;\n  void GenerateClassDeserialize(const GeneratorOptions& options,\n                                io::Printer* printer,\n                                const Descriptor* desc) const;\n  void GenerateClassDeserializeBinary(const GeneratorOptions& options,\n                                      io::Printer* printer,\n                                      const Descriptor* desc) const;\n  void GenerateClassDeserializeBinaryField(const GeneratorOptions& options,\n                                           io::Printer* printer,\n                                           const FieldDescriptor* field) const;\n  void GenerateClassSerializeBinary(const GeneratorOptions& options,\n                                    io::Printer* printer,\n                                    const Descriptor* desc) const;\n  void GenerateClassSerializeBinaryField(const GeneratorOptions& options,\n                                         io::Printer* printer,\n                                         const FieldDescriptor* field) const;\n\n  // Generate definition for one enum.\n  void GenerateEnum(const GeneratorOptions& options,\n                    io::Printer* printer,\n                    const EnumDescriptor* enumdesc) const;\n\n  // Generate an extension definition.\n  void GenerateExtension(const GeneratorOptions& options,\n                         io::Printer* printer,\n                         const FieldDescriptor* field) const;\n\n  // Generate addFoo() method for repeated primitive fields.\n  void GenerateRepeatedPrimitiveHelperMethods(const GeneratorOptions& options,\n                                              io::Printer* printer,\n                                              const FieldDescriptor* field,\n                                              bool untyped) const;\n\n  // Generate addFoo() method for repeated message fields.\n  void GenerateRepeatedMessageHelperMethods(const GeneratorOptions& options,\n                                            io::Printer* printer,\n                                            const FieldDescriptor* field) const;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Generator);\n};\n\n}  // namespace js\n}  // namespace compiler\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_JS_GENERATOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/js/well_known_types_embed.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_JS_WELL_KNOWN_TYPES_EMBED_H__\n#define GOOGLE_PROTOBUF_COMPILER_JS_WELL_KNOWN_TYPES_EMBED_H__\n\n#include <stddef.h>\n\nstruct FileToc {\n  const char* name;\n  const char* data;\n};\n\nextern struct FileToc well_known_types_js[];\n\n#endif  // GOOGLE_PROTOBUF_COMPILER_JS_WELL_KNOWN_TYPES_EMBED_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/objectivec/objectivec_generator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Generates ObjectiveC code for a given .proto file.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__\n#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__\n\n#include <string>\n#include <google/protobuf/compiler/code_generator.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\nnamespace objectivec {\n\n// CodeGenerator implementation which generates a ObjectiveC source file and\n// header.  If you create your own protocol compiler binary and you want it to\n// support ObjectiveC output, you can do so by registering an instance of this\n// CodeGenerator with the CommandLineInterface in your main() function.\nclass LIBPROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator {\n public:\n  ObjectiveCGenerator();\n  ~ObjectiveCGenerator();\n\n  // implements CodeGenerator ----------------------------------------\n  bool HasGenerateAll() const;\n  bool Generate(const FileDescriptor* file,\n                const string& parameter,\n                GeneratorContext* context,\n                string* error) const;\n  bool GenerateAll(const std::vector<const FileDescriptor*>& files,\n                   const string& parameter,\n                   GeneratorContext* context,\n                   string* error) const;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectiveCGenerator);\n};\n\n}  // namespace objectivec\n}  // namespace compiler\n}  // namespace protobuf\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/objectivec/objectivec_helpers.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Helper functions for generating ObjectiveC code.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__\n#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__\n\n#include <string>\n#include <vector>\n\n#include <google/protobuf/descriptor.h>\n#include <google/protobuf/descriptor.pb.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\nnamespace objectivec {\n\n// Generator options (see objectivec_generator.cc for a description of each):\nstruct Options {\n  Options();\n  string expected_prefixes_path;\n  string generate_for_named_framework;\n  string named_framework_to_proto_path_mappings_path;\n};\n\n// Escape C++ trigraphs by escaping question marks to \"\\?\".\nstring LIBPROTOC_EXPORT EscapeTrigraphs(const string& to_escape);\n\n// Strips \".proto\" or \".protodevel\" from the end of a filename.\nstring LIBPROTOC_EXPORT StripProto(const string& filename);\n\n// Remove white space from either end of a StringPiece.\nvoid LIBPROTOC_EXPORT StringPieceTrimWhitespace(StringPiece* input);\n\n// Returns true if the name requires a ns_returns_not_retained attribute applied\n// to it.\nbool LIBPROTOC_EXPORT IsRetainedName(const string& name);\n\n// Returns true if the name starts with \"init\" and will need to have special\n// handling under ARC.\nbool LIBPROTOC_EXPORT IsInitName(const string& name);\n\n// Gets the objc_class_prefix.\nstring LIBPROTOC_EXPORT FileClassPrefix(const FileDescriptor* file);\n\n// Gets the path of the file we're going to generate (sans the .pb.h\n// extension).  The path will be dependent on the objectivec package\n// declared in the proto package.\nstring LIBPROTOC_EXPORT FilePath(const FileDescriptor* file);\n\n// Just like FilePath(), but without the directory part.\nstring LIBPROTOC_EXPORT FilePathBasename(const FileDescriptor* file);\n\n// Gets the name of the root class we'll generate in the file.  This class\n// is not meant for external consumption, but instead contains helpers that\n// the rest of the classes need\nstring LIBPROTOC_EXPORT FileClassName(const FileDescriptor* file);\n\n// These return the fully-qualified class name corresponding to the given\n// descriptor.\nstring LIBPROTOC_EXPORT ClassName(const Descriptor* descriptor);\nstring LIBPROTOC_EXPORT ClassName(const Descriptor* descriptor, string* out_suffix_added);\nstring LIBPROTOC_EXPORT EnumName(const EnumDescriptor* descriptor);\n\n// Returns the fully-qualified name of the enum value corresponding to the\n// the descriptor.\nstring LIBPROTOC_EXPORT EnumValueName(const EnumValueDescriptor* descriptor);\n\n// Returns the name of the enum value corresponding to the descriptor.\nstring LIBPROTOC_EXPORT EnumValueShortName(const EnumValueDescriptor* descriptor);\n\n// Reverse what an enum does.\nstring LIBPROTOC_EXPORT UnCamelCaseEnumShortName(const string& name);\n\n// Returns the name to use for the extension (used as the method off the file's\n// Root class).\nstring LIBPROTOC_EXPORT ExtensionMethodName(const FieldDescriptor* descriptor);\n\n// Returns the transformed field name.\nstring LIBPROTOC_EXPORT FieldName(const FieldDescriptor* field);\nstring LIBPROTOC_EXPORT FieldNameCapitalized(const FieldDescriptor* field);\n\n// Returns the transformed oneof name.\nstring LIBPROTOC_EXPORT OneofEnumName(const OneofDescriptor* descriptor);\nstring LIBPROTOC_EXPORT OneofName(const OneofDescriptor* descriptor);\nstring LIBPROTOC_EXPORT OneofNameCapitalized(const OneofDescriptor* descriptor);\n\ninline bool HasFieldPresence(const FileDescriptor* file) {\n  return file->syntax() != FileDescriptor::SYNTAX_PROTO3;\n}\n\ninline bool HasPreservingUnknownEnumSemantics(const FileDescriptor* file) {\n  return file->syntax() == FileDescriptor::SYNTAX_PROTO3;\n}\n\ninline bool IsMapEntryMessage(const Descriptor* descriptor) {\n  return descriptor->options().map_entry();\n}\n\n// Reverse of the above.\nstring LIBPROTOC_EXPORT UnCamelCaseFieldName(const string& name, const FieldDescriptor* field);\n\nenum ObjectiveCType {\n  OBJECTIVECTYPE_INT32,\n  OBJECTIVECTYPE_UINT32,\n  OBJECTIVECTYPE_INT64,\n  OBJECTIVECTYPE_UINT64,\n  OBJECTIVECTYPE_FLOAT,\n  OBJECTIVECTYPE_DOUBLE,\n  OBJECTIVECTYPE_BOOLEAN,\n  OBJECTIVECTYPE_STRING,\n  OBJECTIVECTYPE_DATA,\n  OBJECTIVECTYPE_ENUM,\n  OBJECTIVECTYPE_MESSAGE\n};\n\nenum FlagType {\n  FLAGTYPE_DESCRIPTOR_INITIALIZATION,\n  FLAGTYPE_EXTENSION,\n  FLAGTYPE_FIELD\n};\n\ntemplate<class TDescriptor>\nstring GetOptionalDeprecatedAttribute(\n    const TDescriptor* descriptor,\n    const FileDescriptor* file = NULL,\n    bool preSpace = true, bool postNewline = false) {\n  bool isDeprecated = descriptor->options().deprecated();\n  // The file is only passed when checking Messages & Enums, so those types\n  // get tagged. At the moment, it doesn't seem to make sense to tag every\n  // field or enum value with when the file is deprecated.\n  if (!isDeprecated && file) {\n    isDeprecated = file->options().deprecated();\n  }\n  if (isDeprecated) {\n    string result = \"DEPRECATED_ATTRIBUTE\";\n    if (preSpace) {\n      result.insert(0, \" \");\n    }\n    if (postNewline) {\n      result.append(\"\\n\");\n    }\n    return result;\n  } else {\n    return \"\";\n  }\n}\n\nstring LIBPROTOC_EXPORT GetCapitalizedType(const FieldDescriptor* field);\n\nObjectiveCType LIBPROTOC_EXPORT GetObjectiveCType(FieldDescriptor::Type field_type);\n\ninline ObjectiveCType GetObjectiveCType(const FieldDescriptor* field) {\n  return GetObjectiveCType(field->type());\n}\n\nbool LIBPROTOC_EXPORT IsPrimitiveType(const FieldDescriptor* field);\nbool LIBPROTOC_EXPORT IsReferenceType(const FieldDescriptor* field);\n\nstring LIBPROTOC_EXPORT GPBGenericValueFieldName(const FieldDescriptor* field);\nstring LIBPROTOC_EXPORT DefaultValue(const FieldDescriptor* field);\nbool LIBPROTOC_EXPORT HasNonZeroDefaultValue(const FieldDescriptor* field);\n\nstring LIBPROTOC_EXPORT BuildFlagsString(const FlagType type, const std::vector<string>& strings);\n\n// Builds HeaderDoc/appledoc style comments out of the comments in the .proto\n// file.\nstring LIBPROTOC_EXPORT BuildCommentsString(const SourceLocation& location,\n                           bool prefer_single_line);\n\n// The name the commonly used by the library when built as a framework.\n// This lines up to the name used in the CocoaPod.\nextern LIBPROTOC_EXPORT const char* const ProtobufLibraryFrameworkName;\n// Returns the CPP symbol name to use as the gate for framework style imports\n// for the given framework name to use.\nstring LIBPROTOC_EXPORT ProtobufFrameworkImportSymbol(const string& framework_name);\n\n// Checks if the file is one of the proto's bundled with the library.\nbool LIBPROTOC_EXPORT IsProtobufLibraryBundledProtoFile(const FileDescriptor* file);\n\n// Checks the prefix for the given files and outputs any warnings as needed. If\n// there are flat out errors, then out_error is filled in with the first error\n// and the result is false.\nbool LIBPROTOC_EXPORT ValidateObjCClassPrefixes(const std::vector<const FileDescriptor*>& files,\n                               const Options& generation_options,\n                               string* out_error);\n\n// Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform\n// the input into the expected output.\nclass LIBPROTOC_EXPORT TextFormatDecodeData {\n public:\n  TextFormatDecodeData();\n  ~TextFormatDecodeData();\n\n  void AddString(int32 key, const string& input_for_decode,\n                 const string& desired_output);\n  size_t num_entries() const { return entries_.size(); }\n  string Data() const;\n\n  static string DecodeDataForString(const string& input_for_decode,\n                                    const string& desired_output);\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TextFormatDecodeData);\n\n  typedef std::pair<int32, string> DataEntry;\n  std::vector<DataEntry> entries_;\n};\n\n// Helper for parsing simple files.\nclass LIBPROTOC_EXPORT LineConsumer {\n public:\n  LineConsumer();\n  virtual ~LineConsumer();\n  virtual bool ConsumeLine(const StringPiece& line, string* out_error) = 0;\n};\n\nbool LIBPROTOC_EXPORT ParseSimpleFile(\n    const string& path, LineConsumer* line_consumer, string* out_error);\n\n\n// Helper class for parsing framework import mappings and generating\n// import statements.\nclass LIBPROTOC_EXPORT ImportWriter {\n public:\n  ImportWriter(const string& generate_for_named_framework,\n               const string& named_framework_to_proto_path_mappings_path,\n               bool include_wkt_imports);\n  ~ImportWriter();\n\n  void AddFile(const FileDescriptor* file, const string& header_extension);\n  void Print(io::Printer *printer) const;\n\n private:\n  class ProtoFrameworkCollector : public LineConsumer {\n   public:\n    ProtoFrameworkCollector(std::map<string, string>* inout_proto_file_to_framework_name)\n        : map_(inout_proto_file_to_framework_name) {}\n\n    virtual bool ConsumeLine(const StringPiece& line, string* out_error);\n\n   private:\n    std::map<string, string>* map_;\n  };\n\n  void ParseFrameworkMappings();\n\n  const string generate_for_named_framework_;\n  const string named_framework_to_proto_path_mappings_path_;\n  const bool include_wkt_imports_;\n  std::map<string, string> proto_file_to_framework_name_;\n  bool need_to_parse_mapping_file_;\n\n  std::vector<string> protobuf_framework_imports_;\n  std::vector<string> protobuf_non_framework_imports_;\n  std::vector<string> other_framework_imports_;\n  std::vector<string> other_imports_;\n};\n\n}  // namespace objectivec\n}  // namespace compiler\n}  // namespace protobuf\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/parser.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Implements parsing of .proto files to FileDescriptorProtos.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_PARSER_H__\n#define GOOGLE_PROTOBUF_COMPILER_PARSER_H__\n\n#include <map>\n#include <string>\n#include <utility>\n#include <google/protobuf/descriptor.pb.h>\n#include <google/protobuf/io/tokenizer.h>\n#include <google/protobuf/descriptor.h>\n#include <google/protobuf/repeated_field.h>\n\nnamespace google {\nnamespace protobuf { class Message; }\n\nnamespace protobuf {\nnamespace compiler {\n\n// Defined in this file.\nclass Parser;\nclass SourceLocationTable;\n\n// Implements parsing of protocol definitions (such as .proto files).\n//\n// Note that most users will be more interested in the Importer class.\n// Parser is a lower-level class which simply converts a single .proto file\n// to a FileDescriptorProto.  It does not resolve import directives or perform\n// many other kinds of validation needed to construct a complete\n// FileDescriptor.\nclass LIBPROTOBUF_EXPORT Parser {\n public:\n  Parser();\n  ~Parser();\n\n  // Parse the entire input and construct a FileDescriptorProto representing\n  // it.  Returns true if no errors occurred, false otherwise.\n  bool Parse(io::Tokenizer* input, FileDescriptorProto* file);\n\n  // Optional features:\n\n  // DEPRECATED:  New code should use the SourceCodeInfo embedded in the\n  //   FileDescriptorProto.\n  //\n  // Requests that locations of certain definitions be recorded to the given\n  // SourceLocationTable while parsing.  This can be used to look up exact line\n  // and column numbers for errors reported by DescriptorPool during validation.\n  // Set to NULL (the default) to discard source location information.\n  void RecordSourceLocationsTo(SourceLocationTable* location_table) {\n    source_location_table_ = location_table;\n  }\n\n  // Requests that errors be recorded to the given ErrorCollector while\n  // parsing.  Set to NULL (the default) to discard error messages.\n  void RecordErrorsTo(io::ErrorCollector* error_collector) {\n    error_collector_ = error_collector;\n  }\n\n  // Returns the identifier used in the \"syntax = \" declaration, if one was\n  // seen during the last call to Parse(), or the empty string otherwise.\n  const string& GetSyntaxIdentifier() { return syntax_identifier_; }\n\n  // If set true, input files will be required to begin with a syntax\n  // identifier.  Otherwise, files may omit this.  If a syntax identifier\n  // is provided, it must be 'syntax = \"proto2\";' and must appear at the\n  // top of this file regardless of whether or not it was required.\n  void SetRequireSyntaxIdentifier(bool value) {\n    require_syntax_identifier_ = value;\n  }\n\n  // Call SetStopAfterSyntaxIdentifier(true) to tell the parser to stop\n  // parsing as soon as it has seen the syntax identifier, or lack thereof.\n  // This is useful for quickly identifying the syntax of the file without\n  // parsing the whole thing.  If this is enabled, no error will be recorded\n  // if the syntax identifier is something other than \"proto2\" (since\n  // presumably the caller intends to deal with that), but other kinds of\n  // errors (e.g. parse errors) will still be reported.  When this is enabled,\n  // you may pass a NULL FileDescriptorProto to Parse().\n  void SetStopAfterSyntaxIdentifier(bool value) {\n    stop_after_syntax_identifier_ = value;\n  }\n\n private:\n  class LocationRecorder;\n\n  // =================================================================\n  // Error recovery helpers\n\n  // Consume the rest of the current statement.  This consumes tokens\n  // until it sees one of:\n  //   ';'  Consumes the token and returns.\n  //   '{'  Consumes the brace then calls SkipRestOfBlock().\n  //   '}'  Returns without consuming.\n  //   EOF  Returns (can't consume).\n  // The Parser often calls SkipStatement() after encountering a syntax\n  // error.  This allows it to go on parsing the following lines, allowing\n  // it to report more than just one error in the file.\n  void SkipStatement();\n\n  // Consume the rest of the current block, including nested blocks,\n  // ending after the closing '}' is encountered and consumed, or at EOF.\n  void SkipRestOfBlock();\n\n  // -----------------------------------------------------------------\n  // Single-token consuming helpers\n  //\n  // These make parsing code more readable.\n\n  // True if the current token is TYPE_END.\n  inline bool AtEnd();\n\n  // True if the next token matches the given text.\n  inline bool LookingAt(const char* text);\n  // True if the next token is of the given type.\n  inline bool LookingAtType(io::Tokenizer::TokenType token_type);\n\n  // If the next token exactly matches the text given, consume it and return\n  // true.  Otherwise, return false without logging an error.\n  bool TryConsume(const char* text);\n\n  // These attempt to read some kind of token from the input.  If successful,\n  // they return true.  Otherwise they return false and add the given error\n  // to the error list.\n\n  // Consume a token with the exact text given.\n  bool Consume(const char* text, const char* error);\n  // Same as above, but automatically generates the error \"Expected \\\"text\\\".\",\n  // where \"text\" is the expected token text.\n  bool Consume(const char* text);\n  // Consume a token of type IDENTIFIER and store its text in \"output\".\n  bool ConsumeIdentifier(string* output, const char* error);\n  // Consume an integer and store its value in \"output\".\n  bool ConsumeInteger(int* output, const char* error);\n  // Consume a signed integer and store its value in \"output\".\n  bool ConsumeSignedInteger(int* output, const char* error);\n  // Consume a 64-bit integer and store its value in \"output\".  If the value\n  // is greater than max_value, an error will be reported.\n  bool ConsumeInteger64(uint64 max_value, uint64* output, const char* error);\n  // Consume a number and store its value in \"output\".  This will accept\n  // tokens of either INTEGER or FLOAT type.\n  bool ConsumeNumber(double* output, const char* error);\n  // Consume a string literal and store its (unescaped) value in \"output\".\n  bool ConsumeString(string* output, const char* error);\n\n  // Consume a token representing the end of the statement.  Comments between\n  // this token and the next will be harvested for documentation.  The given\n  // LocationRecorder should refer to the declaration that was just parsed;\n  // it will be populated with these comments.\n  //\n  // TODO(kenton):  The LocationRecorder is const because historically locations\n  //   have been passed around by const reference, for no particularly good\n  //   reason.  We should probably go through and change them all to mutable\n  //   pointer to make this more intuitive.\n  bool TryConsumeEndOfDeclaration(\n      const char* text, const LocationRecorder* location);\n  bool TryConsumeEndOfDeclarationFinishScope(\n      const char* text, const LocationRecorder* location);\n\n  bool ConsumeEndOfDeclaration(\n      const char* text, const LocationRecorder* location);\n\n  // -----------------------------------------------------------------\n  // Error logging helpers\n\n  // Invokes error_collector_->AddError(), if error_collector_ is not NULL.\n  void AddError(int line, int column, const string& error);\n\n  // Invokes error_collector_->AddError() with the line and column number\n  // of the current token.\n  void AddError(const string& error);\n\n  // Records a location in the SourceCodeInfo.location table (see\n  // descriptor.proto).  We use RAII to ensure that the start and end locations\n  // are recorded -- the constructor records the start location and the\n  // destructor records the end location.  Since the parser is\n  // recursive-descent, this works out beautifully.\n  class LIBPROTOBUF_EXPORT LocationRecorder {\n   public:\n    // Construct the file's \"root\" location.\n    LocationRecorder(Parser* parser);\n\n    // Construct a location that represents a declaration nested within the\n    // given parent.  E.g. a field's location is nested within the location\n    // for a message type.  The parent's path will be copied, so you should\n    // call AddPath() only to add the path components leading from the parent\n    // to the child (as opposed to leading from the root to the child).\n    LocationRecorder(const LocationRecorder& parent);\n\n    // Convenience constructors that call AddPath() one or two times.\n    LocationRecorder(const LocationRecorder& parent, int path1);\n    LocationRecorder(const LocationRecorder& parent, int path1, int path2);\n\n    // Creates a recorder that generates locations into given source code info.\n    LocationRecorder(const LocationRecorder& parent, int path1,\n                    SourceCodeInfo* source_code_info);\n\n    ~LocationRecorder();\n\n    // Add a path component.  See SourceCodeInfo.Location.path in\n    // descriptor.proto.\n    void AddPath(int path_component);\n\n    // By default the location is considered to start at the current token at\n    // the time the LocationRecorder is created.  StartAt() sets the start\n    // location to the given token instead.\n    void StartAt(const io::Tokenizer::Token& token);\n\n    // Start at the same location as some other LocationRecorder.\n    void StartAt(const LocationRecorder& other);\n\n    // By default the location is considered to end at the previous token at\n    // the time the LocationRecorder is destroyed.  EndAt() sets the end\n    // location to the given token instead.\n    void EndAt(const io::Tokenizer::Token& token);\n\n    // Records the start point of this location to the SourceLocationTable that\n    // was passed to RecordSourceLocationsTo(), if any.  SourceLocationTable\n    // is an older way of keeping track of source locations which is still\n    // used in some places.\n    void RecordLegacyLocation(const Message* descriptor,\n        DescriptorPool::ErrorCollector::ErrorLocation location);\n\n    // Returns the number of path components in the recorder's current location.\n    int CurrentPathSize() const;\n\n    // Attaches leading and trailing comments to the location.  The two strings\n    // will be swapped into place, so after this is called *leading and\n    // *trailing will be empty.\n    //\n    // TODO(kenton):  See comment on TryConsumeEndOfDeclaration(), above, for\n    //   why this is const.\n    void AttachComments(string* leading, string* trailing,\n                        std::vector<string>* detached_comments) const;\n\n   private:\n    // Indexes of parent and current location in the parent\n    // SourceCodeInfo.location repeated field. For top-level elements,\n    // parent_index_ is -1.\n    Parser* parser_;\n    SourceCodeInfo* source_code_info_;\n    SourceCodeInfo::Location* location_;\n\n    void Init(const LocationRecorder& parent, SourceCodeInfo* source_code_info);\n  };\n\n  // =================================================================\n  // Parsers for various language constructs\n\n  // Parses the \"syntax = \\\"proto2\\\";\" line at the top of the file.  Returns\n  // false if it failed to parse or if the syntax identifier was not\n  // recognized.\n  bool ParseSyntaxIdentifier(const LocationRecorder& parent);\n\n  // These methods parse various individual bits of code.  They return\n  // false if they completely fail to parse the construct.  In this case,\n  // it is probably necessary to skip the rest of the statement to recover.\n  // However, if these methods return true, it does NOT mean that there\n  // were no errors; only that there were no *syntax* errors.  For instance,\n  // if a service method is defined using proper syntax but uses a primitive\n  // type as its input or output, ParseMethodField() still returns true\n  // and only reports the error by calling AddError().  In practice, this\n  // makes logic much simpler for the caller.\n\n  // Parse a top-level message, enum, service, etc.\n  bool ParseTopLevelStatement(FileDescriptorProto* file,\n                              const LocationRecorder& root_location);\n\n  // Parse various language high-level language construrcts.\n  bool ParseMessageDefinition(DescriptorProto* message,\n                              const LocationRecorder& message_location,\n                              const FileDescriptorProto* containing_file);\n  bool ParseEnumDefinition(EnumDescriptorProto* enum_type,\n                           const LocationRecorder& enum_location,\n                           const FileDescriptorProto* containing_file);\n  bool ParseServiceDefinition(ServiceDescriptorProto* service,\n                              const LocationRecorder& service_location,\n                              const FileDescriptorProto* containing_file);\n  bool ParsePackage(FileDescriptorProto* file,\n                    const LocationRecorder& root_location,\n                    const FileDescriptorProto* containing_file);\n  bool ParseImport(RepeatedPtrField<string>* dependency,\n                   RepeatedField<int32>* public_dependency,\n                   RepeatedField<int32>* weak_dependency,\n                   const LocationRecorder& root_location,\n                   const FileDescriptorProto* containing_file);\n\n  // These methods parse the contents of a message, enum, or service type and\n  // add them to the given object.  They consume the entire block including\n  // the beginning and ending brace.\n  bool ParseMessageBlock(DescriptorProto* message,\n                         const LocationRecorder& message_location,\n                         const FileDescriptorProto* containing_file);\n  bool ParseEnumBlock(EnumDescriptorProto* enum_type,\n                      const LocationRecorder& enum_location,\n                      const FileDescriptorProto* containing_file);\n  bool ParseServiceBlock(ServiceDescriptorProto* service,\n                         const LocationRecorder& service_location,\n                         const FileDescriptorProto* containing_file);\n\n  // Parse one statement within a message, enum, or service block, including\n  // final semicolon.\n  bool ParseMessageStatement(DescriptorProto* message,\n                             const LocationRecorder& message_location,\n                             const FileDescriptorProto* containing_file);\n  bool ParseEnumStatement(EnumDescriptorProto* message,\n                          const LocationRecorder& enum_location,\n                          const FileDescriptorProto* containing_file);\n  bool ParseServiceStatement(ServiceDescriptorProto* message,\n                             const LocationRecorder& service_location,\n                             const FileDescriptorProto* containing_file);\n\n  // Parse a field of a message.  If the field is a group, its type will be\n  // added to \"messages\".\n  //\n  // parent_location and location_field_number_for_nested_type are needed when\n  // parsing groups -- we need to generate a nested message type within the\n  // parent and record its location accordingly.  Since the parent could be\n  // either a FileDescriptorProto or a DescriptorProto, we must pass in the\n  // correct field number to use.\n  bool ParseMessageField(FieldDescriptorProto* field,\n                         RepeatedPtrField<DescriptorProto>* messages,\n                         const LocationRecorder& parent_location,\n                         int location_field_number_for_nested_type,\n                         const LocationRecorder& field_location,\n                         const FileDescriptorProto* containing_file);\n\n  // Like ParseMessageField() but expects the label has already been filled in\n  // by the caller.\n  bool ParseMessageFieldNoLabel(FieldDescriptorProto* field,\n                                RepeatedPtrField<DescriptorProto>* messages,\n                                const LocationRecorder& parent_location,\n                                int location_field_number_for_nested_type,\n                                const LocationRecorder& field_location,\n                                const FileDescriptorProto* containing_file);\n\n  // Parse an \"extensions\" declaration.\n  bool ParseExtensions(DescriptorProto* message,\n                       const LocationRecorder& extensions_location,\n                       const FileDescriptorProto* containing_file);\n\n  // Parse a \"reserved\" declaration.\n  bool ParseReserved(DescriptorProto* message,\n                     const LocationRecorder& message_location);\n  bool ParseReservedNames(DescriptorProto* message,\n                          const LocationRecorder& parent_location);\n  bool ParseReservedNumbers(DescriptorProto* message,\n                            const LocationRecorder& parent_location);\n  bool ParseReserved(EnumDescriptorProto* message,\n                     const LocationRecorder& message_location);\n  bool ParseReservedNames(EnumDescriptorProto* message,\n                          const LocationRecorder& parent_location);\n  bool ParseReservedNumbers(EnumDescriptorProto* message,\n                            const LocationRecorder& parent_location);\n\n  // Parse an \"extend\" declaration.  (See also comments for\n  // ParseMessageField().)\n  bool ParseExtend(RepeatedPtrField<FieldDescriptorProto>* extensions,\n                   RepeatedPtrField<DescriptorProto>* messages,\n                   const LocationRecorder& parent_location,\n                   int location_field_number_for_nested_type,\n                   const LocationRecorder& extend_location,\n                   const FileDescriptorProto* containing_file);\n\n  // Parse a \"oneof\" declaration.  The caller is responsible for setting\n  // oneof_decl->label() since it will have had to parse the label before it\n  // knew it was parsing a oneof.\n  bool ParseOneof(OneofDescriptorProto* oneof_decl,\n                  DescriptorProto* containing_type,\n                  int oneof_index,\n                  const LocationRecorder& oneof_location,\n                  const LocationRecorder& containing_type_location,\n                  const FileDescriptorProto* containing_file);\n\n  // Parse a single enum value within an enum block.\n  bool ParseEnumConstant(EnumValueDescriptorProto* enum_value,\n                         const LocationRecorder& enum_value_location,\n                         const FileDescriptorProto* containing_file);\n\n  // Parse enum constant options, i.e. the list in square brackets at the end\n  // of the enum constant value definition.\n  bool ParseEnumConstantOptions(EnumValueDescriptorProto* value,\n                                const LocationRecorder& enum_value_location,\n                                const FileDescriptorProto* containing_file);\n\n  // Parse a single method within a service definition.\n  bool ParseServiceMethod(MethodDescriptorProto* method,\n                          const LocationRecorder& method_location,\n                          const FileDescriptorProto* containing_file);\n\n\n  // Parse options of a single method or stream.\n  bool ParseMethodOptions(const LocationRecorder& parent_location,\n                          const FileDescriptorProto* containing_file,\n                          const int optionsFieldNumber,\n                          Message* mutable_options);\n\n  // Parse \"required\", \"optional\", or \"repeated\" and fill in \"label\"\n  // with the value. Returns true if such a label is consumed.\n  bool ParseLabel(FieldDescriptorProto::Label* label,\n                  const FileDescriptorProto* containing_file);\n\n  // Parse a type name and fill in \"type\" (if it is a primitive) or\n  // \"type_name\" (if it is not) with the type parsed.\n  bool ParseType(FieldDescriptorProto::Type* type,\n                 string* type_name);\n  // Parse a user-defined type and fill in \"type_name\" with the name.\n  // If a primitive type is named, it is treated as an error.\n  bool ParseUserDefinedType(string* type_name);\n\n  // Parses field options, i.e. the stuff in square brackets at the end\n  // of a field definition.  Also parses default value.\n  bool ParseFieldOptions(FieldDescriptorProto* field,\n                         const LocationRecorder& field_location,\n                         const FileDescriptorProto* containing_file);\n\n  // Parse the \"default\" option.  This needs special handling because its\n  // type is the field's type.\n  bool ParseDefaultAssignment(FieldDescriptorProto* field,\n                              const LocationRecorder& field_location,\n                              const FileDescriptorProto* containing_file);\n\n  bool ParseJsonName(FieldDescriptorProto* field,\n                     const LocationRecorder& field_location,\n                     const FileDescriptorProto* containing_file);\n\n  enum OptionStyle {\n    OPTION_ASSIGNMENT,  // just \"name = value\"\n    OPTION_STATEMENT    // \"option name = value;\"\n  };\n\n  // Parse a single option name/value pair, e.g. \"ctype = CORD\".  The name\n  // identifies a field of the given Message, and the value of that field\n  // is set to the parsed value.\n  bool ParseOption(Message* options,\n                   const LocationRecorder& options_location,\n                   const FileDescriptorProto* containing_file,\n                   OptionStyle style);\n\n  // Parses a single part of a multipart option name. A multipart name consists\n  // of names separated by dots. Each name is either an identifier or a series\n  // of identifiers separated by dots and enclosed in parentheses. E.g.,\n  // \"foo.(bar.baz).qux\".\n  bool ParseOptionNamePart(UninterpretedOption* uninterpreted_option,\n                           const LocationRecorder& part_location,\n                           const FileDescriptorProto* containing_file);\n\n  // Parses a string surrounded by balanced braces.  Strips off the outer\n  // braces and stores the enclosed string in *value.\n  // E.g.,\n  //     { foo }                     *value gets 'foo'\n  //     { foo { bar: box } }        *value gets 'foo { bar: box }'\n  //     {}                          *value gets ''\n  //\n  // REQUIRES: LookingAt(\"{\")\n  // When finished successfully, we are looking at the first token past\n  // the ending brace.\n  bool ParseUninterpretedBlock(string* value);\n\n  struct MapField {\n    // Whether the field is a map field.\n    bool is_map_field;\n    // The types of the key and value if they are primitive types.\n    FieldDescriptorProto::Type key_type;\n    FieldDescriptorProto::Type value_type;\n    // Or the type names string if the types are customized types.\n    string key_type_name;\n    string value_type_name;\n\n    MapField() : is_map_field(false) {}\n  };\n  // Desugar the map syntax to generate a nested map entry message.\n  void GenerateMapEntry(const MapField& map_field, FieldDescriptorProto* field,\n                        RepeatedPtrField<DescriptorProto>* messages);\n\n  // Whether fields without label default to optional fields.\n  bool DefaultToOptionalFields() const {\n    return syntax_identifier_ == \"proto3\";\n  }\n\n\n  bool ValidateEnum(const EnumDescriptorProto* proto);\n\n  // =================================================================\n\n  io::Tokenizer* input_;\n  io::ErrorCollector* error_collector_;\n  SourceCodeInfo* source_code_info_;\n  SourceLocationTable* source_location_table_;  // legacy\n  bool had_errors_;\n  bool require_syntax_identifier_;\n  bool stop_after_syntax_identifier_;\n  string syntax_identifier_;\n\n  // Leading doc comments for the next declaration.  These are not complete\n  // yet; use ConsumeEndOfDeclaration() to get the complete comments.\n  string upcoming_doc_comments_;\n\n  // Detached comments are not connected to any syntax entities. Elements in\n  // this vector are paragraphs of comments separated by empty lines. The\n  // detached comments will be put into the leading_detached_comments field for\n  // the next element (See SourceCodeInfo.Location in descriptor.proto), when\n  // ConsumeEndOfDeclaration() is called.\n  std::vector<string> upcoming_detached_comments_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Parser);\n};\n\n// A table mapping (descriptor, ErrorLocation) pairs -- as reported by\n// DescriptorPool when validating descriptors -- to line and column numbers\n// within the original source code.\n//\n// This is semi-obsolete:  FileDescriptorProto.source_code_info now contains\n// far more complete information about source locations.  However, as of this\n// writing you still need to use SourceLocationTable when integrating with\n// DescriptorPool.\nclass LIBPROTOBUF_EXPORT SourceLocationTable {\n public:\n  SourceLocationTable();\n  ~SourceLocationTable();\n\n  // Finds the precise location of the given error and fills in *line and\n  // *column with the line and column numbers.  If not found, sets *line to\n  // -1 and *column to 0 (since line = -1 is used to mean \"error has no exact\n  // location\" in the ErrorCollector interface).  Returns true if found, false\n  // otherwise.\n  bool Find(const Message* descriptor,\n            DescriptorPool::ErrorCollector::ErrorLocation location,\n            int* line, int* column) const;\n\n  // Adds a location to the table.\n  void Add(const Message* descriptor,\n           DescriptorPool::ErrorCollector::ErrorLocation location,\n           int line, int column);\n\n  // Clears the contents of the table.\n  void Clear();\n\n private:\n  typedef std::map<\n    std::pair<const Message*, DescriptorPool::ErrorCollector::ErrorLocation>,\n    std::pair<int, int> > LocationMap;\n  LocationMap location_map_;\n};\n\n}  // namespace compiler\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_PARSER_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/php/php_generator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__\n#define GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__\n\n#include <google/protobuf/compiler/code_generator.h>\n#include <google/protobuf/descriptor.h>\n\n#include <string>\n\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\nnamespace php {\n\nclass LIBPROTOC_EXPORT Generator\n    : public google::protobuf::compiler::CodeGenerator {\n  virtual bool Generate(\n      const FileDescriptor* file,\n      const string& parameter,\n      GeneratorContext* generator_context,\n      string* error) const;\n};\n\n// To skip reserved keywords in php, some generated classname are prefixed.\n// Other code generators may need following API to figure out the actual\n// classname.\nLIBPROTOC_EXPORT std::string GeneratedClassName(\n    const google::protobuf::Descriptor* desc);\nLIBPROTOC_EXPORT std::string GeneratedClassName(\n    const google::protobuf::EnumDescriptor* desc);\nLIBPROTOC_EXPORT std::string GeneratedClassName(\n    const google::protobuf::ServiceDescriptor* desc);\n\n}  // namespace php\n}  // namespace compiler\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/plugin.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//\n// Front-end for protoc code generator plugins written in C++.\n//\n// To implement a protoc plugin in C++, simply write an implementation of\n// CodeGenerator, then create a main() function like:\n//   int main(int argc, char* argv[]) {\n//     MyCodeGenerator generator;\n//     return google::protobuf::compiler::PluginMain(argc, argv, &generator);\n//   }\n// You must link your plugin against libprotobuf and libprotoc.\n//\n// The core part of PluginMain is to invoke the given CodeGenerator on a\n// CodeGeneratorRequest to generate a CodeGeneratorResponse. This part is\n// abstracted out and made into function GenerateCode so that it can be reused,\n// for example, to implement a variant of PluginMain that does some\n// preprocessing on the input CodeGeneratorRequest before feeding the request\n// to the given code generator.\n//\n// To get protoc to use the plugin, do one of the following:\n// * Place the plugin binary somewhere in the PATH and give it the name\n//   \"protoc-gen-NAME\" (replacing \"NAME\" with the name of your plugin).  If you\n//   then invoke protoc with the parameter --NAME_out=OUT_DIR (again, replace\n//   \"NAME\" with your plugin's name), protoc will invoke your plugin to generate\n//   the output, which will be placed in OUT_DIR.\n// * Place the plugin binary anywhere, with any name, and pass the --plugin\n//   parameter to protoc to direct it to your plugin like so:\n//     protoc --plugin=protoc-gen-NAME=path/to/mybinary --NAME_out=OUT_DIR\n//   On Windows, make sure to include the .exe suffix:\n//     protoc --plugin=protoc-gen-NAME=path/to/mybinary.exe --NAME_out=OUT_DIR\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__\n#define GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\n\nclass CodeGenerator;    // code_generator.h\nclass CodeGeneratorRequest;\nclass CodeGeneratorResponse;\n\n// Implements main() for a protoc plugin exposing the given code generator.\nLIBPROTOC_EXPORT int PluginMain(int argc, char* argv[], const CodeGenerator* generator);\n\n// Generates code using the given code generator. Returns true if the code\n// generation is successful. If the code geneartion fails, error_msg may be\n// populated to describe the failure cause.\nbool GenerateCode(const CodeGeneratorRequest& request,\n    const CodeGenerator& generator, CodeGeneratorResponse* response,\n    string* error_msg);\n\n}  // namespace compiler\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/plugin.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/compiler/plugin.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/unknown_field_set.h>\n#include <google/protobuf/descriptor.pb.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto LIBPROTOC_EXPORT\n#ifdef major\n#undef major\n#endif\n#ifdef minor\n#undef minor\n#endif\n\nnamespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOC_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[4];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOC_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\nclass CodeGeneratorRequest;\nclass CodeGeneratorRequestDefaultTypeInternal;\nLIBPROTOC_EXPORT extern CodeGeneratorRequestDefaultTypeInternal _CodeGeneratorRequest_default_instance_;\nclass CodeGeneratorResponse;\nclass CodeGeneratorResponseDefaultTypeInternal;\nLIBPROTOC_EXPORT extern CodeGeneratorResponseDefaultTypeInternal _CodeGeneratorResponse_default_instance_;\nclass CodeGeneratorResponse_File;\nclass CodeGeneratorResponse_FileDefaultTypeInternal;\nLIBPROTOC_EXPORT extern CodeGeneratorResponse_FileDefaultTypeInternal _CodeGeneratorResponse_File_default_instance_;\nclass Version;\nclass VersionDefaultTypeInternal;\nLIBPROTOC_EXPORT extern VersionDefaultTypeInternal _Version_default_instance_;\n}  // namespace compiler\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOC_EXPORT ::google::protobuf::compiler::CodeGeneratorRequest* Arena::CreateMaybeMessage<::google::protobuf::compiler::CodeGeneratorRequest>(Arena*);\ntemplate<> LIBPROTOC_EXPORT ::google::protobuf::compiler::CodeGeneratorResponse* Arena::CreateMaybeMessage<::google::protobuf::compiler::CodeGeneratorResponse>(Arena*);\ntemplate<> LIBPROTOC_EXPORT ::google::protobuf::compiler::CodeGeneratorResponse_File* Arena::CreateMaybeMessage<::google::protobuf::compiler::CodeGeneratorResponse_File>(Arena*);\ntemplate<> LIBPROTOC_EXPORT ::google::protobuf::compiler::Version* Arena::CreateMaybeMessage<::google::protobuf::compiler::Version>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\n\n// ===================================================================\n\nclass LIBPROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.Version) */ {\n public:\n  Version();\n  virtual ~Version();\n\n  Version(const Version& from);\n\n  inline Version& operator=(const Version& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Version(Version&& from) noexcept\n    : Version() {\n    *this = ::std::move(from);\n  }\n\n  inline Version& operator=(Version&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Version& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Version* internal_default_instance() {\n    return reinterpret_cast<const Version*>(\n               &_Version_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void Swap(Version* other);\n  friend void swap(Version& a, Version& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Version* New() const final {\n    return CreateMaybeMessage<Version>(NULL);\n  }\n\n  Version* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Version>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Version& from);\n  void MergeFrom(const Version& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Version* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional string suffix = 4;\n  bool has_suffix() const;\n  void clear_suffix();\n  static const int kSuffixFieldNumber = 4;\n  const ::std::string& suffix() const;\n  void set_suffix(const ::std::string& value);\n  #if LANG_CXX11\n  void set_suffix(::std::string&& value);\n  #endif\n  void set_suffix(const char* value);\n  void set_suffix(const char* value, size_t size);\n  ::std::string* mutable_suffix();\n  ::std::string* release_suffix();\n  void set_allocated_suffix(::std::string* suffix);\n\n  // optional int32 major = 1;\n  bool has_major() const;\n  void clear_major();\n  static const int kMajorFieldNumber = 1;\n  ::google::protobuf::int32 major() const;\n  void set_major(::google::protobuf::int32 value);\n\n  // optional int32 minor = 2;\n  bool has_minor() const;\n  void clear_minor();\n  static const int kMinorFieldNumber = 2;\n  ::google::protobuf::int32 minor() const;\n  void set_minor(::google::protobuf::int32 value);\n\n  // optional int32 patch = 3;\n  bool has_patch() const;\n  void clear_patch();\n  static const int kPatchFieldNumber = 3;\n  ::google::protobuf::int32 patch() const;\n  void set_patch(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.compiler.Version)\n private:\n  void set_has_major();\n  void clear_has_major();\n  void set_has_minor();\n  void clear_has_minor();\n  void set_has_patch();\n  void clear_has_patch();\n  void set_has_suffix();\n  void clear_has_suffix();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::internal::ArenaStringPtr suffix_;\n  ::google::protobuf::int32 major_;\n  ::google::protobuf::int32 minor_;\n  ::google::protobuf::int32 patch_;\n  friend struct ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorRequest) */ {\n public:\n  CodeGeneratorRequest();\n  virtual ~CodeGeneratorRequest();\n\n  CodeGeneratorRequest(const CodeGeneratorRequest& from);\n\n  inline CodeGeneratorRequest& operator=(const CodeGeneratorRequest& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  CodeGeneratorRequest(CodeGeneratorRequest&& from) noexcept\n    : CodeGeneratorRequest() {\n    *this = ::std::move(from);\n  }\n\n  inline CodeGeneratorRequest& operator=(CodeGeneratorRequest&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const CodeGeneratorRequest& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const CodeGeneratorRequest* internal_default_instance() {\n    return reinterpret_cast<const CodeGeneratorRequest*>(\n               &_CodeGeneratorRequest_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    1;\n\n  void Swap(CodeGeneratorRequest* other);\n  friend void swap(CodeGeneratorRequest& a, CodeGeneratorRequest& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline CodeGeneratorRequest* New() const final {\n    return CreateMaybeMessage<CodeGeneratorRequest>(NULL);\n  }\n\n  CodeGeneratorRequest* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<CodeGeneratorRequest>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const CodeGeneratorRequest& from);\n  void MergeFrom(const CodeGeneratorRequest& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(CodeGeneratorRequest* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated string file_to_generate = 1;\n  int file_to_generate_size() const;\n  void clear_file_to_generate();\n  static const int kFileToGenerateFieldNumber = 1;\n  const ::std::string& file_to_generate(int index) const;\n  ::std::string* mutable_file_to_generate(int index);\n  void set_file_to_generate(int index, const ::std::string& value);\n  #if LANG_CXX11\n  void set_file_to_generate(int index, ::std::string&& value);\n  #endif\n  void set_file_to_generate(int index, const char* value);\n  void set_file_to_generate(int index, const char* value, size_t size);\n  ::std::string* add_file_to_generate();\n  void add_file_to_generate(const ::std::string& value);\n  #if LANG_CXX11\n  void add_file_to_generate(::std::string&& value);\n  #endif\n  void add_file_to_generate(const char* value);\n  void add_file_to_generate(const char* value, size_t size);\n  const ::google::protobuf::RepeatedPtrField< ::std::string>& file_to_generate() const;\n  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_file_to_generate();\n\n  // repeated .google.protobuf.FileDescriptorProto proto_file = 15;\n  int proto_file_size() const;\n  void clear_proto_file();\n  static const int kProtoFileFieldNumber = 15;\n  ::google::protobuf::FileDescriptorProto* mutable_proto_file(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*\n      mutable_proto_file();\n  const ::google::protobuf::FileDescriptorProto& proto_file(int index) const;\n  ::google::protobuf::FileDescriptorProto* add_proto_file();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >&\n      proto_file() const;\n\n  // optional string parameter = 2;\n  bool has_parameter() const;\n  void clear_parameter();\n  static const int kParameterFieldNumber = 2;\n  const ::std::string& parameter() const;\n  void set_parameter(const ::std::string& value);\n  #if LANG_CXX11\n  void set_parameter(::std::string&& value);\n  #endif\n  void set_parameter(const char* value);\n  void set_parameter(const char* value, size_t size);\n  ::std::string* mutable_parameter();\n  ::std::string* release_parameter();\n  void set_allocated_parameter(::std::string* parameter);\n\n  // optional .google.protobuf.compiler.Version compiler_version = 3;\n  bool has_compiler_version() const;\n  void clear_compiler_version();\n  static const int kCompilerVersionFieldNumber = 3;\n  private:\n  const ::google::protobuf::compiler::Version& _internal_compiler_version() const;\n  public:\n  const ::google::protobuf::compiler::Version& compiler_version() const;\n  ::google::protobuf::compiler::Version* release_compiler_version();\n  ::google::protobuf::compiler::Version* mutable_compiler_version();\n  void set_allocated_compiler_version(::google::protobuf::compiler::Version* compiler_version);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest)\n private:\n  void set_has_parameter();\n  void clear_has_parameter();\n  void set_has_compiler_version();\n  void clear_has_compiler_version();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::std::string> file_to_generate_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto > proto_file_;\n  ::google::protobuf::internal::ArenaStringPtr parameter_;\n  ::google::protobuf::compiler::Version* compiler_version_;\n  friend struct ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOC_EXPORT CodeGeneratorResponse_File : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse.File) */ {\n public:\n  CodeGeneratorResponse_File();\n  virtual ~CodeGeneratorResponse_File();\n\n  CodeGeneratorResponse_File(const CodeGeneratorResponse_File& from);\n\n  inline CodeGeneratorResponse_File& operator=(const CodeGeneratorResponse_File& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  CodeGeneratorResponse_File(CodeGeneratorResponse_File&& from) noexcept\n    : CodeGeneratorResponse_File() {\n    *this = ::std::move(from);\n  }\n\n  inline CodeGeneratorResponse_File& operator=(CodeGeneratorResponse_File&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const CodeGeneratorResponse_File& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const CodeGeneratorResponse_File* internal_default_instance() {\n    return reinterpret_cast<const CodeGeneratorResponse_File*>(\n               &_CodeGeneratorResponse_File_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    2;\n\n  void Swap(CodeGeneratorResponse_File* other);\n  friend void swap(CodeGeneratorResponse_File& a, CodeGeneratorResponse_File& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline CodeGeneratorResponse_File* New() const final {\n    return CreateMaybeMessage<CodeGeneratorResponse_File>(NULL);\n  }\n\n  CodeGeneratorResponse_File* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<CodeGeneratorResponse_File>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const CodeGeneratorResponse_File& from);\n  void MergeFrom(const CodeGeneratorResponse_File& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(CodeGeneratorResponse_File* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional string name = 1;\n  bool has_name() const;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n\n  // optional string insertion_point = 2;\n  bool has_insertion_point() const;\n  void clear_insertion_point();\n  static const int kInsertionPointFieldNumber = 2;\n  const ::std::string& insertion_point() const;\n  void set_insertion_point(const ::std::string& value);\n  #if LANG_CXX11\n  void set_insertion_point(::std::string&& value);\n  #endif\n  void set_insertion_point(const char* value);\n  void set_insertion_point(const char* value, size_t size);\n  ::std::string* mutable_insertion_point();\n  ::std::string* release_insertion_point();\n  void set_allocated_insertion_point(::std::string* insertion_point);\n\n  // optional string content = 15;\n  bool has_content() const;\n  void clear_content();\n  static const int kContentFieldNumber = 15;\n  const ::std::string& content() const;\n  void set_content(const ::std::string& value);\n  #if LANG_CXX11\n  void set_content(::std::string&& value);\n  #endif\n  void set_content(const char* value);\n  void set_content(const char* value, size_t size);\n  ::std::string* mutable_content();\n  ::std::string* release_content();\n  void set_allocated_content(::std::string* content);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File)\n private:\n  void set_has_name();\n  void clear_has_name();\n  void set_has_insertion_point();\n  void clear_has_insertion_point();\n  void set_has_content();\n  void clear_has_content();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::internal::ArenaStringPtr insertion_point_;\n  ::google::protobuf::internal::ArenaStringPtr content_;\n  friend struct ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.compiler.CodeGeneratorResponse) */ {\n public:\n  CodeGeneratorResponse();\n  virtual ~CodeGeneratorResponse();\n\n  CodeGeneratorResponse(const CodeGeneratorResponse& from);\n\n  inline CodeGeneratorResponse& operator=(const CodeGeneratorResponse& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  CodeGeneratorResponse(CodeGeneratorResponse&& from) noexcept\n    : CodeGeneratorResponse() {\n    *this = ::std::move(from);\n  }\n\n  inline CodeGeneratorResponse& operator=(CodeGeneratorResponse&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const CodeGeneratorResponse& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const CodeGeneratorResponse* internal_default_instance() {\n    return reinterpret_cast<const CodeGeneratorResponse*>(\n               &_CodeGeneratorResponse_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    3;\n\n  void Swap(CodeGeneratorResponse* other);\n  friend void swap(CodeGeneratorResponse& a, CodeGeneratorResponse& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline CodeGeneratorResponse* New() const final {\n    return CreateMaybeMessage<CodeGeneratorResponse>(NULL);\n  }\n\n  CodeGeneratorResponse* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<CodeGeneratorResponse>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const CodeGeneratorResponse& from);\n  void MergeFrom(const CodeGeneratorResponse& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(CodeGeneratorResponse* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef CodeGeneratorResponse_File File;\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;\n  int file_size() const;\n  void clear_file();\n  static const int kFileFieldNumber = 15;\n  ::google::protobuf::compiler::CodeGeneratorResponse_File* mutable_file(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >*\n      mutable_file();\n  const ::google::protobuf::compiler::CodeGeneratorResponse_File& file(int index) const;\n  ::google::protobuf::compiler::CodeGeneratorResponse_File* add_file();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >&\n      file() const;\n\n  // optional string error = 1;\n  bool has_error() const;\n  void clear_error();\n  static const int kErrorFieldNumber = 1;\n  const ::std::string& error() const;\n  void set_error(const ::std::string& value);\n  #if LANG_CXX11\n  void set_error(::std::string&& value);\n  #endif\n  void set_error(const char* value);\n  void set_error(const char* value, size_t size);\n  ::std::string* mutable_error();\n  ::std::string* release_error();\n  void set_allocated_error(::std::string* error);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse)\n private:\n  void set_has_error();\n  void clear_has_error();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File > file_;\n  ::google::protobuf::internal::ArenaStringPtr error_;\n  friend struct ::protobuf_google_2fprotobuf_2fcompiler_2fplugin_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// Version\n\n// optional int32 major = 1;\ninline bool Version::has_major() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void Version::set_has_major() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void Version::clear_has_major() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void Version::clear_major() {\n  major_ = 0;\n  clear_has_major();\n}\ninline ::google::protobuf::int32 Version::major() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.major)\n  return major_;\n}\ninline void Version::set_major(::google::protobuf::int32 value) {\n  set_has_major();\n  major_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.major)\n}\n\n// optional int32 minor = 2;\ninline bool Version::has_minor() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void Version::set_has_minor() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void Version::clear_has_minor() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void Version::clear_minor() {\n  minor_ = 0;\n  clear_has_minor();\n}\ninline ::google::protobuf::int32 Version::minor() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.minor)\n  return minor_;\n}\ninline void Version::set_minor(::google::protobuf::int32 value) {\n  set_has_minor();\n  minor_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.minor)\n}\n\n// optional int32 patch = 3;\ninline bool Version::has_patch() const {\n  return (_has_bits_[0] & 0x00000008u) != 0;\n}\ninline void Version::set_has_patch() {\n  _has_bits_[0] |= 0x00000008u;\n}\ninline void Version::clear_has_patch() {\n  _has_bits_[0] &= ~0x00000008u;\n}\ninline void Version::clear_patch() {\n  patch_ = 0;\n  clear_has_patch();\n}\ninline ::google::protobuf::int32 Version::patch() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.patch)\n  return patch_;\n}\ninline void Version::set_patch(::google::protobuf::int32 value) {\n  set_has_patch();\n  patch_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.patch)\n}\n\n// optional string suffix = 4;\ninline bool Version::has_suffix() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void Version::set_has_suffix() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void Version::clear_has_suffix() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void Version::clear_suffix() {\n  suffix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  clear_has_suffix();\n}\ninline const ::std::string& Version::suffix() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.Version.suffix)\n  return suffix_.GetNoArena();\n}\ninline void Version::set_suffix(const ::std::string& value) {\n  set_has_suffix();\n  suffix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.Version.suffix)\n}\n#if LANG_CXX11\ninline void Version::set_suffix(::std::string&& value) {\n  set_has_suffix();\n  suffix_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.Version.suffix)\n}\n#endif\ninline void Version::set_suffix(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_suffix();\n  suffix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.Version.suffix)\n}\ninline void Version::set_suffix(const char* value, size_t size) {\n  set_has_suffix();\n  suffix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.Version.suffix)\n}\ninline ::std::string* Version::mutable_suffix() {\n  set_has_suffix();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.Version.suffix)\n  return suffix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* Version::release_suffix() {\n  // @@protoc_insertion_point(field_release:google.protobuf.compiler.Version.suffix)\n  if (!has_suffix()) {\n    return NULL;\n  }\n  clear_has_suffix();\n  return suffix_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void Version::set_allocated_suffix(::std::string* suffix) {\n  if (suffix != NULL) {\n    set_has_suffix();\n  } else {\n    clear_has_suffix();\n  }\n  suffix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), suffix);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.Version.suffix)\n}\n\n// -------------------------------------------------------------------\n\n// CodeGeneratorRequest\n\n// repeated string file_to_generate = 1;\ninline int CodeGeneratorRequest::file_to_generate_size() const {\n  return file_to_generate_.size();\n}\ninline void CodeGeneratorRequest::clear_file_to_generate() {\n  file_to_generate_.Clear();\n}\ninline const ::std::string& CodeGeneratorRequest::file_to_generate(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n  return file_to_generate_.Get(index);\n}\ninline ::std::string* CodeGeneratorRequest::mutable_file_to_generate(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n  return file_to_generate_.Mutable(index);\n}\ninline void CodeGeneratorRequest::set_file_to_generate(int index, const ::std::string& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n  file_to_generate_.Mutable(index)->assign(value);\n}\n#if LANG_CXX11\ninline void CodeGeneratorRequest::set_file_to_generate(int index, ::std::string&& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n  file_to_generate_.Mutable(index)->assign(std::move(value));\n}\n#endif\ninline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  file_to_generate_.Mutable(index)->assign(value);\n  // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n}\ninline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value, size_t size) {\n  file_to_generate_.Mutable(index)->assign(\n    reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n}\ninline ::std::string* CodeGeneratorRequest::add_file_to_generate() {\n  // @@protoc_insertion_point(field_add_mutable:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n  return file_to_generate_.Add();\n}\ninline void CodeGeneratorRequest::add_file_to_generate(const ::std::string& value) {\n  file_to_generate_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n}\n#if LANG_CXX11\ninline void CodeGeneratorRequest::add_file_to_generate(::std::string&& value) {\n  file_to_generate_.Add(std::move(value));\n  // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n}\n#endif\ninline void CodeGeneratorRequest::add_file_to_generate(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  file_to_generate_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n}\ninline void CodeGeneratorRequest::add_file_to_generate(const char* value, size_t size) {\n  file_to_generate_.Add()->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_add_pointer:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n}\ninline const ::google::protobuf::RepeatedPtrField< ::std::string>&\nCodeGeneratorRequest::file_to_generate() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n  return file_to_generate_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::std::string>*\nCodeGeneratorRequest::mutable_file_to_generate() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate)\n  return &file_to_generate_;\n}\n\n// optional string parameter = 2;\ninline bool CodeGeneratorRequest::has_parameter() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void CodeGeneratorRequest::set_has_parameter() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void CodeGeneratorRequest::clear_has_parameter() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void CodeGeneratorRequest::clear_parameter() {\n  parameter_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  clear_has_parameter();\n}\ninline const ::std::string& CodeGeneratorRequest::parameter() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.parameter)\n  return parameter_.GetNoArena();\n}\ninline void CodeGeneratorRequest::set_parameter(const ::std::string& value) {\n  set_has_parameter();\n  parameter_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorRequest.parameter)\n}\n#if LANG_CXX11\ninline void CodeGeneratorRequest::set_parameter(::std::string&& value) {\n  set_has_parameter();\n  parameter_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorRequest.parameter)\n}\n#endif\ninline void CodeGeneratorRequest::set_parameter(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_parameter();\n  parameter_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.parameter)\n}\ninline void CodeGeneratorRequest::set_parameter(const char* value, size_t size) {\n  set_has_parameter();\n  parameter_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorRequest.parameter)\n}\ninline ::std::string* CodeGeneratorRequest::mutable_parameter() {\n  set_has_parameter();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.parameter)\n  return parameter_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* CodeGeneratorRequest::release_parameter() {\n  // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.parameter)\n  if (!has_parameter()) {\n    return NULL;\n  }\n  clear_has_parameter();\n  return parameter_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void CodeGeneratorRequest::set_allocated_parameter(::std::string* parameter) {\n  if (parameter != NULL) {\n    set_has_parameter();\n  } else {\n    clear_has_parameter();\n  }\n  parameter_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), parameter);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.parameter)\n}\n\n// repeated .google.protobuf.FileDescriptorProto proto_file = 15;\ninline int CodeGeneratorRequest::proto_file_size() const {\n  return proto_file_.size();\n}\ninline ::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::mutable_proto_file(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.proto_file)\n  return proto_file_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*\nCodeGeneratorRequest::mutable_proto_file() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file)\n  return &proto_file_;\n}\ninline const ::google::protobuf::FileDescriptorProto& CodeGeneratorRequest::proto_file(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.proto_file)\n  return proto_file_.Get(index);\n}\ninline ::google::protobuf::FileDescriptorProto* CodeGeneratorRequest::add_proto_file() {\n  // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.proto_file)\n  return proto_file_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >&\nCodeGeneratorRequest::proto_file() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file)\n  return proto_file_;\n}\n\n// optional .google.protobuf.compiler.Version compiler_version = 3;\ninline bool CodeGeneratorRequest::has_compiler_version() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void CodeGeneratorRequest::set_has_compiler_version() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void CodeGeneratorRequest::clear_has_compiler_version() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void CodeGeneratorRequest::clear_compiler_version() {\n  if (compiler_version_ != NULL) compiler_version_->Clear();\n  clear_has_compiler_version();\n}\ninline const ::google::protobuf::compiler::Version& CodeGeneratorRequest::_internal_compiler_version() const {\n  return *compiler_version_;\n}\ninline const ::google::protobuf::compiler::Version& CodeGeneratorRequest::compiler_version() const {\n  const ::google::protobuf::compiler::Version* p = compiler_version_;\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::compiler::Version*>(\n      &::google::protobuf::compiler::_Version_default_instance_);\n}\ninline ::google::protobuf::compiler::Version* CodeGeneratorRequest::release_compiler_version() {\n  // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)\n  clear_has_compiler_version();\n  ::google::protobuf::compiler::Version* temp = compiler_version_;\n  compiler_version_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::compiler::Version* CodeGeneratorRequest::mutable_compiler_version() {\n  set_has_compiler_version();\n  if (compiler_version_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::compiler::Version>(GetArenaNoVirtual());\n    compiler_version_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)\n  return compiler_version_;\n}\ninline void CodeGeneratorRequest::set_allocated_compiler_version(::google::protobuf::compiler::Version* compiler_version) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete compiler_version_;\n  }\n  if (compiler_version) {\n    ::google::protobuf::Arena* submessage_arena = NULL;\n    if (message_arena != submessage_arena) {\n      compiler_version = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, compiler_version, submessage_arena);\n    }\n    set_has_compiler_version();\n  } else {\n    clear_has_compiler_version();\n  }\n  compiler_version_ = compiler_version;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version)\n}\n\n// -------------------------------------------------------------------\n\n// CodeGeneratorResponse_File\n\n// optional string name = 1;\ninline bool CodeGeneratorResponse_File::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void CodeGeneratorResponse_File::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void CodeGeneratorResponse_File::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void CodeGeneratorResponse_File::clear_name() {\n  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  clear_has_name();\n}\ninline const ::std::string& CodeGeneratorResponse_File::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.name)\n  return name_.GetNoArena();\n}\ninline void CodeGeneratorResponse_File::set_name(const ::std::string& value) {\n  set_has_name();\n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.name)\n}\n#if LANG_CXX11\ninline void CodeGeneratorResponse_File::set_name(::std::string&& value) {\n  set_has_name();\n  name_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorResponse.File.name)\n}\n#endif\ninline void CodeGeneratorResponse_File::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name();\n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.File.name)\n}\ninline void CodeGeneratorResponse_File::set_name(const char* value, size_t size) {\n  set_has_name();\n  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorResponse.File.name)\n}\ninline ::std::string* CodeGeneratorResponse_File::mutable_name() {\n  set_has_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.name)\n  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* CodeGeneratorResponse_File::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.name)\n  if (!has_name()) {\n    return NULL;\n  }\n  clear_has_name();\n  return name_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void CodeGeneratorResponse_File::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.name)\n}\n\n// optional string insertion_point = 2;\ninline bool CodeGeneratorResponse_File::has_insertion_point() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void CodeGeneratorResponse_File::set_has_insertion_point() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void CodeGeneratorResponse_File::clear_has_insertion_point() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void CodeGeneratorResponse_File::clear_insertion_point() {\n  insertion_point_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  clear_has_insertion_point();\n}\ninline const ::std::string& CodeGeneratorResponse_File::insertion_point() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)\n  return insertion_point_.GetNoArena();\n}\ninline void CodeGeneratorResponse_File::set_insertion_point(const ::std::string& value) {\n  set_has_insertion_point();\n  insertion_point_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)\n}\n#if LANG_CXX11\ninline void CodeGeneratorResponse_File::set_insertion_point(::std::string&& value) {\n  set_has_insertion_point();\n  insertion_point_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)\n}\n#endif\ninline void CodeGeneratorResponse_File::set_insertion_point(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_insertion_point();\n  insertion_point_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)\n}\ninline void CodeGeneratorResponse_File::set_insertion_point(const char* value, size_t size) {\n  set_has_insertion_point();\n  insertion_point_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)\n}\ninline ::std::string* CodeGeneratorResponse_File::mutable_insertion_point() {\n  set_has_insertion_point();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)\n  return insertion_point_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* CodeGeneratorResponse_File::release_insertion_point() {\n  // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)\n  if (!has_insertion_point()) {\n    return NULL;\n  }\n  clear_has_insertion_point();\n  return insertion_point_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void CodeGeneratorResponse_File::set_allocated_insertion_point(::std::string* insertion_point) {\n  if (insertion_point != NULL) {\n    set_has_insertion_point();\n  } else {\n    clear_has_insertion_point();\n  }\n  insertion_point_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), insertion_point);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)\n}\n\n// optional string content = 15;\ninline bool CodeGeneratorResponse_File::has_content() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void CodeGeneratorResponse_File::set_has_content() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void CodeGeneratorResponse_File::clear_has_content() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void CodeGeneratorResponse_File::clear_content() {\n  content_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  clear_has_content();\n}\ninline const ::std::string& CodeGeneratorResponse_File::content() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.content)\n  return content_.GetNoArena();\n}\ninline void CodeGeneratorResponse_File::set_content(const ::std::string& value) {\n  set_has_content();\n  content_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.File.content)\n}\n#if LANG_CXX11\ninline void CodeGeneratorResponse_File::set_content(::std::string&& value) {\n  set_has_content();\n  content_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorResponse.File.content)\n}\n#endif\ninline void CodeGeneratorResponse_File::set_content(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_content();\n  content_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.File.content)\n}\ninline void CodeGeneratorResponse_File::set_content(const char* value, size_t size) {\n  set_has_content();\n  content_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorResponse.File.content)\n}\ninline ::std::string* CodeGeneratorResponse_File::mutable_content() {\n  set_has_content();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.content)\n  return content_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* CodeGeneratorResponse_File::release_content() {\n  // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.content)\n  if (!has_content()) {\n    return NULL;\n  }\n  clear_has_content();\n  return content_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void CodeGeneratorResponse_File::set_allocated_content(::std::string* content) {\n  if (content != NULL) {\n    set_has_content();\n  } else {\n    clear_has_content();\n  }\n  content_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), content);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.content)\n}\n\n// -------------------------------------------------------------------\n\n// CodeGeneratorResponse\n\n// optional string error = 1;\ninline bool CodeGeneratorResponse::has_error() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void CodeGeneratorResponse::set_has_error() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void CodeGeneratorResponse::clear_has_error() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void CodeGeneratorResponse::clear_error() {\n  error_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  clear_has_error();\n}\ninline const ::std::string& CodeGeneratorResponse::error() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.error)\n  return error_.GetNoArena();\n}\ninline void CodeGeneratorResponse::set_error(const ::std::string& value) {\n  set_has_error();\n  error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.compiler.CodeGeneratorResponse.error)\n}\n#if LANG_CXX11\ninline void CodeGeneratorResponse::set_error(::std::string&& value) {\n  set_has_error();\n  error_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.compiler.CodeGeneratorResponse.error)\n}\n#endif\ninline void CodeGeneratorResponse::set_error(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_error();\n  error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.error)\n}\ninline void CodeGeneratorResponse::set_error(const char* value, size_t size) {\n  set_has_error();\n  error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.compiler.CodeGeneratorResponse.error)\n}\ninline ::std::string* CodeGeneratorResponse::mutable_error() {\n  set_has_error();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.error)\n  return error_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* CodeGeneratorResponse::release_error() {\n  // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.error)\n  if (!has_error()) {\n    return NULL;\n  }\n  clear_has_error();\n  return error_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void CodeGeneratorResponse::set_allocated_error(::std::string* error) {\n  if (error != NULL) {\n    set_has_error();\n  } else {\n    clear_has_error();\n  }\n  error_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.error)\n}\n\n// repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;\ninline int CodeGeneratorResponse::file_size() const {\n  return file_.size();\n}\ninline void CodeGeneratorResponse::clear_file() {\n  file_.Clear();\n}\ninline ::google::protobuf::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::mutable_file(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.file)\n  return file_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >*\nCodeGeneratorResponse::mutable_file() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorResponse.file)\n  return &file_;\n}\ninline const ::google::protobuf::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::file(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.file)\n  return file_.Get(index);\n}\ninline ::google::protobuf::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::add_file() {\n  // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorResponse.file)\n  return file_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::compiler::CodeGeneratorResponse_File >&\nCodeGeneratorResponse::file() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorResponse.file)\n  return file_;\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace compiler\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/plugin.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//\n// WARNING:  The plugin interface is currently EXPERIMENTAL and is subject to\n//   change.\n//\n// protoc (aka the Protocol Compiler) can be extended via plugins.  A plugin is\n// just a program that reads a CodeGeneratorRequest from stdin and writes a\n// CodeGeneratorResponse to stdout.\n//\n// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead\n// of dealing with the raw protocol defined here.\n//\n// A plugin executable needs only to be placed somewhere in the path.  The\n// plugin should be named \"protoc-gen-$NAME\", and will then be used when the\n// flag \"--${NAME}_out\" is passed to protoc.\n\nsyntax = \"proto2\";\npackage google.protobuf.compiler;\noption java_package = \"com.google.protobuf.compiler\";\noption java_outer_classname = \"PluginProtos\";\n\noption go_package = \"github.com/golang/protobuf/protoc-gen-go/plugin;plugin_go\";\n\nimport \"google/protobuf/descriptor.proto\";\n\n// The version number of protocol compiler.\nmessage Version {\n  optional int32 major = 1;\n  optional int32 minor = 2;\n  optional int32 patch = 3;\n  // A suffix for alpha, beta or rc release, e.g., \"alpha-1\", \"rc2\". It should\n  // be empty for mainline stable releases.\n  optional string suffix = 4;\n}\n\n// An encoded CodeGeneratorRequest is written to the plugin's stdin.\nmessage CodeGeneratorRequest {\n  // The .proto files that were explicitly listed on the command-line.  The\n  // code generator should generate code only for these files.  Each file's\n  // descriptor will be included in proto_file, below.\n  repeated string file_to_generate = 1;\n\n  // The generator parameter passed on the command-line.\n  optional string parameter = 2;\n\n  // FileDescriptorProtos for all files in files_to_generate and everything\n  // they import.  The files will appear in topological order, so each file\n  // appears before any file that imports it.\n  //\n  // protoc guarantees that all proto_files will be written after\n  // the fields above, even though this is not technically guaranteed by the\n  // protobuf wire format.  This theoretically could allow a plugin to stream\n  // in the FileDescriptorProtos and handle them one by one rather than read\n  // the entire set into memory at once.  However, as of this writing, this\n  // is not similarly optimized on protoc's end -- it will store all fields in\n  // memory at once before sending them to the plugin.\n  //\n  // Type names of fields and extensions in the FileDescriptorProto are always\n  // fully qualified.\n  repeated FileDescriptorProto proto_file = 15;\n\n  // The version number of protocol compiler.\n  optional Version compiler_version = 3;\n\n}\n\n// The plugin writes an encoded CodeGeneratorResponse to stdout.\nmessage CodeGeneratorResponse {\n  // Error message.  If non-empty, code generation failed.  The plugin process\n  // should exit with status code zero even if it reports an error in this way.\n  //\n  // This should be used to indicate errors in .proto files which prevent the\n  // code generator from generating correct code.  Errors which indicate a\n  // problem in protoc itself -- such as the input CodeGeneratorRequest being\n  // unparseable -- should be reported by writing a message to stderr and\n  // exiting with a non-zero status code.\n  optional string error = 1;\n\n  // Represents a single generated file.\n  message File {\n    // The file name, relative to the output directory.  The name must not\n    // contain \".\" or \"..\" components and must be relative, not be absolute (so,\n    // the file cannot lie outside the output directory).  \"/\" must be used as\n    // the path separator, not \"\\\".\n    //\n    // If the name is omitted, the content will be appended to the previous\n    // file.  This allows the generator to break large files into small chunks,\n    // and allows the generated text to be streamed back to protoc so that large\n    // files need not reside completely in memory at one time.  Note that as of\n    // this writing protoc does not optimize for this -- it will read the entire\n    // CodeGeneratorResponse before writing files to disk.\n    optional string name = 1;\n\n    // If non-empty, indicates that the named file should already exist, and the\n    // content here is to be inserted into that file at a defined insertion\n    // point.  This feature allows a code generator to extend the output\n    // produced by another code generator.  The original generator may provide\n    // insertion points by placing special annotations in the file that look\n    // like:\n    //   @@protoc_insertion_point(NAME)\n    // The annotation can have arbitrary text before and after it on the line,\n    // which allows it to be placed in a comment.  NAME should be replaced with\n    // an identifier naming the point -- this is what other generators will use\n    // as the insertion_point.  Code inserted at this point will be placed\n    // immediately above the line containing the insertion point (thus multiple\n    // insertions to the same point will come out in the order they were added).\n    // The double-@ is intended to make it unlikely that the generated code\n    // could contain things that look like insertion points by accident.\n    //\n    // For example, the C++ code generator places the following line in the\n    // .pb.h files that it generates:\n    //   // @@protoc_insertion_point(namespace_scope)\n    // This line appears within the scope of the file's package namespace, but\n    // outside of any particular class.  Another plugin can then specify the\n    // insertion_point \"namespace_scope\" to generate additional classes or\n    // other declarations that should be placed in this scope.\n    //\n    // Note that if the line containing the insertion point begins with\n    // whitespace, the same whitespace will be added to every line of the\n    // inserted text.  This is useful for languages like Python, where\n    // indentation matters.  In these languages, the insertion point comment\n    // should be indented the same amount as any inserted code will need to be\n    // in order to work correctly in that context.\n    //\n    // The code generator that generates the initial file and the one which\n    // inserts into it must both run as part of a single invocation of protoc.\n    // Code generators are executed in the order in which they appear on the\n    // command line.\n    //\n    // If |insertion_point| is present, |name| must also be present.\n    optional string insertion_point = 2;\n\n    // The file contents.\n    optional string content = 15;\n  }\n  repeated File file = 15;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/python/python_generator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: robinson@google.com (Will Robinson)\n//\n// Generates Python code for a given .proto file.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__\n#define GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__\n\n#include <string>\n\n#include <google/protobuf/compiler/code_generator.h>\n#include <google/protobuf/stubs/mutex.h>\n#include <google/protobuf/stubs/common.h>\n\nnamespace google {\nnamespace protobuf {\n\nclass Descriptor;\nclass EnumDescriptor;\nclass EnumValueDescriptor;\nclass FieldDescriptor;\nclass OneofDescriptor;\nclass ServiceDescriptor;\n\nnamespace io { class Printer; }\n\nnamespace compiler {\nnamespace python {\n\n// CodeGenerator implementation for generated Python protocol buffer classes.\n// If you create your own protocol compiler binary and you want it to support\n// Python output, you can do so by registering an instance of this\n// CodeGenerator with the CommandLineInterface in your main() function.\nclass LIBPROTOC_EXPORT Generator : public CodeGenerator {\n public:\n  Generator();\n  virtual ~Generator();\n\n  // CodeGenerator methods.\n  virtual bool Generate(const FileDescriptor* file,\n                        const string& parameter,\n                        GeneratorContext* generator_context,\n                        string* error) const;\n\n private:\n  void PrintImports() const;\n  void PrintFileDescriptor() const;\n  void PrintTopLevelEnums() const;\n  void PrintAllNestedEnumsInFile() const;\n  void PrintNestedEnums(const Descriptor& descriptor) const;\n  void PrintEnum(const EnumDescriptor& enum_descriptor) const;\n\n  void PrintTopLevelExtensions() const;\n\n  void PrintFieldDescriptor(\n      const FieldDescriptor& field, bool is_extension) const;\n  void PrintFieldDescriptorsInDescriptor(\n      const Descriptor& message_descriptor,\n      bool is_extension,\n      const string& list_variable_name,\n      int (Descriptor::*CountFn)() const,\n      const FieldDescriptor* (Descriptor::*GetterFn)(int) const) const;\n  void PrintFieldsInDescriptor(const Descriptor& message_descriptor) const;\n  void PrintExtensionsInDescriptor(const Descriptor& message_descriptor) const;\n  void PrintMessageDescriptors() const;\n  void PrintDescriptor(const Descriptor& message_descriptor) const;\n  void PrintNestedDescriptors(const Descriptor& containing_descriptor) const;\n\n  void PrintMessages() const;\n  void PrintMessage(const Descriptor& message_descriptor, const string& prefix,\n                    std::vector<string>* to_register) const;\n  void PrintNestedMessages(const Descriptor& containing_descriptor,\n                           const string& prefix,\n                           std::vector<string>* to_register) const;\n\n  void FixForeignFieldsInDescriptors() const;\n  void FixForeignFieldsInDescriptor(\n      const Descriptor& descriptor,\n      const Descriptor* containing_descriptor) const;\n  void FixForeignFieldsInField(const Descriptor* containing_type,\n                               const FieldDescriptor& field,\n                               const string& python_dict_name) const;\n  void AddMessageToFileDescriptor(const Descriptor& descriptor) const;\n  void AddEnumToFileDescriptor(const EnumDescriptor& descriptor) const;\n  void AddExtensionToFileDescriptor(const FieldDescriptor& descriptor) const;\n  void AddServiceToFileDescriptor(const ServiceDescriptor& descriptor) const;\n  string FieldReferencingExpression(const Descriptor* containing_type,\n                                    const FieldDescriptor& field,\n                                    const string& python_dict_name) const;\n  template <typename DescriptorT>\n  void FixContainingTypeInDescriptor(\n      const DescriptorT& descriptor,\n      const Descriptor* containing_descriptor) const;\n\n  void FixForeignFieldsInExtensions() const;\n  void FixForeignFieldsInExtension(\n      const FieldDescriptor& extension_field) const;\n  void FixForeignFieldsInNestedExtensions(const Descriptor& descriptor) const;\n\n  void PrintServices() const;\n  void PrintServiceDescriptors() const;\n  void PrintServiceDescriptor(const ServiceDescriptor& descriptor) const;\n  void PrintServiceClass(const ServiceDescriptor& descriptor) const;\n  void PrintServiceStub(const ServiceDescriptor& descriptor) const;\n  void PrintDescriptorKeyAndModuleName(\n      const ServiceDescriptor& descriptor) const;\n\n  void PrintEnumValueDescriptor(const EnumValueDescriptor& descriptor) const;\n  string OptionsValue(const string& serialized_options) const;\n  bool GeneratingDescriptorProto() const;\n\n  template <typename DescriptorT>\n  string ModuleLevelDescriptorName(const DescriptorT& descriptor) const;\n  string ModuleLevelMessageName(const Descriptor& descriptor) const;\n  string ModuleLevelServiceDescriptorName(\n      const ServiceDescriptor& descriptor) const;\n\n  template <typename DescriptorT, typename DescriptorProtoT>\n  void PrintSerializedPbInterval(\n      const DescriptorT& descriptor, DescriptorProtoT& proto) const;\n\n  void FixAllDescriptorOptions() const;\n  void FixOptionsForField(const FieldDescriptor& field) const;\n  void FixOptionsForOneof(const OneofDescriptor& oneof) const;\n  void FixOptionsForEnum(const EnumDescriptor& descriptor) const;\n  void FixOptionsForMessage(const Descriptor& descriptor) const;\n\n  void CopyPublicDependenciesAliases(\n      const string& copy_from, const FileDescriptor* file) const;\n\n  // Very coarse-grained lock to ensure that Generate() is reentrant.\n  // Guards file_, printer_ and file_descriptor_serialized_.\n  mutable Mutex mutex_;\n  mutable const FileDescriptor* file_;  // Set in Generate().  Under mutex_.\n  mutable string file_descriptor_serialized_;\n  mutable io::Printer* printer_;  // Set in Generate().  Under mutex_.\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Generator);\n};\n\n}  // namespace python\n}  // namespace compiler\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/compiler/ruby/ruby_generator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Generates Ruby code for a given .proto file.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__\n#define GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__\n\n#include <string>\n\n#include <google/protobuf/compiler/code_generator.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace compiler {\nnamespace ruby {\n\n// CodeGenerator implementation for generated Ruby protocol buffer classes.\n// If you create your own protocol compiler binary and you want it to support\n// Ruby output, you can do so by registering an instance of this\n// CodeGenerator with the CommandLineInterface in your main() function.\nclass LIBPROTOC_EXPORT Generator\n    : public google::protobuf::compiler::CodeGenerator {\n  virtual bool Generate(\n      const FileDescriptor* file,\n      const string& parameter,\n      GeneratorContext* generator_context,\n      string* error) const;\n};\n\n}  // namespace ruby\n}  // namespace compiler\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__\n\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/descriptor.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This file contains classes which describe a type of protocol message.\n// You can use a message's descriptor to learn at runtime what fields\n// it contains and what the types of those fields are.  The Message\n// interface also allows you to dynamically access and modify individual\n// fields by passing the FieldDescriptor of the field you are interested\n// in.\n//\n// Most users will not care about descriptors, because they will write\n// code specific to certain protocol types and will simply use the classes\n// generated by the protocol compiler directly.  Advanced users who want\n// to operate on arbitrary types (not known at compile time) may want to\n// read descriptors in order to learn about the contents of a message.\n// A very small number of users will want to construct their own\n// Descriptors, either because they are implementing Message manually or\n// because they are writing something like the protocol compiler.\n//\n// For an example of how you might use descriptors, see the code example\n// at the top of message.h.\n\n#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_H__\n#define GOOGLE_PROTOBUF_DESCRIPTOR_H__\n\n#include <memory>\n#include <set>\n#include <string>\n#include <vector>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/mutex.h>\n#include <google/protobuf/stubs/once.h>\n\n// TYPE_BOOL is defined in the MacOS's ConditionalMacros.h.\n#ifdef TYPE_BOOL\n#undef TYPE_BOOL\n#endif  // TYPE_BOOL\n\nnamespace google {\nnamespace protobuf {\n\n// Defined in this file.\nclass Descriptor;\nclass FieldDescriptor;\nclass OneofDescriptor;\nclass EnumDescriptor;\nclass EnumValueDescriptor;\nclass ServiceDescriptor;\nclass MethodDescriptor;\nclass FileDescriptor;\nclass DescriptorDatabase;\nclass DescriptorPool;\n\n// Defined in descriptor.proto\nclass DescriptorProto;\nclass DescriptorProto_ExtensionRange;\nclass FieldDescriptorProto;\nclass OneofDescriptorProto;\nclass EnumDescriptorProto;\nclass EnumValueDescriptorProto;\nclass ServiceDescriptorProto;\nclass MethodDescriptorProto;\nclass FileDescriptorProto;\nclass MessageOptions;\nclass FieldOptions;\nclass OneofOptions;\nclass EnumOptions;\nclass EnumValueOptions;\nclass ExtensionRangeOptions;\nclass ServiceOptions;\nclass MethodOptions;\nclass FileOptions;\nclass UninterpretedOption;\nclass SourceCodeInfo;\n\n// Defined in message.h\nclass Message;\n\n// Defined in descriptor.cc\nclass DescriptorBuilder;\nclass FileDescriptorTables;\nstruct Symbol;\n\n// Defined in unknown_field_set.h.\nclass UnknownField;\n\n// Defined in generated_message_reflection.h.\nnamespace internal {\nclass GeneratedMessageReflection;\n}  // namespace internal\n\n// Defined in command_line_interface.cc\nnamespace compiler {\nclass CommandLineInterface;\n}  // namespace compiler\n\nnamespace descriptor_unittest {\nclass DescriptorTest;\n}  // namespace descriptor_unittest\n\n// Defined in printer.h\nnamespace io {\nclass Printer;\n}  // namespace io\n\n// NB, all indices are zero-based.\nstruct SourceLocation {\n  int start_line;\n  int end_line;\n  int start_column;\n  int end_column;\n\n  // Doc comments found at the source location.\n  // See the comments in SourceCodeInfo.Location (descriptor.proto) for details.\n  string leading_comments;\n  string trailing_comments;\n  std::vector<string> leading_detached_comments;\n};\n\n// Options when generating machine-parsable output from a descriptor with\n// DebugString().\nstruct DebugStringOptions {\n  // include original user comments as recorded in SourceLocation entries. N.B.\n  // that this must be |false| by default: several other pieces of code (for\n  // example, the C++ code generation for fields in the proto compiler) rely on\n  // DebugString() output being unobstructed by user comments.\n  bool include_comments;\n  // If true, elide the braced body in the debug string.\n  bool elide_group_body;\n  bool elide_oneof_body;\n\n  DebugStringOptions()\n      : include_comments(false),\n        elide_group_body(false),\n        elide_oneof_body(false) {}\n};\n\n// A class to handle the simplest cases of a lazily linked descriptor\n// for a message type that isn't built at the time of cross linking,\n// which is needed when a pool has lazily_build_dependencies_ set.\n// Must be instantiated as mutable in a descriptor.\nnamespace internal {\nclass LIBPROTOBUF_EXPORT LazyDescriptor {\n public:\n  // Init function to be called at init time of a descriptor containing\n  // a LazyDescriptor.\n  void Init() {\n    descriptor_ = NULL;\n    name_ = NULL;\n    once_ = NULL;\n    file_ = NULL;\n  }\n\n  // Sets the value of the descriptor if it is known during the descriptor\n  // building process. Not thread safe, should only be called during the\n  // descriptor build process. Should not be called after SetLazy has been\n  // called.\n  void Set(const Descriptor* descriptor);\n\n  // Sets the information needed to lazily cross link the descriptor at a later\n  // time, SetLazy is not thread safe, should be called only once at descriptor\n  // build time if the symbol wasn't found and building of the file containing\n  // that type is delayed because lazily_build_dependencies_ is set on the pool.\n  // Should not be called after Set() has been called.\n  void SetLazy(const string& name, const FileDescriptor* file);\n\n  // Returns the current value of the descriptor, thread-safe. If SetLazy(...)\n  // has been called, will do a one-time cross link of the type specified,\n  // building the descriptor file that contains the type if necessary.\n  inline const Descriptor* Get() {\n    Once();\n    return descriptor_;\n  }\n\n private:\n  static void OnceStatic(LazyDescriptor* lazy);\n  void OnceInternal();\n  void Once();\n\n  const Descriptor* descriptor_;\n  const string* name_;\n  GoogleOnceDynamic* once_;\n  const FileDescriptor* file_;\n};\n}  // namespace internal\n\n// Describes a type of protocol message, or a particular group within a\n// message.  To obtain the Descriptor for a given message object, call\n// Message::GetDescriptor().  Generated message classes also have a\n// static method called descriptor() which returns the type's descriptor.\n// Use DescriptorPool to construct your own descriptors.\nclass LIBPROTOBUF_EXPORT Descriptor {\n public:\n  // The name of the message type, not including its scope.\n  const string& name() const;\n\n  // The fully-qualified name of the message type, scope delimited by\n  // periods.  For example, message type \"Foo\" which is declared in package\n  // \"bar\" has full name \"bar.Foo\".  If a type \"Baz\" is nested within\n  // Foo, Baz's full_name is \"bar.Foo.Baz\".  To get only the part that\n  // comes after the last '.', use name().\n  const string& full_name() const;\n\n  // Index of this descriptor within the file or containing type's message\n  // type array.\n  int index() const;\n\n  // The .proto file in which this message type was defined.  Never NULL.\n  const FileDescriptor* file() const;\n\n  // If this Descriptor describes a nested type, this returns the type\n  // in which it is nested.  Otherwise, returns NULL.\n  const Descriptor* containing_type() const;\n\n  // Get options for this message type.  These are specified in the .proto file\n  // by placing lines like \"option foo = 1234;\" in the message definition.\n  // Allowed options are defined by MessageOptions in\n  // google/protobuf/descriptor.proto, and any available extensions of that\n  // message.\n  const MessageOptions& options() const;\n\n  // Write the contents of this Descriptor into the given DescriptorProto.\n  // The target DescriptorProto must be clear before calling this; if it\n  // isn't, the result may be garbage.\n  void CopyTo(DescriptorProto* proto) const;\n\n  // Write the contents of this decriptor in a human-readable form. Output\n  // will be suitable for re-parsing.\n  string DebugString() const;\n\n  // Similar to DebugString(), but additionally takes options (e.g.,\n  // include original user comments in output).\n  string DebugStringWithOptions(const DebugStringOptions& options) const;\n\n  // Returns true if this is a placeholder for an unknown type. This will\n  // only be the case if this descriptor comes from a DescriptorPool\n  // with AllowUnknownDependencies() set.\n  bool is_placeholder() const;\n\n  // Field stuff -----------------------------------------------------\n\n  // The number of fields in this message type.\n  int field_count() const;\n  // Gets a field by index, where 0 <= index < field_count().\n  // These are returned in the order they were defined in the .proto file.\n  const FieldDescriptor* field(int index) const;\n\n  // Looks up a field by declared tag number.  Returns NULL if no such field\n  // exists.\n  const FieldDescriptor* FindFieldByNumber(int number) const;\n  // Looks up a field by name.  Returns NULL if no such field exists.\n  const FieldDescriptor* FindFieldByName(const string& name) const;\n\n  // Looks up a field by lowercased name (as returned by lowercase_name()).\n  // This lookup may be ambiguous if multiple field names differ only by case,\n  // in which case the field returned is chosen arbitrarily from the matches.\n  const FieldDescriptor* FindFieldByLowercaseName(\n      const string& lowercase_name) const;\n\n  // Looks up a field by camel-case name (as returned by camelcase_name()).\n  // This lookup may be ambiguous if multiple field names differ in a way that\n  // leads them to have identical camel-case names, in which case the field\n  // returned is chosen arbitrarily from the matches.\n  const FieldDescriptor* FindFieldByCamelcaseName(\n      const string& camelcase_name) const;\n\n  // The number of oneofs in this message type.\n  int oneof_decl_count() const;\n  // Get a oneof by index, where 0 <= index < oneof_decl_count().\n  // These are returned in the order they were defined in the .proto file.\n  const OneofDescriptor* oneof_decl(int index) const;\n\n  // Looks up a oneof by name.  Returns NULL if no such oneof exists.\n  const OneofDescriptor* FindOneofByName(const string& name) const;\n\n  // Nested type stuff -----------------------------------------------\n\n  // The number of nested types in this message type.\n  int nested_type_count() const;\n  // Gets a nested type by index, where 0 <= index < nested_type_count().\n  // These are returned in the order they were defined in the .proto file.\n  const Descriptor* nested_type(int index) const;\n\n  // Looks up a nested type by name.  Returns NULL if no such nested type\n  // exists.\n  const Descriptor* FindNestedTypeByName(const string& name) const;\n\n  // Enum stuff ------------------------------------------------------\n\n  // The number of enum types in this message type.\n  int enum_type_count() const;\n  // Gets an enum type by index, where 0 <= index < enum_type_count().\n  // These are returned in the order they were defined in the .proto file.\n  const EnumDescriptor* enum_type(int index) const;\n\n  // Looks up an enum type by name.  Returns NULL if no such enum type exists.\n  const EnumDescriptor* FindEnumTypeByName(const string& name) const;\n\n  // Looks up an enum value by name, among all enum types in this message.\n  // Returns NULL if no such value exists.\n  const EnumValueDescriptor* FindEnumValueByName(const string& name) const;\n\n  // Extensions ------------------------------------------------------\n\n  // A range of field numbers which are designated for third-party\n  // extensions.\n  struct ExtensionRange {\n    typedef ExtensionRangeOptions OptionsType;\n\n    // See Descriptor::CopyTo().\n    void CopyTo(DescriptorProto_ExtensionRange* proto) const;\n\n    int start;  // inclusive\n    int end;    // exclusive\n\n    const ExtensionRangeOptions* options_;\n  };\n\n  // The number of extension ranges in this message type.\n  int extension_range_count() const;\n  // Gets an extension range by index, where 0 <= index <\n  // extension_range_count(). These are returned in the order they were defined\n  // in the .proto file.\n  const ExtensionRange* extension_range(int index) const;\n\n  // Returns true if the number is in one of the extension ranges.\n  bool IsExtensionNumber(int number) const;\n\n  // Returns NULL if no extension range contains the given number.\n  const ExtensionRange* FindExtensionRangeContainingNumber(int number) const;\n\n  // The number of extensions -- extending *other* messages -- that were\n  // defined nested within this message type's scope.\n  int extension_count() const;\n  // Get an extension by index, where 0 <= index < extension_count().\n  // These are returned in the order they were defined in the .proto file.\n  const FieldDescriptor* extension(int index) const;\n\n  // Looks up a named extension (which extends some *other* message type)\n  // defined within this message type's scope.\n  const FieldDescriptor* FindExtensionByName(const string& name) const;\n\n  // Similar to FindFieldByLowercaseName(), but finds extensions defined within\n  // this message type's scope.\n  const FieldDescriptor* FindExtensionByLowercaseName(const string& name) const;\n\n  // Similar to FindFieldByCamelcaseName(), but finds extensions defined within\n  // this message type's scope.\n  const FieldDescriptor* FindExtensionByCamelcaseName(const string& name) const;\n\n  // Reserved fields -------------------------------------------------\n\n  // A range of reserved field numbers.\n  struct ReservedRange {\n    int start;  // inclusive\n    int end;    // exclusive\n  };\n\n  // The number of reserved ranges in this message type.\n  int reserved_range_count() const;\n  // Gets an reserved range by index, where 0 <= index <\n  // reserved_range_count(). These are returned in the order they were defined\n  // in the .proto file.\n  const ReservedRange* reserved_range(int index) const;\n\n  // Returns true if the number is in one of the reserved ranges.\n  bool IsReservedNumber(int number) const;\n\n  // Returns NULL if no reserved range contains the given number.\n  const ReservedRange* FindReservedRangeContainingNumber(int number) const;\n\n  // The number of reserved field names in this message type.\n  int reserved_name_count() const;\n\n  // Gets a reserved name by index, where 0 <= index < reserved_name_count().\n  const string& reserved_name(int index) const;\n\n  // Returns true if the field name is reserved.\n  bool IsReservedName(const string& name) const;\n\n  // Source Location ---------------------------------------------------\n\n  // Updates |*out_location| to the source location of the complete\n  // extent of this message declaration.  Returns false and leaves\n  // |*out_location| unchanged iff location information was not available.\n  bool GetSourceLocation(SourceLocation* out_location) const;\n\n private:\n  typedef MessageOptions OptionsType;\n\n  // Allows tests to test CopyTo(proto, true).\n  friend class ::google::protobuf::descriptor_unittest::DescriptorTest;\n\n  // Allows access to GetLocationPath for annotations.\n  friend class ::google::protobuf::io::Printer;\n\n  // Fill the json_name field of FieldDescriptorProto.\n  void CopyJsonNameTo(DescriptorProto* proto) const;\n\n  // Internal version of DebugString; controls the level of indenting for\n  // correct depth. Takes |options| to control debug-string options, and\n  // |include_opening_clause| to indicate whether the \"message ... \" part of the\n  // clause has already been generated (this varies depending on context).\n  void DebugString(int depth, string *contents,\n                   const DebugStringOptions& options,\n                   bool include_opening_clause) const;\n\n  // Walks up the descriptor tree to generate the source location path\n  // to this descriptor from the file root.\n  void GetLocationPath(std::vector<int>* output) const;\n\n  const string* name_;\n  const string* full_name_;\n  const FileDescriptor* file_;\n  const Descriptor* containing_type_;\n  const MessageOptions* options_;\n\n  // These arrays are separated from their sizes to minimize padding on 64-bit.\n  FieldDescriptor* fields_;\n  OneofDescriptor* oneof_decls_;\n  Descriptor* nested_types_;\n  EnumDescriptor* enum_types_;\n  ExtensionRange* extension_ranges_;\n  FieldDescriptor* extensions_;\n  ReservedRange* reserved_ranges_;\n  const string** reserved_names_;\n\n  int field_count_;\n  int oneof_decl_count_;\n  int nested_type_count_;\n  int enum_type_count_;\n  int extension_range_count_;\n  int extension_count_;\n  int reserved_range_count_;\n  int reserved_name_count_;\n\n  // True if this is a placeholder for an unknown type.\n  bool is_placeholder_;\n  // True if this is a placeholder and the type name wasn't fully-qualified.\n  bool is_unqualified_placeholder_;\n\n  // IMPORTANT:  If you add a new field, make sure to search for all instances\n  // of Allocate<Descriptor>() and AllocateArray<Descriptor>() in descriptor.cc\n  // and update them to initialize the field.\n\n  // Must be constructed using DescriptorPool.\n  Descriptor() {}\n  friend class DescriptorBuilder;\n  friend class DescriptorPool;\n  friend class EnumDescriptor;\n  friend class FieldDescriptor;\n  friend class OneofDescriptor;\n  friend class MethodDescriptor;\n  friend class FileDescriptor;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Descriptor);\n};\n\n\n// Describes a single field of a message.  To get the descriptor for a given\n// field, first get the Descriptor for the message in which it is defined,\n// then call Descriptor::FindFieldByName().  To get a FieldDescriptor for\n// an extension, do one of the following:\n// - Get the Descriptor or FileDescriptor for its containing scope, then\n//   call Descriptor::FindExtensionByName() or\n//   FileDescriptor::FindExtensionByName().\n// - Given a DescriptorPool, call DescriptorPool::FindExtensionByNumber().\n// - Given a Reflection for a message object, call\n//   Reflection::FindKnownExtensionByName() or\n//   Reflection::FindKnownExtensionByNumber().\n// Use DescriptorPool to construct your own descriptors.\nclass LIBPROTOBUF_EXPORT FieldDescriptor {\n public:\n  // Identifies a field type.  0 is reserved for errors.  The order is weird\n  // for historical reasons.  Types 12 and up are new in proto2.\n  enum Type {\n    TYPE_DOUBLE         = 1,   // double, exactly eight bytes on the wire.\n    TYPE_FLOAT          = 2,   // float, exactly four bytes on the wire.\n    TYPE_INT64          = 3,   // int64, varint on the wire.  Negative numbers\n                               // take 10 bytes.  Use TYPE_SINT64 if negative\n                               // values are likely.\n    TYPE_UINT64         = 4,   // uint64, varint on the wire.\n    TYPE_INT32          = 5,   // int32, varint on the wire.  Negative numbers\n                               // take 10 bytes.  Use TYPE_SINT32 if negative\n                               // values are likely.\n    TYPE_FIXED64        = 6,   // uint64, exactly eight bytes on the wire.\n    TYPE_FIXED32        = 7,   // uint32, exactly four bytes on the wire.\n    TYPE_BOOL           = 8,   // bool, varint on the wire.\n    TYPE_STRING         = 9,   // UTF-8 text.\n    TYPE_GROUP          = 10,  // Tag-delimited message.  Deprecated.\n    TYPE_MESSAGE        = 11,  // Length-delimited message.\n\n    TYPE_BYTES          = 12,  // Arbitrary byte array.\n    TYPE_UINT32         = 13,  // uint32, varint on the wire\n    TYPE_ENUM           = 14,  // Enum, varint on the wire\n    TYPE_SFIXED32       = 15,  // int32, exactly four bytes on the wire\n    TYPE_SFIXED64       = 16,  // int64, exactly eight bytes on the wire\n    TYPE_SINT32         = 17,  // int32, ZigZag-encoded varint on the wire\n    TYPE_SINT64         = 18,  // int64, ZigZag-encoded varint on the wire\n\n    MAX_TYPE            = 18,  // Constant useful for defining lookup tables\n                               // indexed by Type.\n  };\n\n  // Specifies the C++ data type used to represent the field.  There is a\n  // fixed mapping from Type to CppType where each Type maps to exactly one\n  // CppType.  0 is reserved for errors.\n  enum CppType {\n    CPPTYPE_INT32       = 1,     // TYPE_INT32, TYPE_SINT32, TYPE_SFIXED32\n    CPPTYPE_INT64       = 2,     // TYPE_INT64, TYPE_SINT64, TYPE_SFIXED64\n    CPPTYPE_UINT32      = 3,     // TYPE_UINT32, TYPE_FIXED32\n    CPPTYPE_UINT64      = 4,     // TYPE_UINT64, TYPE_FIXED64\n    CPPTYPE_DOUBLE      = 5,     // TYPE_DOUBLE\n    CPPTYPE_FLOAT       = 6,     // TYPE_FLOAT\n    CPPTYPE_BOOL        = 7,     // TYPE_BOOL\n    CPPTYPE_ENUM        = 8,     // TYPE_ENUM\n    CPPTYPE_STRING      = 9,     // TYPE_STRING, TYPE_BYTES\n    CPPTYPE_MESSAGE     = 10,    // TYPE_MESSAGE, TYPE_GROUP\n\n    MAX_CPPTYPE         = 10,    // Constant useful for defining lookup tables\n                                 // indexed by CppType.\n  };\n\n  // Identifies whether the field is optional, required, or repeated.  0 is\n  // reserved for errors.\n  enum Label {\n    LABEL_OPTIONAL      = 1,    // optional\n    LABEL_REQUIRED      = 2,    // required\n    LABEL_REPEATED      = 3,    // repeated\n\n    MAX_LABEL           = 3,    // Constant useful for defining lookup tables\n                                // indexed by Label.\n  };\n\n  // Valid field numbers are positive integers up to kMaxNumber.\n  static const int kMaxNumber = (1 << 29) - 1;\n\n  // First field number reserved for the protocol buffer library implementation.\n  // Users may not declare fields that use reserved numbers.\n  static const int kFirstReservedNumber = 19000;\n  // Last field number reserved for the protocol buffer library implementation.\n  // Users may not declare fields that use reserved numbers.\n  static const int kLastReservedNumber  = 19999;\n\n  const string& name() const;        // Name of this field within the message.\n  const string& full_name() const;   // Fully-qualified name of the field.\n  const string& json_name() const;   // JSON name of this field.\n  const FileDescriptor* file() const;// File in which this field was defined.\n  bool is_extension() const;         // Is this an extension field?\n  int number() const;                // Declared tag number.\n\n  // Same as name() except converted to lower-case.  This (and especially the\n  // FindFieldByLowercaseName() method) can be useful when parsing formats\n  // which prefer to use lowercase naming style.  (Although, technically\n  // field names should be lowercased anyway according to the protobuf style\n  // guide, so this only makes a difference when dealing with old .proto files\n  // which do not follow the guide.)\n  const string& lowercase_name() const;\n\n  // Same as name() except converted to camel-case.  In this conversion, any\n  // time an underscore appears in the name, it is removed and the next\n  // letter is capitalized.  Furthermore, the first letter of the name is\n  // lower-cased.  Examples:\n  //   FooBar -> fooBar\n  //   foo_bar -> fooBar\n  //   fooBar -> fooBar\n  // This (and especially the FindFieldByCamelcaseName() method) can be useful\n  // when parsing formats which prefer to use camel-case naming style.\n  const string& camelcase_name() const;\n\n  Type type() const;                  // Declared type of this field.\n  const char* type_name() const;      // Name of the declared type.\n  CppType cpp_type() const;           // C++ type of this field.\n  const char* cpp_type_name() const;  // Name of the C++ type.\n  Label label() const;                // optional/required/repeated\n\n  bool is_required() const;      // shorthand for label() == LABEL_REQUIRED\n  bool is_optional() const;      // shorthand for label() == LABEL_OPTIONAL\n  bool is_repeated() const;      // shorthand for label() == LABEL_REPEATED\n  bool is_packable() const;      // shorthand for is_repeated() &&\n                                 //               IsTypePackable(type())\n  bool is_packed() const;        // shorthand for is_packable() &&\n                                 //               options().packed()\n  bool is_map() const;           // shorthand for type() == TYPE_MESSAGE &&\n                                 // message_type()->options().map_entry()\n\n  // Index of this field within the message's field array, or the file or\n  // extension scope's extensions array.\n  int index() const;\n\n  // Does this field have an explicitly-declared default value?\n  bool has_default_value() const;\n\n  // Whether the user has specified the json_name field option in the .proto\n  // file.\n  bool has_json_name() const;\n\n  // Get the field default value if cpp_type() == CPPTYPE_INT32.  If no\n  // explicit default was defined, the default is 0.\n  int32 default_value_int32() const;\n  // Get the field default value if cpp_type() == CPPTYPE_INT64.  If no\n  // explicit default was defined, the default is 0.\n  int64 default_value_int64() const;\n  // Get the field default value if cpp_type() == CPPTYPE_UINT32.  If no\n  // explicit default was defined, the default is 0.\n  uint32 default_value_uint32() const;\n  // Get the field default value if cpp_type() == CPPTYPE_UINT64.  If no\n  // explicit default was defined, the default is 0.\n  uint64 default_value_uint64() const;\n  // Get the field default value if cpp_type() == CPPTYPE_FLOAT.  If no\n  // explicit default was defined, the default is 0.0.\n  float default_value_float() const;\n  // Get the field default value if cpp_type() == CPPTYPE_DOUBLE.  If no\n  // explicit default was defined, the default is 0.0.\n  double default_value_double() const;\n  // Get the field default value if cpp_type() == CPPTYPE_BOOL.  If no\n  // explicit default was defined, the default is false.\n  bool default_value_bool() const;\n  // Get the field default value if cpp_type() == CPPTYPE_ENUM.  If no\n  // explicit default was defined, the default is the first value defined\n  // in the enum type (all enum types are required to have at least one value).\n  // This never returns NULL.\n  const EnumValueDescriptor* default_value_enum() const;\n  // Get the field default value if cpp_type() == CPPTYPE_STRING.  If no\n  // explicit default was defined, the default is the empty string.\n  const string& default_value_string() const;\n\n  // The Descriptor for the message of which this is a field.  For extensions,\n  // this is the extended type.  Never NULL.\n  const Descriptor* containing_type() const;\n\n  // If the field is a member of a oneof, this is the one, otherwise this is\n  // NULL.\n  const OneofDescriptor* containing_oneof() const;\n\n  // If the field is a member of a oneof, returns the index in that oneof.\n  int index_in_oneof() const;\n\n  // An extension may be declared within the scope of another message.  If this\n  // field is an extension (is_extension() is true), then extension_scope()\n  // returns that message, or NULL if the extension was declared at global\n  // scope.  If this is not an extension, extension_scope() is undefined (may\n  // assert-fail).\n  const Descriptor* extension_scope() const;\n\n  // If type is TYPE_MESSAGE or TYPE_GROUP, returns a descriptor for the\n  // message or the group type.  Otherwise, returns null.\n  const Descriptor* message_type() const;\n  // If type is TYPE_ENUM, returns a descriptor for the enum.  Otherwise,\n  // returns null.\n  const EnumDescriptor* enum_type() const;\n\n  // Get the FieldOptions for this field.  This includes things listed in\n  // square brackets after the field definition.  E.g., the field:\n  //   optional string text = 1 [ctype=CORD];\n  // has the \"ctype\" option set.  Allowed options are defined by FieldOptions\n  // in google/protobuf/descriptor.proto, and any available extensions of that\n  // message.\n  const FieldOptions& options() const;\n\n  // See Descriptor::CopyTo().\n  void CopyTo(FieldDescriptorProto* proto) const;\n\n  // See Descriptor::DebugString().\n  string DebugString() const;\n\n  // See Descriptor::DebugStringWithOptions().\n  string DebugStringWithOptions(const DebugStringOptions& options) const;\n\n  // Helper method to get the CppType for a particular Type.\n  static CppType TypeToCppType(Type type);\n\n  // Helper method to get the name of a Type.\n  static const char* TypeName(Type type);\n\n  // Helper method to get the name of a CppType.\n  static const char* CppTypeName(CppType cpp_type);\n\n  // Return true iff [packed = true] is valid for fields of this type.\n  static inline bool IsTypePackable(Type field_type);\n\n  // Source Location ---------------------------------------------------\n\n  // Updates |*out_location| to the source location of the complete\n  // extent of this field declaration.  Returns false and leaves\n  // |*out_location| unchanged iff location information was not available.\n  bool GetSourceLocation(SourceLocation* out_location) const;\n\n private:\n  typedef FieldOptions OptionsType;\n\n  // Allows access to GetLocationPath for annotations.\n  friend class ::google::protobuf::io::Printer;\n\n  // Fill the json_name field of FieldDescriptorProto.\n  void CopyJsonNameTo(FieldDescriptorProto* proto) const;\n\n  // See Descriptor::DebugString().\n  enum PrintLabelFlag { PRINT_LABEL, OMIT_LABEL };\n  void DebugString(int depth, PrintLabelFlag print_label_flag,\n                   string* contents, const DebugStringOptions& options) const;\n\n  // formats the default value appropriately and returns it as a string.\n  // Must have a default value to call this. If quote_string_type is true, then\n  // types of CPPTYPE_STRING whill be surrounded by quotes and CEscaped.\n  string DefaultValueAsString(bool quote_string_type) const;\n\n  // Helper function that returns the field type name for DebugString.\n  string FieldTypeNameDebugString() const;\n\n  // Walks up the descriptor tree to generate the source location path\n  // to this descriptor from the file root.\n  void GetLocationPath(std::vector<int>* output) const;\n\n  // Returns true if this is a map message type.\n  bool is_map_message_type() const;\n\n  const string* name_;\n  const string* full_name_;\n  const string* lowercase_name_;\n  const string* camelcase_name_;\n  // If has_json_name_ is true, it's the value specified by the user.\n  // Otherwise, it has the same value as camelcase_name_.\n  const string* json_name_;\n  const FileDescriptor* file_;\n  GoogleOnceDynamic* type_once_;\n  static void TypeOnceInit(const FieldDescriptor* to_init);\n  void InternalTypeOnceInit() const;\n  mutable Type type_;\n  Label label_;\n  bool has_default_value_;\n  // Whether the user has specified the json_name field option in the .proto\n  // file.\n  bool has_json_name_;\n  bool is_extension_;\n  int number_;\n  int index_in_oneof_;\n  const Descriptor* containing_type_;\n  const OneofDescriptor* containing_oneof_;\n  const Descriptor* extension_scope_;\n  mutable const Descriptor* message_type_;\n  mutable const EnumDescriptor* enum_type_;\n  const FieldOptions* options_;\n  const string* type_name_;\n  const string* default_value_enum_name_;\n  // IMPORTANT:  If you add a new field, make sure to search for all instances\n  // of Allocate<FieldDescriptor>() and AllocateArray<FieldDescriptor>() in\n  // descriptor.cc and update them to initialize the field.\n\n  union {\n    int32  default_value_int32_;\n    int64  default_value_int64_;\n    uint32 default_value_uint32_;\n    uint64 default_value_uint64_;\n    float  default_value_float_;\n    double default_value_double_;\n    bool   default_value_bool_;\n\n    mutable const EnumValueDescriptor* default_value_enum_;\n    const string* default_value_string_;\n  };\n\n  static const CppType kTypeToCppTypeMap[MAX_TYPE + 1];\n\n  static const char * const kTypeToName[MAX_TYPE + 1];\n\n  static const char * const kCppTypeToName[MAX_CPPTYPE + 1];\n\n  static const char * const kLabelToName[MAX_LABEL + 1];\n\n  // Must be constructed using DescriptorPool.\n  FieldDescriptor() {}\n  friend class DescriptorBuilder;\n  friend class FileDescriptor;\n  friend class Descriptor;\n  friend class OneofDescriptor;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldDescriptor);\n};\n\n\n// Describes a oneof defined in a message type.\nclass LIBPROTOBUF_EXPORT OneofDescriptor {\n public:\n  const string& name() const;       // Name of this oneof.\n  const string& full_name() const;  // Fully-qualified name of the oneof.\n\n  // Index of this oneof within the message's oneof array.\n  int index() const;\n\n  // The .proto file in which this oneof was defined.  Never NULL.\n  const FileDescriptor* file() const;\n  // The Descriptor for the message containing this oneof.\n  const Descriptor* containing_type() const;\n\n  // The number of (non-extension) fields which are members of this oneof.\n  int field_count() const;\n  // Get a member of this oneof, in the order in which they were declared in the\n  // .proto file.  Does not include extensions.\n  const FieldDescriptor* field(int index) const;\n\n  const OneofOptions& options() const;\n\n  // See Descriptor::CopyTo().\n  void CopyTo(OneofDescriptorProto* proto) const;\n\n  // See Descriptor::DebugString().\n  string DebugString() const;\n\n  // See Descriptor::DebugStringWithOptions().\n  string DebugStringWithOptions(const DebugStringOptions& options) const;\n\n  // Source Location ---------------------------------------------------\n\n  // Updates |*out_location| to the source location of the complete\n  // extent of this oneof declaration.  Returns false and leaves\n  // |*out_location| unchanged iff location information was not available.\n  bool GetSourceLocation(SourceLocation* out_location) const;\n\n private:\n  typedef OneofOptions OptionsType;\n\n  // Allows access to GetLocationPath for annotations.\n  friend class ::google::protobuf::io::Printer;\n\n  // See Descriptor::DebugString().\n  void DebugString(int depth, string* contents,\n                   const DebugStringOptions& options) const;\n\n  // Walks up the descriptor tree to generate the source location path\n  // to this descriptor from the file root.\n  void GetLocationPath(std::vector<int>* output) const;\n\n  const string* name_;\n  const string* full_name_;\n  const Descriptor* containing_type_;\n  bool is_extendable_;\n  int field_count_;\n  const FieldDescriptor** fields_;\n  const OneofOptions* options_;\n\n  // IMPORTANT:  If you add a new field, make sure to search for all instances\n  // of Allocate<OneofDescriptor>() and AllocateArray<OneofDescriptor>()\n  // in descriptor.cc and update them to initialize the field.\n\n  // Must be constructed using DescriptorPool.\n  OneofDescriptor() {}\n  friend class DescriptorBuilder;\n  friend class Descriptor;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(OneofDescriptor);\n};\n\n// Describes an enum type defined in a .proto file.  To get the EnumDescriptor\n// for a generated enum type, call TypeName_descriptor().  Use DescriptorPool\n// to construct your own descriptors.\nclass LIBPROTOBUF_EXPORT EnumDescriptor {\n public:\n  // The name of this enum type in the containing scope.\n  const string& name() const;\n\n  // The fully-qualified name of the enum type, scope delimited by periods.\n  const string& full_name() const;\n\n  // Index of this enum within the file or containing message's enum array.\n  int index() const;\n\n  // The .proto file in which this enum type was defined.  Never NULL.\n  const FileDescriptor* file() const;\n\n  // The number of values for this EnumDescriptor.  Guaranteed to be greater\n  // than zero.\n  int value_count() const;\n  // Gets a value by index, where 0 <= index < value_count().\n  // These are returned in the order they were defined in the .proto file.\n  const EnumValueDescriptor* value(int index) const;\n\n  // Looks up a value by name.  Returns NULL if no such value exists.\n  const EnumValueDescriptor* FindValueByName(const string& name) const;\n  // Looks up a value by number.  Returns NULL if no such value exists.  If\n  // multiple values have this number, the first one defined is returned.\n  const EnumValueDescriptor* FindValueByNumber(int number) const;\n\n  // If this enum type is nested in a message type, this is that message type.\n  // Otherwise, NULL.\n  const Descriptor* containing_type() const;\n\n  // Get options for this enum type.  These are specified in the .proto file by\n  // placing lines like \"option foo = 1234;\" in the enum definition.  Allowed\n  // options are defined by EnumOptions in google/protobuf/descriptor.proto,\n  // and any available extensions of that message.\n  const EnumOptions& options() const;\n\n  // See Descriptor::CopyTo().\n  void CopyTo(EnumDescriptorProto* proto) const;\n\n  // See Descriptor::DebugString().\n  string DebugString() const;\n\n  // See Descriptor::DebugStringWithOptions().\n  string DebugStringWithOptions(const DebugStringOptions& options) const;\n\n  // Returns true if this is a placeholder for an unknown enum. This will\n  // only be the case if this descriptor comes from a DescriptorPool\n  // with AllowUnknownDependencies() set.\n  bool is_placeholder() const;\n\n  // Reserved fields -------------------------------------------------\n\n  // A range of reserved field numbers.\n  struct ReservedRange {\n    int start;  // inclusive\n    int end;    // inclusive\n  };\n\n  // The number of reserved ranges in this message type.\n  int reserved_range_count() const;\n  // Gets an reserved range by index, where 0 <= index <\n  // reserved_range_count(). These are returned in the order they were defined\n  // in the .proto file.\n  const EnumDescriptor::ReservedRange* reserved_range(int index) const;\n\n  // Returns true if the number is in one of the reserved ranges.\n  bool IsReservedNumber(int number) const;\n\n  // Returns NULL if no reserved range contains the given number.\n  const EnumDescriptor::ReservedRange*\n      FindReservedRangeContainingNumber(int number) const;\n\n  // The number of reserved field names in this message type.\n  int reserved_name_count() const;\n\n  // Gets a reserved name by index, where 0 <= index < reserved_name_count().\n  const string& reserved_name(int index) const;\n\n  // Returns true if the field name is reserved.\n  bool IsReservedName(const string& name) const;\n\n  // Source Location ---------------------------------------------------\n\n  // Updates |*out_location| to the source location of the complete\n  // extent of this enum declaration.  Returns false and leaves\n  // |*out_location| unchanged iff location information was not available.\n  bool GetSourceLocation(SourceLocation* out_location) const;\n\n private:\n  typedef EnumOptions OptionsType;\n\n  // Allows access to GetLocationPath for annotations.\n  friend class ::google::protobuf::io::Printer;\n\n  // Looks up a value by number.  If the value does not exist, dynamically\n  // creates a new EnumValueDescriptor for that value, assuming that it was\n  // unknown. If a new descriptor is created, this is done in a thread-safe way,\n  // and future calls will return the same value descriptor pointer.\n  //\n  // This is private but is used by GeneratedMessageReflection (which is\n  // friended below) to return a valid EnumValueDescriptor from GetEnum() when\n  // this feature is enabled.\n  const EnumValueDescriptor*\n      FindValueByNumberCreatingIfUnknown(int number) const;\n\n\n  // See Descriptor::DebugString().\n  void DebugString(int depth, string *contents,\n                   const DebugStringOptions& options) const;\n\n  // Walks up the descriptor tree to generate the source location path\n  // to this descriptor from the file root.\n  void GetLocationPath(std::vector<int>* output) const;\n\n  const string* name_;\n  const string* full_name_;\n  const FileDescriptor* file_;\n  const Descriptor* containing_type_;\n  const EnumOptions* options_;\n\n  // True if this is a placeholder for an unknown type.\n  bool is_placeholder_;\n  // True if this is a placeholder and the type name wasn't fully-qualified.\n  bool is_unqualified_placeholder_;\n\n  int value_count_;\n  EnumValueDescriptor* values_;\n\n  int reserved_range_count_;\n  int reserved_name_count_;\n  EnumDescriptor::ReservedRange* reserved_ranges_;\n  const string** reserved_names_;\n\n  // IMPORTANT:  If you add a new field, make sure to search for all instances\n  // of Allocate<EnumDescriptor>() and AllocateArray<EnumDescriptor>() in\n  // descriptor.cc and update them to initialize the field.\n\n  // Must be constructed using DescriptorPool.\n  EnumDescriptor() {}\n  friend class DescriptorBuilder;\n  friend class Descriptor;\n  friend class FieldDescriptor;\n  friend class EnumValueDescriptor;\n  friend class FileDescriptor;\n  friend class DescriptorPool;\n  friend class internal::GeneratedMessageReflection;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumDescriptor);\n};\n\n// Describes an individual enum constant of a particular type.  To get the\n// EnumValueDescriptor for a given enum value, first get the EnumDescriptor\n// for its type, then use EnumDescriptor::FindValueByName() or\n// EnumDescriptor::FindValueByNumber().  Use DescriptorPool to construct\n// your own descriptors.\nclass LIBPROTOBUF_EXPORT EnumValueDescriptor {\n public:\n  const string& name() const;  // Name of this enum constant.\n  int index() const;           // Index within the enums's Descriptor.\n  int number() const;          // Numeric value of this enum constant.\n\n  // The full_name of an enum value is a sibling symbol of the enum type.\n  // e.g. the full name of FieldDescriptorProto::TYPE_INT32 is actually\n  // \"google.protobuf.FieldDescriptorProto.TYPE_INT32\", NOT\n  // \"google.protobuf.FieldDescriptorProto.Type.TYPE_INT32\".  This is to conform\n  // with C++ scoping rules for enums.\n  const string& full_name() const;\n\n  // The .proto file in which this value was defined.  Never NULL.\n  const FileDescriptor* file() const;\n  // The type of this value.  Never NULL.\n  const EnumDescriptor* type() const;\n\n  // Get options for this enum value.  These are specified in the .proto file\n  // by adding text like \"[foo = 1234]\" after an enum value definition.\n  // Allowed options are defined by EnumValueOptions in\n  // google/protobuf/descriptor.proto, and any available extensions of that\n  // message.\n  const EnumValueOptions& options() const;\n\n  // See Descriptor::CopyTo().\n  void CopyTo(EnumValueDescriptorProto* proto) const;\n\n  // See Descriptor::DebugString().\n  string DebugString() const;\n\n  // See Descriptor::DebugStringWithOptions().\n  string DebugStringWithOptions(const DebugStringOptions& options) const;\n\n\n  // Source Location ---------------------------------------------------\n\n  // Updates |*out_location| to the source location of the complete\n  // extent of this enum value declaration.  Returns false and leaves\n  // |*out_location| unchanged iff location information was not available.\n  bool GetSourceLocation(SourceLocation* out_location) const;\n\n private:\n  typedef EnumValueOptions OptionsType;\n\n  // Allows access to GetLocationPath for annotations.\n  friend class ::google::protobuf::io::Printer;\n\n  // See Descriptor::DebugString().\n  void DebugString(int depth, string *contents,\n                   const DebugStringOptions& options) const;\n\n  // Walks up the descriptor tree to generate the source location path\n  // to this descriptor from the file root.\n  void GetLocationPath(std::vector<int>* output) const;\n\n  const string* name_;\n  const string* full_name_;\n  int number_;\n  const EnumDescriptor* type_;\n  const EnumValueOptions* options_;\n  // IMPORTANT:  If you add a new field, make sure to search for all instances\n  // of Allocate<EnumValueDescriptor>() and AllocateArray<EnumValueDescriptor>()\n  // in descriptor.cc and update them to initialize the field.\n\n  // Must be constructed using DescriptorPool.\n  EnumValueDescriptor() {}\n  friend class DescriptorBuilder;\n  friend class EnumDescriptor;\n  friend class DescriptorPool;\n  friend class FileDescriptorTables;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumValueDescriptor);\n};\n\n// Describes an RPC service.  To get the ServiceDescriptor for a service,\n// call Service::GetDescriptor().  Generated service classes also have a\n// static method called descriptor() which returns the type's\n// ServiceDescriptor.  Use DescriptorPool to construct your own descriptors.\nclass LIBPROTOBUF_EXPORT ServiceDescriptor {\n public:\n  // The name of the service, not including its containing scope.\n  const string& name() const;\n  // The fully-qualified name of the service, scope delimited by periods.\n  const string& full_name() const;\n  // Index of this service within the file's services array.\n  int index() const;\n\n  // The .proto file in which this service was defined.  Never NULL.\n  const FileDescriptor* file() const;\n\n  // Get options for this service type.  These are specified in the .proto file\n  // by placing lines like \"option foo = 1234;\" in the service definition.\n  // Allowed options are defined by ServiceOptions in\n  // google/protobuf/descriptor.proto, and any available extensions of that\n  // message.\n  const ServiceOptions& options() const;\n\n  // The number of methods this service defines.\n  int method_count() const;\n  // Gets a MethodDescriptor by index, where 0 <= index < method_count().\n  // These are returned in the order they were defined in the .proto file.\n  const MethodDescriptor* method(int index) const;\n\n  // Look up a MethodDescriptor by name.\n  const MethodDescriptor* FindMethodByName(const string& name) const;\n  // See Descriptor::CopyTo().\n  void CopyTo(ServiceDescriptorProto* proto) const;\n\n  // See Descriptor::DebugString().\n  string DebugString() const;\n\n  // See Descriptor::DebugStringWithOptions().\n  string DebugStringWithOptions(const DebugStringOptions& options) const;\n\n\n  // Source Location ---------------------------------------------------\n\n  // Updates |*out_location| to the source location of the complete\n  // extent of this service declaration.  Returns false and leaves\n  // |*out_location| unchanged iff location information was not available.\n  bool GetSourceLocation(SourceLocation* out_location) const;\n\n private:\n  typedef ServiceOptions OptionsType;\n\n  // Allows access to GetLocationPath for annotations.\n  friend class ::google::protobuf::io::Printer;\n\n  // See Descriptor::DebugString().\n  void DebugString(string *contents, const DebugStringOptions& options) const;\n\n  // Walks up the descriptor tree to generate the source location path\n  // to this descriptor from the file root.\n  void GetLocationPath(std::vector<int>* output) const;\n\n  const string* name_;\n  const string* full_name_;\n  const FileDescriptor* file_;\n  const ServiceOptions* options_;\n  MethodDescriptor* methods_;\n  int method_count_;\n  // IMPORTANT:  If you add a new field, make sure to search for all instances\n  // of Allocate<ServiceDescriptor>() and AllocateArray<ServiceDescriptor>() in\n  // descriptor.cc and update them to initialize the field.\n\n  // Must be constructed using DescriptorPool.\n  ServiceDescriptor() {}\n  friend class DescriptorBuilder;\n  friend class FileDescriptor;\n  friend class MethodDescriptor;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceDescriptor);\n};\n\n\n// Describes an individual service method.  To obtain a MethodDescriptor given\n// a service, first get its ServiceDescriptor, then call\n// ServiceDescriptor::FindMethodByName().  Use DescriptorPool to construct your\n// own descriptors.\nclass LIBPROTOBUF_EXPORT MethodDescriptor {\n public:\n  // Name of this method, not including containing scope.\n  const string& name() const;\n  // The fully-qualified name of the method, scope delimited by periods.\n  const string& full_name() const;\n  // Index within the service's Descriptor.\n  int index() const;\n\n  // The .proto file in which this method was defined.  Never NULL.\n  const FileDescriptor* file() const;\n  // Gets the service to which this method belongs.  Never NULL.\n  const ServiceDescriptor* service() const;\n\n  // Gets the type of protocol message which this method accepts as input.\n  const Descriptor* input_type() const;\n  // Gets the type of protocol message which this message produces as output.\n  const Descriptor* output_type() const;\n\n  // Gets whether the client streams multiple requests.\n  bool client_streaming() const;\n  // Gets whether the server streams multiple responses.\n  bool server_streaming() const;\n\n  // Get options for this method.  These are specified in the .proto file by\n  // placing lines like \"option foo = 1234;\" in curly-braces after a method\n  // declaration.  Allowed options are defined by MethodOptions in\n  // google/protobuf/descriptor.proto, and any available extensions of that\n  // message.\n  const MethodOptions& options() const;\n\n  // See Descriptor::CopyTo().\n  void CopyTo(MethodDescriptorProto* proto) const;\n\n  // See Descriptor::DebugString().\n  string DebugString() const;\n\n  // See Descriptor::DebugStringWithOptions().\n  string DebugStringWithOptions(const DebugStringOptions& options) const;\n\n\n  // Source Location ---------------------------------------------------\n\n  // Updates |*out_location| to the source location of the complete\n  // extent of this method declaration.  Returns false and leaves\n  // |*out_location| unchanged iff location information was not available.\n  bool GetSourceLocation(SourceLocation* out_location) const;\n\n private:\n  typedef MethodOptions OptionsType;\n\n  // Allows access to GetLocationPath for annotations.\n  friend class ::google::protobuf::io::Printer;\n\n  // See Descriptor::DebugString().\n  void DebugString(int depth, string *contents,\n                   const DebugStringOptions& options) const;\n\n  // Walks up the descriptor tree to generate the source location path\n  // to this descriptor from the file root.\n  void GetLocationPath(std::vector<int>* output) const;\n\n  const string* name_;\n  const string* full_name_;\n  const ServiceDescriptor* service_;\n  mutable internal::LazyDescriptor input_type_;\n  mutable internal::LazyDescriptor output_type_;\n  const MethodOptions* options_;\n  bool client_streaming_;\n  bool server_streaming_;\n  // IMPORTANT:  If you add a new field, make sure to search for all instances\n  // of Allocate<MethodDescriptor>() and AllocateArray<MethodDescriptor>() in\n  // descriptor.cc and update them to initialize the field.\n\n  // Must be constructed using DescriptorPool.\n  MethodDescriptor() {}\n  friend class DescriptorBuilder;\n  friend class ServiceDescriptor;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MethodDescriptor);\n};\n\n\n// Describes a whole .proto file.  To get the FileDescriptor for a compiled-in\n// file, get the descriptor for something defined in that file and call\n// descriptor->file().  Use DescriptorPool to construct your own descriptors.\nclass LIBPROTOBUF_EXPORT FileDescriptor {\n public:\n  // The filename, relative to the source tree.\n  // e.g. \"google/protobuf/descriptor.proto\"\n  const string& name() const;\n\n  // The package, e.g. \"google.protobuf.compiler\".\n  const string& package() const;\n\n  // The DescriptorPool in which this FileDescriptor and all its contents were\n  // allocated.  Never NULL.\n  const DescriptorPool* pool() const;\n\n  // The number of files imported by this one.\n  int dependency_count() const;\n  // Gets an imported file by index, where 0 <= index < dependency_count().\n  // These are returned in the order they were defined in the .proto file.\n  const FileDescriptor* dependency(int index) const;\n\n  // The number of files public imported by this one.\n  // The public dependency list is a subset of the dependency list.\n  int public_dependency_count() const;\n  // Gets a public imported file by index, where 0 <= index <\n  // public_dependency_count().\n  // These are returned in the order they were defined in the .proto file.\n  const FileDescriptor* public_dependency(int index) const;\n\n  // The number of files that are imported for weak fields.\n  // The weak dependency list is a subset of the dependency list.\n  int weak_dependency_count() const;\n  // Gets a weak imported file by index, where 0 <= index <\n  // weak_dependency_count().\n  // These are returned in the order they were defined in the .proto file.\n  const FileDescriptor* weak_dependency(int index) const;\n\n  // Number of top-level message types defined in this file.  (This does not\n  // include nested types.)\n  int message_type_count() const;\n  // Gets a top-level message type, where 0 <= index < message_type_count().\n  // These are returned in the order they were defined in the .proto file.\n  const Descriptor* message_type(int index) const;\n\n  // Number of top-level enum types defined in this file.  (This does not\n  // include nested types.)\n  int enum_type_count() const;\n  // Gets a top-level enum type, where 0 <= index < enum_type_count().\n  // These are returned in the order they were defined in the .proto file.\n  const EnumDescriptor* enum_type(int index) const;\n\n  // Number of services defined in this file.\n  int service_count() const;\n  // Gets a service, where 0 <= index < service_count().\n  // These are returned in the order they were defined in the .proto file.\n  const ServiceDescriptor* service(int index) const;\n\n  // Number of extensions defined at file scope.  (This does not include\n  // extensions nested within message types.)\n  int extension_count() const;\n  // Gets an extension's descriptor, where 0 <= index < extension_count().\n  // These are returned in the order they were defined in the .proto file.\n  const FieldDescriptor* extension(int index) const;\n\n  // Get options for this file.  These are specified in the .proto file by\n  // placing lines like \"option foo = 1234;\" at the top level, outside of any\n  // other definitions.  Allowed options are defined by FileOptions in\n  // google/protobuf/descriptor.proto, and any available extensions of that\n  // message.\n  const FileOptions& options() const;\n\n  // Syntax of this file.\n  enum Syntax {\n    SYNTAX_UNKNOWN = 0,\n    SYNTAX_PROTO2  = 2,\n    SYNTAX_PROTO3  = 3,\n  };\n  Syntax syntax() const;\n  static const char* SyntaxName(Syntax syntax);\n\n  // Find a top-level message type by name.  Returns NULL if not found.\n  const Descriptor* FindMessageTypeByName(const string& name) const;\n  // Find a top-level enum type by name.  Returns NULL if not found.\n  const EnumDescriptor* FindEnumTypeByName(const string& name) const;\n  // Find an enum value defined in any top-level enum by name.  Returns NULL if\n  // not found.\n  const EnumValueDescriptor* FindEnumValueByName(const string& name) const;\n  // Find a service definition by name.  Returns NULL if not found.\n  const ServiceDescriptor* FindServiceByName(const string& name) const;\n  // Find a top-level extension definition by name.  Returns NULL if not found.\n  const FieldDescriptor* FindExtensionByName(const string& name) const;\n  // Similar to FindExtensionByName(), but searches by lowercased-name.  See\n  // Descriptor::FindFieldByLowercaseName().\n  const FieldDescriptor* FindExtensionByLowercaseName(const string& name) const;\n  // Similar to FindExtensionByName(), but searches by camelcased-name.  See\n  // Descriptor::FindFieldByCamelcaseName().\n  const FieldDescriptor* FindExtensionByCamelcaseName(const string& name) const;\n\n  // See Descriptor::CopyTo().\n  // Notes:\n  // - This method does NOT copy source code information since it is relatively\n  //   large and rarely needed.  See CopySourceCodeInfoTo() below.\n  void CopyTo(FileDescriptorProto* proto) const;\n  // Write the source code information of this FileDescriptor into the given\n  // FileDescriptorProto.  See CopyTo() above.\n  void CopySourceCodeInfoTo(FileDescriptorProto* proto) const;\n  // Fill the json_name field of FieldDescriptorProto for all fields. Can only\n  // be called after CopyTo().\n  void CopyJsonNameTo(FileDescriptorProto* proto) const;\n\n  // See Descriptor::DebugString().\n  string DebugString() const;\n\n  // See Descriptor::DebugStringWithOptions().\n  string DebugStringWithOptions(const DebugStringOptions& options) const;\n\n  // Returns true if this is a placeholder for an unknown file. This will\n  // only be the case if this descriptor comes from a DescriptorPool\n  // with AllowUnknownDependencies() set.\n  bool is_placeholder() const;\n\n  // Updates |*out_location| to the source location of the complete extent of\n  // this file declaration (namely, the empty path).\n  bool GetSourceLocation(SourceLocation* out_location) const;\n\n  // Updates |*out_location| to the source location of the complete\n  // extent of the declaration or declaration-part denoted by |path|.\n  // Returns false and leaves |*out_location| unchanged iff location\n  // information was not available.  (See SourceCodeInfo for\n  // description of path encoding.)\n  bool GetSourceLocation(const std::vector<int>& path,\n                         SourceLocation* out_location) const;\n\n private:\n  typedef FileOptions OptionsType;\n\n  const string* name_;\n  const string* package_;\n  const DescriptorPool* pool_;\n  GoogleOnceDynamic* dependencies_once_;\n  static void DependenciesOnceInit(const FileDescriptor* to_init);\n  void InternalDependenciesOnceInit() const;\n\n  // These are arranged to minimze padding on 64-bit.\n  int dependency_count_;\n  int public_dependency_count_;\n  int weak_dependency_count_;\n  int message_type_count_;\n  int enum_type_count_;\n  int service_count_;\n  int extension_count_;\n  Syntax syntax_;\n  bool is_placeholder_;\n\n  // Indicates the FileDescriptor is completed building. Used to verify\n  // that type accessor functions that can possibly build a dependent file\n  // aren't called during the process of building the file.\n  bool finished_building_;\n\n  mutable const FileDescriptor** dependencies_;\n  const string** dependencies_names_;\n  int* public_dependencies_;\n  int* weak_dependencies_;\n  Descriptor* message_types_;\n  EnumDescriptor* enum_types_;\n  ServiceDescriptor* services_;\n  FieldDescriptor* extensions_;\n  const FileOptions* options_;\n\n  const FileDescriptorTables* tables_;\n  const SourceCodeInfo* source_code_info_;\n\n  // IMPORTANT:  If you add a new field, make sure to search for all instances\n  // of Allocate<FileDescriptor>() and AllocateArray<FileDescriptor>() in\n  // descriptor.cc and update them to initialize the field.\n\n  FileDescriptor() {}\n  friend class DescriptorBuilder;\n  friend class DescriptorPool;\n  friend class Descriptor;\n  friend class FieldDescriptor;\n  friend class internal::LazyDescriptor;\n  friend class OneofDescriptor;\n  friend class EnumDescriptor;\n  friend class EnumValueDescriptor;\n  friend class MethodDescriptor;\n  friend class ServiceDescriptor;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileDescriptor);\n};\n\n\n// ===================================================================\n\n// Used to construct descriptors.\n//\n// Normally you won't want to build your own descriptors.  Message classes\n// constructed by the protocol compiler will provide them for you.  However,\n// if you are implementing Message on your own, or if you are writing a\n// program which can operate on totally arbitrary types and needs to load\n// them from some sort of database, you might need to.\n//\n// Since Descriptors are composed of a whole lot of cross-linked bits of\n// data that would be a pain to put together manually, the\n// DescriptorPool class is provided to make the process easier.  It can\n// take a FileDescriptorProto (defined in descriptor.proto), validate it,\n// and convert it to a set of nicely cross-linked Descriptors.\n//\n// DescriptorPool also helps with memory management.  Descriptors are\n// composed of many objects containing static data and pointers to each\n// other.  In all likelihood, when it comes time to delete this data,\n// you'll want to delete it all at once.  In fact, it is not uncommon to\n// have a whole pool of descriptors all cross-linked with each other which\n// you wish to delete all at once.  This class represents such a pool, and\n// handles the memory management for you.\n//\n// You can also search for descriptors within a DescriptorPool by name, and\n// extensions by number.\nclass LIBPROTOBUF_EXPORT DescriptorPool {\n public:\n  // Create a normal, empty DescriptorPool.\n  DescriptorPool();\n\n  // Constructs a DescriptorPool that, when it can't find something among the\n  // descriptors already in the pool, looks for it in the given\n  // DescriptorDatabase.\n  // Notes:\n  // - If a DescriptorPool is constructed this way, its BuildFile*() methods\n  //   must not be called (they will assert-fail).  The only way to populate\n  //   the pool with descriptors is to call the Find*By*() methods.\n  // - The Find*By*() methods may block the calling thread if the\n  //   DescriptorDatabase blocks.  This in turn means that parsing messages\n  //   may block if they need to look up extensions.\n  // - The Find*By*() methods will use mutexes for thread-safety, thus making\n  //   them slower even when they don't have to fall back to the database.\n  //   In fact, even the Find*By*() methods of descriptor objects owned by\n  //   this pool will be slower, since they will have to obtain locks too.\n  // - An ErrorCollector may optionally be given to collect validation errors\n  //   in files loaded from the database.  If not given, errors will be printed\n  //   to GOOGLE_LOG(ERROR).  Remember that files are built on-demand, so this\n  //   ErrorCollector may be called from any thread that calls one of the\n  //   Find*By*() methods.\n  // - The DescriptorDatabase must not be mutated during the lifetime of\n  //   the DescriptorPool. Even if the client takes care to avoid data races,\n  //   changes to the content of the DescriptorDatabase may not be reflected\n  //   in subsequent lookups in the DescriptorPool.\n  class ErrorCollector;\n  explicit DescriptorPool(DescriptorDatabase* fallback_database,\n                          ErrorCollector* error_collector = NULL);\n\n  ~DescriptorPool();\n\n  // Get a pointer to the generated pool.  Generated protocol message classes\n  // which are compiled into the binary will allocate their descriptors in\n  // this pool.  Do not add your own descriptors to this pool.\n  static const DescriptorPool* generated_pool();\n\n\n  // Find a FileDescriptor in the pool by file name.  Returns NULL if not\n  // found.\n  const FileDescriptor* FindFileByName(const string& name) const;\n\n  // Find the FileDescriptor in the pool which defines the given symbol.\n  // If any of the Find*ByName() methods below would succeed, then this is\n  // equivalent to calling that method and calling the result's file() method.\n  // Otherwise this returns NULL.\n  const FileDescriptor* FindFileContainingSymbol(\n      const string& symbol_name) const;\n\n  // Looking up descriptors ------------------------------------------\n  // These find descriptors by fully-qualified name.  These will find both\n  // top-level descriptors and nested descriptors.  They return NULL if not\n  // found.\n\n  const Descriptor* FindMessageTypeByName(const string& name) const;\n  const FieldDescriptor* FindFieldByName(const string& name) const;\n  const FieldDescriptor* FindExtensionByName(const string& name) const;\n  const OneofDescriptor* FindOneofByName(const string& name) const;\n  const EnumDescriptor* FindEnumTypeByName(const string& name) const;\n  const EnumValueDescriptor* FindEnumValueByName(const string& name) const;\n  const ServiceDescriptor* FindServiceByName(const string& name) const;\n  const MethodDescriptor* FindMethodByName(const string& name) const;\n\n  // Finds an extension of the given type by number.  The extendee must be\n  // a member of this DescriptorPool or one of its underlays.\n  const FieldDescriptor* FindExtensionByNumber(const Descriptor* extendee,\n                                               int number) const;\n\n  // Finds extensions of extendee. The extensions will be appended to\n  // out in an undefined order. Only extensions defined directly in\n  // this DescriptorPool or one of its underlays are guaranteed to be\n  // found: extensions defined in the fallback database might not be found\n  // depending on the database implementation.\n  void FindAllExtensions(const Descriptor* extendee,\n                         std::vector<const FieldDescriptor*>* out) const;\n\n  // Building descriptors --------------------------------------------\n\n  // When converting a FileDescriptorProto to a FileDescriptor, various\n  // errors might be detected in the input.  The caller may handle these\n  // programmatically by implementing an ErrorCollector.\n  class LIBPROTOBUF_EXPORT ErrorCollector {\n   public:\n    inline ErrorCollector() {}\n    virtual ~ErrorCollector();\n\n    // These constants specify what exact part of the construct is broken.\n    // This is useful e.g. for mapping the error back to an exact location\n    // in a .proto file.\n    enum ErrorLocation {\n      NAME,              // the symbol name, or the package name for files\n      NUMBER,            // field or extension range number\n      TYPE,              // field type\n      EXTENDEE,          // field extendee\n      DEFAULT_VALUE,     // field default value\n      INPUT_TYPE,        // method input type\n      OUTPUT_TYPE,       // method output type\n      OPTION_NAME,       // name in assignment\n      OPTION_VALUE,      // value in option assignment\n      OTHER              // some other problem\n    };\n\n    // Reports an error in the FileDescriptorProto. Use this function if the\n    // problem occurred should interrupt building the FileDescriptorProto.\n    virtual void AddError(\n      const string& filename,      // File name in which the error occurred.\n      const string& element_name,  // Full name of the erroneous element.\n      const Message* descriptor,   // Descriptor of the erroneous element.\n      ErrorLocation location,      // One of the location constants, above.\n      const string& message        // Human-readable error message.\n      ) = 0;\n\n    // Reports a warning in the FileDescriptorProto. Use this function if the\n    // problem occurred should NOT interrupt building the FileDescriptorProto.\n    virtual void AddWarning(\n      const string& /*filename*/,      // File name in which the error occurred.\n      const string& /*element_name*/,  // Full name of the erroneous element.\n      const Message* /*descriptor*/,   // Descriptor of the erroneous element.\n      ErrorLocation /*location*/,      // One of the location constants, above.\n      const string& /*message*/        // Human-readable error message.\n      ) {}\n\n   private:\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ErrorCollector);\n  };\n\n  // Convert the FileDescriptorProto to real descriptors and place them in\n  // this DescriptorPool.  All dependencies of the file must already be in\n  // the pool.  Returns the resulting FileDescriptor, or NULL if there were\n  // problems with the input (e.g. the message was invalid, or dependencies\n  // were missing).  Details about the errors are written to GOOGLE_LOG(ERROR).\n  const FileDescriptor* BuildFile(const FileDescriptorProto& proto);\n\n  // Same as BuildFile() except errors are sent to the given ErrorCollector.\n  const FileDescriptor* BuildFileCollectingErrors(\n    const FileDescriptorProto& proto,\n    ErrorCollector* error_collector);\n\n  // By default, it is an error if a FileDescriptorProto contains references\n  // to types or other files that are not found in the DescriptorPool (or its\n  // backing DescriptorDatabase, if any).  If you call\n  // AllowUnknownDependencies(), however, then unknown types and files\n  // will be replaced by placeholder descriptors (which can be identified by\n  // the is_placeholder() method).  This can allow you to\n  // perform some useful operations with a .proto file even if you do not\n  // have access to other .proto files on which it depends.  However, some\n  // heuristics must be used to fill in the gaps in information, and these\n  // can lead to descriptors which are inaccurate.  For example, the\n  // DescriptorPool may be forced to guess whether an unknown type is a message\n  // or an enum, as well as what package it resides in.  Furthermore,\n  // placeholder types will not be discoverable via FindMessageTypeByName()\n  // and similar methods, which could confuse some descriptor-based algorithms.\n  // Generally, the results of this option should be handled with extreme care.\n  void AllowUnknownDependencies() { allow_unknown_ = true; }\n\n  // By default, weak imports are allowed to be missing, in which case we will\n  // use a placeholder for the dependency and convert the field to be an Empty\n  // message field. If you call EnforceWeakDependencies(true), however, the\n  // DescriptorPool will report a import not found error.\n  void EnforceWeakDependencies(bool enforce) { enforce_weak_ = enforce; }\n\n  // Internal stuff --------------------------------------------------\n  // These methods MUST NOT be called from outside the proto2 library.\n  // These methods may contain hidden pitfalls and may be removed in a\n  // future library version.\n\n  // Create a DescriptorPool which is overlaid on top of some other pool.\n  // If you search for a descriptor in the overlay and it is not found, the\n  // underlay will be searched as a backup.  If the underlay has its own\n  // underlay, that will be searched next, and so on.  This also means that\n  // files built in the overlay will be cross-linked with the underlay's\n  // descriptors if necessary.  The underlay remains property of the caller;\n  // it must remain valid for the lifetime of the newly-constructed pool.\n  //\n  // Example:  Say you want to parse a .proto file at runtime in order to use\n  // its type with a DynamicMessage.  Say this .proto file has dependencies,\n  // but you know that all the dependencies will be things that are already\n  // compiled into the binary.  For ease of use, you'd like to load the types\n  // right out of generated_pool() rather than have to parse redundant copies\n  // of all these .protos and runtime.  But, you don't want to add the parsed\n  // types directly into generated_pool(): this is not allowed, and would be\n  // bad design anyway.  So, instead, you could use generated_pool() as an\n  // underlay for a new DescriptorPool in which you add only the new file.\n  //\n  // WARNING:  Use of underlays can lead to many subtle gotchas.  Instead,\n  //   try to formulate what you want to do in terms of DescriptorDatabases.\n  explicit DescriptorPool(const DescriptorPool* underlay);\n\n  // Called by generated classes at init time to add their descriptors to\n  // generated_pool.  Do NOT call this in your own code!  filename must be a\n  // permanent string (e.g. a string literal).\n  static void InternalAddGeneratedFile(\n      const void* encoded_file_descriptor, int size);\n\n  // Disallow [enforce_utf8 = false] in .proto files.\n  void DisallowEnforceUtf8() { disallow_enforce_utf8_ = true; }\n\n\n  // For internal use only:  Gets a non-const pointer to the generated pool.\n  // This is called at static-initialization time only, so thread-safety is\n  // not a concern.  If both an underlay and a fallback database are present,\n  // the underlay takes precedence.\n  static DescriptorPool* internal_generated_pool();\n\n  // For internal use only:  Changes the behavior of BuildFile() such that it\n  // allows the file to make reference to message types declared in other files\n  // which it did not officially declare as dependencies.\n  void InternalDontEnforceDependencies();\n\n  // For internal use only: Enables lazy building of dependencies of a file.\n  // Delay the building of dependencies of a file descriptor until absolutely\n  // necessary, like when message_type() is called on a field that is defined\n  // in that dependency's file. This will cause functional issues if a proto\n  // or one of it's dependencies has errors. Should only be enabled for the\n  // generated_pool_ (because no descriptor build errors are guaranteed by\n  // the compilation generation process), testing, or if a lack of descriptor\n  // build errors can be guaranteed for a pool.\n  void InternalSetLazilyBuildDependencies() {\n    lazily_build_dependencies_ = true;\n    // This needs to be set when lazily building dependencies, as it breaks\n    // dependency checking.\n    InternalDontEnforceDependencies();\n  }\n\n  // For internal use only.\n  void internal_set_underlay(const DescriptorPool* underlay) {\n    underlay_ = underlay;\n  }\n\n  // For internal (unit test) use only:  Returns true if a FileDescriptor has\n  // been constructed for the given file, false otherwise.  Useful for testing\n  // lazy descriptor initialization behavior.\n  bool InternalIsFileLoaded(const string& filename) const;\n\n\n  // Add a file to unused_import_track_files_. DescriptorBuilder will log\n  // warnings for those files if there is any unused import.\n  void AddUnusedImportTrackFile(const string& file_name);\n  void ClearUnusedImportTrackFiles();\n\n private:\n  friend class Descriptor;\n  friend class internal::LazyDescriptor;\n  friend class FieldDescriptor;\n  friend class EnumDescriptor;\n  friend class ServiceDescriptor;\n  friend class MethodDescriptor;\n  friend class FileDescriptor;\n  friend class StreamDescriptor;\n  friend class DescriptorBuilder;\n  friend class FileDescriptorTables;\n\n  // Return true if the given name is a sub-symbol of any non-package\n  // descriptor that already exists in the descriptor pool.  (The full\n  // definition of such types is already known.)\n  bool IsSubSymbolOfBuiltType(const string& name) const;\n\n  // Tries to find something in the fallback database and link in the\n  // corresponding proto file.  Returns true if successful, in which case\n  // the caller should search for the thing again.  These are declared\n  // const because they are called by (semantically) const methods.\n  bool TryFindFileInFallbackDatabase(const string& name) const;\n  bool TryFindSymbolInFallbackDatabase(const string& name) const;\n  bool TryFindExtensionInFallbackDatabase(const Descriptor* containing_type,\n                                          int field_number) const;\n\n  // Like BuildFile() but called internally when the file has been loaded from\n  // fallback_database_.  Declared const because it is called by (semantically)\n  // const methods.\n  const FileDescriptor* BuildFileFromDatabase(\n    const FileDescriptorProto& proto) const;\n\n  // Helper for when lazily_build_dependencies_ is set, can look up a symbol\n  // after the file's descriptor is built, and can build the file where that\n  // symbol is defined if necessary. Will create a placeholder if the type\n  // doesn't exist in the fallback database, or the file doesn't build\n  // successfully.\n  Symbol CrossLinkOnDemandHelper(const string& name, bool expecting_enum) const;\n\n  // Create a placeholder FileDescriptor of the specified name\n  FileDescriptor* NewPlaceholderFile(const string& name) const;\n  FileDescriptor* NewPlaceholderFileWithMutexHeld(const string& name) const;\n\n  enum PlaceholderType {\n    PLACEHOLDER_MESSAGE,\n    PLACEHOLDER_ENUM,\n    PLACEHOLDER_EXTENDABLE_MESSAGE\n  };\n  // Create a placeholder Descriptor of the specified name\n  Symbol NewPlaceholder(const string& name,\n                        PlaceholderType placeholder_type) const;\n  Symbol NewPlaceholderWithMutexHeld(const string& name,\n                                     PlaceholderType placeholder_type) const;\n\n  // If fallback_database_ is NULL, this is NULL.  Otherwise, this is a mutex\n  // which must be locked while accessing tables_.\n  Mutex* mutex_;\n\n  // See constructor.\n  DescriptorDatabase* fallback_database_;\n  ErrorCollector* default_error_collector_;\n  const DescriptorPool* underlay_;\n\n  // This class contains a lot of hash maps with complicated types that\n  // we'd like to keep out of the header.\n  class Tables;\n  std::unique_ptr<Tables> tables_;\n\n  bool enforce_dependencies_;\n  bool lazily_build_dependencies_;\n  bool allow_unknown_;\n  bool enforce_weak_;\n  bool disallow_enforce_utf8_;\n  std::set<string> unused_import_track_files_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DescriptorPool);\n};\n\n\n// inline methods ====================================================\n\n// These macros makes this repetitive code more readable.\n#define PROTOBUF_DEFINE_ACCESSOR(CLASS, FIELD, TYPE) \\\n  inline TYPE CLASS::FIELD() const { return FIELD##_; }\n\n// Strings fields are stored as pointers but returned as const references.\n#define PROTOBUF_DEFINE_STRING_ACCESSOR(CLASS, FIELD) \\\n  inline const string& CLASS::FIELD() const { return *FIELD##_; }\n\n// Arrays take an index parameter, obviously.\n#define PROTOBUF_DEFINE_ARRAY_ACCESSOR(CLASS, FIELD, TYPE) \\\n  inline TYPE CLASS::FIELD(int index) const { return FIELD##s_ + index; }\n\n#define PROTOBUF_DEFINE_OPTIONS_ACCESSOR(CLASS, TYPE) \\\n  inline const TYPE& CLASS::options() const { return *options_; }\n\nPROTOBUF_DEFINE_STRING_ACCESSOR(Descriptor, name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(Descriptor, full_name)\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, file, const FileDescriptor*)\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, containing_type, const Descriptor*)\n\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, field_count, int)\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, oneof_decl_count, int)\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, nested_type_count, int)\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, enum_type_count, int)\n\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, field, const FieldDescriptor*)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, oneof_decl, const OneofDescriptor*)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, nested_type, const Descriptor*)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, enum_type, const EnumDescriptor*)\n\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, extension_range_count, int)\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, extension_count, int)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension_range,\n                               const Descriptor::ExtensionRange*)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension,\n                               const FieldDescriptor*)\n\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, reserved_range_count, int)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, reserved_range,\n                               const Descriptor::ReservedRange*)\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, reserved_name_count, int)\n\nPROTOBUF_DEFINE_OPTIONS_ACCESSOR(Descriptor, MessageOptions)\nPROTOBUF_DEFINE_ACCESSOR(Descriptor, is_placeholder, bool)\n\nPROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, full_name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, json_name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, lowercase_name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, camelcase_name)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, file, const FileDescriptor*)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, number, int)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, is_extension, bool)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, label, FieldDescriptor::Label)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, containing_type, const Descriptor*)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, containing_oneof,\n                         const OneofDescriptor*)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, index_in_oneof, int)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, extension_scope, const Descriptor*)\nPROTOBUF_DEFINE_OPTIONS_ACCESSOR(FieldDescriptor, FieldOptions)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_default_value, bool)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_json_name, bool)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int32 , int32 )\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_int64 , int64 )\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_uint32, uint32)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_uint64, uint64)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_float , float )\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_double, double)\nPROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, default_value_bool  , bool  )\nPROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, default_value_string)\n\nPROTOBUF_DEFINE_STRING_ACCESSOR(OneofDescriptor, name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(OneofDescriptor, full_name)\nPROTOBUF_DEFINE_ACCESSOR(OneofDescriptor, containing_type, const Descriptor*)\nPROTOBUF_DEFINE_ACCESSOR(OneofDescriptor, field_count, int)\nPROTOBUF_DEFINE_OPTIONS_ACCESSOR(OneofDescriptor, OneofOptions)\n\nPROTOBUF_DEFINE_STRING_ACCESSOR(EnumDescriptor, name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(EnumDescriptor, full_name)\nPROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, file, const FileDescriptor*)\nPROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, containing_type, const Descriptor*)\nPROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, value_count, int)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor, value,\n                               const EnumValueDescriptor*)\nPROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumDescriptor, EnumOptions)\nPROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, is_placeholder, bool)\nPROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, reserved_range_count, int)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor, reserved_range,\n                               const EnumDescriptor::ReservedRange*)\nPROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, reserved_name_count, int)\n\nPROTOBUF_DEFINE_STRING_ACCESSOR(EnumValueDescriptor, name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(EnumValueDescriptor, full_name)\nPROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, number, int)\nPROTOBUF_DEFINE_ACCESSOR(EnumValueDescriptor, type, const EnumDescriptor*)\nPROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumValueDescriptor, EnumValueOptions)\n\nPROTOBUF_DEFINE_STRING_ACCESSOR(ServiceDescriptor, name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(ServiceDescriptor, full_name)\nPROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, file, const FileDescriptor*)\nPROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, method_count, int)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(ServiceDescriptor, method,\n                               const MethodDescriptor*)\nPROTOBUF_DEFINE_OPTIONS_ACCESSOR(ServiceDescriptor, ServiceOptions)\n\nPROTOBUF_DEFINE_STRING_ACCESSOR(MethodDescriptor, name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(MethodDescriptor, full_name)\nPROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, service, const ServiceDescriptor*)\nPROTOBUF_DEFINE_OPTIONS_ACCESSOR(MethodDescriptor, MethodOptions)\nPROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, client_streaming, bool)\nPROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, server_streaming, bool)\n\nPROTOBUF_DEFINE_STRING_ACCESSOR(FileDescriptor, name)\nPROTOBUF_DEFINE_STRING_ACCESSOR(FileDescriptor, package)\nPROTOBUF_DEFINE_ACCESSOR(FileDescriptor, pool, const DescriptorPool*)\nPROTOBUF_DEFINE_ACCESSOR(FileDescriptor, dependency_count, int)\nPROTOBUF_DEFINE_ACCESSOR(FileDescriptor, public_dependency_count, int)\nPROTOBUF_DEFINE_ACCESSOR(FileDescriptor, weak_dependency_count, int)\nPROTOBUF_DEFINE_ACCESSOR(FileDescriptor, message_type_count, int)\nPROTOBUF_DEFINE_ACCESSOR(FileDescriptor, enum_type_count, int)\nPROTOBUF_DEFINE_ACCESSOR(FileDescriptor, service_count, int)\nPROTOBUF_DEFINE_ACCESSOR(FileDescriptor, extension_count, int)\nPROTOBUF_DEFINE_OPTIONS_ACCESSOR(FileDescriptor, FileOptions)\nPROTOBUF_DEFINE_ACCESSOR(FileDescriptor, is_placeholder, bool)\n\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, message_type, const Descriptor*)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, enum_type, const EnumDescriptor*)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, service,\n                               const ServiceDescriptor*)\nPROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, extension,\n                               const FieldDescriptor*)\n\n#undef PROTOBUF_DEFINE_ACCESSOR\n#undef PROTOBUF_DEFINE_STRING_ACCESSOR\n#undef PROTOBUF_DEFINE_ARRAY_ACCESSOR\n\n// A few accessors differ from the macros...\n\ninline bool Descriptor::IsExtensionNumber(int number) const {\n  return FindExtensionRangeContainingNumber(number) != NULL;\n}\n\ninline bool Descriptor::IsReservedNumber(int number) const {\n  return FindReservedRangeContainingNumber(number) != NULL;\n}\n\ninline bool Descriptor::IsReservedName(const string& name) const {\n  for (int i = 0; i < reserved_name_count(); i++) {\n    if (name == reserved_name(i)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n// Can't use PROTOBUF_DEFINE_ARRAY_ACCESSOR because reserved_names_ is actually\n// an array of pointers rather than the usual array of objects.\ninline const string& Descriptor::reserved_name(int index) const {\n  return *reserved_names_[index];\n}\n\ninline bool EnumDescriptor::IsReservedNumber(int number) const {\n  return FindReservedRangeContainingNumber(number) != NULL;\n}\n\ninline bool EnumDescriptor::IsReservedName(const string& name) const {\n  for (int i = 0; i < reserved_name_count(); i++) {\n    if (name == reserved_name(i)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n// Can't use PROTOBUF_DEFINE_ARRAY_ACCESSOR because reserved_names_ is actually\n// an array of pointers rather than the usual array of objects.\ninline const string& EnumDescriptor::reserved_name(int index) const {\n  return *reserved_names_[index];\n}\n\ninline FieldDescriptor::Type FieldDescriptor::type() const {\n  if (type_once_) {\n    type_once_->Init(&FieldDescriptor::TypeOnceInit, this);\n  }\n  return type_;\n}\n\ninline bool FieldDescriptor::is_required() const {\n  return label() == LABEL_REQUIRED;\n}\n\ninline bool FieldDescriptor::is_optional() const {\n  return label() == LABEL_OPTIONAL;\n}\n\ninline bool FieldDescriptor::is_repeated() const {\n  return label() == LABEL_REPEATED;\n}\n\ninline bool FieldDescriptor::is_packable() const {\n  return is_repeated() && IsTypePackable(type());\n}\n\ninline bool FieldDescriptor::is_map() const {\n  return type() == TYPE_MESSAGE && is_map_message_type();\n}\n\n// To save space, index() is computed by looking at the descriptor's position\n// in the parent's array of children.\ninline int FieldDescriptor::index() const {\n  if (!is_extension_) {\n    return static_cast<int>(this - containing_type()->fields_);\n  } else if (extension_scope_ != NULL) {\n    return static_cast<int>(this - extension_scope_->extensions_);\n  } else {\n    return static_cast<int>(this - file_->extensions_);\n  }\n}\n\ninline int Descriptor::index() const {\n  if (containing_type_ == NULL) {\n    return static_cast<int>(this - file_->message_types_);\n  } else {\n    return static_cast<int>(this - containing_type_->nested_types_);\n  }\n}\n\ninline const FileDescriptor* OneofDescriptor::file() const {\n  return containing_type()->file();\n}\n\ninline int OneofDescriptor::index() const {\n  return static_cast<int>(this - containing_type_->oneof_decls_);\n}\n\ninline int EnumDescriptor::index() const {\n  if (containing_type_ == NULL) {\n    return static_cast<int>(this - file_->enum_types_);\n  } else {\n    return static_cast<int>(this - containing_type_->enum_types_);\n  }\n}\n\ninline const FileDescriptor* EnumValueDescriptor::file() const {\n  return type()->file();\n}\n\ninline int EnumValueDescriptor::index() const {\n  return static_cast<int>(this - type_->values_);\n}\n\ninline int ServiceDescriptor::index() const {\n  return static_cast<int>(this - file_->services_);\n}\n\ninline const FileDescriptor* MethodDescriptor::file() const {\n  return service()->file();\n}\n\ninline int MethodDescriptor::index() const {\n  return static_cast<int>(this - service_->methods_);\n}\n\ninline const char* FieldDescriptor::type_name() const {\n  return kTypeToName[type()];\n}\n\ninline FieldDescriptor::CppType FieldDescriptor::cpp_type() const {\n  return kTypeToCppTypeMap[type()];\n}\n\ninline const char* FieldDescriptor::cpp_type_name() const {\n  return kCppTypeToName[kTypeToCppTypeMap[type()]];\n}\n\ninline FieldDescriptor::CppType FieldDescriptor::TypeToCppType(Type type) {\n  return kTypeToCppTypeMap[type];\n}\n\ninline const char* FieldDescriptor::TypeName(Type type) {\n  return kTypeToName[type];\n}\n\ninline const char* FieldDescriptor::CppTypeName(CppType cpp_type) {\n  return kCppTypeToName[cpp_type];\n}\n\ninline bool FieldDescriptor::IsTypePackable(Type field_type) {\n  return (field_type != FieldDescriptor::TYPE_STRING &&\n          field_type != FieldDescriptor::TYPE_GROUP &&\n          field_type != FieldDescriptor::TYPE_MESSAGE &&\n          field_type != FieldDescriptor::TYPE_BYTES);\n}\n\ninline const FileDescriptor* FileDescriptor::public_dependency(\n    int index) const {\n  return dependency(public_dependencies_[index]);\n}\n\ninline const FileDescriptor* FileDescriptor::weak_dependency(\n    int index) const {\n  return dependency(weak_dependencies_[index]);\n}\n\ninline FileDescriptor::Syntax FileDescriptor::syntax() const {\n  return syntax_;\n}\n\n// Can't use PROTOBUF_DEFINE_ARRAY_ACCESSOR because fields_ is actually an array\n// of pointers rather than the usual array of objects.\ninline const FieldDescriptor* OneofDescriptor::field(int index) const {\n  return fields_[index];\n}\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_DESCRIPTOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/descriptor.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/descriptor.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/generated_enum_reflection.h>\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fdescriptor_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2fdescriptor_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[27];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2fdescriptor_2eproto\nnamespace google {\nnamespace protobuf {\nclass DescriptorProto;\nclass DescriptorProtoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern DescriptorProtoDefaultTypeInternal _DescriptorProto_default_instance_;\nclass DescriptorProto_ExtensionRange;\nclass DescriptorProto_ExtensionRangeDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern DescriptorProto_ExtensionRangeDefaultTypeInternal _DescriptorProto_ExtensionRange_default_instance_;\nclass DescriptorProto_ReservedRange;\nclass DescriptorProto_ReservedRangeDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern DescriptorProto_ReservedRangeDefaultTypeInternal _DescriptorProto_ReservedRange_default_instance_;\nclass EnumDescriptorProto;\nclass EnumDescriptorProtoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern EnumDescriptorProtoDefaultTypeInternal _EnumDescriptorProto_default_instance_;\nclass EnumDescriptorProto_EnumReservedRange;\nclass EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern EnumDescriptorProto_EnumReservedRangeDefaultTypeInternal _EnumDescriptorProto_EnumReservedRange_default_instance_;\nclass EnumOptions;\nclass EnumOptionsDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern EnumOptionsDefaultTypeInternal _EnumOptions_default_instance_;\nclass EnumValueDescriptorProto;\nclass EnumValueDescriptorProtoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern EnumValueDescriptorProtoDefaultTypeInternal _EnumValueDescriptorProto_default_instance_;\nclass EnumValueOptions;\nclass EnumValueOptionsDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern EnumValueOptionsDefaultTypeInternal _EnumValueOptions_default_instance_;\nclass ExtensionRangeOptions;\nclass ExtensionRangeOptionsDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern ExtensionRangeOptionsDefaultTypeInternal _ExtensionRangeOptions_default_instance_;\nclass FieldDescriptorProto;\nclass FieldDescriptorProtoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern FieldDescriptorProtoDefaultTypeInternal _FieldDescriptorProto_default_instance_;\nclass FieldOptions;\nclass FieldOptionsDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern FieldOptionsDefaultTypeInternal _FieldOptions_default_instance_;\nclass FileDescriptorProto;\nclass FileDescriptorProtoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern FileDescriptorProtoDefaultTypeInternal _FileDescriptorProto_default_instance_;\nclass FileDescriptorSet;\nclass FileDescriptorSetDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern FileDescriptorSetDefaultTypeInternal _FileDescriptorSet_default_instance_;\nclass FileOptions;\nclass FileOptionsDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern FileOptionsDefaultTypeInternal _FileOptions_default_instance_;\nclass GeneratedCodeInfo;\nclass GeneratedCodeInfoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern GeneratedCodeInfoDefaultTypeInternal _GeneratedCodeInfo_default_instance_;\nclass GeneratedCodeInfo_Annotation;\nclass GeneratedCodeInfo_AnnotationDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern GeneratedCodeInfo_AnnotationDefaultTypeInternal _GeneratedCodeInfo_Annotation_default_instance_;\nclass MessageOptions;\nclass MessageOptionsDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern MessageOptionsDefaultTypeInternal _MessageOptions_default_instance_;\nclass MethodDescriptorProto;\nclass MethodDescriptorProtoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern MethodDescriptorProtoDefaultTypeInternal _MethodDescriptorProto_default_instance_;\nclass MethodOptions;\nclass MethodOptionsDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern MethodOptionsDefaultTypeInternal _MethodOptions_default_instance_;\nclass OneofDescriptorProto;\nclass OneofDescriptorProtoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern OneofDescriptorProtoDefaultTypeInternal _OneofDescriptorProto_default_instance_;\nclass OneofOptions;\nclass OneofOptionsDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern OneofOptionsDefaultTypeInternal _OneofOptions_default_instance_;\nclass ServiceDescriptorProto;\nclass ServiceDescriptorProtoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern ServiceDescriptorProtoDefaultTypeInternal _ServiceDescriptorProto_default_instance_;\nclass ServiceOptions;\nclass ServiceOptionsDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern ServiceOptionsDefaultTypeInternal _ServiceOptions_default_instance_;\nclass SourceCodeInfo;\nclass SourceCodeInfoDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern SourceCodeInfoDefaultTypeInternal _SourceCodeInfo_default_instance_;\nclass SourceCodeInfo_Location;\nclass SourceCodeInfo_LocationDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern SourceCodeInfo_LocationDefaultTypeInternal _SourceCodeInfo_Location_default_instance_;\nclass UninterpretedOption;\nclass UninterpretedOptionDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern UninterpretedOptionDefaultTypeInternal _UninterpretedOption_default_instance_;\nclass UninterpretedOption_NamePart;\nclass UninterpretedOption_NamePartDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern UninterpretedOption_NamePartDefaultTypeInternal _UninterpretedOption_NamePart_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::DescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::DescriptorProto>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::DescriptorProto_ExtensionRange* Arena::CreateMaybeMessage<::google::protobuf::DescriptorProto_ExtensionRange>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::DescriptorProto_ReservedRange* Arena::CreateMaybeMessage<::google::protobuf::DescriptorProto_ReservedRange>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::EnumDescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::EnumDescriptorProto>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::EnumDescriptorProto_EnumReservedRange* Arena::CreateMaybeMessage<::google::protobuf::EnumDescriptorProto_EnumReservedRange>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::EnumOptions* Arena::CreateMaybeMessage<::google::protobuf::EnumOptions>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::EnumValueDescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::EnumValueDescriptorProto>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::EnumValueOptions* Arena::CreateMaybeMessage<::google::protobuf::EnumValueOptions>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::ExtensionRangeOptions* Arena::CreateMaybeMessage<::google::protobuf::ExtensionRangeOptions>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::FieldDescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::FieldDescriptorProto>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::FieldOptions* Arena::CreateMaybeMessage<::google::protobuf::FieldOptions>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::FileDescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::FileDescriptorProto>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::FileDescriptorSet* Arena::CreateMaybeMessage<::google::protobuf::FileDescriptorSet>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::FileOptions* Arena::CreateMaybeMessage<::google::protobuf::FileOptions>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::GeneratedCodeInfo* Arena::CreateMaybeMessage<::google::protobuf::GeneratedCodeInfo>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::GeneratedCodeInfo_Annotation* Arena::CreateMaybeMessage<::google::protobuf::GeneratedCodeInfo_Annotation>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::MessageOptions* Arena::CreateMaybeMessage<::google::protobuf::MessageOptions>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::MethodDescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::MethodDescriptorProto>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::MethodOptions* Arena::CreateMaybeMessage<::google::protobuf::MethodOptions>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::OneofDescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::OneofDescriptorProto>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::OneofOptions* Arena::CreateMaybeMessage<::google::protobuf::OneofOptions>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::ServiceDescriptorProto* Arena::CreateMaybeMessage<::google::protobuf::ServiceDescriptorProto>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::ServiceOptions* Arena::CreateMaybeMessage<::google::protobuf::ServiceOptions>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::SourceCodeInfo* Arena::CreateMaybeMessage<::google::protobuf::SourceCodeInfo>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::SourceCodeInfo_Location* Arena::CreateMaybeMessage<::google::protobuf::SourceCodeInfo_Location>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::UninterpretedOption* Arena::CreateMaybeMessage<::google::protobuf::UninterpretedOption>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::UninterpretedOption_NamePart* Arena::CreateMaybeMessage<::google::protobuf::UninterpretedOption_NamePart>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\nenum FieldDescriptorProto_Type {\n  FieldDescriptorProto_Type_TYPE_DOUBLE = 1,\n  FieldDescriptorProto_Type_TYPE_FLOAT = 2,\n  FieldDescriptorProto_Type_TYPE_INT64 = 3,\n  FieldDescriptorProto_Type_TYPE_UINT64 = 4,\n  FieldDescriptorProto_Type_TYPE_INT32 = 5,\n  FieldDescriptorProto_Type_TYPE_FIXED64 = 6,\n  FieldDescriptorProto_Type_TYPE_FIXED32 = 7,\n  FieldDescriptorProto_Type_TYPE_BOOL = 8,\n  FieldDescriptorProto_Type_TYPE_STRING = 9,\n  FieldDescriptorProto_Type_TYPE_GROUP = 10,\n  FieldDescriptorProto_Type_TYPE_MESSAGE = 11,\n  FieldDescriptorProto_Type_TYPE_BYTES = 12,\n  FieldDescriptorProto_Type_TYPE_UINT32 = 13,\n  FieldDescriptorProto_Type_TYPE_ENUM = 14,\n  FieldDescriptorProto_Type_TYPE_SFIXED32 = 15,\n  FieldDescriptorProto_Type_TYPE_SFIXED64 = 16,\n  FieldDescriptorProto_Type_TYPE_SINT32 = 17,\n  FieldDescriptorProto_Type_TYPE_SINT64 = 18\n};\nLIBPROTOBUF_EXPORT bool FieldDescriptorProto_Type_IsValid(int value);\nconst FieldDescriptorProto_Type FieldDescriptorProto_Type_Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE;\nconst FieldDescriptorProto_Type FieldDescriptorProto_Type_Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64;\nconst int FieldDescriptorProto_Type_Type_ARRAYSIZE = FieldDescriptorProto_Type_Type_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor();\ninline const ::std::string& FieldDescriptorProto_Type_Name(FieldDescriptorProto_Type value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    FieldDescriptorProto_Type_descriptor(), value);\n}\ninline bool FieldDescriptorProto_Type_Parse(\n    const ::std::string& name, FieldDescriptorProto_Type* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<FieldDescriptorProto_Type>(\n    FieldDescriptorProto_Type_descriptor(), name, value);\n}\nenum FieldDescriptorProto_Label {\n  FieldDescriptorProto_Label_LABEL_OPTIONAL = 1,\n  FieldDescriptorProto_Label_LABEL_REQUIRED = 2,\n  FieldDescriptorProto_Label_LABEL_REPEATED = 3\n};\nLIBPROTOBUF_EXPORT bool FieldDescriptorProto_Label_IsValid(int value);\nconst FieldDescriptorProto_Label FieldDescriptorProto_Label_Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL;\nconst FieldDescriptorProto_Label FieldDescriptorProto_Label_Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED;\nconst int FieldDescriptorProto_Label_Label_ARRAYSIZE = FieldDescriptorProto_Label_Label_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor();\ninline const ::std::string& FieldDescriptorProto_Label_Name(FieldDescriptorProto_Label value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    FieldDescriptorProto_Label_descriptor(), value);\n}\ninline bool FieldDescriptorProto_Label_Parse(\n    const ::std::string& name, FieldDescriptorProto_Label* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<FieldDescriptorProto_Label>(\n    FieldDescriptorProto_Label_descriptor(), name, value);\n}\nenum FileOptions_OptimizeMode {\n  FileOptions_OptimizeMode_SPEED = 1,\n  FileOptions_OptimizeMode_CODE_SIZE = 2,\n  FileOptions_OptimizeMode_LITE_RUNTIME = 3\n};\nLIBPROTOBUF_EXPORT bool FileOptions_OptimizeMode_IsValid(int value);\nconst FileOptions_OptimizeMode FileOptions_OptimizeMode_OptimizeMode_MIN = FileOptions_OptimizeMode_SPEED;\nconst FileOptions_OptimizeMode FileOptions_OptimizeMode_OptimizeMode_MAX = FileOptions_OptimizeMode_LITE_RUNTIME;\nconst int FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE = FileOptions_OptimizeMode_OptimizeMode_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor();\ninline const ::std::string& FileOptions_OptimizeMode_Name(FileOptions_OptimizeMode value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    FileOptions_OptimizeMode_descriptor(), value);\n}\ninline bool FileOptions_OptimizeMode_Parse(\n    const ::std::string& name, FileOptions_OptimizeMode* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<FileOptions_OptimizeMode>(\n    FileOptions_OptimizeMode_descriptor(), name, value);\n}\nenum FieldOptions_CType {\n  FieldOptions_CType_STRING = 0,\n  FieldOptions_CType_CORD = 1,\n  FieldOptions_CType_STRING_PIECE = 2\n};\nLIBPROTOBUF_EXPORT bool FieldOptions_CType_IsValid(int value);\nconst FieldOptions_CType FieldOptions_CType_CType_MIN = FieldOptions_CType_STRING;\nconst FieldOptions_CType FieldOptions_CType_CType_MAX = FieldOptions_CType_STRING_PIECE;\nconst int FieldOptions_CType_CType_ARRAYSIZE = FieldOptions_CType_CType_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor();\ninline const ::std::string& FieldOptions_CType_Name(FieldOptions_CType value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    FieldOptions_CType_descriptor(), value);\n}\ninline bool FieldOptions_CType_Parse(\n    const ::std::string& name, FieldOptions_CType* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<FieldOptions_CType>(\n    FieldOptions_CType_descriptor(), name, value);\n}\nenum FieldOptions_JSType {\n  FieldOptions_JSType_JS_NORMAL = 0,\n  FieldOptions_JSType_JS_STRING = 1,\n  FieldOptions_JSType_JS_NUMBER = 2\n};\nLIBPROTOBUF_EXPORT bool FieldOptions_JSType_IsValid(int value);\nconst FieldOptions_JSType FieldOptions_JSType_JSType_MIN = FieldOptions_JSType_JS_NORMAL;\nconst FieldOptions_JSType FieldOptions_JSType_JSType_MAX = FieldOptions_JSType_JS_NUMBER;\nconst int FieldOptions_JSType_JSType_ARRAYSIZE = FieldOptions_JSType_JSType_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldOptions_JSType_descriptor();\ninline const ::std::string& FieldOptions_JSType_Name(FieldOptions_JSType value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    FieldOptions_JSType_descriptor(), value);\n}\ninline bool FieldOptions_JSType_Parse(\n    const ::std::string& name, FieldOptions_JSType* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<FieldOptions_JSType>(\n    FieldOptions_JSType_descriptor(), name, value);\n}\nenum MethodOptions_IdempotencyLevel {\n  MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN = 0,\n  MethodOptions_IdempotencyLevel_NO_SIDE_EFFECTS = 1,\n  MethodOptions_IdempotencyLevel_IDEMPOTENT = 2\n};\nLIBPROTOBUF_EXPORT bool MethodOptions_IdempotencyLevel_IsValid(int value);\nconst MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel_IdempotencyLevel_MIN = MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN;\nconst MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX = MethodOptions_IdempotencyLevel_IDEMPOTENT;\nconst int MethodOptions_IdempotencyLevel_IdempotencyLevel_ARRAYSIZE = MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* MethodOptions_IdempotencyLevel_descriptor();\ninline const ::std::string& MethodOptions_IdempotencyLevel_Name(MethodOptions_IdempotencyLevel value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    MethodOptions_IdempotencyLevel_descriptor(), value);\n}\ninline bool MethodOptions_IdempotencyLevel_Parse(\n    const ::std::string& name, MethodOptions_IdempotencyLevel* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<MethodOptions_IdempotencyLevel>(\n    MethodOptions_IdempotencyLevel_descriptor(), name, value);\n}\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorSet) */ {\n public:\n  FileDescriptorSet();\n  virtual ~FileDescriptorSet();\n\n  FileDescriptorSet(const FileDescriptorSet& from);\n\n  inline FileDescriptorSet& operator=(const FileDescriptorSet& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  FileDescriptorSet(FileDescriptorSet&& from) noexcept\n    : FileDescriptorSet() {\n    *this = ::std::move(from);\n  }\n\n  inline FileDescriptorSet& operator=(FileDescriptorSet&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const FileDescriptorSet& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const FileDescriptorSet* internal_default_instance() {\n    return reinterpret_cast<const FileDescriptorSet*>(\n               &_FileDescriptorSet_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void UnsafeArenaSwap(FileDescriptorSet* other);\n  void Swap(FileDescriptorSet* other);\n  friend void swap(FileDescriptorSet& a, FileDescriptorSet& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline FileDescriptorSet* New() const final {\n    return CreateMaybeMessage<FileDescriptorSet>(NULL);\n  }\n\n  FileDescriptorSet* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<FileDescriptorSet>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const FileDescriptorSet& from);\n  void MergeFrom(const FileDescriptorSet& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(FileDescriptorSet* other);\n  protected:\n  explicit FileDescriptorSet(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.FileDescriptorProto file = 1;\n  int file_size() const;\n  void clear_file();\n  static const int kFileFieldNumber = 1;\n  ::google::protobuf::FileDescriptorProto* mutable_file(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*\n      mutable_file();\n  const ::google::protobuf::FileDescriptorProto& file(int index) const;\n  ::google::protobuf::FileDescriptorProto* add_file();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >&\n      file() const;\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorSet)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto > file_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileDescriptorProto) */ {\n public:\n  FileDescriptorProto();\n  virtual ~FileDescriptorProto();\n\n  FileDescriptorProto(const FileDescriptorProto& from);\n\n  inline FileDescriptorProto& operator=(const FileDescriptorProto& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  FileDescriptorProto(FileDescriptorProto&& from) noexcept\n    : FileDescriptorProto() {\n    *this = ::std::move(from);\n  }\n\n  inline FileDescriptorProto& operator=(FileDescriptorProto&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const FileDescriptorProto& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const FileDescriptorProto* internal_default_instance() {\n    return reinterpret_cast<const FileDescriptorProto*>(\n               &_FileDescriptorProto_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    1;\n\n  void UnsafeArenaSwap(FileDescriptorProto* other);\n  void Swap(FileDescriptorProto* other);\n  friend void swap(FileDescriptorProto& a, FileDescriptorProto& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline FileDescriptorProto* New() const final {\n    return CreateMaybeMessage<FileDescriptorProto>(NULL);\n  }\n\n  FileDescriptorProto* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<FileDescriptorProto>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const FileDescriptorProto& from);\n  void MergeFrom(const FileDescriptorProto& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(FileDescriptorProto* other);\n  protected:\n  explicit FileDescriptorProto(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated string dependency = 3;\n  int dependency_size() const;\n  void clear_dependency();\n  static const int kDependencyFieldNumber = 3;\n  const ::std::string& dependency(int index) const;\n  ::std::string* mutable_dependency(int index);\n  void set_dependency(int index, const ::std::string& value);\n  #if LANG_CXX11\n  void set_dependency(int index, ::std::string&& value);\n  #endif\n  void set_dependency(int index, const char* value);\n  void set_dependency(int index, const char* value, size_t size);\n  ::std::string* add_dependency();\n  void add_dependency(const ::std::string& value);\n  #if LANG_CXX11\n  void add_dependency(::std::string&& value);\n  #endif\n  void add_dependency(const char* value);\n  void add_dependency(const char* value, size_t size);\n  const ::google::protobuf::RepeatedPtrField< ::std::string>& dependency() const;\n  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_dependency();\n\n  // repeated .google.protobuf.DescriptorProto message_type = 4;\n  int message_type_size() const;\n  void clear_message_type();\n  static const int kMessageTypeFieldNumber = 4;\n  ::google::protobuf::DescriptorProto* mutable_message_type(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >*\n      mutable_message_type();\n  const ::google::protobuf::DescriptorProto& message_type(int index) const;\n  ::google::protobuf::DescriptorProto* add_message_type();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >&\n      message_type() const;\n\n  // repeated .google.protobuf.EnumDescriptorProto enum_type = 5;\n  int enum_type_size() const;\n  void clear_enum_type();\n  static const int kEnumTypeFieldNumber = 5;\n  ::google::protobuf::EnumDescriptorProto* mutable_enum_type(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >*\n      mutable_enum_type();\n  const ::google::protobuf::EnumDescriptorProto& enum_type(int index) const;\n  ::google::protobuf::EnumDescriptorProto* add_enum_type();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >&\n      enum_type() const;\n\n  // repeated .google.protobuf.ServiceDescriptorProto service = 6;\n  int service_size() const;\n  void clear_service();\n  static const int kServiceFieldNumber = 6;\n  ::google::protobuf::ServiceDescriptorProto* mutable_service(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >*\n      mutable_service();\n  const ::google::protobuf::ServiceDescriptorProto& service(int index) const;\n  ::google::protobuf::ServiceDescriptorProto* add_service();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >&\n      service() const;\n\n  // repeated .google.protobuf.FieldDescriptorProto extension = 7;\n  int extension_size() const;\n  void clear_extension();\n  static const int kExtensionFieldNumber = 7;\n  ::google::protobuf::FieldDescriptorProto* mutable_extension(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*\n      mutable_extension();\n  const ::google::protobuf::FieldDescriptorProto& extension(int index) const;\n  ::google::protobuf::FieldDescriptorProto* add_extension();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&\n      extension() const;\n\n  // repeated int32 public_dependency = 10;\n  int public_dependency_size() const;\n  void clear_public_dependency();\n  static const int kPublicDependencyFieldNumber = 10;\n  ::google::protobuf::int32 public_dependency(int index) const;\n  void set_public_dependency(int index, ::google::protobuf::int32 value);\n  void add_public_dependency(::google::protobuf::int32 value);\n  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\n      public_dependency() const;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\n      mutable_public_dependency();\n\n  // repeated int32 weak_dependency = 11;\n  int weak_dependency_size() const;\n  void clear_weak_dependency();\n  static const int kWeakDependencyFieldNumber = 11;\n  ::google::protobuf::int32 weak_dependency(int index) const;\n  void set_weak_dependency(int index, ::google::protobuf::int32 value);\n  void add_weak_dependency(::google::protobuf::int32 value);\n  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\n      weak_dependency() const;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\n      mutable_weak_dependency();\n\n  // optional string name = 1;\n  bool has_name() const;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // optional string package = 2;\n  bool has_package() const;\n  void clear_package();\n  static const int kPackageFieldNumber = 2;\n  const ::std::string& package() const;\n  void set_package(const ::std::string& value);\n  #if LANG_CXX11\n  void set_package(::std::string&& value);\n  #endif\n  void set_package(const char* value);\n  void set_package(const char* value, size_t size);\n  ::std::string* mutable_package();\n  ::std::string* release_package();\n  void set_allocated_package(::std::string* package);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_package();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_package(\n      ::std::string* package);\n\n  // optional string syntax = 12;\n  bool has_syntax() const;\n  void clear_syntax();\n  static const int kSyntaxFieldNumber = 12;\n  const ::std::string& syntax() const;\n  void set_syntax(const ::std::string& value);\n  #if LANG_CXX11\n  void set_syntax(::std::string&& value);\n  #endif\n  void set_syntax(const char* value);\n  void set_syntax(const char* value, size_t size);\n  ::std::string* mutable_syntax();\n  ::std::string* release_syntax();\n  void set_allocated_syntax(::std::string* syntax);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_syntax();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_syntax(\n      ::std::string* syntax);\n\n  // optional .google.protobuf.FileOptions options = 8;\n  bool has_options() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 8;\n  private:\n  const ::google::protobuf::FileOptions& _internal_options() const;\n  public:\n  const ::google::protobuf::FileOptions& options() const;\n  ::google::protobuf::FileOptions* release_options();\n  ::google::protobuf::FileOptions* mutable_options();\n  void set_allocated_options(::google::protobuf::FileOptions* options);\n  void unsafe_arena_set_allocated_options(\n      ::google::protobuf::FileOptions* options);\n  ::google::protobuf::FileOptions* unsafe_arena_release_options();\n\n  // optional .google.protobuf.SourceCodeInfo source_code_info = 9;\n  bool has_source_code_info() const;\n  void clear_source_code_info();\n  static const int kSourceCodeInfoFieldNumber = 9;\n  private:\n  const ::google::protobuf::SourceCodeInfo& _internal_source_code_info() const;\n  public:\n  const ::google::protobuf::SourceCodeInfo& source_code_info() const;\n  ::google::protobuf::SourceCodeInfo* release_source_code_info();\n  ::google::protobuf::SourceCodeInfo* mutable_source_code_info();\n  void set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info);\n  void unsafe_arena_set_allocated_source_code_info(\n      ::google::protobuf::SourceCodeInfo* source_code_info);\n  ::google::protobuf::SourceCodeInfo* unsafe_arena_release_source_code_info();\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorProto)\n private:\n  void set_has_name();\n  void clear_has_name();\n  void set_has_package();\n  void clear_has_package();\n  void set_has_options();\n  void clear_has_options();\n  void set_has_source_code_info();\n  void clear_has_source_code_info();\n  void set_has_syntax();\n  void clear_has_syntax();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::std::string> dependency_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto > message_type_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto > enum_type_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto > service_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto > extension_;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > public_dependency_;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > weak_dependency_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::internal::ArenaStringPtr package_;\n  ::google::protobuf::internal::ArenaStringPtr syntax_;\n  ::google::protobuf::FileOptions* options_;\n  ::google::protobuf::SourceCodeInfo* source_code_info_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ExtensionRange) */ {\n public:\n  DescriptorProto_ExtensionRange();\n  virtual ~DescriptorProto_ExtensionRange();\n\n  DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from);\n\n  inline DescriptorProto_ExtensionRange& operator=(const DescriptorProto_ExtensionRange& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  DescriptorProto_ExtensionRange(DescriptorProto_ExtensionRange&& from) noexcept\n    : DescriptorProto_ExtensionRange() {\n    *this = ::std::move(from);\n  }\n\n  inline DescriptorProto_ExtensionRange& operator=(DescriptorProto_ExtensionRange&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const DescriptorProto_ExtensionRange& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const DescriptorProto_ExtensionRange* internal_default_instance() {\n    return reinterpret_cast<const DescriptorProto_ExtensionRange*>(\n               &_DescriptorProto_ExtensionRange_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    2;\n\n  void UnsafeArenaSwap(DescriptorProto_ExtensionRange* other);\n  void Swap(DescriptorProto_ExtensionRange* other);\n  friend void swap(DescriptorProto_ExtensionRange& a, DescriptorProto_ExtensionRange& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline DescriptorProto_ExtensionRange* New() const final {\n    return CreateMaybeMessage<DescriptorProto_ExtensionRange>(NULL);\n  }\n\n  DescriptorProto_ExtensionRange* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<DescriptorProto_ExtensionRange>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const DescriptorProto_ExtensionRange& from);\n  void MergeFrom(const DescriptorProto_ExtensionRange& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(DescriptorProto_ExtensionRange* other);\n  protected:\n  explicit DescriptorProto_ExtensionRange(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional .google.protobuf.ExtensionRangeOptions options = 3;\n  bool has_options() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 3;\n  private:\n  const ::google::protobuf::ExtensionRangeOptions& _internal_options() const;\n  public:\n  const ::google::protobuf::ExtensionRangeOptions& options() const;\n  ::google::protobuf::ExtensionRangeOptions* release_options();\n  ::google::protobuf::ExtensionRangeOptions* mutable_options();\n  void set_allocated_options(::google::protobuf::ExtensionRangeOptions* options);\n  void unsafe_arena_set_allocated_options(\n      ::google::protobuf::ExtensionRangeOptions* options);\n  ::google::protobuf::ExtensionRangeOptions* unsafe_arena_release_options();\n\n  // optional int32 start = 1;\n  bool has_start() const;\n  void clear_start();\n  static const int kStartFieldNumber = 1;\n  ::google::protobuf::int32 start() const;\n  void set_start(::google::protobuf::int32 value);\n\n  // optional int32 end = 2;\n  bool has_end() const;\n  void clear_end();\n  static const int kEndFieldNumber = 2;\n  ::google::protobuf::int32 end() const;\n  void set_end(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ExtensionRange)\n private:\n  void set_has_start();\n  void clear_has_start();\n  void set_has_end();\n  void clear_has_end();\n  void set_has_options();\n  void clear_has_options();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::ExtensionRangeOptions* options_;\n  ::google::protobuf::int32 start_;\n  ::google::protobuf::int32 end_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto.ReservedRange) */ {\n public:\n  DescriptorProto_ReservedRange();\n  virtual ~DescriptorProto_ReservedRange();\n\n  DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange& from);\n\n  inline DescriptorProto_ReservedRange& operator=(const DescriptorProto_ReservedRange& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  DescriptorProto_ReservedRange(DescriptorProto_ReservedRange&& from) noexcept\n    : DescriptorProto_ReservedRange() {\n    *this = ::std::move(from);\n  }\n\n  inline DescriptorProto_ReservedRange& operator=(DescriptorProto_ReservedRange&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const DescriptorProto_ReservedRange& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const DescriptorProto_ReservedRange* internal_default_instance() {\n    return reinterpret_cast<const DescriptorProto_ReservedRange*>(\n               &_DescriptorProto_ReservedRange_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    3;\n\n  void UnsafeArenaSwap(DescriptorProto_ReservedRange* other);\n  void Swap(DescriptorProto_ReservedRange* other);\n  friend void swap(DescriptorProto_ReservedRange& a, DescriptorProto_ReservedRange& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline DescriptorProto_ReservedRange* New() const final {\n    return CreateMaybeMessage<DescriptorProto_ReservedRange>(NULL);\n  }\n\n  DescriptorProto_ReservedRange* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<DescriptorProto_ReservedRange>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const DescriptorProto_ReservedRange& from);\n  void MergeFrom(const DescriptorProto_ReservedRange& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(DescriptorProto_ReservedRange* other);\n  protected:\n  explicit DescriptorProto_ReservedRange(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional int32 start = 1;\n  bool has_start() const;\n  void clear_start();\n  static const int kStartFieldNumber = 1;\n  ::google::protobuf::int32 start() const;\n  void set_start(::google::protobuf::int32 value);\n\n  // optional int32 end = 2;\n  bool has_end() const;\n  void clear_end();\n  static const int kEndFieldNumber = 2;\n  ::google::protobuf::int32 end() const;\n  void set_end(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ReservedRange)\n private:\n  void set_has_start();\n  void clear_has_start();\n  void set_has_end();\n  void clear_has_end();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::int32 start_;\n  ::google::protobuf::int32 end_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DescriptorProto) */ {\n public:\n  DescriptorProto();\n  virtual ~DescriptorProto();\n\n  DescriptorProto(const DescriptorProto& from);\n\n  inline DescriptorProto& operator=(const DescriptorProto& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  DescriptorProto(DescriptorProto&& from) noexcept\n    : DescriptorProto() {\n    *this = ::std::move(from);\n  }\n\n  inline DescriptorProto& operator=(DescriptorProto&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const DescriptorProto& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const DescriptorProto* internal_default_instance() {\n    return reinterpret_cast<const DescriptorProto*>(\n               &_DescriptorProto_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    4;\n\n  void UnsafeArenaSwap(DescriptorProto* other);\n  void Swap(DescriptorProto* other);\n  friend void swap(DescriptorProto& a, DescriptorProto& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline DescriptorProto* New() const final {\n    return CreateMaybeMessage<DescriptorProto>(NULL);\n  }\n\n  DescriptorProto* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<DescriptorProto>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const DescriptorProto& from);\n  void MergeFrom(const DescriptorProto& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(DescriptorProto* other);\n  protected:\n  explicit DescriptorProto(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef DescriptorProto_ExtensionRange ExtensionRange;\n  typedef DescriptorProto_ReservedRange ReservedRange;\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.FieldDescriptorProto field = 2;\n  int field_size() const;\n  void clear_field();\n  static const int kFieldFieldNumber = 2;\n  ::google::protobuf::FieldDescriptorProto* mutable_field(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*\n      mutable_field();\n  const ::google::protobuf::FieldDescriptorProto& field(int index) const;\n  ::google::protobuf::FieldDescriptorProto* add_field();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&\n      field() const;\n\n  // repeated .google.protobuf.DescriptorProto nested_type = 3;\n  int nested_type_size() const;\n  void clear_nested_type();\n  static const int kNestedTypeFieldNumber = 3;\n  ::google::protobuf::DescriptorProto* mutable_nested_type(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >*\n      mutable_nested_type();\n  const ::google::protobuf::DescriptorProto& nested_type(int index) const;\n  ::google::protobuf::DescriptorProto* add_nested_type();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >&\n      nested_type() const;\n\n  // repeated .google.protobuf.EnumDescriptorProto enum_type = 4;\n  int enum_type_size() const;\n  void clear_enum_type();\n  static const int kEnumTypeFieldNumber = 4;\n  ::google::protobuf::EnumDescriptorProto* mutable_enum_type(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >*\n      mutable_enum_type();\n  const ::google::protobuf::EnumDescriptorProto& enum_type(int index) const;\n  ::google::protobuf::EnumDescriptorProto* add_enum_type();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >&\n      enum_type() const;\n\n  // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;\n  int extension_range_size() const;\n  void clear_extension_range();\n  static const int kExtensionRangeFieldNumber = 5;\n  ::google::protobuf::DescriptorProto_ExtensionRange* mutable_extension_range(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >*\n      mutable_extension_range();\n  const ::google::protobuf::DescriptorProto_ExtensionRange& extension_range(int index) const;\n  ::google::protobuf::DescriptorProto_ExtensionRange* add_extension_range();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >&\n      extension_range() const;\n\n  // repeated .google.protobuf.FieldDescriptorProto extension = 6;\n  int extension_size() const;\n  void clear_extension();\n  static const int kExtensionFieldNumber = 6;\n  ::google::protobuf::FieldDescriptorProto* mutable_extension(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*\n      mutable_extension();\n  const ::google::protobuf::FieldDescriptorProto& extension(int index) const;\n  ::google::protobuf::FieldDescriptorProto* add_extension();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&\n      extension() const;\n\n  // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;\n  int oneof_decl_size() const;\n  void clear_oneof_decl();\n  static const int kOneofDeclFieldNumber = 8;\n  ::google::protobuf::OneofDescriptorProto* mutable_oneof_decl(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >*\n      mutable_oneof_decl();\n  const ::google::protobuf::OneofDescriptorProto& oneof_decl(int index) const;\n  ::google::protobuf::OneofDescriptorProto* add_oneof_decl();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >&\n      oneof_decl() const;\n\n  // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;\n  int reserved_range_size() const;\n  void clear_reserved_range();\n  static const int kReservedRangeFieldNumber = 9;\n  ::google::protobuf::DescriptorProto_ReservedRange* mutable_reserved_range(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >*\n      mutable_reserved_range();\n  const ::google::protobuf::DescriptorProto_ReservedRange& reserved_range(int index) const;\n  ::google::protobuf::DescriptorProto_ReservedRange* add_reserved_range();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >&\n      reserved_range() const;\n\n  // repeated string reserved_name = 10;\n  int reserved_name_size() const;\n  void clear_reserved_name();\n  static const int kReservedNameFieldNumber = 10;\n  const ::std::string& reserved_name(int index) const;\n  ::std::string* mutable_reserved_name(int index);\n  void set_reserved_name(int index, const ::std::string& value);\n  #if LANG_CXX11\n  void set_reserved_name(int index, ::std::string&& value);\n  #endif\n  void set_reserved_name(int index, const char* value);\n  void set_reserved_name(int index, const char* value, size_t size);\n  ::std::string* add_reserved_name();\n  void add_reserved_name(const ::std::string& value);\n  #if LANG_CXX11\n  void add_reserved_name(::std::string&& value);\n  #endif\n  void add_reserved_name(const char* value);\n  void add_reserved_name(const char* value, size_t size);\n  const ::google::protobuf::RepeatedPtrField< ::std::string>& reserved_name() const;\n  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_reserved_name();\n\n  // optional string name = 1;\n  bool has_name() const;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // optional .google.protobuf.MessageOptions options = 7;\n  bool has_options() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 7;\n  private:\n  const ::google::protobuf::MessageOptions& _internal_options() const;\n  public:\n  const ::google::protobuf::MessageOptions& options() const;\n  ::google::protobuf::MessageOptions* release_options();\n  ::google::protobuf::MessageOptions* mutable_options();\n  void set_allocated_options(::google::protobuf::MessageOptions* options);\n  void unsafe_arena_set_allocated_options(\n      ::google::protobuf::MessageOptions* options);\n  ::google::protobuf::MessageOptions* unsafe_arena_release_options();\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto)\n private:\n  void set_has_name();\n  void clear_has_name();\n  void set_has_options();\n  void clear_has_options();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto > field_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto > nested_type_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto > enum_type_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange > extension_range_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto > extension_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto > oneof_decl_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange > reserved_range_;\n  ::google::protobuf::RepeatedPtrField< ::std::string> reserved_name_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::MessageOptions* options_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT ExtensionRangeOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ExtensionRangeOptions) */ {\n public:\n  ExtensionRangeOptions();\n  virtual ~ExtensionRangeOptions();\n\n  ExtensionRangeOptions(const ExtensionRangeOptions& from);\n\n  inline ExtensionRangeOptions& operator=(const ExtensionRangeOptions& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  ExtensionRangeOptions(ExtensionRangeOptions&& from) noexcept\n    : ExtensionRangeOptions() {\n    *this = ::std::move(from);\n  }\n\n  inline ExtensionRangeOptions& operator=(ExtensionRangeOptions&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const ExtensionRangeOptions& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const ExtensionRangeOptions* internal_default_instance() {\n    return reinterpret_cast<const ExtensionRangeOptions*>(\n               &_ExtensionRangeOptions_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    5;\n\n  void UnsafeArenaSwap(ExtensionRangeOptions* other);\n  void Swap(ExtensionRangeOptions* other);\n  friend void swap(ExtensionRangeOptions& a, ExtensionRangeOptions& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline ExtensionRangeOptions* New() const final {\n    return CreateMaybeMessage<ExtensionRangeOptions>(NULL);\n  }\n\n  ExtensionRangeOptions* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<ExtensionRangeOptions>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const ExtensionRangeOptions& from);\n  void MergeFrom(const ExtensionRangeOptions& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(ExtensionRangeOptions* other);\n  protected:\n  explicit ExtensionRangeOptions(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\n  int uninterpreted_option_size() const;\n  void clear_uninterpreted_option();\n  static const int kUninterpretedOptionFieldNumber = 999;\n  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\n      mutable_uninterpreted_option();\n  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;\n  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\n      uninterpreted_option() const;\n\n  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ExtensionRangeOptions)\n  // @@protoc_insertion_point(class_scope:google.protobuf.ExtensionRangeOptions)\n private:\n\n  ::google::protobuf::internal::ExtensionSet _extensions_;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldDescriptorProto) */ {\n public:\n  FieldDescriptorProto();\n  virtual ~FieldDescriptorProto();\n\n  FieldDescriptorProto(const FieldDescriptorProto& from);\n\n  inline FieldDescriptorProto& operator=(const FieldDescriptorProto& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  FieldDescriptorProto(FieldDescriptorProto&& from) noexcept\n    : FieldDescriptorProto() {\n    *this = ::std::move(from);\n  }\n\n  inline FieldDescriptorProto& operator=(FieldDescriptorProto&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const FieldDescriptorProto& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const FieldDescriptorProto* internal_default_instance() {\n    return reinterpret_cast<const FieldDescriptorProto*>(\n               &_FieldDescriptorProto_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    6;\n\n  void UnsafeArenaSwap(FieldDescriptorProto* other);\n  void Swap(FieldDescriptorProto* other);\n  friend void swap(FieldDescriptorProto& a, FieldDescriptorProto& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline FieldDescriptorProto* New() const final {\n    return CreateMaybeMessage<FieldDescriptorProto>(NULL);\n  }\n\n  FieldDescriptorProto* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<FieldDescriptorProto>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const FieldDescriptorProto& from);\n  void MergeFrom(const FieldDescriptorProto& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(FieldDescriptorProto* other);\n  protected:\n  explicit FieldDescriptorProto(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef FieldDescriptorProto_Type Type;\n  static const Type TYPE_DOUBLE =\n    FieldDescriptorProto_Type_TYPE_DOUBLE;\n  static const Type TYPE_FLOAT =\n    FieldDescriptorProto_Type_TYPE_FLOAT;\n  static const Type TYPE_INT64 =\n    FieldDescriptorProto_Type_TYPE_INT64;\n  static const Type TYPE_UINT64 =\n    FieldDescriptorProto_Type_TYPE_UINT64;\n  static const Type TYPE_INT32 =\n    FieldDescriptorProto_Type_TYPE_INT32;\n  static const Type TYPE_FIXED64 =\n    FieldDescriptorProto_Type_TYPE_FIXED64;\n  static const Type TYPE_FIXED32 =\n    FieldDescriptorProto_Type_TYPE_FIXED32;\n  static const Type TYPE_BOOL =\n    FieldDescriptorProto_Type_TYPE_BOOL;\n  static const Type TYPE_STRING =\n    FieldDescriptorProto_Type_TYPE_STRING;\n  static const Type TYPE_GROUP =\n    FieldDescriptorProto_Type_TYPE_GROUP;\n  static const Type TYPE_MESSAGE =\n    FieldDescriptorProto_Type_TYPE_MESSAGE;\n  static const Type TYPE_BYTES =\n    FieldDescriptorProto_Type_TYPE_BYTES;\n  static const Type TYPE_UINT32 =\n    FieldDescriptorProto_Type_TYPE_UINT32;\n  static const Type TYPE_ENUM =\n    FieldDescriptorProto_Type_TYPE_ENUM;\n  static const Type TYPE_SFIXED32 =\n    FieldDescriptorProto_Type_TYPE_SFIXED32;\n  static const Type TYPE_SFIXED64 =\n    FieldDescriptorProto_Type_TYPE_SFIXED64;\n  static const Type TYPE_SINT32 =\n    FieldDescriptorProto_Type_TYPE_SINT32;\n  static const Type TYPE_SINT64 =\n    FieldDescriptorProto_Type_TYPE_SINT64;\n  static inline bool Type_IsValid(int value) {\n    return FieldDescriptorProto_Type_IsValid(value);\n  }\n  static const Type Type_MIN =\n    FieldDescriptorProto_Type_Type_MIN;\n  static const Type Type_MAX =\n    FieldDescriptorProto_Type_Type_MAX;\n  static const int Type_ARRAYSIZE =\n    FieldDescriptorProto_Type_Type_ARRAYSIZE;\n  static inline const ::google::protobuf::EnumDescriptor*\n  Type_descriptor() {\n    return FieldDescriptorProto_Type_descriptor();\n  }\n  static inline const ::std::string& Type_Name(Type value) {\n    return FieldDescriptorProto_Type_Name(value);\n  }\n  static inline bool Type_Parse(const ::std::string& name,\n      Type* value) {\n    return FieldDescriptorProto_Type_Parse(name, value);\n  }\n\n  typedef FieldDescriptorProto_Label Label;\n  static const Label LABEL_OPTIONAL =\n    FieldDescriptorProto_Label_LABEL_OPTIONAL;\n  static const Label LABEL_REQUIRED =\n    FieldDescriptorProto_Label_LABEL_REQUIRED;\n  static const Label LABEL_REPEATED =\n    FieldDescriptorProto_Label_LABEL_REPEATED;\n  static inline bool Label_IsValid(int value) {\n    return FieldDescriptorProto_Label_IsValid(value);\n  }\n  static const Label Label_MIN =\n    FieldDescriptorProto_Label_Label_MIN;\n  static const Label Label_MAX =\n    FieldDescriptorProto_Label_Label_MAX;\n  static const int Label_ARRAYSIZE =\n    FieldDescriptorProto_Label_Label_ARRAYSIZE;\n  static inline const ::google::protobuf::EnumDescriptor*\n  Label_descriptor() {\n    return FieldDescriptorProto_Label_descriptor();\n  }\n  static inline const ::std::string& Label_Name(Label value) {\n    return FieldDescriptorProto_Label_Name(value);\n  }\n  static inline bool Label_Parse(const ::std::string& name,\n      Label* value) {\n    return FieldDescriptorProto_Label_Parse(name, value);\n  }\n\n  // accessors -------------------------------------------------------\n\n  // optional string name = 1;\n  bool has_name() const;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // optional string extendee = 2;\n  bool has_extendee() const;\n  void clear_extendee();\n  static const int kExtendeeFieldNumber = 2;\n  const ::std::string& extendee() const;\n  void set_extendee(const ::std::string& value);\n  #if LANG_CXX11\n  void set_extendee(::std::string&& value);\n  #endif\n  void set_extendee(const char* value);\n  void set_extendee(const char* value, size_t size);\n  ::std::string* mutable_extendee();\n  ::std::string* release_extendee();\n  void set_allocated_extendee(::std::string* extendee);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_extendee();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_extendee(\n      ::std::string* extendee);\n\n  // optional string type_name = 6;\n  bool has_type_name() const;\n  void clear_type_name();\n  static const int kTypeNameFieldNumber = 6;\n  const ::std::string& type_name() const;\n  void set_type_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_type_name(::std::string&& value);\n  #endif\n  void set_type_name(const char* value);\n  void set_type_name(const char* value, size_t size);\n  ::std::string* mutable_type_name();\n  ::std::string* release_type_name();\n  void set_allocated_type_name(::std::string* type_name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_type_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_type_name(\n      ::std::string* type_name);\n\n  // optional string default_value = 7;\n  bool has_default_value() const;\n  void clear_default_value();\n  static const int kDefaultValueFieldNumber = 7;\n  const ::std::string& default_value() const;\n  void set_default_value(const ::std::string& value);\n  #if LANG_CXX11\n  void set_default_value(::std::string&& value);\n  #endif\n  void set_default_value(const char* value);\n  void set_default_value(const char* value, size_t size);\n  ::std::string* mutable_default_value();\n  ::std::string* release_default_value();\n  void set_allocated_default_value(::std::string* default_value);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_default_value();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_default_value(\n      ::std::string* default_value);\n\n  // optional string json_name = 10;\n  bool has_json_name() const;\n  void clear_json_name();\n  static const int kJsonNameFieldNumber = 10;\n  const ::std::string& json_name() const;\n  void set_json_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_json_name(::std::string&& value);\n  #endif\n  void set_json_name(const char* value);\n  void set_json_name(const char* value, size_t size);\n  ::std::string* mutable_json_name();\n  ::std::string* release_json_name();\n  void set_allocated_json_name(::std::string* json_name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_json_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_json_name(\n      ::std::string* json_name);\n\n  // optional .google.protobuf.FieldOptions options = 8;\n  bool has_options() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 8;\n  private:\n  const ::google::protobuf::FieldOptions& _internal_options() const;\n  public:\n  const ::google::protobuf::FieldOptions& options() const;\n  ::google::protobuf::FieldOptions* release_options();\n  ::google::protobuf::FieldOptions* mutable_options();\n  void set_allocated_options(::google::protobuf::FieldOptions* options);\n  void unsafe_arena_set_allocated_options(\n      ::google::protobuf::FieldOptions* options);\n  ::google::protobuf::FieldOptions* unsafe_arena_release_options();\n\n  // optional int32 number = 3;\n  bool has_number() const;\n  void clear_number();\n  static const int kNumberFieldNumber = 3;\n  ::google::protobuf::int32 number() const;\n  void set_number(::google::protobuf::int32 value);\n\n  // optional int32 oneof_index = 9;\n  bool has_oneof_index() const;\n  void clear_oneof_index();\n  static const int kOneofIndexFieldNumber = 9;\n  ::google::protobuf::int32 oneof_index() const;\n  void set_oneof_index(::google::protobuf::int32 value);\n\n  // optional .google.protobuf.FieldDescriptorProto.Label label = 4;\n  bool has_label() const;\n  void clear_label();\n  static const int kLabelFieldNumber = 4;\n  ::google::protobuf::FieldDescriptorProto_Label label() const;\n  void set_label(::google::protobuf::FieldDescriptorProto_Label value);\n\n  // optional .google.protobuf.FieldDescriptorProto.Type type = 5;\n  bool has_type() const;\n  void clear_type();\n  static const int kTypeFieldNumber = 5;\n  ::google::protobuf::FieldDescriptorProto_Type type() const;\n  void set_type(::google::protobuf::FieldDescriptorProto_Type value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.FieldDescriptorProto)\n private:\n  void set_has_name();\n  void clear_has_name();\n  void set_has_number();\n  void clear_has_number();\n  void set_has_label();\n  void clear_has_label();\n  void set_has_type();\n  void clear_has_type();\n  void set_has_type_name();\n  void clear_has_type_name();\n  void set_has_extendee();\n  void clear_has_extendee();\n  void set_has_default_value();\n  void clear_has_default_value();\n  void set_has_oneof_index();\n  void clear_has_oneof_index();\n  void set_has_json_name();\n  void clear_has_json_name();\n  void set_has_options();\n  void clear_has_options();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::internal::ArenaStringPtr extendee_;\n  ::google::protobuf::internal::ArenaStringPtr type_name_;\n  ::google::protobuf::internal::ArenaStringPtr default_value_;\n  ::google::protobuf::internal::ArenaStringPtr json_name_;\n  ::google::protobuf::FieldOptions* options_;\n  ::google::protobuf::int32 number_;\n  ::google::protobuf::int32 oneof_index_;\n  int label_;\n  int type_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofDescriptorProto) */ {\n public:\n  OneofDescriptorProto();\n  virtual ~OneofDescriptorProto();\n\n  OneofDescriptorProto(const OneofDescriptorProto& from);\n\n  inline OneofDescriptorProto& operator=(const OneofDescriptorProto& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  OneofDescriptorProto(OneofDescriptorProto&& from) noexcept\n    : OneofDescriptorProto() {\n    *this = ::std::move(from);\n  }\n\n  inline OneofDescriptorProto& operator=(OneofDescriptorProto&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const OneofDescriptorProto& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const OneofDescriptorProto* internal_default_instance() {\n    return reinterpret_cast<const OneofDescriptorProto*>(\n               &_OneofDescriptorProto_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    7;\n\n  void UnsafeArenaSwap(OneofDescriptorProto* other);\n  void Swap(OneofDescriptorProto* other);\n  friend void swap(OneofDescriptorProto& a, OneofDescriptorProto& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline OneofDescriptorProto* New() const final {\n    return CreateMaybeMessage<OneofDescriptorProto>(NULL);\n  }\n\n  OneofDescriptorProto* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<OneofDescriptorProto>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const OneofDescriptorProto& from);\n  void MergeFrom(const OneofDescriptorProto& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(OneofDescriptorProto* other);\n  protected:\n  explicit OneofDescriptorProto(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional string name = 1;\n  bool has_name() const;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // optional .google.protobuf.OneofOptions options = 2;\n  bool has_options() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 2;\n  private:\n  const ::google::protobuf::OneofOptions& _internal_options() const;\n  public:\n  const ::google::protobuf::OneofOptions& options() const;\n  ::google::protobuf::OneofOptions* release_options();\n  ::google::protobuf::OneofOptions* mutable_options();\n  void set_allocated_options(::google::protobuf::OneofOptions* options);\n  void unsafe_arena_set_allocated_options(\n      ::google::protobuf::OneofOptions* options);\n  ::google::protobuf::OneofOptions* unsafe_arena_release_options();\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.OneofDescriptorProto)\n private:\n  void set_has_name();\n  void clear_has_name();\n  void set_has_options();\n  void clear_has_options();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::OneofOptions* options_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto.EnumReservedRange) */ {\n public:\n  EnumDescriptorProto_EnumReservedRange();\n  virtual ~EnumDescriptorProto_EnumReservedRange();\n\n  EnumDescriptorProto_EnumReservedRange(const EnumDescriptorProto_EnumReservedRange& from);\n\n  inline EnumDescriptorProto_EnumReservedRange& operator=(const EnumDescriptorProto_EnumReservedRange& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  EnumDescriptorProto_EnumReservedRange(EnumDescriptorProto_EnumReservedRange&& from) noexcept\n    : EnumDescriptorProto_EnumReservedRange() {\n    *this = ::std::move(from);\n  }\n\n  inline EnumDescriptorProto_EnumReservedRange& operator=(EnumDescriptorProto_EnumReservedRange&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const EnumDescriptorProto_EnumReservedRange& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const EnumDescriptorProto_EnumReservedRange* internal_default_instance() {\n    return reinterpret_cast<const EnumDescriptorProto_EnumReservedRange*>(\n               &_EnumDescriptorProto_EnumReservedRange_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    8;\n\n  void UnsafeArenaSwap(EnumDescriptorProto_EnumReservedRange* other);\n  void Swap(EnumDescriptorProto_EnumReservedRange* other);\n  friend void swap(EnumDescriptorProto_EnumReservedRange& a, EnumDescriptorProto_EnumReservedRange& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline EnumDescriptorProto_EnumReservedRange* New() const final {\n    return CreateMaybeMessage<EnumDescriptorProto_EnumReservedRange>(NULL);\n  }\n\n  EnumDescriptorProto_EnumReservedRange* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<EnumDescriptorProto_EnumReservedRange>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const EnumDescriptorProto_EnumReservedRange& from);\n  void MergeFrom(const EnumDescriptorProto_EnumReservedRange& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(EnumDescriptorProto_EnumReservedRange* other);\n  protected:\n  explicit EnumDescriptorProto_EnumReservedRange(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional int32 start = 1;\n  bool has_start() const;\n  void clear_start();\n  static const int kStartFieldNumber = 1;\n  ::google::protobuf::int32 start() const;\n  void set_start(::google::protobuf::int32 value);\n\n  // optional int32 end = 2;\n  bool has_end() const;\n  void clear_end();\n  static const int kEndFieldNumber = 2;\n  ::google::protobuf::int32 end() const;\n  void set_end(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto.EnumReservedRange)\n private:\n  void set_has_start();\n  void clear_has_start();\n  void set_has_end();\n  void clear_has_end();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::int32 start_;\n  ::google::protobuf::int32 end_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumDescriptorProto) */ {\n public:\n  EnumDescriptorProto();\n  virtual ~EnumDescriptorProto();\n\n  EnumDescriptorProto(const EnumDescriptorProto& from);\n\n  inline EnumDescriptorProto& operator=(const EnumDescriptorProto& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  EnumDescriptorProto(EnumDescriptorProto&& from) noexcept\n    : EnumDescriptorProto() {\n    *this = ::std::move(from);\n  }\n\n  inline EnumDescriptorProto& operator=(EnumDescriptorProto&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const EnumDescriptorProto& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const EnumDescriptorProto* internal_default_instance() {\n    return reinterpret_cast<const EnumDescriptorProto*>(\n               &_EnumDescriptorProto_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    9;\n\n  void UnsafeArenaSwap(EnumDescriptorProto* other);\n  void Swap(EnumDescriptorProto* other);\n  friend void swap(EnumDescriptorProto& a, EnumDescriptorProto& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline EnumDescriptorProto* New() const final {\n    return CreateMaybeMessage<EnumDescriptorProto>(NULL);\n  }\n\n  EnumDescriptorProto* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<EnumDescriptorProto>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const EnumDescriptorProto& from);\n  void MergeFrom(const EnumDescriptorProto& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(EnumDescriptorProto* other);\n  protected:\n  explicit EnumDescriptorProto(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef EnumDescriptorProto_EnumReservedRange EnumReservedRange;\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.EnumValueDescriptorProto value = 2;\n  int value_size() const;\n  void clear_value();\n  static const int kValueFieldNumber = 2;\n  ::google::protobuf::EnumValueDescriptorProto* mutable_value(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >*\n      mutable_value();\n  const ::google::protobuf::EnumValueDescriptorProto& value(int index) const;\n  ::google::protobuf::EnumValueDescriptorProto* add_value();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >&\n      value() const;\n\n  // repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;\n  int reserved_range_size() const;\n  void clear_reserved_range();\n  static const int kReservedRangeFieldNumber = 4;\n  ::google::protobuf::EnumDescriptorProto_EnumReservedRange* mutable_reserved_range(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >*\n      mutable_reserved_range();\n  const ::google::protobuf::EnumDescriptorProto_EnumReservedRange& reserved_range(int index) const;\n  ::google::protobuf::EnumDescriptorProto_EnumReservedRange* add_reserved_range();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >&\n      reserved_range() const;\n\n  // repeated string reserved_name = 5;\n  int reserved_name_size() const;\n  void clear_reserved_name();\n  static const int kReservedNameFieldNumber = 5;\n  const ::std::string& reserved_name(int index) const;\n  ::std::string* mutable_reserved_name(int index);\n  void set_reserved_name(int index, const ::std::string& value);\n  #if LANG_CXX11\n  void set_reserved_name(int index, ::std::string&& value);\n  #endif\n  void set_reserved_name(int index, const char* value);\n  void set_reserved_name(int index, const char* value, size_t size);\n  ::std::string* add_reserved_name();\n  void add_reserved_name(const ::std::string& value);\n  #if LANG_CXX11\n  void add_reserved_name(::std::string&& value);\n  #endif\n  void add_reserved_name(const char* value);\n  void add_reserved_name(const char* value, size_t size);\n  const ::google::protobuf::RepeatedPtrField< ::std::string>& reserved_name() const;\n  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_reserved_name();\n\n  // optional string name = 1;\n  bool has_name() const;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // optional .google.protobuf.EnumOptions options = 3;\n  bool has_options() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 3;\n  private:\n  const ::google::protobuf::EnumOptions& _internal_options() const;\n  public:\n  const ::google::protobuf::EnumOptions& options() const;\n  ::google::protobuf::EnumOptions* release_options();\n  ::google::protobuf::EnumOptions* mutable_options();\n  void set_allocated_options(::google::protobuf::EnumOptions* options);\n  void unsafe_arena_set_allocated_options(\n      ::google::protobuf::EnumOptions* options);\n  ::google::protobuf::EnumOptions* unsafe_arena_release_options();\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto)\n private:\n  void set_has_name();\n  void clear_has_name();\n  void set_has_options();\n  void clear_has_options();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto > value_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange > reserved_range_;\n  ::google::protobuf::RepeatedPtrField< ::std::string> reserved_name_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::EnumOptions* options_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueDescriptorProto) */ {\n public:\n  EnumValueDescriptorProto();\n  virtual ~EnumValueDescriptorProto();\n\n  EnumValueDescriptorProto(const EnumValueDescriptorProto& from);\n\n  inline EnumValueDescriptorProto& operator=(const EnumValueDescriptorProto& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  EnumValueDescriptorProto(EnumValueDescriptorProto&& from) noexcept\n    : EnumValueDescriptorProto() {\n    *this = ::std::move(from);\n  }\n\n  inline EnumValueDescriptorProto& operator=(EnumValueDescriptorProto&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const EnumValueDescriptorProto& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const EnumValueDescriptorProto* internal_default_instance() {\n    return reinterpret_cast<const EnumValueDescriptorProto*>(\n               &_EnumValueDescriptorProto_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    10;\n\n  void UnsafeArenaSwap(EnumValueDescriptorProto* other);\n  void Swap(EnumValueDescriptorProto* other);\n  friend void swap(EnumValueDescriptorProto& a, EnumValueDescriptorProto& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline EnumValueDescriptorProto* New() const final {\n    return CreateMaybeMessage<EnumValueDescriptorProto>(NULL);\n  }\n\n  EnumValueDescriptorProto* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<EnumValueDescriptorProto>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const EnumValueDescriptorProto& from);\n  void MergeFrom(const EnumValueDescriptorProto& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(EnumValueDescriptorProto* other);\n  protected:\n  explicit EnumValueDescriptorProto(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional string name = 1;\n  bool has_name() const;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // optional .google.protobuf.EnumValueOptions options = 3;\n  bool has_options() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 3;\n  private:\n  const ::google::protobuf::EnumValueOptions& _internal_options() const;\n  public:\n  const ::google::protobuf::EnumValueOptions& options() const;\n  ::google::protobuf::EnumValueOptions* release_options();\n  ::google::protobuf::EnumValueOptions* mutable_options();\n  void set_allocated_options(::google::protobuf::EnumValueOptions* options);\n  void unsafe_arena_set_allocated_options(\n      ::google::protobuf::EnumValueOptions* options);\n  ::google::protobuf::EnumValueOptions* unsafe_arena_release_options();\n\n  // optional int32 number = 2;\n  bool has_number() const;\n  void clear_number();\n  static const int kNumberFieldNumber = 2;\n  ::google::protobuf::int32 number() const;\n  void set_number(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueDescriptorProto)\n private:\n  void set_has_name();\n  void clear_has_name();\n  void set_has_number();\n  void clear_has_number();\n  void set_has_options();\n  void clear_has_options();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::EnumValueOptions* options_;\n  ::google::protobuf::int32 number_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceDescriptorProto) */ {\n public:\n  ServiceDescriptorProto();\n  virtual ~ServiceDescriptorProto();\n\n  ServiceDescriptorProto(const ServiceDescriptorProto& from);\n\n  inline ServiceDescriptorProto& operator=(const ServiceDescriptorProto& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  ServiceDescriptorProto(ServiceDescriptorProto&& from) noexcept\n    : ServiceDescriptorProto() {\n    *this = ::std::move(from);\n  }\n\n  inline ServiceDescriptorProto& operator=(ServiceDescriptorProto&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const ServiceDescriptorProto& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const ServiceDescriptorProto* internal_default_instance() {\n    return reinterpret_cast<const ServiceDescriptorProto*>(\n               &_ServiceDescriptorProto_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    11;\n\n  void UnsafeArenaSwap(ServiceDescriptorProto* other);\n  void Swap(ServiceDescriptorProto* other);\n  friend void swap(ServiceDescriptorProto& a, ServiceDescriptorProto& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline ServiceDescriptorProto* New() const final {\n    return CreateMaybeMessage<ServiceDescriptorProto>(NULL);\n  }\n\n  ServiceDescriptorProto* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<ServiceDescriptorProto>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const ServiceDescriptorProto& from);\n  void MergeFrom(const ServiceDescriptorProto& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(ServiceDescriptorProto* other);\n  protected:\n  explicit ServiceDescriptorProto(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.MethodDescriptorProto method = 2;\n  int method_size() const;\n  void clear_method();\n  static const int kMethodFieldNumber = 2;\n  ::google::protobuf::MethodDescriptorProto* mutable_method(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >*\n      mutable_method();\n  const ::google::protobuf::MethodDescriptorProto& method(int index) const;\n  ::google::protobuf::MethodDescriptorProto* add_method();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >&\n      method() const;\n\n  // optional string name = 1;\n  bool has_name() const;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // optional .google.protobuf.ServiceOptions options = 3;\n  bool has_options() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 3;\n  private:\n  const ::google::protobuf::ServiceOptions& _internal_options() const;\n  public:\n  const ::google::protobuf::ServiceOptions& options() const;\n  ::google::protobuf::ServiceOptions* release_options();\n  ::google::protobuf::ServiceOptions* mutable_options();\n  void set_allocated_options(::google::protobuf::ServiceOptions* options);\n  void unsafe_arena_set_allocated_options(\n      ::google::protobuf::ServiceOptions* options);\n  ::google::protobuf::ServiceOptions* unsafe_arena_release_options();\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.ServiceDescriptorProto)\n private:\n  void set_has_name();\n  void clear_has_name();\n  void set_has_options();\n  void clear_has_options();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto > method_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::ServiceOptions* options_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodDescriptorProto) */ {\n public:\n  MethodDescriptorProto();\n  virtual ~MethodDescriptorProto();\n\n  MethodDescriptorProto(const MethodDescriptorProto& from);\n\n  inline MethodDescriptorProto& operator=(const MethodDescriptorProto& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  MethodDescriptorProto(MethodDescriptorProto&& from) noexcept\n    : MethodDescriptorProto() {\n    *this = ::std::move(from);\n  }\n\n  inline MethodDescriptorProto& operator=(MethodDescriptorProto&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const MethodDescriptorProto& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const MethodDescriptorProto* internal_default_instance() {\n    return reinterpret_cast<const MethodDescriptorProto*>(\n               &_MethodDescriptorProto_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    12;\n\n  void UnsafeArenaSwap(MethodDescriptorProto* other);\n  void Swap(MethodDescriptorProto* other);\n  friend void swap(MethodDescriptorProto& a, MethodDescriptorProto& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline MethodDescriptorProto* New() const final {\n    return CreateMaybeMessage<MethodDescriptorProto>(NULL);\n  }\n\n  MethodDescriptorProto* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<MethodDescriptorProto>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const MethodDescriptorProto& from);\n  void MergeFrom(const MethodDescriptorProto& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(MethodDescriptorProto* other);\n  protected:\n  explicit MethodDescriptorProto(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // optional string name = 1;\n  bool has_name() const;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // optional string input_type = 2;\n  bool has_input_type() const;\n  void clear_input_type();\n  static const int kInputTypeFieldNumber = 2;\n  const ::std::string& input_type() const;\n  void set_input_type(const ::std::string& value);\n  #if LANG_CXX11\n  void set_input_type(::std::string&& value);\n  #endif\n  void set_input_type(const char* value);\n  void set_input_type(const char* value, size_t size);\n  ::std::string* mutable_input_type();\n  ::std::string* release_input_type();\n  void set_allocated_input_type(::std::string* input_type);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_input_type();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_input_type(\n      ::std::string* input_type);\n\n  // optional string output_type = 3;\n  bool has_output_type() const;\n  void clear_output_type();\n  static const int kOutputTypeFieldNumber = 3;\n  const ::std::string& output_type() const;\n  void set_output_type(const ::std::string& value);\n  #if LANG_CXX11\n  void set_output_type(::std::string&& value);\n  #endif\n  void set_output_type(const char* value);\n  void set_output_type(const char* value, size_t size);\n  ::std::string* mutable_output_type();\n  ::std::string* release_output_type();\n  void set_allocated_output_type(::std::string* output_type);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_output_type();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_output_type(\n      ::std::string* output_type);\n\n  // optional .google.protobuf.MethodOptions options = 4;\n  bool has_options() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 4;\n  private:\n  const ::google::protobuf::MethodOptions& _internal_options() const;\n  public:\n  const ::google::protobuf::MethodOptions& options() const;\n  ::google::protobuf::MethodOptions* release_options();\n  ::google::protobuf::MethodOptions* mutable_options();\n  void set_allocated_options(::google::protobuf::MethodOptions* options);\n  void unsafe_arena_set_allocated_options(\n      ::google::protobuf::MethodOptions* options);\n  ::google::protobuf::MethodOptions* unsafe_arena_release_options();\n\n  // optional bool client_streaming = 5 [default = false];\n  bool has_client_streaming() const;\n  void clear_client_streaming();\n  static const int kClientStreamingFieldNumber = 5;\n  bool client_streaming() const;\n  void set_client_streaming(bool value);\n\n  // optional bool server_streaming = 6 [default = false];\n  bool has_server_streaming() const;\n  void clear_server_streaming();\n  static const int kServerStreamingFieldNumber = 6;\n  bool server_streaming() const;\n  void set_server_streaming(bool value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.MethodDescriptorProto)\n private:\n  void set_has_name();\n  void clear_has_name();\n  void set_has_input_type();\n  void clear_has_input_type();\n  void set_has_output_type();\n  void clear_has_output_type();\n  void set_has_options();\n  void clear_has_options();\n  void set_has_client_streaming();\n  void clear_has_client_streaming();\n  void set_has_server_streaming();\n  void clear_has_server_streaming();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::internal::ArenaStringPtr input_type_;\n  ::google::protobuf::internal::ArenaStringPtr output_type_;\n  ::google::protobuf::MethodOptions* options_;\n  bool client_streaming_;\n  bool server_streaming_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FileOptions) */ {\n public:\n  FileOptions();\n  virtual ~FileOptions();\n\n  FileOptions(const FileOptions& from);\n\n  inline FileOptions& operator=(const FileOptions& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  FileOptions(FileOptions&& from) noexcept\n    : FileOptions() {\n    *this = ::std::move(from);\n  }\n\n  inline FileOptions& operator=(FileOptions&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const FileOptions& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const FileOptions* internal_default_instance() {\n    return reinterpret_cast<const FileOptions*>(\n               &_FileOptions_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    13;\n\n  void UnsafeArenaSwap(FileOptions* other);\n  void Swap(FileOptions* other);\n  friend void swap(FileOptions& a, FileOptions& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline FileOptions* New() const final {\n    return CreateMaybeMessage<FileOptions>(NULL);\n  }\n\n  FileOptions* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<FileOptions>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const FileOptions& from);\n  void MergeFrom(const FileOptions& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(FileOptions* other);\n  protected:\n  explicit FileOptions(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef FileOptions_OptimizeMode OptimizeMode;\n  static const OptimizeMode SPEED =\n    FileOptions_OptimizeMode_SPEED;\n  static const OptimizeMode CODE_SIZE =\n    FileOptions_OptimizeMode_CODE_SIZE;\n  static const OptimizeMode LITE_RUNTIME =\n    FileOptions_OptimizeMode_LITE_RUNTIME;\n  static inline bool OptimizeMode_IsValid(int value) {\n    return FileOptions_OptimizeMode_IsValid(value);\n  }\n  static const OptimizeMode OptimizeMode_MIN =\n    FileOptions_OptimizeMode_OptimizeMode_MIN;\n  static const OptimizeMode OptimizeMode_MAX =\n    FileOptions_OptimizeMode_OptimizeMode_MAX;\n  static const int OptimizeMode_ARRAYSIZE =\n    FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE;\n  static inline const ::google::protobuf::EnumDescriptor*\n  OptimizeMode_descriptor() {\n    return FileOptions_OptimizeMode_descriptor();\n  }\n  static inline const ::std::string& OptimizeMode_Name(OptimizeMode value) {\n    return FileOptions_OptimizeMode_Name(value);\n  }\n  static inline bool OptimizeMode_Parse(const ::std::string& name,\n      OptimizeMode* value) {\n    return FileOptions_OptimizeMode_Parse(name, value);\n  }\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\n  int uninterpreted_option_size() const;\n  void clear_uninterpreted_option();\n  static const int kUninterpretedOptionFieldNumber = 999;\n  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\n      mutable_uninterpreted_option();\n  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;\n  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\n      uninterpreted_option() const;\n\n  // optional string java_package = 1;\n  bool has_java_package() const;\n  void clear_java_package();\n  static const int kJavaPackageFieldNumber = 1;\n  const ::std::string& java_package() const;\n  void set_java_package(const ::std::string& value);\n  #if LANG_CXX11\n  void set_java_package(::std::string&& value);\n  #endif\n  void set_java_package(const char* value);\n  void set_java_package(const char* value, size_t size);\n  ::std::string* mutable_java_package();\n  ::std::string* release_java_package();\n  void set_allocated_java_package(::std::string* java_package);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_java_package();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_java_package(\n      ::std::string* java_package);\n\n  // optional string java_outer_classname = 8;\n  bool has_java_outer_classname() const;\n  void clear_java_outer_classname();\n  static const int kJavaOuterClassnameFieldNumber = 8;\n  const ::std::string& java_outer_classname() const;\n  void set_java_outer_classname(const ::std::string& value);\n  #if LANG_CXX11\n  void set_java_outer_classname(::std::string&& value);\n  #endif\n  void set_java_outer_classname(const char* value);\n  void set_java_outer_classname(const char* value, size_t size);\n  ::std::string* mutable_java_outer_classname();\n  ::std::string* release_java_outer_classname();\n  void set_allocated_java_outer_classname(::std::string* java_outer_classname);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_java_outer_classname();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_java_outer_classname(\n      ::std::string* java_outer_classname);\n\n  // optional string go_package = 11;\n  bool has_go_package() const;\n  void clear_go_package();\n  static const int kGoPackageFieldNumber = 11;\n  const ::std::string& go_package() const;\n  void set_go_package(const ::std::string& value);\n  #if LANG_CXX11\n  void set_go_package(::std::string&& value);\n  #endif\n  void set_go_package(const char* value);\n  void set_go_package(const char* value, size_t size);\n  ::std::string* mutable_go_package();\n  ::std::string* release_go_package();\n  void set_allocated_go_package(::std::string* go_package);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_go_package();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_go_package(\n      ::std::string* go_package);\n\n  // optional string objc_class_prefix = 36;\n  bool has_objc_class_prefix() const;\n  void clear_objc_class_prefix();\n  static const int kObjcClassPrefixFieldNumber = 36;\n  const ::std::string& objc_class_prefix() const;\n  void set_objc_class_prefix(const ::std::string& value);\n  #if LANG_CXX11\n  void set_objc_class_prefix(::std::string&& value);\n  #endif\n  void set_objc_class_prefix(const char* value);\n  void set_objc_class_prefix(const char* value, size_t size);\n  ::std::string* mutable_objc_class_prefix();\n  ::std::string* release_objc_class_prefix();\n  void set_allocated_objc_class_prefix(::std::string* objc_class_prefix);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_objc_class_prefix();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_objc_class_prefix(\n      ::std::string* objc_class_prefix);\n\n  // optional string csharp_namespace = 37;\n  bool has_csharp_namespace() const;\n  void clear_csharp_namespace();\n  static const int kCsharpNamespaceFieldNumber = 37;\n  const ::std::string& csharp_namespace() const;\n  void set_csharp_namespace(const ::std::string& value);\n  #if LANG_CXX11\n  void set_csharp_namespace(::std::string&& value);\n  #endif\n  void set_csharp_namespace(const char* value);\n  void set_csharp_namespace(const char* value, size_t size);\n  ::std::string* mutable_csharp_namespace();\n  ::std::string* release_csharp_namespace();\n  void set_allocated_csharp_namespace(::std::string* csharp_namespace);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_csharp_namespace();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_csharp_namespace(\n      ::std::string* csharp_namespace);\n\n  // optional string swift_prefix = 39;\n  bool has_swift_prefix() const;\n  void clear_swift_prefix();\n  static const int kSwiftPrefixFieldNumber = 39;\n  const ::std::string& swift_prefix() const;\n  void set_swift_prefix(const ::std::string& value);\n  #if LANG_CXX11\n  void set_swift_prefix(::std::string&& value);\n  #endif\n  void set_swift_prefix(const char* value);\n  void set_swift_prefix(const char* value, size_t size);\n  ::std::string* mutable_swift_prefix();\n  ::std::string* release_swift_prefix();\n  void set_allocated_swift_prefix(::std::string* swift_prefix);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_swift_prefix();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_swift_prefix(\n      ::std::string* swift_prefix);\n\n  // optional string php_class_prefix = 40;\n  bool has_php_class_prefix() const;\n  void clear_php_class_prefix();\n  static const int kPhpClassPrefixFieldNumber = 40;\n  const ::std::string& php_class_prefix() const;\n  void set_php_class_prefix(const ::std::string& value);\n  #if LANG_CXX11\n  void set_php_class_prefix(::std::string&& value);\n  #endif\n  void set_php_class_prefix(const char* value);\n  void set_php_class_prefix(const char* value, size_t size);\n  ::std::string* mutable_php_class_prefix();\n  ::std::string* release_php_class_prefix();\n  void set_allocated_php_class_prefix(::std::string* php_class_prefix);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_php_class_prefix();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_php_class_prefix(\n      ::std::string* php_class_prefix);\n\n  // optional string php_namespace = 41;\n  bool has_php_namespace() const;\n  void clear_php_namespace();\n  static const int kPhpNamespaceFieldNumber = 41;\n  const ::std::string& php_namespace() const;\n  void set_php_namespace(const ::std::string& value);\n  #if LANG_CXX11\n  void set_php_namespace(::std::string&& value);\n  #endif\n  void set_php_namespace(const char* value);\n  void set_php_namespace(const char* value, size_t size);\n  ::std::string* mutable_php_namespace();\n  ::std::string* release_php_namespace();\n  void set_allocated_php_namespace(::std::string* php_namespace);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_php_namespace();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_php_namespace(\n      ::std::string* php_namespace);\n\n  // optional string php_metadata_namespace = 44;\n  bool has_php_metadata_namespace() const;\n  void clear_php_metadata_namespace();\n  static const int kPhpMetadataNamespaceFieldNumber = 44;\n  const ::std::string& php_metadata_namespace() const;\n  void set_php_metadata_namespace(const ::std::string& value);\n  #if LANG_CXX11\n  void set_php_metadata_namespace(::std::string&& value);\n  #endif\n  void set_php_metadata_namespace(const char* value);\n  void set_php_metadata_namespace(const char* value, size_t size);\n  ::std::string* mutable_php_metadata_namespace();\n  ::std::string* release_php_metadata_namespace();\n  void set_allocated_php_metadata_namespace(::std::string* php_metadata_namespace);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_php_metadata_namespace();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_php_metadata_namespace(\n      ::std::string* php_metadata_namespace);\n\n  // optional string ruby_package = 45;\n  bool has_ruby_package() const;\n  void clear_ruby_package();\n  static const int kRubyPackageFieldNumber = 45;\n  const ::std::string& ruby_package() const;\n  void set_ruby_package(const ::std::string& value);\n  #if LANG_CXX11\n  void set_ruby_package(::std::string&& value);\n  #endif\n  void set_ruby_package(const char* value);\n  void set_ruby_package(const char* value, size_t size);\n  ::std::string* mutable_ruby_package();\n  ::std::string* release_ruby_package();\n  void set_allocated_ruby_package(::std::string* ruby_package);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_ruby_package();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_ruby_package(\n      ::std::string* ruby_package);\n\n  // optional bool java_multiple_files = 10 [default = false];\n  bool has_java_multiple_files() const;\n  void clear_java_multiple_files();\n  static const int kJavaMultipleFilesFieldNumber = 10;\n  bool java_multiple_files() const;\n  void set_java_multiple_files(bool value);\n\n  // optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  GOOGLE_PROTOBUF_DEPRECATED_ATTR bool has_java_generate_equals_and_hash() const;\n  GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_java_generate_equals_and_hash();\n  GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kJavaGenerateEqualsAndHashFieldNumber = 20;\n  GOOGLE_PROTOBUF_DEPRECATED_ATTR bool java_generate_equals_and_hash() const;\n  GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_java_generate_equals_and_hash(bool value);\n\n  // optional bool java_string_check_utf8 = 27 [default = false];\n  bool has_java_string_check_utf8() const;\n  void clear_java_string_check_utf8();\n  static const int kJavaStringCheckUtf8FieldNumber = 27;\n  bool java_string_check_utf8() const;\n  void set_java_string_check_utf8(bool value);\n\n  // optional bool cc_generic_services = 16 [default = false];\n  bool has_cc_generic_services() const;\n  void clear_cc_generic_services();\n  static const int kCcGenericServicesFieldNumber = 16;\n  bool cc_generic_services() const;\n  void set_cc_generic_services(bool value);\n\n  // optional bool java_generic_services = 17 [default = false];\n  bool has_java_generic_services() const;\n  void clear_java_generic_services();\n  static const int kJavaGenericServicesFieldNumber = 17;\n  bool java_generic_services() const;\n  void set_java_generic_services(bool value);\n\n  // optional bool py_generic_services = 18 [default = false];\n  bool has_py_generic_services() const;\n  void clear_py_generic_services();\n  static const int kPyGenericServicesFieldNumber = 18;\n  bool py_generic_services() const;\n  void set_py_generic_services(bool value);\n\n  // optional bool php_generic_services = 42 [default = false];\n  bool has_php_generic_services() const;\n  void clear_php_generic_services();\n  static const int kPhpGenericServicesFieldNumber = 42;\n  bool php_generic_services() const;\n  void set_php_generic_services(bool value);\n\n  // optional bool deprecated = 23 [default = false];\n  bool has_deprecated() const;\n  void clear_deprecated();\n  static const int kDeprecatedFieldNumber = 23;\n  bool deprecated() const;\n  void set_deprecated(bool value);\n\n  // optional bool cc_enable_arenas = 31 [default = false];\n  bool has_cc_enable_arenas() const;\n  void clear_cc_enable_arenas();\n  static const int kCcEnableArenasFieldNumber = 31;\n  bool cc_enable_arenas() const;\n  void set_cc_enable_arenas(bool value);\n\n  // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];\n  bool has_optimize_for() const;\n  void clear_optimize_for();\n  static const int kOptimizeForFieldNumber = 9;\n  ::google::protobuf::FileOptions_OptimizeMode optimize_for() const;\n  void set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value);\n\n  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FileOptions)\n  // @@protoc_insertion_point(class_scope:google.protobuf.FileOptions)\n private:\n  void set_has_java_package();\n  void clear_has_java_package();\n  void set_has_java_outer_classname();\n  void clear_has_java_outer_classname();\n  void set_has_java_multiple_files();\n  void clear_has_java_multiple_files();\n  void set_has_java_generate_equals_and_hash();\n  void clear_has_java_generate_equals_and_hash();\n  void set_has_java_string_check_utf8();\n  void clear_has_java_string_check_utf8();\n  void set_has_optimize_for();\n  void clear_has_optimize_for();\n  void set_has_go_package();\n  void clear_has_go_package();\n  void set_has_cc_generic_services();\n  void clear_has_cc_generic_services();\n  void set_has_java_generic_services();\n  void clear_has_java_generic_services();\n  void set_has_py_generic_services();\n  void clear_has_py_generic_services();\n  void set_has_php_generic_services();\n  void clear_has_php_generic_services();\n  void set_has_deprecated();\n  void clear_has_deprecated();\n  void set_has_cc_enable_arenas();\n  void clear_has_cc_enable_arenas();\n  void set_has_objc_class_prefix();\n  void clear_has_objc_class_prefix();\n  void set_has_csharp_namespace();\n  void clear_has_csharp_namespace();\n  void set_has_swift_prefix();\n  void clear_has_swift_prefix();\n  void set_has_php_class_prefix();\n  void clear_has_php_class_prefix();\n  void set_has_php_namespace();\n  void clear_has_php_namespace();\n  void set_has_php_metadata_namespace();\n  void clear_has_php_metadata_namespace();\n  void set_has_ruby_package();\n  void clear_has_ruby_package();\n\n  ::google::protobuf::internal::ExtensionSet _extensions_;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;\n  ::google::protobuf::internal::ArenaStringPtr java_package_;\n  ::google::protobuf::internal::ArenaStringPtr java_outer_classname_;\n  ::google::protobuf::internal::ArenaStringPtr go_package_;\n  ::google::protobuf::internal::ArenaStringPtr objc_class_prefix_;\n  ::google::protobuf::internal::ArenaStringPtr csharp_namespace_;\n  ::google::protobuf::internal::ArenaStringPtr swift_prefix_;\n  ::google::protobuf::internal::ArenaStringPtr php_class_prefix_;\n  ::google::protobuf::internal::ArenaStringPtr php_namespace_;\n  ::google::protobuf::internal::ArenaStringPtr php_metadata_namespace_;\n  ::google::protobuf::internal::ArenaStringPtr ruby_package_;\n  bool java_multiple_files_;\n  bool java_generate_equals_and_hash_;\n  bool java_string_check_utf8_;\n  bool cc_generic_services_;\n  bool java_generic_services_;\n  bool py_generic_services_;\n  bool php_generic_services_;\n  bool deprecated_;\n  bool cc_enable_arenas_;\n  int optimize_for_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MessageOptions) */ {\n public:\n  MessageOptions();\n  virtual ~MessageOptions();\n\n  MessageOptions(const MessageOptions& from);\n\n  inline MessageOptions& operator=(const MessageOptions& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  MessageOptions(MessageOptions&& from) noexcept\n    : MessageOptions() {\n    *this = ::std::move(from);\n  }\n\n  inline MessageOptions& operator=(MessageOptions&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const MessageOptions& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const MessageOptions* internal_default_instance() {\n    return reinterpret_cast<const MessageOptions*>(\n               &_MessageOptions_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    14;\n\n  void UnsafeArenaSwap(MessageOptions* other);\n  void Swap(MessageOptions* other);\n  friend void swap(MessageOptions& a, MessageOptions& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline MessageOptions* New() const final {\n    return CreateMaybeMessage<MessageOptions>(NULL);\n  }\n\n  MessageOptions* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<MessageOptions>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const MessageOptions& from);\n  void MergeFrom(const MessageOptions& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(MessageOptions* other);\n  protected:\n  explicit MessageOptions(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\n  int uninterpreted_option_size() const;\n  void clear_uninterpreted_option();\n  static const int kUninterpretedOptionFieldNumber = 999;\n  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\n      mutable_uninterpreted_option();\n  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;\n  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\n      uninterpreted_option() const;\n\n  // optional bool message_set_wire_format = 1 [default = false];\n  bool has_message_set_wire_format() const;\n  void clear_message_set_wire_format();\n  static const int kMessageSetWireFormatFieldNumber = 1;\n  bool message_set_wire_format() const;\n  void set_message_set_wire_format(bool value);\n\n  // optional bool no_standard_descriptor_accessor = 2 [default = false];\n  bool has_no_standard_descriptor_accessor() const;\n  void clear_no_standard_descriptor_accessor();\n  static const int kNoStandardDescriptorAccessorFieldNumber = 2;\n  bool no_standard_descriptor_accessor() const;\n  void set_no_standard_descriptor_accessor(bool value);\n\n  // optional bool deprecated = 3 [default = false];\n  bool has_deprecated() const;\n  void clear_deprecated();\n  static const int kDeprecatedFieldNumber = 3;\n  bool deprecated() const;\n  void set_deprecated(bool value);\n\n  // optional bool map_entry = 7;\n  bool has_map_entry() const;\n  void clear_map_entry();\n  static const int kMapEntryFieldNumber = 7;\n  bool map_entry() const;\n  void set_map_entry(bool value);\n\n  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MessageOptions)\n  // @@protoc_insertion_point(class_scope:google.protobuf.MessageOptions)\n private:\n  void set_has_message_set_wire_format();\n  void clear_has_message_set_wire_format();\n  void set_has_no_standard_descriptor_accessor();\n  void clear_has_no_standard_descriptor_accessor();\n  void set_has_deprecated();\n  void clear_has_deprecated();\n  void set_has_map_entry();\n  void clear_has_map_entry();\n\n  ::google::protobuf::internal::ExtensionSet _extensions_;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;\n  bool message_set_wire_format_;\n  bool no_standard_descriptor_accessor_;\n  bool deprecated_;\n  bool map_entry_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldOptions) */ {\n public:\n  FieldOptions();\n  virtual ~FieldOptions();\n\n  FieldOptions(const FieldOptions& from);\n\n  inline FieldOptions& operator=(const FieldOptions& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  FieldOptions(FieldOptions&& from) noexcept\n    : FieldOptions() {\n    *this = ::std::move(from);\n  }\n\n  inline FieldOptions& operator=(FieldOptions&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const FieldOptions& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const FieldOptions* internal_default_instance() {\n    return reinterpret_cast<const FieldOptions*>(\n               &_FieldOptions_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    15;\n\n  void UnsafeArenaSwap(FieldOptions* other);\n  void Swap(FieldOptions* other);\n  friend void swap(FieldOptions& a, FieldOptions& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline FieldOptions* New() const final {\n    return CreateMaybeMessage<FieldOptions>(NULL);\n  }\n\n  FieldOptions* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<FieldOptions>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const FieldOptions& from);\n  void MergeFrom(const FieldOptions& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(FieldOptions* other);\n  protected:\n  explicit FieldOptions(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef FieldOptions_CType CType;\n  static const CType STRING =\n    FieldOptions_CType_STRING;\n  static const CType CORD =\n    FieldOptions_CType_CORD;\n  static const CType STRING_PIECE =\n    FieldOptions_CType_STRING_PIECE;\n  static inline bool CType_IsValid(int value) {\n    return FieldOptions_CType_IsValid(value);\n  }\n  static const CType CType_MIN =\n    FieldOptions_CType_CType_MIN;\n  static const CType CType_MAX =\n    FieldOptions_CType_CType_MAX;\n  static const int CType_ARRAYSIZE =\n    FieldOptions_CType_CType_ARRAYSIZE;\n  static inline const ::google::protobuf::EnumDescriptor*\n  CType_descriptor() {\n    return FieldOptions_CType_descriptor();\n  }\n  static inline const ::std::string& CType_Name(CType value) {\n    return FieldOptions_CType_Name(value);\n  }\n  static inline bool CType_Parse(const ::std::string& name,\n      CType* value) {\n    return FieldOptions_CType_Parse(name, value);\n  }\n\n  typedef FieldOptions_JSType JSType;\n  static const JSType JS_NORMAL =\n    FieldOptions_JSType_JS_NORMAL;\n  static const JSType JS_STRING =\n    FieldOptions_JSType_JS_STRING;\n  static const JSType JS_NUMBER =\n    FieldOptions_JSType_JS_NUMBER;\n  static inline bool JSType_IsValid(int value) {\n    return FieldOptions_JSType_IsValid(value);\n  }\n  static const JSType JSType_MIN =\n    FieldOptions_JSType_JSType_MIN;\n  static const JSType JSType_MAX =\n    FieldOptions_JSType_JSType_MAX;\n  static const int JSType_ARRAYSIZE =\n    FieldOptions_JSType_JSType_ARRAYSIZE;\n  static inline const ::google::protobuf::EnumDescriptor*\n  JSType_descriptor() {\n    return FieldOptions_JSType_descriptor();\n  }\n  static inline const ::std::string& JSType_Name(JSType value) {\n    return FieldOptions_JSType_Name(value);\n  }\n  static inline bool JSType_Parse(const ::std::string& name,\n      JSType* value) {\n    return FieldOptions_JSType_Parse(name, value);\n  }\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\n  int uninterpreted_option_size() const;\n  void clear_uninterpreted_option();\n  static const int kUninterpretedOptionFieldNumber = 999;\n  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\n      mutable_uninterpreted_option();\n  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;\n  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\n      uninterpreted_option() const;\n\n  // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];\n  bool has_ctype() const;\n  void clear_ctype();\n  static const int kCtypeFieldNumber = 1;\n  ::google::protobuf::FieldOptions_CType ctype() const;\n  void set_ctype(::google::protobuf::FieldOptions_CType value);\n\n  // optional bool packed = 2;\n  bool has_packed() const;\n  void clear_packed();\n  static const int kPackedFieldNumber = 2;\n  bool packed() const;\n  void set_packed(bool value);\n\n  // optional bool lazy = 5 [default = false];\n  bool has_lazy() const;\n  void clear_lazy();\n  static const int kLazyFieldNumber = 5;\n  bool lazy() const;\n  void set_lazy(bool value);\n\n  // optional bool deprecated = 3 [default = false];\n  bool has_deprecated() const;\n  void clear_deprecated();\n  static const int kDeprecatedFieldNumber = 3;\n  bool deprecated() const;\n  void set_deprecated(bool value);\n\n  // optional bool weak = 10 [default = false];\n  bool has_weak() const;\n  void clear_weak();\n  static const int kWeakFieldNumber = 10;\n  bool weak() const;\n  void set_weak(bool value);\n\n  // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];\n  bool has_jstype() const;\n  void clear_jstype();\n  static const int kJstypeFieldNumber = 6;\n  ::google::protobuf::FieldOptions_JSType jstype() const;\n  void set_jstype(::google::protobuf::FieldOptions_JSType value);\n\n  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FieldOptions)\n  // @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions)\n private:\n  void set_has_ctype();\n  void clear_has_ctype();\n  void set_has_packed();\n  void clear_has_packed();\n  void set_has_jstype();\n  void clear_has_jstype();\n  void set_has_lazy();\n  void clear_has_lazy();\n  void set_has_deprecated();\n  void clear_has_deprecated();\n  void set_has_weak();\n  void clear_has_weak();\n\n  ::google::protobuf::internal::ExtensionSet _extensions_;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;\n  int ctype_;\n  bool packed_;\n  bool lazy_;\n  bool deprecated_;\n  bool weak_;\n  int jstype_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT OneofOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.OneofOptions) */ {\n public:\n  OneofOptions();\n  virtual ~OneofOptions();\n\n  OneofOptions(const OneofOptions& from);\n\n  inline OneofOptions& operator=(const OneofOptions& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  OneofOptions(OneofOptions&& from) noexcept\n    : OneofOptions() {\n    *this = ::std::move(from);\n  }\n\n  inline OneofOptions& operator=(OneofOptions&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const OneofOptions& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const OneofOptions* internal_default_instance() {\n    return reinterpret_cast<const OneofOptions*>(\n               &_OneofOptions_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    16;\n\n  void UnsafeArenaSwap(OneofOptions* other);\n  void Swap(OneofOptions* other);\n  friend void swap(OneofOptions& a, OneofOptions& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline OneofOptions* New() const final {\n    return CreateMaybeMessage<OneofOptions>(NULL);\n  }\n\n  OneofOptions* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<OneofOptions>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const OneofOptions& from);\n  void MergeFrom(const OneofOptions& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(OneofOptions* other);\n  protected:\n  explicit OneofOptions(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\n  int uninterpreted_option_size() const;\n  void clear_uninterpreted_option();\n  static const int kUninterpretedOptionFieldNumber = 999;\n  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\n      mutable_uninterpreted_option();\n  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;\n  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\n      uninterpreted_option() const;\n\n  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(OneofOptions)\n  // @@protoc_insertion_point(class_scope:google.protobuf.OneofOptions)\n private:\n\n  ::google::protobuf::internal::ExtensionSet _extensions_;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumOptions) */ {\n public:\n  EnumOptions();\n  virtual ~EnumOptions();\n\n  EnumOptions(const EnumOptions& from);\n\n  inline EnumOptions& operator=(const EnumOptions& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  EnumOptions(EnumOptions&& from) noexcept\n    : EnumOptions() {\n    *this = ::std::move(from);\n  }\n\n  inline EnumOptions& operator=(EnumOptions&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const EnumOptions& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const EnumOptions* internal_default_instance() {\n    return reinterpret_cast<const EnumOptions*>(\n               &_EnumOptions_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    17;\n\n  void UnsafeArenaSwap(EnumOptions* other);\n  void Swap(EnumOptions* other);\n  friend void swap(EnumOptions& a, EnumOptions& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline EnumOptions* New() const final {\n    return CreateMaybeMessage<EnumOptions>(NULL);\n  }\n\n  EnumOptions* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<EnumOptions>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const EnumOptions& from);\n  void MergeFrom(const EnumOptions& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(EnumOptions* other);\n  protected:\n  explicit EnumOptions(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\n  int uninterpreted_option_size() const;\n  void clear_uninterpreted_option();\n  static const int kUninterpretedOptionFieldNumber = 999;\n  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\n      mutable_uninterpreted_option();\n  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;\n  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\n      uninterpreted_option() const;\n\n  // optional bool allow_alias = 2;\n  bool has_allow_alias() const;\n  void clear_allow_alias();\n  static const int kAllowAliasFieldNumber = 2;\n  bool allow_alias() const;\n  void set_allow_alias(bool value);\n\n  // optional bool deprecated = 3 [default = false];\n  bool has_deprecated() const;\n  void clear_deprecated();\n  static const int kDeprecatedFieldNumber = 3;\n  bool deprecated() const;\n  void set_deprecated(bool value);\n\n  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumOptions)\n  // @@protoc_insertion_point(class_scope:google.protobuf.EnumOptions)\n private:\n  void set_has_allow_alias();\n  void clear_has_allow_alias();\n  void set_has_deprecated();\n  void clear_has_deprecated();\n\n  ::google::protobuf::internal::ExtensionSet _extensions_;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;\n  bool allow_alias_;\n  bool deprecated_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValueOptions) */ {\n public:\n  EnumValueOptions();\n  virtual ~EnumValueOptions();\n\n  EnumValueOptions(const EnumValueOptions& from);\n\n  inline EnumValueOptions& operator=(const EnumValueOptions& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  EnumValueOptions(EnumValueOptions&& from) noexcept\n    : EnumValueOptions() {\n    *this = ::std::move(from);\n  }\n\n  inline EnumValueOptions& operator=(EnumValueOptions&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const EnumValueOptions& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const EnumValueOptions* internal_default_instance() {\n    return reinterpret_cast<const EnumValueOptions*>(\n               &_EnumValueOptions_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    18;\n\n  void UnsafeArenaSwap(EnumValueOptions* other);\n  void Swap(EnumValueOptions* other);\n  friend void swap(EnumValueOptions& a, EnumValueOptions& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline EnumValueOptions* New() const final {\n    return CreateMaybeMessage<EnumValueOptions>(NULL);\n  }\n\n  EnumValueOptions* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<EnumValueOptions>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const EnumValueOptions& from);\n  void MergeFrom(const EnumValueOptions& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(EnumValueOptions* other);\n  protected:\n  explicit EnumValueOptions(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\n  int uninterpreted_option_size() const;\n  void clear_uninterpreted_option();\n  static const int kUninterpretedOptionFieldNumber = 999;\n  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\n      mutable_uninterpreted_option();\n  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;\n  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\n      uninterpreted_option() const;\n\n  // optional bool deprecated = 1 [default = false];\n  bool has_deprecated() const;\n  void clear_deprecated();\n  static const int kDeprecatedFieldNumber = 1;\n  bool deprecated() const;\n  void set_deprecated(bool value);\n\n  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumValueOptions)\n  // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueOptions)\n private:\n  void set_has_deprecated();\n  void clear_has_deprecated();\n\n  ::google::protobuf::internal::ExtensionSet _extensions_;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;\n  bool deprecated_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ServiceOptions) */ {\n public:\n  ServiceOptions();\n  virtual ~ServiceOptions();\n\n  ServiceOptions(const ServiceOptions& from);\n\n  inline ServiceOptions& operator=(const ServiceOptions& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  ServiceOptions(ServiceOptions&& from) noexcept\n    : ServiceOptions() {\n    *this = ::std::move(from);\n  }\n\n  inline ServiceOptions& operator=(ServiceOptions&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const ServiceOptions& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const ServiceOptions* internal_default_instance() {\n    return reinterpret_cast<const ServiceOptions*>(\n               &_ServiceOptions_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    19;\n\n  void UnsafeArenaSwap(ServiceOptions* other);\n  void Swap(ServiceOptions* other);\n  friend void swap(ServiceOptions& a, ServiceOptions& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline ServiceOptions* New() const final {\n    return CreateMaybeMessage<ServiceOptions>(NULL);\n  }\n\n  ServiceOptions* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<ServiceOptions>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const ServiceOptions& from);\n  void MergeFrom(const ServiceOptions& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(ServiceOptions* other);\n  protected:\n  explicit ServiceOptions(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\n  int uninterpreted_option_size() const;\n  void clear_uninterpreted_option();\n  static const int kUninterpretedOptionFieldNumber = 999;\n  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\n      mutable_uninterpreted_option();\n  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;\n  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\n      uninterpreted_option() const;\n\n  // optional bool deprecated = 33 [default = false];\n  bool has_deprecated() const;\n  void clear_deprecated();\n  static const int kDeprecatedFieldNumber = 33;\n  bool deprecated() const;\n  void set_deprecated(bool value);\n\n  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ServiceOptions)\n  // @@protoc_insertion_point(class_scope:google.protobuf.ServiceOptions)\n private:\n  void set_has_deprecated();\n  void clear_has_deprecated();\n\n  ::google::protobuf::internal::ExtensionSet _extensions_;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;\n  bool deprecated_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.MethodOptions) */ {\n public:\n  MethodOptions();\n  virtual ~MethodOptions();\n\n  MethodOptions(const MethodOptions& from);\n\n  inline MethodOptions& operator=(const MethodOptions& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  MethodOptions(MethodOptions&& from) noexcept\n    : MethodOptions() {\n    *this = ::std::move(from);\n  }\n\n  inline MethodOptions& operator=(MethodOptions&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const MethodOptions& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const MethodOptions* internal_default_instance() {\n    return reinterpret_cast<const MethodOptions*>(\n               &_MethodOptions_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    20;\n\n  void UnsafeArenaSwap(MethodOptions* other);\n  void Swap(MethodOptions* other);\n  friend void swap(MethodOptions& a, MethodOptions& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline MethodOptions* New() const final {\n    return CreateMaybeMessage<MethodOptions>(NULL);\n  }\n\n  MethodOptions* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<MethodOptions>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const MethodOptions& from);\n  void MergeFrom(const MethodOptions& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(MethodOptions* other);\n  protected:\n  explicit MethodOptions(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef MethodOptions_IdempotencyLevel IdempotencyLevel;\n  static const IdempotencyLevel IDEMPOTENCY_UNKNOWN =\n    MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN;\n  static const IdempotencyLevel NO_SIDE_EFFECTS =\n    MethodOptions_IdempotencyLevel_NO_SIDE_EFFECTS;\n  static const IdempotencyLevel IDEMPOTENT =\n    MethodOptions_IdempotencyLevel_IDEMPOTENT;\n  static inline bool IdempotencyLevel_IsValid(int value) {\n    return MethodOptions_IdempotencyLevel_IsValid(value);\n  }\n  static const IdempotencyLevel IdempotencyLevel_MIN =\n    MethodOptions_IdempotencyLevel_IdempotencyLevel_MIN;\n  static const IdempotencyLevel IdempotencyLevel_MAX =\n    MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX;\n  static const int IdempotencyLevel_ARRAYSIZE =\n    MethodOptions_IdempotencyLevel_IdempotencyLevel_ARRAYSIZE;\n  static inline const ::google::protobuf::EnumDescriptor*\n  IdempotencyLevel_descriptor() {\n    return MethodOptions_IdempotencyLevel_descriptor();\n  }\n  static inline const ::std::string& IdempotencyLevel_Name(IdempotencyLevel value) {\n    return MethodOptions_IdempotencyLevel_Name(value);\n  }\n  static inline bool IdempotencyLevel_Parse(const ::std::string& name,\n      IdempotencyLevel* value) {\n    return MethodOptions_IdempotencyLevel_Parse(name, value);\n  }\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\n  int uninterpreted_option_size() const;\n  void clear_uninterpreted_option();\n  static const int kUninterpretedOptionFieldNumber = 999;\n  ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\n      mutable_uninterpreted_option();\n  const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const;\n  ::google::protobuf::UninterpretedOption* add_uninterpreted_option();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\n      uninterpreted_option() const;\n\n  // optional bool deprecated = 33 [default = false];\n  bool has_deprecated() const;\n  void clear_deprecated();\n  static const int kDeprecatedFieldNumber = 33;\n  bool deprecated() const;\n  void set_deprecated(bool value);\n\n  // optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  bool has_idempotency_level() const;\n  void clear_idempotency_level();\n  static const int kIdempotencyLevelFieldNumber = 34;\n  ::google::protobuf::MethodOptions_IdempotencyLevel idempotency_level() const;\n  void set_idempotency_level(::google::protobuf::MethodOptions_IdempotencyLevel value);\n\n  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MethodOptions)\n  // @@protoc_insertion_point(class_scope:google.protobuf.MethodOptions)\n private:\n  void set_has_deprecated();\n  void clear_has_deprecated();\n  void set_has_idempotency_level();\n  void clear_has_idempotency_level();\n\n  ::google::protobuf::internal::ExtensionSet _extensions_;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_;\n  bool deprecated_;\n  int idempotency_level_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption.NamePart) */ {\n public:\n  UninterpretedOption_NamePart();\n  virtual ~UninterpretedOption_NamePart();\n\n  UninterpretedOption_NamePart(const UninterpretedOption_NamePart& from);\n\n  inline UninterpretedOption_NamePart& operator=(const UninterpretedOption_NamePart& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  UninterpretedOption_NamePart(UninterpretedOption_NamePart&& from) noexcept\n    : UninterpretedOption_NamePart() {\n    *this = ::std::move(from);\n  }\n\n  inline UninterpretedOption_NamePart& operator=(UninterpretedOption_NamePart&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const UninterpretedOption_NamePart& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const UninterpretedOption_NamePart* internal_default_instance() {\n    return reinterpret_cast<const UninterpretedOption_NamePart*>(\n               &_UninterpretedOption_NamePart_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    21;\n\n  void UnsafeArenaSwap(UninterpretedOption_NamePart* other);\n  void Swap(UninterpretedOption_NamePart* other);\n  friend void swap(UninterpretedOption_NamePart& a, UninterpretedOption_NamePart& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline UninterpretedOption_NamePart* New() const final {\n    return CreateMaybeMessage<UninterpretedOption_NamePart>(NULL);\n  }\n\n  UninterpretedOption_NamePart* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<UninterpretedOption_NamePart>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const UninterpretedOption_NamePart& from);\n  void MergeFrom(const UninterpretedOption_NamePart& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(UninterpretedOption_NamePart* other);\n  protected:\n  explicit UninterpretedOption_NamePart(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // required string name_part = 1;\n  bool has_name_part() const;\n  void clear_name_part();\n  static const int kNamePartFieldNumber = 1;\n  const ::std::string& name_part() const;\n  void set_name_part(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name_part(::std::string&& value);\n  #endif\n  void set_name_part(const char* value);\n  void set_name_part(const char* value, size_t size);\n  ::std::string* mutable_name_part();\n  ::std::string* release_name_part();\n  void set_allocated_name_part(::std::string* name_part);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name_part();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name_part(\n      ::std::string* name_part);\n\n  // required bool is_extension = 2;\n  bool has_is_extension() const;\n  void clear_is_extension();\n  static const int kIsExtensionFieldNumber = 2;\n  bool is_extension() const;\n  void set_is_extension(bool value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption.NamePart)\n private:\n  void set_has_name_part();\n  void clear_has_name_part();\n  void set_has_is_extension();\n  void clear_has_is_extension();\n\n  // helper for ByteSizeLong()\n  size_t RequiredFieldsByteSizeFallback() const;\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::internal::ArenaStringPtr name_part_;\n  bool is_extension_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UninterpretedOption) */ {\n public:\n  UninterpretedOption();\n  virtual ~UninterpretedOption();\n\n  UninterpretedOption(const UninterpretedOption& from);\n\n  inline UninterpretedOption& operator=(const UninterpretedOption& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  UninterpretedOption(UninterpretedOption&& from) noexcept\n    : UninterpretedOption() {\n    *this = ::std::move(from);\n  }\n\n  inline UninterpretedOption& operator=(UninterpretedOption&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const UninterpretedOption& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const UninterpretedOption* internal_default_instance() {\n    return reinterpret_cast<const UninterpretedOption*>(\n               &_UninterpretedOption_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    22;\n\n  void UnsafeArenaSwap(UninterpretedOption* other);\n  void Swap(UninterpretedOption* other);\n  friend void swap(UninterpretedOption& a, UninterpretedOption& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline UninterpretedOption* New() const final {\n    return CreateMaybeMessage<UninterpretedOption>(NULL);\n  }\n\n  UninterpretedOption* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<UninterpretedOption>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const UninterpretedOption& from);\n  void MergeFrom(const UninterpretedOption& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(UninterpretedOption* other);\n  protected:\n  explicit UninterpretedOption(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef UninterpretedOption_NamePart NamePart;\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.UninterpretedOption.NamePart name = 2;\n  int name_size() const;\n  void clear_name();\n  static const int kNameFieldNumber = 2;\n  ::google::protobuf::UninterpretedOption_NamePart* mutable_name(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >*\n      mutable_name();\n  const ::google::protobuf::UninterpretedOption_NamePart& name(int index) const;\n  ::google::protobuf::UninterpretedOption_NamePart* add_name();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >&\n      name() const;\n\n  // optional string identifier_value = 3;\n  bool has_identifier_value() const;\n  void clear_identifier_value();\n  static const int kIdentifierValueFieldNumber = 3;\n  const ::std::string& identifier_value() const;\n  void set_identifier_value(const ::std::string& value);\n  #if LANG_CXX11\n  void set_identifier_value(::std::string&& value);\n  #endif\n  void set_identifier_value(const char* value);\n  void set_identifier_value(const char* value, size_t size);\n  ::std::string* mutable_identifier_value();\n  ::std::string* release_identifier_value();\n  void set_allocated_identifier_value(::std::string* identifier_value);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_identifier_value();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_identifier_value(\n      ::std::string* identifier_value);\n\n  // optional bytes string_value = 7;\n  bool has_string_value() const;\n  void clear_string_value();\n  static const int kStringValueFieldNumber = 7;\n  const ::std::string& string_value() const;\n  void set_string_value(const ::std::string& value);\n  #if LANG_CXX11\n  void set_string_value(::std::string&& value);\n  #endif\n  void set_string_value(const char* value);\n  void set_string_value(const void* value, size_t size);\n  ::std::string* mutable_string_value();\n  ::std::string* release_string_value();\n  void set_allocated_string_value(::std::string* string_value);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_string_value();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_string_value(\n      ::std::string* string_value);\n\n  // optional string aggregate_value = 8;\n  bool has_aggregate_value() const;\n  void clear_aggregate_value();\n  static const int kAggregateValueFieldNumber = 8;\n  const ::std::string& aggregate_value() const;\n  void set_aggregate_value(const ::std::string& value);\n  #if LANG_CXX11\n  void set_aggregate_value(::std::string&& value);\n  #endif\n  void set_aggregate_value(const char* value);\n  void set_aggregate_value(const char* value, size_t size);\n  ::std::string* mutable_aggregate_value();\n  ::std::string* release_aggregate_value();\n  void set_allocated_aggregate_value(::std::string* aggregate_value);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_aggregate_value();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_aggregate_value(\n      ::std::string* aggregate_value);\n\n  // optional uint64 positive_int_value = 4;\n  bool has_positive_int_value() const;\n  void clear_positive_int_value();\n  static const int kPositiveIntValueFieldNumber = 4;\n  ::google::protobuf::uint64 positive_int_value() const;\n  void set_positive_int_value(::google::protobuf::uint64 value);\n\n  // optional int64 negative_int_value = 5;\n  bool has_negative_int_value() const;\n  void clear_negative_int_value();\n  static const int kNegativeIntValueFieldNumber = 5;\n  ::google::protobuf::int64 negative_int_value() const;\n  void set_negative_int_value(::google::protobuf::int64 value);\n\n  // optional double double_value = 6;\n  bool has_double_value() const;\n  void clear_double_value();\n  static const int kDoubleValueFieldNumber = 6;\n  double double_value() const;\n  void set_double_value(double value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption)\n private:\n  void set_has_identifier_value();\n  void clear_has_identifier_value();\n  void set_has_positive_int_value();\n  void clear_has_positive_int_value();\n  void set_has_negative_int_value();\n  void clear_has_negative_int_value();\n  void set_has_double_value();\n  void clear_has_double_value();\n  void set_has_string_value();\n  void clear_has_string_value();\n  void set_has_aggregate_value();\n  void clear_has_aggregate_value();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart > name_;\n  ::google::protobuf::internal::ArenaStringPtr identifier_value_;\n  ::google::protobuf::internal::ArenaStringPtr string_value_;\n  ::google::protobuf::internal::ArenaStringPtr aggregate_value_;\n  ::google::protobuf::uint64 positive_int_value_;\n  ::google::protobuf::int64 negative_int_value_;\n  double double_value_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo.Location) */ {\n public:\n  SourceCodeInfo_Location();\n  virtual ~SourceCodeInfo_Location();\n\n  SourceCodeInfo_Location(const SourceCodeInfo_Location& from);\n\n  inline SourceCodeInfo_Location& operator=(const SourceCodeInfo_Location& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  SourceCodeInfo_Location(SourceCodeInfo_Location&& from) noexcept\n    : SourceCodeInfo_Location() {\n    *this = ::std::move(from);\n  }\n\n  inline SourceCodeInfo_Location& operator=(SourceCodeInfo_Location&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const SourceCodeInfo_Location& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const SourceCodeInfo_Location* internal_default_instance() {\n    return reinterpret_cast<const SourceCodeInfo_Location*>(\n               &_SourceCodeInfo_Location_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    23;\n\n  void UnsafeArenaSwap(SourceCodeInfo_Location* other);\n  void Swap(SourceCodeInfo_Location* other);\n  friend void swap(SourceCodeInfo_Location& a, SourceCodeInfo_Location& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline SourceCodeInfo_Location* New() const final {\n    return CreateMaybeMessage<SourceCodeInfo_Location>(NULL);\n  }\n\n  SourceCodeInfo_Location* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<SourceCodeInfo_Location>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const SourceCodeInfo_Location& from);\n  void MergeFrom(const SourceCodeInfo_Location& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(SourceCodeInfo_Location* other);\n  protected:\n  explicit SourceCodeInfo_Location(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated int32 path = 1 [packed = true];\n  int path_size() const;\n  void clear_path();\n  static const int kPathFieldNumber = 1;\n  ::google::protobuf::int32 path(int index) const;\n  void set_path(int index, ::google::protobuf::int32 value);\n  void add_path(::google::protobuf::int32 value);\n  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\n      path() const;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\n      mutable_path();\n\n  // repeated int32 span = 2 [packed = true];\n  int span_size() const;\n  void clear_span();\n  static const int kSpanFieldNumber = 2;\n  ::google::protobuf::int32 span(int index) const;\n  void set_span(int index, ::google::protobuf::int32 value);\n  void add_span(::google::protobuf::int32 value);\n  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\n      span() const;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\n      mutable_span();\n\n  // repeated string leading_detached_comments = 6;\n  int leading_detached_comments_size() const;\n  void clear_leading_detached_comments();\n  static const int kLeadingDetachedCommentsFieldNumber = 6;\n  const ::std::string& leading_detached_comments(int index) const;\n  ::std::string* mutable_leading_detached_comments(int index);\n  void set_leading_detached_comments(int index, const ::std::string& value);\n  #if LANG_CXX11\n  void set_leading_detached_comments(int index, ::std::string&& value);\n  #endif\n  void set_leading_detached_comments(int index, const char* value);\n  void set_leading_detached_comments(int index, const char* value, size_t size);\n  ::std::string* add_leading_detached_comments();\n  void add_leading_detached_comments(const ::std::string& value);\n  #if LANG_CXX11\n  void add_leading_detached_comments(::std::string&& value);\n  #endif\n  void add_leading_detached_comments(const char* value);\n  void add_leading_detached_comments(const char* value, size_t size);\n  const ::google::protobuf::RepeatedPtrField< ::std::string>& leading_detached_comments() const;\n  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_leading_detached_comments();\n\n  // optional string leading_comments = 3;\n  bool has_leading_comments() const;\n  void clear_leading_comments();\n  static const int kLeadingCommentsFieldNumber = 3;\n  const ::std::string& leading_comments() const;\n  void set_leading_comments(const ::std::string& value);\n  #if LANG_CXX11\n  void set_leading_comments(::std::string&& value);\n  #endif\n  void set_leading_comments(const char* value);\n  void set_leading_comments(const char* value, size_t size);\n  ::std::string* mutable_leading_comments();\n  ::std::string* release_leading_comments();\n  void set_allocated_leading_comments(::std::string* leading_comments);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_leading_comments();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_leading_comments(\n      ::std::string* leading_comments);\n\n  // optional string trailing_comments = 4;\n  bool has_trailing_comments() const;\n  void clear_trailing_comments();\n  static const int kTrailingCommentsFieldNumber = 4;\n  const ::std::string& trailing_comments() const;\n  void set_trailing_comments(const ::std::string& value);\n  #if LANG_CXX11\n  void set_trailing_comments(::std::string&& value);\n  #endif\n  void set_trailing_comments(const char* value);\n  void set_trailing_comments(const char* value, size_t size);\n  ::std::string* mutable_trailing_comments();\n  ::std::string* release_trailing_comments();\n  void set_allocated_trailing_comments(::std::string* trailing_comments);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_trailing_comments();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_trailing_comments(\n      ::std::string* trailing_comments);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo.Location)\n private:\n  void set_has_leading_comments();\n  void clear_has_leading_comments();\n  void set_has_trailing_comments();\n  void clear_has_trailing_comments();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > path_;\n  mutable int _path_cached_byte_size_;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > span_;\n  mutable int _span_cached_byte_size_;\n  ::google::protobuf::RepeatedPtrField< ::std::string> leading_detached_comments_;\n  ::google::protobuf::internal::ArenaStringPtr leading_comments_;\n  ::google::protobuf::internal::ArenaStringPtr trailing_comments_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceCodeInfo) */ {\n public:\n  SourceCodeInfo();\n  virtual ~SourceCodeInfo();\n\n  SourceCodeInfo(const SourceCodeInfo& from);\n\n  inline SourceCodeInfo& operator=(const SourceCodeInfo& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  SourceCodeInfo(SourceCodeInfo&& from) noexcept\n    : SourceCodeInfo() {\n    *this = ::std::move(from);\n  }\n\n  inline SourceCodeInfo& operator=(SourceCodeInfo&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const SourceCodeInfo& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const SourceCodeInfo* internal_default_instance() {\n    return reinterpret_cast<const SourceCodeInfo*>(\n               &_SourceCodeInfo_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    24;\n\n  void UnsafeArenaSwap(SourceCodeInfo* other);\n  void Swap(SourceCodeInfo* other);\n  friend void swap(SourceCodeInfo& a, SourceCodeInfo& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline SourceCodeInfo* New() const final {\n    return CreateMaybeMessage<SourceCodeInfo>(NULL);\n  }\n\n  SourceCodeInfo* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<SourceCodeInfo>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const SourceCodeInfo& from);\n  void MergeFrom(const SourceCodeInfo& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(SourceCodeInfo* other);\n  protected:\n  explicit SourceCodeInfo(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef SourceCodeInfo_Location Location;\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.SourceCodeInfo.Location location = 1;\n  int location_size() const;\n  void clear_location();\n  static const int kLocationFieldNumber = 1;\n  ::google::protobuf::SourceCodeInfo_Location* mutable_location(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >*\n      mutable_location();\n  const ::google::protobuf::SourceCodeInfo_Location& location(int index) const;\n  ::google::protobuf::SourceCodeInfo_Location* add_location();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >&\n      location() const;\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location > location_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo.Annotation) */ {\n public:\n  GeneratedCodeInfo_Annotation();\n  virtual ~GeneratedCodeInfo_Annotation();\n\n  GeneratedCodeInfo_Annotation(const GeneratedCodeInfo_Annotation& from);\n\n  inline GeneratedCodeInfo_Annotation& operator=(const GeneratedCodeInfo_Annotation& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  GeneratedCodeInfo_Annotation(GeneratedCodeInfo_Annotation&& from) noexcept\n    : GeneratedCodeInfo_Annotation() {\n    *this = ::std::move(from);\n  }\n\n  inline GeneratedCodeInfo_Annotation& operator=(GeneratedCodeInfo_Annotation&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const GeneratedCodeInfo_Annotation& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const GeneratedCodeInfo_Annotation* internal_default_instance() {\n    return reinterpret_cast<const GeneratedCodeInfo_Annotation*>(\n               &_GeneratedCodeInfo_Annotation_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    25;\n\n  void UnsafeArenaSwap(GeneratedCodeInfo_Annotation* other);\n  void Swap(GeneratedCodeInfo_Annotation* other);\n  friend void swap(GeneratedCodeInfo_Annotation& a, GeneratedCodeInfo_Annotation& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline GeneratedCodeInfo_Annotation* New() const final {\n    return CreateMaybeMessage<GeneratedCodeInfo_Annotation>(NULL);\n  }\n\n  GeneratedCodeInfo_Annotation* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<GeneratedCodeInfo_Annotation>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const GeneratedCodeInfo_Annotation& from);\n  void MergeFrom(const GeneratedCodeInfo_Annotation& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(GeneratedCodeInfo_Annotation* other);\n  protected:\n  explicit GeneratedCodeInfo_Annotation(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated int32 path = 1 [packed = true];\n  int path_size() const;\n  void clear_path();\n  static const int kPathFieldNumber = 1;\n  ::google::protobuf::int32 path(int index) const;\n  void set_path(int index, ::google::protobuf::int32 value);\n  void add_path(::google::protobuf::int32 value);\n  const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\n      path() const;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\n      mutable_path();\n\n  // optional string source_file = 2;\n  bool has_source_file() const;\n  void clear_source_file();\n  static const int kSourceFileFieldNumber = 2;\n  const ::std::string& source_file() const;\n  void set_source_file(const ::std::string& value);\n  #if LANG_CXX11\n  void set_source_file(::std::string&& value);\n  #endif\n  void set_source_file(const char* value);\n  void set_source_file(const char* value, size_t size);\n  ::std::string* mutable_source_file();\n  ::std::string* release_source_file();\n  void set_allocated_source_file(::std::string* source_file);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_source_file();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_source_file(\n      ::std::string* source_file);\n\n  // optional int32 begin = 3;\n  bool has_begin() const;\n  void clear_begin();\n  static const int kBeginFieldNumber = 3;\n  ::google::protobuf::int32 begin() const;\n  void set_begin(::google::protobuf::int32 value);\n\n  // optional int32 end = 4;\n  bool has_end() const;\n  void clear_end();\n  static const int kEndFieldNumber = 4;\n  ::google::protobuf::int32 end() const;\n  void set_end(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo.Annotation)\n private:\n  void set_has_source_file();\n  void clear_has_source_file();\n  void set_has_begin();\n  void clear_has_begin();\n  void set_has_end();\n  void clear_has_end();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > path_;\n  mutable int _path_cached_byte_size_;\n  ::google::protobuf::internal::ArenaStringPtr source_file_;\n  ::google::protobuf::int32 begin_;\n  ::google::protobuf::int32 end_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.GeneratedCodeInfo) */ {\n public:\n  GeneratedCodeInfo();\n  virtual ~GeneratedCodeInfo();\n\n  GeneratedCodeInfo(const GeneratedCodeInfo& from);\n\n  inline GeneratedCodeInfo& operator=(const GeneratedCodeInfo& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  GeneratedCodeInfo(GeneratedCodeInfo&& from) noexcept\n    : GeneratedCodeInfo() {\n    *this = ::std::move(from);\n  }\n\n  inline GeneratedCodeInfo& operator=(GeneratedCodeInfo&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {\n    return _internal_metadata_.unknown_fields();\n  }\n  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {\n    return _internal_metadata_.mutable_unknown_fields();\n  }\n\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const GeneratedCodeInfo& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const GeneratedCodeInfo* internal_default_instance() {\n    return reinterpret_cast<const GeneratedCodeInfo*>(\n               &_GeneratedCodeInfo_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    26;\n\n  void UnsafeArenaSwap(GeneratedCodeInfo* other);\n  void Swap(GeneratedCodeInfo* other);\n  friend void swap(GeneratedCodeInfo& a, GeneratedCodeInfo& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline GeneratedCodeInfo* New() const final {\n    return CreateMaybeMessage<GeneratedCodeInfo>(NULL);\n  }\n\n  GeneratedCodeInfo* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<GeneratedCodeInfo>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const GeneratedCodeInfo& from);\n  void MergeFrom(const GeneratedCodeInfo& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(GeneratedCodeInfo* other);\n  protected:\n  explicit GeneratedCodeInfo(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef GeneratedCodeInfo_Annotation Annotation;\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;\n  int annotation_size() const;\n  void clear_annotation();\n  static const int kAnnotationFieldNumber = 1;\n  ::google::protobuf::GeneratedCodeInfo_Annotation* mutable_annotation(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >*\n      mutable_annotation();\n  const ::google::protobuf::GeneratedCodeInfo_Annotation& annotation(int index) const;\n  ::google::protobuf::GeneratedCodeInfo_Annotation* add_annotation();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >&\n      annotation() const;\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::HasBits<1> _has_bits_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation > annotation_;\n  friend struct ::protobuf_google_2fprotobuf_2fdescriptor_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// FileDescriptorSet\n\n// repeated .google.protobuf.FileDescriptorProto file = 1;\ninline int FileDescriptorSet::file_size() const {\n  return file_.size();\n}\ninline void FileDescriptorSet::clear_file() {\n  file_.Clear();\n}\ninline ::google::protobuf::FileDescriptorProto* FileDescriptorSet::mutable_file(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorSet.file)\n  return file_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >*\nFileDescriptorSet::mutable_file() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorSet.file)\n  return &file_;\n}\ninline const ::google::protobuf::FileDescriptorProto& FileDescriptorSet::file(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorSet.file)\n  return file_.Get(index);\n}\ninline ::google::protobuf::FileDescriptorProto* FileDescriptorSet::add_file() {\n  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorSet.file)\n  return file_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >&\nFileDescriptorSet::file() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorSet.file)\n  return file_;\n}\n\n// -------------------------------------------------------------------\n\n// FileDescriptorProto\n\n// optional string name = 1;\ninline bool FileDescriptorProto::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void FileDescriptorProto::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void FileDescriptorProto::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void FileDescriptorProto::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_name();\n}\ninline const ::std::string& FileDescriptorProto::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.name)\n  return name_.Get();\n}\ninline void FileDescriptorProto::set_name(const ::std::string& value) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.name)\n}\n#if LANG_CXX11\ninline void FileDescriptorProto::set_name(::std::string&& value) {\n  set_has_name();\n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileDescriptorProto.name)\n}\n#endif\ninline void FileDescriptorProto::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.name)\n}\ninline void FileDescriptorProto::set_name(const char* value,\n    size_t size) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.name)\n}\ninline ::std::string* FileDescriptorProto::mutable_name() {\n  set_has_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileDescriptorProto::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.name)\n  if (!has_name()) {\n    return NULL;\n  }\n  clear_has_name();\n  return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileDescriptorProto::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.name)\n}\ninline ::std::string* FileDescriptorProto::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_name();\n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileDescriptorProto::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.name)\n}\n\n// optional string package = 2;\ninline bool FileDescriptorProto::has_package() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void FileDescriptorProto::set_has_package() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void FileDescriptorProto::clear_has_package() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void FileDescriptorProto::clear_package() {\n  package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_package();\n}\ninline const ::std::string& FileDescriptorProto::package() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.package)\n  return package_.Get();\n}\ninline void FileDescriptorProto::set_package(const ::std::string& value) {\n  set_has_package();\n  package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.package)\n}\n#if LANG_CXX11\ninline void FileDescriptorProto::set_package(::std::string&& value) {\n  set_has_package();\n  package_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileDescriptorProto.package)\n}\n#endif\ninline void FileDescriptorProto::set_package(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_package();\n  package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.package)\n}\ninline void FileDescriptorProto::set_package(const char* value,\n    size_t size) {\n  set_has_package();\n  package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.package)\n}\ninline ::std::string* FileDescriptorProto::mutable_package() {\n  set_has_package();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.package)\n  return package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileDescriptorProto::release_package() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.package)\n  if (!has_package()) {\n    return NULL;\n  }\n  clear_has_package();\n  return package_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileDescriptorProto::set_allocated_package(::std::string* package) {\n  if (package != NULL) {\n    set_has_package();\n  } else {\n    clear_has_package();\n  }\n  package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), package,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.package)\n}\ninline ::std::string* FileDescriptorProto::unsafe_arena_release_package() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.package)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_package();\n  return package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileDescriptorProto::unsafe_arena_set_allocated_package(\n    ::std::string* package) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (package != NULL) {\n    set_has_package();\n  } else {\n    clear_has_package();\n  }\n  package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      package, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.package)\n}\n\n// repeated string dependency = 3;\ninline int FileDescriptorProto::dependency_size() const {\n  return dependency_.size();\n}\ninline void FileDescriptorProto::clear_dependency() {\n  dependency_.Clear();\n}\ninline const ::std::string& FileDescriptorProto::dependency(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.dependency)\n  return dependency_.Get(index);\n}\ninline ::std::string* FileDescriptorProto::mutable_dependency(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.dependency)\n  return dependency_.Mutable(index);\n}\ninline void FileDescriptorProto::set_dependency(int index, const ::std::string& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency)\n  dependency_.Mutable(index)->assign(value);\n}\n#if LANG_CXX11\ninline void FileDescriptorProto::set_dependency(int index, ::std::string&& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency)\n  dependency_.Mutable(index)->assign(std::move(value));\n}\n#endif\ninline void FileDescriptorProto::set_dependency(int index, const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  dependency_.Mutable(index)->assign(value);\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.dependency)\n}\ninline void FileDescriptorProto::set_dependency(int index, const char* value, size_t size) {\n  dependency_.Mutable(index)->assign(\n    reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.dependency)\n}\ninline ::std::string* FileDescriptorProto::add_dependency() {\n  // @@protoc_insertion_point(field_add_mutable:google.protobuf.FileDescriptorProto.dependency)\n  return dependency_.Add();\n}\ninline void FileDescriptorProto::add_dependency(const ::std::string& value) {\n  dependency_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency)\n}\n#if LANG_CXX11\ninline void FileDescriptorProto::add_dependency(::std::string&& value) {\n  dependency_.Add(std::move(value));\n  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency)\n}\n#endif\ninline void FileDescriptorProto::add_dependency(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  dependency_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add_char:google.protobuf.FileDescriptorProto.dependency)\n}\ninline void FileDescriptorProto::add_dependency(const char* value, size_t size) {\n  dependency_.Add()->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_add_pointer:google.protobuf.FileDescriptorProto.dependency)\n}\ninline const ::google::protobuf::RepeatedPtrField< ::std::string>&\nFileDescriptorProto::dependency() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.dependency)\n  return dependency_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::std::string>*\nFileDescriptorProto::mutable_dependency() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.dependency)\n  return &dependency_;\n}\n\n// repeated int32 public_dependency = 10;\ninline int FileDescriptorProto::public_dependency_size() const {\n  return public_dependency_.size();\n}\ninline void FileDescriptorProto::clear_public_dependency() {\n  public_dependency_.Clear();\n}\ninline ::google::protobuf::int32 FileDescriptorProto::public_dependency(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.public_dependency)\n  return public_dependency_.Get(index);\n}\ninline void FileDescriptorProto::set_public_dependency(int index, ::google::protobuf::int32 value) {\n  public_dependency_.Set(index, value);\n  // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.public_dependency)\n}\ninline void FileDescriptorProto::add_public_dependency(::google::protobuf::int32 value) {\n  public_dependency_.Add(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.public_dependency)\n}\ninline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\nFileDescriptorProto::public_dependency() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.public_dependency)\n  return public_dependency_;\n}\ninline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\nFileDescriptorProto::mutable_public_dependency() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.public_dependency)\n  return &public_dependency_;\n}\n\n// repeated int32 weak_dependency = 11;\ninline int FileDescriptorProto::weak_dependency_size() const {\n  return weak_dependency_.size();\n}\ninline void FileDescriptorProto::clear_weak_dependency() {\n  weak_dependency_.Clear();\n}\ninline ::google::protobuf::int32 FileDescriptorProto::weak_dependency(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.weak_dependency)\n  return weak_dependency_.Get(index);\n}\ninline void FileDescriptorProto::set_weak_dependency(int index, ::google::protobuf::int32 value) {\n  weak_dependency_.Set(index, value);\n  // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.weak_dependency)\n}\ninline void FileDescriptorProto::add_weak_dependency(::google::protobuf::int32 value) {\n  weak_dependency_.Add(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.weak_dependency)\n}\ninline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\nFileDescriptorProto::weak_dependency() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.weak_dependency)\n  return weak_dependency_;\n}\ninline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\nFileDescriptorProto::mutable_weak_dependency() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.weak_dependency)\n  return &weak_dependency_;\n}\n\n// repeated .google.protobuf.DescriptorProto message_type = 4;\ninline int FileDescriptorProto::message_type_size() const {\n  return message_type_.size();\n}\ninline void FileDescriptorProto::clear_message_type() {\n  message_type_.Clear();\n}\ninline ::google::protobuf::DescriptorProto* FileDescriptorProto::mutable_message_type(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.message_type)\n  return message_type_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >*\nFileDescriptorProto::mutable_message_type() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.message_type)\n  return &message_type_;\n}\ninline const ::google::protobuf::DescriptorProto& FileDescriptorProto::message_type(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.message_type)\n  return message_type_.Get(index);\n}\ninline ::google::protobuf::DescriptorProto* FileDescriptorProto::add_message_type() {\n  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.message_type)\n  return message_type_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >&\nFileDescriptorProto::message_type() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.message_type)\n  return message_type_;\n}\n\n// repeated .google.protobuf.EnumDescriptorProto enum_type = 5;\ninline int FileDescriptorProto::enum_type_size() const {\n  return enum_type_.size();\n}\ninline void FileDescriptorProto::clear_enum_type() {\n  enum_type_.Clear();\n}\ninline ::google::protobuf::EnumDescriptorProto* FileDescriptorProto::mutable_enum_type(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.enum_type)\n  return enum_type_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >*\nFileDescriptorProto::mutable_enum_type() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.enum_type)\n  return &enum_type_;\n}\ninline const ::google::protobuf::EnumDescriptorProto& FileDescriptorProto::enum_type(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.enum_type)\n  return enum_type_.Get(index);\n}\ninline ::google::protobuf::EnumDescriptorProto* FileDescriptorProto::add_enum_type() {\n  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.enum_type)\n  return enum_type_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >&\nFileDescriptorProto::enum_type() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.enum_type)\n  return enum_type_;\n}\n\n// repeated .google.protobuf.ServiceDescriptorProto service = 6;\ninline int FileDescriptorProto::service_size() const {\n  return service_.size();\n}\ninline void FileDescriptorProto::clear_service() {\n  service_.Clear();\n}\ninline ::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::mutable_service(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.service)\n  return service_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >*\nFileDescriptorProto::mutable_service() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.service)\n  return &service_;\n}\ninline const ::google::protobuf::ServiceDescriptorProto& FileDescriptorProto::service(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.service)\n  return service_.Get(index);\n}\ninline ::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::add_service() {\n  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.service)\n  return service_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >&\nFileDescriptorProto::service() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.service)\n  return service_;\n}\n\n// repeated .google.protobuf.FieldDescriptorProto extension = 7;\ninline int FileDescriptorProto::extension_size() const {\n  return extension_.size();\n}\ninline void FileDescriptorProto::clear_extension() {\n  extension_.Clear();\n}\ninline ::google::protobuf::FieldDescriptorProto* FileDescriptorProto::mutable_extension(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.extension)\n  return extension_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*\nFileDescriptorProto::mutable_extension() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.extension)\n  return &extension_;\n}\ninline const ::google::protobuf::FieldDescriptorProto& FileDescriptorProto::extension(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.extension)\n  return extension_.Get(index);\n}\ninline ::google::protobuf::FieldDescriptorProto* FileDescriptorProto::add_extension() {\n  // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.extension)\n  return extension_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&\nFileDescriptorProto::extension() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.extension)\n  return extension_;\n}\n\n// optional .google.protobuf.FileOptions options = 8;\ninline bool FileDescriptorProto::has_options() const {\n  return (_has_bits_[0] & 0x00000008u) != 0;\n}\ninline void FileDescriptorProto::set_has_options() {\n  _has_bits_[0] |= 0x00000008u;\n}\ninline void FileDescriptorProto::clear_has_options() {\n  _has_bits_[0] &= ~0x00000008u;\n}\ninline void FileDescriptorProto::clear_options() {\n  if (options_ != NULL) options_->Clear();\n  clear_has_options();\n}\ninline const ::google::protobuf::FileOptions& FileDescriptorProto::_internal_options() const {\n  return *options_;\n}\ninline const ::google::protobuf::FileOptions& FileDescriptorProto::options() const {\n  const ::google::protobuf::FileOptions* p = options_;\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.options)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::FileOptions*>(\n      &::google::protobuf::_FileOptions_default_instance_);\n}\ninline ::google::protobuf::FileOptions* FileDescriptorProto::release_options() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::FileOptions* temp = options_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::FileOptions* FileDescriptorProto::unsafe_arena_release_options() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::FileOptions* temp = options_;\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() {\n  set_has_options();\n  if (options_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::FileOptions>(GetArenaNoVirtual());\n    options_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.options)\n  return options_;\n}\ninline void FileDescriptorProto::set_allocated_options(::google::protobuf::FileOptions* options) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete options_;\n  }\n  if (options) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(options);\n    if (message_arena != submessage_arena) {\n      options = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, options, submessage_arena);\n    }\n    set_has_options();\n  } else {\n    clear_has_options();\n  }\n  options_ = options;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.options)\n}\n\n// optional .google.protobuf.SourceCodeInfo source_code_info = 9;\ninline bool FileDescriptorProto::has_source_code_info() const {\n  return (_has_bits_[0] & 0x00000010u) != 0;\n}\ninline void FileDescriptorProto::set_has_source_code_info() {\n  _has_bits_[0] |= 0x00000010u;\n}\ninline void FileDescriptorProto::clear_has_source_code_info() {\n  _has_bits_[0] &= ~0x00000010u;\n}\ninline void FileDescriptorProto::clear_source_code_info() {\n  if (source_code_info_ != NULL) source_code_info_->Clear();\n  clear_has_source_code_info();\n}\ninline const ::google::protobuf::SourceCodeInfo& FileDescriptorProto::_internal_source_code_info() const {\n  return *source_code_info_;\n}\ninline const ::google::protobuf::SourceCodeInfo& FileDescriptorProto::source_code_info() const {\n  const ::google::protobuf::SourceCodeInfo* p = source_code_info_;\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.source_code_info)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::SourceCodeInfo*>(\n      &::google::protobuf::_SourceCodeInfo_default_instance_);\n}\ninline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::release_source_code_info() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.source_code_info)\n  clear_has_source_code_info();\n  ::google::protobuf::SourceCodeInfo* temp = source_code_info_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  source_code_info_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::unsafe_arena_release_source_code_info() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.source_code_info)\n  clear_has_source_code_info();\n  ::google::protobuf::SourceCodeInfo* temp = source_code_info_;\n  source_code_info_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::mutable_source_code_info() {\n  set_has_source_code_info();\n  if (source_code_info_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::SourceCodeInfo>(GetArenaNoVirtual());\n    source_code_info_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.source_code_info)\n  return source_code_info_;\n}\ninline void FileDescriptorProto::set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete source_code_info_;\n  }\n  if (source_code_info) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(source_code_info);\n    if (message_arena != submessage_arena) {\n      source_code_info = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, source_code_info, submessage_arena);\n    }\n    set_has_source_code_info();\n  } else {\n    clear_has_source_code_info();\n  }\n  source_code_info_ = source_code_info;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.source_code_info)\n}\n\n// optional string syntax = 12;\ninline bool FileDescriptorProto::has_syntax() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void FileDescriptorProto::set_has_syntax() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void FileDescriptorProto::clear_has_syntax() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void FileDescriptorProto::clear_syntax() {\n  syntax_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_syntax();\n}\ninline const ::std::string& FileDescriptorProto::syntax() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.syntax)\n  return syntax_.Get();\n}\ninline void FileDescriptorProto::set_syntax(const ::std::string& value) {\n  set_has_syntax();\n  syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.syntax)\n}\n#if LANG_CXX11\ninline void FileDescriptorProto::set_syntax(::std::string&& value) {\n  set_has_syntax();\n  syntax_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileDescriptorProto.syntax)\n}\n#endif\ninline void FileDescriptorProto::set_syntax(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_syntax();\n  syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.syntax)\n}\ninline void FileDescriptorProto::set_syntax(const char* value,\n    size_t size) {\n  set_has_syntax();\n  syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.syntax)\n}\ninline ::std::string* FileDescriptorProto::mutable_syntax() {\n  set_has_syntax();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.syntax)\n  return syntax_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileDescriptorProto::release_syntax() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.syntax)\n  if (!has_syntax()) {\n    return NULL;\n  }\n  clear_has_syntax();\n  return syntax_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileDescriptorProto::set_allocated_syntax(::std::string* syntax) {\n  if (syntax != NULL) {\n    set_has_syntax();\n  } else {\n    clear_has_syntax();\n  }\n  syntax_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), syntax,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.syntax)\n}\ninline ::std::string* FileDescriptorProto::unsafe_arena_release_syntax() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.syntax)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_syntax();\n  return syntax_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileDescriptorProto::unsafe_arena_set_allocated_syntax(\n    ::std::string* syntax) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (syntax != NULL) {\n    set_has_syntax();\n  } else {\n    clear_has_syntax();\n  }\n  syntax_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      syntax, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.syntax)\n}\n\n// -------------------------------------------------------------------\n\n// DescriptorProto_ExtensionRange\n\n// optional int32 start = 1;\ninline bool DescriptorProto_ExtensionRange::has_start() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void DescriptorProto_ExtensionRange::set_has_start() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void DescriptorProto_ExtensionRange::clear_has_start() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void DescriptorProto_ExtensionRange::clear_start() {\n  start_ = 0;\n  clear_has_start();\n}\ninline ::google::protobuf::int32 DescriptorProto_ExtensionRange::start() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.start)\n  return start_;\n}\ninline void DescriptorProto_ExtensionRange::set_start(::google::protobuf::int32 value) {\n  set_has_start();\n  start_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.start)\n}\n\n// optional int32 end = 2;\ninline bool DescriptorProto_ExtensionRange::has_end() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void DescriptorProto_ExtensionRange::set_has_end() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void DescriptorProto_ExtensionRange::clear_has_end() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void DescriptorProto_ExtensionRange::clear_end() {\n  end_ = 0;\n  clear_has_end();\n}\ninline ::google::protobuf::int32 DescriptorProto_ExtensionRange::end() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.end)\n  return end_;\n}\ninline void DescriptorProto_ExtensionRange::set_end(::google::protobuf::int32 value) {\n  set_has_end();\n  end_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.end)\n}\n\n// optional .google.protobuf.ExtensionRangeOptions options = 3;\ninline bool DescriptorProto_ExtensionRange::has_options() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void DescriptorProto_ExtensionRange::set_has_options() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void DescriptorProto_ExtensionRange::clear_has_options() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void DescriptorProto_ExtensionRange::clear_options() {\n  if (options_ != NULL) options_->Clear();\n  clear_has_options();\n}\ninline const ::google::protobuf::ExtensionRangeOptions& DescriptorProto_ExtensionRange::_internal_options() const {\n  return *options_;\n}\ninline const ::google::protobuf::ExtensionRangeOptions& DescriptorProto_ExtensionRange::options() const {\n  const ::google::protobuf::ExtensionRangeOptions* p = options_;\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.options)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::ExtensionRangeOptions*>(\n      &::google::protobuf::_ExtensionRangeOptions_default_instance_);\n}\ninline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::release_options() {\n  // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.ExtensionRange.options)\n  clear_has_options();\n  ::google::protobuf::ExtensionRangeOptions* temp = options_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::unsafe_arena_release_options() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.ExtensionRange.options)\n  clear_has_options();\n  ::google::protobuf::ExtensionRangeOptions* temp = options_;\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::mutable_options() {\n  set_has_options();\n  if (options_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::ExtensionRangeOptions>(GetArenaNoVirtual());\n    options_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.ExtensionRange.options)\n  return options_;\n}\ninline void DescriptorProto_ExtensionRange::set_allocated_options(::google::protobuf::ExtensionRangeOptions* options) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete options_;\n  }\n  if (options) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(options);\n    if (message_arena != submessage_arena) {\n      options = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, options, submessage_arena);\n    }\n    set_has_options();\n  } else {\n    clear_has_options();\n  }\n  options_ = options;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.ExtensionRange.options)\n}\n\n// -------------------------------------------------------------------\n\n// DescriptorProto_ReservedRange\n\n// optional int32 start = 1;\ninline bool DescriptorProto_ReservedRange::has_start() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void DescriptorProto_ReservedRange::set_has_start() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void DescriptorProto_ReservedRange::clear_has_start() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void DescriptorProto_ReservedRange::clear_start() {\n  start_ = 0;\n  clear_has_start();\n}\ninline ::google::protobuf::int32 DescriptorProto_ReservedRange::start() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.start)\n  return start_;\n}\ninline void DescriptorProto_ReservedRange::set_start(::google::protobuf::int32 value) {\n  set_has_start();\n  start_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.start)\n}\n\n// optional int32 end = 2;\ninline bool DescriptorProto_ReservedRange::has_end() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void DescriptorProto_ReservedRange::set_has_end() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void DescriptorProto_ReservedRange::clear_has_end() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void DescriptorProto_ReservedRange::clear_end() {\n  end_ = 0;\n  clear_has_end();\n}\ninline ::google::protobuf::int32 DescriptorProto_ReservedRange::end() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.end)\n  return end_;\n}\ninline void DescriptorProto_ReservedRange::set_end(::google::protobuf::int32 value) {\n  set_has_end();\n  end_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.end)\n}\n\n// -------------------------------------------------------------------\n\n// DescriptorProto\n\n// optional string name = 1;\ninline bool DescriptorProto::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void DescriptorProto::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void DescriptorProto::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void DescriptorProto::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_name();\n}\ninline const ::std::string& DescriptorProto::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.name)\n  return name_.Get();\n}\ninline void DescriptorProto::set_name(const ::std::string& value) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.name)\n}\n#if LANG_CXX11\ninline void DescriptorProto::set_name(::std::string&& value) {\n  set_has_name();\n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.DescriptorProto.name)\n}\n#endif\ninline void DescriptorProto::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.name)\n}\ninline void DescriptorProto::set_name(const char* value,\n    size_t size) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.name)\n}\ninline ::std::string* DescriptorProto::mutable_name() {\n  set_has_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* DescriptorProto::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.name)\n  if (!has_name()) {\n    return NULL;\n  }\n  clear_has_name();\n  return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void DescriptorProto::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.name)\n}\ninline ::std::string* DescriptorProto::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_name();\n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void DescriptorProto::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.name)\n}\n\n// repeated .google.protobuf.FieldDescriptorProto field = 2;\ninline int DescriptorProto::field_size() const {\n  return field_.size();\n}\ninline void DescriptorProto::clear_field() {\n  field_.Clear();\n}\ninline ::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_field(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.field)\n  return field_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*\nDescriptorProto::mutable_field() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.field)\n  return &field_;\n}\ninline const ::google::protobuf::FieldDescriptorProto& DescriptorProto::field(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.field)\n  return field_.Get(index);\n}\ninline ::google::protobuf::FieldDescriptorProto* DescriptorProto::add_field() {\n  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.field)\n  return field_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&\nDescriptorProto::field() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.field)\n  return field_;\n}\n\n// repeated .google.protobuf.FieldDescriptorProto extension = 6;\ninline int DescriptorProto::extension_size() const {\n  return extension_.size();\n}\ninline void DescriptorProto::clear_extension() {\n  extension_.Clear();\n}\ninline ::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_extension(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension)\n  return extension_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >*\nDescriptorProto::mutable_extension() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension)\n  return &extension_;\n}\ninline const ::google::protobuf::FieldDescriptorProto& DescriptorProto::extension(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension)\n  return extension_.Get(index);\n}\ninline ::google::protobuf::FieldDescriptorProto* DescriptorProto::add_extension() {\n  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension)\n  return extension_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >&\nDescriptorProto::extension() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension)\n  return extension_;\n}\n\n// repeated .google.protobuf.DescriptorProto nested_type = 3;\ninline int DescriptorProto::nested_type_size() const {\n  return nested_type_.size();\n}\ninline void DescriptorProto::clear_nested_type() {\n  nested_type_.Clear();\n}\ninline ::google::protobuf::DescriptorProto* DescriptorProto::mutable_nested_type(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.nested_type)\n  return nested_type_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >*\nDescriptorProto::mutable_nested_type() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.nested_type)\n  return &nested_type_;\n}\ninline const ::google::protobuf::DescriptorProto& DescriptorProto::nested_type(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.nested_type)\n  return nested_type_.Get(index);\n}\ninline ::google::protobuf::DescriptorProto* DescriptorProto::add_nested_type() {\n  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.nested_type)\n  return nested_type_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >&\nDescriptorProto::nested_type() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.nested_type)\n  return nested_type_;\n}\n\n// repeated .google.protobuf.EnumDescriptorProto enum_type = 4;\ninline int DescriptorProto::enum_type_size() const {\n  return enum_type_.size();\n}\ninline void DescriptorProto::clear_enum_type() {\n  enum_type_.Clear();\n}\ninline ::google::protobuf::EnumDescriptorProto* DescriptorProto::mutable_enum_type(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.enum_type)\n  return enum_type_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >*\nDescriptorProto::mutable_enum_type() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.enum_type)\n  return &enum_type_;\n}\ninline const ::google::protobuf::EnumDescriptorProto& DescriptorProto::enum_type(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.enum_type)\n  return enum_type_.Get(index);\n}\ninline ::google::protobuf::EnumDescriptorProto* DescriptorProto::add_enum_type() {\n  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.enum_type)\n  return enum_type_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >&\nDescriptorProto::enum_type() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.enum_type)\n  return enum_type_;\n}\n\n// repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;\ninline int DescriptorProto::extension_range_size() const {\n  return extension_range_.size();\n}\ninline void DescriptorProto::clear_extension_range() {\n  extension_range_.Clear();\n}\ninline ::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::mutable_extension_range(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension_range)\n  return extension_range_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >*\nDescriptorProto::mutable_extension_range() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension_range)\n  return &extension_range_;\n}\ninline const ::google::protobuf::DescriptorProto_ExtensionRange& DescriptorProto::extension_range(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension_range)\n  return extension_range_.Get(index);\n}\ninline ::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::add_extension_range() {\n  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension_range)\n  return extension_range_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >&\nDescriptorProto::extension_range() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension_range)\n  return extension_range_;\n}\n\n// repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;\ninline int DescriptorProto::oneof_decl_size() const {\n  return oneof_decl_.size();\n}\ninline void DescriptorProto::clear_oneof_decl() {\n  oneof_decl_.Clear();\n}\ninline ::google::protobuf::OneofDescriptorProto* DescriptorProto::mutable_oneof_decl(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.oneof_decl)\n  return oneof_decl_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >*\nDescriptorProto::mutable_oneof_decl() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.oneof_decl)\n  return &oneof_decl_;\n}\ninline const ::google::protobuf::OneofDescriptorProto& DescriptorProto::oneof_decl(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.oneof_decl)\n  return oneof_decl_.Get(index);\n}\ninline ::google::protobuf::OneofDescriptorProto* DescriptorProto::add_oneof_decl() {\n  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.oneof_decl)\n  return oneof_decl_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >&\nDescriptorProto::oneof_decl() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.oneof_decl)\n  return oneof_decl_;\n}\n\n// optional .google.protobuf.MessageOptions options = 7;\ninline bool DescriptorProto::has_options() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void DescriptorProto::set_has_options() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void DescriptorProto::clear_has_options() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void DescriptorProto::clear_options() {\n  if (options_ != NULL) options_->Clear();\n  clear_has_options();\n}\ninline const ::google::protobuf::MessageOptions& DescriptorProto::_internal_options() const {\n  return *options_;\n}\ninline const ::google::protobuf::MessageOptions& DescriptorProto::options() const {\n  const ::google::protobuf::MessageOptions* p = options_;\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.options)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::MessageOptions*>(\n      &::google::protobuf::_MessageOptions_default_instance_);\n}\ninline ::google::protobuf::MessageOptions* DescriptorProto::release_options() {\n  // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::MessageOptions* temp = options_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::MessageOptions* DescriptorProto::unsafe_arena_release_options() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::MessageOptions* temp = options_;\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::MessageOptions* DescriptorProto::mutable_options() {\n  set_has_options();\n  if (options_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::MessageOptions>(GetArenaNoVirtual());\n    options_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.options)\n  return options_;\n}\ninline void DescriptorProto::set_allocated_options(::google::protobuf::MessageOptions* options) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete options_;\n  }\n  if (options) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(options);\n    if (message_arena != submessage_arena) {\n      options = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, options, submessage_arena);\n    }\n    set_has_options();\n  } else {\n    clear_has_options();\n  }\n  options_ = options;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.options)\n}\n\n// repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;\ninline int DescriptorProto::reserved_range_size() const {\n  return reserved_range_.size();\n}\ninline void DescriptorProto::clear_reserved_range() {\n  reserved_range_.Clear();\n}\ninline ::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::mutable_reserved_range(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_range)\n  return reserved_range_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >*\nDescriptorProto::mutable_reserved_range() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_range)\n  return &reserved_range_;\n}\ninline const ::google::protobuf::DescriptorProto_ReservedRange& DescriptorProto::reserved_range(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_range)\n  return reserved_range_.Get(index);\n}\ninline ::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::add_reserved_range() {\n  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_range)\n  return reserved_range_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >&\nDescriptorProto::reserved_range() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_range)\n  return reserved_range_;\n}\n\n// repeated string reserved_name = 10;\ninline int DescriptorProto::reserved_name_size() const {\n  return reserved_name_.size();\n}\ninline void DescriptorProto::clear_reserved_name() {\n  reserved_name_.Clear();\n}\ninline const ::std::string& DescriptorProto::reserved_name(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_name)\n  return reserved_name_.Get(index);\n}\ninline ::std::string* DescriptorProto::mutable_reserved_name(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_name)\n  return reserved_name_.Mutable(index);\n}\ninline void DescriptorProto::set_reserved_name(int index, const ::std::string& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name)\n  reserved_name_.Mutable(index)->assign(value);\n}\n#if LANG_CXX11\ninline void DescriptorProto::set_reserved_name(int index, ::std::string&& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name)\n  reserved_name_.Mutable(index)->assign(std::move(value));\n}\n#endif\ninline void DescriptorProto::set_reserved_name(int index, const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  reserved_name_.Mutable(index)->assign(value);\n  // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.reserved_name)\n}\ninline void DescriptorProto::set_reserved_name(int index, const char* value, size_t size) {\n  reserved_name_.Mutable(index)->assign(\n    reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.reserved_name)\n}\ninline ::std::string* DescriptorProto::add_reserved_name() {\n  // @@protoc_insertion_point(field_add_mutable:google.protobuf.DescriptorProto.reserved_name)\n  return reserved_name_.Add();\n}\ninline void DescriptorProto::add_reserved_name(const ::std::string& value) {\n  reserved_name_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name)\n}\n#if LANG_CXX11\ninline void DescriptorProto::add_reserved_name(::std::string&& value) {\n  reserved_name_.Add(std::move(value));\n  // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name)\n}\n#endif\ninline void DescriptorProto::add_reserved_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  reserved_name_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add_char:google.protobuf.DescriptorProto.reserved_name)\n}\ninline void DescriptorProto::add_reserved_name(const char* value, size_t size) {\n  reserved_name_.Add()->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_add_pointer:google.protobuf.DescriptorProto.reserved_name)\n}\ninline const ::google::protobuf::RepeatedPtrField< ::std::string>&\nDescriptorProto::reserved_name() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_name)\n  return reserved_name_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::std::string>*\nDescriptorProto::mutable_reserved_name() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_name)\n  return &reserved_name_;\n}\n\n// -------------------------------------------------------------------\n\n// ExtensionRangeOptions\n\n// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\ninline int ExtensionRangeOptions::uninterpreted_option_size() const {\n  return uninterpreted_option_.size();\n}\ninline void ExtensionRangeOptions::clear_uninterpreted_option() {\n  uninterpreted_option_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption* ExtensionRangeOptions::mutable_uninterpreted_option(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.ExtensionRangeOptions.uninterpreted_option)\n  return uninterpreted_option_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\nExtensionRangeOptions::mutable_uninterpreted_option() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.ExtensionRangeOptions.uninterpreted_option)\n  return &uninterpreted_option_;\n}\ninline const ::google::protobuf::UninterpretedOption& ExtensionRangeOptions::uninterpreted_option(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.ExtensionRangeOptions.uninterpreted_option)\n  return uninterpreted_option_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption* ExtensionRangeOptions::add_uninterpreted_option() {\n  // @@protoc_insertion_point(field_add:google.protobuf.ExtensionRangeOptions.uninterpreted_option)\n  return uninterpreted_option_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\nExtensionRangeOptions::uninterpreted_option() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.ExtensionRangeOptions.uninterpreted_option)\n  return uninterpreted_option_;\n}\n\n// -------------------------------------------------------------------\n\n// FieldDescriptorProto\n\n// optional string name = 1;\ninline bool FieldDescriptorProto::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void FieldDescriptorProto::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void FieldDescriptorProto::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void FieldDescriptorProto::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_name();\n}\ninline const ::std::string& FieldDescriptorProto::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.name)\n  return name_.Get();\n}\ninline void FieldDescriptorProto::set_name(const ::std::string& value) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.name)\n}\n#if LANG_CXX11\ninline void FieldDescriptorProto::set_name(::std::string&& value) {\n  set_has_name();\n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.name)\n}\n#endif\ninline void FieldDescriptorProto::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.name)\n}\ninline void FieldDescriptorProto::set_name(const char* value,\n    size_t size) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.name)\n}\ninline ::std::string* FieldDescriptorProto::mutable_name() {\n  set_has_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FieldDescriptorProto::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.name)\n  if (!has_name()) {\n    return NULL;\n  }\n  clear_has_name();\n  return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.name)\n}\ninline ::std::string* FieldDescriptorProto::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_name();\n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.name)\n}\n\n// optional int32 number = 3;\ninline bool FieldDescriptorProto::has_number() const {\n  return (_has_bits_[0] & 0x00000040u) != 0;\n}\ninline void FieldDescriptorProto::set_has_number() {\n  _has_bits_[0] |= 0x00000040u;\n}\ninline void FieldDescriptorProto::clear_has_number() {\n  _has_bits_[0] &= ~0x00000040u;\n}\ninline void FieldDescriptorProto::clear_number() {\n  number_ = 0;\n  clear_has_number();\n}\ninline ::google::protobuf::int32 FieldDescriptorProto::number() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.number)\n  return number_;\n}\ninline void FieldDescriptorProto::set_number(::google::protobuf::int32 value) {\n  set_has_number();\n  number_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.number)\n}\n\n// optional .google.protobuf.FieldDescriptorProto.Label label = 4;\ninline bool FieldDescriptorProto::has_label() const {\n  return (_has_bits_[0] & 0x00000100u) != 0;\n}\ninline void FieldDescriptorProto::set_has_label() {\n  _has_bits_[0] |= 0x00000100u;\n}\ninline void FieldDescriptorProto::clear_has_label() {\n  _has_bits_[0] &= ~0x00000100u;\n}\ninline void FieldDescriptorProto::clear_label() {\n  label_ = 1;\n  clear_has_label();\n}\ninline ::google::protobuf::FieldDescriptorProto_Label FieldDescriptorProto::label() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.label)\n  return static_cast< ::google::protobuf::FieldDescriptorProto_Label >(label_);\n}\ninline void FieldDescriptorProto::set_label(::google::protobuf::FieldDescriptorProto_Label value) {\n  assert(::google::protobuf::FieldDescriptorProto_Label_IsValid(value));\n  set_has_label();\n  label_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.label)\n}\n\n// optional .google.protobuf.FieldDescriptorProto.Type type = 5;\ninline bool FieldDescriptorProto::has_type() const {\n  return (_has_bits_[0] & 0x00000200u) != 0;\n}\ninline void FieldDescriptorProto::set_has_type() {\n  _has_bits_[0] |= 0x00000200u;\n}\ninline void FieldDescriptorProto::clear_has_type() {\n  _has_bits_[0] &= ~0x00000200u;\n}\ninline void FieldDescriptorProto::clear_type() {\n  type_ = 1;\n  clear_has_type();\n}\ninline ::google::protobuf::FieldDescriptorProto_Type FieldDescriptorProto::type() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type)\n  return static_cast< ::google::protobuf::FieldDescriptorProto_Type >(type_);\n}\ninline void FieldDescriptorProto::set_type(::google::protobuf::FieldDescriptorProto_Type value) {\n  assert(::google::protobuf::FieldDescriptorProto_Type_IsValid(value));\n  set_has_type();\n  type_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type)\n}\n\n// optional string type_name = 6;\ninline bool FieldDescriptorProto::has_type_name() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void FieldDescriptorProto::set_has_type_name() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void FieldDescriptorProto::clear_has_type_name() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void FieldDescriptorProto::clear_type_name() {\n  type_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_type_name();\n}\ninline const ::std::string& FieldDescriptorProto::type_name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type_name)\n  return type_name_.Get();\n}\ninline void FieldDescriptorProto::set_type_name(const ::std::string& value) {\n  set_has_type_name();\n  type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type_name)\n}\n#if LANG_CXX11\ninline void FieldDescriptorProto::set_type_name(::std::string&& value) {\n  set_has_type_name();\n  type_name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.type_name)\n}\n#endif\ninline void FieldDescriptorProto::set_type_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_type_name();\n  type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.type_name)\n}\ninline void FieldDescriptorProto::set_type_name(const char* value,\n    size_t size) {\n  set_has_type_name();\n  type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.type_name)\n}\ninline ::std::string* FieldDescriptorProto::mutable_type_name() {\n  set_has_type_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.type_name)\n  return type_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FieldDescriptorProto::release_type_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.type_name)\n  if (!has_type_name()) {\n    return NULL;\n  }\n  clear_has_type_name();\n  return type_name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::set_allocated_type_name(::std::string* type_name) {\n  if (type_name != NULL) {\n    set_has_type_name();\n  } else {\n    clear_has_type_name();\n  }\n  type_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.type_name)\n}\ninline ::std::string* FieldDescriptorProto::unsafe_arena_release_type_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.type_name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_type_name();\n  return type_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::unsafe_arena_set_allocated_type_name(\n    ::std::string* type_name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (type_name != NULL) {\n    set_has_type_name();\n  } else {\n    clear_has_type_name();\n  }\n  type_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      type_name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.type_name)\n}\n\n// optional string extendee = 2;\ninline bool FieldDescriptorProto::has_extendee() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void FieldDescriptorProto::set_has_extendee() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void FieldDescriptorProto::clear_has_extendee() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void FieldDescriptorProto::clear_extendee() {\n  extendee_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_extendee();\n}\ninline const ::std::string& FieldDescriptorProto::extendee() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.extendee)\n  return extendee_.Get();\n}\ninline void FieldDescriptorProto::set_extendee(const ::std::string& value) {\n  set_has_extendee();\n  extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.extendee)\n}\n#if LANG_CXX11\ninline void FieldDescriptorProto::set_extendee(::std::string&& value) {\n  set_has_extendee();\n  extendee_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.extendee)\n}\n#endif\ninline void FieldDescriptorProto::set_extendee(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_extendee();\n  extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.extendee)\n}\ninline void FieldDescriptorProto::set_extendee(const char* value,\n    size_t size) {\n  set_has_extendee();\n  extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.extendee)\n}\ninline ::std::string* FieldDescriptorProto::mutable_extendee() {\n  set_has_extendee();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.extendee)\n  return extendee_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FieldDescriptorProto::release_extendee() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.extendee)\n  if (!has_extendee()) {\n    return NULL;\n  }\n  clear_has_extendee();\n  return extendee_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee) {\n  if (extendee != NULL) {\n    set_has_extendee();\n  } else {\n    clear_has_extendee();\n  }\n  extendee_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), extendee,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.extendee)\n}\ninline ::std::string* FieldDescriptorProto::unsafe_arena_release_extendee() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.extendee)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_extendee();\n  return extendee_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::unsafe_arena_set_allocated_extendee(\n    ::std::string* extendee) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (extendee != NULL) {\n    set_has_extendee();\n  } else {\n    clear_has_extendee();\n  }\n  extendee_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      extendee, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.extendee)\n}\n\n// optional string default_value = 7;\ninline bool FieldDescriptorProto::has_default_value() const {\n  return (_has_bits_[0] & 0x00000008u) != 0;\n}\ninline void FieldDescriptorProto::set_has_default_value() {\n  _has_bits_[0] |= 0x00000008u;\n}\ninline void FieldDescriptorProto::clear_has_default_value() {\n  _has_bits_[0] &= ~0x00000008u;\n}\ninline void FieldDescriptorProto::clear_default_value() {\n  default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_default_value();\n}\ninline const ::std::string& FieldDescriptorProto::default_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.default_value)\n  return default_value_.Get();\n}\ninline void FieldDescriptorProto::set_default_value(const ::std::string& value) {\n  set_has_default_value();\n  default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.default_value)\n}\n#if LANG_CXX11\ninline void FieldDescriptorProto::set_default_value(::std::string&& value) {\n  set_has_default_value();\n  default_value_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.default_value)\n}\n#endif\ninline void FieldDescriptorProto::set_default_value(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_default_value();\n  default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.default_value)\n}\ninline void FieldDescriptorProto::set_default_value(const char* value,\n    size_t size) {\n  set_has_default_value();\n  default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.default_value)\n}\ninline ::std::string* FieldDescriptorProto::mutable_default_value() {\n  set_has_default_value();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.default_value)\n  return default_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FieldDescriptorProto::release_default_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.default_value)\n  if (!has_default_value()) {\n    return NULL;\n  }\n  clear_has_default_value();\n  return default_value_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::set_allocated_default_value(::std::string* default_value) {\n  if (default_value != NULL) {\n    set_has_default_value();\n  } else {\n    clear_has_default_value();\n  }\n  default_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.default_value)\n}\ninline ::std::string* FieldDescriptorProto::unsafe_arena_release_default_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.default_value)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_default_value();\n  return default_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::unsafe_arena_set_allocated_default_value(\n    ::std::string* default_value) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (default_value != NULL) {\n    set_has_default_value();\n  } else {\n    clear_has_default_value();\n  }\n  default_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      default_value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.default_value)\n}\n\n// optional int32 oneof_index = 9;\ninline bool FieldDescriptorProto::has_oneof_index() const {\n  return (_has_bits_[0] & 0x00000080u) != 0;\n}\ninline void FieldDescriptorProto::set_has_oneof_index() {\n  _has_bits_[0] |= 0x00000080u;\n}\ninline void FieldDescriptorProto::clear_has_oneof_index() {\n  _has_bits_[0] &= ~0x00000080u;\n}\ninline void FieldDescriptorProto::clear_oneof_index() {\n  oneof_index_ = 0;\n  clear_has_oneof_index();\n}\ninline ::google::protobuf::int32 FieldDescriptorProto::oneof_index() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.oneof_index)\n  return oneof_index_;\n}\ninline void FieldDescriptorProto::set_oneof_index(::google::protobuf::int32 value) {\n  set_has_oneof_index();\n  oneof_index_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.oneof_index)\n}\n\n// optional string json_name = 10;\ninline bool FieldDescriptorProto::has_json_name() const {\n  return (_has_bits_[0] & 0x00000010u) != 0;\n}\ninline void FieldDescriptorProto::set_has_json_name() {\n  _has_bits_[0] |= 0x00000010u;\n}\ninline void FieldDescriptorProto::clear_has_json_name() {\n  _has_bits_[0] &= ~0x00000010u;\n}\ninline void FieldDescriptorProto::clear_json_name() {\n  json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_json_name();\n}\ninline const ::std::string& FieldDescriptorProto::json_name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.json_name)\n  return json_name_.Get();\n}\ninline void FieldDescriptorProto::set_json_name(const ::std::string& value) {\n  set_has_json_name();\n  json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.json_name)\n}\n#if LANG_CXX11\ninline void FieldDescriptorProto::set_json_name(::std::string&& value) {\n  set_has_json_name();\n  json_name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FieldDescriptorProto.json_name)\n}\n#endif\ninline void FieldDescriptorProto::set_json_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_json_name();\n  json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.json_name)\n}\ninline void FieldDescriptorProto::set_json_name(const char* value,\n    size_t size) {\n  set_has_json_name();\n  json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.json_name)\n}\ninline ::std::string* FieldDescriptorProto::mutable_json_name() {\n  set_has_json_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.json_name)\n  return json_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FieldDescriptorProto::release_json_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.json_name)\n  if (!has_json_name()) {\n    return NULL;\n  }\n  clear_has_json_name();\n  return json_name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::set_allocated_json_name(::std::string* json_name) {\n  if (json_name != NULL) {\n    set_has_json_name();\n  } else {\n    clear_has_json_name();\n  }\n  json_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name)\n}\ninline ::std::string* FieldDescriptorProto::unsafe_arena_release_json_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.json_name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_json_name();\n  return json_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FieldDescriptorProto::unsafe_arena_set_allocated_json_name(\n    ::std::string* json_name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (json_name != NULL) {\n    set_has_json_name();\n  } else {\n    clear_has_json_name();\n  }\n  json_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      json_name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.json_name)\n}\n\n// optional .google.protobuf.FieldOptions options = 8;\ninline bool FieldDescriptorProto::has_options() const {\n  return (_has_bits_[0] & 0x00000020u) != 0;\n}\ninline void FieldDescriptorProto::set_has_options() {\n  _has_bits_[0] |= 0x00000020u;\n}\ninline void FieldDescriptorProto::clear_has_options() {\n  _has_bits_[0] &= ~0x00000020u;\n}\ninline void FieldDescriptorProto::clear_options() {\n  if (options_ != NULL) options_->Clear();\n  clear_has_options();\n}\ninline const ::google::protobuf::FieldOptions& FieldDescriptorProto::_internal_options() const {\n  return *options_;\n}\ninline const ::google::protobuf::FieldOptions& FieldDescriptorProto::options() const {\n  const ::google::protobuf::FieldOptions* p = options_;\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.options)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::FieldOptions*>(\n      &::google::protobuf::_FieldOptions_default_instance_);\n}\ninline ::google::protobuf::FieldOptions* FieldDescriptorProto::release_options() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::FieldOptions* temp = options_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::FieldOptions* FieldDescriptorProto::unsafe_arena_release_options() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::FieldOptions* temp = options_;\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() {\n  set_has_options();\n  if (options_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::FieldOptions>(GetArenaNoVirtual());\n    options_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.options)\n  return options_;\n}\ninline void FieldDescriptorProto::set_allocated_options(::google::protobuf::FieldOptions* options) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete options_;\n  }\n  if (options) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(options);\n    if (message_arena != submessage_arena) {\n      options = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, options, submessage_arena);\n    }\n    set_has_options();\n  } else {\n    clear_has_options();\n  }\n  options_ = options;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.options)\n}\n\n// -------------------------------------------------------------------\n\n// OneofDescriptorProto\n\n// optional string name = 1;\ninline bool OneofDescriptorProto::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void OneofDescriptorProto::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void OneofDescriptorProto::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void OneofDescriptorProto::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_name();\n}\ninline const ::std::string& OneofDescriptorProto::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.name)\n  return name_.Get();\n}\ninline void OneofDescriptorProto::set_name(const ::std::string& value) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.OneofDescriptorProto.name)\n}\n#if LANG_CXX11\ninline void OneofDescriptorProto::set_name(::std::string&& value) {\n  set_has_name();\n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.OneofDescriptorProto.name)\n}\n#endif\ninline void OneofDescriptorProto::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.OneofDescriptorProto.name)\n}\ninline void OneofDescriptorProto::set_name(const char* value,\n    size_t size) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.OneofDescriptorProto.name)\n}\ninline ::std::string* OneofDescriptorProto::mutable_name() {\n  set_has_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* OneofDescriptorProto::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.name)\n  if (!has_name()) {\n    return NULL;\n  }\n  clear_has_name();\n  return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void OneofDescriptorProto::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name)\n}\ninline ::std::string* OneofDescriptorProto::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.OneofDescriptorProto.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_name();\n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void OneofDescriptorProto::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.OneofDescriptorProto.name)\n}\n\n// optional .google.protobuf.OneofOptions options = 2;\ninline bool OneofDescriptorProto::has_options() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void OneofDescriptorProto::set_has_options() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void OneofDescriptorProto::clear_has_options() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void OneofDescriptorProto::clear_options() {\n  if (options_ != NULL) options_->Clear();\n  clear_has_options();\n}\ninline const ::google::protobuf::OneofOptions& OneofDescriptorProto::_internal_options() const {\n  return *options_;\n}\ninline const ::google::protobuf::OneofOptions& OneofDescriptorProto::options() const {\n  const ::google::protobuf::OneofOptions* p = options_;\n  // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.options)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::OneofOptions*>(\n      &::google::protobuf::_OneofOptions_default_instance_);\n}\ninline ::google::protobuf::OneofOptions* OneofDescriptorProto::release_options() {\n  // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::OneofOptions* temp = options_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::OneofOptions* OneofDescriptorProto::unsafe_arena_release_options() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.OneofDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::OneofOptions* temp = options_;\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::OneofOptions* OneofDescriptorProto::mutable_options() {\n  set_has_options();\n  if (options_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::OneofOptions>(GetArenaNoVirtual());\n    options_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.options)\n  return options_;\n}\ninline void OneofDescriptorProto::set_allocated_options(::google::protobuf::OneofOptions* options) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete options_;\n  }\n  if (options) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(options);\n    if (message_arena != submessage_arena) {\n      options = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, options, submessage_arena);\n    }\n    set_has_options();\n  } else {\n    clear_has_options();\n  }\n  options_ = options;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.options)\n}\n\n// -------------------------------------------------------------------\n\n// EnumDescriptorProto_EnumReservedRange\n\n// optional int32 start = 1;\ninline bool EnumDescriptorProto_EnumReservedRange::has_start() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void EnumDescriptorProto_EnumReservedRange::set_has_start() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void EnumDescriptorProto_EnumReservedRange::clear_has_start() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void EnumDescriptorProto_EnumReservedRange::clear_start() {\n  start_ = 0;\n  clear_has_start();\n}\ninline ::google::protobuf::int32 EnumDescriptorProto_EnumReservedRange::start() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.start)\n  return start_;\n}\ninline void EnumDescriptorProto_EnumReservedRange::set_start(::google::protobuf::int32 value) {\n  set_has_start();\n  start_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.EnumReservedRange.start)\n}\n\n// optional int32 end = 2;\ninline bool EnumDescriptorProto_EnumReservedRange::has_end() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void EnumDescriptorProto_EnumReservedRange::set_has_end() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void EnumDescriptorProto_EnumReservedRange::clear_has_end() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void EnumDescriptorProto_EnumReservedRange::clear_end() {\n  end_ = 0;\n  clear_has_end();\n}\ninline ::google::protobuf::int32 EnumDescriptorProto_EnumReservedRange::end() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.EnumReservedRange.end)\n  return end_;\n}\ninline void EnumDescriptorProto_EnumReservedRange::set_end(::google::protobuf::int32 value) {\n  set_has_end();\n  end_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.EnumReservedRange.end)\n}\n\n// -------------------------------------------------------------------\n\n// EnumDescriptorProto\n\n// optional string name = 1;\ninline bool EnumDescriptorProto::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void EnumDescriptorProto::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void EnumDescriptorProto::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void EnumDescriptorProto::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_name();\n}\ninline const ::std::string& EnumDescriptorProto::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.name)\n  return name_.Get();\n}\ninline void EnumDescriptorProto::set_name(const ::std::string& value) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.name)\n}\n#if LANG_CXX11\ninline void EnumDescriptorProto::set_name(::std::string&& value) {\n  set_has_name();\n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.EnumDescriptorProto.name)\n}\n#endif\ninline void EnumDescriptorProto::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.EnumDescriptorProto.name)\n}\ninline void EnumDescriptorProto::set_name(const char* value,\n    size_t size) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumDescriptorProto.name)\n}\ninline ::std::string* EnumDescriptorProto::mutable_name() {\n  set_has_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* EnumDescriptorProto::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.name)\n  if (!has_name()) {\n    return NULL;\n  }\n  clear_has_name();\n  return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void EnumDescriptorProto::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.name)\n}\ninline ::std::string* EnumDescriptorProto::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumDescriptorProto.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_name();\n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void EnumDescriptorProto::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumDescriptorProto.name)\n}\n\n// repeated .google.protobuf.EnumValueDescriptorProto value = 2;\ninline int EnumDescriptorProto::value_size() const {\n  return value_.size();\n}\ninline void EnumDescriptorProto::clear_value() {\n  value_.Clear();\n}\ninline ::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::mutable_value(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.value)\n  return value_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >*\nEnumDescriptorProto::mutable_value() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.value)\n  return &value_;\n}\ninline const ::google::protobuf::EnumValueDescriptorProto& EnumDescriptorProto::value(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.value)\n  return value_.Get(index);\n}\ninline ::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::add_value() {\n  // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.value)\n  return value_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >&\nEnumDescriptorProto::value() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.value)\n  return value_;\n}\n\n// optional .google.protobuf.EnumOptions options = 3;\ninline bool EnumDescriptorProto::has_options() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void EnumDescriptorProto::set_has_options() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void EnumDescriptorProto::clear_has_options() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void EnumDescriptorProto::clear_options() {\n  if (options_ != NULL) options_->Clear();\n  clear_has_options();\n}\ninline const ::google::protobuf::EnumOptions& EnumDescriptorProto::_internal_options() const {\n  return *options_;\n}\ninline const ::google::protobuf::EnumOptions& EnumDescriptorProto::options() const {\n  const ::google::protobuf::EnumOptions* p = options_;\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.options)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::EnumOptions*>(\n      &::google::protobuf::_EnumOptions_default_instance_);\n}\ninline ::google::protobuf::EnumOptions* EnumDescriptorProto::release_options() {\n  // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::EnumOptions* temp = options_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::EnumOptions* EnumDescriptorProto::unsafe_arena_release_options() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::EnumOptions* temp = options_;\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::EnumOptions* EnumDescriptorProto::mutable_options() {\n  set_has_options();\n  if (options_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::EnumOptions>(GetArenaNoVirtual());\n    options_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.options)\n  return options_;\n}\ninline void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumOptions* options) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete options_;\n  }\n  if (options) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(options);\n    if (message_arena != submessage_arena) {\n      options = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, options, submessage_arena);\n    }\n    set_has_options();\n  } else {\n    clear_has_options();\n  }\n  options_ = options;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.options)\n}\n\n// repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;\ninline int EnumDescriptorProto::reserved_range_size() const {\n  return reserved_range_.size();\n}\ninline void EnumDescriptorProto::clear_reserved_range() {\n  reserved_range_.Clear();\n}\ninline ::google::protobuf::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::mutable_reserved_range(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.reserved_range)\n  return reserved_range_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >*\nEnumDescriptorProto::mutable_reserved_range() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.reserved_range)\n  return &reserved_range_;\n}\ninline const ::google::protobuf::EnumDescriptorProto_EnumReservedRange& EnumDescriptorProto::reserved_range(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.reserved_range)\n  return reserved_range_.Get(index);\n}\ninline ::google::protobuf::EnumDescriptorProto_EnumReservedRange* EnumDescriptorProto::add_reserved_range() {\n  // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.reserved_range)\n  return reserved_range_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto_EnumReservedRange >&\nEnumDescriptorProto::reserved_range() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.reserved_range)\n  return reserved_range_;\n}\n\n// repeated string reserved_name = 5;\ninline int EnumDescriptorProto::reserved_name_size() const {\n  return reserved_name_.size();\n}\ninline void EnumDescriptorProto::clear_reserved_name() {\n  reserved_name_.Clear();\n}\ninline const ::std::string& EnumDescriptorProto::reserved_name(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.reserved_name)\n  return reserved_name_.Get(index);\n}\ninline ::std::string* EnumDescriptorProto::mutable_reserved_name(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.reserved_name)\n  return reserved_name_.Mutable(index);\n}\ninline void EnumDescriptorProto::set_reserved_name(int index, const ::std::string& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.reserved_name)\n  reserved_name_.Mutable(index)->assign(value);\n}\n#if LANG_CXX11\ninline void EnumDescriptorProto::set_reserved_name(int index, ::std::string&& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.reserved_name)\n  reserved_name_.Mutable(index)->assign(std::move(value));\n}\n#endif\ninline void EnumDescriptorProto::set_reserved_name(int index, const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  reserved_name_.Mutable(index)->assign(value);\n  // @@protoc_insertion_point(field_set_char:google.protobuf.EnumDescriptorProto.reserved_name)\n}\ninline void EnumDescriptorProto::set_reserved_name(int index, const char* value, size_t size) {\n  reserved_name_.Mutable(index)->assign(\n    reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumDescriptorProto.reserved_name)\n}\ninline ::std::string* EnumDescriptorProto::add_reserved_name() {\n  // @@protoc_insertion_point(field_add_mutable:google.protobuf.EnumDescriptorProto.reserved_name)\n  return reserved_name_.Add();\n}\ninline void EnumDescriptorProto::add_reserved_name(const ::std::string& value) {\n  reserved_name_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.reserved_name)\n}\n#if LANG_CXX11\ninline void EnumDescriptorProto::add_reserved_name(::std::string&& value) {\n  reserved_name_.Add(std::move(value));\n  // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.reserved_name)\n}\n#endif\ninline void EnumDescriptorProto::add_reserved_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  reserved_name_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add_char:google.protobuf.EnumDescriptorProto.reserved_name)\n}\ninline void EnumDescriptorProto::add_reserved_name(const char* value, size_t size) {\n  reserved_name_.Add()->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_add_pointer:google.protobuf.EnumDescriptorProto.reserved_name)\n}\ninline const ::google::protobuf::RepeatedPtrField< ::std::string>&\nEnumDescriptorProto::reserved_name() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.reserved_name)\n  return reserved_name_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::std::string>*\nEnumDescriptorProto::mutable_reserved_name() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.reserved_name)\n  return &reserved_name_;\n}\n\n// -------------------------------------------------------------------\n\n// EnumValueDescriptorProto\n\n// optional string name = 1;\ninline bool EnumValueDescriptorProto::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void EnumValueDescriptorProto::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void EnumValueDescriptorProto::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void EnumValueDescriptorProto::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_name();\n}\ninline const ::std::string& EnumValueDescriptorProto::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.name)\n  return name_.Get();\n}\ninline void EnumValueDescriptorProto::set_name(const ::std::string& value) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.name)\n}\n#if LANG_CXX11\ninline void EnumValueDescriptorProto::set_name(::std::string&& value) {\n  set_has_name();\n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.EnumValueDescriptorProto.name)\n}\n#endif\ninline void EnumValueDescriptorProto::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.EnumValueDescriptorProto.name)\n}\ninline void EnumValueDescriptorProto::set_name(const char* value,\n    size_t size) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumValueDescriptorProto.name)\n}\ninline ::std::string* EnumValueDescriptorProto::mutable_name() {\n  set_has_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* EnumValueDescriptorProto::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.name)\n  if (!has_name()) {\n    return NULL;\n  }\n  clear_has_name();\n  return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void EnumValueDescriptorProto::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.name)\n}\ninline ::std::string* EnumValueDescriptorProto::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValueDescriptorProto.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_name();\n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void EnumValueDescriptorProto::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueDescriptorProto.name)\n}\n\n// optional int32 number = 2;\ninline bool EnumValueDescriptorProto::has_number() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void EnumValueDescriptorProto::set_has_number() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void EnumValueDescriptorProto::clear_has_number() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void EnumValueDescriptorProto::clear_number() {\n  number_ = 0;\n  clear_has_number();\n}\ninline ::google::protobuf::int32 EnumValueDescriptorProto::number() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.number)\n  return number_;\n}\ninline void EnumValueDescriptorProto::set_number(::google::protobuf::int32 value) {\n  set_has_number();\n  number_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.number)\n}\n\n// optional .google.protobuf.EnumValueOptions options = 3;\ninline bool EnumValueDescriptorProto::has_options() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void EnumValueDescriptorProto::set_has_options() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void EnumValueDescriptorProto::clear_has_options() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void EnumValueDescriptorProto::clear_options() {\n  if (options_ != NULL) options_->Clear();\n  clear_has_options();\n}\ninline const ::google::protobuf::EnumValueOptions& EnumValueDescriptorProto::_internal_options() const {\n  return *options_;\n}\ninline const ::google::protobuf::EnumValueOptions& EnumValueDescriptorProto::options() const {\n  const ::google::protobuf::EnumValueOptions* p = options_;\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.options)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::EnumValueOptions*>(\n      &::google::protobuf::_EnumValueOptions_default_instance_);\n}\ninline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::release_options() {\n  // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::EnumValueOptions* temp = options_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::unsafe_arena_release_options() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValueDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::EnumValueOptions* temp = options_;\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::mutable_options() {\n  set_has_options();\n  if (options_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::EnumValueOptions>(GetArenaNoVirtual());\n    options_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.options)\n  return options_;\n}\ninline void EnumValueDescriptorProto::set_allocated_options(::google::protobuf::EnumValueOptions* options) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete options_;\n  }\n  if (options) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(options);\n    if (message_arena != submessage_arena) {\n      options = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, options, submessage_arena);\n    }\n    set_has_options();\n  } else {\n    clear_has_options();\n  }\n  options_ = options;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.options)\n}\n\n// -------------------------------------------------------------------\n\n// ServiceDescriptorProto\n\n// optional string name = 1;\ninline bool ServiceDescriptorProto::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void ServiceDescriptorProto::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void ServiceDescriptorProto::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void ServiceDescriptorProto::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_name();\n}\ninline const ::std::string& ServiceDescriptorProto::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.name)\n  return name_.Get();\n}\ninline void ServiceDescriptorProto::set_name(const ::std::string& value) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.ServiceDescriptorProto.name)\n}\n#if LANG_CXX11\ninline void ServiceDescriptorProto::set_name(::std::string&& value) {\n  set_has_name();\n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.ServiceDescriptorProto.name)\n}\n#endif\ninline void ServiceDescriptorProto::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.ServiceDescriptorProto.name)\n}\ninline void ServiceDescriptorProto::set_name(const char* value,\n    size_t size) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.ServiceDescriptorProto.name)\n}\ninline ::std::string* ServiceDescriptorProto::mutable_name() {\n  set_has_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* ServiceDescriptorProto::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.name)\n  if (!has_name()) {\n    return NULL;\n  }\n  clear_has_name();\n  return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void ServiceDescriptorProto::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.name)\n}\ninline ::std::string* ServiceDescriptorProto::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.ServiceDescriptorProto.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_name();\n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void ServiceDescriptorProto::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ServiceDescriptorProto.name)\n}\n\n// repeated .google.protobuf.MethodDescriptorProto method = 2;\ninline int ServiceDescriptorProto::method_size() const {\n  return method_.size();\n}\ninline void ServiceDescriptorProto::clear_method() {\n  method_.Clear();\n}\ninline ::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::mutable_method(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.method)\n  return method_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >*\nServiceDescriptorProto::mutable_method() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceDescriptorProto.method)\n  return &method_;\n}\ninline const ::google::protobuf::MethodDescriptorProto& ServiceDescriptorProto::method(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.method)\n  return method_.Get(index);\n}\ninline ::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::add_method() {\n  // @@protoc_insertion_point(field_add:google.protobuf.ServiceDescriptorProto.method)\n  return method_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >&\nServiceDescriptorProto::method() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.ServiceDescriptorProto.method)\n  return method_;\n}\n\n// optional .google.protobuf.ServiceOptions options = 3;\ninline bool ServiceDescriptorProto::has_options() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void ServiceDescriptorProto::set_has_options() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void ServiceDescriptorProto::clear_has_options() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void ServiceDescriptorProto::clear_options() {\n  if (options_ != NULL) options_->Clear();\n  clear_has_options();\n}\ninline const ::google::protobuf::ServiceOptions& ServiceDescriptorProto::_internal_options() const {\n  return *options_;\n}\ninline const ::google::protobuf::ServiceOptions& ServiceDescriptorProto::options() const {\n  const ::google::protobuf::ServiceOptions* p = options_;\n  // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.options)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::ServiceOptions*>(\n      &::google::protobuf::_ServiceOptions_default_instance_);\n}\ninline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::release_options() {\n  // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::ServiceOptions* temp = options_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::unsafe_arena_release_options() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.ServiceDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::ServiceOptions* temp = options_;\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::mutable_options() {\n  set_has_options();\n  if (options_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::ServiceOptions>(GetArenaNoVirtual());\n    options_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.options)\n  return options_;\n}\ninline void ServiceDescriptorProto::set_allocated_options(::google::protobuf::ServiceOptions* options) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete options_;\n  }\n  if (options) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(options);\n    if (message_arena != submessage_arena) {\n      options = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, options, submessage_arena);\n    }\n    set_has_options();\n  } else {\n    clear_has_options();\n  }\n  options_ = options;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.options)\n}\n\n// -------------------------------------------------------------------\n\n// MethodDescriptorProto\n\n// optional string name = 1;\ninline bool MethodDescriptorProto::has_name() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void MethodDescriptorProto::set_has_name() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void MethodDescriptorProto::clear_has_name() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void MethodDescriptorProto::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_name();\n}\ninline const ::std::string& MethodDescriptorProto::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.name)\n  return name_.Get();\n}\ninline void MethodDescriptorProto::set_name(const ::std::string& value) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.name)\n}\n#if LANG_CXX11\ninline void MethodDescriptorProto::set_name(::std::string&& value) {\n  set_has_name();\n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.MethodDescriptorProto.name)\n}\n#endif\ninline void MethodDescriptorProto::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.name)\n}\ninline void MethodDescriptorProto::set_name(const char* value,\n    size_t size) {\n  set_has_name();\n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.name)\n}\ninline ::std::string* MethodDescriptorProto::mutable_name() {\n  set_has_name();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* MethodDescriptorProto::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.name)\n  if (!has_name()) {\n    return NULL;\n  }\n  clear_has_name();\n  return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void MethodDescriptorProto::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.name)\n}\ninline ::std::string* MethodDescriptorProto::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_name();\n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void MethodDescriptorProto::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    set_has_name();\n  } else {\n    clear_has_name();\n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.name)\n}\n\n// optional string input_type = 2;\ninline bool MethodDescriptorProto::has_input_type() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void MethodDescriptorProto::set_has_input_type() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void MethodDescriptorProto::clear_has_input_type() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void MethodDescriptorProto::clear_input_type() {\n  input_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_input_type();\n}\ninline const ::std::string& MethodDescriptorProto::input_type() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.input_type)\n  return input_type_.Get();\n}\ninline void MethodDescriptorProto::set_input_type(const ::std::string& value) {\n  set_has_input_type();\n  input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.input_type)\n}\n#if LANG_CXX11\ninline void MethodDescriptorProto::set_input_type(::std::string&& value) {\n  set_has_input_type();\n  input_type_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.MethodDescriptorProto.input_type)\n}\n#endif\ninline void MethodDescriptorProto::set_input_type(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_input_type();\n  input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.input_type)\n}\ninline void MethodDescriptorProto::set_input_type(const char* value,\n    size_t size) {\n  set_has_input_type();\n  input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.input_type)\n}\ninline ::std::string* MethodDescriptorProto::mutable_input_type() {\n  set_has_input_type();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.input_type)\n  return input_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* MethodDescriptorProto::release_input_type() {\n  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.input_type)\n  if (!has_input_type()) {\n    return NULL;\n  }\n  clear_has_input_type();\n  return input_type_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void MethodDescriptorProto::set_allocated_input_type(::std::string* input_type) {\n  if (input_type != NULL) {\n    set_has_input_type();\n  } else {\n    clear_has_input_type();\n  }\n  input_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), input_type,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.input_type)\n}\ninline ::std::string* MethodDescriptorProto::unsafe_arena_release_input_type() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.input_type)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_input_type();\n  return input_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void MethodDescriptorProto::unsafe_arena_set_allocated_input_type(\n    ::std::string* input_type) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (input_type != NULL) {\n    set_has_input_type();\n  } else {\n    clear_has_input_type();\n  }\n  input_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      input_type, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.input_type)\n}\n\n// optional string output_type = 3;\ninline bool MethodDescriptorProto::has_output_type() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void MethodDescriptorProto::set_has_output_type() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void MethodDescriptorProto::clear_has_output_type() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void MethodDescriptorProto::clear_output_type() {\n  output_type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_output_type();\n}\ninline const ::std::string& MethodDescriptorProto::output_type() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.output_type)\n  return output_type_.Get();\n}\ninline void MethodDescriptorProto::set_output_type(const ::std::string& value) {\n  set_has_output_type();\n  output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.output_type)\n}\n#if LANG_CXX11\ninline void MethodDescriptorProto::set_output_type(::std::string&& value) {\n  set_has_output_type();\n  output_type_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.MethodDescriptorProto.output_type)\n}\n#endif\ninline void MethodDescriptorProto::set_output_type(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_output_type();\n  output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.output_type)\n}\ninline void MethodDescriptorProto::set_output_type(const char* value,\n    size_t size) {\n  set_has_output_type();\n  output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.output_type)\n}\ninline ::std::string* MethodDescriptorProto::mutable_output_type() {\n  set_has_output_type();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.output_type)\n  return output_type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* MethodDescriptorProto::release_output_type() {\n  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.output_type)\n  if (!has_output_type()) {\n    return NULL;\n  }\n  clear_has_output_type();\n  return output_type_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void MethodDescriptorProto::set_allocated_output_type(::std::string* output_type) {\n  if (output_type != NULL) {\n    set_has_output_type();\n  } else {\n    clear_has_output_type();\n  }\n  output_type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_type,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.output_type)\n}\ninline ::std::string* MethodDescriptorProto::unsafe_arena_release_output_type() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.output_type)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_output_type();\n  return output_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void MethodDescriptorProto::unsafe_arena_set_allocated_output_type(\n    ::std::string* output_type) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (output_type != NULL) {\n    set_has_output_type();\n  } else {\n    clear_has_output_type();\n  }\n  output_type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      output_type, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.output_type)\n}\n\n// optional .google.protobuf.MethodOptions options = 4;\ninline bool MethodDescriptorProto::has_options() const {\n  return (_has_bits_[0] & 0x00000008u) != 0;\n}\ninline void MethodDescriptorProto::set_has_options() {\n  _has_bits_[0] |= 0x00000008u;\n}\ninline void MethodDescriptorProto::clear_has_options() {\n  _has_bits_[0] &= ~0x00000008u;\n}\ninline void MethodDescriptorProto::clear_options() {\n  if (options_ != NULL) options_->Clear();\n  clear_has_options();\n}\ninline const ::google::protobuf::MethodOptions& MethodDescriptorProto::_internal_options() const {\n  return *options_;\n}\ninline const ::google::protobuf::MethodOptions& MethodDescriptorProto::options() const {\n  const ::google::protobuf::MethodOptions* p = options_;\n  // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.options)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::MethodOptions*>(\n      &::google::protobuf::_MethodOptions_default_instance_);\n}\ninline ::google::protobuf::MethodOptions* MethodDescriptorProto::release_options() {\n  // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::MethodOptions* temp = options_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::MethodOptions* MethodDescriptorProto::unsafe_arena_release_options() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.options)\n  clear_has_options();\n  ::google::protobuf::MethodOptions* temp = options_;\n  options_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::MethodOptions* MethodDescriptorProto::mutable_options() {\n  set_has_options();\n  if (options_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::MethodOptions>(GetArenaNoVirtual());\n    options_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.options)\n  return options_;\n}\ninline void MethodDescriptorProto::set_allocated_options(::google::protobuf::MethodOptions* options) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete options_;\n  }\n  if (options) {\n    ::google::protobuf::Arena* submessage_arena =\n      ::google::protobuf::Arena::GetArena(options);\n    if (message_arena != submessage_arena) {\n      options = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, options, submessage_arena);\n    }\n    set_has_options();\n  } else {\n    clear_has_options();\n  }\n  options_ = options;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.options)\n}\n\n// optional bool client_streaming = 5 [default = false];\ninline bool MethodDescriptorProto::has_client_streaming() const {\n  return (_has_bits_[0] & 0x00000010u) != 0;\n}\ninline void MethodDescriptorProto::set_has_client_streaming() {\n  _has_bits_[0] |= 0x00000010u;\n}\ninline void MethodDescriptorProto::clear_has_client_streaming() {\n  _has_bits_[0] &= ~0x00000010u;\n}\ninline void MethodDescriptorProto::clear_client_streaming() {\n  client_streaming_ = false;\n  clear_has_client_streaming();\n}\ninline bool MethodDescriptorProto::client_streaming() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.client_streaming)\n  return client_streaming_;\n}\ninline void MethodDescriptorProto::set_client_streaming(bool value) {\n  set_has_client_streaming();\n  client_streaming_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.client_streaming)\n}\n\n// optional bool server_streaming = 6 [default = false];\ninline bool MethodDescriptorProto::has_server_streaming() const {\n  return (_has_bits_[0] & 0x00000020u) != 0;\n}\ninline void MethodDescriptorProto::set_has_server_streaming() {\n  _has_bits_[0] |= 0x00000020u;\n}\ninline void MethodDescriptorProto::clear_has_server_streaming() {\n  _has_bits_[0] &= ~0x00000020u;\n}\ninline void MethodDescriptorProto::clear_server_streaming() {\n  server_streaming_ = false;\n  clear_has_server_streaming();\n}\ninline bool MethodDescriptorProto::server_streaming() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.server_streaming)\n  return server_streaming_;\n}\ninline void MethodDescriptorProto::set_server_streaming(bool value) {\n  set_has_server_streaming();\n  server_streaming_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.server_streaming)\n}\n\n// -------------------------------------------------------------------\n\n// FileOptions\n\n// optional string java_package = 1;\ninline bool FileOptions::has_java_package() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void FileOptions::set_has_java_package() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void FileOptions::clear_has_java_package() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void FileOptions::clear_java_package() {\n  java_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_java_package();\n}\ninline const ::std::string& FileOptions::java_package() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_package)\n  return java_package_.Get();\n}\ninline void FileOptions::set_java_package(const ::std::string& value) {\n  set_has_java_package();\n  java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_package)\n}\n#if LANG_CXX11\ninline void FileOptions::set_java_package(::std::string&& value) {\n  set_has_java_package();\n  java_package_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.java_package)\n}\n#endif\ninline void FileOptions::set_java_package(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_java_package();\n  java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_package)\n}\ninline void FileOptions::set_java_package(const char* value,\n    size_t size) {\n  set_has_java_package();\n  java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_package)\n}\ninline ::std::string* FileOptions::mutable_java_package() {\n  set_has_java_package();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_package)\n  return java_package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_java_package() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_package)\n  if (!has_java_package()) {\n    return NULL;\n  }\n  clear_has_java_package();\n  return java_package_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_java_package(::std::string* java_package) {\n  if (java_package != NULL) {\n    set_has_java_package();\n  } else {\n    clear_has_java_package();\n  }\n  java_package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_package,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_package)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_java_package() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.java_package)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_java_package();\n  return java_package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_java_package(\n    ::std::string* java_package) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (java_package != NULL) {\n    set_has_java_package();\n  } else {\n    clear_has_java_package();\n  }\n  java_package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      java_package, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.java_package)\n}\n\n// optional string java_outer_classname = 8;\ninline bool FileOptions::has_java_outer_classname() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void FileOptions::set_has_java_outer_classname() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void FileOptions::clear_has_java_outer_classname() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void FileOptions::clear_java_outer_classname() {\n  java_outer_classname_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_java_outer_classname();\n}\ninline const ::std::string& FileOptions::java_outer_classname() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_outer_classname)\n  return java_outer_classname_.Get();\n}\ninline void FileOptions::set_java_outer_classname(const ::std::string& value) {\n  set_has_java_outer_classname();\n  java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_outer_classname)\n}\n#if LANG_CXX11\ninline void FileOptions::set_java_outer_classname(::std::string&& value) {\n  set_has_java_outer_classname();\n  java_outer_classname_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.java_outer_classname)\n}\n#endif\ninline void FileOptions::set_java_outer_classname(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_java_outer_classname();\n  java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_outer_classname)\n}\ninline void FileOptions::set_java_outer_classname(const char* value,\n    size_t size) {\n  set_has_java_outer_classname();\n  java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_outer_classname)\n}\ninline ::std::string* FileOptions::mutable_java_outer_classname() {\n  set_has_java_outer_classname();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_outer_classname)\n  return java_outer_classname_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_java_outer_classname() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_outer_classname)\n  if (!has_java_outer_classname()) {\n    return NULL;\n  }\n  clear_has_java_outer_classname();\n  return java_outer_classname_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_java_outer_classname(::std::string* java_outer_classname) {\n  if (java_outer_classname != NULL) {\n    set_has_java_outer_classname();\n  } else {\n    clear_has_java_outer_classname();\n  }\n  java_outer_classname_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_outer_classname,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_outer_classname)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_java_outer_classname() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.java_outer_classname)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_java_outer_classname();\n  return java_outer_classname_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_java_outer_classname(\n    ::std::string* java_outer_classname) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (java_outer_classname != NULL) {\n    set_has_java_outer_classname();\n  } else {\n    clear_has_java_outer_classname();\n  }\n  java_outer_classname_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      java_outer_classname, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.java_outer_classname)\n}\n\n// optional bool java_multiple_files = 10 [default = false];\ninline bool FileOptions::has_java_multiple_files() const {\n  return (_has_bits_[0] & 0x00000400u) != 0;\n}\ninline void FileOptions::set_has_java_multiple_files() {\n  _has_bits_[0] |= 0x00000400u;\n}\ninline void FileOptions::clear_has_java_multiple_files() {\n  _has_bits_[0] &= ~0x00000400u;\n}\ninline void FileOptions::clear_java_multiple_files() {\n  java_multiple_files_ = false;\n  clear_has_java_multiple_files();\n}\ninline bool FileOptions::java_multiple_files() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_multiple_files)\n  return java_multiple_files_;\n}\ninline void FileOptions::set_java_multiple_files(bool value) {\n  set_has_java_multiple_files();\n  java_multiple_files_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_multiple_files)\n}\n\n// optional bool java_generate_equals_and_hash = 20 [deprecated = true];\ninline bool FileOptions::has_java_generate_equals_and_hash() const {\n  return (_has_bits_[0] & 0x00000800u) != 0;\n}\ninline void FileOptions::set_has_java_generate_equals_and_hash() {\n  _has_bits_[0] |= 0x00000800u;\n}\ninline void FileOptions::clear_has_java_generate_equals_and_hash() {\n  _has_bits_[0] &= ~0x00000800u;\n}\ninline void FileOptions::clear_java_generate_equals_and_hash() {\n  java_generate_equals_and_hash_ = false;\n  clear_has_java_generate_equals_and_hash();\n}\ninline bool FileOptions::java_generate_equals_and_hash() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generate_equals_and_hash)\n  return java_generate_equals_and_hash_;\n}\ninline void FileOptions::set_java_generate_equals_and_hash(bool value) {\n  set_has_java_generate_equals_and_hash();\n  java_generate_equals_and_hash_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_generate_equals_and_hash)\n}\n\n// optional bool java_string_check_utf8 = 27 [default = false];\ninline bool FileOptions::has_java_string_check_utf8() const {\n  return (_has_bits_[0] & 0x00001000u) != 0;\n}\ninline void FileOptions::set_has_java_string_check_utf8() {\n  _has_bits_[0] |= 0x00001000u;\n}\ninline void FileOptions::clear_has_java_string_check_utf8() {\n  _has_bits_[0] &= ~0x00001000u;\n}\ninline void FileOptions::clear_java_string_check_utf8() {\n  java_string_check_utf8_ = false;\n  clear_has_java_string_check_utf8();\n}\ninline bool FileOptions::java_string_check_utf8() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_string_check_utf8)\n  return java_string_check_utf8_;\n}\ninline void FileOptions::set_java_string_check_utf8(bool value) {\n  set_has_java_string_check_utf8();\n  java_string_check_utf8_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_string_check_utf8)\n}\n\n// optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];\ninline bool FileOptions::has_optimize_for() const {\n  return (_has_bits_[0] & 0x00080000u) != 0;\n}\ninline void FileOptions::set_has_optimize_for() {\n  _has_bits_[0] |= 0x00080000u;\n}\ninline void FileOptions::clear_has_optimize_for() {\n  _has_bits_[0] &= ~0x00080000u;\n}\ninline void FileOptions::clear_optimize_for() {\n  optimize_for_ = 1;\n  clear_has_optimize_for();\n}\ninline ::google::protobuf::FileOptions_OptimizeMode FileOptions::optimize_for() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.optimize_for)\n  return static_cast< ::google::protobuf::FileOptions_OptimizeMode >(optimize_for_);\n}\ninline void FileOptions::set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value) {\n  assert(::google::protobuf::FileOptions_OptimizeMode_IsValid(value));\n  set_has_optimize_for();\n  optimize_for_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.optimize_for)\n}\n\n// optional string go_package = 11;\ninline bool FileOptions::has_go_package() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void FileOptions::set_has_go_package() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void FileOptions::clear_has_go_package() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void FileOptions::clear_go_package() {\n  go_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_go_package();\n}\ninline const ::std::string& FileOptions::go_package() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.go_package)\n  return go_package_.Get();\n}\ninline void FileOptions::set_go_package(const ::std::string& value) {\n  set_has_go_package();\n  go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.go_package)\n}\n#if LANG_CXX11\ninline void FileOptions::set_go_package(::std::string&& value) {\n  set_has_go_package();\n  go_package_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.go_package)\n}\n#endif\ninline void FileOptions::set_go_package(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_go_package();\n  go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.go_package)\n}\ninline void FileOptions::set_go_package(const char* value,\n    size_t size) {\n  set_has_go_package();\n  go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.go_package)\n}\ninline ::std::string* FileOptions::mutable_go_package() {\n  set_has_go_package();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.go_package)\n  return go_package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_go_package() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.go_package)\n  if (!has_go_package()) {\n    return NULL;\n  }\n  clear_has_go_package();\n  return go_package_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_go_package(::std::string* go_package) {\n  if (go_package != NULL) {\n    set_has_go_package();\n  } else {\n    clear_has_go_package();\n  }\n  go_package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), go_package,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.go_package)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_go_package() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.go_package)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_go_package();\n  return go_package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_go_package(\n    ::std::string* go_package) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (go_package != NULL) {\n    set_has_go_package();\n  } else {\n    clear_has_go_package();\n  }\n  go_package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      go_package, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.go_package)\n}\n\n// optional bool cc_generic_services = 16 [default = false];\ninline bool FileOptions::has_cc_generic_services() const {\n  return (_has_bits_[0] & 0x00002000u) != 0;\n}\ninline void FileOptions::set_has_cc_generic_services() {\n  _has_bits_[0] |= 0x00002000u;\n}\ninline void FileOptions::clear_has_cc_generic_services() {\n  _has_bits_[0] &= ~0x00002000u;\n}\ninline void FileOptions::clear_cc_generic_services() {\n  cc_generic_services_ = false;\n  clear_has_cc_generic_services();\n}\ninline bool FileOptions::cc_generic_services() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_generic_services)\n  return cc_generic_services_;\n}\ninline void FileOptions::set_cc_generic_services(bool value) {\n  set_has_cc_generic_services();\n  cc_generic_services_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_generic_services)\n}\n\n// optional bool java_generic_services = 17 [default = false];\ninline bool FileOptions::has_java_generic_services() const {\n  return (_has_bits_[0] & 0x00004000u) != 0;\n}\ninline void FileOptions::set_has_java_generic_services() {\n  _has_bits_[0] |= 0x00004000u;\n}\ninline void FileOptions::clear_has_java_generic_services() {\n  _has_bits_[0] &= ~0x00004000u;\n}\ninline void FileOptions::clear_java_generic_services() {\n  java_generic_services_ = false;\n  clear_has_java_generic_services();\n}\ninline bool FileOptions::java_generic_services() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generic_services)\n  return java_generic_services_;\n}\ninline void FileOptions::set_java_generic_services(bool value) {\n  set_has_java_generic_services();\n  java_generic_services_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_generic_services)\n}\n\n// optional bool py_generic_services = 18 [default = false];\ninline bool FileOptions::has_py_generic_services() const {\n  return (_has_bits_[0] & 0x00008000u) != 0;\n}\ninline void FileOptions::set_has_py_generic_services() {\n  _has_bits_[0] |= 0x00008000u;\n}\ninline void FileOptions::clear_has_py_generic_services() {\n  _has_bits_[0] &= ~0x00008000u;\n}\ninline void FileOptions::clear_py_generic_services() {\n  py_generic_services_ = false;\n  clear_has_py_generic_services();\n}\ninline bool FileOptions::py_generic_services() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.py_generic_services)\n  return py_generic_services_;\n}\ninline void FileOptions::set_py_generic_services(bool value) {\n  set_has_py_generic_services();\n  py_generic_services_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.py_generic_services)\n}\n\n// optional bool php_generic_services = 42 [default = false];\ninline bool FileOptions::has_php_generic_services() const {\n  return (_has_bits_[0] & 0x00010000u) != 0;\n}\ninline void FileOptions::set_has_php_generic_services() {\n  _has_bits_[0] |= 0x00010000u;\n}\ninline void FileOptions::clear_has_php_generic_services() {\n  _has_bits_[0] &= ~0x00010000u;\n}\ninline void FileOptions::clear_php_generic_services() {\n  php_generic_services_ = false;\n  clear_has_php_generic_services();\n}\ninline bool FileOptions::php_generic_services() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_generic_services)\n  return php_generic_services_;\n}\ninline void FileOptions::set_php_generic_services(bool value) {\n  set_has_php_generic_services();\n  php_generic_services_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_generic_services)\n}\n\n// optional bool deprecated = 23 [default = false];\ninline bool FileOptions::has_deprecated() const {\n  return (_has_bits_[0] & 0x00020000u) != 0;\n}\ninline void FileOptions::set_has_deprecated() {\n  _has_bits_[0] |= 0x00020000u;\n}\ninline void FileOptions::clear_has_deprecated() {\n  _has_bits_[0] &= ~0x00020000u;\n}\ninline void FileOptions::clear_deprecated() {\n  deprecated_ = false;\n  clear_has_deprecated();\n}\ninline bool FileOptions::deprecated() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.deprecated)\n  return deprecated_;\n}\ninline void FileOptions::set_deprecated(bool value) {\n  set_has_deprecated();\n  deprecated_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.deprecated)\n}\n\n// optional bool cc_enable_arenas = 31 [default = false];\ninline bool FileOptions::has_cc_enable_arenas() const {\n  return (_has_bits_[0] & 0x00040000u) != 0;\n}\ninline void FileOptions::set_has_cc_enable_arenas() {\n  _has_bits_[0] |= 0x00040000u;\n}\ninline void FileOptions::clear_has_cc_enable_arenas() {\n  _has_bits_[0] &= ~0x00040000u;\n}\ninline void FileOptions::clear_cc_enable_arenas() {\n  cc_enable_arenas_ = false;\n  clear_has_cc_enable_arenas();\n}\ninline bool FileOptions::cc_enable_arenas() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_enable_arenas)\n  return cc_enable_arenas_;\n}\ninline void FileOptions::set_cc_enable_arenas(bool value) {\n  set_has_cc_enable_arenas();\n  cc_enable_arenas_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_enable_arenas)\n}\n\n// optional string objc_class_prefix = 36;\ninline bool FileOptions::has_objc_class_prefix() const {\n  return (_has_bits_[0] & 0x00000008u) != 0;\n}\ninline void FileOptions::set_has_objc_class_prefix() {\n  _has_bits_[0] |= 0x00000008u;\n}\ninline void FileOptions::clear_has_objc_class_prefix() {\n  _has_bits_[0] &= ~0x00000008u;\n}\ninline void FileOptions::clear_objc_class_prefix() {\n  objc_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_objc_class_prefix();\n}\ninline const ::std::string& FileOptions::objc_class_prefix() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.objc_class_prefix)\n  return objc_class_prefix_.Get();\n}\ninline void FileOptions::set_objc_class_prefix(const ::std::string& value) {\n  set_has_objc_class_prefix();\n  objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.objc_class_prefix)\n}\n#if LANG_CXX11\ninline void FileOptions::set_objc_class_prefix(::std::string&& value) {\n  set_has_objc_class_prefix();\n  objc_class_prefix_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.objc_class_prefix)\n}\n#endif\ninline void FileOptions::set_objc_class_prefix(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_objc_class_prefix();\n  objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.objc_class_prefix)\n}\ninline void FileOptions::set_objc_class_prefix(const char* value,\n    size_t size) {\n  set_has_objc_class_prefix();\n  objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.objc_class_prefix)\n}\ninline ::std::string* FileOptions::mutable_objc_class_prefix() {\n  set_has_objc_class_prefix();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.objc_class_prefix)\n  return objc_class_prefix_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_objc_class_prefix() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.objc_class_prefix)\n  if (!has_objc_class_prefix()) {\n    return NULL;\n  }\n  clear_has_objc_class_prefix();\n  return objc_class_prefix_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_objc_class_prefix(::std::string* objc_class_prefix) {\n  if (objc_class_prefix != NULL) {\n    set_has_objc_class_prefix();\n  } else {\n    clear_has_objc_class_prefix();\n  }\n  objc_class_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), objc_class_prefix,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.objc_class_prefix)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_objc_class_prefix() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.objc_class_prefix)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_objc_class_prefix();\n  return objc_class_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_objc_class_prefix(\n    ::std::string* objc_class_prefix) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (objc_class_prefix != NULL) {\n    set_has_objc_class_prefix();\n  } else {\n    clear_has_objc_class_prefix();\n  }\n  objc_class_prefix_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      objc_class_prefix, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.objc_class_prefix)\n}\n\n// optional string csharp_namespace = 37;\ninline bool FileOptions::has_csharp_namespace() const {\n  return (_has_bits_[0] & 0x00000010u) != 0;\n}\ninline void FileOptions::set_has_csharp_namespace() {\n  _has_bits_[0] |= 0x00000010u;\n}\ninline void FileOptions::clear_has_csharp_namespace() {\n  _has_bits_[0] &= ~0x00000010u;\n}\ninline void FileOptions::clear_csharp_namespace() {\n  csharp_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_csharp_namespace();\n}\ninline const ::std::string& FileOptions::csharp_namespace() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.csharp_namespace)\n  return csharp_namespace_.Get();\n}\ninline void FileOptions::set_csharp_namespace(const ::std::string& value) {\n  set_has_csharp_namespace();\n  csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.csharp_namespace)\n}\n#if LANG_CXX11\ninline void FileOptions::set_csharp_namespace(::std::string&& value) {\n  set_has_csharp_namespace();\n  csharp_namespace_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.csharp_namespace)\n}\n#endif\ninline void FileOptions::set_csharp_namespace(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_csharp_namespace();\n  csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.csharp_namespace)\n}\ninline void FileOptions::set_csharp_namespace(const char* value,\n    size_t size) {\n  set_has_csharp_namespace();\n  csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.csharp_namespace)\n}\ninline ::std::string* FileOptions::mutable_csharp_namespace() {\n  set_has_csharp_namespace();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.csharp_namespace)\n  return csharp_namespace_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_csharp_namespace() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.csharp_namespace)\n  if (!has_csharp_namespace()) {\n    return NULL;\n  }\n  clear_has_csharp_namespace();\n  return csharp_namespace_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_csharp_namespace(::std::string* csharp_namespace) {\n  if (csharp_namespace != NULL) {\n    set_has_csharp_namespace();\n  } else {\n    clear_has_csharp_namespace();\n  }\n  csharp_namespace_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), csharp_namespace,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.csharp_namespace)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_csharp_namespace() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.csharp_namespace)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_csharp_namespace();\n  return csharp_namespace_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_csharp_namespace(\n    ::std::string* csharp_namespace) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (csharp_namespace != NULL) {\n    set_has_csharp_namespace();\n  } else {\n    clear_has_csharp_namespace();\n  }\n  csharp_namespace_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      csharp_namespace, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.csharp_namespace)\n}\n\n// optional string swift_prefix = 39;\ninline bool FileOptions::has_swift_prefix() const {\n  return (_has_bits_[0] & 0x00000020u) != 0;\n}\ninline void FileOptions::set_has_swift_prefix() {\n  _has_bits_[0] |= 0x00000020u;\n}\ninline void FileOptions::clear_has_swift_prefix() {\n  _has_bits_[0] &= ~0x00000020u;\n}\ninline void FileOptions::clear_swift_prefix() {\n  swift_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_swift_prefix();\n}\ninline const ::std::string& FileOptions::swift_prefix() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.swift_prefix)\n  return swift_prefix_.Get();\n}\ninline void FileOptions::set_swift_prefix(const ::std::string& value) {\n  set_has_swift_prefix();\n  swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.swift_prefix)\n}\n#if LANG_CXX11\ninline void FileOptions::set_swift_prefix(::std::string&& value) {\n  set_has_swift_prefix();\n  swift_prefix_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.swift_prefix)\n}\n#endif\ninline void FileOptions::set_swift_prefix(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_swift_prefix();\n  swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.swift_prefix)\n}\ninline void FileOptions::set_swift_prefix(const char* value,\n    size_t size) {\n  set_has_swift_prefix();\n  swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.swift_prefix)\n}\ninline ::std::string* FileOptions::mutable_swift_prefix() {\n  set_has_swift_prefix();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.swift_prefix)\n  return swift_prefix_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_swift_prefix() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.swift_prefix)\n  if (!has_swift_prefix()) {\n    return NULL;\n  }\n  clear_has_swift_prefix();\n  return swift_prefix_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_swift_prefix(::std::string* swift_prefix) {\n  if (swift_prefix != NULL) {\n    set_has_swift_prefix();\n  } else {\n    clear_has_swift_prefix();\n  }\n  swift_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), swift_prefix,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.swift_prefix)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_swift_prefix() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.swift_prefix)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_swift_prefix();\n  return swift_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_swift_prefix(\n    ::std::string* swift_prefix) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (swift_prefix != NULL) {\n    set_has_swift_prefix();\n  } else {\n    clear_has_swift_prefix();\n  }\n  swift_prefix_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      swift_prefix, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.swift_prefix)\n}\n\n// optional string php_class_prefix = 40;\ninline bool FileOptions::has_php_class_prefix() const {\n  return (_has_bits_[0] & 0x00000040u) != 0;\n}\ninline void FileOptions::set_has_php_class_prefix() {\n  _has_bits_[0] |= 0x00000040u;\n}\ninline void FileOptions::clear_has_php_class_prefix() {\n  _has_bits_[0] &= ~0x00000040u;\n}\ninline void FileOptions::clear_php_class_prefix() {\n  php_class_prefix_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_php_class_prefix();\n}\ninline const ::std::string& FileOptions::php_class_prefix() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_class_prefix)\n  return php_class_prefix_.Get();\n}\ninline void FileOptions::set_php_class_prefix(const ::std::string& value) {\n  set_has_php_class_prefix();\n  php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_class_prefix)\n}\n#if LANG_CXX11\ninline void FileOptions::set_php_class_prefix(::std::string&& value) {\n  set_has_php_class_prefix();\n  php_class_prefix_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_class_prefix)\n}\n#endif\ninline void FileOptions::set_php_class_prefix(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_php_class_prefix();\n  php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.php_class_prefix)\n}\ninline void FileOptions::set_php_class_prefix(const char* value,\n    size_t size) {\n  set_has_php_class_prefix();\n  php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.php_class_prefix)\n}\ninline ::std::string* FileOptions::mutable_php_class_prefix() {\n  set_has_php_class_prefix();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_class_prefix)\n  return php_class_prefix_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_php_class_prefix() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_class_prefix)\n  if (!has_php_class_prefix()) {\n    return NULL;\n  }\n  clear_has_php_class_prefix();\n  return php_class_prefix_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_php_class_prefix(::std::string* php_class_prefix) {\n  if (php_class_prefix != NULL) {\n    set_has_php_class_prefix();\n  } else {\n    clear_has_php_class_prefix();\n  }\n  php_class_prefix_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_class_prefix,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_class_prefix)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_php_class_prefix() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_class_prefix)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_php_class_prefix();\n  return php_class_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_php_class_prefix(\n    ::std::string* php_class_prefix) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (php_class_prefix != NULL) {\n    set_has_php_class_prefix();\n  } else {\n    clear_has_php_class_prefix();\n  }\n  php_class_prefix_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      php_class_prefix, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_class_prefix)\n}\n\n// optional string php_namespace = 41;\ninline bool FileOptions::has_php_namespace() const {\n  return (_has_bits_[0] & 0x00000080u) != 0;\n}\ninline void FileOptions::set_has_php_namespace() {\n  _has_bits_[0] |= 0x00000080u;\n}\ninline void FileOptions::clear_has_php_namespace() {\n  _has_bits_[0] &= ~0x00000080u;\n}\ninline void FileOptions::clear_php_namespace() {\n  php_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_php_namespace();\n}\ninline const ::std::string& FileOptions::php_namespace() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_namespace)\n  return php_namespace_.Get();\n}\ninline void FileOptions::set_php_namespace(const ::std::string& value) {\n  set_has_php_namespace();\n  php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_namespace)\n}\n#if LANG_CXX11\ninline void FileOptions::set_php_namespace(::std::string&& value) {\n  set_has_php_namespace();\n  php_namespace_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_namespace)\n}\n#endif\ninline void FileOptions::set_php_namespace(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_php_namespace();\n  php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.php_namespace)\n}\ninline void FileOptions::set_php_namespace(const char* value,\n    size_t size) {\n  set_has_php_namespace();\n  php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.php_namespace)\n}\ninline ::std::string* FileOptions::mutable_php_namespace() {\n  set_has_php_namespace();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_namespace)\n  return php_namespace_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_php_namespace() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_namespace)\n  if (!has_php_namespace()) {\n    return NULL;\n  }\n  clear_has_php_namespace();\n  return php_namespace_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_php_namespace(::std::string* php_namespace) {\n  if (php_namespace != NULL) {\n    set_has_php_namespace();\n  } else {\n    clear_has_php_namespace();\n  }\n  php_namespace_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_namespace,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_namespace)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_php_namespace() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_namespace)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_php_namespace();\n  return php_namespace_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_php_namespace(\n    ::std::string* php_namespace) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (php_namespace != NULL) {\n    set_has_php_namespace();\n  } else {\n    clear_has_php_namespace();\n  }\n  php_namespace_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      php_namespace, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_namespace)\n}\n\n// optional string php_metadata_namespace = 44;\ninline bool FileOptions::has_php_metadata_namespace() const {\n  return (_has_bits_[0] & 0x00000100u) != 0;\n}\ninline void FileOptions::set_has_php_metadata_namespace() {\n  _has_bits_[0] |= 0x00000100u;\n}\ninline void FileOptions::clear_has_php_metadata_namespace() {\n  _has_bits_[0] &= ~0x00000100u;\n}\ninline void FileOptions::clear_php_metadata_namespace() {\n  php_metadata_namespace_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_php_metadata_namespace();\n}\ninline const ::std::string& FileOptions::php_metadata_namespace() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_metadata_namespace)\n  return php_metadata_namespace_.Get();\n}\ninline void FileOptions::set_php_metadata_namespace(const ::std::string& value) {\n  set_has_php_metadata_namespace();\n  php_metadata_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_metadata_namespace)\n}\n#if LANG_CXX11\ninline void FileOptions::set_php_metadata_namespace(::std::string&& value) {\n  set_has_php_metadata_namespace();\n  php_metadata_namespace_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.php_metadata_namespace)\n}\n#endif\ninline void FileOptions::set_php_metadata_namespace(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_php_metadata_namespace();\n  php_metadata_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.php_metadata_namespace)\n}\ninline void FileOptions::set_php_metadata_namespace(const char* value,\n    size_t size) {\n  set_has_php_metadata_namespace();\n  php_metadata_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.php_metadata_namespace)\n}\ninline ::std::string* FileOptions::mutable_php_metadata_namespace() {\n  set_has_php_metadata_namespace();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.php_metadata_namespace)\n  return php_metadata_namespace_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_php_metadata_namespace() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_metadata_namespace)\n  if (!has_php_metadata_namespace()) {\n    return NULL;\n  }\n  clear_has_php_metadata_namespace();\n  return php_metadata_namespace_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_php_metadata_namespace(::std::string* php_metadata_namespace) {\n  if (php_metadata_namespace != NULL) {\n    set_has_php_metadata_namespace();\n  } else {\n    clear_has_php_metadata_namespace();\n  }\n  php_metadata_namespace_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), php_metadata_namespace,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_metadata_namespace)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_php_metadata_namespace() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_metadata_namespace)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_php_metadata_namespace();\n  return php_metadata_namespace_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_php_metadata_namespace(\n    ::std::string* php_metadata_namespace) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (php_metadata_namespace != NULL) {\n    set_has_php_metadata_namespace();\n  } else {\n    clear_has_php_metadata_namespace();\n  }\n  php_metadata_namespace_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      php_metadata_namespace, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_metadata_namespace)\n}\n\n// optional string ruby_package = 45;\ninline bool FileOptions::has_ruby_package() const {\n  return (_has_bits_[0] & 0x00000200u) != 0;\n}\ninline void FileOptions::set_has_ruby_package() {\n  _has_bits_[0] |= 0x00000200u;\n}\ninline void FileOptions::clear_has_ruby_package() {\n  _has_bits_[0] &= ~0x00000200u;\n}\ninline void FileOptions::clear_ruby_package() {\n  ruby_package_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_ruby_package();\n}\ninline const ::std::string& FileOptions::ruby_package() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.ruby_package)\n  return ruby_package_.Get();\n}\ninline void FileOptions::set_ruby_package(const ::std::string& value) {\n  set_has_ruby_package();\n  ruby_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.ruby_package)\n}\n#if LANG_CXX11\ninline void FileOptions::set_ruby_package(::std::string&& value) {\n  set_has_ruby_package();\n  ruby_package_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.FileOptions.ruby_package)\n}\n#endif\ninline void FileOptions::set_ruby_package(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_ruby_package();\n  ruby_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.ruby_package)\n}\ninline void FileOptions::set_ruby_package(const char* value,\n    size_t size) {\n  set_has_ruby_package();\n  ruby_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.ruby_package)\n}\ninline ::std::string* FileOptions::mutable_ruby_package() {\n  set_has_ruby_package();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.ruby_package)\n  return ruby_package_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* FileOptions::release_ruby_package() {\n  // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.ruby_package)\n  if (!has_ruby_package()) {\n    return NULL;\n  }\n  clear_has_ruby_package();\n  return ruby_package_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void FileOptions::set_allocated_ruby_package(::std::string* ruby_package) {\n  if (ruby_package != NULL) {\n    set_has_ruby_package();\n  } else {\n    clear_has_ruby_package();\n  }\n  ruby_package_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ruby_package,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.ruby_package)\n}\ninline ::std::string* FileOptions::unsafe_arena_release_ruby_package() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.ruby_package)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_ruby_package();\n  return ruby_package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void FileOptions::unsafe_arena_set_allocated_ruby_package(\n    ::std::string* ruby_package) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (ruby_package != NULL) {\n    set_has_ruby_package();\n  } else {\n    clear_has_ruby_package();\n  }\n  ruby_package_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ruby_package, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.ruby_package)\n}\n\n// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\ninline int FileOptions::uninterpreted_option_size() const {\n  return uninterpreted_option_.size();\n}\ninline void FileOptions::clear_uninterpreted_option() {\n  uninterpreted_option_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption* FileOptions::mutable_uninterpreted_option(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.uninterpreted_option)\n  return uninterpreted_option_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\nFileOptions::mutable_uninterpreted_option() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileOptions.uninterpreted_option)\n  return &uninterpreted_option_;\n}\ninline const ::google::protobuf::UninterpretedOption& FileOptions::uninterpreted_option(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.uninterpreted_option)\n  return uninterpreted_option_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption* FileOptions::add_uninterpreted_option() {\n  // @@protoc_insertion_point(field_add:google.protobuf.FileOptions.uninterpreted_option)\n  return uninterpreted_option_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\nFileOptions::uninterpreted_option() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FileOptions.uninterpreted_option)\n  return uninterpreted_option_;\n}\n\n// -------------------------------------------------------------------\n\n// MessageOptions\n\n// optional bool message_set_wire_format = 1 [default = false];\ninline bool MessageOptions::has_message_set_wire_format() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void MessageOptions::set_has_message_set_wire_format() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void MessageOptions::clear_has_message_set_wire_format() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void MessageOptions::clear_message_set_wire_format() {\n  message_set_wire_format_ = false;\n  clear_has_message_set_wire_format();\n}\ninline bool MessageOptions::message_set_wire_format() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.message_set_wire_format)\n  return message_set_wire_format_;\n}\ninline void MessageOptions::set_message_set_wire_format(bool value) {\n  set_has_message_set_wire_format();\n  message_set_wire_format_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.message_set_wire_format)\n}\n\n// optional bool no_standard_descriptor_accessor = 2 [default = false];\ninline bool MessageOptions::has_no_standard_descriptor_accessor() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void MessageOptions::set_has_no_standard_descriptor_accessor() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void MessageOptions::clear_has_no_standard_descriptor_accessor() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void MessageOptions::clear_no_standard_descriptor_accessor() {\n  no_standard_descriptor_accessor_ = false;\n  clear_has_no_standard_descriptor_accessor();\n}\ninline bool MessageOptions::no_standard_descriptor_accessor() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.no_standard_descriptor_accessor)\n  return no_standard_descriptor_accessor_;\n}\ninline void MessageOptions::set_no_standard_descriptor_accessor(bool value) {\n  set_has_no_standard_descriptor_accessor();\n  no_standard_descriptor_accessor_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.no_standard_descriptor_accessor)\n}\n\n// optional bool deprecated = 3 [default = false];\ninline bool MessageOptions::has_deprecated() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void MessageOptions::set_has_deprecated() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void MessageOptions::clear_has_deprecated() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void MessageOptions::clear_deprecated() {\n  deprecated_ = false;\n  clear_has_deprecated();\n}\ninline bool MessageOptions::deprecated() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.deprecated)\n  return deprecated_;\n}\ninline void MessageOptions::set_deprecated(bool value) {\n  set_has_deprecated();\n  deprecated_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.deprecated)\n}\n\n// optional bool map_entry = 7;\ninline bool MessageOptions::has_map_entry() const {\n  return (_has_bits_[0] & 0x00000008u) != 0;\n}\ninline void MessageOptions::set_has_map_entry() {\n  _has_bits_[0] |= 0x00000008u;\n}\ninline void MessageOptions::clear_has_map_entry() {\n  _has_bits_[0] &= ~0x00000008u;\n}\ninline void MessageOptions::clear_map_entry() {\n  map_entry_ = false;\n  clear_has_map_entry();\n}\ninline bool MessageOptions::map_entry() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.map_entry)\n  return map_entry_;\n}\ninline void MessageOptions::set_map_entry(bool value) {\n  set_has_map_entry();\n  map_entry_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.map_entry)\n}\n\n// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\ninline int MessageOptions::uninterpreted_option_size() const {\n  return uninterpreted_option_.size();\n}\ninline void MessageOptions::clear_uninterpreted_option() {\n  uninterpreted_option_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption* MessageOptions::mutable_uninterpreted_option(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.MessageOptions.uninterpreted_option)\n  return uninterpreted_option_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\nMessageOptions::mutable_uninterpreted_option() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.MessageOptions.uninterpreted_option)\n  return &uninterpreted_option_;\n}\ninline const ::google::protobuf::UninterpretedOption& MessageOptions::uninterpreted_option(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.uninterpreted_option)\n  return uninterpreted_option_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption* MessageOptions::add_uninterpreted_option() {\n  // @@protoc_insertion_point(field_add:google.protobuf.MessageOptions.uninterpreted_option)\n  return uninterpreted_option_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\nMessageOptions::uninterpreted_option() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.MessageOptions.uninterpreted_option)\n  return uninterpreted_option_;\n}\n\n// -------------------------------------------------------------------\n\n// FieldOptions\n\n// optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];\ninline bool FieldOptions::has_ctype() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void FieldOptions::set_has_ctype() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void FieldOptions::clear_has_ctype() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void FieldOptions::clear_ctype() {\n  ctype_ = 0;\n  clear_has_ctype();\n}\ninline ::google::protobuf::FieldOptions_CType FieldOptions::ctype() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.ctype)\n  return static_cast< ::google::protobuf::FieldOptions_CType >(ctype_);\n}\ninline void FieldOptions::set_ctype(::google::protobuf::FieldOptions_CType value) {\n  assert(::google::protobuf::FieldOptions_CType_IsValid(value));\n  set_has_ctype();\n  ctype_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.ctype)\n}\n\n// optional bool packed = 2;\ninline bool FieldOptions::has_packed() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void FieldOptions::set_has_packed() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void FieldOptions::clear_has_packed() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void FieldOptions::clear_packed() {\n  packed_ = false;\n  clear_has_packed();\n}\ninline bool FieldOptions::packed() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.packed)\n  return packed_;\n}\ninline void FieldOptions::set_packed(bool value) {\n  set_has_packed();\n  packed_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.packed)\n}\n\n// optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];\ninline bool FieldOptions::has_jstype() const {\n  return (_has_bits_[0] & 0x00000020u) != 0;\n}\ninline void FieldOptions::set_has_jstype() {\n  _has_bits_[0] |= 0x00000020u;\n}\ninline void FieldOptions::clear_has_jstype() {\n  _has_bits_[0] &= ~0x00000020u;\n}\ninline void FieldOptions::clear_jstype() {\n  jstype_ = 0;\n  clear_has_jstype();\n}\ninline ::google::protobuf::FieldOptions_JSType FieldOptions::jstype() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.jstype)\n  return static_cast< ::google::protobuf::FieldOptions_JSType >(jstype_);\n}\ninline void FieldOptions::set_jstype(::google::protobuf::FieldOptions_JSType value) {\n  assert(::google::protobuf::FieldOptions_JSType_IsValid(value));\n  set_has_jstype();\n  jstype_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.jstype)\n}\n\n// optional bool lazy = 5 [default = false];\ninline bool FieldOptions::has_lazy() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void FieldOptions::set_has_lazy() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void FieldOptions::clear_has_lazy() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void FieldOptions::clear_lazy() {\n  lazy_ = false;\n  clear_has_lazy();\n}\ninline bool FieldOptions::lazy() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.lazy)\n  return lazy_;\n}\ninline void FieldOptions::set_lazy(bool value) {\n  set_has_lazy();\n  lazy_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.lazy)\n}\n\n// optional bool deprecated = 3 [default = false];\ninline bool FieldOptions::has_deprecated() const {\n  return (_has_bits_[0] & 0x00000008u) != 0;\n}\ninline void FieldOptions::set_has_deprecated() {\n  _has_bits_[0] |= 0x00000008u;\n}\ninline void FieldOptions::clear_has_deprecated() {\n  _has_bits_[0] &= ~0x00000008u;\n}\ninline void FieldOptions::clear_deprecated() {\n  deprecated_ = false;\n  clear_has_deprecated();\n}\ninline bool FieldOptions::deprecated() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.deprecated)\n  return deprecated_;\n}\ninline void FieldOptions::set_deprecated(bool value) {\n  set_has_deprecated();\n  deprecated_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.deprecated)\n}\n\n// optional bool weak = 10 [default = false];\ninline bool FieldOptions::has_weak() const {\n  return (_has_bits_[0] & 0x00000010u) != 0;\n}\ninline void FieldOptions::set_has_weak() {\n  _has_bits_[0] |= 0x00000010u;\n}\ninline void FieldOptions::clear_has_weak() {\n  _has_bits_[0] &= ~0x00000010u;\n}\ninline void FieldOptions::clear_weak() {\n  weak_ = false;\n  clear_has_weak();\n}\ninline bool FieldOptions::weak() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.weak)\n  return weak_;\n}\ninline void FieldOptions::set_weak(bool value) {\n  set_has_weak();\n  weak_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.weak)\n}\n\n// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\ninline int FieldOptions::uninterpreted_option_size() const {\n  return uninterpreted_option_.size();\n}\ninline void FieldOptions::clear_uninterpreted_option() {\n  uninterpreted_option_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption* FieldOptions::mutable_uninterpreted_option(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.uninterpreted_option)\n  return uninterpreted_option_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\nFieldOptions::mutable_uninterpreted_option() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldOptions.uninterpreted_option)\n  return &uninterpreted_option_;\n}\ninline const ::google::protobuf::UninterpretedOption& FieldOptions::uninterpreted_option(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.uninterpreted_option)\n  return uninterpreted_option_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption* FieldOptions::add_uninterpreted_option() {\n  // @@protoc_insertion_point(field_add:google.protobuf.FieldOptions.uninterpreted_option)\n  return uninterpreted_option_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\nFieldOptions::uninterpreted_option() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FieldOptions.uninterpreted_option)\n  return uninterpreted_option_;\n}\n\n// -------------------------------------------------------------------\n\n// OneofOptions\n\n// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\ninline int OneofOptions::uninterpreted_option_size() const {\n  return uninterpreted_option_.size();\n}\ninline void OneofOptions::clear_uninterpreted_option() {\n  uninterpreted_option_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption* OneofOptions::mutable_uninterpreted_option(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.OneofOptions.uninterpreted_option)\n  return uninterpreted_option_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\nOneofOptions::mutable_uninterpreted_option() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.OneofOptions.uninterpreted_option)\n  return &uninterpreted_option_;\n}\ninline const ::google::protobuf::UninterpretedOption& OneofOptions::uninterpreted_option(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.OneofOptions.uninterpreted_option)\n  return uninterpreted_option_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption* OneofOptions::add_uninterpreted_option() {\n  // @@protoc_insertion_point(field_add:google.protobuf.OneofOptions.uninterpreted_option)\n  return uninterpreted_option_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\nOneofOptions::uninterpreted_option() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.OneofOptions.uninterpreted_option)\n  return uninterpreted_option_;\n}\n\n// -------------------------------------------------------------------\n\n// EnumOptions\n\n// optional bool allow_alias = 2;\ninline bool EnumOptions::has_allow_alias() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void EnumOptions::set_has_allow_alias() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void EnumOptions::clear_has_allow_alias() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void EnumOptions::clear_allow_alias() {\n  allow_alias_ = false;\n  clear_has_allow_alias();\n}\ninline bool EnumOptions::allow_alias() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.allow_alias)\n  return allow_alias_;\n}\ninline void EnumOptions::set_allow_alias(bool value) {\n  set_has_allow_alias();\n  allow_alias_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.allow_alias)\n}\n\n// optional bool deprecated = 3 [default = false];\ninline bool EnumOptions::has_deprecated() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void EnumOptions::set_has_deprecated() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void EnumOptions::clear_has_deprecated() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void EnumOptions::clear_deprecated() {\n  deprecated_ = false;\n  clear_has_deprecated();\n}\ninline bool EnumOptions::deprecated() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.deprecated)\n  return deprecated_;\n}\ninline void EnumOptions::set_deprecated(bool value) {\n  set_has_deprecated();\n  deprecated_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.deprecated)\n}\n\n// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\ninline int EnumOptions::uninterpreted_option_size() const {\n  return uninterpreted_option_.size();\n}\ninline void EnumOptions::clear_uninterpreted_option() {\n  uninterpreted_option_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption* EnumOptions::mutable_uninterpreted_option(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumOptions.uninterpreted_option)\n  return uninterpreted_option_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\nEnumOptions::mutable_uninterpreted_option() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumOptions.uninterpreted_option)\n  return &uninterpreted_option_;\n}\ninline const ::google::protobuf::UninterpretedOption& EnumOptions::uninterpreted_option(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.uninterpreted_option)\n  return uninterpreted_option_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption* EnumOptions::add_uninterpreted_option() {\n  // @@protoc_insertion_point(field_add:google.protobuf.EnumOptions.uninterpreted_option)\n  return uninterpreted_option_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\nEnumOptions::uninterpreted_option() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.EnumOptions.uninterpreted_option)\n  return uninterpreted_option_;\n}\n\n// -------------------------------------------------------------------\n\n// EnumValueOptions\n\n// optional bool deprecated = 1 [default = false];\ninline bool EnumValueOptions::has_deprecated() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void EnumValueOptions::set_has_deprecated() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void EnumValueOptions::clear_has_deprecated() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void EnumValueOptions::clear_deprecated() {\n  deprecated_ = false;\n  clear_has_deprecated();\n}\ninline bool EnumValueOptions::deprecated() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.deprecated)\n  return deprecated_;\n}\ninline void EnumValueOptions::set_deprecated(bool value) {\n  set_has_deprecated();\n  deprecated_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumValueOptions.deprecated)\n}\n\n// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\ninline int EnumValueOptions::uninterpreted_option_size() const {\n  return uninterpreted_option_.size();\n}\ninline void EnumValueOptions::clear_uninterpreted_option() {\n  uninterpreted_option_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption* EnumValueOptions::mutable_uninterpreted_option(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueOptions.uninterpreted_option)\n  return uninterpreted_option_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\nEnumValueOptions::mutable_uninterpreted_option() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValueOptions.uninterpreted_option)\n  return &uninterpreted_option_;\n}\ninline const ::google::protobuf::UninterpretedOption& EnumValueOptions::uninterpreted_option(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.uninterpreted_option)\n  return uninterpreted_option_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption* EnumValueOptions::add_uninterpreted_option() {\n  // @@protoc_insertion_point(field_add:google.protobuf.EnumValueOptions.uninterpreted_option)\n  return uninterpreted_option_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\nEnumValueOptions::uninterpreted_option() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.EnumValueOptions.uninterpreted_option)\n  return uninterpreted_option_;\n}\n\n// -------------------------------------------------------------------\n\n// ServiceOptions\n\n// optional bool deprecated = 33 [default = false];\ninline bool ServiceOptions::has_deprecated() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void ServiceOptions::set_has_deprecated() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void ServiceOptions::clear_has_deprecated() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void ServiceOptions::clear_deprecated() {\n  deprecated_ = false;\n  clear_has_deprecated();\n}\ninline bool ServiceOptions::deprecated() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.deprecated)\n  return deprecated_;\n}\ninline void ServiceOptions::set_deprecated(bool value) {\n  set_has_deprecated();\n  deprecated_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.ServiceOptions.deprecated)\n}\n\n// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\ninline int ServiceOptions::uninterpreted_option_size() const {\n  return uninterpreted_option_.size();\n}\ninline void ServiceOptions::clear_uninterpreted_option() {\n  uninterpreted_option_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption* ServiceOptions::mutable_uninterpreted_option(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceOptions.uninterpreted_option)\n  return uninterpreted_option_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\nServiceOptions::mutable_uninterpreted_option() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceOptions.uninterpreted_option)\n  return &uninterpreted_option_;\n}\ninline const ::google::protobuf::UninterpretedOption& ServiceOptions::uninterpreted_option(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.uninterpreted_option)\n  return uninterpreted_option_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption* ServiceOptions::add_uninterpreted_option() {\n  // @@protoc_insertion_point(field_add:google.protobuf.ServiceOptions.uninterpreted_option)\n  return uninterpreted_option_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\nServiceOptions::uninterpreted_option() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.ServiceOptions.uninterpreted_option)\n  return uninterpreted_option_;\n}\n\n// -------------------------------------------------------------------\n\n// MethodOptions\n\n// optional bool deprecated = 33 [default = false];\ninline bool MethodOptions::has_deprecated() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void MethodOptions::set_has_deprecated() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void MethodOptions::clear_has_deprecated() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void MethodOptions::clear_deprecated() {\n  deprecated_ = false;\n  clear_has_deprecated();\n}\ninline bool MethodOptions::deprecated() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.deprecated)\n  return deprecated_;\n}\ninline void MethodOptions::set_deprecated(bool value) {\n  set_has_deprecated();\n  deprecated_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.MethodOptions.deprecated)\n}\n\n// optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\ninline bool MethodOptions::has_idempotency_level() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void MethodOptions::set_has_idempotency_level() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void MethodOptions::clear_has_idempotency_level() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void MethodOptions::clear_idempotency_level() {\n  idempotency_level_ = 0;\n  clear_has_idempotency_level();\n}\ninline ::google::protobuf::MethodOptions_IdempotencyLevel MethodOptions::idempotency_level() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.idempotency_level)\n  return static_cast< ::google::protobuf::MethodOptions_IdempotencyLevel >(idempotency_level_);\n}\ninline void MethodOptions::set_idempotency_level(::google::protobuf::MethodOptions_IdempotencyLevel value) {\n  assert(::google::protobuf::MethodOptions_IdempotencyLevel_IsValid(value));\n  set_has_idempotency_level();\n  idempotency_level_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.MethodOptions.idempotency_level)\n}\n\n// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;\ninline int MethodOptions::uninterpreted_option_size() const {\n  return uninterpreted_option_.size();\n}\ninline void MethodOptions::clear_uninterpreted_option() {\n  uninterpreted_option_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption* MethodOptions::mutable_uninterpreted_option(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.MethodOptions.uninterpreted_option)\n  return uninterpreted_option_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >*\nMethodOptions::mutable_uninterpreted_option() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.MethodOptions.uninterpreted_option)\n  return &uninterpreted_option_;\n}\ninline const ::google::protobuf::UninterpretedOption& MethodOptions::uninterpreted_option(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.uninterpreted_option)\n  return uninterpreted_option_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption* MethodOptions::add_uninterpreted_option() {\n  // @@protoc_insertion_point(field_add:google.protobuf.MethodOptions.uninterpreted_option)\n  return uninterpreted_option_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >&\nMethodOptions::uninterpreted_option() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.MethodOptions.uninterpreted_option)\n  return uninterpreted_option_;\n}\n\n// -------------------------------------------------------------------\n\n// UninterpretedOption_NamePart\n\n// required string name_part = 1;\ninline bool UninterpretedOption_NamePart::has_name_part() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void UninterpretedOption_NamePart::set_has_name_part() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void UninterpretedOption_NamePart::clear_has_name_part() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void UninterpretedOption_NamePart::clear_name_part() {\n  name_part_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_name_part();\n}\ninline const ::std::string& UninterpretedOption_NamePart::name_part() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.name_part)\n  return name_part_.Get();\n}\ninline void UninterpretedOption_NamePart::set_name_part(const ::std::string& value) {\n  set_has_name_part();\n  name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.name_part)\n}\n#if LANG_CXX11\ninline void UninterpretedOption_NamePart::set_name_part(::std::string&& value) {\n  set_has_name_part();\n  name_part_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.NamePart.name_part)\n}\n#endif\ninline void UninterpretedOption_NamePart::set_name_part(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_name_part();\n  name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.NamePart.name_part)\n}\ninline void UninterpretedOption_NamePart::set_name_part(const char* value,\n    size_t size) {\n  set_has_name_part();\n  name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.NamePart.name_part)\n}\ninline ::std::string* UninterpretedOption_NamePart::mutable_name_part() {\n  set_has_name_part();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.NamePart.name_part)\n  return name_part_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* UninterpretedOption_NamePart::release_name_part() {\n  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.NamePart.name_part)\n  if (!has_name_part()) {\n    return NULL;\n  }\n  clear_has_name_part();\n  return name_part_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* name_part) {\n  if (name_part != NULL) {\n    set_has_name_part();\n  } else {\n    clear_has_name_part();\n  }\n  name_part_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_part,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part)\n}\ninline ::std::string* UninterpretedOption_NamePart::unsafe_arena_release_name_part() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.NamePart.name_part)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_name_part();\n  return name_part_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void UninterpretedOption_NamePart::unsafe_arena_set_allocated_name_part(\n    ::std::string* name_part) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name_part != NULL) {\n    set_has_name_part();\n  } else {\n    clear_has_name_part();\n  }\n  name_part_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name_part, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part)\n}\n\n// required bool is_extension = 2;\ninline bool UninterpretedOption_NamePart::has_is_extension() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void UninterpretedOption_NamePart::set_has_is_extension() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void UninterpretedOption_NamePart::clear_has_is_extension() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void UninterpretedOption_NamePart::clear_is_extension() {\n  is_extension_ = false;\n  clear_has_is_extension();\n}\ninline bool UninterpretedOption_NamePart::is_extension() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.is_extension)\n  return is_extension_;\n}\ninline void UninterpretedOption_NamePart::set_is_extension(bool value) {\n  set_has_is_extension();\n  is_extension_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.is_extension)\n}\n\n// -------------------------------------------------------------------\n\n// UninterpretedOption\n\n// repeated .google.protobuf.UninterpretedOption.NamePart name = 2;\ninline int UninterpretedOption::name_size() const {\n  return name_.size();\n}\ninline void UninterpretedOption::clear_name() {\n  name_.Clear();\n}\ninline ::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::mutable_name(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.name)\n  return name_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >*\nUninterpretedOption::mutable_name() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.UninterpretedOption.name)\n  return &name_;\n}\ninline const ::google::protobuf::UninterpretedOption_NamePart& UninterpretedOption::name(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.name)\n  return name_.Get(index);\n}\ninline ::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::add_name() {\n  // @@protoc_insertion_point(field_add:google.protobuf.UninterpretedOption.name)\n  return name_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >&\nUninterpretedOption::name() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.UninterpretedOption.name)\n  return name_;\n}\n\n// optional string identifier_value = 3;\ninline bool UninterpretedOption::has_identifier_value() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void UninterpretedOption::set_has_identifier_value() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void UninterpretedOption::clear_has_identifier_value() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void UninterpretedOption::clear_identifier_value() {\n  identifier_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_identifier_value();\n}\ninline const ::std::string& UninterpretedOption::identifier_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.identifier_value)\n  return identifier_value_.Get();\n}\ninline void UninterpretedOption::set_identifier_value(const ::std::string& value) {\n  set_has_identifier_value();\n  identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.identifier_value)\n}\n#if LANG_CXX11\ninline void UninterpretedOption::set_identifier_value(::std::string&& value) {\n  set_has_identifier_value();\n  identifier_value_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.identifier_value)\n}\n#endif\ninline void UninterpretedOption::set_identifier_value(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_identifier_value();\n  identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.identifier_value)\n}\ninline void UninterpretedOption::set_identifier_value(const char* value,\n    size_t size) {\n  set_has_identifier_value();\n  identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.identifier_value)\n}\ninline ::std::string* UninterpretedOption::mutable_identifier_value() {\n  set_has_identifier_value();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.identifier_value)\n  return identifier_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* UninterpretedOption::release_identifier_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.identifier_value)\n  if (!has_identifier_value()) {\n    return NULL;\n  }\n  clear_has_identifier_value();\n  return identifier_value_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void UninterpretedOption::set_allocated_identifier_value(::std::string* identifier_value) {\n  if (identifier_value != NULL) {\n    set_has_identifier_value();\n  } else {\n    clear_has_identifier_value();\n  }\n  identifier_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), identifier_value,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.identifier_value)\n}\ninline ::std::string* UninterpretedOption::unsafe_arena_release_identifier_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.identifier_value)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_identifier_value();\n  return identifier_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void UninterpretedOption::unsafe_arena_set_allocated_identifier_value(\n    ::std::string* identifier_value) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (identifier_value != NULL) {\n    set_has_identifier_value();\n  } else {\n    clear_has_identifier_value();\n  }\n  identifier_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      identifier_value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.identifier_value)\n}\n\n// optional uint64 positive_int_value = 4;\ninline bool UninterpretedOption::has_positive_int_value() const {\n  return (_has_bits_[0] & 0x00000008u) != 0;\n}\ninline void UninterpretedOption::set_has_positive_int_value() {\n  _has_bits_[0] |= 0x00000008u;\n}\ninline void UninterpretedOption::clear_has_positive_int_value() {\n  _has_bits_[0] &= ~0x00000008u;\n}\ninline void UninterpretedOption::clear_positive_int_value() {\n  positive_int_value_ = GOOGLE_ULONGLONG(0);\n  clear_has_positive_int_value();\n}\ninline ::google::protobuf::uint64 UninterpretedOption::positive_int_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.positive_int_value)\n  return positive_int_value_;\n}\ninline void UninterpretedOption::set_positive_int_value(::google::protobuf::uint64 value) {\n  set_has_positive_int_value();\n  positive_int_value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.positive_int_value)\n}\n\n// optional int64 negative_int_value = 5;\ninline bool UninterpretedOption::has_negative_int_value() const {\n  return (_has_bits_[0] & 0x00000010u) != 0;\n}\ninline void UninterpretedOption::set_has_negative_int_value() {\n  _has_bits_[0] |= 0x00000010u;\n}\ninline void UninterpretedOption::clear_has_negative_int_value() {\n  _has_bits_[0] &= ~0x00000010u;\n}\ninline void UninterpretedOption::clear_negative_int_value() {\n  negative_int_value_ = GOOGLE_LONGLONG(0);\n  clear_has_negative_int_value();\n}\ninline ::google::protobuf::int64 UninterpretedOption::negative_int_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.negative_int_value)\n  return negative_int_value_;\n}\ninline void UninterpretedOption::set_negative_int_value(::google::protobuf::int64 value) {\n  set_has_negative_int_value();\n  negative_int_value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.negative_int_value)\n}\n\n// optional double double_value = 6;\ninline bool UninterpretedOption::has_double_value() const {\n  return (_has_bits_[0] & 0x00000020u) != 0;\n}\ninline void UninterpretedOption::set_has_double_value() {\n  _has_bits_[0] |= 0x00000020u;\n}\ninline void UninterpretedOption::clear_has_double_value() {\n  _has_bits_[0] &= ~0x00000020u;\n}\ninline void UninterpretedOption::clear_double_value() {\n  double_value_ = 0;\n  clear_has_double_value();\n}\ninline double UninterpretedOption::double_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.double_value)\n  return double_value_;\n}\ninline void UninterpretedOption::set_double_value(double value) {\n  set_has_double_value();\n  double_value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.double_value)\n}\n\n// optional bytes string_value = 7;\ninline bool UninterpretedOption::has_string_value() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void UninterpretedOption::set_has_string_value() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void UninterpretedOption::clear_has_string_value() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void UninterpretedOption::clear_string_value() {\n  string_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_string_value();\n}\ninline const ::std::string& UninterpretedOption::string_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.string_value)\n  return string_value_.Get();\n}\ninline void UninterpretedOption::set_string_value(const ::std::string& value) {\n  set_has_string_value();\n  string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.string_value)\n}\n#if LANG_CXX11\ninline void UninterpretedOption::set_string_value(::std::string&& value) {\n  set_has_string_value();\n  string_value_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.string_value)\n}\n#endif\ninline void UninterpretedOption::set_string_value(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_string_value();\n  string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.string_value)\n}\ninline void UninterpretedOption::set_string_value(const void* value,\n    size_t size) {\n  set_has_string_value();\n  string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.string_value)\n}\ninline ::std::string* UninterpretedOption::mutable_string_value() {\n  set_has_string_value();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.string_value)\n  return string_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* UninterpretedOption::release_string_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.string_value)\n  if (!has_string_value()) {\n    return NULL;\n  }\n  clear_has_string_value();\n  return string_value_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void UninterpretedOption::set_allocated_string_value(::std::string* string_value) {\n  if (string_value != NULL) {\n    set_has_string_value();\n  } else {\n    clear_has_string_value();\n  }\n  string_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.string_value)\n}\ninline ::std::string* UninterpretedOption::unsafe_arena_release_string_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.string_value)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_string_value();\n  return string_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void UninterpretedOption::unsafe_arena_set_allocated_string_value(\n    ::std::string* string_value) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (string_value != NULL) {\n    set_has_string_value();\n  } else {\n    clear_has_string_value();\n  }\n  string_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      string_value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.string_value)\n}\n\n// optional string aggregate_value = 8;\ninline bool UninterpretedOption::has_aggregate_value() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void UninterpretedOption::set_has_aggregate_value() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void UninterpretedOption::clear_has_aggregate_value() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void UninterpretedOption::clear_aggregate_value() {\n  aggregate_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_aggregate_value();\n}\ninline const ::std::string& UninterpretedOption::aggregate_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.aggregate_value)\n  return aggregate_value_.Get();\n}\ninline void UninterpretedOption::set_aggregate_value(const ::std::string& value) {\n  set_has_aggregate_value();\n  aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.aggregate_value)\n}\n#if LANG_CXX11\ninline void UninterpretedOption::set_aggregate_value(::std::string&& value) {\n  set_has_aggregate_value();\n  aggregate_value_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.UninterpretedOption.aggregate_value)\n}\n#endif\ninline void UninterpretedOption::set_aggregate_value(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_aggregate_value();\n  aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.aggregate_value)\n}\ninline void UninterpretedOption::set_aggregate_value(const char* value,\n    size_t size) {\n  set_has_aggregate_value();\n  aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.aggregate_value)\n}\ninline ::std::string* UninterpretedOption::mutable_aggregate_value() {\n  set_has_aggregate_value();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.aggregate_value)\n  return aggregate_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* UninterpretedOption::release_aggregate_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.aggregate_value)\n  if (!has_aggregate_value()) {\n    return NULL;\n  }\n  clear_has_aggregate_value();\n  return aggregate_value_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void UninterpretedOption::set_allocated_aggregate_value(::std::string* aggregate_value) {\n  if (aggregate_value != NULL) {\n    set_has_aggregate_value();\n  } else {\n    clear_has_aggregate_value();\n  }\n  aggregate_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), aggregate_value,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.aggregate_value)\n}\ninline ::std::string* UninterpretedOption::unsafe_arena_release_aggregate_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.aggregate_value)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_aggregate_value();\n  return aggregate_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void UninterpretedOption::unsafe_arena_set_allocated_aggregate_value(\n    ::std::string* aggregate_value) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (aggregate_value != NULL) {\n    set_has_aggregate_value();\n  } else {\n    clear_has_aggregate_value();\n  }\n  aggregate_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      aggregate_value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.aggregate_value)\n}\n\n// -------------------------------------------------------------------\n\n// SourceCodeInfo_Location\n\n// repeated int32 path = 1 [packed = true];\ninline int SourceCodeInfo_Location::path_size() const {\n  return path_.size();\n}\ninline void SourceCodeInfo_Location::clear_path() {\n  path_.Clear();\n}\ninline ::google::protobuf::int32 SourceCodeInfo_Location::path(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.path)\n  return path_.Get(index);\n}\ninline void SourceCodeInfo_Location::set_path(int index, ::google::protobuf::int32 value) {\n  path_.Set(index, value);\n  // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.path)\n}\ninline void SourceCodeInfo_Location::add_path(::google::protobuf::int32 value) {\n  path_.Add(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.path)\n}\ninline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\nSourceCodeInfo_Location::path() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.path)\n  return path_;\n}\ninline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\nSourceCodeInfo_Location::mutable_path() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.path)\n  return &path_;\n}\n\n// repeated int32 span = 2 [packed = true];\ninline int SourceCodeInfo_Location::span_size() const {\n  return span_.size();\n}\ninline void SourceCodeInfo_Location::clear_span() {\n  span_.Clear();\n}\ninline ::google::protobuf::int32 SourceCodeInfo_Location::span(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.span)\n  return span_.Get(index);\n}\ninline void SourceCodeInfo_Location::set_span(int index, ::google::protobuf::int32 value) {\n  span_.Set(index, value);\n  // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.span)\n}\ninline void SourceCodeInfo_Location::add_span(::google::protobuf::int32 value) {\n  span_.Add(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.span)\n}\ninline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\nSourceCodeInfo_Location::span() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.span)\n  return span_;\n}\ninline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\nSourceCodeInfo_Location::mutable_span() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.span)\n  return &span_;\n}\n\n// optional string leading_comments = 3;\ninline bool SourceCodeInfo_Location::has_leading_comments() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void SourceCodeInfo_Location::set_has_leading_comments() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void SourceCodeInfo_Location::clear_has_leading_comments() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void SourceCodeInfo_Location::clear_leading_comments() {\n  leading_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_leading_comments();\n}\ninline const ::std::string& SourceCodeInfo_Location::leading_comments() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_comments)\n  return leading_comments_.Get();\n}\ninline void SourceCodeInfo_Location::set_leading_comments(const ::std::string& value) {\n  set_has_leading_comments();\n  leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_comments)\n}\n#if LANG_CXX11\ninline void SourceCodeInfo_Location::set_leading_comments(::std::string&& value) {\n  set_has_leading_comments();\n  leading_comments_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.SourceCodeInfo.Location.leading_comments)\n}\n#endif\ninline void SourceCodeInfo_Location::set_leading_comments(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_leading_comments();\n  leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_comments)\n}\ninline void SourceCodeInfo_Location::set_leading_comments(const char* value,\n    size_t size) {\n  set_has_leading_comments();\n  leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_comments)\n}\ninline ::std::string* SourceCodeInfo_Location::mutable_leading_comments() {\n  set_has_leading_comments();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_comments)\n  return leading_comments_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* SourceCodeInfo_Location::release_leading_comments() {\n  // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.leading_comments)\n  if (!has_leading_comments()) {\n    return NULL;\n  }\n  clear_has_leading_comments();\n  return leading_comments_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void SourceCodeInfo_Location::set_allocated_leading_comments(::std::string* leading_comments) {\n  if (leading_comments != NULL) {\n    set_has_leading_comments();\n  } else {\n    clear_has_leading_comments();\n  }\n  leading_comments_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), leading_comments,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments)\n}\ninline ::std::string* SourceCodeInfo_Location::unsafe_arena_release_leading_comments() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.SourceCodeInfo.Location.leading_comments)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_leading_comments();\n  return leading_comments_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void SourceCodeInfo_Location::unsafe_arena_set_allocated_leading_comments(\n    ::std::string* leading_comments) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (leading_comments != NULL) {\n    set_has_leading_comments();\n  } else {\n    clear_has_leading_comments();\n  }\n  leading_comments_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      leading_comments, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments)\n}\n\n// optional string trailing_comments = 4;\ninline bool SourceCodeInfo_Location::has_trailing_comments() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void SourceCodeInfo_Location::set_has_trailing_comments() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void SourceCodeInfo_Location::clear_has_trailing_comments() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void SourceCodeInfo_Location::clear_trailing_comments() {\n  trailing_comments_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_trailing_comments();\n}\ninline const ::std::string& SourceCodeInfo_Location::trailing_comments() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n  return trailing_comments_.Get();\n}\ninline void SourceCodeInfo_Location::set_trailing_comments(const ::std::string& value) {\n  set_has_trailing_comments();\n  trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n}\n#if LANG_CXX11\ninline void SourceCodeInfo_Location::set_trailing_comments(::std::string&& value) {\n  set_has_trailing_comments();\n  trailing_comments_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n}\n#endif\ninline void SourceCodeInfo_Location::set_trailing_comments(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_trailing_comments();\n  trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n}\ninline void SourceCodeInfo_Location::set_trailing_comments(const char* value,\n    size_t size) {\n  set_has_trailing_comments();\n  trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n}\ninline ::std::string* SourceCodeInfo_Location::mutable_trailing_comments() {\n  set_has_trailing_comments();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n  return trailing_comments_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* SourceCodeInfo_Location::release_trailing_comments() {\n  // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n  if (!has_trailing_comments()) {\n    return NULL;\n  }\n  clear_has_trailing_comments();\n  return trailing_comments_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::string* trailing_comments) {\n  if (trailing_comments != NULL) {\n    set_has_trailing_comments();\n  } else {\n    clear_has_trailing_comments();\n  }\n  trailing_comments_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), trailing_comments,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n}\ninline ::std::string* SourceCodeInfo_Location::unsafe_arena_release_trailing_comments() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_trailing_comments();\n  return trailing_comments_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void SourceCodeInfo_Location::unsafe_arena_set_allocated_trailing_comments(\n    ::std::string* trailing_comments) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (trailing_comments != NULL) {\n    set_has_trailing_comments();\n  } else {\n    clear_has_trailing_comments();\n  }\n  trailing_comments_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      trailing_comments, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments)\n}\n\n// repeated string leading_detached_comments = 6;\ninline int SourceCodeInfo_Location::leading_detached_comments_size() const {\n  return leading_detached_comments_.size();\n}\ninline void SourceCodeInfo_Location::clear_leading_detached_comments() {\n  leading_detached_comments_.Clear();\n}\ninline const ::std::string& SourceCodeInfo_Location::leading_detached_comments(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n  return leading_detached_comments_.Get(index);\n}\ninline ::std::string* SourceCodeInfo_Location::mutable_leading_detached_comments(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n  return leading_detached_comments_.Mutable(index);\n}\ninline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const ::std::string& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n  leading_detached_comments_.Mutable(index)->assign(value);\n}\n#if LANG_CXX11\ninline void SourceCodeInfo_Location::set_leading_detached_comments(int index, ::std::string&& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n  leading_detached_comments_.Mutable(index)->assign(std::move(value));\n}\n#endif\ninline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  leading_detached_comments_.Mutable(index)->assign(value);\n  // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n}\ninline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value, size_t size) {\n  leading_detached_comments_.Mutable(index)->assign(\n    reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n}\ninline ::std::string* SourceCodeInfo_Location::add_leading_detached_comments() {\n  // @@protoc_insertion_point(field_add_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n  return leading_detached_comments_.Add();\n}\ninline void SourceCodeInfo_Location::add_leading_detached_comments(const ::std::string& value) {\n  leading_detached_comments_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n}\n#if LANG_CXX11\ninline void SourceCodeInfo_Location::add_leading_detached_comments(::std::string&& value) {\n  leading_detached_comments_.Add(std::move(value));\n  // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n}\n#endif\ninline void SourceCodeInfo_Location::add_leading_detached_comments(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  leading_detached_comments_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n}\ninline void SourceCodeInfo_Location::add_leading_detached_comments(const char* value, size_t size) {\n  leading_detached_comments_.Add()->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_add_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n}\ninline const ::google::protobuf::RepeatedPtrField< ::std::string>&\nSourceCodeInfo_Location::leading_detached_comments() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n  return leading_detached_comments_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::std::string>*\nSourceCodeInfo_Location::mutable_leading_detached_comments() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments)\n  return &leading_detached_comments_;\n}\n\n// -------------------------------------------------------------------\n\n// SourceCodeInfo\n\n// repeated .google.protobuf.SourceCodeInfo.Location location = 1;\ninline int SourceCodeInfo::location_size() const {\n  return location_.size();\n}\ninline void SourceCodeInfo::clear_location() {\n  location_.Clear();\n}\ninline ::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::mutable_location(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.location)\n  return location_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >*\nSourceCodeInfo::mutable_location() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.location)\n  return &location_;\n}\ninline const ::google::protobuf::SourceCodeInfo_Location& SourceCodeInfo::location(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.location)\n  return location_.Get(index);\n}\ninline ::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::add_location() {\n  // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.location)\n  return location_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >&\nSourceCodeInfo::location() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.location)\n  return location_;\n}\n\n// -------------------------------------------------------------------\n\n// GeneratedCodeInfo_Annotation\n\n// repeated int32 path = 1 [packed = true];\ninline int GeneratedCodeInfo_Annotation::path_size() const {\n  return path_.size();\n}\ninline void GeneratedCodeInfo_Annotation::clear_path() {\n  path_.Clear();\n}\ninline ::google::protobuf::int32 GeneratedCodeInfo_Annotation::path(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.path)\n  return path_.Get(index);\n}\ninline void GeneratedCodeInfo_Annotation::set_path(int index, ::google::protobuf::int32 value) {\n  path_.Set(index, value);\n  // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.path)\n}\ninline void GeneratedCodeInfo_Annotation::add_path(::google::protobuf::int32 value) {\n  path_.Add(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.Annotation.path)\n}\ninline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&\nGeneratedCodeInfo_Annotation::path() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.Annotation.path)\n  return path_;\n}\ninline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*\nGeneratedCodeInfo_Annotation::mutable_path() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.Annotation.path)\n  return &path_;\n}\n\n// optional string source_file = 2;\ninline bool GeneratedCodeInfo_Annotation::has_source_file() const {\n  return (_has_bits_[0] & 0x00000001u) != 0;\n}\ninline void GeneratedCodeInfo_Annotation::set_has_source_file() {\n  _has_bits_[0] |= 0x00000001u;\n}\ninline void GeneratedCodeInfo_Annotation::clear_has_source_file() {\n  _has_bits_[0] &= ~0x00000001u;\n}\ninline void GeneratedCodeInfo_Annotation::clear_source_file() {\n  source_file_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  clear_has_source_file();\n}\ninline const ::std::string& GeneratedCodeInfo_Annotation::source_file() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n  return source_file_.Get();\n}\ninline void GeneratedCodeInfo_Annotation::set_source_file(const ::std::string& value) {\n  set_has_source_file();\n  source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n}\n#if LANG_CXX11\ninline void GeneratedCodeInfo_Annotation::set_source_file(::std::string&& value) {\n  set_has_source_file();\n  source_file_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n}\n#endif\ninline void GeneratedCodeInfo_Annotation::set_source_file(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  set_has_source_file();\n  source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n}\ninline void GeneratedCodeInfo_Annotation::set_source_file(const char* value,\n    size_t size) {\n  set_has_source_file();\n  source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n}\ninline ::std::string* GeneratedCodeInfo_Annotation::mutable_source_file() {\n  set_has_source_file();\n  // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n  return source_file_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* GeneratedCodeInfo_Annotation::release_source_file() {\n  // @@protoc_insertion_point(field_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n  if (!has_source_file()) {\n    return NULL;\n  }\n  clear_has_source_file();\n  return source_file_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void GeneratedCodeInfo_Annotation::set_allocated_source_file(::std::string* source_file) {\n  if (source_file != NULL) {\n    set_has_source_file();\n  } else {\n    clear_has_source_file();\n  }\n  source_file_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source_file,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n}\ninline ::std::string* GeneratedCodeInfo_Annotation::unsafe_arena_release_source_file() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  clear_has_source_file();\n  return source_file_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void GeneratedCodeInfo_Annotation::unsafe_arena_set_allocated_source_file(\n    ::std::string* source_file) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (source_file != NULL) {\n    set_has_source_file();\n  } else {\n    clear_has_source_file();\n  }\n  source_file_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      source_file, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file)\n}\n\n// optional int32 begin = 3;\ninline bool GeneratedCodeInfo_Annotation::has_begin() const {\n  return (_has_bits_[0] & 0x00000002u) != 0;\n}\ninline void GeneratedCodeInfo_Annotation::set_has_begin() {\n  _has_bits_[0] |= 0x00000002u;\n}\ninline void GeneratedCodeInfo_Annotation::clear_has_begin() {\n  _has_bits_[0] &= ~0x00000002u;\n}\ninline void GeneratedCodeInfo_Annotation::clear_begin() {\n  begin_ = 0;\n  clear_has_begin();\n}\ninline ::google::protobuf::int32 GeneratedCodeInfo_Annotation::begin() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.begin)\n  return begin_;\n}\ninline void GeneratedCodeInfo_Annotation::set_begin(::google::protobuf::int32 value) {\n  set_has_begin();\n  begin_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.begin)\n}\n\n// optional int32 end = 4;\ninline bool GeneratedCodeInfo_Annotation::has_end() const {\n  return (_has_bits_[0] & 0x00000004u) != 0;\n}\ninline void GeneratedCodeInfo_Annotation::set_has_end() {\n  _has_bits_[0] |= 0x00000004u;\n}\ninline void GeneratedCodeInfo_Annotation::clear_has_end() {\n  _has_bits_[0] &= ~0x00000004u;\n}\ninline void GeneratedCodeInfo_Annotation::clear_end() {\n  end_ = 0;\n  clear_has_end();\n}\ninline ::google::protobuf::int32 GeneratedCodeInfo_Annotation::end() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.end)\n  return end_;\n}\ninline void GeneratedCodeInfo_Annotation::set_end(::google::protobuf::int32 value) {\n  set_has_end();\n  end_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.end)\n}\n\n// -------------------------------------------------------------------\n\n// GeneratedCodeInfo\n\n// repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;\ninline int GeneratedCodeInfo::annotation_size() const {\n  return annotation_.size();\n}\ninline void GeneratedCodeInfo::clear_annotation() {\n  annotation_.Clear();\n}\ninline ::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::mutable_annotation(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.annotation)\n  return annotation_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >*\nGeneratedCodeInfo::mutable_annotation() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.annotation)\n  return &annotation_;\n}\ninline const ::google::protobuf::GeneratedCodeInfo_Annotation& GeneratedCodeInfo::annotation(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.annotation)\n  return annotation_.Get(index);\n}\ninline ::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::add_annotation() {\n  // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.annotation)\n  return annotation_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >&\nGeneratedCodeInfo::annotation() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.annotation)\n  return annotation_;\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\nnamespace google {\nnamespace protobuf {\n\ntemplate <> struct is_proto_enum< ::google::protobuf::FieldDescriptorProto_Type> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldDescriptorProto_Type>() {\n  return ::google::protobuf::FieldDescriptorProto_Type_descriptor();\n}\ntemplate <> struct is_proto_enum< ::google::protobuf::FieldDescriptorProto_Label> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldDescriptorProto_Label>() {\n  return ::google::protobuf::FieldDescriptorProto_Label_descriptor();\n}\ntemplate <> struct is_proto_enum< ::google::protobuf::FileOptions_OptimizeMode> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FileOptions_OptimizeMode>() {\n  return ::google::protobuf::FileOptions_OptimizeMode_descriptor();\n}\ntemplate <> struct is_proto_enum< ::google::protobuf::FieldOptions_CType> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldOptions_CType>() {\n  return ::google::protobuf::FieldOptions_CType_descriptor();\n}\ntemplate <> struct is_proto_enum< ::google::protobuf::FieldOptions_JSType> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldOptions_JSType>() {\n  return ::google::protobuf::FieldOptions_JSType_descriptor();\n}\ntemplate <> struct is_proto_enum< ::google::protobuf::MethodOptions_IdempotencyLevel> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::MethodOptions_IdempotencyLevel>() {\n  return ::google::protobuf::MethodOptions_IdempotencyLevel_descriptor();\n}\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/descriptor.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// The messages in this file describe the definitions found in .proto files.\n// A valid .proto file can be translated directly to a FileDescriptorProto\n// without any other information (e.g. without reading its imports).\n\n\nsyntax = \"proto2\";\n\npackage google.protobuf;\noption go_package = \"github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"DescriptorProtos\";\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption objc_class_prefix = \"GPB\";\noption cc_enable_arenas = true;\n\n// descriptor.proto must be optimized for speed because reflection-based\n// algorithms don't work during bootstrapping.\noption optimize_for = SPEED;\n\n// The protocol compiler can output a FileDescriptorSet containing the .proto\n// files it parses.\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n}\n\n// Describes a complete .proto file.\nmessage FileDescriptorProto {\n  optional string name = 1;       // file name, relative to root of source tree\n  optional string package = 2;    // e.g. \"foo\", \"foo.bar\", etc.\n\n  // Names of files imported by this file.\n  repeated string dependency = 3;\n  // Indexes of the public imported files in the dependency list above.\n  repeated int32 public_dependency = 10;\n  // Indexes of the weak imported files in the dependency list.\n  // For Google-internal migration only. Do not use.\n  repeated int32 weak_dependency = 11;\n\n  // All top-level definitions in this file.\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n\n  optional FileOptions options = 8;\n\n  // This field contains optional information about the original source code.\n  // You may safely remove this entire field without harming runtime\n  // functionality of the descriptors -- the information is needed only by\n  // development tools.\n  optional SourceCodeInfo source_code_info = 9;\n\n  // The syntax of the proto file.\n  // The supported values are \"proto2\" and \"proto3\".\n  optional string syntax = 12;\n}\n\n// Describes a message type.\nmessage DescriptorProto {\n  optional string name = 1;\n\n  repeated FieldDescriptorProto field = 2;\n  repeated FieldDescriptorProto extension = 6;\n\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n\n    optional ExtensionRangeOptions options = 3;\n  }\n  repeated ExtensionRange extension_range = 5;\n\n  repeated OneofDescriptorProto oneof_decl = 8;\n\n  optional MessageOptions options = 7;\n\n  // Range of reserved tag numbers. Reserved tag numbers may not be used by\n  // fields or extension ranges in the same message. Reserved ranges may\n  // not overlap.\n  message ReservedRange {\n    optional int32 start = 1; // Inclusive.\n    optional int32 end = 2;   // Exclusive.\n  }\n  repeated ReservedRange reserved_range = 9;\n  // Reserved field names, which may not be used by fields in the same message.\n  // A given name may only be reserved once.\n  repeated string reserved_name = 10;\n}\n\nmessage ExtensionRangeOptions {\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\n// Describes a field within a message.\nmessage FieldDescriptorProto {\n  enum Type {\n    // 0 is reserved for errors.\n    // Order is weird for historical reasons.\n    TYPE_DOUBLE         = 1;\n    TYPE_FLOAT          = 2;\n    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if\n    // negative values are likely.\n    TYPE_INT64          = 3;\n    TYPE_UINT64         = 4;\n    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if\n    // negative values are likely.\n    TYPE_INT32          = 5;\n    TYPE_FIXED64        = 6;\n    TYPE_FIXED32        = 7;\n    TYPE_BOOL           = 8;\n    TYPE_STRING         = 9;\n    // Tag-delimited aggregate.\n    // Group type is deprecated and not supported in proto3. However, Proto3\n    // implementations should still be able to parse the group wire format and\n    // treat group fields as unknown fields.\n    TYPE_GROUP          = 10;\n    TYPE_MESSAGE        = 11;  // Length-delimited aggregate.\n\n    // New in version 2.\n    TYPE_BYTES          = 12;\n    TYPE_UINT32         = 13;\n    TYPE_ENUM           = 14;\n    TYPE_SFIXED32       = 15;\n    TYPE_SFIXED64       = 16;\n    TYPE_SINT32         = 17;  // Uses ZigZag encoding.\n    TYPE_SINT64         = 18;  // Uses ZigZag encoding.\n  };\n\n  enum Label {\n    // 0 is reserved for errors\n    LABEL_OPTIONAL      = 1;\n    LABEL_REQUIRED      = 2;\n    LABEL_REPEATED      = 3;\n  };\n\n  optional string name = 1;\n  optional int32 number = 3;\n  optional Label label = 4;\n\n  // If type_name is set, this need not be set.  If both this and type_name\n  // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.\n  optional Type type = 5;\n\n  // For message and enum types, this is the name of the type.  If the name\n  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping\n  // rules are used to find the type (i.e. first the nested types within this\n  // message are searched, then within the parent, on up to the root\n  // namespace).\n  optional string type_name = 6;\n\n  // For extensions, this is the name of the type being extended.  It is\n  // resolved in the same manner as type_name.\n  optional string extendee = 2;\n\n  // For numeric types, contains the original text representation of the value.\n  // For booleans, \"true\" or \"false\".\n  // For strings, contains the default text contents (not escaped in any way).\n  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.\n  // TODO(kenton):  Base-64 encode?\n  optional string default_value = 7;\n\n  // If set, gives the index of a oneof in the containing type's oneof_decl\n  // list.  This field is a member of that oneof.\n  optional int32 oneof_index = 9;\n\n  // JSON name of this field. The value is set by protocol compiler. If the\n  // user has set a \"json_name\" option on this field, that option's value\n  // will be used. Otherwise, it's deduced from the field's name by converting\n  // it to camelCase.\n  optional string json_name = 10;\n\n  optional FieldOptions options = 8;\n}\n\n// Describes a oneof.\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\n\n// Describes an enum type.\nmessage EnumDescriptorProto {\n  optional string name = 1;\n\n  repeated EnumValueDescriptorProto value = 2;\n\n  optional EnumOptions options = 3;\n\n  // Range of reserved numeric values. Reserved values may not be used by\n  // entries in the same enum. Reserved ranges may not overlap.\n  //\n  // Note that this is distinct from DescriptorProto.ReservedRange in that it\n  // is inclusive such that it can appropriately represent the entire int32\n  // domain.\n  message EnumReservedRange {\n    optional int32 start = 1; // Inclusive.\n    optional int32 end = 2;   // Inclusive.\n  }\n\n  // Range of reserved numeric values. Reserved numeric values may not be used\n  // by enum values in the same enum declaration. Reserved ranges may not\n  // overlap.\n  repeated EnumReservedRange reserved_range = 4;\n\n  // Reserved enum value names, which may not be reused. A given name may only\n  // be reserved once.\n  repeated string reserved_name = 5;\n}\n\n// Describes a value within an enum.\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n\n  optional EnumValueOptions options = 3;\n}\n\n// Describes a service.\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n\n  optional ServiceOptions options = 3;\n}\n\n// Describes a method of a service.\nmessage MethodDescriptorProto {\n  optional string name = 1;\n\n  // Input and output type names.  These are resolved in the same way as\n  // FieldDescriptorProto.type_name, but must refer to a message type.\n  optional string input_type = 2;\n  optional string output_type = 3;\n\n  optional MethodOptions options = 4;\n\n  // Identifies if client streams multiple client messages\n  optional bool client_streaming = 5 [default=false];\n  // Identifies if server streams multiple server messages\n  optional bool server_streaming = 6 [default=false];\n}\n\n\n// ===================================================================\n// Options\n\n// Each of the definitions above may have \"options\" attached.  These are\n// just annotations which may cause code to be generated slightly differently\n// or may contain hints for code that manipulates protocol messages.\n//\n// Clients may define custom options as extensions of the *Options messages.\n// These extensions may not yet be known at parsing time, so the parser cannot\n// store the values in them.  Instead it stores them in a field in the *Options\n// message called uninterpreted_option. This field must have the same name\n// across all *Options messages. We then use this field to populate the\n// extensions when we build a descriptor, at which point all protos have been\n// parsed and so all extensions are known.\n//\n// Extension numbers for custom options may be chosen as follows:\n// * For options which will only be used within a single application or\n//   organization, or for experimental options, use field numbers 50000\n//   through 99999.  It is up to you to ensure that you do not use the\n//   same number for multiple options.\n// * For options which will be published and used publicly by multiple\n//   independent entities, e-mail protobuf-global-extension-registry@google.com\n//   to reserve extension numbers. Simply provide your project name (e.g.\n//   Objective-C plugin) and your project website (if available) -- there's no\n//   need to explain how you intend to use them. Usually you only need one\n//   extension number. You can declare multiple options with only one extension\n//   number by putting them in a sub-message. See the Custom Options section of\n//   the docs for examples:\n//   https://developers.google.com/protocol-buffers/docs/proto#options\n//   If this turns out to be popular, a web service will be set up\n//   to automatically assign option numbers.\n\n\nmessage FileOptions {\n\n  // Sets the Java package where classes generated from this .proto will be\n  // placed.  By default, the proto package is used, but this is often\n  // inappropriate because proto packages do not normally start with backwards\n  // domain names.\n  optional string java_package = 1;\n\n\n  // If set, all the classes from the .proto file are wrapped in a single\n  // outer class with the given name.  This applies to both Proto1\n  // (equivalent to the old \"--one_java_file\" option) and Proto2 (where\n  // a .proto always translates to a single class, but you may want to\n  // explicitly choose the class name).\n  optional string java_outer_classname = 8;\n\n  // If set true, then the Java code generator will generate a separate .java\n  // file for each top-level message, enum, and service defined in the .proto\n  // file.  Thus, these types will *not* be nested inside the outer class\n  // named by java_outer_classname.  However, the outer class will still be\n  // generated to contain the file's getDescriptor() method as well as any\n  // top-level extensions defined in the file.\n  optional bool java_multiple_files = 10 [default=false];\n\n  // This option does nothing.\n  optional bool java_generate_equals_and_hash = 20 [deprecated=true];\n\n  // If set true, then the Java2 code generator will generate code that\n  // throws an exception whenever an attempt is made to assign a non-UTF-8\n  // byte sequence to a string field.\n  // Message reflection will do the same.\n  // However, an extension field still accepts non-UTF-8 byte sequences.\n  // This option has no effect on when used with the lite runtime.\n  optional bool java_string_check_utf8 = 27 [default=false];\n\n\n  // Generated classes can be optimized for speed or code size.\n  enum OptimizeMode {\n    SPEED = 1;        // Generate complete code for parsing, serialization,\n                      // etc.\n    CODE_SIZE = 2;    // Use ReflectionOps to implement these methods.\n    LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.\n  }\n  optional OptimizeMode optimize_for = 9 [default=SPEED];\n\n  // Sets the Go package where structs generated from this .proto will be\n  // placed. If omitted, the Go package will be derived from the following:\n  //   - The basename of the package import path, if provided.\n  //   - Otherwise, the package statement in the .proto file, if present.\n  //   - Otherwise, the basename of the .proto file, without extension.\n  optional string go_package = 11;\n\n\n\n  // Should generic services be generated in each language?  \"Generic\" services\n  // are not specific to any particular RPC system.  They are generated by the\n  // main code generators in each language (without additional plugins).\n  // Generic services were the only kind of service generation supported by\n  // early versions of google.protobuf.\n  //\n  // Generic services are now considered deprecated in favor of using plugins\n  // that generate code specific to your particular RPC system.  Therefore,\n  // these default to false.  Old code which depends on generic services should\n  // explicitly set them to true.\n  optional bool cc_generic_services = 16 [default=false];\n  optional bool java_generic_services = 17 [default=false];\n  optional bool py_generic_services = 18 [default=false];\n  optional bool php_generic_services = 42 [default=false];\n\n  // Is this file deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for everything in the file, or it will be completely ignored; in the very\n  // least, this is a formalization for deprecating files.\n  optional bool deprecated = 23 [default=false];\n\n  // Enables the use of arenas for the proto messages in this file. This applies\n  // only to generated classes for C++.\n  optional bool cc_enable_arenas = 31 [default=false];\n\n\n  // Sets the objective c class prefix which is prepended to all objective c\n  // generated classes from this .proto. There is no default.\n  optional string objc_class_prefix = 36;\n\n  // Namespace for generated classes; defaults to the package.\n  optional string csharp_namespace = 37;\n\n  // By default Swift generators will take the proto package and CamelCase it\n  // replacing '.' with underscore and use that to prefix the types/symbols\n  // defined. When this options is provided, they will use this value instead\n  // to prefix the types/symbols defined.\n  optional string swift_prefix = 39;\n\n  // Sets the php class prefix which is prepended to all php generated classes\n  // from this .proto. Default is empty.\n  optional string php_class_prefix = 40;\n\n  // Use this option to change the namespace of php generated classes. Default\n  // is empty. When this option is empty, the package name will be used for\n  // determining the namespace.\n  optional string php_namespace = 41;\n\n\n  // Use this option to change the namespace of php generated metadata classes.\n  // Default is empty. When this option is empty, the proto file name will be used\n  // for determining the namespace.\n  optional string php_metadata_namespace = 44;\n\n  // Use this option to change the package of ruby generated classes. Default\n  // is empty. When this option is not set, the package name will be used for\n  // determining the ruby package.\n  optional string ruby_package = 45;\n\n  // The parser stores options it doesn't recognize here.\n  // See the documentation for the \"Options\" section above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message.\n  // See the documentation for the \"Options\" section above.\n  extensions 1000 to max;\n\n  reserved 38;\n}\n\nmessage MessageOptions {\n  // Set true to use the old proto1 MessageSet wire format for extensions.\n  // This is provided for backwards-compatibility with the MessageSet wire\n  // format.  You should not use this for any other reason:  It's less\n  // efficient, has fewer features, and is more complicated.\n  //\n  // The message must be defined exactly as follows:\n  //   message Foo {\n  //     option message_set_wire_format = true;\n  //     extensions 4 to max;\n  //   }\n  // Note that the message cannot have any defined fields; MessageSets only\n  // have extensions.\n  //\n  // All extensions of your type must be singular messages; e.g. they cannot\n  // be int32s, enums, or repeated messages.\n  //\n  // Because this is an option, the above two restrictions are not enforced by\n  // the protocol compiler.\n  optional bool message_set_wire_format = 1 [default=false];\n\n  // Disables the generation of the standard \"descriptor()\" accessor, which can\n  // conflict with a field of the same name.  This is meant to make migration\n  // from proto1 easier; new code should avoid fields named \"descriptor\".\n  optional bool no_standard_descriptor_accessor = 2 [default=false];\n\n  // Is this message deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the message, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating messages.\n  optional bool deprecated = 3 [default=false];\n\n  // Whether the message is an automatically generated map entry type for the\n  // maps field.\n  //\n  // For maps fields:\n  //     map<KeyType, ValueType> map_field = 1;\n  // The parsed descriptor looks like:\n  //     message MapFieldEntry {\n  //         option map_entry = true;\n  //         optional KeyType key = 1;\n  //         optional ValueType value = 2;\n  //     }\n  //     repeated MapFieldEntry map_field = 1;\n  //\n  // Implementations may choose not to generate the map_entry=true message, but\n  // use a native map in the target language to hold the keys and values.\n  // The reflection APIs in such implementions still need to work as\n  // if the field is a repeated message field.\n  //\n  // NOTE: Do not set the option in .proto files. Always use the maps syntax\n  // instead. The option should only be implicitly set by the proto compiler\n  // parser.\n  optional bool map_entry = 7;\n\n  reserved 8;  // javalite_serializable\n  reserved 9;  // javanano_as_lite\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage FieldOptions {\n  // The ctype option instructs the C++ code generator to use a different\n  // representation of the field than it normally would.  See the specific\n  // options below.  This option is not yet implemented in the open source\n  // release -- sorry, we'll try to include it in a future version!\n  optional CType ctype = 1 [default = STRING];\n  enum CType {\n    // Default mode.\n    STRING = 0;\n\n    CORD = 1;\n\n    STRING_PIECE = 2;\n  }\n  // The packed option can be enabled for repeated primitive fields to enable\n  // a more efficient representation on the wire. Rather than repeatedly\n  // writing the tag and type for each element, the entire array is encoded as\n  // a single length-delimited blob. In proto3, only explicit setting it to\n  // false will avoid using packed encoding.\n  optional bool packed = 2;\n\n  // The jstype option determines the JavaScript type used for values of the\n  // field.  The option is permitted only for 64 bit integral and fixed types\n  // (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING\n  // is represented as JavaScript string, which avoids loss of precision that\n  // can happen when a large value is converted to a floating point JavaScript.\n  // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to\n  // use the JavaScript \"number\" type.  The behavior of the default option\n  // JS_NORMAL is implementation dependent.\n  //\n  // This option is an enum to permit additional types to be added, e.g.\n  // goog.math.Integer.\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  enum JSType {\n    // Use the default type.\n    JS_NORMAL = 0;\n\n    // Use JavaScript strings.\n    JS_STRING = 1;\n\n    // Use JavaScript numbers.\n    JS_NUMBER = 2;\n  }\n\n  // Should this field be parsed lazily?  Lazy applies only to message-type\n  // fields.  It means that when the outer message is initially parsed, the\n  // inner message's contents will not be parsed but instead stored in encoded\n  // form.  The inner message will actually be parsed when it is first accessed.\n  //\n  // This is only a hint.  Implementations are free to choose whether to use\n  // eager or lazy parsing regardless of the value of this option.  However,\n  // setting this option true suggests that the protocol author believes that\n  // using lazy parsing on this field is worth the additional bookkeeping\n  // overhead typically needed to implement it.\n  //\n  // This option does not affect the public interface of any generated code;\n  // all method signatures remain the same.  Furthermore, thread-safety of the\n  // interface is not affected by this option; const methods remain safe to\n  // call from multiple threads concurrently, while non-const methods continue\n  // to require exclusive access.\n  //\n  //\n  // Note that implementations may choose not to check required fields within\n  // a lazy sub-message.  That is, calling IsInitialized() on the outer message\n  // may return true even if the inner message has missing required fields.\n  // This is necessary because otherwise the inner message would have to be\n  // parsed in order to perform the check, defeating the purpose of lazy\n  // parsing.  An implementation which chooses not to check required fields\n  // must be consistent about it.  That is, for any particular sub-message, the\n  // implementation must either *always* check its required fields, or *never*\n  // check its required fields, regardless of whether or not the message has\n  // been parsed.\n  optional bool lazy = 5 [default=false];\n\n  // Is this field deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for accessors, or it will be completely ignored; in the very least, this\n  // is a formalization for deprecating fields.\n  optional bool deprecated = 3 [default=false];\n\n  // For Google-internal migration only. Do not use.\n  optional bool weak = 10 [default=false];\n\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n\n  reserved 4;  // removed jtype\n}\n\nmessage OneofOptions {\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage EnumOptions {\n\n  // Set this option to true to allow mapping different tag names to the same\n  // value.\n  optional bool allow_alias = 2;\n\n  // Is this enum deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the enum, or it will be completely ignored; in the very least, this\n  // is a formalization for deprecating enums.\n  optional bool deprecated = 3 [default=false];\n\n  reserved 5;  // javanano_as_lite\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage EnumValueOptions {\n  // Is this enum value deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the enum value, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating enum values.\n  optional bool deprecated = 1 [default=false];\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage ServiceOptions {\n\n  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\n  //   framework.  We apologize for hoarding these numbers to ourselves, but\n  //   we were already using them long before we decided to release Protocol\n  //   Buffers.\n\n  // Is this service deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the service, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating services.\n  optional bool deprecated = 33 [default=false];\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage MethodOptions {\n\n  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\n  //   framework.  We apologize for hoarding these numbers to ourselves, but\n  //   we were already using them long before we decided to release Protocol\n  //   Buffers.\n\n  // Is this method deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the method, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating methods.\n  optional bool deprecated = 33 [default=false];\n\n  // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,\n  // or neither? HTTP based RPC implementation may choose GET verb for safe\n  // methods, and PUT verb for idempotent methods instead of the default POST.\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS     = 1; // implies idempotent\n    IDEMPOTENT          = 2; // idempotent, but may have side effects\n  }\n  optional IdempotencyLevel idempotency_level =\n      34 [default=IDEMPOTENCY_UNKNOWN];\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\n\n// A message representing a option the parser does not recognize. This only\n// appears in options protos created by the compiler::Parser class.\n// DescriptorPool resolves these when building Descriptor objects. Therefore,\n// options protos in descriptor objects (e.g. returned by Descriptor::options(),\n// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\n// in them.\nmessage UninterpretedOption {\n  // The name of the uninterpreted option.  Each string represents a segment in\n  // a dot-separated name.  is_extension is true iff a segment represents an\n  // extension (denoted with parentheses in options specs in .proto files).\n  // E.g.,{ [\"foo\", false], [\"bar.baz\", true], [\"qux\", false] } represents\n  // \"foo.(bar.baz).qux\".\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n  repeated NamePart name = 2;\n\n  // The value of the uninterpreted option, in whatever type the tokenizer\n  // identified it as during parsing. Exactly one of these should be set.\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n}\n\n// ===================================================================\n// Optional source code info\n\n// Encapsulates information about the original source file from which a\n// FileDescriptorProto was generated.\nmessage SourceCodeInfo {\n  // A Location identifies a piece of source code in a .proto file which\n  // corresponds to a particular definition.  This information is intended\n  // to be useful to IDEs, code indexers, documentation generators, and similar\n  // tools.\n  //\n  // For example, say we have a file like:\n  //   message Foo {\n  //     optional string foo = 1;\n  //   }\n  // Let's look at just the field definition:\n  //   optional string foo = 1;\n  //   ^       ^^     ^^  ^  ^^^\n  //   a       bc     de  f  ghi\n  // We have the following locations:\n  //   span   path               represents\n  //   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.\n  //   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).\n  //   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).\n  //   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).\n  //   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).\n  //\n  // Notes:\n  // - A location may refer to a repeated field itself (i.e. not to any\n  //   particular index within it).  This is used whenever a set of elements are\n  //   logically enclosed in a single code segment.  For example, an entire\n  //   extend block (possibly containing multiple extension definitions) will\n  //   have an outer location whose path refers to the \"extensions\" repeated\n  //   field without an index.\n  // - Multiple locations may have the same path.  This happens when a single\n  //   logical declaration is spread out across multiple places.  The most\n  //   obvious example is the \"extend\" block again -- there may be multiple\n  //   extend blocks in the same scope, each of which will have the same path.\n  // - A location's span is not always a subset of its parent's span.  For\n  //   example, the \"extendee\" of an extension declaration appears at the\n  //   beginning of the \"extend\" block and is shared by all extensions within\n  //   the block.\n  // - Just because a location's span is a subset of some other location's span\n  //   does not mean that it is a descendent.  For example, a \"group\" defines\n  //   both a type and a field in a single declaration.  Thus, the locations\n  //   corresponding to the type and field and their components will overlap.\n  // - Code which tries to interpret locations should probably be designed to\n  //   ignore those that it doesn't understand, as more types of locations could\n  //   be recorded in the future.\n  repeated Location location = 1;\n  message Location {\n    // Identifies which part of the FileDescriptorProto was defined at this\n    // location.\n    //\n    // Each element is a field number or an index.  They form a path from\n    // the root FileDescriptorProto to the place where the definition.  For\n    // example, this path:\n    //   [ 4, 3, 2, 7, 1 ]\n    // refers to:\n    //   file.message_type(3)  // 4, 3\n    //       .field(7)         // 2, 7\n    //       .name()           // 1\n    // This is because FileDescriptorProto.message_type has field number 4:\n    //   repeated DescriptorProto message_type = 4;\n    // and DescriptorProto.field has field number 2:\n    //   repeated FieldDescriptorProto field = 2;\n    // and FieldDescriptorProto.name has field number 1:\n    //   optional string name = 1;\n    //\n    // Thus, the above path gives the location of a field name.  If we removed\n    // the last element:\n    //   [ 4, 3, 2, 7 ]\n    // this path refers to the whole field declaration (from the beginning\n    // of the label to the terminating semicolon).\n    repeated int32 path = 1 [packed=true];\n\n    // Always has exactly three or four elements: start line, start column,\n    // end line (optional, otherwise assumed same as start line), end column.\n    // These are packed into a single field for efficiency.  Note that line\n    // and column numbers are zero-based -- typically you will want to add\n    // 1 to each before displaying to a user.\n    repeated int32 span = 2 [packed=true];\n\n    // If this SourceCodeInfo represents a complete declaration, these are any\n    // comments appearing before and after the declaration which appear to be\n    // attached to the declaration.\n    //\n    // A series of line comments appearing on consecutive lines, with no other\n    // tokens appearing on those lines, will be treated as a single comment.\n    //\n    // leading_detached_comments will keep paragraphs of comments that appear\n    // before (but not connected to) the current element. Each paragraph,\n    // separated by empty lines, will be one comment element in the repeated\n    // field.\n    //\n    // Only the comment content is provided; comment markers (e.g. //) are\n    // stripped out.  For block comments, leading whitespace and an asterisk\n    // will be stripped from the beginning of each line other than the first.\n    // Newlines are included in the output.\n    //\n    // Examples:\n    //\n    //   optional int32 foo = 1;  // Comment attached to foo.\n    //   // Comment attached to bar.\n    //   optional int32 bar = 2;\n    //\n    //   optional string baz = 3;\n    //   // Comment attached to baz.\n    //   // Another line attached to baz.\n    //\n    //   // Comment attached to qux.\n    //   //\n    //   // Another line attached to qux.\n    //   optional double qux = 4;\n    //\n    //   // Detached comment for corge. This is not leading or trailing comments\n    //   // to qux or corge because there are blank lines separating it from\n    //   // both.\n    //\n    //   // Detached comment for corge paragraph 2.\n    //\n    //   optional string corge = 5;\n    //   /* Block comment attached\n    //    * to corge.  Leading asterisks\n    //    * will be removed. */\n    //   /* Block comment attached to\n    //    * grault. */\n    //   optional int32 grault = 6;\n    //\n    //   // ignored detached comments.\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n}\n\n// Describes the relationship between generated code and its original source\n// file. A GeneratedCodeInfo message is associated with only one generated\n// source file, but may contain references to different source .proto files.\nmessage GeneratedCodeInfo {\n  // An Annotation connects some span of text in generated code to an element\n  // of its generating .proto file.\n  repeated Annotation annotation = 1;\n  message Annotation {\n    // Identifies the element in the original source .proto file. This field\n    // is formatted the same as SourceCodeInfo.Location.path.\n    repeated int32 path = 1 [packed=true];\n\n    // Identifies the filesystem path to the original source .proto.\n    optional string source_file = 2;\n\n    // Identifies the starting offset in bytes in the generated code\n    // that relates to the identified object.\n    optional int32 begin = 3;\n\n    // Identifies the ending offset in bytes in the generated code that\n    // relates to the identified offset. The end offset should be one past\n    // the last relevant byte (so the length of the text = end - begin).\n    optional int32 end = 4;\n  }\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/descriptor_database.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Interface for manipulating databases of descriptors.\n\n#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_DATABASE_H__\n#define GOOGLE_PROTOBUF_DESCRIPTOR_DATABASE_H__\n\n#include <map>\n#include <string>\n#include <utility>\n#include <vector>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/descriptor.h>\n\nnamespace google {\nnamespace protobuf {\n\n// Defined in this file.\nclass DescriptorDatabase;\nclass SimpleDescriptorDatabase;\nclass EncodedDescriptorDatabase;\nclass DescriptorPoolDatabase;\nclass MergedDescriptorDatabase;\n\n// Abstract interface for a database of descriptors.\n//\n// This is useful if you want to create a DescriptorPool which loads\n// descriptors on-demand from some sort of large database.  If the database\n// is large, it may be inefficient to enumerate every .proto file inside it\n// calling DescriptorPool::BuildFile() for each one.  Instead, a DescriptorPool\n// can be created which wraps a DescriptorDatabase and only builds particular\n// descriptors when they are needed.\nclass LIBPROTOBUF_EXPORT DescriptorDatabase {\n public:\n  inline DescriptorDatabase() {}\n  virtual ~DescriptorDatabase();\n\n  // Find a file by file name.  Fills in in *output and returns true if found.\n  // Otherwise, returns false, leaving the contents of *output undefined.\n  virtual bool FindFileByName(const string& filename,\n                              FileDescriptorProto* output) = 0;\n\n  // Find the file that declares the given fully-qualified symbol name.\n  // If found, fills in *output and returns true, otherwise returns false\n  // and leaves *output undefined.\n  virtual bool FindFileContainingSymbol(const string& symbol_name,\n                                        FileDescriptorProto* output) = 0;\n\n  // Find the file which defines an extension extending the given message type\n  // with the given field number.  If found, fills in *output and returns true,\n  // otherwise returns false and leaves *output undefined.  containing_type\n  // must be a fully-qualified type name.\n  virtual bool FindFileContainingExtension(const string& containing_type,\n                                           int field_number,\n                                           FileDescriptorProto* output) = 0;\n\n  // Finds the tag numbers used by all known extensions of\n  // extendee_type, and appends them to output in an undefined\n  // order. This method is best-effort: it's not guaranteed that the\n  // database will find all extensions, and it's not guaranteed that\n  // FindFileContainingExtension will return true on all of the found\n  // numbers. Returns true if the search was successful, otherwise\n  // returns false and leaves output unchanged.\n  //\n  // This method has a default implementation that always returns\n  // false.\n  virtual bool FindAllExtensionNumbers(const string& /* extendee_type */,\n                                       std::vector<int>* /* output */) {\n    return false;\n  }\n\n\n  // Finds the file names and appends them to the output in an\n  // undefined order. This method is best-effort: it's not guaranteed that the\n  // database will find all files. Returns true if the database supports\n  // searching all file names, otherwise returns false and leaves output\n  // unchanged.\n  //\n  // This method has a default implementation that always returns\n  // false.\n  virtual bool FindAllFileNames(std::vector<string>* output) {\n    return false;\n  }\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DescriptorDatabase);\n};\n\n// A DescriptorDatabase into which you can insert files manually.\n//\n// FindFileContainingSymbol() is fully-implemented.  When you add a file, its\n// symbols will be indexed for this purpose.  Note that the implementation\n// may return false positives, but only if it isn't possible for the symbol\n// to be defined in any other file.  In particular, if a file defines a symbol\n// \"Foo\", then searching for \"Foo.[anything]\" will match that file.  This way,\n// the database does not need to aggressively index all children of a symbol.\n//\n// FindFileContainingExtension() is mostly-implemented.  It works if and only\n// if the original FieldDescriptorProto defining the extension has a\n// fully-qualified type name in its \"extendee\" field (i.e. starts with a '.').\n// If the extendee is a relative name, SimpleDescriptorDatabase will not\n// attempt to resolve the type, so it will not know what type the extension is\n// extending.  Therefore, calling FindFileContainingExtension() with the\n// extension's containing type will never actually find that extension.  Note\n// that this is an unlikely problem, as all FileDescriptorProtos created by the\n// protocol compiler (as well as ones created by calling\n// FileDescriptor::CopyTo()) will always use fully-qualified names for all\n// types.  You only need to worry if you are constructing FileDescriptorProtos\n// yourself, or are calling compiler::Parser directly.\nclass LIBPROTOBUF_EXPORT SimpleDescriptorDatabase : public DescriptorDatabase {\n public:\n  SimpleDescriptorDatabase();\n  ~SimpleDescriptorDatabase();\n\n  // Adds the FileDescriptorProto to the database, making a copy.  The object\n  // can be deleted after Add() returns.  Returns false if the file conflicted\n  // with a file already in the database, in which case an error will have\n  // been written to GOOGLE_LOG(ERROR).\n  bool Add(const FileDescriptorProto& file);\n\n  // Adds the FileDescriptorProto to the database and takes ownership of it.\n  bool AddAndOwn(const FileDescriptorProto* file);\n\n  // implements DescriptorDatabase -----------------------------------\n  bool FindFileByName(const string& filename,\n                      FileDescriptorProto* output);\n  bool FindFileContainingSymbol(const string& symbol_name,\n                                FileDescriptorProto* output);\n  bool FindFileContainingExtension(const string& containing_type,\n                                   int field_number,\n                                   FileDescriptorProto* output);\n  bool FindAllExtensionNumbers(const string& extendee_type,\n                               std::vector<int>* output);\n\n private:\n  // So that it can use DescriptorIndex.\n  friend class EncodedDescriptorDatabase;\n\n  // An index mapping file names, symbol names, and extension numbers to\n  // some sort of values.\n  template <typename Value>\n  class DescriptorIndex {\n   public:\n    // Helpers to recursively add particular descriptors and all their contents\n    // to the index.\n    bool AddFile(const FileDescriptorProto& file,\n                 Value value);\n    bool AddSymbol(const string& name, Value value);\n    bool AddNestedExtensions(const DescriptorProto& message_type,\n                             Value value);\n    bool AddExtension(const FieldDescriptorProto& field,\n                      Value value);\n\n    Value FindFile(const string& filename);\n    Value FindSymbol(const string& name);\n    Value FindExtension(const string& containing_type, int field_number);\n    bool FindAllExtensionNumbers(const string& containing_type,\n                                 std::vector<int>* output);\n\n   private:\n    std::map<string, Value> by_name_;\n    std::map<string, Value> by_symbol_;\n    std::map<std::pair<string, int>, Value> by_extension_;\n\n    // Invariant:  The by_symbol_ map does not contain any symbols which are\n    // prefixes of other symbols in the map.  For example, \"foo.bar\" is a\n    // prefix of \"foo.bar.baz\" (but is not a prefix of \"foo.barbaz\").\n    //\n    // This invariant is important because it means that given a symbol name,\n    // we can find a key in the map which is a prefix of the symbol in O(lg n)\n    // time, and we know that there is at most one such key.\n    //\n    // The prefix lookup algorithm works like so:\n    // 1) Find the last key in the map which is less than or equal to the\n    //    search key.\n    // 2) If the found key is a prefix of the search key, then return it.\n    //    Otherwise, there is no match.\n    //\n    // I am sure this algorithm has been described elsewhere, but since I\n    // wasn't able to find it quickly I will instead prove that it works\n    // myself.  The key to the algorithm is that if a match exists, step (1)\n    // will find it.  Proof:\n    // 1) Define the \"search key\" to be the key we are looking for, the \"found\n    //    key\" to be the key found in step (1), and the \"match key\" to be the\n    //    key which actually matches the search key (i.e. the key we're trying\n    //    to find).\n    // 2) The found key must be less than or equal to the search key by\n    //    definition.\n    // 3) The match key must also be less than or equal to the search key\n    //    (because it is a prefix).\n    // 4) The match key cannot be greater than the found key, because if it\n    //    were, then step (1) of the algorithm would have returned the match\n    //    key instead (since it finds the *greatest* key which is less than or\n    //    equal to the search key).\n    // 5) Therefore, the found key must be between the match key and the search\n    //    key, inclusive.\n    // 6) Since the search key must be a sub-symbol of the match key, if it is\n    //    not equal to the match key, then search_key[match_key.size()] must\n    //    be '.'.\n    // 7) Since '.' sorts before any other character that is valid in a symbol\n    //    name, then if the found key is not equal to the match key, then\n    //    found_key[match_key.size()] must also be '.', because any other value\n    //    would make it sort after the search key.\n    // 8) Therefore, if the found key is not equal to the match key, then the\n    //    found key must be a sub-symbol of the match key.  However, this would\n    //    contradict our map invariant which says that no symbol in the map is\n    //    a sub-symbol of any other.\n    // 9) Therefore, the found key must match the match key.\n    //\n    // The above proof assumes the match key exists.  In the case that the\n    // match key does not exist, then step (1) will return some other symbol.\n    // That symbol cannot be a super-symbol of the search key since if it were,\n    // then it would be a match, and we're assuming the match key doesn't exist.\n    // Therefore, step 2 will correctly return no match.\n\n    // Find the last entry in the by_symbol_ map whose key is less than or\n    // equal to the given name.\n    typename std::map<string, Value>::iterator FindLastLessOrEqual(\n        const string& name);\n\n    // True if either the arguments are equal or super_symbol identifies a\n    // parent symbol of sub_symbol (e.g. \"foo.bar\" is a parent of\n    // \"foo.bar.baz\", but not a parent of \"foo.barbaz\").\n    bool IsSubSymbol(const string& sub_symbol, const string& super_symbol);\n\n    // Returns true if and only if all characters in the name are alphanumerics,\n    // underscores, or periods.\n    bool ValidateSymbolName(const string& name);\n  };\n\n\n  DescriptorIndex<const FileDescriptorProto*> index_;\n  std::vector<const FileDescriptorProto*> files_to_delete_;\n\n  // If file is non-NULL, copy it into *output and return true, otherwise\n  // return false.\n  bool MaybeCopy(const FileDescriptorProto* file,\n                 FileDescriptorProto* output);\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(SimpleDescriptorDatabase);\n};\n\n// Very similar to SimpleDescriptorDatabase, but stores all the descriptors\n// as raw bytes and generally tries to use as little memory as possible.\n//\n// The same caveats regarding FindFileContainingExtension() apply as with\n// SimpleDescriptorDatabase.\nclass LIBPROTOBUF_EXPORT EncodedDescriptorDatabase : public DescriptorDatabase {\n public:\n  EncodedDescriptorDatabase();\n  ~EncodedDescriptorDatabase();\n\n  // Adds the FileDescriptorProto to the database.  The descriptor is provided\n  // in encoded form.  The database does not make a copy of the bytes, nor\n  // does it take ownership; it's up to the caller to make sure the bytes\n  // remain valid for the life of the database.  Returns false and logs an error\n  // if the bytes are not a valid FileDescriptorProto or if the file conflicted\n  // with a file already in the database.\n  bool Add(const void* encoded_file_descriptor, int size);\n\n  // Like Add(), but makes a copy of the data, so that the caller does not\n  // need to keep it around.\n  bool AddCopy(const void* encoded_file_descriptor, int size);\n\n  // Like FindFileContainingSymbol but returns only the name of the file.\n  bool FindNameOfFileContainingSymbol(const string& symbol_name,\n                                      string* output);\n\n  // implements DescriptorDatabase -----------------------------------\n  bool FindFileByName(const string& filename,\n                      FileDescriptorProto* output);\n  bool FindFileContainingSymbol(const string& symbol_name,\n                                FileDescriptorProto* output);\n  bool FindFileContainingExtension(const string& containing_type,\n                                   int field_number,\n                                   FileDescriptorProto* output);\n  bool FindAllExtensionNumbers(const string& extendee_type,\n                               std::vector<int>* output);\n\n private:\n  SimpleDescriptorDatabase::DescriptorIndex<std::pair<const void*, int> >\n      index_;\n  std::vector<void*> files_to_delete_;\n\n  // If encoded_file.first is non-NULL, parse the data into *output and return\n  // true, otherwise return false.\n  bool MaybeParse(std::pair<const void*, int> encoded_file,\n                  FileDescriptorProto* output);\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EncodedDescriptorDatabase);\n};\n\n// A DescriptorDatabase that fetches files from a given pool.\nclass LIBPROTOBUF_EXPORT DescriptorPoolDatabase : public DescriptorDatabase {\n public:\n  explicit DescriptorPoolDatabase(const DescriptorPool& pool);\n  ~DescriptorPoolDatabase();\n\n  // implements DescriptorDatabase -----------------------------------\n  bool FindFileByName(const string& filename,\n                      FileDescriptorProto* output);\n  bool FindFileContainingSymbol(const string& symbol_name,\n                                FileDescriptorProto* output);\n  bool FindFileContainingExtension(const string& containing_type,\n                                   int field_number,\n                                   FileDescriptorProto* output);\n  bool FindAllExtensionNumbers(const string& extendee_type,\n                               std::vector<int>* output);\n\n private:\n  const DescriptorPool& pool_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DescriptorPoolDatabase);\n};\n\n// A DescriptorDatabase that wraps two or more others.  It first searches the\n// first database and, if that fails, tries the second, and so on.\nclass LIBPROTOBUF_EXPORT MergedDescriptorDatabase : public DescriptorDatabase {\n public:\n  // Merge just two databases.  The sources remain property of the caller.\n  MergedDescriptorDatabase(DescriptorDatabase* source1,\n                           DescriptorDatabase* source2);\n  // Merge more than two databases.  The sources remain property of the caller.\n  // The vector may be deleted after the constructor returns but the\n  // DescriptorDatabases need to stick around.\n  explicit MergedDescriptorDatabase(\n      const std::vector<DescriptorDatabase*>& sources);\n  ~MergedDescriptorDatabase();\n\n  // implements DescriptorDatabase -----------------------------------\n  bool FindFileByName(const string& filename,\n                      FileDescriptorProto* output);\n  bool FindFileContainingSymbol(const string& symbol_name,\n                                FileDescriptorProto* output);\n  bool FindFileContainingExtension(const string& containing_type,\n                                   int field_number,\n                                   FileDescriptorProto* output);\n  // Merges the results of calling all databases. Returns true iff any\n  // of the databases returned true.\n  bool FindAllExtensionNumbers(const string& extendee_type,\n                               std::vector<int>* output);\n\n\n private:\n  std::vector<DescriptorDatabase*> sources_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MergedDescriptorDatabase);\n};\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_DESCRIPTOR_DATABASE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/duration.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/duration.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fduration_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2fduration_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fduration_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2fduration_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[1];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2fduration_2eproto\nnamespace google {\nnamespace protobuf {\nclass Duration;\nclass DurationDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern DurationDefaultTypeInternal _Duration_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Duration* Arena::CreateMaybeMessage<::google::protobuf::Duration>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT Duration : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Duration) */ {\n public:\n  Duration();\n  virtual ~Duration();\n\n  Duration(const Duration& from);\n\n  inline Duration& operator=(const Duration& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Duration(Duration&& from) noexcept\n    : Duration() {\n    *this = ::std::move(from);\n  }\n\n  inline Duration& operator=(Duration&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Duration& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Duration* internal_default_instance() {\n    return reinterpret_cast<const Duration*>(\n               &_Duration_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void UnsafeArenaSwap(Duration* other);\n  void Swap(Duration* other);\n  friend void swap(Duration& a, Duration& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Duration* New() const final {\n    return CreateMaybeMessage<Duration>(NULL);\n  }\n\n  Duration* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Duration>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Duration& from);\n  void MergeFrom(const Duration& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Duration* other);\n  protected:\n  explicit Duration(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // int64 seconds = 1;\n  void clear_seconds();\n  static const int kSecondsFieldNumber = 1;\n  ::google::protobuf::int64 seconds() const;\n  void set_seconds(::google::protobuf::int64 value);\n\n  // int32 nanos = 2;\n  void clear_nanos();\n  static const int kNanosFieldNumber = 2;\n  ::google::protobuf::int32 nanos() const;\n  void set_nanos(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Duration)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::int64 seconds_;\n  ::google::protobuf::int32 nanos_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fduration_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// Duration\n\n// int64 seconds = 1;\ninline void Duration::clear_seconds() {\n  seconds_ = GOOGLE_LONGLONG(0);\n}\ninline ::google::protobuf::int64 Duration::seconds() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Duration.seconds)\n  return seconds_;\n}\ninline void Duration::set_seconds(::google::protobuf::int64 value) {\n  \n  seconds_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Duration.seconds)\n}\n\n// int32 nanos = 2;\ninline void Duration::clear_nanos() {\n  nanos_ = 0;\n}\ninline ::google::protobuf::int32 Duration::nanos() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Duration.nanos)\n  return nanos_;\n}\ninline void Duration::set_nanos(::google::protobuf::int32 value) {\n  \n  nanos_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Duration.nanos)\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2fduration_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/duration.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption go_package = \"github.com/golang/protobuf/ptypes/duration\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"DurationProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n// A Duration represents a signed, fixed-length span of time represented\n// as a count of seconds and fractions of seconds at nanosecond\n// resolution. It is independent of any calendar and concepts like \"day\"\n// or \"month\". It is related to Timestamp in that the difference between\n// two Timestamp values is a Duration and it can be added or subtracted\n// from a Timestamp. Range is approximately +-10,000 years.\n//\n// # Examples\n//\n// Example 1: Compute Duration from two Timestamps in pseudo code.\n//\n//     Timestamp start = ...;\n//     Timestamp end = ...;\n//     Duration duration = ...;\n//\n//     duration.seconds = end.seconds - start.seconds;\n//     duration.nanos = end.nanos - start.nanos;\n//\n//     if (duration.seconds < 0 && duration.nanos > 0) {\n//       duration.seconds += 1;\n//       duration.nanos -= 1000000000;\n//     } else if (durations.seconds > 0 && duration.nanos < 0) {\n//       duration.seconds -= 1;\n//       duration.nanos += 1000000000;\n//     }\n//\n// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.\n//\n//     Timestamp start = ...;\n//     Duration duration = ...;\n//     Timestamp end = ...;\n//\n//     end.seconds = start.seconds + duration.seconds;\n//     end.nanos = start.nanos + duration.nanos;\n//\n//     if (end.nanos < 0) {\n//       end.seconds -= 1;\n//       end.nanos += 1000000000;\n//     } else if (end.nanos >= 1000000000) {\n//       end.seconds += 1;\n//       end.nanos -= 1000000000;\n//     }\n//\n// Example 3: Compute Duration from datetime.timedelta in Python.\n//\n//     td = datetime.timedelta(days=3, minutes=10)\n//     duration = Duration()\n//     duration.FromTimedelta(td)\n//\n// # JSON Mapping\n//\n// In JSON format, the Duration type is encoded as a string rather than an\n// object, where the string ends in the suffix \"s\" (indicating seconds) and\n// is preceded by the number of seconds, with nanoseconds expressed as\n// fractional seconds. For example, 3 seconds with 0 nanoseconds should be\n// encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should\n// be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1\n// microsecond should be expressed in JSON format as \"3.000001s\".\n//\n//\nmessage Duration {\n\n  // Signed seconds of the span of time. Must be from -315,576,000,000\n  // to +315,576,000,000 inclusive. Note: these bounds are computed from:\n  // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years\n  int64 seconds = 1;\n\n  // Signed fractions of a second at nanosecond resolution of the span\n  // of time. Durations less than one second are represented with a 0\n  // `seconds` field and a positive or negative `nanos` field. For durations\n  // of one second or more, a non-zero value for the `nanos` field must be\n  // of the same sign as the `seconds` field. Must be from -999,999,999\n  // to +999,999,999 inclusive.\n  int32 nanos = 2;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/dynamic_message.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Defines an implementation of Message which can emulate types which are not\n// known at compile-time.\n\n#ifndef GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__\n#define GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__\n\n#include <algorithm>\n#include <memory>\n#include <vector>\n\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/mutex.h>\n\nnamespace google {\nnamespace protobuf {\n\n// Defined in other files.\nclass Descriptor;        // descriptor.h\nclass DescriptorPool;    // descriptor.h\n\n// Constructs implementations of Message which can emulate types which are not\n// known at compile-time.\n//\n// Sometimes you want to be able to manipulate protocol types that you don't\n// know about at compile time.  It would be nice to be able to construct\n// a Message object which implements the message type given by any arbitrary\n// Descriptor.  DynamicMessage provides this.\n//\n// As it turns out, a DynamicMessage needs to construct extra\n// information about its type in order to operate.  Most of this information\n// can be shared between all DynamicMessages of the same type.  But, caching\n// this information in some sort of global map would be a bad idea, since\n// the cached information for a particular descriptor could outlive the\n// descriptor itself.  To avoid this problem, DynamicMessageFactory\n// encapsulates this \"cache\".  All DynamicMessages of the same type created\n// from the same factory will share the same support data.  Any Descriptors\n// used with a particular factory must outlive the factory.\nclass LIBPROTOBUF_EXPORT DynamicMessageFactory : public MessageFactory {\n public:\n  // Construct a DynamicMessageFactory that will search for extensions in\n  // the DescriptorPool in which the extendee is defined.\n  DynamicMessageFactory();\n\n  // Construct a DynamicMessageFactory that will search for extensions in\n  // the given DescriptorPool.\n  //\n  // DEPRECATED:  Use CodedInputStream::SetExtensionRegistry() to tell the\n  //   parser to look for extensions in an alternate pool.  However, note that\n  //   this is almost never what you want to do.  Almost all users should use\n  //   the zero-arg constructor.\n  DynamicMessageFactory(const DescriptorPool* pool);\n\n  ~DynamicMessageFactory();\n\n  // Call this to tell the DynamicMessageFactory that if it is given a\n  // Descriptor d for which:\n  //   d->file()->pool() == DescriptorPool::generated_pool(),\n  // then it should delegate to MessageFactory::generated_factory() instead\n  // of constructing a dynamic implementation of the message.  In theory there\n  // is no down side to doing this, so it may become the default in the future.\n  void SetDelegateToGeneratedFactory(bool enable) {\n    delegate_to_generated_factory_ = enable;\n  }\n\n  // implements MessageFactory ---------------------------------------\n\n  // Given a Descriptor, constructs the default (prototype) Message of that\n  // type.  You can then call that message's New() method to construct a\n  // mutable message of that type.\n  //\n  // Calling this method twice with the same Descriptor returns the same\n  // object.  The returned object remains property of the factory and will\n  // be destroyed when the factory is destroyed.  Also, any objects created\n  // by calling the prototype's New() method share some data with the\n  // prototype, so these must be destroyed before the DynamicMessageFactory\n  // is destroyed.\n  //\n  // The given descriptor must outlive the returned message, and hence must\n  // outlive the DynamicMessageFactory.\n  //\n  // The method is thread-safe.\n  const Message* GetPrototype(const Descriptor* type);\n\n private:\n  const DescriptorPool* pool_;\n  bool delegate_to_generated_factory_;\n\n  // This struct just contains a hash_map.  We can't #include <google/protobuf/stubs/hash.h> from\n  // this header due to hacks needed for hash_map portability in the open source\n  // release.  Namely, stubs/hash.h, which defines hash_map portably, is not a\n  // public header (for good reason), but dynamic_message.h is, and public\n  // headers may only #include other public headers.\n  struct PrototypeMap;\n  std::unique_ptr<PrototypeMap> prototypes_;\n  mutable Mutex prototypes_mutex_;\n\n  friend class DynamicMessage;\n  const Message* GetPrototypeNoLock(const Descriptor* type);\n\n  // Construct default oneof instance for reflection usage if oneof\n  // is defined.\n  static void ConstructDefaultOneofInstance(const Descriptor* type,\n                                            const uint32 offsets[],\n                                            void* default_oneof_instance);\n  // Delete default oneof instance. Called by ~DynamicMessageFactory.\n  static void DeleteDefaultOneofInstance(const Descriptor* type,\n                                         const uint32 offsets[],\n                                         const void* default_oneof_instance);\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DynamicMessageFactory);\n};\n\n// Helper for computing a sorted list of map entries via reflection.\nclass LIBPROTOBUF_EXPORT DynamicMapSorter {\n public:\n  static std::vector<const Message*> Sort(const Message& message,\n                                          int map_size,\n                                          const Reflection* reflection,\n                                          const FieldDescriptor* field) {\n    std::vector<const Message*> result(static_cast<size_t>(map_size));\n    const RepeatedPtrField<Message>& map_field =\n        reflection->GetRepeatedPtrField<Message>(message, field);\n    size_t i = 0;\n    for (RepeatedPtrField<Message>::const_pointer_iterator it =\n             map_field.pointer_begin(); it != map_field.pointer_end(); ) {\n      result[i++] = *it++;\n    }\n    GOOGLE_DCHECK_EQ(result.size(), i);\n    MapEntryMessageComparator comparator(field->message_type());\n    std::stable_sort(result.begin(), result.end(), comparator);\n    // Complain if the keys aren't in ascending order.\n#ifndef NDEBUG\n    for (size_t j = 1; j < static_cast<size_t>(map_size); j++) {\n      if (!comparator(result[j - 1], result[j])) {\n        GOOGLE_LOG(ERROR) << (comparator(result[j], result[j - 1]) ?\n                      \"internal error in map key sorting\" :\n                      \"map keys are not unique\");\n      }\n    }\n#endif\n    return result;\n  }\n\n private:\n  class LIBPROTOBUF_EXPORT MapEntryMessageComparator {\n   public:\n    explicit MapEntryMessageComparator(const Descriptor* descriptor)\n        : field_(descriptor->field(0)) {}\n\n    bool operator()(const Message* a, const Message* b) {\n      const Reflection* reflection = a->GetReflection();\n      switch (field_->cpp_type()) {\n        case FieldDescriptor::CPPTYPE_BOOL: {\n          bool first = reflection->GetBool(*a, field_);\n          bool second = reflection->GetBool(*b, field_);\n          return first < second;\n        }\n        case FieldDescriptor::CPPTYPE_INT32: {\n          int32 first = reflection->GetInt32(*a, field_);\n          int32 second = reflection->GetInt32(*b, field_);\n          return first < second;\n        }\n        case FieldDescriptor::CPPTYPE_INT64: {\n          int64 first = reflection->GetInt64(*a, field_);\n          int64 second = reflection->GetInt64(*b, field_);\n          return first < second;\n        }\n        case FieldDescriptor::CPPTYPE_UINT32: {\n          uint32 first = reflection->GetUInt32(*a, field_);\n          uint32 second = reflection->GetUInt32(*b, field_);\n          return first < second;\n        }\n        case FieldDescriptor::CPPTYPE_UINT64: {\n          uint64 first = reflection->GetUInt64(*a, field_);\n          uint64 second = reflection->GetUInt64(*b, field_);\n          return first < second;\n        }\n        case FieldDescriptor::CPPTYPE_STRING: {\n          string first = reflection->GetString(*a, field_);\n          string second = reflection->GetString(*b, field_);\n          return first < second;\n        }\n        default:\n          GOOGLE_LOG(DFATAL) << \"Invalid key for map field.\";\n          return true;\n      }\n    }\n\n   private:\n    const FieldDescriptor* field_;\n  };\n};\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/empty.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/empty.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fempty_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2fempty_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fempty_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2fempty_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[1];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2fempty_2eproto\nnamespace google {\nnamespace protobuf {\nclass Empty;\nclass EmptyDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern EmptyDefaultTypeInternal _Empty_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Empty* Arena::CreateMaybeMessage<::google::protobuf::Empty>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ {\n public:\n  Empty();\n  virtual ~Empty();\n\n  Empty(const Empty& from);\n\n  inline Empty& operator=(const Empty& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Empty(Empty&& from) noexcept\n    : Empty() {\n    *this = ::std::move(from);\n  }\n\n  inline Empty& operator=(Empty&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Empty& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Empty* internal_default_instance() {\n    return reinterpret_cast<const Empty*>(\n               &_Empty_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void UnsafeArenaSwap(Empty* other);\n  void Swap(Empty* other);\n  friend void swap(Empty& a, Empty& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Empty* New() const final {\n    return CreateMaybeMessage<Empty>(NULL);\n  }\n\n  Empty* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Empty>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Empty& from);\n  void MergeFrom(const Empty& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Empty* other);\n  protected:\n  explicit Empty(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Empty)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fempty_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// Empty\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2fempty_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/empty.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"github.com/golang/protobuf/ptypes/empty\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"EmptyProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption cc_enable_arenas = true;\n\n// A generic empty message that you can re-use to avoid defining duplicated\n// empty messages in your APIs. A typical example is to use it as the request\n// or the response type of an API method. For instance:\n//\n//     service Foo {\n//       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n//     }\n//\n// The JSON representation for `Empty` is empty JSON object `{}`.\nmessage Empty {}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/extension_set.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This header is logically internal, but is made public because it is used\n// from protocol-compiler-generated code, which may reside in other components.\n\n#ifndef GOOGLE_PROTOBUF_EXTENSION_SET_H__\n#define GOOGLE_PROTOBUF_EXTENSION_SET_H__\n\n#include <algorithm>\n#include <cassert>\n#include <map>\n#include <string>\n#include <utility>\n#include <vector>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/logging.h>\n#include <google/protobuf/stubs/once.h>\n#include <google/protobuf/repeated_field.h>\n\nnamespace google {\n\nnamespace protobuf {\n  class Arena;\n  class Descriptor;                                    // descriptor.h\n  class FieldDescriptor;                               // descriptor.h\n  class DescriptorPool;                                // descriptor.h\n  class MessageLite;                                   // message_lite.h\n  class Message;                                       // message.h\n  class MessageFactory;                                // message.h\n  class UnknownFieldSet;                               // unknown_field_set.h\n  namespace io {\n    class CodedInputStream;                              // coded_stream.h\n    class CodedOutputStream;                             // coded_stream.h\n  }\n  namespace internal {\n    class FieldSkipper;                                  // wire_format_lite.h\n  }\n}\n\nnamespace protobuf {\nnamespace internal {\n\n// Used to store values of type WireFormatLite::FieldType without having to\n// #include wire_format_lite.h.  Also, ensures that we use only one byte to\n// store these values, which is important to keep the layout of\n// ExtensionSet::Extension small.\ntypedef uint8 FieldType;\n\n// A function which, given an integer value, returns true if the number\n// matches one of the defined values for the corresponding enum type.  This\n// is used with RegisterEnumExtension, below.\ntypedef bool EnumValidityFunc(int number);\n\n// Version of the above which takes an argument.  This is needed to deal with\n// extensions that are not compiled in.\ntypedef bool EnumValidityFuncWithArg(const void* arg, int number);\n\n// Information about a registered extension.\nstruct ExtensionInfo {\n  inline ExtensionInfo() {}\n  inline ExtensionInfo(FieldType type_param, bool isrepeated, bool ispacked)\n      : type(type_param), is_repeated(isrepeated), is_packed(ispacked),\n        descriptor(NULL) {}\n\n  FieldType type;\n  bool is_repeated;\n  bool is_packed;\n\n  struct EnumValidityCheck {\n    EnumValidityFuncWithArg* func;\n    const void* arg;\n  };\n\n  union {\n    EnumValidityCheck enum_validity_check;\n    const MessageLite* message_prototype;\n  };\n\n  // The descriptor for this extension, if one exists and is known.  May be\n  // NULL.  Must not be NULL if the descriptor for the extension does not\n  // live in the same pool as the descriptor for the containing type.\n  const FieldDescriptor* descriptor;\n};\n\n// Abstract interface for an object which looks up extension definitions.  Used\n// when parsing.\nclass LIBPROTOBUF_EXPORT ExtensionFinder {\n public:\n  virtual ~ExtensionFinder();\n\n  // Find the extension with the given containing type and number.\n  virtual bool Find(int number, ExtensionInfo* output) = 0;\n};\n\n// Implementation of ExtensionFinder which finds extensions defined in .proto\n// files which have been compiled into the binary.\nclass LIBPROTOBUF_EXPORT GeneratedExtensionFinder : public ExtensionFinder {\n public:\n  GeneratedExtensionFinder(const MessageLite* containing_type)\n      : containing_type_(containing_type) {}\n  virtual ~GeneratedExtensionFinder() {}\n\n  // Returns true and fills in *output if found, otherwise returns false.\n  virtual bool Find(int number, ExtensionInfo* output);\n\n private:\n  const MessageLite* containing_type_;\n};\n\n// A FieldSkipper used for parsing MessageSet.\nclass MessageSetFieldSkipper;\n\n// Note:  extension_set_heavy.cc defines DescriptorPoolExtensionFinder for\n// finding extensions from a DescriptorPool.\n\n// This is an internal helper class intended for use within the protocol buffer\n// library and generated classes.  Clients should not use it directly.  Instead,\n// use the generated accessors such as GetExtension() of the class being\n// extended.\n//\n// This class manages extensions for a protocol message object.  The\n// message's HasExtension(), GetExtension(), MutableExtension(), and\n// ClearExtension() methods are just thin wrappers around the embedded\n// ExtensionSet.  When parsing, if a tag number is encountered which is\n// inside one of the message type's extension ranges, the tag is passed\n// off to the ExtensionSet for parsing.  Etc.\nclass LIBPROTOBUF_EXPORT ExtensionSet {\n public:\n  ExtensionSet();\n  explicit ExtensionSet(::google::protobuf::Arena* arena);\n  ~ExtensionSet();\n\n  // These are called at startup by protocol-compiler-generated code to\n  // register known extensions.  The registrations are used by ParseField()\n  // to look up extensions for parsed field numbers.  Note that dynamic parsing\n  // does not use ParseField(); only protocol-compiler-generated parsing\n  // methods do.\n  static void RegisterExtension(const MessageLite* containing_type,\n                                int number, FieldType type,\n                                bool is_repeated, bool is_packed);\n  static void RegisterEnumExtension(const MessageLite* containing_type,\n                                    int number, FieldType type,\n                                    bool is_repeated, bool is_packed,\n                                    EnumValidityFunc* is_valid);\n  static void RegisterMessageExtension(const MessageLite* containing_type,\n                                       int number, FieldType type,\n                                       bool is_repeated, bool is_packed,\n                                       const MessageLite* prototype);\n\n  // =================================================================\n\n  // Add all fields which are currently present to the given vector.  This\n  // is useful to implement Reflection::ListFields().\n  void AppendToList(const Descriptor* containing_type,\n                    const DescriptorPool* pool,\n                    std::vector<const FieldDescriptor*>* output) const;\n\n  // =================================================================\n  // Accessors\n  //\n  // Generated message classes include type-safe templated wrappers around\n  // these methods.  Generally you should use those rather than call these\n  // directly, unless you are doing low-level memory management.\n  //\n  // When calling any of these accessors, the extension number requested\n  // MUST exist in the DescriptorPool provided to the constructor.  Otherwise,\n  // the method will fail an assert.  Normally, though, you would not call\n  // these directly; you would either call the generated accessors of your\n  // message class (e.g. GetExtension()) or you would call the accessors\n  // of the reflection interface.  In both cases, it is impossible to\n  // trigger this assert failure:  the generated accessors only accept\n  // linked-in extension types as parameters, while the Reflection interface\n  // requires you to provide the FieldDescriptor describing the extension.\n  //\n  // When calling any of these accessors, a protocol-compiler-generated\n  // implementation of the extension corresponding to the number MUST\n  // be linked in, and the FieldDescriptor used to refer to it MUST be\n  // the one generated by that linked-in code.  Otherwise, the method will\n  // die on an assert failure.  The message objects returned by the message\n  // accessors are guaranteed to be of the correct linked-in type.\n  //\n  // These methods pretty much match Reflection except that:\n  // - They're not virtual.\n  // - They identify fields by number rather than FieldDescriptors.\n  // - They identify enum values using integers rather than descriptors.\n  // - Strings provide Mutable() in addition to Set() accessors.\n\n  bool Has(int number) const;\n  int ExtensionSize(int number) const;   // Size of a repeated extension.\n  int NumExtensions() const;  // The number of extensions\n  FieldType ExtensionType(int number) const;\n  void ClearExtension(int number);\n\n  // singular fields -------------------------------------------------\n\n  int32  GetInt32 (int number, int32  default_value) const;\n  int64  GetInt64 (int number, int64  default_value) const;\n  uint32 GetUInt32(int number, uint32 default_value) const;\n  uint64 GetUInt64(int number, uint64 default_value) const;\n  float  GetFloat (int number, float  default_value) const;\n  double GetDouble(int number, double default_value) const;\n  bool   GetBool  (int number, bool   default_value) const;\n  int    GetEnum  (int number, int    default_value) const;\n  const string & GetString (int number, const string&  default_value) const;\n  const MessageLite& GetMessage(int number,\n                                const MessageLite& default_value) const;\n  const MessageLite& GetMessage(int number, const Descriptor* message_type,\n                                MessageFactory* factory) const;\n\n  // |descriptor| may be NULL so long as it is known that the descriptor for\n  // the extension lives in the same pool as the descriptor for the containing\n  // type.\n#define desc const FieldDescriptor* descriptor  // avoid line wrapping\n  void SetInt32 (int number, FieldType type, int32  value, desc);\n  void SetInt64 (int number, FieldType type, int64  value, desc);\n  void SetUInt32(int number, FieldType type, uint32 value, desc);\n  void SetUInt64(int number, FieldType type, uint64 value, desc);\n  void SetFloat (int number, FieldType type, float  value, desc);\n  void SetDouble(int number, FieldType type, double value, desc);\n  void SetBool  (int number, FieldType type, bool   value, desc);\n  void SetEnum  (int number, FieldType type, int    value, desc);\n  void SetString(int number, FieldType type, const string& value, desc);\n  string * MutableString (int number, FieldType type, desc);\n  MessageLite* MutableMessage(int number, FieldType type,\n                              const MessageLite& prototype, desc);\n  MessageLite* MutableMessage(const FieldDescriptor* decsriptor,\n                              MessageFactory* factory);\n  // Adds the given message to the ExtensionSet, taking ownership of the\n  // message object. Existing message with the same number will be deleted.\n  // If \"message\" is NULL, this is equivalent to \"ClearExtension(number)\".\n  void SetAllocatedMessage(int number, FieldType type,\n                           const FieldDescriptor* descriptor,\n                           MessageLite* message);\n  void UnsafeArenaSetAllocatedMessage(int number, FieldType type,\n                                      const FieldDescriptor* descriptor,\n                                      MessageLite* message);\n  MessageLite* ReleaseMessage(int number, const MessageLite& prototype);\n  MessageLite* UnsafeArenaReleaseMessage(\n      int number, const MessageLite& prototype);\n\n  MessageLite* ReleaseMessage(const FieldDescriptor* descriptor,\n                              MessageFactory* factory);\n  MessageLite* UnsafeArenaReleaseMessage(const FieldDescriptor* descriptor,\n                                         MessageFactory* factory);\n#undef desc\n  ::google::protobuf::Arena* GetArenaNoVirtual() const { return arena_; }\n\n  // repeated fields -------------------------------------------------\n\n  // Fetches a RepeatedField extension by number; returns |default_value|\n  // if no such extension exists. User should not touch this directly; it is\n  // used by the GetRepeatedExtension() method.\n  const void* GetRawRepeatedField(int number, const void* default_value) const;\n  // Fetches a mutable version of a RepeatedField extension by number,\n  // instantiating one if none exists. Similar to above, user should not use\n  // this directly; it underlies MutableRepeatedExtension().\n  void* MutableRawRepeatedField(int number, FieldType field_type,\n                                bool packed, const FieldDescriptor* desc);\n\n  // This is an overload of MutableRawRepeatedField to maintain compatibility\n  // with old code using a previous API. This version of\n  // MutableRawRepeatedField() will GOOGLE_CHECK-fail on a missing extension.\n  // (E.g.: borg/clients/internal/proto1/proto2_reflection.cc.)\n  void* MutableRawRepeatedField(int number);\n\n  int32  GetRepeatedInt32 (int number, int index) const;\n  int64  GetRepeatedInt64 (int number, int index) const;\n  uint32 GetRepeatedUInt32(int number, int index) const;\n  uint64 GetRepeatedUInt64(int number, int index) const;\n  float  GetRepeatedFloat (int number, int index) const;\n  double GetRepeatedDouble(int number, int index) const;\n  bool   GetRepeatedBool  (int number, int index) const;\n  int    GetRepeatedEnum  (int number, int index) const;\n  const string & GetRepeatedString (int number, int index) const;\n  const MessageLite& GetRepeatedMessage(int number, int index) const;\n\n  void SetRepeatedInt32 (int number, int index, int32  value);\n  void SetRepeatedInt64 (int number, int index, int64  value);\n  void SetRepeatedUInt32(int number, int index, uint32 value);\n  void SetRepeatedUInt64(int number, int index, uint64 value);\n  void SetRepeatedFloat (int number, int index, float  value);\n  void SetRepeatedDouble(int number, int index, double value);\n  void SetRepeatedBool  (int number, int index, bool   value);\n  void SetRepeatedEnum  (int number, int index, int    value);\n  void SetRepeatedString(int number, int index, const string& value);\n  string * MutableRepeatedString (int number, int index);\n  MessageLite* MutableRepeatedMessage(int number, int index);\n\n#define desc const FieldDescriptor* descriptor  // avoid line wrapping\n  void AddInt32 (int number, FieldType type, bool packed, int32  value, desc);\n  void AddInt64 (int number, FieldType type, bool packed, int64  value, desc);\n  void AddUInt32(int number, FieldType type, bool packed, uint32 value, desc);\n  void AddUInt64(int number, FieldType type, bool packed, uint64 value, desc);\n  void AddFloat (int number, FieldType type, bool packed, float  value, desc);\n  void AddDouble(int number, FieldType type, bool packed, double value, desc);\n  void AddBool  (int number, FieldType type, bool packed, bool   value, desc);\n  void AddEnum  (int number, FieldType type, bool packed, int    value, desc);\n  void AddString(int number, FieldType type, const string& value, desc);\n  string * AddString (int number, FieldType type, desc);\n  MessageLite* AddMessage(int number, FieldType type,\n                          const MessageLite& prototype, desc);\n  MessageLite* AddMessage(const FieldDescriptor* descriptor,\n                          MessageFactory* factory);\n  void AddAllocatedMessage(const FieldDescriptor* descriptor,\n                           MessageLite* new_entry);\n#undef desc\n\n  void RemoveLast(int number);\n  MessageLite* ReleaseLast(int number);\n  void SwapElements(int number, int index1, int index2);\n\n  // -----------------------------------------------------------------\n  // TODO(kenton):  Hardcore memory management accessors\n\n  // =================================================================\n  // convenience methods for implementing methods of Message\n  //\n  // These could all be implemented in terms of the other methods of this\n  // class, but providing them here helps keep the generated code size down.\n\n  void Clear();\n  void MergeFrom(const ExtensionSet& other);\n  void Swap(ExtensionSet* other);\n  void SwapExtension(ExtensionSet* other, int number);\n  bool IsInitialized() const;\n\n  // Parses a single extension from the input. The input should start out\n  // positioned immediately after the tag.\n  bool ParseField(uint32 tag, io::CodedInputStream* input,\n                  ExtensionFinder* extension_finder,\n                  FieldSkipper* field_skipper);\n\n  // Specific versions for lite or full messages (constructs the appropriate\n  // FieldSkipper automatically).  |containing_type| is the default\n  // instance for the containing message; it is used only to look up the\n  // extension by number.  See RegisterExtension(), above.  Unlike the other\n  // methods of ExtensionSet, this only works for generated message types --\n  // it looks up extensions registered using RegisterExtension().\n  bool ParseField(uint32 tag, io::CodedInputStream* input,\n                  const MessageLite* containing_type);\n  bool ParseField(uint32 tag, io::CodedInputStream* input,\n                  const Message* containing_type,\n                  UnknownFieldSet* unknown_fields);\n  bool ParseField(uint32 tag, io::CodedInputStream* input,\n                  const MessageLite* containing_type,\n                  io::CodedOutputStream* unknown_fields);\n\n  // Parse an entire message in MessageSet format.  Such messages have no\n  // fields, only extensions.\n  bool ParseMessageSet(io::CodedInputStream* input,\n                       ExtensionFinder* extension_finder,\n                       MessageSetFieldSkipper* field_skipper);\n\n  // Specific versions for lite or full messages (constructs the appropriate\n  // FieldSkipper automatically).\n  bool ParseMessageSet(io::CodedInputStream* input,\n                       const MessageLite* containing_type);\n  bool ParseMessageSet(io::CodedInputStream* input,\n                       const Message* containing_type,\n                       UnknownFieldSet* unknown_fields);\n\n  // Write all extension fields with field numbers in the range\n  //   [start_field_number, end_field_number)\n  // to the output stream, using the cached sizes computed when ByteSize() was\n  // last called.  Note that the range bounds are inclusive-exclusive.\n  void SerializeWithCachedSizes(int start_field_number,\n                                int end_field_number,\n                                io::CodedOutputStream* output) const;\n\n  // Same as SerializeWithCachedSizes, but without any bounds checking.\n  // The caller must ensure that target has sufficient capacity for the\n  // serialized extensions.\n  //\n  // Returns a pointer past the last written byte.\n  uint8* InternalSerializeWithCachedSizesToArray(int start_field_number,\n                                                 int end_field_number,\n                                                 bool deterministic,\n                                                 uint8* target) const;\n\n  // Like above but serializes in MessageSet format.\n  void SerializeMessageSetWithCachedSizes(io::CodedOutputStream* output) const;\n  uint8* InternalSerializeMessageSetWithCachedSizesToArray(bool deterministic,\n                                                           uint8* target) const;\n\n  // For backward-compatibility, versions of two of the above methods that\n  // serialize deterministically iff SetDefaultSerializationDeterministic()\n  // has been called.\n  uint8* SerializeWithCachedSizesToArray(int start_field_number,\n                                         int end_field_number,\n                                         uint8* target) const;\n  uint8* SerializeMessageSetWithCachedSizesToArray(uint8* target) const;\n\n  // Returns the total serialized size of all the extensions.\n  size_t ByteSize() const;\n\n  // Like ByteSize() but uses MessageSet format.\n  size_t MessageSetByteSize() const;\n\n  // Returns (an estimate of) the total number of bytes used for storing the\n  // extensions in memory, excluding sizeof(*this).  If the ExtensionSet is\n  // for a lite message (and thus possibly contains lite messages), the results\n  // are undefined (might work, might crash, might corrupt data, might not even\n  // be linked in).  It's up to the protocol compiler to avoid calling this on\n  // such ExtensionSets (easy enough since lite messages don't implement\n  // SpaceUsed()).\n  size_t SpaceUsedExcludingSelfLong() const;\n\n  // This method just calls SpaceUsedExcludingSelfLong() but it can not be\n  // inlined because the definition of SpaceUsedExcludingSelfLong() is not\n  // included in lite runtime and when an inline method refers to it MSVC\n  // will complain about unresolved symbols when building the lite runtime\n  // as .dll.\n  int SpaceUsedExcludingSelf() const;\n\n private:\n\n  // Interface of a lazily parsed singular message extension.\n  class LIBPROTOBUF_EXPORT LazyMessageExtension {\n   public:\n    LazyMessageExtension() {}\n    virtual ~LazyMessageExtension() {}\n\n    virtual LazyMessageExtension* New(::google::protobuf::Arena* arena) const = 0;\n    virtual const MessageLite& GetMessage(\n        const MessageLite& prototype) const = 0;\n    virtual MessageLite* MutableMessage(const MessageLite& prototype) = 0;\n    virtual void SetAllocatedMessage(MessageLite *message) = 0;\n    virtual void UnsafeArenaSetAllocatedMessage(MessageLite *message) = 0;\n    virtual MessageLite* ReleaseMessage(const MessageLite& prototype) = 0;\n    virtual MessageLite* UnsafeArenaReleaseMessage(\n        const MessageLite& prototype) = 0;\n\n    virtual bool IsInitialized() const = 0;\n\n    PROTOBUF_RUNTIME_DEPRECATED(\"Please use ByteSizeLong() instead\")\n    virtual int ByteSize() const {\n      return internal::ToIntSize(ByteSizeLong());\n    }\n    virtual size_t ByteSizeLong() const = 0;\n    virtual size_t SpaceUsedLong() const = 0;\n\n    virtual void MergeFrom(const LazyMessageExtension& other) = 0;\n    virtual void Clear() = 0;\n\n    virtual bool ReadMessage(const MessageLite& prototype,\n                             io::CodedInputStream* input) = 0;\n    virtual void WriteMessage(int number,\n                              io::CodedOutputStream* output) const = 0;\n    virtual uint8* WriteMessageToArray(int number, uint8* target) const = 0;\n    virtual uint8* InternalWriteMessageToArray(int number, bool,\n                                               uint8* target) const {\n      // TODO(gpike): make this pure virtual. This is a placeholder because we\n      // need to update third_party/upb, for example.\n      return WriteMessageToArray(number, target);\n    }\n\n   private:\n    virtual void UnusedKeyMethod();  // Dummy key method to avoid weak vtable.\n\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(LazyMessageExtension);\n  };\n  struct Extension {\n    // The order of these fields packs Extension into 24 bytes when using 8\n    // byte alignment. Consider this when adding or removing fields here.\n    union {\n      int32                 int32_value;\n      int64                 int64_value;\n      uint32                uint32_value;\n      uint64                uint64_value;\n      float                 float_value;\n      double                double_value;\n      bool                  bool_value;\n      int                   enum_value;\n      string*               string_value;\n      MessageLite*          message_value;\n      LazyMessageExtension* lazymessage_value;\n\n      RepeatedField   <int32      >* repeated_int32_value;\n      RepeatedField   <int64      >* repeated_int64_value;\n      RepeatedField   <uint32     >* repeated_uint32_value;\n      RepeatedField   <uint64     >* repeated_uint64_value;\n      RepeatedField   <float      >* repeated_float_value;\n      RepeatedField   <double     >* repeated_double_value;\n      RepeatedField   <bool       >* repeated_bool_value;\n      RepeatedField   <int        >* repeated_enum_value;\n      RepeatedPtrField<string     >* repeated_string_value;\n      RepeatedPtrField<MessageLite>* repeated_message_value;\n    };\n\n    FieldType type;\n    bool is_repeated;\n\n    // For singular types, indicates if the extension is \"cleared\".  This\n    // happens when an extension is set and then later cleared by the caller.\n    // We want to keep the Extension object around for reuse, so instead of\n    // removing it from the map, we just set is_cleared = true.  This has no\n    // meaning for repeated types; for those, the size of the RepeatedField\n    // simply becomes zero when cleared.\n    bool is_cleared : 4;\n\n    // For singular message types, indicates whether lazy parsing is enabled\n    // for this extension. This field is only valid when type == TYPE_MESSAGE\n    // and !is_repeated because we only support lazy parsing for singular\n    // message types currently. If is_lazy = true, the extension is stored in\n    // lazymessage_value. Otherwise, the extension will be message_value.\n    bool is_lazy : 4;\n\n    // For repeated types, this indicates if the [packed=true] option is set.\n    bool is_packed;\n\n    // For packed fields, the size of the packed data is recorded here when\n    // ByteSize() is called then used during serialization.\n    // TODO(kenton):  Use atomic<int> when C++ supports it.\n    mutable int cached_size;\n\n    // The descriptor for this extension, if one exists and is known.  May be\n    // NULL.  Must not be NULL if the descriptor for the extension does not\n    // live in the same pool as the descriptor for the containing type.\n    const FieldDescriptor* descriptor;\n\n    // Some helper methods for operations on a single Extension.\n    void SerializeFieldWithCachedSizes(\n        int number,\n        io::CodedOutputStream* output) const;\n    uint8* InternalSerializeFieldWithCachedSizesToArray(\n        int number,\n        bool deterministic,\n        uint8* target) const;\n    void SerializeMessageSetItemWithCachedSizes(\n        int number,\n        io::CodedOutputStream* output) const;\n    uint8* InternalSerializeMessageSetItemWithCachedSizesToArray(\n        int number,\n        bool deterministic,\n        uint8* target) const;\n    size_t ByteSize(int number) const;\n    size_t MessageSetItemByteSize(int number) const;\n    void Clear();\n    int GetSize() const;\n    void Free();\n    size_t SpaceUsedExcludingSelfLong() const;\n    bool IsInitialized() const;\n  };\n\n  // The Extension struct is small enough to be passed by value, so we use it\n  // directly as the value type in mappings rather than use pointers.  We use\n  // sorted maps rather than hash-maps because we expect most ExtensionSets will\n  // only contain a small number of extension.  Also, we want AppendToList and\n  // deterministic serialization to order fields by field number.\n\n  struct KeyValue {\n    int first;\n    Extension second;\n\n    struct FirstComparator {\n      bool operator()(const KeyValue& lhs, const KeyValue& rhs) const {\n        return lhs.first < rhs.first;\n      }\n      bool operator()(const KeyValue& lhs, int key) const {\n        return lhs.first < key;\n      }\n      bool operator()(int key, const KeyValue& rhs) const {\n        return key < rhs.first;\n      }\n    };\n  };\n\n  typedef std::map<int, Extension> LargeMap;\n\n  // Wrapper API that switches between flat-map and LargeMap.\n\n  // Finds a key (if present) in the ExtensionSet.\n  const Extension* FindOrNull(int key) const;\n  Extension* FindOrNull(int key);\n\n  // Helper-functions that only inspect the LargeMap.\n  const Extension* FindOrNullInLargeMap(int key) const;\n  Extension* FindOrNullInLargeMap(int key);\n\n  // Inserts a new (key, Extension) into the ExtensionSet (and returns true), or\n  // finds the already-existing Extension for that key (returns false).\n  // The Extension* will point to the new-or-found Extension.\n  std::pair<Extension*, bool> Insert(int key);\n\n  // Grows the flat_capacity_.\n  // If flat_capacity_ > kMaximumFlatCapacity, converts to LargeMap.\n  void GrowCapacity(size_t minimum_new_capacity);\n  static constexpr uint16 kMaximumFlatCapacity = 256;\n  bool is_large() const { return flat_capacity_ > kMaximumFlatCapacity; }\n\n  // Removes a key from the ExtensionSet.\n  void Erase(int key);\n\n  size_t Size() const {\n    return GOOGLE_PREDICT_FALSE(is_large()) ? map_.large->size() : flat_size_;\n  }\n\n  // Similar to std::for_each.\n  // Each Iterator is decomposed into ->first and ->second fields, so\n  // that the KeyValueFunctor can be agnostic vis-a-vis KeyValue-vs-std::pair.\n  template <typename Iterator, typename KeyValueFunctor>\n  static KeyValueFunctor ForEach(Iterator begin, Iterator end,\n                                 KeyValueFunctor func) {\n    for (Iterator it = begin; it != end; ++it) func(it->first, it->second);\n    return std::move(func);\n  }\n\n  // Applies a functor to the <int, Extension&> pairs in sorted order.\n  template <typename KeyValueFunctor>\n  KeyValueFunctor ForEach(KeyValueFunctor func) {\n    if (GOOGLE_PREDICT_FALSE(is_large())) {\n      return ForEach(map_.large->begin(), map_.large->end(), std::move(func));\n    }\n    return ForEach(flat_begin(), flat_end(), std::move(func));\n  }\n\n  // Applies a functor to the <int, const Extension&> pairs in sorted order.\n  template <typename KeyValueFunctor>\n  KeyValueFunctor ForEach(KeyValueFunctor func) const {\n    if (GOOGLE_PREDICT_FALSE(is_large())) {\n      return ForEach(map_.large->begin(), map_.large->end(), std::move(func));\n    }\n    return ForEach(flat_begin(), flat_end(), std::move(func));\n  }\n\n  // Merges existing Extension from other_extension\n  void InternalExtensionMergeFrom(int number, const Extension& other_extension);\n\n  // Returns true and fills field_number and extension if extension is found.\n  // Note to support packed repeated field compatibility, it also fills whether\n  // the tag on wire is packed, which can be different from\n  // extension->is_packed (whether packed=true is specified).\n  bool FindExtensionInfoFromTag(uint32 tag, ExtensionFinder* extension_finder,\n                                int* field_number, ExtensionInfo* extension,\n                                bool* was_packed_on_wire);\n\n  // Returns true and fills extension if extension is found.\n  // Note to support packed repeated field compatibility, it also fills whether\n  // the tag on wire is packed, which can be different from\n  // extension->is_packed (whether packed=true is specified).\n  bool FindExtensionInfoFromFieldNumber(int wire_type, int field_number,\n                                        ExtensionFinder* extension_finder,\n                                        ExtensionInfo* extension,\n                                        bool* was_packed_on_wire);\n\n  // Parses a single extension from the input. The input should start out\n  // positioned immediately after the wire tag. This method is called in\n  // ParseField() after field number and was_packed_on_wire is extracted from\n  // the wire tag and ExtensionInfo is found by the field number.\n  bool ParseFieldWithExtensionInfo(int field_number,\n                                   bool was_packed_on_wire,\n                                   const ExtensionInfo& extension,\n                                   io::CodedInputStream* input,\n                                   FieldSkipper* field_skipper);\n\n  // Like ParseField(), but this method may parse singular message extensions\n  // lazily depending on the value of FLAGS_eagerly_parse_message_sets.\n  bool ParseFieldMaybeLazily(int wire_type, int field_number,\n                             io::CodedInputStream* input,\n                             ExtensionFinder* extension_finder,\n                             MessageSetFieldSkipper* field_skipper);\n\n  // Gets the extension with the given number, creating it if it does not\n  // already exist.  Returns true if the extension did not already exist.\n  bool MaybeNewExtension(int number, const FieldDescriptor* descriptor,\n                         Extension** result);\n\n  // Gets the repeated extension for the given descriptor, creating it if\n  // it does not exist.\n  Extension* MaybeNewRepeatedExtension(const FieldDescriptor* descriptor);\n\n  // Parse a single MessageSet item -- called just after the item group start\n  // tag has been read.\n  bool ParseMessageSetItem(io::CodedInputStream* input,\n                           ExtensionFinder* extension_finder,\n                           MessageSetFieldSkipper* field_skipper);\n\n  // Hack:  RepeatedPtrFieldBase declares ExtensionSet as a friend.  This\n  //   friendship should automatically extend to ExtensionSet::Extension, but\n  //   unfortunately some older compilers (e.g. GCC 3.4.4) do not implement this\n  //   correctly.  So, we must provide helpers for calling methods of that\n  //   class.\n\n  // Defined in extension_set_heavy.cc.\n  static inline size_t RepeatedMessage_SpaceUsedExcludingSelfLong(\n      RepeatedPtrFieldBase* field);\n\n  KeyValue* flat_begin() {\n    assert(!is_large());\n    return map_.flat;\n  }\n  const KeyValue* flat_begin() const {\n    assert(!is_large());\n    return map_.flat;\n  }\n  KeyValue* flat_end() {\n    assert(!is_large());\n    return map_.flat + flat_size_;\n  }\n  const KeyValue* flat_end() const {\n    assert(!is_large());\n    return map_.flat + flat_size_;\n  }\n\n  ::google::protobuf::Arena* arena_;\n\n  // Manual memory-management:\n  // map_.flat is an allocated array of flat_capacity_ elements.\n  // [map_.flat, map_.flat + flat_size_) is the currently-in-use prefix.\n  uint16 flat_capacity_;\n  uint16 flat_size_;\n  union AllocatedData {\n    KeyValue* flat;\n\n    // If flat_capacity_ > kMaximumFlatCapacity, switch to LargeMap,\n    // which guarantees O(n lg n) CPU but larger constant factors.\n    LargeMap* large;\n  } map_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionSet);\n};\n\n// These are just for convenience...\ninline void ExtensionSet::SetString(int number, FieldType type,\n                                    const string& value,\n                                    const FieldDescriptor* descriptor) {\n  MutableString(number, type, descriptor)->assign(value);\n}\ninline void ExtensionSet::SetRepeatedString(int number, int index,\n                                            const string& value) {\n  MutableRepeatedString(number, index)->assign(value);\n}\ninline void ExtensionSet::AddString(int number, FieldType type,\n                                    const string& value,\n                                    const FieldDescriptor* descriptor) {\n  AddString(number, type, descriptor)->assign(value);\n}\n\n// ===================================================================\n// Glue for generated extension accessors\n\n// -------------------------------------------------------------------\n// Template magic\n\n// First we have a set of classes representing \"type traits\" for different\n// field types.  A type traits class knows how to implement basic accessors\n// for extensions of a particular type given an ExtensionSet.  The signature\n// for a type traits class looks like this:\n//\n//   class TypeTraits {\n//    public:\n//     typedef ? ConstType;\n//     typedef ? MutableType;\n//     // TypeTraits for singular fields and repeated fields will define the\n//     // symbol \"Singular\" or \"Repeated\" respectively. These two symbols will\n//     // be used in extension accessors to distinguish between singular\n//     // extensions and repeated extensions. If the TypeTraits for the passed\n//     // in extension doesn't have the expected symbol defined, it means the\n//     // user is passing a repeated extension to a singular accessor, or the\n//     // opposite. In that case the C++ compiler will generate an error\n//     // message \"no matching member function\" to inform the user.\n//     typedef ? Singular\n//     typedef ? Repeated\n//\n//     static inline ConstType Get(int number, const ExtensionSet& set);\n//     static inline void Set(int number, ConstType value, ExtensionSet* set);\n//     static inline MutableType Mutable(int number, ExtensionSet* set);\n//\n//     // Variants for repeated fields.\n//     static inline ConstType Get(int number, const ExtensionSet& set,\n//                                 int index);\n//     static inline void Set(int number, int index,\n//                            ConstType value, ExtensionSet* set);\n//     static inline MutableType Mutable(int number, int index,\n//                                       ExtensionSet* set);\n//     static inline void Add(int number, ConstType value, ExtensionSet* set);\n//     static inline MutableType Add(int number, ExtensionSet* set);\n//     This is used by the ExtensionIdentifier constructor to register\n//     the extension at dynamic initialization.\n//     template <typename ExtendeeT>\n//     static void Register(int number, FieldType type, bool is_packed);\n//   };\n//\n// Not all of these methods make sense for all field types.  For example, the\n// \"Mutable\" methods only make sense for strings and messages, and the\n// repeated methods only make sense for repeated types.  So, each type\n// traits class implements only the set of methods from this signature that it\n// actually supports.  This will cause a compiler error if the user tries to\n// access an extension using a method that doesn't make sense for its type.\n// For example, if \"foo\" is an extension of type \"optional int32\", then if you\n// try to write code like:\n//   my_message.MutableExtension(foo)\n// you will get a compile error because PrimitiveTypeTraits<int32> does not\n// have a \"Mutable()\" method.\n\n// -------------------------------------------------------------------\n// PrimitiveTypeTraits\n\n// Since the ExtensionSet has different methods for each primitive type,\n// we must explicitly define the methods of the type traits class for each\n// known type.\ntemplate <typename Type>\nclass PrimitiveTypeTraits {\n public:\n  typedef Type ConstType;\n  typedef Type MutableType;\n  typedef PrimitiveTypeTraits<Type> Singular;\n\n  static inline ConstType Get(int number, const ExtensionSet& set,\n                              ConstType default_value);\n  static inline void Set(int number, FieldType field_type,\n                         ConstType value, ExtensionSet* set);\n  template <typename ExtendeeT>\n  static void Register(int number, FieldType type, bool is_packed) {\n    ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number,\n                                    type, false, is_packed);\n  }\n};\n\ntemplate <typename Type>\nclass RepeatedPrimitiveTypeTraits {\n public:\n  typedef Type ConstType;\n  typedef Type MutableType;\n  typedef RepeatedPrimitiveTypeTraits<Type> Repeated;\n\n  typedef RepeatedField<Type> RepeatedFieldType;\n\n  static inline Type Get(int number, const ExtensionSet& set, int index);\n  static inline void Set(int number, int index, Type value, ExtensionSet* set);\n  static inline void Add(int number, FieldType field_type,\n                         bool is_packed, Type value, ExtensionSet* set);\n\n  static inline const RepeatedField<ConstType>&\n      GetRepeated(int number, const ExtensionSet& set);\n  static inline RepeatedField<Type>*\n      MutableRepeated(int number, FieldType field_type,\n                      bool is_packed, ExtensionSet* set);\n\n  static const RepeatedFieldType* GetDefaultRepeatedField();\n  template <typename ExtendeeT>\n  static void Register(int number, FieldType type, bool is_packed) {\n    ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number,\n                                    type, true, is_packed);\n  }\n};\n\nLIBPROTOBUF_EXPORT extern ProtobufOnceType repeated_primitive_generic_type_traits_once_init_;\n\nclass LIBPROTOBUF_EXPORT RepeatedPrimitiveDefaults {\n private:\n  template<typename Type> friend class RepeatedPrimitiveTypeTraits;\n  static const RepeatedPrimitiveDefaults* default_instance();\n  RepeatedField<int32> default_repeated_field_int32_;\n  RepeatedField<int64> default_repeated_field_int64_;\n  RepeatedField<uint32> default_repeated_field_uint32_;\n  RepeatedField<uint64> default_repeated_field_uint64_;\n  RepeatedField<double> default_repeated_field_double_;\n  RepeatedField<float> default_repeated_field_float_;\n  RepeatedField<bool> default_repeated_field_bool_;\n};\n\n#define PROTOBUF_DEFINE_PRIMITIVE_TYPE(TYPE, METHOD)                       \\\ntemplate<> inline TYPE PrimitiveTypeTraits<TYPE>::Get(                     \\\n    int number, const ExtensionSet& set, TYPE default_value) {             \\\n  return set.Get##METHOD(number, default_value);                           \\\n}                                                                          \\\ntemplate<> inline void PrimitiveTypeTraits<TYPE>::Set(                     \\\n    int number, FieldType field_type, TYPE value, ExtensionSet* set) {     \\\n  set->Set##METHOD(number, field_type, value, NULL);                       \\\n}                                                                          \\\n                                                                           \\\ntemplate<> inline TYPE RepeatedPrimitiveTypeTraits<TYPE>::Get(             \\\n    int number, const ExtensionSet& set, int index) {                      \\\n  return set.GetRepeated##METHOD(number, index);                           \\\n}                                                                          \\\ntemplate<> inline void RepeatedPrimitiveTypeTraits<TYPE>::Set(             \\\n    int number, int index, TYPE value, ExtensionSet* set) {                \\\n  set->SetRepeated##METHOD(number, index, value);                          \\\n}                                                                          \\\ntemplate<> inline void RepeatedPrimitiveTypeTraits<TYPE>::Add(             \\\n    int number, FieldType field_type, bool is_packed,                      \\\n    TYPE value, ExtensionSet* set) {                                       \\\n  set->Add##METHOD(number, field_type, is_packed, value, NULL);            \\\n}                                                                          \\\ntemplate<> inline const RepeatedField<TYPE>*                               \\\n    RepeatedPrimitiveTypeTraits<TYPE>::GetDefaultRepeatedField() {         \\\n  return &RepeatedPrimitiveDefaults::default_instance()                    \\\n              ->default_repeated_field_##TYPE##_;                          \\\n}                                                                          \\\ntemplate<> inline const RepeatedField<TYPE>&                               \\\n    RepeatedPrimitiveTypeTraits<TYPE>::GetRepeated(int number,             \\\n                                               const ExtensionSet& set) {  \\\n  return *reinterpret_cast<const RepeatedField<TYPE>*>(                    \\\n                            set.GetRawRepeatedField(                       \\\n                                number, GetDefaultRepeatedField()));       \\\n}                                                                          \\\ntemplate<> inline RepeatedField<TYPE>*                                     \\\n    RepeatedPrimitiveTypeTraits<TYPE>::MutableRepeated(int number,         \\\n                                                   FieldType field_type,   \\\n                                                   bool is_packed,         \\\n                                                   ExtensionSet* set) {    \\\n  return reinterpret_cast<RepeatedField<TYPE>*>(                           \\\n      set->MutableRawRepeatedField(number, field_type, is_packed, NULL));  \\\n}\n\nPROTOBUF_DEFINE_PRIMITIVE_TYPE( int32,  Int32)\nPROTOBUF_DEFINE_PRIMITIVE_TYPE( int64,  Int64)\nPROTOBUF_DEFINE_PRIMITIVE_TYPE(uint32, UInt32)\nPROTOBUF_DEFINE_PRIMITIVE_TYPE(uint64, UInt64)\nPROTOBUF_DEFINE_PRIMITIVE_TYPE( float,  Float)\nPROTOBUF_DEFINE_PRIMITIVE_TYPE(double, Double)\nPROTOBUF_DEFINE_PRIMITIVE_TYPE(  bool,   Bool)\n\n#undef PROTOBUF_DEFINE_PRIMITIVE_TYPE\n\n// -------------------------------------------------------------------\n// StringTypeTraits\n\n// Strings support both Set() and Mutable().\nclass LIBPROTOBUF_EXPORT StringTypeTraits {\n public:\n  typedef const string& ConstType;\n  typedef string* MutableType;\n  typedef StringTypeTraits Singular;\n\n  static inline const string& Get(int number, const ExtensionSet& set,\n                                  ConstType default_value) {\n    return set.GetString(number, default_value);\n  }\n  static inline void Set(int number, FieldType field_type,\n                         const string& value, ExtensionSet* set) {\n    set->SetString(number, field_type, value, NULL);\n  }\n  static inline string* Mutable(int number, FieldType field_type,\n                                ExtensionSet* set) {\n    return set->MutableString(number, field_type, NULL);\n  }\n  template <typename ExtendeeT>\n  static void Register(int number, FieldType type, bool is_packed) {\n    ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number,\n                                    type, false, is_packed);\n  }\n};\n\nclass LIBPROTOBUF_EXPORT RepeatedStringTypeTraits {\n public:\n  typedef const string& ConstType;\n  typedef string* MutableType;\n  typedef RepeatedStringTypeTraits Repeated;\n\n  typedef RepeatedPtrField<string> RepeatedFieldType;\n\n  static inline const string& Get(int number, const ExtensionSet& set,\n                                  int index) {\n    return set.GetRepeatedString(number, index);\n  }\n  static inline void Set(int number, int index,\n                         const string& value, ExtensionSet* set) {\n    set->SetRepeatedString(number, index, value);\n  }\n  static inline string* Mutable(int number, int index, ExtensionSet* set) {\n    return set->MutableRepeatedString(number, index);\n  }\n  static inline void Add(int number, FieldType field_type,\n                         bool /*is_packed*/, const string& value,\n                         ExtensionSet* set) {\n    set->AddString(number, field_type, value, NULL);\n  }\n  static inline string* Add(int number, FieldType field_type,\n                            ExtensionSet* set) {\n    return set->AddString(number, field_type, NULL);\n  }\n  static inline const RepeatedPtrField<string>&\n      GetRepeated(int number, const ExtensionSet& set) {\n    return *reinterpret_cast<const RepeatedPtrField<string>*>(\n        set.GetRawRepeatedField(number, GetDefaultRepeatedField()));\n  }\n\n  static inline RepeatedPtrField<string>*\n      MutableRepeated(int number, FieldType field_type,\n                      bool is_packed, ExtensionSet* set) {\n    return reinterpret_cast<RepeatedPtrField<string>*>(\n        set->MutableRawRepeatedField(number, field_type,\n                                     is_packed, NULL));\n  }\n\n  static const RepeatedFieldType* GetDefaultRepeatedField();\n\n  template <typename ExtendeeT>\n  static void Register(int number, FieldType type, bool is_packed) {\n    ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number,\n                                    type, true, is_packed);\n  }\n\n private:\n  static void InitializeDefaultRepeatedFields();\n  static void DestroyDefaultRepeatedFields();\n};\n\n// -------------------------------------------------------------------\n// EnumTypeTraits\n\n// ExtensionSet represents enums using integers internally, so we have to\n// static_cast around.\ntemplate <typename Type, bool IsValid(int)>\nclass EnumTypeTraits {\n public:\n  typedef Type ConstType;\n  typedef Type MutableType;\n  typedef EnumTypeTraits<Type, IsValid> Singular;\n\n  static inline ConstType Get(int number, const ExtensionSet& set,\n                              ConstType default_value) {\n    return static_cast<Type>(set.GetEnum(number, default_value));\n  }\n  static inline void Set(int number, FieldType field_type,\n                         ConstType value, ExtensionSet* set) {\n    GOOGLE_DCHECK(IsValid(value));\n    set->SetEnum(number, field_type, value, NULL);\n  }\n  template <typename ExtendeeT>\n  static void Register(int number, FieldType type, bool is_packed) {\n    ExtensionSet::RegisterEnumExtension(&ExtendeeT::default_instance(), number,\n                                        type, false, is_packed, IsValid);\n  }\n};\n\ntemplate <typename Type, bool IsValid(int)>\nclass RepeatedEnumTypeTraits {\n public:\n  typedef Type ConstType;\n  typedef Type MutableType;\n  typedef RepeatedEnumTypeTraits<Type, IsValid> Repeated;\n\n  typedef RepeatedField<Type> RepeatedFieldType;\n\n  static inline ConstType Get(int number, const ExtensionSet& set, int index) {\n    return static_cast<Type>(set.GetRepeatedEnum(number, index));\n  }\n  static inline void Set(int number, int index,\n                         ConstType value, ExtensionSet* set) {\n    GOOGLE_DCHECK(IsValid(value));\n    set->SetRepeatedEnum(number, index, value);\n  }\n  static inline void Add(int number, FieldType field_type,\n                         bool is_packed, ConstType value, ExtensionSet* set) {\n    GOOGLE_DCHECK(IsValid(value));\n    set->AddEnum(number, field_type, is_packed, value, NULL);\n  }\n  static inline const RepeatedField<Type>& GetRepeated(int number,\n                                                       const ExtensionSet&\n                                                       set) {\n    // Hack: the `Extension` struct stores a RepeatedField<int> for enums.\n    // RepeatedField<int> cannot implicitly convert to RepeatedField<EnumType>\n    // so we need to do some casting magic. See message.h for similar\n    // contortions for non-extension fields.\n    return *reinterpret_cast<const RepeatedField<Type>*>(\n        set.GetRawRepeatedField(number, GetDefaultRepeatedField()));\n  }\n\n  static inline RepeatedField<Type>* MutableRepeated(int number,\n                                                     FieldType field_type,\n                                                     bool is_packed,\n                                                     ExtensionSet* set) {\n    return reinterpret_cast<RepeatedField<Type>*>(\n        set->MutableRawRepeatedField(number, field_type, is_packed, NULL));\n  }\n\n  static const RepeatedFieldType* GetDefaultRepeatedField() {\n    // Hack: as noted above, repeated enum fields are internally stored as a\n    // RepeatedField<int>. We need to be able to instantiate global static\n    // objects to return as default (empty) repeated fields on non-existent\n    // extensions. We would not be able to know a-priori all of the enum types\n    // (values of |Type|) to instantiate all of these, so we just re-use int32's\n    // default repeated field object.\n    return reinterpret_cast<const RepeatedField<Type>*>(\n        RepeatedPrimitiveTypeTraits<int32>::GetDefaultRepeatedField());\n  }\n  template <typename ExtendeeT>\n  static void Register(int number, FieldType type, bool is_packed) {\n    ExtensionSet::RegisterEnumExtension(&ExtendeeT::default_instance(), number,\n                                        type, true, is_packed, IsValid);\n  }\n};\n\n// -------------------------------------------------------------------\n// MessageTypeTraits\n\n// ExtensionSet guarantees that when manipulating extensions with message\n// types, the implementation used will be the compiled-in class representing\n// that type.  So, we can static_cast down to the exact type we expect.\ntemplate <typename Type>\nclass MessageTypeTraits {\n public:\n  typedef const Type& ConstType;\n  typedef Type* MutableType;\n  typedef MessageTypeTraits<Type> Singular;\n\n  static inline ConstType Get(int number, const ExtensionSet& set,\n                              ConstType default_value) {\n    return static_cast<const Type&>(\n        set.GetMessage(number, default_value));\n  }\n  static inline MutableType Mutable(int number, FieldType field_type,\n                                    ExtensionSet* set) {\n    return static_cast<Type*>(\n      set->MutableMessage(number, field_type, Type::default_instance(), NULL));\n  }\n  static inline void SetAllocated(int number, FieldType field_type,\n                                  MutableType message, ExtensionSet* set) {\n    set->SetAllocatedMessage(number, field_type, NULL, message);\n  }\n  static inline void UnsafeArenaSetAllocated(int number, FieldType field_type,\n                                             MutableType message,\n                                             ExtensionSet* set) {\n    set->UnsafeArenaSetAllocatedMessage(number, field_type, NULL, message);\n  }\n  static inline MutableType Release(int number, FieldType /* field_type */,\n                                    ExtensionSet* set) {\n    return static_cast<Type*>(set->ReleaseMessage(\n        number, Type::default_instance()));\n  }\n  static inline MutableType UnsafeArenaRelease(int number,\n                                               FieldType /* field_type */,\n                                               ExtensionSet* set) {\n    return static_cast<Type*>(set->UnsafeArenaReleaseMessage(\n        number, Type::default_instance()));\n  }\n  template <typename ExtendeeT>\n  static void Register(int number, FieldType type, bool is_packed) {\n    ExtensionSet::RegisterMessageExtension(&ExtendeeT::default_instance(),\n                                           number, type, false, is_packed,\n                                           &Type::default_instance());\n  }\n};\n\n// forward declaration\nclass RepeatedMessageGenericTypeTraits;\n\ntemplate <typename Type>\nclass RepeatedMessageTypeTraits {\n public:\n  typedef const Type& ConstType;\n  typedef Type* MutableType;\n  typedef RepeatedMessageTypeTraits<Type> Repeated;\n\n  typedef RepeatedPtrField<Type> RepeatedFieldType;\n\n  static inline ConstType Get(int number, const ExtensionSet& set, int index) {\n    return static_cast<const Type&>(set.GetRepeatedMessage(number, index));\n  }\n  static inline MutableType Mutable(int number, int index, ExtensionSet* set) {\n    return static_cast<Type*>(set->MutableRepeatedMessage(number, index));\n  }\n  static inline MutableType Add(int number, FieldType field_type,\n                                ExtensionSet* set) {\n    return static_cast<Type*>(\n        set->AddMessage(number, field_type, Type::default_instance(), NULL));\n  }\n  static inline const RepeatedPtrField<Type>& GetRepeated(int number,\n                                                          const ExtensionSet&\n                                                          set) {\n    // See notes above in RepeatedEnumTypeTraits::GetRepeated(): same\n    // casting hack applies here, because a RepeatedPtrField<MessageLite>\n    // cannot naturally become a RepeatedPtrType<Type> even though Type is\n    // presumably a message. google::protobuf::Message goes through similar contortions\n    // with a reinterpret_cast<>.\n    return *reinterpret_cast<const RepeatedPtrField<Type>*>(\n        set.GetRawRepeatedField(number, GetDefaultRepeatedField()));\n  }\n  static inline RepeatedPtrField<Type>* MutableRepeated(int number,\n                                                        FieldType field_type,\n                                                        bool is_packed,\n                                                        ExtensionSet* set) {\n    return reinterpret_cast<RepeatedPtrField<Type>*>(\n        set->MutableRawRepeatedField(number, field_type, is_packed, NULL));\n  }\n\n  static const RepeatedFieldType* GetDefaultRepeatedField();\n  template <typename ExtendeeT>\n  static void Register(int number, FieldType type, bool is_packed) {\n    ExtensionSet::RegisterMessageExtension(&ExtendeeT::default_instance(),\n                                           number, type, true, is_packed,\n                                           &Type::default_instance());\n  }\n};\n\ntemplate<typename Type> inline\n    const typename RepeatedMessageTypeTraits<Type>::RepeatedFieldType*\n    RepeatedMessageTypeTraits<Type>::GetDefaultRepeatedField() {\n  static auto instance = OnShutdownDelete(new RepeatedFieldType);\n  return instance;\n}\n\n// -------------------------------------------------------------------\n// ExtensionIdentifier\n\n// This is the type of actual extension objects.  E.g. if you have:\n//   extends Foo with optional int32 bar = 1234;\n// then \"bar\" will be defined in C++ as:\n//   ExtensionIdentifier<Foo, PrimitiveTypeTraits<int32>, 1, false> bar(1234);\n//\n// Note that we could, in theory, supply the field number as a template\n// parameter, and thus make an instance of ExtensionIdentifier have no\n// actual contents.  However, if we did that, then using at extension\n// identifier would not necessarily cause the compiler to output any sort\n// of reference to any symbol defined in the extension's .pb.o file.  Some\n// linkers will actually drop object files that are not explicitly referenced,\n// but that would be bad because it would cause this extension to not be\n// registered at static initialization, and therefore using it would crash.\n\ntemplate <typename ExtendeeType, typename TypeTraitsType,\n          FieldType field_type, bool is_packed>\nclass ExtensionIdentifier {\n public:\n  typedef TypeTraitsType TypeTraits;\n  typedef ExtendeeType Extendee;\n\n  ExtensionIdentifier(int number, typename TypeTraits::ConstType default_value)\n      : number_(number), default_value_(default_value) {\n    Register(number);\n  }\n  inline int number() const { return number_; }\n  typename TypeTraits::ConstType default_value() const {\n    return default_value_;\n  }\n\n  static void Register(int number) {\n    TypeTraits::template Register<ExtendeeType>(number, field_type, is_packed);\n  }\n\n private:\n  const int number_;\n  typename TypeTraits::ConstType default_value_;\n};\n\n// -------------------------------------------------------------------\n// Generated accessors\n\n// This macro should be expanded in the context of a generated type which\n// has extensions.\n//\n// We use \"_proto_TypeTraits\" as a type name below because \"TypeTraits\"\n// causes problems if the class has a nested message or enum type with that\n// name and \"_TypeTraits\" is technically reserved for the C++ library since\n// it starts with an underscore followed by a capital letter.\n//\n// For similar reason, we use \"_field_type\" and \"_is_packed\" as parameter names\n// below, so that \"field_type\" and \"is_packed\" can be used as field names.\n#define GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(CLASSNAME)                        \\\n  /* Has, Size, Clear */                                                      \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline bool HasExtension(                                                   \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const {   \\\n    return _extensions_.Has(id.number());                                     \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline void ClearExtension(                                                 \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {         \\\n    _extensions_.ClearExtension(id.number());                                 \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline int ExtensionSize(                                                   \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const {   \\\n    return _extensions_.ExtensionSize(id.number());                           \\\n  }                                                                           \\\n                                                                              \\\n  /* Singular accessors */                                                    \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(        \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const {   \\\n    return _proto_TypeTraits::Get(id.number(), _extensions_,                  \\\n                                  id.default_value());                        \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(  \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {         \\\n    return _proto_TypeTraits::Mutable(id.number(), _field_type,               \\\n                                      &_extensions_);                         \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline void SetExtension(                                                   \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \\\n      typename _proto_TypeTraits::Singular::ConstType value) {                \\\n    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);   \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline void SetAllocatedExtension(                                          \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \\\n      typename _proto_TypeTraits::Singular::MutableType value) {              \\\n    _proto_TypeTraits::SetAllocated(id.number(), _field_type,                 \\\n                                    value, &_extensions_);                    \\\n  }                                                                           \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline void UnsafeArenaSetAllocatedExtension(                               \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \\\n      typename _proto_TypeTraits::Singular::MutableType value) {              \\\n    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,      \\\n                                               value, &_extensions_);         \\\n  }                                                                           \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline typename _proto_TypeTraits::Singular::MutableType ReleaseExtension(  \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {         \\\n    return _proto_TypeTraits::Release(id.number(), _field_type,               \\\n                                      &_extensions_);                         \\\n  }                                                                           \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline typename _proto_TypeTraits::Singular::MutableType                    \\\n      UnsafeArenaReleaseExtension(                                            \\\n          const ::google::protobuf::internal::ExtensionIdentifier<                      \\\n            CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {     \\\n    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,    \\\n                                                 &_extensions_);              \\\n  }                                                                           \\\n                                                                              \\\n  /* Repeated accessors */                                                    \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(        \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \\\n      int index) const {                                                      \\\n    return _proto_TypeTraits::Get(id.number(), _extensions_, index);          \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(  \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \\\n      int index) {                                                            \\\n    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);     \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline void SetExtension(                                                   \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \\\n      int index, typename _proto_TypeTraits::Repeated::ConstType value) {     \\\n    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);         \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(      \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) {         \\\n    return _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);   \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline void AddExtension(                                                   \\\n      const ::google::protobuf::internal::ExtensionIdentifier<                          \\\n        CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id,           \\\n      typename _proto_TypeTraits::Repeated::ConstType value) {                \\\n    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed,              \\\n                           value, &_extensions_);                             \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&       \\\n      GetRepeatedExtension(                                                   \\\n          const ::google::protobuf::internal::ExtensionIdentifier<                      \\\n            CLASSNAME, _proto_TypeTraits, _field_type,                        \\\n            _is_packed>& id) const {                                          \\\n    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);         \\\n  }                                                                           \\\n                                                                              \\\n  template <typename _proto_TypeTraits,                                       \\\n            ::google::protobuf::internal::FieldType _field_type,                        \\\n            bool _is_packed>                                                  \\\n  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*             \\\n      MutableRepeatedExtension(                                               \\\n          const ::google::protobuf::internal::ExtensionIdentifier<                      \\\n              CLASSNAME, _proto_TypeTraits, _field_type,                      \\\n              _is_packed>& id) {                                              \\\n    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,       \\\n                                              _is_packed, &_extensions_);     \\\n  }\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_EXTENSION_SET_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/field_mask.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/field_mask.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2ffield_5fmask_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2ffield_5fmask_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2ffield_5fmask_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[1];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto\nnamespace google {\nnamespace protobuf {\nclass FieldMask;\nclass FieldMaskDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern FieldMaskDefaultTypeInternal _FieldMask_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::FieldMask* Arena::CreateMaybeMessage<::google::protobuf::FieldMask>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT FieldMask : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FieldMask) */ {\n public:\n  FieldMask();\n  virtual ~FieldMask();\n\n  FieldMask(const FieldMask& from);\n\n  inline FieldMask& operator=(const FieldMask& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  FieldMask(FieldMask&& from) noexcept\n    : FieldMask() {\n    *this = ::std::move(from);\n  }\n\n  inline FieldMask& operator=(FieldMask&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const FieldMask& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const FieldMask* internal_default_instance() {\n    return reinterpret_cast<const FieldMask*>(\n               &_FieldMask_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void Swap(FieldMask* other);\n  friend void swap(FieldMask& a, FieldMask& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline FieldMask* New() const final {\n    return CreateMaybeMessage<FieldMask>(NULL);\n  }\n\n  FieldMask* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<FieldMask>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const FieldMask& from);\n  void MergeFrom(const FieldMask& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(FieldMask* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated string paths = 1;\n  int paths_size() const;\n  void clear_paths();\n  static const int kPathsFieldNumber = 1;\n  const ::std::string& paths(int index) const;\n  ::std::string* mutable_paths(int index);\n  void set_paths(int index, const ::std::string& value);\n  #if LANG_CXX11\n  void set_paths(int index, ::std::string&& value);\n  #endif\n  void set_paths(int index, const char* value);\n  void set_paths(int index, const char* value, size_t size);\n  ::std::string* add_paths();\n  void add_paths(const ::std::string& value);\n  #if LANG_CXX11\n  void add_paths(::std::string&& value);\n  #endif\n  void add_paths(const char* value);\n  void add_paths(const char* value, size_t size);\n  const ::google::protobuf::RepeatedPtrField< ::std::string>& paths() const;\n  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_paths();\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.FieldMask)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::RepeatedPtrField< ::std::string> paths_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// FieldMask\n\n// repeated string paths = 1;\ninline int FieldMask::paths_size() const {\n  return paths_.size();\n}\ninline void FieldMask::clear_paths() {\n  paths_.Clear();\n}\ninline const ::std::string& FieldMask::paths(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FieldMask.paths)\n  return paths_.Get(index);\n}\ninline ::std::string* FieldMask::mutable_paths(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.FieldMask.paths)\n  return paths_.Mutable(index);\n}\ninline void FieldMask::set_paths(int index, const ::std::string& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths)\n  paths_.Mutable(index)->assign(value);\n}\n#if LANG_CXX11\ninline void FieldMask::set_paths(int index, ::std::string&& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths)\n  paths_.Mutable(index)->assign(std::move(value));\n}\n#endif\ninline void FieldMask::set_paths(int index, const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  paths_.Mutable(index)->assign(value);\n  // @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths)\n}\ninline void FieldMask::set_paths(int index, const char* value, size_t size) {\n  paths_.Mutable(index)->assign(\n    reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldMask.paths)\n}\ninline ::std::string* FieldMask::add_paths() {\n  // @@protoc_insertion_point(field_add_mutable:google.protobuf.FieldMask.paths)\n  return paths_.Add();\n}\ninline void FieldMask::add_paths(const ::std::string& value) {\n  paths_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths)\n}\n#if LANG_CXX11\ninline void FieldMask::add_paths(::std::string&& value) {\n  paths_.Add(std::move(value));\n  // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths)\n}\n#endif\ninline void FieldMask::add_paths(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  paths_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths)\n}\ninline void FieldMask::add_paths(const char* value, size_t size) {\n  paths_.Add()->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_add_pointer:google.protobuf.FieldMask.paths)\n}\ninline const ::google::protobuf::RepeatedPtrField< ::std::string>&\nFieldMask::paths() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.FieldMask.paths)\n  return paths_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::std::string>*\nFieldMask::mutable_paths() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldMask.paths)\n  return &paths_;\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2ffield_5fmask_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/field_mask.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"FieldMaskProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption go_package = \"google.golang.org/genproto/protobuf/field_mask;field_mask\";\n\n// `FieldMask` represents a set of symbolic field paths, for example:\n//\n//     paths: \"f.a\"\n//     paths: \"f.b.d\"\n//\n// Here `f` represents a field in some root message, `a` and `b`\n// fields in the message found in `f`, and `d` a field found in the\n// message in `f.b`.\n//\n// Field masks are used to specify a subset of fields that should be\n// returned by a get operation or modified by an update operation.\n// Field masks also have a custom JSON encoding (see below).\n//\n// # Field Masks in Projections\n//\n// When used in the context of a projection, a response message or\n// sub-message is filtered by the API to only contain those fields as\n// specified in the mask. For example, if the mask in the previous\n// example is applied to a response message as follows:\n//\n//     f {\n//       a : 22\n//       b {\n//         d : 1\n//         x : 2\n//       }\n//       y : 13\n//     }\n//     z: 8\n//\n// The result will not contain specific values for fields x,y and z\n// (their value will be set to the default, and omitted in proto text\n// output):\n//\n//\n//     f {\n//       a : 22\n//       b {\n//         d : 1\n//       }\n//     }\n//\n// A repeated field is not allowed except at the last position of a\n// paths string.\n//\n// If a FieldMask object is not present in a get operation, the\n// operation applies to all fields (as if a FieldMask of all fields\n// had been specified).\n//\n// Note that a field mask does not necessarily apply to the\n// top-level response message. In case of a REST get operation, the\n// field mask applies directly to the response, but in case of a REST\n// list operation, the mask instead applies to each individual message\n// in the returned resource list. In case of a REST custom method,\n// other definitions may be used. Where the mask applies will be\n// clearly documented together with its declaration in the API.  In\n// any case, the effect on the returned resource/resources is required\n// behavior for APIs.\n//\n// # Field Masks in Update Operations\n//\n// A field mask in update operations specifies which fields of the\n// targeted resource are going to be updated. The API is required\n// to only change the values of the fields as specified in the mask\n// and leave the others untouched. If a resource is passed in to\n// describe the updated values, the API ignores the values of all\n// fields not covered by the mask.\n//\n// If a repeated field is specified for an update operation, the existing\n// repeated values in the target resource will be overwritten by the new values.\n// Note that a repeated field is only allowed in the last position of a `paths`\n// string.\n//\n// If a sub-message is specified in the last position of the field mask for an\n// update operation, then the existing sub-message in the target resource is\n// overwritten. Given the target message:\n//\n//     f {\n//       b {\n//         d : 1\n//         x : 2\n//       }\n//       c : 1\n//     }\n//\n// And an update message:\n//\n//     f {\n//       b {\n//         d : 10\n//       }\n//     }\n//\n// then if the field mask is:\n//\n//  paths: \"f.b\"\n//\n// then the result will be:\n//\n//     f {\n//       b {\n//         d : 10\n//       }\n//       c : 1\n//     }\n//\n// However, if the update mask was:\n//\n//  paths: \"f.b.d\"\n//\n// then the result would be:\n//\n//     f {\n//       b {\n//         d : 10\n//         x : 2\n//       }\n//       c : 1\n//     }\n//\n// In order to reset a field's value to the default, the field must\n// be in the mask and set to the default value in the provided resource.\n// Hence, in order to reset all fields of a resource, provide a default\n// instance of the resource and set all fields in the mask, or do\n// not provide a mask as described below.\n//\n// If a field mask is not present on update, the operation applies to\n// all fields (as if a field mask of all fields has been specified).\n// Note that in the presence of schema evolution, this may mean that\n// fields the client does not know and has therefore not filled into\n// the request will be reset to their default. If this is unwanted\n// behavior, a specific service may require a client to always specify\n// a field mask, producing an error if not.\n//\n// As with get operations, the location of the resource which\n// describes the updated values in the request message depends on the\n// operation kind. In any case, the effect of the field mask is\n// required to be honored by the API.\n//\n// ## Considerations for HTTP REST\n//\n// The HTTP kind of an update operation which uses a field mask must\n// be set to PATCH instead of PUT in order to satisfy HTTP semantics\n// (PUT must only be used for full updates).\n//\n// # JSON Encoding of Field Masks\n//\n// In JSON, a field mask is encoded as a single string where paths are\n// separated by a comma. Fields name in each path are converted\n// to/from lower-camel naming conventions.\n//\n// As an example, consider the following message declarations:\n//\n//     message Profile {\n//       User user = 1;\n//       Photo photo = 2;\n//     }\n//     message User {\n//       string display_name = 1;\n//       string address = 2;\n//     }\n//\n// In proto a field mask for `Profile` may look as such:\n//\n//     mask {\n//       paths: \"user.display_name\"\n//       paths: \"photo\"\n//     }\n//\n// In JSON, the same mask is represented as below:\n//\n//     {\n//       mask: \"user.displayName,photo\"\n//     }\n//\n// # Field Masks and Oneof Fields\n//\n// Field masks treat fields in oneofs just as regular fields. Consider the\n// following message:\n//\n//     message SampleMessage {\n//       oneof test_oneof {\n//         string name = 4;\n//         SubMessage sub_message = 9;\n//       }\n//     }\n//\n// The field mask can be:\n//\n//     mask {\n//       paths: \"name\"\n//     }\n//\n// Or:\n//\n//     mask {\n//       paths: \"sub_message\"\n//     }\n//\n// Note that oneof type names (\"test_oneof\" in this case) cannot be used in\n// paths.\n//\n// ## Field Mask Verification\n//\n// The implementation of any API method which has a FieldMask type field in the\n// request should verify the included field paths, and return an\n// `INVALID_ARGUMENT` error if any path is duplicated or unmappable.\nmessage FieldMask {\n  // The set of field mask paths.\n  repeated string paths = 1;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/generated_enum_reflection.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: jasonh@google.com (Jason Hsueh)\n//\n// This header is logically internal, but is made public because it is used\n// from protocol-compiler-generated code, which may reside in other components.\n// It provides reflection support for generated enums, and is included in\n// generated .pb.h files and should have minimal dependencies. The methods are\n// implemented in generated_message_reflection.cc.\n\n#ifndef GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__\n#define GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__\n\n#include <string>\n\n#include <google/protobuf/generated_enum_util.h>\n\nnamespace google {\nnamespace protobuf {\n  class EnumDescriptor;\n}  // namespace protobuf\n\nnamespace protobuf {\n\n// Returns the EnumDescriptor for enum type E, which must be a\n// proto-declared enum type.  Code generated by the protocol compiler\n// will include specializations of this template for each enum type declared.\ntemplate <typename E>\nconst EnumDescriptor* GetEnumDescriptor();\n\nnamespace internal {\n\n// Helper for EnumType_Parse functions: try to parse the string 'name' as an\n// enum name of the given type, returning true and filling in value on success,\n// or returning false and leaving value unchanged on failure.\nLIBPROTOBUF_EXPORT bool ParseNamedEnum(const EnumDescriptor* descriptor,\n                    const string& name,\n                    int* value);\n\ntemplate<typename EnumType>\nbool ParseNamedEnum(const EnumDescriptor* descriptor,\n                    const string& name,\n                    EnumType* value) {\n  int tmp;\n  if (!ParseNamedEnum(descriptor, name, &tmp)) return false;\n  *value = static_cast<EnumType>(tmp);\n  return true;\n}\n\n// Just a wrapper around printing the name of a value. The main point of this\n// function is not to be inlined, so that you can do this without including\n// descriptor.h.\nLIBPROTOBUF_EXPORT const string& NameOfEnum(const EnumDescriptor* descriptor, int value);\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/generated_enum_util.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__\n#define GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__\n\n#include <type_traits>\n\nnamespace google {\nnamespace protobuf {\n\n// This type trait can be used to cause templates to only match proto2 enum\n// types.\ntemplate <typename T> struct is_proto_enum : ::std::false_type {};\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/generated_message_reflection.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This header is logically internal, but is made public because it is used\n// from protocol-compiler-generated code, which may reside in other components.\n\n#ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__\n#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__\n\n#include <string>\n#include <vector>\n#include <google/protobuf/stubs/casts.h>\n#include <google/protobuf/stubs/common.h>\n// TODO(jasonh): Remove this once the compiler change to directly include this\n// is released to components.\n#include <google/protobuf/generated_enum_reflection.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/unknown_field_set.h>\n\n\nnamespace google {\nnamespace upb {\nnamespace google_opensource {\nclass GMR_Handlers;\n}  // namespace google_opensource\n}  // namespace upb\n\nnamespace protobuf {\nclass DescriptorPool;\nclass MapKey;\nclass MapValueRef;\n}  // namespace protobuf\n\n\nnamespace protobuf {\nnamespace flat {\nclass MetadataBuilder;\n}  // namespace flat\n}  // namespace protobuf\n\n\nnamespace protobuf {\nnamespace internal {\nclass DefaultEmptyOneof;\n\n// Defined in this file.\nclass GeneratedMessageReflection;\n\n// Defined in other files.\nclass ExtensionSet;             // extension_set.h\nclass WeakFieldMap;             // weak_field_map.h\n\n// This struct describes the internal layout of the message, hence this is\n// used to act on the message reflectively.\n//   default_instance:  The default instance of the message.  This is only\n//                  used to obtain pointers to default instances of embedded\n//                  messages, which GetMessage() will return if the particular\n//                  sub-message has not been initialized yet.  (Thus, all\n//                  embedded message fields *must* have non-NULL pointers\n//                  in the default instance.)\n//   offsets:       An array of ints giving the byte offsets.\n//                  For each oneof or weak field, the offset is relative to the\n//                  default_instance. These can be computed at compile time\n//                  using the\n//                  PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET()\n//                  macro. For each none oneof field, the offset is related to\n//                  the start of the message object.  These can be computed at\n//                  compile time using the\n//                  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET() macro.\n//                  Besides offsets for all fields, this array also contains\n//                  offsets for oneof unions. The offset of the i-th oneof union\n//                  is offsets[descriptor->field_count() + i].\n//   has_bit_indices:  Mapping from field indexes to their index in the has\n//                  bit array.\n//   has_bits_offset:  Offset in the message of an array of uint32s of size\n//                  descriptor->field_count()/32, rounded up.  This is a\n//                  bitfield where each bit indicates whether or not the\n//                  corresponding field of the message has been initialized.\n//                  The bit for field index i is obtained by the expression:\n//                    has_bits[i / 32] & (1 << (i % 32))\n//   unknown_fields_offset:  Offset in the message of the UnknownFieldSet for\n//                  the message.\n//   extensions_offset:  Offset in the message of the ExtensionSet for the\n//                  message, or -1 if the message type has no extension\n//                  ranges.\n//   oneof_case_offset:  Offset in the message of an array of uint32s of\n//                  size descriptor->oneof_decl_count().  Each uint32\n//                  indicates what field is set for each oneof.\n//   object_size:   The size of a message object of this type, as measured\n//                  by sizeof().\n//   arena_offset:  If a message doesn't have a unknown_field_set that stores\n//                  the arena, it must have a direct pointer to the arena.\n//   weak_field_map_offset: If the message proto has weak fields, this is the\n//                  offset of _weak_field_map_ in the generated proto. Otherwise\n//                  -1.\nstruct ReflectionSchema {\n public:\n  // Size of a google::protobuf::Message object of this type.\n  uint32 GetObjectSize() const { return static_cast<uint32>(object_size_); }\n\n  // Offset of a non-oneof field.  Getting a field offset is slightly more\n  // efficient when we know statically that it is not a oneof field.\n  uint32 GetFieldOffsetNonOneof(const FieldDescriptor* field) const {\n    GOOGLE_DCHECK(!field->containing_oneof());\n    return OffsetValue(offsets_[field->index()], field->type());\n  }\n\n  // Offset of any field.\n  uint32 GetFieldOffset(const FieldDescriptor* field) const {\n    if (field->containing_oneof()) {\n      size_t offset =\n          static_cast<size_t>(field->containing_type()->field_count() +\n          field->containing_oneof()->index());\n      return OffsetValue(offsets_[offset], field->type());\n    } else {\n      return GetFieldOffsetNonOneof(field);\n    }\n  }\n\n  bool IsFieldInlined(const FieldDescriptor* field) const {\n    if (field->containing_oneof()) {\n      size_t offset =\n          static_cast<size_t>(field->containing_type()->field_count() +\n                              field->containing_oneof()->index());\n      return Inlined(offsets_[offset], field->type());\n    } else {\n      return Inlined(offsets_[field->index()], field->type());\n    }\n  }\n\n  uint32 GetOneofCaseOffset(const OneofDescriptor* oneof_descriptor) const {\n    return static_cast<uint32>(oneof_case_offset_) +\n           static_cast<uint32>(\n               static_cast<size_t>(oneof_descriptor->index()) * sizeof(uint32));\n  }\n\n  bool HasHasbits() const { return has_bits_offset_ != -1; }\n\n  // Bit index within the bit array of hasbits.  Bit order is low-to-high.\n  uint32 HasBitIndex(const FieldDescriptor* field) const {\n    GOOGLE_DCHECK(HasHasbits());\n    return has_bit_indices_[field->index()];\n  }\n\n  // Byte offset of the hasbits array.\n  uint32 HasBitsOffset() const {\n    GOOGLE_DCHECK(HasHasbits());\n    return static_cast<uint32>(has_bits_offset_);\n  }\n\n  // The offset of the InternalMetadataWithArena member.\n  // For Lite this will actually be an InternalMetadataWithArenaLite.\n  // The schema doesn't contain enough information to distinguish between\n  // these two cases.\n  uint32 GetMetadataOffset() const {\n    return static_cast<uint32>(metadata_offset_);\n  }\n\n  // Whether this message has an ExtensionSet.\n  bool HasExtensionSet() const { return extensions_offset_ != -1; }\n\n  // The offset of the ExtensionSet in this message.\n  uint32 GetExtensionSetOffset() const {\n    GOOGLE_DCHECK(HasExtensionSet());\n    return static_cast<uint32>(extensions_offset_);\n  }\n\n  // The off set of WeakFieldMap when the message contains weak fields.\n  // The default is 0 for now.\n  int GetWeakFieldMapOffset() const { return weak_field_map_offset_; }\n\n  bool IsDefaultInstance(const Message& message) const {\n    return &message == default_instance_;\n  }\n\n  // Returns a pointer to the default value for this field.  The size and type\n  // of the underlying data depends on the field's type.\n  const void *GetFieldDefault(const FieldDescriptor* field) const {\n    return reinterpret_cast<const uint8*>(default_instance_) +\n           OffsetValue(offsets_[field->index()], field->type());\n  }\n\n\n  bool HasWeakFields() const { return weak_field_map_offset_ > 0; }\n\n  // These members are intended to be private, but we cannot actually make them\n  // private because this prevents us from using aggregate initialization of\n  // them, ie.\n  //\n  //   ReflectionSchema schema = {a, b, c, d, e, ...};\n // private:\n  const Message* default_instance_;\n  const uint32* offsets_;\n  const uint32* has_bit_indices_;\n  int has_bits_offset_;\n  int metadata_offset_;\n  int extensions_offset_;\n  int oneof_case_offset_;\n  int object_size_;\n  int weak_field_map_offset_;\n\n  // We tag offset values to provide additional data about fields (such as\n  // inlined).\n  static uint32 OffsetValue(uint32 v, FieldDescriptor::Type type) {\n    if (type == FieldDescriptor::TYPE_STRING ||\n        type == FieldDescriptor::TYPE_BYTES) {\n      return v & ~1u;\n    } else {\n      return v;\n    }\n  }\n\n  static bool Inlined(uint32 v, FieldDescriptor::Type type) {\n    if (type == FieldDescriptor::TYPE_STRING ||\n        type == FieldDescriptor::TYPE_BYTES) {\n      return v & 1u;\n    } else {\n      // Non string/byte fields are not inlined.\n      return false;\n    }\n  }\n};\n\n// Structs that the code generator emits directly to describe a message.\n// These should never used directly except to build a ReflectionSchema\n// object.\n//\n// EXPERIMENTAL: these are changing rapidly, and may completely disappear\n// or merge with ReflectionSchema.\nstruct MigrationSchema {\n  int32 offsets_index;\n  int32 has_bit_indices_index;\n  int object_size;\n};\n\n// THIS CLASS IS NOT INTENDED FOR DIRECT USE.  It is intended for use\n// by generated code.  This class is just a big hack that reduces code\n// size.\n//\n// A GeneratedMessageReflection is an implementation of Reflection\n// which expects all fields to be backed by simple variables located in\n// memory.  The locations are given using a base pointer and a set of\n// offsets.\n//\n// It is required that the user represents fields of each type in a standard\n// way, so that GeneratedMessageReflection can cast the void* pointer to\n// the appropriate type.  For primitive fields and string fields, each field\n// should be represented using the obvious C++ primitive type.  Enums and\n// Messages are different:\n//  - Singular Message fields are stored as a pointer to a Message.  These\n//    should start out NULL, except for in the default instance where they\n//    should start out pointing to other default instances.\n//  - Enum fields are stored as an int.  This int must always contain\n//    a valid value, such that EnumDescriptor::FindValueByNumber() would\n//    not return NULL.\n//  - Repeated fields are stored as RepeatedFields or RepeatedPtrFields\n//    of whatever type the individual field would be.  Strings and\n//    Messages use RepeatedPtrFields while everything else uses\n//    RepeatedFields.\nclass GeneratedMessageReflection final : public Reflection {\n public:\n  // Constructs a GeneratedMessageReflection.\n  // Parameters:\n  //   descriptor:    The descriptor for the message type being implemented.\n  //   schema:        The description of the internal guts of the message.\n  //   pool:          DescriptorPool to search for extension definitions.  Only\n  //                  used by FindKnownExtensionByName() and\n  //                  FindKnownExtensionByNumber().\n  //   factory:       MessageFactory to use to construct extension messages.\n  GeneratedMessageReflection(const Descriptor* descriptor,\n                             const ReflectionSchema& schema,\n                             const DescriptorPool* pool,\n                             MessageFactory* factory);\n\n  ~GeneratedMessageReflection();\n\n  // implements Reflection -------------------------------------------\n\n  const UnknownFieldSet& GetUnknownFields(const Message& message) const;\n  UnknownFieldSet* MutableUnknownFields(Message* message) const;\n\n  size_t SpaceUsedLong(const Message& message) const;\n\n  bool HasField(const Message& message, const FieldDescriptor* field) const;\n  int FieldSize(const Message& message, const FieldDescriptor* field) const;\n  void ClearField(Message* message, const FieldDescriptor* field) const;\n  bool HasOneof(const Message& message,\n                const OneofDescriptor* oneof_descriptor) const;\n  void ClearOneof(Message* message, const OneofDescriptor* field) const;\n  void RemoveLast(Message* message, const FieldDescriptor* field) const;\n  Message* ReleaseLast(Message* message, const FieldDescriptor* field) const;\n  void Swap(Message* message1, Message* message2) const;\n  void SwapFields(Message* message1, Message* message2,\n                  const std::vector<const FieldDescriptor*>& fields) const;\n  void SwapElements(Message* message, const FieldDescriptor* field,\n                    int index1, int index2) const;\n  void ListFields(const Message& message,\n                  std::vector<const FieldDescriptor*>* output) const;\n\n  int32  GetInt32 (const Message& message,\n                   const FieldDescriptor* field) const;\n  int64  GetInt64 (const Message& message,\n                   const FieldDescriptor* field) const;\n  uint32 GetUInt32(const Message& message,\n                   const FieldDescriptor* field) const;\n  uint64 GetUInt64(const Message& message,\n                   const FieldDescriptor* field) const;\n  float  GetFloat (const Message& message,\n                   const FieldDescriptor* field) const;\n  double GetDouble(const Message& message,\n                   const FieldDescriptor* field) const;\n  bool   GetBool  (const Message& message,\n                   const FieldDescriptor* field) const;\n  string GetString(const Message& message,\n                   const FieldDescriptor* field) const;\n  const string& GetStringReference(const Message& message,\n                                   const FieldDescriptor* field,\n                                   string* scratch) const;\n  const EnumValueDescriptor* GetEnum(const Message& message,\n                                     const FieldDescriptor* field) const;\n  int GetEnumValue(const Message& message,\n                   const FieldDescriptor* field) const;\n  const Message& GetMessage(const Message& message,\n                            const FieldDescriptor* field,\n                            MessageFactory* factory = NULL) const;\n\n  const FieldDescriptor* GetOneofFieldDescriptor(\n      const Message& message,\n      const OneofDescriptor* oneof_descriptor) const;\n\n private:\n  bool ContainsMapKey(const Message& message,\n                      const FieldDescriptor* field,\n                      const MapKey& key) const;\n  bool InsertOrLookupMapValue(Message* message,\n                              const FieldDescriptor* field,\n                              const MapKey& key,\n                              MapValueRef* val) const;\n  bool DeleteMapValue(Message* message,\n                      const FieldDescriptor* field,\n                      const MapKey& key) const;\n  MapIterator MapBegin(\n      Message* message,\n      const FieldDescriptor* field) const;\n  MapIterator MapEnd(\n      Message* message,\n      const FieldDescriptor* field) const;\n  int MapSize(const Message& message, const FieldDescriptor* field) const;\n\n public:\n  void SetInt32 (Message* message,\n                 const FieldDescriptor* field, int32  value) const;\n  void SetInt64 (Message* message,\n                 const FieldDescriptor* field, int64  value) const;\n  void SetUInt32(Message* message,\n                 const FieldDescriptor* field, uint32 value) const;\n  void SetUInt64(Message* message,\n                 const FieldDescriptor* field, uint64 value) const;\n  void SetFloat (Message* message,\n                 const FieldDescriptor* field, float  value) const;\n  void SetDouble(Message* message,\n                 const FieldDescriptor* field, double value) const;\n  void SetBool  (Message* message,\n                 const FieldDescriptor* field, bool   value) const;\n  void SetString(Message* message,\n                 const FieldDescriptor* field,\n                 const string& value) const;\n  void SetEnum  (Message* message, const FieldDescriptor* field,\n                 const EnumValueDescriptor* value) const;\n  void SetEnumValue(Message* message, const FieldDescriptor* field,\n                    int value) const;\n  Message* MutableMessage(Message* message, const FieldDescriptor* field,\n                          MessageFactory* factory = NULL) const;\n  void SetAllocatedMessage(Message* message,\n                           Message* sub_message,\n                           const FieldDescriptor* field) const;\n  Message* ReleaseMessage(Message* message, const FieldDescriptor* field,\n                          MessageFactory* factory = NULL) const;\n\n  int32  GetRepeatedInt32 (const Message& message,\n                           const FieldDescriptor* field, int index) const;\n  int64  GetRepeatedInt64 (const Message& message,\n                           const FieldDescriptor* field, int index) const;\n  uint32 GetRepeatedUInt32(const Message& message,\n                           const FieldDescriptor* field, int index) const;\n  uint64 GetRepeatedUInt64(const Message& message,\n                           const FieldDescriptor* field, int index) const;\n  float  GetRepeatedFloat (const Message& message,\n                           const FieldDescriptor* field, int index) const;\n  double GetRepeatedDouble(const Message& message,\n                           const FieldDescriptor* field, int index) const;\n  bool   GetRepeatedBool  (const Message& message,\n                           const FieldDescriptor* field, int index) const;\n  string GetRepeatedString(const Message& message,\n                           const FieldDescriptor* field, int index) const;\n  const string& GetRepeatedStringReference(const Message& message,\n                                           const FieldDescriptor* field,\n                                           int index, string* scratch) const;\n  const EnumValueDescriptor* GetRepeatedEnum(const Message& message,\n                                             const FieldDescriptor* field,\n                                             int index) const;\n  int GetRepeatedEnumValue(const Message& message,\n                           const FieldDescriptor* field,\n                           int index) const;\n  const Message& GetRepeatedMessage(const Message& message,\n                                    const FieldDescriptor* field,\n                                    int index) const;\n\n  // Set the value of a field.\n  void SetRepeatedInt32 (Message* message,\n                         const FieldDescriptor* field, int index, int32  value) const;\n  void SetRepeatedInt64 (Message* message,\n                         const FieldDescriptor* field, int index, int64  value) const;\n  void SetRepeatedUInt32(Message* message,\n                         const FieldDescriptor* field, int index, uint32 value) const;\n  void SetRepeatedUInt64(Message* message,\n                         const FieldDescriptor* field, int index, uint64 value) const;\n  void SetRepeatedFloat (Message* message,\n                         const FieldDescriptor* field, int index, float  value) const;\n  void SetRepeatedDouble(Message* message,\n                         const FieldDescriptor* field, int index, double value) const;\n  void SetRepeatedBool  (Message* message,\n                         const FieldDescriptor* field, int index, bool   value) const;\n  void SetRepeatedString(Message* message,\n                         const FieldDescriptor* field, int index,\n                         const string& value) const;\n  void SetRepeatedEnum(Message* message, const FieldDescriptor* field,\n                       int index, const EnumValueDescriptor* value) const;\n  void SetRepeatedEnumValue(Message* message, const FieldDescriptor* field,\n                            int index, int value) const;\n  // Get a mutable pointer to a field with a message type.\n  Message* MutableRepeatedMessage(Message* message,\n                                  const FieldDescriptor* field,\n                                  int index) const;\n\n  void AddInt32 (Message* message,\n                 const FieldDescriptor* field, int32  value) const;\n  void AddInt64 (Message* message,\n                 const FieldDescriptor* field, int64  value) const;\n  void AddUInt32(Message* message,\n                 const FieldDescriptor* field, uint32 value) const;\n  void AddUInt64(Message* message,\n                 const FieldDescriptor* field, uint64 value) const;\n  void AddFloat (Message* message,\n                 const FieldDescriptor* field, float  value) const;\n  void AddDouble(Message* message,\n                 const FieldDescriptor* field, double value) const;\n  void AddBool  (Message* message,\n                 const FieldDescriptor* field, bool   value) const;\n  void AddString(Message* message,\n                 const FieldDescriptor* field, const string& value) const;\n  void AddEnum(Message* message,\n               const FieldDescriptor* field,\n               const EnumValueDescriptor* value) const;\n  void AddEnumValue(Message* message,\n                    const FieldDescriptor* field,\n                    int value) const;\n  Message* AddMessage(Message* message, const FieldDescriptor* field,\n                      MessageFactory* factory = NULL) const;\n  void AddAllocatedMessage(\n      Message* message, const FieldDescriptor* field,\n      Message* new_entry) const;\n\n  const FieldDescriptor* FindKnownExtensionByName(const string& name) const;\n  const FieldDescriptor* FindKnownExtensionByNumber(int number) const;\n\n  bool SupportsUnknownEnumValues() const;\n\n  // This value for arena_offset_ indicates that there is no arena pointer in\n  // this message (e.g., old generated code).\n  static const int kNoArenaPointer = -1;\n\n  // This value for unknown_field_offset_ indicates that there is no\n  // UnknownFieldSet in this message, and that instead, we are using the\n  // Zero-Overhead Arena Pointer trick. When this is the case, arena_offset_\n  // actually indexes to an InternalMetadataWithArena instance, which can return\n  // either an arena pointer or an UnknownFieldSet or both. It is never the case\n  // that unknown_field_offset_ == kUnknownFieldSetInMetadata && arena_offset_\n  // == kNoArenaPointer.\n  static const int kUnknownFieldSetInMetadata = -1;\n\n protected:\n  void* MutableRawRepeatedField(\n      Message* message, const FieldDescriptor* field, FieldDescriptor::CppType,\n      int ctype, const Descriptor* desc) const;\n\n  const void* GetRawRepeatedField(\n      const Message& message, const FieldDescriptor* field,\n      FieldDescriptor::CppType, int ctype,\n      const Descriptor* desc) const;\n\n  virtual MessageFactory* GetMessageFactory() const;\n\n  virtual void* RepeatedFieldData(\n      Message* message, const FieldDescriptor* field,\n      FieldDescriptor::CppType cpp_type,\n      const Descriptor* message_type) const;\n\n private:\n  friend class google::protobuf::flat::MetadataBuilder;\n  friend class upb::google_opensource::GMR_Handlers;\n\n  const Descriptor* const descriptor_;\n  const ReflectionSchema schema_;\n  const DescriptorPool* const descriptor_pool_;\n  MessageFactory* const message_factory_;\n\n  // Last non weak field index. This is an optimization when most weak fields\n  // are at the end of the containing message. If a message proto doesn't\n  // contain weak fields, then this field equals descriptor_->field_count().\n  int last_non_weak_field_index_;\n\n  template <class T>\n  const T& GetRawNonOneof(const Message& message,\n                          const FieldDescriptor* field) const;\n  template <class T>\n  T* MutableRawNonOneof(Message* message, const FieldDescriptor* field) const;\n\n  template <typename Type>\n  const Type& GetRaw(const Message& message,\n                            const FieldDescriptor* field) const;\n  template <typename Type>\n  inline Type* MutableRaw(Message* message,\n                          const FieldDescriptor* field) const;\n  template <typename Type>\n  inline const Type& DefaultRaw(const FieldDescriptor* field) const;\n\n  inline const uint32* GetHasBits(const Message& message) const;\n  inline uint32* MutableHasBits(Message* message) const;\n  inline uint32 GetOneofCase(\n      const Message& message,\n      const OneofDescriptor* oneof_descriptor) const;\n  inline uint32* MutableOneofCase(\n      Message* message,\n      const OneofDescriptor* oneof_descriptor) const;\n  inline const ExtensionSet& GetExtensionSet(const Message& message) const;\n  inline ExtensionSet* MutableExtensionSet(Message* message) const;\n  inline Arena* GetArena(Message* message) const;\n\n  inline const InternalMetadataWithArena& GetInternalMetadataWithArena(\n      const Message& message) const;\n\n  inline InternalMetadataWithArena*\n      MutableInternalMetadataWithArena(Message* message) const;\n\n  inline bool IsInlined(const FieldDescriptor* field) const;\n\n  inline bool HasBit(const Message& message,\n                     const FieldDescriptor* field) const;\n  inline void SetBit(Message* message,\n                     const FieldDescriptor* field) const;\n  inline void ClearBit(Message* message,\n                       const FieldDescriptor* field) const;\n  inline void SwapBit(Message* message1,\n                      Message* message2,\n                      const FieldDescriptor* field) const;\n\n  // This function only swaps the field. Should swap corresponding has_bit\n  // before or after using this function.\n  void SwapField(Message* message1,\n                 Message* message2,\n                 const FieldDescriptor* field) const;\n\n  void SwapOneofField(Message* message1,\n                      Message* message2,\n                      const OneofDescriptor* oneof_descriptor) const;\n\n  inline bool HasOneofField(const Message& message,\n                            const FieldDescriptor* field) const;\n  inline void SetOneofCase(Message* message,\n                           const FieldDescriptor* field) const;\n  inline void ClearOneofField(Message* message,\n                              const FieldDescriptor* field) const;\n\n  template <typename Type>\n  inline const Type& GetField(const Message& message,\n                              const FieldDescriptor* field) const;\n  template <typename Type>\n  inline void SetField(Message* message,\n                       const FieldDescriptor* field, const Type& value) const;\n  template <typename Type>\n  inline Type* MutableField(Message* message,\n                            const FieldDescriptor* field) const;\n  template <typename Type>\n  inline const Type& GetRepeatedField(const Message& message,\n                                      const FieldDescriptor* field,\n                                      int index) const;\n  template <typename Type>\n  inline const Type& GetRepeatedPtrField(const Message& message,\n                                         const FieldDescriptor* field,\n                                         int index) const;\n  template <typename Type>\n  inline void SetRepeatedField(Message* message,\n                               const FieldDescriptor* field, int index,\n                               Type value) const;\n  template <typename Type>\n  inline Type* MutableRepeatedField(Message* message,\n                                    const FieldDescriptor* field,\n                                    int index) const;\n  template <typename Type>\n  inline void AddField(Message* message,\n                       const FieldDescriptor* field, const Type& value) const;\n  template <typename Type>\n  inline Type* AddField(Message* message,\n                        const FieldDescriptor* field) const;\n\n  int GetExtensionNumberOrDie(const Descriptor* type) const;\n\n  // Internal versions of EnumValue API perform no checking. Called after checks\n  // by public methods.\n  void SetEnumValueInternal(Message* message,\n                            const FieldDescriptor* field,\n                            int value) const;\n  void SetRepeatedEnumValueInternal(Message* message,\n                                    const FieldDescriptor* field,\n                                    int index,\n                                    int value) const;\n  void AddEnumValueInternal(Message* message,\n                            const FieldDescriptor* field,\n                            int value) const;\n\n\n  Message* UnsafeArenaReleaseMessage(Message* message,\n                                     const FieldDescriptor* field,\n                                     MessageFactory* factory = NULL) const;\n\n  void UnsafeArenaSetAllocatedMessage(Message* message,\n                                      Message* sub_message,\n                                      const FieldDescriptor* field) const;\n\n  internal::MapFieldBase* MapData(\n      Message* message, const FieldDescriptor* field) const;\n\n  friend inline  // inline so nobody can call this function.\n      void\n      RegisterAllTypesInternal(const Metadata* file_level_metadata, int size);\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GeneratedMessageReflection);\n};\n\n// There are some places in proto2 where dynamic_cast would be useful as an\n// optimization.  For example, take Message::MergeFrom(const Message& other).\n// For a given generated message FooMessage, we generate these two methods:\n//   void MergeFrom(const FooMessage& other);\n//   void MergeFrom(const Message& other);\n// The former method can be implemented directly in terms of FooMessage's\n// inline accessors, but the latter method must work with the reflection\n// interface.  However, if the parameter to the latter method is actually of\n// type FooMessage, then we'd like to be able to just call the other method\n// as an optimization.  So, we use dynamic_cast to check this.\n//\n// That said, dynamic_cast requires RTTI, which many people like to disable\n// for performance and code size reasons.  When RTTI is not available, we\n// still need to produce correct results.  So, in this case we have to fall\n// back to using reflection, which is what we would have done anyway if the\n// objects were not of the exact same class.\n//\n// dynamic_cast_if_available() implements this logic.  If RTTI is\n// enabled, it does a dynamic_cast.  If RTTI is disabled, it just returns\n// NULL.\ntemplate<typename To, typename From>\ninline To dynamic_cast_if_available(From from) {\n#ifdef GOOGLE_PROTOBUF_NO_RTTI\n  // Avoid the compiler warning about unused variables.\n  (void)from;\n  return NULL;\n#else\n  return dynamic_cast<To>(from);\n#endif\n}\n\n// Tries to downcast this message to a generated message type.\n// Returns NULL if this class is not an instance of T.\n//\n// This is like dynamic_cast_if_available, except it works even when\n// dynamic_cast is not available by using Reflection.  However it only works\n// with Message objects.\n//\n// TODO(haberman): can we remove dynamic_cast_if_available in favor of this?\ntemplate <typename T>\nT* DynamicCastToGenerated(const Message* from) {\n  // Compile-time assert that T is a generated type that has a\n  // default_instance() accessor, but avoid actually calling it.\n  const T&(*get_default_instance)() = &T::default_instance;\n  (void)get_default_instance;\n\n  // Compile-time assert that T is a subclass of google::protobuf::Message.\n  const Message* unused = static_cast<T*>(NULL);\n  (void)unused;\n\n#ifdef GOOGLE_PROTOBUF_NO_RTTI\n  bool ok = &T::default_instance() ==\n            from->GetReflection()->GetMessageFactory()->GetPrototype(\n                from->GetDescriptor());\n  return ok ? down_cast<T*>(from) : NULL;\n#else\n  return dynamic_cast<T*>(from);\n#endif\n}\n\ntemplate <typename T>\nT* DynamicCastToGenerated(Message* from) {\n  const Message* message_const = from;\n  return const_cast<T*>(DynamicCastToGenerated<const T>(message_const));\n}\n\nLIBPROTOBUF_EXPORT void AssignDescriptors(\n    const string& filename, const MigrationSchema* schemas,\n    const Message* const* default_instances_, const uint32* offsets,\n    // update the following descriptor arrays.\n    Metadata* file_level_metadata,\n    const EnumDescriptor** file_level_enum_descriptors,\n    const ServiceDescriptor** file_level_service_descriptors);\n\nLIBPROTOBUF_EXPORT void RegisterAllTypes(const Metadata* file_level_metadata, int size);\n\n// These cannot be in lite so we put them in the reflection.\nLIBPROTOBUF_EXPORT void UnknownFieldSetSerializer(const uint8* base, uint32 offset, uint32 tag,\n                               uint32 has_offset,\n                               ::google::protobuf::io::CodedOutputStream* output);\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/generated_message_table_driven.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_H__\n#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_H__\n\n#include <google/protobuf/map.h>\n#include <google/protobuf/map_entry_lite.h>\n#include <google/protobuf/map_field_lite.h>\n#include <google/protobuf/message_lite.h>\n#include <google/protobuf/wire_format_lite.h>\n#include <google/protobuf/wire_format_lite_inl.h>\n\n// We require C++11 and Clang to use constexpr for variables, as GCC 4.8\n// requires constexpr to be consistent between declarations of variables\n// unnecessarily (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58541).\n// VS 2017 Update 3 also supports this usage of constexpr.\n#if defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1911)\n#define PROTOBUF_CONSTEXPR_VAR constexpr\n#else  // !__clang__\n#define PROTOBUF_CONSTEXPR_VAR\n#endif  // !_clang\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// Processing-type masks.\nstatic constexpr const unsigned char kOneofMask = 0x40;\nstatic constexpr const unsigned char kRepeatedMask = 0x20;\n// Mask for the raw type: either a WireFormatLite::FieldType or one of the\n// ProcessingTypes below, without the oneof or repeated flag.\nstatic constexpr const unsigned char kTypeMask = 0x1f;\n\n// Wire type masks.\nstatic constexpr const unsigned char kNotPackedMask = 0x10;\nstatic constexpr const unsigned char kInvalidMask = 0x20;\n\nenum ProcessingTypes {\n  TYPE_STRING_INLINED = 23,\n  TYPE_BYTES_INLINED = 24,\n  TYPE_MAP = 25,\n};\n\nstatic_assert(TYPE_MAP < kRepeatedMask, \"Invalid enum\");\n\n// TODO(ckennelly):  Add a static assertion to ensure that these masks do not\n// conflict with wiretypes.\n\n// ParseTableField is kept small to help simplify instructions for computing\n// offsets, as we will always need this information to parse a field.\n// Additional data, needed for some types, is stored in\n// AuxillaryParseTableField.\nstruct ParseTableField {\n  uint32 offset;\n  // The presence_index ordinarily represents a has_bit index, but for fields\n  // inside a oneof it represents the index in _oneof_case_.\n  uint32 presence_index;\n  unsigned char normal_wiretype;\n  unsigned char packed_wiretype;\n\n  // processing_type is given by:\n  //   (FieldDescriptor->type() << 1) | FieldDescriptor->is_packed()\n  unsigned char processing_type;\n\n  unsigned char tag_size;\n};\n\nstruct ParseTable;\n\nunion AuxillaryParseTableField {\n  typedef bool (*EnumValidator)(int);\n\n  // Enums\n  struct enum_aux {\n    EnumValidator validator;\n  };\n  enum_aux enums;\n  // Group, messages\n  struct message_aux {\n    // ExplicitlyInitialized<T> -> T requires a reinterpret_cast, which prevents\n    // the tables from being constructed as a constexpr.  We use void to avoid\n    // the cast.\n    const void* default_message_void;\n    const MessageLite* default_message() const {\n      return static_cast<const MessageLite*>(default_message_void);\n    }\n  };\n  message_aux messages;\n  // Strings\n  struct string_aux {\n    const void* default_ptr;\n    const char* field_name;\n  };\n  string_aux strings;\n\n  struct map_aux {\n    bool (*parse_map)(io::CodedInputStream*, void*);\n  };\n  map_aux maps;\n\n  AuxillaryParseTableField() = default;\n  constexpr AuxillaryParseTableField(AuxillaryParseTableField::enum_aux e)\n      : enums(e) {}\n  constexpr AuxillaryParseTableField(AuxillaryParseTableField::message_aux m)\n      : messages(m) {}\n  constexpr AuxillaryParseTableField(AuxillaryParseTableField::string_aux s)\n      : strings(s) {}\n  constexpr AuxillaryParseTableField(AuxillaryParseTableField::map_aux m)\n      : maps(m) {}\n};\n\nstruct ParseTable {\n  const ParseTableField* fields;\n  const AuxillaryParseTableField* aux;\n  int max_field_number;\n  // TODO(ckennelly): Do something with this padding.\n\n  // TODO(ckennelly): Vet these for sign extension.\n  int64 has_bits_offset;\n  int64 oneof_case_offset;\n  int64 extension_offset;\n  int64 arena_offset;\n\n  // ExplicitlyInitialized<T> -> T requires a reinterpret_cast, which prevents\n  // the tables from being constructed as a constexpr.  We use void to avoid\n  // the cast.\n  const void* default_instance_void;\n  const MessageLite* default_instance() const {\n    return static_cast<const MessageLite*>(default_instance_void);\n  }\n\n  bool unknown_field_set;\n};\n\nstatic_assert(sizeof(ParseTableField) <= 16, \"ParseTableField is too large\");\n// The tables must be composed of POD components to ensure link-time\n// initialization.\nstatic_assert(std::is_pod<ParseTableField>::value, \"\");\nstatic_assert(std::is_pod<AuxillaryParseTableField::enum_aux>::value, \"\");\nstatic_assert(std::is_pod<AuxillaryParseTableField::message_aux>::value, \"\");\nstatic_assert(std::is_pod<AuxillaryParseTableField::string_aux>::value, \"\");\nstatic_assert(std::is_pod<ParseTable>::value, \"\");\n\n#ifndef __NVCC__  // This assertion currently fails under NVCC.\nstatic_assert(std::is_pod<AuxillaryParseTableField>::value, \"\");\n#endif\n\n// TODO(ckennelly): Consolidate these implementations into a single one, using\n// dynamic dispatch to the appropriate unknown field handler.\nbool MergePartialFromCodedStream(MessageLite* msg, const ParseTable& table,\n                                 io::CodedInputStream* input);\nbool MergePartialFromCodedStreamLite(MessageLite* msg, const ParseTable& table,\n                                 io::CodedInputStream* input);\n\ntemplate <typename Entry>\nbool ParseMap(io::CodedInputStream* input, void* map_field) {\n  typedef typename MapEntryToMapField<Entry>::MapFieldType MapFieldType;\n  typedef google::protobuf::Map<typename Entry::EntryKeyType,\n                      typename Entry::EntryValueType>\n      MapType;\n  typedef typename Entry::template Parser<MapFieldType, MapType> ParserType;\n\n  ParserType parser(static_cast<MapFieldType*>(map_field));\n  return ::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(input,\n                                                                  &parser);\n}\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_TABLE_DRIVEN_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/generated_message_util.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This file contains miscellaneous helper code used by generated code --\n// including lite types -- but which should not be used directly by users.\n\n#ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__\n#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__\n\n#include <assert.h>\n#include <atomic>\n#include <climits>\n#include <string>\n#include <vector>\n\n#include <google/protobuf/stubs/logging.h>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/once.h>  // Add direct dep on port for pb.cc\n#include <google/protobuf/has_bits.h>\n#include <google/protobuf/implicit_weak_message.h>\n#include <google/protobuf/map_entry_lite.h>\n#include <google/protobuf/message_lite.h>\n#include <google/protobuf/wire_format_lite.h>\n\nnamespace google {\n\nnamespace protobuf {\n\nclass Arena;\n\nnamespace io { class CodedInputStream; }\n\nnamespace internal {\n\n\n// Annotation for the compiler to emit a deprecation message if a field marked\n// with option 'deprecated=true' is used in the code, or for other things in\n// generated code which are deprecated.\n//\n// For internal use in the pb.cc files, deprecation warnings are suppressed\n// there.\n#undef DEPRECATED_PROTOBUF_FIELD\n#define PROTOBUF_DEPRECATED\n\n#define GOOGLE_PROTOBUF_DEPRECATED_ATTR\n\n\n// Returns the offset of the given field within the given aggregate type.\n// This is equivalent to the ANSI C offsetof() macro.  However, according\n// to the C++ standard, offsetof() only works on POD types, and GCC\n// enforces this requirement with a warning.  In practice, this rule is\n// unnecessarily strict; there is probably no compiler or platform on\n// which the offsets of the direct fields of a class are non-constant.\n// Fields inherited from superclasses *can* have non-constant offsets,\n// but that's not what this macro will be used for.\n#if defined(__clang__)\n// For Clang we use __builtin_offsetof() and suppress the warning,\n// to avoid Control Flow Integrity and UBSan vptr sanitizers from\n// crashing while trying to validate the invalid reinterpet_casts.\n#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD)  \\\n  _Pragma(\"clang diagnostic push\")                                   \\\n  _Pragma(\"clang diagnostic ignored \\\"-Winvalid-offsetof\\\"\")         \\\n  __builtin_offsetof(TYPE, FIELD)                                    \\\n  _Pragma(\"clang diagnostic pop\")\n#else\n// Note that we calculate relative to the pointer value 16 here since if we\n// just use zero, GCC complains about dereferencing a NULL pointer.  We\n// choose 16 rather than some other number just in case the compiler would\n// be confused by an unaligned pointer.\n#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD)  \\\n  static_cast< ::google::protobuf::uint32>(                           \\\n      reinterpret_cast<const char*>(                                 \\\n          &reinterpret_cast<const TYPE*>(16)->FIELD) -               \\\n      reinterpret_cast<const char*>(16))\n#endif\n\n// Constants for special floating point values.\nLIBPROTOBUF_EXPORT double Infinity();\nLIBPROTOBUF_EXPORT double NaN();\n\nLIBPROTOBUF_EXPORT void InitProtobufDefaults();\n\n// This used by proto1\ninline const std::string& GetEmptyString() {\n  InitProtobufDefaults();\n  return GetEmptyStringAlreadyInited();\n}\n\n// True if IsInitialized() is true for all elements of t.  Type is expected\n// to be a RepeatedPtrField<some message type>.  It's useful to have this\n// helper here to keep the protobuf compiler from ever having to emit loops in\n// IsInitialized() methods.  We want the C++ compiler to inline this or not\n// as it sees fit.\ntemplate <class Type> bool AllAreInitialized(const Type& t) {\n  for (int i = t.size(); --i >= 0; ) {\n    if (!t.Get(i).IsInitialized()) return false;\n  }\n  return true;\n}\n\n// \"Weak\" variant of AllAreInitialized, used to implement implicit weak fields.\n// This version operates on MessageLite to avoid introducing a dependency on the\n// concrete message type.\ntemplate <class T>\nbool AllAreInitializedWeak(const ::google::protobuf::RepeatedPtrField<T>& t) {\n  for (int i = t.size(); --i >= 0;) {\n    if (!reinterpret_cast<const ::google::protobuf::internal::RepeatedPtrFieldBase&>(t)\n             .Get<::google::protobuf::internal::ImplicitWeakTypeHandler<T> >(i)\n             .IsInitialized()) {\n      return false;\n    }\n  }\n  return true;\n}\n\nstruct LIBPROTOBUF_EXPORT FieldMetadata {\n  uint32 offset;  // offset of this field in the struct\n  uint32 tag;     // field * 8 + wire_type\n  // byte offset * 8 + bit_offset;\n  // if the high bit is set then this is the byte offset of the oneof_case\n  // for this field.\n  uint32 has_offset;\n  uint32 type;      // the type of this field.\n  const void* ptr;  // auxiliary data\n\n  // From the serializer point of view each fundamental type can occur in\n  // 4 different ways. For simplicity we treat all combinations as a cartesion\n  // product although not all combinations are allowed.\n  enum FieldTypeClass {\n    kPresence,\n    kNoPresence,\n    kRepeated,\n    kPacked,\n    kOneOf,\n    kNumTypeClasses  // must be last enum\n  };\n  // C++ protobuf has 20 fundamental types, were we added Cord and StringPiece\n  // and also distinquish the same types if they have different wire format.\n  enum {\n    kCordType = 19,\n    kStringPieceType = 20,\n    kInlinedType = 21,\n    kNumTypes = 21,\n    kSpecial = kNumTypes * kNumTypeClasses,\n  };\n\n  static int CalculateType(int fundamental_type, FieldTypeClass type_class);\n};\n\ninline bool IsPresent(const void* base, uint32 hasbit) {\n  const uint32* has_bits_array = static_cast<const uint32*>(base);\n  return (has_bits_array[hasbit / 32] & (1u << (hasbit & 31))) != 0;\n}\n\ninline bool IsOneofPresent(const void* base, uint32 offset, uint32 tag) {\n  const uint32* oneof =\n      reinterpret_cast<const uint32*>(static_cast<const uint8*>(base) + offset);\n  return *oneof == tag >> 3;\n}\n\ntypedef void (*SpecialSerializer)(const uint8* base, uint32 offset, uint32 tag,\n                                  uint32 has_offset,\n                                  ::google::protobuf::io::CodedOutputStream* output);\n\nLIBPROTOBUF_EXPORT void ExtensionSerializer(const uint8* base, uint32 offset, uint32 tag,\n                         uint32 has_offset,\n                         ::google::protobuf::io::CodedOutputStream* output);\nLIBPROTOBUF_EXPORT void UnknownFieldSerializerLite(const uint8* base, uint32 offset, uint32 tag,\n                                uint32 has_offset,\n                                ::google::protobuf::io::CodedOutputStream* output);\n\nstruct SerializationTable {\n  int num_fields;\n  const FieldMetadata* field_table;\n};\n\nLIBPROTOBUF_EXPORT void SerializeInternal(const uint8* base, const FieldMetadata* table,\n                       int num_fields, ::google::protobuf::io::CodedOutputStream* output);\n\ninline void TableSerialize(const ::google::protobuf::MessageLite& msg,\n                           const SerializationTable* table,\n                           ::google::protobuf::io::CodedOutputStream* output) {\n  const FieldMetadata* field_table = table->field_table;\n  int num_fields = table->num_fields - 1;\n  const uint8* base = reinterpret_cast<const uint8*>(&msg);\n  // TODO(gerbens) This skips the first test if we could use the fast\n  // array serialization path, we should make this\n  // int cached_size =\n  //    *reinterpret_cast<const int32*>(base + field_table->offset);\n  // SerializeWithCachedSize(msg, field_table + 1, num_fields, cached_size, ...)\n  // But we keep conformance with the old way for now.\n  SerializeInternal(base, field_table + 1, num_fields, output);\n}\n\nuint8* SerializeInternalToArray(const uint8* base, const FieldMetadata* table,\n                                int num_fields, bool is_deterministic,\n                                uint8* buffer);\n\ninline uint8* TableSerializeToArray(const ::google::protobuf::MessageLite& msg,\n                                    const SerializationTable* table,\n                                    bool is_deterministic, uint8* buffer) {\n  const uint8* base = reinterpret_cast<const uint8*>(&msg);\n  const FieldMetadata* field_table = table->field_table + 1;\n  int num_fields = table->num_fields - 1;\n  return SerializeInternalToArray(base, field_table, num_fields,\n                                  is_deterministic, buffer);\n}\n\ntemplate <typename T>\nstruct CompareHelper {\n  bool operator()(const T& a, const T& b) { return a < b; }\n};\n\ntemplate <>\nstruct CompareHelper<ArenaStringPtr> {\n  bool operator()(const ArenaStringPtr& a, const ArenaStringPtr& b) {\n    return a.Get() < b.Get();\n  }\n};\n\nstruct CompareMapKey {\n  template <typename T>\n  bool operator()(const MapEntryHelper<T>& a, const MapEntryHelper<T>& b) {\n    return Compare(a.key_, b.key_);\n  }\n  template <typename T>\n  bool Compare(const T& a, const T& b) {\n    return CompareHelper<T>()(a, b);\n  }\n};\n\ntemplate <typename MapFieldType, const SerializationTable* table>\nvoid MapFieldSerializer(const uint8* base, uint32 offset, uint32 tag,\n                        uint32 has_offset,\n                        ::google::protobuf::io::CodedOutputStream* output) {\n  typedef MapEntryHelper<typename MapFieldType::EntryTypeTrait> Entry;\n  typedef typename MapFieldType::MapType::const_iterator Iter;\n\n  const MapFieldType& map_field =\n      *reinterpret_cast<const MapFieldType*>(base + offset);\n  const SerializationTable* t =\n      table +\n      has_offset;  // has_offset is overloaded for maps to mean table offset\n  if (!output->IsSerializationDeterministic()) {\n    for (Iter it = map_field.GetMap().begin(); it != map_field.GetMap().end();\n         ++it) {\n      Entry map_entry(*it);\n      output->WriteVarint32(tag);\n      output->WriteVarint32(map_entry._cached_size_);\n      SerializeInternal(reinterpret_cast<const uint8*>(&map_entry),\n                        t->field_table, t->num_fields, output);\n    }\n  } else {\n    std::vector<Entry> v;\n    for (Iter it = map_field.GetMap().begin(); it != map_field.GetMap().end();\n         ++it) {\n      v.push_back(Entry(*it));\n    }\n    std::sort(v.begin(), v.end(), CompareMapKey());\n    for (int i = 0; i < v.size(); i++) {\n      output->WriteVarint32(tag);\n      output->WriteVarint32(v[i]._cached_size_);\n      SerializeInternal(reinterpret_cast<const uint8*>(&v[i]), t->field_table,\n                        t->num_fields, output);\n    }\n  }\n}\n\nLIBPROTOBUF_EXPORT MessageLite* DuplicateIfNonNullInternal(MessageLite* message);\nLIBPROTOBUF_EXPORT MessageLite* GetOwnedMessageInternal(Arena* message_arena,\n                                     MessageLite* submessage,\n                                     Arena* submessage_arena);\n\ntemplate <typename T>\nT* DuplicateIfNonNull(T* message) {\n  // The casts must be reinterpret_cast<> because T might be a forward-declared\n  // type that the compiler doesn't know is related to MessageLite.\n  return reinterpret_cast<T*>(\n      DuplicateIfNonNullInternal(reinterpret_cast<MessageLite*>(message)));\n}\n\ntemplate <typename T>\nT* GetOwnedMessage(Arena* message_arena, T* submessage,\n                   Arena* submessage_arena) {\n  // The casts must be reinterpret_cast<> because T might be a forward-declared\n  // type that the compiler doesn't know is related to MessageLite.\n  return reinterpret_cast<T*>(GetOwnedMessageInternal(\n      message_arena, reinterpret_cast<MessageLite*>(submessage),\n      submessage_arena));\n}\n\n// Hide atomic from the public header and allow easy change to regular int\n// on platforms where the atomic might have a perf impact.\nclass LIBPROTOBUF_EXPORT CachedSize {\n public:\n  int Get() const { return size_.load(std::memory_order_relaxed); }\n  void Set(int size) { size_.store(size, std::memory_order_relaxed); }\n private:\n  std::atomic<int> size_{0};\n};\n\n// SCCInfo represents information of a strongly connected component of\n// mutual dependent messages.\nstruct LIBPROTOBUF_EXPORT SCCInfoBase {\n  // We use 0 for the Initialized state, because test eax,eax, jnz is smaller\n  // and is subject to macro fusion.\n  enum {\n    kInitialized = 0,  // final state\n    kRunning = 1,\n    kUninitialized = -1,  // initial state\n  };\n#ifndef _MSC_VER\n  std::atomic<int> visit_status;\n#else\n  // MSVC doesnt make std::atomic constant initialized. This union trick\n  // makes it so.\n  union {\n    int visit_status_to_make_linker_init;\n    std::atomic<int> visit_status;\n  };\n#endif\n  int num_deps;\n  void (*init_func)();\n  // This is followed by an array  of num_deps\n  // const SCCInfoBase* deps[];\n};\n\ntemplate <int N>\nstruct SCCInfo {\n  SCCInfoBase base;\n  // Semantically this is const SCCInfo<T>* which is is a templated type.\n  // The obvious inheriting from SCCInfoBase mucks with struct initialization.\n  // Attempts showed the compiler was generating dynamic initialization code.\n  // Zero length arrays produce warnings with MSVC.\n  SCCInfoBase* deps[N ? N : 1];\n};\n\nLIBPROTOBUF_EXPORT void InitSCCImpl(SCCInfoBase* scc);\n\ninline void InitSCC(SCCInfoBase* scc) {\n  auto status = scc->visit_status.load(std::memory_order_acquire);\n  if (GOOGLE_PREDICT_FALSE(status != SCCInfoBase::kInitialized)) InitSCCImpl(scc);\n}\n\nLIBPROTOBUF_EXPORT void DestroyMessage(const void* message);\nLIBPROTOBUF_EXPORT void DestroyString(const void* s);\n// Destroy (not delete) the message\ninline void OnShutdownDestroyMessage(const void* ptr) {\n  OnShutdownRun(DestroyMessage, ptr);\n}\n// Destroy the string (call string destructor)\ninline void OnShutdownDestroyString(const std::string* ptr) {\n  OnShutdownRun(DestroyString, ptr);\n}\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/has_bits.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_HAS_BITS_H__\n#define GOOGLE_PROTOBUF_HAS_BITS_H__\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/port.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\ntemplate<size_t doublewords>\nclass HasBits {\n public:\n  HasBits() GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE { Clear(); }\n\n  void Clear() GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    memset(has_bits_, 0, sizeof(has_bits_));\n  }\n\n  ::google::protobuf::uint32& operator[](int index) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    return has_bits_[index];\n  }\n\n  const ::google::protobuf::uint32& operator[](int index) const\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    return has_bits_[index];\n  }\n\n  bool operator==(const HasBits<doublewords>& rhs) const {\n    return memcmp(has_bits_, rhs.has_bits_, sizeof(has_bits_)) == 0;\n  }\n\n  bool operator!=(const HasBits<doublewords>& rhs) const {\n    return !(*this == rhs);\n  }\n\n  bool empty() const;\n\n private:\n  ::google::protobuf::uint32 has_bits_[doublewords];\n};\n\ntemplate <>\ninline bool HasBits<1>::empty() const {\n  return !has_bits_[0];\n}\n\ntemplate <>\ninline bool HasBits<2>::empty() const {\n  return !(has_bits_[0] | has_bits_[1]);\n}\n\ntemplate <>\ninline bool HasBits<3>::empty() const {\n  return !(has_bits_[0] | has_bits_[1] | has_bits_[2]);\n}\n\ntemplate <>\ninline bool HasBits<4>::empty() const {\n  return !(has_bits_[0] | has_bits_[1] | has_bits_[2] | has_bits_[3]);\n}\n\ntemplate <size_t doublewords>\ninline bool HasBits<doublewords>::empty() const {\n  for (size_t i = 0; i < doublewords; ++i) {\n    if (has_bits_[i]) return false;\n  }\n  return true;\n}\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_HAS_BITS_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/implicit_weak_message.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__\n#define GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/message_lite.h>\n\n// This file is logically internal-only and should only be used by protobuf\n// generated code.\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// An implementation of MessageLite that treats all data as unknown. This type\n// acts as a placeholder for an implicit weak field in the case where the true\n// message type does not get linked into the binary.\nclass LIBPROTOBUF_EXPORT ImplicitWeakMessage : public MessageLite {\n public:\n  ImplicitWeakMessage() : arena_(NULL) {}\n  explicit ImplicitWeakMessage(Arena* arena) : arena_(arena) {}\n\n  static const ImplicitWeakMessage* default_instance();\n\n  string GetTypeName() const { return \"\"; }\n\n  MessageLite* New() const { return new ImplicitWeakMessage; }\n  MessageLite* New(Arena* arena) const {\n    return Arena::CreateMessage<ImplicitWeakMessage>(arena);\n  }\n\n  Arena* GetArena() const { return arena_; }\n\n  void Clear() { data_.clear(); }\n\n  bool IsInitialized() const { return true; }\n\n  void CheckTypeAndMergeFrom(const MessageLite& other) {\n    data_.append(static_cast<const ImplicitWeakMessage&>(other).data_);\n  }\n\n  bool MergePartialFromCodedStream(io::CodedInputStream* input);\n\n  size_t ByteSizeLong() const { return data_.size(); }\n\n  void SerializeWithCachedSizes(io::CodedOutputStream* output) const {\n    output->WriteString(data_);\n  }\n\n  int GetCachedSize() const { return static_cast<int>(data_.size()); }\n\n  typedef void InternalArenaConstructable_;\n\n private:\n  Arena* const arena_;\n  string data_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImplicitWeakMessage);\n};\n\n// A type handler for use with implicit weak repeated message fields.\ntemplate <typename ImplicitWeakType>\nclass ImplicitWeakTypeHandler {\n public:\n  typedef ImplicitWeakType Type;\n  typedef ::google::protobuf::MessageLite WeakType;\n  static const bool Moveable = false;\n\n  // With implicit weak fields, we need separate NewFromPrototype and\n  // NewFromPrototypeWeak functions. The former is used when we want to create a\n  // strong dependency on the message type, and it just delegates to the\n  // GenericTypeHandler. The latter avoids creating a strong dependency, by\n  // simply calling MessageLite::New.\n  static inline ::google::protobuf::MessageLite* NewFromPrototype(\n      const ::google::protobuf::MessageLite* prototype, ::google::protobuf::Arena* arena = NULL) {\n    return prototype->New(arena);\n  }\n\n  static inline void Delete(::google::protobuf::MessageLite* value, Arena* arena) {\n    if (arena == NULL) {\n      delete value;\n    }\n  }\n  static inline ::google::protobuf::Arena* GetArena(::google::protobuf::MessageLite* value) {\n    return value->GetArena();\n  }\n  static inline void* GetMaybeArenaPointer(::google::protobuf::MessageLite* value) {\n    return value->GetArena();\n  }\n  static inline void Clear(::google::protobuf::MessageLite* value) {\n    value->Clear();\n  }\n  static void Merge(const ::google::protobuf::MessageLite& from,\n                    ::google::protobuf::MessageLite* to) {\n    to->CheckTypeAndMergeFrom(from);\n  }\n  static inline size_t SpaceUsedLong(const Type& value) {\n    return value.SpaceUsedLong();\n  }\n};\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/inlined_string_field.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__\n#define GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__\n\n#include <string>\n\n#include <google/protobuf/stubs/port.h>\n#include <google/protobuf/stubs/stringpiece.h>\n\nnamespace google {\nnamespace protobuf {\n\nclass Arena;\n\nnamespace internal {\n\n// InlinedStringField wraps a ::std::string instance and exposes an API similar to\n// ArenaStringPtr's wrapping of a ::std::string* instance.  As ::std::string is never\n// allocated on the Arena, we expose only the *NoArena methods of\n// ArenaStringPtr.\n//\n// default_value parameters are taken for consistency with ArenaStringPtr, but\n// are not used for most methods.  With inlining, these should be removed from\n// the generated binary.\nclass LIBPROTOBUF_EXPORT InlinedStringField {\n public:\n  InlinedStringField()\n    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n  explicit InlinedStringField(const ::std::string& default_value);\n\n  void AssignWithDefault(const ::std::string* default_value,\n                         const InlinedStringField& from)\n    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n\n  void ClearToEmpty(const ::std::string* default_value, Arena* arena)\n      GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    ClearToEmptyNoArena(default_value);\n  }\n  void ClearNonDefaultToEmpty() GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    ClearNonDefaultToEmptyNoArena();\n  }\n  void ClearToEmptyNoArena(const ::std::string* default_value)\n      GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    ClearNonDefaultToEmptyNoArena();\n  }\n  void ClearNonDefaultToEmptyNoArena()\n    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n\n  void ClearToDefault(const ::std::string* default_value, Arena* arena)\n      GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    ClearToDefaultNoArena(default_value);\n  }\n  void ClearToDefaultNoArena(const ::std::string* default_value)\n    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n\n  void Destroy(const ::std::string* default_value, Arena* arena)\n      GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    DestroyNoArena(default_value);\n  }\n  void DestroyNoArena(const ::std::string* default_value)\n    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n\n  const ::std::string& Get() const GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    return GetNoArena();\n  }\n  const ::std::string& GetNoArena() const GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n\n  ::std::string* Mutable(const ::std::string* default_value, Arena* arena)\n      GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    return MutableNoArena(default_value);\n  }\n  ::std::string* MutableNoArena(const ::std::string* default_value)\n    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n\n  ::std::string* Release(const ::std::string* default_value, Arena* arena) {\n    return ReleaseNoArena(default_value);\n  }\n  ::std::string* ReleaseNonDefault(const ::std::string* default_value, Arena* arena) {\n    return ReleaseNonDefaultNoArena(default_value);\n  }\n  ::std::string* ReleaseNoArena(const ::std::string* default_value) {\n    return ReleaseNonDefaultNoArena(default_value);\n  }\n  ::std::string* ReleaseNonDefaultNoArena(const ::std::string* default_value);\n\n  void Set(const ::std::string* default_value,\n           StringPiece value,\n           Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    SetNoArena(default_value, value);\n  }\n  void SetLite(const ::std::string* default_value,\n               StringPiece value,\n               Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    SetNoArena(default_value, value);\n  }\n  void SetNoArena(const ::std::string* default_value,\n                  StringPiece value) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n\n  void Set(const ::std::string* default_value,\n           const ::std::string& value,\n           Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    SetNoArena(default_value, value);\n  }\n  void SetLite(const ::std::string* default_value,\n               const ::std::string& value,\n               Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {\n    SetNoArena(default_value, value);\n  }\n  void SetNoArena(const ::std::string* default_value,\n                  const ::std::string& value)\n    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n\n#if LANG_CXX11\n  void SetNoArena(const ::std::string* default_value,\n                  ::std::string&& value)\n    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n#endif\n  void SetAllocated(const ::std::string* default_value,\n                    ::std::string* value,\n                    Arena* arena) {\n    SetAllocatedNoArena(default_value, value);\n  }\n  void SetAllocatedNoArena(const ::std::string* default_value,\n                           ::std::string* value);\n  void Swap(InlinedStringField* from)\n    GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;\n  ::std::string* UnsafeMutablePointer();\n  void UnsafeSetDefault(const ::std::string* default_value);\n  ::std::string* UnsafeArenaRelease(const ::std::string* default_value, Arena* arena);\n  void UnsafeArenaSetAllocated(\n      const ::std::string* default_value, ::std::string* value, Arena* arena);\n\n  bool IsDefault(const ::std::string* default_value) {\n    return false;\n  }\n private:\n  ::std::string value_;\n};\n\ninline InlinedStringField::InlinedStringField() {}\n\ninline InlinedStringField::InlinedStringField(const ::std::string& default_value) :\n  value_(default_value) {}\n\ninline void InlinedStringField::AssignWithDefault(\n    const ::std::string* default_value, const InlinedStringField& from) {\n  value_ = from.value_;\n}\n\ninline const ::std::string& InlinedStringField::GetNoArena() const {\n  return value_;\n}\n\ninline ::std::string* InlinedStringField::MutableNoArena(const ::std::string*) {\n  return &value_;\n}\n\ninline void InlinedStringField::SetAllocatedNoArena(\n    const ::std::string* default_value, ::std::string* value) {\n  if (value == NULL) {\n    value_.assign(*default_value);\n  } else {\n#if LANG_CXX11\n    value_.assign(std::move(*value));\n#else\n    value_.swap(*value);\n#endif\n    delete value;\n  }\n}\n\ninline void InlinedStringField::DestroyNoArena(const ::std::string*) {\n  // This is invoked from the generated message's ArenaDtor, which is used to\n  // clean up objects not allocated on the Arena.\n  this->~InlinedStringField();\n}\n\ninline void InlinedStringField::ClearNonDefaultToEmptyNoArena() {\n  value_.clear();\n}\n\ninline void InlinedStringField::ClearToDefaultNoArena(\n    const ::std::string* default_value) {\n  value_.assign(*default_value);\n}\n\ninline ::std::string* InlinedStringField::ReleaseNonDefaultNoArena(\n    const ::std::string* default_value) {\n  ::std::string* released = new ::std::string(*default_value);\n  value_.swap(*released);\n  return released;\n}\n\ninline void InlinedStringField::SetNoArena(\n    const ::std::string* default_value, StringPiece value) {\n  value_.assign(value.data(), value.length());\n}\n\ninline void InlinedStringField::SetNoArena(\n    const ::std::string* default_value, const ::std::string& value) {\n  value_.assign(value);\n}\n\n#if LANG_CXX11\ninline void InlinedStringField::SetNoArena(\n    const ::std::string* default_value, ::std::string&& value) {\n  value_.assign(std::move(value));\n}\n#endif\n\ninline void InlinedStringField::Swap(InlinedStringField* from) {\n  value_.swap(from->value_);\n}\n\ninline ::std::string* InlinedStringField::UnsafeMutablePointer() {\n  return &value_;\n}\n\ninline void InlinedStringField::UnsafeSetDefault(\n    const ::std::string* default_value) {\n  value_.assign(*default_value);\n}\n\ninline ::std::string* InlinedStringField::UnsafeArenaRelease(\n    const ::std::string* default_value, Arena* arena) {\n  return ReleaseNoArena(default_value);\n}\n\ninline void InlinedStringField::UnsafeArenaSetAllocated(\n    const ::std::string* default_value, ::std::string* value, Arena* arena) {\n  if (value == NULL) {\n    value_.assign(*default_value);\n  } else {\n    value_.assign(*value);\n  }\n}\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/io/coded_stream.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This file contains the CodedInputStream and CodedOutputStream classes,\n// which wrap a ZeroCopyInputStream or ZeroCopyOutputStream, respectively,\n// and allow you to read or write individual pieces of data in various\n// formats.  In particular, these implement the varint encoding for\n// integers, a simple variable-length encoding in which smaller numbers\n// take fewer bytes.\n//\n// Typically these classes will only be used internally by the protocol\n// buffer library in order to encode and decode protocol buffers.  Clients\n// of the library only need to know about this class if they wish to write\n// custom message parsing or serialization procedures.\n//\n// CodedOutputStream example:\n//   // Write some data to \"myfile\".  First we write a 4-byte \"magic number\"\n//   // to identify the file type, then write a length-delimited string.  The\n//   // string is composed of a varint giving the length followed by the raw\n//   // bytes.\n//   int fd = open(\"myfile\", O_CREAT | O_WRONLY);\n//   ZeroCopyOutputStream* raw_output = new FileOutputStream(fd);\n//   CodedOutputStream* coded_output = new CodedOutputStream(raw_output);\n//\n//   int magic_number = 1234;\n//   char text[] = \"Hello world!\";\n//   coded_output->WriteLittleEndian32(magic_number);\n//   coded_output->WriteVarint32(strlen(text));\n//   coded_output->WriteRaw(text, strlen(text));\n//\n//   delete coded_output;\n//   delete raw_output;\n//   close(fd);\n//\n// CodedInputStream example:\n//   // Read a file created by the above code.\n//   int fd = open(\"myfile\", O_RDONLY);\n//   ZeroCopyInputStream* raw_input = new FileInputStream(fd);\n//   CodedInputStream coded_input = new CodedInputStream(raw_input);\n//\n//   coded_input->ReadLittleEndian32(&magic_number);\n//   if (magic_number != 1234) {\n//     cerr << \"File not in expected format.\" << endl;\n//     return;\n//   }\n//\n//   uint32 size;\n//   coded_input->ReadVarint32(&size);\n//\n//   char* text = new char[size + 1];\n//   coded_input->ReadRaw(buffer, size);\n//   text[size] = '\\0';\n//\n//   delete coded_input;\n//   delete raw_input;\n//   close(fd);\n//\n//   cout << \"Text is: \" << text << endl;\n//   delete [] text;\n//\n// For those who are interested, varint encoding is defined as follows:\n//\n// The encoding operates on unsigned integers of up to 64 bits in length.\n// Each byte of the encoded value has the format:\n// * bits 0-6: Seven bits of the number being encoded.\n// * bit 7: Zero if this is the last byte in the encoding (in which\n//   case all remaining bits of the number are zero) or 1 if\n//   more bytes follow.\n// The first byte contains the least-significant 7 bits of the number, the\n// second byte (if present) contains the next-least-significant 7 bits,\n// and so on.  So, the binary number 1011000101011 would be encoded in two\n// bytes as \"10101011 00101100\".\n//\n// In theory, varint could be used to encode integers of any length.\n// However, for practicality we set a limit at 64 bits.  The maximum encoded\n// length of a number is thus 10 bytes.\n\n#ifndef GOOGLE_PROTOBUF_IO_CODED_STREAM_H__\n#define GOOGLE_PROTOBUF_IO_CODED_STREAM_H__\n\n#include <assert.h>\n#include <atomic>\n#include <climits>\n#include <string>\n#include <utility>\n#ifdef _MSC_VER\n  // Assuming windows is always little-endian.\n  #if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)\n    #define PROTOBUF_LITTLE_ENDIAN 1\n  #endif\n  #if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)\n    // If MSVC has \"/RTCc\" set, it will complain about truncating casts at\n    // runtime.  This file contains some intentional truncating casts.\n    #pragma runtime_checks(\"c\", off)\n  #endif\n#else\n  #include <sys/param.h>   // __BYTE_ORDER\n  #if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \\\n         (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \\\n      !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)\n    #define PROTOBUF_LITTLE_ENDIAN 1\n  #endif\n#endif\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/port.h>\n#include <google/protobuf/stubs/port.h>\n\nnamespace google {\n\nnamespace protobuf {\n\nclass DescriptorPool;\nclass MessageFactory;\n\nnamespace internal { void MapTestForceDeterministic(); }\n\nnamespace io {\n\n// Defined in this file.\nclass CodedInputStream;\nclass CodedOutputStream;\n\n// Defined in other files.\nclass ZeroCopyInputStream;           // zero_copy_stream.h\nclass ZeroCopyOutputStream;          // zero_copy_stream.h\n\n// Class which reads and decodes binary data which is composed of varint-\n// encoded integers and fixed-width pieces.  Wraps a ZeroCopyInputStream.\n// Most users will not need to deal with CodedInputStream.\n//\n// Most methods of CodedInputStream that return a bool return false if an\n// underlying I/O error occurs or if the data is malformed.  Once such a\n// failure occurs, the CodedInputStream is broken and is no longer useful.\nclass LIBPROTOBUF_EXPORT CodedInputStream {\n public:\n  // Create a CodedInputStream that reads from the given ZeroCopyInputStream.\n  explicit CodedInputStream(ZeroCopyInputStream* input);\n\n  // Create a CodedInputStream that reads from the given flat array.  This is\n  // faster than using an ArrayInputStream.  PushLimit(size) is implied by\n  // this constructor.\n  explicit CodedInputStream(const uint8* buffer, int size);\n\n  // Destroy the CodedInputStream and position the underlying\n  // ZeroCopyInputStream at the first unread byte.  If an error occurred while\n  // reading (causing a method to return false), then the exact position of\n  // the input stream may be anywhere between the last value that was read\n  // successfully and the stream's byte limit.\n  ~CodedInputStream();\n\n  // Return true if this CodedInputStream reads from a flat array instead of\n  // a ZeroCopyInputStream.\n  inline bool IsFlat() const;\n\n  // Skips a number of bytes.  Returns false if an underlying read error\n  // occurs.\n  inline bool Skip(int count);\n\n  // Sets *data to point directly at the unread part of the CodedInputStream's\n  // underlying buffer, and *size to the size of that buffer, but does not\n  // advance the stream's current position.  This will always either produce\n  // a non-empty buffer or return false.  If the caller consumes any of\n  // this data, it should then call Skip() to skip over the consumed bytes.\n  // This may be useful for implementing external fast parsing routines for\n  // types of data not covered by the CodedInputStream interface.\n  bool GetDirectBufferPointer(const void** data, int* size);\n\n  // Like GetDirectBufferPointer, but this method is inlined, and does not\n  // attempt to Refresh() if the buffer is currently empty.\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  void GetDirectBufferPointerInline(const void** data, int* size);\n\n  // Read raw bytes, copying them into the given buffer.\n  bool ReadRaw(void* buffer, int size);\n\n  // Like the above, with inlined optimizations. This should only be used\n  // by the protobuf implementation.\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  bool InternalReadRawInline(void* buffer, int size);\n\n  // Like ReadRaw, but reads into a string.\n  bool ReadString(string* buffer, int size);\n  // Like the above, with inlined optimizations. This should only be used\n  // by the protobuf implementation.\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  bool InternalReadStringInline(string* buffer, int size);\n\n\n  // Read a 32-bit little-endian integer.\n  bool ReadLittleEndian32(uint32* value);\n  // Read a 64-bit little-endian integer.\n  bool ReadLittleEndian64(uint64* value);\n\n  // These methods read from an externally provided buffer. The caller is\n  // responsible for ensuring that the buffer has sufficient space.\n  // Read a 32-bit little-endian integer.\n  static const uint8* ReadLittleEndian32FromArray(const uint8* buffer,\n                                                   uint32* value);\n  // Read a 64-bit little-endian integer.\n  static const uint8* ReadLittleEndian64FromArray(const uint8* buffer,\n                                                   uint64* value);\n\n  // Read an unsigned integer with Varint encoding, truncating to 32 bits.\n  // Reading a 32-bit value is equivalent to reading a 64-bit one and casting\n  // it to uint32, but may be more efficient.\n  bool ReadVarint32(uint32* value);\n  // Read an unsigned integer with Varint encoding.\n  bool ReadVarint64(uint64* value);\n\n  // Reads a varint off the wire into an \"int\". This should be used for reading\n  // sizes off the wire (sizes of strings, submessages, bytes fields, etc).\n  //\n  // The value from the wire is interpreted as unsigned.  If its value exceeds\n  // the representable value of an integer on this platform, instead of\n  // truncating we return false. Truncating (as performed by ReadVarint32()\n  // above) is an acceptable approach for fields representing an integer, but\n  // when we are parsing a size from the wire, truncating the value would result\n  // in us misparsing the payload.\n  bool ReadVarintSizeAsInt(int* value);\n\n  // Read a tag.  This calls ReadVarint32() and returns the result, or returns\n  // zero (which is not a valid tag) if ReadVarint32() fails.  Also, ReadTag\n  // (but not ReadTagNoLastTag) updates the last tag value, which can be checked\n  // with LastTagWas().\n  //\n  // Always inline because this is only called in one place per parse loop\n  // but it is called for every iteration of said loop, so it should be fast.\n  // GCC doesn't want to inline this by default.\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE uint32 ReadTag() {\n    return last_tag_ = ReadTagNoLastTag();\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE uint32 ReadTagNoLastTag();\n\n\n  // This usually a faster alternative to ReadTag() when cutoff is a manifest\n  // constant.  It does particularly well for cutoff >= 127.  The first part\n  // of the return value is the tag that was read, though it can also be 0 in\n  // the cases where ReadTag() would return 0.  If the second part is true\n  // then the tag is known to be in [0, cutoff].  If not, the tag either is\n  // above cutoff or is 0.  (There's intentional wiggle room when tag is 0,\n  // because that can arise in several ways, and for best performance we want\n  // to avoid an extra \"is tag == 0?\" check here.)\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  std::pair<uint32, bool> ReadTagWithCutoff(uint32 cutoff) {\n    std::pair<uint32, bool> result = ReadTagWithCutoffNoLastTag(cutoff);\n    last_tag_ = result.first;\n    return result;\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  std::pair<uint32, bool> ReadTagWithCutoffNoLastTag(uint32 cutoff);\n\n  // Usually returns true if calling ReadVarint32() now would produce the given\n  // value.  Will always return false if ReadVarint32() would not return the\n  // given value.  If ExpectTag() returns true, it also advances past\n  // the varint.  For best performance, use a compile-time constant as the\n  // parameter.\n  // Always inline because this collapses to a small number of instructions\n  // when given a constant parameter, but GCC doesn't want to inline by default.\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool ExpectTag(uint32 expected);\n\n  // Like above, except this reads from the specified buffer. The caller is\n  // responsible for ensuring that the buffer is large enough to read a varint\n  // of the expected size. For best performance, use a compile-time constant as\n  // the expected tag parameter.\n  //\n  // Returns a pointer beyond the expected tag if it was found, or NULL if it\n  // was not.\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  static const uint8* ExpectTagFromArray(const uint8* buffer, uint32 expected);\n\n  // Usually returns true if no more bytes can be read.  Always returns false\n  // if more bytes can be read.  If ExpectAtEnd() returns true, a subsequent\n  // call to LastTagWas() will act as if ReadTag() had been called and returned\n  // zero, and ConsumedEntireMessage() will return true.\n  bool ExpectAtEnd();\n\n  // If the last call to ReadTag() or ReadTagWithCutoff() returned the given\n  // value, returns true.  Otherwise, returns false.\n  // ReadTagNoLastTag/ReadTagWithCutoffNoLastTag do not preserve the last\n  // returned value.\n  //\n  // This is needed because parsers for some types of embedded messages\n  // (with field type TYPE_GROUP) don't actually know that they've reached the\n  // end of a message until they see an ENDGROUP tag, which was actually part\n  // of the enclosing message.  The enclosing message would like to check that\n  // tag to make sure it had the right number, so it calls LastTagWas() on\n  // return from the embedded parser to check.\n  bool LastTagWas(uint32 expected);\n  void SetLastTag(uint32 tag) { last_tag_ = tag; }\n\n  // When parsing message (but NOT a group), this method must be called\n  // immediately after MergeFromCodedStream() returns (if it returns true)\n  // to further verify that the message ended in a legitimate way.  For\n  // example, this verifies that parsing did not end on an end-group tag.\n  // It also checks for some cases where, due to optimizations,\n  // MergeFromCodedStream() can incorrectly return true.\n  bool ConsumedEntireMessage();\n\n  // Limits ----------------------------------------------------------\n  // Limits are used when parsing length-delimited embedded messages.\n  // After the message's length is read, PushLimit() is used to prevent\n  // the CodedInputStream from reading beyond that length.  Once the\n  // embedded message has been parsed, PopLimit() is called to undo the\n  // limit.\n\n  // Opaque type used with PushLimit() and PopLimit().  Do not modify\n  // values of this type yourself.  The only reason that this isn't a\n  // struct with private internals is for efficiency.\n  typedef int Limit;\n\n  // Places a limit on the number of bytes that the stream may read,\n  // starting from the current position.  Once the stream hits this limit,\n  // it will act like the end of the input has been reached until PopLimit()\n  // is called.\n  //\n  // As the names imply, the stream conceptually has a stack of limits.  The\n  // shortest limit on the stack is always enforced, even if it is not the\n  // top limit.\n  //\n  // The value returned by PushLimit() is opaque to the caller, and must\n  // be passed unchanged to the corresponding call to PopLimit().\n  Limit PushLimit(int byte_limit);\n\n  // Pops the last limit pushed by PushLimit().  The input must be the value\n  // returned by that call to PushLimit().\n  void PopLimit(Limit limit);\n\n  // Returns the number of bytes left until the nearest limit on the\n  // stack is hit, or -1 if no limits are in place.\n  int BytesUntilLimit() const;\n\n  // Returns current position relative to the beginning of the input stream.\n  int CurrentPosition() const;\n\n  // Total Bytes Limit -----------------------------------------------\n  // To prevent malicious users from sending excessively large messages\n  // and causing memory exhaustion, CodedInputStream imposes a hard limit on\n  // the total number of bytes it will read.\n\n  // Sets the maximum number of bytes that this CodedInputStream will read\n  // before refusing to continue.  To prevent servers from allocating enormous\n  // amounts of memory to hold parsed messages, the maximum message length\n  // should be limited to the shortest length that will not harm usability.\n  // The default limit is INT_MAX (~2GB) and apps should set shorter limits\n  // if possible. An error will always be printed to stderr if the limit is\n  // reached.\n  //\n  // Note: setting a limit less than the current read position is interpreted\n  // as a limit on the current position.\n  //\n  // This is unrelated to PushLimit()/PopLimit().\n  void SetTotalBytesLimit(int total_bytes_limit);\n\n  PROTOBUF_RUNTIME_DEPRECATED(\n      \"Please use the single parameter version of SetTotalBytesLimit(). The \"\n      \"second parameter is ignored.\")\n  void SetTotalBytesLimit(int total_bytes_limit, int) {\n    SetTotalBytesLimit(total_bytes_limit);\n  }\n\n  // The Total Bytes Limit minus the Current Position, or -1 if the total bytes\n  // limit is INT_MAX.\n  int BytesUntilTotalBytesLimit() const;\n\n  // Recursion Limit -------------------------------------------------\n  // To prevent corrupt or malicious messages from causing stack overflows,\n  // we must keep track of the depth of recursion when parsing embedded\n  // messages and groups.  CodedInputStream keeps track of this because it\n  // is the only object that is passed down the stack during parsing.\n\n  // Sets the maximum recursion depth.  The default is 100.\n  void SetRecursionLimit(int limit);\n\n\n  // Increments the current recursion depth.  Returns true if the depth is\n  // under the limit, false if it has gone over.\n  bool IncrementRecursionDepth();\n\n  // Decrements the recursion depth if possible.\n  void DecrementRecursionDepth();\n\n  // Decrements the recursion depth blindly.  This is faster than\n  // DecrementRecursionDepth().  It should be used only if all previous\n  // increments to recursion depth were successful.\n  void UnsafeDecrementRecursionDepth();\n\n  // Shorthand for make_pair(PushLimit(byte_limit), --recursion_budget_).\n  // Using this can reduce code size and complexity in some cases.  The caller\n  // is expected to check that the second part of the result is non-negative (to\n  // bail out if the depth of recursion is too high) and, if all is well, to\n  // later pass the first part of the result to PopLimit() or similar.\n  std::pair<CodedInputStream::Limit, int> IncrementRecursionDepthAndPushLimit(\n      int byte_limit);\n\n  // Shorthand for PushLimit(ReadVarint32(&length) ? length : 0).\n  Limit ReadLengthAndPushLimit();\n\n  // Helper that is equivalent to: {\n  //  bool result = ConsumedEntireMessage();\n  //  PopLimit(limit);\n  //  UnsafeDecrementRecursionDepth();\n  //  return result; }\n  // Using this can reduce code size and complexity in some cases.\n  // Do not use unless the current recursion depth is greater than zero.\n  bool DecrementRecursionDepthAndPopLimit(Limit limit);\n\n  // Helper that is equivalent to: {\n  //  bool result = ConsumedEntireMessage();\n  //  PopLimit(limit);\n  //  return result; }\n  // Using this can reduce code size and complexity in some cases.\n  bool CheckEntireMessageConsumedAndPopLimit(Limit limit);\n\n  // Extension Registry ----------------------------------------------\n  // ADVANCED USAGE:  99.9% of people can ignore this section.\n  //\n  // By default, when parsing extensions, the parser looks for extension\n  // definitions in the pool which owns the outer message's Descriptor.\n  // However, you may call SetExtensionRegistry() to provide an alternative\n  // pool instead.  This makes it possible, for example, to parse a message\n  // using a generated class, but represent some extensions using\n  // DynamicMessage.\n\n  // Set the pool used to look up extensions.  Most users do not need to call\n  // this as the correct pool will be chosen automatically.\n  //\n  // WARNING:  It is very easy to misuse this.  Carefully read the requirements\n  //   below.  Do not use this unless you are sure you need it.  Almost no one\n  //   does.\n  //\n  // Let's say you are parsing a message into message object m, and you want\n  // to take advantage of SetExtensionRegistry().  You must follow these\n  // requirements:\n  //\n  // The given DescriptorPool must contain m->GetDescriptor().  It is not\n  // sufficient for it to simply contain a descriptor that has the same name\n  // and content -- it must be the *exact object*.  In other words:\n  //   assert(pool->FindMessageTypeByName(m->GetDescriptor()->full_name()) ==\n  //          m->GetDescriptor());\n  // There are two ways to satisfy this requirement:\n  // 1) Use m->GetDescriptor()->pool() as the pool.  This is generally useless\n  //    because this is the pool that would be used anyway if you didn't call\n  //    SetExtensionRegistry() at all.\n  // 2) Use a DescriptorPool which has m->GetDescriptor()->pool() as an\n  //    \"underlay\".  Read the documentation for DescriptorPool for more\n  //    information about underlays.\n  //\n  // You must also provide a MessageFactory.  This factory will be used to\n  // construct Message objects representing extensions.  The factory's\n  // GetPrototype() MUST return non-NULL for any Descriptor which can be found\n  // through the provided pool.\n  //\n  // If the provided factory might return instances of protocol-compiler-\n  // generated (i.e. compiled-in) types, or if the outer message object m is\n  // a generated type, then the given factory MUST have this property:  If\n  // GetPrototype() is given a Descriptor which resides in\n  // DescriptorPool::generated_pool(), the factory MUST return the same\n  // prototype which MessageFactory::generated_factory() would return.  That\n  // is, given a descriptor for a generated type, the factory must return an\n  // instance of the generated class (NOT DynamicMessage).  However, when\n  // given a descriptor for a type that is NOT in generated_pool, the factory\n  // is free to return any implementation.\n  //\n  // The reason for this requirement is that generated sub-objects may be\n  // accessed via the standard (non-reflection) extension accessor methods,\n  // and these methods will down-cast the object to the generated class type.\n  // If the object is not actually of that type, the results would be undefined.\n  // On the other hand, if an extension is not compiled in, then there is no\n  // way the code could end up accessing it via the standard accessors -- the\n  // only way to access the extension is via reflection.  When using reflection,\n  // DynamicMessage and generated messages are indistinguishable, so it's fine\n  // if these objects are represented using DynamicMessage.\n  //\n  // Using DynamicMessageFactory on which you have called\n  // SetDelegateToGeneratedFactory(true) should be sufficient to satisfy the\n  // above requirement.\n  //\n  // If either pool or factory is NULL, both must be NULL.\n  //\n  // Note that this feature is ignored when parsing \"lite\" messages as they do\n  // not have descriptors.\n  void SetExtensionRegistry(const DescriptorPool* pool,\n                            MessageFactory* factory);\n\n  // Get the DescriptorPool set via SetExtensionRegistry(), or NULL if no pool\n  // has been provided.\n  const DescriptorPool* GetExtensionPool();\n\n  // Get the MessageFactory set via SetExtensionRegistry(), or NULL if no\n  // factory has been provided.\n  MessageFactory* GetExtensionFactory();\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CodedInputStream);\n\n  const uint8* buffer_;\n  const uint8* buffer_end_;     // pointer to the end of the buffer.\n  ZeroCopyInputStream* input_;\n  int total_bytes_read_;  // total bytes read from input_, including\n                          // the current buffer\n\n  // If total_bytes_read_ surpasses INT_MAX, we record the extra bytes here\n  // so that we can BackUp() on destruction.\n  int overflow_bytes_;\n\n  // LastTagWas() stuff.\n  uint32 last_tag_;         // result of last ReadTag() or ReadTagWithCutoff().\n\n  // This is set true by ReadTag{Fallback/Slow}() if it is called when exactly\n  // at EOF, or by ExpectAtEnd() when it returns true.  This happens when we\n  // reach the end of a message and attempt to read another tag.\n  bool legitimate_message_end_;\n\n  // See EnableAliasing().\n  bool aliasing_enabled_;\n\n  // Limits\n  Limit current_limit_;   // if position = -1, no limit is applied\n\n  // For simplicity, if the current buffer crosses a limit (either a normal\n  // limit created by PushLimit() or the total bytes limit), buffer_size_\n  // only tracks the number of bytes before that limit.  This field\n  // contains the number of bytes after it.  Note that this implies that if\n  // buffer_size_ == 0 and buffer_size_after_limit_ > 0, we know we've\n  // hit a limit.  However, if both are zero, it doesn't necessarily mean\n  // we aren't at a limit -- the buffer may have ended exactly at the limit.\n  int buffer_size_after_limit_;\n\n  // Maximum number of bytes to read, period.  This is unrelated to\n  // current_limit_.  Set using SetTotalBytesLimit().\n  int total_bytes_limit_;\n\n  // Current recursion budget, controlled by IncrementRecursionDepth() and\n  // similar.  Starts at recursion_limit_ and goes down: if this reaches\n  // -1 we are over budget.\n  int recursion_budget_;\n  // Recursion depth limit, set by SetRecursionLimit().\n  int recursion_limit_;\n\n  // See SetExtensionRegistry().\n  const DescriptorPool* extension_pool_;\n  MessageFactory* extension_factory_;\n\n  // Private member functions.\n\n  // Fallback when Skip() goes past the end of the current buffer.\n  bool SkipFallback(int count, int original_buffer_size);\n\n  // Advance the buffer by a given number of bytes.\n  void Advance(int amount);\n\n  // Back up input_ to the current buffer position.\n  void BackUpInputToCurrentPosition();\n\n  // Recomputes the value of buffer_size_after_limit_.  Must be called after\n  // current_limit_ or total_bytes_limit_ changes.\n  void RecomputeBufferLimits();\n\n  // Writes an error message saying that we hit total_bytes_limit_.\n  void PrintTotalBytesLimitError();\n\n  // Called when the buffer runs out to request more data.  Implies an\n  // Advance(BufferSize()).\n  bool Refresh();\n\n  // When parsing varints, we optimize for the common case of small values, and\n  // then optimize for the case when the varint fits within the current buffer\n  // piece. The Fallback method is used when we can't use the one-byte\n  // optimization. The Slow method is yet another fallback when the buffer is\n  // not large enough. Making the slow path out-of-line speeds up the common\n  // case by 10-15%. The slow path is fairly uncommon: it only triggers when a\n  // message crosses multiple buffers.  Note: ReadVarint32Fallback() and\n  // ReadVarint64Fallback() are called frequently and generally not inlined, so\n  // they have been optimized to avoid \"out\" parameters.  The former returns -1\n  // if it fails and the uint32 it read otherwise.  The latter has a bool\n  // indicating success or failure as part of its return type.\n  int64 ReadVarint32Fallback(uint32 first_byte_or_zero);\n  int ReadVarintSizeAsIntFallback();\n  std::pair<uint64, bool> ReadVarint64Fallback();\n  bool ReadVarint32Slow(uint32* value);\n  bool ReadVarint64Slow(uint64* value);\n  int ReadVarintSizeAsIntSlow();\n  bool ReadLittleEndian32Fallback(uint32* value);\n  bool ReadLittleEndian64Fallback(uint64* value);\n\n  // Fallback/slow methods for reading tags. These do not update last_tag_,\n  // but will set legitimate_message_end_ if we are at the end of the input\n  // stream.\n  uint32 ReadTagFallback(uint32 first_byte_or_zero);\n  uint32 ReadTagSlow();\n  bool ReadStringFallback(string* buffer, int size);\n\n  // Return the size of the buffer.\n  int BufferSize() const;\n\n  static const int kDefaultTotalBytesLimit = INT_MAX;\n\n  static int default_recursion_limit_;  // 100 by default.\n};\n\n// Class which encodes and writes binary data which is composed of varint-\n// encoded integers and fixed-width pieces.  Wraps a ZeroCopyOutputStream.\n// Most users will not need to deal with CodedOutputStream.\n//\n// Most methods of CodedOutputStream which return a bool return false if an\n// underlying I/O error occurs.  Once such a failure occurs, the\n// CodedOutputStream is broken and is no longer useful. The Write* methods do\n// not return the stream status, but will invalidate the stream if an error\n// occurs. The client can probe HadError() to determine the status.\n//\n// Note that every method of CodedOutputStream which writes some data has\n// a corresponding static \"ToArray\" version. These versions write directly\n// to the provided buffer, returning a pointer past the last written byte.\n// They require that the buffer has sufficient capacity for the encoded data.\n// This allows an optimization where we check if an output stream has enough\n// space for an entire message before we start writing and, if there is, we\n// call only the ToArray methods to avoid doing bound checks for each\n// individual value.\n// i.e., in the example above:\n//\n//   CodedOutputStream coded_output = new CodedOutputStream(raw_output);\n//   int magic_number = 1234;\n//   char text[] = \"Hello world!\";\n//\n//   int coded_size = sizeof(magic_number) +\n//                    CodedOutputStream::VarintSize32(strlen(text)) +\n//                    strlen(text);\n//\n//   uint8* buffer =\n//       coded_output->GetDirectBufferForNBytesAndAdvance(coded_size);\n//   if (buffer != NULL) {\n//     // The output stream has enough space in the buffer: write directly to\n//     // the array.\n//     buffer = CodedOutputStream::WriteLittleEndian32ToArray(magic_number,\n//                                                            buffer);\n//     buffer = CodedOutputStream::WriteVarint32ToArray(strlen(text), buffer);\n//     buffer = CodedOutputStream::WriteRawToArray(text, strlen(text), buffer);\n//   } else {\n//     // Make bound-checked writes, which will ask the underlying stream for\n//     // more space as needed.\n//     coded_output->WriteLittleEndian32(magic_number);\n//     coded_output->WriteVarint32(strlen(text));\n//     coded_output->WriteRaw(text, strlen(text));\n//   }\n//\n//   delete coded_output;\nclass LIBPROTOBUF_EXPORT CodedOutputStream {\n public:\n  // Create an CodedOutputStream that writes to the given ZeroCopyOutputStream.\n  explicit CodedOutputStream(ZeroCopyOutputStream* output);\n  CodedOutputStream(ZeroCopyOutputStream* output, bool do_eager_refresh);\n\n  // Destroy the CodedOutputStream and position the underlying\n  // ZeroCopyOutputStream immediately after the last byte written.\n  ~CodedOutputStream();\n\n  // Trims any unused space in the underlying buffer so that its size matches\n  // the number of bytes written by this stream. The underlying buffer will\n  // automatically be trimmed when this stream is destroyed; this call is only\n  // necessary if the underlying buffer is accessed *before* the stream is\n  // destroyed.\n  void Trim();\n\n  // Skips a number of bytes, leaving the bytes unmodified in the underlying\n  // buffer.  Returns false if an underlying write error occurs.  This is\n  // mainly useful with GetDirectBufferPointer().\n  bool Skip(int count);\n\n  // Sets *data to point directly at the unwritten part of the\n  // CodedOutputStream's underlying buffer, and *size to the size of that\n  // buffer, but does not advance the stream's current position.  This will\n  // always either produce a non-empty buffer or return false.  If the caller\n  // writes any data to this buffer, it should then call Skip() to skip over\n  // the consumed bytes.  This may be useful for implementing external fast\n  // serialization routines for types of data not covered by the\n  // CodedOutputStream interface.\n  bool GetDirectBufferPointer(void** data, int* size);\n\n  // If there are at least \"size\" bytes available in the current buffer,\n  // returns a pointer directly into the buffer and advances over these bytes.\n  // The caller may then write directly into this buffer (e.g. using the\n  // *ToArray static methods) rather than go through CodedOutputStream.  If\n  // there are not enough bytes available, returns NULL.  The return pointer is\n  // invalidated as soon as any other non-const method of CodedOutputStream\n  // is called.\n  inline uint8* GetDirectBufferForNBytesAndAdvance(int size);\n\n  // Write raw bytes, copying them from the given buffer.\n  void WriteRaw(const void* buffer, int size);\n  // Like WriteRaw()  but will try to write aliased data if aliasing is\n  // turned on.\n  void WriteRawMaybeAliased(const void* data, int size);\n  // Like WriteRaw()  but writing directly to the target array.\n  // This is _not_ inlined, as the compiler often optimizes memcpy into inline\n  // copy loops. Since this gets called by every field with string or bytes\n  // type, inlining may lead to a significant amount of code bloat, with only a\n  // minor performance gain.\n  static uint8* WriteRawToArray(const void* buffer, int size, uint8* target);\n\n  // Equivalent to WriteRaw(str.data(), str.size()).\n  void WriteString(const string& str);\n  // Like WriteString()  but writing directly to the target array.\n  static uint8* WriteStringToArray(const string& str, uint8* target);\n  // Write the varint-encoded size of str followed by str.\n  static uint8* WriteStringWithSizeToArray(const string& str, uint8* target);\n\n\n  // Instructs the CodedOutputStream to allow the underlying\n  // ZeroCopyOutputStream to hold pointers to the original structure instead of\n  // copying, if it supports it (i.e. output->AllowsAliasing() is true).  If the\n  // underlying stream does not support aliasing, then enabling it has no\n  // affect.  For now, this only affects the behavior of\n  // WriteRawMaybeAliased().\n  //\n  // NOTE: It is caller's responsibility to ensure that the chunk of memory\n  // remains live until all of the data has been consumed from the stream.\n  void EnableAliasing(bool enabled);\n\n  // Write a 32-bit little-endian integer.\n  void WriteLittleEndian32(uint32 value);\n  // Like WriteLittleEndian32()  but writing directly to the target array.\n  static uint8* WriteLittleEndian32ToArray(uint32 value, uint8* target);\n  // Write a 64-bit little-endian integer.\n  void WriteLittleEndian64(uint64 value);\n  // Like WriteLittleEndian64()  but writing directly to the target array.\n  static uint8* WriteLittleEndian64ToArray(uint64 value, uint8* target);\n\n  // Write an unsigned integer with Varint encoding.  Writing a 32-bit value\n  // is equivalent to casting it to uint64 and writing it as a 64-bit value,\n  // but may be more efficient.\n  void WriteVarint32(uint32 value);\n  // Like WriteVarint32()  but writing directly to the target array.\n  static uint8* WriteVarint32ToArray(uint32 value, uint8* target);\n  // Write an unsigned integer with Varint encoding.\n  void WriteVarint64(uint64 value);\n  // Like WriteVarint64()  but writing directly to the target array.\n  static uint8* WriteVarint64ToArray(uint64 value, uint8* target);\n\n  // Equivalent to WriteVarint32() except when the value is negative,\n  // in which case it must be sign-extended to a full 10 bytes.\n  void WriteVarint32SignExtended(int32 value);\n  // Like WriteVarint32SignExtended()  but writing directly to the target array.\n  static uint8* WriteVarint32SignExtendedToArray(int32 value, uint8* target);\n\n  // This is identical to WriteVarint32(), but optimized for writing tags.\n  // In particular, if the input is a compile-time constant, this method\n  // compiles down to a couple instructions.\n  // Always inline because otherwise the aformentioned optimization can't work,\n  // but GCC by default doesn't want to inline this.\n  void WriteTag(uint32 value);\n  // Like WriteTag()  but writing directly to the target array.\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  static uint8* WriteTagToArray(uint32 value, uint8* target);\n\n  // Returns the number of bytes needed to encode the given value as a varint.\n  static size_t VarintSize32(uint32 value);\n  // Returns the number of bytes needed to encode the given value as a varint.\n  static size_t VarintSize64(uint64 value);\n\n  // If negative, 10 bytes.  Otheriwse, same as VarintSize32().\n  static size_t VarintSize32SignExtended(int32 value);\n\n  // Compile-time equivalent of VarintSize32().\n  template <uint32 Value>\n  struct StaticVarintSize32 {\n    static const size_t value =\n        (Value < (1 << 7))\n            ? 1\n            : (Value < (1 << 14))\n                ? 2\n                : (Value < (1 << 21))\n                    ? 3\n                    : (Value < (1 << 28))\n                        ? 4\n                        : 5;\n  };\n\n  // Returns the total number of bytes written since this object was created.\n  inline int ByteCount() const;\n\n  // Returns true if there was an underlying I/O error since this object was\n  // created.\n  bool HadError() const { return had_error_; }\n\n  // Deterministic serialization, if requested, guarantees that for a given\n  // binary, equal messages will always be serialized to the same bytes. This\n  // implies:\n  //   . repeated serialization of a message will return the same bytes\n  //   . different processes of the same binary (which may be executing on\n  //     different machines) will serialize equal messages to the same bytes.\n  //\n  // Note the deterministic serialization is NOT canonical across languages; it\n  // is also unstable across different builds with schema changes due to unknown\n  // fields. Users who need canonical serialization, e.g., persistent storage in\n  // a canonical form, fingerprinting, etc., should define their own\n  // canonicalization specification and implement the serializer using\n  // reflection APIs rather than relying on this API.\n  //\n  // If deterministic serialization is requested, the serializer will\n  // sort map entries by keys in lexicographical order or numerical order.\n  // (This is an implementation detail and may subject to change.)\n  //\n  // There are two ways to determine whether serialization should be\n  // deterministic for this CodedOutputStream.  If SetSerializationDeterministic\n  // has not yet been called, then the default comes from the global default,\n  // which is false, until SetDefaultSerializationDeterministic has been called.\n  // Otherwise, SetSerializationDeterministic has been called, and the last\n  // value passed to it is all that matters.\n  void SetSerializationDeterministic(bool value) {\n    is_serialization_deterministic_ = value;\n  }\n  // See above.  Also, note that users of this CodedOutputStream may need to\n  // call IsSerializationDeterministic() to serialize in the intended way.  This\n  // CodedOutputStream cannot enforce a desire for deterministic serialization\n  // by itself.\n  bool IsSerializationDeterministic() const {\n    return is_serialization_deterministic_;\n  }\n\n  static bool IsDefaultSerializationDeterministic() {\n    return default_serialization_deterministic_.load(std::memory_order_relaxed) != 0;\n  }\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CodedOutputStream);\n\n  ZeroCopyOutputStream* output_;\n  uint8* buffer_;\n  int buffer_size_;\n  int total_bytes_;  // Sum of sizes of all buffers seen so far.\n  bool had_error_;   // Whether an error occurred during output.\n  bool aliasing_enabled_;  // See EnableAliasing().\n  bool is_serialization_deterministic_;\n  static std::atomic<bool> default_serialization_deterministic_;\n\n  // Advance the buffer by a given number of bytes.\n  void Advance(int amount);\n\n  // Called when the buffer runs out to request more data.  Implies an\n  // Advance(buffer_size_).\n  bool Refresh();\n\n  // Like WriteRaw() but may avoid copying if the underlying\n  // ZeroCopyOutputStream supports it.\n  void WriteAliasedRaw(const void* buffer, int size);\n\n  // If this write might cross the end of the buffer, we compose the bytes first\n  // then use WriteRaw().\n  void WriteVarint32SlowPath(uint32 value);\n  void WriteVarint64SlowPath(uint64 value);\n\n  // See above.  Other projects may use \"friend\" to allow them to call this.\n  // After SetDefaultSerializationDeterministic() completes, all protocol\n  // buffer serializations will be deterministic by default.  Thread safe.\n  // However, the meaning of \"after\" is subtle here: to be safe, each thread\n  // that wants deterministic serialization by default needs to call\n  // SetDefaultSerializationDeterministic() or ensure on its own that another\n  // thread has done so.\n  friend void ::google::protobuf::internal::MapTestForceDeterministic();\n  static void SetDefaultSerializationDeterministic() {\n    default_serialization_deterministic_.store(true, std::memory_order_relaxed);\n  }\n};\n\n// inline methods ====================================================\n// The vast majority of varints are only one byte.  These inline\n// methods optimize for that case.\n\ninline bool CodedInputStream::ReadVarint32(uint32* value) {\n  uint32 v = 0;\n  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_)) {\n    v = *buffer_;\n    if (v < 0x80) {\n      *value = v;\n      Advance(1);\n      return true;\n    }\n  }\n  int64 result = ReadVarint32Fallback(v);\n  *value = static_cast<uint32>(result);\n  return result >= 0;\n}\n\ninline bool CodedInputStream::ReadVarint64(uint64* value) {\n  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_) && *buffer_ < 0x80) {\n    *value = *buffer_;\n    Advance(1);\n    return true;\n  }\n  std::pair<uint64, bool> p = ReadVarint64Fallback();\n  *value = p.first;\n  return p.second;\n}\n\ninline bool CodedInputStream::ReadVarintSizeAsInt(int* value) {\n  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_)) {\n    int v = *buffer_;\n    if (v < 0x80) {\n      *value = v;\n      Advance(1);\n      return true;\n    }\n  }\n  *value = ReadVarintSizeAsIntFallback();\n  return *value >= 0;\n}\n\n// static\ninline const uint8* CodedInputStream::ReadLittleEndian32FromArray(\n    const uint8* buffer,\n    uint32* value) {\n#if defined(PROTOBUF_LITTLE_ENDIAN)\n  memcpy(value, buffer, sizeof(*value));\n  return buffer + sizeof(*value);\n#else\n  *value = (static_cast<uint32>(buffer[0])      ) |\n           (static_cast<uint32>(buffer[1]) <<  8) |\n           (static_cast<uint32>(buffer[2]) << 16) |\n           (static_cast<uint32>(buffer[3]) << 24);\n  return buffer + sizeof(*value);\n#endif\n}\n// static\ninline const uint8* CodedInputStream::ReadLittleEndian64FromArray(\n    const uint8* buffer,\n    uint64* value) {\n#if defined(PROTOBUF_LITTLE_ENDIAN)\n  memcpy(value, buffer, sizeof(*value));\n  return buffer + sizeof(*value);\n#else\n  uint32 part0 = (static_cast<uint32>(buffer[0])      ) |\n                 (static_cast<uint32>(buffer[1]) <<  8) |\n                 (static_cast<uint32>(buffer[2]) << 16) |\n                 (static_cast<uint32>(buffer[3]) << 24);\n  uint32 part1 = (static_cast<uint32>(buffer[4])      ) |\n                 (static_cast<uint32>(buffer[5]) <<  8) |\n                 (static_cast<uint32>(buffer[6]) << 16) |\n                 (static_cast<uint32>(buffer[7]) << 24);\n  *value = static_cast<uint64>(part0) |\n          (static_cast<uint64>(part1) << 32);\n  return buffer + sizeof(*value);\n#endif\n}\n\ninline bool CodedInputStream::ReadLittleEndian32(uint32* value) {\n#if defined(PROTOBUF_LITTLE_ENDIAN)\n  if (GOOGLE_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) {\n    buffer_ = ReadLittleEndian32FromArray(buffer_, value);\n    return true;\n  } else {\n    return ReadLittleEndian32Fallback(value);\n  }\n#else\n  return ReadLittleEndian32Fallback(value);\n#endif\n}\n\ninline bool CodedInputStream::ReadLittleEndian64(uint64* value) {\n#if defined(PROTOBUF_LITTLE_ENDIAN)\n  if (GOOGLE_PREDICT_TRUE(BufferSize() >= static_cast<int>(sizeof(*value)))) {\n    buffer_ = ReadLittleEndian64FromArray(buffer_, value);\n    return true;\n  } else {\n    return ReadLittleEndian64Fallback(value);\n  }\n#else\n  return ReadLittleEndian64Fallback(value);\n#endif\n}\n\ninline uint32 CodedInputStream::ReadTagNoLastTag() {\n  uint32 v = 0;\n  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_)) {\n    v = *buffer_;\n    if (v < 0x80) {\n      Advance(1);\n      return v;\n    }\n  }\n  v = ReadTagFallback(v);\n  return v;\n}\n\ninline std::pair<uint32, bool> CodedInputStream::ReadTagWithCutoffNoLastTag(\n    uint32 cutoff) {\n  // In performance-sensitive code we can expect cutoff to be a compile-time\n  // constant, and things like \"cutoff >= kMax1ByteVarint\" to be evaluated at\n  // compile time.\n  uint32 first_byte_or_zero = 0;\n  if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_)) {\n    // Hot case: buffer_ non_empty, buffer_[0] in [1, 128).\n    // TODO(gpike): Is it worth rearranging this? E.g., if the number of fields\n    // is large enough then is it better to check for the two-byte case first?\n    first_byte_or_zero = buffer_[0];\n    if (static_cast<int8>(buffer_[0]) > 0) {\n      const uint32 kMax1ByteVarint = 0x7f;\n      uint32 tag = buffer_[0];\n      Advance(1);\n      return std::make_pair(tag, cutoff >= kMax1ByteVarint || tag <= cutoff);\n    }\n    // Other hot case: cutoff >= 0x80, buffer_ has at least two bytes available,\n    // and tag is two bytes.  The latter is tested by bitwise-and-not of the\n    // first byte and the second byte.\n    if (cutoff >= 0x80 && GOOGLE_PREDICT_TRUE(buffer_ + 1 < buffer_end_) &&\n        GOOGLE_PREDICT_TRUE((buffer_[0] & ~buffer_[1]) >= 0x80)) {\n      const uint32 kMax2ByteVarint = (0x7f << 7) + 0x7f;\n      uint32 tag = (1u << 7) * buffer_[1] + (buffer_[0] - 0x80);\n      Advance(2);\n      // It might make sense to test for tag == 0 now, but it is so rare that\n      // that we don't bother.  A varint-encoded 0 should be one byte unless\n      // the encoder lost its mind.  The second part of the return value of\n      // this function is allowed to be either true or false if the tag is 0,\n      // so we don't have to check for tag == 0.  We may need to check whether\n      // it exceeds cutoff.\n      bool at_or_below_cutoff = cutoff >= kMax2ByteVarint || tag <= cutoff;\n      return std::make_pair(tag, at_or_below_cutoff);\n    }\n  }\n  // Slow path\n  const uint32 tag = ReadTagFallback(first_byte_or_zero);\n  return std::make_pair(tag, static_cast<uint32>(tag - 1) < cutoff);\n}\n\ninline bool CodedInputStream::LastTagWas(uint32 expected) {\n  return last_tag_ == expected;\n}\n\ninline bool CodedInputStream::ConsumedEntireMessage() {\n  return legitimate_message_end_;\n}\n\ninline bool CodedInputStream::ExpectTag(uint32 expected) {\n  if (expected < (1 << 7)) {\n    if (GOOGLE_PREDICT_TRUE(buffer_ < buffer_end_) && buffer_[0] == expected) {\n      Advance(1);\n      return true;\n    } else {\n      return false;\n    }\n  } else if (expected < (1 << 14)) {\n    if (GOOGLE_PREDICT_TRUE(BufferSize() >= 2) &&\n        buffer_[0] == static_cast<uint8>(expected | 0x80) &&\n        buffer_[1] == static_cast<uint8>(expected >> 7)) {\n      Advance(2);\n      return true;\n    } else {\n      return false;\n    }\n  } else {\n    // Don't bother optimizing for larger values.\n    return false;\n  }\n}\n\ninline const uint8* CodedInputStream::ExpectTagFromArray(\n    const uint8* buffer, uint32 expected) {\n  if (expected < (1 << 7)) {\n    if (buffer[0] == expected) {\n      return buffer + 1;\n    }\n  } else if (expected < (1 << 14)) {\n    if (buffer[0] == static_cast<uint8>(expected | 0x80) &&\n        buffer[1] == static_cast<uint8>(expected >> 7)) {\n      return buffer + 2;\n    }\n  }\n  return NULL;\n}\n\ninline void CodedInputStream::GetDirectBufferPointerInline(const void** data,\n                                                           int* size) {\n  *data = buffer_;\n  *size = static_cast<int>(buffer_end_ - buffer_);\n}\n\ninline bool CodedInputStream::ExpectAtEnd() {\n  // If we are at a limit we know no more bytes can be read.  Otherwise, it's\n  // hard to say without calling Refresh(), and we'd rather not do that.\n\n  if (buffer_ == buffer_end_ &&\n      ((buffer_size_after_limit_ != 0) ||\n       (total_bytes_read_ == current_limit_))) {\n    last_tag_ = 0;                   // Pretend we called ReadTag()...\n    legitimate_message_end_ = true;  // ... and it hit EOF.\n    return true;\n  } else {\n    return false;\n  }\n}\n\ninline int CodedInputStream::CurrentPosition() const {\n  return total_bytes_read_ - (BufferSize() + buffer_size_after_limit_);\n}\n\ninline uint8* CodedOutputStream::GetDirectBufferForNBytesAndAdvance(int size) {\n  if (buffer_size_ < size) {\n    return NULL;\n  } else {\n    uint8* result = buffer_;\n    Advance(size);\n    return result;\n  }\n}\n\ninline uint8* CodedOutputStream::WriteVarint32ToArray(uint32 value,\n                                                      uint8* target) {\n  while (value >= 0x80) {\n    *target = static_cast<uint8>(value | 0x80);\n    value >>= 7;\n    ++target;\n  }\n  *target = static_cast<uint8>(value);\n  return target + 1;\n}\n\ninline uint8* CodedOutputStream::WriteVarint64ToArray(uint64 value,\n                                                      uint8* target) {\n  while (value >= 0x80) {\n    *target = static_cast<uint8>(value | 0x80);\n    value >>= 7;\n    ++target;\n  }\n  *target = static_cast<uint8>(value);\n  return target + 1;\n}\n\ninline void CodedOutputStream::WriteVarint32SignExtended(int32 value) {\n  WriteVarint64(static_cast<uint64>(value));\n}\n\ninline uint8* CodedOutputStream::WriteVarint32SignExtendedToArray(\n    int32 value, uint8* target) {\n  return WriteVarint64ToArray(static_cast<uint64>(value), target);\n}\n\ninline uint8* CodedOutputStream::WriteLittleEndian32ToArray(uint32 value,\n                                                            uint8* target) {\n#if defined(PROTOBUF_LITTLE_ENDIAN)\n  memcpy(target, &value, sizeof(value));\n#else\n  target[0] = static_cast<uint8>(value);\n  target[1] = static_cast<uint8>(value >>  8);\n  target[2] = static_cast<uint8>(value >> 16);\n  target[3] = static_cast<uint8>(value >> 24);\n#endif\n  return target + sizeof(value);\n}\n\ninline uint8* CodedOutputStream::WriteLittleEndian64ToArray(uint64 value,\n                                                            uint8* target) {\n#if defined(PROTOBUF_LITTLE_ENDIAN)\n  memcpy(target, &value, sizeof(value));\n#else\n  uint32 part0 = static_cast<uint32>(value);\n  uint32 part1 = static_cast<uint32>(value >> 32);\n\n  target[0] = static_cast<uint8>(part0);\n  target[1] = static_cast<uint8>(part0 >>  8);\n  target[2] = static_cast<uint8>(part0 >> 16);\n  target[3] = static_cast<uint8>(part0 >> 24);\n  target[4] = static_cast<uint8>(part1);\n  target[5] = static_cast<uint8>(part1 >>  8);\n  target[6] = static_cast<uint8>(part1 >> 16);\n  target[7] = static_cast<uint8>(part1 >> 24);\n#endif\n  return target + sizeof(value);\n}\n\ninline void CodedOutputStream::WriteVarint32(uint32 value) {\n  if (buffer_size_ >= 5) {\n    // Fast path:  We have enough bytes left in the buffer to guarantee that\n    // this write won't cross the end, so we can skip the checks.\n    uint8* target = buffer_;\n    uint8* end = WriteVarint32ToArray(value, target);\n    int size = static_cast<int>(end - target);\n    Advance(size);\n  } else {\n    WriteVarint32SlowPath(value);\n  }\n}\n\ninline void CodedOutputStream::WriteVarint64(uint64 value) {\n  if (buffer_size_ >= 10) {\n    // Fast path:  We have enough bytes left in the buffer to guarantee that\n    // this write won't cross the end, so we can skip the checks.\n    uint8* target = buffer_;\n    uint8* end = WriteVarint64ToArray(value, target);\n    int size = static_cast<int>(end - target);\n    Advance(size);\n  } else {\n    WriteVarint64SlowPath(value);\n  }\n}\n\ninline void CodedOutputStream::WriteTag(uint32 value) {\n  WriteVarint32(value);\n}\n\ninline uint8* CodedOutputStream::WriteTagToArray(\n    uint32 value, uint8* target) {\n  return WriteVarint32ToArray(value, target);\n}\n\ninline size_t CodedOutputStream::VarintSize32(uint32 value) {\n  // This computes value == 0 ? 1 : floor(log2(value)) / 7 + 1\n  // Use an explicit multiplication to implement the divide of\n  // a number in the 1..31 range.\n  // Explicit OR 0x1 to avoid calling Bits::Log2FloorNonZero(0), which is\n  // undefined.\n  uint32 log2value = Bits::Log2FloorNonZero(value | 0x1);\n  return static_cast<size_t>((log2value * 9 + 73) / 64);\n}\n\ninline size_t CodedOutputStream::VarintSize64(uint64 value) {\n  // This computes value == 0 ? 1 : floor(log2(value)) / 7 + 1\n  // Use an explicit multiplication to implement the divide of\n  // a number in the 1..63 range.\n  // Explicit OR 0x1 to avoid calling Bits::Log2FloorNonZero(0), which is\n  // undefined.\n  uint32 log2value = Bits::Log2FloorNonZero64(value | 0x1);\n  return static_cast<size_t>((log2value * 9 + 73) / 64);\n}\n\ninline size_t CodedOutputStream::VarintSize32SignExtended(int32 value) {\n  if (value < 0) {\n    return 10;     // TODO(kenton):  Make this a symbolic constant.\n  } else {\n    return VarintSize32(static_cast<uint32>(value));\n  }\n}\n\ninline void CodedOutputStream::WriteString(const string& str) {\n  WriteRaw(str.data(), static_cast<int>(str.size()));\n}\n\ninline void CodedOutputStream::WriteRawMaybeAliased(\n    const void* data, int size) {\n  if (aliasing_enabled_) {\n    WriteAliasedRaw(data, size);\n  } else {\n    WriteRaw(data, size);\n  }\n}\n\ninline uint8* CodedOutputStream::WriteStringToArray(\n    const string& str, uint8* target) {\n  return WriteRawToArray(str.data(), static_cast<int>(str.size()), target);\n}\n\ninline int CodedOutputStream::ByteCount() const {\n  return total_bytes_ - buffer_size_;\n}\n\ninline void CodedInputStream::Advance(int amount) {\n  buffer_ += amount;\n}\n\ninline void CodedOutputStream::Advance(int amount) {\n  buffer_ += amount;\n  buffer_size_ -= amount;\n}\n\ninline void CodedInputStream::SetRecursionLimit(int limit) {\n  recursion_budget_ += limit - recursion_limit_;\n  recursion_limit_ = limit;\n}\n\ninline bool CodedInputStream::IncrementRecursionDepth() {\n  --recursion_budget_;\n  return recursion_budget_ >= 0;\n}\n\ninline void CodedInputStream::DecrementRecursionDepth() {\n  if (recursion_budget_ < recursion_limit_) ++recursion_budget_;\n}\n\ninline void CodedInputStream::UnsafeDecrementRecursionDepth() {\n  assert(recursion_budget_ < recursion_limit_);\n  ++recursion_budget_;\n}\n\ninline void CodedInputStream::SetExtensionRegistry(const DescriptorPool* pool,\n                                                   MessageFactory* factory) {\n  extension_pool_ = pool;\n  extension_factory_ = factory;\n}\n\ninline const DescriptorPool* CodedInputStream::GetExtensionPool() {\n  return extension_pool_;\n}\n\ninline MessageFactory* CodedInputStream::GetExtensionFactory() {\n  return extension_factory_;\n}\n\ninline int CodedInputStream::BufferSize() const {\n  return static_cast<int>(buffer_end_ - buffer_);\n}\n\ninline CodedInputStream::CodedInputStream(ZeroCopyInputStream* input)\n  : buffer_(NULL),\n    buffer_end_(NULL),\n    input_(input),\n    total_bytes_read_(0),\n    overflow_bytes_(0),\n    last_tag_(0),\n    legitimate_message_end_(false),\n    aliasing_enabled_(false),\n    current_limit_(kint32max),\n    buffer_size_after_limit_(0),\n    total_bytes_limit_(kDefaultTotalBytesLimit),\n    recursion_budget_(default_recursion_limit_),\n    recursion_limit_(default_recursion_limit_),\n    extension_pool_(NULL),\n    extension_factory_(NULL) {\n  // Eagerly Refresh() so buffer space is immediately available.\n  Refresh();\n}\n\ninline CodedInputStream::CodedInputStream(const uint8* buffer, int size)\n  : buffer_(buffer),\n    buffer_end_(buffer + size),\n    input_(NULL),\n    total_bytes_read_(size),\n    overflow_bytes_(0),\n    last_tag_(0),\n    legitimate_message_end_(false),\n    aliasing_enabled_(false),\n    current_limit_(size),\n    buffer_size_after_limit_(0),\n    total_bytes_limit_(kDefaultTotalBytesLimit),\n    recursion_budget_(default_recursion_limit_),\n    recursion_limit_(default_recursion_limit_),\n    extension_pool_(NULL),\n    extension_factory_(NULL) {\n  // Note that setting current_limit_ == size is important to prevent some\n  // code paths from trying to access input_ and segfaulting.\n}\n\ninline bool CodedInputStream::IsFlat() const {\n  return input_ == NULL;\n}\n\ninline bool CodedInputStream::Skip(int count) {\n  if (count < 0) return false;  // security: count is often user-supplied\n\n  const int original_buffer_size = BufferSize();\n\n  if (count <= original_buffer_size) {\n    // Just skipping within the current buffer.  Easy.\n    Advance(count);\n    return true;\n  }\n\n  return SkipFallback(count, original_buffer_size);\n}\n\n}  // namespace io\n}  // namespace protobuf\n\n\n#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)\n  #pragma runtime_checks(\"c\", restore)\n#endif  // _MSC_VER && !defined(__INTEL_COMPILER)\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_IO_CODED_STREAM_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/io/gzip_stream.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: brianolson@google.com (Brian Olson)\n//\n// This file contains the definition for classes GzipInputStream and\n// GzipOutputStream.\n//\n// GzipInputStream decompresses data from an underlying\n// ZeroCopyInputStream and provides the decompressed data as a\n// ZeroCopyInputStream.\n//\n// GzipOutputStream is an ZeroCopyOutputStream that compresses data to\n// an underlying ZeroCopyOutputStream.\n\n#ifndef GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__\n#define GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/io/zero_copy_stream.h>\n#include <zlib.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace io {\n\n// A ZeroCopyInputStream that reads compressed data through zlib\nclass LIBPROTOBUF_EXPORT GzipInputStream : public ZeroCopyInputStream {\n public:\n  // Format key for constructor\n  enum Format {\n    // zlib will autodetect gzip header or deflate stream\n    AUTO = 0,\n\n    // GZIP streams have some extra header data for file attributes.\n    GZIP = 1,\n\n    // Simpler zlib stream format.\n    ZLIB = 2,\n  };\n\n  // buffer_size and format may be -1 for default of 64kB and GZIP format\n  explicit GzipInputStream(\n      ZeroCopyInputStream* sub_stream,\n      Format format = AUTO,\n      int buffer_size = -1);\n  virtual ~GzipInputStream();\n\n  // Return last error message or NULL if no error.\n  inline const char* ZlibErrorMessage() const {\n    return zcontext_.msg;\n  }\n  inline int ZlibErrorCode() const {\n    return zerror_;\n  }\n\n  // implements ZeroCopyInputStream ----------------------------------\n  bool Next(const void** data, int* size);\n  void BackUp(int count);\n  bool Skip(int count);\n  int64 ByteCount() const;\n\n private:\n  Format format_;\n\n  ZeroCopyInputStream* sub_stream_;\n\n  z_stream zcontext_;\n  int zerror_;\n\n  void* output_buffer_;\n  void* output_position_;\n  size_t output_buffer_length_;\n  int64 byte_count_;\n\n  int Inflate(int flush);\n  void DoNextOutput(const void** data, int* size);\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GzipInputStream);\n};\n\n\nclass LIBPROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream {\n public:\n  // Format key for constructor\n  enum Format {\n    // GZIP streams have some extra header data for file attributes.\n    GZIP = 1,\n\n    // Simpler zlib stream format.\n    ZLIB = 2,\n  };\n\n  struct Options {\n    // Defaults to GZIP.\n    Format format;\n\n    // What size buffer to use internally.  Defaults to 64kB.\n    int buffer_size;\n\n    // A number between 0 and 9, where 0 is no compression and 9 is best\n    // compression.  Defaults to Z_DEFAULT_COMPRESSION (see zlib.h).\n    int compression_level;\n\n    // Defaults to Z_DEFAULT_STRATEGY.  Can also be set to Z_FILTERED,\n    // Z_HUFFMAN_ONLY, or Z_RLE.  See the documentation for deflateInit2 in\n    // zlib.h for definitions of these constants.\n    int compression_strategy;\n\n    Options();  // Initializes with default values.\n  };\n\n  // Create a GzipOutputStream with default options.\n  explicit GzipOutputStream(ZeroCopyOutputStream* sub_stream);\n\n  // Create a GzipOutputStream with the given options.\n  GzipOutputStream(\n      ZeroCopyOutputStream* sub_stream,\n      const Options& options);\n\n  virtual ~GzipOutputStream();\n\n  // Return last error message or NULL if no error.\n  inline const char* ZlibErrorMessage() const {\n    return zcontext_.msg;\n  }\n  inline int ZlibErrorCode() const {\n    return zerror_;\n  }\n\n  // Flushes data written so far to zipped data in the underlying stream.\n  // It is the caller's responsibility to flush the underlying stream if\n  // necessary.\n  // Compression may be less efficient stopping and starting around flushes.\n  // Returns true if no error.\n  //\n  // Please ensure that block size is > 6. Here is an excerpt from the zlib\n  // doc that explains why:\n  //\n  // In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that avail_out\n  // is greater than six to avoid repeated flush markers due to\n  // avail_out == 0 on return.\n  bool Flush();\n\n  // Writes out all data and closes the gzip stream.\n  // It is the caller's responsibility to close the underlying stream if\n  // necessary.\n  // Returns true if no error.\n  bool Close();\n\n  // implements ZeroCopyOutputStream ---------------------------------\n  bool Next(void** data, int* size);\n  void BackUp(int count);\n  int64 ByteCount() const;\n\n private:\n  ZeroCopyOutputStream* sub_stream_;\n  // Result from calling Next() on sub_stream_\n  void* sub_data_;\n  int sub_data_size_;\n\n  z_stream zcontext_;\n  int zerror_;\n  void* input_buffer_;\n  size_t input_buffer_length_;\n\n  // Shared constructor code.\n  void Init(ZeroCopyOutputStream* sub_stream, const Options& options);\n\n  // Do some compression.\n  // Takes zlib flush mode.\n  // Returns zlib error code.\n  int Deflate(int flush);\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GzipOutputStream);\n};\n\n}  // namespace io\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/io/printer.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Utility class for writing text to a ZeroCopyOutputStream.\n\n#ifndef GOOGLE_PROTOBUF_IO_PRINTER_H__\n#define GOOGLE_PROTOBUF_IO_PRINTER_H__\n\n#include <string>\n#include <map>\n#include <vector>\n#include <google/protobuf/stubs/common.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace io {\n\nclass ZeroCopyOutputStream;     // zero_copy_stream.h\n\n// Records annotations about a Printer's output.\nclass LIBPROTOBUF_EXPORT AnnotationCollector {\n public:\n  // Records that the bytes in file_path beginning with begin_offset and ending\n  // before end_offset are associated with the SourceCodeInfo-style path.\n  virtual void AddAnnotation(size_t begin_offset, size_t end_offset,\n                             const string& file_path,\n                             const std::vector<int>& path) = 0;\n\n  virtual ~AnnotationCollector() {}\n};\n\n// Records annotations about a Printer's output to the given protocol buffer,\n// assuming that the buffer has an ::Annotation message exposing path,\n// source_file, begin and end fields.\ntemplate <typename AnnotationProto>\nclass AnnotationProtoCollector : public AnnotationCollector {\n public:\n  // annotation_proto is the protocol buffer to which new Annotations should be\n  // added. It is not owned by the AnnotationProtoCollector.\n  explicit AnnotationProtoCollector(AnnotationProto* annotation_proto)\n      : annotation_proto_(annotation_proto) {}\n\n  // Override for AnnotationCollector::AddAnnotation.\n  virtual void AddAnnotation(size_t begin_offset, size_t end_offset,\n                             const string& file_path,\n                             const std::vector<int>& path) {\n    typename AnnotationProto::Annotation* annotation =\n        annotation_proto_->add_annotation();\n    for (int i = 0; i < path.size(); ++i) {\n      annotation->add_path(path[i]);\n    }\n    annotation->set_source_file(file_path);\n    annotation->set_begin(begin_offset);\n    annotation->set_end(end_offset);\n  }\n\n private:\n  // The protocol buffer to which new annotations should be added.\n  AnnotationProto* const annotation_proto_;\n};\n\n// This simple utility class assists in code generation.  It basically\n// allows the caller to define a set of variables and then output some\n// text with variable substitutions.  Example usage:\n//\n//   Printer printer(output, '$');\n//   map<string, string> vars;\n//   vars[\"name\"] = \"Bob\";\n//   printer.Print(vars, \"My name is $name$.\");\n//\n// The above writes \"My name is Bob.\" to the output stream.\n//\n// Printer aggressively enforces correct usage, crashing (with assert failures)\n// in the case of undefined variables in debug builds. This helps greatly in\n// debugging code which uses it.\n//\n// If a Printer is constructed with an AnnotationCollector, it will provide it\n// with annotations that connect the Printer's output to paths that can identify\n// various descriptors.  In the above example, if person_ is a descriptor that\n// identifies Bob, we can associate the output string \"My name is Bob.\" with\n// a source path pointing to that descriptor with:\n//\n//   printer.Annotate(\"name\", person_);\n//\n// The AnnotationCollector will be sent an annotation linking the output range\n// covering \"Bob\" to the logical path provided by person_.  Tools may use\n// this association to (for example) link \"Bob\" in the output back to the\n// source file that defined the person_ descriptor identifying Bob.\n//\n// Annotate can only examine variables substituted during the last call to\n// Print.  It is invalid to refer to a variable that was used multiple times\n// in a single Print call.\n//\n// In full generality, one may specify a range of output text using a beginning\n// substitution variable and an ending variable.  The resulting annotation will\n// span from the first character of the substituted value for the beginning\n// variable to the last character of the substituted value for the ending\n// variable.  For example, the Annotate call above is equivalent to this one:\n//\n//   printer.Annotate(\"name\", \"name\", person_);\n//\n// This is useful if multiple variables combine to form a single span of output\n// that should be annotated with the same source path.  For example:\n//\n//   Printer printer(output, '$');\n//   map<string, string> vars;\n//   vars[\"first\"] = \"Alice\";\n//   vars[\"last\"] = \"Smith\";\n//   printer.Print(vars, \"My name is $first$ $last$.\");\n//   printer.Annotate(\"first\", \"last\", person_);\n//\n// This code would associate the span covering \"Alice Smith\" in the output with\n// the person_ descriptor.\n//\n// Note that the beginning variable must come before (or overlap with, in the\n// case of zero-sized substitution values) the ending variable.\n//\n// It is also sometimes useful to use variables with zero-sized values as\n// markers.  This avoids issues with multiple references to the same variable\n// and also allows annotation ranges to span literal text from the Print\n// templates:\n//\n//   Printer printer(output, '$');\n//   map<string, string> vars;\n//   vars[\"foo\"] = \"bar\";\n//   vars[\"function\"] = \"call\";\n//   vars[\"mark\"] = \"\";\n//   printer.Print(vars, \"$function$($foo$,$foo$)$mark$\");\n//   printer.Annotate(\"function\", \"mark\", call_);\n//\n// This code associates the span covering \"call(bar,bar)\" in the output with the\n// call_ descriptor.\n\nclass LIBPROTOBUF_EXPORT Printer {\n public:\n  // Create a printer that writes text to the given output stream.  Use the\n  // given character as the delimiter for variables.\n  Printer(ZeroCopyOutputStream* output, char variable_delimiter);\n\n  // Create a printer that writes text to the given output stream.  Use the\n  // given character as the delimiter for variables.  If annotation_collector\n  // is not null, Printer will provide it with annotations about code written\n  // to the stream.  annotation_collector is not owned by Printer.\n  Printer(ZeroCopyOutputStream* output, char variable_delimiter,\n          AnnotationCollector* annotation_collector);\n\n  ~Printer();\n\n  // Link a subsitution variable emitted by the last call to Print to the object\n  // described by descriptor.\n  template <typename SomeDescriptor>\n  void Annotate(const char* varname, const SomeDescriptor* descriptor) {\n    Annotate(varname, varname, descriptor);\n  }\n\n  // Link the output range defined by the substitution variables as emitted by\n  // the last call to Print to the object described by descriptor. The range\n  // begins at begin_varname's value and ends after the last character of the\n  // value substituted for end_varname.\n  template <typename SomeDescriptor>\n  void Annotate(const char* begin_varname, const char* end_varname,\n                const SomeDescriptor* descriptor) {\n    if (annotation_collector_ == NULL) {\n      // Annotations aren't turned on for this Printer, so don't pay the cost\n      // of building the location path.\n      return;\n    }\n    std::vector<int> path;\n    descriptor->GetLocationPath(&path);\n    Annotate(begin_varname, end_varname, descriptor->file()->name(), path);\n  }\n\n  // Link a subsitution variable emitted by the last call to Print to the file\n  // with path file_name.\n  void Annotate(const char* varname, const string& file_name) {\n    Annotate(varname, varname, file_name);\n  }\n\n  // Link the output range defined by the substitution variables as emitted by\n  // the last call to Print to the file with path file_name. The range begins\n  // at begin_varname's value and ends after the last character of the value\n  // substituted for end_varname.\n  void Annotate(const char* begin_varname, const char* end_varname,\n                const string& file_name) {\n    if (annotation_collector_ == NULL) {\n      // Annotations aren't turned on for this Printer.\n      return;\n    }\n    std::vector<int> empty_path;\n    Annotate(begin_varname, end_varname, file_name, empty_path);\n  }\n\n  // Print some text after applying variable substitutions.  If a particular\n  // variable in the text is not defined, this will crash.  Variables to be\n  // substituted are identified by their names surrounded by delimiter\n  // characters (as given to the constructor).  The variable bindings are\n  // defined by the given map.\n  void Print(const std::map<string, string>& variables, const char* text);\n\n  // Like the first Print(), except the substitutions are given as parameters.\n  void Print(const char* text);\n  // Like the first Print(), except the substitutions are given as parameters.\n  void Print(const char* text, const char* variable, const string& value);\n  // Like the first Print(), except the substitutions are given as parameters.\n  void Print(const char* text, const char* variable1, const string& value1,\n                               const char* variable2, const string& value2);\n  // Like the first Print(), except the substitutions are given as parameters.\n  void Print(const char* text, const char* variable1, const string& value1,\n                               const char* variable2, const string& value2,\n                               const char* variable3, const string& value3);\n  // Like the first Print(), except the substitutions are given as parameters.\n  void Print(const char* text, const char* variable1, const string& value1,\n                               const char* variable2, const string& value2,\n                               const char* variable3, const string& value3,\n                               const char* variable4, const string& value4);\n  // Like the first Print(), except the substitutions are given as parameters.\n  void Print(const char* text, const char* variable1, const string& value1,\n                               const char* variable2, const string& value2,\n                               const char* variable3, const string& value3,\n                               const char* variable4, const string& value4,\n                               const char* variable5, const string& value5);\n  // Like the first Print(), except the substitutions are given as parameters.\n  void Print(const char* text, const char* variable1, const string& value1,\n                               const char* variable2, const string& value2,\n                               const char* variable3, const string& value3,\n                               const char* variable4, const string& value4,\n                               const char* variable5, const string& value5,\n                               const char* variable6, const string& value6);\n  // Like the first Print(), except the substitutions are given as parameters.\n  void Print(const char* text, const char* variable1, const string& value1,\n                               const char* variable2, const string& value2,\n                               const char* variable3, const string& value3,\n                               const char* variable4, const string& value4,\n                               const char* variable5, const string& value5,\n                               const char* variable6, const string& value6,\n                               const char* variable7, const string& value7);\n  // Like the first Print(), except the substitutions are given as parameters.\n  void Print(const char* text, const char* variable1, const string& value1,\n                               const char* variable2, const string& value2,\n                               const char* variable3, const string& value3,\n                               const char* variable4, const string& value4,\n                               const char* variable5, const string& value5,\n                               const char* variable6, const string& value6,\n                               const char* variable7, const string& value7,\n                               const char* variable8, const string& value8);\n\n  // Indent text by two spaces.  After calling Indent(), two spaces will be\n  // inserted at the beginning of each line of text.  Indent() may be called\n  // multiple times to produce deeper indents.\n  void Indent();\n\n  // Reduces the current indent level by two spaces, or crashes if the indent\n  // level is zero.\n  void Outdent();\n\n  // Write a string to the output buffer.\n  // This method does not look for newlines to add indentation.\n  void PrintRaw(const string& data);\n\n  // Write a zero-delimited string to output buffer.\n  // This method does not look for newlines to add indentation.\n  void PrintRaw(const char* data);\n\n  // Write some bytes to the output buffer.\n  // This method does not look for newlines to add indentation.\n  void WriteRaw(const char* data, int size);\n\n  // True if any write to the underlying stream failed.  (We don't just\n  // crash in this case because this is an I/O failure, not a programming\n  // error.)\n  bool failed() const { return failed_; }\n\n private:\n  // Link the output range defined by the substitution variables as emitted by\n  // the last call to Print to the object found at the SourceCodeInfo-style path\n  // in a file with path file_path. The range begins at the start of\n  // begin_varname's value and ends after the last character of the value\n  // substituted for end_varname. Note that begin_varname and end_varname\n  // may refer to the same variable.\n  void Annotate(const char* begin_varname, const char* end_varname,\n                const string& file_path, const std::vector<int>& path);\n\n  // Copy size worth of bytes from data to buffer_.\n  void CopyToBuffer(const char* data, int size);\n\n  const char variable_delimiter_;\n\n  ZeroCopyOutputStream* const output_;\n  char* buffer_;\n  int buffer_size_;\n  // The current position, in bytes, in the output stream.  This is equivalent\n  // to the total number of bytes that have been written so far.  This value is\n  // used to calculate annotation ranges in the substitutions_ map below.\n  size_t offset_;\n\n  string indent_;\n  bool at_start_of_line_;\n  bool failed_;\n\n  // A map from variable name to [start, end) offsets in the output buffer.\n  // These refer to the offsets used for a variable after the last call to\n  // Print.  If a variable was used more than once, the entry used in\n  // this map is set to a negative-length span.  For singly-used variables, the\n  // start offset is the beginning of the substitution; the end offset is the\n  // last byte of the substitution plus one (such that (end - start) is the\n  // length of the substituted string).\n  std::map<string, std::pair<size_t, size_t> > substitutions_;\n\n  // Keeps track of the keys in substitutions_ that need to be updated when\n  // indents are inserted. These are keys that refer to the beginning of the\n  // current line.\n  std::vector<string> line_start_variables_;\n\n  // Returns true and sets range to the substitution range in the output for\n  // varname if varname was used once in the last call to Print. If varname\n  // was not used, or if it was used multiple times, returns false (and\n  // fails a debug assertion).\n  bool GetSubstitutionRange(const char* varname,\n                            std::pair<size_t, size_t>* range);\n\n  // If non-null, annotation_collector_ is used to store annotations about\n  // generated code.\n  AnnotationCollector* const annotation_collector_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Printer);\n};\n\n}  // namespace io\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_IO_PRINTER_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/io/strtod.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// A locale-independent version of strtod(), used to parse floating\n// point default values in .proto files, where the decimal separator\n// is always a dot.\n\n#ifndef GOOGLE_PROTOBUF_IO_STRTOD_H__\n#define GOOGLE_PROTOBUF_IO_STRTOD_H__\n\nnamespace google {\nnamespace protobuf {\nnamespace io {\n\n// A locale-independent version of the standard strtod(), which always\n// uses a dot as the decimal separator.\ndouble NoLocaleStrtod(const char* str, char** endptr);\n\n// Casts a double value to a float value. If the value is outside of the\n// representable range of float, it will be converted to positive or negative\n// infinity.\nfloat SafeDoubleToFloat(double value);\n\n}  // namespace io\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_IO_STRTOD_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/io/tokenizer.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Class for parsing tokenized text from a ZeroCopyInputStream.\n\n#ifndef GOOGLE_PROTOBUF_IO_TOKENIZER_H__\n#define GOOGLE_PROTOBUF_IO_TOKENIZER_H__\n\n#include <string>\n#include <vector>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/logging.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace io {\n\nclass ZeroCopyInputStream;     // zero_copy_stream.h\n\n// Defined in this file.\nclass ErrorCollector;\nclass Tokenizer;\n\n// By \"column number\", the proto compiler refers to a count of the number\n// of bytes before a given byte, except that a tab character advances to\n// the next multiple of 8 bytes.  Note in particular that column numbers\n// are zero-based, while many user interfaces use one-based column numbers.\ntypedef int ColumnNumber;\n\n// Abstract interface for an object which collects the errors that occur\n// during parsing.  A typical implementation might simply print the errors\n// to stdout.\nclass LIBPROTOBUF_EXPORT ErrorCollector {\n public:\n  inline ErrorCollector() {}\n  virtual ~ErrorCollector();\n\n  // Indicates that there was an error in the input at the given line and\n  // column numbers.  The numbers are zero-based, so you may want to add\n  // 1 to each before printing them.\n  virtual void AddError(int line, ColumnNumber column,\n                        const string& message) = 0;\n\n  // Indicates that there was a warning in the input at the given line and\n  // column numbers.  The numbers are zero-based, so you may want to add\n  // 1 to each before printing them.\n  virtual void AddWarning(int line, ColumnNumber column,\n                          const string& message) { }\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ErrorCollector);\n};\n\n// This class converts a stream of raw text into a stream of tokens for\n// the protocol definition parser to parse.  The tokens recognized are\n// similar to those that make up the C language; see the TokenType enum for\n// precise descriptions.  Whitespace and comments are skipped.  By default,\n// C- and C++-style comments are recognized, but other styles can be used by\n// calling set_comment_style().\nclass LIBPROTOBUF_EXPORT Tokenizer {\n public:\n  // Construct a Tokenizer that reads and tokenizes text from the given\n  // input stream and writes errors to the given error_collector.\n  // The caller keeps ownership of input and error_collector.\n  Tokenizer(ZeroCopyInputStream* input, ErrorCollector* error_collector);\n  ~Tokenizer();\n\n  enum TokenType {\n    TYPE_START,       // Next() has not yet been called.\n    TYPE_END,         // End of input reached.  \"text\" is empty.\n\n    TYPE_IDENTIFIER,  // A sequence of letters, digits, and underscores, not\n                      // starting with a digit.  It is an error for a number\n                      // to be followed by an identifier with no space in\n                      // between.\n    TYPE_INTEGER,     // A sequence of digits representing an integer.  Normally\n                      // the digits are decimal, but a prefix of \"0x\" indicates\n                      // a hex number and a leading zero indicates octal, just\n                      // like with C numeric literals.  A leading negative sign\n                      // is NOT included in the token; it's up to the parser to\n                      // interpret the unary minus operator on its own.\n    TYPE_FLOAT,       // A floating point literal, with a fractional part and/or\n                      // an exponent.  Always in decimal.  Again, never\n                      // negative.\n    TYPE_STRING,      // A quoted sequence of escaped characters.  Either single\n                      // or double quotes can be used, but they must match.\n                      // A string literal cannot cross a line break.\n    TYPE_SYMBOL,      // Any other printable character, like '!' or '+'.\n                      // Symbols are always a single character, so \"!+$%\" is\n                      // four tokens.\n  };\n\n  // Structure representing a token read from the token stream.\n  struct Token {\n    TokenType type;\n    string text;       // The exact text of the token as it appeared in\n                       // the input.  e.g. tokens of TYPE_STRING will still\n                       // be escaped and in quotes.\n\n    // \"line\" and \"column\" specify the position of the first character of\n    // the token within the input stream.  They are zero-based.\n    int line;\n    ColumnNumber column;\n    ColumnNumber end_column;\n  };\n\n  // Get the current token.  This is updated when Next() is called.  Before\n  // the first call to Next(), current() has type TYPE_START and no contents.\n  const Token& current();\n\n  // Return the previous token -- i.e. what current() returned before the\n  // previous call to Next().\n  const Token& previous();\n\n  // Advance to the next token.  Returns false if the end of the input is\n  // reached.\n  bool Next();\n\n  // Like Next(), but also collects comments which appear between the previous\n  // and next tokens.\n  //\n  // Comments which appear to be attached to the previous token are stored\n  // in *prev_tailing_comments.  Comments which appear to be attached to the\n  // next token are stored in *next_leading_comments.  Comments appearing in\n  // between which do not appear to be attached to either will be added to\n  // detached_comments.  Any of these parameters can be NULL to simply discard\n  // the comments.\n  //\n  // A series of line comments appearing on consecutive lines, with no other\n  // tokens appearing on those lines, will be treated as a single comment.\n  //\n  // Only the comment content is returned; comment markers (e.g. //) are\n  // stripped out.  For block comments, leading whitespace and an asterisk will\n  // be stripped from the beginning of each line other than the first.  Newlines\n  // are included in the output.\n  //\n  // Examples:\n  //\n  //   optional int32 foo = 1;  // Comment attached to foo.\n  //   // Comment attached to bar.\n  //   optional int32 bar = 2;\n  //\n  //   optional string baz = 3;\n  //   // Comment attached to baz.\n  //   // Another line attached to baz.\n  //\n  //   // Comment attached to qux.\n  //   //\n  //   // Another line attached to qux.\n  //   optional double qux = 4;\n  //\n  //   // Detached comment.  This is not attached to qux or corge\n  //   // because there are blank lines separating it from both.\n  //\n  //   optional string corge = 5;\n  //   /* Block comment attached\n  //    * to corge.  Leading asterisks\n  //    * will be removed. */\n  //   /* Block comment attached to\n  //    * grault. */\n  //   optional int32 grault = 6;\n  bool NextWithComments(string* prev_trailing_comments,\n                        std::vector<string>* detached_comments,\n                        string* next_leading_comments);\n\n  // Parse helpers ---------------------------------------------------\n\n  // Parses a TYPE_FLOAT token.  This never fails, so long as the text actually\n  // comes from a TYPE_FLOAT token parsed by Tokenizer.  If it doesn't, the\n  // result is undefined (possibly an assert failure).\n  static double ParseFloat(const string& text);\n\n  // Parses a TYPE_STRING token.  This never fails, so long as the text actually\n  // comes from a TYPE_STRING token parsed by Tokenizer.  If it doesn't, the\n  // result is undefined (possibly an assert failure).\n  static void ParseString(const string& text, string* output);\n\n  // Identical to ParseString, but appends to output.\n  static void ParseStringAppend(const string& text, string* output);\n\n  // Parses a TYPE_INTEGER token.  Returns false if the result would be\n  // greater than max_value.  Otherwise, returns true and sets *output to the\n  // result.  If the text is not from a Token of type TYPE_INTEGER originally\n  // parsed by a Tokenizer, the result is undefined (possibly an assert\n  // failure).\n  static bool ParseInteger(const string& text, uint64 max_value,\n                           uint64* output);\n\n  // Options ---------------------------------------------------------\n\n  // Set true to allow floats to be suffixed with the letter 'f'.  Tokens\n  // which would otherwise be integers but which have the 'f' suffix will be\n  // forced to be interpreted as floats.  For all other purposes, the 'f' is\n  // ignored.\n  void set_allow_f_after_float(bool value) { allow_f_after_float_ = value; }\n\n  // Valid values for set_comment_style().\n  enum CommentStyle {\n    // Line comments begin with \"//\", block comments are delimited by \"/*\" and\n    // \"*/\".\n    CPP_COMMENT_STYLE,\n    // Line comments begin with \"#\".  No way to write block comments.\n    SH_COMMENT_STYLE\n  };\n\n  // Sets the comment style.\n  void set_comment_style(CommentStyle style) { comment_style_ = style; }\n\n  // Whether to require whitespace between a number and a field name.\n  // Default is true. Do not use this; for Google-internal cleanup only.\n  void set_require_space_after_number(bool require) {\n    require_space_after_number_ = require;\n  }\n\n  // Whether to allow string literals to span multiple lines. Default is false.\n  // Do not use this; for Google-internal cleanup only.\n  void set_allow_multiline_strings(bool allow) {\n    allow_multiline_strings_ = allow;\n  }\n\n  // External helper: validate an identifier.\n  static bool IsIdentifier(const string& text);\n\n  // -----------------------------------------------------------------\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Tokenizer);\n\n  Token current_;           // Returned by current().\n  Token previous_;          // Returned by previous().\n\n  ZeroCopyInputStream* input_;\n  ErrorCollector* error_collector_;\n\n  char current_char_;       // == buffer_[buffer_pos_], updated by NextChar().\n  const char* buffer_;      // Current buffer returned from input_.\n  int buffer_size_;         // Size of buffer_.\n  int buffer_pos_;          // Current position within the buffer.\n  bool read_error_;         // Did we previously encounter a read error?\n\n  // Line and column number of current_char_ within the whole input stream.\n  int line_;\n  ColumnNumber column_;\n\n  // String to which text should be appended as we advance through it.\n  // Call RecordTo(&str) to start recording and StopRecording() to stop.\n  // E.g. StartToken() calls RecordTo(&current_.text).  record_start_ is the\n  // position within the current buffer where recording started.\n  string* record_target_;\n  int record_start_;\n\n  // Options.\n  bool allow_f_after_float_;\n  CommentStyle comment_style_;\n  bool require_space_after_number_;\n  bool allow_multiline_strings_;\n\n  // Since we count columns we need to interpret tabs somehow.  We'll take\n  // the standard 8-character definition for lack of any way to do better.\n  // This must match the documentation of ColumnNumber.\n  static const int kTabWidth = 8;\n\n  // -----------------------------------------------------------------\n  // Helper methods.\n\n  // Consume this character and advance to the next one.\n  void NextChar();\n\n  // Read a new buffer from the input.\n  void Refresh();\n\n  inline void RecordTo(string* target);\n  inline void StopRecording();\n\n  // Called when the current character is the first character of a new\n  // token (not including whitespace or comments).\n  inline void StartToken();\n  // Called when the current character is the first character after the\n  // end of the last token.  After this returns, current_.text will\n  // contain all text consumed since StartToken() was called.\n  inline void EndToken();\n\n  // Convenience method to add an error at the current line and column.\n  void AddError(const string& message) {\n    error_collector_->AddError(line_, column_, message);\n  }\n\n  // -----------------------------------------------------------------\n  // The following four methods are used to consume tokens of specific\n  // types.  They are actually used to consume all characters *after*\n  // the first, since the calling function consumes the first character\n  // in order to decide what kind of token is being read.\n\n  // Read and consume a string, ending when the given delimiter is\n  // consumed.\n  void ConsumeString(char delimiter);\n\n  // Read and consume a number, returning TYPE_FLOAT or TYPE_INTEGER\n  // depending on what was read.  This needs to know if the first\n  // character was a zero in order to correctly recognize hex and octal\n  // numbers.\n  // It also needs to know if the first character was a . to parse floating\n  // point correctly.\n  TokenType ConsumeNumber(bool started_with_zero, bool started_with_dot);\n\n  // Consume the rest of a line.\n  void ConsumeLineComment(string* content);\n  // Consume until \"*/\".\n  void ConsumeBlockComment(string* content);\n\n  enum NextCommentStatus {\n    // Started a line comment.\n    LINE_COMMENT,\n\n    // Started a block comment.\n    BLOCK_COMMENT,\n\n    // Consumed a slash, then realized it wasn't a comment.  current_ has\n    // been filled in with a slash token.  The caller should return it.\n    SLASH_NOT_COMMENT,\n\n    // We do not appear to be starting a comment here.\n    NO_COMMENT\n  };\n\n  // If we're at the start of a new comment, consume it and return what kind\n  // of comment it is.\n  NextCommentStatus TryConsumeCommentStart();\n\n  // -----------------------------------------------------------------\n  // These helper methods make the parsing code more readable.  The\n  // \"character classes\" referred to are defined at the top of the .cc file.\n  // Basically it is a C++ class with one method:\n  //   static bool InClass(char c);\n  // The method returns true if c is a member of this \"class\", like \"Letter\"\n  // or \"Digit\".\n\n  // Returns true if the current character is of the given character\n  // class, but does not consume anything.\n  template<typename CharacterClass>\n  inline bool LookingAt();\n\n  // If the current character is in the given class, consume it and return\n  // true.  Otherwise return false.\n  // e.g. TryConsumeOne<Letter>()\n  template<typename CharacterClass>\n  inline bool TryConsumeOne();\n\n  // Like above, but try to consume the specific character indicated.\n  inline bool TryConsume(char c);\n\n  // Consume zero or more of the given character class.\n  template<typename CharacterClass>\n  inline void ConsumeZeroOrMore();\n\n  // Consume one or more of the given character class or log the given\n  // error message.\n  // e.g. ConsumeOneOrMore<Digit>(\"Expected digits.\");\n  template<typename CharacterClass>\n  inline void ConsumeOneOrMore(const char* error);\n};\n\n// inline methods ====================================================\ninline const Tokenizer::Token& Tokenizer::current() {\n  return current_;\n}\n\ninline const Tokenizer::Token& Tokenizer::previous() {\n  return previous_;\n}\n\ninline void Tokenizer::ParseString(const string& text, string* output) {\n  output->clear();\n  ParseStringAppend(text, output);\n}\n\n}  // namespace io\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_IO_TOKENIZER_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/io/zero_copy_stream.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This file contains the ZeroCopyInputStream and ZeroCopyOutputStream\n// interfaces, which represent abstract I/O streams to and from which\n// protocol buffers can be read and written.  For a few simple\n// implementations of these interfaces, see zero_copy_stream_impl.h.\n//\n// These interfaces are different from classic I/O streams in that they\n// try to minimize the amount of data copying that needs to be done.\n// To accomplish this, responsibility for allocating buffers is moved to\n// the stream object, rather than being the responsibility of the caller.\n// So, the stream can return a buffer which actually points directly into\n// the final data structure where the bytes are to be stored, and the caller\n// can interact directly with that buffer, eliminating an intermediate copy\n// operation.\n//\n// As an example, consider the common case in which you are reading bytes\n// from an array that is already in memory (or perhaps an mmap()ed file).\n// With classic I/O streams, you would do something like:\n//   char buffer[BUFFER_SIZE];\n//   input->Read(buffer, BUFFER_SIZE);\n//   DoSomething(buffer, BUFFER_SIZE);\n// Then, the stream basically just calls memcpy() to copy the data from\n// the array into your buffer.  With a ZeroCopyInputStream, you would do\n// this instead:\n//   const void* buffer;\n//   int size;\n//   input->Next(&buffer, &size);\n//   DoSomething(buffer, size);\n// Here, no copy is performed.  The input stream returns a pointer directly\n// into the backing array, and the caller ends up reading directly from it.\n//\n// If you want to be able to read the old-fashion way, you can create\n// a CodedInputStream or CodedOutputStream wrapping these objects and use\n// their ReadRaw()/WriteRaw() methods.  These will, of course, add a copy\n// step, but Coded*Stream will handle buffering so at least it will be\n// reasonably efficient.\n//\n// ZeroCopyInputStream example:\n//   // Read in a file and print its contents to stdout.\n//   int fd = open(\"myfile\", O_RDONLY);\n//   ZeroCopyInputStream* input = new FileInputStream(fd);\n//\n//   const void* buffer;\n//   int size;\n//   while (input->Next(&buffer, &size)) {\n//     cout.write(buffer, size);\n//   }\n//\n//   delete input;\n//   close(fd);\n//\n// ZeroCopyOutputStream example:\n//   // Copy the contents of \"infile\" to \"outfile\", using plain read() for\n//   // \"infile\" but a ZeroCopyOutputStream for \"outfile\".\n//   int infd = open(\"infile\", O_RDONLY);\n//   int outfd = open(\"outfile\", O_WRONLY);\n//   ZeroCopyOutputStream* output = new FileOutputStream(outfd);\n//\n//   void* buffer;\n//   int size;\n//   while (output->Next(&buffer, &size)) {\n//     int bytes = read(infd, buffer, size);\n//     if (bytes < size) {\n//       // Reached EOF.\n//       output->BackUp(size - bytes);\n//       break;\n//     }\n//   }\n//\n//   delete output;\n//   close(infd);\n//   close(outfd);\n\n#ifndef GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__\n#define GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__\n\n#include <string>\n#include <google/protobuf/stubs/common.h>\n\nnamespace google {\n\nnamespace protobuf {\nnamespace io {\n\n// Defined in this file.\nclass ZeroCopyInputStream;\nclass ZeroCopyOutputStream;\n\n// Abstract interface similar to an input stream but designed to minimize\n// copying.\nclass LIBPROTOBUF_EXPORT ZeroCopyInputStream {\n public:\n  ZeroCopyInputStream() {}\n  virtual ~ZeroCopyInputStream() {}\n\n  // Obtains a chunk of data from the stream.\n  //\n  // Preconditions:\n  // * \"size\" and \"data\" are not NULL.\n  //\n  // Postconditions:\n  // * If the returned value is false, there is no more data to return or\n  //   an error occurred.  All errors are permanent.\n  // * Otherwise, \"size\" points to the actual number of bytes read and \"data\"\n  //   points to a pointer to a buffer containing these bytes.\n  // * Ownership of this buffer remains with the stream, and the buffer\n  //   remains valid only until some other method of the stream is called\n  //   or the stream is destroyed.\n  // * It is legal for the returned buffer to have zero size, as long\n  //   as repeatedly calling Next() eventually yields a buffer with non-zero\n  //   size.\n  virtual bool Next(const void** data, int* size) = 0;\n\n  // Backs up a number of bytes, so that the next call to Next() returns\n  // data again that was already returned by the last call to Next().  This\n  // is useful when writing procedures that are only supposed to read up\n  // to a certain point in the input, then return.  If Next() returns a\n  // buffer that goes beyond what you wanted to read, you can use BackUp()\n  // to return to the point where you intended to finish.\n  //\n  // Preconditions:\n  // * The last method called must have been Next().\n  // * count must be less than or equal to the size of the last buffer\n  //   returned by Next().\n  //\n  // Postconditions:\n  // * The last \"count\" bytes of the last buffer returned by Next() will be\n  //   pushed back into the stream.  Subsequent calls to Next() will return\n  //   the same data again before producing new data.\n  virtual void BackUp(int count) = 0;\n\n  // Skips a number of bytes.  Returns false if the end of the stream is\n  // reached or some input error occurred.  In the end-of-stream case, the\n  // stream is advanced to the end of the stream (so ByteCount() will return\n  // the total size of the stream).\n  virtual bool Skip(int count) = 0;\n\n  // Returns the total number of bytes read since this object was created.\n  virtual int64 ByteCount() const = 0;\n\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ZeroCopyInputStream);\n};\n\n// Abstract interface similar to an output stream but designed to minimize\n// copying.\nclass LIBPROTOBUF_EXPORT ZeroCopyOutputStream {\n public:\n  ZeroCopyOutputStream() {}\n  virtual ~ZeroCopyOutputStream() {}\n\n  // Obtains a buffer into which data can be written.  Any data written\n  // into this buffer will eventually (maybe instantly, maybe later on)\n  // be written to the output.\n  //\n  // Preconditions:\n  // * \"size\" and \"data\" are not NULL.\n  //\n  // Postconditions:\n  // * If the returned value is false, an error occurred.  All errors are\n  //   permanent.\n  // * Otherwise, \"size\" points to the actual number of bytes in the buffer\n  //   and \"data\" points to the buffer.\n  // * Ownership of this buffer remains with the stream, and the buffer\n  //   remains valid only until some other method of the stream is called\n  //   or the stream is destroyed.\n  // * Any data which the caller stores in this buffer will eventually be\n  //   written to the output (unless BackUp() is called).\n  // * It is legal for the returned buffer to have zero size, as long\n  //   as repeatedly calling Next() eventually yields a buffer with non-zero\n  //   size.\n  virtual bool Next(void** data, int* size) = 0;\n\n  // Backs up a number of bytes, so that the end of the last buffer returned\n  // by Next() is not actually written.  This is needed when you finish\n  // writing all the data you want to write, but the last buffer was bigger\n  // than you needed.  You don't want to write a bunch of garbage after the\n  // end of your data, so you use BackUp() to back up.\n  //\n  // Preconditions:\n  // * The last method called must have been Next().\n  // * count must be less than or equal to the size of the last buffer\n  //   returned by Next().\n  // * The caller must not have written anything to the last \"count\" bytes\n  //   of that buffer.\n  //\n  // Postconditions:\n  // * The last \"count\" bytes of the last buffer returned by Next() will be\n  //   ignored.\n  virtual void BackUp(int count) = 0;\n\n  // Returns the total number of bytes written since this object was created.\n  virtual int64 ByteCount() const = 0;\n\n  // Write a given chunk of data to the output.  Some output streams may\n  // implement this in a way that avoids copying. Check AllowsAliasing() before\n  // calling WriteAliasedRaw(). It will GOOGLE_CHECK fail if WriteAliasedRaw() is\n  // called on a stream that does not allow aliasing.\n  //\n  // NOTE: It is caller's responsibility to ensure that the chunk of memory\n  // remains live until all of the data has been consumed from the stream.\n  virtual bool WriteAliasedRaw(const void* data, int size);\n  virtual bool AllowsAliasing() const { return false; }\n\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ZeroCopyOutputStream);\n};\n\n}  // namespace io\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/io/zero_copy_stream_impl.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This file contains common implementations of the interfaces defined in\n// zero_copy_stream.h which are only included in the full (non-lite)\n// protobuf library.  These implementations include Unix file descriptors\n// and C++ iostreams.  See also:  zero_copy_stream_impl_lite.h\n\n#ifndef GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_H__\n#define GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_H__\n\n#include <string>\n#include <iosfwd>\n#include <google/protobuf/io/zero_copy_stream.h>\n#include <google/protobuf/io/zero_copy_stream_impl_lite.h>\n#include <google/protobuf/stubs/common.h>\n\n\nnamespace google {\nnamespace protobuf {\nnamespace io {\n\n\n// ===================================================================\n\n// A ZeroCopyInputStream which reads from a file descriptor.\n//\n// FileInputStream is preferred over using an ifstream with IstreamInputStream.\n// The latter will introduce an extra layer of buffering, harming performance.\n// Also, it's conceivable that FileInputStream could someday be enhanced\n// to use zero-copy file descriptors on OSs which support them.\nclass LIBPROTOBUF_EXPORT FileInputStream : public ZeroCopyInputStream {\n public:\n  // Creates a stream that reads from the given Unix file descriptor.\n  // If a block_size is given, it specifies the number of bytes that\n  // should be read and returned with each call to Next().  Otherwise,\n  // a reasonable default is used.\n  explicit FileInputStream(int file_descriptor, int block_size = -1);\n\n  // Flushes any buffers and closes the underlying file.  Returns false if\n  // an error occurs during the process; use GetErrno() to examine the error.\n  // Even if an error occurs, the file descriptor is closed when this returns.\n  bool Close();\n\n  // By default, the file descriptor is not closed when the stream is\n  // destroyed.  Call SetCloseOnDelete(true) to change that.  WARNING:\n  // This leaves no way for the caller to detect if close() fails.  If\n  // detecting close() errors is important to you, you should arrange\n  // to close the descriptor yourself.\n  void SetCloseOnDelete(bool value) { copying_input_.SetCloseOnDelete(value); }\n\n  // If an I/O error has occurred on this file descriptor, this is the\n  // errno from that error.  Otherwise, this is zero.  Once an error\n  // occurs, the stream is broken and all subsequent operations will\n  // fail.\n  int GetErrno() { return copying_input_.GetErrno(); }\n\n  // implements ZeroCopyInputStream ----------------------------------\n  bool Next(const void** data, int* size);\n  void BackUp(int count);\n  bool Skip(int count);\n  int64 ByteCount() const;\n\n private:\n  class LIBPROTOBUF_EXPORT CopyingFileInputStream : public CopyingInputStream {\n   public:\n    CopyingFileInputStream(int file_descriptor);\n    ~CopyingFileInputStream();\n\n    bool Close();\n    void SetCloseOnDelete(bool value) { close_on_delete_ = value; }\n    int GetErrno() { return errno_; }\n\n    // implements CopyingInputStream ---------------------------------\n    int Read(void* buffer, int size);\n    int Skip(int count);\n\n   private:\n    // The file descriptor.\n    const int file_;\n    bool close_on_delete_;\n    bool is_closed_;\n\n    // The errno of the I/O error, if one has occurred.  Otherwise, zero.\n    int errno_;\n\n    // Did we try to seek once and fail?  If so, we assume this file descriptor\n    // doesn't support seeking and won't try again.\n    bool previous_seek_failed_;\n\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CopyingFileInputStream);\n  };\n\n  CopyingFileInputStream copying_input_;\n  CopyingInputStreamAdaptor impl_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileInputStream);\n};\n\n// ===================================================================\n\n// A ZeroCopyOutputStream which writes to a file descriptor.\n//\n// FileOutputStream is preferred over using an ofstream with\n// OstreamOutputStream.  The latter will introduce an extra layer of buffering,\n// harming performance.  Also, it's conceivable that FileOutputStream could\n// someday be enhanced to use zero-copy file descriptors on OSs which\n// support them.\nclass LIBPROTOBUF_EXPORT FileOutputStream : public ZeroCopyOutputStream {\n public:\n  // Creates a stream that writes to the given Unix file descriptor.\n  // If a block_size is given, it specifies the size of the buffers\n  // that should be returned by Next().  Otherwise, a reasonable default\n  // is used.\n  explicit FileOutputStream(int file_descriptor, int block_size = -1);\n  ~FileOutputStream();\n\n  // Flushes any buffers and closes the underlying file.  Returns false if\n  // an error occurs during the process; use GetErrno() to examine the error.\n  // Even if an error occurs, the file descriptor is closed when this returns.\n  bool Close();\n\n  // Flushes FileOutputStream's buffers but does not close the\n  // underlying file. No special measures are taken to ensure that\n  // underlying operating system file object is synchronized to disk.\n  bool Flush();\n\n  // By default, the file descriptor is not closed when the stream is\n  // destroyed.  Call SetCloseOnDelete(true) to change that.  WARNING:\n  // This leaves no way for the caller to detect if close() fails.  If\n  // detecting close() errors is important to you, you should arrange\n  // to close the descriptor yourself.\n  void SetCloseOnDelete(bool value) { copying_output_.SetCloseOnDelete(value); }\n\n  // If an I/O error has occurred on this file descriptor, this is the\n  // errno from that error.  Otherwise, this is zero.  Once an error\n  // occurs, the stream is broken and all subsequent operations will\n  // fail.\n  int GetErrno() { return copying_output_.GetErrno(); }\n\n  // implements ZeroCopyOutputStream ---------------------------------\n  bool Next(void** data, int* size);\n  void BackUp(int count);\n  int64 ByteCount() const;\n\n private:\n  class LIBPROTOBUF_EXPORT CopyingFileOutputStream : public CopyingOutputStream {\n   public:\n    CopyingFileOutputStream(int file_descriptor);\n    ~CopyingFileOutputStream();\n\n    bool Close();\n    void SetCloseOnDelete(bool value) { close_on_delete_ = value; }\n    int GetErrno() { return errno_; }\n\n    // implements CopyingOutputStream --------------------------------\n    bool Write(const void* buffer, int size);\n\n   private:\n    // The file descriptor.\n    const int file_;\n    bool close_on_delete_;\n    bool is_closed_;\n\n    // The errno of the I/O error, if one has occurred.  Otherwise, zero.\n    int errno_;\n\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CopyingFileOutputStream);\n  };\n\n  CopyingFileOutputStream copying_output_;\n  CopyingOutputStreamAdaptor impl_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileOutputStream);\n};\n\n// ===================================================================\n\n// A ZeroCopyInputStream which reads from a C++ istream.\n//\n// Note that for reading files (or anything represented by a file descriptor),\n// FileInputStream is more efficient.\nclass LIBPROTOBUF_EXPORT IstreamInputStream : public ZeroCopyInputStream {\n public:\n  // Creates a stream that reads from the given C++ istream.\n  // If a block_size is given, it specifies the number of bytes that\n  // should be read and returned with each call to Next().  Otherwise,\n  // a reasonable default is used.\n  explicit IstreamInputStream(std::istream* stream, int block_size = -1);\n\n  // implements ZeroCopyInputStream ----------------------------------\n  bool Next(const void** data, int* size);\n  void BackUp(int count);\n  bool Skip(int count);\n  int64 ByteCount() const;\n\n private:\n  class LIBPROTOBUF_EXPORT CopyingIstreamInputStream : public CopyingInputStream {\n   public:\n    CopyingIstreamInputStream(std::istream* input);\n    ~CopyingIstreamInputStream();\n\n    // implements CopyingInputStream ---------------------------------\n    int Read(void* buffer, int size);\n    // (We use the default implementation of Skip().)\n\n   private:\n    // The stream.\n    std::istream* input_;\n\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CopyingIstreamInputStream);\n  };\n\n  CopyingIstreamInputStream copying_input_;\n  CopyingInputStreamAdaptor impl_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(IstreamInputStream);\n};\n\n// ===================================================================\n\n// A ZeroCopyOutputStream which writes to a C++ ostream.\n//\n// Note that for writing files (or anything represented by a file descriptor),\n// FileOutputStream is more efficient.\nclass LIBPROTOBUF_EXPORT OstreamOutputStream : public ZeroCopyOutputStream {\n public:\n  // Creates a stream that writes to the given C++ ostream.\n  // If a block_size is given, it specifies the size of the buffers\n  // that should be returned by Next().  Otherwise, a reasonable default\n  // is used.\n  explicit OstreamOutputStream(std::ostream* stream, int block_size = -1);\n  ~OstreamOutputStream();\n\n  // implements ZeroCopyOutputStream ---------------------------------\n  bool Next(void** data, int* size);\n  void BackUp(int count);\n  int64 ByteCount() const;\n\n private:\n  class LIBPROTOBUF_EXPORT CopyingOstreamOutputStream : public CopyingOutputStream {\n   public:\n    CopyingOstreamOutputStream(std::ostream* output);\n    ~CopyingOstreamOutputStream();\n\n    // implements CopyingOutputStream --------------------------------\n    bool Write(const void* buffer, int size);\n\n   private:\n    // The stream.\n    std::ostream* output_;\n\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CopyingOstreamOutputStream);\n  };\n\n  CopyingOstreamOutputStream copying_output_;\n  CopyingOutputStreamAdaptor impl_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(OstreamOutputStream);\n};\n\n// ===================================================================\n\n// A ZeroCopyInputStream which reads from several other streams in sequence.\n// ConcatenatingInputStream is unable to distinguish between end-of-stream\n// and read errors in the underlying streams, so it assumes any errors mean\n// end-of-stream.  So, if the underlying streams fail for any other reason,\n// ConcatenatingInputStream may do odd things.  It is suggested that you do\n// not use ConcatenatingInputStream on streams that might produce read errors\n// other than end-of-stream.\nclass LIBPROTOBUF_EXPORT ConcatenatingInputStream : public ZeroCopyInputStream {\n public:\n  // All streams passed in as well as the array itself must remain valid\n  // until the ConcatenatingInputStream is destroyed.\n  ConcatenatingInputStream(ZeroCopyInputStream* const streams[], int count);\n\n  // implements ZeroCopyInputStream ----------------------------------\n  bool Next(const void** data, int* size);\n  void BackUp(int count);\n  bool Skip(int count);\n  int64 ByteCount() const;\n\n\n private:\n  // As streams are retired, streams_ is incremented and count_ is\n  // decremented.\n  ZeroCopyInputStream* const* streams_;\n  int stream_count_;\n  int64 bytes_retired_;  // Bytes read from previous streams.\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ConcatenatingInputStream);\n};\n\n// ===================================================================\n\n// A ZeroCopyInputStream which wraps some other stream and limits it to\n// a particular byte count.\nclass LIBPROTOBUF_EXPORT LimitingInputStream : public ZeroCopyInputStream {\n public:\n  LimitingInputStream(ZeroCopyInputStream* input, int64 limit);\n  ~LimitingInputStream();\n\n  // implements ZeroCopyInputStream ----------------------------------\n  bool Next(const void** data, int* size);\n  void BackUp(int count);\n  bool Skip(int count);\n  int64 ByteCount() const;\n\n\n private:\n  ZeroCopyInputStream* input_;\n  int64 limit_;  // Decreases as we go, becomes negative if we overshoot.\n  int64 prior_bytes_read_;  // Bytes read on underlying stream at construction\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(LimitingInputStream);\n};\n\n// ===================================================================\n\n}  // namespace io\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/io/zero_copy_stream_impl_lite.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This file contains common implementations of the interfaces defined in\n// zero_copy_stream.h which are included in the \"lite\" protobuf library.\n// These implementations cover I/O on raw arrays and strings, as well as\n// adaptors which make it easy to implement streams based on traditional\n// streams.  Of course, many users will probably want to write their own\n// implementations of these interfaces specific to the particular I/O\n// abstractions they prefer to use, but these should cover the most common\n// cases.\n\n#ifndef GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_LITE_H__\n#define GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_LITE_H__\n\n#include <memory>\n#include <string>\n#include <iosfwd>\n#include <google/protobuf/io/zero_copy_stream.h>\n#include <google/protobuf/stubs/callback.h>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/stl_util.h>\n\n\nnamespace google {\nnamespace protobuf {\nnamespace io {\n\n// ===================================================================\n\n// A ZeroCopyInputStream backed by an in-memory array of bytes.\nclass LIBPROTOBUF_EXPORT ArrayInputStream : public ZeroCopyInputStream {\n public:\n  // Create an InputStream that returns the bytes pointed to by \"data\".\n  // \"data\" remains the property of the caller but must remain valid until\n  // the stream is destroyed.  If a block_size is given, calls to Next()\n  // will return data blocks no larger than the given size.  Otherwise, the\n  // first call to Next() returns the entire array.  block_size is mainly\n  // useful for testing; in production you would probably never want to set\n  // it.\n  ArrayInputStream(const void* data, int size, int block_size = -1);\n\n  // implements ZeroCopyInputStream ----------------------------------\n  bool Next(const void** data, int* size);\n  void BackUp(int count);\n  bool Skip(int count);\n  int64 ByteCount() const;\n\n\n private:\n  const uint8* const data_;  // The byte array.\n  const int size_;           // Total size of the array.\n  const int block_size_;     // How many bytes to return at a time.\n\n  int position_;\n  int last_returned_size_;   // How many bytes we returned last time Next()\n                             // was called (used for error checking only).\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ArrayInputStream);\n};\n\n// ===================================================================\n\n// A ZeroCopyOutputStream backed by an in-memory array of bytes.\nclass LIBPROTOBUF_EXPORT ArrayOutputStream : public ZeroCopyOutputStream {\n public:\n  // Create an OutputStream that writes to the bytes pointed to by \"data\".\n  // \"data\" remains the property of the caller but must remain valid until\n  // the stream is destroyed.  If a block_size is given, calls to Next()\n  // will return data blocks no larger than the given size.  Otherwise, the\n  // first call to Next() returns the entire array.  block_size is mainly\n  // useful for testing; in production you would probably never want to set\n  // it.\n  ArrayOutputStream(void* data, int size, int block_size = -1);\n\n  // implements ZeroCopyOutputStream ---------------------------------\n  bool Next(void** data, int* size);\n  void BackUp(int count);\n  int64 ByteCount() const;\n\n private:\n  uint8* const data_;        // The byte array.\n  const int size_;           // Total size of the array.\n  const int block_size_;     // How many bytes to return at a time.\n\n  int position_;\n  int last_returned_size_;   // How many bytes we returned last time Next()\n                             // was called (used for error checking only).\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ArrayOutputStream);\n};\n\n// ===================================================================\n\n// A ZeroCopyOutputStream which appends bytes to a string.\nclass LIBPROTOBUF_EXPORT StringOutputStream : public ZeroCopyOutputStream {\n public:\n  // Create a StringOutputStream which appends bytes to the given string.\n  // The string remains property of the caller, but it is mutated in arbitrary\n  // ways and MUST NOT be accessed in any way until you're done with the\n  // stream. Either be sure there's no further usage, or (safest) destroy the\n  // stream before using the contents.\n  //\n  // Hint:  If you call target->reserve(n) before creating the stream,\n  //   the first call to Next() will return at least n bytes of buffer\n  //   space.\n  explicit StringOutputStream(string* target);\n\n  // implements ZeroCopyOutputStream ---------------------------------\n  bool Next(void** data, int* size);\n  void BackUp(int count);\n  int64 ByteCount() const;\n\n protected:\n  void SetString(string* target);\n\n private:\n  static const int kMinimumSize = 16;\n\n  string* target_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringOutputStream);\n};\n\n// Note:  There is no StringInputStream.  Instead, just create an\n// ArrayInputStream as follows:\n//   ArrayInputStream input(str.data(), str.size());\n\n// ===================================================================\n\n// A generic traditional input stream interface.\n//\n// Lots of traditional input streams (e.g. file descriptors, C stdio\n// streams, and C++ iostreams) expose an interface where every read\n// involves copying bytes into a buffer.  If you want to take such an\n// interface and make a ZeroCopyInputStream based on it, simply implement\n// CopyingInputStream and then use CopyingInputStreamAdaptor.\n//\n// CopyingInputStream implementations should avoid buffering if possible.\n// CopyingInputStreamAdaptor does its own buffering and will read data\n// in large blocks.\nclass LIBPROTOBUF_EXPORT CopyingInputStream {\n public:\n  virtual ~CopyingInputStream() {}\n\n  // Reads up to \"size\" bytes into the given buffer.  Returns the number of\n  // bytes read.  Read() waits until at least one byte is available, or\n  // returns zero if no bytes will ever become available (EOF), or -1 if a\n  // permanent read error occurred.\n  virtual int Read(void* buffer, int size) = 0;\n\n  // Skips the next \"count\" bytes of input.  Returns the number of bytes\n  // actually skipped.  This will always be exactly equal to \"count\" unless\n  // EOF was reached or a permanent read error occurred.\n  //\n  // The default implementation just repeatedly calls Read() into a scratch\n  // buffer.\n  virtual int Skip(int count);\n};\n\n// A ZeroCopyInputStream which reads from a CopyingInputStream.  This is\n// useful for implementing ZeroCopyInputStreams that read from traditional\n// streams.  Note that this class is not really zero-copy.\n//\n// If you want to read from file descriptors or C++ istreams, this is\n// already implemented for you:  use FileInputStream or IstreamInputStream\n// respectively.\nclass LIBPROTOBUF_EXPORT CopyingInputStreamAdaptor : public ZeroCopyInputStream {\n public:\n  // Creates a stream that reads from the given CopyingInputStream.\n  // If a block_size is given, it specifies the number of bytes that\n  // should be read and returned with each call to Next().  Otherwise,\n  // a reasonable default is used.  The caller retains ownership of\n  // copying_stream unless SetOwnsCopyingStream(true) is called.\n  explicit CopyingInputStreamAdaptor(CopyingInputStream* copying_stream,\n                                     int block_size = -1);\n  ~CopyingInputStreamAdaptor();\n\n  // Call SetOwnsCopyingStream(true) to tell the CopyingInputStreamAdaptor to\n  // delete the underlying CopyingInputStream when it is destroyed.\n  void SetOwnsCopyingStream(bool value) { owns_copying_stream_ = value; }\n\n  // implements ZeroCopyInputStream ----------------------------------\n  bool Next(const void** data, int* size);\n  void BackUp(int count);\n  bool Skip(int count);\n  int64 ByteCount() const;\n\n private:\n  // Insures that buffer_ is not NULL.\n  void AllocateBufferIfNeeded();\n  // Frees the buffer and resets buffer_used_.\n  void FreeBuffer();\n\n  // The underlying copying stream.\n  CopyingInputStream* copying_stream_;\n  bool owns_copying_stream_;\n\n  // True if we have seen a permenant error from the underlying stream.\n  bool failed_;\n\n  // The current position of copying_stream_, relative to the point where\n  // we started reading.\n  int64 position_;\n\n  // Data is read into this buffer.  It may be NULL if no buffer is currently\n  // in use.  Otherwise, it points to an array of size buffer_size_.\n  std::unique_ptr<uint8[]> buffer_;\n  const int buffer_size_;\n\n  // Number of valid bytes currently in the buffer (i.e. the size last\n  // returned by Next()).  0 <= buffer_used_ <= buffer_size_.\n  int buffer_used_;\n\n  // Number of bytes in the buffer which were backed up over by a call to\n  // BackUp().  These need to be returned again.\n  // 0 <= backup_bytes_ <= buffer_used_\n  int backup_bytes_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CopyingInputStreamAdaptor);\n};\n\n// ===================================================================\n\n// A generic traditional output stream interface.\n//\n// Lots of traditional output streams (e.g. file descriptors, C stdio\n// streams, and C++ iostreams) expose an interface where every write\n// involves copying bytes from a buffer.  If you want to take such an\n// interface and make a ZeroCopyOutputStream based on it, simply implement\n// CopyingOutputStream and then use CopyingOutputStreamAdaptor.\n//\n// CopyingOutputStream implementations should avoid buffering if possible.\n// CopyingOutputStreamAdaptor does its own buffering and will write data\n// in large blocks.\nclass LIBPROTOBUF_EXPORT CopyingOutputStream {\n public:\n  virtual ~CopyingOutputStream() {}\n\n  // Writes \"size\" bytes from the given buffer to the output.  Returns true\n  // if successful, false on a write error.\n  virtual bool Write(const void* buffer, int size) = 0;\n};\n\n// A ZeroCopyOutputStream which writes to a CopyingOutputStream.  This is\n// useful for implementing ZeroCopyOutputStreams that write to traditional\n// streams.  Note that this class is not really zero-copy.\n//\n// If you want to write to file descriptors or C++ ostreams, this is\n// already implemented for you:  use FileOutputStream or OstreamOutputStream\n// respectively.\nclass LIBPROTOBUF_EXPORT CopyingOutputStreamAdaptor : public ZeroCopyOutputStream {\n public:\n  // Creates a stream that writes to the given Unix file descriptor.\n  // If a block_size is given, it specifies the size of the buffers\n  // that should be returned by Next().  Otherwise, a reasonable default\n  // is used.\n  explicit CopyingOutputStreamAdaptor(CopyingOutputStream* copying_stream,\n                                      int block_size = -1);\n  ~CopyingOutputStreamAdaptor();\n\n  // Writes all pending data to the underlying stream.  Returns false if a\n  // write error occurred on the underlying stream.  (The underlying\n  // stream itself is not necessarily flushed.)\n  bool Flush();\n\n  // Call SetOwnsCopyingStream(true) to tell the CopyingOutputStreamAdaptor to\n  // delete the underlying CopyingOutputStream when it is destroyed.\n  void SetOwnsCopyingStream(bool value) { owns_copying_stream_ = value; }\n\n  // implements ZeroCopyOutputStream ---------------------------------\n  bool Next(void** data, int* size);\n  void BackUp(int count);\n  int64 ByteCount() const;\n\n private:\n  // Write the current buffer, if it is present.\n  bool WriteBuffer();\n  // Insures that buffer_ is not NULL.\n  void AllocateBufferIfNeeded();\n  // Frees the buffer.\n  void FreeBuffer();\n\n  // The underlying copying stream.\n  CopyingOutputStream* copying_stream_;\n  bool owns_copying_stream_;\n\n  // True if we have seen a permenant error from the underlying stream.\n  bool failed_;\n\n  // The current position of copying_stream_, relative to the point where\n  // we started writing.\n  int64 position_;\n\n  // Data is written from this buffer.  It may be NULL if no buffer is\n  // currently in use.  Otherwise, it points to an array of size buffer_size_.\n  std::unique_ptr<uint8[]> buffer_;\n  const int buffer_size_;\n\n  // Number of valid bytes currently in the buffer (i.e. the size last\n  // returned by Next()).  When BackUp() is called, we just reduce this.\n  // 0 <= buffer_used_ <= buffer_size_.\n  int buffer_used_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CopyingOutputStreamAdaptor);\n};\n\n// ===================================================================\n\n// mutable_string_data() and as_string_data() are workarounds to improve\n// the performance of writing new data to an existing string.  Unfortunately\n// the methods provided by the string class are suboptimal, and using memcpy()\n// is mildly annoying because it requires its pointer args to be non-NULL even\n// if we ask it to copy 0 bytes.  Furthermore, string_as_array() has the\n// property that it always returns NULL if its arg is the empty string, exactly\n// what we want to avoid if we're using it in conjunction with memcpy()!\n// With C++11, the desired memcpy() boils down to memcpy(..., &(*s)[0], size),\n// where s is a string*.  Without C++11, &(*s)[0] is not guaranteed to be safe,\n// so we use string_as_array(), and live with the extra logic that tests whether\n// *s is empty.\n\n// Return a pointer to mutable characters underlying the given string.  The\n// return value is valid until the next time the string is resized.  We\n// trust the caller to treat the return value as an array of length s->size().\ninline char* mutable_string_data(string* s) {\n#ifdef LANG_CXX11\n  // This should be simpler & faster than string_as_array() because the latter\n  // is guaranteed to return NULL when *s is empty, so it has to check for that.\n  return &(*s)[0];\n#else\n  return string_as_array(s);\n#endif\n}\n\n// as_string_data(s) is equivalent to\n//  ({ char* p = mutable_string_data(s); make_pair(p, p != NULL); })\n// Sometimes it's faster: in some scenarios p cannot be NULL, and then the\n// code can avoid that check.\ninline std::pair<char*, bool> as_string_data(string* s) {\n  char *p = mutable_string_data(s);\n#ifdef LANG_CXX11\n  return std::make_pair(p, true);\n#else\n  return std::make_pair(p, p != NULL);\n#endif\n}\n\n}  // namespace io\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_LITE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/map.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// This file defines the map container and its helpers to support protobuf maps.\n//\n// The Map and MapIterator types are provided by this header file.\n// Please avoid using other types defined here, unless they are public\n// types within Map or MapIterator, such as Map::value_type.\n\n#ifndef GOOGLE_PROTOBUF_MAP_H__\n#define GOOGLE_PROTOBUF_MAP_H__\n\n#include <initializer_list>\n#include <iterator>\n#include <limits>  // To support Visual Studio 2008\n#include <set>\n#include <utility>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/generated_enum_util.h>\n#include <google/protobuf/map_type_handler.h>\n#include <google/protobuf/stubs/hash.h>\n\nnamespace google {\nnamespace protobuf {\n\ntemplate <typename Key, typename T>\nclass Map;\n\nclass MapIterator;\n\ntemplate <typename Enum> struct is_proto_enum;\n\nnamespace internal {\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType key_wire_type,\n          WireFormatLite::FieldType value_wire_type, int default_enum_value>\nclass MapFieldLite;\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType key_wire_type,\n          WireFormatLite::FieldType value_wire_type, int default_enum_value>\nclass MapField;\n\ntemplate <typename Key, typename T>\nclass TypeDefinedMapFieldBase;\n\nclass DynamicMapField;\n\nclass GeneratedMessageReflection;\n}  // namespace internal\n\n// This is the class for google::protobuf::Map's internal value_type. Instead of using\n// std::pair as value_type, we use this class which provides us more control of\n// its process of construction and destruction.\ntemplate <typename Key, typename T>\nclass MapPair {\n public:\n  typedef const Key first_type;\n  typedef T second_type;\n\n  MapPair(const Key& other_first, const T& other_second)\n      : first(other_first), second(other_second) {}\n  explicit MapPair(const Key& other_first) : first(other_first), second() {}\n  MapPair(const MapPair& other)\n      : first(other.first), second(other.second) {}\n\n  ~MapPair() {}\n\n  // Implicitly convertible to std::pair of compatible types.\n  template <typename T1, typename T2>\n  operator std::pair<T1, T2>() const {\n    return std::pair<T1, T2>(first, second);\n  }\n\n  const Key first;\n  T second;\n\n private:\n  friend class ::google::protobuf::Arena;\n  friend class Map<Key, T>;\n};\n\n// google::protobuf::Map is an associative container type used to store protobuf map\n// fields.  Each Map instance may or may not use a different hash function, a\n// different iteration order, and so on.  E.g., please don't examine\n// implementation details to decide if the following would work:\n//  Map<int, int> m0, m1;\n//  m0[0] = m1[0] = m0[1] = m1[1] = 0;\n//  assert(m0.begin()->first == m1.begin()->first);  // Bug!\n//\n// Map's interface is similar to std::unordered_map, except that Map is not\n// designed to play well with exceptions.\ntemplate <typename Key, typename T>\nclass Map {\n public:\n  typedef Key key_type;\n  typedef T mapped_type;\n  typedef MapPair<Key, T> value_type;\n\n  typedef value_type* pointer;\n  typedef const value_type* const_pointer;\n  typedef value_type& reference;\n  typedef const value_type& const_reference;\n\n  typedef size_t size_type;\n  typedef hash<Key> hasher;\n\n  Map() : arena_(NULL), default_enum_value_(0) { Init(); }\n  explicit Map(Arena* arena) : arena_(arena), default_enum_value_(0) { Init(); }\n\n  Map(const Map& other)\n      : arena_(NULL), default_enum_value_(other.default_enum_value_) {\n    Init();\n    insert(other.begin(), other.end());\n  }\n\n  Map(Map&& other) noexcept : Map() {\n    if (other.arena_) {\n      *this = other;\n    } else {\n      swap(other);\n    }\n  }\n  Map& operator=(Map&& other) noexcept {\n    if (this != &other) {\n      if (arena_ != other.arena_) {\n        *this = other;\n      } else {\n        swap(other);\n      }\n    }\n    return *this;\n  }\n\n  template <class InputIt>\n  Map(const InputIt& first, const InputIt& last)\n      : arena_(NULL), default_enum_value_(0) {\n    Init();\n    insert(first, last);\n  }\n\n  ~Map() {\n    clear();\n    if (arena_ == NULL) {\n      delete elements_;\n    }\n  }\n\n private:\n  void Init() {\n    elements_ = Arena::Create<InnerMap>(arena_, 0u, hasher(), Allocator(arena_));\n  }\n\n  // re-implement std::allocator to use arena allocator for memory allocation.\n  // Used for google::protobuf::Map implementation. Users should not use this class\n  // directly.\n  template <typename U>\n  class MapAllocator {\n   public:\n    typedef U value_type;\n    typedef value_type* pointer;\n    typedef const value_type* const_pointer;\n    typedef value_type& reference;\n    typedef const value_type& const_reference;\n    typedef size_t size_type;\n    typedef ptrdiff_t difference_type;\n\n    MapAllocator() : arena_(NULL) {}\n    explicit MapAllocator(Arena* arena) : arena_(arena) {}\n    template <typename X>\n    MapAllocator(const MapAllocator<X>& allocator)\n        : arena_(allocator.arena()) {}\n\n    pointer allocate(size_type n, const void* /* hint */ = 0) {\n      // If arena is not given, malloc needs to be called which doesn't\n      // construct element object.\n      if (arena_ == NULL) {\n        return static_cast<pointer>(::operator new(n * sizeof(value_type)));\n      } else {\n        return reinterpret_cast<pointer>(\n            Arena::CreateArray<uint8>(arena_, n * sizeof(value_type)));\n      }\n    }\n\n    void deallocate(pointer p, size_type n) {\n      if (arena_ == NULL) {\n#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)\n        ::operator delete(p, n * sizeof(value_type));\n#else\n        (void)n;\n        ::operator delete(p);\n#endif\n      }\n    }\n\n#if __cplusplus >= 201103L && !defined(GOOGLE_PROTOBUF_OS_APPLE) && \\\n    !defined(GOOGLE_PROTOBUF_OS_NACL) &&                            \\\n    !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN)\n    template<class NodeType, class... Args>\n    void construct(NodeType* p, Args&&... args) {\n      // Clang 3.6 doesn't compile static casting to void* directly. (Issue\n      // #1266) According C++ standard 5.2.9/1: \"The static_cast operator shall\n      // not cast away constness\". So first the maybe const pointer is casted to\n      // const void* and after the const void* is const casted.\n      new (const_cast<void*>(static_cast<const void*>(p)))\n          NodeType(std::forward<Args>(args)...);\n    }\n\n    template<class NodeType>\n    void destroy(NodeType* p) {\n      p->~NodeType();\n    }\n#else\n    void construct(pointer p, const_reference t) { new (p) value_type(t); }\n\n    void destroy(pointer p) { p->~value_type(); }\n#endif\n\n    template <typename X>\n    struct rebind {\n      typedef MapAllocator<X> other;\n    };\n\n    template <typename X>\n    bool operator==(const MapAllocator<X>& other) const {\n      return arena_ == other.arena_;\n    }\n\n    template <typename X>\n    bool operator!=(const MapAllocator<X>& other) const {\n      return arena_ != other.arena_;\n    }\n\n    // To support Visual Studio 2008\n    size_type max_size() const {\n      // parentheses around (std::...:max) prevents macro warning of max()\n      return (std::numeric_limits<size_type>::max)();\n    }\n\n    // To support gcc-4.4, which does not properly\n    // support templated friend classes\n    Arena* arena() const {\n      return arena_;\n    }\n\n   private:\n    typedef void DestructorSkippable_;\n    Arena* const arena_;\n  };\n\n  // InnerMap's key type is Key and its value type is value_type*.  We use a\n  // custom class here and for Node, below, to ensure that k_ is at offset 0,\n  // allowing safe conversion from pointer to Node to pointer to Key, and vice\n  // versa when appropriate.\n  class KeyValuePair {\n   public:\n    KeyValuePair(const Key& k, value_type* v) : k_(k), v_(v) {}\n\n    const Key& key() const { return k_; }\n    Key& key() { return k_; }\n    value_type* value() const { return v_; }\n    value_type*& value() { return v_; }\n\n   private:\n    Key k_;\n    value_type* v_;\n  };\n\n  typedef MapAllocator<KeyValuePair> Allocator;\n\n  // InnerMap is a generic hash-based map.  It doesn't contain any\n  // protocol-buffer-specific logic.  It is a chaining hash map with the\n  // additional feature that some buckets can be converted to use an ordered\n  // container.  This ensures O(lg n) bounds on find, insert, and erase, while\n  // avoiding the overheads of ordered containers most of the time.\n  //\n  // The implementation doesn't need the full generality of unordered_map,\n  // and it doesn't have it.  More bells and whistles can be added as needed.\n  // Some implementation details:\n  // 1. The hash function has type hasher and the equality function\n  //    equal_to<Key>.  We inherit from hasher to save space\n  //    (empty-base-class optimization).\n  // 2. The number of buckets is a power of two.\n  // 3. Buckets are converted to trees in pairs: if we convert bucket b then\n  //    buckets b and b^1 will share a tree.  Invariant: buckets b and b^1 have\n  //    the same non-NULL value iff they are sharing a tree.  (An alternative\n  //    implementation strategy would be to have a tag bit per bucket.)\n  // 4. As is typical for hash_map and such, the Keys and Values are always\n  //    stored in linked list nodes.  Pointers to elements are never invalidated\n  //    until the element is deleted.\n  // 5. The trees' payload type is pointer to linked-list node.  Tree-converting\n  //    a bucket doesn't copy Key-Value pairs.\n  // 6. Once we've tree-converted a bucket, it is never converted back. However,\n  //    the items a tree contains may wind up assigned to trees or lists upon a\n  //    rehash.\n  // 7. The code requires no C++ features from C++11 or later.\n  // 8. Mutations to a map do not invalidate the map's iterators, pointers to\n  //    elements, or references to elements.\n  // 9. Except for erase(iterator), any non-const method can reorder iterators.\n  class InnerMap : private hasher {\n   public:\n    typedef value_type* Value;\n\n    InnerMap(size_type n, hasher h, Allocator alloc)\n        : hasher(h),\n          num_elements_(0),\n          seed_(Seed()),\n          table_(NULL),\n          alloc_(alloc) {\n      n = TableSize(n);\n      table_ = CreateEmptyTable(n);\n      num_buckets_ = index_of_first_non_null_ = n;\n    }\n\n    ~InnerMap() {\n      if (table_ != NULL) {\n        clear();\n        Dealloc<void*>(table_, num_buckets_);\n      }\n    }\n\n   private:\n    enum { kMinTableSize = 8 };\n\n    // Linked-list nodes, as one would expect for a chaining hash table.\n    struct Node {\n      KeyValuePair kv;\n      Node* next;\n    };\n\n    // This is safe only if the given pointer is known to point to a Key that is\n    // part of a Node.\n    static Node* NodePtrFromKeyPtr(Key* k) {\n      return reinterpret_cast<Node*>(k);\n    }\n\n    static Key* KeyPtrFromNodePtr(Node* node) { return &node->kv.key(); }\n\n    // Trees.  The payload type is pointer to Key, so that we can query the tree\n    // with Keys that are not in any particular data structure.  When we insert,\n    // though, the pointer is always pointing to a Key that is inside a Node.\n    struct KeyCompare {\n      bool operator()(const Key* n0, const Key* n1) const { return *n0 < *n1; }\n    };\n    typedef typename Allocator::template rebind<Key*>::other KeyPtrAllocator;\n    typedef std::set<Key*, KeyCompare, KeyPtrAllocator> Tree;\n    typedef typename Tree::iterator TreeIterator;\n\n    // iterator and const_iterator are instantiations of iterator_base.\n    template <typename KeyValueType>\n    struct iterator_base {\n      typedef KeyValueType& reference;\n      typedef KeyValueType* pointer;\n\n      // Invariants:\n      // node_ is always correct. This is handy because the most common\n      // operations are operator* and operator-> and they only use node_.\n      // When node_ is set to a non-NULL value, all the other non-const fields\n      // are updated to be correct also, but those fields can become stale\n      // if the underlying map is modified.  When those fields are needed they\n      // are rechecked, and updated if necessary.\n      iterator_base() : node_(NULL), m_(NULL), bucket_index_(0) {}\n\n      explicit iterator_base(const InnerMap* m) : m_(m) {\n        SearchFrom(m->index_of_first_non_null_);\n      }\n\n      // Any iterator_base can convert to any other.  This is overkill, and we\n      // rely on the enclosing class to use it wisely.  The standard \"iterator\n      // can convert to const_iterator\" is OK but the reverse direction is not.\n      template <typename U>\n      explicit iterator_base(const iterator_base<U>& it)\n          : node_(it.node_), m_(it.m_), bucket_index_(it.bucket_index_) {}\n\n      iterator_base(Node* n, const InnerMap* m, size_type index)\n          : node_(n), m_(m), bucket_index_(index) {}\n\n      iterator_base(TreeIterator tree_it, const InnerMap* m, size_type index)\n          : node_(NodePtrFromKeyPtr(*tree_it)), m_(m), bucket_index_(index) {\n        // Invariant: iterators that use buckets with trees have an even\n        // bucket_index_.\n        GOOGLE_DCHECK_EQ(bucket_index_ % 2, 0);\n      }\n\n      // Advance through buckets, looking for the first that isn't empty.\n      // If nothing non-empty is found then leave node_ == NULL.\n      void SearchFrom(size_type start_bucket) {\n        GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ ||\n               m_->table_[m_->index_of_first_non_null_] != NULL);\n        node_ = NULL;\n        for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_;\n             bucket_index_++) {\n          if (m_->TableEntryIsNonEmptyList(bucket_index_)) {\n            node_ = static_cast<Node*>(m_->table_[bucket_index_]);\n            break;\n          } else if (m_->TableEntryIsTree(bucket_index_)) {\n            Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]);\n            GOOGLE_DCHECK(!tree->empty());\n            node_ = NodePtrFromKeyPtr(*tree->begin());\n            break;\n          }\n        }\n      }\n\n      reference operator*() const { return node_->kv; }\n      pointer operator->() const { return &(operator*()); }\n\n      friend bool operator==(const iterator_base& a, const iterator_base& b) {\n        return a.node_ == b.node_;\n      }\n      friend bool operator!=(const iterator_base& a, const iterator_base& b) {\n        return a.node_ != b.node_;\n      }\n\n      iterator_base& operator++() {\n        if (node_->next == NULL) {\n          TreeIterator tree_it;\n          const bool is_list = revalidate_if_necessary(&tree_it);\n          if (is_list) {\n            SearchFrom(bucket_index_ + 1);\n          } else {\n            GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0);\n            Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]);\n            if (++tree_it == tree->end()) {\n              SearchFrom(bucket_index_ + 2);\n            } else {\n              node_ = NodePtrFromKeyPtr(*tree_it);\n            }\n          }\n        } else {\n          node_ = node_->next;\n        }\n        return *this;\n      }\n\n      iterator_base operator++(int /* unused */) {\n        iterator_base tmp = *this;\n        ++*this;\n        return tmp;\n      }\n\n      // Assumes node_ and m_ are correct and non-NULL, but other fields may be\n      // stale.  Fix them as needed.  Then return true iff node_ points to a\n      // Node in a list.  If false is returned then *it is modified to be\n      // a valid iterator for node_.\n      bool revalidate_if_necessary(TreeIterator* it) {\n        GOOGLE_DCHECK(node_ != NULL && m_ != NULL);\n        // Force bucket_index_ to be in range.\n        bucket_index_ &= (m_->num_buckets_ - 1);\n        // Common case: the bucket we think is relevant points to node_.\n        if (m_->table_[bucket_index_] == static_cast<void*>(node_))\n          return true;\n        // Less common: the bucket is a linked list with node_ somewhere in it,\n        // but not at the head.\n        if (m_->TableEntryIsNonEmptyList(bucket_index_)) {\n          Node* l = static_cast<Node*>(m_->table_[bucket_index_]);\n          while ((l = l->next) != NULL) {\n            if (l == node_) {\n              return true;\n            }\n          }\n        }\n        // Well, bucket_index_ still might be correct, but probably\n        // not.  Revalidate just to be sure.  This case is rare enough that we\n        // don't worry about potential optimizations, such as having a custom\n        // find-like method that compares Node* instead of const Key&.\n        iterator_base i(m_->find(*KeyPtrFromNodePtr(node_), it));\n        bucket_index_ = i.bucket_index_;\n        return m_->TableEntryIsList(bucket_index_);\n      }\n\n      Node* node_;\n      const InnerMap* m_;\n      size_type bucket_index_;\n    };\n\n   public:\n    typedef iterator_base<KeyValuePair> iterator;\n    typedef iterator_base<const KeyValuePair> const_iterator;\n\n    iterator begin() { return iterator(this); }\n    iterator end() { return iterator(); }\n    const_iterator begin() const { return const_iterator(this); }\n    const_iterator end() const { return const_iterator(); }\n\n    void clear() {\n      for (size_type b = 0; b < num_buckets_; b++) {\n        if (TableEntryIsNonEmptyList(b)) {\n          Node* node = static_cast<Node*>(table_[b]);\n          table_[b] = NULL;\n          do {\n            Node* next = node->next;\n            DestroyNode(node);\n            node = next;\n          } while (node != NULL);\n        } else if (TableEntryIsTree(b)) {\n          Tree* tree = static_cast<Tree*>(table_[b]);\n          GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0);\n          table_[b] = table_[b + 1] = NULL;\n          typename Tree::iterator tree_it = tree->begin();\n          do {\n            Node* node = NodePtrFromKeyPtr(*tree_it);\n            typename Tree::iterator next = tree_it;\n            ++next;\n            tree->erase(tree_it);\n            DestroyNode(node);\n            tree_it = next;\n          } while (tree_it != tree->end());\n          DestroyTree(tree);\n          b++;\n        }\n      }\n      num_elements_ = 0;\n      index_of_first_non_null_ = num_buckets_;\n    }\n\n    const hasher& hash_function() const { return *this; }\n\n    static size_type max_size() {\n      return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28);\n    }\n    size_type size() const { return num_elements_; }\n    bool empty() const { return size() == 0; }\n\n    iterator find(const Key& k) { return iterator(FindHelper(k).first); }\n    const_iterator find(const Key& k) const { return find(k, NULL); }\n\n    // In traditional C++ style, this performs \"insert if not present.\"\n    std::pair<iterator, bool> insert(const KeyValuePair& kv) {\n      std::pair<const_iterator, size_type> p = FindHelper(kv.key());\n      // Case 1: key was already present.\n      if (p.first.node_ != NULL)\n        return std::make_pair(iterator(p.first), false);\n      // Case 2: insert.\n      if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) {\n        p = FindHelper(kv.key());\n      }\n      const size_type b = p.second;  // bucket number\n      Node* node = Alloc<Node>(1);\n      alloc_.construct(&node->kv, kv);\n      iterator result = InsertUnique(b, node);\n      ++num_elements_;\n      return std::make_pair(result, true);\n    }\n\n    // The same, but if an insertion is necessary then the value portion of the\n    // inserted key-value pair is left uninitialized.\n    std::pair<iterator, bool> insert(const Key& k) {\n      std::pair<const_iterator, size_type> p = FindHelper(k);\n      // Case 1: key was already present.\n      if (p.first.node_ != NULL)\n        return std::make_pair(iterator(p.first), false);\n      // Case 2: insert.\n      if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) {\n        p = FindHelper(k);\n      }\n      const size_type b = p.second;  // bucket number\n      Node* node = Alloc<Node>(1);\n      typedef typename Allocator::template rebind<Key>::other KeyAllocator;\n      KeyAllocator(alloc_).construct(&node->kv.key(), k);\n      iterator result = InsertUnique(b, node);\n      ++num_elements_;\n      return std::make_pair(result, true);\n    }\n\n    Value& operator[](const Key& k) {\n      KeyValuePair kv(k, Value());\n      return insert(kv).first->value();\n    }\n\n    void erase(iterator it) {\n      GOOGLE_DCHECK_EQ(it.m_, this);\n      typename Tree::iterator tree_it;\n      const bool is_list = it.revalidate_if_necessary(&tree_it);\n      size_type b = it.bucket_index_;\n      Node* const item = it.node_;\n      if (is_list) {\n        GOOGLE_DCHECK(TableEntryIsNonEmptyList(b));\n        Node* head = static_cast<Node*>(table_[b]);\n        head = EraseFromLinkedList(item, head);\n        table_[b] = static_cast<void*>(head);\n      } else {\n        GOOGLE_DCHECK(TableEntryIsTree(b));\n        Tree* tree = static_cast<Tree*>(table_[b]);\n        tree->erase(*tree_it);\n        if (tree->empty()) {\n          // Force b to be the minimum of b and b ^ 1.  This is important\n          // only because we want index_of_first_non_null_ to be correct.\n          b &= ~static_cast<size_type>(1);\n          DestroyTree(tree);\n          table_[b] = table_[b + 1] = NULL;\n        }\n      }\n      DestroyNode(item);\n      --num_elements_;\n      if (GOOGLE_PREDICT_FALSE(b == index_of_first_non_null_)) {\n        while (index_of_first_non_null_ < num_buckets_ &&\n               table_[index_of_first_non_null_] == NULL) {\n          ++index_of_first_non_null_;\n        }\n      }\n    }\n\n   private:\n    const_iterator find(const Key& k, TreeIterator* it) const {\n      return FindHelper(k, it).first;\n    }\n    std::pair<const_iterator, size_type> FindHelper(const Key& k) const {\n      return FindHelper(k, NULL);\n    }\n    std::pair<const_iterator, size_type> FindHelper(const Key& k,\n                                                    TreeIterator* it) const {\n      size_type b = BucketNumber(k);\n      if (TableEntryIsNonEmptyList(b)) {\n        Node* node = static_cast<Node*>(table_[b]);\n        do {\n          if (IsMatch(*KeyPtrFromNodePtr(node), k)) {\n            return std::make_pair(const_iterator(node, this, b), b);\n          } else {\n            node = node->next;\n          }\n        } while (node != NULL);\n      } else if (TableEntryIsTree(b)) {\n        GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]);\n        b &= ~static_cast<size_t>(1);\n        Tree* tree = static_cast<Tree*>(table_[b]);\n        Key* key = const_cast<Key*>(&k);\n        typename Tree::iterator tree_it = tree->find(key);\n        if (tree_it != tree->end()) {\n          if (it != NULL) *it = tree_it;\n          return std::make_pair(const_iterator(tree_it, this, b), b);\n        }\n      }\n      return std::make_pair(end(), b);\n    }\n\n    // Insert the given Node in bucket b.  If that would make bucket b too big,\n    // and bucket b is not a tree, create a tree for buckets b and b^1 to share.\n    // Requires count(*KeyPtrFromNodePtr(node)) == 0 and that b is the correct\n    // bucket.  num_elements_ is not modified.\n    iterator InsertUnique(size_type b, Node* node) {\n      GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ ||\n             table_[index_of_first_non_null_] != NULL);\n      // In practice, the code that led to this point may have already\n      // determined whether we are inserting into an empty list, a short list,\n      // or whatever.  But it's probably cheap enough to recompute that here;\n      // it's likely that we're inserting into an empty or short list.\n      iterator result;\n      GOOGLE_DCHECK(find(*KeyPtrFromNodePtr(node)) == end());\n      if (TableEntryIsEmpty(b)) {\n        result = InsertUniqueInList(b, node);\n      } else if (TableEntryIsNonEmptyList(b)) {\n        if (GOOGLE_PREDICT_FALSE(TableEntryIsTooLong(b))) {\n          TreeConvert(b);\n          result = InsertUniqueInTree(b, node);\n          GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1));\n        } else {\n          // Insert into a pre-existing list.  This case cannot modify\n          // index_of_first_non_null_, so we skip the code to update it.\n          return InsertUniqueInList(b, node);\n        }\n      } else {\n        // Insert into a pre-existing tree.  This case cannot modify\n        // index_of_first_non_null_, so we skip the code to update it.\n        return InsertUniqueInTree(b, node);\n      }\n      // parentheses around (std::min) prevents macro expansion of min(...)\n      index_of_first_non_null_ =\n          (std::min)(index_of_first_non_null_, result.bucket_index_);\n      return result;\n    }\n\n    // Helper for InsertUnique.  Handles the case where bucket b is a\n    // not-too-long linked list.\n    iterator InsertUniqueInList(size_type b, Node* node) {\n      node->next = static_cast<Node*>(table_[b]);\n      table_[b] = static_cast<void*>(node);\n      return iterator(node, this, b);\n    }\n\n    // Helper for InsertUnique.  Handles the case where bucket b points to a\n    // Tree.\n    iterator InsertUniqueInTree(size_type b, Node* node) {\n      GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]);\n      // Maintain the invariant that node->next is NULL for all Nodes in Trees.\n      node->next = NULL;\n      return iterator(static_cast<Tree*>(table_[b])\n                      ->insert(KeyPtrFromNodePtr(node))\n                      .first,\n                      this, b & ~static_cast<size_t>(1));\n    }\n\n    // Returns whether it did resize.  Currently this is only used when\n    // num_elements_ increases, though it could be used in other situations.\n    // It checks for load too low as well as load too high: because any number\n    // of erases can occur between inserts, the load could be as low as 0 here.\n    // Resizing to a lower size is not always helpful, but failing to do so can\n    // destroy the expected big-O bounds for some operations. By having the\n    // policy that sometimes we resize down as well as up, clients can easily\n    // keep O(size()) = O(number of buckets) if they want that.\n    bool ResizeIfLoadIsOutOfRange(size_type new_size) {\n      const size_type kMaxMapLoadTimes16 = 12;  // controls RAM vs CPU tradeoff\n      const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16;\n      const size_type lo_cutoff = hi_cutoff / 4;\n      // We don't care how many elements are in trees.  If a lot are,\n      // we may resize even though there are many empty buckets.  In\n      // practice, this seems fine.\n      if (GOOGLE_PREDICT_FALSE(new_size >= hi_cutoff)) {\n        if (num_buckets_ <= max_size() / 2) {\n          Resize(num_buckets_ * 2);\n          return true;\n        }\n      } else if (GOOGLE_PREDICT_FALSE(new_size <= lo_cutoff &&\n                                    num_buckets_ > kMinTableSize)) {\n        size_type lg2_of_size_reduction_factor = 1;\n        // It's possible we want to shrink a lot here... size() could even be 0.\n        // So, estimate how much to shrink by making sure we don't shrink so\n        // much that we would need to grow the table after a few inserts.\n        const size_type hypothetical_size = new_size * 5 / 4 + 1;\n        while ((hypothetical_size << lg2_of_size_reduction_factor) <\n               hi_cutoff) {\n          ++lg2_of_size_reduction_factor;\n        }\n        size_type new_num_buckets = std::max<size_type>(\n            kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor);\n        if (new_num_buckets != num_buckets_) {\n          Resize(new_num_buckets);\n          return true;\n        }\n      }\n      return false;\n    }\n\n    // Resize to the given number of buckets.\n    void Resize(size_t new_num_buckets) {\n      GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize);\n      void** const old_table = table_;\n      const size_type old_table_size = num_buckets_;\n      num_buckets_ = new_num_buckets;\n      table_ = CreateEmptyTable(num_buckets_);\n      const size_type start = index_of_first_non_null_;\n      index_of_first_non_null_ = num_buckets_;\n      for (size_type i = start; i < old_table_size; i++) {\n        if (TableEntryIsNonEmptyList(old_table, i)) {\n          TransferList(old_table, i);\n        } else if (TableEntryIsTree(old_table, i)) {\n          TransferTree(old_table, i++);\n        }\n      }\n      Dealloc<void*>(old_table, old_table_size);\n    }\n\n    void TransferList(void* const* table, size_type index) {\n      Node* node = static_cast<Node*>(table[index]);\n      do {\n        Node* next = node->next;\n        InsertUnique(BucketNumber(*KeyPtrFromNodePtr(node)), node);\n        node = next;\n      } while (node != NULL);\n    }\n\n    void TransferTree(void* const* table, size_type index) {\n      Tree* tree = static_cast<Tree*>(table[index]);\n      typename Tree::iterator tree_it = tree->begin();\n      do {\n        Node* node = NodePtrFromKeyPtr(*tree_it);\n        InsertUnique(BucketNumber(**tree_it), node);\n      } while (++tree_it != tree->end());\n      DestroyTree(tree);\n    }\n\n    Node* EraseFromLinkedList(Node* item, Node* head) {\n      if (head == item) {\n        return head->next;\n      } else {\n        head->next = EraseFromLinkedList(item, head->next);\n        return head;\n      }\n    }\n\n    bool TableEntryIsEmpty(size_type b) const {\n      return TableEntryIsEmpty(table_, b);\n    }\n    bool TableEntryIsNonEmptyList(size_type b) const {\n      return TableEntryIsNonEmptyList(table_, b);\n    }\n    bool TableEntryIsTree(size_type b) const {\n      return TableEntryIsTree(table_, b);\n    }\n    bool TableEntryIsList(size_type b) const {\n      return TableEntryIsList(table_, b);\n    }\n    static bool TableEntryIsEmpty(void* const* table, size_type b) {\n      return table[b] == NULL;\n    }\n    static bool TableEntryIsNonEmptyList(void* const* table, size_type b) {\n      return table[b] != NULL && table[b] != table[b ^ 1];\n    }\n    static bool TableEntryIsTree(void* const* table, size_type b) {\n      return !TableEntryIsEmpty(table, b) &&\n          !TableEntryIsNonEmptyList(table, b);\n    }\n    static bool TableEntryIsList(void* const* table, size_type b) {\n      return !TableEntryIsTree(table, b);\n    }\n\n    void TreeConvert(size_type b) {\n      GOOGLE_DCHECK(!TableEntryIsTree(b) && !TableEntryIsTree(b ^ 1));\n      typename Allocator::template rebind<Tree>::other tree_allocator(alloc_);\n      Tree* tree = tree_allocator.allocate(1);\n      // We want to use the three-arg form of construct, if it exists, but we\n      // create a temporary and use the two-arg construct that's known to exist.\n      // It's clunky, but the compiler should be able to generate more-or-less\n      // the same code.\n      tree_allocator.construct(tree,\n                               Tree(KeyCompare(), KeyPtrAllocator(alloc_)));\n      // Now the tree is ready to use.\n      size_type count = CopyListToTree(b, tree) + CopyListToTree(b ^ 1, tree);\n      GOOGLE_DCHECK_EQ(count, tree->size());\n      table_[b] = table_[b ^ 1] = static_cast<void*>(tree);\n    }\n\n    // Copy a linked list in the given bucket to a tree.\n    // Returns the number of things it copied.\n    size_type CopyListToTree(size_type b, Tree* tree) {\n      size_type count = 0;\n      Node* node = static_cast<Node*>(table_[b]);\n      while (node != NULL) {\n        tree->insert(KeyPtrFromNodePtr(node));\n        ++count;\n        Node* next = node->next;\n        node->next = NULL;\n        node = next;\n      }\n      return count;\n    }\n\n    // Return whether table_[b] is a linked list that seems awfully long.\n    // Requires table_[b] to point to a non-empty linked list.\n    bool TableEntryIsTooLong(size_type b) {\n      const size_type kMaxLength = 8;\n      size_type count = 0;\n      Node* node = static_cast<Node*>(table_[b]);\n      do {\n        ++count;\n        node = node->next;\n      } while (node != NULL);\n      // Invariant: no linked list ever is more than kMaxLength in length.\n      GOOGLE_DCHECK_LE(count, kMaxLength);\n      return count >= kMaxLength;\n    }\n\n    size_type BucketNumber(const Key& k) const {\n      // We inherit from hasher, so one-arg operator() provides a hash function.\n      size_type h = (*const_cast<InnerMap*>(this))(k);\n      return (h + seed_) & (num_buckets_ - 1);\n    }\n\n    bool IsMatch(const Key& k0, const Key& k1) const {\n      return std::equal_to<Key>()(k0, k1);\n    }\n\n    // Return a power of two no less than max(kMinTableSize, n).\n    // Assumes either n < kMinTableSize or n is a power of two.\n    size_type TableSize(size_type n) {\n      return n < static_cast<size_type>(kMinTableSize)\n                 ? static_cast<size_type>(kMinTableSize)\n                 : n;\n    }\n\n    // Use alloc_ to allocate an array of n objects of type U.\n    template <typename U>\n    U* Alloc(size_type n) {\n      typedef typename Allocator::template rebind<U>::other alloc_type;\n      return alloc_type(alloc_).allocate(n);\n    }\n\n    // Use alloc_ to deallocate an array of n objects of type U.\n    template <typename U>\n    void Dealloc(U* t, size_type n) {\n      typedef typename Allocator::template rebind<U>::other alloc_type;\n      alloc_type(alloc_).deallocate(t, n);\n    }\n\n    void DestroyNode(Node* node) {\n      alloc_.destroy(&node->kv);\n      Dealloc<Node>(node, 1);\n    }\n\n    void DestroyTree(Tree* tree) {\n      typename Allocator::template rebind<Tree>::other tree_allocator(alloc_);\n      tree_allocator.destroy(tree);\n      tree_allocator.deallocate(tree, 1);\n    }\n\n    void** CreateEmptyTable(size_type n) {\n      GOOGLE_DCHECK(n >= kMinTableSize);\n      GOOGLE_DCHECK_EQ(n & (n - 1), 0);\n      void** result = Alloc<void*>(n);\n      memset(result, 0, n * sizeof(result[0]));\n      return result;\n    }\n\n    // Return a randomish value.\n    size_type Seed() const {\n      size_type s = static_cast<size_type>(reinterpret_cast<uintptr_t>(this));\n#if defined(__x86_64__) && defined(__GNUC__)\n      uint32 hi, lo;\n      asm(\"rdtsc\" : \"=a\" (lo), \"=d\" (hi));\n      s += ((static_cast<uint64>(hi) << 32) | lo);\n#endif\n      return s;\n    }\n\n    size_type num_elements_;\n    size_type num_buckets_;\n    size_type seed_;\n    size_type index_of_first_non_null_;\n    void** table_;  // an array with num_buckets_ entries\n    Allocator alloc_;\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(InnerMap);\n  };  // end of class InnerMap\n\n public:\n  // Iterators\n  class const_iterator {\n    typedef typename InnerMap::const_iterator InnerIt;\n\n   public:\n    typedef std::forward_iterator_tag iterator_category;\n    typedef typename Map::value_type value_type;\n    typedef ptrdiff_t difference_type;\n    typedef const value_type* pointer;\n    typedef const value_type& reference;\n\n    const_iterator() {}\n    explicit const_iterator(const InnerIt& it) : it_(it) {}\n\n    const_reference operator*() const {\n      return *it_->value();\n    }\n    const_pointer operator->() const { return &(operator*()); }\n\n    const_iterator& operator++() {\n      ++it_;\n      return *this;\n    }\n    const_iterator operator++(int) { return const_iterator(it_++); }\n\n    friend bool operator==(const const_iterator& a, const const_iterator& b) {\n      return a.it_ == b.it_;\n    }\n    friend bool operator!=(const const_iterator& a, const const_iterator& b) {\n      return !(a == b);\n    }\n\n   private:\n    InnerIt it_;\n  };\n\n  class iterator {\n    typedef typename InnerMap::iterator InnerIt;\n\n   public:\n    typedef std::forward_iterator_tag iterator_category;\n    typedef typename Map::value_type value_type;\n    typedef ptrdiff_t difference_type;\n    typedef value_type* pointer;\n    typedef value_type& reference;\n\n    iterator() {}\n    explicit iterator(const InnerIt& it) : it_(it) {}\n\n    reference operator*() const { return *it_->value(); }\n    pointer operator->() const { return &(operator*()); }\n\n    iterator& operator++() {\n      ++it_;\n      return *this;\n    }\n    iterator operator++(int) { return iterator(it_++); }\n\n    // Allow implicit conversion to const_iterator.\n    operator const_iterator() const {\n      return const_iterator(typename InnerMap::const_iterator(it_));\n    }\n\n    friend bool operator==(const iterator& a, const iterator& b) {\n      return a.it_ == b.it_;\n    }\n    friend bool operator!=(const iterator& a, const iterator& b) {\n      return !(a == b);\n    }\n\n   private:\n    friend class Map;\n\n    InnerIt it_;\n  };\n\n  iterator begin() { return iterator(elements_->begin()); }\n  iterator end() { return iterator(elements_->end()); }\n  const_iterator begin() const {\n    return const_iterator(iterator(elements_->begin()));\n  }\n  const_iterator end() const {\n    return const_iterator(iterator(elements_->end()));\n  }\n  const_iterator cbegin() const { return begin(); }\n  const_iterator cend() const { return end(); }\n\n  // Capacity\n  size_type size() const { return elements_->size(); }\n  bool empty() const { return size() == 0; }\n\n  // Element access\n  T& operator[](const key_type& key) {\n    value_type** value =  &(*elements_)[key];\n    if (*value == NULL) {\n      *value = CreateValueTypeInternal(key);\n      internal::MapValueInitializer<google::protobuf::is_proto_enum<T>::value,\n                                    T>::Initialize((*value)->second,\n                                                   default_enum_value_);\n    }\n    return (*value)->second;\n  }\n  const T& at(const key_type& key) const {\n    const_iterator it = find(key);\n    GOOGLE_CHECK(it != end()) << \"key not found: \" << key;\n    return it->second;\n  }\n  T& at(const key_type& key) {\n    iterator it = find(key);\n    GOOGLE_CHECK(it != end()) << \"key not found: \" << key;\n    return it->second;\n  }\n\n  // Lookup\n  size_type count(const key_type& key) const {\n    const_iterator it = find(key);\n    GOOGLE_DCHECK(it == end() || key == it->first);\n    return it == end() ? 0 : 1;\n  }\n  const_iterator find(const key_type& key) const {\n    return const_iterator(iterator(elements_->find(key)));\n  }\n  iterator find(const key_type& key) { return iterator(elements_->find(key)); }\n  std::pair<const_iterator, const_iterator> equal_range(\n      const key_type& key) const {\n    const_iterator it = find(key);\n    if (it == end()) {\n      return std::pair<const_iterator, const_iterator>(it, it);\n    } else {\n      const_iterator begin = it++;\n      return std::pair<const_iterator, const_iterator>(begin, it);\n    }\n  }\n  std::pair<iterator, iterator> equal_range(const key_type& key) {\n    iterator it = find(key);\n    if (it == end()) {\n      return std::pair<iterator, iterator>(it, it);\n    } else {\n      iterator begin = it++;\n      return std::pair<iterator, iterator>(begin, it);\n    }\n  }\n\n  // insert\n  std::pair<iterator, bool> insert(const value_type& value) {\n    std::pair<typename InnerMap::iterator, bool> p =\n        elements_->insert(value.first);\n    if (p.second) {\n      p.first->value() = CreateValueTypeInternal(value);\n    }\n    return std::pair<iterator, bool>(iterator(p.first), p.second);\n  }\n  template <class InputIt>\n  void insert(InputIt first, InputIt last) {\n    for (InputIt it = first; it != last; ++it) {\n      iterator exist_it = find(it->first);\n      if (exist_it == end()) {\n        operator[](it->first) = it->second;\n      }\n    }\n  }\n  void insert(std::initializer_list<value_type> values) {\n    insert(values.begin(), values.end());\n  }\n\n  // Erase and clear\n  size_type erase(const key_type& key) {\n    iterator it = find(key);\n    if (it == end()) {\n      return 0;\n    } else {\n      erase(it);\n      return 1;\n    }\n  }\n  iterator erase(iterator pos) {\n    if (arena_ == NULL) delete pos.operator->();\n    iterator i = pos++;\n    elements_->erase(i.it_);\n    return pos;\n  }\n  void erase(iterator first, iterator last) {\n    while (first != last) {\n      first = erase(first);\n    }\n  }\n  void clear() { erase(begin(), end()); }\n\n  // Assign\n  Map& operator=(const Map& other) {\n    if (this != &other) {\n      clear();\n      insert(other.begin(), other.end());\n    }\n    return *this;\n  }\n\n  void swap(Map& other) {\n    if (arena_ == other.arena_) {\n      std::swap(default_enum_value_, other.default_enum_value_);\n      std::swap(elements_, other.elements_);\n    } else {\n      // TODO(zuguang): optimize this. The temporary copy can be allocated\n      // in the same arena as the other message, and the \"other = copy\" can\n      // be replaced with the fast-path swap above.\n      Map copy = *this;\n      *this = other;\n      other = copy;\n    }\n  }\n\n  // Access to hasher.  Currently this returns a copy, but it may\n  // be modified to return a const reference in the future.\n  hasher hash_function() const { return elements_->hash_function(); }\n\n private:\n  // Set default enum value only for proto2 map field whose value is enum type.\n  void SetDefaultEnumValue(int default_enum_value) {\n    default_enum_value_ = default_enum_value;\n  }\n\n  value_type* CreateValueTypeInternal(const Key& key) {\n    if (arena_ == NULL) {\n      return new value_type(key);\n    } else {\n      value_type* value = reinterpret_cast<value_type*>(\n          Arena::CreateArray<uint8>(arena_, sizeof(value_type)));\n      Arena::CreateInArenaStorage(const_cast<Key*>(&value->first), arena_);\n      Arena::CreateInArenaStorage(&value->second, arena_);\n      const_cast<Key&>(value->first) = key;\n      return value;\n    }\n  }\n\n  value_type* CreateValueTypeInternal(const value_type& value) {\n    if (arena_ == NULL) {\n      return new value_type(value);\n    } else {\n      value_type* p = reinterpret_cast<value_type*>(\n          Arena::CreateArray<uint8>(arena_, sizeof(value_type)));\n      Arena::CreateInArenaStorage(const_cast<Key*>(&p->first), arena_);\n      Arena::CreateInArenaStorage(&p->second, arena_);\n      const_cast<Key&>(p->first) = value.first;\n      p->second = value.second;\n      return p;\n    }\n  }\n\n  Arena* arena_;\n  int default_enum_value_;\n  InnerMap* elements_;\n\n  friend class ::google::protobuf::Arena;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  template <typename Derived, typename K, typename V,\n            internal::WireFormatLite::FieldType key_wire_type,\n            internal::WireFormatLite::FieldType value_wire_type,\n            int default_enum_value>\n  friend class internal::MapFieldLite;\n};\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_MAP_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/map_entry.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_MAP_ENTRY_H__\n#define GOOGLE_PROTOBUF_MAP_ENTRY_H__\n\n#include <google/protobuf/generated_message_reflection.h>\n#include <google/protobuf/map_entry_lite.h>\n#include <google/protobuf/map_type_handler.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/reflection_ops.h>\n#include <google/protobuf/unknown_field_set.h>\n#include <google/protobuf/wire_format_lite_inl.h>\n\nnamespace google {\nnamespace protobuf {\nclass Arena;\nnamespace internal {\ntemplate <typename Derived, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nclass MapField;\n}\n}\n\nnamespace protobuf {\nnamespace internal {\n\n// MapEntry is the returned google::protobuf::Message when calling AddMessage of\n// google::protobuf::Reflection. In order to let it work with generated message\n// reflection, its in-memory type is the same as generated message with the same\n// fields. However, in order to decide the in-memory type of key/value, we need\n// to know both their cpp type in generated api and proto type. In\n// implementation, all in-memory types have related wire format functions to\n// support except ArenaStringPtr. Therefore, we need to define another type with\n// supporting wire format functions. Since this type is only used as return type\n// of MapEntry accessors, it's named MapEntry accessor type.\n//\n// cpp type:               the type visible to users in public API.\n// proto type:             WireFormatLite::FieldType of the field.\n// in-memory type:         type of the data member used to stored this field.\n// MapEntry accessor type: type used in MapEntry getters/mutators to access the\n//                         field.\n//\n// cpp type | proto type  | in-memory type | MapEntry accessor type\n// int32      TYPE_INT32    int32            int32\n// int32      TYPE_FIXED32  int32            int32\n// string     TYPE_STRING   ArenaStringPtr   string\n// FooEnum    TYPE_ENUM     int              int\n// FooMessage TYPE_MESSAGE  FooMessage*      FooMessage\n//\n// The in-memory types of primitive types can be inferred from its proto type,\n// while we need to explicitly specify the cpp type if proto type is\n// TYPE_MESSAGE to infer the in-memory type.  Moreover, default_enum_value is\n// used to initialize enum field in proto2.\ntemplate <typename Derived, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nclass MapEntry\n    : public MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType,\n                          kValueFieldType, default_enum_value> {\n public:\n  MapEntry() : _internal_metadata_(NULL) {}\n  explicit MapEntry(Arena* arena)\n      : MapEntryImpl<Derived, Message, Key, Value, kKeyFieldType,\n                     kValueFieldType, default_enum_value>(arena),\n        _internal_metadata_(arena) {}\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n\n  InternalMetadataWithArena _internal_metadata_;\n\n private:\n  friend class ::google::protobuf::Arena;\n  template <typename C, typename K, typename V,\n            WireFormatLite::FieldType k_wire_type, WireFormatLite::FieldType,\n            int default_enum>\n  friend class internal::MapField;\n  friend class internal::GeneratedMessageReflection;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntry);\n};\n\n// Specialization for the full runtime\ntemplate <typename Derived, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nstruct MapEntryHelper<MapEntry<Derived, Key, Value, kKeyFieldType,\n                               kValueFieldType, default_enum_value> >\n    : MapEntryHelper<MapEntryLite<Derived, Key, Value, kKeyFieldType,\n                                  kValueFieldType, default_enum_value> > {\n  explicit MapEntryHelper(const MapPair<Key, Value>& map_pair)\n      : MapEntryHelper<MapEntryLite<Derived, Key, Value, kKeyFieldType,\n                                    kValueFieldType, default_enum_value> >(\n            map_pair) {}\n};\n\ntemplate <typename Derived, typename K, typename V,\n          WireFormatLite::FieldType key, WireFormatLite::FieldType value,\n          int default_enum>\nstruct DeconstructMapEntry<MapEntry<Derived, K, V, key, value, default_enum> > {\n  typedef K Key;\n  typedef V Value;\n  static const WireFormatLite::FieldType kKeyFieldType = key;\n  static const WireFormatLite::FieldType kValueFieldType = value;\n  static const int default_enum_value = default_enum;\n};\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_MAP_ENTRY_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/map_entry_lite.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_MAP_ENTRY_LITE_H__\n#define GOOGLE_PROTOBUF_MAP_ENTRY_LITE_H__\n\n#include <assert.h>\n\n#include <google/protobuf/stubs/casts.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/map.h>\n#include <google/protobuf/map_type_handler.h>\n#include <google/protobuf/stubs/port.h>\n#include <google/protobuf/wire_format_lite_inl.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\ntemplate <typename Derived, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nclass MapEntry;\ntemplate <typename Derived, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nclass MapFieldLite;\n}  // namespace internal\n}  // namespace protobuf\n\nnamespace protobuf {\nnamespace internal {\n\n// MoveHelper::Move is used to set *dest.  It copies *src, or moves it (in\n// the C++11 sense), or swaps it. *src is left in a sane state for\n// subsequent destruction, but shouldn't be used for anything.\ntemplate <bool is_enum, bool is_message, bool is_stringlike, typename T>\nstruct MoveHelper {  // primitives\n  static void Move(T* src, T* dest) { *dest = *src; }\n};\n\ntemplate <bool is_message, bool is_stringlike, typename T>\nstruct MoveHelper<true, is_message, is_stringlike, T> {  // enums\n  static void Move(T* src, T* dest) { *dest = *src; }\n  // T is an enum here, so allow conversions to and from int.\n  static void Move(T* src, int* dest) { *dest = static_cast<int>(*src); }\n  static void Move(int* src, T* dest) { *dest = static_cast<T>(*src); }\n};\n\ntemplate <bool is_stringlike, typename T>\nstruct MoveHelper<false, true, is_stringlike, T> {  // messages\n  static void Move(T* src, T* dest) { dest->Swap(src); }\n};\n\ntemplate <typename T>\nstruct MoveHelper<false, false, true, T> {  // strings and similar\n  static void Move(T* src, T* dest) {\n#if __cplusplus >= 201103L\n    *dest = std::move(*src);\n#else\n    dest->swap(*src);\n#endif\n  }\n};\n\n// MapEntryImpl is used to implement parsing and serialization of map entries.\n// It uses Curious Recursive Template Pattern (CRTP) to provide the type of\n// the eventual code to the template code.\ntemplate <typename Derived, typename Base, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nclass MapEntryImpl : public Base {\n protected:\n  // Provide utilities to parse/serialize key/value.  Provide utilities to\n  // manipulate internal stored type.\n  typedef MapTypeHandler<kKeyFieldType, Key> KeyTypeHandler;\n  typedef MapTypeHandler<kValueFieldType, Value> ValueTypeHandler;\n\n  // Define internal memory layout. Strings and messages are stored as\n  // pointers, while other types are stored as values.\n  typedef typename KeyTypeHandler::TypeOnMemory KeyOnMemory;\n  typedef typename ValueTypeHandler::TypeOnMemory ValueOnMemory;\n\n  // Enum type cannot be used for MapTypeHandler::Read. Define a type\n  // which will replace Enum with int.\n  typedef typename KeyTypeHandler::MapEntryAccessorType KeyMapEntryAccessorType;\n  typedef typename ValueTypeHandler::MapEntryAccessorType\n      ValueMapEntryAccessorType;\n\n  // Constants for field number.\n  static const int kKeyFieldNumber = 1;\n  static const int kValueFieldNumber = 2;\n\n  // Constants for field tag.\n  static const uint8 kKeyTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(\n      kKeyFieldNumber, KeyTypeHandler::kWireType);\n  static const uint8 kValueTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(\n      kValueFieldNumber, ValueTypeHandler::kWireType);\n  static const size_t kTagSize = 1;\n\n public:\n  // Work-around for a compiler bug (see repeated_field.h).\n  typedef void MapEntryHasMergeTypeTrait;\n  typedef Derived EntryType;\n  typedef Key EntryKeyType;\n  typedef Value EntryValueType;\n  static const WireFormatLite::FieldType kEntryKeyFieldType = kKeyFieldType;\n  static const WireFormatLite::FieldType kEntryValueFieldType = kValueFieldType;\n  static const int kEntryDefaultEnumValue = default_enum_value;\n\n  MapEntryImpl() : arena_(NULL) {\n    KeyTypeHandler::Initialize(&key_, NULL);\n    ValueTypeHandler::InitializeMaybeByDefaultEnum(&value_, default_enum_value,\n                                                   NULL);\n    _has_bits_[0] = 0;\n  }\n\n  explicit MapEntryImpl(Arena* arena) : arena_(arena) {\n    KeyTypeHandler::Initialize(&key_, arena);\n    ValueTypeHandler::InitializeMaybeByDefaultEnum(&value_, default_enum_value,\n                                                   arena);\n    _has_bits_[0] = 0;\n  }\n\n  ~MapEntryImpl() {\n    if (GetArenaNoVirtual() != NULL) return;\n    KeyTypeHandler::DeleteNoArena(key_);\n    ValueTypeHandler::DeleteNoArena(value_);\n  }\n\n  // accessors ======================================================\n\n  virtual inline const KeyMapEntryAccessorType& key() const {\n    return KeyTypeHandler::GetExternalReference(key_);\n  }\n  virtual inline const ValueMapEntryAccessorType& value() const {\n    return ValueTypeHandler::DefaultIfNotInitialized(\n        value_, Derived::internal_default_instance()->value_);\n  }\n  inline KeyMapEntryAccessorType* mutable_key() {\n    set_has_key();\n    return KeyTypeHandler::EnsureMutable(&key_, GetArenaNoVirtual());\n  }\n  inline ValueMapEntryAccessorType* mutable_value() {\n    set_has_value();\n    return ValueTypeHandler::EnsureMutable(&value_, GetArenaNoVirtual());\n  }\n\n  // implements MessageLite =========================================\n\n  // MapEntryImpl is for implementation only and this function isn't called\n  // anywhere. Just provide a fake implementation here for MessageLite.\n  string GetTypeName() const { return \"\"; }\n\n  void CheckTypeAndMergeFrom(const MessageLite& other) {\n    MergeFromInternal(*::google::protobuf::down_cast<const Derived*>(&other));\n  }\n\n  bool MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream* input) {\n    uint32 tag;\n\n    for (;;) {\n      // 1) corrupted data: return false;\n      // 2) unknown field: skip without putting into unknown field set;\n      // 3) unknown enum value: keep it in parsing. In proto2, caller should\n      // check the value and put this entry into containing message's unknown\n      // field set if the value is an unknown enum. In proto3, caller doesn't\n      // need to care whether the value is unknown enum;\n      // 4) missing key/value: missed key/value will have default value. caller\n      // should take this entry as if key/value is set to default value.\n      tag = input->ReadTagNoLastTag();\n      switch (tag) {\n        case kKeyTag:\n          if (!KeyTypeHandler::Read(input, mutable_key())) {\n            return false;\n          }\n          set_has_key();\n          break;\n\n        case kValueTag:\n          if (!ValueTypeHandler::Read(input, mutable_value())) {\n            return false;\n          }\n          set_has_value();\n          if (input->ExpectAtEnd()) return true;\n          break;\n\n        default:\n          if (tag == 0 ||\n              WireFormatLite::GetTagWireType(tag) ==\n              WireFormatLite::WIRETYPE_END_GROUP) {\n            return true;\n          }\n          if (!WireFormatLite::SkipField(input, tag)) return false;\n          break;\n      }\n    }\n  }\n\n  size_t ByteSizeLong() const {\n    size_t size = 0;\n    size += has_key() ?\n        kTagSize + static_cast<size_t>(KeyTypeHandler::ByteSize(key())) : 0;\n    size += has_value() ?\n        kTagSize + static_cast<size_t>(ValueTypeHandler::ByteSize(value())) : 0;\n    return size;\n  }\n\n  void SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream* output) const {\n    KeyTypeHandler::Write(kKeyFieldNumber, key(), output);\n    ValueTypeHandler::Write(kValueFieldNumber, value(), output);\n  }\n\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(bool deterministic,\n                                                   ::google::protobuf::uint8* output) const {\n    output = KeyTypeHandler::InternalWriteToArray(kKeyFieldNumber, key(),\n                                                  deterministic, output);\n    output = ValueTypeHandler::InternalWriteToArray(kValueFieldNumber, value(),\n                                                    deterministic, output);\n    return output;\n  }\n\n  // Don't override SerializeWithCachedSizesToArray.  Use MessageLite's.\n\n  int GetCachedSize() const {\n    int size = 0;\n    size += has_key()\n        ? static_cast<int>(kTagSize) + KeyTypeHandler::GetCachedSize(key())\n        : 0;\n    size += has_value()\n        ? static_cast<int>(kTagSize) + ValueTypeHandler::GetCachedSize(value())\n        : 0;\n    return size;\n  }\n\n  bool IsInitialized() const { return ValueTypeHandler::IsInitialized(value_); }\n\n  Base* New() const {\n    Derived* entry = new Derived;\n    return entry;\n  }\n\n  Base* New(Arena* arena) const {\n    Derived* entry = Arena::CreateMessage<Derived>(arena);\n    return entry;\n  }\n\n  size_t SpaceUsedLong() const {\n    size_t size = sizeof(Derived);\n    size += KeyTypeHandler::SpaceUsedInMapEntryLong(key_);\n    size += ValueTypeHandler::SpaceUsedInMapEntryLong(value_);\n    return size;\n  }\n\n protected:\n  // We can't declare this function directly here as it would hide the other\n  // overload (const Message&).\n  void MergeFromInternal(const MapEntryImpl& from) {\n    if (from._has_bits_[0]) {\n      if (from.has_key()) {\n        KeyTypeHandler::EnsureMutable(&key_, GetArenaNoVirtual());\n        KeyTypeHandler::Merge(from.key(), &key_, GetArenaNoVirtual());\n        set_has_key();\n      }\n      if (from.has_value()) {\n        ValueTypeHandler::EnsureMutable(&value_, GetArenaNoVirtual());\n        ValueTypeHandler::Merge(from.value(), &value_, GetArenaNoVirtual());\n        set_has_value();\n      }\n    }\n  }\n\n public:\n  void Clear() {\n    KeyTypeHandler::Clear(&key_, GetArenaNoVirtual());\n    ValueTypeHandler::ClearMaybeByDefaultEnum(\n        &value_, GetArenaNoVirtual(), default_enum_value);\n    clear_has_key();\n    clear_has_value();\n  }\n\n  static void InitAsDefaultInstance() {\n    Derived* d = const_cast<Derived*>(Derived::internal_default_instance());\n    KeyTypeHandler::AssignDefaultValue(&d->key_);\n    ValueTypeHandler::AssignDefaultValue(&d->value_);\n  }\n\n  Arena* GetArena() const {\n    return GetArenaNoVirtual();\n  }\n\n  // Create a MapEntryImpl for given key and value from google::protobuf::Map in\n  // serialization. This function is only called when value is enum. Enum is\n  // treated differently because its type in MapEntry is int and its type in\n  // google::protobuf::Map is enum. We cannot create a reference to int from an enum.\n  static Derived* EnumWrap(const Key& key, const Value value, Arena* arena) {\n    return Arena::CreateMessage<MapEnumEntryWrapper>(arena, key, value);\n  }\n\n  // Like above, but for all the other types. This avoids value copy to create\n  // MapEntryImpl from google::protobuf::Map in serialization.\n  static Derived* Wrap(const Key& key, const Value& value, Arena* arena) {\n    return Arena::CreateMessage<MapEntryWrapper>(arena, key, value);\n  }\n\n  // Parsing using MergePartialFromCodedStream, above, is not as\n  // efficient as it could be.  This helper class provides a speedier way.\n  template <typename MapField, typename Map>\n  class Parser {\n   public:\n    explicit Parser(MapField* mf) : mf_(mf), map_(mf->MutableMap()) {}\n\n    // This does what the typical MergePartialFromCodedStream() is expected to\n    // do, with the additional side-effect that if successful (i.e., if true is\n    // going to be its return value) it inserts the key-value pair into map_.\n    bool MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream* input) {\n      // Look for the expected thing: a key and then a value.  If it fails,\n      // invoke the enclosing class's MergePartialFromCodedStream, or return\n      // false if that would be pointless.\n      if (input->ExpectTag(kKeyTag)) {\n        if (!KeyTypeHandler::Read(input, &key_)) {\n          return false;\n        }\n        // Peek at the next byte to see if it is kValueTag.  If not, bail out.\n        const void* data;\n        int size;\n        input->GetDirectBufferPointerInline(&data, &size);\n        // We could use memcmp here, but we don't bother. The tag is one byte.\n        GOOGLE_COMPILE_ASSERT(kTagSize == 1, tag_size_error);\n        if (size > 0 && *reinterpret_cast<const char*>(data) == kValueTag) {\n          typename Map::size_type map_size = map_->size();\n          value_ptr_ = &(*map_)[key_];\n          if (GOOGLE_PREDICT_TRUE(map_size != map_->size())) {\n            // We created a new key-value pair.  Fill in the value.\n            typedef\n                typename MapIf<ValueTypeHandler::kIsEnum, int*, Value*>::type T;\n            input->Skip(kTagSize);  // Skip kValueTag.\n            if (!ValueTypeHandler::Read(input,\n                                        reinterpret_cast<T>(value_ptr_))) {\n              map_->erase(key_);  // Failure! Undo insertion.\n              return false;\n            }\n            if (input->ExpectAtEnd()) return true;\n            return ReadBeyondKeyValuePair(input);\n          }\n        }\n      } else {\n        key_ = Key();\n      }\n\n      entry_.reset(mf_->NewEntry());\n      *entry_->mutable_key() = key_;\n      const bool result = entry_->MergePartialFromCodedStream(input);\n      if (result) UseKeyAndValueFromEntry();\n      if (entry_->GetArena() != NULL) entry_.release();\n      return result;\n    }\n\n    const Key& key() const { return key_; }\n    const Value& value() const { return *value_ptr_; }\n\n   private:\n    void UseKeyAndValueFromEntry() GOOGLE_PROTOBUF_ATTRIBUTE_COLD {\n      // Update key_ in case we need it later (because key() is called).\n      // This is potentially inefficient, especially if the key is\n      // expensive to copy (e.g., a long string), but this is a cold\n      // path, so it's not a big deal.\n      key_ = entry_->key();\n      value_ptr_ = &(*map_)[key_];\n      MoveHelper<ValueTypeHandler::kIsEnum,\n                 ValueTypeHandler::kIsMessage,\n                 ValueTypeHandler::kWireType ==\n                 WireFormatLite::WIRETYPE_LENGTH_DELIMITED,\n                 Value>::Move(entry_->mutable_value(), value_ptr_);\n    }\n\n    // After reading a key and value successfully, and inserting that data\n    // into map_, we are not at the end of the input.  This is unusual, but\n    // allowed by the spec.\n    bool ReadBeyondKeyValuePair(::google::protobuf::io::CodedInputStream* input)\n        GOOGLE_PROTOBUF_ATTRIBUTE_COLD {\n      typedef MoveHelper<KeyTypeHandler::kIsEnum,\n                         KeyTypeHandler::kIsMessage,\n                         KeyTypeHandler::kWireType ==\n                         WireFormatLite::WIRETYPE_LENGTH_DELIMITED,\n                         Key> KeyMover;\n      typedef MoveHelper<ValueTypeHandler::kIsEnum,\n                         ValueTypeHandler::kIsMessage,\n                         ValueTypeHandler::kWireType ==\n                         WireFormatLite::WIRETYPE_LENGTH_DELIMITED,\n                         Value> ValueMover;\n      entry_.reset(mf_->NewEntry());\n      ValueMover::Move(value_ptr_, entry_->mutable_value());\n      map_->erase(key_);\n      KeyMover::Move(&key_, entry_->mutable_key());\n      const bool result = entry_->MergePartialFromCodedStream(input);\n      if (result) UseKeyAndValueFromEntry();\n      if (entry_->GetArena() != NULL) entry_.release();\n      return result;\n    }\n\n    MapField* const mf_;\n    Map* const map_;\n    Key key_;\n    Value* value_ptr_;\n    // On the fast path entry_ is not used.  And, when entry_ is used, it's set\n    // to mf_->NewEntry(), so in the arena case we must call entry_.release.\n    std::unique_ptr<MapEntryImpl> entry_;\n  };\n\n protected:\n  void set_has_key() { _has_bits_[0] |= 0x00000001u; }\n  bool has_key() const { return (_has_bits_[0] & 0x00000001u) != 0; }\n  void clear_has_key() { _has_bits_[0] &= ~0x00000001u; }\n  void set_has_value() { _has_bits_[0] |= 0x00000002u; }\n  bool has_value() const { return (_has_bits_[0] & 0x00000002u) != 0; }\n  void clear_has_value() { _has_bits_[0] &= ~0x00000002u; }\n\n private:\n  // Serializing a generated message containing map field involves serializing\n  // key-value pairs from google::protobuf::Map. The wire format of each key-value pair\n  // after serialization should be the same as that of a MapEntry message\n  // containing the same key and value inside it.  However, google::protobuf::Map doesn't\n  // store key and value as MapEntry message, which disables us to use existing\n  // code to serialize message. In order to use existing code to serialize\n  // message, we need to construct a MapEntry from key-value pair. But it\n  // involves copy of key and value to construct a MapEntry. In order to avoid\n  // this copy in constructing a MapEntry, we need the following class which\n  // only takes references of given key and value.\n  class MapEntryWrapper : public Derived {\n    typedef Derived BaseClass;\n    typedef typename BaseClass::KeyMapEntryAccessorType KeyMapEntryAccessorType;\n    typedef\n        typename BaseClass::ValueMapEntryAccessorType ValueMapEntryAccessorType;\n\n   public:\n    MapEntryWrapper(Arena* arena, const Key& key, const Value& value)\n        : Derived(arena), key_(key), value_(value) {\n      BaseClass::set_has_key();\n      BaseClass::set_has_value();\n    }\n    inline const KeyMapEntryAccessorType& key() const { return key_; }\n    inline const ValueMapEntryAccessorType& value() const { return value_; }\n\n   private:\n    const Key& key_;\n    const Value& value_;\n\n    friend class ::google::protobuf::Arena;\n    typedef void InternalArenaConstructable_;\n    typedef void DestructorSkippable_;\n  };\n\n  // Like above, but for enum value only, which stores value instead of\n  // reference of value field inside. This is needed because the type of value\n  // field in constructor is an enum, while we need to store it as an int. If we\n  // initialize a reference to int with a reference to enum, compiler will\n  // generate a temporary int from enum and initialize the reference to int with\n  // the temporary.\n  class MapEnumEntryWrapper : public Derived {\n    typedef Derived BaseClass;\n    typedef typename BaseClass::KeyMapEntryAccessorType KeyMapEntryAccessorType;\n    typedef\n        typename BaseClass::ValueMapEntryAccessorType ValueMapEntryAccessorType;\n\n   public:\n    MapEnumEntryWrapper(Arena* arena, const Key& key, const Value& value)\n        : Derived(arena), key_(key), value_(value) {\n      BaseClass::set_has_key();\n      BaseClass::set_has_value();\n    }\n    inline const KeyMapEntryAccessorType& key() const { return key_; }\n    inline const ValueMapEntryAccessorType& value() const { return value_; }\n\n   private:\n    const KeyMapEntryAccessorType& key_;\n    const ValueMapEntryAccessorType value_;\n\n    friend class google::protobuf::Arena;\n    typedef void DestructorSkippable_;\n  };\n\n  inline Arena* GetArenaNoVirtual() const {\n    return arena_;\n  }\n\n public:  // Needed for constructing tables\n  KeyOnMemory key_;\n  ValueOnMemory value_;\n  Arena* arena_;\n  uint32 _has_bits_[1];\n\n private:\n  friend class ::google::protobuf::Arena;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  template <typename C, typename K, typename V, WireFormatLite::FieldType,\n            WireFormatLite::FieldType, int>\n  friend class internal::MapEntry;\n  template <typename C, typename K, typename V, WireFormatLite::FieldType,\n            WireFormatLite::FieldType, int>\n  friend class internal::MapFieldLite;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntryImpl);\n};\n\ntemplate <typename T, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nclass MapEntryLite\n    : public MapEntryImpl<T, MessageLite, Key, Value, kKeyFieldType,\n                          kValueFieldType, default_enum_value> {\n public:\n  typedef MapEntryImpl<T, MessageLite, Key, Value, kKeyFieldType,\n                       kValueFieldType, default_enum_value>\n      SuperType;\n  MapEntryLite() {}\n  explicit MapEntryLite(Arena* arena) : SuperType(arena) {}\n  void MergeFrom(const MapEntryLite& other) { MergeFromInternal(other); }\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntryLite);\n};\n// The completely unprincipled and unwieldy use of template parameters in\n// the map code necessitates wrappers to make the code a little bit more\n// manageable.\ntemplate <typename Derived>\nstruct DeconstructMapEntry;\n\ntemplate <typename T, typename K, typename V, WireFormatLite::FieldType key,\n          WireFormatLite::FieldType value, int default_enum>\nstruct DeconstructMapEntry<MapEntryLite<T, K, V, key, value, default_enum> > {\n  typedef K Key;\n  typedef V Value;\n  static const WireFormatLite::FieldType kKeyFieldType = key;\n  static const WireFormatLite::FieldType kValueFieldType = value;\n  static const int default_enum_value = default_enum;\n};\n\n// Helpers for deterministic serialization =============================\n\n// This struct can be used with any generic sorting algorithm.  If the Key\n// type is relatively small and easy to copy then copying Keys into an\n// array of SortItems can be beneficial.  Then all the data the sorting\n// algorithm needs to touch is in that one array.\ntemplate <typename Key, typename PtrToKeyValuePair> struct SortItem {\n  SortItem() {}\n  explicit SortItem(PtrToKeyValuePair p) : first(p->first), second(p) {}\n\n  Key first;\n  PtrToKeyValuePair second;\n};\n\ntemplate <typename T> struct CompareByFirstField {\n  bool operator()(const T& a, const T& b) const {\n    return a.first < b.first;\n  }\n};\n\ntemplate <typename T> struct CompareByDerefFirst {\n  bool operator()(const T& a, const T& b) const {\n    return a->first < b->first;\n  }\n};\n\n// Helper for table driven serialization\n\ntemplate <WireFormatLite::FieldType FieldType>\nstruct FromHelper {\n  template <typename T>\n  static const T& From(const T& x) {\n    return x;\n  }\n};\n\ntemplate <>\nstruct FromHelper<WireFormatLite::TYPE_STRING> {\n  static ArenaStringPtr From(const string& x) {\n    ArenaStringPtr res;\n    TaggedPtr<::std::string> ptr;\n    ptr.Set(const_cast<string*>(&x));\n    res.UnsafeSetTaggedPointer(ptr);\n    return res;\n  }\n};\ntemplate <>\nstruct FromHelper<WireFormatLite::TYPE_BYTES> {\n  static ArenaStringPtr From(const string& x) {\n    ArenaStringPtr res;\n    TaggedPtr<::std::string> ptr;\n    ptr.Set(const_cast<string*>(&x));\n    res.UnsafeSetTaggedPointer(ptr);\n    return res;\n  }\n};\ntemplate <>\nstruct FromHelper<WireFormatLite::TYPE_MESSAGE> {\n  template <typename T>\n  static T* From(const T& x) {\n    return const_cast<T*>(&x);\n  }\n};\n\ntemplate <typename MapEntryType>\nstruct MapEntryHelper;\n\ntemplate <typename T, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nstruct MapEntryHelper<MapEntryLite<T, Key, Value, kKeyFieldType,\n                                   kValueFieldType, default_enum_value> > {\n  // Provide utilities to parse/serialize key/value.  Provide utilities to\n  // manipulate internal stored type.\n  typedef MapTypeHandler<kKeyFieldType, Key> KeyTypeHandler;\n  typedef MapTypeHandler<kValueFieldType, Value> ValueTypeHandler;\n\n  // Define internal memory layout. Strings and messages are stored as\n  // pointers, while other types are stored as values.\n  typedef typename KeyTypeHandler::TypeOnMemory KeyOnMemory;\n  typedef typename ValueTypeHandler::TypeOnMemory ValueOnMemory;\n\n  explicit MapEntryHelper(const MapPair<Key, Value>& map_pair)\n      : _has_bits_(3),\n        _cached_size_(2 + KeyTypeHandler::GetCachedSize(map_pair.first) +\n                      ValueTypeHandler::GetCachedSize(map_pair.second)),\n        key_(FromHelper<kKeyFieldType>::From(map_pair.first)),\n        value_(FromHelper<kValueFieldType>::From(map_pair.second)) {}\n\n  // Purposely not folowing the style guide naming. These are the names\n  // the proto compiler would generate given the map entry descriptor.\n  // The proto compiler generates the offsets in this struct as if this was\n  // a regular message. This way the table driven code barely notices it's\n  // dealing with a map field.\n  uint32 _has_bits_;     // NOLINT\n  uint32 _cached_size_;  // NOLINT\n  KeyOnMemory key_;      // NOLINT\n  ValueOnMemory value_;  // NOLINT\n};\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_MAP_ENTRY_LITE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/map_field.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_MAP_FIELD_H__\n#define GOOGLE_PROTOBUF_MAP_FIELD_H__\n\n#include <atomic>\n\n#include <google/protobuf/stubs/mutex.h>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/generated_message_reflection.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/descriptor.h>\n#include <google/protobuf/map_entry.h>\n#include <google/protobuf/map_field_lite.h>\n#include <google/protobuf/map_type_handler.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>\n#include <google/protobuf/unknown_field_set.h>\n\n\nnamespace google {\nnamespace protobuf {\nclass DynamicMessage;\nclass MapKey;\nnamespace internal {\n\nclass ContendedMapCleanTest;\nclass GeneratedMessageReflection;\nclass MapFieldAccessor;\n\n// This class provides access to map field using reflection, which is the same\n// as those provided for RepeatedPtrField<Message>. It is used for internal\n// reflection implentation only. Users should never use this directly.\nclass LIBPROTOBUF_EXPORT MapFieldBase {\n public:\n  MapFieldBase()\n      : arena_(NULL),\n        repeated_field_(NULL),\n        state_(STATE_MODIFIED_MAP) {}\n  explicit MapFieldBase(Arena* arena)\n      : arena_(arena),\n        repeated_field_(NULL),\n        state_(STATE_MODIFIED_MAP) {\n    // Mutex's destructor needs to be called explicitly to release resources\n    // acquired in its constructor.\n    arena->OwnDestructor(&mutex_);\n  }\n  virtual ~MapFieldBase();\n\n  // Returns reference to internal repeated field. Data written using\n  // google::protobuf::Map's api prior to calling this function is guarantted to be\n  // included in repeated field.\n  const RepeatedPtrFieldBase& GetRepeatedField() const;\n\n  // Like above. Returns mutable pointer to the internal repeated field.\n  RepeatedPtrFieldBase* MutableRepeatedField();\n\n  // Pure virtual map APIs for Map Reflection.\n  virtual bool ContainsMapKey(const MapKey& map_key) const = 0;\n  virtual bool InsertOrLookupMapValue(\n      const MapKey& map_key, MapValueRef* val) = 0;\n  // Returns whether changes to the map are reflected in the repeated field.\n  bool IsRepeatedFieldValid() const;\n  // Insures operations after won't get executed before calling this.\n  bool IsMapValid() const;\n  virtual bool DeleteMapValue(const MapKey& map_key) = 0;\n  virtual bool EqualIterator(const MapIterator& a,\n                             const MapIterator& b) const = 0;\n  virtual void MapBegin(MapIterator* map_iter) const = 0;\n  virtual void MapEnd(MapIterator* map_iter) const = 0;\n  // Sync Map with repeated field and returns the size of map.\n  virtual int size() const = 0;\n\n  // Returns the number of bytes used by the repeated field, excluding\n  // sizeof(*this)\n  size_t SpaceUsedExcludingSelfLong() const;\n\n  int SpaceUsedExcludingSelf() const {\n    return internal::ToIntSize(SpaceUsedExcludingSelfLong());\n  }\n\n protected:\n  // Gets the size of space used by map field.\n  virtual size_t SpaceUsedExcludingSelfNoLock() const;\n\n  // Synchronizes the content in Map to RepeatedPtrField if there is any change\n  // to Map after last synchronization.\n  void SyncRepeatedFieldWithMap() const;\n  virtual void SyncRepeatedFieldWithMapNoLock() const;\n\n  // Synchronizes the content in RepeatedPtrField to Map if there is any change\n  // to RepeatedPtrField after last synchronization.\n  void SyncMapWithRepeatedField() const;\n  virtual void SyncMapWithRepeatedFieldNoLock() const {}\n\n  // Tells MapFieldBase that there is new change to Map.\n  void SetMapDirty();\n\n  // Tells MapFieldBase that there is new change to RepeatedPTrField.\n  void SetRepeatedDirty();\n\n  // Provides derived class the access to repeated field.\n  void* MutableRepeatedPtrField() const;\n\n  enum State {\n    STATE_MODIFIED_MAP = 0,       // map has newly added data that has not been\n                                  // synchronized to repeated field\n    STATE_MODIFIED_REPEATED = 1,  // repeated field has newly added data that\n                                  // has not been synchronized to map\n    CLEAN = 2,  // data in map and repeated field are same\n  };\n\n  Arena* arena_;\n  mutable RepeatedPtrField<Message>* repeated_field_;\n\n  mutable Mutex mutex_;  // The thread to synchronize map and repeated field\n                         // needs to get lock first;\n  mutable std::atomic<State> state_;\n\n private:\n  friend class ContendedMapCleanTest;\n  friend class GeneratedMessageReflection;\n  friend class MapFieldAccessor;\n  friend class ::google::protobuf::DynamicMessage;\n\n  // Virtual helper methods for MapIterator. MapIterator doesn't have the\n  // type helper for key and value. Call these help methods to deal with\n  // different types. Real helper methods are implemented in\n  // TypeDefinedMapFieldBase.\n  friend class ::google::protobuf::MapIterator;\n  // Allocate map<...>::iterator for MapIterator.\n  virtual void InitializeIterator(MapIterator* map_iter) const = 0;\n\n  // DeleteIterator() is called by the destructor of MapIterator only.\n  // It deletes map<...>::iterator for MapIterator.\n  virtual void DeleteIterator(MapIterator* map_iter) const = 0;\n\n  // Copy the map<...>::iterator from other_iterator to\n  // this_iterator.\n  virtual void CopyIterator(MapIterator* this_iterator,\n                            const MapIterator& other_iterator) const = 0;\n\n  // IncreaseIterator() is called by operator++() of MapIterator only.\n  // It implements the ++ operator of MapIterator.\n  virtual void IncreaseIterator(MapIterator* map_iter) const = 0;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapFieldBase);\n};\n\n// This class provides common Map Reflection implementations for generated\n// message and dynamic message.\ntemplate<typename Key, typename T>\nclass TypeDefinedMapFieldBase : public MapFieldBase {\n public:\n  TypeDefinedMapFieldBase() {}\n  explicit TypeDefinedMapFieldBase(Arena* arena) : MapFieldBase(arena) {}\n  ~TypeDefinedMapFieldBase() {}\n  void MapBegin(MapIterator* map_iter) const;\n  void MapEnd(MapIterator* map_iter) const;\n  bool EqualIterator(const MapIterator& a, const MapIterator& b) const;\n\n  virtual const Map<Key, T>& GetMap() const = 0;\n  virtual Map<Key, T>* MutableMap() = 0;\n\n protected:\n  typename Map<Key, T>::const_iterator& InternalGetIterator(\n      const MapIterator* map_iter) const;\n\n private:\n  void InitializeIterator(MapIterator* map_iter) const;\n  void DeleteIterator(MapIterator* map_iter) const;\n  void CopyIterator(MapIterator* this_iteratorm,\n                    const MapIterator& that_iterator) const;\n  void IncreaseIterator(MapIterator* map_iter) const;\n\n  virtual void SetMapIteratorValue(MapIterator* map_iter) const = 0;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeDefinedMapFieldBase);\n};\n\n// This class provides access to map field using generated api. It is used for\n// internal generated message implentation only. Users should never use this\n// directly.\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value = 0>\nclass MapField : public TypeDefinedMapFieldBase<Key, T> {\n  // Provide utilities to parse/serialize key/value.  Provide utilities to\n  // manipulate internal stored type.\n  typedef MapTypeHandler<kKeyFieldType, Key> KeyTypeHandler;\n  typedef MapTypeHandler<kValueFieldType, T> ValueTypeHandler;\n\n  // Define message type for internal repeated field.\n  typedef Derived EntryType;\n  typedef MapEntryLite<Derived, Key, T, kKeyFieldType, kValueFieldType,\n                       default_enum_value>\n      EntryLiteType;\n\n  // Define abbreviation for parent MapFieldLite\n  typedef MapFieldLite<Derived, Key, T, kKeyFieldType, kValueFieldType,\n                       default_enum_value>\n      MapFieldLiteType;\n\n  // Enum needs to be handled differently from other types because it has\n  // different exposed type in google::protobuf::Map's api and repeated field's api. For\n  // details see the comment in the implementation of\n  // SyncMapWithRepeatedFieldNoLock.\n  static const bool kIsValueEnum = ValueTypeHandler::kIsEnum;\n  typedef typename MapIf<kIsValueEnum, T, const T&>::type CastValueType;\n\n public:\n  typedef typename Derived::SuperType EntryTypeTrait;\n  typedef Map<Key, T> MapType;\n\n  MapField() {}\n  explicit MapField(Arena* arena)\n      : TypeDefinedMapFieldBase<Key, T>(arena), impl_(arena) {}\n\n  // Implement MapFieldBase\n  bool ContainsMapKey(const MapKey& map_key) const;\n  bool InsertOrLookupMapValue(const MapKey& map_key, MapValueRef* val);\n  bool DeleteMapValue(const MapKey& map_key);\n\n  const Map<Key, T>& GetMap() const {\n    MapFieldBase::SyncMapWithRepeatedField();\n    return impl_.GetMap();\n  }\n\n  Map<Key, T>* MutableMap() {\n    MapFieldBase::SyncMapWithRepeatedField();\n    Map<Key, T>* result = impl_.MutableMap();\n    MapFieldBase::SetMapDirty();\n    return result;\n  }\n\n  // Convenient methods for generated message implementation.\n  int size() const;\n  void Clear();\n  void MergeFrom(const MapField& other);\n  void Swap(MapField* other);\n\n  // Used in the implementation of parsing. Caller should take the ownership iff\n  // arena_ is NULL.\n  EntryType* NewEntry() const { return impl_.NewEntry(); }\n  // Used in the implementation of serializing enum value type. Caller should\n  // take the ownership iff arena_ is NULL.\n  EntryType* NewEnumEntryWrapper(const Key& key, const T t) const {\n    return impl_.NewEnumEntryWrapper(key, t);\n  }\n  // Used in the implementation of serializing other value types. Caller should\n  // take the ownership iff arena_ is NULL.\n  EntryType* NewEntryWrapper(const Key& key, const T& t) const {\n    return impl_.NewEntryWrapper(key, t);\n  }\n\n private:\n  MapFieldLiteType impl_;\n\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n\n  // Implements MapFieldBase\n  void SyncRepeatedFieldWithMapNoLock() const;\n  void SyncMapWithRepeatedFieldNoLock() const;\n  size_t SpaceUsedExcludingSelfNoLock() const;\n\n  void SetMapIteratorValue(MapIterator* map_iter) const;\n\n  friend class ::google::protobuf::Arena;\n  friend class MapFieldStateTest;  // For testing, it needs raw access to impl_\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapField);\n};\n\ntemplate <typename T, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nstruct MapEntryToMapField<MapEntry<T, Key, Value, kKeyFieldType,\n                                   kValueFieldType, default_enum_value> > {\n  typedef MapField<T, Key, Value, kKeyFieldType, kValueFieldType,\n                   default_enum_value>\n      MapFieldType;\n};\n\nclass LIBPROTOBUF_EXPORT DynamicMapField: public TypeDefinedMapFieldBase<MapKey, MapValueRef> {\n public:\n  explicit DynamicMapField(const Message* default_entry);\n  DynamicMapField(const Message* default_entry, Arena* arena);\n  ~DynamicMapField();\n\n  // Implement MapFieldBase\n  bool ContainsMapKey(const MapKey& map_key) const;\n  bool InsertOrLookupMapValue(const MapKey& map_key, MapValueRef* val);\n  bool DeleteMapValue(const MapKey& map_key);\n\n  const Map<MapKey, MapValueRef>& GetMap() const;\n  Map<MapKey, MapValueRef>* MutableMap();\n\n  int size() const;\n\n private:\n  Map<MapKey, MapValueRef> map_;\n  const Message* default_entry_;\n\n  // Implements MapFieldBase\n  void SyncRepeatedFieldWithMapNoLock() const;\n  void SyncMapWithRepeatedFieldNoLock() const;\n  size_t SpaceUsedExcludingSelfNoLock() const;\n  void SetMapIteratorValue(MapIterator* map_iter) const;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DynamicMapField);\n};\n\n}  // namespace internal\n\n#define TYPE_CHECK(EXPECTEDTYPE, METHOD)                        \\\n  if (type() != EXPECTEDTYPE) {                                 \\\n    GOOGLE_LOG(FATAL)                                                  \\\n        << \"Protocol Buffer map usage error:\\n\"                 \\\n        << METHOD << \" type does not match\\n\"                   \\\n        << \"  Expected : \"                                      \\\n        << FieldDescriptor::CppTypeName(EXPECTEDTYPE) << \"\\n\"   \\\n        << \"  Actual   : \"                                      \\\n        << FieldDescriptor::CppTypeName(type());                \\\n  }\n\n// MapKey is an union type for representing any possible\n// map key.\nclass LIBPROTOBUF_EXPORT MapKey {\n public:\n  MapKey() : type_(0) {\n  }\n  MapKey(const MapKey& other) : type_(0) {\n    CopyFrom(other);\n  }\n  MapKey& operator=(const MapKey& other) {\n    CopyFrom(other);\n    return *this;\n  }\n\n  ~MapKey() {\n    if (type_ == FieldDescriptor::CPPTYPE_STRING) {\n      delete val_.string_value_;\n    }\n  }\n\n  FieldDescriptor::CppType type() const {\n    if (type_ == 0) {\n      GOOGLE_LOG(FATAL)\n          << \"Protocol Buffer map usage error:\\n\"\n          << \"MapKey::type MapKey is not initialized. \"\n          << \"Call set methods to initialize MapKey.\";\n    }\n    return (FieldDescriptor::CppType)type_;\n  }\n\n  void SetInt64Value(int64 value) {\n    SetType(FieldDescriptor::CPPTYPE_INT64);\n    val_.int64_value_ = value;\n  }\n  void SetUInt64Value(uint64 value) {\n    SetType(FieldDescriptor::CPPTYPE_UINT64);\n    val_.uint64_value_ = value;\n  }\n  void SetInt32Value(int32 value) {\n    SetType(FieldDescriptor::CPPTYPE_INT32);\n    val_.int32_value_ = value;\n  }\n  void SetUInt32Value(uint32 value) {\n    SetType(FieldDescriptor::CPPTYPE_UINT32);\n    val_.uint32_value_ = value;\n  }\n  void SetBoolValue(bool value) {\n    SetType(FieldDescriptor::CPPTYPE_BOOL);\n    val_.bool_value_ = value;\n  }\n  void SetStringValue(const string& val) {\n    SetType(FieldDescriptor::CPPTYPE_STRING);\n    *val_.string_value_ = val;\n  }\n\n  int64 GetInt64Value() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT64,\n               \"MapKey::GetInt64Value\");\n    return val_.int64_value_;\n  }\n  uint64 GetUInt64Value() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT64,\n               \"MapKey::GetUInt64Value\");\n    return val_.uint64_value_;\n  }\n  int32 GetInt32Value() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT32,\n               \"MapKey::GetInt32Value\");\n    return val_.int32_value_;\n  }\n  uint32 GetUInt32Value() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT32,\n               \"MapKey::GetUInt32Value\");\n    return val_.uint32_value_;\n  }\n  bool GetBoolValue() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL,\n               \"MapKey::GetBoolValue\");\n    return val_.bool_value_;\n  }\n  const string& GetStringValue() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_STRING,\n               \"MapKey::GetStringValue\");\n    return *val_.string_value_;\n  }\n\n  bool operator<(const MapKey& other) const {\n    if (type_ != other.type_) {\n      // We could define a total order that handles this case, but\n      // there currently no need.  So, for now, fail.\n      GOOGLE_LOG(FATAL) << \"Unsupported: type mismatch\";\n    }\n    switch (type()) {\n      case FieldDescriptor::CPPTYPE_DOUBLE:\n      case FieldDescriptor::CPPTYPE_FLOAT:\n      case FieldDescriptor::CPPTYPE_ENUM:\n      case FieldDescriptor::CPPTYPE_MESSAGE:\n        GOOGLE_LOG(FATAL) << \"Unsupported\";\n        return false;\n      case FieldDescriptor::CPPTYPE_STRING:\n        return *val_.string_value_ < *other.val_.string_value_;\n      case FieldDescriptor::CPPTYPE_INT64:\n        return val_.int64_value_ < other.val_.int64_value_;\n      case FieldDescriptor::CPPTYPE_INT32:\n        return val_.int32_value_ < other.val_.int32_value_;\n      case FieldDescriptor::CPPTYPE_UINT64:\n        return val_.uint64_value_ < other.val_.uint64_value_;\n      case FieldDescriptor::CPPTYPE_UINT32:\n        return val_.uint32_value_ < other.val_.uint32_value_;\n      case FieldDescriptor::CPPTYPE_BOOL:\n        return val_.bool_value_ < other.val_.bool_value_;\n    }\n    return false;\n  }\n\n  bool operator==(const MapKey& other) const {\n    if (type_ != other.type_) {\n      // To be consistent with operator<, we don't allow this either.\n      GOOGLE_LOG(FATAL) << \"Unsupported: type mismatch\";\n    }\n    switch (type()) {\n      case FieldDescriptor::CPPTYPE_DOUBLE:\n      case FieldDescriptor::CPPTYPE_FLOAT:\n      case FieldDescriptor::CPPTYPE_ENUM:\n      case FieldDescriptor::CPPTYPE_MESSAGE:\n        GOOGLE_LOG(FATAL) << \"Unsupported\";\n        break;\n      case FieldDescriptor::CPPTYPE_STRING:\n        return *val_.string_value_ == *other.val_.string_value_;\n      case FieldDescriptor::CPPTYPE_INT64:\n        return val_.int64_value_ == other.val_.int64_value_;\n      case FieldDescriptor::CPPTYPE_INT32:\n        return val_.int32_value_ == other.val_.int32_value_;\n      case FieldDescriptor::CPPTYPE_UINT64:\n        return val_.uint64_value_ == other.val_.uint64_value_;\n      case FieldDescriptor::CPPTYPE_UINT32:\n        return val_.uint32_value_ == other.val_.uint32_value_;\n      case FieldDescriptor::CPPTYPE_BOOL:\n        return val_.bool_value_ == other.val_.bool_value_;\n    }\n    GOOGLE_LOG(FATAL) << \"Can't get here.\";\n    return false;\n  }\n\n  void CopyFrom(const MapKey& other) {\n    SetType(other.type());\n    switch (type_) {\n      case FieldDescriptor::CPPTYPE_DOUBLE:\n      case FieldDescriptor::CPPTYPE_FLOAT:\n      case FieldDescriptor::CPPTYPE_ENUM:\n      case FieldDescriptor::CPPTYPE_MESSAGE:\n        GOOGLE_LOG(FATAL) << \"Unsupported\";\n        break;\n      case FieldDescriptor::CPPTYPE_STRING:\n        *val_.string_value_ = *other.val_.string_value_;\n        break;\n      case FieldDescriptor::CPPTYPE_INT64:\n        val_.int64_value_ = other.val_.int64_value_;\n        break;\n      case FieldDescriptor::CPPTYPE_INT32:\n        val_.int32_value_ = other.val_.int32_value_;\n        break;\n      case FieldDescriptor::CPPTYPE_UINT64:\n        val_.uint64_value_ = other.val_.uint64_value_;\n        break;\n      case FieldDescriptor::CPPTYPE_UINT32:\n        val_.uint32_value_ = other.val_.uint32_value_;\n        break;\n      case FieldDescriptor::CPPTYPE_BOOL:\n        val_.bool_value_ = other.val_.bool_value_;\n        break;\n    }\n  }\n\n private:\n  template <typename K, typename V>\n  friend class internal::TypeDefinedMapFieldBase;\n  friend class MapIterator;\n  friend class internal::DynamicMapField;\n\n  union KeyValue {\n    KeyValue() {}\n    string* string_value_;\n    int64 int64_value_;\n    int32 int32_value_;\n    uint64 uint64_value_;\n    uint32 uint32_value_;\n    bool bool_value_;\n  } val_;\n\n  void SetType(FieldDescriptor::CppType type) {\n    if (type_ == type) return;\n    if (type_ == FieldDescriptor::CPPTYPE_STRING) {\n      delete val_.string_value_;\n    }\n    type_ = type;\n    if (type_ == FieldDescriptor::CPPTYPE_STRING) {\n      val_.string_value_ = new string;\n    }\n  }\n\n  // type_ is 0 or a valid FieldDescriptor::CppType.\n  int type_;\n};\n\n// MapValueRef points to a map value.\nclass LIBPROTOBUF_EXPORT MapValueRef {\n public:\n  MapValueRef() : data_(NULL), type_(0) {}\n\n  void SetInt64Value(int64 value) {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT64,\n               \"MapValueRef::SetInt64Value\");\n    *reinterpret_cast<int64*>(data_) = value;\n  }\n  void SetUInt64Value(uint64 value) {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT64,\n               \"MapValueRef::SetUInt64Value\");\n    *reinterpret_cast<uint64*>(data_) = value;\n  }\n  void SetInt32Value(int32 value) {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT32,\n               \"MapValueRef::SetInt32Value\");\n    *reinterpret_cast<int32*>(data_) = value;\n  }\n  void SetUInt32Value(uint32 value) {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT32,\n               \"MapValueRef::SetUInt32Value\");\n    *reinterpret_cast<uint32*>(data_) = value;\n  }\n  void SetBoolValue(bool value) {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL,\n               \"MapValueRef::SetBoolValue\");\n    *reinterpret_cast<bool*>(data_) = value;\n  }\n  // TODO(jieluo) - Checks that enum is member.\n  void SetEnumValue(int value) {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_ENUM,\n               \"MapValueRef::SetEnumValue\");\n    *reinterpret_cast<int*>(data_) = value;\n  }\n  void SetStringValue(const string& value) {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_STRING,\n               \"MapValueRef::SetStringValue\");\n    *reinterpret_cast<string*>(data_) = value;\n  }\n  void SetFloatValue(float value) {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_FLOAT,\n               \"MapValueRef::SetFloatValue\");\n    *reinterpret_cast<float*>(data_) = value;\n  }\n  void SetDoubleValue(double value) {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_DOUBLE,\n               \"MapValueRef::SetDoubleValue\");\n    *reinterpret_cast<double*>(data_) = value;\n  }\n\n  int64 GetInt64Value() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT64,\n               \"MapValueRef::GetInt64Value\");\n    return *reinterpret_cast<int64*>(data_);\n  }\n  uint64 GetUInt64Value() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT64,\n               \"MapValueRef::GetUInt64Value\");\n    return *reinterpret_cast<uint64*>(data_);\n  }\n  int32 GetInt32Value() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_INT32,\n               \"MapValueRef::GetInt32Value\");\n    return *reinterpret_cast<int32*>(data_);\n  }\n  uint32 GetUInt32Value() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_UINT32,\n               \"MapValueRef::GetUInt32Value\");\n    return *reinterpret_cast<uint32*>(data_);\n  }\n  bool GetBoolValue() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_BOOL,\n               \"MapValueRef::GetBoolValue\");\n    return *reinterpret_cast<bool*>(data_);\n  }\n  int GetEnumValue() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_ENUM,\n               \"MapValueRef::GetEnumValue\");\n    return *reinterpret_cast<int*>(data_);\n  }\n  const string& GetStringValue() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_STRING,\n               \"MapValueRef::GetStringValue\");\n    return *reinterpret_cast<string*>(data_);\n  }\n  float GetFloatValue() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_FLOAT,\n               \"MapValueRef::GetFloatValue\");\n    return *reinterpret_cast<float*>(data_);\n  }\n  double GetDoubleValue() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_DOUBLE,\n               \"MapValueRef::GetDoubleValue\");\n    return *reinterpret_cast<double*>(data_);\n  }\n\n  const Message& GetMessageValue() const {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_MESSAGE,\n               \"MapValueRef::GetMessageValue\");\n    return *reinterpret_cast<Message*>(data_);\n  }\n\n  Message* MutableMessageValue() {\n    TYPE_CHECK(FieldDescriptor::CPPTYPE_MESSAGE,\n               \"MapValueRef::MutableMessageValue\");\n    return reinterpret_cast<Message*>(data_);\n  }\n\n private:\n  template <typename Derived, typename K, typename V,\n            internal::WireFormatLite::FieldType key_wire_type,\n            internal::WireFormatLite::FieldType value_wire_type,\n            int default_enum_value>\n  friend class internal::MapField;\n  template <typename K, typename V>\n  friend class internal::TypeDefinedMapFieldBase;\n  friend class MapIterator;\n  friend class internal::GeneratedMessageReflection;\n  friend class internal::DynamicMapField;\n\n  void SetType(FieldDescriptor::CppType type) {\n    type_ = type;\n  }\n\n  FieldDescriptor::CppType type() const {\n    if (type_ == 0 || data_ == NULL) {\n      GOOGLE_LOG(FATAL)\n          << \"Protocol Buffer map usage error:\\n\"\n          << \"MapValueRef::type MapValueRef is not initialized.\";\n    }\n    return (FieldDescriptor::CppType)type_;\n  }\n  void SetValue(const void* val) {\n    data_ = const_cast<void*>(val);\n  }\n  void CopyFrom(const MapValueRef& other) {\n    type_ = other.type_;\n    data_ = other.data_;\n  }\n  // Only used in DynamicMapField\n  void DeleteData() {\n    switch (type_) {\n#define HANDLE_TYPE(CPPTYPE, TYPE)                              \\\n      case google::protobuf::FieldDescriptor::CPPTYPE_##CPPTYPE: {        \\\n        delete reinterpret_cast<TYPE*>(data_);                  \\\n        break;                                                  \\\n      }\n      HANDLE_TYPE(INT32, int32);\n      HANDLE_TYPE(INT64, int64);\n      HANDLE_TYPE(UINT32, uint32);\n      HANDLE_TYPE(UINT64, uint64);\n      HANDLE_TYPE(DOUBLE, double);\n      HANDLE_TYPE(FLOAT, float);\n      HANDLE_TYPE(BOOL, bool);\n      HANDLE_TYPE(STRING, string);\n      HANDLE_TYPE(ENUM, int32);\n      HANDLE_TYPE(MESSAGE, Message);\n#undef HANDLE_TYPE\n    }\n  }\n  // data_ point to a map value. MapValueRef does not\n  // own this value.\n  void* data_;\n  // type_ is 0 or a valid FieldDescriptor::CppType.\n  int type_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapValueRef);\n};\n\n#undef TYPE_CHECK\n\nclass LIBPROTOBUF_EXPORT MapIterator {\n public:\n  MapIterator(Message* message, const FieldDescriptor* field) {\n    const Reflection* reflection = message->GetReflection();\n    map_ = reflection->MapData(message, field);\n    key_.SetType(field->message_type()->FindFieldByName(\"key\")->cpp_type());\n    value_.SetType(field->message_type()->FindFieldByName(\"value\")->cpp_type());\n    map_->InitializeIterator(this);\n  }\n  MapIterator(const MapIterator& other) {\n    map_ = other.map_;\n    map_->InitializeIterator(this);\n    map_->CopyIterator(this, other);\n  }\n  ~MapIterator() {\n    map_->DeleteIterator(this);\n  }\n  MapIterator& operator=(const MapIterator& other) {\n    map_ = other.map_;\n    map_->CopyIterator(this, other);\n    return *this;\n  }\n  friend bool operator==(const MapIterator& a, const MapIterator& b) {\n    return a.map_->EqualIterator(a, b);\n  }\n  friend bool operator!=(const MapIterator& a, const MapIterator& b) {\n    return !a.map_->EqualIterator(a, b);\n  }\n  MapIterator& operator++() {\n    map_->IncreaseIterator(this);\n    return *this;\n  }\n  MapIterator operator++(int) {\n    // iter_ is copied from Map<...>::iterator, no need to\n    // copy from its self again. Use the same implementation\n    // with operator++()\n    map_->IncreaseIterator(this);\n    return *this;\n  }\n  const MapKey& GetKey() {\n    return key_;\n  }\n  const MapValueRef& GetValueRef() {\n    return value_;\n  }\n  MapValueRef* MutableValueRef() {\n    map_->SetMapDirty();\n    return &value_;\n  }\n\n private:\n  template <typename Key, typename T>\n  friend class internal::TypeDefinedMapFieldBase;\n  friend class internal::DynamicMapField;\n  template <typename Derived, typename Key, typename T,\n            internal::WireFormatLite::FieldType kKeyFieldType,\n            internal::WireFormatLite::FieldType kValueFieldType,\n            int default_enum_value>\n  friend class internal::MapField;\n\n  // reinterpret_cast from heap-allocated Map<...>::iterator*. MapIterator owns\n  // the iterator. It is allocated by MapField<...>::InitializeIterator() called\n  // in constructor and deleted by MapField<...>::DeleteIterator() called in\n  // destructor.\n  void* iter_;\n  // Point to a MapField to call helper methods implemented in MapField.\n  // MapIterator does not own this object.\n  internal::MapFieldBase* map_;\n  MapKey key_;\n  MapValueRef value_;\n};\n\n}  // namespace protobuf\n}  // namespace google\n\nGOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START\ntemplate<>\nstruct hash<google::protobuf::MapKey> {\n  size_t\n  operator()(const google::protobuf::MapKey& map_key) const {\n    switch (map_key.type()) {\n      case google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE:\n      case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT:\n      case google::protobuf::FieldDescriptor::CPPTYPE_ENUM:\n      case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE:\n        GOOGLE_LOG(FATAL) << \"Unsupported\";\n        break;\n      case google::protobuf::FieldDescriptor::CPPTYPE_STRING:\n        return hash<string>()(map_key.GetStringValue());\n      case google::protobuf::FieldDescriptor::CPPTYPE_INT64:\n        return hash<::google::protobuf::int64>()(map_key.GetInt64Value());\n      case google::protobuf::FieldDescriptor::CPPTYPE_INT32:\n        return hash<::google::protobuf::int32>()(map_key.GetInt32Value());\n      case google::protobuf::FieldDescriptor::CPPTYPE_UINT64:\n        return hash<::google::protobuf::uint64>()(map_key.GetUInt64Value());\n      case google::protobuf::FieldDescriptor::CPPTYPE_UINT32:\n        return hash<::google::protobuf::uint32>()(map_key.GetUInt32Value());\n      case google::protobuf::FieldDescriptor::CPPTYPE_BOOL:\n        return hash<bool>()(map_key.GetBoolValue());\n    }\n    GOOGLE_LOG(FATAL) << \"Can't get here.\";\n    return 0;\n  }\n  bool\n  operator()(const google::protobuf::MapKey& map_key1,\n             const google::protobuf::MapKey& map_key2) const {\n    return map_key1 < map_key2;\n  }\n};\nGOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END\n\n#endif  // GOOGLE_PROTOBUF_MAP_FIELD_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/map_field_inl.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_MAP_FIELD_INL_H__\n#define GOOGLE_PROTOBUF_MAP_FIELD_INL_H__\n\n#include <memory>\n\n#include <google/protobuf/stubs/casts.h>\n#include <google/protobuf/map.h>\n#include <google/protobuf/map_field.h>\n#include <google/protobuf/map_type_handler.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n// UnwrapMapKey template\ntemplate<typename T>\nT UnwrapMapKey(const MapKey& map_key);\ntemplate<>\ninline int32 UnwrapMapKey<int32>(const MapKey& map_key) {\n  return map_key.GetInt32Value();\n}\ntemplate<>\ninline uint32 UnwrapMapKey<uint32>(const MapKey& map_key) {\n  return map_key.GetUInt32Value();\n}\ntemplate<>\ninline int64 UnwrapMapKey<int64>(const MapKey& map_key) {\n  return map_key.GetInt64Value();\n}\ntemplate<>\ninline uint64 UnwrapMapKey<uint64>(const MapKey& map_key) {\n  return map_key.GetUInt64Value();\n}\ntemplate<>\ninline bool UnwrapMapKey<bool>(const MapKey& map_key) {\n  return map_key.GetBoolValue();\n}\ntemplate<>\ninline string UnwrapMapKey<string>(const MapKey& map_key) {\n  return map_key.GetStringValue();\n}\n\n// SetMapKey template\ntemplate<typename T>\ninline void SetMapKey(MapKey* map_key, const T& value);\ntemplate<>\ninline void SetMapKey<int32>(MapKey* map_key, const int32& value) {\n  map_key->SetInt32Value(value);\n}\ntemplate<>\ninline void SetMapKey<uint32>(MapKey* map_key, const uint32& value) {\n  map_key->SetUInt32Value(value);\n}\ntemplate<>\ninline void SetMapKey<int64>(MapKey* map_key, const int64& value) {\n  map_key->SetInt64Value(value);\n}\ntemplate<>\ninline void SetMapKey<uint64>(MapKey* map_key, const uint64& value) {\n  map_key->SetUInt64Value(value);\n}\ntemplate<>\ninline void SetMapKey<bool>(MapKey* map_key, const bool& value) {\n  map_key->SetBoolValue(value);\n}\ntemplate<>\ninline void SetMapKey<string>(MapKey* map_key, const string& value) {\n  map_key->SetStringValue(value);\n}\n\n// ------------------------TypeDefinedMapFieldBase---------------\ntemplate <typename Key, typename T>\ntypename Map<Key, T>::const_iterator&\nTypeDefinedMapFieldBase<Key, T>::InternalGetIterator(\n    const MapIterator* map_iter) const {\n  return *reinterpret_cast<typename Map<Key, T>::const_iterator *>(\n      map_iter->iter_);\n}\n\ntemplate <typename Key, typename T>\nvoid TypeDefinedMapFieldBase<Key, T>::MapBegin(MapIterator* map_iter) const {\n  InternalGetIterator(map_iter) = GetMap().begin();\n  SetMapIteratorValue(map_iter);\n}\n\ntemplate <typename Key, typename T>\nvoid TypeDefinedMapFieldBase<Key, T>::MapEnd(MapIterator* map_iter) const {\n  InternalGetIterator(map_iter) = GetMap().end();\n}\n\ntemplate <typename Key, typename T>\nbool TypeDefinedMapFieldBase<Key, T>::EqualIterator(const MapIterator& a,\n                                                    const MapIterator& b)\n    const {\n  return InternalGetIterator(&a) == InternalGetIterator(&b);\n}\n\ntemplate <typename Key, typename T>\nvoid TypeDefinedMapFieldBase<Key, T>::IncreaseIterator(MapIterator* map_iter)\n    const {\n  ++InternalGetIterator(map_iter);\n  SetMapIteratorValue(map_iter);\n}\n\ntemplate <typename Key, typename T>\nvoid TypeDefinedMapFieldBase<Key, T>::InitializeIterator(\n    MapIterator* map_iter) const {\n  map_iter->iter_ = new typename Map<Key, T>::const_iterator;\n  GOOGLE_CHECK(map_iter->iter_ != NULL);\n}\n\ntemplate <typename Key, typename T>\nvoid TypeDefinedMapFieldBase<Key, T>::DeleteIterator(MapIterator* map_iter)\n    const {\n  delete reinterpret_cast<typename Map<Key, T>::const_iterator *>(\n      map_iter->iter_);\n}\n\ntemplate <typename Key, typename T>\nvoid TypeDefinedMapFieldBase<Key, T>::CopyIterator(\n    MapIterator* this_iter,\n    const MapIterator& that_iter) const {\n  InternalGetIterator(this_iter) = InternalGetIterator(&that_iter);\n  this_iter->key_.SetType(that_iter.key_.type());\n  // MapValueRef::type() fails when containing data is null. However, if\n  // this_iter points to MapEnd, data can be null.\n  this_iter->value_.SetType(\n      static_cast<FieldDescriptor::CppType>(that_iter.value_.type_));\n  SetMapIteratorValue(this_iter);\n}\n\n// ----------------------------------------------------------------------\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nint MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n             default_enum_value>::size() const {\n  MapFieldBase::SyncMapWithRepeatedField();\n  return static_cast<int>(impl_.GetMap().size());\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nvoid MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n              default_enum_value>::Clear() {\n  MapFieldBase::SyncMapWithRepeatedField();\n  impl_.MutableMap()->clear();\n  MapFieldBase::SetMapDirty();\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nvoid MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n              default_enum_value>::SetMapIteratorValue(MapIterator* map_iter)\n    const {\n  const Map<Key, T>& map = impl_.GetMap();\n  typename Map<Key, T>::const_iterator iter =\n      TypeDefinedMapFieldBase<Key, T>::InternalGetIterator(map_iter);\n  if (iter == map.end()) return;\n  SetMapKey(&map_iter->key_, iter->first);\n  map_iter->value_.SetValue(&iter->second);\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nbool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n              default_enum_value>::ContainsMapKey(const MapKey& map_key) const {\n  const Map<Key, T>& map = impl_.GetMap();\n  const Key& key = UnwrapMapKey<Key>(map_key);\n  typename Map<Key, T>::const_iterator iter = map.find(key);\n  return iter != map.end();\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nbool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n              default_enum_value>::InsertOrLookupMapValue(const MapKey& map_key,\n                                                          MapValueRef* val) {\n  // Always use mutable map because users may change the map value by\n  // MapValueRef.\n  Map<Key, T>* map = MutableMap();\n  const Key& key = UnwrapMapKey<Key>(map_key);\n  typename Map<Key, T>::iterator iter = map->find(key);\n  if (map->end() == iter) {\n    val->SetValue(&((*map)[key]));\n    return true;\n  }\n  // Key is already in the map. Make sure (*map)[key] is not called.\n  // [] may reorder the map and iterators.\n  val->SetValue(&(iter->second));\n  return false;\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nbool MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n              default_enum_value>::DeleteMapValue(const MapKey& map_key) {\n  const Key& key = UnwrapMapKey<Key>(map_key);\n  return MutableMap()->erase(key);\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nvoid MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n              default_enum_value>::MergeFrom(const MapField& other) {\n  MapFieldBase::SyncMapWithRepeatedField();\n  other.SyncMapWithRepeatedField();\n  impl_.MergeFrom(other.impl_);\n  MapFieldBase::SetMapDirty();\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nvoid MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n              default_enum_value>::Swap(MapField* other) {\n  std::swap(this->MapFieldBase::repeated_field_, other->repeated_field_);\n  impl_.Swap(&other->impl_);\n  // a relaxed swap of the atomic\n  auto other_state = other->state_.load(std::memory_order_relaxed);\n  auto this_state = this->MapFieldBase::state_.load(std::memory_order_relaxed);\n  other->state_.store(this_state, std::memory_order_relaxed);\n  this->MapFieldBase::state_.store(other_state, std::memory_order_relaxed);\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nvoid MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n              default_enum_value>::SyncRepeatedFieldWithMapNoLock() const {\n  if (this->MapFieldBase::repeated_field_ == NULL) {\n    if (this->MapFieldBase::arena_ == NULL) {\n      this->MapFieldBase::repeated_field_ = new RepeatedPtrField<Message>();\n    } else {\n      this->MapFieldBase::repeated_field_ =\n          Arena::CreateMessage<RepeatedPtrField<Message> >(\n              this->MapFieldBase::arena_);\n    }\n  }\n  const Map<Key, T>& map = impl_.GetMap();\n  RepeatedPtrField<EntryType>* repeated_field =\n      reinterpret_cast<RepeatedPtrField<EntryType>*>(\n          this->MapFieldBase::repeated_field_);\n\n  repeated_field->Clear();\n\n  // The only way we can get at this point is through reflection and the\n  // only way we can get the reflection object is by having called GetReflection\n  // on the encompassing field. So that type must have existed and hence we\n  // know that this MapEntry default_type has also already been constructed.\n  // So it's safe to just call internal_default_instance().\n  const Message* default_entry = Derived::internal_default_instance();\n  for (typename Map<Key, T>::const_iterator it = map.begin();\n       it != map.end(); ++it) {\n    EntryType* new_entry =\n        down_cast<EntryType*>(default_entry->New(this->MapFieldBase::arena_));\n    repeated_field->AddAllocated(new_entry);\n    (*new_entry->mutable_key()) = it->first;\n    (*new_entry->mutable_value()) = it->second;\n  }\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nvoid MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n              default_enum_value>::SyncMapWithRepeatedFieldNoLock() const {\n  Map<Key, T>* map = const_cast<MapField*>(this)->impl_.MutableMap();\n  RepeatedPtrField<EntryType>* repeated_field =\n      reinterpret_cast<RepeatedPtrField<EntryType>*>(\n          this->MapFieldBase::repeated_field_);\n  GOOGLE_CHECK(this->MapFieldBase::repeated_field_ != NULL);\n  map->clear();\n  for (typename RepeatedPtrField<EntryType>::iterator it =\n           repeated_field->begin(); it != repeated_field->end(); ++it) {\n    // Cast is needed because Map's api and internal storage is different when\n    // value is enum. For enum, we cannot cast an int to enum. Thus, we have to\n    // copy value. For other types, they have same exposed api type and internal\n    // stored type. We should not introduce value copy for them. We achieve this\n    // by casting to value for enum while casting to reference for other types.\n    (*map)[it->key()] = static_cast<CastValueType>(it->value());\n  }\n}\n\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nsize_t MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,\n                default_enum_value>::SpaceUsedExcludingSelfNoLock() const {\n  size_t size = 0;\n  if (this->MapFieldBase::repeated_field_ != NULL) {\n    size += this->MapFieldBase::repeated_field_->SpaceUsedExcludingSelfLong();\n  }\n  Map<Key, T>* map = const_cast<MapField*>(this)->impl_.MutableMap();\n  size += sizeof(*map);\n  for (typename Map<Key, T>::iterator it = map->begin(); it != map->end();\n       ++it) {\n    size += KeyTypeHandler::SpaceUsedInMapLong(it->first);\n    size += ValueTypeHandler::SpaceUsedInMapLong(it->second);\n  }\n  return size;\n}\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_MAP_FIELD_INL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/map_field_lite.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_MAP_FIELD_LITE_H__\n#define GOOGLE_PROTOBUF_MAP_FIELD_LITE_H__\n\n#include <google/protobuf/map.h>\n#include <google/protobuf/map_entry_lite.h>\n#include <google/protobuf/wire_format_lite.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// This class provides access to map field using generated api. It is used for\n// internal generated message implentation only. Users should never use this\n// directly.\ntemplate <typename Derived, typename Key, typename T,\n          WireFormatLite::FieldType key_wire_type,\n          WireFormatLite::FieldType value_wire_type, int default_enum_value = 0>\nclass MapFieldLite {\n  // Define message type for internal repeated field.\n  typedef Derived EntryType;\n\n public:\n  typedef Map<Key, T> MapType;\n  typedef EntryType EntryTypeTrait;\n\n  MapFieldLite() : arena_(NULL) { SetDefaultEnumValue(); }\n\n  explicit MapFieldLite(Arena* arena) : arena_(arena), map_(arena) {\n    SetDefaultEnumValue();\n  }\n\n  // Accessors\n  const Map<Key, T>& GetMap() const { return map_; }\n  Map<Key, T>* MutableMap() { return &map_; }\n\n  // Convenient methods for generated message implementation.\n  int size() const { return static_cast<int>(map_.size()); }\n  void Clear() { return map_.clear(); }\n  void MergeFrom(const MapFieldLite& other) {\n    for (typename Map<Key, T>::const_iterator it = other.map_.begin();\n         it != other.map_.end(); ++it) {\n      map_[it->first] = it->second;\n    }\n  }\n  void Swap(MapFieldLite* other) { map_.swap(other->map_); }\n\n  // Set default enum value only for proto2 map field whose value is enum type.\n  void SetDefaultEnumValue() {\n    MutableMap()->SetDefaultEnumValue(default_enum_value);\n  }\n\n  // Used in the implementation of parsing. Caller should take the ownership iff\n  // arena_ is NULL.\n  EntryType* NewEntry() const {\n    if (arena_ == NULL) {\n      return new EntryType();\n    } else {\n      return Arena::CreateMessage<EntryType>(arena_);\n    }\n  }\n  // Used in the implementation of serializing enum value type. Caller should\n  // take the ownership iff arena_ is NULL.\n  EntryType* NewEnumEntryWrapper(const Key& key, const T t) const {\n    return EntryType::EnumWrap(key, t, arena_);\n  }\n  // Used in the implementation of serializing other value types. Caller should\n  // take the ownership iff arena_ is NULL.\n  EntryType* NewEntryWrapper(const Key& key, const T& t) const {\n    return EntryType::Wrap(key, t, arena_);\n  }\n\n private:\n  typedef void DestructorSkippable_;\n\n  Arena* arena_;\n  Map<Key, T> map_;\n\n  friend class ::google::protobuf::Arena;\n};\n\n// True if IsInitialized() is true for value field in all elements of t. T is\n// expected to be message.  It's useful to have this helper here to keep the\n// protobuf compiler from ever having to emit loops in IsInitialized() methods.\n// We want the C++ compiler to inline this or not as it sees fit.\ntemplate <typename Key, typename T>\nbool AllAreInitialized(const Map<Key, T>& t) {\n  for (typename Map<Key, T>::const_iterator it = t.begin(); it != t.end();\n       ++it) {\n    if (!it->second.IsInitialized()) return false;\n  }\n  return true;\n}\n\ntemplate <typename MEntry>\nstruct MapEntryToMapField : MapEntryToMapField<typename MEntry::SuperType> {};\n\ntemplate <typename T, typename Key, typename Value,\n          WireFormatLite::FieldType kKeyFieldType,\n          WireFormatLite::FieldType kValueFieldType, int default_enum_value>\nstruct MapEntryToMapField<MapEntryLite<T, Key, Value, kKeyFieldType,\n                                       kValueFieldType, default_enum_value> > {\n  typedef MapFieldLite<MapEntryLite<T, Key, Value, kKeyFieldType,\n                                    kValueFieldType, default_enum_value>,\n                       Key, Value, kKeyFieldType, kValueFieldType,\n                       default_enum_value>\n      MapFieldType;\n};\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_MAP_FIELD_LITE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/map_type_handler.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_TYPE_HANDLER_H__\n#define GOOGLE_PROTOBUF_TYPE_HANDLER_H__\n\n#include <google/protobuf/arena.h>\n#include <google/protobuf/wire_format_lite_inl.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// Used for compile time type selection. MapIf::type will be TrueType if Flag is\n// true and FalseType otherwise.\ntemplate<bool Flag, typename TrueType, typename FalseType>\nstruct MapIf;\n\ntemplate<typename TrueType, typename FalseType>\nstruct MapIf<true, TrueType, FalseType> {\n  typedef TrueType type;\n};\n\ntemplate<typename TrueType, typename FalseType>\nstruct MapIf<false, TrueType, FalseType> {\n  typedef FalseType type;\n};\n\n// In proto2 Map, enum needs to be initialized to given default value, while\n// other types' default value can be inferred from the type.\ntemplate <bool IsEnum, typename Type>\nclass MapValueInitializer {\n public:\n  static inline void Initialize(Type& type, int default_enum_value);\n};\n\ntemplate <typename Type>\nclass MapValueInitializer<true, Type> {\n public:\n  static inline void Initialize(Type& value, int default_enum_value) {\n    value = static_cast<Type>(default_enum_value);\n  }\n};\n\ntemplate <typename Type>\nclass MapValueInitializer<false, Type> {\n public:\n  static inline void Initialize(Type& /* value */, int /* default_enum_value */) {}\n};\n\ntemplate <typename Type, bool is_arena_constructable>\nclass MapArenaMessageCreator {\n public:\n  // Use arena to create message if Type is arena constructable. Otherwise,\n  // create the message on heap.\n  static inline Type* CreateMessage(Arena* arena);\n};\ntemplate <typename Type>\nclass MapArenaMessageCreator<Type, true> {\n public:\n  static inline Type* CreateMessage(Arena* arena) {\n    return Arena::CreateMessage<Type>(arena);\n  }\n};\ntemplate <typename Type>\nclass MapArenaMessageCreator<Type, false> {\n public:\n  static inline Type* CreateMessage(Arena* arena) {\n    return Arena::Create<Type>(arena);\n  }\n};\n\n// Define constants for given wire field type\ntemplate <WireFormatLite::FieldType field_type, typename Type>\nclass MapWireFieldTypeTraits {};\n\n#define TYPE_TRAITS(FieldType, CType, WireFormatType, IsMessage, IsEnum)   \\\n  template <typename Type>                                                 \\\n  class MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType, Type> {   \\\n   public:                                                                 \\\n    static const bool kIsMessage = IsMessage;                              \\\n    static const bool kIsEnum = IsEnum;                                    \\\n    typedef typename MapIf<kIsMessage, Type*, CType>::type TypeOnMemory;   \\\n    typedef typename MapIf<kIsEnum, int, Type>::type MapEntryAccessorType; \\\n    static const WireFormatLite::WireType kWireType =                      \\\n        WireFormatLite::WIRETYPE_##WireFormatType;                         \\\n  };\n\nTYPE_TRAITS(MESSAGE , Type, LENGTH_DELIMITED, true, false)\nTYPE_TRAITS(STRING  , ArenaStringPtr, LENGTH_DELIMITED, false, false)\nTYPE_TRAITS(BYTES   , ArenaStringPtr ,  LENGTH_DELIMITED, false, false)\nTYPE_TRAITS(INT64   , int64  ,  VARINT , false, false)\nTYPE_TRAITS(UINT64  , uint64 ,  VARINT , false, false)\nTYPE_TRAITS(INT32   , int32  ,  VARINT , false, false)\nTYPE_TRAITS(UINT32  , uint32 ,  VARINT , false, false)\nTYPE_TRAITS(SINT64  , int64  ,  VARINT , false, false)\nTYPE_TRAITS(SINT32  , int32  ,  VARINT , false, false)\nTYPE_TRAITS(ENUM    , int    ,  VARINT , false, true )\nTYPE_TRAITS(DOUBLE  , double ,  FIXED64, false, false)\nTYPE_TRAITS(FLOAT   , float  ,  FIXED32, false, false)\nTYPE_TRAITS(FIXED64 , uint64 ,  FIXED64, false, false)\nTYPE_TRAITS(FIXED32 , uint32 ,  FIXED32, false, false)\nTYPE_TRAITS(SFIXED64, int64  ,  FIXED64, false, false)\nTYPE_TRAITS(SFIXED32, int32  ,  FIXED32, false, false)\nTYPE_TRAITS(BOOL    , bool   ,  VARINT , false, false)\n\n#undef TYPE_TRAITS\n\ntemplate <WireFormatLite::FieldType field_type, typename Type>\nclass MapTypeHandler {};\n\ntemplate <typename Type>\nclass MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type> {\n public:\n  // Enum type cannot be used for MapTypeHandler::Read. Define a type which will\n  // replace Enum with int.\n  typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE,\n      Type>::MapEntryAccessorType MapEntryAccessorType;\n  // Internal stored type in MapEntryLite for given wire field type.\n  typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE,\n                                          Type>::TypeOnMemory TypeOnMemory;\n  // Corresponding wire type for field type.\n  static const WireFormatLite::WireType kWireType =\n      MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE, Type>::kWireType;\n  // Whether wire type is for message.\n  static const bool kIsMessage =\n      MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE, Type>::kIsMessage;\n  // Whether wire type is for enum.\n  static const bool kIsEnum =\n      MapWireFieldTypeTraits<WireFormatLite::TYPE_MESSAGE, Type>::kIsEnum;\n\n  // Functions used in parsing and serialization. ===================\n  static inline size_t ByteSize(const MapEntryAccessorType& value);\n  static inline int GetCachedSize(const MapEntryAccessorType& value);\n  static inline bool Read(io::CodedInputStream* input,\n                          MapEntryAccessorType* value);\n  static inline void Write(int field, const MapEntryAccessorType& value,\n                           io::CodedOutputStream* output);\n  static inline uint8* InternalWriteToArray(int field,\n                                            const MapEntryAccessorType& value,\n                                            bool deterministic, uint8* target);\n  static inline uint8* WriteToArray(int field,\n                                    const MapEntryAccessorType& value,\n                                    uint8* target);\n\n  // Functions to manipulate data on memory. ========================\n  static inline const Type& GetExternalReference(const Type* value);\n  static inline void DeleteNoArena(const Type* x);\n  static inline void Merge(const Type& from, Type** to, Arena* arena);\n  static inline void Clear(Type** value, Arena* arena);\n  static inline void ClearMaybeByDefaultEnum(Type** value, Arena* arena,\n                                             int default_enum_value);\n  static inline void Initialize(Type** x, Arena* arena);\n\n  static inline void InitializeMaybeByDefaultEnum(Type** x,\n                                                  int default_enum_value,\n                                                  Arena* arena);\n  static inline Type* EnsureMutable(Type** value, Arena* arena);\n  // SpaceUsedInMapEntry: Return bytes used by value in MapEntry, excluding\n  // those already calculate in sizeof(MapField).\n  static inline size_t SpaceUsedInMapEntryLong(const Type* value);\n  // Return bytes used by value in Map.\n  static inline size_t SpaceUsedInMapLong(const Type& value);\n  // Assign default value to given instance.\n  static inline void AssignDefaultValue(Type** value);\n  // Return default instance if value is not initialized when calling const\n  // reference accessor.\n  static inline const Type& DefaultIfNotInitialized(\n      const Type* value, const Type* default_value);\n  // Check if all required fields have values set.\n  static inline bool IsInitialized(Type* value);\n};\n\n#define MAP_HANDLER(FieldType)                                                \\\n  template <typename Type>                                                    \\\n  class MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type> {              \\\n   public:                                                                    \\\n    typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType, \\\n                                            Type>::MapEntryAccessorType       \\\n        MapEntryAccessorType;                                                 \\\n    typedef typename MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType, \\\n                                            Type>::TypeOnMemory TypeOnMemory; \\\n    static const WireFormatLite::WireType kWireType =                         \\\n        MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,              \\\n                               Type>::kWireType;                              \\\n    static const bool kIsMessage =                                            \\\n        MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,              \\\n                               Type>::kIsMessage;                             \\\n    static const bool kIsEnum =                                               \\\n        MapWireFieldTypeTraits<WireFormatLite::TYPE_##FieldType,              \\\n                               Type>::kIsEnum;                                \\\n    static inline int ByteSize(const MapEntryAccessorType& value);            \\\n    static inline int GetCachedSize(const MapEntryAccessorType& value);       \\\n    static inline bool Read(io::CodedInputStream* input,                      \\\n                            MapEntryAccessorType* value);                     \\\n    static inline void Write(int field, const MapEntryAccessorType& value,    \\\n                             io::CodedOutputStream* output);                  \\\n    static inline uint8* InternalWriteToArray(                                \\\n        int field, const MapEntryAccessorType& value, bool deterministic,     \\\n        uint8* target);                                                       \\\n    static inline uint8* WriteToArray(int field,                              \\\n                                      const MapEntryAccessorType& value,      \\\n                                      uint8* target) {                        \\\n      return InternalWriteToArray(field, value, false, target);               \\\n    }                                                                         \\\n    static inline const MapEntryAccessorType& GetExternalReference(           \\\n        const TypeOnMemory& value);                                           \\\n    static inline void DeleteNoArena(const TypeOnMemory& x);                  \\\n    static inline void Merge(const MapEntryAccessorType& from,                \\\n                             TypeOnMemory* to, Arena* arena);                 \\\n    static inline void Clear(TypeOnMemory* value, Arena* arena);              \\\n    static inline void ClearMaybeByDefaultEnum(TypeOnMemory* value,           \\\n                                               Arena* arena,                  \\\n                                               int default_enum);             \\\n    static inline size_t SpaceUsedInMapEntryLong(const TypeOnMemory& value);  \\\n    static inline size_t SpaceUsedInMapLong(const TypeOnMemory& value);       \\\n    static inline size_t SpaceUsedInMapLong(const string& value);             \\\n    static inline void AssignDefaultValue(TypeOnMemory* value);               \\\n    static inline const MapEntryAccessorType& DefaultIfNotInitialized(        \\\n        const TypeOnMemory& value, const TypeOnMemory& default_value);        \\\n    static inline bool IsInitialized(const TypeOnMemory& value);              \\\n    static void DeleteNoArena(TypeOnMemory& value);                           \\\n    static inline void Initialize(TypeOnMemory* value, Arena* arena);         \\\n    static inline void InitializeMaybeByDefaultEnum(TypeOnMemory* value,      \\\n                                                    int default_enum_value,   \\\n                                                    Arena* arena);            \\\n    static inline MapEntryAccessorType* EnsureMutable(TypeOnMemory* value,    \\\n                                                      Arena* arena);          \\\n  };\nMAP_HANDLER(STRING)\nMAP_HANDLER(BYTES)\nMAP_HANDLER(INT64)\nMAP_HANDLER(UINT64)\nMAP_HANDLER(INT32)\nMAP_HANDLER(UINT32)\nMAP_HANDLER(SINT64)\nMAP_HANDLER(SINT32)\nMAP_HANDLER(ENUM)\nMAP_HANDLER(DOUBLE)\nMAP_HANDLER(FLOAT)\nMAP_HANDLER(FIXED64)\nMAP_HANDLER(FIXED32)\nMAP_HANDLER(SFIXED64)\nMAP_HANDLER(SFIXED32)\nMAP_HANDLER(BOOL)\n#undef MAP_HANDLER\n\ntemplate <typename Type>\ninline size_t\nMapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::ByteSize(\n    const MapEntryAccessorType& value) {\n  return WireFormatLite::MessageSizeNoVirtual(value);\n}\n\n#define GOOGLE_PROTOBUF_BYTE_SIZE(FieldType, DeclaredType)                     \\\n  template <typename Type>                                                     \\\n  inline int MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::ByteSize( \\\n      const MapEntryAccessorType& value) {                                     \\\n    return static_cast<int>(WireFormatLite::DeclaredType##Size(value));        \\\n  }\n\nGOOGLE_PROTOBUF_BYTE_SIZE(STRING, String)\nGOOGLE_PROTOBUF_BYTE_SIZE(BYTES , Bytes)\nGOOGLE_PROTOBUF_BYTE_SIZE(INT64 , Int64)\nGOOGLE_PROTOBUF_BYTE_SIZE(UINT64, UInt64)\nGOOGLE_PROTOBUF_BYTE_SIZE(INT32 , Int32)\nGOOGLE_PROTOBUF_BYTE_SIZE(UINT32, UInt32)\nGOOGLE_PROTOBUF_BYTE_SIZE(SINT64, SInt64)\nGOOGLE_PROTOBUF_BYTE_SIZE(SINT32, SInt32)\nGOOGLE_PROTOBUF_BYTE_SIZE(ENUM  , Enum)\n\n#undef GOOGLE_PROTOBUF_BYTE_SIZE\n\n#define FIXED_BYTE_SIZE(FieldType, DeclaredType)                               \\\n  template <typename Type>                                                     \\\n  inline int MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::ByteSize( \\\n      const MapEntryAccessorType& /* value */) {                               \\\n    return WireFormatLite::k##DeclaredType##Size;                              \\\n  }\n\nFIXED_BYTE_SIZE(DOUBLE  , Double)\nFIXED_BYTE_SIZE(FLOAT   , Float)\nFIXED_BYTE_SIZE(FIXED64 , Fixed64)\nFIXED_BYTE_SIZE(FIXED32 , Fixed32)\nFIXED_BYTE_SIZE(SFIXED64, SFixed64)\nFIXED_BYTE_SIZE(SFIXED32, SFixed32)\nFIXED_BYTE_SIZE(BOOL    , Bool)\n\n#undef FIXED_BYTE_SIZE\n\ntemplate <typename Type>\ninline int\nMapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::GetCachedSize(\n    const MapEntryAccessorType& value) {\n  return static_cast<int>(\n      WireFormatLite::LengthDelimitedSize(\n          static_cast<size_t>(value.GetCachedSize())));\n}\n\n#define GET_CACHED_SIZE(FieldType, DeclaredType)                         \\\n  template <typename Type>                                               \\\n  inline int                                                             \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::GetCachedSize( \\\n      const MapEntryAccessorType& value) {                               \\\n    return static_cast<int>(WireFormatLite::DeclaredType##Size(value));  \\\n  }\n\nGET_CACHED_SIZE(STRING, String)\nGET_CACHED_SIZE(BYTES , Bytes)\nGET_CACHED_SIZE(INT64 , Int64)\nGET_CACHED_SIZE(UINT64, UInt64)\nGET_CACHED_SIZE(INT32 , Int32)\nGET_CACHED_SIZE(UINT32, UInt32)\nGET_CACHED_SIZE(SINT64, SInt64)\nGET_CACHED_SIZE(SINT32, SInt32)\nGET_CACHED_SIZE(ENUM  , Enum)\n\n#undef GET_CACHED_SIZE\n\n#define GET_FIXED_CACHED_SIZE(FieldType, DeclaredType)                   \\\n  template <typename Type>                                               \\\n  inline int                                                             \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::GetCachedSize( \\\n      const MapEntryAccessorType& /* value */) {                         \\\n    return WireFormatLite::k##DeclaredType##Size;                        \\\n  }\n\nGET_FIXED_CACHED_SIZE(DOUBLE  , Double)\nGET_FIXED_CACHED_SIZE(FLOAT   , Float)\nGET_FIXED_CACHED_SIZE(FIXED64 , Fixed64)\nGET_FIXED_CACHED_SIZE(FIXED32 , Fixed32)\nGET_FIXED_CACHED_SIZE(SFIXED64, SFixed64)\nGET_FIXED_CACHED_SIZE(SFIXED32, SFixed32)\nGET_FIXED_CACHED_SIZE(BOOL    , Bool)\n\n#undef GET_FIXED_CACHED_SIZE\n\ntemplate <typename Type>\ninline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Write(\n    int field, const MapEntryAccessorType& value,\n    io::CodedOutputStream* output) {\n  WireFormatLite::WriteMessageMaybeToArray(field, value, output);\n}\n\ntemplate <typename Type>\ninline uint8*\nMapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::InternalWriteToArray(\n    int field, const MapEntryAccessorType& value, bool deterministic,\n    uint8* target) {\n  return WireFormatLite::InternalWriteMessageToArray(field, value,\n                                                     deterministic, target);\n}\n\n#define WRITE_METHOD(FieldType, DeclaredType)                                  \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Write(   \\\n      int field, const MapEntryAccessorType& value,                            \\\n      io::CodedOutputStream* output) {                                         \\\n    return WireFormatLite::Write##DeclaredType(field, value, output);          \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline uint8*                                                                \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \\\n                 Type>::InternalWriteToArray(                                  \\\n      int field, const MapEntryAccessorType& value, bool, uint8* target) {     \\\n    return WireFormatLite::Write##DeclaredType##ToArray(field, value, target); \\\n  }\n\nWRITE_METHOD(STRING  , String)\nWRITE_METHOD(BYTES   , Bytes)\nWRITE_METHOD(INT64   , Int64)\nWRITE_METHOD(UINT64  , UInt64)\nWRITE_METHOD(INT32   , Int32)\nWRITE_METHOD(UINT32  , UInt32)\nWRITE_METHOD(SINT64  , SInt64)\nWRITE_METHOD(SINT32  , SInt32)\nWRITE_METHOD(ENUM    , Enum)\nWRITE_METHOD(DOUBLE  , Double)\nWRITE_METHOD(FLOAT   , Float)\nWRITE_METHOD(FIXED64 , Fixed64)\nWRITE_METHOD(FIXED32 , Fixed32)\nWRITE_METHOD(SFIXED64, SFixed64)\nWRITE_METHOD(SFIXED32, SFixed32)\nWRITE_METHOD(BOOL    , Bool)\n\n#undef WRITE_METHOD\n\ntemplate <typename Type>\ninline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Read(\n    io::CodedInputStream* input, MapEntryAccessorType* value) {\n  return WireFormatLite::ReadMessageNoVirtual(input, value);\n}\n\ntemplate <typename Type>\ninline bool MapTypeHandler<WireFormatLite::TYPE_STRING, Type>::Read(\n    io::CodedInputStream* input, MapEntryAccessorType* value) {\n  return WireFormatLite::ReadString(input, value);\n}\n\ntemplate <typename Type>\ninline bool MapTypeHandler<WireFormatLite::TYPE_BYTES, Type>::Read(\n    io::CodedInputStream* input, MapEntryAccessorType* value) {\n  return WireFormatLite::ReadBytes(input, value);\n}\n\n#define READ_METHOD(FieldType)                                              \\\n  template <typename Type>                                                  \\\n  inline bool MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Read( \\\n      io::CodedInputStream* input, MapEntryAccessorType* value) {           \\\n    return WireFormatLite::ReadPrimitive<TypeOnMemory,                      \\\n                                         WireFormatLite::TYPE_##FieldType>( \\\n        input, value);                                                      \\\n  }\n\nREAD_METHOD(INT64)\nREAD_METHOD(UINT64)\nREAD_METHOD(INT32)\nREAD_METHOD(UINT32)\nREAD_METHOD(SINT64)\nREAD_METHOD(SINT32)\nREAD_METHOD(ENUM)\nREAD_METHOD(DOUBLE)\nREAD_METHOD(FLOAT)\nREAD_METHOD(FIXED64)\nREAD_METHOD(FIXED32)\nREAD_METHOD(SFIXED64)\nREAD_METHOD(SFIXED32)\nREAD_METHOD(BOOL)\n\n#undef READ_METHOD\n\n// Definition for message handler\n\ntemplate <typename Type>\ninline const Type&\nMapTypeHandler<WireFormatLite::TYPE_MESSAGE,\n                        Type>::GetExternalReference(const Type* value) {\n  return *value;\n}\n\ntemplate <typename Type>\ninline size_t MapTypeHandler<WireFormatLite::TYPE_MESSAGE,\n                             Type>::SpaceUsedInMapEntryLong(const Type* value) {\n  return value->SpaceUsedLong();\n}\n\ntemplate <typename Type>\nsize_t MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::SpaceUsedInMapLong(\n    const Type& value) {\n  return value.SpaceUsedLong();\n}\n\ntemplate <typename Type>\ninline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Clear(\n    Type** value, Arena* /* arena */) {\n  if (*value != NULL) (*value)->Clear();\n}\ntemplate <typename Type>\ninline void\nMapTypeHandler<WireFormatLite::TYPE_MESSAGE,\n                        Type>::ClearMaybeByDefaultEnum(Type** value,\n                                                       Arena* /* arena */,\n                                                       int /* default_enum_value */) {\n  if (*value != NULL) (*value)->Clear();\n}\ntemplate <typename Type>\ninline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::Merge(\n    const Type& from, Type** to, Arena* /* arena */) {\n  (*to)->MergeFrom(from);\n}\n\ntemplate <typename Type>\nvoid MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::DeleteNoArena(\n    const Type* ptr) {\n  delete ptr;\n}\n\ntemplate <typename Type>\ninline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE,\n                                    Type>::AssignDefaultValue(Type** value) {\n  *value = const_cast<Type*>(Type::internal_default_instance());\n}\n\ntemplate <typename Type>\ninline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE,\n                                    Type>::Initialize(Type** x,\n                                                      Arena* /* arena */) {\n  *x = NULL;\n}\n\ntemplate <typename Type>\ninline void MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::\n    InitializeMaybeByDefaultEnum(Type** x, int /* default_enum_value */,\n                                 Arena* /* arena */) {\n  *x = NULL;\n}\n\ntemplate <typename Type>\ninline Type* MapTypeHandler<WireFormatLite::TYPE_MESSAGE,\n                                     Type>::EnsureMutable(Type** value,\n                                                          Arena* arena) {\n  if (*value == NULL) {\n    *value =\n        MapArenaMessageCreator<Type, Arena::is_arena_constructable<Type>::\n                                         type::value>::CreateMessage(arena);\n  }\n  return *value;\n}\n\ntemplate <typename Type>\ninline const Type& MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::\n    DefaultIfNotInitialized(const Type* value, const Type* default_value) {\n  return value != NULL ? *value : *default_value;\n}\n\ntemplate <typename Type>\ninline bool MapTypeHandler<WireFormatLite::TYPE_MESSAGE,\n                                    Type>::IsInitialized(Type* value) {\n  return value->IsInitialized();\n}\n\n// Definition for string/bytes handler\n\n#define STRING_OR_BYTES_HANDLER_FUNCTIONS(FieldType)                           \\\n  template <typename Type>                                                     \\\n  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,       \\\n                                       Type>::MapEntryAccessorType&            \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \\\n                 Type>::GetExternalReference(const TypeOnMemory& value) {      \\\n    return value.Get();                                                        \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline size_t                                                                \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \\\n                 Type>::SpaceUsedInMapEntryLong(const TypeOnMemory& value) {   \\\n    return sizeof(value);                                                      \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline size_t                                                                \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::SpaceUsedInMapLong(  \\\n      const TypeOnMemory& value) {                                             \\\n    return sizeof(value);                                                      \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline size_t                                                                \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::SpaceUsedInMapLong(  \\\n      const string& value) {                                                   \\\n    return sizeof(value);                                                      \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Clear(   \\\n      TypeOnMemory* value, Arena* arena) {                                     \\\n    value->ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),    \\\n                        arena);                                                \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::         \\\n      ClearMaybeByDefaultEnum(TypeOnMemory* value, Arena* arena,               \\\n                              int /* default_enum */) {                        \\\n    Clear(value, arena);                                                       \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Merge(   \\\n      const MapEntryAccessorType& from, TypeOnMemory* to, Arena* arena) {      \\\n    to->Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from, arena);  \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::DeleteNoArena(  \\\n      TypeOnMemory& value) {                                                   \\\n    value.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());  \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \\\n                             Type>::AssignDefaultValue(TypeOnMemory* /* value */) {} \\\n  template <typename Type>                                                     \\\n  inline void                                                                  \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Initialize(          \\\n      TypeOnMemory* value, Arena* /* arena */) {                               \\\n    value->UnsafeSetDefault(                                                   \\\n        &::google::protobuf::internal::GetEmptyStringAlreadyInited());                   \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::         \\\n      InitializeMaybeByDefaultEnum(TypeOnMemory* value,                        \\\n                                   int /* default_enum_value */,               \\\n                                   Arena* arena) {                             \\\n    Initialize(value, arena);                                                  \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,             \\\n                                 Type>::MapEntryAccessorType*                  \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::EnsureMutable(       \\\n      TypeOnMemory* value, Arena* arena) {                                     \\\n    return value->Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),  \\\n                          arena);                                              \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,       \\\n                                       Type>::MapEntryAccessorType&            \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \\\n                 Type>::DefaultIfNotInitialized(const TypeOnMemory& value,     \\\n                                                const TypeOnMemory&            \\\n                                                    /* default_value */) {     \\\n    return value.Get();                                                        \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline bool MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \\\n                             Type>::IsInitialized(const TypeOnMemory& /* value */) { \\\n    return true;                                                               \\\n  }\nSTRING_OR_BYTES_HANDLER_FUNCTIONS(STRING)\nSTRING_OR_BYTES_HANDLER_FUNCTIONS(BYTES)\n#undef STRING_OR_BYTES_HANDLER_FUNCTIONS\n\n#define PRIMITIVE_HANDLER_FUNCTIONS(FieldType)                                 \\\n  template <typename Type>                                                     \\\n  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,       \\\n                                       Type>::MapEntryAccessorType&            \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \\\n                 Type>::GetExternalReference(const TypeOnMemory& value) {      \\\n    return value;                                                              \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline size_t                                                                \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \\\n                 Type>::SpaceUsedInMapEntryLong(const TypeOnMemory& /* value */) {   \\\n    return 0;                                                                  \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline size_t                                                                \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::SpaceUsedInMapLong(  \\\n      const TypeOnMemory& /* value */) {                                       \\\n    return sizeof(Type);                                                       \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Clear(   \\\n      TypeOnMemory* value, Arena* /* arena */) {                               \\\n    *value = 0;                                                                \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::         \\\n      ClearMaybeByDefaultEnum(TypeOnMemory* value, Arena* /* arena */,         \\\n                              int default_enum_value) {                        \\\n    *value = static_cast<TypeOnMemory>(default_enum_value);                    \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Merge(   \\\n      const MapEntryAccessorType& from, TypeOnMemory* to,                      \\\n      Arena* /* arena */) {                                                    \\\n    *to = from;                                                                \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \\\n                             Type>::DeleteNoArena(TypeOnMemory& /* x */) {}    \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \\\n                             Type>::AssignDefaultValue(TypeOnMemory* /* value */) {} \\\n  template <typename Type>                                                     \\\n  inline void                                                                  \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::Initialize(          \\\n      TypeOnMemory* value, Arena* /* arena */) {                               \\\n    *value = 0;                                                                \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline void MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::         \\\n      InitializeMaybeByDefaultEnum(TypeOnMemory* value,                        \\\n                                   int default_enum_value,                     \\\n                                   Arena* /* arena */) {                       \\\n    *value = static_cast<TypeOnMemory>(default_enum_value);                    \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,             \\\n                                 Type>::MapEntryAccessorType*                  \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::EnsureMutable(       \\\n      TypeOnMemory* value, Arena* /* arena */) {                               \\\n    return value;                                                              \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline const typename MapTypeHandler<WireFormatLite::TYPE_##FieldType,       \\\n                                       Type>::MapEntryAccessorType&            \\\n  MapTypeHandler<WireFormatLite::TYPE_##FieldType,                             \\\n                 Type>::DefaultIfNotInitialized(const TypeOnMemory& value,     \\\n                                                const TypeOnMemory&            \\\n                                                   /* default_value */) {      \\\n    return value;                                                              \\\n  }                                                                            \\\n  template <typename Type>                                                     \\\n  inline bool MapTypeHandler<WireFormatLite::TYPE_##FieldType,                 \\\n                             Type>::IsInitialized(const TypeOnMemory& /* value */) { \\\n    return true;                                                               \\\n  }\nPRIMITIVE_HANDLER_FUNCTIONS(INT64)\nPRIMITIVE_HANDLER_FUNCTIONS(UINT64)\nPRIMITIVE_HANDLER_FUNCTIONS(INT32)\nPRIMITIVE_HANDLER_FUNCTIONS(UINT32)\nPRIMITIVE_HANDLER_FUNCTIONS(SINT64)\nPRIMITIVE_HANDLER_FUNCTIONS(SINT32)\nPRIMITIVE_HANDLER_FUNCTIONS(ENUM)\nPRIMITIVE_HANDLER_FUNCTIONS(DOUBLE)\nPRIMITIVE_HANDLER_FUNCTIONS(FLOAT)\nPRIMITIVE_HANDLER_FUNCTIONS(FIXED64)\nPRIMITIVE_HANDLER_FUNCTIONS(FIXED32)\nPRIMITIVE_HANDLER_FUNCTIONS(SFIXED64)\nPRIMITIVE_HANDLER_FUNCTIONS(SFIXED32)\nPRIMITIVE_HANDLER_FUNCTIONS(BOOL)\n#undef PRIMITIVE_HANDLER_FUNCTIONS\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_TYPE_HANDLER_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/message.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Defines Message, the abstract interface implemented by non-lite\n// protocol message objects.  Although it's possible to implement this\n// interface manually, most users will use the protocol compiler to\n// generate implementations.\n//\n// Example usage:\n//\n// Say you have a message defined as:\n//\n//   message Foo {\n//     optional string text = 1;\n//     repeated int32 numbers = 2;\n//   }\n//\n// Then, if you used the protocol compiler to generate a class from the above\n// definition, you could use it like so:\n//\n//   string data;  // Will store a serialized version of the message.\n//\n//   {\n//     // Create a message and serialize it.\n//     Foo foo;\n//     foo.set_text(\"Hello World!\");\n//     foo.add_numbers(1);\n//     foo.add_numbers(5);\n//     foo.add_numbers(42);\n//\n//     foo.SerializeToString(&data);\n//   }\n//\n//   {\n//     // Parse the serialized message and check that it contains the\n//     // correct data.\n//     Foo foo;\n//     foo.ParseFromString(data);\n//\n//     assert(foo.text() == \"Hello World!\");\n//     assert(foo.numbers_size() == 3);\n//     assert(foo.numbers(0) == 1);\n//     assert(foo.numbers(1) == 5);\n//     assert(foo.numbers(2) == 42);\n//   }\n//\n//   {\n//     // Same as the last block, but do it dynamically via the Message\n//     // reflection interface.\n//     Message* foo = new Foo;\n//     const Descriptor* descriptor = foo->GetDescriptor();\n//\n//     // Get the descriptors for the fields we're interested in and verify\n//     // their types.\n//     const FieldDescriptor* text_field = descriptor->FindFieldByName(\"text\");\n//     assert(text_field != NULL);\n//     assert(text_field->type() == FieldDescriptor::TYPE_STRING);\n//     assert(text_field->label() == FieldDescriptor::LABEL_OPTIONAL);\n//     const FieldDescriptor* numbers_field = descriptor->\n//                                            FindFieldByName(\"numbers\");\n//     assert(numbers_field != NULL);\n//     assert(numbers_field->type() == FieldDescriptor::TYPE_INT32);\n//     assert(numbers_field->label() == FieldDescriptor::LABEL_REPEATED);\n//\n//     // Parse the message.\n//     foo->ParseFromString(data);\n//\n//     // Use the reflection interface to examine the contents.\n//     const Reflection* reflection = foo->GetReflection();\n//     assert(reflection->GetString(*foo, text_field) == \"Hello World!\");\n//     assert(reflection->FieldSize(*foo, numbers_field) == 3);\n//     assert(reflection->GetRepeatedInt32(*foo, numbers_field, 0) == 1);\n//     assert(reflection->GetRepeatedInt32(*foo, numbers_field, 1) == 5);\n//     assert(reflection->GetRepeatedInt32(*foo, numbers_field, 2) == 42);\n//\n//     delete foo;\n//   }\n\n#ifndef GOOGLE_PROTOBUF_MESSAGE_H__\n#define GOOGLE_PROTOBUF_MESSAGE_H__\n\n#include <iosfwd>\n#include <string>\n#include <type_traits>\n#include <vector>\n\n#include <google/protobuf/arena.h>\n#include <google/protobuf/message_lite.h>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/descriptor.h>\n\n\n#define GOOGLE_PROTOBUF_HAS_ONEOF\n#define GOOGLE_PROTOBUF_HAS_ARENAS\n\nnamespace google {\nnamespace protobuf {\n\n// Defined in this file.\nclass Message;\nclass Reflection;\nclass MessageFactory;\n\n// Defined in other files.\nclass MapKey;\nclass MapValueRef;\nclass MapIterator;\nclass MapReflectionTester;\n\nnamespace internal {\nclass MapFieldBase;\n}\nclass UnknownFieldSet;         // unknown_field_set.h\nnamespace io {\nclass ZeroCopyInputStream;     // zero_copy_stream.h\nclass ZeroCopyOutputStream;    // zero_copy_stream.h\nclass CodedInputStream;        // coded_stream.h\nclass CodedOutputStream;       // coded_stream.h\n}\nnamespace python {\nclass MapReflectionFriend;     // scalar_map_container.h\n}\nnamespace expr {\nclass CelMapReflectionFriend;  // field_backed_map_impl.cc\n}\n\n\nnamespace internal {\nclass ReflectionOps;     // reflection_ops.h\nclass MapKeySorter;      // wire_format.cc\nclass WireFormat;        // wire_format.h\nclass MapFieldReflectionTest;  // map_test.cc\n}\n\ntemplate<typename T>\nclass RepeatedField;     // repeated_field.h\n\ntemplate<typename T>\nclass RepeatedPtrField;  // repeated_field.h\n\n// A container to hold message metadata.\nstruct Metadata {\n  const Descriptor* descriptor;\n  const Reflection* reflection;\n};\n\n// Abstract interface for protocol messages.\n//\n// See also MessageLite, which contains most every-day operations.  Message\n// adds descriptors and reflection on top of that.\n//\n// The methods of this class that are virtual but not pure-virtual have\n// default implementations based on reflection.  Message classes which are\n// optimized for speed will want to override these with faster implementations,\n// but classes optimized for code size may be happy with keeping them.  See\n// the optimize_for option in descriptor.proto.\nclass LIBPROTOBUF_EXPORT Message : public MessageLite {\n public:\n  inline Message() {}\n  virtual ~Message() {}\n\n  // Basic Operations ------------------------------------------------\n\n  // Construct a new instance of the same type.  Ownership is passed to the\n  // caller.  (This is also defined in MessageLite, but is defined again here\n  // for return-type covariance.)\n  virtual Message* New() const = 0;\n\n  // Construct a new instance on the arena. Ownership is passed to the caller\n  // if arena is a NULL. Default implementation allows for API compatibility\n  // during the Arena transition.\n  virtual Message* New(::google::protobuf::Arena* arena) const {\n    Message* message = New();\n    if (arena != NULL) {\n      arena->Own(message);\n    }\n    return message;\n  }\n\n  // Make this message into a copy of the given message.  The given message\n  // must have the same descriptor, but need not necessarily be the same class.\n  // By default this is just implemented as \"Clear(); MergeFrom(from);\".\n  virtual void CopyFrom(const Message& from);\n\n  // Merge the fields from the given message into this message.  Singular\n  // fields will be overwritten, if specified in from, except for embedded\n  // messages which will be merged.  Repeated fields will be concatenated.\n  // The given message must be of the same type as this message (i.e. the\n  // exact same class).\n  virtual void MergeFrom(const Message& from);\n\n  // Verifies that IsInitialized() returns true.  GOOGLE_CHECK-fails otherwise, with\n  // a nice error message.\n  void CheckInitialized() const;\n\n  // Slowly build a list of all required fields that are not set.\n  // This is much, much slower than IsInitialized() as it is implemented\n  // purely via reflection.  Generally, you should not call this unless you\n  // have already determined that an error exists by calling IsInitialized().\n  void FindInitializationErrors(std::vector<string>* errors) const;\n\n  // Like FindInitializationErrors, but joins all the strings, delimited by\n  // commas, and returns them.\n  string InitializationErrorString() const;\n\n  // Clears all unknown fields from this message and all embedded messages.\n  // Normally, if unknown tag numbers are encountered when parsing a message,\n  // the tag and value are stored in the message's UnknownFieldSet and\n  // then written back out when the message is serialized.  This allows servers\n  // which simply route messages to other servers to pass through messages\n  // that have new field definitions which they don't yet know about.  However,\n  // this behavior can have security implications.  To avoid it, call this\n  // method after parsing.\n  //\n  // See Reflection::GetUnknownFields() for more on unknown fields.\n  virtual void DiscardUnknownFields();\n\n  // Computes (an estimate of) the total number of bytes currently used for\n  // storing the message in memory.  The default implementation calls the\n  // Reflection object's SpaceUsed() method.\n  //\n  // SpaceUsed() is noticeably slower than ByteSize(), as it is implemented\n  // using reflection (rather than the generated code implementation for\n  // ByteSize()). Like ByteSize(), its CPU time is linear in the number of\n  // fields defined for the proto.\n  virtual size_t SpaceUsedLong() const;\n\n  PROTOBUF_RUNTIME_DEPRECATED(\"Please use SpaceUsedLong() instead\")\n  int SpaceUsed() const { return internal::ToIntSize(SpaceUsedLong()); }\n\n  // Debugging & Testing----------------------------------------------\n\n  // Generates a human readable form of this message, useful for debugging\n  // and other purposes.\n  string DebugString() const;\n  // Like DebugString(), but with less whitespace.\n  string ShortDebugString() const;\n  // Like DebugString(), but do not escape UTF-8 byte sequences.\n  string Utf8DebugString() const;\n  // Convenience function useful in GDB.  Prints DebugString() to stdout.\n  void PrintDebugString() const;\n\n  // Heavy I/O -------------------------------------------------------\n  // Additional parsing and serialization methods not implemented by\n  // MessageLite because they are not supported by the lite library.\n\n  // Parse a protocol buffer from a file descriptor.  If successful, the entire\n  // input will be consumed.\n  bool ParseFromFileDescriptor(int file_descriptor);\n  // Like ParseFromFileDescriptor(), but accepts messages that are missing\n  // required fields.\n  bool ParsePartialFromFileDescriptor(int file_descriptor);\n  // Parse a protocol buffer from a C++ istream.  If successful, the entire\n  // input will be consumed.\n  bool ParseFromIstream(std::istream* input);\n  // Like ParseFromIstream(), but accepts messages that are missing\n  // required fields.\n  bool ParsePartialFromIstream(std::istream* input);\n\n  // Serialize the message and write it to the given file descriptor.  All\n  // required fields must be set.\n  bool SerializeToFileDescriptor(int file_descriptor) const;\n  // Like SerializeToFileDescriptor(), but allows missing required fields.\n  bool SerializePartialToFileDescriptor(int file_descriptor) const;\n  // Serialize the message and write it to the given C++ ostream.  All\n  // required fields must be set.\n  bool SerializeToOstream(std::ostream* output) const;\n  // Like SerializeToOstream(), but allows missing required fields.\n  bool SerializePartialToOstream(std::ostream* output) const;\n\n\n  // Reflection-based methods ----------------------------------------\n  // These methods are pure-virtual in MessageLite, but Message provides\n  // reflection-based default implementations.\n\n  virtual string GetTypeName() const;\n  virtual void Clear();\n  virtual bool IsInitialized() const;\n  virtual void CheckTypeAndMergeFrom(const MessageLite& other);\n  virtual bool MergePartialFromCodedStream(io::CodedInputStream* input);\n  virtual size_t ByteSizeLong() const;\n  virtual void SerializeWithCachedSizes(io::CodedOutputStream* output) const;\n\n private:\n  // This is called only by the default implementation of ByteSize(), to\n  // update the cached size.  If you override ByteSize(), you do not need\n  // to override this.  If you do not override ByteSize(), you MUST override\n  // this; the default implementation will crash.\n  //\n  // The method is private because subclasses should never call it; only\n  // override it.  Yes, C++ lets you do that.  Crazy, huh?\n  virtual void SetCachedSize(int size) const;\n\n public:\n\n  // Introspection ---------------------------------------------------\n\n  // Typedef for backwards-compatibility.\n  typedef google::protobuf::Reflection Reflection;\n\n  // Get a non-owning pointer to a Descriptor for this message's type.  This\n  // describes what fields the message contains, the types of those fields, etc.\n  // This object remains property of the Message.\n  const Descriptor* GetDescriptor() const { return GetMetadata().descriptor; }\n\n  // Get a non-owning pointer to the Reflection interface for this Message,\n  // which can be used to read and modify the fields of the Message dynamically\n  // (in other words, without knowing the message type at compile time).  This\n  // object remains property of the Message.\n  //\n  // This method remains virtual in case a subclass does not implement\n  // reflection and wants to override the default behavior.\n  virtual const Reflection* GetReflection() const final {\n    return GetMetadata().reflection;\n  }\n\n protected:\n  // Get a struct containing the metadata for the Message. Most subclasses only\n  // need to implement this method, rather than the GetDescriptor() and\n  // GetReflection() wrappers.\n  virtual Metadata GetMetadata() const  = 0;\n\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Message);\n};\n\nnamespace internal {\n// Forward-declare interfaces used to implement RepeatedFieldRef.\n// These are protobuf internals that users shouldn't care about.\nclass RepeatedFieldAccessor;\n}  // namespace internal\n\n// Forward-declare RepeatedFieldRef templates. The second type parameter is\n// used for SFINAE tricks. Users should ignore it.\ntemplate<typename T, typename Enable = void>\nclass RepeatedFieldRef;\n\ntemplate<typename T, typename Enable = void>\nclass MutableRepeatedFieldRef;\n\n// This interface contains methods that can be used to dynamically access\n// and modify the fields of a protocol message.  Their semantics are\n// similar to the accessors the protocol compiler generates.\n//\n// To get the Reflection for a given Message, call Message::GetReflection().\n//\n// This interface is separate from Message only for efficiency reasons;\n// the vast majority of implementations of Message will share the same\n// implementation of Reflection (GeneratedMessageReflection,\n// defined in generated_message.h), and all Messages of a particular class\n// should share the same Reflection object (though you should not rely on\n// the latter fact).\n//\n// There are several ways that these methods can be used incorrectly.  For\n// example, any of the following conditions will lead to undefined\n// results (probably assertion failures):\n// - The FieldDescriptor is not a field of this message type.\n// - The method called is not appropriate for the field's type.  For\n//   each field type in FieldDescriptor::TYPE_*, there is only one\n//   Get*() method, one Set*() method, and one Add*() method that is\n//   valid for that type.  It should be obvious which (except maybe\n//   for TYPE_BYTES, which are represented using strings in C++).\n// - A Get*() or Set*() method for singular fields is called on a repeated\n//   field.\n// - GetRepeated*(), SetRepeated*(), or Add*() is called on a non-repeated\n//   field.\n// - The Message object passed to any method is not of the right type for\n//   this Reflection object (i.e. message.GetReflection() != reflection).\n//\n// You might wonder why there is not any abstract representation for a field\n// of arbitrary type.  E.g., why isn't there just a \"GetField()\" method that\n// returns \"const Field&\", where \"Field\" is some class with accessors like\n// \"GetInt32Value()\".  The problem is that someone would have to deal with\n// allocating these Field objects.  For generated message classes, having to\n// allocate space for an additional object to wrap every field would at least\n// double the message's memory footprint, probably worse.  Allocating the\n// objects on-demand, on the other hand, would be expensive and prone to\n// memory leaks.  So, instead we ended up with this flat interface.\nclass LIBPROTOBUF_EXPORT Reflection {\n public:\n  inline Reflection() {}\n  virtual ~Reflection();\n\n  // Get the UnknownFieldSet for the message.  This contains fields which\n  // were seen when the Message was parsed but were not recognized according\n  // to the Message's definition. For proto3 protos, this method will always\n  // return an empty UnknownFieldSet.\n  virtual const UnknownFieldSet& GetUnknownFields(\n      const Message& message) const = 0;\n  // Get a mutable pointer to the UnknownFieldSet for the message.  This\n  // contains fields which were seen when the Message was parsed but were not\n  // recognized according to the Message's definition. For proto3 protos, this\n  // method will return a valid mutable UnknownFieldSet pointer but modifying\n  // it won't affect the serialized bytes of the message.\n  virtual UnknownFieldSet* MutableUnknownFields(Message* message) const = 0;\n\n  // Estimate the amount of memory used by the message object.\n  virtual size_t SpaceUsedLong(const Message& message) const = 0;\n\n  PROTOBUF_RUNTIME_DEPRECATED(\"Please use SpaceUsedLong() instead\")\n  int SpaceUsed(const Message& message) const {\n    return internal::ToIntSize(SpaceUsedLong(message));\n  }\n\n  // Check if the given non-repeated field is set.\n  virtual bool HasField(const Message& message,\n                        const FieldDescriptor* field) const = 0;\n\n  // Get the number of elements of a repeated field.\n  virtual int FieldSize(const Message& message,\n                        const FieldDescriptor* field) const = 0;\n\n  // Clear the value of a field, so that HasField() returns false or\n  // FieldSize() returns zero.\n  virtual void ClearField(Message* message,\n                          const FieldDescriptor* field) const = 0;\n\n  // Check if the oneof is set. Returns true if any field in oneof\n  // is set, false otherwise.\n  // TODO(jieluo) - make it pure virtual after updating all\n  // the subclasses.\n  virtual bool HasOneof(const Message& /*message*/,\n                        const OneofDescriptor* /*oneof_descriptor*/) const {\n    return false;\n  }\n\n  virtual void ClearOneof(Message* /*message*/,\n                          const OneofDescriptor* /*oneof_descriptor*/) const {}\n\n  // Returns the field descriptor if the oneof is set. NULL otherwise.\n  // TODO(jieluo) - make it pure virtual.\n  virtual const FieldDescriptor* GetOneofFieldDescriptor(\n      const Message& /*message*/,\n      const OneofDescriptor* /*oneof_descriptor*/) const {\n    return NULL;\n  }\n\n  // Removes the last element of a repeated field.\n  // We don't provide a way to remove any element other than the last\n  // because it invites inefficient use, such as O(n^2) filtering loops\n  // that should have been O(n).  If you want to remove an element other\n  // than the last, the best way to do it is to re-arrange the elements\n  // (using Swap()) so that the one you want removed is at the end, then\n  // call RemoveLast().\n  virtual void RemoveLast(Message* message,\n                          const FieldDescriptor* field) const = 0;\n  // Removes the last element of a repeated message field, and returns the\n  // pointer to the caller.  Caller takes ownership of the returned pointer.\n  virtual Message* ReleaseLast(Message* message,\n                               const FieldDescriptor* field) const = 0;\n\n  // Swap the complete contents of two messages.\n  virtual void Swap(Message* message1, Message* message2) const = 0;\n\n  // Swap fields listed in fields vector of two messages.\n  virtual void SwapFields(Message* message1,\n                          Message* message2,\n                          const std::vector<const FieldDescriptor*>& fields)\n      const = 0;\n\n  // Swap two elements of a repeated field.\n  virtual void SwapElements(Message* message,\n                            const FieldDescriptor* field,\n                            int index1,\n                            int index2) const = 0;\n\n  // List all fields of the message which are currently set, except for unknown\n  // fields, but including extension known to the parser (i.e. compiled in).\n  // Singular fields will only be listed if HasField(field) would return true\n  // and repeated fields will only be listed if FieldSize(field) would return\n  // non-zero.  Fields (both normal fields and extension fields) will be listed\n  // ordered by field number.\n  // Use Reflection::GetUnknownFields() or message.unknown_fields() to also get\n  // access to fields/extensions unknown to the parser.\n  virtual void ListFields(\n      const Message& message,\n      std::vector<const FieldDescriptor*>* output) const = 0;\n\n  // Singular field getters ------------------------------------------\n  // These get the value of a non-repeated field.  They return the default\n  // value for fields that aren't set.\n\n  virtual int32  GetInt32 (const Message& message,\n                           const FieldDescriptor* field) const = 0;\n  virtual int64  GetInt64 (const Message& message,\n                           const FieldDescriptor* field) const = 0;\n  virtual uint32 GetUInt32(const Message& message,\n                           const FieldDescriptor* field) const = 0;\n  virtual uint64 GetUInt64(const Message& message,\n                           const FieldDescriptor* field) const = 0;\n  virtual float  GetFloat (const Message& message,\n                           const FieldDescriptor* field) const = 0;\n  virtual double GetDouble(const Message& message,\n                           const FieldDescriptor* field) const = 0;\n  virtual bool   GetBool  (const Message& message,\n                           const FieldDescriptor* field) const = 0;\n  virtual string GetString(const Message& message,\n                           const FieldDescriptor* field) const = 0;\n  virtual const EnumValueDescriptor* GetEnum(\n      const Message& message, const FieldDescriptor* field) const = 0;\n\n  // GetEnumValue() returns an enum field's value as an integer rather than\n  // an EnumValueDescriptor*. If the integer value does not correspond to a\n  // known value descriptor, a new value descriptor is created. (Such a value\n  // will only be present when the new unknown-enum-value semantics are enabled\n  // for a message.)\n  virtual int GetEnumValue(\n      const Message& message, const FieldDescriptor* field) const = 0;\n\n  // See MutableMessage() for the meaning of the \"factory\" parameter.\n  virtual const Message& GetMessage(const Message& message,\n                                    const FieldDescriptor* field,\n                                    MessageFactory* factory = NULL) const = 0;\n\n  // Get a string value without copying, if possible.\n  //\n  // GetString() necessarily returns a copy of the string.  This can be\n  // inefficient when the string is already stored in a string object in the\n  // underlying message.  GetStringReference() will return a reference to the\n  // underlying string in this case.  Otherwise, it will copy the string into\n  // *scratch and return that.\n  //\n  // Note:  It is perfectly reasonable and useful to write code like:\n  //     str = reflection->GetStringReference(field, &str);\n  //   This line would ensure that only one copy of the string is made\n  //   regardless of the field's underlying representation.  When initializing\n  //   a newly-constructed string, though, it's just as fast and more readable\n  //   to use code like:\n  //     string str = reflection->GetString(message, field);\n  virtual const string& GetStringReference(const Message& message,\n                                           const FieldDescriptor* field,\n                                           string* scratch) const = 0;\n\n\n  // Singular field mutators -----------------------------------------\n  // These mutate the value of a non-repeated field.\n\n  virtual void SetInt32 (Message* message,\n                         const FieldDescriptor* field, int32  value) const = 0;\n  virtual void SetInt64 (Message* message,\n                         const FieldDescriptor* field, int64  value) const = 0;\n  virtual void SetUInt32(Message* message,\n                         const FieldDescriptor* field, uint32 value) const = 0;\n  virtual void SetUInt64(Message* message,\n                         const FieldDescriptor* field, uint64 value) const = 0;\n  virtual void SetFloat (Message* message,\n                         const FieldDescriptor* field, float  value) const = 0;\n  virtual void SetDouble(Message* message,\n                         const FieldDescriptor* field, double value) const = 0;\n  virtual void SetBool  (Message* message,\n                         const FieldDescriptor* field, bool   value) const = 0;\n  virtual void SetString(Message* message,\n                         const FieldDescriptor* field,\n                         const string& value) const = 0;\n  virtual void SetEnum  (Message* message,\n                         const FieldDescriptor* field,\n                         const EnumValueDescriptor* value) const = 0;\n  // Set an enum field's value with an integer rather than EnumValueDescriptor.\n  // If the value does not correspond to a known enum value, either behavior is\n  // undefined (for proto2 messages), or the value is accepted silently for\n  // messages with new unknown-enum-value semantics.\n  virtual void SetEnumValue(Message* message,\n                            const FieldDescriptor* field,\n                            int value) const = 0;\n\n  // Get a mutable pointer to a field with a message type.  If a MessageFactory\n  // is provided, it will be used to construct instances of the sub-message;\n  // otherwise, the default factory is used.  If the field is an extension that\n  // does not live in the same pool as the containing message's descriptor (e.g.\n  // it lives in an overlay pool), then a MessageFactory must be provided.\n  // If you have no idea what that meant, then you probably don't need to worry\n  // about it (don't provide a MessageFactory).  WARNING:  If the\n  // FieldDescriptor is for a compiled-in extension, then\n  // factory->GetPrototype(field->message_type()) MUST return an instance of\n  // the compiled-in class for this type, NOT DynamicMessage.\n  virtual Message* MutableMessage(Message* message,\n                                  const FieldDescriptor* field,\n                                  MessageFactory* factory = NULL) const = 0;\n  // Replaces the message specified by 'field' with the already-allocated object\n  // sub_message, passing ownership to the message.  If the field contained a\n  // message, that message is deleted.  If sub_message is NULL, the field is\n  // cleared.\n  virtual void SetAllocatedMessage(Message* message,\n                                   Message* sub_message,\n                                   const FieldDescriptor* field) const = 0;\n  // Releases the message specified by 'field' and returns the pointer,\n  // ReleaseMessage() will return the message the message object if it exists.\n  // Otherwise, it may or may not return NULL.  In any case, if the return value\n  // is non-NULL, the caller takes ownership of the pointer.\n  // If the field existed (HasField() is true), then the returned pointer will\n  // be the same as the pointer returned by MutableMessage().\n  // This function has the same effect as ClearField().\n  virtual Message* ReleaseMessage(Message* message,\n                                  const FieldDescriptor* field,\n                                  MessageFactory* factory = NULL) const = 0;\n\n\n  // Repeated field getters ------------------------------------------\n  // These get the value of one element of a repeated field.\n\n  virtual int32  GetRepeatedInt32 (const Message& message,\n                                   const FieldDescriptor* field,\n                                   int index) const = 0;\n  virtual int64  GetRepeatedInt64 (const Message& message,\n                                   const FieldDescriptor* field,\n                                   int index) const = 0;\n  virtual uint32 GetRepeatedUInt32(const Message& message,\n                                   const FieldDescriptor* field,\n                                   int index) const = 0;\n  virtual uint64 GetRepeatedUInt64(const Message& message,\n                                   const FieldDescriptor* field,\n                                   int index) const = 0;\n  virtual float  GetRepeatedFloat (const Message& message,\n                                   const FieldDescriptor* field,\n                                   int index) const = 0;\n  virtual double GetRepeatedDouble(const Message& message,\n                                   const FieldDescriptor* field,\n                                   int index) const = 0;\n  virtual bool   GetRepeatedBool  (const Message& message,\n                                   const FieldDescriptor* field,\n                                   int index) const = 0;\n  virtual string GetRepeatedString(const Message& message,\n                                   const FieldDescriptor* field,\n                                   int index) const = 0;\n  virtual const EnumValueDescriptor* GetRepeatedEnum(\n      const Message& message,\n      const FieldDescriptor* field, int index) const = 0;\n  // GetRepeatedEnumValue() returns an enum field's value as an integer rather\n  // than an EnumValueDescriptor*. If the integer value does not correspond to a\n  // known value descriptor, a new value descriptor is created. (Such a value\n  // will only be present when the new unknown-enum-value semantics are enabled\n  // for a message.)\n  virtual int GetRepeatedEnumValue(\n      const Message& message,\n      const FieldDescriptor* field, int index) const = 0;\n  virtual const Message& GetRepeatedMessage(\n      const Message& message,\n      const FieldDescriptor* field, int index) const = 0;\n\n  // See GetStringReference(), above.\n  virtual const string& GetRepeatedStringReference(\n      const Message& message, const FieldDescriptor* field,\n      int index, string* scratch) const = 0;\n\n\n  // Repeated field mutators -----------------------------------------\n  // These mutate the value of one element of a repeated field.\n\n  virtual void SetRepeatedInt32 (Message* message,\n                                 const FieldDescriptor* field,\n                                 int index, int32  value) const = 0;\n  virtual void SetRepeatedInt64 (Message* message,\n                                 const FieldDescriptor* field,\n                                 int index, int64  value) const = 0;\n  virtual void SetRepeatedUInt32(Message* message,\n                                 const FieldDescriptor* field,\n                                 int index, uint32 value) const = 0;\n  virtual void SetRepeatedUInt64(Message* message,\n                                 const FieldDescriptor* field,\n                                 int index, uint64 value) const = 0;\n  virtual void SetRepeatedFloat (Message* message,\n                                 const FieldDescriptor* field,\n                                 int index, float  value) const = 0;\n  virtual void SetRepeatedDouble(Message* message,\n                                 const FieldDescriptor* field,\n                                 int index, double value) const = 0;\n  virtual void SetRepeatedBool  (Message* message,\n                                 const FieldDescriptor* field,\n                                 int index, bool   value) const = 0;\n  virtual void SetRepeatedString(Message* message,\n                                 const FieldDescriptor* field,\n                                 int index, const string& value) const = 0;\n  virtual void SetRepeatedEnum(Message* message,\n                               const FieldDescriptor* field, int index,\n                               const EnumValueDescriptor* value) const = 0;\n  // Set an enum field's value with an integer rather than EnumValueDescriptor.\n  // If the value does not correspond to a known enum value, either behavior is\n  // undefined (for proto2 messages), or the value is accepted silently for\n  // messages with new unknown-enum-value semantics.\n  virtual void SetRepeatedEnumValue(Message* message,\n                                    const FieldDescriptor* field, int index,\n                                    int value) const = 0;\n  // Get a mutable pointer to an element of a repeated field with a message\n  // type.\n  virtual Message* MutableRepeatedMessage(\n      Message* message, const FieldDescriptor* field, int index) const = 0;\n\n\n  // Repeated field adders -------------------------------------------\n  // These add an element to a repeated field.\n\n  virtual void AddInt32 (Message* message,\n                         const FieldDescriptor* field, int32  value) const = 0;\n  virtual void AddInt64 (Message* message,\n                         const FieldDescriptor* field, int64  value) const = 0;\n  virtual void AddUInt32(Message* message,\n                         const FieldDescriptor* field, uint32 value) const = 0;\n  virtual void AddUInt64(Message* message,\n                         const FieldDescriptor* field, uint64 value) const = 0;\n  virtual void AddFloat (Message* message,\n                         const FieldDescriptor* field, float  value) const = 0;\n  virtual void AddDouble(Message* message,\n                         const FieldDescriptor* field, double value) const = 0;\n  virtual void AddBool  (Message* message,\n                         const FieldDescriptor* field, bool   value) const = 0;\n  virtual void AddString(Message* message,\n                         const FieldDescriptor* field,\n                         const string& value) const = 0;\n  virtual void AddEnum  (Message* message,\n                         const FieldDescriptor* field,\n                         const EnumValueDescriptor* value) const = 0;\n  // Set an enum field's value with an integer rather than EnumValueDescriptor.\n  // If the value does not correspond to a known enum value, either behavior is\n  // undefined (for proto2 messages), or the value is accepted silently for\n  // messages with new unknown-enum-value semantics.\n  virtual void AddEnumValue(Message* message,\n                            const FieldDescriptor* field,\n                            int value) const = 0;\n  // See MutableMessage() for comments on the \"factory\" parameter.\n  virtual Message* AddMessage(Message* message,\n                              const FieldDescriptor* field,\n                              MessageFactory* factory = NULL) const = 0;\n\n  // Appends an already-allocated object 'new_entry' to the repeated field\n  // specifyed by 'field' passing ownership to the message.\n  // TODO(tmarek): Make virtual after all subclasses have been\n  // updated.\n  virtual void AddAllocatedMessage(Message* message,\n                                   const FieldDescriptor* field,\n                                   Message* new_entry) const;\n\n\n  // Get a RepeatedFieldRef object that can be used to read the underlying\n  // repeated field. The type parameter T must be set according to the\n  // field's cpp type. The following table shows the mapping from cpp type\n  // to acceptable T.\n  //\n  //   field->cpp_type()      T\n  //   CPPTYPE_INT32        int32\n  //   CPPTYPE_UINT32       uint32\n  //   CPPTYPE_INT64        int64\n  //   CPPTYPE_UINT64       uint64\n  //   CPPTYPE_DOUBLE       double\n  //   CPPTYPE_FLOAT        float\n  //   CPPTYPE_BOOL         bool\n  //   CPPTYPE_ENUM         generated enum type or int32\n  //   CPPTYPE_STRING       string\n  //   CPPTYPE_MESSAGE      generated message type or google::protobuf::Message\n  //\n  // A RepeatedFieldRef object can be copied and the resulted object will point\n  // to the same repeated field in the same message. The object can be used as\n  // long as the message is not destroyed.\n  //\n  // Note that to use this method users need to include the header file\n  // \"google/protobuf/reflection.h\" (which defines the RepeatedFieldRef\n  // class templates).\n  template<typename T>\n  RepeatedFieldRef<T> GetRepeatedFieldRef(\n      const Message& message, const FieldDescriptor* field) const;\n\n  // Like GetRepeatedFieldRef() but return an object that can also be used\n  // manipulate the underlying repeated field.\n  template<typename T>\n  MutableRepeatedFieldRef<T> GetMutableRepeatedFieldRef(\n      Message* message, const FieldDescriptor* field) const;\n\n  // DEPRECATED. Please use Get(Mutable)RepeatedFieldRef() for repeated field\n  // access. The following repeated field accesors will be removed in the\n  // future.\n  //\n  // Repeated field accessors  -------------------------------------------------\n  // The methods above, e.g. GetRepeatedInt32(msg, fd, index), provide singular\n  // access to the data in a RepeatedField.  The methods below provide aggregate\n  // access by exposing the RepeatedField object itself with the Message.\n  // Applying these templates to inappropriate types will lead to an undefined\n  // reference at link time (e.g. GetRepeatedField<***double>), or possibly a\n  // template matching error at compile time (e.g. GetRepeatedPtrField<File>).\n  //\n  // Usage example: my_doubs = refl->GetRepeatedField<double>(msg, fd);\n\n  // DEPRECATED. Please use GetRepeatedFieldRef().\n  //\n  // for T = Cord and all protobuf scalar types except enums.\n  template<typename T>\n  PROTOBUF_RUNTIME_DEPRECATED(\"Please use GetRepeatedFieldRef() instead\")\n  const RepeatedField<T>& GetRepeatedField(\n      const Message&, const FieldDescriptor*) const;\n\n  // DEPRECATED. Please use GetMutableRepeatedFieldRef().\n  //\n  // for T = Cord and all protobuf scalar types except enums.\n  template<typename T>\n  PROTOBUF_RUNTIME_DEPRECATED(\"Please use GetMutableRepeatedFieldRef() instead\")\n  RepeatedField<T>* MutableRepeatedField(\n      Message*, const FieldDescriptor*) const;\n\n  // DEPRECATED. Please use GetRepeatedFieldRef().\n  //\n  // for T = string, google::protobuf::internal::StringPieceField\n  //         google::protobuf::Message & descendants.\n  template<typename T>\n  PROTOBUF_RUNTIME_DEPRECATED(\"Please use GetRepeatedFieldRef() instead\")\n  const RepeatedPtrField<T>& GetRepeatedPtrField(\n      const Message&, const FieldDescriptor*) const;\n\n  // DEPRECATED. Please use GetMutableRepeatedFieldRef().\n  //\n  // for T = string, google::protobuf::internal::StringPieceField\n  //         google::protobuf::Message & descendants.\n  template<typename T>\n  PROTOBUF_RUNTIME_DEPRECATED(\"Please use GetMutableRepeatedFieldRef() instead\")\n  RepeatedPtrField<T>* MutableRepeatedPtrField(\n      Message*, const FieldDescriptor*) const;\n\n  // Extensions ----------------------------------------------------------------\n\n  // Try to find an extension of this message type by fully-qualified field\n  // name.  Returns NULL if no extension is known for this name or number.\n  virtual const FieldDescriptor* FindKnownExtensionByName(\n      const string& name) const = 0;\n\n  // Try to find an extension of this message type by field number.\n  // Returns NULL if no extension is known for this name or number.\n  virtual const FieldDescriptor* FindKnownExtensionByNumber(\n      int number) const = 0;\n\n  // Feature Flags -------------------------------------------------------------\n\n  // Does this message support storing arbitrary integer values in enum fields?\n  // If |true|, GetEnumValue/SetEnumValue and associated repeated-field versions\n  // take arbitrary integer values, and the legacy GetEnum() getter will\n  // dynamically create an EnumValueDescriptor for any integer value without\n  // one. If |false|, setting an unknown enum value via the integer-based\n  // setters results in undefined behavior (in practice, GOOGLE_DCHECK-fails).\n  //\n  // Generic code that uses reflection to handle messages with enum fields\n  // should check this flag before using the integer-based setter, and either\n  // downgrade to a compatible value or use the UnknownFieldSet if not. For\n  // example:\n  //\n  //   int new_value = GetValueFromApplicationLogic();\n  //   if (reflection->SupportsUnknownEnumValues()) {\n  //     reflection->SetEnumValue(message, field, new_value);\n  //   } else {\n  //     if (field_descriptor->enum_type()->\n  //             FindValueByNumber(new_value) != NULL) {\n  //       reflection->SetEnumValue(message, field, new_value);\n  //     } else if (emit_unknown_enum_values) {\n  //       reflection->MutableUnknownFields(message)->AddVarint(\n  //           field->number(), new_value);\n  //     } else {\n  //       // convert value to a compatible/default value.\n  //       new_value = CompatibleDowngrade(new_value);\n  //       reflection->SetEnumValue(message, field, new_value);\n  //     }\n  //   }\n  virtual bool SupportsUnknownEnumValues() const { return false; }\n\n  // Returns the MessageFactory associated with this message.  This can be\n  // useful for determining if a message is a generated message or not, for\n  // example:\n  //   if (message->GetReflection()->GetMessageFactory() ==\n  //       google::protobuf::MessageFactory::generated_factory()) {\n  //     // This is a generated message.\n  //   }\n  // It can also be used to create more messages of this type, though\n  // Message::New() is an easier way to accomplish this.\n  virtual MessageFactory* GetMessageFactory() const;\n\n  // ---------------------------------------------------------------------------\n\n protected:\n  // Obtain a pointer to a Repeated Field Structure and do some type checking:\n  //   on field->cpp_type(),\n  //   on field->field_option().ctype() (if ctype >= 0)\n  //   of field->message_type() (if message_type != NULL).\n  // We use 2 routine rather than 4 (const vs mutable) x (scalar vs pointer).\n  virtual void* MutableRawRepeatedField(\n      Message* message, const FieldDescriptor* field, FieldDescriptor::CppType,\n      int ctype, const Descriptor* message_type) const = 0;\n\n  // TODO(jieluo) - make it pure virtual after updating all the subclasses.\n  virtual const void* GetRawRepeatedField(\n      const Message& message, const FieldDescriptor* field,\n      FieldDescriptor::CppType cpptype, int ctype,\n      const Descriptor* message_type) const {\n    return MutableRawRepeatedField(\n        const_cast<Message*>(&message), field, cpptype, ctype, message_type);\n  }\n\n  // The following methods are used to implement (Mutable)RepeatedFieldRef.\n  // A Ref object will store a raw pointer to the repeated field data (obtained\n  // from RepeatedFieldData()) and a pointer to a Accessor (obtained from\n  // RepeatedFieldAccessor) which will be used to access the raw data.\n  //\n  // TODO(xiaofeng): Make these methods pure-virtual.\n\n  // Returns a raw pointer to the repeated field\n  //\n  // \"cpp_type\" and \"message_type\" are deduced from the type parameter T passed\n  // to Get(Mutable)RepeatedFieldRef. If T is a generated message type,\n  // \"message_type\" should be set to its descriptor. Otherwise \"message_type\"\n  // should be set to NULL. Implementations of this method should check whether\n  // \"cpp_type\"/\"message_type\" is consistent with the actual type of the field.\n  // We use 1 routine rather than 2 (const vs mutable) because it is protected\n  // and it doesn't change the message.\n  virtual void* RepeatedFieldData(\n      Message* message, const FieldDescriptor* field,\n      FieldDescriptor::CppType cpp_type,\n      const Descriptor* message_type) const;\n\n  // The returned pointer should point to a singleton instance which implements\n  // the RepeatedFieldAccessor interface.\n  virtual const internal::RepeatedFieldAccessor* RepeatedFieldAccessor(\n      const FieldDescriptor* field) const;\n\n private:\n  template<typename T, typename Enable>\n  friend class RepeatedFieldRef;\n  template<typename T, typename Enable>\n  friend class MutableRepeatedFieldRef;\n  friend class ::google::protobuf::python::MapReflectionFriend;\n#define GOOGLE_PROTOBUF_HAS_CEL_MAP_REFLECTION_FRIEND\n  friend class ::google::protobuf::expr::CelMapReflectionFriend;\n  friend class internal::MapFieldReflectionTest;\n  friend class internal::MapKeySorter;\n  friend class internal::WireFormat;\n  friend class internal::ReflectionOps;\n\n  // Special version for specialized implementations of string.  We can't call\n  // MutableRawRepeatedField directly here because we don't have access to\n  // FieldOptions::* which are defined in descriptor.pb.h.  Including that\n  // file here is not possible because it would cause a circular include cycle.\n  // We use 1 routine rather than 2 (const vs mutable) because it is private\n  // and mutable a repeated string field doesn't change the message.\n  void* MutableRawRepeatedString(\n      Message* message, const FieldDescriptor* field, bool is_string) const;\n\n  friend class MapReflectionTester;\n  // TODO(jieluo) - make the map APIs pure virtual after updating\n  // all the subclasses.\n  // Returns true if key is in map. Returns false if key is not in map field.\n  virtual bool ContainsMapKey(const Message& /* message */,\n                              const FieldDescriptor* /* field */,\n                              const MapKey& /* key */) const {\n    return false;\n  }\n\n  // If key is in map field: Saves the value pointer to val and returns\n  // false. If key in not in map field: Insert the key into map, saves\n  // value pointer to val and retuns true.\n  virtual bool InsertOrLookupMapValue(Message* /* message */,\n                                      const FieldDescriptor* /* field */,\n                                      const MapKey& /* key */,\n                                      MapValueRef* /* val */) const {\n    return false;\n  }\n\n  // Delete and returns true if key is in the map field. Returns false\n  // otherwise.\n  virtual bool DeleteMapValue(Message* /* message */,\n                              const FieldDescriptor* /* field */,\n                              const MapKey& /* key */) const {\n    return false;\n  }\n\n  // Returns a MapIterator referring to the first element in the map field.\n  // If the map field is empty, this function returns the same as\n  // reflection::MapEnd. Mutation to the field may invalidate the iterator.\n  virtual MapIterator MapBegin(\n      Message* message,\n      const FieldDescriptor* field) const;\n\n  // Returns a MapIterator referring to the theoretical element that would\n  // follow the last element in the map field. It does not point to any\n  // real element. Mutation to the field may invalidate the iterator.\n  virtual MapIterator MapEnd(\n      Message* message,\n      const FieldDescriptor* field) const;\n\n  // Get the number of <key, value> pair of a map field. The result may be\n  // different from FieldSize which can have duplicate keys.\n  virtual int MapSize(const Message& /* message */,\n                      const FieldDescriptor* /* field */) const {\n    return 0;\n  }\n\n  // Help method for MapIterator.\n  friend class MapIterator;\n  virtual internal::MapFieldBase* MapData(\n      Message* /* message */, const FieldDescriptor* /* field */) const {\n    return NULL;\n  }\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Reflection);\n};\n\n// Abstract interface for a factory for message objects.\nclass LIBPROTOBUF_EXPORT MessageFactory {\n public:\n  inline MessageFactory() {}\n  virtual ~MessageFactory();\n\n  // Given a Descriptor, gets or constructs the default (prototype) Message\n  // of that type.  You can then call that message's New() method to construct\n  // a mutable message of that type.\n  //\n  // Calling this method twice with the same Descriptor returns the same\n  // object.  The returned object remains property of the factory.  Also, any\n  // objects created by calling the prototype's New() method share some data\n  // with the prototype, so these must be destroyed before the MessageFactory\n  // is destroyed.\n  //\n  // The given descriptor must outlive the returned message, and hence must\n  // outlive the MessageFactory.\n  //\n  // Some implementations do not support all types.  GetPrototype() will\n  // return NULL if the descriptor passed in is not supported.\n  //\n  // This method may or may not be thread-safe depending on the implementation.\n  // Each implementation should document its own degree thread-safety.\n  virtual const Message* GetPrototype(const Descriptor* type) = 0;\n\n  // Gets a MessageFactory which supports all generated, compiled-in messages.\n  // In other words, for any compiled-in type FooMessage, the following is true:\n  //   MessageFactory::generated_factory()->GetPrototype(\n  //     FooMessage::descriptor()) == FooMessage::default_instance()\n  // This factory supports all types which are found in\n  // DescriptorPool::generated_pool().  If given a descriptor from any other\n  // pool, GetPrototype() will return NULL.  (You can also check if a\n  // descriptor is for a generated message by checking if\n  // descriptor->file()->pool() == DescriptorPool::generated_pool().)\n  //\n  // This factory is 100% thread-safe; calling GetPrototype() does not modify\n  // any shared data.\n  //\n  // This factory is a singleton.  The caller must not delete the object.\n  static MessageFactory* generated_factory();\n\n  // For internal use only:  Registers a .proto file at static initialization\n  // time, to be placed in generated_factory.  The first time GetPrototype()\n  // is called with a descriptor from this file, |register_messages| will be\n  // called, with the file name as the parameter.  It must call\n  // InternalRegisterGeneratedMessage() (below) to register each message type\n  // in the file.  This strange mechanism is necessary because descriptors are\n  // built lazily, so we can't register types by their descriptor until we\n  // know that the descriptor exists.  |filename| must be a permanent string.\n  static void InternalRegisterGeneratedFile(\n      const char* filename, void (*register_messages)(const string&));\n\n  // For internal use only:  Registers a message type.  Called only by the\n  // functions which are registered with InternalRegisterGeneratedFile(),\n  // above.\n  static void InternalRegisterGeneratedMessage(const Descriptor* descriptor,\n                                               const Message* prototype);\n\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFactory);\n};\n\n#define DECLARE_GET_REPEATED_FIELD(TYPE)                         \\\ntemplate<>                                                       \\\nLIBPROTOBUF_EXPORT                                               \\\nconst RepeatedField<TYPE>& Reflection::GetRepeatedField<TYPE>(   \\\n    const Message& message, const FieldDescriptor* field) const; \\\n                                                                 \\\ntemplate<>                                                       \\\nLIBPROTOBUF_EXPORT                                               \\\nRepeatedField<TYPE>* Reflection::MutableRepeatedField<TYPE>(     \\\n    Message* message, const FieldDescriptor* field) const;\n\nDECLARE_GET_REPEATED_FIELD(int32)\nDECLARE_GET_REPEATED_FIELD(int64)\nDECLARE_GET_REPEATED_FIELD(uint32)\nDECLARE_GET_REPEATED_FIELD(uint64)\nDECLARE_GET_REPEATED_FIELD(float)\nDECLARE_GET_REPEATED_FIELD(double)\nDECLARE_GET_REPEATED_FIELD(bool)\n\n#undef DECLARE_GET_REPEATED_FIELD\n\n// =============================================================================\n// Implementation details for {Get,Mutable}RawRepeatedPtrField.  We provide\n// specializations for <string>, <StringPieceField> and <Message> and handle\n// everything else with the default template which will match any type having\n// a method with signature \"static const google::protobuf::Descriptor* descriptor()\".\n// Such a type presumably is a descendant of google::protobuf::Message.\n\ntemplate<>\ninline const RepeatedPtrField<string>& Reflection::GetRepeatedPtrField<string>(\n    const Message& message, const FieldDescriptor* field) const {\n  return *static_cast<RepeatedPtrField<string>* >(\n      MutableRawRepeatedString(const_cast<Message*>(&message), field, true));\n}\n\ntemplate<>\ninline RepeatedPtrField<string>* Reflection::MutableRepeatedPtrField<string>(\n    Message* message, const FieldDescriptor* field) const {\n  return static_cast<RepeatedPtrField<string>* >(\n      MutableRawRepeatedString(message, field, true));\n}\n\n\n// -----\n\ntemplate<>\ninline const RepeatedPtrField<Message>& Reflection::GetRepeatedPtrField(\n    const Message& message, const FieldDescriptor* field) const {\n  return *static_cast<const RepeatedPtrField<Message>* >(\n      GetRawRepeatedField(message, field, FieldDescriptor::CPPTYPE_MESSAGE,\n                          -1, NULL));\n}\n\ntemplate<>\ninline RepeatedPtrField<Message>* Reflection::MutableRepeatedPtrField(\n    Message* message, const FieldDescriptor* field) const {\n  return static_cast<RepeatedPtrField<Message>* >(\n      MutableRawRepeatedField(message, field,\n          FieldDescriptor::CPPTYPE_MESSAGE, -1,\n          NULL));\n}\n\ntemplate<typename PB>\ninline const RepeatedPtrField<PB>& Reflection::GetRepeatedPtrField(\n    const Message& message, const FieldDescriptor* field) const {\n  return *static_cast<const RepeatedPtrField<PB>* >(\n      GetRawRepeatedField(message, field, FieldDescriptor::CPPTYPE_MESSAGE,\n                          -1, PB::default_instance().GetDescriptor()));\n}\n\ntemplate<typename PB>\ninline RepeatedPtrField<PB>* Reflection::MutableRepeatedPtrField(\n    Message* message, const FieldDescriptor* field) const {\n  return static_cast<RepeatedPtrField<PB>* >(\n      MutableRawRepeatedField(message, field,\n          FieldDescriptor::CPPTYPE_MESSAGE, -1,\n          PB::default_instance().GetDescriptor()));\n}\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_MESSAGE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/message_lite.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Authors: wink@google.com (Wink Saville),\n//          kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Defines MessageLite, the abstract interface implemented by all (lite\n// and non-lite) protocol message objects.\n\n#ifndef GOOGLE_PROTOBUF_MESSAGE_LITE_H__\n#define GOOGLE_PROTOBUF_MESSAGE_LITE_H__\n\n#include <climits>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/logging.h>\n#include <google/protobuf/stubs/once.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/stubs/port.h>\n\nnamespace google {\nnamespace protobuf {\ntemplate <typename T>\nclass RepeatedPtrField;\nnamespace io {\nclass CodedInputStream;\nclass CodedOutputStream;\nclass ZeroCopyInputStream;\nclass ZeroCopyOutputStream;\n}\nnamespace internal {\n\nclass RepeatedPtrFieldBase;\nclass WireFormatLite;\nclass WeakFieldMap;\n\n#ifndef SWIG\n// We compute sizes as size_t but cache them as int.  This function converts a\n// computed size to a cached size.  Since we don't proceed with serialization\n// if the total size was > INT_MAX, it is not important what this function\n// returns for inputs > INT_MAX.  However this case should not error or\n// GOOGLE_CHECK-fail, because the full size_t resolution is still returned from\n// ByteSizeLong() and checked against INT_MAX; we can catch the overflow\n// there.\ninline int ToCachedSize(size_t size) { return static_cast<int>(size); }\n\n// We mainly calculate sizes in terms of size_t, but some functions that\n// compute sizes return \"int\".  These int sizes are expected to always be\n// positive. This function is more efficient than casting an int to size_t\n// directly on 64-bit platforms because it avoids making the compiler emit a\n// sign extending instruction, which we don't want and don't want to pay for.\ninline size_t FromIntSize(int size) {\n  // Convert to unsigned before widening so sign extension is not necessary.\n  return static_cast<unsigned int>(size);\n}\n\n// For cases where a legacy function returns an integer size.  We GOOGLE_DCHECK()\n// that the conversion will fit within an integer; if this is false then we\n// are losing information.\ninline int ToIntSize(size_t size) {\n  GOOGLE_DCHECK_LE(size, static_cast<size_t>(INT_MAX));\n  return static_cast<int>(size);\n}\n\n// This type wraps a variable whose constructor and destructor are explicitly\n// called. It is particularly useful for a global variable, without its\n// constructor and destructor run on start and end of the program lifetime.\n// This circumvents the initial construction order fiasco, while keeping\n// the address of the empty string a compile time constant.\n//\n// Pay special attention to the initialization state of the object.\n// 1. The object is \"uninitialized\" to begin with.\n// 2. Call DefaultConstruct() only if the object is uninitialized.\n//    After the call, the object becomes \"initialized\".\n// 3. Call get() and get_mutable() only if the object is initialized.\n// 4. Call Destruct() only if the object is initialized.\n//    After the call, the object becomes uninitialized.\ntemplate <typename T>\nclass ExplicitlyConstructed {\n public:\n  void DefaultConstruct() {\n    new (&union_) T();\n  }\n\n  void Destruct() {\n    get_mutable()->~T();\n  }\n\n  constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }\n  T* get_mutable() { return reinterpret_cast<T*>(&union_); }\n\n private:\n  // Prefer c++14 aligned_storage, but for compatibility this will do.\n  union AlignedUnion {\n    char space[sizeof(T)];\n    int64 align_to_int64;\n    void* align_to_ptr;\n  } union_;\n};\n\n// Default empty string object. Don't use this directly. Instead, call\n// GetEmptyString() to get the reference.\nLIBPROTOBUF_EXPORT extern ExplicitlyConstructed<::std::string> fixed_address_empty_string;\n\nLIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyStringAlreadyInited() {\n  return fixed_address_empty_string.get();\n}\n\nLIBPROTOBUF_EXPORT size_t StringSpaceUsedExcludingSelfLong(const string& str);\n#endif  // SWIG\n}  // namespace internal\n\n// Interface to light weight protocol messages.\n//\n// This interface is implemented by all protocol message objects.  Non-lite\n// messages additionally implement the Message interface, which is a\n// subclass of MessageLite.  Use MessageLite instead when you only need\n// the subset of features which it supports -- namely, nothing that uses\n// descriptors or reflection.  You can instruct the protocol compiler\n// to generate classes which implement only MessageLite, not the full\n// Message interface, by adding the following line to the .proto file:\n//\n//   option optimize_for = LITE_RUNTIME;\n//\n// This is particularly useful on resource-constrained systems where\n// the full protocol buffers runtime library is too big.\n//\n// Note that on non-constrained systems (e.g. servers) when you need\n// to link in lots of protocol definitions, a better way to reduce\n// total code footprint is to use optimize_for = CODE_SIZE.  This\n// will make the generated code smaller while still supporting all the\n// same features (at the expense of speed).  optimize_for = LITE_RUNTIME\n// is best when you only have a small number of message types linked\n// into your binary, in which case the size of the protocol buffers\n// runtime itself is the biggest problem.\nclass LIBPROTOBUF_EXPORT MessageLite {\n public:\n  inline MessageLite() {}\n  virtual ~MessageLite() {}\n\n  // Basic Operations ------------------------------------------------\n\n  // Get the name of this message type, e.g. \"foo.bar.BazProto\".\n  virtual string GetTypeName() const = 0;\n\n  // Construct a new instance of the same type.  Ownership is passed to the\n  // caller.\n  virtual MessageLite* New() const = 0;\n\n  // Construct a new instance on the arena. Ownership is passed to the caller\n  // if arena is a NULL. Default implementation for backwards compatibility.\n  virtual MessageLite* New(::google::protobuf::Arena* arena) const;\n\n  // Get the arena, if any, associated with this message. Virtual method\n  // required for generic operations but most arena-related operations should\n  // use the GetArenaNoVirtual() generated-code method. Default implementation\n  // to reduce code size by avoiding the need for per-type implementations\n  // when types do not implement arena support.\n  virtual ::google::protobuf::Arena* GetArena() const { return NULL; }\n\n  // Get a pointer that may be equal to this message's arena, or may not be.\n  // If the value returned by this method is equal to some arena pointer, then\n  // this message is on that arena; however, if this message is on some arena,\n  // this method may or may not return that arena's pointer. As a tradeoff,\n  // this method may be more efficient than GetArena(). The intent is to allow\n  // underlying representations that use e.g. tagged pointers to sometimes\n  // store the arena pointer directly, and sometimes in a more indirect way,\n  // and allow a fastpath comparison against the arena pointer when it's easy\n  // to obtain.\n  virtual void* GetMaybeArenaPointer() const { return GetArena(); }\n\n  // Clear all fields of the message and set them to their default values.\n  // Clear() avoids freeing memory, assuming that any memory allocated\n  // to hold parts of the message will be needed again to hold the next\n  // message.  If you actually want to free the memory used by a Message,\n  // you must delete it.\n  virtual void Clear() = 0;\n\n  // Quickly check if all required fields have values set.\n  virtual bool IsInitialized() const = 0;\n\n  // This is not implemented for Lite messages -- it just returns \"(cannot\n  // determine missing fields for lite message)\".  However, it is implemented\n  // for full messages.  See message.h.\n  virtual string InitializationErrorString() const;\n\n  // If |other| is the exact same class as this, calls MergeFrom(). Otherwise,\n  // results are undefined (probably crash).\n  virtual void CheckTypeAndMergeFrom(const MessageLite& other) = 0;\n\n  // Parsing ---------------------------------------------------------\n  // Methods for parsing in protocol buffer format.  Most of these are\n  // just simple wrappers around MergeFromCodedStream().  Clear() will be\n  // called before merging the input.\n\n  // Fill the message with a protocol buffer parsed from the given input\n  // stream. Returns false on a read error or if the input is in the wrong\n  // format.  A successful return does not indicate the entire input is\n  // consumed, ensure you call ConsumedEntireMessage() to check that if\n  // applicable.\n  bool ParseFromCodedStream(io::CodedInputStream* input);\n  // Like ParseFromCodedStream(), but accepts messages that are missing\n  // required fields.\n  bool ParsePartialFromCodedStream(io::CodedInputStream* input);\n  // Read a protocol buffer from the given zero-copy input stream.  If\n  // successful, the entire input will be consumed.\n  bool ParseFromZeroCopyStream(io::ZeroCopyInputStream* input);\n  // Like ParseFromZeroCopyStream(), but accepts messages that are missing\n  // required fields.\n  bool ParsePartialFromZeroCopyStream(io::ZeroCopyInputStream* input);\n  // Read a protocol buffer from the given zero-copy input stream, expecting\n  // the message to be exactly \"size\" bytes long.  If successful, exactly\n  // this many bytes will have been consumed from the input.\n  bool ParseFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input, int size);\n  // Like ParseFromBoundedZeroCopyStream(), but accepts messages that are\n  // missing required fields.\n  bool ParsePartialFromBoundedZeroCopyStream(io::ZeroCopyInputStream* input,\n                                             int size);\n  // Parses a protocol buffer contained in a string. Returns true on success.\n  // This function takes a string in the (non-human-readable) binary wire\n  // format, matching the encoding output by MessageLite::SerializeToString().\n  // If you'd like to convert a human-readable string into a protocol buffer\n  // object, see google::protobuf::TextFormat::ParseFromString().\n  bool ParseFromString(const string& data);\n  // Like ParseFromString(), but accepts messages that are missing\n  // required fields.\n  bool ParsePartialFromString(const string& data);\n  // Parse a protocol buffer contained in an array of bytes.\n  bool ParseFromArray(const void* data, int size);\n  // Like ParseFromArray(), but accepts messages that are missing\n  // required fields.\n  bool ParsePartialFromArray(const void* data, int size);\n\n\n  // Reads a protocol buffer from the stream and merges it into this\n  // Message.  Singular fields read from the what is\n  // already in the Message and repeated fields are appended to those\n  // already present.\n  //\n  // It is the responsibility of the caller to call input->LastTagWas()\n  // (for groups) or input->ConsumedEntireMessage() (for non-groups) after\n  // this returns to verify that the message's end was delimited correctly.\n  //\n  // ParsefromCodedStream() is implemented as Clear() followed by\n  // MergeFromCodedStream().\n  bool MergeFromCodedStream(io::CodedInputStream* input);\n\n  // Like MergeFromCodedStream(), but succeeds even if required fields are\n  // missing in the input.\n  //\n  // MergeFromCodedStream() is just implemented as MergePartialFromCodedStream()\n  // followed by IsInitialized().\n  virtual bool MergePartialFromCodedStream(io::CodedInputStream* input) = 0;\n\n\n  // Serialization ---------------------------------------------------\n  // Methods for serializing in protocol buffer format.  Most of these\n  // are just simple wrappers around ByteSize() and SerializeWithCachedSizes().\n\n  // Write a protocol buffer of this message to the given output.  Returns\n  // false on a write error.  If the message is missing required fields,\n  // this may GOOGLE_CHECK-fail.\n  bool SerializeToCodedStream(io::CodedOutputStream* output) const;\n  // Like SerializeToCodedStream(), but allows missing required fields.\n  bool SerializePartialToCodedStream(io::CodedOutputStream* output) const;\n  // Write the message to the given zero-copy output stream.  All required\n  // fields must be set.\n  bool SerializeToZeroCopyStream(io::ZeroCopyOutputStream* output) const;\n  // Like SerializeToZeroCopyStream(), but allows missing required fields.\n  bool SerializePartialToZeroCopyStream(io::ZeroCopyOutputStream* output) const;\n  // Serialize the message and store it in the given string.  All required\n  // fields must be set.\n  bool SerializeToString(string* output) const;\n  // Like SerializeToString(), but allows missing required fields.\n  bool SerializePartialToString(string* output) const;\n  // Serialize the message and store it in the given byte array.  All required\n  // fields must be set.\n  bool SerializeToArray(void* data, int size) const;\n  // Like SerializeToArray(), but allows missing required fields.\n  bool SerializePartialToArray(void* data, int size) const;\n\n  // Make a string encoding the message. Is equivalent to calling\n  // SerializeToString() on a string and using that.  Returns the empty\n  // string if SerializeToString() would have returned an error.\n  // Note: If you intend to generate many such strings, you may\n  // reduce heap fragmentation by instead re-using the same string\n  // object with calls to SerializeToString().\n  string SerializeAsString() const;\n  // Like SerializeAsString(), but allows missing required fields.\n  string SerializePartialAsString() const;\n\n  // Like SerializeToString(), but appends to the data to the string's existing\n  // contents.  All required fields must be set.\n  bool AppendToString(string* output) const;\n  // Like AppendToString(), but allows missing required fields.\n  bool AppendPartialToString(string* output) const;\n\n  // Computes the serialized size of the message.  This recursively calls\n  // ByteSizeLong() on all embedded messages.\n  //\n  // ByteSizeLong() is generally linear in the number of fields defined for the\n  // proto.\n  virtual size_t ByteSizeLong() const = 0;\n\n  // Legacy ByteSize() API.\n  PROTOBUF_RUNTIME_DEPRECATED(\"Please use ByteSizeLong() instead\")\n  int ByteSize() const {\n    return internal::ToIntSize(ByteSizeLong());\n  }\n\n  // Serializes the message without recomputing the size.  The message must not\n  // have changed since the last call to ByteSize(), and the value returned by\n  // ByteSize must be non-negative.  Otherwise the results are undefined.\n  virtual void SerializeWithCachedSizes(\n      io::CodedOutputStream* output) const;\n\n  // Functions below here are not part of the public interface.  It isn't\n  // enforced, but they should be treated as private, and will be private\n  // at some future time.  Unfortunately the implementation of the \"friend\"\n  // keyword in GCC is broken at the moment, but we expect it will be fixed.\n\n  // Like SerializeWithCachedSizes, but writes directly to *target, returning\n  // a pointer to the byte immediately after the last byte written.  \"target\"\n  // must point at a byte array of at least ByteSize() bytes.  Whether to use\n  // deterministic serialization, e.g., maps in sorted order, is determined by\n  // CodedOutputStream::IsDefaultSerializationDeterministic().\n  virtual uint8* SerializeWithCachedSizesToArray(uint8* target) const;\n\n  // Returns the result of the last call to ByteSize().  An embedded message's\n  // size is needed both to serialize it (because embedded messages are\n  // length-delimited) and to compute the outer message's size.  Caching\n  // the size avoids computing it multiple times.\n  //\n  // ByteSize() does not automatically use the cached size when available\n  // because this would require invalidating it every time the message was\n  // modified, which would be too hard and expensive.  (E.g. if a deeply-nested\n  // sub-message is changed, all of its parents' cached sizes would need to be\n  // invalidated, which is too much work for an otherwise inlined setter\n  // method.)\n  virtual int GetCachedSize() const = 0;\n\n  virtual uint8* InternalSerializeWithCachedSizesToArray(bool deterministic,\n                                                         uint8* target) const;\n\n protected:\n  // CastToBase allows generated code to cast a RepeatedPtrField<T> to\n  // RepeatedPtrFieldBase. We try to restrict access to RepeatedPtrFieldBase\n  // because it is an implementation detail that user code should not access\n  // directly.\n  template <typename T>\n  static ::google::protobuf::internal::RepeatedPtrFieldBase* CastToBase(\n      ::google::protobuf::RepeatedPtrField<T>* repeated) {\n    return repeated;\n  }\n  template <typename T>\n  static const ::google::protobuf::internal::RepeatedPtrFieldBase& CastToBase(\n      const ::google::protobuf::RepeatedPtrField<T>& repeated) {\n    return repeated;\n  }\n\n  template <typename T>\n  static T* CreateMaybeMessage(Arena* arena) {\n    return Arena::CreateMaybeMessage<T>(arena);\n  }\n\n private:\n  // TODO(gerbens) make this a pure abstract function\n  virtual const void* InternalGetTable() const { return NULL; }\n\n  friend class internal::WireFormatLite;\n  friend class Message;\n  friend class internal::WeakFieldMap;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageLite);\n};\n\nnamespace internal {\n\nextern bool LIBPROTOBUF_EXPORT proto3_preserve_unknown_;\n\n// DO NOT USE: For migration only. Will be removed when Proto3 defaults to\n// preserve unknowns.\ninline bool GetProto3PreserveUnknownsDefault() {\n  return proto3_preserve_unknown_;\n}\n\n// DO NOT USE: For migration only. Will be removed when Proto3 defaults to\n// preserve unknowns.\nvoid LIBPROTOBUF_EXPORT SetProto3PreserveUnknownsDefault(bool preserve);\n}  // namespace internal\n\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_MESSAGE_LITE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/metadata.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// This header file defines an internal class that encapsulates internal message\n// metadata (Unknown-field set, Arena pointer, ...) and allows its\n// representation to be made more space-efficient via various optimizations.\n//\n// Note that this is distinct from google::protobuf::Metadata, which encapsulates\n// Descriptor and Reflection pointers.\n\n#ifndef GOOGLE_PROTOBUF_METADATA_H__\n#define GOOGLE_PROTOBUF_METADATA_H__\n\n#include <google/protobuf/metadata_lite.h>\n#include <google/protobuf/unknown_field_set.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\nclass InternalMetadataWithArena\n    : public InternalMetadataWithArenaBase<UnknownFieldSet,\n                                           InternalMetadataWithArena> {\n public:\n  InternalMetadataWithArena() {}\n  explicit InternalMetadataWithArena(Arena* arena)\n      : InternalMetadataWithArenaBase<UnknownFieldSet,\n                                           InternalMetadataWithArena>(arena) {}\n\n  void DoSwap(UnknownFieldSet* other) {\n    mutable_unknown_fields()->Swap(other);\n  }\n\n  void DoMergeFrom(const UnknownFieldSet& other) {\n    mutable_unknown_fields()->MergeFrom(other);\n  }\n\n  void DoClear() {\n    mutable_unknown_fields()->Clear();\n  }\n\n  static const UnknownFieldSet& default_instance() {\n    return *UnknownFieldSet::default_instance();\n  }\n};\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_METADATA_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/metadata_lite.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_METADATA_LITE_H__\n#define GOOGLE_PROTOBUF_METADATA_LITE_H__\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/message_lite.h>\n#include <google/protobuf/stubs/port.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// This is the representation for messages that support arena allocation. It\n// uses a tagged pointer to either store the Arena pointer, if there are no\n// unknown fields, or a pointer to a block of memory with both the Arena pointer\n// and the UnknownFieldSet, if there are unknown fields. This optimization\n// allows for \"zero-overhead\" storage of the Arena pointer, relative to the\n// above baseline implementation.\n//\n// The tagged pointer uses the LSB to disambiguate cases, and uses bit 0 == 0 to\n// indicate an arena pointer and bit 0 == 1 to indicate a UFS+Arena-container\n// pointer.\ntemplate <class T, class Derived>\nclass InternalMetadataWithArenaBase {\n public:\n  InternalMetadataWithArenaBase() : ptr_(NULL) {}\n  explicit InternalMetadataWithArenaBase(Arena* arena) : ptr_(arena) {}\n\n  ~InternalMetadataWithArenaBase() {\n    if (have_unknown_fields() && arena() == NULL) {\n      delete PtrValue<Container>();\n    }\n    ptr_ = NULL;\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE const T& unknown_fields() const {\n    if (GOOGLE_PREDICT_FALSE(have_unknown_fields())) {\n      return PtrValue<Container>()->unknown_fields;\n    } else {\n      return Derived::default_instance();\n    }\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE T* mutable_unknown_fields() {\n    if (GOOGLE_PREDICT_TRUE(have_unknown_fields())) {\n      return &PtrValue<Container>()->unknown_fields;\n    } else {\n      return mutable_unknown_fields_slow();\n    }\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE Arena* arena() const {\n    if (GOOGLE_PREDICT_FALSE(have_unknown_fields())) {\n      return PtrValue<Container>()->arena;\n    } else {\n      return PtrValue<Arena>();\n    }\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE bool have_unknown_fields() const {\n    return PtrTag() == kTagContainer;\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Swap(Derived* other) {\n    // Semantics here are that we swap only the unknown fields, not the arena\n    // pointer. We cannot simply swap ptr_ with other->ptr_ because we need to\n    // maintain our own arena ptr. Also, our ptr_ and other's ptr_ may be in\n    // different states (direct arena pointer vs. container with UFS) so we\n    // cannot simply swap ptr_ and then restore the arena pointers. We reuse\n    // UFS's swap implementation instead.\n    if (have_unknown_fields() || other->have_unknown_fields()) {\n      static_cast<Derived*>(this)->DoSwap(other->mutable_unknown_fields());\n    }\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void MergeFrom(const Derived& other) {\n    if (other.have_unknown_fields()) {\n      static_cast<Derived*>(this)->DoMergeFrom(other.unknown_fields());\n    }\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void Clear() {\n    if (have_unknown_fields()) {\n      static_cast<Derived*>(this)->DoClear();\n    }\n  }\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE void* raw_arena_ptr() const {\n    return ptr_;\n  }\n\n private:\n  void* ptr_;\n\n  // Tagged pointer implementation.\n  enum {\n    // ptr_ is an Arena*.\n    kTagArena = 0,\n    // ptr_ is a Container*.\n    kTagContainer = 1,\n  };\n  static const intptr_t kPtrTagMask = 1;\n  static const intptr_t kPtrValueMask = ~kPtrTagMask;\n\n  // Accessors for pointer tag and pointer value.\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE int PtrTag() const {\n    return reinterpret_cast<intptr_t>(ptr_) & kPtrTagMask;\n  }\n\n  template<typename U> U* PtrValue() const {\n    return reinterpret_cast<U*>(\n        reinterpret_cast<intptr_t>(ptr_) & kPtrValueMask);\n  }\n\n  // If ptr_'s tag is kTagContainer, it points to an instance of this struct.\n  struct Container {\n    T unknown_fields;\n    Arena* arena;\n  };\n\n  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE T* mutable_unknown_fields_slow() {\n    Arena* my_arena = arena();\n    Container* container = Arena::Create<Container>(my_arena);\n    // Two-step assignment works around a bug in clang's static analyzer:\n    // https://bugs.llvm.org/show_bug.cgi?id=34198.\n    ptr_ = container;\n    ptr_ = reinterpret_cast<void*>(\n        reinterpret_cast<intptr_t>(ptr_) | kTagContainer);\n    container->arena = my_arena;\n    return &(container->unknown_fields);\n  }\n};\n\n// We store unknown fields as a string right now, because there is currently no\n// good interface for reading unknown fields into an ArenaString.  We may want\n// to revisit this to allow unknown fields to be parsed onto the Arena.\nclass InternalMetadataWithArenaLite\n    : public InternalMetadataWithArenaBase<string,\n                                           InternalMetadataWithArenaLite> {\n public:\n  InternalMetadataWithArenaLite() {}\n\n  explicit InternalMetadataWithArenaLite(Arena* arena)\n      : InternalMetadataWithArenaBase<string,\n                                      InternalMetadataWithArenaLite>(arena) {}\n\n  void DoSwap(string* other) {\n    mutable_unknown_fields()->swap(*other);\n  }\n\n  void DoMergeFrom(const string& other) {\n    mutable_unknown_fields()->append(other);\n  }\n\n  void DoClear() {\n    mutable_unknown_fields()->clear();\n  }\n\n  static const string& default_instance() {\n    return GetEmptyStringAlreadyInited();\n  }\n};\n\n// This helper RAII class is needed to efficiently parse unknown fields. We\n// should only call mutable_unknown_fields if there are actual unknown fields.\n// The obvious thing to just use a stack string and swap it at the end of the\n// parse won't work, because the destructor of StringOutputStream needs to be\n// called before we can modify the string (it check-fails). Using\n// LiteUnknownFieldSetter setter(&_internal_metadata_);\n// StringOutputStream stream(setter.buffer());\n// guarantees that the string is only swapped after stream is destroyed.\nclass LIBPROTOBUF_EXPORT LiteUnknownFieldSetter {\n public:\n  explicit LiteUnknownFieldSetter(InternalMetadataWithArenaLite* metadata)\n      : metadata_(metadata) {\n    if (metadata->have_unknown_fields()) {\n      buffer_.swap(*metadata->mutable_unknown_fields());\n    }\n  }\n  ~LiteUnknownFieldSetter() {\n    if (!buffer_.empty()) metadata_->mutable_unknown_fields()->swap(buffer_);\n  }\n  string* buffer() { return &buffer_; }\n\n private:\n  InternalMetadataWithArenaLite* metadata_;\n  string buffer_;\n};\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_METADATA_LITE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/reflection.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// This header defines the RepeatedFieldRef class template used to access\n// repeated fields with protobuf reflection API.\n#ifndef GOOGLE_PROTOBUF_REFLECTION_H__\n#define GOOGLE_PROTOBUF_REFLECTION_H__\n\n#include <memory>\n\n#include <google/protobuf/message.h>\n#include <google/protobuf/generated_enum_util.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\ntemplate<typename T, typename Enable = void>\nstruct RefTypeTraits;\n}  // namespace internal\n\ntemplate<typename T>\nRepeatedFieldRef<T> Reflection::GetRepeatedFieldRef(\n    const Message& message, const FieldDescriptor* field) const {\n  return RepeatedFieldRef<T>(message, field);\n}\n\ntemplate<typename T>\nMutableRepeatedFieldRef<T> Reflection::GetMutableRepeatedFieldRef(\n    Message* message, const FieldDescriptor* field) const {\n  return MutableRepeatedFieldRef<T>(message, field);\n}\n\n// RepeatedFieldRef definition for non-message types.\ntemplate<typename T>\nclass RepeatedFieldRef<\n    T, typename std::enable_if<!std::is_base_of<Message, T>::value>::type> {\n  typedef typename internal::RefTypeTraits<T>::iterator IteratorType;\n  typedef typename internal::RefTypeTraits<T>::AccessorType AccessorType;\n\n public:\n  bool empty() const {\n    return accessor_->IsEmpty(data_);\n  }\n  int size() const {\n    return accessor_->Size(data_);\n  }\n  T Get(int index) const {\n    return accessor_->template Get<T>(data_, index);\n  }\n\n  typedef IteratorType iterator;\n  typedef IteratorType const_iterator;\n  typedef T value_type;\n  typedef T& reference;\n  typedef const T& const_reference;\n  typedef int size_type;\n  typedef ptrdiff_t difference_type;\n\n  iterator begin() const {\n    return iterator(data_, accessor_, true);\n  }\n  iterator end() const {\n    return iterator(data_, accessor_, false);\n  }\n\n private:\n  friend class Reflection;\n  RepeatedFieldRef(\n      const Message& message,\n      const FieldDescriptor* field) {\n    const Reflection* reflection = message.GetReflection();\n    data_ = reflection->RepeatedFieldData(\n        const_cast<Message*>(&message), field,\n        internal::RefTypeTraits<T>::cpp_type, NULL);\n    accessor_ = reflection->RepeatedFieldAccessor(field);\n  }\n\n  const void* data_;\n  const AccessorType* accessor_;\n};\n\n// MutableRepeatedFieldRef definition for non-message types.\ntemplate<typename T>\nclass MutableRepeatedFieldRef<\n    T, typename std::enable_if<!std::is_base_of<Message, T>::value>::type> {\n  typedef typename internal::RefTypeTraits<T>::AccessorType AccessorType;\n\n public:\n  bool empty() const {\n    return accessor_->IsEmpty(data_);\n  }\n  int size() const {\n    return accessor_->Size(data_);\n  }\n  T Get(int index) const {\n    return accessor_->template Get<T>(data_, index);\n  }\n\n  void Set(int index, const T& value) const {\n    accessor_->template Set<T>(data_, index, value);\n  }\n  void Add(const T& value) const {\n    accessor_->template Add<T>(data_, value);\n  }\n  void RemoveLast() const {\n    accessor_->RemoveLast(data_);\n  }\n  void SwapElements(int index1, int index2) const {\n    accessor_->SwapElements(data_, index1, index2);\n  }\n  void Clear() const {\n    accessor_->Clear(data_);\n  }\n\n  void Swap(const MutableRepeatedFieldRef& other) const {\n    accessor_->Swap(data_, other.accessor_, other.data_);\n  }\n\n  template<typename Container>\n  void MergeFrom(const Container& container) const {\n    typedef typename Container::const_iterator Iterator;\n    for (Iterator it = container.begin(); it != container.end(); ++it) {\n      Add(*it);\n    }\n  }\n  template<typename Container>\n  void CopyFrom(const Container& container) const {\n    Clear();\n    MergeFrom(container);\n  }\n\n private:\n  friend class Reflection;\n  MutableRepeatedFieldRef(\n      Message* message,\n      const FieldDescriptor* field) {\n    const Reflection* reflection = message->GetReflection();\n    data_ = reflection->RepeatedFieldData(\n        message, field, internal::RefTypeTraits<T>::cpp_type, NULL);\n    accessor_ = reflection->RepeatedFieldAccessor(field);\n  }\n\n  void* data_;\n  const AccessorType* accessor_;\n};\n\n// RepeatedFieldRef definition for message types.\ntemplate<typename T>\nclass RepeatedFieldRef<\n    T, typename std::enable_if<std::is_base_of<Message, T>::value>::type> {\n  typedef typename internal::RefTypeTraits<T>::iterator IteratorType;\n  typedef typename internal::RefTypeTraits<T>::AccessorType AccessorType;\n\n public:\n  bool empty() const {\n    return accessor_->IsEmpty(data_);\n  }\n  int size() const {\n    return accessor_->Size(data_);\n  }\n  // This method returns a reference to the underlying message object if it\n  // exists. If a message object doesn't exist (e.g., data stored in serialized\n  // form), scratch_space will be filled with the data and a reference to it\n  // will be returned.\n  //\n  // Example:\n  //   RepeatedFieldRef<Message> h = ...\n  //   unique_ptr<Message> scratch_space(h.NewMessage());\n  //   const Message& item = h.Get(index, scratch_space.get());\n  const T& Get(int index, T* scratch_space) const {\n    return *static_cast<const T*>(accessor_->Get(data_, index, scratch_space));\n  }\n  // Create a new message of the same type as the messages stored in this\n  // repeated field. Caller takes ownership of the returned object.\n  T* NewMessage() const {\n    return static_cast<T*>(default_instance_->New());\n  }\n\n  typedef IteratorType iterator;\n  typedef IteratorType const_iterator;\n  typedef T value_type;\n  typedef T& reference;\n  typedef const T& const_reference;\n  typedef int size_type;\n  typedef ptrdiff_t difference_type;\n\n  iterator begin() const {\n    return iterator(data_, accessor_, true, NewMessage());\n  }\n  iterator end() const {\n    // The end iterator must not be dereferenced, no need for scratch space.\n    return iterator(data_, accessor_, false, nullptr);\n  }\n\n private:\n  friend class Reflection;\n  RepeatedFieldRef(\n      const Message& message,\n      const FieldDescriptor* field) {\n    const Reflection* reflection = message.GetReflection();\n    data_ = reflection->RepeatedFieldData(\n        const_cast<Message*>(&message), field,\n        internal::RefTypeTraits<T>::cpp_type,\n        internal::RefTypeTraits<T>::GetMessageFieldDescriptor());\n    accessor_ = reflection->RepeatedFieldAccessor(field);\n    default_instance_ =\n        reflection->GetMessageFactory()->GetPrototype(field->message_type());\n  }\n\n  const void* data_;\n  const AccessorType* accessor_;\n  const Message* default_instance_;\n};\n\n// MutableRepeatedFieldRef definition for message types.\ntemplate<typename T>\nclass MutableRepeatedFieldRef<\n    T, typename std::enable_if<std::is_base_of<Message, T>::value>::type> {\n  typedef typename internal::RefTypeTraits<T>::AccessorType AccessorType;\n\n public:\n  bool empty() const {\n    return accessor_->IsEmpty(data_);\n  }\n  int size() const {\n    return accessor_->Size(data_);\n  }\n  // See comments for RepeatedFieldRef<Message>::Get()\n  const T& Get(int index, T* scratch_space) const {\n    return *static_cast<const T*>(accessor_->Get(data_, index, scratch_space));\n  }\n  // Create a new message of the same type as the messages stored in this\n  // repeated field. Caller takes ownership of the returned object.\n  T* NewMessage() const {\n    return static_cast<T*>(default_instance_->New());\n  }\n\n  void Set(int index, const T& value) const {\n    accessor_->Set(data_, index, &value);\n  }\n  void Add(const T& value) const {\n    accessor_->Add(data_, &value);\n  }\n  void RemoveLast() const {\n    accessor_->RemoveLast(data_);\n  }\n  void SwapElements(int index1, int index2) const {\n    accessor_->SwapElements(data_, index1, index2);\n  }\n  void Clear() const {\n    accessor_->Clear(data_);\n  }\n\n  void Swap(const MutableRepeatedFieldRef& other) const {\n    accessor_->Swap(data_, other.accessor_, other.data_);\n  }\n\n  template<typename Container>\n  void MergeFrom(const Container& container) const {\n    typedef typename Container::const_iterator Iterator;\n    for (Iterator it = container.begin(); it != container.end(); ++it) {\n      Add(*it);\n    }\n  }\n  template<typename Container>\n  void CopyFrom(const Container& container) const {\n    Clear();\n    MergeFrom(container);\n  }\n\n private:\n  friend class Reflection;\n  MutableRepeatedFieldRef(\n      Message* message,\n      const FieldDescriptor* field) {\n    const Reflection* reflection = message->GetReflection();\n    data_ = reflection->RepeatedFieldData(\n        message, field, internal::RefTypeTraits<T>::cpp_type,\n        internal::RefTypeTraits<T>::GetMessageFieldDescriptor());\n    accessor_ = reflection->RepeatedFieldAccessor(field);\n    default_instance_ =\n        reflection->GetMessageFactory()->GetPrototype(field->message_type());\n  }\n\n  void* data_;\n  const AccessorType* accessor_;\n  const Message* default_instance_;\n};\n\nnamespace internal {\n// Interfaces used to implement reflection RepeatedFieldRef API.\n// Reflection::GetRepeatedAccessor() should return a pointer to an singleton\n// object that implements the below interface.\n//\n// This interface passes/returns values using void pointers. The actual type\n// of the value depends on the field's cpp_type. Following is a mapping from\n// cpp_type to the type that should be used in this interface:\n//\n//   field->cpp_type()      T                Actual type of void*\n//   CPPTYPE_INT32        int32                   int32\n//   CPPTYPE_UINT32       uint32                  uint32\n//   CPPTYPE_INT64        int64                   int64\n//   CPPTYPE_UINT64       uint64                  uint64\n//   CPPTYPE_DOUBLE       double                  double\n//   CPPTYPE_FLOAT        float                   float\n//   CPPTYPE_BOOL         bool                    bool\n//   CPPTYPE_ENUM         generated enum type     int32\n//   CPPTYPE_STRING       string                  string\n//   CPPTYPE_MESSAGE      generated message type  google::protobuf::Message\n//                        or google::protobuf::Message\n//\n// Note that for enums we use int32 in the interface.\n//\n// You can map from T to the actual type using RefTypeTraits:\n//   typedef RefTypeTraits<T>::AccessorValueType ActualType;\nclass LIBPROTOBUF_EXPORT RepeatedFieldAccessor {\n public:\n  // Typedefs for clarity.\n  typedef void Field;\n  typedef void Value;\n  typedef void Iterator;\n\n  virtual ~RepeatedFieldAccessor();\n  virtual bool IsEmpty(const Field* data) const = 0;\n  virtual int Size(const Field* data) const = 0;\n  // Depends on the underlying representation of the repeated field, this\n  // method can return a pointer to the underlying object if such an object\n  // exists, or fill the data into scratch_space and return scratch_space.\n  // Callers of this method must ensure scratch_space is a valid pointer\n  // to a mutable object of the correct type.\n  virtual const Value* Get(\n      const Field* data, int index, Value* scratch_space) const = 0;\n\n  virtual void Clear(Field* data) const = 0;\n  virtual void Set(Field* data, int index, const Value* value) const = 0;\n  virtual void Add(Field* data, const Value* value) const = 0;\n  virtual void RemoveLast(Field* data) const = 0;\n  virtual void SwapElements(Field* data, int index1, int index2) const = 0;\n  virtual void Swap(Field* data, const RepeatedFieldAccessor* other_mutator,\n                    Field* other_data) const = 0;\n\n  // Create an iterator that points at the beginning of the repeated field.\n  virtual Iterator* BeginIterator(const Field* data) const = 0;\n  // Create an iterator that points at the end of the repeated field.\n  virtual Iterator* EndIterator(const Field* data) const = 0;\n  // Make a copy of an iterator and return the new copy.\n  virtual Iterator* CopyIterator(const Field* data,\n                                 const Iterator* iterator) const = 0;\n  // Move an iterator to point to the next element.\n  virtual Iterator* AdvanceIterator(const Field* data,\n                                    Iterator* iterator) const = 0;\n  // Compare whether two iterators point to the same element.\n  virtual bool EqualsIterator(const Field* data, const Iterator* a,\n                              const Iterator* b) const = 0;\n  // Delete an iterator created by BeginIterator(), EndIterator() and\n  // CopyIterator().\n  virtual void DeleteIterator(const Field* data, Iterator* iterator) const = 0;\n  // Like Get() but for iterators.\n  virtual const Value* GetIteratorValue(const Field* data,\n                                        const Iterator* iterator,\n                                        Value* scratch_space) const = 0;\n\n  // Templated methods that make using this interface easier for non-message\n  // types.\n  template<typename T>\n  T Get(const Field* data, int index) const {\n    typedef typename RefTypeTraits<T>::AccessorValueType ActualType;\n    ActualType scratch_space;\n    return static_cast<T>(\n        *reinterpret_cast<const ActualType*>(\n            Get(data, index, static_cast<Value*>(&scratch_space))));\n  }\n\n  template<typename T, typename ValueType>\n  void Set(Field* data, int index, const ValueType& value) const {\n    typedef typename RefTypeTraits<T>::AccessorValueType ActualType;\n    // In this RepeatedFieldAccessor interface we pass/return data using\n    // raw pointers. Type of the data these raw pointers point to should\n    // be ActualType. Here we have a ValueType object and want a ActualType\n    // pointer. We can't cast a ValueType pointer to an ActualType pointer\n    // directly because their type might be different (for enums ValueType\n    // may be a generated enum type while ActualType is int32). To be safe\n    // we make a copy to get a temporary ActualType object and use it.\n    ActualType tmp = static_cast<ActualType>(value);\n    Set(data, index, static_cast<const Value*>(&tmp));\n  }\n\n  template<typename T, typename ValueType>\n  void Add(Field* data, const ValueType& value) const {\n    typedef typename RefTypeTraits<T>::AccessorValueType ActualType;\n    // In this RepeatedFieldAccessor interface we pass/return data using\n    // raw pointers. Type of the data these raw pointers point to should\n    // be ActualType. Here we have a ValueType object and want a ActualType\n    // pointer. We can't cast a ValueType pointer to an ActualType pointer\n    // directly because their type might be different (for enums ValueType\n    // may be a generated enum type while ActualType is int32). To be safe\n    // we make a copy to get a temporary ActualType object and use it.\n    ActualType tmp = static_cast<ActualType>(value);\n    Add(data, static_cast<const Value*>(&tmp));\n  }\n};\n\n// Implement (Mutable)RepeatedFieldRef::iterator\ntemplate<typename T>\nclass RepeatedFieldRefIterator\n    : public std::iterator<std::forward_iterator_tag, T> {\n  typedef typename RefTypeTraits<T>::AccessorValueType AccessorValueType;\n  typedef typename RefTypeTraits<T>::IteratorValueType IteratorValueType;\n  typedef typename RefTypeTraits<T>::IteratorPointerType IteratorPointerType;\n\n public:\n  // Constructor for non-message fields.\n  RepeatedFieldRefIterator(const void* data,\n                           const RepeatedFieldAccessor* accessor, bool begin)\n      : data_(data),\n        accessor_(accessor),\n        iterator_(begin ? accessor->BeginIterator(data)\n                        : accessor->EndIterator(data)),\n        // The end iterator must not be dereferenced, no need for scratch space.\n        scratch_space_(begin ? new AccessorValueType : nullptr) {}\n  // Constructor for message fields.\n  RepeatedFieldRefIterator(const void* data,\n                           const RepeatedFieldAccessor* accessor,\n                           bool begin,\n                           AccessorValueType* scratch_space)\n      : data_(data), accessor_(accessor),\n        iterator_(begin ? accessor->BeginIterator(data) :\n                          accessor->EndIterator(data)),\n        scratch_space_(scratch_space) {\n  }\n  ~RepeatedFieldRefIterator() {\n    accessor_->DeleteIterator(data_, iterator_);\n  }\n  RepeatedFieldRefIterator operator++(int) {\n    RepeatedFieldRefIterator tmp(*this);\n    iterator_ = accessor_->AdvanceIterator(data_, iterator_);\n    return tmp;\n  }\n  RepeatedFieldRefIterator& operator++() {\n    iterator_ = accessor_->AdvanceIterator(data_, iterator_);\n    return *this;\n  }\n  IteratorValueType operator*() const {\n    return static_cast<IteratorValueType>(\n        *static_cast<const AccessorValueType*>(\n            accessor_->GetIteratorValue(\n                data_, iterator_, scratch_space_.get())));\n  }\n  IteratorPointerType operator->() const {\n    return static_cast<IteratorPointerType>(\n        accessor_->GetIteratorValue(\n            data_, iterator_, scratch_space_.get()));\n  }\n  bool operator!=(const RepeatedFieldRefIterator& other) const {\n    assert(data_ == other.data_);\n    assert(accessor_ == other.accessor_);\n    return !accessor_->EqualsIterator(data_, iterator_, other.iterator_);\n  }\n  bool operator==(const RepeatedFieldRefIterator& other) const {\n    return !this->operator!=(other);\n  }\n\n  RepeatedFieldRefIterator(const RepeatedFieldRefIterator& other)\n      : data_(other.data_), accessor_(other.accessor_),\n        iterator_(accessor_->CopyIterator(data_, other.iterator_)) {\n  }\n  RepeatedFieldRefIterator& operator=(const RepeatedFieldRefIterator& other) {\n    if (this != &other) {\n      accessor_->DeleteIterator(data_, iterator_);\n      data_ = other.data_;\n      accessor_ = other.accessor_;\n      iterator_ = accessor_->CopyIterator(data_, other.iterator_);\n    }\n    return *this;\n  }\n\n protected:\n  const void* data_;\n  const RepeatedFieldAccessor* accessor_;\n  void* iterator_;\n  std::unique_ptr<AccessorValueType> scratch_space_;\n};\n\n// TypeTraits that maps the type parameter T of RepeatedFieldRef or\n// MutableRepeatedFieldRef to corresponding iterator type,\n// RepeatedFieldAccessor type, etc.\ntemplate<typename T>\nstruct PrimitiveTraits {\n  static const bool is_primitive = false;\n};\n#define DEFINE_PRIMITIVE(TYPE, type) \\\n    template<> struct PrimitiveTraits<type> { \\\n      static const bool is_primitive = true; \\\n      static const FieldDescriptor::CppType cpp_type = \\\n          FieldDescriptor::CPPTYPE_ ## TYPE; \\\n    };\nDEFINE_PRIMITIVE(INT32, int32)\nDEFINE_PRIMITIVE(UINT32, uint32)\nDEFINE_PRIMITIVE(INT64, int64)\nDEFINE_PRIMITIVE(UINT64, uint64)\nDEFINE_PRIMITIVE(FLOAT, float)\nDEFINE_PRIMITIVE(DOUBLE, double)\nDEFINE_PRIMITIVE(BOOL, bool)\n#undef DEFINE_PRIMITIVE\n\ntemplate<typename T>\nstruct RefTypeTraits<\n    T, typename std::enable_if<PrimitiveTraits<T>::is_primitive>::type> {\n  typedef RepeatedFieldRefIterator<T> iterator;\n  typedef RepeatedFieldAccessor AccessorType;\n  typedef T AccessorValueType;\n  typedef T IteratorValueType;\n  typedef T* IteratorPointerType;\n  static const FieldDescriptor::CppType cpp_type =\n      PrimitiveTraits<T>::cpp_type;\n  static const Descriptor* GetMessageFieldDescriptor() {\n    return NULL;\n  }\n};\n\ntemplate<typename T>\nstruct RefTypeTraits<\n    T, typename std::enable_if<is_proto_enum<T>::value>::type> {\n  typedef RepeatedFieldRefIterator<T> iterator;\n  typedef RepeatedFieldAccessor AccessorType;\n  // We use int32 for repeated enums in RepeatedFieldAccessor.\n  typedef int32 AccessorValueType;\n  typedef T IteratorValueType;\n  typedef int32* IteratorPointerType;\n  static const FieldDescriptor::CppType cpp_type =\n      FieldDescriptor::CPPTYPE_ENUM;\n  static const Descriptor* GetMessageFieldDescriptor() {\n    return NULL;\n  }\n};\n\ntemplate<typename T>\nstruct RefTypeTraits<\n    T, typename std::enable_if<std::is_same<string, T>::value>::type> {\n  typedef RepeatedFieldRefIterator<T> iterator;\n  typedef RepeatedFieldAccessor AccessorType;\n  typedef string AccessorValueType;\n  typedef const string IteratorValueType;\n  typedef const string* IteratorPointerType;\n  static const FieldDescriptor::CppType cpp_type =\n      FieldDescriptor::CPPTYPE_STRING;\n  static const Descriptor* GetMessageFieldDescriptor() {\n    return NULL;\n  }\n};\n\ntemplate<typename T>\nstruct MessageDescriptorGetter {\n  static const Descriptor* get() {\n    return T::default_instance().GetDescriptor();\n  }\n};\ntemplate<>\nstruct MessageDescriptorGetter<Message> {\n  static const Descriptor* get() {\n    return NULL;\n  }\n};\n\ntemplate<typename T>\nstruct RefTypeTraits<\n    T, typename std::enable_if<std::is_base_of<Message, T>::value>::type> {\n  typedef RepeatedFieldRefIterator<T> iterator;\n  typedef RepeatedFieldAccessor AccessorType;\n  typedef Message AccessorValueType;\n  typedef const T& IteratorValueType;\n  typedef const T* IteratorPointerType;\n  static const FieldDescriptor::CppType cpp_type =\n      FieldDescriptor::CPPTYPE_MESSAGE;\n  static const Descriptor* GetMessageFieldDescriptor() {\n    return MessageDescriptorGetter<T>::get();\n  }\n};\n}  // namespace internal\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_REFLECTION_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/reflection_ops.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This header is logically internal, but is made public because it is used\n// from protocol-compiler-generated code, which may reside in other components.\n\n#ifndef GOOGLE_PROTOBUF_REFLECTION_OPS_H__\n#define GOOGLE_PROTOBUF_REFLECTION_OPS_H__\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/message.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// Basic operations that can be performed using reflection.\n// These can be used as a cheap way to implement the corresponding\n// methods of the Message interface, though they are likely to be\n// slower than implementations tailored for the specific message type.\n//\n// This class should stay limited to operations needed to implement\n// the Message interface.\n//\n// This class is really a namespace that contains only static methods.\nclass LIBPROTOBUF_EXPORT ReflectionOps {\n public:\n  static void Copy(const Message& from, Message* to);\n  static void Merge(const Message& from, Message* to);\n  static void Clear(Message* message);\n  static bool IsInitialized(const Message& message);\n  static void DiscardUnknownFields(Message* message);\n\n  // Finds all unset required fields in the message and adds their full\n  // paths (e.g. \"foo.bar[5].baz\") to *names.  \"prefix\" will be attached to\n  // the front of each name.\n  static void FindInitializationErrors(const Message& message,\n                                       const string& prefix,\n                                       std::vector<string>* errors);\n\n private:\n  // All methods are static.  No need to construct.\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ReflectionOps);\n};\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_REFLECTION_OPS_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/repeated_field.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// RepeatedField and RepeatedPtrField are used by generated protocol message\n// classes to manipulate repeated fields.  These classes are very similar to\n// STL's vector, but include a number of optimizations found to be useful\n// specifically in the case of Protocol Buffers.  RepeatedPtrField is\n// particularly different from STL vector as it manages ownership of the\n// pointers that it contains.\n//\n// Typically, clients should not need to access RepeatedField objects directly,\n// but should instead use the accessor functions generated automatically by the\n// protocol compiler.\n\n#ifndef GOOGLE_PROTOBUF_REPEATED_FIELD_H__\n#define GOOGLE_PROTOBUF_REPEATED_FIELD_H__\n\n#ifdef _MSC_VER\n// This is required for min/max on VS2013 only.\n#include <algorithm>\n#endif\n\n#include <iterator>\n#include <limits>\n#include <string>\n#include <google/protobuf/stubs/casts.h>\n#include <google/protobuf/stubs/logging.h>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/implicit_weak_message.h>\n#include <google/protobuf/message_lite.h>\n#include <google/protobuf/stubs/port.h>\n#include <type_traits>\n\n\n// Forward-declare these so that we can make them friends.\nnamespace google {\nnamespace upb {\nnamespace google_opensource {\nclass GMR_Handlers;\n}  // namespace google_opensource\n}  // namespace upb\n\nnamespace protobuf {\n\nclass Message;\n\nnamespace internal {\n\nclass MergePartialFromCodedStreamHelper;\n\nstatic const int kMinRepeatedFieldAllocationSize = 4;\n\n// A utility function for logging that doesn't need any template types.\nvoid LogIndexOutOfBounds(int index, int size);\n\ntemplate <typename Iter>\ninline int CalculateReserve(Iter begin, Iter end, std::forward_iterator_tag) {\n  return static_cast<int>(std::distance(begin, end));\n}\n\ntemplate <typename Iter>\ninline int CalculateReserve(Iter /*begin*/, Iter /*end*/,\n                            std::input_iterator_tag /*unused*/) {\n  return -1;\n}\n\ntemplate <typename Iter>\ninline int CalculateReserve(Iter begin, Iter end) {\n  typedef typename std::iterator_traits<Iter>::iterator_category Category;\n  return CalculateReserve(begin, end, Category());\n}\n}  // namespace internal\n\n\n// RepeatedField is used to represent repeated fields of a primitive type (in\n// other words, everything except strings and nested Messages).  Most users will\n// not ever use a RepeatedField directly; they will use the get-by-index,\n// set-by-index, and add accessors that are generated for all repeated fields.\ntemplate <typename Element>\nclass RepeatedField final {\n public:\n  RepeatedField();\n  explicit RepeatedField(Arena* arena);\n  RepeatedField(const RepeatedField& other);\n  template <typename Iter>\n  RepeatedField(Iter begin, const Iter& end);\n  ~RepeatedField();\n\n  RepeatedField& operator=(const RepeatedField& other);\n\n  RepeatedField(RepeatedField&& other) noexcept;\n  RepeatedField& operator=(RepeatedField&& other) noexcept;\n\n  bool empty() const;\n  int size() const;\n\n  const Element& Get(int index) const;\n  Element* Mutable(int index);\n\n  const Element& operator[](int index) const { return Get(index); }\n  Element& operator[](int index) { return *Mutable(index); }\n\n  void Set(int index, const Element& value);\n  void Add(const Element& value);\n  // Appends a new element and return a pointer to it.\n  // The new element is uninitialized if |Element| is a POD type.\n  Element* Add();\n  // Remove the last element in the array.\n  void RemoveLast();\n\n  // Extract elements with indices in \"[start .. start+num-1]\".\n  // Copy them into \"elements[0 .. num-1]\" if \"elements\" is not NULL.\n  // Caution: implementation also moves elements with indices [start+num ..].\n  // Calling this routine inside a loop can cause quadratic behavior.\n  void ExtractSubrange(int start, int num, Element* elements);\n\n  void Clear();\n  void MergeFrom(const RepeatedField& other);\n  void CopyFrom(const RepeatedField& other);\n\n  // Reserve space to expand the field to at least the given size.  If the\n  // array is grown, it will always be at least doubled in size.\n  void Reserve(int new_size);\n\n  // Resize the RepeatedField to a new, smaller size.  This is O(1).\n  void Truncate(int new_size);\n\n  void AddAlreadyReserved(const Element& value);\n  // Appends a new element and return a pointer to it.\n  // The new element is uninitialized if |Element| is a POD type.\n  // Should be called only if Capacity() > Size().\n  Element* AddAlreadyReserved();\n  Element* AddNAlreadyReserved(int elements);\n  int Capacity() const;\n\n  // Like STL resize.  Uses value to fill appended elements.\n  // Like Truncate() if new_size <= size(), otherwise this is\n  // O(new_size - size()).\n  void Resize(int new_size, const Element& value);\n\n  // Gets the underlying array.  This pointer is possibly invalidated by\n  // any add or remove operation.\n  Element* mutable_data();\n  const Element* data() const;\n\n  // Swap entire contents with \"other\". If they are separate arenas then, copies\n  // data between each other.\n  void Swap(RepeatedField* other);\n\n  // Swap entire contents with \"other\". Should be called only if the caller can\n  // guarantee that both repeated fields are on the same arena or are on the\n  // heap. Swapping between different arenas is disallowed and caught by a\n  // GOOGLE_DCHECK (see API docs for details).\n  void UnsafeArenaSwap(RepeatedField* other);\n\n  // Swap two elements.\n  void SwapElements(int index1, int index2);\n\n  // STL-like iterator support\n  typedef Element* iterator;\n  typedef const Element* const_iterator;\n  typedef Element value_type;\n  typedef value_type& reference;\n  typedef const value_type& const_reference;\n  typedef value_type* pointer;\n  typedef const value_type* const_pointer;\n  typedef int size_type;\n  typedef ptrdiff_t difference_type;\n\n  iterator begin();\n  const_iterator begin() const;\n  const_iterator cbegin() const;\n  iterator end();\n  const_iterator end() const;\n  const_iterator cend() const;\n\n  // Reverse iterator support\n  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;\n  typedef std::reverse_iterator<iterator> reverse_iterator;\n  reverse_iterator rbegin() {\n    return reverse_iterator(end());\n  }\n  const_reverse_iterator rbegin() const {\n    return const_reverse_iterator(end());\n  }\n  reverse_iterator rend() {\n    return reverse_iterator(begin());\n  }\n  const_reverse_iterator rend() const {\n    return const_reverse_iterator(begin());\n  }\n\n  // Returns the number of bytes used by the repeated field, excluding\n  // sizeof(*this)\n  size_t SpaceUsedExcludingSelfLong() const;\n\n  int SpaceUsedExcludingSelf() const {\n    return internal::ToIntSize(SpaceUsedExcludingSelfLong());\n  }\n\n  // Removes the element referenced by position.\n  //\n  // Returns an iterator to the element immediately following the removed\n  // element.\n  //\n  // Invalidates all iterators at or after the removed element, including end().\n  iterator erase(const_iterator position);\n\n  // Removes the elements in the range [first, last).\n  //\n  // Returns an iterator to the element immediately following the removed range.\n  //\n  // Invalidates all iterators at or after the removed range, including end().\n  iterator erase(const_iterator first, const_iterator last);\n\n  // Get the Arena on which this RepeatedField stores its elements.\n  ::google::protobuf::Arena* GetArena() const {\n    return GetArenaNoVirtual();\n  }\n\n  // For internal use only.\n  //\n  // This is public due to it being called by generated code.\n  inline void InternalSwap(RepeatedField* other);\n\n private:\n  static const int kInitialSize = 0;\n  // A note on the representation here (see also comment below for\n  // RepeatedPtrFieldBase's struct Rep):\n  //\n  // We maintain the same sizeof(RepeatedField) as before we added arena support\n  // so that we do not degrade performance by bloating memory usage. Directly\n  // adding an arena_ element to RepeatedField is quite costly. By using\n  // indirection in this way, we keep the same size when the RepeatedField is\n  // empty (common case), and add only an 8-byte header to the elements array\n  // when non-empty. We make sure to place the size fields directly in the\n  // RepeatedField class to avoid costly cache misses due to the indirection.\n  int current_size_;\n  int total_size_;\n  struct Rep {\n    Arena* arena;\n    Element elements[1];\n  };\n  // We can not use sizeof(Rep) - sizeof(Element) due to the trailing padding on\n  // the struct. We can not use sizeof(Arena*) as well because there might be\n  // a \"gap\" after the field arena and before the field elements (e.g., when\n  // Element is double and pointer is 32bit).\n  static const size_t kRepHeaderSize;\n\n  // We reuse the Rep* for an Arena* when total_size == 0, to avoid having to do\n  // an allocation in the constructor when we have an Arena.\n  union Pointer {\n    Pointer(Arena* a) : arena(a) {}\n    Arena* arena;   // When total_size_ == 0.\n    Rep* rep;       // When total_size_ != 0.\n  } ptr_;\n\n  Rep* rep() const {\n    GOOGLE_DCHECK_GT(total_size_, 0);\n    return ptr_.rep;\n  }\n\n  friend class Arena;\n  typedef void InternalArenaConstructable_;\n\n\n  // Move the contents of |from| into |to|, possibly clobbering |from| in the\n  // process.  For primitive types this is just a memcpy(), but it could be\n  // specialized for non-primitive types to, say, swap each element instead.\n  void MoveArray(Element* to, Element* from, int size);\n\n  // Copy the elements of |from| into |to|.\n  void CopyArray(Element* to, const Element* from, int size);\n\n  // Internal helper expected by Arena methods.\n  inline Arena* GetArenaNoVirtual() const {\n    return (total_size_ == 0) ? ptr_.arena : ptr_.rep->arena;\n  }\n\n  // Internal helper to delete all elements and deallocate the storage.\n  // If Element has a trivial destructor (for example, if it's a fundamental\n  // type, like int32), the loop will be removed by the optimizer.\n  void InternalDeallocate(Rep* rep, int size) {\n    if (rep != NULL) {\n      Element* e = &rep->elements[0];\n      Element* limit = &rep->elements[size];\n      for (; e < limit; e++) {\n        e->~Element();\n      }\n      if (rep->arena == NULL) {\n#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)\n        const size_t bytes = size * sizeof(*e) + kRepHeaderSize;\n        ::operator delete(static_cast<void*>(rep), bytes);\n#else\n        ::operator delete(static_cast<void*>(rep));\n#endif\n      }\n    }\n  }\n\n  friend class internal::WireFormatLite;\n  const Element* unsafe_data() const;\n};\n\ntemplate<typename Element>\nconst size_t RepeatedField<Element>::kRepHeaderSize =\n    reinterpret_cast<size_t>(&reinterpret_cast<Rep*>(16)->elements[0]) - 16;\n\nnamespace internal {\ntemplate <typename It> class RepeatedPtrIterator;\ntemplate <typename It, typename VoidPtr> class RepeatedPtrOverPtrsIterator;\n}  // namespace internal\n\nnamespace internal {\n\n// This is a helper template to copy an array of elements efficiently when they\n// have a trivial copy constructor, and correctly otherwise. This really\n// shouldn't be necessary, but our compiler doesn't optimize std::copy very\n// effectively.\ntemplate <typename Element,\n          bool HasTrivialCopy =\n              std::is_pod<Element>::value>\nstruct ElementCopier {\n  void operator()(Element* to, const Element* from, int array_size);\n};\n\n}  // namespace internal\n\nnamespace internal {\n\n// type-traits helper for RepeatedPtrFieldBase: we only want to invoke\n// arena-related \"copy if on different arena\" behavior if the necessary methods\n// exist on the contained type. In particular, we rely on MergeFrom() existing\n// as a general proxy for the fact that a copy will work, and we also provide a\n// specific override for string*.\ntemplate <typename T>\nstruct TypeImplementsMergeBehaviorProbeForMergeFrom {\n  typedef char HasMerge;\n  typedef long HasNoMerge;\n\n  // We accept either of:\n  // - void MergeFrom(const T& other)\n  // - bool MergeFrom(const T& other)\n  //\n  // We mangle these names a bit to avoid compatibility issues in 'unclean'\n  // include environments that may have, e.g., \"#define test ...\" (yes, this\n  // exists).\n  template<typename U, typename RetType, RetType (U::*)(const U& arg)>\n      struct CheckType;\n  template<typename U> static HasMerge Check(\n      CheckType<U, void, &U::MergeFrom>*);\n  template<typename U> static HasMerge Check(\n      CheckType<U, bool, &U::MergeFrom>*);\n  template<typename U> static HasNoMerge Check(...);\n\n  // Resolves to either std::true_type or std::false_type.\n  typedef std::integral_constant<bool,\n               (sizeof(Check<T>(0)) == sizeof(HasMerge))> type;\n};\n\ntemplate <typename T, typename = void>\nstruct TypeImplementsMergeBehavior :\n    TypeImplementsMergeBehaviorProbeForMergeFrom<T> {};\n\n\ntemplate <>\nstruct TypeImplementsMergeBehavior< ::std::string> {\n  typedef std::true_type type;\n};\n\n// This is the common base class for RepeatedPtrFields.  It deals only in void*\n// pointers.  Users should not use this interface directly.\n//\n// The methods of this interface correspond to the methods of RepeatedPtrField,\n// but may have a template argument called TypeHandler.  Its signature is:\n//   class TypeHandler {\n//    public:\n//     typedef MyType Type;\n//     // WeakType is almost always the same as MyType, but we use it in\n//     // ImplicitWeakTypeHandler.\n//     typedef MyType WeakType;\n//     static Type* New();\n//     static WeakType* NewFromPrototype(const WeakType* prototype,\n//                                       ::google::protobuf::Arena* arena);\n//     static void Delete(Type*);\n//     static void Clear(Type*);\n//     static void Merge(const Type& from, Type* to);\n//\n//     // Only needs to be implemented if SpaceUsedExcludingSelf() is called.\n//     static int SpaceUsedLong(const Type&);\n//   };\nclass LIBPROTOBUF_EXPORT RepeatedPtrFieldBase {\n protected:\n  RepeatedPtrFieldBase();\n  explicit RepeatedPtrFieldBase(::google::protobuf::Arena* arena);\n  ~RepeatedPtrFieldBase() {}\n\n  // Must be called from destructor.\n  template <typename TypeHandler>\n  void Destroy();\n\n  bool empty() const;\n  int size() const;\n\n  template <typename TypeHandler>\n  typename TypeHandler::Type* Mutable(int index);\n  template <typename TypeHandler>\n  void Delete(int index);\n  template <typename TypeHandler>\n  typename TypeHandler::Type* Add(typename TypeHandler::Type* prototype = NULL);\n\n public:\n  // The next few methods are public so that they can be called from generated\n  // code when implicit weak fields are used, but they should never be called by\n  // application code.\n\n  template <typename TypeHandler>\n  const typename TypeHandler::WeakType& Get(int index) const;\n\n  // Creates and adds an element using the given prototype, without introducing\n  // a link-time dependency on the concrete message type. This method is used to\n  // implement implicit weak fields. The prototype may be NULL, in which case an\n  // ImplicitWeakMessage will be used as a placeholder.\n  google::protobuf::MessageLite* AddWeak(const google::protobuf::MessageLite* prototype);\n\n  template <typename TypeHandler>\n  void Clear();\n\n  template <typename TypeHandler>\n  void MergeFrom(const RepeatedPtrFieldBase& other);\n\n  inline void InternalSwap(RepeatedPtrFieldBase* other);\n\n protected:\n  template <typename TypeHandler>\n  void Add(typename TypeHandler::Type&& value,\n           std::enable_if<TypeHandler::Moveable>* dummy = NULL);\n\n  template <typename TypeHandler>\n  void RemoveLast();\n  template <typename TypeHandler>\n  void CopyFrom(const RepeatedPtrFieldBase& other);\n\n  void CloseGap(int start, int num);\n\n  void Reserve(int new_size);\n\n  int Capacity() const;\n\n  // Used for constructing iterators.\n  void* const* raw_data() const;\n  void** raw_mutable_data() const;\n\n  template <typename TypeHandler>\n  typename TypeHandler::Type** mutable_data();\n  template <typename TypeHandler>\n  const typename TypeHandler::Type* const* data() const;\n\n  template <typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  void Swap(RepeatedPtrFieldBase* other);\n\n  void SwapElements(int index1, int index2);\n\n  template <typename TypeHandler>\n  size_t SpaceUsedExcludingSelfLong() const;\n\n  // Advanced memory management --------------------------------------\n\n  // Like Add(), but if there are no cleared objects to use, returns NULL.\n  template <typename TypeHandler>\n  typename TypeHandler::Type* AddFromCleared();\n\n  template<typename TypeHandler>\n  void AddAllocated(typename TypeHandler::Type* value) {\n    typename TypeImplementsMergeBehavior<typename TypeHandler::Type>::type t;\n    AddAllocatedInternal<TypeHandler>(value, t);\n  }\n\n  template <typename TypeHandler>\n  void UnsafeArenaAddAllocated(typename TypeHandler::Type* value);\n\n  template <typename TypeHandler>\n  typename TypeHandler::Type* ReleaseLast() {\n    typename TypeImplementsMergeBehavior<typename TypeHandler::Type>::type t;\n    return ReleaseLastInternal<TypeHandler>(t);\n  }\n\n  // Releases last element and returns it, but does not do out-of-arena copy.\n  // And just returns the raw pointer to the contained element in the arena.\n  template <typename TypeHandler>\n  typename TypeHandler::Type* UnsafeArenaReleaseLast();\n\n  int ClearedCount() const;\n  template <typename TypeHandler>\n  void AddCleared(typename TypeHandler::Type* value);\n  template <typename TypeHandler>\n  typename TypeHandler::Type* ReleaseCleared();\n\n  template <typename TypeHandler>\n  void AddAllocatedInternal(typename TypeHandler::Type* value, std::true_type);\n  template <typename TypeHandler>\n  void AddAllocatedInternal(typename TypeHandler::Type* value, std::false_type);\n\n  template <typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE\n  void AddAllocatedSlowWithCopy(typename TypeHandler::Type* value,\n                                Arena* value_arena,\n                                Arena* my_arena);\n  template <typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE\n  void AddAllocatedSlowWithoutCopy(typename TypeHandler::Type* value);\n\n  template <typename TypeHandler>\n  typename TypeHandler::Type* ReleaseLastInternal(std::true_type);\n  template <typename TypeHandler>\n  typename TypeHandler::Type* ReleaseLastInternal(std::false_type);\n\n  template<typename TypeHandler> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE\n  void SwapFallback(RepeatedPtrFieldBase* other);\n\n  inline Arena* GetArenaNoVirtual() const {\n    return arena_;\n  }\n\n private:\n  static const int kInitialSize = 0;\n  // A few notes on internal representation:\n  //\n  // We use an indirected approach, with struct Rep, to keep\n  // sizeof(RepeatedPtrFieldBase) equivalent to what it was before arena support\n  // was added, namely, 3 8-byte machine words on x86-64. An instance of Rep is\n  // allocated only when the repeated field is non-empty, and it is a\n  // dynamically-sized struct (the header is directly followed by elements[]).\n  // We place arena_ and current_size_ directly in the object to avoid cache\n  // misses due to the indirection, because these fields are checked frequently.\n  // Placing all fields directly in the RepeatedPtrFieldBase instance costs\n  // significant performance for memory-sensitive workloads.\n  Arena* arena_;\n  int    current_size_;\n  int    total_size_;\n  struct Rep {\n    int    allocated_size;\n    void*  elements[1];\n  };\n  static const size_t kRepHeaderSize = sizeof(Rep) - sizeof(void*);\n  // Contains arena ptr and the elements array. We also keep the invariant that\n  // if rep_ is NULL, then arena is NULL.\n  Rep* rep_;\n\n  template <typename TypeHandler>\n  static inline typename TypeHandler::Type* cast(void* element) {\n    return reinterpret_cast<typename TypeHandler::Type*>(element);\n  }\n  template <typename TypeHandler>\n  static inline const typename TypeHandler::Type* cast(const void* element) {\n    return reinterpret_cast<const typename TypeHandler::Type*>(element);\n  }\n\n  // Non-templated inner function to avoid code duplication. Takes a function\n  // pointer to the type-specific (templated) inner allocate/merge loop.\n  void MergeFromInternal(\n      const RepeatedPtrFieldBase& other,\n      void (RepeatedPtrFieldBase::*inner_loop)(void**, void**, int, int));\n\n  template<typename TypeHandler>\n  void MergeFromInnerLoop(\n      void** our_elems, void** other_elems, int length, int already_allocated);\n\n  // Internal helper: extend array space if necessary to contain |extend_amount|\n  // more elements, and return a pointer to the element immediately following\n  // the old list of elements.  This interface factors out common behavior from\n  // Reserve() and MergeFrom() to reduce code size. |extend_amount| must be > 0.\n  void** InternalExtend(int extend_amount);\n\n  // The reflection implementation needs to call protected methods directly,\n  // reinterpreting pointers as being to Message instead of a specific Message\n  // subclass.\n  friend class GeneratedMessageReflection;\n\n  // ExtensionSet stores repeated message extensions as\n  // RepeatedPtrField<MessageLite>, but non-lite ExtensionSets need to implement\n  // SpaceUsedLong(), and thus need to call SpaceUsedExcludingSelfLong()\n  // reinterpreting MessageLite as Message.  ExtensionSet also needs to make use\n  // of AddFromCleared(), which is not part of the public interface.\n  friend class ExtensionSet;\n\n  // The MapFieldBase implementation needs to call protected methods directly,\n  // reinterpreting pointers as being to Message instead of a specific Message\n  // subclass.\n  friend class MapFieldBase;\n\n  // The table-driven MergePartialFromCodedStream implementation needs to\n  // operate on RepeatedPtrField<MessageLite>.\n  friend class MergePartialFromCodedStreamHelper;\n\n  // To parse directly into a proto2 generated class, the upb class GMR_Handlers\n  // needs to be able to modify a RepeatedPtrFieldBase directly.\n  friend class upb::google_opensource::GMR_Handlers;\n\n  friend class AccessorHelper;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPtrFieldBase);\n};\n\ntemplate <typename GenericType>\nclass GenericTypeHandler {\n public:\n  typedef GenericType Type;\n  typedef GenericType WeakType;\n  static const bool Moveable = false;\n\n  static inline GenericType* New(Arena* arena) {\n    return ::google::protobuf::Arena::CreateMaybeMessage<Type>(arena);\n  }\n  static inline GenericType* NewFromPrototype(\n      const GenericType* prototype, ::google::protobuf::Arena* arena = NULL);\n  static inline void Delete(GenericType* value, Arena* arena) {\n    if (arena == NULL) {\n      delete value;\n    }\n  }\n  static inline ::google::protobuf::Arena* GetArena(GenericType* value) {\n    return ::google::protobuf::Arena::GetArena<Type>(value);\n  }\n  static inline void* GetMaybeArenaPointer(GenericType* value) {\n    return ::google::protobuf::Arena::GetArena<Type>(value);\n  }\n\n  static inline void Clear(GenericType* value) { value->Clear(); }\n  GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE\n  static void Merge(const GenericType& from, GenericType* to);\n  static inline size_t SpaceUsedLong(const GenericType& value) {\n    return value.SpaceUsedLong();\n  }\n};\n\ntemplate <typename GenericType>\nGenericType* GenericTypeHandler<GenericType>::NewFromPrototype(\n    const GenericType* /* prototype */, ::google::protobuf::Arena* arena) {\n  return New(arena);\n}\ntemplate <typename GenericType>\nvoid GenericTypeHandler<GenericType>::Merge(const GenericType& from,\n                                            GenericType* to) {\n  to->MergeFrom(from);\n}\n\n// NewFromPrototype() and Merge() are not defined inline here, as we will need\n// to do a virtual function dispatch anyways to go from Message* to call\n// New/Merge.\ntemplate<>\nMessageLite* GenericTypeHandler<MessageLite>::NewFromPrototype(\n    const MessageLite* prototype, google::protobuf::Arena* arena);\ntemplate<>\ninline google::protobuf::Arena* GenericTypeHandler<MessageLite>::GetArena(\n    MessageLite* value) {\n  return value->GetArena();\n}\ntemplate<>\ninline void* GenericTypeHandler<MessageLite>::GetMaybeArenaPointer(\n    MessageLite* value) {\n  return value->GetMaybeArenaPointer();\n}\ntemplate <>\nvoid GenericTypeHandler<MessageLite>::Merge(const MessageLite& from,\n                                            MessageLite* to);\ntemplate<>\ninline void GenericTypeHandler<string>::Clear(string* value) {\n  value->clear();\n}\ntemplate<>\nvoid GenericTypeHandler<string>::Merge(const string& from,\n                                       string* to);\n\n// Declarations of the specialization as we cannot define them here, as the\n// header that defines ProtocolMessage depends on types defined in this header.\n#define DECLARE_SPECIALIZATIONS_FOR_BASE_PROTO_TYPES(TypeName)                 \\\n    template<>                                                                 \\\n    TypeName* GenericTypeHandler<TypeName>::NewFromPrototype(                  \\\n        const TypeName* prototype, google::protobuf::Arena* arena);                      \\\n    template<>                                                                 \\\n    google::protobuf::Arena* GenericTypeHandler<TypeName>::GetArena(                     \\\n        TypeName* value);                                                      \\\n    template<>                                                                 \\\n    void* GenericTypeHandler<TypeName>::GetMaybeArenaPointer(                  \\\n        TypeName* value);\n\n// Message specialization bodies defined in message.cc. This split is necessary\n// to allow proto2-lite (which includes this header) to be independent of\n// Message.\nDECLARE_SPECIALIZATIONS_FOR_BASE_PROTO_TYPES(Message)\n\n\n#undef DECLARE_SPECIALIZATIONS_FOR_BASE_PROTO_TYPES\n\nclass StringTypeHandler {\n public:\n  typedef string Type;\n  typedef string WeakType;\n  static const bool Moveable = std::is_move_constructible<Type>::value &&\n                               std::is_move_assignable<Type>::value;\n\n  static inline string* New(Arena* arena) {\n    return Arena::Create<string>(arena);\n  }\n  static inline string* New(Arena* arena, string&& value) {\n    return Arena::Create<string>(arena, std::move(value));\n  }\n  static inline string* NewFromPrototype(const string*,\n                                         ::google::protobuf::Arena* arena) {\n    return New(arena);\n  }\n  static inline ::google::protobuf::Arena* GetArena(string*) {\n    return NULL;\n  }\n  static inline void* GetMaybeArenaPointer(string* /* value */) {\n    return NULL;\n  }\n  static inline void Delete(string* value, Arena* arena) {\n    if (arena == NULL) {\n      delete value;\n    }\n  }\n  static inline void Clear(string* value) { value->clear(); }\n  static inline void Merge(const string& from, string* to) { *to = from; }\n  static size_t SpaceUsedLong(const string& value)  {\n    return sizeof(value) + StringSpaceUsedExcludingSelfLong(value);\n  }\n};\n\n}  // namespace internal\n\n// RepeatedPtrField is like RepeatedField, but used for repeated strings or\n// Messages.\ntemplate <typename Element>\nclass RepeatedPtrField final : private internal::RepeatedPtrFieldBase {\n public:\n  RepeatedPtrField();\n  explicit RepeatedPtrField(::google::protobuf::Arena* arena);\n\n  RepeatedPtrField(const RepeatedPtrField& other);\n  template <typename Iter>\n  RepeatedPtrField(Iter begin, const Iter& end);\n  ~RepeatedPtrField();\n\n  RepeatedPtrField& operator=(const RepeatedPtrField& other);\n\n  RepeatedPtrField(RepeatedPtrField&& other) noexcept;\n  RepeatedPtrField& operator=(RepeatedPtrField&& other) noexcept;\n\n  bool empty() const;\n  int size() const;\n\n  const Element& Get(int index) const;\n  Element* Mutable(int index);\n  Element* Add();\n  void Add(Element&& value);\n\n  const Element& operator[](int index) const { return Get(index); }\n  Element& operator[](int index) { return *Mutable(index); }\n\n  // Remove the last element in the array.\n  // Ownership of the element is retained by the array.\n  void RemoveLast();\n\n  // Delete elements with indices in the range [start .. start+num-1].\n  // Caution: implementation moves all elements with indices [start+num .. ].\n  // Calling this routine inside a loop can cause quadratic behavior.\n  void DeleteSubrange(int start, int num);\n\n  void Clear();\n  void MergeFrom(const RepeatedPtrField& other);\n  void CopyFrom(const RepeatedPtrField& other);\n\n  // Reserve space to expand the field to at least the given size.  This only\n  // resizes the pointer array; it doesn't allocate any objects.  If the\n  // array is grown, it will always be at least doubled in size.\n  void Reserve(int new_size);\n\n  int Capacity() const;\n\n  // Gets the underlying array.  This pointer is possibly invalidated by\n  // any add or remove operation.\n  Element** mutable_data();\n  const Element* const* data() const;\n\n  // Swap entire contents with \"other\". If they are on separate arenas, then\n  // copies data.\n  void Swap(RepeatedPtrField* other);\n\n  // Swap entire contents with \"other\". Caller should guarantee that either both\n  // fields are on the same arena or both are on the heap. Swapping between\n  // different arenas with this function is disallowed and is caught via\n  // GOOGLE_DCHECK.\n  void UnsafeArenaSwap(RepeatedPtrField* other);\n\n  // Swap two elements.\n  void SwapElements(int index1, int index2);\n\n  // STL-like iterator support\n  typedef internal::RepeatedPtrIterator<Element> iterator;\n  typedef internal::RepeatedPtrIterator<const Element> const_iterator;\n  typedef Element value_type;\n  typedef value_type& reference;\n  typedef const value_type& const_reference;\n  typedef value_type* pointer;\n  typedef const value_type* const_pointer;\n  typedef int size_type;\n  typedef ptrdiff_t difference_type;\n\n  iterator begin();\n  const_iterator begin() const;\n  const_iterator cbegin() const;\n  iterator end();\n  const_iterator end() const;\n  const_iterator cend() const;\n\n  // Reverse iterator support\n  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;\n  typedef std::reverse_iterator<iterator> reverse_iterator;\n  reverse_iterator rbegin() {\n    return reverse_iterator(end());\n  }\n  const_reverse_iterator rbegin() const {\n    return const_reverse_iterator(end());\n  }\n  reverse_iterator rend() {\n    return reverse_iterator(begin());\n  }\n  const_reverse_iterator rend() const {\n    return const_reverse_iterator(begin());\n  }\n\n  // Custom STL-like iterator that iterates over and returns the underlying\n  // pointers to Element rather than Element itself.\n  typedef internal::RepeatedPtrOverPtrsIterator<Element*, void*>\n      pointer_iterator;\n  typedef internal::RepeatedPtrOverPtrsIterator<const Element* const,\n                                                const void* const>\n      const_pointer_iterator;\n  pointer_iterator pointer_begin();\n  const_pointer_iterator pointer_begin() const;\n  pointer_iterator pointer_end();\n  const_pointer_iterator pointer_end() const;\n\n  // Returns (an estimate of) the number of bytes used by the repeated field,\n  // excluding sizeof(*this).\n  size_t SpaceUsedExcludingSelfLong() const;\n\n  int SpaceUsedExcludingSelf() const {\n    return internal::ToIntSize(SpaceUsedExcludingSelfLong());\n  }\n\n  // Advanced memory management --------------------------------------\n  // When hardcore memory management becomes necessary -- as it sometimes\n  // does here at Google -- the following methods may be useful.\n\n  // Add an already-allocated object, passing ownership to the\n  // RepeatedPtrField.\n  //\n  // Note that some special behavior occurs with respect to arenas:\n  //\n  //   (i) if this field holds submessages, the new submessage will be copied if\n  //   the original is in an arena and this RepeatedPtrField is either in a\n  //   different arena, or on the heap.\n  //   (ii) if this field holds strings, the passed-in string *must* be\n  //   heap-allocated, not arena-allocated. There is no way to dynamically check\n  //   this at runtime, so User Beware.\n  void AddAllocated(Element* value);\n\n  // Remove the last element and return it, passing ownership to the caller.\n  // Requires:  size() > 0\n  //\n  // If this RepeatedPtrField is on an arena, an object copy is required to pass\n  // ownership back to the user (for compatible semantics). Use\n  // UnsafeArenaReleaseLast() if this behavior is undesired.\n  Element* ReleaseLast();\n\n  // Add an already-allocated object, skipping arena-ownership checks. The user\n  // must guarantee that the given object is in the same arena as this\n  // RepeatedPtrField.\n  // It is also useful in legacy code that uses temporary ownership to avoid\n  // copies. Example:\n  //   RepeatedPtrField<T> temp_field;\n  //   temp_field.AddAllocated(new T);\n  //   ... // Do something with temp_field\n  //   temp_field.ExtractSubrange(0, temp_field.size(), nullptr);\n  // If you put temp_field on the arena this fails, because the ownership\n  // transfers to the arena at the \"AddAllocated\" call and is not released\n  // anymore causing a double delete. UnsafeArenaAddAllocated prevents this.\n  void UnsafeArenaAddAllocated(Element* value);\n\n  // Remove the last element and return it.  Works only when operating on an\n  // arena. The returned pointer is to the original object in the arena, hence\n  // has the arena's lifetime.\n  // Requires:  current_size_ > 0\n  Element* UnsafeArenaReleaseLast();\n\n  // Extract elements with indices in the range \"[start .. start+num-1]\".\n  // The caller assumes ownership of the extracted elements and is responsible\n  // for deleting them when they are no longer needed.\n  // If \"elements\" is non-NULL, then pointers to the extracted elements\n  // are stored in \"elements[0 .. num-1]\" for the convenience of the caller.\n  // If \"elements\" is NULL, then the caller must use some other mechanism\n  // to perform any further operations (like deletion) on these elements.\n  // Caution: implementation also moves elements with indices [start+num ..].\n  // Calling this routine inside a loop can cause quadratic behavior.\n  //\n  // Memory copying behavior is identical to ReleaseLast(), described above: if\n  // this RepeatedPtrField is on an arena, an object copy is performed for each\n  // returned element, so that all returned element pointers are to\n  // heap-allocated copies. If this copy is not desired, the user should call\n  // UnsafeArenaExtractSubrange().\n  void ExtractSubrange(int start, int num, Element** elements);\n\n  // Identical to ExtractSubrange() described above, except that when this\n  // repeated field is on an arena, no object copies are performed. Instead, the\n  // raw object pointers are returned. Thus, if on an arena, the returned\n  // objects must not be freed, because they will not be heap-allocated objects.\n  void UnsafeArenaExtractSubrange(int start, int num, Element** elements);\n\n  // When elements are removed by calls to RemoveLast() or Clear(), they\n  // are not actually freed.  Instead, they are cleared and kept so that\n  // they can be reused later.  This can save lots of CPU time when\n  // repeatedly reusing a protocol message for similar purposes.\n  //\n  // Hardcore programs may choose to manipulate these cleared objects\n  // to better optimize memory management using the following routines.\n\n  // Get the number of cleared objects that are currently being kept\n  // around for reuse.\n  int ClearedCount() const;\n  // Add an element to the pool of cleared objects, passing ownership to\n  // the RepeatedPtrField.  The element must be cleared prior to calling\n  // this method.\n  //\n  // This method cannot be called when the repeated field is on an arena or when\n  // |value| is; both cases will trigger a GOOGLE_DCHECK-failure.\n  void AddCleared(Element* value);\n  // Remove a single element from the cleared pool and return it, passing\n  // ownership to the caller.  The element is guaranteed to be cleared.\n  // Requires:  ClearedCount() > 0\n  //\n  //\n  // This method cannot be called when the repeated field is on an arena; doing\n  // so will trigger a GOOGLE_DCHECK-failure.\n  Element* ReleaseCleared();\n\n  // Removes the element referenced by position.\n  //\n  // Returns an iterator to the element immediately following the removed\n  // element.\n  //\n  // Invalidates all iterators at or after the removed element, including end().\n  iterator erase(const_iterator position);\n\n  // Removes the elements in the range [first, last).\n  //\n  // Returns an iterator to the element immediately following the removed range.\n  //\n  // Invalidates all iterators at or after the removed range, including end().\n  iterator erase(const_iterator first, const_iterator last);\n\n  // Gets the arena on which this RepeatedPtrField stores its elements.\n  ::google::protobuf::Arena* GetArena() const {\n    return GetArenaNoVirtual();\n  }\n\n  // For internal use only.\n  //\n  // This is public due to it being called by generated code.\n  using RepeatedPtrFieldBase::InternalSwap;\n\n private:\n  // Note:  RepeatedPtrField SHOULD NOT be subclassed by users.\n  class TypeHandler;\n\n  // Internal arena accessor expected by helpers in Arena.\n  inline Arena* GetArenaNoVirtual() const;\n\n  // Implementations for ExtractSubrange(). The copying behavior must be\n  // included only if the type supports the necessary operations (e.g.,\n  // MergeFrom()), so we must resolve this at compile time. ExtractSubrange()\n  // uses SFINAE to choose one of the below implementations.\n  void ExtractSubrangeInternal(int start, int num, Element** elements,\n                               std::true_type);\n  void ExtractSubrangeInternal(int start, int num, Element** elements,\n                               std::false_type);\n\n  friend class Arena;\n  friend class MessageLite;\n\n  typedef void InternalArenaConstructable_;\n\n};\n\n// implementation ====================================================\n\ntemplate <typename Element>\ninline RepeatedField<Element>::RepeatedField()\n  : current_size_(0),\n    total_size_(0),\n    ptr_(NULL) {\n}\n\ntemplate <typename Element>\ninline RepeatedField<Element>::RepeatedField(Arena* arena)\n  : current_size_(0),\n    total_size_(0),\n    ptr_(arena) {\n}\n\ntemplate <typename Element>\ninline RepeatedField<Element>::RepeatedField(const RepeatedField& other)\n  : current_size_(0),\n    total_size_(0),\n    ptr_(NULL) {\n  if (other.current_size_ != 0) {\n    Reserve(other.size());\n    AddNAlreadyReserved(other.size());\n    CopyArray(Mutable(0), &other.Get(0), other.size());\n  }\n}\n\ntemplate <typename Element>\ntemplate <typename Iter>\nRepeatedField<Element>::RepeatedField(Iter begin, const Iter& end)\n  : current_size_(0),\n    total_size_(0),\n    ptr_(NULL) {\n  int reserve = internal::CalculateReserve(begin, end);\n  if (reserve != -1) {\n    Reserve(reserve);\n    for (; begin != end; ++begin) {\n      AddAlreadyReserved(*begin);\n    }\n  } else {\n    for (; begin != end; ++begin) {\n      Add(*begin);\n    }\n  }\n}\n\ntemplate <typename Element>\nRepeatedField<Element>::~RepeatedField() {\n  if (total_size_ > 0) {\n    InternalDeallocate(rep(), total_size_);\n  }\n}\n\ntemplate <typename Element>\ninline RepeatedField<Element>&\nRepeatedField<Element>::operator=(const RepeatedField& other) {\n  if (this != &other)\n    CopyFrom(other);\n  return *this;\n}\n\ntemplate <typename Element>\ninline RepeatedField<Element>::RepeatedField(RepeatedField&& other) noexcept\n    : RepeatedField() {\n  // We don't just call Swap(&other) here because it would perform 3 copies if\n  // the two fields are on different arenas.\n  if (other.GetArenaNoVirtual()) {\n    CopyFrom(other);\n  } else {\n    InternalSwap(&other);\n  }\n}\n\ntemplate <typename Element>\ninline RepeatedField<Element>& RepeatedField<Element>::operator=(\n    RepeatedField&& other) noexcept {\n  // We don't just call Swap(&other) here because it would perform 3 copies if\n  // the two fields are on different arenas.\n  if (this != &other) {\n    if (this->GetArenaNoVirtual() != other.GetArenaNoVirtual()) {\n      CopyFrom(other);\n    } else {\n      InternalSwap(&other);\n    }\n  }\n  return *this;\n}\n\ntemplate <typename Element>\ninline bool RepeatedField<Element>::empty() const {\n  return current_size_ == 0;\n}\n\ntemplate <typename Element>\ninline int RepeatedField<Element>::size() const {\n  return current_size_;\n}\n\ntemplate <typename Element>\ninline int RepeatedField<Element>::Capacity() const {\n  return total_size_;\n}\n\ntemplate<typename Element>\ninline void RepeatedField<Element>::AddAlreadyReserved(const Element& value) {\n  GOOGLE_DCHECK_LT(current_size_, total_size_);\n  rep()->elements[current_size_++] = value;\n}\n\ntemplate<typename Element>\ninline Element* RepeatedField<Element>::AddAlreadyReserved() {\n  GOOGLE_DCHECK_LT(current_size_, total_size_);\n  return &rep()->elements[current_size_++];\n}\n\ntemplate<typename Element>\ninline Element* RepeatedField<Element>::AddNAlreadyReserved(int elements) {\n  GOOGLE_DCHECK_LE(current_size_ + elements, total_size_);\n  // Warning: total_size_ can be NULL if elements == 0 && current_size_ == 0.\n  // Existing callers depend on this behavior. :(\n  Element* ret = &ptr_.rep->elements[current_size_];\n  current_size_ += elements;\n  return ret;\n}\n\ntemplate<typename Element>\ninline void RepeatedField<Element>::Resize(int new_size, const Element& value) {\n  GOOGLE_DCHECK_GE(new_size, 0);\n  if (new_size > current_size_) {\n    Reserve(new_size);\n    std::fill(&rep()->elements[current_size_],\n              &rep()->elements[new_size], value);\n  }\n  current_size_ = new_size;\n}\n\ntemplate <typename Element>\ninline const Element& RepeatedField<Element>::Get(int index) const {\n  GOOGLE_DCHECK_GE(index, 0);\n  GOOGLE_DCHECK_LT(index, current_size_);\n  return rep()->elements[index];\n}\n\ntemplate <typename Element>\ninline Element* RepeatedField<Element>::Mutable(int index) {\n  GOOGLE_DCHECK_GE(index, 0);\n  GOOGLE_DCHECK_LT(index, current_size_);\n  return &rep()->elements[index];\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::Set(int index, const Element& value) {\n  GOOGLE_DCHECK_GE(index, 0);\n  GOOGLE_DCHECK_LT(index, current_size_);\n  rep()->elements[index] = value;\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::Add(const Element& value) {\n  if (current_size_ == total_size_) Reserve(total_size_ + 1);\n  rep()->elements[current_size_++] = value;\n}\n\ntemplate <typename Element>\ninline Element* RepeatedField<Element>::Add() {\n  if (current_size_ == total_size_) Reserve(total_size_ + 1);\n  return &rep()->elements[current_size_++];\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::RemoveLast() {\n  GOOGLE_DCHECK_GT(current_size_, 0);\n  current_size_--;\n}\n\ntemplate <typename Element>\nvoid RepeatedField<Element>::ExtractSubrange(\n    int start, int num, Element* elements) {\n  GOOGLE_DCHECK_GE(start, 0);\n  GOOGLE_DCHECK_GE(num, 0);\n  GOOGLE_DCHECK_LE(start + num, this->current_size_);\n\n  // Save the values of the removed elements if requested.\n  if (elements != NULL) {\n    for (int i = 0; i < num; ++i)\n      elements[i] = this->Get(i + start);\n  }\n\n  // Slide remaining elements down to fill the gap.\n  if (num > 0) {\n    for (int i = start + num; i < this->current_size_; ++i)\n      this->Set(i - num, this->Get(i));\n    this->Truncate(this->current_size_ - num);\n  }\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::Clear() {\n  current_size_ = 0;\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::MergeFrom(const RepeatedField& other) {\n  GOOGLE_DCHECK_NE(&other, this);\n  if (other.current_size_ != 0) {\n    int existing_size = size();\n    Reserve(existing_size + other.size());\n    AddNAlreadyReserved(other.size());\n    CopyArray(Mutable(existing_size), &other.Get(0), other.size());\n  }\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::CopyFrom(const RepeatedField& other) {\n  if (&other == this) return;\n  Clear();\n  MergeFrom(other);\n}\n\ntemplate <typename Element>\ninline typename RepeatedField<Element>::iterator RepeatedField<Element>::erase(\n    const_iterator position) {\n  return erase(position, position + 1);\n}\n\ntemplate <typename Element>\ninline typename RepeatedField<Element>::iterator RepeatedField<Element>::erase(\n    const_iterator first, const_iterator last) {\n  size_type first_offset = first - cbegin();\n  if (first != last) {\n    Truncate(std::copy(last, cend(), begin() + first_offset) - cbegin());\n  }\n  return begin() + first_offset;\n}\n\ntemplate <typename Element>\ninline Element* RepeatedField<Element>::mutable_data() {\n  return total_size_ > 0 ? rep()->elements : NULL;\n}\n\ntemplate <typename Element>\ninline const Element* RepeatedField<Element>::data() const {\n  return total_size_ > 0 ? rep()->elements : NULL;\n}\n\ntemplate <typename Element>\ninline const Element* RepeatedField<Element>::unsafe_data() const {\n  return rep()->elements;\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::InternalSwap(RepeatedField* other) {\n  GOOGLE_DCHECK(this != other);\n  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());\n\n  std::swap(ptr_, other->ptr_);\n  std::swap(current_size_, other->current_size_);\n  std::swap(total_size_, other->total_size_);\n}\n\ntemplate <typename Element>\nvoid RepeatedField<Element>::Swap(RepeatedField* other) {\n  if (this == other) return;\n  if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {\n    InternalSwap(other);\n  } else {\n    RepeatedField<Element> temp(other->GetArenaNoVirtual());\n    temp.MergeFrom(*this);\n    CopyFrom(*other);\n    other->UnsafeArenaSwap(&temp);\n  }\n}\n\ntemplate <typename Element>\nvoid RepeatedField<Element>::UnsafeArenaSwap(RepeatedField* other) {\n  if (this == other) return;\n  InternalSwap(other);\n}\n\ntemplate <typename Element>\nvoid RepeatedField<Element>::SwapElements(int index1, int index2) {\n  using std::swap;  // enable ADL with fallback\n  swap(rep()->elements[index1], rep()->elements[index2]);\n}\n\ntemplate <typename Element>\ninline typename RepeatedField<Element>::iterator\nRepeatedField<Element>::begin() {\n  return total_size_ > 0 ? rep()->elements : NULL;\n}\ntemplate <typename Element>\ninline typename RepeatedField<Element>::const_iterator\nRepeatedField<Element>::begin() const {\n  return total_size_ > 0 ? rep()->elements : NULL;\n}\ntemplate <typename Element>\ninline typename RepeatedField<Element>::const_iterator\nRepeatedField<Element>::cbegin() const {\n  return total_size_ > 0 ? rep()->elements : NULL;\n}\ntemplate <typename Element>\ninline typename RepeatedField<Element>::iterator\nRepeatedField<Element>::end() {\n  return total_size_ > 0 ? rep()->elements + current_size_ : NULL;\n}\ntemplate <typename Element>\ninline typename RepeatedField<Element>::const_iterator\nRepeatedField<Element>::end() const {\n  return total_size_ > 0 ? rep()->elements + current_size_ : NULL;\n}\ntemplate <typename Element>\ninline typename RepeatedField<Element>::const_iterator\nRepeatedField<Element>::cend() const {\n  return total_size_ > 0 ? rep()->elements + current_size_ : NULL;\n}\n\ntemplate <typename Element>\ninline size_t RepeatedField<Element>::SpaceUsedExcludingSelfLong() const {\n  return total_size_ > 0 ? (total_size_ * sizeof(Element) + kRepHeaderSize) : 0;\n}\n\n// Avoid inlining of Reserve(): new, copy, and delete[] lead to a significant\n// amount of code bloat.\ntemplate <typename Element>\nvoid RepeatedField<Element>::Reserve(int new_size) {\n  if (total_size_ >= new_size) return;\n  Rep* old_rep = total_size_ > 0 ? rep() : NULL;\n  Arena* arena = GetArenaNoVirtual();\n  new_size = std::max(google::protobuf::internal::kMinRepeatedFieldAllocationSize,\n                      std::max(total_size_ * 2, new_size));\n  GOOGLE_DCHECK_LE(\n      static_cast<size_t>(new_size),\n      (std::numeric_limits<size_t>::max() - kRepHeaderSize) / sizeof(Element))\n      << \"Requested size is too large to fit into size_t.\";\n  size_t bytes = kRepHeaderSize + sizeof(Element) * static_cast<size_t>(new_size);\n  if (arena == NULL) {\n    ptr_.rep = static_cast<Rep*>(::operator new(bytes));\n  } else {\n    ptr_.rep = reinterpret_cast<Rep*>(\n            ::google::protobuf::Arena::CreateArray<char>(arena, bytes));\n  }\n  ptr_.rep->arena = arena;\n  int old_total_size = total_size_;\n  total_size_ = new_size;\n  // Invoke placement-new on newly allocated elements. We shouldn't have to do\n  // this, since Element is supposed to be POD, but a previous version of this\n  // code allocated storage with \"new Element[size]\" and some code uses\n  // RepeatedField with non-POD types, relying on constructor invocation. If\n  // Element has a trivial constructor (e.g., int32), gcc (tested with -O2)\n  // completely removes this loop because the loop body is empty, so this has no\n  // effect unless its side-effects are required for correctness.\n  // Note that we do this before MoveArray() below because Element's copy\n  // assignment implementation will want an initialized instance first.\n  Element* e = &rep()->elements[0];\n  Element* limit = e + total_size_;\n  for (; e < limit; e++) {\n    new (e) Element;\n  }\n  if (current_size_ > 0) {\n    MoveArray(&rep()->elements[0], old_rep->elements, current_size_);\n  }\n\n  // Likewise, we need to invoke destructors on the old array.\n  InternalDeallocate(old_rep, old_total_size);\n\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::Truncate(int new_size) {\n  GOOGLE_DCHECK_LE(new_size, current_size_);\n  if (current_size_ > 0) {\n    current_size_ = new_size;\n  }\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::MoveArray(\n  Element* to, Element* from, int array_size) {\n  CopyArray(to, from, array_size);\n}\n\ntemplate <typename Element>\ninline void RepeatedField<Element>::CopyArray(\n  Element* to, const Element* from, int array_size) {\n  internal::ElementCopier<Element>()(to, from, array_size);\n}\n\nnamespace internal {\n\ntemplate <typename Element, bool HasTrivialCopy>\nvoid ElementCopier<Element, HasTrivialCopy>::operator()(\n  Element* to, const Element* from, int array_size) {\n  std::copy(from, from + array_size, to);\n}\n\ntemplate <typename Element>\nstruct ElementCopier<Element, true> {\n  void operator()(Element* to, const Element* from, int array_size) {\n    memcpy(to, from, static_cast<size_t>(array_size) * sizeof(Element));\n  }\n};\n\n}  // namespace internal\n\n\n// -------------------------------------------------------------------\n\nnamespace internal {\n\ninline RepeatedPtrFieldBase::RepeatedPtrFieldBase()\n  : arena_(NULL),\n    current_size_(0),\n    total_size_(0),\n    rep_(NULL) {\n}\n\ninline RepeatedPtrFieldBase::RepeatedPtrFieldBase(::google::protobuf::Arena* arena)\n  : arena_(arena),\n    current_size_(0),\n    total_size_(0),\n    rep_(NULL) {\n}\n\ntemplate <typename TypeHandler>\nvoid RepeatedPtrFieldBase::Destroy() {\n  if (rep_ != NULL && arena_ == NULL) {\n    int n = rep_->allocated_size;\n    void* const* elements = rep_->elements;\n    for (int i = 0; i < n; i++) {\n      TypeHandler::Delete(cast<TypeHandler>(elements[i]), NULL);\n    }\n#if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)\n    const size_t size = total_size_ * sizeof(elements[0]) + kRepHeaderSize;\n    ::operator delete(static_cast<void*>(rep_), size);\n#else\n    ::operator delete(static_cast<void*>(rep_));\n#endif\n  }\n  rep_ = NULL;\n}\n\ntemplate <typename TypeHandler>\ninline void RepeatedPtrFieldBase::Swap(RepeatedPtrFieldBase* other) {\n  if (other->GetArenaNoVirtual() == GetArenaNoVirtual()) {\n    InternalSwap(other);\n  } else {\n    SwapFallback<TypeHandler>(other);\n  }\n}\n\ntemplate <typename TypeHandler>\nvoid RepeatedPtrFieldBase::SwapFallback(RepeatedPtrFieldBase* other) {\n  GOOGLE_DCHECK(other->GetArenaNoVirtual() != GetArenaNoVirtual());\n\n  // Copy semantics in this case. We try to improve efficiency by placing the\n  // temporary on |other|'s arena so that messages are copied cross-arena only\n  // once, not twice.\n  RepeatedPtrFieldBase temp(other->GetArenaNoVirtual());\n  temp.MergeFrom<TypeHandler>(*this);\n  this->Clear<TypeHandler>();\n  this->MergeFrom<TypeHandler>(*other);\n  other->Clear<TypeHandler>();\n  other->InternalSwap(&temp);\n  temp.Destroy<TypeHandler>();  // Frees rep_ if `other` had no arena.\n}\n\ninline bool RepeatedPtrFieldBase::empty() const {\n  return current_size_ == 0;\n}\n\ninline int RepeatedPtrFieldBase::size() const {\n  return current_size_;\n}\n\ntemplate <typename TypeHandler>\ninline const typename TypeHandler::WeakType&\nRepeatedPtrFieldBase::Get(int index) const {\n  GOOGLE_DCHECK_GE(index, 0);\n  GOOGLE_DCHECK_LT(index, current_size_);\n  return *cast<TypeHandler>(rep_->elements[index]);\n}\n\ntemplate <typename TypeHandler>\ninline typename TypeHandler::Type*\nRepeatedPtrFieldBase::Mutable(int index) {\n  GOOGLE_DCHECK_GE(index, 0);\n  GOOGLE_DCHECK_LT(index, current_size_);\n  return cast<TypeHandler>(rep_->elements[index]);\n}\n\ntemplate <typename TypeHandler>\ninline void RepeatedPtrFieldBase::Delete(int index) {\n  GOOGLE_DCHECK_GE(index, 0);\n  GOOGLE_DCHECK_LT(index, current_size_);\n  TypeHandler::Delete(cast<TypeHandler>(rep_->elements[index]), arena_);\n}\n\ntemplate <typename TypeHandler>\ninline typename TypeHandler::Type* RepeatedPtrFieldBase::Add(\n    typename TypeHandler::Type* prototype) {\n  if (rep_ != NULL && current_size_ < rep_->allocated_size) {\n    return cast<TypeHandler>(rep_->elements[current_size_++]);\n  }\n  if (!rep_ || rep_->allocated_size == total_size_) {\n    Reserve(total_size_ + 1);\n  }\n  ++rep_->allocated_size;\n  typename TypeHandler::Type* result =\n      TypeHandler::NewFromPrototype(prototype, arena_);\n  rep_->elements[current_size_++] = result;\n  return result;\n}\n\ntemplate <typename TypeHandler>\ninline void RepeatedPtrFieldBase::Add(\n    typename TypeHandler::Type&& value,\n    std::enable_if<TypeHandler::Moveable>*) {\n  if (rep_ != NULL && current_size_ < rep_->allocated_size) {\n    *cast<TypeHandler>(rep_->elements[current_size_++]) = std::move(value);\n    return;\n  }\n  if (!rep_ || rep_->allocated_size == total_size_) {\n    Reserve(total_size_ + 1);\n  }\n  ++rep_->allocated_size;\n  typename TypeHandler::Type* result =\n      TypeHandler::New(arena_, std::move(value));\n  rep_->elements[current_size_++] = result;\n}\n\ntemplate <typename TypeHandler>\ninline void RepeatedPtrFieldBase::RemoveLast() {\n  GOOGLE_DCHECK_GT(current_size_, 0);\n  TypeHandler::Clear(cast<TypeHandler>(rep_->elements[--current_size_]));\n}\n\ntemplate <typename TypeHandler>\nvoid RepeatedPtrFieldBase::Clear() {\n  const int n = current_size_;\n  GOOGLE_DCHECK_GE(n, 0);\n  if (n > 0) {\n    void* const* elements = rep_->elements;\n    int i = 0;\n    do {\n      TypeHandler::Clear(cast<TypeHandler>(elements[i++]));\n    } while (i < n);\n    current_size_ = 0;\n  }\n}\n\n// To avoid unnecessary code duplication and reduce binary size, we use a\n// layered approach to implementing MergeFrom(). The toplevel method is\n// templated, so we get a small thunk per concrete message type in the binary.\n// This calls a shared implementation with most of the logic, passing a function\n// pointer to another type-specific piece of code that calls the object-allocate\n// and merge handlers.\ntemplate <typename TypeHandler>\ninline void RepeatedPtrFieldBase::MergeFrom(const RepeatedPtrFieldBase& other) {\n  GOOGLE_DCHECK_NE(&other, this);\n  if (other.current_size_ == 0) return;\n  MergeFromInternal(\n      other, &RepeatedPtrFieldBase::MergeFromInnerLoop<TypeHandler>);\n}\n\ninline void RepeatedPtrFieldBase::MergeFromInternal(\n    const RepeatedPtrFieldBase& other,\n    void (RepeatedPtrFieldBase::*inner_loop)(void**, void**, int, int)) {\n  // Note: wrapper has already guaranteed that other.rep_ != NULL here.\n  int other_size = other.current_size_;\n  void** other_elements = other.rep_->elements;\n  void** new_elements = InternalExtend(other_size);\n  int allocated_elems = rep_->allocated_size - current_size_;\n  (this->*inner_loop)(new_elements, other_elements,\n                      other_size, allocated_elems);\n  current_size_ += other_size;\n  if (rep_->allocated_size < current_size_) {\n    rep_->allocated_size = current_size_;\n  }\n}\n\n// Merges other_elems to our_elems.\ntemplate<typename TypeHandler>\nvoid RepeatedPtrFieldBase::MergeFromInnerLoop(\n    void** our_elems, void** other_elems, int length, int already_allocated) {\n  // Split into two loops, over ranges [0, allocated) and [allocated, length),\n  // to avoid a branch within the loop.\n  for (int i = 0; i < already_allocated && i < length; i++) {\n    // Already allocated: use existing element.\n    typename TypeHandler::WeakType* other_elem =\n        reinterpret_cast<typename TypeHandler::WeakType*>(other_elems[i]);\n    typename TypeHandler::WeakType* new_elem =\n        reinterpret_cast<typename TypeHandler::WeakType*>(our_elems[i]);\n    TypeHandler::Merge(*other_elem, new_elem);\n  }\n  Arena* arena = GetArenaNoVirtual();\n  for (int i = already_allocated; i < length; i++) {\n    // Not allocated: alloc a new element first, then merge it.\n    typename TypeHandler::WeakType* other_elem =\n        reinterpret_cast<typename TypeHandler::WeakType*>(other_elems[i]);\n    typename TypeHandler::WeakType* new_elem =\n        TypeHandler::NewFromPrototype(other_elem, arena);\n    TypeHandler::Merge(*other_elem, new_elem);\n    our_elems[i] = new_elem;\n  }\n}\n\ntemplate <typename TypeHandler>\ninline void RepeatedPtrFieldBase::CopyFrom(const RepeatedPtrFieldBase& other) {\n  if (&other == this) return;\n  RepeatedPtrFieldBase::Clear<TypeHandler>();\n  RepeatedPtrFieldBase::MergeFrom<TypeHandler>(other);\n}\n\ninline int RepeatedPtrFieldBase::Capacity() const {\n  return total_size_;\n}\n\ninline void* const* RepeatedPtrFieldBase::raw_data() const {\n  return rep_ ? rep_->elements : NULL;\n}\n\ninline void** RepeatedPtrFieldBase::raw_mutable_data() const {\n  return rep_ ? const_cast<void**>(rep_->elements) : NULL;\n}\n\ntemplate <typename TypeHandler>\ninline typename TypeHandler::Type** RepeatedPtrFieldBase::mutable_data() {\n  // TODO(kenton):  Breaks C++ aliasing rules.  We should probably remove this\n  //   method entirely.\n  return reinterpret_cast<typename TypeHandler::Type**>(raw_mutable_data());\n}\n\ntemplate <typename TypeHandler>\ninline const typename TypeHandler::Type* const*\nRepeatedPtrFieldBase::data() const {\n  // TODO(kenton):  Breaks C++ aliasing rules.  We should probably remove this\n  //   method entirely.\n  return reinterpret_cast<const typename TypeHandler::Type* const*>(raw_data());\n}\n\ninline void RepeatedPtrFieldBase::SwapElements(int index1, int index2) {\n  using std::swap;  // enable ADL with fallback\n  swap(rep_->elements[index1], rep_->elements[index2]);\n}\n\ntemplate <typename TypeHandler>\ninline size_t RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong() const {\n  size_t allocated_bytes = static_cast<size_t>(total_size_) * sizeof(void*);\n  if (rep_ != NULL) {\n    for (int i = 0; i < rep_->allocated_size; ++i) {\n      allocated_bytes += TypeHandler::SpaceUsedLong(\n          *cast<TypeHandler>(rep_->elements[i]));\n    }\n    allocated_bytes += kRepHeaderSize;\n  }\n  return allocated_bytes;\n}\n\ntemplate <typename TypeHandler>\ninline typename TypeHandler::Type* RepeatedPtrFieldBase::AddFromCleared() {\n  if (rep_ != NULL && current_size_ < rep_->allocated_size) {\n    return cast<TypeHandler>(rep_->elements[current_size_++]);\n  } else {\n    return NULL;\n  }\n}\n\n// AddAllocated version that implements arena-safe copying behavior.\ntemplate <typename TypeHandler>\nvoid RepeatedPtrFieldBase::AddAllocatedInternal(\n    typename TypeHandler::Type* value,\n    std::true_type) {\n  Arena* element_arena = reinterpret_cast<Arena*>(\n      TypeHandler::GetMaybeArenaPointer(value));\n  Arena* arena = GetArenaNoVirtual();\n  if (arena == element_arena && rep_ &&\n      rep_->allocated_size < total_size_) {\n    // Fast path: underlying arena representation (tagged pointer) is equal to\n    // our arena pointer, and we can add to array without resizing it (at least\n    // one slot that is not allocated).\n    void** elems = rep_->elements;\n    if (current_size_ < rep_->allocated_size) {\n      // Make space at [current] by moving first allocated element to end of\n      // allocated list.\n      elems[rep_->allocated_size] = elems[current_size_];\n    }\n    elems[current_size_] = value;\n    current_size_ = current_size_ + 1;\n    rep_->allocated_size = rep_->allocated_size + 1;\n  } else {\n    AddAllocatedSlowWithCopy<TypeHandler>(\n        value, TypeHandler::GetArena(value), arena);\n  }\n}\n\n// Slowpath handles all cases, copying if necessary.\ntemplate<typename TypeHandler>\nvoid RepeatedPtrFieldBase::AddAllocatedSlowWithCopy(\n    // Pass value_arena and my_arena to avoid duplicate virtual call (value) or\n    // load (mine).\n    typename TypeHandler::Type* value, Arena* value_arena, Arena* my_arena) {\n  // Ensure that either the value is in the same arena, or if not, we do the\n  // appropriate thing: Own() it (if it's on heap and we're in an arena) or copy\n  // it to our arena/heap (otherwise).\n  if (my_arena != NULL && value_arena == NULL) {\n    my_arena->Own(value);\n  } else if (my_arena != value_arena) {\n    typename TypeHandler::Type* new_value =\n        TypeHandler::NewFromPrototype(value, my_arena);\n    TypeHandler::Merge(*value, new_value);\n    TypeHandler::Delete(value, value_arena);\n    value = new_value;\n  }\n\n  UnsafeArenaAddAllocated<TypeHandler>(value);\n}\n\n// AddAllocated version that does not implement arena-safe copying behavior.\ntemplate <typename TypeHandler>\nvoid RepeatedPtrFieldBase::AddAllocatedInternal(\n    typename TypeHandler::Type* value,\n    std::false_type) {\n  if (rep_ &&  rep_->allocated_size < total_size_) {\n    // Fast path: underlying arena representation (tagged pointer) is equal to\n    // our arena pointer, and we can add to array without resizing it (at least\n    // one slot that is not allocated).\n    void** elems = rep_->elements;\n    if (current_size_ < rep_->allocated_size) {\n      // Make space at [current] by moving first allocated element to end of\n      // allocated list.\n      elems[rep_->allocated_size] = elems[current_size_];\n    }\n    elems[current_size_] = value;\n    current_size_ = current_size_ + 1;\n    ++rep_->allocated_size;\n  } else {\n    UnsafeArenaAddAllocated<TypeHandler>(value);\n  }\n}\n\ntemplate <typename TypeHandler>\nvoid RepeatedPtrFieldBase::UnsafeArenaAddAllocated(\n    typename TypeHandler::Type* value) {\n  // Make room for the new pointer.\n  if (!rep_ || current_size_ == total_size_) {\n    // The array is completely full with no cleared objects, so grow it.\n    Reserve(total_size_ + 1);\n    ++rep_->allocated_size;\n  } else if (rep_->allocated_size == total_size_) {\n    // There is no more space in the pointer array because it contains some\n    // cleared objects awaiting reuse.  We don't want to grow the array in this\n    // case because otherwise a loop calling AddAllocated() followed by Clear()\n    // would leak memory.\n    TypeHandler::Delete(\n        cast<TypeHandler>(rep_->elements[current_size_]), arena_);\n  } else if (current_size_ < rep_->allocated_size) {\n    // We have some cleared objects.  We don't care about their order, so we\n    // can just move the first one to the end to make space.\n    rep_->elements[rep_->allocated_size] = rep_->elements[current_size_];\n    ++rep_->allocated_size;\n  } else {\n    // There are no cleared objects.\n    ++rep_->allocated_size;\n  }\n\n  rep_->elements[current_size_++] = value;\n}\n\n// ReleaseLast() for types that implement merge/copy behavior.\ntemplate <typename TypeHandler>\ninline typename TypeHandler::Type*\nRepeatedPtrFieldBase::ReleaseLastInternal(std::true_type) {\n  // First, release an element.\n  typename TypeHandler::Type* result = UnsafeArenaReleaseLast<TypeHandler>();\n  // Now perform a copy if we're on an arena.\n  Arena* arena = GetArenaNoVirtual();\n  if (arena == NULL) {\n    return result;\n  } else {\n    typename TypeHandler::Type* new_result =\n        TypeHandler::NewFromPrototype(result, NULL);\n    TypeHandler::Merge(*result, new_result);\n    return new_result;\n  }\n}\n\n// ReleaseLast() for types that *do not* implement merge/copy behavior -- this\n// is the same as UnsafeArenaReleaseLast(). Note that we GOOGLE_DCHECK-fail if we're on\n// an arena, since the user really should implement the copy operation in this\n// case.\ntemplate <typename TypeHandler>\ninline typename TypeHandler::Type*\nRepeatedPtrFieldBase::ReleaseLastInternal(std::false_type) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL)\n      << \"ReleaseLast() called on a RepeatedPtrField that is on an arena, \"\n      << \"with a type that does not implement MergeFrom. This is unsafe; \"\n      << \"please implement MergeFrom for your type.\";\n  return UnsafeArenaReleaseLast<TypeHandler>();\n}\n\ntemplate <typename TypeHandler>\ninline typename TypeHandler::Type*\n  RepeatedPtrFieldBase::UnsafeArenaReleaseLast() {\n  GOOGLE_DCHECK_GT(current_size_, 0);\n  typename TypeHandler::Type* result =\n      cast<TypeHandler>(rep_->elements[--current_size_]);\n  --rep_->allocated_size;\n  if (current_size_ < rep_->allocated_size) {\n    // There are cleared elements on the end; replace the removed element\n    // with the last allocated element.\n    rep_->elements[current_size_] = rep_->elements[rep_->allocated_size];\n  }\n  return result;\n}\n\ninline int RepeatedPtrFieldBase::ClearedCount() const {\n  return rep_ ? (rep_->allocated_size - current_size_) : 0;\n}\n\ntemplate <typename TypeHandler>\ninline void RepeatedPtrFieldBase::AddCleared(\n    typename TypeHandler::Type* value) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL)\n      << \"AddCleared() can only be used on a RepeatedPtrField not on an arena.\";\n  GOOGLE_DCHECK(TypeHandler::GetArena(value) == NULL)\n      << \"AddCleared() can only accept values not on an arena.\";\n  if (!rep_ || rep_->allocated_size == total_size_) {\n    Reserve(total_size_ + 1);\n  }\n  rep_->elements[rep_->allocated_size++] = value;\n}\n\ntemplate <typename TypeHandler>\ninline typename TypeHandler::Type* RepeatedPtrFieldBase::ReleaseCleared() {\n  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL)\n      << \"ReleaseCleared() can only be used on a RepeatedPtrField not on \"\n      << \"an arena.\";\n  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);\n  GOOGLE_DCHECK(rep_ != NULL);\n  GOOGLE_DCHECK_GT(rep_->allocated_size, current_size_);\n  return cast<TypeHandler>(rep_->elements[--rep_->allocated_size]);\n}\n\n}  // namespace internal\n\n// -------------------------------------------------------------------\n\ntemplate <typename Element>\nclass RepeatedPtrField<Element>::TypeHandler\n    : public internal::GenericTypeHandler<Element> {\n};\n\ntemplate <>\nclass RepeatedPtrField<string>::TypeHandler\n    : public internal::StringTypeHandler {\n};\n\ntemplate <typename Element>\ninline RepeatedPtrField<Element>::RepeatedPtrField()\n  : RepeatedPtrFieldBase() {}\n\ntemplate <typename Element>\ninline RepeatedPtrField<Element>::RepeatedPtrField(::google::protobuf::Arena* arena) :\n  RepeatedPtrFieldBase(arena) {}\n\ntemplate <typename Element>\ninline RepeatedPtrField<Element>::RepeatedPtrField(\n    const RepeatedPtrField& other)\n  : RepeatedPtrFieldBase() {\n  MergeFrom(other);\n}\n\ntemplate <typename Element>\ntemplate <typename Iter>\ninline RepeatedPtrField<Element>::RepeatedPtrField(\n    Iter begin, const Iter& end) {\n  int reserve = internal::CalculateReserve(begin, end);\n  if (reserve != -1) {\n    Reserve(reserve);\n  }\n  for (; begin != end; ++begin) {\n    *Add() = *begin;\n  }\n}\n\ntemplate <typename Element>\nRepeatedPtrField<Element>::~RepeatedPtrField() {\n  Destroy<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline RepeatedPtrField<Element>& RepeatedPtrField<Element>::operator=(\n    const RepeatedPtrField& other) {\n  if (this != &other)\n    CopyFrom(other);\n  return *this;\n}\n\ntemplate <typename Element>\ninline RepeatedPtrField<Element>::RepeatedPtrField(\n    RepeatedPtrField&& other) noexcept\n    : RepeatedPtrField() {\n  // We don't just call Swap(&other) here because it would perform 3 copies if\n  // the two fields are on different arenas.\n  if (other.GetArenaNoVirtual()) {\n    CopyFrom(other);\n  } else {\n    InternalSwap(&other);\n  }\n}\n\ntemplate <typename Element>\ninline RepeatedPtrField<Element>& RepeatedPtrField<Element>::operator=(\n    RepeatedPtrField&& other) noexcept {\n  // We don't just call Swap(&other) here because it would perform 3 copies if\n  // the two fields are on different arenas.\n  if (this != &other) {\n    if (this->GetArenaNoVirtual() != other.GetArenaNoVirtual()) {\n      CopyFrom(other);\n    } else {\n      InternalSwap(&other);\n    }\n  }\n  return *this;\n}\n\ntemplate <typename Element>\ninline bool RepeatedPtrField<Element>::empty() const {\n  return RepeatedPtrFieldBase::empty();\n}\n\ntemplate <typename Element>\ninline int RepeatedPtrField<Element>::size() const {\n  return RepeatedPtrFieldBase::size();\n}\n\ntemplate <typename Element>\ninline const Element& RepeatedPtrField<Element>::Get(int index) const {\n  return RepeatedPtrFieldBase::Get<TypeHandler>(index);\n}\n\n\ntemplate <typename Element>\ninline Element* RepeatedPtrField<Element>::Mutable(int index) {\n  return RepeatedPtrFieldBase::Mutable<TypeHandler>(index);\n}\n\ntemplate <typename Element>\ninline Element* RepeatedPtrField<Element>::Add() {\n  return RepeatedPtrFieldBase::Add<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::Add(Element&& value) {\n  RepeatedPtrFieldBase::Add<TypeHandler>(std::move(value));\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::RemoveLast() {\n  RepeatedPtrFieldBase::RemoveLast<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::DeleteSubrange(int start, int num) {\n  GOOGLE_DCHECK_GE(start, 0);\n  GOOGLE_DCHECK_GE(num, 0);\n  GOOGLE_DCHECK_LE(start + num, size());\n  for (int i = 0; i < num; ++i) {\n    RepeatedPtrFieldBase::Delete<TypeHandler>(start + i);\n  }\n  ExtractSubrange(start, num, NULL);\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::ExtractSubrange(\n    int start, int num, Element** elements) {\n  typename internal::TypeImplementsMergeBehavior<\n      typename TypeHandler::Type>::type t;\n  ExtractSubrangeInternal(start, num, elements, t);\n}\n\n// ExtractSubrange() implementation for types that implement merge/copy\n// behavior.\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::ExtractSubrangeInternal(\n    int start, int num, Element** elements, std::true_type) {\n  GOOGLE_DCHECK_GE(start, 0);\n  GOOGLE_DCHECK_GE(num, 0);\n  GOOGLE_DCHECK_LE(start + num, size());\n\n  if (num > 0) {\n    // Save the values of the removed elements if requested.\n    if (elements != NULL) {\n      if (GetArenaNoVirtual() != NULL) {\n        // If we're on an arena, we perform a copy for each element so that the\n        // returned elements are heap-allocated.\n        for (int i = 0; i < num; ++i) {\n          Element* element = RepeatedPtrFieldBase::\n              Mutable<TypeHandler>(i + start);\n          typename TypeHandler::Type* new_value =\n              TypeHandler::NewFromPrototype(element, NULL);\n          TypeHandler::Merge(*element, new_value);\n          elements[i] = new_value;\n        }\n      } else {\n        for (int i = 0; i < num; ++i) {\n          elements[i] = RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start);\n        }\n      }\n    }\n    CloseGap(start, num);\n  }\n}\n\n// ExtractSubrange() implementation for types that do not implement merge/copy\n// behavior.\ntemplate<typename Element>\ninline void RepeatedPtrField<Element>::ExtractSubrangeInternal(\n    int start, int num, Element** elements, std::false_type) {\n  // This case is identical to UnsafeArenaExtractSubrange(). However, since\n  // ExtractSubrange() must return heap-allocated objects by contract, and we\n  // cannot fulfill this contract if we are an on arena, we must GOOGLE_DCHECK() that\n  // we are not on an arena.\n  GOOGLE_DCHECK(GetArenaNoVirtual() == NULL)\n      << \"ExtractSubrange() when arena is non-NULL is only supported when \"\n      << \"the Element type supplies a MergeFrom() operation to make copies.\";\n  UnsafeArenaExtractSubrange(start, num, elements);\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::UnsafeArenaExtractSubrange(\n    int start, int num, Element** elements) {\n  GOOGLE_DCHECK_GE(start, 0);\n  GOOGLE_DCHECK_GE(num, 0);\n  GOOGLE_DCHECK_LE(start + num, size());\n\n  if (num > 0) {\n    // Save the values of the removed elements if requested.\n    if (elements != NULL) {\n      for (int i = 0; i < num; ++i) {\n        elements[i] = RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start);\n      }\n    }\n    CloseGap(start, num);\n  }\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::Clear() {\n  RepeatedPtrFieldBase::Clear<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::MergeFrom(\n    const RepeatedPtrField& other) {\n  RepeatedPtrFieldBase::MergeFrom<TypeHandler>(other);\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::CopyFrom(\n    const RepeatedPtrField& other) {\n  RepeatedPtrFieldBase::CopyFrom<TypeHandler>(other);\n}\n\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::iterator\nRepeatedPtrField<Element>::erase(const_iterator position) {\n  return erase(position, position + 1);\n}\n\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::iterator\nRepeatedPtrField<Element>::erase(const_iterator first, const_iterator last) {\n  size_type pos_offset = std::distance(cbegin(), first);\n  size_type last_offset = std::distance(cbegin(), last);\n  DeleteSubrange(pos_offset, last_offset - pos_offset);\n  return begin() + pos_offset;\n}\n\ntemplate <typename Element>\ninline Element** RepeatedPtrField<Element>::mutable_data() {\n  return RepeatedPtrFieldBase::mutable_data<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline const Element* const* RepeatedPtrField<Element>::data() const {\n  return RepeatedPtrFieldBase::data<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::Swap(RepeatedPtrField* other) {\n  if (this == other)\n    return;\n  RepeatedPtrFieldBase::Swap<TypeHandler>(other);\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::UnsafeArenaSwap(\n    RepeatedPtrField* other) {\n  if (this == other)\n      return;\n  RepeatedPtrFieldBase::InternalSwap(other);\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::SwapElements(int index1, int index2) {\n  RepeatedPtrFieldBase::SwapElements(index1, index2);\n}\n\ntemplate <typename Element>\ninline Arena* RepeatedPtrField<Element>::GetArenaNoVirtual() const {\n  return RepeatedPtrFieldBase::GetArenaNoVirtual();\n}\n\ntemplate <typename Element>\ninline size_t RepeatedPtrField<Element>::SpaceUsedExcludingSelfLong() const {\n  return RepeatedPtrFieldBase::SpaceUsedExcludingSelfLong<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::AddAllocated(Element* value) {\n  RepeatedPtrFieldBase::AddAllocated<TypeHandler>(value);\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::UnsafeArenaAddAllocated(Element* value) {\n  RepeatedPtrFieldBase::UnsafeArenaAddAllocated<TypeHandler>(value);\n}\n\ntemplate <typename Element>\ninline Element* RepeatedPtrField<Element>::ReleaseLast() {\n  return RepeatedPtrFieldBase::ReleaseLast<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline Element* RepeatedPtrField<Element>::UnsafeArenaReleaseLast() {\n  return RepeatedPtrFieldBase::UnsafeArenaReleaseLast<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline int RepeatedPtrField<Element>::ClearedCount() const {\n  return RepeatedPtrFieldBase::ClearedCount();\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::AddCleared(Element* value) {\n  return RepeatedPtrFieldBase::AddCleared<TypeHandler>(value);\n}\n\ntemplate <typename Element>\ninline Element* RepeatedPtrField<Element>::ReleaseCleared() {\n  return RepeatedPtrFieldBase::ReleaseCleared<TypeHandler>();\n}\n\ntemplate <typename Element>\ninline void RepeatedPtrField<Element>::Reserve(int new_size) {\n  return RepeatedPtrFieldBase::Reserve(new_size);\n}\n\ntemplate <typename Element>\ninline int RepeatedPtrField<Element>::Capacity() const {\n  return RepeatedPtrFieldBase::Capacity();\n}\n\n// -------------------------------------------------------------------\n\nnamespace internal {\n\n// STL-like iterator implementation for RepeatedPtrField.  You should not\n// refer to this class directly; use RepeatedPtrField<T>::iterator instead.\n//\n// The iterator for RepeatedPtrField<T>, RepeatedPtrIterator<T>, is\n// very similar to iterator_ptr<T**> in util/gtl/iterator_adaptors.h,\n// but adds random-access operators and is modified to wrap a void** base\n// iterator (since RepeatedPtrField stores its array as a void* array and\n// casting void** to T** would violate C++ aliasing rules).\n//\n// This code based on net/proto/proto-array-internal.h by Jeffrey Yasskin\n// (jyasskin@google.com).\ntemplate<typename Element>\nclass RepeatedPtrIterator\n    : public std::iterator<\n          std::random_access_iterator_tag, Element> {\n public:\n  typedef RepeatedPtrIterator<Element> iterator;\n  typedef std::iterator<\n          std::random_access_iterator_tag, Element> superclass;\n\n  // Shadow the value_type in std::iterator<> because const_iterator::value_type\n  // needs to be T, not const T.\n  typedef typename std::remove_const<Element>::type value_type;\n\n  // Let the compiler know that these are type names, so we don't have to\n  // write \"typename\" in front of them everywhere.\n  typedef typename superclass::reference reference;\n  typedef typename superclass::pointer pointer;\n  typedef typename superclass::difference_type difference_type;\n\n  RepeatedPtrIterator() : it_(NULL) {}\n  explicit RepeatedPtrIterator(void* const* it) : it_(it) {}\n\n  // Allow \"upcasting\" from RepeatedPtrIterator<T**> to\n  // RepeatedPtrIterator<const T*const*>.\n  template<typename OtherElement>\n  RepeatedPtrIterator(const RepeatedPtrIterator<OtherElement>& other)\n      : it_(other.it_) {\n    // Force a compiler error if the other type is not convertible to ours.\n    if (false) {\n      implicit_cast<Element*>(static_cast<OtherElement*>(nullptr));\n    }\n  }\n\n  // dereferenceable\n  reference operator*() const { return *reinterpret_cast<Element*>(*it_); }\n  pointer   operator->() const { return &(operator*()); }\n\n  // {inc,dec}rementable\n  iterator& operator++() { ++it_; return *this; }\n  iterator  operator++(int) { return iterator(it_++); }\n  iterator& operator--() { --it_; return *this; }\n  iterator  operator--(int) { return iterator(it_--); }\n\n  // equality_comparable\n  bool operator==(const iterator& x) const { return it_ == x.it_; }\n  bool operator!=(const iterator& x) const { return it_ != x.it_; }\n\n  // less_than_comparable\n  bool operator<(const iterator& x) const { return it_ < x.it_; }\n  bool operator<=(const iterator& x) const { return it_ <= x.it_; }\n  bool operator>(const iterator& x) const { return it_ > x.it_; }\n  bool operator>=(const iterator& x) const { return it_ >= x.it_; }\n\n  // addable, subtractable\n  iterator& operator+=(difference_type d) {\n    it_ += d;\n    return *this;\n  }\n  friend iterator operator+(iterator it, const difference_type d) {\n    it += d;\n    return it;\n  }\n  friend iterator operator+(const difference_type d, iterator it) {\n    it += d;\n    return it;\n  }\n  iterator& operator-=(difference_type d) {\n    it_ -= d;\n    return *this;\n  }\n  friend iterator operator-(iterator it, difference_type d) {\n    it -= d;\n    return it;\n  }\n\n  // indexable\n  reference operator[](difference_type d) const { return *(*this + d); }\n\n  // random access iterator\n  difference_type operator-(const iterator& x) const { return it_ - x.it_; }\n\n private:\n  template<typename OtherElement>\n  friend class RepeatedPtrIterator;\n\n  // The internal iterator.\n  void* const* it_;\n};\n\n// Provide an iterator that operates on pointers to the underlying objects\n// rather than the objects themselves as RepeatedPtrIterator does.\n// Consider using this when working with stl algorithms that change\n// the array.\n// The VoidPtr template parameter holds the type-agnostic pointer value\n// referenced by the iterator.  It should either be \"void *\" for a mutable\n// iterator, or \"const void* const\" for a constant iterator.\ntemplate <typename Element, typename VoidPtr>\nclass RepeatedPtrOverPtrsIterator\n    : public std::iterator<std::random_access_iterator_tag, Element> {\n public:\n  typedef RepeatedPtrOverPtrsIterator<Element, VoidPtr> iterator;\n  typedef std::iterator<std::random_access_iterator_tag, Element> superclass;\n\n  // Shadow the value_type in std::iterator<> because const_iterator::value_type\n  // needs to be T, not const T.\n  typedef typename std::remove_const<Element>::type value_type;\n\n  // Let the compiler know that these are type names, so we don't have to\n  // write \"typename\" in front of them everywhere.\n  typedef typename superclass::reference reference;\n  typedef typename superclass::pointer pointer;\n  typedef typename superclass::difference_type difference_type;\n\n  RepeatedPtrOverPtrsIterator() : it_(NULL) {}\n  explicit RepeatedPtrOverPtrsIterator(VoidPtr* it) : it_(it) {}\n\n  // dereferenceable\n  reference operator*() const { return *reinterpret_cast<Element*>(it_); }\n  pointer   operator->() const { return &(operator*()); }\n\n  // {inc,dec}rementable\n  iterator& operator++() { ++it_; return *this; }\n  iterator  operator++(int) { return iterator(it_++); }\n  iterator& operator--() { --it_; return *this; }\n  iterator  operator--(int) { return iterator(it_--); }\n\n  // equality_comparable\n  bool operator==(const iterator& x) const { return it_ == x.it_; }\n  bool operator!=(const iterator& x) const { return it_ != x.it_; }\n\n  // less_than_comparable\n  bool operator<(const iterator& x) const { return it_ < x.it_; }\n  bool operator<=(const iterator& x) const { return it_ <= x.it_; }\n  bool operator>(const iterator& x) const { return it_ > x.it_; }\n  bool operator>=(const iterator& x) const { return it_ >= x.it_; }\n\n  // addable, subtractable\n  iterator& operator+=(difference_type d) {\n    it_ += d;\n    return *this;\n  }\n  friend iterator operator+(iterator it, difference_type d) {\n    it += d;\n    return it;\n  }\n  friend iterator operator+(difference_type d, iterator it) {\n    it += d;\n    return it;\n  }\n  iterator& operator-=(difference_type d) {\n    it_ -= d;\n    return *this;\n  }\n  friend iterator operator-(iterator it, difference_type d) {\n    it -= d;\n    return it;\n  }\n\n  // indexable\n  reference operator[](difference_type d) const { return *(*this + d); }\n\n  // random access iterator\n  difference_type operator-(const iterator& x) const { return it_ - x.it_; }\n\n private:\n  template<typename OtherElement>\n  friend class RepeatedPtrIterator;\n\n  // The internal iterator.\n  VoidPtr* it_;\n};\n\nvoid RepeatedPtrFieldBase::InternalSwap(RepeatedPtrFieldBase* other) {\n  GOOGLE_DCHECK(this != other);\n  GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());\n\n  std::swap(rep_, other->rep_);\n  std::swap(current_size_, other->current_size_);\n  std::swap(total_size_, other->total_size_);\n}\n\n}  // namespace internal\n\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::iterator\nRepeatedPtrField<Element>::begin() {\n  return iterator(raw_data());\n}\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::const_iterator\nRepeatedPtrField<Element>::begin() const {\n  return iterator(raw_data());\n}\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::const_iterator\nRepeatedPtrField<Element>::cbegin() const {\n  return begin();\n}\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::iterator\nRepeatedPtrField<Element>::end() {\n  return iterator(raw_data() + size());\n}\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::const_iterator\nRepeatedPtrField<Element>::end() const {\n  return iterator(raw_data() + size());\n}\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::const_iterator\nRepeatedPtrField<Element>::cend() const {\n  return end();\n}\n\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::pointer_iterator\nRepeatedPtrField<Element>::pointer_begin() {\n  return pointer_iterator(raw_mutable_data());\n}\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::const_pointer_iterator\nRepeatedPtrField<Element>::pointer_begin() const {\n  return const_pointer_iterator(const_cast<const void* const*>(raw_data()));\n}\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::pointer_iterator\nRepeatedPtrField<Element>::pointer_end() {\n  return pointer_iterator(raw_mutable_data() + size());\n}\ntemplate <typename Element>\ninline typename RepeatedPtrField<Element>::const_pointer_iterator\nRepeatedPtrField<Element>::pointer_end() const {\n  return const_pointer_iterator(\n      const_cast<const void* const*>(raw_data() + size()));\n}\n\n\n// Iterators and helper functions that follow the spirit of the STL\n// std::back_insert_iterator and std::back_inserter but are tailor-made\n// for RepeatedField and RepeatedPtrField. Typical usage would be:\n//\n//   std::copy(some_sequence.begin(), some_sequence.end(),\n//             google::protobuf::RepeatedFieldBackInserter(proto.mutable_sequence()));\n//\n// Ported by johannes from util/gtl/proto-array-iterators.h\n\nnamespace internal {\n// A back inserter for RepeatedField objects.\ntemplate<typename T> class RepeatedFieldBackInsertIterator\n    : public std::iterator<std::output_iterator_tag, T> {\n public:\n  explicit RepeatedFieldBackInsertIterator(\n      RepeatedField<T>* const mutable_field)\n      : field_(mutable_field) {\n  }\n  RepeatedFieldBackInsertIterator<T>& operator=(const T& value) {\n    field_->Add(value);\n    return *this;\n  }\n  RepeatedFieldBackInsertIterator<T>& operator*() {\n    return *this;\n  }\n  RepeatedFieldBackInsertIterator<T>& operator++() {\n    return *this;\n  }\n  RepeatedFieldBackInsertIterator<T>& operator++(int /* unused */) {\n    return *this;\n  }\n\n private:\n  RepeatedField<T>* field_;\n};\n\n// A back inserter for RepeatedPtrField objects.\ntemplate<typename T> class RepeatedPtrFieldBackInsertIterator\n    : public std::iterator<std::output_iterator_tag, T> {\n public:\n  RepeatedPtrFieldBackInsertIterator(\n      RepeatedPtrField<T>* const mutable_field)\n      : field_(mutable_field) {\n  }\n  RepeatedPtrFieldBackInsertIterator<T>& operator=(const T& value) {\n    *field_->Add() = value;\n    return *this;\n  }\n  RepeatedPtrFieldBackInsertIterator<T>& operator=(\n      const T* const ptr_to_value) {\n    *field_->Add() = *ptr_to_value;\n    return *this;\n  }\n  RepeatedPtrFieldBackInsertIterator<T>& operator=(T&& value) {\n    *field_->Add() = std::move(value);\n    return *this;\n  }\n  RepeatedPtrFieldBackInsertIterator<T>& operator*() {\n    return *this;\n  }\n  RepeatedPtrFieldBackInsertIterator<T>& operator++() {\n    return *this;\n  }\n  RepeatedPtrFieldBackInsertIterator<T>& operator++(int /* unused */) {\n    return *this;\n  }\n\n private:\n  RepeatedPtrField<T>* field_;\n};\n\n// A back inserter for RepeatedPtrFields that inserts by transferring ownership\n// of a pointer.\ntemplate<typename T> class AllocatedRepeatedPtrFieldBackInsertIterator\n    : public std::iterator<std::output_iterator_tag, T> {\n public:\n  explicit AllocatedRepeatedPtrFieldBackInsertIterator(\n      RepeatedPtrField<T>* const mutable_field)\n      : field_(mutable_field) {\n  }\n  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator=(\n      T* const ptr_to_value) {\n    field_->AddAllocated(ptr_to_value);\n    return *this;\n  }\n  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator*() {\n    return *this;\n  }\n  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++() {\n    return *this;\n  }\n  AllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++(\n      int /* unused */) {\n    return *this;\n  }\n\n private:\n  RepeatedPtrField<T>* field_;\n};\n\n// Almost identical to AllocatedRepeatedPtrFieldBackInsertIterator. This one\n// uses the UnsafeArenaAddAllocated instead.\ntemplate<typename T>\nclass UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator\n    : public std::iterator<std::output_iterator_tag, T> {\n public:\n  explicit UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator(\n    ::google::protobuf::RepeatedPtrField<T>* const mutable_field)\n  : field_(mutable_field) {\n  }\n  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator=(\n    T const* const ptr_to_value) {\n    field_->UnsafeArenaAddAllocated(const_cast<T*>(ptr_to_value));\n    return *this;\n  }\n  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator*() {\n    return *this;\n  }\n  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++() {\n    return *this;\n  }\n  UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>& operator++(\n      int /* unused */) {\n    return *this;\n  }\n\n private:\n  ::google::protobuf::RepeatedPtrField<T>* field_;\n};\n\n}  // namespace internal\n\n// Provides a back insert iterator for RepeatedField instances,\n// similar to std::back_inserter().\ntemplate<typename T> internal::RepeatedFieldBackInsertIterator<T>\nRepeatedFieldBackInserter(RepeatedField<T>* const mutable_field) {\n  return internal::RepeatedFieldBackInsertIterator<T>(mutable_field);\n}\n\n// Provides a back insert iterator for RepeatedPtrField instances,\n// similar to std::back_inserter().\ntemplate<typename T> internal::RepeatedPtrFieldBackInsertIterator<T>\nRepeatedPtrFieldBackInserter(RepeatedPtrField<T>* const mutable_field) {\n  return internal::RepeatedPtrFieldBackInsertIterator<T>(mutable_field);\n}\n\n// Special back insert iterator for RepeatedPtrField instances, just in\n// case someone wants to write generic template code that can access both\n// RepeatedFields and RepeatedPtrFields using a common name.\ntemplate<typename T> internal::RepeatedPtrFieldBackInsertIterator<T>\nRepeatedFieldBackInserter(RepeatedPtrField<T>* const mutable_field) {\n  return internal::RepeatedPtrFieldBackInsertIterator<T>(mutable_field);\n}\n\n// Provides a back insert iterator for RepeatedPtrField instances\n// similar to std::back_inserter() which transfers the ownership while\n// copying elements.\ntemplate<typename T> internal::AllocatedRepeatedPtrFieldBackInsertIterator<T>\nAllocatedRepeatedPtrFieldBackInserter(\n    RepeatedPtrField<T>* const mutable_field) {\n  return internal::AllocatedRepeatedPtrFieldBackInsertIterator<T>(\n      mutable_field);\n}\n\n// Similar to AllocatedRepeatedPtrFieldBackInserter, using\n// UnsafeArenaAddAllocated instead of AddAllocated.\n// This is slightly faster if that matters. It is also useful in legacy code\n// that uses temporary ownership to avoid copies. Example:\n//   RepeatedPtrField<T> temp_field;\n//   temp_field.AddAllocated(new T);\n//   ... // Do something with temp_field\n//   temp_field.ExtractSubrange(0, temp_field.size(), nullptr);\n// If you put temp_field on the arena this fails, because the ownership\n// transfers to the arena at the \"AddAllocated\" call and is not released anymore\n// causing a double delete. Using UnsafeArenaAddAllocated prevents this.\ntemplate<typename T>\ninternal::UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>\nUnsafeArenaAllocatedRepeatedPtrFieldBackInserter(\n    ::google::protobuf::RepeatedPtrField<T>* const mutable_field) {\n  return internal::UnsafeArenaAllocatedRepeatedPtrFieldBackInsertIterator<T>(\n      mutable_field);\n}\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_REPEATED_FIELD_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/service.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// DEPRECATED:  This module declares the abstract interfaces underlying proto2\n// RPC services.  These are intented to be independent of any particular RPC\n// implementation, so that proto2 services can be used on top of a variety\n// of implementations.  Starting with version 2.3.0, RPC implementations should\n// not try to build on these, but should instead provide code generator plugins\n// which generate code specific to the particular RPC implementation.  This way\n// the generated code can be more appropriate for the implementation in use\n// and can avoid unnecessary layers of indirection.\n//\n//\n// When you use the protocol compiler to compile a service definition, it\n// generates two classes:  An abstract interface for the service (with\n// methods matching the service definition) and a \"stub\" implementation.\n// A stub is just a type-safe wrapper around an RpcChannel which emulates a\n// local implementation of the service.\n//\n// For example, the service definition:\n//   service MyService {\n//     rpc Foo(MyRequest) returns(MyResponse);\n//   }\n// will generate abstract interface \"MyService\" and class \"MyService::Stub\".\n// You could implement a MyService as follows:\n//   class MyServiceImpl : public MyService {\n//    public:\n//     MyServiceImpl() {}\n//     ~MyServiceImpl() {}\n//\n//     // implements MyService ---------------------------------------\n//\n//     void Foo(google::protobuf::RpcController* controller,\n//              const MyRequest* request,\n//              MyResponse* response,\n//              Closure* done) {\n//       // ... read request and fill in response ...\n//       done->Run();\n//     }\n//   };\n// You would then register an instance of MyServiceImpl with your RPC server\n// implementation.  (How to do that depends on the implementation.)\n//\n// To call a remote MyServiceImpl, first you need an RpcChannel connected to it.\n// How to construct a channel depends, again, on your RPC implementation.\n// Here we use a hypothetical \"MyRpcChannel\" as an example:\n//   MyRpcChannel channel(\"rpc:hostname:1234/myservice\");\n//   MyRpcController controller;\n//   MyServiceImpl::Stub stub(&channel);\n//   FooRequest request;\n//   FooResponse response;\n//\n//   // ... fill in request ...\n//\n//   stub.Foo(&controller, request, &response, NewCallback(HandleResponse));\n//\n// On Thread-Safety:\n//\n// Different RPC implementations may make different guarantees about what\n// threads they may run callbacks on, and what threads the application is\n// allowed to use to call the RPC system.  Portable software should be ready\n// for callbacks to be called on any thread, but should not try to call the\n// RPC system from any thread except for the ones on which it received the\n// callbacks.  Realistically, though, simple software will probably want to\n// use a single-threaded RPC system while high-end software will want to\n// use multiple threads.  RPC implementations should provide multiple\n// choices.\n\n#ifndef GOOGLE_PROTOBUF_SERVICE_H__\n#define GOOGLE_PROTOBUF_SERVICE_H__\n\n#include <string>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/callback.h>\n\nnamespace google {\nnamespace protobuf {\n\n// Defined in this file.\nclass Service;\nclass RpcController;\nclass RpcChannel;\n\n// Defined in other files.\nclass Descriptor;            // descriptor.h\nclass ServiceDescriptor;     // descriptor.h\nclass MethodDescriptor;      // descriptor.h\nclass Message;               // message.h\n\n// Abstract base interface for protocol-buffer-based RPC services.  Services\n// themselves are abstract interfaces (implemented either by servers or as\n// stubs), but they subclass this base interface.  The methods of this\n// interface can be used to call the methods of the Service without knowing\n// its exact type at compile time (analogous to Reflection).\nclass LIBPROTOBUF_EXPORT Service {\n public:\n  inline Service() {}\n  virtual ~Service();\n\n  // When constructing a stub, you may pass STUB_OWNS_CHANNEL as the second\n  // parameter to the constructor to tell it to delete its RpcChannel when\n  // destroyed.\n  enum ChannelOwnership {\n    STUB_OWNS_CHANNEL,\n    STUB_DOESNT_OWN_CHANNEL\n  };\n\n  // Get the ServiceDescriptor describing this service and its methods.\n  virtual const ServiceDescriptor* GetDescriptor() = 0;\n\n  // Call a method of the service specified by MethodDescriptor.  This is\n  // normally implemented as a simple switch() that calls the standard\n  // definitions of the service's methods.\n  //\n  // Preconditions:\n  // * method->service() == GetDescriptor()\n  // * request and response are of the exact same classes as the objects\n  //   returned by GetRequestPrototype(method) and\n  //   GetResponsePrototype(method).\n  // * After the call has started, the request must not be modified and the\n  //   response must not be accessed at all until \"done\" is called.\n  // * \"controller\" is of the correct type for the RPC implementation being\n  //   used by this Service.  For stubs, the \"correct type\" depends on the\n  //   RpcChannel which the stub is using.  Server-side Service\n  //   implementations are expected to accept whatever type of RpcController\n  //   the server-side RPC implementation uses.\n  //\n  // Postconditions:\n  // * \"done\" will be called when the method is complete.  This may be\n  //   before CallMethod() returns or it may be at some point in the future.\n  // * If the RPC succeeded, \"response\" contains the response returned by\n  //   the server.\n  // * If the RPC failed, \"response\"'s contents are undefined.  The\n  //   RpcController can be queried to determine if an error occurred and\n  //   possibly to get more information about the error.\n  virtual void CallMethod(const MethodDescriptor* method,\n                          RpcController* controller,\n                          const Message* request,\n                          Message* response,\n                          Closure* done) = 0;\n\n  // CallMethod() requires that the request and response passed in are of a\n  // particular subclass of Message.  GetRequestPrototype() and\n  // GetResponsePrototype() get the default instances of these required types.\n  // You can then call Message::New() on these instances to construct mutable\n  // objects which you can then pass to CallMethod().\n  //\n  // Example:\n  //   const MethodDescriptor* method =\n  //     service->GetDescriptor()->FindMethodByName(\"Foo\");\n  //   Message* request  = stub->GetRequestPrototype (method)->New();\n  //   Message* response = stub->GetResponsePrototype(method)->New();\n  //   request->ParseFromString(input);\n  //   service->CallMethod(method, *request, response, callback);\n  virtual const Message& GetRequestPrototype(\n    const MethodDescriptor* method) const = 0;\n  virtual const Message& GetResponsePrototype(\n    const MethodDescriptor* method) const = 0;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Service);\n};\n\n// An RpcController mediates a single method call.  The primary purpose of\n// the controller is to provide a way to manipulate settings specific to the\n// RPC implementation and to find out about RPC-level errors.\n//\n// The methods provided by the RpcController interface are intended to be a\n// \"least common denominator\" set of features which we expect all\n// implementations to support.  Specific implementations may provide more\n// advanced features (e.g. deadline propagation).\nclass LIBPROTOBUF_EXPORT RpcController {\n public:\n  inline RpcController() {}\n  virtual ~RpcController();\n\n  // Client-side methods ---------------------------------------------\n  // These calls may be made from the client side only.  Their results\n  // are undefined on the server side (may crash).\n\n  // Resets the RpcController to its initial state so that it may be reused in\n  // a new call.  Must not be called while an RPC is in progress.\n  virtual void Reset() = 0;\n\n  // After a call has finished, returns true if the call failed.  The possible\n  // reasons for failure depend on the RPC implementation.  Failed() must not\n  // be called before a call has finished.  If Failed() returns true, the\n  // contents of the response message are undefined.\n  virtual bool Failed() const = 0;\n\n  // If Failed() is true, returns a human-readable description of the error.\n  virtual string ErrorText() const = 0;\n\n  // Advises the RPC system that the caller desires that the RPC call be\n  // canceled.  The RPC system may cancel it immediately, may wait awhile and\n  // then cancel it, or may not even cancel the call at all.  If the call is\n  // canceled, the \"done\" callback will still be called and the RpcController\n  // will indicate that the call failed at that time.\n  virtual void StartCancel() = 0;\n\n  // Server-side methods ---------------------------------------------\n  // These calls may be made from the server side only.  Their results\n  // are undefined on the client side (may crash).\n\n  // Causes Failed() to return true on the client side.  \"reason\" will be\n  // incorporated into the message returned by ErrorText().  If you find\n  // you need to return machine-readable information about failures, you\n  // should incorporate it into your response protocol buffer and should\n  // NOT call SetFailed().\n  virtual void SetFailed(const string& reason) = 0;\n\n  // If true, indicates that the client canceled the RPC, so the server may\n  // as well give up on replying to it.  The server should still call the\n  // final \"done\" callback.\n  virtual bool IsCanceled() const = 0;\n\n  // Asks that the given callback be called when the RPC is canceled.  The\n  // callback will always be called exactly once.  If the RPC completes without\n  // being canceled, the callback will be called after completion.  If the RPC\n  // has already been canceled when NotifyOnCancel() is called, the callback\n  // will be called immediately.\n  //\n  // NotifyOnCancel() must be called no more than once per request.\n  virtual void NotifyOnCancel(Closure* callback) = 0;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RpcController);\n};\n\n// Abstract interface for an RPC channel.  An RpcChannel represents a\n// communication line to a Service which can be used to call that Service's\n// methods.  The Service may be running on another machine.  Normally, you\n// should not call an RpcChannel directly, but instead construct a stub Service\n// wrapping it.  Example:\n//   RpcChannel* channel = new MyRpcChannel(\"remotehost.example.com:1234\");\n//   MyService* service = new MyService::Stub(channel);\n//   service->MyMethod(request, &response, callback);\nclass LIBPROTOBUF_EXPORT RpcChannel {\n public:\n  inline RpcChannel() {}\n  virtual ~RpcChannel();\n\n  // Call the given method of the remote service.  The signature of this\n  // procedure looks the same as Service::CallMethod(), but the requirements\n  // are less strict in one important way:  the request and response objects\n  // need not be of any specific class as long as their descriptors are\n  // method->input_type() and method->output_type().\n  virtual void CallMethod(const MethodDescriptor* method,\n                          RpcController* controller,\n                          const Message* request,\n                          Message* response,\n                          Closure* done) = 0;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RpcChannel);\n};\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_SERVICE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/source_context.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/source_context.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fsource_5fcontext_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2fsource_5fcontext_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[1];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto\nnamespace google {\nnamespace protobuf {\nclass SourceContext;\nclass SourceContextDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern SourceContextDefaultTypeInternal _SourceContext_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::SourceContext* Arena::CreateMaybeMessage<::google::protobuf::SourceContext>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT SourceContext : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.SourceContext) */ {\n public:\n  SourceContext();\n  virtual ~SourceContext();\n\n  SourceContext(const SourceContext& from);\n\n  inline SourceContext& operator=(const SourceContext& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  SourceContext(SourceContext&& from) noexcept\n    : SourceContext() {\n    *this = ::std::move(from);\n  }\n\n  inline SourceContext& operator=(SourceContext&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const SourceContext& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const SourceContext* internal_default_instance() {\n    return reinterpret_cast<const SourceContext*>(\n               &_SourceContext_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void Swap(SourceContext* other);\n  friend void swap(SourceContext& a, SourceContext& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline SourceContext* New() const final {\n    return CreateMaybeMessage<SourceContext>(NULL);\n  }\n\n  SourceContext* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<SourceContext>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const SourceContext& from);\n  void MergeFrom(const SourceContext& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(SourceContext* other);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return NULL;\n  }\n  inline void* MaybeArenaPtr() const {\n    return NULL;\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // string file_name = 1;\n  void clear_file_name();\n  static const int kFileNameFieldNumber = 1;\n  const ::std::string& file_name() const;\n  void set_file_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_file_name(::std::string&& value);\n  #endif\n  void set_file_name(const char* value);\n  void set_file_name(const char* value, size_t size);\n  ::std::string* mutable_file_name();\n  ::std::string* release_file_name();\n  void set_allocated_file_name(::std::string* file_name);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.SourceContext)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  ::google::protobuf::internal::ArenaStringPtr file_name_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// SourceContext\n\n// string file_name = 1;\ninline void SourceContext::clear_file_name() {\n  file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline const ::std::string& SourceContext::file_name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.SourceContext.file_name)\n  return file_name_.GetNoArena();\n}\ninline void SourceContext::set_file_name(const ::std::string& value) {\n  \n  file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);\n  // @@protoc_insertion_point(field_set:google.protobuf.SourceContext.file_name)\n}\n#if LANG_CXX11\ninline void SourceContext::set_file_name(::std::string&& value) {\n  \n  file_name_.SetNoArena(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.SourceContext.file_name)\n}\n#endif\ninline void SourceContext::set_file_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));\n  // @@protoc_insertion_point(field_set_char:google.protobuf.SourceContext.file_name)\n}\ninline void SourceContext::set_file_name(const char* value, size_t size) {\n  \n  file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(reinterpret_cast<const char*>(value), size));\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceContext.file_name)\n}\ninline ::std::string* SourceContext::mutable_file_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.SourceContext.file_name)\n  return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline ::std::string* SourceContext::release_file_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.SourceContext.file_name)\n  \n  return file_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n}\ninline void SourceContext::set_allocated_file_name(::std::string* file_name) {\n  if (file_name != NULL) {\n    \n  } else {\n    \n  }\n  file_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), file_name);\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceContext.file_name)\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2fsource_5fcontext_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/source_context.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"SourceContextProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption go_package = \"google.golang.org/genproto/protobuf/source_context;source_context\";\n\n// `SourceContext` represents information about the source of a\n// protobuf element, like the file in which it is defined.\nmessage SourceContext {\n  // The path-qualified name of the .proto file that contained the associated\n  // protobuf element.  For example: `\"google/protobuf/source_context.proto\"`.\n  string file_name = 1;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/struct.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/struct.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fstruct_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2fstruct_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/map.h>  // IWYU pragma: export\n#include <google/protobuf/map_entry.h>\n#include <google/protobuf/map_field_inl.h>\n#include <google/protobuf/generated_enum_reflection.h>\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fstruct_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2fstruct_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[4];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2fstruct_2eproto\nnamespace google {\nnamespace protobuf {\nclass ListValue;\nclass ListValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern ListValueDefaultTypeInternal _ListValue_default_instance_;\nclass Struct;\nclass StructDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern StructDefaultTypeInternal _Struct_default_instance_;\nclass Struct_FieldsEntry_DoNotUse;\nclass Struct_FieldsEntry_DoNotUseDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern Struct_FieldsEntry_DoNotUseDefaultTypeInternal _Struct_FieldsEntry_DoNotUse_default_instance_;\nclass Value;\nclass ValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern ValueDefaultTypeInternal _Value_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::ListValue* Arena::CreateMaybeMessage<::google::protobuf::ListValue>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Struct* Arena::CreateMaybeMessage<::google::protobuf::Struct>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Struct_FieldsEntry_DoNotUse* Arena::CreateMaybeMessage<::google::protobuf::Struct_FieldsEntry_DoNotUse>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Value* Arena::CreateMaybeMessage<::google::protobuf::Value>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\nenum NullValue {\n  NULL_VALUE = 0,\n  NullValue_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,\n  NullValue_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max\n};\nLIBPROTOBUF_EXPORT bool NullValue_IsValid(int value);\nconst NullValue NullValue_MIN = NULL_VALUE;\nconst NullValue NullValue_MAX = NULL_VALUE;\nconst int NullValue_ARRAYSIZE = NullValue_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* NullValue_descriptor();\ninline const ::std::string& NullValue_Name(NullValue value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    NullValue_descriptor(), value);\n}\ninline bool NullValue_Parse(\n    const ::std::string& name, NullValue* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<NullValue>(\n    NullValue_descriptor(), name, value);\n}\n// ===================================================================\n\nclass Struct_FieldsEntry_DoNotUse : public ::google::protobuf::internal::MapEntry<Struct_FieldsEntry_DoNotUse, \n    ::std::string, ::google::protobuf::Value,\n    ::google::protobuf::internal::WireFormatLite::TYPE_STRING,\n    ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,\n    0 > {\npublic:\n  typedef ::google::protobuf::internal::MapEntry<Struct_FieldsEntry_DoNotUse, \n    ::std::string, ::google::protobuf::Value,\n    ::google::protobuf::internal::WireFormatLite::TYPE_STRING,\n    ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,\n    0 > SuperType;\n  Struct_FieldsEntry_DoNotUse();\n  Struct_FieldsEntry_DoNotUse(::google::protobuf::Arena* arena);\n  void MergeFrom(const Struct_FieldsEntry_DoNotUse& other);\n  static const Struct_FieldsEntry_DoNotUse* internal_default_instance() { return reinterpret_cast<const Struct_FieldsEntry_DoNotUse*>(&_Struct_FieldsEntry_DoNotUse_default_instance_); }\n  void MergeFrom(const ::google::protobuf::Message& other) final;\n  ::google::protobuf::Metadata GetMetadata() const;\n};\n\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT Struct : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Struct) */ {\n public:\n  Struct();\n  virtual ~Struct();\n\n  Struct(const Struct& from);\n\n  inline Struct& operator=(const Struct& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Struct(Struct&& from) noexcept\n    : Struct() {\n    *this = ::std::move(from);\n  }\n\n  inline Struct& operator=(Struct&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Struct& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Struct* internal_default_instance() {\n    return reinterpret_cast<const Struct*>(\n               &_Struct_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    1;\n\n  void UnsafeArenaSwap(Struct* other);\n  void Swap(Struct* other);\n  friend void swap(Struct& a, Struct& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Struct* New() const final {\n    return CreateMaybeMessage<Struct>(NULL);\n  }\n\n  Struct* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Struct>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Struct& from);\n  void MergeFrom(const Struct& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Struct* other);\n  protected:\n  explicit Struct(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n\n  // accessors -------------------------------------------------------\n\n  // map<string, .google.protobuf.Value> fields = 1;\n  int fields_size() const;\n  void clear_fields();\n  static const int kFieldsFieldNumber = 1;\n  const ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >&\n      fields() const;\n  ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >*\n      mutable_fields();\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Struct)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::MapField<\n      Struct_FieldsEntry_DoNotUse,\n      ::std::string, ::google::protobuf::Value,\n      ::google::protobuf::internal::WireFormatLite::TYPE_STRING,\n      ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,\n      0 > fields_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Value) */ {\n public:\n  Value();\n  virtual ~Value();\n\n  Value(const Value& from);\n\n  inline Value& operator=(const Value& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Value(Value&& from) noexcept\n    : Value() {\n    *this = ::std::move(from);\n  }\n\n  inline Value& operator=(Value&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Value& default_instance();\n\n  enum KindCase {\n    kNullValue = 1,\n    kNumberValue = 2,\n    kStringValue = 3,\n    kBoolValue = 4,\n    kStructValue = 5,\n    kListValue = 6,\n    KIND_NOT_SET = 0,\n  };\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Value* internal_default_instance() {\n    return reinterpret_cast<const Value*>(\n               &_Value_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    2;\n\n  void UnsafeArenaSwap(Value* other);\n  void Swap(Value* other);\n  friend void swap(Value& a, Value& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Value* New() const final {\n    return CreateMaybeMessage<Value>(NULL);\n  }\n\n  Value* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Value>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Value& from);\n  void MergeFrom(const Value& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Value* other);\n  protected:\n  explicit Value(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // .google.protobuf.NullValue null_value = 1;\n  private:\n  bool has_null_value() const;\n  public:\n  void clear_null_value();\n  static const int kNullValueFieldNumber = 1;\n  ::google::protobuf::NullValue null_value() const;\n  void set_null_value(::google::protobuf::NullValue value);\n\n  // double number_value = 2;\n  private:\n  bool has_number_value() const;\n  public:\n  void clear_number_value();\n  static const int kNumberValueFieldNumber = 2;\n  double number_value() const;\n  void set_number_value(double value);\n\n  // string string_value = 3;\n  private:\n  bool has_string_value() const;\n  public:\n  void clear_string_value();\n  static const int kStringValueFieldNumber = 3;\n  const ::std::string& string_value() const;\n  void set_string_value(const ::std::string& value);\n  #if LANG_CXX11\n  void set_string_value(::std::string&& value);\n  #endif\n  void set_string_value(const char* value);\n  void set_string_value(const char* value, size_t size);\n  ::std::string* mutable_string_value();\n  ::std::string* release_string_value();\n  void set_allocated_string_value(::std::string* string_value);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_string_value();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_string_value(\n      ::std::string* string_value);\n\n  // bool bool_value = 4;\n  private:\n  bool has_bool_value() const;\n  public:\n  void clear_bool_value();\n  static const int kBoolValueFieldNumber = 4;\n  bool bool_value() const;\n  void set_bool_value(bool value);\n\n  // .google.protobuf.Struct struct_value = 5;\n  bool has_struct_value() const;\n  void clear_struct_value();\n  static const int kStructValueFieldNumber = 5;\n  private:\n  const ::google::protobuf::Struct& _internal_struct_value() const;\n  public:\n  const ::google::protobuf::Struct& struct_value() const;\n  ::google::protobuf::Struct* release_struct_value();\n  ::google::protobuf::Struct* mutable_struct_value();\n  void set_allocated_struct_value(::google::protobuf::Struct* struct_value);\n  void unsafe_arena_set_allocated_struct_value(\n      ::google::protobuf::Struct* struct_value);\n  ::google::protobuf::Struct* unsafe_arena_release_struct_value();\n\n  // .google.protobuf.ListValue list_value = 6;\n  bool has_list_value() const;\n  void clear_list_value();\n  static const int kListValueFieldNumber = 6;\n  private:\n  const ::google::protobuf::ListValue& _internal_list_value() const;\n  public:\n  const ::google::protobuf::ListValue& list_value() const;\n  ::google::protobuf::ListValue* release_list_value();\n  ::google::protobuf::ListValue* mutable_list_value();\n  void set_allocated_list_value(::google::protobuf::ListValue* list_value);\n  void unsafe_arena_set_allocated_list_value(\n      ::google::protobuf::ListValue* list_value);\n  ::google::protobuf::ListValue* unsafe_arena_release_list_value();\n\n  void clear_kind();\n  KindCase kind_case() const;\n  // @@protoc_insertion_point(class_scope:google.protobuf.Value)\n private:\n  void set_has_null_value();\n  void set_has_number_value();\n  void set_has_string_value();\n  void set_has_bool_value();\n  void set_has_struct_value();\n  void set_has_list_value();\n\n  inline bool has_kind() const;\n  inline void clear_has_kind();\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  union KindUnion {\n    KindUnion() {}\n    int null_value_;\n    double number_value_;\n    ::google::protobuf::internal::ArenaStringPtr string_value_;\n    bool bool_value_;\n    ::google::protobuf::Struct* struct_value_;\n    ::google::protobuf::ListValue* list_value_;\n  } kind_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  ::google::protobuf::uint32 _oneof_case_[1];\n\n  friend struct ::protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT ListValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.ListValue) */ {\n public:\n  ListValue();\n  virtual ~ListValue();\n\n  ListValue(const ListValue& from);\n\n  inline ListValue& operator=(const ListValue& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  ListValue(ListValue&& from) noexcept\n    : ListValue() {\n    *this = ::std::move(from);\n  }\n\n  inline ListValue& operator=(ListValue&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const ListValue& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const ListValue* internal_default_instance() {\n    return reinterpret_cast<const ListValue*>(\n               &_ListValue_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    3;\n\n  void UnsafeArenaSwap(ListValue* other);\n  void Swap(ListValue* other);\n  friend void swap(ListValue& a, ListValue& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline ListValue* New() const final {\n    return CreateMaybeMessage<ListValue>(NULL);\n  }\n\n  ListValue* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<ListValue>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const ListValue& from);\n  void MergeFrom(const ListValue& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(ListValue* other);\n  protected:\n  explicit ListValue(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.Value values = 1;\n  int values_size() const;\n  void clear_values();\n  static const int kValuesFieldNumber = 1;\n  ::google::protobuf::Value* mutable_values(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >*\n      mutable_values();\n  const ::google::protobuf::Value& values(int index) const;\n  ::google::protobuf::Value* add_values();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >&\n      values() const;\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.ListValue)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value > values_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fstruct_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// -------------------------------------------------------------------\n\n// Struct\n\n// map<string, .google.protobuf.Value> fields = 1;\ninline int Struct::fields_size() const {\n  return fields_.size();\n}\ninline void Struct::clear_fields() {\n  fields_.Clear();\n}\ninline const ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >&\nStruct::fields() const {\n  // @@protoc_insertion_point(field_map:google.protobuf.Struct.fields)\n  return fields_.GetMap();\n}\ninline ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >*\nStruct::mutable_fields() {\n  // @@protoc_insertion_point(field_mutable_map:google.protobuf.Struct.fields)\n  return fields_.MutableMap();\n}\n\n// -------------------------------------------------------------------\n\n// Value\n\n// .google.protobuf.NullValue null_value = 1;\ninline bool Value::has_null_value() const {\n  return kind_case() == kNullValue;\n}\ninline void Value::set_has_null_value() {\n  _oneof_case_[0] = kNullValue;\n}\ninline void Value::clear_null_value() {\n  if (has_null_value()) {\n    kind_.null_value_ = 0;\n    clear_has_kind();\n  }\n}\ninline ::google::protobuf::NullValue Value::null_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Value.null_value)\n  if (has_null_value()) {\n    return static_cast< ::google::protobuf::NullValue >(kind_.null_value_);\n  }\n  return static_cast< ::google::protobuf::NullValue >(0);\n}\ninline void Value::set_null_value(::google::protobuf::NullValue value) {\n  if (!has_null_value()) {\n    clear_kind();\n    set_has_null_value();\n  }\n  kind_.null_value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Value.null_value)\n}\n\n// double number_value = 2;\ninline bool Value::has_number_value() const {\n  return kind_case() == kNumberValue;\n}\ninline void Value::set_has_number_value() {\n  _oneof_case_[0] = kNumberValue;\n}\ninline void Value::clear_number_value() {\n  if (has_number_value()) {\n    kind_.number_value_ = 0;\n    clear_has_kind();\n  }\n}\ninline double Value::number_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Value.number_value)\n  if (has_number_value()) {\n    return kind_.number_value_;\n  }\n  return 0;\n}\ninline void Value::set_number_value(double value) {\n  if (!has_number_value()) {\n    clear_kind();\n    set_has_number_value();\n  }\n  kind_.number_value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Value.number_value)\n}\n\n// string string_value = 3;\ninline bool Value::has_string_value() const {\n  return kind_case() == kStringValue;\n}\ninline void Value::set_has_string_value() {\n  _oneof_case_[0] = kStringValue;\n}\ninline void Value::clear_string_value() {\n  if (has_string_value()) {\n    kind_.string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n        GetArenaNoVirtual());\n    clear_has_kind();\n  }\n}\ninline const ::std::string& Value::string_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Value.string_value)\n  if (has_string_value()) {\n    return kind_.string_value_.Get();\n  }\n  return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();\n}\ninline void Value::set_string_value(const ::std::string& value) {\n  if (!has_string_value()) {\n    clear_kind();\n    set_has_string_value();\n    kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  kind_.string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value)\n}\n#if LANG_CXX11\ninline void Value::set_string_value(::std::string&& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value)\n  if (!has_string_value()) {\n    clear_kind();\n    set_has_string_value();\n    kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  kind_.string_value_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Value.string_value)\n}\n#endif\ninline void Value::set_string_value(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  if (!has_string_value()) {\n    clear_kind();\n    set_has_string_value();\n    kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  kind_.string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      ::std::string(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Value.string_value)\n}\ninline void Value::set_string_value(const char* value,\n                             size_t size) {\n  if (!has_string_value()) {\n    clear_kind();\n    set_has_string_value();\n    kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  kind_.string_value_.Set(\n      &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size),\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Value.string_value)\n}\ninline ::std::string* Value::mutable_string_value() {\n  if (!has_string_value()) {\n    clear_kind();\n    set_has_string_value();\n    kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  return kind_.string_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Value.string_value)\n}\ninline ::std::string* Value::release_string_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Value.string_value)\n  if (has_string_value()) {\n    clear_has_kind();\n    return kind_.string_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n        GetArenaNoVirtual());\n  } else {\n    return NULL;\n  }\n}\ninline void Value::set_allocated_string_value(::std::string* string_value) {\n  if (!has_string_value()) {\n    kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  clear_kind();\n  if (string_value != NULL) {\n    set_has_string_value();\n    kind_.string_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value,\n        GetArenaNoVirtual());\n  }\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.string_value)\n}\ninline ::std::string* Value::unsafe_arena_release_string_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.string_value)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (has_string_value()) {\n    clear_has_kind();\n    return kind_.string_value_.UnsafeArenaRelease(\n        &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n  } else {\n    return NULL;\n  }\n}\ninline void Value::unsafe_arena_set_allocated_string_value(::std::string* string_value) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (!has_string_value()) {\n    kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());\n  }\n  clear_kind();\n  if (string_value) {\n    set_has_string_value();\n    kind_.string_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value, GetArenaNoVirtual());\n  }\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.string_value)\n}\n\n// bool bool_value = 4;\ninline bool Value::has_bool_value() const {\n  return kind_case() == kBoolValue;\n}\ninline void Value::set_has_bool_value() {\n  _oneof_case_[0] = kBoolValue;\n}\ninline void Value::clear_bool_value() {\n  if (has_bool_value()) {\n    kind_.bool_value_ = false;\n    clear_has_kind();\n  }\n}\ninline bool Value::bool_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Value.bool_value)\n  if (has_bool_value()) {\n    return kind_.bool_value_;\n  }\n  return false;\n}\ninline void Value::set_bool_value(bool value) {\n  if (!has_bool_value()) {\n    clear_kind();\n    set_has_bool_value();\n  }\n  kind_.bool_value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Value.bool_value)\n}\n\n// .google.protobuf.Struct struct_value = 5;\ninline bool Value::has_struct_value() const {\n  return kind_case() == kStructValue;\n}\ninline void Value::set_has_struct_value() {\n  _oneof_case_[0] = kStructValue;\n}\ninline void Value::clear_struct_value() {\n  if (has_struct_value()) {\n    if (GetArenaNoVirtual() == NULL) {\n      delete kind_.struct_value_;\n    }\n    clear_has_kind();\n  }\n}\ninline const ::google::protobuf::Struct& Value::_internal_struct_value() const {\n  return *kind_.struct_value_;\n}\ninline ::google::protobuf::Struct* Value::release_struct_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Value.struct_value)\n  if (has_struct_value()) {\n    clear_has_kind();\n      ::google::protobuf::Struct* temp = kind_.struct_value_;\n    if (GetArenaNoVirtual() != NULL) {\n      temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n    }\n    kind_.struct_value_ = NULL;\n    return temp;\n  } else {\n    return NULL;\n  }\n}\ninline const ::google::protobuf::Struct& Value::struct_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Value.struct_value)\n  return has_struct_value()\n      ? *kind_.struct_value_\n      : *reinterpret_cast< ::google::protobuf::Struct*>(&::google::protobuf::_Struct_default_instance_);\n}\ninline ::google::protobuf::Struct* Value::unsafe_arena_release_struct_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.struct_value)\n  if (has_struct_value()) {\n    clear_has_kind();\n    ::google::protobuf::Struct* temp = kind_.struct_value_;\n    kind_.struct_value_ = NULL;\n    return temp;\n  } else {\n    return NULL;\n  }\n}\ninline void Value::unsafe_arena_set_allocated_struct_value(::google::protobuf::Struct* struct_value) {\n  clear_kind();\n  if (struct_value) {\n    set_has_struct_value();\n    kind_.struct_value_ = struct_value;\n  }\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.struct_value)\n}\ninline ::google::protobuf::Struct* Value::mutable_struct_value() {\n  if (!has_struct_value()) {\n    clear_kind();\n    set_has_struct_value();\n    kind_.struct_value_ = CreateMaybeMessage< ::google::protobuf::Struct >(\n        GetArenaNoVirtual());\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Value.struct_value)\n  return kind_.struct_value_;\n}\n\n// .google.protobuf.ListValue list_value = 6;\ninline bool Value::has_list_value() const {\n  return kind_case() == kListValue;\n}\ninline void Value::set_has_list_value() {\n  _oneof_case_[0] = kListValue;\n}\ninline void Value::clear_list_value() {\n  if (has_list_value()) {\n    if (GetArenaNoVirtual() == NULL) {\n      delete kind_.list_value_;\n    }\n    clear_has_kind();\n  }\n}\ninline const ::google::protobuf::ListValue& Value::_internal_list_value() const {\n  return *kind_.list_value_;\n}\ninline ::google::protobuf::ListValue* Value::release_list_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Value.list_value)\n  if (has_list_value()) {\n    clear_has_kind();\n      ::google::protobuf::ListValue* temp = kind_.list_value_;\n    if (GetArenaNoVirtual() != NULL) {\n      temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n    }\n    kind_.list_value_ = NULL;\n    return temp;\n  } else {\n    return NULL;\n  }\n}\ninline const ::google::protobuf::ListValue& Value::list_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Value.list_value)\n  return has_list_value()\n      ? *kind_.list_value_\n      : *reinterpret_cast< ::google::protobuf::ListValue*>(&::google::protobuf::_ListValue_default_instance_);\n}\ninline ::google::protobuf::ListValue* Value::unsafe_arena_release_list_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.list_value)\n  if (has_list_value()) {\n    clear_has_kind();\n    ::google::protobuf::ListValue* temp = kind_.list_value_;\n    kind_.list_value_ = NULL;\n    return temp;\n  } else {\n    return NULL;\n  }\n}\ninline void Value::unsafe_arena_set_allocated_list_value(::google::protobuf::ListValue* list_value) {\n  clear_kind();\n  if (list_value) {\n    set_has_list_value();\n    kind_.list_value_ = list_value;\n  }\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.list_value)\n}\ninline ::google::protobuf::ListValue* Value::mutable_list_value() {\n  if (!has_list_value()) {\n    clear_kind();\n    set_has_list_value();\n    kind_.list_value_ = CreateMaybeMessage< ::google::protobuf::ListValue >(\n        GetArenaNoVirtual());\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Value.list_value)\n  return kind_.list_value_;\n}\n\ninline bool Value::has_kind() const {\n  return kind_case() != KIND_NOT_SET;\n}\ninline void Value::clear_has_kind() {\n  _oneof_case_[0] = KIND_NOT_SET;\n}\ninline Value::KindCase Value::kind_case() const {\n  return Value::KindCase(_oneof_case_[0]);\n}\n// -------------------------------------------------------------------\n\n// ListValue\n\n// repeated .google.protobuf.Value values = 1;\ninline int ListValue::values_size() const {\n  return values_.size();\n}\ninline void ListValue::clear_values() {\n  values_.Clear();\n}\ninline ::google::protobuf::Value* ListValue::mutable_values(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.ListValue.values)\n  return values_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >*\nListValue::mutable_values() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.ListValue.values)\n  return &values_;\n}\ninline const ::google::protobuf::Value& ListValue::values(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.ListValue.values)\n  return values_.Get(index);\n}\ninline ::google::protobuf::Value* ListValue::add_values() {\n  // @@protoc_insertion_point(field_add:google.protobuf.ListValue.values)\n  return values_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >&\nListValue::values() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.ListValue.values)\n  return values_;\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\nnamespace google {\nnamespace protobuf {\n\ntemplate <> struct is_proto_enum< ::google::protobuf::NullValue> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::NullValue>() {\n  return ::google::protobuf::NullValue_descriptor();\n}\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2fstruct_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/struct.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption go_package = \"github.com/golang/protobuf/ptypes/struct;structpb\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"StructProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n\n// `Struct` represents a structured data value, consisting of fields\n// which map to dynamically typed values. In some languages, `Struct`\n// might be supported by a native representation. For example, in\n// scripting languages like JS a struct is represented as an\n// object. The details of that representation are described together\n// with the proto support for the language.\n//\n// The JSON representation for `Struct` is JSON object.\nmessage Struct {\n  // Unordered map of dynamically typed values.\n  map<string, Value> fields = 1;\n}\n\n// `Value` represents a dynamically typed value which can be either\n// null, a number, a string, a boolean, a recursive struct value, or a\n// list of values. A producer of value is expected to set one of that\n// variants, absence of any variant indicates an error.\n//\n// The JSON representation for `Value` is JSON value.\nmessage Value {\n  // The kind of value.\n  oneof kind {\n    // Represents a null value.\n    NullValue null_value = 1;\n    // Represents a double value.\n    double number_value = 2;\n    // Represents a string value.\n    string string_value = 3;\n    // Represents a boolean value.\n    bool bool_value = 4;\n    // Represents a structured value.\n    Struct struct_value = 5;\n    // Represents a repeated `Value`.\n    ListValue list_value = 6;\n  }\n}\n\n// `NullValue` is a singleton enumeration to represent the null value for the\n// `Value` type union.\n//\n//  The JSON representation for `NullValue` is JSON `null`.\nenum NullValue {\n  // Null value.\n  NULL_VALUE = 0;\n}\n\n// `ListValue` is a wrapper around a repeated field of values.\n//\n// The JSON representation for `ListValue` is JSON array.\nmessage ListValue {\n  // Repeated field of dynamically typed values.\n  repeated Value values = 1;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/bytestream.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// This file declares the ByteSink and ByteSource abstract interfaces. These\n// interfaces represent objects that consume (ByteSink) or produce (ByteSource)\n// a sequence of bytes. Using these abstract interfaces in your APIs can help\n// make your code work with a variety of input and output types.\n//\n// This file also declares the following commonly used implementations of these\n// interfaces.\n//\n//   ByteSink:\n//      UncheckedArrayByteSink  Writes to an array, without bounds checking\n//      CheckedArrayByteSink    Writes to an array, with bounds checking\n//      GrowingArrayByteSink    Allocates and writes to a growable buffer\n//      StringByteSink          Writes to an STL string\n//      NullByteSink            Consumes a never-ending stream of bytes\n//\n//   ByteSource:\n//      ArrayByteSource         Reads from an array or string/StringPiece\n//      LimitedByteSource       Limits the number of bytes read from an\n\n#ifndef GOOGLE_PROTOBUF_STUBS_BYTESTREAM_H_\n#define GOOGLE_PROTOBUF_STUBS_BYTESTREAM_H_\n\n#include <stddef.h>\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/stringpiece.h>\n\nclass CordByteSink;\nclass MemBlock;\n\nnamespace google {\nnamespace protobuf {\nnamespace strings {\n\n// An abstract interface for an object that consumes a sequence of bytes. This\n// interface offers a way to append data as well as a Flush() function.\n//\n// Example:\n//\n//   string my_data;\n//   ...\n//   ByteSink* sink = ...\n//   sink->Append(my_data.data(), my_data.size());\n//   sink->Flush();\n//\nclass LIBPROTOBUF_EXPORT ByteSink {\n public:\n  ByteSink() {}\n  virtual ~ByteSink() {}\n\n  // Appends the \"n\" bytes starting at \"bytes\".\n  virtual void Append(const char* bytes, size_t n) = 0;\n\n  // Flushes internal buffers. The default implemenation does nothing. ByteSink\n  // subclasses may use internal buffers that require calling Flush() at the end\n  // of the stream.\n  virtual void Flush();\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ByteSink);\n};\n\n// An abstract interface for an object that produces a fixed-size sequence of\n// bytes.\n//\n// Example:\n//\n//   ByteSource* source = ...\n//   while (source->Available() > 0) {\n//     StringPiece data = source->Peek();\n//     ... do something with \"data\" ...\n//     source->Skip(data.length());\n//   }\n//\nclass LIBPROTOBUF_EXPORT ByteSource {\n public:\n  ByteSource() {}\n  virtual ~ByteSource() {}\n\n  // Returns the number of bytes left to read from the source. Available()\n  // should decrease by N each time Skip(N) is called. Available() may not\n  // increase. Available() returning 0 indicates that the ByteSource is\n  // exhausted.\n  //\n  // Note: Size() may have been a more appropriate name as it's more\n  //       indicative of the fixed-size nature of a ByteSource.\n  virtual size_t Available() const = 0;\n\n  // Returns a StringPiece of the next contiguous region of the source. Does not\n  // reposition the source. The returned region is empty iff Available() == 0.\n  //\n  // The returned region is valid until the next call to Skip() or until this\n  // object is destroyed, whichever occurs first.\n  //\n  // The length of the returned StringPiece will be <= Available().\n  virtual StringPiece Peek() = 0;\n\n  // Skips the next n bytes. Invalidates any StringPiece returned by a previous\n  // call to Peek().\n  //\n  // REQUIRES: Available() >= n\n  virtual void Skip(size_t n) = 0;\n\n  // Writes the next n bytes in this ByteSource to the given ByteSink, and\n  // advances this ByteSource past the copied bytes. The default implementation\n  // of this method just copies the bytes normally, but subclasses might\n  // override CopyTo to optimize certain cases.\n  //\n  // REQUIRES: Available() >= n\n  virtual void CopyTo(ByteSink* sink, size_t n);\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ByteSource);\n};\n\n//\n// Some commonly used implementations of ByteSink\n//\n\n// Implementation of ByteSink that writes to an unsized byte array. No\n// bounds-checking is performed--it is the caller's responsibility to ensure\n// that the destination array is large enough.\n//\n// Example:\n//\n//   char buf[10];\n//   UncheckedArrayByteSink sink(buf);\n//   sink.Append(\"hi\", 2);    // OK\n//   sink.Append(data, 100);  // WOOPS! Overflows buf[10].\n//\nclass LIBPROTOBUF_EXPORT UncheckedArrayByteSink : public ByteSink {\n public:\n  explicit UncheckedArrayByteSink(char* dest) : dest_(dest) {}\n  virtual void Append(const char* data, size_t n);\n\n  // Returns the current output pointer so that a caller can see how many bytes\n  // were produced.\n  //\n  // Note: this method is not part of the ByteSink interface.\n  char* CurrentDestination() const { return dest_; }\n\n private:\n  char* dest_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(UncheckedArrayByteSink);\n};\n\n// Implementation of ByteSink that writes to a sized byte array. This sink will\n// not write more than \"capacity\" bytes to outbuf. Once \"capacity\" bytes are\n// appended, subsequent bytes will be ignored and Overflowed() will return true.\n// Overflowed() does not cause a runtime error (i.e., it does not CHECK fail).\n//\n// Example:\n//\n//   char buf[10];\n//   CheckedArrayByteSink sink(buf, 10);\n//   sink.Append(\"hi\", 2);    // OK\n//   sink.Append(data, 100);  // Will only write 8 more bytes\n//\nclass LIBPROTOBUF_EXPORT CheckedArrayByteSink : public ByteSink {\n public:\n  CheckedArrayByteSink(char* outbuf, size_t capacity);\n  virtual void Append(const char* bytes, size_t n);\n\n  // Returns the number of bytes actually written to the sink.\n  size_t NumberOfBytesWritten() const { return size_; }\n\n  // Returns true if any bytes were discarded, i.e., if there was an\n  // attempt to write more than 'capacity' bytes.\n  bool Overflowed() const { return overflowed_; }\n\n private:\n  char* outbuf_;\n  const size_t capacity_;\n  size_t size_;\n  bool overflowed_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CheckedArrayByteSink);\n};\n\n// Implementation of ByteSink that allocates an internal buffer (a char array)\n// and expands it as needed to accommodate appended data (similar to a string),\n// and allows the caller to take ownership of the internal buffer via the\n// GetBuffer() method. The buffer returned from GetBuffer() must be deleted by\n// the caller with delete[]. GetBuffer() also sets the internal buffer to be\n// empty, and subsequent appends to the sink will create a new buffer. The\n// destructor will free the internal buffer if GetBuffer() was not called.\n//\n// Example:\n//\n//   GrowingArrayByteSink sink(10);\n//   sink.Append(\"hi\", 2);\n//   sink.Append(data, n);\n//   const char* buf = sink.GetBuffer();  // Ownership transferred\n//   delete[] buf;\n//\nclass LIBPROTOBUF_EXPORT GrowingArrayByteSink : public strings::ByteSink {\n public:\n  explicit GrowingArrayByteSink(size_t estimated_size);\n  virtual ~GrowingArrayByteSink();\n  virtual void Append(const char* bytes, size_t n);\n\n  // Returns the allocated buffer, and sets nbytes to its size. The caller takes\n  // ownership of the buffer and must delete it with delete[].\n  char* GetBuffer(size_t* nbytes);\n\n private:\n  void Expand(size_t amount);\n  void ShrinkToFit();\n\n  size_t capacity_;\n  char* buf_;\n  size_t size_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GrowingArrayByteSink);\n};\n\n// Implementation of ByteSink that appends to the given string.\n// Existing contents of \"dest\" are not modified; new data is appended.\n//\n// Example:\n//\n//   string dest = \"Hello \";\n//   StringByteSink sink(&dest);\n//   sink.Append(\"World\", 5);\n//   assert(dest == \"Hello World\");\n//\nclass LIBPROTOBUF_EXPORT StringByteSink : public ByteSink {\n public:\n  explicit StringByteSink(string* dest) : dest_(dest) {}\n  virtual void Append(const char* data, size_t n);\n\n private:\n  string* dest_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringByteSink);\n};\n\n// Implementation of ByteSink that discards all data.\n//\n// Example:\n//\n//   NullByteSink sink;\n//   sink.Append(data, data.size());  // All data ignored.\n//\nclass LIBPROTOBUF_EXPORT NullByteSink : public ByteSink {\n public:\n  NullByteSink() {}\n  virtual void Append(const char *data, size_t n) {}\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(NullByteSink);\n};\n\n//\n// Some commonly used implementations of ByteSource\n//\n\n// Implementation of ByteSource that reads from a StringPiece.\n//\n// Example:\n//\n//   string data = \"Hello\";\n//   ArrayByteSource source(data);\n//   assert(source.Available() == 5);\n//   assert(source.Peek() == \"Hello\");\n//\nclass LIBPROTOBUF_EXPORT ArrayByteSource : public ByteSource {\n public:\n  explicit ArrayByteSource(StringPiece s) : input_(s) {}\n\n  virtual size_t Available() const;\n  virtual StringPiece Peek();\n  virtual void Skip(size_t n);\n\n private:\n  StringPiece   input_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ArrayByteSource);\n};\n\n// Implementation of ByteSource that wraps another ByteSource, limiting the\n// number of bytes returned.\n//\n// The caller maintains ownership of the underlying source, and may not use the\n// underlying source while using the LimitByteSource object.  The underlying\n// source's pointer is advanced by n bytes every time this LimitByteSource\n// object is advanced by n.\n//\n// Example:\n//\n//   string data = \"Hello World\";\n//   ArrayByteSource abs(data);\n//   assert(abs.Available() == data.size());\n//\n//   LimitByteSource limit(abs, 5);\n//   assert(limit.Available() == 5);\n//   assert(limit.Peek() == \"Hello\");\n//\nclass LIBPROTOBUF_EXPORT LimitByteSource : public ByteSource {\n public:\n  // Returns at most \"limit\" bytes from \"source\".\n  LimitByteSource(ByteSource* source, size_t limit);\n\n  virtual size_t Available() const;\n  virtual StringPiece Peek();\n  virtual void Skip(size_t n);\n\n  // We override CopyTo so that we can forward to the underlying source, in\n  // case it has an efficient implementation of CopyTo.\n  virtual void CopyTo(ByteSink* sink, size_t n);\n\n private:\n  ByteSource* source_;\n  size_t limit_;\n};\n\n}  // namespace strings\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_BYTESTREAM_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/callback.h",
    "content": "#ifndef GOOGLE_PROTOBUF_STUBS_CALLBACK_H_\n#define GOOGLE_PROTOBUF_STUBS_CALLBACK_H_\n\n#include <type_traits>\n\n#include <google/protobuf/stubs/macros.h>\n\n// ===================================================================\n// emulates google3/base/callback.h\n\nnamespace google {\nnamespace protobuf {\n\n// Abstract interface for a callback.  When calling an RPC, you must provide\n// a Closure to call when the procedure completes.  See the Service interface\n// in service.h.\n//\n// To automatically construct a Closure which calls a particular function or\n// method with a particular set of parameters, use the NewCallback() function.\n// Example:\n//   void FooDone(const FooResponse* response) {\n//     ...\n//   }\n//\n//   void CallFoo() {\n//     ...\n//     // When done, call FooDone() and pass it a pointer to the response.\n//     Closure* callback = NewCallback(&FooDone, response);\n//     // Make the call.\n//     service->Foo(controller, request, response, callback);\n//   }\n//\n// Example that calls a method:\n//   class Handler {\n//    public:\n//     ...\n//\n//     void FooDone(const FooResponse* response) {\n//       ...\n//     }\n//\n//     void CallFoo() {\n//       ...\n//       // When done, call FooDone() and pass it a pointer to the response.\n//       Closure* callback = NewCallback(this, &Handler::FooDone, response);\n//       // Make the call.\n//       service->Foo(controller, request, response, callback);\n//     }\n//   };\n//\n// Currently NewCallback() supports binding zero, one, or two arguments.\n//\n// Callbacks created with NewCallback() automatically delete themselves when\n// executed.  They should be used when a callback is to be called exactly\n// once (usually the case with RPC callbacks).  If a callback may be called\n// a different number of times (including zero), create it with\n// NewPermanentCallback() instead.  You are then responsible for deleting the\n// callback (using the \"delete\" keyword as normal).\n//\n// Note that NewCallback() is a bit touchy regarding argument types.  Generally,\n// the values you provide for the parameter bindings must exactly match the\n// types accepted by the callback function.  For example:\n//   void Foo(string s);\n//   NewCallback(&Foo, \"foo\");          // WON'T WORK:  const char* != string\n//   NewCallback(&Foo, string(\"foo\"));  // WORKS\n// Also note that the arguments cannot be references:\n//   void Foo(const string& s);\n//   string my_str;\n//   NewCallback(&Foo, my_str);  // WON'T WORK:  Can't use referecnes.\n// However, correctly-typed pointers will work just fine.\nclass LIBPROTOBUF_EXPORT Closure {\n public:\n  Closure() {}\n  virtual ~Closure();\n\n  virtual void Run() = 0;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Closure);\n};\n\ntemplate<typename R>\nclass ResultCallback {\n public:\n  ResultCallback() {}\n  virtual ~ResultCallback() {}\n\n  virtual R Run() = 0;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ResultCallback);\n};\n\ntemplate<typename R, typename A1>\nclass LIBPROTOBUF_EXPORT ResultCallback1 {\n public:\n  ResultCallback1() {}\n  virtual ~ResultCallback1() {}\n\n  virtual R Run(A1) = 0;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ResultCallback1);\n};\n\ntemplate<typename R, typename A1, typename A2>\nclass LIBPROTOBUF_EXPORT ResultCallback2 {\n public:\n  ResultCallback2() {}\n  virtual ~ResultCallback2() {}\n\n  virtual R Run(A1,A2) = 0;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ResultCallback2);\n};\n\nnamespace internal {\n\nclass LIBPROTOBUF_EXPORT FunctionClosure0 : public Closure {\n public:\n  typedef void (*FunctionType)();\n\n  FunctionClosure0(FunctionType function, bool self_deleting)\n    : function_(function), self_deleting_(self_deleting) {}\n  ~FunctionClosure0();\n\n  void Run() {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    function_();\n    if (needs_delete) delete this;\n  }\n\n private:\n  FunctionType function_;\n  bool self_deleting_;\n};\n\ntemplate <typename Class>\nclass MethodClosure0 : public Closure {\n public:\n  typedef void (Class::*MethodType)();\n\n  MethodClosure0(Class* object, MethodType method, bool self_deleting)\n    : object_(object), method_(method), self_deleting_(self_deleting) {}\n  ~MethodClosure0() {}\n\n  void Run() {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    (object_->*method_)();\n    if (needs_delete) delete this;\n  }\n\n private:\n  Class* object_;\n  MethodType method_;\n  bool self_deleting_;\n};\n\ntemplate <typename Arg1>\nclass FunctionClosure1 : public Closure {\n public:\n  typedef void (*FunctionType)(Arg1 arg1);\n\n  FunctionClosure1(FunctionType function, bool self_deleting,\n                   Arg1 arg1)\n    : function_(function), self_deleting_(self_deleting),\n      arg1_(arg1) {}\n  ~FunctionClosure1() {}\n\n  void Run() {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    function_(arg1_);\n    if (needs_delete) delete this;\n  }\n\n private:\n  FunctionType function_;\n  bool self_deleting_;\n  Arg1 arg1_;\n};\n\ntemplate <typename Class, typename Arg1>\nclass MethodClosure1 : public Closure {\n public:\n  typedef void (Class::*MethodType)(Arg1 arg1);\n\n  MethodClosure1(Class* object, MethodType method, bool self_deleting,\n                 Arg1 arg1)\n    : object_(object), method_(method), self_deleting_(self_deleting),\n      arg1_(arg1) {}\n  ~MethodClosure1() {}\n\n  void Run() {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    (object_->*method_)(arg1_);\n    if (needs_delete) delete this;\n  }\n\n private:\n  Class* object_;\n  MethodType method_;\n  bool self_deleting_;\n  Arg1 arg1_;\n};\n\ntemplate <typename Arg1, typename Arg2>\nclass FunctionClosure2 : public Closure {\n public:\n  typedef void (*FunctionType)(Arg1 arg1, Arg2 arg2);\n\n  FunctionClosure2(FunctionType function, bool self_deleting,\n                   Arg1 arg1, Arg2 arg2)\n    : function_(function), self_deleting_(self_deleting),\n      arg1_(arg1), arg2_(arg2) {}\n  ~FunctionClosure2() {}\n\n  void Run() {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    function_(arg1_, arg2_);\n    if (needs_delete) delete this;\n  }\n\n private:\n  FunctionType function_;\n  bool self_deleting_;\n  Arg1 arg1_;\n  Arg2 arg2_;\n};\n\ntemplate <typename Class, typename Arg1, typename Arg2>\nclass MethodClosure2 : public Closure {\n public:\n  typedef void (Class::*MethodType)(Arg1 arg1, Arg2 arg2);\n\n  MethodClosure2(Class* object, MethodType method, bool self_deleting,\n                 Arg1 arg1, Arg2 arg2)\n    : object_(object), method_(method), self_deleting_(self_deleting),\n      arg1_(arg1), arg2_(arg2) {}\n  ~MethodClosure2() {}\n\n  void Run() {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    (object_->*method_)(arg1_, arg2_);\n    if (needs_delete) delete this;\n  }\n\n private:\n  Class* object_;\n  MethodType method_;\n  bool self_deleting_;\n  Arg1 arg1_;\n  Arg2 arg2_;\n};\n\ntemplate<typename R>\nclass FunctionResultCallback_0_0 : public ResultCallback<R> {\n public:\n  typedef R (*FunctionType)();\n\n  FunctionResultCallback_0_0(FunctionType function, bool self_deleting)\n      : function_(function), self_deleting_(self_deleting) {}\n  ~FunctionResultCallback_0_0() {}\n\n  R Run() {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    R result = function_();\n    if (needs_delete) delete this;\n    return result;\n  }\n\n private:\n  FunctionType function_;\n  bool self_deleting_;\n};\n\ntemplate<typename R, typename P1>\nclass FunctionResultCallback_1_0 : public ResultCallback<R> {\n public:\n  typedef R (*FunctionType)(P1);\n\n  FunctionResultCallback_1_0(FunctionType function, bool self_deleting,\n                             P1 p1)\n      : function_(function), self_deleting_(self_deleting), p1_(p1) {}\n  ~FunctionResultCallback_1_0() {}\n\n  R Run() {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    R result = function_(p1_);\n    if (needs_delete) delete this;\n    return result;\n  }\n\n private:\n  FunctionType function_;\n  bool self_deleting_;\n  P1 p1_;\n};\n\ntemplate<typename R, typename Arg1>\nclass FunctionResultCallback_0_1 : public ResultCallback1<R, Arg1> {\n public:\n  typedef R (*FunctionType)(Arg1 arg1);\n\n  FunctionResultCallback_0_1(FunctionType function, bool self_deleting)\n      : function_(function), self_deleting_(self_deleting) {}\n  ~FunctionResultCallback_0_1() {}\n\n  R Run(Arg1 a1) {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    R result = function_(a1);\n    if (needs_delete) delete this;\n    return result;\n  }\n\n private:\n  FunctionType function_;\n  bool self_deleting_;\n};\n\ntemplate<typename R, typename P1, typename A1>\nclass FunctionResultCallback_1_1 : public ResultCallback1<R, A1> {\n public:\n  typedef R (*FunctionType)(P1, A1);\n\n  FunctionResultCallback_1_1(FunctionType function, bool self_deleting,\n                             P1 p1)\n      : function_(function), self_deleting_(self_deleting), p1_(p1) {}\n  ~FunctionResultCallback_1_1() {}\n\n  R Run(A1 a1) {\n    bool needs_delete = self_deleting_;  // read in case callback deletes\n    R result = function_(p1_, a1);\n    if (needs_delete) delete this;\n    return result;\n  }\n\n private:\n  FunctionType function_;\n  bool self_deleting_;\n  P1 p1_;\n};\n\ntemplate <typename T>\nstruct InternalConstRef {\n  typedef typename std::remove_reference<T>::type base_type;\n  typedef const base_type& type;\n};\n\ntemplate<typename R, typename T>\nclass MethodResultCallback_0_0 : public ResultCallback<R> {\n public:\n  typedef R (T::*MethodType)();\n  MethodResultCallback_0_0(T* object, MethodType method, bool self_deleting)\n      : object_(object),\n        method_(method),\n        self_deleting_(self_deleting) {}\n  ~MethodResultCallback_0_0() {}\n\n  R Run() {\n    bool needs_delete = self_deleting_;\n    R result = (object_->*method_)();\n    if (needs_delete) delete this;\n    return result;\n  }\n\n private:\n  T* object_;\n  MethodType method_;\n  bool self_deleting_;\n};\n\ntemplate <typename R, typename T, typename P1, typename P2, typename P3,\n          typename P4, typename P5, typename A1, typename A2>\nclass MethodResultCallback_5_2 : public ResultCallback2<R, A1, A2> {\n public:\n  typedef R (T::*MethodType)(P1, P2, P3, P4, P5, A1, A2);\n  MethodResultCallback_5_2(T* object, MethodType method, bool self_deleting,\n                           P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)\n      : object_(object),\n        method_(method),\n        self_deleting_(self_deleting),\n        p1_(p1),\n        p2_(p2),\n        p3_(p3),\n        p4_(p4),\n        p5_(p5) {}\n  ~MethodResultCallback_5_2() {}\n\n  R Run(A1 a1, A2 a2) {\n    bool needs_delete = self_deleting_;\n    R result = (object_->*method_)(p1_, p2_, p3_, p4_, p5_, a1, a2);\n    if (needs_delete) delete this;\n    return result;\n  }\n\n private:\n  T* object_;\n  MethodType method_;\n  bool self_deleting_;\n  typename std::remove_reference<P1>::type p1_;\n  typename std::remove_reference<P2>::type p2_;\n  typename std::remove_reference<P3>::type p3_;\n  typename std::remove_reference<P4>::type p4_;\n  typename std::remove_reference<P5>::type p5_;\n};\n\n}  // namespace internal\n\n// See Closure.\ninline Closure* NewCallback(void (*function)()) {\n  return new internal::FunctionClosure0(function, true);\n}\n\n// See Closure.\ninline Closure* NewPermanentCallback(void (*function)()) {\n  return new internal::FunctionClosure0(function, false);\n}\n\n// See Closure.\ntemplate <typename Class>\ninline Closure* NewCallback(Class* object, void (Class::*method)()) {\n  return new internal::MethodClosure0<Class>(object, method, true);\n}\n\n// See Closure.\ntemplate <typename Class>\ninline Closure* NewPermanentCallback(Class* object, void (Class::*method)()) {\n  return new internal::MethodClosure0<Class>(object, method, false);\n}\n\n// See Closure.\ntemplate <typename Arg1>\ninline Closure* NewCallback(void (*function)(Arg1),\n                            Arg1 arg1) {\n  return new internal::FunctionClosure1<Arg1>(function, true, arg1);\n}\n\n// See Closure.\ntemplate <typename Arg1>\ninline Closure* NewPermanentCallback(void (*function)(Arg1),\n                                     Arg1 arg1) {\n  return new internal::FunctionClosure1<Arg1>(function, false, arg1);\n}\n\n// See Closure.\ntemplate <typename Class, typename Arg1>\ninline Closure* NewCallback(Class* object, void (Class::*method)(Arg1),\n                            Arg1 arg1) {\n  return new internal::MethodClosure1<Class, Arg1>(object, method, true, arg1);\n}\n\n// See Closure.\ntemplate <typename Class, typename Arg1>\ninline Closure* NewPermanentCallback(Class* object, void (Class::*method)(Arg1),\n                                     Arg1 arg1) {\n  return new internal::MethodClosure1<Class, Arg1>(object, method, false, arg1);\n}\n\n// See Closure.\ntemplate <typename Arg1, typename Arg2>\ninline Closure* NewCallback(void (*function)(Arg1, Arg2),\n                            Arg1 arg1, Arg2 arg2) {\n  return new internal::FunctionClosure2<Arg1, Arg2>(\n    function, true, arg1, arg2);\n}\n\n// See Closure.\ntemplate <typename Arg1, typename Arg2>\ninline Closure* NewPermanentCallback(void (*function)(Arg1, Arg2),\n                                     Arg1 arg1, Arg2 arg2) {\n  return new internal::FunctionClosure2<Arg1, Arg2>(\n    function, false, arg1, arg2);\n}\n\n// See Closure.\ntemplate <typename Class, typename Arg1, typename Arg2>\ninline Closure* NewCallback(Class* object, void (Class::*method)(Arg1, Arg2),\n                            Arg1 arg1, Arg2 arg2) {\n  return new internal::MethodClosure2<Class, Arg1, Arg2>(\n    object, method, true, arg1, arg2);\n}\n\n// See Closure.\ntemplate <typename Class, typename Arg1, typename Arg2>\ninline Closure* NewPermanentCallback(\n    Class* object, void (Class::*method)(Arg1, Arg2),\n    Arg1 arg1, Arg2 arg2) {\n  return new internal::MethodClosure2<Class, Arg1, Arg2>(\n    object, method, false, arg1, arg2);\n}\n\n// See ResultCallback\ntemplate<typename R>\ninline ResultCallback<R>* NewCallback(R (*function)()) {\n  return new internal::FunctionResultCallback_0_0<R>(function, true);\n}\n\n// See ResultCallback\ntemplate<typename R>\ninline ResultCallback<R>* NewPermanentCallback(R (*function)()) {\n  return new internal::FunctionResultCallback_0_0<R>(function, false);\n}\n\n// See ResultCallback\ntemplate<typename R, typename P1>\ninline ResultCallback<R>* NewCallback(R (*function)(P1), P1 p1) {\n  return new internal::FunctionResultCallback_1_0<R, P1>(\n      function, true, p1);\n}\n\n// See ResultCallback\ntemplate<typename R, typename P1>\ninline ResultCallback<R>* NewPermanentCallback(\n    R (*function)(P1), P1 p1) {\n  return new internal::FunctionResultCallback_1_0<R, P1>(\n      function, false, p1);\n}\n\n// See ResultCallback1\ntemplate<typename R, typename A1>\ninline ResultCallback1<R, A1>* NewCallback(R (*function)(A1)) {\n  return new internal::FunctionResultCallback_0_1<R, A1>(function, true);\n}\n\n// See ResultCallback1\ntemplate<typename R, typename A1>\ninline ResultCallback1<R, A1>* NewPermanentCallback(R (*function)(A1)) {\n  return new internal::FunctionResultCallback_0_1<R, A1>(function, false);\n}\n\n// See ResultCallback1\ntemplate<typename R, typename P1, typename A1>\ninline ResultCallback1<R, A1>* NewCallback(R (*function)(P1, A1), P1 p1) {\n  return new internal::FunctionResultCallback_1_1<R, P1, A1>(\n      function, true, p1);\n}\n\n// See ResultCallback1\ntemplate<typename R, typename P1, typename A1>\ninline ResultCallback1<R, A1>* NewPermanentCallback(\n    R (*function)(P1, A1), P1 p1) {\n  return new internal::FunctionResultCallback_1_1<R, P1, A1>(\n      function, false, p1);\n}\n\n// See MethodResultCallback_0_0\ntemplate <typename R, typename T1, typename T2>\ninline ResultCallback<R>* NewPermanentCallback(\n    T1* object, R (T2::*function)()) {\n  return new internal::MethodResultCallback_0_0<R, T1>(object, function, false);\n}\n\n// See MethodResultCallback_5_2\ntemplate <typename R, typename T, typename P1, typename P2, typename P3,\n          typename P4, typename P5, typename A1, typename A2>\ninline ResultCallback2<R, A1, A2>* NewPermanentCallback(\n    T* object, R (T::*function)(P1, P2, P3, P4, P5, A1, A2),\n    typename internal::InternalConstRef<P1>::type p1,\n    typename internal::InternalConstRef<P2>::type p2,\n    typename internal::InternalConstRef<P3>::type p3,\n    typename internal::InternalConstRef<P4>::type p4,\n    typename internal::InternalConstRef<P5>::type p5) {\n  return new internal::MethodResultCallback_5_2<R, T, P1, P2, P3, P4, P5, A1,\n                                                A2>(object, function, false, p1,\n                                                    p2, p3, p4, p5);\n}\n\n// A function which does nothing.  Useful for creating no-op callbacks, e.g.:\n//   Closure* nothing = NewCallback(&DoNothing);\nvoid LIBPROTOBUF_EXPORT DoNothing();\n\n\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_CALLBACK_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/casts.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2014 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_CASTS_H__\n#define GOOGLE_PROTOBUF_CASTS_H__\n\n#include <type_traits>\n\n#include <google/protobuf/stubs/common.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n// Use implicit_cast as a safe version of static_cast or const_cast\n// for upcasting in the type hierarchy (i.e. casting a pointer to Foo\n// to a pointer to SuperclassOfFoo or casting a pointer to Foo to\n// a const pointer to Foo).\n// When you use implicit_cast, the compiler checks that the cast is safe.\n// Such explicit implicit_casts are necessary in surprisingly many\n// situations where C++ demands an exact type match instead of an\n// argument type convertable to a target type.\n//\n// The From type can be inferred, so the preferred syntax for using\n// implicit_cast is the same as for static_cast etc.:\n//\n//   implicit_cast<ToType>(expr)\n//\n// implicit_cast would have been part of the C++ standard library,\n// but the proposal was submitted too late.  It will probably make\n// its way into the language in the future.\ntemplate<typename To, typename From>\ninline To implicit_cast(From const &f) {\n  return f;\n}\n\n// When you upcast (that is, cast a pointer from type Foo to type\n// SuperclassOfFoo), it's fine to use implicit_cast<>, since upcasts\n// always succeed.  When you downcast (that is, cast a pointer from\n// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because\n// how do you know the pointer is really of type SubclassOfFoo?  It\n// could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,\n// when you downcast, you should use this macro.  In debug mode, we\n// use dynamic_cast<> to double-check the downcast is legal (we die\n// if it's not).  In normal mode, we do the efficient static_cast<>\n// instead.  Thus, it's important to test in debug mode to make sure\n// the cast is legal!\n//    This is the only place in the code we should use dynamic_cast<>.\n// In particular, you SHOULDN'T be using dynamic_cast<> in order to\n// do RTTI (eg code like this:\n//    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);\n//    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);\n// You should design the code some other way not to need this.\n\ntemplate<typename To, typename From>     // use like this: down_cast<T*>(foo);\ninline To down_cast(From* f) {                   // so we only accept pointers\n  // Ensures that To is a sub-type of From *.  This test is here only\n  // for compile-time type checking, and has no overhead in an\n  // optimized build at run-time, as it will be optimized away\n  // completely.\n  if (false) {\n    implicit_cast<From*, To>(0);\n  }\n\n#if !defined(NDEBUG) && !defined(GOOGLE_PROTOBUF_NO_RTTI)\n  assert(f == NULL || dynamic_cast<To>(f) != NULL);  // RTTI: debug mode only!\n#endif\n  return static_cast<To>(f);\n}\n\ntemplate<typename To, typename From>    // use like this: down_cast<T&>(foo);\ninline To down_cast(From& f) {\n  typedef typename std::remove_reference<To>::type* ToAsPointer;\n  // Ensures that To is a sub-type of From *.  This test is here only\n  // for compile-time type checking, and has no overhead in an\n  // optimized build at run-time, as it will be optimized away\n  // completely.\n  if (false) {\n    implicit_cast<From*, ToAsPointer>(0);\n  }\n\n#if !defined(NDEBUG) && !defined(GOOGLE_PROTOBUF_NO_RTTI)\n  // RTTI: debug mode only!\n  assert(dynamic_cast<ToAsPointer>(&f) != NULL);\n#endif\n  return *static_cast<ToAsPointer>(&f);\n}\n\ntemplate<typename To, typename From>\ninline To bit_cast(const From& from) {\n  GOOGLE_COMPILE_ASSERT(sizeof(From) == sizeof(To),\n                        bit_cast_with_different_sizes);\n  To dest;\n  memcpy(&dest, &from, sizeof(dest));\n  return dest;\n}\n\n}  // namespace internal\n\n// We made these internal so that they would show up as such in the docs,\n// but we don't want to stick \"internal::\" in front of them everywhere.\nusing internal::implicit_cast;\nusing internal::down_cast;\nusing internal::bit_cast;\n\n}  // namespace protobuf\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_CASTS_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/common.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda) and others\n//\n// Contains basic types and utilities used by the rest of the library.\n\n#ifndef GOOGLE_PROTOBUF_COMMON_H__\n#define GOOGLE_PROTOBUF_COMMON_H__\n\n#include <algorithm>\n#include <iostream>\n#include <map>\n#include <memory>\n#include <set>\n#include <string>\n#include <vector>\n\n#include <google/protobuf/stubs/port.h>\n#include <google/protobuf/stubs/macros.h>\n#include <google/protobuf/stubs/platform_macros.h>\n\n// TODO(liujisi): Remove the following includes after the include clean-up.\n#include <google/protobuf/stubs/logging.h>\n#include <google/protobuf/stubs/mutex.h>\n#include <google/protobuf/stubs/callback.h>\n\n#ifndef PROTOBUF_USE_EXCEPTIONS\n#if defined(_MSC_VER) && defined(_CPPUNWIND)\n  #define PROTOBUF_USE_EXCEPTIONS 1\n#elif defined(__EXCEPTIONS)\n  #define PROTOBUF_USE_EXCEPTIONS 1\n#else\n  #define PROTOBUF_USE_EXCEPTIONS 0\n#endif\n#endif\n\n#if PROTOBUF_USE_EXCEPTIONS\n#include <exception>\n#endif\n#if defined(__APPLE__)\n#include <TargetConditionals.h>  // for TARGET_OS_IPHONE\n#endif\n\n#if defined(__ANDROID__) || defined(GOOGLE_PROTOBUF_OS_ANDROID) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) || defined(GOOGLE_PROTOBUF_OS_IPHONE)\n#include <pthread.h>\n#endif\n\n#if defined(_WIN32) && defined(GetMessage)\n// Allow GetMessage to be used as a valid method name in protobuf classes.\n// windows.h defines GetMessage() as a macro.  Let's re-define it as an inline\n// function.  The inline function should be equivalent for C++ users.\ninline BOOL GetMessage_Win32(\n    LPMSG lpMsg, HWND hWnd,\n    UINT wMsgFilterMin, UINT wMsgFilterMax) {\n  return GetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);\n}\n#undef GetMessage\ninline BOOL GetMessage(\n    LPMSG lpMsg, HWND hWnd,\n    UINT wMsgFilterMin, UINT wMsgFilterMax) {\n  return GetMessage_Win32(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);\n}\n#endif\n\nnamespace std {}\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// Some of these constants are macros rather than const ints so that they can\n// be used in #if directives.\n\n// The current version, represented as a single integer to make comparison\n// easier:  major * 10^6 + minor * 10^3 + micro\n#define GOOGLE_PROTOBUF_VERSION 3006001\n\n// A suffix string for alpha, beta or rc releases. Empty for stable releases.\n#define GOOGLE_PROTOBUF_VERSION_SUFFIX \"\"\n\n// The minimum library version which works with the current version of the\n// headers.\n#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3006001\n\n// The minimum header version which works with the current version of\n// the library.  This constant should only be used by protoc's C++ code\n// generator.\nstatic const int kMinHeaderVersionForLibrary = 3006001;\n\n// The minimum protoc version which works with the current version of the\n// headers.\n#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3006001\n\n// The minimum header version which works with the current version of\n// protoc.  This constant should only be used in VerifyVersion().\nstatic const int kMinHeaderVersionForProtoc = 3006001;\n\n// Verifies that the headers and libraries are compatible.  Use the macro\n// below to call this.\nvoid LIBPROTOBUF_EXPORT VerifyVersion(int headerVersion, int minLibraryVersion,\n                                      const char* filename);\n\n// Converts a numeric version number to a string.\nstd::string LIBPROTOBUF_EXPORT VersionString(int version);\n\n}  // namespace internal\n\n// Place this macro in your main() function (or somewhere before you attempt\n// to use the protobuf library) to verify that the version you link against\n// matches the headers you compiled against.  If a version mismatch is\n// detected, the process will abort.\n#define GOOGLE_PROTOBUF_VERIFY_VERSION                                    \\\n  ::google::protobuf::internal::VerifyVersion(                            \\\n    GOOGLE_PROTOBUF_VERSION, GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION,         \\\n    __FILE__)\n\n\n// ===================================================================\n// from google3/util/utf8/public/unilib.h\n\nclass StringPiece;\nnamespace internal {\n\n// Checks if the buffer contains structurally-valid UTF-8.  Implemented in\n// structurally_valid.cc.\nLIBPROTOBUF_EXPORT bool IsStructurallyValidUTF8(const char* buf, int len);\n\ninline bool IsStructurallyValidUTF8(const std::string& str) {\n  return IsStructurallyValidUTF8(str.data(), static_cast<int>(str.length()));\n}\n\n// Returns initial number of bytes of structually valid UTF-8.\nLIBPROTOBUF_EXPORT int UTF8SpnStructurallyValid(const StringPiece& str);\n\n// Coerce UTF-8 byte string in src_str to be\n// a structurally-valid equal-length string by selectively\n// overwriting illegal bytes with replace_char (typically ' ' or '?').\n// replace_char must be legal printable 7-bit Ascii 0x20..0x7e.\n// src_str is read-only.\n//\n// Returns pointer to output buffer, src_str.data() if no changes were made,\n//  or idst if some bytes were changed. idst is allocated by the caller\n//  and must be at least as big as src_str\n//\n// Optimized for: all structurally valid and no byte copying is done.\n//\nLIBPROTOBUF_EXPORT char* UTF8CoerceToStructurallyValid(\n    const StringPiece& str, char* dst, char replace_char);\n\n}  // namespace internal\n\n\n// ===================================================================\n// Shutdown support.\n\n// Shut down the entire protocol buffers library, deleting all static-duration\n// objects allocated by the library or by generated .pb.cc files.\n//\n// There are two reasons you might want to call this:\n// * You use a draconian definition of \"memory leak\" in which you expect\n//   every single malloc() to have a corresponding free(), even for objects\n//   which live until program exit.\n// * You are writing a dynamically-loaded library which needs to clean up\n//   after itself when the library is unloaded.\n//\n// It is safe to call this multiple times.  However, it is not safe to use\n// any other part of the protocol buffers library after\n// ShutdownProtobufLibrary() has been called. Furthermore this call is not\n// thread safe, user needs to synchronize multiple calls.\nLIBPROTOBUF_EXPORT void ShutdownProtobufLibrary();\n\nnamespace internal {\n\n// Register a function to be called when ShutdownProtocolBuffers() is called.\nLIBPROTOBUF_EXPORT void OnShutdown(void (*func)());\n// Run an arbitrary function on an arg\nLIBPROTOBUF_EXPORT void OnShutdownRun(void (*f)(const void*), const void* arg);\n\ntemplate <typename T>\nT* OnShutdownDelete(T* p) {\n  OnShutdownRun([](const void* p) { delete static_cast<const T*>(p); }, p);\n  return p;\n}\n\n}  // namespace internal\n\n#if PROTOBUF_USE_EXCEPTIONS\nclass FatalException : public std::exception {\n public:\n  FatalException(const char* filename, int line, const std::string& message)\n      : filename_(filename), line_(line), message_(message) {}\n  virtual ~FatalException() throw();\n\n  virtual const char* what() const throw();\n\n  const char* filename() const { return filename_; }\n  int line() const { return line_; }\n  const std::string& message() const { return message_; }\n\n private:\n  const char* filename_;\n  const int line_;\n  const std::string message_;\n};\n#endif\n\n// This is at the end of the file instead of the beginning to work around a bug\n// in some versions of MSVC.\nusing std::string;\n\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_COMMON_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/fastmem.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2014 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Fast memory copying and comparison routines.\n//   strings::fastmemcmp_inlined() replaces memcmp()\n//   strings::memcpy_inlined() replaces memcpy()\n//   strings::memeq(a, b, n) replaces memcmp(a, b, n) == 0\n//\n// strings::*_inlined() routines are inline versions of the\n// routines exported by this module.  Sometimes using the inlined\n// versions is faster.  Measure before using the inlined versions.\n//\n// Performance measurement:\n//   strings::fastmemcmp_inlined\n//     Analysis: memcmp, fastmemcmp_inlined, fastmemcmp\n//     2012-01-30\n\n#ifndef GOOGLE_PROTOBUF_STUBS_FASTMEM_H_\n#define GOOGLE_PROTOBUF_STUBS_FASTMEM_H_\n\n#include <stddef.h>\n#include <stdio.h>\n#include <string.h>\n\n#include <google/protobuf/stubs/common.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// Return true if the n bytes at a equal the n bytes at b.\n// The regions are allowed to overlap.\n//\n// The performance is similar to the performance memcmp(), but faster for\n// moderately-sized inputs, or inputs that share a common prefix and differ\n// somewhere in their last 8 bytes. Further optimizations can be added later\n// if it makes sense to do so.:w\ninline bool memeq(const char* a, const char* b, size_t n) {\n  size_t n_rounded_down = n & ~static_cast<size_t>(7);\n  if (GOOGLE_PREDICT_FALSE(n_rounded_down == 0)) {  // n <= 7\n    return memcmp(a, b, n) == 0;\n  }\n  // n >= 8\n  uint64 u = GOOGLE_UNALIGNED_LOAD64(a) ^ GOOGLE_UNALIGNED_LOAD64(b);\n  uint64 v = GOOGLE_UNALIGNED_LOAD64(a + n - 8) ^ GOOGLE_UNALIGNED_LOAD64(b + n - 8);\n  if ((u | v) != 0) {  // The first or last 8 bytes differ.\n    return false;\n  }\n  a += 8;\n  b += 8;\n  n = n_rounded_down - 8;\n  if (n > 128) {\n    // As of 2012, memcmp on x86-64 uses a big unrolled loop with SSE2\n    // instructions, and while we could try to do something faster, it\n    // doesn't seem worth pursuing.\n    return memcmp(a, b, n) == 0;\n  }\n  for (; n >= 16; n -= 16) {\n    uint64 x = GOOGLE_UNALIGNED_LOAD64(a) ^ GOOGLE_UNALIGNED_LOAD64(b);\n    uint64 y = GOOGLE_UNALIGNED_LOAD64(a + 8) ^ GOOGLE_UNALIGNED_LOAD64(b + 8);\n    if ((x | y) != 0) {\n      return false;\n    }\n    a += 16;\n    b += 16;\n  }\n  // n must be 0 or 8 now because it was a multiple of 8 at the top of the loop.\n  return n == 0 || GOOGLE_UNALIGNED_LOAD64(a) == GOOGLE_UNALIGNED_LOAD64(b);\n}\n\ninline int fastmemcmp_inlined(const char *a, const char *b, size_t n) {\n  if (n >= 64) {\n    return memcmp(a, b, n);\n  }\n  const char* a_limit = a + n;\n  while (a + sizeof(uint64) <= a_limit &&\n         GOOGLE_UNALIGNED_LOAD64(a) == GOOGLE_UNALIGNED_LOAD64(b)) {\n    a += sizeof(uint64);\n    b += sizeof(uint64);\n  }\n  if (a + sizeof(uint32) <= a_limit &&\n      GOOGLE_UNALIGNED_LOAD32(a) == GOOGLE_UNALIGNED_LOAD32(b)) {\n    a += sizeof(uint32);\n    b += sizeof(uint32);\n  }\n  while (a < a_limit) {\n    int d =\n        static_cast<int>(static_cast<uint32>(*a++) - static_cast<uint32>(*b++));\n    if (d) return d;\n  }\n  return 0;\n}\n\n// The standard memcpy operation is slow for variable small sizes.\n// This implementation inlines the optimal realization for sizes 1 to 16.\n// To avoid code bloat don't use it in case of not performance-critical spots,\n// nor when you don't expect very frequent values of size <= 16.\ninline void memcpy_inlined(char *dst, const char *src, size_t size) {\n  // Compiler inlines code with minimal amount of data movement when third\n  // parameter of memcpy is a constant.\n  switch (size) {\n    case  1: memcpy(dst, src, 1); break;\n    case  2: memcpy(dst, src, 2); break;\n    case  3: memcpy(dst, src, 3); break;\n    case  4: memcpy(dst, src, 4); break;\n    case  5: memcpy(dst, src, 5); break;\n    case  6: memcpy(dst, src, 6); break;\n    case  7: memcpy(dst, src, 7); break;\n    case  8: memcpy(dst, src, 8); break;\n    case  9: memcpy(dst, src, 9); break;\n    case 10: memcpy(dst, src, 10); break;\n    case 11: memcpy(dst, src, 11); break;\n    case 12: memcpy(dst, src, 12); break;\n    case 13: memcpy(dst, src, 13); break;\n    case 14: memcpy(dst, src, 14); break;\n    case 15: memcpy(dst, src, 15); break;\n    case 16: memcpy(dst, src, 16); break;\n    default: memcpy(dst, src, size); break;\n  }\n}\n\n}  // namespace internal\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_FASTMEM_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/hash.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//\n// Deals with the fact that hash_map is not defined everywhere.\n\n#ifndef GOOGLE_PROTOBUF_STUBS_HASH_H__\n#define GOOGLE_PROTOBUF_STUBS_HASH_H__\n\n#include <string.h>\n#include <google/protobuf/stubs/common.h>\n\n#define GOOGLE_PROTOBUF_HAVE_HASH_MAP 1\n#define GOOGLE_PROTOBUF_HAVE_HASH_SET 1\n\n// Use C++11 unordered_{map|set} if available.\n#if ((defined(_LIBCPP_STD_VER) && _LIBCPP_STD_VER >= 11) || \\\n    (((__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X)) && \\\n    (__GLIBCXX__ > 20090421)))\n# define GOOGLE_PROTOBUF_HAS_CXX11_HASH\n\n// For XCode >= 4.6:  the compiler is clang with libc++.\n// For earlier XCode version: the compiler is gcc-4.2.1 with libstdc++.\n// libc++ provides <unordered_map> and friends even in non C++11 mode,\n// and it does not provide the tr1 library. Therefore the following macro\n// checks against this special case.\n// Note that we should not test the __APPLE_CC__ version number or the\n// __clang__ macro, since the new compiler can still use -stdlib=libstdc++, in\n// which case <unordered_map> is not compilable without -std=c++11\n#elif defined(__APPLE_CC__)\n# if __GNUC__ >= 4\n#  define GOOGLE_PROTOBUF_HAS_TR1\n# else\n// Not tested for gcc < 4... These setting can compile under 4.2.1 though.\n#  define GOOGLE_PROTOBUF_HASH_NAMESPACE __gnu_cxx\n#  include <ext/hash_map>\n#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map\n#  include <ext/hash_set>\n#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set\n# endif\n\n// Version checks for gcc.\n#elif defined(__GNUC__)\n// For GCC 4.x+, use tr1::unordered_map/set; otherwise, follow the\n// instructions from:\n// https://gcc.gnu.org/onlinedocs/libstdc++/manual/backwards.html\n# if __GNUC__ >= 4\n#  define GOOGLE_PROTOBUF_HAS_TR1\n# elif __GNUC__ >= 3\n#  include <backward/hash_map>\n#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map\n#  include <backward/hash_set>\n#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set\n#  if __GNUC__ == 3 && __GNUC_MINOR__ == 0\n#   define GOOGLE_PROTOBUF_HASH_NAMESPACE std       // GCC 3.0\n#  else\n#   define GOOGLE_PROTOBUF_HASH_NAMESPACE __gnu_cxx // GCC 3.1 and later\n#  endif\n# else\n#  define GOOGLE_PROTOBUF_HASH_NAMESPACE\n#  include <hash_map>\n#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map\n#  include <hash_set>\n#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set\n# endif\n\n// GCC <= 4.1 does not define std::tr1::hash for `long long int` or `long long unsigned int`\n# if __GNUC__ == 4 && defined(__GNUC_MINOR__) && __GNUC_MINOR__ <= 1\n#  undef GOOGLE_PROTOBUF_HAS_TR1\n#  undef GOOGLE_PROTOBUF_HAVE_HASH_MAP\n#  undef GOOGLE_PROTOBUF_HAVE_HASH_SET\n# endif\n\n// Version checks for MSC.\n// Apparently Microsoft decided to move hash_map *back* to the std namespace in\n// MSVC 2010:\n// http://blogs.msdn.com/vcblog/archive/2009/05/25/stl-breaking-changes-in-visual-studio-2010-beta-1.aspx\n// And.. they are moved back to stdext in MSVC 2013 (haven't checked 2012). That\n// said, use unordered_map for MSVC 2010 and beyond is our safest bet.\n#elif defined(_MSC_VER)\n# if _MSC_VER >= 1600  // Since Visual Studio 2010\n#  define GOOGLE_PROTOBUF_HAS_CXX11_HASH\n#  define GOOGLE_PROTOBUF_HASH_COMPARE std::hash_compare\n# elif _MSC_VER >= 1500  // Since Visual Studio 2008\n#  define GOOGLE_PROTOBUF_HASH_NAMESPACE stdext\n#  include <hash_map>\n#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map\n#  include <hash_set>\n#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set\n#  define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare\n#  define GOOGLE_PROTOBUF_CONTAINERS_NEED_HASH_COMPARE\n# elif _MSC_VER >= 1310\n#  define GOOGLE_PROTOBUF_HASH_NAMESPACE stdext\n#  include <hash_map>\n#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map\n#  include <hash_set>\n#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set\n#  define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare\n# else\n#  define GOOGLE_PROTOBUF_HASH_NAMESPACE std\n#  include <hash_map>\n#  define GOOGLE_PROTOBUF_HASH_MAP_CLASS hash_map\n#  include <hash_set>\n#  define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set\n#  define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare\n# endif\n\n// **ADD NEW COMPILERS SUPPORT HERE.**\n// For other compilers, undefine the macro and fallback to use std::map, in\n// google/protobuf/stubs/hash.h\n#else\n# undef GOOGLE_PROTOBUF_HAVE_HASH_MAP\n# undef GOOGLE_PROTOBUF_HAVE_HASH_SET\n#endif\n\n#if defined(GOOGLE_PROTOBUF_HAS_CXX11_HASH)\n# define GOOGLE_PROTOBUF_HASH_NAMESPACE std\n# include <unordered_map>\n# define GOOGLE_PROTOBUF_HASH_MAP_CLASS unordered_map\n# include <unordered_set>\n# define GOOGLE_PROTOBUF_HASH_SET_CLASS unordered_set\n#elif defined(GOOGLE_PROTOBUF_HAS_TR1)\n# define GOOGLE_PROTOBUF_HASH_NAMESPACE std::tr1\n# include <tr1/unordered_map>\n# define GOOGLE_PROTOBUF_HASH_MAP_CLASS unordered_map\n# include <tr1/unordered_set>\n# define GOOGLE_PROTOBUF_HASH_SET_CLASS unordered_set\n#endif\n\n# define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START \\\n  namespace google {                                      \\\n  namespace protobuf {\n# define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END }}\n\n#undef GOOGLE_PROTOBUF_HAS_CXX11_HASH\n#undef GOOGLE_PROTOBUF_HAS_TR1\n\n#if defined(GOOGLE_PROTOBUF_HAVE_HASH_MAP) && \\\n    defined(GOOGLE_PROTOBUF_HAVE_HASH_SET)\n#else\n#define GOOGLE_PROTOBUF_MISSING_HASH\n#include <map>\n#include <set>\n#endif\n\nnamespace google {\nnamespace protobuf {\n\n#ifdef GOOGLE_PROTOBUF_MISSING_HASH\n#undef GOOGLE_PROTOBUF_MISSING_HASH\n\n// This system doesn't have hash_map or hash_set.  Emulate them using map and\n// set.\n\n// Make hash<T> be the same as less<T>.  Note that everywhere where custom\n// hash functions are defined in the protobuf code, they are also defined such\n// that they can be used as \"less\" functions, which is required by MSVC anyway.\ntemplate <typename Key>\nstruct hash {\n  // Dummy, just to make derivative hash functions compile.\n  int operator()(const Key& key) {\n    GOOGLE_LOG(FATAL) << \"Should never be called.\";\n    return 0;\n  }\n\n  inline bool operator()(const Key& a, const Key& b) const {\n    return a < b;\n  }\n};\n\n// Make sure char* is compared by value.\ntemplate <>\nstruct hash<const char*> {\n  // Dummy, just to make derivative hash functions compile.\n  int operator()(const char* key) {\n    GOOGLE_LOG(FATAL) << \"Should never be called.\";\n    return 0;\n  }\n\n  inline bool operator()(const char* a, const char* b) const {\n    return strcmp(a, b) < 0;\n  }\n};\n\ntemplate <typename Key, typename Data,\n          typename HashFcn = hash<Key>,\n          typename EqualKey = std::equal_to<Key>,\n          typename Alloc = std::allocator< std::pair<const Key, Data> > >\nclass hash_map : public std::map<Key, Data, HashFcn, Alloc> {\n  typedef std::map<Key, Data, HashFcn, Alloc> BaseClass;\n\n public:\n  hash_map(int a = 0, const HashFcn& b = HashFcn(),\n           const EqualKey& c = EqualKey(),\n           const Alloc& d = Alloc()) : BaseClass(b, d) {}\n\n  HashFcn hash_function() const { return HashFcn(); }\n};\n\ntemplate <typename Key,\n          typename HashFcn = hash<Key>,\n          typename EqualKey = std::equal_to<Key> >\nclass hash_set : public std::set<Key, HashFcn> {\n public:\n  hash_set(int = 0) {}\n\n  HashFcn hash_function() const { return HashFcn(); }\n};\n\n#elif defined(_MSC_VER) && !defined(_STLPORT_VERSION) && \\\n    !(defined(_LIBCPP_STD_VER) && _LIBCPP_STD_VER >= 11)\n\ntemplate <typename Key>\nstruct hash : public GOOGLE_PROTOBUF_HASH_COMPARE<Key> {\n};\n\n// MSVC's hash_compare<const char*> hashes based on the string contents but\n// compares based on the string pointer.  WTF?\nclass CstringLess {\n public:\n  inline bool operator()(const char* a, const char* b) const {\n    return strcmp(a, b) < 0;\n  }\n};\n\ntemplate <>\nstruct hash<const char*>\n    : public GOOGLE_PROTOBUF_HASH_COMPARE<const char*, CstringLess> {};\n\n#ifdef GOOGLE_PROTOBUF_CONTAINERS_NEED_HASH_COMPARE\n\ntemplate <typename Key, typename HashFcn, typename EqualKey>\nstruct InternalHashCompare : public GOOGLE_PROTOBUF_HASH_COMPARE<Key> {\n  InternalHashCompare() {}\n  InternalHashCompare(HashFcn hashfcn, EqualKey equalkey)\n      : hashfcn_(hashfcn), equalkey_(equalkey) {}\n  size_t operator()(const Key& key) const { return hashfcn_(key); }\n  bool operator()(const Key& key1, const Key& key2) const {\n    return !equalkey_(key1, key2);\n  }\n  HashFcn hashfcn_;\n  EqualKey equalkey_;\n};\n\ntemplate <typename Key, typename Data,\n          typename HashFcn = hash<Key>,\n          typename EqualKey = std::equal_to<Key>,\n          typename Alloc = std::allocator< std::pair<const Key, Data> > >\nclass hash_map\n    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<\n          Key, Data, InternalHashCompare<Key, HashFcn, EqualKey>, Alloc> {\n  typedef GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<\n      Key, Data, InternalHashCompare<Key, HashFcn, EqualKey>, Alloc> BaseClass;\n\n public:\n  hash_map(int a = 0, const HashFcn& b = HashFcn(),\n           const EqualKey& c = EqualKey(), const Alloc& d = Alloc())\n      : BaseClass(InternalHashCompare<Key, HashFcn, EqualKey>(b, c), d) {}\n\n  HashFcn hash_function() const { return HashFcn(); }\n};\n\ntemplate <typename Key, typename HashFcn = hash<Key>,\n          typename EqualKey = std::equal_to<Key> >\nclass hash_set\n    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_SET_CLASS<\n          Key, InternalHashCompare<Key, HashFcn, EqualKey> > {\n public:\n  hash_set(int = 0) {}\n\n  HashFcn hash_function() const { return HashFcn(); }\n};\n\n#else  // GOOGLE_PROTOBUF_CONTAINERS_NEED_HASH_COMPARE\n\ntemplate <typename Key, typename Data,\n          typename HashFcn = hash<Key>,\n          typename EqualKey = std::equal_to<Key>,\n          typename Alloc = std::allocator< std::pair<const Key, Data> > >\nclass hash_map\n    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<\n          Key, Data, HashFcn, EqualKey, Alloc> {\n  typedef GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<\n      Key, Data, HashFcn, EqualKey, Alloc> BaseClass;\n\n public:\n  hash_map(int a = 0, const HashFcn& b = HashFcn(),\n           const EqualKey& c = EqualKey(),\n           const Alloc& d = Alloc()) : BaseClass(a, b, c, d) {}\n\n  HashFcn hash_function() const { return HashFcn(); }\n};\n\ntemplate <typename Key, typename HashFcn = hash<Key>,\n          typename EqualKey = std::equal_to<Key> >\nclass hash_set\n    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_SET_CLASS<\n          Key, HashFcn, EqualKey> {\n public:\n  hash_set(int = 0) {}\n\n  HashFcn hash_function() const { return HashFcn(); }\n};\n#endif  // GOOGLE_PROTOBUF_CONTAINERS_NEED_HASH_COMPARE\n\n#else  // defined(_MSC_VER) && !defined(_STLPORT_VERSION)\n\ntemplate <typename Key>\nstruct hash : public GOOGLE_PROTOBUF_HASH_NAMESPACE::hash<Key> {\n};\n\ntemplate <typename Key>\nstruct hash<const Key*> {\n  inline size_t operator()(const Key* key) const {\n    return reinterpret_cast<size_t>(key);\n  }\n};\n\n// Unlike the old SGI version, the TR1 \"hash\" does not special-case char*.  So,\n// we go ahead and provide our own implementation.\ntemplate <>\nstruct hash<const char*> {\n  inline size_t operator()(const char* str) const {\n    size_t result = 0;\n    for (; *str != '\\0'; str++) {\n      result = 5 * result + static_cast<size_t>(*str);\n    }\n    return result;\n  }\n};\n\ntemplate<>\nstruct hash<bool> {\n  size_t operator()(bool x) const {\n    return static_cast<size_t>(x);\n  }\n};\n\ntemplate <typename Key, typename Data,\n          typename HashFcn = hash<Key>,\n          typename EqualKey = std::equal_to<Key>,\n          typename Alloc = std::allocator< std::pair<const Key, Data> > >\nclass hash_map\n    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<\n          Key, Data, HashFcn, EqualKey, Alloc> {\n  typedef GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<\n      Key, Data, HashFcn, EqualKey, Alloc> BaseClass;\n\n public:\n  hash_map(int a = 0, const HashFcn& b = HashFcn(),\n           const EqualKey& c = EqualKey(),\n           const Alloc& d = Alloc()) : BaseClass(a, b, c, d) {}\n\n  HashFcn hash_function() const { return HashFcn(); }\n};\n\ntemplate <typename Key, typename HashFcn = hash<Key>,\n          typename EqualKey = std::equal_to<Key> >\nclass hash_set\n    : public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_SET_CLASS<\n          Key, HashFcn, EqualKey> {\n public:\n  hash_set(int = 0) {}\n\n  HashFcn hash_function() const { return HashFcn(); }\n};\n\n#endif  // !GOOGLE_PROTOBUF_MISSING_HASH\n\ntemplate <>\nstruct hash<string> {\n  inline size_t operator()(const string& key) const {\n    return hash<const char*>()(key.c_str());\n  }\n\n  static const size_t bucket_size = 4;\n  static const size_t min_buckets = 8;\n  inline bool operator()(const string& a, const string& b) const {\n    return a < b;\n  }\n};\n\ntemplate <typename First, typename Second>\nstruct hash<std::pair<First, Second> > {\n  inline size_t operator()(const std::pair<First, Second>& key) const {\n    size_t first_hash = hash<First>()(key.first);\n    size_t second_hash = hash<Second>()(key.second);\n\n    // FIXME(kenton):  What is the best way to compute this hash?  I have\n    // no idea!  This seems a bit better than an XOR.\n    return first_hash * ((1 << 16) - 1) + second_hash;\n  }\n\n  static const size_t bucket_size = 4;\n  static const size_t min_buckets = 8;\n  inline bool operator()(const std::pair<First, Second>& a,\n                           const std::pair<First, Second>& b) const {\n    return a < b;\n  }\n};\n\n// Used by GCC/SGI STL only.  (Why isn't this provided by the standard\n// library?  :( )\nstruct streq {\n  inline bool operator()(const char* a, const char* b) const {\n    return strcmp(a, b) == 0;\n  }\n};\n\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_HASH_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/logging.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_STUBS_LOGGING_H_\n#define GOOGLE_PROTOBUF_STUBS_LOGGING_H_\n\n#include <google/protobuf/stubs/macros.h>\n#include <google/protobuf/stubs/port.h>\n\n// ===================================================================\n// emulates google3/base/logging.h\n\nnamespace google {\nnamespace protobuf {\n\nenum LogLevel {\n  LOGLEVEL_INFO,     // Informational.  This is never actually used by\n                     // libprotobuf.\n  LOGLEVEL_WARNING,  // Warns about issues that, although not technically a\n                     // problem now, could cause problems in the future.  For\n                     // example, a // warning will be printed when parsing a\n                     // message that is near the message size limit.\n  LOGLEVEL_ERROR,    // An error occurred which should never happen during\n                     // normal use.\n  LOGLEVEL_FATAL,    // An error occurred from which the library cannot\n                     // recover.  This usually indicates a programming error\n                     // in the code which calls the library, especially when\n                     // compiled in debug mode.\n\n#ifdef NDEBUG\n  LOGLEVEL_DFATAL = LOGLEVEL_ERROR\n#else\n  LOGLEVEL_DFATAL = LOGLEVEL_FATAL\n#endif\n};\n\nclass StringPiece;\nnamespace util {\nclass Status;\n}\nclass uint128;\nnamespace internal {\n\nclass LogFinisher;\n\nclass LIBPROTOBUF_EXPORT LogMessage {\n public:\n  LogMessage(LogLevel level, const char* filename, int line);\n  ~LogMessage();\n\n  LogMessage& operator<<(const std::string& value);\n  LogMessage& operator<<(const char* value);\n  LogMessage& operator<<(char value);\n  LogMessage& operator<<(int value);\n  LogMessage& operator<<(uint value);\n  LogMessage& operator<<(long value);\n  LogMessage& operator<<(unsigned long value);\n  LogMessage& operator<<(long long value);\n  LogMessage& operator<<(unsigned long long value);\n  LogMessage& operator<<(double value);\n  LogMessage& operator<<(void* value);\n  LogMessage& operator<<(const StringPiece& value);\n  LogMessage& operator<<(const ::google::protobuf::util::Status& status);\n  LogMessage& operator<<(const uint128& value);\n\n private:\n  friend class LogFinisher;\n  void Finish();\n\n  LogLevel level_;\n  const char* filename_;\n  int line_;\n  std::string message_;\n};\n\n// Used to make the entire \"LOG(BLAH) << etc.\" expression have a void return\n// type and print a newline after each message.\nclass LIBPROTOBUF_EXPORT LogFinisher {\n public:\n  void operator=(LogMessage& other);\n};\n\ntemplate<typename T>\nbool IsOk(T status) { return status.ok(); }\ntemplate<>\ninline bool IsOk(bool status) { return status; }\n\n}  // namespace internal\n\n// Undef everything in case we're being mixed with some other Google library\n// which already defined them itself.  Presumably all Google libraries will\n// support the same syntax for these so it should not be a big deal if they\n// end up using our definitions instead.\n#undef GOOGLE_LOG\n#undef GOOGLE_LOG_IF\n\n#undef GOOGLE_CHECK\n#undef GOOGLE_CHECK_OK\n#undef GOOGLE_CHECK_EQ\n#undef GOOGLE_CHECK_NE\n#undef GOOGLE_CHECK_LT\n#undef GOOGLE_CHECK_LE\n#undef GOOGLE_CHECK_GT\n#undef GOOGLE_CHECK_GE\n#undef GOOGLE_CHECK_NOTNULL\n\n#undef GOOGLE_DLOG\n#undef GOOGLE_DCHECK\n#undef GOOGLE_DCHECK_OK\n#undef GOOGLE_DCHECK_EQ\n#undef GOOGLE_DCHECK_NE\n#undef GOOGLE_DCHECK_LT\n#undef GOOGLE_DCHECK_LE\n#undef GOOGLE_DCHECK_GT\n#undef GOOGLE_DCHECK_GE\n\n#define GOOGLE_LOG(LEVEL)                                                 \\\n  ::google::protobuf::internal::LogFinisher() =                           \\\n    ::google::protobuf::internal::LogMessage(                             \\\n      ::google::protobuf::LOGLEVEL_##LEVEL, __FILE__, __LINE__)\n#define GOOGLE_LOG_IF(LEVEL, CONDITION) \\\n  !(CONDITION) ? (void)0 : GOOGLE_LOG(LEVEL)\n\n#define GOOGLE_CHECK(EXPRESSION) \\\n  GOOGLE_LOG_IF(FATAL, !(EXPRESSION)) << \"CHECK failed: \" #EXPRESSION \": \"\n#define GOOGLE_CHECK_OK(A) GOOGLE_CHECK(::google::protobuf::internal::IsOk(A))\n#define GOOGLE_CHECK_EQ(A, B) GOOGLE_CHECK((A) == (B))\n#define GOOGLE_CHECK_NE(A, B) GOOGLE_CHECK((A) != (B))\n#define GOOGLE_CHECK_LT(A, B) GOOGLE_CHECK((A) <  (B))\n#define GOOGLE_CHECK_LE(A, B) GOOGLE_CHECK((A) <= (B))\n#define GOOGLE_CHECK_GT(A, B) GOOGLE_CHECK((A) >  (B))\n#define GOOGLE_CHECK_GE(A, B) GOOGLE_CHECK((A) >= (B))\n\nnamespace internal {\ntemplate<typename T>\nT* CheckNotNull(const char* /* file */, int /* line */,\n                const char* name, T* val) {\n  if (val == NULL) {\n    GOOGLE_LOG(FATAL) << name;\n  }\n  return val;\n}\n}  // namespace internal\n#define GOOGLE_CHECK_NOTNULL(A) \\\n  ::google::protobuf::internal::CheckNotNull(\\\n      __FILE__, __LINE__, \"'\" #A \"' must not be NULL\", (A))\n\n#ifdef NDEBUG\n\n#define GOOGLE_DLOG(LEVEL) GOOGLE_LOG_IF(LEVEL, false)\n\n#define GOOGLE_DCHECK(EXPRESSION) while(false) GOOGLE_CHECK(EXPRESSION)\n#define GOOGLE_DCHECK_OK(E) GOOGLE_DCHECK(::google::protobuf::internal::IsOk(E))\n#define GOOGLE_DCHECK_EQ(A, B) GOOGLE_DCHECK((A) == (B))\n#define GOOGLE_DCHECK_NE(A, B) GOOGLE_DCHECK((A) != (B))\n#define GOOGLE_DCHECK_LT(A, B) GOOGLE_DCHECK((A) <  (B))\n#define GOOGLE_DCHECK_LE(A, B) GOOGLE_DCHECK((A) <= (B))\n#define GOOGLE_DCHECK_GT(A, B) GOOGLE_DCHECK((A) >  (B))\n#define GOOGLE_DCHECK_GE(A, B) GOOGLE_DCHECK((A) >= (B))\n\n#else  // NDEBUG\n\n#define GOOGLE_DLOG GOOGLE_LOG\n\n#define GOOGLE_DCHECK    GOOGLE_CHECK\n#define GOOGLE_DCHECK_OK GOOGLE_CHECK_OK\n#define GOOGLE_DCHECK_EQ GOOGLE_CHECK_EQ\n#define GOOGLE_DCHECK_NE GOOGLE_CHECK_NE\n#define GOOGLE_DCHECK_LT GOOGLE_CHECK_LT\n#define GOOGLE_DCHECK_LE GOOGLE_CHECK_LE\n#define GOOGLE_DCHECK_GT GOOGLE_CHECK_GT\n#define GOOGLE_DCHECK_GE GOOGLE_CHECK_GE\n\n#endif  // !NDEBUG\n\ntypedef void LogHandler(LogLevel level, const char* filename, int line,\n                        const std::string& message);\n\n// The protobuf library sometimes writes warning and error messages to\n// stderr.  These messages are primarily useful for developers, but may\n// also help end users figure out a problem.  If you would prefer that\n// these messages be sent somewhere other than stderr, call SetLogHandler()\n// to set your own handler.  This returns the old handler.  Set the handler\n// to NULL to ignore log messages (but see also LogSilencer, below).\n//\n// Obviously, SetLogHandler is not thread-safe.  You should only call it\n// at initialization time, and probably not from library code.  If you\n// simply want to suppress log messages temporarily (e.g. because you\n// have some code that tends to trigger them frequently and you know\n// the warnings are not important to you), use the LogSilencer class\n// below.\nLIBPROTOBUF_EXPORT LogHandler* SetLogHandler(LogHandler* new_func);\n\n// Create a LogSilencer if you want to temporarily suppress all log\n// messages.  As long as any LogSilencer objects exist, non-fatal\n// log messages will be discarded (the current LogHandler will *not*\n// be called).  Constructing a LogSilencer is thread-safe.  You may\n// accidentally suppress log messages occurring in another thread, but\n// since messages are generally for debugging purposes only, this isn't\n// a big deal.  If you want to intercept log messages, use SetLogHandler().\nclass LIBPROTOBUF_EXPORT LogSilencer {\n public:\n  LogSilencer();\n  ~LogSilencer();\n};\n\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_LOGGING_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/macros.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_MACROS_H__\n#define GOOGLE_PROTOBUF_MACROS_H__\n\n#include <google/protobuf/stubs/port.h>\n\nnamespace google {\nnamespace protobuf {\n\n#undef GOOGLE_DISALLOW_EVIL_CONSTRUCTORS\n#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)    \\\n  TypeName(const TypeName&);                           \\\n  void operator=(const TypeName&)\n\n#undef GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS\n#define GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \\\n  TypeName();                                           \\\n  TypeName(const TypeName&);                            \\\n  void operator=(const TypeName&)\n\n// ===================================================================\n// from google3/base/basictypes.h\n\n// The GOOGLE_ARRAYSIZE(arr) macro returns the # of elements in an array arr.\n// The expression is a compile-time constant, and therefore can be\n// used in defining new arrays, for example.\n//\n// GOOGLE_ARRAYSIZE catches a few type errors.  If you see a compiler error\n//\n//   \"warning: division by zero in ...\"\n//\n// when using GOOGLE_ARRAYSIZE, you are (wrongfully) giving it a pointer.\n// You should only use GOOGLE_ARRAYSIZE on statically allocated arrays.\n//\n// The following comments are on the implementation details, and can\n// be ignored by the users.\n//\n// ARRAYSIZE(arr) works by inspecting sizeof(arr) (the # of bytes in\n// the array) and sizeof(*(arr)) (the # of bytes in one array\n// element).  If the former is divisible by the latter, perhaps arr is\n// indeed an array, in which case the division result is the # of\n// elements in the array.  Otherwise, arr cannot possibly be an array,\n// and we generate a compiler error to prevent the code from\n// compiling.\n//\n// Since the size of bool is implementation-defined, we need to cast\n// !(sizeof(a) & sizeof(*(a))) to size_t in order to ensure the final\n// result has type size_t.\n//\n// This macro is not perfect as it wrongfully accepts certain\n// pointers, namely where the pointer size is divisible by the pointee\n// size.  Since all our code has to go through a 32-bit compiler,\n// where a pointer is 4 bytes, this means all pointers to a type whose\n// size is 3 or greater than 4 will be (righteously) rejected.\n//\n// Kudos to Jorg Brown for this simple and elegant implementation.\n\n#undef GOOGLE_ARRAYSIZE\n#define GOOGLE_ARRAYSIZE(a) \\\n  ((sizeof(a) / sizeof(*(a))) / \\\n   static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))\n\n// The COMPILE_ASSERT macro can be used to verify that a compile time\n// expression is true. For example, you could use it to verify the\n// size of a static array:\n//\n//   COMPILE_ASSERT(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,\n//                  content_type_names_incorrect_size);\n//\n// or to make sure a struct is smaller than a certain size:\n//\n//   COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large);\n//\n// The second argument to the macro is the name of the variable. If\n// the expression is false, most compilers will issue a warning/error\n// containing the name of the variable.\n\nnamespace internal {\n\ntemplate <bool>\nstruct CompileAssert {\n};\n\n}  // namespace internal\n\n#undef GOOGLE_COMPILE_ASSERT\n#if __cplusplus >= 201103L\n#define GOOGLE_COMPILE_ASSERT(expr, msg) static_assert(expr, #msg)\n#else\n#define GOOGLE_COMPILE_ASSERT(expr, msg) \\\n  ::google::protobuf::internal::CompileAssert<(bool(expr))> \\\n          msg[bool(expr) ? 1 : -1]; \\\n  (void)msg\n// Implementation details of COMPILE_ASSERT:\n//\n// - COMPILE_ASSERT works by defining an array type that has -1\n//   elements (and thus is invalid) when the expression is false.\n//\n// - The simpler definition\n//\n//     #define COMPILE_ASSERT(expr, msg) typedef char msg[(expr) ? 1 : -1]\n//\n//   does not work, as gcc supports variable-length arrays whose sizes\n//   are determined at run-time (this is gcc's extension and not part\n//   of the C++ standard).  As a result, gcc fails to reject the\n//   following code with the simple definition:\n//\n//     int foo;\n//     COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is\n//                               // not a compile-time constant.\n//\n// - By using the type CompileAssert<(bool(expr))>, we ensures that\n//   expr is a compile-time constant.  (Template arguments must be\n//   determined at compile-time.)\n//\n// - The outter parentheses in CompileAssert<(bool(expr))> are necessary\n//   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written\n//\n//     CompileAssert<bool(expr)>\n//\n//   instead, these compilers will refuse to compile\n//\n//     COMPILE_ASSERT(5 > 0, some_message);\n//\n//   (They seem to think the \">\" in \"5 > 0\" marks the end of the\n//   template argument list.)\n//\n// - The array size is (bool(expr) ? 1 : -1), instead of simply\n//\n//     ((expr) ? 1 : -1).\n//\n//   This is to avoid running into a bug in MS VC 7.1, which\n//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.\n#endif  // __cplusplus >= 201103L\n\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_MACROS_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/mutex.h",
    "content": "// Copyright (c) 2006, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_STUBS_MUTEX_H_\n#define GOOGLE_PROTOBUF_STUBS_MUTEX_H_\n\n#include <mutex>\n\n#include <google/protobuf/stubs/macros.h>\n\n// ===================================================================\n// emulates google3/base/mutex.h\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n#define GOOGLE_PROTOBUF_LINKER_INITIALIZED\n\n// Mutex is a natural type to wrap. As both google and other organization have\n// specialized mutexes. gRPC also provides an injection mechanism for custom\n// mutexes.\nclass LIBPROTOBUF_EXPORT WrappedMutex {\n public:\n  WrappedMutex() = default;\n  void Lock() { mu_.lock(); }\n  void Unlock() { mu_.unlock(); }\n  // Crash if this Mutex is not held exclusively by this thread.\n  // May fail to crash when it should; will never crash when it should not.\n  void AssertHeld() const {}\n\n private:\n  std::mutex mu_;\n};\n\nusing Mutex = WrappedMutex;\n\n// MutexLock(mu) acquires mu when constructed and releases it when destroyed.\nclass LIBPROTOBUF_EXPORT MutexLock {\n public:\n  explicit MutexLock(Mutex *mu) : mu_(mu) { this->mu_->Lock(); }\n  ~MutexLock() { this->mu_->Unlock(); }\n private:\n  Mutex *const mu_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MutexLock);\n};\n\n// TODO(kenton):  Implement these?  Hard to implement portably.\ntypedef MutexLock ReaderMutexLock;\ntypedef MutexLock WriterMutexLock;\n\n// MutexLockMaybe is like MutexLock, but is a no-op when mu is NULL.\nclass LIBPROTOBUF_EXPORT MutexLockMaybe {\n public:\n  explicit MutexLockMaybe(Mutex *mu) :\n    mu_(mu) { if (this->mu_ != NULL) { this->mu_->Lock(); } }\n  ~MutexLockMaybe() { if (this->mu_ != NULL) { this->mu_->Unlock(); } }\n private:\n  Mutex *const mu_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MutexLockMaybe);\n};\n\n#if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL)\ntemplate<typename T>\nclass ThreadLocalStorage {\n public:\n  ThreadLocalStorage() {\n    pthread_key_create(&key_, &ThreadLocalStorage::Delete);\n  }\n  ~ThreadLocalStorage() {\n    pthread_key_delete(key_);\n  }\n  T* Get() {\n    T* result = static_cast<T*>(pthread_getspecific(key_));\n    if (result == NULL) {\n      result = new T();\n      pthread_setspecific(key_, result);\n    }\n    return result;\n  }\n private:\n  static void Delete(void* value) {\n    delete static_cast<T*>(value);\n  }\n  pthread_key_t key_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ThreadLocalStorage);\n};\n#endif\n\n}  // namespace internal\n\n// We made these internal so that they would show up as such in the docs,\n// but we don't want to stick \"internal::\" in front of them everywhere.\nusing internal::Mutex;\nusing internal::MutexLock;\nusing internal::ReaderMutexLock;\nusing internal::WriterMutexLock;\nusing internal::MutexLockMaybe;\n\n\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_MUTEX_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/once.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//\n// emulates google3/base/once.h\n//\n// This header is intended to be included only by internal .cc files and\n// generated .pb.cc files.  Users should not use this directly.\n//\n// This is basically a portable version of pthread_once().\n//\n// This header declares:\n// * A type called ProtobufOnceType.\n// * A macro GOOGLE_PROTOBUF_DECLARE_ONCE() which declares a variable of type\n//   ProtobufOnceType.  This is the only legal way to declare such a variable.\n//   The macro may only be used at the global scope (you cannot create local or\n//   class member variables of this type).\n// * A function GoogleOnceInit(ProtobufOnceType* once, void (*init_func)()).\n//   This function, when invoked multiple times given the same ProtobufOnceType\n//   object, will invoke init_func on the first call only, and will make sure\n//   none of the calls return before that first call to init_func has finished.\n// * The user can provide a parameter which GoogleOnceInit() forwards to the\n//   user-provided function when it is called. Usage example:\n//     int a = 10;\n//     GoogleOnceInit(&my_once, &MyFunctionExpectingIntArgument, &a);\n// * This implementation guarantees that ProtobufOnceType is a POD (i.e. no\n//   static initializer generated).\n//\n// This implements a way to perform lazy initialization.  It's more efficient\n// than using mutexes as no lock is needed if initialization has already\n// happened.\n//\n// Example usage:\n//   void Init();\n//   GOOGLE_PROTOBUF_DECLARE_ONCE(once_init);\n//\n//   // Calls Init() exactly once.\n//   void InitOnce() {\n//     GoogleOnceInit(&once_init, &Init);\n//   }\n//\n// Note that if GoogleOnceInit() is called before main() has begun, it must\n// only be called by the thread that will eventually call main() -- that is,\n// the thread that performs dynamic initialization.  In general this is a safe\n// assumption since people don't usually construct threads before main() starts,\n// but it is technically not guaranteed.  Unfortunately, Win32 provides no way\n// whatsoever to statically-initialize its synchronization primitives, so our\n// only choice is to assume that dynamic initialization is single-threaded.\n\n#ifndef GOOGLE_PROTOBUF_STUBS_ONCE_H__\n#define GOOGLE_PROTOBUF_STUBS_ONCE_H__\n\n#include <mutex>\n#include <utility>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\nusing once_flag = std::once_flag;\ntemplate <typename... Args>\nvoid call_once(Args&&... args ) {\n  std::call_once(std::forward<Args>(args)...);\n}\n\n}  // namespace internal\n\n// TODO(gerbens) remove this once third_party is fully extracted\nusing ProtobufOnceType = internal::once_flag;\n\ninline void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)()) {\n  std::call_once(*once, init_func);\n}\n\ntemplate <typename Arg>\ninline void GoogleOnceInitArg(ProtobufOnceType* once, void (*init_func)(Arg*),\n                              Arg* arg) {\n  std::call_once(*once, init_func, arg);\n}\n\nclass GoogleOnceDynamic {\n public:\n  // If this->Init() has not been called before by any thread,\n  // execute (*func_with_arg)(arg) then return.\n  // Otherwise, wait until that prior invocation has finished\n  // executing its function, then return.\n  template<typename T>\n  void Init(void (*func_with_arg)(T*), T* arg) {\n    GoogleOnceInitArg<T>(&this->state_, func_with_arg, arg);\n  }\n private:\n  ProtobufOnceType state_;\n};\n\n#define GOOGLE_PROTOBUF_ONCE_TYPE ::google::protobuf::ProtobufOnceType\n#define GOOGLE_PROTOBUF_DECLARE_ONCE(NAME) \\\n  ::google::protobuf::ProtobufOnceType NAME\n\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_ONCE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/platform_macros.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2012 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_PLATFORM_MACROS_H_\n#define GOOGLE_PROTOBUF_PLATFORM_MACROS_H_\n\n#define GOOGLE_PROTOBUF_PLATFORM_ERROR \\\n#error \"Host platform was not detected as supported by protobuf\"\n\n// Processor architecture detection.  For more info on what's defined, see:\n//   http://msdn.microsoft.com/en-us/library/b0084kay.aspx\n//   http://www.agner.org/optimize/calling_conventions.pdf\n//   or with gcc, run: \"echo | gcc -E -dM -\"\n#if defined(_M_X64) || defined(__x86_64__)\n#define GOOGLE_PROTOBUF_ARCH_X64 1\n#define GOOGLE_PROTOBUF_ARCH_64_BIT 1\n#elif defined(_M_IX86) || defined(__i386__)\n#define GOOGLE_PROTOBUF_ARCH_IA32 1\n#define GOOGLE_PROTOBUF_ARCH_32_BIT 1\n#elif defined(__QNX__)\n#define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1\n#define GOOGLE_PROTOBUF_ARCH_32_BIT 1\n#elif defined(_M_ARM) || defined(__ARMEL__)\n#define GOOGLE_PROTOBUF_ARCH_ARM 1\n#define GOOGLE_PROTOBUF_ARCH_32_BIT 1\n#elif defined(_M_ARM64)\n#define GOOGLE_PROTOBUF_ARCH_ARM 1\n#define GOOGLE_PROTOBUF_ARCH_64_BIT 1\n#elif defined(__aarch64__)\n#define GOOGLE_PROTOBUF_ARCH_AARCH64 1\n#define GOOGLE_PROTOBUF_ARCH_64_BIT 1\n#elif defined(__MIPSEL__)\n#if defined(__LP64__)\n#define GOOGLE_PROTOBUF_ARCH_MIPS64 1\n#define GOOGLE_PROTOBUF_ARCH_64_BIT 1\n#else\n#define GOOGLE_PROTOBUF_ARCH_MIPS 1\n#define GOOGLE_PROTOBUF_ARCH_32_BIT 1\n#endif\n#elif defined(__pnacl__)\n#define GOOGLE_PROTOBUF_ARCH_32_BIT 1\n#elif defined(sparc)\n#define GOOGLE_PROTOBUF_ARCH_SPARC 1\n#if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)\n#define GOOGLE_PROTOBUF_ARCH_64_BIT 1\n#else\n#define GOOGLE_PROTOBUF_ARCH_32_BIT 1\n#endif\n#elif defined(_POWER) || defined(__powerpc64__) || defined(__PPC64__)\n#define GOOGLE_PROTOBUF_ARCH_POWER 1\n#define GOOGLE_PROTOBUF_ARCH_64_BIT 1\n#elif defined(__PPC__)\n#define GOOGLE_PROTOBUF_ARCH_PPC 1\n#define GOOGLE_PROTOBUF_ARCH_32_BIT 1\n#elif defined(__GNUC__)\n# if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4))\n// We fallback to the generic Clang/GCC >= 4.7 implementation in atomicops.h\n# elif defined(__clang__)\n#  if !__has_extension(c_atomic)\nGOOGLE_PROTOBUF_PLATFORM_ERROR\n#  endif\n// We fallback to the generic Clang/GCC >= 4.7 implementation in atomicops.h\n# endif\n# if __LP64__\n#  define GOOGLE_PROTOBUF_ARCH_64_BIT 1\n# else\n#  define GOOGLE_PROTOBUF_ARCH_32_BIT 1\n# endif\n#else\nGOOGLE_PROTOBUF_PLATFORM_ERROR\n#endif\n\n#if defined(__APPLE__)\n#define GOOGLE_PROTOBUF_OS_APPLE\n#include <TargetConditionals.h>\n#if TARGET_OS_IPHONE\n#define GOOGLE_PROTOBUF_OS_IPHONE\n#endif\n#elif defined(__EMSCRIPTEN__)\n#define GOOGLE_PROTOBUF_OS_EMSCRIPTEN\n#elif defined(__native_client__)\n#define GOOGLE_PROTOBUF_OS_NACL\n#elif defined(sun)\n#define GOOGLE_PROTOBUF_OS_SOLARIS\n#elif defined(_AIX)\n#define GOOGLE_PROTOBUF_OS_AIX\n#elif defined(__ANDROID__)\n#define GOOGLE_PROTOBUF_OS_ANDROID\n#endif\n\n#undef GOOGLE_PROTOBUF_PLATFORM_ERROR\n\n#if defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE) || defined(__OpenBSD__)\n// Android ndk does not support the __thread keyword very well yet. Here\n// we use pthread_key_create()/pthread_getspecific()/... methods for\n// TLS support on android.\n// iOS and OpenBSD also do not support the __thread keyword.\n#define GOOGLE_PROTOBUF_NO_THREADLOCAL\n#endif\n\n#endif  // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/port.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#ifndef GOOGLE_PROTOBUF_STUBS_PORT_H_\n#define GOOGLE_PROTOBUF_STUBS_PORT_H_\n\n#include <assert.h>\n#include <stdlib.h>\n#include <cstddef>\n#include <string>\n#include <string.h>\n#if defined(__osf__)\n// Tru64 lacks stdint.h, but has inttypes.h which defines a superset of\n// what stdint.h would define.\n#include <inttypes.h>\n#elif !defined(_MSC_VER)\n#include <stdint.h>\n#endif\n\n#include <google/protobuf/stubs/platform_macros.h>\n\n#undef PROTOBUF_LITTLE_ENDIAN\n#ifdef _WIN32\n  // Assuming windows is always little-endian.\n  // TODO(xiaofeng): The PROTOBUF_LITTLE_ENDIAN is not only used for\n  // optimization but also for correctness. We should define an\n  // different macro to test the big-endian code path in coded_stream.\n  #if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)\n    #define PROTOBUF_LITTLE_ENDIAN 1\n  #endif\n  #if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)\n    // If MSVC has \"/RTCc\" set, it will complain about truncating casts at\n    // runtime.  This file contains some intentional truncating casts.\n    #pragma runtime_checks(\"c\", off)\n  #endif\n#else\n  #include <sys/param.h>   // __BYTE_ORDER\n  #if defined(__OpenBSD__)\n    #include <endian.h>\n  #endif\n  #if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \\\n         (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || \\\n         (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN)) && \\\n      !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)\n    #define PROTOBUF_LITTLE_ENDIAN 1\n  #endif\n#endif\n#if defined(_MSC_VER) && defined(PROTOBUF_USE_DLLS)\n  #ifdef LIBPROTOBUF_EXPORTS\n    #define LIBPROTOBUF_EXPORT __declspec(dllexport)\n  #else\n    #define LIBPROTOBUF_EXPORT __declspec(dllimport)\n  #endif\n  #ifdef LIBPROTOC_EXPORTS\n    #define LIBPROTOC_EXPORT   __declspec(dllexport)\n  #else\n    #define LIBPROTOC_EXPORT   __declspec(dllimport)\n  #endif\n#else\n  #define LIBPROTOBUF_EXPORT\n  #define LIBPROTOC_EXPORT\n#endif\n\n// These #includes are for the byte swap functions declared later on.\n#ifdef _MSC_VER\n#include <stdlib.h>  // NOLINT(build/include)\n#include <intrin.h>\n#elif defined(__APPLE__)\n#include <libkern/OSByteOrder.h>\n#elif defined(__GLIBC__) || defined(__BIONIC__) || defined(__CYGWIN__)\n#include <byteswap.h>  // IWYU pragma: export\n#endif\n\n#define PROTOBUF_RUNTIME_DEPRECATED(message)\n\n// ===================================================================\n// from google3/base/port.h\n\n#if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L || \\\n     (defined(_MSC_VER) && _MSC_VER >= 1900))\n// Define this to 1 if the code is compiled in C++11 mode; leave it\n// undefined otherwise.  Do NOT define it to 0 -- that causes\n// '#ifdef LANG_CXX11' to behave differently from '#if LANG_CXX11'.\n#define LANG_CXX11 1\n#endif\n\n#if LANG_CXX11 && !defined(__NVCC__)\n#define PROTOBUF_CXX11 1\n#else\n#define PROTOBUF_CXX11 0\n#endif\n\n#if PROTOBUF_CXX11\n#define PROTOBUF_FINAL final\n#else\n#define PROTOBUF_FINAL\n#endif\n\nnamespace google {\nnamespace protobuf {\n\ntypedef unsigned int uint;\n\n#ifdef _MSC_VER\ntypedef signed __int8  int8;\ntypedef __int16 int16;\ntypedef __int32 int32;\ntypedef __int64 int64;\n\ntypedef unsigned __int8  uint8;\ntypedef unsigned __int16 uint16;\ntypedef unsigned __int32 uint32;\ntypedef unsigned __int64 uint64;\n#else\ntypedef int8_t int8;\ntypedef int16_t int16;\ntypedef int32_t int32;\ntypedef int64_t int64;\n\ntypedef uint8_t uint8;\ntypedef uint16_t uint16;\ntypedef uint32_t uint32;\ntypedef uint64_t uint64;\n#endif\n\n// long long macros to be used because gcc and vc++ use different suffixes,\n// and different size specifiers in format strings\n#undef GOOGLE_LONGLONG\n#undef GOOGLE_ULONGLONG\n#undef GOOGLE_LL_FORMAT\n\n#ifdef _MSC_VER\n#define GOOGLE_LONGLONG(x) x##I64\n#define GOOGLE_ULONGLONG(x) x##UI64\n#define GOOGLE_LL_FORMAT \"I64\"  // As in printf(\"%I64d\", ...)\n#else\n// By long long, we actually mean int64.\n#define GOOGLE_LONGLONG(x) x##LL\n#define GOOGLE_ULONGLONG(x) x##ULL\n// Used to format real long long integers.\n#define GOOGLE_LL_FORMAT \"ll\"  // As in \"%lld\". Note that \"q\" is poor form also.\n#endif\n\nstatic const int32 kint32max = 0x7FFFFFFF;\nstatic const int32 kint32min = -kint32max - 1;\nstatic const int64 kint64max = GOOGLE_LONGLONG(0x7FFFFFFFFFFFFFFF);\nstatic const int64 kint64min = -kint64max - 1;\nstatic const uint32 kuint32max = 0xFFFFFFFFu;\nstatic const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF);\n\n// -------------------------------------------------------------------\n// Annotations:  Some parts of the code have been annotated in ways that might\n//   be useful to some compilers or tools, but are not supported universally.\n//   You can #define these annotations yourself if the default implementation\n//   is not right for you.\n\n#ifndef GOOGLE_ATTRIBUTE_ALWAYS_INLINE\n#if defined(__GNUC__) && (__GNUC__ > 3 ||(__GNUC__ == 3 && __GNUC_MINOR__ >= 1))\n// For functions we want to force inline.\n// Introduced in gcc 3.1.\n#define GOOGLE_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((always_inline))\n#else\n// Other compilers will have to figure it out for themselves.\n#define GOOGLE_ATTRIBUTE_ALWAYS_INLINE\n#endif\n#endif\n\n#define GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE GOOGLE_ATTRIBUTE_ALWAYS_INLINE\n\n#ifndef GOOGLE_ATTRIBUTE_NOINLINE\n#if defined(__GNUC__) && (__GNUC__ > 3 ||(__GNUC__ == 3 && __GNUC_MINOR__ >= 1))\n// For functions we want to force not inline.\n// Introduced in gcc 3.1.\n#define GOOGLE_ATTRIBUTE_NOINLINE __attribute__ ((noinline))\n#elif defined(_MSC_VER) && (_MSC_VER >= 1400)\n// Seems to have been around since at least Visual Studio 2005\n#define GOOGLE_ATTRIBUTE_NOINLINE __declspec(noinline)\n#else\n// Other compilers will have to figure it out for themselves.\n#define GOOGLE_ATTRIBUTE_NOINLINE\n#endif\n#endif\n\n#define GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE GOOGLE_ATTRIBUTE_NOINLINE\n\n#ifndef GOOGLE_ATTRIBUTE_FUNC_ALIGN\n#if defined(__clang__) || \\\n    defined(__GNUC__) && (__GNUC__ > 4 ||(__GNUC__ == 4 && __GNUC_MINOR__ >= 3))\n// Function alignment attribute introduced in gcc 4.3\n#define GOOGLE_ATTRIBUTE_FUNC_ALIGN(bytes) __attribute__ ((aligned(bytes)))\n#else\n#define GOOGLE_ATTRIBUTE_FUNC_ALIGN(bytes)\n#endif\n#endif\n\n#define GOOGLE_PROTOBUF_ATTRIBUTE_FUNC_ALIGN(bytes) \\\n        GOOGLE_ATTRIBUTE_FUNC_ALIGN(bytes)\n\n#ifndef GOOGLE_PREDICT_TRUE\n#ifdef __GNUC__\n// Provided at least since GCC 3.0.\n#define GOOGLE_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))\n#else\n#define GOOGLE_PREDICT_TRUE(x) (x)\n#endif\n#endif\n\n#ifndef GOOGLE_PREDICT_FALSE\n#ifdef __GNUC__\n// Provided at least since GCC 3.0.\n#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(x, 0))\n#else\n#define GOOGLE_PREDICT_FALSE(x) (x)\n#endif\n#endif\n\n#ifndef GOOGLE_PROTOBUF_ATTRIBUTE_RETURNS_NONNULL\n#ifdef __GNUC__\n#define GOOGLE_PROTOBUF_ATTRIBUTE_RETURNS_NONNULL \\\n    __attribute__((returns_nonnull))\n#endif\n#endif\n\n// Delimits a block of code which may write to memory which is simultaneously\n// written by other threads, but which has been determined to be thread-safe\n// (e.g. because it is an idempotent write).\n#ifndef GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN\n#define GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN()\n#endif\n#ifndef GOOGLE_SAFE_CONCURRENT_WRITES_END\n#define GOOGLE_SAFE_CONCURRENT_WRITES_END()\n#endif\n\n#define GOOGLE_GUARDED_BY(x)\n#define GOOGLE_ATTRIBUTE_COLD\n\n#ifdef GOOGLE_PROTOBUF_DONT_USE_UNALIGNED\n# define GOOGLE_PROTOBUF_USE_UNALIGNED 0\n#else\n# if defined(_M_X64) || defined(__x86_64__) || defined(_M_IX86) || defined(__i386__)\n#  define GOOGLE_PROTOBUF_USE_UNALIGNED 1\n# else\n#  define GOOGLE_PROTOBUF_USE_UNALIGNED 0\n# endif\n#endif\n\n#define GOOGLE_PROTOBUF_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_COLD\n\n#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) ||\\\n    defined(MEMORY_SANITIZER)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif  // __cplusplus\nuint16_t __sanitizer_unaligned_load16(const void *p);\nuint32_t __sanitizer_unaligned_load32(const void *p);\nuint64_t __sanitizer_unaligned_load64(const void *p);\nvoid __sanitizer_unaligned_store16(void *p, uint16_t v);\nvoid __sanitizer_unaligned_store32(void *p, uint32_t v);\nvoid __sanitizer_unaligned_store64(void *p, uint64_t v);\n#ifdef __cplusplus\n}  // extern \"C\"\n#endif  // __cplusplus\n\ninline uint16 GOOGLE_UNALIGNED_LOAD16(const void *p) {\n  return __sanitizer_unaligned_load16(p);\n}\n\ninline uint32 GOOGLE_UNALIGNED_LOAD32(const void *p) {\n  return __sanitizer_unaligned_load32(p);\n}\n\ninline uint64 GOOGLE_UNALIGNED_LOAD64(const void *p) {\n  return __sanitizer_unaligned_load64(p);\n}\n\ninline void GOOGLE_UNALIGNED_STORE16(void *p, uint16 v) {\n  __sanitizer_unaligned_store16(p, v);\n}\n\ninline void GOOGLE_UNALIGNED_STORE32(void *p, uint32 v) {\n  __sanitizer_unaligned_store32(p, v);\n}\n\ninline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) {\n  __sanitizer_unaligned_store64(p, v);\n}\n\n#elif GOOGLE_PROTOBUF_USE_UNALIGNED\n\n#define GOOGLE_UNALIGNED_LOAD16(_p) (*reinterpret_cast<const uint16 *>(_p))\n#define GOOGLE_UNALIGNED_LOAD32(_p) (*reinterpret_cast<const uint32 *>(_p))\n#define GOOGLE_UNALIGNED_LOAD64(_p) (*reinterpret_cast<const uint64 *>(_p))\n\n#define GOOGLE_UNALIGNED_STORE16(_p, _val) (*reinterpret_cast<uint16 *>(_p) = (_val))\n#define GOOGLE_UNALIGNED_STORE32(_p, _val) (*reinterpret_cast<uint32 *>(_p) = (_val))\n#define GOOGLE_UNALIGNED_STORE64(_p, _val) (*reinterpret_cast<uint64 *>(_p) = (_val))\n\n#else\ninline uint16 GOOGLE_UNALIGNED_LOAD16(const void *p) {\n  uint16 t;\n  memcpy(&t, p, sizeof t);\n  return t;\n}\n\ninline uint32 GOOGLE_UNALIGNED_LOAD32(const void *p) {\n  uint32 t;\n  memcpy(&t, p, sizeof t);\n  return t;\n}\n\ninline uint64 GOOGLE_UNALIGNED_LOAD64(const void *p) {\n  uint64 t;\n  memcpy(&t, p, sizeof t);\n  return t;\n}\n\ninline void GOOGLE_UNALIGNED_STORE16(void *p, uint16 v) {\n  memcpy(p, &v, sizeof v);\n}\n\ninline void GOOGLE_UNALIGNED_STORE32(void *p, uint32 v) {\n  memcpy(p, &v, sizeof v);\n}\n\ninline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) {\n  memcpy(p, &v, sizeof v);\n}\n#endif\n\n#if defined(GOOGLE_PROTOBUF_OS_NACL) \\\n    || (defined(__ANDROID__) && defined(__clang__) \\\n        && (__clang_major__ == 3 && __clang_minor__ == 8) \\\n        && (__clang_patchlevel__ < 275480))\n# define GOOGLE_PROTOBUF_USE_PORTABLE_LOG2\n#endif\n\n#if defined(_MSC_VER)\n#define GOOGLE_THREAD_LOCAL __declspec(thread)\n#else\n#define GOOGLE_THREAD_LOCAL __thread\n#endif\n\n// The following guarantees declaration of the byte swap functions.\n#ifdef _MSC_VER\n#define bswap_16(x) _byteswap_ushort(x)\n#define bswap_32(x) _byteswap_ulong(x)\n#define bswap_64(x) _byteswap_uint64(x)\n\n#elif defined(__APPLE__)\n// Mac OS X / Darwin features\n#define bswap_16(x) OSSwapInt16(x)\n#define bswap_32(x) OSSwapInt32(x)\n#define bswap_64(x) OSSwapInt64(x)\n\n#elif !defined(__GLIBC__) && !defined(__BIONIC__) && !defined(__CYGWIN__)\n\nstatic inline uint16 bswap_16(uint16 x) {\n  return static_cast<uint16>(((x & 0xFF) << 8) | ((x & 0xFF00) >> 8));\n}\n#define bswap_16(x) bswap_16(x)\nstatic inline uint32 bswap_32(uint32 x) {\n  return (((x & 0xFF) << 24) |\n          ((x & 0xFF00) << 8) |\n          ((x & 0xFF0000) >> 8) |\n          ((x & 0xFF000000) >> 24));\n}\n#define bswap_32(x) bswap_32(x)\nstatic inline uint64 bswap_64(uint64 x) {\n  return (((x & GOOGLE_ULONGLONG(0xFF)) << 56) |\n          ((x & GOOGLE_ULONGLONG(0xFF00)) << 40) |\n          ((x & GOOGLE_ULONGLONG(0xFF0000)) << 24) |\n          ((x & GOOGLE_ULONGLONG(0xFF000000)) << 8) |\n          ((x & GOOGLE_ULONGLONG(0xFF00000000)) >> 8) |\n          ((x & GOOGLE_ULONGLONG(0xFF0000000000)) >> 24) |\n          ((x & GOOGLE_ULONGLONG(0xFF000000000000)) >> 40) |\n          ((x & GOOGLE_ULONGLONG(0xFF00000000000000)) >> 56));\n}\n#define bswap_64(x) bswap_64(x)\n\n#endif\n\n// ===================================================================\n// from google3/util/bits/bits.h\n\nclass Bits {\n public:\n  static uint32 Log2FloorNonZero(uint32 n) {\n#if defined(__GNUC__)\n  return 31 ^ static_cast<uint32>(__builtin_clz(n));\n#elif defined(_MSC_VER)\n  unsigned long where;\n  _BitScanReverse(&where, n);\n  return where;\n#else\n  return Log2FloorNonZero_Portable(n);\n#endif\n  }\n\n  static uint32 Log2FloorNonZero64(uint64 n) {\n    // Older versions of clang run into an instruction-selection failure when\n    // it encounters __builtin_clzll:\n    // https://bugs.chromium.org/p/nativeclient/issues/detail?id=4395\n    // This includes arm-nacl-clang and clang in older Android NDK versions.\n    // To work around this, when we build with those we use the portable\n    // implementation instead.\n#if defined(__GNUC__) && !defined(GOOGLE_PROTOBUF_USE_PORTABLE_LOG2)\n  return 63 ^ static_cast<uint32>(__builtin_clzll(n));\n#elif defined(_MSC_VER) && defined(_M_X64)\n  unsigned long where;\n  _BitScanReverse64(&where, n);\n  return where;\n#else\n  return Log2FloorNonZero64_Portable(n);\n#endif\n  }\n private:\n  static int Log2FloorNonZero_Portable(uint32 n) {\n    if (n == 0)\n      return -1;\n    int log = 0;\n    uint32 value = n;\n    for (int i = 4; i >= 0; --i) {\n      int shift = (1 << i);\n      uint32 x = value >> shift;\n      if (x != 0) {\n        value = x;\n        log += shift;\n      }\n    }\n    assert(value == 1);\n    return log;\n  }\n\n  static int Log2FloorNonZero64_Portable(uint64 n) {\n    const uint32 topbits = static_cast<uint32>(n >> 32);\n    if (topbits == 0) {\n      // Top bits are zero, so scan in bottom bits\n      return static_cast<int>(Log2FloorNonZero(static_cast<uint32>(n)));\n    } else {\n      return 32 + static_cast<int>(Log2FloorNonZero(topbits));\n    }\n  }\n};\n\n// ===================================================================\n// from google3/util/endian/endian.h\nLIBPROTOBUF_EXPORT uint32 ghtonl(uint32 x);\n\nclass BigEndian {\n public:\n#ifdef PROTOBUF_LITTLE_ENDIAN\n\n  static uint16 FromHost16(uint16 x) { return bswap_16(x); }\n  static uint16 ToHost16(uint16 x) { return bswap_16(x); }\n\n  static uint32 FromHost32(uint32 x) { return bswap_32(x); }\n  static uint32 ToHost32(uint32 x) { return bswap_32(x); }\n\n  static uint64 FromHost64(uint64 x) { return bswap_64(x); }\n  static uint64 ToHost64(uint64 x) { return bswap_64(x); }\n\n  static bool IsLittleEndian() { return true; }\n\n#else\n\n  static uint16 FromHost16(uint16 x) { return x; }\n  static uint16 ToHost16(uint16 x) { return x; }\n\n  static uint32 FromHost32(uint32 x) { return x; }\n  static uint32 ToHost32(uint32 x) { return x; }\n\n  static uint64 FromHost64(uint64 x) { return x; }\n  static uint64 ToHost64(uint64 x) { return x; }\n\n  static bool IsLittleEndian() { return false; }\n\n#endif /* ENDIAN */\n\n  // Functions to do unaligned loads and stores in big-endian order.\n  static uint16 Load16(const void *p) {\n    return ToHost16(GOOGLE_UNALIGNED_LOAD16(p));\n  }\n\n  static void Store16(void *p, uint16 v) {\n    GOOGLE_UNALIGNED_STORE16(p, FromHost16(v));\n  }\n\n  static uint32 Load32(const void *p) {\n    return ToHost32(GOOGLE_UNALIGNED_LOAD32(p));\n  }\n\n  static void Store32(void *p, uint32 v) {\n    GOOGLE_UNALIGNED_STORE32(p, FromHost32(v));\n  }\n\n  static uint64 Load64(const void *p) {\n    return ToHost64(GOOGLE_UNALIGNED_LOAD64(p));\n  }\n\n  static void Store64(void *p, uint64 v) {\n    GOOGLE_UNALIGNED_STORE64(p, FromHost64(v));\n  }\n};\n\n#ifndef GOOGLE_ATTRIBUTE_SECTION_VARIABLE\n#define GOOGLE_ATTRIBUTE_SECTION_VARIABLE(name)\n#endif\n\n#define GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(name)\n\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_PORT_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/singleton.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2014 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#ifndef GOOGLE_PROTOBUF_STUBS_SINGLETON_H__\n#define GOOGLE_PROTOBUF_STUBS_SINGLETON_H__\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/once.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\ntemplate<typename T>\nclass Singleton {\n public:\n  static T* get() {\n    GoogleOnceInit(&once_, &Singleton<T>::Init);\n    return instance_;\n  }\n  static void ShutDown() {\n    delete instance_;\n    instance_ = NULL;\n  }\n private:\n  static void Init() {\n    instance_ = new T();\n  }\n  static ProtobufOnceType once_;\n  static T* instance_;\n};\n\ntemplate<typename T>\nProtobufOnceType Singleton<T>::once_;\n\ntemplate<typename T>\nT* Singleton<T>::instance_ = NULL;\n}  // namespace internal\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_SINGLETON_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/status.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#ifndef GOOGLE_PROTOBUF_STUBS_STATUS_H_\n#define GOOGLE_PROTOBUF_STUBS_STATUS_H_\n\n#include <iosfwd>\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/stringpiece.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace util {\nnamespace error {\n// These values must match error codes defined in google/rpc/code.proto.\nenum Code {\n  OK = 0,\n  CANCELLED = 1,\n  UNKNOWN = 2,\n  INVALID_ARGUMENT = 3,\n  DEADLINE_EXCEEDED = 4,\n  NOT_FOUND = 5,\n  ALREADY_EXISTS = 6,\n  PERMISSION_DENIED = 7,\n  UNAUTHENTICATED = 16,\n  RESOURCE_EXHAUSTED = 8,\n  FAILED_PRECONDITION = 9,\n  ABORTED = 10,\n  OUT_OF_RANGE = 11,\n  UNIMPLEMENTED = 12,\n  INTERNAL = 13,\n  UNAVAILABLE = 14,\n  DATA_LOSS = 15,\n};\n}  // namespace error\n\nclass LIBPROTOBUF_EXPORT Status {\n public:\n  // Creates a \"successful\" status.\n  Status();\n\n  // Create a status in the canonical error space with the specified\n  // code, and error message.  If \"code == 0\", error_message is\n  // ignored and a Status object identical to Status::OK is\n  // constructed.\n  Status(error::Code error_code, StringPiece error_message);\n  Status(const Status&);\n  Status& operator=(const Status& x);\n  ~Status() {}\n\n  // Some pre-defined Status objects\n  static const Status OK;             // Identical to 0-arg constructor\n  static const Status CANCELLED;\n  static const Status UNKNOWN;\n\n  // Accessor\n  bool ok() const {\n    return error_code_ == error::OK;\n  }\n  int error_code() const {\n    return error_code_;\n  }\n  StringPiece error_message() const {\n    return error_message_;\n  }\n\n  bool operator==(const Status& x) const;\n  bool operator!=(const Status& x) const {\n    return !operator==(x);\n  }\n\n  // Return a combination of the error code name and message.\n  string ToString() const;\n\n private:\n  error::Code error_code_;\n  string error_message_;\n};\n\n// Prints a human-readable representation of 'x' to 'os'.\nLIBPROTOBUF_EXPORT std::ostream& operator<<(std::ostream& os, const Status& x);\n\n#define EXPECT_OK(value) EXPECT_TRUE((value).ok())\n\n}  // namespace util\n}  // namespace protobuf\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_STUBS_STATUS_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/stl_util.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// from google3/util/gtl/stl_util.h\n\n#ifndef GOOGLE_PROTOBUF_STUBS_STL_UTIL_H__\n#define GOOGLE_PROTOBUF_STUBS_STL_UTIL_H__\n\n#include <google/protobuf/stubs/common.h>\n\nnamespace google {\nnamespace protobuf {\n\n// STLDeleteContainerPointers()\n//  For a range within a container of pointers, calls delete\n//  (non-array version) on these pointers.\n// NOTE: for these three functions, we could just implement a DeleteObject\n// functor and then call for_each() on the range and functor, but this\n// requires us to pull in all of algorithm.h, which seems expensive.\n// For hash_[multi]set, it is important that this deletes behind the iterator\n// because the hash_set may call the hash function on the iterator when it is\n// advanced, which could result in the hash function trying to deference a\n// stale pointer.\ntemplate <class ForwardIterator>\nvoid STLDeleteContainerPointers(ForwardIterator begin,\n                                ForwardIterator end) {\n  while (begin != end) {\n    ForwardIterator temp = begin;\n    ++begin;\n    delete *temp;\n  }\n}\n\n// Inside Google, this function implements a horrible, disgusting hack in which\n// we reach into the string's private implementation and resize it without\n// initializing the new bytes.  In some cases doing this can significantly\n// improve performance.  However, since it's totally non-portable it has no\n// place in open source code.  Feel free to fill this function in with your\n// own disgusting hack if you want the perf boost.\ninline void STLStringResizeUninitialized(string* s, size_t new_size) {\n  s->resize(new_size);\n}\n\n// Return a mutable char* pointing to a string's internal buffer,\n// which may not be null-terminated. Writing through this pointer will\n// modify the string.\n//\n// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the\n// next call to a string method that invalidates iterators.\n//\n// As of 2006-04, there is no standard-blessed way of getting a\n// mutable reference to a string's internal buffer. However, issue 530\n// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-active.html#530)\n// proposes this as the method. According to Matt Austern, this should\n// already work on all current implementations.\ninline char* string_as_array(string* str) {\n  // DO NOT USE const_cast<char*>(str->data())! See the unittest for why.\n  return str->empty() ? NULL : &*str->begin();\n}\n\n// STLDeleteElements() deletes all the elements in an STL container and clears\n// the container.  This function is suitable for use with a vector, set,\n// hash_set, or any other STL container which defines sensible begin(), end(),\n// and clear() methods.\n//\n// If container is NULL, this function is a no-op.\n//\n// As an alternative to calling STLDeleteElements() directly, consider\n// ElementDeleter (defined below), which ensures that your container's elements\n// are deleted when the ElementDeleter goes out of scope.\ntemplate <class T>\nvoid STLDeleteElements(T *container) {\n  if (!container) return;\n  STLDeleteContainerPointers(container->begin(), container->end());\n  container->clear();\n}\n\n// Given an STL container consisting of (key, value) pairs, STLDeleteValues\n// deletes all the \"value\" components and clears the container.  Does nothing\n// in the case it's given a NULL pointer.\n\ntemplate <class T>\nvoid STLDeleteValues(T *v) {\n  if (!v) return;\n  for (typename T::iterator i = v->begin(); i != v->end(); ++i) {\n    delete i->second;\n  }\n  v->clear();\n}\n\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_STUBS_STL_UTIL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/stringpiece.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// A StringPiece points to part or all of a string, Cord, double-quoted string\n// literal, or other string-like object.  A StringPiece does *not* own the\n// string to which it points.  A StringPiece is not null-terminated.\n//\n// You can use StringPiece as a function or method parameter.  A StringPiece\n// parameter can receive a double-quoted string literal argument, a \"const\n// char*\" argument, a string argument, or a StringPiece argument with no data\n// copying.  Systematic use of StringPiece for arguments reduces data\n// copies and strlen() calls.\n//\n// Prefer passing StringPieces by value:\n//   void MyFunction(StringPiece arg);\n// If circumstances require, you may also pass by const reference:\n//   void MyFunction(const StringPiece& arg);  // not preferred\n// Both of these have the same lifetime semantics.  Passing by value\n// generates slightly smaller code.  For more discussion, see the thread\n// go/stringpiecebyvalue on c-users.\n//\n// StringPiece is also suitable for local variables if you know that\n// the lifetime of the underlying object is longer than the lifetime\n// of your StringPiece variable.\n//\n// Beware of binding a StringPiece to a temporary:\n//   StringPiece sp = obj.MethodReturningString();  // BAD: lifetime problem\n//\n// This code is okay:\n//   string str = obj.MethodReturningString();  // str owns its contents\n//   StringPiece sp(str);  // GOOD, because str outlives sp\n//\n// StringPiece is sometimes a poor choice for a return value and usually a poor\n// choice for a data member.  If you do use a StringPiece this way, it is your\n// responsibility to ensure that the object pointed to by the StringPiece\n// outlives the StringPiece.\n//\n// A StringPiece may represent just part of a string; thus the name \"Piece\".\n// For example, when splitting a string, vector<StringPiece> is a natural data\n// type for the output.  For another example, a Cord is a non-contiguous,\n// potentially very long string-like object.  The Cord class has an interface\n// that iteratively provides StringPiece objects that point to the\n// successive pieces of a Cord object.\n//\n// A StringPiece is not null-terminated.  If you write code that scans a\n// StringPiece, you must check its length before reading any characters.\n// Common idioms that work on null-terminated strings do not work on\n// StringPiece objects.\n//\n// There are several ways to create a null StringPiece:\n//   StringPiece()\n//   StringPiece(NULL)\n//   StringPiece(NULL, 0)\n// For all of the above, sp.data() == NULL, sp.length() == 0,\n// and sp.empty() == true.  Also, if you create a StringPiece with\n// a non-NULL pointer then sp.data() != NULL.  Once created,\n// sp.data() will stay either NULL or not-NULL, except if you call\n// sp.clear() or sp.set().\n//\n// Thus, you can use StringPiece(NULL) to signal an out-of-band value\n// that is different from other StringPiece values.  This is similar\n// to the way that const char* p1 = NULL; is different from\n// const char* p2 = \"\";.\n//\n// There are many ways to create an empty StringPiece:\n//   StringPiece()\n//   StringPiece(NULL)\n//   StringPiece(NULL, 0)\n//   StringPiece(\"\")\n//   StringPiece(\"\", 0)\n//   StringPiece(\"abcdef\", 0)\n//   StringPiece(\"abcdef\"+6, 0)\n// For all of the above, sp.length() will be 0 and sp.empty() will be true.\n// For some empty StringPiece values, sp.data() will be NULL.\n// For some empty StringPiece values, sp.data() will not be NULL.\n//\n// Be careful not to confuse: null StringPiece and empty StringPiece.\n// The set of empty StringPieces properly includes the set of null StringPieces.\n// That is, every null StringPiece is an empty StringPiece,\n// but some non-null StringPieces are empty Stringpieces too.\n//\n// All empty StringPiece values compare equal to each other.\n// Even a null StringPieces compares equal to a non-null empty StringPiece:\n//  StringPiece() == StringPiece(\"\", 0)\n//  StringPiece(NULL) == StringPiece(\"abc\", 0)\n//  StringPiece(NULL, 0) == StringPiece(\"abcdef\"+6, 0)\n//\n// Look carefully at this example:\n//   StringPiece(\"\") == NULL\n// True or false?  TRUE, because StringPiece::operator== converts\n// the right-hand side from NULL to StringPiece(NULL),\n// and then compares two zero-length spans of characters.\n// However, we are working to make this example produce a compile error.\n//\n// Suppose you want to write:\n//   bool TestWhat?(StringPiece sp) { return sp == NULL; }  // BAD\n// Do not do that.  Write one of these instead:\n//   bool TestNull(StringPiece sp) { return sp.data() == NULL; }\n//   bool TestEmpty(StringPiece sp) { return sp.empty(); }\n// The intent of TestWhat? is unclear.  Did you mean TestNull or TestEmpty?\n// Right now, TestWhat? behaves likes TestEmpty.\n// We are working to make TestWhat? produce a compile error.\n// TestNull is good to test for an out-of-band signal.\n// TestEmpty is good to test for an empty StringPiece.\n//\n// Caveats (again):\n// (1) The lifetime of the pointed-to string (or piece of a string)\n//     must be longer than the lifetime of the StringPiece.\n// (2) There may or may not be a '\\0' character after the end of\n//     StringPiece data.\n// (3) A null StringPiece is empty.\n//     An empty StringPiece may or may not be a null StringPiece.\n\n#ifndef GOOGLE_PROTOBUF_STUBS_STRINGPIECE_H_\n#define GOOGLE_PROTOBUF_STUBS_STRINGPIECE_H_\n\n#include <assert.h>\n#include <stddef.h>\n#include <string.h>\n#include <iosfwd>\n#include <limits>\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/hash.h>\n\nnamespace google {\nnamespace protobuf {\n// StringPiece has *two* size types.\n// StringPiece::size_type\n//   is unsigned\n//   is 32 bits in LP32, 64 bits in LP64, 64 bits in LLP64\n//   no future changes intended\n// stringpiece_ssize_type\n//   is signed\n//   is 32 bits in LP32, 64 bits in LP64, 64 bits in LLP64\n//   future changes intended: http://go/64BitStringPiece\n//\ntypedef string::difference_type stringpiece_ssize_type;\n\n// STRINGPIECE_CHECK_SIZE protects us from 32-bit overflows.\n// TODO(mec): delete this after stringpiece_ssize_type goes 64 bit.\n#if !defined(NDEBUG)\n#define STRINGPIECE_CHECK_SIZE 1\n#elif defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0\n#define STRINGPIECE_CHECK_SIZE 1\n#else\n#define STRINGPIECE_CHECK_SIZE 0\n#endif\n\nclass LIBPROTOBUF_EXPORT StringPiece {\n private:\n  const char* ptr_;\n  stringpiece_ssize_type length_;\n\n  // Prevent overflow in debug mode or fortified mode.\n  // sizeof(stringpiece_ssize_type) may be smaller than sizeof(size_t).\n  static stringpiece_ssize_type CheckedSsizeTFromSizeT(size_t size) {\n#if STRINGPIECE_CHECK_SIZE > 0\n#ifdef max\n#undef max\n#endif\n    if (size > static_cast<size_t>(\n        std::numeric_limits<stringpiece_ssize_type>::max())) {\n      // Some people grep for this message in logs\n      // so take care if you ever change it.\n      LogFatalSizeTooBig(size, \"size_t to int conversion\");\n    }\n#endif\n    return static_cast<stringpiece_ssize_type>(size);\n  }\n\n  // Out-of-line error path.\n  static void LogFatalSizeTooBig(size_t size, const char* details);\n\n public:\n  // We provide non-explicit singleton constructors so users can pass\n  // in a \"const char*\" or a \"string\" wherever a \"StringPiece\" is\n  // expected.\n  //\n  // Style guide exception granted:\n  // http://goto/style-guide-exception-20978288\n  StringPiece() : ptr_(NULL), length_(0) {}\n\n  StringPiece(const char* str)  // NOLINT(runtime/explicit)\n      : ptr_(str), length_(0) {\n    if (str != NULL) {\n      length_ = CheckedSsizeTFromSizeT(strlen(str));\n    }\n  }\n\n  template <class Allocator>\n  StringPiece(  // NOLINT(runtime/explicit)\n      const std::basic_string<char, std::char_traits<char>, Allocator>& str)\n      : ptr_(str.data()), length_(0) {\n    length_ = CheckedSsizeTFromSizeT(str.size());\n  }\n\n  StringPiece(const char* offset, stringpiece_ssize_type len)\n      : ptr_(offset), length_(len) {\n    assert(len >= 0);\n  }\n\n  // Substring of another StringPiece.\n  // pos must be non-negative and <= x.length().\n  StringPiece(StringPiece x, stringpiece_ssize_type pos);\n  // Substring of another StringPiece.\n  // pos must be non-negative and <= x.length().\n  // len must be non-negative and will be pinned to at most x.length() - pos.\n  StringPiece(StringPiece x,\n              stringpiece_ssize_type pos,\n              stringpiece_ssize_type len);\n\n  // data() may return a pointer to a buffer with embedded NULs, and the\n  // returned buffer may or may not be null terminated.  Therefore it is\n  // typically a mistake to pass data() to a routine that expects a NUL\n  // terminated string.\n  const char* data() const { return ptr_; }\n  stringpiece_ssize_type size() const { return length_; }\n  stringpiece_ssize_type length() const { return length_; }\n  bool empty() const { return length_ == 0; }\n\n  void clear() {\n    ptr_ = NULL;\n    length_ = 0;\n  }\n\n  void set(const char* data, stringpiece_ssize_type len) {\n    assert(len >= 0);\n    ptr_ = data;\n    length_ = len;\n  }\n\n  void set(const char* str) {\n    ptr_ = str;\n    if (str != NULL)\n      length_ = CheckedSsizeTFromSizeT(strlen(str));\n    else\n      length_ = 0;\n  }\n\n  void set(const void* data, stringpiece_ssize_type len) {\n    ptr_ = reinterpret_cast<const char*>(data);\n    length_ = len;\n  }\n\n  char operator[](stringpiece_ssize_type i) const {\n    assert(0 <= i);\n    assert(i < length_);\n    return ptr_[i];\n  }\n\n  void remove_prefix(stringpiece_ssize_type n) {\n    assert(length_ >= n);\n    ptr_ += n;\n    length_ -= n;\n  }\n\n  void remove_suffix(stringpiece_ssize_type n) {\n    assert(length_ >= n);\n    length_ -= n;\n  }\n\n  // returns {-1, 0, 1}\n  int compare(StringPiece x) const {\n    const stringpiece_ssize_type min_size =\n        length_ < x.length_ ? length_ : x.length_;\n    int r = memcmp(ptr_, x.ptr_, static_cast<size_t>(min_size));\n    if (r < 0) return -1;\n    if (r > 0) return 1;\n    if (length_ < x.length_) return -1;\n    if (length_ > x.length_) return 1;\n    return 0;\n  }\n\n  string as_string() const {\n    return ToString();\n  }\n  // We also define ToString() here, since many other string-like\n  // interfaces name the routine that converts to a C++ string\n  // \"ToString\", and it's confusing to have the method that does that\n  // for a StringPiece be called \"as_string()\".  We also leave the\n  // \"as_string()\" method defined here for existing code.\n  string ToString() const {\n    if (ptr_ == NULL) return string();\n    return string(data(), static_cast<size_type>(size()));\n  }\n\n  operator string() const {\n    return ToString();\n  }\n\n  void CopyToString(string* target) const;\n  void AppendToString(string* target) const;\n\n  bool starts_with(StringPiece x) const {\n    return (length_ >= x.length_) &&\n           (memcmp(ptr_, x.ptr_, static_cast<size_t>(x.length_)) == 0);\n  }\n\n  bool ends_with(StringPiece x) const {\n    return ((length_ >= x.length_) &&\n            (memcmp(ptr_ + (length_-x.length_), x.ptr_,\n                 static_cast<size_t>(x.length_)) == 0));\n  }\n\n  // Checks whether StringPiece starts with x and if so advances the beginning\n  // of it to past the match.  It's basically a shortcut for starts_with\n  // followed by remove_prefix.\n  bool Consume(StringPiece x);\n  // Like above but for the end of the string.\n  bool ConsumeFromEnd(StringPiece x);\n\n  // standard STL container boilerplate\n  typedef char value_type;\n  typedef const char* pointer;\n  typedef const char& reference;\n  typedef const char& const_reference;\n  typedef size_t size_type;\n  typedef ptrdiff_t difference_type;\n  static const size_type npos;\n  typedef const char* const_iterator;\n  typedef const char* iterator;\n  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;\n  typedef std::reverse_iterator<iterator> reverse_iterator;\n  iterator begin() const { return ptr_; }\n  iterator end() const { return ptr_ + length_; }\n  const_reverse_iterator rbegin() const {\n    return const_reverse_iterator(ptr_ + length_);\n  }\n  const_reverse_iterator rend() const {\n    return const_reverse_iterator(ptr_);\n  }\n  stringpiece_ssize_type max_size() const { return length_; }\n  stringpiece_ssize_type capacity() const { return length_; }\n\n  // cpplint.py emits a false positive [build/include_what_you_use]\n  stringpiece_ssize_type copy(char* buf, size_type n, size_type pos = 0) const;  // NOLINT\n\n  bool contains(StringPiece s) const;\n\n  stringpiece_ssize_type find(StringPiece s, size_type pos = 0) const;\n  stringpiece_ssize_type find(char c, size_type pos = 0) const;\n  stringpiece_ssize_type rfind(StringPiece s, size_type pos = npos) const;\n  stringpiece_ssize_type rfind(char c, size_type pos = npos) const;\n\n  stringpiece_ssize_type find_first_of(StringPiece s, size_type pos = 0) const;\n  stringpiece_ssize_type find_first_of(char c, size_type pos = 0) const {\n    return find(c, pos);\n  }\n  stringpiece_ssize_type find_first_not_of(StringPiece s,\n                                           size_type pos = 0) const;\n  stringpiece_ssize_type find_first_not_of(char c, size_type pos = 0) const;\n  stringpiece_ssize_type find_last_of(StringPiece s,\n                                      size_type pos = npos) const;\n  stringpiece_ssize_type find_last_of(char c, size_type pos = npos) const {\n    return rfind(c, pos);\n  }\n  stringpiece_ssize_type find_last_not_of(StringPiece s,\n                                          size_type pos = npos) const;\n  stringpiece_ssize_type find_last_not_of(char c, size_type pos = npos) const;\n\n  StringPiece substr(size_type pos, size_type n = npos) const;\n};\n\n// This large function is defined inline so that in a fairly common case where\n// one of the arguments is a literal, the compiler can elide a lot of the\n// following comparisons.\ninline bool operator==(StringPiece x, StringPiece y) {\n  stringpiece_ssize_type len = x.size();\n  if (len != y.size()) {\n    return false;\n  }\n\n  return x.data() == y.data() || len <= 0 ||\n      memcmp(x.data(), y.data(), static_cast<size_t>(len)) == 0;\n}\n\ninline bool operator!=(StringPiece x, StringPiece y) {\n  return !(x == y);\n}\n\ninline bool operator<(StringPiece x, StringPiece y) {\n  const stringpiece_ssize_type min_size =\n      x.size() < y.size() ? x.size() : y.size();\n  const int r = memcmp(x.data(), y.data(), static_cast<size_t>(min_size));\n  return (r < 0) || (r == 0 && x.size() < y.size());\n}\n\ninline bool operator>(StringPiece x, StringPiece y) {\n  return y < x;\n}\n\ninline bool operator<=(StringPiece x, StringPiece y) {\n  return !(x > y);\n}\n\ninline bool operator>=(StringPiece x, StringPiece y) {\n  return !(x < y);\n}\n\n// allow StringPiece to be logged\nextern std::ostream& operator<<(std::ostream& o, StringPiece piece);\n\nnamespace internal {\n// StringPiece is not a POD and can not be used in an union (pre C++11). We\n// need a POD version of it.\nstruct StringPiecePod {\n  // Create from a StringPiece.\n  static StringPiecePod CreateFromStringPiece(StringPiece str) {\n    StringPiecePod pod;\n    pod.data_ = str.data();\n    pod.size_ = str.size();\n    return pod;\n  }\n\n  // Cast to StringPiece.\n  operator StringPiece() const { return StringPiece(data_, size_); }\n\n  bool operator==(const char* value) const {\n    return StringPiece(data_, size_) == StringPiece(value);\n  }\n\n  char operator[](stringpiece_ssize_type i) const {\n    assert(0 <= i);\n    assert(i < size_);\n    return data_[i];\n  }\n\n  const char* data() const { return data_; }\n\n  stringpiece_ssize_type size() const {\n    return size_;\n  }\n\n  std::string ToString() const {\n    return std::string(data_, static_cast<size_t>(size_));\n  }\n private:\n  const char* data_;\n  stringpiece_ssize_type size_;\n};\n\n}  // namespace internal\n}  // namespace protobuf\n}  // namespace google\n\nGOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START\ntemplate<> struct hash<StringPiece> {\n  size_t operator()(const StringPiece& s) const {\n    size_t result = 0;\n    for (const char *str = s.data(), *end = str + s.size(); str < end; str++) {  \n      result = 5 * result + static_cast<size_t>(*str);\n    }\n    return result;\n  }\n};\nGOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END\n\n#endif  // STRINGS_STRINGPIECE_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/stubs/template_util.h",
    "content": "// Copyright 2005 Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// ----\n// Author: lar@google.com (Laramie Leavitt)\n//\n// Template metaprogramming utility functions.\n//\n// This code is compiled directly on many platforms, including client\n// platforms like Windows, Mac, and embedded systems.  Before making\n// any changes here, make sure that you're not breaking any platforms.\n//\n//\n// The names chosen here reflect those used in tr1 and the boost::mpl\n// library, there are similar operations used in the Loki library as\n// well.  I prefer the boost names for 2 reasons:\n// 1.  I think that portions of the Boost libraries are more likely to\n// be included in the c++ standard.\n// 2.  It is not impossible that some of the boost libraries will be\n// included in our own build in the future.\n// Both of these outcomes means that we may be able to directly replace\n// some of these with boost equivalents.\n//\n#ifndef GOOGLE_PROTOBUF_TEMPLATE_UTIL_H_\n#define GOOGLE_PROTOBUF_TEMPLATE_UTIL_H_\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// Types small_ and big_ are guaranteed such that sizeof(small_) <\n// sizeof(big_)\ntypedef char small_;\n\nstruct big_ {\n  char dummy[2];\n};\n\n// Identity metafunction.\ntemplate <class T>\nstruct identity_ {\n  typedef T type;\n};\n\n// integral_constant, defined in tr1, is a wrapper for an integer\n// value. We don't really need this generality; we could get away\n// with hardcoding the integer type to bool. We use the fully\n// general integer_constant for compatibility with tr1.\n\ntemplate<class T, T v>\nstruct integral_constant {\n  static const T value = v;\n  typedef T value_type;\n  typedef integral_constant<T, v> type;\n};\n\ntemplate <class T, T v> const T integral_constant<T, v>::value;\n\n\n// Abbreviations: true_type and false_type are structs that represent boolean\n// true and false values. Also define the boost::mpl versions of those names,\n// true_ and false_.\ntypedef integral_constant<bool, true>  true_type;\ntypedef integral_constant<bool, false> false_type;\ntypedef true_type  true_;\ntypedef false_type false_;\n\n// if_ is a templatized conditional statement.\n// if_<cond, A, B> is a compile time evaluation of cond.\n// if_<>::type contains A if cond is true, B otherwise.\ntemplate<bool cond, typename A, typename B>\nstruct if_{\n  typedef A type;\n};\n\ntemplate<typename A, typename B>\nstruct if_<false, A, B> {\n  typedef B type;\n};\n\n\n// type_equals_ is a template type comparator, similar to Loki IsSameType.\n// type_equals_<A, B>::value is true iff \"A\" is the same type as \"B\".\n//\n// New code should prefer base::is_same, defined in base/type_traits.h.\n// It is functionally identical, but is_same is the standard spelling.\ntemplate<typename A, typename B>\nstruct type_equals_ : public false_ {\n};\n\ntemplate<typename A>\nstruct type_equals_<A, A> : public true_ {\n};\n\n// and_ is a template && operator.\n// and_<A, B>::value evaluates \"A::value && B::value\".\ntemplate<typename A, typename B>\nstruct and_ : public integral_constant<bool, (A::value && B::value)> {\n};\n\n// or_ is a template || operator.\n// or_<A, B>::value evaluates \"A::value || B::value\".\ntemplate<typename A, typename B>\nstruct or_ : public integral_constant<bool, (A::value || B::value)> {\n};\n\n\n}  // namespace internal\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_TEMPLATE_UTIL_H_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/text_format.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: jschorr@google.com (Joseph Schorr)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Utilities for printing and parsing protocol messages in a human-readable,\n// text-based format.\n\n#ifndef GOOGLE_PROTOBUF_TEXT_FORMAT_H__\n#define GOOGLE_PROTOBUF_TEXT_FORMAT_H__\n\n#include <map>\n#include <memory>\n#include <string>\n#include <vector>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/descriptor.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/message_lite.h>\n\nnamespace google {\nnamespace protobuf {\n\nnamespace io {\n  class ErrorCollector;      // tokenizer.h\n}\n\n// This class implements protocol buffer text format.  Printing and parsing\n// protocol messages in text format is useful for debugging and human editing\n// of messages.\n//\n// This class is really a namespace that contains only static methods.\nclass LIBPROTOBUF_EXPORT TextFormat {\n public:\n  // Outputs a textual representation of the given message to the given\n  // output stream. Returns false if printing fails.\n  static bool Print(const Message& message, io::ZeroCopyOutputStream* output);\n\n  // Print the fields in an UnknownFieldSet.  They are printed by tag number\n  // only.  Embedded messages are heuristically identified by attempting to\n  // parse them. Returns false if printing fails.\n  static bool PrintUnknownFields(const UnknownFieldSet& unknown_fields,\n                                 io::ZeroCopyOutputStream* output);\n\n  // Like Print(), but outputs directly to a string.\n  // Note: output will be cleared prior to printing, and will be left empty\n  // even if printing fails. Returns false if printing fails.\n  static bool PrintToString(const Message& message, string* output);\n\n  // Like PrintUnknownFields(), but outputs directly to a string. Returns false\n  // if printing fails.\n  static bool PrintUnknownFieldsToString(const UnknownFieldSet& unknown_fields,\n                                         string* output);\n\n  // Outputs a textual representation of the value of the field supplied on\n  // the message supplied. For non-repeated fields, an index of -1 must\n  // be supplied. Note that this method will print the default value for a\n  // field if it is not set.\n  static void PrintFieldValueToString(const Message& message,\n                                      const FieldDescriptor* field,\n                                      int index,\n                                      string* output);\n\n  class LIBPROTOBUF_EXPORT BaseTextGenerator {\n   public:\n    virtual ~BaseTextGenerator();\n\n    virtual void Indent() {}\n    virtual void Outdent() {}\n\n    // Print text to the output stream.\n    virtual void Print(const char* text, size_t size) = 0;\n\n    void PrintString(const string& str) { Print(str.data(), str.size()); }\n\n    template <size_t n>\n    void PrintLiteral(const char (&text)[n]) {\n      Print(text, n - 1);  // n includes the terminating zero character.\n    }\n  };\n\n  // The default printer that converts scalar values from fields into their\n  // string representation.\n  // You can derive from this FastFieldValuePrinter if you want to have fields\n  // to be printed in a different way and register it at the Printer.\n  class LIBPROTOBUF_EXPORT FastFieldValuePrinter {\n   public:\n    FastFieldValuePrinter();\n    virtual ~FastFieldValuePrinter();\n    virtual void PrintBool(bool val, BaseTextGenerator* generator) const;\n    virtual void PrintInt32(int32 val, BaseTextGenerator* generator) const;\n    virtual void PrintUInt32(uint32 val, BaseTextGenerator* generator) const;\n    virtual void PrintInt64(int64 val, BaseTextGenerator* generator) const;\n    virtual void PrintUInt64(uint64 val, BaseTextGenerator* generator) const;\n    virtual void PrintFloat(float val, BaseTextGenerator* generator) const;\n    virtual void PrintDouble(double val, BaseTextGenerator* generator) const;\n    virtual void PrintString(const string& val,\n                             BaseTextGenerator* generator) const;\n    virtual void PrintBytes(const string& val,\n                            BaseTextGenerator* generator) const;\n    virtual void PrintEnum(int32 val, const string& name,\n                           BaseTextGenerator* generator) const;\n    virtual void PrintFieldName(const Message& message, int field_index,\n                                int field_count, const Reflection* reflection,\n                                const FieldDescriptor* field,\n                                BaseTextGenerator* generator) const;\n    virtual void PrintFieldName(const Message& message,\n                                const Reflection* reflection,\n                                const FieldDescriptor* field,\n                                BaseTextGenerator* generator) const;\n    virtual void PrintMessageStart(const Message& message, int field_index,\n                                   int field_count, bool single_line_mode,\n                                   BaseTextGenerator* generator) const;\n    virtual void PrintMessageEnd(const Message& message, int field_index,\n                                 int field_count, bool single_line_mode,\n                                 BaseTextGenerator* generator) const;\n\n   private:\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FastFieldValuePrinter);\n  };\n\n  class LIBPROTOBUF_EXPORT PROTOBUF_RUNTIME_DEPRECATED(\"Please use FastFieldValuePrinter\")\n      FieldValuePrinter {\n   public:\n    FieldValuePrinter();\n    virtual ~FieldValuePrinter();\n    virtual string PrintBool(bool val) const;\n    virtual string PrintInt32(int32 val) const;\n    virtual string PrintUInt32(uint32 val) const;\n    virtual string PrintInt64(int64 val) const;\n    virtual string PrintUInt64(uint64 val) const;\n    virtual string PrintFloat(float val) const;\n    virtual string PrintDouble(double val) const;\n    virtual string PrintString(const string& val) const;\n    virtual string PrintBytes(const string& val) const;\n    virtual string PrintEnum(int32 val, const string& name) const;\n    virtual string PrintFieldName(const Message& message,\n                                  const Reflection* reflection,\n                                  const FieldDescriptor* field) const;\n    virtual string PrintMessageStart(const Message& message,\n                                     int field_index,\n                                     int field_count,\n                                     bool single_line_mode) const;\n    virtual string PrintMessageEnd(const Message& message,\n                                   int field_index,\n                                   int field_count,\n                                   bool single_line_mode) const;\n\n   private:\n    FastFieldValuePrinter delegate_;\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldValuePrinter);\n  };\n\n  class LIBPROTOBUF_EXPORT MessagePrinter {\n   public:\n    MessagePrinter() {}\n    virtual ~MessagePrinter() {}\n    virtual void Print(const Message& message, bool single_line_mode,\n                       BaseTextGenerator* generator) const = 0;\n\n   private:\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessagePrinter);\n  };\n\n  // Interface that Printers or Parsers can use to find extensions, or types\n  // referenced in Any messages.\n  class LIBPROTOBUF_EXPORT Finder {\n   public:\n    virtual ~Finder();\n\n    // Try to find an extension of *message by fully-qualified field\n    // name.  Returns NULL if no extension is known for this name or number.\n    // The base implementation uses the extensions already known by the message.\n    virtual const FieldDescriptor* FindExtension(\n        Message* message,\n        const string& name) const;\n\n    // Find the message type for an Any proto.\n    // Returns NULL if no message is known for this name.\n    // The base implementation only accepts prefixes of type.googleprod.com/ or\n    // type.googleapis.com/, and searches the DescriptorPool of the parent\n    // message.\n    virtual const Descriptor* FindAnyType(const Message& message,\n                                          const string& prefix,\n                                          const string& name) const;\n  };\n\n  // Class for those users which require more fine-grained control over how\n  // a protobuffer message is printed out.\n  class LIBPROTOBUF_EXPORT Printer {\n   public:\n    Printer();\n    ~Printer();\n\n    // Like TextFormat::Print\n    bool Print(const Message& message, io::ZeroCopyOutputStream* output) const;\n    // Like TextFormat::PrintUnknownFields\n    bool PrintUnknownFields(const UnknownFieldSet& unknown_fields,\n                            io::ZeroCopyOutputStream* output) const;\n    // Like TextFormat::PrintToString\n    bool PrintToString(const Message& message, string* output) const;\n    // Like TextFormat::PrintUnknownFieldsToString\n    bool PrintUnknownFieldsToString(const UnknownFieldSet& unknown_fields,\n                                    string* output) const;\n    // Like TextFormat::PrintFieldValueToString\n    void PrintFieldValueToString(const Message& message,\n                                 const FieldDescriptor* field,\n                                 int index,\n                                 string* output) const;\n\n    // Adjust the initial indent level of all output.  Each indent level is\n    // equal to two spaces.\n    void SetInitialIndentLevel(int indent_level) {\n      initial_indent_level_ = indent_level;\n    }\n\n    // If printing in single line mode, then the entire message will be output\n    // on a single line with no line breaks.\n    void SetSingleLineMode(bool single_line_mode) {\n      single_line_mode_ = single_line_mode;\n    }\n\n    bool IsInSingleLineMode() const {\n      return single_line_mode_;\n    }\n\n    // If use_field_number is true, uses field number instead of field name.\n    void SetUseFieldNumber(bool use_field_number) {\n      use_field_number_ = use_field_number;\n    }\n\n    // Set true to print repeated primitives in a format like:\n    //   field_name: [1, 2, 3, 4]\n    // instead of printing each value on its own line.  Short format applies\n    // only to primitive values -- i.e. everything except strings and\n    // sub-messages/groups.\n    void SetUseShortRepeatedPrimitives(bool use_short_repeated_primitives) {\n      use_short_repeated_primitives_ = use_short_repeated_primitives;\n    }\n\n    // Set true to output UTF-8 instead of ASCII.  The only difference\n    // is that bytes >= 0x80 in string fields will not be escaped,\n    // because they are assumed to be part of UTF-8 multi-byte\n    // sequences. This will change the default FastFieldValuePrinter.\n    void SetUseUtf8StringEscaping(bool as_utf8);\n\n    // Set the default (Fast)FieldValuePrinter that is used for all fields that\n    // don't have a field-specific printer registered.\n    // Takes ownership of the printer.\n    void SetDefaultFieldValuePrinter(const FastFieldValuePrinter* printer);\n    void SetDefaultFieldValuePrinter(const FieldValuePrinter* printer);\n\n    // Sets whether we want to hide unknown fields or not.\n    // Usually unknown fields are printed in a generic way that includes the\n    // tag number of the field instead of field name. However, sometimes it\n    // is useful to be able to print the message without unknown fields (e.g.\n    // for the python protobuf version to maintain consistency between its pure\n    // python and c++ implementations).\n    void SetHideUnknownFields(bool hide) {\n      hide_unknown_fields_ = hide;\n    }\n\n    // If print_message_fields_in_index_order is true, fields of a proto message\n    // will be printed using the order defined in source code instead of the\n    // field number, extensions will be printed at the end of the message\n    // and their relative order is determined by the extension number.\n    // By default, use the field number order.\n    void SetPrintMessageFieldsInIndexOrder(\n        bool print_message_fields_in_index_order) {\n      print_message_fields_in_index_order_ =\n          print_message_fields_in_index_order;\n    }\n\n    // If expand==true, expand google.protobuf.Any payloads. The output\n    // will be of form\n    //    [type_url] { <value_printed_in_text> }\n    //\n    // If expand==false, print Any using the default printer. The output will\n    // look like\n    //    type_url: \"<type_url>\"  value: \"serialized_content\"\n    void SetExpandAny(bool expand) {\n      expand_any_ = expand;\n    }\n\n    // Set how parser finds message for Any payloads.\n    void SetFinder(Finder* finder) {\n      finder_ = finder;\n    }\n\n    // If non-zero, we truncate all string fields that are  longer than this\n    // threshold.  This is useful when the proto message has very long strings,\n    // e.g., dump of encoded image file.\n    //\n    // NOTE(hfgong):  Setting a non-zero value breaks round-trip safe\n    // property of TextFormat::Printer.  That is, from the printed message, we\n    // cannot fully recover the original string field any more.\n    void SetTruncateStringFieldLongerThan(\n        const int64 truncate_string_field_longer_than) {\n      truncate_string_field_longer_than_ = truncate_string_field_longer_than;\n    }\n\n    // Register a custom field-specific (Fast)FieldValuePrinter for fields\n    // with a particular FieldDescriptor.\n    // Returns \"true\" if the registration succeeded, or \"false\", if there is\n    // already a printer for that FieldDescriptor.\n    // Takes ownership of the printer on successful registration.\n    bool RegisterFieldValuePrinter(const FieldDescriptor* field,\n                                   const FieldValuePrinter* printer);\n    bool RegisterFieldValuePrinter(const FieldDescriptor* field,\n                                   const FastFieldValuePrinter* printer);\n\n    // Register a custom message-specific MessagePrinter for messages with a\n    // particular Descriptor.\n    // Returns \"true\" if the registration succeeded, or \"false\" if there is\n    // already a printer for that Descriptor.\n    bool RegisterMessagePrinter(const Descriptor* descriptor,\n                                const MessagePrinter* printer);\n\n   private:\n    // Forward declaration of an internal class used to print the text\n    // output to the OutputStream (see text_format.cc for implementation).\n    class TextGenerator;\n\n    // Internal Print method, used for writing to the OutputStream via\n    // the TextGenerator class.\n    void Print(const Message& message, TextGenerator* generator) const;\n\n    // Print a single field.\n    void PrintField(const Message& message, const Reflection* reflection,\n                    const FieldDescriptor* field,\n                    TextGenerator* generator) const;\n\n    // Print a repeated primitive field in short form.\n    void PrintShortRepeatedField(const Message& message,\n                                 const Reflection* reflection,\n                                 const FieldDescriptor* field,\n                                 TextGenerator* generator) const;\n\n    // Print the name of a field -- i.e. everything that comes before the\n    // ':' for a single name/value pair.\n    void PrintFieldName(const Message& message, int field_index,\n                        int field_count, const Reflection* reflection,\n                        const FieldDescriptor* field,\n                        TextGenerator* generator) const;\n\n    // Outputs a textual representation of the value of the field supplied on\n    // the message supplied or the default value if not set.\n    void PrintFieldValue(const Message& message, const Reflection* reflection,\n                         const FieldDescriptor* field, int index,\n                         TextGenerator* generator) const;\n\n    // Print the fields in an UnknownFieldSet.  They are printed by tag number\n    // only.  Embedded messages are heuristically identified by attempting to\n    // parse them.\n    void PrintUnknownFields(const UnknownFieldSet& unknown_fields,\n                            TextGenerator* generator) const;\n\n    bool PrintAny(const Message& message, TextGenerator* generator) const;\n\n    int initial_indent_level_;\n\n    bool single_line_mode_;\n\n    bool use_field_number_;\n\n    bool use_short_repeated_primitives_;\n\n    bool hide_unknown_fields_;\n\n    bool print_message_fields_in_index_order_;\n\n    bool expand_any_;\n\n    int64 truncate_string_field_longer_than_;\n\n    std::unique_ptr<const FastFieldValuePrinter> default_field_value_printer_;\n    typedef std::map<const FieldDescriptor*, const FastFieldValuePrinter*>\n        CustomPrinterMap;\n    CustomPrinterMap custom_printers_;\n\n    typedef std::map<const Descriptor*, const MessagePrinter*>\n        CustomMessagePrinterMap;\n    CustomMessagePrinterMap custom_message_printers_;\n\n    const Finder* finder_;\n  };\n\n  // Parses a text-format protocol message from the given input stream to\n  // the given message object. This function parses the human-readable format\n  // written by Print(). Returns true on success. The message is cleared first,\n  // even if the function fails -- See Merge() to avoid this behavior.\n  //\n  // Example input: \"user {\\n id: 123 extra { gender: MALE language: 'en' }\\n}\"\n  //\n  // One use for this function is parsing handwritten strings in test code.\n  // Another use is to parse the output from google::protobuf::Message::DebugString()\n  // (or ShortDebugString()), because these functions output using\n  // google::protobuf::TextFormat::Print().\n  //\n  // If you would like to read a protocol buffer serialized in the\n  // (non-human-readable) binary wire format, see\n  // google::protobuf::MessageLite::ParseFromString().\n  static bool Parse(io::ZeroCopyInputStream* input, Message* output);\n  // Like Parse(), but reads directly from a string.\n  static bool ParseFromString(const string& input, Message* output);\n\n  // Like Parse(), but the data is merged into the given message, as if\n  // using Message::MergeFrom().\n  static bool Merge(io::ZeroCopyInputStream* input, Message* output);\n  // Like Merge(), but reads directly from a string.\n  static bool MergeFromString(const string& input, Message* output);\n\n  // Parse the given text as a single field value and store it into the\n  // given field of the given message. If the field is a repeated field,\n  // the new value will be added to the end\n  static bool ParseFieldValueFromString(const string& input,\n                                        const FieldDescriptor* field,\n                                        Message* message);\n\n  // A location in the parsed text.\n  struct ParseLocation {\n    int line;\n    int column;\n\n    ParseLocation() : line(-1), column(-1) {}\n    ParseLocation(int line_param, int column_param)\n        : line(line_param), column(column_param) {}\n  };\n\n  // Data structure which is populated with the locations of each field\n  // value parsed from the text.\n  class LIBPROTOBUF_EXPORT ParseInfoTree {\n   public:\n    ParseInfoTree();\n    ~ParseInfoTree();\n\n    // Returns the parse location for index-th value of the field in the parsed\n    // text. If none exists, returns a location with line = -1. Index should be\n    // -1 for not-repeated fields.\n    ParseLocation GetLocation(const FieldDescriptor* field, int index) const;\n\n    // Returns the parse info tree for the given field, which must be a message\n    // type. The nested information tree is owned by the root tree and will be\n    // deleted when it is deleted.\n    ParseInfoTree* GetTreeForNested(const FieldDescriptor* field,\n                                    int index) const;\n\n   private:\n    // Allow the text format parser to record information into the tree.\n    friend class TextFormat;\n\n    // Records the starting location of a single value for a field.\n    void RecordLocation(const FieldDescriptor* field, ParseLocation location);\n\n    // Create and records a nested tree for a nested message field.\n    ParseInfoTree* CreateNested(const FieldDescriptor* field);\n\n    // Defines the map from the index-th field descriptor to its parse location.\n    typedef std::map<const FieldDescriptor*,\n                     std::vector<ParseLocation> > LocationMap;\n\n    // Defines the map from the index-th field descriptor to the nested parse\n    // info tree.\n    typedef std::map<const FieldDescriptor*,\n                     std::vector<ParseInfoTree*> > NestedMap;\n\n    LocationMap locations_;\n    NestedMap nested_;\n\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ParseInfoTree);\n  };\n\n  // For more control over parsing, use this class.\n  class LIBPROTOBUF_EXPORT Parser {\n   public:\n    Parser();\n    ~Parser();\n\n    // Like TextFormat::Parse().\n    bool Parse(io::ZeroCopyInputStream* input, Message* output);\n    // Like TextFormat::ParseFromString().\n    bool ParseFromString(const string& input, Message* output);\n    // Like TextFormat::Merge().\n    bool Merge(io::ZeroCopyInputStream* input, Message* output);\n    // Like TextFormat::MergeFromString().\n    bool MergeFromString(const string& input, Message* output);\n\n    // Set where to report parse errors.  If NULL (the default), errors will\n    // be printed to stderr.\n    void RecordErrorsTo(io::ErrorCollector* error_collector) {\n      error_collector_ = error_collector;\n    }\n\n    // Set how parser finds extensions.  If NULL (the default), the\n    // parser will use the standard Reflection object associated with\n    // the message being parsed.\n    void SetFinder(Finder* finder) {\n      finder_ = finder;\n    }\n\n    // Sets where location information about the parse will be written. If NULL\n    // (the default), then no location will be written.\n    void WriteLocationsTo(ParseInfoTree* tree) {\n      parse_info_tree_ = tree;\n    }\n\n    // Normally parsing fails if, after parsing, output->IsInitialized()\n    // returns false.  Call AllowPartialMessage(true) to skip this check.\n    void AllowPartialMessage(bool allow) {\n      allow_partial_ = allow;\n    }\n\n    // Allow field names to be matched case-insensitively.\n    // This is not advisable if there are fields that only differ in case, or\n    // if you want to enforce writing in the canonical form.\n    // This is 'false' by default.\n    void AllowCaseInsensitiveField(bool allow) {\n      allow_case_insensitive_field_ = allow;\n    }\n\n    // Like TextFormat::ParseFieldValueFromString\n    bool ParseFieldValueFromString(const string& input,\n                                   const FieldDescriptor* field,\n                                   Message* output);\n\n\n    void AllowFieldNumber(bool allow) {\n      allow_field_number_ = allow;\n    }\n\n   private:\n    // Forward declaration of an internal class used to parse text\n    // representations (see text_format.cc for implementation).\n    class ParserImpl;\n\n    // Like TextFormat::Merge().  The provided implementation is used\n    // to do the parsing.\n    bool MergeUsingImpl(io::ZeroCopyInputStream* input,\n                        Message* output,\n                        ParserImpl* parser_impl);\n\n    io::ErrorCollector* error_collector_;\n    const Finder* finder_;\n    ParseInfoTree* parse_info_tree_;\n    bool allow_partial_;\n    bool allow_case_insensitive_field_;\n    bool allow_unknown_field_;\n    bool allow_unknown_enum_;\n    bool allow_field_number_;\n    bool allow_relaxed_whitespace_;\n    bool allow_singular_overwrites_;\n  };\n\n\n private:\n  // Hack: ParseInfoTree declares TextFormat as a friend which should extend\n  // the friendship to TextFormat::Parser::ParserImpl, but unfortunately some\n  // old compilers (e.g. GCC 3.4.6) don't implement this correctly. We provide\n  // helpers for ParserImpl to call methods of ParseInfoTree.\n  static inline void RecordLocation(ParseInfoTree* info_tree,\n                                    const FieldDescriptor* field,\n                                    ParseLocation location);\n  static inline ParseInfoTree* CreateNested(ParseInfoTree* info_tree,\n                                            const FieldDescriptor* field);\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TextFormat);\n};\n\ninline void TextFormat::RecordLocation(ParseInfoTree* info_tree,\n                                       const FieldDescriptor* field,\n                                       ParseLocation location) {\n  info_tree->RecordLocation(field, location);\n}\n\n\ninline TextFormat::ParseInfoTree* TextFormat::CreateNested(\n    ParseInfoTree* info_tree, const FieldDescriptor* field) {\n  return info_tree->CreateNested(field);\n}\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_TEXT_FORMAT_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/timestamp.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/timestamp.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2ftimestamp_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2ftimestamp_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2ftimestamp_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2ftimestamp_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[1];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto\nnamespace google {\nnamespace protobuf {\nclass Timestamp;\nclass TimestampDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern TimestampDefaultTypeInternal _Timestamp_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Timestamp* Arena::CreateMaybeMessage<::google::protobuf::Timestamp>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT Timestamp : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Timestamp) */ {\n public:\n  Timestamp();\n  virtual ~Timestamp();\n\n  Timestamp(const Timestamp& from);\n\n  inline Timestamp& operator=(const Timestamp& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Timestamp(Timestamp&& from) noexcept\n    : Timestamp() {\n    *this = ::std::move(from);\n  }\n\n  inline Timestamp& operator=(Timestamp&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Timestamp& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Timestamp* internal_default_instance() {\n    return reinterpret_cast<const Timestamp*>(\n               &_Timestamp_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void UnsafeArenaSwap(Timestamp* other);\n  void Swap(Timestamp* other);\n  friend void swap(Timestamp& a, Timestamp& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Timestamp* New() const final {\n    return CreateMaybeMessage<Timestamp>(NULL);\n  }\n\n  Timestamp* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Timestamp>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Timestamp& from);\n  void MergeFrom(const Timestamp& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Timestamp* other);\n  protected:\n  explicit Timestamp(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // int64 seconds = 1;\n  void clear_seconds();\n  static const int kSecondsFieldNumber = 1;\n  ::google::protobuf::int64 seconds() const;\n  void set_seconds(::google::protobuf::int64 value);\n\n  // int32 nanos = 2;\n  void clear_nanos();\n  static const int kNanosFieldNumber = 2;\n  ::google::protobuf::int32 nanos() const;\n  void set_nanos(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Timestamp)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::int64 seconds_;\n  ::google::protobuf::int32 nanos_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// Timestamp\n\n// int64 seconds = 1;\ninline void Timestamp::clear_seconds() {\n  seconds_ = GOOGLE_LONGLONG(0);\n}\ninline ::google::protobuf::int64 Timestamp::seconds() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.seconds)\n  return seconds_;\n}\ninline void Timestamp::set_seconds(::google::protobuf::int64 value) {\n  \n  seconds_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.seconds)\n}\n\n// int32 nanos = 2;\ninline void Timestamp::clear_nanos() {\n  nanos_ = 0;\n}\ninline ::google::protobuf::int32 Timestamp::nanos() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.nanos)\n  return nanos_;\n}\ninline void Timestamp::set_nanos(::google::protobuf::int32 value) {\n  \n  nanos_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.nanos)\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2ftimestamp_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/timestamp.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption go_package = \"github.com/golang/protobuf/ptypes/timestamp\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"TimestampProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n// A Timestamp represents a point in time independent of any time zone\n// or calendar, represented as seconds and fractions of seconds at\n// nanosecond resolution in UTC Epoch time. It is encoded using the\n// Proleptic Gregorian Calendar which extends the Gregorian calendar\n// backwards to year one. It is encoded assuming all minutes are 60\n// seconds long, i.e. leap seconds are \"smeared\" so that no leap second\n// table is needed for interpretation. Range is from\n// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.\n// By restricting to that range, we ensure that we can convert to\n// and from  RFC 3339 date strings.\n// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).\n//\n// # Examples\n//\n// Example 1: Compute Timestamp from POSIX `time()`.\n//\n//     Timestamp timestamp;\n//     timestamp.set_seconds(time(NULL));\n//     timestamp.set_nanos(0);\n//\n// Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n//\n//     struct timeval tv;\n//     gettimeofday(&tv, NULL);\n//\n//     Timestamp timestamp;\n//     timestamp.set_seconds(tv.tv_sec);\n//     timestamp.set_nanos(tv.tv_usec * 1000);\n//\n// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n//\n//     FILETIME ft;\n//     GetSystemTimeAsFileTime(&ft);\n//     UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n//\n//     // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n//     // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n//     Timestamp timestamp;\n//     timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n//     timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n//\n// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n//\n//     long millis = System.currentTimeMillis();\n//\n//     Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n//         .setNanos((int) ((millis % 1000) * 1000000)).build();\n//\n//\n// Example 5: Compute Timestamp from current time in Python.\n//\n//     timestamp = Timestamp()\n//     timestamp.GetCurrentTime()\n//\n// # JSON Mapping\n//\n// In JSON format, the Timestamp type is encoded as a string in the\n// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n// format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n// where {year} is always expressed using four digits while {month}, {day},\n// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n// are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n// is required. A proto3 JSON serializer should always use UTC (as indicated by\n// \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n// able to accept both UTC and other timezones (as indicated by an offset).\n//\n// For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n// 01:30 UTC on January 15, 2017.\n//\n// In JavaScript, one can convert a Date object to this format using the\n// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]\n// method. In Python, a standard `datetime.datetime` object can be converted\n// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)\n// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one\n// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](\n// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--\n// ) to obtain a formatter capable of generating timestamps in this format.\n//\n//\nmessage Timestamp {\n\n  // Represents seconds of UTC time since Unix epoch\n  // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n  // 9999-12-31T23:59:59Z inclusive.\n  int64 seconds = 1;\n\n  // Non-negative fractions of a second at nanosecond resolution. Negative\n  // second values with fractions must still have non-negative nanos values\n  // that count forward in time. Must be from 0 to 999,999,999\n  // inclusive.\n  int32 nanos = 2;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/type.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/type.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2ftype_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2ftype_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/generated_enum_reflection.h>\n#include <google/protobuf/unknown_field_set.h>\n#include <google/protobuf/any.pb.h>\n#include <google/protobuf/source_context.pb.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2ftype_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2ftype_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[5];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2ftype_2eproto\nnamespace google {\nnamespace protobuf {\nclass Enum;\nclass EnumDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern EnumDefaultTypeInternal _Enum_default_instance_;\nclass EnumValue;\nclass EnumValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern EnumValueDefaultTypeInternal _EnumValue_default_instance_;\nclass Field;\nclass FieldDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern FieldDefaultTypeInternal _Field_default_instance_;\nclass Option;\nclass OptionDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern OptionDefaultTypeInternal _Option_default_instance_;\nclass Type;\nclass TypeDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern TypeDefaultTypeInternal _Type_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Enum* Arena::CreateMaybeMessage<::google::protobuf::Enum>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::EnumValue* Arena::CreateMaybeMessage<::google::protobuf::EnumValue>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Field* Arena::CreateMaybeMessage<::google::protobuf::Field>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Option* Arena::CreateMaybeMessage<::google::protobuf::Option>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Type* Arena::CreateMaybeMessage<::google::protobuf::Type>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\nenum Field_Kind {\n  Field_Kind_TYPE_UNKNOWN = 0,\n  Field_Kind_TYPE_DOUBLE = 1,\n  Field_Kind_TYPE_FLOAT = 2,\n  Field_Kind_TYPE_INT64 = 3,\n  Field_Kind_TYPE_UINT64 = 4,\n  Field_Kind_TYPE_INT32 = 5,\n  Field_Kind_TYPE_FIXED64 = 6,\n  Field_Kind_TYPE_FIXED32 = 7,\n  Field_Kind_TYPE_BOOL = 8,\n  Field_Kind_TYPE_STRING = 9,\n  Field_Kind_TYPE_GROUP = 10,\n  Field_Kind_TYPE_MESSAGE = 11,\n  Field_Kind_TYPE_BYTES = 12,\n  Field_Kind_TYPE_UINT32 = 13,\n  Field_Kind_TYPE_ENUM = 14,\n  Field_Kind_TYPE_SFIXED32 = 15,\n  Field_Kind_TYPE_SFIXED64 = 16,\n  Field_Kind_TYPE_SINT32 = 17,\n  Field_Kind_TYPE_SINT64 = 18,\n  Field_Kind_Field_Kind_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,\n  Field_Kind_Field_Kind_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max\n};\nLIBPROTOBUF_EXPORT bool Field_Kind_IsValid(int value);\nconst Field_Kind Field_Kind_Kind_MIN = Field_Kind_TYPE_UNKNOWN;\nconst Field_Kind Field_Kind_Kind_MAX = Field_Kind_TYPE_SINT64;\nconst int Field_Kind_Kind_ARRAYSIZE = Field_Kind_Kind_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* Field_Kind_descriptor();\ninline const ::std::string& Field_Kind_Name(Field_Kind value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    Field_Kind_descriptor(), value);\n}\ninline bool Field_Kind_Parse(\n    const ::std::string& name, Field_Kind* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<Field_Kind>(\n    Field_Kind_descriptor(), name, value);\n}\nenum Field_Cardinality {\n  Field_Cardinality_CARDINALITY_UNKNOWN = 0,\n  Field_Cardinality_CARDINALITY_OPTIONAL = 1,\n  Field_Cardinality_CARDINALITY_REQUIRED = 2,\n  Field_Cardinality_CARDINALITY_REPEATED = 3,\n  Field_Cardinality_Field_Cardinality_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,\n  Field_Cardinality_Field_Cardinality_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max\n};\nLIBPROTOBUF_EXPORT bool Field_Cardinality_IsValid(int value);\nconst Field_Cardinality Field_Cardinality_Cardinality_MIN = Field_Cardinality_CARDINALITY_UNKNOWN;\nconst Field_Cardinality Field_Cardinality_Cardinality_MAX = Field_Cardinality_CARDINALITY_REPEATED;\nconst int Field_Cardinality_Cardinality_ARRAYSIZE = Field_Cardinality_Cardinality_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* Field_Cardinality_descriptor();\ninline const ::std::string& Field_Cardinality_Name(Field_Cardinality value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    Field_Cardinality_descriptor(), value);\n}\ninline bool Field_Cardinality_Parse(\n    const ::std::string& name, Field_Cardinality* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<Field_Cardinality>(\n    Field_Cardinality_descriptor(), name, value);\n}\nenum Syntax {\n  SYNTAX_PROTO2 = 0,\n  SYNTAX_PROTO3 = 1,\n  Syntax_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,\n  Syntax_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max\n};\nLIBPROTOBUF_EXPORT bool Syntax_IsValid(int value);\nconst Syntax Syntax_MIN = SYNTAX_PROTO2;\nconst Syntax Syntax_MAX = SYNTAX_PROTO3;\nconst int Syntax_ARRAYSIZE = Syntax_MAX + 1;\n\nLIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* Syntax_descriptor();\ninline const ::std::string& Syntax_Name(Syntax value) {\n  return ::google::protobuf::internal::NameOfEnum(\n    Syntax_descriptor(), value);\n}\ninline bool Syntax_Parse(\n    const ::std::string& name, Syntax* value) {\n  return ::google::protobuf::internal::ParseNamedEnum<Syntax>(\n    Syntax_descriptor(), name, value);\n}\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT Type : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Type) */ {\n public:\n  Type();\n  virtual ~Type();\n\n  Type(const Type& from);\n\n  inline Type& operator=(const Type& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Type(Type&& from) noexcept\n    : Type() {\n    *this = ::std::move(from);\n  }\n\n  inline Type& operator=(Type&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Type& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Type* internal_default_instance() {\n    return reinterpret_cast<const Type*>(\n               &_Type_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void UnsafeArenaSwap(Type* other);\n  void Swap(Type* other);\n  friend void swap(Type& a, Type& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Type* New() const final {\n    return CreateMaybeMessage<Type>(NULL);\n  }\n\n  Type* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Type>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Type& from);\n  void MergeFrom(const Type& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Type* other);\n  protected:\n  explicit Type(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.Field fields = 2;\n  int fields_size() const;\n  void clear_fields();\n  static const int kFieldsFieldNumber = 2;\n  ::google::protobuf::Field* mutable_fields(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >*\n      mutable_fields();\n  const ::google::protobuf::Field& fields(int index) const;\n  ::google::protobuf::Field* add_fields();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >&\n      fields() const;\n\n  // repeated string oneofs = 3;\n  int oneofs_size() const;\n  void clear_oneofs();\n  static const int kOneofsFieldNumber = 3;\n  const ::std::string& oneofs(int index) const;\n  ::std::string* mutable_oneofs(int index);\n  void set_oneofs(int index, const ::std::string& value);\n  #if LANG_CXX11\n  void set_oneofs(int index, ::std::string&& value);\n  #endif\n  void set_oneofs(int index, const char* value);\n  void set_oneofs(int index, const char* value, size_t size);\n  ::std::string* add_oneofs();\n  void add_oneofs(const ::std::string& value);\n  #if LANG_CXX11\n  void add_oneofs(::std::string&& value);\n  #endif\n  void add_oneofs(const char* value);\n  void add_oneofs(const char* value, size_t size);\n  const ::google::protobuf::RepeatedPtrField< ::std::string>& oneofs() const;\n  ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_oneofs();\n\n  // repeated .google.protobuf.Option options = 4;\n  int options_size() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 4;\n  ::google::protobuf::Option* mutable_options(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\n      mutable_options();\n  const ::google::protobuf::Option& options(int index) const;\n  ::google::protobuf::Option* add_options();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\n      options() const;\n\n  // string name = 1;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // .google.protobuf.SourceContext source_context = 5;\n  bool has_source_context() const;\n  void clear_source_context();\n  static const int kSourceContextFieldNumber = 5;\n  private:\n  const ::google::protobuf::SourceContext& _internal_source_context() const;\n  public:\n  const ::google::protobuf::SourceContext& source_context() const;\n  ::google::protobuf::SourceContext* release_source_context();\n  ::google::protobuf::SourceContext* mutable_source_context();\n  void set_allocated_source_context(::google::protobuf::SourceContext* source_context);\n  void unsafe_arena_set_allocated_source_context(\n      ::google::protobuf::SourceContext* source_context);\n  ::google::protobuf::SourceContext* unsafe_arena_release_source_context();\n\n  // .google.protobuf.Syntax syntax = 6;\n  void clear_syntax();\n  static const int kSyntaxFieldNumber = 6;\n  ::google::protobuf::Syntax syntax() const;\n  void set_syntax(::google::protobuf::Syntax value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Type)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field > fields_;\n  ::google::protobuf::RepeatedPtrField< ::std::string> oneofs_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::SourceContext* source_context_;\n  int syntax_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT Field : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Field) */ {\n public:\n  Field();\n  virtual ~Field();\n\n  Field(const Field& from);\n\n  inline Field& operator=(const Field& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Field(Field&& from) noexcept\n    : Field() {\n    *this = ::std::move(from);\n  }\n\n  inline Field& operator=(Field&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Field& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Field* internal_default_instance() {\n    return reinterpret_cast<const Field*>(\n               &_Field_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    1;\n\n  void UnsafeArenaSwap(Field* other);\n  void Swap(Field* other);\n  friend void swap(Field& a, Field& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Field* New() const final {\n    return CreateMaybeMessage<Field>(NULL);\n  }\n\n  Field* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Field>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Field& from);\n  void MergeFrom(const Field& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Field* other);\n  protected:\n  explicit Field(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  typedef Field_Kind Kind;\n  static const Kind TYPE_UNKNOWN =\n    Field_Kind_TYPE_UNKNOWN;\n  static const Kind TYPE_DOUBLE =\n    Field_Kind_TYPE_DOUBLE;\n  static const Kind TYPE_FLOAT =\n    Field_Kind_TYPE_FLOAT;\n  static const Kind TYPE_INT64 =\n    Field_Kind_TYPE_INT64;\n  static const Kind TYPE_UINT64 =\n    Field_Kind_TYPE_UINT64;\n  static const Kind TYPE_INT32 =\n    Field_Kind_TYPE_INT32;\n  static const Kind TYPE_FIXED64 =\n    Field_Kind_TYPE_FIXED64;\n  static const Kind TYPE_FIXED32 =\n    Field_Kind_TYPE_FIXED32;\n  static const Kind TYPE_BOOL =\n    Field_Kind_TYPE_BOOL;\n  static const Kind TYPE_STRING =\n    Field_Kind_TYPE_STRING;\n  static const Kind TYPE_GROUP =\n    Field_Kind_TYPE_GROUP;\n  static const Kind TYPE_MESSAGE =\n    Field_Kind_TYPE_MESSAGE;\n  static const Kind TYPE_BYTES =\n    Field_Kind_TYPE_BYTES;\n  static const Kind TYPE_UINT32 =\n    Field_Kind_TYPE_UINT32;\n  static const Kind TYPE_ENUM =\n    Field_Kind_TYPE_ENUM;\n  static const Kind TYPE_SFIXED32 =\n    Field_Kind_TYPE_SFIXED32;\n  static const Kind TYPE_SFIXED64 =\n    Field_Kind_TYPE_SFIXED64;\n  static const Kind TYPE_SINT32 =\n    Field_Kind_TYPE_SINT32;\n  static const Kind TYPE_SINT64 =\n    Field_Kind_TYPE_SINT64;\n  static inline bool Kind_IsValid(int value) {\n    return Field_Kind_IsValid(value);\n  }\n  static const Kind Kind_MIN =\n    Field_Kind_Kind_MIN;\n  static const Kind Kind_MAX =\n    Field_Kind_Kind_MAX;\n  static const int Kind_ARRAYSIZE =\n    Field_Kind_Kind_ARRAYSIZE;\n  static inline const ::google::protobuf::EnumDescriptor*\n  Kind_descriptor() {\n    return Field_Kind_descriptor();\n  }\n  static inline const ::std::string& Kind_Name(Kind value) {\n    return Field_Kind_Name(value);\n  }\n  static inline bool Kind_Parse(const ::std::string& name,\n      Kind* value) {\n    return Field_Kind_Parse(name, value);\n  }\n\n  typedef Field_Cardinality Cardinality;\n  static const Cardinality CARDINALITY_UNKNOWN =\n    Field_Cardinality_CARDINALITY_UNKNOWN;\n  static const Cardinality CARDINALITY_OPTIONAL =\n    Field_Cardinality_CARDINALITY_OPTIONAL;\n  static const Cardinality CARDINALITY_REQUIRED =\n    Field_Cardinality_CARDINALITY_REQUIRED;\n  static const Cardinality CARDINALITY_REPEATED =\n    Field_Cardinality_CARDINALITY_REPEATED;\n  static inline bool Cardinality_IsValid(int value) {\n    return Field_Cardinality_IsValid(value);\n  }\n  static const Cardinality Cardinality_MIN =\n    Field_Cardinality_Cardinality_MIN;\n  static const Cardinality Cardinality_MAX =\n    Field_Cardinality_Cardinality_MAX;\n  static const int Cardinality_ARRAYSIZE =\n    Field_Cardinality_Cardinality_ARRAYSIZE;\n  static inline const ::google::protobuf::EnumDescriptor*\n  Cardinality_descriptor() {\n    return Field_Cardinality_descriptor();\n  }\n  static inline const ::std::string& Cardinality_Name(Cardinality value) {\n    return Field_Cardinality_Name(value);\n  }\n  static inline bool Cardinality_Parse(const ::std::string& name,\n      Cardinality* value) {\n    return Field_Cardinality_Parse(name, value);\n  }\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.Option options = 9;\n  int options_size() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 9;\n  ::google::protobuf::Option* mutable_options(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\n      mutable_options();\n  const ::google::protobuf::Option& options(int index) const;\n  ::google::protobuf::Option* add_options();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\n      options() const;\n\n  // string name = 4;\n  void clear_name();\n  static const int kNameFieldNumber = 4;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // string type_url = 6;\n  void clear_type_url();\n  static const int kTypeUrlFieldNumber = 6;\n  const ::std::string& type_url() const;\n  void set_type_url(const ::std::string& value);\n  #if LANG_CXX11\n  void set_type_url(::std::string&& value);\n  #endif\n  void set_type_url(const char* value);\n  void set_type_url(const char* value, size_t size);\n  ::std::string* mutable_type_url();\n  ::std::string* release_type_url();\n  void set_allocated_type_url(::std::string* type_url);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_type_url();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_type_url(\n      ::std::string* type_url);\n\n  // string json_name = 10;\n  void clear_json_name();\n  static const int kJsonNameFieldNumber = 10;\n  const ::std::string& json_name() const;\n  void set_json_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_json_name(::std::string&& value);\n  #endif\n  void set_json_name(const char* value);\n  void set_json_name(const char* value, size_t size);\n  ::std::string* mutable_json_name();\n  ::std::string* release_json_name();\n  void set_allocated_json_name(::std::string* json_name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_json_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_json_name(\n      ::std::string* json_name);\n\n  // string default_value = 11;\n  void clear_default_value();\n  static const int kDefaultValueFieldNumber = 11;\n  const ::std::string& default_value() const;\n  void set_default_value(const ::std::string& value);\n  #if LANG_CXX11\n  void set_default_value(::std::string&& value);\n  #endif\n  void set_default_value(const char* value);\n  void set_default_value(const char* value, size_t size);\n  ::std::string* mutable_default_value();\n  ::std::string* release_default_value();\n  void set_allocated_default_value(::std::string* default_value);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_default_value();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_default_value(\n      ::std::string* default_value);\n\n  // .google.protobuf.Field.Kind kind = 1;\n  void clear_kind();\n  static const int kKindFieldNumber = 1;\n  ::google::protobuf::Field_Kind kind() const;\n  void set_kind(::google::protobuf::Field_Kind value);\n\n  // .google.protobuf.Field.Cardinality cardinality = 2;\n  void clear_cardinality();\n  static const int kCardinalityFieldNumber = 2;\n  ::google::protobuf::Field_Cardinality cardinality() const;\n  void set_cardinality(::google::protobuf::Field_Cardinality value);\n\n  // int32 number = 3;\n  void clear_number();\n  static const int kNumberFieldNumber = 3;\n  ::google::protobuf::int32 number() const;\n  void set_number(::google::protobuf::int32 value);\n\n  // int32 oneof_index = 7;\n  void clear_oneof_index();\n  static const int kOneofIndexFieldNumber = 7;\n  ::google::protobuf::int32 oneof_index() const;\n  void set_oneof_index(::google::protobuf::int32 value);\n\n  // bool packed = 8;\n  void clear_packed();\n  static const int kPackedFieldNumber = 8;\n  bool packed() const;\n  void set_packed(bool value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Field)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::internal::ArenaStringPtr type_url_;\n  ::google::protobuf::internal::ArenaStringPtr json_name_;\n  ::google::protobuf::internal::ArenaStringPtr default_value_;\n  int kind_;\n  int cardinality_;\n  ::google::protobuf::int32 number_;\n  ::google::protobuf::int32 oneof_index_;\n  bool packed_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT Enum : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Enum) */ {\n public:\n  Enum();\n  virtual ~Enum();\n\n  Enum(const Enum& from);\n\n  inline Enum& operator=(const Enum& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Enum(Enum&& from) noexcept\n    : Enum() {\n    *this = ::std::move(from);\n  }\n\n  inline Enum& operator=(Enum&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Enum& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Enum* internal_default_instance() {\n    return reinterpret_cast<const Enum*>(\n               &_Enum_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    2;\n\n  void UnsafeArenaSwap(Enum* other);\n  void Swap(Enum* other);\n  friend void swap(Enum& a, Enum& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Enum* New() const final {\n    return CreateMaybeMessage<Enum>(NULL);\n  }\n\n  Enum* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Enum>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Enum& from);\n  void MergeFrom(const Enum& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Enum* other);\n  protected:\n  explicit Enum(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.EnumValue enumvalue = 2;\n  int enumvalue_size() const;\n  void clear_enumvalue();\n  static const int kEnumvalueFieldNumber = 2;\n  ::google::protobuf::EnumValue* mutable_enumvalue(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >*\n      mutable_enumvalue();\n  const ::google::protobuf::EnumValue& enumvalue(int index) const;\n  ::google::protobuf::EnumValue* add_enumvalue();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >&\n      enumvalue() const;\n\n  // repeated .google.protobuf.Option options = 3;\n  int options_size() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 3;\n  ::google::protobuf::Option* mutable_options(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\n      mutable_options();\n  const ::google::protobuf::Option& options(int index) const;\n  ::google::protobuf::Option* add_options();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\n      options() const;\n\n  // string name = 1;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // .google.protobuf.SourceContext source_context = 4;\n  bool has_source_context() const;\n  void clear_source_context();\n  static const int kSourceContextFieldNumber = 4;\n  private:\n  const ::google::protobuf::SourceContext& _internal_source_context() const;\n  public:\n  const ::google::protobuf::SourceContext& source_context() const;\n  ::google::protobuf::SourceContext* release_source_context();\n  ::google::protobuf::SourceContext* mutable_source_context();\n  void set_allocated_source_context(::google::protobuf::SourceContext* source_context);\n  void unsafe_arena_set_allocated_source_context(\n      ::google::protobuf::SourceContext* source_context);\n  ::google::protobuf::SourceContext* unsafe_arena_release_source_context();\n\n  // .google.protobuf.Syntax syntax = 5;\n  void clear_syntax();\n  static const int kSyntaxFieldNumber = 5;\n  ::google::protobuf::Syntax syntax() const;\n  void set_syntax(::google::protobuf::Syntax value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Enum)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue > enumvalue_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::SourceContext* source_context_;\n  int syntax_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT EnumValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.EnumValue) */ {\n public:\n  EnumValue();\n  virtual ~EnumValue();\n\n  EnumValue(const EnumValue& from);\n\n  inline EnumValue& operator=(const EnumValue& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  EnumValue(EnumValue&& from) noexcept\n    : EnumValue() {\n    *this = ::std::move(from);\n  }\n\n  inline EnumValue& operator=(EnumValue&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const EnumValue& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const EnumValue* internal_default_instance() {\n    return reinterpret_cast<const EnumValue*>(\n               &_EnumValue_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    3;\n\n  void UnsafeArenaSwap(EnumValue* other);\n  void Swap(EnumValue* other);\n  friend void swap(EnumValue& a, EnumValue& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline EnumValue* New() const final {\n    return CreateMaybeMessage<EnumValue>(NULL);\n  }\n\n  EnumValue* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<EnumValue>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const EnumValue& from);\n  void MergeFrom(const EnumValue& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(EnumValue* other);\n  protected:\n  explicit EnumValue(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // repeated .google.protobuf.Option options = 3;\n  int options_size() const;\n  void clear_options();\n  static const int kOptionsFieldNumber = 3;\n  ::google::protobuf::Option* mutable_options(int index);\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\n      mutable_options();\n  const ::google::protobuf::Option& options(int index) const;\n  ::google::protobuf::Option* add_options();\n  const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\n      options() const;\n\n  // string name = 1;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // int32 number = 2;\n  void clear_number();\n  static const int kNumberFieldNumber = 2;\n  ::google::protobuf::int32 number() const;\n  void set_number(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.EnumValue)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option > options_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::int32 number_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT Option : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Option) */ {\n public:\n  Option();\n  virtual ~Option();\n\n  Option(const Option& from);\n\n  inline Option& operator=(const Option& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Option(Option&& from) noexcept\n    : Option() {\n    *this = ::std::move(from);\n  }\n\n  inline Option& operator=(Option&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Option& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Option* internal_default_instance() {\n    return reinterpret_cast<const Option*>(\n               &_Option_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    4;\n\n  void UnsafeArenaSwap(Option* other);\n  void Swap(Option* other);\n  friend void swap(Option& a, Option& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Option* New() const final {\n    return CreateMaybeMessage<Option>(NULL);\n  }\n\n  Option* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Option>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Option& from);\n  void MergeFrom(const Option& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Option* other);\n  protected:\n  explicit Option(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // string name = 1;\n  void clear_name();\n  static const int kNameFieldNumber = 1;\n  const ::std::string& name() const;\n  void set_name(const ::std::string& value);\n  #if LANG_CXX11\n  void set_name(::std::string&& value);\n  #endif\n  void set_name(const char* value);\n  void set_name(const char* value, size_t size);\n  ::std::string* mutable_name();\n  ::std::string* release_name();\n  void set_allocated_name(::std::string* name);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_name();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_name(\n      ::std::string* name);\n\n  // .google.protobuf.Any value = 2;\n  bool has_value() const;\n  void clear_value();\n  static const int kValueFieldNumber = 2;\n  private:\n  const ::google::protobuf::Any& _internal_value() const;\n  public:\n  const ::google::protobuf::Any& value() const;\n  ::google::protobuf::Any* release_value();\n  ::google::protobuf::Any* mutable_value();\n  void set_allocated_value(::google::protobuf::Any* value);\n  void unsafe_arena_set_allocated_value(\n      ::google::protobuf::Any* value);\n  ::google::protobuf::Any* unsafe_arena_release_value();\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Option)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::ArenaStringPtr name_;\n  ::google::protobuf::Any* value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2ftype_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// Type\n\n// string name = 1;\ninline void Type::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& Type::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Type.name)\n  return name_.Get();\n}\ninline void Type::set_name(const ::std::string& value) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.Type.name)\n}\n#if LANG_CXX11\ninline void Type::set_name(::std::string&& value) {\n  \n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Type.name)\n}\n#endif\ninline void Type::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Type.name)\n}\ninline void Type::set_name(const char* value,\n    size_t size) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Type.name)\n}\ninline ::std::string* Type::mutable_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Type.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* Type::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Type.name)\n  \n  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void Type::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.name)\n}\ninline ::std::string* Type::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Type.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void Type::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Type.name)\n}\n\n// repeated .google.protobuf.Field fields = 2;\ninline int Type::fields_size() const {\n  return fields_.size();\n}\ninline void Type::clear_fields() {\n  fields_.Clear();\n}\ninline ::google::protobuf::Field* Type::mutable_fields(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Type.fields)\n  return fields_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >*\nType::mutable_fields() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.fields)\n  return &fields_;\n}\ninline const ::google::protobuf::Field& Type::fields(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Type.fields)\n  return fields_.Get(index);\n}\ninline ::google::protobuf::Field* Type::add_fields() {\n  // @@protoc_insertion_point(field_add:google.protobuf.Type.fields)\n  return fields_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Field >&\nType::fields() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Type.fields)\n  return fields_;\n}\n\n// repeated string oneofs = 3;\ninline int Type::oneofs_size() const {\n  return oneofs_.size();\n}\ninline void Type::clear_oneofs() {\n  oneofs_.Clear();\n}\ninline const ::std::string& Type::oneofs(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Type.oneofs)\n  return oneofs_.Get(index);\n}\ninline ::std::string* Type::mutable_oneofs(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Type.oneofs)\n  return oneofs_.Mutable(index);\n}\ninline void Type::set_oneofs(int index, const ::std::string& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs)\n  oneofs_.Mutable(index)->assign(value);\n}\n#if LANG_CXX11\ninline void Type::set_oneofs(int index, ::std::string&& value) {\n  // @@protoc_insertion_point(field_set:google.protobuf.Type.oneofs)\n  oneofs_.Mutable(index)->assign(std::move(value));\n}\n#endif\ninline void Type::set_oneofs(int index, const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  oneofs_.Mutable(index)->assign(value);\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Type.oneofs)\n}\ninline void Type::set_oneofs(int index, const char* value, size_t size) {\n  oneofs_.Mutable(index)->assign(\n    reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Type.oneofs)\n}\ninline ::std::string* Type::add_oneofs() {\n  // @@protoc_insertion_point(field_add_mutable:google.protobuf.Type.oneofs)\n  return oneofs_.Add();\n}\ninline void Type::add_oneofs(const ::std::string& value) {\n  oneofs_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs)\n}\n#if LANG_CXX11\ninline void Type::add_oneofs(::std::string&& value) {\n  oneofs_.Add(std::move(value));\n  // @@protoc_insertion_point(field_add:google.protobuf.Type.oneofs)\n}\n#endif\ninline void Type::add_oneofs(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  oneofs_.Add()->assign(value);\n  // @@protoc_insertion_point(field_add_char:google.protobuf.Type.oneofs)\n}\ninline void Type::add_oneofs(const char* value, size_t size) {\n  oneofs_.Add()->assign(reinterpret_cast<const char*>(value), size);\n  // @@protoc_insertion_point(field_add_pointer:google.protobuf.Type.oneofs)\n}\ninline const ::google::protobuf::RepeatedPtrField< ::std::string>&\nType::oneofs() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Type.oneofs)\n  return oneofs_;\n}\ninline ::google::protobuf::RepeatedPtrField< ::std::string>*\nType::mutable_oneofs() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.oneofs)\n  return &oneofs_;\n}\n\n// repeated .google.protobuf.Option options = 4;\ninline int Type::options_size() const {\n  return options_.size();\n}\ninline void Type::clear_options() {\n  options_.Clear();\n}\ninline ::google::protobuf::Option* Type::mutable_options(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Type.options)\n  return options_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\nType::mutable_options() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Type.options)\n  return &options_;\n}\ninline const ::google::protobuf::Option& Type::options(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Type.options)\n  return options_.Get(index);\n}\ninline ::google::protobuf::Option* Type::add_options() {\n  // @@protoc_insertion_point(field_add:google.protobuf.Type.options)\n  return options_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\nType::options() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Type.options)\n  return options_;\n}\n\n// .google.protobuf.SourceContext source_context = 5;\ninline bool Type::has_source_context() const {\n  return this != internal_default_instance() && source_context_ != NULL;\n}\ninline const ::google::protobuf::SourceContext& Type::_internal_source_context() const {\n  return *source_context_;\n}\ninline const ::google::protobuf::SourceContext& Type::source_context() const {\n  const ::google::protobuf::SourceContext* p = source_context_;\n  // @@protoc_insertion_point(field_get:google.protobuf.Type.source_context)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::SourceContext*>(\n      &::google::protobuf::_SourceContext_default_instance_);\n}\ninline ::google::protobuf::SourceContext* Type::release_source_context() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Type.source_context)\n  \n  ::google::protobuf::SourceContext* temp = source_context_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  source_context_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::SourceContext* Type::unsafe_arena_release_source_context() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Type.source_context)\n  \n  ::google::protobuf::SourceContext* temp = source_context_;\n  source_context_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::SourceContext* Type::mutable_source_context() {\n  \n  if (source_context_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::SourceContext>(GetArenaNoVirtual());\n    source_context_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Type.source_context)\n  return source_context_;\n}\ninline void Type::set_allocated_source_context(::google::protobuf::SourceContext* source_context) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_context_);\n  }\n  if (source_context) {\n    ::google::protobuf::Arena* submessage_arena = NULL;\n    if (message_arena != submessage_arena) {\n      source_context = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, source_context, submessage_arena);\n    }\n    \n  } else {\n    \n  }\n  source_context_ = source_context;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.source_context)\n}\n\n// .google.protobuf.Syntax syntax = 6;\ninline void Type::clear_syntax() {\n  syntax_ = 0;\n}\ninline ::google::protobuf::Syntax Type::syntax() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Type.syntax)\n  return static_cast< ::google::protobuf::Syntax >(syntax_);\n}\ninline void Type::set_syntax(::google::protobuf::Syntax value) {\n  \n  syntax_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Type.syntax)\n}\n\n// -------------------------------------------------------------------\n\n// Field\n\n// .google.protobuf.Field.Kind kind = 1;\ninline void Field::clear_kind() {\n  kind_ = 0;\n}\ninline ::google::protobuf::Field_Kind Field::kind() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.kind)\n  return static_cast< ::google::protobuf::Field_Kind >(kind_);\n}\ninline void Field::set_kind(::google::protobuf::Field_Kind value) {\n  \n  kind_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Field.kind)\n}\n\n// .google.protobuf.Field.Cardinality cardinality = 2;\ninline void Field::clear_cardinality() {\n  cardinality_ = 0;\n}\ninline ::google::protobuf::Field_Cardinality Field::cardinality() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.cardinality)\n  return static_cast< ::google::protobuf::Field_Cardinality >(cardinality_);\n}\ninline void Field::set_cardinality(::google::protobuf::Field_Cardinality value) {\n  \n  cardinality_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Field.cardinality)\n}\n\n// int32 number = 3;\ninline void Field::clear_number() {\n  number_ = 0;\n}\ninline ::google::protobuf::int32 Field::number() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.number)\n  return number_;\n}\ninline void Field::set_number(::google::protobuf::int32 value) {\n  \n  number_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Field.number)\n}\n\n// string name = 4;\ninline void Field::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& Field::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.name)\n  return name_.Get();\n}\ninline void Field::set_name(const ::std::string& value) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.Field.name)\n}\n#if LANG_CXX11\ninline void Field::set_name(::std::string&& value) {\n  \n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Field.name)\n}\n#endif\ninline void Field::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Field.name)\n}\ninline void Field::set_name(const char* value,\n    size_t size) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.name)\n}\ninline ::std::string* Field::mutable_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Field.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* Field::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Field.name)\n  \n  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void Field::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.name)\n}\ninline ::std::string* Field::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void Field::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.name)\n}\n\n// string type_url = 6;\ninline void Field::clear_type_url() {\n  type_url_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& Field::type_url() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.type_url)\n  return type_url_.Get();\n}\ninline void Field::set_type_url(const ::std::string& value) {\n  \n  type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.Field.type_url)\n}\n#if LANG_CXX11\ninline void Field::set_type_url(::std::string&& value) {\n  \n  type_url_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Field.type_url)\n}\n#endif\ninline void Field::set_type_url(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Field.type_url)\n}\ninline void Field::set_type_url(const char* value,\n    size_t size) {\n  \n  type_url_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.type_url)\n}\ninline ::std::string* Field::mutable_type_url() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Field.type_url)\n  return type_url_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* Field::release_type_url() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Field.type_url)\n  \n  return type_url_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void Field::set_allocated_type_url(::std::string* type_url) {\n  if (type_url != NULL) {\n    \n  } else {\n    \n  }\n  type_url_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_url,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.type_url)\n}\ninline ::std::string* Field::unsafe_arena_release_type_url() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.type_url)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return type_url_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void Field::unsafe_arena_set_allocated_type_url(\n    ::std::string* type_url) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (type_url != NULL) {\n    \n  } else {\n    \n  }\n  type_url_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      type_url, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.type_url)\n}\n\n// int32 oneof_index = 7;\ninline void Field::clear_oneof_index() {\n  oneof_index_ = 0;\n}\ninline ::google::protobuf::int32 Field::oneof_index() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.oneof_index)\n  return oneof_index_;\n}\ninline void Field::set_oneof_index(::google::protobuf::int32 value) {\n  \n  oneof_index_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Field.oneof_index)\n}\n\n// bool packed = 8;\ninline void Field::clear_packed() {\n  packed_ = false;\n}\ninline bool Field::packed() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.packed)\n  return packed_;\n}\ninline void Field::set_packed(bool value) {\n  \n  packed_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Field.packed)\n}\n\n// repeated .google.protobuf.Option options = 9;\ninline int Field::options_size() const {\n  return options_.size();\n}\ninline void Field::clear_options() {\n  options_.Clear();\n}\ninline ::google::protobuf::Option* Field::mutable_options(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Field.options)\n  return options_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\nField::mutable_options() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Field.options)\n  return &options_;\n}\ninline const ::google::protobuf::Option& Field::options(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.options)\n  return options_.Get(index);\n}\ninline ::google::protobuf::Option* Field::add_options() {\n  // @@protoc_insertion_point(field_add:google.protobuf.Field.options)\n  return options_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\nField::options() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Field.options)\n  return options_;\n}\n\n// string json_name = 10;\ninline void Field::clear_json_name() {\n  json_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& Field::json_name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.json_name)\n  return json_name_.Get();\n}\ninline void Field::set_json_name(const ::std::string& value) {\n  \n  json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.Field.json_name)\n}\n#if LANG_CXX11\ninline void Field::set_json_name(::std::string&& value) {\n  \n  json_name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Field.json_name)\n}\n#endif\ninline void Field::set_json_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Field.json_name)\n}\ninline void Field::set_json_name(const char* value,\n    size_t size) {\n  \n  json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.json_name)\n}\ninline ::std::string* Field::mutable_json_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Field.json_name)\n  return json_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* Field::release_json_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Field.json_name)\n  \n  return json_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void Field::set_allocated_json_name(::std::string* json_name) {\n  if (json_name != NULL) {\n    \n  } else {\n    \n  }\n  json_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.json_name)\n}\ninline ::std::string* Field::unsafe_arena_release_json_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.json_name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return json_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void Field::unsafe_arena_set_allocated_json_name(\n    ::std::string* json_name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (json_name != NULL) {\n    \n  } else {\n    \n  }\n  json_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      json_name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.json_name)\n}\n\n// string default_value = 11;\ninline void Field::clear_default_value() {\n  default_value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& Field::default_value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Field.default_value)\n  return default_value_.Get();\n}\ninline void Field::set_default_value(const ::std::string& value) {\n  \n  default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.Field.default_value)\n}\n#if LANG_CXX11\ninline void Field::set_default_value(::std::string&& value) {\n  \n  default_value_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Field.default_value)\n}\n#endif\ninline void Field::set_default_value(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Field.default_value)\n}\ninline void Field::set_default_value(const char* value,\n    size_t size) {\n  \n  default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Field.default_value)\n}\ninline ::std::string* Field::mutable_default_value() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Field.default_value)\n  return default_value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* Field::release_default_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Field.default_value)\n  \n  return default_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void Field::set_allocated_default_value(::std::string* default_value) {\n  if (default_value != NULL) {\n    \n  } else {\n    \n  }\n  default_value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.default_value)\n}\ninline ::std::string* Field::unsafe_arena_release_default_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.default_value)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return default_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void Field::unsafe_arena_set_allocated_default_value(\n    ::std::string* default_value) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (default_value != NULL) {\n    \n  } else {\n    \n  }\n  default_value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      default_value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.default_value)\n}\n\n// -------------------------------------------------------------------\n\n// Enum\n\n// string name = 1;\ninline void Enum::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& Enum::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Enum.name)\n  return name_.Get();\n}\ninline void Enum::set_name(const ::std::string& value) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.Enum.name)\n}\n#if LANG_CXX11\ninline void Enum::set_name(::std::string&& value) {\n  \n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Enum.name)\n}\n#endif\ninline void Enum::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Enum.name)\n}\ninline void Enum::set_name(const char* value,\n    size_t size) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Enum.name)\n}\ninline ::std::string* Enum::mutable_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* Enum::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Enum.name)\n  \n  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void Enum::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.name)\n}\ninline ::std::string* Enum::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Enum.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void Enum::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Enum.name)\n}\n\n// repeated .google.protobuf.EnumValue enumvalue = 2;\ninline int Enum::enumvalue_size() const {\n  return enumvalue_.size();\n}\ninline void Enum::clear_enumvalue() {\n  enumvalue_.Clear();\n}\ninline ::google::protobuf::EnumValue* Enum::mutable_enumvalue(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.enumvalue)\n  return enumvalue_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >*\nEnum::mutable_enumvalue() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.enumvalue)\n  return &enumvalue_;\n}\ninline const ::google::protobuf::EnumValue& Enum::enumvalue(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Enum.enumvalue)\n  return enumvalue_.Get(index);\n}\ninline ::google::protobuf::EnumValue* Enum::add_enumvalue() {\n  // @@protoc_insertion_point(field_add:google.protobuf.Enum.enumvalue)\n  return enumvalue_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValue >&\nEnum::enumvalue() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Enum.enumvalue)\n  return enumvalue_;\n}\n\n// repeated .google.protobuf.Option options = 3;\ninline int Enum::options_size() const {\n  return options_.size();\n}\ninline void Enum::clear_options() {\n  options_.Clear();\n}\ninline ::google::protobuf::Option* Enum::mutable_options(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.options)\n  return options_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\nEnum::mutable_options() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.Enum.options)\n  return &options_;\n}\ninline const ::google::protobuf::Option& Enum::options(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Enum.options)\n  return options_.Get(index);\n}\ninline ::google::protobuf::Option* Enum::add_options() {\n  // @@protoc_insertion_point(field_add:google.protobuf.Enum.options)\n  return options_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\nEnum::options() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.Enum.options)\n  return options_;\n}\n\n// .google.protobuf.SourceContext source_context = 4;\ninline bool Enum::has_source_context() const {\n  return this != internal_default_instance() && source_context_ != NULL;\n}\ninline const ::google::protobuf::SourceContext& Enum::_internal_source_context() const {\n  return *source_context_;\n}\ninline const ::google::protobuf::SourceContext& Enum::source_context() const {\n  const ::google::protobuf::SourceContext* p = source_context_;\n  // @@protoc_insertion_point(field_get:google.protobuf.Enum.source_context)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::SourceContext*>(\n      &::google::protobuf::_SourceContext_default_instance_);\n}\ninline ::google::protobuf::SourceContext* Enum::release_source_context() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Enum.source_context)\n  \n  ::google::protobuf::SourceContext* temp = source_context_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  source_context_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::SourceContext* Enum::unsafe_arena_release_source_context() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Enum.source_context)\n  \n  ::google::protobuf::SourceContext* temp = source_context_;\n  source_context_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::SourceContext* Enum::mutable_source_context() {\n  \n  if (source_context_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::SourceContext>(GetArenaNoVirtual());\n    source_context_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Enum.source_context)\n  return source_context_;\n}\ninline void Enum::set_allocated_source_context(::google::protobuf::SourceContext* source_context) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_context_);\n  }\n  if (source_context) {\n    ::google::protobuf::Arena* submessage_arena = NULL;\n    if (message_arena != submessage_arena) {\n      source_context = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, source_context, submessage_arena);\n    }\n    \n  } else {\n    \n  }\n  source_context_ = source_context;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.source_context)\n}\n\n// .google.protobuf.Syntax syntax = 5;\ninline void Enum::clear_syntax() {\n  syntax_ = 0;\n}\ninline ::google::protobuf::Syntax Enum::syntax() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Enum.syntax)\n  return static_cast< ::google::protobuf::Syntax >(syntax_);\n}\ninline void Enum::set_syntax(::google::protobuf::Syntax value) {\n  \n  syntax_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Enum.syntax)\n}\n\n// -------------------------------------------------------------------\n\n// EnumValue\n\n// string name = 1;\ninline void EnumValue::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& EnumValue::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.name)\n  return name_.Get();\n}\ninline void EnumValue::set_name(const ::std::string& value) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumValue.name)\n}\n#if LANG_CXX11\ninline void EnumValue::set_name(::std::string&& value) {\n  \n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.EnumValue.name)\n}\n#endif\ninline void EnumValue::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.EnumValue.name)\n}\ninline void EnumValue::set_name(const char* value,\n    size_t size) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumValue.name)\n}\ninline ::std::string* EnumValue::mutable_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* EnumValue::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.EnumValue.name)\n  \n  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void EnumValue::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValue.name)\n}\ninline ::std::string* EnumValue::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValue.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void EnumValue::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValue.name)\n}\n\n// int32 number = 2;\ninline void EnumValue::clear_number() {\n  number_ = 0;\n}\ninline ::google::protobuf::int32 EnumValue::number() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.number)\n  return number_;\n}\ninline void EnumValue::set_number(::google::protobuf::int32 value) {\n  \n  number_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.EnumValue.number)\n}\n\n// repeated .google.protobuf.Option options = 3;\ninline int EnumValue::options_size() const {\n  return options_.size();\n}\ninline void EnumValue::clear_options() {\n  options_.Clear();\n}\ninline ::google::protobuf::Option* EnumValue::mutable_options(int index) {\n  // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValue.options)\n  return options_.Mutable(index);\n}\ninline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >*\nEnumValue::mutable_options() {\n  // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValue.options)\n  return &options_;\n}\ninline const ::google::protobuf::Option& EnumValue::options(int index) const {\n  // @@protoc_insertion_point(field_get:google.protobuf.EnumValue.options)\n  return options_.Get(index);\n}\ninline ::google::protobuf::Option* EnumValue::add_options() {\n  // @@protoc_insertion_point(field_add:google.protobuf.EnumValue.options)\n  return options_.Add();\n}\ninline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Option >&\nEnumValue::options() const {\n  // @@protoc_insertion_point(field_list:google.protobuf.EnumValue.options)\n  return options_;\n}\n\n// -------------------------------------------------------------------\n\n// Option\n\n// string name = 1;\ninline void Option::clear_name() {\n  name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& Option::name() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Option.name)\n  return name_.Get();\n}\ninline void Option::set_name(const ::std::string& value) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.Option.name)\n}\n#if LANG_CXX11\ninline void Option::set_name(::std::string&& value) {\n  \n  name_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.Option.name)\n}\n#endif\ninline void Option::set_name(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.Option.name)\n}\ninline void Option::set_name(const char* value,\n    size_t size) {\n  \n  name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.Option.name)\n}\ninline ::std::string* Option::mutable_name() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.Option.name)\n  return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* Option::release_name() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Option.name)\n  \n  return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void Option::set_allocated_name(::std::string* name) {\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.name)\n}\ninline ::std::string* Option::unsafe_arena_release_name() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Option.name)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void Option::unsafe_arena_set_allocated_name(\n    ::std::string* name) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (name != NULL) {\n    \n  } else {\n    \n  }\n  name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      name, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Option.name)\n}\n\n// .google.protobuf.Any value = 2;\ninline bool Option::has_value() const {\n  return this != internal_default_instance() && value_ != NULL;\n}\ninline const ::google::protobuf::Any& Option::_internal_value() const {\n  return *value_;\n}\ninline const ::google::protobuf::Any& Option::value() const {\n  const ::google::protobuf::Any* p = value_;\n  // @@protoc_insertion_point(field_get:google.protobuf.Option.value)\n  return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::Any*>(\n      &::google::protobuf::_Any_default_instance_);\n}\ninline ::google::protobuf::Any* Option::release_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.Option.value)\n  \n  ::google::protobuf::Any* temp = value_;\n  if (GetArenaNoVirtual() != NULL) {\n    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);\n  }\n  value_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::Any* Option::unsafe_arena_release_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Option.value)\n  \n  ::google::protobuf::Any* temp = value_;\n  value_ = NULL;\n  return temp;\n}\ninline ::google::protobuf::Any* Option::mutable_value() {\n  \n  if (value_ == NULL) {\n    auto* p = CreateMaybeMessage<::google::protobuf::Any>(GetArenaNoVirtual());\n    value_ = p;\n  }\n  // @@protoc_insertion_point(field_mutable:google.protobuf.Option.value)\n  return value_;\n}\ninline void Option::set_allocated_value(::google::protobuf::Any* value) {\n  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();\n  if (message_arena == NULL) {\n    delete reinterpret_cast< ::google::protobuf::MessageLite*>(value_);\n  }\n  if (value) {\n    ::google::protobuf::Arena* submessage_arena = NULL;\n    if (message_arena != submessage_arena) {\n      value = ::google::protobuf::internal::GetOwnedMessage(\n          message_arena, value, submessage_arena);\n    }\n    \n  } else {\n    \n  }\n  value_ = value;\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.value)\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\nnamespace google {\nnamespace protobuf {\n\ntemplate <> struct is_proto_enum< ::google::protobuf::Field_Kind> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::Field_Kind>() {\n  return ::google::protobuf::Field_Kind_descriptor();\n}\ntemplate <> struct is_proto_enum< ::google::protobuf::Field_Cardinality> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::Field_Cardinality>() {\n  return ::google::protobuf::Field_Cardinality_descriptor();\n}\ntemplate <> struct is_proto_enum< ::google::protobuf::Syntax> : ::std::true_type {};\ntemplate <>\ninline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::Syntax>() {\n  return ::google::protobuf::Syntax_descriptor();\n}\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2ftype_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/type.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/source_context.proto\";\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"TypeProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\noption go_package = \"google.golang.org/genproto/protobuf/ptype;ptype\";\n\n// A protocol buffer message type.\nmessage Type {\n  // The fully qualified message name.\n  string name = 1;\n  // The list of fields.\n  repeated Field fields = 2;\n  // The list of types appearing in `oneof` definitions in this type.\n  repeated string oneofs = 3;\n  // The protocol buffer options.\n  repeated Option options = 4;\n  // The source context.\n  SourceContext source_context = 5;\n  // The source syntax.\n  Syntax syntax = 6;\n}\n\n// A single field of a message type.\nmessage Field {\n  // Basic field types.\n  enum Kind {\n    // Field type unknown.\n    TYPE_UNKNOWN        = 0;\n    // Field type double.\n    TYPE_DOUBLE         = 1;\n    // Field type float.\n    TYPE_FLOAT          = 2;\n    // Field type int64.\n    TYPE_INT64          = 3;\n    // Field type uint64.\n    TYPE_UINT64         = 4;\n    // Field type int32.\n    TYPE_INT32          = 5;\n    // Field type fixed64.\n    TYPE_FIXED64        = 6;\n    // Field type fixed32.\n    TYPE_FIXED32        = 7;\n    // Field type bool.\n    TYPE_BOOL           = 8;\n    // Field type string.\n    TYPE_STRING         = 9;\n    // Field type group. Proto2 syntax only, and deprecated.\n    TYPE_GROUP          = 10;\n    // Field type message.\n    TYPE_MESSAGE        = 11;\n    // Field type bytes.\n    TYPE_BYTES          = 12;\n    // Field type uint32.\n    TYPE_UINT32         = 13;\n    // Field type enum.\n    TYPE_ENUM           = 14;\n    // Field type sfixed32.\n    TYPE_SFIXED32       = 15;\n    // Field type sfixed64.\n    TYPE_SFIXED64       = 16;\n    // Field type sint32.\n    TYPE_SINT32         = 17;\n    // Field type sint64.\n    TYPE_SINT64         = 18;\n  };\n\n  // Whether a field is optional, required, or repeated.\n  enum Cardinality {\n    // For fields with unknown cardinality.\n    CARDINALITY_UNKNOWN = 0;\n    // For optional fields.\n    CARDINALITY_OPTIONAL = 1;\n    // For required fields. Proto2 syntax only.\n    CARDINALITY_REQUIRED = 2;\n    // For repeated fields.\n    CARDINALITY_REPEATED = 3;\n  };\n\n  // The field type.\n  Kind kind = 1;\n  // The field cardinality.\n  Cardinality cardinality = 2;\n  // The field number.\n  int32 number = 3;\n  // The field name.\n  string name = 4;\n  // The field type URL, without the scheme, for message or enumeration\n  // types. Example: `\"type.googleapis.com/google.protobuf.Timestamp\"`.\n  string type_url = 6;\n  // The index of the field type in `Type.oneofs`, for message or enumeration\n  // types. The first type has index 1; zero means the type is not in the list.\n  int32 oneof_index = 7;\n  // Whether to use alternative packed wire representation.\n  bool packed = 8;\n  // The protocol buffer options.\n  repeated Option options = 9;\n  // The field JSON name.\n  string json_name = 10;\n  // The string value of the default value of this field. Proto2 syntax only.\n  string default_value = 11;\n}\n\n// Enum type definition.\nmessage Enum {\n  // Enum type name.\n  string name = 1;\n  // Enum value definitions.\n  repeated EnumValue enumvalue = 2;\n  // Protocol buffer options.\n  repeated Option options = 3;\n  // The source context.\n  SourceContext source_context = 4;\n  // The source syntax.\n  Syntax syntax = 5;\n}\n\n// Enum value definition.\nmessage EnumValue {\n  // Enum value name.\n  string name = 1;\n  // Enum value number.\n  int32 number = 2;\n  // Protocol buffer options.\n  repeated Option options = 3;\n}\n\n// A protocol buffer option, which can be attached to a message, field,\n// enumeration, etc.\nmessage Option {\n  // The option's name. For protobuf built-in options (options defined in\n  // descriptor.proto), this is the short name. For example, `\"map_entry\"`.\n  // For custom options, it should be the fully-qualified name. For example,\n  // `\"google.api.http\"`.\n  string name = 1;\n  // The option's value packed in an Any message. If the value is a primitive,\n  // the corresponding wrapper type defined in google/protobuf/wrappers.proto\n  // should be used. If the value is an enum, it should be stored as an int32\n  // value using the google.protobuf.Int32Value type.\n  Any value = 2;\n}\n\n// The syntax in which a protocol buffer element is defined.\nenum Syntax {\n  // Syntax `proto2`.\n  SYNTAX_PROTO2 = 0;\n  // Syntax `proto3`.\n  SYNTAX_PROTO3 = 1;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/unknown_field_set.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// Contains classes used to keep track of unrecognized fields seen while\n// parsing a protocol message.\n\n#ifndef GOOGLE_PROTOBUF_UNKNOWN_FIELD_SET_H__\n#define GOOGLE_PROTOBUF_UNKNOWN_FIELD_SET_H__\n\n#include <assert.h>\n#include <string>\n#include <vector>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/logging.h>\n#include <google/protobuf/message_lite.h>\n\nnamespace google {\nnamespace protobuf {\n  namespace io {\n    class CodedInputStream;         // coded_stream.h\n    class CodedOutputStream;        // coded_stream.h\n    class ZeroCopyInputStream;      // zero_copy_stream.h\n  }\n  namespace internal {\n    class InternalMetadataWithArena;  // metadata.h\n    class WireFormat;               // wire_format.h\n    class MessageSetFieldSkipperUsingCord;\n                                    // extension_set_heavy.cc\n  }\n\nclass Message;                      // message.h\nclass UnknownField;                 // below\n\n// An UnknownFieldSet contains fields that were encountered while parsing a\n// message but were not defined by its type.  Keeping track of these can be\n// useful, especially in that they may be written if the message is serialized\n// again without being cleared in between.  This means that software which\n// simply receives messages and forwards them to other servers does not need\n// to be updated every time a new field is added to the message definition.\n//\n// To get the UnknownFieldSet attached to any message, call\n// Reflection::GetUnknownFields().\n//\n// This class is necessarily tied to the protocol buffer wire format, unlike\n// the Reflection interface which is independent of any serialization scheme.\nclass LIBPROTOBUF_EXPORT UnknownFieldSet {\n public:\n  UnknownFieldSet();\n  ~UnknownFieldSet();\n\n  // Remove all fields.\n  inline void Clear();\n\n  // Remove all fields and deallocate internal data objects\n  void ClearAndFreeMemory();\n\n  // Is this set empty?\n  inline bool empty() const;\n\n  // Merge the contents of some other UnknownFieldSet with this one.\n  void MergeFrom(const UnknownFieldSet& other);\n\n  // Similar to above, but this function will destroy the contents of other.\n  void MergeFromAndDestroy(UnknownFieldSet* other);\n\n  // Merge the contents an UnknownFieldSet with the UnknownFieldSet in\n  // *metadata, if there is one.  If *metadata doesn't have an UnknownFieldSet\n  // then add one to it and make it be a copy of the first arg.\n  static void MergeToInternalMetdata(\n      const UnknownFieldSet& other,\n      internal::InternalMetadataWithArena* metadata);\n\n  // Swaps the contents of some other UnknownFieldSet with this one.\n  inline void Swap(UnknownFieldSet* x);\n\n  // Computes (an estimate of) the total number of bytes currently used for\n  // storing the unknown fields in memory. Does NOT include\n  // sizeof(*this) in the calculation.\n  size_t SpaceUsedExcludingSelfLong() const;\n\n  int SpaceUsedExcludingSelf() const {\n    return internal::ToIntSize(SpaceUsedExcludingSelfLong());\n  }\n\n  // Version of SpaceUsed() including sizeof(*this).\n  size_t SpaceUsedLong() const;\n\n  int SpaceUsed() const {\n    return internal::ToIntSize(SpaceUsedLong());\n  }\n\n  // Returns the number of fields present in the UnknownFieldSet.\n  inline int field_count() const;\n  // Get a field in the set, where 0 <= index < field_count().  The fields\n  // appear in the order in which they were added.\n  inline const UnknownField& field(int index) const;\n  // Get a mutable pointer to a field in the set, where\n  // 0 <= index < field_count().  The fields appear in the order in which\n  // they were added.\n  inline UnknownField* mutable_field(int index);\n\n  // Adding fields ---------------------------------------------------\n\n  void AddVarint(int number, uint64 value);\n  void AddFixed32(int number, uint32 value);\n  void AddFixed64(int number, uint64 value);\n  void AddLengthDelimited(int number, const string& value);\n  string* AddLengthDelimited(int number);\n  UnknownFieldSet* AddGroup(int number);\n\n  // Adds an unknown field from another set.\n  void AddField(const UnknownField& field);\n\n  // Delete fields with indices in the range [start .. start+num-1].\n  // Caution: implementation moves all fields with indices [start+num .. ].\n  void DeleteSubrange(int start, int num);\n\n  // Delete all fields with a specific field number. The order of left fields\n  // is preserved.\n  // Caution: implementation moves all fields after the first deleted field.\n  void DeleteByNumber(int number);\n\n  // Parsing helpers -------------------------------------------------\n  // These work exactly like the similarly-named methods of Message.\n\n  bool MergeFromCodedStream(io::CodedInputStream* input);\n  bool ParseFromCodedStream(io::CodedInputStream* input);\n  bool ParseFromZeroCopyStream(io::ZeroCopyInputStream* input);\n  bool ParseFromArray(const void* data, int size);\n  inline bool ParseFromString(const string& data) {\n    return ParseFromArray(data.data(), static_cast<int>(data.size()));\n  }\n\n  static const UnknownFieldSet* default_instance();\n private:\n  // For InternalMergeFrom\n  friend class UnknownField;\n  // Merges from other UnknownFieldSet. This method assumes, that this object\n  // is newly created and has fields_ == NULL;\n  void InternalMergeFrom(const UnknownFieldSet& other);\n  void ClearFallback();\n\n  // fields_ is either NULL, or a pointer to a vector that is *non-empty*. We\n  // never hold the empty vector because we want the 'do we have any unknown\n  // fields' check to be fast, and avoid a cache miss: the UFS instance gets\n  // embedded in the message object, so 'fields_ != NULL' tests a member\n  // variable hot in the cache, without the need to go touch a vector somewhere\n  // else in memory.\n  std::vector<UnknownField>* fields_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(UnknownFieldSet);\n};\n\n// Represents one field in an UnknownFieldSet.\nclass LIBPROTOBUF_EXPORT UnknownField {\n public:\n  enum Type {\n    TYPE_VARINT,\n    TYPE_FIXED32,\n    TYPE_FIXED64,\n    TYPE_LENGTH_DELIMITED,\n    TYPE_GROUP\n  };\n\n  // The field's field number, as seen on the wire.\n  inline int number() const;\n\n  // The field type.\n  inline Type type() const;\n\n  // Accessors -------------------------------------------------------\n  // Each method works only for UnknownFields of the corresponding type.\n\n  inline uint64 varint() const;\n  inline uint32 fixed32() const;\n  inline uint64 fixed64() const;\n  inline const string& length_delimited() const;\n  inline const UnknownFieldSet& group() const;\n\n  inline void set_varint(uint64 value);\n  inline void set_fixed32(uint32 value);\n  inline void set_fixed64(uint64 value);\n  inline void set_length_delimited(const string& value);\n  inline string* mutable_length_delimited();\n  inline UnknownFieldSet* mutable_group();\n\n  // Serialization API.\n  // These methods can take advantage of the underlying implementation and may\n  // archieve a better performance than using getters to retrieve the data and\n  // do the serialization yourself.\n  void SerializeLengthDelimitedNoTag(io::CodedOutputStream* output) const;\n  uint8* SerializeLengthDelimitedNoTagToArray(uint8* target) const;\n\n  inline size_t GetLengthDelimitedSize() const;\n\n\n  // If this UnknownField contains a pointer, delete it.\n  void Delete();\n\n  // Reset all the underlying pointers to NULL. A special function to be only\n  // used while merging from a temporary UFS.\n  void Reset();\n\n  // Make a deep copy of any pointers in this UnknownField.\n  void DeepCopy(const UnknownField& other);\n\n  // Set the wire type of this UnknownField. Should only be used when this\n  // UnknownField is being created.\n  inline void SetType(Type type);\n\n  union LengthDelimited {\n    string* string_value_;\n  };\n\n  uint32 number_;\n  uint32 type_;\n  union {\n    uint64 varint_;\n    uint32 fixed32_;\n    uint64 fixed64_;\n    mutable union LengthDelimited length_delimited_;\n    UnknownFieldSet* group_;\n  } data_;\n};\n\n// ===================================================================\n// inline implementations\n\ninline UnknownFieldSet::UnknownFieldSet() : fields_(NULL) {}\n\ninline UnknownFieldSet::~UnknownFieldSet() { Clear(); }\n\ninline void UnknownFieldSet::ClearAndFreeMemory() { Clear(); }\n\ninline void UnknownFieldSet::Clear() {\n  if (fields_ != NULL) {\n    ClearFallback();\n  }\n}\n\ninline bool UnknownFieldSet::empty() const {\n  // Invariant: fields_ is never empty if present.\n  return !fields_;\n}\n\ninline void UnknownFieldSet::Swap(UnknownFieldSet* x) {\n  std::swap(fields_, x->fields_);\n}\n\ninline int UnknownFieldSet::field_count() const {\n  return fields_ ? static_cast<int>(fields_->size()) : 0;\n}\ninline const UnknownField& UnknownFieldSet::field(int index) const {\n  GOOGLE_DCHECK(fields_ != NULL);\n  return (*fields_)[static_cast<size_t>(index)];\n}\ninline UnknownField* UnknownFieldSet::mutable_field(int index) {\n  return &(*fields_)[static_cast<size_t>(index)];\n}\n\ninline void UnknownFieldSet::AddLengthDelimited(\n    int number, const string& value) {\n  AddLengthDelimited(number)->assign(value);\n}\n\n\n\n\ninline int UnknownField::number() const { return static_cast<int>(number_); }\ninline UnknownField::Type UnknownField::type() const {\n  return static_cast<Type>(type_);\n}\n\ninline uint64 UnknownField::varint() const {\n  assert(type() == TYPE_VARINT);\n  return data_.varint_;\n}\ninline uint32 UnknownField::fixed32() const {\n  assert(type() == TYPE_FIXED32);\n  return data_.fixed32_;\n}\ninline uint64 UnknownField::fixed64() const {\n  assert(type() == TYPE_FIXED64);\n  return data_.fixed64_;\n}\ninline const string& UnknownField::length_delimited() const {\n  assert(type() == TYPE_LENGTH_DELIMITED);\n  return *data_.length_delimited_.string_value_;\n}\ninline const UnknownFieldSet& UnknownField::group() const {\n  assert(type() == TYPE_GROUP);\n  return *data_.group_;\n}\n\ninline void UnknownField::set_varint(uint64 value) {\n  assert(type() == TYPE_VARINT);\n  data_.varint_ = value;\n}\ninline void UnknownField::set_fixed32(uint32 value) {\n  assert(type() == TYPE_FIXED32);\n  data_.fixed32_ = value;\n}\ninline void UnknownField::set_fixed64(uint64 value) {\n  assert(type() == TYPE_FIXED64);\n  data_.fixed64_ = value;\n}\ninline void UnknownField::set_length_delimited(const string& value) {\n  assert(type() == TYPE_LENGTH_DELIMITED);\n  data_.length_delimited_.string_value_->assign(value);\n}\ninline string* UnknownField::mutable_length_delimited() {\n  assert(type() == TYPE_LENGTH_DELIMITED);\n  return data_.length_delimited_.string_value_;\n}\ninline UnknownFieldSet* UnknownField::mutable_group() {\n  assert(type() == TYPE_GROUP);\n  return data_.group_;\n}\n\ninline size_t UnknownField::GetLengthDelimitedSize() const {\n  GOOGLE_DCHECK_EQ(TYPE_LENGTH_DELIMITED, type());\n  return data_.length_delimited_.string_value_->size();\n}\n\ninline void UnknownField::SetType(Type type) {\n  type_ = type;\n}\n\n\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_UNKNOWN_FIELD_SET_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/util/delimited_message_util.h",
    "content": "// Adapted from the patch of kenton@google.com (Kenton Varda)\n// See https://github.com/google/protobuf/pull/710 for details.\n\n#ifndef GOOGLE_PROTOBUF_UTIL_DELIMITED_MESSAGE_UTIL_H__\n#define GOOGLE_PROTOBUF_UTIL_DELIMITED_MESSAGE_UTIL_H__\n\n#include <ostream>\n\n#include <google/protobuf/message_lite.h>\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/io/zero_copy_stream_impl.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace util {\n\n// Write a single size-delimited message from the given stream. Delimited\n// format allows a single file or stream to contain multiple messages,\n// whereas normally writing multiple non-delimited messages to the same\n// stream would cause them to be merged. A delimited message is a varint\n// encoding the message size followed by a message of exactly that size.\n//\n// Note that if you want to *read* a delimited message from a file descriptor\n// or istream, you will need to construct an io::FileInputStream or\n// io::OstreamInputStream (implementations of io::ZeroCopyStream) and use the\n// utility function ParseDelimitedFromZeroCopyStream(). You must then\n// continue to use the same ZeroCopyInputStream to read all further data from\n// the stream until EOF. This is because these ZeroCopyInputStream\n// implementations are buffered: they read a big chunk of data at a time,\n// then parse it. As a result, they may read past the end of the delimited\n// message. There is no way for them to push the extra data back into the\n// underlying source, so instead you must keep using the same stream object.\nbool LIBPROTOBUF_EXPORT SerializeDelimitedToFileDescriptor(const MessageLite& message, int file_descriptor);\n\nbool LIBPROTOBUF_EXPORT SerializeDelimitedToOstream(const MessageLite& message, std::ostream* output);\n\n// Read a single size-delimited message from the given stream. Delimited\n// format allows a single file or stream to contain multiple messages,\n// whereas normally parsing consumes the entire input. A delimited message\n// is a varint encoding the message size followed by a message of exactly\n// that size.\n//\n// If |clean_eof| is not NULL, then it will be set to indicate whether the\n// stream ended cleanly. That is, if the stream ends without this method\n// having read any data at all from it, then *clean_eof will be set true,\n// otherwise it will be set false. Note that these methods return false\n// on EOF, but they also return false on other errors, so |clean_eof| is\n// needed to distinguish a clean end from errors.\nbool LIBPROTOBUF_EXPORT ParseDelimitedFromZeroCopyStream(MessageLite* message, io::ZeroCopyInputStream* input, bool* clean_eof);\n\nbool LIBPROTOBUF_EXPORT ParseDelimitedFromCodedStream(MessageLite* message, io::CodedInputStream* input, bool* clean_eof);\n\n// Write a single size-delimited message from the given stream. Delimited\n// format allows a single file or stream to contain multiple messages,\n// whereas normally writing multiple non-delimited messages to the same\n// stream would cause them to be merged. A delimited message is a varint\n// encoding the message size followed by a message of exactly that size.\nbool LIBPROTOBUF_EXPORT SerializeDelimitedToZeroCopyStream(const MessageLite& message, io::ZeroCopyOutputStream* output);\n\nbool LIBPROTOBUF_EXPORT SerializeDelimitedToCodedStream(const MessageLite& message, io::CodedOutputStream* output);\n\n}  // namespace util\n}  // namespace protobuf\n}  // namespace google\n\n#endif  // GOOGLE_PROTOBUF_UTIL_DELIMITED_MESSAGE_UTIL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/util/field_comparator.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Defines classes for field comparison.\n\n#ifndef GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__\n#define GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__\n\n#include <map>\n#include <string>\n#include <vector>\n\n#include <google/protobuf/stubs/common.h>\n\nnamespace google {\nnamespace protobuf {\n\nclass Message;\nclass EnumValueDescriptor;\nclass FieldDescriptor;\n\nnamespace util {\n\nclass FieldContext;\nclass MessageDifferencer;\n\n// Base class specifying the interface for comparing protocol buffer fields.\n// Regular users should consider using or subclassing DefaultFieldComparator\n// rather than this interface.\n// Currently, this does not support comparing unknown fields.\nclass LIBPROTOBUF_EXPORT FieldComparator {\n public:\n  FieldComparator();\n  virtual ~FieldComparator();\n\n  enum ComparisonResult {\n    SAME,       // Compared fields are equal. In case of comparing submessages,\n                // user should not recursively compare their contents.\n    DIFFERENT,  // Compared fields are different. In case of comparing\n                // submessages, user should not recursively compare their\n                // contents.\n    RECURSE,    // Compared submessages need to be compared recursively.\n                // FieldComparator does not specify the semantics of recursive\n                // comparison. This value should not be returned for simple\n                // values.\n  };\n\n  // Compares the values of a field in two protocol buffer messages.\n  // Returns SAME or DIFFERENT for simple values, and SAME, DIFFERENT or RECURSE\n  // for submessages. Returning RECURSE for fields not being submessages is\n  // illegal.\n  // In case the given FieldDescriptor points to a repeated field, the indices\n  // need to be valid. Otherwise they should be ignored.\n  //\n  // FieldContext contains information about the specific instances of the\n  // fields being compared, versus FieldDescriptor which only contains general\n  // type information about the fields.\n  virtual ComparisonResult Compare(\n      const google::protobuf::Message& message_1,\n      const google::protobuf::Message& message_2,\n      const google::protobuf::FieldDescriptor* field,\n      int index_1, int index_2,\n      const google::protobuf::util::FieldContext* field_context) = 0;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldComparator);\n};\n\n// Basic implementation of FieldComparator.  Supports three modes of floating\n// point value comparison: exact, approximate using MathUtil::AlmostEqual\n// method, and arbitrarily precise using MathUtil::WithinFractionOrMargin.\nclass LIBPROTOBUF_EXPORT DefaultFieldComparator : public FieldComparator {\n public:\n  enum FloatComparison {\n     EXACT,               // Floats and doubles are compared exactly.\n     APPROXIMATE,         // Floats and doubles are compared using the\n                          // MathUtil::AlmostEqual method or\n                          // MathUtil::WithinFractionOrMargin method.\n     // TODO(ksroka): Introduce third value to differenciate uses of AlmostEqual\n     //               and WithinFractionOrMargin.\n  };\n\n  // Creates new comparator with float comparison set to EXACT.\n  DefaultFieldComparator();\n\n  virtual ~DefaultFieldComparator();\n\n  virtual ComparisonResult Compare(\n      const google::protobuf::Message& message_1,\n      const google::protobuf::Message& message_2,\n      const google::protobuf::FieldDescriptor* field,\n      int index_1, int index_2,\n      const google::protobuf::util::FieldContext* field_context);\n\n  void set_float_comparison(FloatComparison float_comparison) {\n    float_comparison_ = float_comparison;\n  }\n\n  FloatComparison float_comparison() const {\n    return float_comparison_;\n  }\n\n  // Set whether the FieldComparator shall treat floats or doubles that are both\n  // NaN as equal (treat_nan_as_equal = true) or as different\n  // (treat_nan_as_equal = false). Default is treating NaNs always as different.\n  void set_treat_nan_as_equal(bool treat_nan_as_equal) {\n    treat_nan_as_equal_ = treat_nan_as_equal;\n  }\n\n  bool treat_nan_as_equal() const {\n    return treat_nan_as_equal_;\n  }\n\n  // Sets the fraction and margin for the float comparison of a given field.\n  // Uses MathUtil::WithinFractionOrMargin to compare the values.\n  //\n  // REQUIRES: field->cpp_type == FieldDescriptor::CPPTYPE_DOUBLE or\n  //           field->cpp_type == FieldDescriptor::CPPTYPE_FLOAT\n  // REQUIRES: float_comparison_ == APPROXIMATE\n  void SetFractionAndMargin(const FieldDescriptor* field, double fraction,\n                            double margin);\n\n  // Sets the fraction and margin for the float comparison of all float and\n  // double fields, unless a field has been given a specific setting via\n  // SetFractionAndMargin() above.\n  // Uses MathUtil::WithinFractionOrMargin to compare the values.\n  //\n  // REQUIRES: float_comparison_ == APPROXIMATE\n  void SetDefaultFractionAndMargin(double fraction, double margin);\n\n protected:\n  // Compare using the provided message_differencer. For example, a subclass can\n  // use this method to compare some field in a certain way using the same\n  // message_differencer instance and the field context.\n  bool Compare(MessageDifferencer* differencer,\n               const google::protobuf::Message& message1,\n               const google::protobuf::Message& message2,\n               const google::protobuf::util::FieldContext* field_context);\n\n private:\n  // Defines the tolerance for floating point comparison (fraction and margin).\n  struct Tolerance {\n    double fraction;\n    double margin;\n    Tolerance()\n        : fraction(0.0),\n          margin(0.0) {}\n    Tolerance(double f, double m)\n        : fraction(f),\n          margin(m) {}\n  };\n\n  // Defines the map to store the tolerances for floating point comparison.\n  typedef std::map<const FieldDescriptor*, Tolerance> ToleranceMap;\n\n  // The following methods get executed when CompareFields is called for the\n  // basic types (instead of submessages). They return true on success. One\n  // can use ResultFromBoolean() to convert that boolean to a ComparisonResult\n  // value.\n  bool CompareBool(const google::protobuf::FieldDescriptor& field,\n                   bool value_1, bool value_2) {\n    return value_1 == value_2;\n  }\n\n  // Uses CompareDoubleOrFloat, a helper function used by both CompareDouble and\n  // CompareFloat.\n  bool CompareDouble(const google::protobuf::FieldDescriptor& field,\n                     double value_1, double value_2);\n\n  bool CompareEnum(const google::protobuf::FieldDescriptor& field,\n                   const EnumValueDescriptor* value_1,\n                   const EnumValueDescriptor* value_2);\n\n  // Uses CompareDoubleOrFloat, a helper function used by both CompareDouble and\n  // CompareFloat.\n  bool CompareFloat(const google::protobuf::FieldDescriptor& field,\n                    float value_1, float value_2);\n\n  bool CompareInt32(const google::protobuf::FieldDescriptor& field,\n                    int32 value_1, int32 value_2) {\n    return value_1 == value_2;\n  }\n\n  bool CompareInt64(const google::protobuf::FieldDescriptor& field,\n                    int64 value_1, int64 value_2) {\n    return value_1 == value_2;\n  }\n\n  bool CompareString(const google::protobuf::FieldDescriptor& field,\n                     const string& value_1, const string& value_2) {\n    return value_1 == value_2;\n  }\n\n  bool CompareUInt32(const google::protobuf::FieldDescriptor& field,\n                     uint32 value_1, uint32 value_2) {\n    return value_1 == value_2;\n  }\n\n  bool CompareUInt64(const google::protobuf::FieldDescriptor& field,\n                     uint64 value_1, uint64 value_2) {\n    return value_1 == value_2;\n  }\n\n  // This function is used by CompareDouble and CompareFloat to avoid code\n  // duplication. There are no checks done against types of the values passed,\n  // but it's likely to fail if passed non-numeric arguments.\n  template<typename T>\n  bool CompareDoubleOrFloat(const google::protobuf::FieldDescriptor& field,\n                            T value_1, T value_2);\n\n  // Returns FieldComparator::SAME if boolean_result is true and\n  // FieldComparator::DIFFERENT otherwise.\n  ComparisonResult ResultFromBoolean(bool boolean_result) const;\n\n  FloatComparison float_comparison_;\n\n  // If true, floats and doubles that are both NaN are considered to be\n  // equal. Otherwise, two floats or doubles that are NaN are considered to be\n  // different.\n  bool treat_nan_as_equal_;\n\n  // True iff default_tolerance_ has been explicitly set.\n  //\n  // If false, then the default tolerance for floats and doubles is that which\n  // is used by MathUtil::AlmostEquals().\n  bool has_default_tolerance_;\n\n  // Default float/double tolerance. Only meaningful if\n  // has_default_tolerance_ == true.\n  Tolerance default_tolerance_;\n\n  // Field-specific float/double tolerances, which override any default for\n  // those particular fields.\n  ToleranceMap map_tolerance_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(DefaultFieldComparator);\n};\n\n}  // namespace util\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/util/field_mask_util.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Defines utilities for the FieldMask well known type.\n\n#ifndef GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__\n#define GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__\n\n#include <string>\n\n#include <google/protobuf/descriptor.h>\n#include <google/protobuf/field_mask.pb.h>\n#include <google/protobuf/stubs/stringpiece.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace util {\n\nclass LIBPROTOBUF_EXPORT FieldMaskUtil {\n  typedef google::protobuf::FieldMask FieldMask;\n\n public:\n  // Converts FieldMask to/from string, formatted by separating each path\n  // with a comma (e.g., \"foo_bar,baz.quz\").\n  static string ToString(const FieldMask& mask);\n  static void FromString(StringPiece str, FieldMask* out);\n\n  // Converts FieldMask to/from string, formatted according to proto3 JSON\n  // spec for FieldMask (e.g., \"fooBar,baz.quz\"). If the field name is not\n  // style conforming (i.e., not snake_case when converted to string, or not\n  // camelCase when converted from string), the conversion will fail.\n  static bool ToJsonString(const FieldMask& mask, string* out);\n  static bool FromJsonString(StringPiece str, FieldMask* out);\n\n  // Get the descriptors of the fields which the given path from the message\n  // descriptor traverses, if field_descriptors is not null.\n  // Return false if the path is not valid, and the content of field_descriptors\n  // is unspecified.\n  static bool GetFieldDescriptors(\n      const Descriptor* descriptor, StringPiece path,\n      std::vector<const FieldDescriptor*>* field_descriptors);\n\n  // Checks whether the given path is valid for type T.\n  template <typename T>\n  static bool IsValidPath(StringPiece path) {\n    return GetFieldDescriptors(T::descriptor(), path, nullptr);\n  }\n\n  // Checks whether the given FieldMask is valid for type T.\n  template <typename T>\n  static bool IsValidFieldMask(const FieldMask& mask) {\n    for (int i = 0; i < mask.paths_size(); ++i) {\n      if (!GetFieldDescriptors(T::descriptor(), mask.paths(i), nullptr))\n        return false;\n    }\n    return true;\n  }\n\n  // Adds a path to FieldMask after checking whether the given path is valid.\n  // This method check-fails if the path is not a valid path for type T.\n  template <typename T>\n  static void AddPathToFieldMask(StringPiece path, FieldMask* mask) {\n    GOOGLE_CHECK(IsValidPath<T>(path));\n    mask->add_paths(path);\n  }\n\n  // Creates a FieldMask with all fields of type T. This FieldMask only\n  // contains fields of T but not any sub-message fields.\n  template <typename T>\n  static FieldMask GetFieldMaskForAllFields() {\n    FieldMask out;\n    InternalGetFieldMaskForAllFields(T::descriptor(), &out);\n    return out;\n  }\n  template <typename T>\n  PROTOBUF_RUNTIME_DEPRECATED(\"Use *out = GetFieldMaskForAllFields() instead\")\n  static void GetFieldMaskForAllFields(FieldMask* out) {\n    InternalGetFieldMaskForAllFields(T::descriptor(), out);\n  }\n\n  // Converts a FieldMask to the canonical form. It will:\n  //   1. Remove paths that are covered by another path. For example,\n  //      \"foo.bar\" is covered by \"foo\" and will be removed if \"foo\"\n  //      is also in the FieldMask.\n  //   2. Sort all paths in alphabetical order.\n  static void ToCanonicalForm(const FieldMask& mask, FieldMask* out);\n\n  // Creates an union of two FieldMasks.\n  static void Union(const FieldMask& mask1, const FieldMask& mask2,\n                    FieldMask* out);\n\n  // Creates an intersection of two FieldMasks.\n  static void Intersect(const FieldMask& mask1, const FieldMask& mask2,\n                        FieldMask* out);\n\n  // Subtracts mask2 from mask1 base of type T.\n  template <typename T>\n  static void Subtract(const FieldMask& mask1, const FieldMask& mask2,\n                       FieldMask* out) {\n    InternalSubtract(T::descriptor(), mask1, mask2, out);\n  }\n\n  // Returns true if path is covered by the given FieldMask. Note that path\n  // \"foo.bar\" covers all paths like \"foo.bar.baz\", \"foo.bar.quz.x\", etc.\n  // Also note that parent paths are not covered by explicit child path, i.e.\n  // \"foo.bar\" does NOT cover \"foo\", even if \"bar\" is the only child.\n  static bool IsPathInFieldMask(StringPiece path, const FieldMask& mask);\n\n  class MergeOptions;\n  // Merges fields specified in a FieldMask into another message. See the\n  // comments in MergeOptions regarding compatibility with\n  // google/protobuf/field_mask.proto\n  static void MergeMessageTo(const Message& source, const FieldMask& mask,\n                             const MergeOptions& options, Message* destination);\n\n  class TrimOptions;\n  // Removes from 'message' any field that is not represented in the given\n  // FieldMask. If the FieldMask is empty, does nothing.\n  static void TrimMessage(const FieldMask& mask, Message* message);\n\n  // Removes from 'message' any field that is not represented in the given\n  // FieldMask with customized TrimOptions.\n  // If the FieldMask is empty, does nothing.\n  static void TrimMessage(const FieldMask& mask, Message* message,\n                          const TrimOptions& options);\n\n private:\n  friend class SnakeCaseCamelCaseTest;\n  // Converts a field name from snake_case to camelCase:\n  //   1. Every character after \"_\" will be converted to uppercase.\n  //   2. All \"_\"s are removed.\n  // The conversion will fail if:\n  //   1. The field name contains uppercase letters.\n  //   2. Any character after a \"_\" is not a lowercase letter.\n  // If the conversion succeeds, it's guaranteed that the resulted\n  // camelCase name will yield the original snake_case name when\n  // converted using CamelCaseToSnakeCase().\n  //\n  // Note that the input can contain characters not allowed in C identifiers.\n  // For example, \"foo_bar,baz_quz\" will be converted to \"fooBar,bazQuz\"\n  // successfully.\n  static bool SnakeCaseToCamelCase(StringPiece input, string* output);\n  // Converts a field name from camelCase to snake_case:\n  //   1. Every uppercase letter is converted to lowercase with a additional\n  //      preceding \"-\".\n  // The conversion will fail if:\n  //   1. The field name contains \"_\"s.\n  // If the conversion succeeds, it's guaranteed that the resulted\n  // snake_case name will yield the original camelCase name when\n  // converted using SnakeCaseToCamelCase().\n  //\n  // Note that the input can contain characters not allowed in C identifiers.\n  // For example, \"fooBar,bazQuz\" will be converted to \"foo_bar,baz_quz\"\n  // successfully.\n  static bool CamelCaseToSnakeCase(StringPiece input, string* output);\n\n  static void InternalGetFieldMaskForAllFields(const Descriptor* descriptor,\n                                               FieldMask* out);\n\n  static void InternalSubtract(const Descriptor* descriptor,\n                               const FieldMask& mask1, const FieldMask& mask2,\n                               FieldMask* out);\n};\n\n// Note that for compatibility with the defined behaviour for FieldMask in\n// google/protobuf/field_mask.proto, set replace_message_fields and\n// replace_repeated_fields to 'true'. The default options are not compatible\n// with google/protobuf/field_mask.proto.\nclass LIBPROTOBUF_EXPORT FieldMaskUtil::MergeOptions {\n public:\n  MergeOptions()\n      : replace_message_fields_(false), replace_repeated_fields_(false) {}\n  // When merging message fields, the default behavior is to merge the\n  // content of two message fields together. If you instead want to use\n  // the field from the source message to replace the corresponding field\n  // in the destination message, set this flag to true. When this flag is set,\n  // specified submessage fields that are missing in source will be cleared in\n  // destination.\n  void set_replace_message_fields(bool value) {\n    replace_message_fields_ = value;\n  }\n  bool replace_message_fields() const { return replace_message_fields_; }\n  // The default merging behavior will append entries from the source\n  // repeated field to the destination repeated field. If you only want\n  // to keep the entries from the source repeated field, set this flag\n  // to true.\n  void set_replace_repeated_fields(bool value) {\n    replace_repeated_fields_ = value;\n  }\n  bool replace_repeated_fields() const { return replace_repeated_fields_; }\n\n private:\n  bool replace_message_fields_;\n  bool replace_repeated_fields_;\n};\n\nclass LIBPROTOBUF_EXPORT FieldMaskUtil::TrimOptions {\n public:\n  TrimOptions()\n      : keep_required_fields_(false) {}\n  // When trimming message fields, the default behavior is to trim required\n  // fields of the present message if they are not specified in the field mask.\n  // If you instead want to keep required fields of the present message even\n  // they are not speicifed in the field mask, set this flag to true.\n  void set_keep_required_fields(bool value) {\n    keep_required_fields_ = value;\n  }\n  bool keep_required_fields() const { return keep_required_fields_; }\n\n private:\n  bool keep_required_fields_;\n};\n\n}  // namespace util\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/util/json_util.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Utility functions to convert between protobuf binary format and proto3 JSON\n// format.\n#ifndef GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__\n#define GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__\n\n#include <google/protobuf/message.h>\n#include <google/protobuf/util/type_resolver.h>\n#include <google/protobuf/stubs/bytestream.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace io {\nclass ZeroCopyInputStream;\nclass ZeroCopyOutputStream;\n}  // namespace io\nnamespace util {\n\nstruct JsonParseOptions {\n  // Whether to ignore unknown JSON fields during parsing\n  bool ignore_unknown_fields;\n\n  JsonParseOptions() : ignore_unknown_fields(false) {}\n};\n\nstruct JsonPrintOptions {\n  // Whether to add spaces, line breaks and indentation to make the JSON output\n  // easy to read.\n  bool add_whitespace;\n  // Whether to always print primitive fields. By default proto3 primitive\n  // fields with default values will be omitted in JSON output. For example, an\n  // int32 field set to 0 will be omitted. Set this flag to true will override\n  // the default behavior and print primitive fields regardless of their values.\n  bool always_print_primitive_fields;\n  // Whether to always print enums as ints. By default they are rendered as\n  // strings.\n  bool always_print_enums_as_ints;\n  // Whether to preserve proto field names\n  bool preserve_proto_field_names;\n\n  JsonPrintOptions()\n      : add_whitespace(false),\n        always_print_primitive_fields(false),\n        always_print_enums_as_ints(false),\n        preserve_proto_field_names(false) {}\n};\n\n// DEPRECATED. Use JsonPrintOptions instead.\ntypedef JsonPrintOptions JsonOptions;\n\n// Converts from protobuf message to JSON. This is a simple wrapper of\n// BinaryToJsonString(). It will use the DescriptorPool of the passed-in\n// message to resolve Any types.\nLIBPROTOBUF_EXPORT util::Status MessageToJsonString(const Message& message,\n                                   string* output,\n                                   const JsonOptions& options);\n\ninline util::Status MessageToJsonString(const Message& message,\n                                          string* output) {\n  return MessageToJsonString(message, output, JsonOptions());\n}\n\n// Converts from JSON to protobuf message. This is a simple wrapper of\n// JsonStringToBinary(). It will use the DescriptorPool of the passed-in\n// message to resolve Any types.\nLIBPROTOBUF_EXPORT util::Status JsonStringToMessage(const string& input,\n                                   Message* message,\n                                   const JsonParseOptions& options);\n\ninline util::Status JsonStringToMessage(const string& input,\n                                          Message* message) {\n  return JsonStringToMessage(input, message, JsonParseOptions());\n}\n\n// Converts protobuf binary data to JSON.\n// The conversion will fail if:\n//   1. TypeResolver fails to resolve a type.\n//   2. input is not valid protobuf wire format, or conflicts with the type\n//      information returned by TypeResolver.\n// Note that unknown fields will be discarded silently.\nLIBPROTOBUF_EXPORT util::Status BinaryToJsonStream(\n    TypeResolver* resolver,\n    const string& type_url,\n    io::ZeroCopyInputStream* binary_input,\n    io::ZeroCopyOutputStream* json_output,\n    const JsonPrintOptions& options);\n\ninline util::Status BinaryToJsonStream(\n    TypeResolver* resolver, const string& type_url,\n    io::ZeroCopyInputStream* binary_input,\n    io::ZeroCopyOutputStream* json_output) {\n  return BinaryToJsonStream(resolver, type_url, binary_input, json_output,\n                            JsonPrintOptions());\n}\n\nLIBPROTOBUF_EXPORT util::Status BinaryToJsonString(\n    TypeResolver* resolver,\n    const string& type_url,\n    const string& binary_input,\n    string* json_output,\n    const JsonPrintOptions& options);\n\ninline util::Status BinaryToJsonString(TypeResolver* resolver,\n                                         const string& type_url,\n                                         const string& binary_input,\n                                         string* json_output) {\n  return BinaryToJsonString(resolver, type_url, binary_input, json_output,\n                            JsonPrintOptions());\n}\n\n// Converts JSON data to protobuf binary format.\n// The conversion will fail if:\n//   1. TypeResolver fails to resolve a type.\n//   2. input is not valid JSON format, or conflicts with the type\n//      information returned by TypeResolver.\nLIBPROTOBUF_EXPORT util::Status JsonToBinaryStream(\n    TypeResolver* resolver,\n    const string& type_url,\n    io::ZeroCopyInputStream* json_input,\n    io::ZeroCopyOutputStream* binary_output,\n    const JsonParseOptions& options);\n\ninline util::Status JsonToBinaryStream(\n    TypeResolver* resolver,\n    const string& type_url,\n    io::ZeroCopyInputStream* json_input,\n    io::ZeroCopyOutputStream* binary_output) {\n  return JsonToBinaryStream(resolver, type_url, json_input, binary_output,\n                            JsonParseOptions());\n}\n\nLIBPROTOBUF_EXPORT util::Status JsonToBinaryString(\n    TypeResolver* resolver,\n    const string& type_url,\n    const string& json_input,\n    string* binary_output,\n    const JsonParseOptions& options);\n\ninline util::Status JsonToBinaryString(\n    TypeResolver* resolver,\n    const string& type_url,\n    const string& json_input,\n    string* binary_output) {\n  return JsonToBinaryString(resolver, type_url, json_input, binary_output,\n                            JsonParseOptions());\n}\n\nnamespace internal {\n// Internal helper class. Put in the header so we can write unit-tests for it.\nclass LIBPROTOBUF_EXPORT ZeroCopyStreamByteSink : public strings::ByteSink {\n public:\n  explicit ZeroCopyStreamByteSink(io::ZeroCopyOutputStream* stream)\n      : stream_(stream), buffer_(NULL), buffer_size_(0) {}\n  ~ZeroCopyStreamByteSink();\n\n  virtual void Append(const char* bytes, size_t len);\n\n private:\n  io::ZeroCopyOutputStream* stream_;\n  void* buffer_;\n  int buffer_size_;\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ZeroCopyStreamByteSink);\n};\n}  // namespace internal\n\n}  // namespace util\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/util/message_differencer.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: jschorr@google.com (Joseph Schorr)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This file defines static methods and classes for comparing Protocol\n// Messages.\n//\n// Aug. 2008: Added Unknown Fields Comparison for messages.\n// Aug. 2009: Added different options to compare repeated fields.\n// Apr. 2010: Moved field comparison to FieldComparator.\n\n#ifndef GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__\n#define GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__\n\n#include <map>\n#include <set>\n#include <string>\n#include <vector>\n#include <google/protobuf/descriptor.h>  // FieldDescriptor\n#include <google/protobuf/message.h>  // Message\n#include <google/protobuf/unknown_field_set.h>\n#include <google/protobuf/util/field_comparator.h>\n\nnamespace google {\nnamespace protobuf {\n\nclass DynamicMessageFactory;\nclass FieldDescriptor;\n\nnamespace io {\nclass ZeroCopyOutputStream;\nclass Printer;\n}\n\nnamespace util {\n\nclass DefaultFieldComparator;\nclass FieldContext;  // declared below MessageDifferencer\n\n// A basic differencer that can be used to determine\n// the differences between two specified Protocol Messages. If any differences\n// are found, the Compare method will return false, and any differencer reporter\n// specified via ReportDifferencesTo will have its reporting methods called (see\n// below for implementation of the report). Based off of the original\n// ProtocolDifferencer implementation in //net/proto/protocol-differencer.h\n// (Thanks Todd!).\n//\n// MessageDifferencer REQUIRES that compared messages be the same type, defined\n// as messages that share the same descriptor.  If not, the behavior of this\n// class is undefined.\n//\n// People disagree on what MessageDifferencer should do when asked to compare\n// messages with different descriptors.  Some people think it should always\n// return false.  Others expect it to try to look for similar fields and\n// compare them anyway -- especially if the descriptors happen to be identical.\n// If we chose either of these behaviors, some set of people would find it\n// surprising, and could end up writing code expecting the other behavior\n// without realizing their error.  Therefore, we forbid that usage.\n//\n// This class is implemented based on the proto2 reflection. The performance\n// should be good enough for normal usages. However, for places where the\n// performance is extremely sensitive, there are several alternatives:\n// - Comparing serialized string\n// Downside: false negatives (there are messages that are the same but their\n// serialized strings are different).\n// - Equals code generator by compiler plugin (net/proto2/contrib/equals_plugin)\n// Downside: more generated code; maintenance overhead for the additional rule\n// (must be in sync with the original proto_library).\n//\n// Note on handling of google.protobuf.Any: MessageDifferencer automatically\n// unpacks Any::value into a Message and compares its individual fields.\n// Messages encoded in a repeated Any cannot be compared using TreatAsMap.\n//\n//\n// Note on thread-safety: MessageDifferencer is *not* thread-safe. You need to\n// guard it with a lock to use the same MessageDifferencer instance from\n// multiple threads. Note that it's fine to call static comparison methods\n// (like MessageDifferencer::Equals) concurrently.\nclass LIBPROTOBUF_EXPORT MessageDifferencer {\n public:\n  // Determines whether the supplied messages are equal. Equality is defined as\n  // all fields within the two messages being set to the same value. Primitive\n  // fields and strings are compared by value while embedded messages/groups\n  // are compared as if via a recursive call. Use IgnoreField() and Compare()\n  // if some fields should be ignored in the comparison.\n  //\n  // This method REQUIRES that the two messages have the same\n  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).\n  static bool Equals(const Message& message1, const Message& message2);\n\n  // Determines whether the supplied messages are equivalent. Equivalency is\n  // defined as all fields within the two messages having the same value. This\n  // differs from the Equals method above in that fields with default values\n  // are considered set to said value automatically. For details on how default\n  // values are defined for each field type, see http://shortn/_x2Gv6XFrWt.\n  // Also, Equivalent() ignores unknown fields. Use IgnoreField() and Compare()\n  // if some fields should be ignored in the comparison.\n  //\n  // This method REQUIRES that the two messages have the same\n  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).\n  static bool Equivalent(const Message& message1, const Message& message2);\n\n  // Determines whether the supplied messages are approximately equal.\n  // Approximate equality is defined as all fields within the two messages\n  // being approximately equal.  Primitive (non-float) fields and strings are\n  // compared by value, floats are compared using MathUtil::AlmostEquals() and\n  // embedded messages/groups are compared as if via a recursive call. Use\n  // IgnoreField() and Compare() if some fields should be ignored in the\n  // comparison.\n  //\n  // This method REQUIRES that the two messages have the same\n  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).\n  static bool ApproximatelyEquals(const Message& message1,\n                                  const Message& message2);\n\n  // Determines whether the supplied messages are approximately equivalent.\n  // Approximate equivalency is defined as all fields within the two messages\n  // being approximately equivalent. As in\n  // MessageDifferencer::ApproximatelyEquals, primitive (non-float) fields and\n  // strings are compared by value, floats are compared using\n  // MathUtil::AlmostEquals() and embedded messages/groups are compared as if\n  // via a recursive call. However, fields with default values are considered\n  // set to said value, as per MessageDiffencer::Equivalent. Use IgnoreField()\n  // and Compare() if some fields should be ignored in the comparison.\n  //\n  // This method REQUIRES that the two messages have the same\n  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).\n  static bool ApproximatelyEquivalent(const Message& message1,\n                                      const Message& message2);\n\n  // Identifies an individual field in a message instance.  Used for field_path,\n  // below.\n  struct SpecificField {\n    // For known fields, \"field\" is filled in and \"unknown_field_number\" is -1.\n    // For unknown fields, \"field\" is NULL, \"unknown_field_number\" is the field\n    // number, and \"unknown_field_type\" is its type.\n    const FieldDescriptor* field;\n    int unknown_field_number;\n    UnknownField::Type unknown_field_type;\n\n    // If this a repeated field, \"index\" is the index within it.  For unknown\n    // fields, this is the index of the field among all unknown fields of the\n    // same field number and type.\n    int index;\n\n    // If \"field\" is a repeated field which is being treated as a map or\n    // a set (see TreatAsMap() and TreatAsSet(), below), new_index indicates\n    // the index the position to which the element has moved.  If the element\n    // has not moved, \"new_index\" will have the same value as \"index\".\n    int new_index;\n\n    // For unknown fields, these are the pointers to the UnknownFieldSet\n    // containing the unknown fields. In certain cases (e.g. proto1's\n    // MessageSet, or nested groups of unknown fields), these may differ from\n    // the messages' internal UnknownFieldSets.\n    const UnknownFieldSet* unknown_field_set1;\n    const UnknownFieldSet* unknown_field_set2;\n\n    // For unknown fields, these are the index of the field within the\n    // UnknownFieldSets. One or the other will be -1 when\n    // reporting an addition or deletion.\n    int unknown_field_index1;\n    int unknown_field_index2;\n\n    SpecificField()\n        : field(NULL),\n          unknown_field_number(-1),\n          index(-1),\n          new_index(-1),\n          unknown_field_set1(NULL),\n          unknown_field_set2(NULL),\n          unknown_field_index1(-1),\n          unknown_field_index2(-1) {}\n  };\n\n  // Abstract base class from which all MessageDifferencer\n  // reporters derive. The five Report* methods below will be called when\n  // a field has been added, deleted, modified, moved, or matched. The third\n  // argument is a vector of FieldDescriptor pointers which describes the chain\n  // of fields that was taken to find the current field. For example, for a\n  // field found in an embedded message, the vector will contain two\n  // FieldDescriptors. The first will be the field of the embedded message\n  // itself and the second will be the actual field in the embedded message\n  // that was added/deleted/modified.\n  class LIBPROTOBUF_EXPORT Reporter {\n   public:\n    Reporter();\n    virtual ~Reporter();\n\n    // Reports that a field has been added into Message2.\n    virtual void ReportAdded(\n        const Message& message1, const Message& message2,\n        const std::vector<SpecificField>& field_path) = 0;\n\n    // Reports that a field has been deleted from Message1.\n    virtual void ReportDeleted(\n        const Message& message1,\n        const Message& message2,\n        const std::vector<SpecificField>& field_path) = 0;\n\n    // Reports that the value of a field has been modified.\n    virtual void ReportModified(\n        const Message& message1,\n        const Message& message2,\n        const std::vector<SpecificField>& field_path) = 0;\n\n    // Reports that a repeated field has been moved to another location.  This\n    // only applies when using TreatAsSet or TreatAsMap()  -- see below. Also\n    // note that for any given field, ReportModified and ReportMoved are\n    // mutually exclusive. If a field has been both moved and modified, then\n    // only ReportModified will be called.\n    virtual void ReportMoved(\n        const Message& /* message1 */,\n        const Message& /* message2 */,\n        const std::vector<SpecificField>& /* field_path */) { }\n\n    // Reports that two fields match. Useful for doing side-by-side diffs.\n    // This function is mutually exclusive with ReportModified and ReportMoved.\n    // Note that you must call set_report_matches(true) before calling Compare\n    // to make use of this function.\n    virtual void ReportMatched(\n        const Message& /* message1 */,\n        const Message& /* message2 */,\n        const std::vector<SpecificField>& /* field_path */) { }\n\n    // Reports that two fields would have been compared, but the\n    // comparison has been skipped because the field was marked as\n    // 'ignored' using IgnoreField().  This function is mutually\n    // exclusive with all the other Report() functions.\n    //\n    // The contract of ReportIgnored is slightly different than the\n    // other Report() functions, in that |field_path.back().index| is\n    // always equal to -1, even if the last field is repeated. This is\n    // because while the other Report() functions indicate where in a\n    // repeated field the action (Addition, Deletion, etc...)\n    // happened, when a repeated field is 'ignored', the differencer\n    // simply calls ReportIgnored on the repeated field as a whole and\n    // moves on without looking at its individual elements.\n    //\n    // Furthermore, ReportIgnored() does not indicate whether the\n    // fields were in fact equal or not, as Compare() does not inspect\n    // these fields at all. It is up to the Reporter to decide whether\n    // the fields are equal or not (perhaps with a second call to\n    // Compare()), if it cares.\n    virtual void ReportIgnored(\n        const Message& /* message1 */,\n        const Message& /* message2 */,\n        const std::vector<SpecificField>& /* field_path */) { }\n\n    // Report that an unknown field is ignored. (see comment above).\n    // Note this is a different function since the last SpecificField in field\n    // path has a null field.  This could break existing Reporter.\n    virtual void ReportUnknownFieldIgnored(\n        const Message& /* message1 */, const Message& /* message2 */,\n        const std::vector<SpecificField>& /* field_path */) {}\n\n   private:\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Reporter);\n  };\n\n  // MapKeyComparator is used to determine if two elements have the same key\n  // when comparing elements of a repeated field as a map.\n  class LIBPROTOBUF_EXPORT MapKeyComparator {\n   public:\n    MapKeyComparator();\n    virtual ~MapKeyComparator();\n\n    virtual bool IsMatch(\n        const Message& /* message1 */,\n        const Message& /* message2 */,\n        const std::vector<SpecificField>& /* parent_fields */) const {\n      GOOGLE_CHECK(false) << \"IsMatch() is not implemented.\";\n      return false;\n    }\n\n   private:\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapKeyComparator);\n  };\n\n  // Abstract base class from which all IgnoreCriteria derive.\n  // By adding IgnoreCriteria more complex ignore logic can be implemented.\n  // IgnoreCriteria are registed with AddIgnoreCriteria. For each compared\n  // field IsIgnored is called on each added IgnoreCriteria until one returns\n  // true or all return false.\n  // IsIgnored is called for fields where at least one side has a value.\n  class LIBPROTOBUF_EXPORT IgnoreCriteria {\n   public:\n    IgnoreCriteria();\n    virtual ~IgnoreCriteria();\n\n    // Returns true if the field should be ignored.\n    virtual bool IsIgnored(\n        const Message& /* message1 */,\n        const Message& /* message2 */,\n        const FieldDescriptor* /* field */,\n        const std::vector<SpecificField>& /* parent_fields */) = 0;\n\n    // Returns true if the unknown field should be ignored.\n    // Note: This will be called for unknown fields as well in which case\n    //       field.field will be null.\n    virtual bool IsUnknownFieldIgnored(\n        const Message& /* message1 */, const Message& /* message2 */,\n        const SpecificField& /* field */,\n        const std::vector<SpecificField>& /* parent_fields */) {\n      return false;\n    }\n  };\n\n  // To add a Reporter, construct default here, then use ReportDifferencesTo or\n  // ReportDifferencesToString.\n  explicit MessageDifferencer();\n\n  ~MessageDifferencer();\n\n  enum MessageFieldComparison {\n    EQUAL,       // Fields must be present in both messages\n                 // for the messages to be considered the same.\n    EQUIVALENT,  // Fields with default values are considered set\n                 // for comparison purposes even if not explicitly\n                 // set in the messages themselves.  Unknown fields\n                 // are ignored.\n  };\n\n  enum Scope {\n    FULL,    // All fields of both messages are considered in the comparison.\n    PARTIAL  // Only fields present in the first message are considered; fields\n             // set only in the second message will be skipped during\n             // comparison.\n  };\n\n  // DEPRECATED. Use FieldComparator::FloatComparison instead.\n  enum FloatComparison {\n    EXACT,       // Floats and doubles are compared exactly.\n    APPROXIMATE  // Floats and doubles are compared using the\n                 // MathUtil::AlmostEquals method.\n  };\n\n  enum RepeatedFieldComparison {\n    AS_LIST,     // Repeated fields are compared in order.  Differing values at\n                 // the same index are reported using ReportModified().  If the\n                 // repeated fields have different numbers of elements, the\n                 // unpaired elements are reported using ReportAdded() or\n                 // ReportDeleted().\n    AS_SET,      // Treat all the repeated fields as sets.\n                 // See TreatAsSet(), as below.\n  };\n\n  // The elements of the given repeated field will be treated as a set for\n  // diffing purposes, so different orderings of the same elements will be\n  // considered equal.  Elements which are present on both sides of the\n  // comparison but which have changed position will be reported with\n  // ReportMoved().  Elements which only exist on one side or the other are\n  // reported with ReportAdded() and ReportDeleted() regardless of their\n  // positions.  ReportModified() is never used for this repeated field.  If\n  // the only differences between the compared messages is that some fields\n  // have been moved, then the comparison returns true.\n  //\n  // Note that despite the name of this method, this is really\n  // comparison as multisets: if one side of the comparison has a duplicate\n  // in the repeated field but the other side doesn't, this will count as\n  // a mismatch.\n  //\n  // If the scope of comparison is set to PARTIAL, then in addition to what's\n  // above, extra values added to repeated fields of the second message will\n  // not cause the comparison to fail.\n  //\n  // Note that set comparison is currently O(k * n^2) (where n is the total\n  // number of elements, and k is the average size of each element). In theory\n  // it could be made O(n * k) with a more complex hashing implementation. Feel\n  // free to contribute one if the current implementation is too slow for you.\n  // If partial matching is also enabled, the time complexity will be O(k * n^2\n  // + n^3) in which n^3 is the time complexity of the maximum matching\n  // algorithm.\n  //\n  // REQUIRES:  field->is_repeated() and field not registered with TreatAsList\n  void TreatAsSet(const FieldDescriptor* field);\n\n  // The elements of the given repeated field will be treated as a list for\n  // diffing purposes, so different orderings of the same elements will NOT be\n  // considered equal.\n  //\n  // REQUIRED: field->is_repeated() and field not registered with TreatAsSet\n  void TreatAsList(const FieldDescriptor* field);\n\n  // The elements of the given repeated field will be treated as a map for\n  // diffing purposes, with |key| being the map key.  Thus, elements with the\n  // same key will be compared even if they do not appear at the same index.\n  // Differences are reported similarly to TreatAsSet(), except that\n  // ReportModified() is used to report elements with the same key but\n  // different values.  Note that if an element is both moved and modified,\n  // only ReportModified() will be called.  As with TreatAsSet, if the only\n  // differences between the compared messages is that some fields have been\n  // moved, then the comparison returns true. See TreatAsSet for notes on\n  // performance.\n  //\n  // REQUIRES:  field->is_repeated()\n  // REQUIRES:  field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE\n  // REQUIRES:  key->containing_type() == field->message_type()\n  void TreatAsMap(const FieldDescriptor* field, const FieldDescriptor* key);\n  // Same as TreatAsMap except that this method will use multiple fields as\n  // the key in comparison. All specified fields in 'key_fields' should be\n  // present in the compared elements. Two elements will be treated as having\n  // the same key iff they have the same value for every specified field. There\n  // are two steps in the comparison process. The first one is key matching.\n  // Every element from one message will be compared to every element from\n  // the other message. Only fields in 'key_fields' are compared in this step\n  // to decide if two elements have the same key. The second step is value\n  // comparison. Those pairs of elements with the same key (with equal value\n  // for every field in 'key_fields') will be compared in this step.\n  // Time complexity of the first step is O(s * m * n ^ 2) where s is the\n  // average size of the fields specified in 'key_fields', m is the number of\n  // fields in 'key_fields' and n is the number of elements. If partial\n  // matching is enabled, an extra O(n^3) will be incured by the maximum\n  // matching algorithm. The second step is O(k * n) where k is the average\n  // size of each element.\n  void TreatAsMapWithMultipleFieldsAsKey(\n      const FieldDescriptor* field,\n      const std::vector<const FieldDescriptor*>& key_fields);\n  // Same as TreatAsMapWithMultipleFieldsAsKey, except that each of the field\n  // do not necessarily need to be a direct subfield. Each element in\n  // key_field_paths indicate a path from the message being compared, listing\n  // successive subfield to reach the key field.\n  //\n  // REQUIRES:\n  //   for key_field_path in key_field_paths:\n  //     key_field_path[0]->containing_type() == field->message_type()\n  //     for i in [0, key_field_path.size() - 1):\n  //       key_field_path[i+1]->containing_type() ==\n  //           key_field_path[i]->message_type()\n  //       key_field_path[i]->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE\n  //       !key_field_path[i]->is_repeated()\n  void TreatAsMapWithMultipleFieldPathsAsKey(\n      const FieldDescriptor* field,\n      const std::vector<std::vector<const FieldDescriptor*> >& key_field_paths);\n\n  // Uses a custom MapKeyComparator to determine if two elements have the same\n  // key when comparing a repeated field as a map.\n  // The caller is responsible to delete the key_comparator.\n  // This method varies from TreatAsMapWithMultipleFieldsAsKey only in the\n  // first key matching step. Rather than comparing some specified fields, it\n  // will invoke the IsMatch method of the given 'key_comparator' to decide if\n  // two elements have the same key.\n  void TreatAsMapUsingKeyComparator(\n      const FieldDescriptor* field,\n      const MapKeyComparator* key_comparator);\n\n  // Initiates and returns a new instance of MultipleFieldsMapKeyComparator.\n  MapKeyComparator* CreateMultipleFieldsMapKeyComparator(\n      const std::vector<std::vector<const FieldDescriptor*> >& key_field_paths);\n\n  // Add a custom ignore criteria that is evaluated in addition to the\n  // ignored fields added with IgnoreField.\n  // Takes ownership of ignore_criteria.\n  void AddIgnoreCriteria(IgnoreCriteria* ignore_criteria);\n\n  // Indicates that any field with the given descriptor should be\n  // ignored for the purposes of comparing two messages. This applies\n  // to fields nested in the message structure as well as top level\n  // ones. When the MessageDifferencer encounters an ignored field,\n  // ReportIgnored is called on the reporter, if one is specified.\n  //\n  // The only place where the field's 'ignored' status is not applied is when\n  // it is being used as a key in a field passed to TreatAsMap or is one of\n  // the fields passed to TreatAsMapWithMultipleFieldsAsKey.\n  // In this case it is compared in key matching but after that it's ignored\n  // in value comparison.\n  void IgnoreField(const FieldDescriptor* field);\n\n  // Sets the field comparator used to determine differences between protocol\n  // buffer fields. By default it's set to a DefaultFieldComparator instance.\n  // MessageDifferencer doesn't take ownership over the passed object.\n  // Note that this method must be called before Compare for the comparator to\n  // be used.\n  void set_field_comparator(FieldComparator* comparator);\n\n  // DEPRECATED. Pass a DefaultFieldComparator instance instead.\n  // Sets the fraction and margin for the float comparison of a given field.\n  // Uses MathUtil::WithinFractionOrMargin to compare the values.\n  // NOTE: this method does nothing if differencer's field comparator has been\n  //       set to a custom object.\n  //\n  // REQUIRES: field->cpp_type == FieldDescriptor::CPPTYPE_DOUBLE or\n  //           field->cpp_type == FieldDescriptor::CPPTYPE_FLOAT\n  // REQUIRES: float_comparison_ == APPROXIMATE\n  void SetFractionAndMargin(const FieldDescriptor* field, double fraction,\n                            double margin);\n\n  // Sets the type of comparison (as defined in the MessageFieldComparison\n  // enumeration above) that is used by this differencer when determining how\n  // to compare fields in messages.\n  void set_message_field_comparison(MessageFieldComparison comparison);\n\n  // Tells the differencer whether or not to report matches. This method must\n  // be called before Compare. The default for a new differencer is false.\n  void set_report_matches(bool report_matches) {\n    report_matches_ = report_matches;\n  }\n\n  // Tells the differencer whether or not to report moves (in a set or map\n  // repeated field). This method must be called before Compare. The default for\n  // a new differencer is true.\n  void set_report_moves(bool report_moves) {\n    report_moves_ = report_moves;\n  }\n\n  // Sets the scope of the comparison (as defined in the Scope enumeration\n  // above) that is used by this differencer when determining which fields to\n  // compare between the messages.\n  void set_scope(Scope scope);\n\n  // Returns the current scope used by this differencer.\n  Scope scope();\n\n  // DEPRECATED. Pass a DefaultFieldComparator instance instead.\n  // Sets the type of comparison (as defined in the FloatComparison enumeration\n  // above) that is used by this differencer when comparing float (and double)\n  // fields in messages.\n  // NOTE: this method does nothing if differencer's field comparator has been\n  //       set to a custom object.\n  void set_float_comparison(FloatComparison comparison);\n\n  // Sets the type of comparison for repeated field (as defined in the\n  // RepeatedFieldComparison enumeration above) that is used by this\n  // differencer when compare repeated fields in messages.\n  void set_repeated_field_comparison(RepeatedFieldComparison comparison);\n\n  // Compares the two specified messages, returning true if they are the same,\n  // false otherwise. If this method returns false, any changes between the\n  // two messages will be reported if a Reporter was specified via\n  // ReportDifferencesTo (see also ReportDifferencesToString).\n  //\n  // This method REQUIRES that the two messages have the same\n  // Descriptor (message1.GetDescriptor() == message2.GetDescriptor()).\n  bool Compare(const Message& message1, const Message& message2);\n\n  // Same as above, except comparing only the list of fields specified by the\n  // two vectors of FieldDescriptors.\n  bool CompareWithFields(\n      const Message& message1, const Message& message2,\n      const std::vector<const FieldDescriptor*>& message1_fields,\n      const std::vector<const FieldDescriptor*>& message2_fields);\n\n  // Automatically creates a reporter that will output the differences\n  // found (if any) to the specified output string pointer. Note that this\n  // method must be called before Compare.\n  void ReportDifferencesToString(string* output);\n\n  // Tells the MessageDifferencer to report differences via the specified\n  // reporter. Note that this method must be called before Compare for\n  // the reporter to be used. It is the responsibility of the caller to delete\n  // this object.\n  // If the provided pointer equals NULL, the MessageDifferencer stops reporting\n  // differences to any previously set reporters or output strings.\n  void ReportDifferencesTo(Reporter* reporter);\n\n  // An implementation of the MessageDifferencer Reporter that outputs\n  // any differences found in human-readable form to the supplied\n  // ZeroCopyOutputStream or Printer. If a printer is used, the delimiter\n  // *must* be '$'.\n  //\n  // WARNING: this reporter does not necessarily flush its output until it is\n  // destroyed. As a result, it is not safe to assume the output is valid or\n  // complete until after you destroy the reporter. For example, if you use a\n  // StreamReporter to write to a StringOutputStream, the target string may\n  // contain uninitialized data until the reporter is destroyed.\n  class LIBPROTOBUF_EXPORT StreamReporter : public Reporter {\n   public:\n    explicit StreamReporter(io::ZeroCopyOutputStream* output);\n    explicit StreamReporter(io::Printer* printer);  // delimiter '$'\n    virtual ~StreamReporter();\n\n    // When set to true, the stream reporter will also output aggregates nodes\n    // (i.e. messages and groups) whose subfields have been modified. When\n    // false, will only report the individual subfields. Defaults to false.\n    void set_report_modified_aggregates(bool report) {\n      report_modified_aggregates_ = report;\n    }\n\n    // The following are implementations of the methods described above.\n    virtual void ReportAdded(const Message& message1, const Message& message2,\n                             const std::vector<SpecificField>& field_path);\n\n    virtual void ReportDeleted(const Message& message1,\n                               const Message& message2,\n                               const std::vector<SpecificField>& field_path);\n\n    virtual void ReportModified(const Message& message1,\n                                const Message& message2,\n                                const std::vector<SpecificField>& field_path);\n\n    virtual void ReportMoved(const Message& message1,\n                             const Message& message2,\n                             const std::vector<SpecificField>& field_path);\n\n    virtual void ReportMatched(const Message& message1,\n                               const Message& message2,\n                               const std::vector<SpecificField>& field_path);\n\n    virtual void ReportIgnored(const Message& message1,\n                               const Message& message2,\n                               const std::vector<SpecificField>& field_path);\n\n    virtual void ReportUnknownFieldIgnored(\n        const Message& message1, const Message& message2,\n        const std::vector<SpecificField>& field_path);\n\n   protected:\n    // Prints the specified path of fields to the buffer.  message is used to\n    // print map keys.\n    virtual void PrintPath(const std::vector<SpecificField>& field_path,\n                           bool left_side, const Message& message);\n\n    // Prints the specified path of fields to the buffer.\n    virtual void PrintPath(const std::vector<SpecificField>& field_path,\n                           bool left_side);\n\n    // Prints the value of fields to the buffer.  left_side is true if the\n    // given message is from the left side of the comparison, false if it\n    // was the right.  This is relevant only to decide whether to follow\n    // unknown_field_index1 or unknown_field_index2 when an unknown field\n    // is encountered in field_path.\n    virtual void PrintValue(const Message& message,\n                            const std::vector<SpecificField>& field_path,\n                            bool left_side);\n\n    // Prints the specified path of unknown fields to the buffer.\n    virtual void PrintUnknownFieldValue(const UnknownField* unknown_field);\n\n    // Just print a string\n    void Print(const string& str);\n\n   private:\n    io::Printer* printer_;\n    bool delete_printer_;\n    bool report_modified_aggregates_;\n\n    GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StreamReporter);\n  };\n\n private:\n  friend class DefaultFieldComparator;\n\n  // A MapKeyComparator to be used in TreatAsMapUsingKeyComparator.\n  // Implementation of this class needs to do field value comparison which\n  // relies on some private methods of MessageDifferencer. That's why this\n  // class is declared as a nested class of MessageDifferencer.\n  class MultipleFieldsMapKeyComparator;\n\n  // A MapKeyComparator for use with map_entries.\n  class LIBPROTOBUF_EXPORT MapEntryKeyComparator : public MapKeyComparator {\n   public:\n    explicit MapEntryKeyComparator(MessageDifferencer* message_differencer);\n    virtual bool IsMatch(const Message& message1, const Message& message2,\n                         const std::vector<SpecificField>& parent_fields) const;\n\n   private:\n    MessageDifferencer* message_differencer_;\n  };\n\n  // Returns true if field1's number() is less than field2's.\n  static bool FieldBefore(const FieldDescriptor* field1,\n                          const FieldDescriptor* field2);\n\n  // Combine the two lists of fields into the combined_fields output vector.\n  // All fields present in both lists will always be included in the combined\n  // list.  Fields only present in one of the lists will only appear in the\n  // combined list if the corresponding fields_scope option is set to FULL.\n  void CombineFields(const std::vector<const FieldDescriptor*>& fields1,\n                     Scope fields1_scope,\n                     const std::vector<const FieldDescriptor*>& fields2,\n                     Scope fields2_scope,\n                     std::vector<const FieldDescriptor*>* combined_fields);\n\n  // Internal version of the Compare method which performs the actual\n  // comparison. The parent_fields vector is a vector containing field\n  // descriptors of all fields accessed to get to this comparison operation\n  // (i.e. if the current message is an embedded message, the parent_fields\n  // vector will contain the field that has this embedded message).\n  bool Compare(const Message& message1, const Message& message2,\n               std::vector<SpecificField>* parent_fields);\n\n  // Compares all the unknown fields in two messages.\n  bool CompareUnknownFields(const Message& message1, const Message& message2,\n                            const google::protobuf::UnknownFieldSet&,\n                            const google::protobuf::UnknownFieldSet&,\n                            std::vector<SpecificField>* parent_fields);\n\n  // Compares the specified messages for the requested field lists. The field\n  // lists are modified depending on comparison settings, and then passed to\n  // CompareWithFieldsInternal.\n  bool CompareRequestedFieldsUsingSettings(\n      const Message& message1, const Message& message2,\n      const std::vector<const FieldDescriptor*>& message1_fields,\n      const std::vector<const FieldDescriptor*>& message2_fields,\n      std::vector<SpecificField>* parent_fields);\n\n  // Compares the specified messages with the specified field lists.\n  bool CompareWithFieldsInternal(\n      const Message& message1, const Message& message2,\n      const std::vector<const FieldDescriptor*>& message1_fields,\n      const std::vector<const FieldDescriptor*>& message2_fields,\n      std::vector<SpecificField>* parent_fields);\n\n  // Compares the repeated fields, and report the error.\n  bool CompareRepeatedField(const Message& message1, const Message& message2,\n                            const FieldDescriptor* field,\n                            std::vector<SpecificField>* parent_fields);\n\n  // Shorthand for CompareFieldValueUsingParentFields with NULL parent_fields.\n  bool CompareFieldValue(const Message& message1,\n                         const Message& message2,\n                         const FieldDescriptor* field,\n                         int index1,\n                         int index2);\n\n  // Compares the specified field on the two messages, returning\n  // true if they are the same, false otherwise. For repeated fields,\n  // this method only compares the value in the specified index. This method\n  // uses Compare functions to recurse into submessages.\n  // The parent_fields vector is used in calls to a Reporter instance calls.\n  // It can be NULL, in which case the MessageDifferencer will create new\n  // list of parent messages if it needs to recursively compare the given field.\n  // To avoid confusing users you should not set it to NULL unless you modified\n  // Reporter to handle the change of parent_fields correctly.\n  bool CompareFieldValueUsingParentFields(\n      const Message& message1,\n      const Message& message2,\n      const FieldDescriptor* field,\n      int index1,\n      int index2,\n      std::vector<SpecificField>* parent_fields);\n\n  // Compares the specified field on the two messages, returning comparison\n  // result, as returned by appropriate FieldComparator.\n  FieldComparator::ComparisonResult GetFieldComparisonResult(\n      const Message& message1, const Message& message2,\n      const FieldDescriptor* field, int index1, int index2,\n      const FieldContext* field_context);\n\n  // Check if the two elements in the repeated field are match to each other.\n  // if the key_comprator is NULL, this function returns true when the two\n  // elements are equal.\n  bool IsMatch(const FieldDescriptor* repeated_field,\n               const MapKeyComparator* key_comparator,\n               const Message* message1, const Message* message2,\n               const std::vector<SpecificField>& parent_fields,\n               int index1, int index2);\n\n  // Returns true when this repeated field has been configured to be treated\n  // as a set.\n  bool IsTreatedAsSet(const FieldDescriptor* field);\n\n  // Returns true when this repeated field is to be compared as a subset, ie.\n  // has been configured to be treated as a set or map and scope is set to\n  // PARTIAL.\n  bool IsTreatedAsSubset(const FieldDescriptor* field);\n\n  // Returns true if this field is to be ignored when this\n  // MessageDifferencer compares messages.\n  bool IsIgnored(\n      const Message& message1,\n      const Message& message2,\n      const FieldDescriptor* field,\n      const std::vector<SpecificField>& parent_fields);\n\n  // Returns true if this unknown field is to be ignored when this\n  // MessageDifferencer compares messages.\n  bool IsUnknownFieldIgnored(const Message& message1, const Message& message2,\n                             const SpecificField& field,\n                             const std::vector<SpecificField>& parent_fields);\n\n  // Returns MapKeyComparator* when this field has been configured to be treated\n  // as a map or its is_map() return true.  If not, returns NULL.\n  const MapKeyComparator* GetMapKeyComparator(\n      const FieldDescriptor* field) const;\n\n  // Attempts to match indices of a repeated field, so that the contained values\n  // match. Clears output vectors and sets their values to indices of paired\n  // messages, ie. if message1[0] matches message2[1], then match_list1[0] == 1\n  // and match_list2[1] == 0. The unmatched indices are indicated by -1.\n  // This method returns false if the match failed. However, it doesn't mean\n  // that the comparison succeeds when this method returns true (you need to\n  // double-check in this case).\n  bool MatchRepeatedFieldIndices(\n      const Message& message1,\n      const Message& message2,\n      const FieldDescriptor* repeated_field,\n      const std::vector<SpecificField>& parent_fields,\n      std::vector<int>* match_list1,\n      std::vector<int>* match_list2);\n\n  // If \"any\" is of type google.protobuf.Any, extract its payload using\n  // DynamicMessageFactory and store in \"data\".\n  bool UnpackAny(const Message& any, std::unique_ptr<Message>* data);\n\n  // Checks if index is equal to new_index in all the specific fields.\n  static bool CheckPathChanged(const std::vector<SpecificField>& parent_fields);\n\n  // Defines a map between field descriptors and their MapKeyComparators.\n  // Used for repeated fields when they are configured as TreatAsMap.\n  typedef std::map<const FieldDescriptor*,\n              const MapKeyComparator*> FieldKeyComparatorMap;\n\n  // Defines a set to store field descriptors.  Used for repeated fields when\n  // they are configured as TreatAsSet.\n  typedef std::set<const FieldDescriptor*> FieldSet;\n\n  Reporter* reporter_;\n  DefaultFieldComparator default_field_comparator_;\n  FieldComparator* field_comparator_;\n  MessageFieldComparison message_field_comparison_;\n  Scope scope_;\n  RepeatedFieldComparison repeated_field_comparison_;\n\n  FieldSet set_fields_;\n  FieldSet list_fields_;\n  // Keeps track of MapKeyComparators that are created within\n  // MessageDifferencer. These MapKeyComparators should be deleted\n  // before MessageDifferencer is destroyed.\n  // When TreatAsMap or TreatAsMapWithMultipleFieldsAsKey is called, we don't\n  // store the supplied FieldDescriptors directly. Instead, a new\n  // MapKeyComparator is created for comparison purpose.\n  std::vector<MapKeyComparator*> owned_key_comparators_;\n  FieldKeyComparatorMap map_field_key_comparator_;\n  MapEntryKeyComparator map_entry_key_comparator_;\n  std::vector<IgnoreCriteria*> ignore_criteria_;\n\n  FieldSet ignored_fields_;\n\n  bool report_matches_;\n  bool report_moves_;\n\n  string* output_string_;\n\n  std::unique_ptr<DynamicMessageFactory> dynamic_message_factory_;\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageDifferencer);\n};\n\n// This class provides extra information to the FieldComparator::Compare\n// function.\nclass LIBPROTOBUF_EXPORT FieldContext {\n public:\n  explicit FieldContext(\n      std::vector<MessageDifferencer::SpecificField>* parent_fields)\n      : parent_fields_(parent_fields) {}\n\n  std::vector<MessageDifferencer::SpecificField>* parent_fields() const {\n    return parent_fields_;\n  }\n\n private:\n  std::vector<MessageDifferencer::SpecificField>* parent_fields_;\n};\n\n}\n}\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/util/time_util.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Defines utilities for the Timestamp and Duration well known types.\n\n#ifndef GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__\n#define GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__\n\n#include <ctime>\n#include <ostream>\n#include <string>\n#ifdef _MSC_VER\n#include <winsock2.h>\n#else\n#include <sys/time.h>\n#endif\n\n#include <google/protobuf/duration.pb.h>\n#include <google/protobuf/timestamp.pb.h>\n\nnamespace google {\nnamespace protobuf {\nnamespace util {\n\n// Utility functions for Timestamp and Duration.\nclass LIBPROTOBUF_EXPORT TimeUtil {\n  typedef google::protobuf::Timestamp Timestamp;\n  typedef google::protobuf::Duration Duration;\n\n public:\n  // The min/max Timestamp/Duration values we support.\n  //\n  // For \"0001-01-01T00:00:00Z\".\n  static const int64 kTimestampMinSeconds = -62135596800LL;\n  // For \"9999-12-31T23:59:59.999999999Z\".\n  static const int64 kTimestampMaxSeconds = 253402300799LL;\n  static const int64 kDurationMinSeconds = -315576000000LL;\n  static const int64 kDurationMaxSeconds = 315576000000LL;\n\n  // Converts Timestamp to/from RFC 3339 date string format.\n  // Generated output will always be Z-normalized and uses 3, 6 or 9\n  // fractional digits as required to represent the exact time. When\n  // parsing, any fractional digits (or none) and any offset are\n  // accepted as long as they fit into nano-seconds precision.\n  // Note that Timestamp can only represent time from\n  // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. Converting\n  // a Timestamp outside of this range is undefined behavior.\n  // See https://www.ietf.org/rfc/rfc3339.txt\n  //\n  // Example of generated format:\n  //   \"1972-01-01T10:00:20.021Z\"\n  //\n  // Example of accepted format:\n  //   \"1972-01-01T10:00:20.021-05:00\"\n  static string ToString(const Timestamp& timestamp);\n  static bool FromString(const string& value, Timestamp* timestamp);\n\n  // Converts Duration to/from string format. The string format will contains\n  // 3, 6, or 9 fractional digits depending on the precision required to\n  // represent the exact Duration value. For example:\n  //   \"1s\", \"1.010s\", \"1.000000100s\", \"-3.100s\"\n  // The range that can be represented by Duration is from -315,576,000,000\n  // to +315,576,000,000 inclusive (in seconds).\n  static string ToString(const Duration& duration);\n  static bool FromString(const string& value, Duration* timestamp);\n\n#ifdef GetCurrentTime\n#undef GetCurrentTime  // Visual Studio has macro GetCurrentTime\n#endif\n  // Gets the current UTC time.\n  static Timestamp GetCurrentTime();\n  // Returns the Time representing \"1970-01-01 00:00:00\".\n  static Timestamp GetEpoch();\n\n  // Converts between Duration and integer types. The behavior is undefined if\n  // the input value is not in the valid range of Duration.\n  static Duration NanosecondsToDuration(int64 nanos);\n  static Duration MicrosecondsToDuration(int64 micros);\n  static Duration MillisecondsToDuration(int64 millis);\n  static Duration SecondsToDuration(int64 seconds);\n  static Duration MinutesToDuration(int64 minutes);\n  static Duration HoursToDuration(int64 hours);\n  // Result will be truncated towards zero. For example, \"-1.5s\" will be\n  // truncated to \"-1s\", and \"1.5s\" to \"1s\" when converting to seconds.\n  // It's undefined behavior if the input duration is not valid or the result\n  // exceeds the range of int64. A duration is not valid if it's not in the\n  // valid range of Duration, or have an invalid nanos value (i.e., larger\n  // than 999999999, less than -999999999, or have a different sign from the\n  // seconds part).\n  static int64 DurationToNanoseconds(const Duration& duration);\n  static int64 DurationToMicroseconds(const Duration& duration);\n  static int64 DurationToMilliseconds(const Duration& duration);\n  static int64 DurationToSeconds(const Duration& duration);\n  static int64 DurationToMinutes(const Duration& duration);\n  static int64 DurationToHours(const Duration& duration);\n  // Creates Timestamp from integer types. The integer value indicates the\n  // time elapsed from Epoch time. The behavior is undefined if the input\n  // value is not in the valid range of Timestamp.\n  static Timestamp NanosecondsToTimestamp(int64 nanos);\n  static Timestamp MicrosecondsToTimestamp(int64 micros);\n  static Timestamp MillisecondsToTimestamp(int64 millis);\n  static Timestamp SecondsToTimestamp(int64 seconds);\n  // Result will be truncated down to the nearest integer value. For example,\n  // with \"1969-12-31T23:59:59.9Z\", TimestampToMilliseconds() returns -100\n  // and TimestampToSeconds() returns -1. It's undefined behavior if the input\n  // Timestamp is not valid (i.e., its seconds part or nanos part does not fall\n  // in the valid range) or the return value doesn't fit into int64.\n  static int64 TimestampToNanoseconds(const Timestamp& timestamp);\n  static int64 TimestampToMicroseconds(const Timestamp& timestamp);\n  static int64 TimestampToMilliseconds(const Timestamp& timestamp);\n  static int64 TimestampToSeconds(const Timestamp& timestamp);\n\n  // Conversion to/from other time/date types. Note that these types may\n  // have a different precision and time range from Timestamp/Duration.\n  // When converting to a lower precision type, the value will be truncated\n  // to the nearest value that can be represented. If the value is\n  // out of the range of the result type, the return value is undefined.\n  //\n  // Conversion to/from time_t\n  static Timestamp TimeTToTimestamp(time_t value);\n  static time_t TimestampToTimeT(const Timestamp& value);\n\n  // Conversion to/from timeval\n  static Timestamp TimevalToTimestamp(const timeval& value);\n  static timeval TimestampToTimeval(const Timestamp& value);\n  static Duration TimevalToDuration(const timeval& value);\n  static timeval DurationToTimeval(const Duration& value);\n};\n\n}  // namespace util\n}  // namespace protobuf\n\n\nnamespace protobuf {\n// Overloaded operators for Duration.\n//\n// Assignment operators.\nLIBPROTOBUF_EXPORT Duration& operator+=(Duration& d1, const Duration& d2);  // NOLINT\nLIBPROTOBUF_EXPORT Duration& operator-=(Duration& d1, const Duration& d2);  // NOLINT\nLIBPROTOBUF_EXPORT Duration& operator*=(Duration& d, int64 r);  // NOLINT\nLIBPROTOBUF_EXPORT Duration& operator*=(Duration& d, double r);  // NOLINT\nLIBPROTOBUF_EXPORT Duration& operator/=(Duration& d, int64 r);  // NOLINT\nLIBPROTOBUF_EXPORT Duration& operator/=(Duration& d, double r);  // NOLINT\n// Overload for other integer types.\ntemplate <typename T>\nDuration& operator*=(Duration& d, T r) {  // NOLINT\n  int64 x = r;\n  return d *= x;\n}\ntemplate <typename T>\nDuration& operator/=(Duration& d, T r) {  // NOLINT\n  int64 x = r;\n  return d /= x;\n}\nLIBPROTOBUF_EXPORT Duration& operator%=(Duration& d1, const Duration& d2);  // NOLINT\n// Relational operators.\ninline bool operator<(const Duration& d1, const Duration& d2) {\n  if (d1.seconds() == d2.seconds()) {\n    return d1.nanos() < d2.nanos();\n  }\n  return d1.seconds() < d2.seconds();\n}\ninline bool operator>(const Duration& d1, const Duration& d2) {\n  return d2 < d1;\n}\ninline bool operator>=(const Duration& d1, const Duration& d2) {\n  return !(d1 < d2);\n}\ninline bool operator<=(const Duration& d1, const Duration& d2) {\n  return !(d2 < d1);\n}\ninline bool operator==(const Duration& d1, const Duration& d2) {\n  return d1.seconds() == d2.seconds() && d1.nanos() == d2.nanos();\n}\ninline bool operator!=(const Duration& d1, const Duration& d2) {\n  return !(d1 == d2);\n}\n// Additive operators\ninline Duration operator-(const Duration& d) {\n  Duration result;\n  result.set_seconds(-d.seconds());\n  result.set_nanos(-d.nanos());\n  return result;\n}\ninline Duration operator+(const Duration& d1, const Duration& d2) {\n  Duration result = d1;\n  return result += d2;\n}\ninline Duration operator-(const Duration& d1, const Duration& d2) {\n  Duration result = d1;\n  return result -= d2;\n}\n// Multiplicative operators\ntemplate<typename T>\ninline Duration operator*(Duration d, T r) {\n  return d *= r;\n}\ntemplate<typename T>\ninline Duration operator*(T r, Duration d) {\n  return d *= r;\n}\ntemplate<typename T>\ninline Duration operator/(Duration d, T r) {\n  return d /= r;\n}\nLIBPROTOBUF_EXPORT int64 operator/(const Duration& d1, const Duration& d2);\n\ninline Duration operator%(const Duration& d1, const Duration& d2) {\n  Duration result = d1;\n  return result %= d2;\n}\n\ninline std::ostream& operator<<(std::ostream& out, const Duration& d) {\n  out << google::protobuf::util::TimeUtil::ToString(d);\n  return out;\n}\n\n// Overloaded operators for Timestamp\n//\n// Assignement operators.\nLIBPROTOBUF_EXPORT Timestamp& operator+=(Timestamp& t, const Duration& d);  // NOLINT\nLIBPROTOBUF_EXPORT Timestamp& operator-=(Timestamp& t, const Duration& d);  // NOLINT\n// Relational operators.\ninline bool operator<(const Timestamp& t1, const Timestamp& t2) {\n  if (t1.seconds() == t2.seconds()) {\n    return t1.nanos() < t2.nanos();\n  }\n  return t1.seconds() < t2.seconds();\n}\ninline bool operator>(const Timestamp& t1, const Timestamp& t2) {\n  return t2 < t1;\n}\ninline bool operator>=(const Timestamp& t1, const Timestamp& t2) {\n  return !(t1 < t2);\n}\ninline bool operator<=(const Timestamp& t1, const Timestamp& t2) {\n  return !(t2 < t1);\n}\ninline bool operator==(const Timestamp& t1, const Timestamp& t2) {\n  return t1.seconds() == t2.seconds() && t1.nanos() == t2.nanos();\n}\ninline bool operator!=(const Timestamp& t1, const Timestamp& t2) {\n  return !(t1 == t2);\n}\n// Additive operators.\ninline Timestamp operator+(const Timestamp& t, const Duration& d) {\n  Timestamp result = t;\n  return result += d;\n}\ninline Timestamp operator+(const Duration& d, const Timestamp& t) {\n  Timestamp result = t;\n  return result += d;\n}\ninline Timestamp operator-(const Timestamp& t, const Duration& d) {\n  Timestamp result = t;\n  return result -= d;\n}\nLIBPROTOBUF_EXPORT Duration operator-(const Timestamp& t1, const Timestamp& t2);\n\ninline std::ostream& operator<<(std::ostream& out, const Timestamp& t) {\n  out << google::protobuf::util::TimeUtil::ToString(t);\n  return out;\n}\n\n}  // namespace protobuf\n\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/util/type_resolver.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Defines a TypeResolver for the Any message.\n\n#ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__\n#define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/status.h>\n\n\nnamespace google {\nnamespace protobuf {\nclass Type;\nclass Enum;\n}  // namespace protobuf\n\n\nnamespace protobuf {\nclass DescriptorPool;\nnamespace util {\n\n// Abstract interface for a type resovler.\n//\n// Implementations of this interface must be thread-safe.\nclass LIBPROTOBUF_EXPORT TypeResolver {\n public:\n  TypeResolver() {}\n  virtual ~TypeResolver() {}\n\n  // Resolves a type url for a message type.\n  virtual util::Status ResolveMessageType(\n      const string& type_url, google::protobuf::Type* message_type) = 0;\n\n  // Resolves a type url for an enum type.\n  virtual util::Status ResolveEnumType(const string& type_url,\n                                         google::protobuf::Enum* enum_type) = 0;\n\n private:\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeResolver);\n};\n\n}  // namespace util\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/util/type_resolver_util.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Defines utilities for the TypeResolver.\n\n#ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__\n#define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\nnamespace google {\nnamespace protobuf {\nclass DescriptorPool;\nnamespace util {\nclass TypeResolver;\n\n// Creates a TypeResolver that serves type information in the given descriptor\n// pool. Caller takes ownership of the returned TypeResolver.\nLIBPROTOBUF_EXPORT TypeResolver* NewTypeResolverForDescriptorPool(\n    const string& url_prefix, const DescriptorPool* pool);\n\n}  // namespace util\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/wire_format.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//         atenasio@google.com (Chris Atenasio) (ZigZag transform)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This header is logically internal, but is made public because it is used\n// from protocol-compiler-generated code, which may reside in other components.\n\n#ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_H__\n#define GOOGLE_PROTOBUF_WIRE_FORMAT_H__\n\n#include <string>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/descriptor.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/wire_format_lite.h>\n\nnamespace google {\nnamespace protobuf {\n  namespace io {\n    class CodedInputStream;      // coded_stream.h\n    class CodedOutputStream;     // coded_stream.h\n  }\n  class UnknownFieldSet;         // unknown_field_set.h\n}\n\nnamespace protobuf {\nnamespace internal {\n\n// This class is for internal use by the protocol buffer library and by\n// protocol-complier-generated message classes.  It must not be called\n// directly by clients.\n//\n// This class contains code for implementing the binary protocol buffer\n// wire format via reflection.  The WireFormatLite class implements the\n// non-reflection based routines.\n//\n// This class is really a namespace that contains only static methods\nclass LIBPROTOBUF_EXPORT WireFormat {\n public:\n\n  // Given a field return its WireType\n  static inline WireFormatLite::WireType WireTypeForField(\n      const FieldDescriptor* field);\n\n  // Given a FieldDescriptor::Type return its WireType\n  static inline WireFormatLite::WireType WireTypeForFieldType(\n      FieldDescriptor::Type type);\n\n  // Compute the byte size of a tag.  For groups, this includes both the start\n  // and end tags.\n  static inline size_t TagSize(int field_number, FieldDescriptor::Type type);\n\n  // These procedures can be used to implement the methods of Message which\n  // handle parsing and serialization of the protocol buffer wire format\n  // using only the Reflection interface.  When you ask the protocol\n  // compiler to optimize for code size rather than speed, it will implement\n  // those methods in terms of these procedures.  Of course, these are much\n  // slower than the specialized implementations which the protocol compiler\n  // generates when told to optimize for speed.\n\n  // Read a message in protocol buffer wire format.\n  //\n  // This procedure reads either to the end of the input stream or through\n  // a WIRETYPE_END_GROUP tag ending the message, whichever comes first.\n  // It returns false if the input is invalid.\n  //\n  // Required fields are NOT checked by this method.  You must call\n  // IsInitialized() on the resulting message yourself.\n  static bool ParseAndMergePartial(io::CodedInputStream* input,\n                                   Message* message);\n\n  // Serialize a message in protocol buffer wire format.\n  //\n  // Any embedded messages within the message must have their correct sizes\n  // cached.  However, the top-level message need not; its size is passed as\n  // a parameter to this procedure.\n  //\n  // These return false iff the underlying stream returns a write error.\n  static void SerializeWithCachedSizes(\n      const Message& message,\n      int size, io::CodedOutputStream* output);\n\n  // Implements Message::ByteSize() via reflection.  WARNING:  The result\n  // of this method is *not* cached anywhere.  However, all embedded messages\n  // will have their ByteSize() methods called, so their sizes will be cached.\n  // Therefore, calling this method is sufficient to allow you to call\n  // WireFormat::SerializeWithCachedSizes() on the same object.\n  static size_t ByteSize(const Message& message);\n\n  // -----------------------------------------------------------------\n  // Helpers for dealing with unknown fields\n\n  // Skips a field value of the given WireType.  The input should start\n  // positioned immediately after the tag.  If unknown_fields is non-NULL,\n  // the contents of the field will be added to it.\n  static bool SkipField(io::CodedInputStream* input, uint32 tag,\n                        UnknownFieldSet* unknown_fields);\n\n  // Reads and ignores a message from the input.  If unknown_fields is non-NULL,\n  // the contents will be added to it.\n  static bool SkipMessage(io::CodedInputStream* input,\n                          UnknownFieldSet* unknown_fields);\n\n  // Read a packed enum field. If the is_valid function is not NULL, values for\n  // which is_valid(value) returns false are appended to unknown_fields_stream.\n  static bool ReadPackedEnumPreserveUnknowns(io::CodedInputStream* input,\n                                             uint32 field_number,\n                                             bool (*is_valid)(int),\n                                             UnknownFieldSet* unknown_fields,\n                                             RepeatedField<int>* values);\n\n  // Write the contents of an UnknownFieldSet to the output.\n  static void SerializeUnknownFields(const UnknownFieldSet& unknown_fields,\n                                     io::CodedOutputStream* output);\n  // Same as above, except writing directly to the provided buffer.\n  // Requires that the buffer have sufficient capacity for\n  // ComputeUnknownFieldsSize(unknown_fields).\n  //\n  // Returns a pointer past the last written byte.\n  static uint8* SerializeUnknownFieldsToArray(\n      const UnknownFieldSet& unknown_fields,\n      uint8* target);\n\n  // Same thing except for messages that have the message_set_wire_format\n  // option.\n  static void SerializeUnknownMessageSetItems(\n      const UnknownFieldSet& unknown_fields,\n      io::CodedOutputStream* output);\n  // Same as above, except writing directly to the provided buffer.\n  // Requires that the buffer have sufficient capacity for\n  // ComputeUnknownMessageSetItemsSize(unknown_fields).\n  //\n  // Returns a pointer past the last written byte.\n  static uint8* SerializeUnknownMessageSetItemsToArray(\n      const UnknownFieldSet& unknown_fields,\n      uint8* target);\n\n  // Compute the size of the UnknownFieldSet on the wire.\n  static size_t ComputeUnknownFieldsSize(const UnknownFieldSet& unknown_fields);\n\n  // Same thing except for messages that have the message_set_wire_format\n  // option.\n  static size_t ComputeUnknownMessageSetItemsSize(\n      const UnknownFieldSet& unknown_fields);\n\n\n  // Helper functions for encoding and decoding tags.  (Inlined below and in\n  // _inl.h)\n  //\n  // This is different from MakeTag(field->number(), field->type()) in the case\n  // of packed repeated fields.\n  static uint32 MakeTag(const FieldDescriptor* field);\n\n  // Parse a single field.  The input should start out positioned immediately\n  // after the tag.\n  static bool ParseAndMergeField(\n      uint32 tag,\n      const FieldDescriptor* field,        // May be NULL for unknown\n      Message* message,\n      io::CodedInputStream* input);\n\n  // Serialize a single field.\n  static void SerializeFieldWithCachedSizes(\n      const FieldDescriptor* field,        // Cannot be NULL\n      const Message& message,\n      io::CodedOutputStream* output);\n\n  // Compute size of a single field.  If the field is a message type, this\n  // will call ByteSize() for the embedded message, insuring that it caches\n  // its size.\n  static size_t FieldByteSize(\n      const FieldDescriptor* field,        // Cannot be NULL\n      const Message& message);\n\n  // Parse/serialize a MessageSet::Item group.  Used with messages that use\n  // opion message_set_wire_format = true.\n  static bool ParseAndMergeMessageSetItem(\n      io::CodedInputStream* input,\n      Message* message);\n  static void SerializeMessageSetItemWithCachedSizes(\n      const FieldDescriptor* field,\n      const Message& message,\n      io::CodedOutputStream* output);\n  static size_t MessageSetItemByteSize(\n      const FieldDescriptor* field,\n      const Message& message);\n\n  // Computes the byte size of a field, excluding tags. For packed fields, it\n  // only includes the size of the raw data, and not the size of the total\n  // length, but for other length-delimited types, the size of the length is\n  // included.\n  static size_t FieldDataOnlyByteSize(\n      const FieldDescriptor* field,        // Cannot be NULL\n      const Message& message);\n\n  enum Operation {\n    PARSE = 0,\n    SERIALIZE = 1,\n  };\n\n  // Verifies that a string field is valid UTF8, logging an error if not.\n  // This function will not be called by newly generated protobuf code\n  // but remains present to support existing code.\n  static void VerifyUTF8String(const char* data, int size, Operation op);\n  // The NamedField variant takes a field name in order to produce an\n  // informative error message if verification fails.\n  static void VerifyUTF8StringNamedField(const char* data,\n                                         int size,\n                                         Operation op,\n                                         const char* field_name);\n\n private:\n  // Skip a MessageSet field.\n  static bool SkipMessageSetField(io::CodedInputStream* input,\n                                  uint32 field_number,\n                                  UnknownFieldSet* unknown_fields);\n\n  // Parse a MessageSet field.\n  static bool ParseAndMergeMessageSetField(uint32 field_number,\n                                           const FieldDescriptor* field,\n                                           Message* message,\n                                           io::CodedInputStream* input);\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(WireFormat);\n};\n\n// Subclass of FieldSkipper which saves skipped fields to an UnknownFieldSet.\nclass LIBPROTOBUF_EXPORT UnknownFieldSetFieldSkipper : public FieldSkipper {\n public:\n  UnknownFieldSetFieldSkipper(UnknownFieldSet* unknown_fields)\n      : unknown_fields_(unknown_fields) {}\n  virtual ~UnknownFieldSetFieldSkipper() {}\n\n  // implements FieldSkipper -----------------------------------------\n  virtual bool SkipField(io::CodedInputStream* input, uint32 tag);\n  virtual bool SkipMessage(io::CodedInputStream* input);\n  virtual void SkipUnknownEnum(int field_number, int value);\n\n protected:\n  UnknownFieldSet* unknown_fields_;\n};\n\n// inline methods ====================================================\n\ninline WireFormatLite::WireType WireFormat::WireTypeForField(\n    const FieldDescriptor* field) {\n  if (field->is_packed()) {\n    return WireFormatLite::WIRETYPE_LENGTH_DELIMITED;\n  } else {\n    return WireTypeForFieldType(field->type());\n  }\n}\n\ninline WireFormatLite::WireType WireFormat::WireTypeForFieldType(\n    FieldDescriptor::Type type) {\n  // Some compilers don't like enum -> enum casts, so we implicit_cast to\n  // int first.\n  return WireFormatLite::WireTypeForFieldType(\n      static_cast<WireFormatLite::FieldType>(\n        implicit_cast<int>(type)));\n}\n\ninline uint32 WireFormat::MakeTag(const FieldDescriptor* field) {\n  return WireFormatLite::MakeTag(field->number(), WireTypeForField(field));\n}\n\ninline size_t WireFormat::TagSize(int field_number,\n                                  FieldDescriptor::Type type) {\n  // Some compilers don't like enum -> enum casts, so we implicit_cast to\n  // int first.\n  return WireFormatLite::TagSize(field_number,\n      static_cast<WireFormatLite::FieldType>(\n        implicit_cast<int>(type)));\n}\n\ninline void WireFormat::VerifyUTF8String(const char* data, int size,\n    WireFormat::Operation op) {\n#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED\n  WireFormatLite::VerifyUtf8String(\n      data, size, static_cast<WireFormatLite::Operation>(op), NULL);\n#else\n  // Avoid the compiler warning about unused variables.\n  (void)data; (void)size; (void)op;\n#endif\n}\n\ninline void WireFormat::VerifyUTF8StringNamedField(\n    const char* data, int size, WireFormat::Operation op,\n    const char* field_name) {\n#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED\n  WireFormatLite::VerifyUtf8String(\n      data, size, static_cast<WireFormatLite::Operation>(op), field_name);\n#else\n  // Avoid the compiler warning about unused variables.\n  (void)data; (void)size; (void)op; (void)field_name;\n#endif\n}\n\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_WIRE_FORMAT_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/wire_format_lite.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//         atenasio@google.com (Chris Atenasio) (ZigZag transform)\n//         wink@google.com (Wink Saville) (refactored from wire_format.h)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// This header is logically internal, but is made public because it is used\n// from protocol-compiler-generated code, which may reside in other components.\n\n#ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__\n#define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/message_lite.h>\n#include <google/protobuf/stubs/port.h>\n#include <google/protobuf/repeated_field.h>\n\n// Do UTF-8 validation on string type in Debug build only\n#ifndef NDEBUG\n#define GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED\n#endif\n\n// Avoid conflict with iOS where <ConditionalMacros.h> #defines TYPE_BOOL.\n//\n// If some one needs the macro TYPE_BOOL in a file that includes this header, it's\n// possible to bring it back using push/pop_macro as follows.\n//\n// #pragma push_macro(\"TYPE_BOOL\")\n// #include this header and/or all headers that need the macro to be undefined.\n// #pragma pop_macro(\"TYPE_BOOL\")\n#undef TYPE_BOOL\n\nnamespace google {\n\nnamespace protobuf {\n  template <typename T> class RepeatedField;  // repeated_field.h\n}\n\nnamespace protobuf {\nnamespace internal {\n\nclass StringPieceField;\n\n// This class is for internal use by the protocol buffer library and by\n// protocol-complier-generated message classes.  It must not be called\n// directly by clients.\n//\n// This class contains helpers for implementing the binary protocol buffer\n// wire format without the need for reflection. Use WireFormat when using\n// reflection.\n//\n// This class is really a namespace that contains only static methods.\nclass LIBPROTOBUF_EXPORT WireFormatLite {\n public:\n\n  // -----------------------------------------------------------------\n  // Helper constants and functions related to the format.  These are\n  // mostly meant for internal and generated code to use.\n\n  // The wire format is composed of a sequence of tag/value pairs, each\n  // of which contains the value of one field (or one element of a repeated\n  // field).  Each tag is encoded as a varint.  The lower bits of the tag\n  // identify its wire type, which specifies the format of the data to follow.\n  // The rest of the bits contain the field number.  Each type of field (as\n  // declared by FieldDescriptor::Type, in descriptor.h) maps to one of\n  // these wire types.  Immediately following each tag is the field's value,\n  // encoded in the format specified by the wire type.  Because the tag\n  // identifies the encoding of this data, it is possible to skip\n  // unrecognized fields for forwards compatibility.\n\n  enum WireType {\n    WIRETYPE_VARINT           = 0,\n    WIRETYPE_FIXED64          = 1,\n    WIRETYPE_LENGTH_DELIMITED = 2,\n    WIRETYPE_START_GROUP      = 3,\n    WIRETYPE_END_GROUP        = 4,\n    WIRETYPE_FIXED32          = 5,\n  };\n\n  // Lite alternative to FieldDescriptor::Type.  Must be kept in sync.\n  enum FieldType {\n    TYPE_DOUBLE         = 1,\n    TYPE_FLOAT          = 2,\n    TYPE_INT64          = 3,\n    TYPE_UINT64         = 4,\n    TYPE_INT32          = 5,\n    TYPE_FIXED64        = 6,\n    TYPE_FIXED32        = 7,\n    TYPE_BOOL           = 8,\n    TYPE_STRING         = 9,\n    TYPE_GROUP          = 10,\n    TYPE_MESSAGE        = 11,\n    TYPE_BYTES          = 12,\n    TYPE_UINT32         = 13,\n    TYPE_ENUM           = 14,\n    TYPE_SFIXED32       = 15,\n    TYPE_SFIXED64       = 16,\n    TYPE_SINT32         = 17,\n    TYPE_SINT64         = 18,\n    MAX_FIELD_TYPE      = 18,\n  };\n\n  // Lite alternative to FieldDescriptor::CppType.  Must be kept in sync.\n  enum CppType {\n    CPPTYPE_INT32       = 1,\n    CPPTYPE_INT64       = 2,\n    CPPTYPE_UINT32      = 3,\n    CPPTYPE_UINT64      = 4,\n    CPPTYPE_DOUBLE      = 5,\n    CPPTYPE_FLOAT       = 6,\n    CPPTYPE_BOOL        = 7,\n    CPPTYPE_ENUM        = 8,\n    CPPTYPE_STRING      = 9,\n    CPPTYPE_MESSAGE     = 10,\n    MAX_CPPTYPE         = 10,\n  };\n\n  // Helper method to get the CppType for a particular Type.\n  static CppType FieldTypeToCppType(FieldType type);\n\n  // Given a FieldDescriptor::Type return its WireType\n  static inline WireFormatLite::WireType WireTypeForFieldType(\n      WireFormatLite::FieldType type) {\n    return kWireTypeForFieldType[type];\n  }\n\n  // Number of bits in a tag which identify the wire type.\n  static const int kTagTypeBits = 3;\n  // Mask for those bits.\n  static const uint32 kTagTypeMask = (1 << kTagTypeBits) - 1;\n\n  // Helper functions for encoding and decoding tags.  (Inlined below and in\n  // _inl.h)\n  //\n  // This is different from MakeTag(field->number(), field->type()) in the case\n  // of packed repeated fields.\n  static uint32 MakeTag(int field_number, WireType type);\n  static WireType GetTagWireType(uint32 tag);\n  static int GetTagFieldNumber(uint32 tag);\n\n  // Compute the byte size of a tag.  For groups, this includes both the start\n  // and end tags.\n  static inline size_t TagSize(int field_number,\n                               WireFormatLite::FieldType type);\n\n  // Skips a field value with the given tag.  The input should start\n  // positioned immediately after the tag.  Skipped values are simply discarded,\n  // not recorded anywhere.  See WireFormat::SkipField() for a version that\n  // records to an UnknownFieldSet.\n  static bool SkipField(io::CodedInputStream* input, uint32 tag);\n\n  // Skips a field value with the given tag.  The input should start\n  // positioned immediately after the tag. Skipped values are recorded to a\n  // CodedOutputStream.\n  static bool SkipField(io::CodedInputStream* input, uint32 tag,\n                        io::CodedOutputStream* output);\n\n  // Reads and ignores a message from the input.  Skipped values are simply\n  // discarded, not recorded anywhere.  See WireFormat::SkipMessage() for a\n  // version that records to an UnknownFieldSet.\n  static bool SkipMessage(io::CodedInputStream* input);\n\n  // Reads and ignores a message from the input.  Skipped values are recorded\n  // to a CodedOutputStream.\n  static bool SkipMessage(io::CodedInputStream* input,\n                          io::CodedOutputStream* output);\n\n// This macro does the same thing as WireFormatLite::MakeTag(), but the\n// result is usable as a compile-time constant, which makes it usable\n// as a switch case or a template input.  WireFormatLite::MakeTag() is more\n// type-safe, though, so prefer it if possible.\n#define GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(FIELD_NUMBER, TYPE)                  \\\n  static_cast<uint32>(                                                   \\\n    (static_cast<uint32>(FIELD_NUMBER) << ::google::protobuf::internal::WireFormatLite::kTagTypeBits) \\\n      | (TYPE))\n\n  // These are the tags for the old MessageSet format, which was defined as:\n  //   message MessageSet {\n  //     repeated group Item = 1 {\n  //       required int32 type_id = 2;\n  //       required string message = 3;\n  //     }\n  //   }\n  static const int kMessageSetItemNumber = 1;\n  static const int kMessageSetTypeIdNumber = 2;\n  static const int kMessageSetMessageNumber = 3;\n  static const int kMessageSetItemStartTag =\n    GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetItemNumber,\n                                WireFormatLite::WIRETYPE_START_GROUP);\n  static const int kMessageSetItemEndTag =\n    GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetItemNumber,\n                                WireFormatLite::WIRETYPE_END_GROUP);\n  static const int kMessageSetTypeIdTag =\n    GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetTypeIdNumber,\n                                WireFormatLite::WIRETYPE_VARINT);\n  static const int kMessageSetMessageTag =\n    GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetMessageNumber,\n                                WireFormatLite::WIRETYPE_LENGTH_DELIMITED);\n\n  // Byte size of all tags of a MessageSet::Item combined.\n  static const size_t kMessageSetItemTagsSize;\n\n  // Helper functions for converting between floats/doubles and IEEE-754\n  // uint32s/uint64s so that they can be written.  (Assumes your platform\n  // uses IEEE-754 floats.)\n  static uint32 EncodeFloat(float value);\n  static float DecodeFloat(uint32 value);\n  static uint64 EncodeDouble(double value);\n  static double DecodeDouble(uint64 value);\n\n  // Helper functions for mapping signed integers to unsigned integers in\n  // such a way that numbers with small magnitudes will encode to smaller\n  // varints.  If you simply static_cast a negative number to an unsigned\n  // number and varint-encode it, it will always take 10 bytes, defeating\n  // the purpose of varint.  So, for the \"sint32\" and \"sint64\" field types,\n  // we ZigZag-encode the values.\n  static uint32 ZigZagEncode32(int32 n);\n  static int32  ZigZagDecode32(uint32 n);\n  static uint64 ZigZagEncode64(int64 n);\n  static int64  ZigZagDecode64(uint64 n);\n\n  // =================================================================\n  // Methods for reading/writing individual field.  The implementations\n  // of these methods are defined in wire_format_lite_inl.h; you must #include\n  // that file to use these.\n\n#ifdef NDEBUG\n#define INL GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n#else\n// Avoid excessive inlining in non-optimized builds. Without other optimizations\n// the inlining is not going to provide benefits anyway and the huge resulting\n// functions, especially in the proto-generated serialization functions, produce\n// stack frames so large that many tests run into stack overflows (b/32192897).\n#define INL\n#endif\n\n  // Read fields, not including tags.  The assumption is that you already\n  // read the tag to determine what field to read.\n\n  // For primitive fields, we just use a templatized routine parameterized by\n  // the represented type and the FieldType. These are specialized with the\n  // appropriate definition for each declared type.\n  template <typename CType, enum FieldType DeclaredType>\n  INL static bool ReadPrimitive(io::CodedInputStream* input, CType* value);\n\n  // Reads repeated primitive values, with optimizations for repeats.\n  // tag_size and tag should both be compile-time constants provided by the\n  // protocol compiler.\n  template <typename CType, enum FieldType DeclaredType>\n  INL static bool ReadRepeatedPrimitive(int tag_size, uint32 tag,\n                                        io::CodedInputStream* input,\n                                        RepeatedField<CType>* value);\n\n  // Identical to ReadRepeatedPrimitive, except will not inline the\n  // implementation.\n  template <typename CType, enum FieldType DeclaredType>\n  static bool ReadRepeatedPrimitiveNoInline(int tag_size, uint32 tag,\n                                            io::CodedInputStream* input,\n                                            RepeatedField<CType>* value);\n\n  // Reads a primitive value directly from the provided buffer. It returns a\n  // pointer past the segment of data that was read.\n  //\n  // This is only implemented for the types with fixed wire size, e.g.\n  // float, double, and the (s)fixed* types.\n  template <typename CType, enum FieldType DeclaredType> INL\n  static const uint8* ReadPrimitiveFromArray(const uint8* buffer, CType* value);\n\n  // Reads a primitive packed field.\n  //\n  // This is only implemented for packable types.\n  template <typename CType, enum FieldType DeclaredType>\n  INL static bool ReadPackedPrimitive(io::CodedInputStream* input,\n                                      RepeatedField<CType>* value);\n\n  // Identical to ReadPackedPrimitive, except will not inline the\n  // implementation.\n  template <typename CType, enum FieldType DeclaredType>\n  static bool ReadPackedPrimitiveNoInline(io::CodedInputStream* input,\n                                          RepeatedField<CType>* value);\n\n  // Read a packed enum field. If the is_valid function is not NULL, values for\n  // which is_valid(value) returns false are silently dropped.\n  static bool ReadPackedEnumNoInline(io::CodedInputStream* input,\n                                     bool (*is_valid)(int),\n                                     RepeatedField<int>* values);\n\n  // Read a packed enum field. If the is_valid function is not NULL, values for\n  // which is_valid(value) returns false are appended to unknown_fields_stream.\n  static bool ReadPackedEnumPreserveUnknowns(\n      io::CodedInputStream* input, int field_number, bool (*is_valid)(int),\n      io::CodedOutputStream* unknown_fields_stream, RepeatedField<int>* values);\n\n  // Read a string.  ReadString(..., string* value) requires an existing string.\n  static inline bool ReadString(io::CodedInputStream* input, string* value);\n  // ReadString(..., string** p) is internal-only, and should only be called\n  // from generated code. It starts by setting *p to \"new string\"\n  // if *p == &GetEmptyStringAlreadyInited().  It then invokes\n  // ReadString(io::CodedInputStream* input, *p).  This is useful for reducing\n  // code size.\n  static inline bool ReadString(io::CodedInputStream* input, string** p);\n  // Analogous to ReadString().\n  static bool ReadBytes(io::CodedInputStream* input, string* value);\n  static bool ReadBytes(io::CodedInputStream* input, string** p);\n\n  enum Operation {\n    PARSE = 0,\n    SERIALIZE = 1,\n  };\n\n  // Returns true if the data is valid UTF-8.\n  static bool VerifyUtf8String(const char* data, int size,\n                               Operation op,\n                               const char* field_name);\n\n  template <typename MessageType>\n  static inline bool ReadGroup(int field_number, io::CodedInputStream* input,\n                               MessageType* value);\n\n  template <typename MessageType>\n  static inline bool ReadMessage(io::CodedInputStream* input,\n                                 MessageType* value);\n\n  // Do not use.\n  template <typename MessageType>\n  static inline bool ReadGroupNoVirtual(int field_number,\n                                        io::CodedInputStream* input,\n                                        MessageType* value) {\n    return ReadGroup(field_number, input, value);\n  }\n\n  template<typename MessageType>\n  static inline bool ReadMessageNoVirtual(io::CodedInputStream* input,\n                                          MessageType* value) {\n    return ReadMessage(input, value);\n  }\n\n  // Write a tag.  The Write*() functions typically include the tag, so\n  // normally there's no need to call this unless using the Write*NoTag()\n  // variants.\n  INL static void WriteTag(int field_number, WireType type,\n                           io::CodedOutputStream* output);\n\n  // Write fields, without tags.\n  INL static void WriteInt32NoTag(int32 value, io::CodedOutputStream* output);\n  INL static void WriteInt64NoTag(int64 value, io::CodedOutputStream* output);\n  INL static void WriteUInt32NoTag(uint32 value, io::CodedOutputStream* output);\n  INL static void WriteUInt64NoTag(uint64 value, io::CodedOutputStream* output);\n  INL static void WriteSInt32NoTag(int32 value, io::CodedOutputStream* output);\n  INL static void WriteSInt64NoTag(int64 value, io::CodedOutputStream* output);\n  INL static void WriteFixed32NoTag(uint32 value,\n                                    io::CodedOutputStream* output);\n  INL static void WriteFixed64NoTag(uint64 value,\n                                    io::CodedOutputStream* output);\n  INL static void WriteSFixed32NoTag(int32 value,\n                                     io::CodedOutputStream* output);\n  INL static void WriteSFixed64NoTag(int64 value,\n                                     io::CodedOutputStream* output);\n  INL static void WriteFloatNoTag(float value, io::CodedOutputStream* output);\n  INL static void WriteDoubleNoTag(double value, io::CodedOutputStream* output);\n  INL static void WriteBoolNoTag(bool value, io::CodedOutputStream* output);\n  INL static void WriteEnumNoTag(int value, io::CodedOutputStream* output);\n\n  // Write array of primitive fields, without tags\n  static void WriteFloatArray(const float* a, int n,\n                              io::CodedOutputStream* output);\n  static void WriteDoubleArray(const double* a, int n,\n                               io::CodedOutputStream* output);\n  static void WriteFixed32Array(const uint32* a, int n,\n                                io::CodedOutputStream* output);\n  static void WriteFixed64Array(const uint64* a, int n,\n                                io::CodedOutputStream* output);\n  static void WriteSFixed32Array(const int32* a, int n,\n                                 io::CodedOutputStream* output);\n  static void WriteSFixed64Array(const int64* a, int n,\n                                 io::CodedOutputStream* output);\n  static void WriteBoolArray(const bool* a, int n,\n                             io::CodedOutputStream* output);\n\n  // Write fields, including tags.\n  static void WriteInt32(int field_number, int32 value,\n                         io::CodedOutputStream* output);\n  static void WriteInt64(int field_number, int64 value,\n                         io::CodedOutputStream* output);\n  static void WriteUInt32(int field_number, uint32 value,\n                          io::CodedOutputStream* output);\n  static void WriteUInt64(int field_number, uint64 value,\n                          io::CodedOutputStream* output);\n  static void WriteSInt32(int field_number, int32 value,\n                          io::CodedOutputStream* output);\n  static void WriteSInt64(int field_number, int64 value,\n                          io::CodedOutputStream* output);\n  static void WriteFixed32(int field_number, uint32 value,\n                           io::CodedOutputStream* output);\n  static void WriteFixed64(int field_number, uint64 value,\n                           io::CodedOutputStream* output);\n  static void WriteSFixed32(int field_number, int32 value,\n                            io::CodedOutputStream* output);\n  static void WriteSFixed64(int field_number, int64 value,\n                            io::CodedOutputStream* output);\n  static void WriteFloat(int field_number, float value,\n                         io::CodedOutputStream* output);\n  static void WriteDouble(int field_number, double value,\n                          io::CodedOutputStream* output);\n  static void WriteBool(int field_number, bool value,\n                        io::CodedOutputStream* output);\n  static void WriteEnum(int field_number, int value,\n                        io::CodedOutputStream* output);\n\n  static void WriteString(int field_number, const string& value,\n                          io::CodedOutputStream* output);\n  static void WriteBytes(int field_number, const string& value,\n                         io::CodedOutputStream* output);\n  static void WriteStringMaybeAliased(int field_number, const string& value,\n                                      io::CodedOutputStream* output);\n  static void WriteBytesMaybeAliased(int field_number, const string& value,\n                                     io::CodedOutputStream* output);\n\n  static void WriteGroup(int field_number, const MessageLite& value,\n                         io::CodedOutputStream* output);\n  static void WriteMessage(int field_number, const MessageLite& value,\n                           io::CodedOutputStream* output);\n  // Like above, but these will check if the output stream has enough\n  // space to write directly to a flat array.\n  static void WriteGroupMaybeToArray(int field_number, const MessageLite& value,\n                                     io::CodedOutputStream* output);\n  static void WriteMessageMaybeToArray(int field_number,\n                                       const MessageLite& value,\n                                       io::CodedOutputStream* output);\n\n  // Like above, but de-virtualize the call to SerializeWithCachedSizes().  The\n  // pointer must point at an instance of MessageType, *not* a subclass (or\n  // the subclass must not override SerializeWithCachedSizes()).\n  template <typename MessageType>\n  static inline void WriteGroupNoVirtual(int field_number,\n                                         const MessageType& value,\n                                         io::CodedOutputStream* output);\n  template <typename MessageType>\n  static inline void WriteMessageNoVirtual(int field_number,\n                                           const MessageType& value,\n                                           io::CodedOutputStream* output);\n\n  // Like above, but use only *ToArray methods of CodedOutputStream.\n  INL static uint8* WriteTagToArray(int field_number, WireType type,\n                                    uint8* target);\n\n  // Write fields, without tags.\n  INL static uint8* WriteInt32NoTagToArray(int32 value, uint8* target);\n  INL static uint8* WriteInt64NoTagToArray(int64 value, uint8* target);\n  INL static uint8* WriteUInt32NoTagToArray(uint32 value, uint8* target);\n  INL static uint8* WriteUInt64NoTagToArray(uint64 value, uint8* target);\n  INL static uint8* WriteSInt32NoTagToArray(int32 value, uint8* target);\n  INL static uint8* WriteSInt64NoTagToArray(int64 value, uint8* target);\n  INL static uint8* WriteFixed32NoTagToArray(uint32 value, uint8* target);\n  INL static uint8* WriteFixed64NoTagToArray(uint64 value, uint8* target);\n  INL static uint8* WriteSFixed32NoTagToArray(int32 value, uint8* target);\n  INL static uint8* WriteSFixed64NoTagToArray(int64 value, uint8* target);\n  INL static uint8* WriteFloatNoTagToArray(float value, uint8* target);\n  INL static uint8* WriteDoubleNoTagToArray(double value, uint8* target);\n  INL static uint8* WriteBoolNoTagToArray(bool value, uint8* target);\n  INL static uint8* WriteEnumNoTagToArray(int value, uint8* target);\n\n  // Write fields, without tags.  These require that value.size() > 0.\n  template<typename T>\n  INL static uint8* WritePrimitiveNoTagToArray(\n      const RepeatedField<T>& value,\n      uint8* (*Writer)(T, uint8*), uint8* target);\n  template<typename T>\n  INL static uint8* WriteFixedNoTagToArray(\n      const RepeatedField<T>& value,\n      uint8* (*Writer)(T, uint8*), uint8* target);\n\n  INL static uint8* WriteInt32NoTagToArray(\n      const RepeatedField< int32>& value, uint8* output);\n  INL static uint8* WriteInt64NoTagToArray(\n      const RepeatedField< int64>& value, uint8* output);\n  INL static uint8* WriteUInt32NoTagToArray(\n      const RepeatedField<uint32>& value, uint8* output);\n  INL static uint8* WriteUInt64NoTagToArray(\n      const RepeatedField<uint64>& value, uint8* output);\n  INL static uint8* WriteSInt32NoTagToArray(\n      const RepeatedField< int32>& value, uint8* output);\n  INL static uint8* WriteSInt64NoTagToArray(\n      const RepeatedField< int64>& value, uint8* output);\n  INL static uint8* WriteFixed32NoTagToArray(\n      const RepeatedField<uint32>& value, uint8* output);\n  INL static uint8* WriteFixed64NoTagToArray(\n      const RepeatedField<uint64>& value, uint8* output);\n  INL static uint8* WriteSFixed32NoTagToArray(\n      const RepeatedField< int32>& value, uint8* output);\n  INL static uint8* WriteSFixed64NoTagToArray(\n      const RepeatedField< int64>& value, uint8* output);\n  INL static uint8* WriteFloatNoTagToArray(\n      const RepeatedField< float>& value, uint8* output);\n  INL static uint8* WriteDoubleNoTagToArray(\n      const RepeatedField<double>& value, uint8* output);\n  INL static uint8* WriteBoolNoTagToArray(\n      const RepeatedField<  bool>& value, uint8* output);\n  INL static uint8* WriteEnumNoTagToArray(\n      const RepeatedField<   int>& value, uint8* output);\n\n  // Write fields, including tags.\n  INL static uint8* WriteInt32ToArray(int field_number, int32 value,\n                                      uint8* target);\n  INL static uint8* WriteInt64ToArray(int field_number, int64 value,\n                                      uint8* target);\n  INL static uint8* WriteUInt32ToArray(int field_number, uint32 value,\n                                       uint8* target);\n  INL static uint8* WriteUInt64ToArray(int field_number, uint64 value,\n                                       uint8* target);\n  INL static uint8* WriteSInt32ToArray(int field_number, int32 value,\n                                       uint8* target);\n  INL static uint8* WriteSInt64ToArray(int field_number, int64 value,\n                                       uint8* target);\n  INL static uint8* WriteFixed32ToArray(int field_number, uint32 value,\n                                        uint8* target);\n  INL static uint8* WriteFixed64ToArray(int field_number, uint64 value,\n                                        uint8* target);\n  INL static uint8* WriteSFixed32ToArray(int field_number, int32 value,\n                                         uint8* target);\n  INL static uint8* WriteSFixed64ToArray(int field_number, int64 value,\n                                         uint8* target);\n  INL static uint8* WriteFloatToArray(int field_number, float value,\n                                      uint8* target);\n  INL static uint8* WriteDoubleToArray(int field_number, double value,\n                                       uint8* target);\n  INL static uint8* WriteBoolToArray(int field_number, bool value,\n                                     uint8* target);\n  INL static uint8* WriteEnumToArray(int field_number, int value,\n                                     uint8* target);\n\n  template<typename T>\n  INL static uint8* WritePrimitiveToArray(\n      int field_number,\n      const RepeatedField<T>& value,\n      uint8* (*Writer)(int, T, uint8*), uint8* target);\n\n  INL static uint8* WriteInt32ToArray(\n      int field_number, const RepeatedField< int32>& value, uint8* output);\n  INL static uint8* WriteInt64ToArray(\n      int field_number, const RepeatedField< int64>& value, uint8* output);\n  INL static uint8* WriteUInt32ToArray(\n      int field_number, const RepeatedField<uint32>& value, uint8* output);\n  INL static uint8* WriteUInt64ToArray(\n      int field_number, const RepeatedField<uint64>& value, uint8* output);\n  INL static uint8* WriteSInt32ToArray(\n      int field_number, const RepeatedField< int32>& value, uint8* output);\n  INL static uint8* WriteSInt64ToArray(\n      int field_number, const RepeatedField< int64>& value, uint8* output);\n  INL static uint8* WriteFixed32ToArray(\n      int field_number, const RepeatedField<uint32>& value, uint8* output);\n  INL static uint8* WriteFixed64ToArray(\n      int field_number, const RepeatedField<uint64>& value, uint8* output);\n  INL static uint8* WriteSFixed32ToArray(\n      int field_number, const RepeatedField< int32>& value, uint8* output);\n  INL static uint8* WriteSFixed64ToArray(\n      int field_number, const RepeatedField< int64>& value, uint8* output);\n  INL static uint8* WriteFloatToArray(\n      int field_number, const RepeatedField< float>& value, uint8* output);\n  INL static uint8* WriteDoubleToArray(\n      int field_number, const RepeatedField<double>& value, uint8* output);\n  INL static uint8* WriteBoolToArray(\n      int field_number, const RepeatedField<  bool>& value, uint8* output);\n  INL static uint8* WriteEnumToArray(\n      int field_number, const RepeatedField<   int>& value, uint8* output);\n\n  INL static uint8* WriteStringToArray(int field_number, const string& value,\n                                       uint8* target);\n  INL static uint8* WriteBytesToArray(int field_number, const string& value,\n                                      uint8* target);\n\n  // Whether to serialize deterministically (e.g., map keys are\n  // sorted) is a property of a CodedOutputStream, and in the process\n  // of serialization, the \"ToArray\" variants may be invoked.  But they don't\n  // have a CodedOutputStream available, so they get an additional parameter\n  // telling them whether to serialize deterministically.\n  template<typename MessageType>\n  INL static uint8* InternalWriteGroupToArray(int field_number,\n                                              const MessageType& value,\n                                              bool deterministic,\n                                              uint8* target);\n  template<typename MessageType>\n  INL static uint8* InternalWriteMessageToArray(int field_number,\n                                                const MessageType& value,\n                                                bool deterministic,\n                                                uint8* target);\n\n  // Like above, but de-virtualize the call to SerializeWithCachedSizes().  The\n  // pointer must point at an instance of MessageType, *not* a subclass (or\n  // the subclass must not override SerializeWithCachedSizes()).\n  template <typename MessageType>\n  INL static uint8* InternalWriteGroupNoVirtualToArray(int field_number,\n                                                       const MessageType& value,\n                                                       bool deterministic,\n                                                       uint8* target);\n  template <typename MessageType>\n  INL static uint8* InternalWriteMessageNoVirtualToArray(\n      int field_number, const MessageType& value, bool deterministic,\n      uint8* target);\n\n  // For backward-compatibility, the last four methods also have versions\n  // that are non-deterministic always.\n  INL static uint8* WriteGroupToArray(int field_number,\n                                      const MessageLite& value, uint8* target) {\n    return InternalWriteGroupToArray(field_number, value, false, target);\n  }\n  INL static uint8* WriteMessageToArray(int field_number,\n                                        const MessageLite& value,\n                                        uint8* target) {\n    return InternalWriteMessageToArray(field_number, value, false, target);\n  }\n  template <typename MessageType>\n  INL static uint8* WriteGroupNoVirtualToArray(int field_number,\n                                               const MessageType& value,\n                                               uint8* target) {\n    return InternalWriteGroupNoVirtualToArray(field_number, value, false,\n                                              target);\n  }\n  template <typename MessageType>\n  INL static uint8* WriteMessageNoVirtualToArray(int field_number,\n                                                 const MessageType& value,\n                                                 uint8* target) {\n    return InternalWriteMessageNoVirtualToArray(field_number, value, false,\n                                                target);\n  }\n\n#undef INL\n\n  // Compute the byte size of a field.  The XxSize() functions do NOT include\n  // the tag, so you must also call TagSize().  (This is because, for repeated\n  // fields, you should only call TagSize() once and multiply it by the element\n  // count, but you may have to call XxSize() for each individual element.)\n  static inline size_t Int32Size   ( int32 value);\n  static inline size_t Int64Size   ( int64 value);\n  static inline size_t UInt32Size  (uint32 value);\n  static inline size_t UInt64Size  (uint64 value);\n  static inline size_t SInt32Size  ( int32 value);\n  static inline size_t SInt64Size  ( int64 value);\n  static inline size_t EnumSize    (   int value);\n\n  static size_t Int32Size (const RepeatedField< int32>& value);\n  static size_t Int64Size (const RepeatedField< int64>& value);\n  static size_t UInt32Size(const RepeatedField<uint32>& value);\n  static size_t UInt64Size(const RepeatedField<uint64>& value);\n  static size_t SInt32Size(const RepeatedField< int32>& value);\n  static size_t SInt64Size(const RepeatedField< int64>& value);\n  static size_t EnumSize  (const RepeatedField<   int>& value);\n\n  // These types always have the same size.\n  static const size_t kFixed32Size  = 4;\n  static const size_t kFixed64Size  = 8;\n  static const size_t kSFixed32Size = 4;\n  static const size_t kSFixed64Size = 8;\n  static const size_t kFloatSize    = 4;\n  static const size_t kDoubleSize   = 8;\n  static const size_t kBoolSize     = 1;\n\n  static inline size_t StringSize(const string& value);\n  static inline size_t BytesSize (const string& value);\n\n  template<typename MessageType>\n  static inline size_t GroupSize  (const MessageType& value);\n  template<typename MessageType>\n  static inline size_t MessageSize(const MessageType& value);\n\n  // Like above, but de-virtualize the call to ByteSize().  The\n  // pointer must point at an instance of MessageType, *not* a subclass (or\n  // the subclass must not override ByteSize()).\n  template<typename MessageType>\n  static inline size_t GroupSizeNoVirtual  (const MessageType& value);\n  template<typename MessageType>\n  static inline size_t MessageSizeNoVirtual(const MessageType& value);\n\n  // Given the length of data, calculate the byte size of the data on the\n  // wire if we encode the data as a length delimited field.\n  static inline size_t LengthDelimitedSize(size_t length);\n\n private:\n  // A helper method for the repeated primitive reader. This method has\n  // optimizations for primitive types that have fixed size on the wire, and\n  // can be read using potentially faster paths.\n  template <typename CType, enum FieldType DeclaredType>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  static bool ReadRepeatedFixedSizePrimitive(\n      int tag_size,\n      uint32 tag,\n      google::protobuf::io::CodedInputStream* input,\n      RepeatedField<CType>* value);\n\n  // Like ReadRepeatedFixedSizePrimitive but for packed primitive fields.\n  template <typename CType, enum FieldType DeclaredType>\n  GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE\n  static bool ReadPackedFixedSizePrimitive(\n      google::protobuf::io::CodedInputStream* input, RepeatedField<CType>* value);\n\n  static const CppType kFieldTypeToCppTypeMap[];\n  static const WireFormatLite::WireType kWireTypeForFieldType[];\n\n  GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(WireFormatLite);\n};\n\n// A class which deals with unknown values.  The default implementation just\n// discards them.  WireFormat defines a subclass which writes to an\n// UnknownFieldSet.  This class is used by ExtensionSet::ParseField(), since\n// ExtensionSet is part of the lite library but UnknownFieldSet is not.\nclass LIBPROTOBUF_EXPORT FieldSkipper {\n public:\n  FieldSkipper() {}\n  virtual ~FieldSkipper() {}\n\n  // Skip a field whose tag has already been consumed.\n  virtual bool SkipField(io::CodedInputStream* input, uint32 tag);\n\n  // Skip an entire message or group, up to an end-group tag (which is consumed)\n  // or end-of-stream.\n  virtual bool SkipMessage(io::CodedInputStream* input);\n\n  // Deal with an already-parsed unrecognized enum value.  The default\n  // implementation does nothing, but the UnknownFieldSet-based implementation\n  // saves it as an unknown varint.\n  virtual void SkipUnknownEnum(int field_number, int value);\n};\n\n// Subclass of FieldSkipper which saves skipped fields to a CodedOutputStream.\n\nclass LIBPROTOBUF_EXPORT CodedOutputStreamFieldSkipper : public FieldSkipper {\n public:\n  explicit CodedOutputStreamFieldSkipper(io::CodedOutputStream* unknown_fields)\n      : unknown_fields_(unknown_fields) {}\n  virtual ~CodedOutputStreamFieldSkipper() {}\n\n  // implements FieldSkipper -----------------------------------------\n  virtual bool SkipField(io::CodedInputStream* input, uint32 tag);\n  virtual bool SkipMessage(io::CodedInputStream* input);\n  virtual void SkipUnknownEnum(int field_number, int value);\n\n protected:\n  io::CodedOutputStream* unknown_fields_;\n};\n\n\n// inline methods ====================================================\n\ninline WireFormatLite::CppType\nWireFormatLite::FieldTypeToCppType(FieldType type) {\n  return kFieldTypeToCppTypeMap[type];\n}\n\ninline uint32 WireFormatLite::MakeTag(int field_number, WireType type) {\n  return GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(field_number, type);\n}\n\ninline WireFormatLite::WireType WireFormatLite::GetTagWireType(uint32 tag) {\n  return static_cast<WireType>(tag & kTagTypeMask);\n}\n\ninline int WireFormatLite::GetTagFieldNumber(uint32 tag) {\n  return static_cast<int>(tag >> kTagTypeBits);\n}\n\ninline size_t WireFormatLite::TagSize(int field_number,\n                                      WireFormatLite::FieldType type) {\n  size_t result = io::CodedOutputStream::VarintSize32(\n    static_cast<uint32>(field_number << kTagTypeBits));\n  if (type == TYPE_GROUP) {\n    // Groups have both a start and an end tag.\n    return result * 2;\n  } else {\n    return result;\n  }\n}\n\ninline uint32 WireFormatLite::EncodeFloat(float value) {\n  union {float f; uint32 i;};\n  f = value;\n  return i;\n}\n\ninline float WireFormatLite::DecodeFloat(uint32 value) {\n  union {float f; uint32 i;};\n  i = value;\n  return f;\n}\n\ninline uint64 WireFormatLite::EncodeDouble(double value) {\n  union {double f; uint64 i;};\n  f = value;\n  return i;\n}\n\ninline double WireFormatLite::DecodeDouble(uint64 value) {\n  union {double f; uint64 i;};\n  i = value;\n  return f;\n}\n\n// ZigZag Transform:  Encodes signed integers so that they can be\n// effectively used with varint encoding.\n//\n// varint operates on unsigned integers, encoding smaller numbers into\n// fewer bytes.  If you try to use it on a signed integer, it will treat\n// this number as a very large unsigned integer, which means that even\n// small signed numbers like -1 will take the maximum number of bytes\n// (10) to encode.  ZigZagEncode() maps signed integers to unsigned\n// in such a way that those with a small absolute value will have smaller\n// encoded values, making them appropriate for encoding using varint.\n//\n//       int32 ->     uint32\n// -------------------------\n//           0 ->          0\n//          -1 ->          1\n//           1 ->          2\n//          -2 ->          3\n//         ... ->        ...\n//  2147483647 -> 4294967294\n// -2147483648 -> 4294967295\n//\n//        >> encode >>\n//        << decode <<\n\ninline uint32 WireFormatLite::ZigZagEncode32(int32 n) {\n  // Note:  the right-shift must be arithmetic\n  // Note:  left shift must be unsigned because of overflow\n  return (static_cast<uint32>(n) << 1) ^ static_cast<uint32>(n >> 31);\n}\n\ninline int32 WireFormatLite::ZigZagDecode32(uint32 n) {\n  // Note:  Using unsigned types prevent undefined behavior\n  return static_cast<int32>((n >> 1) ^ (~(n & 1) + 1));\n}\n\ninline uint64 WireFormatLite::ZigZagEncode64(int64 n) {\n  // Note:  the right-shift must be arithmetic\n  // Note:  left shift must be unsigned because of overflow\n  return (static_cast<uint64>(n) << 1) ^ static_cast<uint64>(n >> 63);\n}\n\ninline int64 WireFormatLite::ZigZagDecode64(uint64 n) {\n  // Note:  Using unsigned types prevent undefined behavior\n  return static_cast<int64>((n >> 1) ^ (~(n & 1) + 1));\n}\n\n// String is for UTF-8 text only, but, even so, ReadString() can simply\n// call ReadBytes().\n\ninline bool WireFormatLite::ReadString(io::CodedInputStream* input,\n                                       string* value) {\n  return ReadBytes(input, value);\n}\n\ninline bool WireFormatLite::ReadString(io::CodedInputStream* input,\n                                       string** p) {\n  return ReadBytes(input, p);\n}\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/wire_format_lite_inl.h",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//         wink@google.com (Wink Saville) (refactored from wire_format.h)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n\n#ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__\n#define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__\n\n#include <algorithm>\n#include <string>\n#include <google/protobuf/stubs/common.h>\n#include <google/protobuf/stubs/logging.h>\n#include <google/protobuf/message_lite.h>\n#include <google/protobuf/repeated_field.h>\n#include <google/protobuf/wire_format_lite.h>\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arenastring.h>\n\n\nnamespace google {\nnamespace protobuf {\nnamespace internal {\n\n// Implementation details of ReadPrimitive.\n\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<int32, WireFormatLite::TYPE_INT32>(\n    io::CodedInputStream* input,\n    int32* value) {\n  uint32 temp;\n  if (!input->ReadVarint32(&temp)) return false;\n  *value = static_cast<int32>(temp);\n  return true;\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<int64, WireFormatLite::TYPE_INT64>(\n    io::CodedInputStream* input,\n    int64* value) {\n  uint64 temp;\n  if (!input->ReadVarint64(&temp)) return false;\n  *value = static_cast<int64>(temp);\n  return true;\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<uint32, WireFormatLite::TYPE_UINT32>(\n    io::CodedInputStream* input,\n    uint32* value) {\n  return input->ReadVarint32(value);\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<uint64, WireFormatLite::TYPE_UINT64>(\n    io::CodedInputStream* input,\n    uint64* value) {\n  return input->ReadVarint64(value);\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<int32, WireFormatLite::TYPE_SINT32>(\n    io::CodedInputStream* input,\n    int32* value) {\n  uint32 temp;\n  if (!input->ReadVarint32(&temp)) return false;\n  *value = ZigZagDecode32(temp);\n  return true;\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<int64, WireFormatLite::TYPE_SINT64>(\n    io::CodedInputStream* input,\n    int64* value) {\n  uint64 temp;\n  if (!input->ReadVarint64(&temp)) return false;\n  *value = ZigZagDecode64(temp);\n  return true;\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<uint32, WireFormatLite::TYPE_FIXED32>(\n    io::CodedInputStream* input,\n    uint32* value) {\n  return input->ReadLittleEndian32(value);\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<uint64, WireFormatLite::TYPE_FIXED64>(\n    io::CodedInputStream* input,\n    uint64* value) {\n  return input->ReadLittleEndian64(value);\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<int32, WireFormatLite::TYPE_SFIXED32>(\n    io::CodedInputStream* input,\n    int32* value) {\n  uint32 temp;\n  if (!input->ReadLittleEndian32(&temp)) return false;\n  *value = static_cast<int32>(temp);\n  return true;\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<int64, WireFormatLite::TYPE_SFIXED64>(\n    io::CodedInputStream* input,\n    int64* value) {\n  uint64 temp;\n  if (!input->ReadLittleEndian64(&temp)) return false;\n  *value = static_cast<int64>(temp);\n  return true;\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<float, WireFormatLite::TYPE_FLOAT>(\n    io::CodedInputStream* input,\n    float* value) {\n  uint32 temp;\n  if (!input->ReadLittleEndian32(&temp)) return false;\n  *value = DecodeFloat(temp);\n  return true;\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<double, WireFormatLite::TYPE_DOUBLE>(\n    io::CodedInputStream* input,\n    double* value) {\n  uint64 temp;\n  if (!input->ReadLittleEndian64(&temp)) return false;\n  *value = DecodeDouble(temp);\n  return true;\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<bool, WireFormatLite::TYPE_BOOL>(\n    io::CodedInputStream* input,\n    bool* value) {\n  uint64 temp;\n  if (!input->ReadVarint64(&temp)) return false;\n  *value = temp != 0;\n  return true;\n}\ntemplate <>\ninline bool WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(\n    io::CodedInputStream* input,\n    int* value) {\n  uint32 temp;\n  if (!input->ReadVarint32(&temp)) return false;\n  *value = static_cast<int>(temp);\n  return true;\n}\n\ntemplate <>\ninline const uint8* WireFormatLite::ReadPrimitiveFromArray<\n  uint32, WireFormatLite::TYPE_FIXED32>(\n    const uint8* buffer,\n    uint32* value) {\n  return io::CodedInputStream::ReadLittleEndian32FromArray(buffer, value);\n}\ntemplate <>\ninline const uint8* WireFormatLite::ReadPrimitiveFromArray<\n  uint64, WireFormatLite::TYPE_FIXED64>(\n    const uint8* buffer,\n    uint64* value) {\n  return io::CodedInputStream::ReadLittleEndian64FromArray(buffer, value);\n}\ntemplate <>\ninline const uint8* WireFormatLite::ReadPrimitiveFromArray<\n  int32, WireFormatLite::TYPE_SFIXED32>(\n    const uint8* buffer,\n    int32* value) {\n  uint32 temp;\n  buffer = io::CodedInputStream::ReadLittleEndian32FromArray(buffer, &temp);\n  *value = static_cast<int32>(temp);\n  return buffer;\n}\ntemplate <>\ninline const uint8* WireFormatLite::ReadPrimitiveFromArray<\n  int64, WireFormatLite::TYPE_SFIXED64>(\n    const uint8* buffer,\n    int64* value) {\n  uint64 temp;\n  buffer = io::CodedInputStream::ReadLittleEndian64FromArray(buffer, &temp);\n  *value = static_cast<int64>(temp);\n  return buffer;\n}\ntemplate <>\ninline const uint8* WireFormatLite::ReadPrimitiveFromArray<\n  float, WireFormatLite::TYPE_FLOAT>(\n    const uint8* buffer,\n    float* value) {\n  uint32 temp;\n  buffer = io::CodedInputStream::ReadLittleEndian32FromArray(buffer, &temp);\n  *value = DecodeFloat(temp);\n  return buffer;\n}\ntemplate <>\ninline const uint8* WireFormatLite::ReadPrimitiveFromArray<\n  double, WireFormatLite::TYPE_DOUBLE>(\n    const uint8* buffer,\n    double* value) {\n  uint64 temp;\n  buffer = io::CodedInputStream::ReadLittleEndian64FromArray(buffer, &temp);\n  *value = DecodeDouble(temp);\n  return buffer;\n}\n\ntemplate <typename CType, enum WireFormatLite::FieldType DeclaredType>\ninline bool WireFormatLite::ReadRepeatedPrimitive(\n    int,  // tag_size, unused.\n    uint32 tag,\n    io::CodedInputStream* input,\n    RepeatedField<CType>* values) {\n  CType value;\n  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;\n  values->Add(value);\n  int elements_already_reserved = values->Capacity() - values->size();\n  while (elements_already_reserved > 0 && input->ExpectTag(tag)) {\n    if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;\n    values->AddAlreadyReserved(value);\n    elements_already_reserved--;\n  }\n  return true;\n}\n\ntemplate <typename CType, enum WireFormatLite::FieldType DeclaredType>\ninline bool WireFormatLite::ReadRepeatedFixedSizePrimitive(\n    int tag_size,\n    uint32 tag,\n    io::CodedInputStream* input,\n    RepeatedField<CType>* values) {\n  GOOGLE_DCHECK_EQ(UInt32Size(tag), static_cast<size_t>(tag_size));\n  CType value;\n  if (!ReadPrimitive<CType, DeclaredType>(input, &value))\n    return false;\n  values->Add(value);\n\n  // For fixed size values, repeated values can be read more quickly by\n  // reading directly from a raw array.\n  //\n  // We can get a tight loop by only reading as many elements as can be\n  // added to the RepeatedField without having to do any resizing. Additionally,\n  // we only try to read as many elements as are available from the current\n  // buffer space. Doing so avoids having to perform boundary checks when\n  // reading the value: the maximum number of elements that can be read is\n  // known outside of the loop.\n  const void* void_pointer;\n  int size;\n  input->GetDirectBufferPointerInline(&void_pointer, &size);\n  if (size > 0) {\n    const uint8* buffer = reinterpret_cast<const uint8*>(void_pointer);\n    // The number of bytes each type occupies on the wire.\n    const int per_value_size = tag_size + static_cast<int>(sizeof(value));\n\n    // parentheses around (std::min) prevents macro expansion of min(...)\n    int elements_available =\n        (std::min)(values->Capacity() - values->size(), size / per_value_size);\n    int num_read = 0;\n    while (num_read < elements_available &&\n           (buffer = io::CodedInputStream::ExpectTagFromArray(\n               buffer, tag)) != NULL) {\n      buffer = ReadPrimitiveFromArray<CType, DeclaredType>(buffer, &value);\n      values->AddAlreadyReserved(value);\n      ++num_read;\n    }\n    const int read_bytes = num_read * per_value_size;\n    if (read_bytes > 0) {\n      input->Skip(read_bytes);\n    }\n  }\n  return true;\n}\n\n// Specializations of ReadRepeatedPrimitive for the fixed size types, which use\n// the optimized code path.\n#define READ_REPEATED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)             \\\ntemplate <>                                                                    \\\ninline bool WireFormatLite::ReadRepeatedPrimitive<                             \\\n  CPPTYPE, WireFormatLite::DECLARED_TYPE>(                                     \\\n    int tag_size,                                                              \\\n    uint32 tag,                                                                \\\n    io::CodedInputStream* input,                                               \\\n    RepeatedField<CPPTYPE>* values) {                                          \\\n  return ReadRepeatedFixedSizePrimitive<                                       \\\n    CPPTYPE, WireFormatLite::DECLARED_TYPE>(                                   \\\n      tag_size, tag, input, values);                                           \\\n}\n\nREAD_REPEATED_FIXED_SIZE_PRIMITIVE(uint32, TYPE_FIXED32)\nREAD_REPEATED_FIXED_SIZE_PRIMITIVE(uint64, TYPE_FIXED64)\nREAD_REPEATED_FIXED_SIZE_PRIMITIVE(int32, TYPE_SFIXED32)\nREAD_REPEATED_FIXED_SIZE_PRIMITIVE(int64, TYPE_SFIXED64)\nREAD_REPEATED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT)\nREAD_REPEATED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)\n\n#undef READ_REPEATED_FIXED_SIZE_PRIMITIVE\n\ntemplate <typename CType, enum WireFormatLite::FieldType DeclaredType>\nbool WireFormatLite::ReadRepeatedPrimitiveNoInline(\n    int tag_size,\n    uint32 tag,\n    io::CodedInputStream* input,\n    RepeatedField<CType>* value) {\n  return ReadRepeatedPrimitive<CType, DeclaredType>(\n      tag_size, tag, input, value);\n}\n\ntemplate <typename CType, enum WireFormatLite::FieldType DeclaredType>\ninline bool WireFormatLite::ReadPackedPrimitive(io::CodedInputStream* input,\n                                                RepeatedField<CType>* values) {\n  int length;\n  if (!input->ReadVarintSizeAsInt(&length)) return false;\n  io::CodedInputStream::Limit limit = input->PushLimit(length);\n  while (input->BytesUntilLimit() > 0) {\n    CType value;\n    if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;\n    values->Add(value);\n  }\n  input->PopLimit(limit);\n  return true;\n}\n\ntemplate <typename CType, enum WireFormatLite::FieldType DeclaredType>\ninline bool WireFormatLite::ReadPackedFixedSizePrimitive(\n    io::CodedInputStream* input, RepeatedField<CType>* values) {\n  int length;\n  if (!input->ReadVarintSizeAsInt(&length)) return false;\n  const int old_entries = values->size();\n  const int new_entries = length / static_cast<int>(sizeof(CType));\n  const int new_bytes = new_entries * static_cast<int>(sizeof(CType));\n  if (new_bytes != length) return false;\n  // We would *like* to pre-allocate the buffer to write into (for\n  // speed), but *must* avoid performing a very large allocation due\n  // to a malicious user-supplied \"length\" above.  So we have a fast\n  // path that pre-allocates when the \"length\" is less than a bound.\n  // We determine the bound by calling BytesUntilTotalBytesLimit() and\n  // BytesUntilLimit().  These return -1 to mean \"no limit set\".\n  // There are four cases:\n  // TotalBytesLimit  Limit\n  // -1               -1     Use slow path.\n  // -1               >= 0   Use fast path if length <= Limit.\n  // >= 0             -1     Use slow path.\n  // >= 0             >= 0   Use fast path if length <= min(both limits).\n  int64 bytes_limit = input->BytesUntilTotalBytesLimit();\n  if (bytes_limit == -1) {\n    bytes_limit = input->BytesUntilLimit();\n  } else {\n    // parentheses around (std::min) prevents macro expansion of min(...)\n    bytes_limit =\n        (std::min)(bytes_limit, static_cast<int64>(input->BytesUntilLimit()));\n  }\n  if (bytes_limit >= new_bytes) {\n    // Fast-path that pre-allocates *values to the final size.\n#if defined(PROTOBUF_LITTLE_ENDIAN)\n    values->Resize(old_entries + new_entries, 0);\n    // values->mutable_data() may change after Resize(), so do this after:\n    void* dest = reinterpret_cast<void*>(values->mutable_data() + old_entries);\n    if (!input->ReadRaw(dest, new_bytes)) {\n      values->Truncate(old_entries);\n      return false;\n    }\n#else\n    values->Reserve(old_entries + new_entries);\n    CType value;\n    for (int i = 0; i < new_entries; ++i) {\n      if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;\n      values->AddAlreadyReserved(value);\n    }\n#endif\n  } else {\n    // This is the slow-path case where \"length\" may be too large to\n    // safely allocate.  We read as much as we can into *values\n    // without pre-allocating \"length\" bytes.\n    CType value;\n    for (int i = 0; i < new_entries; ++i) {\n      if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;\n      values->Add(value);\n    }\n  }\n  return true;\n}\n\n// Specializations of ReadPackedPrimitive for the fixed size types, which use\n// an optimized code path.\n#define READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)      \\\ntemplate <>                                                                    \\\ninline bool WireFormatLite::ReadPackedPrimitive<                               \\\n  CPPTYPE, WireFormatLite::DECLARED_TYPE>(                                     \\\n    io::CodedInputStream* input,                                               \\\n    RepeatedField<CPPTYPE>* values) {                                          \\\n  return ReadPackedFixedSizePrimitive<                                         \\\n      CPPTYPE, WireFormatLite::DECLARED_TYPE>(input, values);                  \\\n}\n\nREAD_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(uint32, TYPE_FIXED32)\nREAD_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(uint64, TYPE_FIXED64)\nREAD_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(int32, TYPE_SFIXED32)\nREAD_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(int64, TYPE_SFIXED64)\nREAD_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT)\nREAD_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)\n\n#undef READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE\n\ntemplate <typename CType, enum WireFormatLite::FieldType DeclaredType>\nbool WireFormatLite::ReadPackedPrimitiveNoInline(io::CodedInputStream* input,\n                                                 RepeatedField<CType>* values) {\n  return ReadPackedPrimitive<CType, DeclaredType>(input, values);\n}\n\n\ntemplate<typename MessageType>\ninline bool WireFormatLite::ReadGroup(\n    int field_number, io::CodedInputStream* input,\n    MessageType* value) {\n  if (!input->IncrementRecursionDepth()) return false;\n  if (!value->MergePartialFromCodedStream(input)) return false;\n  input->UnsafeDecrementRecursionDepth();\n  // Make sure the last thing read was an end tag for this group.\n  if (!input->LastTagWas(MakeTag(field_number, WIRETYPE_END_GROUP))) {\n    return false;\n  }\n  return true;\n}\ntemplate<typename MessageType>\ninline bool WireFormatLite::ReadMessage(\n    io::CodedInputStream* input, MessageType* value) {\n  int length;\n  if (!input->ReadVarintSizeAsInt(&length)) return false;\n  std::pair<io::CodedInputStream::Limit, int> p =\n      input->IncrementRecursionDepthAndPushLimit(length);\n  if (p.second < 0 || !value->MergePartialFromCodedStream(input)) return false;\n  // Make sure that parsing stopped when the limit was hit, not at an endgroup\n  // tag.\n  return input->DecrementRecursionDepthAndPopLimit(p.first);\n}\n\n// ===================================================================\n\ninline void WireFormatLite::WriteTag(int field_number, WireType type,\n                                     io::CodedOutputStream* output) {\n  output->WriteTag(MakeTag(field_number, type));\n}\n\ninline void WireFormatLite::WriteInt32NoTag(int32 value,\n                                            io::CodedOutputStream* output) {\n  output->WriteVarint32SignExtended(value);\n}\ninline void WireFormatLite::WriteInt64NoTag(int64 value,\n                                            io::CodedOutputStream* output) {\n  output->WriteVarint64(static_cast<uint64>(value));\n}\ninline void WireFormatLite::WriteUInt32NoTag(uint32 value,\n                                             io::CodedOutputStream* output) {\n  output->WriteVarint32(value);\n}\ninline void WireFormatLite::WriteUInt64NoTag(uint64 value,\n                                             io::CodedOutputStream* output) {\n  output->WriteVarint64(value);\n}\ninline void WireFormatLite::WriteSInt32NoTag(int32 value,\n                                             io::CodedOutputStream* output) {\n  output->WriteVarint32(ZigZagEncode32(value));\n}\ninline void WireFormatLite::WriteSInt64NoTag(int64 value,\n                                             io::CodedOutputStream* output) {\n  output->WriteVarint64(ZigZagEncode64(value));\n}\ninline void WireFormatLite::WriteFixed32NoTag(uint32 value,\n                                              io::CodedOutputStream* output) {\n  output->WriteLittleEndian32(value);\n}\ninline void WireFormatLite::WriteFixed64NoTag(uint64 value,\n                                              io::CodedOutputStream* output) {\n  output->WriteLittleEndian64(value);\n}\ninline void WireFormatLite::WriteSFixed32NoTag(int32 value,\n                                               io::CodedOutputStream* output) {\n  output->WriteLittleEndian32(static_cast<uint32>(value));\n}\ninline void WireFormatLite::WriteSFixed64NoTag(int64 value,\n                                               io::CodedOutputStream* output) {\n  output->WriteLittleEndian64(static_cast<uint64>(value));\n}\ninline void WireFormatLite::WriteFloatNoTag(float value,\n                                            io::CodedOutputStream* output) {\n  output->WriteLittleEndian32(EncodeFloat(value));\n}\ninline void WireFormatLite::WriteDoubleNoTag(double value,\n                                             io::CodedOutputStream* output) {\n  output->WriteLittleEndian64(EncodeDouble(value));\n}\ninline void WireFormatLite::WriteBoolNoTag(bool value,\n                                           io::CodedOutputStream* output) {\n  output->WriteVarint32(value ? 1 : 0);\n}\ninline void WireFormatLite::WriteEnumNoTag(int value,\n                                           io::CodedOutputStream* output) {\n  output->WriteVarint32SignExtended(value);\n}\n\n// See comment on ReadGroupNoVirtual to understand the need for this template\n// parameter name.\ntemplate<typename MessageType_WorkAroundCppLookupDefect>\ninline void WireFormatLite::WriteGroupNoVirtual(\n    int field_number, const MessageType_WorkAroundCppLookupDefect& value,\n    io::CodedOutputStream* output) {\n  WriteTag(field_number, WIRETYPE_START_GROUP, output);\n  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);\n  WriteTag(field_number, WIRETYPE_END_GROUP, output);\n}\ntemplate<typename MessageType_WorkAroundCppLookupDefect>\ninline void WireFormatLite::WriteMessageNoVirtual(\n    int field_number, const MessageType_WorkAroundCppLookupDefect& value,\n    io::CodedOutputStream* output) {\n  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);\n  output->WriteVarint32(\n      value.MessageType_WorkAroundCppLookupDefect::GetCachedSize());\n  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);\n}\n\n// ===================================================================\n\ninline uint8* WireFormatLite::WriteTagToArray(int field_number,\n                                              WireType type,\n                                              uint8* target) {\n  return io::CodedOutputStream::WriteTagToArray(MakeTag(field_number, type),\n                                                target);\n}\n\ninline uint8* WireFormatLite::WriteInt32NoTagToArray(int32 value,\n                                                     uint8* target) {\n  return io::CodedOutputStream::WriteVarint32SignExtendedToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteInt64NoTagToArray(int64 value,\n                                                     uint8* target) {\n  return io::CodedOutputStream::WriteVarint64ToArray(\n      static_cast<uint64>(value), target);\n}\ninline uint8* WireFormatLite::WriteUInt32NoTagToArray(uint32 value,\n                                                      uint8* target) {\n  return io::CodedOutputStream::WriteVarint32ToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteUInt64NoTagToArray(uint64 value,\n                                                      uint8* target) {\n  return io::CodedOutputStream::WriteVarint64ToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteSInt32NoTagToArray(int32 value,\n                                                      uint8* target) {\n  return io::CodedOutputStream::WriteVarint32ToArray(ZigZagEncode32(value),\n                                                     target);\n}\ninline uint8* WireFormatLite::WriteSInt64NoTagToArray(int64 value,\n                                                      uint8* target) {\n  return io::CodedOutputStream::WriteVarint64ToArray(ZigZagEncode64(value),\n                                                     target);\n}\ninline uint8* WireFormatLite::WriteFixed32NoTagToArray(uint32 value,\n                                                       uint8* target) {\n  return io::CodedOutputStream::WriteLittleEndian32ToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteFixed64NoTagToArray(uint64 value,\n                                                       uint8* target) {\n  return io::CodedOutputStream::WriteLittleEndian64ToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteSFixed32NoTagToArray(int32 value,\n                                                        uint8* target) {\n  return io::CodedOutputStream::WriteLittleEndian32ToArray(\n      static_cast<uint32>(value), target);\n}\ninline uint8* WireFormatLite::WriteSFixed64NoTagToArray(int64 value,\n                                                        uint8* target) {\n  return io::CodedOutputStream::WriteLittleEndian64ToArray(\n      static_cast<uint64>(value), target);\n}\ninline uint8* WireFormatLite::WriteFloatNoTagToArray(float value,\n                                                     uint8* target) {\n  return io::CodedOutputStream::WriteLittleEndian32ToArray(EncodeFloat(value),\n                                                           target);\n}\ninline uint8* WireFormatLite::WriteDoubleNoTagToArray(double value,\n                                                      uint8* target) {\n  return io::CodedOutputStream::WriteLittleEndian64ToArray(EncodeDouble(value),\n                                                           target);\n}\ninline uint8* WireFormatLite::WriteBoolNoTagToArray(bool value,\n                                                    uint8* target) {\n  return io::CodedOutputStream::WriteVarint32ToArray(value ? 1 : 0, target);\n}\ninline uint8* WireFormatLite::WriteEnumNoTagToArray(int value,\n                                                    uint8* target) {\n  return io::CodedOutputStream::WriteVarint32SignExtendedToArray(value, target);\n}\n\ntemplate<typename T>\ninline uint8* WireFormatLite::WritePrimitiveNoTagToArray(\n      const RepeatedField<T>& value,\n      uint8* (*Writer)(T, uint8*), uint8* target) {\n  const int n = value.size();\n  GOOGLE_DCHECK_GT(n, 0);\n\n  const T* ii = value.unsafe_data();\n  int i = 0;\n  do {\n    target = Writer(ii[i], target);\n  } while (++i < n);\n\n  return target;\n}\n\ntemplate<typename T>\ninline uint8* WireFormatLite::WriteFixedNoTagToArray(\n      const RepeatedField<T>& value,\n      uint8* (*Writer)(T, uint8*), uint8* target) {\n#if defined(PROTOBUF_LITTLE_ENDIAN)\n  (void) Writer;\n\n  const int n = value.size();\n  GOOGLE_DCHECK_GT(n, 0);\n\n  const T* ii = value.unsafe_data();\n  const int bytes = n * static_cast<int>(sizeof(ii[0]));\n  memcpy(target, ii, static_cast<size_t>(bytes));\n  return target + bytes;\n#else\n  return WritePrimitiveNoTagToArray(value, Writer, target);\n#endif\n}\n\ninline uint8* WireFormatLite::WriteInt32NoTagToArray(\n    const RepeatedField< int32>& value, uint8* target) {\n  return WritePrimitiveNoTagToArray(value, WriteInt32NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteInt64NoTagToArray(\n    const RepeatedField< int64>& value, uint8* target) {\n  return WritePrimitiveNoTagToArray(value, WriteInt64NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteUInt32NoTagToArray(\n    const RepeatedField<uint32>& value, uint8* target) {\n  return WritePrimitiveNoTagToArray(value, WriteUInt32NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteUInt64NoTagToArray(\n    const RepeatedField<uint64>& value, uint8* target) {\n  return WritePrimitiveNoTagToArray(value, WriteUInt64NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteSInt32NoTagToArray(\n    const RepeatedField< int32>& value, uint8* target) {\n  return WritePrimitiveNoTagToArray(value, WriteSInt32NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteSInt64NoTagToArray(\n    const RepeatedField< int64>& value, uint8* target) {\n  return WritePrimitiveNoTagToArray(value, WriteSInt64NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteFixed32NoTagToArray(\n    const RepeatedField<uint32>& value, uint8* target) {\n  return WriteFixedNoTagToArray(value, WriteFixed32NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteFixed64NoTagToArray(\n    const RepeatedField<uint64>& value, uint8* target) {\n  return WriteFixedNoTagToArray(value, WriteFixed64NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteSFixed32NoTagToArray(\n    const RepeatedField< int32>& value, uint8* target) {\n  return WriteFixedNoTagToArray(value, WriteSFixed32NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteSFixed64NoTagToArray(\n    const RepeatedField< int64>& value, uint8* target) {\n  return WriteFixedNoTagToArray(value, WriteSFixed64NoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteFloatNoTagToArray(\n    const RepeatedField< float>& value, uint8* target) {\n  return WriteFixedNoTagToArray(value, WriteFloatNoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteDoubleNoTagToArray(\n    const RepeatedField<double>& value, uint8* target) {\n  return WriteFixedNoTagToArray(value, WriteDoubleNoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteBoolNoTagToArray(\n    const RepeatedField<  bool>& value, uint8* target) {\n  return WritePrimitiveNoTagToArray(value, WriteBoolNoTagToArray, target);\n}\ninline uint8* WireFormatLite::WriteEnumNoTagToArray(\n    const RepeatedField<   int>& value, uint8* target) {\n  return WritePrimitiveNoTagToArray(value, WriteEnumNoTagToArray, target);\n}\n\ninline uint8* WireFormatLite::WriteInt32ToArray(int field_number,\n                                                int32 value,\n                                                uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);\n  return WriteInt32NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteInt64ToArray(int field_number,\n                                                int64 value,\n                                                uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);\n  return WriteInt64NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteUInt32ToArray(int field_number,\n                                                 uint32 value,\n                                                 uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);\n  return WriteUInt32NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteUInt64ToArray(int field_number,\n                                                 uint64 value,\n                                                 uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);\n  return WriteUInt64NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteSInt32ToArray(int field_number,\n                                                 int32 value,\n                                                 uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);\n  return WriteSInt32NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteSInt64ToArray(int field_number,\n                                                 int64 value,\n                                                 uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);\n  return WriteSInt64NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteFixed32ToArray(int field_number,\n                                                  uint32 value,\n                                                  uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);\n  return WriteFixed32NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteFixed64ToArray(int field_number,\n                                                  uint64 value,\n                                                  uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);\n  return WriteFixed64NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteSFixed32ToArray(int field_number,\n                                                   int32 value,\n                                                   uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);\n  return WriteSFixed32NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteSFixed64ToArray(int field_number,\n                                                   int64 value,\n                                                   uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);\n  return WriteSFixed64NoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteFloatToArray(int field_number,\n                                                float value,\n                                                uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);\n  return WriteFloatNoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteDoubleToArray(int field_number,\n                                                 double value,\n                                                 uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);\n  return WriteDoubleNoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteBoolToArray(int field_number,\n                                               bool value,\n                                               uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);\n  return WriteBoolNoTagToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteEnumToArray(int field_number,\n                                               int value,\n                                               uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);\n  return WriteEnumNoTagToArray(value, target);\n}\n\ntemplate<typename T>\ninline uint8* WireFormatLite::WritePrimitiveToArray(\n    int field_number,\n    const RepeatedField<T>& value,\n    uint8* (*Writer)(int, T, uint8*), uint8* target) {\n  const int n = value.size();\n  if (n == 0) {\n    return target;\n  }\n\n  const T* ii = value.unsafe_data();\n  int i = 0;\n  do {\n    target = Writer(field_number, ii[i], target);\n  } while (++i < n);\n\n  return target;\n}\n\ninline uint8* WireFormatLite::WriteInt32ToArray(\n    int field_number, const RepeatedField< int32>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteInt32ToArray, target);\n}\ninline uint8* WireFormatLite::WriteInt64ToArray(\n    int field_number, const RepeatedField< int64>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteInt64ToArray, target);\n}\ninline uint8* WireFormatLite::WriteUInt32ToArray(\n    int field_number, const RepeatedField<uint32>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteUInt32ToArray, target);\n}\ninline uint8* WireFormatLite::WriteUInt64ToArray(\n    int field_number, const RepeatedField<uint64>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteUInt64ToArray, target);\n}\ninline uint8* WireFormatLite::WriteSInt32ToArray(\n    int field_number, const RepeatedField< int32>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteSInt32ToArray, target);\n}\ninline uint8* WireFormatLite::WriteSInt64ToArray(\n    int field_number, const RepeatedField< int64>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteSInt64ToArray, target);\n}\ninline uint8* WireFormatLite::WriteFixed32ToArray(\n    int field_number, const RepeatedField<uint32>& value, uint8* target) {\n  return WritePrimitiveToArray(\n      field_number, value, WriteFixed32ToArray, target);\n}\ninline uint8* WireFormatLite::WriteFixed64ToArray(\n    int field_number, const RepeatedField<uint64>& value, uint8* target) {\n  return WritePrimitiveToArray(\n      field_number, value, WriteFixed64ToArray, target);\n}\ninline uint8* WireFormatLite::WriteSFixed32ToArray(\n    int field_number, const RepeatedField< int32>& value, uint8* target) {\n  return WritePrimitiveToArray(\n      field_number, value, WriteSFixed32ToArray, target);\n}\ninline uint8* WireFormatLite::WriteSFixed64ToArray(\n    int field_number, const RepeatedField< int64>& value, uint8* target) {\n  return WritePrimitiveToArray(\n      field_number, value, WriteSFixed64ToArray, target);\n}\ninline uint8* WireFormatLite::WriteFloatToArray(\n    int field_number, const RepeatedField< float>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteFloatToArray, target);\n}\ninline uint8* WireFormatLite::WriteDoubleToArray(\n    int field_number, const RepeatedField<double>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteDoubleToArray, target);\n}\ninline uint8* WireFormatLite::WriteBoolToArray(\n    int field_number, const RepeatedField<  bool>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteBoolToArray, target);\n}\ninline uint8* WireFormatLite::WriteEnumToArray(\n    int field_number, const RepeatedField<   int>& value, uint8* target) {\n  return WritePrimitiveToArray(field_number, value, WriteEnumToArray, target);\n}\ninline uint8* WireFormatLite::WriteStringToArray(int field_number,\n                                                 const string& value,\n                                                 uint8* target) {\n  // String is for UTF-8 text only\n  // WARNING:  In wire_format.cc, both strings and bytes are handled by\n  //   WriteString() to avoid code duplication.  If the implementations become\n  //   different, you will need to update that usage.\n  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);\n  return io::CodedOutputStream::WriteStringWithSizeToArray(value, target);\n}\ninline uint8* WireFormatLite::WriteBytesToArray(int field_number,\n                                                const string& value,\n                                                uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);\n  return io::CodedOutputStream::WriteStringWithSizeToArray(value, target);\n}\n\n\ntemplate<typename MessageType>\ninline uint8* WireFormatLite::InternalWriteGroupToArray(\n    int field_number, const MessageType& value, bool deterministic,\n    uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_START_GROUP, target);\n  target = value.InternalSerializeWithCachedSizesToArray(deterministic, target);\n  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);\n}\ntemplate<typename MessageType>\ninline uint8* WireFormatLite::InternalWriteMessageToArray(\n    int field_number, const MessageType& value, bool deterministic,\n    uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);\n  target = io::CodedOutputStream::WriteVarint32ToArray(\n    static_cast<uint32>(value.GetCachedSize()), target);\n  return value.InternalSerializeWithCachedSizesToArray(deterministic, target);\n}\n\n// See comment on ReadGroupNoVirtual to understand the need for this template\n// parameter name.\ntemplate<typename MessageType_WorkAroundCppLookupDefect>\ninline uint8* WireFormatLite::InternalWriteGroupNoVirtualToArray(\n    int field_number, const MessageType_WorkAroundCppLookupDefect& value,\n    bool deterministic, uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_START_GROUP, target);\n  target = value.MessageType_WorkAroundCppLookupDefect::\n      InternalSerializeWithCachedSizesToArray(deterministic, target);\n  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);\n}\ntemplate<typename MessageType_WorkAroundCppLookupDefect>\ninline uint8* WireFormatLite::InternalWriteMessageNoVirtualToArray(\n    int field_number, const MessageType_WorkAroundCppLookupDefect& value,\n    bool deterministic, uint8* target) {\n  target = WriteTagToArray(field_number, WIRETYPE_LENGTH_DELIMITED, target);\n  target = io::CodedOutputStream::WriteVarint32ToArray(\n        static_cast<uint32>(\n            value.MessageType_WorkAroundCppLookupDefect::GetCachedSize()),\n        target);\n  return value.MessageType_WorkAroundCppLookupDefect::\n      InternalSerializeWithCachedSizesToArray(deterministic, target);\n}\n\n// ===================================================================\n\ninline size_t WireFormatLite::Int32Size(int32 value) {\n  return io::CodedOutputStream::VarintSize32SignExtended(value);\n}\ninline size_t WireFormatLite::Int64Size(int64 value) {\n  return io::CodedOutputStream::VarintSize64(static_cast<uint64>(value));\n}\ninline size_t WireFormatLite::UInt32Size(uint32 value) {\n  return io::CodedOutputStream::VarintSize32(value);\n}\ninline size_t WireFormatLite::UInt64Size(uint64 value) {\n  return io::CodedOutputStream::VarintSize64(value);\n}\ninline size_t WireFormatLite::SInt32Size(int32 value) {\n  return io::CodedOutputStream::VarintSize32(ZigZagEncode32(value));\n}\ninline size_t WireFormatLite::SInt64Size(int64 value) {\n  return io::CodedOutputStream::VarintSize64(ZigZagEncode64(value));\n}\ninline size_t WireFormatLite::EnumSize(int value) {\n  return io::CodedOutputStream::VarintSize32SignExtended(value);\n}\n\ninline size_t WireFormatLite::StringSize(const string& value) {\n  return LengthDelimitedSize(value.size());\n}\ninline size_t WireFormatLite::BytesSize(const string& value) {\n  return LengthDelimitedSize(value.size());\n}\n\n\ntemplate<typename MessageType>\ninline size_t WireFormatLite::GroupSize(const MessageType& value) {\n  return value.ByteSizeLong();\n}\ntemplate<typename MessageType>\ninline size_t WireFormatLite::MessageSize(const MessageType& value) {\n  return LengthDelimitedSize(value.ByteSizeLong());\n}\n\n// See comment on ReadGroupNoVirtual to understand the need for this template\n// parameter name.\ntemplate<typename MessageType_WorkAroundCppLookupDefect>\ninline size_t WireFormatLite::GroupSizeNoVirtual(\n    const MessageType_WorkAroundCppLookupDefect& value) {\n  return value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong();\n}\ntemplate<typename MessageType_WorkAroundCppLookupDefect>\ninline size_t WireFormatLite::MessageSizeNoVirtual(\n    const MessageType_WorkAroundCppLookupDefect& value) {\n  return LengthDelimitedSize(\n      value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong());\n}\n\ninline size_t WireFormatLite::LengthDelimitedSize(size_t length) {\n  // The static_cast here prevents an error in certain compiler configurations\n  // but is not technically correct--if length is too large to fit in a uint32\n  // then it will be silently truncated. We will need to fix this if we ever\n  // decide to start supporting serialized messages greater than 2 GiB in size.\n  return length + io::CodedOutputStream::VarintSize32(\n      static_cast<uint32>(length));\n}\n\n}  // namespace internal\n}  // namespace protobuf\n\n}  // namespace google\n#endif  // GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/wrappers.pb.h",
    "content": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/wrappers.proto\n\n#ifndef PROTOBUF_INCLUDED_google_2fprotobuf_2fwrappers_2eproto\n#define PROTOBUF_INCLUDED_google_2fprotobuf_2fwrappers_2eproto\n\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\n#if GOOGLE_PROTOBUF_VERSION < 3006001\n#error This file was generated by a newer version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please update\n#error your headers.\n#endif\n#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION\n#error This file was generated by an older version of protoc which is\n#error incompatible with your Protocol Buffer headers.  Please\n#error regenerate this file with a newer version of protoc.\n#endif\n\n#include <google/protobuf/io/coded_stream.h>\n#include <google/protobuf/arena.h>\n#include <google/protobuf/arenastring.h>\n#include <google/protobuf/generated_message_table_driven.h>\n#include <google/protobuf/generated_message_util.h>\n#include <google/protobuf/inlined_string_field.h>\n#include <google/protobuf/metadata.h>\n#include <google/protobuf/message.h>\n#include <google/protobuf/repeated_field.h>  // IWYU pragma: export\n#include <google/protobuf/extension_set.h>  // IWYU pragma: export\n#include <google/protobuf/unknown_field_set.h>\n// @@protoc_insertion_point(includes)\n#define PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fwrappers_2eproto LIBPROTOBUF_EXPORT\n\nnamespace protobuf_google_2fprotobuf_2fwrappers_2eproto {\n// Internal implementation detail -- do not use these members.\nstruct LIBPROTOBUF_EXPORT TableStruct {\n  static const ::google::protobuf::internal::ParseTableField entries[];\n  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];\n  static const ::google::protobuf::internal::ParseTable schema[9];\n  static const ::google::protobuf::internal::FieldMetadata field_metadata[];\n  static const ::google::protobuf::internal::SerializationTable serialization_table[];\n  static const ::google::protobuf::uint32 offsets[];\n};\nvoid LIBPROTOBUF_EXPORT AddDescriptors();\n}  // namespace protobuf_google_2fprotobuf_2fwrappers_2eproto\nnamespace google {\nnamespace protobuf {\nclass BoolValue;\nclass BoolValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern BoolValueDefaultTypeInternal _BoolValue_default_instance_;\nclass BytesValue;\nclass BytesValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern BytesValueDefaultTypeInternal _BytesValue_default_instance_;\nclass DoubleValue;\nclass DoubleValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern DoubleValueDefaultTypeInternal _DoubleValue_default_instance_;\nclass FloatValue;\nclass FloatValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern FloatValueDefaultTypeInternal _FloatValue_default_instance_;\nclass Int32Value;\nclass Int32ValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern Int32ValueDefaultTypeInternal _Int32Value_default_instance_;\nclass Int64Value;\nclass Int64ValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern Int64ValueDefaultTypeInternal _Int64Value_default_instance_;\nclass StringValue;\nclass StringValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern StringValueDefaultTypeInternal _StringValue_default_instance_;\nclass UInt32Value;\nclass UInt32ValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern UInt32ValueDefaultTypeInternal _UInt32Value_default_instance_;\nclass UInt64Value;\nclass UInt64ValueDefaultTypeInternal;\nLIBPROTOBUF_EXPORT extern UInt64ValueDefaultTypeInternal _UInt64Value_default_instance_;\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::BoolValue* Arena::CreateMaybeMessage<::google::protobuf::BoolValue>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::BytesValue* Arena::CreateMaybeMessage<::google::protobuf::BytesValue>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::DoubleValue* Arena::CreateMaybeMessage<::google::protobuf::DoubleValue>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::FloatValue* Arena::CreateMaybeMessage<::google::protobuf::FloatValue>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Int32Value* Arena::CreateMaybeMessage<::google::protobuf::Int32Value>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::Int64Value* Arena::CreateMaybeMessage<::google::protobuf::Int64Value>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::StringValue* Arena::CreateMaybeMessage<::google::protobuf::StringValue>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::UInt32Value* Arena::CreateMaybeMessage<::google::protobuf::UInt32Value>(Arena*);\ntemplate<> LIBPROTOBUF_EXPORT ::google::protobuf::UInt64Value* Arena::CreateMaybeMessage<::google::protobuf::UInt64Value>(Arena*);\n}  // namespace protobuf\n}  // namespace google\nnamespace google {\nnamespace protobuf {\n\n// ===================================================================\n\nclass LIBPROTOBUF_EXPORT DoubleValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.DoubleValue) */ {\n public:\n  DoubleValue();\n  virtual ~DoubleValue();\n\n  DoubleValue(const DoubleValue& from);\n\n  inline DoubleValue& operator=(const DoubleValue& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  DoubleValue(DoubleValue&& from) noexcept\n    : DoubleValue() {\n    *this = ::std::move(from);\n  }\n\n  inline DoubleValue& operator=(DoubleValue&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const DoubleValue& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const DoubleValue* internal_default_instance() {\n    return reinterpret_cast<const DoubleValue*>(\n               &_DoubleValue_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    0;\n\n  void UnsafeArenaSwap(DoubleValue* other);\n  void Swap(DoubleValue* other);\n  friend void swap(DoubleValue& a, DoubleValue& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline DoubleValue* New() const final {\n    return CreateMaybeMessage<DoubleValue>(NULL);\n  }\n\n  DoubleValue* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<DoubleValue>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const DoubleValue& from);\n  void MergeFrom(const DoubleValue& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(DoubleValue* other);\n  protected:\n  explicit DoubleValue(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // double value = 1;\n  void clear_value();\n  static const int kValueFieldNumber = 1;\n  double value() const;\n  void set_value(double value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.DoubleValue)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  double value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT FloatValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.FloatValue) */ {\n public:\n  FloatValue();\n  virtual ~FloatValue();\n\n  FloatValue(const FloatValue& from);\n\n  inline FloatValue& operator=(const FloatValue& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  FloatValue(FloatValue&& from) noexcept\n    : FloatValue() {\n    *this = ::std::move(from);\n  }\n\n  inline FloatValue& operator=(FloatValue&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const FloatValue& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const FloatValue* internal_default_instance() {\n    return reinterpret_cast<const FloatValue*>(\n               &_FloatValue_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    1;\n\n  void UnsafeArenaSwap(FloatValue* other);\n  void Swap(FloatValue* other);\n  friend void swap(FloatValue& a, FloatValue& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline FloatValue* New() const final {\n    return CreateMaybeMessage<FloatValue>(NULL);\n  }\n\n  FloatValue* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<FloatValue>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const FloatValue& from);\n  void MergeFrom(const FloatValue& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(FloatValue* other);\n  protected:\n  explicit FloatValue(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // float value = 1;\n  void clear_value();\n  static const int kValueFieldNumber = 1;\n  float value() const;\n  void set_value(float value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.FloatValue)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  float value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT Int64Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int64Value) */ {\n public:\n  Int64Value();\n  virtual ~Int64Value();\n\n  Int64Value(const Int64Value& from);\n\n  inline Int64Value& operator=(const Int64Value& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Int64Value(Int64Value&& from) noexcept\n    : Int64Value() {\n    *this = ::std::move(from);\n  }\n\n  inline Int64Value& operator=(Int64Value&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Int64Value& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Int64Value* internal_default_instance() {\n    return reinterpret_cast<const Int64Value*>(\n               &_Int64Value_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    2;\n\n  void UnsafeArenaSwap(Int64Value* other);\n  void Swap(Int64Value* other);\n  friend void swap(Int64Value& a, Int64Value& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Int64Value* New() const final {\n    return CreateMaybeMessage<Int64Value>(NULL);\n  }\n\n  Int64Value* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Int64Value>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Int64Value& from);\n  void MergeFrom(const Int64Value& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Int64Value* other);\n  protected:\n  explicit Int64Value(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // int64 value = 1;\n  void clear_value();\n  static const int kValueFieldNumber = 1;\n  ::google::protobuf::int64 value() const;\n  void set_value(::google::protobuf::int64 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Int64Value)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::int64 value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT UInt64Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt64Value) */ {\n public:\n  UInt64Value();\n  virtual ~UInt64Value();\n\n  UInt64Value(const UInt64Value& from);\n\n  inline UInt64Value& operator=(const UInt64Value& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  UInt64Value(UInt64Value&& from) noexcept\n    : UInt64Value() {\n    *this = ::std::move(from);\n  }\n\n  inline UInt64Value& operator=(UInt64Value&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const UInt64Value& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const UInt64Value* internal_default_instance() {\n    return reinterpret_cast<const UInt64Value*>(\n               &_UInt64Value_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    3;\n\n  void UnsafeArenaSwap(UInt64Value* other);\n  void Swap(UInt64Value* other);\n  friend void swap(UInt64Value& a, UInt64Value& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline UInt64Value* New() const final {\n    return CreateMaybeMessage<UInt64Value>(NULL);\n  }\n\n  UInt64Value* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<UInt64Value>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const UInt64Value& from);\n  void MergeFrom(const UInt64Value& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(UInt64Value* other);\n  protected:\n  explicit UInt64Value(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // uint64 value = 1;\n  void clear_value();\n  static const int kValueFieldNumber = 1;\n  ::google::protobuf::uint64 value() const;\n  void set_value(::google::protobuf::uint64 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.UInt64Value)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::uint64 value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT Int32Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Int32Value) */ {\n public:\n  Int32Value();\n  virtual ~Int32Value();\n\n  Int32Value(const Int32Value& from);\n\n  inline Int32Value& operator=(const Int32Value& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  Int32Value(Int32Value&& from) noexcept\n    : Int32Value() {\n    *this = ::std::move(from);\n  }\n\n  inline Int32Value& operator=(Int32Value&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const Int32Value& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const Int32Value* internal_default_instance() {\n    return reinterpret_cast<const Int32Value*>(\n               &_Int32Value_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    4;\n\n  void UnsafeArenaSwap(Int32Value* other);\n  void Swap(Int32Value* other);\n  friend void swap(Int32Value& a, Int32Value& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline Int32Value* New() const final {\n    return CreateMaybeMessage<Int32Value>(NULL);\n  }\n\n  Int32Value* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<Int32Value>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const Int32Value& from);\n  void MergeFrom(const Int32Value& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(Int32Value* other);\n  protected:\n  explicit Int32Value(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // int32 value = 1;\n  void clear_value();\n  static const int kValueFieldNumber = 1;\n  ::google::protobuf::int32 value() const;\n  void set_value(::google::protobuf::int32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.Int32Value)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::int32 value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT UInt32Value : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.UInt32Value) */ {\n public:\n  UInt32Value();\n  virtual ~UInt32Value();\n\n  UInt32Value(const UInt32Value& from);\n\n  inline UInt32Value& operator=(const UInt32Value& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  UInt32Value(UInt32Value&& from) noexcept\n    : UInt32Value() {\n    *this = ::std::move(from);\n  }\n\n  inline UInt32Value& operator=(UInt32Value&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const UInt32Value& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const UInt32Value* internal_default_instance() {\n    return reinterpret_cast<const UInt32Value*>(\n               &_UInt32Value_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    5;\n\n  void UnsafeArenaSwap(UInt32Value* other);\n  void Swap(UInt32Value* other);\n  friend void swap(UInt32Value& a, UInt32Value& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline UInt32Value* New() const final {\n    return CreateMaybeMessage<UInt32Value>(NULL);\n  }\n\n  UInt32Value* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<UInt32Value>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const UInt32Value& from);\n  void MergeFrom(const UInt32Value& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(UInt32Value* other);\n  protected:\n  explicit UInt32Value(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // uint32 value = 1;\n  void clear_value();\n  static const int kValueFieldNumber = 1;\n  ::google::protobuf::uint32 value() const;\n  void set_value(::google::protobuf::uint32 value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.UInt32Value)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::uint32 value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT BoolValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BoolValue) */ {\n public:\n  BoolValue();\n  virtual ~BoolValue();\n\n  BoolValue(const BoolValue& from);\n\n  inline BoolValue& operator=(const BoolValue& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  BoolValue(BoolValue&& from) noexcept\n    : BoolValue() {\n    *this = ::std::move(from);\n  }\n\n  inline BoolValue& operator=(BoolValue&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const BoolValue& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const BoolValue* internal_default_instance() {\n    return reinterpret_cast<const BoolValue*>(\n               &_BoolValue_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    6;\n\n  void UnsafeArenaSwap(BoolValue* other);\n  void Swap(BoolValue* other);\n  friend void swap(BoolValue& a, BoolValue& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline BoolValue* New() const final {\n    return CreateMaybeMessage<BoolValue>(NULL);\n  }\n\n  BoolValue* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<BoolValue>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const BoolValue& from);\n  void MergeFrom(const BoolValue& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(BoolValue* other);\n  protected:\n  explicit BoolValue(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // bool value = 1;\n  void clear_value();\n  static const int kValueFieldNumber = 1;\n  bool value() const;\n  void set_value(bool value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.BoolValue)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  bool value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT StringValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.StringValue) */ {\n public:\n  StringValue();\n  virtual ~StringValue();\n\n  StringValue(const StringValue& from);\n\n  inline StringValue& operator=(const StringValue& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  StringValue(StringValue&& from) noexcept\n    : StringValue() {\n    *this = ::std::move(from);\n  }\n\n  inline StringValue& operator=(StringValue&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const StringValue& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const StringValue* internal_default_instance() {\n    return reinterpret_cast<const StringValue*>(\n               &_StringValue_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    7;\n\n  void UnsafeArenaSwap(StringValue* other);\n  void Swap(StringValue* other);\n  friend void swap(StringValue& a, StringValue& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline StringValue* New() const final {\n    return CreateMaybeMessage<StringValue>(NULL);\n  }\n\n  StringValue* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<StringValue>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const StringValue& from);\n  void MergeFrom(const StringValue& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(StringValue* other);\n  protected:\n  explicit StringValue(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // string value = 1;\n  void clear_value();\n  static const int kValueFieldNumber = 1;\n  const ::std::string& value() const;\n  void set_value(const ::std::string& value);\n  #if LANG_CXX11\n  void set_value(::std::string&& value);\n  #endif\n  void set_value(const char* value);\n  void set_value(const char* value, size_t size);\n  ::std::string* mutable_value();\n  ::std::string* release_value();\n  void set_allocated_value(::std::string* value);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_value();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_value(\n      ::std::string* value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.StringValue)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::ArenaStringPtr value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;\n};\n// -------------------------------------------------------------------\n\nclass LIBPROTOBUF_EXPORT BytesValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.BytesValue) */ {\n public:\n  BytesValue();\n  virtual ~BytesValue();\n\n  BytesValue(const BytesValue& from);\n\n  inline BytesValue& operator=(const BytesValue& from) {\n    CopyFrom(from);\n    return *this;\n  }\n  #if LANG_CXX11\n  BytesValue(BytesValue&& from) noexcept\n    : BytesValue() {\n    *this = ::std::move(from);\n  }\n\n  inline BytesValue& operator=(BytesValue&& from) noexcept {\n    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {\n      if (this != &from) InternalSwap(&from);\n    } else {\n      CopyFrom(from);\n    }\n    return *this;\n  }\n  #endif\n  inline ::google::protobuf::Arena* GetArena() const final {\n    return GetArenaNoVirtual();\n  }\n  inline void* GetMaybeArenaPointer() const final {\n    return MaybeArenaPtr();\n  }\n  static const ::google::protobuf::Descriptor* descriptor();\n  static const BytesValue& default_instance();\n\n  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY\n  static inline const BytesValue* internal_default_instance() {\n    return reinterpret_cast<const BytesValue*>(\n               &_BytesValue_default_instance_);\n  }\n  static constexpr int kIndexInFileMessages =\n    8;\n\n  void UnsafeArenaSwap(BytesValue* other);\n  void Swap(BytesValue* other);\n  friend void swap(BytesValue& a, BytesValue& b) {\n    a.Swap(&b);\n  }\n\n  // implements Message ----------------------------------------------\n\n  inline BytesValue* New() const final {\n    return CreateMaybeMessage<BytesValue>(NULL);\n  }\n\n  BytesValue* New(::google::protobuf::Arena* arena) const final {\n    return CreateMaybeMessage<BytesValue>(arena);\n  }\n  void CopyFrom(const ::google::protobuf::Message& from) final;\n  void MergeFrom(const ::google::protobuf::Message& from) final;\n  void CopyFrom(const BytesValue& from);\n  void MergeFrom(const BytesValue& from);\n  void Clear() final;\n  bool IsInitialized() const final;\n\n  size_t ByteSizeLong() const final;\n  bool MergePartialFromCodedStream(\n      ::google::protobuf::io::CodedInputStream* input) final;\n  void SerializeWithCachedSizes(\n      ::google::protobuf::io::CodedOutputStream* output) const final;\n  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(\n      bool deterministic, ::google::protobuf::uint8* target) const final;\n  int GetCachedSize() const final { return _cached_size_.Get(); }\n\n  private:\n  void SharedCtor();\n  void SharedDtor();\n  void SetCachedSize(int size) const final;\n  void InternalSwap(BytesValue* other);\n  protected:\n  explicit BytesValue(::google::protobuf::Arena* arena);\n  private:\n  static void ArenaDtor(void* object);\n  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);\n  private:\n  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {\n    return _internal_metadata_.arena();\n  }\n  inline void* MaybeArenaPtr() const {\n    return _internal_metadata_.raw_arena_ptr();\n  }\n  public:\n\n  ::google::protobuf::Metadata GetMetadata() const final;\n\n  // nested types ----------------------------------------------------\n\n  // accessors -------------------------------------------------------\n\n  // bytes value = 1;\n  void clear_value();\n  static const int kValueFieldNumber = 1;\n  const ::std::string& value() const;\n  void set_value(const ::std::string& value);\n  #if LANG_CXX11\n  void set_value(::std::string&& value);\n  #endif\n  void set_value(const char* value);\n  void set_value(const void* value, size_t size);\n  ::std::string* mutable_value();\n  ::std::string* release_value();\n  void set_allocated_value(::std::string* value);\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  ::std::string* unsafe_arena_release_value();\n  PROTOBUF_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors for\"\n  \"    string fields are deprecated and will be removed in a\"\n  \"    future release.\")\n  void unsafe_arena_set_allocated_value(\n      ::std::string* value);\n\n  // @@protoc_insertion_point(class_scope:google.protobuf.BytesValue)\n private:\n\n  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;\n  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;\n  typedef void InternalArenaConstructable_;\n  typedef void DestructorSkippable_;\n  ::google::protobuf::internal::ArenaStringPtr value_;\n  mutable ::google::protobuf::internal::CachedSize _cached_size_;\n  friend struct ::protobuf_google_2fprotobuf_2fwrappers_2eproto::TableStruct;\n};\n// ===================================================================\n\n\n// ===================================================================\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wstrict-aliasing\"\n#endif  // __GNUC__\n// DoubleValue\n\n// double value = 1;\ninline void DoubleValue::clear_value() {\n  value_ = 0;\n}\ninline double DoubleValue::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.DoubleValue.value)\n  return value_;\n}\ninline void DoubleValue::set_value(double value) {\n  \n  value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.DoubleValue.value)\n}\n\n// -------------------------------------------------------------------\n\n// FloatValue\n\n// float value = 1;\ninline void FloatValue::clear_value() {\n  value_ = 0;\n}\ninline float FloatValue::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.FloatValue.value)\n  return value_;\n}\ninline void FloatValue::set_value(float value) {\n  \n  value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.FloatValue.value)\n}\n\n// -------------------------------------------------------------------\n\n// Int64Value\n\n// int64 value = 1;\ninline void Int64Value::clear_value() {\n  value_ = GOOGLE_LONGLONG(0);\n}\ninline ::google::protobuf::int64 Int64Value::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Int64Value.value)\n  return value_;\n}\ninline void Int64Value::set_value(::google::protobuf::int64 value) {\n  \n  value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Int64Value.value)\n}\n\n// -------------------------------------------------------------------\n\n// UInt64Value\n\n// uint64 value = 1;\ninline void UInt64Value::clear_value() {\n  value_ = GOOGLE_ULONGLONG(0);\n}\ninline ::google::protobuf::uint64 UInt64Value::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UInt64Value.value)\n  return value_;\n}\ninline void UInt64Value::set_value(::google::protobuf::uint64 value) {\n  \n  value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.UInt64Value.value)\n}\n\n// -------------------------------------------------------------------\n\n// Int32Value\n\n// int32 value = 1;\ninline void Int32Value::clear_value() {\n  value_ = 0;\n}\ninline ::google::protobuf::int32 Int32Value::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.Int32Value.value)\n  return value_;\n}\ninline void Int32Value::set_value(::google::protobuf::int32 value) {\n  \n  value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.Int32Value.value)\n}\n\n// -------------------------------------------------------------------\n\n// UInt32Value\n\n// uint32 value = 1;\ninline void UInt32Value::clear_value() {\n  value_ = 0u;\n}\ninline ::google::protobuf::uint32 UInt32Value::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.UInt32Value.value)\n  return value_;\n}\ninline void UInt32Value::set_value(::google::protobuf::uint32 value) {\n  \n  value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.UInt32Value.value)\n}\n\n// -------------------------------------------------------------------\n\n// BoolValue\n\n// bool value = 1;\ninline void BoolValue::clear_value() {\n  value_ = false;\n}\ninline bool BoolValue::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.BoolValue.value)\n  return value_;\n}\ninline void BoolValue::set_value(bool value) {\n  \n  value_ = value;\n  // @@protoc_insertion_point(field_set:google.protobuf.BoolValue.value)\n}\n\n// -------------------------------------------------------------------\n\n// StringValue\n\n// string value = 1;\ninline void StringValue::clear_value() {\n  value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& StringValue::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.StringValue.value)\n  return value_.Get();\n}\ninline void StringValue::set_value(const ::std::string& value) {\n  \n  value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.StringValue.value)\n}\n#if LANG_CXX11\ninline void StringValue::set_value(::std::string&& value) {\n  \n  value_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.StringValue.value)\n}\n#endif\ninline void StringValue::set_value(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.StringValue.value)\n}\ninline void StringValue::set_value(const char* value,\n    size_t size) {\n  \n  value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.StringValue.value)\n}\ninline ::std::string* StringValue::mutable_value() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.StringValue.value)\n  return value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* StringValue::release_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.StringValue.value)\n  \n  return value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void StringValue::set_allocated_value(::std::string* value) {\n  if (value != NULL) {\n    \n  } else {\n    \n  }\n  value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.StringValue.value)\n}\ninline ::std::string* StringValue::unsafe_arena_release_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.StringValue.value)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void StringValue::unsafe_arena_set_allocated_value(\n    ::std::string* value) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (value != NULL) {\n    \n  } else {\n    \n  }\n  value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.StringValue.value)\n}\n\n// -------------------------------------------------------------------\n\n// BytesValue\n\n// bytes value = 1;\ninline void BytesValue::clear_value() {\n  value_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline const ::std::string& BytesValue::value() const {\n  // @@protoc_insertion_point(field_get:google.protobuf.BytesValue.value)\n  return value_.Get();\n}\ninline void BytesValue::set_value(const ::std::string& value) {\n  \n  value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set:google.protobuf.BytesValue.value)\n}\n#if LANG_CXX11\ninline void BytesValue::set_value(::std::string&& value) {\n  \n  value_.Set(\n    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_rvalue:google.protobuf.BytesValue.value)\n}\n#endif\ninline void BytesValue::set_value(const char* value) {\n  GOOGLE_DCHECK(value != NULL);\n  \n  value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),\n              GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_char:google.protobuf.BytesValue.value)\n}\ninline void BytesValue::set_value(const void* value,\n    size_t size) {\n  \n  value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(\n      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_pointer:google.protobuf.BytesValue.value)\n}\ninline ::std::string* BytesValue::mutable_value() {\n  \n  // @@protoc_insertion_point(field_mutable:google.protobuf.BytesValue.value)\n  return value_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline ::std::string* BytesValue::release_value() {\n  // @@protoc_insertion_point(field_release:google.protobuf.BytesValue.value)\n  \n  return value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());\n}\ninline void BytesValue::set_allocated_value(::std::string* value) {\n  if (value != NULL) {\n    \n  } else {\n    \n  }\n  value_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value,\n      GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_set_allocated:google.protobuf.BytesValue.value)\n}\ninline ::std::string* BytesValue::unsafe_arena_release_value() {\n  // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.BytesValue.value)\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  \n  return value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      GetArenaNoVirtual());\n}\ninline void BytesValue::unsafe_arena_set_allocated_value(\n    ::std::string* value) {\n  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);\n  if (value != NULL) {\n    \n  } else {\n    \n  }\n  value_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),\n      value, GetArenaNoVirtual());\n  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.BytesValue.value)\n}\n\n#ifdef __GNUC__\n  #pragma GCC diagnostic pop\n#endif  // __GNUC__\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n// -------------------------------------------------------------------\n\n\n// @@protoc_insertion_point(namespace_scope)\n\n}  // namespace protobuf\n}  // namespace google\n\n// @@protoc_insertion_point(global_scope)\n\n#endif  // PROTOBUF_INCLUDED_google_2fprotobuf_2fwrappers_2eproto\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/include/google/protobuf/wrappers.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Wrappers for primitive (non-message) types. These types are useful\n// for embedding primitives in the `google.protobuf.Any` type and for places\n// where we need to distinguish between the absence of a primitive\n// typed field and its default value.\n\nsyntax = \"proto3\";\n\npackage google.protobuf;\n\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption cc_enable_arenas = true;\noption go_package = \"github.com/golang/protobuf/ptypes/wrappers\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"WrappersProto\";\noption java_multiple_files = true;\noption objc_class_prefix = \"GPB\";\n\n// Wrapper message for `double`.\n//\n// The JSON representation for `DoubleValue` is JSON number.\nmessage DoubleValue {\n  // The double value.\n  double value = 1;\n}\n\n// Wrapper message for `float`.\n//\n// The JSON representation for `FloatValue` is JSON number.\nmessage FloatValue {\n  // The float value.\n  float value = 1;\n}\n\n// Wrapper message for `int64`.\n//\n// The JSON representation for `Int64Value` is JSON string.\nmessage Int64Value {\n  // The int64 value.\n  int64 value = 1;\n}\n\n// Wrapper message for `uint64`.\n//\n// The JSON representation for `UInt64Value` is JSON string.\nmessage UInt64Value {\n  // The uint64 value.\n  uint64 value = 1;\n}\n\n// Wrapper message for `int32`.\n//\n// The JSON representation for `Int32Value` is JSON number.\nmessage Int32Value {\n  // The int32 value.\n  int32 value = 1;\n}\n\n// Wrapper message for `uint32`.\n//\n// The JSON representation for `UInt32Value` is JSON number.\nmessage UInt32Value {\n  // The uint32 value.\n  uint32 value = 1;\n}\n\n// Wrapper message for `bool`.\n//\n// The JSON representation for `BoolValue` is JSON `true` and `false`.\nmessage BoolValue {\n  // The bool value.\n  bool value = 1;\n}\n\n// Wrapper message for `string`.\n//\n// The JSON representation for `StringValue` is JSON string.\nmessage StringValue {\n  // The string value.\n  string value = 1;\n}\n\n// Wrapper message for `bytes`.\n//\n// The JSON representation for `BytesValue` is JSON string.\nmessage BytesValue {\n  // The bytes value.\n  bytes value = 1;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/lib/pkgconfig/protobuf-lite.pc",
    "content": "prefix=/protobuf/protobuf-3.6.1/..\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include\n\nName: Protocol Buffers\nDescription: Google's Data Interchange Format\nVersion: 3.6.1\nLibs: -L${libdir} -lprotobuf-lite -pthread \nCflags: -I${includedir} -pthread\nConflicts: protobuf\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/protobuf/lib/pkgconfig/protobuf.pc",
    "content": "prefix=/protobuf/protobuf-3.6.1/..\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include\n\nName: Protocol Buffers\nDescription: Google's Data Interchange Format\nVersion: 3.6.1\nLibs: -L${libdir} -lprotobuf -pthread \nLibs.private: -lz \nCflags: -I${includedir} -pthread\nConflicts: protobuf-lite\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/CMakeLists.txt",
    "content": "# CMakeLists.txt -- Build system for the pybind11 modules\n#\n# Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>\n#\n# All rights reserved. Use of this source code is governed by a\n# BSD-style license that can be found in the LICENSE file.\n\ncmake_minimum_required(VERSION 3.4)\n\n# The `cmake_minimum_required(VERSION 3.4...3.22)` syntax does not work with\n# some versions of VS that have a patched CMake 3.11. This forces us to emulate\n# the behavior using the following workaround:\nif(${CMAKE_VERSION} VERSION_LESS 3.22)\n  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})\nelse()\n  cmake_policy(VERSION 3.22)\nendif()\n\n# Avoid infinite recursion if tests include this as a subdirectory\nif(DEFINED PYBIND11_MASTER_PROJECT)\n  return()\nendif()\n\n# Extract project version from source\nfile(STRINGS \"${CMAKE_CURRENT_SOURCE_DIR}/include/pybind11/detail/common.h\"\n     pybind11_version_defines REGEX \"#define PYBIND11_VERSION_(MAJOR|MINOR|PATCH) \")\n\nforeach(ver ${pybind11_version_defines})\n  if(ver MATCHES [[#define PYBIND11_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$]])\n    set(PYBIND11_VERSION_${CMAKE_MATCH_1} \"${CMAKE_MATCH_2}\")\n  endif()\nendforeach()\n\nif(PYBIND11_VERSION_PATCH MATCHES [[\\.([a-zA-Z0-9]+)$]])\n  set(pybind11_VERSION_TYPE \"${CMAKE_MATCH_1}\")\nendif()\nstring(REGEX MATCH \"^[0-9]+\" PYBIND11_VERSION_PATCH \"${PYBIND11_VERSION_PATCH}\")\n\nproject(\n  pybind11\n  LANGUAGES CXX\n  VERSION \"${PYBIND11_VERSION_MAJOR}.${PYBIND11_VERSION_MINOR}.${PYBIND11_VERSION_PATCH}\")\n\n# Standard includes\ninclude(GNUInstallDirs)\ninclude(CMakePackageConfigHelpers)\ninclude(CMakeDependentOption)\n\nif(NOT pybind11_FIND_QUIETLY)\n  message(STATUS \"pybind11 v${pybind11_VERSION} ${pybind11_VERSION_TYPE}\")\nendif()\n\n# Check if pybind11 is being used directly or via add_subdirectory\nif(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)\n  ### Warn if not an out-of-source builds\n  if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)\n    set(lines\n        \"You are building in-place. If that is not what you intended to \"\n        \"do, you can clean the source directory with:\\n\"\n        \"rm -r CMakeCache.txt CMakeFiles/ cmake_uninstall.cmake pybind11Config.cmake \"\n        \"pybind11ConfigVersion.cmake tests/CMakeFiles/\\n\")\n    message(AUTHOR_WARNING ${lines})\n  endif()\n\n  set(PYBIND11_MASTER_PROJECT ON)\n\n  if(OSX AND CMAKE_VERSION VERSION_LESS 3.7)\n    # Bug in macOS CMake < 3.7 is unable to download catch\n    message(WARNING \"CMAKE 3.7+ needed on macOS to download catch, and newer HIGHLY recommended\")\n  elseif(WINDOWS AND CMAKE_VERSION VERSION_LESS 3.8)\n    # Only tested with 3.8+ in CI.\n    message(WARNING \"CMAKE 3.8+ tested on Windows, previous versions untested\")\n  endif()\n\n  message(STATUS \"CMake ${CMAKE_VERSION}\")\n\n  if(CMAKE_CXX_STANDARD)\n    set(CMAKE_CXX_EXTENSIONS OFF)\n    set(CMAKE_CXX_STANDARD_REQUIRED ON)\n  endif()\n\n  set(pybind11_system \"\")\n\n  set_property(GLOBAL PROPERTY USE_FOLDERS ON)\nelse()\n  set(PYBIND11_MASTER_PROJECT OFF)\n  set(pybind11_system SYSTEM)\nendif()\n\n# Options\noption(PYBIND11_INSTALL \"Install pybind11 header files?\" ${PYBIND11_MASTER_PROJECT})\noption(PYBIND11_TEST \"Build pybind11 test suite?\" ${PYBIND11_MASTER_PROJECT})\noption(PYBIND11_NOPYTHON \"Disable search for Python\" OFF)\noption(PYBIND11_SIMPLE_GIL_MANAGEMENT\n       \"Use simpler GIL management logic that does not support disassociation\" OFF)\nset(PYBIND11_INTERNALS_VERSION\n    \"\"\n    CACHE STRING \"Override the ABI version, may be used to enable the unstable ABI.\")\n\nif(PYBIND11_SIMPLE_GIL_MANAGEMENT)\n  add_compile_definitions(PYBIND11_SIMPLE_GIL_MANAGEMENT)\nendif()\n\ncmake_dependent_option(\n  USE_PYTHON_INCLUDE_DIR\n  \"Install pybind11 headers in Python include directory instead of default installation prefix\"\n  OFF \"PYBIND11_INSTALL\" OFF)\n\ncmake_dependent_option(PYBIND11_FINDPYTHON \"Force new FindPython\" OFF\n                       \"NOT CMAKE_VERSION VERSION_LESS 3.12\" OFF)\n\n# NB: when adding a header don't forget to also add it to setup.py\nset(PYBIND11_HEADERS\n    include/pybind11/detail/class.h\n    include/pybind11/detail/common.h\n    include/pybind11/detail/descr.h\n    include/pybind11/detail/init.h\n    include/pybind11/detail/internals.h\n    include/pybind11/detail/type_caster_base.h\n    include/pybind11/detail/typeid.h\n    include/pybind11/attr.h\n    include/pybind11/buffer_info.h\n    include/pybind11/cast.h\n    include/pybind11/chrono.h\n    include/pybind11/common.h\n    include/pybind11/complex.h\n    include/pybind11/options.h\n    include/pybind11/eigen.h\n    include/pybind11/eigen/matrix.h\n    include/pybind11/eigen/tensor.h\n    include/pybind11/embed.h\n    include/pybind11/eval.h\n    include/pybind11/gil.h\n    include/pybind11/iostream.h\n    include/pybind11/functional.h\n    include/pybind11/numpy.h\n    include/pybind11/operators.h\n    include/pybind11/pybind11.h\n    include/pybind11/pytypes.h\n    include/pybind11/stl.h\n    include/pybind11/stl_bind.h\n    include/pybind11/stl/filesystem.h)\n\n# Compare with grep and warn if mismatched\nif(PYBIND11_MASTER_PROJECT AND NOT CMAKE_VERSION VERSION_LESS 3.12)\n  file(\n    GLOB_RECURSE _pybind11_header_check\n    LIST_DIRECTORIES false\n    RELATIVE \"${CMAKE_CURRENT_SOURCE_DIR}\"\n    CONFIGURE_DEPENDS \"include/pybind11/*.h\")\n  set(_pybind11_here_only ${PYBIND11_HEADERS})\n  set(_pybind11_disk_only ${_pybind11_header_check})\n  list(REMOVE_ITEM _pybind11_here_only ${_pybind11_header_check})\n  list(REMOVE_ITEM _pybind11_disk_only ${PYBIND11_HEADERS})\n  if(_pybind11_here_only)\n    message(AUTHOR_WARNING \"PYBIND11_HEADERS has extra files:\" ${_pybind11_here_only})\n  endif()\n  if(_pybind11_disk_only)\n    message(AUTHOR_WARNING \"PYBIND11_HEADERS is missing files:\" ${_pybind11_disk_only})\n  endif()\nendif()\n\n# CMake 3.12 added list(TRANSFORM <list> PREPEND\n# But we can't use it yet\nstring(REPLACE \"include/\" \"${CMAKE_CURRENT_SOURCE_DIR}/include/\" PYBIND11_HEADERS\n               \"${PYBIND11_HEADERS}\")\n\n# Cache variable so this can be used in parent projects\nset(pybind11_INCLUDE_DIR\n    \"${CMAKE_CURRENT_LIST_DIR}/include\"\n    CACHE INTERNAL \"Directory where pybind11 headers are located\")\n\n# Backward compatible variable for add_subdirectory mode\nif(NOT PYBIND11_MASTER_PROJECT)\n  set(PYBIND11_INCLUDE_DIR\n      \"${pybind11_INCLUDE_DIR}\"\n      CACHE INTERNAL \"\")\nendif()\n\n# Note: when creating targets, you cannot use if statements at configure time -\n# you need generator expressions, because those will be placed in the target file.\n# You can also place ifs *in* the Config.in, but not here.\n\n# This section builds targets, but does *not* touch Python\n# Non-IMPORT targets cannot be defined twice\nif(NOT TARGET pybind11_headers)\n  # Build the headers-only target (no Python included):\n  # (long name used here to keep this from clashing in subdirectory mode)\n  add_library(pybind11_headers INTERFACE)\n  add_library(pybind11::pybind11_headers ALIAS pybind11_headers) # to match exported target\n  add_library(pybind11::headers ALIAS pybind11_headers) # easier to use/remember\n\n  target_include_directories(\n    pybind11_headers ${pybind11_system} INTERFACE $<BUILD_INTERFACE:${pybind11_INCLUDE_DIR}>\n                                                  $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)\n\n  target_compile_features(pybind11_headers INTERFACE cxx_inheriting_constructors cxx_user_literals\n                                                     cxx_right_angle_brackets)\n  if(NOT \"${PYBIND11_INTERNALS_VERSION}\" STREQUAL \"\")\n    target_compile_definitions(\n      pybind11_headers INTERFACE \"PYBIND11_INTERNALS_VERSION=${PYBIND11_INTERNALS_VERSION}\")\n  endif()\nelse()\n  # It is invalid to install a target twice, too.\n  set(PYBIND11_INSTALL OFF)\nendif()\n\ninclude(\"${CMAKE_CURRENT_SOURCE_DIR}/tools/pybind11Common.cmake\")\n# https://github.com/jtojnar/cmake-snips/#concatenating-paths-when-building-pkg-config-files\n# TODO: cmake 3.20 adds the cmake_path() function, which obsoletes this snippet\ninclude(\"${CMAKE_CURRENT_SOURCE_DIR}/tools/JoinPaths.cmake\")\n\n# Relative directory setting\nif(USE_PYTHON_INCLUDE_DIR AND DEFINED Python_INCLUDE_DIRS)\n  file(RELATIVE_PATH CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX} ${Python_INCLUDE_DIRS})\nelseif(USE_PYTHON_INCLUDE_DIR AND DEFINED PYTHON_INCLUDE_DIR)\n  file(RELATIVE_PATH CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX} ${PYTHON_INCLUDE_DIRS})\nendif()\n\nif(PYBIND11_INSTALL)\n  install(DIRECTORY ${pybind11_INCLUDE_DIR}/pybind11 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})\n  set(PYBIND11_CMAKECONFIG_INSTALL_DIR\n      \"${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}\"\n      CACHE STRING \"install path for pybind11Config.cmake\")\n\n  if(IS_ABSOLUTE \"${CMAKE_INSTALL_INCLUDEDIR}\")\n    set(pybind11_INCLUDEDIR \"${CMAKE_INSTALL_FULL_INCLUDEDIR}\")\n  else()\n    set(pybind11_INCLUDEDIR \"\\$\\{PACKAGE_PREFIX_DIR\\}/${CMAKE_INSTALL_INCLUDEDIR}\")\n  endif()\n\n  configure_package_config_file(\n    tools/${PROJECT_NAME}Config.cmake.in \"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake\"\n    INSTALL_DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR})\n\n  if(CMAKE_VERSION VERSION_LESS 3.14)\n    # Remove CMAKE_SIZEOF_VOID_P from ConfigVersion.cmake since the library does\n    # not depend on architecture specific settings or libraries.\n    set(_PYBIND11_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})\n    unset(CMAKE_SIZEOF_VOID_P)\n\n    write_basic_package_version_file(\n      ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake\n      VERSION ${PROJECT_VERSION}\n      COMPATIBILITY AnyNewerVersion)\n\n    set(CMAKE_SIZEOF_VOID_P ${_PYBIND11_CMAKE_SIZEOF_VOID_P})\n  else()\n    # CMake 3.14+ natively supports header-only libraries\n    write_basic_package_version_file(\n      ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake\n      VERSION ${PROJECT_VERSION}\n      COMPATIBILITY AnyNewerVersion ARCH_INDEPENDENT)\n  endif()\n\n  install(\n    FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake\n          ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake\n          tools/FindPythonLibsNew.cmake\n          tools/pybind11Common.cmake\n          tools/pybind11Tools.cmake\n          tools/pybind11NewTools.cmake\n    DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR})\n\n  if(NOT PYBIND11_EXPORT_NAME)\n    set(PYBIND11_EXPORT_NAME \"${PROJECT_NAME}Targets\")\n  endif()\n\n  install(TARGETS pybind11_headers EXPORT \"${PYBIND11_EXPORT_NAME}\")\n\n  install(\n    EXPORT \"${PYBIND11_EXPORT_NAME}\"\n    NAMESPACE \"pybind11::\"\n    DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR})\n\n  # pkg-config support\n  if(NOT prefix_for_pc_file)\n    set(prefix_for_pc_file \"${CMAKE_INSTALL_PREFIX}\")\n  endif()\n  join_paths(includedir_for_pc_file \"\\${prefix}\" \"${CMAKE_INSTALL_INCLUDEDIR}\")\n  configure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/tools/pybind11.pc.in\"\n                 \"${CMAKE_CURRENT_BINARY_DIR}/pybind11.pc\" @ONLY)\n  install(FILES \"${CMAKE_CURRENT_BINARY_DIR}/pybind11.pc\"\n          DESTINATION \"${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig/\")\n\n  # Uninstall target\n  if(PYBIND11_MASTER_PROJECT)\n    configure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake_uninstall.cmake.in\"\n                   \"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake\" IMMEDIATE @ONLY)\n\n    add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P\n                                        ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)\n  endif()\nendif()\n\n# BUILD_TESTING takes priority, but only if this is the master project\nif(PYBIND11_MASTER_PROJECT AND DEFINED BUILD_TESTING)\n  if(BUILD_TESTING)\n    if(_pybind11_nopython)\n      message(FATAL_ERROR \"Cannot activate tests in NOPYTHON mode\")\n    else()\n      add_subdirectory(tests)\n    endif()\n  endif()\nelse()\n  if(PYBIND11_TEST)\n    if(_pybind11_nopython)\n      message(FATAL_ERROR \"Cannot activate tests in NOPYTHON mode\")\n    else()\n      add_subdirectory(tests)\n    endif()\n  endif()\nendif()\n\n# Better symmetry with find_package(pybind11 CONFIG) mode.\nif(NOT PYBIND11_MASTER_PROJECT)\n  set(pybind11_FOUND\n      TRUE\n      CACHE INTERNAL \"True if pybind11 and all required components found on the system\")\nendif()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/LICENSE",
    "content": "Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nPlease also refer to the file .github/CONTRIBUTING.md, which clarifies licensing of\nexternal contributions to this project including patches, pull requests, etc.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/MANIFEST.in",
    "content": "prune tests\nrecursive-include pybind11/include/pybind11 *.h\nrecursive-include pybind11 *.py\nrecursive-include pybind11 py.typed\ninclude pybind11/share/cmake/pybind11/*.cmake\ninclude LICENSE README.rst pyproject.toml setup.py setup.cfg\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/README.rst",
    "content": ".. figure:: https://github.com/pybind/pybind11/raw/master/docs/pybind11-logo.png\n   :alt: pybind11 logo\n\n**pybind11 — Seamless operability between C++11 and Python**\n\n|Latest Documentation Status| |Stable Documentation Status| |Gitter chat| |GitHub Discussions| |CI| |Build status|\n\n|Repology| |PyPI package| |Conda-forge| |Python Versions|\n\n`Setuptools example <https://github.com/pybind/python_example>`_\n• `Scikit-build example <https://github.com/pybind/scikit_build_example>`_\n• `CMake example <https://github.com/pybind/cmake_example>`_\n\n.. start\n\n\n**pybind11** is a lightweight header-only library that exposes C++ types\nin Python and vice versa, mainly to create Python bindings of existing\nC++ code. Its goals and syntax are similar to the excellent\n`Boost.Python <http://www.boost.org/doc/libs/1_58_0/libs/python/doc/>`_\nlibrary by David Abrahams: to minimize boilerplate code in traditional\nextension modules by inferring type information using compile-time\nintrospection.\n\nThe main issue with Boost.Python—and the reason for creating such a\nsimilar project—is Boost. Boost is an enormously large and complex suite\nof utility libraries that works with almost every C++ compiler in\nexistence. This compatibility has its cost: arcane template tricks and\nworkarounds are necessary to support the oldest and buggiest of compiler\nspecimens. Now that C++11-compatible compilers are widely available,\nthis heavy machinery has become an excessively large and unnecessary\ndependency.\n\nThink of this library as a tiny self-contained version of Boost.Python\nwith everything stripped away that isn't relevant for binding\ngeneration. Without comments, the core header files only require ~4K\nlines of code and depend on Python (3.6+, or PyPy) and the C++\nstandard library. This compact implementation was possible thanks to\nsome of the new C++11 language features (specifically: tuples, lambda\nfunctions and variadic templates). Since its creation, this library has\ngrown beyond Boost.Python in many ways, leading to dramatically simpler\nbinding code in many common situations.\n\nTutorial and reference documentation is provided at\n`pybind11.readthedocs.io <https://pybind11.readthedocs.io/en/latest>`_.\nA PDF version of the manual is available\n`here <https://pybind11.readthedocs.io/_/downloads/en/latest/pdf/>`_.\nAnd the source code is always available at\n`github.com/pybind/pybind11 <https://github.com/pybind/pybind11>`_.\n\n\nCore features\n-------------\n\n\npybind11 can map the following core C++ features to Python:\n\n- Functions accepting and returning custom data structures per value,\n  reference, or pointer\n- Instance methods and static methods\n- Overloaded functions\n- Instance attributes and static attributes\n- Arbitrary exception types\n- Enumerations\n- Callbacks\n- Iterators and ranges\n- Custom operators\n- Single and multiple inheritance\n- STL data structures\n- Smart pointers with reference counting like ``std::shared_ptr``\n- Internal references with correct reference counting\n- C++ classes with virtual (and pure virtual) methods can be extended\n  in Python\n\nGoodies\n-------\n\nIn addition to the core functionality, pybind11 provides some extra\ngoodies:\n\n- Python 3.6+, and PyPy3 7.3 are supported with an implementation-agnostic\n  interface (pybind11 2.9 was the last version to support Python 2 and 3.5).\n\n- It is possible to bind C++11 lambda functions with captured\n  variables. The lambda capture data is stored inside the resulting\n  Python function object.\n\n- pybind11 uses C++11 move constructors and move assignment operators\n  whenever possible to efficiently transfer custom data types.\n\n- It's easy to expose the internal storage of custom data types through\n  Pythons' buffer protocols. This is handy e.g. for fast conversion\n  between C++ matrix classes like Eigen and NumPy without expensive\n  copy operations.\n\n- pybind11 can automatically vectorize functions so that they are\n  transparently applied to all entries of one or more NumPy array\n  arguments.\n\n- Python's slice-based access and assignment operations can be\n  supported with just a few lines of code.\n\n- Everything is contained in just a few header files; there is no need\n  to link against any additional libraries.\n\n- Binaries are generally smaller by a factor of at least 2 compared to\n  equivalent bindings generated by Boost.Python. A recent pybind11\n  conversion of PyRosetta, an enormous Boost.Python binding project,\n  `reported <https://graylab.jhu.edu/Sergey/2016.RosettaCon/PyRosetta-4.pdf>`_\n  a binary size reduction of **5.4x** and compile time reduction by\n  **5.8x**.\n\n- Function signatures are precomputed at compile time (using\n  ``constexpr``), leading to smaller binaries.\n\n- With little extra effort, C++ types can be pickled and unpickled\n  similar to regular Python objects.\n\nSupported compilers\n-------------------\n\n1. Clang/LLVM 3.3 or newer (for Apple Xcode's clang, this is 5.0.0 or\n   newer)\n2. GCC 4.8 or newer\n3. Microsoft Visual Studio 2017 or newer\n4. Intel classic C++ compiler 18 or newer (ICC 20.2 tested in CI)\n5. Cygwin/GCC (previously tested on 2.5.1)\n6. NVCC (CUDA 11.0 tested in CI)\n7. NVIDIA PGI (20.9 tested in CI)\n\nAbout\n-----\n\nThis project was created by `Wenzel\nJakob <http://rgl.epfl.ch/people/wjakob>`_. Significant features and/or\nimprovements to the code were contributed by Jonas Adler, Lori A. Burns,\nSylvain Corlay, Eric Cousineau, Aaron Gokaslan, Ralf Grosse-Kunstleve, Trent Houliston, Axel\nHuebl, @hulucc, Yannick Jadoul, Sergey Lyskov Johan Mabille, Tomasz Miąsko,\nDean Moldovan, Ben Pritchard, Jason Rhinelander, Boris Schäling, Pim\nSchellart, Henry Schreiner, Ivan Smirnov, Boris Staletic, and Patrick Stewart.\n\nWe thank Google for a generous financial contribution to the continuous\nintegration infrastructure used by this project.\n\n\nContributing\n~~~~~~~~~~~~\n\nSee the `contributing\nguide <https://github.com/pybind/pybind11/blob/master/.github/CONTRIBUTING.md>`_\nfor information on building and contributing to pybind11.\n\nLicense\n~~~~~~~\n\npybind11 is provided under a BSD-style license that can be found in the\n`LICENSE <https://github.com/pybind/pybind11/blob/master/LICENSE>`_\nfile. By using, distributing, or contributing to this project, you agree\nto the terms and conditions of this license.\n\n.. |Latest Documentation Status| image:: https://readthedocs.org/projects/pybind11/badge?version=latest\n   :target: http://pybind11.readthedocs.org/en/latest\n.. |Stable Documentation Status| image:: https://img.shields.io/badge/docs-stable-blue.svg\n   :target: http://pybind11.readthedocs.org/en/stable\n.. |Gitter chat| image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg\n   :target: https://gitter.im/pybind/Lobby\n.. |CI| image:: https://github.com/pybind/pybind11/workflows/CI/badge.svg\n   :target: https://github.com/pybind/pybind11/actions\n.. |Build status| image:: https://ci.appveyor.com/api/projects/status/riaj54pn4h08xy40?svg=true\n   :target: https://ci.appveyor.com/project/wjakob/pybind11\n.. |PyPI package| image:: https://img.shields.io/pypi/v/pybind11.svg\n   :target: https://pypi.org/project/pybind11/\n.. |Conda-forge| image:: https://img.shields.io/conda/vn/conda-forge/pybind11.svg\n   :target: https://github.com/conda-forge/pybind11-feedstock\n.. |Repology| image:: https://repology.org/badge/latest-versions/python:pybind11.svg\n   :target: https://repology.org/project/python:pybind11/versions\n.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/pybind11.svg\n   :target: https://pypi.org/project/pybind11/\n.. |GitHub Discussions| image:: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github\n   :target: https://github.com/pybind/pybind11/discussions\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/Doxyfile",
    "content": "PROJECT_NAME           = pybind11\nINPUT                  = ../include/pybind11/\nRECURSIVE              = YES\n\nGENERATE_HTML          = NO\nGENERATE_LATEX         = NO\nGENERATE_XML           = YES\nXML_OUTPUT             = .build/doxygenxml\nXML_PROGRAMLISTING     = YES\n\nMACRO_EXPANSION        = YES\nEXPAND_ONLY_PREDEF     = YES\nEXPAND_AS_DEFINED      = PYBIND11_RUNTIME_EXCEPTION\n\nALIASES                = \"rst=\\verbatim embed:rst\"\nALIASES               += \"endrst=\\endverbatim\"\n\nQUIET                  = YES\nWARNINGS               = YES\nWARN_IF_UNDOCUMENTED   = NO\nPREDEFINED             = PYBIND11_NOINLINE\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/Makefile",
    "content": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHINXBUILD   = sphinx-build\nPAPER         =\nBUILDDIR      = .build\n\n# User-friendly check for sphinx-build\nifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)\n$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)\nendif\n\n# Internal variables.\nPAPEROPT_a4     = -D latex_paper_size=a4\nPAPEROPT_letter = -D latex_paper_size=letter\nALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .\n# the i18n builder cannot share the environment and doctrees with the others\nI18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .\n\n.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext\n\nhelp:\n\t@echo \"Please use \\`make <target>' where <target> is one of\"\n\t@echo \"  html       to make standalone HTML files\"\n\t@echo \"  dirhtml    to make HTML files named index.html in directories\"\n\t@echo \"  singlehtml to make a single large HTML file\"\n\t@echo \"  pickle     to make pickle files\"\n\t@echo \"  json       to make JSON files\"\n\t@echo \"  htmlhelp   to make HTML files and a HTML help project\"\n\t@echo \"  qthelp     to make HTML files and a qthelp project\"\n\t@echo \"  applehelp  to make an Apple Help Book\"\n\t@echo \"  devhelp    to make HTML files and a Devhelp project\"\n\t@echo \"  epub       to make an epub\"\n\t@echo \"  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter\"\n\t@echo \"  latexpdf   to make LaTeX files and run them through pdflatex\"\n\t@echo \"  latexpdfja to make LaTeX files and run them through platex/dvipdfmx\"\n\t@echo \"  text       to make text files\"\n\t@echo \"  man        to make manual pages\"\n\t@echo \"  texinfo    to make Texinfo files\"\n\t@echo \"  info       to make Texinfo files and run them through makeinfo\"\n\t@echo \"  gettext    to make PO message catalogs\"\n\t@echo \"  changes    to make an overview of all changed/added/deprecated items\"\n\t@echo \"  xml        to make Docutils-native XML files\"\n\t@echo \"  pseudoxml  to make pseudoxml-XML files for display purposes\"\n\t@echo \"  linkcheck  to check all external links for integrity\"\n\t@echo \"  doctest    to run all doctests embedded in the documentation (if enabled)\"\n\t@echo \"  coverage   to run coverage check of the documentation (if enabled)\"\n\nclean:\n\trm -rf $(BUILDDIR)/*\n\nhtml:\n\t$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html\n\t@echo\n\t@echo \"Build finished. The HTML pages are in $(BUILDDIR)/html.\"\n\ndirhtml:\n\t$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml\n\t@echo\n\t@echo \"Build finished. The HTML pages are in $(BUILDDIR)/dirhtml.\"\n\nsinglehtml:\n\t$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml\n\t@echo\n\t@echo \"Build finished. The HTML page is in $(BUILDDIR)/singlehtml.\"\n\npickle:\n\t$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle\n\t@echo\n\t@echo \"Build finished; now you can process the pickle files.\"\n\njson:\n\t$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json\n\t@echo\n\t@echo \"Build finished; now you can process the JSON files.\"\n\nhtmlhelp:\n\t$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp\n\t@echo\n\t@echo \"Build finished; now you can run HTML Help Workshop with the\" \\\n\t      \".hhp project file in $(BUILDDIR)/htmlhelp.\"\n\nqthelp:\n\t$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp\n\t@echo\n\t@echo \"Build finished; now you can run \"qcollectiongenerator\" with the\" \\\n\t      \".qhcp project file in $(BUILDDIR)/qthelp, like this:\"\n\t@echo \"# qcollectiongenerator $(BUILDDIR)/qthelp/pybind11.qhcp\"\n\t@echo \"To view the help file:\"\n\t@echo \"# assistant -collectionFile $(BUILDDIR)/qthelp/pybind11.qhc\"\n\napplehelp:\n\t$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp\n\t@echo\n\t@echo \"Build finished. The help book is in $(BUILDDIR)/applehelp.\"\n\t@echo \"N.B. You won't be able to view it unless you put it in\" \\\n\t      \"~/Library/Documentation/Help or install it in your application\" \\\n\t      \"bundle.\"\n\ndevhelp:\n\t$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp\n\t@echo\n\t@echo \"Build finished.\"\n\t@echo \"To view the help file:\"\n\t@echo \"# mkdir -p $$HOME/.local/share/devhelp/pybind11\"\n\t@echo \"# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pybind11\"\n\t@echo \"# devhelp\"\n\nepub:\n\t$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub\n\t@echo\n\t@echo \"Build finished. The epub file is in $(BUILDDIR)/epub.\"\n\nlatex:\n\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex\n\t@echo\n\t@echo \"Build finished; the LaTeX files are in $(BUILDDIR)/latex.\"\n\t@echo \"Run \\`make' in that directory to run these through (pdf)latex\" \\\n\t      \"(use \\`make latexpdf' here to do that automatically).\"\n\nlatexpdf:\n\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex\n\t@echo \"Running LaTeX files through pdflatex...\"\n\t$(MAKE) -C $(BUILDDIR)/latex all-pdf\n\t@echo \"pdflatex finished; the PDF files are in $(BUILDDIR)/latex.\"\n\nlatexpdfja:\n\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex\n\t@echo \"Running LaTeX files through platex and dvipdfmx...\"\n\t$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja\n\t@echo \"pdflatex finished; the PDF files are in $(BUILDDIR)/latex.\"\n\ntext:\n\t$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text\n\t@echo\n\t@echo \"Build finished. The text files are in $(BUILDDIR)/text.\"\n\nman:\n\t$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man\n\t@echo\n\t@echo \"Build finished. The manual pages are in $(BUILDDIR)/man.\"\n\ntexinfo:\n\t$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo\n\t@echo\n\t@echo \"Build finished. The Texinfo files are in $(BUILDDIR)/texinfo.\"\n\t@echo \"Run \\`make' in that directory to run these through makeinfo\" \\\n\t      \"(use \\`make info' here to do that automatically).\"\n\ninfo:\n\t$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo\n\t@echo \"Running Texinfo files through makeinfo...\"\n\tmake -C $(BUILDDIR)/texinfo info\n\t@echo \"makeinfo finished; the Info files are in $(BUILDDIR)/texinfo.\"\n\ngettext:\n\t$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale\n\t@echo\n\t@echo \"Build finished. The message catalogs are in $(BUILDDIR)/locale.\"\n\nchanges:\n\t$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes\n\t@echo\n\t@echo \"The overview file is in $(BUILDDIR)/changes.\"\n\nlinkcheck:\n\t$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck\n\t@echo\n\t@echo \"Link check complete; look for any errors in the above output \" \\\n\t      \"or in $(BUILDDIR)/linkcheck/output.txt.\"\n\ndoctest:\n\t$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest\n\t@echo \"Testing of doctests in the sources finished, look at the \" \\\n\t      \"results in $(BUILDDIR)/doctest/output.txt.\"\n\ncoverage:\n\t$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage\n\t@echo \"Testing of coverage in the sources finished, look at the \" \\\n\t      \"results in $(BUILDDIR)/coverage/python.txt.\"\n\nxml:\n\t$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml\n\t@echo\n\t@echo \"Build finished. The XML files are in $(BUILDDIR)/xml.\"\n\npseudoxml:\n\t$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml\n\t@echo\n\t@echo \"Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml.\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/_static/css/custom.css",
    "content": ".highlight .go {\n  color: #707070;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/cast/chrono.rst",
    "content": "Chrono\n======\n\nWhen including the additional header file :file:`pybind11/chrono.h` conversions\nfrom C++11 chrono datatypes to python datetime objects are automatically enabled.\nThis header also enables conversions of python floats (often from sources such\nas ``time.monotonic()``, ``time.perf_counter()`` and ``time.process_time()``)\ninto durations.\n\nAn overview of clocks in C++11\n------------------------------\n\nA point of confusion when using these conversions is the differences between\nclocks provided in C++11. There are three clock types defined by the C++11\nstandard and users can define their own if needed. Each of these clocks have\ndifferent properties and when converting to and from python will give different\nresults.\n\nThe first clock defined by the standard is ``std::chrono::system_clock``. This\nclock measures the current date and time. However, this clock changes with to\nupdates to the operating system time. For example, if your time is synchronised\nwith a time server this clock will change. This makes this clock a poor choice\nfor timing purposes but good for measuring the wall time.\n\nThe second clock defined in the standard is ``std::chrono::steady_clock``.\nThis clock ticks at a steady rate and is never adjusted. This makes it excellent\nfor timing purposes, however the value in this clock does not correspond to the\ncurrent date and time. Often this clock will be the amount of time your system\nhas been on, although it does not have to be. This clock will never be the same\nclock as the system clock as the system clock can change but steady clocks\ncannot.\n\nThe third clock defined in the standard is ``std::chrono::high_resolution_clock``.\nThis clock is the clock that has the highest resolution out of the clocks in the\nsystem. It is normally a typedef to either the system clock or the steady clock\nbut can be its own independent clock. This is important as when using these\nconversions as the types you get in python for this clock might be different\ndepending on the system.\nIf it is a typedef of the system clock, python will get datetime objects, but if\nit is a different clock they will be timedelta objects.\n\nProvided conversions\n--------------------\n\n.. rubric:: C++ to Python\n\n- ``std::chrono::system_clock::time_point`` → ``datetime.datetime``\n    System clock times are converted to python datetime instances. They are\n    in the local timezone, but do not have any timezone information attached\n    to them (they are naive datetime objects).\n\n- ``std::chrono::duration`` → ``datetime.timedelta``\n    Durations are converted to timedeltas, any precision in the duration\n    greater than microseconds is lost by rounding towards zero.\n\n- ``std::chrono::[other_clocks]::time_point`` → ``datetime.timedelta``\n    Any clock time that is not the system clock is converted to a time delta.\n    This timedelta measures the time from the clocks epoch to now.\n\n.. rubric:: Python to C++\n\n- ``datetime.datetime`` or ``datetime.date`` or ``datetime.time`` → ``std::chrono::system_clock::time_point``\n    Date/time objects are converted into system clock timepoints. Any\n    timezone information is ignored and the type is treated as a naive\n    object.\n\n- ``datetime.timedelta`` → ``std::chrono::duration``\n    Time delta are converted into durations with microsecond precision.\n\n- ``datetime.timedelta`` → ``std::chrono::[other_clocks]::time_point``\n    Time deltas that are converted into clock timepoints are treated as\n    the amount of time from the start of the clocks epoch.\n\n- ``float`` → ``std::chrono::duration``\n    Floats that are passed to C++ as durations be interpreted as a number of\n    seconds. These will be converted to the duration using ``duration_cast``\n    from the float.\n\n- ``float`` → ``std::chrono::[other_clocks]::time_point``\n    Floats that are passed to C++ as time points will be interpreted as the\n    number of seconds from the start of the clocks epoch.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/cast/custom.rst",
    "content": "Custom type casters\n===================\n\nIn very rare cases, applications may require custom type casters that cannot be\nexpressed using the abstractions provided by pybind11, thus requiring raw\nPython C API calls. This is fairly advanced usage and should only be pursued by\nexperts who are familiar with the intricacies of Python reference counting.\n\nThe following snippets demonstrate how this works for a very simple ``inty``\ntype that that should be convertible from Python types that provide a\n``__int__(self)`` method.\n\n.. code-block:: cpp\n\n    struct inty { long long_value; };\n\n    void print(inty s) {\n        std::cout << s.long_value << std::endl;\n    }\n\nThe following Python snippet demonstrates the intended usage from the Python side:\n\n.. code-block:: python\n\n    class A:\n        def __int__(self):\n            return 123\n\n\n    from example import print\n\n    print(A())\n\nTo register the necessary conversion routines, it is necessary to add an\ninstantiation of the ``pybind11::detail::type_caster<T>`` template.\nAlthough this is an implementation detail, adding an instantiation of this\ntype is explicitly allowed.\n\n.. code-block:: cpp\n\n    namespace PYBIND11_NAMESPACE { namespace detail {\n        template <> struct type_caster<inty> {\n        public:\n            /**\n             * This macro establishes the name 'inty' in\n             * function signatures and declares a local variable\n             * 'value' of type inty\n             */\n            PYBIND11_TYPE_CASTER(inty, const_name(\"inty\"));\n\n            /**\n             * Conversion part 1 (Python->C++): convert a PyObject into a inty\n             * instance or return false upon failure. The second argument\n             * indicates whether implicit conversions should be applied.\n             */\n            bool load(handle src, bool) {\n                /* Extract PyObject from handle */\n                PyObject *source = src.ptr();\n                /* Try converting into a Python integer value */\n                PyObject *tmp = PyNumber_Long(source);\n                if (!tmp)\n                    return false;\n                /* Now try to convert into a C++ int */\n                value.long_value = PyLong_AsLong(tmp);\n                Py_DECREF(tmp);\n                /* Ensure return code was OK (to avoid out-of-range errors etc) */\n                return !(value.long_value == -1 && !PyErr_Occurred());\n            }\n\n            /**\n             * Conversion part 2 (C++ -> Python): convert an inty instance into\n             * a Python object. The second and third arguments are used to\n             * indicate the return value policy and parent object (for\n             * ``return_value_policy::reference_internal``) and are generally\n             * ignored by implicit casters.\n             */\n            static handle cast(inty src, return_value_policy /* policy */, handle /* parent */) {\n                return PyLong_FromLong(src.long_value);\n            }\n        };\n    }} // namespace PYBIND11_NAMESPACE::detail\n\n.. note::\n\n    A ``type_caster<T>`` defined with ``PYBIND11_TYPE_CASTER(T, ...)`` requires\n    that ``T`` is default-constructible (``value`` is first default constructed\n    and then ``load()`` assigns to it).\n\n.. warning::\n\n    When using custom type casters, it's important to declare them consistently\n    in every compilation unit of the Python extension module. Otherwise,\n    undefined behavior can ensue.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/cast/eigen.rst",
    "content": "Eigen\n#####\n\n`Eigen <http://eigen.tuxfamily.org>`_ is C++ header-based library for dense and\nsparse linear algebra. Due to its popularity and widespread adoption, pybind11\nprovides transparent conversion and limited mapping support between Eigen and\nScientific Python linear algebra data types.\n\nTo enable the built-in Eigen support you must include the optional header file\n:file:`pybind11/eigen.h`.\n\nPass-by-value\n=============\n\nWhen binding a function with ordinary Eigen dense object arguments (for\nexample, ``Eigen::MatrixXd``), pybind11 will accept any input value that is\nalready (or convertible to) a ``numpy.ndarray`` with dimensions compatible with\nthe Eigen type, copy its values into a temporary Eigen variable of the\nappropriate type, then call the function with this temporary variable.\n\nSparse matrices are similarly copied to or from\n``scipy.sparse.csr_matrix``/``scipy.sparse.csc_matrix`` objects.\n\nPass-by-reference\n=================\n\nOne major limitation of the above is that every data conversion implicitly\ninvolves a copy, which can be both expensive (for large matrices) and disallows\nbinding functions that change their (Matrix) arguments.  Pybind11 allows you to\nwork around this by using Eigen's ``Eigen::Ref<MatrixType>`` class much as you\nwould when writing a function taking a generic type in Eigen itself (subject to\nsome limitations discussed below).\n\nWhen calling a bound function accepting a ``Eigen::Ref<const MatrixType>``\ntype, pybind11 will attempt to avoid copying by using an ``Eigen::Map`` object\nthat maps into the source ``numpy.ndarray`` data: this requires both that the\ndata types are the same (e.g. ``dtype='float64'`` and ``MatrixType::Scalar`` is\n``double``); and that the storage is layout compatible.  The latter limitation\nis discussed in detail in the section below, and requires careful\nconsideration: by default, numpy matrices and Eigen matrices are *not* storage\ncompatible.\n\nIf the numpy matrix cannot be used as is (either because its types differ, e.g.\npassing an array of integers to an Eigen parameter requiring doubles, or\nbecause the storage is incompatible), pybind11 makes a temporary copy and\npasses the copy instead.\n\nWhen a bound function parameter is instead ``Eigen::Ref<MatrixType>`` (note the\nlack of ``const``), pybind11 will only allow the function to be called if it\ncan be mapped *and* if the numpy array is writeable (that is\n``a.flags.writeable`` is true).  Any access (including modification) made to\nthe passed variable will be transparently carried out directly on the\n``numpy.ndarray``.\n\nThis means you can write code such as the following and have it work as\nexpected:\n\n.. code-block:: cpp\n\n    void scale_by_2(Eigen::Ref<Eigen::VectorXd> v) {\n        v *= 2;\n    }\n\nNote, however, that you will likely run into limitations due to numpy and\nEigen's difference default storage order for data; see the below section on\n:ref:`storage_orders` for details on how to bind code that won't run into such\nlimitations.\n\n.. note::\n\n    Passing by reference is not supported for sparse types.\n\nReturning values to Python\n==========================\n\nWhen returning an ordinary dense Eigen matrix type to numpy (e.g.\n``Eigen::MatrixXd`` or ``Eigen::RowVectorXf``) pybind11 keeps the matrix and\nreturns a numpy array that directly references the Eigen matrix: no copy of the\ndata is performed.  The numpy array will have ``array.flags.owndata`` set to\n``False`` to indicate that it does not own the data, and the lifetime of the\nstored Eigen matrix will be tied to the returned ``array``.\n\nIf you bind a function with a non-reference, ``const`` return type (e.g.\n``const Eigen::MatrixXd``), the same thing happens except that pybind11 also\nsets the numpy array's ``writeable`` flag to false.\n\nIf you return an lvalue reference or pointer, the usual pybind11 rules apply,\nas dictated by the binding function's return value policy (see the\ndocumentation on :ref:`return_value_policies` for full details).  That means,\nwithout an explicit return value policy, lvalue references will be copied and\npointers will be managed by pybind11.  In order to avoid copying, you should\nexplicitly specify an appropriate return value policy, as in the following\nexample:\n\n.. code-block:: cpp\n\n    class MyClass {\n        Eigen::MatrixXd big_mat = Eigen::MatrixXd::Zero(10000, 10000);\n    public:\n        Eigen::MatrixXd &getMatrix() { return big_mat; }\n        const Eigen::MatrixXd &viewMatrix() { return big_mat; }\n    };\n\n    // Later, in binding code:\n    py::class_<MyClass>(m, \"MyClass\")\n        .def(py::init<>())\n        .def(\"copy_matrix\", &MyClass::getMatrix) // Makes a copy!\n        .def(\"get_matrix\", &MyClass::getMatrix, py::return_value_policy::reference_internal)\n        .def(\"view_matrix\", &MyClass::viewMatrix, py::return_value_policy::reference_internal)\n        ;\n\n.. code-block:: python\n\n    a = MyClass()\n    m = a.get_matrix()  # flags.writeable = True,  flags.owndata = False\n    v = a.view_matrix()  # flags.writeable = False, flags.owndata = False\n    c = a.copy_matrix()  # flags.writeable = True,  flags.owndata = True\n    # m[5,6] and v[5,6] refer to the same element, c[5,6] does not.\n\nNote in this example that ``py::return_value_policy::reference_internal`` is\nused to tie the life of the MyClass object to the life of the returned arrays.\n\nYou may also return an ``Eigen::Ref``, ``Eigen::Map`` or other map-like Eigen\nobject (for example, the return value of ``matrix.block()`` and related\nmethods) that map into a dense Eigen type.  When doing so, the default\nbehaviour of pybind11 is to simply reference the returned data: you must take\ncare to ensure that this data remains valid!  You may ask pybind11 to\nexplicitly *copy* such a return value by using the\n``py::return_value_policy::copy`` policy when binding the function.  You may\nalso use ``py::return_value_policy::reference_internal`` or a\n``py::keep_alive`` to ensure the data stays valid as long as the returned numpy\narray does.\n\nWhen returning such a reference of map, pybind11 additionally respects the\nreadonly-status of the returned value, marking the numpy array as non-writeable\nif the reference or map was itself read-only.\n\n.. note::\n\n    Sparse types are always copied when returned.\n\n.. _storage_orders:\n\nStorage orders\n==============\n\nPassing arguments via ``Eigen::Ref`` has some limitations that you must be\naware of in order to effectively pass matrices by reference.  First and\nforemost is that the default ``Eigen::Ref<MatrixType>`` class requires\ncontiguous storage along columns (for column-major types, the default in Eigen)\nor rows if ``MatrixType`` is specifically an ``Eigen::RowMajor`` storage type.\nThe former, Eigen's default, is incompatible with ``numpy``'s default row-major\nstorage, and so you will not be able to pass numpy arrays to Eigen by reference\nwithout making one of two changes.\n\n(Note that this does not apply to vectors (or column or row matrices): for such\ntypes the \"row-major\" and \"column-major\" distinction is meaningless).\n\nThe first approach is to change the use of ``Eigen::Ref<MatrixType>`` to the\nmore general ``Eigen::Ref<MatrixType, 0, Eigen::Stride<Eigen::Dynamic,\nEigen::Dynamic>>`` (or similar type with a fully dynamic stride type in the\nthird template argument).  Since this is a rather cumbersome type, pybind11\nprovides a ``py::EigenDRef<MatrixType>`` type alias for your convenience (along\nwith EigenDMap for the equivalent Map, and EigenDStride for just the stride\ntype).\n\nThis type allows Eigen to map into any arbitrary storage order.  This is not\nthe default in Eigen for performance reasons: contiguous storage allows\nvectorization that cannot be done when storage is not known to be contiguous at\ncompile time.  The default ``Eigen::Ref`` stride type allows non-contiguous\nstorage along the outer dimension (that is, the rows of a column-major matrix\nor columns of a row-major matrix), but not along the inner dimension.\n\nThis type, however, has the added benefit of also being able to map numpy array\nslices.  For example, the following (contrived) example uses Eigen with a numpy\nslice to multiply by 2 all coefficients that are both on even rows (0, 2, 4,\n...) and in columns 2, 5, or 8:\n\n.. code-block:: cpp\n\n    m.def(\"scale\", [](py::EigenDRef<Eigen::MatrixXd> m, double c) { m *= c; });\n\n.. code-block:: python\n\n    # a = np.array(...)\n    scale_by_2(myarray[0::2, 2:9:3])\n\nThe second approach to avoid copying is more intrusive: rearranging the\nunderlying data types to not run into the non-contiguous storage problem in the\nfirst place.  In particular, that means using matrices with ``Eigen::RowMajor``\nstorage, where appropriate, such as:\n\n.. code-block:: cpp\n\n    using RowMatrixXd = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;\n    // Use RowMatrixXd instead of MatrixXd\n\nNow bound functions accepting ``Eigen::Ref<RowMatrixXd>`` arguments will be\ncallable with numpy's (default) arrays without involving a copying.\n\nYou can, alternatively, change the storage order that numpy arrays use by\nadding the ``order='F'`` option when creating an array:\n\n.. code-block:: python\n\n    myarray = np.array(source, order=\"F\")\n\nSuch an object will be passable to a bound function accepting an\n``Eigen::Ref<MatrixXd>`` (or similar column-major Eigen type).\n\nOne major caveat with this approach, however, is that it is not entirely as\neasy as simply flipping all Eigen or numpy usage from one to the other: some\noperations may alter the storage order of a numpy array.  For example, ``a2 =\narray.transpose()`` results in ``a2`` being a view of ``array`` that references\nthe same data, but in the opposite storage order!\n\nWhile this approach allows fully optimized vectorized calculations in Eigen, it\ncannot be used with array slices, unlike the first approach.\n\nWhen *returning* a matrix to Python (either a regular matrix, a reference via\n``Eigen::Ref<>``, or a map/block into a matrix), no special storage\nconsideration is required: the created numpy array will have the required\nstride that allows numpy to properly interpret the array, whatever its storage\norder.\n\nFailing rather than copying\n===========================\n\nThe default behaviour when binding ``Eigen::Ref<const MatrixType>`` Eigen\nreferences is to copy matrix values when passed a numpy array that does not\nconform to the element type of ``MatrixType`` or does not have a compatible\nstride layout.  If you want to explicitly avoid copying in such a case, you\nshould bind arguments using the ``py::arg().noconvert()`` annotation (as\ndescribed in the :ref:`nonconverting_arguments` documentation).\n\nThe following example shows an example of arguments that don't allow data\ncopying to take place:\n\n.. code-block:: cpp\n\n    // The method and function to be bound:\n    class MyClass {\n        // ...\n        double some_method(const Eigen::Ref<const MatrixXd> &matrix) { /* ... */ }\n    };\n    float some_function(const Eigen::Ref<const MatrixXf> &big,\n                        const Eigen::Ref<const MatrixXf> &small) {\n        // ...\n    }\n\n    // The associated binding code:\n    using namespace pybind11::literals; // for \"arg\"_a\n    py::class_<MyClass>(m, \"MyClass\")\n        // ... other class definitions\n        .def(\"some_method\", &MyClass::some_method, py::arg().noconvert());\n\n    m.def(\"some_function\", &some_function,\n        \"big\"_a.noconvert(), // <- Don't allow copying for this arg\n        \"small\"_a            // <- This one can be copied if needed\n    );\n\nWith the above binding code, attempting to call the the ``some_method(m)``\nmethod on a ``MyClass`` object, or attempting to call ``some_function(m, m2)``\nwill raise a ``RuntimeError`` rather than making a temporary copy of the array.\nIt will, however, allow the ``m2`` argument to be copied into a temporary if\nnecessary.\n\nNote that explicitly specifying ``.noconvert()`` is not required for *mutable*\nEigen references (e.g. ``Eigen::Ref<MatrixXd>`` without ``const`` on the\n``MatrixXd``): mutable references will never be called with a temporary copy.\n\nVectors versus column/row matrices\n==================================\n\nEigen and numpy have fundamentally different notions of a vector.  In Eigen, a\nvector is simply a matrix with the number of columns or rows set to 1 at\ncompile time (for a column vector or row vector, respectively).  NumPy, in\ncontrast, has comparable 2-dimensional 1xN and Nx1 arrays, but *also* has\n1-dimensional arrays of size N.\n\nWhen passing a 2-dimensional 1xN or Nx1 array to Eigen, the Eigen type must\nhave matching dimensions: That is, you cannot pass a 2-dimensional Nx1 numpy\narray to an Eigen value expecting a row vector, or a 1xN numpy array as a\ncolumn vector argument.\n\nOn the other hand, pybind11 allows you to pass 1-dimensional arrays of length N\nas Eigen parameters.  If the Eigen type can hold a column vector of length N it\nwill be passed as such a column vector.  If not, but the Eigen type constraints\nwill accept a row vector, it will be passed as a row vector.  (The column\nvector takes precedence when both are supported, for example, when passing a\n1D numpy array to a MatrixXd argument).  Note that the type need not be\nexplicitly a vector: it is permitted to pass a 1D numpy array of size 5 to an\nEigen ``Matrix<double, Dynamic, 5>``: you would end up with a 1x5 Eigen matrix.\nPassing the same to an ``Eigen::MatrixXd`` would result in a 5x1 Eigen matrix.\n\nWhen returning an Eigen vector to numpy, the conversion is ambiguous: a row\nvector of length 4 could be returned as either a 1D array of length 4, or as a\n2D array of size 1x4.  When encountering such a situation, pybind11 compromises\nby considering the returned Eigen type: if it is a compile-time vector--that\nis, the type has either the number of rows or columns set to 1 at compile\ntime--pybind11 converts to a 1D numpy array when returning the value.  For\ninstances that are a vector only at run-time (e.g. ``MatrixXd``,\n``Matrix<float, Dynamic, 4>``), pybind11 returns the vector as a 2D array to\nnumpy.  If this isn't want you want, you can use ``array.reshape(...)`` to get\na view of the same data in the desired dimensions.\n\n.. seealso::\n\n    The file :file:`tests/test_eigen.cpp` contains a complete example that\n    shows how to pass Eigen sparse and dense data types in more detail.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/cast/functional.rst",
    "content": "Functional\n##########\n\nThe following features must be enabled by including :file:`pybind11/functional.h`.\n\n\nCallbacks and passing anonymous functions\n=========================================\n\nThe C++11 standard brought lambda functions and the generic polymorphic\nfunction wrapper ``std::function<>`` to the C++ programming language, which\nenable powerful new ways of working with functions. Lambda functions come in\ntwo flavors: stateless lambda function resemble classic function pointers that\nlink to an anonymous piece of code, while stateful lambda functions\nadditionally depend on captured variables that are stored in an anonymous\n*lambda closure object*.\n\nHere is a simple example of a C++ function that takes an arbitrary function\n(stateful or stateless) with signature ``int -> int`` as an argument and runs\nit with the value 10.\n\n.. code-block:: cpp\n\n    int func_arg(const std::function<int(int)> &f) {\n        return f(10);\n    }\n\nThe example below is more involved: it takes a function of signature ``int -> int``\nand returns another function of the same kind. The return value is a stateful\nlambda function, which stores the value ``f`` in the capture object and adds 1 to\nits return value upon execution.\n\n.. code-block:: cpp\n\n    std::function<int(int)> func_ret(const std::function<int(int)> &f) {\n        return [f](int i) {\n            return f(i) + 1;\n        };\n    }\n\nThis example demonstrates using python named parameters in C++ callbacks which\nrequires using ``py::cpp_function`` as a wrapper. Usage is similar to defining\nmethods of classes:\n\n.. code-block:: cpp\n\n    py::cpp_function func_cpp() {\n        return py::cpp_function([](int i) { return i+1; },\n           py::arg(\"number\"));\n    }\n\nAfter including the extra header file :file:`pybind11/functional.h`, it is almost\ntrivial to generate binding code for all of these functions.\n\n.. code-block:: cpp\n\n    #include <pybind11/functional.h>\n\n    PYBIND11_MODULE(example, m) {\n        m.def(\"func_arg\", &func_arg);\n        m.def(\"func_ret\", &func_ret);\n        m.def(\"func_cpp\", &func_cpp);\n    }\n\nThe following interactive session shows how to call them from Python.\n\n.. code-block:: pycon\n\n    $ python\n    >>> import example\n    >>> def square(i):\n    ...     return i * i\n    ...\n    >>> example.func_arg(square)\n    100L\n    >>> square_plus_1 = example.func_ret(square)\n    >>> square_plus_1(4)\n    17L\n    >>> plus_1 = func_cpp()\n    >>> plus_1(number=43)\n    44L\n\n.. warning::\n\n    Keep in mind that passing a function from C++ to Python (or vice versa)\n    will instantiate a piece of wrapper code that translates function\n    invocations between the two languages. Naturally, this translation\n    increases the computational cost of each function call somewhat. A\n    problematic situation can arise when a function is copied back and forth\n    between Python and C++ many times in a row, in which case the underlying\n    wrappers will accumulate correspondingly. The resulting long sequence of\n    C++ -> Python -> C++ -> ... roundtrips can significantly decrease\n    performance.\n\n    There is one exception: pybind11 detects case where a stateless function\n    (i.e. a function pointer or a lambda function without captured variables)\n    is passed as an argument to another C++ function exposed in Python. In this\n    case, there is no overhead. Pybind11 will extract the underlying C++\n    function pointer from the wrapped function to sidestep a potential C++ ->\n    Python -> C++ roundtrip. This is demonstrated in :file:`tests/test_callbacks.cpp`.\n\n.. note::\n\n    This functionality is very useful when generating bindings for callbacks in\n    C++ libraries (e.g. GUI libraries, asynchronous networking libraries, etc.).\n\n    The file :file:`tests/test_callbacks.cpp` contains a complete example\n    that demonstrates how to work with callbacks and anonymous functions in\n    more detail.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/cast/index.rst",
    "content": ".. _type-conversions:\n\nType conversions\n################\n\nApart from enabling cross-language function calls, a fundamental problem\nthat a binding tool like pybind11 must address is to provide access to\nnative Python types in C++ and vice versa. There are three fundamentally\ndifferent ways to do this—which approach is preferable for a particular type\ndepends on the situation at hand.\n\n1. Use a native C++ type everywhere. In this case, the type must be wrapped\n   using pybind11-generated bindings so that Python can interact with it.\n\n2. Use a native Python type everywhere. It will need to be wrapped so that\n   C++ functions can interact with it.\n\n3. Use a native C++ type on the C++ side and a native Python type on the\n   Python side. pybind11 refers to this as a *type conversion*.\n\n   Type conversions are the most \"natural\" option in the sense that native\n   (non-wrapped) types are used everywhere. The main downside is that a copy\n   of the data must be made on every Python ↔ C++ transition: this is\n   needed since the C++ and Python versions of the same type generally won't\n   have the same memory layout.\n\n   pybind11 can perform many kinds of conversions automatically. An overview\n   is provided in the table \":ref:`conversion_table`\".\n\nThe following subsections discuss the differences between these options in more\ndetail. The main focus in this section is on type conversions, which represent\nthe last case of the above list.\n\n.. toctree::\n   :maxdepth: 1\n\n   overview\n   strings\n   stl\n   functional\n   chrono\n   eigen\n   custom\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/cast/overview.rst",
    "content": "Overview\n########\n\n.. rubric:: 1. Native type in C++, wrapper in Python\n\nExposing a custom C++ type using :class:`py::class_` was covered in detail\nin the :doc:`/classes` section. There, the underlying data structure is\nalways the original C++ class while the :class:`py::class_` wrapper provides\na Python interface. Internally, when an object like this is sent from C++ to\nPython, pybind11 will just add the outer wrapper layer over the native C++\nobject. Getting it back from Python is just a matter of peeling off the\nwrapper.\n\n.. rubric:: 2. Wrapper in C++, native type in Python\n\nThis is the exact opposite situation. Now, we have a type which is native to\nPython, like a ``tuple`` or a ``list``. One way to get this data into C++ is\nwith the :class:`py::object` family of wrappers. These are explained in more\ndetail in the :doc:`/advanced/pycpp/object` section. We'll just give a quick\nexample here:\n\n.. code-block:: cpp\n\n    void print_list(py::list my_list) {\n        for (auto item : my_list)\n            std::cout << item << \" \";\n    }\n\n.. code-block:: pycon\n\n    >>> print_list([1, 2, 3])\n    1 2 3\n\nThe Python ``list`` is not converted in any way -- it's just wrapped in a C++\n:class:`py::list` class. At its core it's still a Python object. Copying a\n:class:`py::list` will do the usual reference-counting like in Python.\nReturning the object to Python will just remove the thin wrapper.\n\n.. rubric:: 3. Converting between native C++ and Python types\n\nIn the previous two cases we had a native type in one language and a wrapper in\nthe other. Now, we have native types on both sides and we convert between them.\n\n.. code-block:: cpp\n\n    void print_vector(const std::vector<int> &v) {\n        for (auto item : v)\n            std::cout << item << \"\\n\";\n    }\n\n.. code-block:: pycon\n\n    >>> print_vector([1, 2, 3])\n    1 2 3\n\nIn this case, pybind11 will construct a new ``std::vector<int>`` and copy each\nelement from the Python ``list``. The newly constructed object will be passed\nto ``print_vector``. The same thing happens in the other direction: a new\n``list`` is made to match the value returned from C++.\n\nLots of these conversions are supported out of the box, as shown in the table\nbelow. They are very convenient, but keep in mind that these conversions are\nfundamentally based on copying data. This is perfectly fine for small immutable\ntypes but it may become quite expensive for large data structures. This can be\navoided by overriding the automatic conversion with a custom wrapper (i.e. the\nabove-mentioned approach 1). This requires some manual effort and more details\nare available in the :ref:`opaque` section.\n\n.. _conversion_table:\n\nList of all builtin conversions\n-------------------------------\n\nThe following basic data types are supported out of the box (some may require\nan additional extension header to be included). To pass other data structures\nas arguments and return values, refer to the section on binding :ref:`classes`.\n\n+------------------------------------+---------------------------+-----------------------------------+\n|  Data type                         |  Description              | Header file                       |\n+====================================+===========================+===================================+\n| ``int8_t``, ``uint8_t``            | 8-bit integers            | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``int16_t``, ``uint16_t``          | 16-bit integers           | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``int32_t``, ``uint32_t``          | 32-bit integers           | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``int64_t``, ``uint64_t``          | 64-bit integers           | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``ssize_t``, ``size_t``            | Platform-dependent size   | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``float``, ``double``              | Floating point types      | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``bool``                           | Two-state Boolean type    | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``char``                           | Character literal         | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``char16_t``                       | UTF-16 character literal  | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``char32_t``                       | UTF-32 character literal  | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``wchar_t``                        | Wide character literal    | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``const char *``                   | UTF-8 string literal      | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``const char16_t *``               | UTF-16 string literal     | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``const char32_t *``               | UTF-32 string literal     | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``const wchar_t *``                | Wide string literal       | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::string``                    | STL dynamic UTF-8 string  | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::u16string``                 | STL dynamic UTF-16 string | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::u32string``                 | STL dynamic UTF-32 string | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::wstring``                   | STL dynamic wide string   | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::string_view``,              | STL C++17 string views    | :file:`pybind11/pybind11.h`       |\n| ``std::u16string_view``, etc.      |                           |                                   |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::pair<T1, T2>``              | Pair of two custom types  | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::tuple<...>``                | Arbitrary tuple of types  | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::reference_wrapper<...>``    | Reference type wrapper    | :file:`pybind11/pybind11.h`       |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::complex<T>``                | Complex numbers           | :file:`pybind11/complex.h`        |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::array<T, Size>``            | STL static array          | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::vector<T>``                 | STL dynamic array         | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::deque<T>``                  | STL double-ended queue    | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::valarray<T>``               | STL value array           | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::list<T>``                   | STL linked list           | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::map<T1, T2>``               | STL ordered map           | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::unordered_map<T1, T2>``     | STL unordered map         | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::set<T>``                    | STL ordered set           | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::unordered_set<T>``          | STL unordered set         | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::optional<T>``               | STL optional type (C++17) | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::experimental::optional<T>`` | STL optional type (exp.)  | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::variant<...>``              | Type-safe union (C++17)   | :file:`pybind11/stl.h`            |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::filesystem::path<T>``       | STL path (C++17) [#]_     | :file:`pybind11/stl/filesystem.h` |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::function<...>``             | STL polymorphic function  | :file:`pybind11/functional.h`     |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::chrono::duration<...>``     | STL time duration         | :file:`pybind11/chrono.h`         |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``std::chrono::time_point<...>``   | STL date/time             | :file:`pybind11/chrono.h`         |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``Eigen::Matrix<...>``             | Eigen: dense matrix       | :file:`pybind11/eigen.h`          |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``Eigen::Map<...>``                | Eigen: mapped memory      | :file:`pybind11/eigen.h`          |\n+------------------------------------+---------------------------+-----------------------------------+\n| ``Eigen::SparseMatrix<...>``       | Eigen: sparse matrix      | :file:`pybind11/eigen.h`          |\n+------------------------------------+---------------------------+-----------------------------------+\n\n.. [#] ``std::filesystem::path`` is converted to ``pathlib.Path`` and\n   ``os.PathLike`` is converted to ``std::filesystem::path``.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/cast/stl.rst",
    "content": "STL containers\n##############\n\nAutomatic conversion\n====================\n\nWhen including the additional header file :file:`pybind11/stl.h`, conversions\nbetween ``std::vector<>``/``std::deque<>``/``std::list<>``/``std::array<>``/``std::valarray<>``,\n``std::set<>``/``std::unordered_set<>``, and\n``std::map<>``/``std::unordered_map<>`` and the Python ``list``, ``set`` and\n``dict`` data structures are automatically enabled. The types ``std::pair<>``\nand ``std::tuple<>`` are already supported out of the box with just the core\n:file:`pybind11/pybind11.h` header.\n\nThe major downside of these implicit conversions is that containers must be\nconverted (i.e. copied) on every Python->C++ and C++->Python transition, which\ncan have implications on the program semantics and performance. Please read the\nnext sections for more details and alternative approaches that avoid this.\n\n.. note::\n\n    Arbitrary nesting of any of these types is possible.\n\n.. seealso::\n\n    The file :file:`tests/test_stl.cpp` contains a complete\n    example that demonstrates how to pass STL data types in more detail.\n\n.. _cpp17_container_casters:\n\nC++17 library containers\n========================\n\nThe :file:`pybind11/stl.h` header also includes support for ``std::optional<>``\nand ``std::variant<>``. These require a C++17 compiler and standard library.\nIn C++14 mode, ``std::experimental::optional<>`` is supported if available.\n\nVarious versions of these containers also exist for C++11 (e.g. in Boost).\npybind11 provides an easy way to specialize the ``type_caster`` for such\ntypes:\n\n.. code-block:: cpp\n\n    // `boost::optional` as an example -- can be any `std::optional`-like container\n    namespace PYBIND11_NAMESPACE { namespace detail {\n        template <typename T>\n        struct type_caster<boost::optional<T>> : optional_caster<boost::optional<T>> {};\n    }}\n\nThe above should be placed in a header file and included in all translation units\nwhere automatic conversion is needed. Similarly, a specialization can be provided\nfor custom variant types:\n\n.. code-block:: cpp\n\n    // `boost::variant` as an example -- can be any `std::variant`-like container\n    namespace PYBIND11_NAMESPACE { namespace detail {\n        template <typename... Ts>\n        struct type_caster<boost::variant<Ts...>> : variant_caster<boost::variant<Ts...>> {};\n\n        // Specifies the function used to visit the variant -- `apply_visitor` instead of `visit`\n        template <>\n        struct visit_helper<boost::variant> {\n            template <typename... Args>\n            static auto call(Args &&...args) -> decltype(boost::apply_visitor(args...)) {\n                return boost::apply_visitor(args...);\n            }\n        };\n    }} // namespace PYBIND11_NAMESPACE::detail\n\nThe ``visit_helper`` specialization is not required if your ``name::variant`` provides\na ``name::visit()`` function. For any other function name, the specialization must be\nincluded to tell pybind11 how to visit the variant.\n\n.. warning::\n\n    When converting a ``variant`` type, pybind11 follows the same rules as when\n    determining which function overload to call (:ref:`overload_resolution`), and\n    so the same caveats hold. In particular, the order in which the ``variant``'s\n    alternatives are listed is important, since pybind11 will try conversions in\n    this order. This means that, for example, when converting ``variant<int, bool>``,\n    the ``bool`` variant will never be selected, as any Python ``bool`` is already\n    an ``int`` and is convertible to a C++ ``int``. Changing the order of alternatives\n    (and using ``variant<bool, int>``, in this example) provides a solution.\n\n.. note::\n\n    pybind11 only supports the modern implementation of ``boost::variant``\n    which makes use of variadic templates. This requires Boost 1.56 or newer.\n\n.. _opaque:\n\nMaking opaque types\n===================\n\npybind11 heavily relies on a template matching mechanism to convert parameters\nand return values that are constructed from STL data types such as vectors,\nlinked lists, hash tables, etc. This even works in a recursive manner, for\ninstance to deal with lists of hash maps of pairs of elementary and custom\ntypes, etc.\n\nHowever, a fundamental limitation of this approach is that internal conversions\nbetween Python and C++ types involve a copy operation that prevents\npass-by-reference semantics. What does this mean?\n\nSuppose we bind the following function\n\n.. code-block:: cpp\n\n    void append_1(std::vector<int> &v) {\n       v.push_back(1);\n    }\n\nand call it from Python, the following happens:\n\n.. code-block:: pycon\n\n   >>> v = [5, 6]\n   >>> append_1(v)\n   >>> print(v)\n   [5, 6]\n\nAs you can see, when passing STL data structures by reference, modifications\nare not propagated back the Python side. A similar situation arises when\nexposing STL data structures using the ``def_readwrite`` or ``def_readonly``\nfunctions:\n\n.. code-block:: cpp\n\n    /* ... definition ... */\n\n    class MyClass {\n        std::vector<int> contents;\n    };\n\n    /* ... binding code ... */\n\n    py::class_<MyClass>(m, \"MyClass\")\n        .def(py::init<>())\n        .def_readwrite(\"contents\", &MyClass::contents);\n\nIn this case, properties can be read and written in their entirety. However, an\n``append`` operation involving such a list type has no effect:\n\n.. code-block:: pycon\n\n   >>> m = MyClass()\n   >>> m.contents = [5, 6]\n   >>> print(m.contents)\n   [5, 6]\n   >>> m.contents.append(7)\n   >>> print(m.contents)\n   [5, 6]\n\nFinally, the involved copy operations can be costly when dealing with very\nlarge lists. To deal with all of the above situations, pybind11 provides a\nmacro named ``PYBIND11_MAKE_OPAQUE(T)`` that disables the template-based\nconversion machinery of types, thus rendering them *opaque*. The contents of\nopaque objects are never inspected or extracted, hence they *can* be passed by\nreference. For instance, to turn ``std::vector<int>`` into an opaque type, add\nthe declaration\n\n.. code-block:: cpp\n\n    PYBIND11_MAKE_OPAQUE(std::vector<int>);\n\nbefore any binding code (e.g. invocations to ``class_::def()``, etc.). This\nmacro must be specified at the top level (and outside of any namespaces), since\nit adds a template instantiation of ``type_caster``. If your binding code consists of\nmultiple compilation units, it must be present in every file (typically via a\ncommon header) preceding any usage of ``std::vector<int>``. Opaque types must\nalso have a corresponding ``class_`` declaration to associate them with a name\nin Python, and to define a set of available operations, e.g.:\n\n.. code-block:: cpp\n\n    py::class_<std::vector<int>>(m, \"IntVector\")\n        .def(py::init<>())\n        .def(\"clear\", &std::vector<int>::clear)\n        .def(\"pop_back\", &std::vector<int>::pop_back)\n        .def(\"__len__\", [](const std::vector<int> &v) { return v.size(); })\n        .def(\"__iter__\", [](std::vector<int> &v) {\n           return py::make_iterator(v.begin(), v.end());\n        }, py::keep_alive<0, 1>()) /* Keep vector alive while iterator is used */\n        // ....\n\n.. seealso::\n\n    The file :file:`tests/test_opaque_types.cpp` contains a complete\n    example that demonstrates how to create and expose opaque types using\n    pybind11 in more detail.\n\n.. _stl_bind:\n\nBinding STL containers\n======================\n\nThe ability to expose STL containers as native Python objects is a fairly\ncommon request, hence pybind11 also provides an optional header file named\n:file:`pybind11/stl_bind.h` that does exactly this. The mapped containers try\nto match the behavior of their native Python counterparts as much as possible.\n\nThe following example showcases usage of :file:`pybind11/stl_bind.h`:\n\n.. code-block:: cpp\n\n    // Don't forget this\n    #include <pybind11/stl_bind.h>\n\n    PYBIND11_MAKE_OPAQUE(std::vector<int>);\n    PYBIND11_MAKE_OPAQUE(std::map<std::string, double>);\n\n    // ...\n\n    // later in binding code:\n    py::bind_vector<std::vector<int>>(m, \"VectorInt\");\n    py::bind_map<std::map<std::string, double>>(m, \"MapStringDouble\");\n\nWhen binding STL containers pybind11 considers the types of the container's\nelements to decide whether the container should be confined to the local module\n(via the :ref:`module_local` feature).  If the container element types are\nanything other than already-bound custom types bound without\n``py::module_local()`` the container binding will have ``py::module_local()``\napplied.  This includes converting types such as numeric types, strings, Eigen\ntypes; and types that have not yet been bound at the time of the stl container\nbinding.  This module-local binding is designed to avoid potential conflicts\nbetween module bindings (for example, from two separate modules each attempting\nto bind ``std::vector<int>`` as a python type).\n\nIt is possible to override this behavior to force a definition to be either\nmodule-local or global.  To do so, you can pass the attributes\n``py::module_local()`` (to make the binding module-local) or\n``py::module_local(false)`` (to make the binding global) into the\n``py::bind_vector`` or ``py::bind_map`` arguments:\n\n.. code-block:: cpp\n\n    py::bind_vector<std::vector<int>>(m, \"VectorInt\", py::module_local(false));\n\nNote, however, that such a global binding would make it impossible to load this\nmodule at the same time as any other pybind module that also attempts to bind\nthe same container type (``std::vector<int>`` in the above example).\n\nSee :ref:`module_local` for more details on module-local bindings.\n\n.. seealso::\n\n    The file :file:`tests/test_stl_binders.cpp` shows how to use the\n    convenience STL container wrappers.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/cast/strings.rst",
    "content": "Strings, bytes and Unicode conversions\n######################################\n\nPassing Python strings to C++\n=============================\n\nWhen a Python ``str`` is passed from Python to a C++ function that accepts\n``std::string`` or ``char *`` as arguments, pybind11 will encode the Python\nstring to UTF-8. All Python ``str`` can be encoded in UTF-8, so this operation\ndoes not fail.\n\nThe C++ language is encoding agnostic. It is the responsibility of the\nprogrammer to track encodings. It's often easiest to simply `use UTF-8\neverywhere <http://utf8everywhere.org/>`_.\n\n.. code-block:: c++\n\n    m.def(\"utf8_test\",\n        [](const std::string &s) {\n            cout << \"utf-8 is icing on the cake.\\n\";\n            cout << s;\n        }\n    );\n    m.def(\"utf8_charptr\",\n        [](const char *s) {\n            cout << \"My favorite food is\\n\";\n            cout << s;\n        }\n    );\n\n.. code-block:: pycon\n\n    >>> utf8_test(\"🎂\")\n    utf-8 is icing on the cake.\n    🎂\n\n    >>> utf8_charptr(\"🍕\")\n    My favorite food is\n    🍕\n\n.. note::\n\n    Some terminal emulators do not support UTF-8 or emoji fonts and may not\n    display the example above correctly.\n\nThe results are the same whether the C++ function accepts arguments by value or\nreference, and whether or not ``const`` is used.\n\nPassing bytes to C++\n--------------------\n\nA Python ``bytes`` object will be passed to C++ functions that accept\n``std::string`` or ``char*`` *without* conversion.  In order to make a function\n*only* accept ``bytes`` (and not ``str``), declare it as taking a ``py::bytes``\nargument.\n\n\nReturning C++ strings to Python\n===============================\n\nWhen a C++ function returns a ``std::string`` or ``char*`` to a Python caller,\n**pybind11 will assume that the string is valid UTF-8** and will decode it to a\nnative Python ``str``, using the same API as Python uses to perform\n``bytes.decode('utf-8')``. If this implicit conversion fails, pybind11 will\nraise a ``UnicodeDecodeError``.\n\n.. code-block:: c++\n\n    m.def(\"std_string_return\",\n        []() {\n            return std::string(\"This string needs to be UTF-8 encoded\");\n        }\n    );\n\n.. code-block:: pycon\n\n    >>> isinstance(example.std_string_return(), str)\n    True\n\n\nBecause UTF-8 is inclusive of pure ASCII, there is never any issue with\nreturning a pure ASCII string to Python. If there is any possibility that the\nstring is not pure ASCII, it is necessary to ensure the encoding is valid\nUTF-8.\n\n.. warning::\n\n    Implicit conversion assumes that a returned ``char *`` is null-terminated.\n    If there is no null terminator a buffer overrun will occur.\n\nExplicit conversions\n--------------------\n\nIf some C++ code constructs a ``std::string`` that is not a UTF-8 string, one\ncan perform a explicit conversion and return a ``py::str`` object. Explicit\nconversion has the same overhead as implicit conversion.\n\n.. code-block:: c++\n\n    // This uses the Python C API to convert Latin-1 to Unicode\n    m.def(\"str_output\",\n        []() {\n            std::string s = \"Send your r\\xe9sum\\xe9 to Alice in HR\"; // Latin-1\n            py::str py_s = PyUnicode_DecodeLatin1(s.data(), s.length());\n            return py_s;\n        }\n    );\n\n.. code-block:: pycon\n\n    >>> str_output()\n    'Send your résumé to Alice in HR'\n\nThe `Python C API\n<https://docs.python.org/3/c-api/unicode.html#built-in-codecs>`_ provides\nseveral built-in codecs.\n\n\nOne could also use a third party encoding library such as libiconv to transcode\nto UTF-8.\n\nReturn C++ strings without conversion\n-------------------------------------\n\nIf the data in a C++ ``std::string`` does not represent text and should be\nreturned to Python as ``bytes``, then one can return the data as a\n``py::bytes`` object.\n\n.. code-block:: c++\n\n    m.def(\"return_bytes\",\n        []() {\n            std::string s(\"\\xba\\xd0\\xba\\xd0\");  // Not valid UTF-8\n            return py::bytes(s);  // Return the data without transcoding\n        }\n    );\n\n.. code-block:: pycon\n\n    >>> example.return_bytes()\n    b'\\xba\\xd0\\xba\\xd0'\n\n\nNote the asymmetry: pybind11 will convert ``bytes`` to ``std::string`` without\nencoding, but cannot convert ``std::string`` back to ``bytes`` implicitly.\n\n.. code-block:: c++\n\n    m.def(\"asymmetry\",\n        [](std::string s) {  // Accepts str or bytes from Python\n            return s;  // Looks harmless, but implicitly converts to str\n        }\n    );\n\n.. code-block:: pycon\n\n    >>> isinstance(example.asymmetry(b\"have some bytes\"), str)\n    True\n\n    >>> example.asymmetry(b\"\\xba\\xd0\\xba\\xd0\")  # invalid utf-8 as bytes\n    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 0: invalid start byte\n\n\nWide character strings\n======================\n\nWhen a Python ``str`` is passed to a C++ function expecting ``std::wstring``,\n``wchar_t*``, ``std::u16string`` or ``std::u32string``, the ``str`` will be\nencoded to UTF-16 or UTF-32 depending on how the C++ compiler implements each\ntype, in the platform's native endianness. When strings of these types are\nreturned, they are assumed to contain valid UTF-16 or UTF-32, and will be\ndecoded to Python ``str``.\n\n.. code-block:: c++\n\n    #define UNICODE\n    #include <windows.h>\n\n    m.def(\"set_window_text\",\n        [](HWND hwnd, std::wstring s) {\n            // Call SetWindowText with null-terminated UTF-16 string\n            ::SetWindowText(hwnd, s.c_str());\n        }\n    );\n    m.def(\"get_window_text\",\n        [](HWND hwnd) {\n            const int buffer_size = ::GetWindowTextLength(hwnd) + 1;\n            auto buffer = std::make_unique< wchar_t[] >(buffer_size);\n\n            ::GetWindowText(hwnd, buffer.data(), buffer_size);\n\n            std::wstring text(buffer.get());\n\n            // wstring will be converted to Python str\n            return text;\n        }\n    );\n\nStrings in multibyte encodings such as Shift-JIS must transcoded to a\nUTF-8/16/32 before being returned to Python.\n\n\nCharacter literals\n==================\n\nC++ functions that accept character literals as input will receive the first\ncharacter of a Python ``str`` as their input. If the string is longer than one\nUnicode character, trailing characters will be ignored.\n\nWhen a character literal is returned from C++ (such as a ``char`` or a\n``wchar_t``), it will be converted to a ``str`` that represents the single\ncharacter.\n\n.. code-block:: c++\n\n    m.def(\"pass_char\", [](char c) { return c; });\n    m.def(\"pass_wchar\", [](wchar_t w) { return w; });\n\n.. code-block:: pycon\n\n    >>> example.pass_char(\"A\")\n    'A'\n\nWhile C++ will cast integers to character types (``char c = 0x65;``), pybind11\ndoes not convert Python integers to characters implicitly. The Python function\n``chr()`` can be used to convert integers to characters.\n\n.. code-block:: pycon\n\n    >>> example.pass_char(0x65)\n    TypeError\n\n    >>> example.pass_char(chr(0x65))\n    'A'\n\nIf the desire is to work with an 8-bit integer, use ``int8_t`` or ``uint8_t``\nas the argument type.\n\nGrapheme clusters\n-----------------\n\nA single grapheme may be represented by two or more Unicode characters. For\nexample 'é' is usually represented as U+00E9 but can also be expressed as the\ncombining character sequence U+0065 U+0301 (that is, the letter 'e' followed by\na combining acute accent). The combining character will be lost if the\ntwo-character sequence is passed as an argument, even though it renders as a\nsingle grapheme.\n\n.. code-block:: pycon\n\n    >>> example.pass_wchar(\"é\")\n    'é'\n\n    >>> combining_e_acute = \"e\" + \"\\u0301\"\n\n    >>> combining_e_acute\n    'é'\n\n    >>> combining_e_acute == \"é\"\n    False\n\n    >>> example.pass_wchar(combining_e_acute)\n    'e'\n\nNormalizing combining characters before passing the character literal to C++\nmay resolve *some* of these issues:\n\n.. code-block:: pycon\n\n    >>> example.pass_wchar(unicodedata.normalize(\"NFC\", combining_e_acute))\n    'é'\n\nIn some languages (Thai for example), there are `graphemes that cannot be\nexpressed as a single Unicode code point\n<http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries>`_, so there is\nno way to capture them in a C++ character type.\n\n\nC++17 string views\n==================\n\nC++17 string views are automatically supported when compiling in C++17 mode.\nThey follow the same rules for encoding and decoding as the corresponding STL\nstring type (for example, a ``std::u16string_view`` argument will be passed\nUTF-16-encoded data, and a returned ``std::string_view`` will be decoded as\nUTF-8).\n\nReferences\n==========\n\n* `The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) <https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/>`_\n* `C++ - Using STL Strings at Win32 API Boundaries <https://msdn.microsoft.com/en-ca/magazine/mt238407.aspx>`_\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/classes.rst",
    "content": "Classes\n#######\n\nThis section presents advanced binding code for classes and it is assumed\nthat you are already familiar with the basics from :doc:`/classes`.\n\n.. _overriding_virtuals:\n\nOverriding virtual functions in Python\n======================================\n\nSuppose that a C++ class or interface has a virtual function that we'd like\nto override from within Python (we'll focus on the class ``Animal``; ``Dog`` is\ngiven as a specific example of how one would do this with traditional C++\ncode).\n\n.. code-block:: cpp\n\n    class Animal {\n    public:\n        virtual ~Animal() { }\n        virtual std::string go(int n_times) = 0;\n    };\n\n    class Dog : public Animal {\n    public:\n        std::string go(int n_times) override {\n            std::string result;\n            for (int i=0; i<n_times; ++i)\n                result += \"woof! \";\n            return result;\n        }\n    };\n\nLet's also suppose that we are given a plain function which calls the\nfunction ``go()`` on an arbitrary ``Animal`` instance.\n\n.. code-block:: cpp\n\n    std::string call_go(Animal *animal) {\n        return animal->go(3);\n    }\n\nNormally, the binding code for these classes would look as follows:\n\n.. code-block:: cpp\n\n    PYBIND11_MODULE(example, m) {\n        py::class_<Animal>(m, \"Animal\")\n            .def(\"go\", &Animal::go);\n\n        py::class_<Dog, Animal>(m, \"Dog\")\n            .def(py::init<>());\n\n        m.def(\"call_go\", &call_go);\n    }\n\nHowever, these bindings are impossible to extend: ``Animal`` is not\nconstructible, and we clearly require some kind of \"trampoline\" that\nredirects virtual calls back to Python.\n\nDefining a new type of ``Animal`` from within Python is possible but requires a\nhelper class that is defined as follows:\n\n.. code-block:: cpp\n\n    class PyAnimal : public Animal {\n    public:\n        /* Inherit the constructors */\n        using Animal::Animal;\n\n        /* Trampoline (need one for each virtual function) */\n        std::string go(int n_times) override {\n            PYBIND11_OVERRIDE_PURE(\n                std::string, /* Return type */\n                Animal,      /* Parent class */\n                go,          /* Name of function in C++ (must match Python name) */\n                n_times      /* Argument(s) */\n            );\n        }\n    };\n\nThe macro :c:macro:`PYBIND11_OVERRIDE_PURE` should be used for pure virtual\nfunctions, and :c:macro:`PYBIND11_OVERRIDE` should be used for functions which have\na default implementation.  There are also two alternate macros\n:c:macro:`PYBIND11_OVERRIDE_PURE_NAME` and :c:macro:`PYBIND11_OVERRIDE_NAME` which\ntake a string-valued name argument between the *Parent class* and *Name of the\nfunction* slots, which defines the name of function in Python. This is required\nwhen the C++ and Python versions of the\nfunction have different names, e.g.  ``operator()`` vs ``__call__``.\n\nThe binding code also needs a few minor adaptations (highlighted):\n\n.. code-block:: cpp\n    :emphasize-lines: 2,3\n\n    PYBIND11_MODULE(example, m) {\n        py::class_<Animal, PyAnimal /* <--- trampoline*/>(m, \"Animal\")\n            .def(py::init<>())\n            .def(\"go\", &Animal::go);\n\n        py::class_<Dog, Animal>(m, \"Dog\")\n            .def(py::init<>());\n\n        m.def(\"call_go\", &call_go);\n    }\n\nImportantly, pybind11 is made aware of the trampoline helper class by\nspecifying it as an extra template argument to :class:`class_`. (This can also\nbe combined with other template arguments such as a custom holder type; the\norder of template types does not matter).  Following this, we are able to\ndefine a constructor as usual.\n\nBindings should be made against the actual class, not the trampoline helper class.\n\n.. code-block:: cpp\n    :emphasize-lines: 3\n\n    py::class_<Animal, PyAnimal /* <--- trampoline*/>(m, \"Animal\");\n        .def(py::init<>())\n        .def(\"go\", &PyAnimal::go); /* <--- THIS IS WRONG, use &Animal::go */\n\nNote, however, that the above is sufficient for allowing python classes to\nextend ``Animal``, but not ``Dog``: see :ref:`virtual_and_inheritance` for the\nnecessary steps required to providing proper overriding support for inherited\nclasses.\n\nThe Python session below shows how to override ``Animal::go`` and invoke it via\na virtual method call.\n\n.. code-block:: pycon\n\n    >>> from example import *\n    >>> d = Dog()\n    >>> call_go(d)\n    'woof! woof! woof! '\n    >>> class Cat(Animal):\n    ...     def go(self, n_times):\n    ...         return \"meow! \" * n_times\n    ...\n    >>> c = Cat()\n    >>> call_go(c)\n    'meow! meow! meow! '\n\nIf you are defining a custom constructor in a derived Python class, you *must*\nensure that you explicitly call the bound C++ constructor using ``__init__``,\n*regardless* of whether it is a default constructor or not. Otherwise, the\nmemory for the C++ portion of the instance will be left uninitialized, which\nwill generally leave the C++ instance in an invalid state and cause undefined\nbehavior if the C++ instance is subsequently used.\n\n.. versionchanged:: 2.6\n   The default pybind11 metaclass will throw a ``TypeError`` when it detects\n   that ``__init__`` was not called by a derived class.\n\nHere is an example:\n\n.. code-block:: python\n\n    class Dachshund(Dog):\n        def __init__(self, name):\n            Dog.__init__(self)  # Without this, a TypeError is raised.\n            self.name = name\n\n        def bark(self):\n            return \"yap!\"\n\nNote that a direct ``__init__`` constructor *should be called*, and ``super()``\nshould not be used. For simple cases of linear inheritance, ``super()``\nmay work, but once you begin mixing Python and C++ multiple inheritance,\nthings will fall apart due to differences between Python's MRO and C++'s\nmechanisms.\n\nPlease take a look at the :ref:`macro_notes` before using this feature.\n\n.. note::\n\n    When the overridden type returns a reference or pointer to a type that\n    pybind11 converts from Python (for example, numeric values, std::string,\n    and other built-in value-converting types), there are some limitations to\n    be aware of:\n\n    - because in these cases there is no C++ variable to reference (the value\n      is stored in the referenced Python variable), pybind11 provides one in\n      the PYBIND11_OVERRIDE macros (when needed) with static storage duration.\n      Note that this means that invoking the overridden method on *any*\n      instance will change the referenced value stored in *all* instances of\n      that type.\n\n    - Attempts to modify a non-const reference will not have the desired\n      effect: it will change only the static cache variable, but this change\n      will not propagate to underlying Python instance, and the change will be\n      replaced the next time the override is invoked.\n\n.. warning::\n\n    The :c:macro:`PYBIND11_OVERRIDE` and accompanying macros used to be called\n    ``PYBIND11_OVERLOAD`` up until pybind11 v2.5.0, and :func:`get_override`\n    used to be called ``get_overload``. This naming was corrected and the older\n    macro and function names may soon be deprecated, in order to reduce\n    confusion with overloaded functions and methods and ``py::overload_cast``\n    (see :ref:`classes`).\n\n.. seealso::\n\n    The file :file:`tests/test_virtual_functions.cpp` contains a complete\n    example that demonstrates how to override virtual functions using pybind11\n    in more detail.\n\n.. _virtual_and_inheritance:\n\nCombining virtual functions and inheritance\n===========================================\n\nWhen combining virtual methods with inheritance, you need to be sure to provide\nan override for each method for which you want to allow overrides from derived\npython classes.  For example, suppose we extend the above ``Animal``/``Dog``\nexample as follows:\n\n.. code-block:: cpp\n\n    class Animal {\n    public:\n        virtual std::string go(int n_times) = 0;\n        virtual std::string name() { return \"unknown\"; }\n    };\n    class Dog : public Animal {\n    public:\n        std::string go(int n_times) override {\n            std::string result;\n            for (int i=0; i<n_times; ++i)\n                result += bark() + \" \";\n            return result;\n        }\n        virtual std::string bark() { return \"woof!\"; }\n    };\n\nthen the trampoline class for ``Animal`` must, as described in the previous\nsection, override ``go()`` and ``name()``, but in order to allow python code to\ninherit properly from ``Dog``, we also need a trampoline class for ``Dog`` that\noverrides both the added ``bark()`` method *and* the ``go()`` and ``name()``\nmethods inherited from ``Animal`` (even though ``Dog`` doesn't directly\noverride the ``name()`` method):\n\n.. code-block:: cpp\n\n    class PyAnimal : public Animal {\n    public:\n        using Animal::Animal; // Inherit constructors\n        std::string go(int n_times) override { PYBIND11_OVERRIDE_PURE(std::string, Animal, go, n_times); }\n        std::string name() override { PYBIND11_OVERRIDE(std::string, Animal, name, ); }\n    };\n    class PyDog : public Dog {\n    public:\n        using Dog::Dog; // Inherit constructors\n        std::string go(int n_times) override { PYBIND11_OVERRIDE(std::string, Dog, go, n_times); }\n        std::string name() override { PYBIND11_OVERRIDE(std::string, Dog, name, ); }\n        std::string bark() override { PYBIND11_OVERRIDE(std::string, Dog, bark, ); }\n    };\n\n.. note::\n\n    Note the trailing commas in the ``PYBIND11_OVERRIDE`` calls to ``name()``\n    and ``bark()``. These are needed to portably implement a trampoline for a\n    function that does not take any arguments. For functions that take\n    a nonzero number of arguments, the trailing comma must be omitted.\n\nA registered class derived from a pybind11-registered class with virtual\nmethods requires a similar trampoline class, *even if* it doesn't explicitly\ndeclare or override any virtual methods itself:\n\n.. code-block:: cpp\n\n    class Husky : public Dog {};\n    class PyHusky : public Husky {\n    public:\n        using Husky::Husky; // Inherit constructors\n        std::string go(int n_times) override { PYBIND11_OVERRIDE_PURE(std::string, Husky, go, n_times); }\n        std::string name() override { PYBIND11_OVERRIDE(std::string, Husky, name, ); }\n        std::string bark() override { PYBIND11_OVERRIDE(std::string, Husky, bark, ); }\n    };\n\nThere is, however, a technique that can be used to avoid this duplication\n(which can be especially helpful for a base class with several virtual\nmethods).  The technique involves using template trampoline classes, as\nfollows:\n\n.. code-block:: cpp\n\n    template <class AnimalBase = Animal> class PyAnimal : public AnimalBase {\n    public:\n        using AnimalBase::AnimalBase; // Inherit constructors\n        std::string go(int n_times) override { PYBIND11_OVERRIDE_PURE(std::string, AnimalBase, go, n_times); }\n        std::string name() override { PYBIND11_OVERRIDE(std::string, AnimalBase, name, ); }\n    };\n    template <class DogBase = Dog> class PyDog : public PyAnimal<DogBase> {\n    public:\n        using PyAnimal<DogBase>::PyAnimal; // Inherit constructors\n        // Override PyAnimal's pure virtual go() with a non-pure one:\n        std::string go(int n_times) override { PYBIND11_OVERRIDE(std::string, DogBase, go, n_times); }\n        std::string bark() override { PYBIND11_OVERRIDE(std::string, DogBase, bark, ); }\n    };\n\nThis technique has the advantage of requiring just one trampoline method to be\ndeclared per virtual method and pure virtual method override.  It does,\nhowever, require the compiler to generate at least as many methods (and\npossibly more, if both pure virtual and overridden pure virtual methods are\nexposed, as above).\n\nThe classes are then registered with pybind11 using:\n\n.. code-block:: cpp\n\n    py::class_<Animal, PyAnimal<>> animal(m, \"Animal\");\n    py::class_<Dog, Animal, PyDog<>> dog(m, \"Dog\");\n    py::class_<Husky, Dog, PyDog<Husky>> husky(m, \"Husky\");\n    // ... add animal, dog, husky definitions\n\nNote that ``Husky`` did not require a dedicated trampoline template class at\nall, since it neither declares any new virtual methods nor provides any pure\nvirtual method implementations.\n\nWith either the repeated-virtuals or templated trampoline methods in place, you\ncan now create a python class that inherits from ``Dog``:\n\n.. code-block:: python\n\n    class ShihTzu(Dog):\n        def bark(self):\n            return \"yip!\"\n\n.. seealso::\n\n    See the file :file:`tests/test_virtual_functions.cpp` for complete examples\n    using both the duplication and templated trampoline approaches.\n\n.. _extended_aliases:\n\nExtended trampoline class functionality\n=======================================\n\n.. _extended_class_functionality_forced_trampoline:\n\nForced trampoline class initialisation\n--------------------------------------\nThe trampoline classes described in the previous sections are, by default, only\ninitialized when needed.  More specifically, they are initialized when a python\nclass actually inherits from a registered type (instead of merely creating an\ninstance of the registered type), or when a registered constructor is only\nvalid for the trampoline class but not the registered class.  This is primarily\nfor performance reasons: when the trampoline class is not needed for anything\nexcept virtual method dispatching, not initializing the trampoline class\nimproves performance by avoiding needing to do a run-time check to see if the\ninheriting python instance has an overridden method.\n\nSometimes, however, it is useful to always initialize a trampoline class as an\nintermediate class that does more than just handle virtual method dispatching.\nFor example, such a class might perform extra class initialization, extra\ndestruction operations, and might define new members and methods to enable a\nmore python-like interface to a class.\n\nIn order to tell pybind11 that it should *always* initialize the trampoline\nclass when creating new instances of a type, the class constructors should be\ndeclared using ``py::init_alias<Args, ...>()`` instead of the usual\n``py::init<Args, ...>()``.  This forces construction via the trampoline class,\nensuring member initialization and (eventual) destruction.\n\n.. seealso::\n\n    See the file :file:`tests/test_virtual_functions.cpp` for complete examples\n    showing both normal and forced trampoline instantiation.\n\nDifferent method signatures\n---------------------------\nThe macro's introduced in :ref:`overriding_virtuals` cover most of the standard\nuse cases when exposing C++ classes to Python. Sometimes it is hard or unwieldy\nto create a direct one-on-one mapping between the arguments and method return\ntype.\n\nAn example would be when the C++ signature contains output arguments using\nreferences (See also :ref:`faq_reference_arguments`). Another way of solving\nthis is to use the method body of the trampoline class to do conversions to the\ninput and return of the Python method.\n\nThe main building block to do so is the :func:`get_override`, this function\nallows retrieving a method implemented in Python from within the trampoline's\nmethods. Consider for example a C++ method which has the signature\n``bool myMethod(int32_t& value)``, where the return indicates whether\nsomething should be done with the ``value``. This can be made convenient on the\nPython side by allowing the Python function to return ``None`` or an ``int``:\n\n.. code-block:: cpp\n\n    bool MyClass::myMethod(int32_t& value)\n    {\n        pybind11::gil_scoped_acquire gil;  // Acquire the GIL while in this scope.\n        // Try to look up the overridden method on the Python side.\n        pybind11::function override = pybind11::get_override(this, \"myMethod\");\n        if (override) {  // method is found\n            auto obj = override(value);  // Call the Python function.\n            if (py::isinstance<py::int_>(obj)) {  // check if it returned a Python integer type\n                value = obj.cast<int32_t>();  // Cast it and assign it to the value.\n                return true;  // Return true; value should be used.\n            } else {\n                return false;  // Python returned none, return false.\n            }\n        }\n        return false;  // Alternatively return MyClass::myMethod(value);\n    }\n\n\n.. _custom_constructors:\n\nCustom constructors\n===================\n\nThe syntax for binding constructors was previously introduced, but it only\nworks when a constructor of the appropriate arguments actually exists on the\nC++ side.  To extend this to more general cases, pybind11 makes it possible\nto bind factory functions as constructors. For example, suppose you have a\nclass like this:\n\n.. code-block:: cpp\n\n    class Example {\n    private:\n        Example(int); // private constructor\n    public:\n        // Factory function:\n        static Example create(int a) { return Example(a); }\n    };\n\n    py::class_<Example>(m, \"Example\")\n        .def(py::init(&Example::create));\n\nWhile it is possible to create a straightforward binding of the static\n``create`` method, it may sometimes be preferable to expose it as a constructor\non the Python side. This can be accomplished by calling ``.def(py::init(...))``\nwith the function reference returning the new instance passed as an argument.\nIt is also possible to use this approach to bind a function returning a new\ninstance by raw pointer or by the holder (e.g. ``std::unique_ptr``).\n\nThe following example shows the different approaches:\n\n.. code-block:: cpp\n\n    class Example {\n    private:\n        Example(int); // private constructor\n    public:\n        // Factory function - returned by value:\n        static Example create(int a) { return Example(a); }\n\n        // These constructors are publicly callable:\n        Example(double);\n        Example(int, int);\n        Example(std::string);\n    };\n\n    py::class_<Example>(m, \"Example\")\n        // Bind the factory function as a constructor:\n        .def(py::init(&Example::create))\n        // Bind a lambda function returning a pointer wrapped in a holder:\n        .def(py::init([](std::string arg) {\n            return std::unique_ptr<Example>(new Example(arg));\n        }))\n        // Return a raw pointer:\n        .def(py::init([](int a, int b) { return new Example(a, b); }))\n        // You can mix the above with regular C++ constructor bindings as well:\n        .def(py::init<double>())\n        ;\n\nWhen the constructor is invoked from Python, pybind11 will call the factory\nfunction and store the resulting C++ instance in the Python instance.\n\nWhen combining factory functions constructors with :ref:`virtual function\ntrampolines <overriding_virtuals>` there are two approaches.  The first is to\nadd a constructor to the alias class that takes a base value by\nrvalue-reference.  If such a constructor is available, it will be used to\nconstruct an alias instance from the value returned by the factory function.\nThe second option is to provide two factory functions to ``py::init()``: the\nfirst will be invoked when no alias class is required (i.e. when the class is\nbeing used but not inherited from in Python), and the second will be invoked\nwhen an alias is required.\n\nYou can also specify a single factory function that always returns an alias\ninstance: this will result in behaviour similar to ``py::init_alias<...>()``,\nas described in the :ref:`extended trampoline class documentation\n<extended_aliases>`.\n\nThe following example shows the different factory approaches for a class with\nan alias:\n\n.. code-block:: cpp\n\n    #include <pybind11/factory.h>\n    class Example {\n    public:\n        // ...\n        virtual ~Example() = default;\n    };\n    class PyExample : public Example {\n    public:\n        using Example::Example;\n        PyExample(Example &&base) : Example(std::move(base)) {}\n    };\n    py::class_<Example, PyExample>(m, \"Example\")\n        // Returns an Example pointer.  If a PyExample is needed, the Example\n        // instance will be moved via the extra constructor in PyExample, above.\n        .def(py::init([]() { return new Example(); }))\n        // Two callbacks:\n        .def(py::init([]() { return new Example(); } /* no alias needed */,\n                      []() { return new PyExample(); } /* alias needed */))\n        // *Always* returns an alias instance (like py::init_alias<>())\n        .def(py::init([]() { return new PyExample(); }))\n        ;\n\nBrace initialization\n--------------------\n\n``pybind11::init<>`` internally uses C++11 brace initialization to call the\nconstructor of the target class. This means that it can be used to bind\n*implicit* constructors as well:\n\n.. code-block:: cpp\n\n    struct Aggregate {\n        int a;\n        std::string b;\n    };\n\n    py::class_<Aggregate>(m, \"Aggregate\")\n        .def(py::init<int, const std::string &>());\n\n.. note::\n\n    Note that brace initialization preferentially invokes constructor overloads\n    taking a ``std::initializer_list``. In the rare event that this causes an\n    issue, you can work around it by using ``py::init(...)`` with a lambda\n    function that constructs the new object as desired.\n\n.. _classes_with_non_public_destructors:\n\nNon-public destructors\n======================\n\nIf a class has a private or protected destructor (as might e.g. be the case in\na singleton pattern), a compile error will occur when creating bindings via\npybind11. The underlying issue is that the ``std::unique_ptr`` holder type that\nis responsible for managing the lifetime of instances will reference the\ndestructor even if no deallocations ever take place. In order to expose classes\nwith private or protected destructors, it is possible to override the holder\ntype via a holder type argument to ``class_``. Pybind11 provides a helper class\n``py::nodelete`` that disables any destructor invocations. In this case, it is\ncrucial that instances are deallocated on the C++ side to avoid memory leaks.\n\n.. code-block:: cpp\n\n    /* ... definition ... */\n\n    class MyClass {\n    private:\n        ~MyClass() { }\n    };\n\n    /* ... binding code ... */\n\n    py::class_<MyClass, std::unique_ptr<MyClass, py::nodelete>>(m, \"MyClass\")\n        .def(py::init<>())\n\n.. _destructors_that_call_python:\n\nDestructors that call Python\n============================\n\nIf a Python function is invoked from a C++ destructor, an exception may be thrown\nof type :class:`error_already_set`. If this error is thrown out of a class destructor,\n``std::terminate()`` will be called, terminating the process. Class destructors\nmust catch all exceptions of type :class:`error_already_set` to discard the Python\nexception using :func:`error_already_set::discard_as_unraisable`.\n\nEvery Python function should be treated as *possibly throwing*. When a Python generator\nstops yielding items, Python will throw a ``StopIteration`` exception, which can pass\nthough C++ destructors if the generator's stack frame holds the last reference to C++\nobjects.\n\nFor more information, see :ref:`the documentation on exceptions <unraisable_exceptions>`.\n\n.. code-block:: cpp\n\n    class MyClass {\n    public:\n        ~MyClass() {\n            try {\n                py::print(\"Even printing is dangerous in a destructor\");\n                py::exec(\"raise ValueError('This is an unraisable exception')\");\n            } catch (py::error_already_set &e) {\n                // error_context should be information about where/why the occurred,\n                // e.g. use __func__ to get the name of the current function\n                e.discard_as_unraisable(__func__);\n            }\n        }\n    };\n\n.. note::\n\n    pybind11 does not support C++ destructors marked ``noexcept(false)``.\n\n.. versionadded:: 2.6\n\n.. _implicit_conversions:\n\nImplicit conversions\n====================\n\nSuppose that instances of two types ``A`` and ``B`` are used in a project, and\nthat an ``A`` can easily be converted into an instance of type ``B`` (examples of this\ncould be a fixed and an arbitrary precision number type).\n\n.. code-block:: cpp\n\n    py::class_<A>(m, \"A\")\n        /// ... members ...\n\n    py::class_<B>(m, \"B\")\n        .def(py::init<A>())\n        /// ... members ...\n\n    m.def(\"func\",\n        [](const B &) { /* .... */ }\n    );\n\nTo invoke the function ``func`` using a variable ``a`` containing an ``A``\ninstance, we'd have to write ``func(B(a))`` in Python. On the other hand, C++\nwill automatically apply an implicit type conversion, which makes it possible\nto directly write ``func(a)``.\n\nIn this situation (i.e. where ``B`` has a constructor that converts from\n``A``), the following statement enables similar implicit conversions on the\nPython side:\n\n.. code-block:: cpp\n\n    py::implicitly_convertible<A, B>();\n\n.. note::\n\n    Implicit conversions from ``A`` to ``B`` only work when ``B`` is a custom\n    data type that is exposed to Python via pybind11.\n\n    To prevent runaway recursion, implicit conversions are non-reentrant: an\n    implicit conversion invoked as part of another implicit conversion of the\n    same type (i.e. from ``A`` to ``B``) will fail.\n\n.. _static_properties:\n\nStatic properties\n=================\n\nThe section on :ref:`properties` discussed the creation of instance properties\nthat are implemented in terms of C++ getters and setters.\n\nStatic properties can also be created in a similar way to expose getters and\nsetters of static class attributes. Note that the implicit ``self`` argument\nalso exists in this case and is used to pass the Python ``type`` subclass\ninstance. This parameter will often not be needed by the C++ side, and the\nfollowing example illustrates how to instantiate a lambda getter function\nthat ignores it:\n\n.. code-block:: cpp\n\n    py::class_<Foo>(m, \"Foo\")\n        .def_property_readonly_static(\"foo\", [](py::object /* self */) { return Foo(); });\n\nOperator overloading\n====================\n\nSuppose that we're given the following ``Vector2`` class with a vector addition\nand scalar multiplication operation, all implemented using overloaded operators\nin C++.\n\n.. code-block:: cpp\n\n    class Vector2 {\n    public:\n        Vector2(float x, float y) : x(x), y(y) { }\n\n        Vector2 operator+(const Vector2 &v) const { return Vector2(x + v.x, y + v.y); }\n        Vector2 operator*(float value) const { return Vector2(x * value, y * value); }\n        Vector2& operator+=(const Vector2 &v) { x += v.x; y += v.y; return *this; }\n        Vector2& operator*=(float v) { x *= v; y *= v; return *this; }\n\n        friend Vector2 operator*(float f, const Vector2 &v) {\n            return Vector2(f * v.x, f * v.y);\n        }\n\n        std::string toString() const {\n            return \"[\" + std::to_string(x) + \", \" + std::to_string(y) + \"]\";\n        }\n    private:\n        float x, y;\n    };\n\nThe following snippet shows how the above operators can be conveniently exposed\nto Python.\n\n.. code-block:: cpp\n\n    #include <pybind11/operators.h>\n\n    PYBIND11_MODULE(example, m) {\n        py::class_<Vector2>(m, \"Vector2\")\n            .def(py::init<float, float>())\n            .def(py::self + py::self)\n            .def(py::self += py::self)\n            .def(py::self *= float())\n            .def(float() * py::self)\n            .def(py::self * float())\n            .def(-py::self)\n            .def(\"__repr__\", &Vector2::toString);\n    }\n\nNote that a line like\n\n.. code-block:: cpp\n\n            .def(py::self * float())\n\nis really just short hand notation for\n\n.. code-block:: cpp\n\n    .def(\"__mul__\", [](const Vector2 &a, float b) {\n        return a * b;\n    }, py::is_operator())\n\nThis can be useful for exposing additional operators that don't exist on the\nC++ side, or to perform other types of customization. The ``py::is_operator``\nflag marker is needed to inform pybind11 that this is an operator, which\nreturns ``NotImplemented`` when invoked with incompatible arguments rather than\nthrowing a type error.\n\n.. note::\n\n    To use the more convenient ``py::self`` notation, the additional\n    header file :file:`pybind11/operators.h` must be included.\n\n.. seealso::\n\n    The file :file:`tests/test_operator_overloading.cpp` contains a\n    complete example that demonstrates how to work with overloaded operators in\n    more detail.\n\n.. _pickling:\n\nPickling support\n================\n\nPython's ``pickle`` module provides a powerful facility to serialize and\nde-serialize a Python object graph into a binary data stream. To pickle and\nunpickle C++ classes using pybind11, a ``py::pickle()`` definition must be\nprovided. Suppose the class in question has the following signature:\n\n.. code-block:: cpp\n\n    class Pickleable {\n    public:\n        Pickleable(const std::string &value) : m_value(value) { }\n        const std::string &value() const { return m_value; }\n\n        void setExtra(int extra) { m_extra = extra; }\n        int extra() const { return m_extra; }\n    private:\n        std::string m_value;\n        int m_extra = 0;\n    };\n\nPickling support in Python is enabled by defining the ``__setstate__`` and\n``__getstate__`` methods [#f3]_. For pybind11 classes, use ``py::pickle()``\nto bind these two functions:\n\n.. code-block:: cpp\n\n    py::class_<Pickleable>(m, \"Pickleable\")\n        .def(py::init<std::string>())\n        .def(\"value\", &Pickleable::value)\n        .def(\"extra\", &Pickleable::extra)\n        .def(\"setExtra\", &Pickleable::setExtra)\n        .def(py::pickle(\n            [](const Pickleable &p) { // __getstate__\n                /* Return a tuple that fully encodes the state of the object */\n                return py::make_tuple(p.value(), p.extra());\n            },\n            [](py::tuple t) { // __setstate__\n                if (t.size() != 2)\n                    throw std::runtime_error(\"Invalid state!\");\n\n                /* Create a new C++ instance */\n                Pickleable p(t[0].cast<std::string>());\n\n                /* Assign any additional state */\n                p.setExtra(t[1].cast<int>());\n\n                return p;\n            }\n        ));\n\nThe ``__setstate__`` part of the ``py::pickle()`` definition follows the same\nrules as the single-argument version of ``py::init()``. The return type can be\na value, pointer or holder type. See :ref:`custom_constructors` for details.\n\nAn instance can now be pickled as follows:\n\n.. code-block:: python\n\n    import pickle\n\n    p = Pickleable(\"test_value\")\n    p.setExtra(15)\n    data = pickle.dumps(p)\n\n\n.. note::\n    If given, the second argument to ``dumps`` must be 2 or larger - 0 and 1 are\n    not supported. Newer versions are also fine; for instance, specify ``-1`` to\n    always use the latest available version. Beware: failure to follow these\n    instructions will cause important pybind11 memory allocation routines to be\n    skipped during unpickling, which will likely lead to memory corruption\n    and/or segmentation faults. Python defaults to version 3 (Python 3-3.7) and\n    version 4 for Python 3.8+.\n\n.. seealso::\n\n    The file :file:`tests/test_pickling.cpp` contains a complete example\n    that demonstrates how to pickle and unpickle types using pybind11 in more\n    detail.\n\n.. [#f3] http://docs.python.org/3/library/pickle.html#pickling-class-instances\n\nDeepcopy support\n================\n\nPython normally uses references in assignments. Sometimes a real copy is needed\nto prevent changing all copies. The ``copy`` module [#f5]_ provides these\ncapabilities.\n\nA class with pickle support is automatically also (deep)copy\ncompatible. However, performance can be improved by adding custom\n``__copy__`` and ``__deepcopy__`` methods.\n\nFor simple classes (deep)copy can be enabled by using the copy constructor,\nwhich should look as follows:\n\n.. code-block:: cpp\n\n    py::class_<Copyable>(m, \"Copyable\")\n        .def(\"__copy__\",  [](const Copyable &self) {\n            return Copyable(self);\n        })\n        .def(\"__deepcopy__\", [](const Copyable &self, py::dict) {\n            return Copyable(self);\n        }, \"memo\"_a);\n\n.. note::\n\n    Dynamic attributes will not be copied in this example.\n\n.. [#f5] https://docs.python.org/3/library/copy.html\n\nMultiple Inheritance\n====================\n\npybind11 can create bindings for types that derive from multiple base types\n(aka. *multiple inheritance*). To do so, specify all bases in the template\narguments of the ``class_`` declaration:\n\n.. code-block:: cpp\n\n    py::class_<MyType, BaseType1, BaseType2, BaseType3>(m, \"MyType\")\n       ...\n\nThe base types can be specified in arbitrary order, and they can even be\ninterspersed with alias types and holder types (discussed earlier in this\ndocument)---pybind11 will automatically find out which is which. The only\nrequirement is that the first template argument is the type to be declared.\n\nIt is also permitted to inherit multiply from exported C++ classes in Python,\nas well as inheriting from multiple Python and/or pybind11-exported classes.\n\nThere is one caveat regarding the implementation of this feature:\n\nWhen only one base type is specified for a C++ type that actually has multiple\nbases, pybind11 will assume that it does not participate in multiple\ninheritance, which can lead to undefined behavior. In such cases, add the tag\n``multiple_inheritance`` to the class constructor:\n\n.. code-block:: cpp\n\n    py::class_<MyType, BaseType2>(m, \"MyType\", py::multiple_inheritance());\n\nThe tag is redundant and does not need to be specified when multiple base types\nare listed.\n\n.. _module_local:\n\nModule-local class bindings\n===========================\n\nWhen creating a binding for a class, pybind11 by default makes that binding\n\"global\" across modules.  What this means is that a type defined in one module\ncan be returned from any module resulting in the same Python type.  For\nexample, this allows the following:\n\n.. code-block:: cpp\n\n    // In the module1.cpp binding code for module1:\n    py::class_<Pet>(m, \"Pet\")\n        .def(py::init<std::string>())\n        .def_readonly(\"name\", &Pet::name);\n\n.. code-block:: cpp\n\n    // In the module2.cpp binding code for module2:\n    m.def(\"create_pet\", [](std::string name) { return new Pet(name); });\n\n.. code-block:: pycon\n\n    >>> from module1 import Pet\n    >>> from module2 import create_pet\n    >>> pet1 = Pet(\"Kitty\")\n    >>> pet2 = create_pet(\"Doggy\")\n    >>> pet2.name()\n    'Doggy'\n\nWhen writing binding code for a library, this is usually desirable: this\nallows, for example, splitting up a complex library into multiple Python\nmodules.\n\nIn some cases, however, this can cause conflicts.  For example, suppose two\nunrelated modules make use of an external C++ library and each provide custom\nbindings for one of that library's classes.  This will result in an error when\na Python program attempts to import both modules (directly or indirectly)\nbecause of conflicting definitions on the external type:\n\n.. code-block:: cpp\n\n    // dogs.cpp\n\n    // Binding for external library class:\n    py::class<pets::Pet>(m, \"Pet\")\n        .def(\"name\", &pets::Pet::name);\n\n    // Binding for local extension class:\n    py::class<Dog, pets::Pet>(m, \"Dog\")\n        .def(py::init<std::string>());\n\n.. code-block:: cpp\n\n    // cats.cpp, in a completely separate project from the above dogs.cpp.\n\n    // Binding for external library class:\n    py::class<pets::Pet>(m, \"Pet\")\n        .def(\"get_name\", &pets::Pet::name);\n\n    // Binding for local extending class:\n    py::class<Cat, pets::Pet>(m, \"Cat\")\n        .def(py::init<std::string>());\n\n.. code-block:: pycon\n\n    >>> import cats\n    >>> import dogs\n    Traceback (most recent call last):\n      File \"<stdin>\", line 1, in <module>\n    ImportError: generic_type: type \"Pet\" is already registered!\n\nTo get around this, you can tell pybind11 to keep the external class binding\nlocalized to the module by passing the ``py::module_local()`` attribute into\nthe ``py::class_`` constructor:\n\n.. code-block:: cpp\n\n    // Pet binding in dogs.cpp:\n    py::class<pets::Pet>(m, \"Pet\", py::module_local())\n        .def(\"name\", &pets::Pet::name);\n\n.. code-block:: cpp\n\n    // Pet binding in cats.cpp:\n    py::class<pets::Pet>(m, \"Pet\", py::module_local())\n        .def(\"get_name\", &pets::Pet::name);\n\nThis makes the Python-side ``dogs.Pet`` and ``cats.Pet`` into distinct classes,\navoiding the conflict and allowing both modules to be loaded.  C++ code in the\n``dogs`` module that casts or returns a ``Pet`` instance will result in a\n``dogs.Pet`` Python instance, while C++ code in the ``cats`` module will result\nin a ``cats.Pet`` Python instance.\n\nThis does come with two caveats, however: First, external modules cannot return\nor cast a ``Pet`` instance to Python (unless they also provide their own local\nbindings).  Second, from the Python point of view they are two distinct classes.\n\nNote that the locality only applies in the C++ -> Python direction.  When\npassing such a ``py::module_local`` type into a C++ function, the module-local\nclasses are still considered.  This means that if the following function is\nadded to any module (including but not limited to the ``cats`` and ``dogs``\nmodules above) it will be callable with either a ``dogs.Pet`` or ``cats.Pet``\nargument:\n\n.. code-block:: cpp\n\n    m.def(\"pet_name\", [](const pets::Pet &pet) { return pet.name(); });\n\nFor example, suppose the above function is added to each of ``cats.cpp``,\n``dogs.cpp`` and ``frogs.cpp`` (where ``frogs.cpp`` is some other module that\ndoes *not* bind ``Pets`` at all).\n\n.. code-block:: pycon\n\n    >>> import cats, dogs, frogs  # No error because of the added py::module_local()\n    >>> mycat, mydog = cats.Cat(\"Fluffy\"), dogs.Dog(\"Rover\")\n    >>> (cats.pet_name(mycat), dogs.pet_name(mydog))\n    ('Fluffy', 'Rover')\n    >>> (cats.pet_name(mydog), dogs.pet_name(mycat), frogs.pet_name(mycat))\n    ('Rover', 'Fluffy', 'Fluffy')\n\nIt is possible to use ``py::module_local()`` registrations in one module even\nif another module registers the same type globally: within the module with the\nmodule-local definition, all C++ instances will be cast to the associated bound\nPython type.  In other modules any such values are converted to the global\nPython type created elsewhere.\n\n.. note::\n\n    STL bindings (as provided via the optional :file:`pybind11/stl_bind.h`\n    header) apply ``py::module_local`` by default when the bound type might\n    conflict with other modules; see :ref:`stl_bind` for details.\n\n.. note::\n\n    The localization of the bound types is actually tied to the shared object\n    or binary generated by the compiler/linker.  For typical modules created\n    with ``PYBIND11_MODULE()``, this distinction is not significant.  It is\n    possible, however, when :ref:`embedding` to embed multiple modules in the\n    same binary (see :ref:`embedding_modules`).  In such a case, the\n    localization will apply across all embedded modules within the same binary.\n\n.. seealso::\n\n    The file :file:`tests/test_local_bindings.cpp` contains additional examples\n    that demonstrate how ``py::module_local()`` works.\n\nBinding protected member functions\n==================================\n\nIt's normally not possible to expose ``protected`` member functions to Python:\n\n.. code-block:: cpp\n\n    class A {\n    protected:\n        int foo() const { return 42; }\n    };\n\n    py::class_<A>(m, \"A\")\n        .def(\"foo\", &A::foo); // error: 'foo' is a protected member of 'A'\n\nOn one hand, this is good because non-``public`` members aren't meant to be\naccessed from the outside. But we may want to make use of ``protected``\nfunctions in derived Python classes.\n\nThe following pattern makes this possible:\n\n.. code-block:: cpp\n\n    class A {\n    protected:\n        int foo() const { return 42; }\n    };\n\n    class Publicist : public A { // helper type for exposing protected functions\n    public:\n        using A::foo; // inherited with different access modifier\n    };\n\n    py::class_<A>(m, \"A\") // bind the primary class\n        .def(\"foo\", &Publicist::foo); // expose protected methods via the publicist\n\nThis works because ``&Publicist::foo`` is exactly the same function as\n``&A::foo`` (same signature and address), just with a different access\nmodifier. The only purpose of the ``Publicist`` helper class is to make\nthe function name ``public``.\n\nIf the intent is to expose ``protected`` ``virtual`` functions which can be\noverridden in Python, the publicist pattern can be combined with the previously\ndescribed trampoline:\n\n.. code-block:: cpp\n\n    class A {\n    public:\n        virtual ~A() = default;\n\n    protected:\n        virtual int foo() const { return 42; }\n    };\n\n    class Trampoline : public A {\n    public:\n        int foo() const override { PYBIND11_OVERRIDE(int, A, foo, ); }\n    };\n\n    class Publicist : public A {\n    public:\n        using A::foo;\n    };\n\n    py::class_<A, Trampoline>(m, \"A\") // <-- `Trampoline` here\n        .def(\"foo\", &Publicist::foo); // <-- `Publicist` here, not `Trampoline`!\n\nBinding final classes\n=====================\n\nSome classes may not be appropriate to inherit from. In C++11, classes can\nuse the ``final`` specifier to ensure that a class cannot be inherited from.\nThe ``py::is_final`` attribute can be used to ensure that Python classes\ncannot inherit from a specified type. The underlying C++ type does not need\nto be declared final.\n\n.. code-block:: cpp\n\n    class IsFinal final {};\n\n    py::class_<IsFinal>(m, \"IsFinal\", py::is_final());\n\nWhen you try to inherit from such a class in Python, you will now get this\nerror:\n\n.. code-block:: pycon\n\n    >>> class PyFinalChild(IsFinal):\n    ...     pass\n    ...\n    TypeError: type 'IsFinal' is not an acceptable base type\n\n.. note:: This attribute is currently ignored on PyPy\n\n.. versionadded:: 2.6\n\nBinding classes with template parameters\n========================================\n\npybind11 can also wrap classes that have template parameters. Consider these classes:\n\n.. code-block:: cpp\n\n    struct Cat {};\n    struct Dog {};\n\n    template <typename PetType>\n    struct Cage {\n        Cage(PetType& pet);\n        PetType& get();\n    };\n\nC++ templates may only be instantiated at compile time, so pybind11 can only\nwrap instantiated templated classes. You cannot wrap a non-instantiated template:\n\n.. code-block:: cpp\n\n    // BROKEN (this will not compile)\n    py::class_<Cage>(m, \"Cage\");\n        .def(\"get\", &Cage::get);\n\nYou must explicitly specify each template/type combination that you want to\nwrap separately.\n\n.. code-block:: cpp\n\n    // ok\n    py::class_<Cage<Cat>>(m, \"CatCage\")\n        .def(\"get\", &Cage<Cat>::get);\n\n    // ok\n    py::class_<Cage<Dog>>(m, \"DogCage\")\n        .def(\"get\", &Cage<Dog>::get);\n\nIf your class methods have template parameters you can wrap those as well,\nbut once again each instantiation must be explicitly specified:\n\n.. code-block:: cpp\n\n    typename <typename T>\n    struct MyClass {\n        template <typename V>\n        T fn(V v);\n    };\n\n    py::class<MyClass<int>>(m, \"MyClassT\")\n        .def(\"fn\", &MyClass<int>::fn<std::string>);\n\nCustom automatic downcasters\n============================\n\nAs explained in :ref:`inheritance`, pybind11 comes with built-in\nunderstanding of the dynamic type of polymorphic objects in C++; that\nis, returning a Pet to Python produces a Python object that knows it's\nwrapping a Dog, if Pet has virtual methods and pybind11 knows about\nDog and this Pet is in fact a Dog. Sometimes, you might want to\nprovide this automatic downcasting behavior when creating bindings for\na class hierarchy that does not use standard C++ polymorphism, such as\nLLVM [#f4]_. As long as there's some way to determine at runtime\nwhether a downcast is safe, you can proceed by specializing the\n``pybind11::polymorphic_type_hook`` template:\n\n.. code-block:: cpp\n\n    enum class PetKind { Cat, Dog, Zebra };\n    struct Pet {   // Not polymorphic: has no virtual methods\n        const PetKind kind;\n        int age = 0;\n      protected:\n        Pet(PetKind _kind) : kind(_kind) {}\n    };\n    struct Dog : Pet {\n        Dog() : Pet(PetKind::Dog) {}\n        std::string sound = \"woof!\";\n        std::string bark() const { return sound; }\n    };\n\n    namespace PYBIND11_NAMESPACE {\n        template<> struct polymorphic_type_hook<Pet> {\n            static const void *get(const Pet *src, const std::type_info*& type) {\n                // note that src may be nullptr\n                if (src && src->kind == PetKind::Dog) {\n                    type = &typeid(Dog);\n                    return static_cast<const Dog*>(src);\n                }\n                return src;\n            }\n        };\n    } // namespace PYBIND11_NAMESPACE\n\nWhen pybind11 wants to convert a C++ pointer of type ``Base*`` to a\nPython object, it calls ``polymorphic_type_hook<Base>::get()`` to\ndetermine if a downcast is possible. The ``get()`` function should use\nwhatever runtime information is available to determine if its ``src``\nparameter is in fact an instance of some class ``Derived`` that\ninherits from ``Base``. If it finds such a ``Derived``, it sets ``type\n= &typeid(Derived)`` and returns a pointer to the ``Derived`` object\nthat contains ``src``. Otherwise, it just returns ``src``, leaving\n``type`` at its default value of nullptr. If you set ``type`` to a\ntype that pybind11 doesn't know about, no downcasting will occur, and\nthe original ``src`` pointer will be used with its static type\n``Base*``.\n\nIt is critical that the returned pointer and ``type`` argument of\n``get()`` agree with each other: if ``type`` is set to something\nnon-null, the returned pointer must point to the start of an object\nwhose type is ``type``. If the hierarchy being exposed uses only\nsingle inheritance, a simple ``return src;`` will achieve this just\nfine, but in the general case, you must cast ``src`` to the\nappropriate derived-class pointer (e.g. using\n``static_cast<Derived>(src)``) before allowing it to be returned as a\n``void*``.\n\n.. [#f4] https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html\n\n.. note::\n\n    pybind11's standard support for downcasting objects whose types\n    have virtual methods is implemented using\n    ``polymorphic_type_hook`` too, using the standard C++ ability to\n    determine the most-derived type of a polymorphic object using\n    ``typeid()`` and to cast a base pointer to that most-derived type\n    (even if you don't know what it is) using ``dynamic_cast<void*>``.\n\n.. seealso::\n\n    The file :file:`tests/test_tagbased_polymorphic.cpp` contains a\n    more complete example, including a demonstration of how to provide\n    automatic downcasting for an entire class hierarchy without\n    writing one get() function for each class.\n\nAccessing the type object\n=========================\n\nYou can get the type object from a C++ class that has already been registered using:\n\n.. code-block:: cpp\n\n    py::type T_py = py::type::of<T>();\n\nYou can directly use ``py::type::of(ob)`` to get the type object from any python\nobject, just like ``type(ob)`` in Python.\n\n.. note::\n\n    Other types, like ``py::type::of<int>()``, do not work, see :ref:`type-conversions`.\n\n.. versionadded:: 2.6\n\nCustom type setup\n=================\n\nFor advanced use cases, such as enabling garbage collection support, you may\nwish to directly manipulate the ``PyHeapTypeObject`` corresponding to a\n``py::class_`` definition.\n\nYou can do that using ``py::custom_type_setup``:\n\n.. code-block:: cpp\n\n   struct OwnsPythonObjects {\n       py::object value = py::none();\n   };\n   py::class_<OwnsPythonObjects> cls(\n       m, \"OwnsPythonObjects\", py::custom_type_setup([](PyHeapTypeObject *heap_type) {\n           auto *type = &heap_type->ht_type;\n           type->tp_flags |= Py_TPFLAGS_HAVE_GC;\n           type->tp_traverse = [](PyObject *self_base, visitproc visit, void *arg) {\n               auto &self = py::cast<OwnsPythonObjects&>(py::handle(self_base));\n               Py_VISIT(self.value.ptr());\n               return 0;\n           };\n           type->tp_clear = [](PyObject *self_base) {\n               auto &self = py::cast<OwnsPythonObjects&>(py::handle(self_base));\n               self.value = py::none();\n               return 0;\n           };\n       }));\n   cls.def(py::init<>());\n   cls.def_readwrite(\"value\", &OwnsPythonObjects::value);\n\n.. versionadded:: 2.8\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/embedding.rst",
    "content": ".. _embedding:\n\nEmbedding the interpreter\n#########################\n\nWhile pybind11 is mainly focused on extending Python using C++, it's also\npossible to do the reverse: embed the Python interpreter into a C++ program.\nAll of the other documentation pages still apply here, so refer to them for\ngeneral pybind11 usage. This section will cover a few extra things required\nfor embedding.\n\nGetting started\n===============\n\nA basic executable with an embedded interpreter can be created with just a few\nlines of CMake and the ``pybind11::embed`` target, as shown below. For more\ninformation, see :doc:`/compiling`.\n\n.. code-block:: cmake\n\n    cmake_minimum_required(VERSION 3.4)\n    project(example)\n\n    find_package(pybind11 REQUIRED)  # or `add_subdirectory(pybind11)`\n\n    add_executable(example main.cpp)\n    target_link_libraries(example PRIVATE pybind11::embed)\n\nThe essential structure of the ``main.cpp`` file looks like this:\n\n.. code-block:: cpp\n\n    #include <pybind11/embed.h> // everything needed for embedding\n    namespace py = pybind11;\n\n    int main() {\n        py::scoped_interpreter guard{}; // start the interpreter and keep it alive\n\n        py::print(\"Hello, World!\"); // use the Python API\n    }\n\nThe interpreter must be initialized before using any Python API, which includes\nall the functions and classes in pybind11. The RAII guard class ``scoped_interpreter``\ntakes care of the interpreter lifetime. After the guard is destroyed, the interpreter\nshuts down and clears its memory. No Python functions can be called after this.\n\nExecuting Python code\n=====================\n\nThere are a few different ways to run Python code. One option is to use ``eval``,\n``exec`` or ``eval_file``, as explained in :ref:`eval`. Here is a quick example in\nthe context of an executable with an embedded interpreter:\n\n.. code-block:: cpp\n\n    #include <pybind11/embed.h>\n    namespace py = pybind11;\n\n    int main() {\n        py::scoped_interpreter guard{};\n\n        py::exec(R\"(\n            kwargs = dict(name=\"World\", number=42)\n            message = \"Hello, {name}! The answer is {number}\".format(**kwargs)\n            print(message)\n        )\");\n    }\n\nAlternatively, similar results can be achieved using pybind11's API (see\n:doc:`/advanced/pycpp/index` for more details).\n\n.. code-block:: cpp\n\n    #include <pybind11/embed.h>\n    namespace py = pybind11;\n    using namespace py::literals;\n\n    int main() {\n        py::scoped_interpreter guard{};\n\n        auto kwargs = py::dict(\"name\"_a=\"World\", \"number\"_a=42);\n        auto message = \"Hello, {name}! The answer is {number}\"_s.format(**kwargs);\n        py::print(message);\n    }\n\nThe two approaches can also be combined:\n\n.. code-block:: cpp\n\n    #include <pybind11/embed.h>\n    #include <iostream>\n\n    namespace py = pybind11;\n    using namespace py::literals;\n\n    int main() {\n        py::scoped_interpreter guard{};\n\n        auto locals = py::dict(\"name\"_a=\"World\", \"number\"_a=42);\n        py::exec(R\"(\n            message = \"Hello, {name}! The answer is {number}\".format(**locals())\n        )\", py::globals(), locals);\n\n        auto message = locals[\"message\"].cast<std::string>();\n        std::cout << message;\n    }\n\nImporting modules\n=================\n\nPython modules can be imported using ``module_::import()``:\n\n.. code-block:: cpp\n\n    py::module_ sys = py::module_::import(\"sys\");\n    py::print(sys.attr(\"path\"));\n\nFor convenience, the current working directory is included in ``sys.path`` when\nembedding the interpreter. This makes it easy to import local Python files:\n\n.. code-block:: python\n\n    \"\"\"calc.py located in the working directory\"\"\"\n\n\n    def add(i, j):\n        return i + j\n\n\n.. code-block:: cpp\n\n    py::module_ calc = py::module_::import(\"calc\");\n    py::object result = calc.attr(\"add\")(1, 2);\n    int n = result.cast<int>();\n    assert(n == 3);\n\nModules can be reloaded using ``module_::reload()`` if the source is modified e.g.\nby an external process. This can be useful in scenarios where the application\nimports a user defined data processing script which needs to be updated after\nchanges by the user. Note that this function does not reload modules recursively.\n\n.. _embedding_modules:\n\nAdding embedded modules\n=======================\n\nEmbedded binary modules can be added using the ``PYBIND11_EMBEDDED_MODULE`` macro.\nNote that the definition must be placed at global scope. They can be imported\nlike any other module.\n\n.. code-block:: cpp\n\n    #include <pybind11/embed.h>\n    namespace py = pybind11;\n\n    PYBIND11_EMBEDDED_MODULE(fast_calc, m) {\n        // `m` is a `py::module_` which is used to bind functions and classes\n        m.def(\"add\", [](int i, int j) {\n            return i + j;\n        });\n    }\n\n    int main() {\n        py::scoped_interpreter guard{};\n\n        auto fast_calc = py::module_::import(\"fast_calc\");\n        auto result = fast_calc.attr(\"add\")(1, 2).cast<int>();\n        assert(result == 3);\n    }\n\nUnlike extension modules where only a single binary module can be created, on\nthe embedded side an unlimited number of modules can be added using multiple\n``PYBIND11_EMBEDDED_MODULE`` definitions (as long as they have unique names).\n\nThese modules are added to Python's list of builtins, so they can also be\nimported in pure Python files loaded by the interpreter. Everything interacts\nnaturally:\n\n.. code-block:: python\n\n    \"\"\"py_module.py located in the working directory\"\"\"\n    import cpp_module\n\n    a = cpp_module.a\n    b = a + 1\n\n\n.. code-block:: cpp\n\n    #include <pybind11/embed.h>\n    namespace py = pybind11;\n\n    PYBIND11_EMBEDDED_MODULE(cpp_module, m) {\n        m.attr(\"a\") = 1;\n    }\n\n    int main() {\n        py::scoped_interpreter guard{};\n\n        auto py_module = py::module_::import(\"py_module\");\n\n        auto locals = py::dict(\"fmt\"_a=\"{} + {} = {}\", **py_module.attr(\"__dict__\"));\n        assert(locals[\"a\"].cast<int>() == 1);\n        assert(locals[\"b\"].cast<int>() == 2);\n\n        py::exec(R\"(\n            c = a + b\n            message = fmt.format(a, b, c)\n        )\", py::globals(), locals);\n\n        assert(locals[\"c\"].cast<int>() == 3);\n        assert(locals[\"message\"].cast<std::string>() == \"1 + 2 = 3\");\n    }\n\n\nInterpreter lifetime\n====================\n\nThe Python interpreter shuts down when ``scoped_interpreter`` is destroyed. After\nthis, creating a new instance will restart the interpreter. Alternatively, the\n``initialize_interpreter`` / ``finalize_interpreter`` pair of functions can be used\nto directly set the state at any time.\n\nModules created with pybind11 can be safely re-initialized after the interpreter\nhas been restarted. However, this may not apply to third-party extension modules.\nThe issue is that Python itself cannot completely unload extension modules and\nthere are several caveats with regard to interpreter restarting. In short, not\nall memory may be freed, either due to Python reference cycles or user-created\nglobal data. All the details can be found in the CPython documentation.\n\n.. warning::\n\n    Creating two concurrent ``scoped_interpreter`` guards is a fatal error. So is\n    calling ``initialize_interpreter`` for a second time after the interpreter\n    has already been initialized.\n\n    Do not use the raw CPython API functions ``Py_Initialize`` and\n    ``Py_Finalize`` as these do not properly handle the lifetime of\n    pybind11's internal data.\n\n\nSub-interpreter support\n=======================\n\nCreating multiple copies of ``scoped_interpreter`` is not possible because it\nrepresents the main Python interpreter. Sub-interpreters are something different\nand they do permit the existence of multiple interpreters. This is an advanced\nfeature of the CPython API and should be handled with care. pybind11 does not\ncurrently offer a C++ interface for sub-interpreters, so refer to the CPython\ndocumentation for all the details regarding this feature.\n\nWe'll just mention a couple of caveats the sub-interpreters support in pybind11:\n\n 1. Sub-interpreters will not receive independent copies of embedded modules.\n    Instead, these are shared and modifications in one interpreter may be\n    reflected in another.\n\n 2. Managing multiple threads, multiple interpreters and the GIL can be\n    challenging and there are several caveats here, even within the pure\n    CPython API (please refer to the Python docs for details). As for\n    pybind11, keep in mind that ``gil_scoped_release`` and ``gil_scoped_acquire``\n    do not take sub-interpreters into account.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/exceptions.rst",
    "content": "Exceptions\n##########\n\nBuilt-in C++ to Python exception translation\n============================================\n\nWhen Python calls C++ code through pybind11, pybind11 provides a C++ exception handler\nthat will trap C++ exceptions, translate them to the corresponding Python exception,\nand raise them so that Python code can handle them.\n\npybind11 defines translations for ``std::exception`` and its standard\nsubclasses, and several special exception classes that translate to specific\nPython exceptions. Note that these are not actually Python exceptions, so they\ncannot be examined using the Python C API. Instead, they are pure C++ objects\nthat pybind11 will translate the corresponding Python exception when they arrive\nat its exception handler.\n\n.. tabularcolumns:: |p{0.5\\textwidth}|p{0.45\\textwidth}|\n\n+--------------------------------------+--------------------------------------+\n|  Exception thrown by C++             |  Translated to Python exception type |\n+======================================+======================================+\n| :class:`std::exception`              | ``RuntimeError``                     |\n+--------------------------------------+--------------------------------------+\n| :class:`std::bad_alloc`              | ``MemoryError``                      |\n+--------------------------------------+--------------------------------------+\n| :class:`std::domain_error`           | ``ValueError``                       |\n+--------------------------------------+--------------------------------------+\n| :class:`std::invalid_argument`       | ``ValueError``                       |\n+--------------------------------------+--------------------------------------+\n| :class:`std::length_error`           | ``ValueError``                       |\n+--------------------------------------+--------------------------------------+\n| :class:`std::out_of_range`           | ``IndexError``                       |\n+--------------------------------------+--------------------------------------+\n| :class:`std::range_error`            | ``ValueError``                       |\n+--------------------------------------+--------------------------------------+\n| :class:`std::overflow_error`         | ``OverflowError``                    |\n+--------------------------------------+--------------------------------------+\n| :class:`pybind11::stop_iteration`    | ``StopIteration`` (used to implement |\n|                                      | custom iterators)                    |\n+--------------------------------------+--------------------------------------+\n| :class:`pybind11::index_error`       | ``IndexError`` (used to indicate out |\n|                                      | of bounds access in ``__getitem__``, |\n|                                      | ``__setitem__``, etc.)               |\n+--------------------------------------+--------------------------------------+\n| :class:`pybind11::key_error`         | ``KeyError`` (used to indicate out   |\n|                                      | of bounds access in ``__getitem__``, |\n|                                      | ``__setitem__`` in dict-like         |\n|                                      | objects, etc.)                       |\n+--------------------------------------+--------------------------------------+\n| :class:`pybind11::value_error`       | ``ValueError`` (used to indicate     |\n|                                      | wrong value passed in                |\n|                                      | ``container.remove(...)``)           |\n+--------------------------------------+--------------------------------------+\n| :class:`pybind11::type_error`        | ``TypeError``                        |\n+--------------------------------------+--------------------------------------+\n| :class:`pybind11::buffer_error`      | ``BufferError``                      |\n+--------------------------------------+--------------------------------------+\n| :class:`pybind11::import_error`      | ``ImportError``                      |\n+--------------------------------------+--------------------------------------+\n| :class:`pybind11::attribute_error`   | ``AttributeError``                   |\n+--------------------------------------+--------------------------------------+\n| Any other exception                  | ``RuntimeError``                     |\n+--------------------------------------+--------------------------------------+\n\nException translation is not bidirectional. That is, *catching* the C++\nexceptions defined above will not trap exceptions that originate from\nPython. For that, catch :class:`pybind11::error_already_set`. See :ref:`below\n<handling_python_exceptions_cpp>` for further details.\n\nThere is also a special exception :class:`cast_error` that is thrown by\n:func:`handle::call` when the input arguments cannot be converted to Python\nobjects.\n\nRegistering custom translators\n==============================\n\nIf the default exception conversion policy described above is insufficient,\npybind11 also provides support for registering custom exception translators.\nSimilar to pybind11 classes, exception translators can be local to the module\nthey are defined in or global to the entire python session.  To register a simple\nexception conversion that translates a C++ exception into a new Python exception\nusing the C++ exception's ``what()`` method, a helper function is available:\n\n.. code-block:: cpp\n\n    py::register_exception<CppExp>(module, \"PyExp\");\n\nThis call creates a Python exception class with the name ``PyExp`` in the given\nmodule and automatically converts any encountered exceptions of type ``CppExp``\ninto Python exceptions of type ``PyExp``.\n\nA matching function is available for registering a local exception translator:\n\n.. code-block:: cpp\n\n    py::register_local_exception<CppExp>(module, \"PyExp\");\n\n\nIt is possible to specify base class for the exception using the third\nparameter, a ``handle``:\n\n.. code-block:: cpp\n\n    py::register_exception<CppExp>(module, \"PyExp\", PyExc_RuntimeError);\n    py::register_local_exception<CppExp>(module, \"PyExp\", PyExc_RuntimeError);\n\nThen ``PyExp`` can be caught both as ``PyExp`` and ``RuntimeError``.\n\nThe class objects of the built-in Python exceptions are listed in the Python\ndocumentation on `Standard Exceptions <https://docs.python.org/3/c-api/exceptions.html#standard-exceptions>`_.\nThe default base class is ``PyExc_Exception``.\n\nWhen more advanced exception translation is needed, the functions\n``py::register_exception_translator(translator)`` and\n``py::register_local_exception_translator(translator)`` can be used to register\nfunctions that can translate arbitrary exception types (and which may include\nadditional logic to do so).  The functions takes a stateless callable (e.g. a\nfunction pointer or a lambda function without captured variables) with the call\nsignature ``void(std::exception_ptr)``.\n\nWhen a C++ exception is thrown, the registered exception translators are tried\nin reverse order of registration (i.e. the last registered translator gets the\nfirst shot at handling the exception). All local translators will be tried\nbefore a global translator is tried.\n\nInside the translator, ``std::rethrow_exception`` should be used within\na try block to re-throw the exception.  One or more catch clauses to catch\nthe appropriate exceptions should then be used with each clause using\n``PyErr_SetString`` to set a Python exception or ``ex(string)`` to set\nthe python exception to a custom exception type (see below).\n\nTo declare a custom Python exception type, declare a ``py::exception`` variable\nand use this in the associated exception translator (note: it is often useful\nto make this a static declaration when using it inside a lambda expression\nwithout requiring capturing).\n\nThe following example demonstrates this for a hypothetical exception classes\n``MyCustomException`` and ``OtherException``: the first is translated to a\ncustom python exception ``MyCustomError``, while the second is translated to a\nstandard python RuntimeError:\n\n.. code-block:: cpp\n\n    static py::exception<MyCustomException> exc(m, \"MyCustomError\");\n    py::register_exception_translator([](std::exception_ptr p) {\n        try {\n            if (p) std::rethrow_exception(p);\n        } catch (const MyCustomException &e) {\n            exc(e.what());\n        } catch (const OtherException &e) {\n            PyErr_SetString(PyExc_RuntimeError, e.what());\n        }\n    });\n\nMultiple exceptions can be handled by a single translator, as shown in the\nexample above. If the exception is not caught by the current translator, the\npreviously registered one gets a chance.\n\nIf none of the registered exception translators is able to handle the\nexception, it is handled by the default converter as described in the previous\nsection.\n\n.. seealso::\n\n    The file :file:`tests/test_exceptions.cpp` contains examples\n    of various custom exception translators and custom exception types.\n\n.. note::\n\n    Call either ``PyErr_SetString`` or a custom exception's call\n    operator (``exc(string)``) for every exception caught in a custom exception\n    translator.  Failure to do so will cause Python to crash with ``SystemError:\n    error return without exception set``.\n\n    Exceptions that you do not plan to handle should simply not be caught, or\n    may be explicitly (re-)thrown to delegate it to the other,\n    previously-declared existing exception translators.\n\n    Note that ``libc++`` and ``libstdc++`` `behave differently under macOS\n    <https://stackoverflow.com/questions/19496643/using-clang-fvisibility-hidden-and-typeinfo-and-type-erasure/28827430>`_\n    with ``-fvisibility=hidden``. Therefore exceptions that are used across ABI\n    boundaries need to be explicitly exported, as exercised in\n    ``tests/test_exceptions.h``. See also:\n    \"Problems with C++ exceptions\" under `GCC Wiki <https://gcc.gnu.org/wiki/Visibility>`_.\n\n\nLocal vs Global Exception Translators\n=====================================\n\nWhen a global exception translator is registered, it will be applied across all\nmodules in the reverse order of registration. This can create behavior where the\norder of module import influences how exceptions are translated.\n\nIf module1 has the following translator:\n\n.. code-block:: cpp\n\n      py::register_exception_translator([](std::exception_ptr p) {\n        try {\n            if (p) std::rethrow_exception(p);\n        } catch (const std::invalid_argument &e) {\n            PyErr_SetString(\"module1 handled this\")\n        }\n      }\n\nand module2 has the following similar translator:\n\n.. code-block:: cpp\n\n      py::register_exception_translator([](std::exception_ptr p) {\n        try {\n            if (p) std::rethrow_exception(p);\n        } catch (const std::invalid_argument &e) {\n            PyErr_SetString(\"module2 handled this\")\n        }\n      }\n\nthen which translator handles the invalid_argument will be determined by the\norder that module1 and module2 are imported. Since exception translators are\napplied in the reverse order of registration, which ever module was imported\nlast will \"win\" and that translator will be applied.\n\nIf there are multiple pybind11 modules that share exception types (either\nstandard built-in or custom) loaded into a single python instance and\nconsistent error handling behavior is needed, then local translators should be\nused.\n\nChanging the previous example to use ``register_local_exception_translator``\nwould mean that when invalid_argument is thrown in the module2 code, the\nmodule2 translator will always handle it, while in module1, the module1\ntranslator will do the same.\n\n.. _handling_python_exceptions_cpp:\n\nHandling exceptions from Python in C++\n======================================\n\nWhen C++ calls Python functions, such as in a callback function or when\nmanipulating Python objects, and Python raises an ``Exception``, pybind11\nconverts the Python exception into a C++ exception of type\n:class:`pybind11::error_already_set` whose payload contains a C++ string textual\nsummary and the actual Python exception. ``error_already_set`` is used to\npropagate Python exception back to Python (or possibly, handle them in C++).\n\n.. tabularcolumns:: |p{0.5\\textwidth}|p{0.45\\textwidth}|\n\n+--------------------------------------+--------------------------------------+\n|  Exception raised in Python          |  Thrown as C++ exception type        |\n+======================================+======================================+\n| Any Python ``Exception``             | :class:`pybind11::error_already_set` |\n+--------------------------------------+--------------------------------------+\n\nFor example:\n\n.. code-block:: cpp\n\n    try {\n        // open(\"missing.txt\", \"r\")\n        auto file = py::module_::import(\"io\").attr(\"open\")(\"missing.txt\", \"r\");\n        auto text = file.attr(\"read\")();\n        file.attr(\"close\")();\n    } catch (py::error_already_set &e) {\n        if (e.matches(PyExc_FileNotFoundError)) {\n            py::print(\"missing.txt not found\");\n        } else if (e.matches(PyExc_PermissionError)) {\n            py::print(\"missing.txt found but not accessible\");\n        } else {\n            throw;\n        }\n    }\n\nNote that C++ to Python exception translation does not apply here, since that is\na method for translating C++ exceptions to Python, not vice versa. The error raised\nfrom Python is always ``error_already_set``.\n\nThis example illustrates this behavior:\n\n.. code-block:: cpp\n\n    try {\n        py::eval(\"raise ValueError('The Ring')\");\n    } catch (py::value_error &boromir) {\n        // Boromir never gets the ring\n        assert(false);\n    } catch (py::error_already_set &frodo) {\n        // Frodo gets the ring\n        py::print(\"I will take the ring\");\n    }\n\n    try {\n        // py::value_error is a request for pybind11 to raise a Python exception\n        throw py::value_error(\"The ball\");\n    } catch (py::error_already_set &cat) {\n        // cat won't catch the ball since\n        // py::value_error is not a Python exception\n        assert(false);\n    } catch (py::value_error &dog) {\n        // dog will catch the ball\n        py::print(\"Run Spot run\");\n        throw;  // Throw it again (pybind11 will raise ValueError)\n    }\n\nHandling errors from the Python C API\n=====================================\n\nWhere possible, use :ref:`pybind11 wrappers <wrappers>` instead of calling\nthe Python C API directly. When calling the Python C API directly, in\naddition to manually managing reference counts, one must follow the pybind11\nerror protocol, which is outlined here.\n\nAfter calling the Python C API, if Python returns an error,\n``throw py::error_already_set();``, which allows pybind11 to deal with the\nexception and pass it back to the Python interpreter. This includes calls to\nthe error setting functions such as ``PyErr_SetString``.\n\n.. code-block:: cpp\n\n    PyErr_SetString(PyExc_TypeError, \"C API type error demo\");\n    throw py::error_already_set();\n\n    // But it would be easier to simply...\n    throw py::type_error(\"pybind11 wrapper type error\");\n\nAlternately, to ignore the error, call `PyErr_Clear\n<https://docs.python.org/3/c-api/exceptions.html#c.PyErr_Clear>`_.\n\nAny Python error must be thrown or cleared, or Python/pybind11 will be left in\nan invalid state.\n\nChaining exceptions ('raise from')\n==================================\n\nPython has a mechanism for indicating that exceptions were caused by other\nexceptions:\n\n.. code-block:: py\n\n    try:\n        print(1 / 0)\n    except Exception as exc:\n        raise RuntimeError(\"could not divide by zero\") from exc\n\nTo do a similar thing in pybind11, you can use the ``py::raise_from`` function. It\nsets the current python error indicator, so to continue propagating the exception\nyou should ``throw py::error_already_set()``.\n\n.. code-block:: cpp\n\n    try {\n        py::eval(\"print(1 / 0\"));\n    } catch (py::error_already_set &e) {\n        py::raise_from(e, PyExc_RuntimeError, \"could not divide by zero\");\n        throw py::error_already_set();\n    }\n\n.. versionadded:: 2.8\n\n.. _unraisable_exceptions:\n\nHandling unraisable exceptions\n==============================\n\nIf a Python function invoked from a C++ destructor or any function marked\n``noexcept(true)`` (collectively, \"noexcept functions\") throws an exception, there\nis no way to propagate the exception, as such functions may not throw.\nShould they throw or fail to catch any exceptions in their call graph,\nthe C++ runtime calls ``std::terminate()`` to abort immediately.\n\nSimilarly, Python exceptions raised in a class's ``__del__`` method do not\npropagate, but are logged by Python as an unraisable error. In Python 3.8+, a\n`system hook is triggered\n<https://docs.python.org/3/library/sys.html#sys.unraisablehook>`_\nand an auditing event is logged.\n\nAny noexcept function should have a try-catch block that traps\nclass:`error_already_set` (or any other exception that can occur). Note that\npybind11 wrappers around Python exceptions such as\n:class:`pybind11::value_error` are *not* Python exceptions; they are C++\nexceptions that pybind11 catches and converts to Python exceptions. Noexcept\nfunctions cannot propagate these exceptions either. A useful approach is to\nconvert them to Python exceptions and then ``discard_as_unraisable`` as shown\nbelow.\n\n.. code-block:: cpp\n\n    void nonthrowing_func() noexcept(true) {\n        try {\n            // ...\n        } catch (py::error_already_set &eas) {\n            // Discard the Python error using Python APIs, using the C++ magic\n            // variable __func__. Python already knows the type and value and of the\n            // exception object.\n            eas.discard_as_unraisable(__func__);\n        } catch (const std::exception &e) {\n            // Log and discard C++ exceptions.\n            third_party::log(e);\n        }\n    }\n\n.. versionadded:: 2.6\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/functions.rst",
    "content": "Functions\n#########\n\nBefore proceeding with this section, make sure that you are already familiar\nwith the basics of binding functions and classes, as explained in :doc:`/basics`\nand :doc:`/classes`. The following guide is applicable to both free and member\nfunctions, i.e. *methods* in Python.\n\n.. _return_value_policies:\n\nReturn value policies\n=====================\n\nPython and C++ use fundamentally different ways of managing the memory and\nlifetime of objects managed by them. This can lead to issues when creating\nbindings for functions that return a non-trivial type. Just by looking at the\ntype information, it is not clear whether Python should take charge of the\nreturned value and eventually free its resources, or if this is handled on the\nC++ side. For this reason, pybind11 provides a several *return value policy*\nannotations that can be passed to the :func:`module_::def` and\n:func:`class_::def` functions. The default policy is\n:enum:`return_value_policy::automatic`.\n\nReturn value policies are tricky, and it's very important to get them right.\nJust to illustrate what can go wrong, consider the following simple example:\n\n.. code-block:: cpp\n\n    /* Function declaration */\n    Data *get_data() { return _data; /* (pointer to a static data structure) */ }\n    ...\n\n    /* Binding code */\n    m.def(\"get_data\", &get_data); // <-- KABOOM, will cause crash when called from Python\n\nWhat's going on here? When ``get_data()`` is called from Python, the return\nvalue (a native C++ type) must be wrapped to turn it into a usable Python type.\nIn this case, the default return value policy (:enum:`return_value_policy::automatic`)\ncauses pybind11 to assume ownership of the static ``_data`` instance.\n\nWhen Python's garbage collector eventually deletes the Python\nwrapper, pybind11 will also attempt to delete the C++ instance (via ``operator\ndelete()``) due to the implied ownership. At this point, the entire application\nwill come crashing down, though errors could also be more subtle and involve\nsilent data corruption.\n\nIn the above example, the policy :enum:`return_value_policy::reference` should have\nbeen specified so that the global data instance is only *referenced* without any\nimplied transfer of ownership, i.e.:\n\n.. code-block:: cpp\n\n    m.def(\"get_data\", &get_data, py::return_value_policy::reference);\n\nOn the other hand, this is not the right policy for many other situations,\nwhere ignoring ownership could lead to resource leaks.\nAs a developer using pybind11, it's important to be familiar with the different\nreturn value policies, including which situation calls for which one of them.\nThe following table provides an overview of available policies:\n\n.. tabularcolumns:: |p{0.5\\textwidth}|p{0.45\\textwidth}|\n\n+--------------------------------------------------+----------------------------------------------------------------------------+\n| Return value policy                              | Description                                                                |\n+==================================================+============================================================================+\n| :enum:`return_value_policy::take_ownership`      | Reference an existing object (i.e. do not create a new copy) and take      |\n|                                                  | ownership. Python will call the destructor and delete operator when the    |\n|                                                  | object's reference count reaches zero. Undefined behavior ensues when the  |\n|                                                  | C++ side does the same, or when the data was not dynamically allocated.    |\n+--------------------------------------------------+----------------------------------------------------------------------------+\n| :enum:`return_value_policy::copy`                | Create a new copy of the returned object, which will be owned by Python.   |\n|                                                  | This policy is comparably safe because the lifetimes of the two instances  |\n|                                                  | are decoupled.                                                             |\n+--------------------------------------------------+----------------------------------------------------------------------------+\n| :enum:`return_value_policy::move`                | Use ``std::move`` to move the return value contents into a new instance    |\n|                                                  | that will be owned by Python. This policy is comparably safe because the   |\n|                                                  | lifetimes of the two instances (move source and destination) are decoupled.|\n+--------------------------------------------------+----------------------------------------------------------------------------+\n| :enum:`return_value_policy::reference`           | Reference an existing object, but do not take ownership. The C++ side is   |\n|                                                  | responsible for managing the object's lifetime and deallocating it when    |\n|                                                  | it is no longer used. Warning: undefined behavior will ensue when the C++  |\n|                                                  | side deletes an object that is still referenced and used by Python.        |\n+--------------------------------------------------+----------------------------------------------------------------------------+\n| :enum:`return_value_policy::reference_internal`  | Indicates that the lifetime of the return value is tied to the lifetime    |\n|                                                  | of a parent object, namely the implicit ``this``, or ``self`` argument of  |\n|                                                  | the called method or property. Internally, this policy works just like     |\n|                                                  | :enum:`return_value_policy::reference` but additionally applies a          |\n|                                                  | ``keep_alive<0, 1>`` *call policy* (described in the next section) that    |\n|                                                  | prevents the parent object from being garbage collected as long as the     |\n|                                                  | return value is referenced by Python. This is the default policy for       |\n|                                                  | property getters created via ``def_property``, ``def_readwrite``, etc.     |\n+--------------------------------------------------+----------------------------------------------------------------------------+\n| :enum:`return_value_policy::automatic`           | This policy falls back to the policy                                       |\n|                                                  | :enum:`return_value_policy::take_ownership` when the return value is a     |\n|                                                  | pointer. Otherwise, it uses :enum:`return_value_policy::move` or           |\n|                                                  | :enum:`return_value_policy::copy` for rvalue and lvalue references,        |\n|                                                  | respectively. See above for a description of what all of these different   |\n|                                                  | policies do. This is the default policy for ``py::class_``-wrapped types.  |\n+--------------------------------------------------+----------------------------------------------------------------------------+\n| :enum:`return_value_policy::automatic_reference` | As above, but use policy :enum:`return_value_policy::reference` when the   |\n|                                                  | return value is a pointer. This is the default conversion policy for       |\n|                                                  | function arguments when calling Python functions manually from C++ code    |\n|                                                  | (i.e. via ``handle::operator()``) and the casters in ``pybind11/stl.h``.   |\n|                                                  | You probably won't need to use this explicitly.                            |\n+--------------------------------------------------+----------------------------------------------------------------------------+\n\nReturn value policies can also be applied to properties:\n\n.. code-block:: cpp\n\n    class_<MyClass>(m, \"MyClass\")\n        .def_property(\"data\", &MyClass::getData, &MyClass::setData,\n                      py::return_value_policy::copy);\n\nTechnically, the code above applies the policy to both the getter and the\nsetter function, however, the setter doesn't really care about *return*\nvalue policies which makes this a convenient terse syntax. Alternatively,\ntargeted arguments can be passed through the :class:`cpp_function` constructor:\n\n.. code-block:: cpp\n\n    class_<MyClass>(m, \"MyClass\")\n        .def_property(\"data\",\n            py::cpp_function(&MyClass::getData, py::return_value_policy::copy),\n            py::cpp_function(&MyClass::setData)\n        );\n\n.. warning::\n\n    Code with invalid return value policies might access uninitialized memory or\n    free data structures multiple times, which can lead to hard-to-debug\n    non-determinism and segmentation faults, hence it is worth spending the\n    time to understand all the different options in the table above.\n\n.. note::\n\n    One important aspect of the above policies is that they only apply to\n    instances which pybind11 has *not* seen before, in which case the policy\n    clarifies essential questions about the return value's lifetime and\n    ownership.  When pybind11 knows the instance already (as identified by its\n    type and address in memory), it will return the existing Python object\n    wrapper rather than creating a new copy.\n\n.. note::\n\n    The next section on :ref:`call_policies` discusses *call policies* that can be\n    specified *in addition* to a return value policy from the list above. Call\n    policies indicate reference relationships that can involve both return values\n    and parameters of functions.\n\n.. note::\n\n   As an alternative to elaborate call policies and lifetime management logic,\n   consider using smart pointers (see the section on :ref:`smart_pointers` for\n   details). Smart pointers can tell whether an object is still referenced from\n   C++ or Python, which generally eliminates the kinds of inconsistencies that\n   can lead to crashes or undefined behavior. For functions returning smart\n   pointers, it is not necessary to specify a return value policy.\n\n.. _call_policies:\n\nAdditional call policies\n========================\n\nIn addition to the above return value policies, further *call policies* can be\nspecified to indicate dependencies between parameters or ensure a certain state\nfor the function call.\n\nKeep alive\n----------\n\nIn general, this policy is required when the C++ object is any kind of container\nand another object is being added to the container. ``keep_alive<Nurse, Patient>``\nindicates that the argument with index ``Patient`` should be kept alive at least\nuntil the argument with index ``Nurse`` is freed by the garbage collector. Argument\nindices start at one, while zero refers to the return value. For methods, index\n``1`` refers to the implicit ``this`` pointer, while regular arguments begin at\nindex ``2``. Arbitrarily many call policies can be specified. When a ``Nurse``\nwith value ``None`` is detected at runtime, the call policy does nothing.\n\nWhen the nurse is not a pybind11-registered type, the implementation internally\nrelies on the ability to create a *weak reference* to the nurse object. When\nthe nurse object is not a pybind11-registered type and does not support weak\nreferences, an exception will be thrown.\n\nIf you use an incorrect argument index, you will get a ``RuntimeError`` saying\n``Could not activate keep_alive!``. You should review the indices you're using.\n\nConsider the following example: here, the binding code for a list append\noperation ties the lifetime of the newly added element to the underlying\ncontainer:\n\n.. code-block:: cpp\n\n    py::class_<List>(m, \"List\")\n        .def(\"append\", &List::append, py::keep_alive<1, 2>());\n\nFor consistency, the argument indexing is identical for constructors. Index\n``1`` still refers to the implicit ``this`` pointer, i.e. the object which is\nbeing constructed. Index ``0`` refers to the return type which is presumed to\nbe ``void`` when a constructor is viewed like a function. The following example\nties the lifetime of the constructor element to the constructed object:\n\n.. code-block:: cpp\n\n    py::class_<Nurse>(m, \"Nurse\")\n        .def(py::init<Patient &>(), py::keep_alive<1, 2>());\n\n.. note::\n\n    ``keep_alive`` is analogous to the ``with_custodian_and_ward`` (if Nurse,\n    Patient != 0) and ``with_custodian_and_ward_postcall`` (if Nurse/Patient ==\n    0) policies from Boost.Python.\n\nCall guard\n----------\n\nThe ``call_guard<T>`` policy allows any scope guard type ``T`` to be placed\naround the function call. For example, this definition:\n\n.. code-block:: cpp\n\n    m.def(\"foo\", foo, py::call_guard<T>());\n\nis equivalent to the following pseudocode:\n\n.. code-block:: cpp\n\n    m.def(\"foo\", [](args...) {\n        T scope_guard;\n        return foo(args...); // forwarded arguments\n    });\n\nThe only requirement is that ``T`` is default-constructible, but otherwise any\nscope guard will work. This is very useful in combination with ``gil_scoped_release``.\nSee :ref:`gil`.\n\nMultiple guards can also be specified as ``py::call_guard<T1, T2, T3...>``. The\nconstructor order is left to right and destruction happens in reverse.\n\n.. seealso::\n\n    The file :file:`tests/test_call_policies.cpp` contains a complete example\n    that demonstrates using `keep_alive` and `call_guard` in more detail.\n\n.. _python_objects_as_args:\n\nPython objects as arguments\n===========================\n\npybind11 exposes all major Python types using thin C++ wrapper classes. These\nwrapper classes can also be used as parameters of functions in bindings, which\nmakes it possible to directly work with native Python types on the C++ side.\nFor instance, the following statement iterates over a Python ``dict``:\n\n.. code-block:: cpp\n\n    void print_dict(const py::dict& dict) {\n        /* Easily interact with Python types */\n        for (auto item : dict)\n            std::cout << \"key=\" << std::string(py::str(item.first)) << \", \"\n                      << \"value=\" << std::string(py::str(item.second)) << std::endl;\n    }\n\nIt can be exported:\n\n.. code-block:: cpp\n\n    m.def(\"print_dict\", &print_dict);\n\nAnd used in Python as usual:\n\n.. code-block:: pycon\n\n    >>> print_dict({\"foo\": 123, \"bar\": \"hello\"})\n    key=foo, value=123\n    key=bar, value=hello\n\nFor more information on using Python objects in C++, see :doc:`/advanced/pycpp/index`.\n\nAccepting \\*args and \\*\\*kwargs\n===============================\n\nPython provides a useful mechanism to define functions that accept arbitrary\nnumbers of arguments and keyword arguments:\n\n.. code-block:: python\n\n   def generic(*args, **kwargs):\n       ...  # do something with args and kwargs\n\nSuch functions can also be created using pybind11:\n\n.. code-block:: cpp\n\n   void generic(py::args args, const py::kwargs& kwargs) {\n       /// .. do something with args\n       if (kwargs)\n           /// .. do something with kwargs\n   }\n\n   /// Binding code\n   m.def(\"generic\", &generic);\n\nThe class ``py::args`` derives from ``py::tuple`` and ``py::kwargs`` derives\nfrom ``py::dict``.\n\nYou may also use just one or the other, and may combine these with other\narguments.  Note, however, that ``py::kwargs`` must always be the last argument\nof the function, and ``py::args`` implies that any further arguments are\nkeyword-only (see :ref:`keyword_only_arguments`).\n\nPlease refer to the other examples for details on how to iterate over these,\nand on how to cast their entries into C++ objects. A demonstration is also\navailable in ``tests/test_kwargs_and_defaults.cpp``.\n\n.. note::\n\n    When combining \\*args or \\*\\*kwargs with :ref:`keyword_args` you should\n    *not* include ``py::arg`` tags for the ``py::args`` and ``py::kwargs``\n    arguments.\n\nDefault arguments revisited\n===========================\n\nThe section on :ref:`default_args` previously discussed basic usage of default\narguments using pybind11. One noteworthy aspect of their implementation is that\ndefault arguments are converted to Python objects right at declaration time.\nConsider the following example:\n\n.. code-block:: cpp\n\n    py::class_<MyClass>(\"MyClass\")\n        .def(\"myFunction\", py::arg(\"arg\") = SomeType(123));\n\nIn this case, pybind11 must already be set up to deal with values of the type\n``SomeType`` (via a prior instantiation of ``py::class_<SomeType>``), or an\nexception will be thrown.\n\nAnother aspect worth highlighting is that the \"preview\" of the default argument\nin the function signature is generated using the object's ``__repr__`` method.\nIf not available, the signature may not be very helpful, e.g.:\n\n.. code-block:: pycon\n\n    FUNCTIONS\n    ...\n    |  myFunction(...)\n    |      Signature : (MyClass, arg : SomeType = <SomeType object at 0x101b7b080>) -> NoneType\n    ...\n\nThe first way of addressing this is by defining ``SomeType.__repr__``.\nAlternatively, it is possible to specify the human-readable preview of the\ndefault argument manually using the ``arg_v`` notation:\n\n.. code-block:: cpp\n\n    py::class_<MyClass>(\"MyClass\")\n        .def(\"myFunction\", py::arg_v(\"arg\", SomeType(123), \"SomeType(123)\"));\n\nSometimes it may be necessary to pass a null pointer value as a default\nargument. In this case, remember to cast it to the underlying type in question,\nlike so:\n\n.. code-block:: cpp\n\n    py::class_<MyClass>(\"MyClass\")\n        .def(\"myFunction\", py::arg(\"arg\") = static_cast<SomeType *>(nullptr));\n\n.. _keyword_only_arguments:\n\nKeyword-only arguments\n======================\n\nPython implements keyword-only arguments by specifying an unnamed ``*``\nargument in a function definition:\n\n.. code-block:: python\n\n    def f(a, *, b):  # a can be positional or via keyword; b must be via keyword\n        pass\n\n\n    f(a=1, b=2)  # good\n    f(b=2, a=1)  # good\n    f(1, b=2)  # good\n    f(1, 2)  # TypeError: f() takes 1 positional argument but 2 were given\n\nPybind11 provides a ``py::kw_only`` object that allows you to implement\nthe same behaviour by specifying the object between positional and keyword-only\nargument annotations when registering the function:\n\n.. code-block:: cpp\n\n    m.def(\"f\", [](int a, int b) { /* ... */ },\n          py::arg(\"a\"), py::kw_only(), py::arg(\"b\"));\n\n.. versionadded:: 2.6\n\nA ``py::args`` argument implies that any following arguments are keyword-only,\nas if ``py::kw_only()`` had been specified in the same relative location of the\nargument list as the ``py::args`` argument.  The ``py::kw_only()`` may be\nincluded to be explicit about this, but is not required.\n\n.. versionchanged:: 2.9\n   This can now be combined with ``py::args``. Before, ``py::args`` could only\n   occur at the end of the argument list, or immediately before a ``py::kwargs``\n   argument at the end.\n\n\nPositional-only arguments\n=========================\n\nPython 3.8 introduced a new positional-only argument syntax, using ``/`` in the\nfunction definition (note that this has been a convention for CPython\npositional arguments, such as in ``pow()``, since Python 2). You can\ndo the same thing in any version of Python using ``py::pos_only()``:\n\n.. code-block:: cpp\n\n   m.def(\"f\", [](int a, int b) { /* ... */ },\n          py::arg(\"a\"), py::pos_only(), py::arg(\"b\"));\n\nYou now cannot give argument ``a`` by keyword. This can be combined with\nkeyword-only arguments, as well.\n\n.. versionadded:: 2.6\n\n.. _nonconverting_arguments:\n\nNon-converting arguments\n========================\n\nCertain argument types may support conversion from one type to another.  Some\nexamples of conversions are:\n\n* :ref:`implicit_conversions` declared using ``py::implicitly_convertible<A,B>()``\n* Calling a method accepting a double with an integer argument\n* Calling a ``std::complex<float>`` argument with a non-complex python type\n  (for example, with a float).  (Requires the optional ``pybind11/complex.h``\n  header).\n* Calling a function taking an Eigen matrix reference with a numpy array of the\n  wrong type or of an incompatible data layout.  (Requires the optional\n  ``pybind11/eigen.h`` header).\n\nThis behaviour is sometimes undesirable: the binding code may prefer to raise\nan error rather than convert the argument.  This behaviour can be obtained\nthrough ``py::arg`` by calling the ``.noconvert()`` method of the ``py::arg``\nobject, such as:\n\n.. code-block:: cpp\n\n    m.def(\"floats_only\", [](double f) { return 0.5 * f; }, py::arg(\"f\").noconvert());\n    m.def(\"floats_preferred\", [](double f) { return 0.5 * f; }, py::arg(\"f\"));\n\nAttempting the call the second function (the one without ``.noconvert()``) with\nan integer will succeed, but attempting to call the ``.noconvert()`` version\nwill fail with a ``TypeError``:\n\n.. code-block:: pycon\n\n    >>> floats_preferred(4)\n    2.0\n    >>> floats_only(4)\n    Traceback (most recent call last):\n      File \"<stdin>\", line 1, in <module>\n    TypeError: floats_only(): incompatible function arguments. The following argument types are supported:\n        1. (f: float) -> float\n\n    Invoked with: 4\n\nYou may, of course, combine this with the :var:`_a` shorthand notation (see\n:ref:`keyword_args`) and/or :ref:`default_args`.  It is also permitted to omit\nthe argument name by using the ``py::arg()`` constructor without an argument\nname, i.e. by specifying ``py::arg().noconvert()``.\n\n.. note::\n\n    When specifying ``py::arg`` options it is necessary to provide the same\n    number of options as the bound function has arguments.  Thus if you want to\n    enable no-convert behaviour for just one of several arguments, you will\n    need to specify a ``py::arg()`` annotation for each argument with the\n    no-convert argument modified to ``py::arg().noconvert()``.\n\n.. _none_arguments:\n\nAllow/Prohibiting None arguments\n================================\n\nWhen a C++ type registered with :class:`py::class_` is passed as an argument to\na function taking the instance as pointer or shared holder (e.g. ``shared_ptr``\nor a custom, copyable holder as described in :ref:`smart_pointers`), pybind\nallows ``None`` to be passed from Python which results in calling the C++\nfunction with ``nullptr`` (or an empty holder) for the argument.\n\nTo explicitly enable or disable this behaviour, using the\n``.none`` method of the :class:`py::arg` object:\n\n.. code-block:: cpp\n\n    py::class_<Dog>(m, \"Dog\").def(py::init<>());\n    py::class_<Cat>(m, \"Cat\").def(py::init<>());\n    m.def(\"bark\", [](Dog *dog) -> std::string {\n        if (dog) return \"woof!\"; /* Called with a Dog instance */\n        else return \"(no dog)\"; /* Called with None, dog == nullptr */\n    }, py::arg(\"dog\").none(true));\n    m.def(\"meow\", [](Cat *cat) -> std::string {\n        // Can't be called with None argument\n        return \"meow\";\n    }, py::arg(\"cat\").none(false));\n\nWith the above, the Python call ``bark(None)`` will return the string ``\"(no\ndog)\"``, while attempting to call ``meow(None)`` will raise a ``TypeError``:\n\n.. code-block:: pycon\n\n    >>> from animals import Dog, Cat, bark, meow\n    >>> bark(Dog())\n    'woof!'\n    >>> meow(Cat())\n    'meow'\n    >>> bark(None)\n    '(no dog)'\n    >>> meow(None)\n    Traceback (most recent call last):\n      File \"<stdin>\", line 1, in <module>\n    TypeError: meow(): incompatible function arguments. The following argument types are supported:\n        1. (cat: animals.Cat) -> str\n\n    Invoked with: None\n\nThe default behaviour when the tag is unspecified is to allow ``None``.\n\n.. note::\n\n    Even when ``.none(true)`` is specified for an argument, ``None`` will be converted to a\n    ``nullptr`` *only* for custom and :ref:`opaque <opaque>` types. Pointers to built-in types\n    (``double *``, ``int *``, ...) and STL types (``std::vector<T> *``, ...; if ``pybind11/stl.h``\n    is included) are copied when converted to C++ (see :doc:`/advanced/cast/overview`) and will\n    not allow ``None`` as argument.  To pass optional argument of these copied types consider\n    using ``std::optional<T>``\n\n.. _overload_resolution:\n\nOverload resolution order\n=========================\n\nWhen a function or method with multiple overloads is called from Python,\npybind11 determines which overload to call in two passes.  The first pass\nattempts to call each overload without allowing argument conversion (as if\nevery argument had been specified as ``py::arg().noconvert()`` as described\nabove).\n\nIf no overload succeeds in the no-conversion first pass, a second pass is\nattempted in which argument conversion is allowed (except where prohibited via\nan explicit ``py::arg().noconvert()`` attribute in the function definition).\n\nIf the second pass also fails a ``TypeError`` is raised.\n\nWithin each pass, overloads are tried in the order they were registered with\npybind11. If the ``py::prepend()`` tag is added to the definition, a function\ncan be placed at the beginning of the overload sequence instead, allowing user\noverloads to proceed built in functions.\n\nWhat this means in practice is that pybind11 will prefer any overload that does\nnot require conversion of arguments to an overload that does, but otherwise\nprefers earlier-defined overloads to later-defined ones.\n\n.. note::\n\n    pybind11 does *not* further prioritize based on the number/pattern of\n    overloaded arguments.  That is, pybind11 does not prioritize a function\n    requiring one conversion over one requiring three, but only prioritizes\n    overloads requiring no conversion at all to overloads that require\n    conversion of at least one argument.\n\n.. versionadded:: 2.6\n\n    The ``py::prepend()`` tag.\n\nBinding functions with template parameters\n==========================================\n\nYou can bind functions that have template parameters. Here's a function:\n\n.. code-block:: cpp\n\n    template <typename T>\n    void set(T t);\n\nC++ templates cannot be instantiated at runtime, so you cannot bind the\nnon-instantiated function:\n\n.. code-block:: cpp\n\n    // BROKEN (this will not compile)\n    m.def(\"set\", &set);\n\nYou must bind each instantiated function template separately. You may bind\neach instantiation with the same name, which will be treated the same as\nan overloaded function:\n\n.. code-block:: cpp\n\n    m.def(\"set\", &set<int>);\n    m.def(\"set\", &set<std::string>);\n\nSometimes it's more clear to bind them with separate names, which is also\nan option:\n\n.. code-block:: cpp\n\n    m.def(\"setInt\", &set<int>);\n    m.def(\"setString\", &set<std::string>);\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/misc.rst",
    "content": "Miscellaneous\n#############\n\n.. _macro_notes:\n\nGeneral notes regarding convenience macros\n==========================================\n\npybind11 provides a few convenience macros such as\n:func:`PYBIND11_DECLARE_HOLDER_TYPE` and ``PYBIND11_OVERRIDE_*``. Since these\nare \"just\" macros that are evaluated in the preprocessor (which has no concept\nof types), they *will* get confused by commas in a template argument; for\nexample, consider:\n\n.. code-block:: cpp\n\n    PYBIND11_OVERRIDE(MyReturnType<T1, T2>, Class<T3, T4>, func)\n\nThe limitation of the C preprocessor interprets this as five arguments (with new\narguments beginning after each comma) rather than three.  To get around this,\nthere are two alternatives: you can use a type alias, or you can wrap the type\nusing the ``PYBIND11_TYPE`` macro:\n\n.. code-block:: cpp\n\n    // Version 1: using a type alias\n    using ReturnType = MyReturnType<T1, T2>;\n    using ClassType = Class<T3, T4>;\n    PYBIND11_OVERRIDE(ReturnType, ClassType, func);\n\n    // Version 2: using the PYBIND11_TYPE macro:\n    PYBIND11_OVERRIDE(PYBIND11_TYPE(MyReturnType<T1, T2>),\n                      PYBIND11_TYPE(Class<T3, T4>), func)\n\nThe ``PYBIND11_MAKE_OPAQUE`` macro does *not* require the above workarounds.\n\n.. _gil:\n\nGlobal Interpreter Lock (GIL)\n=============================\n\nThe Python C API dictates that the Global Interpreter Lock (GIL) must always\nbe held by the current thread to safely access Python objects. As a result,\nwhen Python calls into C++ via pybind11 the GIL must be held, and pybind11\nwill never implicitly release the GIL.\n\n.. code-block:: cpp\n\n    void my_function() {\n        /* GIL is held when this function is called from Python */\n    }\n\n    PYBIND11_MODULE(example, m) {\n        m.def(\"my_function\", &my_function);\n    }\n\npybind11 will ensure that the GIL is held when it knows that it is calling\nPython code. For example, if a Python callback is passed to C++ code via\n``std::function``, when C++ code calls the function the built-in wrapper\nwill acquire the GIL before calling the Python callback. Similarly, the\n``PYBIND11_OVERRIDE`` family of macros will acquire the GIL before calling\nback into Python.\n\nWhen writing C++ code that is called from other C++ code, if that code accesses\nPython state, it must explicitly acquire and release the GIL.\n\nThe classes :class:`gil_scoped_release` and :class:`gil_scoped_acquire` can be\nused to acquire and release the global interpreter lock in the body of a C++\nfunction call. In this way, long-running C++ code can be parallelized using\nmultiple Python threads, **but great care must be taken** when any\n:class:`gil_scoped_release` appear: if there is any way that the C++ code\ncan access Python objects, :class:`gil_scoped_acquire` should be used to\nreacquire the GIL. Taking :ref:`overriding_virtuals` as an example, this\ncould be realized as follows (important changes highlighted):\n\n.. code-block:: cpp\n    :emphasize-lines: 8,30,31\n\n    class PyAnimal : public Animal {\n    public:\n        /* Inherit the constructors */\n        using Animal::Animal;\n\n        /* Trampoline (need one for each virtual function) */\n        std::string go(int n_times) {\n            /* PYBIND11_OVERRIDE_PURE will acquire the GIL before accessing Python state */\n            PYBIND11_OVERRIDE_PURE(\n                std::string, /* Return type */\n                Animal,      /* Parent class */\n                go,          /* Name of function */\n                n_times      /* Argument(s) */\n            );\n        }\n    };\n\n    PYBIND11_MODULE(example, m) {\n        py::class_<Animal, PyAnimal> animal(m, \"Animal\");\n        animal\n            .def(py::init<>())\n            .def(\"go\", &Animal::go);\n\n        py::class_<Dog>(m, \"Dog\", animal)\n            .def(py::init<>());\n\n        m.def(\"call_go\", [](Animal *animal) -> std::string {\n            // GIL is held when called from Python code. Release GIL before\n            // calling into (potentially long-running) C++ code\n            py::gil_scoped_release release;\n            return call_go(animal);\n        });\n    }\n\nThe ``call_go`` wrapper can also be simplified using the ``call_guard`` policy\n(see :ref:`call_policies`) which yields the same result:\n\n.. code-block:: cpp\n\n    m.def(\"call_go\", &call_go, py::call_guard<py::gil_scoped_release>());\n\n\nCommon Sources Of Global Interpreter Lock Errors\n==================================================================\n\nFailing to properly hold the Global Interpreter Lock (GIL) is one of the\nmore common sources of bugs within code that uses pybind11. If you are\nrunning into GIL related errors, we highly recommend you consult the\nfollowing checklist.\n\n- Do you have any global variables that are pybind11 objects or invoke\n  pybind11 functions in either their constructor or destructor? You are generally\n  not allowed to invoke any Python function in a global static context. We recommend\n  using lazy initialization and then intentionally leaking at the end of the program.\n\n- Do you have any pybind11 objects that are members of other C++ structures? One\n  commonly overlooked requirement is that pybind11 objects have to increase their reference count\n  whenever their copy constructor is called. Thus, you need to be holding the GIL to invoke\n  the copy constructor of any C++ class that has a pybind11 member. This can sometimes be very\n  tricky to track for complicated programs Think carefully when you make a pybind11 object\n  a member in another struct.\n\n- C++ destructors that invoke Python functions can be particularly troublesome as\n  destructors can sometimes get invoked in weird and unexpected circumstances as a result\n  of exceptions.\n\n- You should try running your code in a debug build. That will enable additional assertions\n  within pybind11 that will throw exceptions on certain GIL handling errors\n  (reference counting operations).\n\nBinding sequence data types, iterators, the slicing protocol, etc.\n==================================================================\n\nPlease refer to the supplemental example for details.\n\n.. seealso::\n\n    The file :file:`tests/test_sequences_and_iterators.cpp` contains a\n    complete example that shows how to bind a sequence data type, including\n    length queries (``__len__``), iterators (``__iter__``), the slicing\n    protocol and other kinds of useful operations.\n\n\nPartitioning code over multiple extension modules\n=================================================\n\nIt's straightforward to split binding code over multiple extension modules,\nwhile referencing types that are declared elsewhere. Everything \"just\" works\nwithout any special precautions. One exception to this rule occurs when\nextending a type declared in another extension module. Recall the basic example\nfrom Section :ref:`inheritance`.\n\n.. code-block:: cpp\n\n    py::class_<Pet> pet(m, \"Pet\");\n    pet.def(py::init<const std::string &>())\n       .def_readwrite(\"name\", &Pet::name);\n\n    py::class_<Dog>(m, \"Dog\", pet /* <- specify parent */)\n        .def(py::init<const std::string &>())\n        .def(\"bark\", &Dog::bark);\n\nSuppose now that ``Pet`` bindings are defined in a module named ``basic``,\nwhereas the ``Dog`` bindings are defined somewhere else. The challenge is of\ncourse that the variable ``pet`` is not available anymore though it is needed\nto indicate the inheritance relationship to the constructor of ``class_<Dog>``.\nHowever, it can be acquired as follows:\n\n.. code-block:: cpp\n\n    py::object pet = (py::object) py::module_::import(\"basic\").attr(\"Pet\");\n\n    py::class_<Dog>(m, \"Dog\", pet)\n        .def(py::init<const std::string &>())\n        .def(\"bark\", &Dog::bark);\n\nAlternatively, you can specify the base class as a template parameter option to\n``class_``, which performs an automated lookup of the corresponding Python\ntype. Like the above code, however, this also requires invoking the ``import``\nfunction once to ensure that the pybind11 binding code of the module ``basic``\nhas been executed:\n\n.. code-block:: cpp\n\n    py::module_::import(\"basic\");\n\n    py::class_<Dog, Pet>(m, \"Dog\")\n        .def(py::init<const std::string &>())\n        .def(\"bark\", &Dog::bark);\n\nNaturally, both methods will fail when there are cyclic dependencies.\n\nNote that pybind11 code compiled with hidden-by-default symbol visibility (e.g.\nvia the command line flag ``-fvisibility=hidden`` on GCC/Clang), which is\nrequired for proper pybind11 functionality, can interfere with the ability to\naccess types defined in another extension module.  Working around this requires\nmanually exporting types that are accessed by multiple extension modules;\npybind11 provides a macro to do just this:\n\n.. code-block:: cpp\n\n    class PYBIND11_EXPORT Dog : public Animal {\n        ...\n    };\n\nNote also that it is possible (although would rarely be required) to share arbitrary\nC++ objects between extension modules at runtime. Internal library data is shared\nbetween modules using capsule machinery [#f6]_ which can be also utilized for\nstoring, modifying and accessing user-defined data. Note that an extension module\nwill \"see\" other extensions' data if and only if they were built with the same\npybind11 version. Consider the following example:\n\n.. code-block:: cpp\n\n    auto data = reinterpret_cast<MyData *>(py::get_shared_data(\"mydata\"));\n    if (!data)\n        data = static_cast<MyData *>(py::set_shared_data(\"mydata\", new MyData(42)));\n\nIf the above snippet was used in several separately compiled extension modules,\nthe first one to be imported would create a ``MyData`` instance and associate\na ``\"mydata\"`` key with a pointer to it. Extensions that are imported later\nwould be then able to access the data behind the same pointer.\n\n.. [#f6] https://docs.python.org/3/extending/extending.html#using-capsules\n\nModule Destructors\n==================\n\npybind11 does not provide an explicit mechanism to invoke cleanup code at\nmodule destruction time. In rare cases where such functionality is required, it\nis possible to emulate it using Python capsules or weak references with a\ndestruction callback.\n\n.. code-block:: cpp\n\n    auto cleanup_callback = []() {\n        // perform cleanup here -- this function is called with the GIL held\n    };\n\n    m.add_object(\"_cleanup\", py::capsule(cleanup_callback));\n\nThis approach has the potential downside that instances of classes exposed\nwithin the module may still be alive when the cleanup callback is invoked\n(whether this is acceptable will generally depend on the application).\n\nAlternatively, the capsule may also be stashed within a type object, which\nensures that it not called before all instances of that type have been\ncollected:\n\n.. code-block:: cpp\n\n    auto cleanup_callback = []() { /* ... */ };\n    m.attr(\"BaseClass\").attr(\"_cleanup\") = py::capsule(cleanup_callback);\n\nBoth approaches also expose a potentially dangerous ``_cleanup`` attribute in\nPython, which may be undesirable from an API standpoint (a premature explicit\ncall from Python might lead to undefined behavior). Yet another approach that\navoids this issue involves weak reference with a cleanup callback:\n\n.. code-block:: cpp\n\n    // Register a callback function that is invoked when the BaseClass object is collected\n    py::cpp_function cleanup_callback(\n        [](py::handle weakref) {\n            // perform cleanup here -- this function is called with the GIL held\n\n            weakref.dec_ref(); // release weak reference\n        }\n    );\n\n    // Create a weak reference with a cleanup callback and initially leak it\n    (void) py::weakref(m.attr(\"BaseClass\"), cleanup_callback).release();\n\n.. note::\n\n    PyPy does not garbage collect objects when the interpreter exits. An alternative\n    approach (which also works on CPython) is to use the :py:mod:`atexit` module [#f7]_,\n    for example:\n\n    .. code-block:: cpp\n\n        auto atexit = py::module_::import(\"atexit\");\n        atexit.attr(\"register\")(py::cpp_function([]() {\n            // perform cleanup here -- this function is called with the GIL held\n        }));\n\n    .. [#f7] https://docs.python.org/3/library/atexit.html\n\n\nGenerating documentation using Sphinx\n=====================================\n\nSphinx [#f4]_ has the ability to inspect the signatures and documentation\nstrings in pybind11-based extension modules to automatically generate beautiful\ndocumentation in a variety formats. The python_example repository [#f5]_ contains a\nsimple example repository which uses this approach.\n\nThere are two potential gotchas when using this approach: first, make sure that\nthe resulting strings do not contain any :kbd:`TAB` characters, which break the\ndocstring parsing routines. You may want to use C++11 raw string literals,\nwhich are convenient for multi-line comments. Conveniently, any excess\nindentation will be automatically be removed by Sphinx. However, for this to\nwork, it is important that all lines are indented consistently, i.e.:\n\n.. code-block:: cpp\n\n    // ok\n    m.def(\"foo\", &foo, R\"mydelimiter(\n        The foo function\n\n        Parameters\n        ----------\n    )mydelimiter\");\n\n    // *not ok*\n    m.def(\"foo\", &foo, R\"mydelimiter(The foo function\n\n        Parameters\n        ----------\n    )mydelimiter\");\n\nBy default, pybind11 automatically generates and prepends a signature to the docstring of a function\nregistered with ``module_::def()`` and ``class_::def()``. Sometimes this\nbehavior is not desirable, because you want to provide your own signature or remove\nthe docstring completely to exclude the function from the Sphinx documentation.\nThe class ``options`` allows you to selectively suppress auto-generated signatures:\n\n.. code-block:: cpp\n\n    PYBIND11_MODULE(example, m) {\n        py::options options;\n        options.disable_function_signatures();\n\n        m.def(\"add\", [](int a, int b) { return a + b; }, \"A function which adds two numbers\");\n    }\n\npybind11 also appends all members of an enum to the resulting enum docstring.\nThis default behavior can be disabled by using the ``disable_enum_members_docstring()``\nfunction of the ``options`` class.\n\nWith ``disable_user_defined_docstrings()`` all user defined docstrings of\n``module_::def()``, ``class_::def()`` and ``enum_()`` are disabled, but the\nfunction signatures and enum members are included in the docstring, unless they\nare disabled separately.\n\nNote that changes to the settings affect only function bindings created during the\nlifetime of the ``options`` instance. When it goes out of scope at the end of the module's init function,\nthe default settings are restored to prevent unwanted side effects.\n\n.. [#f4] http://www.sphinx-doc.org\n.. [#f5] http://github.com/pybind/python_example\n\n.. _avoiding-cpp-types-in-docstrings:\n\nAvoiding C++ types in docstrings\n================================\n\nDocstrings are generated at the time of the declaration, e.g. when ``.def(...)`` is called.\nAt this point parameter and return types should be known to pybind11.\nIf a custom type is not exposed yet through a ``py::class_`` constructor or a custom type caster,\nits C++ type name will be used instead to generate the signature in the docstring:\n\n.. code-block:: text\n\n     |  __init__(...)\n     |      __init__(self: example.Foo, arg0: ns::Bar) -> None\n                                              ^^^^^^^\n\n\nThis limitation can be circumvented by ensuring that C++ classes are registered with pybind11\nbefore they are used as a parameter or return type of a function:\n\n.. code-block:: cpp\n\n    PYBIND11_MODULE(example, m) {\n\n        auto pyFoo = py::class_<ns::Foo>(m, \"Foo\");\n        auto pyBar = py::class_<ns::Bar>(m, \"Bar\");\n\n        pyFoo.def(py::init<const ns::Bar&>());\n        pyBar.def(py::init<const ns::Foo&>());\n    }\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/pycpp/index.rst",
    "content": "Python C++ interface\n####################\n\npybind11 exposes Python types and functions using thin C++ wrappers, which\nmakes it possible to conveniently call Python code from C++ without resorting\nto Python's C API.\n\n.. toctree::\n   :maxdepth: 2\n\n   object\n   numpy\n   utilities\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/pycpp/numpy.rst",
    "content": ".. _numpy:\n\nNumPy\n#####\n\nBuffer protocol\n===============\n\nPython supports an extremely general and convenient approach for exchanging\ndata between plugin libraries. Types can expose a buffer view [#f2]_, which\nprovides fast direct access to the raw internal data representation. Suppose we\nwant to bind the following simplistic Matrix class:\n\n.. code-block:: cpp\n\n    class Matrix {\n    public:\n        Matrix(size_t rows, size_t cols) : m_rows(rows), m_cols(cols) {\n            m_data = new float[rows*cols];\n        }\n        float *data() { return m_data; }\n        size_t rows() const { return m_rows; }\n        size_t cols() const { return m_cols; }\n    private:\n        size_t m_rows, m_cols;\n        float *m_data;\n    };\n\nThe following binding code exposes the ``Matrix`` contents as a buffer object,\nmaking it possible to cast Matrices into NumPy arrays. It is even possible to\ncompletely avoid copy operations with Python expressions like\n``np.array(matrix_instance, copy = False)``.\n\n.. code-block:: cpp\n\n    py::class_<Matrix>(m, \"Matrix\", py::buffer_protocol())\n       .def_buffer([](Matrix &m) -> py::buffer_info {\n            return py::buffer_info(\n                m.data(),                               /* Pointer to buffer */\n                sizeof(float),                          /* Size of one scalar */\n                py::format_descriptor<float>::format(), /* Python struct-style format descriptor */\n                2,                                      /* Number of dimensions */\n                { m.rows(), m.cols() },                 /* Buffer dimensions */\n                { sizeof(float) * m.cols(),             /* Strides (in bytes) for each index */\n                  sizeof(float) }\n            );\n        });\n\nSupporting the buffer protocol in a new type involves specifying the special\n``py::buffer_protocol()`` tag in the ``py::class_`` constructor and calling the\n``def_buffer()`` method with a lambda function that creates a\n``py::buffer_info`` description record on demand describing a given matrix\ninstance. The contents of ``py::buffer_info`` mirror the Python buffer protocol\nspecification.\n\n.. code-block:: cpp\n\n    struct buffer_info {\n        void *ptr;\n        py::ssize_t itemsize;\n        std::string format;\n        py::ssize_t ndim;\n        std::vector<py::ssize_t> shape;\n        std::vector<py::ssize_t> strides;\n    };\n\nTo create a C++ function that can take a Python buffer object as an argument,\nsimply use the type ``py::buffer`` as one of its arguments. Buffers can exist\nin a great variety of configurations, hence some safety checks are usually\nnecessary in the function body. Below, you can see a basic example on how to\ndefine a custom constructor for the Eigen double precision matrix\n(``Eigen::MatrixXd``) type, which supports initialization from compatible\nbuffer objects (e.g. a NumPy matrix).\n\n.. code-block:: cpp\n\n    /* Bind MatrixXd (or some other Eigen type) to Python */\n    typedef Eigen::MatrixXd Matrix;\n\n    typedef Matrix::Scalar Scalar;\n    constexpr bool rowMajor = Matrix::Flags & Eigen::RowMajorBit;\n\n    py::class_<Matrix>(m, \"Matrix\", py::buffer_protocol())\n        .def(py::init([](py::buffer b) {\n            typedef Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic> Strides;\n\n            /* Request a buffer descriptor from Python */\n            py::buffer_info info = b.request();\n\n            /* Some basic validation checks ... */\n            if (info.format != py::format_descriptor<Scalar>::format())\n                throw std::runtime_error(\"Incompatible format: expected a double array!\");\n\n            if (info.ndim != 2)\n                throw std::runtime_error(\"Incompatible buffer dimension!\");\n\n            auto strides = Strides(\n                info.strides[rowMajor ? 0 : 1] / (py::ssize_t)sizeof(Scalar),\n                info.strides[rowMajor ? 1 : 0] / (py::ssize_t)sizeof(Scalar));\n\n            auto map = Eigen::Map<Matrix, 0, Strides>(\n                static_cast<Scalar *>(info.ptr), info.shape[0], info.shape[1], strides);\n\n            return Matrix(map);\n        }));\n\nFor reference, the ``def_buffer()`` call for this Eigen data type should look\nas follows:\n\n.. code-block:: cpp\n\n    .def_buffer([](Matrix &m) -> py::buffer_info {\n        return py::buffer_info(\n            m.data(),                                /* Pointer to buffer */\n            sizeof(Scalar),                          /* Size of one scalar */\n            py::format_descriptor<Scalar>::format(), /* Python struct-style format descriptor */\n            2,                                       /* Number of dimensions */\n            { m.rows(), m.cols() },                  /* Buffer dimensions */\n            { sizeof(Scalar) * (rowMajor ? m.cols() : 1),\n              sizeof(Scalar) * (rowMajor ? 1 : m.rows()) }\n                                                     /* Strides (in bytes) for each index */\n        );\n     })\n\nFor a much easier approach of binding Eigen types (although with some\nlimitations), refer to the section on :doc:`/advanced/cast/eigen`.\n\n.. seealso::\n\n    The file :file:`tests/test_buffers.cpp` contains a complete example\n    that demonstrates using the buffer protocol with pybind11 in more detail.\n\n.. [#f2] http://docs.python.org/3/c-api/buffer.html\n\nArrays\n======\n\nBy exchanging ``py::buffer`` with ``py::array`` in the above snippet, we can\nrestrict the function so that it only accepts NumPy arrays (rather than any\ntype of Python object satisfying the buffer protocol).\n\nIn many situations, we want to define a function which only accepts a NumPy\narray of a certain data type. This is possible via the ``py::array_t<T>``\ntemplate. For instance, the following function requires the argument to be a\nNumPy array containing double precision values.\n\n.. code-block:: cpp\n\n    void f(py::array_t<double> array);\n\nWhen it is invoked with a different type (e.g. an integer or a list of\nintegers), the binding code will attempt to cast the input into a NumPy array\nof the requested type. This feature requires the :file:`pybind11/numpy.h`\nheader to be included. Note that :file:`pybind11/numpy.h` does not depend on\nthe NumPy headers, and thus can be used without declaring a build-time\ndependency on NumPy; NumPy>=1.7.0 is a runtime dependency.\n\nData in NumPy arrays is not guaranteed to packed in a dense manner;\nfurthermore, entries can be separated by arbitrary column and row strides.\nSometimes, it can be useful to require a function to only accept dense arrays\nusing either the C (row-major) or Fortran (column-major) ordering. This can be\naccomplished via a second template argument with values ``py::array::c_style``\nor ``py::array::f_style``.\n\n.. code-block:: cpp\n\n    void f(py::array_t<double, py::array::c_style | py::array::forcecast> array);\n\nThe ``py::array::forcecast`` argument is the default value of the second\ntemplate parameter, and it ensures that non-conforming arguments are converted\ninto an array satisfying the specified requirements instead of trying the next\nfunction overload.\n\nThere are several methods on arrays; the methods listed below under references\nwork, as well as the following functions based on the NumPy API:\n\n- ``.dtype()`` returns the type of the contained values.\n\n- ``.strides()`` returns a pointer to the strides of the array (optionally pass\n  an integer axis to get a number).\n\n- ``.flags()`` returns the flag settings. ``.writable()`` and ``.owndata()``\n  are directly available.\n\n- ``.offset_at()`` returns the offset (optionally pass indices).\n\n- ``.squeeze()`` returns a view with length-1 axes removed.\n\n- ``.view(dtype)`` returns a view of the array with a different dtype.\n\n- ``.reshape({i, j, ...})`` returns a view of the array with a different shape.\n  ``.resize({...})`` is also available.\n\n- ``.index_at(i, j, ...)`` gets the count from the beginning to a given index.\n\n\nThere are also several methods for getting references (described below).\n\nStructured types\n================\n\nIn order for ``py::array_t`` to work with structured (record) types, we first\nneed to register the memory layout of the type. This can be done via\n``PYBIND11_NUMPY_DTYPE`` macro, called in the plugin definition code, which\nexpects the type followed by field names:\n\n.. code-block:: cpp\n\n    struct A {\n        int x;\n        double y;\n    };\n\n    struct B {\n        int z;\n        A a;\n    };\n\n    // ...\n    PYBIND11_MODULE(test, m) {\n        // ...\n\n        PYBIND11_NUMPY_DTYPE(A, x, y);\n        PYBIND11_NUMPY_DTYPE(B, z, a);\n        /* now both A and B can be used as template arguments to py::array_t */\n    }\n\nThe structure should consist of fundamental arithmetic types, ``std::complex``,\npreviously registered substructures, and arrays of any of the above. Both C++\narrays and ``std::array`` are supported. While there is a static assertion to\nprevent many types of unsupported structures, it is still the user's\nresponsibility to use only \"plain\" structures that can be safely manipulated as\nraw memory without violating invariants.\n\nVectorizing functions\n=====================\n\nSuppose we want to bind a function with the following signature to Python so\nthat it can process arbitrary NumPy array arguments (vectors, matrices, general\nN-D arrays) in addition to its normal arguments:\n\n.. code-block:: cpp\n\n    double my_func(int x, float y, double z);\n\nAfter including the ``pybind11/numpy.h`` header, this is extremely simple:\n\n.. code-block:: cpp\n\n    m.def(\"vectorized_func\", py::vectorize(my_func));\n\nInvoking the function like below causes 4 calls to be made to ``my_func`` with\neach of the array elements. The significant advantage of this compared to\nsolutions like ``numpy.vectorize()`` is that the loop over the elements runs\nentirely on the C++ side and can be crunched down into a tight, optimized loop\nby the compiler. The result is returned as a NumPy array of type\n``numpy.dtype.float64``.\n\n.. code-block:: pycon\n\n    >>> x = np.array([[1, 3], [5, 7]])\n    >>> y = np.array([[2, 4], [6, 8]])\n    >>> z = 3\n    >>> result = vectorized_func(x, y, z)\n\nThe scalar argument ``z`` is transparently replicated 4 times.  The input\narrays ``x`` and ``y`` are automatically converted into the right types (they\nare of type  ``numpy.dtype.int64`` but need to be ``numpy.dtype.int32`` and\n``numpy.dtype.float32``, respectively).\n\n.. note::\n\n    Only arithmetic, complex, and POD types passed by value or by ``const &``\n    reference are vectorized; all other arguments are passed through as-is.\n    Functions taking rvalue reference arguments cannot be vectorized.\n\nIn cases where the computation is too complicated to be reduced to\n``vectorize``, it will be necessary to create and access the buffer contents\nmanually. The following snippet contains a complete example that shows how this\nworks (the code is somewhat contrived, since it could have been done more\nsimply using ``vectorize``).\n\n.. code-block:: cpp\n\n    #include <pybind11/pybind11.h>\n    #include <pybind11/numpy.h>\n\n    namespace py = pybind11;\n\n    py::array_t<double> add_arrays(py::array_t<double> input1, py::array_t<double> input2) {\n        py::buffer_info buf1 = input1.request(), buf2 = input2.request();\n\n        if (buf1.ndim != 1 || buf2.ndim != 1)\n            throw std::runtime_error(\"Number of dimensions must be one\");\n\n        if (buf1.size != buf2.size)\n            throw std::runtime_error(\"Input shapes must match\");\n\n        /* No pointer is passed, so NumPy will allocate the buffer */\n        auto result = py::array_t<double>(buf1.size);\n\n        py::buffer_info buf3 = result.request();\n\n        double *ptr1 = static_cast<double *>(buf1.ptr);\n        double *ptr2 = static_cast<double *>(buf2.ptr);\n        double *ptr3 = static_cast<double *>(buf3.ptr);\n\n        for (size_t idx = 0; idx < buf1.shape[0]; idx++)\n            ptr3[idx] = ptr1[idx] + ptr2[idx];\n\n        return result;\n    }\n\n    PYBIND11_MODULE(test, m) {\n        m.def(\"add_arrays\", &add_arrays, \"Add two NumPy arrays\");\n    }\n\n.. seealso::\n\n    The file :file:`tests/test_numpy_vectorize.cpp` contains a complete\n    example that demonstrates using :func:`vectorize` in more detail.\n\nDirect access\n=============\n\nFor performance reasons, particularly when dealing with very large arrays, it\nis often desirable to directly access array elements without internal checking\nof dimensions and bounds on every access when indices are known to be already\nvalid.  To avoid such checks, the ``array`` class and ``array_t<T>`` template\nclass offer an unchecked proxy object that can be used for this unchecked\naccess through the ``unchecked<N>`` and ``mutable_unchecked<N>`` methods,\nwhere ``N`` gives the required dimensionality of the array:\n\n.. code-block:: cpp\n\n    m.def(\"sum_3d\", [](py::array_t<double> x) {\n        auto r = x.unchecked<3>(); // x must have ndim = 3; can be non-writeable\n        double sum = 0;\n        for (py::ssize_t i = 0; i < r.shape(0); i++)\n            for (py::ssize_t j = 0; j < r.shape(1); j++)\n                for (py::ssize_t k = 0; k < r.shape(2); k++)\n                    sum += r(i, j, k);\n        return sum;\n    });\n    m.def(\"increment_3d\", [](py::array_t<double> x) {\n        auto r = x.mutable_unchecked<3>(); // Will throw if ndim != 3 or flags.writeable is false\n        for (py::ssize_t i = 0; i < r.shape(0); i++)\n            for (py::ssize_t j = 0; j < r.shape(1); j++)\n                for (py::ssize_t k = 0; k < r.shape(2); k++)\n                    r(i, j, k) += 1.0;\n    }, py::arg().noconvert());\n\nTo obtain the proxy from an ``array`` object, you must specify both the data\ntype and number of dimensions as template arguments, such as ``auto r =\nmyarray.mutable_unchecked<float, 2>()``.\n\nIf the number of dimensions is not known at compile time, you can omit the\ndimensions template parameter (i.e. calling ``arr_t.unchecked()`` or\n``arr.unchecked<T>()``.  This will give you a proxy object that works in the\nsame way, but results in less optimizable code and thus a small efficiency\nloss in tight loops.\n\nNote that the returned proxy object directly references the array's data, and\nonly reads its shape, strides, and writeable flag when constructed.  You must\ntake care to ensure that the referenced array is not destroyed or reshaped for\nthe duration of the returned object, typically by limiting the scope of the\nreturned instance.\n\nThe returned proxy object supports some of the same methods as ``py::array`` so\nthat it can be used as a drop-in replacement for some existing, index-checked\nuses of ``py::array``:\n\n- ``.ndim()`` returns the number of dimensions\n\n- ``.data(1, 2, ...)`` and ``r.mutable_data(1, 2, ...)``` returns a pointer to\n  the ``const T`` or ``T`` data, respectively, at the given indices.  The\n  latter is only available to proxies obtained via ``a.mutable_unchecked()``.\n\n- ``.itemsize()`` returns the size of an item in bytes, i.e. ``sizeof(T)``.\n\n- ``.ndim()`` returns the number of dimensions.\n\n- ``.shape(n)`` returns the size of dimension ``n``\n\n- ``.size()`` returns the total number of elements (i.e. the product of the shapes).\n\n- ``.nbytes()`` returns the number of bytes used by the referenced elements\n  (i.e. ``itemsize()`` times ``size()``).\n\n.. seealso::\n\n    The file :file:`tests/test_numpy_array.cpp` contains additional examples\n    demonstrating the use of this feature.\n\nEllipsis\n========\n\nPython provides a convenient ``...`` ellipsis notation that is often used to\nslice multidimensional arrays. For instance, the following snippet extracts the\nmiddle dimensions of a tensor with the first and last index set to zero.\n\n.. code-block:: python\n\n   a = ...  # a NumPy array\n   b = a[0, ..., 0]\n\nThe function ``py::ellipsis()`` function can be used to perform the same\noperation on the C++ side:\n\n.. code-block:: cpp\n\n   py::array a = /* A NumPy array */;\n   py::array b = a[py::make_tuple(0, py::ellipsis(), 0)];\n\n\nMemory view\n===========\n\nFor a case when we simply want to provide a direct accessor to C/C++ buffer\nwithout a concrete class object, we can return a ``memoryview`` object. Suppose\nwe wish to expose a ``memoryview`` for 2x4 uint8_t array, we can do the\nfollowing:\n\n.. code-block:: cpp\n\n    const uint8_t buffer[] = {\n        0, 1, 2, 3,\n        4, 5, 6, 7\n    };\n    m.def(\"get_memoryview2d\", []() {\n        return py::memoryview::from_buffer(\n            buffer,                                    // buffer pointer\n            { 2, 4 },                                  // shape (rows, cols)\n            { sizeof(uint8_t) * 4, sizeof(uint8_t) }   // strides in bytes\n        );\n    });\n\nThis approach is meant for providing a ``memoryview`` for a C/C++ buffer not\nmanaged by Python. The user is responsible for managing the lifetime of the\nbuffer. Using a ``memoryview`` created in this way after deleting the buffer in\nC++ side results in undefined behavior.\n\nWe can also use ``memoryview::from_memory`` for a simple 1D contiguous buffer:\n\n.. code-block:: cpp\n\n    m.def(\"get_memoryview1d\", []() {\n        return py::memoryview::from_memory(\n            buffer,               // buffer pointer\n            sizeof(uint8_t) * 8   // buffer size\n        );\n    });\n\n.. versionchanged:: 2.6\n    ``memoryview::from_memory`` added.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/pycpp/object.rst",
    "content": "Python types\n############\n\n.. _wrappers:\n\nAvailable wrappers\n==================\n\nAll major Python types are available as thin C++ wrapper classes. These\ncan also be used as function parameters -- see :ref:`python_objects_as_args`.\n\nAvailable types include :class:`handle`, :class:`object`, :class:`bool_`,\n:class:`int_`, :class:`float_`, :class:`str`, :class:`bytes`, :class:`tuple`,\n:class:`list`, :class:`dict`, :class:`slice`, :class:`none`, :class:`capsule`,\n:class:`iterable`, :class:`iterator`, :class:`function`, :class:`buffer`,\n:class:`array`, and :class:`array_t`.\n\n.. warning::\n\n    Be sure to review the :ref:`pytypes_gotchas` before using this heavily in\n    your C++ API.\n\n.. _instantiating_compound_types:\n\nInstantiating compound Python types from C++\n============================================\n\nDictionaries can be initialized in the :class:`dict` constructor:\n\n.. code-block:: cpp\n\n    using namespace pybind11::literals; // to bring in the `_a` literal\n    py::dict d(\"spam\"_a=py::none(), \"eggs\"_a=42);\n\nA tuple of python objects can be instantiated using :func:`py::make_tuple`:\n\n.. code-block:: cpp\n\n    py::tuple tup = py::make_tuple(42, py::none(), \"spam\");\n\nEach element is converted to a supported Python type.\n\nA `simple namespace`_ can be instantiated using\n\n.. code-block:: cpp\n\n    using namespace pybind11::literals;  // to bring in the `_a` literal\n    py::object SimpleNamespace = py::module_::import(\"types\").attr(\"SimpleNamespace\");\n    py::object ns = SimpleNamespace(\"spam\"_a=py::none(), \"eggs\"_a=42);\n\nAttributes on a namespace can be modified with the :func:`py::delattr`,\n:func:`py::getattr`, and :func:`py::setattr` functions. Simple namespaces can\nbe useful as lightweight stand-ins for class instances.\n\n.. _simple namespace: https://docs.python.org/3/library/types.html#types.SimpleNamespace\n\n.. _casting_back_and_forth:\n\nCasting back and forth\n======================\n\nIn this kind of mixed code, it is often necessary to convert arbitrary C++\ntypes to Python, which can be done using :func:`py::cast`:\n\n.. code-block:: cpp\n\n    MyClass *cls = ...;\n    py::object obj = py::cast(cls);\n\nThe reverse direction uses the following syntax:\n\n.. code-block:: cpp\n\n    py::object obj = ...;\n    MyClass *cls = obj.cast<MyClass *>();\n\nWhen conversion fails, both directions throw the exception :class:`cast_error`.\n\n.. _python_libs:\n\nAccessing Python libraries from C++\n===================================\n\nIt is also possible to import objects defined in the Python standard\nlibrary or available in the current Python environment (``sys.path``) and work\nwith these in C++.\n\nThis example obtains a reference to the Python ``Decimal`` class.\n\n.. code-block:: cpp\n\n    // Equivalent to \"from decimal import Decimal\"\n    py::object Decimal = py::module_::import(\"decimal\").attr(\"Decimal\");\n\n.. code-block:: cpp\n\n    // Try to import scipy\n    py::object scipy = py::module_::import(\"scipy\");\n    return scipy.attr(\"__version__\");\n\n\n.. _calling_python_functions:\n\nCalling Python functions\n========================\n\nIt is also possible to call Python classes, functions and methods\nvia ``operator()``.\n\n.. code-block:: cpp\n\n    // Construct a Python object of class Decimal\n    py::object pi = Decimal(\"3.14159\");\n\n.. code-block:: cpp\n\n    // Use Python to make our directories\n    py::object os = py::module_::import(\"os\");\n    py::object makedirs = os.attr(\"makedirs\");\n    makedirs(\"/tmp/path/to/somewhere\");\n\nOne can convert the result obtained from Python to a pure C++ version\nif a ``py::class_`` or type conversion is defined.\n\n.. code-block:: cpp\n\n    py::function f = <...>;\n    py::object result_py = f(1234, \"hello\", some_instance);\n    MyClass &result = result_py.cast<MyClass>();\n\n.. _calling_python_methods:\n\nCalling Python methods\n========================\n\nTo call an object's method, one can again use ``.attr`` to obtain access to the\nPython method.\n\n.. code-block:: cpp\n\n    // Calculate e^π in decimal\n    py::object exp_pi = pi.attr(\"exp\")();\n    py::print(py::str(exp_pi));\n\nIn the example above ``pi.attr(\"exp\")`` is a *bound method*: it will always call\nthe method for that same instance of the class. Alternately one can create an\n*unbound method* via the Python class (instead of instance) and pass the ``self``\nobject explicitly, followed by other arguments.\n\n.. code-block:: cpp\n\n    py::object decimal_exp = Decimal.attr(\"exp\");\n\n    // Compute the e^n for n=0..4\n    for (int n = 0; n < 5; n++) {\n        py::print(decimal_exp(Decimal(n));\n    }\n\nKeyword arguments\n=================\n\nKeyword arguments are also supported. In Python, there is the usual call syntax:\n\n.. code-block:: python\n\n    def f(number, say, to):\n        ...  # function code\n\n\n    f(1234, say=\"hello\", to=some_instance)  # keyword call in Python\n\nIn C++, the same call can be made using:\n\n.. code-block:: cpp\n\n    using namespace pybind11::literals; // to bring in the `_a` literal\n    f(1234, \"say\"_a=\"hello\", \"to\"_a=some_instance); // keyword call in C++\n\nUnpacking arguments\n===================\n\nUnpacking of ``*args`` and ``**kwargs`` is also possible and can be mixed with\nother arguments:\n\n.. code-block:: cpp\n\n    // * unpacking\n    py::tuple args = py::make_tuple(1234, \"hello\", some_instance);\n    f(*args);\n\n    // ** unpacking\n    py::dict kwargs = py::dict(\"number\"_a=1234, \"say\"_a=\"hello\", \"to\"_a=some_instance);\n    f(**kwargs);\n\n    // mixed keywords, * and ** unpacking\n    py::tuple args = py::make_tuple(1234);\n    py::dict kwargs = py::dict(\"to\"_a=some_instance);\n    f(*args, \"say\"_a=\"hello\", **kwargs);\n\nGeneralized unpacking according to PEP448_ is also supported:\n\n.. code-block:: cpp\n\n    py::dict kwargs1 = py::dict(\"number\"_a=1234);\n    py::dict kwargs2 = py::dict(\"to\"_a=some_instance);\n    f(**kwargs1, \"say\"_a=\"hello\", **kwargs2);\n\n.. seealso::\n\n    The file :file:`tests/test_pytypes.cpp` contains a complete\n    example that demonstrates passing native Python types in more detail. The\n    file :file:`tests/test_callbacks.cpp` presents a few examples of calling\n    Python functions from C++, including keywords arguments and unpacking.\n\n.. _PEP448: https://www.python.org/dev/peps/pep-0448/\n\n.. _implicit_casting:\n\nImplicit casting\n================\n\nWhen using the C++ interface for Python types, or calling Python functions,\nobjects of type :class:`object` are returned. It is possible to invoke implicit\nconversions to subclasses like :class:`dict`. The same holds for the proxy objects\nreturned by ``operator[]`` or ``obj.attr()``.\nCasting to subtypes improves code readability and allows values to be passed to\nC++ functions that require a specific subtype rather than a generic :class:`object`.\n\n.. code-block:: cpp\n\n    #include <pybind11/numpy.h>\n    using namespace pybind11::literals;\n\n    py::module_ os = py::module_::import(\"os\");\n    py::module_ path = py::module_::import(\"os.path\");  // like 'import os.path as path'\n    py::module_ np = py::module_::import(\"numpy\");  // like 'import numpy as np'\n\n    py::str curdir_abs = path.attr(\"abspath\")(path.attr(\"curdir\"));\n    py::print(py::str(\"Current directory: \") + curdir_abs);\n    py::dict environ = os.attr(\"environ\");\n    py::print(environ[\"HOME\"]);\n    py::array_t<float> arr = np.attr(\"ones\")(3, \"dtype\"_a=\"float32\");\n    py::print(py::repr(arr + py::int_(1)));\n\nThese implicit conversions are available for subclasses of :class:`object`; there\nis no need to call ``obj.cast()`` explicitly as for custom classes, see\n:ref:`casting_back_and_forth`.\n\n.. note::\n    If a trivial conversion via move constructor is not possible, both implicit and\n    explicit casting (calling ``obj.cast()``) will attempt a \"rich\" conversion.\n    For instance, ``py::list env = os.attr(\"environ\");`` will succeed and is\n    equivalent to the Python code ``env = list(os.environ)`` that produces a\n    list of the dict keys.\n\n..  TODO: Adapt text once PR #2349 has landed\n\nHandling exceptions\n===================\n\nPython exceptions from wrapper classes will be thrown as a ``py::error_already_set``.\nSee :ref:`Handling exceptions from Python in C++\n<handling_python_exceptions_cpp>` for more information on handling exceptions\nraised when calling C++ wrapper classes.\n\n.. _pytypes_gotchas:\n\nGotchas\n=======\n\nDefault-Constructed Wrappers\n----------------------------\n\nWhen a wrapper type is default-constructed, it is **not** a valid Python object (i.e. it is not ``py::none()``). It is simply the same as\n``PyObject*`` null pointer. To check for this, use\n``static_cast<bool>(my_wrapper)``.\n\nAssigning py::none() to wrappers\n--------------------------------\n\nYou may be tempted to use types like ``py::str`` and ``py::dict`` in C++\nsignatures (either pure C++, or in bound signatures), and assign them default\nvalues of ``py::none()``. However, in a best case scenario, it will fail fast\nbecause ``None`` is not convertible to that type (e.g. ``py::dict``), or in a\nworse case scenario, it will silently work but corrupt the types you want to\nwork with (e.g. ``py::str(py::none())`` will yield ``\"None\"`` in Python).\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/pycpp/utilities.rst",
    "content": "Utilities\n#########\n\nUsing Python's print function in C++\n====================================\n\nThe usual way to write output in C++ is using ``std::cout`` while in Python one\nwould use ``print``. Since these methods use different buffers, mixing them can\nlead to output order issues. To resolve this, pybind11 modules can use the\n:func:`py::print` function which writes to Python's ``sys.stdout`` for consistency.\n\nPython's ``print`` function is replicated in the C++ API including optional\nkeyword arguments ``sep``, ``end``, ``file``, ``flush``. Everything works as\nexpected in Python:\n\n.. code-block:: cpp\n\n    py::print(1, 2.0, \"three\"); // 1 2.0 three\n    py::print(1, 2.0, \"three\", \"sep\"_a=\"-\"); // 1-2.0-three\n\n    auto args = py::make_tuple(\"unpacked\", true);\n    py::print(\"->\", *args, \"end\"_a=\"<-\"); // -> unpacked True <-\n\n.. _ostream_redirect:\n\nCapturing standard output from ostream\n======================================\n\nOften, a library will use the streams ``std::cout`` and ``std::cerr`` to print,\nbut this does not play well with Python's standard ``sys.stdout`` and ``sys.stderr``\nredirection. Replacing a library's printing with ``py::print <print>`` may not\nbe feasible. This can be fixed using a guard around the library function that\nredirects output to the corresponding Python streams:\n\n.. code-block:: cpp\n\n    #include <pybind11/iostream.h>\n\n    ...\n\n    // Add a scoped redirect for your noisy code\n    m.def(\"noisy_func\", []() {\n        py::scoped_ostream_redirect stream(\n            std::cout,                               // std::ostream&\n            py::module_::import(\"sys\").attr(\"stdout\") // Python output\n        );\n        call_noisy_func();\n    });\n\n.. warning::\n\n    The implementation in ``pybind11/iostream.h`` is NOT thread safe. Multiple\n    threads writing to a redirected ostream concurrently cause data races\n    and potentially buffer overflows. Therefore it is currently a requirement\n    that all (possibly) concurrent redirected ostream writes are protected by\n    a mutex. #HelpAppreciated: Work on iostream.h thread safety. For more\n    background see the discussions under\n    `PR #2982 <https://github.com/pybind/pybind11/pull/2982>`_ and\n    `PR #2995 <https://github.com/pybind/pybind11/pull/2995>`_.\n\nThis method respects flushes on the output streams and will flush if needed\nwhen the scoped guard is destroyed. This allows the output to be redirected in\nreal time, such as to a Jupyter notebook. The two arguments, the C++ stream and\nthe Python output, are optional, and default to standard output if not given. An\nextra type, ``py::scoped_estream_redirect <scoped_estream_redirect>``, is identical\nexcept for defaulting to ``std::cerr`` and ``sys.stderr``; this can be useful with\n``py::call_guard``, which allows multiple items, but uses the default constructor:\n\n.. code-block:: cpp\n\n    // Alternative: Call single function using call guard\n    m.def(\"noisy_func\", &call_noisy_function,\n          py::call_guard<py::scoped_ostream_redirect,\n                         py::scoped_estream_redirect>());\n\nThe redirection can also be done in Python with the addition of a context\nmanager, using the ``py::add_ostream_redirect() <add_ostream_redirect>`` function:\n\n.. code-block:: cpp\n\n    py::add_ostream_redirect(m, \"ostream_redirect\");\n\nThe name in Python defaults to ``ostream_redirect`` if no name is passed.  This\ncreates the following context manager in Python:\n\n.. code-block:: python\n\n    with ostream_redirect(stdout=True, stderr=True):\n        noisy_function()\n\nIt defaults to redirecting both streams, though you can use the keyword\narguments to disable one of the streams if needed.\n\n.. note::\n\n    The above methods will not redirect C-level output to file descriptors, such\n    as ``fprintf``. For those cases, you'll need to redirect the file\n    descriptors either directly in C or with Python's ``os.dup2`` function\n    in an operating-system dependent way.\n\n.. _eval:\n\nEvaluating Python expressions from strings and files\n====================================================\n\npybind11 provides the ``eval``, ``exec`` and ``eval_file`` functions to evaluate\nPython expressions and statements. The following example illustrates how they\ncan be used.\n\n.. code-block:: cpp\n\n    // At beginning of file\n    #include <pybind11/eval.h>\n\n    ...\n\n    // Evaluate in scope of main module\n    py::object scope = py::module_::import(\"__main__\").attr(\"__dict__\");\n\n    // Evaluate an isolated expression\n    int result = py::eval(\"my_variable + 10\", scope).cast<int>();\n\n    // Evaluate a sequence of statements\n    py::exec(\n        \"print('Hello')\\n\"\n        \"print('world!');\",\n        scope);\n\n    // Evaluate the statements in an separate Python file on disk\n    py::eval_file(\"script.py\", scope);\n\nC++11 raw string literals are also supported and quite handy for this purpose.\nThe only requirement is that the first statement must be on a new line following\nthe raw string delimiter ``R\"(``, ensuring all lines have common leading indent:\n\n.. code-block:: cpp\n\n    py::exec(R\"(\n        x = get_answer()\n        if x == 42:\n            print('Hello World!')\n        else:\n            print('Bye!')\n        )\", scope\n    );\n\n.. note::\n\n    `eval` and `eval_file` accept a template parameter that describes how the\n    string/file should be interpreted. Possible choices include ``eval_expr``\n    (isolated expression), ``eval_single_statement`` (a single statement, return\n    value is always ``none``), and ``eval_statements`` (sequence of statements,\n    return value is always ``none``). `eval` defaults to  ``eval_expr``,\n    `eval_file` defaults to ``eval_statements`` and `exec` is just a shortcut\n    for ``eval<eval_statements>``.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/advanced/smart_ptrs.rst",
    "content": "Smart pointers\n##############\n\nstd::unique_ptr\n===============\n\nGiven a class ``Example`` with Python bindings, it's possible to return\ninstances wrapped in C++11 unique pointers, like so\n\n.. code-block:: cpp\n\n    std::unique_ptr<Example> create_example() { return std::unique_ptr<Example>(new Example()); }\n\n.. code-block:: cpp\n\n    m.def(\"create_example\", &create_example);\n\nIn other words, there is nothing special that needs to be done. While returning\nunique pointers in this way is allowed, it is *illegal* to use them as function\narguments. For instance, the following function signature cannot be processed\nby pybind11.\n\n.. code-block:: cpp\n\n    void do_something_with_example(std::unique_ptr<Example> ex) { ... }\n\nThe above signature would imply that Python needs to give up ownership of an\nobject that is passed to this function, which is generally not possible (for\ninstance, the object might be referenced elsewhere).\n\nstd::shared_ptr\n===============\n\nThe binding generator for classes, :class:`class_`, can be passed a template\ntype that denotes a special *holder* type that is used to manage references to\nthe object.  If no such holder type template argument is given, the default for\na type named ``Type`` is ``std::unique_ptr<Type>``, which means that the object\nis deallocated when Python's reference count goes to zero.\n\nIt is possible to switch to other types of reference counting wrappers or smart\npointers, which is useful in codebases that rely on them. For instance, the\nfollowing snippet causes ``std::shared_ptr`` to be used instead.\n\n.. code-block:: cpp\n\n    py::class_<Example, std::shared_ptr<Example> /* <- holder type */> obj(m, \"Example\");\n\nNote that any particular class can only be associated with a single holder type.\n\nOne potential stumbling block when using holder types is that they need to be\napplied consistently. Can you guess what's broken about the following binding\ncode?\n\n.. code-block:: cpp\n\n    class Child { };\n\n    class Parent {\n    public:\n       Parent() : child(std::make_shared<Child>()) { }\n       Child *get_child() { return child.get(); }  /* Hint: ** DON'T DO THIS ** */\n    private:\n        std::shared_ptr<Child> child;\n    };\n\n    PYBIND11_MODULE(example, m) {\n        py::class_<Child, std::shared_ptr<Child>>(m, \"Child\");\n\n        py::class_<Parent, std::shared_ptr<Parent>>(m, \"Parent\")\n           .def(py::init<>())\n           .def(\"get_child\", &Parent::get_child);\n    }\n\nThe following Python code will cause undefined behavior (and likely a\nsegmentation fault).\n\n.. code-block:: python\n\n   from example import Parent\n\n   print(Parent().get_child())\n\nThe problem is that ``Parent::get_child()`` returns a pointer to an instance of\n``Child``, but the fact that this instance is already managed by\n``std::shared_ptr<...>`` is lost when passing raw pointers. In this case,\npybind11 will create a second independent ``std::shared_ptr<...>`` that also\nclaims ownership of the pointer. In the end, the object will be freed **twice**\nsince these shared pointers have no way of knowing about each other.\n\nThere are two ways to resolve this issue:\n\n1. For types that are managed by a smart pointer class, never use raw pointers\n   in function arguments or return values. In other words: always consistently\n   wrap pointers into their designated holder types (such as\n   ``std::shared_ptr<...>``). In this case, the signature of ``get_child()``\n   should be modified as follows:\n\n.. code-block:: cpp\n\n    std::shared_ptr<Child> get_child() { return child; }\n\n2. Adjust the definition of ``Child`` by specifying\n   ``std::enable_shared_from_this<T>`` (see cppreference_ for details) as a\n   base class. This adds a small bit of information to ``Child`` that allows\n   pybind11 to realize that there is already an existing\n   ``std::shared_ptr<...>`` and communicate with it. In this case, the\n   declaration of ``Child`` should look as follows:\n\n.. _cppreference: http://en.cppreference.com/w/cpp/memory/enable_shared_from_this\n\n.. code-block:: cpp\n\n    class Child : public std::enable_shared_from_this<Child> { };\n\n.. _smart_pointers:\n\nCustom smart pointers\n=====================\n\npybind11 supports ``std::unique_ptr`` and ``std::shared_ptr`` right out of the\nbox. For any other custom smart pointer, transparent conversions can be enabled\nusing a macro invocation similar to the following. It must be declared at the\ntop namespace level before any binding code:\n\n.. code-block:: cpp\n\n    PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>);\n\nThe first argument of :func:`PYBIND11_DECLARE_HOLDER_TYPE` should be a\nplaceholder name that is used as a template parameter of the second argument.\nThus, feel free to use any identifier, but use it consistently on both sides;\nalso, don't use the name of a type that already exists in your codebase.\n\nThe macro also accepts a third optional boolean parameter that is set to false\nby default. Specify\n\n.. code-block:: cpp\n\n    PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>, true);\n\nif ``SmartPtr<T>`` can always be initialized from a ``T*`` pointer without the\nrisk of inconsistencies (such as multiple independent ``SmartPtr`` instances\nbelieving that they are the sole owner of the ``T*`` pointer). A common\nsituation where ``true`` should be passed is when the ``T`` instances use\n*intrusive* reference counting.\n\nPlease take a look at the :ref:`macro_notes` before using this feature.\n\nBy default, pybind11 assumes that your custom smart pointer has a standard\ninterface, i.e. provides a ``.get()`` member function to access the underlying\nraw pointer. If this is not the case, pybind11's ``holder_helper`` must be\nspecialized:\n\n.. code-block:: cpp\n\n    // Always needed for custom holder types\n    PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>);\n\n    // Only needed if the type's `.get()` goes by another name\n    namespace PYBIND11_NAMESPACE { namespace detail {\n        template <typename T>\n        struct holder_helper<SmartPtr<T>> { // <-- specialization\n            static const T *get(const SmartPtr<T> &p) { return p.getPointer(); }\n        };\n    }}\n\nThe above specialization informs pybind11 that the custom ``SmartPtr`` class\nprovides ``.get()`` functionality via ``.getPointer()``.\n\n.. seealso::\n\n    The file :file:`tests/test_smart_ptr.cpp` contains a complete example\n    that demonstrates how to work with custom reference-counting holder types\n    in more detail.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/basics.rst",
    "content": ".. _basics:\n\nFirst steps\n###########\n\nThis sections demonstrates the basic features of pybind11. Before getting\nstarted, make sure that development environment is set up to compile the\nincluded set of test cases.\n\n\nCompiling the test cases\n========================\n\nLinux/macOS\n-----------\n\nOn Linux  you'll need to install the **python-dev** or **python3-dev** packages as\nwell as **cmake**. On macOS, the included python version works out of the box,\nbut **cmake** must still be installed.\n\nAfter installing the prerequisites, run\n\n.. code-block:: bash\n\n   mkdir build\n   cd build\n   cmake ..\n   make check -j 4\n\nThe last line will both compile and run the tests.\n\nWindows\n-------\n\nOn Windows, only **Visual Studio 2017** and newer are supported.\n\n.. Note::\n\n    To use the C++17 in Visual Studio 2017 (MSVC 14.1), pybind11 requires the flag\n    ``/permissive-`` to be passed to the compiler `to enforce standard conformance`_. When\n    building with Visual Studio 2019, this is not strictly necessary, but still advised.\n\n..  _`to enforce standard conformance`: https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=vs-2017\n\nTo compile and run the tests:\n\n.. code-block:: batch\n\n   mkdir build\n   cd build\n   cmake ..\n   cmake --build . --config Release --target check\n\nThis will create a Visual Studio project, compile and run the target, all from the\ncommand line.\n\n.. Note::\n\n    If all tests fail, make sure that the Python binary and the testcases are compiled\n    for the same processor type and bitness (i.e. either **i386** or **x86_64**). You\n    can specify **x86_64** as the target architecture for the generated Visual Studio\n    project using ``cmake -A x64 ..``.\n\n.. seealso::\n\n    Advanced users who are already familiar with Boost.Python may want to skip\n    the tutorial and look at the test cases in the :file:`tests` directory,\n    which exercise all features of pybind11.\n\nHeader and namespace conventions\n================================\n\nFor brevity, all code examples assume that the following two lines are present:\n\n.. code-block:: cpp\n\n    #include <pybind11/pybind11.h>\n\n    namespace py = pybind11;\n\nSome features may require additional headers, but those will be specified as needed.\n\n.. _simple_example:\n\nCreating bindings for a simple function\n=======================================\n\nLet's start by creating Python bindings for an extremely simple function, which\nadds two numbers and returns their result:\n\n.. code-block:: cpp\n\n    int add(int i, int j) {\n        return i + j;\n    }\n\nFor simplicity [#f1]_, we'll put both this function and the binding code into\na file named :file:`example.cpp` with the following contents:\n\n.. code-block:: cpp\n\n    #include <pybind11/pybind11.h>\n\n    int add(int i, int j) {\n        return i + j;\n    }\n\n    PYBIND11_MODULE(example, m) {\n        m.doc() = \"pybind11 example plugin\"; // optional module docstring\n\n        m.def(\"add\", &add, \"A function that adds two numbers\");\n    }\n\n.. [#f1] In practice, implementation and binding code will generally be located\n         in separate files.\n\nThe :func:`PYBIND11_MODULE` macro creates a function that will be called when an\n``import`` statement is issued from within Python. The module name (``example``)\nis given as the first macro argument (it should not be in quotes). The second\nargument (``m``) defines a variable of type :class:`py::module_ <module>` which\nis the main interface for creating bindings. The method :func:`module_::def`\ngenerates binding code that exposes the ``add()`` function to Python.\n\n.. note::\n\n    Notice how little code was needed to expose our function to Python: all\n    details regarding the function's parameters and return value were\n    automatically inferred using template metaprogramming. This overall\n    approach and the used syntax are borrowed from Boost.Python, though the\n    underlying implementation is very different.\n\npybind11 is a header-only library, hence it is not necessary to link against\nany special libraries and there are no intermediate (magic) translation steps.\nOn Linux, the above example can be compiled using the following command:\n\n.. code-block:: bash\n\n    $ c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) example.cpp -o example$(python3-config --extension-suffix)\n\n.. note::\n\n    If you used :ref:`include_as_a_submodule` to get the pybind11 source, then\n    use ``$(python3-config --includes) -Iextern/pybind11/include`` instead of\n    ``$(python3 -m pybind11 --includes)`` in the above compilation, as\n    explained in :ref:`building_manually`.\n\nFor more details on the required compiler flags on Linux and macOS, see\n:ref:`building_manually`. For complete cross-platform compilation instructions,\nrefer to the :ref:`compiling` page.\n\nThe `python_example`_ and `cmake_example`_ repositories are also a good place\nto start. They are both complete project examples with cross-platform build\nsystems. The only difference between the two is that `python_example`_ uses\nPython's ``setuptools`` to build the module, while `cmake_example`_ uses CMake\n(which may be preferable for existing C++ projects).\n\n.. _python_example: https://github.com/pybind/python_example\n.. _cmake_example: https://github.com/pybind/cmake_example\n\nBuilding the above C++ code will produce a binary module file that can be\nimported to Python. Assuming that the compiled module is located in the\ncurrent directory, the following interactive Python session shows how to\nload and execute the example:\n\n.. code-block:: pycon\n\n    $ python\n    Python 3.9.10 (main, Jan 15 2022, 11:48:04)\n    [Clang 13.0.0 (clang-1300.0.29.3)] on darwin\n    Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n    >>> import example\n    >>> example.add(1, 2)\n    3\n    >>>\n\n.. _keyword_args:\n\nKeyword arguments\n=================\n\nWith a simple code modification, it is possible to inform Python about the\nnames of the arguments (\"i\" and \"j\" in this case).\n\n.. code-block:: cpp\n\n    m.def(\"add\", &add, \"A function which adds two numbers\",\n          py::arg(\"i\"), py::arg(\"j\"));\n\n:class:`arg` is one of several special tag classes which can be used to pass\nmetadata into :func:`module_::def`. With this modified binding code, we can now\ncall the function using keyword arguments, which is a more readable alternative\nparticularly for functions taking many parameters:\n\n.. code-block:: pycon\n\n    >>> import example\n    >>> example.add(i=1, j=2)\n    3L\n\nThe keyword names also appear in the function signatures within the documentation.\n\n.. code-block:: pycon\n\n    >>> help(example)\n\n    ....\n\n    FUNCTIONS\n        add(...)\n            Signature : (i: int, j: int) -> int\n\n            A function which adds two numbers\n\nA shorter notation for named arguments is also available:\n\n.. code-block:: cpp\n\n    // regular notation\n    m.def(\"add1\", &add, py::arg(\"i\"), py::arg(\"j\"));\n    // shorthand\n    using namespace pybind11::literals;\n    m.def(\"add2\", &add, \"i\"_a, \"j\"_a);\n\nThe :var:`_a` suffix forms a C++11 literal which is equivalent to :class:`arg`.\nNote that the literal operator must first be made visible with the directive\n``using namespace pybind11::literals``. This does not bring in anything else\nfrom the ``pybind11`` namespace except for literals.\n\n.. _default_args:\n\nDefault arguments\n=================\n\nSuppose now that the function to be bound has default arguments, e.g.:\n\n.. code-block:: cpp\n\n    int add(int i = 1, int j = 2) {\n        return i + j;\n    }\n\nUnfortunately, pybind11 cannot automatically extract these parameters, since they\nare not part of the function's type information. However, they are simple to specify\nusing an extension of :class:`arg`:\n\n.. code-block:: cpp\n\n    m.def(\"add\", &add, \"A function which adds two numbers\",\n          py::arg(\"i\") = 1, py::arg(\"j\") = 2);\n\nThe default values also appear within the documentation.\n\n.. code-block:: pycon\n\n    >>> help(example)\n\n    ....\n\n    FUNCTIONS\n        add(...)\n            Signature : (i: int = 1, j: int = 2) -> int\n\n            A function which adds two numbers\n\nThe shorthand notation is also available for default arguments:\n\n.. code-block:: cpp\n\n    // regular notation\n    m.def(\"add1\", &add, py::arg(\"i\") = 1, py::arg(\"j\") = 2);\n    // shorthand\n    m.def(\"add2\", &add, \"i\"_a=1, \"j\"_a=2);\n\nExporting variables\n===================\n\nTo expose a value from C++, use the ``attr`` function to register it in a\nmodule as shown below. Built-in types and general objects (more on that later)\nare automatically converted when assigned as attributes, and can be explicitly\nconverted using the function ``py::cast``.\n\n.. code-block:: cpp\n\n    PYBIND11_MODULE(example, m) {\n        m.attr(\"the_answer\") = 42;\n        py::object world = py::cast(\"World\");\n        m.attr(\"what\") = world;\n    }\n\nThese are then accessible from Python:\n\n.. code-block:: pycon\n\n    >>> import example\n    >>> example.the_answer\n    42\n    >>> example.what\n    'World'\n\n.. _supported_types:\n\nSupported data types\n====================\n\nA large number of data types are supported out of the box and can be used\nseamlessly as functions arguments, return values or with ``py::cast`` in general.\nFor a full overview, see the :doc:`advanced/cast/index` section.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/benchmark.py",
    "content": "import datetime as dt\nimport os\nimport random\n\nnfns = 4  # Functions per class\nnargs = 4  # Arguments per function\n\n\ndef generate_dummy_code_pybind11(nclasses=10):\n    decl = \"\"\n    bindings = \"\"\n\n    for cl in range(nclasses):\n        decl += f\"class cl{cl:03};\\n\"\n    decl += \"\\n\"\n\n    for cl in range(nclasses):\n        decl += f\"class {cl:03} {{\\n\"\n        decl += \"public:\\n\"\n        bindings += f'    py::class_<cl{cl:03}>(m, \"cl{cl:03}\")\\n'\n        for fn in range(nfns):\n            ret = random.randint(0, nclasses - 1)\n            params = [random.randint(0, nclasses - 1) for i in range(nargs)]\n            decl += f\"    cl{ret:03} *fn_{fn:03}(\"\n            decl += \", \".join(f\"cl{p:03} *\" for p in params)\n            decl += \");\\n\"\n            bindings += f'        .def(\"fn_{fn:03}\", &cl{cl:03}::fn_{fn:03})\\n'\n        decl += \"};\\n\\n\"\n        bindings += \"        ;\\n\"\n\n    result = \"#include <pybind11/pybind11.h>\\n\\n\"\n    result += \"namespace py = pybind11;\\n\\n\"\n    result += decl + \"\\n\"\n    result += \"PYBIND11_MODULE(example, m) {\\n\"\n    result += bindings\n    result += \"}\"\n    return result\n\n\ndef generate_dummy_code_boost(nclasses=10):\n    decl = \"\"\n    bindings = \"\"\n\n    for cl in range(nclasses):\n        decl += f\"class cl{cl:03};\\n\"\n    decl += \"\\n\"\n\n    for cl in range(nclasses):\n        decl += \"class cl%03i {\\n\" % cl\n        decl += \"public:\\n\"\n        bindings += f'    py::class_<cl{cl:03}>(\"cl{cl:03}\")\\n'\n        for fn in range(nfns):\n            ret = random.randint(0, nclasses - 1)\n            params = [random.randint(0, nclasses - 1) for i in range(nargs)]\n            decl += f\"    cl{ret:03} *fn_{fn:03}(\"\n            decl += \", \".join(f\"cl{p:03} *\" for p in params)\n            decl += \");\\n\"\n            bindings += f'        .def(\"fn_{fn:03}\", &cl{cl:03}::fn_{fn:03}, py::return_value_policy<py::manage_new_object>())\\n'\n        decl += \"};\\n\\n\"\n        bindings += \"        ;\\n\"\n\n    result = \"#include <boost/python.hpp>\\n\\n\"\n    result += \"namespace py = boost::python;\\n\\n\"\n    result += decl + \"\\n\"\n    result += \"BOOST_PYTHON_MODULE(example) {\\n\"\n    result += bindings\n    result += \"}\"\n    return result\n\n\nfor codegen in [generate_dummy_code_pybind11, generate_dummy_code_boost]:\n    print(\"{\")\n    for i in range(0, 10):\n        nclasses = 2**i\n        with open(\"test.cpp\", \"w\") as f:\n            f.write(codegen(nclasses))\n        n1 = dt.datetime.now()\n        os.system(\n            \"g++ -Os -shared -rdynamic -undefined dynamic_lookup \"\n            \"-fvisibility=hidden -std=c++14 test.cpp -I include \"\n            \"-I /System/Library/Frameworks/Python.framework/Headers -o test.so\"\n        )\n        n2 = dt.datetime.now()\n        elapsed = (n2 - n1).total_seconds()\n        size = os.stat(\"test.so\").st_size\n        print(\"   {%i, %f, %i},\" % (nclasses * nfns, elapsed, size))\n    print(\"}\")\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/benchmark.rst",
    "content": "Benchmark\n=========\n\nThe following is the result of a synthetic benchmark comparing both compilation\ntime and module size of pybind11 against Boost.Python. A detailed report about a\nBoost.Python to pybind11 conversion of a real project is available here: [#f1]_.\n\n.. [#f1] http://graylab.jhu.edu/RosettaCon2016/PyRosetta-4.pdf\n\nSetup\n-----\n\nA python script (see the ``docs/benchmark.py`` file) was used to generate a set\nof files with dummy classes whose count increases for each successive benchmark\n(between 1 and 2048 classes in powers of two). Each class has four methods with\na randomly generated signature with a return value and four arguments. (There\nwas no particular reason for this setup other than the desire to generate many\nunique function signatures whose count could be controlled in a simple way.)\n\nHere is an example of the binding code for one class:\n\n.. code-block:: cpp\n\n    ...\n    class cl034 {\n    public:\n        cl279 *fn_000(cl084 *, cl057 *, cl065 *, cl042 *);\n        cl025 *fn_001(cl098 *, cl262 *, cl414 *, cl121 *);\n        cl085 *fn_002(cl445 *, cl297 *, cl145 *, cl421 *);\n        cl470 *fn_003(cl200 *, cl323 *, cl332 *, cl492 *);\n    };\n    ...\n\n    PYBIND11_MODULE(example, m) {\n        ...\n        py::class_<cl034>(m, \"cl034\")\n            .def(\"fn_000\", &cl034::fn_000)\n            .def(\"fn_001\", &cl034::fn_001)\n            .def(\"fn_002\", &cl034::fn_002)\n            .def(\"fn_003\", &cl034::fn_003)\n        ...\n    }\n\nThe Boost.Python version looks almost identical except that a return value\npolicy had to be specified as an argument to ``def()``. For both libraries,\ncompilation was done with\n\n.. code-block:: bash\n\n    Apple LLVM version 7.0.2 (clang-700.1.81)\n\nand the following compilation flags\n\n.. code-block:: bash\n\n    g++ -Os -shared -rdynamic -undefined dynamic_lookup -fvisibility=hidden -std=c++14\n\nCompilation time\n----------------\n\nThe following log-log plot shows how the compilation time grows for an\nincreasing number of class and function declarations. pybind11 includes many\nfewer headers, which initially leads to shorter compilation times, but the\nperformance is ultimately fairly similar (pybind11 is 19.8 seconds faster for\nthe largest largest file with 2048 classes and a total of 8192 methods -- a\nmodest **1.2x** speedup relative to Boost.Python, which required 116.35\nseconds).\n\n.. only:: not latex\n\n    .. image:: pybind11_vs_boost_python1.svg\n\n.. only:: latex\n\n    .. image:: pybind11_vs_boost_python1.png\n\nModule size\n-----------\n\nDifferences between the two libraries become much more pronounced when\nconsidering the file size of the generated Python plugin: for the largest file,\nthe binary generated by Boost.Python required 16.8 MiB, which was **2.17\ntimes** / **9.1 megabytes** larger than the output generated by pybind11. For\nvery small inputs, Boost.Python has an edge in the plot below -- however, note\nthat it stores many definitions in an external library, whose size was not\nincluded here, hence the comparison is slightly shifted in Boost.Python's\nfavor.\n\n.. only:: not latex\n\n    .. image:: pybind11_vs_boost_python2.svg\n\n.. only:: latex\n\n    .. image:: pybind11_vs_boost_python2.png\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/changelog.rst",
    "content": ".. _changelog:\n\nChangelog\n#########\n\nStarting with version 1.8.0, pybind11 releases use a `semantic versioning\n<http://semver.org>`_ policy.\n\nChanges will be added here periodically from the \"Suggested changelog entry\"\nblock in pull request descriptions.\n\n\nIN DEVELOPMENT\n--------------\n\nChanges will be summarized here periodically.\n\nChanges:\n\n* ``PyGILState_Check()``'s in ``pybind11::handle``'s ``inc_ref()`` &\n  ``dec_ref()`` are now enabled by default again.\n  `#4246 <https://github.com/pybind/pybind11/pull/4246>`_\n\n* ``py::initialize_interpreter()`` using ``PyConfig_InitPythonConfig()``\n  instead of ``PyConfig_InitIsolatedConfig()``, to obtain complete\n  ``sys.path``.\n  `#4473 <https://github.com/pybind/pybind11/pull/4473>`_\n\n* Cast errors now always include Python type information, even if\n  ``PYBIND11_DETAILED_ERROR_MESSAGES`` is not defined. This increases binary\n  sizes slightly (~1.5%) but the error messages are much more informative.\n  `#4463 <https://github.com/pybind/pybind11/pull/4463>`_\n\n\nBuild system improvements:\n\n* Update clang-tidy to 15 in CI.\n  `#4387 <https://github.com/pybind/pybind11/pull/4387>`_\n\n* Moved the linting framework over to Ruff.\n  `#4483 <https://github.com/pybind/pybind11/pull/4483>`_\n\nVersion 2.10.4 (Mar 16, 2023)\n----------------------------\n\nChanges:\n\n* ``python3 -m pybind11`` gained a ``--version`` option (prints the version and\n  exits).\n  `#4526 <https://github.com/pybind/pybind11/pull/4526>`_\n\nBug Fixes:\n\n* Fix a warning when pydebug is enabled on Python 3.11.\n  `#4461 <https://github.com/pybind/pybind11/pull/4461>`_\n\n* Ensure ``gil_scoped_release`` RAII is non-copyable.\n  `#4490 <https://github.com/pybind/pybind11/pull/4490>`_\n\n* Ensure the tests dir does not show up with new versions of setuptools.\n  `#4510 <https://github.com/pybind/pybind11/pull/4510>`_\n\n* Better stacklevel for a warning in setuptools helpers.\n  `#4516 <https://github.com/pybind/pybind11/pull/4516>`_\n\nVersion 2.10.3 (Jan 3, 2023)\n----------------------------\n\nChanges:\n\n* Temporarily made our GIL status assertions (added in 2.10.2) disabled by\n  default (re-enable manually by defining\n  ``PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF``, will be enabled in 2.11).\n  `#4432 <https://github.com/pybind/pybind11/pull/4432>`_\n\n* Improved error messages when ``inc_ref``/``dec_ref`` are called with an\n  invalid GIL state.\n  `#4427 <https://github.com/pybind/pybind11/pull/4427>`_\n  `#4436 <https://github.com/pybind/pybind11/pull/4436>`_\n\nBug Fixes:\n\n* Some minor touchups found by static analyzers.\n  `#4440 <https://github.com/pybind/pybind11/pull/4440>`_\n\n\nVersion 2.10.2 (Dec 20, 2022)\n-----------------------------\n\nChanges:\n\n* ``scoped_interpreter`` constructor taking ``PyConfig``.\n  `#4330 <https://github.com/pybind/pybind11/pull/4330>`_\n\n* ``pybind11/eigen/tensor.h`` adds converters to and from ``Eigen::Tensor`` and\n  ``Eigen::TensorMap``.\n  `#4201 <https://github.com/pybind/pybind11/pull/4201>`_\n\n* ``PyGILState_Check()``'s  were integrated to ``pybind11::handle``\n  ``inc_ref()`` & ``dec_ref()``. The added GIL checks are guarded by\n  ``PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF``, which is the default only if\n  ``NDEBUG`` is not defined. (Made non-default in 2.10.3, will be active in 2.11)\n  `#4246 <https://github.com/pybind/pybind11/pull/4246>`_\n\n* Add option for enable/disable enum members in docstring.\n  `#2768 <https://github.com/pybind/pybind11/pull/2768>`_\n\n* Fixed typing of ``KeysView``, ``ValuesView`` and ``ItemsView`` in ``bind_map``.\n  `#4353 <https://github.com/pybind/pybind11/pull/4353>`_\n\nBug fixes:\n\n* Bug fix affecting only Python 3.6 under very specific, uncommon conditions:\n  move ``PyEval_InitThreads()`` call to the correct location.\n  `#4350 <https://github.com/pybind/pybind11/pull/4350>`_\n\n* Fix segfault bug when passing foreign native functions to functional.h.\n  `#4254 <https://github.com/pybind/pybind11/pull/4254>`_\n\nBuild system improvements:\n\n* Support setting PYTHON_LIBRARIES manually for Windows ARM cross-compilation\n  (classic mode).\n  `#4406 <https://github.com/pybind/pybind11/pull/4406>`_\n\n* Extend IPO/LTO detection for ICX (a.k.a IntelLLVM) compiler.\n  `#4402 <https://github.com/pybind/pybind11/pull/4402>`_\n\n* Allow calling ``find_package(pybind11 CONFIG)`` multiple times from separate\n  directories in the same CMake project and properly link Python (new mode).\n  `#4401 <https://github.com/pybind/pybind11/pull/4401>`_\n\n* ``multiprocessing_set_spawn`` in pytest fixture for added safety.\n  `#4377 <https://github.com/pybind/pybind11/pull/4377>`_\n\n* Fixed a bug in two pybind11/tools cmake scripts causing \"Unknown arguments specified\" errors.\n  `#4327 <https://github.com/pybind/pybind11/pull/4327>`_\n\n\n\nVersion 2.10.1 (Oct 31, 2022)\n-----------------------------\n\nThis is the first version to fully support embedding the newly released Python 3.11.\n\nChanges:\n\n* Allow ``pybind11::capsule`` constructor to take null destructor pointers.\n  `#4221 <https://github.com/pybind/pybind11/pull/4221>`_\n\n* ``embed.h`` was changed so that ``PYTHONPATH`` is used also with Python 3.11\n  (established behavior).\n  `#4119 <https://github.com/pybind/pybind11/pull/4119>`_\n\n* A ``PYBIND11_SIMPLE_GIL_MANAGEMENT`` option was added (cmake, C++ define),\n  along with many additional tests in ``test_gil_scoped.py``. The option may be\n  useful to try when debugging GIL-related issues, to determine if the more\n  complex default implementation is or is not to blame. See #4216 for\n  background. WARNING: Please be careful to not create ODR violations when\n  using the option: everything that is linked together with mutual symbol\n  visibility needs to be rebuilt.\n  `#4216 <https://github.com/pybind/pybind11/pull/4216>`_\n\n* ``PYBIND11_EXPORT_EXCEPTION`` was made non-empty only under macOS. This makes\n  Linux builds safer, and enables the removal of warning suppression pragmas for\n  Windows.\n  `#4298 <https://github.com/pybind/pybind11/pull/4298>`_\n\nBug fixes:\n\n* Fixed a bug where ``UnicodeDecodeError`` was not propagated from various\n  ``py::str`` ctors when decoding surrogate utf characters.\n  `#4294 <https://github.com/pybind/pybind11/pull/4294>`_\n\n* Revert perfect forwarding for ``make_iterator``. This broke at least one\n  valid use case. May revisit later.\n  `#4234 <https://github.com/pybind/pybind11/pull/4234>`_\n\n* Fix support for safe casts to ``void*`` (regression in 2.10.0).\n  `#4275 <https://github.com/pybind/pybind11/pull/4275>`_\n\n* Fix ``char8_t`` support (regression in 2.9).\n  `#4278 <https://github.com/pybind/pybind11/pull/4278>`_\n\n* Unicode surrogate character in Python exception message leads to process\n  termination in ``error_already_set::what()``.\n  `#4297 <https://github.com/pybind/pybind11/pull/4297>`_\n\n* Fix MSVC 2019 v.1924 & C++14 mode error for ``overload_cast``.\n  `#4188 <https://github.com/pybind/pybind11/pull/4188>`_\n\n* Make augmented assignment operators non-const for the object-api. Behavior\n  was previously broken for augmented assignment operators.\n  `#4065 <https://github.com/pybind/pybind11/pull/4065>`_\n\n* Add proper error checking to C++ bindings for Python list append and insert.\n  `#4208 <https://github.com/pybind/pybind11/pull/4208>`_\n\n* Work-around for Nvidia's CUDA nvcc compiler in versions 11.4.0 - 11.8.0.\n  `#4220 <https://github.com/pybind/pybind11/pull/4220>`_\n\n* A workaround for PyPy was added in the ``py::error_already_set``\n  implementation, related to PR `#1895 <https://github.com/pybind/pybind11/pull/1895>`_\n  released with v2.10.0.\n  `#4079 <https://github.com/pybind/pybind11/pull/4079>`_\n\n* Fixed compiler errors when C++23 ``std::forward_like`` is available.\n  `#4136 <https://github.com/pybind/pybind11/pull/4136>`_\n\n* Properly raise exceptions in contains methods (like when an object in unhashable).\n  `#4209 <https://github.com/pybind/pybind11/pull/4209>`_\n\n* Further improve another error in exception handling.\n  `#4232 <https://github.com/pybind/pybind11/pull/4232>`_\n\n* ``get_local_internals()`` was made compatible with\n  ``finalize_interpreter()``, fixing potential freezes during interpreter\n  finalization.\n  `#4192 <https://github.com/pybind/pybind11/pull/4192>`_\n\nPerformance and style:\n\n* Reserve space in set and STL map casters if possible. This will prevent\n  unnecessary rehashing / resizing by knowing the number of keys ahead of time\n  for Python to C++ casting. This improvement will greatly speed up the casting\n  of large unordered maps and sets.\n  `#4194 <https://github.com/pybind/pybind11/pull/4194>`_\n\n* GIL RAII scopes are non-copyable to avoid potential bugs.\n  `#4183 <https://github.com/pybind/pybind11/pull/4183>`_\n\n* Explicitly default all relevant ctors for pytypes in the ``PYBIND11_OBJECT``\n  macros and enforce the clang-tidy checks ``modernize-use-equals-default`` in\n  macros as well.\n  `#4017 <https://github.com/pybind/pybind11/pull/4017>`_\n\n* Optimize iterator advancement in C++ bindings.\n  `#4237 <https://github.com/pybind/pybind11/pull/4237>`_\n\n* Use the modern ``PyObject_GenericGetDict`` and ``PyObject_GenericSetDict``\n  for handling dynamic attribute dictionaries.\n  `#4106 <https://github.com/pybind/pybind11/pull/4106>`_\n\n* Document that users should use ``PYBIND11_NAMESPACE`` instead of using ``pybind11`` when\n  opening namespaces. Using namespace declarations and namespace qualification\n  remain the same as ``pybind11``. This is done to ensure consistent symbol\n  visibility.\n  `#4098 <https://github.com/pybind/pybind11/pull/4098>`_\n\n* Mark ``detail::forward_like`` as constexpr.\n  `#4147 <https://github.com/pybind/pybind11/pull/4147>`_\n\n* Optimize unpacking_collector when processing ``arg_v`` arguments.\n  `#4219 <https://github.com/pybind/pybind11/pull/4219>`_\n\n* Optimize casting C++ object to ``None``.\n  `#4269 <https://github.com/pybind/pybind11/pull/4269>`_\n\n\nBuild system improvements:\n\n* CMake: revert overwrite behavior, now opt-in with ``PYBIND11_PYTHONLIBS_OVERRWRITE OFF``.\n  `#4195 <https://github.com/pybind/pybind11/pull/4195>`_\n\n* Include a pkg-config file when installing pybind11, such as in the Python\n  package.\n  `#4077 <https://github.com/pybind/pybind11/pull/4077>`_\n\n* Avoid stripping debug symbols when ``CMAKE_BUILD_TYPE`` is set to ``DEBUG``\n  instead of ``Debug``.\n  `#4078 <https://github.com/pybind/pybind11/pull/4078>`_\n\n* Followup to `#3948 <https://github.com/pybind/pybind11/pull/3948>`_, fixing vcpkg again.\n  `#4123 <https://github.com/pybind/pybind11/pull/4123>`_\n\nVersion 2.10.0 (Jul 15, 2022)\n-----------------------------\n\nRemoved support for Python 2.7, Python 3.5, and MSVC 2015. Support for MSVC\n2017 is limited due to availability of CI runners; we highly recommend MSVC\n2019 or 2022 be used. Initial support added for Python 3.11.\n\nNew features:\n\n* ``py::anyset`` & ``py::frozenset`` were added, with copying (cast) to\n  ``std::set`` (similar to ``set``).\n  `#3901 <https://github.com/pybind/pybind11/pull/3901>`_\n\n* Support bytearray casting to string.\n  `#3707 <https://github.com/pybind/pybind11/pull/3707>`_\n\n* ``type_caster<std::monostate>`` was added. ``std::monostate`` is a tag type\n  that allows ``std::variant`` to act as an optional, or allows default\n  construction of a ``std::variant`` holding a non-default constructible type.\n  `#3818 <https://github.com/pybind/pybind11/pull/3818>`_\n\n* ``pybind11::capsule::set_name`` added to mutate the name of the capsule instance.\n  `#3866 <https://github.com/pybind/pybind11/pull/3866>`_\n\n* NumPy: dtype constructor from type number added, accessors corresponding to\n  Python API ``dtype.num``, ``dtype.byteorder``, ``dtype.flags`` and\n  ``dtype.alignment`` added.\n  `#3868 <https://github.com/pybind/pybind11/pull/3868>`_\n\n\nChanges:\n\n* Python 3.6 is now the minimum supported version.\n  `#3688 <https://github.com/pybind/pybind11/pull/3688>`_\n  `#3719 <https://github.com/pybind/pybind11/pull/3719>`_\n\n* The minimum version for MSVC is now 2017.\n  `#3722 <https://github.com/pybind/pybind11/pull/3722>`_\n\n* Fix issues with CPython 3.11 betas and add to supported test matrix.\n  `#3923 <https://github.com/pybind/pybind11/pull/3923>`_\n\n* ``error_already_set`` is now safer and more performant, especially for\n  exceptions with long tracebacks, by delaying computation.\n  `#1895 <https://github.com/pybind/pybind11/pull/1895>`_\n\n* Improve exception handling in python ``str`` bindings.\n  `#3826 <https://github.com/pybind/pybind11/pull/3826>`_\n\n* The bindings for capsules now have more consistent exception handling.\n  `#3825 <https://github.com/pybind/pybind11/pull/3825>`_\n\n* ``PYBIND11_OBJECT_CVT`` and ``PYBIND11_OBJECT_CVT_DEFAULT`` macro can now be\n  used to define classes in namespaces other than pybind11.\n  `#3797 <https://github.com/pybind/pybind11/pull/3797>`_\n\n* Error printing code now uses ``PYBIND11_DETAILED_ERROR_MESSAGES`` instead of\n  requiring ``NDEBUG``, allowing use with release builds if desired.\n  `#3913 <https://github.com/pybind/pybind11/pull/3913>`_\n\n* Implicit conversion of the literal ``0`` to ``pybind11::handle`` is now disabled.\n  `#4008 <https://github.com/pybind/pybind11/pull/4008>`_\n\n\nBug fixes:\n\n* Fix exception handling when ``pybind11::weakref()`` fails.\n  `#3739 <https://github.com/pybind/pybind11/pull/3739>`_\n\n* ``module_::def_submodule`` was missing proper error handling. This is fixed now.\n  `#3973 <https://github.com/pybind/pybind11/pull/3973>`_\n\n* The behavior or ``error_already_set`` was made safer and the highly opaque\n  \"Unknown internal error occurred\" message was replaced with a more helpful\n  message.\n  `#3982 <https://github.com/pybind/pybind11/pull/3982>`_\n\n* ``error_already_set::what()`` now handles non-normalized exceptions correctly.\n  `#3971 <https://github.com/pybind/pybind11/pull/3971>`_\n\n* Support older C++ compilers where filesystem is not yet part of the standard\n  library and is instead included in ``std::experimental::filesystem``.\n  `#3840 <https://github.com/pybind/pybind11/pull/3840>`_\n\n* Fix ``-Wfree-nonheap-object`` warnings produced by GCC by avoiding returning\n  pointers to static objects with ``return_value_policy::take_ownership``.\n  `#3946 <https://github.com/pybind/pybind11/pull/3946>`_\n\n* Fix cast from pytype rvalue to another pytype.\n  `#3949 <https://github.com/pybind/pybind11/pull/3949>`_\n\n* Ensure proper behavior when garbage collecting classes with dynamic attributes in Python >=3.9.\n  `#4051 <https://github.com/pybind/pybind11/pull/4051>`_\n\n* A couple long-standing ``PYBIND11_NAMESPACE``\n  ``__attribute__((visibility(\"hidden\")))`` inconsistencies are now fixed\n  (affects only unusual environments).\n  `#4043 <https://github.com/pybind/pybind11/pull/4043>`_\n\n* ``pybind11::detail::get_internals()`` is now resilient to in-flight Python\n  exceptions.\n  `#3981 <https://github.com/pybind/pybind11/pull/3981>`_\n\n* Arrays with a dimension of size 0 are now properly converted to dynamic Eigen\n  matrices (more common in NumPy 1.23).\n  `#4038 <https://github.com/pybind/pybind11/pull/4038>`_\n\n* Avoid catching unrelated errors when importing NumPy.\n  `#3974 <https://github.com/pybind/pybind11/pull/3974>`_\n\nPerformance and style:\n\n* Added an accessor overload of ``(object &&key)`` to reference steal the\n  object when using python types as keys. This prevents unnecessary reference\n  count overhead for attr, dictionary, tuple, and sequence look ups. Added\n  additional regression tests. Fixed a performance bug the caused accessor\n  assignments to potentially perform unnecessary copies.\n  `#3970 <https://github.com/pybind/pybind11/pull/3970>`_\n\n* Perfect forward all args of ``make_iterator``.\n  `#3980 <https://github.com/pybind/pybind11/pull/3980>`_\n\n* Avoid potential bug in pycapsule destructor by adding an ``error_guard`` to\n  one of the dtors.\n  `#3958 <https://github.com/pybind/pybind11/pull/3958>`_\n\n* Optimize dictionary access in ``strip_padding`` for numpy.\n  `#3994 <https://github.com/pybind/pybind11/pull/3994>`_\n\n* ``stl_bind.h`` bindings now take slice args as a const-ref.\n  `#3852 <https://github.com/pybind/pybind11/pull/3852>`_\n\n* Made slice constructor more consistent, and improve performance of some\n  casters by allowing reference stealing.\n  `#3845 <https://github.com/pybind/pybind11/pull/3845>`_\n\n* Change numpy dtype from_args method to use const ref.\n  `#3878 <https://github.com/pybind/pybind11/pull/3878>`_\n\n* Follow rule of three to ensure ``PyErr_Restore`` is called only once.\n  `#3872 <https://github.com/pybind/pybind11/pull/3872>`_\n\n* Added missing perfect forwarding for ``make_iterator`` functions.\n  `#3860 <https://github.com/pybind/pybind11/pull/3860>`_\n\n* Optimize c++ to python function casting by using the rvalue caster.\n  `#3966 <https://github.com/pybind/pybind11/pull/3966>`_\n\n* Optimize Eigen sparse matrix casting by removing unnecessary temporary.\n  `#4064 <https://github.com/pybind/pybind11/pull/4064>`_\n\n* Avoid potential implicit copy/assignment constructors causing double free in\n  ``strdup_gaurd``.\n  `#3905 <https://github.com/pybind/pybind11/pull/3905>`_\n\n* Enable clang-tidy checks ``misc-definitions-in-headers``,\n  ``modernize-loop-convert``, and ``modernize-use-nullptr``.\n  `#3881 <https://github.com/pybind/pybind11/pull/3881>`_\n  `#3988 <https://github.com/pybind/pybind11/pull/3988>`_\n\n\nBuild system improvements:\n\n* CMake: Fix file extension on Windows with cp36 and cp37 using FindPython.\n  `#3919 <https://github.com/pybind/pybind11/pull/3919>`_\n\n* CMake: Support multiple Python targets (such as on vcpkg).\n  `#3948 <https://github.com/pybind/pybind11/pull/3948>`_\n\n* CMake: Fix issue with NVCC on Windows.\n  `#3947 <https://github.com/pybind/pybind11/pull/3947>`_\n\n* CMake: Drop the bitness check on cross compiles (like targeting WebAssembly\n  via Emscripten).\n  `#3959 <https://github.com/pybind/pybind11/pull/3959>`_\n\n* Add MSVC builds in debug mode to CI.\n  `#3784 <https://github.com/pybind/pybind11/pull/3784>`_\n\n* MSVC 2022 C++20 coverage was added to GitHub Actions, including Eigen.\n  `#3732 <https://github.com/pybind/pybind11/pull/3732>`_,\n  `#3741 <https://github.com/pybind/pybind11/pull/3741>`_\n\n\nBackend and tidying up:\n\n* New theme for the documentation.\n  `#3109 <https://github.com/pybind/pybind11/pull/3109>`_\n\n* Remove idioms in code comments.  Use more inclusive language.\n  `#3809 <https://github.com/pybind/pybind11/pull/3809>`_\n\n* ``#include <iostream>`` was removed from the ``pybind11/stl.h`` header. Your\n  project may break if it has a transitive dependency on this include. The fix\n  is to \"Include What You Use\".\n  `#3928 <https://github.com/pybind/pybind11/pull/3928>`_\n\n* Avoid ``setup.py <command>`` usage in internal tests.\n  `#3734 <https://github.com/pybind/pybind11/pull/3734>`_\n\n\nVersion 2.9.2 (Mar 29, 2022)\n----------------------------\n\nChanges:\n\n* Enum now has an ``__index__`` method on Python <3.8 too.\n  `#3700 <https://github.com/pybind/pybind11/pull/3700>`_\n\n* Local internals are now cleared after finalizing the interpreter.\n  `#3744 <https://github.com/pybind/pybind11/pull/3744>`_\n\nBug fixes:\n\n* Better support for Python 3.11 alphas.\n  `#3694 <https://github.com/pybind/pybind11/pull/3694>`_\n\n* ``PYBIND11_TYPE_CASTER`` now uses fully qualified symbols, so it can be used\n  outside of ``pybind11::detail``.\n  `#3758 <https://github.com/pybind/pybind11/pull/3758>`_\n\n* Some fixes for PyPy 3.9.\n  `#3768 <https://github.com/pybind/pybind11/pull/3768>`_\n\n* Fixed a potential memleak in PyPy in ``get_type_override``.\n  `#3774 <https://github.com/pybind/pybind11/pull/3774>`_\n\n* Fix usage of ``VISIBILITY_INLINES_HIDDEN``.\n  `#3721 <https://github.com/pybind/pybind11/pull/3721>`_\n\n\nBuild system improvements:\n\n* Uses ``sysconfig`` module to determine installation locations on Python >=\n  3.10, instead of ``distutils`` which has been deprecated.\n  `#3764 <https://github.com/pybind/pybind11/pull/3764>`_\n\n* Support Catch 2.13.5+ (supporting GLIBC 2.34+).\n  `#3679 <https://github.com/pybind/pybind11/pull/3679>`_\n\n* Fix test failures with numpy 1.22 by ignoring whitespace when comparing\n  ``str()`` of dtypes.\n  `#3682 <https://github.com/pybind/pybind11/pull/3682>`_\n\n\nBackend and tidying up:\n\n* clang-tidy: added ``readability-qualified-auto``,\n  ``readability-braces-around-statements``,\n  ``cppcoreguidelines-prefer-member-initializer``,\n  ``clang-analyzer-optin.performance.Padding``,\n  ``cppcoreguidelines-pro-type-static-cast-downcast``, and\n  ``readability-inconsistent-declaration-parameter-name``.\n  `#3702 <https://github.com/pybind/pybind11/pull/3702>`_,\n  `#3699 <https://github.com/pybind/pybind11/pull/3699>`_,\n  `#3716 <https://github.com/pybind/pybind11/pull/3716>`_,\n  `#3709 <https://github.com/pybind/pybind11/pull/3709>`_\n\n* clang-format was added to the pre-commit actions, and the entire code base\n  automatically reformatted (after several iterations preparing for this leap).\n  `#3713 <https://github.com/pybind/pybind11/pull/3713>`_\n\n\nVersion 2.9.1 (Feb 2, 2022)\n---------------------------\n\nChanges:\n\n* If possible, attach Python exception with ``py::raise_from`` to ``TypeError``\n  when casting from C++ to Python. This will give additional info if Python\n  exceptions occur in the caster. Adds a test case of trying to convert a set\n  from C++ to Python when the hash function is not defined in Python.\n  `#3605 <https://github.com/pybind/pybind11/pull/3605>`_\n\n* Add a mapping of C++11 nested exceptions to their Python exception\n  equivalent using ``py::raise_from``. This attaches the nested exceptions in\n  Python using the ``__cause__`` field.\n  `#3608 <https://github.com/pybind/pybind11/pull/3608>`_\n\n* Propagate Python exception traceback using ``raise_from`` if a pybind11\n  function runs out of overloads.\n  `#3671 <https://github.com/pybind/pybind11/pull/3671>`_\n\n* ``py::multiple_inheritance`` is now only needed when C++ bases are hidden\n  from pybind11.\n  `#3650 <https://github.com/pybind/pybind11/pull/3650>`_ and\n  `#3659 <https://github.com/pybind/pybind11/pull/3659>`_\n\n\nBug fixes:\n\n* Remove a boolean cast in ``numpy.h`` that causes MSVC C4800 warnings when\n  compiling against Python 3.10 or newer.\n  `#3669 <https://github.com/pybind/pybind11/pull/3669>`_\n\n* Render ``py::bool_`` and ``py::float_`` as ``bool`` and ``float``\n  respectively.\n  `#3622 <https://github.com/pybind/pybind11/pull/3622>`_\n\nBuild system improvements:\n\n* Fix CMake extension suffix computation on Python 3.10+.\n  `#3663 <https://github.com/pybind/pybind11/pull/3663>`_\n\n* Allow ``CMAKE_ARGS`` to override CMake args in pybind11's own ``setup.py``.\n  `#3577 <https://github.com/pybind/pybind11/pull/3577>`_\n\n* Remove a few deprecated c-headers.\n  `#3610 <https://github.com/pybind/pybind11/pull/3610>`_\n\n* More uniform handling of test targets.\n  `#3590 <https://github.com/pybind/pybind11/pull/3590>`_\n\n* Add clang-tidy readability check to catch potentially swapped function args.\n  `#3611 <https://github.com/pybind/pybind11/pull/3611>`_\n\n\nVersion 2.9.0 (Dec 28, 2021)\n----------------------------\n\nThis is the last version to support Python 2.7 and 3.5.\n\nNew Features:\n\n* Allow ``py::args`` to be followed by other arguments; the remaining arguments\n  are implicitly keyword-only, as if a ``py::kw_only{}`` annotation had been\n  used.\n  `#3402 <https://github.com/pybind/pybind11/pull/3402>`_\n\nChanges:\n\n* Make str/bytes/memoryview more interoperable with ``std::string_view``.\n  `#3521 <https://github.com/pybind/pybind11/pull/3521>`_\n\n* Replace ``_`` with ``const_name`` in internals, avoid defining ``pybind::_``\n  if ``_`` defined as macro (common gettext usage)\n  `#3423 <https://github.com/pybind/pybind11/pull/3423>`_\n\n\nBug fixes:\n\n* Fix a rare warning about extra copy in an Eigen constructor.\n  `#3486 <https://github.com/pybind/pybind11/pull/3486>`_\n\n* Fix caching of the C++ overrides.\n  `#3465 <https://github.com/pybind/pybind11/pull/3465>`_\n\n* Add missing ``std::forward`` calls to some ``cpp_function`` overloads.\n  `#3443 <https://github.com/pybind/pybind11/pull/3443>`_\n\n* Support PyPy 7.3.7 and the PyPy3.8 beta. Test python-3.11 on PRs with the\n  ``python dev`` label.\n  `#3419 <https://github.com/pybind/pybind11/pull/3419>`_\n\n* Replace usage of deprecated ``Eigen::MappedSparseMatrix`` with\n  ``Eigen::Map<Eigen::SparseMatrix<...>>`` for Eigen 3.3+.\n  `#3499 <https://github.com/pybind/pybind11/pull/3499>`_\n\n* Tweaks to support Microsoft Visual Studio 2022.\n  `#3497 <https://github.com/pybind/pybind11/pull/3497>`_\n\nBuild system improvements:\n\n* Nicer CMake printout and IDE organisation for pybind11's own tests.\n  `#3479 <https://github.com/pybind/pybind11/pull/3479>`_\n\n* CMake: report version type as part of the version string to avoid a spurious\n  space in the package status message.\n  `#3472 <https://github.com/pybind/pybind11/pull/3472>`_\n\n* Flags starting with ``-g`` in ``$CFLAGS`` and ``$CPPFLAGS`` are no longer\n  overridden by ``.Pybind11Extension``.\n  `#3436 <https://github.com/pybind/pybind11/pull/3436>`_\n\n* Ensure ThreadPool is closed in ``setup_helpers``.\n  `#3548 <https://github.com/pybind/pybind11/pull/3548>`_\n\n* Avoid LTS on ``mips64`` and ``ppc64le`` (reported broken).\n  `#3557 <https://github.com/pybind/pybind11/pull/3557>`_\n\n\nv2.8.1 (Oct 27, 2021)\n---------------------\n\nChanges and additions:\n\n* The simple namespace creation shortcut added in 2.8.0 was deprecated due to\n  usage of CPython internal API, and will be removed soon. Use\n  ``py::module_::import(\"types\").attr(\"SimpleNamespace\")``.\n  `#3374 <https://github.com/pybinyyd/pybind11/pull/3374>`_\n\n* Add C++ Exception type to throw and catch ``AttributeError``. Useful for\n  defining custom ``__setattr__`` and ``__getattr__`` methods.\n  `#3387 <https://github.com/pybind/pybind11/pull/3387>`_\n\nFixes:\n\n* Fixed the potential for dangling references when using properties with\n  ``std::optional`` types.\n  `#3376 <https://github.com/pybind/pybind11/pull/3376>`_\n\n* Modernize usage of ``PyCodeObject`` on Python 3.9+ (moving toward support for\n  Python 3.11a1)\n  `#3368 <https://github.com/pybind/pybind11/pull/3368>`_\n\n* A long-standing bug in ``eigen.h`` was fixed (originally PR #3343). The bug\n  was unmasked by newly added ``static_assert``'s in the Eigen 3.4.0 release.\n  `#3352 <https://github.com/pybind/pybind11/pull/3352>`_\n\n* Support multiple raw inclusion of CMake helper files (Conan.io does this for\n  multi-config generators).\n  `#3420 <https://github.com/pybind/pybind11/pull/3420>`_\n\n* Fix harmless warning on upcoming CMake 3.22.\n  `#3368 <https://github.com/pybind/pybind11/pull/3368>`_\n\n* Fix 2.8.0 regression with MSVC 2017 + C++17 mode + Python 3.\n  `#3407 <https://github.com/pybind/pybind11/pull/3407>`_\n\n* Fix 2.8.0 regression that caused undefined behavior (typically\n  segfaults) in ``make_key_iterator``/``make_value_iterator`` if dereferencing\n  the iterator returned a temporary value instead of a reference.\n  `#3348 <https://github.com/pybind/pybind11/pull/3348>`_\n\n\nv2.8.0 (Oct 4, 2021)\n--------------------\n\nNew features:\n\n* Added ``py::raise_from`` to enable chaining exceptions.\n  `#3215 <https://github.com/pybind/pybind11/pull/3215>`_\n\n* Allow exception translators to be optionally registered local to a module\n  instead of applying globally across all pybind11 modules. Use\n  ``register_local_exception_translator(ExceptionTranslator&& translator)``\n  instead of  ``register_exception_translator(ExceptionTranslator&&\n  translator)`` to keep your exception remapping code local to the module.\n  `#2650 <https://github.com/pybinyyd/pybind11/pull/2650>`_\n\n* Add ``make_simple_namespace`` function for instantiating Python\n  ``SimpleNamespace`` objects. **Deprecated in 2.8.1.**\n  `#2840 <https://github.com/pybind/pybind11/pull/2840>`_\n\n* ``pybind11::scoped_interpreter`` and ``initialize_interpreter`` have new\n  arguments to allow ``sys.argv`` initialization.\n  `#2341 <https://github.com/pybind/pybind11/pull/2341>`_\n\n* Allow Python builtins to be used as callbacks in CPython.\n  `#1413 <https://github.com/pybind/pybind11/pull/1413>`_\n\n* Added ``view`` to view arrays with a different datatype.\n  `#987 <https://github.com/pybind/pybind11/pull/987>`_\n\n* Implemented ``reshape`` on arrays.\n  `#984 <https://github.com/pybind/pybind11/pull/984>`_\n\n* Enable defining custom ``__new__`` methods on classes by fixing bug\n  preventing overriding methods if they have non-pybind11 siblings.\n  `#3265 <https://github.com/pybind/pybind11/pull/3265>`_\n\n* Add ``make_value_iterator()``, and fix ``make_key_iterator()`` to return\n  references instead of copies.\n  `#3293 <https://github.com/pybind/pybind11/pull/3293>`_\n\n* Improve the classes generated by ``bind_map``: `#3310 <https://github.com/pybind/pybind11/pull/3310>`_\n\n  * Change ``.items`` from an iterator to a dictionary view.\n  * Add ``.keys`` and ``.values`` (both dictionary views).\n  * Allow ``__contains__`` to take any object.\n\n* ``pybind11::custom_type_setup`` was added, for customizing the\n  ``PyHeapTypeObject`` corresponding to a class, which may be useful for\n  enabling garbage collection support, among other things.\n  `#3287 <https://github.com/pybind/pybind11/pull/3287>`_\n\n\nChanges:\n\n* Set ``__file__`` constant when running ``eval_file`` in an embedded interpreter.\n  `#3233 <https://github.com/pybind/pybind11/pull/3233>`_\n\n* Python objects and (C++17) ``std::optional`` now accepted in ``py::slice``\n  constructor.\n  `#1101 <https://github.com/pybind/pybind11/pull/1101>`_\n\n* The pybind11 proxy types ``str``, ``bytes``, ``bytearray``, ``tuple``,\n  ``list`` now consistently support passing ``ssize_t`` values for sizes and\n  indexes. Previously, only ``size_t`` was accepted in several interfaces.\n  `#3219 <https://github.com/pybind/pybind11/pull/3219>`_\n\n* Avoid evaluating ``PYBIND11_TLS_REPLACE_VALUE`` arguments more than once.\n  `#3290 <https://github.com/pybind/pybind11/pull/3290>`_\n\nFixes:\n\n* Bug fix: enum value's ``__int__`` returning non-int when underlying type is\n  bool or of char type.\n  `#1334 <https://github.com/pybind/pybind11/pull/1334>`_\n\n* Fixes bug in setting error state in Capsule's pointer methods.\n  `#3261 <https://github.com/pybind/pybind11/pull/3261>`_\n\n* A long-standing memory leak in ``py::cpp_function::initialize`` was fixed.\n  `#3229 <https://github.com/pybind/pybind11/pull/3229>`_\n\n* Fixes thread safety for some ``pybind11::type_caster`` which require lifetime\n  extension, such as for ``std::string_view``.\n  `#3237 <https://github.com/pybind/pybind11/pull/3237>`_\n\n* Restore compatibility with gcc 4.8.4 as distributed by ubuntu-trusty, linuxmint-17.\n  `#3270 <https://github.com/pybind/pybind11/pull/3270>`_\n\n\nBuild system improvements:\n\n* Fix regression in CMake Python package config: improper use of absolute path.\n  `#3144 <https://github.com/pybind/pybind11/pull/3144>`_\n\n* Cached Python version information could become stale when CMake was re-run\n  with a different Python version. The build system now detects this and\n  updates this information.\n  `#3299 <https://github.com/pybind/pybind11/pull/3299>`_\n\n* Specified UTF8-encoding in setup.py calls of open().\n  `#3137 <https://github.com/pybind/pybind11/pull/3137>`_\n\n* Fix a harmless warning from CMake 3.21 with the classic Python discovery.\n  `#3220 <https://github.com/pybind/pybind11/pull/3220>`_\n\n* Eigen repo and version can now be specified as cmake options.\n  `#3324 <https://github.com/pybind/pybind11/pull/3324>`_\n\n\nBackend and tidying up:\n\n* Reduced thread-local storage required for keeping alive temporary data for\n  type conversion to one key per ABI version, rather than one key per extension\n  module.  This makes the total thread-local storage required by pybind11 2\n  keys per ABI version.\n  `#3275 <https://github.com/pybind/pybind11/pull/3275>`_\n\n* Optimize NumPy array construction with additional moves.\n  `#3183 <https://github.com/pybind/pybind11/pull/3183>`_\n\n* Conversion to ``std::string`` and ``std::string_view`` now avoids making an\n  extra copy of the data on Python >= 3.3.\n  `#3257 <https://github.com/pybind/pybind11/pull/3257>`_\n\n* Remove const modifier from certain C++ methods on Python collections\n  (``list``, ``set``, ``dict``) such as (``clear()``, ``append()``,\n  ``insert()``, etc...) and annotated them with ``py-non-const``.\n\n* Enable readability ``clang-tidy-const-return`` and remove useless consts.\n  `#3254 <https://github.com/pybind/pybind11/pull/3254>`_\n  `#3194 <https://github.com/pybind/pybind11/pull/3194>`_\n\n* The clang-tidy ``google-explicit-constructor`` option was enabled.\n  `#3250 <https://github.com/pybind/pybind11/pull/3250>`_\n\n* Mark a pytype move constructor as noexcept (perf).\n  `#3236 <https://github.com/pybind/pybind11/pull/3236>`_\n\n* Enable clang-tidy check to guard against inheritance slicing.\n  `#3210 <https://github.com/pybind/pybind11/pull/3210>`_\n\n* Legacy warning suppression pragma were removed from eigen.h. On Unix\n  platforms, please use -isystem for Eigen include directories, to suppress\n  compiler warnings originating from Eigen headers. Note that CMake does this\n  by default. No adjustments are needed for Windows.\n  `#3198 <https://github.com/pybind/pybind11/pull/3198>`_\n\n* Format pybind11 with isort consistent ordering of imports\n  `#3195 <https://github.com/pybind/pybind11/pull/3195>`_\n\n* The warnings-suppression \"pragma clamp\" at the top/bottom of pybind11 was\n  removed, clearing the path to refactoring and IWYU cleanup.\n  `#3186 <https://github.com/pybind/pybind11/pull/3186>`_\n\n* Enable most bugprone checks in clang-tidy and fix the found potential bugs\n  and poor coding styles.\n  `#3166 <https://github.com/pybind/pybind11/pull/3166>`_\n\n* Add ``clang-tidy-readability`` rules to make boolean casts explicit improving\n  code readability. Also enabled other misc and readability clang-tidy checks.\n  `#3148 <https://github.com/pybind/pybind11/pull/3148>`_\n\n* Move object in ``.pop()`` for list.\n  `#3116 <https://github.com/pybind/pybind11/pull/3116>`_\n\n\n\n\nv2.7.1 (Aug 3, 2021)\n---------------------\n\nMinor missing functionality added:\n\n* Allow Python builtins to be used as callbacks in CPython.\n  `#1413 <https://github.com/pybind/pybind11/pull/1413>`_\n\nBug fixes:\n\n* Fix regression in CMake Python package config: improper use of absolute path.\n  `#3144 <https://github.com/pybind/pybind11/pull/3144>`_\n\n* Fix Mingw64 and add to the CI testing matrix.\n  `#3132 <https://github.com/pybind/pybind11/pull/3132>`_\n\n* Specified UTF8-encoding in setup.py calls of open().\n  `#3137 <https://github.com/pybind/pybind11/pull/3137>`_\n\n* Add clang-tidy-readability rules to make boolean casts explicit improving\n  code readability. Also enabled other misc and readability clang-tidy checks.\n  `#3148 <https://github.com/pybind/pybind11/pull/3148>`_\n\n* Move object in ``.pop()`` for list.\n  `#3116 <https://github.com/pybind/pybind11/pull/3116>`_\n\nBackend and tidying up:\n\n* Removed and fixed warning suppressions.\n  `#3127 <https://github.com/pybind/pybind11/pull/3127>`_\n  `#3129 <https://github.com/pybind/pybind11/pull/3129>`_\n  `#3135 <https://github.com/pybind/pybind11/pull/3135>`_\n  `#3141 <https://github.com/pybind/pybind11/pull/3141>`_\n  `#3142 <https://github.com/pybind/pybind11/pull/3142>`_\n  `#3150 <https://github.com/pybind/pybind11/pull/3150>`_\n  `#3152 <https://github.com/pybind/pybind11/pull/3152>`_\n  `#3160 <https://github.com/pybind/pybind11/pull/3160>`_\n  `#3161 <https://github.com/pybind/pybind11/pull/3161>`_\n\n\nv2.7.0 (Jul 16, 2021)\n---------------------\n\nNew features:\n\n* Enable ``py::implicitly_convertible<py::none, ...>`` for\n  ``py::class_``-wrapped types.\n  `#3059 <https://github.com/pybind/pybind11/pull/3059>`_\n\n* Allow function pointer extraction from overloaded functions.\n  `#2944 <https://github.com/pybind/pybind11/pull/2944>`_\n\n* NumPy: added ``.char_()`` to type which gives the NumPy public ``char``\n  result, which also distinguishes types by bit length (unlike ``.kind()``).\n  `#2864 <https://github.com/pybind/pybind11/pull/2864>`_\n\n* Add ``pybind11::bytearray`` to manipulate ``bytearray`` similar to ``bytes``.\n  `#2799 <https://github.com/pybind/pybind11/pull/2799>`_\n\n* ``pybind11/stl/filesystem.h`` registers a type caster that, on C++17/Python\n  3.6+, converts ``std::filesystem::path`` to ``pathlib.Path`` and any\n  ``os.PathLike`` to ``std::filesystem::path``.\n  `#2730 <https://github.com/pybind/pybind11/pull/2730>`_\n\n* A ``PYBIND11_VERSION_HEX`` define was added, similar to ``PY_VERSION_HEX``.\n  `#3120 <https://github.com/pybind/pybind11/pull/3120>`_\n\n\n\nChanges:\n\n* ``py::str`` changed to exclusively hold ``PyUnicodeObject``. Previously\n  ``py::str`` could also hold ``bytes``, which is probably surprising, was\n  never documented, and can mask bugs (e.g. accidental use of ``py::str``\n  instead of ``py::bytes``).\n  `#2409 <https://github.com/pybind/pybind11/pull/2409>`_\n\n* Add a safety guard to ensure that the Python GIL is held when C++ calls back\n  into Python via ``object_api<>::operator()`` (e.g. ``py::function``\n  ``__call__``).  (This feature is available for Python 3.6+ only.)\n  `#2919 <https://github.com/pybind/pybind11/pull/2919>`_\n\n* Catch a missing ``self`` argument in calls to ``__init__()``.\n  `#2914 <https://github.com/pybind/pybind11/pull/2914>`_\n\n* Use ``std::string_view`` if available to avoid a copy when passing an object\n  to a ``std::ostream``.\n  `#3042 <https://github.com/pybind/pybind11/pull/3042>`_\n\n* An important warning about thread safety was added to the ``iostream.h``\n  documentation; attempts to make ``py::scoped_ostream_redirect`` thread safe\n  have been removed, as it was only partially effective.\n  `#2995 <https://github.com/pybind/pybind11/pull/2995>`_\n\n\nFixes:\n\n* Performance: avoid unnecessary strlen calls.\n  `#3058 <https://github.com/pybind/pybind11/pull/3058>`_\n\n* Fix auto-generated documentation string when using ``const T`` in\n  ``pyarray_t``.\n  `#3020 <https://github.com/pybind/pybind11/pull/3020>`_\n\n* Unify error messages thrown by ``simple_collector``/``unpacking_collector``.\n  `#3013 <https://github.com/pybind/pybind11/pull/3013>`_\n\n* ``pybind11::builtin_exception`` is now explicitly exported, which means the\n  types included/defined in different modules are identical, and exceptions\n  raised in different modules can be caught correctly. The documentation was\n  updated to explain that custom exceptions that are used across module\n  boundaries need to be explicitly exported as well.\n  `#2999 <https://github.com/pybind/pybind11/pull/2999>`_\n\n* Fixed exception when printing UTF-8 to a ``scoped_ostream_redirect``.\n  `#2982 <https://github.com/pybind/pybind11/pull/2982>`_\n\n* Pickle support enhancement: ``setstate`` implementation will attempt to\n  ``setattr`` ``__dict__`` only if the unpickled ``dict`` object is not empty,\n  to not force use of ``py::dynamic_attr()`` unnecessarily.\n  `#2972 <https://github.com/pybind/pybind11/pull/2972>`_\n\n* Allow negative timedelta values to roundtrip.\n  `#2870 <https://github.com/pybind/pybind11/pull/2870>`_\n\n* Fix unchecked errors could potentially swallow signals/other exceptions.\n  `#2863 <https://github.com/pybind/pybind11/pull/2863>`_\n\n* Add null pointer check with ``std::localtime``.\n  `#2846 <https://github.com/pybind/pybind11/pull/2846>`_\n\n* Fix the ``weakref`` constructor from ``py::object`` to create a new\n  ``weakref`` on conversion.\n  `#2832 <https://github.com/pybind/pybind11/pull/2832>`_\n\n* Avoid relying on exceptions in C++17 when getting a ``shared_ptr`` holder\n  from a ``shared_from_this`` class.\n  `#2819 <https://github.com/pybind/pybind11/pull/2819>`_\n\n* Allow the codec's exception to be raised instead of :code:`RuntimeError` when\n  casting from :code:`py::str` to :code:`std::string`.\n  `#2903 <https://github.com/pybind/pybind11/pull/2903>`_\n\n\nBuild system improvements:\n\n* In ``setup_helpers.py``, test for platforms that have some multiprocessing\n  features but lack semaphores, which ``ParallelCompile`` requires.\n  `#3043 <https://github.com/pybind/pybind11/pull/3043>`_\n\n* Fix ``pybind11_INCLUDE_DIR`` in case ``CMAKE_INSTALL_INCLUDEDIR`` is\n  absolute.\n  `#3005 <https://github.com/pybind/pybind11/pull/3005>`_\n\n* Fix bug not respecting ``WITH_SOABI`` or ``WITHOUT_SOABI`` to CMake.\n  `#2938 <https://github.com/pybind/pybind11/pull/2938>`_\n\n* Fix the default ``Pybind11Extension`` compilation flags with a Mingw64 python.\n  `#2921 <https://github.com/pybind/pybind11/pull/2921>`_\n\n* Clang on Windows: do not pass ``/MP`` (ignored flag).\n  `#2824 <https://github.com/pybind/pybind11/pull/2824>`_\n\n* ``pybind11.setup_helpers.intree_extensions`` can be used to generate\n  ``Pybind11Extension`` instances from cpp files placed in the Python package\n  source tree.\n  `#2831 <https://github.com/pybind/pybind11/pull/2831>`_\n\nBackend and tidying up:\n\n* Enable clang-tidy performance, readability, and modernization checks\n  throughout the codebase to enforce best coding practices.\n  `#3046 <https://github.com/pybind/pybind11/pull/3046>`_,\n  `#3049 <https://github.com/pybind/pybind11/pull/3049>`_,\n  `#3051 <https://github.com/pybind/pybind11/pull/3051>`_,\n  `#3052 <https://github.com/pybind/pybind11/pull/3052>`_,\n  `#3080 <https://github.com/pybind/pybind11/pull/3080>`_, and\n  `#3094 <https://github.com/pybind/pybind11/pull/3094>`_\n\n\n* Checks for common misspellings were added to the pre-commit hooks.\n  `#3076 <https://github.com/pybind/pybind11/pull/3076>`_\n\n* Changed ``Werror`` to stricter ``Werror-all`` for Intel compiler and fixed\n  minor issues.\n  `#2948 <https://github.com/pybind/pybind11/pull/2948>`_\n\n* Fixed compilation with GCC < 5 when the user defines ``_GLIBCXX_USE_CXX11_ABI``.\n  `#2956 <https://github.com/pybind/pybind11/pull/2956>`_\n\n* Added nox support for easier local testing and linting of contributions.\n  `#3101 <https://github.com/pybind/pybind11/pull/3101>`_ and\n  `#3121 <https://github.com/pybind/pybind11/pull/3121>`_\n\n* Avoid RTD style issue with docutils 0.17+.\n  `#3119 <https://github.com/pybind/pybind11/pull/3119>`_\n\n* Support pipx run, such as ``pipx run pybind11 --include`` for a quick compile.\n  `#3117 <https://github.com/pybind/pybind11/pull/3117>`_\n\n\n\nv2.6.2 (Jan 26, 2021)\n---------------------\n\nMinor missing functionality added:\n\n* enum: add missing Enum.value property.\n  `#2739 <https://github.com/pybind/pybind11/pull/2739>`_\n\n* Allow thread termination to be avoided during shutdown for CPython 3.7+ via\n  ``.disarm`` for ``gil_scoped_acquire``/``gil_scoped_release``.\n  `#2657 <https://github.com/pybind/pybind11/pull/2657>`_\n\nFixed or improved behavior in a few special cases:\n\n* Fix bug where the constructor of ``object`` subclasses would not throw on\n  being passed a Python object of the wrong type.\n  `#2701 <https://github.com/pybind/pybind11/pull/2701>`_\n\n* The ``type_caster`` for integers does not convert Python objects with\n  ``__int__`` anymore with ``noconvert`` or during the first round of trying\n  overloads.\n  `#2698 <https://github.com/pybind/pybind11/pull/2698>`_\n\n* When casting to a C++ integer, ``__index__`` is always called and not\n  considered as conversion, consistent with Python 3.8+.\n  `#2801 <https://github.com/pybind/pybind11/pull/2801>`_\n\nBuild improvements:\n\n* Setup helpers: ``extra_compile_args`` and ``extra_link_args`` automatically set by\n  Pybind11Extension are now prepended, which allows them to be overridden\n  by user-set ``extra_compile_args`` and ``extra_link_args``.\n  `#2808 <https://github.com/pybind/pybind11/pull/2808>`_\n\n* Setup helpers: Don't trigger unused parameter warning.\n  `#2735 <https://github.com/pybind/pybind11/pull/2735>`_\n\n* CMake: Support running with ``--warn-uninitialized`` active.\n  `#2806 <https://github.com/pybind/pybind11/pull/2806>`_\n\n* CMake: Avoid error if included from two submodule directories.\n  `#2804 <https://github.com/pybind/pybind11/pull/2804>`_\n\n* CMake: Fix ``STATIC`` / ``SHARED`` being ignored in FindPython mode.\n  `#2796 <https://github.com/pybind/pybind11/pull/2796>`_\n\n* CMake: Respect the setting for ``CMAKE_CXX_VISIBILITY_PRESET`` if defined.\n  `#2793 <https://github.com/pybind/pybind11/pull/2793>`_\n\n* CMake: Fix issue with FindPython2/FindPython3 not working with ``pybind11::embed``.\n  `#2662 <https://github.com/pybind/pybind11/pull/2662>`_\n\n* CMake: mixing local and installed pybind11's would prioritize the installed\n  one over the local one (regression in 2.6.0).\n  `#2716 <https://github.com/pybind/pybind11/pull/2716>`_\n\n\nBug fixes:\n\n* Fixed segfault in multithreaded environments when using\n  ``scoped_ostream_redirect``.\n  `#2675 <https://github.com/pybind/pybind11/pull/2675>`_\n\n* Leave docstring unset when all docstring-related options are disabled, rather\n  than set an empty string.\n  `#2745 <https://github.com/pybind/pybind11/pull/2745>`_\n\n* The module key in builtins that pybind11 uses to store its internals changed\n  from std::string to a python str type (more natural on Python 2, no change on\n  Python 3).\n  `#2814 <https://github.com/pybind/pybind11/pull/2814>`_\n\n* Fixed assertion error related to unhandled (later overwritten) exception in\n  CPython 3.8 and 3.9 debug builds.\n  `#2685 <https://github.com/pybind/pybind11/pull/2685>`_\n\n* Fix ``py::gil_scoped_acquire`` assert with CPython 3.9 debug build.\n  `#2683 <https://github.com/pybind/pybind11/pull/2683>`_\n\n* Fix issue with a test failing on pytest 6.2.\n  `#2741 <https://github.com/pybind/pybind11/pull/2741>`_\n\nWarning fixes:\n\n* Fix warning modifying constructor parameter 'flag' that shadows a field of\n  'set_flag' ``[-Wshadow-field-in-constructor-modified]``.\n  `#2780 <https://github.com/pybind/pybind11/pull/2780>`_\n\n* Suppressed some deprecation warnings about old-style\n  ``__init__``/``__setstate__`` in the tests.\n  `#2759 <https://github.com/pybind/pybind11/pull/2759>`_\n\nValgrind work:\n\n* Fix invalid access when calling a pybind11 ``__init__`` on a non-pybind11\n  class instance.\n  `#2755 <https://github.com/pybind/pybind11/pull/2755>`_\n\n* Fixed various minor memory leaks in pybind11's test suite.\n  `#2758 <https://github.com/pybind/pybind11/pull/2758>`_\n\n* Resolved memory leak in cpp_function initialization when exceptions occurred.\n  `#2756 <https://github.com/pybind/pybind11/pull/2756>`_\n\n* Added a Valgrind build, checking for leaks and memory-related UB, to CI.\n  `#2746 <https://github.com/pybind/pybind11/pull/2746>`_\n\nCompiler support:\n\n* Intel compiler was not activating C++14 support due to a broken define.\n  `#2679 <https://github.com/pybind/pybind11/pull/2679>`_\n\n* Support ICC and NVIDIA HPC SDK in C++17 mode.\n  `#2729 <https://github.com/pybind/pybind11/pull/2729>`_\n\n* Support Intel OneAPI compiler (ICC 20.2) and add to CI.\n  `#2573 <https://github.com/pybind/pybind11/pull/2573>`_\n\n\n\nv2.6.1 (Nov 11, 2020)\n---------------------\n\n* ``py::exec``, ``py::eval``, and ``py::eval_file`` now add the builtins module\n  as ``\"__builtins__\"`` to their ``globals`` argument, better matching ``exec``\n  and ``eval`` in pure Python.\n  `#2616 <https://github.com/pybind/pybind11/pull/2616>`_\n\n* ``setup_helpers`` will no longer set a minimum macOS version higher than the\n  current version.\n  `#2622 <https://github.com/pybind/pybind11/pull/2622>`_\n\n* Allow deleting static properties.\n  `#2629 <https://github.com/pybind/pybind11/pull/2629>`_\n\n* Seal a leak in ``def_buffer``, cleaning up the ``capture`` object after the\n  ``class_`` object goes out of scope.\n  `#2634 <https://github.com/pybind/pybind11/pull/2634>`_\n\n* ``pybind11_INCLUDE_DIRS`` was incorrect, potentially causing a regression if\n  it was expected to include ``PYTHON_INCLUDE_DIRS`` (please use targets\n  instead).\n  `#2636 <https://github.com/pybind/pybind11/pull/2636>`_\n\n* Added parameter names to the ``py::enum_`` constructor and methods, avoiding\n  ``arg0`` in the generated docstrings.\n  `#2637 <https://github.com/pybind/pybind11/pull/2637>`_\n\n* Added ``needs_recompile`` optional function to the ``ParallelCompiler``\n  helper, to allow a recompile to be skipped based on a user-defined function.\n  `#2643 <https://github.com/pybind/pybind11/pull/2643>`_\n\n\nv2.6.0 (Oct 21, 2020)\n---------------------\n\nSee :ref:`upgrade-guide-2.6` for help upgrading to the new version.\n\nNew features:\n\n* Keyword-only arguments supported in Python 2 or 3 with ``py::kw_only()``.\n  `#2100 <https://github.com/pybind/pybind11/pull/2100>`_\n\n* Positional-only arguments supported in Python 2 or 3 with ``py::pos_only()``.\n  `#2459 <https://github.com/pybind/pybind11/pull/2459>`_\n\n* ``py::is_final()`` class modifier to block subclassing (CPython only).\n  `#2151 <https://github.com/pybind/pybind11/pull/2151>`_\n\n* Added ``py::prepend()``, allowing a function to be placed at the beginning of\n  the overload chain.\n  `#1131 <https://github.com/pybind/pybind11/pull/1131>`_\n\n* Access to the type object now provided with ``py::type::of<T>()`` and\n  ``py::type::of(h)``.\n  `#2364 <https://github.com/pybind/pybind11/pull/2364>`_\n\n* Perfect forwarding support for methods.\n  `#2048 <https://github.com/pybind/pybind11/pull/2048>`_\n\n* Added ``py::error_already_set::discard_as_unraisable()``.\n  `#2372 <https://github.com/pybind/pybind11/pull/2372>`_\n\n* ``py::hash`` is now public.\n  `#2217 <https://github.com/pybind/pybind11/pull/2217>`_\n\n* ``py::class_<union_type>`` is now supported. Note that writing to one data\n  member of the union and reading another (type punning) is UB in C++. Thus\n  pybind11-bound enums should never be used for such conversions.\n  `#2320 <https://github.com/pybind/pybind11/pull/2320>`_.\n\n* Classes now check local scope when registering members, allowing a subclass\n  to have a member with the same name as a parent (such as an enum).\n  `#2335 <https://github.com/pybind/pybind11/pull/2335>`_\n\nCode correctness features:\n\n* Error now thrown when ``__init__`` is forgotten on subclasses.\n  `#2152 <https://github.com/pybind/pybind11/pull/2152>`_\n\n* Throw error if conversion to a pybind11 type if the Python object isn't a\n  valid instance of that type, such as ``py::bytes(o)`` when ``py::object o``\n  isn't a bytes instance.\n  `#2349 <https://github.com/pybind/pybind11/pull/2349>`_\n\n* Throw if conversion to ``str`` fails.\n  `#2477 <https://github.com/pybind/pybind11/pull/2477>`_\n\n\nAPI changes:\n\n* ``py::module`` was renamed ``py::module_`` to avoid issues with C++20 when\n  used unqualified, but an alias ``py::module`` is provided for backward\n  compatibility.\n  `#2489 <https://github.com/pybind/pybind11/pull/2489>`_\n\n* Public constructors for ``py::module_`` have been deprecated; please use\n  ``pybind11::module_::create_extension_module`` if you were using the public\n  constructor (fairly rare after ``PYBIND11_MODULE`` was introduced).\n  `#2552 <https://github.com/pybind/pybind11/pull/2552>`_\n\n* ``PYBIND11_OVERLOAD*`` macros and ``get_overload`` function replaced by\n  correctly-named ``PYBIND11_OVERRIDE*`` and ``get_override``, fixing\n  inconsistencies in the presence of a closing ``;`` in these macros.\n  ``get_type_overload`` is deprecated.\n  `#2325 <https://github.com/pybind/pybind11/pull/2325>`_\n\nPackaging / building improvements:\n\n* The Python package was reworked to be more powerful and useful.\n  `#2433 <https://github.com/pybind/pybind11/pull/2433>`_\n\n  * :ref:`build-setuptools` is easier thanks to a new\n    ``pybind11.setup_helpers`` module, which provides utilities to use\n    setuptools with pybind11. It can be used via PEP 518, ``setup_requires``,\n    or by directly importing or copying ``setup_helpers.py`` into your project.\n\n  * CMake configuration files are now included in the Python package. Use\n    ``pybind11.get_cmake_dir()`` or ``python -m pybind11 --cmakedir`` to get\n    the directory with the CMake configuration files, or include the\n    site-packages location in your ``CMAKE_MODULE_PATH``. Or you can use the\n    new ``pybind11[global]`` extra when you install ``pybind11``, which\n    installs the CMake files and headers into your base environment in the\n    standard location.\n\n  * ``pybind11-config`` is another way to write ``python -m pybind11`` if you\n    have your PATH set up.\n\n  * Added external typing support to the helper module, code from\n    ``import pybind11`` can now be type checked.\n    `#2588 <https://github.com/pybind/pybind11/pull/2588>`_\n\n* Minimum CMake required increased to 3.4.\n  `#2338 <https://github.com/pybind/pybind11/pull/2338>`_ and\n  `#2370 <https://github.com/pybind/pybind11/pull/2370>`_\n\n  * Full integration with CMake's C++ standard system and compile features\n    replaces ``PYBIND11_CPP_STANDARD``.\n\n  * Generated config file is now portable to different Python/compiler/CMake\n    versions.\n\n  * Virtual environments prioritized if ``PYTHON_EXECUTABLE`` is not set\n    (``venv``, ``virtualenv``, and ``conda``) (similar to the new FindPython\n    mode).\n\n  * Other CMake features now natively supported, like\n    ``CMAKE_INTERPROCEDURAL_OPTIMIZATION``, ``set(CMAKE_CXX_VISIBILITY_PRESET\n    hidden)``.\n\n  * ``CUDA`` as a language is now supported.\n\n  * Helper functions ``pybind11_strip``, ``pybind11_extension``,\n    ``pybind11_find_import`` added, see :doc:`cmake/index`.\n\n  * Optional :ref:`find-python-mode` and :ref:`nopython-mode` with CMake.\n    `#2370 <https://github.com/pybind/pybind11/pull/2370>`_\n\n* Uninstall target added.\n  `#2265 <https://github.com/pybind/pybind11/pull/2265>`_ and\n  `#2346 <https://github.com/pybind/pybind11/pull/2346>`_\n\n* ``pybind11_add_module()`` now accepts an optional ``OPT_SIZE`` flag that\n  switches the binding target to size-based optimization if the global build\n  type can not always be fixed to ``MinSizeRel`` (except in debug mode, where\n  optimizations remain disabled).  ``MinSizeRel`` or this flag reduces binary\n  size quite substantially (~25% on some platforms).\n  `#2463 <https://github.com/pybind/pybind11/pull/2463>`_\n\nSmaller or developer focused features and fixes:\n\n* Moved ``mkdoc.py`` to a new repo, `pybind11-mkdoc`_. There are no longer\n  submodules in the main repo.\n\n* ``py::memoryview`` segfault fix and update, with new\n  ``py::memoryview::from_memory`` in Python 3, and documentation.\n  `#2223 <https://github.com/pybind/pybind11/pull/2223>`_\n\n* Fix for ``buffer_info`` on Python 2.\n  `#2503 <https://github.com/pybind/pybind11/pull/2503>`_\n\n* If ``__eq__`` defined but not ``__hash__``, ``__hash__`` is now set to\n  ``None``.\n  `#2291 <https://github.com/pybind/pybind11/pull/2291>`_\n\n* ``py::ellipsis`` now also works on Python 2.\n  `#2360 <https://github.com/pybind/pybind11/pull/2360>`_\n\n* Pointer to ``std::tuple`` & ``std::pair`` supported in cast.\n  `#2334 <https://github.com/pybind/pybind11/pull/2334>`_\n\n* Small fixes in NumPy support. ``py::array`` now uses ``py::ssize_t`` as first\n  argument type.\n  `#2293 <https://github.com/pybind/pybind11/pull/2293>`_\n\n* Added missing signature for ``py::array``.\n  `#2363 <https://github.com/pybind/pybind11/pull/2363>`_\n\n* ``unchecked_mutable_reference`` has access to operator ``()`` and ``[]`` when\n  const.\n  `#2514 <https://github.com/pybind/pybind11/pull/2514>`_\n\n* ``py::vectorize`` is now supported on functions that return void.\n  `#1969 <https://github.com/pybind/pybind11/pull/1969>`_\n\n* ``py::capsule`` supports ``get_pointer`` and ``set_pointer``.\n  `#1131 <https://github.com/pybind/pybind11/pull/1131>`_\n\n* Fix crash when different instances share the same pointer of the same type.\n  `#2252 <https://github.com/pybind/pybind11/pull/2252>`_\n\n* Fix for ``py::len`` not clearing Python's error state when it fails and throws.\n  `#2575 <https://github.com/pybind/pybind11/pull/2575>`_\n\n* Bugfixes related to more extensive testing, new GitHub Actions CI.\n  `#2321 <https://github.com/pybind/pybind11/pull/2321>`_\n\n* Bug in timezone issue in Eastern hemisphere midnight fixed.\n  `#2438 <https://github.com/pybind/pybind11/pull/2438>`_\n\n* ``std::chrono::time_point`` now works when the resolution is not the same as\n  the system.\n  `#2481 <https://github.com/pybind/pybind11/pull/2481>`_\n\n* Bug fixed where ``py::array_t`` could accept arrays that did not match the\n  requested ordering.\n  `#2484 <https://github.com/pybind/pybind11/pull/2484>`_\n\n* Avoid a segfault on some compilers when types are removed in Python.\n  `#2564 <https://github.com/pybind/pybind11/pull/2564>`_\n\n* ``py::arg::none()`` is now also respected when passing keyword arguments.\n  `#2611 <https://github.com/pybind/pybind11/pull/2611>`_\n\n* PyPy fixes, PyPy 7.3.x now supported, including PyPy3. (Known issue with\n  PyPy2 and Windows `#2596 <https://github.com/pybind/pybind11/issues/2596>`_).\n  `#2146 <https://github.com/pybind/pybind11/pull/2146>`_\n\n* CPython 3.9.0 workaround for undefined behavior (macOS segfault).\n  `#2576 <https://github.com/pybind/pybind11/pull/2576>`_\n\n* CPython 3.9 warning fixes.\n  `#2253 <https://github.com/pybind/pybind11/pull/2253>`_\n\n* Improved C++20 support, now tested in CI.\n  `#2489 <https://github.com/pybind/pybind11/pull/2489>`_\n  `#2599 <https://github.com/pybind/pybind11/pull/2599>`_\n\n* Improved but still incomplete debug Python interpreter support.\n  `#2025 <https://github.com/pybind/pybind11/pull/2025>`_\n\n* NVCC (CUDA 11) now supported and tested in CI.\n  `#2461 <https://github.com/pybind/pybind11/pull/2461>`_\n\n* NVIDIA PGI compilers now supported and tested in CI.\n  `#2475 <https://github.com/pybind/pybind11/pull/2475>`_\n\n* At least Intel 18 now explicitly required when compiling with Intel.\n  `#2577 <https://github.com/pybind/pybind11/pull/2577>`_\n\n* Extensive style checking in CI, with `pre-commit`_ support. Code\n  modernization, checked by clang-tidy.\n\n* Expanded docs, including new main page, new installing section, and CMake\n  helpers page, along with over a dozen new sections on existing pages.\n\n* In GitHub, new docs for contributing and new issue templates.\n\n.. _pre-commit: https://pre-commit.com\n\n.. _pybind11-mkdoc: https://github.com/pybind/pybind11-mkdoc\n\nv2.5.0 (Mar 31, 2020)\n-----------------------------------------------------\n\n* Use C++17 fold expressions in type casters, if available. This can\n  improve performance during overload resolution when functions have\n  multiple arguments.\n  `#2043 <https://github.com/pybind/pybind11/pull/2043>`_.\n\n* Changed include directory resolution in ``pybind11/__init__.py``\n  and installation in ``setup.py``. This fixes a number of open issues\n  where pybind11 headers could not be found in certain environments.\n  `#1995 <https://github.com/pybind/pybind11/pull/1995>`_.\n\n* C++20 ``char8_t`` and ``u8string`` support. `#2026\n  <https://github.com/pybind/pybind11/pull/2026>`_.\n\n* CMake: search for Python 3.9. `bb9c91\n  <https://github.com/pybind/pybind11/commit/bb9c91>`_.\n\n* Fixes for MSYS-based build environments.\n  `#2087 <https://github.com/pybind/pybind11/pull/2087>`_,\n  `#2053 <https://github.com/pybind/pybind11/pull/2053>`_.\n\n* STL bindings for ``std::vector<...>::clear``. `#2074\n  <https://github.com/pybind/pybind11/pull/2074>`_.\n\n* Read-only flag for ``py::buffer``. `#1466\n  <https://github.com/pybind/pybind11/pull/1466>`_.\n\n* Exception handling during module initialization.\n  `bf2b031 <https://github.com/pybind/pybind11/commit/bf2b031>`_.\n\n* Support linking against a CPython debug build.\n  `#2025 <https://github.com/pybind/pybind11/pull/2025>`_.\n\n* Fixed issues involving the availability and use of aligned ``new`` and\n  ``delete``. `#1988 <https://github.com/pybind/pybind11/pull/1988>`_,\n  `759221 <https://github.com/pybind/pybind11/commit/759221>`_.\n\n* Fixed a resource leak upon interpreter shutdown.\n  `#2020 <https://github.com/pybind/pybind11/pull/2020>`_.\n\n* Fixed error handling in the boolean caster.\n  `#1976 <https://github.com/pybind/pybind11/pull/1976>`_.\n\nv2.4.3 (Oct 15, 2019)\n-----------------------------------------------------\n\n* Adapt pybind11 to a C API convention change in Python 3.8. `#1950\n  <https://github.com/pybind/pybind11/pull/1950>`_.\n\nv2.4.2 (Sep 21, 2019)\n-----------------------------------------------------\n\n* Replaced usage of a C++14 only construct. `#1929\n  <https://github.com/pybind/pybind11/pull/1929>`_.\n\n* Made an ifdef future-proof for Python >= 4. `f3109d\n  <https://github.com/pybind/pybind11/commit/f3109d>`_.\n\nv2.4.1 (Sep 20, 2019)\n-----------------------------------------------------\n\n* Fixed a problem involving implicit conversion from enumerations to integers\n  on Python 3.8. `#1780 <https://github.com/pybind/pybind11/pull/1780>`_.\n\nv2.4.0 (Sep 19, 2019)\n-----------------------------------------------------\n\n* Try harder to keep pybind11-internal data structures separate when there\n  are potential ABI incompatibilities. Fixes crashes that occurred when loading\n  multiple pybind11 extensions that were e.g. compiled by GCC (libstdc++)\n  and Clang (libc++).\n  `#1588 <https://github.com/pybind/pybind11/pull/1588>`_ and\n  `c9f5a <https://github.com/pybind/pybind11/commit/c9f5a>`_.\n\n* Added support for ``__await__``, ``__aiter__``, and ``__anext__`` protocols.\n  `#1842 <https://github.com/pybind/pybind11/pull/1842>`_.\n\n* ``pybind11_add_module()``: don't strip symbols when compiling in\n  ``RelWithDebInfo`` mode. `#1980\n  <https://github.com/pybind/pybind11/pull/1980>`_.\n\n* ``enum_``: Reproduce Python behavior when comparing against invalid values\n  (e.g. ``None``, strings, etc.). Add back support for ``__invert__()``.\n  `#1912 <https://github.com/pybind/pybind11/pull/1912>`_,\n  `#1907 <https://github.com/pybind/pybind11/pull/1907>`_.\n\n* List insertion operation for ``py::list``.\n  Added ``.empty()`` to all collection types.\n  Added ``py::set::contains()`` and ``py::dict::contains()``.\n  `#1887 <https://github.com/pybind/pybind11/pull/1887>`_,\n  `#1884 <https://github.com/pybind/pybind11/pull/1884>`_,\n  `#1888 <https://github.com/pybind/pybind11/pull/1888>`_.\n\n* ``py::details::overload_cast_impl`` is available in C++11 mode, can be used\n  like ``overload_cast`` with an additional set of parentheses.\n  `#1581 <https://github.com/pybind/pybind11/pull/1581>`_.\n\n* Fixed ``get_include()`` on Conda.\n  `#1877 <https://github.com/pybind/pybind11/pull/1877>`_.\n\n* ``stl_bind.h``: negative indexing support.\n  `#1882 <https://github.com/pybind/pybind11/pull/1882>`_.\n\n* Minor CMake fix to add MinGW compatibility.\n  `#1851 <https://github.com/pybind/pybind11/pull/1851>`_.\n\n* GIL-related fixes.\n  `#1836 <https://github.com/pybind/pybind11/pull/1836>`_,\n  `8b90b <https://github.com/pybind/pybind11/commit/8b90b>`_.\n\n* Other very minor/subtle fixes and improvements.\n  `#1329 <https://github.com/pybind/pybind11/pull/1329>`_,\n  `#1910 <https://github.com/pybind/pybind11/pull/1910>`_,\n  `#1863 <https://github.com/pybind/pybind11/pull/1863>`_,\n  `#1847 <https://github.com/pybind/pybind11/pull/1847>`_,\n  `#1890 <https://github.com/pybind/pybind11/pull/1890>`_,\n  `#1860 <https://github.com/pybind/pybind11/pull/1860>`_,\n  `#1848 <https://github.com/pybind/pybind11/pull/1848>`_,\n  `#1821 <https://github.com/pybind/pybind11/pull/1821>`_,\n  `#1837 <https://github.com/pybind/pybind11/pull/1837>`_,\n  `#1833 <https://github.com/pybind/pybind11/pull/1833>`_,\n  `#1748 <https://github.com/pybind/pybind11/pull/1748>`_,\n  `#1852 <https://github.com/pybind/pybind11/pull/1852>`_.\n\nv2.3.0 (June 11, 2019)\n-----------------------------------------------------\n\n* Significantly reduced module binary size (10-20%) when compiled in C++11 mode\n  with GCC/Clang, or in any mode with MSVC. Function signatures are now always\n  precomputed at compile time (this was previously only available in C++14 mode\n  for non-MSVC compilers).\n  `#934 <https://github.com/pybind/pybind11/pull/934>`_.\n\n* Add basic support for tag-based static polymorphism, where classes\n  provide a method to returns the desired type of an instance.\n  `#1326 <https://github.com/pybind/pybind11/pull/1326>`_.\n\n* Python type wrappers (``py::handle``, ``py::object``, etc.)\n  now support map Python's number protocol onto C++ arithmetic\n  operators such as ``operator+``, ``operator/=``, etc.\n  `#1511 <https://github.com/pybind/pybind11/pull/1511>`_.\n\n* A number of improvements related to enumerations:\n\n   1. The ``enum_`` implementation was rewritten from scratch to reduce\n      code bloat. Rather than instantiating a full implementation for each\n      enumeration, most code is now contained in a generic base class.\n      `#1511 <https://github.com/pybind/pybind11/pull/1511>`_.\n\n   2. The ``value()``  method of ``py::enum_`` now accepts an optional\n      docstring that will be shown in the documentation of the associated\n      enumeration. `#1160 <https://github.com/pybind/pybind11/pull/1160>`_.\n\n   3. check for already existing enum value and throw an error if present.\n      `#1453 <https://github.com/pybind/pybind11/pull/1453>`_.\n\n* Support for over-aligned type allocation via C++17's aligned ``new``\n  statement. `#1582 <https://github.com/pybind/pybind11/pull/1582>`_.\n\n* Added ``py::ellipsis()`` method for slicing of multidimensional NumPy arrays\n  `#1502 <https://github.com/pybind/pybind11/pull/1502>`_.\n\n* Numerous Improvements to the ``mkdoc.py`` script for extracting documentation\n  from C++ header files.\n  `#1788 <https://github.com/pybind/pybind11/pull/1788>`_.\n\n* ``pybind11_add_module()``: allow including Python as a ``SYSTEM`` include path.\n  `#1416 <https://github.com/pybind/pybind11/pull/1416>`_.\n\n* ``pybind11/stl.h`` does not convert strings to ``vector<string>`` anymore.\n  `#1258 <https://github.com/pybind/pybind11/issues/1258>`_.\n\n* Mark static methods as such to fix auto-generated Sphinx documentation.\n  `#1732 <https://github.com/pybind/pybind11/pull/1732>`_.\n\n* Re-throw forced unwind exceptions (e.g. during pthread termination).\n  `#1208 <https://github.com/pybind/pybind11/pull/1208>`_.\n\n* Added ``__contains__`` method to the bindings of maps (``std::map``,\n  ``std::unordered_map``).\n  `#1767 <https://github.com/pybind/pybind11/pull/1767>`_.\n\n* Improvements to ``gil_scoped_acquire``.\n  `#1211 <https://github.com/pybind/pybind11/pull/1211>`_.\n\n* Type caster support for ``std::deque<T>``.\n  `#1609 <https://github.com/pybind/pybind11/pull/1609>`_.\n\n* Support for ``std::unique_ptr`` holders, whose deleters differ between a base and derived\n  class. `#1353 <https://github.com/pybind/pybind11/pull/1353>`_.\n\n* Construction of STL array/vector-like data structures from\n  iterators. Added an ``extend()`` operation.\n  `#1709 <https://github.com/pybind/pybind11/pull/1709>`_,\n\n* CMake build system improvements for projects that include non-C++\n  files (e.g. plain C, CUDA) in ``pybind11_add_module`` et al.\n  `#1678 <https://github.com/pybind/pybind11/pull/1678>`_.\n\n* Fixed asynchronous invocation and deallocation of Python functions\n  wrapped in ``std::function``.\n  `#1595 <https://github.com/pybind/pybind11/pull/1595>`_.\n\n* Fixes regarding return value policy propagation in STL type casters.\n  `#1603 <https://github.com/pybind/pybind11/pull/1603>`_.\n\n* Fixed scoped enum comparisons.\n  `#1571 <https://github.com/pybind/pybind11/pull/1571>`_.\n\n* Fixed iostream redirection for code that releases the GIL.\n  `#1368 <https://github.com/pybind/pybind11/pull/1368>`_,\n\n* A number of CI-related fixes.\n  `#1757 <https://github.com/pybind/pybind11/pull/1757>`_,\n  `#1744 <https://github.com/pybind/pybind11/pull/1744>`_,\n  `#1670 <https://github.com/pybind/pybind11/pull/1670>`_.\n\nv2.2.4 (September 11, 2018)\n-----------------------------------------------------\n\n* Use new Python 3.7 Thread Specific Storage (TSS) implementation if available.\n  `#1454 <https://github.com/pybind/pybind11/pull/1454>`_,\n  `#1517 <https://github.com/pybind/pybind11/pull/1517>`_.\n\n* Fixes for newer MSVC versions and C++17 mode.\n  `#1347 <https://github.com/pybind/pybind11/pull/1347>`_,\n  `#1462 <https://github.com/pybind/pybind11/pull/1462>`_.\n\n* Propagate return value policies to type-specific casters\n  when casting STL containers.\n  `#1455 <https://github.com/pybind/pybind11/pull/1455>`_.\n\n* Allow ostream-redirection of more than 1024 characters.\n  `#1479 <https://github.com/pybind/pybind11/pull/1479>`_.\n\n* Set ``Py_DEBUG`` define when compiling against a debug Python build.\n  `#1438 <https://github.com/pybind/pybind11/pull/1438>`_.\n\n* Untangle integer logic in number type caster to work for custom\n  types that may only be castable to a restricted set of builtin types.\n  `#1442 <https://github.com/pybind/pybind11/pull/1442>`_.\n\n* CMake build system: Remember Python version in cache file.\n  `#1434 <https://github.com/pybind/pybind11/pull/1434>`_.\n\n* Fix for custom smart pointers: use ``std::addressof`` to obtain holder\n  address instead of ``operator&``.\n  `#1435 <https://github.com/pybind/pybind11/pull/1435>`_.\n\n* Properly report exceptions thrown during module initialization.\n  `#1362 <https://github.com/pybind/pybind11/pull/1362>`_.\n\n* Fixed a segmentation fault when creating empty-shaped NumPy array.\n  `#1371 <https://github.com/pybind/pybind11/pull/1371>`_.\n\n* The version of Intel C++ compiler must be >= 2017, and this is now checked by\n  the header files. `#1363 <https://github.com/pybind/pybind11/pull/1363>`_.\n\n* A few minor typo fixes and improvements to the test suite, and\n  patches that silence compiler warnings.\n\n* Vectors now support construction from generators, as well as ``extend()`` from a\n  list or generator.\n  `#1496 <https://github.com/pybind/pybind11/pull/1496>`_.\n\n\nv2.2.3 (April 29, 2018)\n-----------------------------------------------------\n\n* The pybind11 header location detection was replaced by a new implementation\n  that no longer depends on ``pip`` internals (the recently released ``pip``\n  10 has restricted access to this API).\n  `#1190 <https://github.com/pybind/pybind11/pull/1190>`_.\n\n* Small adjustment to an implementation detail to work around a compiler segmentation fault in Clang 3.3/3.4.\n  `#1350 <https://github.com/pybind/pybind11/pull/1350>`_.\n\n* The minimal supported version of the Intel compiler was >= 17.0 since\n  pybind11 v2.1. This check is now explicit, and a compile-time error is raised\n  if the compiler meet the requirement.\n  `#1363 <https://github.com/pybind/pybind11/pull/1363>`_.\n\n* Fixed an endianness-related fault in the test suite.\n  `#1287 <https://github.com/pybind/pybind11/pull/1287>`_.\n\nv2.2.2 (February 7, 2018)\n-----------------------------------------------------\n\n* Fixed a segfault when combining embedded interpreter\n  shutdown/reinitialization with external loaded pybind11 modules.\n  `#1092 <https://github.com/pybind/pybind11/pull/1092>`_.\n\n* Eigen support: fixed a bug where Nx1/1xN numpy inputs couldn't be passed as\n  arguments to Eigen vectors (which for Eigen are simply compile-time fixed\n  Nx1/1xN matrices).\n  `#1106 <https://github.com/pybind/pybind11/pull/1106>`_.\n\n* Clarified to license by moving the licensing of contributions from\n  ``LICENSE`` into ``CONTRIBUTING.md``: the licensing of contributions is not\n  actually part of the software license as distributed.  This isn't meant to be\n  a substantial change in the licensing of the project, but addresses concerns\n  that the clause made the license non-standard.\n  `#1109 <https://github.com/pybind/pybind11/issues/1109>`_.\n\n* Fixed a regression introduced in 2.1 that broke binding functions with lvalue\n  character literal arguments.\n  `#1128 <https://github.com/pybind/pybind11/pull/1128>`_.\n\n* MSVC: fix for compilation failures under /permissive-, and added the flag to\n  the appveyor test suite.\n  `#1155 <https://github.com/pybind/pybind11/pull/1155>`_.\n\n* Fixed ``__qualname__`` generation, and in turn, fixes how class names\n  (especially nested class names) are shown in generated docstrings.\n  `#1171 <https://github.com/pybind/pybind11/pull/1171>`_.\n\n* Updated the FAQ with a suggested project citation reference.\n  `#1189 <https://github.com/pybind/pybind11/pull/1189>`_.\n\n* Added fixes for deprecation warnings when compiled under C++17 with\n  ``-Wdeprecated`` turned on, and add ``-Wdeprecated`` to the test suite\n  compilation flags.\n  `#1191 <https://github.com/pybind/pybind11/pull/1191>`_.\n\n* Fixed outdated PyPI URLs in ``setup.py``.\n  `#1213 <https://github.com/pybind/pybind11/pull/1213>`_.\n\n* Fixed a refcount leak for arguments that end up in a ``py::args`` argument\n  for functions with both fixed positional and ``py::args`` arguments.\n  `#1216 <https://github.com/pybind/pybind11/pull/1216>`_.\n\n* Fixed a potential segfault resulting from possible premature destruction of\n  ``py::args``/``py::kwargs`` arguments with overloaded functions.\n  `#1223 <https://github.com/pybind/pybind11/pull/1223>`_.\n\n* Fixed ``del map[item]`` for a ``stl_bind.h`` bound stl map.\n  `#1229 <https://github.com/pybind/pybind11/pull/1229>`_.\n\n* Fixed a regression from v2.1.x where the aggregate initialization could\n  unintentionally end up at a constructor taking a templated\n  ``std::initializer_list<T>`` argument.\n  `#1249 <https://github.com/pybind/pybind11/pull/1249>`_.\n\n* Fixed an issue where calling a function with a keep_alive policy on the same\n  nurse/patient pair would cause the internal patient storage to needlessly\n  grow (unboundedly, if the nurse is long-lived).\n  `#1251 <https://github.com/pybind/pybind11/issues/1251>`_.\n\n* Various other minor fixes.\n\nv2.2.1 (September 14, 2017)\n-----------------------------------------------------\n\n* Added ``py::module_::reload()`` member function for reloading a module.\n  `#1040 <https://github.com/pybind/pybind11/pull/1040>`_.\n\n* Fixed a reference leak in the number converter.\n  `#1078 <https://github.com/pybind/pybind11/pull/1078>`_.\n\n* Fixed compilation with Clang on host GCC < 5 (old libstdc++ which isn't fully\n  C++11 compliant). `#1062 <https://github.com/pybind/pybind11/pull/1062>`_.\n\n* Fixed a regression where the automatic ``std::vector<bool>`` caster would\n  fail to compile. The same fix also applies to any container which returns\n  element proxies instead of references.\n  `#1053 <https://github.com/pybind/pybind11/pull/1053>`_.\n\n* Fixed a regression where the ``py::keep_alive`` policy could not be applied\n  to constructors. `#1065 <https://github.com/pybind/pybind11/pull/1065>`_.\n\n* Fixed a nullptr dereference when loading a ``py::module_local`` type\n  that's only registered in an external module.\n  `#1058 <https://github.com/pybind/pybind11/pull/1058>`_.\n\n* Fixed implicit conversion of accessors to types derived from ``py::object``.\n  `#1076 <https://github.com/pybind/pybind11/pull/1076>`_.\n\n* The ``name`` in ``PYBIND11_MODULE(name, variable)`` can now be a macro.\n  `#1082 <https://github.com/pybind/pybind11/pull/1082>`_.\n\n* Relaxed overly strict ``py::pickle()`` check for matching get and set types.\n  `#1064 <https://github.com/pybind/pybind11/pull/1064>`_.\n\n* Conversion errors now try to be more informative when it's likely that\n  a missing header is the cause (e.g. forgetting ``<pybind11/stl.h>``).\n  `#1077 <https://github.com/pybind/pybind11/pull/1077>`_.\n\nv2.2.0 (August 31, 2017)\n-----------------------------------------------------\n\n* Support for embedding the Python interpreter. See the\n  :doc:`documentation page </advanced/embedding>` for a\n  full overview of the new features.\n  `#774 <https://github.com/pybind/pybind11/pull/774>`_,\n  `#889 <https://github.com/pybind/pybind11/pull/889>`_,\n  `#892 <https://github.com/pybind/pybind11/pull/892>`_,\n  `#920 <https://github.com/pybind/pybind11/pull/920>`_.\n\n  .. code-block:: cpp\n\n      #include <pybind11/embed.h>\n      namespace py = pybind11;\n\n      int main() {\n          py::scoped_interpreter guard{}; // start the interpreter and keep it alive\n\n          py::print(\"Hello, World!\"); // use the Python API\n      }\n\n* Support for inheriting from multiple C++ bases in Python.\n  `#693 <https://github.com/pybind/pybind11/pull/693>`_.\n\n  .. code-block:: python\n\n      from cpp_module import CppBase1, CppBase2\n\n\n      class PyDerived(CppBase1, CppBase2):\n          def __init__(self):\n              CppBase1.__init__(self)  # C++ bases must be initialized explicitly\n              CppBase2.__init__(self)\n\n* ``PYBIND11_MODULE`` is now the preferred way to create module entry points.\n  ``PYBIND11_PLUGIN`` is deprecated. See :ref:`macros` for details.\n  `#879 <https://github.com/pybind/pybind11/pull/879>`_.\n\n  .. code-block:: cpp\n\n      // new\n      PYBIND11_MODULE(example, m) {\n          m.def(\"add\", [](int a, int b) { return a + b; });\n      }\n\n      // old\n      PYBIND11_PLUGIN(example) {\n          py::module m(\"example\");\n          m.def(\"add\", [](int a, int b) { return a + b; });\n          return m.ptr();\n      }\n\n* pybind11's headers and build system now more strictly enforce hidden symbol\n  visibility for extension modules. This should be seamless for most users,\n  but see the :doc:`upgrade` if you use a custom build system.\n  `#995 <https://github.com/pybind/pybind11/pull/995>`_.\n\n* Support for ``py::module_local`` types which allow multiple modules to\n  export the same C++ types without conflicts. This is useful for opaque\n  types like ``std::vector<int>``. ``py::bind_vector`` and ``py::bind_map``\n  now default to ``py::module_local`` if their elements are builtins or\n  local types. See :ref:`module_local` for details.\n  `#949 <https://github.com/pybind/pybind11/pull/949>`_,\n  `#981 <https://github.com/pybind/pybind11/pull/981>`_,\n  `#995 <https://github.com/pybind/pybind11/pull/995>`_,\n  `#997 <https://github.com/pybind/pybind11/pull/997>`_.\n\n* Custom constructors can now be added very easily using lambdas or factory\n  functions which return a class instance by value, pointer or holder. This\n  supersedes the old placement-new ``__init__`` technique.\n  See :ref:`custom_constructors` for details.\n  `#805 <https://github.com/pybind/pybind11/pull/805>`_,\n  `#1014 <https://github.com/pybind/pybind11/pull/1014>`_.\n\n  .. code-block:: cpp\n\n      struct Example {\n          Example(std::string);\n      };\n\n      py::class_<Example>(m, \"Example\")\n          .def(py::init<std::string>()) // existing constructor\n          .def(py::init([](int n) { // custom constructor\n              return std::make_unique<Example>(std::to_string(n));\n          }));\n\n* Similarly to custom constructors, pickling support functions are now bound\n  using the ``py::pickle()`` adaptor which improves type safety. See the\n  :doc:`upgrade` and :ref:`pickling` for details.\n  `#1038 <https://github.com/pybind/pybind11/pull/1038>`_.\n\n* Builtin support for converting C++17 standard library types and general\n  conversion improvements:\n\n  1. C++17 ``std::variant`` is supported right out of the box. C++11/14\n     equivalents (e.g. ``boost::variant``) can also be added with a simple\n     user-defined specialization. See :ref:`cpp17_container_casters` for details.\n     `#811 <https://github.com/pybind/pybind11/pull/811>`_,\n     `#845 <https://github.com/pybind/pybind11/pull/845>`_,\n     `#989 <https://github.com/pybind/pybind11/pull/989>`_.\n\n  2. Out-of-the-box support for C++17 ``std::string_view``.\n     `#906 <https://github.com/pybind/pybind11/pull/906>`_.\n\n  3. Improved compatibility of the builtin ``optional`` converter.\n     `#874 <https://github.com/pybind/pybind11/pull/874>`_.\n\n  4. The ``bool`` converter now accepts ``numpy.bool_`` and types which\n     define ``__bool__`` (Python 3.x) or ``__nonzero__`` (Python 2.7).\n     `#925 <https://github.com/pybind/pybind11/pull/925>`_.\n\n  5. C++-to-Python casters are now more efficient and move elements out\n     of rvalue containers whenever possible.\n     `#851 <https://github.com/pybind/pybind11/pull/851>`_,\n     `#936 <https://github.com/pybind/pybind11/pull/936>`_,\n     `#938 <https://github.com/pybind/pybind11/pull/938>`_.\n\n  6. Fixed ``bytes`` to ``std::string/char*`` conversion on Python 3.\n     `#817 <https://github.com/pybind/pybind11/pull/817>`_.\n\n  7. Fixed lifetime of temporary C++ objects created in Python-to-C++ conversions.\n     `#924 <https://github.com/pybind/pybind11/pull/924>`_.\n\n* Scope guard call policy for RAII types, e.g. ``py::call_guard<py::gil_scoped_release>()``,\n  ``py::call_guard<py::scoped_ostream_redirect>()``. See :ref:`call_policies` for details.\n  `#740 <https://github.com/pybind/pybind11/pull/740>`_.\n\n* Utility for redirecting C++ streams to Python (e.g. ``std::cout`` ->\n  ``sys.stdout``). Scope guard ``py::scoped_ostream_redirect`` in C++ and\n  a context manager in Python. See :ref:`ostream_redirect`.\n  `#1009 <https://github.com/pybind/pybind11/pull/1009>`_.\n\n* Improved handling of types and exceptions across module boundaries.\n  `#915 <https://github.com/pybind/pybind11/pull/915>`_,\n  `#951 <https://github.com/pybind/pybind11/pull/951>`_,\n  `#995 <https://github.com/pybind/pybind11/pull/995>`_.\n\n* Fixed destruction order of ``py::keep_alive`` nurse/patient objects\n  in reference cycles.\n  `#856 <https://github.com/pybind/pybind11/pull/856>`_.\n\n* NumPy and buffer protocol related improvements:\n\n  1. Support for negative strides in Python buffer objects/numpy arrays. This\n     required changing integers from unsigned to signed for the related C++ APIs.\n     Note: If you have compiler warnings enabled, you may notice some new conversion\n     warnings after upgrading. These can be resolved with ``static_cast``.\n     `#782 <https://github.com/pybind/pybind11/pull/782>`_.\n\n  2. Support ``std::complex`` and arrays inside ``PYBIND11_NUMPY_DTYPE``.\n     `#831 <https://github.com/pybind/pybind11/pull/831>`_,\n     `#832 <https://github.com/pybind/pybind11/pull/832>`_.\n\n  3. Support for constructing ``py::buffer_info`` and ``py::arrays`` using\n     arbitrary containers or iterators instead of requiring a ``std::vector``.\n     `#788 <https://github.com/pybind/pybind11/pull/788>`_,\n     `#822 <https://github.com/pybind/pybind11/pull/822>`_,\n     `#860 <https://github.com/pybind/pybind11/pull/860>`_.\n\n  4. Explicitly check numpy version and require >= 1.7.0.\n     `#819 <https://github.com/pybind/pybind11/pull/819>`_.\n\n* Support for allowing/prohibiting ``None`` for specific arguments and improved\n  ``None`` overload resolution order. See :ref:`none_arguments` for details.\n  `#843 <https://github.com/pybind/pybind11/pull/843>`_.\n  `#859 <https://github.com/pybind/pybind11/pull/859>`_.\n\n* Added ``py::exec()`` as a shortcut for ``py::eval<py::eval_statements>()``\n  and support for C++11 raw string literals as input. See :ref:`eval`.\n  `#766 <https://github.com/pybind/pybind11/pull/766>`_,\n  `#827 <https://github.com/pybind/pybind11/pull/827>`_.\n\n* ``py::vectorize()`` ignores non-vectorizable arguments and supports\n  member functions.\n  `#762 <https://github.com/pybind/pybind11/pull/762>`_.\n\n* Support for bound methods as callbacks (``pybind11/functional.h``).\n  `#815 <https://github.com/pybind/pybind11/pull/815>`_.\n\n* Allow aliasing pybind11 methods: ``cls.attr(\"foo\") = cls.attr(\"bar\")``.\n  `#802 <https://github.com/pybind/pybind11/pull/802>`_.\n\n* Don't allow mixed static/non-static overloads.\n  `#804 <https://github.com/pybind/pybind11/pull/804>`_.\n\n* Fixed overriding static properties in derived classes.\n  `#784 <https://github.com/pybind/pybind11/pull/784>`_.\n\n* Added support for write only properties.\n  `#1144 <https://github.com/pybind/pybind11/pull/1144>`_.\n\n* Improved deduction of member functions of a derived class when its bases\n  aren't registered with pybind11.\n  `#855 <https://github.com/pybind/pybind11/pull/855>`_.\n\n  .. code-block:: cpp\n\n      struct Base {\n          int foo() { return 42; }\n      }\n\n      struct Derived : Base {}\n\n      // Now works, but previously required also binding `Base`\n      py::class_<Derived>(m, \"Derived\")\n          .def(\"foo\", &Derived::foo); // function is actually from `Base`\n\n* The implementation of ``py::init<>`` now uses C++11 brace initialization\n  syntax to construct instances, which permits binding implicit constructors of\n  aggregate types. `#1015 <https://github.com/pybind/pybind11/pull/1015>`_.\n\n    .. code-block:: cpp\n\n        struct Aggregate {\n            int a;\n            std::string b;\n        };\n\n        py::class_<Aggregate>(m, \"Aggregate\")\n            .def(py::init<int, const std::string &>());\n\n* Fixed issues with multiple inheritance with offset base/derived pointers.\n  `#812 <https://github.com/pybind/pybind11/pull/812>`_,\n  `#866 <https://github.com/pybind/pybind11/pull/866>`_,\n  `#960 <https://github.com/pybind/pybind11/pull/960>`_.\n\n* Fixed reference leak of type objects.\n  `#1030 <https://github.com/pybind/pybind11/pull/1030>`_.\n\n* Improved support for the ``/std:c++14`` and ``/std:c++latest`` modes\n  on MSVC 2017.\n  `#841 <https://github.com/pybind/pybind11/pull/841>`_,\n  `#999 <https://github.com/pybind/pybind11/pull/999>`_.\n\n* Fixed detection of private operator new on MSVC.\n  `#893 <https://github.com/pybind/pybind11/pull/893>`_,\n  `#918 <https://github.com/pybind/pybind11/pull/918>`_.\n\n* Intel C++ compiler compatibility fixes.\n  `#937 <https://github.com/pybind/pybind11/pull/937>`_.\n\n* Fixed implicit conversion of ``py::enum_`` to integer types on Python 2.7.\n  `#821 <https://github.com/pybind/pybind11/pull/821>`_.\n\n* Added ``py::hash`` to fetch the hash value of Python objects, and\n  ``.def(hash(py::self))`` to provide the C++ ``std::hash`` as the Python\n  ``__hash__`` method.\n  `#1034 <https://github.com/pybind/pybind11/pull/1034>`_.\n\n* Fixed ``__truediv__`` on Python 2 and ``__itruediv__`` on Python 3.\n  `#867 <https://github.com/pybind/pybind11/pull/867>`_.\n\n* ``py::capsule`` objects now support the ``name`` attribute. This is useful\n  for interfacing with ``scipy.LowLevelCallable``.\n  `#902 <https://github.com/pybind/pybind11/pull/902>`_.\n\n* Fixed ``py::make_iterator``'s ``__next__()`` for past-the-end calls.\n  `#897 <https://github.com/pybind/pybind11/pull/897>`_.\n\n* Added ``error_already_set::matches()`` for checking Python exceptions.\n  `#772 <https://github.com/pybind/pybind11/pull/772>`_.\n\n* Deprecated ``py::error_already_set::clear()``. It's no longer needed\n  following a simplification of the ``py::error_already_set`` class.\n  `#954 <https://github.com/pybind/pybind11/pull/954>`_.\n\n* Deprecated ``py::handle::operator==()`` in favor of ``py::handle::is()``\n  `#825 <https://github.com/pybind/pybind11/pull/825>`_.\n\n* Deprecated ``py::object::borrowed``/``py::object::stolen``.\n  Use ``py::object::borrowed_t{}``/``py::object::stolen_t{}`` instead.\n  `#771 <https://github.com/pybind/pybind11/pull/771>`_.\n\n* Changed internal data structure versioning to avoid conflicts between\n  modules compiled with different revisions of pybind11.\n  `#1012 <https://github.com/pybind/pybind11/pull/1012>`_.\n\n* Additional compile-time and run-time error checking and more informative messages.\n  `#786 <https://github.com/pybind/pybind11/pull/786>`_,\n  `#794 <https://github.com/pybind/pybind11/pull/794>`_,\n  `#803 <https://github.com/pybind/pybind11/pull/803>`_.\n\n* Various minor improvements and fixes.\n  `#764 <https://github.com/pybind/pybind11/pull/764>`_,\n  `#791 <https://github.com/pybind/pybind11/pull/791>`_,\n  `#795 <https://github.com/pybind/pybind11/pull/795>`_,\n  `#840 <https://github.com/pybind/pybind11/pull/840>`_,\n  `#844 <https://github.com/pybind/pybind11/pull/844>`_,\n  `#846 <https://github.com/pybind/pybind11/pull/846>`_,\n  `#849 <https://github.com/pybind/pybind11/pull/849>`_,\n  `#858 <https://github.com/pybind/pybind11/pull/858>`_,\n  `#862 <https://github.com/pybind/pybind11/pull/862>`_,\n  `#871 <https://github.com/pybind/pybind11/pull/871>`_,\n  `#872 <https://github.com/pybind/pybind11/pull/872>`_,\n  `#881 <https://github.com/pybind/pybind11/pull/881>`_,\n  `#888 <https://github.com/pybind/pybind11/pull/888>`_,\n  `#899 <https://github.com/pybind/pybind11/pull/899>`_,\n  `#928 <https://github.com/pybind/pybind11/pull/928>`_,\n  `#931 <https://github.com/pybind/pybind11/pull/931>`_,\n  `#944 <https://github.com/pybind/pybind11/pull/944>`_,\n  `#950 <https://github.com/pybind/pybind11/pull/950>`_,\n  `#952 <https://github.com/pybind/pybind11/pull/952>`_,\n  `#962 <https://github.com/pybind/pybind11/pull/962>`_,\n  `#965 <https://github.com/pybind/pybind11/pull/965>`_,\n  `#970 <https://github.com/pybind/pybind11/pull/970>`_,\n  `#978 <https://github.com/pybind/pybind11/pull/978>`_,\n  `#979 <https://github.com/pybind/pybind11/pull/979>`_,\n  `#986 <https://github.com/pybind/pybind11/pull/986>`_,\n  `#1020 <https://github.com/pybind/pybind11/pull/1020>`_,\n  `#1027 <https://github.com/pybind/pybind11/pull/1027>`_,\n  `#1037 <https://github.com/pybind/pybind11/pull/1037>`_.\n\n* Testing improvements.\n  `#798 <https://github.com/pybind/pybind11/pull/798>`_,\n  `#882 <https://github.com/pybind/pybind11/pull/882>`_,\n  `#898 <https://github.com/pybind/pybind11/pull/898>`_,\n  `#900 <https://github.com/pybind/pybind11/pull/900>`_,\n  `#921 <https://github.com/pybind/pybind11/pull/921>`_,\n  `#923 <https://github.com/pybind/pybind11/pull/923>`_,\n  `#963 <https://github.com/pybind/pybind11/pull/963>`_.\n\nv2.1.1 (April 7, 2017)\n-----------------------------------------------------\n\n* Fixed minimum version requirement for MSVC 2015u3\n  `#773 <https://github.com/pybind/pybind11/pull/773>`_.\n\nv2.1.0 (March 22, 2017)\n-----------------------------------------------------\n\n* pybind11 now performs function overload resolution in two phases. The first\n  phase only considers exact type matches, while the second allows for implicit\n  conversions to take place. A special ``noconvert()`` syntax can be used to\n  completely disable implicit conversions for specific arguments.\n  `#643 <https://github.com/pybind/pybind11/pull/643>`_,\n  `#634 <https://github.com/pybind/pybind11/pull/634>`_,\n  `#650 <https://github.com/pybind/pybind11/pull/650>`_.\n\n* Fixed a regression where static properties no longer worked with classes\n  using multiple inheritance. The ``py::metaclass`` attribute is no longer\n  necessary (and deprecated as of this release) when binding classes with\n  static properties.\n  `#679 <https://github.com/pybind/pybind11/pull/679>`_,\n\n* Classes bound using ``pybind11`` can now use custom metaclasses.\n  `#679 <https://github.com/pybind/pybind11/pull/679>`_,\n\n* ``py::args`` and ``py::kwargs`` can now be mixed with other positional\n  arguments when binding functions using pybind11.\n  `#611 <https://github.com/pybind/pybind11/pull/611>`_.\n\n* Improved support for C++11 unicode string and character types; added\n  extensive documentation regarding pybind11's string conversion behavior.\n  `#624 <https://github.com/pybind/pybind11/pull/624>`_,\n  `#636 <https://github.com/pybind/pybind11/pull/636>`_,\n  `#715 <https://github.com/pybind/pybind11/pull/715>`_.\n\n* pybind11 can now avoid expensive copies when converting Eigen arrays to NumPy\n  arrays (and vice versa). `#610 <https://github.com/pybind/pybind11/pull/610>`_.\n\n* The \"fast path\" in ``py::vectorize`` now works for any full-size group of C or\n  F-contiguous arrays. The non-fast path is also faster since it no longer performs\n  copies of the input arguments (except when type conversions are necessary).\n  `#610 <https://github.com/pybind/pybind11/pull/610>`_.\n\n* Added fast, unchecked access to NumPy arrays via a proxy object.\n  `#746 <https://github.com/pybind/pybind11/pull/746>`_.\n\n* Transparent support for class-specific ``operator new`` and\n  ``operator delete`` implementations.\n  `#755 <https://github.com/pybind/pybind11/pull/755>`_.\n\n* Slimmer and more efficient STL-compatible iterator interface for sequence types.\n  `#662 <https://github.com/pybind/pybind11/pull/662>`_.\n\n* Improved custom holder type support.\n  `#607 <https://github.com/pybind/pybind11/pull/607>`_.\n\n* ``nullptr`` to ``None`` conversion fixed in various builtin type casters.\n  `#732 <https://github.com/pybind/pybind11/pull/732>`_.\n\n* ``enum_`` now exposes its members via a special ``__members__`` attribute.\n  `#666 <https://github.com/pybind/pybind11/pull/666>`_.\n\n* ``std::vector`` bindings created using ``stl_bind.h`` can now optionally\n  implement the buffer protocol. `#488 <https://github.com/pybind/pybind11/pull/488>`_.\n\n* Automated C++ reference documentation using doxygen and breathe.\n  `#598 <https://github.com/pybind/pybind11/pull/598>`_.\n\n* Added minimum compiler version assertions.\n  `#727 <https://github.com/pybind/pybind11/pull/727>`_.\n\n* Improved compatibility with C++1z.\n  `#677 <https://github.com/pybind/pybind11/pull/677>`_.\n\n* Improved ``py::capsule`` API. Can be used to implement cleanup\n  callbacks that are involved at module destruction time.\n  `#752 <https://github.com/pybind/pybind11/pull/752>`_.\n\n* Various minor improvements and fixes.\n  `#595 <https://github.com/pybind/pybind11/pull/595>`_,\n  `#588 <https://github.com/pybind/pybind11/pull/588>`_,\n  `#589 <https://github.com/pybind/pybind11/pull/589>`_,\n  `#603 <https://github.com/pybind/pybind11/pull/603>`_,\n  `#619 <https://github.com/pybind/pybind11/pull/619>`_,\n  `#648 <https://github.com/pybind/pybind11/pull/648>`_,\n  `#695 <https://github.com/pybind/pybind11/pull/695>`_,\n  `#720 <https://github.com/pybind/pybind11/pull/720>`_,\n  `#723 <https://github.com/pybind/pybind11/pull/723>`_,\n  `#729 <https://github.com/pybind/pybind11/pull/729>`_,\n  `#724 <https://github.com/pybind/pybind11/pull/724>`_,\n  `#742 <https://github.com/pybind/pybind11/pull/742>`_,\n  `#753 <https://github.com/pybind/pybind11/pull/753>`_.\n\nv2.0.1 (Jan 4, 2017)\n-----------------------------------------------------\n\n* Fix pointer to reference error in type_caster on MSVC\n  `#583 <https://github.com/pybind/pybind11/pull/583>`_.\n\n* Fixed a segmentation in the test suite due to a typo\n  `cd7eac <https://github.com/pybind/pybind11/commit/cd7eac>`_.\n\nv2.0.0 (Jan 1, 2017)\n-----------------------------------------------------\n\n* Fixed a reference counting regression affecting types with custom metaclasses\n  (introduced in v2.0.0-rc1).\n  `#571 <https://github.com/pybind/pybind11/pull/571>`_.\n\n* Quenched a CMake policy warning.\n  `#570 <https://github.com/pybind/pybind11/pull/570>`_.\n\nv2.0.0-rc1 (Dec 23, 2016)\n-----------------------------------------------------\n\nThe pybind11 developers are excited to issue a release candidate of pybind11\nwith a subsequent v2.0.0 release planned in early January next year.\n\nAn incredible amount of effort by went into pybind11 over the last ~5 months,\nleading to a release that is jam-packed with exciting new features and numerous\nusability improvements. The following list links PRs or individual commits\nwhenever applicable.\n\nHappy Christmas!\n\n* Support for binding C++ class hierarchies that make use of multiple\n  inheritance. `#410 <https://github.com/pybind/pybind11/pull/410>`_.\n\n* PyPy support: pybind11 now supports nightly builds of PyPy and will\n  interoperate with the future 5.7 release. No code changes are necessary,\n  everything \"just\" works as usual. Note that we only target the Python 2.7\n  branch for now; support for 3.x will be added once its ``cpyext`` extension\n  support catches up. A few minor features remain unsupported for the time\n  being (notably dynamic attributes in custom types).\n  `#527 <https://github.com/pybind/pybind11/pull/527>`_.\n\n* Significant work on the documentation -- in particular, the monolithic\n  ``advanced.rst`` file was restructured into a easier to read hierarchical\n  organization. `#448 <https://github.com/pybind/pybind11/pull/448>`_.\n\n* Many NumPy-related improvements:\n\n  1. Object-oriented API to access and modify NumPy ``ndarray`` instances,\n     replicating much of the corresponding NumPy C API functionality.\n     `#402 <https://github.com/pybind/pybind11/pull/402>`_.\n\n  2. NumPy array ``dtype`` array descriptors are now first-class citizens and\n     are exposed via a new class ``py::dtype``.\n\n  3. Structured dtypes can be registered using the ``PYBIND11_NUMPY_DTYPE()``\n     macro. Special ``array`` constructors accepting dtype objects were also\n     added.\n\n     One potential caveat involving this change: format descriptor strings\n     should now be accessed via ``format_descriptor::format()`` (however, for\n     compatibility purposes, the old syntax ``format_descriptor::value`` will\n     still work for non-structured data types). `#308\n     <https://github.com/pybind/pybind11/pull/308>`_.\n\n  4. Further improvements to support structured dtypes throughout the system.\n     `#472 <https://github.com/pybind/pybind11/pull/472>`_,\n     `#474 <https://github.com/pybind/pybind11/pull/474>`_,\n     `#459 <https://github.com/pybind/pybind11/pull/459>`_,\n     `#453 <https://github.com/pybind/pybind11/pull/453>`_,\n     `#452 <https://github.com/pybind/pybind11/pull/452>`_, and\n     `#505 <https://github.com/pybind/pybind11/pull/505>`_.\n\n  5. Fast access operators. `#497 <https://github.com/pybind/pybind11/pull/497>`_.\n\n  6. Constructors for arrays whose storage is owned by another object.\n     `#440 <https://github.com/pybind/pybind11/pull/440>`_.\n\n  7. Added constructors for ``array`` and ``array_t`` explicitly accepting shape\n     and strides; if strides are not provided, they are deduced assuming\n     C-contiguity. Also added simplified constructors for 1-dimensional case.\n\n  8. Added buffer/NumPy support for ``char[N]`` and ``std::array<char, N>`` types.\n\n  9. Added ``memoryview`` wrapper type which is constructible from ``buffer_info``.\n\n* Eigen: many additional conversions and support for non-contiguous\n  arrays/slices.\n  `#427 <https://github.com/pybind/pybind11/pull/427>`_,\n  `#315 <https://github.com/pybind/pybind11/pull/315>`_,\n  `#316 <https://github.com/pybind/pybind11/pull/316>`_,\n  `#312 <https://github.com/pybind/pybind11/pull/312>`_, and\n  `#267 <https://github.com/pybind/pybind11/pull/267>`_\n\n* Incompatible changes in ``class_<...>::class_()``:\n\n    1. Declarations of types that provide access via the buffer protocol must\n       now include the ``py::buffer_protocol()`` annotation as an argument to\n       the ``class_`` constructor.\n\n    2. Declarations of types that require a custom metaclass (i.e. all classes\n       which include static properties via commands such as\n       ``def_readwrite_static()``) must now include the ``py::metaclass()``\n       annotation as an argument to the ``class_`` constructor.\n\n       These two changes were necessary to make type definitions in pybind11\n       future-proof, and to support PyPy via its cpyext mechanism. `#527\n       <https://github.com/pybind/pybind11/pull/527>`_.\n\n\n    3. This version of pybind11 uses a redesigned mechanism for instantiating\n       trampoline classes that are used to override virtual methods from within\n       Python. This led to the following user-visible syntax change: instead of\n\n       .. code-block:: cpp\n\n           py::class_<TrampolineClass>(\"MyClass\")\n             .alias<MyClass>()\n             ....\n\n       write\n\n       .. code-block:: cpp\n\n           py::class_<MyClass, TrampolineClass>(\"MyClass\")\n             ....\n\n       Importantly, both the original and the trampoline class are now\n       specified as an arguments (in arbitrary order) to the ``py::class_``\n       template, and the ``alias<..>()`` call is gone. The new scheme has zero\n       overhead in cases when Python doesn't override any functions of the\n       underlying C++ class. `rev. 86d825\n       <https://github.com/pybind/pybind11/commit/86d825>`_.\n\n* Added ``eval`` and ``eval_file`` functions for evaluating expressions and\n  statements from a string or file. `rev. 0d3fc3\n  <https://github.com/pybind/pybind11/commit/0d3fc3>`_.\n\n* pybind11 can now create types with a modifiable dictionary.\n  `#437 <https://github.com/pybind/pybind11/pull/437>`_ and\n  `#444 <https://github.com/pybind/pybind11/pull/444>`_.\n\n* Support for translation of arbitrary C++ exceptions to Python counterparts.\n  `#296 <https://github.com/pybind/pybind11/pull/296>`_ and\n  `#273 <https://github.com/pybind/pybind11/pull/273>`_.\n\n* Report full backtraces through mixed C++/Python code, better reporting for\n  import errors, fixed GIL management in exception processing.\n  `#537 <https://github.com/pybind/pybind11/pull/537>`_,\n  `#494 <https://github.com/pybind/pybind11/pull/494>`_,\n  `rev. e72d95 <https://github.com/pybind/pybind11/commit/e72d95>`_, and\n  `rev. 099d6e <https://github.com/pybind/pybind11/commit/099d6e>`_.\n\n* Support for bit-level operations, comparisons, and serialization of C++\n  enumerations. `#503 <https://github.com/pybind/pybind11/pull/503>`_,\n  `#508 <https://github.com/pybind/pybind11/pull/508>`_,\n  `#380 <https://github.com/pybind/pybind11/pull/380>`_,\n  `#309 <https://github.com/pybind/pybind11/pull/309>`_.\n  `#311 <https://github.com/pybind/pybind11/pull/311>`_.\n\n* The ``class_`` constructor now accepts its template arguments in any order.\n  `#385 <https://github.com/pybind/pybind11/pull/385>`_.\n\n* Attribute and item accessors now have a more complete interface which makes\n  it possible to chain attributes as in\n  ``obj.attr(\"a\")[key].attr(\"b\").attr(\"method\")(1, 2, 3)``. `#425\n  <https://github.com/pybind/pybind11/pull/425>`_.\n\n* Major redesign of the default and conversion constructors in ``pytypes.h``.\n  `#464 <https://github.com/pybind/pybind11/pull/464>`_.\n\n* Added built-in support for ``std::shared_ptr`` holder type. It is no longer\n  necessary to to include a declaration of the form\n  ``PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)`` (though continuing to\n  do so won't cause an error).\n  `#454 <https://github.com/pybind/pybind11/pull/454>`_.\n\n* New ``py::overload_cast`` casting operator to select among multiple possible\n  overloads of a function. An example:\n\n    .. code-block:: cpp\n\n        py::class_<Pet>(m, \"Pet\")\n            .def(\"set\", py::overload_cast<int>(&Pet::set), \"Set the pet's age\")\n            .def(\"set\", py::overload_cast<const std::string &>(&Pet::set), \"Set the pet's name\");\n\n  This feature only works on C++14-capable compilers.\n  `#541 <https://github.com/pybind/pybind11/pull/541>`_.\n\n* C++ types are automatically cast to Python types, e.g. when assigning\n  them as an attribute. For instance, the following is now legal:\n\n    .. code-block:: cpp\n\n        py::module m = /* ... */\n        m.attr(\"constant\") = 123;\n\n  (Previously, a ``py::cast`` call was necessary to avoid a compilation error.)\n  `#551 <https://github.com/pybind/pybind11/pull/551>`_.\n\n* Redesigned ``pytest``-based test suite. `#321 <https://github.com/pybind/pybind11/pull/321>`_.\n\n* Instance tracking to detect reference leaks in test suite. `#324 <https://github.com/pybind/pybind11/pull/324>`_\n\n* pybind11 can now distinguish between multiple different instances that are\n  located at the same memory address, but which have different types.\n  `#329 <https://github.com/pybind/pybind11/pull/329>`_.\n\n* Improved logic in ``move`` return value policy.\n  `#510 <https://github.com/pybind/pybind11/pull/510>`_,\n  `#297 <https://github.com/pybind/pybind11/pull/297>`_.\n\n* Generalized unpacking API to permit calling Python functions from C++ using\n  notation such as ``foo(a1, a2, *args, \"ka\"_a=1, \"kb\"_a=2, **kwargs)``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.\n\n* ``py::print()`` function whose behavior matches that of the native Python\n  ``print()`` function. `#372 <https://github.com/pybind/pybind11/pull/372>`_.\n\n* Added ``py::dict`` keyword constructor:``auto d = dict(\"number\"_a=42,\n  \"name\"_a=\"World\");``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.\n\n* Added ``py::str::format()`` method and ``_s`` literal: ``py::str s = \"1 + 2\n  = {}\"_s.format(3);``. `#372 <https://github.com/pybind/pybind11/pull/372>`_.\n\n* Added ``py::repr()`` function which is equivalent to Python's builtin\n  ``repr()``. `#333 <https://github.com/pybind/pybind11/pull/333>`_.\n\n* Improved construction and destruction logic for holder types. It is now\n  possible to reference instances with smart pointer holder types without\n  constructing the holder if desired. The ``PYBIND11_DECLARE_HOLDER_TYPE``\n  macro now accepts an optional second parameter to indicate whether the holder\n  type uses intrusive reference counting.\n  `#533 <https://github.com/pybind/pybind11/pull/533>`_ and\n  `#561 <https://github.com/pybind/pybind11/pull/561>`_.\n\n* Mapping a stateless C++ function to Python and back is now \"for free\" (i.e.\n  no extra indirections or argument conversion overheads). `rev. 954b79\n  <https://github.com/pybind/pybind11/commit/954b79>`_.\n\n* Bindings for ``std::valarray<T>``.\n  `#545 <https://github.com/pybind/pybind11/pull/545>`_.\n\n* Improved support for C++17 capable compilers.\n  `#562 <https://github.com/pybind/pybind11/pull/562>`_.\n\n* Bindings for ``std::optional<t>``.\n  `#475 <https://github.com/pybind/pybind11/pull/475>`_,\n  `#476 <https://github.com/pybind/pybind11/pull/476>`_,\n  `#479 <https://github.com/pybind/pybind11/pull/479>`_,\n  `#499 <https://github.com/pybind/pybind11/pull/499>`_, and\n  `#501 <https://github.com/pybind/pybind11/pull/501>`_.\n\n* ``stl_bind.h``: general improvements and support for ``std::map`` and\n  ``std::unordered_map``.\n  `#490 <https://github.com/pybind/pybind11/pull/490>`_,\n  `#282 <https://github.com/pybind/pybind11/pull/282>`_,\n  `#235 <https://github.com/pybind/pybind11/pull/235>`_.\n\n* The ``std::tuple``, ``std::pair``, ``std::list``, and ``std::vector`` type\n  casters now accept any Python sequence type as input. `rev. 107285\n  <https://github.com/pybind/pybind11/commit/107285>`_.\n\n* Improved CMake Python detection on multi-architecture Linux.\n  `#532 <https://github.com/pybind/pybind11/pull/532>`_.\n\n* Infrastructure to selectively disable or enable parts of the automatically\n  generated docstrings. `#486 <https://github.com/pybind/pybind11/pull/486>`_.\n\n* ``reference`` and ``reference_internal`` are now the default return value\n  properties for static and non-static properties, respectively. `#473\n  <https://github.com/pybind/pybind11/pull/473>`_. (the previous defaults\n  were ``automatic``). `#473 <https://github.com/pybind/pybind11/pull/473>`_.\n\n* Support for ``std::unique_ptr`` with non-default deleters or no deleter at\n  all (``py::nodelete``). `#384 <https://github.com/pybind/pybind11/pull/384>`_.\n\n* Deprecated ``handle::call()`` method. The new syntax to call Python\n  functions is simply ``handle()``. It can also be invoked explicitly via\n  ``handle::operator<X>()``, where ``X`` is an optional return value policy.\n\n* Print more informative error messages when ``make_tuple()`` or ``cast()``\n  fail. `#262 <https://github.com/pybind/pybind11/pull/262>`_.\n\n* Creation of holder types for classes deriving from\n  ``std::enable_shared_from_this<>`` now also works for ``const`` values.\n  `#260 <https://github.com/pybind/pybind11/pull/260>`_.\n\n* ``make_iterator()`` improvements for better compatibility with various\n  types (now uses prefix increment operator); it now also accepts iterators\n  with different begin/end types as long as they are equality comparable.\n  `#247 <https://github.com/pybind/pybind11/pull/247>`_.\n\n* ``arg()`` now accepts a wider range of argument types for default values.\n  `#244 <https://github.com/pybind/pybind11/pull/244>`_.\n\n* Support ``keep_alive`` where the nurse object may be ``None``. `#341\n  <https://github.com/pybind/pybind11/pull/341>`_.\n\n* Added constructors for ``str`` and ``bytes`` from zero-terminated char\n  pointers, and from char pointers and length. Added constructors for ``str``\n  from ``bytes`` and for ``bytes`` from ``str``, which will perform UTF-8\n  decoding/encoding as required.\n\n* Many other improvements of library internals without user-visible changes\n\n\n1.8.1 (July 12, 2016)\n----------------------\n* Fixed a rare but potentially very severe issue when the garbage collector ran\n  during pybind11 type creation.\n\n1.8.0 (June 14, 2016)\n----------------------\n* Redesigned CMake build system which exports a convenient\n  ``pybind11_add_module`` function to parent projects.\n* ``std::vector<>`` type bindings analogous to Boost.Python's ``indexing_suite``\n* Transparent conversion of sparse and dense Eigen matrices and vectors (``eigen.h``)\n* Added an ``ExtraFlags`` template argument to the NumPy ``array_t<>`` wrapper\n  to disable an enforced cast that may lose precision, e.g. to create overloads\n  for different precisions and complex vs real-valued matrices.\n* Prevent implicit conversion of floating point values to integral types in\n  function arguments\n* Fixed incorrect default return value policy for functions returning a shared\n  pointer\n* Don't allow registering a type via ``class_`` twice\n* Don't allow casting a ``None`` value into a C++ lvalue reference\n* Fixed a crash in ``enum_::operator==`` that was triggered by the ``help()`` command\n* Improved detection of whether or not custom C++ types can be copy/move-constructed\n* Extended ``str`` type to also work with ``bytes`` instances\n* Added a ``\"name\"_a`` user defined string literal that is equivalent to ``py::arg(\"name\")``.\n* When specifying function arguments via ``py::arg``, the test that verifies\n  the number of arguments now runs at compile time.\n* Added ``[[noreturn]]`` attribute to ``pybind11_fail()`` to quench some\n  compiler warnings\n* List function arguments in exception text when the dispatch code cannot find\n  a matching overload\n* Added ``PYBIND11_OVERLOAD_NAME`` and ``PYBIND11_OVERLOAD_PURE_NAME`` macros which\n  can be used to override virtual methods whose name differs in C++ and Python\n  (e.g. ``__call__`` and ``operator()``)\n* Various minor ``iterator`` and ``make_iterator()`` improvements\n* Transparently support ``__bool__`` on Python 2.x and Python 3.x\n* Fixed issue with destructor of unpickled object not being called\n* Minor CMake build system improvements on Windows\n* New ``pybind11::args`` and ``pybind11::kwargs`` types to create functions which\n  take an arbitrary number of arguments and keyword arguments\n* New syntax to call a Python function from C++ using ``*args`` and ``*kwargs``\n* The functions ``def_property_*`` now correctly process docstring arguments (these\n  formerly caused a segmentation fault)\n* Many ``mkdoc.py`` improvements (enumerations, template arguments, ``DOC()``\n  macro accepts more arguments)\n* Cygwin support\n* Documentation improvements (pickling support, ``keep_alive``, macro usage)\n\n1.7 (April 30, 2016)\n----------------------\n* Added a new ``move`` return value policy that triggers C++11 move semantics.\n  The automatic return value policy falls back to this case whenever a rvalue\n  reference is encountered\n* Significantly more general GIL state routines that are used instead of\n  Python's troublesome ``PyGILState_Ensure`` and ``PyGILState_Release`` API\n* Redesign of opaque types that drastically simplifies their usage\n* Extended ability to pass values of type ``[const] void *``\n* ``keep_alive`` fix: don't fail when there is no patient\n* ``functional.h``: acquire the GIL before calling a Python function\n* Added Python RAII type wrappers ``none`` and ``iterable``\n* Added ``*args`` and ``*kwargs`` pass-through parameters to\n  ``pybind11.get_include()`` function\n* Iterator improvements and fixes\n* Documentation on return value policies and opaque types improved\n\n1.6 (April 30, 2016)\n----------------------\n* Skipped due to upload to PyPI gone wrong and inability to recover\n  (https://github.com/pypa/packaging-problems/issues/74)\n\n1.5 (April 21, 2016)\n----------------------\n* For polymorphic types, use RTTI to try to return the closest type registered with pybind11\n* Pickling support for serializing and unserializing C++ instances to a byte stream in Python\n* Added a convenience routine ``make_iterator()`` which turns a range indicated\n  by a pair of C++ iterators into a iterable Python object\n* Added ``len()`` and a variadic ``make_tuple()`` function\n* Addressed a rare issue that could confuse the current virtual function\n  dispatcher and another that could lead to crashes in multi-threaded\n  applications\n* Added a ``get_include()`` function to the Python module that returns the path\n  of the directory containing the installed pybind11 header files\n* Documentation improvements: import issues, symbol visibility, pickling, limitations\n* Added casting support for ``std::reference_wrapper<>``\n\n1.4 (April 7, 2016)\n--------------------------\n* Transparent type conversion for ``std::wstring`` and ``wchar_t``\n* Allow passing ``nullptr``-valued strings\n* Transparent passing of ``void *`` pointers using capsules\n* Transparent support for returning values wrapped in ``std::unique_ptr<>``\n* Improved docstring generation for compatibility with Sphinx\n* Nicer debug error message when default parameter construction fails\n* Support for \"opaque\" types that bypass the transparent conversion layer for STL containers\n* Redesigned type casting interface to avoid ambiguities that could occasionally cause compiler errors\n* Redesigned property implementation; fixes crashes due to an unfortunate default return value policy\n* Anaconda package generation support\n\n1.3 (March 8, 2016)\n--------------------------\n\n* Added support for the Intel C++ compiler (v15+)\n* Added support for the STL unordered set/map data structures\n* Added support for the STL linked list data structure\n* NumPy-style broadcasting support in ``pybind11::vectorize``\n* pybind11 now displays more verbose error messages when ``arg::operator=()`` fails\n* pybind11 internal data structures now live in a version-dependent namespace to avoid ABI issues\n* Many, many bugfixes involving corner cases and advanced usage\n\n1.2 (February 7, 2016)\n--------------------------\n\n* Optional: efficient generation of function signatures at compile time using C++14\n* Switched to a simpler and more general way of dealing with function default\n  arguments. Unused keyword arguments in function calls are now detected and\n  cause errors as expected\n* New ``keep_alive`` call policy analogous to Boost.Python's ``with_custodian_and_ward``\n* New ``pybind11::base<>`` attribute to indicate a subclass relationship\n* Improved interface for RAII type wrappers in ``pytypes.h``\n* Use RAII type wrappers consistently within pybind11 itself. This\n  fixes various potential refcount leaks when exceptions occur\n* Added new ``bytes`` RAII type wrapper (maps to ``string`` in Python 2.7)\n* Made handle and related RAII classes const correct, using them more\n  consistently everywhere now\n* Got rid of the ugly ``__pybind11__`` attributes on the Python side---they are\n  now stored in a C++ hash table that is not visible in Python\n* Fixed refcount leaks involving NumPy arrays and bound functions\n* Vastly improved handling of shared/smart pointers\n* Removed an unnecessary copy operation in ``pybind11::vectorize``\n* Fixed naming clashes when both pybind11 and NumPy headers are included\n* Added conversions for additional exception types\n* Documentation improvements (using multiple extension modules, smart pointers,\n  other minor clarifications)\n* unified infrastructure for parsing variadic arguments in ``class_`` and cpp_function\n* Fixed license text (was: ZLIB, should have been: 3-clause BSD)\n* Python 3.2 compatibility\n* Fixed remaining issues when accessing types in another plugin module\n* Added enum comparison and casting methods\n* Improved SFINAE-based detection of whether types are copy-constructible\n* Eliminated many warnings about unused variables and the use of ``offsetof()``\n* Support for ``std::array<>`` conversions\n\n1.1 (December 7, 2015)\n--------------------------\n\n* Documentation improvements (GIL, wrapping functions, casting, fixed many typos)\n* Generalized conversion of integer types\n* Improved support for casting function objects\n* Improved support for ``std::shared_ptr<>`` conversions\n* Initial support for ``std::set<>`` conversions\n* Fixed type resolution issue for types defined in a separate plugin module\n* CMake build system improvements\n* Factored out generic functionality to non-templated code (smaller code size)\n* Added a code size / compile time benchmark vs Boost.Python\n* Added an appveyor CI script\n\n1.0 (October 15, 2015)\n------------------------\n* Initial release\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/classes.rst",
    "content": ".. _classes:\n\nObject-oriented code\n####################\n\nCreating bindings for a custom type\n===================================\n\nLet's now look at a more complex example where we'll create bindings for a\ncustom C++ data structure named ``Pet``. Its definition is given below:\n\n.. code-block:: cpp\n\n    struct Pet {\n        Pet(const std::string &name) : name(name) { }\n        void setName(const std::string &name_) { name = name_; }\n        const std::string &getName() const { return name; }\n\n        std::string name;\n    };\n\nThe binding code for ``Pet`` looks as follows:\n\n.. code-block:: cpp\n\n    #include <pybind11/pybind11.h>\n\n    namespace py = pybind11;\n\n    PYBIND11_MODULE(example, m) {\n        py::class_<Pet>(m, \"Pet\")\n            .def(py::init<const std::string &>())\n            .def(\"setName\", &Pet::setName)\n            .def(\"getName\", &Pet::getName);\n    }\n\n:class:`class_` creates bindings for a C++ *class* or *struct*-style data\nstructure. :func:`init` is a convenience function that takes the types of a\nconstructor's parameters as template arguments and wraps the corresponding\nconstructor (see the :ref:`custom_constructors` section for details). An\ninteractive Python session demonstrating this example is shown below:\n\n.. code-block:: pycon\n\n    % python\n    >>> import example\n    >>> p = example.Pet(\"Molly\")\n    >>> print(p)\n    <example.Pet object at 0x10cd98060>\n    >>> p.getName()\n    'Molly'\n    >>> p.setName(\"Charly\")\n    >>> p.getName()\n    'Charly'\n\n.. seealso::\n\n    Static member functions can be bound in the same way using\n    :func:`class_::def_static`.\n\nKeyword and default arguments\n=============================\nIt is possible to specify keyword and default arguments using the syntax\ndiscussed in the previous chapter. Refer to the sections :ref:`keyword_args`\nand :ref:`default_args` for details.\n\nBinding lambda functions\n========================\n\nNote how ``print(p)`` produced a rather useless summary of our data structure in the example above:\n\n.. code-block:: pycon\n\n    >>> print(p)\n    <example.Pet object at 0x10cd98060>\n\nTo address this, we could bind a utility function that returns a human-readable\nsummary to the special method slot named ``__repr__``. Unfortunately, there is no\nsuitable functionality in the ``Pet`` data structure, and it would be nice if\nwe did not have to change it. This can easily be accomplished by binding a\nLambda function instead:\n\n.. code-block:: cpp\n\n        py::class_<Pet>(m, \"Pet\")\n            .def(py::init<const std::string &>())\n            .def(\"setName\", &Pet::setName)\n            .def(\"getName\", &Pet::getName)\n            .def(\"__repr__\",\n                [](const Pet &a) {\n                    return \"<example.Pet named '\" + a.name + \"'>\";\n                }\n            );\n\nBoth stateless [#f1]_ and stateful lambda closures are supported by pybind11.\nWith the above change, the same Python code now produces the following output:\n\n.. code-block:: pycon\n\n    >>> print(p)\n    <example.Pet named 'Molly'>\n\n.. [#f1] Stateless closures are those with an empty pair of brackets ``[]`` as the capture object.\n\n.. _properties:\n\nInstance and static fields\n==========================\n\nWe can also directly expose the ``name`` field using the\n:func:`class_::def_readwrite` method. A similar :func:`class_::def_readonly`\nmethod also exists for ``const`` fields.\n\n.. code-block:: cpp\n\n        py::class_<Pet>(m, \"Pet\")\n            .def(py::init<const std::string &>())\n            .def_readwrite(\"name\", &Pet::name)\n            // ... remainder ...\n\nThis makes it possible to write\n\n.. code-block:: pycon\n\n    >>> p = example.Pet(\"Molly\")\n    >>> p.name\n    'Molly'\n    >>> p.name = \"Charly\"\n    >>> p.name\n    'Charly'\n\nNow suppose that ``Pet::name`` was a private internal variable\nthat can only be accessed via setters and getters.\n\n.. code-block:: cpp\n\n    class Pet {\n    public:\n        Pet(const std::string &name) : name(name) { }\n        void setName(const std::string &name_) { name = name_; }\n        const std::string &getName() const { return name; }\n    private:\n        std::string name;\n    };\n\nIn this case, the method :func:`class_::def_property`\n(:func:`class_::def_property_readonly` for read-only data) can be used to\nprovide a field-like interface within Python that will transparently call\nthe setter and getter functions:\n\n.. code-block:: cpp\n\n        py::class_<Pet>(m, \"Pet\")\n            .def(py::init<const std::string &>())\n            .def_property(\"name\", &Pet::getName, &Pet::setName)\n            // ... remainder ...\n\nWrite only properties can be defined by passing ``nullptr`` as the\ninput for the read function.\n\n.. seealso::\n\n    Similar functions :func:`class_::def_readwrite_static`,\n    :func:`class_::def_readonly_static` :func:`class_::def_property_static`,\n    and :func:`class_::def_property_readonly_static` are provided for binding\n    static variables and properties. Please also see the section on\n    :ref:`static_properties` in the advanced part of the documentation.\n\nDynamic attributes\n==================\n\nNative Python classes can pick up new attributes dynamically:\n\n.. code-block:: pycon\n\n    >>> class Pet:\n    ...     name = \"Molly\"\n    ...\n    >>> p = Pet()\n    >>> p.name = \"Charly\"  # overwrite existing\n    >>> p.age = 2  # dynamically add a new attribute\n\nBy default, classes exported from C++ do not support this and the only writable\nattributes are the ones explicitly defined using :func:`class_::def_readwrite`\nor :func:`class_::def_property`.\n\n.. code-block:: cpp\n\n    py::class_<Pet>(m, \"Pet\")\n        .def(py::init<>())\n        .def_readwrite(\"name\", &Pet::name);\n\nTrying to set any other attribute results in an error:\n\n.. code-block:: pycon\n\n    >>> p = example.Pet()\n    >>> p.name = \"Charly\"  # OK, attribute defined in C++\n    >>> p.age = 2  # fail\n    AttributeError: 'Pet' object has no attribute 'age'\n\nTo enable dynamic attributes for C++ classes, the :class:`py::dynamic_attr` tag\nmust be added to the :class:`py::class_` constructor:\n\n.. code-block:: cpp\n\n    py::class_<Pet>(m, \"Pet\", py::dynamic_attr())\n        .def(py::init<>())\n        .def_readwrite(\"name\", &Pet::name);\n\nNow everything works as expected:\n\n.. code-block:: pycon\n\n    >>> p = example.Pet()\n    >>> p.name = \"Charly\"  # OK, overwrite value in C++\n    >>> p.age = 2  # OK, dynamically add a new attribute\n    >>> p.__dict__  # just like a native Python class\n    {'age': 2}\n\nNote that there is a small runtime cost for a class with dynamic attributes.\nNot only because of the addition of a ``__dict__``, but also because of more\nexpensive garbage collection tracking which must be activated to resolve\npossible circular references. Native Python classes incur this same cost by\ndefault, so this is not anything to worry about. By default, pybind11 classes\nare more efficient than native Python classes. Enabling dynamic attributes\njust brings them on par.\n\n.. _inheritance:\n\nInheritance and automatic downcasting\n=====================================\n\nSuppose now that the example consists of two data structures with an\ninheritance relationship:\n\n.. code-block:: cpp\n\n    struct Pet {\n        Pet(const std::string &name) : name(name) { }\n        std::string name;\n    };\n\n    struct Dog : Pet {\n        Dog(const std::string &name) : Pet(name) { }\n        std::string bark() const { return \"woof!\"; }\n    };\n\nThere are two different ways of indicating a hierarchical relationship to\npybind11: the first specifies the C++ base class as an extra template\nparameter of the :class:`class_`:\n\n.. code-block:: cpp\n\n    py::class_<Pet>(m, \"Pet\")\n       .def(py::init<const std::string &>())\n       .def_readwrite(\"name\", &Pet::name);\n\n    // Method 1: template parameter:\n    py::class_<Dog, Pet /* <- specify C++ parent type */>(m, \"Dog\")\n        .def(py::init<const std::string &>())\n        .def(\"bark\", &Dog::bark);\n\nAlternatively, we can also assign a name to the previously bound ``Pet``\n:class:`class_` object and reference it when binding the ``Dog`` class:\n\n.. code-block:: cpp\n\n    py::class_<Pet> pet(m, \"Pet\");\n    pet.def(py::init<const std::string &>())\n       .def_readwrite(\"name\", &Pet::name);\n\n    // Method 2: pass parent class_ object:\n    py::class_<Dog>(m, \"Dog\", pet /* <- specify Python parent type */)\n        .def(py::init<const std::string &>())\n        .def(\"bark\", &Dog::bark);\n\nFunctionality-wise, both approaches are equivalent. Afterwards, instances will\nexpose fields and methods of both types:\n\n.. code-block:: pycon\n\n    >>> p = example.Dog(\"Molly\")\n    >>> p.name\n    'Molly'\n    >>> p.bark()\n    'woof!'\n\nThe C++ classes defined above are regular non-polymorphic types with an\ninheritance relationship. This is reflected in Python:\n\n.. code-block:: cpp\n\n    // Return a base pointer to a derived instance\n    m.def(\"pet_store\", []() { return std::unique_ptr<Pet>(new Dog(\"Molly\")); });\n\n.. code-block:: pycon\n\n    >>> p = example.pet_store()\n    >>> type(p)  # `Dog` instance behind `Pet` pointer\n    Pet          # no pointer downcasting for regular non-polymorphic types\n    >>> p.bark()\n    AttributeError: 'Pet' object has no attribute 'bark'\n\nThe function returned a ``Dog`` instance, but because it's a non-polymorphic\ntype behind a base pointer, Python only sees a ``Pet``. In C++, a type is only\nconsidered polymorphic if it has at least one virtual function and pybind11\nwill automatically recognize this:\n\n.. code-block:: cpp\n\n    struct PolymorphicPet {\n        virtual ~PolymorphicPet() = default;\n    };\n\n    struct PolymorphicDog : PolymorphicPet {\n        std::string bark() const { return \"woof!\"; }\n    };\n\n    // Same binding code\n    py::class_<PolymorphicPet>(m, \"PolymorphicPet\");\n    py::class_<PolymorphicDog, PolymorphicPet>(m, \"PolymorphicDog\")\n        .def(py::init<>())\n        .def(\"bark\", &PolymorphicDog::bark);\n\n    // Again, return a base pointer to a derived instance\n    m.def(\"pet_store2\", []() { return std::unique_ptr<PolymorphicPet>(new PolymorphicDog); });\n\n.. code-block:: pycon\n\n    >>> p = example.pet_store2()\n    >>> type(p)\n    PolymorphicDog  # automatically downcast\n    >>> p.bark()\n    'woof!'\n\nGiven a pointer to a polymorphic base, pybind11 performs automatic downcasting\nto the actual derived type. Note that this goes beyond the usual situation in\nC++: we don't just get access to the virtual functions of the base, we get the\nconcrete derived type including functions and attributes that the base type may\nnot even be aware of.\n\n.. seealso::\n\n    For more information about polymorphic behavior see :ref:`overriding_virtuals`.\n\n\nOverloaded methods\n==================\n\nSometimes there are several overloaded C++ methods with the same name taking\ndifferent kinds of input arguments:\n\n.. code-block:: cpp\n\n    struct Pet {\n        Pet(const std::string &name, int age) : name(name), age(age) { }\n\n        void set(int age_) { age = age_; }\n        void set(const std::string &name_) { name = name_; }\n\n        std::string name;\n        int age;\n    };\n\nAttempting to bind ``Pet::set`` will cause an error since the compiler does not\nknow which method the user intended to select. We can disambiguate by casting\nthem to function pointers. Binding multiple functions to the same Python name\nautomatically creates a chain of function overloads that will be tried in\nsequence.\n\n.. code-block:: cpp\n\n    py::class_<Pet>(m, \"Pet\")\n       .def(py::init<const std::string &, int>())\n       .def(\"set\", static_cast<void (Pet::*)(int)>(&Pet::set), \"Set the pet's age\")\n       .def(\"set\", static_cast<void (Pet::*)(const std::string &)>(&Pet::set), \"Set the pet's name\");\n\nThe overload signatures are also visible in the method's docstring:\n\n.. code-block:: pycon\n\n    >>> help(example.Pet)\n\n    class Pet(__builtin__.object)\n     |  Methods defined here:\n     |\n     |  __init__(...)\n     |      Signature : (Pet, str, int) -> NoneType\n     |\n     |  set(...)\n     |      1. Signature : (Pet, int) -> NoneType\n     |\n     |      Set the pet's age\n     |\n     |      2. Signature : (Pet, str) -> NoneType\n     |\n     |      Set the pet's name\n\nIf you have a C++14 compatible compiler [#cpp14]_, you can use an alternative\nsyntax to cast the overloaded function:\n\n.. code-block:: cpp\n\n    py::class_<Pet>(m, \"Pet\")\n        .def(\"set\", py::overload_cast<int>(&Pet::set), \"Set the pet's age\")\n        .def(\"set\", py::overload_cast<const std::string &>(&Pet::set), \"Set the pet's name\");\n\nHere, ``py::overload_cast`` only requires the parameter types to be specified.\nThe return type and class are deduced. This avoids the additional noise of\n``void (Pet::*)()`` as seen in the raw cast. If a function is overloaded based\non constness, the ``py::const_`` tag should be used:\n\n.. code-block:: cpp\n\n    struct Widget {\n        int foo(int x, float y);\n        int foo(int x, float y) const;\n    };\n\n    py::class_<Widget>(m, \"Widget\")\n       .def(\"foo_mutable\", py::overload_cast<int, float>(&Widget::foo))\n       .def(\"foo_const\",   py::overload_cast<int, float>(&Widget::foo, py::const_));\n\nIf you prefer the ``py::overload_cast`` syntax but have a C++11 compatible compiler only,\nyou can use ``py::detail::overload_cast_impl`` with an additional set of parentheses:\n\n.. code-block:: cpp\n\n    template <typename... Args>\n    using overload_cast_ = pybind11::detail::overload_cast_impl<Args...>;\n\n    py::class_<Pet>(m, \"Pet\")\n        .def(\"set\", overload_cast_<int>()(&Pet::set), \"Set the pet's age\")\n        .def(\"set\", overload_cast_<const std::string &>()(&Pet::set), \"Set the pet's name\");\n\n.. [#cpp14] A compiler which supports the ``-std=c++14`` flag.\n\n.. note::\n\n    To define multiple overloaded constructors, simply declare one after the\n    other using the ``.def(py::init<...>())`` syntax. The existing machinery\n    for specifying keyword and default arguments also works.\n\nEnumerations and internal types\n===============================\n\nLet's now suppose that the example class contains internal types like enumerations, e.g.:\n\n.. code-block:: cpp\n\n    struct Pet {\n        enum Kind {\n            Dog = 0,\n            Cat\n        };\n\n        struct Attributes {\n            float age = 0;\n        };\n\n        Pet(const std::string &name, Kind type) : name(name), type(type) { }\n\n        std::string name;\n        Kind type;\n        Attributes attr;\n    };\n\nThe binding code for this example looks as follows:\n\n.. code-block:: cpp\n\n    py::class_<Pet> pet(m, \"Pet\");\n\n    pet.def(py::init<const std::string &, Pet::Kind>())\n        .def_readwrite(\"name\", &Pet::name)\n        .def_readwrite(\"type\", &Pet::type)\n        .def_readwrite(\"attr\", &Pet::attr);\n\n    py::enum_<Pet::Kind>(pet, \"Kind\")\n        .value(\"Dog\", Pet::Kind::Dog)\n        .value(\"Cat\", Pet::Kind::Cat)\n        .export_values();\n\n    py::class_<Pet::Attributes>(pet, \"Attributes\")\n        .def(py::init<>())\n        .def_readwrite(\"age\", &Pet::Attributes::age);\n\n\nTo ensure that the nested types ``Kind`` and ``Attributes`` are created within the scope of ``Pet``, the\n``pet`` :class:`class_` instance must be supplied to the :class:`enum_` and :class:`class_`\nconstructor. The :func:`enum_::export_values` function exports the enum entries\ninto the parent scope, which should be skipped for newer C++11-style strongly\ntyped enums.\n\n.. code-block:: pycon\n\n    >>> p = Pet(\"Lucy\", Pet.Cat)\n    >>> p.type\n    Kind.Cat\n    >>> int(p.type)\n    1L\n\nThe entries defined by the enumeration type are exposed in the ``__members__`` property:\n\n.. code-block:: pycon\n\n    >>> Pet.Kind.__members__\n    {'Dog': Kind.Dog, 'Cat': Kind.Cat}\n\nThe ``name`` property returns the name of the enum value as a unicode string.\n\n.. note::\n\n    It is also possible to use ``str(enum)``, however these accomplish different\n    goals. The following shows how these two approaches differ.\n\n    .. code-block:: pycon\n\n        >>> p = Pet(\"Lucy\", Pet.Cat)\n        >>> pet_type = p.type\n        >>> pet_type\n        Pet.Cat\n        >>> str(pet_type)\n        'Pet.Cat'\n        >>> pet_type.name\n        'Cat'\n\n.. note::\n\n    When the special tag ``py::arithmetic()`` is specified to the ``enum_``\n    constructor, pybind11 creates an enumeration that also supports rudimentary\n    arithmetic and bit-level operations like comparisons, and, or, xor, negation,\n    etc.\n\n    .. code-block:: cpp\n\n        py::enum_<Pet::Kind>(pet, \"Kind\", py::arithmetic())\n           ...\n\n    By default, these are omitted to conserve space.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/cmake/index.rst",
    "content": "CMake helpers\n-------------\n\nPybind11 can be used with ``add_subdirectory(extern/pybind11)``, or from an\ninstall with ``find_package(pybind11 CONFIG)``. The interface provided in\neither case is functionally identical.\n\n.. cmake-module:: ../../tools/pybind11Config.cmake.in\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/compiling.rst",
    "content": ".. _compiling:\n\nBuild systems\n#############\n\n.. _build-setuptools:\n\nBuilding with setuptools\n========================\n\nFor projects on PyPI, building with setuptools is the way to go. Sylvain Corlay\nhas kindly provided an example project which shows how to set up everything,\nincluding automatic generation of documentation using Sphinx. Please refer to\nthe [python_example]_ repository.\n\n.. [python_example] https://github.com/pybind/python_example\n\nA helper file is provided with pybind11 that can simplify usage with setuptools.\n\nTo use pybind11 inside your ``setup.py``, you have to have some system to\nensure that ``pybind11`` is installed when you build your package. There are\nfour possible ways to do this, and pybind11 supports all four: You can ask all\nusers to install pybind11 beforehand (bad), you can use\n:ref:`setup_helpers-pep518` (good, but very new and requires Pip 10),\n:ref:`setup_helpers-setup_requires` (discouraged by Python packagers now that\nPEP 518 is available, but it still works everywhere), or you can\n:ref:`setup_helpers-copy-manually` (always works but you have to manually sync\nyour copy to get updates).\n\nAn example of a ``setup.py`` using pybind11's helpers:\n\n.. code-block:: python\n\n    from glob import glob\n    from setuptools import setup\n    from pybind11.setup_helpers import Pybind11Extension\n\n    ext_modules = [\n        Pybind11Extension(\n            \"python_example\",\n            sorted(glob(\"src/*.cpp\")),  # Sort source files for reproducibility\n        ),\n    ]\n\n    setup(..., ext_modules=ext_modules)\n\nIf you want to do an automatic search for the highest supported C++ standard,\nthat is supported via a ``build_ext`` command override; it will only affect\n``Pybind11Extensions``:\n\n.. code-block:: python\n\n    from glob import glob\n    from setuptools import setup\n    from pybind11.setup_helpers import Pybind11Extension, build_ext\n\n    ext_modules = [\n        Pybind11Extension(\n            \"python_example\",\n            sorted(glob(\"src/*.cpp\")),\n        ),\n    ]\n\n    setup(..., cmdclass={\"build_ext\": build_ext}, ext_modules=ext_modules)\n\nIf you have single-file extension modules that are directly stored in the\nPython source tree (``foo.cpp`` in the same directory as where a ``foo.py``\nwould be located), you can also generate ``Pybind11Extensions`` using\n``setup_helpers.intree_extensions``: ``intree_extensions([\"path/to/foo.cpp\",\n...])`` returns a list of ``Pybind11Extensions`` which can be passed to\n``ext_modules``, possibly after further customizing their attributes\n(``libraries``, ``include_dirs``, etc.).  By doing so, a ``foo.*.so`` extension\nmodule will be generated and made available upon installation.\n\n``intree_extension`` will automatically detect if you are using a ``src``-style\nlayout (as long as no namespace packages are involved), but you can also\nexplicitly pass ``package_dir`` to it (as in ``setuptools.setup``).\n\nSince pybind11 does not require NumPy when building, a light-weight replacement\nfor NumPy's parallel compilation distutils tool is included. Use it like this:\n\n.. code-block:: python\n\n    from pybind11.setup_helpers import ParallelCompile\n\n    # Optional multithreaded build\n    ParallelCompile(\"NPY_NUM_BUILD_JOBS\").install()\n\n    setup(...)\n\nThe argument is the name of an environment variable to control the number of\nthreads, such as ``NPY_NUM_BUILD_JOBS`` (as used by NumPy), though you can set\nsomething different if you want; ``CMAKE_BUILD_PARALLEL_LEVEL`` is another choice\na user might expect. You can also pass ``default=N`` to set the default number\nof threads (0 will take the number of threads available) and ``max=N``, the\nmaximum number of threads; if you have a large extension you may want set this\nto a memory dependent number.\n\nIf you are developing rapidly and have a lot of C++ files, you may want to\navoid rebuilding files that have not changed. For simple cases were you are\nusing ``pip install -e .`` and do not have local headers, you can skip the\nrebuild if an object file is newer than its source (headers are not checked!)\nwith the following:\n\n.. code-block:: python\n\n    from pybind11.setup_helpers import ParallelCompile, naive_recompile\n\n    ParallelCompile(\"NPY_NUM_BUILD_JOBS\", needs_recompile=naive_recompile).install()\n\n\nIf you have a more complex build, you can implement a smarter function and pass\nit to ``needs_recompile``, or you can use [Ccache]_ instead. ``CXX=\"cache g++\"\npip install -e .`` would be the way to use it with GCC, for example. Unlike the\nsimple solution, this even works even when not compiling in editable mode, but\nit does require Ccache to be installed.\n\nKeep in mind that Pip will not even attempt to rebuild if it thinks it has\nalready built a copy of your code, which it deduces from the version number.\nOne way to avoid this is to use [setuptools_scm]_, which will generate a\nversion number that includes the number of commits since your last tag and a\nhash for a dirty directory. Another way to force a rebuild is purge your cache\nor use Pip's ``--no-cache-dir`` option.\n\n.. [Ccache] https://ccache.dev\n\n.. [setuptools_scm] https://github.com/pypa/setuptools_scm\n\n.. _setup_helpers-pep518:\n\nPEP 518 requirements (Pip 10+ required)\n---------------------------------------\n\nIf you use `PEP 518's <https://www.python.org/dev/peps/pep-0518/>`_\n``pyproject.toml`` file, you can ensure that ``pybind11`` is available during\nthe compilation of your project.  When this file exists, Pip will make a new\nvirtual environment, download just the packages listed here in ``requires=``,\nand build a wheel (binary Python package). It will then throw away the\nenvironment, and install your wheel.\n\nYour ``pyproject.toml`` file will likely look something like this:\n\n.. code-block:: toml\n\n    [build-system]\n    requires = [\"setuptools>=42\", \"wheel\", \"pybind11~=2.6.1\"]\n    build-backend = \"setuptools.build_meta\"\n\n.. note::\n\n    The main drawback to this method is that a `PEP 517`_ compliant build tool,\n    such as Pip 10+, is required for this approach to work; older versions of\n    Pip completely ignore this file. If you distribute binaries (called wheels\n    in Python) using something like `cibuildwheel`_, remember that ``setup.py``\n    and ``pyproject.toml`` are not even contained in the wheel, so this high\n    Pip requirement is only for source builds, and will not affect users of\n    your binary wheels. If you are building SDists and wheels, then\n    `pypa-build`_ is the recommended official tool.\n\n.. _PEP 517: https://www.python.org/dev/peps/pep-0517/\n.. _cibuildwheel: https://cibuildwheel.readthedocs.io\n.. _pypa-build: https://pypa-build.readthedocs.io/en/latest/\n\n.. _setup_helpers-setup_requires:\n\nClassic ``setup_requires``\n--------------------------\n\nIf you want to support old versions of Pip with the classic\n``setup_requires=[\"pybind11\"]`` keyword argument to setup, which triggers a\ntwo-phase ``setup.py`` run, then you will need to use something like this to\nensure the first pass works (which has not yet installed the ``setup_requires``\npackages, since it can't install something it does not know about):\n\n.. code-block:: python\n\n    try:\n        from pybind11.setup_helpers import Pybind11Extension\n    except ImportError:\n        from setuptools import Extension as Pybind11Extension\n\n\nIt doesn't matter that the Extension class is not the enhanced subclass for the\nfirst pass run; and the second pass will have the ``setup_requires``\nrequirements.\n\nThis is obviously more of a hack than the PEP 518 method, but it supports\nancient versions of Pip.\n\n.. _setup_helpers-copy-manually:\n\nCopy manually\n-------------\n\nYou can also copy ``setup_helpers.py`` directly to your project; it was\ndesigned to be usable standalone, like the old example ``setup.py``. You can\nset ``include_pybind11=False`` to skip including the pybind11 package headers,\nso you can use it with git submodules and a specific git version. If you use\nthis, you will need to import from a local file in ``setup.py`` and ensure the\nhelper file is part of your MANIFEST.\n\n\nClosely related, if you include pybind11 as a subproject, you can run the\n``setup_helpers.py`` inplace. If loaded correctly, this should even pick up\nthe correct include for pybind11, though you can turn it off as shown above if\nyou want to input it manually.\n\nSuggested usage if you have pybind11 as a submodule in ``extern/pybind11``:\n\n.. code-block:: python\n\n    DIR = os.path.abspath(os.path.dirname(__file__))\n\n    sys.path.append(os.path.join(DIR, \"extern\", \"pybind11\"))\n    from pybind11.setup_helpers import Pybind11Extension  # noqa: E402\n\n    del sys.path[-1]\n\n\n.. versionchanged:: 2.6\n\n    Added ``setup_helpers`` file.\n\nBuilding with cppimport\n========================\n\n[cppimport]_ is a small Python import hook that determines whether there is a C++\nsource file whose name matches the requested module. If there is, the file is\ncompiled as a Python extension using pybind11 and placed in the same folder as\nthe C++ source file. Python is then able to find the module and load it.\n\n.. [cppimport] https://github.com/tbenthompson/cppimport\n\n.. _cmake:\n\nBuilding with CMake\n===================\n\nFor C++ codebases that have an existing CMake-based build system, a Python\nextension module can be created with just a few lines of code:\n\n.. code-block:: cmake\n\n    cmake_minimum_required(VERSION 3.4...3.18)\n    project(example LANGUAGES CXX)\n\n    add_subdirectory(pybind11)\n    pybind11_add_module(example example.cpp)\n\nThis assumes that the pybind11 repository is located in a subdirectory named\n:file:`pybind11` and that the code is located in a file named :file:`example.cpp`.\nThe CMake command ``add_subdirectory`` will import the pybind11 project which\nprovides the ``pybind11_add_module`` function. It will take care of all the\ndetails needed to build a Python extension module on any platform.\n\nA working sample project, including a way to invoke CMake from :file:`setup.py` for\nPyPI integration, can be found in the [cmake_example]_  repository.\n\n.. [cmake_example] https://github.com/pybind/cmake_example\n\n.. versionchanged:: 2.6\n   CMake 3.4+ is required.\n\nFurther information can be found at :doc:`cmake/index`.\n\npybind11_add_module\n-------------------\n\nTo ease the creation of Python extension modules, pybind11 provides a CMake\nfunction with the following signature:\n\n.. code-block:: cmake\n\n    pybind11_add_module(<name> [MODULE | SHARED] [EXCLUDE_FROM_ALL]\n                        [NO_EXTRAS] [THIN_LTO] [OPT_SIZE] source1 [source2 ...])\n\nThis function behaves very much like CMake's builtin ``add_library`` (in fact,\nit's a wrapper function around that command). It will add a library target\ncalled ``<name>`` to be built from the listed source files. In addition, it\nwill take care of all the Python-specific compiler and linker flags as well\nas the OS- and Python-version-specific file extension. The produced target\n``<name>`` can be further manipulated with regular CMake commands.\n\n``MODULE`` or ``SHARED`` may be given to specify the type of library. If no\ntype is given, ``MODULE`` is used by default which ensures the creation of a\nPython-exclusive module. Specifying ``SHARED`` will create a more traditional\ndynamic library which can also be linked from elsewhere. ``EXCLUDE_FROM_ALL``\nremoves this target from the default build (see CMake docs for details).\n\nSince pybind11 is a template library, ``pybind11_add_module`` adds compiler\nflags to ensure high quality code generation without bloat arising from long\nsymbol names and duplication of code in different translation units. It\nsets default visibility to *hidden*, which is required for some pybind11\nfeatures and functionality when attempting to load multiple pybind11 modules\ncompiled under different pybind11 versions.  It also adds additional flags\nenabling LTO (Link Time Optimization) and strip unneeded symbols. See the\n:ref:`FAQ entry <faq:symhidden>` for a more detailed explanation. These\nlatter optimizations are never applied in ``Debug`` mode.  If ``NO_EXTRAS`` is\ngiven, they will always be disabled, even in ``Release`` mode. However, this\nwill result in code bloat and is generally not recommended.\n\nAs stated above, LTO is enabled by default. Some newer compilers also support\ndifferent flavors of LTO such as `ThinLTO`_. Setting ``THIN_LTO`` will cause\nthe function to prefer this flavor if available. The function falls back to\nregular LTO if ``-flto=thin`` is not available. If\n``CMAKE_INTERPROCEDURAL_OPTIMIZATION`` is set (either ``ON`` or ``OFF``), then\nthat will be respected instead of the built-in flag search.\n\n.. note::\n\n   If you want to set the property form on targets or the\n   ``CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>`` versions of this, you should\n   still use ``set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)`` (otherwise a\n   no-op) to disable pybind11's ipo flags.\n\nThe ``OPT_SIZE`` flag enables size-based optimization equivalent to the\nstandard ``/Os`` or ``-Os`` compiler flags and the ``MinSizeRel`` build type,\nwhich avoid optimizations that that can substantially increase the size of the\nresulting binary. This flag is particularly useful in projects that are split\ninto performance-critical parts and associated bindings. In this case, we can\ncompile the project in release mode (and hence, optimize performance globally),\nand specify ``OPT_SIZE`` for the binding target, where size might be the main\nconcern as performance is often less critical here. A ~25% size reduction has\nbeen observed in practice. This flag only changes the optimization behavior at\na per-target level and takes precedence over the global CMake build type\n(``Release``, ``RelWithDebInfo``) except for ``Debug`` builds, where\noptimizations remain disabled.\n\n.. _ThinLTO: http://clang.llvm.org/docs/ThinLTO.html\n\nConfiguration variables\n-----------------------\n\nBy default, pybind11 will compile modules with the compiler default or the\nminimum standard required by pybind11, whichever is higher.  You can set the\nstandard explicitly with\n`CMAKE_CXX_STANDARD <https://cmake.org/cmake/help/latest/variable/CMAKE_CXX_STANDARD.html>`_:\n\n.. code-block:: cmake\n\n    set(CMAKE_CXX_STANDARD 14 CACHE STRING \"C++ version selection\")  # or 11, 14, 17, 20\n    set(CMAKE_CXX_STANDARD_REQUIRED ON)  # optional, ensure standard is supported\n    set(CMAKE_CXX_EXTENSIONS OFF)  # optional, keep compiler extensions off\n\nThe variables can also be set when calling CMake from the command line using\nthe ``-D<variable>=<value>`` flag. You can also manually set ``CXX_STANDARD``\non a target or use ``target_compile_features`` on your targets - anything that\nCMake supports.\n\nClassic Python support: The target Python version can be selected by setting\n``PYBIND11_PYTHON_VERSION`` or an exact Python installation can be specified\nwith ``PYTHON_EXECUTABLE``.  For example:\n\n.. code-block:: bash\n\n    cmake -DPYBIND11_PYTHON_VERSION=3.6 ..\n\n    # Another method:\n    cmake -DPYTHON_EXECUTABLE=/path/to/python ..\n\n    # This often is a good way to get the current Python, works in environments:\n    cmake -DPYTHON_EXECUTABLE=$(python3 -c \"import sys; print(sys.executable)\") ..\n\n\nfind_package vs. add_subdirectory\n---------------------------------\n\nFor CMake-based projects that don't include the pybind11 repository internally,\nan external installation can be detected through ``find_package(pybind11)``.\nSee the `Config file`_ docstring for details of relevant CMake variables.\n\n.. code-block:: cmake\n\n    cmake_minimum_required(VERSION 3.4...3.18)\n    project(example LANGUAGES CXX)\n\n    find_package(pybind11 REQUIRED)\n    pybind11_add_module(example example.cpp)\n\nNote that ``find_package(pybind11)`` will only work correctly if pybind11\nhas been correctly installed on the system, e. g. after downloading or cloning\nthe pybind11 repository  :\n\n.. code-block:: bash\n\n    # Classic CMake\n    cd pybind11\n    mkdir build\n    cd build\n    cmake ..\n    make install\n\n    # CMake 3.15+\n    cd pybind11\n    cmake -S . -B build\n    cmake --build build -j 2  # Build on 2 cores\n    cmake --install build\n\nOnce detected, the aforementioned ``pybind11_add_module`` can be employed as\nbefore. The function usage and configuration variables are identical no matter\nif pybind11 is added as a subdirectory or found as an installed package. You\ncan refer to the same [cmake_example]_ repository for a full sample project\n-- just swap out ``add_subdirectory`` for ``find_package``.\n\n.. _Config file: https://github.com/pybind/pybind11/blob/master/tools/pybind11Config.cmake.in\n\n\n.. _find-python-mode:\n\nFindPython mode\n---------------\n\nCMake 3.12+ (3.15+ recommended, 3.18.2+ ideal) added a new module called\nFindPython that had a highly improved search algorithm and modern targets\nand tools. If you use FindPython, pybind11 will detect this and use the\nexisting targets instead:\n\n.. code-block:: cmake\n\n    cmake_minimum_required(VERSION 3.15...3.22)\n    project(example LANGUAGES CXX)\n\n    find_package(Python 3.6 COMPONENTS Interpreter Development REQUIRED)\n    find_package(pybind11 CONFIG REQUIRED)\n    # or add_subdirectory(pybind11)\n\n    pybind11_add_module(example example.cpp)\n\nYou can also use the targets (as listed below) with FindPython. If you define\n``PYBIND11_FINDPYTHON``, pybind11 will perform the FindPython step for you\n(mostly useful when building pybind11's own tests, or as a way to change search\nalgorithms from the CMake invocation, with ``-DPYBIND11_FINDPYTHON=ON``.\n\n.. warning::\n\n    If you use FindPython to multi-target Python versions, use the individual\n    targets listed below, and avoid targets that directly include Python parts.\n\nThere are `many ways to hint or force a discovery of a specific Python\ninstallation <https://cmake.org/cmake/help/latest/module/FindPython.html>`_),\nsetting ``Python_ROOT_DIR`` may be the most common one (though with\nvirtualenv/venv support, and Conda support, this tends to find the correct\nPython version more often than the old system did).\n\n.. warning::\n\n    When the Python libraries (i.e. ``libpythonXX.a`` and ``libpythonXX.so``\n    on Unix) are not available, as is the case on a manylinux image, the\n    ``Development`` component will not be resolved by ``FindPython``. When not\n    using the embedding functionality, CMake 3.18+ allows you to specify\n    ``Development.Module`` instead of ``Development`` to resolve this issue.\n\n.. versionadded:: 2.6\n\nAdvanced: interface library targets\n-----------------------------------\n\nPybind11 supports modern CMake usage patterns with a set of interface targets,\navailable in all modes. The targets provided are:\n\n   ``pybind11::headers``\n     Just the pybind11 headers and minimum compile requirements\n\n   ``pybind11::pybind11``\n     Python headers + ``pybind11::headers``\n\n   ``pybind11::python_link_helper``\n     Just the \"linking\" part of pybind11:module\n\n   ``pybind11::module``\n     Everything for extension modules - ``pybind11::pybind11`` + ``Python::Module`` (FindPython CMake 3.15+) or ``pybind11::python_link_helper``\n\n   ``pybind11::embed``\n     Everything for embedding the Python interpreter - ``pybind11::pybind11`` + ``Python::Python`` (FindPython) or Python libs\n\n   ``pybind11::lto`` / ``pybind11::thin_lto``\n     An alternative to `INTERPROCEDURAL_OPTIMIZATION` for adding link-time optimization.\n\n   ``pybind11::windows_extras``\n     ``/bigobj`` and ``/mp`` for MSVC.\n\n   ``pybind11::opt_size``\n     ``/Os`` for MSVC, ``-Os`` for other compilers. Does nothing for debug builds.\n\nTwo helper functions are also provided:\n\n    ``pybind11_strip(target)``\n      Strips a target (uses ``CMAKE_STRIP`` after the target is built)\n\n    ``pybind11_extension(target)``\n      Sets the correct extension (with SOABI) for a target.\n\nYou can use these targets to build complex applications. For example, the\n``add_python_module`` function is identical to:\n\n.. code-block:: cmake\n\n    cmake_minimum_required(VERSION 3.4)\n    project(example LANGUAGES CXX)\n\n    find_package(pybind11 REQUIRED)  # or add_subdirectory(pybind11)\n\n    add_library(example MODULE main.cpp)\n\n    target_link_libraries(example PRIVATE pybind11::module pybind11::lto pybind11::windows_extras)\n\n    pybind11_extension(example)\n    if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo)\n        # Strip unnecessary sections of the binary on Linux/macOS\n        pybind11_strip(example)\n    endif()\n\n    set_target_properties(example PROPERTIES CXX_VISIBILITY_PRESET \"hidden\"\n                                             CUDA_VISIBILITY_PRESET \"hidden\")\n\nInstead of setting properties, you can set ``CMAKE_*`` variables to initialize these correctly.\n\n.. warning::\n\n    Since pybind11 is a metatemplate library, it is crucial that certain\n    compiler flags are provided to ensure high quality code generation. In\n    contrast to the ``pybind11_add_module()`` command, the CMake interface\n    provides a *composable* set of targets to ensure that you retain flexibility.\n    It can be especially important to provide or set these properties; the\n    :ref:`FAQ <faq:symhidden>` contains an explanation on why these are needed.\n\n.. versionadded:: 2.6\n\n.. _nopython-mode:\n\nAdvanced: NOPYTHON mode\n-----------------------\n\nIf you want complete control, you can set ``PYBIND11_NOPYTHON`` to completely\ndisable Python integration (this also happens if you run ``FindPython2`` and\n``FindPython3`` without running ``FindPython``). This gives you complete\nfreedom to integrate into an existing system (like `Scikit-Build's\n<https://scikit-build.readthedocs.io>`_ ``PythonExtensions``).\n``pybind11_add_module`` and ``pybind11_extension`` will be unavailable, and the\ntargets will be missing any Python specific behavior.\n\n.. versionadded:: 2.6\n\nEmbedding the Python interpreter\n--------------------------------\n\nIn addition to extension modules, pybind11 also supports embedding Python into\na C++ executable or library. In CMake, simply link with the ``pybind11::embed``\ntarget. It provides everything needed to get the interpreter running. The Python\nheaders and libraries are attached to the target. Unlike ``pybind11::module``,\nthere is no need to manually set any additional properties here. For more\ninformation about usage in C++, see :doc:`/advanced/embedding`.\n\n.. code-block:: cmake\n\n    cmake_minimum_required(VERSION 3.4...3.18)\n    project(example LANGUAGES CXX)\n\n    find_package(pybind11 REQUIRED)  # or add_subdirectory(pybind11)\n\n    add_executable(example main.cpp)\n    target_link_libraries(example PRIVATE pybind11::embed)\n\n.. _building_manually:\n\nBuilding manually\n=================\n\npybind11 is a header-only library, hence it is not necessary to link against\nany special libraries and there are no intermediate (magic) translation steps.\n\nOn Linux, you can compile an example such as the one given in\n:ref:`simple_example` using the following command:\n\n.. code-block:: bash\n\n    $ c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) example.cpp -o example$(python3-config --extension-suffix)\n\nThe ``python3 -m pybind11 --includes`` command fetches the include paths for\nboth pybind11 and Python headers. This assumes that pybind11 has been installed\nusing ``pip`` or ``conda``. If it hasn't, you can also manually specify\n``-I <path-to-pybind11>/include`` together with the Python includes path\n``python3-config --includes``.\n\nOn macOS: the build command is almost the same but it also requires passing\nthe ``-undefined dynamic_lookup`` flag so as to ignore missing symbols when\nbuilding the module:\n\n.. code-block:: bash\n\n    $ c++ -O3 -Wall -shared -std=c++11 -undefined dynamic_lookup $(python3 -m pybind11 --includes) example.cpp -o example$(python3-config --extension-suffix)\n\nIn general, it is advisable to include several additional build parameters\nthat can considerably reduce the size of the created binary. Refer to section\n:ref:`cmake` for a detailed example of a suitable cross-platform CMake-based\nbuild system that works on all platforms including Windows.\n\n.. note::\n\n    On Linux and macOS, it's better to (intentionally) not link against\n    ``libpython``. The symbols will be resolved when the extension library\n    is loaded into a Python binary. This is preferable because you might\n    have several different installations of a given Python version (e.g. the\n    system-provided Python, and one that ships with a piece of commercial\n    software). In this way, the plugin will work with both versions, instead\n    of possibly importing a second Python library into a process that already\n    contains one (which will lead to a segfault).\n\n\nBuilding with Bazel\n===================\n\nYou can build with the Bazel build system using the `pybind11_bazel\n<https://github.com/pybind/pybind11_bazel>`_ repository.\n\nGenerating binding code automatically\n=====================================\n\nThe ``Binder`` project is a tool for automatic generation of pybind11 binding\ncode by introspecting existing C++ codebases using LLVM/Clang. See the\n[binder]_ documentation for details.\n\n.. [binder] http://cppbinder.readthedocs.io/en/latest/about.html\n\n[AutoWIG]_ is a Python library that wraps automatically compiled libraries into\nhigh-level languages. It parses C++ code using LLVM/Clang technologies and\ngenerates the wrappers using the Mako templating engine. The approach is automatic,\nextensible, and applies to very complex C++ libraries, composed of thousands of\nclasses or incorporating modern meta-programming constructs.\n\n.. [AutoWIG] https://github.com/StatisKit/AutoWIG\n\n[robotpy-build]_ is a is a pure python, cross platform build tool that aims to\nsimplify creation of python wheels for pybind11 projects, and provide\ncross-project dependency management. Additionally, it is able to autogenerate\ncustomizable pybind11-based wrappers by parsing C++ header files.\n\n.. [robotpy-build] https://robotpy-build.readthedocs.io\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/conf.py",
    "content": "#!/usr/bin/env python3\n#\n# pybind11 documentation build configuration file, created by\n# sphinx-quickstart on Sun Oct 11 19:23:48 2015.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport os\nimport re\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nDIR = Path(__file__).parent.resolve()\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n# sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n# needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    \"breathe\",\n    \"sphinx_copybutton\",\n    \"sphinxcontrib.rsvgconverter\",\n    \"sphinxcontrib.moderncmakedomain\",\n]\n\nbreathe_projects = {\"pybind11\": \".build/doxygenxml/\"}\nbreathe_default_project = \"pybind11\"\nbreathe_domain_by_extension = {\"h\": \"cpp\"}\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\".templates\"]\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n# source_suffix = ['.rst', '.md']\nsource_suffix = \".rst\"\n\n# The encoding of source files.\n# source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = \"index\"\n\n# General information about the project.\nproject = \"pybind11\"\ncopyright = \"2017, Wenzel Jakob\"\nauthor = \"Wenzel Jakob\"\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n\n# Read the listed version\nwith open(\"../pybind11/_version.py\") as f:\n    code = compile(f.read(), \"../pybind11/_version.py\", \"exec\")\nloc = {}\nexec(code, loc)\n\n# The full version, including alpha/beta/rc tags.\nversion = loc[\"__version__\"]\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n# today = ''\n# Else, today_fmt is used as the format for a strftime call.\n# today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = [\".build\", \"release.rst\"]\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\ndefault_role = \"any\"\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n# add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n# add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n# show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\n# pygments_style = 'monokai'\n\n# A list of ignored prefixes for module index sorting.\n# modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n# keep_warnings = False\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = False\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n\nhtml_theme = \"furo\"\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n# html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n# html_theme_path = []\n\n# The name for this set of Sphinx documents.  If None, it defaults to\n# \"<project> v<version> documentation\".\n# html_title = None\n\n# A shorter title for the navigation bar.  Default is the same as html_title.\n# html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n# html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n# html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = [\"_static\"]\n\nhtml_css_files = [\n    \"css/custom.css\",\n]\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n# html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n# html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n# html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n# html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n# html_additional_pages = {}\n\n# If false, no module index is generated.\n# html_domain_indices = True\n\n# If false, no index is generated.\n# html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n# html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n# html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n# html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n# html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it.  The value of this option must be the\n# base URL from which the finished HTML is served.\n# html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n# html_file_suffix = None\n\n# Language to be used for generating the HTML full-text search index.\n# Sphinx supports the following languages:\n#   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'\n#   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'\n# html_search_language = 'en'\n\n# A dictionary with options for the search language support, empty by default.\n# Now only 'ja' uses this config value\n# html_search_options = {'type': 'default'}\n\n# The name of a javascript file (relative to the configuration directory) that\n# implements a search results scorer. If empty, the default will be used.\n# html_search_scorer = 'scorer.js'\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = \"pybind11doc\"\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_engine = \"pdflatex\"\n\nlatex_elements = {\n    # The paper size ('letterpaper' or 'a4paper').\n    # 'papersize': 'letterpaper',\n    #\n    # The font size ('10pt', '11pt' or '12pt').\n    # 'pointsize': '10pt',\n    #\n    # Additional stuff for the LaTeX preamble.\n    # remove blank pages (between the title page and the TOC, etc.)\n    \"classoptions\": \",openany,oneside\",\n    \"preamble\": r\"\"\"\n\\usepackage{fontawesome}\n\\usepackage{textgreek}\n\\DeclareUnicodeCharacter{00A0}{}\n\\DeclareUnicodeCharacter{2194}{\\faArrowsH}\n\\DeclareUnicodeCharacter{1F382}{\\faBirthdayCake}\n\\DeclareUnicodeCharacter{1F355}{\\faAdjust}\n\\DeclareUnicodeCharacter{0301}{'}\n\\DeclareUnicodeCharacter{03C0}{\\textpi}\n\n\"\"\",\n    # Latex figure (float) alignment\n    # 'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n#  author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n    (master_doc, \"pybind11.tex\", \"pybind11 Documentation\", \"Wenzel Jakob\", \"manual\"),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n# latex_logo = 'pybind11-logo.png'\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n# latex_use_parts = False\n\n# If true, show page references after internal links.\n# latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n# latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n# latex_appendices = []\n\n# If false, no module index is generated.\n# latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [(master_doc, \"pybind11\", \"pybind11 Documentation\", [author], 1)]\n\n# If true, show URL addresses after external links.\n# man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n#  dir menu entry, description, category)\ntexinfo_documents = [\n    (\n        master_doc,\n        \"pybind11\",\n        \"pybind11 Documentation\",\n        author,\n        \"pybind11\",\n        \"One line description of project.\",\n        \"Miscellaneous\",\n    ),\n]\n\n# Documents to append as an appendix to all manuals.\n# texinfo_appendices = []\n\n# If false, no module index is generated.\n# texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n# texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n# texinfo_no_detailmenu = False\n\nprimary_domain = \"cpp\"\nhighlight_language = \"cpp\"\n\n\ndef generate_doxygen_xml(app):\n    build_dir = os.path.join(app.confdir, \".build\")\n    if not os.path.exists(build_dir):\n        os.mkdir(build_dir)\n\n    try:\n        subprocess.call([\"doxygen\", \"--version\"])\n        retcode = subprocess.call([\"doxygen\"], cwd=app.confdir)\n        if retcode < 0:\n            sys.stderr.write(f\"doxygen error code: {-retcode}\\n\")\n    except OSError as e:\n        sys.stderr.write(f\"doxygen execution failed: {e}\\n\")\n\n\ndef prepare(app):\n    with open(DIR.parent / \"README.rst\") as f:\n        contents = f.read()\n\n    if app.builder.name == \"latex\":\n        # Remove badges and stuff from start\n        contents = contents[contents.find(r\".. start\") :]\n\n        # Filter out section titles for index.rst for LaTeX\n        contents = re.sub(r\"^(.*)\\n[-~]{3,}$\", r\"**\\1**\", contents, flags=re.MULTILINE)\n\n    with open(DIR / \"readme.rst\", \"w\") as f:\n        f.write(contents)\n\n\ndef clean_up(app, exception):\n    (DIR / \"readme.rst\").unlink()\n\n\ndef setup(app):\n    # Add hook for building doxygen xml when needed\n    app.connect(\"builder-inited\", generate_doxygen_xml)\n\n    # Copy the readme in\n    app.connect(\"builder-inited\", prepare)\n\n    # Clean up the generated readme\n    app.connect(\"build-finished\", clean_up)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/faq.rst",
    "content": "Frequently asked questions\n##########################\n\n\"ImportError: dynamic module does not define init function\"\n===========================================================\n\n1. Make sure that the name specified in PYBIND11_MODULE is identical to the\nfilename of the extension library (without suffixes such as ``.so``).\n\n2. If the above did not fix the issue, you are likely using an incompatible\nversion of Python that does not match what you compiled with.\n\n\"Symbol not found: ``__Py_ZeroStruct`` / ``_PyInstanceMethod_Type``\"\n========================================================================\n\nSee the first answer.\n\n\"SystemError: dynamic module not initialized properly\"\n======================================================\n\nSee the first answer.\n\nThe Python interpreter immediately crashes when importing my module\n===================================================================\n\nSee the first answer.\n\n.. _faq_reference_arguments:\n\nLimitations involving reference arguments\n=========================================\n\nIn C++, it's fairly common to pass arguments using mutable references or\nmutable pointers, which allows both read and write access to the value\nsupplied by the caller. This is sometimes done for efficiency reasons, or to\nrealize functions that have multiple return values. Here are two very basic\nexamples:\n\n.. code-block:: cpp\n\n    void increment(int &i) { i++; }\n    void increment_ptr(int *i) { (*i)++; }\n\nIn Python, all arguments are passed by reference, so there is no general\nissue in binding such code from Python.\n\nHowever, certain basic Python types (like ``str``, ``int``, ``bool``,\n``float``, etc.) are **immutable**. This means that the following attempt\nto port the function to Python doesn't have the same effect on the value\nprovided by the caller -- in fact, it does nothing at all.\n\n.. code-block:: python\n\n    def increment(i):\n        i += 1  # nope..\n\npybind11 is also affected by such language-level conventions, which means that\nbinding ``increment`` or ``increment_ptr`` will also create Python functions\nthat don't modify their arguments.\n\nAlthough inconvenient, one workaround is to encapsulate the immutable types in\na custom type that does allow modifications.\n\nAn other alternative involves binding a small wrapper lambda function that\nreturns a tuple with all output arguments (see the remainder of the\ndocumentation for examples on binding lambda functions). An example:\n\n.. code-block:: cpp\n\n    int foo(int &i) { i++; return 123; }\n\nand the binding code\n\n.. code-block:: cpp\n\n   m.def(\"foo\", [](int i) { int rv = foo(i); return std::make_tuple(rv, i); });\n\n\nHow can I reduce the build time?\n================================\n\nIt's good practice to split binding code over multiple files, as in the\nfollowing example:\n\n:file:`example.cpp`:\n\n.. code-block:: cpp\n\n    void init_ex1(py::module_ &);\n    void init_ex2(py::module_ &);\n    /* ... */\n\n    PYBIND11_MODULE(example, m) {\n        init_ex1(m);\n        init_ex2(m);\n        /* ... */\n    }\n\n:file:`ex1.cpp`:\n\n.. code-block:: cpp\n\n    void init_ex1(py::module_ &m) {\n        m.def(\"add\", [](int a, int b) { return a + b; });\n    }\n\n:file:`ex2.cpp`:\n\n.. code-block:: cpp\n\n    void init_ex2(py::module_ &m) {\n        m.def(\"sub\", [](int a, int b) { return a - b; });\n    }\n\n:command:`python`:\n\n.. code-block:: pycon\n\n    >>> import example\n    >>> example.add(1, 2)\n    3\n    >>> example.sub(1, 1)\n    0\n\nAs shown above, the various ``init_ex`` functions should be contained in\nseparate files that can be compiled independently from one another, and then\nlinked together into the same final shared object.  Following this approach\nwill:\n\n1. reduce memory requirements per compilation unit.\n\n2. enable parallel builds (if desired).\n\n3. allow for faster incremental builds. For instance, when a single class\n   definition is changed, only a subset of the binding code will generally need\n   to be recompiled.\n\n\"recursive template instantiation exceeded maximum depth of 256\"\n================================================================\n\nIf you receive an error about excessive recursive template evaluation, try\nspecifying a larger value, e.g. ``-ftemplate-depth=1024`` on GCC/Clang. The\nculprit is generally the generation of function signatures at compile time\nusing C++14 template metaprogramming.\n\n.. _`faq:hidden_visibility`:\n\n\"'SomeClass' declared with greater visibility than the type of its field 'SomeClass::member' [-Wattributes]\"\n============================================================================================================\n\nThis error typically indicates that you are compiling without the required\n``-fvisibility`` flag.  pybind11 code internally forces hidden visibility on\nall internal code, but if non-hidden (and thus *exported*) code attempts to\ninclude a pybind type (for example, ``py::object`` or ``py::list``) you can run\ninto this warning.\n\nTo avoid it, make sure you are specifying ``-fvisibility=hidden`` when\ncompiling pybind code.\n\nAs to why ``-fvisibility=hidden`` is necessary, because pybind modules could\nhave been compiled under different versions of pybind itself, it is also\nimportant that the symbols defined in one module do not clash with the\npotentially-incompatible symbols defined in another.  While Python extension\nmodules are usually loaded with localized symbols (under POSIX systems\ntypically using ``dlopen`` with the ``RTLD_LOCAL`` flag), this Python default\ncan be changed, but even if it isn't it is not always enough to guarantee\ncomplete independence of the symbols involved when not using\n``-fvisibility=hidden``.\n\nAdditionally, ``-fvisibility=hidden`` can deliver considerably binary size\nsavings. (See the following section for more details.)\n\n\n.. _`faq:symhidden`:\n\nHow can I create smaller binaries?\n==================================\n\nTo do its job, pybind11 extensively relies on a programming technique known as\n*template metaprogramming*, which is a way of performing computation at compile\ntime using type information. Template metaprogramming usually instantiates code\ninvolving significant numbers of deeply nested types that are either completely\nremoved or reduced to just a few instructions during the compiler's optimization\nphase. However, due to the nested nature of these types, the resulting symbol\nnames in the compiled extension library can be extremely long. For instance,\nthe included test suite contains the following symbol:\n\n.. only:: html\n\n    .. code-block:: none\n\n        _​_​Z​N​8​p​y​b​i​n​d​1​1​1​2​c​p​p​_​f​u​n​c​t​i​o​n​C​1​I​v​8​E​x​a​m​p​l​e​2​J​R​N​S​t​3​_​_​1​6​v​e​c​t​o​r​I​N​S​3​_​1​2​b​a​s​i​c​_​s​t​r​i​n​g​I​w​N​S​3​_​1​1​c​h​a​r​_​t​r​a​i​t​s​I​w​E​E​N​S​3​_​9​a​l​l​o​c​a​t​o​r​I​w​E​E​E​E​N​S​8​_​I​S​A​_​E​E​E​E​E​J​N​S​_​4​n​a​m​e​E​N​S​_​7​s​i​b​l​i​n​g​E​N​S​_​9​i​s​_​m​e​t​h​o​d​E​A​2​8​_​c​E​E​E​M​T​0​_​F​T​_​D​p​T​1​_​E​D​p​R​K​T​2​_\n\n.. only:: not html\n\n    .. code-block:: cpp\n\n        __ZN8pybind1112cpp_functionC1Iv8Example2JRNSt3__16vectorINS3_12basic_stringIwNS3_11char_traitsIwEENS3_9allocatorIwEEEENS8_ISA_EEEEEJNS_4nameENS_7siblingENS_9is_methodEA28_cEEEMT0_FT_DpT1_EDpRKT2_\n\nwhich is the mangled form of the following function type:\n\n.. code-block:: cpp\n\n    pybind11::cpp_function::cpp_function<void, Example2, std::__1::vector<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >, std::__1::allocator<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > > >&, pybind11::name, pybind11::sibling, pybind11::is_method, char [28]>(void (Example2::*)(std::__1::vector<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >, std::__1::allocator<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > > >&), pybind11::name const&, pybind11::sibling const&, pybind11::is_method const&, char const (&) [28])\n\nThe memory needed to store just the mangled name of this function (196 bytes)\nis larger than the actual piece of code (111 bytes) it represents! On the other\nhand, it's silly to even give this function a name -- after all, it's just a\ntiny cog in a bigger piece of machinery that is not exposed to the outside\nworld. So we'll generally only want to export symbols for those functions which\nare actually called from the outside.\n\nThis can be achieved by specifying the parameter ``-fvisibility=hidden`` to GCC\nand Clang, which sets the default symbol visibility to *hidden*, which has a\ntremendous impact on the final binary size of the resulting extension library.\n(On Visual Studio, symbols are already hidden by default, so nothing needs to\nbe done there.)\n\nIn addition to decreasing binary size, ``-fvisibility=hidden`` also avoids\npotential serious issues when loading multiple modules and is required for\nproper pybind operation.  See the previous FAQ entry for more details.\n\nHow can I properly handle Ctrl-C in long-running functions?\n===========================================================\n\nCtrl-C is received by the Python interpreter, and holds it until the GIL\nis released, so a long-running function won't be interrupted.\n\nTo interrupt from inside your function, you can use the ``PyErr_CheckSignals()``\nfunction, that will tell if a signal has been raised on the Python side.  This\nfunction merely checks a flag, so its impact is negligible. When a signal has\nbeen received, you must either explicitly interrupt execution by throwing\n``py::error_already_set`` (which will propagate the existing\n``KeyboardInterrupt``), or clear the error (which you usually will not want):\n\n.. code-block:: cpp\n\n    PYBIND11_MODULE(example, m)\n    {\n        m.def(\"long running_func\", []()\n        {\n            for (;;) {\n                if (PyErr_CheckSignals() != 0)\n                    throw py::error_already_set();\n                // Long running iteration\n            }\n        });\n    }\n\nCMake doesn't detect the right Python version\n=============================================\n\nThe CMake-based build system will try to automatically detect the installed\nversion of Python and link against that. When this fails, or when there are\nmultiple versions of Python and it finds the wrong one, delete\n``CMakeCache.txt`` and then add ``-DPYTHON_EXECUTABLE=$(which python)`` to your\nCMake configure line. (Replace ``$(which python)`` with a path to python if\nyour prefer.)\n\nYou can alternatively try ``-DPYBIND11_FINDPYTHON=ON``, which will activate the\nnew CMake FindPython support instead of pybind11's custom search. Requires\nCMake 3.12+, and 3.15+ or 3.18.2+ are even better. You can set this in your\n``CMakeLists.txt`` before adding or finding pybind11, as well.\n\nInconsistent detection of Python version in CMake and pybind11\n==============================================================\n\nThe functions ``find_package(PythonInterp)`` and ``find_package(PythonLibs)``\nprovided by CMake for Python version detection are modified by pybind11 due to\nunreliability and limitations that make them unsuitable for pybind11's needs.\nInstead pybind11 provides its own, more reliable Python detection CMake code.\nConflicts can arise, however, when using pybind11 in a project that *also* uses\nthe CMake Python detection in a system with several Python versions installed.\n\nThis difference may cause inconsistencies and errors if *both* mechanisms are\nused in the same project.\n\nThere are three possible solutions:\n\n1. Avoid using ``find_package(PythonInterp)`` and ``find_package(PythonLibs)``\n   from CMake and rely on pybind11 in detecting Python version. If this is not\n   possible, the CMake machinery should be called *before* including pybind11.\n2. Set ``PYBIND11_FINDPYTHON`` to ``True`` or use ``find_package(Python\n   COMPONENTS Interpreter Development)`` on modern CMake (3.12+, 3.15+ better,\n   3.18.2+ best). Pybind11 in these cases uses the new CMake FindPython instead\n   of the old, deprecated search tools, and these modules are much better at\n   finding the correct Python.\n3. Set ``PYBIND11_NOPYTHON`` to ``TRUE``. Pybind11 will not search for Python.\n   However, you will have to use the target-based system, and do more setup\n   yourself, because it does not know about or include things that depend on\n   Python, like ``pybind11_add_module``. This might be ideal for integrating\n   into an existing system, like scikit-build's Python helpers.\n\nHow to cite this project?\n=========================\n\nWe suggest the following BibTeX template to cite pybind11 in scientific\ndiscourse:\n\n.. code-block:: bash\n\n    @misc{pybind11,\n       author = {Wenzel Jakob and Jason Rhinelander and Dean Moldovan},\n       year = {2017},\n       note = {https://github.com/pybind/pybind11},\n       title = {pybind11 -- Seamless operability between C++11 and Python}\n    }\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/index.rst",
    "content": ".. only:: latex\n\n   Intro\n   =====\n\n.. include:: readme.rst\n\n.. only:: not latex\n\n    Contents:\n\n.. toctree::\n   :maxdepth: 1\n\n   changelog\n   upgrade\n\n.. toctree::\n   :caption: The Basics\n   :maxdepth: 2\n\n   installing\n   basics\n   classes\n   compiling\n\n.. toctree::\n   :caption: Advanced Topics\n   :maxdepth: 2\n\n   advanced/functions\n   advanced/classes\n   advanced/exceptions\n   advanced/smart_ptrs\n   advanced/cast/index\n   advanced/pycpp/index\n   advanced/embedding\n   advanced/misc\n\n.. toctree::\n   :caption: Extra Information\n   :maxdepth: 1\n\n   faq\n   benchmark\n   limitations\n   reference\n   cmake/index\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/installing.rst",
    "content": ".. _installing:\n\nInstalling the library\n######################\n\nThere are several ways to get the pybind11 source, which lives at\n`pybind/pybind11 on GitHub <https://github.com/pybind/pybind11>`_. The pybind11\ndevelopers recommend one of the first three ways listed here, submodule, PyPI,\nor conda-forge, for obtaining pybind11.\n\n.. _include_as_a_submodule:\n\nInclude as a submodule\n======================\n\nWhen you are working on a project in Git, you can use the pybind11 repository\nas a submodule. From your git repository, use:\n\n.. code-block:: bash\n\n    git submodule add -b stable ../../pybind/pybind11 extern/pybind11\n    git submodule update --init\n\nThis assumes you are placing your dependencies in ``extern/``, and that you are\nusing GitHub; if you are not using GitHub, use the full https or ssh URL\ninstead of the relative URL ``../../pybind/pybind11`` above. Some other servers\nalso require the ``.git`` extension (GitHub does not).\n\nFrom here, you can now include ``extern/pybind11/include``, or you can use\nthe various integration tools (see :ref:`compiling`) pybind11 provides directly\nfrom the local folder.\n\nInclude with PyPI\n=================\n\nYou can download the sources and CMake files as a Python package from PyPI\nusing Pip. Just use:\n\n.. code-block:: bash\n\n    pip install pybind11\n\nThis will provide pybind11 in a standard Python package format. If you want\npybind11 available directly in your environment root, you can use:\n\n.. code-block:: bash\n\n    pip install \"pybind11[global]\"\n\nThis is not recommended if you are installing with your system Python, as it\nwill add files to ``/usr/local/include/pybind11`` and\n``/usr/local/share/cmake/pybind11``, so unless that is what you want, it is\nrecommended only for use in virtual environments or your ``pyproject.toml``\nfile (see :ref:`compiling`).\n\nInclude with conda-forge\n========================\n\nYou can use pybind11 with conda packaging via `conda-forge\n<https://github.com/conda-forge/pybind11-feedstock>`_:\n\n.. code-block:: bash\n\n    conda install -c conda-forge pybind11\n\n\nInclude with vcpkg\n==================\nYou can download and install pybind11 using the Microsoft `vcpkg\n<https://github.com/Microsoft/vcpkg/>`_ dependency manager:\n\n.. code-block:: bash\n\n    git clone https://github.com/Microsoft/vcpkg.git\n    cd vcpkg\n    ./bootstrap-vcpkg.sh\n    ./vcpkg integrate install\n    vcpkg install pybind11\n\nThe pybind11 port in vcpkg is kept up to date by Microsoft team members and\ncommunity contributors. If the version is out of date, please `create an issue\nor pull request <https://github.com/Microsoft/vcpkg/>`_ on the vcpkg\nrepository.\n\nGlobal install with brew\n========================\n\nThe brew package manager (Homebrew on macOS, or Linuxbrew on Linux) has a\n`pybind11 package\n<https://github.com/Homebrew/homebrew-core/blob/master/Formula/pybind11.rb>`_.\nTo install:\n\n.. code-block:: bash\n\n    brew install pybind11\n\n.. We should list Conan, and possibly a few other C++ package managers (hunter,\n.. perhaps). Conan has a very clean CMake integration that would be good to show.\n\nOther options\n=============\n\nOther locations you can find pybind11 are `listed here\n<https://repology.org/project/python:pybind11/versions>`_; these are maintained\nby various packagers and the community.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/limitations.rst",
    "content": "Limitations\n###########\n\nDesign choices\n^^^^^^^^^^^^^^\n\npybind11 strives to be a general solution to binding generation, but it also has\ncertain limitations:\n\n- pybind11 casts away ``const``-ness in function arguments and return values.\n  This is in line with the Python language, which has no concept of ``const``\n  values. This means that some additional care is needed to avoid bugs that\n  would be caught by the type checker in a traditional C++ program.\n\n- The NumPy interface ``pybind11::array`` greatly simplifies accessing\n  numerical data from C++ (and vice versa), but it's not a full-blown array\n  class like ``Eigen::Array`` or ``boost.multi_array``. ``Eigen`` objects are\n  directly supported, however, with ``pybind11/eigen.h``.\n\nLarge but useful features could be implemented in pybind11 but would lead to a\nsignificant increase in complexity. Pybind11 strives to be simple and compact.\nUsers who require large new features are encouraged to write an extension to\npybind11; see `pybind11_json <https://github.com/pybind/pybind11_json>`_ for an\nexample.\n\n\nKnown bugs\n^^^^^^^^^^\n\nThese are issues that hopefully will one day be fixed, but currently are\nunsolved. If you know how to help with one of these issues, contributions\nare welcome!\n\n- Intel 20.2 is currently having an issue with the test suite.\n  `#2573 <https://github.com/pybind/pybind11/pull/2573>`_\n\n- Debug mode Python does not support 1-5 tests in the test suite currently.\n  `#2422 <https://github.com/pybind/pybind11/pull/2422>`_\n\n- PyPy3 7.3.1 and 7.3.2 have issues with several tests on 32-bit Windows.\n\nKnown limitations\n^^^^^^^^^^^^^^^^^\n\nThese are issues that are probably solvable, but have not been fixed yet. A\nclean, well written patch would likely be accepted to solve them.\n\n- Type casters are not kept alive recursively.\n  `#2527 <https://github.com/pybind/pybind11/issues/2527>`_\n  One consequence is that containers of ``char *`` are currently not supported.\n  `#2245 <https://github.com/pybind/pybind11/issues/2245>`_\n\n- The ``cpptest`` does not run on Windows with Python 3.8 or newer, due to DLL\n  loader changes. User code that is correctly installed should not be affected.\n  `#2560 <https://github.com/pybind/pybind11/issue/2560>`_\n\nPython 3.9.0 warning\n^^^^^^^^^^^^^^^^^^^^\n\nCombining older versions of pybind11 (< 2.6.0) with Python on exactly 3.9.0\nwill trigger undefined behavior that typically manifests as crashes during\ninterpreter shutdown (but could also destroy your data. **You have been\nwarned**).\n\nThis issue was `fixed in Python <https://github.com/python/cpython/pull/22670>`_.\nAs a mitigation for this bug, pybind11 2.6.0 or newer includes a workaround\nspecifically when Python 3.9.0 is detected at runtime, leaking about 50 bytes\nof memory when a callback function is garbage collected.  For reference, the\npybind11 test suite has about 2,000 such callbacks, but only 49 are garbage\ncollected before the end-of-process. Wheels (even if built with Python 3.9.0)\nwill correctly avoid the leak when run in Python 3.9.1, and this does not\naffect other 3.X versions.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/reference.rst",
    "content": ".. _reference:\n\n.. warning::\n\n    Please be advised that the reference documentation discussing pybind11\n    internals is currently incomplete. Please refer to the previous sections\n    and the pybind11 header files for the nitty gritty details.\n\nReference\n#########\n\n.. _macros:\n\nMacros\n======\n\n.. doxygendefine:: PYBIND11_MODULE\n\n.. _core_types:\n\nConvenience classes for arbitrary Python types\n==============================================\n\nCommon member functions\n-----------------------\n\n.. doxygenclass:: object_api\n    :members:\n\nWithout reference counting\n--------------------------\n\n.. doxygenclass:: handle\n    :members:\n\nWith reference counting\n-----------------------\n\n.. doxygenclass:: object\n    :members:\n\n.. doxygenfunction:: reinterpret_borrow\n\n.. doxygenfunction:: reinterpret_steal\n\nConvenience classes for specific Python types\n=============================================\n\n.. doxygenclass:: module_\n    :members:\n\n.. doxygengroup:: pytypes\n    :members:\n\nConvenience functions converting to Python types\n================================================\n\n.. doxygenfunction:: make_tuple(Args&&...)\n\n.. doxygenfunction:: make_iterator(Iterator, Sentinel, Extra &&...)\n.. doxygenfunction:: make_iterator(Type &, Extra&&...)\n\n.. doxygenfunction:: make_key_iterator(Iterator, Sentinel, Extra &&...)\n.. doxygenfunction:: make_key_iterator(Type &, Extra&&...)\n\n.. doxygenfunction:: make_value_iterator(Iterator, Sentinel, Extra &&...)\n.. doxygenfunction:: make_value_iterator(Type &, Extra&&...)\n\n.. _extras:\n\nPassing extra arguments to ``def`` or ``class_``\n================================================\n\n.. doxygengroup:: annotations\n    :members:\n\nEmbedding the interpreter\n=========================\n\n.. doxygendefine:: PYBIND11_EMBEDDED_MODULE\n\n.. doxygenfunction:: initialize_interpreter\n\n.. doxygenfunction:: finalize_interpreter\n\n.. doxygenclass:: scoped_interpreter\n\nRedirecting C++ streams\n=======================\n\n.. doxygenclass:: scoped_ostream_redirect\n\n.. doxygenclass:: scoped_estream_redirect\n\n.. doxygenfunction:: add_ostream_redirect\n\nPython built-in functions\n=========================\n\n.. doxygengroup:: python_builtins\n    :members:\n\nInheritance\n===========\n\nSee :doc:`/classes` and :doc:`/advanced/classes` for more detail.\n\n.. doxygendefine:: PYBIND11_OVERRIDE\n\n.. doxygendefine:: PYBIND11_OVERRIDE_PURE\n\n.. doxygendefine:: PYBIND11_OVERRIDE_NAME\n\n.. doxygendefine:: PYBIND11_OVERRIDE_PURE_NAME\n\n.. doxygenfunction:: get_override\n\nExceptions\n==========\n\n.. doxygenclass:: error_already_set\n    :members:\n\n.. doxygenclass:: builtin_exception\n    :members:\n\nLiterals\n========\n\n.. doxygennamespace:: literals\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/release.rst",
    "content": "On version numbers\n^^^^^^^^^^^^^^^^^^\n\nThe two version numbers (C++ and Python) must match when combined (checked when\nyou build the PyPI package), and must be a valid `PEP 440\n<https://www.python.org/dev/peps/pep-0440>`_ version when combined.\n\nFor example:\n\n.. code-block:: C++\n\n    #define PYBIND11_VERSION_MAJOR X\n    #define PYBIND11_VERSION_MINOR Y\n    #define PYBIND11_VERSION_PATCH Z.dev1\n\nFor beta, ``PYBIND11_VERSION_PATCH`` should be ``Z.b1``. RC's can be ``Z.rc1``.\nAlways include the dot (even though PEP 440 allows it to be dropped). For a\nfinal release, this must be a simple integer. There is also a HEX version of\nthe version just below.\n\n\nTo release a new version of pybind11:\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nIf you don't have nox, you should either use ``pipx run nox`` instead, or use\n``pipx install nox`` or ``brew install nox`` (Unix).\n\n- Update the version number\n    - Update ``PYBIND11_VERSION_MAJOR`` etc. in\n      ``include/pybind11/detail/common.h``. PATCH should be a simple integer.\n    - Update the version HEX just below, as well.\n    - Update ``pybind11/_version.py`` (match above)\n    - Run ``nox -s tests_packaging`` to ensure this was done correctly.\n    - Ensure that all the information in ``setup.cfg`` is up-to-date, like\n      supported Python versions.\n    - Add release date in ``docs/changelog.rst``.\n          - Check to make sure\n            `needs-changelog <https://github.com/pybind/pybind11/pulls?q=is%3Apr+is%3Aclosed+label%3A%22needs+changelog%22>`_\n            issues are entered in the changelog (clear the label when done).\n    - ``git add`` and ``git commit``, ``git push``. **Ensure CI passes**. (If it\n      fails due to a known flake issue, either ignore or restart CI.)\n- Add a release branch if this is a new minor version, or update the existing release branch if it is a patch version\n    - New branch: ``git checkout -b vX.Y``, ``git push -u origin vX.Y``\n    - Update branch: ``git checkout vX.Y``, ``git merge <release branch>``, ``git push``\n- Update tags (optional; if you skip this, the GitHub release makes a\n    non-annotated tag for you)\n    - ``git tag -a vX.Y.Z -m 'vX.Y.Z release'``.\n    - ``git push --tags``.\n- Update stable\n    - ``git checkout stable``\n    - ``git merge master``\n    - ``git push``\n- Make a GitHub release (this shows up in the UI, sends new release\n  notifications to users watching releases, and also uploads PyPI packages).\n  (Note: if you do not use an existing tag, this creates a new lightweight tag\n  for you, so you could skip the above step.)\n    - GUI method: Under `releases <https://github.com/pybind/pybind11/releases>`_\n      click \"Draft a new release\" on the far right, fill in the tag name\n      (if you didn't tag above, it will be made here), fill in a release name\n      like \"Version X.Y.Z\", and copy-and-paste the markdown-formatted (!) changelog\n      into the description (usually ``cat docs/changelog.rst | pandoc -f rst -t gfm``).\n      Check \"pre-release\" if this is a beta/RC.\n    - CLI method: with ``gh`` installed, run ``gh release create vX.Y.Z -t \"Version X.Y.Z\"``\n      If this is a pre-release, add ``-p``.\n\n- Get back to work\n    - Make sure you are on master, not somewhere else: ``git checkout master``\n    - Update version macros in ``include/pybind11/detail/common.h`` (set PATCH to\n      ``0.dev1`` and increment MINOR).\n    - Update ``_version.py`` to match\n    - Run ``nox -s tests_packaging`` to ensure this was done correctly.\n    - Add a spot for in-development updates in ``docs/changelog.rst``.\n    - ``git add``, ``git commit``, ``git push``\n\nIf a version branch is updated, remember to set PATCH to ``1.dev1``.\n\nIf you'd like to bump homebrew, run:\n\n.. code-block:: console\n\n    brew bump-formula-pr --url https://github.com/pybind/pybind11/archive/vX.Y.Z.tar.gz\n\nConda-forge should automatically make a PR in a few hours, and automatically\nmerge it if there are no issues.\n\n\nManual packaging\n^^^^^^^^^^^^^^^^\n\nIf you need to manually upload releases, you can download the releases from the job artifacts and upload them with twine. You can also make the files locally (not recommended in general, as your local directory is more likely to be \"dirty\" and SDists love picking up random unrelated/hidden files); this is the procedure:\n\n.. code-block:: bash\n\n    nox -s build\n    twine upload dist/*\n\nThis makes SDists and wheels, and the final line uploads them.\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/requirements.txt",
    "content": "breathe==4.34.0\nfuro==2022.6.21\nsphinx==5.0.2\nsphinx-copybutton==0.5.0\nsphinxcontrib-moderncmakedomain==3.21.4\nsphinxcontrib-svg2pdfconverter==1.2.0\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/docs/upgrade.rst",
    "content": "Upgrade guide\n#############\n\nThis is a companion guide to the :doc:`changelog`. While the changelog briefly\nlists all of the new features, improvements and bug fixes, this upgrade guide\nfocuses only the subset which directly impacts your experience when upgrading\nto a new version. But it goes into more detail. This includes things like\ndeprecated APIs and their replacements, build system changes, general code\nmodernization and other useful information.\n\n.. _upgrade-guide-2.9:\n\nv2.9\n====\n\n* Any usage of the recently added ``py::make_simple_namespace`` should be\n  converted to using ``py::module_::import(\"types\").attr(\"SimpleNamespace\")``\n  instead.\n\n* The use of ``_`` in custom type casters can now be replaced with the more\n  readable ``const_name`` instead. The old ``_`` shortcut has been retained\n  unless it is being used as a macro (like for gettext).\n\n\n.. _upgrade-guide-2.7:\n\nv2.7\n====\n\n*Before* v2.7, ``py::str`` can hold ``PyUnicodeObject`` or ``PyBytesObject``,\nand ``py::isinstance<str>()`` is ``true`` for both ``py::str`` and\n``py::bytes``. Starting with v2.7, ``py::str`` exclusively holds\n``PyUnicodeObject`` (`#2409 <https://github.com/pybind/pybind11/pull/2409>`_),\nand ``py::isinstance<str>()`` is ``true`` only for ``py::str``. To help in\nthe transition of user code, the ``PYBIND11_STR_LEGACY_PERMISSIVE`` macro\nis provided as an escape hatch to go back to the legacy behavior. This macro\nwill be removed in future releases. Two types of required fixes are expected\nto be common:\n\n* Accidental use of ``py::str`` instead of ``py::bytes``, masked by the legacy\n  behavior. These are probably very easy to fix, by changing from\n  ``py::str`` to ``py::bytes``.\n\n* Reliance on py::isinstance<str>(obj) being ``true`` for\n  ``py::bytes``. This is likely to be easy to fix in most cases by adding\n  ``|| py::isinstance<bytes>(obj)``, but a fix may be more involved, e.g. if\n  ``py::isinstance<T>`` appears in a template. Such situations will require\n  careful review and custom fixes.\n\n\n.. _upgrade-guide-2.6:\n\nv2.6\n====\n\nUsage of the ``PYBIND11_OVERLOAD*`` macros and ``get_overload`` function should\nbe replaced by ``PYBIND11_OVERRIDE*`` and ``get_override``. In the future, the\nold macros may be deprecated and removed.\n\n``py::module`` has been renamed ``py::module_``, but a backward compatible\ntypedef has been included. This change was to avoid a language change in C++20\nthat requires unqualified ``module`` not be placed at the start of a logical\nline. Qualified usage is unaffected and the typedef will remain unless the\nC++ language rules change again.\n\nThe public constructors of ``py::module_`` have been deprecated. Use\n``PYBIND11_MODULE`` or ``module_::create_extension_module`` instead.\n\nAn error is now thrown when ``__init__`` is forgotten on subclasses. This was\nincorrect before, but was not checked. Add a call to ``__init__`` if it is\nmissing.\n\nA ``py::type_error`` is now thrown when casting to a subclass (like\n``py::bytes`` from ``py::object``) if the conversion is not valid. Make a valid\nconversion instead.\n\nThe undocumented ``h.get_type()`` method has been deprecated and replaced by\n``py::type::of(h)``.\n\nEnums now have a ``__str__`` method pre-defined; if you want to override it,\nthe simplest fix is to add the new ``py::prepend()`` tag when defining\n``\"__str__\"``.\n\nIf ``__eq__`` defined but not ``__hash__``, ``__hash__`` is now set to\n``None``, as in normal CPython. You should add ``__hash__`` if you intended the\nclass to be hashable, possibly using the new ``py::hash`` shortcut.\n\nThe constructors for ``py::array`` now always take signed integers for size,\nfor consistency. This may lead to compiler warnings on some systems. Cast to\n``py::ssize_t`` instead of ``std::size_t``.\n\nThe ``tools/clang`` submodule and ``tools/mkdoc.py`` have been moved to a\nstandalone package, `pybind11-mkdoc`_. If you were using those tools, please\nuse them via a pip install from the new location.\n\nThe ``pybind11`` package on PyPI no longer fills the wheel \"headers\" slot - if\nyou were using the headers from this slot, they are available by requesting the\n``global`` extra, that is, ``pip install \"pybind11[global]\"``. (Most users will\nbe unaffected, as the ``pybind11/include`` location is reported by ``python -m\npybind11 --includes`` and ``pybind11.get_include()`` is still correct and has\nnot changed since 2.5).\n\n.. _pybind11-mkdoc: https://github.com/pybind/pybind11-mkdoc\n\nCMake support:\n--------------\n\nThe minimum required version of CMake is now 3.4.  Several details of the CMake\nsupport have been deprecated; warnings will be shown if you need to change\nsomething. The changes are:\n\n* ``PYBIND11_CPP_STANDARD=<platform-flag>`` is deprecated, please use\n  ``CMAKE_CXX_STANDARD=<number>`` instead, or any other valid CMake CXX or CUDA\n  standard selection method, like ``target_compile_features``.\n\n* If you do not request a standard, pybind11 targets will compile with the\n  compiler default, but not less than C++11, instead of forcing C++14 always.\n  If you depend on the old behavior, please use ``set(CMAKE_CXX_STANDARD 14 CACHE STRING \"\")``\n  instead.\n\n* Direct ``pybind11::module`` usage should always be accompanied by at least\n  ``set(CMAKE_CXX_VISIBILITY_PRESET hidden)`` or similar - it used to try to\n  manually force this compiler flag (but not correctly on all compilers or with\n  CUDA).\n\n* ``pybind11_add_module``'s ``SYSTEM`` argument is deprecated and does nothing;\n  linking now behaves like other imported libraries consistently in both\n  config and submodule mode, and behaves like a ``SYSTEM`` library by\n  default.\n\n* If ``PYTHON_EXECUTABLE`` is not set, virtual environments (``venv``,\n  ``virtualenv``, and ``conda``) are prioritized over the standard search\n  (similar to the new FindPython mode).\n\nIn addition, the following changes may be of interest:\n\n* ``CMAKE_INTERPROCEDURAL_OPTIMIZATION`` will be respected by\n  ``pybind11_add_module`` if set instead of linking to ``pybind11::lto`` or\n  ``pybind11::thin_lto``.\n\n* Using ``find_package(Python COMPONENTS Interpreter Development)`` before\n  pybind11 will cause pybind11 to use the new Python mechanisms instead of its\n  own custom search, based on a patched version of classic ``FindPythonInterp``\n  / ``FindPythonLibs``. In the future, this may become the default. A recent\n  (3.15+ or 3.18.2+) version of CMake is recommended.\n\n\n\nv2.5\n====\n\nThe Python package now includes the headers as data in the package itself, as\nwell as in the \"headers\" wheel slot. ``pybind11 --includes`` and\n``pybind11.get_include()`` report the new location, which is always correct\nregardless of how pybind11 was installed, making the old ``user=`` argument\nmeaningless. If you are not using the function to get the location already, you\nare encouraged to switch to the package location.\n\n\nv2.2\n====\n\nDeprecation of the ``PYBIND11_PLUGIN`` macro\n--------------------------------------------\n\n``PYBIND11_MODULE`` is now the preferred way to create module entry points.\nThe old macro emits a compile-time deprecation warning.\n\n.. code-block:: cpp\n\n    // old\n    PYBIND11_PLUGIN(example) {\n        py::module m(\"example\", \"documentation string\");\n\n        m.def(\"add\", [](int a, int b) { return a + b; });\n\n        return m.ptr();\n    }\n\n    // new\n    PYBIND11_MODULE(example, m) {\n        m.doc() = \"documentation string\"; // optional\n\n        m.def(\"add\", [](int a, int b) { return a + b; });\n    }\n\n\nNew API for defining custom constructors and pickling functions\n---------------------------------------------------------------\n\nThe old placement-new custom constructors have been deprecated. The new approach\nuses ``py::init()`` and factory functions to greatly improve type safety.\n\nPlacement-new can be called accidentally with an incompatible type (without any\ncompiler errors or warnings), or it can initialize the same object multiple times\nif not careful with the Python-side ``__init__`` calls. The new-style custom\nconstructors prevent such mistakes. See :ref:`custom_constructors` for details.\n\n.. code-block:: cpp\n\n    // old -- deprecated (runtime warning shown only in debug mode)\n    py::class<Foo>(m, \"Foo\")\n        .def(\"__init__\", [](Foo &self, ...) {\n            new (&self) Foo(...); // uses placement-new\n        });\n\n    // new\n    py::class<Foo>(m, \"Foo\")\n        .def(py::init([](...) { // Note: no `self` argument\n            return new Foo(...); // return by raw pointer\n            // or: return std::make_unique<Foo>(...); // return by holder\n            // or: return Foo(...); // return by value (move constructor)\n        }));\n\nMirroring the custom constructor changes, ``py::pickle()`` is now the preferred\nway to get and set object state. See :ref:`pickling` for details.\n\n.. code-block:: cpp\n\n    // old -- deprecated (runtime warning shown only in debug mode)\n    py::class<Foo>(m, \"Foo\")\n        ...\n        .def(\"__getstate__\", [](const Foo &self) {\n            return py::make_tuple(self.value1(), self.value2(), ...);\n        })\n        .def(\"__setstate__\", [](Foo &self, py::tuple t) {\n            new (&self) Foo(t[0].cast<std::string>(), ...);\n        });\n\n    // new\n    py::class<Foo>(m, \"Foo\")\n        ...\n        .def(py::pickle(\n            [](const Foo &self) { // __getstate__\n                return py::make_tuple(self.value1(), self.value2(), ...); // unchanged\n            },\n            [](py::tuple t) { // __setstate__, note: no `self` argument\n                return new Foo(t[0].cast<std::string>(), ...);\n                // or: return std::make_unique<Foo>(...); // return by holder\n                // or: return Foo(...); // return by value (move constructor)\n            }\n        ));\n\nFor both the constructors and pickling, warnings are shown at module\ninitialization time (on import, not when the functions are called).\nThey're only visible when compiled in debug mode. Sample warning:\n\n.. code-block:: none\n\n    pybind11-bound class 'mymodule.Foo' is using an old-style placement-new '__init__'\n    which has been deprecated. See the upgrade guide in pybind11's docs.\n\n\nStricter enforcement of hidden symbol visibility for pybind11 modules\n---------------------------------------------------------------------\n\npybind11 now tries to actively enforce hidden symbol visibility for modules.\nIf you're using either one of pybind11's :doc:`CMake or Python build systems\n<compiling>` (the two example repositories) and you haven't been exporting any\nsymbols, there's nothing to be concerned about. All the changes have been done\ntransparently in the background. If you were building manually or relied on\nspecific default visibility, read on.\n\nSetting default symbol visibility to *hidden* has always been recommended for\npybind11 (see :ref:`faq:symhidden`). On Linux and macOS, hidden symbol\nvisibility (in conjunction with the ``strip`` utility) yields much smaller\nmodule binaries. `CPython's extension docs`_ also recommend hiding symbols\nby default, with the goal of avoiding symbol name clashes between modules.\nStarting with v2.2, pybind11 enforces this more strictly: (1) by declaring\nall symbols inside the ``pybind11`` namespace as hidden and (2) by including\nthe ``-fvisibility=hidden`` flag on Linux and macOS (only for extension\nmodules, not for embedding the interpreter).\n\n.. _CPython's extension docs: https://docs.python.org/3/extending/extending.html#providing-a-c-api-for-an-extension-module\n\nThe namespace-scope hidden visibility is done automatically in pybind11's\nheaders and it's generally transparent to users. It ensures that:\n\n* Modules compiled with different pybind11 versions don't clash with each other.\n\n* Some new features, like ``py::module_local`` bindings, can work as intended.\n\nThe ``-fvisibility=hidden`` flag applies the same visibility to user bindings\noutside of the ``pybind11`` namespace. It's now set automatic by pybind11's\nCMake and Python build systems, but this needs to be done manually by users\nof other build systems. Adding this flag:\n\n* Minimizes the chances of symbol conflicts between modules. E.g. if two\n  unrelated modules were statically linked to different (ABI-incompatible)\n  versions of the same third-party library, a symbol clash would be likely\n  (and would end with unpredictable results).\n\n* Produces smaller binaries on Linux and macOS, as pointed out previously.\n\nWithin pybind11's CMake build system, ``pybind11_add_module`` has always been\nsetting the ``-fvisibility=hidden`` flag in release mode. From now on, it's\nbeing applied unconditionally, even in debug mode and it can no longer be opted\nout of with the ``NO_EXTRAS`` option. The ``pybind11::module`` target now also\nadds this flag to its interface. The ``pybind11::embed`` target is unchanged.\n\nThe most significant change here is for the ``pybind11::module`` target. If you\nwere previously relying on default visibility, i.e. if your Python module was\ndoubling as a shared library with dependents, you'll need to either export\nsymbols manually (recommended for cross-platform libraries) or factor out the\nshared library (and have the Python module link to it like the other\ndependents). As a temporary workaround, you can also restore default visibility\nusing the CMake code below, but this is not recommended in the long run:\n\n.. code-block:: cmake\n\n    target_link_libraries(mymodule PRIVATE pybind11::module)\n\n    add_library(restore_default_visibility INTERFACE)\n    target_compile_options(restore_default_visibility INTERFACE -fvisibility=default)\n    target_link_libraries(mymodule PRIVATE restore_default_visibility)\n\n\nLocal STL container bindings\n----------------------------\n\nPrevious pybind11 versions could only bind types globally -- all pybind11\nmodules, even unrelated ones, would have access to the same exported types.\nHowever, this would also result in a conflict if two modules exported the\nsame C++ type, which is especially problematic for very common types, e.g.\n``std::vector<int>``. :ref:`module_local` were added to resolve this (see\nthat section for a complete usage guide).\n\n``py::class_`` still defaults to global bindings (because these types are\nusually unique across modules), however in order to avoid clashes of opaque\ntypes, ``py::bind_vector`` and ``py::bind_map`` will now bind STL containers\nas ``py::module_local`` if their elements are: builtins (``int``, ``float``,\netc.), not bound using ``py::class_``, or bound as ``py::module_local``. For\nexample, this change allows multiple modules to bind ``std::vector<int>``\nwithout causing conflicts. See :ref:`stl_bind` for more details.\n\nWhen upgrading to this version, if you have multiple modules which depend on\na single global binding of an STL container, note that all modules can still\naccept foreign  ``py::module_local`` types in the direction of Python-to-C++.\nThe locality only affects the C++-to-Python direction. If this is needed in\nmultiple modules, you'll need to either:\n\n* Add a copy of the same STL binding to all of the modules which need it.\n\n* Restore the global status of that single binding by marking it\n  ``py::module_local(false)``.\n\nThe latter is an easy workaround, but in the long run it would be best to\nlocalize all common type bindings in order to avoid conflicts with\nthird-party modules.\n\n\nNegative strides for Python buffer objects and numpy arrays\n-----------------------------------------------------------\n\nSupport for negative strides required changing the integer type from unsigned\nto signed in the interfaces of ``py::buffer_info`` and ``py::array``. If you\nhave compiler warnings enabled, you may notice some new conversion warnings\nafter upgrading. These can be resolved using ``static_cast``.\n\n\nDeprecation of some ``py::object`` APIs\n---------------------------------------\n\nTo compare ``py::object`` instances by pointer, you should now use\n``obj1.is(obj2)`` which is equivalent to ``obj1 is obj2`` in Python.\nPreviously, pybind11 used ``operator==`` for this (``obj1 == obj2``), but\nthat could be confusing and is now deprecated (so that it can eventually\nbe replaced with proper rich object comparison in a future release).\n\nFor classes which inherit from ``py::object``, ``borrowed`` and ``stolen``\nwere previously available as protected constructor tags. Now the types\nshould be used directly instead: ``borrowed_t{}`` and ``stolen_t{}``\n(`#771 <https://github.com/pybind/pybind11/pull/771>`_).\n\n\nStricter compile-time error checking\n------------------------------------\n\nSome error checks have been moved from run time to compile time. Notably,\nautomatic conversion of ``std::shared_ptr<T>`` is not possible when ``T`` is\nnot directly registered with ``py::class_<T>`` (e.g. ``std::shared_ptr<int>``\nor ``std::shared_ptr<std::vector<T>>`` are not automatically convertible).\nAttempting to bind a function with such arguments now results in a compile-time\nerror instead of waiting to fail at run time.\n\n``py::init<...>()`` constructor definitions are also stricter and now prevent\nbindings which could cause unexpected behavior:\n\n.. code-block:: cpp\n\n    struct Example {\n        Example(int &);\n    };\n\n    py::class_<Example>(m, \"Example\")\n        .def(py::init<int &>()); // OK, exact match\n        // .def(py::init<int>()); // compile-time error, mismatch\n\nA non-``const`` lvalue reference is not allowed to bind to an rvalue. However,\nnote that a constructor taking ``const T &`` can still be registered using\n``py::init<T>()`` because a ``const`` lvalue reference can bind to an rvalue.\n\nv2.1\n====\n\nMinimum compiler versions are enforced at compile time\n------------------------------------------------------\n\nThe minimums also apply to v2.0 but the check is now explicit and a compile-time\nerror is raised if the compiler does not meet the requirements:\n\n* GCC >= 4.8\n* clang >= 3.3 (appleclang >= 5.0)\n* MSVC >= 2015u3\n* Intel C++ >= 15.0\n\n\nThe ``py::metaclass`` attribute is not required for static properties\n---------------------------------------------------------------------\n\nBinding classes with static properties is now possible by default. The\nzero-parameter version of ``py::metaclass()`` is deprecated. However, a new\none-parameter ``py::metaclass(python_type)`` version was added for rare\ncases when a custom metaclass is needed to override pybind11's default.\n\n.. code-block:: cpp\n\n    // old -- emits a deprecation warning\n    py::class_<Foo>(m, \"Foo\", py::metaclass())\n        .def_property_readonly_static(\"foo\", ...);\n\n    // new -- static properties work without the attribute\n    py::class_<Foo>(m, \"Foo\")\n        .def_property_readonly_static(\"foo\", ...);\n\n    // new -- advanced feature, override pybind11's default metaclass\n    py::class_<Bar>(m, \"Bar\", py::metaclass(custom_python_type))\n        ...\n\n\nv2.0\n====\n\nBreaking changes in ``py::class_``\n----------------------------------\n\nThese changes were necessary to make type definitions in pybind11\nfuture-proof, to support PyPy via its ``cpyext`` mechanism (`#527\n<https://github.com/pybind/pybind11/pull/527>`_), and to improve efficiency\n(`rev. 86d825 <https://github.com/pybind/pybind11/commit/86d825>`_).\n\n1. Declarations of types that provide access via the buffer protocol must\n   now include the ``py::buffer_protocol()`` annotation as an argument to\n   the ``py::class_`` constructor.\n\n   .. code-block:: cpp\n\n       py::class_<Matrix>(\"Matrix\", py::buffer_protocol())\n           .def(py::init<...>())\n           .def_buffer(...);\n\n2. Classes which include static properties (e.g. ``def_readwrite_static()``)\n   must now include the ``py::metaclass()`` attribute. Note: this requirement\n   has since been removed in v2.1. If you're upgrading from 1.x, it's\n   recommended to skip directly to v2.1 or newer.\n\n3. This version of pybind11 uses a redesigned mechanism for instantiating\n   trampoline classes that are used to override virtual methods from within\n   Python. This led to the following user-visible syntax change:\n\n   .. code-block:: cpp\n\n       // old v1.x syntax\n       py::class_<TrampolineClass>(\"MyClass\")\n           .alias<MyClass>()\n           ...\n\n       // new v2.x syntax\n       py::class_<MyClass, TrampolineClass>(\"MyClass\")\n           ...\n\n   Importantly, both the original and the trampoline class are now specified\n   as arguments to the ``py::class_`` template, and the ``alias<..>()`` call\n   is gone. The new scheme has zero overhead in cases when Python doesn't\n   override any functions of the underlying C++ class.\n   `rev. 86d825 <https://github.com/pybind/pybind11/commit/86d825>`_.\n\n   The class type must be the first template argument given to ``py::class_``\n   while the trampoline can be mixed in arbitrary order with other arguments\n   (see the following section).\n\n\nDeprecation of the ``py::base<T>()`` attribute\n----------------------------------------------\n\n``py::base<T>()`` was deprecated in favor of specifying ``T`` as a template\nargument to ``py::class_``. This new syntax also supports multiple inheritance.\nNote that, while the type being exported must be the first argument in the\n``py::class_<Class, ...>`` template, the order of the following types (bases,\nholder and/or trampoline) is not important.\n\n.. code-block:: cpp\n\n    // old v1.x\n    py::class_<Derived>(\"Derived\", py::base<Base>());\n\n    // new v2.x\n    py::class_<Derived, Base>(\"Derived\");\n\n    // new -- multiple inheritance\n    py::class_<Derived, Base1, Base2>(\"Derived\");\n\n    // new -- apart from `Derived` the argument order can be arbitrary\n    py::class_<Derived, Base1, Holder, Base2, Trampoline>(\"Derived\");\n\n\nOut-of-the-box support for ``std::shared_ptr``\n----------------------------------------------\n\nThe relevant type caster is now built in, so it's no longer necessary to\ninclude a declaration of the form:\n\n.. code-block:: cpp\n\n    PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)\n\nContinuing to do so won't cause an error or even a deprecation warning,\nbut it's completely redundant.\n\n\nDeprecation of a few ``py::object`` APIs\n----------------------------------------\n\nAll of the old-style calls emit deprecation warnings.\n\n+---------------------------------------+---------------------------------------------+\n|  Old syntax                           |  New syntax                                 |\n+=======================================+=============================================+\n| ``obj.call(args...)``                 | ``obj(args...)``                            |\n+---------------------------------------+---------------------------------------------+\n| ``obj.str()``                         | ``py::str(obj)``                            |\n+---------------------------------------+---------------------------------------------+\n| ``auto l = py::list(obj); l.check()`` | ``py::isinstance<py::list>(obj)``           |\n+---------------------------------------+---------------------------------------------+\n| ``py::object(ptr, true)``             | ``py::reinterpret_borrow<py::object>(ptr)`` |\n+---------------------------------------+---------------------------------------------+\n| ``py::object(ptr, false)``            | ``py::reinterpret_steal<py::object>(ptr)``  |\n+---------------------------------------+---------------------------------------------+\n| ``if (obj.attr(\"foo\"))``              | ``if (py::hasattr(obj, \"foo\"))``            |\n+---------------------------------------+---------------------------------------------+\n| ``if (obj[\"bar\"])``                   | ``if (obj.contains(\"bar\"))``                |\n+---------------------------------------+---------------------------------------------+\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/attr.h",
    "content": "/*\n    pybind11/attr.h: Infrastructure for processing custom\n    type and function attributes\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"detail/common.h\"\n#include \"cast.h\"\n\n#include <functional>\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\n/// \\addtogroup annotations\n/// @{\n\n/// Annotation for methods\nstruct is_method {\n    handle class_;\n    explicit is_method(const handle &c) : class_(c) {}\n};\n\n/// Annotation for operators\nstruct is_operator {};\n\n/// Annotation for classes that cannot be subclassed\nstruct is_final {};\n\n/// Annotation for parent scope\nstruct scope {\n    handle value;\n    explicit scope(const handle &s) : value(s) {}\n};\n\n/// Annotation for documentation\nstruct doc {\n    const char *value;\n    explicit doc(const char *value) : value(value) {}\n};\n\n/// Annotation for function names\nstruct name {\n    const char *value;\n    explicit name(const char *value) : value(value) {}\n};\n\n/// Annotation indicating that a function is an overload associated with a given \"sibling\"\nstruct sibling {\n    handle value;\n    explicit sibling(const handle &value) : value(value.ptr()) {}\n};\n\n/// Annotation indicating that a class derives from another given type\ntemplate <typename T>\nstruct base {\n\n    PYBIND11_DEPRECATED(\n        \"base<T>() was deprecated in favor of specifying 'T' as a template argument to class_\")\n    base() = default;\n};\n\n/// Keep patient alive while nurse lives\ntemplate <size_t Nurse, size_t Patient>\nstruct keep_alive {};\n\n/// Annotation indicating that a class is involved in a multiple inheritance relationship\nstruct multiple_inheritance {};\n\n/// Annotation which enables dynamic attributes, i.e. adds `__dict__` to a class\nstruct dynamic_attr {};\n\n/// Annotation which enables the buffer protocol for a type\nstruct buffer_protocol {};\n\n/// Annotation which requests that a special metaclass is created for a type\nstruct metaclass {\n    handle value;\n\n    PYBIND11_DEPRECATED(\"py::metaclass() is no longer required. It's turned on by default now.\")\n    metaclass() = default;\n\n    /// Override pybind11's default metaclass\n    explicit metaclass(handle value) : value(value) {}\n};\n\n/// Specifies a custom callback with signature `void (PyHeapTypeObject*)` that\n/// may be used to customize the Python type.\n///\n/// The callback is invoked immediately before `PyType_Ready`.\n///\n/// Note: This is an advanced interface, and uses of it may require changes to\n/// work with later versions of pybind11.  You may wish to consult the\n/// implementation of `make_new_python_type` in `detail/classes.h` to understand\n/// the context in which the callback will be run.\nstruct custom_type_setup {\n    using callback = std::function<void(PyHeapTypeObject *heap_type)>;\n\n    explicit custom_type_setup(callback value) : value(std::move(value)) {}\n\n    callback value;\n};\n\n/// Annotation that marks a class as local to the module:\nstruct module_local {\n    const bool value;\n    constexpr explicit module_local(bool v = true) : value(v) {}\n};\n\n/// Annotation to mark enums as an arithmetic type\nstruct arithmetic {};\n\n/// Mark a function for addition at the beginning of the existing overload chain instead of the end\nstruct prepend {};\n\n/** \\rst\n    A call policy which places one or more guard variables (``Ts...``) around the function call.\n\n    For example, this definition:\n\n    .. code-block:: cpp\n\n        m.def(\"foo\", foo, py::call_guard<T>());\n\n    is equivalent to the following pseudocode:\n\n    .. code-block:: cpp\n\n        m.def(\"foo\", [](args...) {\n            T scope_guard;\n            return foo(args...); // forwarded arguments\n        });\n \\endrst */\ntemplate <typename... Ts>\nstruct call_guard;\n\ntemplate <>\nstruct call_guard<> {\n    using type = detail::void_type;\n};\n\ntemplate <typename T>\nstruct call_guard<T> {\n    static_assert(std::is_default_constructible<T>::value,\n                  \"The guard type must be default constructible\");\n\n    using type = T;\n};\n\ntemplate <typename T, typename... Ts>\nstruct call_guard<T, Ts...> {\n    struct type {\n        T guard{}; // Compose multiple guard types with left-to-right default-constructor order\n        typename call_guard<Ts...>::type next{};\n    };\n};\n\n/// @} annotations\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n/* Forward declarations */\nenum op_id : int;\nenum op_type : int;\nstruct undefined_t;\ntemplate <op_id id, op_type ot, typename L = undefined_t, typename R = undefined_t>\nstruct op_;\nvoid keep_alive_impl(size_t Nurse, size_t Patient, function_call &call, handle ret);\n\n/// Internal data structure which holds metadata about a keyword argument\nstruct argument_record {\n    const char *name;  ///< Argument name\n    const char *descr; ///< Human-readable version of the argument value\n    handle value;      ///< Associated Python object\n    bool convert : 1;  ///< True if the argument is allowed to convert when loading\n    bool none : 1;     ///< True if None is allowed when loading\n\n    argument_record(const char *name, const char *descr, handle value, bool convert, bool none)\n        : name(name), descr(descr), value(value), convert(convert), none(none) {}\n};\n\n/// Internal data structure which holds metadata about a bound function (signature, overloads,\n/// etc.)\nstruct function_record {\n    function_record()\n        : is_constructor(false), is_new_style_constructor(false), is_stateless(false),\n          is_operator(false), is_method(false), has_args(false), has_kwargs(false),\n          prepend(false) {}\n\n    /// Function name\n    char *name = nullptr; /* why no C++ strings? They generate heavier code.. */\n\n    // User-specified documentation string\n    char *doc = nullptr;\n\n    /// Human-readable version of the function signature\n    char *signature = nullptr;\n\n    /// List of registered keyword arguments\n    std::vector<argument_record> args;\n\n    /// Pointer to lambda function which converts arguments and performs the actual call\n    handle (*impl)(function_call &) = nullptr;\n\n    /// Storage for the wrapped function pointer and captured data, if any\n    void *data[3] = {};\n\n    /// Pointer to custom destructor for 'data' (if needed)\n    void (*free_data)(function_record *ptr) = nullptr;\n\n    /// Return value policy associated with this function\n    return_value_policy policy = return_value_policy::automatic;\n\n    /// True if name == '__init__'\n    bool is_constructor : 1;\n\n    /// True if this is a new-style `__init__` defined in `detail/init.h`\n    bool is_new_style_constructor : 1;\n\n    /// True if this is a stateless function pointer\n    bool is_stateless : 1;\n\n    /// True if this is an operator (__add__), etc.\n    bool is_operator : 1;\n\n    /// True if this is a method\n    bool is_method : 1;\n\n    /// True if the function has a '*args' argument\n    bool has_args : 1;\n\n    /// True if the function has a '**kwargs' argument\n    bool has_kwargs : 1;\n\n    /// True if this function is to be inserted at the beginning of the overload resolution chain\n    bool prepend : 1;\n\n    /// Number of arguments (including py::args and/or py::kwargs, if present)\n    std::uint16_t nargs;\n\n    /// Number of leading positional arguments, which are terminated by a py::args or py::kwargs\n    /// argument or by a py::kw_only annotation.\n    std::uint16_t nargs_pos = 0;\n\n    /// Number of leading arguments (counted in `nargs`) that are positional-only\n    std::uint16_t nargs_pos_only = 0;\n\n    /// Python method object\n    PyMethodDef *def = nullptr;\n\n    /// Python handle to the parent scope (a class or a module)\n    handle scope;\n\n    /// Python handle to the sibling function representing an overload chain\n    handle sibling;\n\n    /// Pointer to next overload\n    function_record *next = nullptr;\n};\n\n/// Special data structure which (temporarily) holds metadata about a bound class\nstruct type_record {\n    PYBIND11_NOINLINE type_record()\n        : multiple_inheritance(false), dynamic_attr(false), buffer_protocol(false),\n          default_holder(true), module_local(false), is_final(false) {}\n\n    /// Handle to the parent scope\n    handle scope;\n\n    /// Name of the class\n    const char *name = nullptr;\n\n    // Pointer to RTTI type_info data structure\n    const std::type_info *type = nullptr;\n\n    /// How large is the underlying C++ type?\n    size_t type_size = 0;\n\n    /// What is the alignment of the underlying C++ type?\n    size_t type_align = 0;\n\n    /// How large is the type's holder?\n    size_t holder_size = 0;\n\n    /// The global operator new can be overridden with a class-specific variant\n    void *(*operator_new)(size_t) = nullptr;\n\n    /// Function pointer to class_<..>::init_instance\n    void (*init_instance)(instance *, const void *) = nullptr;\n\n    /// Function pointer to class_<..>::dealloc\n    void (*dealloc)(detail::value_and_holder &) = nullptr;\n\n    /// List of base classes of the newly created type\n    list bases;\n\n    /// Optional docstring\n    const char *doc = nullptr;\n\n    /// Custom metaclass (optional)\n    handle metaclass;\n\n    /// Custom type setup.\n    custom_type_setup::callback custom_type_setup_callback;\n\n    /// Multiple inheritance marker\n    bool multiple_inheritance : 1;\n\n    /// Does the class manage a __dict__?\n    bool dynamic_attr : 1;\n\n    /// Does the class implement the buffer protocol?\n    bool buffer_protocol : 1;\n\n    /// Is the default (unique_ptr) holder type used?\n    bool default_holder : 1;\n\n    /// Is the class definition local to the module shared object?\n    bool module_local : 1;\n\n    /// Is the class inheritable from python classes?\n    bool is_final : 1;\n\n    PYBIND11_NOINLINE void add_base(const std::type_info &base, void *(*caster)(void *) ) {\n        auto *base_info = detail::get_type_info(base, false);\n        if (!base_info) {\n            std::string tname(base.name());\n            detail::clean_type_id(tname);\n            pybind11_fail(\"generic_type: type \\\"\" + std::string(name)\n                          + \"\\\" referenced unknown base type \\\"\" + tname + \"\\\"\");\n        }\n\n        if (default_holder != base_info->default_holder) {\n            std::string tname(base.name());\n            detail::clean_type_id(tname);\n            pybind11_fail(\"generic_type: type \\\"\" + std::string(name) + \"\\\" \"\n                          + (default_holder ? \"does not have\" : \"has\")\n                          + \" a non-default holder type while its base \\\"\" + tname + \"\\\" \"\n                          + (base_info->default_holder ? \"does not\" : \"does\"));\n        }\n\n        bases.append((PyObject *) base_info->type);\n\n#if PY_VERSION_HEX < 0x030B0000\n        dynamic_attr |= base_info->type->tp_dictoffset != 0;\n#else\n        dynamic_attr |= (base_info->type->tp_flags & Py_TPFLAGS_MANAGED_DICT) != 0;\n#endif\n\n        if (caster) {\n            base_info->implicit_casts.emplace_back(type, caster);\n        }\n    }\n};\n\ninline function_call::function_call(const function_record &f, handle p) : func(f), parent(p) {\n    args.reserve(f.nargs);\n    args_convert.reserve(f.nargs);\n}\n\n/// Tag for a new-style `__init__` defined in `detail/init.h`\nstruct is_new_style_constructor {};\n\n/**\n * Partial template specializations to process custom attributes provided to\n * cpp_function_ and class_. These are either used to initialize the respective\n * fields in the type_record and function_record data structures or executed at\n * runtime to deal with custom call policies (e.g. keep_alive).\n */\ntemplate <typename T, typename SFINAE = void>\nstruct process_attribute;\n\ntemplate <typename T>\nstruct process_attribute_default {\n    /// Default implementation: do nothing\n    static void init(const T &, function_record *) {}\n    static void init(const T &, type_record *) {}\n    static void precall(function_call &) {}\n    static void postcall(function_call &, handle) {}\n};\n\n/// Process an attribute specifying the function's name\ntemplate <>\nstruct process_attribute<name> : process_attribute_default<name> {\n    static void init(const name &n, function_record *r) { r->name = const_cast<char *>(n.value); }\n};\n\n/// Process an attribute specifying the function's docstring\ntemplate <>\nstruct process_attribute<doc> : process_attribute_default<doc> {\n    static void init(const doc &n, function_record *r) { r->doc = const_cast<char *>(n.value); }\n};\n\n/// Process an attribute specifying the function's docstring (provided as a C-style string)\ntemplate <>\nstruct process_attribute<const char *> : process_attribute_default<const char *> {\n    static void init(const char *d, function_record *r) { r->doc = const_cast<char *>(d); }\n    static void init(const char *d, type_record *r) { r->doc = d; }\n};\ntemplate <>\nstruct process_attribute<char *> : process_attribute<const char *> {};\n\n/// Process an attribute indicating the function's return value policy\ntemplate <>\nstruct process_attribute<return_value_policy> : process_attribute_default<return_value_policy> {\n    static void init(const return_value_policy &p, function_record *r) { r->policy = p; }\n};\n\n/// Process an attribute which indicates that this is an overloaded function associated with a\n/// given sibling\ntemplate <>\nstruct process_attribute<sibling> : process_attribute_default<sibling> {\n    static void init(const sibling &s, function_record *r) { r->sibling = s.value; }\n};\n\n/// Process an attribute which indicates that this function is a method\ntemplate <>\nstruct process_attribute<is_method> : process_attribute_default<is_method> {\n    static void init(const is_method &s, function_record *r) {\n        r->is_method = true;\n        r->scope = s.class_;\n    }\n};\n\n/// Process an attribute which indicates the parent scope of a method\ntemplate <>\nstruct process_attribute<scope> : process_attribute_default<scope> {\n    static void init(const scope &s, function_record *r) { r->scope = s.value; }\n};\n\n/// Process an attribute which indicates that this function is an operator\ntemplate <>\nstruct process_attribute<is_operator> : process_attribute_default<is_operator> {\n    static void init(const is_operator &, function_record *r) { r->is_operator = true; }\n};\n\ntemplate <>\nstruct process_attribute<is_new_style_constructor>\n    : process_attribute_default<is_new_style_constructor> {\n    static void init(const is_new_style_constructor &, function_record *r) {\n        r->is_new_style_constructor = true;\n    }\n};\n\ninline void check_kw_only_arg(const arg &a, function_record *r) {\n    if (r->args.size() > r->nargs_pos && (!a.name || a.name[0] == '\\0')) {\n        pybind11_fail(\"arg(): cannot specify an unnamed argument after a kw_only() annotation or \"\n                      \"args() argument\");\n    }\n}\n\ninline void append_self_arg_if_needed(function_record *r) {\n    if (r->is_method && r->args.empty()) {\n        r->args.emplace_back(\"self\", nullptr, handle(), /*convert=*/true, /*none=*/false);\n    }\n}\n\n/// Process a keyword argument attribute (*without* a default value)\ntemplate <>\nstruct process_attribute<arg> : process_attribute_default<arg> {\n    static void init(const arg &a, function_record *r) {\n        append_self_arg_if_needed(r);\n        r->args.emplace_back(a.name, nullptr, handle(), !a.flag_noconvert, a.flag_none);\n\n        check_kw_only_arg(a, r);\n    }\n};\n\n/// Process a keyword argument attribute (*with* a default value)\ntemplate <>\nstruct process_attribute<arg_v> : process_attribute_default<arg_v> {\n    static void init(const arg_v &a, function_record *r) {\n        if (r->is_method && r->args.empty()) {\n            r->args.emplace_back(\n                \"self\", /*descr=*/nullptr, /*parent=*/handle(), /*convert=*/true, /*none=*/false);\n        }\n\n        if (!a.value) {\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n            std::string descr(\"'\");\n            if (a.name) {\n                descr += std::string(a.name) + \": \";\n            }\n            descr += a.type + \"'\";\n            if (r->is_method) {\n                if (r->name) {\n                    descr += \" in method '\" + (std::string) str(r->scope) + \".\"\n                             + (std::string) r->name + \"'\";\n                } else {\n                    descr += \" in method of '\" + (std::string) str(r->scope) + \"'\";\n                }\n            } else if (r->name) {\n                descr += \" in function '\" + (std::string) r->name + \"'\";\n            }\n            pybind11_fail(\"arg(): could not convert default argument \" + descr\n                          + \" into a Python object (type not registered yet?)\");\n#else\n            pybind11_fail(\"arg(): could not convert default argument \"\n                          \"into a Python object (type not registered yet?). \"\n                          \"#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for \"\n                          \"more information.\");\n#endif\n        }\n        r->args.emplace_back(a.name, a.descr, a.value.inc_ref(), !a.flag_noconvert, a.flag_none);\n\n        check_kw_only_arg(a, r);\n    }\n};\n\n/// Process a keyword-only-arguments-follow pseudo argument\ntemplate <>\nstruct process_attribute<kw_only> : process_attribute_default<kw_only> {\n    static void init(const kw_only &, function_record *r) {\n        append_self_arg_if_needed(r);\n        if (r->has_args && r->nargs_pos != static_cast<std::uint16_t>(r->args.size())) {\n            pybind11_fail(\"Mismatched args() and kw_only(): they must occur at the same relative \"\n                          \"argument location (or omit kw_only() entirely)\");\n        }\n        r->nargs_pos = static_cast<std::uint16_t>(r->args.size());\n    }\n};\n\n/// Process a positional-only-argument maker\ntemplate <>\nstruct process_attribute<pos_only> : process_attribute_default<pos_only> {\n    static void init(const pos_only &, function_record *r) {\n        append_self_arg_if_needed(r);\n        r->nargs_pos_only = static_cast<std::uint16_t>(r->args.size());\n        if (r->nargs_pos_only > r->nargs_pos) {\n            pybind11_fail(\"pos_only(): cannot follow a py::args() argument\");\n        }\n        // It also can't follow a kw_only, but a static_assert in pybind11.h checks that\n    }\n};\n\n/// Process a parent class attribute.  Single inheritance only (class_ itself already guarantees\n/// that)\ntemplate <typename T>\nstruct process_attribute<T, enable_if_t<is_pyobject<T>::value>>\n    : process_attribute_default<handle> {\n    static void init(const handle &h, type_record *r) { r->bases.append(h); }\n};\n\n/// Process a parent class attribute (deprecated, does not support multiple inheritance)\ntemplate <typename T>\nstruct process_attribute<base<T>> : process_attribute_default<base<T>> {\n    static void init(const base<T> &, type_record *r) { r->add_base(typeid(T), nullptr); }\n};\n\n/// Process a multiple inheritance attribute\ntemplate <>\nstruct process_attribute<multiple_inheritance> : process_attribute_default<multiple_inheritance> {\n    static void init(const multiple_inheritance &, type_record *r) {\n        r->multiple_inheritance = true;\n    }\n};\n\ntemplate <>\nstruct process_attribute<dynamic_attr> : process_attribute_default<dynamic_attr> {\n    static void init(const dynamic_attr &, type_record *r) { r->dynamic_attr = true; }\n};\n\ntemplate <>\nstruct process_attribute<custom_type_setup> {\n    static void init(const custom_type_setup &value, type_record *r) {\n        r->custom_type_setup_callback = value.value;\n    }\n};\n\ntemplate <>\nstruct process_attribute<is_final> : process_attribute_default<is_final> {\n    static void init(const is_final &, type_record *r) { r->is_final = true; }\n};\n\ntemplate <>\nstruct process_attribute<buffer_protocol> : process_attribute_default<buffer_protocol> {\n    static void init(const buffer_protocol &, type_record *r) { r->buffer_protocol = true; }\n};\n\ntemplate <>\nstruct process_attribute<metaclass> : process_attribute_default<metaclass> {\n    static void init(const metaclass &m, type_record *r) { r->metaclass = m.value; }\n};\n\ntemplate <>\nstruct process_attribute<module_local> : process_attribute_default<module_local> {\n    static void init(const module_local &l, type_record *r) { r->module_local = l.value; }\n};\n\n/// Process a 'prepend' attribute, putting this at the beginning of the overload chain\ntemplate <>\nstruct process_attribute<prepend> : process_attribute_default<prepend> {\n    static void init(const prepend &, function_record *r) { r->prepend = true; }\n};\n\n/// Process an 'arithmetic' attribute for enums (does nothing here)\ntemplate <>\nstruct process_attribute<arithmetic> : process_attribute_default<arithmetic> {};\n\ntemplate <typename... Ts>\nstruct process_attribute<call_guard<Ts...>> : process_attribute_default<call_guard<Ts...>> {};\n\n/**\n * Process a keep_alive call policy -- invokes keep_alive_impl during the\n * pre-call handler if both Nurse, Patient != 0 and use the post-call handler\n * otherwise\n */\ntemplate <size_t Nurse, size_t Patient>\nstruct process_attribute<keep_alive<Nurse, Patient>>\n    : public process_attribute_default<keep_alive<Nurse, Patient>> {\n    template <size_t N = Nurse, size_t P = Patient, enable_if_t<N != 0 && P != 0, int> = 0>\n    static void precall(function_call &call) {\n        keep_alive_impl(Nurse, Patient, call, handle());\n    }\n    template <size_t N = Nurse, size_t P = Patient, enable_if_t<N != 0 && P != 0, int> = 0>\n    static void postcall(function_call &, handle) {}\n    template <size_t N = Nurse, size_t P = Patient, enable_if_t<N == 0 || P == 0, int> = 0>\n    static void precall(function_call &) {}\n    template <size_t N = Nurse, size_t P = Patient, enable_if_t<N == 0 || P == 0, int> = 0>\n    static void postcall(function_call &call, handle ret) {\n        keep_alive_impl(Nurse, Patient, call, ret);\n    }\n};\n\n/// Recursively iterate over variadic template arguments\ntemplate <typename... Args>\nstruct process_attributes {\n    static void init(const Args &...args, function_record *r) {\n        PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(r);\n        PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(r);\n        using expander = int[];\n        (void) expander{\n            0, ((void) process_attribute<typename std::decay<Args>::type>::init(args, r), 0)...};\n    }\n    static void init(const Args &...args, type_record *r) {\n        PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(r);\n        PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(r);\n        using expander = int[];\n        (void) expander{0,\n                        (process_attribute<typename std::decay<Args>::type>::init(args, r), 0)...};\n    }\n    static void precall(function_call &call) {\n        PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(call);\n        using expander = int[];\n        (void) expander{0,\n                        (process_attribute<typename std::decay<Args>::type>::precall(call), 0)...};\n    }\n    static void postcall(function_call &call, handle fn_ret) {\n        PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(call, fn_ret);\n        PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(fn_ret);\n        using expander = int[];\n        (void) expander{\n            0, (process_attribute<typename std::decay<Args>::type>::postcall(call, fn_ret), 0)...};\n    }\n};\n\ntemplate <typename T>\nusing is_call_guard = is_instantiation<call_guard, T>;\n\n/// Extract the ``type`` from the first `call_guard` in `Extras...` (or `void_type` if none found)\ntemplate <typename... Extra>\nusing extract_guard_t = typename exactly_one_t<is_call_guard, call_guard<>, Extra...>::type;\n\n/// Check the number of named arguments at compile time\ntemplate <typename... Extra,\n          size_t named = constexpr_sum(std::is_base_of<arg, Extra>::value...),\n          size_t self = constexpr_sum(std::is_same<is_method, Extra>::value...)>\nconstexpr bool expected_num_args(size_t nargs, bool has_args, bool has_kwargs) {\n    PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(nargs, has_args, has_kwargs);\n    return named == 0 || (self + named + size_t(has_args) + size_t(has_kwargs)) == nargs;\n}\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/buffer_info.h",
    "content": "/*\n    pybind11/buffer_info.h: Python buffer object interface\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"detail/common.h\"\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n// Default, C-style strides\ninline std::vector<ssize_t> c_strides(const std::vector<ssize_t> &shape, ssize_t itemsize) {\n    auto ndim = shape.size();\n    std::vector<ssize_t> strides(ndim, itemsize);\n    if (ndim > 0) {\n        for (size_t i = ndim - 1; i > 0; --i) {\n            strides[i - 1] = strides[i] * shape[i];\n        }\n    }\n    return strides;\n}\n\n// F-style strides; default when constructing an array_t with `ExtraFlags & f_style`\ninline std::vector<ssize_t> f_strides(const std::vector<ssize_t> &shape, ssize_t itemsize) {\n    auto ndim = shape.size();\n    std::vector<ssize_t> strides(ndim, itemsize);\n    for (size_t i = 1; i < ndim; ++i) {\n        strides[i] = strides[i - 1] * shape[i - 1];\n    }\n    return strides;\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n/// Information record describing a Python buffer object\nstruct buffer_info {\n    void *ptr = nullptr;          // Pointer to the underlying storage\n    ssize_t itemsize = 0;         // Size of individual items in bytes\n    ssize_t size = 0;             // Total number of entries\n    std::string format;           // For homogeneous buffers, this should be set to\n                                  // format_descriptor<T>::format()\n    ssize_t ndim = 0;             // Number of dimensions\n    std::vector<ssize_t> shape;   // Shape of the tensor (1 entry per dimension)\n    std::vector<ssize_t> strides; // Number of bytes between adjacent entries\n                                  // (for each per dimension)\n    bool readonly = false;        // flag to indicate if the underlying storage may be written to\n\n    buffer_info() = default;\n\n    buffer_info(void *ptr,\n                ssize_t itemsize,\n                const std::string &format,\n                ssize_t ndim,\n                detail::any_container<ssize_t> shape_in,\n                detail::any_container<ssize_t> strides_in,\n                bool readonly = false)\n        : ptr(ptr), itemsize(itemsize), size(1), format(format), ndim(ndim),\n          shape(std::move(shape_in)), strides(std::move(strides_in)), readonly(readonly) {\n        if (ndim != (ssize_t) shape.size() || ndim != (ssize_t) strides.size()) {\n            pybind11_fail(\"buffer_info: ndim doesn't match shape and/or strides length\");\n        }\n        for (size_t i = 0; i < (size_t) ndim; ++i) {\n            size *= shape[i];\n        }\n    }\n\n    template <typename T>\n    buffer_info(T *ptr,\n                detail::any_container<ssize_t> shape_in,\n                detail::any_container<ssize_t> strides_in,\n                bool readonly = false)\n        : buffer_info(private_ctr_tag(),\n                      ptr,\n                      sizeof(T),\n                      format_descriptor<T>::format(),\n                      static_cast<ssize_t>(shape_in->size()),\n                      std::move(shape_in),\n                      std::move(strides_in),\n                      readonly) {}\n\n    buffer_info(void *ptr,\n                ssize_t itemsize,\n                const std::string &format,\n                ssize_t size,\n                bool readonly = false)\n        : buffer_info(ptr, itemsize, format, 1, {size}, {itemsize}, readonly) {}\n\n    template <typename T>\n    buffer_info(T *ptr, ssize_t size, bool readonly = false)\n        : buffer_info(ptr, sizeof(T), format_descriptor<T>::format(), size, readonly) {}\n\n    template <typename T>\n    buffer_info(const T *ptr, ssize_t size, bool readonly = true)\n        : buffer_info(\n            const_cast<T *>(ptr), sizeof(T), format_descriptor<T>::format(), size, readonly) {}\n\n    explicit buffer_info(Py_buffer *view, bool ownview = true)\n        : buffer_info(\n            view->buf,\n            view->itemsize,\n            view->format,\n            view->ndim,\n            {view->shape, view->shape + view->ndim},\n            /* Though buffer::request() requests PyBUF_STRIDES, ctypes objects\n             * ignore this flag and return a view with NULL strides.\n             * When strides are NULL, build them manually.  */\n            view->strides\n                ? std::vector<ssize_t>(view->strides, view->strides + view->ndim)\n                : detail::c_strides({view->shape, view->shape + view->ndim}, view->itemsize),\n            (view->readonly != 0)) {\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        this->m_view = view;\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        this->ownview = ownview;\n    }\n\n    buffer_info(const buffer_info &) = delete;\n    buffer_info &operator=(const buffer_info &) = delete;\n\n    buffer_info(buffer_info &&other) noexcept { (*this) = std::move(other); }\n\n    buffer_info &operator=(buffer_info &&rhs) noexcept {\n        ptr = rhs.ptr;\n        itemsize = rhs.itemsize;\n        size = rhs.size;\n        format = std::move(rhs.format);\n        ndim = rhs.ndim;\n        shape = std::move(rhs.shape);\n        strides = std::move(rhs.strides);\n        std::swap(m_view, rhs.m_view);\n        std::swap(ownview, rhs.ownview);\n        readonly = rhs.readonly;\n        return *this;\n    }\n\n    ~buffer_info() {\n        if (m_view && ownview) {\n            PyBuffer_Release(m_view);\n            delete m_view;\n        }\n    }\n\n    Py_buffer *view() const { return m_view; }\n    Py_buffer *&view() { return m_view; }\n\nprivate:\n    struct private_ctr_tag {};\n\n    buffer_info(private_ctr_tag,\n                void *ptr,\n                ssize_t itemsize,\n                const std::string &format,\n                ssize_t ndim,\n                detail::any_container<ssize_t> &&shape_in,\n                detail::any_container<ssize_t> &&strides_in,\n                bool readonly)\n        : buffer_info(\n            ptr, itemsize, format, ndim, std::move(shape_in), std::move(strides_in), readonly) {}\n\n    Py_buffer *m_view = nullptr;\n    bool ownview = false;\n};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ntemplate <typename T, typename SFINAE = void>\nstruct compare_buffer_info {\n    static bool compare(const buffer_info &b) {\n        return b.format == format_descriptor<T>::format() && b.itemsize == (ssize_t) sizeof(T);\n    }\n};\n\ntemplate <typename T>\nstruct compare_buffer_info<T, detail::enable_if_t<std::is_integral<T>::value>> {\n    static bool compare(const buffer_info &b) {\n        return (size_t) b.itemsize == sizeof(T)\n               && (b.format == format_descriptor<T>::value\n                   || ((sizeof(T) == sizeof(long))\n                       && b.format == (std::is_unsigned<T>::value ? \"L\" : \"l\"))\n                   || ((sizeof(T) == sizeof(size_t))\n                       && b.format == (std::is_unsigned<T>::value ? \"N\" : \"n\")));\n    }\n};\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/cast.h",
    "content": "/*\n    pybind11/cast.h: Partial template specializations to cast between\n    C++ and Python types\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"detail/common.h\"\n#include \"detail/descr.h\"\n#include \"detail/type_caster_base.h\"\n#include \"detail/typeid.h\"\n#include \"pytypes.h\"\n\n#include <array>\n#include <cstring>\n#include <functional>\n#include <iosfwd>\n#include <iterator>\n#include <memory>\n#include <string>\n#include <tuple>\n#include <type_traits>\n#include <utility>\n#include <vector>\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nPYBIND11_WARNING_DISABLE_MSVC(4127)\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ntemplate <typename type, typename SFINAE = void>\nclass type_caster : public type_caster_base<type> {};\ntemplate <typename type>\nusing make_caster = type_caster<intrinsic_t<type>>;\n\n// Shortcut for calling a caster's `cast_op_type` cast operator for casting a type_caster to a T\ntemplate <typename T>\ntypename make_caster<T>::template cast_op_type<T> cast_op(make_caster<T> &caster) {\n    return caster.operator typename make_caster<T>::template cast_op_type<T>();\n}\ntemplate <typename T>\ntypename make_caster<T>::template cast_op_type<typename std::add_rvalue_reference<T>::type>\ncast_op(make_caster<T> &&caster) {\n    return std::move(caster).operator typename make_caster<T>::\n        template cast_op_type<typename std::add_rvalue_reference<T>::type>();\n}\n\ntemplate <typename type>\nclass type_caster<std::reference_wrapper<type>> {\nprivate:\n    using caster_t = make_caster<type>;\n    caster_t subcaster;\n    using reference_t = type &;\n    using subcaster_cast_op_type = typename caster_t::template cast_op_type<reference_t>;\n\n    static_assert(\n        std::is_same<typename std::remove_const<type>::type &, subcaster_cast_op_type>::value\n            || std::is_same<reference_t, subcaster_cast_op_type>::value,\n        \"std::reference_wrapper<T> caster requires T to have a caster with an \"\n        \"`operator T &()` or `operator const T &()`\");\n\npublic:\n    bool load(handle src, bool convert) { return subcaster.load(src, convert); }\n    static constexpr auto name = caster_t::name;\n    static handle\n    cast(const std::reference_wrapper<type> &src, return_value_policy policy, handle parent) {\n        // It is definitely wrong to take ownership of this pointer, so mask that rvp\n        if (policy == return_value_policy::take_ownership\n            || policy == return_value_policy::automatic) {\n            policy = return_value_policy::automatic_reference;\n        }\n        return caster_t::cast(&src.get(), policy, parent);\n    }\n    template <typename T>\n    using cast_op_type = std::reference_wrapper<type>;\n    explicit operator std::reference_wrapper<type>() { return cast_op<type &>(subcaster); }\n};\n\n#define PYBIND11_TYPE_CASTER(type, py_name)                                                       \\\nprotected:                                                                                        \\\n    type value;                                                                                   \\\n                                                                                                  \\\npublic:                                                                                           \\\n    static constexpr auto name = py_name;                                                         \\\n    template <typename T_,                                                                        \\\n              ::pybind11::detail::enable_if_t<                                                    \\\n                  std::is_same<type, ::pybind11::detail::remove_cv_t<T_>>::value,                 \\\n                  int>                                                                            \\\n              = 0>                                                                                \\\n    static ::pybind11::handle cast(                                                               \\\n        T_ *src, ::pybind11::return_value_policy policy, ::pybind11::handle parent) {             \\\n        if (!src)                                                                                 \\\n            return ::pybind11::none().release();                                                  \\\n        if (policy == ::pybind11::return_value_policy::take_ownership) {                          \\\n            auto h = cast(std::move(*src), policy, parent);                                       \\\n            delete src;                                                                           \\\n            return h;                                                                             \\\n        }                                                                                         \\\n        return cast(*src, policy, parent);                                                        \\\n    }                                                                                             \\\n    operator type *() { return &value; }               /* NOLINT(bugprone-macro-parentheses) */   \\\n    operator type &() { return value; }                /* NOLINT(bugprone-macro-parentheses) */   \\\n    operator type &&() && { return std::move(value); } /* NOLINT(bugprone-macro-parentheses) */   \\\n    template <typename T_>                                                                        \\\n    using cast_op_type = ::pybind11::detail::movable_cast_op_type<T_>\n\ntemplate <typename CharT>\nusing is_std_char_type = any_of<std::is_same<CharT, char>, /* std::string */\n#if defined(PYBIND11_HAS_U8STRING)\n                                std::is_same<CharT, char8_t>, /* std::u8string */\n#endif\n                                std::is_same<CharT, char16_t>, /* std::u16string */\n                                std::is_same<CharT, char32_t>, /* std::u32string */\n                                std::is_same<CharT, wchar_t>   /* std::wstring */\n                                >;\n\ntemplate <typename T>\nstruct type_caster<T, enable_if_t<std::is_arithmetic<T>::value && !is_std_char_type<T>::value>> {\n    using _py_type_0 = conditional_t<sizeof(T) <= sizeof(long), long, long long>;\n    using _py_type_1 = conditional_t<std::is_signed<T>::value,\n                                     _py_type_0,\n                                     typename std::make_unsigned<_py_type_0>::type>;\n    using py_type = conditional_t<std::is_floating_point<T>::value, double, _py_type_1>;\n\npublic:\n    bool load(handle src, bool convert) {\n        py_type py_value;\n\n        if (!src) {\n            return false;\n        }\n\n#if !defined(PYPY_VERSION)\n        auto index_check = [](PyObject *o) { return PyIndex_Check(o); };\n#else\n        // In PyPy 7.3.3, `PyIndex_Check` is implemented by calling `__index__`,\n        // while CPython only considers the existence of `nb_index`/`__index__`.\n        auto index_check = [](PyObject *o) { return hasattr(o, \"__index__\"); };\n#endif\n\n        if (std::is_floating_point<T>::value) {\n            if (convert || PyFloat_Check(src.ptr())) {\n                py_value = (py_type) PyFloat_AsDouble(src.ptr());\n            } else {\n                return false;\n            }\n        } else if (PyFloat_Check(src.ptr())\n                   || (!convert && !PYBIND11_LONG_CHECK(src.ptr()) && !index_check(src.ptr()))) {\n            return false;\n        } else {\n            handle src_or_index = src;\n            // PyPy: 7.3.7's 3.8 does not implement PyLong_*'s __index__ calls.\n#if PY_VERSION_HEX < 0x03080000 || defined(PYPY_VERSION)\n            object index;\n            if (!PYBIND11_LONG_CHECK(src.ptr())) { // So: index_check(src.ptr())\n                index = reinterpret_steal<object>(PyNumber_Index(src.ptr()));\n                if (!index) {\n                    PyErr_Clear();\n                    if (!convert)\n                        return false;\n                } else {\n                    src_or_index = index;\n                }\n            }\n#endif\n            if (std::is_unsigned<py_type>::value) {\n                py_value = as_unsigned<py_type>(src_or_index.ptr());\n            } else { // signed integer:\n                py_value = sizeof(T) <= sizeof(long)\n                               ? (py_type) PyLong_AsLong(src_or_index.ptr())\n                               : (py_type) PYBIND11_LONG_AS_LONGLONG(src_or_index.ptr());\n            }\n        }\n\n        // Python API reported an error\n        bool py_err = py_value == (py_type) -1 && PyErr_Occurred();\n\n        // Check to see if the conversion is valid (integers should match exactly)\n        // Signed/unsigned checks happen elsewhere\n        if (py_err\n            || (std::is_integral<T>::value && sizeof(py_type) != sizeof(T)\n                && py_value != (py_type) (T) py_value)) {\n            PyErr_Clear();\n            if (py_err && convert && (PyNumber_Check(src.ptr()) != 0)) {\n                auto tmp = reinterpret_steal<object>(std::is_floating_point<T>::value\n                                                         ? PyNumber_Float(src.ptr())\n                                                         : PyNumber_Long(src.ptr()));\n                PyErr_Clear();\n                return load(tmp, false);\n            }\n            return false;\n        }\n\n        value = (T) py_value;\n        return true;\n    }\n\n    template <typename U = T>\n    static typename std::enable_if<std::is_floating_point<U>::value, handle>::type\n    cast(U src, return_value_policy /* policy */, handle /* parent */) {\n        return PyFloat_FromDouble((double) src);\n    }\n\n    template <typename U = T>\n    static typename std::enable_if<!std::is_floating_point<U>::value && std::is_signed<U>::value\n                                       && (sizeof(U) <= sizeof(long)),\n                                   handle>::type\n    cast(U src, return_value_policy /* policy */, handle /* parent */) {\n        return PYBIND11_LONG_FROM_SIGNED((long) src);\n    }\n\n    template <typename U = T>\n    static typename std::enable_if<!std::is_floating_point<U>::value && std::is_unsigned<U>::value\n                                       && (sizeof(U) <= sizeof(unsigned long)),\n                                   handle>::type\n    cast(U src, return_value_policy /* policy */, handle /* parent */) {\n        return PYBIND11_LONG_FROM_UNSIGNED((unsigned long) src);\n    }\n\n    template <typename U = T>\n    static typename std::enable_if<!std::is_floating_point<U>::value && std::is_signed<U>::value\n                                       && (sizeof(U) > sizeof(long)),\n                                   handle>::type\n    cast(U src, return_value_policy /* policy */, handle /* parent */) {\n        return PyLong_FromLongLong((long long) src);\n    }\n\n    template <typename U = T>\n    static typename std::enable_if<!std::is_floating_point<U>::value && std::is_unsigned<U>::value\n                                       && (sizeof(U) > sizeof(unsigned long)),\n                                   handle>::type\n    cast(U src, return_value_policy /* policy */, handle /* parent */) {\n        return PyLong_FromUnsignedLongLong((unsigned long long) src);\n    }\n\n    PYBIND11_TYPE_CASTER(T, const_name<std::is_integral<T>::value>(\"int\", \"float\"));\n};\n\ntemplate <typename T>\nstruct void_caster {\npublic:\n    bool load(handle src, bool) {\n        if (src && src.is_none()) {\n            return true;\n        }\n        return false;\n    }\n    static handle cast(T, return_value_policy /* policy */, handle /* parent */) {\n        return none().release();\n    }\n    PYBIND11_TYPE_CASTER(T, const_name(\"None\"));\n};\n\ntemplate <>\nclass type_caster<void_type> : public void_caster<void_type> {};\n\ntemplate <>\nclass type_caster<void> : public type_caster<void_type> {\npublic:\n    using type_caster<void_type>::cast;\n\n    bool load(handle h, bool) {\n        if (!h) {\n            return false;\n        }\n        if (h.is_none()) {\n            value = nullptr;\n            return true;\n        }\n\n        /* Check if this is a capsule */\n        if (isinstance<capsule>(h)) {\n            value = reinterpret_borrow<capsule>(h);\n            return true;\n        }\n\n        /* Check if this is a C++ type */\n        const auto &bases = all_type_info((PyTypeObject *) type::handle_of(h).ptr());\n        if (bases.size() == 1) { // Only allowing loading from a single-value type\n            value = values_and_holders(reinterpret_cast<instance *>(h.ptr())).begin()->value_ptr();\n            return true;\n        }\n\n        /* Fail */\n        return false;\n    }\n\n    static handle cast(const void *ptr, return_value_policy /* policy */, handle /* parent */) {\n        if (ptr) {\n            return capsule(ptr).release();\n        }\n        return none().release();\n    }\n\n    template <typename T>\n    using cast_op_type = void *&;\n    explicit operator void *&() { return value; }\n    static constexpr auto name = const_name(\"capsule\");\n\nprivate:\n    void *value = nullptr;\n};\n\ntemplate <>\nclass type_caster<std::nullptr_t> : public void_caster<std::nullptr_t> {};\n\ntemplate <>\nclass type_caster<bool> {\npublic:\n    bool load(handle src, bool convert) {\n        if (!src) {\n            return false;\n        }\n        if (src.ptr() == Py_True) {\n            value = true;\n            return true;\n        }\n        if (src.ptr() == Py_False) {\n            value = false;\n            return true;\n        }\n        if (convert || (std::strcmp(\"numpy.bool_\", Py_TYPE(src.ptr())->tp_name) == 0)) {\n            // (allow non-implicit conversion for numpy booleans)\n\n            Py_ssize_t res = -1;\n            if (src.is_none()) {\n                res = 0; // None is implicitly converted to False\n            }\n#if defined(PYPY_VERSION)\n            // On PyPy, check that \"__bool__\" attr exists\n            else if (hasattr(src, PYBIND11_BOOL_ATTR)) {\n                res = PyObject_IsTrue(src.ptr());\n            }\n#else\n            // Alternate approach for CPython: this does the same as the above, but optimized\n            // using the CPython API so as to avoid an unneeded attribute lookup.\n            else if (auto *tp_as_number = src.ptr()->ob_type->tp_as_number) {\n                if (PYBIND11_NB_BOOL(tp_as_number)) {\n                    res = (*PYBIND11_NB_BOOL(tp_as_number))(src.ptr());\n                }\n            }\n#endif\n            if (res == 0 || res == 1) {\n                value = (res != 0);\n                return true;\n            }\n            PyErr_Clear();\n        }\n        return false;\n    }\n    static handle cast(bool src, return_value_policy /* policy */, handle /* parent */) {\n        return handle(src ? Py_True : Py_False).inc_ref();\n    }\n    PYBIND11_TYPE_CASTER(bool, const_name(\"bool\"));\n};\n\n// Helper class for UTF-{8,16,32} C++ stl strings:\ntemplate <typename StringType, bool IsView = false>\nstruct string_caster {\n    using CharT = typename StringType::value_type;\n\n    // Simplify life by being able to assume standard char sizes (the standard only guarantees\n    // minimums, but Python requires exact sizes)\n    static_assert(!std::is_same<CharT, char>::value || sizeof(CharT) == 1,\n                  \"Unsupported char size != 1\");\n#if defined(PYBIND11_HAS_U8STRING)\n    static_assert(!std::is_same<CharT, char8_t>::value || sizeof(CharT) == 1,\n                  \"Unsupported char8_t size != 1\");\n#endif\n    static_assert(!std::is_same<CharT, char16_t>::value || sizeof(CharT) == 2,\n                  \"Unsupported char16_t size != 2\");\n    static_assert(!std::is_same<CharT, char32_t>::value || sizeof(CharT) == 4,\n                  \"Unsupported char32_t size != 4\");\n    // wchar_t can be either 16 bits (Windows) or 32 (everywhere else)\n    static_assert(!std::is_same<CharT, wchar_t>::value || sizeof(CharT) == 2 || sizeof(CharT) == 4,\n                  \"Unsupported wchar_t size != 2/4\");\n    static constexpr size_t UTF_N = 8 * sizeof(CharT);\n\n    bool load(handle src, bool) {\n        handle load_src = src;\n        if (!src) {\n            return false;\n        }\n        if (!PyUnicode_Check(load_src.ptr())) {\n            return load_raw(load_src);\n        }\n\n        // For UTF-8 we avoid the need for a temporary `bytes` object by using\n        // `PyUnicode_AsUTF8AndSize`.\n        if (UTF_N == 8) {\n            Py_ssize_t size = -1;\n            const auto *buffer\n                = reinterpret_cast<const CharT *>(PyUnicode_AsUTF8AndSize(load_src.ptr(), &size));\n            if (!buffer) {\n                PyErr_Clear();\n                return false;\n            }\n            value = StringType(buffer, static_cast<size_t>(size));\n            return true;\n        }\n\n        auto utfNbytes\n            = reinterpret_steal<object>(PyUnicode_AsEncodedString(load_src.ptr(),\n                                                                  UTF_N == 8    ? \"utf-8\"\n                                                                  : UTF_N == 16 ? \"utf-16\"\n                                                                                : \"utf-32\",\n                                                                  nullptr));\n        if (!utfNbytes) {\n            PyErr_Clear();\n            return false;\n        }\n\n        const auto *buffer\n            = reinterpret_cast<const CharT *>(PYBIND11_BYTES_AS_STRING(utfNbytes.ptr()));\n        size_t length = (size_t) PYBIND11_BYTES_SIZE(utfNbytes.ptr()) / sizeof(CharT);\n        // Skip BOM for UTF-16/32\n        if (UTF_N > 8) {\n            buffer++;\n            length--;\n        }\n        value = StringType(buffer, length);\n\n        // If we're loading a string_view we need to keep the encoded Python object alive:\n        if (IsView) {\n            loader_life_support::add_patient(utfNbytes);\n        }\n\n        return true;\n    }\n\n    static handle\n    cast(const StringType &src, return_value_policy /* policy */, handle /* parent */) {\n        const char *buffer = reinterpret_cast<const char *>(src.data());\n        auto nbytes = ssize_t(src.size() * sizeof(CharT));\n        handle s = decode_utfN(buffer, nbytes);\n        if (!s) {\n            throw error_already_set();\n        }\n        return s;\n    }\n\n    PYBIND11_TYPE_CASTER(StringType, const_name(PYBIND11_STRING_NAME));\n\nprivate:\n    static handle decode_utfN(const char *buffer, ssize_t nbytes) {\n#if !defined(PYPY_VERSION)\n        return UTF_N == 8    ? PyUnicode_DecodeUTF8(buffer, nbytes, nullptr)\n               : UTF_N == 16 ? PyUnicode_DecodeUTF16(buffer, nbytes, nullptr, nullptr)\n                             : PyUnicode_DecodeUTF32(buffer, nbytes, nullptr, nullptr);\n#else\n        // PyPy segfaults when on PyUnicode_DecodeUTF16 (and possibly on PyUnicode_DecodeUTF32 as\n        // well), so bypass the whole thing by just passing the encoding as a string value, which\n        // works properly:\n        return PyUnicode_Decode(buffer,\n                                nbytes,\n                                UTF_N == 8    ? \"utf-8\"\n                                : UTF_N == 16 ? \"utf-16\"\n                                              : \"utf-32\",\n                                nullptr);\n#endif\n    }\n\n    // When loading into a std::string or char*, accept a bytes/bytearray object as-is (i.e.\n    // without any encoding/decoding attempt).  For other C++ char sizes this is a no-op.\n    // which supports loading a unicode from a str, doesn't take this path.\n    template <typename C = CharT>\n    bool load_raw(enable_if_t<std::is_same<C, char>::value, handle> src) {\n        if (PYBIND11_BYTES_CHECK(src.ptr())) {\n            // We were passed raw bytes; accept it into a std::string or char*\n            // without any encoding attempt.\n            const char *bytes = PYBIND11_BYTES_AS_STRING(src.ptr());\n            if (!bytes) {\n                pybind11_fail(\"Unexpected PYBIND11_BYTES_AS_STRING() failure.\");\n            }\n            value = StringType(bytes, (size_t) PYBIND11_BYTES_SIZE(src.ptr()));\n            return true;\n        }\n        if (PyByteArray_Check(src.ptr())) {\n            // We were passed a bytearray; accept it into a std::string or char*\n            // without any encoding attempt.\n            const char *bytearray = PyByteArray_AsString(src.ptr());\n            if (!bytearray) {\n                pybind11_fail(\"Unexpected PyByteArray_AsString() failure.\");\n            }\n            value = StringType(bytearray, (size_t) PyByteArray_Size(src.ptr()));\n            return true;\n        }\n\n        return false;\n    }\n\n    template <typename C = CharT>\n    bool load_raw(enable_if_t<!std::is_same<C, char>::value, handle>) {\n        return false;\n    }\n};\n\ntemplate <typename CharT, class Traits, class Allocator>\nstruct type_caster<std::basic_string<CharT, Traits, Allocator>,\n                   enable_if_t<is_std_char_type<CharT>::value>>\n    : string_caster<std::basic_string<CharT, Traits, Allocator>> {};\n\n#ifdef PYBIND11_HAS_STRING_VIEW\ntemplate <typename CharT, class Traits>\nstruct type_caster<std::basic_string_view<CharT, Traits>,\n                   enable_if_t<is_std_char_type<CharT>::value>>\n    : string_caster<std::basic_string_view<CharT, Traits>, true> {};\n#endif\n\n// Type caster for C-style strings.  We basically use a std::string type caster, but also add the\n// ability to use None as a nullptr char* (which the string caster doesn't allow).\ntemplate <typename CharT>\nstruct type_caster<CharT, enable_if_t<is_std_char_type<CharT>::value>> {\n    using StringType = std::basic_string<CharT>;\n    using StringCaster = make_caster<StringType>;\n    StringCaster str_caster;\n    bool none = false;\n    CharT one_char = 0;\n\npublic:\n    bool load(handle src, bool convert) {\n        if (!src) {\n            return false;\n        }\n        if (src.is_none()) {\n            // Defer accepting None to other overloads (if we aren't in convert mode):\n            if (!convert) {\n                return false;\n            }\n            none = true;\n            return true;\n        }\n        return str_caster.load(src, convert);\n    }\n\n    static handle cast(const CharT *src, return_value_policy policy, handle parent) {\n        if (src == nullptr) {\n            return pybind11::none().release();\n        }\n        return StringCaster::cast(StringType(src), policy, parent);\n    }\n\n    static handle cast(CharT src, return_value_policy policy, handle parent) {\n        if (std::is_same<char, CharT>::value) {\n            handle s = PyUnicode_DecodeLatin1((const char *) &src, 1, nullptr);\n            if (!s) {\n                throw error_already_set();\n            }\n            return s;\n        }\n        return StringCaster::cast(StringType(1, src), policy, parent);\n    }\n\n    explicit operator CharT *() {\n        return none ? nullptr : const_cast<CharT *>(static_cast<StringType &>(str_caster).c_str());\n    }\n    explicit operator CharT &() {\n        if (none) {\n            throw value_error(\"Cannot convert None to a character\");\n        }\n\n        auto &value = static_cast<StringType &>(str_caster);\n        size_t str_len = value.size();\n        if (str_len == 0) {\n            throw value_error(\"Cannot convert empty string to a character\");\n        }\n\n        // If we're in UTF-8 mode, we have two possible failures: one for a unicode character that\n        // is too high, and one for multiple unicode characters (caught later), so we need to\n        // figure out how long the first encoded character is in bytes to distinguish between these\n        // two errors.  We also allow want to allow unicode characters U+0080 through U+00FF, as\n        // those can fit into a single char value.\n        if (StringCaster::UTF_N == 8 && str_len > 1 && str_len <= 4) {\n            auto v0 = static_cast<unsigned char>(value[0]);\n            // low bits only: 0-127\n            // 0b110xxxxx - start of 2-byte sequence\n            // 0b1110xxxx - start of 3-byte sequence\n            // 0b11110xxx - start of 4-byte sequence\n            size_t char0_bytes = (v0 & 0x80) == 0      ? 1\n                                 : (v0 & 0xE0) == 0xC0 ? 2\n                                 : (v0 & 0xF0) == 0xE0 ? 3\n                                                       : 4;\n\n            if (char0_bytes == str_len) {\n                // If we have a 128-255 value, we can decode it into a single char:\n                if (char0_bytes == 2 && (v0 & 0xFC) == 0xC0) { // 0x110000xx 0x10xxxxxx\n                    one_char = static_cast<CharT>(((v0 & 3) << 6)\n                                                  + (static_cast<unsigned char>(value[1]) & 0x3F));\n                    return one_char;\n                }\n                // Otherwise we have a single character, but it's > U+00FF\n                throw value_error(\"Character code point not in range(0x100)\");\n            }\n        }\n\n        // UTF-16 is much easier: we can only have a surrogate pair for values above U+FFFF, thus a\n        // surrogate pair with total length 2 instantly indicates a range error (but not a \"your\n        // string was too long\" error).\n        else if (StringCaster::UTF_N == 16 && str_len == 2) {\n            one_char = static_cast<CharT>(value[0]);\n            if (one_char >= 0xD800 && one_char < 0xE000) {\n                throw value_error(\"Character code point not in range(0x10000)\");\n            }\n        }\n\n        if (str_len != 1) {\n            throw value_error(\"Expected a character, but multi-character string found\");\n        }\n\n        one_char = value[0];\n        return one_char;\n    }\n\n    static constexpr auto name = const_name(PYBIND11_STRING_NAME);\n    template <typename _T>\n    using cast_op_type = pybind11::detail::cast_op_type<_T>;\n};\n\n// Base implementation for std::tuple and std::pair\ntemplate <template <typename...> class Tuple, typename... Ts>\nclass tuple_caster {\n    using type = Tuple<Ts...>;\n    static constexpr auto size = sizeof...(Ts);\n    using indices = make_index_sequence<size>;\n\npublic:\n    bool load(handle src, bool convert) {\n        if (!isinstance<sequence>(src)) {\n            return false;\n        }\n        const auto seq = reinterpret_borrow<sequence>(src);\n        if (seq.size() != size) {\n            return false;\n        }\n        return load_impl(seq, convert, indices{});\n    }\n\n    template <typename T>\n    static handle cast(T &&src, return_value_policy policy, handle parent) {\n        return cast_impl(std::forward<T>(src), policy, parent, indices{});\n    }\n\n    // copied from the PYBIND11_TYPE_CASTER macro\n    template <typename T>\n    static handle cast(T *src, return_value_policy policy, handle parent) {\n        if (!src) {\n            return none().release();\n        }\n        if (policy == return_value_policy::take_ownership) {\n            auto h = cast(std::move(*src), policy, parent);\n            delete src;\n            return h;\n        }\n        return cast(*src, policy, parent);\n    }\n\n    static constexpr auto name\n        = const_name(\"Tuple[\") + concat(make_caster<Ts>::name...) + const_name(\"]\");\n\n    template <typename T>\n    using cast_op_type = type;\n\n    explicit operator type() & { return implicit_cast(indices{}); }\n    explicit operator type() && { return std::move(*this).implicit_cast(indices{}); }\n\nprotected:\n    template <size_t... Is>\n    type implicit_cast(index_sequence<Is...>) & {\n        return type(cast_op<Ts>(std::get<Is>(subcasters))...);\n    }\n    template <size_t... Is>\n    type implicit_cast(index_sequence<Is...>) && {\n        return type(cast_op<Ts>(std::move(std::get<Is>(subcasters)))...);\n    }\n\n    static constexpr bool load_impl(const sequence &, bool, index_sequence<>) { return true; }\n\n    template <size_t... Is>\n    bool load_impl(const sequence &seq, bool convert, index_sequence<Is...>) {\n#ifdef __cpp_fold_expressions\n        if ((... || !std::get<Is>(subcasters).load(seq[Is], convert))) {\n            return false;\n        }\n#else\n        for (bool r : {std::get<Is>(subcasters).load(seq[Is], convert)...}) {\n            if (!r) {\n                return false;\n            }\n        }\n#endif\n        return true;\n    }\n\n    /* Implementation: Convert a C++ tuple into a Python tuple */\n    template <typename T, size_t... Is>\n    static handle\n    cast_impl(T &&src, return_value_policy policy, handle parent, index_sequence<Is...>) {\n        PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(src, policy, parent);\n        PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(policy, parent);\n        std::array<object, size> entries{{reinterpret_steal<object>(\n            make_caster<Ts>::cast(std::get<Is>(std::forward<T>(src)), policy, parent))...}};\n        for (const auto &entry : entries) {\n            if (!entry) {\n                return handle();\n            }\n        }\n        tuple result(size);\n        int counter = 0;\n        for (auto &entry : entries) {\n            PyTuple_SET_ITEM(result.ptr(), counter++, entry.release().ptr());\n        }\n        return result.release();\n    }\n\n    Tuple<make_caster<Ts>...> subcasters;\n};\n\ntemplate <typename T1, typename T2>\nclass type_caster<std::pair<T1, T2>> : public tuple_caster<std::pair, T1, T2> {};\n\ntemplate <typename... Ts>\nclass type_caster<std::tuple<Ts...>> : public tuple_caster<std::tuple, Ts...> {};\n\n/// Helper class which abstracts away certain actions. Users can provide specializations for\n/// custom holders, but it's only necessary if the type has a non-standard interface.\ntemplate <typename T>\nstruct holder_helper {\n    static auto get(const T &p) -> decltype(p.get()) { return p.get(); }\n};\n\n/// Type caster for holder types like std::shared_ptr, etc.\n/// The SFINAE hook is provided to help work around the current lack of support\n/// for smart-pointer interoperability. Please consider it an implementation\n/// detail that may change in the future, as formal support for smart-pointer\n/// interoperability is added into pybind11.\ntemplate <typename type, typename holder_type, typename SFINAE = void>\nstruct copyable_holder_caster : public type_caster_base<type> {\npublic:\n    using base = type_caster_base<type>;\n    static_assert(std::is_base_of<base, type_caster<type>>::value,\n                  \"Holder classes are only supported for custom types\");\n    using base::base;\n    using base::cast;\n    using base::typeinfo;\n    using base::value;\n\n    bool load(handle src, bool convert) {\n        return base::template load_impl<copyable_holder_caster<type, holder_type>>(src, convert);\n    }\n\n    explicit operator type *() { return this->value; }\n    // static_cast works around compiler error with MSVC 17 and CUDA 10.2\n    // see issue #2180\n    explicit operator type &() { return *(static_cast<type *>(this->value)); }\n    explicit operator holder_type *() { return std::addressof(holder); }\n    explicit operator holder_type &() { return holder; }\n\n    static handle cast(const holder_type &src, return_value_policy, handle) {\n        const auto *ptr = holder_helper<holder_type>::get(src);\n        return type_caster_base<type>::cast_holder(ptr, &src);\n    }\n\nprotected:\n    friend class type_caster_generic;\n    void check_holder_compat() {\n        if (typeinfo->default_holder) {\n            throw cast_error(\"Unable to load a custom holder type from a default-holder instance\");\n        }\n    }\n\n    bool load_value(value_and_holder &&v_h) {\n        if (v_h.holder_constructed()) {\n            value = v_h.value_ptr();\n            holder = v_h.template holder<holder_type>();\n            return true;\n        }\n        throw cast_error(\"Unable to cast from non-held to held instance (T& to Holder<T>) \"\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n                         \"(#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for \"\n                         \"type information)\");\n#else\n                         \"of type '\"\n                         + type_id<holder_type>() + \"''\");\n#endif\n    }\n\n    template <typename T = holder_type,\n              detail::enable_if_t<!std::is_constructible<T, const T &, type *>::value, int> = 0>\n    bool try_implicit_casts(handle, bool) {\n        return false;\n    }\n\n    template <typename T = holder_type,\n              detail::enable_if_t<std::is_constructible<T, const T &, type *>::value, int> = 0>\n    bool try_implicit_casts(handle src, bool convert) {\n        for (auto &cast : typeinfo->implicit_casts) {\n            copyable_holder_caster sub_caster(*cast.first);\n            if (sub_caster.load(src, convert)) {\n                value = cast.second(sub_caster.value);\n                holder = holder_type(sub_caster.holder, (type *) value);\n                return true;\n            }\n        }\n        return false;\n    }\n\n    static bool try_direct_conversions(handle) { return false; }\n\n    holder_type holder;\n};\n\n/// Specialize for the common std::shared_ptr, so users don't need to\ntemplate <typename T>\nclass type_caster<std::shared_ptr<T>> : public copyable_holder_caster<T, std::shared_ptr<T>> {};\n\n/// Type caster for holder types like std::unique_ptr.\n/// Please consider the SFINAE hook an implementation detail, as explained\n/// in the comment for the copyable_holder_caster.\ntemplate <typename type, typename holder_type, typename SFINAE = void>\nstruct move_only_holder_caster {\n    static_assert(std::is_base_of<type_caster_base<type>, type_caster<type>>::value,\n                  \"Holder classes are only supported for custom types\");\n\n    static handle cast(holder_type &&src, return_value_policy, handle) {\n        auto *ptr = holder_helper<holder_type>::get(src);\n        return type_caster_base<type>::cast_holder(ptr, std::addressof(src));\n    }\n    static constexpr auto name = type_caster_base<type>::name;\n};\n\ntemplate <typename type, typename deleter>\nclass type_caster<std::unique_ptr<type, deleter>>\n    : public move_only_holder_caster<type, std::unique_ptr<type, deleter>> {};\n\ntemplate <typename type, typename holder_type>\nusing type_caster_holder = conditional_t<is_copy_constructible<holder_type>::value,\n                                         copyable_holder_caster<type, holder_type>,\n                                         move_only_holder_caster<type, holder_type>>;\n\ntemplate <typename T, bool Value = false>\nstruct always_construct_holder {\n    static constexpr bool value = Value;\n};\n\n/// Create a specialization for custom holder types (silently ignores std::shared_ptr)\n#define PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...)                                      \\\n    PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)                                                  \\\n    namespace detail {                                                                            \\\n    template <typename type>                                                                      \\\n    struct always_construct_holder<holder_type> : always_construct_holder<void, ##__VA_ARGS__> {  \\\n    };                                                                                            \\\n    template <typename type>                                                                      \\\n    class type_caster<holder_type, enable_if_t<!is_shared_ptr<holder_type>::value>>               \\\n        : public type_caster_holder<type, holder_type> {};                                        \\\n    }                                                                                             \\\n    PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n\n// PYBIND11_DECLARE_HOLDER_TYPE holder types:\ntemplate <typename base, typename holder>\nstruct is_holder_type\n    : std::is_base_of<detail::type_caster_holder<base, holder>, detail::type_caster<holder>> {};\n// Specialization for always-supported unique_ptr holders:\ntemplate <typename base, typename deleter>\nstruct is_holder_type<base, std::unique_ptr<base, deleter>> : std::true_type {};\n\ntemplate <typename T>\nstruct handle_type_name {\n    static constexpr auto name = const_name<T>();\n};\ntemplate <>\nstruct handle_type_name<bool_> {\n    static constexpr auto name = const_name(\"bool\");\n};\ntemplate <>\nstruct handle_type_name<bytes> {\n    static constexpr auto name = const_name(PYBIND11_BYTES_NAME);\n};\ntemplate <>\nstruct handle_type_name<int_> {\n    static constexpr auto name = const_name(\"int\");\n};\ntemplate <>\nstruct handle_type_name<iterable> {\n    static constexpr auto name = const_name(\"Iterable\");\n};\ntemplate <>\nstruct handle_type_name<iterator> {\n    static constexpr auto name = const_name(\"Iterator\");\n};\ntemplate <>\nstruct handle_type_name<float_> {\n    static constexpr auto name = const_name(\"float\");\n};\ntemplate <>\nstruct handle_type_name<none> {\n    static constexpr auto name = const_name(\"None\");\n};\ntemplate <>\nstruct handle_type_name<args> {\n    static constexpr auto name = const_name(\"*args\");\n};\ntemplate <>\nstruct handle_type_name<kwargs> {\n    static constexpr auto name = const_name(\"**kwargs\");\n};\n\ntemplate <typename type>\nstruct pyobject_caster {\n    template <typename T = type, enable_if_t<std::is_same<T, handle>::value, int> = 0>\n    pyobject_caster() : value() {}\n\n    // `type` may not be default constructible (e.g. frozenset, anyset).  Initializing `value`\n    // to a nil handle is safe since it will only be accessed if `load` succeeds.\n    template <typename T = type, enable_if_t<std::is_base_of<object, T>::value, int> = 0>\n    pyobject_caster() : value(reinterpret_steal<type>(handle())) {}\n\n    template <typename T = type, enable_if_t<std::is_same<T, handle>::value, int> = 0>\n    bool load(handle src, bool /* convert */) {\n        value = src;\n        return static_cast<bool>(value);\n    }\n\n    template <typename T = type, enable_if_t<std::is_base_of<object, T>::value, int> = 0>\n    bool load(handle src, bool /* convert */) {\n        if (!isinstance<type>(src)) {\n            return false;\n        }\n        value = reinterpret_borrow<type>(src);\n        return true;\n    }\n\n    static handle cast(const handle &src, return_value_policy /* policy */, handle /* parent */) {\n        return src.inc_ref();\n    }\n    PYBIND11_TYPE_CASTER(type, handle_type_name<type>::name);\n};\n\ntemplate <typename T>\nclass type_caster<T, enable_if_t<is_pyobject<T>::value>> : public pyobject_caster<T> {};\n\n// Our conditions for enabling moving are quite restrictive:\n// At compile time:\n// - T needs to be a non-const, non-pointer, non-reference type\n// - type_caster<T>::operator T&() must exist\n// - the type must be move constructible (obviously)\n// At run-time:\n// - if the type is non-copy-constructible, the object must be the sole owner of the type (i.e. it\n//   must have ref_count() == 1)h\n// If any of the above are not satisfied, we fall back to copying.\ntemplate <typename T>\nusing move_is_plain_type\n    = satisfies_none_of<T, std::is_void, std::is_pointer, std::is_reference, std::is_const>;\ntemplate <typename T, typename SFINAE = void>\nstruct move_always : std::false_type {};\ntemplate <typename T>\nstruct move_always<\n    T,\n    enable_if_t<\n        all_of<move_is_plain_type<T>,\n               negation<is_copy_constructible<T>>,\n               std::is_move_constructible<T>,\n               std::is_same<decltype(std::declval<make_caster<T>>().operator T &()), T &>>::value>>\n    : std::true_type {};\ntemplate <typename T, typename SFINAE = void>\nstruct move_if_unreferenced : std::false_type {};\ntemplate <typename T>\nstruct move_if_unreferenced<\n    T,\n    enable_if_t<\n        all_of<move_is_plain_type<T>,\n               negation<move_always<T>>,\n               std::is_move_constructible<T>,\n               std::is_same<decltype(std::declval<make_caster<T>>().operator T &()), T &>>::value>>\n    : std::true_type {};\ntemplate <typename T>\nusing move_never = none_of<move_always<T>, move_if_unreferenced<T>>;\n\n// Detect whether returning a `type` from a cast on type's type_caster is going to result in a\n// reference or pointer to a local variable of the type_caster.  Basically, only\n// non-reference/pointer `type`s and reference/pointers from a type_caster_generic are safe;\n// everything else returns a reference/pointer to a local variable.\ntemplate <typename type>\nusing cast_is_temporary_value_reference\n    = bool_constant<(std::is_reference<type>::value || std::is_pointer<type>::value)\n                    && !std::is_base_of<type_caster_generic, make_caster<type>>::value\n                    && !std::is_same<intrinsic_t<type>, void>::value>;\n\n// When a value returned from a C++ function is being cast back to Python, we almost always want to\n// force `policy = move`, regardless of the return value policy the function/method was declared\n// with.\ntemplate <typename Return, typename SFINAE = void>\nstruct return_value_policy_override {\n    static return_value_policy policy(return_value_policy p) { return p; }\n};\n\ntemplate <typename Return>\nstruct return_value_policy_override<\n    Return,\n    detail::enable_if_t<std::is_base_of<type_caster_generic, make_caster<Return>>::value, void>> {\n    static return_value_policy policy(return_value_policy p) {\n        return !std::is_lvalue_reference<Return>::value && !std::is_pointer<Return>::value\n                   ? return_value_policy::move\n                   : p;\n    }\n};\n\n// Basic python -> C++ casting; throws if casting fails\ntemplate <typename T, typename SFINAE>\ntype_caster<T, SFINAE> &load_type(type_caster<T, SFINAE> &conv, const handle &handle) {\n    static_assert(!detail::is_pyobject<T>::value,\n                  \"Internal error: type_caster should only be used for C++ types\");\n    if (!conv.load(handle, true)) {\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n        throw cast_error(\"Unable to cast Python instance to C++ type (#define \"\n                         \"PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)\");\n#else\n        throw cast_error(\"Unable to cast Python instance of type \"\n                         + (std::string) str(type::handle_of(handle)) + \" to C++ type '\"\n                         + type_id<T>() + \"'\");\n#endif\n    }\n    return conv;\n}\n// Wrapper around the above that also constructs and returns a type_caster\ntemplate <typename T>\nmake_caster<T> load_type(const handle &handle) {\n    make_caster<T> conv;\n    load_type(conv, handle);\n    return conv;\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n// pytype -> C++ type\ntemplate <typename T, detail::enable_if_t<!detail::is_pyobject<T>::value, int> = 0>\nT cast(const handle &handle) {\n    using namespace detail;\n    static_assert(!cast_is_temporary_value_reference<T>::value,\n                  \"Unable to cast type to reference: value is local to type caster\");\n    return cast_op<T>(load_type<T>(handle));\n}\n\n// pytype -> pytype (calls converting constructor)\ntemplate <typename T, detail::enable_if_t<detail::is_pyobject<T>::value, int> = 0>\nT cast(const handle &handle) {\n    return T(reinterpret_borrow<object>(handle));\n}\n\n// C++ type -> py::object\ntemplate <typename T, detail::enable_if_t<!detail::is_pyobject<T>::value, int> = 0>\nobject cast(T &&value,\n            return_value_policy policy = return_value_policy::automatic_reference,\n            handle parent = handle()) {\n    using no_ref_T = typename std::remove_reference<T>::type;\n    if (policy == return_value_policy::automatic) {\n        policy = std::is_pointer<no_ref_T>::value     ? return_value_policy::take_ownership\n                 : std::is_lvalue_reference<T>::value ? return_value_policy::copy\n                                                      : return_value_policy::move;\n    } else if (policy == return_value_policy::automatic_reference) {\n        policy = std::is_pointer<no_ref_T>::value     ? return_value_policy::reference\n                 : std::is_lvalue_reference<T>::value ? return_value_policy::copy\n                                                      : return_value_policy::move;\n    }\n    return reinterpret_steal<object>(\n        detail::make_caster<T>::cast(std::forward<T>(value), policy, parent));\n}\n\ntemplate <typename T>\nT handle::cast() const {\n    return pybind11::cast<T>(*this);\n}\ntemplate <>\ninline void handle::cast() const {\n    return;\n}\n\ntemplate <typename T>\ndetail::enable_if_t<!detail::move_never<T>::value, T> move(object &&obj) {\n    if (obj.ref_count() > 1) {\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n        throw cast_error(\n            \"Unable to cast Python instance to C++ rvalue: instance has multiple references\"\n            \" (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)\");\n#else\n        throw cast_error(\"Unable to move from Python \" + (std::string) str(type::handle_of(obj))\n                         + \" instance to C++ \" + type_id<T>()\n                         + \" instance: instance has multiple references\");\n#endif\n    }\n\n    // Move into a temporary and return that, because the reference may be a local value of `conv`\n    T ret = std::move(detail::load_type<T>(obj).operator T &());\n    return ret;\n}\n\n// Calling cast() on an rvalue calls pybind11::cast with the object rvalue, which does:\n// - If we have to move (because T has no copy constructor), do it.  This will fail if the moved\n//   object has multiple references, but trying to copy will fail to compile.\n// - If both movable and copyable, check ref count: if 1, move; otherwise copy\n// - Otherwise (not movable), copy.\ntemplate <typename T>\ndetail::enable_if_t<!detail::is_pyobject<T>::value && detail::move_always<T>::value, T>\ncast(object &&object) {\n    return move<T>(std::move(object));\n}\ntemplate <typename T>\ndetail::enable_if_t<!detail::is_pyobject<T>::value && detail::move_if_unreferenced<T>::value, T>\ncast(object &&object) {\n    if (object.ref_count() > 1) {\n        return cast<T>(object);\n    }\n    return move<T>(std::move(object));\n}\ntemplate <typename T>\ndetail::enable_if_t<!detail::is_pyobject<T>::value && detail::move_never<T>::value, T>\ncast(object &&object) {\n    return cast<T>(object);\n}\n\n// pytype rvalue -> pytype (calls converting constructor)\ntemplate <typename T>\ndetail::enable_if_t<detail::is_pyobject<T>::value, T> cast(object &&object) {\n    return T(std::move(object));\n}\n\ntemplate <typename T>\nT object::cast() const & {\n    return pybind11::cast<T>(*this);\n}\ntemplate <typename T>\nT object::cast() && {\n    return pybind11::cast<T>(std::move(*this));\n}\ntemplate <>\ninline void object::cast() const & {\n    return;\n}\ntemplate <>\ninline void object::cast() && {\n    return;\n}\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n// Declared in pytypes.h:\ntemplate <typename T, enable_if_t<!is_pyobject<T>::value, int>>\nobject object_or_cast(T &&o) {\n    return pybind11::cast(std::forward<T>(o));\n}\n\n// Placeholder type for the unneeded (and dead code) static variable in the\n// PYBIND11_OVERRIDE_OVERRIDE macro\nstruct override_unused {};\ntemplate <typename ret_type>\nusing override_caster_t = conditional_t<cast_is_temporary_value_reference<ret_type>::value,\n                                        make_caster<ret_type>,\n                                        override_unused>;\n\n// Trampoline use: for reference/pointer types to value-converted values, we do a value cast, then\n// store the result in the given variable.  For other types, this is a no-op.\ntemplate <typename T>\nenable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&o,\n                                                                     make_caster<T> &caster) {\n    return cast_op<T>(load_type(caster, o));\n}\ntemplate <typename T>\nenable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&,\n                                                                      override_unused &) {\n    pybind11_fail(\"Internal error: cast_ref fallback invoked\");\n}\n\n// Trampoline use: Having a pybind11::cast with an invalid reference type is going to\n// static_assert, even though if it's in dead code, so we provide a \"trampoline\" to pybind11::cast\n// that only does anything in cases where pybind11::cast is valid.\ntemplate <typename T>\nenable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_safe(object &&) {\n    pybind11_fail(\"Internal error: cast_safe fallback invoked\");\n}\ntemplate <typename T>\nenable_if_t<std::is_void<T>::value, void> cast_safe(object &&) {}\ntemplate <typename T>\nenable_if_t<detail::none_of<cast_is_temporary_value_reference<T>, std::is_void<T>>::value, T>\ncast_safe(object &&o) {\n    return pybind11::cast<T>(std::move(o));\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n// The overloads could coexist, i.e. the #if is not strictly speaking needed,\n// but it is an easy minor optimization.\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\ninline cast_error cast_error_unable_to_convert_call_arg() {\n    return cast_error(\"Unable to convert call argument to Python object (#define \"\n                      \"PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)\");\n}\n#else\ninline cast_error cast_error_unable_to_convert_call_arg(const std::string &name,\n                                                        const std::string &type) {\n    return cast_error(\"Unable to convert call argument '\" + name + \"' of type '\" + type\n                      + \"' to Python object\");\n}\n#endif\n\ntemplate <return_value_policy policy = return_value_policy::automatic_reference>\ntuple make_tuple() {\n    return tuple(0);\n}\n\ntemplate <return_value_policy policy = return_value_policy::automatic_reference, typename... Args>\ntuple make_tuple(Args &&...args_) {\n    constexpr size_t size = sizeof...(Args);\n    std::array<object, size> args{{reinterpret_steal<object>(\n        detail::make_caster<Args>::cast(std::forward<Args>(args_), policy, nullptr))...}};\n    for (size_t i = 0; i < args.size(); i++) {\n        if (!args[i]) {\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n            throw cast_error_unable_to_convert_call_arg();\n#else\n            std::array<std::string, size> argtypes{{type_id<Args>()...}};\n            throw cast_error_unable_to_convert_call_arg(std::to_string(i), argtypes[i]);\n#endif\n        }\n    }\n    tuple result(size);\n    int counter = 0;\n    for (auto &arg_value : args) {\n        PyTuple_SET_ITEM(result.ptr(), counter++, arg_value.release().ptr());\n    }\n    return result;\n}\n\n/// \\ingroup annotations\n/// Annotation for arguments\nstruct arg {\n    /// Constructs an argument with the name of the argument; if null or omitted, this is a\n    /// positional argument.\n    constexpr explicit arg(const char *name = nullptr)\n        : name(name), flag_noconvert(false), flag_none(true) {}\n    /// Assign a value to this argument\n    template <typename T>\n    arg_v operator=(T &&value) const;\n    /// Indicate that the type should not be converted in the type caster\n    arg &noconvert(bool flag = true) {\n        flag_noconvert = flag;\n        return *this;\n    }\n    /// Indicates that the argument should/shouldn't allow None (e.g. for nullable pointer args)\n    arg &none(bool flag = true) {\n        flag_none = flag;\n        return *this;\n    }\n\n    const char *name;        ///< If non-null, this is a named kwargs argument\n    bool flag_noconvert : 1; ///< If set, do not allow conversion (requires a supporting type\n                             ///< caster!)\n    bool flag_none : 1;      ///< If set (the default), allow None to be passed to this argument\n};\n\n/// \\ingroup annotations\n/// Annotation for arguments with values\nstruct arg_v : arg {\nprivate:\n    template <typename T>\n    arg_v(arg &&base, T &&x, const char *descr = nullptr)\n        : arg(base), value(reinterpret_steal<object>(detail::make_caster<T>::cast(\n                         std::forward<T>(x), return_value_policy::automatic, {}))),\n          descr(descr)\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n          ,\n          type(type_id<T>())\n#endif\n    {\n        // Workaround! See:\n        // https://github.com/pybind/pybind11/issues/2336\n        // https://github.com/pybind/pybind11/pull/2685#issuecomment-731286700\n        if (PyErr_Occurred()) {\n            PyErr_Clear();\n        }\n    }\n\npublic:\n    /// Direct construction with name, default, and description\n    template <typename T>\n    arg_v(const char *name, T &&x, const char *descr = nullptr)\n        : arg_v(arg(name), std::forward<T>(x), descr) {}\n\n    /// Called internally when invoking `py::arg(\"a\") = value`\n    template <typename T>\n    arg_v(const arg &base, T &&x, const char *descr = nullptr)\n        : arg_v(arg(base), std::forward<T>(x), descr) {}\n\n    /// Same as `arg::noconvert()`, but returns *this as arg_v&, not arg&\n    arg_v &noconvert(bool flag = true) {\n        arg::noconvert(flag);\n        return *this;\n    }\n\n    /// Same as `arg::nonone()`, but returns *this as arg_v&, not arg&\n    arg_v &none(bool flag = true) {\n        arg::none(flag);\n        return *this;\n    }\n\n    /// The default value\n    object value;\n    /// The (optional) description of the default value\n    const char *descr;\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n    /// The C++ type name of the default value (only available when compiled in debug mode)\n    std::string type;\n#endif\n};\n\n/// \\ingroup annotations\n/// Annotation indicating that all following arguments are keyword-only; the is the equivalent of\n/// an unnamed '*' argument\nstruct kw_only {};\n\n/// \\ingroup annotations\n/// Annotation indicating that all previous arguments are positional-only; the is the equivalent of\n/// an unnamed '/' argument (in Python 3.8)\nstruct pos_only {};\n\ntemplate <typename T>\narg_v arg::operator=(T &&value) const {\n    return {*this, std::forward<T>(value)};\n}\n\n/// Alias for backward compatibility -- to be removed in version 2.0\ntemplate <typename /*unused*/>\nusing arg_t = arg_v;\n\ninline namespace literals {\n/** \\rst\n    String literal version of `arg`\n \\endrst */\nconstexpr arg operator\"\" _a(const char *name, size_t) { return arg(name); }\n} // namespace literals\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ntemplate <typename T>\nusing is_kw_only = std::is_same<intrinsic_t<T>, kw_only>;\ntemplate <typename T>\nusing is_pos_only = std::is_same<intrinsic_t<T>, pos_only>;\n\n// forward declaration (definition in attr.h)\nstruct function_record;\n\n/// Internal data associated with a single function call\nstruct function_call {\n    function_call(const function_record &f, handle p); // Implementation in attr.h\n\n    /// The function data:\n    const function_record &func;\n\n    /// Arguments passed to the function:\n    std::vector<handle> args;\n\n    /// The `convert` value the arguments should be loaded with\n    std::vector<bool> args_convert;\n\n    /// Extra references for the optional `py::args` and/or `py::kwargs` arguments (which, if\n    /// present, are also in `args` but without a reference).\n    object args_ref, kwargs_ref;\n\n    /// The parent, if any\n    handle parent;\n\n    /// If this is a call to an initializer, this argument contains `self`\n    handle init_self;\n};\n\n/// Helper class which loads arguments for C++ functions called from Python\ntemplate <typename... Args>\nclass argument_loader {\n    using indices = make_index_sequence<sizeof...(Args)>;\n\n    template <typename Arg>\n    using argument_is_args = std::is_same<intrinsic_t<Arg>, args>;\n    template <typename Arg>\n    using argument_is_kwargs = std::is_same<intrinsic_t<Arg>, kwargs>;\n    // Get kwargs argument position, or -1 if not present:\n    static constexpr auto kwargs_pos = constexpr_last<argument_is_kwargs, Args...>();\n\n    static_assert(kwargs_pos == -1 || kwargs_pos == (int) sizeof...(Args) - 1,\n                  \"py::kwargs is only permitted as the last argument of a function\");\n\npublic:\n    static constexpr bool has_kwargs = kwargs_pos != -1;\n\n    // py::args argument position; -1 if not present.\n    static constexpr int args_pos = constexpr_last<argument_is_args, Args...>();\n\n    static_assert(args_pos == -1 || args_pos == constexpr_first<argument_is_args, Args...>(),\n                  \"py::args cannot be specified more than once\");\n\n    static constexpr auto arg_names = concat(type_descr(make_caster<Args>::name)...);\n\n    bool load_args(function_call &call) { return load_impl_sequence(call, indices{}); }\n\n    template <typename Return, typename Guard, typename Func>\n    // NOLINTNEXTLINE(readability-const-return-type)\n    enable_if_t<!std::is_void<Return>::value, Return> call(Func &&f) && {\n        return std::move(*this).template call_impl<remove_cv_t<Return>>(\n            std::forward<Func>(f), indices{}, Guard{});\n    }\n\n    template <typename Return, typename Guard, typename Func>\n    enable_if_t<std::is_void<Return>::value, void_type> call(Func &&f) && {\n        std::move(*this).template call_impl<remove_cv_t<Return>>(\n            std::forward<Func>(f), indices{}, Guard{});\n        return void_type();\n    }\n\nprivate:\n    static bool load_impl_sequence(function_call &, index_sequence<>) { return true; }\n\n    template <size_t... Is>\n    bool load_impl_sequence(function_call &call, index_sequence<Is...>) {\n#ifdef __cpp_fold_expressions\n        if ((... || !std::get<Is>(argcasters).load(call.args[Is], call.args_convert[Is]))) {\n            return false;\n        }\n#else\n        for (bool r : {std::get<Is>(argcasters).load(call.args[Is], call.args_convert[Is])...}) {\n            if (!r) {\n                return false;\n            }\n        }\n#endif\n        return true;\n    }\n\n    template <typename Return, typename Func, size_t... Is, typename Guard>\n    Return call_impl(Func &&f, index_sequence<Is...>, Guard &&) && {\n        return std::forward<Func>(f)(cast_op<Args>(std::move(std::get<Is>(argcasters)))...);\n    }\n\n    std::tuple<make_caster<Args>...> argcasters;\n};\n\n/// Helper class which collects only positional arguments for a Python function call.\n/// A fancier version below can collect any argument, but this one is optimal for simple calls.\ntemplate <return_value_policy policy>\nclass simple_collector {\npublic:\n    template <typename... Ts>\n    explicit simple_collector(Ts &&...values)\n        : m_args(pybind11::make_tuple<policy>(std::forward<Ts>(values)...)) {}\n\n    const tuple &args() const & { return m_args; }\n    dict kwargs() const { return {}; }\n\n    tuple args() && { return std::move(m_args); }\n\n    /// Call a Python function and pass the collected arguments\n    object call(PyObject *ptr) const {\n        PyObject *result = PyObject_CallObject(ptr, m_args.ptr());\n        if (!result) {\n            throw error_already_set();\n        }\n        return reinterpret_steal<object>(result);\n    }\n\nprivate:\n    tuple m_args;\n};\n\n/// Helper class which collects positional, keyword, * and ** arguments for a Python function call\ntemplate <return_value_policy policy>\nclass unpacking_collector {\npublic:\n    template <typename... Ts>\n    explicit unpacking_collector(Ts &&...values) {\n        // Tuples aren't (easily) resizable so a list is needed for collection,\n        // but the actual function call strictly requires a tuple.\n        auto args_list = list();\n        using expander = int[];\n        (void) expander{0, (process(args_list, std::forward<Ts>(values)), 0)...};\n\n        m_args = std::move(args_list);\n    }\n\n    const tuple &args() const & { return m_args; }\n    const dict &kwargs() const & { return m_kwargs; }\n\n    tuple args() && { return std::move(m_args); }\n    dict kwargs() && { return std::move(m_kwargs); }\n\n    /// Call a Python function and pass the collected arguments\n    object call(PyObject *ptr) const {\n        PyObject *result = PyObject_Call(ptr, m_args.ptr(), m_kwargs.ptr());\n        if (!result) {\n            throw error_already_set();\n        }\n        return reinterpret_steal<object>(result);\n    }\n\nprivate:\n    template <typename T>\n    void process(list &args_list, T &&x) {\n        auto o = reinterpret_steal<object>(\n            detail::make_caster<T>::cast(std::forward<T>(x), policy, {}));\n        if (!o) {\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n            throw cast_error_unable_to_convert_call_arg();\n#else\n            throw cast_error_unable_to_convert_call_arg(std::to_string(args_list.size()),\n                                                        type_id<T>());\n#endif\n        }\n        args_list.append(std::move(o));\n    }\n\n    void process(list &args_list, detail::args_proxy ap) {\n        for (auto a : ap) {\n            args_list.append(a);\n        }\n    }\n\n    void process(list & /*args_list*/, arg_v a) {\n        if (!a.name) {\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n            nameless_argument_error();\n#else\n            nameless_argument_error(a.type);\n#endif\n        }\n        if (m_kwargs.contains(a.name)) {\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n            multiple_values_error();\n#else\n            multiple_values_error(a.name);\n#endif\n        }\n        if (!a.value) {\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n            throw cast_error_unable_to_convert_call_arg();\n#else\n            throw cast_error_unable_to_convert_call_arg(a.name, a.type);\n#endif\n        }\n        m_kwargs[a.name] = std::move(a.value);\n    }\n\n    void process(list & /*args_list*/, detail::kwargs_proxy kp) {\n        if (!kp) {\n            return;\n        }\n        for (auto k : reinterpret_borrow<dict>(kp)) {\n            if (m_kwargs.contains(k.first)) {\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n                multiple_values_error();\n#else\n                multiple_values_error(str(k.first));\n#endif\n            }\n            m_kwargs[k.first] = k.second;\n        }\n    }\n\n    [[noreturn]] static void nameless_argument_error() {\n        throw type_error(\n            \"Got kwargs without a name; only named arguments \"\n            \"may be passed via py::arg() to a python function call. \"\n            \"(#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)\");\n    }\n    [[noreturn]] static void nameless_argument_error(const std::string &type) {\n        throw type_error(\"Got kwargs without a name of type '\" + type\n                         + \"'; only named \"\n                           \"arguments may be passed via py::arg() to a python function call. \");\n    }\n    [[noreturn]] static void multiple_values_error() {\n        throw type_error(\n            \"Got multiple values for keyword argument \"\n            \"(#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)\");\n    }\n\n    [[noreturn]] static void multiple_values_error(const std::string &name) {\n        throw type_error(\"Got multiple values for keyword argument '\" + name + \"'\");\n    }\n\nprivate:\n    tuple m_args;\n    dict m_kwargs;\n};\n\n// [workaround(intel)] Separate function required here\n// We need to put this into a separate function because the Intel compiler\n// fails to compile enable_if_t<!all_of<is_positional<Args>...>::value>\n// (tested with ICC 2021.1 Beta 20200827).\ntemplate <typename... Args>\nconstexpr bool args_are_all_positional() {\n    return all_of<is_positional<Args>...>::value;\n}\n\n/// Collect only positional arguments for a Python function call\ntemplate <return_value_policy policy,\n          typename... Args,\n          typename = enable_if_t<args_are_all_positional<Args...>()>>\nsimple_collector<policy> collect_arguments(Args &&...args) {\n    return simple_collector<policy>(std::forward<Args>(args)...);\n}\n\n/// Collect all arguments, including keywords and unpacking (only instantiated when needed)\ntemplate <return_value_policy policy,\n          typename... Args,\n          typename = enable_if_t<!args_are_all_positional<Args...>()>>\nunpacking_collector<policy> collect_arguments(Args &&...args) {\n    // Following argument order rules for generalized unpacking according to PEP 448\n    static_assert(constexpr_last<is_positional, Args...>()\n                          < constexpr_first<is_keyword_or_ds, Args...>()\n                      && constexpr_last<is_s_unpacking, Args...>()\n                             < constexpr_first<is_ds_unpacking, Args...>(),\n                  \"Invalid function call: positional args must precede keywords and ** unpacking; \"\n                  \"* unpacking must precede ** unpacking\");\n    return unpacking_collector<policy>(std::forward<Args>(args)...);\n}\n\ntemplate <typename Derived>\ntemplate <return_value_policy policy, typename... Args>\nobject object_api<Derived>::operator()(Args &&...args) const {\n#ifndef NDEBUG\n    if (!PyGILState_Check()) {\n        pybind11_fail(\"pybind11::object_api<>::operator() PyGILState_Check() failure.\");\n    }\n#endif\n    return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());\n}\n\ntemplate <typename Derived>\ntemplate <return_value_policy policy, typename... Args>\nobject object_api<Derived>::call(Args &&...args) const {\n    return operator()<policy>(std::forward<Args>(args)...);\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\ntemplate <typename T>\nhandle type::handle_of() {\n    static_assert(std::is_base_of<detail::type_caster_generic, detail::make_caster<T>>::value,\n                  \"py::type::of<T> only supports the case where T is a registered C++ types.\");\n\n    return detail::get_type_handle(typeid(T), true);\n}\n\n#define PYBIND11_MAKE_OPAQUE(...)                                                                 \\\n    PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)                                                  \\\n    namespace detail {                                                                            \\\n    template <>                                                                                   \\\n    class type_caster<__VA_ARGS__> : public type_caster_base<__VA_ARGS__> {};                     \\\n    }                                                                                             \\\n    PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n\n/// Lets you pass a type containing a `,` through a macro parameter without needing a separate\n/// typedef, e.g.:\n/// `PYBIND11_OVERRIDE(PYBIND11_TYPE(ReturnType<A, B>), PYBIND11_TYPE(Parent<C, D>), f, arg)`\n#define PYBIND11_TYPE(...) __VA_ARGS__\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/chrono.h",
    "content": "/*\n    pybind11/chrono.h: Transparent conversion between std::chrono and python's datetime\n\n    Copyright (c) 2016 Trent Houliston <trent@houliston.me> and\n                       Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"pybind11.h\"\n\n#include <chrono>\n#include <cmath>\n#include <ctime>\n#include <datetime.h>\n#include <mutex>\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ntemplate <typename type>\nclass duration_caster {\npublic:\n    using rep = typename type::rep;\n    using period = typename type::period;\n\n    // signed 25 bits required by the standard.\n    using days = std::chrono::duration<int_least32_t, std::ratio<86400>>;\n\n    bool load(handle src, bool) {\n        using namespace std::chrono;\n\n        // Lazy initialise the PyDateTime import\n        if (!PyDateTimeAPI) {\n            PyDateTime_IMPORT;\n        }\n\n        if (!src) {\n            return false;\n        }\n        // If invoked with datetime.delta object\n        if (PyDelta_Check(src.ptr())) {\n            value = type(duration_cast<duration<rep, period>>(\n                days(PyDateTime_DELTA_GET_DAYS(src.ptr()))\n                + seconds(PyDateTime_DELTA_GET_SECONDS(src.ptr()))\n                + microseconds(PyDateTime_DELTA_GET_MICROSECONDS(src.ptr()))));\n            return true;\n        }\n        // If invoked with a float we assume it is seconds and convert\n        if (PyFloat_Check(src.ptr())) {\n            value = type(duration_cast<duration<rep, period>>(\n                duration<double>(PyFloat_AsDouble(src.ptr()))));\n            return true;\n        }\n        return false;\n    }\n\n    // If this is a duration just return it back\n    static const std::chrono::duration<rep, period> &\n    get_duration(const std::chrono::duration<rep, period> &src) {\n        return src;\n    }\n\n    // If this is a time_point get the time_since_epoch\n    template <typename Clock>\n    static std::chrono::duration<rep, period>\n    get_duration(const std::chrono::time_point<Clock, std::chrono::duration<rep, period>> &src) {\n        return src.time_since_epoch();\n    }\n\n    static handle cast(const type &src, return_value_policy /* policy */, handle /* parent */) {\n        using namespace std::chrono;\n\n        // Use overloaded function to get our duration from our source\n        // Works out if it is a duration or time_point and get the duration\n        auto d = get_duration(src);\n\n        // Lazy initialise the PyDateTime import\n        if (!PyDateTimeAPI) {\n            PyDateTime_IMPORT;\n        }\n\n        // Declare these special duration types so the conversions happen with the correct\n        // primitive types (int)\n        using dd_t = duration<int, std::ratio<86400>>;\n        using ss_t = duration<int, std::ratio<1>>;\n        using us_t = duration<int, std::micro>;\n\n        auto dd = duration_cast<dd_t>(d);\n        auto subd = d - dd;\n        auto ss = duration_cast<ss_t>(subd);\n        auto us = duration_cast<us_t>(subd - ss);\n        return PyDelta_FromDSU(dd.count(), ss.count(), us.count());\n    }\n\n    PYBIND11_TYPE_CASTER(type, const_name(\"datetime.timedelta\"));\n};\n\ninline std::tm *localtime_thread_safe(const std::time_t *time, std::tm *buf) {\n#if (defined(__STDC_LIB_EXT1__) && defined(__STDC_WANT_LIB_EXT1__)) || defined(_MSC_VER)\n    if (localtime_s(buf, time))\n        return nullptr;\n    return buf;\n#else\n    static std::mutex mtx;\n    std::lock_guard<std::mutex> lock(mtx);\n    std::tm *tm_ptr = std::localtime(time);\n    if (tm_ptr != nullptr) {\n        *buf = *tm_ptr;\n    }\n    return tm_ptr;\n#endif\n}\n\n// This is for casting times on the system clock into datetime.datetime instances\ntemplate <typename Duration>\nclass type_caster<std::chrono::time_point<std::chrono::system_clock, Duration>> {\npublic:\n    using type = std::chrono::time_point<std::chrono::system_clock, Duration>;\n    bool load(handle src, bool) {\n        using namespace std::chrono;\n\n        // Lazy initialise the PyDateTime import\n        if (!PyDateTimeAPI) {\n            PyDateTime_IMPORT;\n        }\n\n        if (!src) {\n            return false;\n        }\n\n        std::tm cal;\n        microseconds msecs;\n\n        if (PyDateTime_Check(src.ptr())) {\n            cal.tm_sec = PyDateTime_DATE_GET_SECOND(src.ptr());\n            cal.tm_min = PyDateTime_DATE_GET_MINUTE(src.ptr());\n            cal.tm_hour = PyDateTime_DATE_GET_HOUR(src.ptr());\n            cal.tm_mday = PyDateTime_GET_DAY(src.ptr());\n            cal.tm_mon = PyDateTime_GET_MONTH(src.ptr()) - 1;\n            cal.tm_year = PyDateTime_GET_YEAR(src.ptr()) - 1900;\n            cal.tm_isdst = -1;\n            msecs = microseconds(PyDateTime_DATE_GET_MICROSECOND(src.ptr()));\n        } else if (PyDate_Check(src.ptr())) {\n            cal.tm_sec = 0;\n            cal.tm_min = 0;\n            cal.tm_hour = 0;\n            cal.tm_mday = PyDateTime_GET_DAY(src.ptr());\n            cal.tm_mon = PyDateTime_GET_MONTH(src.ptr()) - 1;\n            cal.tm_year = PyDateTime_GET_YEAR(src.ptr()) - 1900;\n            cal.tm_isdst = -1;\n            msecs = microseconds(0);\n        } else if (PyTime_Check(src.ptr())) {\n            cal.tm_sec = PyDateTime_TIME_GET_SECOND(src.ptr());\n            cal.tm_min = PyDateTime_TIME_GET_MINUTE(src.ptr());\n            cal.tm_hour = PyDateTime_TIME_GET_HOUR(src.ptr());\n            cal.tm_mday = 1;  // This date (day, month, year) = (1, 0, 70)\n            cal.tm_mon = 0;   // represents 1-Jan-1970, which is the first\n            cal.tm_year = 70; // earliest available date for Python's datetime\n            cal.tm_isdst = -1;\n            msecs = microseconds(PyDateTime_TIME_GET_MICROSECOND(src.ptr()));\n        } else {\n            return false;\n        }\n\n        value = time_point_cast<Duration>(system_clock::from_time_t(std::mktime(&cal)) + msecs);\n        return true;\n    }\n\n    static handle cast(const std::chrono::time_point<std::chrono::system_clock, Duration> &src,\n                       return_value_policy /* policy */,\n                       handle /* parent */) {\n        using namespace std::chrono;\n\n        // Lazy initialise the PyDateTime import\n        if (!PyDateTimeAPI) {\n            PyDateTime_IMPORT;\n        }\n\n        // Get out microseconds, and make sure they are positive, to avoid bug in eastern\n        // hemisphere time zones (cfr. https://github.com/pybind/pybind11/issues/2417)\n        using us_t = duration<int, std::micro>;\n        auto us = duration_cast<us_t>(src.time_since_epoch() % seconds(1));\n        if (us.count() < 0) {\n            us += seconds(1);\n        }\n\n        // Subtract microseconds BEFORE `system_clock::to_time_t`, because:\n        // > If std::time_t has lower precision, it is implementation-defined whether the value is\n        // rounded or truncated. (https://en.cppreference.com/w/cpp/chrono/system_clock/to_time_t)\n        std::time_t tt\n            = system_clock::to_time_t(time_point_cast<system_clock::duration>(src - us));\n\n        std::tm localtime;\n        std::tm *localtime_ptr = localtime_thread_safe(&tt, &localtime);\n        if (!localtime_ptr) {\n            throw cast_error(\"Unable to represent system_clock in local time\");\n        }\n        return PyDateTime_FromDateAndTime(localtime.tm_year + 1900,\n                                          localtime.tm_mon + 1,\n                                          localtime.tm_mday,\n                                          localtime.tm_hour,\n                                          localtime.tm_min,\n                                          localtime.tm_sec,\n                                          us.count());\n    }\n    PYBIND11_TYPE_CASTER(type, const_name(\"datetime.datetime\"));\n};\n\n// Other clocks that are not the system clock are not measured as datetime.datetime objects\n// since they are not measured on calendar time. So instead we just make them timedeltas\n// Or if they have passed us a time as a float we convert that\ntemplate <typename Clock, typename Duration>\nclass type_caster<std::chrono::time_point<Clock, Duration>>\n    : public duration_caster<std::chrono::time_point<Clock, Duration>> {};\n\ntemplate <typename Rep, typename Period>\nclass type_caster<std::chrono::duration<Rep, Period>>\n    : public duration_caster<std::chrono::duration<Rep, Period>> {};\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/common.h",
    "content": "#include \"detail/common.h\"\n#warning \"Including 'common.h' is deprecated. It will be removed in v3.0. Use 'pybind11.h'.\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/complex.h",
    "content": "/*\n    pybind11/complex.h: Complex number support\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"pybind11.h\"\n\n#include <complex>\n\n/// glibc defines I as a macro which breaks things, e.g., boost template names\n#ifdef I\n#    undef I\n#endif\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\ntemplate <typename T>\nstruct format_descriptor<std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>> {\n    static constexpr const char c = format_descriptor<T>::c;\n    static constexpr const char value[3] = {'Z', c, '\\0'};\n    static std::string format() { return std::string(value); }\n};\n\n#ifndef PYBIND11_CPP17\n\ntemplate <typename T>\nconstexpr const char\n    format_descriptor<std::complex<T>,\n                      detail::enable_if_t<std::is_floating_point<T>::value>>::value[3];\n\n#endif\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ntemplate <typename T>\nstruct is_fmt_numeric<std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>> {\n    static constexpr bool value = true;\n    static constexpr int index = is_fmt_numeric<T>::index + 3;\n};\n\ntemplate <typename T>\nclass type_caster<std::complex<T>> {\npublic:\n    bool load(handle src, bool convert) {\n        if (!src) {\n            return false;\n        }\n        if (!convert && !PyComplex_Check(src.ptr())) {\n            return false;\n        }\n        Py_complex result = PyComplex_AsCComplex(src.ptr());\n        if (result.real == -1.0 && PyErr_Occurred()) {\n            PyErr_Clear();\n            return false;\n        }\n        value = std::complex<T>((T) result.real, (T) result.imag);\n        return true;\n    }\n\n    static handle\n    cast(const std::complex<T> &src, return_value_policy /* policy */, handle /* parent */) {\n        return PyComplex_FromDoubles((double) src.real(), (double) src.imag());\n    }\n\n    PYBIND11_TYPE_CASTER(std::complex<T>, const_name(\"complex\"));\n};\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/detail/class.h",
    "content": "/*\n    pybind11/detail/class.h: Python C API implementation details for py::class_\n\n    Copyright (c) 2017 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"../attr.h\"\n#include \"../options.h\"\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n#if !defined(PYPY_VERSION)\n#    define PYBIND11_BUILTIN_QUALNAME\n#    define PYBIND11_SET_OLDPY_QUALNAME(obj, nameobj)\n#else\n// In PyPy, we still set __qualname__ so that we can produce reliable function type\n// signatures; in CPython this macro expands to nothing:\n#    define PYBIND11_SET_OLDPY_QUALNAME(obj, nameobj)                                             \\\n        setattr((PyObject *) obj, \"__qualname__\", nameobj)\n#endif\n\ninline std::string get_fully_qualified_tp_name(PyTypeObject *type) {\n#if !defined(PYPY_VERSION)\n    return type->tp_name;\n#else\n    auto module_name = handle((PyObject *) type).attr(\"__module__\").cast<std::string>();\n    if (module_name == PYBIND11_BUILTINS_MODULE)\n        return type->tp_name;\n    else\n        return std::move(module_name) + \".\" + type->tp_name;\n#endif\n}\n\ninline PyTypeObject *type_incref(PyTypeObject *type) {\n    Py_INCREF(type);\n    return type;\n}\n\n#if !defined(PYPY_VERSION)\n\n/// `pybind11_static_property.__get__()`: Always pass the class instead of the instance.\nextern \"C\" inline PyObject *pybind11_static_get(PyObject *self, PyObject * /*ob*/, PyObject *cls) {\n    return PyProperty_Type.tp_descr_get(self, cls, cls);\n}\n\n/// `pybind11_static_property.__set__()`: Just like the above `__get__()`.\nextern \"C\" inline int pybind11_static_set(PyObject *self, PyObject *obj, PyObject *value) {\n    PyObject *cls = PyType_Check(obj) ? obj : (PyObject *) Py_TYPE(obj);\n    return PyProperty_Type.tp_descr_set(self, cls, value);\n}\n\n// Forward declaration to use in `make_static_property_type()`\ninline void enable_dynamic_attributes(PyHeapTypeObject *heap_type);\n\n/** A `static_property` is the same as a `property` but the `__get__()` and `__set__()`\n    methods are modified to always use the object type instead of a concrete instance.\n    Return value: New reference. */\ninline PyTypeObject *make_static_property_type() {\n    constexpr auto *name = \"pybind11_static_property\";\n    auto name_obj = reinterpret_steal<object>(PYBIND11_FROM_STRING(name));\n\n    /* Danger zone: from now (and until PyType_Ready), make sure to\n       issue no Python C API calls which could potentially invoke the\n       garbage collector (the GC will call type_traverse(), which will in\n       turn find the newly constructed type in an invalid state) */\n    auto *heap_type = (PyHeapTypeObject *) PyType_Type.tp_alloc(&PyType_Type, 0);\n    if (!heap_type) {\n        pybind11_fail(\"make_static_property_type(): error allocating type!\");\n    }\n\n    heap_type->ht_name = name_obj.inc_ref().ptr();\n#    ifdef PYBIND11_BUILTIN_QUALNAME\n    heap_type->ht_qualname = name_obj.inc_ref().ptr();\n#    endif\n\n    auto *type = &heap_type->ht_type;\n    type->tp_name = name;\n    type->tp_base = type_incref(&PyProperty_Type);\n    type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HEAPTYPE;\n    type->tp_descr_get = pybind11_static_get;\n    type->tp_descr_set = pybind11_static_set;\n\n    if (PyType_Ready(type) < 0) {\n        pybind11_fail(\"make_static_property_type(): failure in PyType_Ready()!\");\n    }\n\n#    if PY_VERSION_HEX >= 0x030C0000\n    // PRE 3.12 FEATURE FREEZE. PLEASE REVIEW AFTER FREEZE.\n    // Since Python-3.12 property-derived types are required to\n    // have dynamic attributes (to set `__doc__`)\n    enable_dynamic_attributes(heap_type);\n#    endif\n\n    setattr((PyObject *) type, \"__module__\", str(\"pybind11_builtins\"));\n    PYBIND11_SET_OLDPY_QUALNAME(type, name_obj);\n\n    return type;\n}\n\n#else // PYPY\n\n/** PyPy has some issues with the above C API, so we evaluate Python code instead.\n    This function will only be called once so performance isn't really a concern.\n    Return value: New reference. */\ninline PyTypeObject *make_static_property_type() {\n    auto d = dict();\n    PyObject *result = PyRun_String(R\"(\\\nclass pybind11_static_property(property):\n    def __get__(self, obj, cls):\n        return property.__get__(self, cls, cls)\n\n    def __set__(self, obj, value):\n        cls = obj if isinstance(obj, type) else type(obj)\n        property.__set__(self, cls, value)\n)\",\n                                    Py_file_input,\n                                    d.ptr(),\n                                    d.ptr());\n    if (result == nullptr)\n        throw error_already_set();\n    Py_DECREF(result);\n    return (PyTypeObject *) d[\"pybind11_static_property\"].cast<object>().release().ptr();\n}\n\n#endif // PYPY\n\n/** Types with static properties need to handle `Type.static_prop = x` in a specific way.\n    By default, Python replaces the `static_property` itself, but for wrapped C++ types\n    we need to call `static_property.__set__()` in order to propagate the new value to\n    the underlying C++ data structure. */\nextern \"C\" inline int pybind11_meta_setattro(PyObject *obj, PyObject *name, PyObject *value) {\n    // Use `_PyType_Lookup()` instead of `PyObject_GetAttr()` in order to get the raw\n    // descriptor (`property`) instead of calling `tp_descr_get` (`property.__get__()`).\n    PyObject *descr = _PyType_Lookup((PyTypeObject *) obj, name);\n\n    // The following assignment combinations are possible:\n    //   1. `Type.static_prop = value`             --> descr_set: `Type.static_prop.__set__(value)`\n    //   2. `Type.static_prop = other_static_prop` --> setattro:  replace existing `static_prop`\n    //   3. `Type.regular_attribute = value`       --> setattro:  regular attribute assignment\n    auto *const static_prop = (PyObject *) get_internals().static_property_type;\n    const auto call_descr_set = (descr != nullptr) && (value != nullptr)\n                                && (PyObject_IsInstance(descr, static_prop) != 0)\n                                && (PyObject_IsInstance(value, static_prop) == 0);\n    if (call_descr_set) {\n        // Call `static_property.__set__()` instead of replacing the `static_property`.\n#if !defined(PYPY_VERSION)\n        return Py_TYPE(descr)->tp_descr_set(descr, obj, value);\n#else\n        if (PyObject *result = PyObject_CallMethod(descr, \"__set__\", \"OO\", obj, value)) {\n            Py_DECREF(result);\n            return 0;\n        } else {\n            return -1;\n        }\n#endif\n    } else {\n        // Replace existing attribute.\n        return PyType_Type.tp_setattro(obj, name, value);\n    }\n}\n\n/**\n * Python 3's PyInstanceMethod_Type hides itself via its tp_descr_get, which prevents aliasing\n * methods via cls.attr(\"m2\") = cls.attr(\"m1\"): instead the tp_descr_get returns a plain function,\n * when called on a class, or a PyMethod, when called on an instance.  Override that behaviour here\n * to do a special case bypass for PyInstanceMethod_Types.\n */\nextern \"C\" inline PyObject *pybind11_meta_getattro(PyObject *obj, PyObject *name) {\n    PyObject *descr = _PyType_Lookup((PyTypeObject *) obj, name);\n    if (descr && PyInstanceMethod_Check(descr)) {\n        Py_INCREF(descr);\n        return descr;\n    }\n    return PyType_Type.tp_getattro(obj, name);\n}\n\n/// metaclass `__call__` function that is used to create all pybind11 objects.\nextern \"C\" inline PyObject *pybind11_meta_call(PyObject *type, PyObject *args, PyObject *kwargs) {\n\n    // use the default metaclass call to create/initialize the object\n    PyObject *self = PyType_Type.tp_call(type, args, kwargs);\n    if (self == nullptr) {\n        return nullptr;\n    }\n\n    // This must be a pybind11 instance\n    auto *instance = reinterpret_cast<detail::instance *>(self);\n\n    // Ensure that the base __init__ function(s) were called\n    for (const auto &vh : values_and_holders(instance)) {\n        if (!vh.holder_constructed()) {\n            PyErr_Format(PyExc_TypeError,\n                         \"%.200s.__init__() must be called when overriding __init__\",\n                         get_fully_qualified_tp_name(vh.type->type).c_str());\n            Py_DECREF(self);\n            return nullptr;\n        }\n    }\n\n    return self;\n}\n\n/// Cleanup the type-info for a pybind11-registered type.\nextern \"C\" inline void pybind11_meta_dealloc(PyObject *obj) {\n    auto *type = (PyTypeObject *) obj;\n    auto &internals = get_internals();\n\n    // A pybind11-registered type will:\n    // 1) be found in internals.registered_types_py\n    // 2) have exactly one associated `detail::type_info`\n    auto found_type = internals.registered_types_py.find(type);\n    if (found_type != internals.registered_types_py.end() && found_type->second.size() == 1\n        && found_type->second[0]->type == type) {\n\n        auto *tinfo = found_type->second[0];\n        auto tindex = std::type_index(*tinfo->cpptype);\n        internals.direct_conversions.erase(tindex);\n\n        if (tinfo->module_local) {\n            get_local_internals().registered_types_cpp.erase(tindex);\n        } else {\n            internals.registered_types_cpp.erase(tindex);\n        }\n        internals.registered_types_py.erase(tinfo->type);\n\n        // Actually just `std::erase_if`, but that's only available in C++20\n        auto &cache = internals.inactive_override_cache;\n        for (auto it = cache.begin(), last = cache.end(); it != last;) {\n            if (it->first == (PyObject *) tinfo->type) {\n                it = cache.erase(it);\n            } else {\n                ++it;\n            }\n        }\n\n        delete tinfo;\n    }\n\n    PyType_Type.tp_dealloc(obj);\n}\n\n/** This metaclass is assigned by default to all pybind11 types and is required in order\n    for static properties to function correctly. Users may override this using `py::metaclass`.\n    Return value: New reference. */\ninline PyTypeObject *make_default_metaclass() {\n    constexpr auto *name = \"pybind11_type\";\n    auto name_obj = reinterpret_steal<object>(PYBIND11_FROM_STRING(name));\n\n    /* Danger zone: from now (and until PyType_Ready), make sure to\n       issue no Python C API calls which could potentially invoke the\n       garbage collector (the GC will call type_traverse(), which will in\n       turn find the newly constructed type in an invalid state) */\n    auto *heap_type = (PyHeapTypeObject *) PyType_Type.tp_alloc(&PyType_Type, 0);\n    if (!heap_type) {\n        pybind11_fail(\"make_default_metaclass(): error allocating metaclass!\");\n    }\n\n    heap_type->ht_name = name_obj.inc_ref().ptr();\n#ifdef PYBIND11_BUILTIN_QUALNAME\n    heap_type->ht_qualname = name_obj.inc_ref().ptr();\n#endif\n\n    auto *type = &heap_type->ht_type;\n    type->tp_name = name;\n    type->tp_base = type_incref(&PyType_Type);\n    type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HEAPTYPE;\n\n    type->tp_call = pybind11_meta_call;\n\n    type->tp_setattro = pybind11_meta_setattro;\n    type->tp_getattro = pybind11_meta_getattro;\n\n    type->tp_dealloc = pybind11_meta_dealloc;\n\n    if (PyType_Ready(type) < 0) {\n        pybind11_fail(\"make_default_metaclass(): failure in PyType_Ready()!\");\n    }\n\n    setattr((PyObject *) type, \"__module__\", str(\"pybind11_builtins\"));\n    PYBIND11_SET_OLDPY_QUALNAME(type, name_obj);\n\n    return type;\n}\n\n/// For multiple inheritance types we need to recursively register/deregister base pointers for any\n/// base classes with pointers that are difference from the instance value pointer so that we can\n/// correctly recognize an offset base class pointer. This calls a function with any offset base\n/// ptrs.\ninline void traverse_offset_bases(void *valueptr,\n                                  const detail::type_info *tinfo,\n                                  instance *self,\n                                  bool (*f)(void * /*parentptr*/, instance * /*self*/)) {\n    for (handle h : reinterpret_borrow<tuple>(tinfo->type->tp_bases)) {\n        if (auto *parent_tinfo = get_type_info((PyTypeObject *) h.ptr())) {\n            for (auto &c : parent_tinfo->implicit_casts) {\n                if (c.first == tinfo->cpptype) {\n                    auto *parentptr = c.second(valueptr);\n                    if (parentptr != valueptr) {\n                        f(parentptr, self);\n                    }\n                    traverse_offset_bases(parentptr, parent_tinfo, self, f);\n                    break;\n                }\n            }\n        }\n    }\n}\n\ninline bool register_instance_impl(void *ptr, instance *self) {\n    get_internals().registered_instances.emplace(ptr, self);\n    return true; // unused, but gives the same signature as the deregister func\n}\ninline bool deregister_instance_impl(void *ptr, instance *self) {\n    auto &registered_instances = get_internals().registered_instances;\n    auto range = registered_instances.equal_range(ptr);\n    for (auto it = range.first; it != range.second; ++it) {\n        if (self == it->second) {\n            registered_instances.erase(it);\n            return true;\n        }\n    }\n    return false;\n}\n\ninline void register_instance(instance *self, void *valptr, const type_info *tinfo) {\n    register_instance_impl(valptr, self);\n    if (!tinfo->simple_ancestors) {\n        traverse_offset_bases(valptr, tinfo, self, register_instance_impl);\n    }\n}\n\ninline bool deregister_instance(instance *self, void *valptr, const type_info *tinfo) {\n    bool ret = deregister_instance_impl(valptr, self);\n    if (!tinfo->simple_ancestors) {\n        traverse_offset_bases(valptr, tinfo, self, deregister_instance_impl);\n    }\n    return ret;\n}\n\n/// Instance creation function for all pybind11 types. It allocates the internal instance layout\n/// for holding C++ objects and holders.  Allocation is done lazily (the first time the instance is\n/// cast to a reference or pointer), and initialization is done by an `__init__` function.\ninline PyObject *make_new_instance(PyTypeObject *type) {\n#if defined(PYPY_VERSION)\n    // PyPy gets tp_basicsize wrong (issue 2482) under multiple inheritance when the first\n    // inherited object is a plain Python type (i.e. not derived from an extension type).  Fix it.\n    ssize_t instance_size = static_cast<ssize_t>(sizeof(instance));\n    if (type->tp_basicsize < instance_size) {\n        type->tp_basicsize = instance_size;\n    }\n#endif\n    PyObject *self = type->tp_alloc(type, 0);\n    auto *inst = reinterpret_cast<instance *>(self);\n    // Allocate the value/holder internals:\n    inst->allocate_layout();\n\n    return self;\n}\n\n/// Instance creation function for all pybind11 types. It only allocates space for the\n/// C++ object, but doesn't call the constructor -- an `__init__` function must do that.\nextern \"C\" inline PyObject *pybind11_object_new(PyTypeObject *type, PyObject *, PyObject *) {\n    return make_new_instance(type);\n}\n\n/// An `__init__` function constructs the C++ object. Users should provide at least one\n/// of these using `py::init` or directly with `.def(__init__, ...)`. Otherwise, the\n/// following default function will be used which simply throws an exception.\nextern \"C\" inline int pybind11_object_init(PyObject *self, PyObject *, PyObject *) {\n    PyTypeObject *type = Py_TYPE(self);\n    std::string msg = get_fully_qualified_tp_name(type) + \": No constructor defined!\";\n    PyErr_SetString(PyExc_TypeError, msg.c_str());\n    return -1;\n}\n\ninline void add_patient(PyObject *nurse, PyObject *patient) {\n    auto &internals = get_internals();\n    auto *instance = reinterpret_cast<detail::instance *>(nurse);\n    instance->has_patients = true;\n    Py_INCREF(patient);\n    internals.patients[nurse].push_back(patient);\n}\n\ninline void clear_patients(PyObject *self) {\n    auto *instance = reinterpret_cast<detail::instance *>(self);\n    auto &internals = get_internals();\n    auto pos = internals.patients.find(self);\n    assert(pos != internals.patients.end());\n    // Clearing the patients can cause more Python code to run, which\n    // can invalidate the iterator. Extract the vector of patients\n    // from the unordered_map first.\n    auto patients = std::move(pos->second);\n    internals.patients.erase(pos);\n    instance->has_patients = false;\n    for (PyObject *&patient : patients) {\n        Py_CLEAR(patient);\n    }\n}\n\n/// Clears all internal data from the instance and removes it from registered instances in\n/// preparation for deallocation.\ninline void clear_instance(PyObject *self) {\n    auto *instance = reinterpret_cast<detail::instance *>(self);\n\n    // Deallocate any values/holders, if present:\n    for (auto &v_h : values_and_holders(instance)) {\n        if (v_h) {\n\n            // We have to deregister before we call dealloc because, for virtual MI types, we still\n            // need to be able to get the parent pointers.\n            if (v_h.instance_registered()\n                && !deregister_instance(instance, v_h.value_ptr(), v_h.type)) {\n                pybind11_fail(\n                    \"pybind11_object_dealloc(): Tried to deallocate unregistered instance!\");\n            }\n\n            if (instance->owned || v_h.holder_constructed()) {\n                v_h.type->dealloc(v_h);\n            }\n        }\n    }\n    // Deallocate the value/holder layout internals:\n    instance->deallocate_layout();\n\n    if (instance->weakrefs) {\n        PyObject_ClearWeakRefs(self);\n    }\n\n    PyObject **dict_ptr = _PyObject_GetDictPtr(self);\n    if (dict_ptr) {\n        Py_CLEAR(*dict_ptr);\n    }\n\n    if (instance->has_patients) {\n        clear_patients(self);\n    }\n}\n\n/// Instance destructor function for all pybind11 types. It calls `type_info.dealloc`\n/// to destroy the C++ object itself, while the rest is Python bookkeeping.\nextern \"C\" inline void pybind11_object_dealloc(PyObject *self) {\n    auto *type = Py_TYPE(self);\n\n    // If this is a GC tracked object, untrack it first\n    // Note that the track call is implicitly done by the\n    // default tp_alloc, which we never override.\n    if (PyType_HasFeature(type, Py_TPFLAGS_HAVE_GC) != 0) {\n        PyObject_GC_UnTrack(self);\n    }\n\n    clear_instance(self);\n\n    type->tp_free(self);\n\n#if PY_VERSION_HEX < 0x03080000\n    // `type->tp_dealloc != pybind11_object_dealloc` means that we're being called\n    // as part of a derived type's dealloc, in which case we're not allowed to decref\n    // the type here. For cross-module compatibility, we shouldn't compare directly\n    // with `pybind11_object_dealloc`, but with the common one stashed in internals.\n    auto pybind11_object_type = (PyTypeObject *) get_internals().instance_base;\n    if (type->tp_dealloc == pybind11_object_type->tp_dealloc)\n        Py_DECREF(type);\n#else\n    // This was not needed before Python 3.8 (Python issue 35810)\n    // https://github.com/pybind/pybind11/issues/1946\n    Py_DECREF(type);\n#endif\n}\n\nstd::string error_string();\n\n/** Create the type which can be used as a common base for all classes.  This is\n    needed in order to satisfy Python's requirements for multiple inheritance.\n    Return value: New reference. */\ninline PyObject *make_object_base_type(PyTypeObject *metaclass) {\n    constexpr auto *name = \"pybind11_object\";\n    auto name_obj = reinterpret_steal<object>(PYBIND11_FROM_STRING(name));\n\n    /* Danger zone: from now (and until PyType_Ready), make sure to\n       issue no Python C API calls which could potentially invoke the\n       garbage collector (the GC will call type_traverse(), which will in\n       turn find the newly constructed type in an invalid state) */\n    auto *heap_type = (PyHeapTypeObject *) metaclass->tp_alloc(metaclass, 0);\n    if (!heap_type) {\n        pybind11_fail(\"make_object_base_type(): error allocating type!\");\n    }\n\n    heap_type->ht_name = name_obj.inc_ref().ptr();\n#ifdef PYBIND11_BUILTIN_QUALNAME\n    heap_type->ht_qualname = name_obj.inc_ref().ptr();\n#endif\n\n    auto *type = &heap_type->ht_type;\n    type->tp_name = name;\n    type->tp_base = type_incref(&PyBaseObject_Type);\n    type->tp_basicsize = static_cast<ssize_t>(sizeof(instance));\n    type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HEAPTYPE;\n\n    type->tp_new = pybind11_object_new;\n    type->tp_init = pybind11_object_init;\n    type->tp_dealloc = pybind11_object_dealloc;\n\n    /* Support weak references (needed for the keep_alive feature) */\n    type->tp_weaklistoffset = offsetof(instance, weakrefs);\n\n    if (PyType_Ready(type) < 0) {\n        pybind11_fail(\"PyType_Ready failed in make_object_base_type(): \" + error_string());\n    }\n\n    setattr((PyObject *) type, \"__module__\", str(\"pybind11_builtins\"));\n    PYBIND11_SET_OLDPY_QUALNAME(type, name_obj);\n\n    assert(!PyType_HasFeature(type, Py_TPFLAGS_HAVE_GC));\n    return (PyObject *) heap_type;\n}\n\n/// dynamic_attr: Allow the garbage collector to traverse the internal instance `__dict__`.\nextern \"C\" inline int pybind11_traverse(PyObject *self, visitproc visit, void *arg) {\n    PyObject *&dict = *_PyObject_GetDictPtr(self);\n    Py_VISIT(dict);\n// https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_traverse\n#if PY_VERSION_HEX >= 0x03090000\n    Py_VISIT(Py_TYPE(self));\n#endif\n    return 0;\n}\n\n/// dynamic_attr: Allow the GC to clear the dictionary.\nextern \"C\" inline int pybind11_clear(PyObject *self) {\n    PyObject *&dict = *_PyObject_GetDictPtr(self);\n    Py_CLEAR(dict);\n    return 0;\n}\n\n/// Give instances of this type a `__dict__` and opt into garbage collection.\ninline void enable_dynamic_attributes(PyHeapTypeObject *heap_type) {\n    auto *type = &heap_type->ht_type;\n    type->tp_flags |= Py_TPFLAGS_HAVE_GC;\n#if PY_VERSION_HEX < 0x030B0000\n    type->tp_dictoffset = type->tp_basicsize;           // place dict at the end\n    type->tp_basicsize += (ssize_t) sizeof(PyObject *); // and allocate enough space for it\n#else\n    type->tp_flags |= Py_TPFLAGS_MANAGED_DICT;\n#endif\n    type->tp_traverse = pybind11_traverse;\n    type->tp_clear = pybind11_clear;\n\n    static PyGetSetDef getset[] = {{\n#if PY_VERSION_HEX < 0x03070000\n                                       const_cast<char *>(\"__dict__\"),\n#else\n                                       \"__dict__\",\n#endif\n                                       PyObject_GenericGetDict,\n                                       PyObject_GenericSetDict,\n                                       nullptr,\n                                       nullptr},\n                                   {nullptr, nullptr, nullptr, nullptr, nullptr}};\n    type->tp_getset = getset;\n}\n\n/// buffer_protocol: Fill in the view as specified by flags.\nextern \"C\" inline int pybind11_getbuffer(PyObject *obj, Py_buffer *view, int flags) {\n    // Look for a `get_buffer` implementation in this type's info or any bases (following MRO).\n    type_info *tinfo = nullptr;\n    for (auto type : reinterpret_borrow<tuple>(Py_TYPE(obj)->tp_mro)) {\n        tinfo = get_type_info((PyTypeObject *) type.ptr());\n        if (tinfo && tinfo->get_buffer) {\n            break;\n        }\n    }\n    if (view == nullptr || !tinfo || !tinfo->get_buffer) {\n        if (view) {\n            view->obj = nullptr;\n        }\n        PyErr_SetString(PyExc_BufferError, \"pybind11_getbuffer(): Internal error\");\n        return -1;\n    }\n    std::memset(view, 0, sizeof(Py_buffer));\n    buffer_info *info = tinfo->get_buffer(obj, tinfo->get_buffer_data);\n    if ((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE && info->readonly) {\n        delete info;\n        // view->obj = nullptr;  // Was just memset to 0, so not necessary\n        PyErr_SetString(PyExc_BufferError, \"Writable buffer requested for readonly storage\");\n        return -1;\n    }\n    view->obj = obj;\n    view->ndim = 1;\n    view->internal = info;\n    view->buf = info->ptr;\n    view->itemsize = info->itemsize;\n    view->len = view->itemsize;\n    for (auto s : info->shape) {\n        view->len *= s;\n    }\n    view->readonly = static_cast<int>(info->readonly);\n    if ((flags & PyBUF_FORMAT) == PyBUF_FORMAT) {\n        view->format = const_cast<char *>(info->format.c_str());\n    }\n    if ((flags & PyBUF_STRIDES) == PyBUF_STRIDES) {\n        view->ndim = (int) info->ndim;\n        view->strides = info->strides.data();\n        view->shape = info->shape.data();\n    }\n    Py_INCREF(view->obj);\n    return 0;\n}\n\n/// buffer_protocol: Release the resources of the buffer.\nextern \"C\" inline void pybind11_releasebuffer(PyObject *, Py_buffer *view) {\n    delete (buffer_info *) view->internal;\n}\n\n/// Give this type a buffer interface.\ninline void enable_buffer_protocol(PyHeapTypeObject *heap_type) {\n    heap_type->ht_type.tp_as_buffer = &heap_type->as_buffer;\n\n    heap_type->as_buffer.bf_getbuffer = pybind11_getbuffer;\n    heap_type->as_buffer.bf_releasebuffer = pybind11_releasebuffer;\n}\n\n/** Create a brand new Python type according to the `type_record` specification.\n    Return value: New reference. */\ninline PyObject *make_new_python_type(const type_record &rec) {\n    auto name = reinterpret_steal<object>(PYBIND11_FROM_STRING(rec.name));\n\n    auto qualname = name;\n    if (rec.scope && !PyModule_Check(rec.scope.ptr()) && hasattr(rec.scope, \"__qualname__\")) {\n        qualname = reinterpret_steal<object>(\n            PyUnicode_FromFormat(\"%U.%U\", rec.scope.attr(\"__qualname__\").ptr(), name.ptr()));\n    }\n\n    object module_;\n    if (rec.scope) {\n        if (hasattr(rec.scope, \"__module__\")) {\n            module_ = rec.scope.attr(\"__module__\");\n        } else if (hasattr(rec.scope, \"__name__\")) {\n            module_ = rec.scope.attr(\"__name__\");\n        }\n    }\n\n    const auto *full_name = c_str(\n#if !defined(PYPY_VERSION)\n        module_ ? str(module_).cast<std::string>() + \".\" + rec.name :\n#endif\n                rec.name);\n\n    char *tp_doc = nullptr;\n    if (rec.doc && options::show_user_defined_docstrings()) {\n        /* Allocate memory for docstring (using PyObject_MALLOC, since\n           Python will free this later on) */\n        size_t size = std::strlen(rec.doc) + 1;\n        tp_doc = (char *) PyObject_MALLOC(size);\n        std::memcpy((void *) tp_doc, rec.doc, size);\n    }\n\n    auto &internals = get_internals();\n    auto bases = tuple(rec.bases);\n    auto *base = (bases.empty()) ? internals.instance_base : bases[0].ptr();\n\n    /* Danger zone: from now (and until PyType_Ready), make sure to\n       issue no Python C API calls which could potentially invoke the\n       garbage collector (the GC will call type_traverse(), which will in\n       turn find the newly constructed type in an invalid state) */\n    auto *metaclass\n        = rec.metaclass.ptr() ? (PyTypeObject *) rec.metaclass.ptr() : internals.default_metaclass;\n\n    auto *heap_type = (PyHeapTypeObject *) metaclass->tp_alloc(metaclass, 0);\n    if (!heap_type) {\n        pybind11_fail(std::string(rec.name) + \": Unable to create type object!\");\n    }\n\n    heap_type->ht_name = name.release().ptr();\n#ifdef PYBIND11_BUILTIN_QUALNAME\n    heap_type->ht_qualname = qualname.inc_ref().ptr();\n#endif\n\n    auto *type = &heap_type->ht_type;\n    type->tp_name = full_name;\n    type->tp_doc = tp_doc;\n    type->tp_base = type_incref((PyTypeObject *) base);\n    type->tp_basicsize = static_cast<ssize_t>(sizeof(instance));\n    if (!bases.empty()) {\n        type->tp_bases = bases.release().ptr();\n    }\n\n    /* Don't inherit base __init__ */\n    type->tp_init = pybind11_object_init;\n\n    /* Supported protocols */\n    type->tp_as_number = &heap_type->as_number;\n    type->tp_as_sequence = &heap_type->as_sequence;\n    type->tp_as_mapping = &heap_type->as_mapping;\n    type->tp_as_async = &heap_type->as_async;\n\n    /* Flags */\n    type->tp_flags |= Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE;\n    if (!rec.is_final) {\n        type->tp_flags |= Py_TPFLAGS_BASETYPE;\n    }\n\n    if (rec.dynamic_attr) {\n        enable_dynamic_attributes(heap_type);\n    }\n\n    if (rec.buffer_protocol) {\n        enable_buffer_protocol(heap_type);\n    }\n\n    if (rec.custom_type_setup_callback) {\n        rec.custom_type_setup_callback(heap_type);\n    }\n\n    if (PyType_Ready(type) < 0) {\n        pybind11_fail(std::string(rec.name) + \": PyType_Ready failed: \" + error_string());\n    }\n\n    assert(!rec.dynamic_attr || PyType_HasFeature(type, Py_TPFLAGS_HAVE_GC));\n\n    /* Register type with the parent scope */\n    if (rec.scope) {\n        setattr(rec.scope, rec.name, (PyObject *) type);\n    } else {\n        Py_INCREF(type); // Keep it alive forever (reference leak)\n    }\n\n    if (module_) { // Needed by pydoc\n        setattr((PyObject *) type, \"__module__\", module_);\n    }\n\n    PYBIND11_SET_OLDPY_QUALNAME(type, qualname);\n\n    return (PyObject *) type;\n}\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/detail/common.h",
    "content": "/*\n    pybind11/detail/common.h -- Basic macros\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#define PYBIND11_VERSION_MAJOR 2\n#define PYBIND11_VERSION_MINOR 10\n#define PYBIND11_VERSION_PATCH 4\n\n// Similar to Python's convention: https://docs.python.org/3/c-api/apiabiversion.html\n// Additional convention: 0xD = dev\n#define PYBIND11_VERSION_HEX 0x020A0400\n\n// Define some generic pybind11 helper macros for warning management.\n//\n// Note that compiler-specific push/pop pairs are baked into the\n// PYBIND11_NAMESPACE_BEGIN/PYBIND11_NAMESPACE_END pair of macros. Therefore manual\n// PYBIND11_WARNING_PUSH/PYBIND11_WARNING_POP are usually only needed in `#include` sections.\n//\n// If you find you need to suppress a warning, please try to make the suppression as local as\n// possible using these macros. Please also be sure to push/pop with the pybind11 macros. Please\n// only use compiler specifics if you need to check specific versions, e.g. Apple Clang vs. vanilla\n// Clang.\n#if defined(_MSC_VER)\n#    define PYBIND11_COMPILER_MSVC\n#    define PYBIND11_PRAGMA(...) __pragma(__VA_ARGS__)\n#    define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(warning(push))\n#    define PYBIND11_WARNING_POP PYBIND11_PRAGMA(warning(pop))\n#elif defined(__INTEL_COMPILER)\n#    define PYBIND11_COMPILER_INTEL\n#    define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)\n#    define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(warning push)\n#    define PYBIND11_WARNING_POP PYBIND11_PRAGMA(warning pop)\n#elif defined(__clang__)\n#    define PYBIND11_COMPILER_CLANG\n#    define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)\n#    define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(clang diagnostic push)\n#    define PYBIND11_WARNING_POP PYBIND11_PRAGMA(clang diagnostic push)\n#elif defined(__GNUC__)\n#    define PYBIND11_COMPILER_GCC\n#    define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)\n#    define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(GCC diagnostic push)\n#    define PYBIND11_WARNING_POP PYBIND11_PRAGMA(GCC diagnostic pop)\n#endif\n\n#ifdef PYBIND11_COMPILER_MSVC\n#    define PYBIND11_WARNING_DISABLE_MSVC(name) PYBIND11_PRAGMA(warning(disable : name))\n#else\n#    define PYBIND11_WARNING_DISABLE_MSVC(name)\n#endif\n\n#ifdef PYBIND11_COMPILER_CLANG\n#    define PYBIND11_WARNING_DISABLE_CLANG(name) PYBIND11_PRAGMA(clang diagnostic ignored name)\n#else\n#    define PYBIND11_WARNING_DISABLE_CLANG(name)\n#endif\n\n#ifdef PYBIND11_COMPILER_GCC\n#    define PYBIND11_WARNING_DISABLE_GCC(name) PYBIND11_PRAGMA(GCC diagnostic ignored name)\n#else\n#    define PYBIND11_WARNING_DISABLE_GCC(name)\n#endif\n\n#ifdef PYBIND11_COMPILER_INTEL\n#    define PYBIND11_WARNING_DISABLE_INTEL(name) PYBIND11_PRAGMA(warning disable name)\n#else\n#    define PYBIND11_WARNING_DISABLE_INTEL(name)\n#endif\n\n#define PYBIND11_NAMESPACE_BEGIN(name)                                                            \\\n    namespace name {                                                                              \\\n    PYBIND11_WARNING_PUSH\n\n#define PYBIND11_NAMESPACE_END(name)                                                              \\\n    PYBIND11_WARNING_POP                                                                          \\\n    }\n\n// Robust support for some features and loading modules compiled against different pybind versions\n// requires forcing hidden visibility on pybind code, so we enforce this by setting the attribute\n// on the main `pybind11` namespace.\n#if !defined(PYBIND11_NAMESPACE)\n#    ifdef __GNUG__\n#        define PYBIND11_NAMESPACE pybind11 __attribute__((visibility(\"hidden\")))\n#    else\n#        define PYBIND11_NAMESPACE pybind11\n#    endif\n#endif\n\n#if !(defined(_MSC_VER) && __cplusplus == 199711L)\n#    if __cplusplus >= 201402L\n#        define PYBIND11_CPP14\n#        if __cplusplus >= 201703L\n#            define PYBIND11_CPP17\n#            if __cplusplus >= 202002L\n#                define PYBIND11_CPP20\n// Please update tests/pybind11_tests.cpp `cpp_std()` when adding a macro here.\n#            endif\n#        endif\n#    endif\n#elif defined(_MSC_VER) && __cplusplus == 199711L\n// MSVC sets _MSVC_LANG rather than __cplusplus (supposedly until the standard is fully\n// implemented). Unless you use the /Zc:__cplusplus flag on Visual Studio 2017 15.7 Preview 3\n// or newer.\n#    if _MSVC_LANG >= 201402L\n#        define PYBIND11_CPP14\n#        if _MSVC_LANG > 201402L\n#            define PYBIND11_CPP17\n#            if _MSVC_LANG >= 202002L\n#                define PYBIND11_CPP20\n#            endif\n#        endif\n#    endif\n#endif\n\n// Compiler version assertions\n#if defined(__INTEL_COMPILER)\n#    if __INTEL_COMPILER < 1800\n#        error pybind11 requires Intel C++ compiler v18 or newer\n#    elif __INTEL_COMPILER < 1900 && defined(PYBIND11_CPP14)\n#        error pybind11 supports only C++11 with Intel C++ compiler v18. Use v19 or newer for C++14.\n#    endif\n/* The following pragma cannot be pop'ed:\n   https://community.intel.com/t5/Intel-C-Compiler/Inline-and-no-inline-warning/td-p/1216764 */\n#    pragma warning disable 2196 // warning #2196: routine is both \"inline\" and \"noinline\"\n#elif defined(__clang__) && !defined(__apple_build_version__)\n#    if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 3)\n#        error pybind11 requires clang 3.3 or newer\n#    endif\n#elif defined(__clang__)\n// Apple changes clang version macros to its Xcode version; the first Xcode release based on\n// (upstream) clang 3.3 was Xcode 5:\n#    if __clang_major__ < 5\n#        error pybind11 requires Xcode/clang 5.0 or newer\n#    endif\n#elif defined(__GNUG__)\n#    if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)\n#        error pybind11 requires gcc 4.8 or newer\n#    endif\n#elif defined(_MSC_VER)\n#    if _MSC_VER < 1910\n#        error pybind11 2.10+ requires MSVC 2017 or newer\n#    endif\n#endif\n\n#if !defined(PYBIND11_EXPORT)\n#    if defined(WIN32) || defined(_WIN32)\n#        define PYBIND11_EXPORT __declspec(dllexport)\n#    else\n#        define PYBIND11_EXPORT __attribute__((visibility(\"default\")))\n#    endif\n#endif\n\n#if !defined(PYBIND11_EXPORT_EXCEPTION)\n#    if defined(__apple_build_version__)\n#        define PYBIND11_EXPORT_EXCEPTION PYBIND11_EXPORT\n#    else\n#        define PYBIND11_EXPORT_EXCEPTION\n#    endif\n#endif\n\n// For CUDA, GCC7, GCC8:\n// PYBIND11_NOINLINE_FORCED is incompatible with `-Wattributes -Werror`.\n// When defining PYBIND11_NOINLINE_FORCED, it is best to also use `-Wno-attributes`.\n// However, the measured shared-library size saving when using noinline are only\n// 1.7% for CUDA, -0.2% for GCC7, and 0.0% for GCC8 (using -DCMAKE_BUILD_TYPE=MinSizeRel,\n// the default under pybind11/tests).\n#if !defined(PYBIND11_NOINLINE_FORCED)                                                            \\\n    && (defined(__CUDACC__) || (defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8)))\n#    define PYBIND11_NOINLINE_DISABLED\n#endif\n\n// The PYBIND11_NOINLINE macro is for function DEFINITIONS.\n// In contrast, FORWARD DECLARATIONS should never use this macro:\n// https://stackoverflow.com/questions/9317473/forward-declaration-of-inline-functions\n#if defined(PYBIND11_NOINLINE_DISABLED) // Option for maximum portability and experimentation.\n#    define PYBIND11_NOINLINE inline\n#elif defined(_MSC_VER)\n#    define PYBIND11_NOINLINE __declspec(noinline) inline\n#else\n#    define PYBIND11_NOINLINE __attribute__((noinline)) inline\n#endif\n\n#if defined(__MINGW32__)\n// For unknown reasons all PYBIND11_DEPRECATED member trigger a warning when declared\n// whether it is used or not\n#    define PYBIND11_DEPRECATED(reason)\n#elif defined(PYBIND11_CPP14)\n#    define PYBIND11_DEPRECATED(reason) [[deprecated(reason)]]\n#else\n#    define PYBIND11_DEPRECATED(reason) __attribute__((deprecated(reason)))\n#endif\n\n#if defined(PYBIND11_CPP17)\n#    define PYBIND11_MAYBE_UNUSED [[maybe_unused]]\n#elif defined(_MSC_VER) && !defined(__clang__)\n#    define PYBIND11_MAYBE_UNUSED\n#else\n#    define PYBIND11_MAYBE_UNUSED __attribute__((__unused__))\n#endif\n\n/* Don't let Python.h #define (v)snprintf as macro because they are implemented\n   properly in Visual Studio since 2015. */\n#if defined(_MSC_VER)\n#    define HAVE_SNPRINTF 1\n#endif\n\n/// Include Python header, disable linking to pythonX_d.lib on Windows in debug mode\n#if defined(_MSC_VER)\nPYBIND11_WARNING_PUSH\nPYBIND11_WARNING_DISABLE_MSVC(4505)\n// C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removed (PyPy only)\n#    if defined(_DEBUG) && !defined(Py_DEBUG)\n// Workaround for a VS 2022 issue.\n// NOTE: This workaround knowingly violates the Python.h include order requirement:\n// https://docs.python.org/3/c-api/intro.html#include-files\n// See https://github.com/pybind/pybind11/pull/3497 for full context.\n#        include <yvals.h>\n#        if _MSVC_STL_VERSION >= 143\n#            include <crtdefs.h>\n#        endif\n#        define PYBIND11_DEBUG_MARKER\n#        undef _DEBUG\n#    endif\n#endif\n\n// https://en.cppreference.com/w/c/chrono/localtime\n#if defined(__STDC_LIB_EXT1__) && !defined(__STDC_WANT_LIB_EXT1__)\n#    define __STDC_WANT_LIB_EXT1__\n#endif\n\n#ifdef __has_include\n// std::optional (but including it in c++14 mode isn't allowed)\n#    if defined(PYBIND11_CPP17) && __has_include(<optional>)\n#        define PYBIND11_HAS_OPTIONAL 1\n#    endif\n// std::experimental::optional (but not allowed in c++11 mode)\n#    if defined(PYBIND11_CPP14) && (__has_include(<experimental/optional>) && \\\n                                 !__has_include(<optional>))\n#        define PYBIND11_HAS_EXP_OPTIONAL 1\n#    endif\n// std::variant\n#    if defined(PYBIND11_CPP17) && __has_include(<variant>)\n#        define PYBIND11_HAS_VARIANT 1\n#    endif\n#elif defined(_MSC_VER) && defined(PYBIND11_CPP17)\n#    define PYBIND11_HAS_OPTIONAL 1\n#    define PYBIND11_HAS_VARIANT 1\n#endif\n\n#if defined(PYBIND11_CPP17)\n#    if defined(__has_include)\n#        if __has_include(<string_view>)\n#            define PYBIND11_HAS_STRING_VIEW\n#        endif\n#    elif defined(_MSC_VER)\n#        define PYBIND11_HAS_STRING_VIEW\n#    endif\n#endif\n\n#include <Python.h>\n// Reminder: WITH_THREAD is always defined if PY_VERSION_HEX >= 0x03070000\n#if PY_VERSION_HEX < 0x03060000\n#    error \"PYTHON < 3.6 IS UNSUPPORTED. pybind11 v2.9 was the last to support Python 2 and 3.5.\"\n#endif\n#include <frameobject.h>\n#include <pythread.h>\n\n/* Python #defines overrides on all sorts of core functions, which\n   tends to weak havok in C++ codebases that expect these to work\n   like regular functions (potentially with several overloads) */\n#if defined(isalnum)\n#    undef isalnum\n#    undef isalpha\n#    undef islower\n#    undef isspace\n#    undef isupper\n#    undef tolower\n#    undef toupper\n#endif\n\n#if defined(copysign)\n#    undef copysign\n#endif\n\n#if defined(PYPY_VERSION) && !defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)\n#    define PYBIND11_SIMPLE_GIL_MANAGEMENT\n#endif\n\n#if defined(_MSC_VER)\n#    if defined(PYBIND11_DEBUG_MARKER)\n#        define _DEBUG\n#        undef PYBIND11_DEBUG_MARKER\n#    endif\nPYBIND11_WARNING_POP\n#endif\n\n#include <cstddef>\n#include <cstring>\n#include <exception>\n#include <forward_list>\n#include <memory>\n#include <stdexcept>\n#include <string>\n#include <type_traits>\n#include <typeindex>\n#include <unordered_map>\n#include <unordered_set>\n#include <vector>\n#if defined(__has_include)\n#    if __has_include(<version>)\n#        include <version>\n#    endif\n#endif\n\n// Must be after including <version> or one of the other headers specified by the standard\n#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L\n#    define PYBIND11_HAS_U8STRING\n#endif\n\n// See description of PR #4246:\n#if !defined(NDEBUG) && !defined(PY_ASSERT_GIL_HELD_INCREF_DECREF)                                \\\n    && !(defined(PYPY_VERSION)                                                                    \\\n         && defined(_MSC_VER)) /* PyPy Windows: pytest hangs indefinitely at the end of the       \\\n                                  process (see PR #4268) */                                       \\\n    && !defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)\n// The following define will be enabled by default in the 2.11 release\n// define PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF\n#endif\n\n// #define PYBIND11_STR_LEGACY_PERMISSIVE\n// If DEFINED, pybind11::str can hold PyUnicodeObject or PyBytesObject\n//             (probably surprising and never documented, but this was the\n//             legacy behavior until and including v2.6.x). As a side-effect,\n//             pybind11::isinstance<str>() is true for both pybind11::str and\n//             pybind11::bytes.\n// If UNDEFINED, pybind11::str can only hold PyUnicodeObject, and\n//               pybind11::isinstance<str>() is true only for pybind11::str.\n//               However, for Python 2 only (!), the pybind11::str caster\n//               implicitly decoded bytes to PyUnicodeObject. This was to ease\n//               the transition from the legacy behavior to the non-permissive\n//               behavior.\n\n/// Compatibility macros for Python 2 / Python 3 versions TODO: remove\n#define PYBIND11_INSTANCE_METHOD_NEW(ptr, class_) PyInstanceMethod_New(ptr)\n#define PYBIND11_INSTANCE_METHOD_CHECK PyInstanceMethod_Check\n#define PYBIND11_INSTANCE_METHOD_GET_FUNCTION PyInstanceMethod_GET_FUNCTION\n#define PYBIND11_BYTES_CHECK PyBytes_Check\n#define PYBIND11_BYTES_FROM_STRING PyBytes_FromString\n#define PYBIND11_BYTES_FROM_STRING_AND_SIZE PyBytes_FromStringAndSize\n#define PYBIND11_BYTES_AS_STRING_AND_SIZE PyBytes_AsStringAndSize\n#define PYBIND11_BYTES_AS_STRING PyBytes_AsString\n#define PYBIND11_BYTES_SIZE PyBytes_Size\n#define PYBIND11_LONG_CHECK(o) PyLong_Check(o)\n#define PYBIND11_LONG_AS_LONGLONG(o) PyLong_AsLongLong(o)\n#define PYBIND11_LONG_FROM_SIGNED(o) PyLong_FromSsize_t((ssize_t) (o))\n#define PYBIND11_LONG_FROM_UNSIGNED(o) PyLong_FromSize_t((size_t) (o))\n#define PYBIND11_BYTES_NAME \"bytes\"\n#define PYBIND11_STRING_NAME \"str\"\n#define PYBIND11_SLICE_OBJECT PyObject\n#define PYBIND11_FROM_STRING PyUnicode_FromString\n#define PYBIND11_STR_TYPE ::pybind11::str\n#define PYBIND11_BOOL_ATTR \"__bool__\"\n#define PYBIND11_NB_BOOL(ptr) ((ptr)->nb_bool)\n#define PYBIND11_BUILTINS_MODULE \"builtins\"\n// Providing a separate declaration to make Clang's -Wmissing-prototypes happy.\n// See comment for PYBIND11_MODULE below for why this is marked \"maybe unused\".\n#define PYBIND11_PLUGIN_IMPL(name)                                                                \\\n    extern \"C\" PYBIND11_MAYBE_UNUSED PYBIND11_EXPORT PyObject *PyInit_##name();                   \\\n    extern \"C\" PYBIND11_EXPORT PyObject *PyInit_##name()\n\n#define PYBIND11_TRY_NEXT_OVERLOAD ((PyObject *) 1) // special failure return code\n#define PYBIND11_STRINGIFY(x) #x\n#define PYBIND11_TOSTRING(x) PYBIND11_STRINGIFY(x)\n#define PYBIND11_CONCAT(first, second) first##second\n#define PYBIND11_ENSURE_INTERNALS_READY pybind11::detail::get_internals();\n\n#define PYBIND11_CHECK_PYTHON_VERSION                                                             \\\n    {                                                                                             \\\n        const char *compiled_ver                                                                  \\\n            = PYBIND11_TOSTRING(PY_MAJOR_VERSION) \".\" PYBIND11_TOSTRING(PY_MINOR_VERSION);        \\\n        const char *runtime_ver = Py_GetVersion();                                                \\\n        size_t len = std::strlen(compiled_ver);                                                   \\\n        if (std::strncmp(runtime_ver, compiled_ver, len) != 0                                     \\\n            || (runtime_ver[len] >= '0' && runtime_ver[len] <= '9')) {                            \\\n            PyErr_Format(PyExc_ImportError,                                                       \\\n                         \"Python version mismatch: module was compiled for Python %s, \"           \\\n                         \"but the interpreter version is incompatible: %s.\",                      \\\n                         compiled_ver,                                                            \\\n                         runtime_ver);                                                            \\\n            return nullptr;                                                                       \\\n        }                                                                                         \\\n    }\n\n#define PYBIND11_CATCH_INIT_EXCEPTIONS                                                            \\\n    catch (pybind11::error_already_set & e) {                                                     \\\n        pybind11::raise_from(e, PyExc_ImportError, \"initialization failed\");                      \\\n        return nullptr;                                                                           \\\n    }                                                                                             \\\n    catch (const std::exception &e) {                                                             \\\n        PyErr_SetString(PyExc_ImportError, e.what());                                             \\\n        return nullptr;                                                                           \\\n    }\n\n/** \\rst\n    ***Deprecated in favor of PYBIND11_MODULE***\n\n    This macro creates the entry point that will be invoked when the Python interpreter\n    imports a plugin library. Please create a `module_` in the function body and return\n    the pointer to its underlying Python object at the end.\n\n    .. code-block:: cpp\n\n        PYBIND11_PLUGIN(example) {\n            pybind11::module_ m(\"example\", \"pybind11 example plugin\");\n            /// Set up bindings here\n            return m.ptr();\n        }\n\\endrst */\n#define PYBIND11_PLUGIN(name)                                                                     \\\n    PYBIND11_DEPRECATED(\"PYBIND11_PLUGIN is deprecated, use PYBIND11_MODULE\")                     \\\n    static PyObject *pybind11_init();                                                             \\\n    PYBIND11_PLUGIN_IMPL(name) {                                                                  \\\n        PYBIND11_CHECK_PYTHON_VERSION                                                             \\\n        PYBIND11_ENSURE_INTERNALS_READY                                                           \\\n        try {                                                                                     \\\n            return pybind11_init();                                                               \\\n        }                                                                                         \\\n        PYBIND11_CATCH_INIT_EXCEPTIONS                                                            \\\n    }                                                                                             \\\n    PyObject *pybind11_init()\n\n/** \\rst\n    This macro creates the entry point that will be invoked when the Python interpreter\n    imports an extension module. The module name is given as the first argument and it\n    should not be in quotes. The second macro argument defines a variable of type\n    `py::module_` which can be used to initialize the module.\n\n    The entry point is marked as \"maybe unused\" to aid dead-code detection analysis:\n    since the entry point is typically only looked up at runtime and not referenced\n    during translation, it would otherwise appear as unused (\"dead\") code.\n\n    .. code-block:: cpp\n\n        PYBIND11_MODULE(example, m) {\n            m.doc() = \"pybind11 example module\";\n\n            // Add bindings here\n            m.def(\"foo\", []() {\n                return \"Hello, World!\";\n            });\n        }\n\\endrst */\n#define PYBIND11_MODULE(name, variable)                                                           \\\n    static ::pybind11::module_::module_def PYBIND11_CONCAT(pybind11_module_def_, name)            \\\n        PYBIND11_MAYBE_UNUSED;                                                                    \\\n    PYBIND11_MAYBE_UNUSED                                                                         \\\n    static void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_ &);                     \\\n    PYBIND11_PLUGIN_IMPL(name) {                                                                  \\\n        PYBIND11_CHECK_PYTHON_VERSION                                                             \\\n        PYBIND11_ENSURE_INTERNALS_READY                                                           \\\n        auto m = ::pybind11::module_::create_extension_module(                                    \\\n            PYBIND11_TOSTRING(name), nullptr, &PYBIND11_CONCAT(pybind11_module_def_, name));      \\\n        try {                                                                                     \\\n            PYBIND11_CONCAT(pybind11_init_, name)(m);                                             \\\n            return m.ptr();                                                                       \\\n        }                                                                                         \\\n        PYBIND11_CATCH_INIT_EXCEPTIONS                                                            \\\n    }                                                                                             \\\n    void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_ & (variable))\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nusing ssize_t = Py_ssize_t;\nusing size_t = std::size_t;\n\ntemplate <typename IntType>\ninline ssize_t ssize_t_cast(const IntType &val) {\n    static_assert(sizeof(IntType) <= sizeof(ssize_t), \"Implicit narrowing is not permitted.\");\n    return static_cast<ssize_t>(val);\n}\n\n/// Approach used to cast a previously unknown C++ instance into a Python object\nenum class return_value_policy : uint8_t {\n    /** This is the default return value policy, which falls back to the policy\n        return_value_policy::take_ownership when the return value is a pointer.\n        Otherwise, it uses return_value::move or return_value::copy for rvalue\n        and lvalue references, respectively. See below for a description of what\n        all of these different policies do. */\n    automatic = 0,\n\n    /** As above, but use policy return_value_policy::reference when the return\n        value is a pointer. This is the default conversion policy for function\n        arguments when calling Python functions manually from C++ code (i.e. via\n        handle::operator()). You probably won't need to use this. */\n    automatic_reference,\n\n    /** Reference an existing object (i.e. do not create a new copy) and take\n        ownership. Python will call the destructor and delete operator when the\n        object's reference count reaches zero. Undefined behavior ensues when\n        the C++ side does the same.. */\n    take_ownership,\n\n    /** Create a new copy of the returned object, which will be owned by\n        Python. This policy is comparably safe because the lifetimes of the two\n        instances are decoupled. */\n    copy,\n\n    /** Use std::move to move the return value contents into a new instance\n        that will be owned by Python. This policy is comparably safe because the\n        lifetimes of the two instances (move source and destination) are\n        decoupled. */\n    move,\n\n    /** Reference an existing object, but do not take ownership. The C++ side\n        is responsible for managing the object's lifetime and deallocating it\n        when it is no longer used. Warning: undefined behavior will ensue when\n        the C++ side deletes an object that is still referenced and used by\n        Python. */\n    reference,\n\n    /** This policy only applies to methods and properties. It references the\n        object without taking ownership similar to the above\n        return_value_policy::reference policy. In contrast to that policy, the\n        function or property's implicit this argument (called the parent) is\n        considered to be the the owner of the return value (the child).\n        pybind11 then couples the lifetime of the parent to the child via a\n        reference relationship that ensures that the parent cannot be garbage\n        collected while Python is still using the child. More advanced\n        variations of this scheme are also possible using combinations of\n        return_value_policy::reference and the keep_alive call policy */\n    reference_internal\n};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ninline static constexpr int log2(size_t n, int k = 0) {\n    return (n <= 1) ? k : log2(n >> 1, k + 1);\n}\n\n// Returns the size as a multiple of sizeof(void *), rounded up.\ninline static constexpr size_t size_in_ptrs(size_t s) {\n    return 1 + ((s - 1) >> log2(sizeof(void *)));\n}\n\n/**\n * The space to allocate for simple layout instance holders (see below) in multiple of the size of\n * a pointer (e.g.  2 means 16 bytes on 64-bit architectures).  The default is the minimum required\n * to holder either a std::unique_ptr or std::shared_ptr (which is almost always\n * sizeof(std::shared_ptr<T>)).\n */\nconstexpr size_t instance_simple_holder_in_ptrs() {\n    static_assert(sizeof(std::shared_ptr<int>) >= sizeof(std::unique_ptr<int>),\n                  \"pybind assumes std::shared_ptrs are at least as big as std::unique_ptrs\");\n    return size_in_ptrs(sizeof(std::shared_ptr<int>));\n}\n\n// Forward declarations\nstruct type_info;\nstruct value_and_holder;\n\nstruct nonsimple_values_and_holders {\n    void **values_and_holders;\n    uint8_t *status;\n};\n\n/// The 'instance' type which needs to be standard layout (need to be able to use 'offsetof')\nstruct instance {\n    PyObject_HEAD\n    /// Storage for pointers and holder; see simple_layout, below, for a description\n    union {\n        void *simple_value_holder[1 + instance_simple_holder_in_ptrs()];\n        nonsimple_values_and_holders nonsimple;\n    };\n    /// Weak references\n    PyObject *weakrefs;\n    /// If true, the pointer is owned which means we're free to manage it with a holder.\n    bool owned : 1;\n    /**\n     * An instance has two possible value/holder layouts.\n     *\n     * Simple layout (when this flag is true), means the `simple_value_holder` is set with a\n     * pointer and the holder object governing that pointer, i.e. [val1*][holder].  This layout is\n     * applied whenever there is no python-side multiple inheritance of bound C++ types *and* the\n     * type's holder will fit in the default space (which is large enough to hold either a\n     * std::unique_ptr or std::shared_ptr).\n     *\n     * Non-simple layout applies when using custom holders that require more space than\n     * `shared_ptr` (which is typically the size of two pointers), or when multiple inheritance is\n     * used on the python side.  Non-simple layout allocates the required amount of memory to have\n     * multiple bound C++ classes as parents.  Under this layout, `nonsimple.values_and_holders` is\n     * set to a pointer to allocated space of the required space to hold a sequence of value\n     * pointers and holders followed `status`, a set of bit flags (1 byte each), i.e.\n     * [val1*][holder1][val2*][holder2]...[bb...]  where each [block] is rounded up to a multiple\n     * of `sizeof(void *)`.  `nonsimple.status` is, for convenience, a pointer to the beginning of\n     * the [bb...] block (but not independently allocated).\n     *\n     * Status bits indicate whether the associated holder is constructed (&\n     * status_holder_constructed) and whether the value pointer is registered (&\n     * status_instance_registered) in `registered_instances`.\n     */\n    bool simple_layout : 1;\n    /// For simple layout, tracks whether the holder has been constructed\n    bool simple_holder_constructed : 1;\n    /// For simple layout, tracks whether the instance is registered in `registered_instances`\n    bool simple_instance_registered : 1;\n    /// If true, get_internals().patients has an entry for this object\n    bool has_patients : 1;\n\n    /// Initializes all of the above type/values/holders data (but not the instance values\n    /// themselves)\n    void allocate_layout();\n\n    /// Destroys/deallocates all of the above\n    void deallocate_layout();\n\n    /// Returns the value_and_holder wrapper for the given type (or the first, if `find_type`\n    /// omitted).  Returns a default-constructed (with `.inst = nullptr`) object on failure if\n    /// `throw_if_missing` is false.\n    value_and_holder get_value_and_holder(const type_info *find_type = nullptr,\n                                          bool throw_if_missing = true);\n\n    /// Bit values for the non-simple status flags\n    static constexpr uint8_t status_holder_constructed = 1;\n    static constexpr uint8_t status_instance_registered = 2;\n};\n\nstatic_assert(std::is_standard_layout<instance>::value,\n              \"Internal error: `pybind11::detail::instance` is not standard layout!\");\n\n/// from __cpp_future__ import (convenient aliases from C++14/17)\n#if defined(PYBIND11_CPP14)\nusing std::conditional_t;\nusing std::enable_if_t;\nusing std::remove_cv_t;\nusing std::remove_reference_t;\n#else\ntemplate <bool B, typename T = void>\nusing enable_if_t = typename std::enable_if<B, T>::type;\ntemplate <bool B, typename T, typename F>\nusing conditional_t = typename std::conditional<B, T, F>::type;\ntemplate <typename T>\nusing remove_cv_t = typename std::remove_cv<T>::type;\ntemplate <typename T>\nusing remove_reference_t = typename std::remove_reference<T>::type;\n#endif\n\n#if defined(PYBIND11_CPP20)\nusing std::remove_cvref;\nusing std::remove_cvref_t;\n#else\ntemplate <class T>\nstruct remove_cvref {\n    using type = remove_cv_t<remove_reference_t<T>>;\n};\ntemplate <class T>\nusing remove_cvref_t = typename remove_cvref<T>::type;\n#endif\n\n/// Index sequences\n#if defined(PYBIND11_CPP14)\nusing std::index_sequence;\nusing std::make_index_sequence;\n#else\ntemplate <size_t...>\nstruct index_sequence {};\ntemplate <size_t N, size_t... S>\nstruct make_index_sequence_impl : make_index_sequence_impl<N - 1, N - 1, S...> {};\ntemplate <size_t... S>\nstruct make_index_sequence_impl<0, S...> {\n    using type = index_sequence<S...>;\n};\ntemplate <size_t N>\nusing make_index_sequence = typename make_index_sequence_impl<N>::type;\n#endif\n\n/// Make an index sequence of the indices of true arguments\ntemplate <typename ISeq, size_t, bool...>\nstruct select_indices_impl {\n    using type = ISeq;\n};\ntemplate <size_t... IPrev, size_t I, bool B, bool... Bs>\nstruct select_indices_impl<index_sequence<IPrev...>, I, B, Bs...>\n    : select_indices_impl<conditional_t<B, index_sequence<IPrev..., I>, index_sequence<IPrev...>>,\n                          I + 1,\n                          Bs...> {};\ntemplate <bool... Bs>\nusing select_indices = typename select_indices_impl<index_sequence<>, 0, Bs...>::type;\n\n/// Backports of std::bool_constant and std::negation to accommodate older compilers\ntemplate <bool B>\nusing bool_constant = std::integral_constant<bool, B>;\ntemplate <typename T>\nstruct negation : bool_constant<!T::value> {};\n\n// PGI/Intel cannot detect operator delete with the \"compatible\" void_t impl, so\n// using the new one (C++14 defect, so generally works on newer compilers, even\n// if not in C++17 mode)\n#if defined(__PGIC__) || defined(__INTEL_COMPILER)\ntemplate <typename...>\nusing void_t = void;\n#else\ntemplate <typename...>\nstruct void_t_impl {\n    using type = void;\n};\ntemplate <typename... Ts>\nusing void_t = typename void_t_impl<Ts...>::type;\n#endif\n\n/// Compile-time all/any/none of that check the boolean value of all template types\n#if defined(__cpp_fold_expressions) && !(defined(_MSC_VER) && (_MSC_VER < 1916))\ntemplate <class... Ts>\nusing all_of = bool_constant<(Ts::value && ...)>;\ntemplate <class... Ts>\nusing any_of = bool_constant<(Ts::value || ...)>;\n#elif !defined(_MSC_VER)\ntemplate <bool...>\nstruct bools {};\ntemplate <class... Ts>\nusing all_of = std::is_same<bools<Ts::value..., true>, bools<true, Ts::value...>>;\ntemplate <class... Ts>\nusing any_of = negation<all_of<negation<Ts>...>>;\n#else\n// MSVC has trouble with the above, but supports std::conjunction, which we can use instead (albeit\n// at a slight loss of compilation efficiency).\ntemplate <class... Ts>\nusing all_of = std::conjunction<Ts...>;\ntemplate <class... Ts>\nusing any_of = std::disjunction<Ts...>;\n#endif\ntemplate <class... Ts>\nusing none_of = negation<any_of<Ts...>>;\n\ntemplate <class T, template <class> class... Predicates>\nusing satisfies_all_of = all_of<Predicates<T>...>;\ntemplate <class T, template <class> class... Predicates>\nusing satisfies_any_of = any_of<Predicates<T>...>;\ntemplate <class T, template <class> class... Predicates>\nusing satisfies_none_of = none_of<Predicates<T>...>;\n\n/// Strip the class from a method type\ntemplate <typename T>\nstruct remove_class {};\ntemplate <typename C, typename R, typename... A>\nstruct remove_class<R (C::*)(A...)> {\n    using type = R(A...);\n};\ntemplate <typename C, typename R, typename... A>\nstruct remove_class<R (C::*)(A...) const> {\n    using type = R(A...);\n};\n\n/// Helper template to strip away type modifiers\ntemplate <typename T>\nstruct intrinsic_type {\n    using type = T;\n};\ntemplate <typename T>\nstruct intrinsic_type<const T> {\n    using type = typename intrinsic_type<T>::type;\n};\ntemplate <typename T>\nstruct intrinsic_type<T *> {\n    using type = typename intrinsic_type<T>::type;\n};\ntemplate <typename T>\nstruct intrinsic_type<T &> {\n    using type = typename intrinsic_type<T>::type;\n};\ntemplate <typename T>\nstruct intrinsic_type<T &&> {\n    using type = typename intrinsic_type<T>::type;\n};\ntemplate <typename T, size_t N>\nstruct intrinsic_type<const T[N]> {\n    using type = typename intrinsic_type<T>::type;\n};\ntemplate <typename T, size_t N>\nstruct intrinsic_type<T[N]> {\n    using type = typename intrinsic_type<T>::type;\n};\ntemplate <typename T>\nusing intrinsic_t = typename intrinsic_type<T>::type;\n\n/// Helper type to replace 'void' in some expressions\nstruct void_type {};\n\n/// Helper template which holds a list of types\ntemplate <typename...>\nstruct type_list {};\n\n/// Compile-time integer sum\n#ifdef __cpp_fold_expressions\ntemplate <typename... Ts>\nconstexpr size_t constexpr_sum(Ts... ns) {\n    return (0 + ... + size_t{ns});\n}\n#else\nconstexpr size_t constexpr_sum() { return 0; }\ntemplate <typename T, typename... Ts>\nconstexpr size_t constexpr_sum(T n, Ts... ns) {\n    return size_t{n} + constexpr_sum(ns...);\n}\n#endif\n\nPYBIND11_NAMESPACE_BEGIN(constexpr_impl)\n/// Implementation details for constexpr functions\nconstexpr int first(int i) { return i; }\ntemplate <typename T, typename... Ts>\nconstexpr int first(int i, T v, Ts... vs) {\n    return v ? i : first(i + 1, vs...);\n}\n\nconstexpr int last(int /*i*/, int result) { return result; }\ntemplate <typename T, typename... Ts>\nconstexpr int last(int i, int result, T v, Ts... vs) {\n    return last(i + 1, v ? i : result, vs...);\n}\nPYBIND11_NAMESPACE_END(constexpr_impl)\n\n/// Return the index of the first type in Ts which satisfies Predicate<T>.\n/// Returns sizeof...(Ts) if none match.\ntemplate <template <typename> class Predicate, typename... Ts>\nconstexpr int constexpr_first() {\n    return constexpr_impl::first(0, Predicate<Ts>::value...);\n}\n\n/// Return the index of the last type in Ts which satisfies Predicate<T>, or -1 if none match.\ntemplate <template <typename> class Predicate, typename... Ts>\nconstexpr int constexpr_last() {\n    return constexpr_impl::last(0, -1, Predicate<Ts>::value...);\n}\n\n/// Return the Nth element from the parameter pack\ntemplate <size_t N, typename T, typename... Ts>\nstruct pack_element {\n    using type = typename pack_element<N - 1, Ts...>::type;\n};\ntemplate <typename T, typename... Ts>\nstruct pack_element<0, T, Ts...> {\n    using type = T;\n};\n\n/// Return the one and only type which matches the predicate, or Default if none match.\n/// If more than one type matches the predicate, fail at compile-time.\ntemplate <template <typename> class Predicate, typename Default, typename... Ts>\nstruct exactly_one {\n    static constexpr auto found = constexpr_sum(Predicate<Ts>::value...);\n    static_assert(found <= 1, \"Found more than one type matching the predicate\");\n\n    static constexpr auto index = found ? constexpr_first<Predicate, Ts...>() : 0;\n    using type = conditional_t<found, typename pack_element<index, Ts...>::type, Default>;\n};\ntemplate <template <typename> class P, typename Default>\nstruct exactly_one<P, Default> {\n    using type = Default;\n};\n\ntemplate <template <typename> class Predicate, typename Default, typename... Ts>\nusing exactly_one_t = typename exactly_one<Predicate, Default, Ts...>::type;\n\n/// Defer the evaluation of type T until types Us are instantiated\ntemplate <typename T, typename... /*Us*/>\nstruct deferred_type {\n    using type = T;\n};\ntemplate <typename T, typename... Us>\nusing deferred_t = typename deferred_type<T, Us...>::type;\n\n/// Like is_base_of, but requires a strict base (i.e. `is_strict_base_of<T, T>::value == false`,\n/// unlike `std::is_base_of`)\ntemplate <typename Base, typename Derived>\nusing is_strict_base_of\n    = bool_constant<std::is_base_of<Base, Derived>::value && !std::is_same<Base, Derived>::value>;\n\n/// Like is_base_of, but also requires that the base type is accessible (i.e. that a Derived\n/// pointer can be converted to a Base pointer) For unions, `is_base_of<T, T>::value` is False, so\n/// we need to check `is_same` as well.\ntemplate <typename Base, typename Derived>\nusing is_accessible_base_of\n    = bool_constant<(std::is_same<Base, Derived>::value || std::is_base_of<Base, Derived>::value)\n                    && std::is_convertible<Derived *, Base *>::value>;\n\ntemplate <template <typename...> class Base>\nstruct is_template_base_of_impl {\n    template <typename... Us>\n    static std::true_type check(Base<Us...> *);\n    static std::false_type check(...);\n};\n\n/// Check if a template is the base of a type. For example:\n/// `is_template_base_of<Base, T>` is true if `struct T : Base<U> {}` where U can be anything\ntemplate <template <typename...> class Base, typename T>\n// Sadly, all MSVC versions incl. 2022 need the workaround, even in C++20 mode.\n// See also: https://github.com/pybind/pybind11/pull/3741\n#if !defined(_MSC_VER)\nusing is_template_base_of\n    = decltype(is_template_base_of_impl<Base>::check((intrinsic_t<T> *) nullptr));\n#else\nstruct is_template_base_of\n    : decltype(is_template_base_of_impl<Base>::check((intrinsic_t<T> *) nullptr)) {\n};\n#endif\n\n/// Check if T is an instantiation of the template `Class`. For example:\n/// `is_instantiation<shared_ptr, T>` is true if `T == shared_ptr<U>` where U can be anything.\ntemplate <template <typename...> class Class, typename T>\nstruct is_instantiation : std::false_type {};\ntemplate <template <typename...> class Class, typename... Us>\nstruct is_instantiation<Class, Class<Us...>> : std::true_type {};\n\n/// Check if T is std::shared_ptr<U> where U can be anything\ntemplate <typename T>\nusing is_shared_ptr = is_instantiation<std::shared_ptr, T>;\n\n/// Check if T looks like an input iterator\ntemplate <typename T, typename = void>\nstruct is_input_iterator : std::false_type {};\ntemplate <typename T>\nstruct is_input_iterator<T,\n                         void_t<decltype(*std::declval<T &>()), decltype(++std::declval<T &>())>>\n    : std::true_type {};\n\ntemplate <typename T>\nusing is_function_pointer\n    = bool_constant<std::is_pointer<T>::value\n                    && std::is_function<typename std::remove_pointer<T>::type>::value>;\n\ntemplate <typename F>\nstruct strip_function_object {\n    // If you are encountering an\n    // 'error: name followed by \"::\" must be a class or namespace name'\n    // with the Intel compiler and a noexcept function here,\n    // try to use noexcept(true) instead of plain noexcept.\n    using type = typename remove_class<decltype(&F::operator())>::type;\n};\n\n// Extracts the function signature from a function, function pointer or lambda.\ntemplate <typename Function, typename F = remove_reference_t<Function>>\nusing function_signature_t = conditional_t<\n    std::is_function<F>::value,\n    F,\n    typename conditional_t<std::is_pointer<F>::value || std::is_member_pointer<F>::value,\n                           std::remove_pointer<F>,\n                           strip_function_object<F>>::type>;\n\n/// Returns true if the type looks like a lambda: that is, isn't a function, pointer or member\n/// pointer.  Note that this can catch all sorts of other things, too; this is intended to be used\n/// in a place where passing a lambda makes sense.\ntemplate <typename T>\nusing is_lambda = satisfies_none_of<remove_reference_t<T>,\n                                    std::is_function,\n                                    std::is_pointer,\n                                    std::is_member_pointer>;\n\n// [workaround(intel)] Internal error on fold expression\n/// Apply a function over each element of a parameter pack\n#if defined(__cpp_fold_expressions) && !defined(__INTEL_COMPILER)\n// Intel compiler produces an internal error on this fold expression (tested with ICC 19.0.2)\n#    define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) (((PATTERN), void()), ...)\n#else\nusing expand_side_effects = bool[];\n#    define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN)                                                 \\\n        (void) pybind11::detail::expand_side_effects { ((PATTERN), void(), false)..., false }\n#endif\n\nPYBIND11_NAMESPACE_END(detail)\n\n/// C++ bindings of builtin Python exceptions\nclass PYBIND11_EXPORT_EXCEPTION builtin_exception : public std::runtime_error {\npublic:\n    using std::runtime_error::runtime_error;\n    /// Set the error using the Python C API\n    virtual void set_error() const = 0;\n};\n\n#define PYBIND11_RUNTIME_EXCEPTION(name, type)                                                    \\\n    class PYBIND11_EXPORT_EXCEPTION name : public builtin_exception {                             \\\n    public:                                                                                       \\\n        using builtin_exception::builtin_exception;                                               \\\n        name() : name(\"\") {}                                                                      \\\n        void set_error() const override { PyErr_SetString(type, what()); }                        \\\n    };\n\nPYBIND11_RUNTIME_EXCEPTION(stop_iteration, PyExc_StopIteration)\nPYBIND11_RUNTIME_EXCEPTION(index_error, PyExc_IndexError)\nPYBIND11_RUNTIME_EXCEPTION(key_error, PyExc_KeyError)\nPYBIND11_RUNTIME_EXCEPTION(value_error, PyExc_ValueError)\nPYBIND11_RUNTIME_EXCEPTION(type_error, PyExc_TypeError)\nPYBIND11_RUNTIME_EXCEPTION(buffer_error, PyExc_BufferError)\nPYBIND11_RUNTIME_EXCEPTION(import_error, PyExc_ImportError)\nPYBIND11_RUNTIME_EXCEPTION(attribute_error, PyExc_AttributeError)\nPYBIND11_RUNTIME_EXCEPTION(cast_error, PyExc_RuntimeError) /// Thrown when pybind11::cast or\n                                                           /// handle::call fail due to a type\n                                                           /// casting error\nPYBIND11_RUNTIME_EXCEPTION(reference_cast_error, PyExc_RuntimeError) /// Used internally\n\n[[noreturn]] PYBIND11_NOINLINE void pybind11_fail(const char *reason) {\n    assert(!PyErr_Occurred());\n    throw std::runtime_error(reason);\n}\n[[noreturn]] PYBIND11_NOINLINE void pybind11_fail(const std::string &reason) {\n    assert(!PyErr_Occurred());\n    throw std::runtime_error(reason);\n}\n\ntemplate <typename T, typename SFINAE = void>\nstruct format_descriptor {};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n// Returns the index of the given type in the type char array below, and in the list in numpy.h\n// The order here is: bool; 8 ints ((signed,unsigned)x(8,16,32,64)bits); float,double,long double;\n// complex float,double,long double.  Note that the long double types only participate when long\n// double is actually longer than double (it isn't under MSVC).\n// NB: not only the string below but also complex.h and numpy.h rely on this order.\ntemplate <typename T, typename SFINAE = void>\nstruct is_fmt_numeric {\n    static constexpr bool value = false;\n};\ntemplate <typename T>\nstruct is_fmt_numeric<T, enable_if_t<std::is_arithmetic<T>::value>> {\n    static constexpr bool value = true;\n    static constexpr int index\n        = std::is_same<T, bool>::value\n              ? 0\n              : 1\n                    + (std::is_integral<T>::value\n                           ? detail::log2(sizeof(T)) * 2 + std::is_unsigned<T>::value\n                           : 8\n                                 + (std::is_same<T, double>::value        ? 1\n                                    : std::is_same<T, long double>::value ? 2\n                                                                          : 0));\n};\nPYBIND11_NAMESPACE_END(detail)\n\ntemplate <typename T>\nstruct format_descriptor<T, detail::enable_if_t<std::is_arithmetic<T>::value>> {\n    static constexpr const char c = \"?bBhHiIqQfdg\"[detail::is_fmt_numeric<T>::index];\n    static constexpr const char value[2] = {c, '\\0'};\n    static std::string format() { return std::string(1, c); }\n};\n\n#if !defined(PYBIND11_CPP17)\n\ntemplate <typename T>\nconstexpr const char\n    format_descriptor<T, detail::enable_if_t<std::is_arithmetic<T>::value>>::value[2];\n\n#endif\n\n/// RAII wrapper that temporarily clears any Python error state\nstruct error_scope {\n    PyObject *type, *value, *trace;\n    error_scope() { PyErr_Fetch(&type, &value, &trace); }\n    error_scope(const error_scope &) = delete;\n    error_scope &operator=(const error_scope &) = delete;\n    ~error_scope() { PyErr_Restore(type, value, trace); }\n};\n\n/// Dummy destructor wrapper that can be used to expose classes with a private destructor\nstruct nodelete {\n    template <typename T>\n    void operator()(T *) {}\n};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\ntemplate <typename... Args>\nstruct overload_cast_impl {\n    template <typename Return>\n    constexpr auto operator()(Return (*pf)(Args...)) const noexcept -> decltype(pf) {\n        return pf;\n    }\n\n    template <typename Return, typename Class>\n    constexpr auto operator()(Return (Class::*pmf)(Args...), std::false_type = {}) const noexcept\n        -> decltype(pmf) {\n        return pmf;\n    }\n\n    template <typename Return, typename Class>\n    constexpr auto operator()(Return (Class::*pmf)(Args...) const, std::true_type) const noexcept\n        -> decltype(pmf) {\n        return pmf;\n    }\n};\nPYBIND11_NAMESPACE_END(detail)\n\n// overload_cast requires variable templates: C++14\n#if defined(PYBIND11_CPP14)\n#    define PYBIND11_OVERLOAD_CAST 1\n/// Syntax sugar for resolving overloaded function pointers:\n///  - regular: static_cast<Return (Class::*)(Arg0, Arg1, Arg2)>(&Class::func)\n///  - sweet:   overload_cast<Arg0, Arg1, Arg2>(&Class::func)\ntemplate <typename... Args>\nstatic constexpr detail::overload_cast_impl<Args...> overload_cast{};\n#endif\n\n/// Const member function selector for overload_cast\n///  - regular: static_cast<Return (Class::*)(Arg) const>(&Class::func)\n///  - sweet:   overload_cast<Arg>(&Class::func, const_)\nstatic constexpr auto const_ = std::true_type{};\n\n#if !defined(PYBIND11_CPP14) // no overload_cast: providing something that static_assert-fails:\ntemplate <typename... Args>\nstruct overload_cast {\n    static_assert(detail::deferred_t<std::false_type, Args...>::value,\n                  \"pybind11::overload_cast<...> requires compiling in C++14 mode\");\n};\n#endif // overload_cast\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n// Adaptor for converting arbitrary container arguments into a vector; implicitly convertible from\n// any standard container (or C-style array) supporting std::begin/std::end, any singleton\n// arithmetic type (if T is arithmetic), or explicitly constructible from an iterator pair.\ntemplate <typename T>\nclass any_container {\n    std::vector<T> v;\n\npublic:\n    any_container() = default;\n\n    // Can construct from a pair of iterators\n    template <typename It, typename = enable_if_t<is_input_iterator<It>::value>>\n    any_container(It first, It last) : v(first, last) {}\n\n    // Implicit conversion constructor from any arbitrary container type\n    // with values convertible to T\n    template <typename Container,\n              typename = enable_if_t<\n                  std::is_convertible<decltype(*std::begin(std::declval<const Container &>())),\n                                      T>::value>>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    any_container(const Container &c) : any_container(std::begin(c), std::end(c)) {}\n\n    // initializer_list's aren't deducible, so don't get matched by the above template;\n    // we need this to explicitly allow implicit conversion from one:\n    template <typename TIn, typename = enable_if_t<std::is_convertible<TIn, T>::value>>\n    any_container(const std::initializer_list<TIn> &c) : any_container(c.begin(), c.end()) {}\n\n    // Avoid copying if given an rvalue vector of the correct type.\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    any_container(std::vector<T> &&v) : v(std::move(v)) {}\n\n    // Moves the vector out of an rvalue any_container\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator std::vector<T> &&() && { return std::move(v); }\n\n    // Dereferencing obtains a reference to the underlying vector\n    std::vector<T> &operator*() { return v; }\n    const std::vector<T> &operator*() const { return v; }\n\n    // -> lets you call methods on the underlying vector\n    std::vector<T> *operator->() { return &v; }\n    const std::vector<T> *operator->() const { return &v; }\n};\n\n// Forward-declaration; see detail/class.h\nstd::string get_fully_qualified_tp_name(PyTypeObject *);\n\ntemplate <typename T>\ninline static std::shared_ptr<T>\ntry_get_shared_from_this(std::enable_shared_from_this<T> *holder_value_ptr) {\n// Pre C++17, this code path exploits undefined behavior, but is known to work on many platforms.\n// Use at your own risk!\n// See also https://en.cppreference.com/w/cpp/memory/enable_shared_from_this, and in particular\n// the `std::shared_ptr<Good> gp1 = not_so_good.getptr();` and `try`-`catch` parts of the example.\n#if defined(__cpp_lib_enable_shared_from_this) && (!defined(_MSC_VER) || _MSC_VER >= 1912)\n    return holder_value_ptr->weak_from_this().lock();\n#else\n    try {\n        return holder_value_ptr->shared_from_this();\n    } catch (const std::bad_weak_ptr &) {\n        return nullptr;\n    }\n#endif\n}\n\n// For silencing \"unused\" compiler warnings in special situations.\ntemplate <typename... Args>\n#if defined(_MSC_VER) && _MSC_VER < 1920 // MSVC 2017\nconstexpr\n#endif\n    inline void\n    silence_unused_warnings(Args &&...) {\n}\n\n// MSVC warning C4100: Unreferenced formal parameter\n#if defined(_MSC_VER) && _MSC_VER <= 1916\n#    define PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(...)                                         \\\n        detail::silence_unused_warnings(__VA_ARGS__)\n#else\n#    define PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(...)\n#endif\n\n// GCC -Wunused-but-set-parameter  All GCC versions (as of July 2021).\n#if defined(__GNUG__) && !defined(__clang__) && !defined(__INTEL_COMPILER)\n#    define PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(...)                       \\\n        detail::silence_unused_warnings(__VA_ARGS__)\n#else\n#    define PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(...)\n#endif\n\n#if defined(__clang__)                                                                            \\\n    && (defined(__apple_build_version__) /* AppleClang 13.0.0.13000029 was the only data point    \\\n                                            available. */                                         \\\n        || (__clang_major__ >= 7                                                                  \\\n            && __clang_major__ <= 12) /* Clang 3, 5, 13, 14, 15 do not generate the warning. */   \\\n    )\n#    define PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING\n// Example:\n// tests/test_kwargs_and_defaults.cpp:46:68: error: local variable 'args' will be copied despite\n// being returned by name [-Werror,-Wreturn-std-move]\n//     m.def(\"args_function\", [](py::args args) -> py::tuple { return args; });\n//                                                                    ^~~~\n// test_kwargs_and_defaults.cpp:46:68: note: call 'std::move' explicitly to avoid copying\n//     m.def(\"args_function\", [](py::args args) -> py::tuple { return args; });\n//                                                                    ^~~~\n//                                                                    std::move(args)\n#endif\n\n// Pybind offers detailed error messages by default for all builts that are debug (through the\n// negation of ndebug). This can also be manually enabled by users, for any builds, through\n// defining PYBIND11_DETAILED_ERROR_MESSAGES.\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES) && !defined(NDEBUG)\n#    define PYBIND11_DETAILED_ERROR_MESSAGES\n#endif\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/detail/descr.h",
    "content": "/*\n    pybind11/detail/descr.h: Helper type for concatenating type signatures at compile time\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"common.h\"\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n#if !defined(_MSC_VER)\n#    define PYBIND11_DESCR_CONSTEXPR static constexpr\n#else\n#    define PYBIND11_DESCR_CONSTEXPR const\n#endif\n\n/* Concatenate type signatures at compile time */\ntemplate <size_t N, typename... Ts>\nstruct descr {\n    char text[N + 1]{'\\0'};\n\n    constexpr descr() = default;\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    constexpr descr(char const (&s)[N + 1]) : descr(s, make_index_sequence<N>()) {}\n\n    template <size_t... Is>\n    constexpr descr(char const (&s)[N + 1], index_sequence<Is...>) : text{s[Is]..., '\\0'} {}\n\n    template <typename... Chars>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    constexpr descr(char c, Chars... cs) : text{c, static_cast<char>(cs)..., '\\0'} {}\n\n    static constexpr std::array<const std::type_info *, sizeof...(Ts) + 1> types() {\n        return {{&typeid(Ts)..., nullptr}};\n    }\n};\n\ntemplate <size_t N1, size_t N2, typename... Ts1, typename... Ts2, size_t... Is1, size_t... Is2>\nconstexpr descr<N1 + N2, Ts1..., Ts2...> plus_impl(const descr<N1, Ts1...> &a,\n                                                   const descr<N2, Ts2...> &b,\n                                                   index_sequence<Is1...>,\n                                                   index_sequence<Is2...>) {\n    PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(b);\n    return {a.text[Is1]..., b.text[Is2]...};\n}\n\ntemplate <size_t N1, size_t N2, typename... Ts1, typename... Ts2>\nconstexpr descr<N1 + N2, Ts1..., Ts2...> operator+(const descr<N1, Ts1...> &a,\n                                                   const descr<N2, Ts2...> &b) {\n    return plus_impl(a, b, make_index_sequence<N1>(), make_index_sequence<N2>());\n}\n\ntemplate <size_t N>\nconstexpr descr<N - 1> const_name(char const (&text)[N]) {\n    return descr<N - 1>(text);\n}\nconstexpr descr<0> const_name(char const (&)[1]) { return {}; }\n\ntemplate <size_t Rem, size_t... Digits>\nstruct int_to_str : int_to_str<Rem / 10, Rem % 10, Digits...> {};\ntemplate <size_t... Digits>\nstruct int_to_str<0, Digits...> {\n    // WARNING: This only works with C++17 or higher.\n    static constexpr auto digits = descr<sizeof...(Digits)>(('0' + Digits)...);\n};\n\n// Ternary description (like std::conditional)\ntemplate <bool B, size_t N1, size_t N2>\nconstexpr enable_if_t<B, descr<N1 - 1>> const_name(char const (&text1)[N1], char const (&)[N2]) {\n    return const_name(text1);\n}\ntemplate <bool B, size_t N1, size_t N2>\nconstexpr enable_if_t<!B, descr<N2 - 1>> const_name(char const (&)[N1], char const (&text2)[N2]) {\n    return const_name(text2);\n}\n\ntemplate <bool B, typename T1, typename T2>\nconstexpr enable_if_t<B, T1> const_name(const T1 &d, const T2 &) {\n    return d;\n}\ntemplate <bool B, typename T1, typename T2>\nconstexpr enable_if_t<!B, T2> const_name(const T1 &, const T2 &d) {\n    return d;\n}\n\ntemplate <size_t Size>\nauto constexpr const_name() -> remove_cv_t<decltype(int_to_str<Size / 10, Size % 10>::digits)> {\n    return int_to_str<Size / 10, Size % 10>::digits;\n}\n\ntemplate <typename Type>\nconstexpr descr<1, Type> const_name() {\n    return {'%'};\n}\n\n// If \"_\" is defined as a macro, py::detail::_ cannot be provided.\n// It is therefore best to use py::detail::const_name universally.\n// This block is for backward compatibility only.\n// (The const_name code is repeated to avoid introducing a \"_\" #define ourselves.)\n#ifndef _\n#    define PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY\ntemplate <size_t N>\nconstexpr descr<N - 1> _(char const (&text)[N]) {\n    return const_name<N>(text);\n}\ntemplate <bool B, size_t N1, size_t N2>\nconstexpr enable_if_t<B, descr<N1 - 1>> _(char const (&text1)[N1], char const (&text2)[N2]) {\n    return const_name<B, N1, N2>(text1, text2);\n}\ntemplate <bool B, size_t N1, size_t N2>\nconstexpr enable_if_t<!B, descr<N2 - 1>> _(char const (&text1)[N1], char const (&text2)[N2]) {\n    return const_name<B, N1, N2>(text1, text2);\n}\ntemplate <bool B, typename T1, typename T2>\nconstexpr enable_if_t<B, T1> _(const T1 &d1, const T2 &d2) {\n    return const_name<B, T1, T2>(d1, d2);\n}\ntemplate <bool B, typename T1, typename T2>\nconstexpr enable_if_t<!B, T2> _(const T1 &d1, const T2 &d2) {\n    return const_name<B, T1, T2>(d1, d2);\n}\n\ntemplate <size_t Size>\nauto constexpr _() -> remove_cv_t<decltype(int_to_str<Size / 10, Size % 10>::digits)> {\n    return const_name<Size>();\n}\ntemplate <typename Type>\nconstexpr descr<1, Type> _() {\n    return const_name<Type>();\n}\n#endif // #ifndef _\n\nconstexpr descr<0> concat() { return {}; }\n\ntemplate <size_t N, typename... Ts>\nconstexpr descr<N, Ts...> concat(const descr<N, Ts...> &descr) {\n    return descr;\n}\n\ntemplate <size_t N, typename... Ts, typename... Args>\nconstexpr auto concat(const descr<N, Ts...> &d, const Args &...args)\n    -> decltype(std::declval<descr<N + 2, Ts...>>() + concat(args...)) {\n    return d + const_name(\", \") + concat(args...);\n}\n\ntemplate <size_t N, typename... Ts>\nconstexpr descr<N + 2, Ts...> type_descr(const descr<N, Ts...> &descr) {\n    return const_name(\"{\") + descr + const_name(\"}\");\n}\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/detail/init.h",
    "content": "/*\n    pybind11/detail/init.h: init factory function implementation and support code.\n\n    Copyright (c) 2017 Jason Rhinelander <jason@imaginary.ca>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"class.h\"\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nPYBIND11_WARNING_DISABLE_MSVC(4127)\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ntemplate <>\nclass type_caster<value_and_holder> {\npublic:\n    bool load(handle h, bool) {\n        value = reinterpret_cast<value_and_holder *>(h.ptr());\n        return true;\n    }\n\n    template <typename>\n    using cast_op_type = value_and_holder &;\n    explicit operator value_and_holder &() { return *value; }\n    static constexpr auto name = const_name<value_and_holder>();\n\nprivate:\n    value_and_holder *value = nullptr;\n};\n\nPYBIND11_NAMESPACE_BEGIN(initimpl)\n\ninline void no_nullptr(void *ptr) {\n    if (!ptr) {\n        throw type_error(\"pybind11::init(): factory function returned nullptr\");\n    }\n}\n\n// Implementing functions for all forms of py::init<...> and py::init(...)\ntemplate <typename Class>\nusing Cpp = typename Class::type;\ntemplate <typename Class>\nusing Alias = typename Class::type_alias;\ntemplate <typename Class>\nusing Holder = typename Class::holder_type;\n\ntemplate <typename Class>\nusing is_alias_constructible = std::is_constructible<Alias<Class>, Cpp<Class> &&>;\n\n// Takes a Cpp pointer and returns true if it actually is a polymorphic Alias instance.\ntemplate <typename Class, enable_if_t<Class::has_alias, int> = 0>\nbool is_alias(Cpp<Class> *ptr) {\n    return dynamic_cast<Alias<Class> *>(ptr) != nullptr;\n}\n// Failing fallback version of the above for a no-alias class (always returns false)\ntemplate <typename /*Class*/>\nconstexpr bool is_alias(void *) {\n    return false;\n}\n\n// Constructs and returns a new object; if the given arguments don't map to a constructor, we fall\n// back to brace aggregate initiailization so that for aggregate initialization can be used with\n// py::init, e.g.  `py::init<int, int>` to initialize a `struct T { int a; int b; }`.  For\n// non-aggregate types, we need to use an ordinary T(...) constructor (invoking as `T{...}` usually\n// works, but will not do the expected thing when `T` has an `initializer_list<T>` constructor).\ntemplate <typename Class,\n          typename... Args,\n          detail::enable_if_t<std::is_constructible<Class, Args...>::value, int> = 0>\ninline Class *construct_or_initialize(Args &&...args) {\n    return new Class(std::forward<Args>(args)...);\n}\ntemplate <typename Class,\n          typename... Args,\n          detail::enable_if_t<!std::is_constructible<Class, Args...>::value, int> = 0>\ninline Class *construct_or_initialize(Args &&...args) {\n    return new Class{std::forward<Args>(args)...};\n}\n\n// Attempts to constructs an alias using a `Alias(Cpp &&)` constructor.  This allows types with\n// an alias to provide only a single Cpp factory function as long as the Alias can be\n// constructed from an rvalue reference of the base Cpp type.  This means that Alias classes\n// can, when appropriate, simply define a `Alias(Cpp &&)` constructor rather than needing to\n// inherit all the base class constructors.\ntemplate <typename Class>\nvoid construct_alias_from_cpp(std::true_type /*is_alias_constructible*/,\n                              value_and_holder &v_h,\n                              Cpp<Class> &&base) {\n    v_h.value_ptr() = new Alias<Class>(std::move(base));\n}\ntemplate <typename Class>\n[[noreturn]] void construct_alias_from_cpp(std::false_type /*!is_alias_constructible*/,\n                                           value_and_holder &,\n                                           Cpp<Class> &&) {\n    throw type_error(\"pybind11::init(): unable to convert returned instance to required \"\n                     \"alias class: no `Alias<Class>(Class &&)` constructor available\");\n}\n\n// Error-generating fallback for factories that don't match one of the below construction\n// mechanisms.\ntemplate <typename Class>\nvoid construct(...) {\n    static_assert(!std::is_same<Class, Class>::value /* always false */,\n                  \"pybind11::init(): init function must return a compatible pointer, \"\n                  \"holder, or value\");\n}\n\n// Pointer return v1: the factory function returns a class pointer for a registered class.\n// If we don't need an alias (because this class doesn't have one, or because the final type is\n// inherited on the Python side) we can simply take over ownership.  Otherwise we need to try to\n// construct an Alias from the returned base instance.\ntemplate <typename Class>\nvoid construct(value_and_holder &v_h, Cpp<Class> *ptr, bool need_alias) {\n    PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(need_alias);\n    no_nullptr(ptr);\n    if (Class::has_alias && need_alias && !is_alias<Class>(ptr)) {\n        // We're going to try to construct an alias by moving the cpp type.  Whether or not\n        // that succeeds, we still need to destroy the original cpp pointer (either the\n        // moved away leftover, if the alias construction works, or the value itself if we\n        // throw an error), but we can't just call `delete ptr`: it might have a special\n        // deleter, or might be shared_from_this.  So we construct a holder around it as if\n        // it was a normal instance, then steal the holder away into a local variable; thus\n        // the holder and destruction happens when we leave the C++ scope, and the holder\n        // class gets to handle the destruction however it likes.\n        v_h.value_ptr() = ptr;\n        v_h.set_instance_registered(true);          // To prevent init_instance from registering it\n        v_h.type->init_instance(v_h.inst, nullptr); // Set up the holder\n        Holder<Class> temp_holder(std::move(v_h.holder<Holder<Class>>())); // Steal the holder\n        v_h.type->dealloc(v_h); // Destroys the moved-out holder remains, resets value ptr to null\n        v_h.set_instance_registered(false);\n\n        construct_alias_from_cpp<Class>(is_alias_constructible<Class>{}, v_h, std::move(*ptr));\n    } else {\n        // Otherwise the type isn't inherited, so we don't need an Alias\n        v_h.value_ptr() = ptr;\n    }\n}\n\n// Pointer return v2: a factory that always returns an alias instance ptr.  We simply take over\n// ownership of the pointer.\ntemplate <typename Class, enable_if_t<Class::has_alias, int> = 0>\nvoid construct(value_and_holder &v_h, Alias<Class> *alias_ptr, bool) {\n    no_nullptr(alias_ptr);\n    v_h.value_ptr() = static_cast<Cpp<Class> *>(alias_ptr);\n}\n\n// Holder return: copy its pointer, and move or copy the returned holder into the new instance's\n// holder.  This also handles types like std::shared_ptr<T> and std::unique_ptr<T> where T is a\n// derived type (through those holder's implicit conversion from derived class holder\n// constructors).\ntemplate <typename Class>\nvoid construct(value_and_holder &v_h, Holder<Class> holder, bool need_alias) {\n    PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(need_alias);\n    auto *ptr = holder_helper<Holder<Class>>::get(holder);\n    no_nullptr(ptr);\n    // If we need an alias, check that the held pointer is actually an alias instance\n    if (Class::has_alias && need_alias && !is_alias<Class>(ptr)) {\n        throw type_error(\"pybind11::init(): construction failed: returned holder-wrapped instance \"\n                         \"is not an alias instance\");\n    }\n\n    v_h.value_ptr() = ptr;\n    v_h.type->init_instance(v_h.inst, &holder);\n}\n\n// return-by-value version 1: returning a cpp class by value.  If the class has an alias and an\n// alias is required the alias must have an `Alias(Cpp &&)` constructor so that we can construct\n// the alias from the base when needed (i.e. because of Python-side inheritance).  When we don't\n// need it, we simply move-construct the cpp value into a new instance.\ntemplate <typename Class>\nvoid construct(value_and_holder &v_h, Cpp<Class> &&result, bool need_alias) {\n    PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(need_alias);\n    static_assert(std::is_move_constructible<Cpp<Class>>::value,\n                  \"pybind11::init() return-by-value factory function requires a movable class\");\n    if (Class::has_alias && need_alias) {\n        construct_alias_from_cpp<Class>(is_alias_constructible<Class>{}, v_h, std::move(result));\n    } else {\n        v_h.value_ptr() = new Cpp<Class>(std::move(result));\n    }\n}\n\n// return-by-value version 2: returning a value of the alias type itself.  We move-construct an\n// Alias instance (even if no the python-side inheritance is involved).  The is intended for\n// cases where Alias initialization is always desired.\ntemplate <typename Class>\nvoid construct(value_and_holder &v_h, Alias<Class> &&result, bool) {\n    static_assert(\n        std::is_move_constructible<Alias<Class>>::value,\n        \"pybind11::init() return-by-alias-value factory function requires a movable alias class\");\n    v_h.value_ptr() = new Alias<Class>(std::move(result));\n}\n\n// Implementing class for py::init<...>()\ntemplate <typename... Args>\nstruct constructor {\n    template <typename Class, typename... Extra, enable_if_t<!Class::has_alias, int> = 0>\n    static void execute(Class &cl, const Extra &...extra) {\n        cl.def(\n            \"__init__\",\n            [](value_and_holder &v_h, Args... args) {\n                v_h.value_ptr() = construct_or_initialize<Cpp<Class>>(std::forward<Args>(args)...);\n            },\n            is_new_style_constructor(),\n            extra...);\n    }\n\n    template <\n        typename Class,\n        typename... Extra,\n        enable_if_t<Class::has_alias && std::is_constructible<Cpp<Class>, Args...>::value, int>\n        = 0>\n    static void execute(Class &cl, const Extra &...extra) {\n        cl.def(\n            \"__init__\",\n            [](value_and_holder &v_h, Args... args) {\n                if (Py_TYPE(v_h.inst) == v_h.type->type) {\n                    v_h.value_ptr()\n                        = construct_or_initialize<Cpp<Class>>(std::forward<Args>(args)...);\n                } else {\n                    v_h.value_ptr()\n                        = construct_or_initialize<Alias<Class>>(std::forward<Args>(args)...);\n                }\n            },\n            is_new_style_constructor(),\n            extra...);\n    }\n\n    template <\n        typename Class,\n        typename... Extra,\n        enable_if_t<Class::has_alias && !std::is_constructible<Cpp<Class>, Args...>::value, int>\n        = 0>\n    static void execute(Class &cl, const Extra &...extra) {\n        cl.def(\n            \"__init__\",\n            [](value_and_holder &v_h, Args... args) {\n                v_h.value_ptr()\n                    = construct_or_initialize<Alias<Class>>(std::forward<Args>(args)...);\n            },\n            is_new_style_constructor(),\n            extra...);\n    }\n};\n\n// Implementing class for py::init_alias<...>()\ntemplate <typename... Args>\nstruct alias_constructor {\n    template <\n        typename Class,\n        typename... Extra,\n        enable_if_t<Class::has_alias && std::is_constructible<Alias<Class>, Args...>::value, int>\n        = 0>\n    static void execute(Class &cl, const Extra &...extra) {\n        cl.def(\n            \"__init__\",\n            [](value_and_holder &v_h, Args... args) {\n                v_h.value_ptr()\n                    = construct_or_initialize<Alias<Class>>(std::forward<Args>(args)...);\n            },\n            is_new_style_constructor(),\n            extra...);\n    }\n};\n\n// Implementation class for py::init(Func) and py::init(Func, AliasFunc)\ntemplate <typename CFunc,\n          typename AFunc = void_type (*)(),\n          typename = function_signature_t<CFunc>,\n          typename = function_signature_t<AFunc>>\nstruct factory;\n\n// Specialization for py::init(Func)\ntemplate <typename Func, typename Return, typename... Args>\nstruct factory<Func, void_type (*)(), Return(Args...)> {\n    remove_reference_t<Func> class_factory;\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    factory(Func &&f) : class_factory(std::forward<Func>(f)) {}\n\n    // The given class either has no alias or has no separate alias factory;\n    // this always constructs the class itself.  If the class is registered with an alias\n    // type and an alias instance is needed (i.e. because the final type is a Python class\n    // inheriting from the C++ type) the returned value needs to either already be an alias\n    // instance, or the alias needs to be constructible from a `Class &&` argument.\n    template <typename Class, typename... Extra>\n    void execute(Class &cl, const Extra &...extra) && {\n#if defined(PYBIND11_CPP14)\n        cl.def(\n            \"__init__\",\n            [func = std::move(class_factory)]\n#else\n        auto &func = class_factory;\n        cl.def(\n            \"__init__\",\n            [func]\n#endif\n            (value_and_holder &v_h, Args... args) {\n                construct<Class>(\n                    v_h, func(std::forward<Args>(args)...), Py_TYPE(v_h.inst) != v_h.type->type);\n            },\n            is_new_style_constructor(),\n            extra...);\n    }\n};\n\n// Specialization for py::init(Func, AliasFunc)\ntemplate <typename CFunc,\n          typename AFunc,\n          typename CReturn,\n          typename... CArgs,\n          typename AReturn,\n          typename... AArgs>\nstruct factory<CFunc, AFunc, CReturn(CArgs...), AReturn(AArgs...)> {\n    static_assert(sizeof...(CArgs) == sizeof...(AArgs),\n                  \"pybind11::init(class_factory, alias_factory): class and alias factories \"\n                  \"must have identical argument signatures\");\n    static_assert(all_of<std::is_same<CArgs, AArgs>...>::value,\n                  \"pybind11::init(class_factory, alias_factory): class and alias factories \"\n                  \"must have identical argument signatures\");\n\n    remove_reference_t<CFunc> class_factory;\n    remove_reference_t<AFunc> alias_factory;\n\n    factory(CFunc &&c, AFunc &&a)\n        : class_factory(std::forward<CFunc>(c)), alias_factory(std::forward<AFunc>(a)) {}\n\n    // The class factory is called when the `self` type passed to `__init__` is the direct\n    // class (i.e. not inherited), the alias factory when `self` is a Python-side subtype.\n    template <typename Class, typename... Extra>\n    void execute(Class &cl, const Extra &...extra) && {\n        static_assert(Class::has_alias,\n                      \"The two-argument version of `py::init()` can \"\n                      \"only be used if the class has an alias\");\n#if defined(PYBIND11_CPP14)\n        cl.def(\n            \"__init__\",\n            [class_func = std::move(class_factory), alias_func = std::move(alias_factory)]\n#else\n        auto &class_func = class_factory;\n        auto &alias_func = alias_factory;\n        cl.def(\n            \"__init__\",\n            [class_func, alias_func]\n#endif\n            (value_and_holder &v_h, CArgs... args) {\n                if (Py_TYPE(v_h.inst) == v_h.type->type) {\n                    // If the instance type equals the registered type we don't have inheritance,\n                    // so don't need the alias and can construct using the class function:\n                    construct<Class>(v_h, class_func(std::forward<CArgs>(args)...), false);\n                } else {\n                    construct<Class>(v_h, alias_func(std::forward<CArgs>(args)...), true);\n                }\n            },\n            is_new_style_constructor(),\n            extra...);\n    }\n};\n\n/// Set just the C++ state. Same as `__init__`.\ntemplate <typename Class, typename T>\nvoid setstate(value_and_holder &v_h, T &&result, bool need_alias) {\n    construct<Class>(v_h, std::forward<T>(result), need_alias);\n}\n\n/// Set both the C++ and Python states\ntemplate <typename Class,\n          typename T,\n          typename O,\n          enable_if_t<std::is_convertible<O, handle>::value, int> = 0>\nvoid setstate(value_and_holder &v_h, std::pair<T, O> &&result, bool need_alias) {\n    construct<Class>(v_h, std::move(result.first), need_alias);\n    auto d = handle(result.second);\n    if (PyDict_Check(d.ptr()) && PyDict_Size(d.ptr()) == 0) {\n        // Skipping setattr below, to not force use of py::dynamic_attr() for Class unnecessarily.\n        // See PR #2972 for details.\n        return;\n    }\n    setattr((PyObject *) v_h.inst, \"__dict__\", d);\n}\n\n/// Implementation for py::pickle(GetState, SetState)\ntemplate <typename Get,\n          typename Set,\n          typename = function_signature_t<Get>,\n          typename = function_signature_t<Set>>\nstruct pickle_factory;\n\ntemplate <typename Get,\n          typename Set,\n          typename RetState,\n          typename Self,\n          typename NewInstance,\n          typename ArgState>\nstruct pickle_factory<Get, Set, RetState(Self), NewInstance(ArgState)> {\n    static_assert(std::is_same<intrinsic_t<RetState>, intrinsic_t<ArgState>>::value,\n                  \"The type returned by `__getstate__` must be the same \"\n                  \"as the argument accepted by `__setstate__`\");\n\n    remove_reference_t<Get> get;\n    remove_reference_t<Set> set;\n\n    pickle_factory(Get get, Set set) : get(std::forward<Get>(get)), set(std::forward<Set>(set)) {}\n\n    template <typename Class, typename... Extra>\n    void execute(Class &cl, const Extra &...extra) && {\n        cl.def(\"__getstate__\", std::move(get));\n\n#if defined(PYBIND11_CPP14)\n        cl.def(\n            \"__setstate__\",\n            [func = std::move(set)]\n#else\n        auto &func = set;\n        cl.def(\n            \"__setstate__\",\n            [func]\n#endif\n            (value_and_holder &v_h, ArgState state) {\n                setstate<Class>(\n                    v_h, func(std::forward<ArgState>(state)), Py_TYPE(v_h.inst) != v_h.type->type);\n            },\n            is_new_style_constructor(),\n            extra...);\n    }\n};\n\nPYBIND11_NAMESPACE_END(initimpl)\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/detail/internals.h",
    "content": "/*\n    pybind11/detail/internals.h: Internal data structure and related functions\n\n    Copyright (c) 2017 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"common.h\"\n\n#if defined(WITH_THREAD) && defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)\n#    include \"../gil.h\"\n#endif\n\n#include \"../pytypes.h\"\n\n#include <exception>\n\n/// Tracks the `internals` and `type_info` ABI version independent of the main library version.\n///\n/// Some portions of the code use an ABI that is conditional depending on this\n/// version number.  That allows ABI-breaking changes to be \"pre-implemented\".\n/// Once the default version number is incremented, the conditional logic that\n/// no longer applies can be removed.  Additionally, users that need not\n/// maintain ABI compatibility can increase the version number in order to take\n/// advantage of any functionality/efficiency improvements that depend on the\n/// newer ABI.\n///\n/// WARNING: If you choose to manually increase the ABI version, note that\n/// pybind11 may not be tested as thoroughly with a non-default ABI version, and\n/// further ABI-incompatible changes may be made before the ABI is officially\n/// changed to the new version.\n#ifndef PYBIND11_INTERNALS_VERSION\n#    define PYBIND11_INTERNALS_VERSION 4\n#endif\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nusing ExceptionTranslator = void (*)(std::exception_ptr);\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\nconstexpr const char *internals_function_record_capsule_name = \"pybind11_function_record_capsule\";\n\n// Forward declarations\ninline PyTypeObject *make_static_property_type();\ninline PyTypeObject *make_default_metaclass();\ninline PyObject *make_object_base_type(PyTypeObject *metaclass);\n\n// The old Python Thread Local Storage (TLS) API is deprecated in Python 3.7 in favor of the new\n// Thread Specific Storage (TSS) API.\n#if PY_VERSION_HEX >= 0x03070000\n// Avoid unnecessary allocation of `Py_tss_t`, since we cannot use\n// `Py_LIMITED_API` anyway.\n#    if PYBIND11_INTERNALS_VERSION > 4\n#        define PYBIND11_TLS_KEY_REF Py_tss_t &\n#        if defined(__GNUC__) && !defined(__INTEL_COMPILER)\n// Clang on macOS warns due to `Py_tss_NEEDS_INIT` not specifying an initializer\n// for every field.\n#            define PYBIND11_TLS_KEY_INIT(var)                                                    \\\n                _Pragma(\"GCC diagnostic push\")                                         /**/       \\\n                    _Pragma(\"GCC diagnostic ignored \\\"-Wmissing-field-initializers\\\"\") /**/       \\\n                    Py_tss_t var                                                                  \\\n                    = Py_tss_NEEDS_INIT;                                                          \\\n                _Pragma(\"GCC diagnostic pop\")\n#        else\n#            define PYBIND11_TLS_KEY_INIT(var) Py_tss_t var = Py_tss_NEEDS_INIT;\n#        endif\n#        define PYBIND11_TLS_KEY_CREATE(var) (PyThread_tss_create(&(var)) == 0)\n#        define PYBIND11_TLS_GET_VALUE(key) PyThread_tss_get(&(key))\n#        define PYBIND11_TLS_REPLACE_VALUE(key, value) PyThread_tss_set(&(key), (value))\n#        define PYBIND11_TLS_DELETE_VALUE(key) PyThread_tss_set(&(key), nullptr)\n#        define PYBIND11_TLS_FREE(key) PyThread_tss_delete(&(key))\n#    else\n#        define PYBIND11_TLS_KEY_REF Py_tss_t *\n#        define PYBIND11_TLS_KEY_INIT(var) Py_tss_t *var = nullptr;\n#        define PYBIND11_TLS_KEY_CREATE(var)                                                      \\\n            (((var) = PyThread_tss_alloc()) != nullptr && (PyThread_tss_create((var)) == 0))\n#        define PYBIND11_TLS_GET_VALUE(key) PyThread_tss_get((key))\n#        define PYBIND11_TLS_REPLACE_VALUE(key, value) PyThread_tss_set((key), (value))\n#        define PYBIND11_TLS_DELETE_VALUE(key) PyThread_tss_set((key), nullptr)\n#        define PYBIND11_TLS_FREE(key) PyThread_tss_free(key)\n#    endif\n#else\n// Usually an int but a long on Cygwin64 with Python 3.x\n#    define PYBIND11_TLS_KEY_REF decltype(PyThread_create_key())\n#    define PYBIND11_TLS_KEY_INIT(var) PYBIND11_TLS_KEY_REF var = 0;\n#    define PYBIND11_TLS_KEY_CREATE(var) (((var) = PyThread_create_key()) != -1)\n#    define PYBIND11_TLS_GET_VALUE(key) PyThread_get_key_value((key))\n#    if defined(PYPY_VERSION)\n// On CPython < 3.4 and on PyPy, `PyThread_set_key_value` strangely does not set\n// the value if it has already been set.  Instead, it must first be deleted and\n// then set again.\ninline void tls_replace_value(PYBIND11_TLS_KEY_REF key, void *value) {\n    PyThread_delete_key_value(key);\n    PyThread_set_key_value(key, value);\n}\n#        define PYBIND11_TLS_DELETE_VALUE(key) PyThread_delete_key_value(key)\n#        define PYBIND11_TLS_REPLACE_VALUE(key, value)                                            \\\n            ::pybind11::detail::tls_replace_value((key), (value))\n#    else\n#        define PYBIND11_TLS_DELETE_VALUE(key) PyThread_set_key_value((key), nullptr)\n#        define PYBIND11_TLS_REPLACE_VALUE(key, value) PyThread_set_key_value((key), (value))\n#    endif\n#    define PYBIND11_TLS_FREE(key) (void) key\n#endif\n\n// Python loads modules by default with dlopen with the RTLD_LOCAL flag; under libc++ and possibly\n// other STLs, this means `typeid(A)` from one module won't equal `typeid(A)` from another module\n// even when `A` is the same, non-hidden-visibility type (e.g. from a common include).  Under\n// libstdc++, this doesn't happen: equality and the type_index hash are based on the type name,\n// which works.  If not under a known-good stl, provide our own name-based hash and equality\n// functions that use the type name.\n#if defined(__GLIBCXX__)\ninline bool same_type(const std::type_info &lhs, const std::type_info &rhs) { return lhs == rhs; }\nusing type_hash = std::hash<std::type_index>;\nusing type_equal_to = std::equal_to<std::type_index>;\n#else\ninline bool same_type(const std::type_info &lhs, const std::type_info &rhs) {\n    return lhs.name() == rhs.name() || std::strcmp(lhs.name(), rhs.name()) == 0;\n}\n\nstruct type_hash {\n    size_t operator()(const std::type_index &t) const {\n        size_t hash = 5381;\n        const char *ptr = t.name();\n        while (auto c = static_cast<unsigned char>(*ptr++)) {\n            hash = (hash * 33) ^ c;\n        }\n        return hash;\n    }\n};\n\nstruct type_equal_to {\n    bool operator()(const std::type_index &lhs, const std::type_index &rhs) const {\n        return lhs.name() == rhs.name() || std::strcmp(lhs.name(), rhs.name()) == 0;\n    }\n};\n#endif\n\ntemplate <typename value_type>\nusing type_map = std::unordered_map<std::type_index, value_type, type_hash, type_equal_to>;\n\nstruct override_hash {\n    inline size_t operator()(const std::pair<const PyObject *, const char *> &v) const {\n        size_t value = std::hash<const void *>()(v.first);\n        value ^= std::hash<const void *>()(v.second) + 0x9e3779b9 + (value << 6) + (value >> 2);\n        return value;\n    }\n};\n\n/// Internal data structure used to track registered instances and types.\n/// Whenever binary incompatible changes are made to this structure,\n/// `PYBIND11_INTERNALS_VERSION` must be incremented.\nstruct internals {\n    // std::type_index -> pybind11's type information\n    type_map<type_info *> registered_types_cpp;\n    // PyTypeObject* -> base type_info(s)\n    std::unordered_map<PyTypeObject *, std::vector<type_info *>> registered_types_py;\n    std::unordered_multimap<const void *, instance *> registered_instances; // void * -> instance*\n    std::unordered_set<std::pair<const PyObject *, const char *>, override_hash>\n        inactive_override_cache;\n    type_map<std::vector<bool (*)(PyObject *, void *&)>> direct_conversions;\n    std::unordered_map<const PyObject *, std::vector<PyObject *>> patients;\n    std::forward_list<ExceptionTranslator> registered_exception_translators;\n    std::unordered_map<std::string, void *> shared_data; // Custom data to be shared across\n                                                         // extensions\n#if PYBIND11_INTERNALS_VERSION == 4\n    std::vector<PyObject *> unused_loader_patient_stack_remove_at_v5;\n#endif\n    std::forward_list<std::string> static_strings; // Stores the std::strings backing\n                                                   // detail::c_str()\n    PyTypeObject *static_property_type;\n    PyTypeObject *default_metaclass;\n    PyObject *instance_base;\n#if defined(WITH_THREAD)\n    // Unused if PYBIND11_SIMPLE_GIL_MANAGEMENT is defined:\n    PYBIND11_TLS_KEY_INIT(tstate)\n#    if PYBIND11_INTERNALS_VERSION > 4\n    PYBIND11_TLS_KEY_INIT(loader_life_support_tls_key)\n#    endif // PYBIND11_INTERNALS_VERSION > 4\n    // Unused if PYBIND11_SIMPLE_GIL_MANAGEMENT is defined:\n    PyInterpreterState *istate = nullptr;\n\n#    if PYBIND11_INTERNALS_VERSION > 4\n    // Note that we have to use a std::string to allocate memory to ensure a unique address\n    // We want unique addresses since we use pointer equality to compare function records\n    std::string function_record_capsule_name = internals_function_record_capsule_name;\n#    endif\n\n    internals() = default;\n    internals(const internals &other) = delete;\n    internals &operator=(const internals &other) = delete;\n    ~internals() {\n#    if PYBIND11_INTERNALS_VERSION > 4\n        PYBIND11_TLS_FREE(loader_life_support_tls_key);\n#    endif // PYBIND11_INTERNALS_VERSION > 4\n\n        // This destructor is called *after* Py_Finalize() in finalize_interpreter().\n        // That *SHOULD BE* fine. The following details what happens when PyThread_tss_free is\n        // called. PYBIND11_TLS_FREE is PyThread_tss_free on python 3.7+. On older python, it does\n        // nothing. PyThread_tss_free calls PyThread_tss_delete and PyMem_RawFree.\n        // PyThread_tss_delete just calls TlsFree (on Windows) or pthread_key_delete (on *NIX).\n        // Neither of those have anything to do with CPython internals. PyMem_RawFree *requires*\n        // that the `tstate` be allocated with the CPython allocator.\n        PYBIND11_TLS_FREE(tstate);\n    }\n#endif\n};\n\n/// Additional type information which does not fit into the PyTypeObject.\n/// Changes to this struct also require bumping `PYBIND11_INTERNALS_VERSION`.\nstruct type_info {\n    PyTypeObject *type;\n    const std::type_info *cpptype;\n    size_t type_size, type_align, holder_size_in_ptrs;\n    void *(*operator_new)(size_t);\n    void (*init_instance)(instance *, const void *);\n    void (*dealloc)(value_and_holder &v_h);\n    std::vector<PyObject *(*) (PyObject *, PyTypeObject *)> implicit_conversions;\n    std::vector<std::pair<const std::type_info *, void *(*) (void *)>> implicit_casts;\n    std::vector<bool (*)(PyObject *, void *&)> *direct_conversions;\n    buffer_info *(*get_buffer)(PyObject *, void *) = nullptr;\n    void *get_buffer_data = nullptr;\n    void *(*module_local_load)(PyObject *, const type_info *) = nullptr;\n    /* A simple type never occurs as a (direct or indirect) parent\n     * of a class that makes use of multiple inheritance.\n     * A type can be simple even if it has non-simple ancestors as long as it has no descendants.\n     */\n    bool simple_type : 1;\n    /* True if there is no multiple inheritance in this type's inheritance tree */\n    bool simple_ancestors : 1;\n    /* for base vs derived holder_type checks */\n    bool default_holder : 1;\n    /* true if this is a type registered with py::module_local */\n    bool module_local : 1;\n};\n\n/// On MSVC, debug and release builds are not ABI-compatible!\n#if defined(_MSC_VER) && defined(_DEBUG)\n#    define PYBIND11_BUILD_TYPE \"_debug\"\n#else\n#    define PYBIND11_BUILD_TYPE \"\"\n#endif\n\n/// Let's assume that different compilers are ABI-incompatible.\n/// A user can manually set this string if they know their\n/// compiler is compatible.\n#ifndef PYBIND11_COMPILER_TYPE\n#    if defined(_MSC_VER)\n#        define PYBIND11_COMPILER_TYPE \"_msvc\"\n#    elif defined(__INTEL_COMPILER)\n#        define PYBIND11_COMPILER_TYPE \"_icc\"\n#    elif defined(__clang__)\n#        define PYBIND11_COMPILER_TYPE \"_clang\"\n#    elif defined(__PGI)\n#        define PYBIND11_COMPILER_TYPE \"_pgi\"\n#    elif defined(__MINGW32__)\n#        define PYBIND11_COMPILER_TYPE \"_mingw\"\n#    elif defined(__CYGWIN__)\n#        define PYBIND11_COMPILER_TYPE \"_gcc_cygwin\"\n#    elif defined(__GNUC__)\n#        define PYBIND11_COMPILER_TYPE \"_gcc\"\n#    else\n#        define PYBIND11_COMPILER_TYPE \"_unknown\"\n#    endif\n#endif\n\n/// Also standard libs\n#ifndef PYBIND11_STDLIB\n#    if defined(_LIBCPP_VERSION)\n#        define PYBIND11_STDLIB \"_libcpp\"\n#    elif defined(__GLIBCXX__) || defined(__GLIBCPP__)\n#        define PYBIND11_STDLIB \"_libstdcpp\"\n#    else\n#        define PYBIND11_STDLIB \"\"\n#    endif\n#endif\n\n/// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility.\n#ifndef PYBIND11_BUILD_ABI\n#    if defined(__GXX_ABI_VERSION)\n#        define PYBIND11_BUILD_ABI \"_cxxabi\" PYBIND11_TOSTRING(__GXX_ABI_VERSION)\n#    else\n#        define PYBIND11_BUILD_ABI \"\"\n#    endif\n#endif\n\n#ifndef PYBIND11_INTERNALS_KIND\n#    if defined(WITH_THREAD)\n#        define PYBIND11_INTERNALS_KIND \"\"\n#    else\n#        define PYBIND11_INTERNALS_KIND \"_without_thread\"\n#    endif\n#endif\n\n#define PYBIND11_INTERNALS_ID                                                                     \\\n    \"__pybind11_internals_v\" PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION)                        \\\n        PYBIND11_INTERNALS_KIND PYBIND11_COMPILER_TYPE PYBIND11_STDLIB PYBIND11_BUILD_ABI         \\\n            PYBIND11_BUILD_TYPE \"__\"\n\n#define PYBIND11_MODULE_LOCAL_ID                                                                  \\\n    \"__pybind11_module_local_v\" PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION)                     \\\n        PYBIND11_INTERNALS_KIND PYBIND11_COMPILER_TYPE PYBIND11_STDLIB PYBIND11_BUILD_ABI         \\\n            PYBIND11_BUILD_TYPE \"__\"\n\n/// Each module locally stores a pointer to the `internals` data. The data\n/// itself is shared among modules with the same `PYBIND11_INTERNALS_ID`.\ninline internals **&get_internals_pp() {\n    static internals **internals_pp = nullptr;\n    return internals_pp;\n}\n\n// forward decl\ninline void translate_exception(std::exception_ptr);\n\ntemplate <class T,\n          enable_if_t<std::is_same<std::nested_exception, remove_cvref_t<T>>::value, int> = 0>\nbool handle_nested_exception(const T &exc, const std::exception_ptr &p) {\n    std::exception_ptr nested = exc.nested_ptr();\n    if (nested != nullptr && nested != p) {\n        translate_exception(nested);\n        return true;\n    }\n    return false;\n}\n\ntemplate <class T,\n          enable_if_t<!std::is_same<std::nested_exception, remove_cvref_t<T>>::value, int> = 0>\nbool handle_nested_exception(const T &exc, const std::exception_ptr &p) {\n    if (const auto *nep = dynamic_cast<const std::nested_exception *>(std::addressof(exc))) {\n        return handle_nested_exception(*nep, p);\n    }\n    return false;\n}\n\ninline bool raise_err(PyObject *exc_type, const char *msg) {\n    if (PyErr_Occurred()) {\n        raise_from(exc_type, msg);\n        return true;\n    }\n    PyErr_SetString(exc_type, msg);\n    return false;\n}\n\ninline void translate_exception(std::exception_ptr p) {\n    if (!p) {\n        return;\n    }\n    try {\n        std::rethrow_exception(p);\n    } catch (error_already_set &e) {\n        handle_nested_exception(e, p);\n        e.restore();\n        return;\n    } catch (const builtin_exception &e) {\n        // Could not use template since it's an abstract class.\n        if (const auto *nep = dynamic_cast<const std::nested_exception *>(std::addressof(e))) {\n            handle_nested_exception(*nep, p);\n        }\n        e.set_error();\n        return;\n    } catch (const std::bad_alloc &e) {\n        handle_nested_exception(e, p);\n        raise_err(PyExc_MemoryError, e.what());\n        return;\n    } catch (const std::domain_error &e) {\n        handle_nested_exception(e, p);\n        raise_err(PyExc_ValueError, e.what());\n        return;\n    } catch (const std::invalid_argument &e) {\n        handle_nested_exception(e, p);\n        raise_err(PyExc_ValueError, e.what());\n        return;\n    } catch (const std::length_error &e) {\n        handle_nested_exception(e, p);\n        raise_err(PyExc_ValueError, e.what());\n        return;\n    } catch (const std::out_of_range &e) {\n        handle_nested_exception(e, p);\n        raise_err(PyExc_IndexError, e.what());\n        return;\n    } catch (const std::range_error &e) {\n        handle_nested_exception(e, p);\n        raise_err(PyExc_ValueError, e.what());\n        return;\n    } catch (const std::overflow_error &e) {\n        handle_nested_exception(e, p);\n        raise_err(PyExc_OverflowError, e.what());\n        return;\n    } catch (const std::exception &e) {\n        handle_nested_exception(e, p);\n        raise_err(PyExc_RuntimeError, e.what());\n        return;\n    } catch (const std::nested_exception &e) {\n        handle_nested_exception(e, p);\n        raise_err(PyExc_RuntimeError, \"Caught an unknown nested exception!\");\n        return;\n    } catch (...) {\n        raise_err(PyExc_RuntimeError, \"Caught an unknown exception!\");\n        return;\n    }\n}\n\n#if !defined(__GLIBCXX__)\ninline void translate_local_exception(std::exception_ptr p) {\n    try {\n        if (p) {\n            std::rethrow_exception(p);\n        }\n    } catch (error_already_set &e) {\n        e.restore();\n        return;\n    } catch (const builtin_exception &e) {\n        e.set_error();\n        return;\n    }\n}\n#endif\n\n/// Return a reference to the current `internals` data\nPYBIND11_NOINLINE internals &get_internals() {\n    auto **&internals_pp = get_internals_pp();\n    if (internals_pp && *internals_pp) {\n        return **internals_pp;\n    }\n\n#if defined(WITH_THREAD)\n#    if defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)\n    gil_scoped_acquire gil;\n#    else\n    // Ensure that the GIL is held since we will need to make Python calls.\n    // Cannot use py::gil_scoped_acquire here since that constructor calls get_internals.\n    struct gil_scoped_acquire_local {\n        gil_scoped_acquire_local() : state(PyGILState_Ensure()) {}\n        gil_scoped_acquire_local(const gil_scoped_acquire_local &) = delete;\n        gil_scoped_acquire_local &operator=(const gil_scoped_acquire_local &) = delete;\n        ~gil_scoped_acquire_local() { PyGILState_Release(state); }\n        const PyGILState_STATE state;\n    } gil;\n#    endif\n#endif\n    error_scope err_scope;\n\n    PYBIND11_STR_TYPE id(PYBIND11_INTERNALS_ID);\n    auto builtins = handle(PyEval_GetBuiltins());\n    if (builtins.contains(id) && isinstance<capsule>(builtins[id])) {\n        internals_pp = static_cast<internals **>(capsule(builtins[id]));\n\n        // We loaded builtins through python's builtins, which means that our `error_already_set`\n        // and `builtin_exception` may be different local classes than the ones set up in the\n        // initial exception translator, below, so add another for our local exception classes.\n        //\n        // libstdc++ doesn't require this (types there are identified only by name)\n        // libc++ with CPython doesn't require this (types are explicitly exported)\n        // libc++ with PyPy still need it, awaiting further investigation\n#if !defined(__GLIBCXX__)\n        (*internals_pp)->registered_exception_translators.push_front(&translate_local_exception);\n#endif\n    } else {\n        if (!internals_pp) {\n            internals_pp = new internals *();\n        }\n        auto *&internals_ptr = *internals_pp;\n        internals_ptr = new internals();\n#if defined(WITH_THREAD)\n\n        PyThreadState *tstate = PyThreadState_Get();\n        if (!PYBIND11_TLS_KEY_CREATE(internals_ptr->tstate)) {\n            pybind11_fail(\"get_internals: could not successfully initialize the tstate TSS key!\");\n        }\n        PYBIND11_TLS_REPLACE_VALUE(internals_ptr->tstate, tstate);\n\n#    if PYBIND11_INTERNALS_VERSION > 4\n        if (!PYBIND11_TLS_KEY_CREATE(internals_ptr->loader_life_support_tls_key)) {\n            pybind11_fail(\"get_internals: could not successfully initialize the \"\n                          \"loader_life_support TSS key!\");\n        }\n#    endif\n        internals_ptr->istate = tstate->interp;\n#endif\n        builtins[id] = capsule(internals_pp);\n        internals_ptr->registered_exception_translators.push_front(&translate_exception);\n        internals_ptr->static_property_type = make_static_property_type();\n        internals_ptr->default_metaclass = make_default_metaclass();\n        internals_ptr->instance_base = make_object_base_type(internals_ptr->default_metaclass);\n    }\n    return **internals_pp;\n}\n\n// the internals struct (above) is shared between all the modules. local_internals are only\n// for a single module. Any changes made to internals may require an update to\n// PYBIND11_INTERNALS_VERSION, breaking backwards compatibility. local_internals is, by design,\n// restricted to a single module. Whether a module has local internals or not should not\n// impact any other modules, because the only things accessing the local internals is the\n// module that contains them.\nstruct local_internals {\n    type_map<type_info *> registered_types_cpp;\n    std::forward_list<ExceptionTranslator> registered_exception_translators;\n#if defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION == 4\n\n    // For ABI compatibility, we can't store the loader_life_support TLS key in\n    // the `internals` struct directly.  Instead, we store it in `shared_data` and\n    // cache a copy in `local_internals`.  If we allocated a separate TLS key for\n    // each instance of `local_internals`, we could end up allocating hundreds of\n    // TLS keys if hundreds of different pybind11 modules are loaded (which is a\n    // plausible number).\n    PYBIND11_TLS_KEY_INIT(loader_life_support_tls_key)\n\n    // Holds the shared TLS key for the loader_life_support stack.\n    struct shared_loader_life_support_data {\n        PYBIND11_TLS_KEY_INIT(loader_life_support_tls_key)\n        shared_loader_life_support_data() {\n            if (!PYBIND11_TLS_KEY_CREATE(loader_life_support_tls_key)) {\n                pybind11_fail(\"local_internals: could not successfully initialize the \"\n                              \"loader_life_support TLS key!\");\n            }\n        }\n        // We can't help but leak the TLS key, because Python never unloads extension modules.\n    };\n\n    local_internals() {\n        auto &internals = get_internals();\n        // Get or create the `loader_life_support_stack_key`.\n        auto &ptr = internals.shared_data[\"_life_support\"];\n        if (!ptr) {\n            ptr = new shared_loader_life_support_data;\n        }\n        loader_life_support_tls_key\n            = static_cast<shared_loader_life_support_data *>(ptr)->loader_life_support_tls_key;\n    }\n#endif //  defined(WITH_THREAD) && PYBIND11_INTERNALS_VERSION == 4\n};\n\n/// Works like `get_internals`, but for things which are locally registered.\ninline local_internals &get_local_internals() {\n    // Current static can be created in the interpreter finalization routine. If the later will be\n    // destroyed in another static variable destructor, creation of this static there will cause\n    // static deinitialization fiasco. In order to avoid it we avoid destruction of the\n    // local_internals static. One can read more about the problem and current solution here:\n    // https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables\n    static auto *locals = new local_internals();\n    return *locals;\n}\n\n/// Constructs a std::string with the given arguments, stores it in `internals`, and returns its\n/// `c_str()`.  Such strings objects have a long storage duration -- the internal strings are only\n/// cleared when the program exits or after interpreter shutdown (when embedding), and so are\n/// suitable for c-style strings needed by Python internals (such as PyTypeObject's tp_name).\ntemplate <typename... Args>\nconst char *c_str(Args &&...args) {\n    auto &strings = get_internals().static_strings;\n    strings.emplace_front(std::forward<Args>(args)...);\n    return strings.front().c_str();\n}\n\ninline const char *get_function_record_capsule_name() {\n#if PYBIND11_INTERNALS_VERSION > 4\n    return get_internals().function_record_capsule_name.c_str();\n#else\n    return nullptr;\n#endif\n}\n\n// Determine whether or not the following capsule contains a pybind11 function record.\n// Note that we use `internals` to make sure that only ABI compatible records are touched.\n//\n// This check is currently used in two places:\n// - An important optimization in functional.h to avoid overhead in C++ -> Python -> C++\n// - The sibling feature of cpp_function to allow overloads\ninline bool is_function_record_capsule(const capsule &cap) {\n    // Pointer equality as we rely on internals() to ensure unique pointers\n    return cap.name() == get_function_record_capsule_name();\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n/// Returns a named pointer that is shared among all extension modules (using the same\n/// pybind11 version) running in the current interpreter. Names starting with underscores\n/// are reserved for internal usage. Returns `nullptr` if no matching entry was found.\nPYBIND11_NOINLINE void *get_shared_data(const std::string &name) {\n    auto &internals = detail::get_internals();\n    auto it = internals.shared_data.find(name);\n    return it != internals.shared_data.end() ? it->second : nullptr;\n}\n\n/// Set the shared data that can be later recovered by `get_shared_data()`.\nPYBIND11_NOINLINE void *set_shared_data(const std::string &name, void *data) {\n    detail::get_internals().shared_data[name] = data;\n    return data;\n}\n\n/// Returns a typed reference to a shared data entry (by using `get_shared_data()`) if\n/// such entry exists. Otherwise, a new object of default-constructible type `T` is\n/// added to the shared data under the given name and a reference to it is returned.\ntemplate <typename T>\nT &get_or_create_shared_data(const std::string &name) {\n    auto &internals = detail::get_internals();\n    auto it = internals.shared_data.find(name);\n    T *ptr = (T *) (it != internals.shared_data.end() ? it->second : nullptr);\n    if (!ptr) {\n        ptr = new T();\n        internals.shared_data[name] = ptr;\n    }\n    return *ptr;\n}\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/detail/type_caster_base.h",
    "content": "/*\n    pybind11/detail/type_caster_base.h (originally first part of pybind11/cast.h)\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"../pytypes.h\"\n#include \"common.h\"\n#include \"descr.h\"\n#include \"internals.h\"\n#include \"typeid.h\"\n\n#include <cstdint>\n#include <iterator>\n#include <new>\n#include <string>\n#include <type_traits>\n#include <typeindex>\n#include <typeinfo>\n#include <unordered_map>\n#include <utility>\n#include <vector>\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n/// A life support system for temporary objects created by `type_caster::load()`.\n/// Adding a patient will keep it alive up until the enclosing function returns.\nclass loader_life_support {\nprivate:\n    loader_life_support *parent = nullptr;\n    std::unordered_set<PyObject *> keep_alive;\n\n#if defined(WITH_THREAD)\n    // Store stack pointer in thread-local storage.\n    static PYBIND11_TLS_KEY_REF get_stack_tls_key() {\n#    if PYBIND11_INTERNALS_VERSION == 4\n        return get_local_internals().loader_life_support_tls_key;\n#    else\n        return get_internals().loader_life_support_tls_key;\n#    endif\n    }\n    static loader_life_support *get_stack_top() {\n        return static_cast<loader_life_support *>(PYBIND11_TLS_GET_VALUE(get_stack_tls_key()));\n    }\n    static void set_stack_top(loader_life_support *value) {\n        PYBIND11_TLS_REPLACE_VALUE(get_stack_tls_key(), value);\n    }\n#else\n    // Use single global variable for stack.\n    static loader_life_support **get_stack_pp() {\n        static loader_life_support *global_stack = nullptr;\n        return global_stack;\n    }\n    static loader_life_support *get_stack_top() { return *get_stack_pp(); }\n    static void set_stack_top(loader_life_support *value) { *get_stack_pp() = value; }\n#endif\n\npublic:\n    /// A new patient frame is created when a function is entered\n    loader_life_support() : parent{get_stack_top()} { set_stack_top(this); }\n\n    /// ... and destroyed after it returns\n    ~loader_life_support() {\n        if (get_stack_top() != this) {\n            pybind11_fail(\"loader_life_support: internal error\");\n        }\n        set_stack_top(parent);\n        for (auto *item : keep_alive) {\n            Py_DECREF(item);\n        }\n    }\n\n    /// This can only be used inside a pybind11-bound function, either by `argument_loader`\n    /// at argument preparation time or by `py::cast()` at execution time.\n    PYBIND11_NOINLINE static void add_patient(handle h) {\n        loader_life_support *frame = get_stack_top();\n        if (!frame) {\n            // NOTE: It would be nice to include the stack frames here, as this indicates\n            // use of pybind11::cast<> outside the normal call framework, finding such\n            // a location is challenging. Developers could consider printing out\n            // stack frame addresses here using something like __builtin_frame_address(0)\n            throw cast_error(\"When called outside a bound function, py::cast() cannot \"\n                             \"do Python -> C++ conversions which require the creation \"\n                             \"of temporary values\");\n        }\n\n        if (frame->keep_alive.insert(h.ptr()).second) {\n            Py_INCREF(h.ptr());\n        }\n    }\n};\n\n// Gets the cache entry for the given type, creating it if necessary.  The return value is the pair\n// returned by emplace, i.e. an iterator for the entry and a bool set to `true` if the entry was\n// just created.\ninline std::pair<decltype(internals::registered_types_py)::iterator, bool>\nall_type_info_get_cache(PyTypeObject *type);\n\n// Populates a just-created cache entry.\nPYBIND11_NOINLINE void all_type_info_populate(PyTypeObject *t, std::vector<type_info *> &bases) {\n    std::vector<PyTypeObject *> check;\n    for (handle parent : reinterpret_borrow<tuple>(t->tp_bases)) {\n        check.push_back((PyTypeObject *) parent.ptr());\n    }\n\n    auto const &type_dict = get_internals().registered_types_py;\n    for (size_t i = 0; i < check.size(); i++) {\n        auto *type = check[i];\n        // Ignore Python2 old-style class super type:\n        if (!PyType_Check((PyObject *) type)) {\n            continue;\n        }\n\n        // Check `type` in the current set of registered python types:\n        auto it = type_dict.find(type);\n        if (it != type_dict.end()) {\n            // We found a cache entry for it, so it's either pybind-registered or has pre-computed\n            // pybind bases, but we have to make sure we haven't already seen the type(s) before:\n            // we want to follow Python/virtual C++ rules that there should only be one instance of\n            // a common base.\n            for (auto *tinfo : it->second) {\n                // NB: Could use a second set here, rather than doing a linear search, but since\n                // having a large number of immediate pybind11-registered types seems fairly\n                // unlikely, that probably isn't worthwhile.\n                bool found = false;\n                for (auto *known : bases) {\n                    if (known == tinfo) {\n                        found = true;\n                        break;\n                    }\n                }\n                if (!found) {\n                    bases.push_back(tinfo);\n                }\n            }\n        } else if (type->tp_bases) {\n            // It's some python type, so keep follow its bases classes to look for one or more\n            // registered types\n            if (i + 1 == check.size()) {\n                // When we're at the end, we can pop off the current element to avoid growing\n                // `check` when adding just one base (which is typical--i.e. when there is no\n                // multiple inheritance)\n                check.pop_back();\n                i--;\n            }\n            for (handle parent : reinterpret_borrow<tuple>(type->tp_bases)) {\n                check.push_back((PyTypeObject *) parent.ptr());\n            }\n        }\n    }\n}\n\n/**\n * Extracts vector of type_info pointers of pybind-registered roots of the given Python type.  Will\n * be just 1 pybind type for the Python type of a pybind-registered class, or for any Python-side\n * derived class that uses single inheritance.  Will contain as many types as required for a Python\n * class that uses multiple inheritance to inherit (directly or indirectly) from multiple\n * pybind-registered classes.  Will be empty if neither the type nor any base classes are\n * pybind-registered.\n *\n * The value is cached for the lifetime of the Python type.\n */\ninline const std::vector<detail::type_info *> &all_type_info(PyTypeObject *type) {\n    auto ins = all_type_info_get_cache(type);\n    if (ins.second) {\n        // New cache entry: populate it\n        all_type_info_populate(type, ins.first->second);\n    }\n\n    return ins.first->second;\n}\n\n/**\n * Gets a single pybind11 type info for a python type.  Returns nullptr if neither the type nor any\n * ancestors are pybind11-registered.  Throws an exception if there are multiple bases--use\n * `all_type_info` instead if you want to support multiple bases.\n */\nPYBIND11_NOINLINE detail::type_info *get_type_info(PyTypeObject *type) {\n    const auto &bases = all_type_info(type);\n    if (bases.empty()) {\n        return nullptr;\n    }\n    if (bases.size() > 1) {\n        pybind11_fail(\n            \"pybind11::detail::get_type_info: type has multiple pybind11-registered bases\");\n    }\n    return bases.front();\n}\n\ninline detail::type_info *get_local_type_info(const std::type_index &tp) {\n    auto &locals = get_local_internals().registered_types_cpp;\n    auto it = locals.find(tp);\n    if (it != locals.end()) {\n        return it->second;\n    }\n    return nullptr;\n}\n\ninline detail::type_info *get_global_type_info(const std::type_index &tp) {\n    auto &types = get_internals().registered_types_cpp;\n    auto it = types.find(tp);\n    if (it != types.end()) {\n        return it->second;\n    }\n    return nullptr;\n}\n\n/// Return the type info for a given C++ type; on lookup failure can either throw or return\n/// nullptr.\nPYBIND11_NOINLINE detail::type_info *get_type_info(const std::type_index &tp,\n                                                   bool throw_if_missing = false) {\n    if (auto *ltype = get_local_type_info(tp)) {\n        return ltype;\n    }\n    if (auto *gtype = get_global_type_info(tp)) {\n        return gtype;\n    }\n\n    if (throw_if_missing) {\n        std::string tname = tp.name();\n        detail::clean_type_id(tname);\n        pybind11_fail(\"pybind11::detail::get_type_info: unable to find type info for \\\"\"\n                      + std::move(tname) + '\"');\n    }\n    return nullptr;\n}\n\nPYBIND11_NOINLINE handle get_type_handle(const std::type_info &tp, bool throw_if_missing) {\n    detail::type_info *type_info = get_type_info(tp, throw_if_missing);\n    return handle(type_info ? ((PyObject *) type_info->type) : nullptr);\n}\n\n// Searches the inheritance graph for a registered Python instance, using all_type_info().\nPYBIND11_NOINLINE handle find_registered_python_instance(void *src,\n                                                         const detail::type_info *tinfo) {\n    auto it_instances = get_internals().registered_instances.equal_range(src);\n    for (auto it_i = it_instances.first; it_i != it_instances.second; ++it_i) {\n        for (auto *instance_type : detail::all_type_info(Py_TYPE(it_i->second))) {\n            if (instance_type && same_type(*instance_type->cpptype, *tinfo->cpptype)) {\n                return handle((PyObject *) it_i->second).inc_ref();\n            }\n        }\n    }\n    return handle();\n}\n\nstruct value_and_holder {\n    instance *inst = nullptr;\n    size_t index = 0u;\n    const detail::type_info *type = nullptr;\n    void **vh = nullptr;\n\n    // Main constructor for a found value/holder:\n    value_and_holder(instance *i, const detail::type_info *type, size_t vpos, size_t index)\n        : inst{i}, index{index}, type{type}, vh{inst->simple_layout\n                                                    ? inst->simple_value_holder\n                                                    : &inst->nonsimple.values_and_holders[vpos]} {}\n\n    // Default constructor (used to signal a value-and-holder not found by get_value_and_holder())\n    value_and_holder() = default;\n\n    // Used for past-the-end iterator\n    explicit value_and_holder(size_t index) : index{index} {}\n\n    template <typename V = void>\n    V *&value_ptr() const {\n        return reinterpret_cast<V *&>(vh[0]);\n    }\n    // True if this `value_and_holder` has a non-null value pointer\n    explicit operator bool() const { return value_ptr() != nullptr; }\n\n    template <typename H>\n    H &holder() const {\n        return reinterpret_cast<H &>(vh[1]);\n    }\n    bool holder_constructed() const {\n        return inst->simple_layout\n                   ? inst->simple_holder_constructed\n                   : (inst->nonsimple.status[index] & instance::status_holder_constructed) != 0u;\n    }\n    // NOLINTNEXTLINE(readability-make-member-function-const)\n    void set_holder_constructed(bool v = true) {\n        if (inst->simple_layout) {\n            inst->simple_holder_constructed = v;\n        } else if (v) {\n            inst->nonsimple.status[index] |= instance::status_holder_constructed;\n        } else {\n            inst->nonsimple.status[index] &= (std::uint8_t) ~instance::status_holder_constructed;\n        }\n    }\n    bool instance_registered() const {\n        return inst->simple_layout\n                   ? inst->simple_instance_registered\n                   : ((inst->nonsimple.status[index] & instance::status_instance_registered) != 0);\n    }\n    // NOLINTNEXTLINE(readability-make-member-function-const)\n    void set_instance_registered(bool v = true) {\n        if (inst->simple_layout) {\n            inst->simple_instance_registered = v;\n        } else if (v) {\n            inst->nonsimple.status[index] |= instance::status_instance_registered;\n        } else {\n            inst->nonsimple.status[index] &= (std::uint8_t) ~instance::status_instance_registered;\n        }\n    }\n};\n\n// Container for accessing and iterating over an instance's values/holders\nstruct values_and_holders {\nprivate:\n    instance *inst;\n    using type_vec = std::vector<detail::type_info *>;\n    const type_vec &tinfo;\n\npublic:\n    explicit values_and_holders(instance *inst)\n        : inst{inst}, tinfo(all_type_info(Py_TYPE(inst))) {}\n\n    struct iterator {\n    private:\n        instance *inst = nullptr;\n        const type_vec *types = nullptr;\n        value_and_holder curr;\n        friend struct values_and_holders;\n        iterator(instance *inst, const type_vec *tinfo)\n            : inst{inst}, types{tinfo},\n              curr(inst /* instance */,\n                   types->empty() ? nullptr : (*types)[0] /* type info */,\n                   0, /* vpos: (non-simple types only): the first vptr comes first */\n                   0 /* index */) {}\n        // Past-the-end iterator:\n        explicit iterator(size_t end) : curr(end) {}\n\n    public:\n        bool operator==(const iterator &other) const { return curr.index == other.curr.index; }\n        bool operator!=(const iterator &other) const { return curr.index != other.curr.index; }\n        iterator &operator++() {\n            if (!inst->simple_layout) {\n                curr.vh += 1 + (*types)[curr.index]->holder_size_in_ptrs;\n            }\n            ++curr.index;\n            curr.type = curr.index < types->size() ? (*types)[curr.index] : nullptr;\n            return *this;\n        }\n        value_and_holder &operator*() { return curr; }\n        value_and_holder *operator->() { return &curr; }\n    };\n\n    iterator begin() { return iterator(inst, &tinfo); }\n    iterator end() { return iterator(tinfo.size()); }\n\n    iterator find(const type_info *find_type) {\n        auto it = begin(), endit = end();\n        while (it != endit && it->type != find_type) {\n            ++it;\n        }\n        return it;\n    }\n\n    size_t size() { return tinfo.size(); }\n};\n\n/**\n * Extracts C++ value and holder pointer references from an instance (which may contain multiple\n * values/holders for python-side multiple inheritance) that match the given type.  Throws an error\n * if the given type (or ValueType, if omitted) is not a pybind11 base of the given instance.  If\n * `find_type` is omitted (or explicitly specified as nullptr) the first value/holder are returned,\n * regardless of type (and the resulting .type will be nullptr).\n *\n * The returned object should be short-lived: in particular, it must not outlive the called-upon\n * instance.\n */\nPYBIND11_NOINLINE value_and_holder\ninstance::get_value_and_holder(const type_info *find_type /*= nullptr default in common.h*/,\n                               bool throw_if_missing /*= true in common.h*/) {\n    // Optimize common case:\n    if (!find_type || Py_TYPE(this) == find_type->type) {\n        return value_and_holder(this, find_type, 0, 0);\n    }\n\n    detail::values_and_holders vhs(this);\n    auto it = vhs.find(find_type);\n    if (it != vhs.end()) {\n        return *it;\n    }\n\n    if (!throw_if_missing) {\n        return value_and_holder();\n    }\n\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n    pybind11_fail(\"pybind11::detail::instance::get_value_and_holder: `\"\n                  + get_fully_qualified_tp_name(find_type->type)\n                  + \"' is not a pybind11 base of the given `\"\n                  + get_fully_qualified_tp_name(Py_TYPE(this)) + \"' instance\");\n#else\n    pybind11_fail(\n        \"pybind11::detail::instance::get_value_and_holder: \"\n        \"type is not a pybind11 base of the given instance \"\n        \"(#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for type details)\");\n#endif\n}\n\nPYBIND11_NOINLINE void instance::allocate_layout() {\n    const auto &tinfo = all_type_info(Py_TYPE(this));\n\n    const size_t n_types = tinfo.size();\n\n    if (n_types == 0) {\n        pybind11_fail(\n            \"instance allocation failed: new instance has no pybind11-registered base types\");\n    }\n\n    simple_layout\n        = n_types == 1 && tinfo.front()->holder_size_in_ptrs <= instance_simple_holder_in_ptrs();\n\n    // Simple path: no python-side multiple inheritance, and a small-enough holder\n    if (simple_layout) {\n        simple_value_holder[0] = nullptr;\n        simple_holder_constructed = false;\n        simple_instance_registered = false;\n    } else { // multiple base types or a too-large holder\n        // Allocate space to hold: [v1*][h1][v2*][h2]...[bb...] where [vN*] is a value pointer,\n        // [hN] is the (uninitialized) holder instance for value N, and [bb...] is a set of bool\n        // values that tracks whether each associated holder has been initialized.  Each [block] is\n        // padded, if necessary, to an integer multiple of sizeof(void *).\n        size_t space = 0;\n        for (auto *t : tinfo) {\n            space += 1;                      // value pointer\n            space += t->holder_size_in_ptrs; // holder instance\n        }\n        size_t flags_at = space;\n        space += size_in_ptrs(n_types); // status bytes (holder_constructed and\n                                        // instance_registered)\n\n        // Allocate space for flags, values, and holders, and initialize it to 0 (flags and values,\n        // in particular, need to be 0).  Use Python's memory allocation\n        // functions: Python is using pymalloc, which is designed to be\n        // efficient for small allocations like the one we're doing here;\n        // for larger allocations they are just wrappers around malloc.\n        // TODO: is this still true for pure Python 3.6?\n        nonsimple.values_and_holders = (void **) PyMem_Calloc(space, sizeof(void *));\n        if (!nonsimple.values_and_holders) {\n            throw std::bad_alloc();\n        }\n        nonsimple.status\n            = reinterpret_cast<std::uint8_t *>(&nonsimple.values_and_holders[flags_at]);\n    }\n    owned = true;\n}\n\n// NOLINTNEXTLINE(readability-make-member-function-const)\nPYBIND11_NOINLINE void instance::deallocate_layout() {\n    if (!simple_layout) {\n        PyMem_Free(nonsimple.values_and_holders);\n    }\n}\n\nPYBIND11_NOINLINE bool isinstance_generic(handle obj, const std::type_info &tp) {\n    handle type = detail::get_type_handle(tp, false);\n    if (!type) {\n        return false;\n    }\n    return isinstance(obj, type);\n}\n\nPYBIND11_NOINLINE handle get_object_handle(const void *ptr, const detail::type_info *type) {\n    auto &instances = get_internals().registered_instances;\n    auto range = instances.equal_range(ptr);\n    for (auto it = range.first; it != range.second; ++it) {\n        for (const auto &vh : values_and_holders(it->second)) {\n            if (vh.type == type) {\n                return handle((PyObject *) it->second);\n            }\n        }\n    }\n    return handle();\n}\n\ninline PyThreadState *get_thread_state_unchecked() {\n#if defined(PYPY_VERSION)\n    return PyThreadState_GET();\n#else\n    return _PyThreadState_UncheckedGet();\n#endif\n}\n\n// Forward declarations\nvoid keep_alive_impl(handle nurse, handle patient);\ninline PyObject *make_new_instance(PyTypeObject *type);\n\nclass type_caster_generic {\npublic:\n    PYBIND11_NOINLINE explicit type_caster_generic(const std::type_info &type_info)\n        : typeinfo(get_type_info(type_info)), cpptype(&type_info) {}\n\n    explicit type_caster_generic(const type_info *typeinfo)\n        : typeinfo(typeinfo), cpptype(typeinfo ? typeinfo->cpptype : nullptr) {}\n\n    bool load(handle src, bool convert) { return load_impl<type_caster_generic>(src, convert); }\n\n    PYBIND11_NOINLINE static handle cast(const void *_src,\n                                         return_value_policy policy,\n                                         handle parent,\n                                         const detail::type_info *tinfo,\n                                         void *(*copy_constructor)(const void *),\n                                         void *(*move_constructor)(const void *),\n                                         const void *existing_holder = nullptr) {\n        if (!tinfo) { // no type info: error will be set already\n            return handle();\n        }\n\n        void *src = const_cast<void *>(_src);\n        if (src == nullptr) {\n            return none().release();\n        }\n\n        if (handle registered_inst = find_registered_python_instance(src, tinfo)) {\n            return registered_inst;\n        }\n\n        auto inst = reinterpret_steal<object>(make_new_instance(tinfo->type));\n        auto *wrapper = reinterpret_cast<instance *>(inst.ptr());\n        wrapper->owned = false;\n        void *&valueptr = values_and_holders(wrapper).begin()->value_ptr();\n\n        switch (policy) {\n            case return_value_policy::automatic:\n            case return_value_policy::take_ownership:\n                valueptr = src;\n                wrapper->owned = true;\n                break;\n\n            case return_value_policy::automatic_reference:\n            case return_value_policy::reference:\n                valueptr = src;\n                wrapper->owned = false;\n                break;\n\n            case return_value_policy::copy:\n                if (copy_constructor) {\n                    valueptr = copy_constructor(src);\n                } else {\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n                    std::string type_name(tinfo->cpptype->name());\n                    detail::clean_type_id(type_name);\n                    throw cast_error(\"return_value_policy = copy, but type \" + type_name\n                                     + \" is non-copyable!\");\n#else\n                    throw cast_error(\"return_value_policy = copy, but type is \"\n                                     \"non-copyable! (#define PYBIND11_DETAILED_ERROR_MESSAGES or \"\n                                     \"compile in debug mode for details)\");\n#endif\n                }\n                wrapper->owned = true;\n                break;\n\n            case return_value_policy::move:\n                if (move_constructor) {\n                    valueptr = move_constructor(src);\n                } else if (copy_constructor) {\n                    valueptr = copy_constructor(src);\n                } else {\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n                    std::string type_name(tinfo->cpptype->name());\n                    detail::clean_type_id(type_name);\n                    throw cast_error(\"return_value_policy = move, but type \" + type_name\n                                     + \" is neither movable nor copyable!\");\n#else\n                    throw cast_error(\"return_value_policy = move, but type is neither \"\n                                     \"movable nor copyable! \"\n                                     \"(#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in \"\n                                     \"debug mode for details)\");\n#endif\n                }\n                wrapper->owned = true;\n                break;\n\n            case return_value_policy::reference_internal:\n                valueptr = src;\n                wrapper->owned = false;\n                keep_alive_impl(inst, parent);\n                break;\n\n            default:\n                throw cast_error(\"unhandled return_value_policy: should not happen!\");\n        }\n\n        tinfo->init_instance(wrapper, existing_holder);\n\n        return inst.release();\n    }\n\n    // Base methods for generic caster; there are overridden in copyable_holder_caster\n    void load_value(value_and_holder &&v_h) {\n        auto *&vptr = v_h.value_ptr();\n        // Lazy allocation for unallocated values:\n        if (vptr == nullptr) {\n            const auto *type = v_h.type ? v_h.type : typeinfo;\n            if (type->operator_new) {\n                vptr = type->operator_new(type->type_size);\n            } else {\n#if defined(__cpp_aligned_new) && (!defined(_MSC_VER) || _MSC_VER >= 1912)\n                if (type->type_align > __STDCPP_DEFAULT_NEW_ALIGNMENT__) {\n                    vptr = ::operator new(type->type_size, std::align_val_t(type->type_align));\n                } else {\n                    vptr = ::operator new(type->type_size);\n                }\n#else\n                vptr = ::operator new(type->type_size);\n#endif\n            }\n        }\n        value = vptr;\n    }\n    bool try_implicit_casts(handle src, bool convert) {\n        for (const auto &cast : typeinfo->implicit_casts) {\n            type_caster_generic sub_caster(*cast.first);\n            if (sub_caster.load(src, convert)) {\n                value = cast.second(sub_caster.value);\n                return true;\n            }\n        }\n        return false;\n    }\n    bool try_direct_conversions(handle src) {\n        for (auto &converter : *typeinfo->direct_conversions) {\n            if (converter(src.ptr(), value)) {\n                return true;\n            }\n        }\n        return false;\n    }\n    void check_holder_compat() {}\n\n    PYBIND11_NOINLINE static void *local_load(PyObject *src, const type_info *ti) {\n        auto caster = type_caster_generic(ti);\n        if (caster.load(src, false)) {\n            return caster.value;\n        }\n        return nullptr;\n    }\n\n    /// Try to load with foreign typeinfo, if available. Used when there is no\n    /// native typeinfo, or when the native one wasn't able to produce a value.\n    PYBIND11_NOINLINE bool try_load_foreign_module_local(handle src) {\n        constexpr auto *local_key = PYBIND11_MODULE_LOCAL_ID;\n        const auto pytype = type::handle_of(src);\n        if (!hasattr(pytype, local_key)) {\n            return false;\n        }\n\n        type_info *foreign_typeinfo = reinterpret_borrow<capsule>(getattr(pytype, local_key));\n        // Only consider this foreign loader if actually foreign and is a loader of the correct cpp\n        // type\n        if (foreign_typeinfo->module_local_load == &local_load\n            || (cpptype && !same_type(*cpptype, *foreign_typeinfo->cpptype))) {\n            return false;\n        }\n\n        if (auto *result = foreign_typeinfo->module_local_load(src.ptr(), foreign_typeinfo)) {\n            value = result;\n            return true;\n        }\n        return false;\n    }\n\n    // Implementation of `load`; this takes the type of `this` so that it can dispatch the relevant\n    // bits of code between here and copyable_holder_caster where the two classes need different\n    // logic (without having to resort to virtual inheritance).\n    template <typename ThisT>\n    PYBIND11_NOINLINE bool load_impl(handle src, bool convert) {\n        if (!src) {\n            return false;\n        }\n        if (!typeinfo) {\n            return try_load_foreign_module_local(src);\n        }\n\n        auto &this_ = static_cast<ThisT &>(*this);\n        this_.check_holder_compat();\n\n        PyTypeObject *srctype = Py_TYPE(src.ptr());\n\n        // Case 1: If src is an exact type match for the target type then we can reinterpret_cast\n        // the instance's value pointer to the target type:\n        if (srctype == typeinfo->type) {\n            this_.load_value(reinterpret_cast<instance *>(src.ptr())->get_value_and_holder());\n            return true;\n        }\n        // Case 2: We have a derived class\n        if (PyType_IsSubtype(srctype, typeinfo->type)) {\n            const auto &bases = all_type_info(srctype);\n            bool no_cpp_mi = typeinfo->simple_type;\n\n            // Case 2a: the python type is a Python-inherited derived class that inherits from just\n            // one simple (no MI) pybind11 class, or is an exact match, so the C++ instance is of\n            // the right type and we can use reinterpret_cast.\n            // (This is essentially the same as case 2b, but because not using multiple inheritance\n            // is extremely common, we handle it specially to avoid the loop iterator and type\n            // pointer lookup overhead)\n            if (bases.size() == 1 && (no_cpp_mi || bases.front()->type == typeinfo->type)) {\n                this_.load_value(reinterpret_cast<instance *>(src.ptr())->get_value_and_holder());\n                return true;\n            }\n            // Case 2b: the python type inherits from multiple C++ bases.  Check the bases to see\n            // if we can find an exact match (or, for a simple C++ type, an inherited match); if\n            // so, we can safely reinterpret_cast to the relevant pointer.\n            if (bases.size() > 1) {\n                for (auto *base : bases) {\n                    if (no_cpp_mi ? PyType_IsSubtype(base->type, typeinfo->type)\n                                  : base->type == typeinfo->type) {\n                        this_.load_value(\n                            reinterpret_cast<instance *>(src.ptr())->get_value_and_holder(base));\n                        return true;\n                    }\n                }\n            }\n\n            // Case 2c: C++ multiple inheritance is involved and we couldn't find an exact type\n            // match in the registered bases, above, so try implicit casting (needed for proper C++\n            // casting when MI is involved).\n            if (this_.try_implicit_casts(src, convert)) {\n                return true;\n            }\n        }\n\n        // Perform an implicit conversion\n        if (convert) {\n            for (const auto &converter : typeinfo->implicit_conversions) {\n                auto temp = reinterpret_steal<object>(converter(src.ptr(), typeinfo->type));\n                if (load_impl<ThisT>(temp, false)) {\n                    loader_life_support::add_patient(temp);\n                    return true;\n                }\n            }\n            if (this_.try_direct_conversions(src)) {\n                return true;\n            }\n        }\n\n        // Failed to match local typeinfo. Try again with global.\n        if (typeinfo->module_local) {\n            if (auto *gtype = get_global_type_info(*typeinfo->cpptype)) {\n                typeinfo = gtype;\n                return load(src, false);\n            }\n        }\n\n        // Global typeinfo has precedence over foreign module_local\n        if (try_load_foreign_module_local(src)) {\n            return true;\n        }\n\n        // Custom converters didn't take None, now we convert None to nullptr.\n        if (src.is_none()) {\n            // Defer accepting None to other overloads (if we aren't in convert mode):\n            if (!convert) {\n                return false;\n            }\n            value = nullptr;\n            return true;\n        }\n\n        return false;\n    }\n\n    // Called to do type lookup and wrap the pointer and type in a pair when a dynamic_cast\n    // isn't needed or can't be used.  If the type is unknown, sets the error and returns a pair\n    // with .second = nullptr.  (p.first = nullptr is not an error: it becomes None).\n    PYBIND11_NOINLINE static std::pair<const void *, const type_info *>\n    src_and_type(const void *src,\n                 const std::type_info &cast_type,\n                 const std::type_info *rtti_type = nullptr) {\n        if (auto *tpi = get_type_info(cast_type)) {\n            return {src, const_cast<const type_info *>(tpi)};\n        }\n\n        // Not found, set error:\n        std::string tname = rtti_type ? rtti_type->name() : cast_type.name();\n        detail::clean_type_id(tname);\n        std::string msg = \"Unregistered type : \" + tname;\n        PyErr_SetString(PyExc_TypeError, msg.c_str());\n        return {nullptr, nullptr};\n    }\n\n    const type_info *typeinfo = nullptr;\n    const std::type_info *cpptype = nullptr;\n    void *value = nullptr;\n};\n\n/**\n * Determine suitable casting operator for pointer-or-lvalue-casting type casters.  The type caster\n * needs to provide `operator T*()` and `operator T&()` operators.\n *\n * If the type supports moving the value away via an `operator T&&() &&` method, it should use\n * `movable_cast_op_type` instead.\n */\ntemplate <typename T>\nusing cast_op_type = conditional_t<std::is_pointer<remove_reference_t<T>>::value,\n                                   typename std::add_pointer<intrinsic_t<T>>::type,\n                                   typename std::add_lvalue_reference<intrinsic_t<T>>::type>;\n\n/**\n * Determine suitable casting operator for a type caster with a movable value.  Such a type caster\n * needs to provide `operator T*()`, `operator T&()`, and `operator T&&() &&`.  The latter will be\n * called in appropriate contexts where the value can be moved rather than copied.\n *\n * These operator are automatically provided when using the PYBIND11_TYPE_CASTER macro.\n */\ntemplate <typename T>\nusing movable_cast_op_type\n    = conditional_t<std::is_pointer<typename std::remove_reference<T>::type>::value,\n                    typename std::add_pointer<intrinsic_t<T>>::type,\n                    conditional_t<std::is_rvalue_reference<T>::value,\n                                  typename std::add_rvalue_reference<intrinsic_t<T>>::type,\n                                  typename std::add_lvalue_reference<intrinsic_t<T>>::type>>;\n\n// std::is_copy_constructible isn't quite enough: it lets std::vector<T> (and similar) through when\n// T is non-copyable, but code containing such a copy constructor fails to actually compile.\ntemplate <typename T, typename SFINAE = void>\nstruct is_copy_constructible : std::is_copy_constructible<T> {};\n\n// Specialization for types that appear to be copy constructible but also look like stl containers\n// (we specifically check for: has `value_type` and `reference` with `reference = value_type&`): if\n// so, copy constructability depends on whether the value_type is copy constructible.\ntemplate <typename Container>\nstruct is_copy_constructible<\n    Container,\n    enable_if_t<\n        all_of<std::is_copy_constructible<Container>,\n               std::is_same<typename Container::value_type &, typename Container::reference>,\n               // Avoid infinite recursion\n               negation<std::is_same<Container, typename Container::value_type>>>::value>>\n    : is_copy_constructible<typename Container::value_type> {};\n\n// Likewise for std::pair\n// (after C++17 it is mandatory that the copy constructor not exist when the two types aren't\n// themselves copy constructible, but this can not be relied upon when T1 or T2 are themselves\n// containers).\ntemplate <typename T1, typename T2>\nstruct is_copy_constructible<std::pair<T1, T2>>\n    : all_of<is_copy_constructible<T1>, is_copy_constructible<T2>> {};\n\n// The same problems arise with std::is_copy_assignable, so we use the same workaround.\ntemplate <typename T, typename SFINAE = void>\nstruct is_copy_assignable : std::is_copy_assignable<T> {};\ntemplate <typename Container>\nstruct is_copy_assignable<Container,\n                          enable_if_t<all_of<std::is_copy_assignable<Container>,\n                                             std::is_same<typename Container::value_type &,\n                                                          typename Container::reference>>::value>>\n    : is_copy_assignable<typename Container::value_type> {};\ntemplate <typename T1, typename T2>\nstruct is_copy_assignable<std::pair<T1, T2>>\n    : all_of<is_copy_assignable<T1>, is_copy_assignable<T2>> {};\n\nPYBIND11_NAMESPACE_END(detail)\n\n// polymorphic_type_hook<itype>::get(src, tinfo) determines whether the object pointed\n// to by `src` actually is an instance of some class derived from `itype`.\n// If so, it sets `tinfo` to point to the std::type_info representing that derived\n// type, and returns a pointer to the start of the most-derived object of that type\n// (in which `src` is a subobject; this will be the same address as `src` in most\n// single inheritance cases). If not, or if `src` is nullptr, it simply returns `src`\n// and leaves `tinfo` at its default value of nullptr.\n//\n// The default polymorphic_type_hook just returns src. A specialization for polymorphic\n// types determines the runtime type of the passed object and adjusts the this-pointer\n// appropriately via dynamic_cast<void*>. This is what enables a C++ Animal* to appear\n// to Python as a Dog (if Dog inherits from Animal, Animal is polymorphic, Dog is\n// registered with pybind11, and this Animal is in fact a Dog).\n//\n// You may specialize polymorphic_type_hook yourself for types that want to appear\n// polymorphic to Python but do not use C++ RTTI. (This is a not uncommon pattern\n// in performance-sensitive applications, used most notably in LLVM.)\n//\n// polymorphic_type_hook_base allows users to specialize polymorphic_type_hook with\n// std::enable_if. User provided specializations will always have higher priority than\n// the default implementation and specialization provided in polymorphic_type_hook_base.\ntemplate <typename itype, typename SFINAE = void>\nstruct polymorphic_type_hook_base {\n    static const void *get(const itype *src, const std::type_info *&) { return src; }\n};\ntemplate <typename itype>\nstruct polymorphic_type_hook_base<itype, detail::enable_if_t<std::is_polymorphic<itype>::value>> {\n    static const void *get(const itype *src, const std::type_info *&type) {\n        type = src ? &typeid(*src) : nullptr;\n        return dynamic_cast<const void *>(src);\n    }\n};\ntemplate <typename itype, typename SFINAE = void>\nstruct polymorphic_type_hook : public polymorphic_type_hook_base<itype> {};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n/// Generic type caster for objects stored on the heap\ntemplate <typename type>\nclass type_caster_base : public type_caster_generic {\n    using itype = intrinsic_t<type>;\n\npublic:\n    static constexpr auto name = const_name<type>();\n\n    type_caster_base() : type_caster_base(typeid(type)) {}\n    explicit type_caster_base(const std::type_info &info) : type_caster_generic(info) {}\n\n    static handle cast(const itype &src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic\n            || policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::copy;\n        }\n        return cast(&src, policy, parent);\n    }\n\n    static handle cast(itype &&src, return_value_policy, handle parent) {\n        return cast(&src, return_value_policy::move, parent);\n    }\n\n    // Returns a (pointer, type_info) pair taking care of necessary type lookup for a\n    // polymorphic type (using RTTI by default, but can be overridden by specializing\n    // polymorphic_type_hook). If the instance isn't derived, returns the base version.\n    static std::pair<const void *, const type_info *> src_and_type(const itype *src) {\n        const auto &cast_type = typeid(itype);\n        const std::type_info *instance_type = nullptr;\n        const void *vsrc = polymorphic_type_hook<itype>::get(src, instance_type);\n        if (instance_type && !same_type(cast_type, *instance_type)) {\n            // This is a base pointer to a derived type. If the derived type is registered\n            // with pybind11, we want to make the full derived object available.\n            // In the typical case where itype is polymorphic, we get the correct\n            // derived pointer (which may be != base pointer) by a dynamic_cast to\n            // most derived type. If itype is not polymorphic, we won't get here\n            // except via a user-provided specialization of polymorphic_type_hook,\n            // and the user has promised that no this-pointer adjustment is\n            // required in that case, so it's OK to use static_cast.\n            if (const auto *tpi = get_type_info(*instance_type)) {\n                return {vsrc, tpi};\n            }\n        }\n        // Otherwise we have either a nullptr, an `itype` pointer, or an unknown derived pointer,\n        // so don't do a cast\n        return type_caster_generic::src_and_type(src, cast_type, instance_type);\n    }\n\n    static handle cast(const itype *src, return_value_policy policy, handle parent) {\n        auto st = src_and_type(src);\n        return type_caster_generic::cast(st.first,\n                                         policy,\n                                         parent,\n                                         st.second,\n                                         make_copy_constructor(src),\n                                         make_move_constructor(src));\n    }\n\n    static handle cast_holder(const itype *src, const void *holder) {\n        auto st = src_and_type(src);\n        return type_caster_generic::cast(st.first,\n                                         return_value_policy::take_ownership,\n                                         {},\n                                         st.second,\n                                         nullptr,\n                                         nullptr,\n                                         holder);\n    }\n\n    template <typename T>\n    using cast_op_type = detail::cast_op_type<T>;\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator itype *() { return (type *) value; }\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator itype &() {\n        if (!value) {\n            throw reference_cast_error();\n        }\n        return *((itype *) value);\n    }\n\nprotected:\n    using Constructor = void *(*) (const void *);\n\n    /* Only enabled when the types are {copy,move}-constructible *and* when the type\n       does not have a private operator new implementation. A comma operator is used in the\n       decltype argument to apply SFINAE to the public copy/move constructors.*/\n    template <typename T, typename = enable_if_t<is_copy_constructible<T>::value>>\n    static auto make_copy_constructor(const T *)\n        -> decltype(new T(std::declval<const T>()), Constructor{}) {\n        return [](const void *arg) -> void * { return new T(*reinterpret_cast<const T *>(arg)); };\n    }\n\n    template <typename T, typename = enable_if_t<std::is_move_constructible<T>::value>>\n    static auto make_move_constructor(const T *)\n        -> decltype(new T(std::declval<T &&>()), Constructor{}) {\n        return [](const void *arg) -> void * {\n            return new T(std::move(*const_cast<T *>(reinterpret_cast<const T *>(arg))));\n        };\n    }\n\n    static Constructor make_copy_constructor(...) { return nullptr; }\n    static Constructor make_move_constructor(...) { return nullptr; }\n};\n\nPYBIND11_NOINLINE std::string type_info_description(const std::type_info &ti) {\n    if (auto *type_data = get_type_info(ti)) {\n        handle th((PyObject *) type_data->type);\n        return th.attr(\"__module__\").cast<std::string>() + '.'\n               + th.attr(\"__qualname__\").cast<std::string>();\n    }\n    return clean_type_id(ti.name());\n}\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/detail/typeid.h",
    "content": "/*\n    pybind11/detail/typeid.h: Compiler-independent access to type identifiers\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include <cstdio>\n#include <cstdlib>\n\n#if defined(__GNUG__)\n#    include <cxxabi.h>\n#endif\n\n#include \"common.h\"\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n/// Erase all occurrences of a substring\ninline void erase_all(std::string &string, const std::string &search) {\n    for (size_t pos = 0;;) {\n        pos = string.find(search, pos);\n        if (pos == std::string::npos) {\n            break;\n        }\n        string.erase(pos, search.length());\n    }\n}\n\nPYBIND11_NOINLINE void clean_type_id(std::string &name) {\n#if defined(__GNUG__)\n    int status = 0;\n    std::unique_ptr<char, void (*)(void *)> res{\n        abi::__cxa_demangle(name.c_str(), nullptr, nullptr, &status), std::free};\n    if (status == 0) {\n        name = res.get();\n    }\n#else\n    detail::erase_all(name, \"class \");\n    detail::erase_all(name, \"struct \");\n    detail::erase_all(name, \"enum \");\n#endif\n    detail::erase_all(name, \"pybind11::\");\n}\n\ninline std::string clean_type_id(const char *typeid_name) {\n    std::string name(typeid_name);\n    detail::clean_type_id(name);\n    return name;\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n/// Return a string representation of a C++ type\ntemplate <typename T>\nstatic std::string type_id() {\n    return detail::clean_type_id(typeid(T).name());\n}\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/eigen/matrix.h",
    "content": "/*\n    pybind11/eigen/matrix.h: Transparent conversion for dense and sparse Eigen matrices\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"../numpy.h\"\n\n/* HINT: To suppress warnings originating from the Eigen headers, use -isystem.\n   See also:\n       https://stackoverflow.com/questions/2579576/i-dir-vs-isystem-dir\n       https://stackoverflow.com/questions/1741816/isystem-for-ms-visual-studio-c-compiler\n*/\nPYBIND11_WARNING_PUSH\nPYBIND11_WARNING_DISABLE_MSVC(5054) // https://github.com/pybind/pybind11/pull/3741\n//       C5054: operator '&': deprecated between enumerations of different types\n#if defined(__MINGW32__)\nPYBIND11_WARNING_DISABLE_GCC(\"-Wmaybe-uninitialized\")\n#endif\n\n#include <Eigen/Core>\n#include <Eigen/SparseCore>\n\nPYBIND11_WARNING_POP\n\n// Eigen prior to 3.2.7 doesn't have proper move constructors--but worse, some classes get implicit\n// move constructors that break things.  We could detect this an explicitly copy, but an extra copy\n// of matrices seems highly undesirable.\nstatic_assert(EIGEN_VERSION_AT_LEAST(3, 2, 7),\n              \"Eigen matrix support in pybind11 requires Eigen >= 3.2.7\");\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nPYBIND11_WARNING_DISABLE_MSVC(4127)\n\n// Provide a convenience alias for easier pass-by-ref usage with fully dynamic strides:\nusing EigenDStride = Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic>;\ntemplate <typename MatrixType>\nusing EigenDRef = Eigen::Ref<MatrixType, 0, EigenDStride>;\ntemplate <typename MatrixType>\nusing EigenDMap = Eigen::Map<MatrixType, 0, EigenDStride>;\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n#if EIGEN_VERSION_AT_LEAST(3, 3, 0)\nusing EigenIndex = Eigen::Index;\ntemplate <typename Scalar, int Flags, typename StorageIndex>\nusing EigenMapSparseMatrix = Eigen::Map<Eigen::SparseMatrix<Scalar, Flags, StorageIndex>>;\n#else\nusing EigenIndex = EIGEN_DEFAULT_DENSE_INDEX_TYPE;\ntemplate <typename Scalar, int Flags, typename StorageIndex>\nusing EigenMapSparseMatrix = Eigen::MappedSparseMatrix<Scalar, Flags, StorageIndex>;\n#endif\n\n// Matches Eigen::Map, Eigen::Ref, blocks, etc:\ntemplate <typename T>\nusing is_eigen_dense_map = all_of<is_template_base_of<Eigen::DenseBase, T>,\n                                  std::is_base_of<Eigen::MapBase<T, Eigen::ReadOnlyAccessors>, T>>;\ntemplate <typename T>\nusing is_eigen_mutable_map = std::is_base_of<Eigen::MapBase<T, Eigen::WriteAccessors>, T>;\ntemplate <typename T>\nusing is_eigen_dense_plain\n    = all_of<negation<is_eigen_dense_map<T>>, is_template_base_of<Eigen::PlainObjectBase, T>>;\ntemplate <typename T>\nusing is_eigen_sparse = is_template_base_of<Eigen::SparseMatrixBase, T>;\n// Test for objects inheriting from EigenBase<Derived> that aren't captured by the above.  This\n// basically covers anything that can be assigned to a dense matrix but that don't have a typical\n// matrix data layout that can be copied from their .data().  For example, DiagonalMatrix and\n// SelfAdjointView fall into this category.\ntemplate <typename T>\nusing is_eigen_other\n    = all_of<is_template_base_of<Eigen::EigenBase, T>,\n             negation<any_of<is_eigen_dense_map<T>, is_eigen_dense_plain<T>, is_eigen_sparse<T>>>>;\n\n// Captures numpy/eigen conformability status (returned by EigenProps::conformable()):\ntemplate <bool EigenRowMajor>\nstruct EigenConformable {\n    bool conformable = false;\n    EigenIndex rows = 0, cols = 0;\n    EigenDStride stride{0, 0};    // Only valid if negativestrides is false!\n    bool negativestrides = false; // If true, do not use stride!\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    EigenConformable(bool fits = false) : conformable{fits} {}\n    // Matrix type:\n    EigenConformable(EigenIndex r, EigenIndex c, EigenIndex rstride, EigenIndex cstride)\n        : conformable{true}, rows{r}, cols{c},\n          // TODO: when Eigen bug #747 is fixed, remove the tests for non-negativity.\n          // http://eigen.tuxfamily.org/bz/show_bug.cgi?id=747\n          stride{EigenRowMajor ? (rstride > 0 ? rstride : 0)\n                               : (cstride > 0 ? cstride : 0) /* outer stride */,\n                 EigenRowMajor ? (cstride > 0 ? cstride : 0)\n                               : (rstride > 0 ? rstride : 0) /* inner stride */},\n          negativestrides{rstride < 0 || cstride < 0} {}\n    // Vector type:\n    EigenConformable(EigenIndex r, EigenIndex c, EigenIndex stride)\n        : EigenConformable(r, c, r == 1 ? c * stride : stride, c == 1 ? r : r * stride) {}\n\n    template <typename props>\n    bool stride_compatible() const {\n        // To have compatible strides, we need (on both dimensions) one of fully dynamic strides,\n        // matching strides, or a dimension size of 1 (in which case the stride value is\n        // irrelevant). Alternatively, if any dimension size is 0, the strides are not relevant\n        // (and numpy ≥ 1.23 sets the strides to 0 in that case, so we need to check explicitly).\n        if (negativestrides) {\n            return false;\n        }\n        if (rows == 0 || cols == 0) {\n            return true;\n        }\n        return (props::inner_stride == Eigen::Dynamic || props::inner_stride == stride.inner()\n                || (EigenRowMajor ? cols : rows) == 1)\n               && (props::outer_stride == Eigen::Dynamic || props::outer_stride == stride.outer()\n                   || (EigenRowMajor ? rows : cols) == 1);\n    }\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator bool() const { return conformable; }\n};\n\ntemplate <typename Type>\nstruct eigen_extract_stride {\n    using type = Type;\n};\ntemplate <typename PlainObjectType, int MapOptions, typename StrideType>\nstruct eigen_extract_stride<Eigen::Map<PlainObjectType, MapOptions, StrideType>> {\n    using type = StrideType;\n};\ntemplate <typename PlainObjectType, int Options, typename StrideType>\nstruct eigen_extract_stride<Eigen::Ref<PlainObjectType, Options, StrideType>> {\n    using type = StrideType;\n};\n\n// Helper struct for extracting information from an Eigen type\ntemplate <typename Type_>\nstruct EigenProps {\n    using Type = Type_;\n    using Scalar = typename Type::Scalar;\n    using StrideType = typename eigen_extract_stride<Type>::type;\n    static constexpr EigenIndex rows = Type::RowsAtCompileTime, cols = Type::ColsAtCompileTime,\n                                size = Type::SizeAtCompileTime;\n    static constexpr bool row_major = Type::IsRowMajor,\n                          vector\n                          = Type::IsVectorAtCompileTime, // At least one dimension has fixed size 1\n        fixed_rows = rows != Eigen::Dynamic, fixed_cols = cols != Eigen::Dynamic,\n                          fixed = size != Eigen::Dynamic, // Fully-fixed size\n        dynamic = !fixed_rows && !fixed_cols;             // Fully-dynamic size\n\n    template <EigenIndex i, EigenIndex ifzero>\n    using if_zero = std::integral_constant<EigenIndex, i == 0 ? ifzero : i>;\n    static constexpr EigenIndex inner_stride\n        = if_zero<StrideType::InnerStrideAtCompileTime, 1>::value,\n        outer_stride = if_zero < StrideType::OuterStrideAtCompileTime,\n        vector      ? size\n        : row_major ? cols\n                    : rows > ::value;\n    static constexpr bool dynamic_stride\n        = inner_stride == Eigen::Dynamic && outer_stride == Eigen::Dynamic;\n    static constexpr bool requires_row_major\n        = !dynamic_stride && !vector && (row_major ? inner_stride : outer_stride) == 1;\n    static constexpr bool requires_col_major\n        = !dynamic_stride && !vector && (row_major ? outer_stride : inner_stride) == 1;\n\n    // Takes an input array and determines whether we can make it fit into the Eigen type.  If\n    // the array is a vector, we attempt to fit it into either an Eigen 1xN or Nx1 vector\n    // (preferring the latter if it will fit in either, i.e. for a fully dynamic matrix type).\n    static EigenConformable<row_major> conformable(const array &a) {\n        const auto dims = a.ndim();\n        if (dims < 1 || dims > 2) {\n            return false;\n        }\n\n        if (dims == 2) { // Matrix type: require exact match (or dynamic)\n\n            EigenIndex np_rows = a.shape(0), np_cols = a.shape(1),\n                       np_rstride = a.strides(0) / static_cast<ssize_t>(sizeof(Scalar)),\n                       np_cstride = a.strides(1) / static_cast<ssize_t>(sizeof(Scalar));\n            if ((fixed_rows && np_rows != rows) || (fixed_cols && np_cols != cols)) {\n                return false;\n            }\n\n            return {np_rows, np_cols, np_rstride, np_cstride};\n        }\n\n        // Otherwise we're storing an n-vector.  Only one of the strides will be used, but\n        // whichever is used, we want the (single) numpy stride value.\n        const EigenIndex n = a.shape(0),\n                         stride = a.strides(0) / static_cast<ssize_t>(sizeof(Scalar));\n\n        if (vector) { // Eigen type is a compile-time vector\n            if (fixed && size != n) {\n                return false; // Vector size mismatch\n            }\n            return {rows == 1 ? 1 : n, cols == 1 ? 1 : n, stride};\n        }\n        if (fixed) {\n            // The type has a fixed size, but is not a vector: abort\n            return false;\n        }\n        if (fixed_cols) {\n            // Since this isn't a vector, cols must be != 1.  We allow this only if it exactly\n            // equals the number of elements (rows is Dynamic, and so 1 row is allowed).\n            if (cols != n) {\n                return false;\n            }\n            return {1, n, stride};\n        } // Otherwise it's either fully dynamic, or column dynamic; both become a column vector\n        if (fixed_rows && rows != n) {\n            return false;\n        }\n        return {n, 1, stride};\n    }\n\n    static constexpr bool show_writeable\n        = is_eigen_dense_map<Type>::value && is_eigen_mutable_map<Type>::value;\n    static constexpr bool show_order = is_eigen_dense_map<Type>::value;\n    static constexpr bool show_c_contiguous = show_order && requires_row_major;\n    static constexpr bool show_f_contiguous\n        = !show_c_contiguous && show_order && requires_col_major;\n\n    static constexpr auto descriptor\n        = const_name(\"numpy.ndarray[\") + npy_format_descriptor<Scalar>::name + const_name(\"[\")\n          + const_name<fixed_rows>(const_name<(size_t) rows>(), const_name(\"m\")) + const_name(\", \")\n          + const_name<fixed_cols>(const_name<(size_t) cols>(), const_name(\"n\")) + const_name(\"]\")\n          +\n          // For a reference type (e.g. Ref<MatrixXd>) we have other constraints that might need to\n          // be satisfied: writeable=True (for a mutable reference), and, depending on the map's\n          // stride options, possibly f_contiguous or c_contiguous.  We include them in the\n          // descriptor output to provide some hint as to why a TypeError is occurring (otherwise\n          // it can be confusing to see that a function accepts a 'numpy.ndarray[float64[3,2]]' and\n          // an error message that you *gave* a numpy.ndarray of the right type and dimensions.\n          const_name<show_writeable>(\", flags.writeable\", \"\")\n          + const_name<show_c_contiguous>(\", flags.c_contiguous\", \"\")\n          + const_name<show_f_contiguous>(\", flags.f_contiguous\", \"\") + const_name(\"]\");\n};\n\n// Casts an Eigen type to numpy array.  If given a base, the numpy array references the src data,\n// otherwise it'll make a copy.  writeable lets you turn off the writeable flag for the array.\ntemplate <typename props>\nhandle\neigen_array_cast(typename props::Type const &src, handle base = handle(), bool writeable = true) {\n    constexpr ssize_t elem_size = sizeof(typename props::Scalar);\n    array a;\n    if (props::vector) {\n        a = array({src.size()}, {elem_size * src.innerStride()}, src.data(), base);\n    } else {\n        a = array({src.rows(), src.cols()},\n                  {elem_size * src.rowStride(), elem_size * src.colStride()},\n                  src.data(),\n                  base);\n    }\n\n    if (!writeable) {\n        array_proxy(a.ptr())->flags &= ~detail::npy_api::NPY_ARRAY_WRITEABLE_;\n    }\n\n    return a.release();\n}\n\n// Takes an lvalue ref to some Eigen type and a (python) base object, creating a numpy array that\n// reference the Eigen object's data with `base` as the python-registered base class (if omitted,\n// the base will be set to None, and lifetime management is up to the caller).  The numpy array is\n// non-writeable if the given type is const.\ntemplate <typename props, typename Type>\nhandle eigen_ref_array(Type &src, handle parent = none()) {\n    // none here is to get past array's should-we-copy detection, which currently always\n    // copies when there is no base.  Setting the base to None should be harmless.\n    return eigen_array_cast<props>(src, parent, !std::is_const<Type>::value);\n}\n\n// Takes a pointer to some dense, plain Eigen type, builds a capsule around it, then returns a\n// numpy array that references the encapsulated data with a python-side reference to the capsule to\n// tie its destruction to that of any dependent python objects.  Const-ness is determined by\n// whether or not the Type of the pointer given is const.\ntemplate <typename props, typename Type, typename = enable_if_t<is_eigen_dense_plain<Type>::value>>\nhandle eigen_encapsulate(Type *src) {\n    capsule base(src, [](void *o) { delete static_cast<Type *>(o); });\n    return eigen_ref_array<props>(*src, base);\n}\n\n// Type caster for regular, dense matrix types (e.g. MatrixXd), but not maps/refs/etc. of dense\n// types.\ntemplate <typename Type>\nstruct type_caster<Type, enable_if_t<is_eigen_dense_plain<Type>::value>> {\n    using Scalar = typename Type::Scalar;\n    using props = EigenProps<Type>;\n\n    bool load(handle src, bool convert) {\n        // If we're in no-convert mode, only load if given an array of the correct type\n        if (!convert && !isinstance<array_t<Scalar>>(src)) {\n            return false;\n        }\n\n        // Coerce into an array, but don't do type conversion yet; the copy below handles it.\n        auto buf = array::ensure(src);\n\n        if (!buf) {\n            return false;\n        }\n\n        auto dims = buf.ndim();\n        if (dims < 1 || dims > 2) {\n            return false;\n        }\n\n        auto fits = props::conformable(buf);\n        if (!fits) {\n            return false;\n        }\n\n        // Allocate the new type, then build a numpy reference into it\n        value = Type(fits.rows, fits.cols);\n        auto ref = reinterpret_steal<array>(eigen_ref_array<props>(value));\n        if (dims == 1) {\n            ref = ref.squeeze();\n        } else if (ref.ndim() == 1) {\n            buf = buf.squeeze();\n        }\n\n        int result = detail::npy_api::get().PyArray_CopyInto_(ref.ptr(), buf.ptr());\n\n        if (result < 0) { // Copy failed!\n            PyErr_Clear();\n            return false;\n        }\n\n        return true;\n    }\n\nprivate:\n    // Cast implementation\n    template <typename CType>\n    static handle cast_impl(CType *src, return_value_policy policy, handle parent) {\n        switch (policy) {\n            case return_value_policy::take_ownership:\n            case return_value_policy::automatic:\n                return eigen_encapsulate<props>(src);\n            case return_value_policy::move:\n                return eigen_encapsulate<props>(new CType(std::move(*src)));\n            case return_value_policy::copy:\n                return eigen_array_cast<props>(*src);\n            case return_value_policy::reference:\n            case return_value_policy::automatic_reference:\n                return eigen_ref_array<props>(*src);\n            case return_value_policy::reference_internal:\n                return eigen_ref_array<props>(*src, parent);\n            default:\n                throw cast_error(\"unhandled return_value_policy: should not happen!\");\n        };\n    }\n\npublic:\n    // Normal returned non-reference, non-const value:\n    static handle cast(Type &&src, return_value_policy /* policy */, handle parent) {\n        return cast_impl(&src, return_value_policy::move, parent);\n    }\n    // If you return a non-reference const, we mark the numpy array readonly:\n    static handle cast(const Type &&src, return_value_policy /* policy */, handle parent) {\n        return cast_impl(&src, return_value_policy::move, parent);\n    }\n    // lvalue reference return; default (automatic) becomes copy\n    static handle cast(Type &src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic\n            || policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::copy;\n        }\n        return cast_impl(&src, policy, parent);\n    }\n    // const lvalue reference return; default (automatic) becomes copy\n    static handle cast(const Type &src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic\n            || policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::copy;\n        }\n        return cast(&src, policy, parent);\n    }\n    // non-const pointer return\n    static handle cast(Type *src, return_value_policy policy, handle parent) {\n        return cast_impl(src, policy, parent);\n    }\n    // const pointer return\n    static handle cast(const Type *src, return_value_policy policy, handle parent) {\n        return cast_impl(src, policy, parent);\n    }\n\n    static constexpr auto name = props::descriptor;\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator Type *() { return &value; }\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator Type &() { return value; }\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator Type &&() && { return std::move(value); }\n    template <typename T>\n    using cast_op_type = movable_cast_op_type<T>;\n\nprivate:\n    Type value;\n};\n\n// Base class for casting reference/map/block/etc. objects back to python.\ntemplate <typename MapType>\nstruct eigen_map_caster {\nprivate:\n    using props = EigenProps<MapType>;\n\npublic:\n    // Directly referencing a ref/map's data is a bit dangerous (whatever the map/ref points to has\n    // to stay around), but we'll allow it under the assumption that you know what you're doing\n    // (and have an appropriate keep_alive in place).  We return a numpy array pointing directly at\n    // the ref's data (The numpy array ends up read-only if the ref was to a const matrix type.)\n    // Note that this means you need to ensure you don't destroy the object in some other way (e.g.\n    // with an appropriate keep_alive, or with a reference to a statically allocated matrix).\n    static handle cast(const MapType &src, return_value_policy policy, handle parent) {\n        switch (policy) {\n            case return_value_policy::copy:\n                return eigen_array_cast<props>(src);\n            case return_value_policy::reference_internal:\n                return eigen_array_cast<props>(src, parent, is_eigen_mutable_map<MapType>::value);\n            case return_value_policy::reference:\n            case return_value_policy::automatic:\n            case return_value_policy::automatic_reference:\n                return eigen_array_cast<props>(src, none(), is_eigen_mutable_map<MapType>::value);\n            default:\n                // move, take_ownership don't make any sense for a ref/map:\n                pybind11_fail(\"Invalid return_value_policy for Eigen Map/Ref/Block type\");\n        }\n    }\n\n    static constexpr auto name = props::descriptor;\n\n    // Explicitly delete these: support python -> C++ conversion on these (i.e. these can be return\n    // types but not bound arguments).  We still provide them (with an explicitly delete) so that\n    // you end up here if you try anyway.\n    bool load(handle, bool) = delete;\n    operator MapType() = delete;\n    template <typename>\n    using cast_op_type = MapType;\n};\n\n// We can return any map-like object (but can only load Refs, specialized next):\ntemplate <typename Type>\nstruct type_caster<Type, enable_if_t<is_eigen_dense_map<Type>::value>> : eigen_map_caster<Type> {};\n\n// Loader for Ref<...> arguments.  See the documentation for info on how to make this work without\n// copying (it requires some extra effort in many cases).\ntemplate <typename PlainObjectType, typename StrideType>\nstruct type_caster<\n    Eigen::Ref<PlainObjectType, 0, StrideType>,\n    enable_if_t<is_eigen_dense_map<Eigen::Ref<PlainObjectType, 0, StrideType>>::value>>\n    : public eigen_map_caster<Eigen::Ref<PlainObjectType, 0, StrideType>> {\nprivate:\n    using Type = Eigen::Ref<PlainObjectType, 0, StrideType>;\n    using props = EigenProps<Type>;\n    using Scalar = typename props::Scalar;\n    using MapType = Eigen::Map<PlainObjectType, 0, StrideType>;\n    using Array\n        = array_t<Scalar,\n                  array::forcecast\n                      | ((props::row_major ? props::inner_stride : props::outer_stride) == 1\n                             ? array::c_style\n                         : (props::row_major ? props::outer_stride : props::inner_stride) == 1\n                             ? array::f_style\n                             : 0)>;\n    static constexpr bool need_writeable = is_eigen_mutable_map<Type>::value;\n    // Delay construction (these have no default constructor)\n    std::unique_ptr<MapType> map;\n    std::unique_ptr<Type> ref;\n    // Our array.  When possible, this is just a numpy array pointing to the source data, but\n    // sometimes we can't avoid copying (e.g. input is not a numpy array at all, has an\n    // incompatible layout, or is an array of a type that needs to be converted).  Using a numpy\n    // temporary (rather than an Eigen temporary) saves an extra copy when we need both type\n    // conversion and storage order conversion.  (Note that we refuse to use this temporary copy\n    // when loading an argument for a Ref<M> with M non-const, i.e. a read-write reference).\n    Array copy_or_ref;\n\npublic:\n    bool load(handle src, bool convert) {\n        // First check whether what we have is already an array of the right type.  If not, we\n        // can't avoid a copy (because the copy is also going to do type conversion).\n        bool need_copy = !isinstance<Array>(src);\n\n        EigenConformable<props::row_major> fits;\n        if (!need_copy) {\n            // We don't need a converting copy, but we also need to check whether the strides are\n            // compatible with the Ref's stride requirements\n            auto aref = reinterpret_borrow<Array>(src);\n\n            if (aref && (!need_writeable || aref.writeable())) {\n                fits = props::conformable(aref);\n                if (!fits) {\n                    return false; // Incompatible dimensions\n                }\n                if (!fits.template stride_compatible<props>()) {\n                    need_copy = true;\n                } else {\n                    copy_or_ref = std::move(aref);\n                }\n            } else {\n                need_copy = true;\n            }\n        }\n\n        if (need_copy) {\n            // We need to copy: If we need a mutable reference, or we're not supposed to convert\n            // (either because we're in the no-convert overload pass, or because we're explicitly\n            // instructed not to copy (via `py::arg().noconvert()`) we have to fail loading.\n            if (!convert || need_writeable) {\n                return false;\n            }\n\n            Array copy = Array::ensure(src);\n            if (!copy) {\n                return false;\n            }\n            fits = props::conformable(copy);\n            if (!fits || !fits.template stride_compatible<props>()) {\n                return false;\n            }\n            copy_or_ref = std::move(copy);\n            loader_life_support::add_patient(copy_or_ref);\n        }\n\n        ref.reset();\n        map.reset(new MapType(data(copy_or_ref),\n                              fits.rows,\n                              fits.cols,\n                              make_stride(fits.stride.outer(), fits.stride.inner())));\n        ref.reset(new Type(*map));\n\n        return true;\n    }\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator Type *() { return ref.get(); }\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator Type &() { return *ref; }\n    template <typename _T>\n    using cast_op_type = pybind11::detail::cast_op_type<_T>;\n\nprivate:\n    template <typename T = Type, enable_if_t<is_eigen_mutable_map<T>::value, int> = 0>\n    Scalar *data(Array &a) {\n        return a.mutable_data();\n    }\n\n    template <typename T = Type, enable_if_t<!is_eigen_mutable_map<T>::value, int> = 0>\n    const Scalar *data(Array &a) {\n        return a.data();\n    }\n\n    // Attempt to figure out a constructor of `Stride` that will work.\n    // If both strides are fixed, use a default constructor:\n    template <typename S>\n    using stride_ctor_default = bool_constant<S::InnerStrideAtCompileTime != Eigen::Dynamic\n                                              && S::OuterStrideAtCompileTime != Eigen::Dynamic\n                                              && std::is_default_constructible<S>::value>;\n    // Otherwise, if there is a two-index constructor, assume it is (outer,inner) like\n    // Eigen::Stride, and use it:\n    template <typename S>\n    using stride_ctor_dual\n        = bool_constant<!stride_ctor_default<S>::value\n                        && std::is_constructible<S, EigenIndex, EigenIndex>::value>;\n    // Otherwise, if there is a one-index constructor, and just one of the strides is dynamic, use\n    // it (passing whichever stride is dynamic).\n    template <typename S>\n    using stride_ctor_outer\n        = bool_constant<!any_of<stride_ctor_default<S>, stride_ctor_dual<S>>::value\n                        && S::OuterStrideAtCompileTime == Eigen::Dynamic\n                        && S::InnerStrideAtCompileTime != Eigen::Dynamic\n                        && std::is_constructible<S, EigenIndex>::value>;\n    template <typename S>\n    using stride_ctor_inner\n        = bool_constant<!any_of<stride_ctor_default<S>, stride_ctor_dual<S>>::value\n                        && S::InnerStrideAtCompileTime == Eigen::Dynamic\n                        && S::OuterStrideAtCompileTime != Eigen::Dynamic\n                        && std::is_constructible<S, EigenIndex>::value>;\n\n    template <typename S = StrideType, enable_if_t<stride_ctor_default<S>::value, int> = 0>\n    static S make_stride(EigenIndex, EigenIndex) {\n        return S();\n    }\n    template <typename S = StrideType, enable_if_t<stride_ctor_dual<S>::value, int> = 0>\n    static S make_stride(EigenIndex outer, EigenIndex inner) {\n        return S(outer, inner);\n    }\n    template <typename S = StrideType, enable_if_t<stride_ctor_outer<S>::value, int> = 0>\n    static S make_stride(EigenIndex outer, EigenIndex) {\n        return S(outer);\n    }\n    template <typename S = StrideType, enable_if_t<stride_ctor_inner<S>::value, int> = 0>\n    static S make_stride(EigenIndex, EigenIndex inner) {\n        return S(inner);\n    }\n};\n\n// type_caster for special matrix types (e.g. DiagonalMatrix), which are EigenBase, but not\n// EigenDense (i.e. they don't have a data(), at least not with the usual matrix layout).\n// load() is not supported, but we can cast them into the python domain by first copying to a\n// regular Eigen::Matrix, then casting that.\ntemplate <typename Type>\nstruct type_caster<Type, enable_if_t<is_eigen_other<Type>::value>> {\nprotected:\n    using Matrix\n        = Eigen::Matrix<typename Type::Scalar, Type::RowsAtCompileTime, Type::ColsAtCompileTime>;\n    using props = EigenProps<Matrix>;\n\npublic:\n    static handle cast(const Type &src, return_value_policy /* policy */, handle /* parent */) {\n        handle h = eigen_encapsulate<props>(new Matrix(src));\n        return h;\n    }\n    static handle cast(const Type *src, return_value_policy policy, handle parent) {\n        return cast(*src, policy, parent);\n    }\n\n    static constexpr auto name = props::descriptor;\n\n    // Explicitly delete these: support python -> C++ conversion on these (i.e. these can be return\n    // types but not bound arguments).  We still provide them (with an explicitly delete) so that\n    // you end up here if you try anyway.\n    bool load(handle, bool) = delete;\n    operator Type() = delete;\n    template <typename>\n    using cast_op_type = Type;\n};\n\ntemplate <typename Type>\nstruct type_caster<Type, enable_if_t<is_eigen_sparse<Type>::value>> {\n    using Scalar = typename Type::Scalar;\n    using StorageIndex = remove_reference_t<decltype(*std::declval<Type>().outerIndexPtr())>;\n    using Index = typename Type::Index;\n    static constexpr bool rowMajor = Type::IsRowMajor;\n\n    bool load(handle src, bool) {\n        if (!src) {\n            return false;\n        }\n\n        auto obj = reinterpret_borrow<object>(src);\n        object sparse_module = module_::import(\"scipy.sparse\");\n        object matrix_type = sparse_module.attr(rowMajor ? \"csr_matrix\" : \"csc_matrix\");\n\n        if (!type::handle_of(obj).is(matrix_type)) {\n            try {\n                obj = matrix_type(obj);\n            } catch (const error_already_set &) {\n                return false;\n            }\n        }\n\n        auto values = array_t<Scalar>((object) obj.attr(\"data\"));\n        auto innerIndices = array_t<StorageIndex>((object) obj.attr(\"indices\"));\n        auto outerIndices = array_t<StorageIndex>((object) obj.attr(\"indptr\"));\n        auto shape = pybind11::tuple((pybind11::object) obj.attr(\"shape\"));\n        auto nnz = obj.attr(\"nnz\").cast<Index>();\n\n        if (!values || !innerIndices || !outerIndices) {\n            return false;\n        }\n\n        value = EigenMapSparseMatrix<Scalar,\n                                     Type::Flags &(Eigen::RowMajor | Eigen::ColMajor),\n                                     StorageIndex>(shape[0].cast<Index>(),\n                                                   shape[1].cast<Index>(),\n                                                   std::move(nnz),\n                                                   outerIndices.mutable_data(),\n                                                   innerIndices.mutable_data(),\n                                                   values.mutable_data());\n\n        return true;\n    }\n\n    static handle cast(const Type &src, return_value_policy /* policy */, handle /* parent */) {\n        const_cast<Type &>(src).makeCompressed();\n\n        object matrix_type\n            = module_::import(\"scipy.sparse\").attr(rowMajor ? \"csr_matrix\" : \"csc_matrix\");\n\n        array data(src.nonZeros(), src.valuePtr());\n        array outerIndices((rowMajor ? src.rows() : src.cols()) + 1, src.outerIndexPtr());\n        array innerIndices(src.nonZeros(), src.innerIndexPtr());\n\n        return matrix_type(pybind11::make_tuple(\n                               std::move(data), std::move(innerIndices), std::move(outerIndices)),\n                           pybind11::make_tuple(src.rows(), src.cols()))\n            .release();\n    }\n\n    PYBIND11_TYPE_CASTER(Type,\n                         const_name<(Type::IsRowMajor) != 0>(\"scipy.sparse.csr_matrix[\",\n                                                             \"scipy.sparse.csc_matrix[\")\n                             + npy_format_descriptor<Scalar>::name + const_name(\"]\"));\n};\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/eigen/tensor.h",
    "content": "/*\n    pybind11/eigen/tensor.h: Transparent conversion for Eigen tensors\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"../numpy.h\"\n\n#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)\nstatic_assert(__GNUC__ > 5, \"Eigen Tensor support in pybind11 requires GCC > 5.0\");\n#endif\n\n// Disable warnings for Eigen\nPYBIND11_WARNING_PUSH\nPYBIND11_WARNING_DISABLE_MSVC(4554)\nPYBIND11_WARNING_DISABLE_MSVC(4127)\n#if defined(__MINGW32__)\nPYBIND11_WARNING_DISABLE_GCC(\"-Wmaybe-uninitialized\")\n#endif\n\n#include <unsupported/Eigen/CXX11/Tensor>\n\nPYBIND11_WARNING_POP\n\nstatic_assert(EIGEN_VERSION_AT_LEAST(3, 3, 0),\n              \"Eigen Tensor support in pybind11 requires Eigen >= 3.3.0\");\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nPYBIND11_WARNING_DISABLE_MSVC(4127)\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ninline bool is_tensor_aligned(const void *data) {\n    return (reinterpret_cast<std::size_t>(data) % EIGEN_DEFAULT_ALIGN_BYTES) == 0;\n}\n\ntemplate <typename T>\nconstexpr int compute_array_flag_from_tensor() {\n    static_assert((static_cast<int>(T::Layout) == static_cast<int>(Eigen::RowMajor))\n                      || (static_cast<int>(T::Layout) == static_cast<int>(Eigen::ColMajor)),\n                  \"Layout must be row or column major\");\n    return (static_cast<int>(T::Layout) == static_cast<int>(Eigen::RowMajor)) ? array::c_style\n                                                                              : array::f_style;\n}\n\ntemplate <typename T>\nstruct eigen_tensor_helper {};\n\ntemplate <typename Scalar_, int NumIndices_, int Options_, typename IndexType>\nstruct eigen_tensor_helper<Eigen::Tensor<Scalar_, NumIndices_, Options_, IndexType>> {\n    using Type = Eigen::Tensor<Scalar_, NumIndices_, Options_, IndexType>;\n    using ValidType = void;\n\n    static Eigen::DSizes<typename Type::Index, Type::NumIndices> get_shape(const Type &f) {\n        return f.dimensions();\n    }\n\n    static constexpr bool\n    is_correct_shape(const Eigen::DSizes<typename Type::Index, Type::NumIndices> & /*shape*/) {\n        return true;\n    }\n\n    template <typename T>\n    struct helper {};\n\n    template <size_t... Is>\n    struct helper<index_sequence<Is...>> {\n        static constexpr auto value = concat(const_name(((void) Is, \"?\"))...);\n    };\n\n    static constexpr auto dimensions_descriptor\n        = helper<decltype(make_index_sequence<Type::NumIndices>())>::value;\n\n    template <typename... Args>\n    static Type *alloc(Args &&...args) {\n        return new Type(std::forward<Args>(args)...);\n    }\n\n    static void free(Type *tensor) { delete tensor; }\n};\n\ntemplate <typename Scalar_, typename std::ptrdiff_t... Indices, int Options_, typename IndexType>\nstruct eigen_tensor_helper<\n    Eigen::TensorFixedSize<Scalar_, Eigen::Sizes<Indices...>, Options_, IndexType>> {\n    using Type = Eigen::TensorFixedSize<Scalar_, Eigen::Sizes<Indices...>, Options_, IndexType>;\n    using ValidType = void;\n\n    static constexpr Eigen::DSizes<typename Type::Index, Type::NumIndices>\n    get_shape(const Type & /*f*/) {\n        return get_shape();\n    }\n\n    static constexpr Eigen::DSizes<typename Type::Index, Type::NumIndices> get_shape() {\n        return Eigen::DSizes<typename Type::Index, Type::NumIndices>(Indices...);\n    }\n\n    static bool\n    is_correct_shape(const Eigen::DSizes<typename Type::Index, Type::NumIndices> &shape) {\n        return get_shape() == shape;\n    }\n\n    static constexpr auto dimensions_descriptor = concat(const_name<Indices>()...);\n\n    template <typename... Args>\n    static Type *alloc(Args &&...args) {\n        Eigen::aligned_allocator<Type> allocator;\n        return ::new (allocator.allocate(1)) Type(std::forward<Args>(args)...);\n    }\n\n    static void free(Type *tensor) {\n        Eigen::aligned_allocator<Type> allocator;\n        tensor->~Type();\n        allocator.deallocate(tensor, 1);\n    }\n};\n\ntemplate <typename Type, bool ShowDetails, bool NeedsWriteable = false>\nstruct get_tensor_descriptor {\n    static constexpr auto details\n        = const_name<NeedsWriteable>(\", flags.writeable\", \"\")\n          + const_name<static_cast<int>(Type::Layout) == static_cast<int>(Eigen::RowMajor)>(\n              \", flags.c_contiguous\", \", flags.f_contiguous\");\n    static constexpr auto value\n        = const_name(\"numpy.ndarray[\") + npy_format_descriptor<typename Type::Scalar>::name\n          + const_name(\"[\") + eigen_tensor_helper<remove_cv_t<Type>>::dimensions_descriptor\n          + const_name(\"]\") + const_name<ShowDetails>(details, const_name(\"\")) + const_name(\"]\");\n};\n\n// When EIGEN_AVOID_STL_ARRAY is defined, Eigen::DSizes<T, 0> does not have the begin() member\n// function. Falling back to a simple loop works around this issue.\n//\n// We need to disable the type-limits warning for the inner loop when size = 0.\n\nPYBIND11_WARNING_PUSH\nPYBIND11_WARNING_DISABLE_GCC(\"-Wtype-limits\")\n\ntemplate <typename T, int size>\nstd::vector<T> convert_dsizes_to_vector(const Eigen::DSizes<T, size> &arr) {\n    std::vector<T> result(size);\n\n    for (size_t i = 0; i < size; i++) {\n        result[i] = arr[i];\n    }\n\n    return result;\n}\n\ntemplate <typename T, int size>\nEigen::DSizes<T, size> get_shape_for_array(const array &arr) {\n    Eigen::DSizes<T, size> result;\n    const T *shape = arr.shape();\n    for (size_t i = 0; i < size; i++) {\n        result[i] = shape[i];\n    }\n\n    return result;\n}\n\nPYBIND11_WARNING_POP\n\ntemplate <typename Type>\nstruct type_caster<Type, typename eigen_tensor_helper<Type>::ValidType> {\n    using Helper = eigen_tensor_helper<Type>;\n    static constexpr auto temp_name = get_tensor_descriptor<Type, false>::value;\n    PYBIND11_TYPE_CASTER(Type, temp_name);\n\n    bool load(handle src, bool convert) {\n        if (!convert) {\n            if (!isinstance<array>(src)) {\n                return false;\n            }\n            array temp = array::ensure(src);\n            if (!temp) {\n                return false;\n            }\n\n            if (!temp.dtype().is(dtype::of<typename Type::Scalar>())) {\n                return false;\n            }\n        }\n\n        array_t<typename Type::Scalar, compute_array_flag_from_tensor<Type>()> arr(\n            reinterpret_borrow<object>(src));\n\n        if (arr.ndim() != Type::NumIndices) {\n            return false;\n        }\n        auto shape = get_shape_for_array<typename Type::Index, Type::NumIndices>(arr);\n\n        if (!Helper::is_correct_shape(shape)) {\n            return false;\n        }\n\n#if EIGEN_VERSION_AT_LEAST(3, 4, 0)\n        auto data_pointer = arr.data();\n#else\n        // Handle Eigen bug\n        auto data_pointer = const_cast<typename Type::Scalar *>(arr.data());\n#endif\n\n        if (is_tensor_aligned(arr.data())) {\n            value = Eigen::TensorMap<const Type, Eigen::Aligned>(data_pointer, shape);\n        } else {\n            value = Eigen::TensorMap<const Type>(data_pointer, shape);\n        }\n\n        return true;\n    }\n\n    static handle cast(Type &&src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::reference\n            || policy == return_value_policy::reference_internal) {\n            pybind11_fail(\"Cannot use a reference return value policy for an rvalue\");\n        }\n        return cast_impl(&src, return_value_policy::move, parent);\n    }\n\n    static handle cast(const Type &&src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::reference\n            || policy == return_value_policy::reference_internal) {\n            pybind11_fail(\"Cannot use a reference return value policy for an rvalue\");\n        }\n        return cast_impl(&src, return_value_policy::move, parent);\n    }\n\n    static handle cast(Type &src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic\n            || policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::copy;\n        }\n        return cast_impl(&src, policy, parent);\n    }\n\n    static handle cast(const Type &src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic\n            || policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::copy;\n        }\n        return cast(&src, policy, parent);\n    }\n\n    static handle cast(Type *src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic) {\n            policy = return_value_policy::take_ownership;\n        } else if (policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::reference;\n        }\n        return cast_impl(src, policy, parent);\n    }\n\n    static handle cast(const Type *src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic) {\n            policy = return_value_policy::take_ownership;\n        } else if (policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::reference;\n        }\n        return cast_impl(src, policy, parent);\n    }\n\n    template <typename C>\n    static handle cast_impl(C *src, return_value_policy policy, handle parent) {\n        object parent_object;\n        bool writeable = false;\n        switch (policy) {\n            case return_value_policy::move:\n                if (std::is_const<C>::value) {\n                    pybind11_fail(\"Cannot move from a constant reference\");\n                }\n\n                src = Helper::alloc(std::move(*src));\n\n                parent_object\n                    = capsule(src, [](void *ptr) { Helper::free(reinterpret_cast<Type *>(ptr)); });\n                writeable = true;\n                break;\n\n            case return_value_policy::take_ownership:\n                if (std::is_const<C>::value) {\n                    // This cast is ugly, and might be UB in some cases, but we don't have an\n                    // alternative here as we must free that memory\n                    Helper::free(const_cast<Type *>(src));\n                    pybind11_fail(\"Cannot take ownership of a const reference\");\n                }\n\n                parent_object\n                    = capsule(src, [](void *ptr) { Helper::free(reinterpret_cast<Type *>(ptr)); });\n                writeable = true;\n                break;\n\n            case return_value_policy::copy:\n                writeable = true;\n                break;\n\n            case return_value_policy::reference:\n                parent_object = none();\n                writeable = !std::is_const<C>::value;\n                break;\n\n            case return_value_policy::reference_internal:\n                // Default should do the right thing\n                if (!parent) {\n                    pybind11_fail(\"Cannot use reference internal when there is no parent\");\n                }\n                parent_object = reinterpret_borrow<object>(parent);\n                writeable = !std::is_const<C>::value;\n                break;\n\n            default:\n                pybind11_fail(\"pybind11 bug in eigen.h, please file a bug report\");\n        }\n\n        auto result = array_t<typename Type::Scalar, compute_array_flag_from_tensor<Type>()>(\n            convert_dsizes_to_vector(Helper::get_shape(*src)), src->data(), parent_object);\n\n        if (!writeable) {\n            array_proxy(result.ptr())->flags &= ~detail::npy_api::NPY_ARRAY_WRITEABLE_;\n        }\n\n        return result.release();\n    }\n};\n\ntemplate <typename StoragePointerType,\n          bool needs_writeable,\n          enable_if_t<!needs_writeable, bool> = true>\nStoragePointerType get_array_data_for_type(array &arr) {\n#if EIGEN_VERSION_AT_LEAST(3, 4, 0)\n    return reinterpret_cast<StoragePointerType>(arr.data());\n#else\n    // Handle Eigen bug\n    return reinterpret_cast<StoragePointerType>(const_cast<void *>(arr.data()));\n#endif\n}\n\ntemplate <typename StoragePointerType,\n          bool needs_writeable,\n          enable_if_t<needs_writeable, bool> = true>\nStoragePointerType get_array_data_for_type(array &arr) {\n    return reinterpret_cast<StoragePointerType>(arr.mutable_data());\n}\n\ntemplate <typename T, typename = void>\nstruct get_storage_pointer_type;\n\ntemplate <typename MapType>\nstruct get_storage_pointer_type<MapType, void_t<typename MapType::StoragePointerType>> {\n    using SPT = typename MapType::StoragePointerType;\n};\n\ntemplate <typename MapType>\nstruct get_storage_pointer_type<MapType, void_t<typename MapType::PointerArgType>> {\n    using SPT = typename MapType::PointerArgType;\n};\n\ntemplate <typename Type, int Options>\nstruct type_caster<Eigen::TensorMap<Type, Options>,\n                   typename eigen_tensor_helper<remove_cv_t<Type>>::ValidType> {\n    using MapType = Eigen::TensorMap<Type, Options>;\n    using Helper = eigen_tensor_helper<remove_cv_t<Type>>;\n\n    bool load(handle src, bool /*convert*/) {\n        // Note that we have a lot more checks here as we want to make sure to avoid copies\n        if (!isinstance<array>(src)) {\n            return false;\n        }\n        auto arr = reinterpret_borrow<array>(src);\n        if ((arr.flags() & compute_array_flag_from_tensor<Type>()) == 0) {\n            return false;\n        }\n\n        if (!arr.dtype().is(dtype::of<typename Type::Scalar>())) {\n            return false;\n        }\n\n        if (arr.ndim() != Type::NumIndices) {\n            return false;\n        }\n\n        constexpr bool is_aligned = (Options & Eigen::Aligned) != 0;\n\n        if (is_aligned && !is_tensor_aligned(arr.data())) {\n            return false;\n        }\n\n        auto shape = get_shape_for_array<typename Type::Index, Type::NumIndices>(arr);\n\n        if (!Helper::is_correct_shape(shape)) {\n            return false;\n        }\n\n        if (needs_writeable && !arr.writeable()) {\n            return false;\n        }\n\n        auto result = get_array_data_for_type<typename get_storage_pointer_type<MapType>::SPT,\n                                              needs_writeable>(arr);\n\n        value.reset(new MapType(std::move(result), std::move(shape)));\n\n        return true;\n    }\n\n    static handle cast(MapType &&src, return_value_policy policy, handle parent) {\n        return cast_impl(&src, policy, parent);\n    }\n\n    static handle cast(const MapType &&src, return_value_policy policy, handle parent) {\n        return cast_impl(&src, policy, parent);\n    }\n\n    static handle cast(MapType &src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic\n            || policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::copy;\n        }\n        return cast_impl(&src, policy, parent);\n    }\n\n    static handle cast(const MapType &src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic\n            || policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::copy;\n        }\n        return cast(&src, policy, parent);\n    }\n\n    static handle cast(MapType *src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic) {\n            policy = return_value_policy::take_ownership;\n        } else if (policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::reference;\n        }\n        return cast_impl(src, policy, parent);\n    }\n\n    static handle cast(const MapType *src, return_value_policy policy, handle parent) {\n        if (policy == return_value_policy::automatic) {\n            policy = return_value_policy::take_ownership;\n        } else if (policy == return_value_policy::automatic_reference) {\n            policy = return_value_policy::reference;\n        }\n        return cast_impl(src, policy, parent);\n    }\n\n    template <typename C>\n    static handle cast_impl(C *src, return_value_policy policy, handle parent) {\n        object parent_object;\n        constexpr bool writeable = !std::is_const<C>::value;\n        switch (policy) {\n            case return_value_policy::reference:\n                parent_object = none();\n                break;\n\n            case return_value_policy::reference_internal:\n                // Default should do the right thing\n                if (!parent) {\n                    pybind11_fail(\"Cannot use reference internal when there is no parent\");\n                }\n                parent_object = reinterpret_borrow<object>(parent);\n                break;\n\n            case return_value_policy::take_ownership:\n                delete src;\n                // fallthrough\n            default:\n                // move, take_ownership don't make any sense for a ref/map:\n                pybind11_fail(\"Invalid return_value_policy for Eigen Map type, must be either \"\n                              \"reference or reference_internal\");\n        }\n\n        auto result = array_t<typename Type::Scalar, compute_array_flag_from_tensor<Type>()>(\n            convert_dsizes_to_vector(Helper::get_shape(*src)),\n            src->data(),\n            std::move(parent_object));\n\n        if (!writeable) {\n            array_proxy(result.ptr())->flags &= ~detail::npy_api::NPY_ARRAY_WRITEABLE_;\n        }\n\n        return result.release();\n    }\n\n#if EIGEN_VERSION_AT_LEAST(3, 4, 0)\n\n    static constexpr bool needs_writeable = !std::is_const<typename std::remove_pointer<\n        typename get_storage_pointer_type<MapType>::SPT>::type>::value;\n#else\n    // Handle Eigen bug\n    static constexpr bool needs_writeable = !std::is_const<Type>::value;\n#endif\n\nprotected:\n    // TODO: Move to std::optional once std::optional has more support\n    std::unique_ptr<MapType> value;\n\npublic:\n    static constexpr auto name = get_tensor_descriptor<Type, true, needs_writeable>::value;\n    explicit operator MapType *() { return value.get(); }\n    explicit operator MapType &() { return *value; }\n    explicit operator MapType &&() && { return std::move(*value); }\n\n    template <typename T_>\n    using cast_op_type = ::pybind11::detail::movable_cast_op_type<T_>;\n};\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/eigen.h",
    "content": "/*\n    pybind11/eigen.h: Transparent conversion for dense and sparse Eigen matrices\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"eigen/matrix.h\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/embed.h",
    "content": "/*\n    pybind11/embed.h: Support for embedding the interpreter\n\n    Copyright (c) 2017 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"pybind11.h\"\n#include \"eval.h\"\n\n#include <memory>\n#include <vector>\n\n#if defined(PYPY_VERSION)\n#    error Embedding the interpreter is not supported with PyPy\n#endif\n\n#define PYBIND11_EMBEDDED_MODULE_IMPL(name)                                                       \\\n    extern \"C\" PyObject *pybind11_init_impl_##name();                                             \\\n    extern \"C\" PyObject *pybind11_init_impl_##name() { return pybind11_init_wrapper_##name(); }\n\n/** \\rst\n    Add a new module to the table of builtins for the interpreter. Must be\n    defined in global scope. The first macro parameter is the name of the\n    module (without quotes). The second parameter is the variable which will\n    be used as the interface to add functions and classes to the module.\n\n    .. code-block:: cpp\n\n        PYBIND11_EMBEDDED_MODULE(example, m) {\n            // ... initialize functions and classes here\n            m.def(\"foo\", []() {\n                return \"Hello, World!\";\n            });\n        }\n \\endrst */\n#define PYBIND11_EMBEDDED_MODULE(name, variable)                                                  \\\n    static ::pybind11::module_::module_def PYBIND11_CONCAT(pybind11_module_def_, name);           \\\n    static void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_ &);                     \\\n    static PyObject PYBIND11_CONCAT(*pybind11_init_wrapper_, name)() {                            \\\n        auto m = ::pybind11::module_::create_extension_module(                                    \\\n            PYBIND11_TOSTRING(name), nullptr, &PYBIND11_CONCAT(pybind11_module_def_, name));      \\\n        try {                                                                                     \\\n            PYBIND11_CONCAT(pybind11_init_, name)(m);                                             \\\n            return m.ptr();                                                                       \\\n        }                                                                                         \\\n        PYBIND11_CATCH_INIT_EXCEPTIONS                                                            \\\n    }                                                                                             \\\n    PYBIND11_EMBEDDED_MODULE_IMPL(name)                                                           \\\n    ::pybind11::detail::embedded_module PYBIND11_CONCAT(pybind11_module_, name)(                  \\\n        PYBIND11_TOSTRING(name), PYBIND11_CONCAT(pybind11_init_impl_, name));                     \\\n    void PYBIND11_CONCAT(pybind11_init_, name)(::pybind11::module_                                \\\n                                               & variable) // NOLINT(bugprone-macro-parentheses)\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n/// Python 2.7/3.x compatible version of `PyImport_AppendInittab` and error checks.\nstruct embedded_module {\n    using init_t = PyObject *(*) ();\n    embedded_module(const char *name, init_t init) {\n        if (Py_IsInitialized() != 0) {\n            pybind11_fail(\"Can't add new modules after the interpreter has been initialized\");\n        }\n\n        auto result = PyImport_AppendInittab(name, init);\n        if (result == -1) {\n            pybind11_fail(\"Insufficient memory to add a new module\");\n        }\n    }\n};\n\nstruct wide_char_arg_deleter {\n    void operator()(wchar_t *ptr) const {\n        // API docs: https://docs.python.org/3/c-api/sys.html#c.Py_DecodeLocale\n        PyMem_RawFree(ptr);\n    }\n};\n\ninline wchar_t *widen_chars(const char *safe_arg) {\n    wchar_t *widened_arg = Py_DecodeLocale(safe_arg, nullptr);\n    return widened_arg;\n}\n\ninline void precheck_interpreter() {\n    if (Py_IsInitialized() != 0) {\n        pybind11_fail(\"The interpreter is already running\");\n    }\n}\n\n#if !defined(PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX)\n#    define PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX (0x03080000)\n#endif\n\n#if PY_VERSION_HEX < PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX\ninline void initialize_interpreter_pre_pyconfig(bool init_signal_handlers,\n                                                int argc,\n                                                const char *const *argv,\n                                                bool add_program_dir_to_path) {\n    detail::precheck_interpreter();\n    Py_InitializeEx(init_signal_handlers ? 1 : 0);\n#    if defined(WITH_THREAD) && PY_VERSION_HEX < 0x03070000\n    PyEval_InitThreads();\n#    endif\n\n    // Before it was special-cased in python 3.8, passing an empty or null argv\n    // caused a segfault, so we have to reimplement the special case ourselves.\n    bool special_case = (argv == nullptr || argc <= 0);\n\n    const char *const empty_argv[]{\"\\0\"};\n    const char *const *safe_argv = special_case ? empty_argv : argv;\n    if (special_case) {\n        argc = 1;\n    }\n\n    auto argv_size = static_cast<size_t>(argc);\n    // SetArgv* on python 3 takes wchar_t, so we have to convert.\n    std::unique_ptr<wchar_t *[]> widened_argv(new wchar_t *[argv_size]);\n    std::vector<std::unique_ptr<wchar_t[], detail::wide_char_arg_deleter>> widened_argv_entries;\n    widened_argv_entries.reserve(argv_size);\n    for (size_t ii = 0; ii < argv_size; ++ii) {\n        widened_argv_entries.emplace_back(detail::widen_chars(safe_argv[ii]));\n        if (!widened_argv_entries.back()) {\n            // A null here indicates a character-encoding failure or the python\n            // interpreter out of memory. Give up.\n            return;\n        }\n        widened_argv[ii] = widened_argv_entries.back().get();\n    }\n\n    auto *pysys_argv = widened_argv.get();\n\n    PySys_SetArgvEx(argc, pysys_argv, static_cast<int>(add_program_dir_to_path));\n}\n#endif\n\nPYBIND11_NAMESPACE_END(detail)\n\n#if PY_VERSION_HEX >= PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX\ninline void initialize_interpreter(PyConfig *config,\n                                   int argc = 0,\n                                   const char *const *argv = nullptr,\n                                   bool add_program_dir_to_path = true) {\n    detail::precheck_interpreter();\n    PyStatus status = PyConfig_SetBytesArgv(config, argc, const_cast<char *const *>(argv));\n    if (PyStatus_Exception(status) != 0) {\n        // A failure here indicates a character-encoding failure or the python\n        // interpreter out of memory. Give up.\n        PyConfig_Clear(config);\n        throw std::runtime_error(PyStatus_IsError(status) != 0 ? status.err_msg\n                                                               : \"Failed to prepare CPython\");\n    }\n    status = Py_InitializeFromConfig(config);\n    if (PyStatus_Exception(status) != 0) {\n        PyConfig_Clear(config);\n        throw std::runtime_error(PyStatus_IsError(status) != 0 ? status.err_msg\n                                                               : \"Failed to init CPython\");\n    }\n    if (add_program_dir_to_path) {\n        PyRun_SimpleString(\"import sys, os.path; \"\n                           \"sys.path.insert(0, \"\n                           \"os.path.abspath(os.path.dirname(sys.argv[0])) \"\n                           \"if sys.argv and os.path.exists(sys.argv[0]) else '')\");\n    }\n    PyConfig_Clear(config);\n}\n#endif\n\n/** \\rst\n    Initialize the Python interpreter. No other pybind11 or CPython API functions can be\n    called before this is done; with the exception of `PYBIND11_EMBEDDED_MODULE`. The\n    optional `init_signal_handlers` parameter can be used to skip the registration of\n    signal handlers (see the `Python documentation`_ for details). Calling this function\n    again after the interpreter has already been initialized is a fatal error.\n\n    If initializing the Python interpreter fails, then the program is terminated.  (This\n    is controlled by the CPython runtime and is an exception to pybind11's normal behavior\n    of throwing exceptions on errors.)\n\n    The remaining optional parameters, `argc`, `argv`, and `add_program_dir_to_path` are\n    used to populate ``sys.argv`` and ``sys.path``.\n    See the |PySys_SetArgvEx documentation|_ for details.\n\n    .. _Python documentation: https://docs.python.org/3/c-api/init.html#c.Py_InitializeEx\n    .. |PySys_SetArgvEx documentation| replace:: ``PySys_SetArgvEx`` documentation\n    .. _PySys_SetArgvEx documentation: https://docs.python.org/3/c-api/init.html#c.PySys_SetArgvEx\n \\endrst */\ninline void initialize_interpreter(bool init_signal_handlers = true,\n                                   int argc = 0,\n                                   const char *const *argv = nullptr,\n                                   bool add_program_dir_to_path = true) {\n#if PY_VERSION_HEX < PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX\n    detail::initialize_interpreter_pre_pyconfig(\n        init_signal_handlers, argc, argv, add_program_dir_to_path);\n#else\n    PyConfig config;\n    PyConfig_InitIsolatedConfig(&config);\n    config.isolated = 0;\n    config.use_environment = 1;\n    config.install_signal_handlers = init_signal_handlers ? 1 : 0;\n    initialize_interpreter(&config, argc, argv, add_program_dir_to_path);\n#endif\n}\n\n/** \\rst\n    Shut down the Python interpreter. No pybind11 or CPython API functions can be called\n    after this. In addition, pybind11 objects must not outlive the interpreter:\n\n    .. code-block:: cpp\n\n        { // BAD\n            py::initialize_interpreter();\n            auto hello = py::str(\"Hello, World!\");\n            py::finalize_interpreter();\n        } // <-- BOOM, hello's destructor is called after interpreter shutdown\n\n        { // GOOD\n            py::initialize_interpreter();\n            { // scoped\n                auto hello = py::str(\"Hello, World!\");\n            } // <-- OK, hello is cleaned up properly\n            py::finalize_interpreter();\n        }\n\n        { // BETTER\n            py::scoped_interpreter guard{};\n            auto hello = py::str(\"Hello, World!\");\n        }\n\n    .. warning::\n\n        The interpreter can be restarted by calling `initialize_interpreter` again.\n        Modules created using pybind11 can be safely re-initialized. However, Python\n        itself cannot completely unload binary extension modules and there are several\n        caveats with regard to interpreter restarting. All the details can be found\n        in the CPython documentation. In short, not all interpreter memory may be\n        freed, either due to reference cycles or user-created global data.\n\n \\endrst */\ninline void finalize_interpreter() {\n    handle builtins(PyEval_GetBuiltins());\n    const char *id = PYBIND11_INTERNALS_ID;\n\n    // Get the internals pointer (without creating it if it doesn't exist).  It's possible for the\n    // internals to be created during Py_Finalize() (e.g. if a py::capsule calls `get_internals()`\n    // during destruction), so we get the pointer-pointer here and check it after Py_Finalize().\n    detail::internals **internals_ptr_ptr = detail::get_internals_pp();\n    // It could also be stashed in builtins, so look there too:\n    if (builtins.contains(id) && isinstance<capsule>(builtins[id])) {\n        internals_ptr_ptr = capsule(builtins[id]);\n    }\n    // Local internals contains data managed by the current interpreter, so we must clear them to\n    // avoid undefined behaviors when initializing another interpreter\n    detail::get_local_internals().registered_types_cpp.clear();\n    detail::get_local_internals().registered_exception_translators.clear();\n\n    Py_Finalize();\n\n    if (internals_ptr_ptr) {\n        delete *internals_ptr_ptr;\n        *internals_ptr_ptr = nullptr;\n    }\n}\n\n/** \\rst\n    Scope guard version of `initialize_interpreter` and `finalize_interpreter`.\n    This a move-only guard and only a single instance can exist.\n\n    See `initialize_interpreter` for a discussion of its constructor arguments.\n\n    .. code-block:: cpp\n\n        #include <pybind11/embed.h>\n\n        int main() {\n            py::scoped_interpreter guard{};\n            py::print(Hello, World!);\n        } // <-- interpreter shutdown\n \\endrst */\nclass scoped_interpreter {\npublic:\n    explicit scoped_interpreter(bool init_signal_handlers = true,\n                                int argc = 0,\n                                const char *const *argv = nullptr,\n                                bool add_program_dir_to_path = true) {\n        initialize_interpreter(init_signal_handlers, argc, argv, add_program_dir_to_path);\n    }\n\n#if PY_VERSION_HEX >= PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX\n    explicit scoped_interpreter(PyConfig *config,\n                                int argc = 0,\n                                const char *const *argv = nullptr,\n                                bool add_program_dir_to_path = true) {\n        initialize_interpreter(config, argc, argv, add_program_dir_to_path);\n    }\n#endif\n\n    scoped_interpreter(const scoped_interpreter &) = delete;\n    scoped_interpreter(scoped_interpreter &&other) noexcept { other.is_valid = false; }\n    scoped_interpreter &operator=(const scoped_interpreter &) = delete;\n    scoped_interpreter &operator=(scoped_interpreter &&) = delete;\n\n    ~scoped_interpreter() {\n        if (is_valid) {\n            finalize_interpreter();\n        }\n    }\n\nprivate:\n    bool is_valid = true;\n};\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/eval.h",
    "content": "/*\n    pybind11/eval.h: Support for evaluating Python expressions and statements\n    from strings and files\n\n    Copyright (c) 2016 Klemens Morgenstern <klemens.morgenstern@ed-chemnitz.de> and\n                       Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"pybind11.h\"\n\n#include <utility>\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ninline void ensure_builtins_in_globals(object &global) {\n#if defined(PYPY_VERSION) || PY_VERSION_HEX < 0x03080000\n    // Running exec and eval adds `builtins` module under `__builtins__` key to\n    // globals if not yet present.  Python 3.8 made PyRun_String behave\n    // similarly. Let's also do that for older versions, for consistency. This\n    // was missing from PyPy3.8 7.3.7.\n    if (!global.contains(\"__builtins__\"))\n        global[\"__builtins__\"] = module_::import(PYBIND11_BUILTINS_MODULE);\n#else\n    (void) global;\n#endif\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\nenum eval_mode {\n    /// Evaluate a string containing an isolated expression\n    eval_expr,\n\n    /// Evaluate a string containing a single statement. Returns \\c none\n    eval_single_statement,\n\n    /// Evaluate a string containing a sequence of statement. Returns \\c none\n    eval_statements\n};\n\ntemplate <eval_mode mode = eval_expr>\nobject eval(const str &expr, object global = globals(), object local = object()) {\n    if (!local) {\n        local = global;\n    }\n\n    detail::ensure_builtins_in_globals(global);\n\n    /* PyRun_String does not accept a PyObject / encoding specifier,\n       this seems to be the only alternative */\n    std::string buffer = \"# -*- coding: utf-8 -*-\\n\" + (std::string) expr;\n\n    int start = 0;\n    switch (mode) {\n        case eval_expr:\n            start = Py_eval_input;\n            break;\n        case eval_single_statement:\n            start = Py_single_input;\n            break;\n        case eval_statements:\n            start = Py_file_input;\n            break;\n        default:\n            pybind11_fail(\"invalid evaluation mode\");\n    }\n\n    PyObject *result = PyRun_String(buffer.c_str(), start, global.ptr(), local.ptr());\n    if (!result) {\n        throw error_already_set();\n    }\n    return reinterpret_steal<object>(result);\n}\n\ntemplate <eval_mode mode = eval_expr, size_t N>\nobject eval(const char (&s)[N], object global = globals(), object local = object()) {\n    /* Support raw string literals by removing common leading whitespace */\n    auto expr = (s[0] == '\\n') ? str(module_::import(\"textwrap\").attr(\"dedent\")(s)) : str(s);\n    return eval<mode>(expr, std::move(global), std::move(local));\n}\n\ninline void exec(const str &expr, object global = globals(), object local = object()) {\n    eval<eval_statements>(expr, std::move(global), std::move(local));\n}\n\ntemplate <size_t N>\nvoid exec(const char (&s)[N], object global = globals(), object local = object()) {\n    eval<eval_statements>(s, std::move(global), std::move(local));\n}\n\n#if defined(PYPY_VERSION)\ntemplate <eval_mode mode = eval_statements>\nobject eval_file(str, object, object) {\n    pybind11_fail(\"eval_file not supported in PyPy3. Use eval\");\n}\ntemplate <eval_mode mode = eval_statements>\nobject eval_file(str, object) {\n    pybind11_fail(\"eval_file not supported in PyPy3. Use eval\");\n}\ntemplate <eval_mode mode = eval_statements>\nobject eval_file(str) {\n    pybind11_fail(\"eval_file not supported in PyPy3. Use eval\");\n}\n#else\ntemplate <eval_mode mode = eval_statements>\nobject eval_file(str fname, object global = globals(), object local = object()) {\n    if (!local) {\n        local = global;\n    }\n\n    detail::ensure_builtins_in_globals(global);\n\n    int start = 0;\n    switch (mode) {\n        case eval_expr:\n            start = Py_eval_input;\n            break;\n        case eval_single_statement:\n            start = Py_single_input;\n            break;\n        case eval_statements:\n            start = Py_file_input;\n            break;\n        default:\n            pybind11_fail(\"invalid evaluation mode\");\n    }\n\n    int closeFile = 1;\n    std::string fname_str = (std::string) fname;\n    FILE *f = _Py_fopen_obj(fname.ptr(), \"r\");\n    if (!f) {\n        PyErr_Clear();\n        pybind11_fail(\"File \\\"\" + fname_str + \"\\\" could not be opened!\");\n    }\n\n    if (!global.contains(\"__file__\")) {\n        global[\"__file__\"] = std::move(fname);\n    }\n\n    PyObject *result\n        = PyRun_FileEx(f, fname_str.c_str(), start, global.ptr(), local.ptr(), closeFile);\n\n    if (!result) {\n        throw error_already_set();\n    }\n    return reinterpret_steal<object>(result);\n}\n#endif\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/functional.h",
    "content": "/*\n    pybind11/functional.h: std::function<> support\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"pybind11.h\"\n\n#include <functional>\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ntemplate <typename Return, typename... Args>\nstruct type_caster<std::function<Return(Args...)>> {\n    using type = std::function<Return(Args...)>;\n    using retval_type = conditional_t<std::is_same<Return, void>::value, void_type, Return>;\n    using function_type = Return (*)(Args...);\n\npublic:\n    bool load(handle src, bool convert) {\n        if (src.is_none()) {\n            // Defer accepting None to other overloads (if we aren't in convert mode):\n            if (!convert) {\n                return false;\n            }\n            return true;\n        }\n\n        if (!isinstance<function>(src)) {\n            return false;\n        }\n\n        auto func = reinterpret_borrow<function>(src);\n\n        /*\n           When passing a C++ function as an argument to another C++\n           function via Python, every function call would normally involve\n           a full C++ -> Python -> C++ roundtrip, which can be prohibitive.\n           Here, we try to at least detect the case where the function is\n           stateless (i.e. function pointer or lambda function without\n           captured variables), in which case the roundtrip can be avoided.\n         */\n        if (auto cfunc = func.cpp_function()) {\n            auto *cfunc_self = PyCFunction_GET_SELF(cfunc.ptr());\n            if (cfunc_self == nullptr) {\n                PyErr_Clear();\n            } else if (isinstance<capsule>(cfunc_self)) {\n                auto c = reinterpret_borrow<capsule>(cfunc_self);\n\n                function_record *rec = nullptr;\n                // Check that we can safely reinterpret the capsule into a function_record\n                if (detail::is_function_record_capsule(c)) {\n                    rec = c.get_pointer<function_record>();\n                }\n\n                while (rec != nullptr) {\n                    if (rec->is_stateless\n                        && same_type(typeid(function_type),\n                                     *reinterpret_cast<const std::type_info *>(rec->data[1]))) {\n                        struct capture {\n                            function_type f;\n                        };\n                        value = ((capture *) &rec->data)->f;\n                        return true;\n                    }\n                    rec = rec->next;\n                }\n            }\n            // PYPY segfaults here when passing builtin function like sum.\n            // Raising an fail exception here works to prevent the segfault, but only on gcc.\n            // See PR #1413 for full details\n        }\n\n        // ensure GIL is held during functor destruction\n        struct func_handle {\n            function f;\n#if !(defined(_MSC_VER) && _MSC_VER == 1916 && defined(PYBIND11_CPP17))\n            // This triggers a syntax error under very special conditions (very weird indeed).\n            explicit\n#endif\n                func_handle(function &&f_) noexcept\n                : f(std::move(f_)) {\n            }\n            func_handle(const func_handle &f_) { operator=(f_); }\n            func_handle &operator=(const func_handle &f_) {\n                gil_scoped_acquire acq;\n                f = f_.f;\n                return *this;\n            }\n            ~func_handle() {\n                gil_scoped_acquire acq;\n                function kill_f(std::move(f));\n            }\n        };\n\n        // to emulate 'move initialization capture' in C++11\n        struct func_wrapper {\n            func_handle hfunc;\n            explicit func_wrapper(func_handle &&hf) noexcept : hfunc(std::move(hf)) {}\n            Return operator()(Args... args) const {\n                gil_scoped_acquire acq;\n                // casts the returned object as a rvalue to the return type\n                return hfunc.f(std::forward<Args>(args)...).template cast<Return>();\n            }\n        };\n\n        value = func_wrapper(func_handle(std::move(func)));\n        return true;\n    }\n\n    template <typename Func>\n    static handle cast(Func &&f_, return_value_policy policy, handle /* parent */) {\n        if (!f_) {\n            return none().release();\n        }\n\n        auto result = f_.template target<function_type>();\n        if (result) {\n            return cpp_function(*result, policy).release();\n        }\n        return cpp_function(std::forward<Func>(f_), policy).release();\n    }\n\n    PYBIND11_TYPE_CASTER(type,\n                         const_name(\"Callable[[\") + concat(make_caster<Args>::name...)\n                             + const_name(\"], \") + make_caster<retval_type>::name\n                             + const_name(\"]\"));\n};\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/gil.h",
    "content": "/*\n    pybind11/gil.h: RAII helpers for managing the GIL\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"detail/common.h\"\n\n#if defined(WITH_THREAD) && !defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)\n#    include \"detail/internals.h\"\n#endif\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n// forward declarations\nPyThreadState *get_thread_state_unchecked();\n\nPYBIND11_NAMESPACE_END(detail)\n\n#if defined(WITH_THREAD)\n\n#    if !defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)\n\n/* The functions below essentially reproduce the PyGILState_* API using a RAII\n * pattern, but there are a few important differences:\n *\n * 1. When acquiring the GIL from an non-main thread during the finalization\n *    phase, the GILState API blindly terminates the calling thread, which\n *    is often not what is wanted. This API does not do this.\n *\n * 2. The gil_scoped_release function can optionally cut the relationship\n *    of a PyThreadState and its associated thread, which allows moving it to\n *    another thread (this is a fairly rare/advanced use case).\n *\n * 3. The reference count of an acquired thread state can be controlled. This\n *    can be handy to prevent cases where callbacks issued from an external\n *    thread would otherwise constantly construct and destroy thread state data\n *    structures.\n *\n * See the Python bindings of NanoGUI (http://github.com/wjakob/nanogui) for an\n * example which uses features 2 and 3 to migrate the Python thread of\n * execution to another thread (to run the event loop on the original thread,\n * in this case).\n */\n\nclass gil_scoped_acquire {\npublic:\n    PYBIND11_NOINLINE gil_scoped_acquire() {\n        auto &internals = detail::get_internals();\n        tstate = (PyThreadState *) PYBIND11_TLS_GET_VALUE(internals.tstate);\n\n        if (!tstate) {\n            /* Check if the GIL was acquired using the PyGILState_* API instead (e.g. if\n               calling from a Python thread). Since we use a different key, this ensures\n               we don't create a new thread state and deadlock in PyEval_AcquireThread\n               below. Note we don't save this state with internals.tstate, since we don't\n               create it we would fail to clear it (its reference count should be > 0). */\n            tstate = PyGILState_GetThisThreadState();\n        }\n\n        if (!tstate) {\n            tstate = PyThreadState_New(internals.istate);\n#        if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n            if (!tstate) {\n                pybind11_fail(\"scoped_acquire: could not create thread state!\");\n            }\n#        endif\n            tstate->gilstate_counter = 0;\n            PYBIND11_TLS_REPLACE_VALUE(internals.tstate, tstate);\n        } else {\n            release = detail::get_thread_state_unchecked() != tstate;\n        }\n\n        if (release) {\n            PyEval_AcquireThread(tstate);\n        }\n\n        inc_ref();\n    }\n\n    gil_scoped_acquire(const gil_scoped_acquire &) = delete;\n    gil_scoped_acquire &operator=(const gil_scoped_acquire &) = delete;\n\n    void inc_ref() { ++tstate->gilstate_counter; }\n\n    PYBIND11_NOINLINE void dec_ref() {\n        --tstate->gilstate_counter;\n#        if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n        if (detail::get_thread_state_unchecked() != tstate) {\n            pybind11_fail(\"scoped_acquire::dec_ref(): thread state must be current!\");\n        }\n        if (tstate->gilstate_counter < 0) {\n            pybind11_fail(\"scoped_acquire::dec_ref(): reference count underflow!\");\n        }\n#        endif\n        if (tstate->gilstate_counter == 0) {\n#        if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n            if (!release) {\n                pybind11_fail(\"scoped_acquire::dec_ref(): internal error!\");\n            }\n#        endif\n            PyThreadState_Clear(tstate);\n            if (active) {\n                PyThreadState_DeleteCurrent();\n            }\n            PYBIND11_TLS_DELETE_VALUE(detail::get_internals().tstate);\n            release = false;\n        }\n    }\n\n    /// This method will disable the PyThreadState_DeleteCurrent call and the\n    /// GIL won't be acquired. This method should be used if the interpreter\n    /// could be shutting down when this is called, as thread deletion is not\n    /// allowed during shutdown. Check _Py_IsFinalizing() on Python 3.7+, and\n    /// protect subsequent code.\n    PYBIND11_NOINLINE void disarm() { active = false; }\n\n    PYBIND11_NOINLINE ~gil_scoped_acquire() {\n        dec_ref();\n        if (release) {\n            PyEval_SaveThread();\n        }\n    }\n\nprivate:\n    PyThreadState *tstate = nullptr;\n    bool release = true;\n    bool active = true;\n};\n\nclass gil_scoped_release {\npublic:\n    explicit gil_scoped_release(bool disassoc = false) : disassoc(disassoc) {\n        // `get_internals()` must be called here unconditionally in order to initialize\n        // `internals.tstate` for subsequent `gil_scoped_acquire` calls. Otherwise, an\n        // initialization race could occur as multiple threads try `gil_scoped_acquire`.\n        auto &internals = detail::get_internals();\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        tstate = PyEval_SaveThread();\n        if (disassoc) {\n            // Python >= 3.7 can remove this, it's an int before 3.7\n            // NOLINTNEXTLINE(readability-qualified-auto)\n            auto key = internals.tstate;\n            PYBIND11_TLS_DELETE_VALUE(key);\n        }\n    }\n\n    gil_scoped_release(const gil_scoped_release &) = delete;\n    gil_scoped_release &operator=(const gil_scoped_release &) = delete;\n\n    /// This method will disable the PyThreadState_DeleteCurrent call and the\n    /// GIL won't be acquired. This method should be used if the interpreter\n    /// could be shutting down when this is called, as thread deletion is not\n    /// allowed during shutdown. Check _Py_IsFinalizing() on Python 3.7+, and\n    /// protect subsequent code.\n    PYBIND11_NOINLINE void disarm() { active = false; }\n\n    ~gil_scoped_release() {\n        if (!tstate) {\n            return;\n        }\n        // `PyEval_RestoreThread()` should not be called if runtime is finalizing\n        if (active) {\n            PyEval_RestoreThread(tstate);\n        }\n        if (disassoc) {\n            // Python >= 3.7 can remove this, it's an int before 3.7\n            // NOLINTNEXTLINE(readability-qualified-auto)\n            auto key = detail::get_internals().tstate;\n            PYBIND11_TLS_REPLACE_VALUE(key, tstate);\n        }\n    }\n\nprivate:\n    PyThreadState *tstate;\n    bool disassoc;\n    bool active = true;\n};\n\n#    else // PYBIND11_SIMPLE_GIL_MANAGEMENT\n\nclass gil_scoped_acquire {\n    PyGILState_STATE state;\n\npublic:\n    gil_scoped_acquire() : state{PyGILState_Ensure()} {}\n    gil_scoped_acquire(const gil_scoped_acquire &) = delete;\n    gil_scoped_acquire &operator=(const gil_scoped_acquire &) = delete;\n    ~gil_scoped_acquire() { PyGILState_Release(state); }\n    void disarm() {}\n};\n\nclass gil_scoped_release {\n    PyThreadState *state;\n\npublic:\n    gil_scoped_release() : state{PyEval_SaveThread()} {}\n    gil_scoped_release(const gil_scoped_release &) = delete;\n    gil_scoped_release &operator=(const gil_scoped_release &) = delete;\n    ~gil_scoped_release() { PyEval_RestoreThread(state); }\n    void disarm() {}\n};\n\n#    endif // PYBIND11_SIMPLE_GIL_MANAGEMENT\n\n#else // WITH_THREAD\n\nclass gil_scoped_acquire {\npublic:\n    gil_scoped_acquire() {\n        // Trick to suppress `unused variable` error messages (at call sites).\n        (void) (this != (this + 1));\n    }\n    gil_scoped_acquire(const gil_scoped_acquire &) = delete;\n    gil_scoped_acquire &operator=(const gil_scoped_acquire &) = delete;\n    void disarm() {}\n};\n\nclass gil_scoped_release {\npublic:\n    gil_scoped_release() {\n        // Trick to suppress `unused variable` error messages (at call sites).\n        (void) (this != (this + 1));\n    }\n    gil_scoped_release(const gil_scoped_release &) = delete;\n    gil_scoped_release &operator=(const gil_scoped_release &) = delete;\n    void disarm() {}\n};\n\n#endif // WITH_THREAD\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/iostream.h",
    "content": "/*\n    pybind11/iostream.h -- Tools to assist with redirecting cout and cerr to Python\n\n    Copyright (c) 2017 Henry F. Schreiner\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n\n    WARNING: The implementation in this file is NOT thread safe. Multiple\n    threads writing to a redirected ostream concurrently cause data races\n    and potentially buffer overflows. Therefore it is currently a requirement\n    that all (possibly) concurrent redirected ostream writes are protected by\n    a mutex.\n    #HelpAppreciated: Work on iostream.h thread safety.\n    For more background see the discussions under\n    https://github.com/pybind/pybind11/pull/2982 and\n    https://github.com/pybind/pybind11/pull/2995.\n*/\n\n#pragma once\n\n#include \"pybind11.h\"\n\n#include <algorithm>\n#include <cstring>\n#include <iostream>\n#include <iterator>\n#include <memory>\n#include <ostream>\n#include <streambuf>\n#include <string>\n#include <utility>\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n// Buffer that writes to Python instead of C++\nclass pythonbuf : public std::streambuf {\nprivate:\n    using traits_type = std::streambuf::traits_type;\n\n    const size_t buf_size;\n    std::unique_ptr<char[]> d_buffer;\n    object pywrite;\n    object pyflush;\n\n    int overflow(int c) override {\n        if (!traits_type::eq_int_type(c, traits_type::eof())) {\n            *pptr() = traits_type::to_char_type(c);\n            pbump(1);\n        }\n        return sync() == 0 ? traits_type::not_eof(c) : traits_type::eof();\n    }\n\n    // Computes how many bytes at the end of the buffer are part of an\n    // incomplete sequence of UTF-8 bytes.\n    // Precondition: pbase() < pptr()\n    size_t utf8_remainder() const {\n        const auto rbase = std::reverse_iterator<char *>(pbase());\n        const auto rpptr = std::reverse_iterator<char *>(pptr());\n        auto is_ascii = [](char c) { return (static_cast<unsigned char>(c) & 0x80) == 0x00; };\n        auto is_leading = [](char c) { return (static_cast<unsigned char>(c) & 0xC0) == 0xC0; };\n        auto is_leading_2b = [](char c) { return static_cast<unsigned char>(c) <= 0xDF; };\n        auto is_leading_3b = [](char c) { return static_cast<unsigned char>(c) <= 0xEF; };\n        // If the last character is ASCII, there are no incomplete code points\n        if (is_ascii(*rpptr)) {\n            return 0;\n        }\n        // Otherwise, work back from the end of the buffer and find the first\n        // UTF-8 leading byte\n        const auto rpend = rbase - rpptr >= 3 ? rpptr + 3 : rbase;\n        const auto leading = std::find_if(rpptr, rpend, is_leading);\n        if (leading == rbase) {\n            return 0;\n        }\n        const auto dist = static_cast<size_t>(leading - rpptr);\n        size_t remainder = 0;\n\n        if (dist == 0) {\n            remainder = 1; // 1-byte code point is impossible\n        } else if (dist == 1) {\n            remainder = is_leading_2b(*leading) ? 0 : dist + 1;\n        } else if (dist == 2) {\n            remainder = is_leading_3b(*leading) ? 0 : dist + 1;\n        }\n        // else if (dist >= 3), at least 4 bytes before encountering an UTF-8\n        // leading byte, either no remainder or invalid UTF-8.\n        // Invalid UTF-8 will cause an exception later when converting\n        // to a Python string, so that's not handled here.\n        return remainder;\n    }\n\n    // This function must be non-virtual to be called in a destructor.\n    int _sync() {\n        if (pbase() != pptr()) { // If buffer is not empty\n            gil_scoped_acquire tmp;\n            // This subtraction cannot be negative, so dropping the sign.\n            auto size = static_cast<size_t>(pptr() - pbase());\n            size_t remainder = utf8_remainder();\n\n            if (size > remainder) {\n                str line(pbase(), size - remainder);\n                pywrite(std::move(line));\n                pyflush();\n            }\n\n            // Copy the remainder at the end of the buffer to the beginning:\n            if (remainder > 0) {\n                std::memmove(pbase(), pptr() - remainder, remainder);\n            }\n            setp(pbase(), epptr());\n            pbump(static_cast<int>(remainder));\n        }\n        return 0;\n    }\n\n    int sync() override { return _sync(); }\n\npublic:\n    explicit pythonbuf(const object &pyostream, size_t buffer_size = 1024)\n        : buf_size(buffer_size), d_buffer(new char[buf_size]), pywrite(pyostream.attr(\"write\")),\n          pyflush(pyostream.attr(\"flush\")) {\n        setp(d_buffer.get(), d_buffer.get() + buf_size - 1);\n    }\n\n    pythonbuf(pythonbuf &&) = default;\n\n    /// Sync before destroy\n    ~pythonbuf() override { _sync(); }\n};\n\nPYBIND11_NAMESPACE_END(detail)\n\n/** \\rst\n    This a move-only guard that redirects output.\n\n    .. code-block:: cpp\n\n        #include <pybind11/iostream.h>\n\n        ...\n\n        {\n            py::scoped_ostream_redirect output;\n            std::cout << \"Hello, World!\"; // Python stdout\n        } // <-- return std::cout to normal\n\n    You can explicitly pass the c++ stream and the python object,\n    for example to guard stderr instead.\n\n    .. code-block:: cpp\n\n        {\n            py::scoped_ostream_redirect output{\n                std::cerr, py::module::import(\"sys\").attr(\"stderr\")};\n            std::cout << \"Hello, World!\";\n        }\n \\endrst */\nclass scoped_ostream_redirect {\nprotected:\n    std::streambuf *old;\n    std::ostream &costream;\n    detail::pythonbuf buffer;\n\npublic:\n    explicit scoped_ostream_redirect(std::ostream &costream = std::cout,\n                                     const object &pyostream\n                                     = module_::import(\"sys\").attr(\"stdout\"))\n        : costream(costream), buffer(pyostream) {\n        old = costream.rdbuf(&buffer);\n    }\n\n    ~scoped_ostream_redirect() { costream.rdbuf(old); }\n\n    scoped_ostream_redirect(const scoped_ostream_redirect &) = delete;\n    scoped_ostream_redirect(scoped_ostream_redirect &&other) = default;\n    scoped_ostream_redirect &operator=(const scoped_ostream_redirect &) = delete;\n    scoped_ostream_redirect &operator=(scoped_ostream_redirect &&) = delete;\n};\n\n/** \\rst\n    Like `scoped_ostream_redirect`, but redirects cerr by default. This class\n    is provided primary to make ``py::call_guard`` easier to make.\n\n    .. code-block:: cpp\n\n     m.def(\"noisy_func\", &noisy_func,\n           py::call_guard<scoped_ostream_redirect,\n                          scoped_estream_redirect>());\n\n\\endrst */\nclass scoped_estream_redirect : public scoped_ostream_redirect {\npublic:\n    explicit scoped_estream_redirect(std::ostream &costream = std::cerr,\n                                     const object &pyostream\n                                     = module_::import(\"sys\").attr(\"stderr\"))\n        : scoped_ostream_redirect(costream, pyostream) {}\n};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n// Class to redirect output as a context manager. C++ backend.\nclass OstreamRedirect {\n    bool do_stdout_;\n    bool do_stderr_;\n    std::unique_ptr<scoped_ostream_redirect> redirect_stdout;\n    std::unique_ptr<scoped_estream_redirect> redirect_stderr;\n\npublic:\n    explicit OstreamRedirect(bool do_stdout = true, bool do_stderr = true)\n        : do_stdout_(do_stdout), do_stderr_(do_stderr) {}\n\n    void enter() {\n        if (do_stdout_) {\n            redirect_stdout.reset(new scoped_ostream_redirect());\n        }\n        if (do_stderr_) {\n            redirect_stderr.reset(new scoped_estream_redirect());\n        }\n    }\n\n    void exit() {\n        redirect_stdout.reset();\n        redirect_stderr.reset();\n    }\n};\n\nPYBIND11_NAMESPACE_END(detail)\n\n/** \\rst\n    This is a helper function to add a C++ redirect context manager to Python\n    instead of using a C++ guard. To use it, add the following to your binding code:\n\n    .. code-block:: cpp\n\n        #include <pybind11/iostream.h>\n\n        ...\n\n        py::add_ostream_redirect(m, \"ostream_redirect\");\n\n    You now have a Python context manager that redirects your output:\n\n    .. code-block:: python\n\n        with m.ostream_redirect():\n            m.print_to_cout_function()\n\n    This manager can optionally be told which streams to operate on:\n\n    .. code-block:: python\n\n        with m.ostream_redirect(stdout=true, stderr=true):\n            m.noisy_function_with_error_printing()\n\n \\endrst */\ninline class_<detail::OstreamRedirect>\nadd_ostream_redirect(module_ m, const std::string &name = \"ostream_redirect\") {\n    return class_<detail::OstreamRedirect>(std::move(m), name.c_str(), module_local())\n        .def(init<bool, bool>(), arg(\"stdout\") = true, arg(\"stderr\") = true)\n        .def(\"__enter__\", &detail::OstreamRedirect::enter)\n        .def(\"__exit__\", [](detail::OstreamRedirect &self_, const args &) { self_.exit(); });\n}\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/numpy.h",
    "content": "/*\n    pybind11/numpy.h: Basic NumPy support, vectorize() wrapper\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"pybind11.h\"\n#include \"complex.h\"\n\n#include <algorithm>\n#include <array>\n#include <cstdint>\n#include <cstdlib>\n#include <cstring>\n#include <functional>\n#include <numeric>\n#include <sstream>\n#include <string>\n#include <type_traits>\n#include <typeindex>\n#include <utility>\n#include <vector>\n\n/* This will be true on all flat address space platforms and allows us to reduce the\n   whole npy_intp / ssize_t / Py_intptr_t business down to just ssize_t for all size\n   and dimension types (e.g. shape, strides, indexing), instead of inflicting this\n   upon the library user. */\nstatic_assert(sizeof(::pybind11::ssize_t) == sizeof(Py_intptr_t), \"ssize_t != Py_intptr_t\");\nstatic_assert(std::is_signed<Py_intptr_t>::value, \"Py_intptr_t must be signed\");\n// We now can reinterpret_cast between py::ssize_t and Py_intptr_t (MSVC + PyPy cares)\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nPYBIND11_WARNING_DISABLE_MSVC(4127)\n\nclass array; // Forward declaration\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ntemplate <>\nstruct handle_type_name<array> {\n    static constexpr auto name = const_name(\"numpy.ndarray\");\n};\n\ntemplate <typename type, typename SFINAE = void>\nstruct npy_format_descriptor;\n\nstruct PyArrayDescr_Proxy {\n    PyObject_HEAD\n    PyObject *typeobj;\n    char kind;\n    char type;\n    char byteorder;\n    char flags;\n    int type_num;\n    int elsize;\n    int alignment;\n    char *subarray;\n    PyObject *fields;\n    PyObject *names;\n};\n\nstruct PyArray_Proxy {\n    PyObject_HEAD\n    char *data;\n    int nd;\n    ssize_t *dimensions;\n    ssize_t *strides;\n    PyObject *base;\n    PyObject *descr;\n    int flags;\n};\n\nstruct PyVoidScalarObject_Proxy {\n    PyObject_VAR_HEAD char *obval;\n    PyArrayDescr_Proxy *descr;\n    int flags;\n    PyObject *base;\n};\n\nstruct numpy_type_info {\n    PyObject *dtype_ptr;\n    std::string format_str;\n};\n\nstruct numpy_internals {\n    std::unordered_map<std::type_index, numpy_type_info> registered_dtypes;\n\n    numpy_type_info *get_type_info(const std::type_info &tinfo, bool throw_if_missing = true) {\n        auto it = registered_dtypes.find(std::type_index(tinfo));\n        if (it != registered_dtypes.end()) {\n            return &(it->second);\n        }\n        if (throw_if_missing) {\n            pybind11_fail(std::string(\"NumPy type info missing for \") + tinfo.name());\n        }\n        return nullptr;\n    }\n\n    template <typename T>\n    numpy_type_info *get_type_info(bool throw_if_missing = true) {\n        return get_type_info(typeid(typename std::remove_cv<T>::type), throw_if_missing);\n    }\n};\n\nPYBIND11_NOINLINE void load_numpy_internals(numpy_internals *&ptr) {\n    ptr = &get_or_create_shared_data<numpy_internals>(\"_numpy_internals\");\n}\n\ninline numpy_internals &get_numpy_internals() {\n    static numpy_internals *ptr = nullptr;\n    if (!ptr) {\n        load_numpy_internals(ptr);\n    }\n    return *ptr;\n}\n\ntemplate <typename T>\nstruct same_size {\n    template <typename U>\n    using as = bool_constant<sizeof(T) == sizeof(U)>;\n};\n\ntemplate <typename Concrete>\nconstexpr int platform_lookup() {\n    return -1;\n}\n\n// Lookup a type according to its size, and return a value corresponding to the NumPy typenum.\ntemplate <typename Concrete, typename T, typename... Ts, typename... Ints>\nconstexpr int platform_lookup(int I, Ints... Is) {\n    return sizeof(Concrete) == sizeof(T) ? I : platform_lookup<Concrete, Ts...>(Is...);\n}\n\nstruct npy_api {\n    enum constants {\n        NPY_ARRAY_C_CONTIGUOUS_ = 0x0001,\n        NPY_ARRAY_F_CONTIGUOUS_ = 0x0002,\n        NPY_ARRAY_OWNDATA_ = 0x0004,\n        NPY_ARRAY_FORCECAST_ = 0x0010,\n        NPY_ARRAY_ENSUREARRAY_ = 0x0040,\n        NPY_ARRAY_ALIGNED_ = 0x0100,\n        NPY_ARRAY_WRITEABLE_ = 0x0400,\n        NPY_BOOL_ = 0,\n        NPY_BYTE_,\n        NPY_UBYTE_,\n        NPY_SHORT_,\n        NPY_USHORT_,\n        NPY_INT_,\n        NPY_UINT_,\n        NPY_LONG_,\n        NPY_ULONG_,\n        NPY_LONGLONG_,\n        NPY_ULONGLONG_,\n        NPY_FLOAT_,\n        NPY_DOUBLE_,\n        NPY_LONGDOUBLE_,\n        NPY_CFLOAT_,\n        NPY_CDOUBLE_,\n        NPY_CLONGDOUBLE_,\n        NPY_OBJECT_ = 17,\n        NPY_STRING_,\n        NPY_UNICODE_,\n        NPY_VOID_,\n        // Platform-dependent normalization\n        NPY_INT8_ = NPY_BYTE_,\n        NPY_UINT8_ = NPY_UBYTE_,\n        NPY_INT16_ = NPY_SHORT_,\n        NPY_UINT16_ = NPY_USHORT_,\n        // `npy_common.h` defines the integer aliases. In order, it checks:\n        // NPY_BITSOF_LONG, NPY_BITSOF_LONGLONG, NPY_BITSOF_INT, NPY_BITSOF_SHORT, NPY_BITSOF_CHAR\n        // and assigns the alias to the first matching size, so we should check in this order.\n        NPY_INT32_\n        = platform_lookup<std::int32_t, long, int, short>(NPY_LONG_, NPY_INT_, NPY_SHORT_),\n        NPY_UINT32_ = platform_lookup<std::uint32_t, unsigned long, unsigned int, unsigned short>(\n            NPY_ULONG_, NPY_UINT_, NPY_USHORT_),\n        NPY_INT64_\n        = platform_lookup<std::int64_t, long, long long, int>(NPY_LONG_, NPY_LONGLONG_, NPY_INT_),\n        NPY_UINT64_\n        = platform_lookup<std::uint64_t, unsigned long, unsigned long long, unsigned int>(\n            NPY_ULONG_, NPY_ULONGLONG_, NPY_UINT_),\n    };\n\n    struct PyArray_Dims {\n        Py_intptr_t *ptr;\n        int len;\n    };\n\n    static npy_api &get() {\n        static npy_api api = lookup();\n        return api;\n    }\n\n    bool PyArray_Check_(PyObject *obj) const {\n        return PyObject_TypeCheck(obj, PyArray_Type_) != 0;\n    }\n    bool PyArrayDescr_Check_(PyObject *obj) const {\n        return PyObject_TypeCheck(obj, PyArrayDescr_Type_) != 0;\n    }\n\n    unsigned int (*PyArray_GetNDArrayCFeatureVersion_)();\n    PyObject *(*PyArray_DescrFromType_)(int);\n    PyObject *(*PyArray_NewFromDescr_)(PyTypeObject *,\n                                       PyObject *,\n                                       int,\n                                       Py_intptr_t const *,\n                                       Py_intptr_t const *,\n                                       void *,\n                                       int,\n                                       PyObject *);\n    // Unused. Not removed because that affects ABI of the class.\n    PyObject *(*PyArray_DescrNewFromType_)(int);\n    int (*PyArray_CopyInto_)(PyObject *, PyObject *);\n    PyObject *(*PyArray_NewCopy_)(PyObject *, int);\n    PyTypeObject *PyArray_Type_;\n    PyTypeObject *PyVoidArrType_Type_;\n    PyTypeObject *PyArrayDescr_Type_;\n    PyObject *(*PyArray_DescrFromScalar_)(PyObject *);\n    PyObject *(*PyArray_FromAny_)(PyObject *, PyObject *, int, int, int, PyObject *);\n    int (*PyArray_DescrConverter_)(PyObject *, PyObject **);\n    bool (*PyArray_EquivTypes_)(PyObject *, PyObject *);\n    int (*PyArray_GetArrayParamsFromObject_)(PyObject *,\n                                             PyObject *,\n                                             unsigned char,\n                                             PyObject **,\n                                             int *,\n                                             Py_intptr_t *,\n                                             PyObject **,\n                                             PyObject *);\n    PyObject *(*PyArray_Squeeze_)(PyObject *);\n    // Unused. Not removed because that affects ABI of the class.\n    int (*PyArray_SetBaseObject_)(PyObject *, PyObject *);\n    PyObject *(*PyArray_Resize_)(PyObject *, PyArray_Dims *, int, int);\n    PyObject *(*PyArray_Newshape_)(PyObject *, PyArray_Dims *, int);\n    PyObject *(*PyArray_View_)(PyObject *, PyObject *, PyObject *);\n\nprivate:\n    enum functions {\n        API_PyArray_GetNDArrayCFeatureVersion = 211,\n        API_PyArray_Type = 2,\n        API_PyArrayDescr_Type = 3,\n        API_PyVoidArrType_Type = 39,\n        API_PyArray_DescrFromType = 45,\n        API_PyArray_DescrFromScalar = 57,\n        API_PyArray_FromAny = 69,\n        API_PyArray_Resize = 80,\n        API_PyArray_CopyInto = 82,\n        API_PyArray_NewCopy = 85,\n        API_PyArray_NewFromDescr = 94,\n        API_PyArray_DescrNewFromType = 96,\n        API_PyArray_Newshape = 135,\n        API_PyArray_Squeeze = 136,\n        API_PyArray_View = 137,\n        API_PyArray_DescrConverter = 174,\n        API_PyArray_EquivTypes = 182,\n        API_PyArray_GetArrayParamsFromObject = 278,\n        API_PyArray_SetBaseObject = 282\n    };\n\n    static npy_api lookup() {\n        module_ m = module_::import(\"numpy.core.multiarray\");\n        auto c = m.attr(\"_ARRAY_API\");\n        void **api_ptr = (void **) PyCapsule_GetPointer(c.ptr(), nullptr);\n        npy_api api;\n#define DECL_NPY_API(Func) api.Func##_ = (decltype(api.Func##_)) api_ptr[API_##Func];\n        DECL_NPY_API(PyArray_GetNDArrayCFeatureVersion);\n        if (api.PyArray_GetNDArrayCFeatureVersion_() < 0x7) {\n            pybind11_fail(\"pybind11 numpy support requires numpy >= 1.7.0\");\n        }\n        DECL_NPY_API(PyArray_Type);\n        DECL_NPY_API(PyVoidArrType_Type);\n        DECL_NPY_API(PyArrayDescr_Type);\n        DECL_NPY_API(PyArray_DescrFromType);\n        DECL_NPY_API(PyArray_DescrFromScalar);\n        DECL_NPY_API(PyArray_FromAny);\n        DECL_NPY_API(PyArray_Resize);\n        DECL_NPY_API(PyArray_CopyInto);\n        DECL_NPY_API(PyArray_NewCopy);\n        DECL_NPY_API(PyArray_NewFromDescr);\n        DECL_NPY_API(PyArray_DescrNewFromType);\n        DECL_NPY_API(PyArray_Newshape);\n        DECL_NPY_API(PyArray_Squeeze);\n        DECL_NPY_API(PyArray_View);\n        DECL_NPY_API(PyArray_DescrConverter);\n        DECL_NPY_API(PyArray_EquivTypes);\n        DECL_NPY_API(PyArray_GetArrayParamsFromObject);\n        DECL_NPY_API(PyArray_SetBaseObject);\n\n#undef DECL_NPY_API\n        return api;\n    }\n};\n\ninline PyArray_Proxy *array_proxy(void *ptr) { return reinterpret_cast<PyArray_Proxy *>(ptr); }\n\ninline const PyArray_Proxy *array_proxy(const void *ptr) {\n    return reinterpret_cast<const PyArray_Proxy *>(ptr);\n}\n\ninline PyArrayDescr_Proxy *array_descriptor_proxy(PyObject *ptr) {\n    return reinterpret_cast<PyArrayDescr_Proxy *>(ptr);\n}\n\ninline const PyArrayDescr_Proxy *array_descriptor_proxy(const PyObject *ptr) {\n    return reinterpret_cast<const PyArrayDescr_Proxy *>(ptr);\n}\n\ninline bool check_flags(const void *ptr, int flag) {\n    return (flag == (array_proxy(ptr)->flags & flag));\n}\n\ntemplate <typename T>\nstruct is_std_array : std::false_type {};\ntemplate <typename T, size_t N>\nstruct is_std_array<std::array<T, N>> : std::true_type {};\ntemplate <typename T>\nstruct is_complex : std::false_type {};\ntemplate <typename T>\nstruct is_complex<std::complex<T>> : std::true_type {};\n\ntemplate <typename T>\nstruct array_info_scalar {\n    using type = T;\n    static constexpr bool is_array = false;\n    static constexpr bool is_empty = false;\n    static constexpr auto extents = const_name(\"\");\n    static void append_extents(list & /* shape */) {}\n};\n// Computes underlying type and a comma-separated list of extents for array\n// types (any mix of std::array and built-in arrays). An array of char is\n// treated as scalar because it gets special handling.\ntemplate <typename T>\nstruct array_info : array_info_scalar<T> {};\ntemplate <typename T, size_t N>\nstruct array_info<std::array<T, N>> {\n    using type = typename array_info<T>::type;\n    static constexpr bool is_array = true;\n    static constexpr bool is_empty = (N == 0) || array_info<T>::is_empty;\n    static constexpr size_t extent = N;\n\n    // appends the extents to shape\n    static void append_extents(list &shape) {\n        shape.append(N);\n        array_info<T>::append_extents(shape);\n    }\n\n    static constexpr auto extents = const_name<array_info<T>::is_array>(\n        concat(const_name<N>(), array_info<T>::extents), const_name<N>());\n};\n// For numpy we have special handling for arrays of characters, so we don't include\n// the size in the array extents.\ntemplate <size_t N>\nstruct array_info<char[N]> : array_info_scalar<char[N]> {};\ntemplate <size_t N>\nstruct array_info<std::array<char, N>> : array_info_scalar<std::array<char, N>> {};\ntemplate <typename T, size_t N>\nstruct array_info<T[N]> : array_info<std::array<T, N>> {};\ntemplate <typename T>\nusing remove_all_extents_t = typename array_info<T>::type;\n\ntemplate <typename T>\nusing is_pod_struct\n    = all_of<std::is_standard_layout<T>, // since we're accessing directly in memory\n                                         // we need a standard layout type\n#if defined(__GLIBCXX__)                                                                          \\\n    && (__GLIBCXX__ < 20150422 || __GLIBCXX__ == 20150426 || __GLIBCXX__ == 20150623              \\\n        || __GLIBCXX__ == 20150626 || __GLIBCXX__ == 20160803)\n             // libstdc++ < 5 (including versions 4.8.5, 4.9.3 and 4.9.4 which were released after\n             // 5) don't implement is_trivially_copyable, so approximate it\n             std::is_trivially_destructible<T>,\n             satisfies_any_of<T, std::has_trivial_copy_constructor, std::has_trivial_copy_assign>,\n#else\n             std::is_trivially_copyable<T>,\n#endif\n             satisfies_none_of<T,\n                               std::is_reference,\n                               std::is_array,\n                               is_std_array,\n                               std::is_arithmetic,\n                               is_complex,\n                               std::is_enum>>;\n\n// Replacement for std::is_pod (deprecated in C++20)\ntemplate <typename T>\nusing is_pod = all_of<std::is_standard_layout<T>, std::is_trivial<T>>;\n\ntemplate <ssize_t Dim = 0, typename Strides>\nssize_t byte_offset_unsafe(const Strides &) {\n    return 0;\n}\ntemplate <ssize_t Dim = 0, typename Strides, typename... Ix>\nssize_t byte_offset_unsafe(const Strides &strides, ssize_t i, Ix... index) {\n    return i * strides[Dim] + byte_offset_unsafe<Dim + 1>(strides, index...);\n}\n\n/**\n * Proxy class providing unsafe, unchecked const access to array data.  This is constructed through\n * the `unchecked<T, N>()` method of `array` or the `unchecked<N>()` method of `array_t<T>`. `Dims`\n * will be -1 for dimensions determined at runtime.\n */\ntemplate <typename T, ssize_t Dims>\nclass unchecked_reference {\nprotected:\n    static constexpr bool Dynamic = Dims < 0;\n    const unsigned char *data_;\n    // Storing the shape & strides in local variables (i.e. these arrays) allows the compiler to\n    // make large performance gains on big, nested loops, but requires compile-time dimensions\n    conditional_t<Dynamic, const ssize_t *, std::array<ssize_t, (size_t) Dims>> shape_, strides_;\n    const ssize_t dims_;\n\n    friend class pybind11::array;\n    // Constructor for compile-time dimensions:\n    template <bool Dyn = Dynamic>\n    unchecked_reference(const void *data,\n                        const ssize_t *shape,\n                        const ssize_t *strides,\n                        enable_if_t<!Dyn, ssize_t>)\n        : data_{reinterpret_cast<const unsigned char *>(data)}, dims_{Dims} {\n        for (size_t i = 0; i < (size_t) dims_; i++) {\n            shape_[i] = shape[i];\n            strides_[i] = strides[i];\n        }\n    }\n    // Constructor for runtime dimensions:\n    template <bool Dyn = Dynamic>\n    unchecked_reference(const void *data,\n                        const ssize_t *shape,\n                        const ssize_t *strides,\n                        enable_if_t<Dyn, ssize_t> dims)\n        : data_{reinterpret_cast<const unsigned char *>(data)}, shape_{shape}, strides_{strides},\n          dims_{dims} {}\n\npublic:\n    /**\n     * Unchecked const reference access to data at the given indices.  For a compile-time known\n     * number of dimensions, this requires the correct number of arguments; for run-time\n     * dimensionality, this is not checked (and so is up to the caller to use safely).\n     */\n    template <typename... Ix>\n    const T &operator()(Ix... index) const {\n        static_assert(ssize_t{sizeof...(Ix)} == Dims || Dynamic,\n                      \"Invalid number of indices for unchecked array reference\");\n        return *reinterpret_cast<const T *>(data_\n                                            + byte_offset_unsafe(strides_, ssize_t(index)...));\n    }\n    /**\n     * Unchecked const reference access to data; this operator only participates if the reference\n     * is to a 1-dimensional array.  When present, this is exactly equivalent to `obj(index)`.\n     */\n    template <ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>\n    const T &operator[](ssize_t index) const {\n        return operator()(index);\n    }\n\n    /// Pointer access to the data at the given indices.\n    template <typename... Ix>\n    const T *data(Ix... ix) const {\n        return &operator()(ssize_t(ix)...);\n    }\n\n    /// Returns the item size, i.e. sizeof(T)\n    constexpr static ssize_t itemsize() { return sizeof(T); }\n\n    /// Returns the shape (i.e. size) of dimension `dim`\n    ssize_t shape(ssize_t dim) const { return shape_[(size_t) dim]; }\n\n    /// Returns the number of dimensions of the array\n    ssize_t ndim() const { return dims_; }\n\n    /// Returns the total number of elements in the referenced array, i.e. the product of the\n    /// shapes\n    template <bool Dyn = Dynamic>\n    enable_if_t<!Dyn, ssize_t> size() const {\n        return std::accumulate(\n            shape_.begin(), shape_.end(), (ssize_t) 1, std::multiplies<ssize_t>());\n    }\n    template <bool Dyn = Dynamic>\n    enable_if_t<Dyn, ssize_t> size() const {\n        return std::accumulate(shape_, shape_ + ndim(), (ssize_t) 1, std::multiplies<ssize_t>());\n    }\n\n    /// Returns the total number of bytes used by the referenced data.  Note that the actual span\n    /// in memory may be larger if the referenced array has non-contiguous strides (e.g. for a\n    /// slice).\n    ssize_t nbytes() const { return size() * itemsize(); }\n};\n\ntemplate <typename T, ssize_t Dims>\nclass unchecked_mutable_reference : public unchecked_reference<T, Dims> {\n    friend class pybind11::array;\n    using ConstBase = unchecked_reference<T, Dims>;\n    using ConstBase::ConstBase;\n    using ConstBase::Dynamic;\n\npublic:\n    // Bring in const-qualified versions from base class\n    using ConstBase::operator();\n    using ConstBase::operator[];\n\n    /// Mutable, unchecked access to data at the given indices.\n    template <typename... Ix>\n    T &operator()(Ix... index) {\n        static_assert(ssize_t{sizeof...(Ix)} == Dims || Dynamic,\n                      \"Invalid number of indices for unchecked array reference\");\n        return const_cast<T &>(ConstBase::operator()(index...));\n    }\n    /**\n     * Mutable, unchecked access data at the given index; this operator only participates if the\n     * reference is to a 1-dimensional array (or has runtime dimensions).  When present, this is\n     * exactly equivalent to `obj(index)`.\n     */\n    template <ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>\n    T &operator[](ssize_t index) {\n        return operator()(index);\n    }\n\n    /// Mutable pointer access to the data at the given indices.\n    template <typename... Ix>\n    T *mutable_data(Ix... ix) {\n        return &operator()(ssize_t(ix)...);\n    }\n};\n\ntemplate <typename T, ssize_t Dim>\nstruct type_caster<unchecked_reference<T, Dim>> {\n    static_assert(Dim == 0 && Dim > 0 /* always fail */,\n                  \"unchecked array proxy object is not castable\");\n};\ntemplate <typename T, ssize_t Dim>\nstruct type_caster<unchecked_mutable_reference<T, Dim>>\n    : type_caster<unchecked_reference<T, Dim>> {};\n\nPYBIND11_NAMESPACE_END(detail)\n\nclass dtype : public object {\npublic:\n    PYBIND11_OBJECT_DEFAULT(dtype, object, detail::npy_api::get().PyArrayDescr_Check_)\n\n    explicit dtype(const buffer_info &info) {\n        dtype descr(_dtype_from_pep3118()(pybind11::str(info.format)));\n        // If info.itemsize == 0, use the value calculated from the format string\n        m_ptr = descr.strip_padding(info.itemsize != 0 ? info.itemsize : descr.itemsize())\n                    .release()\n                    .ptr();\n    }\n\n    explicit dtype(const pybind11::str &format) : dtype(from_args(format)) {}\n\n    explicit dtype(const std::string &format) : dtype(pybind11::str(format)) {}\n\n    explicit dtype(const char *format) : dtype(pybind11::str(format)) {}\n\n    dtype(list names, list formats, list offsets, ssize_t itemsize) {\n        dict args;\n        args[\"names\"] = std::move(names);\n        args[\"formats\"] = std::move(formats);\n        args[\"offsets\"] = std::move(offsets);\n        args[\"itemsize\"] = pybind11::int_(itemsize);\n        m_ptr = from_args(args).release().ptr();\n    }\n\n    explicit dtype(int typenum)\n        : object(detail::npy_api::get().PyArray_DescrFromType_(typenum), stolen_t{}) {\n        if (m_ptr == nullptr) {\n            throw error_already_set();\n        }\n    }\n\n    /// This is essentially the same as calling numpy.dtype(args) in Python.\n    static dtype from_args(const object &args) {\n        PyObject *ptr = nullptr;\n        if ((detail::npy_api::get().PyArray_DescrConverter_(args.ptr(), &ptr) == 0) || !ptr) {\n            throw error_already_set();\n        }\n        return reinterpret_steal<dtype>(ptr);\n    }\n\n    /// Return dtype associated with a C++ type.\n    template <typename T>\n    static dtype of() {\n        return detail::npy_format_descriptor<typename std::remove_cv<T>::type>::dtype();\n    }\n\n    /// Size of the data type in bytes.\n    ssize_t itemsize() const { return detail::array_descriptor_proxy(m_ptr)->elsize; }\n\n    /// Returns true for structured data types.\n    bool has_fields() const { return detail::array_descriptor_proxy(m_ptr)->names != nullptr; }\n\n    /// Single-character code for dtype's kind.\n    /// For example, floating point types are 'f' and integral types are 'i'.\n    char kind() const { return detail::array_descriptor_proxy(m_ptr)->kind; }\n\n    /// Single-character for dtype's type.\n    /// For example, ``float`` is 'f', ``double`` 'd', ``int`` 'i', and ``long`` 'l'.\n    char char_() const {\n        // Note: The signature, `dtype::char_` follows the naming of NumPy's\n        // public Python API (i.e., ``dtype.char``), rather than its internal\n        // C API (``PyArray_Descr::type``).\n        return detail::array_descriptor_proxy(m_ptr)->type;\n    }\n\n    /// type number of dtype.\n    int num() const {\n        // Note: The signature, `dtype::num` follows the naming of NumPy's public\n        // Python API (i.e., ``dtype.num``), rather than its internal\n        // C API (``PyArray_Descr::type_num``).\n        return detail::array_descriptor_proxy(m_ptr)->type_num;\n    }\n\n    /// Single character for byteorder\n    char byteorder() const { return detail::array_descriptor_proxy(m_ptr)->byteorder; }\n\n    /// Alignment of the data type\n    int alignment() const { return detail::array_descriptor_proxy(m_ptr)->alignment; }\n\n    /// Flags for the array descriptor\n    char flags() const { return detail::array_descriptor_proxy(m_ptr)->flags; }\n\nprivate:\n    static object _dtype_from_pep3118() {\n        static PyObject *obj = module_::import(\"numpy.core._internal\")\n                                   .attr(\"_dtype_from_pep3118\")\n                                   .cast<object>()\n                                   .release()\n                                   .ptr();\n        return reinterpret_borrow<object>(obj);\n    }\n\n    dtype strip_padding(ssize_t itemsize) {\n        // Recursively strip all void fields with empty names that are generated for\n        // padding fields (as of NumPy v1.11).\n        if (!has_fields()) {\n            return *this;\n        }\n\n        struct field_descr {\n            pybind11::str name;\n            object format;\n            pybind11::int_ offset;\n            field_descr(pybind11::str &&name, object &&format, pybind11::int_ &&offset)\n                : name{std::move(name)}, format{std::move(format)}, offset{std::move(offset)} {};\n        };\n        auto field_dict = attr(\"fields\").cast<dict>();\n        std::vector<field_descr> field_descriptors;\n        field_descriptors.reserve(field_dict.size());\n\n        for (auto field : field_dict.attr(\"items\")()) {\n            auto spec = field.cast<tuple>();\n            auto name = spec[0].cast<pybind11::str>();\n            auto spec_fo = spec[1].cast<tuple>();\n            auto format = spec_fo[0].cast<dtype>();\n            auto offset = spec_fo[1].cast<pybind11::int_>();\n            if ((len(name) == 0u) && format.kind() == 'V') {\n                continue;\n            }\n            field_descriptors.emplace_back(\n                std::move(name), format.strip_padding(format.itemsize()), std::move(offset));\n        }\n\n        std::sort(field_descriptors.begin(),\n                  field_descriptors.end(),\n                  [](const field_descr &a, const field_descr &b) {\n                      return a.offset.cast<int>() < b.offset.cast<int>();\n                  });\n\n        list names, formats, offsets;\n        for (auto &descr : field_descriptors) {\n            names.append(std::move(descr.name));\n            formats.append(std::move(descr.format));\n            offsets.append(std::move(descr.offset));\n        }\n        return dtype(std::move(names), std::move(formats), std::move(offsets), itemsize);\n    }\n};\n\nclass array : public buffer {\npublic:\n    PYBIND11_OBJECT_CVT(array, buffer, detail::npy_api::get().PyArray_Check_, raw_array)\n\n    enum {\n        c_style = detail::npy_api::NPY_ARRAY_C_CONTIGUOUS_,\n        f_style = detail::npy_api::NPY_ARRAY_F_CONTIGUOUS_,\n        forcecast = detail::npy_api::NPY_ARRAY_FORCECAST_\n    };\n\n    array() : array(0, static_cast<const double *>(nullptr)) {}\n\n    using ShapeContainer = detail::any_container<ssize_t>;\n    using StridesContainer = detail::any_container<ssize_t>;\n\n    // Constructs an array taking shape/strides from arbitrary container types\n    array(const pybind11::dtype &dt,\n          ShapeContainer shape,\n          StridesContainer strides,\n          const void *ptr = nullptr,\n          handle base = handle()) {\n\n        if (strides->empty()) {\n            *strides = detail::c_strides(*shape, dt.itemsize());\n        }\n\n        auto ndim = shape->size();\n        if (ndim != strides->size()) {\n            pybind11_fail(\"NumPy: shape ndim doesn't match strides ndim\");\n        }\n        auto descr = dt;\n\n        int flags = 0;\n        if (base && ptr) {\n            if (isinstance<array>(base)) {\n                /* Copy flags from base (except ownership bit) */\n                flags = reinterpret_borrow<array>(base).flags()\n                        & ~detail::npy_api::NPY_ARRAY_OWNDATA_;\n            } else {\n                /* Writable by default, easy to downgrade later on if needed */\n                flags = detail::npy_api::NPY_ARRAY_WRITEABLE_;\n            }\n        }\n\n        auto &api = detail::npy_api::get();\n        auto tmp = reinterpret_steal<object>(api.PyArray_NewFromDescr_(\n            api.PyArray_Type_,\n            descr.release().ptr(),\n            (int) ndim,\n            // Use reinterpret_cast for PyPy on Windows (remove if fixed, checked on 7.3.1)\n            reinterpret_cast<Py_intptr_t *>(shape->data()),\n            reinterpret_cast<Py_intptr_t *>(strides->data()),\n            const_cast<void *>(ptr),\n            flags,\n            nullptr));\n        if (!tmp) {\n            throw error_already_set();\n        }\n        if (ptr) {\n            if (base) {\n                api.PyArray_SetBaseObject_(tmp.ptr(), base.inc_ref().ptr());\n            } else {\n                tmp = reinterpret_steal<object>(\n                    api.PyArray_NewCopy_(tmp.ptr(), -1 /* any order */));\n            }\n        }\n        m_ptr = tmp.release().ptr();\n    }\n\n    array(const pybind11::dtype &dt,\n          ShapeContainer shape,\n          const void *ptr = nullptr,\n          handle base = handle())\n        : array(dt, std::move(shape), {}, ptr, base) {}\n\n    template <typename T,\n              typename\n              = detail::enable_if_t<std::is_integral<T>::value && !std::is_same<bool, T>::value>>\n    array(const pybind11::dtype &dt, T count, const void *ptr = nullptr, handle base = handle())\n        : array(dt, {{count}}, ptr, base) {}\n\n    template <typename T>\n    array(ShapeContainer shape, StridesContainer strides, const T *ptr, handle base = handle())\n        : array(pybind11::dtype::of<T>(), std::move(shape), std::move(strides), ptr, base) {}\n\n    template <typename T>\n    array(ShapeContainer shape, const T *ptr, handle base = handle())\n        : array(std::move(shape), {}, ptr, base) {}\n\n    template <typename T>\n    explicit array(ssize_t count, const T *ptr, handle base = handle())\n        : array({count}, {}, ptr, base) {}\n\n    explicit array(const buffer_info &info, handle base = handle())\n        : array(pybind11::dtype(info), info.shape, info.strides, info.ptr, base) {}\n\n    /// Array descriptor (dtype)\n    pybind11::dtype dtype() const {\n        return reinterpret_borrow<pybind11::dtype>(detail::array_proxy(m_ptr)->descr);\n    }\n\n    /// Total number of elements\n    ssize_t size() const {\n        return std::accumulate(shape(), shape() + ndim(), (ssize_t) 1, std::multiplies<ssize_t>());\n    }\n\n    /// Byte size of a single element\n    ssize_t itemsize() const {\n        return detail::array_descriptor_proxy(detail::array_proxy(m_ptr)->descr)->elsize;\n    }\n\n    /// Total number of bytes\n    ssize_t nbytes() const { return size() * itemsize(); }\n\n    /// Number of dimensions\n    ssize_t ndim() const { return detail::array_proxy(m_ptr)->nd; }\n\n    /// Base object\n    object base() const { return reinterpret_borrow<object>(detail::array_proxy(m_ptr)->base); }\n\n    /// Dimensions of the array\n    const ssize_t *shape() const { return detail::array_proxy(m_ptr)->dimensions; }\n\n    /// Dimension along a given axis\n    ssize_t shape(ssize_t dim) const {\n        if (dim >= ndim()) {\n            fail_dim_check(dim, \"invalid axis\");\n        }\n        return shape()[dim];\n    }\n\n    /// Strides of the array\n    const ssize_t *strides() const { return detail::array_proxy(m_ptr)->strides; }\n\n    /// Stride along a given axis\n    ssize_t strides(ssize_t dim) const {\n        if (dim >= ndim()) {\n            fail_dim_check(dim, \"invalid axis\");\n        }\n        return strides()[dim];\n    }\n\n    /// Return the NumPy array flags\n    int flags() const { return detail::array_proxy(m_ptr)->flags; }\n\n    /// If set, the array is writeable (otherwise the buffer is read-only)\n    bool writeable() const {\n        return detail::check_flags(m_ptr, detail::npy_api::NPY_ARRAY_WRITEABLE_);\n    }\n\n    /// If set, the array owns the data (will be freed when the array is deleted)\n    bool owndata() const {\n        return detail::check_flags(m_ptr, detail::npy_api::NPY_ARRAY_OWNDATA_);\n    }\n\n    /// Pointer to the contained data. If index is not provided, points to the\n    /// beginning of the buffer. May throw if the index would lead to out of bounds access.\n    template <typename... Ix>\n    const void *data(Ix... index) const {\n        return static_cast<const void *>(detail::array_proxy(m_ptr)->data + offset_at(index...));\n    }\n\n    /// Mutable pointer to the contained data. If index is not provided, points to the\n    /// beginning of the buffer. May throw if the index would lead to out of bounds access.\n    /// May throw if the array is not writeable.\n    template <typename... Ix>\n    void *mutable_data(Ix... index) {\n        check_writeable();\n        return static_cast<void *>(detail::array_proxy(m_ptr)->data + offset_at(index...));\n    }\n\n    /// Byte offset from beginning of the array to a given index (full or partial).\n    /// May throw if the index would lead to out of bounds access.\n    template <typename... Ix>\n    ssize_t offset_at(Ix... index) const {\n        if ((ssize_t) sizeof...(index) > ndim()) {\n            fail_dim_check(sizeof...(index), \"too many indices for an array\");\n        }\n        return byte_offset(ssize_t(index)...);\n    }\n\n    ssize_t offset_at() const { return 0; }\n\n    /// Item count from beginning of the array to a given index (full or partial).\n    /// May throw if the index would lead to out of bounds access.\n    template <typename... Ix>\n    ssize_t index_at(Ix... index) const {\n        return offset_at(index...) / itemsize();\n    }\n\n    /**\n     * Returns a proxy object that provides access to the array's data without bounds or\n     * dimensionality checking.  Will throw if the array is missing the `writeable` flag.  Use with\n     * care: the array must not be destroyed or reshaped for the duration of the returned object,\n     * and the caller must take care not to access invalid dimensions or dimension indices.\n     */\n    template <typename T, ssize_t Dims = -1>\n    detail::unchecked_mutable_reference<T, Dims> mutable_unchecked() & {\n        if (Dims >= 0 && ndim() != Dims) {\n            throw std::domain_error(\"array has incorrect number of dimensions: \"\n                                    + std::to_string(ndim()) + \"; expected \"\n                                    + std::to_string(Dims));\n        }\n        return detail::unchecked_mutable_reference<T, Dims>(\n            mutable_data(), shape(), strides(), ndim());\n    }\n\n    /**\n     * Returns a proxy object that provides const access to the array's data without bounds or\n     * dimensionality checking.  Unlike `mutable_unchecked()`, this does not require that the\n     * underlying array have the `writable` flag.  Use with care: the array must not be destroyed\n     * or reshaped for the duration of the returned object, and the caller must take care not to\n     * access invalid dimensions or dimension indices.\n     */\n    template <typename T, ssize_t Dims = -1>\n    detail::unchecked_reference<T, Dims> unchecked() const & {\n        if (Dims >= 0 && ndim() != Dims) {\n            throw std::domain_error(\"array has incorrect number of dimensions: \"\n                                    + std::to_string(ndim()) + \"; expected \"\n                                    + std::to_string(Dims));\n        }\n        return detail::unchecked_reference<T, Dims>(data(), shape(), strides(), ndim());\n    }\n\n    /// Return a new view with all of the dimensions of length 1 removed\n    array squeeze() {\n        auto &api = detail::npy_api::get();\n        return reinterpret_steal<array>(api.PyArray_Squeeze_(m_ptr));\n    }\n\n    /// Resize array to given shape\n    /// If refcheck is true and more that one reference exist to this array\n    /// then resize will succeed only if it makes a reshape, i.e. original size doesn't change\n    void resize(ShapeContainer new_shape, bool refcheck = true) {\n        detail::npy_api::PyArray_Dims d\n            = {// Use reinterpret_cast for PyPy on Windows (remove if fixed, checked on 7.3.1)\n               reinterpret_cast<Py_intptr_t *>(new_shape->data()),\n               int(new_shape->size())};\n        // try to resize, set ordering param to -1 cause it's not used anyway\n        auto new_array = reinterpret_steal<object>(\n            detail::npy_api::get().PyArray_Resize_(m_ptr, &d, int(refcheck), -1));\n        if (!new_array) {\n            throw error_already_set();\n        }\n        if (isinstance<array>(new_array)) {\n            *this = std::move(new_array);\n        }\n    }\n\n    /// Optional `order` parameter omitted, to be added as needed.\n    array reshape(ShapeContainer new_shape) {\n        detail::npy_api::PyArray_Dims d\n            = {reinterpret_cast<Py_intptr_t *>(new_shape->data()), int(new_shape->size())};\n        auto new_array\n            = reinterpret_steal<array>(detail::npy_api::get().PyArray_Newshape_(m_ptr, &d, 0));\n        if (!new_array) {\n            throw error_already_set();\n        }\n        return new_array;\n    }\n\n    /// Create a view of an array in a different data type.\n    /// This function may fundamentally reinterpret the data in the array.\n    /// It is the responsibility of the caller to ensure that this is safe.\n    /// Only supports the `dtype` argument, the `type` argument is omitted,\n    /// to be added as needed.\n    array view(const std::string &dtype) {\n        auto &api = detail::npy_api::get();\n        auto new_view = reinterpret_steal<array>(api.PyArray_View_(\n            m_ptr, dtype::from_args(pybind11::str(dtype)).release().ptr(), nullptr));\n        if (!new_view) {\n            throw error_already_set();\n        }\n        return new_view;\n    }\n\n    /// Ensure that the argument is a NumPy array\n    /// In case of an error, nullptr is returned and the Python error is cleared.\n    static array ensure(handle h, int ExtraFlags = 0) {\n        auto result = reinterpret_steal<array>(raw_array(h.ptr(), ExtraFlags));\n        if (!result) {\n            PyErr_Clear();\n        }\n        return result;\n    }\n\nprotected:\n    template <typename, typename>\n    friend struct detail::npy_format_descriptor;\n\n    void fail_dim_check(ssize_t dim, const std::string &msg) const {\n        throw index_error(msg + \": \" + std::to_string(dim) + \" (ndim = \" + std::to_string(ndim())\n                          + ')');\n    }\n\n    template <typename... Ix>\n    ssize_t byte_offset(Ix... index) const {\n        check_dimensions(index...);\n        return detail::byte_offset_unsafe(strides(), ssize_t(index)...);\n    }\n\n    void check_writeable() const {\n        if (!writeable()) {\n            throw std::domain_error(\"array is not writeable\");\n        }\n    }\n\n    template <typename... Ix>\n    void check_dimensions(Ix... index) const {\n        check_dimensions_impl(ssize_t(0), shape(), ssize_t(index)...);\n    }\n\n    void check_dimensions_impl(ssize_t, const ssize_t *) const {}\n\n    template <typename... Ix>\n    void check_dimensions_impl(ssize_t axis, const ssize_t *shape, ssize_t i, Ix... index) const {\n        if (i >= *shape) {\n            throw index_error(std::string(\"index \") + std::to_string(i)\n                              + \" is out of bounds for axis \" + std::to_string(axis)\n                              + \" with size \" + std::to_string(*shape));\n        }\n        check_dimensions_impl(axis + 1, shape + 1, index...);\n    }\n\n    /// Create array from any object -- always returns a new reference\n    static PyObject *raw_array(PyObject *ptr, int ExtraFlags = 0) {\n        if (ptr == nullptr) {\n            PyErr_SetString(PyExc_ValueError, \"cannot create a pybind11::array from a nullptr\");\n            return nullptr;\n        }\n        return detail::npy_api::get().PyArray_FromAny_(\n            ptr, nullptr, 0, 0, detail::npy_api::NPY_ARRAY_ENSUREARRAY_ | ExtraFlags, nullptr);\n    }\n};\n\ntemplate <typename T, int ExtraFlags = array::forcecast>\nclass array_t : public array {\nprivate:\n    struct private_ctor {};\n    // Delegating constructor needed when both moving and accessing in the same constructor\n    array_t(private_ctor,\n            ShapeContainer &&shape,\n            StridesContainer &&strides,\n            const T *ptr,\n            handle base)\n        : array(std::move(shape), std::move(strides), ptr, base) {}\n\npublic:\n    static_assert(!detail::array_info<T>::is_array, \"Array types cannot be used with array_t\");\n\n    using value_type = T;\n\n    array_t() : array(0, static_cast<const T *>(nullptr)) {}\n    array_t(handle h, borrowed_t) : array(h, borrowed_t{}) {}\n    array_t(handle h, stolen_t) : array(h, stolen_t{}) {}\n\n    PYBIND11_DEPRECATED(\"Use array_t<T>::ensure() instead\")\n    array_t(handle h, bool is_borrowed) : array(raw_array_t(h.ptr()), stolen_t{}) {\n        if (!m_ptr) {\n            PyErr_Clear();\n        }\n        if (!is_borrowed) {\n            Py_XDECREF(h.ptr());\n        }\n    }\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    array_t(const object &o) : array(raw_array_t(o.ptr()), stolen_t{}) {\n        if (!m_ptr) {\n            throw error_already_set();\n        }\n    }\n\n    explicit array_t(const buffer_info &info, handle base = handle()) : array(info, base) {}\n\n    array_t(ShapeContainer shape,\n            StridesContainer strides,\n            const T *ptr = nullptr,\n            handle base = handle())\n        : array(std::move(shape), std::move(strides), ptr, base) {}\n\n    explicit array_t(ShapeContainer shape, const T *ptr = nullptr, handle base = handle())\n        : array_t(private_ctor{},\n                  std::move(shape),\n                  (ExtraFlags & f_style) != 0 ? detail::f_strides(*shape, itemsize())\n                                              : detail::c_strides(*shape, itemsize()),\n                  ptr,\n                  base) {}\n\n    explicit array_t(ssize_t count, const T *ptr = nullptr, handle base = handle())\n        : array({count}, {}, ptr, base) {}\n\n    constexpr ssize_t itemsize() const { return sizeof(T); }\n\n    template <typename... Ix>\n    ssize_t index_at(Ix... index) const {\n        return offset_at(index...) / itemsize();\n    }\n\n    template <typename... Ix>\n    const T *data(Ix... index) const {\n        return static_cast<const T *>(array::data(index...));\n    }\n\n    template <typename... Ix>\n    T *mutable_data(Ix... index) {\n        return static_cast<T *>(array::mutable_data(index...));\n    }\n\n    // Reference to element at a given index\n    template <typename... Ix>\n    const T &at(Ix... index) const {\n        if ((ssize_t) sizeof...(index) != ndim()) {\n            fail_dim_check(sizeof...(index), \"index dimension mismatch\");\n        }\n        return *(static_cast<const T *>(array::data())\n                 + byte_offset(ssize_t(index)...) / itemsize());\n    }\n\n    // Mutable reference to element at a given index\n    template <typename... Ix>\n    T &mutable_at(Ix... index) {\n        if ((ssize_t) sizeof...(index) != ndim()) {\n            fail_dim_check(sizeof...(index), \"index dimension mismatch\");\n        }\n        return *(static_cast<T *>(array::mutable_data())\n                 + byte_offset(ssize_t(index)...) / itemsize());\n    }\n\n    /**\n     * Returns a proxy object that provides access to the array's data without bounds or\n     * dimensionality checking.  Will throw if the array is missing the `writeable` flag.  Use with\n     * care: the array must not be destroyed or reshaped for the duration of the returned object,\n     * and the caller must take care not to access invalid dimensions or dimension indices.\n     */\n    template <ssize_t Dims = -1>\n    detail::unchecked_mutable_reference<T, Dims> mutable_unchecked() & {\n        return array::mutable_unchecked<T, Dims>();\n    }\n\n    /**\n     * Returns a proxy object that provides const access to the array's data without bounds or\n     * dimensionality checking.  Unlike `mutable_unchecked()`, this does not require that the\n     * underlying array have the `writable` flag.  Use with care: the array must not be destroyed\n     * or reshaped for the duration of the returned object, and the caller must take care not to\n     * access invalid dimensions or dimension indices.\n     */\n    template <ssize_t Dims = -1>\n    detail::unchecked_reference<T, Dims> unchecked() const & {\n        return array::unchecked<T, Dims>();\n    }\n\n    /// Ensure that the argument is a NumPy array of the correct dtype (and if not, try to convert\n    /// it).  In case of an error, nullptr is returned and the Python error is cleared.\n    static array_t ensure(handle h) {\n        auto result = reinterpret_steal<array_t>(raw_array_t(h.ptr()));\n        if (!result) {\n            PyErr_Clear();\n        }\n        return result;\n    }\n\n    static bool check_(handle h) {\n        const auto &api = detail::npy_api::get();\n        return api.PyArray_Check_(h.ptr())\n               && api.PyArray_EquivTypes_(detail::array_proxy(h.ptr())->descr,\n                                          dtype::of<T>().ptr())\n               && detail::check_flags(h.ptr(), ExtraFlags & (array::c_style | array::f_style));\n    }\n\nprotected:\n    /// Create array from any object -- always returns a new reference\n    static PyObject *raw_array_t(PyObject *ptr) {\n        if (ptr == nullptr) {\n            PyErr_SetString(PyExc_ValueError, \"cannot create a pybind11::array_t from a nullptr\");\n            return nullptr;\n        }\n        return detail::npy_api::get().PyArray_FromAny_(ptr,\n                                                       dtype::of<T>().release().ptr(),\n                                                       0,\n                                                       0,\n                                                       detail::npy_api::NPY_ARRAY_ENSUREARRAY_\n                                                           | ExtraFlags,\n                                                       nullptr);\n    }\n};\n\ntemplate <typename T>\nstruct format_descriptor<T, detail::enable_if_t<detail::is_pod_struct<T>::value>> {\n    static std::string format() {\n        return detail::npy_format_descriptor<typename std::remove_cv<T>::type>::format();\n    }\n};\n\ntemplate <size_t N>\nstruct format_descriptor<char[N]> {\n    static std::string format() { return std::to_string(N) + 's'; }\n};\ntemplate <size_t N>\nstruct format_descriptor<std::array<char, N>> {\n    static std::string format() { return std::to_string(N) + 's'; }\n};\n\ntemplate <typename T>\nstruct format_descriptor<T, detail::enable_if_t<std::is_enum<T>::value>> {\n    static std::string format() {\n        return format_descriptor<\n            typename std::remove_cv<typename std::underlying_type<T>::type>::type>::format();\n    }\n};\n\ntemplate <typename T>\nstruct format_descriptor<T, detail::enable_if_t<detail::array_info<T>::is_array>> {\n    static std::string format() {\n        using namespace detail;\n        static constexpr auto extents = const_name(\"(\") + array_info<T>::extents + const_name(\")\");\n        return extents.text + format_descriptor<remove_all_extents_t<T>>::format();\n    }\n};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\ntemplate <typename T, int ExtraFlags>\nstruct pyobject_caster<array_t<T, ExtraFlags>> {\n    using type = array_t<T, ExtraFlags>;\n\n    bool load(handle src, bool convert) {\n        if (!convert && !type::check_(src)) {\n            return false;\n        }\n        value = type::ensure(src);\n        return static_cast<bool>(value);\n    }\n\n    static handle cast(const handle &src, return_value_policy /* policy */, handle /* parent */) {\n        return src.inc_ref();\n    }\n    PYBIND11_TYPE_CASTER(type, handle_type_name<type>::name);\n};\n\ntemplate <typename T>\nstruct compare_buffer_info<T, detail::enable_if_t<detail::is_pod_struct<T>::value>> {\n    static bool compare(const buffer_info &b) {\n        return npy_api::get().PyArray_EquivTypes_(dtype::of<T>().ptr(), dtype(b).ptr());\n    }\n};\n\ntemplate <typename T, typename = void>\nstruct npy_format_descriptor_name;\n\ntemplate <typename T>\nstruct npy_format_descriptor_name<T, enable_if_t<std::is_integral<T>::value>> {\n    static constexpr auto name = const_name<std::is_same<T, bool>::value>(\n        const_name(\"bool\"),\n        const_name<std::is_signed<T>::value>(\"numpy.int\", \"numpy.uint\")\n            + const_name<sizeof(T) * 8>());\n};\n\ntemplate <typename T>\nstruct npy_format_descriptor_name<T, enable_if_t<std::is_floating_point<T>::value>> {\n    static constexpr auto name = const_name < std::is_same<T, float>::value\n                                 || std::is_same<T, const float>::value\n                                 || std::is_same<T, double>::value\n                                 || std::is_same<T, const double>::value\n                                        > (const_name(\"numpy.float\") + const_name<sizeof(T) * 8>(),\n                                           const_name(\"numpy.longdouble\"));\n};\n\ntemplate <typename T>\nstruct npy_format_descriptor_name<T, enable_if_t<is_complex<T>::value>> {\n    static constexpr auto name = const_name < std::is_same<typename T::value_type, float>::value\n                                 || std::is_same<typename T::value_type, const float>::value\n                                 || std::is_same<typename T::value_type, double>::value\n                                 || std::is_same<typename T::value_type, const double>::value\n                                        > (const_name(\"numpy.complex\")\n                                               + const_name<sizeof(typename T::value_type) * 16>(),\n                                           const_name(\"numpy.longcomplex\"));\n};\n\ntemplate <typename T>\nstruct npy_format_descriptor<\n    T,\n    enable_if_t<satisfies_any_of<T, std::is_arithmetic, is_complex>::value>>\n    : npy_format_descriptor_name<T> {\nprivate:\n    // NB: the order here must match the one in common.h\n    constexpr static const int values[15] = {npy_api::NPY_BOOL_,\n                                             npy_api::NPY_BYTE_,\n                                             npy_api::NPY_UBYTE_,\n                                             npy_api::NPY_INT16_,\n                                             npy_api::NPY_UINT16_,\n                                             npy_api::NPY_INT32_,\n                                             npy_api::NPY_UINT32_,\n                                             npy_api::NPY_INT64_,\n                                             npy_api::NPY_UINT64_,\n                                             npy_api::NPY_FLOAT_,\n                                             npy_api::NPY_DOUBLE_,\n                                             npy_api::NPY_LONGDOUBLE_,\n                                             npy_api::NPY_CFLOAT_,\n                                             npy_api::NPY_CDOUBLE_,\n                                             npy_api::NPY_CLONGDOUBLE_};\n\npublic:\n    static constexpr int value = values[detail::is_fmt_numeric<T>::index];\n\n    static pybind11::dtype dtype() {\n        if (auto *ptr = npy_api::get().PyArray_DescrFromType_(value)) {\n            return reinterpret_steal<pybind11::dtype>(ptr);\n        }\n        pybind11_fail(\"Unsupported buffer format!\");\n    }\n};\n\n#define PYBIND11_DECL_CHAR_FMT                                                                    \\\n    static constexpr auto name = const_name(\"S\") + const_name<N>();                               \\\n    static pybind11::dtype dtype() {                                                              \\\n        return pybind11::dtype(std::string(\"S\") + std::to_string(N));                             \\\n    }\ntemplate <size_t N>\nstruct npy_format_descriptor<char[N]> {\n    PYBIND11_DECL_CHAR_FMT\n};\ntemplate <size_t N>\nstruct npy_format_descriptor<std::array<char, N>> {\n    PYBIND11_DECL_CHAR_FMT\n};\n#undef PYBIND11_DECL_CHAR_FMT\n\ntemplate <typename T>\nstruct npy_format_descriptor<T, enable_if_t<array_info<T>::is_array>> {\nprivate:\n    using base_descr = npy_format_descriptor<typename array_info<T>::type>;\n\npublic:\n    static_assert(!array_info<T>::is_empty, \"Zero-sized arrays are not supported\");\n\n    static constexpr auto name\n        = const_name(\"(\") + array_info<T>::extents + const_name(\")\") + base_descr::name;\n    static pybind11::dtype dtype() {\n        list shape;\n        array_info<T>::append_extents(shape);\n        return pybind11::dtype::from_args(\n            pybind11::make_tuple(base_descr::dtype(), std::move(shape)));\n    }\n};\n\ntemplate <typename T>\nstruct npy_format_descriptor<T, enable_if_t<std::is_enum<T>::value>> {\nprivate:\n    using base_descr = npy_format_descriptor<typename std::underlying_type<T>::type>;\n\npublic:\n    static constexpr auto name = base_descr::name;\n    static pybind11::dtype dtype() { return base_descr::dtype(); }\n};\n\nstruct field_descriptor {\n    const char *name;\n    ssize_t offset;\n    ssize_t size;\n    std::string format;\n    dtype descr;\n};\n\nPYBIND11_NOINLINE void register_structured_dtype(any_container<field_descriptor> fields,\n                                                 const std::type_info &tinfo,\n                                                 ssize_t itemsize,\n                                                 bool (*direct_converter)(PyObject *, void *&)) {\n\n    auto &numpy_internals = get_numpy_internals();\n    if (numpy_internals.get_type_info(tinfo, false)) {\n        pybind11_fail(\"NumPy: dtype is already registered\");\n    }\n\n    // Use ordered fields because order matters as of NumPy 1.14:\n    // https://docs.scipy.org/doc/numpy/release.html#multiple-field-indexing-assignment-of-structured-arrays\n    std::vector<field_descriptor> ordered_fields(std::move(fields));\n    std::sort(\n        ordered_fields.begin(),\n        ordered_fields.end(),\n        [](const field_descriptor &a, const field_descriptor &b) { return a.offset < b.offset; });\n\n    list names, formats, offsets;\n    for (auto &field : ordered_fields) {\n        if (!field.descr) {\n            pybind11_fail(std::string(\"NumPy: unsupported field dtype: `\") + field.name + \"` @ \"\n                          + tinfo.name());\n        }\n        names.append(pybind11::str(field.name));\n        formats.append(field.descr);\n        offsets.append(pybind11::int_(field.offset));\n    }\n    auto *dtype_ptr\n        = pybind11::dtype(std::move(names), std::move(formats), std::move(offsets), itemsize)\n              .release()\n              .ptr();\n\n    // There is an existing bug in NumPy (as of v1.11): trailing bytes are\n    // not encoded explicitly into the format string. This will supposedly\n    // get fixed in v1.12; for further details, see these:\n    // - https://github.com/numpy/numpy/issues/7797\n    // - https://github.com/numpy/numpy/pull/7798\n    // Because of this, we won't use numpy's logic to generate buffer format\n    // strings and will just do it ourselves.\n    ssize_t offset = 0;\n    std::ostringstream oss;\n    // mark the structure as unaligned with '^', because numpy and C++ don't\n    // always agree about alignment (particularly for complex), and we're\n    // explicitly listing all our padding. This depends on none of the fields\n    // overriding the endianness. Putting the ^ in front of individual fields\n    // isn't guaranteed to work due to https://github.com/numpy/numpy/issues/9049\n    oss << \"^T{\";\n    for (auto &field : ordered_fields) {\n        if (field.offset > offset) {\n            oss << (field.offset - offset) << 'x';\n        }\n        oss << field.format << ':' << field.name << ':';\n        offset = field.offset + field.size;\n    }\n    if (itemsize > offset) {\n        oss << (itemsize - offset) << 'x';\n    }\n    oss << '}';\n    auto format_str = oss.str();\n\n    // Smoke test: verify that NumPy properly parses our buffer format string\n    auto &api = npy_api::get();\n    auto arr = array(buffer_info(nullptr, itemsize, format_str, 1));\n    if (!api.PyArray_EquivTypes_(dtype_ptr, arr.dtype().ptr())) {\n        pybind11_fail(\"NumPy: invalid buffer descriptor!\");\n    }\n\n    auto tindex = std::type_index(tinfo);\n    numpy_internals.registered_dtypes[tindex] = {dtype_ptr, std::move(format_str)};\n    get_internals().direct_conversions[tindex].push_back(direct_converter);\n}\n\ntemplate <typename T, typename SFINAE>\nstruct npy_format_descriptor {\n    static_assert(is_pod_struct<T>::value,\n                  \"Attempt to use a non-POD or unimplemented POD type as a numpy dtype\");\n\n    static constexpr auto name = make_caster<T>::name;\n\n    static pybind11::dtype dtype() { return reinterpret_borrow<pybind11::dtype>(dtype_ptr()); }\n\n    static std::string format() {\n        static auto format_str = get_numpy_internals().get_type_info<T>(true)->format_str;\n        return format_str;\n    }\n\n    static void register_dtype(any_container<field_descriptor> fields) {\n        register_structured_dtype(std::move(fields),\n                                  typeid(typename std::remove_cv<T>::type),\n                                  sizeof(T),\n                                  &direct_converter);\n    }\n\nprivate:\n    static PyObject *dtype_ptr() {\n        static PyObject *ptr = get_numpy_internals().get_type_info<T>(true)->dtype_ptr;\n        return ptr;\n    }\n\n    static bool direct_converter(PyObject *obj, void *&value) {\n        auto &api = npy_api::get();\n        if (!PyObject_TypeCheck(obj, api.PyVoidArrType_Type_)) {\n            return false;\n        }\n        if (auto descr = reinterpret_steal<object>(api.PyArray_DescrFromScalar_(obj))) {\n            if (api.PyArray_EquivTypes_(dtype_ptr(), descr.ptr())) {\n                value = ((PyVoidScalarObject_Proxy *) obj)->obval;\n                return true;\n            }\n        }\n        return false;\n    }\n};\n\n#ifdef __CLION_IDE__ // replace heavy macro with dummy code for the IDE (doesn't affect code)\n#    define PYBIND11_NUMPY_DTYPE(Type, ...) ((void) 0)\n#    define PYBIND11_NUMPY_DTYPE_EX(Type, ...) ((void) 0)\n#else\n\n#    define PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, Name)                                          \\\n        ::pybind11::detail::field_descriptor {                                                    \\\n            Name, offsetof(T, Field), sizeof(decltype(std::declval<T>().Field)),                  \\\n                ::pybind11::format_descriptor<decltype(std::declval<T>().Field)>::format(),       \\\n                ::pybind11::detail::npy_format_descriptor<                                        \\\n                    decltype(std::declval<T>().Field)>::dtype()                                   \\\n        }\n\n// Extract name, offset and format descriptor for a struct field\n#    define PYBIND11_FIELD_DESCRIPTOR(T, Field) PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, #Field)\n\n// The main idea of this macro is borrowed from https://github.com/swansontec/map-macro\n// (C) William Swanson, Paul Fultz\n#    define PYBIND11_EVAL0(...) __VA_ARGS__\n#    define PYBIND11_EVAL1(...) PYBIND11_EVAL0(PYBIND11_EVAL0(PYBIND11_EVAL0(__VA_ARGS__)))\n#    define PYBIND11_EVAL2(...) PYBIND11_EVAL1(PYBIND11_EVAL1(PYBIND11_EVAL1(__VA_ARGS__)))\n#    define PYBIND11_EVAL3(...) PYBIND11_EVAL2(PYBIND11_EVAL2(PYBIND11_EVAL2(__VA_ARGS__)))\n#    define PYBIND11_EVAL4(...) PYBIND11_EVAL3(PYBIND11_EVAL3(PYBIND11_EVAL3(__VA_ARGS__)))\n#    define PYBIND11_EVAL(...) PYBIND11_EVAL4(PYBIND11_EVAL4(PYBIND11_EVAL4(__VA_ARGS__)))\n#    define PYBIND11_MAP_END(...)\n#    define PYBIND11_MAP_OUT\n#    define PYBIND11_MAP_COMMA ,\n#    define PYBIND11_MAP_GET_END() 0, PYBIND11_MAP_END\n#    define PYBIND11_MAP_NEXT0(test, next, ...) next PYBIND11_MAP_OUT\n#    define PYBIND11_MAP_NEXT1(test, next) PYBIND11_MAP_NEXT0(test, next, 0)\n#    define PYBIND11_MAP_NEXT(test, next) PYBIND11_MAP_NEXT1(PYBIND11_MAP_GET_END test, next)\n#    if defined(_MSC_VER)                                                                         \\\n        && !defined(__clang__) // MSVC is not as eager to expand macros, hence this workaround\n#        define PYBIND11_MAP_LIST_NEXT1(test, next)                                               \\\n            PYBIND11_EVAL0(PYBIND11_MAP_NEXT0(test, PYBIND11_MAP_COMMA next, 0))\n#    else\n#        define PYBIND11_MAP_LIST_NEXT1(test, next)                                               \\\n            PYBIND11_MAP_NEXT0(test, PYBIND11_MAP_COMMA next, 0)\n#    endif\n#    define PYBIND11_MAP_LIST_NEXT(test, next)                                                    \\\n        PYBIND11_MAP_LIST_NEXT1(PYBIND11_MAP_GET_END test, next)\n#    define PYBIND11_MAP_LIST0(f, t, x, peek, ...)                                                \\\n        f(t, x) PYBIND11_MAP_LIST_NEXT(peek, PYBIND11_MAP_LIST1)(f, t, peek, __VA_ARGS__)\n#    define PYBIND11_MAP_LIST1(f, t, x, peek, ...)                                                \\\n        f(t, x) PYBIND11_MAP_LIST_NEXT(peek, PYBIND11_MAP_LIST0)(f, t, peek, __VA_ARGS__)\n// PYBIND11_MAP_LIST(f, t, a1, a2, ...) expands to f(t, a1), f(t, a2), ...\n#    define PYBIND11_MAP_LIST(f, t, ...)                                                          \\\n        PYBIND11_EVAL(PYBIND11_MAP_LIST1(f, t, __VA_ARGS__, (), 0))\n\n#    define PYBIND11_NUMPY_DTYPE(Type, ...)                                                       \\\n        ::pybind11::detail::npy_format_descriptor<Type>::register_dtype(                          \\\n            ::std::vector<::pybind11::detail::field_descriptor>{                                  \\\n                PYBIND11_MAP_LIST(PYBIND11_FIELD_DESCRIPTOR, Type, __VA_ARGS__)})\n\n#    if defined(_MSC_VER) && !defined(__clang__)\n#        define PYBIND11_MAP2_LIST_NEXT1(test, next)                                              \\\n            PYBIND11_EVAL0(PYBIND11_MAP_NEXT0(test, PYBIND11_MAP_COMMA next, 0))\n#    else\n#        define PYBIND11_MAP2_LIST_NEXT1(test, next)                                              \\\n            PYBIND11_MAP_NEXT0(test, PYBIND11_MAP_COMMA next, 0)\n#    endif\n#    define PYBIND11_MAP2_LIST_NEXT(test, next)                                                   \\\n        PYBIND11_MAP2_LIST_NEXT1(PYBIND11_MAP_GET_END test, next)\n#    define PYBIND11_MAP2_LIST0(f, t, x1, x2, peek, ...)                                          \\\n        f(t, x1, x2) PYBIND11_MAP2_LIST_NEXT(peek, PYBIND11_MAP2_LIST1)(f, t, peek, __VA_ARGS__)\n#    define PYBIND11_MAP2_LIST1(f, t, x1, x2, peek, ...)                                          \\\n        f(t, x1, x2) PYBIND11_MAP2_LIST_NEXT(peek, PYBIND11_MAP2_LIST0)(f, t, peek, __VA_ARGS__)\n// PYBIND11_MAP2_LIST(f, t, a1, a2, ...) expands to f(t, a1, a2), f(t, a3, a4), ...\n#    define PYBIND11_MAP2_LIST(f, t, ...)                                                         \\\n        PYBIND11_EVAL(PYBIND11_MAP2_LIST1(f, t, __VA_ARGS__, (), 0))\n\n#    define PYBIND11_NUMPY_DTYPE_EX(Type, ...)                                                    \\\n        ::pybind11::detail::npy_format_descriptor<Type>::register_dtype(                          \\\n            ::std::vector<::pybind11::detail::field_descriptor>{                                  \\\n                PYBIND11_MAP2_LIST(PYBIND11_FIELD_DESCRIPTOR_EX, Type, __VA_ARGS__)})\n\n#endif // __CLION_IDE__\n\nclass common_iterator {\npublic:\n    using container_type = std::vector<ssize_t>;\n    using value_type = container_type::value_type;\n    using size_type = container_type::size_type;\n\n    common_iterator() : m_strides() {}\n\n    common_iterator(void *ptr, const container_type &strides, const container_type &shape)\n        : p_ptr(reinterpret_cast<char *>(ptr)), m_strides(strides.size()) {\n        m_strides.back() = static_cast<value_type>(strides.back());\n        for (size_type i = m_strides.size() - 1; i != 0; --i) {\n            size_type j = i - 1;\n            auto s = static_cast<value_type>(shape[i]);\n            m_strides[j] = strides[j] + m_strides[i] - strides[i] * s;\n        }\n    }\n\n    void increment(size_type dim) { p_ptr += m_strides[dim]; }\n\n    void *data() const { return p_ptr; }\n\nprivate:\n    char *p_ptr{nullptr};\n    container_type m_strides;\n};\n\ntemplate <size_t N>\nclass multi_array_iterator {\npublic:\n    using container_type = std::vector<ssize_t>;\n\n    multi_array_iterator(const std::array<buffer_info, N> &buffers, const container_type &shape)\n        : m_shape(shape.size()), m_index(shape.size(), 0), m_common_iterator() {\n\n        // Manual copy to avoid conversion warning if using std::copy\n        for (size_t i = 0; i < shape.size(); ++i) {\n            m_shape[i] = shape[i];\n        }\n\n        container_type strides(shape.size());\n        for (size_t i = 0; i < N; ++i) {\n            init_common_iterator(buffers[i], shape, m_common_iterator[i], strides);\n        }\n    }\n\n    multi_array_iterator &operator++() {\n        for (size_t j = m_index.size(); j != 0; --j) {\n            size_t i = j - 1;\n            if (++m_index[i] != m_shape[i]) {\n                increment_common_iterator(i);\n                break;\n            }\n            m_index[i] = 0;\n        }\n        return *this;\n    }\n\n    template <size_t K, class T = void>\n    T *data() const {\n        return reinterpret_cast<T *>(m_common_iterator[K].data());\n    }\n\nprivate:\n    using common_iter = common_iterator;\n\n    void init_common_iterator(const buffer_info &buffer,\n                              const container_type &shape,\n                              common_iter &iterator,\n                              container_type &strides) {\n        auto buffer_shape_iter = buffer.shape.rbegin();\n        auto buffer_strides_iter = buffer.strides.rbegin();\n        auto shape_iter = shape.rbegin();\n        auto strides_iter = strides.rbegin();\n\n        while (buffer_shape_iter != buffer.shape.rend()) {\n            if (*shape_iter == *buffer_shape_iter) {\n                *strides_iter = *buffer_strides_iter;\n            } else {\n                *strides_iter = 0;\n            }\n\n            ++buffer_shape_iter;\n            ++buffer_strides_iter;\n            ++shape_iter;\n            ++strides_iter;\n        }\n\n        std::fill(strides_iter, strides.rend(), 0);\n        iterator = common_iter(buffer.ptr, strides, shape);\n    }\n\n    void increment_common_iterator(size_t dim) {\n        for (auto &iter : m_common_iterator) {\n            iter.increment(dim);\n        }\n    }\n\n    container_type m_shape;\n    container_type m_index;\n    std::array<common_iter, N> m_common_iterator;\n};\n\nenum class broadcast_trivial { non_trivial, c_trivial, f_trivial };\n\n// Populates the shape and number of dimensions for the set of buffers.  Returns a\n// broadcast_trivial enum value indicating whether the broadcast is \"trivial\"--that is, has each\n// buffer being either a singleton or a full-size, C-contiguous (`c_trivial`) or Fortran-contiguous\n// (`f_trivial`) storage buffer; returns `non_trivial` otherwise.\ntemplate <size_t N>\nbroadcast_trivial\nbroadcast(const std::array<buffer_info, N> &buffers, ssize_t &ndim, std::vector<ssize_t> &shape) {\n    ndim = std::accumulate(\n        buffers.begin(), buffers.end(), ssize_t(0), [](ssize_t res, const buffer_info &buf) {\n            return std::max(res, buf.ndim);\n        });\n\n    shape.clear();\n    shape.resize((size_t) ndim, 1);\n\n    // Figure out the output size, and make sure all input arrays conform (i.e. are either size 1\n    // or the full size).\n    for (size_t i = 0; i < N; ++i) {\n        auto res_iter = shape.rbegin();\n        auto end = buffers[i].shape.rend();\n        for (auto shape_iter = buffers[i].shape.rbegin(); shape_iter != end;\n             ++shape_iter, ++res_iter) {\n            const auto &dim_size_in = *shape_iter;\n            auto &dim_size_out = *res_iter;\n\n            // Each input dimension can either be 1 or `n`, but `n` values must match across\n            // buffers\n            if (dim_size_out == 1) {\n                dim_size_out = dim_size_in;\n            } else if (dim_size_in != 1 && dim_size_in != dim_size_out) {\n                pybind11_fail(\"pybind11::vectorize: incompatible size/dimension of inputs!\");\n            }\n        }\n    }\n\n    bool trivial_broadcast_c = true;\n    bool trivial_broadcast_f = true;\n    for (size_t i = 0; i < N && (trivial_broadcast_c || trivial_broadcast_f); ++i) {\n        if (buffers[i].size == 1) {\n            continue;\n        }\n\n        // Require the same number of dimensions:\n        if (buffers[i].ndim != ndim) {\n            return broadcast_trivial::non_trivial;\n        }\n\n        // Require all dimensions be full-size:\n        if (!std::equal(buffers[i].shape.cbegin(), buffers[i].shape.cend(), shape.cbegin())) {\n            return broadcast_trivial::non_trivial;\n        }\n\n        // Check for C contiguity (but only if previous inputs were also C contiguous)\n        if (trivial_broadcast_c) {\n            ssize_t expect_stride = buffers[i].itemsize;\n            auto end = buffers[i].shape.crend();\n            for (auto shape_iter = buffers[i].shape.crbegin(),\n                      stride_iter = buffers[i].strides.crbegin();\n                 trivial_broadcast_c && shape_iter != end;\n                 ++shape_iter, ++stride_iter) {\n                if (expect_stride == *stride_iter) {\n                    expect_stride *= *shape_iter;\n                } else {\n                    trivial_broadcast_c = false;\n                }\n            }\n        }\n\n        // Check for Fortran contiguity (if previous inputs were also F contiguous)\n        if (trivial_broadcast_f) {\n            ssize_t expect_stride = buffers[i].itemsize;\n            auto end = buffers[i].shape.cend();\n            for (auto shape_iter = buffers[i].shape.cbegin(),\n                      stride_iter = buffers[i].strides.cbegin();\n                 trivial_broadcast_f && shape_iter != end;\n                 ++shape_iter, ++stride_iter) {\n                if (expect_stride == *stride_iter) {\n                    expect_stride *= *shape_iter;\n                } else {\n                    trivial_broadcast_f = false;\n                }\n            }\n        }\n    }\n\n    return trivial_broadcast_c   ? broadcast_trivial::c_trivial\n           : trivial_broadcast_f ? broadcast_trivial::f_trivial\n                                 : broadcast_trivial::non_trivial;\n}\n\ntemplate <typename T>\nstruct vectorize_arg {\n    static_assert(!std::is_rvalue_reference<T>::value,\n                  \"Functions with rvalue reference arguments cannot be vectorized\");\n    // The wrapped function gets called with this type:\n    using call_type = remove_reference_t<T>;\n    // Is this a vectorized argument?\n    static constexpr bool vectorize\n        = satisfies_any_of<call_type, std::is_arithmetic, is_complex, is_pod>::value\n          && satisfies_none_of<call_type,\n                               std::is_pointer,\n                               std::is_array,\n                               is_std_array,\n                               std::is_enum>::value\n          && (!std::is_reference<T>::value\n              || (std::is_lvalue_reference<T>::value && std::is_const<call_type>::value));\n    // Accept this type: an array for vectorized types, otherwise the type as-is:\n    using type = conditional_t<vectorize, array_t<remove_cv_t<call_type>, array::forcecast>, T>;\n};\n\n// py::vectorize when a return type is present\ntemplate <typename Func, typename Return, typename... Args>\nstruct vectorize_returned_array {\n    using Type = array_t<Return>;\n\n    static Type create(broadcast_trivial trivial, const std::vector<ssize_t> &shape) {\n        if (trivial == broadcast_trivial::f_trivial) {\n            return array_t<Return, array::f_style>(shape);\n        }\n        return array_t<Return>(shape);\n    }\n\n    static Return *mutable_data(Type &array) { return array.mutable_data(); }\n\n    static Return call(Func &f, Args &...args) { return f(args...); }\n\n    static void call(Return *out, size_t i, Func &f, Args &...args) { out[i] = f(args...); }\n};\n\n// py::vectorize when a return type is not present\ntemplate <typename Func, typename... Args>\nstruct vectorize_returned_array<Func, void, Args...> {\n    using Type = none;\n\n    static Type create(broadcast_trivial, const std::vector<ssize_t> &) { return none(); }\n\n    static void *mutable_data(Type &) { return nullptr; }\n\n    static detail::void_type call(Func &f, Args &...args) {\n        f(args...);\n        return {};\n    }\n\n    static void call(void *, size_t, Func &f, Args &...args) { f(args...); }\n};\n\ntemplate <typename Func, typename Return, typename... Args>\nstruct vectorize_helper {\n\n// NVCC for some reason breaks if NVectorized is private\n#ifdef __CUDACC__\npublic:\n#else\nprivate:\n#endif\n\n    static constexpr size_t N = sizeof...(Args);\n    static constexpr size_t NVectorized = constexpr_sum(vectorize_arg<Args>::vectorize...);\n    static_assert(\n        NVectorized >= 1,\n        \"pybind11::vectorize(...) requires a function with at least one vectorizable argument\");\n\npublic:\n    template <typename T,\n              // SFINAE to prevent shadowing the copy constructor.\n              typename = detail::enable_if_t<\n                  !std::is_same<vectorize_helper, typename std::decay<T>::type>::value>>\n    explicit vectorize_helper(T &&f) : f(std::forward<T>(f)) {}\n\n    object operator()(typename vectorize_arg<Args>::type... args) {\n        return run(args...,\n                   make_index_sequence<N>(),\n                   select_indices<vectorize_arg<Args>::vectorize...>(),\n                   make_index_sequence<NVectorized>());\n    }\n\nprivate:\n    remove_reference_t<Func> f;\n\n    // Internal compiler error in MSVC 19.16.27025.1 (Visual Studio 2017 15.9.4), when compiling\n    // with \"/permissive-\" flag when arg_call_types is manually inlined.\n    using arg_call_types = std::tuple<typename vectorize_arg<Args>::call_type...>;\n    template <size_t Index>\n    using param_n_t = typename std::tuple_element<Index, arg_call_types>::type;\n\n    using returned_array = vectorize_returned_array<Func, Return, Args...>;\n\n    // Runs a vectorized function given arguments tuple and three index sequences:\n    //     - Index is the full set of 0 ... (N-1) argument indices;\n    //     - VIndex is the subset of argument indices with vectorized parameters, letting us access\n    //       vectorized arguments (anything not in this sequence is passed through)\n    //     - BIndex is a incremental sequence (beginning at 0) of the same size as VIndex, so that\n    //       we can store vectorized buffer_infos in an array (argument VIndex has its buffer at\n    //       index BIndex in the array).\n    template <size_t... Index, size_t... VIndex, size_t... BIndex>\n    object run(typename vectorize_arg<Args>::type &...args,\n               index_sequence<Index...> i_seq,\n               index_sequence<VIndex...> vi_seq,\n               index_sequence<BIndex...> bi_seq) {\n\n        // Pointers to values the function was called with; the vectorized ones set here will start\n        // out as array_t<T> pointers, but they will be changed them to T pointers before we make\n        // call the wrapped function.  Non-vectorized pointers are left as-is.\n        std::array<void *, N> params{{&args...}};\n\n        // The array of `buffer_info`s of vectorized arguments:\n        std::array<buffer_info, NVectorized> buffers{\n            {reinterpret_cast<array *>(params[VIndex])->request()...}};\n\n        /* Determine dimensions parameters of output array */\n        ssize_t nd = 0;\n        std::vector<ssize_t> shape(0);\n        auto trivial = broadcast(buffers, nd, shape);\n        auto ndim = (size_t) nd;\n\n        size_t size\n            = std::accumulate(shape.begin(), shape.end(), (size_t) 1, std::multiplies<size_t>());\n\n        // If all arguments are 0-dimension arrays (i.e. single values) return a plain value (i.e.\n        // not wrapped in an array).\n        if (size == 1 && ndim == 0) {\n            PYBIND11_EXPAND_SIDE_EFFECTS(params[VIndex] = buffers[BIndex].ptr);\n            return cast(\n                returned_array::call(f, *reinterpret_cast<param_n_t<Index> *>(params[Index])...));\n        }\n\n        auto result = returned_array::create(trivial, shape);\n\n        PYBIND11_WARNING_PUSH\n#ifdef PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING\n        PYBIND11_WARNING_DISABLE_CLANG(\"-Wreturn-std-move\")\n#endif\n\n        if (size == 0) {\n            return result;\n        }\n\n        /* Call the function */\n        auto *mutable_data = returned_array::mutable_data(result);\n        if (trivial == broadcast_trivial::non_trivial) {\n            apply_broadcast(buffers, params, mutable_data, size, shape, i_seq, vi_seq, bi_seq);\n        } else {\n            apply_trivial(buffers, params, mutable_data, size, i_seq, vi_seq, bi_seq);\n        }\n\n        return result;\n        PYBIND11_WARNING_POP\n    }\n\n    template <size_t... Index, size_t... VIndex, size_t... BIndex>\n    void apply_trivial(std::array<buffer_info, NVectorized> &buffers,\n                       std::array<void *, N> &params,\n                       Return *out,\n                       size_t size,\n                       index_sequence<Index...>,\n                       index_sequence<VIndex...>,\n                       index_sequence<BIndex...>) {\n\n        // Initialize an array of mutable byte references and sizes with references set to the\n        // appropriate pointer in `params`; as we iterate, we'll increment each pointer by its size\n        // (except for singletons, which get an increment of 0).\n        std::array<std::pair<unsigned char *&, const size_t>, NVectorized> vecparams{\n            {std::pair<unsigned char *&, const size_t>(\n                reinterpret_cast<unsigned char *&>(params[VIndex] = buffers[BIndex].ptr),\n                buffers[BIndex].size == 1 ? 0 : sizeof(param_n_t<VIndex>))...}};\n\n        for (size_t i = 0; i < size; ++i) {\n            returned_array::call(\n                out, i, f, *reinterpret_cast<param_n_t<Index> *>(params[Index])...);\n            for (auto &x : vecparams) {\n                x.first += x.second;\n            }\n        }\n    }\n\n    template <size_t... Index, size_t... VIndex, size_t... BIndex>\n    void apply_broadcast(std::array<buffer_info, NVectorized> &buffers,\n                         std::array<void *, N> &params,\n                         Return *out,\n                         size_t size,\n                         const std::vector<ssize_t> &output_shape,\n                         index_sequence<Index...>,\n                         index_sequence<VIndex...>,\n                         index_sequence<BIndex...>) {\n\n        multi_array_iterator<NVectorized> input_iter(buffers, output_shape);\n\n        for (size_t i = 0; i < size; ++i, ++input_iter) {\n            PYBIND11_EXPAND_SIDE_EFFECTS((params[VIndex] = input_iter.template data<BIndex>()));\n            returned_array::call(\n                out, i, f, *reinterpret_cast<param_n_t<Index> *>(std::get<Index>(params))...);\n        }\n    }\n};\n\ntemplate <typename Func, typename Return, typename... Args>\nvectorize_helper<Func, Return, Args...> vectorize_extractor(const Func &f, Return (*)(Args...)) {\n    return detail::vectorize_helper<Func, Return, Args...>(f);\n}\n\ntemplate <typename T, int Flags>\nstruct handle_type_name<array_t<T, Flags>> {\n    static constexpr auto name\n        = const_name(\"numpy.ndarray[\") + npy_format_descriptor<T>::name + const_name(\"]\");\n};\n\nPYBIND11_NAMESPACE_END(detail)\n\n// Vanilla pointer vectorizer:\ntemplate <typename Return, typename... Args>\ndetail::vectorize_helper<Return (*)(Args...), Return, Args...> vectorize(Return (*f)(Args...)) {\n    return detail::vectorize_helper<Return (*)(Args...), Return, Args...>(f);\n}\n\n// lambda vectorizer:\ntemplate <typename Func, detail::enable_if_t<detail::is_lambda<Func>::value, int> = 0>\nauto vectorize(Func &&f)\n    -> decltype(detail::vectorize_extractor(std::forward<Func>(f),\n                                            (detail::function_signature_t<Func> *) nullptr)) {\n    return detail::vectorize_extractor(std::forward<Func>(f),\n                                       (detail::function_signature_t<Func> *) nullptr);\n}\n\n// Vectorize a class method (non-const):\ntemplate <typename Return,\n          typename Class,\n          typename... Args,\n          typename Helper = detail::vectorize_helper<\n              decltype(std::mem_fn(std::declval<Return (Class::*)(Args...)>())),\n              Return,\n              Class *,\n              Args...>>\nHelper vectorize(Return (Class::*f)(Args...)) {\n    return Helper(std::mem_fn(f));\n}\n\n// Vectorize a class method (const):\ntemplate <typename Return,\n          typename Class,\n          typename... Args,\n          typename Helper = detail::vectorize_helper<\n              decltype(std::mem_fn(std::declval<Return (Class::*)(Args...) const>())),\n              Return,\n              const Class *,\n              Args...>>\nHelper vectorize(Return (Class::*f)(Args...) const) {\n    return Helper(std::mem_fn(f));\n}\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/operators.h",
    "content": "/*\n    pybind11/operator.h: Metatemplates for operator overloading\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"pybind11.h\"\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n/// Enumeration with all supported operator types\nenum op_id : int {\n    op_add,\n    op_sub,\n    op_mul,\n    op_div,\n    op_mod,\n    op_divmod,\n    op_pow,\n    op_lshift,\n    op_rshift,\n    op_and,\n    op_xor,\n    op_or,\n    op_neg,\n    op_pos,\n    op_abs,\n    op_invert,\n    op_int,\n    op_long,\n    op_float,\n    op_str,\n    op_cmp,\n    op_gt,\n    op_ge,\n    op_lt,\n    op_le,\n    op_eq,\n    op_ne,\n    op_iadd,\n    op_isub,\n    op_imul,\n    op_idiv,\n    op_imod,\n    op_ilshift,\n    op_irshift,\n    op_iand,\n    op_ixor,\n    op_ior,\n    op_complex,\n    op_bool,\n    op_nonzero,\n    op_repr,\n    op_truediv,\n    op_itruediv,\n    op_hash\n};\n\nenum op_type : int {\n    op_l, /* base type on left */\n    op_r, /* base type on right */\n    op_u  /* unary operator */\n};\n\nstruct self_t {};\nstatic const self_t self = self_t();\n\n/// Type for an unused type slot\nstruct undefined_t {};\n\n/// Don't warn about an unused variable\ninline self_t __self() { return self; }\n\n/// base template of operator implementations\ntemplate <op_id, op_type, typename B, typename L, typename R>\nstruct op_impl {};\n\n/// Operator implementation generator\ntemplate <op_id id, op_type ot, typename L, typename R>\nstruct op_ {\n    static constexpr bool op_enable_if_hook = true;\n    template <typename Class, typename... Extra>\n    void execute(Class &cl, const Extra &...extra) const {\n        using Base = typename Class::type;\n        using L_type = conditional_t<std::is_same<L, self_t>::value, Base, L>;\n        using R_type = conditional_t<std::is_same<R, self_t>::value, Base, R>;\n        using op = op_impl<id, ot, Base, L_type, R_type>;\n        cl.def(op::name(), &op::execute, is_operator(), extra...);\n    }\n    template <typename Class, typename... Extra>\n    void execute_cast(Class &cl, const Extra &...extra) const {\n        using Base = typename Class::type;\n        using L_type = conditional_t<std::is_same<L, self_t>::value, Base, L>;\n        using R_type = conditional_t<std::is_same<R, self_t>::value, Base, R>;\n        using op = op_impl<id, ot, Base, L_type, R_type>;\n        cl.def(op::name(), &op::execute_cast, is_operator(), extra...);\n    }\n};\n\n#define PYBIND11_BINARY_OPERATOR(id, rid, op, expr)                                               \\\n    template <typename B, typename L, typename R>                                                 \\\n    struct op_impl<op_##id, op_l, B, L, R> {                                                      \\\n        static char const *name() { return \"__\" #id \"__\"; }                                       \\\n        static auto execute(const L &l, const R &r) -> decltype(expr) { return (expr); }          \\\n        static B execute_cast(const L &l, const R &r) { return B(expr); }                         \\\n    };                                                                                            \\\n    template <typename B, typename L, typename R>                                                 \\\n    struct op_impl<op_##id, op_r, B, L, R> {                                                      \\\n        static char const *name() { return \"__\" #rid \"__\"; }                                      \\\n        static auto execute(const R &r, const L &l) -> decltype(expr) { return (expr); }          \\\n        static B execute_cast(const R &r, const L &l) { return B(expr); }                         \\\n    };                                                                                            \\\n    inline op_<op_##id, op_l, self_t, self_t> op(const self_t &, const self_t &) {                \\\n        return op_<op_##id, op_l, self_t, self_t>();                                              \\\n    }                                                                                             \\\n    template <typename T>                                                                         \\\n    op_<op_##id, op_l, self_t, T> op(const self_t &, const T &) {                                 \\\n        return op_<op_##id, op_l, self_t, T>();                                                   \\\n    }                                                                                             \\\n    template <typename T>                                                                         \\\n    op_<op_##id, op_r, T, self_t> op(const T &, const self_t &) {                                 \\\n        return op_<op_##id, op_r, T, self_t>();                                                   \\\n    }\n\n#define PYBIND11_INPLACE_OPERATOR(id, op, expr)                                                   \\\n    template <typename B, typename L, typename R>                                                 \\\n    struct op_impl<op_##id, op_l, B, L, R> {                                                      \\\n        static char const *name() { return \"__\" #id \"__\"; }                                       \\\n        static auto execute(L &l, const R &r) -> decltype(expr) { return expr; }                  \\\n        static B execute_cast(L &l, const R &r) { return B(expr); }                               \\\n    };                                                                                            \\\n    template <typename T>                                                                         \\\n    op_<op_##id, op_l, self_t, T> op(const self_t &, const T &) {                                 \\\n        return op_<op_##id, op_l, self_t, T>();                                                   \\\n    }\n\n#define PYBIND11_UNARY_OPERATOR(id, op, expr)                                                     \\\n    template <typename B, typename L>                                                             \\\n    struct op_impl<op_##id, op_u, B, L, undefined_t> {                                            \\\n        static char const *name() { return \"__\" #id \"__\"; }                                       \\\n        static auto execute(const L &l) -> decltype(expr) { return expr; }                        \\\n        static B execute_cast(const L &l) { return B(expr); }                                     \\\n    };                                                                                            \\\n    inline op_<op_##id, op_u, self_t, undefined_t> op(const self_t &) {                           \\\n        return op_<op_##id, op_u, self_t, undefined_t>();                                         \\\n    }\n\nPYBIND11_BINARY_OPERATOR(sub, rsub, operator-, l - r)\nPYBIND11_BINARY_OPERATOR(add, radd, operator+, l + r)\nPYBIND11_BINARY_OPERATOR(mul, rmul, operator*, l *r)\nPYBIND11_BINARY_OPERATOR(truediv, rtruediv, operator/, l / r)\nPYBIND11_BINARY_OPERATOR(mod, rmod, operator%, l % r)\nPYBIND11_BINARY_OPERATOR(lshift, rlshift, operator<<, l << r)\nPYBIND11_BINARY_OPERATOR(rshift, rrshift, operator>>, l >> r)\nPYBIND11_BINARY_OPERATOR(and, rand, operator&, l &r)\nPYBIND11_BINARY_OPERATOR(xor, rxor, operator^, l ^ r)\nPYBIND11_BINARY_OPERATOR(eq, eq, operator==, l == r)\nPYBIND11_BINARY_OPERATOR(ne, ne, operator!=, l != r)\nPYBIND11_BINARY_OPERATOR(or, ror, operator|, l | r)\nPYBIND11_BINARY_OPERATOR(gt, lt, operator>, l > r)\nPYBIND11_BINARY_OPERATOR(ge, le, operator>=, l >= r)\nPYBIND11_BINARY_OPERATOR(lt, gt, operator<, l < r)\nPYBIND11_BINARY_OPERATOR(le, ge, operator<=, l <= r)\n// PYBIND11_BINARY_OPERATOR(pow,       rpow,         pow,          std::pow(l,  r))\nPYBIND11_INPLACE_OPERATOR(iadd, operator+=, l += r)\nPYBIND11_INPLACE_OPERATOR(isub, operator-=, l -= r)\nPYBIND11_INPLACE_OPERATOR(imul, operator*=, l *= r)\nPYBIND11_INPLACE_OPERATOR(itruediv, operator/=, l /= r)\nPYBIND11_INPLACE_OPERATOR(imod, operator%=, l %= r)\nPYBIND11_INPLACE_OPERATOR(ilshift, operator<<=, l <<= r)\nPYBIND11_INPLACE_OPERATOR(irshift, operator>>=, l >>= r)\nPYBIND11_INPLACE_OPERATOR(iand, operator&=, l &= r)\nPYBIND11_INPLACE_OPERATOR(ixor, operator^=, l ^= r)\nPYBIND11_INPLACE_OPERATOR(ior, operator|=, l |= r)\nPYBIND11_UNARY_OPERATOR(neg, operator-, -l)\nPYBIND11_UNARY_OPERATOR(pos, operator+, +l)\n// WARNING: This usage of `abs` should only be done for existing STL overloads.\n// Adding overloads directly in to the `std::` namespace is advised against:\n// https://en.cppreference.com/w/cpp/language/extending_std\nPYBIND11_UNARY_OPERATOR(abs, abs, std::abs(l))\nPYBIND11_UNARY_OPERATOR(hash, hash, std::hash<L>()(l))\nPYBIND11_UNARY_OPERATOR(invert, operator~, (~l))\nPYBIND11_UNARY_OPERATOR(bool, operator!, !!l)\nPYBIND11_UNARY_OPERATOR(int, int_, (int) l)\nPYBIND11_UNARY_OPERATOR(float, float_, (double) l)\n\n#undef PYBIND11_BINARY_OPERATOR\n#undef PYBIND11_INPLACE_OPERATOR\n#undef PYBIND11_UNARY_OPERATOR\nPYBIND11_NAMESPACE_END(detail)\n\nusing detail::self;\n// Add named operators so that they are accessible via `py::`.\nusing detail::hash;\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/options.h",
    "content": "/*\n    pybind11/options.h: global settings that are configurable at runtime.\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"detail/common.h\"\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nclass options {\npublic:\n    // Default RAII constructor, which leaves settings as they currently are.\n    options() : previous_state(global_state()) {}\n\n    // Class is non-copyable.\n    options(const options &) = delete;\n    options &operator=(const options &) = delete;\n\n    // Destructor, which restores settings that were in effect before.\n    ~options() { global_state() = previous_state; }\n\n    // Setter methods (affect the global state):\n\n    options &disable_user_defined_docstrings() & {\n        global_state().show_user_defined_docstrings = false;\n        return *this;\n    }\n\n    options &enable_user_defined_docstrings() & {\n        global_state().show_user_defined_docstrings = true;\n        return *this;\n    }\n\n    options &disable_function_signatures() & {\n        global_state().show_function_signatures = false;\n        return *this;\n    }\n\n    options &enable_function_signatures() & {\n        global_state().show_function_signatures = true;\n        return *this;\n    }\n\n    options &disable_enum_members_docstring() & {\n        global_state().show_enum_members_docstring = false;\n        return *this;\n    }\n\n    options &enable_enum_members_docstring() & {\n        global_state().show_enum_members_docstring = true;\n        return *this;\n    }\n\n    // Getter methods (return the global state):\n\n    static bool show_user_defined_docstrings() {\n        return global_state().show_user_defined_docstrings;\n    }\n\n    static bool show_function_signatures() { return global_state().show_function_signatures; }\n\n    static bool show_enum_members_docstring() {\n        return global_state().show_enum_members_docstring;\n    }\n\n    // This type is not meant to be allocated on the heap.\n    void *operator new(size_t) = delete;\n\nprivate:\n    struct state {\n        bool show_user_defined_docstrings = true; //< Include user-supplied texts in docstrings.\n        bool show_function_signatures = true;     //< Include auto-generated function signatures\n                                                  //  in docstrings.\n        bool show_enum_members_docstring = true;  //< Include auto-generated member list in enum\n                                                  //  docstrings.\n    };\n\n    static state &global_state() {\n        static state instance;\n        return instance;\n    }\n\n    state previous_state;\n};\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/pybind11.h",
    "content": "/*\n    pybind11/pybind11.h: Main header file of the C++11 python\n    binding generator library\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"detail/class.h\"\n#include \"detail/init.h\"\n#include \"attr.h\"\n#include \"gil.h\"\n#include \"options.h\"\n\n#include <cstdlib>\n#include <cstring>\n#include <memory>\n#include <new>\n#include <string>\n#include <utility>\n#include <vector>\n\n#if defined(__cpp_lib_launder) && !(defined(_MSC_VER) && (_MSC_VER < 1914))\n#    define PYBIND11_STD_LAUNDER std::launder\n#    define PYBIND11_HAS_STD_LAUNDER 1\n#else\n#    define PYBIND11_STD_LAUNDER\n#    define PYBIND11_HAS_STD_LAUNDER 0\n#endif\n#if defined(__GNUG__) && !defined(__clang__)\n#    include <cxxabi.h>\n#endif\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\n/* https://stackoverflow.com/questions/46798456/handling-gccs-noexcept-type-warning\n   This warning is about ABI compatibility, not code health.\n   It is only actually needed in a couple places, but apparently GCC 7 \"generates this warning if\n   and only if the first template instantiation ... involves noexcept\" [stackoverflow], therefore\n   it could get triggered from seemingly random places, depending on user code.\n   No other GCC version generates this warning.\n */\n#if defined(__GNUC__) && __GNUC__ == 7\nPYBIND11_WARNING_DISABLE_GCC(\"-Wnoexcept-type\")\n#endif\n\nPYBIND11_WARNING_DISABLE_MSVC(4127)\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n// Apply all the extensions translators from a list\n// Return true if one of the translators completed without raising an exception\n// itself. Return of false indicates that if there are other translators\n// available, they should be tried.\ninline bool apply_exception_translators(std::forward_list<ExceptionTranslator> &translators) {\n    auto last_exception = std::current_exception();\n\n    for (auto &translator : translators) {\n        try {\n            translator(last_exception);\n            return true;\n        } catch (...) {\n            last_exception = std::current_exception();\n        }\n    }\n    return false;\n}\n\n#if defined(_MSC_VER)\n#    define PYBIND11_COMPAT_STRDUP _strdup\n#else\n#    define PYBIND11_COMPAT_STRDUP strdup\n#endif\n\nPYBIND11_NAMESPACE_END(detail)\n\n/// Wraps an arbitrary C++ function/method/lambda function/.. into a callable Python object\nclass cpp_function : public function {\npublic:\n    cpp_function() = default;\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    cpp_function(std::nullptr_t) {}\n\n    /// Construct a cpp_function from a vanilla function pointer\n    template <typename Return, typename... Args, typename... Extra>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    cpp_function(Return (*f)(Args...), const Extra &...extra) {\n        initialize(f, f, extra...);\n    }\n\n    /// Construct a cpp_function from a lambda function (possibly with internal state)\n    template <typename Func,\n              typename... Extra,\n              typename = detail::enable_if_t<detail::is_lambda<Func>::value>>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    cpp_function(Func &&f, const Extra &...extra) {\n        initialize(\n            std::forward<Func>(f), (detail::function_signature_t<Func> *) nullptr, extra...);\n    }\n\n    /// Construct a cpp_function from a class method (non-const, no ref-qualifier)\n    template <typename Return, typename Class, typename... Arg, typename... Extra>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    cpp_function(Return (Class::*f)(Arg...), const Extra &...extra) {\n        initialize(\n            [f](Class *c, Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); },\n            (Return(*)(Class *, Arg...)) nullptr,\n            extra...);\n    }\n\n    /// Construct a cpp_function from a class method (non-const, lvalue ref-qualifier)\n    /// A copy of the overload for non-const functions without explicit ref-qualifier\n    /// but with an added `&`.\n    template <typename Return, typename Class, typename... Arg, typename... Extra>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    cpp_function(Return (Class::*f)(Arg...) &, const Extra &...extra) {\n        initialize(\n            [f](Class *c, Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); },\n            (Return(*)(Class *, Arg...)) nullptr,\n            extra...);\n    }\n\n    /// Construct a cpp_function from a class method (const, no ref-qualifier)\n    template <typename Return, typename Class, typename... Arg, typename... Extra>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    cpp_function(Return (Class::*f)(Arg...) const, const Extra &...extra) {\n        initialize([f](const Class *c,\n                       Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); },\n                   (Return(*)(const Class *, Arg...)) nullptr,\n                   extra...);\n    }\n\n    /// Construct a cpp_function from a class method (const, lvalue ref-qualifier)\n    /// A copy of the overload for const functions without explicit ref-qualifier\n    /// but with an added `&`.\n    template <typename Return, typename Class, typename... Arg, typename... Extra>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    cpp_function(Return (Class::*f)(Arg...) const &, const Extra &...extra) {\n        initialize([f](const Class *c,\n                       Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); },\n                   (Return(*)(const Class *, Arg...)) nullptr,\n                   extra...);\n    }\n\n    /// Return the function name\n    object name() const { return attr(\"__name__\"); }\n\nprotected:\n    struct InitializingFunctionRecordDeleter {\n        // `destruct(function_record, false)`: `initialize_generic` copies strings and\n        // takes care of cleaning up in case of exceptions. So pass `false` to `free_strings`.\n        void operator()(detail::function_record *rec) { destruct(rec, false); }\n    };\n    using unique_function_record\n        = std::unique_ptr<detail::function_record, InitializingFunctionRecordDeleter>;\n\n    /// Space optimization: don't inline this frequently instantiated fragment\n    PYBIND11_NOINLINE unique_function_record make_function_record() {\n        return unique_function_record(new detail::function_record());\n    }\n\n    /// Special internal constructor for functors, lambda functions, etc.\n    template <typename Func, typename Return, typename... Args, typename... Extra>\n    void initialize(Func &&f, Return (*)(Args...), const Extra &...extra) {\n        using namespace detail;\n        struct capture {\n            remove_reference_t<Func> f;\n        };\n\n        /* Store the function including any extra state it might have (e.g. a lambda capture\n         * object) */\n        // The unique_ptr makes sure nothing is leaked in case of an exception.\n        auto unique_rec = make_function_record();\n        auto *rec = unique_rec.get();\n\n        /* Store the capture object directly in the function record if there is enough space */\n        if (sizeof(capture) <= sizeof(rec->data)) {\n            /* Without these pragmas, GCC warns that there might not be\n               enough space to use the placement new operator. However, the\n               'if' statement above ensures that this is the case. */\n            PYBIND11_WARNING_PUSH\n\n#if defined(__GNUG__) && __GNUC__ >= 6\n            PYBIND11_WARNING_DISABLE_GCC(\"-Wplacement-new\")\n#endif\n\n            new ((capture *) &rec->data) capture{std::forward<Func>(f)};\n\n#if !PYBIND11_HAS_STD_LAUNDER\n            PYBIND11_WARNING_DISABLE_GCC(\"-Wstrict-aliasing\")\n#endif\n\n            // UB without std::launder, but without breaking ABI and/or\n            // a significant refactoring it's \"impossible\" to solve.\n            if (!std::is_trivially_destructible<capture>::value) {\n                rec->free_data = [](function_record *r) {\n                    auto data = PYBIND11_STD_LAUNDER((capture *) &r->data);\n                    (void) data;\n                    data->~capture();\n                };\n            }\n            PYBIND11_WARNING_POP\n        } else {\n            rec->data[0] = new capture{std::forward<Func>(f)};\n            rec->free_data = [](function_record *r) { delete ((capture *) r->data[0]); };\n        }\n\n        /* Type casters for the function arguments and return value */\n        using cast_in = argument_loader<Args...>;\n        using cast_out\n            = make_caster<conditional_t<std::is_void<Return>::value, void_type, Return>>;\n\n        static_assert(\n            expected_num_args<Extra...>(\n                sizeof...(Args), cast_in::args_pos >= 0, cast_in::has_kwargs),\n            \"The number of argument annotations does not match the number of function arguments\");\n\n        /* Dispatch code which converts function arguments and performs the actual function call */\n        rec->impl = [](function_call &call) -> handle {\n            cast_in args_converter;\n\n            /* Try to cast the function arguments into the C++ domain */\n            if (!args_converter.load_args(call)) {\n                return PYBIND11_TRY_NEXT_OVERLOAD;\n            }\n\n            /* Invoke call policy pre-call hook */\n            process_attributes<Extra...>::precall(call);\n\n            /* Get a pointer to the capture object */\n            const auto *data = (sizeof(capture) <= sizeof(call.func.data) ? &call.func.data\n                                                                          : call.func.data[0]);\n            auto *cap = const_cast<capture *>(reinterpret_cast<const capture *>(data));\n\n            /* Override policy for rvalues -- usually to enforce rvp::move on an rvalue */\n            return_value_policy policy\n                = return_value_policy_override<Return>::policy(call.func.policy);\n\n            /* Function scope guard -- defaults to the compile-to-nothing `void_type` */\n            using Guard = extract_guard_t<Extra...>;\n\n            /* Perform the function call */\n            handle result\n                = cast_out::cast(std::move(args_converter).template call<Return, Guard>(cap->f),\n                                 policy,\n                                 call.parent);\n\n            /* Invoke call policy post-call hook */\n            process_attributes<Extra...>::postcall(call, result);\n\n            return result;\n        };\n\n        rec->nargs_pos = cast_in::args_pos >= 0\n                             ? static_cast<std::uint16_t>(cast_in::args_pos)\n                             : sizeof...(Args) - cast_in::has_kwargs; // Will get reduced more if\n                                                                      // we have a kw_only\n        rec->has_args = cast_in::args_pos >= 0;\n        rec->has_kwargs = cast_in::has_kwargs;\n\n        /* Process any user-provided function attributes */\n        process_attributes<Extra...>::init(extra..., rec);\n\n        {\n            constexpr bool has_kw_only_args = any_of<std::is_same<kw_only, Extra>...>::value,\n                           has_pos_only_args = any_of<std::is_same<pos_only, Extra>...>::value,\n                           has_arg_annotations = any_of<is_keyword<Extra>...>::value;\n            static_assert(has_arg_annotations || !has_kw_only_args,\n                          \"py::kw_only requires the use of argument annotations\");\n            static_assert(has_arg_annotations || !has_pos_only_args,\n                          \"py::pos_only requires the use of argument annotations (for docstrings \"\n                          \"and aligning the annotations to the argument)\");\n\n            static_assert(constexpr_sum(is_kw_only<Extra>::value...) <= 1,\n                          \"py::kw_only may be specified only once\");\n            static_assert(constexpr_sum(is_pos_only<Extra>::value...) <= 1,\n                          \"py::pos_only may be specified only once\");\n            constexpr auto kw_only_pos = constexpr_first<is_kw_only, Extra...>();\n            constexpr auto pos_only_pos = constexpr_first<is_pos_only, Extra...>();\n            static_assert(!(has_kw_only_args && has_pos_only_args) || pos_only_pos < kw_only_pos,\n                          \"py::pos_only must come before py::kw_only\");\n        }\n\n        /* Generate a readable signature describing the function's arguments and return\n           value types */\n        static constexpr auto signature\n            = const_name(\"(\") + cast_in::arg_names + const_name(\") -> \") + cast_out::name;\n        PYBIND11_DESCR_CONSTEXPR auto types = decltype(signature)::types();\n\n        /* Register the function with Python from generic (non-templated) code */\n        // Pass on the ownership over the `unique_rec` to `initialize_generic`. `rec` stays valid.\n        initialize_generic(std::move(unique_rec), signature.text, types.data(), sizeof...(Args));\n\n        /* Stash some additional information used by an important optimization in 'functional.h' */\n        using FunctionType = Return (*)(Args...);\n        constexpr bool is_function_ptr\n            = std::is_convertible<Func, FunctionType>::value && sizeof(capture) == sizeof(void *);\n        if (is_function_ptr) {\n            rec->is_stateless = true;\n            rec->data[1]\n                = const_cast<void *>(reinterpret_cast<const void *>(&typeid(FunctionType)));\n        }\n    }\n\n    // Utility class that keeps track of all duplicated strings, and cleans them up in its\n    // destructor, unless they are released. Basically a RAII-solution to deal with exceptions\n    // along the way.\n    class strdup_guard {\n    public:\n        strdup_guard() = default;\n        strdup_guard(const strdup_guard &) = delete;\n        strdup_guard &operator=(const strdup_guard &) = delete;\n\n        ~strdup_guard() {\n            for (auto *s : strings) {\n                std::free(s);\n            }\n        }\n        char *operator()(const char *s) {\n            auto *t = PYBIND11_COMPAT_STRDUP(s);\n            strings.push_back(t);\n            return t;\n        }\n        void release() { strings.clear(); }\n\n    private:\n        std::vector<char *> strings;\n    };\n\n    /// Register a function call with Python (generic non-templated code goes here)\n    void initialize_generic(unique_function_record &&unique_rec,\n                            const char *text,\n                            const std::type_info *const *types,\n                            size_t args) {\n        // Do NOT receive `unique_rec` by value. If this function fails to move out the unique_ptr,\n        // we do not want this to destruct the pointer. `initialize` (the caller) still relies on\n        // the pointee being alive after this call. Only move out if a `capsule` is going to keep\n        // it alive.\n        auto *rec = unique_rec.get();\n\n        // Keep track of strdup'ed strings, and clean them up as long as the function's capsule\n        // has not taken ownership yet (when `unique_rec.release()` is called).\n        // Note: This cannot easily be fixed by a `unique_ptr` with custom deleter, because the\n        // strings are only referenced before strdup'ing. So only *after* the following block could\n        // `destruct` safely be called, but even then, `repr` could still throw in the middle of\n        // copying all strings.\n        strdup_guard guarded_strdup;\n\n        /* Create copies of all referenced C-style strings */\n        rec->name = guarded_strdup(rec->name ? rec->name : \"\");\n        if (rec->doc) {\n            rec->doc = guarded_strdup(rec->doc);\n        }\n        for (auto &a : rec->args) {\n            if (a.name) {\n                a.name = guarded_strdup(a.name);\n            }\n            if (a.descr) {\n                a.descr = guarded_strdup(a.descr);\n            } else if (a.value) {\n                a.descr = guarded_strdup(repr(a.value).cast<std::string>().c_str());\n            }\n        }\n\n        rec->is_constructor = (std::strcmp(rec->name, \"__init__\") == 0)\n                              || (std::strcmp(rec->name, \"__setstate__\") == 0);\n\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES) && !defined(PYBIND11_DISABLE_NEW_STYLE_INIT_WARNING)\n        if (rec->is_constructor && !rec->is_new_style_constructor) {\n            const auto class_name\n                = detail::get_fully_qualified_tp_name((PyTypeObject *) rec->scope.ptr());\n            const auto func_name = std::string(rec->name);\n            PyErr_WarnEx(PyExc_FutureWarning,\n                         (\"pybind11-bound class '\" + class_name\n                          + \"' is using an old-style \"\n                            \"placement-new '\"\n                          + func_name\n                          + \"' which has been deprecated. See \"\n                            \"the upgrade guide in pybind11's docs. This message is only visible \"\n                            \"when compiled in debug mode.\")\n                             .c_str(),\n                         0);\n        }\n#endif\n\n        /* Generate a proper function signature */\n        std::string signature;\n        size_t type_index = 0, arg_index = 0;\n        bool is_starred = false;\n        for (const auto *pc = text; *pc != '\\0'; ++pc) {\n            const auto c = *pc;\n\n            if (c == '{') {\n                // Write arg name for everything except *args and **kwargs.\n                is_starred = *(pc + 1) == '*';\n                if (is_starred) {\n                    continue;\n                }\n                // Separator for keyword-only arguments, placed before the kw\n                // arguments start (unless we are already putting an *args)\n                if (!rec->has_args && arg_index == rec->nargs_pos) {\n                    signature += \"*, \";\n                }\n                if (arg_index < rec->args.size() && rec->args[arg_index].name) {\n                    signature += rec->args[arg_index].name;\n                } else if (arg_index == 0 && rec->is_method) {\n                    signature += \"self\";\n                } else {\n                    signature += \"arg\" + std::to_string(arg_index - (rec->is_method ? 1 : 0));\n                }\n                signature += \": \";\n            } else if (c == '}') {\n                // Write default value if available.\n                if (!is_starred && arg_index < rec->args.size() && rec->args[arg_index].descr) {\n                    signature += \" = \";\n                    signature += rec->args[arg_index].descr;\n                }\n                // Separator for positional-only arguments (placed after the\n                // argument, rather than before like *\n                if (rec->nargs_pos_only > 0 && (arg_index + 1) == rec->nargs_pos_only) {\n                    signature += \", /\";\n                }\n                if (!is_starred) {\n                    arg_index++;\n                }\n            } else if (c == '%') {\n                const std::type_info *t = types[type_index++];\n                if (!t) {\n                    pybind11_fail(\"Internal error while parsing type signature (1)\");\n                }\n                if (auto *tinfo = detail::get_type_info(*t)) {\n                    handle th((PyObject *) tinfo->type);\n                    signature += th.attr(\"__module__\").cast<std::string>() + \".\"\n                                 + th.attr(\"__qualname__\").cast<std::string>();\n                } else if (rec->is_new_style_constructor && arg_index == 0) {\n                    // A new-style `__init__` takes `self` as `value_and_holder`.\n                    // Rewrite it to the proper class type.\n                    signature += rec->scope.attr(\"__module__\").cast<std::string>() + \".\"\n                                 + rec->scope.attr(\"__qualname__\").cast<std::string>();\n                } else {\n                    std::string tname(t->name());\n                    detail::clean_type_id(tname);\n                    signature += tname;\n                }\n            } else {\n                signature += c;\n            }\n        }\n\n        if (arg_index != args - rec->has_args - rec->has_kwargs || types[type_index] != nullptr) {\n            pybind11_fail(\"Internal error while parsing type signature (2)\");\n        }\n\n        rec->signature = guarded_strdup(signature.c_str());\n        rec->args.shrink_to_fit();\n        rec->nargs = (std::uint16_t) args;\n\n        if (rec->sibling && PYBIND11_INSTANCE_METHOD_CHECK(rec->sibling.ptr())) {\n            rec->sibling = PYBIND11_INSTANCE_METHOD_GET_FUNCTION(rec->sibling.ptr());\n        }\n\n        detail::function_record *chain = nullptr, *chain_start = rec;\n        if (rec->sibling) {\n            if (PyCFunction_Check(rec->sibling.ptr())) {\n                auto *self = PyCFunction_GET_SELF(rec->sibling.ptr());\n                if (!isinstance<capsule>(self)) {\n                    chain = nullptr;\n                } else {\n                    auto rec_capsule = reinterpret_borrow<capsule>(self);\n                    if (detail::is_function_record_capsule(rec_capsule)) {\n                        chain = rec_capsule.get_pointer<detail::function_record>();\n                        /* Never append a method to an overload chain of a parent class;\n                           instead, hide the parent's overloads in this case */\n                        if (!chain->scope.is(rec->scope)) {\n                            chain = nullptr;\n                        }\n                    } else {\n                        chain = nullptr;\n                    }\n                }\n            }\n            // Don't trigger for things like the default __init__, which are wrapper_descriptors\n            // that we are intentionally replacing\n            else if (!rec->sibling.is_none() && rec->name[0] != '_') {\n                pybind11_fail(\"Cannot overload existing non-function object \\\"\"\n                              + std::string(rec->name) + \"\\\" with a function of the same name\");\n            }\n        }\n\n        if (!chain) {\n            /* No existing overload was found, create a new function object */\n            rec->def = new PyMethodDef();\n            std::memset(rec->def, 0, sizeof(PyMethodDef));\n            rec->def->ml_name = rec->name;\n            rec->def->ml_meth\n                = reinterpret_cast<PyCFunction>(reinterpret_cast<void (*)()>(dispatcher));\n            rec->def->ml_flags = METH_VARARGS | METH_KEYWORDS;\n\n            capsule rec_capsule(unique_rec.release(),\n                                [](void *ptr) { destruct((detail::function_record *) ptr); });\n            rec_capsule.set_name(detail::get_function_record_capsule_name());\n            guarded_strdup.release();\n\n            object scope_module;\n            if (rec->scope) {\n                if (hasattr(rec->scope, \"__module__\")) {\n                    scope_module = rec->scope.attr(\"__module__\");\n                } else if (hasattr(rec->scope, \"__name__\")) {\n                    scope_module = rec->scope.attr(\"__name__\");\n                }\n            }\n\n            m_ptr = PyCFunction_NewEx(rec->def, rec_capsule.ptr(), scope_module.ptr());\n            if (!m_ptr) {\n                pybind11_fail(\"cpp_function::cpp_function(): Could not allocate function object\");\n            }\n        } else {\n            /* Append at the beginning or end of the overload chain */\n            m_ptr = rec->sibling.ptr();\n            inc_ref();\n            if (chain->is_method != rec->is_method) {\n                pybind11_fail(\n                    \"overloading a method with both static and instance methods is not supported; \"\n#if !defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n                    \"#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for more \"\n                    \"details\"\n#else\n                    \"error while attempting to bind \"\n                    + std::string(rec->is_method ? \"instance\" : \"static\") + \" method \"\n                    + std::string(pybind11::str(rec->scope.attr(\"__name__\"))) + \".\"\n                    + std::string(rec->name) + signature\n#endif\n                );\n            }\n\n            if (rec->prepend) {\n                // Beginning of chain; we need to replace the capsule's current head-of-the-chain\n                // pointer with this one, then make this one point to the previous head of the\n                // chain.\n                chain_start = rec;\n                rec->next = chain;\n                auto rec_capsule\n                    = reinterpret_borrow<capsule>(((PyCFunctionObject *) m_ptr)->m_self);\n                rec_capsule.set_pointer(unique_rec.release());\n                guarded_strdup.release();\n            } else {\n                // Or end of chain (normal behavior)\n                chain_start = chain;\n                while (chain->next) {\n                    chain = chain->next;\n                }\n                chain->next = unique_rec.release();\n                guarded_strdup.release();\n            }\n        }\n\n        std::string signatures;\n        int index = 0;\n        /* Create a nice pydoc rec including all signatures and\n           docstrings of the functions in the overload chain */\n        if (chain && options::show_function_signatures()) {\n            // First a generic signature\n            signatures += rec->name;\n            signatures += \"(*args, **kwargs)\\n\";\n            signatures += \"Overloaded function.\\n\\n\";\n        }\n        // Then specific overload signatures\n        bool first_user_def = true;\n        for (auto *it = chain_start; it != nullptr; it = it->next) {\n            if (options::show_function_signatures()) {\n                if (index > 0) {\n                    signatures += '\\n';\n                }\n                if (chain) {\n                    signatures += std::to_string(++index) + \". \";\n                }\n                signatures += rec->name;\n                signatures += it->signature;\n                signatures += '\\n';\n            }\n            if (it->doc && it->doc[0] != '\\0' && options::show_user_defined_docstrings()) {\n                // If we're appending another docstring, and aren't printing function signatures,\n                // we need to append a newline first:\n                if (!options::show_function_signatures()) {\n                    if (first_user_def) {\n                        first_user_def = false;\n                    } else {\n                        signatures += '\\n';\n                    }\n                }\n                if (options::show_function_signatures()) {\n                    signatures += '\\n';\n                }\n                signatures += it->doc;\n                if (options::show_function_signatures()) {\n                    signatures += '\\n';\n                }\n            }\n        }\n\n        /* Install docstring */\n        auto *func = (PyCFunctionObject *) m_ptr;\n        std::free(const_cast<char *>(func->m_ml->ml_doc));\n        // Install docstring if it's non-empty (when at least one option is enabled)\n        func->m_ml->ml_doc\n            = signatures.empty() ? nullptr : PYBIND11_COMPAT_STRDUP(signatures.c_str());\n\n        if (rec->is_method) {\n            m_ptr = PYBIND11_INSTANCE_METHOD_NEW(m_ptr, rec->scope.ptr());\n            if (!m_ptr) {\n                pybind11_fail(\n                    \"cpp_function::cpp_function(): Could not allocate instance method object\");\n            }\n            Py_DECREF(func);\n        }\n    }\n\n    /// When a cpp_function is GCed, release any memory allocated by pybind11\n    static void destruct(detail::function_record *rec, bool free_strings = true) {\n// If on Python 3.9, check the interpreter \"MICRO\" (patch) version.\n// If this is running on 3.9.0, we have to work around a bug.\n#if !defined(PYPY_VERSION) && PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 9\n        static bool is_zero = Py_GetVersion()[4] == '0';\n#endif\n\n        while (rec) {\n            detail::function_record *next = rec->next;\n            if (rec->free_data) {\n                rec->free_data(rec);\n            }\n            // During initialization, these strings might not have been copied yet,\n            // so they cannot be freed. Once the function has been created, they can.\n            // Check `make_function_record` for more details.\n            if (free_strings) {\n                std::free((char *) rec->name);\n                std::free((char *) rec->doc);\n                std::free((char *) rec->signature);\n                for (auto &arg : rec->args) {\n                    std::free(const_cast<char *>(arg.name));\n                    std::free(const_cast<char *>(arg.descr));\n                }\n            }\n            for (auto &arg : rec->args) {\n                arg.value.dec_ref();\n            }\n            if (rec->def) {\n                std::free(const_cast<char *>(rec->def->ml_doc));\n// Python 3.9.0 decref's these in the wrong order; rec->def\n// If loaded on 3.9.0, let these leak (use Python 3.9.1 at runtime to fix)\n// See https://github.com/python/cpython/pull/22670\n#if !defined(PYPY_VERSION) && PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 9\n                if (!is_zero) {\n                    delete rec->def;\n                }\n#else\n                delete rec->def;\n#endif\n            }\n            delete rec;\n            rec = next;\n        }\n    }\n\n    /// Main dispatch logic for calls to functions bound using pybind11\n    static PyObject *dispatcher(PyObject *self, PyObject *args_in, PyObject *kwargs_in) {\n        using namespace detail;\n        assert(isinstance<capsule>(self));\n\n        /* Iterator over the list of potentially admissible overloads */\n        const function_record *overloads = reinterpret_cast<function_record *>(\n                                  PyCapsule_GetPointer(self, get_function_record_capsule_name())),\n                              *it = overloads;\n        assert(overloads != nullptr);\n\n        /* Need to know how many arguments + keyword arguments there are to pick the right\n           overload */\n        const auto n_args_in = (size_t) PyTuple_GET_SIZE(args_in);\n\n        handle parent = n_args_in > 0 ? PyTuple_GET_ITEM(args_in, 0) : nullptr,\n               result = PYBIND11_TRY_NEXT_OVERLOAD;\n\n        auto self_value_and_holder = value_and_holder();\n        if (overloads->is_constructor) {\n            if (!parent\n                || !PyObject_TypeCheck(parent.ptr(), (PyTypeObject *) overloads->scope.ptr())) {\n                PyErr_SetString(\n                    PyExc_TypeError,\n                    \"__init__(self, ...) called with invalid or missing `self` argument\");\n                return nullptr;\n            }\n\n            auto *const tinfo = get_type_info((PyTypeObject *) overloads->scope.ptr());\n            auto *const pi = reinterpret_cast<instance *>(parent.ptr());\n            self_value_and_holder = pi->get_value_and_holder(tinfo, true);\n\n            // If this value is already registered it must mean __init__ is invoked multiple times;\n            // we really can't support that in C++, so just ignore the second __init__.\n            if (self_value_and_holder.instance_registered()) {\n                return none().release().ptr();\n            }\n        }\n\n        try {\n            // We do this in two passes: in the first pass, we load arguments with `convert=false`;\n            // in the second, we allow conversion (except for arguments with an explicit\n            // py::arg().noconvert()).  This lets us prefer calls without conversion, with\n            // conversion as a fallback.\n            std::vector<function_call> second_pass;\n\n            // However, if there are no overloads, we can just skip the no-convert pass entirely\n            const bool overloaded = it != nullptr && it->next != nullptr;\n\n            for (; it != nullptr; it = it->next) {\n\n                /* For each overload:\n                   1. Copy all positional arguments we were given, also checking to make sure that\n                      named positional arguments weren't *also* specified via kwarg.\n                   2. If we weren't given enough, try to make up the omitted ones by checking\n                      whether they were provided by a kwarg matching the `py::arg(\"name\")` name. If\n                      so, use it (and remove it from kwargs); if not, see if the function binding\n                      provided a default that we can use.\n                   3. Ensure that either all keyword arguments were \"consumed\", or that the\n                   function takes a kwargs argument to accept unconsumed kwargs.\n                   4. Any positional arguments still left get put into a tuple (for args), and any\n                      leftover kwargs get put into a dict.\n                   5. Pack everything into a vector; if we have py::args or py::kwargs, they are an\n                      extra tuple or dict at the end of the positional arguments.\n                   6. Call the function call dispatcher (function_record::impl)\n\n                   If one of these fail, move on to the next overload and keep trying until we get\n                   a result other than PYBIND11_TRY_NEXT_OVERLOAD.\n                 */\n\n                const function_record &func = *it;\n                size_t num_args = func.nargs; // Number of positional arguments that we need\n                if (func.has_args) {\n                    --num_args; // (but don't count py::args\n                }\n                if (func.has_kwargs) {\n                    --num_args; //  or py::kwargs)\n                }\n                size_t pos_args = func.nargs_pos;\n\n                if (!func.has_args && n_args_in > pos_args) {\n                    continue; // Too many positional arguments for this overload\n                }\n\n                if (n_args_in < pos_args && func.args.size() < pos_args) {\n                    continue; // Not enough positional arguments given, and not enough defaults to\n                              // fill in the blanks\n                }\n\n                function_call call(func, parent);\n\n                // Protect std::min with parentheses\n                size_t args_to_copy = (std::min)(pos_args, n_args_in);\n                size_t args_copied = 0;\n\n                // 0. Inject new-style `self` argument\n                if (func.is_new_style_constructor) {\n                    // The `value` may have been preallocated by an old-style `__init__`\n                    // if it was a preceding candidate for overload resolution.\n                    if (self_value_and_holder) {\n                        self_value_and_holder.type->dealloc(self_value_and_holder);\n                    }\n\n                    call.init_self = PyTuple_GET_ITEM(args_in, 0);\n                    call.args.emplace_back(reinterpret_cast<PyObject *>(&self_value_and_holder));\n                    call.args_convert.push_back(false);\n                    ++args_copied;\n                }\n\n                // 1. Copy any position arguments given.\n                bool bad_arg = false;\n                for (; args_copied < args_to_copy; ++args_copied) {\n                    const argument_record *arg_rec\n                        = args_copied < func.args.size() ? &func.args[args_copied] : nullptr;\n                    if (kwargs_in && arg_rec && arg_rec->name\n                        && dict_getitemstring(kwargs_in, arg_rec->name)) {\n                        bad_arg = true;\n                        break;\n                    }\n\n                    handle arg(PyTuple_GET_ITEM(args_in, args_copied));\n                    if (arg_rec && !arg_rec->none && arg.is_none()) {\n                        bad_arg = true;\n                        break;\n                    }\n                    call.args.push_back(arg);\n                    call.args_convert.push_back(arg_rec ? arg_rec->convert : true);\n                }\n                if (bad_arg) {\n                    continue; // Maybe it was meant for another overload (issue #688)\n                }\n\n                // Keep track of how many position args we copied out in case we need to come back\n                // to copy the rest into a py::args argument.\n                size_t positional_args_copied = args_copied;\n\n                // We'll need to copy this if we steal some kwargs for defaults\n                dict kwargs = reinterpret_borrow<dict>(kwargs_in);\n\n                // 1.5. Fill in any missing pos_only args from defaults if they exist\n                if (args_copied < func.nargs_pos_only) {\n                    for (; args_copied < func.nargs_pos_only; ++args_copied) {\n                        const auto &arg_rec = func.args[args_copied];\n                        handle value;\n\n                        if (arg_rec.value) {\n                            value = arg_rec.value;\n                        }\n                        if (value) {\n                            call.args.push_back(value);\n                            call.args_convert.push_back(arg_rec.convert);\n                        } else {\n                            break;\n                        }\n                    }\n\n                    if (args_copied < func.nargs_pos_only) {\n                        continue; // Not enough defaults to fill the positional arguments\n                    }\n                }\n\n                // 2. Check kwargs and, failing that, defaults that may help complete the list\n                if (args_copied < num_args) {\n                    bool copied_kwargs = false;\n\n                    for (; args_copied < num_args; ++args_copied) {\n                        const auto &arg_rec = func.args[args_copied];\n\n                        handle value;\n                        if (kwargs_in && arg_rec.name) {\n                            value = dict_getitemstring(kwargs.ptr(), arg_rec.name);\n                        }\n\n                        if (value) {\n                            // Consume a kwargs value\n                            if (!copied_kwargs) {\n                                kwargs = reinterpret_steal<dict>(PyDict_Copy(kwargs.ptr()));\n                                copied_kwargs = true;\n                            }\n                            if (PyDict_DelItemString(kwargs.ptr(), arg_rec.name) == -1) {\n                                throw error_already_set();\n                            }\n                        } else if (arg_rec.value) {\n                            value = arg_rec.value;\n                        }\n\n                        if (!arg_rec.none && value.is_none()) {\n                            break;\n                        }\n\n                        if (value) {\n                            // If we're at the py::args index then first insert a stub for it to be\n                            // replaced later\n                            if (func.has_args && call.args.size() == func.nargs_pos) {\n                                call.args.push_back(none());\n                            }\n\n                            call.args.push_back(value);\n                            call.args_convert.push_back(arg_rec.convert);\n                        } else {\n                            break;\n                        }\n                    }\n\n                    if (args_copied < num_args) {\n                        continue; // Not enough arguments, defaults, or kwargs to fill the\n                                  // positional arguments\n                    }\n                }\n\n                // 3. Check everything was consumed (unless we have a kwargs arg)\n                if (kwargs && !kwargs.empty() && !func.has_kwargs) {\n                    continue; // Unconsumed kwargs, but no py::kwargs argument to accept them\n                }\n\n                // 4a. If we have a py::args argument, create a new tuple with leftovers\n                if (func.has_args) {\n                    tuple extra_args;\n                    if (args_to_copy == 0) {\n                        // We didn't copy out any position arguments from the args_in tuple, so we\n                        // can reuse it directly without copying:\n                        extra_args = reinterpret_borrow<tuple>(args_in);\n                    } else if (positional_args_copied >= n_args_in) {\n                        extra_args = tuple(0);\n                    } else {\n                        size_t args_size = n_args_in - positional_args_copied;\n                        extra_args = tuple(args_size);\n                        for (size_t i = 0; i < args_size; ++i) {\n                            extra_args[i] = PyTuple_GET_ITEM(args_in, positional_args_copied + i);\n                        }\n                    }\n                    if (call.args.size() <= func.nargs_pos) {\n                        call.args.push_back(extra_args);\n                    } else {\n                        call.args[func.nargs_pos] = extra_args;\n                    }\n                    call.args_convert.push_back(false);\n                    call.args_ref = std::move(extra_args);\n                }\n\n                // 4b. If we have a py::kwargs, pass on any remaining kwargs\n                if (func.has_kwargs) {\n                    if (!kwargs.ptr()) {\n                        kwargs = dict(); // If we didn't get one, send an empty one\n                    }\n                    call.args.push_back(kwargs);\n                    call.args_convert.push_back(false);\n                    call.kwargs_ref = std::move(kwargs);\n                }\n\n// 5. Put everything in a vector.  Not technically step 5, we've been building it\n// in `call.args` all along.\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n                if (call.args.size() != func.nargs || call.args_convert.size() != func.nargs) {\n                    pybind11_fail(\"Internal error: function call dispatcher inserted wrong number \"\n                                  \"of arguments!\");\n                }\n#endif\n\n                std::vector<bool> second_pass_convert;\n                if (overloaded) {\n                    // We're in the first no-convert pass, so swap out the conversion flags for a\n                    // set of all-false flags.  If the call fails, we'll swap the flags back in for\n                    // the conversion-allowed call below.\n                    second_pass_convert.resize(func.nargs, false);\n                    call.args_convert.swap(second_pass_convert);\n                }\n\n                // 6. Call the function.\n                try {\n                    loader_life_support guard{};\n                    result = func.impl(call);\n                } catch (reference_cast_error &) {\n                    result = PYBIND11_TRY_NEXT_OVERLOAD;\n                }\n\n                if (result.ptr() != PYBIND11_TRY_NEXT_OVERLOAD) {\n                    break;\n                }\n\n                if (overloaded) {\n                    // The (overloaded) call failed; if the call has at least one argument that\n                    // permits conversion (i.e. it hasn't been explicitly specified `.noconvert()`)\n                    // then add this call to the list of second pass overloads to try.\n                    for (size_t i = func.is_method ? 1 : 0; i < pos_args; i++) {\n                        if (second_pass_convert[i]) {\n                            // Found one: swap the converting flags back in and store the call for\n                            // the second pass.\n                            call.args_convert.swap(second_pass_convert);\n                            second_pass.push_back(std::move(call));\n                            break;\n                        }\n                    }\n                }\n            }\n\n            if (overloaded && !second_pass.empty() && result.ptr() == PYBIND11_TRY_NEXT_OVERLOAD) {\n                // The no-conversion pass finished without success, try again with conversion\n                // allowed\n                for (auto &call : second_pass) {\n                    try {\n                        loader_life_support guard{};\n                        result = call.func.impl(call);\n                    } catch (reference_cast_error &) {\n                        result = PYBIND11_TRY_NEXT_OVERLOAD;\n                    }\n\n                    if (result.ptr() != PYBIND11_TRY_NEXT_OVERLOAD) {\n                        // The error reporting logic below expects 'it' to be valid, as it would be\n                        // if we'd encountered this failure in the first-pass loop.\n                        if (!result) {\n                            it = &call.func;\n                        }\n                        break;\n                    }\n                }\n            }\n        } catch (error_already_set &e) {\n            e.restore();\n            return nullptr;\n#ifdef __GLIBCXX__\n        } catch (abi::__forced_unwind &) {\n            throw;\n#endif\n        } catch (...) {\n            /* When an exception is caught, give each registered exception\n               translator a chance to translate it to a Python exception. First\n               all module-local translators will be tried in reverse order of\n               registration. If none of the module-locale translators handle\n               the exception (or there are no module-locale translators) then\n               the global translators will be tried, also in reverse order of\n               registration.\n\n               A translator may choose to do one of the following:\n\n                - catch the exception and call PyErr_SetString or PyErr_SetObject\n                  to set a standard (or custom) Python exception, or\n                - do nothing and let the exception fall through to the next translator, or\n                - delegate translation to the next translator by throwing a new type of exception.\n             */\n\n            auto &local_exception_translators\n                = get_local_internals().registered_exception_translators;\n            if (detail::apply_exception_translators(local_exception_translators)) {\n                return nullptr;\n            }\n            auto &exception_translators = get_internals().registered_exception_translators;\n            if (detail::apply_exception_translators(exception_translators)) {\n                return nullptr;\n            }\n\n            PyErr_SetString(PyExc_SystemError,\n                            \"Exception escaped from default exception translator!\");\n            return nullptr;\n        }\n\n        auto append_note_if_missing_header_is_suspected = [](std::string &msg) {\n            if (msg.find(\"std::\") != std::string::npos) {\n                msg += \"\\n\\n\"\n                       \"Did you forget to `#include <pybind11/stl.h>`? Or <pybind11/complex.h>,\\n\"\n                       \"<pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic\\n\"\n                       \"conversions are optional and require extra headers to be included\\n\"\n                       \"when compiling your pybind11 module.\";\n            }\n        };\n\n        if (result.ptr() == PYBIND11_TRY_NEXT_OVERLOAD) {\n            if (overloads->is_operator) {\n                return handle(Py_NotImplemented).inc_ref().ptr();\n            }\n\n            std::string msg = std::string(overloads->name) + \"(): incompatible \"\n                              + std::string(overloads->is_constructor ? \"constructor\" : \"function\")\n                              + \" arguments. The following argument types are supported:\\n\";\n\n            int ctr = 0;\n            for (const function_record *it2 = overloads; it2 != nullptr; it2 = it2->next) {\n                msg += \"    \" + std::to_string(++ctr) + \". \";\n\n                bool wrote_sig = false;\n                if (overloads->is_constructor) {\n                    // For a constructor, rewrite `(self: Object, arg0, ...) -> NoneType` as\n                    // `Object(arg0, ...)`\n                    std::string sig = it2->signature;\n                    size_t start = sig.find('(') + 7; // skip \"(self: \"\n                    if (start < sig.size()) {\n                        // End at the , for the next argument\n                        size_t end = sig.find(\", \"), next = end + 2;\n                        size_t ret = sig.rfind(\" -> \");\n                        // Or the ), if there is no comma:\n                        if (end >= sig.size()) {\n                            next = end = sig.find(')');\n                        }\n                        if (start < end && next < sig.size()) {\n                            msg.append(sig, start, end - start);\n                            msg += '(';\n                            msg.append(sig, next, ret - next);\n                            wrote_sig = true;\n                        }\n                    }\n                }\n                if (!wrote_sig) {\n                    msg += it2->signature;\n                }\n\n                msg += '\\n';\n            }\n            msg += \"\\nInvoked with: \";\n            auto args_ = reinterpret_borrow<tuple>(args_in);\n            bool some_args = false;\n            for (size_t ti = overloads->is_constructor ? 1 : 0; ti < args_.size(); ++ti) {\n                if (!some_args) {\n                    some_args = true;\n                } else {\n                    msg += \", \";\n                }\n                try {\n                    msg += pybind11::repr(args_[ti]);\n                } catch (const error_already_set &) {\n                    msg += \"<repr raised Error>\";\n                }\n            }\n            if (kwargs_in) {\n                auto kwargs = reinterpret_borrow<dict>(kwargs_in);\n                if (!kwargs.empty()) {\n                    if (some_args) {\n                        msg += \"; \";\n                    }\n                    msg += \"kwargs: \";\n                    bool first = true;\n                    for (auto kwarg : kwargs) {\n                        if (first) {\n                            first = false;\n                        } else {\n                            msg += \", \";\n                        }\n                        msg += pybind11::str(\"{}=\").format(kwarg.first);\n                        try {\n                            msg += pybind11::repr(kwarg.second);\n                        } catch (const error_already_set &) {\n                            msg += \"<repr raised Error>\";\n                        }\n                    }\n                }\n            }\n\n            append_note_if_missing_header_is_suspected(msg);\n            // Attach additional error info to the exception if supported\n            if (PyErr_Occurred()) {\n                // #HelpAppreciated: unit test coverage for this branch.\n                raise_from(PyExc_TypeError, msg.c_str());\n                return nullptr;\n            }\n            PyErr_SetString(PyExc_TypeError, msg.c_str());\n            return nullptr;\n        }\n        if (!result) {\n            std::string msg = \"Unable to convert function return value to a \"\n                              \"Python type! The signature was\\n\\t\";\n            msg += it->signature;\n            append_note_if_missing_header_is_suspected(msg);\n            // Attach additional error info to the exception if supported\n            if (PyErr_Occurred()) {\n                raise_from(PyExc_TypeError, msg.c_str());\n                return nullptr;\n            }\n            PyErr_SetString(PyExc_TypeError, msg.c_str());\n            return nullptr;\n        }\n        if (overloads->is_constructor && !self_value_and_holder.holder_constructed()) {\n            auto *pi = reinterpret_cast<instance *>(parent.ptr());\n            self_value_and_holder.type->init_instance(pi, nullptr);\n        }\n        return result.ptr();\n    }\n};\n\n/// Wrapper for Python extension modules\nclass module_ : public object {\npublic:\n    PYBIND11_OBJECT_DEFAULT(module_, object, PyModule_Check)\n\n    /// Create a new top-level Python module with the given name and docstring\n    PYBIND11_DEPRECATED(\"Use PYBIND11_MODULE or module_::create_extension_module instead\")\n    explicit module_(const char *name, const char *doc = nullptr) {\n        *this = create_extension_module(name, doc, new PyModuleDef());\n    }\n\n    /** \\rst\n        Create Python binding for a new function within the module scope. ``Func``\n        can be a plain C++ function, a function pointer, or a lambda function. For\n        details on the ``Extra&& ... extra`` argument, see section :ref:`extras`.\n    \\endrst */\n    template <typename Func, typename... Extra>\n    module_ &def(const char *name_, Func &&f, const Extra &...extra) {\n        cpp_function func(std::forward<Func>(f),\n                          name(name_),\n                          scope(*this),\n                          sibling(getattr(*this, name_, none())),\n                          extra...);\n        // NB: allow overwriting here because cpp_function sets up a chain with the intention of\n        // overwriting (and has already checked internally that it isn't overwriting\n        // non-functions).\n        add_object(name_, func, true /* overwrite */);\n        return *this;\n    }\n\n    /** \\rst\n        Create and return a new Python submodule with the given name and docstring.\n        This also works recursively, i.e.\n\n        .. code-block:: cpp\n\n            py::module_ m(\"example\", \"pybind11 example plugin\");\n            py::module_ m2 = m.def_submodule(\"sub\", \"A submodule of 'example'\");\n            py::module_ m3 = m2.def_submodule(\"subsub\", \"A submodule of 'example.sub'\");\n    \\endrst */\n    module_ def_submodule(const char *name, const char *doc = nullptr) {\n        const char *this_name = PyModule_GetName(m_ptr);\n        if (this_name == nullptr) {\n            throw error_already_set();\n        }\n        std::string full_name = std::string(this_name) + '.' + name;\n        handle submodule = PyImport_AddModule(full_name.c_str());\n        if (!submodule) {\n            throw error_already_set();\n        }\n        auto result = reinterpret_borrow<module_>(submodule);\n        if (doc && options::show_user_defined_docstrings()) {\n            result.attr(\"__doc__\") = pybind11::str(doc);\n        }\n        attr(name) = result;\n        return result;\n    }\n\n    /// Import and return a module or throws `error_already_set`.\n    static module_ import(const char *name) {\n        PyObject *obj = PyImport_ImportModule(name);\n        if (!obj) {\n            throw error_already_set();\n        }\n        return reinterpret_steal<module_>(obj);\n    }\n\n    /// Reload the module or throws `error_already_set`.\n    void reload() {\n        PyObject *obj = PyImport_ReloadModule(ptr());\n        if (!obj) {\n            throw error_already_set();\n        }\n        *this = reinterpret_steal<module_>(obj);\n    }\n\n    /** \\rst\n        Adds an object to the module using the given name.  Throws if an object with the given name\n        already exists.\n\n        ``overwrite`` should almost always be false: attempting to overwrite objects that pybind11\n        has established will, in most cases, break things.\n    \\endrst */\n    PYBIND11_NOINLINE void add_object(const char *name, handle obj, bool overwrite = false) {\n        if (!overwrite && hasattr(*this, name)) {\n            pybind11_fail(\n                \"Error during initialization: multiple incompatible definitions with name \\\"\"\n                + std::string(name) + \"\\\"\");\n        }\n\n        PyModule_AddObject(ptr(), name, obj.inc_ref().ptr() /* steals a reference */);\n    }\n\n    using module_def = PyModuleDef; // TODO: Can this be removed (it was needed only for Python 2)?\n\n    /** \\rst\n        Create a new top-level module that can be used as the main module of a C extension.\n\n        ``def`` should point to a statically allocated module_def.\n    \\endrst */\n    static module_ create_extension_module(const char *name, const char *doc, module_def *def) {\n        // module_def is PyModuleDef\n        // Placement new (not an allocation).\n        def = new (def)\n            PyModuleDef{/* m_base */ PyModuleDef_HEAD_INIT,\n                        /* m_name */ name,\n                        /* m_doc */ options::show_user_defined_docstrings() ? doc : nullptr,\n                        /* m_size */ -1,\n                        /* m_methods */ nullptr,\n                        /* m_slots */ nullptr,\n                        /* m_traverse */ nullptr,\n                        /* m_clear */ nullptr,\n                        /* m_free */ nullptr};\n        auto *m = PyModule_Create(def);\n        if (m == nullptr) {\n            if (PyErr_Occurred()) {\n                throw error_already_set();\n            }\n            pybind11_fail(\"Internal error in module_::create_extension_module()\");\n        }\n        // TODO: Should be reinterpret_steal for Python 3, but Python also steals it again when\n        //       returned from PyInit_...\n        //       For Python 2, reinterpret_borrow was correct.\n        return reinterpret_borrow<module_>(m);\n    }\n};\n\n// When inside a namespace (or anywhere as long as it's not the first item on a line),\n// C++20 allows \"module\" to be used. This is provided for backward compatibility, and for\n// simplicity, if someone wants to use py::module for example, that is perfectly safe.\nusing module = module_;\n\n/// \\ingroup python_builtins\n/// Return a dictionary representing the global variables in the current execution frame,\n/// or ``__main__.__dict__`` if there is no frame (usually when the interpreter is embedded).\ninline dict globals() {\n    PyObject *p = PyEval_GetGlobals();\n    return reinterpret_borrow<dict>(p ? p : module_::import(\"__main__\").attr(\"__dict__\").ptr());\n}\n\ntemplate <typename... Args, typename = detail::enable_if_t<args_are_all_keyword_or_ds<Args...>()>>\nPYBIND11_DEPRECATED(\"make_simple_namespace should be replaced with \"\n                    \"py::module_::import(\\\"types\\\").attr(\\\"SimpleNamespace\\\") \")\nobject make_simple_namespace(Args &&...args_) {\n    return module_::import(\"types\").attr(\"SimpleNamespace\")(std::forward<Args>(args_)...);\n}\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n/// Generic support for creating new Python heap types\nclass generic_type : public object {\npublic:\n    PYBIND11_OBJECT_DEFAULT(generic_type, object, PyType_Check)\nprotected:\n    void initialize(const type_record &rec) {\n        if (rec.scope && hasattr(rec.scope, \"__dict__\")\n            && rec.scope.attr(\"__dict__\").contains(rec.name)) {\n            pybind11_fail(\"generic_type: cannot initialize type \\\"\" + std::string(rec.name)\n                          + \"\\\": an object with that name is already defined\");\n        }\n\n        if ((rec.module_local ? get_local_type_info(*rec.type) : get_global_type_info(*rec.type))\n            != nullptr) {\n            pybind11_fail(\"generic_type: type \\\"\" + std::string(rec.name)\n                          + \"\\\" is already registered!\");\n        }\n\n        m_ptr = make_new_python_type(rec);\n\n        /* Register supplemental type information in C++ dict */\n        auto *tinfo = new detail::type_info();\n        tinfo->type = (PyTypeObject *) m_ptr;\n        tinfo->cpptype = rec.type;\n        tinfo->type_size = rec.type_size;\n        tinfo->type_align = rec.type_align;\n        tinfo->operator_new = rec.operator_new;\n        tinfo->holder_size_in_ptrs = size_in_ptrs(rec.holder_size);\n        tinfo->init_instance = rec.init_instance;\n        tinfo->dealloc = rec.dealloc;\n        tinfo->simple_type = true;\n        tinfo->simple_ancestors = true;\n        tinfo->default_holder = rec.default_holder;\n        tinfo->module_local = rec.module_local;\n\n        auto &internals = get_internals();\n        auto tindex = std::type_index(*rec.type);\n        tinfo->direct_conversions = &internals.direct_conversions[tindex];\n        if (rec.module_local) {\n            get_local_internals().registered_types_cpp[tindex] = tinfo;\n        } else {\n            internals.registered_types_cpp[tindex] = tinfo;\n        }\n        internals.registered_types_py[(PyTypeObject *) m_ptr] = {tinfo};\n\n        if (rec.bases.size() > 1 || rec.multiple_inheritance) {\n            mark_parents_nonsimple(tinfo->type);\n            tinfo->simple_ancestors = false;\n        } else if (rec.bases.size() == 1) {\n            auto *parent_tinfo = get_type_info((PyTypeObject *) rec.bases[0].ptr());\n            assert(parent_tinfo != nullptr);\n            bool parent_simple_ancestors = parent_tinfo->simple_ancestors;\n            tinfo->simple_ancestors = parent_simple_ancestors;\n            // The parent can no longer be a simple type if it has MI and has a child\n            parent_tinfo->simple_type = parent_tinfo->simple_type && parent_simple_ancestors;\n        }\n\n        if (rec.module_local) {\n            // Stash the local typeinfo and loader so that external modules can access it.\n            tinfo->module_local_load = &type_caster_generic::local_load;\n            setattr(m_ptr, PYBIND11_MODULE_LOCAL_ID, capsule(tinfo));\n        }\n    }\n\n    /// Helper function which tags all parents of a type using mult. inheritance\n    void mark_parents_nonsimple(PyTypeObject *value) {\n        auto t = reinterpret_borrow<tuple>(value->tp_bases);\n        for (handle h : t) {\n            auto *tinfo2 = get_type_info((PyTypeObject *) h.ptr());\n            if (tinfo2) {\n                tinfo2->simple_type = false;\n            }\n            mark_parents_nonsimple((PyTypeObject *) h.ptr());\n        }\n    }\n\n    void install_buffer_funcs(buffer_info *(*get_buffer)(PyObject *, void *),\n                              void *get_buffer_data) {\n        auto *type = (PyHeapTypeObject *) m_ptr;\n        auto *tinfo = detail::get_type_info(&type->ht_type);\n\n        if (!type->ht_type.tp_as_buffer) {\n            pybind11_fail(\"To be able to register buffer protocol support for the type '\"\n                          + get_fully_qualified_tp_name(tinfo->type)\n                          + \"' the associated class<>(..) invocation must \"\n                            \"include the pybind11::buffer_protocol() annotation!\");\n        }\n\n        tinfo->get_buffer = get_buffer;\n        tinfo->get_buffer_data = get_buffer_data;\n    }\n\n    // rec_func must be set for either fget or fset.\n    void def_property_static_impl(const char *name,\n                                  handle fget,\n                                  handle fset,\n                                  detail::function_record *rec_func) {\n        const auto is_static = (rec_func != nullptr) && !(rec_func->is_method && rec_func->scope);\n        const auto has_doc = (rec_func != nullptr) && (rec_func->doc != nullptr)\n                             && pybind11::options::show_user_defined_docstrings();\n        auto property = handle(\n            (PyObject *) (is_static ? get_internals().static_property_type : &PyProperty_Type));\n        attr(name) = property(fget.ptr() ? fget : none(),\n                              fset.ptr() ? fset : none(),\n                              /*deleter*/ none(),\n                              pybind11::str(has_doc ? rec_func->doc : \"\"));\n    }\n};\n\n/// Set the pointer to operator new if it exists. The cast is needed because it can be overloaded.\ntemplate <typename T,\n          typename = void_t<decltype(static_cast<void *(*) (size_t)>(T::operator new))>>\nvoid set_operator_new(type_record *r) {\n    r->operator_new = &T::operator new;\n}\n\ntemplate <typename>\nvoid set_operator_new(...) {}\n\ntemplate <typename T, typename SFINAE = void>\nstruct has_operator_delete : std::false_type {};\ntemplate <typename T>\nstruct has_operator_delete<T, void_t<decltype(static_cast<void (*)(void *)>(T::operator delete))>>\n    : std::true_type {};\ntemplate <typename T, typename SFINAE = void>\nstruct has_operator_delete_size : std::false_type {};\ntemplate <typename T>\nstruct has_operator_delete_size<\n    T,\n    void_t<decltype(static_cast<void (*)(void *, size_t)>(T::operator delete))>> : std::true_type {\n};\n/// Call class-specific delete if it exists or global otherwise. Can also be an overload set.\ntemplate <typename T, enable_if_t<has_operator_delete<T>::value, int> = 0>\nvoid call_operator_delete(T *p, size_t, size_t) {\n    T::operator delete(p);\n}\ntemplate <typename T,\n          enable_if_t<!has_operator_delete<T>::value && has_operator_delete_size<T>::value, int>\n          = 0>\nvoid call_operator_delete(T *p, size_t s, size_t) {\n    T::operator delete(p, s);\n}\n\ninline void call_operator_delete(void *p, size_t s, size_t a) {\n    (void) s;\n    (void) a;\n#if defined(__cpp_aligned_new) && (!defined(_MSC_VER) || _MSC_VER >= 1912)\n    if (a > __STDCPP_DEFAULT_NEW_ALIGNMENT__) {\n#    ifdef __cpp_sized_deallocation\n        ::operator delete(p, s, std::align_val_t(a));\n#    else\n        ::operator delete(p, std::align_val_t(a));\n#    endif\n        return;\n    }\n#endif\n#ifdef __cpp_sized_deallocation\n    ::operator delete(p, s);\n#else\n    ::operator delete(p);\n#endif\n}\n\ninline void add_class_method(object &cls, const char *name_, const cpp_function &cf) {\n    cls.attr(cf.name()) = cf;\n    if (std::strcmp(name_, \"__eq__\") == 0 && !cls.attr(\"__dict__\").contains(\"__hash__\")) {\n        cls.attr(\"__hash__\") = none();\n    }\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n/// Given a pointer to a member function, cast it to its `Derived` version.\n/// Forward everything else unchanged.\ntemplate <typename /*Derived*/, typename F>\nauto method_adaptor(F &&f) -> decltype(std::forward<F>(f)) {\n    return std::forward<F>(f);\n}\n\ntemplate <typename Derived, typename Return, typename Class, typename... Args>\nauto method_adaptor(Return (Class::*pmf)(Args...)) -> Return (Derived::*)(Args...) {\n    static_assert(\n        detail::is_accessible_base_of<Class, Derived>::value,\n        \"Cannot bind an inaccessible base class method; use a lambda definition instead\");\n    return pmf;\n}\n\ntemplate <typename Derived, typename Return, typename Class, typename... Args>\nauto method_adaptor(Return (Class::*pmf)(Args...) const) -> Return (Derived::*)(Args...) const {\n    static_assert(\n        detail::is_accessible_base_of<Class, Derived>::value,\n        \"Cannot bind an inaccessible base class method; use a lambda definition instead\");\n    return pmf;\n}\n\ntemplate <typename type_, typename... options>\nclass class_ : public detail::generic_type {\n    template <typename T>\n    using is_holder = detail::is_holder_type<type_, T>;\n    template <typename T>\n    using is_subtype = detail::is_strict_base_of<type_, T>;\n    template <typename T>\n    using is_base = detail::is_strict_base_of<T, type_>;\n    // struct instead of using here to help MSVC:\n    template <typename T>\n    struct is_valid_class_option : detail::any_of<is_holder<T>, is_subtype<T>, is_base<T>> {};\n\npublic:\n    using type = type_;\n    using type_alias = detail::exactly_one_t<is_subtype, void, options...>;\n    constexpr static bool has_alias = !std::is_void<type_alias>::value;\n    using holder_type = detail::exactly_one_t<is_holder, std::unique_ptr<type>, options...>;\n\n    static_assert(detail::all_of<is_valid_class_option<options>...>::value,\n                  \"Unknown/invalid class_ template parameters provided\");\n\n    static_assert(!has_alias || std::is_polymorphic<type>::value,\n                  \"Cannot use an alias class with a non-polymorphic type\");\n\n    PYBIND11_OBJECT(class_, generic_type, PyType_Check)\n\n    template <typename... Extra>\n    class_(handle scope, const char *name, const Extra &...extra) {\n        using namespace detail;\n\n        // MI can only be specified via class_ template options, not constructor parameters\n        static_assert(\n            none_of<is_pyobject<Extra>...>::value || // no base class arguments, or:\n                (constexpr_sum(is_pyobject<Extra>::value...) == 1 && // Exactly one base\n                 constexpr_sum(is_base<options>::value...) == 0 &&   // no template option bases\n                 // no multiple_inheritance attr\n                 none_of<std::is_same<multiple_inheritance, Extra>...>::value),\n            \"Error: multiple inheritance bases must be specified via class_ template options\");\n\n        type_record record;\n        record.scope = scope;\n        record.name = name;\n        record.type = &typeid(type);\n        record.type_size = sizeof(conditional_t<has_alias, type_alias, type>);\n        record.type_align = alignof(conditional_t<has_alias, type_alias, type> &);\n        record.holder_size = sizeof(holder_type);\n        record.init_instance = init_instance;\n        record.dealloc = dealloc;\n        record.default_holder = detail::is_instantiation<std::unique_ptr, holder_type>::value;\n\n        set_operator_new<type>(&record);\n\n        /* Register base classes specified via template arguments to class_, if any */\n        PYBIND11_EXPAND_SIDE_EFFECTS(add_base<options>(record));\n\n        /* Process optional arguments, if any */\n        process_attributes<Extra...>::init(extra..., &record);\n\n        generic_type::initialize(record);\n\n        if (has_alias) {\n            auto &instances = record.module_local ? get_local_internals().registered_types_cpp\n                                                  : get_internals().registered_types_cpp;\n            instances[std::type_index(typeid(type_alias))]\n                = instances[std::type_index(typeid(type))];\n        }\n    }\n\n    template <typename Base, detail::enable_if_t<is_base<Base>::value, int> = 0>\n    static void add_base(detail::type_record &rec) {\n        rec.add_base(typeid(Base), [](void *src) -> void * {\n            return static_cast<Base *>(reinterpret_cast<type *>(src));\n        });\n    }\n\n    template <typename Base, detail::enable_if_t<!is_base<Base>::value, int> = 0>\n    static void add_base(detail::type_record &) {}\n\n    template <typename Func, typename... Extra>\n    class_ &def(const char *name_, Func &&f, const Extra &...extra) {\n        cpp_function cf(method_adaptor<type>(std::forward<Func>(f)),\n                        name(name_),\n                        is_method(*this),\n                        sibling(getattr(*this, name_, none())),\n                        extra...);\n        add_class_method(*this, name_, cf);\n        return *this;\n    }\n\n    template <typename Func, typename... Extra>\n    class_ &def_static(const char *name_, Func &&f, const Extra &...extra) {\n        static_assert(!std::is_member_function_pointer<Func>::value,\n                      \"def_static(...) called with a non-static member function pointer\");\n        cpp_function cf(std::forward<Func>(f),\n                        name(name_),\n                        scope(*this),\n                        sibling(getattr(*this, name_, none())),\n                        extra...);\n        auto cf_name = cf.name();\n        attr(std::move(cf_name)) = staticmethod(std::move(cf));\n        return *this;\n    }\n\n    template <typename T, typename... Extra, detail::enable_if_t<T::op_enable_if_hook, int> = 0>\n    class_ &def(const T &op, const Extra &...extra) {\n        op.execute(*this, extra...);\n        return *this;\n    }\n\n    template <typename T, typename... Extra, detail::enable_if_t<T::op_enable_if_hook, int> = 0>\n    class_ &def_cast(const T &op, const Extra &...extra) {\n        op.execute_cast(*this, extra...);\n        return *this;\n    }\n\n    template <typename... Args, typename... Extra>\n    class_ &def(const detail::initimpl::constructor<Args...> &init, const Extra &...extra) {\n        PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(init);\n        init.execute(*this, extra...);\n        return *this;\n    }\n\n    template <typename... Args, typename... Extra>\n    class_ &def(const detail::initimpl::alias_constructor<Args...> &init, const Extra &...extra) {\n        PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(init);\n        init.execute(*this, extra...);\n        return *this;\n    }\n\n    template <typename... Args, typename... Extra>\n    class_ &def(detail::initimpl::factory<Args...> &&init, const Extra &...extra) {\n        std::move(init).execute(*this, extra...);\n        return *this;\n    }\n\n    template <typename... Args, typename... Extra>\n    class_ &def(detail::initimpl::pickle_factory<Args...> &&pf, const Extra &...extra) {\n        std::move(pf).execute(*this, extra...);\n        return *this;\n    }\n\n    template <typename Func>\n    class_ &def_buffer(Func &&func) {\n        struct capture {\n            Func func;\n        };\n        auto *ptr = new capture{std::forward<Func>(func)};\n        install_buffer_funcs(\n            [](PyObject *obj, void *ptr) -> buffer_info * {\n                detail::make_caster<type> caster;\n                if (!caster.load(obj, false)) {\n                    return nullptr;\n                }\n                return new buffer_info(((capture *) ptr)->func(std::move(caster)));\n            },\n            ptr);\n        weakref(m_ptr, cpp_function([ptr](handle wr) {\n                    delete ptr;\n                    wr.dec_ref();\n                }))\n            .release();\n        return *this;\n    }\n\n    template <typename Return, typename Class, typename... Args>\n    class_ &def_buffer(Return (Class::*func)(Args...)) {\n        return def_buffer([func](type &obj) { return (obj.*func)(); });\n    }\n\n    template <typename Return, typename Class, typename... Args>\n    class_ &def_buffer(Return (Class::*func)(Args...) const) {\n        return def_buffer([func](const type &obj) { return (obj.*func)(); });\n    }\n\n    template <typename C, typename D, typename... Extra>\n    class_ &def_readwrite(const char *name, D C::*pm, const Extra &...extra) {\n        static_assert(std::is_same<C, type>::value || std::is_base_of<C, type>::value,\n                      \"def_readwrite() requires a class member (or base class member)\");\n        cpp_function fget([pm](const type &c) -> const D & { return c.*pm; }, is_method(*this)),\n            fset([pm](type &c, const D &value) { c.*pm = value; }, is_method(*this));\n        def_property(name, fget, fset, return_value_policy::reference_internal, extra...);\n        return *this;\n    }\n\n    template <typename C, typename D, typename... Extra>\n    class_ &def_readonly(const char *name, const D C::*pm, const Extra &...extra) {\n        static_assert(std::is_same<C, type>::value || std::is_base_of<C, type>::value,\n                      \"def_readonly() requires a class member (or base class member)\");\n        cpp_function fget([pm](const type &c) -> const D & { return c.*pm; }, is_method(*this));\n        def_property_readonly(name, fget, return_value_policy::reference_internal, extra...);\n        return *this;\n    }\n\n    template <typename D, typename... Extra>\n    class_ &def_readwrite_static(const char *name, D *pm, const Extra &...extra) {\n        cpp_function fget([pm](const object &) -> const D & { return *pm; }, scope(*this)),\n            fset([pm](const object &, const D &value) { *pm = value; }, scope(*this));\n        def_property_static(name, fget, fset, return_value_policy::reference, extra...);\n        return *this;\n    }\n\n    template <typename D, typename... Extra>\n    class_ &def_readonly_static(const char *name, const D *pm, const Extra &...extra) {\n        cpp_function fget([pm](const object &) -> const D & { return *pm; }, scope(*this));\n        def_property_readonly_static(name, fget, return_value_policy::reference, extra...);\n        return *this;\n    }\n\n    /// Uses return_value_policy::reference_internal by default\n    template <typename Getter, typename... Extra>\n    class_ &def_property_readonly(const char *name, const Getter &fget, const Extra &...extra) {\n        return def_property_readonly(name,\n                                     cpp_function(method_adaptor<type>(fget)),\n                                     return_value_policy::reference_internal,\n                                     extra...);\n    }\n\n    /// Uses cpp_function's return_value_policy by default\n    template <typename... Extra>\n    class_ &\n    def_property_readonly(const char *name, const cpp_function &fget, const Extra &...extra) {\n        return def_property(name, fget, nullptr, extra...);\n    }\n\n    /// Uses return_value_policy::reference by default\n    template <typename Getter, typename... Extra>\n    class_ &\n    def_property_readonly_static(const char *name, const Getter &fget, const Extra &...extra) {\n        return def_property_readonly_static(\n            name, cpp_function(fget), return_value_policy::reference, extra...);\n    }\n\n    /// Uses cpp_function's return_value_policy by default\n    template <typename... Extra>\n    class_ &def_property_readonly_static(const char *name,\n                                         const cpp_function &fget,\n                                         const Extra &...extra) {\n        return def_property_static(name, fget, nullptr, extra...);\n    }\n\n    /// Uses return_value_policy::reference_internal by default\n    template <typename Getter, typename Setter, typename... Extra>\n    class_ &\n    def_property(const char *name, const Getter &fget, const Setter &fset, const Extra &...extra) {\n        return def_property(name, fget, cpp_function(method_adaptor<type>(fset)), extra...);\n    }\n    template <typename Getter, typename... Extra>\n    class_ &def_property(const char *name,\n                         const Getter &fget,\n                         const cpp_function &fset,\n                         const Extra &...extra) {\n        return def_property(name,\n                            cpp_function(method_adaptor<type>(fget)),\n                            fset,\n                            return_value_policy::reference_internal,\n                            extra...);\n    }\n\n    /// Uses cpp_function's return_value_policy by default\n    template <typename... Extra>\n    class_ &def_property(const char *name,\n                         const cpp_function &fget,\n                         const cpp_function &fset,\n                         const Extra &...extra) {\n        return def_property_static(name, fget, fset, is_method(*this), extra...);\n    }\n\n    /// Uses return_value_policy::reference by default\n    template <typename Getter, typename... Extra>\n    class_ &def_property_static(const char *name,\n                                const Getter &fget,\n                                const cpp_function &fset,\n                                const Extra &...extra) {\n        return def_property_static(\n            name, cpp_function(fget), fset, return_value_policy::reference, extra...);\n    }\n\n    /// Uses cpp_function's return_value_policy by default\n    template <typename... Extra>\n    class_ &def_property_static(const char *name,\n                                const cpp_function &fget,\n                                const cpp_function &fset,\n                                const Extra &...extra) {\n        static_assert(0 == detail::constexpr_sum(std::is_base_of<arg, Extra>::value...),\n                      \"Argument annotations are not allowed for properties\");\n        auto rec_fget = get_function_record(fget), rec_fset = get_function_record(fset);\n        auto *rec_active = rec_fget;\n        if (rec_fget) {\n            char *doc_prev = rec_fget->doc; /* 'extra' field may include a property-specific\n                                               documentation string */\n            detail::process_attributes<Extra...>::init(extra..., rec_fget);\n            if (rec_fget->doc && rec_fget->doc != doc_prev) {\n                std::free(doc_prev);\n                rec_fget->doc = PYBIND11_COMPAT_STRDUP(rec_fget->doc);\n            }\n        }\n        if (rec_fset) {\n            char *doc_prev = rec_fset->doc;\n            detail::process_attributes<Extra...>::init(extra..., rec_fset);\n            if (rec_fset->doc && rec_fset->doc != doc_prev) {\n                std::free(doc_prev);\n                rec_fset->doc = PYBIND11_COMPAT_STRDUP(rec_fset->doc);\n            }\n            if (!rec_active) {\n                rec_active = rec_fset;\n            }\n        }\n        def_property_static_impl(name, fget, fset, rec_active);\n        return *this;\n    }\n\nprivate:\n    /// Initialize holder object, variant 1: object derives from enable_shared_from_this\n    template <typename T>\n    static void init_holder(detail::instance *inst,\n                            detail::value_and_holder &v_h,\n                            const holder_type * /* unused */,\n                            const std::enable_shared_from_this<T> * /* dummy */) {\n\n        auto sh = std::dynamic_pointer_cast<typename holder_type::element_type>(\n            detail::try_get_shared_from_this(v_h.value_ptr<type>()));\n        if (sh) {\n            new (std::addressof(v_h.holder<holder_type>())) holder_type(std::move(sh));\n            v_h.set_holder_constructed();\n        }\n\n        if (!v_h.holder_constructed() && inst->owned) {\n            new (std::addressof(v_h.holder<holder_type>())) holder_type(v_h.value_ptr<type>());\n            v_h.set_holder_constructed();\n        }\n    }\n\n    static void init_holder_from_existing(const detail::value_and_holder &v_h,\n                                          const holder_type *holder_ptr,\n                                          std::true_type /*is_copy_constructible*/) {\n        new (std::addressof(v_h.holder<holder_type>()))\n            holder_type(*reinterpret_cast<const holder_type *>(holder_ptr));\n    }\n\n    static void init_holder_from_existing(const detail::value_and_holder &v_h,\n                                          const holder_type *holder_ptr,\n                                          std::false_type /*is_copy_constructible*/) {\n        new (std::addressof(v_h.holder<holder_type>()))\n            holder_type(std::move(*const_cast<holder_type *>(holder_ptr)));\n    }\n\n    /// Initialize holder object, variant 2: try to construct from existing holder object, if\n    /// possible\n    static void init_holder(detail::instance *inst,\n                            detail::value_and_holder &v_h,\n                            const holder_type *holder_ptr,\n                            const void * /* dummy -- not enable_shared_from_this<T>) */) {\n        if (holder_ptr) {\n            init_holder_from_existing(v_h, holder_ptr, std::is_copy_constructible<holder_type>());\n            v_h.set_holder_constructed();\n        } else if (detail::always_construct_holder<holder_type>::value || inst->owned) {\n            new (std::addressof(v_h.holder<holder_type>())) holder_type(v_h.value_ptr<type>());\n            v_h.set_holder_constructed();\n        }\n    }\n\n    /// Performs instance initialization including constructing a holder and registering the known\n    /// instance.  Should be called as soon as the `type` value_ptr is set for an instance.  Takes\n    /// an optional pointer to an existing holder to use; if not specified and the instance is\n    /// `.owned`, a new holder will be constructed to manage the value pointer.\n    static void init_instance(detail::instance *inst, const void *holder_ptr) {\n        auto v_h = inst->get_value_and_holder(detail::get_type_info(typeid(type)));\n        if (!v_h.instance_registered()) {\n            register_instance(inst, v_h.value_ptr(), v_h.type);\n            v_h.set_instance_registered();\n        }\n        init_holder(inst, v_h, (const holder_type *) holder_ptr, v_h.value_ptr<type>());\n    }\n\n    /// Deallocates an instance; via holder, if constructed; otherwise via operator delete.\n    static void dealloc(detail::value_and_holder &v_h) {\n        // We could be deallocating because we are cleaning up after a Python exception.\n        // If so, the Python error indicator will be set. We need to clear that before\n        // running the destructor, in case the destructor code calls more Python.\n        // If we don't, the Python API will exit with an exception, and pybind11 will\n        // throw error_already_set from the C++ destructor which is forbidden and triggers\n        // std::terminate().\n        error_scope scope;\n        if (v_h.holder_constructed()) {\n            v_h.holder<holder_type>().~holder_type();\n            v_h.set_holder_constructed(false);\n        } else {\n            detail::call_operator_delete(\n                v_h.value_ptr<type>(), v_h.type->type_size, v_h.type->type_align);\n        }\n        v_h.value_ptr() = nullptr;\n    }\n\n    static detail::function_record *get_function_record(handle h) {\n        h = detail::get_function(h);\n        if (!h) {\n            return nullptr;\n        }\n\n        handle func_self = PyCFunction_GET_SELF(h.ptr());\n        if (!func_self) {\n            throw error_already_set();\n        }\n        if (!isinstance<capsule>(func_self)) {\n            return nullptr;\n        }\n        auto cap = reinterpret_borrow<capsule>(func_self);\n        if (!detail::is_function_record_capsule(cap)) {\n            return nullptr;\n        }\n        return cap.get_pointer<detail::function_record>();\n    }\n};\n\n/// Binds an existing constructor taking arguments Args...\ntemplate <typename... Args>\ndetail::initimpl::constructor<Args...> init() {\n    return {};\n}\n/// Like `init<Args...>()`, but the instance is always constructed through the alias class (even\n/// when not inheriting on the Python side).\ntemplate <typename... Args>\ndetail::initimpl::alias_constructor<Args...> init_alias() {\n    return {};\n}\n\n/// Binds a factory function as a constructor\ntemplate <typename Func, typename Ret = detail::initimpl::factory<Func>>\nRet init(Func &&f) {\n    return {std::forward<Func>(f)};\n}\n\n/// Dual-argument factory function: the first function is called when no alias is needed, the\n/// second when an alias is needed (i.e. due to python-side inheritance).  Arguments must be\n/// identical.\ntemplate <typename CFunc, typename AFunc, typename Ret = detail::initimpl::factory<CFunc, AFunc>>\nRet init(CFunc &&c, AFunc &&a) {\n    return {std::forward<CFunc>(c), std::forward<AFunc>(a)};\n}\n\n/// Binds pickling functions `__getstate__` and `__setstate__` and ensures that the type\n/// returned by `__getstate__` is the same as the argument accepted by `__setstate__`.\ntemplate <typename GetState, typename SetState>\ndetail::initimpl::pickle_factory<GetState, SetState> pickle(GetState &&g, SetState &&s) {\n    return {std::forward<GetState>(g), std::forward<SetState>(s)};\n}\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ninline str enum_name(handle arg) {\n    dict entries = arg.get_type().attr(\"__entries\");\n    for (auto kv : entries) {\n        if (handle(kv.second[int_(0)]).equal(arg)) {\n            return pybind11::str(kv.first);\n        }\n    }\n    return \"???\";\n}\n\nstruct enum_base {\n    enum_base(const handle &base, const handle &parent) : m_base(base), m_parent(parent) {}\n\n    PYBIND11_NOINLINE void init(bool is_arithmetic, bool is_convertible) {\n        m_base.attr(\"__entries\") = dict();\n        auto property = handle((PyObject *) &PyProperty_Type);\n        auto static_property = handle((PyObject *) get_internals().static_property_type);\n\n        m_base.attr(\"__repr__\") = cpp_function(\n            [](const object &arg) -> str {\n                handle type = type::handle_of(arg);\n                object type_name = type.attr(\"__name__\");\n                return pybind11::str(\"<{}.{}: {}>\")\n                    .format(std::move(type_name), enum_name(arg), int_(arg));\n            },\n            name(\"__repr__\"),\n            is_method(m_base));\n\n        m_base.attr(\"name\") = property(cpp_function(&enum_name, name(\"name\"), is_method(m_base)));\n\n        m_base.attr(\"__str__\") = cpp_function(\n            [](handle arg) -> str {\n                object type_name = type::handle_of(arg).attr(\"__name__\");\n                return pybind11::str(\"{}.{}\").format(std::move(type_name), enum_name(arg));\n            },\n            name(\"name\"),\n            is_method(m_base));\n\n        if (options::show_enum_members_docstring()) {\n            m_base.attr(\"__doc__\") = static_property(\n                cpp_function(\n                    [](handle arg) -> std::string {\n                        std::string docstring;\n                        dict entries = arg.attr(\"__entries\");\n                        if (((PyTypeObject *) arg.ptr())->tp_doc) {\n                            docstring += std::string(\n                                reinterpret_cast<PyTypeObject *>(arg.ptr())->tp_doc);\n                            docstring += \"\\n\\n\";\n                        }\n                        docstring += \"Members:\";\n                        for (auto kv : entries) {\n                            auto key = std::string(pybind11::str(kv.first));\n                            auto comment = kv.second[int_(1)];\n                            docstring += \"\\n\\n  \";\n                            docstring += key;\n                            if (!comment.is_none()) {\n                                docstring += \" : \";\n                                docstring += pybind11::str(comment).cast<std::string>();\n                            }\n                        }\n                        return docstring;\n                    },\n                    name(\"__doc__\")),\n                none(),\n                none(),\n                \"\");\n        }\n\n        m_base.attr(\"__members__\") = static_property(cpp_function(\n                                                         [](handle arg) -> dict {\n                                                             dict entries = arg.attr(\"__entries\"),\n                                                                  m;\n                                                             for (auto kv : entries) {\n                                                                 m[kv.first] = kv.second[int_(0)];\n                                                             }\n                                                             return m;\n                                                         },\n                                                         name(\"__members__\")),\n                                                     none(),\n                                                     none(),\n                                                     \"\");\n\n#define PYBIND11_ENUM_OP_STRICT(op, expr, strict_behavior)                                        \\\n    m_base.attr(op) = cpp_function(                                                               \\\n        [](const object &a, const object &b) {                                                    \\\n            if (!type::handle_of(a).is(type::handle_of(b)))                                       \\\n                strict_behavior; /* NOLINT(bugprone-macro-parentheses) */                         \\\n            return expr;                                                                          \\\n        },                                                                                        \\\n        name(op),                                                                                 \\\n        is_method(m_base),                                                                        \\\n        arg(\"other\"))\n\n#define PYBIND11_ENUM_OP_CONV(op, expr)                                                           \\\n    m_base.attr(op) = cpp_function(                                                               \\\n        [](const object &a_, const object &b_) {                                                  \\\n            int_ a(a_), b(b_);                                                                    \\\n            return expr;                                                                          \\\n        },                                                                                        \\\n        name(op),                                                                                 \\\n        is_method(m_base),                                                                        \\\n        arg(\"other\"))\n\n#define PYBIND11_ENUM_OP_CONV_LHS(op, expr)                                                       \\\n    m_base.attr(op) = cpp_function(                                                               \\\n        [](const object &a_, const object &b) {                                                   \\\n            int_ a(a_);                                                                           \\\n            return expr;                                                                          \\\n        },                                                                                        \\\n        name(op),                                                                                 \\\n        is_method(m_base),                                                                        \\\n        arg(\"other\"))\n\n        if (is_convertible) {\n            PYBIND11_ENUM_OP_CONV_LHS(\"__eq__\", !b.is_none() && a.equal(b));\n            PYBIND11_ENUM_OP_CONV_LHS(\"__ne__\", b.is_none() || !a.equal(b));\n\n            if (is_arithmetic) {\n                PYBIND11_ENUM_OP_CONV(\"__lt__\", a < b);\n                PYBIND11_ENUM_OP_CONV(\"__gt__\", a > b);\n                PYBIND11_ENUM_OP_CONV(\"__le__\", a <= b);\n                PYBIND11_ENUM_OP_CONV(\"__ge__\", a >= b);\n                PYBIND11_ENUM_OP_CONV(\"__and__\", a & b);\n                PYBIND11_ENUM_OP_CONV(\"__rand__\", a & b);\n                PYBIND11_ENUM_OP_CONV(\"__or__\", a | b);\n                PYBIND11_ENUM_OP_CONV(\"__ror__\", a | b);\n                PYBIND11_ENUM_OP_CONV(\"__xor__\", a ^ b);\n                PYBIND11_ENUM_OP_CONV(\"__rxor__\", a ^ b);\n                m_base.attr(\"__invert__\")\n                    = cpp_function([](const object &arg) { return ~(int_(arg)); },\n                                   name(\"__invert__\"),\n                                   is_method(m_base));\n            }\n        } else {\n            PYBIND11_ENUM_OP_STRICT(\"__eq__\", int_(a).equal(int_(b)), return false);\n            PYBIND11_ENUM_OP_STRICT(\"__ne__\", !int_(a).equal(int_(b)), return true);\n\n            if (is_arithmetic) {\n#define PYBIND11_THROW throw type_error(\"Expected an enumeration of matching type!\");\n                PYBIND11_ENUM_OP_STRICT(\"__lt__\", int_(a) < int_(b), PYBIND11_THROW);\n                PYBIND11_ENUM_OP_STRICT(\"__gt__\", int_(a) > int_(b), PYBIND11_THROW);\n                PYBIND11_ENUM_OP_STRICT(\"__le__\", int_(a) <= int_(b), PYBIND11_THROW);\n                PYBIND11_ENUM_OP_STRICT(\"__ge__\", int_(a) >= int_(b), PYBIND11_THROW);\n#undef PYBIND11_THROW\n            }\n        }\n\n#undef PYBIND11_ENUM_OP_CONV_LHS\n#undef PYBIND11_ENUM_OP_CONV\n#undef PYBIND11_ENUM_OP_STRICT\n\n        m_base.attr(\"__getstate__\") = cpp_function(\n            [](const object &arg) { return int_(arg); }, name(\"__getstate__\"), is_method(m_base));\n\n        m_base.attr(\"__hash__\") = cpp_function(\n            [](const object &arg) { return int_(arg); }, name(\"__hash__\"), is_method(m_base));\n    }\n\n    PYBIND11_NOINLINE void value(char const *name_, object value, const char *doc = nullptr) {\n        dict entries = m_base.attr(\"__entries\");\n        str name(name_);\n        if (entries.contains(name)) {\n            std::string type_name = (std::string) str(m_base.attr(\"__name__\"));\n            throw value_error(std::move(type_name) + \": element \\\"\" + std::string(name_)\n                              + \"\\\" already exists!\");\n        }\n\n        entries[name] = pybind11::make_tuple(value, doc);\n        m_base.attr(std::move(name)) = std::move(value);\n    }\n\n    PYBIND11_NOINLINE void export_values() {\n        dict entries = m_base.attr(\"__entries\");\n        for (auto kv : entries) {\n            m_parent.attr(kv.first) = kv.second[int_(0)];\n        }\n    }\n\n    handle m_base;\n    handle m_parent;\n};\n\ntemplate <bool is_signed, size_t length>\nstruct equivalent_integer {};\ntemplate <>\nstruct equivalent_integer<true, 1> {\n    using type = int8_t;\n};\ntemplate <>\nstruct equivalent_integer<false, 1> {\n    using type = uint8_t;\n};\ntemplate <>\nstruct equivalent_integer<true, 2> {\n    using type = int16_t;\n};\ntemplate <>\nstruct equivalent_integer<false, 2> {\n    using type = uint16_t;\n};\ntemplate <>\nstruct equivalent_integer<true, 4> {\n    using type = int32_t;\n};\ntemplate <>\nstruct equivalent_integer<false, 4> {\n    using type = uint32_t;\n};\ntemplate <>\nstruct equivalent_integer<true, 8> {\n    using type = int64_t;\n};\ntemplate <>\nstruct equivalent_integer<false, 8> {\n    using type = uint64_t;\n};\n\ntemplate <typename IntLike>\nusing equivalent_integer_t =\n    typename equivalent_integer<std::is_signed<IntLike>::value, sizeof(IntLike)>::type;\n\nPYBIND11_NAMESPACE_END(detail)\n\n/// Binds C++ enumerations and enumeration classes to Python\ntemplate <typename Type>\nclass enum_ : public class_<Type> {\npublic:\n    using Base = class_<Type>;\n    using Base::attr;\n    using Base::def;\n    using Base::def_property_readonly;\n    using Base::def_property_readonly_static;\n    using Underlying = typename std::underlying_type<Type>::type;\n    // Scalar is the integer representation of underlying type\n    using Scalar = detail::conditional_t<detail::any_of<detail::is_std_char_type<Underlying>,\n                                                        std::is_same<Underlying, bool>>::value,\n                                         detail::equivalent_integer_t<Underlying>,\n                                         Underlying>;\n\n    template <typename... Extra>\n    enum_(const handle &scope, const char *name, const Extra &...extra)\n        : class_<Type>(scope, name, extra...), m_base(*this, scope) {\n        constexpr bool is_arithmetic = detail::any_of<std::is_same<arithmetic, Extra>...>::value;\n        constexpr bool is_convertible = std::is_convertible<Type, Underlying>::value;\n        m_base.init(is_arithmetic, is_convertible);\n\n        def(init([](Scalar i) { return static_cast<Type>(i); }), arg(\"value\"));\n        def_property_readonly(\"value\", [](Type value) { return (Scalar) value; });\n        def(\"__int__\", [](Type value) { return (Scalar) value; });\n        def(\"__index__\", [](Type value) { return (Scalar) value; });\n        attr(\"__setstate__\") = cpp_function(\n            [](detail::value_and_holder &v_h, Scalar arg) {\n                detail::initimpl::setstate<Base>(\n                    v_h, static_cast<Type>(arg), Py_TYPE(v_h.inst) != v_h.type->type);\n            },\n            detail::is_new_style_constructor(),\n            pybind11::name(\"__setstate__\"),\n            is_method(*this),\n            arg(\"state\"));\n    }\n\n    /// Export enumeration entries into the parent scope\n    enum_ &export_values() {\n        m_base.export_values();\n        return *this;\n    }\n\n    /// Add an enumeration entry\n    enum_ &value(char const *name, Type value, const char *doc = nullptr) {\n        m_base.value(name, pybind11::cast(value, return_value_policy::copy), doc);\n        return *this;\n    }\n\nprivate:\n    detail::enum_base m_base;\n};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\nPYBIND11_NOINLINE void keep_alive_impl(handle nurse, handle patient) {\n    if (!nurse || !patient) {\n        pybind11_fail(\"Could not activate keep_alive!\");\n    }\n\n    if (patient.is_none() || nurse.is_none()) {\n        return; /* Nothing to keep alive or nothing to be kept alive by */\n    }\n\n    auto tinfo = all_type_info(Py_TYPE(nurse.ptr()));\n    if (!tinfo.empty()) {\n        /* It's a pybind-registered type, so we can store the patient in the\n         * internal list. */\n        add_patient(nurse.ptr(), patient.ptr());\n    } else {\n        /* Fall back to clever approach based on weak references taken from\n         * Boost.Python. This is not used for pybind-registered types because\n         * the objects can be destroyed out-of-order in a GC pass. */\n        cpp_function disable_lifesupport([patient](handle weakref) {\n            patient.dec_ref();\n            weakref.dec_ref();\n        });\n\n        weakref wr(nurse, disable_lifesupport);\n\n        patient.inc_ref(); /* reference patient and leak the weak reference */\n        (void) wr.release();\n    }\n}\n\nPYBIND11_NOINLINE void\nkeep_alive_impl(size_t Nurse, size_t Patient, function_call &call, handle ret) {\n    auto get_arg = [&](size_t n) {\n        if (n == 0) {\n            return ret;\n        }\n        if (n == 1 && call.init_self) {\n            return call.init_self;\n        }\n        if (n <= call.args.size()) {\n            return call.args[n - 1];\n        }\n        return handle();\n    };\n\n    keep_alive_impl(get_arg(Nurse), get_arg(Patient));\n}\n\ninline std::pair<decltype(internals::registered_types_py)::iterator, bool>\nall_type_info_get_cache(PyTypeObject *type) {\n    auto res = get_internals()\n                   .registered_types_py\n#ifdef __cpp_lib_unordered_map_try_emplace\n                   .try_emplace(type);\n#else\n                   .emplace(type, std::vector<detail::type_info *>());\n#endif\n    if (res.second) {\n        // New cache entry created; set up a weak reference to automatically remove it if the type\n        // gets destroyed:\n        weakref((PyObject *) type, cpp_function([type](handle wr) {\n                    get_internals().registered_types_py.erase(type);\n\n                    // TODO consolidate the erasure code in pybind11_meta_dealloc() in class.h\n                    auto &cache = get_internals().inactive_override_cache;\n                    for (auto it = cache.begin(), last = cache.end(); it != last;) {\n                        if (it->first == reinterpret_cast<PyObject *>(type)) {\n                            it = cache.erase(it);\n                        } else {\n                            ++it;\n                        }\n                    }\n\n                    wr.dec_ref();\n                }))\n            .release();\n    }\n\n    return res;\n}\n\n/* There are a large number of apparently unused template arguments because\n * each combination requires a separate py::class_ registration.\n */\ntemplate <typename Access,\n          return_value_policy Policy,\n          typename Iterator,\n          typename Sentinel,\n          typename ValueType,\n          typename... Extra>\nstruct iterator_state {\n    Iterator it;\n    Sentinel end;\n    bool first_or_done;\n};\n\n// Note: these helpers take the iterator by non-const reference because some\n// iterators in the wild can't be dereferenced when const. The & after Iterator\n// is required for MSVC < 16.9. SFINAE cannot be reused for result_type due to\n// bugs in ICC, NVCC, and PGI compilers. See PR #3293.\ntemplate <typename Iterator, typename SFINAE = decltype(*std::declval<Iterator &>())>\nstruct iterator_access {\n    using result_type = decltype(*std::declval<Iterator &>());\n    // NOLINTNEXTLINE(readability-const-return-type) // PR #3263\n    result_type operator()(Iterator &it) const { return *it; }\n};\n\ntemplate <typename Iterator, typename SFINAE = decltype((*std::declval<Iterator &>()).first)>\nclass iterator_key_access {\nprivate:\n    using pair_type = decltype(*std::declval<Iterator &>());\n\npublic:\n    /* If either the pair itself or the element of the pair is a reference, we\n     * want to return a reference, otherwise a value. When the decltype\n     * expression is parenthesized it is based on the value category of the\n     * expression; otherwise it is the declared type of the pair member.\n     * The use of declval<pair_type> in the second branch rather than directly\n     * using *std::declval<Iterator &>() is a workaround for nvcc\n     * (it's not used in the first branch because going via decltype and back\n     * through declval does not perfectly preserve references).\n     */\n    using result_type\n        = conditional_t<std::is_reference<decltype(*std::declval<Iterator &>())>::value,\n                        decltype(((*std::declval<Iterator &>()).first)),\n                        decltype(std::declval<pair_type>().first)>;\n    result_type operator()(Iterator &it) const { return (*it).first; }\n};\n\ntemplate <typename Iterator, typename SFINAE = decltype((*std::declval<Iterator &>()).second)>\nclass iterator_value_access {\nprivate:\n    using pair_type = decltype(*std::declval<Iterator &>());\n\npublic:\n    using result_type\n        = conditional_t<std::is_reference<decltype(*std::declval<Iterator &>())>::value,\n                        decltype(((*std::declval<Iterator &>()).second)),\n                        decltype(std::declval<pair_type>().second)>;\n    result_type operator()(Iterator &it) const { return (*it).second; }\n};\n\ntemplate <typename Access,\n          return_value_policy Policy,\n          typename Iterator,\n          typename Sentinel,\n          typename ValueType,\n          typename... Extra>\niterator make_iterator_impl(Iterator first, Sentinel last, Extra &&...extra) {\n    using state = detail::iterator_state<Access, Policy, Iterator, Sentinel, ValueType, Extra...>;\n    // TODO: state captures only the types of Extra, not the values\n\n    if (!detail::get_type_info(typeid(state), false)) {\n        class_<state>(handle(), \"iterator\", pybind11::module_local())\n            .def(\"__iter__\", [](state &s) -> state & { return s; })\n            .def(\n                \"__next__\",\n                [](state &s) -> ValueType {\n                    if (!s.first_or_done) {\n                        ++s.it;\n                    } else {\n                        s.first_or_done = false;\n                    }\n                    if (s.it == s.end) {\n                        s.first_or_done = true;\n                        throw stop_iteration();\n                    }\n                    return Access()(s.it);\n                    // NOLINTNEXTLINE(readability-const-return-type) // PR #3263\n                },\n                std::forward<Extra>(extra)...,\n                Policy);\n    }\n\n    return cast(state{first, last, true});\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n/// Makes a python iterator from a first and past-the-end C++ InputIterator.\ntemplate <return_value_policy Policy = return_value_policy::reference_internal,\n          typename Iterator,\n          typename Sentinel,\n          typename ValueType = typename detail::iterator_access<Iterator>::result_type,\n          typename... Extra>\niterator make_iterator(Iterator first, Sentinel last, Extra &&...extra) {\n    return detail::make_iterator_impl<detail::iterator_access<Iterator>,\n                                      Policy,\n                                      Iterator,\n                                      Sentinel,\n                                      ValueType,\n                                      Extra...>(first, last, std::forward<Extra>(extra)...);\n}\n\n/// Makes a python iterator over the keys (`.first`) of a iterator over pairs from a\n/// first and past-the-end InputIterator.\ntemplate <return_value_policy Policy = return_value_policy::reference_internal,\n          typename Iterator,\n          typename Sentinel,\n          typename KeyType = typename detail::iterator_key_access<Iterator>::result_type,\n          typename... Extra>\niterator make_key_iterator(Iterator first, Sentinel last, Extra &&...extra) {\n    return detail::make_iterator_impl<detail::iterator_key_access<Iterator>,\n                                      Policy,\n                                      Iterator,\n                                      Sentinel,\n                                      KeyType,\n                                      Extra...>(first, last, std::forward<Extra>(extra)...);\n}\n\n/// Makes a python iterator over the values (`.second`) of a iterator over pairs from a\n/// first and past-the-end InputIterator.\ntemplate <return_value_policy Policy = return_value_policy::reference_internal,\n          typename Iterator,\n          typename Sentinel,\n          typename ValueType = typename detail::iterator_value_access<Iterator>::result_type,\n          typename... Extra>\niterator make_value_iterator(Iterator first, Sentinel last, Extra &&...extra) {\n    return detail::make_iterator_impl<detail::iterator_value_access<Iterator>,\n                                      Policy,\n                                      Iterator,\n                                      Sentinel,\n                                      ValueType,\n                                      Extra...>(first, last, std::forward<Extra>(extra)...);\n}\n\n/// Makes an iterator over values of an stl container or other container supporting\n/// `std::begin()`/`std::end()`\ntemplate <return_value_policy Policy = return_value_policy::reference_internal,\n          typename Type,\n          typename... Extra>\niterator make_iterator(Type &value, Extra &&...extra) {\n    return make_iterator<Policy>(\n        std::begin(value), std::end(value), std::forward<Extra>(extra)...);\n}\n\n/// Makes an iterator over the keys (`.first`) of a stl map-like container supporting\n/// `std::begin()`/`std::end()`\ntemplate <return_value_policy Policy = return_value_policy::reference_internal,\n          typename Type,\n          typename... Extra>\niterator make_key_iterator(Type &value, Extra &&...extra) {\n    return make_key_iterator<Policy>(\n        std::begin(value), std::end(value), std::forward<Extra>(extra)...);\n}\n\n/// Makes an iterator over the values (`.second`) of a stl map-like container supporting\n/// `std::begin()`/`std::end()`\ntemplate <return_value_policy Policy = return_value_policy::reference_internal,\n          typename Type,\n          typename... Extra>\niterator make_value_iterator(Type &value, Extra &&...extra) {\n    return make_value_iterator<Policy>(\n        std::begin(value), std::end(value), std::forward<Extra>(extra)...);\n}\n\ntemplate <typename InputType, typename OutputType>\nvoid implicitly_convertible() {\n    struct set_flag {\n        bool &flag;\n        explicit set_flag(bool &flag_) : flag(flag_) { flag_ = true; }\n        ~set_flag() { flag = false; }\n    };\n    auto implicit_caster = [](PyObject *obj, PyTypeObject *type) -> PyObject * {\n        static bool currently_used = false;\n        if (currently_used) { // implicit conversions are non-reentrant\n            return nullptr;\n        }\n        set_flag flag_helper(currently_used);\n        if (!detail::make_caster<InputType>().load(obj, false)) {\n            return nullptr;\n        }\n        tuple args(1);\n        args[0] = obj;\n        PyObject *result = PyObject_Call((PyObject *) type, args.ptr(), nullptr);\n        if (result == nullptr) {\n            PyErr_Clear();\n        }\n        return result;\n    };\n\n    if (auto *tinfo = detail::get_type_info(typeid(OutputType))) {\n        tinfo->implicit_conversions.emplace_back(std::move(implicit_caster));\n    } else {\n        pybind11_fail(\"implicitly_convertible: Unable to find type \" + type_id<OutputType>());\n    }\n}\n\ninline void register_exception_translator(ExceptionTranslator &&translator) {\n    detail::get_internals().registered_exception_translators.push_front(\n        std::forward<ExceptionTranslator>(translator));\n}\n\n/**\n * Add a new module-local exception translator. Locally registered functions\n * will be tried before any globally registered exception translators, which\n * will only be invoked if the module-local handlers do not deal with\n * the exception.\n */\ninline void register_local_exception_translator(ExceptionTranslator &&translator) {\n    detail::get_local_internals().registered_exception_translators.push_front(\n        std::forward<ExceptionTranslator>(translator));\n}\n\n/**\n * Wrapper to generate a new Python exception type.\n *\n * This should only be used with PyErr_SetString for now.\n * It is not (yet) possible to use as a py::base.\n * Template type argument is reserved for future use.\n */\ntemplate <typename type>\nclass exception : public object {\npublic:\n    exception() = default;\n    exception(handle scope, const char *name, handle base = PyExc_Exception) {\n        std::string full_name\n            = scope.attr(\"__name__\").cast<std::string>() + std::string(\".\") + name;\n        m_ptr = PyErr_NewException(const_cast<char *>(full_name.c_str()), base.ptr(), nullptr);\n        if (hasattr(scope, \"__dict__\") && scope.attr(\"__dict__\").contains(name)) {\n            pybind11_fail(\"Error during initialization: multiple incompatible \"\n                          \"definitions with name \\\"\"\n                          + std::string(name) + \"\\\"\");\n        }\n        scope.attr(name) = *this;\n    }\n\n    // Sets the current python exception to this exception object with the given message\n    void operator()(const char *message) { PyErr_SetString(m_ptr, message); }\n};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n// Returns a reference to a function-local static exception object used in the simple\n// register_exception approach below.  (It would be simpler to have the static local variable\n// directly in register_exception, but that makes clang <3.5 segfault - issue #1349).\ntemplate <typename CppException>\nexception<CppException> &get_exception_object() {\n    static exception<CppException> ex;\n    return ex;\n}\n\n// Helper function for register_exception and register_local_exception\ntemplate <typename CppException>\nexception<CppException> &\nregister_exception_impl(handle scope, const char *name, handle base, bool isLocal) {\n    auto &ex = detail::get_exception_object<CppException>();\n    if (!ex) {\n        ex = exception<CppException>(scope, name, base);\n    }\n\n    auto register_func\n        = isLocal ? &register_local_exception_translator : &register_exception_translator;\n\n    register_func([](std::exception_ptr p) {\n        if (!p) {\n            return;\n        }\n        try {\n            std::rethrow_exception(p);\n        } catch (const CppException &e) {\n            detail::get_exception_object<CppException>()(e.what());\n        }\n    });\n    return ex;\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n/**\n * Registers a Python exception in `m` of the given `name` and installs a translator to\n * translate the C++ exception to the created Python exception using the what() method.\n * This is intended for simple exception translations; for more complex translation, register the\n * exception object and translator directly.\n */\ntemplate <typename CppException>\nexception<CppException> &\nregister_exception(handle scope, const char *name, handle base = PyExc_Exception) {\n    return detail::register_exception_impl<CppException>(scope, name, base, false /* isLocal */);\n}\n\n/**\n * Registers a Python exception in `m` of the given `name` and installs a translator to\n * translate the C++ exception to the created Python exception using the what() method.\n * This translator will only be used for exceptions that are thrown in this module and will be\n * tried before global exception translators, including those registered with register_exception.\n * This is intended for simple exception translations; for more complex translation, register the\n * exception object and translator directly.\n */\ntemplate <typename CppException>\nexception<CppException> &\nregister_local_exception(handle scope, const char *name, handle base = PyExc_Exception) {\n    return detail::register_exception_impl<CppException>(scope, name, base, true /* isLocal */);\n}\n\nPYBIND11_NAMESPACE_BEGIN(detail)\nPYBIND11_NOINLINE void print(const tuple &args, const dict &kwargs) {\n    auto strings = tuple(args.size());\n    for (size_t i = 0; i < args.size(); ++i) {\n        strings[i] = str(args[i]);\n    }\n    auto sep = kwargs.contains(\"sep\") ? kwargs[\"sep\"] : str(\" \");\n    auto line = sep.attr(\"join\")(std::move(strings));\n\n    object file;\n    if (kwargs.contains(\"file\")) {\n        file = kwargs[\"file\"].cast<object>();\n    } else {\n        try {\n            file = module_::import(\"sys\").attr(\"stdout\");\n        } catch (const error_already_set &) {\n            /* If print() is called from code that is executed as\n               part of garbage collection during interpreter shutdown,\n               importing 'sys' can fail. Give up rather than crashing the\n               interpreter in this case. */\n            return;\n        }\n    }\n\n    auto write = file.attr(\"write\");\n    write(std::move(line));\n    write(kwargs.contains(\"end\") ? kwargs[\"end\"] : str(\"\\n\"));\n\n    if (kwargs.contains(\"flush\") && kwargs[\"flush\"].cast<bool>()) {\n        file.attr(\"flush\")();\n    }\n}\nPYBIND11_NAMESPACE_END(detail)\n\ntemplate <return_value_policy policy = return_value_policy::automatic_reference, typename... Args>\nvoid print(Args &&...args) {\n    auto c = detail::collect_arguments<policy>(std::forward<Args>(args)...);\n    detail::print(c.args(), c.kwargs());\n}\n\ninline void\nerror_already_set::m_fetched_error_deleter(detail::error_fetch_and_normalize *raw_ptr) {\n    gil_scoped_acquire gil;\n    error_scope scope;\n    delete raw_ptr;\n}\n\ninline const char *error_already_set::what() const noexcept {\n    gil_scoped_acquire gil;\n    error_scope scope;\n    return m_fetched_error->error_string().c_str();\n}\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\ninline function\nget_type_override(const void *this_ptr, const type_info *this_type, const char *name) {\n    handle self = get_object_handle(this_ptr, this_type);\n    if (!self) {\n        return function();\n    }\n    handle type = type::handle_of(self);\n    auto key = std::make_pair(type.ptr(), name);\n\n    /* Cache functions that aren't overridden in Python to avoid\n       many costly Python dictionary lookups below */\n    auto &cache = get_internals().inactive_override_cache;\n    if (cache.find(key) != cache.end()) {\n        return function();\n    }\n\n    function override = getattr(self, name, function());\n    if (override.is_cpp_function()) {\n        cache.insert(std::move(key));\n        return function();\n    }\n\n    /* Don't call dispatch code if invoked from overridden function.\n       Unfortunately this doesn't work on PyPy. */\n#if !defined(PYPY_VERSION)\n#    if PY_VERSION_HEX >= 0x03090000\n    PyFrameObject *frame = PyThreadState_GetFrame(PyThreadState_Get());\n    if (frame != nullptr) {\n        PyCodeObject *f_code = PyFrame_GetCode(frame);\n        // f_code is guaranteed to not be NULL\n        if ((std::string) str(f_code->co_name) == name && f_code->co_argcount > 0) {\n            PyObject *locals = PyEval_GetLocals();\n            if (locals != nullptr) {\n                PyObject *co_varnames = PyObject_GetAttrString((PyObject *) f_code, \"co_varnames\");\n                PyObject *self_arg = PyTuple_GET_ITEM(co_varnames, 0);\n                Py_DECREF(co_varnames);\n                PyObject *self_caller = dict_getitem(locals, self_arg);\n                if (self_caller == self.ptr()) {\n                    Py_DECREF(f_code);\n                    Py_DECREF(frame);\n                    return function();\n                }\n            }\n        }\n        Py_DECREF(f_code);\n        Py_DECREF(frame);\n    }\n#    else\n    PyFrameObject *frame = PyThreadState_Get()->frame;\n    if (frame != nullptr && (std::string) str(frame->f_code->co_name) == name\n        && frame->f_code->co_argcount > 0) {\n        PyFrame_FastToLocals(frame);\n        PyObject *self_caller\n            = dict_getitem(frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));\n        if (self_caller == self.ptr()) {\n            return function();\n        }\n    }\n#    endif\n\n#else\n    /* PyPy currently doesn't provide a detailed cpyext emulation of\n       frame objects, so we have to emulate this using Python. This\n       is going to be slow..*/\n    dict d;\n    d[\"self\"] = self;\n    d[\"name\"] = pybind11::str(name);\n    PyObject *result\n        = PyRun_String(\"import inspect\\n\"\n                       \"frame = inspect.currentframe()\\n\"\n                       \"if frame is not None:\\n\"\n                       \"    frame = frame.f_back\\n\"\n                       \"    if frame is not None and str(frame.f_code.co_name) == name and \"\n                       \"frame.f_code.co_argcount > 0:\\n\"\n                       \"        self_caller = frame.f_locals[frame.f_code.co_varnames[0]]\\n\"\n                       \"        if self_caller == self:\\n\"\n                       \"            self = None\\n\",\n                       Py_file_input,\n                       d.ptr(),\n                       d.ptr());\n    if (result == nullptr)\n        throw error_already_set();\n    Py_DECREF(result);\n    if (d[\"self\"].is_none())\n        return function();\n#endif\n\n    return override;\n}\nPYBIND11_NAMESPACE_END(detail)\n\n/** \\rst\n  Try to retrieve a python method by the provided name from the instance pointed to by the\n  this_ptr.\n\n  :this_ptr: The pointer to the object the overridden method should be retrieved for. This should\n             be the first non-trampoline class encountered in the inheritance chain.\n  :name: The name of the overridden Python method to retrieve.\n  :return: The Python method by this name from the object or an empty function wrapper.\n \\endrst */\ntemplate <class T>\nfunction get_override(const T *this_ptr, const char *name) {\n    auto *tinfo = detail::get_type_info(typeid(T));\n    return tinfo ? detail::get_type_override(this_ptr, tinfo, name) : function();\n}\n\n#define PYBIND11_OVERRIDE_IMPL(ret_type, cname, name, ...)                                        \\\n    do {                                                                                          \\\n        pybind11::gil_scoped_acquire gil;                                                         \\\n        pybind11::function override                                                               \\\n            = pybind11::get_override(static_cast<const cname *>(this), name);                     \\\n        if (override) {                                                                           \\\n            auto o = override(__VA_ARGS__);                                                       \\\n            if (pybind11::detail::cast_is_temporary_value_reference<ret_type>::value) {           \\\n                static pybind11::detail::override_caster_t<ret_type> caster;                      \\\n                return pybind11::detail::cast_ref<ret_type>(std::move(o), caster);                \\\n            }                                                                                     \\\n            return pybind11::detail::cast_safe<ret_type>(std::move(o));                           \\\n        }                                                                                         \\\n    } while (false)\n\n/** \\rst\n    Macro to populate the virtual method in the trampoline class. This macro tries to look up a\n    method named 'fn' from the Python side, deals with the :ref:`gil` and necessary argument\n    conversions to call this method and return the appropriate type.\n    See :ref:`overriding_virtuals` for more information. This macro should be used when the method\n    name in C is not the same as the method name in Python. For example with `__str__`.\n\n    .. code-block:: cpp\n\n      std::string toString() override {\n        PYBIND11_OVERRIDE_NAME(\n            std::string, // Return type (ret_type)\n            Animal,      // Parent class (cname)\n            \"__str__\",   // Name of method in Python (name)\n            toString,    // Name of function in C++ (fn)\n        );\n      }\n\\endrst */\n#define PYBIND11_OVERRIDE_NAME(ret_type, cname, name, fn, ...)                                    \\\n    do {                                                                                          \\\n        PYBIND11_OVERRIDE_IMPL(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, __VA_ARGS__); \\\n        return cname::fn(__VA_ARGS__);                                                            \\\n    } while (false)\n\n/** \\rst\n    Macro for pure virtual functions, this function is identical to\n    :c:macro:`PYBIND11_OVERRIDE_NAME`, except that it throws if no override can be found.\n\\endrst */\n#define PYBIND11_OVERRIDE_PURE_NAME(ret_type, cname, name, fn, ...)                               \\\n    do {                                                                                          \\\n        PYBIND11_OVERRIDE_IMPL(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, __VA_ARGS__); \\\n        pybind11::pybind11_fail(                                                                  \\\n            \"Tried to call pure virtual function \\\"\" PYBIND11_STRINGIFY(cname) \"::\" name \"\\\"\");   \\\n    } while (false)\n\n/** \\rst\n    Macro to populate the virtual method in the trampoline class. This macro tries to look up the\n    method from the Python side, deals with the :ref:`gil` and necessary argument conversions to\n    call this method and return the appropriate type. This macro should be used if the method name\n    in C and in Python are identical.\n    See :ref:`overriding_virtuals` for more information.\n\n    .. code-block:: cpp\n\n      class PyAnimal : public Animal {\n      public:\n          // Inherit the constructors\n          using Animal::Animal;\n\n          // Trampoline (need one for each virtual function)\n          std::string go(int n_times) override {\n              PYBIND11_OVERRIDE_PURE(\n                  std::string, // Return type (ret_type)\n                  Animal,      // Parent class (cname)\n                  go,          // Name of function in C++ (must match Python name) (fn)\n                  n_times      // Argument(s) (...)\n              );\n          }\n      };\n\\endrst */\n#define PYBIND11_OVERRIDE(ret_type, cname, fn, ...)                                               \\\n    PYBIND11_OVERRIDE_NAME(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), #fn, fn, __VA_ARGS__)\n\n/** \\rst\n    Macro for pure virtual functions, this function is identical to :c:macro:`PYBIND11_OVERRIDE`,\n    except that it throws if no override can be found.\n\\endrst */\n#define PYBIND11_OVERRIDE_PURE(ret_type, cname, fn, ...)                                          \\\n    PYBIND11_OVERRIDE_PURE_NAME(                                                                  \\\n        PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), #fn, fn, __VA_ARGS__)\n\n// Deprecated versions\n\nPYBIND11_DEPRECATED(\"get_type_overload has been deprecated\")\ninline function\nget_type_overload(const void *this_ptr, const detail::type_info *this_type, const char *name) {\n    return detail::get_type_override(this_ptr, this_type, name);\n}\n\ntemplate <class T>\ninline function get_overload(const T *this_ptr, const char *name) {\n    return get_override(this_ptr, name);\n}\n\n#define PYBIND11_OVERLOAD_INT(ret_type, cname, name, ...)                                         \\\n    PYBIND11_OVERRIDE_IMPL(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, __VA_ARGS__)\n#define PYBIND11_OVERLOAD_NAME(ret_type, cname, name, fn, ...)                                    \\\n    PYBIND11_OVERRIDE_NAME(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, fn, __VA_ARGS__)\n#define PYBIND11_OVERLOAD_PURE_NAME(ret_type, cname, name, fn, ...)                               \\\n    PYBIND11_OVERRIDE_PURE_NAME(                                                                  \\\n        PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, fn, __VA_ARGS__);\n#define PYBIND11_OVERLOAD(ret_type, cname, fn, ...)                                               \\\n    PYBIND11_OVERRIDE(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), fn, __VA_ARGS__)\n#define PYBIND11_OVERLOAD_PURE(ret_type, cname, fn, ...)                                          \\\n    PYBIND11_OVERRIDE_PURE(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), fn, __VA_ARGS__);\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/pytypes.h",
    "content": "/*\n    pybind11/pytypes.h: Convenience wrapper classes for basic Python types\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"detail/common.h\"\n#include \"buffer_info.h\"\n\n#include <assert.h>\n#include <cstddef>\n#include <exception>\n#include <frameobject.h>\n#include <iterator>\n#include <memory>\n#include <string>\n#include <type_traits>\n#include <typeinfo>\n#include <utility>\n\n#if defined(PYBIND11_HAS_OPTIONAL)\n#    include <optional>\n#endif\n\n#ifdef PYBIND11_HAS_STRING_VIEW\n#    include <string_view>\n#endif\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\n\nPYBIND11_WARNING_DISABLE_MSVC(4127)\n\n/* A few forward declarations */\nclass handle;\nclass object;\nclass str;\nclass iterator;\nclass type;\nstruct arg;\nstruct arg_v;\n\nPYBIND11_NAMESPACE_BEGIN(detail)\nclass args_proxy;\nbool isinstance_generic(handle obj, const std::type_info &tp);\n\n// Accessor forward declarations\ntemplate <typename Policy>\nclass accessor;\nnamespace accessor_policies {\nstruct obj_attr;\nstruct str_attr;\nstruct generic_item;\nstruct sequence_item;\nstruct list_item;\nstruct tuple_item;\n} // namespace accessor_policies\nusing obj_attr_accessor = accessor<accessor_policies::obj_attr>;\nusing str_attr_accessor = accessor<accessor_policies::str_attr>;\nusing item_accessor = accessor<accessor_policies::generic_item>;\nusing sequence_accessor = accessor<accessor_policies::sequence_item>;\nusing list_accessor = accessor<accessor_policies::list_item>;\nusing tuple_accessor = accessor<accessor_policies::tuple_item>;\n\n/// Tag and check to identify a class which implements the Python object API\nclass pyobject_tag {};\ntemplate <typename T>\nusing is_pyobject = std::is_base_of<pyobject_tag, remove_reference_t<T>>;\n\n/** \\rst\n    A mixin class which adds common functions to `handle`, `object` and various accessors.\n    The only requirement for `Derived` is to implement ``PyObject *Derived::ptr() const``.\n\\endrst */\ntemplate <typename Derived>\nclass object_api : public pyobject_tag {\n    const Derived &derived() const { return static_cast<const Derived &>(*this); }\n\npublic:\n    /** \\rst\n        Return an iterator equivalent to calling ``iter()`` in Python. The object\n        must be a collection which supports the iteration protocol.\n    \\endrst */\n    iterator begin() const;\n    /// Return a sentinel which ends iteration.\n    iterator end() const;\n\n    /** \\rst\n        Return an internal functor to invoke the object's sequence protocol. Casting\n        the returned ``detail::item_accessor`` instance to a `handle` or `object`\n        subclass causes a corresponding call to ``__getitem__``. Assigning a `handle`\n        or `object` subclass causes a call to ``__setitem__``.\n    \\endrst */\n    item_accessor operator[](handle key) const;\n    /// See above (the only difference is that the key's reference is stolen)\n    item_accessor operator[](object &&key) const;\n    /// See above (the only difference is that the key is provided as a string literal)\n    item_accessor operator[](const char *key) const;\n\n    /** \\rst\n        Return an internal functor to access the object's attributes. Casting the\n        returned ``detail::obj_attr_accessor`` instance to a `handle` or `object`\n        subclass causes a corresponding call to ``getattr``. Assigning a `handle`\n        or `object` subclass causes a call to ``setattr``.\n    \\endrst */\n    obj_attr_accessor attr(handle key) const;\n    /// See above (the only difference is that the key's reference is stolen)\n    obj_attr_accessor attr(object &&key) const;\n    /// See above (the only difference is that the key is provided as a string literal)\n    str_attr_accessor attr(const char *key) const;\n\n    /** \\rst\n        Matches * unpacking in Python, e.g. to unpack arguments out of a ``tuple``\n        or ``list`` for a function call. Applying another * to the result yields\n        ** unpacking, e.g. to unpack a dict as function keyword arguments.\n        See :ref:`calling_python_functions`.\n    \\endrst */\n    args_proxy operator*() const;\n\n    /// Check if the given item is contained within this object, i.e. ``item in obj``.\n    template <typename T>\n    bool contains(T &&item) const;\n\n    /** \\rst\n        Assuming the Python object is a function or implements the ``__call__``\n        protocol, ``operator()`` invokes the underlying function, passing an\n        arbitrary set of parameters. The result is returned as a `object` and\n        may need to be converted back into a Python object using `handle::cast()`.\n\n        When some of the arguments cannot be converted to Python objects, the\n        function will throw a `cast_error` exception. When the Python function\n        call fails, a `error_already_set` exception is thrown.\n    \\endrst */\n    template <return_value_policy policy = return_value_policy::automatic_reference,\n              typename... Args>\n    object operator()(Args &&...args) const;\n    template <return_value_policy policy = return_value_policy::automatic_reference,\n              typename... Args>\n    PYBIND11_DEPRECATED(\"call(...) was deprecated in favor of operator()(...)\")\n    object call(Args &&...args) const;\n\n    /// Equivalent to ``obj is other`` in Python.\n    bool is(object_api const &other) const { return derived().ptr() == other.derived().ptr(); }\n    /// Equivalent to ``obj is None`` in Python.\n    bool is_none() const { return derived().ptr() == Py_None; }\n    /// Equivalent to obj == other in Python\n    bool equal(object_api const &other) const { return rich_compare(other, Py_EQ); }\n    bool not_equal(object_api const &other) const { return rich_compare(other, Py_NE); }\n    bool operator<(object_api const &other) const { return rich_compare(other, Py_LT); }\n    bool operator<=(object_api const &other) const { return rich_compare(other, Py_LE); }\n    bool operator>(object_api const &other) const { return rich_compare(other, Py_GT); }\n    bool operator>=(object_api const &other) const { return rich_compare(other, Py_GE); }\n\n    object operator-() const;\n    object operator~() const;\n    object operator+(object_api const &other) const;\n    object operator+=(object_api const &other);\n    object operator-(object_api const &other) const;\n    object operator-=(object_api const &other);\n    object operator*(object_api const &other) const;\n    object operator*=(object_api const &other);\n    object operator/(object_api const &other) const;\n    object operator/=(object_api const &other);\n    object operator|(object_api const &other) const;\n    object operator|=(object_api const &other);\n    object operator&(object_api const &other) const;\n    object operator&=(object_api const &other);\n    object operator^(object_api const &other) const;\n    object operator^=(object_api const &other);\n    object operator<<(object_api const &other) const;\n    object operator<<=(object_api const &other);\n    object operator>>(object_api const &other) const;\n    object operator>>=(object_api const &other);\n\n    PYBIND11_DEPRECATED(\"Use py::str(obj) instead\")\n    pybind11::str str() const;\n\n    /// Get or set the object's docstring, i.e. ``obj.__doc__``.\n    str_attr_accessor doc() const;\n\n    /// Return the object's current reference count\n    int ref_count() const { return static_cast<int>(Py_REFCNT(derived().ptr())); }\n\n    // TODO PYBIND11_DEPRECATED(\n    //     \"Call py::type::handle_of(h) or py::type::of(h) instead of h.get_type()\")\n    handle get_type() const;\n\nprivate:\n    bool rich_compare(object_api const &other, int value) const;\n};\n\ntemplate <typename T>\nusing is_pyobj_ptr_or_nullptr_t = detail::any_of<std::is_same<T, PyObject *>,\n                                                 std::is_same<T, PyObject *const>,\n                                                 std::is_same<T, std::nullptr_t>>;\n\nPYBIND11_NAMESPACE_END(detail)\n\n#if !defined(PYBIND11_HANDLE_REF_DEBUG) && !defined(NDEBUG)\n#    define PYBIND11_HANDLE_REF_DEBUG\n#endif\n\n/** \\rst\n    Holds a reference to a Python object (no reference counting)\n\n    The `handle` class is a thin wrapper around an arbitrary Python object (i.e. a\n    ``PyObject *`` in Python's C API). It does not perform any automatic reference\n    counting and merely provides a basic C++ interface to various Python API functions.\n\n    .. seealso::\n        The `object` class inherits from `handle` and adds automatic reference\n        counting features.\n\\endrst */\nclass handle : public detail::object_api<handle> {\npublic:\n    /// The default constructor creates a handle with a ``nullptr``-valued pointer\n    handle() = default;\n\n    /// Enable implicit conversion from ``PyObject *`` and ``nullptr``.\n    /// Not using ``handle(PyObject *ptr)`` to avoid implicit conversion from ``0``.\n    template <typename T,\n              detail::enable_if_t<detail::is_pyobj_ptr_or_nullptr_t<T>::value, int> = 0>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    handle(T ptr) : m_ptr(ptr) {}\n\n    /// Enable implicit conversion through ``T::operator PyObject *()``.\n    template <\n        typename T,\n        detail::enable_if_t<detail::all_of<detail::none_of<std::is_base_of<handle, T>,\n                                                           detail::is_pyobj_ptr_or_nullptr_t<T>>,\n                                           std::is_convertible<T, PyObject *>>::value,\n                            int>\n        = 0>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    handle(T &obj) : m_ptr(obj) {}\n\n    /// Return the underlying ``PyObject *`` pointer\n    PyObject *ptr() const { return m_ptr; }\n    PyObject *&ptr() { return m_ptr; }\n\n    /** \\rst\n        Manually increase the reference count of the Python object. Usually, it is\n        preferable to use the `object` class which derives from `handle` and calls\n        this function automatically. Returns a reference to itself.\n    \\endrst */\n    const handle &inc_ref() const & {\n#ifdef PYBIND11_HANDLE_REF_DEBUG\n        inc_ref_counter(1);\n#endif\n#ifdef PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF\n        if (m_ptr != nullptr && !PyGILState_Check()) {\n            throw_gilstate_error(\"pybind11::handle::inc_ref()\");\n        }\n#endif\n        Py_XINCREF(m_ptr);\n        return *this;\n    }\n\n    /** \\rst\n        Manually decrease the reference count of the Python object. Usually, it is\n        preferable to use the `object` class which derives from `handle` and calls\n        this function automatically. Returns a reference to itself.\n    \\endrst */\n    const handle &dec_ref() const & {\n#ifdef PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF\n        if (m_ptr != nullptr && !PyGILState_Check()) {\n            throw_gilstate_error(\"pybind11::handle::dec_ref()\");\n        }\n#endif\n        Py_XDECREF(m_ptr);\n        return *this;\n    }\n\n    /** \\rst\n        Attempt to cast the Python object into the given C++ type. A `cast_error`\n        will be throw upon failure.\n    \\endrst */\n    template <typename T>\n    T cast() const;\n    /// Return ``true`` when the `handle` wraps a valid Python object\n    explicit operator bool() const { return m_ptr != nullptr; }\n    /** \\rst\n        Deprecated: Check that the underlying pointers are the same.\n        Equivalent to ``obj1 is obj2`` in Python.\n    \\endrst */\n    PYBIND11_DEPRECATED(\"Use obj1.is(obj2) instead\")\n    bool operator==(const handle &h) const { return m_ptr == h.m_ptr; }\n    PYBIND11_DEPRECATED(\"Use !obj1.is(obj2) instead\")\n    bool operator!=(const handle &h) const { return m_ptr != h.m_ptr; }\n    PYBIND11_DEPRECATED(\"Use handle::operator bool() instead\")\n    bool check() const { return m_ptr != nullptr; }\n\nprotected:\n    PyObject *m_ptr = nullptr;\n\nprivate:\n#ifdef PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF\n    void throw_gilstate_error(const std::string &function_name) const {\n        fprintf(\n            stderr,\n            \"%s is being called while the GIL is either not held or invalid. Please see \"\n            \"https://pybind11.readthedocs.io/en/stable/advanced/\"\n            \"misc.html#common-sources-of-global-interpreter-lock-errors for debugging advice.\\n\",\n            function_name.c_str());\n        fflush(stderr);\n        if (Py_TYPE(m_ptr)->tp_name != nullptr) {\n            fprintf(stderr,\n                    \"The failing %s call was triggered on a %s object.\\n\",\n                    function_name.c_str(),\n                    Py_TYPE(m_ptr)->tp_name);\n            fflush(stderr);\n        }\n        throw std::runtime_error(function_name + \" PyGILState_Check() failure.\");\n    }\n#endif\n\n#ifdef PYBIND11_HANDLE_REF_DEBUG\n    static std::size_t inc_ref_counter(std::size_t add) {\n        thread_local std::size_t counter = 0;\n        counter += add;\n        return counter;\n    }\n\npublic:\n    static std::size_t inc_ref_counter() { return inc_ref_counter(0); }\n#endif\n};\n\n/** \\rst\n    Holds a reference to a Python object (with reference counting)\n\n    Like `handle`, the `object` class is a thin wrapper around an arbitrary Python\n    object (i.e. a ``PyObject *`` in Python's C API). In contrast to `handle`, it\n    optionally increases the object's reference count upon construction, and it\n    *always* decreases the reference count when the `object` instance goes out of\n    scope and is destructed. When using `object` instances consistently, it is much\n    easier to get reference counting right at the first attempt.\n\\endrst */\nclass object : public handle {\npublic:\n    object() = default;\n    PYBIND11_DEPRECATED(\"Use reinterpret_borrow<object>() or reinterpret_steal<object>()\")\n    object(handle h, bool is_borrowed) : handle(h) {\n        if (is_borrowed) {\n            inc_ref();\n        }\n    }\n    /// Copy constructor; always increases the reference count\n    object(const object &o) : handle(o) { inc_ref(); }\n    /// Move constructor; steals the object from ``other`` and preserves its reference count\n    object(object &&other) noexcept : handle(other) { other.m_ptr = nullptr; }\n    /// Destructor; automatically calls `handle::dec_ref()`\n    ~object() { dec_ref(); }\n\n    /** \\rst\n        Resets the internal pointer to ``nullptr`` without decreasing the\n        object's reference count. The function returns a raw handle to the original\n        Python object.\n    \\endrst */\n    handle release() {\n        PyObject *tmp = m_ptr;\n        m_ptr = nullptr;\n        return handle(tmp);\n    }\n\n    object &operator=(const object &other) {\n        // Skip inc_ref and dec_ref if both objects are the same\n        if (!this->is(other)) {\n            other.inc_ref();\n            // Use temporary variable to ensure `*this` remains valid while\n            // `Py_XDECREF` executes, in case `*this` is accessible from Python.\n            handle temp(m_ptr);\n            m_ptr = other.m_ptr;\n            temp.dec_ref();\n        }\n        return *this;\n    }\n\n    object &operator=(object &&other) noexcept {\n        if (this != &other) {\n            handle temp(m_ptr);\n            m_ptr = other.m_ptr;\n            other.m_ptr = nullptr;\n            temp.dec_ref();\n        }\n        return *this;\n    }\n\n#define PYBIND11_INPLACE_OP(iop)                                                                  \\\n    object iop(object_api const &other) { return operator=(handle::iop(other)); }\n\n    PYBIND11_INPLACE_OP(operator+=)\n    PYBIND11_INPLACE_OP(operator-=)\n    PYBIND11_INPLACE_OP(operator*=)\n    PYBIND11_INPLACE_OP(operator/=)\n    PYBIND11_INPLACE_OP(operator|=)\n    PYBIND11_INPLACE_OP(operator&=)\n    PYBIND11_INPLACE_OP(operator^=)\n    PYBIND11_INPLACE_OP(operator<<=)\n    PYBIND11_INPLACE_OP(operator>>=)\n#undef PYBIND11_INPLACE_OP\n\n    // Calling cast() on an object lvalue just copies (via handle::cast)\n    template <typename T>\n    T cast() const &;\n    // Calling on an object rvalue does a move, if needed and/or possible\n    template <typename T>\n    T cast() &&;\n\nprotected:\n    // Tags for choosing constructors from raw PyObject *\n    struct borrowed_t {};\n    struct stolen_t {};\n\n    /// @cond BROKEN\n    template <typename T>\n    friend T reinterpret_borrow(handle);\n    template <typename T>\n    friend T reinterpret_steal(handle);\n    /// @endcond\n\npublic:\n    // Only accessible from derived classes and the reinterpret_* functions\n    object(handle h, borrowed_t) : handle(h) { inc_ref(); }\n    object(handle h, stolen_t) : handle(h) {}\n};\n\n/** \\rst\n    Declare that a `handle` or ``PyObject *`` is a certain type and borrow the reference.\n    The target type ``T`` must be `object` or one of its derived classes. The function\n    doesn't do any conversions or checks. It's up to the user to make sure that the\n    target type is correct.\n\n    .. code-block:: cpp\n\n        PyObject *p = PyList_GetItem(obj, index);\n        py::object o = reinterpret_borrow<py::object>(p);\n        // or\n        py::tuple t = reinterpret_borrow<py::tuple>(p); // <-- `p` must be already be a `tuple`\n\\endrst */\ntemplate <typename T>\nT reinterpret_borrow(handle h) {\n    return {h, object::borrowed_t{}};\n}\n\n/** \\rst\n    Like `reinterpret_borrow`, but steals the reference.\n\n     .. code-block:: cpp\n\n        PyObject *p = PyObject_Str(obj);\n        py::str s = reinterpret_steal<py::str>(p); // <-- `p` must be already be a `str`\n\\endrst */\ntemplate <typename T>\nT reinterpret_steal(handle h) {\n    return {h, object::stolen_t{}};\n}\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n// Equivalent to obj.__class__.__name__ (or obj.__name__ if obj is a class).\ninline const char *obj_class_name(PyObject *obj) {\n    if (PyType_Check(obj)) {\n        return reinterpret_cast<PyTypeObject *>(obj)->tp_name;\n    }\n    return Py_TYPE(obj)->tp_name;\n}\n\nstd::string error_string();\n\nstruct error_fetch_and_normalize {\n    // Immediate normalization is long-established behavior (starting with\n    // https://github.com/pybind/pybind11/commit/135ba8deafb8bf64a15b24d1513899eb600e2011\n    // from Sep 2016) and safest. Normalization could be deferred, but this could mask\n    // errors elsewhere, the performance gain is very minor in typical situations\n    // (usually the dominant bottleneck is EH unwinding), and the implementation here\n    // would be more complex.\n    explicit error_fetch_and_normalize(const char *called) {\n        PyErr_Fetch(&m_type.ptr(), &m_value.ptr(), &m_trace.ptr());\n        if (!m_type) {\n            pybind11_fail(\"Internal error: \" + std::string(called)\n                          + \" called while \"\n                            \"Python error indicator not set.\");\n        }\n        const char *exc_type_name_orig = detail::obj_class_name(m_type.ptr());\n        if (exc_type_name_orig == nullptr) {\n            pybind11_fail(\"Internal error: \" + std::string(called)\n                          + \" failed to obtain the name \"\n                            \"of the original active exception type.\");\n        }\n        m_lazy_error_string = exc_type_name_orig;\n        // PyErr_NormalizeException() may change the exception type if there are cascading\n        // failures. This can potentially be extremely confusing.\n        PyErr_NormalizeException(&m_type.ptr(), &m_value.ptr(), &m_trace.ptr());\n        if (m_type.ptr() == nullptr) {\n            pybind11_fail(\"Internal error: \" + std::string(called)\n                          + \" failed to normalize the \"\n                            \"active exception.\");\n        }\n        const char *exc_type_name_norm = detail::obj_class_name(m_type.ptr());\n        if (exc_type_name_norm == nullptr) {\n            pybind11_fail(\"Internal error: \" + std::string(called)\n                          + \" failed to obtain the name \"\n                            \"of the normalized active exception type.\");\n        }\n#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x07030a00\n        // This behavior runs the risk of masking errors in the error handling, but avoids a\n        // conflict with PyPy, which relies on the normalization here to change OSError to\n        // FileNotFoundError (https://github.com/pybind/pybind11/issues/4075).\n        m_lazy_error_string = exc_type_name_norm;\n#else\n        if (exc_type_name_norm != m_lazy_error_string) {\n            std::string msg = std::string(called)\n                              + \": MISMATCH of original and normalized \"\n                                \"active exception types: \";\n            msg += \"ORIGINAL \";\n            msg += m_lazy_error_string;\n            msg += \" REPLACED BY \";\n            msg += exc_type_name_norm;\n            msg += \": \" + format_value_and_trace();\n            pybind11_fail(msg);\n        }\n#endif\n    }\n\n    error_fetch_and_normalize(const error_fetch_and_normalize &) = delete;\n    error_fetch_and_normalize(error_fetch_and_normalize &&) = delete;\n\n    std::string format_value_and_trace() const {\n        std::string result;\n        std::string message_error_string;\n        if (m_value) {\n            auto value_str = reinterpret_steal<object>(PyObject_Str(m_value.ptr()));\n            constexpr const char *message_unavailable_exc\n                = \"<MESSAGE UNAVAILABLE DUE TO ANOTHER EXCEPTION>\";\n            if (!value_str) {\n                message_error_string = detail::error_string();\n                result = message_unavailable_exc;\n            } else {\n                // Not using `value_str.cast<std::string>()`, to not potentially throw a secondary\n                // error_already_set that will then result in process termination (#4288).\n                auto value_bytes = reinterpret_steal<object>(\n                    PyUnicode_AsEncodedString(value_str.ptr(), \"utf-8\", \"backslashreplace\"));\n                if (!value_bytes) {\n                    message_error_string = detail::error_string();\n                    result = message_unavailable_exc;\n                } else {\n                    char *buffer = nullptr;\n                    Py_ssize_t length = 0;\n                    if (PyBytes_AsStringAndSize(value_bytes.ptr(), &buffer, &length) == -1) {\n                        message_error_string = detail::error_string();\n                        result = message_unavailable_exc;\n                    } else {\n                        result = std::string(buffer, static_cast<std::size_t>(length));\n                    }\n                }\n            }\n        } else {\n            result = \"<MESSAGE UNAVAILABLE>\";\n        }\n        if (result.empty()) {\n            result = \"<EMPTY MESSAGE>\";\n        }\n\n        bool have_trace = false;\n        if (m_trace) {\n#if !defined(PYPY_VERSION)\n            auto *tb = reinterpret_cast<PyTracebackObject *>(m_trace.ptr());\n\n            // Get the deepest trace possible.\n            while (tb->tb_next) {\n                tb = tb->tb_next;\n            }\n\n            PyFrameObject *frame = tb->tb_frame;\n            Py_XINCREF(frame);\n            result += \"\\n\\nAt:\\n\";\n            while (frame) {\n#    if PY_VERSION_HEX >= 0x030900B1\n                PyCodeObject *f_code = PyFrame_GetCode(frame);\n#    else\n                PyCodeObject *f_code = frame->f_code;\n                Py_INCREF(f_code);\n#    endif\n                int lineno = PyFrame_GetLineNumber(frame);\n                result += \"  \";\n                result += handle(f_code->co_filename).cast<std::string>();\n                result += '(';\n                result += std::to_string(lineno);\n                result += \"): \";\n                result += handle(f_code->co_name).cast<std::string>();\n                result += '\\n';\n                Py_DECREF(f_code);\n#    if PY_VERSION_HEX >= 0x030900B1\n                auto *b_frame = PyFrame_GetBack(frame);\n#    else\n                auto *b_frame = frame->f_back;\n                Py_XINCREF(b_frame);\n#    endif\n                Py_DECREF(frame);\n                frame = b_frame;\n            }\n\n            have_trace = true;\n#endif //! defined(PYPY_VERSION)\n        }\n\n        if (!message_error_string.empty()) {\n            if (!have_trace) {\n                result += '\\n';\n            }\n            result += \"\\nMESSAGE UNAVAILABLE DUE TO EXCEPTION: \" + message_error_string;\n        }\n\n        return result;\n    }\n\n    std::string const &error_string() const {\n        if (!m_lazy_error_string_completed) {\n            m_lazy_error_string += \": \" + format_value_and_trace();\n            m_lazy_error_string_completed = true;\n        }\n        return m_lazy_error_string;\n    }\n\n    void restore() {\n        if (m_restore_called) {\n            pybind11_fail(\"Internal error: pybind11::detail::error_fetch_and_normalize::restore() \"\n                          \"called a second time. ORIGINAL ERROR: \"\n                          + error_string());\n        }\n        PyErr_Restore(m_type.inc_ref().ptr(), m_value.inc_ref().ptr(), m_trace.inc_ref().ptr());\n        m_restore_called = true;\n    }\n\n    bool matches(handle exc) const {\n        return (PyErr_GivenExceptionMatches(m_type.ptr(), exc.ptr()) != 0);\n    }\n\n    // Not protecting these for simplicity.\n    object m_type, m_value, m_trace;\n\nprivate:\n    // Only protecting invariants.\n    mutable std::string m_lazy_error_string;\n    mutable bool m_lazy_error_string_completed = false;\n    mutable bool m_restore_called = false;\n};\n\ninline std::string error_string() {\n    return error_fetch_and_normalize(\"pybind11::detail::error_string\").error_string();\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n/// Fetch and hold an error which was already set in Python.  An instance of this is typically\n/// thrown to propagate python-side errors back through C++ which can either be caught manually or\n/// else falls back to the function dispatcher (which then raises the captured error back to\n/// python).\nclass PYBIND11_EXPORT_EXCEPTION error_already_set : public std::exception {\npublic:\n    /// Fetches the current Python exception (using PyErr_Fetch()), which will clear the\n    /// current Python error indicator.\n    error_already_set()\n        : m_fetched_error{new detail::error_fetch_and_normalize(\"pybind11::error_already_set\"),\n                          m_fetched_error_deleter} {}\n\n    /// The what() result is built lazily on demand.\n    /// WARNING: This member function needs to acquire the Python GIL. This can lead to\n    ///          crashes (undefined behavior) if the Python interpreter is finalizing.\n    const char *what() const noexcept override;\n\n    /// Restores the currently-held Python error (which will clear the Python error indicator first\n    /// if already set).\n    /// NOTE: This member function will always restore the normalized exception, which may or may\n    ///       not be the original Python exception.\n    /// WARNING: The GIL must be held when this member function is called!\n    void restore() { m_fetched_error->restore(); }\n\n    /// If it is impossible to raise the currently-held error, such as in a destructor, we can\n    /// write it out using Python's unraisable hook (`sys.unraisablehook`). The error context\n    /// should be some object whose `repr()` helps identify the location of the error. Python\n    /// already knows the type and value of the error, so there is no need to repeat that.\n    void discard_as_unraisable(object err_context) {\n        restore();\n        PyErr_WriteUnraisable(err_context.ptr());\n    }\n    /// An alternate version of `discard_as_unraisable()`, where a string provides information on\n    /// the location of the error. For example, `__func__` could be helpful.\n    /// WARNING: The GIL must be held when this member function is called!\n    void discard_as_unraisable(const char *err_context) {\n        discard_as_unraisable(reinterpret_steal<object>(PYBIND11_FROM_STRING(err_context)));\n    }\n\n    // Does nothing; provided for backwards compatibility.\n    PYBIND11_DEPRECATED(\"Use of error_already_set.clear() is deprecated\")\n    void clear() {}\n\n    /// Check if the currently trapped error type matches the given Python exception class (or a\n    /// subclass thereof).  May also be passed a tuple to search for any exception class matches in\n    /// the given tuple.\n    bool matches(handle exc) const { return m_fetched_error->matches(exc); }\n\n    const object &type() const { return m_fetched_error->m_type; }\n    const object &value() const { return m_fetched_error->m_value; }\n    const object &trace() const { return m_fetched_error->m_trace; }\n\nprivate:\n    std::shared_ptr<detail::error_fetch_and_normalize> m_fetched_error;\n\n    /// WARNING: This custom deleter needs to acquire the Python GIL. This can lead to\n    ///          crashes (undefined behavior) if the Python interpreter is finalizing.\n    static void m_fetched_error_deleter(detail::error_fetch_and_normalize *raw_ptr);\n};\n\n/// Replaces the current Python error indicator with the chosen error, performing a\n/// 'raise from' to indicate that the chosen error was caused by the original error.\ninline void raise_from(PyObject *type, const char *message) {\n    // Based on _PyErr_FormatVFromCause:\n    // https://github.com/python/cpython/blob/467ab194fc6189d9f7310c89937c51abeac56839/Python/errors.c#L405\n    // See https://github.com/pybind/pybind11/pull/2112 for details.\n    PyObject *exc = nullptr, *val = nullptr, *val2 = nullptr, *tb = nullptr;\n\n    assert(PyErr_Occurred());\n    PyErr_Fetch(&exc, &val, &tb);\n    PyErr_NormalizeException(&exc, &val, &tb);\n    if (tb != nullptr) {\n        PyException_SetTraceback(val, tb);\n        Py_DECREF(tb);\n    }\n    Py_DECREF(exc);\n    assert(!PyErr_Occurred());\n\n    PyErr_SetString(type, message);\n\n    PyErr_Fetch(&exc, &val2, &tb);\n    PyErr_NormalizeException(&exc, &val2, &tb);\n    Py_INCREF(val);\n    PyException_SetCause(val2, val);\n    PyException_SetContext(val2, val);\n    PyErr_Restore(exc, val2, tb);\n}\n\n/// Sets the current Python error indicator with the chosen error, performing a 'raise from'\n/// from the error contained in error_already_set to indicate that the chosen error was\n/// caused by the original error.\ninline void raise_from(error_already_set &err, PyObject *type, const char *message) {\n    err.restore();\n    raise_from(type, message);\n}\n\n/** \\defgroup python_builtins const_name\n    Unless stated otherwise, the following C++ functions behave the same\n    as their Python counterparts.\n */\n\n/** \\ingroup python_builtins\n    \\rst\n    Return true if ``obj`` is an instance of ``T``. Type ``T`` must be a subclass of\n    `object` or a class which was exposed to Python as ``py::class_<T>``.\n\\endrst */\ntemplate <typename T, detail::enable_if_t<std::is_base_of<object, T>::value, int> = 0>\nbool isinstance(handle obj) {\n    return T::check_(obj);\n}\n\ntemplate <typename T, detail::enable_if_t<!std::is_base_of<object, T>::value, int> = 0>\nbool isinstance(handle obj) {\n    return detail::isinstance_generic(obj, typeid(T));\n}\n\ntemplate <>\ninline bool isinstance<handle>(handle) = delete;\ntemplate <>\ninline bool isinstance<object>(handle obj) {\n    return obj.ptr() != nullptr;\n}\n\n/// \\ingroup python_builtins\n/// Return true if ``obj`` is an instance of the ``type``.\ninline bool isinstance(handle obj, handle type) {\n    const auto result = PyObject_IsInstance(obj.ptr(), type.ptr());\n    if (result == -1) {\n        throw error_already_set();\n    }\n    return result != 0;\n}\n\n/// \\addtogroup python_builtins\n/// @{\ninline bool hasattr(handle obj, handle name) {\n    return PyObject_HasAttr(obj.ptr(), name.ptr()) == 1;\n}\n\ninline bool hasattr(handle obj, const char *name) {\n    return PyObject_HasAttrString(obj.ptr(), name) == 1;\n}\n\ninline void delattr(handle obj, handle name) {\n    if (PyObject_DelAttr(obj.ptr(), name.ptr()) != 0) {\n        throw error_already_set();\n    }\n}\n\ninline void delattr(handle obj, const char *name) {\n    if (PyObject_DelAttrString(obj.ptr(), name) != 0) {\n        throw error_already_set();\n    }\n}\n\ninline object getattr(handle obj, handle name) {\n    PyObject *result = PyObject_GetAttr(obj.ptr(), name.ptr());\n    if (!result) {\n        throw error_already_set();\n    }\n    return reinterpret_steal<object>(result);\n}\n\ninline object getattr(handle obj, const char *name) {\n    PyObject *result = PyObject_GetAttrString(obj.ptr(), name);\n    if (!result) {\n        throw error_already_set();\n    }\n    return reinterpret_steal<object>(result);\n}\n\ninline object getattr(handle obj, handle name, handle default_) {\n    if (PyObject *result = PyObject_GetAttr(obj.ptr(), name.ptr())) {\n        return reinterpret_steal<object>(result);\n    }\n    PyErr_Clear();\n    return reinterpret_borrow<object>(default_);\n}\n\ninline object getattr(handle obj, const char *name, handle default_) {\n    if (PyObject *result = PyObject_GetAttrString(obj.ptr(), name)) {\n        return reinterpret_steal<object>(result);\n    }\n    PyErr_Clear();\n    return reinterpret_borrow<object>(default_);\n}\n\ninline void setattr(handle obj, handle name, handle value) {\n    if (PyObject_SetAttr(obj.ptr(), name.ptr(), value.ptr()) != 0) {\n        throw error_already_set();\n    }\n}\n\ninline void setattr(handle obj, const char *name, handle value) {\n    if (PyObject_SetAttrString(obj.ptr(), name, value.ptr()) != 0) {\n        throw error_already_set();\n    }\n}\n\ninline ssize_t hash(handle obj) {\n    auto h = PyObject_Hash(obj.ptr());\n    if (h == -1) {\n        throw error_already_set();\n    }\n    return h;\n}\n\n/// @} python_builtins\n\nPYBIND11_NAMESPACE_BEGIN(detail)\ninline handle get_function(handle value) {\n    if (value) {\n        if (PyInstanceMethod_Check(value.ptr())) {\n            value = PyInstanceMethod_GET_FUNCTION(value.ptr());\n        } else if (PyMethod_Check(value.ptr())) {\n            value = PyMethod_GET_FUNCTION(value.ptr());\n        }\n    }\n    return value;\n}\n\n// Reimplementation of python's dict helper functions to ensure that exceptions\n// aren't swallowed (see #2862)\n\n// copied from cpython _PyDict_GetItemStringWithError\ninline PyObject *dict_getitemstring(PyObject *v, const char *key) {\n    PyObject *kv = nullptr, *rv = nullptr;\n    kv = PyUnicode_FromString(key);\n    if (kv == nullptr) {\n        throw error_already_set();\n    }\n\n    rv = PyDict_GetItemWithError(v, kv);\n    Py_DECREF(kv);\n    if (rv == nullptr && PyErr_Occurred()) {\n        throw error_already_set();\n    }\n    return rv;\n}\n\ninline PyObject *dict_getitem(PyObject *v, PyObject *key) {\n    PyObject *rv = PyDict_GetItemWithError(v, key);\n    if (rv == nullptr && PyErr_Occurred()) {\n        throw error_already_set();\n    }\n    return rv;\n}\n\n// Helper aliases/functions to support implicit casting of values given to python\n// accessors/methods. When given a pyobject, this simply returns the pyobject as-is; for other C++\n// type, the value goes through pybind11::cast(obj) to convert it to an `object`.\ntemplate <typename T, enable_if_t<is_pyobject<T>::value, int> = 0>\nauto object_or_cast(T &&o) -> decltype(std::forward<T>(o)) {\n    return std::forward<T>(o);\n}\n// The following casting version is implemented in cast.h:\ntemplate <typename T, enable_if_t<!is_pyobject<T>::value, int> = 0>\nobject object_or_cast(T &&o);\n// Match a PyObject*, which we want to convert directly to handle via its converting constructor\ninline handle object_or_cast(PyObject *ptr) { return ptr; }\n\nPYBIND11_WARNING_PUSH\nPYBIND11_WARNING_DISABLE_MSVC(4522) // warning C4522: multiple assignment operators specified\ntemplate <typename Policy>\nclass accessor : public object_api<accessor<Policy>> {\n    using key_type = typename Policy::key_type;\n\npublic:\n    accessor(handle obj, key_type key) : obj(obj), key(std::move(key)) {}\n    accessor(const accessor &) = default;\n    accessor(accessor &&) noexcept = default;\n\n    // accessor overload required to override default assignment operator (templates are not\n    // allowed to replace default compiler-generated assignments).\n    void operator=(const accessor &a) && { std::move(*this).operator=(handle(a)); }\n    void operator=(const accessor &a) & { operator=(handle(a)); }\n\n    template <typename T>\n    void operator=(T &&value) && {\n        Policy::set(obj, key, object_or_cast(std::forward<T>(value)));\n    }\n    template <typename T>\n    void operator=(T &&value) & {\n        get_cache() = ensure_object(object_or_cast(std::forward<T>(value)));\n    }\n\n    template <typename T = Policy>\n    PYBIND11_DEPRECATED(\n        \"Use of obj.attr(...) as bool is deprecated in favor of pybind11::hasattr(obj, ...)\")\n    explicit\n    operator enable_if_t<std::is_same<T, accessor_policies::str_attr>::value\n                             || std::is_same<T, accessor_policies::obj_attr>::value,\n                         bool>() const {\n        return hasattr(obj, key);\n    }\n    template <typename T = Policy>\n    PYBIND11_DEPRECATED(\"Use of obj[key] as bool is deprecated in favor of obj.contains(key)\")\n    explicit\n    operator enable_if_t<std::is_same<T, accessor_policies::generic_item>::value, bool>() const {\n        return obj.contains(key);\n    }\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator object() const { return get_cache(); }\n    PyObject *ptr() const { return get_cache().ptr(); }\n    template <typename T>\n    T cast() const {\n        return get_cache().template cast<T>();\n    }\n\nprivate:\n    static object ensure_object(object &&o) { return std::move(o); }\n    static object ensure_object(handle h) { return reinterpret_borrow<object>(h); }\n\n    object &get_cache() const {\n        if (!cache) {\n            cache = Policy::get(obj, key);\n        }\n        return cache;\n    }\n\nprivate:\n    handle obj;\n    key_type key;\n    mutable object cache;\n};\nPYBIND11_WARNING_POP\n\nPYBIND11_NAMESPACE_BEGIN(accessor_policies)\nstruct obj_attr {\n    using key_type = object;\n    static object get(handle obj, handle key) { return getattr(obj, key); }\n    static void set(handle obj, handle key, handle val) { setattr(obj, key, val); }\n};\n\nstruct str_attr {\n    using key_type = const char *;\n    static object get(handle obj, const char *key) { return getattr(obj, key); }\n    static void set(handle obj, const char *key, handle val) { setattr(obj, key, val); }\n};\n\nstruct generic_item {\n    using key_type = object;\n\n    static object get(handle obj, handle key) {\n        PyObject *result = PyObject_GetItem(obj.ptr(), key.ptr());\n        if (!result) {\n            throw error_already_set();\n        }\n        return reinterpret_steal<object>(result);\n    }\n\n    static void set(handle obj, handle key, handle val) {\n        if (PyObject_SetItem(obj.ptr(), key.ptr(), val.ptr()) != 0) {\n            throw error_already_set();\n        }\n    }\n};\n\nstruct sequence_item {\n    using key_type = size_t;\n\n    template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>\n    static object get(handle obj, const IdxType &index) {\n        PyObject *result = PySequence_GetItem(obj.ptr(), ssize_t_cast(index));\n        if (!result) {\n            throw error_already_set();\n        }\n        return reinterpret_steal<object>(result);\n    }\n\n    template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>\n    static void set(handle obj, const IdxType &index, handle val) {\n        // PySequence_SetItem does not steal a reference to 'val'\n        if (PySequence_SetItem(obj.ptr(), ssize_t_cast(index), val.ptr()) != 0) {\n            throw error_already_set();\n        }\n    }\n};\n\nstruct list_item {\n    using key_type = size_t;\n\n    template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>\n    static object get(handle obj, const IdxType &index) {\n        PyObject *result = PyList_GetItem(obj.ptr(), ssize_t_cast(index));\n        if (!result) {\n            throw error_already_set();\n        }\n        return reinterpret_borrow<object>(result);\n    }\n\n    template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>\n    static void set(handle obj, const IdxType &index, handle val) {\n        // PyList_SetItem steals a reference to 'val'\n        if (PyList_SetItem(obj.ptr(), ssize_t_cast(index), val.inc_ref().ptr()) != 0) {\n            throw error_already_set();\n        }\n    }\n};\n\nstruct tuple_item {\n    using key_type = size_t;\n\n    template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>\n    static object get(handle obj, const IdxType &index) {\n        PyObject *result = PyTuple_GetItem(obj.ptr(), ssize_t_cast(index));\n        if (!result) {\n            throw error_already_set();\n        }\n        return reinterpret_borrow<object>(result);\n    }\n\n    template <typename IdxType, detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>\n    static void set(handle obj, const IdxType &index, handle val) {\n        // PyTuple_SetItem steals a reference to 'val'\n        if (PyTuple_SetItem(obj.ptr(), ssize_t_cast(index), val.inc_ref().ptr()) != 0) {\n            throw error_already_set();\n        }\n    }\n};\nPYBIND11_NAMESPACE_END(accessor_policies)\n\n/// STL iterator template used for tuple, list, sequence and dict\ntemplate <typename Policy>\nclass generic_iterator : public Policy {\n    using It = generic_iterator;\n\npublic:\n    using difference_type = ssize_t;\n    using iterator_category = typename Policy::iterator_category;\n    using value_type = typename Policy::value_type;\n    using reference = typename Policy::reference;\n    using pointer = typename Policy::pointer;\n\n    generic_iterator() = default;\n    generic_iterator(handle seq, ssize_t index) : Policy(seq, index) {}\n\n    // NOLINTNEXTLINE(readability-const-return-type) // PR #3263\n    reference operator*() const { return Policy::dereference(); }\n    // NOLINTNEXTLINE(readability-const-return-type) // PR #3263\n    reference operator[](difference_type n) const { return *(*this + n); }\n    pointer operator->() const { return **this; }\n\n    It &operator++() {\n        Policy::increment();\n        return *this;\n    }\n    It operator++(int) {\n        auto copy = *this;\n        Policy::increment();\n        return copy;\n    }\n    It &operator--() {\n        Policy::decrement();\n        return *this;\n    }\n    It operator--(int) {\n        auto copy = *this;\n        Policy::decrement();\n        return copy;\n    }\n    It &operator+=(difference_type n) {\n        Policy::advance(n);\n        return *this;\n    }\n    It &operator-=(difference_type n) {\n        Policy::advance(-n);\n        return *this;\n    }\n\n    friend It operator+(const It &a, difference_type n) {\n        auto copy = a;\n        return copy += n;\n    }\n    friend It operator+(difference_type n, const It &b) { return b + n; }\n    friend It operator-(const It &a, difference_type n) {\n        auto copy = a;\n        return copy -= n;\n    }\n    friend difference_type operator-(const It &a, const It &b) { return a.distance_to(b); }\n\n    friend bool operator==(const It &a, const It &b) { return a.equal(b); }\n    friend bool operator!=(const It &a, const It &b) { return !(a == b); }\n    friend bool operator<(const It &a, const It &b) { return b - a > 0; }\n    friend bool operator>(const It &a, const It &b) { return b < a; }\n    friend bool operator>=(const It &a, const It &b) { return !(a < b); }\n    friend bool operator<=(const It &a, const It &b) { return !(a > b); }\n};\n\nPYBIND11_NAMESPACE_BEGIN(iterator_policies)\n/// Quick proxy class needed to implement ``operator->`` for iterators which can't return pointers\ntemplate <typename T>\nstruct arrow_proxy {\n    T value;\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    arrow_proxy(T &&value) noexcept : value(std::move(value)) {}\n    T *operator->() const { return &value; }\n};\n\n/// Lightweight iterator policy using just a simple pointer: see ``PySequence_Fast_ITEMS``\nclass sequence_fast_readonly {\nprotected:\n    using iterator_category = std::random_access_iterator_tag;\n    using value_type = handle;\n    using reference = const handle; // PR #3263\n    using pointer = arrow_proxy<const handle>;\n\n    sequence_fast_readonly(handle obj, ssize_t n) : ptr(PySequence_Fast_ITEMS(obj.ptr()) + n) {}\n\n    // NOLINTNEXTLINE(readability-const-return-type) // PR #3263\n    reference dereference() const { return *ptr; }\n    void increment() { ++ptr; }\n    void decrement() { --ptr; }\n    void advance(ssize_t n) { ptr += n; }\n    bool equal(const sequence_fast_readonly &b) const { return ptr == b.ptr; }\n    ssize_t distance_to(const sequence_fast_readonly &b) const { return ptr - b.ptr; }\n\nprivate:\n    PyObject **ptr;\n};\n\n/// Full read and write access using the sequence protocol: see ``detail::sequence_accessor``\nclass sequence_slow_readwrite {\nprotected:\n    using iterator_category = std::random_access_iterator_tag;\n    using value_type = object;\n    using reference = sequence_accessor;\n    using pointer = arrow_proxy<const sequence_accessor>;\n\n    sequence_slow_readwrite(handle obj, ssize_t index) : obj(obj), index(index) {}\n\n    reference dereference() const { return {obj, static_cast<size_t>(index)}; }\n    void increment() { ++index; }\n    void decrement() { --index; }\n    void advance(ssize_t n) { index += n; }\n    bool equal(const sequence_slow_readwrite &b) const { return index == b.index; }\n    ssize_t distance_to(const sequence_slow_readwrite &b) const { return index - b.index; }\n\nprivate:\n    handle obj;\n    ssize_t index;\n};\n\n/// Python's dictionary protocol permits this to be a forward iterator\nclass dict_readonly {\nprotected:\n    using iterator_category = std::forward_iterator_tag;\n    using value_type = std::pair<handle, handle>;\n    using reference = const value_type; // PR #3263\n    using pointer = arrow_proxy<const value_type>;\n\n    dict_readonly() = default;\n    dict_readonly(handle obj, ssize_t pos) : obj(obj), pos(pos) { increment(); }\n\n    // NOLINTNEXTLINE(readability-const-return-type) // PR #3263\n    reference dereference() const { return {key, value}; }\n    void increment() {\n        if (PyDict_Next(obj.ptr(), &pos, &key, &value) == 0) {\n            pos = -1;\n        }\n    }\n    bool equal(const dict_readonly &b) const { return pos == b.pos; }\n\nprivate:\n    handle obj;\n    PyObject *key = nullptr, *value = nullptr;\n    ssize_t pos = -1;\n};\nPYBIND11_NAMESPACE_END(iterator_policies)\n\n#if !defined(PYPY_VERSION)\nusing tuple_iterator = generic_iterator<iterator_policies::sequence_fast_readonly>;\nusing list_iterator = generic_iterator<iterator_policies::sequence_fast_readonly>;\n#else\nusing tuple_iterator = generic_iterator<iterator_policies::sequence_slow_readwrite>;\nusing list_iterator = generic_iterator<iterator_policies::sequence_slow_readwrite>;\n#endif\n\nusing sequence_iterator = generic_iterator<iterator_policies::sequence_slow_readwrite>;\nusing dict_iterator = generic_iterator<iterator_policies::dict_readonly>;\n\ninline bool PyIterable_Check(PyObject *obj) {\n    PyObject *iter = PyObject_GetIter(obj);\n    if (iter) {\n        Py_DECREF(iter);\n        return true;\n    }\n    PyErr_Clear();\n    return false;\n}\n\ninline bool PyNone_Check(PyObject *o) { return o == Py_None; }\ninline bool PyEllipsis_Check(PyObject *o) { return o == Py_Ellipsis; }\n\n#ifdef PYBIND11_STR_LEGACY_PERMISSIVE\ninline bool PyUnicode_Check_Permissive(PyObject *o) {\n    return PyUnicode_Check(o) || PYBIND11_BYTES_CHECK(o);\n}\n#    define PYBIND11_STR_CHECK_FUN detail::PyUnicode_Check_Permissive\n#else\n#    define PYBIND11_STR_CHECK_FUN PyUnicode_Check\n#endif\n\ninline bool PyStaticMethod_Check(PyObject *o) { return o->ob_type == &PyStaticMethod_Type; }\n\nclass kwargs_proxy : public handle {\npublic:\n    explicit kwargs_proxy(handle h) : handle(h) {}\n};\n\nclass args_proxy : public handle {\npublic:\n    explicit args_proxy(handle h) : handle(h) {}\n    kwargs_proxy operator*() const { return kwargs_proxy(*this); }\n};\n\n/// Python argument categories (using PEP 448 terms)\ntemplate <typename T>\nusing is_keyword = std::is_base_of<arg, T>;\ntemplate <typename T>\nusing is_s_unpacking = std::is_same<args_proxy, T>; // * unpacking\ntemplate <typename T>\nusing is_ds_unpacking = std::is_same<kwargs_proxy, T>; // ** unpacking\ntemplate <typename T>\nusing is_positional = satisfies_none_of<T, is_keyword, is_s_unpacking, is_ds_unpacking>;\ntemplate <typename T>\nusing is_keyword_or_ds = satisfies_any_of<T, is_keyword, is_ds_unpacking>;\n\n// Call argument collector forward declarations\ntemplate <return_value_policy policy = return_value_policy::automatic_reference>\nclass simple_collector;\ntemplate <return_value_policy policy = return_value_policy::automatic_reference>\nclass unpacking_collector;\n\nPYBIND11_NAMESPACE_END(detail)\n\n// TODO: After the deprecated constructors are removed, this macro can be simplified by\n//       inheriting ctors: `using Parent::Parent`. It's not an option right now because\n//       the `using` statement triggers the parent deprecation warning even if the ctor\n//       isn't even used.\n#define PYBIND11_OBJECT_COMMON(Name, Parent, CheckFun)                                            \\\npublic:                                                                                           \\\n    PYBIND11_DEPRECATED(\"Use reinterpret_borrow<\" #Name \">() or reinterpret_steal<\" #Name \">()\")  \\\n    Name(handle h, bool is_borrowed)                                                              \\\n        : Parent(is_borrowed ? Parent(h, borrowed_t{}) : Parent(h, stolen_t{})) {}                \\\n    Name(handle h, borrowed_t) : Parent(h, borrowed_t{}) {}                                       \\\n    Name(handle h, stolen_t) : Parent(h, stolen_t{}) {}                                           \\\n    PYBIND11_DEPRECATED(\"Use py::isinstance<py::python_type>(obj) instead\")                       \\\n    bool check() const { return m_ptr != nullptr && (CheckFun(m_ptr) != 0); }                     \\\n    static bool check_(handle h) { return h.ptr() != nullptr && CheckFun(h.ptr()); }              \\\n    template <typename Policy_> /* NOLINTNEXTLINE(google-explicit-constructor) */                 \\\n    Name(const ::pybind11::detail::accessor<Policy_> &a) : Name(object(a)) {}\n\n#define PYBIND11_OBJECT_CVT(Name, Parent, CheckFun, ConvertFun)                                   \\\n    PYBIND11_OBJECT_COMMON(Name, Parent, CheckFun)                                                \\\n    /* This is deliberately not 'explicit' to allow implicit conversion from object: */           \\\n    /* NOLINTNEXTLINE(google-explicit-constructor) */                                             \\\n    Name(const object &o)                                                                         \\\n        : Parent(check_(o) ? o.inc_ref().ptr() : ConvertFun(o.ptr()), stolen_t{}) {               \\\n        if (!m_ptr)                                                                               \\\n            throw ::pybind11::error_already_set();                                                \\\n    }                                                                                             \\\n    /* NOLINTNEXTLINE(google-explicit-constructor) */                                             \\\n    Name(object &&o) : Parent(check_(o) ? o.release().ptr() : ConvertFun(o.ptr()), stolen_t{}) {  \\\n        if (!m_ptr)                                                                               \\\n            throw ::pybind11::error_already_set();                                                \\\n    }\n\n#define PYBIND11_OBJECT_CVT_DEFAULT(Name, Parent, CheckFun, ConvertFun)                           \\\n    PYBIND11_OBJECT_CVT(Name, Parent, CheckFun, ConvertFun)                                       \\\n    Name() = default;\n\n#define PYBIND11_OBJECT_CHECK_FAILED(Name, o_ptr)                                                 \\\n    ::pybind11::type_error(\"Object of type '\"                                                     \\\n                           + ::pybind11::detail::get_fully_qualified_tp_name(Py_TYPE(o_ptr))      \\\n                           + \"' is not an instance of '\" #Name \"'\")\n\n#define PYBIND11_OBJECT(Name, Parent, CheckFun)                                                   \\\n    PYBIND11_OBJECT_COMMON(Name, Parent, CheckFun)                                                \\\n    /* This is deliberately not 'explicit' to allow implicit conversion from object: */           \\\n    /* NOLINTNEXTLINE(google-explicit-constructor) */                                             \\\n    Name(const object &o) : Parent(o) {                                                           \\\n        if (m_ptr && !check_(m_ptr))                                                              \\\n            throw PYBIND11_OBJECT_CHECK_FAILED(Name, m_ptr);                                      \\\n    }                                                                                             \\\n    /* NOLINTNEXTLINE(google-explicit-constructor) */                                             \\\n    Name(object &&o) : Parent(std::move(o)) {                                                     \\\n        if (m_ptr && !check_(m_ptr))                                                              \\\n            throw PYBIND11_OBJECT_CHECK_FAILED(Name, m_ptr);                                      \\\n    }\n\n#define PYBIND11_OBJECT_DEFAULT(Name, Parent, CheckFun)                                           \\\n    PYBIND11_OBJECT(Name, Parent, CheckFun)                                                       \\\n    Name() = default;\n\n/// \\addtogroup pytypes\n/// @{\n\n/** \\rst\n    Wraps a Python iterator so that it can also be used as a C++ input iterator\n\n    Caveat: copying an iterator does not (and cannot) clone the internal\n    state of the Python iterable. This also applies to the post-increment\n    operator. This iterator should only be used to retrieve the current\n    value using ``operator*()``.\n\\endrst */\nclass iterator : public object {\npublic:\n    using iterator_category = std::input_iterator_tag;\n    using difference_type = ssize_t;\n    using value_type = handle;\n    using reference = const handle; // PR #3263\n    using pointer = const handle *;\n\n    PYBIND11_OBJECT_DEFAULT(iterator, object, PyIter_Check)\n\n    iterator &operator++() {\n        advance();\n        return *this;\n    }\n\n    iterator operator++(int) {\n        auto rv = *this;\n        advance();\n        return rv;\n    }\n\n    // NOLINTNEXTLINE(readability-const-return-type) // PR #3263\n    reference operator*() const {\n        if (m_ptr && !value.ptr()) {\n            auto &self = const_cast<iterator &>(*this);\n            self.advance();\n        }\n        return value;\n    }\n\n    pointer operator->() const {\n        operator*();\n        return &value;\n    }\n\n    /** \\rst\n         The value which marks the end of the iteration. ``it == iterator::sentinel()``\n         is equivalent to catching ``StopIteration`` in Python.\n\n         .. code-block:: cpp\n\n             void foo(py::iterator it) {\n                 while (it != py::iterator::sentinel()) {\n                    // use `*it`\n                    ++it;\n                 }\n             }\n    \\endrst */\n    static iterator sentinel() { return {}; }\n\n    friend bool operator==(const iterator &a, const iterator &b) { return a->ptr() == b->ptr(); }\n    friend bool operator!=(const iterator &a, const iterator &b) { return a->ptr() != b->ptr(); }\n\nprivate:\n    void advance() {\n        value = reinterpret_steal<object>(PyIter_Next(m_ptr));\n        if (value.ptr() == nullptr && PyErr_Occurred()) {\n            throw error_already_set();\n        }\n    }\n\nprivate:\n    object value = {};\n};\n\nclass type : public object {\npublic:\n    PYBIND11_OBJECT(type, object, PyType_Check)\n\n    /// Return a type handle from a handle or an object\n    static handle handle_of(handle h) { return handle((PyObject *) Py_TYPE(h.ptr())); }\n\n    /// Return a type object from a handle or an object\n    static type of(handle h) { return type(type::handle_of(h), borrowed_t{}); }\n\n    // Defined in pybind11/cast.h\n    /// Convert C++ type to handle if previously registered. Does not convert\n    /// standard types, like int, float. etc. yet.\n    /// See https://github.com/pybind/pybind11/issues/2486\n    template <typename T>\n    static handle handle_of();\n\n    /// Convert C++ type to type if previously registered. Does not convert\n    /// standard types, like int, float. etc. yet.\n    /// See https://github.com/pybind/pybind11/issues/2486\n    template <typename T>\n    static type of() {\n        return type(type::handle_of<T>(), borrowed_t{});\n    }\n};\n\nclass iterable : public object {\npublic:\n    PYBIND11_OBJECT_DEFAULT(iterable, object, detail::PyIterable_Check)\n};\n\nclass bytes;\n\nclass str : public object {\npublic:\n    PYBIND11_OBJECT_CVT(str, object, PYBIND11_STR_CHECK_FUN, raw_str)\n\n    template <typename SzType, detail::enable_if_t<std::is_integral<SzType>::value, int> = 0>\n    str(const char *c, const SzType &n)\n        : object(PyUnicode_FromStringAndSize(c, ssize_t_cast(n)), stolen_t{}) {\n        if (!m_ptr) {\n            if (PyErr_Occurred()) {\n                throw error_already_set();\n            }\n            pybind11_fail(\"Could not allocate string object!\");\n        }\n    }\n\n    // 'explicit' is explicitly omitted from the following constructors to allow implicit\n    // conversion to py::str from C++ string-like objects\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    str(const char *c = \"\") : object(PyUnicode_FromString(c), stolen_t{}) {\n        if (!m_ptr) {\n            if (PyErr_Occurred()) {\n                throw error_already_set();\n            }\n            pybind11_fail(\"Could not allocate string object!\");\n        }\n    }\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    str(const std::string &s) : str(s.data(), s.size()) {}\n\n#ifdef PYBIND11_HAS_STRING_VIEW\n    // enable_if is needed to avoid \"ambiguous conversion\" errors (see PR #3521).\n    template <typename T, detail::enable_if_t<std::is_same<T, std::string_view>::value, int> = 0>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    str(T s) : str(s.data(), s.size()) {}\n\n#    ifdef PYBIND11_HAS_U8STRING\n    // reinterpret_cast here is safe (C++20 guarantees char8_t has the same size/alignment as char)\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    str(std::u8string_view s) : str(reinterpret_cast<const char *>(s.data()), s.size()) {}\n#    endif\n\n#endif\n\n    explicit str(const bytes &b);\n\n    /** \\rst\n        Return a string representation of the object. This is analogous to\n        the ``str()`` function in Python.\n    \\endrst */\n    explicit str(handle h) : object(raw_str(h.ptr()), stolen_t{}) {\n        if (!m_ptr) {\n            throw error_already_set();\n        }\n    }\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator std::string() const {\n        object temp = *this;\n        if (PyUnicode_Check(m_ptr)) {\n            temp = reinterpret_steal<object>(PyUnicode_AsUTF8String(m_ptr));\n            if (!temp) {\n                throw error_already_set();\n            }\n        }\n        char *buffer = nullptr;\n        ssize_t length = 0;\n        if (PyBytes_AsStringAndSize(temp.ptr(), &buffer, &length) != 0) {\n            throw error_already_set();\n        }\n        return std::string(buffer, (size_t) length);\n    }\n\n    template <typename... Args>\n    str format(Args &&...args) const {\n        return attr(\"format\")(std::forward<Args>(args)...);\n    }\n\nprivate:\n    /// Return string representation -- always returns a new reference, even if already a str\n    static PyObject *raw_str(PyObject *op) {\n        PyObject *str_value = PyObject_Str(op);\n        return str_value;\n    }\n};\n/// @} pytypes\n\ninline namespace literals {\n/** \\rst\n    String literal version of `str`\n \\endrst */\ninline str operator\"\" _s(const char *s, size_t size) { return {s, size}; }\n} // namespace literals\n\n/// \\addtogroup pytypes\n/// @{\nclass bytes : public object {\npublic:\n    PYBIND11_OBJECT(bytes, object, PYBIND11_BYTES_CHECK)\n\n    // Allow implicit conversion:\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    bytes(const char *c = \"\") : object(PYBIND11_BYTES_FROM_STRING(c), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate bytes object!\");\n        }\n    }\n\n    template <typename SzType, detail::enable_if_t<std::is_integral<SzType>::value, int> = 0>\n    bytes(const char *c, const SzType &n)\n        : object(PYBIND11_BYTES_FROM_STRING_AND_SIZE(c, ssize_t_cast(n)), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate bytes object!\");\n        }\n    }\n\n    // Allow implicit conversion:\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    bytes(const std::string &s) : bytes(s.data(), s.size()) {}\n\n    explicit bytes(const pybind11::str &s);\n\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator std::string() const { return string_op<std::string>(); }\n\n#ifdef PYBIND11_HAS_STRING_VIEW\n    // enable_if is needed to avoid \"ambiguous conversion\" errors (see PR #3521).\n    template <typename T, detail::enable_if_t<std::is_same<T, std::string_view>::value, int> = 0>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    bytes(T s) : bytes(s.data(), s.size()) {}\n\n    // Obtain a string view that views the current `bytes` buffer value.  Note that this is only\n    // valid so long as the `bytes` instance remains alive and so generally should not outlive the\n    // lifetime of the `bytes` instance.\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator std::string_view() const { return string_op<std::string_view>(); }\n#endif\nprivate:\n    template <typename T>\n    T string_op() const {\n        char *buffer = nullptr;\n        ssize_t length = 0;\n        if (PyBytes_AsStringAndSize(m_ptr, &buffer, &length) != 0) {\n            throw error_already_set();\n        }\n        return {buffer, static_cast<size_t>(length)};\n    }\n};\n// Note: breathe >= 4.17.0 will fail to build docs if the below two constructors\n// are included in the doxygen group; close here and reopen after as a workaround\n/// @} pytypes\n\ninline bytes::bytes(const pybind11::str &s) {\n    object temp = s;\n    if (PyUnicode_Check(s.ptr())) {\n        temp = reinterpret_steal<object>(PyUnicode_AsUTF8String(s.ptr()));\n        if (!temp) {\n            throw error_already_set();\n        }\n    }\n    char *buffer = nullptr;\n    ssize_t length = 0;\n    if (PyBytes_AsStringAndSize(temp.ptr(), &buffer, &length) != 0) {\n        throw error_already_set();\n    }\n    auto obj = reinterpret_steal<object>(PYBIND11_BYTES_FROM_STRING_AND_SIZE(buffer, length));\n    if (!obj) {\n        pybind11_fail(\"Could not allocate bytes object!\");\n    }\n    m_ptr = obj.release().ptr();\n}\n\ninline str::str(const bytes &b) {\n    char *buffer = nullptr;\n    ssize_t length = 0;\n    if (PyBytes_AsStringAndSize(b.ptr(), &buffer, &length) != 0) {\n        throw error_already_set();\n    }\n    auto obj = reinterpret_steal<object>(PyUnicode_FromStringAndSize(buffer, length));\n    if (!obj) {\n        if (PyErr_Occurred()) {\n            throw error_already_set();\n        }\n        pybind11_fail(\"Could not allocate string object!\");\n    }\n    m_ptr = obj.release().ptr();\n}\n\n/// \\addtogroup pytypes\n/// @{\nclass bytearray : public object {\npublic:\n    PYBIND11_OBJECT_CVT(bytearray, object, PyByteArray_Check, PyByteArray_FromObject)\n\n    template <typename SzType, detail::enable_if_t<std::is_integral<SzType>::value, int> = 0>\n    bytearray(const char *c, const SzType &n)\n        : object(PyByteArray_FromStringAndSize(c, ssize_t_cast(n)), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate bytearray object!\");\n        }\n    }\n\n    bytearray() : bytearray(\"\", 0) {}\n\n    explicit bytearray(const std::string &s) : bytearray(s.data(), s.size()) {}\n\n    size_t size() const { return static_cast<size_t>(PyByteArray_Size(m_ptr)); }\n\n    explicit operator std::string() const {\n        char *buffer = PyByteArray_AS_STRING(m_ptr);\n        ssize_t size = PyByteArray_GET_SIZE(m_ptr);\n        return std::string(buffer, static_cast<size_t>(size));\n    }\n};\n// Note: breathe >= 4.17.0 will fail to build docs if the below two constructors\n// are included in the doxygen group; close here and reopen after as a workaround\n/// @} pytypes\n\n/// \\addtogroup pytypes\n/// @{\nclass none : public object {\npublic:\n    PYBIND11_OBJECT(none, object, detail::PyNone_Check)\n    none() : object(Py_None, borrowed_t{}) {}\n};\n\nclass ellipsis : public object {\npublic:\n    PYBIND11_OBJECT(ellipsis, object, detail::PyEllipsis_Check)\n    ellipsis() : object(Py_Ellipsis, borrowed_t{}) {}\n};\n\nclass bool_ : public object {\npublic:\n    PYBIND11_OBJECT_CVT(bool_, object, PyBool_Check, raw_bool)\n    bool_() : object(Py_False, borrowed_t{}) {}\n    // Allow implicit conversion from and to `bool`:\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    bool_(bool value) : object(value ? Py_True : Py_False, borrowed_t{}) {}\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator bool() const { return (m_ptr != nullptr) && PyLong_AsLong(m_ptr) != 0; }\n\nprivate:\n    /// Return the truth value of an object -- always returns a new reference\n    static PyObject *raw_bool(PyObject *op) {\n        const auto value = PyObject_IsTrue(op);\n        if (value == -1) {\n            return nullptr;\n        }\n        return handle(value != 0 ? Py_True : Py_False).inc_ref().ptr();\n    }\n};\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n// Converts a value to the given unsigned type.  If an error occurs, you get back (Unsigned) -1;\n// otherwise you get back the unsigned long or unsigned long long value cast to (Unsigned).\n// (The distinction is critically important when casting a returned -1 error value to some other\n// unsigned type: (A)-1 != (B)-1 when A and B are unsigned types of different sizes).\ntemplate <typename Unsigned>\nUnsigned as_unsigned(PyObject *o) {\n    if (sizeof(Unsigned) <= sizeof(unsigned long)) {\n        unsigned long v = PyLong_AsUnsignedLong(o);\n        return v == (unsigned long) -1 && PyErr_Occurred() ? (Unsigned) -1 : (Unsigned) v;\n    }\n    unsigned long long v = PyLong_AsUnsignedLongLong(o);\n    return v == (unsigned long long) -1 && PyErr_Occurred() ? (Unsigned) -1 : (Unsigned) v;\n}\nPYBIND11_NAMESPACE_END(detail)\n\nclass int_ : public object {\npublic:\n    PYBIND11_OBJECT_CVT(int_, object, PYBIND11_LONG_CHECK, PyNumber_Long)\n    int_() : object(PyLong_FromLong(0), stolen_t{}) {}\n    // Allow implicit conversion from C++ integral types:\n    template <typename T, detail::enable_if_t<std::is_integral<T>::value, int> = 0>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    int_(T value) {\n        if (sizeof(T) <= sizeof(long)) {\n            if (std::is_signed<T>::value) {\n                m_ptr = PyLong_FromLong((long) value);\n            } else {\n                m_ptr = PyLong_FromUnsignedLong((unsigned long) value);\n            }\n        } else {\n            if (std::is_signed<T>::value) {\n                m_ptr = PyLong_FromLongLong((long long) value);\n            } else {\n                m_ptr = PyLong_FromUnsignedLongLong((unsigned long long) value);\n            }\n        }\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate int object!\");\n        }\n    }\n\n    template <typename T, detail::enable_if_t<std::is_integral<T>::value, int> = 0>\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator T() const {\n        return std::is_unsigned<T>::value  ? detail::as_unsigned<T>(m_ptr)\n               : sizeof(T) <= sizeof(long) ? (T) PyLong_AsLong(m_ptr)\n                                           : (T) PYBIND11_LONG_AS_LONGLONG(m_ptr);\n    }\n};\n\nclass float_ : public object {\npublic:\n    PYBIND11_OBJECT_CVT(float_, object, PyFloat_Check, PyNumber_Float)\n    // Allow implicit conversion from float/double:\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    float_(float value) : object(PyFloat_FromDouble((double) value), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate float object!\");\n        }\n    }\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    float_(double value = .0) : object(PyFloat_FromDouble((double) value), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate float object!\");\n        }\n    }\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator float() const { return (float) PyFloat_AsDouble(m_ptr); }\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    operator double() const { return (double) PyFloat_AsDouble(m_ptr); }\n};\n\nclass weakref : public object {\npublic:\n    PYBIND11_OBJECT_CVT_DEFAULT(weakref, object, PyWeakref_Check, raw_weakref)\n    explicit weakref(handle obj, handle callback = {})\n        : object(PyWeakref_NewRef(obj.ptr(), callback.ptr()), stolen_t{}) {\n        if (!m_ptr) {\n            if (PyErr_Occurred()) {\n                throw error_already_set();\n            }\n            pybind11_fail(\"Could not allocate weak reference!\");\n        }\n    }\n\nprivate:\n    static PyObject *raw_weakref(PyObject *o) { return PyWeakref_NewRef(o, nullptr); }\n};\n\nclass slice : public object {\npublic:\n    PYBIND11_OBJECT_DEFAULT(slice, object, PySlice_Check)\n    slice(handle start, handle stop, handle step)\n        : object(PySlice_New(start.ptr(), stop.ptr(), step.ptr()), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate slice object!\");\n        }\n    }\n\n#ifdef PYBIND11_HAS_OPTIONAL\n    slice(std::optional<ssize_t> start, std::optional<ssize_t> stop, std::optional<ssize_t> step)\n        : slice(index_to_object(start), index_to_object(stop), index_to_object(step)) {}\n#else\n    slice(ssize_t start_, ssize_t stop_, ssize_t step_)\n        : slice(int_(start_), int_(stop_), int_(step_)) {}\n#endif\n\n    bool\n    compute(size_t length, size_t *start, size_t *stop, size_t *step, size_t *slicelength) const {\n        return PySlice_GetIndicesEx((PYBIND11_SLICE_OBJECT *) m_ptr,\n                                    (ssize_t) length,\n                                    (ssize_t *) start,\n                                    (ssize_t *) stop,\n                                    (ssize_t *) step,\n                                    (ssize_t *) slicelength)\n               == 0;\n    }\n    bool compute(\n        ssize_t length, ssize_t *start, ssize_t *stop, ssize_t *step, ssize_t *slicelength) const {\n        return PySlice_GetIndicesEx(\n                   (PYBIND11_SLICE_OBJECT *) m_ptr, length, start, stop, step, slicelength)\n               == 0;\n    }\n\nprivate:\n    template <typename T>\n    static object index_to_object(T index) {\n        return index ? object(int_(*index)) : object(none());\n    }\n};\n\nclass capsule : public object {\npublic:\n    PYBIND11_OBJECT_DEFAULT(capsule, object, PyCapsule_CheckExact)\n    PYBIND11_DEPRECATED(\"Use reinterpret_borrow<capsule>() or reinterpret_steal<capsule>()\")\n    capsule(PyObject *ptr, bool is_borrowed)\n        : object(is_borrowed ? object(ptr, borrowed_t{}) : object(ptr, stolen_t{})) {}\n\n    explicit capsule(const void *value,\n                     const char *name = nullptr,\n                     PyCapsule_Destructor destructor = nullptr)\n        : object(PyCapsule_New(const_cast<void *>(value), name, destructor), stolen_t{}) {\n        if (!m_ptr) {\n            throw error_already_set();\n        }\n    }\n\n    PYBIND11_DEPRECATED(\"Please use the ctor with value, name, destructor args\")\n    capsule(const void *value, PyCapsule_Destructor destructor)\n        : object(PyCapsule_New(const_cast<void *>(value), nullptr, destructor), stolen_t{}) {\n        if (!m_ptr) {\n            throw error_already_set();\n        }\n    }\n\n    capsule(const void *value, void (*destructor)(void *)) {\n        m_ptr = PyCapsule_New(const_cast<void *>(value), nullptr, [](PyObject *o) {\n            // guard if destructor called while err indicator is set\n            error_scope error_guard;\n            auto destructor = reinterpret_cast<void (*)(void *)>(PyCapsule_GetContext(o));\n            if (destructor == nullptr && PyErr_Occurred()) {\n                throw error_already_set();\n            }\n            const char *name = get_name_in_error_scope(o);\n            void *ptr = PyCapsule_GetPointer(o, name);\n            if (ptr == nullptr) {\n                throw error_already_set();\n            }\n\n            if (destructor != nullptr) {\n                destructor(ptr);\n            }\n        });\n\n        if (!m_ptr || PyCapsule_SetContext(m_ptr, reinterpret_cast<void *>(destructor)) != 0) {\n            throw error_already_set();\n        }\n    }\n\n    explicit capsule(void (*destructor)()) {\n        m_ptr = PyCapsule_New(reinterpret_cast<void *>(destructor), nullptr, [](PyObject *o) {\n            const char *name = get_name_in_error_scope(o);\n            auto destructor = reinterpret_cast<void (*)()>(PyCapsule_GetPointer(o, name));\n            if (destructor == nullptr) {\n                throw error_already_set();\n            }\n            destructor();\n        });\n\n        if (!m_ptr) {\n            throw error_already_set();\n        }\n    }\n\n    template <typename T>\n    operator T *() const { // NOLINT(google-explicit-constructor)\n        return get_pointer<T>();\n    }\n\n    /// Get the pointer the capsule holds.\n    template <typename T = void>\n    T *get_pointer() const {\n        const auto *name = this->name();\n        T *result = static_cast<T *>(PyCapsule_GetPointer(m_ptr, name));\n        if (!result) {\n            throw error_already_set();\n        }\n        return result;\n    }\n\n    /// Replaces a capsule's pointer *without* calling the destructor on the existing one.\n    void set_pointer(const void *value) {\n        if (PyCapsule_SetPointer(m_ptr, const_cast<void *>(value)) != 0) {\n            throw error_already_set();\n        }\n    }\n\n    const char *name() const {\n        const char *name = PyCapsule_GetName(m_ptr);\n        if ((name == nullptr) && PyErr_Occurred()) {\n            throw error_already_set();\n        }\n        return name;\n    }\n\n    /// Replaces a capsule's name *without* calling the destructor on the existing one.\n    void set_name(const char *new_name) {\n        if (PyCapsule_SetName(m_ptr, new_name) != 0) {\n            throw error_already_set();\n        }\n    }\n\nprivate:\n    static const char *get_name_in_error_scope(PyObject *o) {\n        error_scope error_guard;\n\n        const char *name = PyCapsule_GetName(o);\n        if ((name == nullptr) && PyErr_Occurred()) {\n            // write out and consume error raised by call to PyCapsule_GetName\n            PyErr_WriteUnraisable(o);\n        }\n\n        return name;\n    }\n};\n\nclass tuple : public object {\npublic:\n    PYBIND11_OBJECT_CVT(tuple, object, PyTuple_Check, PySequence_Tuple)\n    template <typename SzType = ssize_t,\n              detail::enable_if_t<std::is_integral<SzType>::value, int> = 0>\n    // Some compilers generate link errors when using `const SzType &` here:\n    explicit tuple(SzType size = 0) : object(PyTuple_New(ssize_t_cast(size)), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate tuple object!\");\n        }\n    }\n    size_t size() const { return (size_t) PyTuple_Size(m_ptr); }\n    bool empty() const { return size() == 0; }\n    detail::tuple_accessor operator[](size_t index) const { return {*this, index}; }\n    template <typename T, detail::enable_if_t<detail::is_pyobject<T>::value, int> = 0>\n    detail::item_accessor operator[](T &&o) const {\n        return object::operator[](std::forward<T>(o));\n    }\n    detail::tuple_iterator begin() const { return {*this, 0}; }\n    detail::tuple_iterator end() const { return {*this, PyTuple_GET_SIZE(m_ptr)}; }\n};\n\n// We need to put this into a separate function because the Intel compiler\n// fails to compile enable_if_t<all_of<is_keyword_or_ds<Args>...>::value> part below\n// (tested with ICC 2021.1 Beta 20200827).\ntemplate <typename... Args>\nconstexpr bool args_are_all_keyword_or_ds() {\n    return detail::all_of<detail::is_keyword_or_ds<Args>...>::value;\n}\n\nclass dict : public object {\npublic:\n    PYBIND11_OBJECT_CVT(dict, object, PyDict_Check, raw_dict)\n    dict() : object(PyDict_New(), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate dict object!\");\n        }\n    }\n    template <typename... Args,\n              typename = detail::enable_if_t<args_are_all_keyword_or_ds<Args...>()>,\n              // MSVC workaround: it can't compile an out-of-line definition, so defer the\n              // collector\n              typename collector = detail::deferred_t<detail::unpacking_collector<>, Args...>>\n    explicit dict(Args &&...args) : dict(collector(std::forward<Args>(args)...).kwargs()) {}\n\n    size_t size() const { return (size_t) PyDict_Size(m_ptr); }\n    bool empty() const { return size() == 0; }\n    detail::dict_iterator begin() const { return {*this, 0}; }\n    detail::dict_iterator end() const { return {}; }\n    void clear() /* py-non-const */ { PyDict_Clear(ptr()); }\n    template <typename T>\n    bool contains(T &&key) const {\n        auto result = PyDict_Contains(m_ptr, detail::object_or_cast(std::forward<T>(key)).ptr());\n        if (result == -1) {\n            throw error_already_set();\n        }\n        return result == 1;\n    }\n\nprivate:\n    /// Call the `dict` Python type -- always returns a new reference\n    static PyObject *raw_dict(PyObject *op) {\n        if (PyDict_Check(op)) {\n            return handle(op).inc_ref().ptr();\n        }\n        return PyObject_CallFunctionObjArgs((PyObject *) &PyDict_Type, op, nullptr);\n    }\n};\n\nclass sequence : public object {\npublic:\n    PYBIND11_OBJECT_DEFAULT(sequence, object, PySequence_Check)\n    size_t size() const {\n        ssize_t result = PySequence_Size(m_ptr);\n        if (result == -1) {\n            throw error_already_set();\n        }\n        return (size_t) result;\n    }\n    bool empty() const { return size() == 0; }\n    detail::sequence_accessor operator[](size_t index) const { return {*this, index}; }\n    template <typename T, detail::enable_if_t<detail::is_pyobject<T>::value, int> = 0>\n    detail::item_accessor operator[](T &&o) const {\n        return object::operator[](std::forward<T>(o));\n    }\n    detail::sequence_iterator begin() const { return {*this, 0}; }\n    detail::sequence_iterator end() const { return {*this, PySequence_Size(m_ptr)}; }\n};\n\nclass list : public object {\npublic:\n    PYBIND11_OBJECT_CVT(list, object, PyList_Check, PySequence_List)\n    template <typename SzType = ssize_t,\n              detail::enable_if_t<std::is_integral<SzType>::value, int> = 0>\n    // Some compilers generate link errors when using `const SzType &` here:\n    explicit list(SzType size = 0) : object(PyList_New(ssize_t_cast(size)), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate list object!\");\n        }\n    }\n    size_t size() const { return (size_t) PyList_Size(m_ptr); }\n    bool empty() const { return size() == 0; }\n    detail::list_accessor operator[](size_t index) const { return {*this, index}; }\n    template <typename T, detail::enable_if_t<detail::is_pyobject<T>::value, int> = 0>\n    detail::item_accessor operator[](T &&o) const {\n        return object::operator[](std::forward<T>(o));\n    }\n    detail::list_iterator begin() const { return {*this, 0}; }\n    detail::list_iterator end() const { return {*this, PyList_GET_SIZE(m_ptr)}; }\n    template <typename T>\n    void append(T &&val) /* py-non-const */ {\n        if (PyList_Append(m_ptr, detail::object_or_cast(std::forward<T>(val)).ptr()) != 0) {\n            throw error_already_set();\n        }\n    }\n    template <typename IdxType,\n              typename ValType,\n              detail::enable_if_t<std::is_integral<IdxType>::value, int> = 0>\n    void insert(const IdxType &index, ValType &&val) /* py-non-const */ {\n        if (PyList_Insert(m_ptr,\n                          ssize_t_cast(index),\n                          detail::object_or_cast(std::forward<ValType>(val)).ptr())\n            != 0) {\n            throw error_already_set();\n        }\n    }\n};\n\nclass args : public tuple {\n    PYBIND11_OBJECT_DEFAULT(args, tuple, PyTuple_Check)\n};\nclass kwargs : public dict {\n    PYBIND11_OBJECT_DEFAULT(kwargs, dict, PyDict_Check)\n};\n\nclass anyset : public object {\npublic:\n    PYBIND11_OBJECT(anyset, object, PyAnySet_Check)\n    size_t size() const { return static_cast<size_t>(PySet_Size(m_ptr)); }\n    bool empty() const { return size() == 0; }\n    template <typename T>\n    bool contains(T &&val) const {\n        auto result = PySet_Contains(m_ptr, detail::object_or_cast(std::forward<T>(val)).ptr());\n        if (result == -1) {\n            throw error_already_set();\n        }\n        return result == 1;\n    }\n};\n\nclass set : public anyset {\npublic:\n    PYBIND11_OBJECT_CVT(set, anyset, PySet_Check, PySet_New)\n    set() : anyset(PySet_New(nullptr), stolen_t{}) {\n        if (!m_ptr) {\n            pybind11_fail(\"Could not allocate set object!\");\n        }\n    }\n    template <typename T>\n    bool add(T &&val) /* py-non-const */ {\n        return PySet_Add(m_ptr, detail::object_or_cast(std::forward<T>(val)).ptr()) == 0;\n    }\n    void clear() /* py-non-const */ { PySet_Clear(m_ptr); }\n};\n\nclass frozenset : public anyset {\npublic:\n    PYBIND11_OBJECT_CVT(frozenset, anyset, PyFrozenSet_Check, PyFrozenSet_New)\n};\n\nclass function : public object {\npublic:\n    PYBIND11_OBJECT_DEFAULT(function, object, PyCallable_Check)\n    handle cpp_function() const {\n        handle fun = detail::get_function(m_ptr);\n        if (fun && PyCFunction_Check(fun.ptr())) {\n            return fun;\n        }\n        return handle();\n    }\n    bool is_cpp_function() const { return (bool) cpp_function(); }\n};\n\nclass staticmethod : public object {\npublic:\n    PYBIND11_OBJECT_CVT(staticmethod, object, detail::PyStaticMethod_Check, PyStaticMethod_New)\n};\n\nclass buffer : public object {\npublic:\n    PYBIND11_OBJECT_DEFAULT(buffer, object, PyObject_CheckBuffer)\n\n    buffer_info request(bool writable = false) const {\n        int flags = PyBUF_STRIDES | PyBUF_FORMAT;\n        if (writable) {\n            flags |= PyBUF_WRITABLE;\n        }\n        auto *view = new Py_buffer();\n        if (PyObject_GetBuffer(m_ptr, view, flags) != 0) {\n            delete view;\n            throw error_already_set();\n        }\n        return buffer_info(view);\n    }\n};\n\nclass memoryview : public object {\npublic:\n    PYBIND11_OBJECT_CVT(memoryview, object, PyMemoryView_Check, PyMemoryView_FromObject)\n\n    /** \\rst\n        Creates ``memoryview`` from ``buffer_info``.\n\n        ``buffer_info`` must be created from ``buffer::request()``. Otherwise\n        throws an exception.\n\n        For creating a ``memoryview`` from objects that support buffer protocol,\n        use ``memoryview(const object& obj)`` instead of this constructor.\n     \\endrst */\n    explicit memoryview(const buffer_info &info) {\n        if (!info.view()) {\n            pybind11_fail(\"Prohibited to create memoryview without Py_buffer\");\n        }\n        // Note: PyMemoryView_FromBuffer never increments obj reference.\n        m_ptr = (info.view()->obj) ? PyMemoryView_FromObject(info.view()->obj)\n                                   : PyMemoryView_FromBuffer(info.view());\n        if (!m_ptr) {\n            pybind11_fail(\"Unable to create memoryview from buffer descriptor\");\n        }\n    }\n\n    /** \\rst\n        Creates ``memoryview`` from static buffer.\n\n        This method is meant for providing a ``memoryview`` for C/C++ buffer not\n        managed by Python. The caller is responsible for managing the lifetime\n        of ``ptr`` and ``format``, which MUST outlive the memoryview constructed\n        here.\n\n        See also: Python C API documentation for `PyMemoryView_FromBuffer`_.\n\n        .. _PyMemoryView_FromBuffer:\n           https://docs.python.org/c-api/memoryview.html#c.PyMemoryView_FromBuffer\n\n        :param ptr: Pointer to the buffer.\n        :param itemsize: Byte size of an element.\n        :param format: Pointer to the null-terminated format string. For\n            homogeneous Buffers, this should be set to\n            ``format_descriptor<T>::value``.\n        :param shape: Shape of the tensor (1 entry per dimension).\n        :param strides: Number of bytes between adjacent entries (for each\n            per dimension).\n        :param readonly: Flag to indicate if the underlying storage may be\n            written to.\n     \\endrst */\n    static memoryview from_buffer(void *ptr,\n                                  ssize_t itemsize,\n                                  const char *format,\n                                  detail::any_container<ssize_t> shape,\n                                  detail::any_container<ssize_t> strides,\n                                  bool readonly = false);\n\n    static memoryview from_buffer(const void *ptr,\n                                  ssize_t itemsize,\n                                  const char *format,\n                                  detail::any_container<ssize_t> shape,\n                                  detail::any_container<ssize_t> strides) {\n        return memoryview::from_buffer(\n            const_cast<void *>(ptr), itemsize, format, std::move(shape), std::move(strides), true);\n    }\n\n    template <typename T>\n    static memoryview from_buffer(T *ptr,\n                                  detail::any_container<ssize_t> shape,\n                                  detail::any_container<ssize_t> strides,\n                                  bool readonly = false) {\n        return memoryview::from_buffer(reinterpret_cast<void *>(ptr),\n                                       sizeof(T),\n                                       format_descriptor<T>::value,\n                                       std::move(shape),\n                                       std::move(strides),\n                                       readonly);\n    }\n\n    template <typename T>\n    static memoryview from_buffer(const T *ptr,\n                                  detail::any_container<ssize_t> shape,\n                                  detail::any_container<ssize_t> strides) {\n        return memoryview::from_buffer(\n            const_cast<T *>(ptr), std::move(shape), std::move(strides), true);\n    }\n\n    /** \\rst\n        Creates ``memoryview`` from static memory.\n\n        This method is meant for providing a ``memoryview`` for C/C++ buffer not\n        managed by Python. The caller is responsible for managing the lifetime\n        of ``mem``, which MUST outlive the memoryview constructed here.\n\n        See also: Python C API documentation for `PyMemoryView_FromBuffer`_.\n\n        .. _PyMemoryView_FromMemory:\n           https://docs.python.org/c-api/memoryview.html#c.PyMemoryView_FromMemory\n     \\endrst */\n    static memoryview from_memory(void *mem, ssize_t size, bool readonly = false) {\n        PyObject *ptr = PyMemoryView_FromMemory(\n            reinterpret_cast<char *>(mem), size, (readonly) ? PyBUF_READ : PyBUF_WRITE);\n        if (!ptr) {\n            pybind11_fail(\"Could not allocate memoryview object!\");\n        }\n        return memoryview(object(ptr, stolen_t{}));\n    }\n\n    static memoryview from_memory(const void *mem, ssize_t size) {\n        return memoryview::from_memory(const_cast<void *>(mem), size, true);\n    }\n\n#ifdef PYBIND11_HAS_STRING_VIEW\n    static memoryview from_memory(std::string_view mem) {\n        return from_memory(const_cast<char *>(mem.data()), static_cast<ssize_t>(mem.size()), true);\n    }\n#endif\n};\n\n/// @cond DUPLICATE\ninline memoryview memoryview::from_buffer(void *ptr,\n                                          ssize_t itemsize,\n                                          const char *format,\n                                          detail::any_container<ssize_t> shape,\n                                          detail::any_container<ssize_t> strides,\n                                          bool readonly) {\n    size_t ndim = shape->size();\n    if (ndim != strides->size()) {\n        pybind11_fail(\"memoryview: shape length doesn't match strides length\");\n    }\n    ssize_t size = ndim != 0u ? 1 : 0;\n    for (size_t i = 0; i < ndim; ++i) {\n        size *= (*shape)[i];\n    }\n    Py_buffer view;\n    view.buf = ptr;\n    view.obj = nullptr;\n    view.len = size * itemsize;\n    view.readonly = static_cast<int>(readonly);\n    view.itemsize = itemsize;\n    view.format = const_cast<char *>(format);\n    view.ndim = static_cast<int>(ndim);\n    view.shape = shape->data();\n    view.strides = strides->data();\n    view.suboffsets = nullptr;\n    view.internal = nullptr;\n    PyObject *obj = PyMemoryView_FromBuffer(&view);\n    if (!obj) {\n        throw error_already_set();\n    }\n    return memoryview(object(obj, stolen_t{}));\n}\n/// @endcond\n/// @} pytypes\n\n/// \\addtogroup python_builtins\n/// @{\n\n/// Get the length of a Python object.\ninline size_t len(handle h) {\n    ssize_t result = PyObject_Length(h.ptr());\n    if (result < 0) {\n        throw error_already_set();\n    }\n    return (size_t) result;\n}\n\n/// Get the length hint of a Python object.\n/// Returns 0 when this cannot be determined.\ninline size_t len_hint(handle h) {\n    ssize_t result = PyObject_LengthHint(h.ptr(), 0);\n    if (result < 0) {\n        // Sometimes a length can't be determined at all (eg generators)\n        // In which case simply return 0\n        PyErr_Clear();\n        return 0;\n    }\n    return (size_t) result;\n}\n\ninline str repr(handle h) {\n    PyObject *str_value = PyObject_Repr(h.ptr());\n    if (!str_value) {\n        throw error_already_set();\n    }\n    return reinterpret_steal<str>(str_value);\n}\n\ninline iterator iter(handle obj) {\n    PyObject *result = PyObject_GetIter(obj.ptr());\n    if (!result) {\n        throw error_already_set();\n    }\n    return reinterpret_steal<iterator>(result);\n}\n/// @} python_builtins\n\nPYBIND11_NAMESPACE_BEGIN(detail)\ntemplate <typename D>\niterator object_api<D>::begin() const {\n    return iter(derived());\n}\ntemplate <typename D>\niterator object_api<D>::end() const {\n    return iterator::sentinel();\n}\ntemplate <typename D>\nitem_accessor object_api<D>::operator[](handle key) const {\n    return {derived(), reinterpret_borrow<object>(key)};\n}\ntemplate <typename D>\nitem_accessor object_api<D>::operator[](object &&key) const {\n    return {derived(), std::move(key)};\n}\ntemplate <typename D>\nitem_accessor object_api<D>::operator[](const char *key) const {\n    return {derived(), pybind11::str(key)};\n}\ntemplate <typename D>\nobj_attr_accessor object_api<D>::attr(handle key) const {\n    return {derived(), reinterpret_borrow<object>(key)};\n}\ntemplate <typename D>\nobj_attr_accessor object_api<D>::attr(object &&key) const {\n    return {derived(), std::move(key)};\n}\ntemplate <typename D>\nstr_attr_accessor object_api<D>::attr(const char *key) const {\n    return {derived(), key};\n}\ntemplate <typename D>\nargs_proxy object_api<D>::operator*() const {\n    return args_proxy(derived().ptr());\n}\ntemplate <typename D>\ntemplate <typename T>\nbool object_api<D>::contains(T &&item) const {\n    return attr(\"__contains__\")(std::forward<T>(item)).template cast<bool>();\n}\n\ntemplate <typename D>\npybind11::str object_api<D>::str() const {\n    return pybind11::str(derived());\n}\n\ntemplate <typename D>\nstr_attr_accessor object_api<D>::doc() const {\n    return attr(\"__doc__\");\n}\n\ntemplate <typename D>\nhandle object_api<D>::get_type() const {\n    return type::handle_of(derived());\n}\n\ntemplate <typename D>\nbool object_api<D>::rich_compare(object_api const &other, int value) const {\n    int rv = PyObject_RichCompareBool(derived().ptr(), other.derived().ptr(), value);\n    if (rv == -1) {\n        throw error_already_set();\n    }\n    return rv == 1;\n}\n\n#define PYBIND11_MATH_OPERATOR_UNARY(op, fn)                                                      \\\n    template <typename D>                                                                         \\\n    object object_api<D>::op() const {                                                            \\\n        object result = reinterpret_steal<object>(fn(derived().ptr()));                           \\\n        if (!result.ptr())                                                                        \\\n            throw error_already_set();                                                            \\\n        return result;                                                                            \\\n    }\n\n#define PYBIND11_MATH_OPERATOR_BINARY(op, fn)                                                     \\\n    template <typename D>                                                                         \\\n    object object_api<D>::op(object_api const &other) const {                                     \\\n        object result = reinterpret_steal<object>(fn(derived().ptr(), other.derived().ptr()));    \\\n        if (!result.ptr())                                                                        \\\n            throw error_already_set();                                                            \\\n        return result;                                                                            \\\n    }\n\n#define PYBIND11_MATH_OPERATOR_BINARY_INPLACE(iop, fn)                                            \\\n    template <typename D>                                                                         \\\n    object object_api<D>::iop(object_api const &other) {                                          \\\n        object result = reinterpret_steal<object>(fn(derived().ptr(), other.derived().ptr()));    \\\n        if (!result.ptr())                                                                        \\\n            throw error_already_set();                                                            \\\n        return result;                                                                            \\\n    }\n\nPYBIND11_MATH_OPERATOR_UNARY(operator~, PyNumber_Invert)\nPYBIND11_MATH_OPERATOR_UNARY(operator-, PyNumber_Negative)\nPYBIND11_MATH_OPERATOR_BINARY(operator+, PyNumber_Add)\nPYBIND11_MATH_OPERATOR_BINARY_INPLACE(operator+=, PyNumber_InPlaceAdd)\nPYBIND11_MATH_OPERATOR_BINARY(operator-, PyNumber_Subtract)\nPYBIND11_MATH_OPERATOR_BINARY_INPLACE(operator-=, PyNumber_InPlaceSubtract)\nPYBIND11_MATH_OPERATOR_BINARY(operator*, PyNumber_Multiply)\nPYBIND11_MATH_OPERATOR_BINARY_INPLACE(operator*=, PyNumber_InPlaceMultiply)\nPYBIND11_MATH_OPERATOR_BINARY(operator/, PyNumber_TrueDivide)\nPYBIND11_MATH_OPERATOR_BINARY_INPLACE(operator/=, PyNumber_InPlaceTrueDivide)\nPYBIND11_MATH_OPERATOR_BINARY(operator|, PyNumber_Or)\nPYBIND11_MATH_OPERATOR_BINARY_INPLACE(operator|=, PyNumber_InPlaceOr)\nPYBIND11_MATH_OPERATOR_BINARY(operator&, PyNumber_And)\nPYBIND11_MATH_OPERATOR_BINARY_INPLACE(operator&=, PyNumber_InPlaceAnd)\nPYBIND11_MATH_OPERATOR_BINARY(operator^, PyNumber_Xor)\nPYBIND11_MATH_OPERATOR_BINARY_INPLACE(operator^=, PyNumber_InPlaceXor)\nPYBIND11_MATH_OPERATOR_BINARY(operator<<, PyNumber_Lshift)\nPYBIND11_MATH_OPERATOR_BINARY_INPLACE(operator<<=, PyNumber_InPlaceLshift)\nPYBIND11_MATH_OPERATOR_BINARY(operator>>, PyNumber_Rshift)\nPYBIND11_MATH_OPERATOR_BINARY_INPLACE(operator>>=, PyNumber_InPlaceRshift)\n\n#undef PYBIND11_MATH_OPERATOR_UNARY\n#undef PYBIND11_MATH_OPERATOR_BINARY\n#undef PYBIND11_MATH_OPERATOR_BINARY_INPLACE\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/stl/filesystem.h",
    "content": "// Copyright (c) 2021 The Pybind Development Team.\n// All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\n#pragma once\n\n#include \"../pybind11.h\"\n#include \"../detail/common.h\"\n#include \"../detail/descr.h\"\n#include \"../cast.h\"\n#include \"../pytypes.h\"\n\n#include <string>\n\n#ifdef __has_include\n#    if defined(PYBIND11_CPP17)\n#        if __has_include(<filesystem>) && \\\n          PY_VERSION_HEX >= 0x03060000\n#            include <filesystem>\n#            define PYBIND11_HAS_FILESYSTEM 1\n#        elif __has_include(<experimental/filesystem>)\n#            include <experimental/filesystem>\n#            define PYBIND11_HAS_EXPERIMENTAL_FILESYSTEM 1\n#        endif\n#    endif\n#endif\n\n#if !defined(PYBIND11_HAS_FILESYSTEM) && !defined(PYBIND11_HAS_EXPERIMENTAL_FILESYSTEM)           \\\n    && !defined(PYBIND11_HAS_FILESYSTEM_IS_OPTIONAL)\n#    error                                                                                        \\\n        \"Neither #include <filesystem> nor #include <experimental/filesystem is available. (Use -DPYBIND11_HAS_FILESYSTEM_IS_OPTIONAL to ignore.)\"\n#endif\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n#if defined(PYBIND11_HAS_FILESYSTEM) || defined(PYBIND11_HAS_EXPERIMENTAL_FILESYSTEM)\ntemplate <typename T>\nstruct path_caster {\n\nprivate:\n    static PyObject *unicode_from_fs_native(const std::string &w) {\n#    if !defined(PYPY_VERSION)\n        return PyUnicode_DecodeFSDefaultAndSize(w.c_str(), ssize_t(w.size()));\n#    else\n        // PyPy mistakenly declares the first parameter as non-const.\n        return PyUnicode_DecodeFSDefaultAndSize(const_cast<char *>(w.c_str()), ssize_t(w.size()));\n#    endif\n    }\n\n    static PyObject *unicode_from_fs_native(const std::wstring &w) {\n        return PyUnicode_FromWideChar(w.c_str(), ssize_t(w.size()));\n    }\n\npublic:\n    static handle cast(const T &path, return_value_policy, handle) {\n        if (auto py_str = unicode_from_fs_native(path.native())) {\n            return module_::import(\"pathlib\")\n                .attr(\"Path\")(reinterpret_steal<object>(py_str))\n                .release();\n        }\n        return nullptr;\n    }\n\n    bool load(handle handle, bool) {\n        // PyUnicode_FSConverter and PyUnicode_FSDecoder normally take care of\n        // calling PyOS_FSPath themselves, but that's broken on PyPy (PyPy\n        // issue #3168) so we do it ourselves instead.\n        PyObject *buf = PyOS_FSPath(handle.ptr());\n        if (!buf) {\n            PyErr_Clear();\n            return false;\n        }\n        PyObject *native = nullptr;\n        if constexpr (std::is_same_v<typename T::value_type, char>) {\n            if (PyUnicode_FSConverter(buf, &native) != 0) {\n                if (auto *c_str = PyBytes_AsString(native)) {\n                    // AsString returns a pointer to the internal buffer, which\n                    // must not be free'd.\n                    value = c_str;\n                }\n            }\n        } else if constexpr (std::is_same_v<typename T::value_type, wchar_t>) {\n            if (PyUnicode_FSDecoder(buf, &native) != 0) {\n                if (auto *c_str = PyUnicode_AsWideCharString(native, nullptr)) {\n                    // AsWideCharString returns a new string that must be free'd.\n                    value = c_str; // Copies the string.\n                    PyMem_Free(c_str);\n                }\n            }\n        }\n        Py_XDECREF(native);\n        Py_DECREF(buf);\n        if (PyErr_Occurred()) {\n            PyErr_Clear();\n            return false;\n        }\n        return true;\n    }\n\n    PYBIND11_TYPE_CASTER(T, const_name(\"os.PathLike\"));\n};\n\n#endif // PYBIND11_HAS_FILESYSTEM || defined(PYBIND11_HAS_EXPERIMENTAL_FILESYSTEM)\n\n#if defined(PYBIND11_HAS_FILESYSTEM)\ntemplate <>\nstruct type_caster<std::filesystem::path> : public path_caster<std::filesystem::path> {};\n#elif defined(PYBIND11_HAS_EXPERIMENTAL_FILESYSTEM)\ntemplate <>\nstruct type_caster<std::experimental::filesystem::path>\n    : public path_caster<std::experimental::filesystem::path> {};\n#endif\n\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/stl.h",
    "content": "/*\n    pybind11/stl.h: Transparent conversion for STL data types\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"pybind11.h\"\n#include \"detail/common.h\"\n\n#include <deque>\n#include <list>\n#include <map>\n#include <ostream>\n#include <set>\n#include <unordered_map>\n#include <unordered_set>\n#include <valarray>\n\n// See `detail/common.h` for implementation of these guards.\n#if defined(PYBIND11_HAS_OPTIONAL)\n#    include <optional>\n#elif defined(PYBIND11_HAS_EXP_OPTIONAL)\n#    include <experimental/optional>\n#endif\n\n#if defined(PYBIND11_HAS_VARIANT)\n#    include <variant>\n#endif\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n/// Extracts an const lvalue reference or rvalue reference for U based on the type of T (e.g. for\n/// forwarding a container element).  Typically used indirect via forwarded_type(), below.\ntemplate <typename T, typename U>\nusing forwarded_type = conditional_t<std::is_lvalue_reference<T>::value,\n                                     remove_reference_t<U> &,\n                                     remove_reference_t<U> &&>;\n\n/// Forwards a value U as rvalue or lvalue according to whether T is rvalue or lvalue; typically\n/// used for forwarding a container's elements.\ntemplate <typename T, typename U>\nconstexpr forwarded_type<T, U> forward_like(U &&u) {\n    return std::forward<detail::forwarded_type<T, U>>(std::forward<U>(u));\n}\n\n// Checks if a container has a STL style reserve method.\n// This will only return true for a `reserve()` with a `void` return.\ntemplate <typename C>\nusing has_reserve_method = std::is_same<decltype(std::declval<C>().reserve(0)), void>;\n\ntemplate <typename Type, typename Key>\nstruct set_caster {\n    using type = Type;\n    using key_conv = make_caster<Key>;\n\nprivate:\n    template <typename T = Type, enable_if_t<has_reserve_method<T>::value, int> = 0>\n    void reserve_maybe(const anyset &s, Type *) {\n        value.reserve(s.size());\n    }\n    void reserve_maybe(const anyset &, void *) {}\n\npublic:\n    bool load(handle src, bool convert) {\n        if (!isinstance<anyset>(src)) {\n            return false;\n        }\n        auto s = reinterpret_borrow<anyset>(src);\n        value.clear();\n        reserve_maybe(s, &value);\n        for (auto entry : s) {\n            key_conv conv;\n            if (!conv.load(entry, convert)) {\n                return false;\n            }\n            value.insert(cast_op<Key &&>(std::move(conv)));\n        }\n        return true;\n    }\n\n    template <typename T>\n    static handle cast(T &&src, return_value_policy policy, handle parent) {\n        if (!std::is_lvalue_reference<T>::value) {\n            policy = return_value_policy_override<Key>::policy(policy);\n        }\n        pybind11::set s;\n        for (auto &&value : src) {\n            auto value_ = reinterpret_steal<object>(\n                key_conv::cast(detail::forward_like<T>(value), policy, parent));\n            if (!value_ || !s.add(std::move(value_))) {\n                return handle();\n            }\n        }\n        return s.release();\n    }\n\n    PYBIND11_TYPE_CASTER(type, const_name(\"Set[\") + key_conv::name + const_name(\"]\"));\n};\n\ntemplate <typename Type, typename Key, typename Value>\nstruct map_caster {\n    using key_conv = make_caster<Key>;\n    using value_conv = make_caster<Value>;\n\nprivate:\n    template <typename T = Type, enable_if_t<has_reserve_method<T>::value, int> = 0>\n    void reserve_maybe(const dict &d, Type *) {\n        value.reserve(d.size());\n    }\n    void reserve_maybe(const dict &, void *) {}\n\npublic:\n    bool load(handle src, bool convert) {\n        if (!isinstance<dict>(src)) {\n            return false;\n        }\n        auto d = reinterpret_borrow<dict>(src);\n        value.clear();\n        reserve_maybe(d, &value);\n        for (auto it : d) {\n            key_conv kconv;\n            value_conv vconv;\n            if (!kconv.load(it.first.ptr(), convert) || !vconv.load(it.second.ptr(), convert)) {\n                return false;\n            }\n            value.emplace(cast_op<Key &&>(std::move(kconv)), cast_op<Value &&>(std::move(vconv)));\n        }\n        return true;\n    }\n\n    template <typename T>\n    static handle cast(T &&src, return_value_policy policy, handle parent) {\n        dict d;\n        return_value_policy policy_key = policy;\n        return_value_policy policy_value = policy;\n        if (!std::is_lvalue_reference<T>::value) {\n            policy_key = return_value_policy_override<Key>::policy(policy_key);\n            policy_value = return_value_policy_override<Value>::policy(policy_value);\n        }\n        for (auto &&kv : src) {\n            auto key = reinterpret_steal<object>(\n                key_conv::cast(detail::forward_like<T>(kv.first), policy_key, parent));\n            auto value = reinterpret_steal<object>(\n                value_conv::cast(detail::forward_like<T>(kv.second), policy_value, parent));\n            if (!key || !value) {\n                return handle();\n            }\n            d[std::move(key)] = std::move(value);\n        }\n        return d.release();\n    }\n\n    PYBIND11_TYPE_CASTER(Type,\n                         const_name(\"Dict[\") + key_conv::name + const_name(\", \") + value_conv::name\n                             + const_name(\"]\"));\n};\n\ntemplate <typename Type, typename Value>\nstruct list_caster {\n    using value_conv = make_caster<Value>;\n\n    bool load(handle src, bool convert) {\n        if (!isinstance<sequence>(src) || isinstance<bytes>(src) || isinstance<str>(src)) {\n            return false;\n        }\n        auto s = reinterpret_borrow<sequence>(src);\n        value.clear();\n        reserve_maybe(s, &value);\n        for (auto it : s) {\n            value_conv conv;\n            if (!conv.load(it, convert)) {\n                return false;\n            }\n            value.push_back(cast_op<Value &&>(std::move(conv)));\n        }\n        return true;\n    }\n\nprivate:\n    template <typename T = Type, enable_if_t<has_reserve_method<T>::value, int> = 0>\n    void reserve_maybe(const sequence &s, Type *) {\n        value.reserve(s.size());\n    }\n    void reserve_maybe(const sequence &, void *) {}\n\npublic:\n    template <typename T>\n    static handle cast(T &&src, return_value_policy policy, handle parent) {\n        if (!std::is_lvalue_reference<T>::value) {\n            policy = return_value_policy_override<Value>::policy(policy);\n        }\n        list l(src.size());\n        ssize_t index = 0;\n        for (auto &&value : src) {\n            auto value_ = reinterpret_steal<object>(\n                value_conv::cast(detail::forward_like<T>(value), policy, parent));\n            if (!value_) {\n                return handle();\n            }\n            PyList_SET_ITEM(l.ptr(), index++, value_.release().ptr()); // steals a reference\n        }\n        return l.release();\n    }\n\n    PYBIND11_TYPE_CASTER(Type, const_name(\"List[\") + value_conv::name + const_name(\"]\"));\n};\n\ntemplate <typename Type, typename Alloc>\nstruct type_caster<std::vector<Type, Alloc>> : list_caster<std::vector<Type, Alloc>, Type> {};\n\ntemplate <typename Type, typename Alloc>\nstruct type_caster<std::deque<Type, Alloc>> : list_caster<std::deque<Type, Alloc>, Type> {};\n\ntemplate <typename Type, typename Alloc>\nstruct type_caster<std::list<Type, Alloc>> : list_caster<std::list<Type, Alloc>, Type> {};\n\ntemplate <typename ArrayType, typename Value, bool Resizable, size_t Size = 0>\nstruct array_caster {\n    using value_conv = make_caster<Value>;\n\nprivate:\n    template <bool R = Resizable>\n    bool require_size(enable_if_t<R, size_t> size) {\n        if (value.size() != size) {\n            value.resize(size);\n        }\n        return true;\n    }\n    template <bool R = Resizable>\n    bool require_size(enable_if_t<!R, size_t> size) {\n        return size == Size;\n    }\n\npublic:\n    bool load(handle src, bool convert) {\n        if (!isinstance<sequence>(src)) {\n            return false;\n        }\n        auto l = reinterpret_borrow<sequence>(src);\n        if (!require_size(l.size())) {\n            return false;\n        }\n        size_t ctr = 0;\n        for (auto it : l) {\n            value_conv conv;\n            if (!conv.load(it, convert)) {\n                return false;\n            }\n            value[ctr++] = cast_op<Value &&>(std::move(conv));\n        }\n        return true;\n    }\n\n    template <typename T>\n    static handle cast(T &&src, return_value_policy policy, handle parent) {\n        list l(src.size());\n        ssize_t index = 0;\n        for (auto &&value : src) {\n            auto value_ = reinterpret_steal<object>(\n                value_conv::cast(detail::forward_like<T>(value), policy, parent));\n            if (!value_) {\n                return handle();\n            }\n            PyList_SET_ITEM(l.ptr(), index++, value_.release().ptr()); // steals a reference\n        }\n        return l.release();\n    }\n\n    PYBIND11_TYPE_CASTER(ArrayType,\n                         const_name(\"List[\") + value_conv::name\n                             + const_name<Resizable>(const_name(\"\"),\n                                                     const_name(\"[\") + const_name<Size>()\n                                                         + const_name(\"]\"))\n                             + const_name(\"]\"));\n};\n\ntemplate <typename Type, size_t Size>\nstruct type_caster<std::array<Type, Size>>\n    : array_caster<std::array<Type, Size>, Type, false, Size> {};\n\ntemplate <typename Type>\nstruct type_caster<std::valarray<Type>> : array_caster<std::valarray<Type>, Type, true> {};\n\ntemplate <typename Key, typename Compare, typename Alloc>\nstruct type_caster<std::set<Key, Compare, Alloc>>\n    : set_caster<std::set<Key, Compare, Alloc>, Key> {};\n\ntemplate <typename Key, typename Hash, typename Equal, typename Alloc>\nstruct type_caster<std::unordered_set<Key, Hash, Equal, Alloc>>\n    : set_caster<std::unordered_set<Key, Hash, Equal, Alloc>, Key> {};\n\ntemplate <typename Key, typename Value, typename Compare, typename Alloc>\nstruct type_caster<std::map<Key, Value, Compare, Alloc>>\n    : map_caster<std::map<Key, Value, Compare, Alloc>, Key, Value> {};\n\ntemplate <typename Key, typename Value, typename Hash, typename Equal, typename Alloc>\nstruct type_caster<std::unordered_map<Key, Value, Hash, Equal, Alloc>>\n    : map_caster<std::unordered_map<Key, Value, Hash, Equal, Alloc>, Key, Value> {};\n\n// This type caster is intended to be used for std::optional and std::experimental::optional\ntemplate <typename Type, typename Value = typename Type::value_type>\nstruct optional_caster {\n    using value_conv = make_caster<Value>;\n\n    template <typename T>\n    static handle cast(T &&src, return_value_policy policy, handle parent) {\n        if (!src) {\n            return none().release();\n        }\n        if (!std::is_lvalue_reference<T>::value) {\n            policy = return_value_policy_override<Value>::policy(policy);\n        }\n        return value_conv::cast(*std::forward<T>(src), policy, parent);\n    }\n\n    bool load(handle src, bool convert) {\n        if (!src) {\n            return false;\n        }\n        if (src.is_none()) {\n            return true; // default-constructed value is already empty\n        }\n        value_conv inner_caster;\n        if (!inner_caster.load(src, convert)) {\n            return false;\n        }\n\n        value.emplace(cast_op<Value &&>(std::move(inner_caster)));\n        return true;\n    }\n\n    PYBIND11_TYPE_CASTER(Type, const_name(\"Optional[\") + value_conv::name + const_name(\"]\"));\n};\n\n#if defined(PYBIND11_HAS_OPTIONAL)\ntemplate <typename T>\nstruct type_caster<std::optional<T>> : public optional_caster<std::optional<T>> {};\n\ntemplate <>\nstruct type_caster<std::nullopt_t> : public void_caster<std::nullopt_t> {};\n#endif\n\n#if defined(PYBIND11_HAS_EXP_OPTIONAL)\ntemplate <typename T>\nstruct type_caster<std::experimental::optional<T>>\n    : public optional_caster<std::experimental::optional<T>> {};\n\ntemplate <>\nstruct type_caster<std::experimental::nullopt_t>\n    : public void_caster<std::experimental::nullopt_t> {};\n#endif\n\n/// Visit a variant and cast any found type to Python\nstruct variant_caster_visitor {\n    return_value_policy policy;\n    handle parent;\n\n    using result_type = handle; // required by boost::variant in C++11\n\n    template <typename T>\n    result_type operator()(T &&src) const {\n        return make_caster<T>::cast(std::forward<T>(src), policy, parent);\n    }\n};\n\n/// Helper class which abstracts away variant's `visit` function. `std::variant` and similar\n/// `namespace::variant` types which provide a `namespace::visit()` function are handled here\n/// automatically using argument-dependent lookup. Users can provide specializations for other\n/// variant-like classes, e.g. `boost::variant` and `boost::apply_visitor`.\ntemplate <template <typename...> class Variant>\nstruct visit_helper {\n    template <typename... Args>\n    static auto call(Args &&...args) -> decltype(visit(std::forward<Args>(args)...)) {\n        return visit(std::forward<Args>(args)...);\n    }\n};\n\n/// Generic variant caster\ntemplate <typename Variant>\nstruct variant_caster;\n\ntemplate <template <typename...> class V, typename... Ts>\nstruct variant_caster<V<Ts...>> {\n    static_assert(sizeof...(Ts) > 0, \"Variant must consist of at least one alternative.\");\n\n    template <typename U, typename... Us>\n    bool load_alternative(handle src, bool convert, type_list<U, Us...>) {\n        auto caster = make_caster<U>();\n        if (caster.load(src, convert)) {\n            value = cast_op<U>(std::move(caster));\n            return true;\n        }\n        return load_alternative(src, convert, type_list<Us...>{});\n    }\n\n    bool load_alternative(handle, bool, type_list<>) { return false; }\n\n    bool load(handle src, bool convert) {\n        // Do a first pass without conversions to improve constructor resolution.\n        // E.g. `py::int_(1).cast<variant<double, int>>()` needs to fill the `int`\n        // slot of the variant. Without two-pass loading `double` would be filled\n        // because it appears first and a conversion is possible.\n        if (convert && load_alternative(src, false, type_list<Ts...>{})) {\n            return true;\n        }\n        return load_alternative(src, convert, type_list<Ts...>{});\n    }\n\n    template <typename Variant>\n    static handle cast(Variant &&src, return_value_policy policy, handle parent) {\n        return visit_helper<V>::call(variant_caster_visitor{policy, parent},\n                                     std::forward<Variant>(src));\n    }\n\n    using Type = V<Ts...>;\n    PYBIND11_TYPE_CASTER(Type,\n                         const_name(\"Union[\") + detail::concat(make_caster<Ts>::name...)\n                             + const_name(\"]\"));\n};\n\n#if defined(PYBIND11_HAS_VARIANT)\ntemplate <typename... Ts>\nstruct type_caster<std::variant<Ts...>> : variant_caster<std::variant<Ts...>> {};\n\ntemplate <>\nstruct type_caster<std::monostate> : public void_caster<std::monostate> {};\n#endif\n\nPYBIND11_NAMESPACE_END(detail)\n\ninline std::ostream &operator<<(std::ostream &os, const handle &obj) {\n#ifdef PYBIND11_HAS_STRING_VIEW\n    os << str(obj).cast<std::string_view>();\n#else\n    os << (std::string) str(obj);\n#endif\n    return os;\n}\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/include/pybind11/stl_bind.h",
    "content": "/*\n    pybind11/std_bind.h: Binding generators for STL data types\n\n    Copyright (c) 2016 Sergey Lyskov and Wenzel Jakob\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#pragma once\n\n#include \"detail/common.h\"\n#include \"detail/type_caster_base.h\"\n#include \"cast.h\"\n#include \"operators.h\"\n\n#include <algorithm>\n#include <sstream>\n#include <type_traits>\n\nPYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n/* SFINAE helper class used by 'is_comparable */\ntemplate <typename T>\nstruct container_traits {\n    template <typename T2>\n    static std::true_type\n    test_comparable(decltype(std::declval<const T2 &>() == std::declval<const T2 &>()) *);\n    template <typename T2>\n    static std::false_type test_comparable(...);\n    template <typename T2>\n    static std::true_type test_value(typename T2::value_type *);\n    template <typename T2>\n    static std::false_type test_value(...);\n    template <typename T2>\n    static std::true_type test_pair(typename T2::first_type *, typename T2::second_type *);\n    template <typename T2>\n    static std::false_type test_pair(...);\n\n    static constexpr const bool is_comparable\n        = std::is_same<std::true_type, decltype(test_comparable<T>(nullptr))>::value;\n    static constexpr const bool is_pair\n        = std::is_same<std::true_type, decltype(test_pair<T>(nullptr, nullptr))>::value;\n    static constexpr const bool is_vector\n        = std::is_same<std::true_type, decltype(test_value<T>(nullptr))>::value;\n    static constexpr const bool is_element = !is_pair && !is_vector;\n};\n\n/* Default: is_comparable -> std::false_type */\ntemplate <typename T, typename SFINAE = void>\nstruct is_comparable : std::false_type {};\n\n/* For non-map data structures, check whether operator== can be instantiated */\ntemplate <typename T>\nstruct is_comparable<\n    T,\n    enable_if_t<container_traits<T>::is_element && container_traits<T>::is_comparable>>\n    : std::true_type {};\n\n/* For a vector/map data structure, recursively check the value type\n   (which is std::pair for maps) */\ntemplate <typename T>\nstruct is_comparable<T, enable_if_t<container_traits<T>::is_vector>> {\n    static constexpr const bool value = is_comparable<typename T::value_type>::value;\n};\n\n/* For pairs, recursively check the two data types */\ntemplate <typename T>\nstruct is_comparable<T, enable_if_t<container_traits<T>::is_pair>> {\n    static constexpr const bool value = is_comparable<typename T::first_type>::value\n                                        && is_comparable<typename T::second_type>::value;\n};\n\n/* Fallback functions */\ntemplate <typename, typename, typename... Args>\nvoid vector_if_copy_constructible(const Args &...) {}\ntemplate <typename, typename, typename... Args>\nvoid vector_if_equal_operator(const Args &...) {}\ntemplate <typename, typename, typename... Args>\nvoid vector_if_insertion_operator(const Args &...) {}\ntemplate <typename, typename, typename... Args>\nvoid vector_modifiers(const Args &...) {}\n\ntemplate <typename Vector, typename Class_>\nvoid vector_if_copy_constructible(enable_if_t<is_copy_constructible<Vector>::value, Class_> &cl) {\n    cl.def(init<const Vector &>(), \"Copy constructor\");\n}\n\ntemplate <typename Vector, typename Class_>\nvoid vector_if_equal_operator(enable_if_t<is_comparable<Vector>::value, Class_> &cl) {\n    using T = typename Vector::value_type;\n\n    cl.def(self == self);\n    cl.def(self != self);\n\n    cl.def(\n        \"count\",\n        [](const Vector &v, const T &x) { return std::count(v.begin(), v.end(), x); },\n        arg(\"x\"),\n        \"Return the number of times ``x`` appears in the list\");\n\n    cl.def(\n        \"remove\",\n        [](Vector &v, const T &x) {\n            auto p = std::find(v.begin(), v.end(), x);\n            if (p != v.end()) {\n                v.erase(p);\n            } else {\n                throw value_error();\n            }\n        },\n        arg(\"x\"),\n        \"Remove the first item from the list whose value is x. \"\n        \"It is an error if there is no such item.\");\n\n    cl.def(\n        \"__contains__\",\n        [](const Vector &v, const T &x) { return std::find(v.begin(), v.end(), x) != v.end(); },\n        arg(\"x\"),\n        \"Return true the container contains ``x``\");\n}\n\n// Vector modifiers -- requires a copyable vector_type:\n// (Technically, some of these (pop and __delitem__) don't actually require copyability, but it\n// seems silly to allow deletion but not insertion, so include them here too.)\ntemplate <typename Vector, typename Class_>\nvoid vector_modifiers(\n    enable_if_t<is_copy_constructible<typename Vector::value_type>::value, Class_> &cl) {\n    using T = typename Vector::value_type;\n    using SizeType = typename Vector::size_type;\n    using DiffType = typename Vector::difference_type;\n\n    auto wrap_i = [](DiffType i, SizeType n) {\n        if (i < 0) {\n            i += n;\n        }\n        if (i < 0 || (SizeType) i >= n) {\n            throw index_error();\n        }\n        return i;\n    };\n\n    cl.def(\n        \"append\",\n        [](Vector &v, const T &value) { v.push_back(value); },\n        arg(\"x\"),\n        \"Add an item to the end of the list\");\n\n    cl.def(init([](const iterable &it) {\n        auto v = std::unique_ptr<Vector>(new Vector());\n        v->reserve(len_hint(it));\n        for (handle h : it) {\n            v->push_back(h.cast<T>());\n        }\n        return v.release();\n    }));\n\n    cl.def(\n        \"clear\", [](Vector &v) { v.clear(); }, \"Clear the contents\");\n\n    cl.def(\n        \"extend\",\n        [](Vector &v, const Vector &src) { v.insert(v.end(), src.begin(), src.end()); },\n        arg(\"L\"),\n        \"Extend the list by appending all the items in the given list\");\n\n    cl.def(\n        \"extend\",\n        [](Vector &v, const iterable &it) {\n            const size_t old_size = v.size();\n            v.reserve(old_size + len_hint(it));\n            try {\n                for (handle h : it) {\n                    v.push_back(h.cast<T>());\n                }\n            } catch (const cast_error &) {\n                v.erase(v.begin() + static_cast<typename Vector::difference_type>(old_size),\n                        v.end());\n                try {\n                    v.shrink_to_fit();\n                } catch (const std::exception &) {\n                    // Do nothing\n                }\n                throw;\n            }\n        },\n        arg(\"L\"),\n        \"Extend the list by appending all the items in the given list\");\n\n    cl.def(\n        \"insert\",\n        [](Vector &v, DiffType i, const T &x) {\n            // Can't use wrap_i; i == v.size() is OK\n            if (i < 0) {\n                i += v.size();\n            }\n            if (i < 0 || (SizeType) i > v.size()) {\n                throw index_error();\n            }\n            v.insert(v.begin() + i, x);\n        },\n        arg(\"i\"),\n        arg(\"x\"),\n        \"Insert an item at a given position.\");\n\n    cl.def(\n        \"pop\",\n        [](Vector &v) {\n            if (v.empty()) {\n                throw index_error();\n            }\n            T t = std::move(v.back());\n            v.pop_back();\n            return t;\n        },\n        \"Remove and return the last item\");\n\n    cl.def(\n        \"pop\",\n        [wrap_i](Vector &v, DiffType i) {\n            i = wrap_i(i, v.size());\n            T t = std::move(v[(SizeType) i]);\n            v.erase(std::next(v.begin(), i));\n            return t;\n        },\n        arg(\"i\"),\n        \"Remove and return the item at index ``i``\");\n\n    cl.def(\"__setitem__\", [wrap_i](Vector &v, DiffType i, const T &t) {\n        i = wrap_i(i, v.size());\n        v[(SizeType) i] = t;\n    });\n\n    /// Slicing protocol\n    cl.def(\n        \"__getitem__\",\n        [](const Vector &v, const slice &slice) -> Vector * {\n            size_t start = 0, stop = 0, step = 0, slicelength = 0;\n\n            if (!slice.compute(v.size(), &start, &stop, &step, &slicelength)) {\n                throw error_already_set();\n            }\n\n            auto *seq = new Vector();\n            seq->reserve((size_t) slicelength);\n\n            for (size_t i = 0; i < slicelength; ++i) {\n                seq->push_back(v[start]);\n                start += step;\n            }\n            return seq;\n        },\n        arg(\"s\"),\n        \"Retrieve list elements using a slice object\");\n\n    cl.def(\n        \"__setitem__\",\n        [](Vector &v, const slice &slice, const Vector &value) {\n            size_t start = 0, stop = 0, step = 0, slicelength = 0;\n            if (!slice.compute(v.size(), &start, &stop, &step, &slicelength)) {\n                throw error_already_set();\n            }\n\n            if (slicelength != value.size()) {\n                throw std::runtime_error(\n                    \"Left and right hand size of slice assignment have different sizes!\");\n            }\n\n            for (size_t i = 0; i < slicelength; ++i) {\n                v[start] = value[i];\n                start += step;\n            }\n        },\n        \"Assign list elements using a slice object\");\n\n    cl.def(\n        \"__delitem__\",\n        [wrap_i](Vector &v, DiffType i) {\n            i = wrap_i(i, v.size());\n            v.erase(v.begin() + i);\n        },\n        \"Delete the list elements at index ``i``\");\n\n    cl.def(\n        \"__delitem__\",\n        [](Vector &v, const slice &slice) {\n            size_t start = 0, stop = 0, step = 0, slicelength = 0;\n\n            if (!slice.compute(v.size(), &start, &stop, &step, &slicelength)) {\n                throw error_already_set();\n            }\n\n            if (step == 1 && false) {\n                v.erase(v.begin() + (DiffType) start, v.begin() + DiffType(start + slicelength));\n            } else {\n                for (size_t i = 0; i < slicelength; ++i) {\n                    v.erase(v.begin() + DiffType(start));\n                    start += step - 1;\n                }\n            }\n        },\n        \"Delete list elements using a slice object\");\n}\n\n// If the type has an operator[] that doesn't return a reference (most notably std::vector<bool>),\n// we have to access by copying; otherwise we return by reference.\ntemplate <typename Vector>\nusing vector_needs_copy\n    = negation<std::is_same<decltype(std::declval<Vector>()[typename Vector::size_type()]),\n                            typename Vector::value_type &>>;\n\n// The usual case: access and iterate by reference\ntemplate <typename Vector, typename Class_>\nvoid vector_accessor(enable_if_t<!vector_needs_copy<Vector>::value, Class_> &cl) {\n    using T = typename Vector::value_type;\n    using SizeType = typename Vector::size_type;\n    using DiffType = typename Vector::difference_type;\n    using ItType = typename Vector::iterator;\n\n    auto wrap_i = [](DiffType i, SizeType n) {\n        if (i < 0) {\n            i += n;\n        }\n        if (i < 0 || (SizeType) i >= n) {\n            throw index_error();\n        }\n        return i;\n    };\n\n    cl.def(\n        \"__getitem__\",\n        [wrap_i](Vector &v, DiffType i) -> T & {\n            i = wrap_i(i, v.size());\n            return v[(SizeType) i];\n        },\n        return_value_policy::reference_internal // ref + keepalive\n    );\n\n    cl.def(\n        \"__iter__\",\n        [](Vector &v) {\n            return make_iterator<return_value_policy::reference_internal, ItType, ItType, T &>(\n                v.begin(), v.end());\n        },\n        keep_alive<0, 1>() /* Essential: keep list alive while iterator exists */\n    );\n}\n\n// The case for special objects, like std::vector<bool>, that have to be returned-by-copy:\ntemplate <typename Vector, typename Class_>\nvoid vector_accessor(enable_if_t<vector_needs_copy<Vector>::value, Class_> &cl) {\n    using T = typename Vector::value_type;\n    using SizeType = typename Vector::size_type;\n    using DiffType = typename Vector::difference_type;\n    using ItType = typename Vector::iterator;\n    cl.def(\"__getitem__\", [](const Vector &v, DiffType i) -> T {\n        if (i < 0 && (i += v.size()) < 0) {\n            throw index_error();\n        }\n        if ((SizeType) i >= v.size()) {\n            throw index_error();\n        }\n        return v[(SizeType) i];\n    });\n\n    cl.def(\n        \"__iter__\",\n        [](Vector &v) {\n            return make_iterator<return_value_policy::copy, ItType, ItType, T>(v.begin(), v.end());\n        },\n        keep_alive<0, 1>() /* Essential: keep list alive while iterator exists */\n    );\n}\n\ntemplate <typename Vector, typename Class_>\nauto vector_if_insertion_operator(Class_ &cl, std::string const &name)\n    -> decltype(std::declval<std::ostream &>() << std::declval<typename Vector::value_type>(),\n                void()) {\n    using size_type = typename Vector::size_type;\n\n    cl.def(\n        \"__repr__\",\n        [name](Vector &v) {\n            std::ostringstream s;\n            s << name << '[';\n            for (size_type i = 0; i < v.size(); ++i) {\n                s << v[i];\n                if (i != v.size() - 1) {\n                    s << \", \";\n                }\n            }\n            s << ']';\n            return s.str();\n        },\n        \"Return the canonical string representation of this list.\");\n}\n\n// Provide the buffer interface for vectors if we have data() and we have a format for it\n// GCC seems to have \"void std::vector<bool>::data()\" - doing SFINAE on the existence of data()\n// is insufficient, we need to check it returns an appropriate pointer\ntemplate <typename Vector, typename = void>\nstruct vector_has_data_and_format : std::false_type {};\ntemplate <typename Vector>\nstruct vector_has_data_and_format<\n    Vector,\n    enable_if_t<std::is_same<decltype(format_descriptor<typename Vector::value_type>::format(),\n                                      std::declval<Vector>().data()),\n                             typename Vector::value_type *>::value>> : std::true_type {};\n\n// [workaround(intel)] Separate function required here\n// Workaround as the Intel compiler does not compile the enable_if_t part below\n// (tested with icc (ICC) 2021.1 Beta 20200827)\ntemplate <typename... Args>\nconstexpr bool args_any_are_buffer() {\n    return detail::any_of<std::is_same<Args, buffer_protocol>...>::value;\n}\n\n// [workaround(intel)] Separate function required here\n// [workaround(msvc)] Can't use constexpr bool in return type\n\n// Add the buffer interface to a vector\ntemplate <typename Vector, typename Class_, typename... Args>\nvoid vector_buffer_impl(Class_ &cl, std::true_type) {\n    using T = typename Vector::value_type;\n\n    static_assert(vector_has_data_and_format<Vector>::value,\n                  \"There is not an appropriate format descriptor for this vector\");\n\n    // numpy.h declares this for arbitrary types, but it may raise an exception and crash hard\n    // at runtime if PYBIND11_NUMPY_DTYPE hasn't been called, so check here\n    format_descriptor<T>::format();\n\n    cl.def_buffer([](Vector &v) -> buffer_info {\n        return buffer_info(v.data(),\n                           static_cast<ssize_t>(sizeof(T)),\n                           format_descriptor<T>::format(),\n                           1,\n                           {v.size()},\n                           {sizeof(T)});\n    });\n\n    cl.def(init([](const buffer &buf) {\n        auto info = buf.request();\n        if (info.ndim != 1 || info.strides[0] % static_cast<ssize_t>(sizeof(T))) {\n            throw type_error(\"Only valid 1D buffers can be copied to a vector\");\n        }\n        if (!detail::compare_buffer_info<T>::compare(info)\n            || (ssize_t) sizeof(T) != info.itemsize) {\n            throw type_error(\"Format mismatch (Python: \" + info.format\n                             + \" C++: \" + format_descriptor<T>::format() + \")\");\n        }\n\n        T *p = static_cast<T *>(info.ptr);\n        ssize_t step = info.strides[0] / static_cast<ssize_t>(sizeof(T));\n        T *end = p + info.shape[0] * step;\n        if (step == 1) {\n            return Vector(p, end);\n        }\n        Vector vec;\n        vec.reserve((size_t) info.shape[0]);\n        for (; p != end; p += step) {\n            vec.push_back(*p);\n        }\n        return vec;\n    }));\n\n    return;\n}\n\ntemplate <typename Vector, typename Class_, typename... Args>\nvoid vector_buffer_impl(Class_ &, std::false_type) {}\n\ntemplate <typename Vector, typename Class_, typename... Args>\nvoid vector_buffer(Class_ &cl) {\n    vector_buffer_impl<Vector, Class_, Args...>(\n        cl, detail::any_of<std::is_same<Args, buffer_protocol>...>{});\n}\n\nPYBIND11_NAMESPACE_END(detail)\n\n//\n// std::vector\n//\ntemplate <typename Vector, typename holder_type = std::unique_ptr<Vector>, typename... Args>\nclass_<Vector, holder_type> bind_vector(handle scope, std::string const &name, Args &&...args) {\n    using Class_ = class_<Vector, holder_type>;\n\n    // If the value_type is unregistered (e.g. a converting type) or is itself registered\n    // module-local then make the vector binding module-local as well:\n    using vtype = typename Vector::value_type;\n    auto *vtype_info = detail::get_type_info(typeid(vtype));\n    bool local = !vtype_info || vtype_info->module_local;\n\n    Class_ cl(scope, name.c_str(), pybind11::module_local(local), std::forward<Args>(args)...);\n\n    // Declare the buffer interface if a buffer_protocol() is passed in\n    detail::vector_buffer<Vector, Class_, Args...>(cl);\n\n    cl.def(init<>());\n\n    // Register copy constructor (if possible)\n    detail::vector_if_copy_constructible<Vector, Class_>(cl);\n\n    // Register comparison-related operators and functions (if possible)\n    detail::vector_if_equal_operator<Vector, Class_>(cl);\n\n    // Register stream insertion operator (if possible)\n    detail::vector_if_insertion_operator<Vector, Class_>(cl, name);\n\n    // Modifiers require copyable vector value type\n    detail::vector_modifiers<Vector, Class_>(cl);\n\n    // Accessor and iterator; return by value if copyable, otherwise we return by ref + keep-alive\n    detail::vector_accessor<Vector, Class_>(cl);\n\n    cl.def(\n        \"__bool__\",\n        [](const Vector &v) -> bool { return !v.empty(); },\n        \"Check whether the list is nonempty\");\n\n    cl.def(\"__len__\", &Vector::size);\n\n#if 0\n    // C++ style functions deprecated, leaving it here as an example\n    cl.def(init<size_type>());\n\n    cl.def(\"resize\",\n         (void (Vector::*) (size_type count)) & Vector::resize,\n         \"changes the number of elements stored\");\n\n    cl.def(\"erase\",\n        [](Vector &v, SizeType i) {\n        if (i >= v.size())\n            throw index_error();\n        v.erase(v.begin() + i);\n    }, \"erases element at index ``i``\");\n\n    cl.def(\"empty\",         &Vector::empty,         \"checks whether the container is empty\");\n    cl.def(\"size\",          &Vector::size,          \"returns the number of elements\");\n    cl.def(\"push_back\", (void (Vector::*)(const T&)) &Vector::push_back, \"adds an element to the end\");\n    cl.def(\"pop_back\",                               &Vector::pop_back, \"removes the last element\");\n\n    cl.def(\"max_size\",      &Vector::max_size,      \"returns the maximum possible number of elements\");\n    cl.def(\"reserve\",       &Vector::reserve,       \"reserves storage\");\n    cl.def(\"capacity\",      &Vector::capacity,      \"returns the number of elements that can be held in currently allocated storage\");\n    cl.def(\"shrink_to_fit\", &Vector::shrink_to_fit, \"reduces memory usage by freeing unused memory\");\n\n    cl.def(\"clear\", &Vector::clear, \"clears the contents\");\n    cl.def(\"swap\",   &Vector::swap, \"swaps the contents\");\n\n    cl.def(\"front\", [](Vector &v) {\n        if (v.size()) return v.front();\n        else throw index_error();\n    }, \"access the first element\");\n\n    cl.def(\"back\", [](Vector &v) {\n        if (v.size()) return v.back();\n        else throw index_error();\n    }, \"access the last element \");\n\n#endif\n\n    return cl;\n}\n\n//\n// std::map, std::unordered_map\n//\n\nPYBIND11_NAMESPACE_BEGIN(detail)\n\n/* Fallback functions */\ntemplate <typename, typename, typename... Args>\nvoid map_if_insertion_operator(const Args &...) {}\ntemplate <typename, typename, typename... Args>\nvoid map_assignment(const Args &...) {}\n\n// Map assignment when copy-assignable: just copy the value\ntemplate <typename Map, typename Class_>\nvoid map_assignment(\n    enable_if_t<is_copy_assignable<typename Map::mapped_type>::value, Class_> &cl) {\n    using KeyType = typename Map::key_type;\n    using MappedType = typename Map::mapped_type;\n\n    cl.def(\"__setitem__\", [](Map &m, const KeyType &k, const MappedType &v) {\n        auto it = m.find(k);\n        if (it != m.end()) {\n            it->second = v;\n        } else {\n            m.emplace(k, v);\n        }\n    });\n}\n\n// Not copy-assignable, but still copy-constructible: we can update the value by erasing and\n// reinserting\ntemplate <typename Map, typename Class_>\nvoid map_assignment(enable_if_t<!is_copy_assignable<typename Map::mapped_type>::value\n                                    && is_copy_constructible<typename Map::mapped_type>::value,\n                                Class_> &cl) {\n    using KeyType = typename Map::key_type;\n    using MappedType = typename Map::mapped_type;\n\n    cl.def(\"__setitem__\", [](Map &m, const KeyType &k, const MappedType &v) {\n        // We can't use m[k] = v; because value type might not be default constructable\n        auto r = m.emplace(k, v);\n        if (!r.second) {\n            // value type is not copy assignable so the only way to insert it is to erase it\n            // first...\n            m.erase(r.first);\n            m.emplace(k, v);\n        }\n    });\n}\n\ntemplate <typename Map, typename Class_>\nauto map_if_insertion_operator(Class_ &cl, std::string const &name)\n    -> decltype(std::declval<std::ostream &>() << std::declval<typename Map::key_type>()\n                                               << std::declval<typename Map::mapped_type>(),\n                void()) {\n\n    cl.def(\n        \"__repr__\",\n        [name](Map &m) {\n            std::ostringstream s;\n            s << name << '{';\n            bool f = false;\n            for (auto const &kv : m) {\n                if (f) {\n                    s << \", \";\n                }\n                s << kv.first << \": \" << kv.second;\n                f = true;\n            }\n            s << '}';\n            return s.str();\n        },\n        \"Return the canonical string representation of this map.\");\n}\n\ntemplate <typename KeyType>\nstruct keys_view {\n    virtual size_t len() = 0;\n    virtual iterator iter() = 0;\n    virtual bool contains(const KeyType &k) = 0;\n    virtual bool contains(const object &k) = 0;\n    virtual ~keys_view() = default;\n};\n\ntemplate <typename MappedType>\nstruct values_view {\n    virtual size_t len() = 0;\n    virtual iterator iter() = 0;\n    virtual ~values_view() = default;\n};\n\ntemplate <typename KeyType, typename MappedType>\nstruct items_view {\n    virtual size_t len() = 0;\n    virtual iterator iter() = 0;\n    virtual ~items_view() = default;\n};\n\ntemplate <typename Map, typename KeysView>\nstruct KeysViewImpl : public KeysView {\n    explicit KeysViewImpl(Map &map) : map(map) {}\n    size_t len() override { return map.size(); }\n    iterator iter() override { return make_key_iterator(map.begin(), map.end()); }\n    bool contains(const typename Map::key_type &k) override { return map.find(k) != map.end(); }\n    bool contains(const object &) override { return false; }\n    Map &map;\n};\n\ntemplate <typename Map, typename ValuesView>\nstruct ValuesViewImpl : public ValuesView {\n    explicit ValuesViewImpl(Map &map) : map(map) {}\n    size_t len() override { return map.size(); }\n    iterator iter() override { return make_value_iterator(map.begin(), map.end()); }\n    Map &map;\n};\n\ntemplate <typename Map, typename ItemsView>\nstruct ItemsViewImpl : public ItemsView {\n    explicit ItemsViewImpl(Map &map) : map(map) {}\n    size_t len() override { return map.size(); }\n    iterator iter() override { return make_iterator(map.begin(), map.end()); }\n    Map &map;\n};\n\nPYBIND11_NAMESPACE_END(detail)\n\ntemplate <typename Map, typename holder_type = std::unique_ptr<Map>, typename... Args>\nclass_<Map, holder_type> bind_map(handle scope, const std::string &name, Args &&...args) {\n    using KeyType = typename Map::key_type;\n    using MappedType = typename Map::mapped_type;\n    using StrippedKeyType = detail::remove_cvref_t<KeyType>;\n    using StrippedMappedType = detail::remove_cvref_t<MappedType>;\n    using KeysView = detail::keys_view<StrippedKeyType>;\n    using ValuesView = detail::values_view<StrippedMappedType>;\n    using ItemsView = detail::items_view<StrippedKeyType, StrippedMappedType>;\n    using Class_ = class_<Map, holder_type>;\n\n    // If either type is a non-module-local bound type then make the map binding non-local as well;\n    // otherwise (e.g. both types are either module-local or converting) the map will be\n    // module-local.\n    auto *tinfo = detail::get_type_info(typeid(MappedType));\n    bool local = !tinfo || tinfo->module_local;\n    if (local) {\n        tinfo = detail::get_type_info(typeid(KeyType));\n        local = !tinfo || tinfo->module_local;\n    }\n\n    Class_ cl(scope, name.c_str(), pybind11::module_local(local), std::forward<Args>(args)...);\n    static constexpr auto key_type_descr = detail::make_caster<KeyType>::name;\n    static constexpr auto mapped_type_descr = detail::make_caster<MappedType>::name;\n    std::string key_type_name(key_type_descr.text), mapped_type_name(mapped_type_descr.text);\n\n    // If key type isn't properly wrapped, fall back to C++ names\n    if (key_type_name == \"%\") {\n        key_type_name = detail::type_info_description(typeid(KeyType));\n    }\n    // Similarly for value type:\n    if (mapped_type_name == \"%\") {\n        mapped_type_name = detail::type_info_description(typeid(MappedType));\n    }\n\n    // Wrap KeysView[KeyType] if it wasn't already wrapped\n    if (!detail::get_type_info(typeid(KeysView))) {\n        class_<KeysView> keys_view(\n            scope, (\"KeysView[\" + key_type_name + \"]\").c_str(), pybind11::module_local(local));\n        keys_view.def(\"__len__\", &KeysView::len);\n        keys_view.def(\"__iter__\",\n                      &KeysView::iter,\n                      keep_alive<0, 1>() /* Essential: keep view alive while iterator exists */\n        );\n        keys_view.def(\"__contains__\",\n                      static_cast<bool (KeysView::*)(const KeyType &)>(&KeysView::contains));\n        // Fallback for when the object is not of the key type\n        keys_view.def(\"__contains__\",\n                      static_cast<bool (KeysView::*)(const object &)>(&KeysView::contains));\n    }\n    // Similarly for ValuesView:\n    if (!detail::get_type_info(typeid(ValuesView))) {\n        class_<ValuesView> values_view(scope,\n                                       (\"ValuesView[\" + mapped_type_name + \"]\").c_str(),\n                                       pybind11::module_local(local));\n        values_view.def(\"__len__\", &ValuesView::len);\n        values_view.def(\"__iter__\",\n                        &ValuesView::iter,\n                        keep_alive<0, 1>() /* Essential: keep view alive while iterator exists */\n        );\n    }\n    // Similarly for ItemsView:\n    if (!detail::get_type_info(typeid(ItemsView))) {\n        class_<ItemsView> items_view(\n            scope,\n            (\"ItemsView[\" + key_type_name + \", \").append(mapped_type_name + \"]\").c_str(),\n            pybind11::module_local(local));\n        items_view.def(\"__len__\", &ItemsView::len);\n        items_view.def(\"__iter__\",\n                       &ItemsView::iter,\n                       keep_alive<0, 1>() /* Essential: keep view alive while iterator exists */\n        );\n    }\n\n    cl.def(init<>());\n\n    // Register stream insertion operator (if possible)\n    detail::map_if_insertion_operator<Map, Class_>(cl, name);\n\n    cl.def(\n        \"__bool__\",\n        [](const Map &m) -> bool { return !m.empty(); },\n        \"Check whether the map is nonempty\");\n\n    cl.def(\n        \"__iter__\",\n        [](Map &m) { return make_key_iterator(m.begin(), m.end()); },\n        keep_alive<0, 1>() /* Essential: keep map alive while iterator exists */\n    );\n\n    cl.def(\n        \"keys\",\n        [](Map &m) {\n            return std::unique_ptr<KeysView>(new detail::KeysViewImpl<Map, KeysView>(m));\n        },\n        keep_alive<0, 1>() /* Essential: keep map alive while view exists */\n    );\n\n    cl.def(\n        \"values\",\n        [](Map &m) {\n            return std::unique_ptr<ValuesView>(new detail::ValuesViewImpl<Map, ValuesView>(m));\n        },\n        keep_alive<0, 1>() /* Essential: keep map alive while view exists */\n    );\n\n    cl.def(\n        \"items\",\n        [](Map &m) {\n            return std::unique_ptr<ItemsView>(new detail::ItemsViewImpl<Map, ItemsView>(m));\n        },\n        keep_alive<0, 1>() /* Essential: keep map alive while view exists */\n    );\n\n    cl.def(\n        \"__getitem__\",\n        [](Map &m, const KeyType &k) -> MappedType & {\n            auto it = m.find(k);\n            if (it == m.end()) {\n                throw key_error();\n            }\n            return it->second;\n        },\n        return_value_policy::reference_internal // ref + keepalive\n    );\n\n    cl.def(\"__contains__\", [](Map &m, const KeyType &k) -> bool {\n        auto it = m.find(k);\n        if (it == m.end()) {\n            return false;\n        }\n        return true;\n    });\n    // Fallback for when the object is not of the key type\n    cl.def(\"__contains__\", [](Map &, const object &) -> bool { return false; });\n\n    // Assignment provided only if the type is copyable\n    detail::map_assignment<Map, Class_>(cl);\n\n    cl.def(\"__delitem__\", [](Map &m, const KeyType &k) {\n        auto it = m.find(k);\n        if (it == m.end()) {\n            throw key_error();\n        }\n        m.erase(it);\n    });\n\n    cl.def(\"__len__\", &Map::size);\n\n    return cl;\n}\n\nPYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/noxfile.py",
    "content": "import os\n\nimport nox\n\nnox.needs_version = \">=2022.1.7\"\nnox.options.sessions = [\"lint\", \"tests\", \"tests_packaging\"]\n\nPYTHON_VERSIONS = [\n    \"3.6\",\n    \"3.7\",\n    \"3.8\",\n    \"3.9\",\n    \"3.10\",\n    \"3.11\",\n    \"pypy3.7\",\n    \"pypy3.8\",\n    \"pypy3.9\",\n]\n\nif os.environ.get(\"CI\", None):\n    nox.options.error_on_missing_interpreters = True\n\n\n@nox.session(reuse_venv=True)\ndef lint(session: nox.Session) -> None:\n    \"\"\"\n    Lint the codebase (except for clang-format/tidy).\n    \"\"\"\n    session.install(\"pre-commit\")\n    session.run(\"pre-commit\", \"run\", \"-a\", *session.posargs)\n\n\n@nox.session(python=PYTHON_VERSIONS)\ndef tests(session: nox.Session) -> None:\n    \"\"\"\n    Run the tests (requires a compiler).\n    \"\"\"\n    tmpdir = session.create_tmp()\n    session.install(\"cmake\")\n    session.install(\"-r\", \"tests/requirements.txt\")\n    session.run(\n        \"cmake\",\n        \"-S.\",\n        f\"-B{tmpdir}\",\n        \"-DPYBIND11_WERROR=ON\",\n        \"-DDOWNLOAD_CATCH=ON\",\n        \"-DDOWNLOAD_EIGEN=ON\",\n        *session.posargs,\n    )\n    session.run(\"cmake\", \"--build\", tmpdir)\n    session.run(\"cmake\", \"--build\", tmpdir, \"--config=Release\", \"--target\", \"check\")\n\n\n@nox.session\ndef tests_packaging(session: nox.Session) -> None:\n    \"\"\"\n    Run the packaging tests.\n    \"\"\"\n\n    session.install(\"-r\", \"tests/requirements.txt\", \"--prefer-binary\")\n    session.run(\"pytest\", \"tests/extra_python_package\", *session.posargs)\n\n\n@nox.session(reuse_venv=True)\ndef docs(session: nox.Session) -> None:\n    \"\"\"\n    Build the docs. Pass \"serve\" to serve.\n    \"\"\"\n\n    session.install(\"-r\", \"docs/requirements.txt\")\n    session.chdir(\"docs\")\n\n    if \"pdf\" in session.posargs:\n        session.run(\"sphinx-build\", \"-M\", \"latexpdf\", \".\", \"_build\")\n        return\n\n    session.run(\"sphinx-build\", \"-M\", \"html\", \".\", \"_build\")\n\n    if \"serve\" in session.posargs:\n        session.log(\"Launching docs at http://localhost:8000/ - use Ctrl-C to quit\")\n        session.run(\"python\", \"-m\", \"http.server\", \"8000\", \"-d\", \"_build/html\")\n    elif session.posargs:\n        session.error(\"Unsupported argument to docs\")\n\n\n@nox.session(reuse_venv=True)\ndef make_changelog(session: nox.Session) -> None:\n    \"\"\"\n    Inspect the closed issues and make entries for a changelog.\n    \"\"\"\n    session.install(\"ghapi\", \"rich\")\n    session.run(\"python\", \"tools/make_changelog.py\")\n\n\n@nox.session(reuse_venv=True)\ndef build(session: nox.Session) -> None:\n    \"\"\"\n    Build SDists and wheels.\n    \"\"\"\n\n    session.install(\"build\")\n    session.log(\"Building normal files\")\n    session.run(\"python\", \"-m\", \"build\", *session.posargs)\n    session.log(\"Building pybind11-global files (PYBIND11_GLOBAL_SDIST=1)\")\n    session.run(\n        \"python\", \"-m\", \"build\", *session.posargs, env={\"PYBIND11_GLOBAL_SDIST\": \"1\"}\n    )\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/pybind11/__init__.py",
    "content": "import sys\n\nif sys.version_info < (3, 6):\n    msg = \"pybind11 does not support Python < 3.6. 2.9 was the last release supporting Python 2.7 and 3.5.\"\n    raise ImportError(msg)\n\n\nfrom ._version import __version__, version_info\nfrom .commands import get_cmake_dir, get_include, get_pkgconfig_dir\n\n__all__ = (\n    \"version_info\",\n    \"__version__\",\n    \"get_include\",\n    \"get_cmake_dir\",\n    \"get_pkgconfig_dir\",\n)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/pybind11/__main__.py",
    "content": "# pylint: disable=missing-function-docstring\n\nimport argparse\nimport sys\nimport sysconfig\n\nfrom ._version import __version__\nfrom .commands import get_cmake_dir, get_include, get_pkgconfig_dir\n\n\ndef print_includes() -> None:\n    dirs = [\n        sysconfig.get_path(\"include\"),\n        sysconfig.get_path(\"platinclude\"),\n        get_include(),\n    ]\n\n    # Make unique but preserve order\n    unique_dirs = []\n    for d in dirs:\n        if d and d not in unique_dirs:\n            unique_dirs.append(d)\n\n    print(\" \".join(\"-I\" + d for d in unique_dirs))\n\n\ndef main() -> None:\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\n        \"--version\",\n        action=\"version\",\n        version=__version__,\n        help=\"Print the version and exit.\",\n    )\n    parser.add_argument(\n        \"--includes\",\n        action=\"store_true\",\n        help=\"Include flags for both pybind11 and Python headers.\",\n    )\n    parser.add_argument(\n        \"--cmakedir\",\n        action=\"store_true\",\n        help=\"Print the CMake module directory, ideal for setting -Dpybind11_ROOT in CMake.\",\n    )\n    parser.add_argument(\n        \"--pkgconfigdir\",\n        action=\"store_true\",\n        help=\"Print the pkgconfig directory, ideal for setting $PKG_CONFIG_PATH.\",\n    )\n    args = parser.parse_args()\n    if not sys.argv[1:]:\n        parser.print_help()\n    if args.includes:\n        print_includes()\n    if args.cmakedir:\n        print(get_cmake_dir())\n    if args.pkgconfigdir:\n        print(get_pkgconfig_dir())\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/pybind11/_version.py",
    "content": "from typing import Union\n\n\ndef _to_int(s: str) -> Union[int, str]:\n    try:\n        return int(s)\n    except ValueError:\n        return s\n\n\n__version__ = \"2.10.4\"\nversion_info = tuple(_to_int(s) for s in __version__.split(\".\"))\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/pybind11/commands.py",
    "content": "import os\n\nDIR = os.path.abspath(os.path.dirname(__file__))\n\n\ndef get_include(user: bool = False) -> str:  # pylint: disable=unused-argument\n    \"\"\"\n    Return the path to the pybind11 include directory. The historical \"user\"\n    argument is unused, and may be removed.\n    \"\"\"\n    installed_path = os.path.join(DIR, \"include\")\n    source_path = os.path.join(os.path.dirname(DIR), \"include\")\n    return installed_path if os.path.exists(installed_path) else source_path\n\n\ndef get_cmake_dir() -> str:\n    \"\"\"\n    Return the path to the pybind11 CMake module directory.\n    \"\"\"\n    cmake_installed_path = os.path.join(DIR, \"share\", \"cmake\", \"pybind11\")\n    if os.path.exists(cmake_installed_path):\n        return cmake_installed_path\n\n    msg = \"pybind11 not installed, installation required to access the CMake files\"\n    raise ImportError(msg)\n\n\ndef get_pkgconfig_dir() -> str:\n    \"\"\"\n    Return the path to the pybind11 pkgconfig directory.\n    \"\"\"\n    pkgconfig_installed_path = os.path.join(DIR, \"share\", \"pkgconfig\")\n    if os.path.exists(pkgconfig_installed_path):\n        return pkgconfig_installed_path\n\n    msg = \"pybind11 not installed, installation required to access the pkgconfig files\"\n    raise ImportError(msg)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/pybind11/py.typed",
    "content": ""
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/pybind11/setup_helpers.py",
    "content": "\"\"\"\nThis module provides helpers for C++11+ projects using pybind11.\n\nLICENSE:\n\nCopyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\"\"\"\n\n# IMPORTANT: If you change this file in the pybind11 repo, also review\n# setup_helpers.pyi for matching changes.\n#\n# If you copy this file in, you don't\n# need the .pyi file; it's just an interface file for static type checkers.\n\nimport contextlib\nimport os\nimport platform\nimport shlex\nimport shutil\nimport sys\nimport sysconfig\nimport tempfile\nimport threading\nimport warnings\nfrom functools import lru_cache\nfrom pathlib import Path\nfrom typing import (\n    Any,\n    Callable,\n    Dict,\n    Iterable,\n    Iterator,\n    List,\n    Optional,\n    Tuple,\n    TypeVar,\n    Union,\n)\n\ntry:\n    from setuptools import Extension as _Extension\n    from setuptools.command.build_ext import build_ext as _build_ext\nexcept ImportError:\n    from distutils.command.build_ext import build_ext as _build_ext\n    from distutils.extension import Extension as _Extension\n\nimport distutils.ccompiler\nimport distutils.errors\n\nWIN = sys.platform.startswith(\"win32\") and \"mingw\" not in sysconfig.get_platform()\nMACOS = sys.platform.startswith(\"darwin\")\nSTD_TMPL = \"/std:c++{}\" if WIN else \"-std=c++{}\"\n\n\n# It is recommended to use PEP 518 builds if using this module. However, this\n# file explicitly supports being copied into a user's project directory\n# standalone, and pulling pybind11 with the deprecated setup_requires feature.\n# If you copy the file, remember to add it to your MANIFEST.in, and add the current\n# directory into your path if it sits beside your setup.py.\n\n\nclass Pybind11Extension(_Extension):  # type: ignore[misc]\n    \"\"\"\n    Build a C++11+ Extension module with pybind11. This automatically adds the\n    recommended flags when you init the extension and assumes C++ sources - you\n    can further modify the options yourself.\n\n    The customizations are:\n\n    * ``/EHsc`` and ``/bigobj`` on Windows\n    * ``stdlib=libc++`` on macOS\n    * ``visibility=hidden`` and ``-g0`` on Unix\n\n    Finally, you can set ``cxx_std`` via constructor or afterwards to enable\n    flags for C++ std, and a few extra helper flags related to the C++ standard\n    level. It is _highly_ recommended you either set this, or use the provided\n    ``build_ext``, which will search for the highest supported extension for\n    you if the ``cxx_std`` property is not set. Do not set the ``cxx_std``\n    property more than once, as flags are added when you set it. Set the\n    property to None to disable the addition of C++ standard flags.\n\n    If you want to add pybind11 headers manually, for example for an exact\n    git checkout, then set ``include_pybind11=False``.\n    \"\"\"\n\n    # flags are prepended, so that they can be further overridden, e.g. by\n    # ``extra_compile_args=[\"-g\"]``.\n\n    def _add_cflags(self, flags: List[str]) -> None:\n        self.extra_compile_args[:0] = flags\n\n    def _add_ldflags(self, flags: List[str]) -> None:\n        self.extra_link_args[:0] = flags\n\n    def __init__(self, *args: Any, **kwargs: Any) -> None:\n        self._cxx_level = 0\n        cxx_std = kwargs.pop(\"cxx_std\", 0)\n\n        if \"language\" not in kwargs:\n            kwargs[\"language\"] = \"c++\"\n\n        include_pybind11 = kwargs.pop(\"include_pybind11\", True)\n\n        super().__init__(*args, **kwargs)\n\n        # Include the installed package pybind11 headers\n        if include_pybind11:\n            # If using setup_requires, this fails the first time - that's okay\n            try:\n                import pybind11\n\n                pyinc = pybind11.get_include()\n\n                if pyinc not in self.include_dirs:\n                    self.include_dirs.append(pyinc)\n            except ModuleNotFoundError:\n                pass\n\n        self.cxx_std = cxx_std\n\n        cflags = []\n        ldflags = []\n        if WIN:\n            cflags += [\"/EHsc\", \"/bigobj\"]\n        else:\n            cflags += [\"-fvisibility=hidden\"]\n            env_cflags = os.environ.get(\"CFLAGS\", \"\")\n            env_cppflags = os.environ.get(\"CPPFLAGS\", \"\")\n            c_cpp_flags = shlex.split(env_cflags) + shlex.split(env_cppflags)\n            if not any(opt.startswith(\"-g\") for opt in c_cpp_flags):\n                cflags += [\"-g0\"]\n            if MACOS:\n                cflags += [\"-stdlib=libc++\"]\n                ldflags += [\"-stdlib=libc++\"]\n        self._add_cflags(cflags)\n        self._add_ldflags(ldflags)\n\n    @property\n    def cxx_std(self) -> int:\n        \"\"\"\n        The CXX standard level. If set, will add the required flags. If left at\n        0, it will trigger an automatic search when pybind11's build_ext is\n        used. If None, will have no effect.  Besides just the flags, this may\n        add a macos-min 10.9 or 10.14 flag if MACOSX_DEPLOYMENT_TARGET is\n        unset.\n        \"\"\"\n        return self._cxx_level\n\n    @cxx_std.setter\n    def cxx_std(self, level: int) -> None:\n        if self._cxx_level:\n            warnings.warn(\n                \"You cannot safely change the cxx_level after setting it!\", stacklevel=2\n            )\n\n        # MSVC 2015 Update 3 and later only have 14 (and later 17) modes, so\n        # force a valid flag here.\n        if WIN and level == 11:\n            level = 14\n\n        self._cxx_level = level\n\n        if not level:\n            return\n\n        cflags = [STD_TMPL.format(level)]\n        ldflags = []\n\n        if MACOS and \"MACOSX_DEPLOYMENT_TARGET\" not in os.environ:\n            # C++17 requires a higher min version of macOS. An earlier version\n            # (10.12 or 10.13) can be set manually via environment variable if\n            # you are careful in your feature usage, but 10.14 is the safest\n            # setting for general use. However, never set higher than the\n            # current macOS version!\n            current_macos = tuple(int(x) for x in platform.mac_ver()[0].split(\".\")[:2])\n            desired_macos = (10, 9) if level < 17 else (10, 14)\n            macos_string = \".\".join(str(x) for x in min(current_macos, desired_macos))\n            macosx_min = f\"-mmacosx-version-min={macos_string}\"\n            cflags += [macosx_min]\n            ldflags += [macosx_min]\n\n        self._add_cflags(cflags)\n        self._add_ldflags(ldflags)\n\n\n# Just in case someone clever tries to multithread\ntmp_chdir_lock = threading.Lock()\n\n\n@contextlib.contextmanager\ndef tmp_chdir() -> Iterator[str]:\n    \"Prepare and enter a temporary directory, cleanup when done\"\n\n    # Threadsafe\n    with tmp_chdir_lock:\n        olddir = os.getcwd()\n        try:\n            tmpdir = tempfile.mkdtemp()\n            os.chdir(tmpdir)\n            yield tmpdir\n        finally:\n            os.chdir(olddir)\n            shutil.rmtree(tmpdir)\n\n\n# cf http://bugs.python.org/issue26689\ndef has_flag(compiler: Any, flag: str) -> bool:\n    \"\"\"\n    Return the flag if a flag name is supported on the\n    specified compiler, otherwise None (can be used as a boolean).\n    If multiple flags are passed, return the first that matches.\n    \"\"\"\n\n    with tmp_chdir():\n        fname = Path(\"flagcheck.cpp\")\n        # Don't trigger -Wunused-parameter.\n        fname.write_text(\"int main (int, char **) { return 0; }\", encoding=\"utf-8\")\n\n        try:\n            compiler.compile([str(fname)], extra_postargs=[flag])\n        except distutils.errors.CompileError:\n            return False\n        return True\n\n\n# Every call will cache the result\ncpp_flag_cache = None\n\n\n@lru_cache()\ndef auto_cpp_level(compiler: Any) -> Union[str, int]:\n    \"\"\"\n    Return the max supported C++ std level (17, 14, or 11). Returns latest on Windows.\n    \"\"\"\n\n    if WIN:\n        return \"latest\"\n\n    levels = [17, 14, 11]\n\n    for level in levels:\n        if has_flag(compiler, STD_TMPL.format(level)):\n            return level\n\n    msg = \"Unsupported compiler -- at least C++11 support is needed!\"\n    raise RuntimeError(msg)\n\n\nclass build_ext(_build_ext):  # type: ignore[misc] # noqa: N801\n    \"\"\"\n    Customized build_ext that allows an auto-search for the highest supported\n    C++ level for Pybind11Extension. This is only needed for the auto-search\n    for now, and is completely optional otherwise.\n    \"\"\"\n\n    def build_extensions(self) -> None:\n        \"\"\"\n        Build extensions, injecting C++ std for Pybind11Extension if needed.\n        \"\"\"\n\n        for ext in self.extensions:\n            if hasattr(ext, \"_cxx_level\") and ext._cxx_level == 0:\n                ext.cxx_std = auto_cpp_level(self.compiler)\n\n        super().build_extensions()\n\n\ndef intree_extensions(\n    paths: Iterable[str], package_dir: Optional[Dict[str, str]] = None\n) -> List[Pybind11Extension]:\n    \"\"\"\n    Generate Pybind11Extensions from source files directly located in a Python\n    source tree.\n\n    ``package_dir`` behaves as in ``setuptools.setup``.  If unset, the Python\n    package root parent is determined as the first parent directory that does\n    not contain an ``__init__.py`` file.\n    \"\"\"\n    exts = []\n\n    if package_dir is None:\n        for path in paths:\n            parent, _ = os.path.split(path)\n            while os.path.exists(os.path.join(parent, \"__init__.py\")):\n                parent, _ = os.path.split(parent)\n            relname, _ = os.path.splitext(os.path.relpath(path, parent))\n            qualified_name = relname.replace(os.path.sep, \".\")\n            exts.append(Pybind11Extension(qualified_name, [path]))\n        return exts\n\n    for path in paths:\n        for prefix, parent in package_dir.items():\n            if path.startswith(parent):\n                relname, _ = os.path.splitext(os.path.relpath(path, parent))\n                qualified_name = relname.replace(os.path.sep, \".\")\n                if prefix:\n                    qualified_name = prefix + \".\" + qualified_name\n                exts.append(Pybind11Extension(qualified_name, [path]))\n                break\n        else:\n            msg = (\n                f\"path {path} is not a child of any of the directories listed \"\n                f\"in 'package_dir' ({package_dir})\"\n            )\n            raise ValueError(msg)\n\n    return exts\n\n\ndef naive_recompile(obj: str, src: str) -> bool:\n    \"\"\"\n    This will recompile only if the source file changes. It does not check\n    header files, so a more advanced function or Ccache is better if you have\n    editable header files in your package.\n    \"\"\"\n    return os.stat(obj).st_mtime < os.stat(src).st_mtime\n\n\ndef no_recompile(obg: str, src: str) -> bool:  # pylint: disable=unused-argument\n    \"\"\"\n    This is the safest but slowest choice (and is the default) - will always\n    recompile sources.\n    \"\"\"\n    return True\n\n\nS = TypeVar(\"S\", bound=\"ParallelCompile\")\n\nCCompilerMethod = Callable[\n    [\n        distutils.ccompiler.CCompiler,\n        List[str],\n        Optional[str],\n        Optional[Union[Tuple[str], Tuple[str, Optional[str]]]],\n        Optional[List[str]],\n        bool,\n        Optional[List[str]],\n        Optional[List[str]],\n        Optional[List[str]],\n    ],\n    List[str],\n]\n\n\n# Optional parallel compile utility\n# inspired by: http://stackoverflow.com/questions/11013851/speeding-up-build-process-with-distutils\n# and: https://github.com/tbenthompson/cppimport/blob/stable/cppimport/build_module.py\n# and NumPy's parallel distutils module:\n#              https://github.com/numpy/numpy/blob/master/numpy/distutils/ccompiler.py\nclass ParallelCompile:\n    \"\"\"\n    Make a parallel compile function. Inspired by\n    numpy.distutils.ccompiler.CCompiler.compile and cppimport.\n\n    This takes several arguments that allow you to customize the compile\n    function created:\n\n    envvar:\n        Set an environment variable to control the compilation threads, like\n        NPY_NUM_BUILD_JOBS\n    default:\n        0 will automatically multithread, or 1 will only multithread if the\n        envvar is set.\n    max:\n        The limit for automatic multithreading if non-zero\n    needs_recompile:\n        A function of (obj, src) that returns True when recompile is needed.  No\n        effect in isolated mode; use ccache instead, see\n        https://github.com/matplotlib/matplotlib/issues/1507/\n\n    To use::\n\n        ParallelCompile(\"NPY_NUM_BUILD_JOBS\").install()\n\n    or::\n\n        with ParallelCompile(\"NPY_NUM_BUILD_JOBS\"):\n            setup(...)\n\n    By default, this assumes all files need to be recompiled. A smarter\n    function can be provided via needs_recompile.  If the output has not yet\n    been generated, the compile will always run, and this function is not\n    called.\n    \"\"\"\n\n    __slots__ = (\"envvar\", \"default\", \"max\", \"_old\", \"needs_recompile\")\n\n    def __init__(\n        self,\n        envvar: Optional[str] = None,\n        default: int = 0,\n        max: int = 0,  # pylint: disable=redefined-builtin\n        needs_recompile: Callable[[str, str], bool] = no_recompile,\n    ) -> None:\n        self.envvar = envvar\n        self.default = default\n        self.max = max\n        self.needs_recompile = needs_recompile\n        self._old: List[CCompilerMethod] = []\n\n    def function(self) -> CCompilerMethod:\n        \"\"\"\n        Builds a function object usable as distutils.ccompiler.CCompiler.compile.\n        \"\"\"\n\n        def compile_function(\n            compiler: distutils.ccompiler.CCompiler,\n            sources: List[str],\n            output_dir: Optional[str] = None,\n            macros: Optional[Union[Tuple[str], Tuple[str, Optional[str]]]] = None,\n            include_dirs: Optional[List[str]] = None,\n            debug: bool = False,\n            extra_preargs: Optional[List[str]] = None,\n            extra_postargs: Optional[List[str]] = None,\n            depends: Optional[List[str]] = None,\n        ) -> Any:\n            # These lines are directly from distutils.ccompiler.CCompiler\n            macros, objects, extra_postargs, pp_opts, build = compiler._setup_compile(  # type: ignore[attr-defined]\n                output_dir, macros, include_dirs, sources, depends, extra_postargs\n            )\n            cc_args = compiler._get_cc_args(pp_opts, debug, extra_preargs)  # type: ignore[attr-defined]\n\n            # The number of threads; start with default.\n            threads = self.default\n\n            # Determine the number of compilation threads, unless set by an environment variable.\n            if self.envvar is not None:\n                threads = int(os.environ.get(self.envvar, self.default))\n\n            def _single_compile(obj: Any) -> None:\n                try:\n                    src, ext = build[obj]\n                except KeyError:\n                    return\n\n                if not os.path.exists(obj) or self.needs_recompile(obj, src):\n                    compiler._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)  # type: ignore[attr-defined]\n\n            try:\n                # Importing .synchronize checks for platforms that have some multiprocessing\n                # capabilities but lack semaphores, such as AWS Lambda and Android Termux.\n                import multiprocessing.synchronize\n                from multiprocessing.pool import ThreadPool\n            except ImportError:\n                threads = 1\n\n            if threads == 0:\n                try:\n                    threads = multiprocessing.cpu_count()\n                    threads = self.max if self.max and self.max < threads else threads\n                except NotImplementedError:\n                    threads = 1\n\n            if threads > 1:\n                with ThreadPool(threads) as pool:\n                    for _ in pool.imap_unordered(_single_compile, objects):\n                        pass\n            else:\n                for ob in objects:\n                    _single_compile(ob)\n\n            return objects\n\n        return compile_function\n\n    def install(self: S) -> S:\n        \"\"\"\n        Installs the compile function into distutils.ccompiler.CCompiler.compile.\n        \"\"\"\n        distutils.ccompiler.CCompiler.compile = self.function()  # type: ignore[assignment]\n        return self\n\n    def __enter__(self: S) -> S:\n        self._old.append(distutils.ccompiler.CCompiler.compile)\n        return self.install()\n\n    def __exit__(self, *args: Any) -> None:\n        distutils.ccompiler.CCompiler.compile = self._old.pop()  # type: ignore[assignment]\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/pyproject.toml",
    "content": "[build-system]\nrequires = [\"setuptools>=42\", \"cmake>=3.18\", \"ninja\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[tool.check-manifest]\nignore = [\n    \"tests/**\",\n    \"docs/**\",\n    \"tools/**\",\n    \"include/**\",\n    \".*\",\n    \"pybind11/include/**\",\n    \"pybind11/share/**\",\n    \"CMakeLists.txt\",\n    \"noxfile.py\",\n]\n\n[tool.isort]\n# Needs the compiled .so modules and env.py from tests\nknown_first_party = \"env,pybind11_cross_module_tests,pybind11_tests,\"\n# For black compatibility\nprofile = \"black\"\n\n[tool.mypy]\nfiles = [\"pybind11\"]\npython_version = \"3.6\"\nstrict = true\nshow_error_codes = true\nenable_error_code = [\"ignore-without-code\", \"redundant-expr\", \"truthy-bool\"]\nwarn_unreachable = true\n\n[[tool.mypy.overrides]]\nmodule = [\"ghapi.*\", \"setuptools.*\"]\nignore_missing_imports = true\n\n\n[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = [\"-ra\", \"--showlocals\", \"--strict-markers\", \"--strict-config\"]\nxfail_strict = true\nfilterwarnings = [\"error\"]\nlog_cli_level = \"info\"\ntestpaths = [\n    \"tests\",\n]\ntimeout=300\n\n\n[tool.pylint]\nmaster.py-version = \"3.6\"\nreports.output-format = \"colorized\"\nmessages_control.disable = [\n  \"design\",\n  \"fixme\",\n  \"imports\",\n  \"line-too-long\",\n  \"imports\",\n  \"invalid-name\",\n  \"protected-access\",\n  \"missing-module-docstring\",\n]\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/setup.cfg",
    "content": "[metadata]\nlong_description = file: README.rst\nlong_description_content_type = text/x-rst\ndescription = Seamless operability between C++11 and Python\nauthor = Wenzel Jakob\nauthor_email = wenzel.jakob@epfl.ch\nurl = https://github.com/pybind/pybind11\nlicense = BSD\n\nclassifiers =\n    Development Status :: 5 - Production/Stable\n    Intended Audience :: Developers\n    Topic :: Software Development :: Libraries :: Python Modules\n    Topic :: Utilities\n    Programming Language :: C++\n    Programming Language :: Python :: 3 :: Only\n    Programming Language :: Python :: 3.6\n    Programming Language :: Python :: 3.7\n    Programming Language :: Python :: 3.8\n    Programming Language :: Python :: 3.9\n    Programming Language :: Python :: 3.10\n    Programming Language :: Python :: 3.11\n    License :: OSI Approved :: BSD License\n    Programming Language :: Python :: Implementation :: PyPy\n    Programming Language :: Python :: Implementation :: CPython\n    Programming Language :: C++\n    Topic :: Software Development :: Libraries :: Python Modules\n\nkeywords =\n    C++11\n    Python bindings\n\nproject_urls =\n    Documentation = https://pybind11.readthedocs.io/\n    Bug Tracker = https://github.com/pybind/pybind11/issues\n    Discussions = https://github.com/pybind/pybind11/discussions\n    Changelog = https://pybind11.readthedocs.io/en/latest/changelog.html\n    Chat = https://gitter.im/pybind/Lobby\n\n[options]\npython_requires = >=3.6\nzip_safe = False\n\n\n[flake8]\nmax-line-length = 120\nshow_source = True\nexclude = .git, __pycache__, build, dist, docs, tools, venv\nextend-ignore = E203, E722\nextend-select = B902, B904\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/setup.py",
    "content": "#!/usr/bin/env python3\n\n# Setup script for PyPI; use CMakeFile.txt to build extension modules\n\nimport contextlib\nimport os\nimport re\nimport shutil\nimport string\nimport subprocess\nimport sys\nfrom pathlib import Path\nfrom tempfile import TemporaryDirectory\nfrom typing import Dict, Iterator, List, Union\n\nimport setuptools.command.sdist\n\nDIR = Path(__file__).parent.absolute()\nVERSION_REGEX = re.compile(\n    r\"^\\s*#\\s*define\\s+PYBIND11_VERSION_([A-Z]+)\\s+(.*)$\", re.MULTILINE\n)\nVERSION_FILE = Path(\"pybind11/_version.py\")\nCOMMON_FILE = Path(\"include/pybind11/detail/common.h\")\n\n\ndef build_expected_version_hex(matches: Dict[str, str]) -> str:\n    patch_level_serial = matches[\"PATCH\"]\n    serial = None\n    major = int(matches[\"MAJOR\"])\n    minor = int(matches[\"MINOR\"])\n    flds = patch_level_serial.split(\".\")\n    if flds:\n        patch = int(flds[0])\n        if len(flds) == 1:\n            level = \"0\"\n            serial = 0\n        elif len(flds) == 2:\n            level_serial = flds[1]\n            for level in (\"a\", \"b\", \"c\", \"dev\"):\n                if level_serial.startswith(level):\n                    serial = int(level_serial[len(level) :])\n                    break\n    if serial is None:\n        msg = f'Invalid PYBIND11_VERSION_PATCH: \"{patch_level_serial}\"'\n        raise RuntimeError(msg)\n    version_hex_str = f\"{major:02x}{minor:02x}{patch:02x}{level[:1]}{serial:x}\"\n    return f\"0x{version_hex_str.upper()}\"\n\n\n# PYBIND11_GLOBAL_SDIST will build a different sdist, with the python-headers\n# files, and the sys.prefix files (CMake and headers).\n\nglobal_sdist = os.environ.get(\"PYBIND11_GLOBAL_SDIST\", False)\n\nsetup_py = Path(\n    \"tools/setup_global.py.in\" if global_sdist else \"tools/setup_main.py.in\"\n)\nextra_cmd = 'cmdclass[\"sdist\"] = SDist\\n'\n\nto_src = (\n    (Path(\"pyproject.toml\"), Path(\"tools/pyproject.toml\")),\n    (Path(\"setup.py\"), setup_py),\n)\n\n\n# Read the listed version\nloc: Dict[str, str] = {}\ncode = compile(VERSION_FILE.read_text(encoding=\"utf-8\"), \"pybind11/_version.py\", \"exec\")\nexec(code, loc)\nversion = loc[\"__version__\"]\n\n# Verify that the version matches the one in C++\nmatches = dict(VERSION_REGEX.findall(COMMON_FILE.read_text(encoding=\"utf8\")))\ncpp_version = \"{MAJOR}.{MINOR}.{PATCH}\".format(**matches)\nif version != cpp_version:\n    msg = f\"Python version {version} does not match C++ version {cpp_version}!\"\n    raise RuntimeError(msg)\n\nversion_hex = matches.get(\"HEX\", \"MISSING\")\nexp_version_hex = build_expected_version_hex(matches)\nif version_hex != exp_version_hex:\n    msg = f\"PYBIND11_VERSION_HEX {version_hex} does not match expected value {exp_version_hex}!\"\n    raise RuntimeError(msg)\n\n\n# TODO: use literals & overload (typing extensions or Python 3.8)\ndef get_and_replace(\n    filename: Path, binary: bool = False, **opts: str\n) -> Union[bytes, str]:\n    if binary:\n        contents = filename.read_bytes()\n        return string.Template(contents.decode()).substitute(opts).encode()\n\n    return string.Template(filename.read_text()).substitute(opts)\n\n\n# Use our input files instead when making the SDist (and anything that depends\n# on it, like a wheel)\nclass SDist(setuptools.command.sdist.sdist):  # type: ignore[misc]\n    def make_release_tree(self, base_dir: str, files: List[str]) -> None:\n        super().make_release_tree(base_dir, files)\n\n        for to, src in to_src:\n            txt = get_and_replace(src, binary=True, version=version, extra_cmd=\"\")\n\n            dest = Path(base_dir) / to\n\n            # This is normally linked, so unlink before writing!\n            dest.unlink()\n            dest.write_bytes(txt)  # type: ignore[arg-type]\n\n\n# Remove the CMake install directory when done\n@contextlib.contextmanager\ndef remove_output(*sources: str) -> Iterator[None]:\n    try:\n        yield\n    finally:\n        for src in sources:\n            shutil.rmtree(src)\n\n\nwith remove_output(\"pybind11/include\", \"pybind11/share\"):\n    # Generate the files if they are not present.\n    with TemporaryDirectory() as tmpdir:\n        cmd = [\"cmake\", \"-S\", \".\", \"-B\", tmpdir] + [\n            \"-DCMAKE_INSTALL_PREFIX=pybind11\",\n            \"-DBUILD_TESTING=OFF\",\n            \"-DPYBIND11_NOPYTHON=ON\",\n            \"-Dprefix_for_pc_file=${pcfiledir}/../../\",\n        ]\n        if \"CMAKE_ARGS\" in os.environ:\n            fcommand = [\n                c\n                for c in os.environ[\"CMAKE_ARGS\"].split()\n                if \"DCMAKE_INSTALL_PREFIX\" not in c\n            ]\n            cmd += fcommand\n        subprocess.run(cmd, check=True, cwd=DIR, stdout=sys.stdout, stderr=sys.stderr)\n        subprocess.run(\n            [\"cmake\", \"--install\", tmpdir],\n            check=True,\n            cwd=DIR,\n            stdout=sys.stdout,\n            stderr=sys.stderr,\n        )\n\n    txt = get_and_replace(setup_py, version=version, extra_cmd=extra_cmd)\n    code = compile(txt, setup_py, \"exec\")\n    exec(code, {\"SDist\": SDist})\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/CMakeLists.txt",
    "content": "# CMakeLists.txt -- Build system for the pybind11 test suite\n#\n# Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>\n#\n# All rights reserved. Use of this source code is governed by a\n# BSD-style license that can be found in the LICENSE file.\n\ncmake_minimum_required(VERSION 3.4)\n\n# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with\n# some versions of VS that have a patched CMake 3.11. This forces us to emulate\n# the behavior using the following workaround:\nif(${CMAKE_VERSION} VERSION_LESS 3.21)\n  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})\nelse()\n  cmake_policy(VERSION 3.21)\nendif()\n\n# Only needed for CMake < 3.5 support\ninclude(CMakeParseArguments)\n\n# Filter out items; print an optional message if any items filtered. This ignores extensions.\n#\n# Usage:\n#   pybind11_filter_tests(LISTNAME file1.cpp file2.cpp ... MESSAGE \"\")\n#\nmacro(pybind11_filter_tests LISTNAME)\n  cmake_parse_arguments(ARG \"\" \"MESSAGE\" \"\" ${ARGN})\n  set(PYBIND11_FILTER_TESTS_FOUND OFF)\n  # Make a list of the test without any extensions, for easier filtering.\n  set(_TMP_ACTUAL_LIST \"${${LISTNAME}};\") # enforce ';' at the end to allow matching last item.\n  string(REGEX REPLACE \"\\\\.[^.;]*;\" \";\" LIST_WITHOUT_EXTENSIONS \"${_TMP_ACTUAL_LIST}\")\n  foreach(filename IN LISTS ARG_UNPARSED_ARGUMENTS)\n    string(REGEX REPLACE \"\\\\.[^.]*$\" \"\" filename_no_ext ${filename})\n    # Search in the list without extensions.\n    list(FIND LIST_WITHOUT_EXTENSIONS ${filename_no_ext} _FILE_FOUND)\n    if(_FILE_FOUND GREATER -1)\n      list(REMOVE_AT ${LISTNAME} ${_FILE_FOUND}) # And remove from the list with extensions.\n      list(REMOVE_AT LIST_WITHOUT_EXTENSIONS ${_FILE_FOUND}\n      )# And our search list, to ensure it is in sync.\n      set(PYBIND11_FILTER_TESTS_FOUND ON)\n    endif()\n  endforeach()\n  if(PYBIND11_FILTER_TESTS_FOUND AND ARG_MESSAGE)\n    message(STATUS \"${ARG_MESSAGE}\")\n  endif()\nendmacro()\n\nmacro(possibly_uninitialized)\n  foreach(VARNAME ${ARGN})\n    if(NOT DEFINED \"${VARNAME}\")\n      set(\"${VARNAME}\" \"\")\n    endif()\n  endforeach()\nendmacro()\n\n# Function to add additional targets if any of the provided tests are found.\n# Needles; Specifies the test names to look for.\n# Additions; Specifies the additional test targets to add when any of the needles are found.\nmacro(tests_extra_targets needles additions)\n  # Add the index for this relation to the index extra targets map.\n  list(LENGTH PYBIND11_TEST_EXTRA_TARGETS PYBIND11_TEST_EXTRA_TARGETS_LEN)\n  list(APPEND PYBIND11_TEST_EXTRA_TARGETS ${PYBIND11_TEST_EXTRA_TARGETS_LEN})\n  # Add the test names to look for, and the associated test target additions.\n  set(PYBIND11_TEST_EXTRA_TARGETS_NEEDLES_${PYBIND11_TEST_EXTRA_TARGETS_LEN} ${needles})\n  set(PYBIND11_TEST_EXTRA_TARGETS_ADDITION_${PYBIND11_TEST_EXTRA_TARGETS_LEN} ${additions})\nendmacro()\n\n# New Python support\nif(DEFINED Python_EXECUTABLE)\n  set(PYTHON_EXECUTABLE \"${Python_EXECUTABLE}\")\n  set(PYTHON_VERSION \"${Python_VERSION}\")\nendif()\n\n# There's no harm in including a project in a project\nproject(pybind11_tests CXX)\n\n# Access FindCatch and more\nlist(APPEND CMAKE_MODULE_PATH \"${CMAKE_CURRENT_LIST_DIR}/../tools\")\n\noption(PYBIND11_WERROR \"Report all warnings as errors\" OFF)\noption(DOWNLOAD_EIGEN \"Download EIGEN (requires CMake 3.11+)\" OFF)\noption(PYBIND11_CUDA_TESTS \"Enable building CUDA tests (requires CMake 3.12+)\" OFF)\nset(PYBIND11_TEST_OVERRIDE\n    \"\"\n    CACHE STRING \"Tests from ;-separated list of *.cpp files will be built instead of all tests\")\nset(PYBIND11_TEST_FILTER\n    \"\"\n    CACHE STRING \"Tests from ;-separated list of *.cpp files will be removed from all tests\")\n\nif(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)\n  # We're being loaded directly, i.e. not via add_subdirectory, so make this\n  # work as its own project and load the pybind11Config to get the tools we need\n  find_package(pybind11 REQUIRED CONFIG)\nendif()\n\nif(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)\n  message(STATUS \"Setting tests build type to MinSizeRel as none was specified\")\n  set(CMAKE_BUILD_TYPE\n      MinSizeRel\n      CACHE STRING \"Choose the type of build.\" FORCE)\n  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS \"Debug\" \"Release\" \"MinSizeRel\"\n                                               \"RelWithDebInfo\")\nendif()\n\nif(PYBIND11_CUDA_TESTS)\n  enable_language(CUDA)\n  if(DEFINED CMAKE_CXX_STANDARD)\n    set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD})\n  endif()\n  set(CMAKE_CUDA_STANDARD_REQUIRED ON)\nendif()\n\n# Full set of test files (you can override these; see below, overrides ignore extension)\n# Any test that has no extension is both .py and .cpp, so 'foo' will add 'foo.cpp' and 'foo.py'.\n# Any test that has an extension is exclusively that and handled as such.\nset(PYBIND11_TEST_FILES\n    test_async\n    test_buffers\n    test_builtin_casters\n    test_call_policies\n    test_callbacks\n    test_chrono\n    test_class\n    test_const_name\n    test_constants_and_functions\n    test_copy_move\n    test_custom_type_casters\n    test_custom_type_setup\n    test_docstring_options\n    test_eigen_matrix\n    test_eigen_tensor\n    test_enum\n    test_eval\n    test_exceptions\n    test_factory_constructors\n    test_gil_scoped\n    test_iostream\n    test_kwargs_and_defaults\n    test_local_bindings\n    test_methods_and_attributes\n    test_modules\n    test_multiple_inheritance\n    test_numpy_array\n    test_numpy_dtypes\n    test_numpy_vectorize\n    test_opaque_types\n    test_operator_overloading\n    test_pickling\n    test_pytypes\n    test_sequences_and_iterators\n    test_smart_ptr\n    test_stl\n    test_stl_binders\n    test_tagbased_polymorphic\n    test_thread\n    test_union\n    test_virtual_functions)\n\n# Invoking cmake with something like:\n#     cmake -DPYBIND11_TEST_OVERRIDE=\"test_callbacks.cpp;test_pickling.cpp\" ..\n# lets you override the tests that get compiled and run.  You can restore to all tests with:\n#     cmake -DPYBIND11_TEST_OVERRIDE= ..\nif(PYBIND11_TEST_OVERRIDE)\n  # Instead of doing a direct override here, we iterate over the overrides without extension and\n  # match them against entries from the PYBIND11_TEST_FILES, anything that not matches goes into the filter list.\n  string(REGEX REPLACE \"\\\\.[^.;]*;\" \";\" TEST_OVERRIDE_NO_EXT \"${PYBIND11_TEST_OVERRIDE};\")\n  string(REGEX REPLACE \"\\\\.[^.;]*;\" \";\" TEST_FILES_NO_EXT \"${PYBIND11_TEST_FILES};\")\n  # This allows the override to be done with extensions, preserving backwards compatibility.\n  foreach(test_name ${TEST_FILES_NO_EXT})\n    if(NOT ${test_name} IN_LIST TEST_OVERRIDE_NO_EXT\n    )# If not in the allowlist, add to be filtered out.\n      list(APPEND PYBIND11_TEST_FILTER ${test_name})\n    endif()\n  endforeach()\nendif()\n\n# You can also filter tests:\nif(PYBIND11_TEST_FILTER)\n  pybind11_filter_tests(PYBIND11_TEST_FILES ${PYBIND11_TEST_FILTER})\nendif()\n\n# Skip tests for CUDA check:\n# /pybind11/tests/test_constants_and_functions.cpp(125):\n#   error: incompatible exception specifications\nif(PYBIND11_CUDA_TESTS)\n  pybind11_filter_tests(\n    PYBIND11_TEST_FILES test_constants_and_functions.cpp MESSAGE\n    \"Skipping test_constants_and_functions due to incompatible exception specifications\")\nendif()\n\n# Now that the test filtering is complete, we need to split the list into the test for PYTEST\n# and the list for the cpp targets.\nset(PYBIND11_CPPTEST_FILES \"\")\nset(PYBIND11_PYTEST_FILES \"\")\n\nforeach(test_name ${PYBIND11_TEST_FILES})\n  if(test_name MATCHES \"\\\\.py$\") # Ends in .py, purely python test.\n    list(APPEND PYBIND11_PYTEST_FILES ${test_name})\n  elseif(test_name MATCHES \"\\\\.cpp$\") # Ends in .cpp, purely cpp test.\n    list(APPEND PYBIND11_CPPTEST_FILES ${test_name})\n  elseif(NOT test_name MATCHES \"\\\\.\") # No extension specified, assume both, add extension.\n    list(APPEND PYBIND11_PYTEST_FILES ${test_name}.py)\n    list(APPEND PYBIND11_CPPTEST_FILES ${test_name}.cpp)\n  else()\n    message(WARNING \"Unhanded test extension in test: ${test_name}\")\n  endif()\nendforeach()\nset(PYBIND11_TEST_FILES ${PYBIND11_CPPTEST_FILES})\nlist(SORT PYBIND11_PYTEST_FILES)\n\n# Contains the set of test files that require pybind11_cross_module_tests to be\n# built; if none of these are built (i.e. because TEST_OVERRIDE is used and\n# doesn't include them) the second module doesn't get built.\ntests_extra_targets(\"test_exceptions.py;test_local_bindings.py;test_stl.py;test_stl_binders.py\"\n                    \"pybind11_cross_module_tests\")\n\n# And add additional targets for other tests.\ntests_extra_targets(\"test_exceptions.py\" \"cross_module_interleaved_error_already_set\")\ntests_extra_targets(\"test_gil_scoped.py\" \"cross_module_gil_utils\")\n\nset(PYBIND11_EIGEN_REPO\n    \"https://gitlab.com/libeigen/eigen.git\"\n    CACHE STRING \"Eigen repository to use for tests\")\n# Always use a hash for reconfigure speed and security reasons\n# Include the version number for pretty printing (keep in sync)\nset(PYBIND11_EIGEN_VERSION_AND_HASH\n    \"3.4.0;929bc0e191d0927b1735b9a1ddc0e8b77e3a25ec\"\n    CACHE STRING \"Eigen version to use for tests, format: VERSION;HASH\")\n\nlist(GET PYBIND11_EIGEN_VERSION_AND_HASH 0 PYBIND11_EIGEN_VERSION_STRING)\nlist(GET PYBIND11_EIGEN_VERSION_AND_HASH 1 PYBIND11_EIGEN_VERSION_HASH)\n\n# Check if Eigen is available; if not, remove from PYBIND11_TEST_FILES (but\n# keep it in PYBIND11_PYTEST_FILES, so that we get the \"eigen is not installed\"\n# skip message).\nlist(FIND PYBIND11_TEST_FILES test_eigen_matrix.cpp PYBIND11_TEST_FILES_EIGEN_I)\nif(PYBIND11_TEST_FILES_EIGEN_I EQUAL -1)\n  list(FIND PYBIND11_TEST_FILES test_eigen_tensor.cpp PYBIND11_TEST_FILES_EIGEN_I)\nendif()\nif(PYBIND11_TEST_FILES_EIGEN_I GREATER -1)\n  # Try loading via newer Eigen's Eigen3Config first (bypassing tools/FindEigen3.cmake).\n  # Eigen 3.3.1+ exports a cmake 3.0+ target for handling dependency requirements, but also\n  # produces a fatal error if loaded from a pre-3.0 cmake.\n  if(DOWNLOAD_EIGEN)\n    if(CMAKE_VERSION VERSION_LESS 3.11)\n      message(FATAL_ERROR \"CMake 3.11+ required when using DOWNLOAD_EIGEN\")\n    endif()\n\n    include(FetchContent)\n    FetchContent_Declare(\n      eigen\n      GIT_REPOSITORY \"${PYBIND11_EIGEN_REPO}\"\n      GIT_TAG \"${PYBIND11_EIGEN_VERSION_HASH}\")\n\n    FetchContent_GetProperties(eigen)\n    if(NOT eigen_POPULATED)\n      message(\n        STATUS\n          \"Downloading Eigen ${PYBIND11_EIGEN_VERSION_STRING} (${PYBIND11_EIGEN_VERSION_HASH}) from ${PYBIND11_EIGEN_REPO}\"\n      )\n      FetchContent_Populate(eigen)\n    endif()\n\n    set(EIGEN3_INCLUDE_DIR ${eigen_SOURCE_DIR})\n    set(EIGEN3_FOUND TRUE)\n    # When getting locally, the version is not visible from a superprojet,\n    # so just force it.\n    set(EIGEN3_VERSION \"${PYBIND11_EIGEN_VERSION_STRING}\")\n\n  else()\n    find_package(Eigen3 3.2.7 QUIET CONFIG)\n\n    if(NOT EIGEN3_FOUND)\n      # Couldn't load via target, so fall back to allowing module mode finding, which will pick up\n      # tools/FindEigen3.cmake\n      find_package(Eigen3 3.2.7 QUIET)\n    endif()\n  endif()\n\n  if(EIGEN3_FOUND)\n    if(NOT TARGET Eigen3::Eigen)\n      add_library(Eigen3::Eigen IMPORTED INTERFACE)\n      set_property(TARGET Eigen3::Eigen PROPERTY INTERFACE_INCLUDE_DIRECTORIES\n                                                 \"${EIGEN3_INCLUDE_DIR}\")\n    endif()\n\n    # Eigen 3.3.1+ cmake sets EIGEN3_VERSION_STRING (and hard codes the version when installed\n    # rather than looking it up in the cmake script); older versions, and the\n    # tools/FindEigen3.cmake, set EIGEN3_VERSION instead.\n    if(NOT EIGEN3_VERSION AND EIGEN3_VERSION_STRING)\n      set(EIGEN3_VERSION ${EIGEN3_VERSION_STRING})\n    endif()\n    message(STATUS \"Building tests with Eigen v${EIGEN3_VERSION}\")\n\n    if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))\n      tests_extra_targets(\"test_eigen_tensor.py\" \"eigen_tensor_avoid_stl_array\")\n    endif()\n\n  else()\n    list(FIND PYBIND11_TEST_FILES test_eigen_matrix.cpp PYBIND11_TEST_FILES_EIGEN_I)\n    if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1)\n      list(REMOVE_AT PYBIND11_TEST_FILES ${PYBIND11_TEST_FILES_EIGEN_I})\n    endif()\n\n    list(FIND PYBIND11_TEST_FILES test_eigen_tensor.cpp PYBIND11_TEST_FILES_EIGEN_I)\n    if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1)\n      list(REMOVE_AT PYBIND11_TEST_FILES ${PYBIND11_TEST_FILES_EIGEN_I})\n    endif()\n    message(\n      STATUS \"Building tests WITHOUT Eigen, use -DDOWNLOAD_EIGEN=ON on CMake 3.11+ to download\")\n  endif()\nendif()\n\n# Some code doesn't support gcc 4\nif(CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)\n  list(FIND PYBIND11_TEST_FILES test_eigen_tensor.cpp PYBIND11_TEST_FILES_EIGEN_I)\n  if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1)\n    list(REMOVE_AT PYBIND11_TEST_FILES ${PYBIND11_TEST_FILES_EIGEN_I})\n  endif()\nendif()\n\n# Optional dependency for some tests (boost::variant is only supported with version >= 1.56)\nfind_package(Boost 1.56)\n\nif(Boost_FOUND)\n  if(NOT TARGET Boost::headers)\n    add_library(Boost::headers IMPORTED INTERFACE)\n    if(TARGET Boost::boost)\n      # Classic FindBoost\n      set_property(TARGET Boost::boost PROPERTY INTERFACE_LINK_LIBRARIES Boost::boost)\n    else()\n      # Very old FindBoost, or newer Boost than CMake in older CMakes\n      set_property(TARGET Boost::headers PROPERTY INTERFACE_INCLUDE_DIRECTORIES\n                                                  ${Boost_INCLUDE_DIRS})\n    endif()\n  endif()\nendif()\n\n# Check if we need to add -lstdc++fs or -lc++fs or nothing\nif(DEFINED CMAKE_CXX_STANDARD AND CMAKE_CXX_STANDARD LESS 17)\n  set(STD_FS_NO_LIB_NEEDED TRUE)\nelseif(MSVC)\n  set(STD_FS_NO_LIB_NEEDED TRUE)\nelse()\n  file(\n    WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.cpp\n    \"#include <filesystem>\\nint main(int argc, char ** argv) {\\n  std::filesystem::path p(argv[0]);\\n  return p.string().length();\\n}\"\n  )\n  try_compile(\n    STD_FS_NO_LIB_NEEDED ${CMAKE_CURRENT_BINARY_DIR}\n    SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp\n    COMPILE_DEFINITIONS -std=c++17)\n  try_compile(\n    STD_FS_NEEDS_STDCXXFS ${CMAKE_CURRENT_BINARY_DIR}\n    SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp\n    COMPILE_DEFINITIONS -std=c++17\n    LINK_LIBRARIES stdc++fs)\n  try_compile(\n    STD_FS_NEEDS_CXXFS ${CMAKE_CURRENT_BINARY_DIR}\n    SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp\n    COMPILE_DEFINITIONS -std=c++17\n    LINK_LIBRARIES c++fs)\nendif()\n\nif(${STD_FS_NEEDS_STDCXXFS})\n  set(STD_FS_LIB stdc++fs)\nelseif(${STD_FS_NEEDS_CXXFS})\n  set(STD_FS_LIB c++fs)\nelseif(${STD_FS_NO_LIB_NEEDED})\n  set(STD_FS_LIB \"\")\nelse()\n  message(WARNING \"Unknown C++17 compiler - not passing -lstdc++fs\")\n  set(STD_FS_LIB \"\")\nendif()\n\n# Compile with compiler warnings turned on\nfunction(pybind11_enable_warnings target_name)\n  if(MSVC)\n    target_compile_options(${target_name} PRIVATE /W4 /wd4189)\n  elseif(CMAKE_CXX_COMPILER_ID MATCHES \"(GNU|Intel|Clang)\" AND NOT PYBIND11_CUDA_TESTS)\n    target_compile_options(\n      ${target_name}\n      PRIVATE -Wall\n              -Wextra\n              -Wconversion\n              -Wcast-qual\n              -Wdeprecated\n              -Wundef\n              -Wnon-virtual-dtor)\n  endif()\n\n  if(PYBIND11_WERROR)\n    if(MSVC)\n      target_compile_options(${target_name} PRIVATE /WX)\n    elseif(PYBIND11_CUDA_TESTS)\n      target_compile_options(${target_name} PRIVATE \"SHELL:-Werror all-warnings\")\n    elseif(CMAKE_CXX_COMPILER_ID MATCHES \"(GNU|Clang|IntelLLVM)\")\n      target_compile_options(${target_name} PRIVATE -Werror)\n    elseif(CMAKE_CXX_COMPILER_ID STREQUAL \"Intel\")\n      if(CMAKE_CXX_STANDARD EQUAL 17) # See PR #3570\n        target_compile_options(${target_name} PRIVATE -Wno-conversion)\n      endif()\n      target_compile_options(\n        ${target_name}\n        PRIVATE\n          -Werror-all\n          # \"Inlining inhibited by limit max-size\", \"Inlining inhibited by limit max-total-size\"\n          -diag-disable 11074,11076)\n    endif()\n  endif()\nendfunction()\n\nset(test_targets pybind11_tests)\n\n# Check if any tests need extra targets by iterating through the mappings registered.\nforeach(i ${PYBIND11_TEST_EXTRA_TARGETS})\n  foreach(needle ${PYBIND11_TEST_EXTRA_TARGETS_NEEDLES_${i}})\n    if(needle IN_LIST PYBIND11_PYTEST_FILES)\n      # Add all the additional targets to the test list. List join in newer cmake.\n      foreach(extra_target ${PYBIND11_TEST_EXTRA_TARGETS_ADDITION_${i}})\n        list(APPEND test_targets ${extra_target})\n      endforeach()\n      break() # Breaks out of the needle search, continues with the next mapping.\n    endif()\n  endforeach()\nendforeach()\n\n# Support CUDA testing by forcing the target file to compile with NVCC\nif(PYBIND11_CUDA_TESTS)\n  set_property(SOURCE ${PYBIND11_TEST_FILES} PROPERTY LANGUAGE CUDA)\nendif()\n\nforeach(target ${test_targets})\n  set(test_files ${PYBIND11_TEST_FILES})\n  if(NOT \"${target}\" STREQUAL \"pybind11_tests\")\n    set(test_files \"\")\n  endif()\n\n  # Support CUDA testing by forcing the target file to compile with NVCC\n  if(PYBIND11_CUDA_TESTS)\n    set_property(SOURCE ${target}.cpp PROPERTY LANGUAGE CUDA)\n  endif()\n\n  # Create the binding library\n  pybind11_add_module(${target} THIN_LTO ${target}.cpp ${test_files} ${PYBIND11_HEADERS})\n  pybind11_enable_warnings(${target})\n\n  if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)\n    get_property(\n      suffix\n      TARGET ${target}\n      PROPERTY SUFFIX)\n    set(source_output \"${CMAKE_CURRENT_SOURCE_DIR}/${target}${suffix}\")\n    if(suffix AND EXISTS \"${source_output}\")\n      message(WARNING \"Output file also in source directory; \"\n                      \"please remove to avoid confusion: ${source_output}\")\n    endif()\n  endif()\n\n  if(MSVC)\n    target_compile_options(${target} PRIVATE /utf-8)\n  endif()\n\n  if(EIGEN3_FOUND)\n    target_link_libraries(${target} PRIVATE Eigen3::Eigen)\n    target_compile_definitions(${target} PRIVATE -DPYBIND11_TEST_EIGEN)\n  endif()\n\n  if(Boost_FOUND)\n    target_link_libraries(${target} PRIVATE Boost::headers)\n    target_compile_definitions(${target} PRIVATE -DPYBIND11_TEST_BOOST)\n  endif()\n\n  target_link_libraries(${target} PRIVATE ${STD_FS_LIB})\n\n  # Always write the output file directly into the 'tests' directory (even on MSVC)\n  if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)\n    set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY\n                                               \"${CMAKE_CURRENT_BINARY_DIR}\")\n\n    if(DEFINED CMAKE_CONFIGURATION_TYPES)\n      foreach(config ${CMAKE_CONFIGURATION_TYPES})\n        string(TOUPPER ${config} config)\n        set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${config}\n                                                   \"${CMAKE_CURRENT_BINARY_DIR}\")\n      endforeach()\n    endif()\n  endif()\nendforeach()\n\n# Provide nice organisation in IDEs\nif(NOT CMAKE_VERSION VERSION_LESS 3.8)\n  source_group(\n    TREE \"${CMAKE_CURRENT_SOURCE_DIR}/../include\"\n    PREFIX \"Header Files\"\n    FILES ${PYBIND11_HEADERS})\nendif()\n\n# Make sure pytest is found or produce a warning\npybind11_find_import(pytest VERSION 3.1)\n\nif(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)\n  # This is not used later in the build, so it's okay to regenerate each time.\n  configure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/pytest.ini\" \"${CMAKE_CURRENT_BINARY_DIR}/pytest.ini\"\n                 COPYONLY)\n  file(APPEND \"${CMAKE_CURRENT_BINARY_DIR}/pytest.ini\"\n       \"\\ntestpaths = \\\"${CMAKE_CURRENT_SOURCE_DIR}\\\"\")\n\nendif()\n\n# cmake 3.12 added list(transform <list> prepend\n# but we can't use it yet\nstring(REPLACE \"test_\" \"${CMAKE_CURRENT_SOURCE_DIR}/test_\" PYBIND11_ABS_PYTEST_FILES\n               \"${PYBIND11_PYTEST_FILES}\")\n\nset(PYBIND11_TEST_PREFIX_COMMAND\n    \"\"\n    CACHE STRING \"Put this before pytest, use for checkers and such\")\n\n# A single command to compile and run the tests\nadd_custom_target(\n  pytest\n  COMMAND ${PYBIND11_TEST_PREFIX_COMMAND} ${PYTHON_EXECUTABLE} -m pytest\n          ${PYBIND11_ABS_PYTEST_FILES}\n  DEPENDS ${test_targets}\n  WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\"\n  USES_TERMINAL)\n\nif(PYBIND11_TEST_OVERRIDE)\n  add_custom_command(\n    TARGET pytest\n    POST_BUILD\n    COMMAND ${CMAKE_COMMAND} -E echo\n            \"Note: not all tests run: -DPYBIND11_TEST_OVERRIDE is in effect\")\nendif()\n\n# cmake-format: off\nadd_custom_target(\n  memcheck\n  COMMAND\n    PYTHONMALLOC=malloc\n    valgrind\n    --leak-check=full\n    --show-leak-kinds=definite,indirect\n    --errors-for-leak-kinds=definite,indirect\n    --error-exitcode=1\n    --read-var-info=yes\n    --track-origins=yes\n    --suppressions=\"${CMAKE_CURRENT_SOURCE_DIR}/valgrind-python.supp\"\n    --suppressions=\"${CMAKE_CURRENT_SOURCE_DIR}/valgrind-numpy-scipy.supp\"\n    --gen-suppressions=all\n    ${PYTHON_EXECUTABLE} -m pytest ${PYBIND11_ABS_PYTEST_FILES}\n  DEPENDS ${test_targets}\n  WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\"\n  USES_TERMINAL)\n# cmake-format: on\n\n# Add a check target to run all the tests, starting with pytest (we add dependencies to this below)\nadd_custom_target(check DEPENDS pytest)\n\n# The remaining tests only apply when being built as part of the pybind11 project, but not if the\n# tests are being built independently.\nif(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)\n  return()\nendif()\n\n# Add a post-build comment to show the primary test suite .so size and, if a previous size, compare it:\nadd_custom_command(\n  TARGET pybind11_tests\n  POST_BUILD\n  COMMAND\n    ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../tools/libsize.py\n    $<TARGET_FILE:pybind11_tests>\n    ${CMAKE_CURRENT_BINARY_DIR}/sosize-$<TARGET_FILE_NAME:pybind11_tests>.txt)\n\nif(NOT PYBIND11_CUDA_TESTS)\n  # Test embedding the interpreter. Provides the `cpptest` target.\n  add_subdirectory(test_embed)\n\n  # Test CMake build using functions and targets from subdirectory or installed location\n  add_subdirectory(test_cmake_build)\nendif()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/conftest.py",
    "content": "\"\"\"pytest configuration\n\nExtends output capture as needed by pybind11: ignore constructors, optional unordered lines.\nAdds docstring and exceptions message sanitizers.\n\"\"\"\n\nimport contextlib\nimport difflib\nimport gc\nimport multiprocessing\nimport os\nimport re\nimport textwrap\nimport traceback\n\nimport pytest\n\n# Early diagnostic for failed imports\ntry:\n    import pybind11_tests\nexcept Exception:\n    # pytest does not show the traceback without this.\n    traceback.print_exc()\n    raise\n\n\n@pytest.fixture(scope=\"session\", autouse=True)\ndef always_forkserver_on_unix():\n    if os.name == \"nt\":\n        return\n\n    # Full background: https://github.com/pybind/pybind11/issues/4105#issuecomment-1301004592\n    # In a nutshell: fork() after starting threads == flakiness in the form of deadlocks.\n    # It is actually a well-known pitfall, unfortunately without guard rails.\n    # \"forkserver\" is more performant than \"spawn\" (~9s vs ~13s for tests/test_gil_scoped.py,\n    # visit the issuecomment link above for details).\n    # Windows does not have fork() and the associated pitfall, therefore it is best left\n    # running with defaults.\n    multiprocessing.set_start_method(\"forkserver\")\n\n\n_long_marker = re.compile(r\"([0-9])L\")\n_hexadecimal = re.compile(r\"0x[0-9a-fA-F]+\")\n\n# Avoid collecting Python3 only files\ncollect_ignore = []\n\n\ndef _strip_and_dedent(s):\n    \"\"\"For triple-quote strings\"\"\"\n    return textwrap.dedent(s.lstrip(\"\\n\").rstrip())\n\n\ndef _split_and_sort(s):\n    \"\"\"For output which does not require specific line order\"\"\"\n    return sorted(_strip_and_dedent(s).splitlines())\n\n\ndef _make_explanation(a, b):\n    \"\"\"Explanation for a failed assert -- the a and b arguments are List[str]\"\"\"\n    return [\"--- actual / +++ expected\"] + [\n        line.strip(\"\\n\") for line in difflib.ndiff(a, b)\n    ]\n\n\nclass Output:\n    \"\"\"Basic output post-processing and comparison\"\"\"\n\n    def __init__(self, string):\n        self.string = string\n        self.explanation = []\n\n    def __str__(self):\n        return self.string\n\n    def __eq__(self, other):\n        # Ignore constructor/destructor output which is prefixed with \"###\"\n        a = [\n            line\n            for line in self.string.strip().splitlines()\n            if not line.startswith(\"###\")\n        ]\n        b = _strip_and_dedent(other).splitlines()\n        if a == b:\n            return True\n        else:\n            self.explanation = _make_explanation(a, b)\n            return False\n\n\nclass Unordered(Output):\n    \"\"\"Custom comparison for output without strict line ordering\"\"\"\n\n    def __eq__(self, other):\n        a = _split_and_sort(self.string)\n        b = _split_and_sort(other)\n        if a == b:\n            return True\n        else:\n            self.explanation = _make_explanation(a, b)\n            return False\n\n\nclass Capture:\n    def __init__(self, capfd):\n        self.capfd = capfd\n        self.out = \"\"\n        self.err = \"\"\n\n    def __enter__(self):\n        self.capfd.readouterr()\n        return self\n\n    def __exit__(self, *args):\n        self.out, self.err = self.capfd.readouterr()\n\n    def __eq__(self, other):\n        a = Output(self.out)\n        b = other\n        if a == b:\n            return True\n        else:\n            self.explanation = a.explanation\n            return False\n\n    def __str__(self):\n        return self.out\n\n    def __contains__(self, item):\n        return item in self.out\n\n    @property\n    def unordered(self):\n        return Unordered(self.out)\n\n    @property\n    def stderr(self):\n        return Output(self.err)\n\n\n@pytest.fixture\ndef capture(capsys):\n    \"\"\"Extended `capsys` with context manager and custom equality operators\"\"\"\n    return Capture(capsys)\n\n\nclass SanitizedString:\n    def __init__(self, sanitizer):\n        self.sanitizer = sanitizer\n        self.string = \"\"\n        self.explanation = []\n\n    def __call__(self, thing):\n        self.string = self.sanitizer(thing)\n        return self\n\n    def __eq__(self, other):\n        a = self.string\n        b = _strip_and_dedent(other)\n        if a == b:\n            return True\n        else:\n            self.explanation = _make_explanation(a.splitlines(), b.splitlines())\n            return False\n\n\ndef _sanitize_general(s):\n    s = s.strip()\n    s = s.replace(\"pybind11_tests.\", \"m.\")\n    s = _long_marker.sub(r\"\\1\", s)\n    return s\n\n\ndef _sanitize_docstring(thing):\n    s = thing.__doc__\n    s = _sanitize_general(s)\n    return s\n\n\n@pytest.fixture\ndef doc():\n    \"\"\"Sanitize docstrings and add custom failure explanation\"\"\"\n    return SanitizedString(_sanitize_docstring)\n\n\ndef _sanitize_message(thing):\n    s = str(thing)\n    s = _sanitize_general(s)\n    s = _hexadecimal.sub(\"0\", s)\n    return s\n\n\n@pytest.fixture\ndef msg():\n    \"\"\"Sanitize messages and add custom failure explanation\"\"\"\n    return SanitizedString(_sanitize_message)\n\n\n# noinspection PyUnusedLocal\ndef pytest_assertrepr_compare(op, left, right):\n    \"\"\"Hook to insert custom failure explanation\"\"\"\n    if hasattr(left, \"explanation\"):\n        return left.explanation\n\n\n@contextlib.contextmanager\ndef suppress(exception):\n    \"\"\"Suppress the desired exception\"\"\"\n    try:\n        yield\n    except exception:\n        pass\n\n\ndef gc_collect():\n    \"\"\"Run the garbage collector twice (needed when running\n    reference counting tests with PyPy)\"\"\"\n    gc.collect()\n    gc.collect()\n\n\ndef pytest_configure():\n    pytest.suppress = suppress\n    pytest.gc_collect = gc_collect\n\n\ndef pytest_report_header(config):\n    del config  # Unused.\n    assert (\n        pybind11_tests.compiler_info is not None\n    ), \"Please update pybind11_tests.cpp if this assert fails.\"\n    return (\n        \"C++ Info:\"\n        f\" {pybind11_tests.compiler_info}\"\n        f\" {pybind11_tests.cpp_std}\"\n        f\" {pybind11_tests.PYBIND11_INTERNALS_ID}\"\n        f\" PYBIND11_SIMPLE_GIL_MANAGEMENT={pybind11_tests.PYBIND11_SIMPLE_GIL_MANAGEMENT}\"\n    )\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/constructor_stats.h",
    "content": "#pragma once\n/*\n    tests/constructor_stats.h -- framework for printing and tracking object\n    instance lifetimes in example/test code.\n\n    Copyright (c) 2016 Jason Rhinelander <jason@imaginary.ca>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n\nThis header provides a few useful tools for writing examples or tests that want to check and/or\ndisplay object instance lifetimes.  It requires that you include this header and add the following\nfunction calls to constructors:\n\n    class MyClass {\n        MyClass() { ...; print_default_created(this); }\n        ~MyClass() { ...; print_destroyed(this); }\n        MyClass(const MyClass &c) { ...; print_copy_created(this); }\n        MyClass(MyClass &&c) { ...; print_move_created(this); }\n        MyClass(int a, int b) { ...; print_created(this, a, b); }\n        MyClass &operator=(const MyClass &c) { ...; print_copy_assigned(this); }\n        MyClass &operator=(MyClass &&c) { ...; print_move_assigned(this); }\n\n        ...\n    }\n\nYou can find various examples of these in several of the existing testing .cpp files.  (Of course\nyou don't need to add any of the above constructors/operators that you don't actually have, except\nfor the destructor).\n\nEach of these will print an appropriate message such as:\n\n    ### MyClass @ 0x2801910 created via default constructor\n    ### MyClass @ 0x27fa780 created 100 200\n    ### MyClass @ 0x2801910 destroyed\n    ### MyClass @ 0x27fa780 destroyed\n\nYou can also include extra arguments (such as the 100, 200 in the output above, coming from the\nvalue constructor) for all of the above methods which will be included in the output.\n\nFor testing, each of these also keeps track the created instances and allows you to check how many\nof the various constructors have been invoked from the Python side via code such as:\n\n    from pybind11_tests import ConstructorStats\n    cstats = ConstructorStats.get(MyClass)\n    print(cstats.alive())\n    print(cstats.default_constructions)\n\nNote that `.alive()` should usually be the first thing you call as it invokes Python's garbage\ncollector to actually destroy objects that aren't yet referenced.\n\nFor everything except copy and move constructors and destructors, any extra values given to the\nprint_...() function is stored in a class-specific values list which you can retrieve and inspect\nfrom the ConstructorStats instance `.values()` method.\n\nIn some cases, when you need to track instances of a C++ class not registered with pybind11, you\nneed to add a function returning the ConstructorStats for the C++ class; this can be done with:\n\n    m.def(\"get_special_cstats\", &ConstructorStats::get<SpecialClass>,\npy::return_value_policy::reference)\n\nFinally, you can suppress the output messages, but keep the constructor tracking (for\ninspection/testing in python) by using the functions with `print_` replaced with `track_` (e.g.\n`track_copy_created(this)`).\n\n*/\n\n#include \"pybind11_tests.h\"\n\n#include <list>\n#include <sstream>\n#include <typeindex>\n#include <unordered_map>\n\nclass ConstructorStats {\nprotected:\n    std::unordered_map<void *, int> _instances; // Need a map rather than set because members can\n                                                // shared address with parents\n    std::list<std::string> _values;             // Used to track values\n                                                // (e.g. of value constructors)\npublic:\n    int default_constructions = 0;\n    int copy_constructions = 0;\n    int move_constructions = 0;\n    int copy_assignments = 0;\n    int move_assignments = 0;\n\n    void copy_created(void *inst) {\n        created(inst);\n        copy_constructions++;\n    }\n\n    void move_created(void *inst) {\n        created(inst);\n        move_constructions++;\n    }\n\n    void default_created(void *inst) {\n        created(inst);\n        default_constructions++;\n    }\n\n    void created(void *inst) { ++_instances[inst]; }\n\n    void destroyed(void *inst) {\n        if (--_instances[inst] < 0) {\n            throw std::runtime_error(\"cstats.destroyed() called with unknown \"\n                                     \"instance; potential double-destruction \"\n                                     \"or a missing cstats.created()\");\n        }\n    }\n\n    static void gc() {\n        // Force garbage collection to ensure any pending destructors are invoked:\n#if defined(PYPY_VERSION)\n        PyObject *globals = PyEval_GetGlobals();\n        PyObject *result = PyRun_String(\"import gc\\n\"\n                                        \"for i in range(2):\\n\"\n                                        \"    gc.collect()\\n\",\n                                        Py_file_input,\n                                        globals,\n                                        globals);\n        if (result == nullptr)\n            throw py::error_already_set();\n        Py_DECREF(result);\n#else\n        py::module_::import(\"gc\").attr(\"collect\")();\n#endif\n    }\n\n    int alive() {\n        gc();\n        int total = 0;\n        for (const auto &p : _instances) {\n            if (p.second > 0) {\n                total += p.second;\n            }\n        }\n        return total;\n    }\n\n    void value() {} // Recursion terminator\n    // Takes one or more values, converts them to strings, then stores them.\n    template <typename T, typename... Tmore>\n    void value(const T &v, Tmore &&...args) {\n        std::ostringstream oss;\n        oss << v;\n        _values.push_back(oss.str());\n        value(std::forward<Tmore>(args)...);\n    }\n\n    // Move out stored values\n    py::list values() {\n        py::list l;\n        for (const auto &v : _values) {\n            l.append(py::cast(v));\n        }\n        _values.clear();\n        return l;\n    }\n\n    // Gets constructor stats from a C++ type index\n    static ConstructorStats &get(std::type_index type) {\n        static std::unordered_map<std::type_index, ConstructorStats> all_cstats;\n        return all_cstats[type];\n    }\n\n    // Gets constructor stats from a C++ type\n    template <typename T>\n    static ConstructorStats &get() {\n#if defined(PYPY_VERSION)\n        gc();\n#endif\n        return get(typeid(T));\n    }\n\n    // Gets constructor stats from a Python class\n    static ConstructorStats &get(py::object class_) {\n        auto &internals = py::detail::get_internals();\n        const std::type_index *t1 = nullptr, *t2 = nullptr;\n        try {\n            auto *type_info\n                = internals.registered_types_py.at((PyTypeObject *) class_.ptr()).at(0);\n            for (auto &p : internals.registered_types_cpp) {\n                if (p.second == type_info) {\n                    if (t1) {\n                        t2 = &p.first;\n                        break;\n                    }\n                    t1 = &p.first;\n                }\n            }\n        } catch (const std::out_of_range &) {\n        }\n        if (!t1) {\n            throw std::runtime_error(\"Unknown class passed to ConstructorStats::get()\");\n        }\n        auto &cs1 = get(*t1);\n        // If we have both a t1 and t2 match, one is probably the trampoline class; return\n        // whichever has more constructions (typically one or the other will be 0)\n        if (t2) {\n            auto &cs2 = get(*t2);\n            int cs1_total = cs1.default_constructions + cs1.copy_constructions\n                            + cs1.move_constructions + (int) cs1._values.size();\n            int cs2_total = cs2.default_constructions + cs2.copy_constructions\n                            + cs2.move_constructions + (int) cs2._values.size();\n            if (cs2_total > cs1_total) {\n                return cs2;\n            }\n        }\n        return cs1;\n    }\n};\n\n// To track construction/destruction, you need to call these methods from the various\n// constructors/operators.  The ones that take extra values record the given values in the\n// constructor stats values for later inspection.\ntemplate <class T>\nvoid track_copy_created(T *inst) {\n    ConstructorStats::get<T>().copy_created(inst);\n}\ntemplate <class T>\nvoid track_move_created(T *inst) {\n    ConstructorStats::get<T>().move_created(inst);\n}\ntemplate <class T, typename... Values>\nvoid track_copy_assigned(T *, Values &&...values) {\n    auto &cst = ConstructorStats::get<T>();\n    cst.copy_assignments++;\n    cst.value(std::forward<Values>(values)...);\n}\ntemplate <class T, typename... Values>\nvoid track_move_assigned(T *, Values &&...values) {\n    auto &cst = ConstructorStats::get<T>();\n    cst.move_assignments++;\n    cst.value(std::forward<Values>(values)...);\n}\ntemplate <class T, typename... Values>\nvoid track_default_created(T *inst, Values &&...values) {\n    auto &cst = ConstructorStats::get<T>();\n    cst.default_created(inst);\n    cst.value(std::forward<Values>(values)...);\n}\ntemplate <class T, typename... Values>\nvoid track_created(T *inst, Values &&...values) {\n    auto &cst = ConstructorStats::get<T>();\n    cst.created(inst);\n    cst.value(std::forward<Values>(values)...);\n}\ntemplate <class T, typename... Values>\nvoid track_destroyed(T *inst) {\n    ConstructorStats::get<T>().destroyed(inst);\n}\ntemplate <class T, typename... Values>\nvoid track_values(T *, Values &&...values) {\n    ConstructorStats::get<T>().value(std::forward<Values>(values)...);\n}\n\n/// Don't cast pointers to Python, print them as strings\ninline const char *format_ptrs(const char *p) { return p; }\ntemplate <typename T>\npy::str format_ptrs(T *p) {\n    return \"{:#x}\"_s.format(reinterpret_cast<std::uintptr_t>(p));\n}\ntemplate <typename T>\nauto format_ptrs(T &&x) -> decltype(std::forward<T>(x)) {\n    return std::forward<T>(x);\n}\n\ntemplate <class T, typename... Output>\nvoid print_constr_details(T *inst, const std::string &action, Output &&...output) {\n    py::print(\"###\",\n              py::type_id<T>(),\n              \"@\",\n              format_ptrs(inst),\n              action,\n              format_ptrs(std::forward<Output>(output))...);\n}\n\n// Verbose versions of the above:\ntemplate <class T, typename... Values>\nvoid print_copy_created(T *inst,\n                        Values &&...values) { // NB: this prints, but doesn't store, given values\n    print_constr_details(inst, \"created via copy constructor\", values...);\n    track_copy_created(inst);\n}\ntemplate <class T, typename... Values>\nvoid print_move_created(T *inst,\n                        Values &&...values) { // NB: this prints, but doesn't store, given values\n    print_constr_details(inst, \"created via move constructor\", values...);\n    track_move_created(inst);\n}\ntemplate <class T, typename... Values>\nvoid print_copy_assigned(T *inst, Values &&...values) {\n    print_constr_details(inst, \"assigned via copy assignment\", values...);\n    track_copy_assigned(inst, values...);\n}\ntemplate <class T, typename... Values>\nvoid print_move_assigned(T *inst, Values &&...values) {\n    print_constr_details(inst, \"assigned via move assignment\", values...);\n    track_move_assigned(inst, values...);\n}\ntemplate <class T, typename... Values>\nvoid print_default_created(T *inst, Values &&...values) {\n    print_constr_details(inst, \"created via default constructor\", values...);\n    track_default_created(inst, values...);\n}\ntemplate <class T, typename... Values>\nvoid print_created(T *inst, Values &&...values) {\n    print_constr_details(inst, \"created\", values...);\n    track_created(inst, values...);\n}\ntemplate <class T, typename... Values>\nvoid print_destroyed(T *inst, Values &&...values) { // Prints but doesn't store given values\n    print_constr_details(inst, \"destroyed\", values...);\n    track_destroyed(inst);\n}\ntemplate <class T, typename... Values>\nvoid print_values(T *inst, Values &&...values) {\n    print_constr_details(inst, \":\", values...);\n    track_values(inst, values...);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/cross_module_gil_utils.cpp",
    "content": "/*\n    tests/cross_module_gil_utils.cpp -- tools for acquiring GIL from a different module\n\n    Copyright (c) 2019 Google LLC\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n#if defined(PYBIND11_INTERNALS_VERSION)\n#    undef PYBIND11_INTERNALS_VERSION\n#endif\n#define PYBIND11_INTERNALS_VERSION 21814642 // Ensure this module has its own `internals` instance.\n#include <pybind11/pybind11.h>\n\n#include <cstdint>\n#include <string>\n#include <thread>\n\n// This file mimics a DSO that makes pybind11 calls but does not define a\n// PYBIND11_MODULE. The purpose is to test that such a DSO can create a\n// py::gil_scoped_acquire when the running thread is in a GIL-released state.\n//\n// Note that we define a Python module here for convenience, but in general\n// this need not be the case. The typical scenario would be a DSO that implements\n// shared logic used internally by multiple pybind11 modules.\n\nnamespace {\n\nnamespace py = pybind11;\n\nvoid gil_acquire() { py::gil_scoped_acquire gil; }\n\nstd::string gil_multi_acquire_release(unsigned bits) {\n    if ((bits & 0x1u) != 0u) {\n        py::gil_scoped_acquire gil;\n    }\n    if ((bits & 0x2u) != 0u) {\n        py::gil_scoped_release gil;\n    }\n    if ((bits & 0x4u) != 0u) {\n        py::gil_scoped_acquire gil;\n    }\n    if ((bits & 0x8u) != 0u) {\n        py::gil_scoped_release gil;\n    }\n    return PYBIND11_INTERNALS_ID;\n}\n\nstruct CustomAutoGIL {\n    CustomAutoGIL() : gstate(PyGILState_Ensure()) {}\n    ~CustomAutoGIL() { PyGILState_Release(gstate); }\n\n    PyGILState_STATE gstate;\n};\nstruct CustomAutoNoGIL {\n    CustomAutoNoGIL() : save(PyEval_SaveThread()) {}\n    ~CustomAutoNoGIL() { PyEval_RestoreThread(save); }\n\n    PyThreadState *save;\n};\n\ntemplate <typename Acquire, typename Release>\nvoid gil_acquire_inner() {\n    Acquire acquire_outer;\n    Acquire acquire_inner;\n    Release release;\n}\n\ntemplate <typename Acquire, typename Release>\nvoid gil_acquire_nested() {\n    Acquire acquire_outer;\n    Acquire acquire_inner;\n    Release release;\n    auto thread = std::thread(&gil_acquire_inner<Acquire, Release>);\n    thread.join();\n}\n\nconstexpr char kModuleName[] = \"cross_module_gil_utils\";\n\nstruct PyModuleDef moduledef = {\n    PyModuleDef_HEAD_INIT, kModuleName, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr};\n\n} // namespace\n\n#define ADD_FUNCTION(Name, ...)                                                                   \\\n    PyModule_AddObject(m, Name, PyLong_FromVoidPtr(reinterpret_cast<void *>(&__VA_ARGS__)));\n\nextern \"C\" PYBIND11_EXPORT PyObject *PyInit_cross_module_gil_utils() {\n\n    PyObject *m = PyModule_Create(&moduledef);\n\n    if (m != nullptr) {\n        static_assert(sizeof(&gil_acquire) == sizeof(void *),\n                      \"Function pointer must have the same size as void*\");\n        ADD_FUNCTION(\"gil_acquire_funcaddr\", gil_acquire)\n        ADD_FUNCTION(\"gil_multi_acquire_release_funcaddr\", gil_multi_acquire_release)\n        ADD_FUNCTION(\"gil_acquire_inner_custom_funcaddr\",\n                     gil_acquire_inner<CustomAutoGIL, CustomAutoNoGIL>)\n        ADD_FUNCTION(\"gil_acquire_nested_custom_funcaddr\",\n                     gil_acquire_nested<CustomAutoGIL, CustomAutoNoGIL>)\n        ADD_FUNCTION(\"gil_acquire_inner_pybind11_funcaddr\",\n                     gil_acquire_inner<py::gil_scoped_acquire, py::gil_scoped_release>)\n        ADD_FUNCTION(\"gil_acquire_nested_pybind11_funcaddr\",\n                     gil_acquire_nested<py::gil_scoped_acquire, py::gil_scoped_release>)\n    }\n\n    return m;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/cross_module_interleaved_error_already_set.cpp",
    "content": "/*\n    Copyright (c) 2022 Google LLC\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/pybind11.h>\n\n// This file mimics a DSO that makes pybind11 calls but does not define a PYBIND11_MODULE,\n// so that the first call of cross_module_error_already_set() triggers the first call of\n// pybind11::detail::get_internals().\n\nnamespace {\n\nnamespace py = pybind11;\n\nvoid interleaved_error_already_set() {\n    PyErr_SetString(PyExc_RuntimeError, \"1st error.\");\n    try {\n        throw py::error_already_set();\n    } catch (const py::error_already_set &) {\n        // The 2nd error could be conditional in a real application.\n        PyErr_SetString(PyExc_RuntimeError, \"2nd error.\");\n    } // Here the 1st error is destroyed before the 2nd error is fetched.\n    // The error_already_set dtor triggers a pybind11::detail::get_internals()\n    // call via pybind11::gil_scoped_acquire.\n    if (PyErr_Occurred()) {\n        throw py::error_already_set();\n    }\n}\n\nconstexpr char kModuleName[] = \"cross_module_interleaved_error_already_set\";\n\nstruct PyModuleDef moduledef = {\n    PyModuleDef_HEAD_INIT, kModuleName, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr};\n\n} // namespace\n\nextern \"C\" PYBIND11_EXPORT PyObject *PyInit_cross_module_interleaved_error_already_set() {\n    PyObject *m = PyModule_Create(&moduledef);\n    if (m != nullptr) {\n        static_assert(sizeof(&interleaved_error_already_set) == sizeof(void *),\n                      \"Function pointer must have the same size as void *\");\n        PyModule_AddObject(\n            m,\n            \"funcaddr\",\n            PyLong_FromVoidPtr(reinterpret_cast<void *>(&interleaved_error_already_set)));\n    }\n    return m;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/eigen_tensor_avoid_stl_array.cpp",
    "content": "/*\n    tests/eigen_tensor.cpp -- automatic conversion of Eigen Tensor\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#ifndef EIGEN_AVOID_STL_ARRAY\n#    define EIGEN_AVOID_STL_ARRAY\n#endif\n\n#include \"test_eigen_tensor.inl\"\n\nPYBIND11_MODULE(eigen_tensor_avoid_stl_array, m) { eigen_tensor_test::test_module(m); }\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/env.py",
    "content": "import platform\nimport sys\n\nimport pytest\n\nLINUX = sys.platform.startswith(\"linux\")\nMACOS = sys.platform.startswith(\"darwin\")\nWIN = sys.platform.startswith(\"win32\") or sys.platform.startswith(\"cygwin\")\n\nCPYTHON = platform.python_implementation() == \"CPython\"\nPYPY = platform.python_implementation() == \"PyPy\"\n\n\ndef deprecated_call():\n    \"\"\"\n    pytest.deprecated_call() seems broken in pytest<3.9.x; concretely, it\n    doesn't work on CPython 3.8.0 with pytest==3.3.2 on Ubuntu 18.04 (#2922).\n\n    This is a narrowed reimplementation of the following PR :(\n    https://github.com/pytest-dev/pytest/pull/4104\n    \"\"\"\n    # TODO: Remove this when testing requires pytest>=3.9.\n    pieces = pytest.__version__.split(\".\")\n    pytest_major_minor = (int(pieces[0]), int(pieces[1]))\n    if pytest_major_minor < (3, 9):\n        return pytest.warns((DeprecationWarning, PendingDeprecationWarning))\n    else:\n        return pytest.deprecated_call()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/extra_python_package/pytest.ini",
    "content": ""
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/extra_python_package/test_files.py",
    "content": "import contextlib\nimport os\nimport string\nimport subprocess\nimport sys\nimport tarfile\nimport zipfile\n\n# These tests must be run explicitly\n# They require CMake 3.15+ (--install)\n\nDIR = os.path.abspath(os.path.dirname(__file__))\nMAIN_DIR = os.path.dirname(os.path.dirname(DIR))\n\nPKGCONFIG = \"\"\"\\\nprefix=${{pcfiledir}}/../../\nincludedir=${{prefix}}/include\n\nName: pybind11\nDescription: Seamless operability between C++11 and Python\nVersion: {VERSION}\nCflags: -I${{includedir}}\n\"\"\"\n\n\nmain_headers = {\n    \"include/pybind11/attr.h\",\n    \"include/pybind11/buffer_info.h\",\n    \"include/pybind11/cast.h\",\n    \"include/pybind11/chrono.h\",\n    \"include/pybind11/common.h\",\n    \"include/pybind11/complex.h\",\n    \"include/pybind11/eigen.h\",\n    \"include/pybind11/embed.h\",\n    \"include/pybind11/eval.h\",\n    \"include/pybind11/functional.h\",\n    \"include/pybind11/gil.h\",\n    \"include/pybind11/iostream.h\",\n    \"include/pybind11/numpy.h\",\n    \"include/pybind11/operators.h\",\n    \"include/pybind11/options.h\",\n    \"include/pybind11/pybind11.h\",\n    \"include/pybind11/pytypes.h\",\n    \"include/pybind11/stl.h\",\n    \"include/pybind11/stl_bind.h\",\n}\n\ndetail_headers = {\n    \"include/pybind11/detail/class.h\",\n    \"include/pybind11/detail/common.h\",\n    \"include/pybind11/detail/descr.h\",\n    \"include/pybind11/detail/init.h\",\n    \"include/pybind11/detail/internals.h\",\n    \"include/pybind11/detail/type_caster_base.h\",\n    \"include/pybind11/detail/typeid.h\",\n}\n\neigen_headers = {\n    \"include/pybind11/eigen/matrix.h\",\n    \"include/pybind11/eigen/tensor.h\",\n}\n\nstl_headers = {\n    \"include/pybind11/stl/filesystem.h\",\n}\n\ncmake_files = {\n    \"share/cmake/pybind11/FindPythonLibsNew.cmake\",\n    \"share/cmake/pybind11/pybind11Common.cmake\",\n    \"share/cmake/pybind11/pybind11Config.cmake\",\n    \"share/cmake/pybind11/pybind11ConfigVersion.cmake\",\n    \"share/cmake/pybind11/pybind11NewTools.cmake\",\n    \"share/cmake/pybind11/pybind11Targets.cmake\",\n    \"share/cmake/pybind11/pybind11Tools.cmake\",\n}\n\npkgconfig_files = {\n    \"share/pkgconfig/pybind11.pc\",\n}\n\npy_files = {\n    \"__init__.py\",\n    \"__main__.py\",\n    \"_version.py\",\n    \"commands.py\",\n    \"py.typed\",\n    \"setup_helpers.py\",\n}\n\nheaders = main_headers | detail_headers | eigen_headers | stl_headers\nsrc_files = headers | cmake_files | pkgconfig_files\nall_files = src_files | py_files\n\n\nsdist_files = {\n    \"pybind11\",\n    \"pybind11/include\",\n    \"pybind11/include/pybind11\",\n    \"pybind11/include/pybind11/detail\",\n    \"pybind11/include/pybind11/eigen\",\n    \"pybind11/include/pybind11/stl\",\n    \"pybind11/share\",\n    \"pybind11/share/cmake\",\n    \"pybind11/share/cmake/pybind11\",\n    \"pybind11/share/pkgconfig\",\n    \"pyproject.toml\",\n    \"setup.cfg\",\n    \"setup.py\",\n    \"LICENSE\",\n    \"MANIFEST.in\",\n    \"README.rst\",\n    \"PKG-INFO\",\n}\n\nlocal_sdist_files = {\n    \".egg-info\",\n    \".egg-info/PKG-INFO\",\n    \".egg-info/SOURCES.txt\",\n    \".egg-info/dependency_links.txt\",\n    \".egg-info/not-zip-safe\",\n    \".egg-info/top_level.txt\",\n}\n\n\ndef read_tz_file(tar: tarfile.TarFile, name: str) -> bytes:\n    start = tar.getnames()[0] + \"/\"\n    inner_file = tar.extractfile(tar.getmember(f\"{start}{name}\"))\n    assert inner_file\n    with contextlib.closing(inner_file) as f:\n        return f.read()\n\n\ndef normalize_line_endings(value: bytes) -> bytes:\n    return value.replace(os.linesep.encode(\"utf-8\"), b\"\\n\")\n\n\ndef test_build_sdist(monkeypatch, tmpdir):\n    monkeypatch.chdir(MAIN_DIR)\n\n    subprocess.run(\n        [sys.executable, \"-m\", \"build\", \"--sdist\", f\"--outdir={tmpdir}\"], check=True\n    )\n\n    (sdist,) = tmpdir.visit(\"*.tar.gz\")\n\n    with tarfile.open(str(sdist), \"r:gz\") as tar:\n        start = tar.getnames()[0] + \"/\"\n        version = start[9:-1]\n        simpler = {n.split(\"/\", 1)[-1] for n in tar.getnames()[1:]}\n\n        setup_py = read_tz_file(tar, \"setup.py\")\n        pyproject_toml = read_tz_file(tar, \"pyproject.toml\")\n        pkgconfig = read_tz_file(tar, \"pybind11/share/pkgconfig/pybind11.pc\")\n        cmake_cfg = read_tz_file(\n            tar, \"pybind11/share/cmake/pybind11/pybind11Config.cmake\"\n        )\n\n    assert (\n        'set(pybind11_INCLUDE_DIR \"${PACKAGE_PREFIX_DIR}/include\")'\n        in cmake_cfg.decode(\"utf-8\")\n    )\n\n    files = {f\"pybind11/{n}\" for n in all_files}\n    files |= sdist_files\n    files |= {f\"pybind11{n}\" for n in local_sdist_files}\n    files.add(\"pybind11.egg-info/entry_points.txt\")\n    files.add(\"pybind11.egg-info/requires.txt\")\n    assert simpler == files\n\n    with open(os.path.join(MAIN_DIR, \"tools\", \"setup_main.py.in\"), \"rb\") as f:\n        contents = (\n            string.Template(f.read().decode(\"utf-8\"))\n            .substitute(version=version, extra_cmd=\"\")\n            .encode(\"utf-8\")\n        )\n    assert setup_py == contents\n\n    with open(os.path.join(MAIN_DIR, \"tools\", \"pyproject.toml\"), \"rb\") as f:\n        contents = f.read()\n    assert pyproject_toml == contents\n\n    simple_version = \".\".join(version.split(\".\")[:3])\n    pkgconfig_expected = PKGCONFIG.format(VERSION=simple_version).encode(\"utf-8\")\n    assert normalize_line_endings(pkgconfig) == pkgconfig_expected\n\n\ndef test_build_global_dist(monkeypatch, tmpdir):\n    monkeypatch.chdir(MAIN_DIR)\n    monkeypatch.setenv(\"PYBIND11_GLOBAL_SDIST\", \"1\")\n    subprocess.run(\n        [sys.executable, \"-m\", \"build\", \"--sdist\", \"--outdir\", str(tmpdir)], check=True\n    )\n\n    (sdist,) = tmpdir.visit(\"*.tar.gz\")\n\n    with tarfile.open(str(sdist), \"r:gz\") as tar:\n        start = tar.getnames()[0] + \"/\"\n        version = start[16:-1]\n        simpler = {n.split(\"/\", 1)[-1] for n in tar.getnames()[1:]}\n\n        setup_py = read_tz_file(tar, \"setup.py\")\n        pyproject_toml = read_tz_file(tar, \"pyproject.toml\")\n        pkgconfig = read_tz_file(tar, \"pybind11/share/pkgconfig/pybind11.pc\")\n        cmake_cfg = read_tz_file(\n            tar, \"pybind11/share/cmake/pybind11/pybind11Config.cmake\"\n        )\n\n    assert (\n        'set(pybind11_INCLUDE_DIR \"${PACKAGE_PREFIX_DIR}/include\")'\n        in cmake_cfg.decode(\"utf-8\")\n    )\n\n    files = {f\"pybind11/{n}\" for n in all_files}\n    files |= sdist_files\n    files |= {f\"pybind11_global{n}\" for n in local_sdist_files}\n    assert simpler == files\n\n    with open(os.path.join(MAIN_DIR, \"tools\", \"setup_global.py.in\"), \"rb\") as f:\n        contents = (\n            string.Template(f.read().decode())\n            .substitute(version=version, extra_cmd=\"\")\n            .encode(\"utf-8\")\n        )\n        assert setup_py == contents\n\n    with open(os.path.join(MAIN_DIR, \"tools\", \"pyproject.toml\"), \"rb\") as f:\n        contents = f.read()\n        assert pyproject_toml == contents\n\n    simple_version = \".\".join(version.split(\".\")[:3])\n    pkgconfig_expected = PKGCONFIG.format(VERSION=simple_version).encode(\"utf-8\")\n    assert normalize_line_endings(pkgconfig) == pkgconfig_expected\n\n\ndef tests_build_wheel(monkeypatch, tmpdir):\n    monkeypatch.chdir(MAIN_DIR)\n\n    subprocess.run(\n        [sys.executable, \"-m\", \"pip\", \"wheel\", \".\", \"-w\", str(tmpdir)], check=True\n    )\n\n    (wheel,) = tmpdir.visit(\"*.whl\")\n\n    files = {f\"pybind11/{n}\" for n in all_files}\n    files |= {\n        \"dist-info/LICENSE\",\n        \"dist-info/METADATA\",\n        \"dist-info/RECORD\",\n        \"dist-info/WHEEL\",\n        \"dist-info/entry_points.txt\",\n        \"dist-info/top_level.txt\",\n    }\n\n    with zipfile.ZipFile(str(wheel)) as z:\n        names = z.namelist()\n\n    trimmed = {n for n in names if \"dist-info\" not in n}\n    trimmed |= {f\"dist-info/{n.split('/', 1)[-1]}\" for n in names if \"dist-info\" in n}\n    assert files == trimmed\n\n\ndef tests_build_global_wheel(monkeypatch, tmpdir):\n    monkeypatch.chdir(MAIN_DIR)\n    monkeypatch.setenv(\"PYBIND11_GLOBAL_SDIST\", \"1\")\n\n    subprocess.run(\n        [sys.executable, \"-m\", \"pip\", \"wheel\", \".\", \"-w\", str(tmpdir)], check=True\n    )\n\n    (wheel,) = tmpdir.visit(\"*.whl\")\n\n    files = {f\"data/data/{n}\" for n in src_files}\n    files |= {f\"data/headers/{n[8:]}\" for n in headers}\n    files |= {\n        \"dist-info/LICENSE\",\n        \"dist-info/METADATA\",\n        \"dist-info/WHEEL\",\n        \"dist-info/top_level.txt\",\n        \"dist-info/RECORD\",\n    }\n\n    with zipfile.ZipFile(str(wheel)) as z:\n        names = z.namelist()\n\n    beginning = names[0].split(\"/\", 1)[0].rsplit(\".\", 1)[0]\n    trimmed = {n[len(beginning) + 1 :] for n in names}\n\n    assert files == trimmed\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/extra_setuptools/pytest.ini",
    "content": ""
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/extra_setuptools/test_setuphelper.py",
    "content": "import os\nimport subprocess\nimport sys\nfrom textwrap import dedent\n\nimport pytest\n\nDIR = os.path.abspath(os.path.dirname(__file__))\nMAIN_DIR = os.path.dirname(os.path.dirname(DIR))\nWIN = sys.platform.startswith(\"win32\") or sys.platform.startswith(\"cygwin\")\n\n\n@pytest.mark.parametrize(\"parallel\", [False, True])\n@pytest.mark.parametrize(\"std\", [11, 0])\ndef test_simple_setup_py(monkeypatch, tmpdir, parallel, std):\n    monkeypatch.chdir(tmpdir)\n    monkeypatch.syspath_prepend(MAIN_DIR)\n\n    (tmpdir / \"setup.py\").write_text(\n        dedent(\n            f\"\"\"\\\n            import sys\n            sys.path.append({MAIN_DIR!r})\n\n            from setuptools import setup, Extension\n            from pybind11.setup_helpers import build_ext, Pybind11Extension\n\n            std = {std}\n\n            ext_modules = [\n                Pybind11Extension(\n                    \"simple_setup\",\n                    sorted([\"main.cpp\"]),\n                    cxx_std=std,\n                ),\n            ]\n\n            cmdclass = dict()\n            if std == 0:\n                cmdclass[\"build_ext\"] = build_ext\n\n\n            parallel = {parallel}\n            if parallel:\n                from pybind11.setup_helpers import ParallelCompile\n                ParallelCompile().install()\n\n            setup(\n                name=\"simple_setup_package\",\n                cmdclass=cmdclass,\n                ext_modules=ext_modules,\n            )\n            \"\"\"\n        ),\n        encoding=\"ascii\",\n    )\n\n    (tmpdir / \"main.cpp\").write_text(\n        dedent(\n            \"\"\"\\\n            #include <pybind11/pybind11.h>\n\n            int f(int x) {\n                return x * 3;\n            }\n            PYBIND11_MODULE(simple_setup, m) {\n                m.def(\"f\", &f);\n            }\n            \"\"\"\n        ),\n        encoding=\"ascii\",\n    )\n\n    out = subprocess.check_output(\n        [sys.executable, \"setup.py\", \"build_ext\", \"--inplace\"],\n    )\n    if not WIN:\n        assert b\"-g0\" in out\n    out = subprocess.check_output(\n        [sys.executable, \"setup.py\", \"build_ext\", \"--inplace\", \"--force\"],\n        env=dict(os.environ, CFLAGS=\"-g\"),\n    )\n    if not WIN:\n        assert b\"-g0\" not in out\n\n    # Debug helper printout, normally hidden\n    print(out)\n    for item in tmpdir.listdir():\n        print(item.basename)\n\n    assert (\n        len([f for f in tmpdir.listdir() if f.basename.startswith(\"simple_setup\")]) == 1\n    )\n    assert len(list(tmpdir.listdir())) == 4  # two files + output + build_dir\n\n    (tmpdir / \"test.py\").write_text(\n        dedent(\n            \"\"\"\\\n            import simple_setup\n            assert simple_setup.f(3) == 9\n            \"\"\"\n        ),\n        encoding=\"ascii\",\n    )\n\n    subprocess.check_call(\n        [sys.executable, \"test.py\"], stdout=sys.stdout, stderr=sys.stderr\n    )\n\n\ndef test_intree_extensions(monkeypatch, tmpdir):\n    monkeypatch.syspath_prepend(MAIN_DIR)\n\n    from pybind11.setup_helpers import intree_extensions\n\n    monkeypatch.chdir(tmpdir)\n    root = tmpdir\n    root.ensure_dir()\n    subdir = root / \"dir\"\n    subdir.ensure_dir()\n    src = subdir / \"ext.cpp\"\n    src.ensure()\n    relpath = src.relto(tmpdir)\n    (ext,) = intree_extensions([relpath])\n    assert ext.name == \"ext\"\n    subdir.ensure(\"__init__.py\")\n    (ext,) = intree_extensions([relpath])\n    assert ext.name == \"dir.ext\"\n\n\ndef test_intree_extensions_package_dir(monkeypatch, tmpdir):\n    monkeypatch.syspath_prepend(MAIN_DIR)\n\n    from pybind11.setup_helpers import intree_extensions\n\n    monkeypatch.chdir(tmpdir)\n    root = tmpdir / \"src\"\n    root.ensure_dir()\n    subdir = root / \"dir\"\n    subdir.ensure_dir()\n    src = subdir / \"ext.cpp\"\n    src.ensure()\n    (ext,) = intree_extensions([src.relto(tmpdir)], package_dir={\"\": \"src\"})\n    assert ext.name == \"dir.ext\"\n    (ext,) = intree_extensions([src.relto(tmpdir)], package_dir={\"foo\": \"src\"})\n    assert ext.name == \"foo.dir.ext\"\n    subdir.ensure(\"__init__.py\")\n    (ext,) = intree_extensions([src.relto(tmpdir)], package_dir={\"\": \"src\"})\n    assert ext.name == \"dir.ext\"\n    (ext,) = intree_extensions([src.relto(tmpdir)], package_dir={\"foo\": \"src\"})\n    assert ext.name == \"foo.dir.ext\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/local_bindings.h",
    "content": "#pragma once\n#include \"pybind11_tests.h\"\n\n#include <utility>\n\n/// Simple class used to test py::local:\ntemplate <int>\nclass LocalBase {\npublic:\n    explicit LocalBase(int i) : i(i) {}\n    int i = -1;\n};\n\n/// Registered with py::module_local in both main and secondary modules:\nusing LocalType = LocalBase<0>;\n/// Registered without py::module_local in both modules:\nusing NonLocalType = LocalBase<1>;\n/// A second non-local type (for stl_bind tests):\nusing NonLocal2 = LocalBase<2>;\n/// Tests within-module, different-compilation-unit local definition conflict:\nusing LocalExternal = LocalBase<3>;\n/// Mixed: registered local first, then global\nusing MixedLocalGlobal = LocalBase<4>;\n/// Mixed: global first, then local\nusing MixedGlobalLocal = LocalBase<5>;\n\n/// Registered with py::module_local only in the secondary module:\nusing ExternalType1 = LocalBase<6>;\nusing ExternalType2 = LocalBase<7>;\n\nusing LocalVec = std::vector<LocalType>;\nusing LocalVec2 = std::vector<NonLocal2>;\nusing LocalMap = std::unordered_map<std::string, LocalType>;\nusing NonLocalVec = std::vector<NonLocalType>;\nusing NonLocalVec2 = std::vector<NonLocal2>;\nusing NonLocalMap = std::unordered_map<std::string, NonLocalType>;\nusing NonLocalMap2 = std::unordered_map<std::string, uint8_t>;\n\n// Exception that will be caught via the module local translator.\nclass LocalException : public std::exception {\npublic:\n    explicit LocalException(const char *m) : message{m} {}\n    const char *what() const noexcept override { return message.c_str(); }\n\nprivate:\n    std::string message = \"\";\n};\n\n// Exception that will be registered with register_local_exception_translator\nclass LocalSimpleException : public std::exception {\npublic:\n    explicit LocalSimpleException(const char *m) : message{m} {}\n    const char *what() const noexcept override { return message.c_str(); }\n\nprivate:\n    std::string message = \"\";\n};\n\nPYBIND11_MAKE_OPAQUE(LocalVec);\nPYBIND11_MAKE_OPAQUE(LocalVec2);\nPYBIND11_MAKE_OPAQUE(LocalMap);\nPYBIND11_MAKE_OPAQUE(NonLocalVec);\n// PYBIND11_MAKE_OPAQUE(NonLocalVec2); // same type as LocalVec2\nPYBIND11_MAKE_OPAQUE(NonLocalMap);\nPYBIND11_MAKE_OPAQUE(NonLocalMap2);\n\n// Simple bindings (used with the above):\ntemplate <typename T, int Adjust = 0, typename... Args>\npy::class_<T> bind_local(Args &&...args) {\n    return py::class_<T>(std::forward<Args>(args)...).def(py::init<int>()).def(\"get\", [](T &i) {\n        return i.i + Adjust;\n    });\n};\n\n// Simulate a foreign library base class (to match the example in the docs):\nnamespace pets {\nclass Pet {\npublic:\n    explicit Pet(std::string name) : name_(std::move(name)) {}\n    std::string name_;\n    const std::string &name() const { return name_; }\n};\n} // namespace pets\n\nstruct MixGL {\n    int i;\n    explicit MixGL(int i) : i{i} {}\n};\nstruct MixGL2 {\n    int i;\n    explicit MixGL2(int i) : i{i} {}\n};\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/object.h",
    "content": "#if !defined(__OBJECT_H)\n#    define __OBJECT_H\n\n#    include \"constructor_stats.h\"\n\n#    include <atomic>\n\n/// Reference counted object base class\nclass Object {\npublic:\n    /// Default constructor\n    Object() { print_default_created(this); }\n\n    /// Copy constructor\n    Object(const Object &) : m_refCount(0) { print_copy_created(this); }\n\n    /// Return the current reference count\n    int getRefCount() const { return m_refCount; };\n\n    /// Increase the object's reference count by one\n    void incRef() const { ++m_refCount; }\n\n    /** \\brief Decrease the reference count of\n     * the object and possibly deallocate it.\n     *\n     * The object will automatically be deallocated once\n     * the reference count reaches zero.\n     */\n    void decRef(bool dealloc = true) const {\n        --m_refCount;\n        if (m_refCount == 0 && dealloc) {\n            delete this;\n        } else if (m_refCount < 0) {\n            throw std::runtime_error(\"Internal error: reference count < 0!\");\n        }\n    }\n\n    virtual std::string toString() const = 0;\n\nprotected:\n    /** \\brief Virtual protected deconstructor.\n     * (Will only be called by \\ref ref)\n     */\n    virtual ~Object() { print_destroyed(this); }\n\nprivate:\n    mutable std::atomic<int> m_refCount{0};\n};\n\n// Tag class used to track constructions of ref objects.  When we track constructors, below, we\n// track and print out the actual class (e.g. ref<MyObject>), and *also* add a fake tracker for\n// ref_tag.  This lets us check that the total number of ref<Anything> constructors/destructors is\n// correct without having to check each individual ref<Whatever> type individually.\nclass ref_tag {};\n\n/**\n * \\brief Reference counting helper\n *\n * The \\a ref refeference template is a simple wrapper to store a\n * pointer to an object. It takes care of increasing and decreasing\n * the reference count of the object. When the last reference goes\n * out of scope, the associated object will be deallocated.\n *\n * \\ingroup libcore\n */\ntemplate <typename T>\nclass ref {\npublic:\n    /// Create a nullptr reference\n    ref() : m_ptr(nullptr) {\n        print_default_created(this);\n        track_default_created((ref_tag *) this);\n    }\n\n    /// Construct a reference from a pointer\n    explicit ref(T *ptr) : m_ptr(ptr) {\n        if (m_ptr) {\n            ((Object *) m_ptr)->incRef();\n        }\n\n        print_created(this, \"from pointer\", m_ptr);\n        track_created((ref_tag *) this, \"from pointer\");\n    }\n\n    /// Copy constructor\n    ref(const ref &r) : m_ptr(r.m_ptr) {\n        if (m_ptr) {\n            ((Object *) m_ptr)->incRef();\n        }\n\n        print_copy_created(this, \"with pointer\", m_ptr);\n        track_copy_created((ref_tag *) this);\n    }\n\n    /// Move constructor\n    ref(ref &&r) noexcept : m_ptr(r.m_ptr) {\n        r.m_ptr = nullptr;\n\n        print_move_created(this, \"with pointer\", m_ptr);\n        track_move_created((ref_tag *) this);\n    }\n\n    /// Destroy this reference\n    ~ref() {\n        if (m_ptr) {\n            ((Object *) m_ptr)->decRef();\n        }\n\n        print_destroyed(this);\n        track_destroyed((ref_tag *) this);\n    }\n\n    /// Move another reference into the current one\n    ref &operator=(ref &&r) noexcept {\n        print_move_assigned(this, \"pointer\", r.m_ptr);\n        track_move_assigned((ref_tag *) this);\n\n        if (*this == r) {\n            return *this;\n        }\n        if (m_ptr) {\n            ((Object *) m_ptr)->decRef();\n        }\n        m_ptr = r.m_ptr;\n        r.m_ptr = nullptr;\n        return *this;\n    }\n\n    /// Overwrite this reference with another reference\n    ref &operator=(const ref &r) {\n        if (this == &r) {\n            return *this;\n        }\n        print_copy_assigned(this, \"pointer\", r.m_ptr);\n        track_copy_assigned((ref_tag *) this);\n\n        if (m_ptr == r.m_ptr) {\n            return *this;\n        }\n        if (m_ptr) {\n            ((Object *) m_ptr)->decRef();\n        }\n        m_ptr = r.m_ptr;\n        if (m_ptr) {\n            ((Object *) m_ptr)->incRef();\n        }\n        return *this;\n    }\n\n    /// Overwrite this reference with a pointer to another object\n    ref &operator=(T *ptr) {\n        print_values(this, \"assigned pointer\");\n        track_values((ref_tag *) this, \"assigned pointer\");\n\n        if (m_ptr == ptr) {\n            return *this;\n        }\n        if (m_ptr) {\n            ((Object *) m_ptr)->decRef();\n        }\n        m_ptr = ptr;\n        if (m_ptr) {\n            ((Object *) m_ptr)->incRef();\n        }\n        return *this;\n    }\n\n    /// Compare this reference with another reference\n    bool operator==(const ref &r) const { return m_ptr == r.m_ptr; }\n\n    /// Compare this reference with another reference\n    bool operator!=(const ref &r) const { return m_ptr != r.m_ptr; }\n\n    /// Compare this reference with a pointer\n    bool operator==(const T *ptr) const { return m_ptr == ptr; }\n\n    /// Compare this reference with a pointer\n    bool operator!=(const T *ptr) const { return m_ptr != ptr; }\n\n    /// Access the object referenced by this reference\n    T *operator->() { return m_ptr; }\n\n    /// Access the object referenced by this reference\n    const T *operator->() const { return m_ptr; }\n\n    /// Return a C++ reference to the referenced object\n    T &operator*() { return *m_ptr; }\n\n    /// Return a const C++ reference to the referenced object\n    const T &operator*() const { return *m_ptr; }\n\n    /// Return a pointer to the referenced object\n    explicit operator T *() { return m_ptr; }\n\n    /// Return a const pointer to the referenced object\n    T *get_ptr() { return m_ptr; }\n\n    /// Return a pointer to the referenced object\n    const T *get_ptr() const { return m_ptr; }\n\nprivate:\n    T *m_ptr;\n};\n\n#endif /* __OBJECT_H */\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/pybind11_cross_module_tests.cpp",
    "content": "/*\n    tests/pybind11_cross_module_tests.cpp -- contains tests that require multiple modules\n\n    Copyright (c) 2017 Jason Rhinelander <jason@imaginary.ca>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/stl_bind.h>\n\n#include \"local_bindings.h\"\n#include \"pybind11_tests.h\"\n#include \"test_exceptions.h\"\n\n#include <numeric>\n#include <utility>\n\nPYBIND11_MODULE(pybind11_cross_module_tests, m) {\n    m.doc() = \"pybind11 cross-module test module\";\n\n    // test_local_bindings.py tests:\n    //\n    // Definitions here are tested by importing both this module and the\n    // relevant pybind11_tests submodule from a test_whatever.py\n\n    // test_load_external\n    bind_local<ExternalType1>(m, \"ExternalType1\", py::module_local());\n    bind_local<ExternalType2>(m, \"ExternalType2\", py::module_local());\n\n    // test_exceptions.py\n    py::register_local_exception<LocalSimpleException>(m, \"LocalSimpleException\");\n    m.def(\"raise_runtime_error\", []() {\n        PyErr_SetString(PyExc_RuntimeError, \"My runtime error\");\n        throw py::error_already_set();\n    });\n    m.def(\"raise_value_error\", []() {\n        PyErr_SetString(PyExc_ValueError, \"My value error\");\n        throw py::error_already_set();\n    });\n    m.def(\"throw_pybind_value_error\", []() { throw py::value_error(\"pybind11 value error\"); });\n    m.def(\"throw_pybind_type_error\", []() { throw py::type_error(\"pybind11 type error\"); });\n    m.def(\"throw_stop_iteration\", []() { throw py::stop_iteration(); });\n    m.def(\"throw_local_error\", []() { throw LocalException(\"just local\"); });\n    m.def(\"throw_local_simple_error\", []() { throw LocalSimpleException(\"external mod\"); });\n    py::register_exception_translator([](std::exception_ptr p) {\n        try {\n            if (p) {\n                std::rethrow_exception(p);\n            }\n        } catch (const shared_exception &e) {\n            PyErr_SetString(PyExc_KeyError, e.what());\n        }\n    });\n\n    // translate the local exception into a key error but only in this module\n    py::register_local_exception_translator([](std::exception_ptr p) {\n        try {\n            if (p) {\n                std::rethrow_exception(p);\n            }\n        } catch (const LocalException &e) {\n            PyErr_SetString(PyExc_KeyError, e.what());\n        }\n    });\n\n    // test_local_bindings.py\n    // Local to both:\n    bind_local<LocalType, 1>(m, \"LocalType\", py::module_local()).def(\"get2\", [](LocalType &t) {\n        return t.i + 2;\n    });\n\n    // Can only be called with our python type:\n    m.def(\"local_value\", [](LocalType &l) { return l.i; });\n\n    // test_nonlocal_failure\n    // This registration will fail (global registration when LocalFail is already registered\n    // globally in the main test module):\n    m.def(\"register_nonlocal\", [m]() { bind_local<NonLocalType, 0>(m, \"NonLocalType\"); });\n\n    // test_stl_bind_local\n    // stl_bind.h binders defaults to py::module_local if the types are local or converting:\n    py::bind_vector<LocalVec>(m, \"LocalVec\");\n    py::bind_map<LocalMap>(m, \"LocalMap\");\n\n    // test_stl_bind_global\n    // and global if the type (or one of the types, for the map) is global (so these will fail,\n    // assuming pybind11_tests is already loaded):\n    m.def(\"register_nonlocal_vec\", [m]() { py::bind_vector<NonLocalVec>(m, \"NonLocalVec\"); });\n    m.def(\"register_nonlocal_map\", [m]() { py::bind_map<NonLocalMap>(m, \"NonLocalMap\"); });\n    // The default can, however, be overridden to global using `py::module_local()` or\n    // `py::module_local(false)`.\n    // Explicitly made local:\n    py::bind_vector<NonLocalVec2>(m, \"NonLocalVec2\", py::module_local());\n    // Explicitly made global (and so will fail to bind):\n    m.def(\"register_nonlocal_map2\",\n          [m]() { py::bind_map<NonLocalMap2>(m, \"NonLocalMap2\", py::module_local(false)); });\n\n    // test_mixed_local_global\n    // We try this both with the global type registered first and vice versa (the order shouldn't\n    // matter).\n    m.def(\"register_mixed_global_local\",\n          [m]() { bind_local<MixedGlobalLocal, 200>(m, \"MixedGlobalLocal\", py::module_local()); });\n    m.def(\"register_mixed_local_global\", [m]() {\n        bind_local<MixedLocalGlobal, 2000>(m, \"MixedLocalGlobal\", py::module_local(false));\n    });\n    m.def(\"get_mixed_gl\", [](int i) { return MixedGlobalLocal(i); });\n    m.def(\"get_mixed_lg\", [](int i) { return MixedLocalGlobal(i); });\n\n    // test_internal_locals_differ\n    m.def(\"local_cpp_types_addr\",\n          []() { return (uintptr_t) &py::detail::get_local_internals().registered_types_cpp; });\n\n    // test_stl_caster_vs_stl_bind\n    py::bind_vector<std::vector<int>>(m, \"VectorInt\");\n\n    m.def(\"load_vector_via_binding\",\n          [](std::vector<int> &v) { return std::accumulate(v.begin(), v.end(), 0); });\n\n    // test_cross_module_calls\n    m.def(\"return_self\", [](LocalVec *v) { return v; });\n    m.def(\"return_copy\", [](const LocalVec &v) { return LocalVec(v); });\n\n    class Dog : public pets::Pet {\n    public:\n        explicit Dog(std::string name) : Pet(std::move(name)) {}\n    };\n    py::class_<pets::Pet>(m, \"Pet\", py::module_local()).def(\"name\", &pets::Pet::name);\n    // Binding for local extending class:\n    py::class_<Dog, pets::Pet>(m, \"Dog\").def(py::init<std::string>());\n    m.def(\"pet_name\", [](pets::Pet &p) { return p.name(); });\n\n    py::class_<MixGL>(m, \"MixGL\", py::module_local()).def(py::init<int>());\n    m.def(\"get_gl_value\", [](MixGL &o) { return o.i + 100; });\n\n    py::class_<MixGL2>(m, \"MixGL2\", py::module_local()).def(py::init<int>());\n\n    // test_vector_bool\n    // We can't test both stl.h and stl_bind.h conversions of `std::vector<bool>` within\n    // the same module (it would be an ODR violation). Therefore `bind_vector` of `bool`\n    // is defined here and tested in `test_stl_binders.py`.\n    py::bind_vector<std::vector<bool>>(m, \"VectorBool\");\n\n    // test_missing_header_message\n    // The main module already includes stl.h, but we need to test the error message\n    // which appears when this header is missing.\n    m.def(\"missing_header_arg\", [](const std::vector<float> &) {});\n    m.def(\"missing_header_return\", []() { return std::vector<float>(); });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/pybind11_tests.cpp",
    "content": "/*\n    tests/pybind11_tests.cpp -- pybind example plugin\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"pybind11_tests.h\"\n\n#include \"constructor_stats.h\"\n\n#include <functional>\n#include <list>\n\n/*\nFor testing purposes, we define a static global variable here in a function that each individual\ntest .cpp calls with its initialization lambda.  It's convenient here because we can just not\ncompile some test files to disable/ignore some of the test code.\n\nIt is NOT recommended as a way to use pybind11 in practice, however: the initialization order will\nbe essentially random, which is okay for our test scripts (there are no dependencies between the\nindividual pybind11 test .cpp files), but most likely not what you want when using pybind11\nproductively.\n\nInstead, see the \"How can I reduce the build time?\" question in the \"Frequently asked questions\"\nsection of the documentation for good practice on splitting binding code over multiple files.\n*/\nstd::list<std::function<void(py::module_ &)>> &initializers() {\n    static std::list<std::function<void(py::module_ &)>> inits;\n    return inits;\n}\n\ntest_initializer::test_initializer(Initializer init) { initializers().emplace_back(init); }\n\ntest_initializer::test_initializer(const char *submodule_name, Initializer init) {\n    initializers().emplace_back([=](py::module_ &parent) {\n        auto m = parent.def_submodule(submodule_name);\n        init(m);\n    });\n}\n\nvoid bind_ConstructorStats(py::module_ &m) {\n    py::class_<ConstructorStats>(m, \"ConstructorStats\")\n        .def(\"alive\", &ConstructorStats::alive)\n        .def(\"values\", &ConstructorStats::values)\n        .def_readwrite(\"default_constructions\", &ConstructorStats::default_constructions)\n        .def_readwrite(\"copy_assignments\", &ConstructorStats::copy_assignments)\n        .def_readwrite(\"move_assignments\", &ConstructorStats::move_assignments)\n        .def_readwrite(\"copy_constructions\", &ConstructorStats::copy_constructions)\n        .def_readwrite(\"move_constructions\", &ConstructorStats::move_constructions)\n        .def_static(\"get\",\n                    (ConstructorStats & (*) (py::object)) & ConstructorStats::get,\n                    py::return_value_policy::reference_internal)\n\n        // Not exactly ConstructorStats, but related: expose the internal pybind number of\n        // registered instances to allow instance cleanup checks (invokes a GC first)\n        .def_static(\"detail_reg_inst\", []() {\n            ConstructorStats::gc();\n            return py::detail::get_internals().registered_instances.size();\n        });\n}\n\nconst char *cpp_std() {\n    return\n#if defined(PYBIND11_CPP20)\n        \"C++20\";\n#elif defined(PYBIND11_CPP17)\n        \"C++17\";\n#elif defined(PYBIND11_CPP14)\n        \"C++14\";\n#else\n        \"C++11\";\n#endif\n}\n\nPYBIND11_MODULE(pybind11_tests, m) {\n    m.doc() = \"pybind11 test module\";\n\n    // Intentionally kept minimal to not create a maintenance chore\n    // (\"just enough\" to be conclusive).\n#if defined(_MSC_FULL_VER)\n    m.attr(\"compiler_info\") = \"MSVC \" PYBIND11_TOSTRING(_MSC_FULL_VER);\n#elif defined(__VERSION__)\n    m.attr(\"compiler_info\") = __VERSION__;\n#else\n    m.attr(\"compiler_info\") = py::none();\n#endif\n    m.attr(\"cpp_std\") = cpp_std();\n    m.attr(\"PYBIND11_INTERNALS_ID\") = PYBIND11_INTERNALS_ID;\n    m.attr(\"PYBIND11_SIMPLE_GIL_MANAGEMENT\") =\n#if defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)\n        true;\n#else\n        false;\n#endif\n\n    bind_ConstructorStats(m);\n\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n    m.attr(\"detailed_error_messages_enabled\") = true;\n#else\n    m.attr(\"detailed_error_messages_enabled\") = false;\n#endif\n\n    py::class_<UserType>(m, \"UserType\", \"A `py::class_` type for testing\")\n        .def(py::init<>())\n        .def(py::init<int>())\n        .def(\"get_value\", &UserType::value, \"Get value using a method\")\n        .def(\"set_value\", &UserType::set, \"Set value using a method\")\n        .def_property(\"value\", &UserType::value, &UserType::set, \"Get/set value using a property\")\n        .def(\"__repr__\", [](const UserType &u) { return \"UserType({})\"_s.format(u.value()); });\n\n    py::class_<IncType, UserType>(m, \"IncType\")\n        .def(py::init<>())\n        .def(py::init<int>())\n        .def(\"__repr__\", [](const IncType &u) { return \"IncType({})\"_s.format(u.value()); });\n\n    for (const auto &initializer : initializers()) {\n        initializer(m);\n    }\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/pybind11_tests.h",
    "content": "#pragma once\n\n#include <pybind11/eval.h>\n#include <pybind11/pybind11.h>\n\nnamespace py = pybind11;\nusing namespace pybind11::literals;\n\nclass test_initializer {\n    using Initializer = void (*)(py::module_ &);\n\npublic:\n    explicit test_initializer(Initializer init);\n    test_initializer(const char *submodule_name, Initializer init);\n};\n\n#define TEST_SUBMODULE(name, variable)                                                            \\\n    void test_submodule_##name(py::module_ &);                                                    \\\n    test_initializer name(#name, test_submodule_##name);                                          \\\n    void test_submodule_##name(py::module_ &(variable))\n\n/// Dummy type which is not exported anywhere -- something to trigger a conversion error\nstruct UnregisteredType {};\n\n/// A user-defined type which is exported and can be used by any test\nclass UserType {\npublic:\n    UserType() = default;\n    explicit UserType(int i) : i(i) {}\n\n    int value() const { return i; }\n    void set(int set) { i = set; }\n\nprivate:\n    int i = -1;\n};\n\n/// Like UserType, but increments `value` on copy for quick reference vs. copy tests\nclass IncType : public UserType {\npublic:\n    using UserType::UserType;\n    IncType() = default;\n    IncType(const IncType &other) : IncType(other.value() + 1) {}\n    IncType(IncType &&) = delete;\n    IncType &operator=(const IncType &) = delete;\n    IncType &operator=(IncType &&) = delete;\n};\n\n/// A simple union for basic testing\nunion IntFloat {\n    int i;\n    float f;\n};\n\n/// Custom cast-only type that casts to a string \"rvalue\" or \"lvalue\" depending on the cast\n/// context. Used to test recursive casters (e.g. std::tuple, stl containers).\nstruct RValueCaster {};\nPYBIND11_NAMESPACE_BEGIN(pybind11)\nPYBIND11_NAMESPACE_BEGIN(detail)\ntemplate <>\nclass type_caster<RValueCaster> {\npublic:\n    PYBIND11_TYPE_CASTER(RValueCaster, const_name(\"RValueCaster\"));\n    static handle cast(RValueCaster &&, return_value_policy, handle) {\n        return py::str(\"rvalue\").release();\n    }\n    static handle cast(const RValueCaster &, return_value_policy, handle) {\n        return py::str(\"lvalue\").release();\n    }\n};\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(pybind11)\n\ntemplate <typename F>\nvoid ignoreOldStyleInitWarnings(F &&body) {\n    py::exec(R\"(\n    message = \"pybind11-bound class '.+' is using an old-style placement-new '(?:__init__|__setstate__)' which has been deprecated\"\n\n    import warnings\n    with warnings.catch_warnings():\n        warnings.filterwarnings(\"ignore\", message=message, category=FutureWarning)\n        body()\n    )\",\n             py::dict(py::arg(\"body\") = py::cpp_function(body)));\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/pytest.ini",
    "content": "[pytest]\nminversion = 3.10\nnorecursedirs = test_* extra_*\nxfail_strict = True\naddopts =\n    # show summary of tests\n    -ra\n    # capture only Python print and C++ py::print, but not C output (low-level Python errors)\n    --capture=sys\n    # Show local info when a failure occurs\n    --showlocals\nlog_cli_level = info\nfilterwarnings =\n    # make warnings into errors but ignore certain third-party extension issues\n    error\n    # somehow, some DeprecationWarnings do not get turned into errors\n    always::DeprecationWarning\n    # importing scipy submodules on some version of Python\n    ignore::ImportWarning\n    # bogus numpy ABI warning (see numpy/#432)\n    ignore:.*numpy.dtype size changed.*:RuntimeWarning\n    ignore:.*numpy.ufunc size changed.*:RuntimeWarning\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/requirements.txt",
    "content": "build==0.8.0\nnumpy==1.21.5; platform_python_implementation==\"PyPy\" and sys_platform==\"linux\" and python_version==\"3.7\"\nnumpy==1.19.3; platform_python_implementation!=\"PyPy\" and python_version==\"3.6\"\nnumpy==1.21.5; platform_python_implementation!=\"PyPy\" and python_version>=\"3.7\" and python_version<\"3.10\"\nnumpy==1.22.2; platform_python_implementation!=\"PyPy\" and python_version>=\"3.10\" and python_version<\"3.11\"\npytest==7.0.0\npytest-timeout\nscipy==1.5.4; platform_python_implementation!=\"PyPy\" and python_version<\"3.10\"\nscipy==1.8.0; platform_python_implementation!=\"PyPy\" and python_version==\"3.10\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_async.cpp",
    "content": "/*\n    tests/test_async.cpp -- __await__ support\n\n    Copyright (c) 2019 Google Inc.\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"pybind11_tests.h\"\n\nTEST_SUBMODULE(async_module, m) {\n    struct DoesNotSupportAsync {};\n    py::class_<DoesNotSupportAsync>(m, \"DoesNotSupportAsync\").def(py::init<>());\n    struct SupportsAsync {};\n    py::class_<SupportsAsync>(m, \"SupportsAsync\")\n        .def(py::init<>())\n        .def(\"__await__\", [](const SupportsAsync &self) -> py::object {\n            static_cast<void>(self);\n            py::object loop = py::module_::import(\"asyncio.events\").attr(\"get_event_loop\")();\n            py::object f = loop.attr(\"create_future\")();\n            f.attr(\"set_result\")(5);\n            return f.attr(\"__await__\")();\n        });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_async.py",
    "content": "import pytest\n\nasyncio = pytest.importorskip(\"asyncio\")\nm = pytest.importorskip(\"pybind11_tests.async_module\")\n\n\n@pytest.fixture\ndef event_loop():\n    loop = asyncio.new_event_loop()\n    yield loop\n    loop.close()\n\n\nasync def get_await_result(x):\n    return await x\n\n\ndef test_await(event_loop):\n    assert 5 == event_loop.run_until_complete(get_await_result(m.SupportsAsync()))\n\n\ndef test_await_missing(event_loop):\n    with pytest.raises(TypeError):\n        event_loop.run_until_complete(get_await_result(m.DoesNotSupportAsync()))\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_buffers.cpp",
    "content": "/*\n    tests/test_buffers.cpp -- supporting Pythons' buffer protocol\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/stl.h>\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\nTEST_SUBMODULE(buffers, m) {\n    // test_from_python / test_to_python:\n    class Matrix {\n    public:\n        Matrix(py::ssize_t rows, py::ssize_t cols) : m_rows(rows), m_cols(cols) {\n            print_created(this, std::to_string(m_rows) + \"x\" + std::to_string(m_cols) + \" matrix\");\n            // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n            m_data = new float[(size_t) (rows * cols)];\n            memset(m_data, 0, sizeof(float) * (size_t) (rows * cols));\n        }\n\n        Matrix(const Matrix &s) : m_rows(s.m_rows), m_cols(s.m_cols) {\n            print_copy_created(this,\n                               std::to_string(m_rows) + \"x\" + std::to_string(m_cols) + \" matrix\");\n            // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n            m_data = new float[(size_t) (m_rows * m_cols)];\n            memcpy(m_data, s.m_data, sizeof(float) * (size_t) (m_rows * m_cols));\n        }\n\n        Matrix(Matrix &&s) noexcept : m_rows(s.m_rows), m_cols(s.m_cols), m_data(s.m_data) {\n            print_move_created(this);\n            s.m_rows = 0;\n            s.m_cols = 0;\n            s.m_data = nullptr;\n        }\n\n        ~Matrix() {\n            print_destroyed(this,\n                            std::to_string(m_rows) + \"x\" + std::to_string(m_cols) + \" matrix\");\n            delete[] m_data;\n        }\n\n        Matrix &operator=(const Matrix &s) {\n            if (this == &s) {\n                return *this;\n            }\n            print_copy_assigned(this,\n                                std::to_string(m_rows) + \"x\" + std::to_string(m_cols) + \" matrix\");\n            delete[] m_data;\n            m_rows = s.m_rows;\n            m_cols = s.m_cols;\n            m_data = new float[(size_t) (m_rows * m_cols)];\n            memcpy(m_data, s.m_data, sizeof(float) * (size_t) (m_rows * m_cols));\n            return *this;\n        }\n\n        Matrix &operator=(Matrix &&s) noexcept {\n            print_move_assigned(this,\n                                std::to_string(m_rows) + \"x\" + std::to_string(m_cols) + \" matrix\");\n            if (&s != this) {\n                delete[] m_data;\n                m_rows = s.m_rows;\n                m_cols = s.m_cols;\n                m_data = s.m_data;\n                s.m_rows = 0;\n                s.m_cols = 0;\n                s.m_data = nullptr;\n            }\n            return *this;\n        }\n\n        float operator()(py::ssize_t i, py::ssize_t j) const {\n            return m_data[(size_t) (i * m_cols + j)];\n        }\n\n        float &operator()(py::ssize_t i, py::ssize_t j) {\n            return m_data[(size_t) (i * m_cols + j)];\n        }\n\n        float *data() { return m_data; }\n\n        py::ssize_t rows() const { return m_rows; }\n        py::ssize_t cols() const { return m_cols; }\n\n    private:\n        py::ssize_t m_rows;\n        py::ssize_t m_cols;\n        float *m_data;\n    };\n    py::class_<Matrix>(m, \"Matrix\", py::buffer_protocol())\n        .def(py::init<py::ssize_t, py::ssize_t>())\n        /// Construct from a buffer\n        .def(py::init([](const py::buffer &b) {\n            py::buffer_info info = b.request();\n            if (info.format != py::format_descriptor<float>::format() || info.ndim != 2) {\n                throw std::runtime_error(\"Incompatible buffer format!\");\n            }\n\n            auto *v = new Matrix(info.shape[0], info.shape[1]);\n            memcpy(v->data(), info.ptr, sizeof(float) * (size_t) (v->rows() * v->cols()));\n            return v;\n        }))\n\n        .def(\"rows\", &Matrix::rows)\n        .def(\"cols\", &Matrix::cols)\n\n        /// Bare bones interface\n        .def(\"__getitem__\",\n             [](const Matrix &m, std::pair<py::ssize_t, py::ssize_t> i) {\n                 if (i.first >= m.rows() || i.second >= m.cols()) {\n                     throw py::index_error();\n                 }\n                 return m(i.first, i.second);\n             })\n        .def(\"__setitem__\",\n             [](Matrix &m, std::pair<py::ssize_t, py::ssize_t> i, float v) {\n                 if (i.first >= m.rows() || i.second >= m.cols()) {\n                     throw py::index_error();\n                 }\n                 m(i.first, i.second) = v;\n             })\n        /// Provide buffer access\n        .def_buffer([](Matrix &m) -> py::buffer_info {\n            return py::buffer_info(\n                m.data(),                          /* Pointer to buffer */\n                {m.rows(), m.cols()},              /* Buffer dimensions */\n                {sizeof(float) * size_t(m.cols()), /* Strides (in bytes) for each index */\n                 sizeof(float)});\n        });\n\n    // test_inherited_protocol\n    class SquareMatrix : public Matrix {\n    public:\n        explicit SquareMatrix(py::ssize_t n) : Matrix(n, n) {}\n    };\n    // Derived classes inherit the buffer protocol and the buffer access function\n    py::class_<SquareMatrix, Matrix>(m, \"SquareMatrix\").def(py::init<py::ssize_t>());\n\n    // test_pointer_to_member_fn\n    // Tests that passing a pointer to member to the base class works in\n    // the derived class.\n    struct Buffer {\n        int32_t value = 0;\n\n        py::buffer_info get_buffer_info() {\n            return py::buffer_info(\n                &value, sizeof(value), py::format_descriptor<int32_t>::format(), 1);\n        }\n    };\n    py::class_<Buffer>(m, \"Buffer\", py::buffer_protocol())\n        .def(py::init<>())\n        .def_readwrite(\"value\", &Buffer::value)\n        .def_buffer(&Buffer::get_buffer_info);\n\n    class ConstBuffer {\n        std::unique_ptr<int32_t> value;\n\n    public:\n        int32_t get_value() const { return *value; }\n        void set_value(int32_t v) { *value = v; }\n\n        py::buffer_info get_buffer_info() const {\n            return py::buffer_info(\n                value.get(), sizeof(*value), py::format_descriptor<int32_t>::format(), 1);\n        }\n\n        ConstBuffer() : value(new int32_t{0}) {}\n    };\n    py::class_<ConstBuffer>(m, \"ConstBuffer\", py::buffer_protocol())\n        .def(py::init<>())\n        .def_property(\"value\", &ConstBuffer::get_value, &ConstBuffer::set_value)\n        .def_buffer(&ConstBuffer::get_buffer_info);\n\n    struct DerivedBuffer : public Buffer {};\n    py::class_<DerivedBuffer>(m, \"DerivedBuffer\", py::buffer_protocol())\n        .def(py::init<>())\n        .def_readwrite(\"value\", (int32_t DerivedBuffer::*) &DerivedBuffer::value)\n        .def_buffer(&DerivedBuffer::get_buffer_info);\n\n    struct BufferReadOnly {\n        const uint8_t value = 0;\n        explicit BufferReadOnly(uint8_t value) : value(value) {}\n\n        py::buffer_info get_buffer_info() { return py::buffer_info(&value, 1); }\n    };\n    py::class_<BufferReadOnly>(m, \"BufferReadOnly\", py::buffer_protocol())\n        .def(py::init<uint8_t>())\n        .def_buffer(&BufferReadOnly::get_buffer_info);\n\n    struct BufferReadOnlySelect {\n        uint8_t value = 0;\n        bool readonly = false;\n\n        py::buffer_info get_buffer_info() { return py::buffer_info(&value, 1, readonly); }\n    };\n    py::class_<BufferReadOnlySelect>(m, \"BufferReadOnlySelect\", py::buffer_protocol())\n        .def(py::init<>())\n        .def_readwrite(\"value\", &BufferReadOnlySelect::value)\n        .def_readwrite(\"readonly\", &BufferReadOnlySelect::readonly)\n        .def_buffer(&BufferReadOnlySelect::get_buffer_info);\n\n    // Expose buffer_info for testing.\n    py::class_<py::buffer_info>(m, \"buffer_info\")\n        .def(py::init<>())\n        .def_readonly(\"itemsize\", &py::buffer_info::itemsize)\n        .def_readonly(\"size\", &py::buffer_info::size)\n        .def_readonly(\"format\", &py::buffer_info::format)\n        .def_readonly(\"ndim\", &py::buffer_info::ndim)\n        .def_readonly(\"shape\", &py::buffer_info::shape)\n        .def_readonly(\"strides\", &py::buffer_info::strides)\n        .def_readonly(\"readonly\", &py::buffer_info::readonly)\n        .def(\"__repr__\", [](py::handle self) {\n            return py::str(\"itemsize={0.itemsize!r}, size={0.size!r}, format={0.format!r}, \"\n                           \"ndim={0.ndim!r}, shape={0.shape!r}, strides={0.strides!r}, \"\n                           \"readonly={0.readonly!r}\")\n                .format(self);\n        });\n\n    m.def(\"get_buffer_info\", [](const py::buffer &buffer) { return buffer.request(); });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_buffers.py",
    "content": "import ctypes\nimport io\nimport struct\n\nimport pytest\n\nimport env\nfrom pybind11_tests import ConstructorStats\nfrom pybind11_tests import buffers as m\n\nnp = pytest.importorskip(\"numpy\")\n\n\ndef test_from_python():\n    with pytest.raises(RuntimeError) as excinfo:\n        m.Matrix(np.array([1, 2, 3]))  # trying to assign a 1D array\n    assert str(excinfo.value) == \"Incompatible buffer format!\"\n\n    m3 = np.array([[1, 2, 3], [4, 5, 6]]).astype(np.float32)\n    m4 = m.Matrix(m3)\n\n    for i in range(m4.rows()):\n        for j in range(m4.cols()):\n            assert m3[i, j] == m4[i, j]\n\n    cstats = ConstructorStats.get(m.Matrix)\n    assert cstats.alive() == 1\n    del m3, m4\n    assert cstats.alive() == 0\n    assert cstats.values() == [\"2x3 matrix\"]\n    assert cstats.copy_constructions == 0\n    # assert cstats.move_constructions >= 0  # Don't invoke any\n    assert cstats.copy_assignments == 0\n    assert cstats.move_assignments == 0\n\n\n# https://foss.heptapod.net/pypy/pypy/-/issues/2444\n# TODO: fix on recent PyPy\n@pytest.mark.xfail(\n    env.PYPY, reason=\"PyPy 7.3.7 doesn't clear this anymore\", strict=False\n)\ndef test_to_python():\n    mat = m.Matrix(5, 4)\n    assert memoryview(mat).shape == (5, 4)\n\n    assert mat[2, 3] == 0\n    mat[2, 3] = 4.0\n    mat[3, 2] = 7.0\n    assert mat[2, 3] == 4\n    assert mat[3, 2] == 7\n    assert struct.unpack_from(\"f\", mat, (3 * 4 + 2) * 4) == (7,)\n    assert struct.unpack_from(\"f\", mat, (2 * 4 + 3) * 4) == (4,)\n\n    mat2 = np.array(mat, copy=False)\n    assert mat2.shape == (5, 4)\n    assert abs(mat2).sum() == 11\n    assert mat2[2, 3] == 4 and mat2[3, 2] == 7\n    mat2[2, 3] = 5\n    assert mat2[2, 3] == 5\n\n    cstats = ConstructorStats.get(m.Matrix)\n    assert cstats.alive() == 1\n    del mat\n    pytest.gc_collect()\n    assert cstats.alive() == 1\n    del mat2  # holds a mat reference\n    pytest.gc_collect()\n    assert cstats.alive() == 0\n    assert cstats.values() == [\"5x4 matrix\"]\n    assert cstats.copy_constructions == 0\n    # assert cstats.move_constructions >= 0  # Don't invoke any\n    assert cstats.copy_assignments == 0\n    assert cstats.move_assignments == 0\n\n\ndef test_inherited_protocol():\n    \"\"\"SquareMatrix is derived from Matrix and inherits the buffer protocol\"\"\"\n\n    matrix = m.SquareMatrix(5)\n    assert memoryview(matrix).shape == (5, 5)\n    assert np.asarray(matrix).shape == (5, 5)\n\n\ndef test_pointer_to_member_fn():\n    for cls in [m.Buffer, m.ConstBuffer, m.DerivedBuffer]:\n        buf = cls()\n        buf.value = 0x12345678\n        value = struct.unpack(\"i\", bytearray(buf))[0]\n        assert value == 0x12345678\n\n\ndef test_readonly_buffer():\n    buf = m.BufferReadOnly(0x64)\n    view = memoryview(buf)\n    assert view[0] == 0x64\n    assert view.readonly\n    with pytest.raises(TypeError):\n        view[0] = 0\n\n\ndef test_selective_readonly_buffer():\n    buf = m.BufferReadOnlySelect()\n\n    memoryview(buf)[0] = 0x64\n    assert buf.value == 0x64\n\n    io.BytesIO(b\"A\").readinto(buf)\n    assert buf.value == ord(b\"A\")\n\n    buf.readonly = True\n    with pytest.raises(TypeError):\n        memoryview(buf)[0] = 0\n    with pytest.raises(TypeError):\n        io.BytesIO(b\"1\").readinto(buf)\n\n\ndef test_ctypes_array_1d():\n    char1d = (ctypes.c_char * 10)()\n    int1d = (ctypes.c_int * 15)()\n    long1d = (ctypes.c_long * 7)()\n\n    for carray in (char1d, int1d, long1d):\n        info = m.get_buffer_info(carray)\n        assert info.itemsize == ctypes.sizeof(carray._type_)\n        assert info.size == len(carray)\n        assert info.ndim == 1\n        assert info.shape == [info.size]\n        assert info.strides == [info.itemsize]\n        assert not info.readonly\n\n\ndef test_ctypes_array_2d():\n    char2d = ((ctypes.c_char * 10) * 4)()\n    int2d = ((ctypes.c_int * 15) * 3)()\n    long2d = ((ctypes.c_long * 7) * 2)()\n\n    for carray in (char2d, int2d, long2d):\n        info = m.get_buffer_info(carray)\n        assert info.itemsize == ctypes.sizeof(carray[0]._type_)\n        assert info.size == len(carray) * len(carray[0])\n        assert info.ndim == 2\n        assert info.shape == [len(carray), len(carray[0])]\n        assert info.strides == [info.itemsize * len(carray[0]), info.itemsize]\n        assert not info.readonly\n\n\ndef test_ctypes_from_buffer():\n    test_pystr = b\"0123456789\"\n    for pyarray in (test_pystr, bytearray(test_pystr)):\n        pyinfo = m.get_buffer_info(pyarray)\n\n        if pyinfo.readonly:\n            cbytes = (ctypes.c_char * len(pyarray)).from_buffer_copy(pyarray)\n            cinfo = m.get_buffer_info(cbytes)\n        else:\n            cbytes = (ctypes.c_char * len(pyarray)).from_buffer(pyarray)\n            cinfo = m.get_buffer_info(cbytes)\n\n        assert cinfo.size == pyinfo.size\n        assert cinfo.ndim == pyinfo.ndim\n        assert cinfo.shape == pyinfo.shape\n        assert cinfo.strides == pyinfo.strides\n        assert not cinfo.readonly\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_builtin_casters.cpp",
    "content": "/*\n    tests/test_builtin_casters.cpp -- Casters available without any additional headers\n\n    Copyright (c) 2017 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/complex.h>\n\n#include \"pybind11_tests.h\"\n\nstruct ConstRefCasted {\n    int tag;\n};\n\nPYBIND11_NAMESPACE_BEGIN(pybind11)\nPYBIND11_NAMESPACE_BEGIN(detail)\ntemplate <>\nclass type_caster<ConstRefCasted> {\npublic:\n    static constexpr auto name = const_name<ConstRefCasted>();\n\n    // Input is unimportant, a new value will always be constructed based on the\n    // cast operator.\n    bool load(handle, bool) { return true; }\n\n    explicit operator ConstRefCasted &&() {\n        value = {1};\n        // NOLINTNEXTLINE(performance-move-const-arg)\n        return std::move(value);\n    }\n    explicit operator ConstRefCasted &() {\n        value = {2};\n        return value;\n    }\n    explicit operator ConstRefCasted *() {\n        value = {3};\n        return &value;\n    }\n\n    explicit operator const ConstRefCasted &() {\n        value = {4};\n        return value;\n    }\n    explicit operator const ConstRefCasted *() {\n        value = {5};\n        return &value;\n    }\n\n    // custom cast_op to explicitly propagate types to the conversion operators.\n    template <typename T_>\n    using cast_op_type =\n        /// const\n        conditional_t<\n            std::is_same<remove_reference_t<T_>, const ConstRefCasted *>::value,\n            const ConstRefCasted *,\n            conditional_t<\n                std::is_same<T_, const ConstRefCasted &>::value,\n                const ConstRefCasted &,\n                /// non-const\n                conditional_t<std::is_same<remove_reference_t<T_>, ConstRefCasted *>::value,\n                              ConstRefCasted *,\n                              conditional_t<std::is_same<T_, ConstRefCasted &>::value,\n                                            ConstRefCasted &,\n                                            /* else */ ConstRefCasted &&>>>>;\n\nprivate:\n    ConstRefCasted value = {0};\n};\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(pybind11)\n\nTEST_SUBMODULE(builtin_casters, m) {\n    PYBIND11_WARNING_PUSH\n    PYBIND11_WARNING_DISABLE_MSVC(4127)\n\n    // test_simple_string\n    m.def(\"string_roundtrip\", [](const char *s) { return s; });\n\n    // test_unicode_conversion\n    // Some test characters in utf16 and utf32 encodings.  The last one (the 𝐀) contains a null\n    // byte\n    char32_t a32 = 0x61 /*a*/, z32 = 0x7a /*z*/, ib32 = 0x203d /*‽*/, cake32 = 0x1f382 /*🎂*/,\n             mathbfA32 = 0x1d400 /*𝐀*/;\n    char16_t b16 = 0x62 /*b*/, z16 = 0x7a, ib16 = 0x203d, cake16_1 = 0xd83c, cake16_2 = 0xdf82,\n             mathbfA16_1 = 0xd835, mathbfA16_2 = 0xdc00;\n    std::wstring wstr;\n    wstr.push_back(0x61);   // a\n    wstr.push_back(0x2e18); // ⸘\n    if (sizeof(wchar_t) == 2) {\n        wstr.push_back(mathbfA16_1);\n        wstr.push_back(mathbfA16_2);\n    } // 𝐀, utf16\n    else {\n        wstr.push_back((wchar_t) mathbfA32);\n    }                     // 𝐀, utf32\n    wstr.push_back(0x7a); // z\n\n    m.def(\"good_utf8_string\", []() {\n        return std::string((const char *) u8\"Say utf8\\u203d \\U0001f382 \\U0001d400\");\n    }); // Say utf8‽ 🎂 𝐀\n    m.def(\"good_utf16_string\", [=]() {\n        return std::u16string({b16, ib16, cake16_1, cake16_2, mathbfA16_1, mathbfA16_2, z16});\n    }); // b‽🎂𝐀z\n    m.def(\"good_utf32_string\", [=]() {\n        return std::u32string({a32, mathbfA32, cake32, ib32, z32});\n    });                                                 // a𝐀🎂‽z\n    m.def(\"good_wchar_string\", [=]() { return wstr; }); // a‽𝐀z\n    m.def(\"bad_utf8_string\", []() {\n        return std::string(\"abc\\xd0\"\n                           \"def\");\n    });\n    m.def(\"bad_utf16_string\", [=]() { return std::u16string({b16, char16_t(0xd800), z16}); });\n    // Under Python 2.7, invalid unicode UTF-32 characters didn't appear to trigger\n    // UnicodeDecodeError\n    m.def(\"bad_utf32_string\", [=]() { return std::u32string({a32, char32_t(0xd800), z32}); });\n    if (sizeof(wchar_t) == 2) {\n        m.def(\"bad_wchar_string\", [=]() {\n            return std::wstring({wchar_t(0x61), wchar_t(0xd800)});\n        });\n    }\n    m.def(\"u8_Z\", []() -> char { return 'Z'; });\n    m.def(\"u8_eacute\", []() -> char { return '\\xe9'; });\n    m.def(\"u16_ibang\", [=]() -> char16_t { return ib16; });\n    m.def(\"u32_mathbfA\", [=]() -> char32_t { return mathbfA32; });\n    m.def(\"wchar_heart\", []() -> wchar_t { return 0x2665; });\n\n    // test_single_char_arguments\n    m.attr(\"wchar_size\") = py::cast(sizeof(wchar_t));\n    m.def(\"ord_char\", [](char c) -> int { return static_cast<unsigned char>(c); });\n    m.def(\"ord_char_lv\", [](char &c) -> int { return static_cast<unsigned char>(c); });\n    m.def(\"ord_char16\", [](char16_t c) -> uint16_t { return c; });\n    m.def(\"ord_char16_lv\", [](char16_t &c) -> uint16_t { return c; });\n    m.def(\"ord_char32\", [](char32_t c) -> uint32_t { return c; });\n    m.def(\"ord_wchar\", [](wchar_t c) -> int { return c; });\n\n    // test_bytes_to_string\n    m.def(\"strlen\", [](char *s) { return strlen(s); });\n    m.def(\"string_length\", [](const std::string &s) { return s.length(); });\n\n#ifdef PYBIND11_HAS_U8STRING\n    m.attr(\"has_u8string\") = true;\n    m.def(\"good_utf8_u8string\", []() {\n        return std::u8string(u8\"Say utf8\\u203d \\U0001f382 \\U0001d400\");\n    }); // Say utf8‽ 🎂 𝐀\n    m.def(\"bad_utf8_u8string\", []() {\n        return std::u8string((const char8_t *) \"abc\\xd0\"\n                                               \"def\");\n    });\n\n    m.def(\"u8_char8_Z\", []() -> char8_t { return u8'Z'; });\n\n    // test_single_char_arguments\n    m.def(\"ord_char8\", [](char8_t c) -> int { return static_cast<unsigned char>(c); });\n    m.def(\"ord_char8_lv\", [](char8_t &c) -> int { return static_cast<unsigned char>(c); });\n#endif\n\n    // test_string_view\n#ifdef PYBIND11_HAS_STRING_VIEW\n    m.attr(\"has_string_view\") = true;\n    m.def(\"string_view_print\", [](std::string_view s) { py::print(s, s.size()); });\n    m.def(\"string_view16_print\", [](std::u16string_view s) { py::print(s, s.size()); });\n    m.def(\"string_view32_print\", [](std::u32string_view s) { py::print(s, s.size()); });\n    m.def(\"string_view_chars\", [](std::string_view s) {\n        py::list l;\n        for (auto c : s) {\n            l.append((std::uint8_t) c);\n        }\n        return l;\n    });\n    m.def(\"string_view16_chars\", [](std::u16string_view s) {\n        py::list l;\n        for (auto c : s) {\n            l.append((int) c);\n        }\n        return l;\n    });\n    m.def(\"string_view32_chars\", [](std::u32string_view s) {\n        py::list l;\n        for (auto c : s) {\n            l.append((int) c);\n        }\n        return l;\n    });\n    m.def(\"string_view_return\",\n          []() { return std::string_view((const char *) u8\"utf8 secret \\U0001f382\"); });\n    m.def(\"string_view16_return\",\n          []() { return std::u16string_view(u\"utf16 secret \\U0001f382\"); });\n    m.def(\"string_view32_return\",\n          []() { return std::u32string_view(U\"utf32 secret \\U0001f382\"); });\n\n    // The inner lambdas here are to also test implicit conversion\n    using namespace std::literals;\n    m.def(\"string_view_bytes\",\n          []() { return [](py::bytes b) { return b; }(\"abc \\x80\\x80 def\"sv); });\n    m.def(\"string_view_str\",\n          []() { return [](py::str s) { return s; }(\"abc \\342\\200\\275 def\"sv); });\n    m.def(\"string_view_from_bytes\",\n          [](const py::bytes &b) { return [](std::string_view s) { return s; }(b); });\n    m.def(\"string_view_memoryview\", []() {\n        static constexpr auto val = \"Have some \\360\\237\\216\\202\"sv;\n        return py::memoryview::from_memory(val);\n    });\n\n#    ifdef PYBIND11_HAS_U8STRING\n    m.def(\"string_view8_print\", [](std::u8string_view s) { py::print(s, s.size()); });\n    m.def(\"string_view8_chars\", [](std::u8string_view s) {\n        py::list l;\n        for (auto c : s)\n            l.append((std::uint8_t) c);\n        return l;\n    });\n    m.def(\"string_view8_return\", []() { return std::u8string_view(u8\"utf8 secret \\U0001f382\"); });\n    m.def(\"string_view8_str\", []() { return py::str{std::u8string_view{u8\"abc ‽ def\"}}; });\n#    endif\n\n    struct TypeWithBothOperatorStringAndStringView {\n        // NOLINTNEXTLINE(google-explicit-constructor)\n        operator std::string() const { return \"success\"; }\n        // NOLINTNEXTLINE(google-explicit-constructor)\n        operator std::string_view() const { return \"failure\"; }\n    };\n    m.def(\"bytes_from_type_with_both_operator_string_and_string_view\",\n          []() { return py::bytes(TypeWithBothOperatorStringAndStringView()); });\n    m.def(\"str_from_type_with_both_operator_string_and_string_view\",\n          []() { return py::str(TypeWithBothOperatorStringAndStringView()); });\n#endif\n\n    // test_integer_casting\n    m.def(\"i32_str\", [](std::int32_t v) { return std::to_string(v); });\n    m.def(\"u32_str\", [](std::uint32_t v) { return std::to_string(v); });\n    m.def(\"i64_str\", [](std::int64_t v) { return std::to_string(v); });\n    m.def(\"u64_str\", [](std::uint64_t v) { return std::to_string(v); });\n\n    // test_int_convert\n    m.def(\"int_passthrough\", [](int arg) { return arg; });\n    m.def(\n        \"int_passthrough_noconvert\", [](int arg) { return arg; }, py::arg{}.noconvert());\n\n    // test_tuple\n    m.def(\n        \"pair_passthrough\",\n        [](const std::pair<bool, std::string> &input) {\n            return std::make_pair(input.second, input.first);\n        },\n        \"Return a pair in reversed order\");\n    m.def(\n        \"tuple_passthrough\",\n        [](std::tuple<bool, std::string, int> input) {\n            return std::make_tuple(std::get<2>(input), std::get<1>(input), std::get<0>(input));\n        },\n        \"Return a triple in reversed order\");\n    m.def(\"empty_tuple\", []() { return std::tuple<>(); });\n    static std::pair<RValueCaster, RValueCaster> lvpair;\n    static std::tuple<RValueCaster, RValueCaster, RValueCaster> lvtuple;\n    static std::pair<RValueCaster, std::tuple<RValueCaster, std::pair<RValueCaster, RValueCaster>>>\n        lvnested;\n    m.def(\"rvalue_pair\", []() { return std::make_pair(RValueCaster{}, RValueCaster{}); });\n    m.def(\"lvalue_pair\", []() -> const decltype(lvpair) & { return lvpair; });\n    m.def(\"rvalue_tuple\",\n          []() { return std::make_tuple(RValueCaster{}, RValueCaster{}, RValueCaster{}); });\n    m.def(\"lvalue_tuple\", []() -> const decltype(lvtuple) & { return lvtuple; });\n    m.def(\"rvalue_nested\", []() {\n        return std::make_pair(\n            RValueCaster{},\n            std::make_tuple(RValueCaster{}, std::make_pair(RValueCaster{}, RValueCaster{})));\n    });\n    m.def(\"lvalue_nested\", []() -> const decltype(lvnested) & { return lvnested; });\n\n    m.def(\n        \"int_string_pair\",\n        []() {\n            // Using no-destructor idiom to side-step warnings from overzealous compilers.\n            static auto *int_string_pair = new std::pair<int, std::string>{2, \"items\"};\n            return int_string_pair;\n        },\n        py::return_value_policy::reference);\n\n    // test_builtins_cast_return_none\n    m.def(\"return_none_string\", []() -> std::string * { return nullptr; });\n    m.def(\"return_none_char\", []() -> const char * { return nullptr; });\n    m.def(\"return_none_bool\", []() -> bool * { return nullptr; });\n    m.def(\"return_none_int\", []() -> int * { return nullptr; });\n    m.def(\"return_none_float\", []() -> float * { return nullptr; });\n    m.def(\"return_none_pair\", []() -> std::pair<int, int> * { return nullptr; });\n\n    // test_none_deferred\n    m.def(\"defer_none_cstring\", [](char *) { return false; });\n    m.def(\"defer_none_cstring\", [](const py::none &) { return true; });\n    m.def(\"defer_none_custom\", [](UserType *) { return false; });\n    m.def(\"defer_none_custom\", [](const py::none &) { return true; });\n    m.def(\"nodefer_none_void\", [](void *) { return true; });\n    m.def(\"nodefer_none_void\", [](const py::none &) { return false; });\n\n    // test_void_caster\n    m.def(\"load_nullptr_t\", [](std::nullptr_t) {}); // not useful, but it should still compile\n    m.def(\"cast_nullptr_t\", []() { return std::nullptr_t{}; });\n\n    // [workaround(intel)] ICC 20/21 breaks with py::arg().stuff, using py::arg{}.stuff works.\n\n    // test_bool_caster\n    m.def(\"bool_passthrough\", [](bool arg) { return arg; });\n    m.def(\n        \"bool_passthrough_noconvert\", [](bool arg) { return arg; }, py::arg{}.noconvert());\n\n    // TODO: This should be disabled and fixed in future Intel compilers\n#if !defined(__INTEL_COMPILER)\n    // Test \"bool_passthrough_noconvert\" again, but using () instead of {} to construct py::arg\n    // When compiled with the Intel compiler, this results in segmentation faults when importing\n    // the module. Tested with icc (ICC) 2021.1 Beta 20200827, this should be tested again when\n    // a newer version of icc is available.\n    m.def(\n        \"bool_passthrough_noconvert2\", [](bool arg) { return arg; }, py::arg().noconvert());\n#endif\n\n    // test_reference_wrapper\n    m.def(\"refwrap_builtin\", [](std::reference_wrapper<int> p) { return 10 * p.get(); });\n    m.def(\"refwrap_usertype\", [](std::reference_wrapper<UserType> p) { return p.get().value(); });\n    m.def(\"refwrap_usertype_const\",\n          [](std::reference_wrapper<const UserType> p) { return p.get().value(); });\n\n    m.def(\"refwrap_lvalue\", []() -> std::reference_wrapper<UserType> {\n        static UserType x(1);\n        return std::ref(x);\n    });\n    m.def(\"refwrap_lvalue_const\", []() -> std::reference_wrapper<const UserType> {\n        static UserType x(1);\n        return std::cref(x);\n    });\n\n    // Not currently supported (std::pair caster has return-by-value cast operator);\n    // triggers static_assert failure.\n    // m.def(\"refwrap_pair\", [](std::reference_wrapper<std::pair<int, int>>) { });\n\n    m.def(\n        \"refwrap_list\",\n        [](bool copy) {\n            static IncType x1(1), x2(2);\n            py::list l;\n            for (const auto &f : {std::ref(x1), std::ref(x2)}) {\n                l.append(py::cast(\n                    f, copy ? py::return_value_policy::copy : py::return_value_policy::reference));\n            }\n            return l;\n        },\n        \"copy\"_a);\n\n    m.def(\"refwrap_iiw\", [](const IncType &w) { return w.value(); });\n    m.def(\"refwrap_call_iiw\", [](IncType &w, const py::function &f) {\n        py::list l;\n        l.append(f(std::ref(w)));\n        l.append(f(std::cref(w)));\n        IncType x(w.value());\n        l.append(f(std::ref(x)));\n        IncType y(w.value());\n        auto r3 = std::ref(y);\n        l.append(f(r3));\n        return l;\n    });\n\n    // test_complex\n    m.def(\"complex_cast\", [](float x) { return \"{}\"_s.format(x); });\n    m.def(\"complex_cast\",\n          [](std::complex<float> x) { return \"({}, {})\"_s.format(x.real(), x.imag()); });\n\n    // test int vs. long (Python 2)\n    m.def(\"int_cast\", []() { return (int) 42; });\n    m.def(\"long_cast\", []() { return (long) 42; });\n    m.def(\"longlong_cast\", []() { return ULLONG_MAX; });\n\n    /// test void* cast operator\n    m.def(\"test_void_caster\", []() -> bool {\n        void *v = (void *) 0xabcd;\n        py::object o = py::cast(v);\n        return py::cast<void *>(o) == v;\n    });\n\n    // Tests const/non-const propagation in cast_op.\n    m.def(\"takes\", [](ConstRefCasted x) { return x.tag; });\n    m.def(\"takes_move\", [](ConstRefCasted &&x) { return x.tag; });\n    m.def(\"takes_ptr\", [](ConstRefCasted *x) { return x->tag; });\n    m.def(\"takes_ref\", [](ConstRefCasted &x) { return x.tag; });\n    m.def(\"takes_ref_wrap\", [](std::reference_wrapper<ConstRefCasted> x) { return x.get().tag; });\n    m.def(\"takes_const_ptr\", [](const ConstRefCasted *x) { return x->tag; });\n    m.def(\"takes_const_ref\", [](const ConstRefCasted &x) { return x.tag; });\n    m.def(\"takes_const_ref_wrap\",\n          [](std::reference_wrapper<const ConstRefCasted> x) { return x.get().tag; });\n\n    PYBIND11_WARNING_POP\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_builtin_casters.py",
    "content": "import sys\n\nimport pytest\n\nimport env\nfrom pybind11_tests import IncType, UserType\nfrom pybind11_tests import builtin_casters as m\n\n\ndef test_simple_string():\n    assert m.string_roundtrip(\"const char *\") == \"const char *\"\n\n\ndef test_unicode_conversion():\n    \"\"\"Tests unicode conversion and error reporting.\"\"\"\n    assert m.good_utf8_string() == \"Say utf8‽ 🎂 𝐀\"\n    assert m.good_utf16_string() == \"b‽🎂𝐀z\"\n    assert m.good_utf32_string() == \"a𝐀🎂‽z\"\n    assert m.good_wchar_string() == \"a⸘𝐀z\"\n    if hasattr(m, \"has_u8string\"):\n        assert m.good_utf8_u8string() == \"Say utf8‽ 🎂 𝐀\"\n\n    with pytest.raises(UnicodeDecodeError):\n        m.bad_utf8_string()\n\n    with pytest.raises(UnicodeDecodeError):\n        m.bad_utf16_string()\n\n    # These are provided only if they actually fail (they don't when 32-bit)\n    if hasattr(m, \"bad_utf32_string\"):\n        with pytest.raises(UnicodeDecodeError):\n            m.bad_utf32_string()\n    if hasattr(m, \"bad_wchar_string\"):\n        with pytest.raises(UnicodeDecodeError):\n            m.bad_wchar_string()\n    if hasattr(m, \"has_u8string\"):\n        with pytest.raises(UnicodeDecodeError):\n            m.bad_utf8_u8string()\n\n    assert m.u8_Z() == \"Z\"\n    assert m.u8_eacute() == \"é\"\n    assert m.u16_ibang() == \"‽\"\n    assert m.u32_mathbfA() == \"𝐀\"\n    assert m.wchar_heart() == \"♥\"\n    if hasattr(m, \"has_u8string\"):\n        assert m.u8_char8_Z() == \"Z\"\n\n\ndef test_single_char_arguments():\n    \"\"\"Tests failures for passing invalid inputs to char-accepting functions\"\"\"\n\n    def toobig_message(r):\n        return f\"Character code point not in range({r:#x})\"\n\n    toolong_message = \"Expected a character, but multi-character string found\"\n\n    assert m.ord_char(\"a\") == 0x61  # simple ASCII\n    assert m.ord_char_lv(\"b\") == 0x62\n    assert (\n        m.ord_char(\"é\") == 0xE9\n    )  # requires 2 bytes in utf-8, but can be stuffed in a char\n    with pytest.raises(ValueError) as excinfo:\n        assert m.ord_char(\"Ā\") == 0x100  # requires 2 bytes, doesn't fit in a char\n    assert str(excinfo.value) == toobig_message(0x100)\n    with pytest.raises(ValueError) as excinfo:\n        assert m.ord_char(\"ab\")\n    assert str(excinfo.value) == toolong_message\n\n    assert m.ord_char16(\"a\") == 0x61\n    assert m.ord_char16(\"é\") == 0xE9\n    assert m.ord_char16_lv(\"ê\") == 0xEA\n    assert m.ord_char16(\"Ā\") == 0x100\n    assert m.ord_char16(\"‽\") == 0x203D\n    assert m.ord_char16(\"♥\") == 0x2665\n    assert m.ord_char16_lv(\"♡\") == 0x2661\n    with pytest.raises(ValueError) as excinfo:\n        assert m.ord_char16(\"🎂\") == 0x1F382  # requires surrogate pair\n    assert str(excinfo.value) == toobig_message(0x10000)\n    with pytest.raises(ValueError) as excinfo:\n        assert m.ord_char16(\"aa\")\n    assert str(excinfo.value) == toolong_message\n\n    assert m.ord_char32(\"a\") == 0x61\n    assert m.ord_char32(\"é\") == 0xE9\n    assert m.ord_char32(\"Ā\") == 0x100\n    assert m.ord_char32(\"‽\") == 0x203D\n    assert m.ord_char32(\"♥\") == 0x2665\n    assert m.ord_char32(\"🎂\") == 0x1F382\n    with pytest.raises(ValueError) as excinfo:\n        assert m.ord_char32(\"aa\")\n    assert str(excinfo.value) == toolong_message\n\n    assert m.ord_wchar(\"a\") == 0x61\n    assert m.ord_wchar(\"é\") == 0xE9\n    assert m.ord_wchar(\"Ā\") == 0x100\n    assert m.ord_wchar(\"‽\") == 0x203D\n    assert m.ord_wchar(\"♥\") == 0x2665\n    if m.wchar_size == 2:\n        with pytest.raises(ValueError) as excinfo:\n            assert m.ord_wchar(\"🎂\") == 0x1F382  # requires surrogate pair\n        assert str(excinfo.value) == toobig_message(0x10000)\n    else:\n        assert m.ord_wchar(\"🎂\") == 0x1F382\n    with pytest.raises(ValueError) as excinfo:\n        assert m.ord_wchar(\"aa\")\n    assert str(excinfo.value) == toolong_message\n\n    if hasattr(m, \"has_u8string\"):\n        assert m.ord_char8(\"a\") == 0x61  # simple ASCII\n        assert m.ord_char8_lv(\"b\") == 0x62\n        assert (\n            m.ord_char8(\"é\") == 0xE9\n        )  # requires 2 bytes in utf-8, but can be stuffed in a char\n        with pytest.raises(ValueError) as excinfo:\n            assert m.ord_char8(\"Ā\") == 0x100  # requires 2 bytes, doesn't fit in a char\n        assert str(excinfo.value) == toobig_message(0x100)\n        with pytest.raises(ValueError) as excinfo:\n            assert m.ord_char8(\"ab\")\n        assert str(excinfo.value) == toolong_message\n\n\ndef test_bytes_to_string():\n    \"\"\"Tests the ability to pass bytes to C++ string-accepting functions.  Note that this is\n    one-way: the only way to return bytes to Python is via the pybind11::bytes class.\"\"\"\n    # Issue #816\n\n    assert m.strlen(b\"hi\") == 2\n    assert m.string_length(b\"world\") == 5\n    assert m.string_length(\"a\\x00b\".encode()) == 3\n    assert m.strlen(\"a\\x00b\".encode()) == 1  # C-string limitation\n\n    # passing in a utf8 encoded string should work\n    assert m.string_length(\"💩\".encode()) == 4\n\n\ndef test_bytearray_to_string():\n    \"\"\"Tests the ability to pass bytearray to C++ string-accepting functions\"\"\"\n    assert m.string_length(bytearray(b\"Hi\")) == 2\n    assert m.strlen(bytearray(b\"bytearray\")) == 9\n    assert m.string_length(bytearray()) == 0\n    assert m.string_length(bytearray(\"🦜\", \"utf-8\", \"strict\")) == 4\n    assert m.string_length(bytearray(b\"\\x80\")) == 1\n\n\n@pytest.mark.skipif(not hasattr(m, \"has_string_view\"), reason=\"no <string_view>\")\ndef test_string_view(capture):\n    \"\"\"Tests support for C++17 string_view arguments and return values\"\"\"\n    assert m.string_view_chars(\"Hi\") == [72, 105]\n    assert m.string_view_chars(\"Hi 🎂\") == [72, 105, 32, 0xF0, 0x9F, 0x8E, 0x82]\n    assert m.string_view16_chars(\"Hi 🎂\") == [72, 105, 32, 0xD83C, 0xDF82]\n    assert m.string_view32_chars(\"Hi 🎂\") == [72, 105, 32, 127874]\n    if hasattr(m, \"has_u8string\"):\n        assert m.string_view8_chars(\"Hi\") == [72, 105]\n        assert m.string_view8_chars(\"Hi 🎂\") == [72, 105, 32, 0xF0, 0x9F, 0x8E, 0x82]\n\n    assert m.string_view_return() == \"utf8 secret 🎂\"\n    assert m.string_view16_return() == \"utf16 secret 🎂\"\n    assert m.string_view32_return() == \"utf32 secret 🎂\"\n    if hasattr(m, \"has_u8string\"):\n        assert m.string_view8_return() == \"utf8 secret 🎂\"\n\n    with capture:\n        m.string_view_print(\"Hi\")\n        m.string_view_print(\"utf8 🎂\")\n        m.string_view16_print(\"utf16 🎂\")\n        m.string_view32_print(\"utf32 🎂\")\n    assert (\n        capture\n        == \"\"\"\n        Hi 2\n        utf8 🎂 9\n        utf16 🎂 8\n        utf32 🎂 7\n    \"\"\"\n    )\n    if hasattr(m, \"has_u8string\"):\n        with capture:\n            m.string_view8_print(\"Hi\")\n            m.string_view8_print(\"utf8 🎂\")\n        assert (\n            capture\n            == \"\"\"\n            Hi 2\n            utf8 🎂 9\n        \"\"\"\n        )\n\n    with capture:\n        m.string_view_print(\"Hi, ascii\")\n        m.string_view_print(\"Hi, utf8 🎂\")\n        m.string_view16_print(\"Hi, utf16 🎂\")\n        m.string_view32_print(\"Hi, utf32 🎂\")\n    assert (\n        capture\n        == \"\"\"\n        Hi, ascii 9\n        Hi, utf8 🎂 13\n        Hi, utf16 🎂 12\n        Hi, utf32 🎂 11\n    \"\"\"\n    )\n    if hasattr(m, \"has_u8string\"):\n        with capture:\n            m.string_view8_print(\"Hi, ascii\")\n            m.string_view8_print(\"Hi, utf8 🎂\")\n        assert (\n            capture\n            == \"\"\"\n            Hi, ascii 9\n            Hi, utf8 🎂 13\n        \"\"\"\n        )\n\n    assert m.string_view_bytes() == b\"abc \\x80\\x80 def\"\n    assert m.string_view_str() == \"abc ‽ def\"\n    assert m.string_view_from_bytes(\"abc ‽ def\".encode()) == \"abc ‽ def\"\n    if hasattr(m, \"has_u8string\"):\n        assert m.string_view8_str() == \"abc ‽ def\"\n    assert m.string_view_memoryview() == \"Have some 🎂\".encode()\n\n    assert m.bytes_from_type_with_both_operator_string_and_string_view() == b\"success\"\n    assert m.str_from_type_with_both_operator_string_and_string_view() == \"success\"\n\n\ndef test_integer_casting():\n    \"\"\"Issue #929 - out-of-range integer values shouldn't be accepted\"\"\"\n    assert m.i32_str(-1) == \"-1\"\n    assert m.i64_str(-1) == \"-1\"\n    assert m.i32_str(2000000000) == \"2000000000\"\n    assert m.u32_str(2000000000) == \"2000000000\"\n    assert m.i64_str(-999999999999) == \"-999999999999\"\n    assert m.u64_str(999999999999) == \"999999999999\"\n\n    with pytest.raises(TypeError) as excinfo:\n        m.u32_str(-1)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.u64_str(-1)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.i32_str(-3000000000)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.i32_str(3000000000)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n\ndef test_int_convert():\n    class Int:\n        def __int__(self):\n            return 42\n\n    class NotInt:\n        pass\n\n    class Float:\n        def __float__(self):\n            return 41.99999\n\n    class Index:\n        def __index__(self):\n            return 42\n\n    class IntAndIndex:\n        def __int__(self):\n            return 42\n\n        def __index__(self):\n            return 0\n\n    class RaisingTypeErrorOnIndex:\n        def __index__(self):\n            raise TypeError\n\n        def __int__(self):\n            return 42\n\n    class RaisingValueErrorOnIndex:\n        def __index__(self):\n            raise ValueError\n\n        def __int__(self):\n            return 42\n\n    convert, noconvert = m.int_passthrough, m.int_passthrough_noconvert\n\n    def requires_conversion(v):\n        pytest.raises(TypeError, noconvert, v)\n\n    def cant_convert(v):\n        pytest.raises(TypeError, convert, v)\n\n    assert convert(7) == 7\n    assert noconvert(7) == 7\n    cant_convert(3.14159)\n    # TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)\n    # TODO: PyPy 3.8 does not behave like CPython 3.8 here yet (7.3.7)\n    if (3, 8) <= sys.version_info < (3, 10) and env.CPYTHON:\n        with env.deprecated_call():\n            assert convert(Int()) == 42\n    else:\n        assert convert(Int()) == 42\n    requires_conversion(Int())\n    cant_convert(NotInt())\n    cant_convert(Float())\n\n    # Before Python 3.8, `PyLong_AsLong` does not pick up on `obj.__index__`,\n    # but pybind11 \"backports\" this behavior.\n    assert convert(Index()) == 42\n    assert noconvert(Index()) == 42\n    assert convert(IntAndIndex()) == 0  # Fishy; `int(DoubleThought)` == 42\n    assert noconvert(IntAndIndex()) == 0\n    assert convert(RaisingTypeErrorOnIndex()) == 42\n    requires_conversion(RaisingTypeErrorOnIndex())\n    assert convert(RaisingValueErrorOnIndex()) == 42\n    requires_conversion(RaisingValueErrorOnIndex())\n\n\ndef test_numpy_int_convert():\n    np = pytest.importorskip(\"numpy\")\n\n    convert, noconvert = m.int_passthrough, m.int_passthrough_noconvert\n\n    def require_implicit(v):\n        pytest.raises(TypeError, noconvert, v)\n\n    # `np.intc` is an alias that corresponds to a C++ `int`\n    assert convert(np.intc(42)) == 42\n    assert noconvert(np.intc(42)) == 42\n\n    # The implicit conversion from np.float32 is undesirable but currently accepted.\n    # TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)\n    # TODO: PyPy 3.8 does not behave like CPython 3.8 here yet (7.3.7)\n    # https://github.com/pybind/pybind11/issues/3408\n    if (3, 8) <= sys.version_info < (3, 10) and env.CPYTHON:\n        with env.deprecated_call():\n            assert convert(np.float32(3.14159)) == 3\n    else:\n        assert convert(np.float32(3.14159)) == 3\n    require_implicit(np.float32(3.14159))\n\n\ndef test_tuple(doc):\n    \"\"\"std::pair <-> tuple & std::tuple <-> tuple\"\"\"\n    assert m.pair_passthrough((True, \"test\")) == (\"test\", True)\n    assert m.tuple_passthrough((True, \"test\", 5)) == (5, \"test\", True)\n    # Any sequence can be cast to a std::pair or std::tuple\n    assert m.pair_passthrough([True, \"test\"]) == (\"test\", True)\n    assert m.tuple_passthrough([True, \"test\", 5]) == (5, \"test\", True)\n    assert m.empty_tuple() == ()\n\n    assert (\n        doc(m.pair_passthrough)\n        == \"\"\"\n        pair_passthrough(arg0: Tuple[bool, str]) -> Tuple[str, bool]\n\n        Return a pair in reversed order\n    \"\"\"\n    )\n    assert (\n        doc(m.tuple_passthrough)\n        == \"\"\"\n        tuple_passthrough(arg0: Tuple[bool, str, int]) -> Tuple[int, str, bool]\n\n        Return a triple in reversed order\n    \"\"\"\n    )\n\n    assert m.rvalue_pair() == (\"rvalue\", \"rvalue\")\n    assert m.lvalue_pair() == (\"lvalue\", \"lvalue\")\n    assert m.rvalue_tuple() == (\"rvalue\", \"rvalue\", \"rvalue\")\n    assert m.lvalue_tuple() == (\"lvalue\", \"lvalue\", \"lvalue\")\n    assert m.rvalue_nested() == (\"rvalue\", (\"rvalue\", (\"rvalue\", \"rvalue\")))\n    assert m.lvalue_nested() == (\"lvalue\", (\"lvalue\", (\"lvalue\", \"lvalue\")))\n\n    assert m.int_string_pair() == (2, \"items\")\n\n\ndef test_builtins_cast_return_none():\n    \"\"\"Casters produced with PYBIND11_TYPE_CASTER() should convert nullptr to None\"\"\"\n    assert m.return_none_string() is None\n    assert m.return_none_char() is None\n    assert m.return_none_bool() is None\n    assert m.return_none_int() is None\n    assert m.return_none_float() is None\n    assert m.return_none_pair() is None\n\n\ndef test_none_deferred():\n    \"\"\"None passed as various argument types should defer to other overloads\"\"\"\n    assert not m.defer_none_cstring(\"abc\")\n    assert m.defer_none_cstring(None)\n    assert not m.defer_none_custom(UserType())\n    assert m.defer_none_custom(None)\n    assert m.nodefer_none_void(None)\n\n\ndef test_void_caster():\n    assert m.load_nullptr_t(None) is None\n    assert m.cast_nullptr_t() is None\n\n\ndef test_reference_wrapper():\n    \"\"\"std::reference_wrapper for builtin and user types\"\"\"\n    assert m.refwrap_builtin(42) == 420\n    assert m.refwrap_usertype(UserType(42)) == 42\n    assert m.refwrap_usertype_const(UserType(42)) == 42\n\n    with pytest.raises(TypeError) as excinfo:\n        m.refwrap_builtin(None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.refwrap_usertype(None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    assert m.refwrap_lvalue().value == 1\n    assert m.refwrap_lvalue_const().value == 1\n\n    a1 = m.refwrap_list(copy=True)\n    a2 = m.refwrap_list(copy=True)\n    assert [x.value for x in a1] == [2, 3]\n    assert [x.value for x in a2] == [2, 3]\n    assert not a1[0] is a2[0] and not a1[1] is a2[1]\n\n    b1 = m.refwrap_list(copy=False)\n    b2 = m.refwrap_list(copy=False)\n    assert [x.value for x in b1] == [1, 2]\n    assert [x.value for x in b2] == [1, 2]\n    assert b1[0] is b2[0] and b1[1] is b2[1]\n\n    assert m.refwrap_iiw(IncType(5)) == 5\n    assert m.refwrap_call_iiw(IncType(10), m.refwrap_iiw) == [10, 10, 10, 10]\n\n\ndef test_complex_cast():\n    \"\"\"std::complex casts\"\"\"\n    assert m.complex_cast(1) == \"1.0\"\n    assert m.complex_cast(2j) == \"(0.0, 2.0)\"\n\n\ndef test_bool_caster():\n    \"\"\"Test bool caster implicit conversions.\"\"\"\n    convert, noconvert = m.bool_passthrough, m.bool_passthrough_noconvert\n\n    def require_implicit(v):\n        pytest.raises(TypeError, noconvert, v)\n\n    def cant_convert(v):\n        pytest.raises(TypeError, convert, v)\n\n    # straight up bool\n    assert convert(True) is True\n    assert convert(False) is False\n    assert noconvert(True) is True\n    assert noconvert(False) is False\n\n    # None requires implicit conversion\n    require_implicit(None)\n    assert convert(None) is False\n\n    class A:\n        def __init__(self, x):\n            self.x = x\n\n        def __nonzero__(self):\n            return self.x\n\n        def __bool__(self):\n            return self.x\n\n    class B:\n        pass\n\n    # Arbitrary objects are not accepted\n    cant_convert(object())\n    cant_convert(B())\n\n    # Objects with __nonzero__ / __bool__ defined can be converted\n    require_implicit(A(True))\n    assert convert(A(True)) is True\n    assert convert(A(False)) is False\n\n\ndef test_numpy_bool():\n    np = pytest.importorskip(\"numpy\")\n\n    convert, noconvert = m.bool_passthrough, m.bool_passthrough_noconvert\n\n    def cant_convert(v):\n        pytest.raises(TypeError, convert, v)\n\n    # np.bool_ is not considered implicit\n    assert convert(np.bool_(True)) is True\n    assert convert(np.bool_(False)) is False\n    assert noconvert(np.bool_(True)) is True\n    assert noconvert(np.bool_(False)) is False\n    cant_convert(np.zeros(2, dtype=\"int\"))\n\n\ndef test_int_long():\n    assert isinstance(m.int_cast(), int)\n    assert isinstance(m.long_cast(), int)\n    assert isinstance(m.longlong_cast(), int)\n\n\ndef test_void_caster_2():\n    assert m.test_void_caster()\n\n\ndef test_const_ref_caster():\n    \"\"\"Verifies that const-ref is propagated through type_caster cast_op.\n    The returned ConstRefCasted type is a minimal type that is constructed to\n    reference the casting mode used.\n    \"\"\"\n    x = False\n    assert m.takes(x) == 1\n    assert m.takes_move(x) == 1\n\n    assert m.takes_ptr(x) == 3\n    assert m.takes_ref(x) == 2\n    assert m.takes_ref_wrap(x) == 2\n\n    assert m.takes_const_ptr(x) == 5\n    assert m.takes_const_ref(x) == 4\n    assert m.takes_const_ref_wrap(x) == 4\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_call_policies.cpp",
    "content": "/*\n    tests/test_call_policies.cpp -- keep_alive and call_guard\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"pybind11_tests.h\"\n\nstruct CustomGuard {\n    static bool enabled;\n\n    CustomGuard() { enabled = true; }\n    ~CustomGuard() { enabled = false; }\n\n    static const char *report_status() { return enabled ? \"guarded\" : \"unguarded\"; }\n};\nbool CustomGuard::enabled = false;\n\nstruct DependentGuard {\n    static bool enabled;\n\n    DependentGuard() { enabled = CustomGuard::enabled; }\n    ~DependentGuard() { enabled = false; }\n\n    static const char *report_status() { return enabled ? \"guarded\" : \"unguarded\"; }\n};\nbool DependentGuard::enabled = false;\n\nTEST_SUBMODULE(call_policies, m) {\n    // Parent/Child are used in:\n    // test_keep_alive_argument, test_keep_alive_return_value, test_alive_gc_derived,\n    // test_alive_gc_multi_derived, test_return_none, test_keep_alive_constructor\n    class Child {\n    public:\n        Child() { py::print(\"Allocating child.\"); }\n        Child(const Child &) = default;\n        Child(Child &&) = default;\n        ~Child() { py::print(\"Releasing child.\"); }\n    };\n    py::class_<Child>(m, \"Child\").def(py::init<>());\n\n    class Parent {\n    public:\n        Parent() { py::print(\"Allocating parent.\"); }\n        Parent(const Parent &parent) = default;\n        ~Parent() { py::print(\"Releasing parent.\"); }\n        void addChild(Child *) {}\n        Child *returnChild() { return new Child(); }\n        Child *returnNullChild() { return nullptr; }\n        static Child *staticFunction(Parent *) { return new Child(); }\n    };\n    py::class_<Parent>(m, \"Parent\")\n        .def(py::init<>())\n        .def(py::init([](Child *) { return new Parent(); }), py::keep_alive<1, 2>())\n        .def(\"addChild\", &Parent::addChild)\n        .def(\"addChildKeepAlive\", &Parent::addChild, py::keep_alive<1, 2>())\n        .def(\"returnChild\", &Parent::returnChild)\n        .def(\"returnChildKeepAlive\", &Parent::returnChild, py::keep_alive<1, 0>())\n        .def(\"returnNullChildKeepAliveChild\", &Parent::returnNullChild, py::keep_alive<1, 0>())\n        .def(\"returnNullChildKeepAliveParent\", &Parent::returnNullChild, py::keep_alive<0, 1>())\n        .def_static(\"staticFunction\", &Parent::staticFunction, py::keep_alive<1, 0>());\n\n    m.def(\n        \"free_function\", [](Parent *, Child *) {}, py::keep_alive<1, 2>());\n    m.def(\n        \"invalid_arg_index\", [] {}, py::keep_alive<0, 1>());\n\n#if !defined(PYPY_VERSION)\n    // test_alive_gc\n    class ParentGC : public Parent {\n    public:\n        using Parent::Parent;\n    };\n    py::class_<ParentGC, Parent>(m, \"ParentGC\", py::dynamic_attr()).def(py::init<>());\n#endif\n\n    // test_call_guard\n    m.def(\"unguarded_call\", &CustomGuard::report_status);\n    m.def(\"guarded_call\", &CustomGuard::report_status, py::call_guard<CustomGuard>());\n\n    m.def(\n        \"multiple_guards_correct_order\",\n        []() {\n            return CustomGuard::report_status() + std::string(\" & \")\n                   + DependentGuard::report_status();\n        },\n        py::call_guard<CustomGuard, DependentGuard>());\n\n    m.def(\n        \"multiple_guards_wrong_order\",\n        []() {\n            return DependentGuard::report_status() + std::string(\" & \")\n                   + CustomGuard::report_status();\n        },\n        py::call_guard<DependentGuard, CustomGuard>());\n\n#if defined(WITH_THREAD) && !defined(PYPY_VERSION)\n    // `py::call_guard<py::gil_scoped_release>()` should work in PyPy as well,\n    // but it's unclear how to test it without `PyGILState_GetThisThreadState`.\n    auto report_gil_status = []() {\n        auto is_gil_held = false;\n        if (auto *tstate = py::detail::get_thread_state_unchecked()) {\n            is_gil_held = (tstate == PyGILState_GetThisThreadState());\n        }\n\n        return is_gil_held ? \"GIL held\" : \"GIL released\";\n    };\n\n    m.def(\"with_gil\", report_gil_status);\n    m.def(\"without_gil\", report_gil_status, py::call_guard<py::gil_scoped_release>());\n#endif\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_call_policies.py",
    "content": "import pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import ConstructorStats\nfrom pybind11_tests import call_policies as m\n\n\n@pytest.mark.xfail(\"env.PYPY\", reason=\"sometimes comes out 1 off on PyPy\", strict=False)\ndef test_keep_alive_argument(capture):\n    n_inst = ConstructorStats.detail_reg_inst()\n    with capture:\n        p = m.Parent()\n    assert capture == \"Allocating parent.\"\n    with capture:\n        p.addChild(m.Child())\n        assert ConstructorStats.detail_reg_inst() == n_inst + 1\n    assert (\n        capture\n        == \"\"\"\n        Allocating child.\n        Releasing child.\n    \"\"\"\n    )\n    with capture:\n        del p\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert capture == \"Releasing parent.\"\n\n    with capture:\n        p = m.Parent()\n    assert capture == \"Allocating parent.\"\n    with capture:\n        p.addChildKeepAlive(m.Child())\n        assert ConstructorStats.detail_reg_inst() == n_inst + 2\n    assert capture == \"Allocating child.\"\n    with capture:\n        del p\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert (\n        capture\n        == \"\"\"\n        Releasing parent.\n        Releasing child.\n    \"\"\"\n    )\n\n    p = m.Parent()\n    c = m.Child()\n    assert ConstructorStats.detail_reg_inst() == n_inst + 2\n    m.free_function(p, c)\n    del c\n    assert ConstructorStats.detail_reg_inst() == n_inst + 2\n    del p\n    assert ConstructorStats.detail_reg_inst() == n_inst\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.invalid_arg_index()\n    assert str(excinfo.value) == \"Could not activate keep_alive!\"\n\n\ndef test_keep_alive_return_value(capture):\n    n_inst = ConstructorStats.detail_reg_inst()\n    with capture:\n        p = m.Parent()\n    assert capture == \"Allocating parent.\"\n    with capture:\n        p.returnChild()\n        assert ConstructorStats.detail_reg_inst() == n_inst + 1\n    assert (\n        capture\n        == \"\"\"\n        Allocating child.\n        Releasing child.\n    \"\"\"\n    )\n    with capture:\n        del p\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert capture == \"Releasing parent.\"\n\n    with capture:\n        p = m.Parent()\n    assert capture == \"Allocating parent.\"\n    with capture:\n        p.returnChildKeepAlive()\n        assert ConstructorStats.detail_reg_inst() == n_inst + 2\n    assert capture == \"Allocating child.\"\n    with capture:\n        del p\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert (\n        capture\n        == \"\"\"\n        Releasing parent.\n        Releasing child.\n    \"\"\"\n    )\n\n    p = m.Parent()\n    assert ConstructorStats.detail_reg_inst() == n_inst + 1\n    with capture:\n        m.Parent.staticFunction(p)\n        assert ConstructorStats.detail_reg_inst() == n_inst + 2\n    assert capture == \"Allocating child.\"\n    with capture:\n        del p\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert (\n        capture\n        == \"\"\"\n        Releasing parent.\n        Releasing child.\n    \"\"\"\n    )\n\n\n# https://foss.heptapod.net/pypy/pypy/-/issues/2447\n@pytest.mark.xfail(\"env.PYPY\", reason=\"_PyObject_GetDictPtr is unimplemented\")\ndef test_alive_gc(capture):\n    n_inst = ConstructorStats.detail_reg_inst()\n    p = m.ParentGC()\n    p.addChildKeepAlive(m.Child())\n    assert ConstructorStats.detail_reg_inst() == n_inst + 2\n    lst = [p]\n    lst.append(lst)  # creates a circular reference\n    with capture:\n        del p, lst\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert (\n        capture\n        == \"\"\"\n        Releasing parent.\n        Releasing child.\n    \"\"\"\n    )\n\n\ndef test_alive_gc_derived(capture):\n    class Derived(m.Parent):\n        pass\n\n    n_inst = ConstructorStats.detail_reg_inst()\n    p = Derived()\n    p.addChildKeepAlive(m.Child())\n    assert ConstructorStats.detail_reg_inst() == n_inst + 2\n    lst = [p]\n    lst.append(lst)  # creates a circular reference\n    with capture:\n        del p, lst\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert (\n        capture\n        == \"\"\"\n        Releasing parent.\n        Releasing child.\n    \"\"\"\n    )\n\n\ndef test_alive_gc_multi_derived(capture):\n    class Derived(m.Parent, m.Child):\n        def __init__(self):\n            m.Parent.__init__(self)\n            m.Child.__init__(self)\n\n    n_inst = ConstructorStats.detail_reg_inst()\n    p = Derived()\n    p.addChildKeepAlive(m.Child())\n    # +3 rather than +2 because Derived corresponds to two registered instances\n    assert ConstructorStats.detail_reg_inst() == n_inst + 3\n    lst = [p]\n    lst.append(lst)  # creates a circular reference\n    with capture:\n        del p, lst\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert (\n        capture\n        == \"\"\"\n        Releasing parent.\n        Releasing child.\n        Releasing child.\n    \"\"\"\n    )\n\n\ndef test_return_none(capture):\n    n_inst = ConstructorStats.detail_reg_inst()\n    with capture:\n        p = m.Parent()\n    assert capture == \"Allocating parent.\"\n    with capture:\n        p.returnNullChildKeepAliveChild()\n        assert ConstructorStats.detail_reg_inst() == n_inst + 1\n    assert capture == \"\"\n    with capture:\n        del p\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert capture == \"Releasing parent.\"\n\n    with capture:\n        p = m.Parent()\n    assert capture == \"Allocating parent.\"\n    with capture:\n        p.returnNullChildKeepAliveParent()\n        assert ConstructorStats.detail_reg_inst() == n_inst + 1\n    assert capture == \"\"\n    with capture:\n        del p\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert capture == \"Releasing parent.\"\n\n\ndef test_keep_alive_constructor(capture):\n    n_inst = ConstructorStats.detail_reg_inst()\n\n    with capture:\n        p = m.Parent(m.Child())\n        assert ConstructorStats.detail_reg_inst() == n_inst + 2\n    assert (\n        capture\n        == \"\"\"\n        Allocating child.\n        Allocating parent.\n    \"\"\"\n    )\n    with capture:\n        del p\n        assert ConstructorStats.detail_reg_inst() == n_inst\n    assert (\n        capture\n        == \"\"\"\n        Releasing parent.\n        Releasing child.\n    \"\"\"\n    )\n\n\ndef test_call_guard():\n    assert m.unguarded_call() == \"unguarded\"\n    assert m.guarded_call() == \"guarded\"\n\n    assert m.multiple_guards_correct_order() == \"guarded & guarded\"\n    assert m.multiple_guards_wrong_order() == \"unguarded & guarded\"\n\n    if hasattr(m, \"with_gil\"):\n        assert m.with_gil() == \"GIL held\"\n        assert m.without_gil() == \"GIL released\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_callbacks.cpp",
    "content": "/*\n    tests/test_callbacks.cpp -- callbacks\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/functional.h>\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\n#include <thread>\n\nint dummy_function(int i) { return i + 1; }\n\nTEST_SUBMODULE(callbacks, m) {\n    // test_callbacks, test_function_signatures\n    m.def(\"test_callback1\", [](const py::object &func) { return func(); });\n    m.def(\"test_callback2\", [](const py::object &func) { return func(\"Hello\", 'x', true, 5); });\n    m.def(\"test_callback3\", [](const std::function<int(int)> &func) {\n        return \"func(43) = \" + std::to_string(func(43));\n    });\n    m.def(\"test_callback4\",\n          []() -> std::function<int(int)> { return [](int i) { return i + 1; }; });\n    m.def(\"test_callback5\",\n          []() { return py::cpp_function([](int i) { return i + 1; }, py::arg(\"number\")); });\n\n    // test_keyword_args_and_generalized_unpacking\n    m.def(\"test_tuple_unpacking\", [](const py::function &f) {\n        auto t1 = py::make_tuple(2, 3);\n        auto t2 = py::make_tuple(5, 6);\n        return f(\"positional\", 1, *t1, 4, *t2);\n    });\n\n    m.def(\"test_dict_unpacking\", [](const py::function &f) {\n        auto d1 = py::dict(\"key\"_a = \"value\", \"a\"_a = 1);\n        auto d2 = py::dict();\n        auto d3 = py::dict(\"b\"_a = 2);\n        return f(\"positional\", 1, **d1, **d2, **d3);\n    });\n\n    m.def(\"test_keyword_args\", [](const py::function &f) { return f(\"x\"_a = 10, \"y\"_a = 20); });\n\n    m.def(\"test_unpacking_and_keywords1\", [](const py::function &f) {\n        auto args = py::make_tuple(2);\n        auto kwargs = py::dict(\"d\"_a = 4);\n        return f(1, *args, \"c\"_a = 3, **kwargs);\n    });\n\n    m.def(\"test_unpacking_and_keywords2\", [](const py::function &f) {\n        auto kwargs1 = py::dict(\"a\"_a = 1);\n        auto kwargs2 = py::dict(\"c\"_a = 3, \"d\"_a = 4);\n        return f(\"positional\",\n                 *py::make_tuple(1),\n                 2,\n                 *py::make_tuple(3, 4),\n                 5,\n                 \"key\"_a = \"value\",\n                 **kwargs1,\n                 \"b\"_a = 2,\n                 **kwargs2,\n                 \"e\"_a = 5);\n    });\n\n    m.def(\"test_unpacking_error1\", [](const py::function &f) {\n        auto kwargs = py::dict(\"x\"_a = 3);\n        return f(\"x\"_a = 1, \"y\"_a = 2, **kwargs); // duplicate ** after keyword\n    });\n\n    m.def(\"test_unpacking_error2\", [](const py::function &f) {\n        auto kwargs = py::dict(\"x\"_a = 3);\n        return f(**kwargs, \"x\"_a = 1); // duplicate keyword after **\n    });\n\n    m.def(\"test_arg_conversion_error1\",\n          [](const py::function &f) { f(234, UnregisteredType(), \"kw\"_a = 567); });\n\n    m.def(\"test_arg_conversion_error2\", [](const py::function &f) {\n        f(234, \"expected_name\"_a = UnregisteredType(), \"kw\"_a = 567);\n    });\n\n    // test_lambda_closure_cleanup\n    struct Payload {\n        Payload() { print_default_created(this); }\n        ~Payload() { print_destroyed(this); }\n        Payload(const Payload &) { print_copy_created(this); }\n        Payload(Payload &&) noexcept { print_move_created(this); }\n    };\n    // Export the payload constructor statistics for testing purposes:\n    m.def(\"payload_cstats\", &ConstructorStats::get<Payload>);\n    m.def(\"test_lambda_closure_cleanup\", []() -> std::function<void()> {\n        Payload p;\n\n        // In this situation, `Func` in the implementation of\n        // `cpp_function::initialize` is NOT trivially destructible.\n        return [p]() {\n            /* p should be cleaned up when the returned function is garbage collected */\n            (void) p;\n        };\n    });\n\n    class CppCallable {\n    public:\n        CppCallable() { track_default_created(this); }\n        ~CppCallable() { track_destroyed(this); }\n        CppCallable(const CppCallable &) { track_copy_created(this); }\n        CppCallable(CppCallable &&) noexcept { track_move_created(this); }\n        void operator()() {}\n    };\n\n    m.def(\"test_cpp_callable_cleanup\", []() {\n        // Related issue: https://github.com/pybind/pybind11/issues/3228\n        // Related PR: https://github.com/pybind/pybind11/pull/3229\n        py::list alive_counts;\n        ConstructorStats &stat = ConstructorStats::get<CppCallable>();\n        alive_counts.append(stat.alive());\n        {\n            CppCallable cpp_callable;\n            alive_counts.append(stat.alive());\n            {\n                // In this situation, `Func` in the implementation of\n                // `cpp_function::initialize` IS trivially destructible,\n                // only `capture` is not.\n                py::cpp_function py_func(cpp_callable);\n                py::detail::silence_unused_warnings(py_func);\n                alive_counts.append(stat.alive());\n            }\n            alive_counts.append(stat.alive());\n            {\n                py::cpp_function py_func(std::move(cpp_callable));\n                py::detail::silence_unused_warnings(py_func);\n                alive_counts.append(stat.alive());\n            }\n            alive_counts.append(stat.alive());\n        }\n        alive_counts.append(stat.alive());\n        return alive_counts;\n    });\n\n    // test_cpp_function_roundtrip\n    /* Test if passing a function pointer from C++ -> Python -> C++ yields the original pointer */\n    m.def(\"dummy_function\", &dummy_function);\n    m.def(\"dummy_function_overloaded\", [](int i, int j) { return i + j; });\n    m.def(\"dummy_function_overloaded\", &dummy_function);\n    m.def(\"dummy_function2\", [](int i, int j) { return i + j; });\n    m.def(\n        \"roundtrip\",\n        [](std::function<int(int)> f, bool expect_none = false) {\n            if (expect_none && f) {\n                throw std::runtime_error(\"Expected None to be converted to empty std::function\");\n            }\n            return f;\n        },\n        py::arg(\"f\"),\n        py::arg(\"expect_none\") = false);\n    m.def(\"test_dummy_function\", [](const std::function<int(int)> &f) -> std::string {\n        using fn_type = int (*)(int);\n        const auto *result = f.target<fn_type>();\n        if (!result) {\n            auto r = f(1);\n            return \"can't convert to function pointer: eval(1) = \" + std::to_string(r);\n        }\n        if (*result == dummy_function) {\n            auto r = (*result)(1);\n            return \"matches dummy_function: eval(1) = \" + std::to_string(r);\n        }\n        return \"argument does NOT match dummy_function. This should never happen!\";\n    });\n\n    class AbstractBase {\n    public:\n        // [workaround(intel)] = default does not work here\n        // Defaulting this destructor results in linking errors with the Intel compiler\n        // (in Debug builds only, tested with icpc (ICC) 2021.1 Beta 20200827)\n        virtual ~AbstractBase() {} // NOLINT(modernize-use-equals-default)\n        virtual unsigned int func() = 0;\n    };\n    m.def(\"func_accepting_func_accepting_base\",\n          [](const std::function<double(AbstractBase &)> &) {});\n\n    struct MovableObject {\n        bool valid = true;\n\n        MovableObject() = default;\n        MovableObject(const MovableObject &) = default;\n        MovableObject &operator=(const MovableObject &) = default;\n        MovableObject(MovableObject &&o) noexcept : valid(o.valid) { o.valid = false; }\n        MovableObject &operator=(MovableObject &&o) noexcept {\n            valid = o.valid;\n            o.valid = false;\n            return *this;\n        }\n    };\n    py::class_<MovableObject>(m, \"MovableObject\");\n\n    // test_movable_object\n    m.def(\"callback_with_movable\", [](const std::function<void(MovableObject &)> &f) {\n        auto x = MovableObject();\n        f(x);           // lvalue reference shouldn't move out object\n        return x.valid; // must still return `true`\n    });\n\n    // test_bound_method_callback\n    struct CppBoundMethodTest {};\n    py::class_<CppBoundMethodTest>(m, \"CppBoundMethodTest\")\n        .def(py::init<>())\n        .def(\"triple\", [](CppBoundMethodTest &, int val) { return 3 * val; });\n\n    // This checks that builtin functions can be passed as callbacks\n    // rather than throwing RuntimeError due to trying to extract as capsule\n    m.def(\"test_sum_builtin\",\n          [](const std::function<double(py::iterable)> &sum_builtin, const py::iterable &i) {\n              return sum_builtin(i);\n          });\n\n    // test async Python callbacks\n    using callback_f = std::function<void(int)>;\n    m.def(\"test_async_callback\", [](const callback_f &f, const py::list &work) {\n        // make detached thread that calls `f` with piece of work after a little delay\n        auto start_f = [f](int j) {\n            auto invoke_f = [f, j] {\n                std::this_thread::sleep_for(std::chrono::milliseconds(50));\n                f(j);\n            };\n            auto t = std::thread(std::move(invoke_f));\n            t.detach();\n        };\n\n        // spawn worker threads\n        for (auto i : work) {\n            start_f(py::cast<int>(i));\n        }\n    });\n\n    m.def(\"callback_num_times\", [](const py::function &f, std::size_t num) {\n        for (std::size_t i = 0; i < num; i++) {\n            f();\n        }\n    });\n\n    auto *custom_def = []() {\n        static PyMethodDef def;\n        def.ml_name = \"example_name\";\n        def.ml_doc = \"Example doc\";\n        def.ml_meth = [](PyObject *, PyObject *args) -> PyObject * {\n            if (PyTuple_Size(args) != 1) {\n                throw std::runtime_error(\"Invalid number of arguments for example_name\");\n            }\n            PyObject *first = PyTuple_GetItem(args, 0);\n            if (!PyLong_Check(first)) {\n                throw std::runtime_error(\"Invalid argument to example_name\");\n            }\n            auto result = py::cast(PyLong_AsLong(first) * 9);\n            return result.release().ptr();\n        };\n        def.ml_flags = METH_VARARGS;\n        return &def;\n    }();\n\n    // rec_capsule with name that has the same value (but not pointer) as our internal one\n    // This capsule should be detected by our code as foreign and not inspected as the pointers\n    // shouldn't match\n    constexpr const char *rec_capsule_name\n        = pybind11::detail::internals_function_record_capsule_name;\n    py::capsule rec_capsule(std::malloc(1), [](void *data) { std::free(data); });\n    rec_capsule.set_name(rec_capsule_name);\n    m.add_object(\"custom_function\", PyCFunction_New(custom_def, rec_capsule.ptr()));\n\n    // This test requires a new ABI version to pass\n#if PYBIND11_INTERNALS_VERSION > 4\n    // rec_capsule with nullptr name\n    py::capsule rec_capsule2(std::malloc(1), [](void *data) { std::free(data); });\n    m.add_object(\"custom_function2\", PyCFunction_New(custom_def, rec_capsule2.ptr()));\n#else\n    m.add_object(\"custom_function2\", py::none());\n#endif\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_callbacks.py",
    "content": "import time\nfrom threading import Thread\n\nimport pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import callbacks as m\n\n\ndef test_callbacks():\n    from functools import partial\n\n    def func1():\n        return \"func1\"\n\n    def func2(a, b, c, d):\n        return \"func2\", a, b, c, d\n\n    def func3(a):\n        return f\"func3({a})\"\n\n    assert m.test_callback1(func1) == \"func1\"\n    assert m.test_callback2(func2) == (\"func2\", \"Hello\", \"x\", True, 5)\n    assert m.test_callback1(partial(func2, 1, 2, 3, 4)) == (\"func2\", 1, 2, 3, 4)\n    assert m.test_callback1(partial(func3, \"partial\")) == \"func3(partial)\"\n    assert m.test_callback3(lambda i: i + 1) == \"func(43) = 44\"\n\n    f = m.test_callback4()\n    assert f(43) == 44\n    f = m.test_callback5()\n    assert f(number=43) == 44\n\n\ndef test_bound_method_callback():\n    # Bound Python method:\n    class MyClass:\n        def double(self, val):\n            return 2 * val\n\n    z = MyClass()\n    assert m.test_callback3(z.double) == \"func(43) = 86\"\n\n    z = m.CppBoundMethodTest()\n    assert m.test_callback3(z.triple) == \"func(43) = 129\"\n\n\ndef test_keyword_args_and_generalized_unpacking():\n    def f(*args, **kwargs):\n        return args, kwargs\n\n    assert m.test_tuple_unpacking(f) == ((\"positional\", 1, 2, 3, 4, 5, 6), {})\n    assert m.test_dict_unpacking(f) == (\n        (\"positional\", 1),\n        {\"key\": \"value\", \"a\": 1, \"b\": 2},\n    )\n    assert m.test_keyword_args(f) == ((), {\"x\": 10, \"y\": 20})\n    assert m.test_unpacking_and_keywords1(f) == ((1, 2), {\"c\": 3, \"d\": 4})\n    assert m.test_unpacking_and_keywords2(f) == (\n        (\"positional\", 1, 2, 3, 4, 5),\n        {\"key\": \"value\", \"a\": 1, \"b\": 2, \"c\": 3, \"d\": 4, \"e\": 5},\n    )\n\n    with pytest.raises(TypeError) as excinfo:\n        m.test_unpacking_error1(f)\n    assert \"Got multiple values for keyword argument\" in str(excinfo.value)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.test_unpacking_error2(f)\n    assert \"Got multiple values for keyword argument\" in str(excinfo.value)\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.test_arg_conversion_error1(f)\n    assert \"Unable to convert call argument\" in str(excinfo.value)\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.test_arg_conversion_error2(f)\n    assert \"Unable to convert call argument\" in str(excinfo.value)\n\n\ndef test_lambda_closure_cleanup():\n    m.test_lambda_closure_cleanup()\n    cstats = m.payload_cstats()\n    assert cstats.alive() == 0\n    assert cstats.copy_constructions == 1\n    assert cstats.move_constructions >= 1\n\n\ndef test_cpp_callable_cleanup():\n    alive_counts = m.test_cpp_callable_cleanup()\n    assert alive_counts == [0, 1, 2, 1, 2, 1, 0]\n\n\ndef test_cpp_function_roundtrip():\n    \"\"\"Test if passing a function pointer from C++ -> Python -> C++ yields the original pointer\"\"\"\n\n    assert (\n        m.test_dummy_function(m.dummy_function) == \"matches dummy_function: eval(1) = 2\"\n    )\n    assert (\n        m.test_dummy_function(m.roundtrip(m.dummy_function))\n        == \"matches dummy_function: eval(1) = 2\"\n    )\n    assert (\n        m.test_dummy_function(m.dummy_function_overloaded)\n        == \"matches dummy_function: eval(1) = 2\"\n    )\n    assert m.roundtrip(None, expect_none=True) is None\n    assert (\n        m.test_dummy_function(lambda x: x + 2)\n        == \"can't convert to function pointer: eval(1) = 3\"\n    )\n\n    with pytest.raises(TypeError) as excinfo:\n        m.test_dummy_function(m.dummy_function2)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.test_dummy_function(lambda x, y: x + y)\n    assert any(\n        s in str(excinfo.value)\n        for s in (\"missing 1 required positional argument\", \"takes exactly 2 arguments\")\n    )\n\n\ndef test_function_signatures(doc):\n    assert doc(m.test_callback3) == \"test_callback3(arg0: Callable[[int], int]) -> str\"\n    assert doc(m.test_callback4) == \"test_callback4() -> Callable[[int], int]\"\n\n\ndef test_movable_object():\n    assert m.callback_with_movable(lambda _: None) is True\n\n\n@pytest.mark.skipif(\n    \"env.PYPY\",\n    reason=\"PyPy segfaults on here. See discussion on #1413.\",\n)\ndef test_python_builtins():\n    \"\"\"Test if python builtins like sum() can be used as callbacks\"\"\"\n    assert m.test_sum_builtin(sum, [1, 2, 3]) == 6\n    assert m.test_sum_builtin(sum, []) == 0\n\n\ndef test_async_callbacks():\n    # serves as state for async callback\n    class Item:\n        def __init__(self, value):\n            self.value = value\n\n    res = []\n\n    # generate stateful lambda that will store result in `res`\n    def gen_f():\n        s = Item(3)\n        return lambda j: res.append(s.value + j)\n\n    # do some work async\n    work = [1, 2, 3, 4]\n    m.test_async_callback(gen_f(), work)\n    # wait until work is done\n    from time import sleep\n\n    sleep(0.5)\n    assert sum(res) == sum(x + 3 for x in work)\n\n\ndef test_async_async_callbacks():\n    t = Thread(target=test_async_callbacks)\n    t.start()\n    t.join()\n\n\ndef test_callback_num_times():\n    # Super-simple micro-benchmarking related to PR #2919.\n    # Example runtimes (Intel Xeon 2.2GHz, fully optimized):\n    #   num_millions  1, repeats  2:  0.1 secs\n    #   num_millions 20, repeats 10: 11.5 secs\n    one_million = 1000000\n    num_millions = 1  # Try 20 for actual micro-benchmarking.\n    repeats = 2  # Try 10.\n    rates = []\n    for rep in range(repeats):\n        t0 = time.time()\n        m.callback_num_times(lambda: None, num_millions * one_million)\n        td = time.time() - t0\n        rate = num_millions / td if td else 0\n        rates.append(rate)\n        if not rep:\n            print()\n        print(\n            f\"callback_num_times: {num_millions:d} million / {td:.3f} seconds = {rate:.3f} million / second\"\n        )\n    if len(rates) > 1:\n        print(\"Min    Mean   Max\")\n        print(f\"{min(rates):6.3f} {sum(rates) / len(rates):6.3f} {max(rates):6.3f}\")\n\n\ndef test_custom_func():\n    assert m.custom_function(4) == 36\n    assert m.roundtrip(m.custom_function)(4) == 36\n\n\n@pytest.mark.skipif(\n    m.custom_function2 is None, reason=\"Current PYBIND11_INTERNALS_VERSION too low\"\n)\ndef test_custom_func2():\n    assert m.custom_function2(3) == 27\n    assert m.roundtrip(m.custom_function2)(3) == 27\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_chrono.cpp",
    "content": "/*\n    tests/test_chrono.cpp -- test conversions to/from std::chrono types\n\n    Copyright (c) 2016 Trent Houliston <trent@houliston.me> and\n                       Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/chrono.h>\n\n#include \"pybind11_tests.h\"\n\n#include <chrono>\n\nstruct different_resolutions {\n    using time_point_h = std::chrono::time_point<std::chrono::system_clock, std::chrono::hours>;\n    using time_point_m = std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>;\n    using time_point_s = std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;\n    using time_point_ms\n        = std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>;\n    using time_point_us\n        = std::chrono::time_point<std::chrono::system_clock, std::chrono::microseconds>;\n    time_point_h timestamp_h;\n    time_point_m timestamp_m;\n    time_point_s timestamp_s;\n    time_point_ms timestamp_ms;\n    time_point_us timestamp_us;\n};\n\nTEST_SUBMODULE(chrono, m) {\n    using system_time = std::chrono::system_clock::time_point;\n    using steady_time = std::chrono::steady_clock::time_point;\n\n    using timespan = std::chrono::duration<int64_t, std::nano>;\n    using timestamp = std::chrono::time_point<std::chrono::system_clock, timespan>;\n\n    // test_chrono_system_clock\n    // Return the current time off the wall clock\n    m.def(\"test_chrono1\", []() { return std::chrono::system_clock::now(); });\n\n    // test_chrono_system_clock_roundtrip\n    // Round trip the passed in system clock time\n    m.def(\"test_chrono2\", [](system_time t) { return t; });\n\n    // test_chrono_duration_roundtrip\n    // Round trip the passed in duration\n    m.def(\"test_chrono3\", [](std::chrono::system_clock::duration d) { return d; });\n\n    // test_chrono_duration_subtraction_equivalence\n    // Difference between two passed in time_points\n    m.def(\"test_chrono4\", [](system_time a, system_time b) { return a - b; });\n\n    // test_chrono_steady_clock\n    // Return the current time off the steady_clock\n    m.def(\"test_chrono5\", []() { return std::chrono::steady_clock::now(); });\n\n    // test_chrono_steady_clock_roundtrip\n    // Round trip a steady clock timepoint\n    m.def(\"test_chrono6\", [](steady_time t) { return t; });\n\n    // test_floating_point_duration\n    // Roundtrip a duration in microseconds from a float argument\n    m.def(\"test_chrono7\", [](std::chrono::microseconds t) { return t; });\n    // Float durations (issue #719)\n    m.def(\"test_chrono_float_diff\",\n          [](std::chrono::duration<float> a, std::chrono::duration<float> b) { return a - b; });\n\n    m.def(\"test_nano_timepoint\",\n          [](timestamp start, timespan delta) -> timestamp { return start + delta; });\n\n    // Test different resolutions\n    py::class_<different_resolutions>(m, \"different_resolutions\")\n        .def(py::init<>())\n        .def_readwrite(\"timestamp_h\", &different_resolutions::timestamp_h)\n        .def_readwrite(\"timestamp_m\", &different_resolutions::timestamp_m)\n        .def_readwrite(\"timestamp_s\", &different_resolutions::timestamp_s)\n        .def_readwrite(\"timestamp_ms\", &different_resolutions::timestamp_ms)\n        .def_readwrite(\"timestamp_us\", &different_resolutions::timestamp_us);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_chrono.py",
    "content": "import datetime\n\nimport pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import chrono as m\n\n\ndef test_chrono_system_clock():\n    # Get the time from both c++ and datetime\n    date0 = datetime.datetime.today()\n    date1 = m.test_chrono1()\n    date2 = datetime.datetime.today()\n\n    # The returned value should be a datetime\n    assert isinstance(date1, datetime.datetime)\n\n    # The numbers should vary by a very small amount (time it took to execute)\n    diff_python = abs(date2 - date0)\n    diff = abs(date1 - date2)\n\n    # There should never be a days difference\n    assert diff.days == 0\n\n    # Since datetime.datetime.today() calls time.time(), and on some platforms\n    # that has 1 second accuracy, we compare this way\n    assert diff.seconds <= diff_python.seconds\n\n\ndef test_chrono_system_clock_roundtrip():\n    date1 = datetime.datetime.today()\n\n    # Roundtrip the time\n    date2 = m.test_chrono2(date1)\n\n    # The returned value should be a datetime\n    assert isinstance(date2, datetime.datetime)\n\n    # They should be identical (no information lost on roundtrip)\n    diff = abs(date1 - date2)\n    assert diff == datetime.timedelta(0)\n\n\ndef test_chrono_system_clock_roundtrip_date():\n    date1 = datetime.date.today()\n\n    # Roundtrip the time\n    datetime2 = m.test_chrono2(date1)\n    date2 = datetime2.date()\n    time2 = datetime2.time()\n\n    # The returned value should be a datetime\n    assert isinstance(datetime2, datetime.datetime)\n    assert isinstance(date2, datetime.date)\n    assert isinstance(time2, datetime.time)\n\n    # They should be identical (no information lost on roundtrip)\n    diff = abs(date1 - date2)\n    assert diff.days == 0\n    assert diff.seconds == 0\n    assert diff.microseconds == 0\n\n    # Year, Month & Day should be the same after the round trip\n    assert date1 == date2\n\n    # There should be no time information\n    assert time2.hour == 0\n    assert time2.minute == 0\n    assert time2.second == 0\n    assert time2.microsecond == 0\n\n\nSKIP_TZ_ENV_ON_WIN = pytest.mark.skipif(\n    \"env.WIN\", reason=\"TZ environment variable only supported on POSIX\"\n)\n\n\n@pytest.mark.parametrize(\n    \"time1\",\n    [\n        datetime.datetime.today().time(),\n        datetime.time(0, 0, 0),\n        datetime.time(0, 0, 0, 1),\n        datetime.time(0, 28, 45, 109827),\n        datetime.time(0, 59, 59, 999999),\n        datetime.time(1, 0, 0),\n        datetime.time(5, 59, 59, 0),\n        datetime.time(5, 59, 59, 1),\n    ],\n)\n@pytest.mark.parametrize(\n    \"tz\",\n    [\n        None,\n        pytest.param(\"Europe/Brussels\", marks=SKIP_TZ_ENV_ON_WIN),\n        pytest.param(\"Asia/Pyongyang\", marks=SKIP_TZ_ENV_ON_WIN),\n        pytest.param(\"America/New_York\", marks=SKIP_TZ_ENV_ON_WIN),\n    ],\n)\ndef test_chrono_system_clock_roundtrip_time(time1, tz, monkeypatch):\n    if tz is not None:\n        monkeypatch.setenv(\"TZ\", f\"/usr/share/zoneinfo/{tz}\")\n\n    # Roundtrip the time\n    datetime2 = m.test_chrono2(time1)\n    date2 = datetime2.date()\n    time2 = datetime2.time()\n\n    # The returned value should be a datetime\n    assert isinstance(datetime2, datetime.datetime)\n    assert isinstance(date2, datetime.date)\n    assert isinstance(time2, datetime.time)\n\n    # Hour, Minute, Second & Microsecond should be the same after the round trip\n    assert time1 == time2\n\n    # There should be no date information (i.e. date = python base date)\n    assert date2.year == 1970\n    assert date2.month == 1\n    assert date2.day == 1\n\n\ndef test_chrono_duration_roundtrip():\n    # Get the difference between two times (a timedelta)\n    date1 = datetime.datetime.today()\n    date2 = datetime.datetime.today()\n    diff = date2 - date1\n\n    # Make sure this is a timedelta\n    assert isinstance(diff, datetime.timedelta)\n\n    cpp_diff = m.test_chrono3(diff)\n\n    assert cpp_diff == diff\n\n    # Negative timedelta roundtrip\n    diff = datetime.timedelta(microseconds=-1)\n    cpp_diff = m.test_chrono3(diff)\n\n    assert cpp_diff == diff\n\n\ndef test_chrono_duration_subtraction_equivalence():\n    date1 = datetime.datetime.today()\n    date2 = datetime.datetime.today()\n\n    diff = date2 - date1\n    cpp_diff = m.test_chrono4(date2, date1)\n\n    assert cpp_diff == diff\n\n\ndef test_chrono_duration_subtraction_equivalence_date():\n    date1 = datetime.date.today()\n    date2 = datetime.date.today()\n\n    diff = date2 - date1\n    cpp_diff = m.test_chrono4(date2, date1)\n\n    assert cpp_diff == diff\n\n\ndef test_chrono_steady_clock():\n    time1 = m.test_chrono5()\n    assert isinstance(time1, datetime.timedelta)\n\n\ndef test_chrono_steady_clock_roundtrip():\n    time1 = datetime.timedelta(days=10, seconds=10, microseconds=100)\n    time2 = m.test_chrono6(time1)\n\n    assert isinstance(time2, datetime.timedelta)\n\n    # They should be identical (no information lost on roundtrip)\n    assert time1 == time2\n\n\ndef test_floating_point_duration():\n    # Test using a floating point number in seconds\n    time = m.test_chrono7(35.525123)\n\n    assert isinstance(time, datetime.timedelta)\n\n    assert time.seconds == 35\n    assert 525122 <= time.microseconds <= 525123\n\n    diff = m.test_chrono_float_diff(43.789012, 1.123456)\n    assert diff.seconds == 42\n    assert 665556 <= diff.microseconds <= 665557\n\n\ndef test_nano_timepoint():\n    time = datetime.datetime.now()\n    time1 = m.test_nano_timepoint(time, datetime.timedelta(seconds=60))\n    assert time1 == time + datetime.timedelta(seconds=60)\n\n\ndef test_chrono_different_resolutions():\n    resolutions = m.different_resolutions()\n    time = datetime.datetime.now()\n    resolutions.timestamp_h = time\n    resolutions.timestamp_m = time\n    resolutions.timestamp_s = time\n    resolutions.timestamp_ms = time\n    resolutions.timestamp_us = time\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_class.cpp",
    "content": "/*\n    tests/test_class.cpp -- test py::class_ definitions and basic functionality\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#if defined(__INTEL_COMPILER) && __cplusplus >= 201703L\n// Intel compiler requires a separate header file to support aligned new operators\n// and does not set the __cpp_aligned_new feature macro.\n// This header needs to be included before pybind11.\n#    include <aligned_new>\n#endif\n\n#include <pybind11/stl.h>\n\n#include \"constructor_stats.h\"\n#include \"local_bindings.h\"\n#include \"pybind11_tests.h\"\n\n#include <utility>\n\nPYBIND11_WARNING_DISABLE_MSVC(4324)\n//     warning C4324: structure was padded due to alignment specifier\n\n// test_brace_initialization\nstruct NoBraceInitialization {\n    explicit NoBraceInitialization(std::vector<int> v) : vec{std::move(v)} {}\n    template <typename T>\n    NoBraceInitialization(std::initializer_list<T> l) : vec(l) {}\n\n    std::vector<int> vec;\n};\n\nnamespace test_class {\nnamespace pr4220_tripped_over_this { // PR #4227\n\ntemplate <int>\nstruct SoEmpty {};\n\ntemplate <typename T>\nstd::string get_msg(const T &) {\n    return \"This is really only meant to exercise successful compilation.\";\n}\n\nusing Empty0 = SoEmpty<0x0>;\n\nvoid bind_empty0(py::module_ &m) {\n    py::class_<Empty0>(m, \"Empty0\").def(py::init<>()).def(\"get_msg\", get_msg<Empty0>);\n}\n\n} // namespace pr4220_tripped_over_this\n} // namespace test_class\n\nTEST_SUBMODULE(class_, m) {\n    m.def(\"obj_class_name\", [](py::handle obj) { return py::detail::obj_class_name(obj.ptr()); });\n\n    // test_instance\n    struct NoConstructor {\n        NoConstructor() = default;\n        NoConstructor(const NoConstructor &) = default;\n        NoConstructor(NoConstructor &&) = default;\n        static NoConstructor *new_instance() {\n            auto *ptr = new NoConstructor();\n            print_created(ptr, \"via new_instance\");\n            return ptr;\n        }\n        ~NoConstructor() { print_destroyed(this); }\n    };\n    struct NoConstructorNew {\n        NoConstructorNew() = default;\n        NoConstructorNew(const NoConstructorNew &) = default;\n        NoConstructorNew(NoConstructorNew &&) = default;\n        static NoConstructorNew *new_instance() {\n            auto *ptr = new NoConstructorNew();\n            print_created(ptr, \"via new_instance\");\n            return ptr;\n        }\n        ~NoConstructorNew() { print_destroyed(this); }\n    };\n\n    py::class_<NoConstructor>(m, \"NoConstructor\")\n        .def_static(\"new_instance\", &NoConstructor::new_instance, \"Return an instance\");\n\n    py::class_<NoConstructorNew>(m, \"NoConstructorNew\")\n        .def(py::init([](const NoConstructorNew &self) { return self; })) // Need a NOOP __init__\n        .def_static(\"__new__\",\n                    [](const py::object &) { return NoConstructorNew::new_instance(); });\n\n    // test_inheritance\n    class Pet {\n    public:\n        Pet(const std::string &name, const std::string &species)\n            : m_name(name), m_species(species) {}\n        std::string name() const { return m_name; }\n        std::string species() const { return m_species; }\n\n    private:\n        std::string m_name;\n        std::string m_species;\n    };\n\n    class Dog : public Pet {\n    public:\n        explicit Dog(const std::string &name) : Pet(name, \"dog\") {}\n        std::string bark() const { return \"Woof!\"; }\n    };\n\n    class Rabbit : public Pet {\n    public:\n        explicit Rabbit(const std::string &name) : Pet(name, \"parrot\") {}\n    };\n\n    class Hamster : public Pet {\n    public:\n        explicit Hamster(const std::string &name) : Pet(name, \"rodent\") {}\n    };\n\n    class Chimera : public Pet {\n        Chimera() : Pet(\"Kimmy\", \"chimera\") {}\n    };\n\n    py::class_<Pet> pet_class(m, \"Pet\");\n    pet_class.def(py::init<std::string, std::string>())\n        .def(\"name\", &Pet::name)\n        .def(\"species\", &Pet::species);\n\n    /* One way of declaring a subclass relationship: reference parent's class_ object */\n    py::class_<Dog>(m, \"Dog\", pet_class).def(py::init<std::string>());\n\n    /* Another way of declaring a subclass relationship: reference parent's C++ type */\n    py::class_<Rabbit, Pet>(m, \"Rabbit\").def(py::init<std::string>());\n\n    /* And another: list parent in class template arguments */\n    py::class_<Hamster, Pet>(m, \"Hamster\").def(py::init<std::string>());\n\n    /* Constructors are not inherited by default */\n    py::class_<Chimera, Pet>(m, \"Chimera\");\n\n    m.def(\"pet_name_species\",\n          [](const Pet &pet) { return pet.name() + \" is a \" + pet.species(); });\n    m.def(\"dog_bark\", [](const Dog &dog) { return dog.bark(); });\n\n    // test_automatic_upcasting\n    struct BaseClass {\n        BaseClass() = default;\n        BaseClass(const BaseClass &) = default;\n        BaseClass(BaseClass &&) = default;\n        virtual ~BaseClass() = default;\n    };\n    struct DerivedClass1 : BaseClass {};\n    struct DerivedClass2 : BaseClass {};\n\n    py::class_<BaseClass>(m, \"BaseClass\").def(py::init<>());\n    py::class_<DerivedClass1>(m, \"DerivedClass1\").def(py::init<>());\n    py::class_<DerivedClass2>(m, \"DerivedClass2\").def(py::init<>());\n\n    m.def(\"return_class_1\", []() -> BaseClass * { return new DerivedClass1(); });\n    m.def(\"return_class_2\", []() -> BaseClass * { return new DerivedClass2(); });\n    m.def(\"return_class_n\", [](int n) -> BaseClass * {\n        if (n == 1) {\n            return new DerivedClass1();\n        }\n        if (n == 2) {\n            return new DerivedClass2();\n        }\n        return new BaseClass();\n    });\n    m.def(\"return_none\", []() -> BaseClass * { return nullptr; });\n\n    // test_isinstance\n    m.def(\"check_instances\", [](const py::list &l) {\n        return py::make_tuple(py::isinstance<py::tuple>(l[0]),\n                              py::isinstance<py::dict>(l[1]),\n                              py::isinstance<Pet>(l[2]),\n                              py::isinstance<Pet>(l[3]),\n                              py::isinstance<Dog>(l[4]),\n                              py::isinstance<Rabbit>(l[5]),\n                              py::isinstance<UnregisteredType>(l[6]));\n    });\n\n    struct Invalid {};\n\n    // test_type\n    m.def(\"check_type\", [](int category) {\n        // Currently not supported (via a fail at compile time)\n        // See https://github.com/pybind/pybind11/issues/2486\n        // if (category == 2)\n        //     return py::type::of<int>();\n        if (category == 1) {\n            return py::type::of<DerivedClass1>();\n        }\n        return py::type::of<Invalid>();\n    });\n\n    m.def(\"get_type_of\", [](py::object ob) { return py::type::of(std::move(ob)); });\n\n    m.def(\"get_type_classic\", [](py::handle h) { return h.get_type(); });\n\n    m.def(\"as_type\", [](const py::object &ob) { return py::type(ob); });\n\n    // test_mismatched_holder\n    struct MismatchBase1 {};\n    struct MismatchDerived1 : MismatchBase1 {};\n\n    struct MismatchBase2 {};\n    struct MismatchDerived2 : MismatchBase2 {};\n\n    m.def(\"mismatched_holder_1\", []() {\n        auto mod = py::module_::import(\"__main__\");\n        py::class_<MismatchBase1, std::shared_ptr<MismatchBase1>>(mod, \"MismatchBase1\");\n        py::class_<MismatchDerived1, MismatchBase1>(mod, \"MismatchDerived1\");\n    });\n    m.def(\"mismatched_holder_2\", []() {\n        auto mod = py::module_::import(\"__main__\");\n        py::class_<MismatchBase2>(mod, \"MismatchBase2\");\n        py::class_<MismatchDerived2, std::shared_ptr<MismatchDerived2>, MismatchBase2>(\n            mod, \"MismatchDerived2\");\n    });\n\n    // test_override_static\n    // #511: problem with inheritance + overwritten def_static\n    struct MyBase {\n        static std::unique_ptr<MyBase> make() { return std::unique_ptr<MyBase>(new MyBase()); }\n    };\n\n    struct MyDerived : MyBase {\n        static std::unique_ptr<MyDerived> make() {\n            return std::unique_ptr<MyDerived>(new MyDerived());\n        }\n    };\n\n    py::class_<MyBase>(m, \"MyBase\").def_static(\"make\", &MyBase::make);\n\n    py::class_<MyDerived, MyBase>(m, \"MyDerived\")\n        .def_static(\"make\", &MyDerived::make)\n        .def_static(\"make2\", &MyDerived::make);\n\n    // test_implicit_conversion_life_support\n    struct ConvertibleFromUserType {\n        int i;\n\n        explicit ConvertibleFromUserType(UserType u) : i(u.value()) {}\n    };\n\n    py::class_<ConvertibleFromUserType>(m, \"AcceptsUserType\").def(py::init<UserType>());\n    py::implicitly_convertible<UserType, ConvertibleFromUserType>();\n\n    m.def(\"implicitly_convert_argument\", [](const ConvertibleFromUserType &r) { return r.i; });\n    m.def(\"implicitly_convert_variable\", [](const py::object &o) {\n        // `o` is `UserType` and `r` is a reference to a temporary created by implicit\n        // conversion. This is valid when called inside a bound function because the temp\n        // object is attached to the same life support system as the arguments.\n        const auto &r = o.cast<const ConvertibleFromUserType &>();\n        return r.i;\n    });\n    m.add_object(\"implicitly_convert_variable_fail\", [&] {\n        auto f = [](PyObject *, PyObject *args) -> PyObject * {\n            auto o = py::reinterpret_borrow<py::tuple>(args)[0];\n            try { // It should fail here because there is no life support.\n                o.cast<const ConvertibleFromUserType &>();\n            } catch (const py::cast_error &e) {\n                return py::str(e.what()).release().ptr();\n            }\n            return py::str().release().ptr();\n        };\n\n        auto *def = new PyMethodDef{\"f\", f, METH_VARARGS, nullptr};\n        py::capsule def_capsule(def,\n                                [](void *ptr) { delete reinterpret_cast<PyMethodDef *>(ptr); });\n        return py::reinterpret_steal<py::object>(\n            PyCFunction_NewEx(def, def_capsule.ptr(), m.ptr()));\n    }());\n\n    // test_operator_new_delete\n    struct HasOpNewDel {\n        std::uint64_t i;\n        static void *operator new(size_t s) {\n            py::print(\"A new\", s);\n            return ::operator new(s);\n        }\n        static void *operator new(size_t s, void *ptr) {\n            py::print(\"A placement-new\", s);\n            return ptr;\n        }\n        static void operator delete(void *p) {\n            py::print(\"A delete\");\n            return ::operator delete(p);\n        }\n    };\n    struct HasOpNewDelSize {\n        std::uint32_t i;\n        static void *operator new(size_t s) {\n            py::print(\"B new\", s);\n            return ::operator new(s);\n        }\n        static void *operator new(size_t s, void *ptr) {\n            py::print(\"B placement-new\", s);\n            return ptr;\n        }\n        static void operator delete(void *p, size_t s) {\n            py::print(\"B delete\", s);\n            return ::operator delete(p);\n        }\n    };\n    struct AliasedHasOpNewDelSize {\n        std::uint64_t i;\n        static void *operator new(size_t s) {\n            py::print(\"C new\", s);\n            return ::operator new(s);\n        }\n        static void *operator new(size_t s, void *ptr) {\n            py::print(\"C placement-new\", s);\n            return ptr;\n        }\n        static void operator delete(void *p, size_t s) {\n            py::print(\"C delete\", s);\n            return ::operator delete(p);\n        }\n        virtual ~AliasedHasOpNewDelSize() = default;\n        AliasedHasOpNewDelSize() = default;\n        AliasedHasOpNewDelSize(const AliasedHasOpNewDelSize &) = delete;\n    };\n    struct PyAliasedHasOpNewDelSize : AliasedHasOpNewDelSize {\n        PyAliasedHasOpNewDelSize() = default;\n        explicit PyAliasedHasOpNewDelSize(int) {}\n        std::uint64_t j;\n    };\n    struct HasOpNewDelBoth {\n        std::uint32_t i[8];\n        static void *operator new(size_t s) {\n            py::print(\"D new\", s);\n            return ::operator new(s);\n        }\n        static void *operator new(size_t s, void *ptr) {\n            py::print(\"D placement-new\", s);\n            return ptr;\n        }\n        static void operator delete(void *p) {\n            py::print(\"D delete\");\n            return ::operator delete(p);\n        }\n        static void operator delete(void *p, size_t s) {\n            py::print(\"D wrong delete\", s);\n            return ::operator delete(p);\n        }\n    };\n    py::class_<HasOpNewDel>(m, \"HasOpNewDel\").def(py::init<>());\n    py::class_<HasOpNewDelSize>(m, \"HasOpNewDelSize\").def(py::init<>());\n    py::class_<HasOpNewDelBoth>(m, \"HasOpNewDelBoth\").def(py::init<>());\n    py::class_<AliasedHasOpNewDelSize, PyAliasedHasOpNewDelSize> aliased(m,\n                                                                         \"AliasedHasOpNewDelSize\");\n    aliased.def(py::init<>());\n    aliased.attr(\"size_noalias\") = py::int_(sizeof(AliasedHasOpNewDelSize));\n    aliased.attr(\"size_alias\") = py::int_(sizeof(PyAliasedHasOpNewDelSize));\n\n    // This test is actually part of test_local_bindings (test_duplicate_local), but we need a\n    // definition in a different compilation unit within the same module:\n    bind_local<LocalExternal, 17>(m, \"LocalExternal\", py::module_local());\n\n    // test_bind_protected_functions\n    class ProtectedA {\n    protected:\n        int foo() const { return value; }\n\n    private:\n        int value = 42;\n    };\n\n    class PublicistA : public ProtectedA {\n    public:\n        using ProtectedA::foo;\n    };\n\n    py::class_<ProtectedA>(m, \"ProtectedA\").def(py::init<>()).def(\"foo\", &PublicistA::foo);\n\n    class ProtectedB {\n    public:\n        virtual ~ProtectedB() = default;\n        ProtectedB() = default;\n        ProtectedB(const ProtectedB &) = delete;\n\n    protected:\n        virtual int foo() const { return value; }\n        virtual void *void_foo() { return static_cast<void *>(&value); }\n        virtual void *get_self() { return static_cast<void *>(this); }\n\n    private:\n        int value = 42;\n    };\n\n    class TrampolineB : public ProtectedB {\n    public:\n        int foo() const override { PYBIND11_OVERRIDE(int, ProtectedB, foo, ); }\n        void *void_foo() override { PYBIND11_OVERRIDE(void *, ProtectedB, void_foo, ); }\n        void *get_self() override { PYBIND11_OVERRIDE(void *, ProtectedB, get_self, ); }\n    };\n\n    class PublicistB : public ProtectedB {\n    public:\n        // [workaround(intel)] = default does not work here\n        // Removing or defaulting this destructor results in linking errors with the Intel compiler\n        // (in Debug builds only, tested with icpc (ICC) 2021.1 Beta 20200827)\n        ~PublicistB() override{}; // NOLINT(modernize-use-equals-default)\n        using ProtectedB::foo;\n        using ProtectedB::get_self;\n        using ProtectedB::void_foo;\n    };\n\n    m.def(\"read_foo\", [](const void *original) {\n        const int *ptr = reinterpret_cast<const int *>(original);\n        return *ptr;\n    });\n\n    m.def(\"pointers_equal\",\n          [](const void *original, const void *comparison) { return original == comparison; });\n\n    py::class_<ProtectedB, TrampolineB>(m, \"ProtectedB\")\n        .def(py::init<>())\n        .def(\"foo\", &PublicistB::foo)\n        .def(\"void_foo\", &PublicistB::void_foo)\n        .def(\"get_self\", &PublicistB::get_self);\n\n    // test_brace_initialization\n    struct BraceInitialization {\n        int field1;\n        std::string field2;\n    };\n\n    py::class_<BraceInitialization>(m, \"BraceInitialization\")\n        .def(py::init<int, const std::string &>())\n        .def_readwrite(\"field1\", &BraceInitialization::field1)\n        .def_readwrite(\"field2\", &BraceInitialization::field2);\n    // We *don't* want to construct using braces when the given constructor argument maps to a\n    // constructor, because brace initialization could go to the wrong place (in particular when\n    // there is also an `initializer_list<T>`-accept constructor):\n    py::class_<NoBraceInitialization>(m, \"NoBraceInitialization\")\n        .def(py::init<std::vector<int>>())\n        .def_readonly(\"vec\", &NoBraceInitialization::vec);\n\n    // test_reentrant_implicit_conversion_failure\n    // #1035: issue with runaway reentrant implicit conversion\n    struct BogusImplicitConversion {\n        BogusImplicitConversion(const BogusImplicitConversion &) = default;\n    };\n\n    py::class_<BogusImplicitConversion>(m, \"BogusImplicitConversion\")\n        .def(py::init<const BogusImplicitConversion &>());\n\n    py::implicitly_convertible<int, BogusImplicitConversion>();\n\n    // test_qualname\n    // #1166: nested class docstring doesn't show nested name\n    // Also related: tests that __qualname__ is set properly\n    struct NestBase {};\n    struct Nested {};\n    py::class_<NestBase> base(m, \"NestBase\");\n    base.def(py::init<>());\n    py::class_<Nested>(base, \"Nested\")\n        .def(py::init<>())\n        .def(\"fn\", [](Nested &, int, NestBase &, Nested &) {})\n        .def(\n            \"fa\", [](Nested &, int, NestBase &, Nested &) {}, \"a\"_a, \"b\"_a, \"c\"_a);\n    base.def(\"g\", [](NestBase &, Nested &) {});\n    base.def(\"h\", []() { return NestBase(); });\n\n    // test_error_after_conversion\n    // The second-pass path through dispatcher() previously didn't\n    // remember which overload was used, and would crash trying to\n    // generate a useful error message\n\n    struct NotRegistered {};\n    struct StringWrapper {\n        std::string str;\n    };\n    m.def(\"test_error_after_conversions\", [](int) {});\n    m.def(\"test_error_after_conversions\",\n          [](const StringWrapper &) -> NotRegistered { return {}; });\n    py::class_<StringWrapper>(m, \"StringWrapper\").def(py::init<std::string>());\n    py::implicitly_convertible<std::string, StringWrapper>();\n\n#if defined(PYBIND11_CPP17)\n    struct alignas(1024) Aligned {\n        std::uintptr_t ptr() const { return (uintptr_t) this; }\n    };\n    py::class_<Aligned>(m, \"Aligned\").def(py::init<>()).def(\"ptr\", &Aligned::ptr);\n#endif\n\n    // test_final\n    struct IsFinal final {};\n    py::class_<IsFinal>(m, \"IsFinal\", py::is_final());\n\n    // test_non_final_final\n    struct IsNonFinalFinal {};\n    py::class_<IsNonFinalFinal>(m, \"IsNonFinalFinal\", py::is_final());\n\n    // test_exception_rvalue_abort\n    struct PyPrintDestructor {\n        PyPrintDestructor() = default;\n        ~PyPrintDestructor() { py::print(\"Print from destructor\"); }\n        void throw_something() { throw std::runtime_error(\"error\"); }\n    };\n    py::class_<PyPrintDestructor>(m, \"PyPrintDestructor\")\n        .def(py::init<>())\n        .def(\"throw_something\", &PyPrintDestructor::throw_something);\n\n    // test_multiple_instances_with_same_pointer\n    struct SamePointer {};\n    static SamePointer samePointer;\n    py::class_<SamePointer, std::unique_ptr<SamePointer, py::nodelete>>(m, \"SamePointer\")\n        .def(py::init([]() { return &samePointer; }));\n\n    struct Empty {};\n    py::class_<Empty>(m, \"Empty\").def(py::init<>());\n\n    // test_base_and_derived_nested_scope\n    struct BaseWithNested {\n        struct Nested {};\n    };\n\n    struct DerivedWithNested : BaseWithNested {\n        struct Nested {};\n    };\n\n    py::class_<BaseWithNested> baseWithNested_class(m, \"BaseWithNested\");\n    py::class_<DerivedWithNested, BaseWithNested> derivedWithNested_class(m, \"DerivedWithNested\");\n    py::class_<BaseWithNested::Nested>(baseWithNested_class, \"Nested\")\n        .def_static(\"get_name\", []() { return \"BaseWithNested::Nested\"; });\n    py::class_<DerivedWithNested::Nested>(derivedWithNested_class, \"Nested\")\n        .def_static(\"get_name\", []() { return \"DerivedWithNested::Nested\"; });\n\n    // test_register_duplicate_class\n    struct Duplicate {};\n    struct OtherDuplicate {};\n    struct DuplicateNested {};\n    struct OtherDuplicateNested {};\n\n    m.def(\"register_duplicate_class_name\", [](const py::module_ &m) {\n        py::class_<Duplicate>(m, \"Duplicate\");\n        py::class_<OtherDuplicate>(m, \"Duplicate\");\n    });\n    m.def(\"register_duplicate_class_type\", [](const py::module_ &m) {\n        py::class_<OtherDuplicate>(m, \"OtherDuplicate\");\n        py::class_<OtherDuplicate>(m, \"YetAnotherDuplicate\");\n    });\n    m.def(\"register_duplicate_nested_class_name\", [](const py::object &gt) {\n        py::class_<DuplicateNested>(gt, \"DuplicateNested\");\n        py::class_<OtherDuplicateNested>(gt, \"DuplicateNested\");\n    });\n    m.def(\"register_duplicate_nested_class_type\", [](const py::object &gt) {\n        py::class_<OtherDuplicateNested>(gt, \"OtherDuplicateNested\");\n        py::class_<OtherDuplicateNested>(gt, \"YetAnotherDuplicateNested\");\n    });\n\n    test_class::pr4220_tripped_over_this::bind_empty0(m);\n}\n\ntemplate <int N>\nclass BreaksBase {\npublic:\n    virtual ~BreaksBase() = default;\n    BreaksBase() = default;\n    BreaksBase(const BreaksBase &) = delete;\n};\ntemplate <int N>\nclass BreaksTramp : public BreaksBase<N> {};\n// These should all compile just fine:\nusing DoesntBreak1 = py::class_<BreaksBase<1>, std::unique_ptr<BreaksBase<1>>, BreaksTramp<1>>;\nusing DoesntBreak2 = py::class_<BreaksBase<2>, BreaksTramp<2>, std::unique_ptr<BreaksBase<2>>>;\nusing DoesntBreak3 = py::class_<BreaksBase<3>, std::unique_ptr<BreaksBase<3>>>;\nusing DoesntBreak4 = py::class_<BreaksBase<4>, BreaksTramp<4>>;\nusing DoesntBreak5 = py::class_<BreaksBase<5>>;\nusing DoesntBreak6 = py::class_<BreaksBase<6>, std::shared_ptr<BreaksBase<6>>, BreaksTramp<6>>;\nusing DoesntBreak7 = py::class_<BreaksBase<7>, BreaksTramp<7>, std::shared_ptr<BreaksBase<7>>>;\nusing DoesntBreak8 = py::class_<BreaksBase<8>, std::shared_ptr<BreaksBase<8>>>;\n#define CHECK_BASE(N)                                                                             \\\n    static_assert(std::is_same<typename DoesntBreak##N::type, BreaksBase<(N)>>::value,            \\\n                  \"DoesntBreak\" #N \" has wrong type!\")\nCHECK_BASE(1);\nCHECK_BASE(2);\nCHECK_BASE(3);\nCHECK_BASE(4);\nCHECK_BASE(5);\nCHECK_BASE(6);\nCHECK_BASE(7);\nCHECK_BASE(8);\n#define CHECK_ALIAS(N)                                                                            \\\n    static_assert(                                                                                \\\n        DoesntBreak##N::has_alias                                                                 \\\n            && std::is_same<typename DoesntBreak##N::type_alias, BreaksTramp<(N)>>::value,        \\\n        \"DoesntBreak\" #N \" has wrong type_alias!\")\n#define CHECK_NOALIAS(N)                                                                          \\\n    static_assert(!DoesntBreak##N::has_alias                                                      \\\n                      && std::is_void<typename DoesntBreak##N::type_alias>::value,                \\\n                  \"DoesntBreak\" #N \" has type alias, but shouldn't!\")\nCHECK_ALIAS(1);\nCHECK_ALIAS(2);\nCHECK_NOALIAS(3);\nCHECK_ALIAS(4);\nCHECK_NOALIAS(5);\nCHECK_ALIAS(6);\nCHECK_ALIAS(7);\nCHECK_NOALIAS(8);\n#define CHECK_HOLDER(N, TYPE)                                                                     \\\n    static_assert(std::is_same<typename DoesntBreak##N::holder_type,                              \\\n                               std::TYPE##_ptr<BreaksBase<(N)>>>::value,                          \\\n                  \"DoesntBreak\" #N \" has wrong holder_type!\")\nCHECK_HOLDER(1, unique);\nCHECK_HOLDER(2, unique);\nCHECK_HOLDER(3, unique);\nCHECK_HOLDER(4, unique);\nCHECK_HOLDER(5, unique);\nCHECK_HOLDER(6, shared);\nCHECK_HOLDER(7, shared);\nCHECK_HOLDER(8, shared);\n\n// There's no nice way to test that these fail because they fail to compile; leave them here,\n// though, so that they can be manually tested by uncommenting them (and seeing that compilation\n// failures occurs).\n\n// We have to actually look into the type: the typedef alone isn't enough to instantiate the type:\n#define CHECK_BROKEN(N)                                                                           \\\n    static_assert(std::is_same<typename Breaks##N::type, BreaksBase<-(N)>>::value,                \\\n                  \"Breaks1 has wrong type!\");\n\n#ifdef PYBIND11_NEVER_DEFINED_EVER\n// Two holder classes:\ntypedef py::\n    class_<BreaksBase<-1>, std::unique_ptr<BreaksBase<-1>>, std::unique_ptr<BreaksBase<-1>>>\n        Breaks1;\nCHECK_BROKEN(1);\n// Two aliases:\ntypedef py::class_<BreaksBase<-2>, BreaksTramp<-2>, BreaksTramp<-2>> Breaks2;\nCHECK_BROKEN(2);\n// Holder + 2 aliases\ntypedef py::\n    class_<BreaksBase<-3>, std::unique_ptr<BreaksBase<-3>>, BreaksTramp<-3>, BreaksTramp<-3>>\n        Breaks3;\nCHECK_BROKEN(3);\n// Alias + 2 holders\ntypedef py::class_<BreaksBase<-4>,\n                   std::unique_ptr<BreaksBase<-4>>,\n                   BreaksTramp<-4>,\n                   std::shared_ptr<BreaksBase<-4>>>\n    Breaks4;\nCHECK_BROKEN(4);\n// Invalid option (not a subclass or holder)\ntypedef py::class_<BreaksBase<-5>, BreaksTramp<-4>> Breaks5;\nCHECK_BROKEN(5);\n// Invalid option: multiple inheritance not supported:\ntemplate <>\nstruct BreaksBase<-8> : BreaksBase<-6>, BreaksBase<-7> {};\ntypedef py::class_<BreaksBase<-8>, BreaksBase<-6>, BreaksBase<-7>> Breaks8;\nCHECK_BROKEN(8);\n#endif\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_class.py",
    "content": "import pytest\n\nimport env\nfrom pybind11_tests import ConstructorStats, UserType\nfrom pybind11_tests import class_ as m\n\n\ndef test_obj_class_name():\n    if env.PYPY:\n        expected_name = \"UserType\"\n    else:\n        expected_name = \"pybind11_tests.UserType\"\n    assert m.obj_class_name(UserType(1)) == expected_name\n    assert m.obj_class_name(UserType) == expected_name\n\n\ndef test_repr():\n    assert \"pybind11_type\" in repr(type(UserType))\n    assert \"UserType\" in repr(UserType)\n\n\ndef test_instance(msg):\n    with pytest.raises(TypeError) as excinfo:\n        m.NoConstructor()\n    assert msg(excinfo.value) == \"m.class_.NoConstructor: No constructor defined!\"\n\n    instance = m.NoConstructor.new_instance()\n\n    cstats = ConstructorStats.get(m.NoConstructor)\n    assert cstats.alive() == 1\n    del instance\n    assert cstats.alive() == 0\n\n\ndef test_instance_new(msg):\n    instance = m.NoConstructorNew()  # .__new__(m.NoConstructor.__class__)\n    cstats = ConstructorStats.get(m.NoConstructorNew)\n    assert cstats.alive() == 1\n    del instance\n    assert cstats.alive() == 0\n\n\ndef test_type():\n    assert m.check_type(1) == m.DerivedClass1\n    with pytest.raises(RuntimeError) as execinfo:\n        m.check_type(0)\n\n    assert \"pybind11::detail::get_type_info: unable to find type info\" in str(\n        execinfo.value\n    )\n    assert \"Invalid\" in str(execinfo.value)\n\n    # Currently not supported\n    # See https://github.com/pybind/pybind11/issues/2486\n    # assert m.check_type(2) == int\n\n\ndef test_type_of_py():\n    assert m.get_type_of(1) == int\n    assert m.get_type_of(m.DerivedClass1()) == m.DerivedClass1\n    assert m.get_type_of(int) == type\n\n\ndef test_type_of_classic():\n    assert m.get_type_classic(1) == int\n    assert m.get_type_classic(m.DerivedClass1()) == m.DerivedClass1\n    assert m.get_type_classic(int) == type\n\n\ndef test_type_of_py_nodelete():\n    # If the above test deleted the class, this will segfault\n    assert m.get_type_of(m.DerivedClass1()) == m.DerivedClass1\n\n\ndef test_as_type_py():\n    assert m.as_type(int) == int\n\n    with pytest.raises(TypeError):\n        assert m.as_type(1) == int\n\n    with pytest.raises(TypeError):\n        assert m.as_type(m.DerivedClass1()) == m.DerivedClass1\n\n\ndef test_docstrings(doc):\n    assert doc(UserType) == \"A `py::class_` type for testing\"\n    assert UserType.__name__ == \"UserType\"\n    assert UserType.__module__ == \"pybind11_tests\"\n    assert UserType.get_value.__name__ == \"get_value\"\n    assert UserType.get_value.__module__ == \"pybind11_tests\"\n\n    assert (\n        doc(UserType.get_value)\n        == \"\"\"\n        get_value(self: m.UserType) -> int\n\n        Get value using a method\n    \"\"\"\n    )\n    assert doc(UserType.value) == \"Get/set value using a property\"\n\n    assert (\n        doc(m.NoConstructor.new_instance)\n        == \"\"\"\n        new_instance() -> m.class_.NoConstructor\n\n        Return an instance\n    \"\"\"\n    )\n\n\ndef test_qualname(doc):\n    \"\"\"Tests that a properly qualified name is set in __qualname__ and that\n    generated docstrings properly use it and the module name\"\"\"\n    assert m.NestBase.__qualname__ == \"NestBase\"\n    assert m.NestBase.Nested.__qualname__ == \"NestBase.Nested\"\n\n    assert (\n        doc(m.NestBase.__init__)\n        == \"\"\"\n        __init__(self: m.class_.NestBase) -> None\n    \"\"\"\n    )\n    assert (\n        doc(m.NestBase.g)\n        == \"\"\"\n        g(self: m.class_.NestBase, arg0: m.class_.NestBase.Nested) -> None\n    \"\"\"\n    )\n    assert (\n        doc(m.NestBase.Nested.__init__)\n        == \"\"\"\n        __init__(self: m.class_.NestBase.Nested) -> None\n    \"\"\"\n    )\n    assert (\n        doc(m.NestBase.Nested.fn)\n        == \"\"\"\n        fn(self: m.class_.NestBase.Nested, arg0: int, arg1: m.class_.NestBase, arg2: m.class_.NestBase.Nested) -> None\n    \"\"\"\n    )\n    assert (\n        doc(m.NestBase.Nested.fa)\n        == \"\"\"\n        fa(self: m.class_.NestBase.Nested, a: int, b: m.class_.NestBase, c: m.class_.NestBase.Nested) -> None\n    \"\"\"\n    )\n    assert m.NestBase.__module__ == \"pybind11_tests.class_\"\n    assert m.NestBase.Nested.__module__ == \"pybind11_tests.class_\"\n\n\ndef test_inheritance(msg):\n    roger = m.Rabbit(\"Rabbit\")\n    assert roger.name() + \" is a \" + roger.species() == \"Rabbit is a parrot\"\n    assert m.pet_name_species(roger) == \"Rabbit is a parrot\"\n\n    polly = m.Pet(\"Polly\", \"parrot\")\n    assert polly.name() + \" is a \" + polly.species() == \"Polly is a parrot\"\n    assert m.pet_name_species(polly) == \"Polly is a parrot\"\n\n    molly = m.Dog(\"Molly\")\n    assert molly.name() + \" is a \" + molly.species() == \"Molly is a dog\"\n    assert m.pet_name_species(molly) == \"Molly is a dog\"\n\n    fred = m.Hamster(\"Fred\")\n    assert fred.name() + \" is a \" + fred.species() == \"Fred is a rodent\"\n\n    assert m.dog_bark(molly) == \"Woof!\"\n\n    with pytest.raises(TypeError) as excinfo:\n        m.dog_bark(polly)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        dog_bark(): incompatible function arguments. The following argument types are supported:\n            1. (arg0: m.class_.Dog) -> str\n\n        Invoked with: <m.class_.Pet object at 0>\n    \"\"\"\n    )\n\n    with pytest.raises(TypeError) as excinfo:\n        m.Chimera(\"lion\", \"goat\")\n    assert \"No constructor defined!\" in str(excinfo.value)\n\n\ndef test_inheritance_init(msg):\n    # Single base\n    class Python(m.Pet):\n        def __init__(self):\n            pass\n\n    with pytest.raises(TypeError) as exc_info:\n        Python()\n    expected = \"m.class_.Pet.__init__() must be called when overriding __init__\"\n    assert msg(exc_info.value) == expected\n\n    # Multiple bases\n    class RabbitHamster(m.Rabbit, m.Hamster):\n        def __init__(self):\n            m.Rabbit.__init__(self, \"RabbitHamster\")\n\n    with pytest.raises(TypeError) as exc_info:\n        RabbitHamster()\n    expected = \"m.class_.Hamster.__init__() must be called when overriding __init__\"\n    assert msg(exc_info.value) == expected\n\n\ndef test_automatic_upcasting():\n    assert type(m.return_class_1()).__name__ == \"DerivedClass1\"\n    assert type(m.return_class_2()).__name__ == \"DerivedClass2\"\n    assert type(m.return_none()).__name__ == \"NoneType\"\n    # Repeat these a few times in a random order to ensure no invalid caching is applied\n    assert type(m.return_class_n(1)).__name__ == \"DerivedClass1\"\n    assert type(m.return_class_n(2)).__name__ == \"DerivedClass2\"\n    assert type(m.return_class_n(0)).__name__ == \"BaseClass\"\n    assert type(m.return_class_n(2)).__name__ == \"DerivedClass2\"\n    assert type(m.return_class_n(2)).__name__ == \"DerivedClass2\"\n    assert type(m.return_class_n(0)).__name__ == \"BaseClass\"\n    assert type(m.return_class_n(1)).__name__ == \"DerivedClass1\"\n\n\ndef test_isinstance():\n    objects = [tuple(), dict(), m.Pet(\"Polly\", \"parrot\")] + [m.Dog(\"Molly\")] * 4\n    expected = (True, True, True, True, True, False, False)\n    assert m.check_instances(objects) == expected\n\n\ndef test_mismatched_holder():\n    import re\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.mismatched_holder_1()\n    assert re.match(\n        'generic_type: type \".*MismatchDerived1\" does not have a non-default '\n        'holder type while its base \".*MismatchBase1\" does',\n        str(excinfo.value),\n    )\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.mismatched_holder_2()\n    assert re.match(\n        'generic_type: type \".*MismatchDerived2\" has a non-default holder type '\n        'while its base \".*MismatchBase2\" does not',\n        str(excinfo.value),\n    )\n\n\ndef test_override_static():\n    \"\"\"#511: problem with inheritance + overwritten def_static\"\"\"\n    b = m.MyBase.make()\n    d1 = m.MyDerived.make2()\n    d2 = m.MyDerived.make()\n\n    assert isinstance(b, m.MyBase)\n    assert isinstance(d1, m.MyDerived)\n    assert isinstance(d2, m.MyDerived)\n\n\ndef test_implicit_conversion_life_support():\n    \"\"\"Ensure the lifetime of temporary objects created for implicit conversions\"\"\"\n    assert m.implicitly_convert_argument(UserType(5)) == 5\n    assert m.implicitly_convert_variable(UserType(5)) == 5\n\n    assert \"outside a bound function\" in m.implicitly_convert_variable_fail(UserType(5))\n\n\ndef test_operator_new_delete(capture):\n    \"\"\"Tests that class-specific operator new/delete functions are invoked\"\"\"\n\n    class SubAliased(m.AliasedHasOpNewDelSize):\n        pass\n\n    with capture:\n        a = m.HasOpNewDel()\n        b = m.HasOpNewDelSize()\n        d = m.HasOpNewDelBoth()\n    assert (\n        capture\n        == \"\"\"\n        A new 8\n        B new 4\n        D new 32\n    \"\"\"\n    )\n    sz_alias = str(m.AliasedHasOpNewDelSize.size_alias)\n    sz_noalias = str(m.AliasedHasOpNewDelSize.size_noalias)\n    with capture:\n        c = m.AliasedHasOpNewDelSize()\n        c2 = SubAliased()\n    assert capture == (\"C new \" + sz_noalias + \"\\n\" + \"C new \" + sz_alias + \"\\n\")\n\n    with capture:\n        del a\n        pytest.gc_collect()\n        del b\n        pytest.gc_collect()\n        del d\n        pytest.gc_collect()\n    assert (\n        capture\n        == \"\"\"\n        A delete\n        B delete 4\n        D delete\n    \"\"\"\n    )\n\n    with capture:\n        del c\n        pytest.gc_collect()\n        del c2\n        pytest.gc_collect()\n    assert capture == (\"C delete \" + sz_noalias + \"\\n\" + \"C delete \" + sz_alias + \"\\n\")\n\n\ndef test_bind_protected_functions():\n    \"\"\"Expose protected member functions to Python using a helper class\"\"\"\n    a = m.ProtectedA()\n    assert a.foo() == 42\n\n    b = m.ProtectedB()\n    assert b.foo() == 42\n    assert m.read_foo(b.void_foo()) == 42\n    assert m.pointers_equal(b.get_self(), b)\n\n    class C(m.ProtectedB):\n        def __init__(self):\n            m.ProtectedB.__init__(self)\n\n        def foo(self):\n            return 0\n\n    c = C()\n    assert c.foo() == 0\n\n\ndef test_brace_initialization():\n    \"\"\"Tests that simple POD classes can be constructed using C++11 brace initialization\"\"\"\n    a = m.BraceInitialization(123, \"test\")\n    assert a.field1 == 123\n    assert a.field2 == \"test\"\n\n    # Tests that a non-simple class doesn't get brace initialization (if the\n    # class defines an initializer_list constructor, in particular, it would\n    # win over the expected constructor).\n    b = m.NoBraceInitialization([123, 456])\n    assert b.vec == [123, 456]\n\n\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_class_refcount():\n    \"\"\"Instances must correctly increase/decrease the reference count of their types (#1029)\"\"\"\n    from sys import getrefcount\n\n    class PyDog(m.Dog):\n        pass\n\n    for cls in m.Dog, PyDog:\n        refcount_1 = getrefcount(cls)\n        molly = [cls(\"Molly\") for _ in range(10)]\n        refcount_2 = getrefcount(cls)\n\n        del molly\n        pytest.gc_collect()\n        refcount_3 = getrefcount(cls)\n\n        assert refcount_1 == refcount_3\n        assert refcount_2 > refcount_1\n\n\ndef test_reentrant_implicit_conversion_failure(msg):\n    # ensure that there is no runaway reentrant implicit conversion (#1035)\n    with pytest.raises(TypeError) as excinfo:\n        m.BogusImplicitConversion(0)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        __init__(): incompatible constructor arguments. The following argument types are supported:\n            1. m.class_.BogusImplicitConversion(arg0: m.class_.BogusImplicitConversion)\n\n        Invoked with: 0\n    \"\"\"\n    )\n\n\ndef test_error_after_conversions():\n    with pytest.raises(TypeError) as exc_info:\n        m.test_error_after_conversions(\"hello\")\n    assert str(exc_info.value).startswith(\n        \"Unable to convert function return value to a Python type!\"\n    )\n\n\ndef test_aligned():\n    if hasattr(m, \"Aligned\"):\n        p = m.Aligned().ptr()\n        assert p % 1024 == 0\n\n\n# https://foss.heptapod.net/pypy/pypy/-/issues/2742\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_final():\n    with pytest.raises(TypeError) as exc_info:\n\n        class PyFinalChild(m.IsFinal):\n            pass\n\n    assert str(exc_info.value).endswith(\"is not an acceptable base type\")\n\n\n# https://foss.heptapod.net/pypy/pypy/-/issues/2742\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_non_final_final():\n    with pytest.raises(TypeError) as exc_info:\n\n        class PyNonFinalFinalChild(m.IsNonFinalFinal):\n            pass\n\n    assert str(exc_info.value).endswith(\"is not an acceptable base type\")\n\n\n# https://github.com/pybind/pybind11/issues/1878\ndef test_exception_rvalue_abort():\n    with pytest.raises(RuntimeError):\n        m.PyPrintDestructor().throw_something()\n\n\n# https://github.com/pybind/pybind11/issues/1568\ndef test_multiple_instances_with_same_pointer(capture):\n    n = 100\n    instances = [m.SamePointer() for _ in range(n)]\n    for i in range(n):\n        # We need to reuse the same allocated memory for with a different type,\n        # to ensure the bug in `deregister_instance_impl` is detected. Otherwise\n        # `Py_TYPE(self) == Py_TYPE(it->second)` will still succeed, even though\n        # the `instance` is already deleted.\n        instances[i] = m.Empty()\n    # No assert: if this does not trigger the error\n    #   pybind11_fail(\"pybind11_object_dealloc(): Tried to deallocate unregistered instance!\");\n    # and just completes without crashing, we're good.\n\n\n# https://github.com/pybind/pybind11/issues/1624\ndef test_base_and_derived_nested_scope():\n    assert issubclass(m.DerivedWithNested, m.BaseWithNested)\n    assert m.BaseWithNested.Nested != m.DerivedWithNested.Nested\n    assert m.BaseWithNested.Nested.get_name() == \"BaseWithNested::Nested\"\n    assert m.DerivedWithNested.Nested.get_name() == \"DerivedWithNested::Nested\"\n\n\ndef test_register_duplicate_class():\n    import types\n\n    module_scope = types.ModuleType(\"module_scope\")\n    with pytest.raises(RuntimeError) as exc_info:\n        m.register_duplicate_class_name(module_scope)\n    expected = (\n        'generic_type: cannot initialize type \"Duplicate\": '\n        \"an object with that name is already defined\"\n    )\n    assert str(exc_info.value) == expected\n    with pytest.raises(RuntimeError) as exc_info:\n        m.register_duplicate_class_type(module_scope)\n    expected = 'generic_type: type \"YetAnotherDuplicate\" is already registered!'\n    assert str(exc_info.value) == expected\n\n    class ClassScope:\n        pass\n\n    with pytest.raises(RuntimeError) as exc_info:\n        m.register_duplicate_nested_class_name(ClassScope)\n    expected = (\n        'generic_type: cannot initialize type \"DuplicateNested\": '\n        \"an object with that name is already defined\"\n    )\n    assert str(exc_info.value) == expected\n    with pytest.raises(RuntimeError) as exc_info:\n        m.register_duplicate_nested_class_type(ClassScope)\n    expected = 'generic_type: type \"YetAnotherDuplicateNested\" is already registered!'\n    assert str(exc_info.value) == expected\n\n\ndef test_pr4220_tripped_over_this():\n    assert (\n        m.Empty0().get_msg()\n        == \"This is really only meant to exercise successful compilation.\"\n    )\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/CMakeLists.txt",
    "content": "# Built-in in CMake 3.5+\ninclude(CMakeParseArguments)\n\nadd_custom_target(test_cmake_build)\n\nfunction(pybind11_add_build_test name)\n  cmake_parse_arguments(ARG \"INSTALL\" \"\" \"\" ${ARGN})\n\n  set(build_options \"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}\")\n\n  if(PYBIND11_FINDPYTHON)\n    list(APPEND build_options \"-DPYBIND11_FINDPYTHON=${PYBIND11_FINDPYTHON}\")\n\n    if(DEFINED Python_ROOT_DIR)\n      list(APPEND build_options \"-DPython_ROOT_DIR=${Python_ROOT_DIR}\")\n    endif()\n\n    list(APPEND build_options \"-DPython_EXECUTABLE=${Python_EXECUTABLE}\")\n  else()\n    list(APPEND build_options \"-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}\")\n  endif()\n\n  if(DEFINED CMAKE_CXX_STANDARD)\n    list(APPEND build_options \"-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}\")\n  endif()\n\n  if(NOT ARG_INSTALL)\n    list(APPEND build_options \"-Dpybind11_SOURCE_DIR=${pybind11_SOURCE_DIR}\")\n  else()\n    list(APPEND build_options \"-DCMAKE_PREFIX_PATH=${pybind11_BINARY_DIR}/mock_install\")\n  endif()\n\n  add_custom_target(\n    test_build_${name}\n    ${CMAKE_CTEST_COMMAND}\n    --build-and-test\n    \"${CMAKE_CURRENT_SOURCE_DIR}/${name}\"\n    \"${CMAKE_CURRENT_BINARY_DIR}/${name}\"\n    --build-config\n    Release\n    --build-noclean\n    --build-generator\n    ${CMAKE_GENERATOR}\n    $<$<BOOL:${CMAKE_GENERATOR_PLATFORM}>:--build-generator-platform>\n    ${CMAKE_GENERATOR_PLATFORM}\n    --build-makeprogram\n    ${CMAKE_MAKE_PROGRAM}\n    --build-target\n    check_${name}\n    --build-options\n    ${build_options})\n  if(ARG_INSTALL)\n    add_dependencies(test_build_${name} mock_install)\n  endif()\n  add_dependencies(test_cmake_build test_build_${name})\nendfunction()\n\npossibly_uninitialized(PYTHON_MODULE_EXTENSION Python_INTERPRETER_ID)\n\npybind11_add_build_test(subdirectory_function)\npybind11_add_build_test(subdirectory_target)\nif(\"${PYTHON_MODULE_EXTENSION}\" MATCHES \"pypy\" OR \"${Python_INTERPRETER_ID}\" STREQUAL \"PyPy\")\n  message(STATUS \"Skipping embed test on PyPy\")\nelse()\n  pybind11_add_build_test(subdirectory_embed)\nendif()\n\nif(PYBIND11_INSTALL)\n  add_custom_target(\n    mock_install ${CMAKE_COMMAND} \"-DCMAKE_INSTALL_PREFIX=${pybind11_BINARY_DIR}/mock_install\" -P\n                 \"${pybind11_BINARY_DIR}/cmake_install.cmake\")\n\n  pybind11_add_build_test(installed_function INSTALL)\n  pybind11_add_build_test(installed_target INSTALL)\n  if(NOT (\"${PYTHON_MODULE_EXTENSION}\" MATCHES \"pypy\" OR \"${Python_INTERPRETER_ID}\" STREQUAL \"PyPy\"\n         ))\n    pybind11_add_build_test(installed_embed INSTALL)\n  endif()\nendif()\n\nadd_dependencies(check test_cmake_build)\n\nadd_subdirectory(subdirectory_target EXCLUDE_FROM_ALL)\nadd_subdirectory(subdirectory_embed EXCLUDE_FROM_ALL)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/embed.cpp",
    "content": "#include <pybind11/embed.h>\nnamespace py = pybind11;\n\nPYBIND11_EMBEDDED_MODULE(test_cmake_build, m) {\n    m.def(\"add\", [](int i, int j) { return i + j; });\n}\n\nint main(int argc, char *argv[]) {\n    if (argc != 2) {\n        throw std::runtime_error(\"Expected test.py file as the first argument\");\n    }\n    auto *test_py_file = argv[1];\n\n    py::scoped_interpreter guard{};\n\n    auto m = py::module_::import(\"test_cmake_build\");\n    if (m.attr(\"add\")(1, 2).cast<int>() != 3) {\n        throw std::runtime_error(\"embed.cpp failed\");\n    }\n\n    py::module_::import(\"sys\").attr(\"argv\") = py::make_tuple(\"test.py\", \"embed.cpp\");\n    py::eval_file(test_py_file, py::globals());\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.4)\n\n# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with\n# some versions of VS that have a patched CMake 3.11. This forces us to emulate\n# the behavior using the following workaround:\nif(${CMAKE_VERSION} VERSION_LESS 3.18)\n  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})\nelse()\n  cmake_policy(VERSION 3.18)\nendif()\n\nproject(test_installed_embed CXX)\n\nfind_package(pybind11 CONFIG REQUIRED)\nmessage(STATUS \"Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}\")\n\nadd_executable(test_installed_embed ../embed.cpp)\ntarget_link_libraries(test_installed_embed PRIVATE pybind11::embed)\nset_target_properties(test_installed_embed PROPERTIES OUTPUT_NAME test_cmake_build)\n\n# Do not treat includes from IMPORTED target as SYSTEM (Python headers in pybind11::embed).\n# This may be needed to resolve header conflicts, e.g. between Python release and debug headers.\nset_target_properties(test_installed_embed PROPERTIES NO_SYSTEM_FROM_IMPORTED ON)\n\nadd_custom_target(\n  check_installed_embed\n  $<TARGET_FILE:test_installed_embed> ${PROJECT_SOURCE_DIR}/../test.py\n  DEPENDS test_installed_embed)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.4)\nproject(test_installed_module CXX)\n\n# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with\n# some versions of VS that have a patched CMake 3.11. This forces us to emulate\n# the behavior using the following workaround:\nif(${CMAKE_VERSION} VERSION_LESS 3.18)\n  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})\nelse()\n  cmake_policy(VERSION 3.18)\nendif()\n\nproject(test_installed_function CXX)\n\nfind_package(pybind11 CONFIG REQUIRED)\nmessage(\n  STATUS \"Found pybind11 v${pybind11_VERSION} ${pybind11_VERSION_TYPE}: ${pybind11_INCLUDE_DIRS}\")\n\npybind11_add_module(test_installed_function SHARED NO_EXTRAS ../main.cpp)\nset_target_properties(test_installed_function PROPERTIES OUTPUT_NAME test_cmake_build)\n\nif(DEFINED Python_EXECUTABLE)\n  set(_Python_EXECUTABLE \"${Python_EXECUTABLE}\")\nelseif(DEFINED PYTHON_EXECUTABLE)\n  set(_Python_EXECUTABLE \"${PYTHON_EXECUTABLE}\")\nelse()\n  message(FATAL_ERROR \"No Python executable defined (should not be possible at this stage)\")\nendif()\n\nadd_custom_target(\n  check_installed_function\n  ${CMAKE_COMMAND}\n  -E\n  env\n  PYTHONPATH=$<TARGET_FILE_DIR:test_installed_function>\n  ${_Python_EXECUTABLE}\n  ${PROJECT_SOURCE_DIR}/../test.py\n  ${PROJECT_NAME}\n  DEPENDS test_installed_function)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.4)\n\n# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with\n# some versions of VS that have a patched CMake 3.11. This forces us to emulate\n# the behavior using the following workaround:\nif(${CMAKE_VERSION} VERSION_LESS 3.18)\n  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})\nelse()\n  cmake_policy(VERSION 3.18)\nendif()\n\nproject(test_installed_target CXX)\n\nfind_package(pybind11 CONFIG REQUIRED)\nmessage(STATUS \"Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}\")\n\nadd_library(test_installed_target MODULE ../main.cpp)\n\ntarget_link_libraries(test_installed_target PRIVATE pybind11::module)\nset_target_properties(test_installed_target PROPERTIES OUTPUT_NAME test_cmake_build)\n\n# Make sure result is, for example, test_installed_target.so, not libtest_installed_target.dylib\npybind11_extension(test_installed_target)\n\n# Do not treat includes from IMPORTED target as SYSTEM (Python headers in pybind11::module).\n# This may be needed to resolve header conflicts, e.g. between Python release and debug headers.\nset_target_properties(test_installed_target PROPERTIES NO_SYSTEM_FROM_IMPORTED ON)\n\nif(DEFINED Python_EXECUTABLE)\n  set(_Python_EXECUTABLE \"${Python_EXECUTABLE}\")\nelseif(DEFINED PYTHON_EXECUTABLE)\n  set(_Python_EXECUTABLE \"${PYTHON_EXECUTABLE}\")\nelse()\n  message(FATAL_ERROR \"No Python executable defined (should not be possible at this stage)\")\nendif()\n\nadd_custom_target(\n  check_installed_target\n  ${CMAKE_COMMAND}\n  -E\n  env\n  PYTHONPATH=$<TARGET_FILE_DIR:test_installed_target>\n  ${_Python_EXECUTABLE}\n  ${PROJECT_SOURCE_DIR}/../test.py\n  ${PROJECT_NAME}\n  DEPENDS test_installed_target)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/main.cpp",
    "content": "#include <pybind11/pybind11.h>\nnamespace py = pybind11;\n\nPYBIND11_MODULE(test_cmake_build, m) {\n    m.def(\"add\", [](int i, int j) { return i + j; });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.4)\n\n# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with\n# some versions of VS that have a patched CMake 3.11. This forces us to emulate\n# the behavior using the following workaround:\nif(${CMAKE_VERSION} VERSION_LESS 3.18)\n  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})\nelse()\n  cmake_policy(VERSION 3.18)\nendif()\n\nproject(test_subdirectory_embed CXX)\n\nset(PYBIND11_INSTALL\n    ON\n    CACHE BOOL \"\")\nset(PYBIND11_EXPORT_NAME test_export)\n\nadd_subdirectory(\"${pybind11_SOURCE_DIR}\" pybind11)\n\n# Test basic target functionality\nadd_executable(test_subdirectory_embed ../embed.cpp)\ntarget_link_libraries(test_subdirectory_embed PRIVATE pybind11::embed)\nset_target_properties(test_subdirectory_embed PROPERTIES OUTPUT_NAME test_cmake_build)\n\nadd_custom_target(\n  check_subdirectory_embed\n  $<TARGET_FILE:test_subdirectory_embed> \"${PROJECT_SOURCE_DIR}/../test.py\"\n  DEPENDS test_subdirectory_embed)\n\n# Test custom export group -- PYBIND11_EXPORT_NAME\nadd_library(test_embed_lib ../embed.cpp)\ntarget_link_libraries(test_embed_lib PRIVATE pybind11::embed)\n\ninstall(\n  TARGETS test_embed_lib\n  EXPORT test_export\n  ARCHIVE DESTINATION bin\n  LIBRARY DESTINATION lib\n  RUNTIME DESTINATION lib)\ninstall(EXPORT test_export DESTINATION lib/cmake/test_export/test_export-Targets.cmake)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.4)\n\n# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with\n# some versions of VS that have a patched CMake 3.11. This forces us to emulate\n# the behavior using the following workaround:\nif(${CMAKE_VERSION} VERSION_LESS 3.18)\n  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})\nelse()\n  cmake_policy(VERSION 3.18)\nendif()\n\nproject(test_subdirectory_function CXX)\n\nadd_subdirectory(\"${pybind11_SOURCE_DIR}\" pybind11)\npybind11_add_module(test_subdirectory_function ../main.cpp)\nset_target_properties(test_subdirectory_function PROPERTIES OUTPUT_NAME test_cmake_build)\n\nif(DEFINED Python_EXECUTABLE)\n  set(_Python_EXECUTABLE \"${Python_EXECUTABLE}\")\nelseif(DEFINED PYTHON_EXECUTABLE)\n  set(_Python_EXECUTABLE \"${PYTHON_EXECUTABLE}\")\nelse()\n  message(FATAL_ERROR \"No Python executable defined (should not be possible at this stage)\")\nendif()\n\nadd_custom_target(\n  check_subdirectory_function\n  ${CMAKE_COMMAND}\n  -E\n  env\n  PYTHONPATH=$<TARGET_FILE_DIR:test_subdirectory_function>\n  ${_Python_EXECUTABLE}\n  ${PROJECT_SOURCE_DIR}/../test.py\n  ${PROJECT_NAME}\n  DEPENDS test_subdirectory_function)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.4)\n\n# The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with\n# some versions of VS that have a patched CMake 3.11. This forces us to emulate\n# the behavior using the following workaround:\nif(${CMAKE_VERSION} VERSION_LESS 3.18)\n  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})\nelse()\n  cmake_policy(VERSION 3.18)\nendif()\n\nproject(test_subdirectory_target CXX)\n\nadd_subdirectory(\"${pybind11_SOURCE_DIR}\" pybind11)\n\nadd_library(test_subdirectory_target MODULE ../main.cpp)\nset_target_properties(test_subdirectory_target PROPERTIES OUTPUT_NAME test_cmake_build)\n\ntarget_link_libraries(test_subdirectory_target PRIVATE pybind11::module)\n\n# Make sure result is, for example, test_installed_target.so, not libtest_installed_target.dylib\npybind11_extension(test_subdirectory_target)\n\nif(DEFINED Python_EXECUTABLE)\n  set(_Python_EXECUTABLE \"${Python_EXECUTABLE}\")\nelseif(DEFINED PYTHON_EXECUTABLE)\n  set(_Python_EXECUTABLE \"${PYTHON_EXECUTABLE}\")\nelse()\n  message(FATAL_ERROR \"No Python executable defined (should not be possible at this stage)\")\nendif()\n\nadd_custom_target(\n  check_subdirectory_target\n  ${CMAKE_COMMAND}\n  -E\n  env\n  PYTHONPATH=$<TARGET_FILE_DIR:test_subdirectory_target>\n  ${_Python_EXECUTABLE}\n  ${PROJECT_SOURCE_DIR}/../test.py\n  ${PROJECT_NAME}\n  DEPENDS test_subdirectory_target)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_cmake_build/test.py",
    "content": "import sys\n\nimport test_cmake_build\n\nassert isinstance(__file__, str)  # Test this is properly set\n\nassert test_cmake_build.add(1, 2) == 3\nprint(f\"{sys.argv[1]} imports, runs, and adds: 1 + 2 = 3\")\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_const_name.cpp",
    "content": "// Copyright (c) 2021 The Pybind Development Team.\n// All rights reserved. Use of this source code is governed by a\n// BSD-style license that can be found in the LICENSE file.\n\n#include \"pybind11_tests.h\"\n\n// IUT = Implementation Under Test\n#define CONST_NAME_TESTS(TEST_FUNC, IUT)                                                          \\\n    std::string TEST_FUNC(int selector) {                                                         \\\n        switch (selector) {                                                                       \\\n            case 0:                                                                               \\\n                return IUT(\"\").text;                                                              \\\n            case 1:                                                                               \\\n                return IUT(\"A\").text;                                                             \\\n            case 2:                                                                               \\\n                return IUT(\"Bd\").text;                                                            \\\n            case 3:                                                                               \\\n                return IUT(\"Cef\").text;                                                           \\\n            case 4:                                                                               \\\n                return IUT<int>().text; /*NOLINT(bugprone-macro-parentheses)*/                    \\\n            case 5:                                                                               \\\n                return IUT<std::string>().text; /*NOLINT(bugprone-macro-parentheses)*/            \\\n            case 6:                                                                               \\\n                return IUT<true>(\"T1\", \"T2\").text; /*NOLINT(bugprone-macro-parentheses)*/         \\\n            case 7:                                                                               \\\n                return IUT<false>(\"U1\", \"U2\").text; /*NOLINT(bugprone-macro-parentheses)*/        \\\n            case 8:                                                                               \\\n                /*NOLINTNEXTLINE(bugprone-macro-parentheses)*/                                    \\\n                return IUT<true>(IUT(\"D1\"), IUT(\"D2\")).text;                                      \\\n            case 9:                                                                               \\\n                /*NOLINTNEXTLINE(bugprone-macro-parentheses)*/                                    \\\n                return IUT<false>(IUT(\"E1\"), IUT(\"E2\")).text;                                     \\\n            case 10:                                                                              \\\n                return IUT(\"KeepAtEnd\").text;                                                     \\\n            default:                                                                              \\\n                break;                                                                            \\\n        }                                                                                         \\\n        throw std::runtime_error(\"Invalid selector value.\");                                      \\\n    }\n\nCONST_NAME_TESTS(const_name_tests, py::detail::const_name)\n\n#ifdef PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY\nCONST_NAME_TESTS(underscore_tests, py::detail::_)\n#endif\n\nTEST_SUBMODULE(const_name, m) {\n    m.def(\"const_name_tests\", const_name_tests);\n\n#if defined(PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY)\n    m.def(\"underscore_tests\", underscore_tests);\n#else\n    m.attr(\"underscore_tests\") = \"PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY not defined.\";\n#endif\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_const_name.py",
    "content": "import pytest\n\nfrom pybind11_tests import const_name as m\n\n\n@pytest.mark.parametrize(\"func\", (m.const_name_tests, m.underscore_tests))\n@pytest.mark.parametrize(\n    \"selector, expected\",\n    enumerate(\n        (\n            \"\",\n            \"A\",\n            \"Bd\",\n            \"Cef\",\n            \"%\",\n            \"%\",\n            \"T1\",\n            \"U2\",\n            \"D1\",\n            \"E2\",\n            \"KeepAtEnd\",\n        )\n    ),\n)\ndef test_const_name(func, selector, expected):\n    if isinstance(func, str):\n        pytest.skip(func)\n    text = func(selector)\n    assert text == expected\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_constants_and_functions.cpp",
    "content": "/*\n    tests/test_constants_and_functions.cpp -- global constants and functions, enumerations, raw\n    byte strings\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"pybind11_tests.h\"\n\nenum MyEnum { EFirstEntry = 1, ESecondEntry };\n\nstd::string test_function1() { return \"test_function()\"; }\n\nstd::string test_function2(MyEnum k) { return \"test_function(enum=\" + std::to_string(k) + \")\"; }\n\nstd::string test_function3(int i) { return \"test_function(\" + std::to_string(i) + \")\"; }\n\npy::str test_function4() { return \"test_function()\"; }\npy::str test_function4(char *) { return \"test_function(char *)\"; }\npy::str test_function4(int, float) { return \"test_function(int, float)\"; }\npy::str test_function4(float, int) { return \"test_function(float, int)\"; }\n\npy::bytes return_bytes() {\n    const char *data = \"\\x01\\x00\\x02\\x00\";\n    return std::string(data, 4);\n}\n\nstd::string print_bytes(const py::bytes &bytes) {\n    std::string ret = \"bytes[\";\n    const auto value = static_cast<std::string>(bytes);\n    for (char c : value) {\n        ret += std::to_string(static_cast<int>(c)) + ' ';\n    }\n    ret.back() = ']';\n    return ret;\n}\n\n// Test that we properly handle C++17 exception specifiers (which are part of the function\n// signature in C++17).  These should all still work before C++17, but don't affect the function\n// signature.\nnamespace test_exc_sp {\n// [workaround(intel)] Unable to use noexcept instead of noexcept(true)\n// Make the f1 test basically the same as the f2 test in C++17 mode for the Intel compiler as\n// it fails to compile with a plain noexcept (tested with icc (ICC) 2021.1 Beta 20200827).\n#if defined(__INTEL_COMPILER) && defined(PYBIND11_CPP17)\nint f1(int x) noexcept(true) { return x + 1; }\n#else\nint f1(int x) noexcept { return x + 1; }\n#endif\nint f2(int x) noexcept(true) { return x + 2; }\nint f3(int x) noexcept(false) { return x + 3; }\nPYBIND11_WARNING_PUSH\nPYBIND11_WARNING_DISABLE_GCC(\"-Wdeprecated\")\nPYBIND11_WARNING_DISABLE_CLANG(\"-Wdeprecated\")\n// NOLINTNEXTLINE(modernize-use-noexcept)\nint f4(int x) throw() { return x + 4; } // Deprecated equivalent to noexcept(true)\nPYBIND11_WARNING_POP\nstruct C {\n    int m1(int x) noexcept { return x - 1; }\n    int m2(int x) const noexcept { return x - 2; }\n    int m3(int x) noexcept(true) { return x - 3; }\n    int m4(int x) const noexcept(true) { return x - 4; }\n    int m5(int x) noexcept(false) { return x - 5; }\n    int m6(int x) const noexcept(false) { return x - 6; }\n    PYBIND11_WARNING_PUSH\n    PYBIND11_WARNING_DISABLE_GCC(\"-Wdeprecated\")\n    PYBIND11_WARNING_DISABLE_CLANG(\"-Wdeprecated\")\n    // NOLINTNEXTLINE(modernize-use-noexcept)\n    int m7(int x) throw() { return x - 7; }\n    // NOLINTNEXTLINE(modernize-use-noexcept)\n    int m8(int x) const throw() { return x - 8; }\n    PYBIND11_WARNING_POP\n};\n} // namespace test_exc_sp\n\nTEST_SUBMODULE(constants_and_functions, m) {\n    // test_constants\n    m.attr(\"some_constant\") = py::int_(14);\n\n    // test_function_overloading\n    m.def(\"test_function\", &test_function1);\n    m.def(\"test_function\", &test_function2);\n    m.def(\"test_function\", &test_function3);\n\n#if defined(PYBIND11_OVERLOAD_CAST)\n    m.def(\"test_function\", py::overload_cast<>(&test_function4));\n    m.def(\"test_function\", py::overload_cast<char *>(&test_function4));\n    m.def(\"test_function\", py::overload_cast<int, float>(&test_function4));\n    m.def(\"test_function\", py::overload_cast<float, int>(&test_function4));\n#else\n    m.def(\"test_function\", static_cast<py::str (*)()>(&test_function4));\n    m.def(\"test_function\", static_cast<py::str (*)(char *)>(&test_function4));\n    m.def(\"test_function\", static_cast<py::str (*)(int, float)>(&test_function4));\n    m.def(\"test_function\", static_cast<py::str (*)(float, int)>(&test_function4));\n#endif\n\n    py::enum_<MyEnum>(m, \"MyEnum\")\n        .value(\"EFirstEntry\", EFirstEntry)\n        .value(\"ESecondEntry\", ESecondEntry)\n        .export_values();\n\n    // test_bytes\n    m.def(\"return_bytes\", &return_bytes);\n    m.def(\"print_bytes\", &print_bytes);\n\n    // test_exception_specifiers\n    using namespace test_exc_sp;\n    py::class_<C>(m, \"C\")\n        .def(py::init<>())\n        .def(\"m1\", &C::m1)\n        .def(\"m2\", &C::m2)\n        .def(\"m3\", &C::m3)\n        .def(\"m4\", &C::m4)\n        .def(\"m5\", &C::m5)\n        .def(\"m6\", &C::m6)\n        .def(\"m7\", &C::m7)\n        .def(\"m8\", &C::m8);\n    m.def(\"f1\", f1);\n    m.def(\"f2\", f2);\n\n    PYBIND11_WARNING_PUSH\n    PYBIND11_WARNING_DISABLE_INTEL(878) // incompatible exception specifications\n    m.def(\"f3\", f3);\n    PYBIND11_WARNING_POP\n\n    m.def(\"f4\", f4);\n\n    // test_function_record_leaks\n    m.def(\"register_large_capture_with_invalid_arguments\", [](py::module_ m) {\n        // This should always be enough to trigger the alternative branch\n        // where `sizeof(capture) > sizeof(rec->data)`\n        uint64_t capture[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};\n#if defined(__GNUC__) && __GNUC__ == 4 // CentOS7\n        py::detail::silence_unused_warnings(capture);\n#endif\n        m.def(\n            \"should_raise\", [capture](int) { return capture[9] + 33; }, py::kw_only(), py::arg());\n    });\n    m.def(\"register_with_raising_repr\", [](py::module_ m, const py::object &default_value) {\n        m.def(\n            \"should_raise\",\n            [](int, int, const py::object &) { return 42; },\n            \"some docstring\",\n            py::arg_v(\"x\", 42),\n            py::arg_v(\"y\", 42, \"<the answer>\"),\n            py::arg_v(\"z\", default_value));\n    });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_constants_and_functions.py",
    "content": "import pytest\n\nm = pytest.importorskip(\"pybind11_tests.constants_and_functions\")\n\n\ndef test_constants():\n    assert m.some_constant == 14\n\n\ndef test_function_overloading():\n    assert m.test_function() == \"test_function()\"\n    assert m.test_function(7) == \"test_function(7)\"\n    assert m.test_function(m.MyEnum.EFirstEntry) == \"test_function(enum=1)\"\n    assert m.test_function(m.MyEnum.ESecondEntry) == \"test_function(enum=2)\"\n\n    assert m.test_function() == \"test_function()\"\n    assert m.test_function(\"abcd\") == \"test_function(char *)\"\n    assert m.test_function(1, 1.0) == \"test_function(int, float)\"\n    assert m.test_function(1, 1.0) == \"test_function(int, float)\"\n    assert m.test_function(2.0, 2) == \"test_function(float, int)\"\n\n\ndef test_bytes():\n    assert m.print_bytes(m.return_bytes()) == \"bytes[1 0 2 0]\"\n\n\ndef test_exception_specifiers():\n    c = m.C()\n    assert c.m1(2) == 1\n    assert c.m2(3) == 1\n    assert c.m3(5) == 2\n    assert c.m4(7) == 3\n    assert c.m5(10) == 5\n    assert c.m6(14) == 8\n    assert c.m7(20) == 13\n    assert c.m8(29) == 21\n\n    assert m.f1(33) == 34\n    assert m.f2(53) == 55\n    assert m.f3(86) == 89\n    assert m.f4(140) == 144\n\n\ndef test_function_record_leaks():\n    class RaisingRepr:\n        def __repr__(self):\n            raise RuntimeError(\"Surprise!\")\n\n    with pytest.raises(RuntimeError):\n        m.register_large_capture_with_invalid_arguments(m)\n    with pytest.raises(RuntimeError):\n        m.register_with_raising_repr(m, RaisingRepr())\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_copy_move.cpp",
    "content": "/*\n    tests/test_copy_move_policies.cpp -- 'copy' and 'move' return value policies\n                                         and related tests\n\n    Copyright (c) 2016 Ben North <ben@redfrontdoor.org>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/stl.h>\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\ntemplate <typename derived>\nstruct empty {\n    static const derived &get_one() { return instance_; }\n    static derived instance_;\n};\n\nstruct lacking_copy_ctor : public empty<lacking_copy_ctor> {\n    lacking_copy_ctor() = default;\n    lacking_copy_ctor(const lacking_copy_ctor &other) = delete;\n};\n\ntemplate <>\nlacking_copy_ctor empty<lacking_copy_ctor>::instance_ = {};\n\nstruct lacking_move_ctor : public empty<lacking_move_ctor> {\n    lacking_move_ctor() = default;\n    lacking_move_ctor(const lacking_move_ctor &other) = delete;\n    lacking_move_ctor(lacking_move_ctor &&other) = delete;\n};\n\ntemplate <>\nlacking_move_ctor empty<lacking_move_ctor>::instance_ = {};\n\n/* Custom type caster move/copy test classes */\nclass MoveOnlyInt {\npublic:\n    MoveOnlyInt() { print_default_created(this); }\n    explicit MoveOnlyInt(int v) : value{v} { print_created(this, value); }\n    MoveOnlyInt(MoveOnlyInt &&m) noexcept {\n        print_move_created(this, m.value);\n        std::swap(value, m.value);\n    }\n    MoveOnlyInt &operator=(MoveOnlyInt &&m) noexcept {\n        print_move_assigned(this, m.value);\n        std::swap(value, m.value);\n        return *this;\n    }\n    MoveOnlyInt(const MoveOnlyInt &) = delete;\n    MoveOnlyInt &operator=(const MoveOnlyInt &) = delete;\n    ~MoveOnlyInt() { print_destroyed(this); }\n\n    int value;\n};\nclass MoveOrCopyInt {\npublic:\n    MoveOrCopyInt() { print_default_created(this); }\n    explicit MoveOrCopyInt(int v) : value{v} { print_created(this, value); }\n    MoveOrCopyInt(MoveOrCopyInt &&m) noexcept {\n        print_move_created(this, m.value);\n        std::swap(value, m.value);\n    }\n    MoveOrCopyInt &operator=(MoveOrCopyInt &&m) noexcept {\n        print_move_assigned(this, m.value);\n        std::swap(value, m.value);\n        return *this;\n    }\n    MoveOrCopyInt(const MoveOrCopyInt &c) {\n        print_copy_created(this, c.value);\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        value = c.value;\n    }\n    MoveOrCopyInt &operator=(const MoveOrCopyInt &c) {\n        print_copy_assigned(this, c.value);\n        value = c.value;\n        return *this;\n    }\n    ~MoveOrCopyInt() { print_destroyed(this); }\n\n    int value;\n};\nclass CopyOnlyInt {\npublic:\n    CopyOnlyInt() { print_default_created(this); }\n    explicit CopyOnlyInt(int v) : value{v} { print_created(this, value); }\n    CopyOnlyInt(const CopyOnlyInt &c) {\n        print_copy_created(this, c.value);\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        value = c.value;\n    }\n    CopyOnlyInt &operator=(const CopyOnlyInt &c) {\n        print_copy_assigned(this, c.value);\n        value = c.value;\n        return *this;\n    }\n    ~CopyOnlyInt() { print_destroyed(this); }\n\n    int value;\n};\nPYBIND11_NAMESPACE_BEGIN(pybind11)\nPYBIND11_NAMESPACE_BEGIN(detail)\ntemplate <>\nstruct type_caster<MoveOnlyInt> {\n    PYBIND11_TYPE_CASTER(MoveOnlyInt, const_name(\"MoveOnlyInt\"));\n    bool load(handle src, bool) {\n        value = MoveOnlyInt(src.cast<int>());\n        return true;\n    }\n    static handle cast(const MoveOnlyInt &m, return_value_policy r, handle p) {\n        return pybind11::cast(m.value, r, p);\n    }\n};\n\ntemplate <>\nstruct type_caster<MoveOrCopyInt> {\n    PYBIND11_TYPE_CASTER(MoveOrCopyInt, const_name(\"MoveOrCopyInt\"));\n    bool load(handle src, bool) {\n        value = MoveOrCopyInt(src.cast<int>());\n        return true;\n    }\n    static handle cast(const MoveOrCopyInt &m, return_value_policy r, handle p) {\n        return pybind11::cast(m.value, r, p);\n    }\n};\n\ntemplate <>\nstruct type_caster<CopyOnlyInt> {\nprotected:\n    CopyOnlyInt value;\n\npublic:\n    static constexpr auto name = const_name(\"CopyOnlyInt\");\n    bool load(handle src, bool) {\n        value = CopyOnlyInt(src.cast<int>());\n        return true;\n    }\n    static handle cast(const CopyOnlyInt &m, return_value_policy r, handle p) {\n        return pybind11::cast(m.value, r, p);\n    }\n    static handle cast(const CopyOnlyInt *src, return_value_policy policy, handle parent) {\n        if (!src) {\n            return none().release();\n        }\n        return cast(*src, policy, parent);\n    }\n    explicit operator CopyOnlyInt *() { return &value; }\n    explicit operator CopyOnlyInt &() { return value; }\n    template <typename T>\n    using cast_op_type = pybind11::detail::cast_op_type<T>;\n};\nPYBIND11_NAMESPACE_END(detail)\nPYBIND11_NAMESPACE_END(pybind11)\n\nTEST_SUBMODULE(copy_move_policies, m) {\n    // test_lacking_copy_ctor\n    py::class_<lacking_copy_ctor>(m, \"lacking_copy_ctor\")\n        .def_static(\"get_one\", &lacking_copy_ctor::get_one, py::return_value_policy::copy);\n    // test_lacking_move_ctor\n    py::class_<lacking_move_ctor>(m, \"lacking_move_ctor\")\n        .def_static(\"get_one\", &lacking_move_ctor::get_one, py::return_value_policy::move);\n\n    // test_move_and_copy_casts\n    // NOLINTNEXTLINE(performance-unnecessary-value-param)\n    m.def(\"move_and_copy_casts\", [](const py::object &o) {\n        int r = 0;\n        r += py::cast<MoveOrCopyInt>(o).value; /* moves */\n        r += py::cast<MoveOnlyInt>(o).value;   /* moves */\n        r += py::cast<CopyOnlyInt>(o).value;   /* copies */\n        auto m1(py::cast<MoveOrCopyInt>(o));   /* moves */\n        auto m2(py::cast<MoveOnlyInt>(o));     /* moves */\n        auto m3(py::cast<CopyOnlyInt>(o));     /* copies */\n        r += m1.value + m2.value + m3.value;\n\n        return r;\n    });\n\n    // test_move_and_copy_loads\n    m.def(\"move_only\", [](MoveOnlyInt m) { return m.value; });\n    // Changing this breaks the existing test: needs careful review.\n    // NOLINTNEXTLINE(performance-unnecessary-value-param)\n    m.def(\"move_or_copy\", [](MoveOrCopyInt m) { return m.value; });\n    // Changing this breaks the existing test: needs careful review.\n    // NOLINTNEXTLINE(performance-unnecessary-value-param)\n    m.def(\"copy_only\", [](CopyOnlyInt m) { return m.value; });\n    m.def(\"move_pair\",\n          [](std::pair<MoveOnlyInt, MoveOrCopyInt> p) { return p.first.value + p.second.value; });\n    m.def(\"move_tuple\", [](std::tuple<MoveOnlyInt, MoveOrCopyInt, MoveOnlyInt> t) {\n        return std::get<0>(t).value + std::get<1>(t).value + std::get<2>(t).value;\n    });\n    m.def(\"copy_tuple\", [](std::tuple<CopyOnlyInt, CopyOnlyInt> t) {\n        return std::get<0>(t).value + std::get<1>(t).value;\n    });\n    m.def(\"move_copy_nested\",\n          [](std::pair<MoveOnlyInt,\n                       std::pair<std::tuple<MoveOrCopyInt, CopyOnlyInt, std::tuple<MoveOnlyInt>>,\n                                 MoveOrCopyInt>> x) {\n              return x.first.value + std::get<0>(x.second.first).value\n                     + std::get<1>(x.second.first).value\n                     + std::get<0>(std::get<2>(x.second.first)).value + x.second.second.value;\n          });\n    m.def(\"move_and_copy_cstats\", []() {\n        ConstructorStats::gc();\n        // Reset counts to 0 so that previous tests don't affect later ones:\n        auto &mc = ConstructorStats::get<MoveOrCopyInt>();\n        mc.move_assignments = mc.move_constructions = mc.copy_assignments = mc.copy_constructions\n            = 0;\n        auto &mo = ConstructorStats::get<MoveOnlyInt>();\n        mo.move_assignments = mo.move_constructions = mo.copy_assignments = mo.copy_constructions\n            = 0;\n        auto &co = ConstructorStats::get<CopyOnlyInt>();\n        co.move_assignments = co.move_constructions = co.copy_assignments = co.copy_constructions\n            = 0;\n        py::dict d;\n        d[\"MoveOrCopyInt\"] = py::cast(mc, py::return_value_policy::reference);\n        d[\"MoveOnlyInt\"] = py::cast(mo, py::return_value_policy::reference);\n        d[\"CopyOnlyInt\"] = py::cast(co, py::return_value_policy::reference);\n        return d;\n    });\n#ifdef PYBIND11_HAS_OPTIONAL\n    // test_move_and_copy_load_optional\n    m.attr(\"has_optional\") = true;\n    m.def(\"move_optional\", [](std::optional<MoveOnlyInt> o) { return o->value; });\n    m.def(\"move_or_copy_optional\", [](std::optional<MoveOrCopyInt> o) { return o->value; });\n    m.def(\"copy_optional\", [](std::optional<CopyOnlyInt> o) { return o->value; });\n    m.def(\"move_optional_tuple\",\n          [](std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>> x) {\n              return std::get<0>(*x).value + std::get<1>(*x).value + std::get<2>(*x).value;\n          });\n#else\n    m.attr(\"has_optional\") = false;\n#endif\n\n    // #70 compilation issue if operator new is not public - simple body added\n    // but not needed on most compilers; MSVC and nvcc don't like a local\n    // struct not having a method defined when declared, since it can not be\n    // added later.\n    struct PrivateOpNew {\n        int value = 1;\n\n    private:\n        void *operator new(size_t bytes) {\n            void *ptr = std::malloc(bytes);\n            if (ptr) {\n                return ptr;\n            }\n            throw std::bad_alloc{};\n        }\n    };\n    py::class_<PrivateOpNew>(m, \"PrivateOpNew\").def_readonly(\"value\", &PrivateOpNew::value);\n    m.def(\"private_op_new_value\", []() { return PrivateOpNew(); });\n    m.def(\n        \"private_op_new_reference\",\n        []() -> const PrivateOpNew & {\n            static PrivateOpNew x{};\n            return x;\n        },\n        py::return_value_policy::reference);\n\n    // test_move_fallback\n    // #389: rvp::move should fall-through to copy on non-movable objects\n    struct MoveIssue1 {\n        int v;\n        explicit MoveIssue1(int v) : v{v} {}\n        MoveIssue1(const MoveIssue1 &c) = default;\n        MoveIssue1(MoveIssue1 &&) = delete;\n    };\n    py::class_<MoveIssue1>(m, \"MoveIssue1\")\n        .def(py::init<int>())\n        .def_readwrite(\"value\", &MoveIssue1::v);\n\n    struct MoveIssue2 {\n        int v;\n        explicit MoveIssue2(int v) : v{v} {}\n        MoveIssue2(MoveIssue2 &&) = default;\n    };\n    py::class_<MoveIssue2>(m, \"MoveIssue2\")\n        .def(py::init<int>())\n        .def_readwrite(\"value\", &MoveIssue2::v);\n\n    // #2742: Don't expect ownership of raw pointer to `new`ed object to be transferred with\n    // `py::return_value_policy::move`\n    m.def(\n        \"get_moveissue1\",\n        [](int i) { return std::unique_ptr<MoveIssue1>(new MoveIssue1(i)); },\n        py::return_value_policy::move);\n    m.def(\n        \"get_moveissue2\", [](int i) { return MoveIssue2(i); }, py::return_value_policy::move);\n\n    // Make sure that cast from pytype rvalue to other pytype works\n    m.def(\"get_pytype_rvalue_castissue\", [](double i) { return py::float_(i).cast<py::int_>(); });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_copy_move.py",
    "content": "import pytest\n\nfrom pybind11_tests import copy_move_policies as m\n\n\ndef test_lacking_copy_ctor():\n    with pytest.raises(RuntimeError) as excinfo:\n        m.lacking_copy_ctor.get_one()\n    assert \"is non-copyable!\" in str(excinfo.value)\n\n\ndef test_lacking_move_ctor():\n    with pytest.raises(RuntimeError) as excinfo:\n        m.lacking_move_ctor.get_one()\n    assert \"is neither movable nor copyable!\" in str(excinfo.value)\n\n\ndef test_move_and_copy_casts():\n    \"\"\"Cast some values in C++ via custom type casters and count the number of moves/copies.\"\"\"\n\n    cstats = m.move_and_copy_cstats()\n    c_m, c_mc, c_c = (\n        cstats[\"MoveOnlyInt\"],\n        cstats[\"MoveOrCopyInt\"],\n        cstats[\"CopyOnlyInt\"],\n    )\n\n    # The type move constructions/assignments below each get incremented: the move assignment comes\n    # from the type_caster load; the move construction happens when extracting that via a cast or\n    # loading into an argument.\n    assert m.move_and_copy_casts(3) == 18\n    assert c_m.copy_assignments + c_m.copy_constructions == 0\n    assert c_m.move_assignments == 2\n    assert c_m.move_constructions >= 2\n    assert c_mc.alive() == 0\n    assert c_mc.copy_assignments + c_mc.copy_constructions == 0\n    assert c_mc.move_assignments == 2\n    assert c_mc.move_constructions >= 2\n    assert c_c.alive() == 0\n    assert c_c.copy_assignments == 2\n    assert c_c.copy_constructions >= 2\n    assert c_m.alive() + c_mc.alive() + c_c.alive() == 0\n\n\ndef test_move_and_copy_loads():\n    \"\"\"Call some functions that load arguments via custom type casters and count the number of\n    moves/copies.\"\"\"\n\n    cstats = m.move_and_copy_cstats()\n    c_m, c_mc, c_c = (\n        cstats[\"MoveOnlyInt\"],\n        cstats[\"MoveOrCopyInt\"],\n        cstats[\"CopyOnlyInt\"],\n    )\n\n    assert m.move_only(10) == 10  # 1 move, c_m\n    assert m.move_or_copy(11) == 11  # 1 move, c_mc\n    assert m.copy_only(12) == 12  # 1 copy, c_c\n    assert m.move_pair((13, 14)) == 27  # 1 c_m move, 1 c_mc move\n    assert m.move_tuple((15, 16, 17)) == 48  # 2 c_m moves, 1 c_mc move\n    assert m.copy_tuple((18, 19)) == 37  # 2 c_c copies\n    # Direct constructions: 2 c_m moves, 2 c_mc moves, 1 c_c copy\n    # Extra moves/copies when moving pairs/tuples: 3 c_m, 3 c_mc, 2 c_c\n    assert m.move_copy_nested((1, ((2, 3, (4,)), 5))) == 15\n\n    assert c_m.copy_assignments + c_m.copy_constructions == 0\n    assert c_m.move_assignments == 6\n    assert c_m.move_constructions == 9\n    assert c_mc.copy_assignments + c_mc.copy_constructions == 0\n    assert c_mc.move_assignments == 5\n    assert c_mc.move_constructions == 8\n    assert c_c.copy_assignments == 4\n    assert c_c.copy_constructions == 6\n    assert c_m.alive() + c_mc.alive() + c_c.alive() == 0\n\n\n@pytest.mark.skipif(not m.has_optional, reason=\"no <optional>\")\ndef test_move_and_copy_load_optional():\n    \"\"\"Tests move/copy loads of std::optional arguments\"\"\"\n\n    cstats = m.move_and_copy_cstats()\n    c_m, c_mc, c_c = (\n        cstats[\"MoveOnlyInt\"],\n        cstats[\"MoveOrCopyInt\"],\n        cstats[\"CopyOnlyInt\"],\n    )\n\n    # The extra move/copy constructions below come from the std::optional move (which has to move\n    # its arguments):\n    assert m.move_optional(10) == 10  # c_m: 1 move assign, 2 move construct\n    assert m.move_or_copy_optional(11) == 11  # c_mc: 1 move assign, 2 move construct\n    assert m.copy_optional(12) == 12  # c_c: 1 copy assign, 2 copy construct\n    # 1 move assign + move construct moves each of c_m, c_mc, 1 c_c copy\n    # +1 move/copy construct each from moving the tuple\n    # +1 move/copy construct each from moving the optional (which moves the tuple again)\n    assert m.move_optional_tuple((3, 4, 5)) == 12\n\n    assert c_m.copy_assignments + c_m.copy_constructions == 0\n    assert c_m.move_assignments == 2\n    assert c_m.move_constructions == 5\n    assert c_mc.copy_assignments + c_mc.copy_constructions == 0\n    assert c_mc.move_assignments == 2\n    assert c_mc.move_constructions == 5\n    assert c_c.copy_assignments == 2\n    assert c_c.copy_constructions == 5\n    assert c_m.alive() + c_mc.alive() + c_c.alive() == 0\n\n\ndef test_private_op_new():\n    \"\"\"An object with a private `operator new` cannot be returned by value\"\"\"\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.private_op_new_value()\n    assert \"is neither movable nor copyable\" in str(excinfo.value)\n\n    assert m.private_op_new_reference().value == 1\n\n\ndef test_move_fallback():\n    \"\"\"#389: rvp::move should fall-through to copy on non-movable objects\"\"\"\n\n    m1 = m.get_moveissue1(1)\n    assert m1.value == 1\n    m2 = m.get_moveissue2(2)\n    assert m2.value == 2\n\n\ndef test_pytype_rvalue_cast():\n    \"\"\"Make sure that cast from pytype rvalue to other pytype works\"\"\"\n\n    value = m.get_pytype_rvalue_castissue(1.0)\n    assert value == 1\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_custom_type_casters.cpp",
    "content": "/*\n    tests/test_custom_type_casters.cpp -- tests type_caster<T>\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\n// py::arg/py::arg_v testing: these arguments just record their argument when invoked\nclass ArgInspector1 {\npublic:\n    std::string arg = \"(default arg inspector 1)\";\n};\nclass ArgInspector2 {\npublic:\n    std::string arg = \"(default arg inspector 2)\";\n};\nclass ArgAlwaysConverts {};\n\nnamespace PYBIND11_NAMESPACE {\nnamespace detail {\ntemplate <>\nstruct type_caster<ArgInspector1> {\npublic:\n    // Classic\n#ifdef PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY\n    PYBIND11_TYPE_CASTER(ArgInspector1, _(\"ArgInspector1\"));\n#else\n    PYBIND11_TYPE_CASTER(ArgInspector1, const_name(\"ArgInspector1\"));\n#endif\n\n    bool load(handle src, bool convert) {\n        value.arg = \"loading ArgInspector1 argument \" + std::string(convert ? \"WITH\" : \"WITHOUT\")\n                    + \" conversion allowed.  \"\n                      \"Argument value = \"\n                    + (std::string) str(src);\n        return true;\n    }\n\n    static handle cast(const ArgInspector1 &src, return_value_policy, handle) {\n        return str(src.arg).release();\n    }\n};\ntemplate <>\nstruct type_caster<ArgInspector2> {\npublic:\n    PYBIND11_TYPE_CASTER(ArgInspector2, const_name(\"ArgInspector2\"));\n\n    bool load(handle src, bool convert) {\n        value.arg = \"loading ArgInspector2 argument \" + std::string(convert ? \"WITH\" : \"WITHOUT\")\n                    + \" conversion allowed.  \"\n                      \"Argument value = \"\n                    + (std::string) str(src);\n        return true;\n    }\n\n    static handle cast(const ArgInspector2 &src, return_value_policy, handle) {\n        return str(src.arg).release();\n    }\n};\ntemplate <>\nstruct type_caster<ArgAlwaysConverts> {\npublic:\n    PYBIND11_TYPE_CASTER(ArgAlwaysConverts, const_name(\"ArgAlwaysConverts\"));\n\n    bool load(handle, bool convert) { return convert; }\n\n    static handle cast(const ArgAlwaysConverts &, return_value_policy, handle) {\n        return py::none().release();\n    }\n};\n} // namespace detail\n} // namespace PYBIND11_NAMESPACE\n\n// test_custom_caster_destruction\nclass DestructionTester {\npublic:\n    DestructionTester() { print_default_created(this); }\n    ~DestructionTester() { print_destroyed(this); }\n    DestructionTester(const DestructionTester &) { print_copy_created(this); }\n    DestructionTester(DestructionTester &&) noexcept { print_move_created(this); }\n    DestructionTester &operator=(const DestructionTester &) {\n        print_copy_assigned(this);\n        return *this;\n    }\n    DestructionTester &operator=(DestructionTester &&) noexcept {\n        print_move_assigned(this);\n        return *this;\n    }\n};\nnamespace PYBIND11_NAMESPACE {\nnamespace detail {\ntemplate <>\nstruct type_caster<DestructionTester> {\n    PYBIND11_TYPE_CASTER(DestructionTester, const_name(\"DestructionTester\"));\n    bool load(handle, bool) { return true; }\n\n    static handle cast(const DestructionTester &, return_value_policy, handle) {\n        return py::bool_(true).release();\n    }\n};\n} // namespace detail\n} // namespace PYBIND11_NAMESPACE\n\n// Define type caster outside of `pybind11::detail` and then alias it.\nnamespace other_lib {\nstruct MyType {};\n// Corrupt `py` shorthand alias for surrounding context.\nnamespace py {}\n// Corrupt unqualified relative `pybind11` namespace.\nnamespace PYBIND11_NAMESPACE {}\n// Correct alias.\nnamespace py_ = ::pybind11;\n// Define caster. This is effectively no-op, we only ensure it compiles and we\n// don't have any symbol collision when using macro mixin.\nstruct my_caster {\n    PYBIND11_TYPE_CASTER(MyType, py_::detail::const_name(\"MyType\"));\n    bool load(py_::handle, bool) { return true; }\n\n    static py_::handle cast(const MyType &, py_::return_value_policy, py_::handle) {\n        return py_::bool_(true).release();\n    }\n};\n} // namespace other_lib\n// Effectively \"alias\" it into correct namespace (via inheritance).\nnamespace PYBIND11_NAMESPACE {\nnamespace detail {\ntemplate <>\nstruct type_caster<other_lib::MyType> : public other_lib::my_caster {};\n} // namespace detail\n} // namespace PYBIND11_NAMESPACE\n\nTEST_SUBMODULE(custom_type_casters, m) {\n    // test_custom_type_casters\n\n    // test_noconvert_args\n    //\n    // Test converting.  The ArgAlwaysConverts is just there to make the first no-conversion pass\n    // fail so that our call always ends up happening via the second dispatch (the one that allows\n    // some conversion).\n    class ArgInspector {\n    public:\n        ArgInspector1 f(ArgInspector1 a, ArgAlwaysConverts) { return a; }\n        std::string g(const ArgInspector1 &a,\n                      const ArgInspector1 &b,\n                      int c,\n                      ArgInspector2 *d,\n                      ArgAlwaysConverts) {\n            return a.arg + \"\\n\" + b.arg + \"\\n\" + std::to_string(c) + \"\\n\" + d->arg;\n        }\n        static ArgInspector2 h(ArgInspector2 a, ArgAlwaysConverts) { return a; }\n    };\n    // [workaround(intel)] ICC 20/21 breaks with py::arg().stuff, using py::arg{}.stuff works.\n    py::class_<ArgInspector>(m, \"ArgInspector\")\n        .def(py::init<>())\n        .def(\"f\", &ArgInspector::f, py::arg(), py::arg() = ArgAlwaysConverts())\n        .def(\"g\",\n             &ArgInspector::g,\n             \"a\"_a.noconvert(),\n             \"b\"_a,\n             \"c\"_a.noconvert() = 13,\n             \"d\"_a = ArgInspector2(),\n             py::arg() = ArgAlwaysConverts())\n        .def_static(\"h\", &ArgInspector::h, py::arg{}.noconvert(), py::arg() = ArgAlwaysConverts());\n    m.def(\n        \"arg_inspect_func\",\n        [](const ArgInspector2 &a, const ArgInspector1 &b, ArgAlwaysConverts) {\n            return a.arg + \"\\n\" + b.arg;\n        },\n        py::arg{}.noconvert(false),\n        py::arg_v(nullptr, ArgInspector1()).noconvert(true),\n        py::arg() = ArgAlwaysConverts());\n\n    m.def(\n        \"floats_preferred\", [](double f) { return 0.5 * f; }, \"f\"_a);\n    m.def(\n        \"floats_only\", [](double f) { return 0.5 * f; }, \"f\"_a.noconvert());\n    m.def(\n        \"ints_preferred\", [](int i) { return i / 2; }, \"i\"_a);\n    m.def(\n        \"ints_only\", [](int i) { return i / 2; }, \"i\"_a.noconvert());\n\n    // test_custom_caster_destruction\n    // Test that `take_ownership` works on types with a custom type caster when given a pointer\n\n    // default policy: don't take ownership:\n    m.def(\"custom_caster_no_destroy\", []() {\n        static auto *dt = new DestructionTester();\n        return dt;\n    });\n\n    m.def(\n        \"custom_caster_destroy\",\n        []() { return new DestructionTester(); },\n        py::return_value_policy::take_ownership); // Takes ownership: destroy when finished\n    m.def(\n        \"custom_caster_destroy_const\",\n        []() -> const DestructionTester * { return new DestructionTester(); },\n        py::return_value_policy::take_ownership); // Likewise (const doesn't inhibit destruction)\n    m.def(\"destruction_tester_cstats\",\n          &ConstructorStats::get<DestructionTester>,\n          py::return_value_policy::reference);\n\n    m.def(\"other_lib_type\", [](other_lib::MyType x) { return x; });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_custom_type_casters.py",
    "content": "import pytest\n\nfrom pybind11_tests import custom_type_casters as m\n\n\ndef test_noconvert_args(msg):\n    a = m.ArgInspector()\n    assert (\n        msg(a.f(\"hi\"))\n        == \"\"\"\n        loading ArgInspector1 argument WITH conversion allowed.  Argument value = hi\n    \"\"\"\n    )\n    assert (\n        msg(a.g(\"this is a\", \"this is b\"))\n        == \"\"\"\n        loading ArgInspector1 argument WITHOUT conversion allowed.  Argument value = this is a\n        loading ArgInspector1 argument WITH conversion allowed.  Argument value = this is b\n        13\n        loading ArgInspector2 argument WITH conversion allowed.  Argument value = (default arg inspector 2)\n    \"\"\"\n    )\n    assert (\n        msg(a.g(\"this is a\", \"this is b\", 42))\n        == \"\"\"\n        loading ArgInspector1 argument WITHOUT conversion allowed.  Argument value = this is a\n        loading ArgInspector1 argument WITH conversion allowed.  Argument value = this is b\n        42\n        loading ArgInspector2 argument WITH conversion allowed.  Argument value = (default arg inspector 2)\n    \"\"\"\n    )\n    assert (\n        msg(a.g(\"this is a\", \"this is b\", 42, \"this is d\"))\n        == \"\"\"\n        loading ArgInspector1 argument WITHOUT conversion allowed.  Argument value = this is a\n        loading ArgInspector1 argument WITH conversion allowed.  Argument value = this is b\n        42\n        loading ArgInspector2 argument WITH conversion allowed.  Argument value = this is d\n    \"\"\"\n    )\n    assert (\n        a.h(\"arg 1\")\n        == \"loading ArgInspector2 argument WITHOUT conversion allowed.  Argument value = arg 1\"\n    )\n    assert (\n        msg(m.arg_inspect_func(\"A1\", \"A2\"))\n        == \"\"\"\n        loading ArgInspector2 argument WITH conversion allowed.  Argument value = A1\n        loading ArgInspector1 argument WITHOUT conversion allowed.  Argument value = A2\n    \"\"\"\n    )\n\n    assert m.floats_preferred(4) == 2.0\n    assert m.floats_only(4.0) == 2.0\n    with pytest.raises(TypeError) as excinfo:\n        m.floats_only(4)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        floats_only(): incompatible function arguments. The following argument types are supported:\n            1. (f: float) -> float\n\n        Invoked with: 4\n    \"\"\"\n    )\n\n    assert m.ints_preferred(4) == 2\n    assert m.ints_preferred(True) == 0\n    with pytest.raises(TypeError) as excinfo:\n        m.ints_preferred(4.0)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        ints_preferred(): incompatible function arguments. The following argument types are supported:\n            1. (i: int) -> int\n\n        Invoked with: 4.0\n    \"\"\"\n    )\n\n    assert m.ints_only(4) == 2\n    with pytest.raises(TypeError) as excinfo:\n        m.ints_only(4.0)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        ints_only(): incompatible function arguments. The following argument types are supported:\n            1. (i: int) -> int\n\n        Invoked with: 4.0\n    \"\"\"\n    )\n\n\ndef test_custom_caster_destruction():\n    \"\"\"Tests that returning a pointer to a type that gets converted with a custom type caster gets\n    destroyed when the function has py::return_value_policy::take_ownership policy applied.\n    \"\"\"\n\n    cstats = m.destruction_tester_cstats()\n    # This one *doesn't* have take_ownership: the pointer should be used but not destroyed:\n    z = m.custom_caster_no_destroy()\n    assert cstats.alive() == 1 and cstats.default_constructions == 1\n    assert z\n\n    # take_ownership applied: this constructs a new object, casts it, then destroys it:\n    z = m.custom_caster_destroy()\n    assert z\n    assert cstats.default_constructions == 2\n\n    # Same, but with a const pointer return (which should *not* inhibit destruction):\n    z = m.custom_caster_destroy_const()\n    assert z\n    assert cstats.default_constructions == 3\n\n    # Make sure we still only have the original object (from ..._no_destroy()) alive:\n    assert cstats.alive() == 1\n\n\ndef test_custom_caster_other_lib():\n    assert m.other_lib_type(True)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_custom_type_setup.cpp",
    "content": "/*\n    tests/test_custom_type_setup.cpp -- Tests `pybind11::custom_type_setup`\n\n    Copyright (c) Google LLC\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/pybind11.h>\n\n#include \"pybind11_tests.h\"\n\nnamespace py = pybind11;\n\nnamespace {\n\nstruct OwnsPythonObjects {\n    py::object value = py::none();\n};\n} // namespace\n\nTEST_SUBMODULE(custom_type_setup, m) {\n    py::class_<OwnsPythonObjects> cls(\n        m, \"OwnsPythonObjects\", py::custom_type_setup([](PyHeapTypeObject *heap_type) {\n            auto *type = &heap_type->ht_type;\n            type->tp_flags |= Py_TPFLAGS_HAVE_GC;\n            type->tp_traverse = [](PyObject *self_base, visitproc visit, void *arg) {\n                auto &self = py::cast<OwnsPythonObjects &>(py::handle(self_base));\n                Py_VISIT(self.value.ptr());\n                return 0;\n            };\n            type->tp_clear = [](PyObject *self_base) {\n                auto &self = py::cast<OwnsPythonObjects &>(py::handle(self_base));\n                self.value = py::none();\n                return 0;\n            };\n        }));\n    cls.def(py::init<>());\n    cls.def_readwrite(\"value\", &OwnsPythonObjects::value);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_custom_type_setup.py",
    "content": "import gc\nimport weakref\n\nimport pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import custom_type_setup as m\n\n\n@pytest.fixture\ndef gc_tester():\n    \"\"\"Tests that an object is garbage collected.\n\n    Assumes that any unreferenced objects are fully collected after calling\n    `gc.collect()`.  That is true on CPython, but does not appear to reliably\n    hold on PyPy.\n    \"\"\"\n\n    weak_refs = []\n\n    def add_ref(obj):\n        # PyPy does not support `gc.is_tracked`.\n        if hasattr(gc, \"is_tracked\"):\n            assert gc.is_tracked(obj)\n        weak_refs.append(weakref.ref(obj))\n\n    yield add_ref\n\n    gc.collect()\n    for ref in weak_refs:\n        assert ref() is None\n\n\n# PyPy does not seem to reliably garbage collect.\n@pytest.mark.skipif(\"env.PYPY\")\ndef test_self_cycle(gc_tester):\n    obj = m.OwnsPythonObjects()\n    obj.value = obj\n    gc_tester(obj)\n\n\n# PyPy does not seem to reliably garbage collect.\n@pytest.mark.skipif(\"env.PYPY\")\ndef test_indirect_cycle(gc_tester):\n    obj = m.OwnsPythonObjects()\n    obj_list = [obj]\n    obj.value = obj_list\n    gc_tester(obj)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_docstring_options.cpp",
    "content": "/*\n    tests/test_docstring_options.cpp -- generation of docstrings and signatures\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"pybind11_tests.h\"\n\nTEST_SUBMODULE(docstring_options, m) {\n    // test_docstring_options\n    {\n        py::options options;\n        options.disable_function_signatures();\n\n        m.def(\n            \"test_function1\", [](int, int) {}, py::arg(\"a\"), py::arg(\"b\"));\n        m.def(\n            \"test_function2\", [](int, int) {}, py::arg(\"a\"), py::arg(\"b\"), \"A custom docstring\");\n\n        m.def(\n            \"test_overloaded1\", [](int) {}, py::arg(\"i\"), \"Overload docstring\");\n        m.def(\n            \"test_overloaded1\", [](double) {}, py::arg(\"d\"));\n\n        m.def(\n            \"test_overloaded2\", [](int) {}, py::arg(\"i\"), \"overload docstring 1\");\n        m.def(\n            \"test_overloaded2\", [](double) {}, py::arg(\"d\"), \"overload docstring 2\");\n\n        m.def(\n            \"test_overloaded3\", [](int) {}, py::arg(\"i\"));\n        m.def(\n            \"test_overloaded3\", [](double) {}, py::arg(\"d\"), \"Overload docstr\");\n\n        options.enable_function_signatures();\n\n        m.def(\n            \"test_function3\", [](int, int) {}, py::arg(\"a\"), py::arg(\"b\"));\n        m.def(\n            \"test_function4\", [](int, int) {}, py::arg(\"a\"), py::arg(\"b\"), \"A custom docstring\");\n\n        options.disable_function_signatures().disable_user_defined_docstrings();\n\n        m.def(\n            \"test_function5\", [](int, int) {}, py::arg(\"a\"), py::arg(\"b\"), \"A custom docstring\");\n\n        {\n            py::options nested_options;\n            nested_options.enable_user_defined_docstrings();\n            m.def(\n                \"test_function6\",\n                [](int, int) {},\n                py::arg(\"a\"),\n                py::arg(\"b\"),\n                \"A custom docstring\");\n        }\n    }\n\n    m.def(\n        \"test_function7\", [](int, int) {}, py::arg(\"a\"), py::arg(\"b\"), \"A custom docstring\");\n\n    {\n        py::options options;\n        options.disable_user_defined_docstrings();\n        options.disable_function_signatures();\n\n        m.def(\"test_function8\", []() {});\n    }\n\n    {\n        py::options options;\n        options.disable_user_defined_docstrings();\n\n        struct DocstringTestFoo {\n            int value;\n            void setValue(int v) { value = v; }\n            int getValue() const { return value; }\n        };\n        py::class_<DocstringTestFoo>(m, \"DocstringTestFoo\", \"This is a class docstring\")\n            .def_property(\"value_prop\",\n                          &DocstringTestFoo::getValue,\n                          &DocstringTestFoo::setValue,\n                          \"This is a property docstring\");\n    }\n\n    {\n        enum class DocstringTestEnum1 { Member1, Member2 };\n\n        py::enum_<DocstringTestEnum1>(m, \"DocstringTestEnum1\", \"Enum docstring\")\n            .value(\"Member1\", DocstringTestEnum1::Member1)\n            .value(\"Member2\", DocstringTestEnum1::Member2);\n    }\n\n    {\n        py::options options;\n        options.enable_enum_members_docstring();\n\n        enum class DocstringTestEnum2 { Member1, Member2 };\n\n        py::enum_<DocstringTestEnum2>(m, \"DocstringTestEnum2\", \"Enum docstring\")\n            .value(\"Member1\", DocstringTestEnum2::Member1)\n            .value(\"Member2\", DocstringTestEnum2::Member2);\n    }\n\n    {\n        py::options options;\n        options.disable_enum_members_docstring();\n\n        enum class DocstringTestEnum3 { Member1, Member2 };\n\n        py::enum_<DocstringTestEnum3>(m, \"DocstringTestEnum3\", \"Enum docstring\")\n            .value(\"Member1\", DocstringTestEnum3::Member1)\n            .value(\"Member2\", DocstringTestEnum3::Member2);\n    }\n\n    {\n        py::options options;\n        options.disable_user_defined_docstrings();\n\n        enum class DocstringTestEnum4 { Member1, Member2 };\n\n        py::enum_<DocstringTestEnum4>(m, \"DocstringTestEnum4\", \"Enum docstring\")\n            .value(\"Member1\", DocstringTestEnum4::Member1)\n            .value(\"Member2\", DocstringTestEnum4::Member2);\n    }\n\n    {\n        py::options options;\n        options.disable_user_defined_docstrings();\n        options.disable_enum_members_docstring();\n\n        enum class DocstringTestEnum5 { Member1, Member2 };\n\n        py::enum_<DocstringTestEnum5>(m, \"DocstringTestEnum5\", \"Enum docstring\")\n            .value(\"Member1\", DocstringTestEnum5::Member1)\n            .value(\"Member2\", DocstringTestEnum5::Member2);\n    }\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_docstring_options.py",
    "content": "from pybind11_tests import docstring_options as m\n\n\ndef test_docstring_options():\n    # options.disable_function_signatures()\n    assert not m.test_function1.__doc__\n\n    assert m.test_function2.__doc__ == \"A custom docstring\"\n\n    # docstring specified on just the first overload definition:\n    assert m.test_overloaded1.__doc__ == \"Overload docstring\"\n\n    # docstring on both overloads:\n    assert m.test_overloaded2.__doc__ == \"overload docstring 1\\noverload docstring 2\"\n\n    # docstring on only second overload:\n    assert m.test_overloaded3.__doc__ == \"Overload docstr\"\n\n    # options.enable_function_signatures()\n    assert m.test_function3.__doc__.startswith(\"test_function3(a: int, b: int) -> None\")\n\n    assert m.test_function4.__doc__.startswith(\"test_function4(a: int, b: int) -> None\")\n    assert m.test_function4.__doc__.endswith(\"A custom docstring\\n\")\n\n    # options.disable_function_signatures()\n    # options.disable_user_defined_docstrings()\n    assert not m.test_function5.__doc__\n\n    # nested options.enable_user_defined_docstrings()\n    assert m.test_function6.__doc__ == \"A custom docstring\"\n\n    # RAII destructor\n    assert m.test_function7.__doc__.startswith(\"test_function7(a: int, b: int) -> None\")\n    assert m.test_function7.__doc__.endswith(\"A custom docstring\\n\")\n\n    # when all options are disabled, no docstring (instead of an empty one) should be generated\n    assert m.test_function8.__doc__ is None\n\n    # Suppression of user-defined docstrings for non-function objects\n    assert not m.DocstringTestFoo.__doc__\n    assert not m.DocstringTestFoo.value_prop.__doc__\n\n    # Check existig behaviour of enum docstings\n    assert (\n        m.DocstringTestEnum1.__doc__\n        == \"Enum docstring\\n\\nMembers:\\n\\n  Member1\\n\\n  Member2\"\n    )\n\n    # options.enable_enum_members_docstring()\n    assert (\n        m.DocstringTestEnum2.__doc__\n        == \"Enum docstring\\n\\nMembers:\\n\\n  Member1\\n\\n  Member2\"\n    )\n\n    # options.disable_enum_members_docstring()\n    assert m.DocstringTestEnum3.__doc__ == \"Enum docstring\"\n\n    # options.disable_user_defined_docstrings()\n    assert m.DocstringTestEnum4.__doc__ == \"Members:\\n\\n  Member1\\n\\n  Member2\"\n\n    # options.disable_user_defined_docstrings()\n    # options.disable_enum_members_docstring()\n    # When all options are disabled, no docstring (instead of an empty one) should be generated\n    assert m.DocstringTestEnum5.__doc__ is None\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_eigen_matrix.cpp",
    "content": "/*\n    tests/eigen.cpp -- automatic conversion of Eigen types\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/eigen/matrix.h>\n#include <pybind11/stl.h>\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\nPYBIND11_WARNING_DISABLE_MSVC(4996)\n\n#include <Eigen/Cholesky>\n\nusing MatrixXdR = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;\n\n// Sets/resets a testing reference matrix to have values of 10*r + c, where r and c are the\n// (1-based) row/column number.\ntemplate <typename M>\nvoid reset_ref(M &x) {\n    for (int i = 0; i < x.rows(); i++) {\n        for (int j = 0; j < x.cols(); j++) {\n            x(i, j) = 11 + 10 * i + j;\n        }\n    }\n}\n\n// Returns a static, column-major matrix\nEigen::MatrixXd &get_cm() {\n    static Eigen::MatrixXd *x;\n    if (!x) {\n        x = new Eigen::MatrixXd(3, 3);\n        reset_ref(*x);\n    }\n    return *x;\n}\n// Likewise, but row-major\nMatrixXdR &get_rm() {\n    static MatrixXdR *x;\n    if (!x) {\n        x = new MatrixXdR(3, 3);\n        reset_ref(*x);\n    }\n    return *x;\n}\n// Resets the values of the static matrices returned by get_cm()/get_rm()\nvoid reset_refs() {\n    reset_ref(get_cm());\n    reset_ref(get_rm());\n}\n\n// Returns element 2,1 from a matrix (used to test copy/nocopy)\ndouble get_elem(const Eigen::Ref<const Eigen::MatrixXd> &m) { return m(2, 1); };\n\n// Returns a matrix with 10*r + 100*c added to each matrix element (to help test that the matrix\n// reference is referencing rows/columns correctly).\ntemplate <typename MatrixArgType>\nEigen::MatrixXd adjust_matrix(MatrixArgType m) {\n    Eigen::MatrixXd ret(m);\n    for (int c = 0; c < m.cols(); c++) {\n        for (int r = 0; r < m.rows(); r++) {\n            ret(r, c) += 10 * r + 100 * c; // NOLINT(clang-analyzer-core.uninitialized.Assign)\n        }\n    }\n    return ret;\n}\n\nstruct CustomOperatorNew {\n    CustomOperatorNew() = default;\n\n    Eigen::Matrix4d a = Eigen::Matrix4d::Zero();\n    Eigen::Matrix4d b = Eigen::Matrix4d::Identity();\n\n    EIGEN_MAKE_ALIGNED_OPERATOR_NEW;\n};\n\nTEST_SUBMODULE(eigen_matrix, m) {\n    using FixedMatrixR = Eigen::Matrix<float, 5, 6, Eigen::RowMajor>;\n    using FixedMatrixC = Eigen::Matrix<float, 5, 6>;\n    using DenseMatrixR = Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;\n    using DenseMatrixC = Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic>;\n    using FourRowMatrixC = Eigen::Matrix<float, 4, Eigen::Dynamic>;\n    using FourColMatrixC = Eigen::Matrix<float, Eigen::Dynamic, 4>;\n    using FourRowMatrixR = Eigen::Matrix<float, 4, Eigen::Dynamic>;\n    using FourColMatrixR = Eigen::Matrix<float, Eigen::Dynamic, 4>;\n    using SparseMatrixR = Eigen::SparseMatrix<float, Eigen::RowMajor>;\n    using SparseMatrixC = Eigen::SparseMatrix<float>;\n\n    // various tests\n    m.def(\"double_col\", [](const Eigen::VectorXf &x) -> Eigen::VectorXf { return 2.0f * x; });\n    m.def(\"double_row\",\n          [](const Eigen::RowVectorXf &x) -> Eigen::RowVectorXf { return 2.0f * x; });\n    m.def(\"double_complex\",\n          [](const Eigen::VectorXcf &x) -> Eigen::VectorXcf { return 2.0f * x; });\n    m.def(\"double_threec\", [](py::EigenDRef<Eigen::Vector3f> x) { x *= 2; });\n    m.def(\"double_threer\", [](py::EigenDRef<Eigen::RowVector3f> x) { x *= 2; });\n    m.def(\"double_mat_cm\", [](const Eigen::MatrixXf &x) -> Eigen::MatrixXf { return 2.0f * x; });\n    m.def(\"double_mat_rm\", [](const DenseMatrixR &x) -> DenseMatrixR { return 2.0f * x; });\n\n    // test_eigen_ref_to_python\n    // Different ways of passing via Eigen::Ref; the first and second are the Eigen-recommended\n    m.def(\"cholesky1\",\n          [](const Eigen::Ref<MatrixXdR> &x) -> Eigen::MatrixXd { return x.llt().matrixL(); });\n    m.def(\"cholesky2\", [](const Eigen::Ref<const MatrixXdR> &x) -> Eigen::MatrixXd {\n        return x.llt().matrixL();\n    });\n    m.def(\"cholesky3\",\n          [](const Eigen::Ref<MatrixXdR> &x) -> Eigen::MatrixXd { return x.llt().matrixL(); });\n    m.def(\"cholesky4\", [](const Eigen::Ref<const MatrixXdR> &x) -> Eigen::MatrixXd {\n        return x.llt().matrixL();\n    });\n\n    // test_eigen_ref_mutators\n    // Mutators: these add some value to the given element using Eigen, but Eigen should be mapping\n    // into the numpy array data and so the result should show up there.  There are three versions:\n    // one that works on a contiguous-row matrix (numpy's default), one for a contiguous-column\n    // matrix, and one for any matrix.\n    auto add_rm = [](Eigen::Ref<MatrixXdR> x, int r, int c, double v) { x(r, c) += v; };\n    auto add_cm = [](Eigen::Ref<Eigen::MatrixXd> x, int r, int c, double v) { x(r, c) += v; };\n\n    // Mutators (Eigen maps into numpy variables):\n    m.def(\"add_rm\", add_rm); // Only takes row-contiguous\n    m.def(\"add_cm\", add_cm); // Only takes column-contiguous\n    // Overloaded versions that will accept either row or column contiguous:\n    m.def(\"add1\", add_rm);\n    m.def(\"add1\", add_cm);\n    m.def(\"add2\", add_cm);\n    m.def(\"add2\", add_rm);\n    // This one accepts a matrix of any stride:\n    m.def(\"add_any\",\n          [](py::EigenDRef<Eigen::MatrixXd> x, int r, int c, double v) { x(r, c) += v; });\n\n    // Return mutable references (numpy maps into eigen variables)\n    m.def(\"get_cm_ref\", []() { return Eigen::Ref<Eigen::MatrixXd>(get_cm()); });\n    m.def(\"get_rm_ref\", []() { return Eigen::Ref<MatrixXdR>(get_rm()); });\n    // The same references, but non-mutable (numpy maps into eigen variables, but is !writeable)\n    m.def(\"get_cm_const_ref\", []() { return Eigen::Ref<const Eigen::MatrixXd>(get_cm()); });\n    m.def(\"get_rm_const_ref\", []() { return Eigen::Ref<const MatrixXdR>(get_rm()); });\n\n    m.def(\"reset_refs\", reset_refs); // Restores get_{cm,rm}_ref to original values\n\n    // Increments and returns ref to (same) matrix\n    m.def(\n        \"incr_matrix\",\n        [](Eigen::Ref<Eigen::MatrixXd> m, double v) {\n            m += Eigen::MatrixXd::Constant(m.rows(), m.cols(), v);\n            return m;\n        },\n        py::return_value_policy::reference);\n\n    // Same, but accepts a matrix of any strides\n    m.def(\n        \"incr_matrix_any\",\n        [](py::EigenDRef<Eigen::MatrixXd> m, double v) {\n            m += Eigen::MatrixXd::Constant(m.rows(), m.cols(), v);\n            return m;\n        },\n        py::return_value_policy::reference);\n\n    // Returns an eigen slice of even rows\n    m.def(\n        \"even_rows\",\n        [](py::EigenDRef<Eigen::MatrixXd> m) {\n            return py::EigenDMap<Eigen::MatrixXd>(\n                m.data(),\n                (m.rows() + 1) / 2,\n                m.cols(),\n                py::EigenDStride(m.outerStride(), 2 * m.innerStride()));\n        },\n        py::return_value_policy::reference);\n\n    // Returns an eigen slice of even columns\n    m.def(\n        \"even_cols\",\n        [](py::EigenDRef<Eigen::MatrixXd> m) {\n            return py::EigenDMap<Eigen::MatrixXd>(\n                m.data(),\n                m.rows(),\n                (m.cols() + 1) / 2,\n                py::EigenDStride(2 * m.outerStride(), m.innerStride()));\n        },\n        py::return_value_policy::reference);\n\n    // Returns diagonals: a vector-like object with an inner stride != 1\n    m.def(\"diagonal\", [](const Eigen::Ref<const Eigen::MatrixXd> &x) { return x.diagonal(); });\n    m.def(\"diagonal_1\",\n          [](const Eigen::Ref<const Eigen::MatrixXd> &x) { return x.diagonal<1>(); });\n    m.def(\"diagonal_n\",\n          [](const Eigen::Ref<const Eigen::MatrixXd> &x, int index) { return x.diagonal(index); });\n\n    // Return a block of a matrix (gives non-standard strides)\n    m.def(\"block\",\n          [m](const py::object &x_obj,\n              int start_row,\n              int start_col,\n              int block_rows,\n              int block_cols) {\n              return m.attr(\"_block\")(x_obj, x_obj, start_row, start_col, block_rows, block_cols);\n          });\n\n    m.def(\n        \"_block\",\n        [](const py::object &x_obj,\n           const Eigen::Ref<const Eigen::MatrixXd> &x,\n           int start_row,\n           int start_col,\n           int block_rows,\n           int block_cols) {\n            // See PR #4217 for background. This test is a bit over the top, but might be useful\n            // as a concrete example to point to when explaining the dangling reference trap.\n            auto i0 = py::make_tuple(0, 0);\n            auto x0_orig = x_obj[*i0].cast<double>();\n            if (x(0, 0) != x0_orig) {\n                throw std::runtime_error(\n                    \"Something in the type_caster for Eigen::Ref is terribly wrong.\");\n            }\n            double x0_mod = x0_orig + 1;\n            x_obj[*i0] = x0_mod;\n            auto copy_detected = (x(0, 0) != x0_mod);\n            x_obj[*i0] = x0_orig;\n            if (copy_detected) {\n                throw std::runtime_error(\"type_caster for Eigen::Ref made a copy.\");\n            }\n            return x.block(start_row, start_col, block_rows, block_cols);\n        },\n        py::keep_alive<0, 1>());\n\n    // test_eigen_return_references, test_eigen_keepalive\n    // return value referencing/copying tests:\n    class ReturnTester {\n        Eigen::MatrixXd mat = create();\n\n    public:\n        ReturnTester() { print_created(this); }\n        ~ReturnTester() { print_destroyed(this); }\n        static Eigen::MatrixXd create() { return Eigen::MatrixXd::Ones(10, 10); }\n        // NOLINTNEXTLINE(readability-const-return-type)\n        static const Eigen::MatrixXd createConst() { return Eigen::MatrixXd::Ones(10, 10); }\n        Eigen::MatrixXd &get() { return mat; }\n        Eigen::MatrixXd *getPtr() { return &mat; }\n        const Eigen::MatrixXd &view() { return mat; }\n        const Eigen::MatrixXd *viewPtr() { return &mat; }\n        Eigen::Ref<Eigen::MatrixXd> ref() { return mat; }\n        Eigen::Ref<const Eigen::MatrixXd> refConst() { return mat; }\n        Eigen::Block<Eigen::MatrixXd> block(int r, int c, int nrow, int ncol) {\n            return mat.block(r, c, nrow, ncol);\n        }\n        Eigen::Block<const Eigen::MatrixXd> blockConst(int r, int c, int nrow, int ncol) const {\n            return mat.block(r, c, nrow, ncol);\n        }\n        py::EigenDMap<Eigen::Matrix2d> corners() {\n            return py::EigenDMap<Eigen::Matrix2d>(\n                mat.data(),\n                py::EigenDStride(mat.outerStride() * (mat.outerSize() - 1),\n                                 mat.innerStride() * (mat.innerSize() - 1)));\n        }\n        py::EigenDMap<const Eigen::Matrix2d> cornersConst() const {\n            return py::EigenDMap<const Eigen::Matrix2d>(\n                mat.data(),\n                py::EigenDStride(mat.outerStride() * (mat.outerSize() - 1),\n                                 mat.innerStride() * (mat.innerSize() - 1)));\n        }\n    };\n    using rvp = py::return_value_policy;\n    py::class_<ReturnTester>(m, \"ReturnTester\")\n        .def(py::init<>())\n        .def_static(\"create\", &ReturnTester::create)\n        .def_static(\"create_const\", &ReturnTester::createConst)\n        .def(\"get\", &ReturnTester::get, rvp::reference_internal)\n        .def(\"get_ptr\", &ReturnTester::getPtr, rvp::reference_internal)\n        .def(\"view\", &ReturnTester::view, rvp::reference_internal)\n        .def(\"view_ptr\", &ReturnTester::view, rvp::reference_internal)\n        .def(\"copy_get\", &ReturnTester::get)       // Default rvp: copy\n        .def(\"copy_view\", &ReturnTester::view)     //         \"\n        .def(\"ref\", &ReturnTester::ref)            // Default for Ref is to reference\n        .def(\"ref_const\", &ReturnTester::refConst) // Likewise, but const\n        .def(\"ref_safe\", &ReturnTester::ref, rvp::reference_internal)\n        .def(\"ref_const_safe\", &ReturnTester::refConst, rvp::reference_internal)\n        .def(\"copy_ref\", &ReturnTester::ref, rvp::copy)\n        .def(\"copy_ref_const\", &ReturnTester::refConst, rvp::copy)\n        .def(\"block\", &ReturnTester::block)\n        .def(\"block_safe\", &ReturnTester::block, rvp::reference_internal)\n        .def(\"block_const\", &ReturnTester::blockConst, rvp::reference_internal)\n        .def(\"copy_block\", &ReturnTester::block, rvp::copy)\n        .def(\"corners\", &ReturnTester::corners, rvp::reference_internal)\n        .def(\"corners_const\", &ReturnTester::cornersConst, rvp::reference_internal);\n\n    // test_special_matrix_objects\n    // Returns a DiagonalMatrix with diagonal (1,2,3,...)\n    m.def(\"incr_diag\", [](int k) {\n        Eigen::DiagonalMatrix<int, Eigen::Dynamic> m(k);\n        for (int i = 0; i < k; i++) {\n            m.diagonal()[i] = i + 1;\n        }\n        return m;\n    });\n\n    // Returns a SelfAdjointView referencing the lower triangle of m\n    m.def(\"symmetric_lower\",\n          [](const Eigen::MatrixXi &m) { return m.selfadjointView<Eigen::Lower>(); });\n    // Returns a SelfAdjointView referencing the lower triangle of m\n    m.def(\"symmetric_upper\",\n          [](const Eigen::MatrixXi &m) { return m.selfadjointView<Eigen::Upper>(); });\n\n    // Test matrix for various functions below.\n    Eigen::MatrixXf mat(5, 6);\n    mat << 0, 3, 0, 0, 0, 11, 22, 0, 0, 0, 17, 11, 7, 5, 0, 1, 0, 11, 0, 0, 0, 0, 0, 11, 0, 0, 14,\n        0, 8, 11;\n\n    // test_fixed, and various other tests\n    m.def(\"fixed_r\", [mat]() -> FixedMatrixR { return FixedMatrixR(mat); });\n    // Our Eigen does a hack which respects constness through the numpy writeable flag.\n    // Therefore, the const return actually affects this type despite being an rvalue.\n    // NOLINTNEXTLINE(readability-const-return-type)\n    m.def(\"fixed_r_const\", [mat]() -> const FixedMatrixR { return FixedMatrixR(mat); });\n    m.def(\"fixed_c\", [mat]() -> FixedMatrixC { return FixedMatrixC(mat); });\n    m.def(\"fixed_copy_r\", [](const FixedMatrixR &m) -> FixedMatrixR { return m; });\n    m.def(\"fixed_copy_c\", [](const FixedMatrixC &m) -> FixedMatrixC { return m; });\n    // test_mutator_descriptors\n    m.def(\"fixed_mutator_r\", [](const Eigen::Ref<FixedMatrixR> &) {});\n    m.def(\"fixed_mutator_c\", [](const Eigen::Ref<FixedMatrixC> &) {});\n    m.def(\"fixed_mutator_a\", [](const py::EigenDRef<FixedMatrixC> &) {});\n    // test_dense\n    m.def(\"dense_r\", [mat]() -> DenseMatrixR { return DenseMatrixR(mat); });\n    m.def(\"dense_c\", [mat]() -> DenseMatrixC { return DenseMatrixC(mat); });\n    m.def(\"dense_copy_r\", [](const DenseMatrixR &m) -> DenseMatrixR { return m; });\n    m.def(\"dense_copy_c\", [](const DenseMatrixC &m) -> DenseMatrixC { return m; });\n    // test_sparse, test_sparse_signature\n    m.def(\"sparse_r\", [mat]() -> SparseMatrixR {\n        // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn)\n        return Eigen::SparseView<Eigen::MatrixXf>(mat);\n    });\n    m.def(\"sparse_c\",\n          [mat]() -> SparseMatrixC { return Eigen::SparseView<Eigen::MatrixXf>(mat); });\n    m.def(\"sparse_copy_r\", [](const SparseMatrixR &m) -> SparseMatrixR { return m; });\n    m.def(\"sparse_copy_c\", [](const SparseMatrixC &m) -> SparseMatrixC { return m; });\n    // test_partially_fixed\n    m.def(\"partial_copy_four_rm_r\", [](const FourRowMatrixR &m) -> FourRowMatrixR { return m; });\n    m.def(\"partial_copy_four_rm_c\", [](const FourColMatrixR &m) -> FourColMatrixR { return m; });\n    m.def(\"partial_copy_four_cm_r\", [](const FourRowMatrixC &m) -> FourRowMatrixC { return m; });\n    m.def(\"partial_copy_four_cm_c\", [](const FourColMatrixC &m) -> FourColMatrixC { return m; });\n\n    // test_cpp_casting\n    // Test that we can cast a numpy object to a Eigen::MatrixXd explicitly\n    m.def(\"cpp_copy\", [](py::handle m) { return m.cast<Eigen::MatrixXd>()(1, 0); });\n    m.def(\"cpp_ref_c\", [](py::handle m) { return m.cast<Eigen::Ref<Eigen::MatrixXd>>()(1, 0); });\n    m.def(\"cpp_ref_r\", [](py::handle m) { return m.cast<Eigen::Ref<MatrixXdR>>()(1, 0); });\n    m.def(\"cpp_ref_any\",\n          [](py::handle m) { return m.cast<py::EigenDRef<Eigen::MatrixXd>>()(1, 0); });\n\n    // [workaround(intel)] ICC 20/21 breaks with py::arg().stuff, using py::arg{}.stuff works.\n\n    // test_nocopy_wrapper\n    // Test that we can prevent copying into an argument that would normally copy: First a version\n    // that would allow copying (if types or strides don't match) for comparison:\n    m.def(\"get_elem\", &get_elem);\n    // Now this alternative that calls the tells pybind to fail rather than copy:\n    m.def(\n        \"get_elem_nocopy\",\n        [](const Eigen::Ref<const Eigen::MatrixXd> &m) -> double { return get_elem(m); },\n        py::arg{}.noconvert());\n    // Also test a row-major-only no-copy const ref:\n    m.def(\n        \"get_elem_rm_nocopy\",\n        [](Eigen::Ref<const Eigen::Matrix<long, -1, -1, Eigen::RowMajor>> &m) -> long {\n            return m(2, 1);\n        },\n        py::arg{}.noconvert());\n\n    // test_issue738, test_zero_length\n    // Issue #738: 1×N or N×1 2D matrices were neither accepted nor properly copied with an\n    // incompatible stride value on the length-1 dimension--but that should be allowed (without\n    // requiring a copy!) because the stride value can be safely ignored on a size-1 dimension.\n    // Similarly, 0×N or N×0 matrices were not accepted--again, these should be allowed since\n    // they contain no data. This particularly affects numpy ≥ 1.23, which sets the strides to\n    // 0 if any dimension size is 0.\n    m.def(\"iss738_f1\",\n          &adjust_matrix<const Eigen::Ref<const Eigen::MatrixXd> &>,\n          py::arg{}.noconvert());\n    m.def(\"iss738_f2\",\n          &adjust_matrix<const Eigen::Ref<const Eigen::Matrix<double, -1, -1, Eigen::RowMajor>> &>,\n          py::arg{}.noconvert());\n\n    // test_issue1105\n    // Issue #1105: when converting from a numpy two-dimensional (Nx1) or (1xN) value into a dense\n    // eigen Vector or RowVector, the argument would fail to load because the numpy copy would\n    // fail: numpy won't broadcast a Nx1 into a 1-dimensional vector.\n    m.def(\"iss1105_col\", [](const Eigen::VectorXd &) { return true; });\n    m.def(\"iss1105_row\", [](const Eigen::RowVectorXd &) { return true; });\n\n    // test_named_arguments\n    // Make sure named arguments are working properly:\n    m.def(\n        \"matrix_multiply\",\n        [](const py::EigenDRef<const Eigen::MatrixXd> &A,\n           const py::EigenDRef<const Eigen::MatrixXd> &B) -> Eigen::MatrixXd {\n            if (A.cols() != B.rows()) {\n                throw std::domain_error(\"Nonconformable matrices!\");\n            }\n            return A * B;\n        },\n        py::arg(\"A\"),\n        py::arg(\"B\"));\n\n    // test_custom_operator_new\n    py::class_<CustomOperatorNew>(m, \"CustomOperatorNew\")\n        .def(py::init<>())\n        .def_readonly(\"a\", &CustomOperatorNew::a)\n        .def_readonly(\"b\", &CustomOperatorNew::b);\n\n    // test_eigen_ref_life_support\n    // In case of a failure (the caster's temp array does not live long enough), creating\n    // a new array (np.ones(10)) increases the chances that the temp array will be garbage\n    // collected and/or that its memory will be overridden with different values.\n    m.def(\"get_elem_direct\", [](const Eigen::Ref<const Eigen::VectorXd> &v) {\n        py::module_::import(\"numpy\").attr(\"ones\")(10);\n        return v(5);\n    });\n    m.def(\"get_elem_indirect\", [](std::vector<Eigen::Ref<const Eigen::VectorXd>> v) {\n        py::module_::import(\"numpy\").attr(\"ones\")(10);\n        return v[0](5);\n    });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_eigen_matrix.py",
    "content": "import pytest\n\nfrom pybind11_tests import ConstructorStats\n\nnp = pytest.importorskip(\"numpy\")\nm = pytest.importorskip(\"pybind11_tests.eigen_matrix\")\n\n\nref = np.array(\n    [\n        [0.0, 3, 0, 0, 0, 11],\n        [22, 0, 0, 0, 17, 11],\n        [7, 5, 0, 1, 0, 11],\n        [0, 0, 0, 0, 0, 11],\n        [0, 0, 14, 0, 8, 11],\n    ]\n)\n\n\ndef assert_equal_ref(mat):\n    np.testing.assert_array_equal(mat, ref)\n\n\ndef assert_sparse_equal_ref(sparse_mat):\n    assert_equal_ref(sparse_mat.toarray())\n\n\ndef test_fixed():\n    assert_equal_ref(m.fixed_c())\n    assert_equal_ref(m.fixed_r())\n    assert_equal_ref(m.fixed_copy_r(m.fixed_r()))\n    assert_equal_ref(m.fixed_copy_c(m.fixed_c()))\n    assert_equal_ref(m.fixed_copy_r(m.fixed_c()))\n    assert_equal_ref(m.fixed_copy_c(m.fixed_r()))\n\n\ndef test_dense():\n    assert_equal_ref(m.dense_r())\n    assert_equal_ref(m.dense_c())\n    assert_equal_ref(m.dense_copy_r(m.dense_r()))\n    assert_equal_ref(m.dense_copy_c(m.dense_c()))\n    assert_equal_ref(m.dense_copy_r(m.dense_c()))\n    assert_equal_ref(m.dense_copy_c(m.dense_r()))\n\n\ndef test_partially_fixed():\n    ref2 = np.array([[0.0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11], [12, 13, 14, 15]])\n    np.testing.assert_array_equal(m.partial_copy_four_rm_r(ref2), ref2)\n    np.testing.assert_array_equal(m.partial_copy_four_rm_c(ref2), ref2)\n    np.testing.assert_array_equal(m.partial_copy_four_rm_r(ref2[:, 1]), ref2[:, [1]])\n    np.testing.assert_array_equal(m.partial_copy_four_rm_c(ref2[0, :]), ref2[[0], :])\n    np.testing.assert_array_equal(\n        m.partial_copy_four_rm_r(ref2[:, (0, 2)]), ref2[:, (0, 2)]\n    )\n    np.testing.assert_array_equal(\n        m.partial_copy_four_rm_c(ref2[(3, 1, 2), :]), ref2[(3, 1, 2), :]\n    )\n\n    np.testing.assert_array_equal(m.partial_copy_four_cm_r(ref2), ref2)\n    np.testing.assert_array_equal(m.partial_copy_four_cm_c(ref2), ref2)\n    np.testing.assert_array_equal(m.partial_copy_four_cm_r(ref2[:, 1]), ref2[:, [1]])\n    np.testing.assert_array_equal(m.partial_copy_four_cm_c(ref2[0, :]), ref2[[0], :])\n    np.testing.assert_array_equal(\n        m.partial_copy_four_cm_r(ref2[:, (0, 2)]), ref2[:, (0, 2)]\n    )\n    np.testing.assert_array_equal(\n        m.partial_copy_four_cm_c(ref2[(3, 1, 2), :]), ref2[(3, 1, 2), :]\n    )\n\n    # TypeError should be raise for a shape mismatch\n    functions = [\n        m.partial_copy_four_rm_r,\n        m.partial_copy_four_rm_c,\n        m.partial_copy_four_cm_r,\n        m.partial_copy_four_cm_c,\n    ]\n    matrix_with_wrong_shape = [[1, 2], [3, 4]]\n    for f in functions:\n        with pytest.raises(TypeError) as excinfo:\n            f(matrix_with_wrong_shape)\n        assert \"incompatible function arguments\" in str(excinfo.value)\n\n\ndef test_mutator_descriptors():\n    zr = np.arange(30, dtype=\"float32\").reshape(5, 6)  # row-major\n    zc = zr.reshape(6, 5).transpose()  # column-major\n\n    m.fixed_mutator_r(zr)\n    m.fixed_mutator_c(zc)\n    m.fixed_mutator_a(zr)\n    m.fixed_mutator_a(zc)\n    with pytest.raises(TypeError) as excinfo:\n        m.fixed_mutator_r(zc)\n    assert (\n        \"(arg0: numpy.ndarray[numpy.float32[5, 6],\"\n        \" flags.writeable, flags.c_contiguous]) -> None\" in str(excinfo.value)\n    )\n    with pytest.raises(TypeError) as excinfo:\n        m.fixed_mutator_c(zr)\n    assert (\n        \"(arg0: numpy.ndarray[numpy.float32[5, 6],\"\n        \" flags.writeable, flags.f_contiguous]) -> None\" in str(excinfo.value)\n    )\n    with pytest.raises(TypeError) as excinfo:\n        m.fixed_mutator_a(np.array([[1, 2], [3, 4]], dtype=\"float32\"))\n    assert \"(arg0: numpy.ndarray[numpy.float32[5, 6], flags.writeable]) -> None\" in str(\n        excinfo.value\n    )\n    zr.flags.writeable = False\n    with pytest.raises(TypeError):\n        m.fixed_mutator_r(zr)\n    with pytest.raises(TypeError):\n        m.fixed_mutator_a(zr)\n\n\ndef test_cpp_casting():\n    assert m.cpp_copy(m.fixed_r()) == 22.0\n    assert m.cpp_copy(m.fixed_c()) == 22.0\n    z = np.array([[5.0, 6], [7, 8]])\n    assert m.cpp_copy(z) == 7.0\n    assert m.cpp_copy(m.get_cm_ref()) == 21.0\n    assert m.cpp_copy(m.get_rm_ref()) == 21.0\n    assert m.cpp_ref_c(m.get_cm_ref()) == 21.0\n    assert m.cpp_ref_r(m.get_rm_ref()) == 21.0\n    with pytest.raises(RuntimeError) as excinfo:\n        # Can't reference m.fixed_c: it contains floats, m.cpp_ref_any wants doubles\n        m.cpp_ref_any(m.fixed_c())\n    assert \"Unable to cast Python instance\" in str(excinfo.value)\n    with pytest.raises(RuntimeError) as excinfo:\n        # Can't reference m.fixed_r: it contains floats, m.cpp_ref_any wants doubles\n        m.cpp_ref_any(m.fixed_r())\n    assert \"Unable to cast Python instance\" in str(excinfo.value)\n    assert m.cpp_ref_any(m.ReturnTester.create()) == 1.0\n\n    assert m.cpp_ref_any(m.get_cm_ref()) == 21.0\n    assert m.cpp_ref_any(m.get_cm_ref()) == 21.0\n\n\ndef test_pass_readonly_array():\n    z = np.full((5, 6), 42.0)\n    z.flags.writeable = False\n    np.testing.assert_array_equal(z, m.fixed_copy_r(z))\n    np.testing.assert_array_equal(m.fixed_r_const(), m.fixed_r())\n    assert not m.fixed_r_const().flags.writeable\n    np.testing.assert_array_equal(m.fixed_copy_r(m.fixed_r_const()), m.fixed_r_const())\n\n\ndef test_nonunit_stride_from_python():\n    counting_mat = np.arange(9.0, dtype=np.float32).reshape((3, 3))\n    second_row = counting_mat[1, :]\n    second_col = counting_mat[:, 1]\n    np.testing.assert_array_equal(m.double_row(second_row), 2.0 * second_row)\n    np.testing.assert_array_equal(m.double_col(second_row), 2.0 * second_row)\n    np.testing.assert_array_equal(m.double_complex(second_row), 2.0 * second_row)\n    np.testing.assert_array_equal(m.double_row(second_col), 2.0 * second_col)\n    np.testing.assert_array_equal(m.double_col(second_col), 2.0 * second_col)\n    np.testing.assert_array_equal(m.double_complex(second_col), 2.0 * second_col)\n\n    counting_3d = np.arange(27.0, dtype=np.float32).reshape((3, 3, 3))\n    slices = [counting_3d[0, :, :], counting_3d[:, 0, :], counting_3d[:, :, 0]]\n    for ref_mat in slices:\n        np.testing.assert_array_equal(m.double_mat_cm(ref_mat), 2.0 * ref_mat)\n        np.testing.assert_array_equal(m.double_mat_rm(ref_mat), 2.0 * ref_mat)\n\n    # Mutator:\n    m.double_threer(second_row)\n    m.double_threec(second_col)\n    np.testing.assert_array_equal(counting_mat, [[0.0, 2, 2], [6, 16, 10], [6, 14, 8]])\n\n\ndef test_negative_stride_from_python(msg):\n    \"\"\"Eigen doesn't support (as of yet) negative strides. When a function takes an Eigen matrix by\n    copy or const reference, we can pass a numpy array that has negative strides.  Otherwise, an\n    exception will be thrown as Eigen will not be able to map the numpy array.\"\"\"\n\n    counting_mat = np.arange(9.0, dtype=np.float32).reshape((3, 3))\n    counting_mat = counting_mat[::-1, ::-1]\n    second_row = counting_mat[1, :]\n    second_col = counting_mat[:, 1]\n    np.testing.assert_array_equal(m.double_row(second_row), 2.0 * second_row)\n    np.testing.assert_array_equal(m.double_col(second_row), 2.0 * second_row)\n    np.testing.assert_array_equal(m.double_complex(second_row), 2.0 * second_row)\n    np.testing.assert_array_equal(m.double_row(second_col), 2.0 * second_col)\n    np.testing.assert_array_equal(m.double_col(second_col), 2.0 * second_col)\n    np.testing.assert_array_equal(m.double_complex(second_col), 2.0 * second_col)\n\n    counting_3d = np.arange(27.0, dtype=np.float32).reshape((3, 3, 3))\n    counting_3d = counting_3d[::-1, ::-1, ::-1]\n    slices = [counting_3d[0, :, :], counting_3d[:, 0, :], counting_3d[:, :, 0]]\n    for ref_mat in slices:\n        np.testing.assert_array_equal(m.double_mat_cm(ref_mat), 2.0 * ref_mat)\n        np.testing.assert_array_equal(m.double_mat_rm(ref_mat), 2.0 * ref_mat)\n\n    # Mutator:\n    with pytest.raises(TypeError) as excinfo:\n        m.double_threer(second_row)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        double_threer(): incompatible function arguments. The following argument types are supported:\n            1. (arg0: numpy.ndarray[numpy.float32[1, 3], flags.writeable]) -> None\n\n        Invoked with: \"\"\"\n        + repr(np.array([5.0, 4.0, 3.0], dtype=\"float32\"))\n    )\n\n    with pytest.raises(TypeError) as excinfo:\n        m.double_threec(second_col)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        double_threec(): incompatible function arguments. The following argument types are supported:\n            1. (arg0: numpy.ndarray[numpy.float32[3, 1], flags.writeable]) -> None\n\n        Invoked with: \"\"\"\n        + repr(np.array([7.0, 4.0, 1.0], dtype=\"float32\"))\n    )\n\n\ndef test_block_runtime_error_type_caster_eigen_ref_made_a_copy():\n    with pytest.raises(RuntimeError) as excinfo:\n        m.block(ref, 0, 0, 0, 0)\n    assert str(excinfo.value) == \"type_caster for Eigen::Ref made a copy.\"\n\n\ndef test_nonunit_stride_to_python():\n    assert np.all(m.diagonal(ref) == ref.diagonal())\n    assert np.all(m.diagonal_1(ref) == ref.diagonal(1))\n    for i in range(-5, 7):\n        assert np.all(m.diagonal_n(ref, i) == ref.diagonal(i)), f\"m.diagonal_n({i})\"\n\n    # Must be order=\"F\", otherwise the type_caster will make a copy and\n    # m.block() will return a dangling reference (heap-use-after-free).\n    rof = np.asarray(ref, order=\"F\")\n    assert np.all(m.block(rof, 2, 1, 3, 3) == rof[2:5, 1:4])\n    assert np.all(m.block(rof, 1, 4, 4, 2) == rof[1:, 4:])\n    assert np.all(m.block(rof, 1, 4, 3, 2) == rof[1:4, 4:])\n\n\ndef test_eigen_ref_to_python():\n    chols = [m.cholesky1, m.cholesky2, m.cholesky3, m.cholesky4]\n    for i, chol in enumerate(chols, start=1):\n        mymat = chol(np.array([[1.0, 2, 4], [2, 13, 23], [4, 23, 77]]))\n        assert np.all(\n            mymat == np.array([[1, 0, 0], [2, 3, 0], [4, 5, 6]])\n        ), f\"cholesky{i}\"\n\n\ndef assign_both(a1, a2, r, c, v):\n    a1[r, c] = v\n    a2[r, c] = v\n\n\ndef array_copy_but_one(a, r, c, v):\n    z = np.array(a, copy=True)\n    z[r, c] = v\n    return z\n\n\ndef test_eigen_return_references():\n    \"\"\"Tests various ways of returning references and non-referencing copies\"\"\"\n\n    primary = np.ones((10, 10))\n    a = m.ReturnTester()\n    a_get1 = a.get()\n    assert not a_get1.flags.owndata and a_get1.flags.writeable\n    assign_both(a_get1, primary, 3, 3, 5)\n    a_get2 = a.get_ptr()\n    assert not a_get2.flags.owndata and a_get2.flags.writeable\n    assign_both(a_get1, primary, 2, 3, 6)\n\n    a_view1 = a.view()\n    assert not a_view1.flags.owndata and not a_view1.flags.writeable\n    with pytest.raises(ValueError):\n        a_view1[2, 3] = 4\n    a_view2 = a.view_ptr()\n    assert not a_view2.flags.owndata and not a_view2.flags.writeable\n    with pytest.raises(ValueError):\n        a_view2[2, 3] = 4\n\n    a_copy1 = a.copy_get()\n    assert a_copy1.flags.owndata and a_copy1.flags.writeable\n    np.testing.assert_array_equal(a_copy1, primary)\n    a_copy1[7, 7] = -44  # Shouldn't affect anything else\n    c1want = array_copy_but_one(primary, 7, 7, -44)\n    a_copy2 = a.copy_view()\n    assert a_copy2.flags.owndata and a_copy2.flags.writeable\n    np.testing.assert_array_equal(a_copy2, primary)\n    a_copy2[4, 4] = -22  # Shouldn't affect anything else\n    c2want = array_copy_but_one(primary, 4, 4, -22)\n\n    a_ref1 = a.ref()\n    assert not a_ref1.flags.owndata and a_ref1.flags.writeable\n    assign_both(a_ref1, primary, 1, 1, 15)\n    a_ref2 = a.ref_const()\n    assert not a_ref2.flags.owndata and not a_ref2.flags.writeable\n    with pytest.raises(ValueError):\n        a_ref2[5, 5] = 33\n    a_ref3 = a.ref_safe()\n    assert not a_ref3.flags.owndata and a_ref3.flags.writeable\n    assign_both(a_ref3, primary, 0, 7, 99)\n    a_ref4 = a.ref_const_safe()\n    assert not a_ref4.flags.owndata and not a_ref4.flags.writeable\n    with pytest.raises(ValueError):\n        a_ref4[7, 0] = 987654321\n\n    a_copy3 = a.copy_ref()\n    assert a_copy3.flags.owndata and a_copy3.flags.writeable\n    np.testing.assert_array_equal(a_copy3, primary)\n    a_copy3[8, 1] = 11\n    c3want = array_copy_but_one(primary, 8, 1, 11)\n    a_copy4 = a.copy_ref_const()\n    assert a_copy4.flags.owndata and a_copy4.flags.writeable\n    np.testing.assert_array_equal(a_copy4, primary)\n    a_copy4[8, 4] = 88\n    c4want = array_copy_but_one(primary, 8, 4, 88)\n\n    a_block1 = a.block(3, 3, 2, 2)\n    assert not a_block1.flags.owndata and a_block1.flags.writeable\n    a_block1[0, 0] = 55\n    primary[3, 3] = 55\n    a_block2 = a.block_safe(2, 2, 3, 2)\n    assert not a_block2.flags.owndata and a_block2.flags.writeable\n    a_block2[2, 1] = -123\n    primary[4, 3] = -123\n    a_block3 = a.block_const(6, 7, 4, 3)\n    assert not a_block3.flags.owndata and not a_block3.flags.writeable\n    with pytest.raises(ValueError):\n        a_block3[2, 2] = -44444\n\n    a_copy5 = a.copy_block(2, 2, 2, 3)\n    assert a_copy5.flags.owndata and a_copy5.flags.writeable\n    np.testing.assert_array_equal(a_copy5, primary[2:4, 2:5])\n    a_copy5[1, 1] = 777\n    c5want = array_copy_but_one(primary[2:4, 2:5], 1, 1, 777)\n\n    a_corn1 = a.corners()\n    assert not a_corn1.flags.owndata and a_corn1.flags.writeable\n    a_corn1 *= 50\n    a_corn1[1, 1] = 999\n    primary[0, 0] = 50\n    primary[0, 9] = 50\n    primary[9, 0] = 50\n    primary[9, 9] = 999\n    a_corn2 = a.corners_const()\n    assert not a_corn2.flags.owndata and not a_corn2.flags.writeable\n    with pytest.raises(ValueError):\n        a_corn2[1, 0] = 51\n\n    # All of the changes made all the way along should be visible everywhere\n    # now (except for the copies, of course)\n    np.testing.assert_array_equal(a_get1, primary)\n    np.testing.assert_array_equal(a_get2, primary)\n    np.testing.assert_array_equal(a_view1, primary)\n    np.testing.assert_array_equal(a_view2, primary)\n    np.testing.assert_array_equal(a_ref1, primary)\n    np.testing.assert_array_equal(a_ref2, primary)\n    np.testing.assert_array_equal(a_ref3, primary)\n    np.testing.assert_array_equal(a_ref4, primary)\n    np.testing.assert_array_equal(a_block1, primary[3:5, 3:5])\n    np.testing.assert_array_equal(a_block2, primary[2:5, 2:4])\n    np.testing.assert_array_equal(a_block3, primary[6:10, 7:10])\n    np.testing.assert_array_equal(\n        a_corn1, primary[0 :: primary.shape[0] - 1, 0 :: primary.shape[1] - 1]\n    )\n    np.testing.assert_array_equal(\n        a_corn2, primary[0 :: primary.shape[0] - 1, 0 :: primary.shape[1] - 1]\n    )\n\n    np.testing.assert_array_equal(a_copy1, c1want)\n    np.testing.assert_array_equal(a_copy2, c2want)\n    np.testing.assert_array_equal(a_copy3, c3want)\n    np.testing.assert_array_equal(a_copy4, c4want)\n    np.testing.assert_array_equal(a_copy5, c5want)\n\n\ndef assert_keeps_alive(cl, method, *args):\n    cstats = ConstructorStats.get(cl)\n    start_with = cstats.alive()\n    a = cl()\n    assert cstats.alive() == start_with + 1\n    z = method(a, *args)\n    assert cstats.alive() == start_with + 1\n    del a\n    # Here's the keep alive in action:\n    assert cstats.alive() == start_with + 1\n    del z\n    # Keep alive should have expired:\n    assert cstats.alive() == start_with\n\n\ndef test_eigen_keepalive():\n    a = m.ReturnTester()\n    cstats = ConstructorStats.get(m.ReturnTester)\n    assert cstats.alive() == 1\n    unsafe = [a.ref(), a.ref_const(), a.block(1, 2, 3, 4)]\n    copies = [\n        a.copy_get(),\n        a.copy_view(),\n        a.copy_ref(),\n        a.copy_ref_const(),\n        a.copy_block(4, 3, 2, 1),\n    ]\n    del a\n    assert cstats.alive() == 0\n    del unsafe\n    del copies\n\n    for meth in [\n        m.ReturnTester.get,\n        m.ReturnTester.get_ptr,\n        m.ReturnTester.view,\n        m.ReturnTester.view_ptr,\n        m.ReturnTester.ref_safe,\n        m.ReturnTester.ref_const_safe,\n        m.ReturnTester.corners,\n        m.ReturnTester.corners_const,\n    ]:\n        assert_keeps_alive(m.ReturnTester, meth)\n\n    for meth in [m.ReturnTester.block_safe, m.ReturnTester.block_const]:\n        assert_keeps_alive(m.ReturnTester, meth, 4, 3, 2, 1)\n\n\ndef test_eigen_ref_mutators():\n    \"\"\"Tests Eigen's ability to mutate numpy values\"\"\"\n\n    orig = np.array([[1.0, 2, 3], [4, 5, 6], [7, 8, 9]])\n    zr = np.array(orig)\n    zc = np.array(orig, order=\"F\")\n    m.add_rm(zr, 1, 0, 100)\n    assert np.all(zr == np.array([[1.0, 2, 3], [104, 5, 6], [7, 8, 9]]))\n    m.add_cm(zc, 1, 0, 200)\n    assert np.all(zc == np.array([[1.0, 2, 3], [204, 5, 6], [7, 8, 9]]))\n\n    m.add_any(zr, 1, 0, 20)\n    assert np.all(zr == np.array([[1.0, 2, 3], [124, 5, 6], [7, 8, 9]]))\n    m.add_any(zc, 1, 0, 10)\n    assert np.all(zc == np.array([[1.0, 2, 3], [214, 5, 6], [7, 8, 9]]))\n\n    # Can't reference a col-major array with a row-major Ref, and vice versa:\n    with pytest.raises(TypeError):\n        m.add_rm(zc, 1, 0, 1)\n    with pytest.raises(TypeError):\n        m.add_cm(zr, 1, 0, 1)\n\n    # Overloads:\n    m.add1(zr, 1, 0, -100)\n    m.add2(zr, 1, 0, -20)\n    assert np.all(zr == orig)\n    m.add1(zc, 1, 0, -200)\n    m.add2(zc, 1, 0, -10)\n    assert np.all(zc == orig)\n\n    # a non-contiguous slice (this won't work on either the row- or\n    # column-contiguous refs, but should work for the any)\n    cornersr = zr[0::2, 0::2]\n    cornersc = zc[0::2, 0::2]\n\n    assert np.all(cornersr == np.array([[1.0, 3], [7, 9]]))\n    assert np.all(cornersc == np.array([[1.0, 3], [7, 9]]))\n\n    with pytest.raises(TypeError):\n        m.add_rm(cornersr, 0, 1, 25)\n    with pytest.raises(TypeError):\n        m.add_cm(cornersr, 0, 1, 25)\n    with pytest.raises(TypeError):\n        m.add_rm(cornersc, 0, 1, 25)\n    with pytest.raises(TypeError):\n        m.add_cm(cornersc, 0, 1, 25)\n    m.add_any(cornersr, 0, 1, 25)\n    m.add_any(cornersc, 0, 1, 44)\n    assert np.all(zr == np.array([[1.0, 2, 28], [4, 5, 6], [7, 8, 9]]))\n    assert np.all(zc == np.array([[1.0, 2, 47], [4, 5, 6], [7, 8, 9]]))\n\n    # You shouldn't be allowed to pass a non-writeable array to a mutating Eigen method:\n    zro = zr[0:4, 0:4]\n    zro.flags.writeable = False\n    with pytest.raises(TypeError):\n        m.add_rm(zro, 0, 0, 0)\n    with pytest.raises(TypeError):\n        m.add_any(zro, 0, 0, 0)\n    with pytest.raises(TypeError):\n        m.add1(zro, 0, 0, 0)\n    with pytest.raises(TypeError):\n        m.add2(zro, 0, 0, 0)\n\n    # integer array shouldn't be passable to a double-matrix-accepting mutating func:\n    zi = np.array([[1, 2], [3, 4]])\n    with pytest.raises(TypeError):\n        m.add_rm(zi)\n\n\ndef test_numpy_ref_mutators():\n    \"\"\"Tests numpy mutating Eigen matrices (for returned Eigen::Ref<...>s)\"\"\"\n\n    m.reset_refs()  # In case another test already changed it\n\n    zc = m.get_cm_ref()\n    zcro = m.get_cm_const_ref()\n    zr = m.get_rm_ref()\n    zrro = m.get_rm_const_ref()\n\n    assert [zc[1, 2], zcro[1, 2], zr[1, 2], zrro[1, 2]] == [23] * 4\n\n    assert not zc.flags.owndata and zc.flags.writeable\n    assert not zr.flags.owndata and zr.flags.writeable\n    assert not zcro.flags.owndata and not zcro.flags.writeable\n    assert not zrro.flags.owndata and not zrro.flags.writeable\n\n    zc[1, 2] = 99\n    expect = np.array([[11.0, 12, 13], [21, 22, 99], [31, 32, 33]])\n    # We should have just changed zc, of course, but also zcro and the original eigen matrix\n    assert np.all(zc == expect)\n    assert np.all(zcro == expect)\n    assert np.all(m.get_cm_ref() == expect)\n\n    zr[1, 2] = 99\n    assert np.all(zr == expect)\n    assert np.all(zrro == expect)\n    assert np.all(m.get_rm_ref() == expect)\n\n    # Make sure the readonly ones are numpy-readonly:\n    with pytest.raises(ValueError):\n        zcro[1, 2] = 6\n    with pytest.raises(ValueError):\n        zrro[1, 2] = 6\n\n    # We should be able to explicitly copy like this (and since we're copying,\n    # the const should drop away)\n    y1 = np.array(m.get_cm_const_ref())\n\n    assert y1.flags.owndata and y1.flags.writeable\n    # We should get copies of the eigen data, which was modified above:\n    assert y1[1, 2] == 99\n    y1[1, 2] += 12\n    assert y1[1, 2] == 111\n    assert zc[1, 2] == 99  # Make sure we aren't referencing the original\n\n\ndef test_both_ref_mutators():\n    \"\"\"Tests a complex chain of nested eigen/numpy references\"\"\"\n\n    m.reset_refs()  # In case another test already changed it\n\n    z = m.get_cm_ref()  # numpy -> eigen\n    z[0, 2] -= 3\n    z2 = m.incr_matrix(z, 1)  # numpy -> eigen -> numpy -> eigen\n    z2[1, 1] += 6\n    z3 = m.incr_matrix(z, 2)  # (numpy -> eigen)^3\n    z3[2, 2] += -5\n    z4 = m.incr_matrix(z, 3)  # (numpy -> eigen)^4\n    z4[1, 1] -= 1\n    z5 = m.incr_matrix(z, 4)  # (numpy -> eigen)^5\n    z5[0, 0] = 0\n    assert np.all(z == z2)\n    assert np.all(z == z3)\n    assert np.all(z == z4)\n    assert np.all(z == z5)\n    expect = np.array([[0.0, 22, 20], [31, 37, 33], [41, 42, 38]])\n    assert np.all(z == expect)\n\n    y = np.array(range(100), dtype=\"float64\").reshape(10, 10)\n    y2 = m.incr_matrix_any(y, 10)  # np -> eigen -> np\n    y3 = m.incr_matrix_any(\n        y2[0::2, 0::2], -33\n    )  # np -> eigen -> np slice -> np -> eigen -> np\n    y4 = m.even_rows(y3)  # numpy -> eigen slice -> (... y3)\n    y5 = m.even_cols(y4)  # numpy -> eigen slice -> (... y4)\n    y6 = m.incr_matrix_any(y5, 1000)  # numpy -> eigen -> (... y5)\n\n    # Apply same mutations using just numpy:\n    yexpect = np.array(range(100), dtype=\"float64\").reshape(10, 10)\n    yexpect += 10\n    yexpect[0::2, 0::2] -= 33\n    yexpect[0::4, 0::4] += 1000\n    assert np.all(y6 == yexpect[0::4, 0::4])\n    assert np.all(y5 == yexpect[0::4, 0::4])\n    assert np.all(y4 == yexpect[0::4, 0::2])\n    assert np.all(y3 == yexpect[0::2, 0::2])\n    assert np.all(y2 == yexpect)\n    assert np.all(y == yexpect)\n\n\ndef test_nocopy_wrapper():\n    # get_elem requires a column-contiguous matrix reference, but should be\n    # callable with other types of matrix (via copying):\n    int_matrix_colmajor = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]], order=\"F\")\n    dbl_matrix_colmajor = np.array(\n        int_matrix_colmajor, dtype=\"double\", order=\"F\", copy=True\n    )\n    int_matrix_rowmajor = np.array(int_matrix_colmajor, order=\"C\", copy=True)\n    dbl_matrix_rowmajor = np.array(\n        int_matrix_rowmajor, dtype=\"double\", order=\"C\", copy=True\n    )\n\n    # All should be callable via get_elem:\n    assert m.get_elem(int_matrix_colmajor) == 8\n    assert m.get_elem(dbl_matrix_colmajor) == 8\n    assert m.get_elem(int_matrix_rowmajor) == 8\n    assert m.get_elem(dbl_matrix_rowmajor) == 8\n\n    # All but the second should fail with m.get_elem_nocopy:\n    with pytest.raises(TypeError) as excinfo:\n        m.get_elem_nocopy(int_matrix_colmajor)\n    assert \"get_elem_nocopy(): incompatible function arguments.\" in str(\n        excinfo.value\n    ) and \", flags.f_contiguous\" in str(excinfo.value)\n    assert m.get_elem_nocopy(dbl_matrix_colmajor) == 8\n    with pytest.raises(TypeError) as excinfo:\n        m.get_elem_nocopy(int_matrix_rowmajor)\n    assert \"get_elem_nocopy(): incompatible function arguments.\" in str(\n        excinfo.value\n    ) and \", flags.f_contiguous\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.get_elem_nocopy(dbl_matrix_rowmajor)\n    assert \"get_elem_nocopy(): incompatible function arguments.\" in str(\n        excinfo.value\n    ) and \", flags.f_contiguous\" in str(excinfo.value)\n\n    # For the row-major test, we take a long matrix in row-major, so only the third is allowed:\n    with pytest.raises(TypeError) as excinfo:\n        m.get_elem_rm_nocopy(int_matrix_colmajor)\n    assert \"get_elem_rm_nocopy(): incompatible function arguments.\" in str(\n        excinfo.value\n    ) and \", flags.c_contiguous\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.get_elem_rm_nocopy(dbl_matrix_colmajor)\n    assert \"get_elem_rm_nocopy(): incompatible function arguments.\" in str(\n        excinfo.value\n    ) and \", flags.c_contiguous\" in str(excinfo.value)\n    assert m.get_elem_rm_nocopy(int_matrix_rowmajor) == 8\n    with pytest.raises(TypeError) as excinfo:\n        m.get_elem_rm_nocopy(dbl_matrix_rowmajor)\n    assert \"get_elem_rm_nocopy(): incompatible function arguments.\" in str(\n        excinfo.value\n    ) and \", flags.c_contiguous\" in str(excinfo.value)\n\n\ndef test_eigen_ref_life_support():\n    \"\"\"Ensure the lifetime of temporary arrays created by the `Ref` caster\n\n    The `Ref` caster sometimes creates a copy which needs to stay alive. This needs to\n    happen both for directs casts (just the array) or indirectly (e.g. list of arrays).\n    \"\"\"\n\n    a = np.full(shape=10, fill_value=8, dtype=np.int8)\n    assert m.get_elem_direct(a) == 8\n\n    list_of_a = [a]\n    assert m.get_elem_indirect(list_of_a) == 8\n\n\ndef test_special_matrix_objects():\n    assert np.all(m.incr_diag(7) == np.diag([1.0, 2, 3, 4, 5, 6, 7]))\n\n    asymm = np.array([[1.0, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]])\n    symm_lower = np.array(asymm)\n    symm_upper = np.array(asymm)\n    for i in range(4):\n        for j in range(i + 1, 4):\n            symm_lower[i, j] = symm_lower[j, i]\n            symm_upper[j, i] = symm_upper[i, j]\n\n    assert np.all(m.symmetric_lower(asymm) == symm_lower)\n    assert np.all(m.symmetric_upper(asymm) == symm_upper)\n\n\ndef test_dense_signature(doc):\n    assert (\n        doc(m.double_col)\n        == \"\"\"\n        double_col(arg0: numpy.ndarray[numpy.float32[m, 1]]) -> numpy.ndarray[numpy.float32[m, 1]]\n    \"\"\"\n    )\n    assert (\n        doc(m.double_row)\n        == \"\"\"\n        double_row(arg0: numpy.ndarray[numpy.float32[1, n]]) -> numpy.ndarray[numpy.float32[1, n]]\n    \"\"\"\n    )\n    assert doc(m.double_complex) == (\n        \"\"\"\n        double_complex(arg0: numpy.ndarray[numpy.complex64[m, 1]])\"\"\"\n        \"\"\" -> numpy.ndarray[numpy.complex64[m, 1]]\n    \"\"\"\n    )\n    assert doc(m.double_mat_rm) == (\n        \"\"\"\n        double_mat_rm(arg0: numpy.ndarray[numpy.float32[m, n]])\"\"\"\n        \"\"\" -> numpy.ndarray[numpy.float32[m, n]]\n    \"\"\"\n    )\n\n\ndef test_named_arguments():\n    a = np.array([[1.0, 2], [3, 4], [5, 6]])\n    b = np.ones((2, 1))\n\n    assert np.all(m.matrix_multiply(a, b) == np.array([[3.0], [7], [11]]))\n    assert np.all(m.matrix_multiply(A=a, B=b) == np.array([[3.0], [7], [11]]))\n    assert np.all(m.matrix_multiply(B=b, A=a) == np.array([[3.0], [7], [11]]))\n\n    with pytest.raises(ValueError) as excinfo:\n        m.matrix_multiply(b, a)\n    assert str(excinfo.value) == \"Nonconformable matrices!\"\n\n    with pytest.raises(ValueError) as excinfo:\n        m.matrix_multiply(A=b, B=a)\n    assert str(excinfo.value) == \"Nonconformable matrices!\"\n\n    with pytest.raises(ValueError) as excinfo:\n        m.matrix_multiply(B=a, A=b)\n    assert str(excinfo.value) == \"Nonconformable matrices!\"\n\n\ndef test_sparse():\n    pytest.importorskip(\"scipy\")\n    assert_sparse_equal_ref(m.sparse_r())\n    assert_sparse_equal_ref(m.sparse_c())\n    assert_sparse_equal_ref(m.sparse_copy_r(m.sparse_r()))\n    assert_sparse_equal_ref(m.sparse_copy_c(m.sparse_c()))\n    assert_sparse_equal_ref(m.sparse_copy_r(m.sparse_c()))\n    assert_sparse_equal_ref(m.sparse_copy_c(m.sparse_r()))\n\n\ndef test_sparse_signature(doc):\n    pytest.importorskip(\"scipy\")\n    assert (\n        doc(m.sparse_copy_r)\n        == \"\"\"\n        sparse_copy_r(arg0: scipy.sparse.csr_matrix[numpy.float32]) -> scipy.sparse.csr_matrix[numpy.float32]\n    \"\"\"\n    )\n    assert (\n        doc(m.sparse_copy_c)\n        == \"\"\"\n        sparse_copy_c(arg0: scipy.sparse.csc_matrix[numpy.float32]) -> scipy.sparse.csc_matrix[numpy.float32]\n    \"\"\"\n    )\n\n\ndef test_issue738():\n    \"\"\"Ignore strides on a length-1 dimension (even if they would be incompatible length > 1)\"\"\"\n    assert np.all(m.iss738_f1(np.array([[1.0, 2, 3]])) == np.array([[1.0, 102, 203]]))\n    assert np.all(\n        m.iss738_f1(np.array([[1.0], [2], [3]])) == np.array([[1.0], [12], [23]])\n    )\n\n    assert np.all(m.iss738_f2(np.array([[1.0, 2, 3]])) == np.array([[1.0, 102, 203]]))\n    assert np.all(\n        m.iss738_f2(np.array([[1.0], [2], [3]])) == np.array([[1.0], [12], [23]])\n    )\n\n\n@pytest.mark.parametrize(\"func\", [m.iss738_f1, m.iss738_f2])\n@pytest.mark.parametrize(\"sizes\", [(0, 2), (2, 0)])\ndef test_zero_length(func, sizes):\n    \"\"\"Ignore strides on a length-0 dimension (even if they would be incompatible length > 1)\"\"\"\n    assert np.all(func(np.zeros(sizes)) == np.zeros(sizes))\n\n\ndef test_issue1105():\n    \"\"\"Issue 1105: 1xN or Nx1 input arrays weren't accepted for eigen\n    compile-time row vectors or column vector\"\"\"\n    assert m.iss1105_row(np.ones((1, 7)))\n    assert m.iss1105_col(np.ones((7, 1)))\n\n    # These should still fail (incompatible dimensions):\n    with pytest.raises(TypeError) as excinfo:\n        m.iss1105_row(np.ones((7, 1)))\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.iss1105_col(np.ones((1, 7)))\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n\ndef test_custom_operator_new():\n    \"\"\"Using Eigen types as member variables requires a class-specific\n    operator new with proper alignment\"\"\"\n\n    o = m.CustomOperatorNew()\n    np.testing.assert_allclose(o.a, 0.0)\n    np.testing.assert_allclose(o.b.diagonal(), 1.0)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_eigen_tensor.cpp",
    "content": "/*\n    tests/eigen_tensor.cpp -- automatic conversion of Eigen Tensor\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#define PYBIND11_TEST_EIGEN_TENSOR_NAMESPACE eigen_tensor\n\n#ifdef EIGEN_AVOID_STL_ARRAY\n#    undef EIGEN_AVOID_STL_ARRAY\n#endif\n\n#include \"test_eigen_tensor.inl\"\n\n#include \"pybind11_tests.h\"\n\ntest_initializer egien_tensor(\"eigen_tensor\", eigen_tensor_test::test_module);\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_eigen_tensor.inl",
    "content": "/*\n    tests/eigen_tensor.cpp -- automatic conversion of Eigen Tensor\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/eigen/tensor.h>\n\nPYBIND11_NAMESPACE_BEGIN(eigen_tensor_test)\n\nnamespace py = pybind11;\n\nPYBIND11_WARNING_DISABLE_MSVC(4127)\n\ntemplate <typename M>\nvoid reset_tensor(M &x) {\n    for (int i = 0; i < x.dimension(0); i++) {\n        for (int j = 0; j < x.dimension(1); j++) {\n            for (int k = 0; k < x.dimension(2); k++) {\n                x(i, j, k) = i * (5 * 2) + j * 2 + k;\n            }\n        }\n    }\n}\n\ntemplate <typename M>\nbool check_tensor(M &x) {\n    for (int i = 0; i < x.dimension(0); i++) {\n        for (int j = 0; j < x.dimension(1); j++) {\n            for (int k = 0; k < x.dimension(2); k++) {\n                if (x(i, j, k) != (i * (5 * 2) + j * 2 + k)) {\n                    return false;\n                }\n            }\n        }\n    }\n    return true;\n}\n\ntemplate <int Options>\nEigen::Tensor<double, 3, Options> &get_tensor() {\n    static Eigen::Tensor<double, 3, Options> *x;\n\n    if (!x) {\n        x = new Eigen::Tensor<double, 3, Options>(3, 5, 2);\n        reset_tensor(*x);\n    }\n\n    return *x;\n}\n\ntemplate <int Options>\nEigen::TensorMap<Eigen::Tensor<double, 3, Options>> &get_tensor_map() {\n    static Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> *x;\n\n    if (!x) {\n        x = new Eigen::TensorMap<Eigen::Tensor<double, 3, Options>>(get_tensor<Options>());\n    }\n\n    return *x;\n}\n\ntemplate <int Options>\nEigen::TensorFixedSize<double, Eigen::Sizes<3, 5, 2>, Options> &get_fixed_tensor() {\n    static Eigen::TensorFixedSize<double, Eigen::Sizes<3, 5, 2>, Options> *x;\n\n    if (!x) {\n        Eigen::aligned_allocator<Eigen::TensorFixedSize<double, Eigen::Sizes<3, 5, 2>, Options>>\n            allocator;\n        x = new (allocator.allocate(1))\n            Eigen::TensorFixedSize<double, Eigen::Sizes<3, 5, 2>, Options>();\n        reset_tensor(*x);\n    }\n\n    return *x;\n}\n\ntemplate <int Options>\nconst Eigen::Tensor<double, 3, Options> &get_const_tensor() {\n    return get_tensor<Options>();\n}\n\ntemplate <int Options>\nstruct CustomExample {\n    CustomExample() : member(get_tensor<Options>()), view_member(member) {}\n\n    Eigen::Tensor<double, 3, Options> member;\n    Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> view_member;\n};\n\ntemplate <int Options>\nvoid init_tensor_module(pybind11::module &m) {\n    const char *needed_options = \"\";\n    if (Options == Eigen::ColMajor) {\n        needed_options = \"F\";\n    } else {\n        needed_options = \"C\";\n    }\n    m.attr(\"needed_options\") = needed_options;\n\n    m.def(\"setup\", []() {\n        reset_tensor(get_tensor<Options>());\n        reset_tensor(get_fixed_tensor<Options>());\n    });\n\n    m.def(\"is_ok\", []() {\n        return check_tensor(get_tensor<Options>()) && check_tensor(get_fixed_tensor<Options>());\n    });\n\n    py::class_<CustomExample<Options>>(m, \"CustomExample\", py::module_local())\n        .def(py::init<>())\n        .def_readonly(\n            \"member\", &CustomExample<Options>::member, py::return_value_policy::reference_internal)\n        .def_readonly(\"member_view\",\n                      &CustomExample<Options>::view_member,\n                      py::return_value_policy::reference_internal);\n\n    m.def(\n        \"copy_fixed_tensor\",\n        []() { return &get_fixed_tensor<Options>(); },\n        py::return_value_policy::copy);\n\n    m.def(\n        \"copy_tensor\", []() { return &get_tensor<Options>(); }, py::return_value_policy::copy);\n\n    m.def(\n        \"copy_const_tensor\",\n        []() { return &get_const_tensor<Options>(); },\n        py::return_value_policy::copy);\n\n    m.def(\n        \"move_fixed_tensor_copy\",\n        []() -> Eigen::TensorFixedSize<double, Eigen::Sizes<3, 5, 2>, Options> {\n            return get_fixed_tensor<Options>();\n        },\n        py::return_value_policy::move);\n\n    m.def(\n        \"move_tensor_copy\",\n        []() -> Eigen::Tensor<double, 3, Options> { return get_tensor<Options>(); },\n        py::return_value_policy::move);\n\n    m.def(\n        \"move_const_tensor\",\n        []() -> const Eigen::Tensor<double, 3, Options> & { return get_const_tensor<Options>(); },\n        py::return_value_policy::move);\n\n    m.def(\n        \"take_fixed_tensor\",\n\n        []() {\n            Eigen::aligned_allocator<\n                Eigen::TensorFixedSize<double, Eigen::Sizes<3, 5, 2>, Options>>\n                allocator;\n            return new (allocator.allocate(1))\n                Eigen::TensorFixedSize<double, Eigen::Sizes<3, 5, 2>, Options>(\n                    get_fixed_tensor<Options>());\n        },\n        py::return_value_policy::take_ownership);\n\n    m.def(\n        \"take_tensor\",\n        []() { return new Eigen::Tensor<double, 3, Options>(get_tensor<Options>()); },\n        py::return_value_policy::take_ownership);\n\n    m.def(\n        \"take_const_tensor\",\n        []() -> const Eigen::Tensor<double, 3, Options> * {\n            return new Eigen::Tensor<double, 3, Options>(get_tensor<Options>());\n        },\n        py::return_value_policy::take_ownership);\n\n    m.def(\n        \"take_view_tensor\",\n        []() -> const Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> * {\n            return new Eigen::TensorMap<Eigen::Tensor<double, 3, Options>>(get_tensor<Options>());\n        },\n        py::return_value_policy::take_ownership);\n\n    m.def(\n        \"reference_tensor\",\n        []() { return &get_tensor<Options>(); },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_tensor_v2\",\n        []() -> Eigen::Tensor<double, 3, Options> & { return get_tensor<Options>(); },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_tensor_internal\",\n        []() { return &get_tensor<Options>(); },\n        py::return_value_policy::reference_internal);\n\n    m.def(\n        \"reference_fixed_tensor\",\n        []() { return &get_tensor<Options>(); },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_const_tensor\",\n        []() { return &get_const_tensor<Options>(); },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_const_tensor_v2\",\n        []() -> const Eigen::Tensor<double, 3, Options> & { return get_const_tensor<Options>(); },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_view_of_tensor\",\n        []() -> Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> {\n            return get_tensor_map<Options>();\n        },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_view_of_tensor_v2\",\n        // NOLINTNEXTLINE(readability-const-return-type)\n        []() -> const Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> {\n            return get_tensor_map<Options>(); // NOLINT(readability-const-return-type)\n        },                                    // NOLINT(readability-const-return-type)\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_view_of_tensor_v3\",\n        []() -> Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> * {\n            return &get_tensor_map<Options>();\n        },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_view_of_tensor_v4\",\n        []() -> const Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> * {\n            return &get_tensor_map<Options>();\n        },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_view_of_tensor_v5\",\n        []() -> Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> & {\n            return get_tensor_map<Options>();\n        },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_view_of_tensor_v6\",\n        []() -> const Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> & {\n            return get_tensor_map<Options>();\n        },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"reference_view_of_fixed_tensor\",\n        []() {\n            return Eigen::TensorMap<\n                Eigen::TensorFixedSize<double, Eigen::Sizes<3, 5, 2>, Options>>(\n                get_fixed_tensor<Options>());\n        },\n        py::return_value_policy::reference);\n\n    m.def(\"round_trip_tensor\",\n          [](const Eigen::Tensor<double, 3, Options> &tensor) { return tensor; });\n\n    m.def(\n        \"round_trip_tensor_noconvert\",\n        [](const Eigen::Tensor<double, 3, Options> &tensor) { return tensor; },\n        py::arg(\"tensor\").noconvert());\n\n    m.def(\"round_trip_tensor2\",\n          [](const Eigen::Tensor<int32_t, 3, Options> &tensor) { return tensor; });\n\n    m.def(\"round_trip_fixed_tensor\",\n          [](const Eigen::TensorFixedSize<double, Eigen::Sizes<3, 5, 2>, Options> &tensor) {\n              return tensor;\n          });\n\n    m.def(\n        \"round_trip_view_tensor\",\n        [](Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> view) { return view; },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"round_trip_view_tensor_ref\",\n        [](Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> &view) { return view; },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"round_trip_view_tensor_ptr\",\n        [](Eigen::TensorMap<Eigen::Tensor<double, 3, Options>> *view) { return view; },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"round_trip_aligned_view_tensor\",\n        [](Eigen::TensorMap<Eigen::Tensor<double, 3, Options>, Eigen::Aligned> view) {\n            return view;\n        },\n        py::return_value_policy::reference);\n\n    m.def(\n        \"round_trip_const_view_tensor\",\n        [](Eigen::TensorMap<const Eigen::Tensor<double, 3, Options>> view) {\n            return Eigen::Tensor<double, 3, Options>(view);\n        },\n        py::return_value_policy::move);\n\n    m.def(\n        \"round_trip_rank_0\",\n        [](const Eigen::Tensor<double, 0, Options> &tensor) { return tensor; },\n        py::return_value_policy::move);\n\n    m.def(\n        \"round_trip_rank_0_noconvert\",\n        [](const Eigen::Tensor<double, 0, Options> &tensor) { return tensor; },\n        py::arg(\"tensor\").noconvert(),\n        py::return_value_policy::move);\n\n    m.def(\n        \"round_trip_rank_0_view\",\n        [](Eigen::TensorMap<Eigen::Tensor<double, 0, Options>> &tensor) { return tensor; },\n        py::return_value_policy::reference);\n}\n\nvoid test_module(py::module_ &m) {\n    auto f_style = m.def_submodule(\"f_style\");\n    auto c_style = m.def_submodule(\"c_style\");\n\n    init_tensor_module<Eigen::ColMajor>(f_style);\n    init_tensor_module<Eigen::RowMajor>(c_style);\n}\n\nPYBIND11_NAMESPACE_END(eigen_tensor_test)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_eigen_tensor.py",
    "content": "import sys\n\nimport pytest\n\nnp = pytest.importorskip(\"numpy\")\neigen_tensor = pytest.importorskip(\"pybind11_tests.eigen_tensor\")\nsubmodules = [eigen_tensor.c_style, eigen_tensor.f_style]\ntry:\n    import eigen_tensor_avoid_stl_array as avoid\n\n    submodules += [avoid.c_style, avoid.f_style]\nexcept ImportError as e:\n    # Ensure config, build, toolchain, etc. issues are not masked here:\n    raise RuntimeError(\n        \"import eigen_tensor_avoid_stl_array FAILED, while \"\n        \"import pybind11_tests.eigen_tensor succeeded. \"\n        \"Please ensure that \"\n        \"test_eigen_tensor.cpp & \"\n        \"eigen_tensor_avoid_stl_array.cpp \"\n        \"are built together (or both are not built if Eigen is not available).\"\n    ) from e\n\ntensor_ref = np.empty((3, 5, 2), dtype=np.int64)\n\nfor i in range(tensor_ref.shape[0]):\n    for j in range(tensor_ref.shape[1]):\n        for k in range(tensor_ref.shape[2]):\n            tensor_ref[i, j, k] = i * (5 * 2) + j * 2 + k\n\nindices = (2, 3, 1)\n\n\n@pytest.fixture(autouse=True)\ndef cleanup():\n    for module in submodules:\n        module.setup()\n\n    yield\n\n    for module in submodules:\n        assert module.is_ok()\n\n\ndef test_import_avoid_stl_array():\n    pytest.importorskip(\"eigen_tensor_avoid_stl_array\")\n    assert len(submodules) == 4\n\n\ndef assert_equal_tensor_ref(mat, writeable=True, modified=None):\n    assert mat.flags.writeable == writeable\n\n    copy = np.array(tensor_ref)\n    if modified is not None:\n        copy[indices] = modified\n\n    np.testing.assert_array_equal(mat, copy)\n\n\n@pytest.mark.parametrize(\"m\", submodules)\n@pytest.mark.parametrize(\"member_name\", [\"member\", \"member_view\"])\ndef test_reference_internal(m, member_name):\n    if not hasattr(sys, \"getrefcount\"):\n        pytest.skip(\"No reference counting\")\n    foo = m.CustomExample()\n    counts = sys.getrefcount(foo)\n    mem = getattr(foo, member_name)\n    assert_equal_tensor_ref(mem, writeable=False)\n    new_counts = sys.getrefcount(foo)\n    assert new_counts == counts + 1\n    assert_equal_tensor_ref(mem, writeable=False)\n    del mem\n    assert sys.getrefcount(foo) == counts\n\n\nassert_equal_funcs = [\n    \"copy_tensor\",\n    \"copy_fixed_tensor\",\n    \"copy_const_tensor\",\n    \"move_tensor_copy\",\n    \"move_fixed_tensor_copy\",\n    \"take_tensor\",\n    \"take_fixed_tensor\",\n    \"reference_tensor\",\n    \"reference_tensor_v2\",\n    \"reference_fixed_tensor\",\n    \"reference_view_of_tensor\",\n    \"reference_view_of_tensor_v3\",\n    \"reference_view_of_tensor_v5\",\n    \"reference_view_of_fixed_tensor\",\n]\n\nassert_equal_const_funcs = [\n    \"reference_view_of_tensor_v2\",\n    \"reference_view_of_tensor_v4\",\n    \"reference_view_of_tensor_v6\",\n    \"reference_const_tensor\",\n    \"reference_const_tensor_v2\",\n]\n\n\n@pytest.mark.parametrize(\"m\", submodules)\n@pytest.mark.parametrize(\"func_name\", assert_equal_funcs + assert_equal_const_funcs)\ndef test_convert_tensor_to_py(m, func_name):\n    writeable = func_name in assert_equal_funcs\n    assert_equal_tensor_ref(getattr(m, func_name)(), writeable=writeable)\n\n\n@pytest.mark.parametrize(\"m\", submodules)\ndef test_bad_cpp_to_python_casts(m):\n    with pytest.raises(\n        RuntimeError, match=\"Cannot use reference internal when there is no parent\"\n    ):\n        m.reference_tensor_internal()\n\n    with pytest.raises(RuntimeError, match=\"Cannot move from a constant reference\"):\n        m.move_const_tensor()\n\n    with pytest.raises(\n        RuntimeError, match=\"Cannot take ownership of a const reference\"\n    ):\n        m.take_const_tensor()\n\n    with pytest.raises(\n        RuntimeError,\n        match=\"Invalid return_value_policy for Eigen Map type, must be either reference or reference_internal\",\n    ):\n        m.take_view_tensor()\n\n\n@pytest.mark.parametrize(\"m\", submodules)\ndef test_bad_python_to_cpp_casts(m):\n    with pytest.raises(\n        TypeError, match=r\"^round_trip_tensor\\(\\): incompatible function arguments\"\n    ):\n        m.round_trip_tensor(np.zeros((2, 3)))\n\n    with pytest.raises(TypeError, match=r\"^Cannot cast array data from dtype\"):\n        m.round_trip_tensor(np.zeros(dtype=np.str_, shape=(2, 3, 1)))\n\n    with pytest.raises(\n        TypeError,\n        match=r\"^round_trip_tensor_noconvert\\(\\): incompatible function arguments\",\n    ):\n        m.round_trip_tensor_noconvert(tensor_ref)\n\n    assert_equal_tensor_ref(\n        m.round_trip_tensor_noconvert(tensor_ref.astype(np.float64))\n    )\n\n    if m.needed_options == \"F\":\n        bad_options = \"C\"\n    else:\n        bad_options = \"F\"\n    # Shape, dtype and the order need to be correct for a TensorMap cast\n    with pytest.raises(\n        TypeError, match=r\"^round_trip_view_tensor\\(\\): incompatible function arguments\"\n    ):\n        m.round_trip_view_tensor(\n            np.zeros((3, 5, 2), dtype=np.float64, order=bad_options)\n        )\n\n    with pytest.raises(\n        TypeError, match=r\"^round_trip_view_tensor\\(\\): incompatible function arguments\"\n    ):\n        m.round_trip_view_tensor(\n            np.zeros((3, 5, 2), dtype=np.float32, order=m.needed_options)\n        )\n\n    with pytest.raises(\n        TypeError, match=r\"^round_trip_view_tensor\\(\\): incompatible function arguments\"\n    ):\n        m.round_trip_view_tensor(\n            np.zeros((3, 5), dtype=np.float64, order=m.needed_options)\n        )\n\n    with pytest.raises(\n        TypeError, match=r\"^round_trip_view_tensor\\(\\): incompatible function arguments\"\n    ):\n        temp = np.zeros((3, 5, 2), dtype=np.float64, order=m.needed_options)\n        m.round_trip_view_tensor(\n            temp[:, ::-1, :],\n        )\n\n    with pytest.raises(\n        TypeError, match=r\"^round_trip_view_tensor\\(\\): incompatible function arguments\"\n    ):\n        temp = np.zeros((3, 5, 2), dtype=np.float64, order=m.needed_options)\n        temp.setflags(write=False)\n        m.round_trip_view_tensor(temp)\n\n\n@pytest.mark.parametrize(\"m\", submodules)\ndef test_references_actually_refer(m):\n    a = m.reference_tensor()\n    temp = a[indices]\n    a[indices] = 100\n    assert_equal_tensor_ref(m.copy_const_tensor(), modified=100)\n    a[indices] = temp\n    assert_equal_tensor_ref(m.copy_const_tensor())\n\n    a = m.reference_view_of_tensor()\n    a[indices] = 100\n    assert_equal_tensor_ref(m.copy_const_tensor(), modified=100)\n    a[indices] = temp\n    assert_equal_tensor_ref(m.copy_const_tensor())\n\n\n@pytest.mark.parametrize(\"m\", submodules)\ndef test_round_trip(m):\n    assert_equal_tensor_ref(m.round_trip_tensor(tensor_ref))\n\n    with pytest.raises(TypeError, match=\"^Cannot cast array data from\"):\n        assert_equal_tensor_ref(m.round_trip_tensor2(tensor_ref))\n\n    assert_equal_tensor_ref(m.round_trip_tensor2(np.array(tensor_ref, dtype=np.int32)))\n    assert_equal_tensor_ref(m.round_trip_fixed_tensor(tensor_ref))\n    assert_equal_tensor_ref(m.round_trip_aligned_view_tensor(m.reference_tensor()))\n\n    copy = np.array(tensor_ref, dtype=np.float64, order=m.needed_options)\n    assert_equal_tensor_ref(m.round_trip_view_tensor(copy))\n    assert_equal_tensor_ref(m.round_trip_view_tensor_ref(copy))\n    assert_equal_tensor_ref(m.round_trip_view_tensor_ptr(copy))\n    copy.setflags(write=False)\n    assert_equal_tensor_ref(m.round_trip_const_view_tensor(copy))\n\n    np.testing.assert_array_equal(\n        tensor_ref[:, ::-1, :], m.round_trip_tensor(tensor_ref[:, ::-1, :])\n    )\n\n    assert m.round_trip_rank_0(np.float64(3.5)) == 3.5\n    assert m.round_trip_rank_0(3.5) == 3.5\n\n    with pytest.raises(\n        TypeError,\n        match=r\"^round_trip_rank_0_noconvert\\(\\): incompatible function arguments\",\n    ):\n        m.round_trip_rank_0_noconvert(np.float64(3.5))\n\n    with pytest.raises(\n        TypeError,\n        match=r\"^round_trip_rank_0_noconvert\\(\\): incompatible function arguments\",\n    ):\n        m.round_trip_rank_0_noconvert(3.5)\n\n    with pytest.raises(\n        TypeError, match=r\"^round_trip_rank_0_view\\(\\): incompatible function arguments\"\n    ):\n        m.round_trip_rank_0_view(np.float64(3.5))\n\n    with pytest.raises(\n        TypeError, match=r\"^round_trip_rank_0_view\\(\\): incompatible function arguments\"\n    ):\n        m.round_trip_rank_0_view(3.5)\n\n\n@pytest.mark.parametrize(\"m\", submodules)\ndef test_round_trip_references_actually_refer(m):\n    # Need to create a copy that matches the type on the C side\n    copy = np.array(tensor_ref, dtype=np.float64, order=m.needed_options)\n    a = m.round_trip_view_tensor(copy)\n    temp = a[indices]\n    a[indices] = 100\n    assert_equal_tensor_ref(copy, modified=100)\n    a[indices] = temp\n    assert_equal_tensor_ref(copy)\n\n\n@pytest.mark.parametrize(\"m\", submodules)\ndef test_doc_string(m, doc):\n    assert (\n        doc(m.copy_tensor) == \"copy_tensor() -> numpy.ndarray[numpy.float64[?, ?, ?]]\"\n    )\n    assert (\n        doc(m.copy_fixed_tensor)\n        == \"copy_fixed_tensor() -> numpy.ndarray[numpy.float64[3, 5, 2]]\"\n    )\n    assert (\n        doc(m.reference_const_tensor)\n        == \"reference_const_tensor() -> numpy.ndarray[numpy.float64[?, ?, ?]]\"\n    )\n\n    order_flag = f\"flags.{m.needed_options.lower()}_contiguous\"\n    assert doc(m.round_trip_view_tensor) == (\n        f\"round_trip_view_tensor(arg0: numpy.ndarray[numpy.float64[?, ?, ?], flags.writeable, {order_flag}])\"\n        + f\" -> numpy.ndarray[numpy.float64[?, ?, ?], flags.writeable, {order_flag}]\"\n    )\n    assert doc(m.round_trip_const_view_tensor) == (\n        f\"round_trip_const_view_tensor(arg0: numpy.ndarray[numpy.float64[?, ?, ?], {order_flag}])\"\n        + \" -> numpy.ndarray[numpy.float64[?, ?, ?]]\"\n    )\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_embed/CMakeLists.txt",
    "content": "possibly_uninitialized(PYTHON_MODULE_EXTENSION Python_INTERPRETER_ID)\n\nif(\"${PYTHON_MODULE_EXTENSION}\" MATCHES \"pypy\" OR \"${Python_INTERPRETER_ID}\" STREQUAL \"PyPy\")\n  message(STATUS \"Skipping embed test on PyPy\")\n  add_custom_target(cpptest) # Dummy target on PyPy. Embedding is not supported.\n  set(_suppress_unused_variable_warning \"${DOWNLOAD_CATCH}\")\n  return()\nendif()\n\nfind_package(Catch 2.13.9)\n\nif(CATCH_FOUND)\n  message(STATUS \"Building interpreter tests using Catch v${CATCH_VERSION}\")\nelse()\n  message(STATUS \"Catch not detected. Interpreter tests will be skipped. Install Catch headers\"\n                 \" manually or use `cmake -DDOWNLOAD_CATCH=ON` to fetch them automatically.\")\n  return()\nendif()\n\nfind_package(Threads REQUIRED)\n\nadd_executable(test_embed catch.cpp test_interpreter.cpp)\npybind11_enable_warnings(test_embed)\n\ntarget_link_libraries(test_embed PRIVATE pybind11::embed Catch2::Catch2 Threads::Threads)\n\nif(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)\n  file(COPY test_interpreter.py test_trampoline.py DESTINATION \"${CMAKE_CURRENT_BINARY_DIR}\")\nendif()\n\nadd_custom_target(\n  cpptest\n  COMMAND \"$<TARGET_FILE:test_embed>\"\n  DEPENDS test_embed\n  WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")\n\npybind11_add_module(external_module THIN_LTO external_module.cpp)\nset_target_properties(external_module PROPERTIES LIBRARY_OUTPUT_DIRECTORY\n                                                 \"${CMAKE_CURRENT_BINARY_DIR}\")\nforeach(config ${CMAKE_CONFIGURATION_TYPES})\n  string(TOUPPER ${config} config)\n  set_target_properties(external_module PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${config}\n                                                   \"${CMAKE_CURRENT_BINARY_DIR}\")\nendforeach()\nadd_dependencies(cpptest external_module)\n\nadd_dependencies(check cpptest)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_embed/catch.cpp",
    "content": "// The Catch implementation is compiled here. This is a standalone\n// translation unit to avoid recompiling it for every test change.\n\n#include <pybind11/embed.h>\n\n// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to\n// catch 2.0.1; this should be fixed in the next catch release after 2.0.1).\nPYBIND11_WARNING_DISABLE_MSVC(4996)\n\n// Catch uses _ internally, which breaks gettext style defines\n#ifdef _\n#    undef _\n#endif\n\n#define CATCH_CONFIG_RUNNER\n#include <catch.hpp>\n\nnamespace py = pybind11;\n\nint main(int argc, char *argv[]) {\n    // Setup for TEST_CASE in test_interpreter.cpp, tagging on a large random number:\n    std::string updated_pythonpath(\"pybind11_test_embed_PYTHONPATH_2099743835476552\");\n    const char *preexisting_pythonpath = getenv(\"PYTHONPATH\");\n    if (preexisting_pythonpath != nullptr) {\n#if defined(_WIN32)\n        updated_pythonpath += ';';\n#else\n        updated_pythonpath += ':';\n#endif\n        updated_pythonpath += preexisting_pythonpath;\n    }\n#if defined(_WIN32)\n    _putenv_s(\"PYTHONPATH\", updated_pythonpath.c_str());\n#else\n    setenv(\"PYTHONPATH\", updated_pythonpath.c_str(), /*replace=*/1);\n#endif\n\n    py::scoped_interpreter guard{};\n\n    auto result = Catch::Session().run(argc, argv);\n\n    return result < 0xff ? result : 0xff;\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_embed/external_module.cpp",
    "content": "#include <pybind11/pybind11.h>\n\nnamespace py = pybind11;\n\n/* Simple test module/test class to check that the referenced internals data of external pybind11\n * modules aren't preserved over a finalize/initialize.\n */\n\nPYBIND11_MODULE(external_module, m) {\n    class A {\n    public:\n        explicit A(int value) : v{value} {};\n        int v;\n    };\n\n    py::class_<A>(m, \"A\").def(py::init<int>()).def_readwrite(\"value\", &A::v);\n\n    m.def(\"internals_at\",\n          []() { return reinterpret_cast<uintptr_t>(&py::detail::get_internals()); });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_embed/test_interpreter.cpp",
    "content": "#include <pybind11/embed.h>\n\n// Silence MSVC C++17 deprecation warning from Catch regarding std::uncaught_exceptions (up to\n// catch 2.0.1; this should be fixed in the next catch release after 2.0.1).\nPYBIND11_WARNING_DISABLE_MSVC(4996)\n\n#include <catch.hpp>\n#include <cstdlib>\n#include <fstream>\n#include <functional>\n#include <thread>\n#include <utility>\n\nnamespace py = pybind11;\nusing namespace py::literals;\n\nsize_t get_sys_path_size() {\n    auto sys_path = py::module::import(\"sys\").attr(\"path\");\n    return py::len(sys_path);\n}\n\nclass Widget {\npublic:\n    explicit Widget(std::string message) : message(std::move(message)) {}\n    virtual ~Widget() = default;\n\n    std::string the_message() const { return message; }\n    virtual int the_answer() const = 0;\n    virtual std::string argv0() const = 0;\n\nprivate:\n    std::string message;\n};\n\nclass PyWidget final : public Widget {\n    using Widget::Widget;\n\n    int the_answer() const override { PYBIND11_OVERRIDE_PURE(int, Widget, the_answer); }\n    std::string argv0() const override { PYBIND11_OVERRIDE_PURE(std::string, Widget, argv0); }\n};\n\nclass test_override_cache_helper {\n\npublic:\n    virtual int func() { return 0; }\n\n    test_override_cache_helper() = default;\n    virtual ~test_override_cache_helper() = default;\n    // Non-copyable\n    test_override_cache_helper &operator=(test_override_cache_helper const &Right) = delete;\n    test_override_cache_helper(test_override_cache_helper const &Copy) = delete;\n};\n\nclass test_override_cache_helper_trampoline : public test_override_cache_helper {\n    int func() override { PYBIND11_OVERRIDE(int, test_override_cache_helper, func); }\n};\n\nPYBIND11_EMBEDDED_MODULE(widget_module, m) {\n    py::class_<Widget, PyWidget>(m, \"Widget\")\n        .def(py::init<std::string>())\n        .def_property_readonly(\"the_message\", &Widget::the_message);\n\n    m.def(\"add\", [](int i, int j) { return i + j; });\n}\n\nPYBIND11_EMBEDDED_MODULE(trampoline_module, m) {\n    py::class_<test_override_cache_helper,\n               test_override_cache_helper_trampoline,\n               std::shared_ptr<test_override_cache_helper>>(m, \"test_override_cache_helper\")\n        .def(py::init_alias<>())\n        .def(\"func\", &test_override_cache_helper::func);\n}\n\nPYBIND11_EMBEDDED_MODULE(throw_exception, ) { throw std::runtime_error(\"C++ Error\"); }\n\nPYBIND11_EMBEDDED_MODULE(throw_error_already_set, ) {\n    auto d = py::dict();\n    d[\"missing\"].cast<py::object>();\n}\n\nTEST_CASE(\"PYTHONPATH is used to update sys.path\") {\n    // The setup for this TEST_CASE is in catch.cpp!\n    auto sys_path = py::str(py::module_::import(\"sys\").attr(\"path\")).cast<std::string>();\n    REQUIRE_THAT(sys_path,\n                 Catch::Matchers::Contains(\"pybind11_test_embed_PYTHONPATH_2099743835476552\"));\n}\n\nTEST_CASE(\"Pass classes and data between modules defined in C++ and Python\") {\n    auto module_ = py::module_::import(\"test_interpreter\");\n    REQUIRE(py::hasattr(module_, \"DerivedWidget\"));\n\n    auto locals = py::dict(\"hello\"_a = \"Hello, World!\", \"x\"_a = 5, **module_.attr(\"__dict__\"));\n    py::exec(R\"(\n        widget = DerivedWidget(\"{} - {}\".format(hello, x))\n        message = widget.the_message\n    )\",\n             py::globals(),\n             locals);\n    REQUIRE(locals[\"message\"].cast<std::string>() == \"Hello, World! - 5\");\n\n    auto py_widget = module_.attr(\"DerivedWidget\")(\"The question\");\n    auto message = py_widget.attr(\"the_message\");\n    REQUIRE(message.cast<std::string>() == \"The question\");\n\n    const auto &cpp_widget = py_widget.cast<const Widget &>();\n    REQUIRE(cpp_widget.the_answer() == 42);\n}\n\nTEST_CASE(\"Override cache\") {\n    auto module_ = py::module_::import(\"test_trampoline\");\n    REQUIRE(py::hasattr(module_, \"func\"));\n    REQUIRE(py::hasattr(module_, \"func2\"));\n\n    auto locals = py::dict(**module_.attr(\"__dict__\"));\n\n    int i = 0;\n    for (; i < 1500; ++i) {\n        std::shared_ptr<test_override_cache_helper> p_obj;\n        std::shared_ptr<test_override_cache_helper> p_obj2;\n\n        py::object loc_inst = locals[\"func\"]();\n        p_obj = py::cast<std::shared_ptr<test_override_cache_helper>>(loc_inst);\n\n        int ret = p_obj->func();\n\n        REQUIRE(ret == 42);\n\n        loc_inst = locals[\"func2\"]();\n\n        p_obj2 = py::cast<std::shared_ptr<test_override_cache_helper>>(loc_inst);\n\n        p_obj2->func();\n    }\n}\n\nTEST_CASE(\"Import error handling\") {\n    REQUIRE_NOTHROW(py::module_::import(\"widget_module\"));\n    REQUIRE_THROWS_WITH(py::module_::import(\"throw_exception\"), \"ImportError: C++ Error\");\n    REQUIRE_THROWS_WITH(py::module_::import(\"throw_error_already_set\"),\n                        Catch::Contains(\"ImportError: initialization failed\"));\n\n    auto locals = py::dict(\"is_keyerror\"_a = false, \"message\"_a = \"not set\");\n    py::exec(R\"(\n        try:\n            import throw_error_already_set\n        except ImportError as e:\n            is_keyerror = type(e.__cause__) == KeyError\n            message = str(e.__cause__)\n    )\",\n             py::globals(),\n             locals);\n    REQUIRE(locals[\"is_keyerror\"].cast<bool>() == true);\n    REQUIRE(locals[\"message\"].cast<std::string>() == \"'missing'\");\n}\n\nTEST_CASE(\"There can be only one interpreter\") {\n    static_assert(std::is_move_constructible<py::scoped_interpreter>::value, \"\");\n    static_assert(!std::is_move_assignable<py::scoped_interpreter>::value, \"\");\n    static_assert(!std::is_copy_constructible<py::scoped_interpreter>::value, \"\");\n    static_assert(!std::is_copy_assignable<py::scoped_interpreter>::value, \"\");\n\n    REQUIRE_THROWS_WITH(py::initialize_interpreter(), \"The interpreter is already running\");\n    REQUIRE_THROWS_WITH(py::scoped_interpreter(), \"The interpreter is already running\");\n\n    py::finalize_interpreter();\n    REQUIRE_NOTHROW(py::scoped_interpreter());\n    {\n        auto pyi1 = py::scoped_interpreter();\n        auto pyi2 = std::move(pyi1);\n    }\n    py::initialize_interpreter();\n}\n\n#if PY_VERSION_HEX >= PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX\nTEST_CASE(\"Custom PyConfig\") {\n    py::finalize_interpreter();\n    PyConfig config;\n    PyConfig_InitPythonConfig(&config);\n    REQUIRE_NOTHROW(py::scoped_interpreter{&config});\n    {\n        py::scoped_interpreter p{&config};\n        REQUIRE(py::module_::import(\"widget_module\").attr(\"add\")(1, 41).cast<int>() == 42);\n    }\n    py::initialize_interpreter();\n}\n\nTEST_CASE(\"Custom PyConfig with argv\") {\n    py::finalize_interpreter();\n    {\n        PyConfig config;\n        PyConfig_InitIsolatedConfig(&config);\n        char *argv[] = {strdup(\"a.out\")};\n        py::scoped_interpreter argv_scope{&config, 1, argv};\n        std::free(argv[0]);\n        auto module = py::module::import(\"test_interpreter\");\n        auto py_widget = module.attr(\"DerivedWidget\")(\"The question\");\n        const auto &cpp_widget = py_widget.cast<const Widget &>();\n        REQUIRE(cpp_widget.argv0() == \"a.out\");\n    }\n    py::initialize_interpreter();\n}\n#endif\n\nTEST_CASE(\"Add program dir to path pre-PyConfig\") {\n    py::finalize_interpreter();\n    size_t path_size_add_program_dir_to_path_false = 0;\n    {\n        py::scoped_interpreter scoped_interp{true, 0, nullptr, false};\n        path_size_add_program_dir_to_path_false = get_sys_path_size();\n    }\n    {\n        py::scoped_interpreter scoped_interp{};\n        REQUIRE(get_sys_path_size() == path_size_add_program_dir_to_path_false + 1);\n    }\n    py::initialize_interpreter();\n}\n\n#if PY_VERSION_HEX >= PYBIND11_PYCONFIG_SUPPORT_PY_VERSION_HEX\nTEST_CASE(\"Add program dir to path using PyConfig\") {\n    py::finalize_interpreter();\n    size_t path_size_add_program_dir_to_path_false = 0;\n    {\n        PyConfig config;\n        PyConfig_InitPythonConfig(&config);\n        py::scoped_interpreter scoped_interp{&config, 0, nullptr, false};\n        path_size_add_program_dir_to_path_false = get_sys_path_size();\n    }\n    {\n        PyConfig config;\n        PyConfig_InitPythonConfig(&config);\n        py::scoped_interpreter scoped_interp{&config};\n        REQUIRE(get_sys_path_size() == path_size_add_program_dir_to_path_false + 1);\n    }\n    py::initialize_interpreter();\n}\n#endif\n\nbool has_pybind11_internals_builtin() {\n    auto builtins = py::handle(PyEval_GetBuiltins());\n    return builtins.contains(PYBIND11_INTERNALS_ID);\n};\n\nbool has_pybind11_internals_static() {\n    auto **&ipp = py::detail::get_internals_pp();\n    return (ipp != nullptr) && (*ipp != nullptr);\n}\n\nTEST_CASE(\"Restart the interpreter\") {\n    // Verify pre-restart state.\n    REQUIRE(py::module_::import(\"widget_module\").attr(\"add\")(1, 2).cast<int>() == 3);\n    REQUIRE(has_pybind11_internals_builtin());\n    REQUIRE(has_pybind11_internals_static());\n    REQUIRE(py::module_::import(\"external_module\").attr(\"A\")(123).attr(\"value\").cast<int>()\n            == 123);\n\n    // local and foreign module internals should point to the same internals:\n    REQUIRE(reinterpret_cast<uintptr_t>(*py::detail::get_internals_pp())\n            == py::module_::import(\"external_module\").attr(\"internals_at\")().cast<uintptr_t>());\n\n    // Restart the interpreter.\n    py::finalize_interpreter();\n    REQUIRE(Py_IsInitialized() == 0);\n\n    py::initialize_interpreter();\n    REQUIRE(Py_IsInitialized() == 1);\n\n    // Internals are deleted after a restart.\n    REQUIRE_FALSE(has_pybind11_internals_builtin());\n    REQUIRE_FALSE(has_pybind11_internals_static());\n    pybind11::detail::get_internals();\n    REQUIRE(has_pybind11_internals_builtin());\n    REQUIRE(has_pybind11_internals_static());\n    REQUIRE(reinterpret_cast<uintptr_t>(*py::detail::get_internals_pp())\n            == py::module_::import(\"external_module\").attr(\"internals_at\")().cast<uintptr_t>());\n\n    // Make sure that an interpreter with no get_internals() created until finalize still gets the\n    // internals destroyed\n    py::finalize_interpreter();\n    py::initialize_interpreter();\n    bool ran = false;\n    py::module_::import(\"__main__\").attr(\"internals_destroy_test\")\n        = py::capsule(&ran, [](void *ran) {\n              py::detail::get_internals();\n              *static_cast<bool *>(ran) = true;\n          });\n    REQUIRE_FALSE(has_pybind11_internals_builtin());\n    REQUIRE_FALSE(has_pybind11_internals_static());\n    REQUIRE_FALSE(ran);\n    py::finalize_interpreter();\n    REQUIRE(ran);\n    py::initialize_interpreter();\n    REQUIRE_FALSE(has_pybind11_internals_builtin());\n    REQUIRE_FALSE(has_pybind11_internals_static());\n\n    // C++ modules can be reloaded.\n    auto cpp_module = py::module_::import(\"widget_module\");\n    REQUIRE(cpp_module.attr(\"add\")(1, 2).cast<int>() == 3);\n\n    // C++ type information is reloaded and can be used in python modules.\n    auto py_module = py::module_::import(\"test_interpreter\");\n    auto py_widget = py_module.attr(\"DerivedWidget\")(\"Hello after restart\");\n    REQUIRE(py_widget.attr(\"the_message\").cast<std::string>() == \"Hello after restart\");\n}\n\nTEST_CASE(\"Subinterpreter\") {\n    // Add tags to the modules in the main interpreter and test the basics.\n    py::module_::import(\"__main__\").attr(\"main_tag\") = \"main interpreter\";\n    {\n        auto m = py::module_::import(\"widget_module\");\n        m.attr(\"extension_module_tag\") = \"added to module in main interpreter\";\n\n        REQUIRE(m.attr(\"add\")(1, 2).cast<int>() == 3);\n    }\n    REQUIRE(has_pybind11_internals_builtin());\n    REQUIRE(has_pybind11_internals_static());\n\n    /// Create and switch to a subinterpreter.\n    auto *main_tstate = PyThreadState_Get();\n    auto *sub_tstate = Py_NewInterpreter();\n\n    // Subinterpreters get their own copy of builtins. detail::get_internals() still\n    // works by returning from the static variable, i.e. all interpreters share a single\n    // global pybind11::internals;\n    REQUIRE_FALSE(has_pybind11_internals_builtin());\n    REQUIRE(has_pybind11_internals_static());\n\n    // Modules tags should be gone.\n    REQUIRE_FALSE(py::hasattr(py::module_::import(\"__main__\"), \"tag\"));\n    {\n        auto m = py::module_::import(\"widget_module\");\n        REQUIRE_FALSE(py::hasattr(m, \"extension_module_tag\"));\n\n        // Function bindings should still work.\n        REQUIRE(m.attr(\"add\")(1, 2).cast<int>() == 3);\n    }\n\n    // Restore main interpreter.\n    Py_EndInterpreter(sub_tstate);\n    PyThreadState_Swap(main_tstate);\n\n    REQUIRE(py::hasattr(py::module_::import(\"__main__\"), \"main_tag\"));\n    REQUIRE(py::hasattr(py::module_::import(\"widget_module\"), \"extension_module_tag\"));\n}\n\nTEST_CASE(\"Execution frame\") {\n    // When the interpreter is embedded, there is no execution frame, but `py::exec`\n    // should still function by using reasonable globals: `__main__.__dict__`.\n    py::exec(\"var = dict(number=42)\");\n    REQUIRE(py::globals()[\"var\"][\"number\"].cast<int>() == 42);\n}\n\nTEST_CASE(\"Threads\") {\n    // Restart interpreter to ensure threads are not initialized\n    py::finalize_interpreter();\n    py::initialize_interpreter();\n    REQUIRE_FALSE(has_pybind11_internals_static());\n\n    constexpr auto num_threads = 10;\n    auto locals = py::dict(\"count\"_a = 0);\n\n    {\n        py::gil_scoped_release gil_release{};\n\n        auto threads = std::vector<std::thread>();\n        for (auto i = 0; i < num_threads; ++i) {\n            threads.emplace_back([&]() {\n                py::gil_scoped_acquire gil{};\n                locals[\"count\"] = locals[\"count\"].cast<int>() + 1;\n            });\n        }\n\n        for (auto &thread : threads) {\n            thread.join();\n        }\n    }\n\n    REQUIRE(locals[\"count\"].cast<int>() == num_threads);\n}\n\n// Scope exit utility https://stackoverflow.com/a/36644501/7255855\nstruct scope_exit {\n    std::function<void()> f_;\n    explicit scope_exit(std::function<void()> f) noexcept : f_(std::move(f)) {}\n    ~scope_exit() {\n        if (f_) {\n            f_();\n        }\n    }\n};\n\nTEST_CASE(\"Reload module from file\") {\n    // Disable generation of cached bytecode (.pyc files) for this test, otherwise\n    // Python might pick up an old version from the cache instead of the new versions\n    // of the .py files generated below\n    auto sys = py::module_::import(\"sys\");\n    bool dont_write_bytecode = sys.attr(\"dont_write_bytecode\").cast<bool>();\n    sys.attr(\"dont_write_bytecode\") = true;\n    // Reset the value at scope exit\n    scope_exit reset_dont_write_bytecode(\n        [&]() { sys.attr(\"dont_write_bytecode\") = dont_write_bytecode; });\n\n    std::string module_name = \"test_module_reload\";\n    std::string module_file = module_name + \".py\";\n\n    // Create the module .py file\n    std::ofstream test_module(module_file);\n    test_module << \"def test():\\n\";\n    test_module << \"    return 1\\n\";\n    test_module.close();\n    // Delete the file at scope exit\n    scope_exit delete_module_file([&]() { std::remove(module_file.c_str()); });\n\n    // Import the module from file\n    auto module_ = py::module_::import(module_name.c_str());\n    int result = module_.attr(\"test\")().cast<int>();\n    REQUIRE(result == 1);\n\n    // Update the module .py file with a small change\n    test_module.open(module_file);\n    test_module << \"def test():\\n\";\n    test_module << \"    return 2\\n\";\n    test_module.close();\n\n    // Reload the module\n    module_.reload();\n    result = module_.attr(\"test\")().cast<int>();\n    REQUIRE(result == 2);\n}\n\nTEST_CASE(\"sys.argv gets initialized properly\") {\n    py::finalize_interpreter();\n    {\n        py::scoped_interpreter default_scope;\n        auto module = py::module::import(\"test_interpreter\");\n        auto py_widget = module.attr(\"DerivedWidget\")(\"The question\");\n        const auto &cpp_widget = py_widget.cast<const Widget &>();\n        REQUIRE(cpp_widget.argv0().empty());\n    }\n\n    {\n        char *argv[] = {strdup(\"a.out\")};\n        py::scoped_interpreter argv_scope(true, 1, argv);\n        std::free(argv[0]);\n        auto module = py::module::import(\"test_interpreter\");\n        auto py_widget = module.attr(\"DerivedWidget\")(\"The question\");\n        const auto &cpp_widget = py_widget.cast<const Widget &>();\n        REQUIRE(cpp_widget.argv0() == \"a.out\");\n    }\n    py::initialize_interpreter();\n}\n\nTEST_CASE(\"make_iterator can be called before then after finalizing an interpreter\") {\n    // Reproduction of issue #2101 (https://github.com/pybind/pybind11/issues/2101)\n    py::finalize_interpreter();\n\n    std::vector<int> container;\n    {\n        pybind11::scoped_interpreter g;\n        auto iter = pybind11::make_iterator(container.begin(), container.end());\n    }\n\n    REQUIRE_NOTHROW([&]() {\n        pybind11::scoped_interpreter g;\n        auto iter = pybind11::make_iterator(container.begin(), container.end());\n    }());\n\n    py::initialize_interpreter();\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_embed/test_interpreter.py",
    "content": "import sys\n\nfrom widget_module import Widget\n\n\nclass DerivedWidget(Widget):\n    def __init__(self, message):\n        super().__init__(message)\n\n    def the_answer(self):\n        return 42\n\n    def argv0(self):\n        return sys.argv[0]\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_embed/test_trampoline.py",
    "content": "import trampoline_module\n\n\ndef func():\n    class Test(trampoline_module.test_override_cache_helper):\n        def func(self):\n            return 42\n\n    return Test()\n\n\ndef func2():\n    class Test(trampoline_module.test_override_cache_helper):\n        pass\n\n    return Test()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_enum.cpp",
    "content": "/*\n    tests/test_enums.cpp -- enumerations\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"pybind11_tests.h\"\n\nTEST_SUBMODULE(enums, m) {\n    // test_unscoped_enum\n    enum UnscopedEnum { EOne = 1, ETwo, EThree };\n    py::enum_<UnscopedEnum>(m, \"UnscopedEnum\", py::arithmetic(), \"An unscoped enumeration\")\n        .value(\"EOne\", EOne, \"Docstring for EOne\")\n        .value(\"ETwo\", ETwo, \"Docstring for ETwo\")\n        .value(\"EThree\", EThree, \"Docstring for EThree\")\n        .export_values();\n\n    // test_scoped_enum\n    enum class ScopedEnum { Two = 2, Three };\n    py::enum_<ScopedEnum>(m, \"ScopedEnum\", py::arithmetic())\n        .value(\"Two\", ScopedEnum::Two)\n        .value(\"Three\", ScopedEnum::Three);\n\n    m.def(\"test_scoped_enum\", [](ScopedEnum z) {\n        return \"ScopedEnum::\" + std::string(z == ScopedEnum::Two ? \"Two\" : \"Three\");\n    });\n\n    // test_binary_operators\n    enum Flags { Read = 4, Write = 2, Execute = 1 };\n    py::enum_<Flags>(m, \"Flags\", py::arithmetic())\n        .value(\"Read\", Flags::Read)\n        .value(\"Write\", Flags::Write)\n        .value(\"Execute\", Flags::Execute)\n        .export_values();\n\n    // test_implicit_conversion\n    class ClassWithUnscopedEnum {\n    public:\n        enum EMode { EFirstMode = 1, ESecondMode };\n\n        static EMode test_function(EMode mode) { return mode; }\n    };\n    py::class_<ClassWithUnscopedEnum> exenum_class(m, \"ClassWithUnscopedEnum\");\n    exenum_class.def_static(\"test_function\", &ClassWithUnscopedEnum::test_function);\n    py::enum_<ClassWithUnscopedEnum::EMode>(exenum_class, \"EMode\")\n        .value(\"EFirstMode\", ClassWithUnscopedEnum::EFirstMode)\n        .value(\"ESecondMode\", ClassWithUnscopedEnum::ESecondMode)\n        .export_values();\n\n    // test_enum_to_int\n    m.def(\"test_enum_to_int\", [](int) {});\n    m.def(\"test_enum_to_uint\", [](uint32_t) {});\n    m.def(\"test_enum_to_long_long\", [](long long) {});\n\n    // test_duplicate_enum_name\n    enum SimpleEnum { ONE, TWO, THREE };\n\n    m.def(\"register_bad_enum\", [m]() {\n        py::enum_<SimpleEnum>(m, \"SimpleEnum\")\n            .value(\"ONE\", SimpleEnum::ONE) // NOTE: all value function calls are called with the\n                                           // same first parameter value\n            .value(\"ONE\", SimpleEnum::TWO)\n            .value(\"ONE\", SimpleEnum::THREE)\n            .export_values();\n    });\n\n    // test_enum_scalar\n    enum UnscopedUCharEnum : unsigned char {};\n    enum class ScopedShortEnum : short {};\n    enum class ScopedLongEnum : long {};\n    enum UnscopedUInt64Enum : std::uint64_t {};\n    static_assert(\n        py::detail::all_of<\n            std::is_same<py::enum_<UnscopedUCharEnum>::Scalar, unsigned char>,\n            std::is_same<py::enum_<ScopedShortEnum>::Scalar, short>,\n            std::is_same<py::enum_<ScopedLongEnum>::Scalar, long>,\n            std::is_same<py::enum_<UnscopedUInt64Enum>::Scalar, std::uint64_t>>::value,\n        \"Error during the deduction of enum's scalar type with normal integer underlying\");\n\n    // test_enum_scalar_with_char_underlying\n    enum class ScopedCharEnum : char { Zero, Positive };\n    enum class ScopedWCharEnum : wchar_t { Zero, Positive };\n    enum class ScopedChar32Enum : char32_t { Zero, Positive };\n    enum class ScopedChar16Enum : char16_t { Zero, Positive };\n\n    // test the scalar of char type enums according to chapter 'Character types'\n    // from https://en.cppreference.com/w/cpp/language/types\n    static_assert(\n        py::detail::any_of<\n            std::is_same<py::enum_<ScopedCharEnum>::Scalar, signed char>,  // e.g. gcc on x86\n            std::is_same<py::enum_<ScopedCharEnum>::Scalar, unsigned char> // e.g. arm linux\n            >::value,\n        \"char should be cast to either signed char or unsigned char\");\n    static_assert(sizeof(py::enum_<ScopedWCharEnum>::Scalar) == 2\n                      || sizeof(py::enum_<ScopedWCharEnum>::Scalar) == 4,\n                  \"wchar_t should be either 16 bits (Windows) or 32 (everywhere else)\");\n    static_assert(\n        py::detail::all_of<\n            std::is_same<py::enum_<ScopedChar32Enum>::Scalar, std::uint_least32_t>,\n            std::is_same<py::enum_<ScopedChar16Enum>::Scalar, std::uint_least16_t>>::value,\n        \"char32_t, char16_t (and char8_t)'s size, signedness, and alignment is determined\");\n#if defined(PYBIND11_HAS_U8STRING)\n    enum class ScopedChar8Enum : char8_t { Zero, Positive };\n    static_assert(std::is_same<py::enum_<ScopedChar8Enum>::Scalar, unsigned char>::value);\n#endif\n\n    // test_char_underlying_enum\n    py::enum_<ScopedCharEnum>(m, \"ScopedCharEnum\")\n        .value(\"Zero\", ScopedCharEnum::Zero)\n        .value(\"Positive\", ScopedCharEnum::Positive);\n    py::enum_<ScopedWCharEnum>(m, \"ScopedWCharEnum\")\n        .value(\"Zero\", ScopedWCharEnum::Zero)\n        .value(\"Positive\", ScopedWCharEnum::Positive);\n    py::enum_<ScopedChar32Enum>(m, \"ScopedChar32Enum\")\n        .value(\"Zero\", ScopedChar32Enum::Zero)\n        .value(\"Positive\", ScopedChar32Enum::Positive);\n    py::enum_<ScopedChar16Enum>(m, \"ScopedChar16Enum\")\n        .value(\"Zero\", ScopedChar16Enum::Zero)\n        .value(\"Positive\", ScopedChar16Enum::Positive);\n\n    // test_bool_underlying_enum\n    enum class ScopedBoolEnum : bool { FALSE, TRUE };\n\n    // bool is unsigned (std::is_signed returns false) and 1-byte long, so represented with u8\n    static_assert(std::is_same<py::enum_<ScopedBoolEnum>::Scalar, std::uint8_t>::value, \"\");\n\n    py::enum_<ScopedBoolEnum>(m, \"ScopedBoolEnum\")\n        .value(\"FALSE\", ScopedBoolEnum::FALSE)\n        .value(\"TRUE\", ScopedBoolEnum::TRUE);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_enum.py",
    "content": "import pytest\n\nfrom pybind11_tests import enums as m\n\n\ndef test_unscoped_enum():\n    assert str(m.UnscopedEnum.EOne) == \"UnscopedEnum.EOne\"\n    assert str(m.UnscopedEnum.ETwo) == \"UnscopedEnum.ETwo\"\n    assert str(m.EOne) == \"UnscopedEnum.EOne\"\n    assert repr(m.UnscopedEnum.EOne) == \"<UnscopedEnum.EOne: 1>\"\n    assert repr(m.UnscopedEnum.ETwo) == \"<UnscopedEnum.ETwo: 2>\"\n    assert repr(m.EOne) == \"<UnscopedEnum.EOne: 1>\"\n\n    # name property\n    assert m.UnscopedEnum.EOne.name == \"EOne\"\n    assert m.UnscopedEnum.EOne.value == 1\n    assert m.UnscopedEnum.ETwo.name == \"ETwo\"\n    assert m.UnscopedEnum.ETwo.value == 2\n    assert m.EOne is m.UnscopedEnum.EOne\n    # name, value readonly\n    with pytest.raises(AttributeError):\n        m.UnscopedEnum.EOne.name = \"\"\n    with pytest.raises(AttributeError):\n        m.UnscopedEnum.EOne.value = 10\n    # name, value returns a copy\n    # TODO: Neither the name nor value tests actually check against aliasing.\n    # Use a mutable type that has reference semantics.\n    nonaliased_name = m.UnscopedEnum.EOne.name\n    nonaliased_name = \"bar\"  # noqa: F841\n    assert m.UnscopedEnum.EOne.name == \"EOne\"\n    nonaliased_value = m.UnscopedEnum.EOne.value\n    nonaliased_value = 10  # noqa: F841\n    assert m.UnscopedEnum.EOne.value == 1\n\n    # __members__ property\n    assert m.UnscopedEnum.__members__ == {\n        \"EOne\": m.UnscopedEnum.EOne,\n        \"ETwo\": m.UnscopedEnum.ETwo,\n        \"EThree\": m.UnscopedEnum.EThree,\n    }\n    # __members__ readonly\n    with pytest.raises(AttributeError):\n        m.UnscopedEnum.__members__ = {}\n    # __members__ returns a copy\n    nonaliased_members = m.UnscopedEnum.__members__\n    nonaliased_members[\"bar\"] = \"baz\"\n    assert m.UnscopedEnum.__members__ == {\n        \"EOne\": m.UnscopedEnum.EOne,\n        \"ETwo\": m.UnscopedEnum.ETwo,\n        \"EThree\": m.UnscopedEnum.EThree,\n    }\n\n    for docstring_line in \"\"\"An unscoped enumeration\n\nMembers:\n\n  EOne : Docstring for EOne\n\n  ETwo : Docstring for ETwo\n\n  EThree : Docstring for EThree\"\"\".split(\n        \"\\n\"\n    ):\n        assert docstring_line in m.UnscopedEnum.__doc__\n\n    # Unscoped enums will accept ==/!= int comparisons\n    y = m.UnscopedEnum.ETwo\n    assert y == 2\n    assert 2 == y\n    assert y != 3\n    assert 3 != y\n    # Compare with None\n    assert y != None  # noqa: E711\n    assert not (y == None)  # noqa: E711\n    # Compare with an object\n    assert y != object()\n    assert not (y == object())\n    # Compare with string\n    assert y != \"2\"\n    assert \"2\" != y\n    assert not (\"2\" == y)\n    assert not (y == \"2\")\n\n    with pytest.raises(TypeError):\n        y < object()  # noqa: B015\n\n    with pytest.raises(TypeError):\n        y <= object()  # noqa: B015\n\n    with pytest.raises(TypeError):\n        y > object()  # noqa: B015\n\n    with pytest.raises(TypeError):\n        y >= object()  # noqa: B015\n\n    with pytest.raises(TypeError):\n        y | object()\n\n    with pytest.raises(TypeError):\n        y & object()\n\n    with pytest.raises(TypeError):\n        y ^ object()\n\n    assert int(m.UnscopedEnum.ETwo) == 2\n    assert str(m.UnscopedEnum(2)) == \"UnscopedEnum.ETwo\"\n\n    # order\n    assert m.UnscopedEnum.EOne < m.UnscopedEnum.ETwo\n    assert m.UnscopedEnum.EOne < 2\n    assert m.UnscopedEnum.ETwo > m.UnscopedEnum.EOne\n    assert m.UnscopedEnum.ETwo > 1\n    assert m.UnscopedEnum.ETwo <= 2\n    assert m.UnscopedEnum.ETwo >= 2\n    assert m.UnscopedEnum.EOne <= m.UnscopedEnum.ETwo\n    assert m.UnscopedEnum.EOne <= 2\n    assert m.UnscopedEnum.ETwo >= m.UnscopedEnum.EOne\n    assert m.UnscopedEnum.ETwo >= 1\n    assert not (m.UnscopedEnum.ETwo < m.UnscopedEnum.EOne)\n    assert not (2 < m.UnscopedEnum.EOne)\n\n    # arithmetic\n    assert m.UnscopedEnum.EOne & m.UnscopedEnum.EThree == m.UnscopedEnum.EOne\n    assert m.UnscopedEnum.EOne | m.UnscopedEnum.ETwo == m.UnscopedEnum.EThree\n    assert m.UnscopedEnum.EOne ^ m.UnscopedEnum.EThree == m.UnscopedEnum.ETwo\n\n\ndef test_scoped_enum():\n    assert m.test_scoped_enum(m.ScopedEnum.Three) == \"ScopedEnum::Three\"\n    z = m.ScopedEnum.Two\n    assert m.test_scoped_enum(z) == \"ScopedEnum::Two\"\n\n    # Scoped enums will *NOT* accept ==/!= int comparisons (Will always return False)\n    assert not z == 3\n    assert not 3 == z\n    assert z != 3\n    assert 3 != z\n    # Compare with None\n    assert z != None  # noqa: E711\n    assert not (z == None)  # noqa: E711\n    # Compare with an object\n    assert z != object()\n    assert not (z == object())\n    # Scoped enums will *NOT* accept >, <, >= and <= int comparisons (Will throw exceptions)\n    with pytest.raises(TypeError):\n        z > 3  # noqa: B015\n    with pytest.raises(TypeError):\n        z < 3  # noqa: B015\n    with pytest.raises(TypeError):\n        z >= 3  # noqa: B015\n    with pytest.raises(TypeError):\n        z <= 3  # noqa: B015\n\n    # order\n    assert m.ScopedEnum.Two < m.ScopedEnum.Three\n    assert m.ScopedEnum.Three > m.ScopedEnum.Two\n    assert m.ScopedEnum.Two <= m.ScopedEnum.Three\n    assert m.ScopedEnum.Two <= m.ScopedEnum.Two\n    assert m.ScopedEnum.Two >= m.ScopedEnum.Two\n    assert m.ScopedEnum.Three >= m.ScopedEnum.Two\n\n\ndef test_implicit_conversion():\n    assert str(m.ClassWithUnscopedEnum.EMode.EFirstMode) == \"EMode.EFirstMode\"\n    assert str(m.ClassWithUnscopedEnum.EFirstMode) == \"EMode.EFirstMode\"\n    assert repr(m.ClassWithUnscopedEnum.EMode.EFirstMode) == \"<EMode.EFirstMode: 1>\"\n    assert repr(m.ClassWithUnscopedEnum.EFirstMode) == \"<EMode.EFirstMode: 1>\"\n\n    f = m.ClassWithUnscopedEnum.test_function\n    first = m.ClassWithUnscopedEnum.EFirstMode\n    second = m.ClassWithUnscopedEnum.ESecondMode\n\n    assert f(first) == 1\n\n    assert f(first) == f(first)\n    assert not f(first) != f(first)\n\n    assert f(first) != f(second)\n    assert not f(first) == f(second)\n\n    assert f(first) == int(f(first))\n    assert not f(first) != int(f(first))\n\n    assert f(first) != int(f(second))\n    assert not f(first) == int(f(second))\n\n    # noinspection PyDictCreation\n    x = {f(first): 1, f(second): 2}\n    x[f(first)] = 3\n    x[f(second)] = 4\n    # Hashing test\n    assert repr(x) == \"{<EMode.EFirstMode: 1>: 3, <EMode.ESecondMode: 2>: 4}\"\n\n\ndef test_binary_operators():\n    assert int(m.Flags.Read) == 4\n    assert int(m.Flags.Write) == 2\n    assert int(m.Flags.Execute) == 1\n    assert int(m.Flags.Read | m.Flags.Write | m.Flags.Execute) == 7\n    assert int(m.Flags.Read | m.Flags.Write) == 6\n    assert int(m.Flags.Read | m.Flags.Execute) == 5\n    assert int(m.Flags.Write | m.Flags.Execute) == 3\n    assert int(m.Flags.Write | 1) == 3\n    assert ~m.Flags.Write == -3\n\n    state = m.Flags.Read | m.Flags.Write\n    assert (state & m.Flags.Read) != 0\n    assert (state & m.Flags.Write) != 0\n    assert (state & m.Flags.Execute) == 0\n    assert (state & 1) == 0\n\n    state2 = ~state\n    assert state2 == -7\n    assert int(state ^ state2) == -1\n\n\ndef test_enum_to_int():\n    m.test_enum_to_int(m.Flags.Read)\n    m.test_enum_to_int(m.ClassWithUnscopedEnum.EMode.EFirstMode)\n    m.test_enum_to_int(m.ScopedCharEnum.Positive)\n    m.test_enum_to_int(m.ScopedBoolEnum.TRUE)\n    m.test_enum_to_uint(m.Flags.Read)\n    m.test_enum_to_uint(m.ClassWithUnscopedEnum.EMode.EFirstMode)\n    m.test_enum_to_uint(m.ScopedCharEnum.Positive)\n    m.test_enum_to_uint(m.ScopedBoolEnum.TRUE)\n    m.test_enum_to_long_long(m.Flags.Read)\n    m.test_enum_to_long_long(m.ClassWithUnscopedEnum.EMode.EFirstMode)\n    m.test_enum_to_long_long(m.ScopedCharEnum.Positive)\n    m.test_enum_to_long_long(m.ScopedBoolEnum.TRUE)\n\n\ndef test_duplicate_enum_name():\n    with pytest.raises(ValueError) as excinfo:\n        m.register_bad_enum()\n    assert str(excinfo.value) == 'SimpleEnum: element \"ONE\" already exists!'\n\n\ndef test_char_underlying_enum():  # Issue #1331/PR #1334:\n    assert type(m.ScopedCharEnum.Positive.__int__()) is int\n    assert int(m.ScopedChar16Enum.Zero) == 0\n    assert hash(m.ScopedChar32Enum.Positive) == 1\n    assert type(m.ScopedCharEnum.Positive.__getstate__()) is int\n    assert m.ScopedWCharEnum(1) == m.ScopedWCharEnum.Positive\n    with pytest.raises(TypeError):\n        # Even if the underlying type is char, only an int can be used to construct the enum:\n        m.ScopedCharEnum(\"0\")\n\n\ndef test_bool_underlying_enum():\n    assert type(m.ScopedBoolEnum.TRUE.__int__()) is int\n    assert int(m.ScopedBoolEnum.FALSE) == 0\n    assert hash(m.ScopedBoolEnum.TRUE) == 1\n    assert type(m.ScopedBoolEnum.TRUE.__getstate__()) is int\n    assert m.ScopedBoolEnum(1) == m.ScopedBoolEnum.TRUE\n    # Enum could construct with a bool\n    # (bool is a strict subclass of int, and False will be converted to 0)\n    assert m.ScopedBoolEnum(False) == m.ScopedBoolEnum.FALSE\n\n\ndef test_docstring_signatures():\n    for enum_type in [m.ScopedEnum, m.UnscopedEnum]:\n        for attr in enum_type.__dict__.values():\n            # Issue #2623/PR #2637: Add argument names to enum_ methods\n            assert \"arg0\" not in (attr.__doc__ or \"\")\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_eval.cpp",
    "content": "/*\n    tests/test_eval.cpp -- Usage of eval() and eval_file()\n\n    Copyright (c) 2016 Klemens D. Morgenstern\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/eval.h>\n\n#include \"pybind11_tests.h\"\n\n#include <utility>\n\nTEST_SUBMODULE(eval_, m) {\n    // test_evals\n\n    auto global = py::dict(py::module_::import(\"__main__\").attr(\"__dict__\"));\n\n    m.def(\"test_eval_statements\", [global]() {\n        auto local = py::dict();\n        local[\"call_test\"] = py::cpp_function([&]() -> int { return 42; });\n\n        // Regular string literal\n        py::exec(\"message = 'Hello World!'\\n\"\n                 \"x = call_test()\",\n                 global,\n                 local);\n\n        // Multi-line raw string literal\n        py::exec(R\"(\n            if x == 42:\n                print(message)\n            else:\n                raise RuntimeError\n            )\",\n                 global,\n                 local);\n        auto x = local[\"x\"].cast<int>();\n\n        return x == 42;\n    });\n\n    m.def(\"test_eval\", [global]() {\n        auto local = py::dict();\n        local[\"x\"] = py::int_(42);\n        auto x = py::eval(\"x\", global, local);\n        return x.cast<int>() == 42;\n    });\n\n    m.def(\"test_eval_single_statement\", []() {\n        auto local = py::dict();\n        local[\"call_test\"] = py::cpp_function([&]() -> int { return 42; });\n\n        auto result = py::eval<py::eval_single_statement>(\"x = call_test()\", py::dict(), local);\n        auto x = local[\"x\"].cast<int>();\n        return result.is_none() && x == 42;\n    });\n\n    m.def(\"test_eval_file\", [global](py::str filename) {\n        auto local = py::dict();\n        local[\"y\"] = py::int_(43);\n\n        int val_out = 0;\n        local[\"call_test2\"] = py::cpp_function([&](int value) { val_out = value; });\n\n        auto result = py::eval_file(std::move(filename), global, local);\n        return val_out == 43 && result.is_none();\n    });\n\n    m.def(\"test_eval_failure\", []() {\n        try {\n            py::eval(\"nonsense code ...\");\n        } catch (py::error_already_set &) {\n            return true;\n        }\n        return false;\n    });\n\n    m.def(\"test_eval_file_failure\", []() {\n        try {\n            py::eval_file(\"non-existing file\");\n        } catch (std::exception &) {\n            return true;\n        }\n        return false;\n    });\n\n    // test_eval_empty_globals\n    m.def(\"eval_empty_globals\", [](py::object global) {\n        if (global.is_none()) {\n            global = py::dict();\n        }\n        auto int_class = py::eval(\"isinstance(42, int)\", global);\n        return global;\n    });\n\n    // test_eval_closure\n    m.def(\"test_eval_closure\", []() {\n        py::dict global;\n        global[\"closure_value\"] = 42;\n        py::dict local;\n        local[\"closure_value\"] = 0;\n        py::exec(R\"(\n            local_value = closure_value\n\n            def func_global():\n                return closure_value\n\n            def func_local():\n                return local_value\n            )\",\n                 global,\n                 local);\n        return std::make_pair(global, local);\n    });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_eval.py",
    "content": "import os\n\nimport pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import eval_ as m\n\n\ndef test_evals(capture):\n    with capture:\n        assert m.test_eval_statements()\n    assert capture == \"Hello World!\"\n\n    assert m.test_eval()\n    assert m.test_eval_single_statement()\n\n    assert m.test_eval_failure()\n\n\n@pytest.mark.xfail(\"env.PYPY\", raises=RuntimeError)\ndef test_eval_file():\n    filename = os.path.join(os.path.dirname(__file__), \"test_eval_call.py\")\n    assert m.test_eval_file(filename)\n\n    assert m.test_eval_file_failure()\n\n\ndef test_eval_empty_globals():\n    assert \"__builtins__\" in m.eval_empty_globals(None)\n\n    g = {}\n    assert \"__builtins__\" in m.eval_empty_globals(g)\n    assert \"__builtins__\" in g\n\n\ndef test_eval_closure():\n    global_, local = m.test_eval_closure()\n\n    assert global_[\"closure_value\"] == 42\n    assert local[\"closure_value\"] == 0\n\n    assert \"local_value\" not in global_\n    assert local[\"local_value\"] == 0\n\n    assert \"func_global\" not in global_\n    assert local[\"func_global\"]() == 42\n\n    assert \"func_local\" not in global_\n    with pytest.raises(NameError):\n        local[\"func_local\"]()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_eval_call.py",
    "content": "# This file is called from 'test_eval.py'\n\nif \"call_test2\" in locals():\n    call_test2(y)  # noqa: F821 undefined name\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_exceptions.cpp",
    "content": "/*\n    tests/test_custom-exceptions.cpp -- exception translation\n\n    Copyright (c) 2016 Pim Schellart <P.Schellart@princeton.edu>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n#include \"test_exceptions.h\"\n\n#include \"local_bindings.h\"\n#include \"pybind11_tests.h\"\n\n#include <exception>\n#include <stdexcept>\n#include <utility>\n\n// A type that should be raised as an exception in Python\nclass MyException : public std::exception {\npublic:\n    explicit MyException(const char *m) : message{m} {}\n    const char *what() const noexcept override { return message.c_str(); }\n\nprivate:\n    std::string message = \"\";\n};\n\n// A type that should be translated to a standard Python exception\nclass MyException2 : public std::exception {\npublic:\n    explicit MyException2(const char *m) : message{m} {}\n    const char *what() const noexcept override { return message.c_str(); }\n\nprivate:\n    std::string message = \"\";\n};\n\n// A type that is not derived from std::exception (and is thus unknown)\nclass MyException3 {\npublic:\n    explicit MyException3(const char *m) : message{m} {}\n    virtual const char *what() const noexcept { return message.c_str(); }\n    // Rule of 5 BEGIN: to preempt compiler warnings.\n    MyException3(const MyException3 &) = default;\n    MyException3(MyException3 &&) = default;\n    MyException3 &operator=(const MyException3 &) = default;\n    MyException3 &operator=(MyException3 &&) = default;\n    virtual ~MyException3() = default;\n    // Rule of 5 END.\nprivate:\n    std::string message = \"\";\n};\n\n// A type that should be translated to MyException\n// and delegated to its exception translator\nclass MyException4 : public std::exception {\npublic:\n    explicit MyException4(const char *m) : message{m} {}\n    const char *what() const noexcept override { return message.c_str(); }\n\nprivate:\n    std::string message = \"\";\n};\n\n// Like the above, but declared via the helper function\nclass MyException5 : public std::logic_error {\npublic:\n    explicit MyException5(const std::string &what) : std::logic_error(what) {}\n};\n\n// Inherits from MyException5\nclass MyException5_1 : public MyException5 {\n    using MyException5::MyException5;\n};\n\n// Exception that will be caught via the module local translator.\nclass MyException6 : public std::exception {\npublic:\n    explicit MyException6(const char *m) : message{m} {}\n    const char *what() const noexcept override { return message.c_str(); }\n\nprivate:\n    std::string message = \"\";\n};\n\nstruct PythonCallInDestructor {\n    explicit PythonCallInDestructor(const py::dict &d) : d(d) {}\n    ~PythonCallInDestructor() { d[\"good\"] = true; }\n\n    py::dict d;\n};\n\nstruct PythonAlreadySetInDestructor {\n    explicit PythonAlreadySetInDestructor(const py::str &s) : s(s) {}\n    ~PythonAlreadySetInDestructor() {\n        py::dict foo;\n        try {\n            // Assign to a py::object to force read access of nonexistent dict entry\n            py::object o = foo[\"bar\"];\n        } catch (py::error_already_set &ex) {\n            ex.discard_as_unraisable(s);\n        }\n    }\n\n    py::str s;\n};\n\nTEST_SUBMODULE(exceptions, m) {\n    m.def(\"throw_std_exception\",\n          []() { throw std::runtime_error(\"This exception was intentionally thrown.\"); });\n\n    // make a new custom exception and use it as a translation target\n    static py::exception<MyException> ex(m, \"MyException\");\n    py::register_exception_translator([](std::exception_ptr p) {\n        try {\n            if (p) {\n                std::rethrow_exception(p);\n            }\n        } catch (const MyException &e) {\n            // Set MyException as the active python error\n            ex(e.what());\n        }\n    });\n\n    // register new translator for MyException2\n    // no need to store anything here because this type will\n    // never by visible from Python\n    py::register_exception_translator([](std::exception_ptr p) {\n        try {\n            if (p) {\n                std::rethrow_exception(p);\n            }\n        } catch (const MyException2 &e) {\n            // Translate this exception to a standard RuntimeError\n            PyErr_SetString(PyExc_RuntimeError, e.what());\n        }\n    });\n\n    // register new translator for MyException4\n    // which will catch it and delegate to the previously registered\n    // translator for MyException by throwing a new exception\n    py::register_exception_translator([](std::exception_ptr p) {\n        try {\n            if (p) {\n                std::rethrow_exception(p);\n            }\n        } catch (const MyException4 &e) {\n            throw MyException(e.what());\n        }\n    });\n\n    // A simple exception translation:\n    auto ex5 = py::register_exception<MyException5>(m, \"MyException5\");\n    // A slightly more complicated one that declares MyException5_1 as a subclass of MyException5\n    py::register_exception<MyException5_1>(m, \"MyException5_1\", ex5.ptr());\n\n    // py::register_local_exception<LocalSimpleException>(m, \"LocalSimpleException\")\n\n    py::register_local_exception_translator([](std::exception_ptr p) {\n        try {\n            if (p) {\n                std::rethrow_exception(p);\n            }\n        } catch (const MyException6 &e) {\n            PyErr_SetString(PyExc_RuntimeError, e.what());\n        }\n    });\n\n    m.def(\"throws1\", []() { throw MyException(\"this error should go to a custom type\"); });\n    m.def(\"throws2\",\n          []() { throw MyException2(\"this error should go to a standard Python exception\"); });\n    m.def(\"throws3\", []() { throw MyException3(\"this error cannot be translated\"); });\n    m.def(\"throws4\", []() { throw MyException4(\"this error is rethrown\"); });\n    m.def(\"throws5\",\n          []() { throw MyException5(\"this is a helper-defined translated exception\"); });\n    m.def(\"throws5_1\", []() { throw MyException5_1(\"MyException5 subclass\"); });\n    m.def(\"throws6\", []() { throw MyException6(\"MyException6 only handled in this module\"); });\n    m.def(\"throws_logic_error\", []() {\n        throw std::logic_error(\"this error should fall through to the standard handler\");\n    });\n    m.def(\"throws_overflow_error\", []() { throw std::overflow_error(\"\"); });\n    m.def(\"throws_local_error\", []() { throw LocalException(\"never caught\"); });\n    m.def(\"throws_local_simple_error\", []() { throw LocalSimpleException(\"this mod\"); });\n    m.def(\"exception_matches\", []() {\n        py::dict foo;\n        try {\n            // Assign to a py::object to force read access of nonexistent dict entry\n            py::object o = foo[\"bar\"];\n        } catch (py::error_already_set &ex) {\n            if (!ex.matches(PyExc_KeyError)) {\n                throw;\n            }\n            return true;\n        }\n        return false;\n    });\n    m.def(\"exception_matches_base\", []() {\n        py::dict foo;\n        try {\n            // Assign to a py::object to force read access of nonexistent dict entry\n            py::object o = foo[\"bar\"];\n        } catch (py::error_already_set &ex) {\n            if (!ex.matches(PyExc_Exception)) {\n                throw;\n            }\n            return true;\n        }\n        return false;\n    });\n    m.def(\"modulenotfound_exception_matches_base\", []() {\n        try {\n            // On Python >= 3.6, this raises a ModuleNotFoundError, a subclass of ImportError\n            py::module_::import(\"nonexistent\");\n        } catch (py::error_already_set &ex) {\n            if (!ex.matches(PyExc_ImportError)) {\n                throw;\n            }\n            return true;\n        }\n        return false;\n    });\n\n    m.def(\"throw_already_set\", [](bool err) {\n        if (err) {\n            PyErr_SetString(PyExc_ValueError, \"foo\");\n        }\n        try {\n            throw py::error_already_set();\n        } catch (const std::runtime_error &e) {\n            if ((err && e.what() != std::string(\"ValueError: foo\"))\n                || (!err\n                    && e.what()\n                           != std::string(\"Internal error: pybind11::error_already_set called \"\n                                          \"while Python error indicator not set.\"))) {\n                PyErr_Clear();\n                throw std::runtime_error(\"error message mismatch\");\n            }\n        }\n        PyErr_Clear();\n        if (err) {\n            PyErr_SetString(PyExc_ValueError, \"foo\");\n        }\n        throw py::error_already_set();\n    });\n\n    m.def(\"python_call_in_destructor\", [](const py::dict &d) {\n        bool retval = false;\n        try {\n            PythonCallInDestructor set_dict_in_destructor(d);\n            PyErr_SetString(PyExc_ValueError, \"foo\");\n            throw py::error_already_set();\n        } catch (const py::error_already_set &) {\n            retval = true;\n        }\n        return retval;\n    });\n\n    m.def(\"python_alreadyset_in_destructor\", [](const py::str &s) {\n        PythonAlreadySetInDestructor alreadyset_in_destructor(s);\n        return true;\n    });\n\n    // test_nested_throws\n    m.def(\"try_catch\",\n          [m](const py::object &exc_type, const py::function &f, const py::args &args) {\n              try {\n                  f(*args);\n              } catch (py::error_already_set &ex) {\n                  if (ex.matches(exc_type)) {\n                      py::print(ex.what());\n                  } else {\n                      // Simply `throw;` also works and is better, but using `throw ex;`\n                      // here to cover that situation (as observed in the wild).\n                      throw ex; // Invokes the copy ctor.\n                  }\n              }\n          });\n\n    // Test repr that cannot be displayed\n    m.def(\"simple_bool_passthrough\", [](bool x) { return x; });\n\n    m.def(\"throw_should_be_translated_to_key_error\", []() { throw shared_exception(); });\n\n    m.def(\"raise_from\", []() {\n        PyErr_SetString(PyExc_ValueError, \"inner\");\n        py::raise_from(PyExc_ValueError, \"outer\");\n        throw py::error_already_set();\n    });\n\n    m.def(\"raise_from_already_set\", []() {\n        try {\n            PyErr_SetString(PyExc_ValueError, \"inner\");\n            throw py::error_already_set();\n        } catch (py::error_already_set &e) {\n            py::raise_from(e, PyExc_ValueError, \"outer\");\n            throw py::error_already_set();\n        }\n    });\n\n    m.def(\"throw_nested_exception\", []() {\n        try {\n            throw std::runtime_error(\"Inner Exception\");\n        } catch (const std::runtime_error &) {\n            std::throw_with_nested(std::runtime_error(\"Outer Exception\"));\n        }\n    });\n\n    m.def(\"error_already_set_what\", [](const py::object &exc_type, const py::object &exc_value) {\n        PyErr_SetObject(exc_type.ptr(), exc_value.ptr());\n        std::string what = py::error_already_set().what();\n        bool py_err_set_after_what = (PyErr_Occurred() != nullptr);\n        PyErr_Clear();\n        return py::make_tuple(std::move(what), py_err_set_after_what);\n    });\n\n    m.def(\"test_cross_module_interleaved_error_already_set\", []() {\n        auto cm = py::module_::import(\"cross_module_interleaved_error_already_set\");\n        auto interleaved_error_already_set\n            = reinterpret_cast<void (*)()>(PyLong_AsVoidPtr(cm.attr(\"funcaddr\").ptr()));\n        interleaved_error_already_set();\n    });\n\n    m.def(\"test_error_already_set_double_restore\", [](bool dry_run) {\n        PyErr_SetString(PyExc_ValueError, \"Random error.\");\n        py::error_already_set e;\n        e.restore();\n        PyErr_Clear();\n        if (!dry_run) {\n            e.restore();\n        }\n    });\n\n    // https://github.com/pybind/pybind11/issues/4075\n    m.def(\"test_pypy_oserror_normalization\", []() {\n        try {\n            py::module_::import(\"io\").attr(\"open\")(\"this_filename_must_not_exist\", \"r\");\n        } catch (const py::error_already_set &e) {\n            return py::str(e.what()); // str must be built before e goes out of scope.\n        }\n        return py::str(\"UNEXPECTED\");\n    });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_exceptions.h",
    "content": "#pragma once\n#include \"pybind11_tests.h\"\n\n#include <stdexcept>\n\n// shared exceptions for cross_module_tests\n\nclass PYBIND11_EXPORT_EXCEPTION shared_exception : public pybind11::builtin_exception {\npublic:\n    using builtin_exception::builtin_exception;\n    explicit shared_exception() : shared_exception(\"\") {}\n    void set_error() const override { PyErr_SetString(PyExc_RuntimeError, what()); }\n};\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_exceptions.py",
    "content": "import sys\n\nimport pytest\n\nimport env\nimport pybind11_cross_module_tests as cm\nimport pybind11_tests  # noqa: F401\nfrom pybind11_tests import exceptions as m\n\n\ndef test_std_exception(msg):\n    with pytest.raises(RuntimeError) as excinfo:\n        m.throw_std_exception()\n    assert msg(excinfo.value) == \"This exception was intentionally thrown.\"\n\n\ndef test_error_already_set(msg):\n    with pytest.raises(RuntimeError) as excinfo:\n        m.throw_already_set(False)\n    assert (\n        msg(excinfo.value)\n        == \"Internal error: pybind11::error_already_set called while Python error indicator not set.\"\n    )\n\n    with pytest.raises(ValueError) as excinfo:\n        m.throw_already_set(True)\n    assert msg(excinfo.value) == \"foo\"\n\n\ndef test_raise_from(msg):\n    with pytest.raises(ValueError) as excinfo:\n        m.raise_from()\n    assert msg(excinfo.value) == \"outer\"\n    assert msg(excinfo.value.__cause__) == \"inner\"\n\n\ndef test_raise_from_already_set(msg):\n    with pytest.raises(ValueError) as excinfo:\n        m.raise_from_already_set()\n    assert msg(excinfo.value) == \"outer\"\n    assert msg(excinfo.value.__cause__) == \"inner\"\n\n\ndef test_cross_module_exceptions(msg):\n    with pytest.raises(RuntimeError) as excinfo:\n        cm.raise_runtime_error()\n    assert str(excinfo.value) == \"My runtime error\"\n\n    with pytest.raises(ValueError) as excinfo:\n        cm.raise_value_error()\n    assert str(excinfo.value) == \"My value error\"\n\n    with pytest.raises(ValueError) as excinfo:\n        cm.throw_pybind_value_error()\n    assert str(excinfo.value) == \"pybind11 value error\"\n\n    with pytest.raises(TypeError) as excinfo:\n        cm.throw_pybind_type_error()\n    assert str(excinfo.value) == \"pybind11 type error\"\n\n    with pytest.raises(StopIteration) as excinfo:\n        cm.throw_stop_iteration()\n\n    with pytest.raises(cm.LocalSimpleException) as excinfo:\n        cm.throw_local_simple_error()\n    assert msg(excinfo.value) == \"external mod\"\n\n    with pytest.raises(KeyError) as excinfo:\n        cm.throw_local_error()\n    # KeyError is a repr of the key, so it has an extra set of quotes\n    assert str(excinfo.value) == \"'just local'\"\n\n\n# TODO: FIXME\n@pytest.mark.xfail(\n    \"env.MACOS and (env.PYPY or pybind11_tests.compiler_info.startswith('Homebrew Clang'))\",\n    raises=RuntimeError,\n    reason=\"See Issue #2847, PR #2999, PR #4324\",\n)\ndef test_cross_module_exception_translator():\n    with pytest.raises(KeyError):\n        # translator registered in cross_module_tests\n        m.throw_should_be_translated_to_key_error()\n\n\ndef test_python_call_in_catch():\n    d = {}\n    assert m.python_call_in_destructor(d) is True\n    assert d[\"good\"] is True\n\n\ndef ignore_pytest_unraisable_warning(f):\n    unraisable = \"PytestUnraisableExceptionWarning\"\n    if hasattr(pytest, unraisable):  # Python >= 3.8 and pytest >= 6\n        dec = pytest.mark.filterwarnings(f\"ignore::pytest.{unraisable}\")\n        return dec(f)\n    else:\n        return f\n\n\n# TODO: find out why this fails on PyPy, https://foss.heptapod.net/pypy/pypy/-/issues/3583\n@pytest.mark.xfail(env.PYPY, reason=\"Failure on PyPy 3.8 (7.3.7)\", strict=False)\n@ignore_pytest_unraisable_warning\ndef test_python_alreadyset_in_destructor(monkeypatch, capsys):\n    hooked = False\n    triggered = False\n\n    if hasattr(sys, \"unraisablehook\"):  # Python 3.8+\n        hooked = True\n        # Don't take `sys.unraisablehook`, as that's overwritten by pytest\n        default_hook = sys.__unraisablehook__\n\n        def hook(unraisable_hook_args):\n            exc_type, exc_value, exc_tb, err_msg, obj = unraisable_hook_args\n            if obj == \"already_set demo\":\n                nonlocal triggered\n                triggered = True\n            default_hook(unraisable_hook_args)\n            return\n\n        # Use monkeypatch so pytest can apply and remove the patch as appropriate\n        monkeypatch.setattr(sys, \"unraisablehook\", hook)\n\n    assert m.python_alreadyset_in_destructor(\"already_set demo\") is True\n    if hooked:\n        assert triggered is True\n\n    _, captured_stderr = capsys.readouterr()\n    assert captured_stderr.startswith(\"Exception ignored in: 'already_set demo'\")\n    assert captured_stderr.rstrip().endswith(\"KeyError: 'bar'\")\n\n\ndef test_exception_matches():\n    assert m.exception_matches()\n    assert m.exception_matches_base()\n    assert m.modulenotfound_exception_matches_base()\n\n\ndef test_custom(msg):\n    # Can we catch a MyException?\n    with pytest.raises(m.MyException) as excinfo:\n        m.throws1()\n    assert msg(excinfo.value) == \"this error should go to a custom type\"\n\n    # Can we translate to standard Python exceptions?\n    with pytest.raises(RuntimeError) as excinfo:\n        m.throws2()\n    assert msg(excinfo.value) == \"this error should go to a standard Python exception\"\n\n    # Can we handle unknown exceptions?\n    with pytest.raises(RuntimeError) as excinfo:\n        m.throws3()\n    assert msg(excinfo.value) == \"Caught an unknown exception!\"\n\n    # Can we delegate to another handler by rethrowing?\n    with pytest.raises(m.MyException) as excinfo:\n        m.throws4()\n    assert msg(excinfo.value) == \"this error is rethrown\"\n\n    # Can we fall-through to the default handler?\n    with pytest.raises(RuntimeError) as excinfo:\n        m.throws_logic_error()\n    assert (\n        msg(excinfo.value) == \"this error should fall through to the standard handler\"\n    )\n\n    # OverFlow error translation.\n    with pytest.raises(OverflowError) as excinfo:\n        m.throws_overflow_error()\n\n    # Can we handle a helper-declared exception?\n    with pytest.raises(m.MyException5) as excinfo:\n        m.throws5()\n    assert msg(excinfo.value) == \"this is a helper-defined translated exception\"\n\n    # Exception subclassing:\n    with pytest.raises(m.MyException5) as excinfo:\n        m.throws5_1()\n    assert msg(excinfo.value) == \"MyException5 subclass\"\n    assert isinstance(excinfo.value, m.MyException5_1)\n\n    with pytest.raises(m.MyException5_1) as excinfo:\n        m.throws5_1()\n    assert msg(excinfo.value) == \"MyException5 subclass\"\n\n    with pytest.raises(m.MyException5) as excinfo:\n        try:\n            m.throws5()\n        except m.MyException5_1 as err:\n            raise RuntimeError(\"Exception error: caught child from parent\") from err\n    assert msg(excinfo.value) == \"this is a helper-defined translated exception\"\n\n\ndef test_nested_throws(capture):\n    \"\"\"Tests nested (e.g. C++ -> Python -> C++) exception handling\"\"\"\n\n    def throw_myex():\n        raise m.MyException(\"nested error\")\n\n    def throw_myex5():\n        raise m.MyException5(\"nested error 5\")\n\n    # In the comments below, the exception is caught in the first step, thrown in the last step\n\n    # C++ -> Python\n    with capture:\n        m.try_catch(m.MyException5, throw_myex5)\n    assert str(capture).startswith(\"MyException5: nested error 5\")\n\n    # Python -> C++ -> Python\n    with pytest.raises(m.MyException) as excinfo:\n        m.try_catch(m.MyException5, throw_myex)\n    assert str(excinfo.value) == \"nested error\"\n\n    def pycatch(exctype, f, *args):\n        try:\n            f(*args)\n        except m.MyException as e:\n            print(e)\n\n    # C++ -> Python -> C++ -> Python\n    with capture:\n        m.try_catch(\n            m.MyException5,\n            pycatch,\n            m.MyException,\n            m.try_catch,\n            m.MyException,\n            throw_myex5,\n        )\n    assert str(capture).startswith(\"MyException5: nested error 5\")\n\n    # C++ -> Python -> C++\n    with capture:\n        m.try_catch(m.MyException, pycatch, m.MyException5, m.throws4)\n    assert capture == \"this error is rethrown\"\n\n    # Python -> C++ -> Python -> C++\n    with pytest.raises(m.MyException5) as excinfo:\n        m.try_catch(m.MyException, pycatch, m.MyException, m.throws5)\n    assert str(excinfo.value) == \"this is a helper-defined translated exception\"\n\n\ndef test_throw_nested_exception():\n    with pytest.raises(RuntimeError) as excinfo:\n        m.throw_nested_exception()\n    assert str(excinfo.value) == \"Outer Exception\"\n    assert str(excinfo.value.__cause__) == \"Inner Exception\"\n\n\n# This can often happen if you wrap a pybind11 class in a Python wrapper\ndef test_invalid_repr():\n    class MyRepr:\n        def __repr__(self):\n            raise AttributeError(\"Example error\")\n\n    with pytest.raises(TypeError):\n        m.simple_bool_passthrough(MyRepr())\n\n\ndef test_local_translator(msg):\n    \"\"\"Tests that a local translator works and that the local translator from\n    the cross module is not applied\"\"\"\n    with pytest.raises(RuntimeError) as excinfo:\n        m.throws6()\n    assert msg(excinfo.value) == \"MyException6 only handled in this module\"\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.throws_local_error()\n    assert not isinstance(excinfo.value, KeyError)\n    assert msg(excinfo.value) == \"never caught\"\n\n    with pytest.raises(Exception) as excinfo:\n        m.throws_local_simple_error()\n    assert not isinstance(excinfo.value, cm.LocalSimpleException)\n    assert msg(excinfo.value) == \"this mod\"\n\n\ndef test_error_already_set_message_with_unicode_surrogate():  # Issue #4288\n    assert m.error_already_set_what(RuntimeError, \"\\ud927\") == (\n        \"RuntimeError: \\\\ud927\",\n        False,\n    )\n\n\ndef test_error_already_set_message_with_malformed_utf8():\n    assert m.error_already_set_what(RuntimeError, b\"\\x80\") == (\n        \"RuntimeError: b'\\\\x80'\",\n        False,\n    )\n\n\nclass FlakyException(Exception):\n    def __init__(self, failure_point):\n        if failure_point == \"failure_point_init\":\n            raise ValueError(\"triggered_failure_point_init\")\n        self.failure_point = failure_point\n\n    def __str__(self):\n        if self.failure_point == \"failure_point_str\":\n            raise ValueError(\"triggered_failure_point_str\")\n        return \"FlakyException.__str__\"\n\n\n@pytest.mark.parametrize(\n    \"exc_type, exc_value, expected_what\",\n    (\n        (ValueError, \"plain_str\", \"ValueError: plain_str\"),\n        (ValueError, (\"tuple_elem\",), \"ValueError: tuple_elem\"),\n        (FlakyException, (\"happy\",), \"FlakyException: FlakyException.__str__\"),\n    ),\n)\ndef test_error_already_set_what_with_happy_exceptions(\n    exc_type, exc_value, expected_what\n):\n    what, py_err_set_after_what = m.error_already_set_what(exc_type, exc_value)\n    assert not py_err_set_after_what\n    assert what == expected_what\n\n\n@pytest.mark.skipif(\"env.PYPY\", reason=\"PyErr_NormalizeException Segmentation fault\")\ndef test_flaky_exception_failure_point_init():\n    with pytest.raises(RuntimeError) as excinfo:\n        m.error_already_set_what(FlakyException, (\"failure_point_init\",))\n    lines = str(excinfo.value).splitlines()\n    # PyErr_NormalizeException replaces the original FlakyException with ValueError:\n    assert lines[:3] == [\n        \"pybind11::error_already_set: MISMATCH of original and normalized active exception types:\"\n        \" ORIGINAL FlakyException REPLACED BY ValueError: triggered_failure_point_init\",\n        \"\",\n        \"At:\",\n    ]\n    # Checking the first two lines of the traceback as formatted in error_string():\n    assert \"test_exceptions.py(\" in lines[3]\n    assert lines[3].endswith(\"): __init__\")\n    assert lines[4].endswith(\"): test_flaky_exception_failure_point_init\")\n\n\ndef test_flaky_exception_failure_point_str():\n    what, py_err_set_after_what = m.error_already_set_what(\n        FlakyException, (\"failure_point_str\",)\n    )\n    assert not py_err_set_after_what\n    lines = what.splitlines()\n    if env.PYPY and len(lines) == 3:\n        n = 3  # Traceback is missing.\n    else:\n        n = 5\n    assert (\n        lines[:n]\n        == [\n            \"FlakyException: <MESSAGE UNAVAILABLE DUE TO ANOTHER EXCEPTION>\",\n            \"\",\n            \"MESSAGE UNAVAILABLE DUE TO EXCEPTION: ValueError: triggered_failure_point_str\",\n            \"\",\n            \"At:\",\n        ][:n]\n    )\n\n\ndef test_cross_module_interleaved_error_already_set():\n    with pytest.raises(RuntimeError) as excinfo:\n        m.test_cross_module_interleaved_error_already_set()\n    assert str(excinfo.value) in (\n        \"2nd error.\",  # Almost all platforms.\n        \"RuntimeError: 2nd error.\",  # Some PyPy builds (seen under macOS).\n    )\n\n\ndef test_error_already_set_double_restore():\n    m.test_error_already_set_double_restore(True)  # dry_run\n    with pytest.raises(RuntimeError) as excinfo:\n        m.test_error_already_set_double_restore(False)\n    assert str(excinfo.value) == (\n        \"Internal error: pybind11::detail::error_fetch_and_normalize::restore()\"\n        \" called a second time. ORIGINAL ERROR: ValueError: Random error.\"\n    )\n\n\ndef test_pypy_oserror_normalization():\n    # https://github.com/pybind/pybind11/issues/4075\n    what = m.test_pypy_oserror_normalization()\n    assert \"this_filename_must_not_exist\" in what\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_factory_constructors.cpp",
    "content": "/*\n    tests/test_factory_constructors.cpp -- tests construction from a factory function\n                                           via py::init_factory()\n\n    Copyright (c) 2017 Jason Rhinelander <jason@imaginary.ca>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\n#include <cmath>\n#include <new>\n#include <utility>\n\n// Classes for testing python construction via C++ factory function:\n// Not publicly constructible, copyable, or movable:\nclass TestFactory1 {\n    friend class TestFactoryHelper;\n    TestFactory1() : value(\"(empty)\") { print_default_created(this); }\n    explicit TestFactory1(int v) : value(std::to_string(v)) { print_created(this, value); }\n    explicit TestFactory1(std::string v) : value(std::move(v)) { print_created(this, value); }\n\npublic:\n    std::string value;\n    TestFactory1(TestFactory1 &&) = delete;\n    TestFactory1(const TestFactory1 &) = delete;\n    TestFactory1 &operator=(TestFactory1 &&) = delete;\n    TestFactory1 &operator=(const TestFactory1 &) = delete;\n    ~TestFactory1() { print_destroyed(this); }\n};\n// Non-public construction, but moveable:\nclass TestFactory2 {\n    friend class TestFactoryHelper;\n    TestFactory2() : value(\"(empty2)\") { print_default_created(this); }\n    explicit TestFactory2(int v) : value(std::to_string(v)) { print_created(this, value); }\n    explicit TestFactory2(std::string v) : value(std::move(v)) { print_created(this, value); }\n\npublic:\n    TestFactory2(TestFactory2 &&m) noexcept : value{std::move(m.value)} {\n        print_move_created(this);\n    }\n    TestFactory2 &operator=(TestFactory2 &&m) noexcept {\n        value = std::move(m.value);\n        print_move_assigned(this);\n        return *this;\n    }\n    std::string value;\n    ~TestFactory2() { print_destroyed(this); }\n};\n// Mixed direct/factory construction:\nclass TestFactory3 {\nprotected:\n    friend class TestFactoryHelper;\n    TestFactory3() : value(\"(empty3)\") { print_default_created(this); }\n    explicit TestFactory3(int v) : value(std::to_string(v)) { print_created(this, value); }\n\npublic:\n    explicit TestFactory3(std::string v) : value(std::move(v)) { print_created(this, value); }\n    TestFactory3(TestFactory3 &&m) noexcept : value{std::move(m.value)} {\n        print_move_created(this);\n    }\n    TestFactory3 &operator=(TestFactory3 &&m) noexcept {\n        value = std::move(m.value);\n        print_move_assigned(this);\n        return *this;\n    }\n    std::string value;\n    virtual ~TestFactory3() { print_destroyed(this); }\n};\n// Inheritance test\nclass TestFactory4 : public TestFactory3 {\npublic:\n    TestFactory4() : TestFactory3() { print_default_created(this); }\n    explicit TestFactory4(int v) : TestFactory3(v) { print_created(this, v); }\n    ~TestFactory4() override { print_destroyed(this); }\n};\n// Another class for an invalid downcast test\nclass TestFactory5 : public TestFactory3 {\npublic:\n    explicit TestFactory5(int i) : TestFactory3(i) { print_created(this, i); }\n    ~TestFactory5() override { print_destroyed(this); }\n};\n\nclass TestFactory6 {\nprotected:\n    int value;\n    bool alias = false;\n\npublic:\n    explicit TestFactory6(int i) : value{i} { print_created(this, i); }\n    TestFactory6(TestFactory6 &&f) noexcept {\n        print_move_created(this);\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        value = f.value;\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        alias = f.alias;\n    }\n    TestFactory6(const TestFactory6 &f) {\n        print_copy_created(this);\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        value = f.value;\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        alias = f.alias;\n    }\n    virtual ~TestFactory6() { print_destroyed(this); }\n    virtual int get() { return value; }\n    bool has_alias() const { return alias; }\n};\nclass PyTF6 : public TestFactory6 {\npublic:\n    // Special constructor that allows the factory to construct a PyTF6 from a TestFactory6 only\n    // when an alias is needed:\n    explicit PyTF6(TestFactory6 &&base) : TestFactory6(std::move(base)) {\n        alias = true;\n        print_created(this, \"move\", value);\n    }\n    explicit PyTF6(int i) : TestFactory6(i) {\n        alias = true;\n        print_created(this, i);\n    }\n    PyTF6(PyTF6 &&f) noexcept : TestFactory6(std::move(f)) { print_move_created(this); }\n    PyTF6(const PyTF6 &f) : TestFactory6(f) { print_copy_created(this); }\n    explicit PyTF6(std::string s) : TestFactory6((int) s.size()) {\n        alias = true;\n        print_created(this, s);\n    }\n    ~PyTF6() override { print_destroyed(this); }\n    int get() override { PYBIND11_OVERRIDE(int, TestFactory6, get, /*no args*/); }\n};\n\nclass TestFactory7 {\nprotected:\n    int value;\n    bool alias = false;\n\npublic:\n    explicit TestFactory7(int i) : value{i} { print_created(this, i); }\n    TestFactory7(TestFactory7 &&f) noexcept {\n        print_move_created(this);\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        value = f.value;\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        alias = f.alias;\n    }\n    TestFactory7(const TestFactory7 &f) {\n        print_copy_created(this);\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        value = f.value;\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        alias = f.alias;\n    }\n    virtual ~TestFactory7() { print_destroyed(this); }\n    virtual int get() { return value; }\n    bool has_alias() const { return alias; }\n};\nclass PyTF7 : public TestFactory7 {\npublic:\n    explicit PyTF7(int i) : TestFactory7(i) {\n        // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n        alias = true;\n        print_created(this, i);\n    }\n    PyTF7(PyTF7 &&f) noexcept : TestFactory7(std::move(f)) { print_move_created(this); }\n    PyTF7(const PyTF7 &f) : TestFactory7(f) { print_copy_created(this); }\n    ~PyTF7() override { print_destroyed(this); }\n    int get() override { PYBIND11_OVERRIDE(int, TestFactory7, get, /*no args*/); }\n};\n\nclass TestFactoryHelper {\npublic:\n    // Non-movable, non-copyable type:\n    // Return via pointer:\n    static TestFactory1 *construct1() { return new TestFactory1(); }\n    // Holder:\n    static std::unique_ptr<TestFactory1> construct1(int a) {\n        return std::unique_ptr<TestFactory1>(new TestFactory1(a));\n    }\n    // pointer again\n    static TestFactory1 *construct1_string(std::string a) {\n        return new TestFactory1(std::move(a));\n    }\n\n    // Moveable type:\n    // pointer:\n    static TestFactory2 *construct2() { return new TestFactory2(); }\n    // holder:\n    static std::unique_ptr<TestFactory2> construct2(int a) {\n        return std::unique_ptr<TestFactory2>(new TestFactory2(a));\n    }\n    // by value moving:\n    static TestFactory2 construct2(std::string a) { return TestFactory2(std::move(a)); }\n\n    // shared_ptr holder type:\n    // pointer:\n    static TestFactory3 *construct3() { return new TestFactory3(); }\n    // holder:\n    static std::shared_ptr<TestFactory3> construct3(int a) {\n        return std::shared_ptr<TestFactory3>(new TestFactory3(a));\n    }\n};\n\nTEST_SUBMODULE(factory_constructors, m) {\n\n    // Define various trivial types to allow simpler overload resolution:\n    py::module_ m_tag = m.def_submodule(\"tag\");\n#define MAKE_TAG_TYPE(Name)                                                                       \\\n    struct Name##_tag {};                                                                         \\\n    py::class_<Name##_tag>(m_tag, #Name \"_tag\").def(py::init<>());                                \\\n    m_tag.attr(#Name) = py::cast(Name##_tag{})\n    MAKE_TAG_TYPE(pointer);\n    MAKE_TAG_TYPE(unique_ptr);\n    MAKE_TAG_TYPE(move);\n    MAKE_TAG_TYPE(shared_ptr);\n    MAKE_TAG_TYPE(derived);\n    MAKE_TAG_TYPE(TF4);\n    MAKE_TAG_TYPE(TF5);\n    MAKE_TAG_TYPE(null_ptr);\n    MAKE_TAG_TYPE(null_unique_ptr);\n    MAKE_TAG_TYPE(null_shared_ptr);\n    MAKE_TAG_TYPE(base);\n    MAKE_TAG_TYPE(invalid_base);\n    MAKE_TAG_TYPE(alias);\n    MAKE_TAG_TYPE(unaliasable);\n    MAKE_TAG_TYPE(mixed);\n\n    // test_init_factory_basic, test_bad_type\n    py::class_<TestFactory1>(m, \"TestFactory1\")\n        .def(py::init([](unique_ptr_tag, int v) { return TestFactoryHelper::construct1(v); }))\n        .def(py::init(&TestFactoryHelper::construct1_string)) // raw function pointer\n        .def(py::init([](pointer_tag) { return TestFactoryHelper::construct1(); }))\n        .def(py::init(\n            [](py::handle, int v, py::handle) { return TestFactoryHelper::construct1(v); }))\n        .def_readwrite(\"value\", &TestFactory1::value);\n    py::class_<TestFactory2>(m, \"TestFactory2\")\n        .def(py::init([](pointer_tag, int v) { return TestFactoryHelper::construct2(v); }))\n        .def(py::init([](unique_ptr_tag, std::string v) {\n            return TestFactoryHelper::construct2(std::move(v));\n        }))\n        .def(py::init([](move_tag) { return TestFactoryHelper::construct2(); }))\n        .def_readwrite(\"value\", &TestFactory2::value);\n\n    // Stateful & reused:\n    int c = 1;\n    auto c4a = [c](pointer_tag, TF4_tag, int a) {\n        (void) c;\n        return new TestFactory4(a);\n    };\n\n    // test_init_factory_basic, test_init_factory_casting\n    py::class_<TestFactory3, std::shared_ptr<TestFactory3>> pyTestFactory3(m, \"TestFactory3\");\n    pyTestFactory3\n        .def(py::init([](pointer_tag, int v) { return TestFactoryHelper::construct3(v); }))\n        .def(py::init([](shared_ptr_tag) { return TestFactoryHelper::construct3(); }));\n    ignoreOldStyleInitWarnings([&pyTestFactory3]() {\n        pyTestFactory3.def(\"__init__\", [](TestFactory3 &self, std::string v) {\n            new (&self) TestFactory3(std::move(v));\n        }); // placement-new ctor\n    });\n    pyTestFactory3\n        // factories returning a derived type:\n        .def(py::init(c4a)) // derived ptr\n        .def(py::init([](pointer_tag, TF5_tag, int a) { return new TestFactory5(a); }))\n        // derived shared ptr:\n        .def(py::init(\n            [](shared_ptr_tag, TF4_tag, int a) { return std::make_shared<TestFactory4>(a); }))\n        .def(py::init(\n            [](shared_ptr_tag, TF5_tag, int a) { return std::make_shared<TestFactory5>(a); }))\n\n        // Returns nullptr:\n        .def(py::init([](null_ptr_tag) { return (TestFactory3 *) nullptr; }))\n        .def(py::init([](null_unique_ptr_tag) { return std::unique_ptr<TestFactory3>(); }))\n        .def(py::init([](null_shared_ptr_tag) { return std::shared_ptr<TestFactory3>(); }))\n\n        .def_readwrite(\"value\", &TestFactory3::value);\n\n    // test_init_factory_casting\n    py::class_<TestFactory4, TestFactory3, std::shared_ptr<TestFactory4>>(m, \"TestFactory4\")\n        .def(py::init(c4a)) // pointer\n        ;\n\n    // Doesn't need to be registered, but registering makes getting ConstructorStats easier:\n    py::class_<TestFactory5, TestFactory3, std::shared_ptr<TestFactory5>>(m, \"TestFactory5\");\n\n    // test_init_factory_alias\n    // Alias testing\n    py::class_<TestFactory6, PyTF6>(m, \"TestFactory6\")\n        .def(py::init([](base_tag, int i) { return TestFactory6(i); }))\n        .def(py::init([](alias_tag, int i) { return PyTF6(i); }))\n        .def(py::init([](alias_tag, std::string s) { return PyTF6(std::move(s)); }))\n        .def(py::init([](alias_tag, pointer_tag, int i) { return new PyTF6(i); }))\n        .def(py::init([](base_tag, pointer_tag, int i) { return new TestFactory6(i); }))\n        .def(py::init(\n            [](base_tag, alias_tag, pointer_tag, int i) { return (TestFactory6 *) new PyTF6(i); }))\n\n        .def(\"get\", &TestFactory6::get)\n        .def(\"has_alias\", &TestFactory6::has_alias)\n\n        .def_static(\n            \"get_cstats\", &ConstructorStats::get<TestFactory6>, py::return_value_policy::reference)\n        .def_static(\n            \"get_alias_cstats\", &ConstructorStats::get<PyTF6>, py::return_value_policy::reference);\n\n    // test_init_factory_dual\n    // Separate alias constructor testing\n    py::class_<TestFactory7, PyTF7, std::shared_ptr<TestFactory7>>(m, \"TestFactory7\")\n        .def(py::init([](int i) { return TestFactory7(i); }, [](int i) { return PyTF7(i); }))\n        .def(py::init([](pointer_tag, int i) { return new TestFactory7(i); },\n                      [](pointer_tag, int i) { return new PyTF7(i); }))\n        .def(py::init([](mixed_tag, int i) { return new TestFactory7(i); },\n                      [](mixed_tag, int i) { return PyTF7(i); }))\n        .def(py::init([](mixed_tag, const std::string &s) { return TestFactory7((int) s.size()); },\n                      [](mixed_tag, const std::string &s) { return new PyTF7((int) s.size()); }))\n        .def(py::init([](base_tag, pointer_tag, int i) { return new TestFactory7(i); },\n                      [](base_tag, pointer_tag, int i) { return (TestFactory7 *) new PyTF7(i); }))\n        .def(py::init([](alias_tag, pointer_tag, int i) { return new PyTF7(i); },\n                      [](alias_tag, pointer_tag, int i) { return new PyTF7(10 * i); }))\n        .def(py::init(\n            [](shared_ptr_tag, base_tag, int i) { return std::make_shared<TestFactory7>(i); },\n            [](shared_ptr_tag, base_tag, int i) {\n                auto *p = new PyTF7(i);\n                return std::shared_ptr<TestFactory7>(p);\n            }))\n        .def(py::init([](shared_ptr_tag,\n                         invalid_base_tag,\n                         int i) { return std::make_shared<TestFactory7>(i); },\n                      [](shared_ptr_tag, invalid_base_tag, int i) {\n                          return std::make_shared<TestFactory7>(i);\n                      })) // <-- invalid alias factory\n\n        .def(\"get\", &TestFactory7::get)\n        .def(\"has_alias\", &TestFactory7::has_alias)\n\n        .def_static(\n            \"get_cstats\", &ConstructorStats::get<TestFactory7>, py::return_value_policy::reference)\n        .def_static(\n            \"get_alias_cstats\", &ConstructorStats::get<PyTF7>, py::return_value_policy::reference);\n\n    // test_placement_new_alternative\n    // Class with a custom new operator but *without* a placement new operator (issue #948)\n    class NoPlacementNew {\n    public:\n        explicit NoPlacementNew(int i) : i(i) {}\n        static void *operator new(std::size_t s) {\n            auto *p = ::operator new(s);\n            py::print(\"operator new called, returning\", reinterpret_cast<uintptr_t>(p));\n            return p;\n        }\n        static void operator delete(void *p) {\n            py::print(\"operator delete called on\", reinterpret_cast<uintptr_t>(p));\n            ::operator delete(p);\n        }\n        int i;\n    };\n    // As of 2.2, `py::init<args>` no longer requires placement new\n    py::class_<NoPlacementNew>(m, \"NoPlacementNew\")\n        .def(py::init<int>())\n        .def(py::init([]() { return new NoPlacementNew(100); }))\n        .def_readwrite(\"i\", &NoPlacementNew::i);\n\n    // test_reallocations\n    // Class that has verbose operator_new/operator_delete calls\n    struct NoisyAlloc {\n        NoisyAlloc(const NoisyAlloc &) = default;\n        explicit NoisyAlloc(int i) { py::print(py::str(\"NoisyAlloc(int {})\").format(i)); }\n        explicit NoisyAlloc(double d) { py::print(py::str(\"NoisyAlloc(double {})\").format(d)); }\n        ~NoisyAlloc() { py::print(\"~NoisyAlloc()\"); }\n\n        static void *operator new(size_t s) {\n            py::print(\"noisy new\");\n            return ::operator new(s);\n        }\n        static void *operator new(size_t, void *p) {\n            py::print(\"noisy placement new\");\n            return p;\n        }\n        static void operator delete(void *p, size_t) {\n            py::print(\"noisy delete\");\n            ::operator delete(p);\n        }\n        static void operator delete(void *, void *) { py::print(\"noisy placement delete\"); }\n    };\n\n    py::class_<NoisyAlloc> pyNoisyAlloc(m, \"NoisyAlloc\");\n    // Since these overloads have the same number of arguments, the dispatcher will try each of\n    // them until the arguments convert.  Thus we can get a pre-allocation here when passing a\n    // single non-integer:\n    ignoreOldStyleInitWarnings([&pyNoisyAlloc]() {\n        pyNoisyAlloc.def(\"__init__\", [](NoisyAlloc *a, int i) {\n            new (a) NoisyAlloc(i);\n        }); // Regular constructor, runs first, requires preallocation\n    });\n\n    pyNoisyAlloc.def(py::init([](double d) { return new NoisyAlloc(d); }));\n\n    // The two-argument version: first the factory pointer overload.\n    pyNoisyAlloc.def(py::init([](int i, int) { return new NoisyAlloc(i); }));\n    // Return-by-value:\n    pyNoisyAlloc.def(py::init([](double d, int) { return NoisyAlloc(d); }));\n    // Old-style placement new init; requires preallocation\n    ignoreOldStyleInitWarnings([&pyNoisyAlloc]() {\n        pyNoisyAlloc.def(\"__init__\",\n                         [](NoisyAlloc &a, double d, double) { new (&a) NoisyAlloc(d); });\n    });\n    // Requires deallocation of previous overload preallocated value:\n    pyNoisyAlloc.def(py::init([](int i, double) { return new NoisyAlloc(i); }));\n    // Regular again: requires yet another preallocation\n    ignoreOldStyleInitWarnings([&pyNoisyAlloc]() {\n        pyNoisyAlloc.def(\n            \"__init__\", [](NoisyAlloc &a, int i, const std::string &) { new (&a) NoisyAlloc(i); });\n    });\n\n    // static_assert testing (the following def's should all fail with appropriate compilation\n    // errors):\n#if 0\n    struct BadF1Base {};\n    struct BadF1 : BadF1Base {};\n    struct PyBadF1 : BadF1 {};\n    py::class_<BadF1, PyBadF1, std::shared_ptr<BadF1>> bf1(m, \"BadF1\");\n    // wrapped factory function must return a compatible pointer, holder, or value\n    bf1.def(py::init([]() { return 3; }));\n    // incompatible factory function pointer return type\n    bf1.def(py::init([]() { static int three = 3; return &three; }));\n    // incompatible factory function std::shared_ptr<T> return type: cannot convert shared_ptr<T> to holder\n    // (non-polymorphic base)\n    bf1.def(py::init([]() { return std::shared_ptr<BadF1Base>(new BadF1()); }));\n#endif\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_factory_constructors.py",
    "content": "import re\n\nimport pytest\n\nfrom pybind11_tests import ConstructorStats\nfrom pybind11_tests import factory_constructors as m\nfrom pybind11_tests.factory_constructors import tag\n\n\ndef test_init_factory_basic():\n    \"\"\"Tests py::init_factory() wrapper around various ways of returning the object\"\"\"\n\n    cstats = [\n        ConstructorStats.get(c)\n        for c in [m.TestFactory1, m.TestFactory2, m.TestFactory3]\n    ]\n    cstats[0].alive()  # force gc\n    n_inst = ConstructorStats.detail_reg_inst()\n\n    x1 = m.TestFactory1(tag.unique_ptr, 3)\n    assert x1.value == \"3\"\n    y1 = m.TestFactory1(tag.pointer)\n    assert y1.value == \"(empty)\"\n    z1 = m.TestFactory1(\"hi!\")\n    assert z1.value == \"hi!\"\n\n    assert ConstructorStats.detail_reg_inst() == n_inst + 3\n\n    x2 = m.TestFactory2(tag.move)\n    assert x2.value == \"(empty2)\"\n    y2 = m.TestFactory2(tag.pointer, 7)\n    assert y2.value == \"7\"\n    z2 = m.TestFactory2(tag.unique_ptr, \"hi again\")\n    assert z2.value == \"hi again\"\n\n    assert ConstructorStats.detail_reg_inst() == n_inst + 6\n\n    x3 = m.TestFactory3(tag.shared_ptr)\n    assert x3.value == \"(empty3)\"\n    y3 = m.TestFactory3(tag.pointer, 42)\n    assert y3.value == \"42\"\n    z3 = m.TestFactory3(\"bye\")\n    assert z3.value == \"bye\"\n\n    for null_ptr_kind in [tag.null_ptr, tag.null_unique_ptr, tag.null_shared_ptr]:\n        with pytest.raises(TypeError) as excinfo:\n            m.TestFactory3(null_ptr_kind)\n        assert (\n            str(excinfo.value) == \"pybind11::init(): factory function returned nullptr\"\n        )\n\n    assert [i.alive() for i in cstats] == [3, 3, 3]\n    assert ConstructorStats.detail_reg_inst() == n_inst + 9\n\n    del x1, y2, y3, z3\n    assert [i.alive() for i in cstats] == [2, 2, 1]\n    assert ConstructorStats.detail_reg_inst() == n_inst + 5\n    del x2, x3, y1, z1, z2\n    assert [i.alive() for i in cstats] == [0, 0, 0]\n    assert ConstructorStats.detail_reg_inst() == n_inst\n\n    assert [i.values() for i in cstats] == [\n        [\"3\", \"hi!\"],\n        [\"7\", \"hi again\"],\n        [\"42\", \"bye\"],\n    ]\n    assert [i.default_constructions for i in cstats] == [1, 1, 1]\n\n\ndef test_init_factory_signature(msg):\n    with pytest.raises(TypeError) as excinfo:\n        m.TestFactory1(\"invalid\", \"constructor\", \"arguments\")\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        __init__(): incompatible constructor arguments. The following argument types are supported:\n            1. m.factory_constructors.TestFactory1(arg0: m.factory_constructors.tag.unique_ptr_tag, arg1: int)\n            2. m.factory_constructors.TestFactory1(arg0: str)\n            3. m.factory_constructors.TestFactory1(arg0: m.factory_constructors.tag.pointer_tag)\n            4. m.factory_constructors.TestFactory1(arg0: handle, arg1: int, arg2: handle)\n\n        Invoked with: 'invalid', 'constructor', 'arguments'\n    \"\"\"\n    )\n\n    assert (\n        msg(m.TestFactory1.__init__.__doc__)\n        == \"\"\"\n        __init__(*args, **kwargs)\n        Overloaded function.\n\n        1. __init__(self: m.factory_constructors.TestFactory1, arg0: m.factory_constructors.tag.unique_ptr_tag, arg1: int) -> None\n\n        2. __init__(self: m.factory_constructors.TestFactory1, arg0: str) -> None\n\n        3. __init__(self: m.factory_constructors.TestFactory1, arg0: m.factory_constructors.tag.pointer_tag) -> None\n\n        4. __init__(self: m.factory_constructors.TestFactory1, arg0: handle, arg1: int, arg2: handle) -> None\n    \"\"\"  # noqa: E501 line too long\n    )\n\n\ndef test_init_factory_casting():\n    \"\"\"Tests py::init_factory() wrapper with various upcasting and downcasting returns\"\"\"\n\n    cstats = [\n        ConstructorStats.get(c)\n        for c in [m.TestFactory3, m.TestFactory4, m.TestFactory5]\n    ]\n    cstats[0].alive()  # force gc\n    n_inst = ConstructorStats.detail_reg_inst()\n\n    # Construction from derived references:\n    a = m.TestFactory3(tag.pointer, tag.TF4, 4)\n    assert a.value == \"4\"\n    b = m.TestFactory3(tag.shared_ptr, tag.TF4, 5)\n    assert b.value == \"5\"\n    c = m.TestFactory3(tag.pointer, tag.TF5, 6)\n    assert c.value == \"6\"\n    d = m.TestFactory3(tag.shared_ptr, tag.TF5, 7)\n    assert d.value == \"7\"\n\n    assert ConstructorStats.detail_reg_inst() == n_inst + 4\n\n    # Shared a lambda with TF3:\n    e = m.TestFactory4(tag.pointer, tag.TF4, 8)\n    assert e.value == \"8\"\n\n    assert ConstructorStats.detail_reg_inst() == n_inst + 5\n    assert [i.alive() for i in cstats] == [5, 3, 2]\n\n    del a\n    assert [i.alive() for i in cstats] == [4, 2, 2]\n    assert ConstructorStats.detail_reg_inst() == n_inst + 4\n\n    del b, c, e\n    assert [i.alive() for i in cstats] == [1, 0, 1]\n    assert ConstructorStats.detail_reg_inst() == n_inst + 1\n\n    del d\n    assert [i.alive() for i in cstats] == [0, 0, 0]\n    assert ConstructorStats.detail_reg_inst() == n_inst\n\n    assert [i.values() for i in cstats] == [\n        [\"4\", \"5\", \"6\", \"7\", \"8\"],\n        [\"4\", \"5\", \"8\"],\n        [\"6\", \"7\"],\n    ]\n\n\ndef test_init_factory_alias():\n    \"\"\"Tests py::init_factory() wrapper with value conversions and alias types\"\"\"\n\n    cstats = [m.TestFactory6.get_cstats(), m.TestFactory6.get_alias_cstats()]\n    cstats[0].alive()  # force gc\n    n_inst = ConstructorStats.detail_reg_inst()\n\n    a = m.TestFactory6(tag.base, 1)\n    assert a.get() == 1\n    assert not a.has_alias()\n    b = m.TestFactory6(tag.alias, \"hi there\")\n    assert b.get() == 8\n    assert b.has_alias()\n    c = m.TestFactory6(tag.alias, 3)\n    assert c.get() == 3\n    assert c.has_alias()\n    d = m.TestFactory6(tag.alias, tag.pointer, 4)\n    assert d.get() == 4\n    assert d.has_alias()\n    e = m.TestFactory6(tag.base, tag.pointer, 5)\n    assert e.get() == 5\n    assert not e.has_alias()\n    f = m.TestFactory6(tag.base, tag.alias, tag.pointer, 6)\n    assert f.get() == 6\n    assert f.has_alias()\n\n    assert ConstructorStats.detail_reg_inst() == n_inst + 6\n    assert [i.alive() for i in cstats] == [6, 4]\n\n    del a, b, e\n    assert [i.alive() for i in cstats] == [3, 3]\n    assert ConstructorStats.detail_reg_inst() == n_inst + 3\n    del f, c, d\n    assert [i.alive() for i in cstats] == [0, 0]\n    assert ConstructorStats.detail_reg_inst() == n_inst\n\n    class MyTest(m.TestFactory6):\n        def __init__(self, *args):\n            m.TestFactory6.__init__(self, *args)\n\n        def get(self):\n            return -5 + m.TestFactory6.get(self)\n\n    # Return Class by value, moved into new alias:\n    z = MyTest(tag.base, 123)\n    assert z.get() == 118\n    assert z.has_alias()\n\n    # Return alias by value, moved into new alias:\n    y = MyTest(tag.alias, \"why hello!\")\n    assert y.get() == 5\n    assert y.has_alias()\n\n    # Return Class by pointer, moved into new alias then original destroyed:\n    x = MyTest(tag.base, tag.pointer, 47)\n    assert x.get() == 42\n    assert x.has_alias()\n\n    assert ConstructorStats.detail_reg_inst() == n_inst + 3\n    assert [i.alive() for i in cstats] == [3, 3]\n    del x, y, z\n    assert [i.alive() for i in cstats] == [0, 0]\n    assert ConstructorStats.detail_reg_inst() == n_inst\n\n    assert [i.values() for i in cstats] == [\n        [\"1\", \"8\", \"3\", \"4\", \"5\", \"6\", \"123\", \"10\", \"47\"],\n        [\"hi there\", \"3\", \"4\", \"6\", \"move\", \"123\", \"why hello!\", \"move\", \"47\"],\n    ]\n\n\ndef test_init_factory_dual():\n    \"\"\"Tests init factory functions with dual main/alias factory functions\"\"\"\n    from pybind11_tests.factory_constructors import TestFactory7\n\n    cstats = [TestFactory7.get_cstats(), TestFactory7.get_alias_cstats()]\n    cstats[0].alive()  # force gc\n    n_inst = ConstructorStats.detail_reg_inst()\n\n    class PythFactory7(TestFactory7):\n        def get(self):\n            return 100 + TestFactory7.get(self)\n\n    a1 = TestFactory7(1)\n    a2 = PythFactory7(2)\n    assert a1.get() == 1\n    assert a2.get() == 102\n    assert not a1.has_alias()\n    assert a2.has_alias()\n\n    b1 = TestFactory7(tag.pointer, 3)\n    b2 = PythFactory7(tag.pointer, 4)\n    assert b1.get() == 3\n    assert b2.get() == 104\n    assert not b1.has_alias()\n    assert b2.has_alias()\n\n    c1 = TestFactory7(tag.mixed, 5)\n    c2 = PythFactory7(tag.mixed, 6)\n    assert c1.get() == 5\n    assert c2.get() == 106\n    assert not c1.has_alias()\n    assert c2.has_alias()\n\n    d1 = TestFactory7(tag.base, tag.pointer, 7)\n    d2 = PythFactory7(tag.base, tag.pointer, 8)\n    assert d1.get() == 7\n    assert d2.get() == 108\n    assert not d1.has_alias()\n    assert d2.has_alias()\n\n    # Both return an alias; the second multiplies the value by 10:\n    e1 = TestFactory7(tag.alias, tag.pointer, 9)\n    e2 = PythFactory7(tag.alias, tag.pointer, 10)\n    assert e1.get() == 9\n    assert e2.get() == 200\n    assert e1.has_alias()\n    assert e2.has_alias()\n\n    f1 = TestFactory7(tag.shared_ptr, tag.base, 11)\n    f2 = PythFactory7(tag.shared_ptr, tag.base, 12)\n    assert f1.get() == 11\n    assert f2.get() == 112\n    assert not f1.has_alias()\n    assert f2.has_alias()\n\n    g1 = TestFactory7(tag.shared_ptr, tag.invalid_base, 13)\n    assert g1.get() == 13\n    assert not g1.has_alias()\n    with pytest.raises(TypeError) as excinfo:\n        PythFactory7(tag.shared_ptr, tag.invalid_base, 14)\n    assert (\n        str(excinfo.value)\n        == \"pybind11::init(): construction failed: returned holder-wrapped instance is not an \"\n        \"alias instance\"\n    )\n\n    assert [i.alive() for i in cstats] == [13, 7]\n    assert ConstructorStats.detail_reg_inst() == n_inst + 13\n\n    del a1, a2, b1, d1, e1, e2\n    assert [i.alive() for i in cstats] == [7, 4]\n    assert ConstructorStats.detail_reg_inst() == n_inst + 7\n    del b2, c1, c2, d2, f1, f2, g1\n    assert [i.alive() for i in cstats] == [0, 0]\n    assert ConstructorStats.detail_reg_inst() == n_inst\n\n    assert [i.values() for i in cstats] == [\n        [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"100\", \"11\", \"12\", \"13\", \"14\"],\n        [\"2\", \"4\", \"6\", \"8\", \"9\", \"100\", \"12\"],\n    ]\n\n\ndef test_no_placement_new(capture):\n    \"\"\"Prior to 2.2, `py::init<...>` relied on the type supporting placement\n    new; this tests a class without placement new support.\"\"\"\n    with capture:\n        a = m.NoPlacementNew(123)\n\n    found = re.search(r\"^operator new called, returning (\\d+)\\n$\", str(capture))\n    assert found\n    assert a.i == 123\n    with capture:\n        del a\n        pytest.gc_collect()\n    assert capture == \"operator delete called on \" + found.group(1)\n\n    with capture:\n        b = m.NoPlacementNew()\n\n    found = re.search(r\"^operator new called, returning (\\d+)\\n$\", str(capture))\n    assert found\n    assert b.i == 100\n    with capture:\n        del b\n        pytest.gc_collect()\n    assert capture == \"operator delete called on \" + found.group(1)\n\n\ndef test_multiple_inheritance():\n    class MITest(m.TestFactory1, m.TestFactory2):\n        def __init__(self):\n            m.TestFactory1.__init__(self, tag.unique_ptr, 33)\n            m.TestFactory2.__init__(self, tag.move)\n\n    a = MITest()\n    assert m.TestFactory1.value.fget(a) == \"33\"\n    assert m.TestFactory2.value.fget(a) == \"(empty2)\"\n\n\ndef create_and_destroy(*args):\n    a = m.NoisyAlloc(*args)\n    print(\"---\")\n    del a\n    pytest.gc_collect()\n\n\ndef strip_comments(s):\n    return re.sub(r\"\\s+#.*\", \"\", s)\n\n\ndef test_reallocation_a(capture, msg):\n    \"\"\"When the constructor is overloaded, previous overloads can require a preallocated value.\n    This test makes sure that such preallocated values only happen when they might be necessary,\n    and that they are deallocated properly.\"\"\"\n\n    pytest.gc_collect()\n\n    with capture:\n        create_and_destroy(1)\n    assert (\n        msg(capture)\n        == \"\"\"\n        noisy new\n        noisy placement new\n        NoisyAlloc(int 1)\n        ---\n        ~NoisyAlloc()\n        noisy delete\n    \"\"\"\n    )\n\n\ndef test_reallocation_b(capture, msg):\n    with capture:\n        create_and_destroy(1.5)\n    assert msg(capture) == strip_comments(\n        \"\"\"\n        noisy new               # allocation required to attempt first overload\n        noisy delete            # have to dealloc before considering factory init overload\n        noisy new               # pointer factory calling \"new\", part 1: allocation\n        NoisyAlloc(double 1.5)  # ... part two, invoking constructor\n        ---\n        ~NoisyAlloc()  # Destructor\n        noisy delete   # operator delete\n    \"\"\"\n    )\n\n\ndef test_reallocation_c(capture, msg):\n    with capture:\n        create_and_destroy(2, 3)\n    assert msg(capture) == strip_comments(\n        \"\"\"\n        noisy new          # pointer factory calling \"new\", allocation\n        NoisyAlloc(int 2)  # constructor\n        ---\n        ~NoisyAlloc()  # Destructor\n        noisy delete   # operator delete\n    \"\"\"\n    )\n\n\ndef test_reallocation_d(capture, msg):\n    with capture:\n        create_and_destroy(2.5, 3)\n    assert msg(capture) == strip_comments(\n        \"\"\"\n        NoisyAlloc(double 2.5)  # construction (local func variable: operator_new not called)\n        noisy new               # return-by-value \"new\" part 1: allocation\n        ~NoisyAlloc()           # moved-away local func variable destruction\n        ---\n        ~NoisyAlloc()  # Destructor\n        noisy delete   # operator delete\n    \"\"\"\n    )\n\n\ndef test_reallocation_e(capture, msg):\n    with capture:\n        create_and_destroy(3.5, 4.5)\n    assert msg(capture) == strip_comments(\n        \"\"\"\n        noisy new               # preallocation needed before invoking placement-new overload\n        noisy placement new     # Placement new\n        NoisyAlloc(double 3.5)  # construction\n        ---\n        ~NoisyAlloc()  # Destructor\n        noisy delete   # operator delete\n    \"\"\"\n    )\n\n\ndef test_reallocation_f(capture, msg):\n    with capture:\n        create_and_destroy(4, 0.5)\n    assert msg(capture) == strip_comments(\n        \"\"\"\n        noisy new          # preallocation needed before invoking placement-new overload\n        noisy delete       # deallocation of preallocated storage\n        noisy new          # Factory pointer allocation\n        NoisyAlloc(int 4)  # factory pointer construction\n        ---\n        ~NoisyAlloc()  # Destructor\n        noisy delete   # operator delete\n    \"\"\"\n    )\n\n\ndef test_reallocation_g(capture, msg):\n    with capture:\n        create_and_destroy(5, \"hi\")\n    assert msg(capture) == strip_comments(\n        \"\"\"\n        noisy new            # preallocation needed before invoking first placement new\n        noisy delete         # delete before considering new-style constructor\n        noisy new            # preallocation for second placement new\n        noisy placement new  # Placement new in the second placement new overload\n        NoisyAlloc(int 5)    # construction\n        ---\n        ~NoisyAlloc()  # Destructor\n        noisy delete   # operator delete\n    \"\"\"\n    )\n\n\ndef test_invalid_self():\n    \"\"\"Tests invocation of the pybind-registered base class with an invalid `self` argument.\"\"\"\n\n    class NotPybindDerived:\n        pass\n\n    # Attempts to initialize with an invalid type passed as `self`:\n    class BrokenTF1(m.TestFactory1):\n        def __init__(self, bad):\n            if bad == 1:\n                a = m.TestFactory2(tag.pointer, 1)\n                m.TestFactory1.__init__(a, tag.pointer)\n            elif bad == 2:\n                a = NotPybindDerived()\n                m.TestFactory1.__init__(a, tag.pointer)\n\n    # Same as above, but for a class with an alias:\n    class BrokenTF6(m.TestFactory6):\n        def __init__(self, bad):\n            if bad == 0:\n                m.TestFactory6.__init__()\n            elif bad == 1:\n                a = m.TestFactory2(tag.pointer, 1)\n                m.TestFactory6.__init__(a, tag.base, 1)\n            elif bad == 2:\n                a = m.TestFactory2(tag.pointer, 1)\n                m.TestFactory6.__init__(a, tag.alias, 1)\n            elif bad == 3:\n                m.TestFactory6.__init__(\n                    NotPybindDerived.__new__(NotPybindDerived), tag.base, 1\n                )\n            elif bad == 4:\n                m.TestFactory6.__init__(\n                    NotPybindDerived.__new__(NotPybindDerived), tag.alias, 1\n                )\n\n    for arg in (1, 2):\n        with pytest.raises(TypeError) as excinfo:\n            BrokenTF1(arg)\n        assert (\n            str(excinfo.value)\n            == \"__init__(self, ...) called with invalid or missing `self` argument\"\n        )\n\n    for arg in (0, 1, 2, 3, 4):\n        with pytest.raises(TypeError) as excinfo:\n            BrokenTF6(arg)\n        assert (\n            str(excinfo.value)\n            == \"__init__(self, ...) called with invalid or missing `self` argument\"\n        )\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_gil_scoped.cpp",
    "content": "/*\n    tests/test_gil_scoped.cpp -- acquire and release gil\n\n    Copyright (c) 2017 Borja Zarco (Google LLC) <bzarco@google.com>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/functional.h>\n\n#include \"pybind11_tests.h\"\n\n#include <string>\n#include <thread>\n\n#define CROSS_MODULE(Function)                                                                    \\\n    auto cm = py::module_::import(\"cross_module_gil_utils\");                                      \\\n    auto target = reinterpret_cast<void (*)()>(PyLong_AsVoidPtr(cm.attr(Function).ptr()));\n\nclass VirtClass {\npublic:\n    virtual ~VirtClass() = default;\n    VirtClass() = default;\n    VirtClass(const VirtClass &) = delete;\n    virtual void virtual_func() {}\n    virtual void pure_virtual_func() = 0;\n};\n\nclass PyVirtClass : public VirtClass {\n    void virtual_func() override { PYBIND11_OVERRIDE(void, VirtClass, virtual_func, ); }\n    void pure_virtual_func() override {\n        PYBIND11_OVERRIDE_PURE(void, VirtClass, pure_virtual_func, );\n    }\n};\n\nTEST_SUBMODULE(gil_scoped, m) {\n    m.attr(\"defined_THREAD_SANITIZER\") =\n#if defined(THREAD_SANITIZER)\n        true;\n#else\n        false;\n#endif\n\n    m.def(\"intentional_deadlock\",\n          []() { std::thread([]() { py::gil_scoped_acquire gil_acquired; }).join(); });\n\n    py::class_<VirtClass, PyVirtClass>(m, \"VirtClass\")\n        .def(py::init<>())\n        .def(\"virtual_func\", &VirtClass::virtual_func)\n        .def(\"pure_virtual_func\", &VirtClass::pure_virtual_func);\n\n    m.def(\"test_callback_py_obj\", [](py::object &func) { func(); });\n    m.def(\"test_callback_std_func\", [](const std::function<void()> &func) { func(); });\n    m.def(\"test_callback_virtual_func\", [](VirtClass &virt) { virt.virtual_func(); });\n    m.def(\"test_callback_pure_virtual_func\", [](VirtClass &virt) { virt.pure_virtual_func(); });\n    m.def(\"test_cross_module_gil_released\", []() {\n        CROSS_MODULE(\"gil_acquire_funcaddr\")\n        py::gil_scoped_release gil_release;\n        target();\n    });\n    m.def(\"test_cross_module_gil_acquired\", []() {\n        CROSS_MODULE(\"gil_acquire_funcaddr\")\n        py::gil_scoped_acquire gil_acquire;\n        target();\n    });\n    m.def(\"test_cross_module_gil_inner_custom_released\", []() {\n        CROSS_MODULE(\"gil_acquire_inner_custom_funcaddr\")\n        py::gil_scoped_release gil_release;\n        target();\n    });\n    m.def(\"test_cross_module_gil_inner_custom_acquired\", []() {\n        CROSS_MODULE(\"gil_acquire_inner_custom_funcaddr\")\n        py::gil_scoped_acquire gil_acquire;\n        target();\n    });\n    m.def(\"test_cross_module_gil_inner_pybind11_released\", []() {\n        CROSS_MODULE(\"gil_acquire_inner_pybind11_funcaddr\")\n        py::gil_scoped_release gil_release;\n        target();\n    });\n    m.def(\"test_cross_module_gil_inner_pybind11_acquired\", []() {\n        CROSS_MODULE(\"gil_acquire_inner_pybind11_funcaddr\")\n        py::gil_scoped_acquire gil_acquire;\n        target();\n    });\n    m.def(\"test_cross_module_gil_nested_custom_released\", []() {\n        CROSS_MODULE(\"gil_acquire_nested_custom_funcaddr\")\n        py::gil_scoped_release gil_release;\n        target();\n    });\n    m.def(\"test_cross_module_gil_nested_custom_acquired\", []() {\n        CROSS_MODULE(\"gil_acquire_nested_custom_funcaddr\")\n        py::gil_scoped_acquire gil_acquire;\n        target();\n    });\n    m.def(\"test_cross_module_gil_nested_pybind11_released\", []() {\n        CROSS_MODULE(\"gil_acquire_nested_pybind11_funcaddr\")\n        py::gil_scoped_release gil_release;\n        target();\n    });\n    m.def(\"test_cross_module_gil_nested_pybind11_acquired\", []() {\n        CROSS_MODULE(\"gil_acquire_nested_pybind11_funcaddr\")\n        py::gil_scoped_acquire gil_acquire;\n        target();\n    });\n    m.def(\"test_release_acquire\", [](const py::object &obj) {\n        py::gil_scoped_release gil_released;\n        py::gil_scoped_acquire gil_acquired;\n        return py::str(obj);\n    });\n    m.def(\"test_nested_acquire\", [](const py::object &obj) {\n        py::gil_scoped_release gil_released;\n        py::gil_scoped_acquire gil_acquired_outer;\n        py::gil_scoped_acquire gil_acquired_inner;\n        return py::str(obj);\n    });\n    m.def(\"test_multi_acquire_release_cross_module\", [](unsigned bits) {\n        py::set internals_ids;\n        internals_ids.add(PYBIND11_INTERNALS_ID);\n        {\n            py::gil_scoped_release gil_released;\n            auto thread_f = [bits, &internals_ids]() {\n                py::gil_scoped_acquire gil_acquired;\n                auto cm = py::module_::import(\"cross_module_gil_utils\");\n                auto target = reinterpret_cast<std::string (*)(unsigned)>(\n                    PyLong_AsVoidPtr(cm.attr(\"gil_multi_acquire_release_funcaddr\").ptr()));\n                std::string cm_internals_id = target(bits >> 3);\n                internals_ids.add(cm_internals_id);\n            };\n            if ((bits & 0x1u) != 0u) {\n                thread_f();\n            }\n            if ((bits & 0x2u) != 0u) {\n                std::thread non_python_thread(thread_f);\n                non_python_thread.join();\n            }\n            if ((bits & 0x4u) != 0u) {\n                thread_f();\n            }\n        }\n        return internals_ids;\n    });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_gil_scoped.py",
    "content": "import multiprocessing\nimport sys\nimport threading\nimport time\n\nimport pytest\n\nimport env\nfrom pybind11_tests import gil_scoped as m\n\n\nclass ExtendedVirtClass(m.VirtClass):\n    def virtual_func(self):\n        pass\n\n    def pure_virtual_func(self):\n        pass\n\n\ndef test_callback_py_obj():\n    m.test_callback_py_obj(lambda: None)\n\n\ndef test_callback_std_func():\n    m.test_callback_std_func(lambda: None)\n\n\ndef test_callback_virtual_func():\n    extended = ExtendedVirtClass()\n    m.test_callback_virtual_func(extended)\n\n\ndef test_callback_pure_virtual_func():\n    extended = ExtendedVirtClass()\n    m.test_callback_pure_virtual_func(extended)\n\n\ndef test_cross_module_gil_released():\n    \"\"\"Makes sure that the GIL can be acquired by another module from a GIL-released state.\"\"\"\n    m.test_cross_module_gil_released()  # Should not raise a SIGSEGV\n\n\ndef test_cross_module_gil_acquired():\n    \"\"\"Makes sure that the GIL can be acquired by another module from a GIL-acquired state.\"\"\"\n    m.test_cross_module_gil_acquired()  # Should not raise a SIGSEGV\n\n\ndef test_cross_module_gil_inner_custom_released():\n    \"\"\"Makes sure that the GIL can be acquired/released by another module\n    from a GIL-released state using custom locking logic.\"\"\"\n    m.test_cross_module_gil_inner_custom_released()\n\n\ndef test_cross_module_gil_inner_custom_acquired():\n    \"\"\"Makes sure that the GIL can be acquired/acquired by another module\n    from a GIL-acquired state using custom locking logic.\"\"\"\n    m.test_cross_module_gil_inner_custom_acquired()\n\n\ndef test_cross_module_gil_inner_pybind11_released():\n    \"\"\"Makes sure that the GIL can be acquired/released by another module\n    from a GIL-released state using pybind11 locking logic.\"\"\"\n    m.test_cross_module_gil_inner_pybind11_released()\n\n\ndef test_cross_module_gil_inner_pybind11_acquired():\n    \"\"\"Makes sure that the GIL can be acquired/acquired by another module\n    from a GIL-acquired state using pybind11 locking logic.\"\"\"\n    m.test_cross_module_gil_inner_pybind11_acquired()\n\n\ndef test_cross_module_gil_nested_custom_released():\n    \"\"\"Makes sure that the GIL can be nested acquired/released by another module\n    from a GIL-released state using custom locking logic.\"\"\"\n    m.test_cross_module_gil_nested_custom_released()\n\n\ndef test_cross_module_gil_nested_custom_acquired():\n    \"\"\"Makes sure that the GIL can be nested acquired/acquired by another module\n    from a GIL-acquired state using custom locking logic.\"\"\"\n    m.test_cross_module_gil_nested_custom_acquired()\n\n\ndef test_cross_module_gil_nested_pybind11_released():\n    \"\"\"Makes sure that the GIL can be nested acquired/released by another module\n    from a GIL-released state using pybind11 locking logic.\"\"\"\n    m.test_cross_module_gil_nested_pybind11_released()\n\n\ndef test_cross_module_gil_nested_pybind11_acquired():\n    \"\"\"Makes sure that the GIL can be nested acquired/acquired by another module\n    from a GIL-acquired state using pybind11 locking logic.\"\"\"\n    m.test_cross_module_gil_nested_pybind11_acquired()\n\n\ndef test_release_acquire():\n    assert m.test_release_acquire(0xAB) == \"171\"\n\n\ndef test_nested_acquire():\n    assert m.test_nested_acquire(0xAB) == \"171\"\n\n\ndef test_multi_acquire_release_cross_module():\n    for bits in range(16 * 8):\n        internals_ids = m.test_multi_acquire_release_cross_module(bits)\n        assert len(internals_ids) == 2 if bits % 8 else 1\n\n\n# Intentionally putting human review in the loop here, to guard against accidents.\nVARS_BEFORE_ALL_BASIC_TESTS = dict(vars())  # Make a copy of the dict (critical).\nALL_BASIC_TESTS = (\n    test_callback_py_obj,\n    test_callback_std_func,\n    test_callback_virtual_func,\n    test_callback_pure_virtual_func,\n    test_cross_module_gil_released,\n    test_cross_module_gil_acquired,\n    test_cross_module_gil_inner_custom_released,\n    test_cross_module_gil_inner_custom_acquired,\n    test_cross_module_gil_inner_pybind11_released,\n    test_cross_module_gil_inner_pybind11_acquired,\n    test_cross_module_gil_nested_custom_released,\n    test_cross_module_gil_nested_custom_acquired,\n    test_cross_module_gil_nested_pybind11_released,\n    test_cross_module_gil_nested_pybind11_acquired,\n    test_release_acquire,\n    test_nested_acquire,\n    test_multi_acquire_release_cross_module,\n)\n\n\ndef test_all_basic_tests_completeness():\n    num_found = 0\n    for key, value in VARS_BEFORE_ALL_BASIC_TESTS.items():\n        if not key.startswith(\"test_\"):\n            continue\n        assert value in ALL_BASIC_TESTS\n        num_found += 1\n    assert len(ALL_BASIC_TESTS) == num_found\n\n\ndef _intentional_deadlock():\n    m.intentional_deadlock()\n\n\nALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK = ALL_BASIC_TESTS + (_intentional_deadlock,)\n\n\ndef _run_in_process(target, *args, **kwargs):\n    if len(args) == 0:\n        test_fn = target\n    else:\n        test_fn = args[0]\n    # Do not need to wait much, 10s should be more than enough.\n    timeout = 0.1 if test_fn is _intentional_deadlock else 10\n    process = multiprocessing.Process(target=target, args=args, kwargs=kwargs)\n    process.daemon = True\n    try:\n        t_start = time.time()\n        process.start()\n        if timeout >= 100:  # For debugging.\n            print(\n                \"\\nprocess.pid STARTED\", process.pid, (sys.argv, target, args, kwargs)\n            )\n            print(f\"COPY-PASTE-THIS: gdb {sys.argv[0]} -p {process.pid}\", flush=True)\n        process.join(timeout=timeout)\n        if timeout >= 100:\n            print(\"\\nprocess.pid JOINED\", process.pid, flush=True)\n        t_delta = time.time() - t_start\n        if process.exitcode == 66 and m.defined_THREAD_SANITIZER:  # Issue #2754\n            # WOULD-BE-NICE-TO-HAVE: Check that the message below is actually in the output.\n            # Maybe this could work:\n            # https://gist.github.com/alexeygrigorev/01ce847f2e721b513b42ea4a6c96905e\n            pytest.skip(\n                \"ThreadSanitizer: starting new threads after multi-threaded fork is not supported.\"\n            )\n        elif test_fn is _intentional_deadlock:\n            assert process.exitcode is None\n            return 0\n        elif process.exitcode is None:\n            assert t_delta > 0.9 * timeout\n            msg = \"DEADLOCK, most likely, exactly what this test is meant to detect.\"\n            if env.PYPY and env.WIN:\n                pytest.skip(msg)\n            raise RuntimeError(msg)\n        return process.exitcode\n    finally:\n        if process.is_alive():\n            process.terminate()\n\n\ndef _run_in_threads(test_fn, num_threads, parallel):\n    threads = []\n    for _ in range(num_threads):\n        thread = threading.Thread(target=test_fn)\n        thread.daemon = True\n        thread.start()\n        if parallel:\n            threads.append(thread)\n        else:\n            thread.join()\n    for thread in threads:\n        thread.join()\n\n\n# TODO: FIXME, sometimes returns -11 (segfault) instead of 0 on macOS Python 3.9\n@pytest.mark.parametrize(\"test_fn\", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)\ndef test_run_in_process_one_thread(test_fn):\n    \"\"\"Makes sure there is no GIL deadlock when running in a thread.\n\n    It runs in a separate process to be able to stop and assert if it deadlocks.\n    \"\"\"\n    assert _run_in_process(_run_in_threads, test_fn, num_threads=1, parallel=False) == 0\n\n\n# TODO: FIXME on macOS Python 3.9\n@pytest.mark.parametrize(\"test_fn\", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)\ndef test_run_in_process_multiple_threads_parallel(test_fn):\n    \"\"\"Makes sure there is no GIL deadlock when running in a thread multiple times in parallel.\n\n    It runs in a separate process to be able to stop and assert if it deadlocks.\n    \"\"\"\n    assert _run_in_process(_run_in_threads, test_fn, num_threads=8, parallel=True) == 0\n\n\n# TODO: FIXME on macOS Python 3.9\n@pytest.mark.parametrize(\"test_fn\", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)\ndef test_run_in_process_multiple_threads_sequential(test_fn):\n    \"\"\"Makes sure there is no GIL deadlock when running in a thread multiple times sequentially.\n\n    It runs in a separate process to be able to stop and assert if it deadlocks.\n    \"\"\"\n    assert _run_in_process(_run_in_threads, test_fn, num_threads=8, parallel=False) == 0\n\n\n# TODO: FIXME on macOS Python 3.9\n@pytest.mark.parametrize(\"test_fn\", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)\ndef test_run_in_process_direct(test_fn):\n    \"\"\"Makes sure there is no GIL deadlock when using processes.\n\n    This test is for completion, but it was never an issue.\n    \"\"\"\n    assert _run_in_process(test_fn) == 0\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_iostream.cpp",
    "content": "/*\n    tests/test_iostream.cpp -- Usage of scoped_output_redirect\n\n    Copyright (c) 2017 Henry F. Schreiner\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/iostream.h>\n\n#include \"pybind11_tests.h\"\n\n#include <atomic>\n#include <iostream>\n#include <mutex>\n#include <string>\n#include <thread>\n\nvoid noisy_function(const std::string &msg, bool flush) {\n\n    std::cout << msg;\n    if (flush) {\n        std::cout << std::flush;\n    }\n}\n\nvoid noisy_funct_dual(const std::string &msg, const std::string &emsg) {\n    std::cout << msg;\n    std::cerr << emsg;\n}\n\n// object to manage C++ thread\n// simply repeatedly write to std::cerr until stopped\n// redirect is called at some point to test the safety of scoped_estream_redirect\nstruct TestThread {\n    TestThread() : stop_{false} {\n        auto thread_f = [this] {\n            static std::mutex cout_mutex;\n            while (!stop_) {\n                {\n                    // #HelpAppreciated: Work on iostream.h thread safety.\n                    // Without this lock, the clang ThreadSanitizer (tsan) reliably reports a\n                    // data race, and this test is predictably flakey on Windows.\n                    // For more background see the discussion under\n                    // https://github.com/pybind/pybind11/pull/2982 and\n                    // https://github.com/pybind/pybind11/pull/2995.\n                    const std::lock_guard<std::mutex> lock(cout_mutex);\n                    std::cout << \"x\" << std::flush;\n                }\n                std::this_thread::sleep_for(std::chrono::microseconds(50));\n            }\n        };\n        t_ = new std::thread(std::move(thread_f));\n    }\n\n    ~TestThread() { delete t_; }\n\n    void stop() { stop_ = true; }\n\n    void join() const {\n        py::gil_scoped_release gil_lock;\n        t_->join();\n    }\n\n    void sleep() {\n        py::gil_scoped_release gil_lock;\n        std::this_thread::sleep_for(std::chrono::milliseconds(50));\n    }\n\n    std::thread *t_{nullptr};\n    std::atomic<bool> stop_;\n};\n\nTEST_SUBMODULE(iostream, m) {\n\n    add_ostream_redirect(m);\n\n    // test_evals\n\n    m.def(\"captured_output_default\", [](const std::string &msg) {\n        py::scoped_ostream_redirect redir;\n        std::cout << msg << std::flush;\n    });\n\n    m.def(\"captured_output\", [](const std::string &msg) {\n        py::scoped_ostream_redirect redir(std::cout, py::module_::import(\"sys\").attr(\"stdout\"));\n        std::cout << msg << std::flush;\n    });\n\n    m.def(\"guard_output\",\n          &noisy_function,\n          py::call_guard<py::scoped_ostream_redirect>(),\n          py::arg(\"msg\"),\n          py::arg(\"flush\") = true);\n\n    m.def(\"captured_err\", [](const std::string &msg) {\n        py::scoped_ostream_redirect redir(std::cerr, py::module_::import(\"sys\").attr(\"stderr\"));\n        std::cerr << msg << std::flush;\n    });\n\n    m.def(\"noisy_function\", &noisy_function, py::arg(\"msg\"), py::arg(\"flush\") = true);\n\n    m.def(\"dual_guard\",\n          &noisy_funct_dual,\n          py::call_guard<py::scoped_ostream_redirect, py::scoped_estream_redirect>(),\n          py::arg(\"msg\"),\n          py::arg(\"emsg\"));\n\n    m.def(\"raw_output\", [](const std::string &msg) { std::cout << msg << std::flush; });\n\n    m.def(\"raw_err\", [](const std::string &msg) { std::cerr << msg << std::flush; });\n\n    m.def(\"captured_dual\", [](const std::string &msg, const std::string &emsg) {\n        py::scoped_ostream_redirect redirout(std::cout, py::module_::import(\"sys\").attr(\"stdout\"));\n        py::scoped_ostream_redirect redirerr(std::cerr, py::module_::import(\"sys\").attr(\"stderr\"));\n        std::cout << msg << std::flush;\n        std::cerr << emsg << std::flush;\n    });\n\n    py::class_<TestThread>(m, \"TestThread\")\n        .def(py::init<>())\n        .def(\"stop\", &TestThread::stop)\n        .def(\"join\", &TestThread::join)\n        .def(\"sleep\", &TestThread::sleep);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_iostream.py",
    "content": "from contextlib import redirect_stderr, redirect_stdout\nfrom io import StringIO\n\nfrom pybind11_tests import iostream as m\n\n\ndef test_captured(capsys):\n    msg = \"I've been redirected to Python, I hope!\"\n    m.captured_output(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n    m.captured_err(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == \"\"\n    assert stderr == msg\n\n\ndef test_captured_large_string(capsys):\n    # Make this bigger than the buffer used on the C++ side: 1024 chars\n    msg = \"I've been redirected to Python, I hope!\"\n    msg = msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_captured_utf8_2byte_offset0(capsys):\n    msg = \"\\u07FF\"\n    msg = \"\" + msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_captured_utf8_2byte_offset1(capsys):\n    msg = \"\\u07FF\"\n    msg = \"1\" + msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_captured_utf8_3byte_offset0(capsys):\n    msg = \"\\uFFFF\"\n    msg = \"\" + msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_captured_utf8_3byte_offset1(capsys):\n    msg = \"\\uFFFF\"\n    msg = \"1\" + msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_captured_utf8_3byte_offset2(capsys):\n    msg = \"\\uFFFF\"\n    msg = \"12\" + msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_captured_utf8_4byte_offset0(capsys):\n    msg = \"\\U0010FFFF\"\n    msg = \"\" + msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_captured_utf8_4byte_offset1(capsys):\n    msg = \"\\U0010FFFF\"\n    msg = \"1\" + msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_captured_utf8_4byte_offset2(capsys):\n    msg = \"\\U0010FFFF\"\n    msg = \"12\" + msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_captured_utf8_4byte_offset3(capsys):\n    msg = \"\\U0010FFFF\"\n    msg = \"123\" + msg * (1024 // len(msg) + 1)\n\n    m.captured_output_default(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_guard_capture(capsys):\n    msg = \"I've been redirected to Python, I hope!\"\n    m.guard_output(msg)\n    stdout, stderr = capsys.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n\n\ndef test_series_captured(capture):\n    with capture:\n        m.captured_output(\"a\")\n        m.captured_output(\"b\")\n    assert capture == \"ab\"\n\n\ndef test_flush(capfd):\n    msg = \"(not flushed)\"\n    msg2 = \"(flushed)\"\n\n    with m.ostream_redirect():\n        m.noisy_function(msg, flush=False)\n        stdout, stderr = capfd.readouterr()\n        assert stdout == \"\"\n\n        m.noisy_function(msg2, flush=True)\n        stdout, stderr = capfd.readouterr()\n        assert stdout == msg + msg2\n\n        m.noisy_function(msg, flush=False)\n\n    stdout, stderr = capfd.readouterr()\n    assert stdout == msg\n\n\ndef test_not_captured(capfd):\n    msg = \"Something that should not show up in log\"\n    stream = StringIO()\n    with redirect_stdout(stream):\n        m.raw_output(msg)\n    stdout, stderr = capfd.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n    assert stream.getvalue() == \"\"\n\n    stream = StringIO()\n    with redirect_stdout(stream):\n        m.captured_output(msg)\n    stdout, stderr = capfd.readouterr()\n    assert stdout == \"\"\n    assert stderr == \"\"\n    assert stream.getvalue() == msg\n\n\ndef test_err(capfd):\n    msg = \"Something that should not show up in log\"\n    stream = StringIO()\n    with redirect_stderr(stream):\n        m.raw_err(msg)\n    stdout, stderr = capfd.readouterr()\n    assert stdout == \"\"\n    assert stderr == msg\n    assert stream.getvalue() == \"\"\n\n    stream = StringIO()\n    with redirect_stderr(stream):\n        m.captured_err(msg)\n    stdout, stderr = capfd.readouterr()\n    assert stdout == \"\"\n    assert stderr == \"\"\n    assert stream.getvalue() == msg\n\n\ndef test_multi_captured(capfd):\n    stream = StringIO()\n    with redirect_stdout(stream):\n        m.captured_output(\"a\")\n        m.raw_output(\"b\")\n        m.captured_output(\"c\")\n        m.raw_output(\"d\")\n    stdout, stderr = capfd.readouterr()\n    assert stdout == \"bd\"\n    assert stream.getvalue() == \"ac\"\n\n\ndef test_dual(capsys):\n    m.captured_dual(\"a\", \"b\")\n    stdout, stderr = capsys.readouterr()\n    assert stdout == \"a\"\n    assert stderr == \"b\"\n\n\ndef test_redirect(capfd):\n    msg = \"Should not be in log!\"\n    stream = StringIO()\n    with redirect_stdout(stream):\n        m.raw_output(msg)\n    stdout, stderr = capfd.readouterr()\n    assert stdout == msg\n    assert stream.getvalue() == \"\"\n\n    stream = StringIO()\n    with redirect_stdout(stream):\n        with m.ostream_redirect():\n            m.raw_output(msg)\n    stdout, stderr = capfd.readouterr()\n    assert stdout == \"\"\n    assert stream.getvalue() == msg\n\n    stream = StringIO()\n    with redirect_stdout(stream):\n        m.raw_output(msg)\n    stdout, stderr = capfd.readouterr()\n    assert stdout == msg\n    assert stream.getvalue() == \"\"\n\n\ndef test_redirect_err(capfd):\n    msg = \"StdOut\"\n    msg2 = \"StdErr\"\n\n    stream = StringIO()\n    with redirect_stderr(stream):\n        with m.ostream_redirect(stdout=False):\n            m.raw_output(msg)\n            m.raw_err(msg2)\n    stdout, stderr = capfd.readouterr()\n    assert stdout == msg\n    assert stderr == \"\"\n    assert stream.getvalue() == msg2\n\n\ndef test_redirect_both(capfd):\n    msg = \"StdOut\"\n    msg2 = \"StdErr\"\n\n    stream = StringIO()\n    stream2 = StringIO()\n    with redirect_stdout(stream):\n        with redirect_stderr(stream2):\n            with m.ostream_redirect():\n                m.raw_output(msg)\n                m.raw_err(msg2)\n    stdout, stderr = capfd.readouterr()\n    assert stdout == \"\"\n    assert stderr == \"\"\n    assert stream.getvalue() == msg\n    assert stream2.getvalue() == msg2\n\n\ndef test_threading():\n    with m.ostream_redirect(stdout=True, stderr=False):\n        # start some threads\n        threads = []\n\n        # start some threads\n        for _j in range(20):\n            threads.append(m.TestThread())\n\n        # give the threads some time to fail\n        threads[0].sleep()\n\n        # stop all the threads\n        for t in threads:\n            t.stop()\n\n        for t in threads:\n            t.join()\n\n        # if a thread segfaults, we don't get here\n        assert True\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_kwargs_and_defaults.cpp",
    "content": "/*\n    tests/test_kwargs_and_defaults.cpp -- keyword arguments and default values\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/stl.h>\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\n#include <utility>\n\nTEST_SUBMODULE(kwargs_and_defaults, m) {\n    auto kw_func\n        = [](int x, int y) { return \"x=\" + std::to_string(x) + \", y=\" + std::to_string(y); };\n\n    // test_named_arguments\n    m.def(\"kw_func0\", kw_func);\n    m.def(\"kw_func1\", kw_func, py::arg(\"x\"), py::arg(\"y\"));\n    m.def(\"kw_func2\", kw_func, py::arg(\"x\") = 100, py::arg(\"y\") = 200);\n    m.def(\n        \"kw_func3\", [](const char *) {}, py::arg(\"data\") = std::string(\"Hello world!\"));\n\n    /* A fancier default argument */\n    std::vector<int> list{{13, 17}};\n    m.def(\n        \"kw_func4\",\n        [](const std::vector<int> &entries) {\n            std::string ret = \"{\";\n            for (int i : entries) {\n                ret += std::to_string(i) + \" \";\n            }\n            ret.back() = '}';\n            return ret;\n        },\n        py::arg(\"myList\") = list);\n\n    m.def(\"kw_func_udl\", kw_func, \"x\"_a, \"y\"_a = 300);\n    m.def(\"kw_func_udl_z\", kw_func, \"x\"_a, \"y\"_a = 0);\n\n    // test_args_and_kwargs\n    m.def(\"args_function\", [](py::args args) -> py::tuple {\n        PYBIND11_WARNING_PUSH\n\n#ifdef PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING\n        PYBIND11_WARNING_DISABLE_CLANG(\"-Wreturn-std-move\")\n#endif\n        return args;\n        PYBIND11_WARNING_POP\n    });\n    m.def(\"args_kwargs_function\", [](const py::args &args, const py::kwargs &kwargs) {\n        return py::make_tuple(args, kwargs);\n    });\n\n    // test_mixed_args_and_kwargs\n    m.def(\"mixed_plus_args\",\n          [](int i, double j, const py::args &args) { return py::make_tuple(i, j, args); });\n    m.def(\"mixed_plus_kwargs\",\n          [](int i, double j, const py::kwargs &kwargs) { return py::make_tuple(i, j, kwargs); });\n    auto mixed_plus_both = [](int i, double j, const py::args &args, const py::kwargs &kwargs) {\n        return py::make_tuple(i, j, args, kwargs);\n    };\n    m.def(\"mixed_plus_args_kwargs\", mixed_plus_both);\n\n    m.def(\"mixed_plus_args_kwargs_defaults\",\n          mixed_plus_both,\n          py::arg(\"i\") = 1,\n          py::arg(\"j\") = 3.14159);\n\n    m.def(\n        \"args_kwonly\",\n        [](int i, double j, const py::args &args, int z) { return py::make_tuple(i, j, args, z); },\n        \"i\"_a,\n        \"j\"_a,\n        \"z\"_a);\n    m.def(\n        \"args_kwonly_kwargs\",\n        [](int i, double j, const py::args &args, int z, const py::kwargs &kwargs) {\n            return py::make_tuple(i, j, args, z, kwargs);\n        },\n        \"i\"_a,\n        \"j\"_a,\n        py::kw_only{},\n        \"z\"_a);\n    m.def(\n        \"args_kwonly_kwargs_defaults\",\n        [](int i, double j, const py::args &args, int z, const py::kwargs &kwargs) {\n            return py::make_tuple(i, j, args, z, kwargs);\n        },\n        \"i\"_a = 1,\n        \"j\"_a = 3.14159,\n        \"z\"_a = 42);\n    m.def(\n        \"args_kwonly_full_monty\",\n        [](int h, int i, double j, const py::args &args, int z, const py::kwargs &kwargs) {\n            return py::make_tuple(h, i, j, args, z, kwargs);\n        },\n        py::arg() = 1,\n        py::arg() = 2,\n        py::pos_only{},\n        \"j\"_a = 3.14159,\n        \"z\"_a = 42);\n\n// test_args_refcount\n// PyPy needs a garbage collection to get the reference count values to match CPython's behaviour\n#ifdef PYPY_VERSION\n#    define GC_IF_NEEDED ConstructorStats::gc()\n#else\n#    define GC_IF_NEEDED\n#endif\n    m.def(\"arg_refcount_h\", [](py::handle h) {\n        GC_IF_NEEDED;\n        return h.ref_count();\n    });\n    m.def(\"arg_refcount_h\", [](py::handle h, py::handle, py::handle) {\n        GC_IF_NEEDED;\n        return h.ref_count();\n    });\n    m.def(\"arg_refcount_o\", [](const py::object &o) {\n        GC_IF_NEEDED;\n        return o.ref_count();\n    });\n    m.def(\"args_refcount\", [](py::args a) {\n        GC_IF_NEEDED;\n        py::tuple t(a.size());\n        for (size_t i = 0; i < a.size(); i++) {\n            // Use raw Python API here to avoid an extra, intermediate incref on the tuple item:\n            t[i] = (int) Py_REFCNT(PyTuple_GET_ITEM(a.ptr(), static_cast<py::ssize_t>(i)));\n        }\n        return t;\n    });\n    m.def(\"mixed_args_refcount\", [](const py::object &o, py::args a) {\n        GC_IF_NEEDED;\n        py::tuple t(a.size() + 1);\n        t[0] = o.ref_count();\n        for (size_t i = 0; i < a.size(); i++) {\n            // Use raw Python API here to avoid an extra, intermediate incref on the tuple item:\n            t[i + 1] = (int) Py_REFCNT(PyTuple_GET_ITEM(a.ptr(), static_cast<py::ssize_t>(i)));\n        }\n        return t;\n    });\n\n    // pybind11 won't allow these to be bound: args and kwargs, if present, must be at the end.\n    // Uncomment these to test that the static_assert is indeed working:\n    //    m.def(\"bad_args1\", [](py::args, int) {});\n    //    m.def(\"bad_args2\", [](py::kwargs, int) {});\n    //    m.def(\"bad_args3\", [](py::kwargs, py::args) {});\n    //    m.def(\"bad_args4\", [](py::args, int, py::kwargs) {});\n    //    m.def(\"bad_args5\", [](py::args, py::kwargs, int) {});\n    //    m.def(\"bad_args6\", [](py::args, py::args) {});\n    //    m.def(\"bad_args7\", [](py::kwargs, py::kwargs) {});\n\n    // test_keyword_only_args\n    m.def(\n        \"kw_only_all\",\n        [](int i, int j) { return py::make_tuple(i, j); },\n        py::kw_only(),\n        py::arg(\"i\"),\n        py::arg(\"j\"));\n    m.def(\n        \"kw_only_some\",\n        [](int i, int j, int k) { return py::make_tuple(i, j, k); },\n        py::arg(),\n        py::kw_only(),\n        py::arg(\"j\"),\n        py::arg(\"k\"));\n    m.def(\n        \"kw_only_with_defaults\",\n        [](int i, int j, int k, int z) { return py::make_tuple(i, j, k, z); },\n        py::arg() = 3,\n        \"j\"_a = 4,\n        py::kw_only(),\n        \"k\"_a = 5,\n        \"z\"_a);\n    m.def(\n        \"kw_only_mixed\",\n        [](int i, int j) { return py::make_tuple(i, j); },\n        \"i\"_a,\n        py::kw_only(),\n        \"j\"_a);\n    m.def(\n        \"kw_only_plus_more\",\n        [](int i, int j, int k, const py::kwargs &kwargs) {\n            return py::make_tuple(i, j, k, kwargs);\n        },\n        py::arg() /* positional */,\n        py::arg(\"j\") = -1 /* both */,\n        py::kw_only(),\n        py::arg(\"k\") /* kw-only */);\n\n    m.def(\"register_invalid_kw_only\", [](py::module_ m) {\n        m.def(\n            \"bad_kw_only\",\n            [](int i, int j) { return py::make_tuple(i, j); },\n            py::kw_only(),\n            py::arg() /* invalid unnamed argument */,\n            \"j\"_a);\n    });\n\n    // test_positional_only_args\n    m.def(\n        \"pos_only_all\",\n        [](int i, int j) { return py::make_tuple(i, j); },\n        py::arg(\"i\"),\n        py::arg(\"j\"),\n        py::pos_only());\n    m.def(\n        \"pos_only_mix\",\n        [](int i, int j) { return py::make_tuple(i, j); },\n        py::arg(\"i\"),\n        py::pos_only(),\n        py::arg(\"j\"));\n    m.def(\n        \"pos_kw_only_mix\",\n        [](int i, int j, int k) { return py::make_tuple(i, j, k); },\n        py::arg(\"i\"),\n        py::pos_only(),\n        py::arg(\"j\"),\n        py::kw_only(),\n        py::arg(\"k\"));\n    m.def(\n        \"pos_only_def_mix\",\n        [](int i, int j, int k) { return py::make_tuple(i, j, k); },\n        py::arg(\"i\"),\n        py::arg(\"j\") = 2,\n        py::pos_only(),\n        py::arg(\"k\") = 3);\n\n    // These should fail to compile:\n#ifdef PYBIND11_NEVER_DEFINED_EVER\n    // argument annotations are required when using kw_only\n    m.def(\n        \"bad_kw_only1\", [](int) {}, py::kw_only());\n    // can't specify both `py::kw_only` and a `py::args` argument\n    m.def(\n        \"bad_kw_only2\", [](int i, py::args) {}, py::kw_only(), \"i\"_a);\n#endif\n\n    // test_function_signatures (along with most of the above)\n    struct KWClass {\n        void foo(int, float) {}\n    };\n    py::class_<KWClass>(m, \"KWClass\")\n        .def(\"foo0\", &KWClass::foo)\n        .def(\"foo1\", &KWClass::foo, \"x\"_a, \"y\"_a);\n\n    // Make sure a class (not an instance) can be used as a default argument.\n    // The return value doesn't matter, only that the module is importable.\n    m.def(\n        \"class_default_argument\",\n        [](py::object a) { return py::repr(std::move(a)); },\n        \"a\"_a = py::module_::import(\"decimal\").attr(\"Decimal\"));\n\n    // Initial implementation of kw_only was broken when used on a method/constructor before any\n    // other arguments\n    // https://github.com/pybind/pybind11/pull/3402#issuecomment-963341987\n\n    struct first_arg_kw_only {};\n    py::class_<first_arg_kw_only>(m, \"first_arg_kw_only\")\n        .def(py::init([](int) { return first_arg_kw_only(); }),\n             py::kw_only(), // This being before any args was broken\n             py::arg(\"i\") = 0)\n        .def(\n            \"method\",\n            [](first_arg_kw_only &, int, int) {},\n            py::kw_only(), // and likewise here\n            py::arg(\"i\") = 1,\n            py::arg(\"j\") = 2)\n        // Closely related: pos_only marker didn't show up properly when it was before any other\n        // arguments (although that is fairly useless in practice).\n        .def(\n            \"pos_only\",\n            [](first_arg_kw_only &, int, int) {},\n            py::pos_only{},\n            py::arg(\"i\"),\n            py::arg(\"j\"));\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_kwargs_and_defaults.py",
    "content": "import pytest\n\nfrom pybind11_tests import kwargs_and_defaults as m\n\n\ndef test_function_signatures(doc):\n    assert doc(m.kw_func0) == \"kw_func0(arg0: int, arg1: int) -> str\"\n    assert doc(m.kw_func1) == \"kw_func1(x: int, y: int) -> str\"\n    assert doc(m.kw_func2) == \"kw_func2(x: int = 100, y: int = 200) -> str\"\n    assert doc(m.kw_func3) == \"kw_func3(data: str = 'Hello world!') -> None\"\n    assert doc(m.kw_func4) == \"kw_func4(myList: List[int] = [13, 17]) -> str\"\n    assert doc(m.kw_func_udl) == \"kw_func_udl(x: int, y: int = 300) -> str\"\n    assert doc(m.kw_func_udl_z) == \"kw_func_udl_z(x: int, y: int = 0) -> str\"\n    assert doc(m.args_function) == \"args_function(*args) -> tuple\"\n    assert (\n        doc(m.args_kwargs_function) == \"args_kwargs_function(*args, **kwargs) -> tuple\"\n    )\n    assert (\n        doc(m.KWClass.foo0)\n        == \"foo0(self: m.kwargs_and_defaults.KWClass, arg0: int, arg1: float) -> None\"\n    )\n    assert (\n        doc(m.KWClass.foo1)\n        == \"foo1(self: m.kwargs_and_defaults.KWClass, x: int, y: float) -> None\"\n    )\n\n\ndef test_named_arguments(msg):\n    assert m.kw_func0(5, 10) == \"x=5, y=10\"\n\n    assert m.kw_func1(5, 10) == \"x=5, y=10\"\n    assert m.kw_func1(5, y=10) == \"x=5, y=10\"\n    assert m.kw_func1(y=10, x=5) == \"x=5, y=10\"\n\n    assert m.kw_func2() == \"x=100, y=200\"\n    assert m.kw_func2(5) == \"x=5, y=200\"\n    assert m.kw_func2(x=5) == \"x=5, y=200\"\n    assert m.kw_func2(y=10) == \"x=100, y=10\"\n    assert m.kw_func2(5, 10) == \"x=5, y=10\"\n    assert m.kw_func2(x=5, y=10) == \"x=5, y=10\"\n\n    with pytest.raises(TypeError) as excinfo:\n        # noinspection PyArgumentList\n        m.kw_func2(x=5, y=10, z=12)\n    assert excinfo.match(\n        r\"(?s)^kw_func2\\(\\): incompatible.*Invoked with: kwargs: ((x=5|y=10|z=12)(, |$))\"\n        + \"{3}$\"\n    )\n\n    assert m.kw_func4() == \"{13 17}\"\n    assert m.kw_func4(myList=[1, 2, 3]) == \"{1 2 3}\"\n\n    assert m.kw_func_udl(x=5, y=10) == \"x=5, y=10\"\n    assert m.kw_func_udl_z(x=5) == \"x=5, y=0\"\n\n\ndef test_arg_and_kwargs():\n    args = \"arg1_value\", \"arg2_value\", 3\n    assert m.args_function(*args) == args\n\n    args = \"a1\", \"a2\"\n    kwargs = dict(arg3=\"a3\", arg4=4)\n    assert m.args_kwargs_function(*args, **kwargs) == (args, kwargs)\n\n\ndef test_mixed_args_and_kwargs(msg):\n    mpa = m.mixed_plus_args\n    mpk = m.mixed_plus_kwargs\n    mpak = m.mixed_plus_args_kwargs\n    mpakd = m.mixed_plus_args_kwargs_defaults\n\n    assert mpa(1, 2.5, 4, 99.5, None) == (1, 2.5, (4, 99.5, None))\n    assert mpa(1, 2.5) == (1, 2.5, ())\n    with pytest.raises(TypeError) as excinfo:\n        assert mpa(1)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        mixed_plus_args(): incompatible function arguments. The following argument types are supported:\n            1. (arg0: int, arg1: float, *args) -> tuple\n\n        Invoked with: 1\n    \"\"\"\n    )\n    with pytest.raises(TypeError) as excinfo:\n        assert mpa()\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        mixed_plus_args(): incompatible function arguments. The following argument types are supported:\n            1. (arg0: int, arg1: float, *args) -> tuple\n\n        Invoked with:\n    \"\"\"\n    )\n\n    assert mpk(-2, 3.5, pi=3.14159, e=2.71828) == (\n        -2,\n        3.5,\n        {\"e\": 2.71828, \"pi\": 3.14159},\n    )\n    assert mpak(7, 7.7, 7.77, 7.777, 7.7777, minusseven=-7) == (\n        7,\n        7.7,\n        (7.77, 7.777, 7.7777),\n        {\"minusseven\": -7},\n    )\n    assert mpakd() == (1, 3.14159, (), {})\n    assert mpakd(3) == (3, 3.14159, (), {})\n    assert mpakd(j=2.71828) == (1, 2.71828, (), {})\n    assert mpakd(k=42) == (1, 3.14159, (), {\"k\": 42})\n    assert mpakd(1, 1, 2, 3, 5, 8, then=13, followedby=21) == (\n        1,\n        1,\n        (2, 3, 5, 8),\n        {\"then\": 13, \"followedby\": 21},\n    )\n    # Arguments specified both positionally and via kwargs should fail:\n    with pytest.raises(TypeError) as excinfo:\n        assert mpakd(1, i=1)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        mixed_plus_args_kwargs_defaults(): incompatible function arguments. The following argument types are supported:\n            1. (i: int = 1, j: float = 3.14159, *args, **kwargs) -> tuple\n\n        Invoked with: 1; kwargs: i=1\n    \"\"\"\n    )\n    with pytest.raises(TypeError) as excinfo:\n        assert mpakd(1, 2, j=1)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        mixed_plus_args_kwargs_defaults(): incompatible function arguments. The following argument types are supported:\n            1. (i: int = 1, j: float = 3.14159, *args, **kwargs) -> tuple\n\n        Invoked with: 1, 2; kwargs: j=1\n    \"\"\"\n    )\n\n    # Arguments after a py::args are automatically keyword-only (pybind 2.9+)\n    assert m.args_kwonly(2, 2.5, z=22) == (2, 2.5, (), 22)\n    assert m.args_kwonly(2, 2.5, \"a\", \"b\", \"c\", z=22) == (2, 2.5, (\"a\", \"b\", \"c\"), 22)\n    assert m.args_kwonly(z=22, i=4, j=16) == (4, 16, (), 22)\n\n    with pytest.raises(TypeError) as excinfo:\n        assert m.args_kwonly(2, 2.5, 22)  # missing z= keyword\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        args_kwonly(): incompatible function arguments. The following argument types are supported:\n            1. (i: int, j: float, *args, z: int) -> tuple\n\n        Invoked with: 2, 2.5, 22\n    \"\"\"\n    )\n\n    assert m.args_kwonly_kwargs(i=1, k=4, j=10, z=-1, y=9) == (\n        1,\n        10,\n        (),\n        -1,\n        {\"k\": 4, \"y\": 9},\n    )\n    assert m.args_kwonly_kwargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, z=11, y=12) == (\n        1,\n        2,\n        (3, 4, 5, 6, 7, 8, 9, 10),\n        11,\n        {\"y\": 12},\n    )\n    assert (\n        m.args_kwonly_kwargs.__doc__\n        == \"args_kwonly_kwargs(i: int, j: float, *args, z: int, **kwargs) -> tuple\\n\"\n    )\n\n    assert (\n        m.args_kwonly_kwargs_defaults.__doc__\n        == \"args_kwonly_kwargs_defaults(i: int = 1, j: float = 3.14159, *args, z: int = 42, **kwargs) -> tuple\\n\"  # noqa: E501 line too long\n    )\n    assert m.args_kwonly_kwargs_defaults() == (1, 3.14159, (), 42, {})\n    assert m.args_kwonly_kwargs_defaults(2) == (2, 3.14159, (), 42, {})\n    assert m.args_kwonly_kwargs_defaults(z=-99) == (1, 3.14159, (), -99, {})\n    assert m.args_kwonly_kwargs_defaults(5, 6, 7, 8) == (5, 6, (7, 8), 42, {})\n    assert m.args_kwonly_kwargs_defaults(5, 6, 7, m=8) == (5, 6, (7,), 42, {\"m\": 8})\n    assert m.args_kwonly_kwargs_defaults(5, 6, 7, m=8, z=9) == (5, 6, (7,), 9, {\"m\": 8})\n\n\ndef test_keyword_only_args(msg):\n    assert m.kw_only_all(i=1, j=2) == (1, 2)\n    assert m.kw_only_all(j=1, i=2) == (2, 1)\n\n    with pytest.raises(TypeError) as excinfo:\n        assert m.kw_only_all(i=1) == (1,)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    with pytest.raises(TypeError) as excinfo:\n        assert m.kw_only_all(1, 2) == (1, 2)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    assert m.kw_only_some(1, k=3, j=2) == (1, 2, 3)\n\n    assert m.kw_only_with_defaults(z=8) == (3, 4, 5, 8)\n    assert m.kw_only_with_defaults(2, z=8) == (2, 4, 5, 8)\n    assert m.kw_only_with_defaults(2, j=7, k=8, z=9) == (2, 7, 8, 9)\n    assert m.kw_only_with_defaults(2, 7, z=9, k=8) == (2, 7, 8, 9)\n\n    assert m.kw_only_mixed(1, j=2) == (1, 2)\n    assert m.kw_only_mixed(j=2, i=3) == (3, 2)\n    assert m.kw_only_mixed(i=2, j=3) == (2, 3)\n\n    assert m.kw_only_plus_more(4, 5, k=6, extra=7) == (4, 5, 6, {\"extra\": 7})\n    assert m.kw_only_plus_more(3, k=5, j=4, extra=6) == (3, 4, 5, {\"extra\": 6})\n    assert m.kw_only_plus_more(2, k=3, extra=4) == (2, -1, 3, {\"extra\": 4})\n\n    with pytest.raises(TypeError) as excinfo:\n        assert m.kw_only_mixed(i=1) == (1,)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.register_invalid_kw_only(m)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        arg(): cannot specify an unnamed argument after a kw_only() annotation or args() argument\n    \"\"\"\n    )\n\n    # https://github.com/pybind/pybind11/pull/3402#issuecomment-963341987\n    x = m.first_arg_kw_only(i=1)\n    x.method()\n    x.method(i=1, j=2)\n    assert (\n        m.first_arg_kw_only.__init__.__doc__\n        == \"__init__(self: pybind11_tests.kwargs_and_defaults.first_arg_kw_only, *, i: int = 0) -> None\\n\"  # noqa: E501 line too long\n    )\n    assert (\n        m.first_arg_kw_only.method.__doc__\n        == \"method(self: pybind11_tests.kwargs_and_defaults.first_arg_kw_only, *, i: int = 1, j: int = 2) -> None\\n\"  # noqa: E501 line too long\n    )\n\n\ndef test_positional_only_args(msg):\n    assert m.pos_only_all(1, 2) == (1, 2)\n    assert m.pos_only_all(2, 1) == (2, 1)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.pos_only_all(i=1, j=2)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    assert m.pos_only_mix(1, 2) == (1, 2)\n    assert m.pos_only_mix(2, j=1) == (2, 1)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.pos_only_mix(i=1, j=2)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    assert m.pos_kw_only_mix(1, 2, k=3) == (1, 2, 3)\n    assert m.pos_kw_only_mix(1, j=2, k=3) == (1, 2, 3)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.pos_kw_only_mix(i=1, j=2, k=3)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.pos_kw_only_mix(1, 2, 3)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.pos_only_def_mix()\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    assert m.pos_only_def_mix(1) == (1, 2, 3)\n    assert m.pos_only_def_mix(1, 4) == (1, 4, 3)\n    assert m.pos_only_def_mix(1, 4, 7) == (1, 4, 7)\n    assert m.pos_only_def_mix(1, 4, k=7) == (1, 4, 7)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.pos_only_def_mix(1, j=4)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    # Mix it with args and kwargs:\n    assert (\n        m.args_kwonly_full_monty.__doc__\n        == \"args_kwonly_full_monty(arg0: int = 1, arg1: int = 2, /, j: float = 3.14159, *args, z: int = 42, **kwargs) -> tuple\\n\"  # noqa: E501 line too long\n    )\n    assert m.args_kwonly_full_monty() == (1, 2, 3.14159, (), 42, {})\n    assert m.args_kwonly_full_monty(8) == (8, 2, 3.14159, (), 42, {})\n    assert m.args_kwonly_full_monty(8, 9) == (8, 9, 3.14159, (), 42, {})\n    assert m.args_kwonly_full_monty(8, 9, 10) == (8, 9, 10.0, (), 42, {})\n    assert m.args_kwonly_full_monty(3, 4, 5, 6, 7, m=8, z=9) == (\n        3,\n        4,\n        5.0,\n        (\n            6,\n            7,\n        ),\n        9,\n        {\"m\": 8},\n    )\n    assert m.args_kwonly_full_monty(3, 4, 5, 6, 7, m=8, z=9) == (\n        3,\n        4,\n        5.0,\n        (\n            6,\n            7,\n        ),\n        9,\n        {\"m\": 8},\n    )\n    assert m.args_kwonly_full_monty(5, j=7, m=8, z=9) == (5, 2, 7.0, (), 9, {\"m\": 8})\n    assert m.args_kwonly_full_monty(i=5, j=7, m=8, z=9) == (\n        1,\n        2,\n        7.0,\n        (),\n        9,\n        {\"i\": 5, \"m\": 8},\n    )\n\n    # pos_only at the beginning of the argument list was \"broken\" in how it was displayed (though\n    # this is fairly useless in practice).  Related to:\n    # https://github.com/pybind/pybind11/pull/3402#issuecomment-963341987\n    assert (\n        m.first_arg_kw_only.pos_only.__doc__\n        == \"pos_only(self: pybind11_tests.kwargs_and_defaults.first_arg_kw_only, /, i: int, j: int) -> None\\n\"  # noqa: E501 line too long\n    )\n\n\ndef test_signatures():\n    assert \"kw_only_all(*, i: int, j: int) -> tuple\\n\" == m.kw_only_all.__doc__\n    assert \"kw_only_mixed(i: int, *, j: int) -> tuple\\n\" == m.kw_only_mixed.__doc__\n    assert \"pos_only_all(i: int, j: int, /) -> tuple\\n\" == m.pos_only_all.__doc__\n    assert \"pos_only_mix(i: int, /, j: int) -> tuple\\n\" == m.pos_only_mix.__doc__\n    assert (\n        \"pos_kw_only_mix(i: int, /, j: int, *, k: int) -> tuple\\n\"\n        == m.pos_kw_only_mix.__doc__\n    )\n\n\ndef test_args_refcount():\n    \"\"\"Issue/PR #1216 - py::args elements get double-inc_ref()ed when combined with regular\n    arguments\"\"\"\n    refcount = m.arg_refcount_h\n\n    myval = 54321\n    expected = refcount(myval)\n    assert m.arg_refcount_h(myval) == expected\n    assert m.arg_refcount_o(myval) == expected + 1\n    assert m.arg_refcount_h(myval) == expected\n    assert refcount(myval) == expected\n\n    assert m.mixed_plus_args(1, 2.0, \"a\", myval) == (1, 2.0, (\"a\", myval))\n    assert refcount(myval) == expected\n\n    assert m.mixed_plus_kwargs(3, 4.0, a=1, b=myval) == (3, 4.0, {\"a\": 1, \"b\": myval})\n    assert refcount(myval) == expected\n\n    assert m.args_function(-1, myval) == (-1, myval)\n    assert refcount(myval) == expected\n\n    assert m.mixed_plus_args_kwargs(5, 6.0, myval, a=myval) == (\n        5,\n        6.0,\n        (myval,),\n        {\"a\": myval},\n    )\n    assert refcount(myval) == expected\n\n    assert m.args_kwargs_function(7, 8, myval, a=1, b=myval) == (\n        (7, 8, myval),\n        {\"a\": 1, \"b\": myval},\n    )\n    assert refcount(myval) == expected\n\n    exp3 = refcount(myval, myval, myval)\n    assert m.args_refcount(myval, myval, myval) == (exp3, exp3, exp3)\n    assert refcount(myval) == expected\n\n    # This function takes the first arg as a `py::object` and the rest as a `py::args`.  Unlike the\n    # previous case, when we have both positional and `py::args` we need to construct a new tuple\n    # for the `py::args`; in the previous case, we could simply inc_ref and pass on Python's input\n    # tuple without having to inc_ref the individual elements, but here we can't, hence the extra\n    # refs.\n    assert m.mixed_args_refcount(myval, myval, myval) == (exp3 + 3, exp3 + 3, exp3 + 3)\n\n    assert m.class_default_argument() == \"<class 'decimal.Decimal'>\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_local_bindings.cpp",
    "content": "/*\n    tests/test_local_bindings.cpp -- tests the py::module_local class feature which makes a class\n                                     binding local to the module in which it is defined.\n\n    Copyright (c) 2017 Jason Rhinelander <jason@imaginary.ca>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/stl.h>\n#include <pybind11/stl_bind.h>\n\n#include \"local_bindings.h\"\n#include \"pybind11_tests.h\"\n\n#include <numeric>\n#include <utility>\n\nTEST_SUBMODULE(local_bindings, m) {\n    // test_load_external\n    m.def(\"load_external1\", [](ExternalType1 &e) { return e.i; });\n    m.def(\"load_external2\", [](ExternalType2 &e) { return e.i; });\n\n    // test_local_bindings\n    // Register a class with py::module_local:\n    bind_local<LocalType, -1>(m, \"LocalType\", py::module_local()).def(\"get3\", [](LocalType &t) {\n        return t.i + 3;\n    });\n\n    m.def(\"local_value\", [](LocalType &l) { return l.i; });\n\n    // test_nonlocal_failure\n    // The main pybind11 test module is loaded first, so this registration will succeed (the second\n    // one, in pybind11_cross_module_tests.cpp, is designed to fail):\n    bind_local<NonLocalType, 0>(m, \"NonLocalType\")\n        .def(py::init<int>())\n        .def(\"get\", [](LocalType &i) { return i.i; });\n\n    // test_duplicate_local\n    // py::module_local declarations should be visible across compilation units that get linked\n    // together; this tries to register a duplicate local.  It depends on a definition in\n    // test_class.cpp and should raise a runtime error from the duplicate definition attempt.  If\n    // test_class isn't available it *also* throws a runtime error (with \"test_class not enabled\"\n    // as value).\n    m.def(\"register_local_external\", [m]() {\n        auto main = py::module_::import(\"pybind11_tests\");\n        if (py::hasattr(main, \"class_\")) {\n            bind_local<LocalExternal, 7>(m, \"LocalExternal\", py::module_local());\n        } else {\n            throw std::runtime_error(\"test_class not enabled\");\n        }\n    });\n\n    // test_stl_bind_local\n    // stl_bind.h binders defaults to py::module_local if the types are local or converting:\n    py::bind_vector<LocalVec>(m, \"LocalVec\");\n    py::bind_map<LocalMap>(m, \"LocalMap\");\n    // and global if the type (or one of the types, for the map) is global:\n    py::bind_vector<NonLocalVec>(m, \"NonLocalVec\");\n    py::bind_map<NonLocalMap>(m, \"NonLocalMap\");\n\n    // test_stl_bind_global\n    // They can, however, be overridden to global using `py::module_local(false)`:\n    bind_local<NonLocal2, 10>(m, \"NonLocal2\");\n    py::bind_vector<LocalVec2>(m, \"LocalVec2\", py::module_local());\n    py::bind_map<NonLocalMap2>(m, \"NonLocalMap2\", py::module_local(false));\n\n    // test_mixed_local_global\n    // We try this both with the global type registered first and vice versa (the order shouldn't\n    // matter).\n    m.def(\"register_mixed_global\", [m]() {\n        bind_local<MixedGlobalLocal, 100>(m, \"MixedGlobalLocal\", py::module_local(false));\n    });\n    m.def(\"register_mixed_local\", [m]() {\n        bind_local<MixedLocalGlobal, 1000>(m, \"MixedLocalGlobal\", py::module_local());\n    });\n    m.def(\"get_mixed_gl\", [](int i) { return MixedGlobalLocal(i); });\n    m.def(\"get_mixed_lg\", [](int i) { return MixedLocalGlobal(i); });\n\n    // test_internal_locals_differ\n    m.def(\"local_cpp_types_addr\",\n          []() { return (uintptr_t) &py::detail::get_local_internals().registered_types_cpp; });\n\n    // test_stl_caster_vs_stl_bind\n    m.def(\"load_vector_via_caster\",\n          [](std::vector<int> v) { return std::accumulate(v.begin(), v.end(), 0); });\n\n    // test_cross_module_calls\n    m.def(\"return_self\", [](LocalVec *v) { return v; });\n    m.def(\"return_copy\", [](const LocalVec &v) { return LocalVec(v); });\n\n    class Cat : public pets::Pet {\n    public:\n        explicit Cat(std::string name) : Pet(std::move(name)) {}\n    };\n    py::class_<pets::Pet>(m, \"Pet\", py::module_local()).def(\"get_name\", &pets::Pet::name);\n    // Binding for local extending class:\n    py::class_<Cat, pets::Pet>(m, \"Cat\").def(py::init<std::string>());\n    m.def(\"pet_name\", [](pets::Pet &p) { return p.name(); });\n\n    py::class_<MixGL>(m, \"MixGL\").def(py::init<int>());\n    m.def(\"get_gl_value\", [](MixGL &o) { return o.i + 10; });\n\n    py::class_<MixGL2>(m, \"MixGL2\").def(py::init<int>());\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_local_bindings.py",
    "content": "import pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import local_bindings as m\n\n\ndef test_load_external():\n    \"\"\"Load a `py::module_local` type that's only registered in an external module\"\"\"\n    import pybind11_cross_module_tests as cm\n\n    assert m.load_external1(cm.ExternalType1(11)) == 11\n    assert m.load_external2(cm.ExternalType2(22)) == 22\n\n    with pytest.raises(TypeError) as excinfo:\n        assert m.load_external2(cm.ExternalType1(21)) == 21\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    with pytest.raises(TypeError) as excinfo:\n        assert m.load_external1(cm.ExternalType2(12)) == 12\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n\ndef test_local_bindings():\n    \"\"\"Tests that duplicate `py::module_local` class bindings work across modules\"\"\"\n\n    # Make sure we can load the second module with the conflicting (but local) definition:\n    import pybind11_cross_module_tests as cm\n\n    i1 = m.LocalType(5)\n    assert i1.get() == 4\n    assert i1.get3() == 8\n\n    i2 = cm.LocalType(10)\n    assert i2.get() == 11\n    assert i2.get2() == 12\n\n    assert not hasattr(i1, \"get2\")\n    assert not hasattr(i2, \"get3\")\n\n    # Loading within the local module\n    assert m.local_value(i1) == 5\n    assert cm.local_value(i2) == 10\n\n    # Cross-module loading works as well (on failure, the type loader looks for\n    # external module-local converters):\n    assert m.local_value(i2) == 10\n    assert cm.local_value(i1) == 5\n\n\ndef test_nonlocal_failure():\n    \"\"\"Tests that attempting to register a non-local type in multiple modules fails\"\"\"\n    import pybind11_cross_module_tests as cm\n\n    with pytest.raises(RuntimeError) as excinfo:\n        cm.register_nonlocal()\n    assert (\n        str(excinfo.value) == 'generic_type: type \"NonLocalType\" is already registered!'\n    )\n\n\ndef test_duplicate_local():\n    \"\"\"Tests expected failure when registering a class twice with py::local in the same module\"\"\"\n    with pytest.raises(RuntimeError) as excinfo:\n        m.register_local_external()\n    import pybind11_tests\n\n    assert str(excinfo.value) == (\n        'generic_type: type \"LocalExternal\" is already registered!'\n        if hasattr(pybind11_tests, \"class_\")\n        else \"test_class not enabled\"\n    )\n\n\ndef test_stl_bind_local():\n    import pybind11_cross_module_tests as cm\n\n    v1, v2 = m.LocalVec(), cm.LocalVec()\n    v1.append(m.LocalType(1))\n    v1.append(m.LocalType(2))\n    v2.append(cm.LocalType(1))\n    v2.append(cm.LocalType(2))\n\n    # Cross module value loading:\n    v1.append(cm.LocalType(3))\n    v2.append(m.LocalType(3))\n\n    assert [i.get() for i in v1] == [0, 1, 2]\n    assert [i.get() for i in v2] == [2, 3, 4]\n\n    v3, v4 = m.NonLocalVec(), cm.NonLocalVec2()\n    v3.append(m.NonLocalType(1))\n    v3.append(m.NonLocalType(2))\n    v4.append(m.NonLocal2(3))\n    v4.append(m.NonLocal2(4))\n\n    assert [i.get() for i in v3] == [1, 2]\n    assert [i.get() for i in v4] == [13, 14]\n\n    d1, d2 = m.LocalMap(), cm.LocalMap()\n    d1[\"a\"] = v1[0]\n    d1[\"b\"] = v1[1]\n    d2[\"c\"] = v2[0]\n    d2[\"d\"] = v2[1]\n    assert {i: d1[i].get() for i in d1} == {\"a\": 0, \"b\": 1}\n    assert {i: d2[i].get() for i in d2} == {\"c\": 2, \"d\": 3}\n\n\ndef test_stl_bind_global():\n    import pybind11_cross_module_tests as cm\n\n    with pytest.raises(RuntimeError) as excinfo:\n        cm.register_nonlocal_map()\n    assert (\n        str(excinfo.value) == 'generic_type: type \"NonLocalMap\" is already registered!'\n    )\n\n    with pytest.raises(RuntimeError) as excinfo:\n        cm.register_nonlocal_vec()\n    assert (\n        str(excinfo.value) == 'generic_type: type \"NonLocalVec\" is already registered!'\n    )\n\n    with pytest.raises(RuntimeError) as excinfo:\n        cm.register_nonlocal_map2()\n    assert (\n        str(excinfo.value) == 'generic_type: type \"NonLocalMap2\" is already registered!'\n    )\n\n\ndef test_mixed_local_global():\n    \"\"\"Local types take precedence over globally registered types: a module with a `module_local`\n    type can be registered even if the type is already registered globally.  With the module,\n    casting will go to the local type; outside the module casting goes to the global type.\n    \"\"\"\n    import pybind11_cross_module_tests as cm\n\n    m.register_mixed_global()\n    m.register_mixed_local()\n\n    a = []\n    a.append(m.MixedGlobalLocal(1))\n    a.append(m.MixedLocalGlobal(2))\n    a.append(m.get_mixed_gl(3))\n    a.append(m.get_mixed_lg(4))\n\n    assert [x.get() for x in a] == [101, 1002, 103, 1004]\n\n    cm.register_mixed_global_local()\n    cm.register_mixed_local_global()\n    a.append(m.MixedGlobalLocal(5))\n    a.append(m.MixedLocalGlobal(6))\n    a.append(cm.MixedGlobalLocal(7))\n    a.append(cm.MixedLocalGlobal(8))\n    a.append(m.get_mixed_gl(9))\n    a.append(m.get_mixed_lg(10))\n    a.append(cm.get_mixed_gl(11))\n    a.append(cm.get_mixed_lg(12))\n\n    assert [x.get() for x in a] == [\n        101,\n        1002,\n        103,\n        1004,\n        105,\n        1006,\n        207,\n        2008,\n        109,\n        1010,\n        211,\n        2012,\n    ]\n\n\ndef test_internal_locals_differ():\n    \"\"\"Makes sure the internal local type map differs across the two modules\"\"\"\n    import pybind11_cross_module_tests as cm\n\n    assert m.local_cpp_types_addr() != cm.local_cpp_types_addr()\n\n\n@pytest.mark.xfail(\"env.PYPY and sys.pypy_version_info < (7, 3, 2)\")\ndef test_stl_caster_vs_stl_bind(msg):\n    \"\"\"One module uses a generic vector caster from `<pybind11/stl.h>` while the other\n    exports `std::vector<int>` via `py:bind_vector` and `py::module_local`\"\"\"\n    import pybind11_cross_module_tests as cm\n\n    v1 = cm.VectorInt([1, 2, 3])\n    assert m.load_vector_via_caster(v1) == 6\n    assert cm.load_vector_via_binding(v1) == 6\n\n    v2 = [1, 2, 3]\n    assert m.load_vector_via_caster(v2) == 6\n    with pytest.raises(TypeError) as excinfo:\n        cm.load_vector_via_binding(v2)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n    load_vector_via_binding(): incompatible function arguments. The following argument types are supported:\n        1. (arg0: pybind11_cross_module_tests.VectorInt) -> int\n\n    Invoked with: [1, 2, 3]\n    \"\"\"\n    )\n\n\ndef test_cross_module_calls():\n    import pybind11_cross_module_tests as cm\n\n    v1 = m.LocalVec()\n    v1.append(m.LocalType(1))\n    v2 = cm.LocalVec()\n    v2.append(cm.LocalType(2))\n\n    # Returning the self pointer should get picked up as returning an existing\n    # instance (even when that instance is of a foreign, non-local type).\n    assert m.return_self(v1) is v1\n    assert cm.return_self(v2) is v2\n    assert m.return_self(v2) is v2\n    assert cm.return_self(v1) is v1\n\n    assert m.LocalVec is not cm.LocalVec\n    # Returning a copy, on the other hand, always goes to the local type,\n    # regardless of where the source type came from.\n    assert type(m.return_copy(v1)) is m.LocalVec\n    assert type(m.return_copy(v2)) is m.LocalVec\n    assert type(cm.return_copy(v1)) is cm.LocalVec\n    assert type(cm.return_copy(v2)) is cm.LocalVec\n\n    # Test the example given in the documentation (which also tests inheritance casting):\n    mycat = m.Cat(\"Fluffy\")\n    mydog = cm.Dog(\"Rover\")\n    assert mycat.get_name() == \"Fluffy\"\n    assert mydog.name() == \"Rover\"\n    assert m.Cat.__base__.__name__ == \"Pet\"\n    assert cm.Dog.__base__.__name__ == \"Pet\"\n    assert m.Cat.__base__ is not cm.Dog.__base__\n    assert m.pet_name(mycat) == \"Fluffy\"\n    assert m.pet_name(mydog) == \"Rover\"\n    assert cm.pet_name(mycat) == \"Fluffy\"\n    assert cm.pet_name(mydog) == \"Rover\"\n\n    assert m.MixGL is not cm.MixGL\n    a = m.MixGL(1)\n    b = cm.MixGL(2)\n    assert m.get_gl_value(a) == 11\n    assert m.get_gl_value(b) == 12\n    assert cm.get_gl_value(a) == 101\n    assert cm.get_gl_value(b) == 102\n\n    c, d = m.MixGL2(3), cm.MixGL2(4)\n    with pytest.raises(TypeError) as excinfo:\n        m.get_gl_value(c)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.get_gl_value(d)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_methods_and_attributes.cpp",
    "content": "/*\n    tests/test_methods_and_attributes.cpp -- constructors, deconstructors, attribute access,\n    __str__, argument and return value conventions\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\n#if !defined(PYBIND11_OVERLOAD_CAST)\ntemplate <typename... Args>\nusing overload_cast_ = pybind11::detail::overload_cast_impl<Args...>;\n#endif\n\nclass ExampleMandA {\npublic:\n    ExampleMandA() { print_default_created(this); }\n    explicit ExampleMandA(int value) : value(value) { print_created(this, value); }\n    ExampleMandA(const ExampleMandA &e) : value(e.value) { print_copy_created(this); }\n    explicit ExampleMandA(std::string &&) {}\n    ExampleMandA(ExampleMandA &&e) noexcept : value(e.value) { print_move_created(this); }\n    ~ExampleMandA() { print_destroyed(this); }\n\n    std::string toString() const { return \"ExampleMandA[value=\" + std::to_string(value) + \"]\"; }\n\n    void operator=(const ExampleMandA &e) {\n        print_copy_assigned(this);\n        value = e.value;\n    }\n    void operator=(ExampleMandA &&e) noexcept {\n        print_move_assigned(this);\n        value = e.value;\n    }\n\n    // NOLINTNEXTLINE(performance-unnecessary-value-param)\n    void add1(ExampleMandA other) { value += other.value; }         // passing by value\n    void add2(ExampleMandA &other) { value += other.value; }        // passing by reference\n    void add3(const ExampleMandA &other) { value += other.value; }  // passing by const reference\n    void add4(ExampleMandA *other) { value += other->value; }       // passing by pointer\n    void add5(const ExampleMandA *other) { value += other->value; } // passing by const pointer\n\n    void add6(int other) { value += other; }        // passing by value\n    void add7(int &other) { value += other; }       // passing by reference\n    void add8(const int &other) { value += other; } // passing by const reference\n    // NOLINTNEXTLINE(readability-non-const-parameter) Deliberately non-const for testing\n    void add9(int *other) { value += *other; }        // passing by pointer\n    void add10(const int *other) { value += *other; } // passing by const pointer\n\n    void consume_str(std::string &&) {}\n\n    ExampleMandA self1() { return *this; }              // return by value\n    ExampleMandA &self2() { return *this; }             // return by reference\n    const ExampleMandA &self3() const { return *this; } // return by const reference\n    ExampleMandA *self4() { return this; }              // return by pointer\n    const ExampleMandA *self5() const { return this; }  // return by const pointer\n\n    int internal1() const { return value; }        // return by value\n    int &internal2() { return value; }             // return by reference\n    const int &internal3() const { return value; } // return by const reference\n    int *internal4() { return &value; }            // return by pointer\n    const int *internal5() { return &value; }      // return by const pointer\n\n    py::str overloaded() { return \"()\"; }\n    py::str overloaded(int) { return \"(int)\"; }\n    py::str overloaded(int, float) { return \"(int, float)\"; }\n    py::str overloaded(float, int) { return \"(float, int)\"; }\n    py::str overloaded(int, int) { return \"(int, int)\"; }\n    py::str overloaded(float, float) { return \"(float, float)\"; }\n    py::str overloaded(int) const { return \"(int) const\"; }\n    py::str overloaded(int, float) const { return \"(int, float) const\"; }\n    py::str overloaded(float, int) const { return \"(float, int) const\"; }\n    py::str overloaded(int, int) const { return \"(int, int) const\"; }\n    py::str overloaded(float, float) const { return \"(float, float) const\"; }\n\n    static py::str overloaded(float) { return \"static float\"; }\n\n    int value = 0;\n};\n\nstruct TestProperties {\n    int value = 1;\n    static int static_value;\n\n    int get() const { return value; }\n    void set(int v) { value = v; }\n\n    static int static_get() { return static_value; }\n    static void static_set(int v) { static_value = v; }\n};\nint TestProperties::static_value = 1;\n\nstruct TestPropertiesOverride : TestProperties {\n    int value = 99;\n    static int static_value;\n};\nint TestPropertiesOverride::static_value = 99;\n\nstruct TestPropRVP {\n    UserType v1{1};\n    UserType v2{1};\n    static UserType sv1;\n    static UserType sv2;\n\n    const UserType &get1() const { return v1; }\n    const UserType &get2() const { return v2; }\n    UserType get_rvalue() const { return v2; }\n    void set1(int v) { v1.set(v); }\n    void set2(int v) { v2.set(v); }\n};\nUserType TestPropRVP::sv1(1);\nUserType TestPropRVP::sv2(1);\n\n// Test None-allowed py::arg argument policy\nclass NoneTester {\npublic:\n    int answer = 42;\n};\nint none1(const NoneTester &obj) { return obj.answer; }\nint none2(NoneTester *obj) { return obj ? obj->answer : -1; }\nint none3(std::shared_ptr<NoneTester> &obj) { return obj ? obj->answer : -1; }\nint none4(std::shared_ptr<NoneTester> *obj) { return obj && *obj ? (*obj)->answer : -1; }\nint none5(const std::shared_ptr<NoneTester> &obj) { return obj ? obj->answer : -1; }\n\n// Issue #2778: implicit casting from None to object (not pointer)\nclass NoneCastTester {\npublic:\n    int answer = -1;\n    NoneCastTester() = default;\n    explicit NoneCastTester(int v) : answer(v) {}\n};\n\nstruct StrIssue {\n    int val = -1;\n\n    StrIssue() = default;\n    explicit StrIssue(int i) : val{i} {}\n};\n\n// Issues #854, #910: incompatible function args when member function/pointer is in unregistered\n// base class\nclass UnregisteredBase {\npublic:\n    void do_nothing() const {}\n    void increase_value() {\n        rw_value++;\n        ro_value += 0.25;\n    }\n    void set_int(int v) { rw_value = v; }\n    int get_int() const { return rw_value; }\n    double get_double() const { return ro_value; }\n    int rw_value = 42;\n    double ro_value = 1.25;\n};\nclass RegisteredDerived : public UnregisteredBase {\npublic:\n    using UnregisteredBase::UnregisteredBase;\n    double sum() const { return rw_value + ro_value; }\n};\n\n// Test explicit lvalue ref-qualification\nstruct RefQualified {\n    int value = 0;\n\n    void refQualified(int other) & { value += other; }\n    int constRefQualified(int other) const & { return value + other; }\n};\n\n// Test rvalue ref param\nstruct RValueRefParam {\n    std::size_t func1(std::string &&s) { return s.size(); }\n    std::size_t func2(std::string &&s) const { return s.size(); }\n    std::size_t func3(std::string &&s) & { return s.size(); }\n    std::size_t func4(std::string &&s) const & { return s.size(); }\n};\n\nTEST_SUBMODULE(methods_and_attributes, m) {\n    // test_methods_and_attributes\n    py::class_<ExampleMandA> emna(m, \"ExampleMandA\");\n    emna.def(py::init<>())\n        .def(py::init<int>())\n        .def(py::init<std::string &&>())\n        .def(py::init<const ExampleMandA &>())\n        .def(\"add1\", &ExampleMandA::add1)\n        .def(\"add2\", &ExampleMandA::add2)\n        .def(\"add3\", &ExampleMandA::add3)\n        .def(\"add4\", &ExampleMandA::add4)\n        .def(\"add5\", &ExampleMandA::add5)\n        .def(\"add6\", &ExampleMandA::add6)\n        .def(\"add7\", &ExampleMandA::add7)\n        .def(\"add8\", &ExampleMandA::add8)\n        .def(\"add9\", &ExampleMandA::add9)\n        .def(\"add10\", &ExampleMandA::add10)\n        .def(\"consume_str\", &ExampleMandA::consume_str)\n        .def(\"self1\", &ExampleMandA::self1)\n        .def(\"self2\", &ExampleMandA::self2)\n        .def(\"self3\", &ExampleMandA::self3)\n        .def(\"self4\", &ExampleMandA::self4)\n        .def(\"self5\", &ExampleMandA::self5)\n        .def(\"internal1\", &ExampleMandA::internal1)\n        .def(\"internal2\", &ExampleMandA::internal2)\n        .def(\"internal3\", &ExampleMandA::internal3)\n        .def(\"internal4\", &ExampleMandA::internal4)\n        .def(\"internal5\", &ExampleMandA::internal5)\n#if defined(PYBIND11_OVERLOAD_CAST)\n        .def(\"overloaded\", py::overload_cast<>(&ExampleMandA::overloaded))\n        .def(\"overloaded\", py::overload_cast<int>(&ExampleMandA::overloaded))\n        .def(\"overloaded\", py::overload_cast<int, float>(&ExampleMandA::overloaded))\n        .def(\"overloaded\", py::overload_cast<float, int>(&ExampleMandA::overloaded))\n        .def(\"overloaded\", py::overload_cast<int, int>(&ExampleMandA::overloaded))\n        .def(\"overloaded\", py::overload_cast<float, float>(&ExampleMandA::overloaded))\n        .def(\"overloaded_float\", py::overload_cast<float, float>(&ExampleMandA::overloaded))\n        .def(\"overloaded_const\", py::overload_cast<int>(&ExampleMandA::overloaded, py::const_))\n        .def(\"overloaded_const\",\n             py::overload_cast<int, float>(&ExampleMandA::overloaded, py::const_))\n        .def(\"overloaded_const\",\n             py::overload_cast<float, int>(&ExampleMandA::overloaded, py::const_))\n        .def(\"overloaded_const\",\n             py::overload_cast<int, int>(&ExampleMandA::overloaded, py::const_))\n        .def(\"overloaded_const\",\n             py::overload_cast<float, float>(&ExampleMandA::overloaded, py::const_))\n#else\n        // Use both the traditional static_cast method and the C++11 compatible overload_cast_\n        .def(\"overloaded\", overload_cast_<>()(&ExampleMandA::overloaded))\n        .def(\"overloaded\", overload_cast_<int>()(&ExampleMandA::overloaded))\n        .def(\"overloaded\", overload_cast_<int,   float>()(&ExampleMandA::overloaded))\n        .def(\"overloaded\", static_cast<py::str (ExampleMandA::*)(float,   int)>(&ExampleMandA::overloaded))\n        .def(\"overloaded\", static_cast<py::str (ExampleMandA::*)(int,     int)>(&ExampleMandA::overloaded))\n        .def(\"overloaded\", static_cast<py::str (ExampleMandA::*)(float, float)>(&ExampleMandA::overloaded))\n        .def(\"overloaded_float\", overload_cast_<float, float>()(&ExampleMandA::overloaded))\n        .def(\"overloaded_const\", overload_cast_<int         >()(&ExampleMandA::overloaded, py::const_))\n        .def(\"overloaded_const\", overload_cast_<int,   float>()(&ExampleMandA::overloaded, py::const_))\n        .def(\"overloaded_const\", static_cast<py::str (ExampleMandA::*)(float,   int) const>(&ExampleMandA::overloaded))\n        .def(\"overloaded_const\", static_cast<py::str (ExampleMandA::*)(int,     int) const>(&ExampleMandA::overloaded))\n        .def(\"overloaded_const\", static_cast<py::str (ExampleMandA::*)(float, float) const>(&ExampleMandA::overloaded))\n#endif\n        // test_no_mixed_overloads\n        // Raise error if trying to mix static/non-static overloads on the same name:\n        .def_static(\"add_mixed_overloads1\",\n                    []() {\n                        auto emna = py::reinterpret_borrow<py::class_<ExampleMandA>>(\n                            py::module_::import(\"pybind11_tests.methods_and_attributes\")\n                                .attr(\"ExampleMandA\"));\n                        emna.def(\"overload_mixed1\",\n                                 static_cast<py::str (ExampleMandA::*)(int, int)>(\n                                     &ExampleMandA::overloaded))\n                            .def_static(\n                                \"overload_mixed1\",\n                                static_cast<py::str (*)(float)>(&ExampleMandA::overloaded));\n                    })\n        .def_static(\"add_mixed_overloads2\",\n                    []() {\n                        auto emna = py::reinterpret_borrow<py::class_<ExampleMandA>>(\n                            py::module_::import(\"pybind11_tests.methods_and_attributes\")\n                                .attr(\"ExampleMandA\"));\n                        emna.def_static(\"overload_mixed2\",\n                                        static_cast<py::str (*)(float)>(&ExampleMandA::overloaded))\n                            .def(\"overload_mixed2\",\n                                 static_cast<py::str (ExampleMandA::*)(int, int)>(\n                                     &ExampleMandA::overloaded));\n                    })\n        .def(\"__str__\", &ExampleMandA::toString)\n        .def_readwrite(\"value\", &ExampleMandA::value);\n\n    // test_copy_method\n    // Issue #443: can't call copied methods in Python 3\n    emna.attr(\"add2b\") = emna.attr(\"add2\");\n\n    // test_properties, test_static_properties, test_static_cls\n    py::class_<TestProperties>(m, \"TestProperties\")\n        .def(py::init<>())\n        .def_readonly(\"def_readonly\", &TestProperties::value)\n        .def_readwrite(\"def_readwrite\", &TestProperties::value)\n        .def_property(\"def_writeonly\", nullptr, [](TestProperties &s, int v) { s.value = v; })\n        .def_property(\"def_property_writeonly\", nullptr, &TestProperties::set)\n        .def_property_readonly(\"def_property_readonly\", &TestProperties::get)\n        .def_property(\"def_property\", &TestProperties::get, &TestProperties::set)\n        .def_property(\"def_property_impossible\", nullptr, nullptr)\n        .def_readonly_static(\"def_readonly_static\", &TestProperties::static_value)\n        .def_readwrite_static(\"def_readwrite_static\", &TestProperties::static_value)\n        .def_property_static(\"def_writeonly_static\",\n                             nullptr,\n                             [](const py::object &, int v) { TestProperties::static_value = v; })\n        .def_property_readonly_static(\n            \"def_property_readonly_static\",\n            [](const py::object &) { return TestProperties::static_get(); })\n        .def_property_static(\n            \"def_property_writeonly_static\",\n            nullptr,\n            [](const py::object &, int v) { return TestProperties::static_set(v); })\n        .def_property_static(\n            \"def_property_static\",\n            [](const py::object &) { return TestProperties::static_get(); },\n            [](const py::object &, int v) { TestProperties::static_set(v); })\n        .def_property_static(\n            \"static_cls\",\n            [](py::object cls) { return cls; },\n            [](const py::object &cls, const py::function &f) { f(cls); });\n\n    py::class_<TestPropertiesOverride, TestProperties>(m, \"TestPropertiesOverride\")\n        .def(py::init<>())\n        .def_readonly(\"def_readonly\", &TestPropertiesOverride::value)\n        .def_readonly_static(\"def_readonly_static\", &TestPropertiesOverride::static_value);\n\n    auto static_get1 = [](const py::object &) -> const UserType & { return TestPropRVP::sv1; };\n    auto static_get2 = [](const py::object &) -> const UserType & { return TestPropRVP::sv2; };\n    auto static_set1 = [](const py::object &, int v) { TestPropRVP::sv1.set(v); };\n    auto static_set2 = [](const py::object &, int v) { TestPropRVP::sv2.set(v); };\n    auto rvp_copy = py::return_value_policy::copy;\n\n    // test_property_return_value_policies\n    py::class_<TestPropRVP>(m, \"TestPropRVP\")\n        .def(py::init<>())\n        .def_property_readonly(\"ro_ref\", &TestPropRVP::get1)\n        .def_property_readonly(\"ro_copy\", &TestPropRVP::get2, rvp_copy)\n        .def_property_readonly(\"ro_func\", py::cpp_function(&TestPropRVP::get2, rvp_copy))\n        .def_property(\"rw_ref\", &TestPropRVP::get1, &TestPropRVP::set1)\n        .def_property(\"rw_copy\", &TestPropRVP::get2, &TestPropRVP::set2, rvp_copy)\n        .def_property(\n            \"rw_func\", py::cpp_function(&TestPropRVP::get2, rvp_copy), &TestPropRVP::set2)\n        .def_property_readonly_static(\"static_ro_ref\", static_get1)\n        .def_property_readonly_static(\"static_ro_copy\", static_get2, rvp_copy)\n        .def_property_readonly_static(\"static_ro_func\", py::cpp_function(static_get2, rvp_copy))\n        .def_property_static(\"static_rw_ref\", static_get1, static_set1)\n        .def_property_static(\"static_rw_copy\", static_get2, static_set2, rvp_copy)\n        .def_property_static(\n            \"static_rw_func\", py::cpp_function(static_get2, rvp_copy), static_set2)\n        // test_property_rvalue_policy\n        .def_property_readonly(\"rvalue\", &TestPropRVP::get_rvalue)\n        .def_property_readonly_static(\"static_rvalue\",\n                                      [](const py::object &) { return UserType(1); });\n\n    // test_metaclass_override\n    struct MetaclassOverride {};\n    py::class_<MetaclassOverride>(m, \"MetaclassOverride\", py::metaclass((PyObject *) &PyType_Type))\n        .def_property_readonly_static(\"readonly\", [](const py::object &) { return 1; });\n\n    // test_overload_ordering\n    m.def(\"overload_order\", [](const std::string &) { return 1; });\n    m.def(\"overload_order\", [](const std::string &) { return 2; });\n    m.def(\"overload_order\", [](int) { return 3; });\n    m.def(\n        \"overload_order\", [](int) { return 4; }, py::prepend{});\n\n#if !defined(PYPY_VERSION)\n    // test_dynamic_attributes\n    class DynamicClass {\n    public:\n        DynamicClass() { print_default_created(this); }\n        DynamicClass(const DynamicClass &) = delete;\n        ~DynamicClass() { print_destroyed(this); }\n    };\n    py::class_<DynamicClass>(m, \"DynamicClass\", py::dynamic_attr()).def(py::init());\n\n    class CppDerivedDynamicClass : public DynamicClass {};\n    py::class_<CppDerivedDynamicClass, DynamicClass>(m, \"CppDerivedDynamicClass\").def(py::init());\n#endif\n\n    // test_bad_arg_default\n    // Issue/PR #648: bad arg default debugging output\n#if defined(PYBIND11_DETAILED_ERROR_MESSAGES)\n    m.attr(\"detailed_error_messages_enabled\") = true;\n#else\n    m.attr(\"detailed_error_messages_enabled\") = false;\n#endif\n    m.def(\"bad_arg_def_named\", [] {\n        auto m = py::module_::import(\"pybind11_tests\");\n        m.def(\n            \"should_fail\",\n            [](int, UnregisteredType) {},\n            py::arg(),\n            py::arg(\"a\") = UnregisteredType());\n    });\n    m.def(\"bad_arg_def_unnamed\", [] {\n        auto m = py::module_::import(\"pybind11_tests\");\n        m.def(\n            \"should_fail\",\n            [](int, UnregisteredType) {},\n            py::arg(),\n            py::arg() = UnregisteredType());\n    });\n\n    // [workaround(intel)] ICC 20/21 breaks with py::arg().stuff, using py::arg{}.stuff works.\n\n    // test_accepts_none\n    py::class_<NoneTester, std::shared_ptr<NoneTester>>(m, \"NoneTester\").def(py::init<>());\n    m.def(\"no_none1\", &none1, py::arg{}.none(false));\n    m.def(\"no_none2\", &none2, py::arg{}.none(false));\n    m.def(\"no_none3\", &none3, py::arg{}.none(false));\n    m.def(\"no_none4\", &none4, py::arg{}.none(false));\n    m.def(\"no_none5\", &none5, py::arg{}.none(false));\n    m.def(\"ok_none1\", &none1);\n    m.def(\"ok_none2\", &none2, py::arg{}.none(true));\n    m.def(\"ok_none3\", &none3);\n    m.def(\"ok_none4\", &none4, py::arg{}.none(true));\n    m.def(\"ok_none5\", &none5);\n\n    m.def(\"no_none_kwarg\", &none2, \"a\"_a.none(false));\n    m.def(\"no_none_kwarg_kw_only\", &none2, py::kw_only(), \"a\"_a.none(false));\n\n    // test_casts_none\n    // Issue #2778: implicit casting from None to object (not pointer)\n    py::class_<NoneCastTester>(m, \"NoneCastTester\")\n        .def(py::init<>())\n        .def(py::init<int>())\n        .def(py::init([](py::none const &) { return NoneCastTester{}; }));\n    py::implicitly_convertible<py::none, NoneCastTester>();\n    m.def(\"ok_obj_or_none\", [](NoneCastTester const &foo) { return foo.answer; });\n\n    // test_str_issue\n    // Issue #283: __str__ called on uninitialized instance when constructor arguments invalid\n    py::class_<StrIssue>(m, \"StrIssue\")\n        .def(py::init<int>())\n        .def(py::init<>())\n        .def(\"__str__\",\n             [](const StrIssue &si) { return \"StrIssue[\" + std::to_string(si.val) + \"]\"; });\n\n    // test_unregistered_base_implementations\n    //\n    // Issues #854/910: incompatible function args when member function/pointer is in unregistered\n    // base class The methods and member pointers below actually resolve to members/pointers in\n    // UnregisteredBase; before this test/fix they would be registered via lambda with a first\n    // argument of an unregistered type, and thus uncallable.\n    py::class_<RegisteredDerived>(m, \"RegisteredDerived\")\n        .def(py::init<>())\n        .def(\"do_nothing\", &RegisteredDerived::do_nothing)\n        .def(\"increase_value\", &RegisteredDerived::increase_value)\n        .def_readwrite(\"rw_value\", &RegisteredDerived::rw_value)\n        .def_readonly(\"ro_value\", &RegisteredDerived::ro_value)\n        // Uncommenting the next line should trigger a static_assert:\n        // .def_readwrite(\"fails\", &UserType::value)\n        // Uncommenting the next line should trigger a static_assert:\n        // .def_readonly(\"fails\", &UserType::value)\n        .def_property(\"rw_value_prop\", &RegisteredDerived::get_int, &RegisteredDerived::set_int)\n        .def_property_readonly(\"ro_value_prop\", &RegisteredDerived::get_double)\n        // This one is in the registered class:\n        .def(\"sum\", &RegisteredDerived::sum);\n\n    using Adapted\n        = decltype(py::method_adaptor<RegisteredDerived>(&RegisteredDerived::do_nothing));\n    static_assert(std::is_same<Adapted, void (RegisteredDerived::*)() const>::value, \"\");\n\n    // test_methods_and_attributes\n    py::class_<RefQualified>(m, \"RefQualified\")\n        .def(py::init<>())\n        .def_readonly(\"value\", &RefQualified::value)\n        .def(\"refQualified\", &RefQualified::refQualified)\n        .def(\"constRefQualified\", &RefQualified::constRefQualified);\n\n    py::class_<RValueRefParam>(m, \"RValueRefParam\")\n        .def(py::init<>())\n        .def(\"func1\", &RValueRefParam::func1)\n        .def(\"func2\", &RValueRefParam::func2)\n        .def(\"func3\", &RValueRefParam::func3)\n        .def(\"func4\", &RValueRefParam::func4);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_methods_and_attributes.py",
    "content": "import sys\n\nimport pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import ConstructorStats\nfrom pybind11_tests import methods_and_attributes as m\n\nNO_GETTER_MSG = (\n    \"unreadable attribute\" if sys.version_info < (3, 11) else \"object has no getter\"\n)\nNO_SETTER_MSG = (\n    \"can't set attribute\" if sys.version_info < (3, 11) else \"object has no setter\"\n)\nNO_DELETER_MSG = (\n    \"can't delete attribute\" if sys.version_info < (3, 11) else \"object has no deleter\"\n)\n\n\ndef test_methods_and_attributes():\n    instance1 = m.ExampleMandA()\n    instance2 = m.ExampleMandA(32)\n\n    instance1.add1(instance2)\n    instance1.add2(instance2)\n    instance1.add3(instance2)\n    instance1.add4(instance2)\n    instance1.add5(instance2)\n    instance1.add6(32)\n    instance1.add7(32)\n    instance1.add8(32)\n    instance1.add9(32)\n    instance1.add10(32)\n\n    assert str(instance1) == \"ExampleMandA[value=320]\"\n    assert str(instance2) == \"ExampleMandA[value=32]\"\n    assert str(instance1.self1()) == \"ExampleMandA[value=320]\"\n    assert str(instance1.self2()) == \"ExampleMandA[value=320]\"\n    assert str(instance1.self3()) == \"ExampleMandA[value=320]\"\n    assert str(instance1.self4()) == \"ExampleMandA[value=320]\"\n    assert str(instance1.self5()) == \"ExampleMandA[value=320]\"\n\n    assert instance1.internal1() == 320\n    assert instance1.internal2() == 320\n    assert instance1.internal3() == 320\n    assert instance1.internal4() == 320\n    assert instance1.internal5() == 320\n\n    assert instance1.overloaded() == \"()\"\n    assert instance1.overloaded(0) == \"(int)\"\n    assert instance1.overloaded(1, 1.0) == \"(int, float)\"\n    assert instance1.overloaded(2.0, 2) == \"(float, int)\"\n    assert instance1.overloaded(3, 3) == \"(int, int)\"\n    assert instance1.overloaded(4.0, 4.0) == \"(float, float)\"\n    assert instance1.overloaded_const(-3) == \"(int) const\"\n    assert instance1.overloaded_const(5, 5.0) == \"(int, float) const\"\n    assert instance1.overloaded_const(6.0, 6) == \"(float, int) const\"\n    assert instance1.overloaded_const(7, 7) == \"(int, int) const\"\n    assert instance1.overloaded_const(8.0, 8.0) == \"(float, float) const\"\n    assert instance1.overloaded_float(1, 1) == \"(float, float)\"\n    assert instance1.overloaded_float(1, 1.0) == \"(float, float)\"\n    assert instance1.overloaded_float(1.0, 1) == \"(float, float)\"\n    assert instance1.overloaded_float(1.0, 1.0) == \"(float, float)\"\n\n    assert instance1.value == 320\n    instance1.value = 100\n    assert str(instance1) == \"ExampleMandA[value=100]\"\n\n    cstats = ConstructorStats.get(m.ExampleMandA)\n    assert cstats.alive() == 2\n    del instance1, instance2\n    assert cstats.alive() == 0\n    assert cstats.values() == [\"32\"]\n    assert cstats.default_constructions == 1\n    assert cstats.copy_constructions == 2\n    assert cstats.move_constructions >= 2\n    assert cstats.copy_assignments == 0\n    assert cstats.move_assignments == 0\n\n\ndef test_copy_method():\n    \"\"\"Issue #443: calling copied methods fails in Python 3\"\"\"\n\n    m.ExampleMandA.add2c = m.ExampleMandA.add2\n    m.ExampleMandA.add2d = m.ExampleMandA.add2b\n    a = m.ExampleMandA(123)\n    assert a.value == 123\n    a.add2(m.ExampleMandA(-100))\n    assert a.value == 23\n    a.add2b(m.ExampleMandA(20))\n    assert a.value == 43\n    a.add2c(m.ExampleMandA(6))\n    assert a.value == 49\n    a.add2d(m.ExampleMandA(-7))\n    assert a.value == 42\n\n\ndef test_properties():\n    instance = m.TestProperties()\n\n    assert instance.def_readonly == 1\n    with pytest.raises(AttributeError):\n        instance.def_readonly = 2\n\n    instance.def_readwrite = 2\n    assert instance.def_readwrite == 2\n\n    assert instance.def_property_readonly == 2\n    with pytest.raises(AttributeError):\n        instance.def_property_readonly = 3\n\n    instance.def_property = 3\n    assert instance.def_property == 3\n\n    with pytest.raises(AttributeError) as excinfo:\n        dummy = instance.def_property_writeonly  # unused var\n    assert NO_GETTER_MSG in str(excinfo.value)\n\n    instance.def_property_writeonly = 4\n    assert instance.def_property_readonly == 4\n\n    with pytest.raises(AttributeError) as excinfo:\n        dummy = instance.def_property_impossible  # noqa: F841 unused var\n    assert NO_GETTER_MSG in str(excinfo.value)\n\n    with pytest.raises(AttributeError) as excinfo:\n        instance.def_property_impossible = 5\n    assert NO_SETTER_MSG in str(excinfo.value)\n\n\ndef test_static_properties():\n    assert m.TestProperties.def_readonly_static == 1\n    with pytest.raises(AttributeError) as excinfo:\n        m.TestProperties.def_readonly_static = 2\n    assert NO_SETTER_MSG in str(excinfo.value)\n\n    m.TestProperties.def_readwrite_static = 2\n    assert m.TestProperties.def_readwrite_static == 2\n\n    with pytest.raises(AttributeError) as excinfo:\n        dummy = m.TestProperties.def_writeonly_static  # unused var\n    assert NO_GETTER_MSG in str(excinfo.value)\n\n    m.TestProperties.def_writeonly_static = 3\n    assert m.TestProperties.def_readonly_static == 3\n\n    assert m.TestProperties.def_property_readonly_static == 3\n    with pytest.raises(AttributeError) as excinfo:\n        m.TestProperties.def_property_readonly_static = 99\n    assert NO_SETTER_MSG in str(excinfo.value)\n\n    m.TestProperties.def_property_static = 4\n    assert m.TestProperties.def_property_static == 4\n\n    with pytest.raises(AttributeError) as excinfo:\n        dummy = m.TestProperties.def_property_writeonly_static\n    assert NO_GETTER_MSG in str(excinfo.value)\n\n    m.TestProperties.def_property_writeonly_static = 5\n    assert m.TestProperties.def_property_static == 5\n\n    # Static property read and write via instance\n    instance = m.TestProperties()\n\n    m.TestProperties.def_readwrite_static = 0\n    assert m.TestProperties.def_readwrite_static == 0\n    assert instance.def_readwrite_static == 0\n\n    instance.def_readwrite_static = 2\n    assert m.TestProperties.def_readwrite_static == 2\n    assert instance.def_readwrite_static == 2\n\n    with pytest.raises(AttributeError) as excinfo:\n        dummy = instance.def_property_writeonly_static  # noqa: F841 unused var\n    assert NO_GETTER_MSG in str(excinfo.value)\n\n    instance.def_property_writeonly_static = 4\n    assert instance.def_property_static == 4\n\n    # It should be possible to override properties in derived classes\n    assert m.TestPropertiesOverride().def_readonly == 99\n    assert m.TestPropertiesOverride.def_readonly_static == 99\n\n    # Only static attributes can be deleted\n    del m.TestPropertiesOverride.def_readonly_static\n    assert (\n        hasattr(m.TestPropertiesOverride, \"def_readonly_static\")\n        and m.TestPropertiesOverride.def_readonly_static\n        is m.TestProperties.def_readonly_static\n    )\n    assert \"def_readonly_static\" not in m.TestPropertiesOverride.__dict__\n    properties_override = m.TestPropertiesOverride()\n    with pytest.raises(AttributeError) as excinfo:\n        del properties_override.def_readonly\n    assert NO_DELETER_MSG in str(excinfo.value)\n\n\ndef test_static_cls():\n    \"\"\"Static property getter and setters expect the type object as the their only argument\"\"\"\n\n    instance = m.TestProperties()\n    assert m.TestProperties.static_cls is m.TestProperties\n    assert instance.static_cls is m.TestProperties\n\n    def check_self(self):\n        assert self is m.TestProperties\n\n    m.TestProperties.static_cls = check_self\n    instance.static_cls = check_self\n\n\ndef test_metaclass_override():\n    \"\"\"Overriding pybind11's default metaclass changes the behavior of `static_property`\"\"\"\n\n    assert type(m.ExampleMandA).__name__ == \"pybind11_type\"\n    assert type(m.MetaclassOverride).__name__ == \"type\"\n\n    assert m.MetaclassOverride.readonly == 1\n    assert (\n        type(m.MetaclassOverride.__dict__[\"readonly\"]).__name__\n        == \"pybind11_static_property\"\n    )\n\n    # Regular `type` replaces the property instead of calling `__set__()`\n    m.MetaclassOverride.readonly = 2\n    assert m.MetaclassOverride.readonly == 2\n    assert isinstance(m.MetaclassOverride.__dict__[\"readonly\"], int)\n\n\ndef test_no_mixed_overloads():\n    from pybind11_tests import detailed_error_messages_enabled\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.ExampleMandA.add_mixed_overloads1()\n    assert str(\n        excinfo.value\n    ) == \"overloading a method with both static and instance methods is not supported; \" + (\n        \"#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for more details\"\n        if not detailed_error_messages_enabled\n        else \"error while attempting to bind static method ExampleMandA.overload_mixed1\"\n        \"(arg0: float) -> str\"\n    )\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.ExampleMandA.add_mixed_overloads2()\n    assert str(\n        excinfo.value\n    ) == \"overloading a method with both static and instance methods is not supported; \" + (\n        \"#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for more details\"\n        if not detailed_error_messages_enabled\n        else \"error while attempting to bind instance method ExampleMandA.overload_mixed2\"\n        \"(self: pybind11_tests.methods_and_attributes.ExampleMandA, arg0: int, arg1: int)\"\n        \" -> str\"\n    )\n\n\n@pytest.mark.parametrize(\"access\", [\"ro\", \"rw\", \"static_ro\", \"static_rw\"])\ndef test_property_return_value_policies(access):\n    if not access.startswith(\"static\"):\n        obj = m.TestPropRVP()\n    else:\n        obj = m.TestPropRVP\n\n    ref = getattr(obj, access + \"_ref\")\n    assert ref.value == 1\n    ref.value = 2\n    assert getattr(obj, access + \"_ref\").value == 2\n    ref.value = 1  # restore original value for static properties\n\n    copy = getattr(obj, access + \"_copy\")\n    assert copy.value == 1\n    copy.value = 2\n    assert getattr(obj, access + \"_copy\").value == 1\n\n    copy = getattr(obj, access + \"_func\")\n    assert copy.value == 1\n    copy.value = 2\n    assert getattr(obj, access + \"_func\").value == 1\n\n\ndef test_property_rvalue_policy():\n    \"\"\"When returning an rvalue, the return value policy is automatically changed from\n    `reference(_internal)` to `move`. The following would not work otherwise.\"\"\"\n\n    instance = m.TestPropRVP()\n    o = instance.rvalue\n    assert o.value == 1\n\n    os = m.TestPropRVP.static_rvalue\n    assert os.value == 1\n\n\n# https://foss.heptapod.net/pypy/pypy/-/issues/2447\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_dynamic_attributes():\n    instance = m.DynamicClass()\n    assert not hasattr(instance, \"foo\")\n    assert \"foo\" not in dir(instance)\n\n    # Dynamically add attribute\n    instance.foo = 42\n    assert hasattr(instance, \"foo\")\n    assert instance.foo == 42\n    assert \"foo\" in dir(instance)\n\n    # __dict__ should be accessible and replaceable\n    assert \"foo\" in instance.__dict__\n    instance.__dict__ = {\"bar\": True}\n    assert not hasattr(instance, \"foo\")\n    assert hasattr(instance, \"bar\")\n\n    with pytest.raises(TypeError) as excinfo:\n        instance.__dict__ = []\n    assert str(excinfo.value) == \"__dict__ must be set to a dictionary, not a 'list'\"\n\n    cstats = ConstructorStats.get(m.DynamicClass)\n    assert cstats.alive() == 1\n    del instance\n    assert cstats.alive() == 0\n\n    # Derived classes should work as well\n    class PythonDerivedDynamicClass(m.DynamicClass):\n        pass\n\n    for cls in m.CppDerivedDynamicClass, PythonDerivedDynamicClass:\n        derived = cls()\n        derived.foobar = 100\n        assert derived.foobar == 100\n\n        assert cstats.alive() == 1\n        del derived\n        assert cstats.alive() == 0\n\n\n# https://foss.heptapod.net/pypy/pypy/-/issues/2447\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_cyclic_gc():\n    # One object references itself\n    instance = m.DynamicClass()\n    instance.circular_reference = instance\n\n    cstats = ConstructorStats.get(m.DynamicClass)\n    assert cstats.alive() == 1\n    del instance\n    assert cstats.alive() == 0\n\n    # Two object reference each other\n    i1 = m.DynamicClass()\n    i2 = m.DynamicClass()\n    i1.cycle = i2\n    i2.cycle = i1\n\n    assert cstats.alive() == 2\n    del i1, i2\n    assert cstats.alive() == 0\n\n\ndef test_bad_arg_default(msg):\n    from pybind11_tests import detailed_error_messages_enabled\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.bad_arg_def_named()\n    assert msg(excinfo.value) == (\n        \"arg(): could not convert default argument 'a: UnregisteredType' in function \"\n        \"'should_fail' into a Python object (type not registered yet?)\"\n        if detailed_error_messages_enabled\n        else \"arg(): could not convert default argument into a Python object (type not registered \"\n        \"yet?). #define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for more information.\"\n    )\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.bad_arg_def_unnamed()\n    assert msg(excinfo.value) == (\n        \"arg(): could not convert default argument 'UnregisteredType' in function \"\n        \"'should_fail' into a Python object (type not registered yet?)\"\n        if detailed_error_messages_enabled\n        else \"arg(): could not convert default argument into a Python object (type not registered \"\n        \"yet?). #define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for more information.\"\n    )\n\n\ndef test_accepts_none(msg):\n    a = m.NoneTester()\n    assert m.no_none1(a) == 42\n    assert m.no_none2(a) == 42\n    assert m.no_none3(a) == 42\n    assert m.no_none4(a) == 42\n    assert m.no_none5(a) == 42\n    assert m.ok_none1(a) == 42\n    assert m.ok_none2(a) == 42\n    assert m.ok_none3(a) == 42\n    assert m.ok_none4(a) == 42\n    assert m.ok_none5(a) == 42\n\n    with pytest.raises(TypeError) as excinfo:\n        m.no_none1(None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.no_none2(None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.no_none3(None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.no_none4(None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.no_none5(None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    # The first one still raises because you can't pass None as a lvalue reference arg:\n    with pytest.raises(TypeError) as excinfo:\n        assert m.ok_none1(None) == -1\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        ok_none1(): incompatible function arguments. The following argument types are supported:\n            1. (arg0: m.methods_and_attributes.NoneTester) -> int\n\n        Invoked with: None\n    \"\"\"\n    )\n\n    # The rest take the argument as pointer or holder, and accept None:\n    assert m.ok_none2(None) == -1\n    assert m.ok_none3(None) == -1\n    assert m.ok_none4(None) == -1\n    assert m.ok_none5(None) == -1\n\n    with pytest.raises(TypeError) as excinfo:\n        m.no_none_kwarg(None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.no_none_kwarg(a=None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.no_none_kwarg_kw_only(None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    with pytest.raises(TypeError) as excinfo:\n        m.no_none_kwarg_kw_only(a=None)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n\ndef test_casts_none():\n    \"\"\"#2778: implicit casting from None to object (not pointer)\"\"\"\n    a = m.NoneCastTester()\n    assert m.ok_obj_or_none(a) == -1\n    a = m.NoneCastTester(4)\n    assert m.ok_obj_or_none(a) == 4\n    a = m.NoneCastTester(None)\n    assert m.ok_obj_or_none(a) == -1\n    assert m.ok_obj_or_none(None) == -1\n\n\ndef test_str_issue(msg):\n    \"\"\"#283: __str__ called on uninitialized instance when constructor arguments invalid\"\"\"\n\n    assert str(m.StrIssue(3)) == \"StrIssue[3]\"\n\n    with pytest.raises(TypeError) as excinfo:\n        str(m.StrIssue(\"no\", \"such\", \"constructor\"))\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        __init__(): incompatible constructor arguments. The following argument types are supported:\n            1. m.methods_and_attributes.StrIssue(arg0: int)\n            2. m.methods_and_attributes.StrIssue()\n\n        Invoked with: 'no', 'such', 'constructor'\n    \"\"\"\n    )\n\n\ndef test_unregistered_base_implementations():\n    a = m.RegisteredDerived()\n    a.do_nothing()\n    assert a.rw_value == 42\n    assert a.ro_value == 1.25\n    a.rw_value += 5\n    assert a.sum() == 48.25\n    a.increase_value()\n    assert a.rw_value == 48\n    assert a.ro_value == 1.5\n    assert a.sum() == 49.5\n    assert a.rw_value_prop == 48\n    a.rw_value_prop += 1\n    assert a.rw_value_prop == 49\n    a.increase_value()\n    assert a.ro_value_prop == 1.75\n\n\ndef test_ref_qualified():\n    \"\"\"Tests that explicit lvalue ref-qualified methods can be called just like their\n    non ref-qualified counterparts.\"\"\"\n\n    r = m.RefQualified()\n    assert r.value == 0\n    r.refQualified(17)\n    assert r.value == 17\n    assert r.constRefQualified(23) == 40\n\n\ndef test_overload_ordering():\n    \"Check to see if the normal overload order (first defined) and prepend overload order works\"\n    assert m.overload_order(\"string\") == 1\n    assert m.overload_order(0) == 4\n\n    assert \"1. overload_order(arg0: int) -> int\" in m.overload_order.__doc__\n    assert \"2. overload_order(arg0: str) -> int\" in m.overload_order.__doc__\n    assert \"3. overload_order(arg0: str) -> int\" in m.overload_order.__doc__\n    assert \"4. overload_order(arg0: int) -> int\" in m.overload_order.__doc__\n\n    with pytest.raises(TypeError) as err:\n        m.overload_order(1.1)\n\n    assert \"1. (arg0: int) -> int\" in str(err.value)\n    assert \"2. (arg0: str) -> int\" in str(err.value)\n    assert \"3. (arg0: str) -> int\" in str(err.value)\n    assert \"4. (arg0: int) -> int\" in str(err.value)\n\n\ndef test_rvalue_ref_param():\n    r = m.RValueRefParam()\n    assert r.func1(\"123\") == 3\n    assert r.func2(\"1234\") == 4\n    assert r.func3(\"12345\") == 5\n    assert r.func4(\"123456\") == 6\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_modules.cpp",
    "content": "/*\n    tests/test_modules.cpp -- nested modules, importing modules, and\n                            internal references\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\nTEST_SUBMODULE(modules, m) {\n    // test_nested_modules\n    // This is intentionally \"py::module\" to verify it still can be used in place of \"py::module_\"\n    py::module m_sub = m.def_submodule(\"subsubmodule\");\n    m_sub.def(\"submodule_func\", []() { return \"submodule_func()\"; });\n\n    // test_reference_internal\n    class A {\n    public:\n        explicit A(int v) : v(v) { print_created(this, v); }\n        ~A() { print_destroyed(this); }\n        A(const A &) { print_copy_created(this); }\n        A &operator=(const A &copy) {\n            print_copy_assigned(this);\n            v = copy.v;\n            return *this;\n        }\n        std::string toString() const { return \"A[\" + std::to_string(v) + \"]\"; }\n\n    private:\n        int v;\n    };\n    py::class_<A>(m_sub, \"A\").def(py::init<int>()).def(\"__repr__\", &A::toString);\n\n    class B {\n    public:\n        B() { print_default_created(this); }\n        ~B() { print_destroyed(this); }\n        B(const B &) { print_copy_created(this); }\n        B &operator=(const B &copy) {\n            print_copy_assigned(this);\n            a1 = copy.a1;\n            a2 = copy.a2;\n            return *this;\n        }\n        A &get_a1() { return a1; }\n        A &get_a2() { return a2; }\n\n        A a1{1};\n        A a2{2};\n    };\n    py::class_<B>(m_sub, \"B\")\n        .def(py::init<>())\n        .def(\"get_a1\",\n             &B::get_a1,\n             \"Return the internal A 1\",\n             py::return_value_policy::reference_internal)\n        .def(\"get_a2\",\n             &B::get_a2,\n             \"Return the internal A 2\",\n             py::return_value_policy::reference_internal)\n        .def_readwrite(\"a1\", &B::a1) // def_readonly uses an internal\n                                     // reference return policy by default\n        .def_readwrite(\"a2\", &B::a2);\n\n    // This is intentionally \"py::module\" to verify it still can be used in place of \"py::module_\"\n    m.attr(\"OD\") = py::module::import(\"collections\").attr(\"OrderedDict\");\n\n    // test_duplicate_registration\n    // Registering two things with the same name\n    m.def(\"duplicate_registration\", []() {\n        class Dupe1 {};\n        class Dupe2 {};\n        class Dupe3 {};\n        class DupeException {};\n\n        // Go ahead and leak, until we have a non-leaking py::module_ constructor\n        auto dm\n            = py::module_::create_extension_module(\"dummy\", nullptr, new py::module_::module_def);\n        auto failures = py::list();\n\n        py::class_<Dupe1>(dm, \"Dupe1\");\n        py::class_<Dupe2>(dm, \"Dupe2\");\n        dm.def(\"dupe1_factory\", []() { return Dupe1(); });\n        py::exception<DupeException>(dm, \"DupeException\");\n\n        try {\n            py::class_<Dupe1>(dm, \"Dupe1\");\n            failures.append(\"Dupe1 class\");\n        } catch (std::runtime_error &) {\n        }\n        try {\n            dm.def(\"Dupe1\", []() { return Dupe1(); });\n            failures.append(\"Dupe1 function\");\n        } catch (std::runtime_error &) {\n        }\n        try {\n            py::class_<Dupe3>(dm, \"dupe1_factory\");\n            failures.append(\"dupe1_factory\");\n        } catch (std::runtime_error &) {\n        }\n        try {\n            py::exception<Dupe3>(dm, \"Dupe2\");\n            failures.append(\"Dupe2\");\n        } catch (std::runtime_error &) {\n        }\n        try {\n            dm.def(\"DupeException\", []() { return 30; });\n            failures.append(\"DupeException1\");\n        } catch (std::runtime_error &) {\n        }\n        try {\n            py::class_<DupeException>(dm, \"DupeException\");\n            failures.append(\"DupeException2\");\n        } catch (std::runtime_error &) {\n        }\n\n        return failures;\n    });\n\n    m.def(\"def_submodule\", [](py::module_ m, const char *name) { return m.def_submodule(name); });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_modules.py",
    "content": "import pytest\n\nimport env\nfrom pybind11_tests import ConstructorStats\nfrom pybind11_tests import modules as m\nfrom pybind11_tests.modules import subsubmodule as ms\n\n\ndef test_nested_modules():\n    import pybind11_tests\n\n    assert pybind11_tests.__name__ == \"pybind11_tests\"\n    assert pybind11_tests.modules.__name__ == \"pybind11_tests.modules\"\n    assert (\n        pybind11_tests.modules.subsubmodule.__name__\n        == \"pybind11_tests.modules.subsubmodule\"\n    )\n    assert m.__name__ == \"pybind11_tests.modules\"\n    assert ms.__name__ == \"pybind11_tests.modules.subsubmodule\"\n\n    assert ms.submodule_func() == \"submodule_func()\"\n\n\ndef test_reference_internal():\n    b = ms.B()\n    assert str(b.get_a1()) == \"A[1]\"\n    assert str(b.a1) == \"A[1]\"\n    assert str(b.get_a2()) == \"A[2]\"\n    assert str(b.a2) == \"A[2]\"\n\n    b.a1 = ms.A(42)\n    b.a2 = ms.A(43)\n    assert str(b.get_a1()) == \"A[42]\"\n    assert str(b.a1) == \"A[42]\"\n    assert str(b.get_a2()) == \"A[43]\"\n    assert str(b.a2) == \"A[43]\"\n\n    astats, bstats = ConstructorStats.get(ms.A), ConstructorStats.get(ms.B)\n    assert astats.alive() == 2\n    assert bstats.alive() == 1\n    del b\n    assert astats.alive() == 0\n    assert bstats.alive() == 0\n    assert astats.values() == [\"1\", \"2\", \"42\", \"43\"]\n    assert bstats.values() == []\n    assert astats.default_constructions == 0\n    assert bstats.default_constructions == 1\n    assert astats.copy_constructions == 0\n    assert bstats.copy_constructions == 0\n    # assert astats.move_constructions >= 0  # Don't invoke any\n    # assert bstats.move_constructions >= 0  # Don't invoke any\n    assert astats.copy_assignments == 2\n    assert bstats.copy_assignments == 0\n    assert astats.move_assignments == 0\n    assert bstats.move_assignments == 0\n\n\ndef test_importing():\n    from collections import OrderedDict\n\n    from pybind11_tests.modules import OD\n\n    assert OD is OrderedDict\n    assert str(OD([(1, \"a\"), (2, \"b\")])) == \"OrderedDict([(1, 'a'), (2, 'b')])\"\n\n\ndef test_pydoc():\n    \"\"\"Pydoc needs to be able to provide help() for everything inside a pybind11 module\"\"\"\n    import pydoc\n\n    import pybind11_tests\n\n    assert pybind11_tests.__name__ == \"pybind11_tests\"\n    assert pybind11_tests.__doc__ == \"pybind11 test module\"\n    assert pydoc.text.docmodule(pybind11_tests)\n\n\ndef test_duplicate_registration():\n    \"\"\"Registering two things with the same name\"\"\"\n\n    assert m.duplicate_registration() == []\n\n\ndef test_builtin_key_type():\n    \"\"\"Test that all the keys in the builtin modules have type str.\n\n    Previous versions of pybind11 would add a unicode key in python 2.\n    \"\"\"\n    if hasattr(__builtins__, \"keys\"):\n        keys = __builtins__.keys()\n    else:  # this is to make pypy happy since builtins is different there.\n        keys = __builtins__.__dict__.keys()\n\n    assert {type(k) for k in keys} == {str}\n\n\n@pytest.mark.xfail(\"env.PYPY\", reason=\"PyModule_GetName()\")\ndef test_def_submodule_failures():\n    sm = m.def_submodule(m, b\"ScratchSubModuleName\")  # Using bytes to show it works.\n    assert sm.__name__ == m.__name__ + \".\" + \"ScratchSubModuleName\"\n    malformed_utf8 = b\"\\x80\"\n    if env.PYPY:\n        # It is not worth the effort finding a trigger for a failure when running with PyPy.\n        pytest.skip(\"Sufficiently exercised on platforms other than PyPy.\")\n    else:\n        # Meant to trigger PyModule_GetName() failure:\n        sm_name_orig = sm.__name__\n        sm.__name__ = malformed_utf8\n        try:\n            # We want to assert that a bad __name__ causes some kind of failure, although we do not want to exercise\n            # the internals of PyModule_GetName(). Currently all supported Python versions raise SystemError. If that\n            # changes in future Python versions, simply add the new expected exception types here.\n            with pytest.raises(SystemError):\n                m.def_submodule(sm, b\"SubSubModuleName\")\n        finally:\n            # Clean up to ensure nothing gets upset by a module with an invalid __name__.\n            sm.__name__ = sm_name_orig  # Purely precautionary.\n    # Meant to trigger PyImport_AddModule() failure:\n    with pytest.raises(UnicodeDecodeError):\n        m.def_submodule(sm, malformed_utf8)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_multiple_inheritance.cpp",
    "content": "/*\n    tests/test_multiple_inheritance.cpp -- multiple inheritance,\n    implicit MI casts\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\nnamespace {\n\n// Many bases for testing that multiple inheritance from many classes (i.e. requiring extra\n// space for holder constructed flags) works.\ntemplate <int N>\nstruct BaseN {\n    explicit BaseN(int i) : i(i) {}\n    int i;\n};\n\n// test_mi_static_properties\nstruct Vanilla {\n    std::string vanilla() { return \"Vanilla\"; };\n};\nstruct WithStatic1 {\n    static std::string static_func1() { return \"WithStatic1\"; };\n    static int static_value1;\n};\nstruct WithStatic2 {\n    static std::string static_func2() { return \"WithStatic2\"; };\n    static int static_value2;\n};\nstruct VanillaStaticMix1 : Vanilla, WithStatic1, WithStatic2 {\n    static std::string static_func() { return \"VanillaStaticMix1\"; }\n    static int static_value;\n};\nstruct VanillaStaticMix2 : WithStatic1, Vanilla, WithStatic2 {\n    static std::string static_func() { return \"VanillaStaticMix2\"; }\n    static int static_value;\n};\nint WithStatic1::static_value1 = 1;\nint WithStatic2::static_value2 = 2;\nint VanillaStaticMix1::static_value = 12;\nint VanillaStaticMix2::static_value = 12;\n\n// test_multiple_inheritance_virtbase\nstruct Base1a {\n    explicit Base1a(int i) : i(i) {}\n    int foo() const { return i; }\n    int i;\n};\nstruct Base2a {\n    explicit Base2a(int i) : i(i) {}\n    int bar() const { return i; }\n    int i;\n};\nstruct Base12a : Base1a, Base2a {\n    Base12a(int i, int j) : Base1a(i), Base2a(j) {}\n};\n\n// test_mi_unaligned_base\n// test_mi_base_return\nstruct I801B1 {\n    int a = 1;\n    I801B1() = default;\n    I801B1(const I801B1 &) = default;\n    virtual ~I801B1() = default;\n};\nstruct I801B2 {\n    int b = 2;\n    I801B2() = default;\n    I801B2(const I801B2 &) = default;\n    virtual ~I801B2() = default;\n};\nstruct I801C : I801B1, I801B2 {};\nstruct I801D : I801C {}; // Indirect MI\n\n} // namespace\n\nTEST_SUBMODULE(multiple_inheritance, m) {\n    // Please do not interleave `struct` and `class` definitions with bindings code,\n    // but implement `struct`s and `class`es in the anonymous namespace above.\n    // This helps keeping the smart_holder branch in sync with master.\n\n    // test_multiple_inheritance_mix1\n    // test_multiple_inheritance_mix2\n    struct Base1 {\n        explicit Base1(int i) : i(i) {}\n        int foo() const { return i; }\n        int i;\n    };\n    py::class_<Base1> b1(m, \"Base1\");\n    b1.def(py::init<int>()).def(\"foo\", &Base1::foo);\n\n    struct Base2 {\n        explicit Base2(int i) : i(i) {}\n        int bar() const { return i; }\n        int i;\n    };\n    py::class_<Base2> b2(m, \"Base2\");\n    b2.def(py::init<int>()).def(\"bar\", &Base2::bar);\n\n    // test_multiple_inheritance_cpp\n    struct Base12 : Base1, Base2 {\n        Base12(int i, int j) : Base1(i), Base2(j) {}\n    };\n    struct MIType : Base12 {\n        MIType(int i, int j) : Base12(i, j) {}\n    };\n    py::class_<Base12, Base1, Base2>(m, \"Base12\");\n    py::class_<MIType, Base12>(m, \"MIType\").def(py::init<int, int>());\n\n    // test_multiple_inheritance_python_many_bases\n#define PYBIND11_BASEN(N)                                                                         \\\n    py::class_<BaseN<(N)>>(m, \"BaseN\" #N).def(py::init<int>()).def(\"f\" #N, [](BaseN<N> &b) {      \\\n        return b.i + (N);                                                                         \\\n    })\n    PYBIND11_BASEN(1);\n    PYBIND11_BASEN(2);\n    PYBIND11_BASEN(3);\n    PYBIND11_BASEN(4);\n    PYBIND11_BASEN(5);\n    PYBIND11_BASEN(6);\n    PYBIND11_BASEN(7);\n    PYBIND11_BASEN(8);\n    PYBIND11_BASEN(9);\n    PYBIND11_BASEN(10);\n    PYBIND11_BASEN(11);\n    PYBIND11_BASEN(12);\n    PYBIND11_BASEN(13);\n    PYBIND11_BASEN(14);\n    PYBIND11_BASEN(15);\n    PYBIND11_BASEN(16);\n    PYBIND11_BASEN(17);\n\n    // Uncommenting this should result in a compile time failure (MI can only be specified via\n    // template parameters because pybind has to know the types involved; see discussion in #742\n    // for details).\n    //    struct Base12v2 : Base1, Base2 {\n    //        Base12v2(int i, int j) : Base1(i), Base2(j) { }\n    //    };\n    //    py::class_<Base12v2>(m, \"Base12v2\", b1, b2)\n    //        .def(py::init<int, int>());\n\n    // test_multiple_inheritance_virtbase\n    // Test the case where not all base classes are specified, and where pybind11 requires the\n    // py::multiple_inheritance flag to perform proper casting between types.\n    py::class_<Base1a, std::shared_ptr<Base1a>>(m, \"Base1a\")\n        .def(py::init<int>())\n        .def(\"foo\", &Base1a::foo);\n\n    py::class_<Base2a, std::shared_ptr<Base2a>>(m, \"Base2a\")\n        .def(py::init<int>())\n        .def(\"bar\", &Base2a::bar);\n\n    py::class_<Base12a, /* Base1 missing */ Base2a, std::shared_ptr<Base12a>>(\n        m, \"Base12a\", py::multiple_inheritance())\n        .def(py::init<int, int>());\n\n    m.def(\"bar_base2a\", [](Base2a *b) { return b->bar(); });\n    m.def(\"bar_base2a_sharedptr\", [](const std::shared_ptr<Base2a> &b) { return b->bar(); });\n\n    // test_mi_unaligned_base\n    // test_mi_base_return\n    // Issue #801: invalid casting to derived type with MI bases\n    // Unregistered classes:\n    struct I801B3 {\n        int c = 3;\n        virtual ~I801B3() = default;\n    };\n    struct I801E : I801B3, I801D {};\n\n    py::class_<I801B1, std::shared_ptr<I801B1>>(m, \"I801B1\")\n        .def(py::init<>())\n        .def_readonly(\"a\", &I801B1::a);\n    py::class_<I801B2, std::shared_ptr<I801B2>>(m, \"I801B2\")\n        .def(py::init<>())\n        .def_readonly(\"b\", &I801B2::b);\n    py::class_<I801C, I801B1, I801B2, std::shared_ptr<I801C>>(m, \"I801C\").def(py::init<>());\n    py::class_<I801D, I801C, std::shared_ptr<I801D>>(m, \"I801D\").def(py::init<>());\n\n    // Two separate issues here: first, we want to recognize a pointer to a base type as being a\n    // known instance even when the pointer value is unequal (i.e. due to a non-first\n    // multiple-inheritance base class):\n    m.def(\"i801b1_c\", [](I801C *c) { return static_cast<I801B1 *>(c); });\n    m.def(\"i801b2_c\", [](I801C *c) { return static_cast<I801B2 *>(c); });\n    m.def(\"i801b1_d\", [](I801D *d) { return static_cast<I801B1 *>(d); });\n    m.def(\"i801b2_d\", [](I801D *d) { return static_cast<I801B2 *>(d); });\n\n    // Second, when returned a base class pointer to a derived instance, we cannot assume that the\n    // pointer is `reinterpret_cast`able to the derived pointer because, like above, the base class\n    // pointer could be offset.\n    m.def(\"i801c_b1\", []() -> I801B1 * { return new I801C(); });\n    m.def(\"i801c_b2\", []() -> I801B2 * { return new I801C(); });\n    m.def(\"i801d_b1\", []() -> I801B1 * { return new I801D(); });\n    m.def(\"i801d_b2\", []() -> I801B2 * { return new I801D(); });\n\n    // Return a base class pointer to a pybind-registered type when the actual derived type\n    // isn't pybind-registered (and uses multiple-inheritance to offset the pybind base)\n    m.def(\"i801e_c\", []() -> I801C * { return new I801E(); });\n    m.def(\"i801e_b2\", []() -> I801B2 * { return new I801E(); });\n\n    // test_mi_static_properties\n    py::class_<Vanilla>(m, \"Vanilla\").def(py::init<>()).def(\"vanilla\", &Vanilla::vanilla);\n\n    py::class_<WithStatic1>(m, \"WithStatic1\")\n        .def(py::init<>())\n        .def_static(\"static_func1\", &WithStatic1::static_func1)\n        .def_readwrite_static(\"static_value1\", &WithStatic1::static_value1);\n\n    py::class_<WithStatic2>(m, \"WithStatic2\")\n        .def(py::init<>())\n        .def_static(\"static_func2\", &WithStatic2::static_func2)\n        .def_readwrite_static(\"static_value2\", &WithStatic2::static_value2);\n\n    py::class_<VanillaStaticMix1, Vanilla, WithStatic1, WithStatic2>(m, \"VanillaStaticMix1\")\n        .def(py::init<>())\n        .def_static(\"static_func\", &VanillaStaticMix1::static_func)\n        .def_readwrite_static(\"static_value\", &VanillaStaticMix1::static_value);\n\n    py::class_<VanillaStaticMix2, WithStatic1, Vanilla, WithStatic2>(m, \"VanillaStaticMix2\")\n        .def(py::init<>())\n        .def_static(\"static_func\", &VanillaStaticMix2::static_func)\n        .def_readwrite_static(\"static_value\", &VanillaStaticMix2::static_value);\n\n    struct WithDict {};\n    struct VanillaDictMix1 : Vanilla, WithDict {};\n    struct VanillaDictMix2 : WithDict, Vanilla {};\n    py::class_<WithDict>(m, \"WithDict\", py::dynamic_attr()).def(py::init<>());\n    py::class_<VanillaDictMix1, Vanilla, WithDict>(m, \"VanillaDictMix1\").def(py::init<>());\n    py::class_<VanillaDictMix2, WithDict, Vanilla>(m, \"VanillaDictMix2\").def(py::init<>());\n\n    // test_diamond_inheritance\n    // Issue #959: segfault when constructing diamond inheritance instance\n    // All of these have int members so that there will be various unequal pointers involved.\n    struct B {\n        int b;\n        B() = default;\n        B(const B &) = default;\n        virtual ~B() = default;\n    };\n    struct C0 : public virtual B {\n        int c0;\n    };\n    struct C1 : public virtual B {\n        int c1;\n    };\n    struct D : public C0, public C1 {\n        int d;\n    };\n    py::class_<B>(m, \"B\").def(\"b\", [](B *self) { return self; });\n    py::class_<C0, B>(m, \"C0\").def(\"c0\", [](C0 *self) { return self; });\n    py::class_<C1, B>(m, \"C1\").def(\"c1\", [](C1 *self) { return self; });\n    py::class_<D, C0, C1>(m, \"D\").def(py::init<>());\n\n    // test_pr3635_diamond_*\n    // - functions are get_{base}_{var}, return {var}\n    struct MVB {\n        MVB() = default;\n        MVB(const MVB &) = default;\n        virtual ~MVB() = default;\n\n        int b = 1;\n        int get_b_b() const { return b; }\n    };\n    struct MVC : virtual MVB {\n        int c = 2;\n        int get_c_b() const { return b; }\n        int get_c_c() const { return c; }\n    };\n    struct MVD0 : virtual MVC {\n        int d0 = 3;\n        int get_d0_b() const { return b; }\n        int get_d0_c() const { return c; }\n        int get_d0_d0() const { return d0; }\n    };\n    struct MVD1 : virtual MVC {\n        int d1 = 4;\n        int get_d1_b() const { return b; }\n        int get_d1_c() const { return c; }\n        int get_d1_d1() const { return d1; }\n    };\n    struct MVE : virtual MVD0, virtual MVD1 {\n        int e = 5;\n        int get_e_b() const { return b; }\n        int get_e_c() const { return c; }\n        int get_e_d0() const { return d0; }\n        int get_e_d1() const { return d1; }\n        int get_e_e() const { return e; }\n    };\n    struct MVF : virtual MVE {\n        int f = 6;\n        int get_f_b() const { return b; }\n        int get_f_c() const { return c; }\n        int get_f_d0() const { return d0; }\n        int get_f_d1() const { return d1; }\n        int get_f_e() const { return e; }\n        int get_f_f() const { return f; }\n    };\n    py::class_<MVB>(m, \"MVB\")\n        .def(py::init<>())\n        .def(\"get_b_b\", &MVB::get_b_b)\n        .def_readwrite(\"b\", &MVB::b);\n    py::class_<MVC, MVB>(m, \"MVC\")\n        .def(py::init<>())\n        .def(\"get_c_b\", &MVC::get_c_b)\n        .def(\"get_c_c\", &MVC::get_c_c)\n        .def_readwrite(\"c\", &MVC::c);\n    py::class_<MVD0, MVC>(m, \"MVD0\")\n        .def(py::init<>())\n        .def(\"get_d0_b\", &MVD0::get_d0_b)\n        .def(\"get_d0_c\", &MVD0::get_d0_c)\n        .def(\"get_d0_d0\", &MVD0::get_d0_d0)\n        .def_readwrite(\"d0\", &MVD0::d0);\n    py::class_<MVD1, MVC>(m, \"MVD1\")\n        .def(py::init<>())\n        .def(\"get_d1_b\", &MVD1::get_d1_b)\n        .def(\"get_d1_c\", &MVD1::get_d1_c)\n        .def(\"get_d1_d1\", &MVD1::get_d1_d1)\n        .def_readwrite(\"d1\", &MVD1::d1);\n    py::class_<MVE, MVD0, MVD1>(m, \"MVE\")\n        .def(py::init<>())\n        .def(\"get_e_b\", &MVE::get_e_b)\n        .def(\"get_e_c\", &MVE::get_e_c)\n        .def(\"get_e_d0\", &MVE::get_e_d0)\n        .def(\"get_e_d1\", &MVE::get_e_d1)\n        .def(\"get_e_e\", &MVE::get_e_e)\n        .def_readwrite(\"e\", &MVE::e);\n    py::class_<MVF, MVE>(m, \"MVF\")\n        .def(py::init<>())\n        .def(\"get_f_b\", &MVF::get_f_b)\n        .def(\"get_f_c\", &MVF::get_f_c)\n        .def(\"get_f_d0\", &MVF::get_f_d0)\n        .def(\"get_f_d1\", &MVF::get_f_d1)\n        .def(\"get_f_e\", &MVF::get_f_e)\n        .def(\"get_f_f\", &MVF::get_f_f)\n        .def_readwrite(\"f\", &MVF::f);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_multiple_inheritance.py",
    "content": "import pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import ConstructorStats\nfrom pybind11_tests import multiple_inheritance as m\n\n\ndef test_multiple_inheritance_cpp():\n    mt = m.MIType(3, 4)\n\n    assert mt.foo() == 3\n    assert mt.bar() == 4\n\n\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_multiple_inheritance_mix1():\n    class Base1:\n        def __init__(self, i):\n            self.i = i\n\n        def foo(self):\n            return self.i\n\n    class MITypePy(Base1, m.Base2):\n        def __init__(self, i, j):\n            Base1.__init__(self, i)\n            m.Base2.__init__(self, j)\n\n    mt = MITypePy(3, 4)\n\n    assert mt.foo() == 3\n    assert mt.bar() == 4\n\n\ndef test_multiple_inheritance_mix2():\n    class Base2:\n        def __init__(self, i):\n            self.i = i\n\n        def bar(self):\n            return self.i\n\n    class MITypePy(m.Base1, Base2):\n        def __init__(self, i, j):\n            m.Base1.__init__(self, i)\n            Base2.__init__(self, j)\n\n    mt = MITypePy(3, 4)\n\n    assert mt.foo() == 3\n    assert mt.bar() == 4\n\n\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_multiple_inheritance_python():\n    class MI1(m.Base1, m.Base2):\n        def __init__(self, i, j):\n            m.Base1.__init__(self, i)\n            m.Base2.__init__(self, j)\n\n    class B1:\n        def v(self):\n            return 1\n\n    class MI2(B1, m.Base1, m.Base2):\n        def __init__(self, i, j):\n            B1.__init__(self)\n            m.Base1.__init__(self, i)\n            m.Base2.__init__(self, j)\n\n    class MI3(MI2):\n        def __init__(self, i, j):\n            MI2.__init__(self, i, j)\n\n    class MI4(MI3, m.Base2):\n        def __init__(self, i, j):\n            MI3.__init__(self, i, j)\n            # This should be ignored (Base2 is already initialized via MI2):\n            m.Base2.__init__(self, i + 100)\n\n    class MI5(m.Base2, B1, m.Base1):\n        def __init__(self, i, j):\n            B1.__init__(self)\n            m.Base1.__init__(self, i)\n            m.Base2.__init__(self, j)\n\n    class MI6(m.Base2, B1):\n        def __init__(self, i):\n            m.Base2.__init__(self, i)\n            B1.__init__(self)\n\n    class B2(B1):\n        def v(self):\n            return 2\n\n    class B3:\n        def v(self):\n            return 3\n\n    class B4(B3, B2):\n        def v(self):\n            return 4\n\n    class MI7(B4, MI6):\n        def __init__(self, i):\n            B4.__init__(self)\n            MI6.__init__(self, i)\n\n    class MI8(MI6, B3):\n        def __init__(self, i):\n            MI6.__init__(self, i)\n            B3.__init__(self)\n\n    class MI8b(B3, MI6):\n        def __init__(self, i):\n            B3.__init__(self)\n            MI6.__init__(self, i)\n\n    mi1 = MI1(1, 2)\n    assert mi1.foo() == 1\n    assert mi1.bar() == 2\n\n    mi2 = MI2(3, 4)\n    assert mi2.v() == 1\n    assert mi2.foo() == 3\n    assert mi2.bar() == 4\n\n    mi3 = MI3(5, 6)\n    assert mi3.v() == 1\n    assert mi3.foo() == 5\n    assert mi3.bar() == 6\n\n    mi4 = MI4(7, 8)\n    assert mi4.v() == 1\n    assert mi4.foo() == 7\n    assert mi4.bar() == 8\n\n    mi5 = MI5(10, 11)\n    assert mi5.v() == 1\n    assert mi5.foo() == 10\n    assert mi5.bar() == 11\n\n    mi6 = MI6(12)\n    assert mi6.v() == 1\n    assert mi6.bar() == 12\n\n    mi7 = MI7(13)\n    assert mi7.v() == 4\n    assert mi7.bar() == 13\n\n    mi8 = MI8(14)\n    assert mi8.v() == 1\n    assert mi8.bar() == 14\n\n    mi8b = MI8b(15)\n    assert mi8b.v() == 3\n    assert mi8b.bar() == 15\n\n\ndef test_multiple_inheritance_python_many_bases():\n    class MIMany14(m.BaseN1, m.BaseN2, m.BaseN3, m.BaseN4):\n        def __init__(self):\n            m.BaseN1.__init__(self, 1)\n            m.BaseN2.__init__(self, 2)\n            m.BaseN3.__init__(self, 3)\n            m.BaseN4.__init__(self, 4)\n\n    class MIMany58(m.BaseN5, m.BaseN6, m.BaseN7, m.BaseN8):\n        def __init__(self):\n            m.BaseN5.__init__(self, 5)\n            m.BaseN6.__init__(self, 6)\n            m.BaseN7.__init__(self, 7)\n            m.BaseN8.__init__(self, 8)\n\n    class MIMany916(\n        m.BaseN9,\n        m.BaseN10,\n        m.BaseN11,\n        m.BaseN12,\n        m.BaseN13,\n        m.BaseN14,\n        m.BaseN15,\n        m.BaseN16,\n    ):\n        def __init__(self):\n            m.BaseN9.__init__(self, 9)\n            m.BaseN10.__init__(self, 10)\n            m.BaseN11.__init__(self, 11)\n            m.BaseN12.__init__(self, 12)\n            m.BaseN13.__init__(self, 13)\n            m.BaseN14.__init__(self, 14)\n            m.BaseN15.__init__(self, 15)\n            m.BaseN16.__init__(self, 16)\n\n    class MIMany19(MIMany14, MIMany58, m.BaseN9):\n        def __init__(self):\n            MIMany14.__init__(self)\n            MIMany58.__init__(self)\n            m.BaseN9.__init__(self, 9)\n\n    class MIMany117(MIMany14, MIMany58, MIMany916, m.BaseN17):\n        def __init__(self):\n            MIMany14.__init__(self)\n            MIMany58.__init__(self)\n            MIMany916.__init__(self)\n            m.BaseN17.__init__(self, 17)\n\n    # Inherits from 4 registered C++ classes: can fit in one pointer on any modern arch:\n    a = MIMany14()\n    for i in range(1, 4):\n        assert getattr(a, \"f\" + str(i))() == 2 * i\n\n    # Inherits from 8: requires 1/2 pointers worth of holder flags on 32/64-bit arch:\n    b = MIMany916()\n    for i in range(9, 16):\n        assert getattr(b, \"f\" + str(i))() == 2 * i\n\n    # Inherits from 9: requires >= 2 pointers worth of holder flags\n    c = MIMany19()\n    for i in range(1, 9):\n        assert getattr(c, \"f\" + str(i))() == 2 * i\n\n    # Inherits from 17: requires >= 3 pointers worth of holder flags\n    d = MIMany117()\n    for i in range(1, 17):\n        assert getattr(d, \"f\" + str(i))() == 2 * i\n\n\ndef test_multiple_inheritance_virtbase():\n    class MITypePy(m.Base12a):\n        def __init__(self, i, j):\n            m.Base12a.__init__(self, i, j)\n\n    mt = MITypePy(3, 4)\n    assert mt.bar() == 4\n    assert m.bar_base2a(mt) == 4\n    assert m.bar_base2a_sharedptr(mt) == 4\n\n\ndef test_mi_static_properties():\n    \"\"\"Mixing bases with and without static properties should be possible\n    and the result should be independent of base definition order\"\"\"\n\n    for d in (m.VanillaStaticMix1(), m.VanillaStaticMix2()):\n        assert d.vanilla() == \"Vanilla\"\n        assert d.static_func1() == \"WithStatic1\"\n        assert d.static_func2() == \"WithStatic2\"\n        assert d.static_func() == d.__class__.__name__\n\n        m.WithStatic1.static_value1 = 1\n        m.WithStatic2.static_value2 = 2\n        assert d.static_value1 == 1\n        assert d.static_value2 == 2\n        assert d.static_value == 12\n\n        d.static_value1 = 0\n        assert d.static_value1 == 0\n        d.static_value2 = 0\n        assert d.static_value2 == 0\n        d.static_value = 0\n        assert d.static_value == 0\n\n\n# Requires PyPy 6+\ndef test_mi_dynamic_attributes():\n    \"\"\"Mixing bases with and without dynamic attribute support\"\"\"\n\n    for d in (m.VanillaDictMix1(), m.VanillaDictMix2()):\n        d.dynamic = 1\n        assert d.dynamic == 1\n\n\ndef test_mi_unaligned_base():\n    \"\"\"Returning an offset (non-first MI) base class pointer should recognize the instance\"\"\"\n\n    n_inst = ConstructorStats.detail_reg_inst()\n\n    c = m.I801C()\n    d = m.I801D()\n    # + 4 below because we have the two instances, and each instance has offset base I801B2\n    assert ConstructorStats.detail_reg_inst() == n_inst + 4\n    b1c = m.i801b1_c(c)\n    assert b1c is c\n    b2c = m.i801b2_c(c)\n    assert b2c is c\n    b1d = m.i801b1_d(d)\n    assert b1d is d\n    b2d = m.i801b2_d(d)\n    assert b2d is d\n\n    assert ConstructorStats.detail_reg_inst() == n_inst + 4  # no extra instances\n    del c, b1c, b2c\n    assert ConstructorStats.detail_reg_inst() == n_inst + 2\n    del d, b1d, b2d\n    assert ConstructorStats.detail_reg_inst() == n_inst\n\n\ndef test_mi_base_return():\n    \"\"\"Tests returning an offset (non-first MI) base class pointer to a derived instance\"\"\"\n\n    n_inst = ConstructorStats.detail_reg_inst()\n\n    c1 = m.i801c_b1()\n    assert type(c1) is m.I801C\n    assert c1.a == 1\n    assert c1.b == 2\n\n    d1 = m.i801d_b1()\n    assert type(d1) is m.I801D\n    assert d1.a == 1\n    assert d1.b == 2\n\n    assert ConstructorStats.detail_reg_inst() == n_inst + 4\n\n    c2 = m.i801c_b2()\n    assert type(c2) is m.I801C\n    assert c2.a == 1\n    assert c2.b == 2\n\n    d2 = m.i801d_b2()\n    assert type(d2) is m.I801D\n    assert d2.a == 1\n    assert d2.b == 2\n\n    assert ConstructorStats.detail_reg_inst() == n_inst + 8\n\n    del c2\n    assert ConstructorStats.detail_reg_inst() == n_inst + 6\n    del c1, d1, d2\n    assert ConstructorStats.detail_reg_inst() == n_inst\n\n    # Returning an unregistered derived type with a registered base; we won't\n    # pick up the derived type, obviously, but should still work (as an object\n    # of whatever type was returned).\n    e1 = m.i801e_c()\n    assert type(e1) is m.I801C\n    assert e1.a == 1\n    assert e1.b == 2\n\n    e2 = m.i801e_b2()\n    assert type(e2) is m.I801B2\n    assert e2.b == 2\n\n\ndef test_diamond_inheritance():\n    \"\"\"Tests that diamond inheritance works as expected (issue #959)\"\"\"\n\n    # Issue #959: this shouldn't segfault:\n    d = m.D()\n\n    # Make sure all the various distinct pointers are all recognized as registered instances:\n    assert d is d.c0()\n    assert d is d.c1()\n    assert d is d.b()\n    assert d is d.c0().b()\n    assert d is d.c1().b()\n    assert d is d.c0().c1().b().c0().b()\n\n\ndef test_pr3635_diamond_b():\n    o = m.MVB()\n    assert o.b == 1\n\n    assert o.get_b_b() == 1\n\n\ndef test_pr3635_diamond_c():\n    o = m.MVC()\n    assert o.b == 1\n    assert o.c == 2\n\n    assert o.get_b_b() == 1\n    assert o.get_c_b() == 1\n\n    assert o.get_c_c() == 2\n\n\ndef test_pr3635_diamond_d0():\n    o = m.MVD0()\n    assert o.b == 1\n    assert o.c == 2\n    assert o.d0 == 3\n\n    assert o.get_b_b() == 1\n    assert o.get_c_b() == 1\n    assert o.get_d0_b() == 1\n\n    assert o.get_c_c() == 2\n    assert o.get_d0_c() == 2\n\n    assert o.get_d0_d0() == 3\n\n\ndef test_pr3635_diamond_d1():\n    o = m.MVD1()\n    assert o.b == 1\n    assert o.c == 2\n    assert o.d1 == 4\n\n    assert o.get_b_b() == 1\n    assert o.get_c_b() == 1\n    assert o.get_d1_b() == 1\n\n    assert o.get_c_c() == 2\n    assert o.get_d1_c() == 2\n\n    assert o.get_d1_d1() == 4\n\n\ndef test_pr3635_diamond_e():\n    o = m.MVE()\n    assert o.b == 1\n    assert o.c == 2\n    assert o.d0 == 3\n    assert o.d1 == 4\n    assert o.e == 5\n\n    assert o.get_b_b() == 1\n    assert o.get_c_b() == 1\n    assert o.get_d0_b() == 1\n    assert o.get_d1_b() == 1\n    assert o.get_e_b() == 1\n\n    assert o.get_c_c() == 2\n    assert o.get_d0_c() == 2\n    assert o.get_d1_c() == 2\n    assert o.get_e_c() == 2\n\n    assert o.get_d0_d0() == 3\n    assert o.get_e_d0() == 3\n\n    assert o.get_d1_d1() == 4\n    assert o.get_e_d1() == 4\n\n    assert o.get_e_e() == 5\n\n\ndef test_pr3635_diamond_f():\n    o = m.MVF()\n    assert o.b == 1\n    assert o.c == 2\n    assert o.d0 == 3\n    assert o.d1 == 4\n    assert o.e == 5\n    assert o.f == 6\n\n    assert o.get_b_b() == 1\n    assert o.get_c_b() == 1\n    assert o.get_d0_b() == 1\n    assert o.get_d1_b() == 1\n    assert o.get_e_b() == 1\n    assert o.get_f_b() == 1\n\n    assert o.get_c_c() == 2\n    assert o.get_d0_c() == 2\n    assert o.get_d1_c() == 2\n    assert o.get_e_c() == 2\n    assert o.get_f_c() == 2\n\n    assert o.get_d0_d0() == 3\n    assert o.get_e_d0() == 3\n    assert o.get_f_d0() == 3\n\n    assert o.get_d1_d1() == 4\n    assert o.get_e_d1() == 4\n    assert o.get_f_d1() == 4\n\n    assert o.get_e_e() == 5\n    assert o.get_f_e() == 5\n\n    assert o.get_f_f() == 6\n\n\ndef test_python_inherit_from_mi():\n    \"\"\"Tests extending a Python class from a single inheritor of a MI class\"\"\"\n\n    class PyMVF(m.MVF):\n        g = 7\n\n        def get_g_g(self):\n            return self.g\n\n    o = PyMVF()\n\n    assert o.b == 1\n    assert o.c == 2\n    assert o.d0 == 3\n    assert o.d1 == 4\n    assert o.e == 5\n    assert o.f == 6\n    assert o.g == 7\n\n    assert o.get_g_g() == 7\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_numpy_array.cpp",
    "content": "/*\n    tests/test_numpy_array.cpp -- test core array functionality\n\n    Copyright (c) 2016 Ivan Smirnov <i.s.smirnov@gmail.com>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/numpy.h>\n#include <pybind11/stl.h>\n\n#include \"pybind11_tests.h\"\n\n#include <cstdint>\n#include <utility>\n\n// Size / dtype checks.\nstruct DtypeCheck {\n    py::dtype numpy{};\n    py::dtype pybind11{};\n};\n\ntemplate <typename T>\nDtypeCheck get_dtype_check(const char *name) {\n    py::module_ np = py::module_::import(\"numpy\");\n    DtypeCheck check{};\n    check.numpy = np.attr(\"dtype\")(np.attr(name));\n    check.pybind11 = py::dtype::of<T>();\n    return check;\n}\n\nstd::vector<DtypeCheck> get_concrete_dtype_checks() {\n    return {// Normalization\n            get_dtype_check<std::int8_t>(\"int8\"),\n            get_dtype_check<std::uint8_t>(\"uint8\"),\n            get_dtype_check<std::int16_t>(\"int16\"),\n            get_dtype_check<std::uint16_t>(\"uint16\"),\n            get_dtype_check<std::int32_t>(\"int32\"),\n            get_dtype_check<std::uint32_t>(\"uint32\"),\n            get_dtype_check<std::int64_t>(\"int64\"),\n            get_dtype_check<std::uint64_t>(\"uint64\")};\n}\n\nstruct DtypeSizeCheck {\n    std::string name{};\n    int size_cpp{};\n    int size_numpy{};\n    // For debugging.\n    py::dtype dtype{};\n};\n\ntemplate <typename T>\nDtypeSizeCheck get_dtype_size_check() {\n    DtypeSizeCheck check{};\n    check.name = py::type_id<T>();\n    check.size_cpp = sizeof(T);\n    check.dtype = py::dtype::of<T>();\n    check.size_numpy = check.dtype.attr(\"itemsize\").template cast<int>();\n    return check;\n}\n\nstd::vector<DtypeSizeCheck> get_platform_dtype_size_checks() {\n    return {\n        get_dtype_size_check<short>(),\n        get_dtype_size_check<unsigned short>(),\n        get_dtype_size_check<int>(),\n        get_dtype_size_check<unsigned int>(),\n        get_dtype_size_check<long>(),\n        get_dtype_size_check<unsigned long>(),\n        get_dtype_size_check<long long>(),\n        get_dtype_size_check<unsigned long long>(),\n    };\n}\n\n// Arrays.\nusing arr = py::array;\nusing arr_t = py::array_t<uint16_t, 0>;\nstatic_assert(std::is_same<arr_t::value_type, uint16_t>::value, \"\");\n\ntemplate <typename... Ix>\narr data(const arr &a, Ix... index) {\n    return arr(a.nbytes() - a.offset_at(index...), (const uint8_t *) a.data(index...));\n}\n\ntemplate <typename... Ix>\narr data_t(const arr_t &a, Ix... index) {\n    return arr(a.size() - a.index_at(index...), a.data(index...));\n}\n\ntemplate <typename... Ix>\narr &mutate_data(arr &a, Ix... index) {\n    auto *ptr = (uint8_t *) a.mutable_data(index...);\n    for (py::ssize_t i = 0; i < a.nbytes() - a.offset_at(index...); i++) {\n        ptr[i] = (uint8_t) (ptr[i] * 2);\n    }\n    return a;\n}\n\ntemplate <typename... Ix>\narr_t &mutate_data_t(arr_t &a, Ix... index) {\n    auto ptr = a.mutable_data(index...);\n    for (py::ssize_t i = 0; i < a.size() - a.index_at(index...); i++) {\n        ptr[i]++;\n    }\n    return a;\n}\n\ntemplate <typename... Ix>\npy::ssize_t index_at(const arr &a, Ix... idx) {\n    return a.index_at(idx...);\n}\ntemplate <typename... Ix>\npy::ssize_t index_at_t(const arr_t &a, Ix... idx) {\n    return a.index_at(idx...);\n}\ntemplate <typename... Ix>\npy::ssize_t offset_at(const arr &a, Ix... idx) {\n    return a.offset_at(idx...);\n}\ntemplate <typename... Ix>\npy::ssize_t offset_at_t(const arr_t &a, Ix... idx) {\n    return a.offset_at(idx...);\n}\ntemplate <typename... Ix>\npy::ssize_t at_t(const arr_t &a, Ix... idx) {\n    return a.at(idx...);\n}\ntemplate <typename... Ix>\narr_t &mutate_at_t(arr_t &a, Ix... idx) {\n    a.mutable_at(idx...)++;\n    return a;\n}\n\n#define def_index_fn(name, type)                                                                  \\\n    sm.def(#name, [](type a) { return name(a); });                                                \\\n    sm.def(#name, [](type a, int i) { return name(a, i); });                                      \\\n    sm.def(#name, [](type a, int i, int j) { return name(a, i, j); });                            \\\n    sm.def(#name, [](type a, int i, int j, int k) { return name(a, i, j, k); });\n\ntemplate <typename T, typename T2>\npy::handle auxiliaries(T &&r, T2 &&r2) {\n    if (r.ndim() != 2) {\n        throw std::domain_error(\"error: ndim != 2\");\n    }\n    py::list l;\n    l.append(*r.data(0, 0));\n    l.append(*r2.mutable_data(0, 0));\n    l.append(r.data(0, 1) == r2.mutable_data(0, 1));\n    l.append(r.ndim());\n    l.append(r.itemsize());\n    l.append(r.shape(0));\n    l.append(r.shape(1));\n    l.append(r.size());\n    l.append(r.nbytes());\n    return l.release();\n}\n\n// note: declaration at local scope would create a dangling reference!\nstatic int data_i = 42;\n\nTEST_SUBMODULE(numpy_array, sm) {\n    try {\n        py::module_::import(\"numpy\");\n    } catch (const py::error_already_set &) {\n        return;\n    }\n\n    // test_dtypes\n    py::class_<DtypeCheck>(sm, \"DtypeCheck\")\n        .def_readonly(\"numpy\", &DtypeCheck::numpy)\n        .def_readonly(\"pybind11\", &DtypeCheck::pybind11)\n        .def(\"__repr__\", [](const DtypeCheck &self) {\n            return py::str(\"<DtypeCheck numpy={} pybind11={}>\").format(self.numpy, self.pybind11);\n        });\n    sm.def(\"get_concrete_dtype_checks\", &get_concrete_dtype_checks);\n\n    py::class_<DtypeSizeCheck>(sm, \"DtypeSizeCheck\")\n        .def_readonly(\"name\", &DtypeSizeCheck::name)\n        .def_readonly(\"size_cpp\", &DtypeSizeCheck::size_cpp)\n        .def_readonly(\"size_numpy\", &DtypeSizeCheck::size_numpy)\n        .def(\"__repr__\", [](const DtypeSizeCheck &self) {\n            return py::str(\"<DtypeSizeCheck name='{}' size_cpp={} size_numpy={} dtype={}>\")\n                .format(self.name, self.size_cpp, self.size_numpy, self.dtype);\n        });\n    sm.def(\"get_platform_dtype_size_checks\", &get_platform_dtype_size_checks);\n\n    // test_array_attributes\n    sm.def(\"ndim\", [](const arr &a) { return a.ndim(); });\n    sm.def(\"shape\", [](const arr &a) { return arr(a.ndim(), a.shape()); });\n    sm.def(\"shape\", [](const arr &a, py::ssize_t dim) { return a.shape(dim); });\n    sm.def(\"strides\", [](const arr &a) { return arr(a.ndim(), a.strides()); });\n    sm.def(\"strides\", [](const arr &a, py::ssize_t dim) { return a.strides(dim); });\n    sm.def(\"writeable\", [](const arr &a) { return a.writeable(); });\n    sm.def(\"size\", [](const arr &a) { return a.size(); });\n    sm.def(\"itemsize\", [](const arr &a) { return a.itemsize(); });\n    sm.def(\"nbytes\", [](const arr &a) { return a.nbytes(); });\n    sm.def(\"owndata\", [](const arr &a) { return a.owndata(); });\n\n    // test_index_offset\n    def_index_fn(index_at, const arr &);\n    def_index_fn(index_at_t, const arr_t &);\n    def_index_fn(offset_at, const arr &);\n    def_index_fn(offset_at_t, const arr_t &);\n    // test_data\n    def_index_fn(data, const arr &);\n    def_index_fn(data_t, const arr_t &);\n    // test_mutate_data, test_mutate_readonly\n    def_index_fn(mutate_data, arr &);\n    def_index_fn(mutate_data_t, arr_t &);\n    def_index_fn(at_t, const arr_t &);\n    def_index_fn(mutate_at_t, arr_t &);\n\n    // test_make_c_f_array\n    sm.def(\"make_f_array\", [] { return py::array_t<float>({2, 2}, {4, 8}); });\n    sm.def(\"make_c_array\", [] { return py::array_t<float>({2, 2}, {8, 4}); });\n\n    // test_empty_shaped_array\n    sm.def(\"make_empty_shaped_array\", [] { return py::array(py::dtype(\"f\"), {}, {}); });\n    // test numpy scalars (empty shape, ndim==0)\n    sm.def(\"scalar_int\", []() { return py::array(py::dtype(\"i\"), {}, {}, &data_i); });\n\n    // test_wrap\n    sm.def(\"wrap\", [](const py::array &a) {\n        return py::array(a.dtype(),\n                         {a.shape(), a.shape() + a.ndim()},\n                         {a.strides(), a.strides() + a.ndim()},\n                         a.data(),\n                         a);\n    });\n\n    // test_numpy_view\n    struct ArrayClass {\n        int data[2] = {1, 2};\n        ArrayClass() { py::print(\"ArrayClass()\"); }\n        ~ArrayClass() { py::print(\"~ArrayClass()\"); }\n    };\n    py::class_<ArrayClass>(sm, \"ArrayClass\")\n        .def(py::init<>())\n        .def(\"numpy_view\", [](py::object &obj) {\n            py::print(\"ArrayClass::numpy_view()\");\n            auto &a = obj.cast<ArrayClass &>();\n            return py::array_t<int>({2}, {4}, a.data, obj);\n        });\n\n    // test_cast_numpy_int64_to_uint64\n    sm.def(\"function_taking_uint64\", [](uint64_t) {});\n\n    // test_isinstance\n    sm.def(\"isinstance_untyped\", [](py::object yes, py::object no) {\n        return py::isinstance<py::array>(std::move(yes))\n               && !py::isinstance<py::array>(std::move(no));\n    });\n    sm.def(\"isinstance_typed\", [](const py::object &o) {\n        return py::isinstance<py::array_t<double>>(o) && !py::isinstance<py::array_t<int>>(o);\n    });\n\n    // test_constructors\n    sm.def(\"default_constructors\", []() {\n        return py::dict(\"array\"_a = py::array(),\n                        \"array_t<int32>\"_a = py::array_t<std::int32_t>(),\n                        \"array_t<double>\"_a = py::array_t<double>());\n    });\n    sm.def(\"converting_constructors\", [](const py::object &o) {\n        return py::dict(\"array\"_a = py::array(o),\n                        \"array_t<int32>\"_a = py::array_t<std::int32_t>(o),\n                        \"array_t<double>\"_a = py::array_t<double>(o));\n    });\n\n    // test_overload_resolution\n    sm.def(\"overloaded\", [](const py::array_t<double> &) { return \"double\"; });\n    sm.def(\"overloaded\", [](const py::array_t<float> &) { return \"float\"; });\n    sm.def(\"overloaded\", [](const py::array_t<int> &) { return \"int\"; });\n    sm.def(\"overloaded\", [](const py::array_t<unsigned short> &) { return \"unsigned short\"; });\n    sm.def(\"overloaded\", [](const py::array_t<long long> &) { return \"long long\"; });\n    sm.def(\"overloaded\",\n           [](const py::array_t<std::complex<double>> &) { return \"double complex\"; });\n    sm.def(\"overloaded\", [](const py::array_t<std::complex<float>> &) { return \"float complex\"; });\n\n    sm.def(\"overloaded2\",\n           [](const py::array_t<std::complex<double>> &) { return \"double complex\"; });\n    sm.def(\"overloaded2\", [](const py::array_t<double> &) { return \"double\"; });\n    sm.def(\"overloaded2\",\n           [](const py::array_t<std::complex<float>> &) { return \"float complex\"; });\n    sm.def(\"overloaded2\", [](const py::array_t<float> &) { return \"float\"; });\n\n    // [workaround(intel)] ICC 20/21 breaks with py::arg().stuff, using py::arg{}.stuff works.\n\n    // Only accept the exact types:\n    sm.def(\n        \"overloaded3\", [](const py::array_t<int> &) { return \"int\"; }, py::arg{}.noconvert());\n    sm.def(\n        \"overloaded3\",\n        [](const py::array_t<double> &) { return \"double\"; },\n        py::arg{}.noconvert());\n\n    // Make sure we don't do unsafe coercion (e.g. float to int) when not using forcecast, but\n    // rather that float gets converted via the safe (conversion to double) overload:\n    sm.def(\"overloaded4\", [](const py::array_t<long long, 0> &) { return \"long long\"; });\n    sm.def(\"overloaded4\", [](const py::array_t<double, 0> &) { return \"double\"; });\n\n    // But we do allow conversion to int if forcecast is enabled (but only if no overload matches\n    // without conversion)\n    sm.def(\"overloaded5\", [](const py::array_t<unsigned int> &) { return \"unsigned int\"; });\n    sm.def(\"overloaded5\", [](const py::array_t<double> &) { return \"double\"; });\n\n    // test_greedy_string_overload\n    // Issue 685: ndarray shouldn't go to std::string overload\n    sm.def(\"issue685\", [](const std::string &) { return \"string\"; });\n    sm.def(\"issue685\", [](const py::array &) { return \"array\"; });\n    sm.def(\"issue685\", [](const py::object &) { return \"other\"; });\n\n    // test_array_unchecked_fixed_dims\n    sm.def(\n        \"proxy_add2\",\n        [](py::array_t<double> a, double v) {\n            auto r = a.mutable_unchecked<2>();\n            for (py::ssize_t i = 0; i < r.shape(0); i++) {\n                for (py::ssize_t j = 0; j < r.shape(1); j++) {\n                    r(i, j) += v;\n                }\n            }\n        },\n        py::arg{}.noconvert(),\n        py::arg());\n\n    sm.def(\"proxy_init3\", [](double start) {\n        py::array_t<double, py::array::c_style> a({3, 3, 3});\n        auto r = a.mutable_unchecked<3>();\n        for (py::ssize_t i = 0; i < r.shape(0); i++) {\n            for (py::ssize_t j = 0; j < r.shape(1); j++) {\n                for (py::ssize_t k = 0; k < r.shape(2); k++) {\n                    r(i, j, k) = start++;\n                }\n            }\n        }\n        return a;\n    });\n    sm.def(\"proxy_init3F\", [](double start) {\n        py::array_t<double, py::array::f_style> a({3, 3, 3});\n        auto r = a.mutable_unchecked<3>();\n        for (py::ssize_t k = 0; k < r.shape(2); k++) {\n            for (py::ssize_t j = 0; j < r.shape(1); j++) {\n                for (py::ssize_t i = 0; i < r.shape(0); i++) {\n                    r(i, j, k) = start++;\n                }\n            }\n        }\n        return a;\n    });\n    sm.def(\"proxy_squared_L2_norm\", [](const py::array_t<double> &a) {\n        auto r = a.unchecked<1>();\n        double sumsq = 0;\n        for (py::ssize_t i = 0; i < r.shape(0); i++) {\n            sumsq += r[i] * r(i); // Either notation works for a 1D array\n        }\n        return sumsq;\n    });\n\n    sm.def(\"proxy_auxiliaries2\", [](py::array_t<double> a) {\n        auto r = a.unchecked<2>();\n        auto r2 = a.mutable_unchecked<2>();\n        return auxiliaries(r, r2);\n    });\n\n    sm.def(\"proxy_auxiliaries1_const_ref\", [](py::array_t<double> a) {\n        const auto &r = a.unchecked<1>();\n        const auto &r2 = a.mutable_unchecked<1>();\n        return r(0) == r2(0) && r[0] == r2[0];\n    });\n\n    sm.def(\"proxy_auxiliaries2_const_ref\", [](py::array_t<double> a) {\n        const auto &r = a.unchecked<2>();\n        const auto &r2 = a.mutable_unchecked<2>();\n        return r(0, 0) == r2(0, 0);\n    });\n\n    // test_array_unchecked_dyn_dims\n    // Same as the above, but without a compile-time dimensions specification:\n    sm.def(\n        \"proxy_add2_dyn\",\n        [](py::array_t<double> a, double v) {\n            auto r = a.mutable_unchecked();\n            if (r.ndim() != 2) {\n                throw std::domain_error(\"error: ndim != 2\");\n            }\n            for (py::ssize_t i = 0; i < r.shape(0); i++) {\n                for (py::ssize_t j = 0; j < r.shape(1); j++) {\n                    r(i, j) += v;\n                }\n            }\n        },\n        py::arg{}.noconvert(),\n        py::arg());\n    sm.def(\"proxy_init3_dyn\", [](double start) {\n        py::array_t<double, py::array::c_style> a({3, 3, 3});\n        auto r = a.mutable_unchecked();\n        if (r.ndim() != 3) {\n            throw std::domain_error(\"error: ndim != 3\");\n        }\n        for (py::ssize_t i = 0; i < r.shape(0); i++) {\n            for (py::ssize_t j = 0; j < r.shape(1); j++) {\n                for (py::ssize_t k = 0; k < r.shape(2); k++) {\n                    r(i, j, k) = start++;\n                }\n            }\n        }\n        return a;\n    });\n    sm.def(\"proxy_auxiliaries2_dyn\", [](py::array_t<double> a) {\n        return auxiliaries(a.unchecked(), a.mutable_unchecked());\n    });\n\n    sm.def(\"array_auxiliaries2\", [](py::array_t<double> a) { return auxiliaries(a, a); });\n\n    // test_array_failures\n    // Issue #785: Uninformative \"Unknown internal error\" exception when constructing array from\n    // empty object:\n    sm.def(\"array_fail_test\", []() { return py::array(py::object()); });\n    sm.def(\"array_t_fail_test\", []() { return py::array_t<double>(py::object()); });\n    // Make sure the error from numpy is being passed through:\n    sm.def(\"array_fail_test_negative_size\", []() {\n        int c = 0;\n        return py::array(-1, &c);\n    });\n\n    // test_initializer_list\n    // Issue (unnumbered; reported in #788): regression: initializer lists can be ambiguous\n    sm.def(\"array_initializer_list1\", []() { return py::array_t<float>(1); });\n    // { 1 } also works for the above, but clang warns about it\n    sm.def(\"array_initializer_list2\", []() { return py::array_t<float>({1, 2}); });\n    sm.def(\"array_initializer_list3\", []() { return py::array_t<float>({1, 2, 3}); });\n    sm.def(\"array_initializer_list4\", []() { return py::array_t<float>({1, 2, 3, 4}); });\n\n    // test_array_resize\n    // reshape array to 2D without changing size\n    sm.def(\"array_reshape2\", [](py::array_t<double> a) {\n        const auto dim_sz = (py::ssize_t) std::sqrt(a.size());\n        if (dim_sz * dim_sz != a.size()) {\n            throw std::domain_error(\n                \"array_reshape2: input array total size is not a squared integer\");\n        }\n        a.resize({dim_sz, dim_sz});\n    });\n\n    // resize to 3D array with each dimension = N\n    sm.def(\"array_resize3\", [](py::array_t<double> a, size_t N, bool refcheck) {\n        a.resize({N, N, N}, refcheck);\n    });\n\n    // test_array_create_and_resize\n    // return 2D array with Nrows = Ncols = N\n    sm.def(\"create_and_resize\", [](size_t N) {\n        py::array_t<double> a;\n        a.resize({N, N});\n        std::fill(a.mutable_data(), a.mutable_data() + a.size(), 42.);\n        return a;\n    });\n\n    sm.def(\"array_view\",\n           [](py::array_t<uint8_t> a, const std::string &dtype) { return a.view(dtype); });\n\n    sm.def(\"reshape_initializer_list\", [](py::array_t<int> a, size_t N, size_t M, size_t O) {\n        return a.reshape({N, M, O});\n    });\n    sm.def(\"reshape_tuple\", [](py::array_t<int> a, const std::vector<int> &new_shape) {\n        return a.reshape(new_shape);\n    });\n\n    sm.def(\"index_using_ellipsis\",\n           [](const py::array &a) { return a[py::make_tuple(0, py::ellipsis(), 0)]; });\n\n    // test_argument_conversions\n    sm.def(\n        \"accept_double\", [](const py::array_t<double, 0> &) {}, py::arg(\"a\"));\n    sm.def(\n        \"accept_double_forcecast\",\n        [](const py::array_t<double, py::array::forcecast> &) {},\n        py::arg(\"a\"));\n    sm.def(\n        \"accept_double_c_style\",\n        [](const py::array_t<double, py::array::c_style> &) {},\n        py::arg(\"a\"));\n    sm.def(\n        \"accept_double_c_style_forcecast\",\n        [](const py::array_t<double, py::array::forcecast | py::array::c_style> &) {},\n        py::arg(\"a\"));\n    sm.def(\n        \"accept_double_f_style\",\n        [](const py::array_t<double, py::array::f_style> &) {},\n        py::arg(\"a\"));\n    sm.def(\n        \"accept_double_f_style_forcecast\",\n        [](const py::array_t<double, py::array::forcecast | py::array::f_style> &) {},\n        py::arg(\"a\"));\n    sm.def(\n        \"accept_double_noconvert\", [](const py::array_t<double, 0> &) {}, \"a\"_a.noconvert());\n    sm.def(\n        \"accept_double_forcecast_noconvert\",\n        [](const py::array_t<double, py::array::forcecast> &) {},\n        \"a\"_a.noconvert());\n    sm.def(\n        \"accept_double_c_style_noconvert\",\n        [](const py::array_t<double, py::array::c_style> &) {},\n        \"a\"_a.noconvert());\n    sm.def(\n        \"accept_double_c_style_forcecast_noconvert\",\n        [](const py::array_t<double, py::array::forcecast | py::array::c_style> &) {},\n        \"a\"_a.noconvert());\n    sm.def(\n        \"accept_double_f_style_noconvert\",\n        [](const py::array_t<double, py::array::f_style> &) {},\n        \"a\"_a.noconvert());\n    sm.def(\n        \"accept_double_f_style_forcecast_noconvert\",\n        [](const py::array_t<double, py::array::forcecast | py::array::f_style> &) {},\n        \"a\"_a.noconvert());\n\n    // Check that types returns correct npy format descriptor\n    sm.def(\"test_fmt_desc_float\", [](const py::array_t<float> &) {});\n    sm.def(\"test_fmt_desc_double\", [](const py::array_t<double> &) {});\n    sm.def(\"test_fmt_desc_const_float\", [](const py::array_t<const float> &) {});\n    sm.def(\"test_fmt_desc_const_double\", [](const py::array_t<const double> &) {});\n\n    sm.def(\"round_trip_float\", [](double d) { return d; });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_numpy_array.py",
    "content": "import pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import numpy_array as m\n\nnp = pytest.importorskip(\"numpy\")\n\n\ndef test_dtypes():\n    # See issue #1328.\n    # - Platform-dependent sizes.\n    for size_check in m.get_platform_dtype_size_checks():\n        print(size_check)\n        assert size_check.size_cpp == size_check.size_numpy, size_check\n    # - Concrete sizes.\n    for check in m.get_concrete_dtype_checks():\n        print(check)\n        assert check.numpy == check.pybind11, check\n        if check.numpy.num != check.pybind11.num:\n            print(\n                f\"NOTE: typenum mismatch for {check}: {check.numpy.num} != {check.pybind11.num}\"\n            )\n\n\n@pytest.fixture(scope=\"function\")\ndef arr():\n    return np.array([[1, 2, 3], [4, 5, 6]], \"=u2\")\n\n\ndef test_array_attributes():\n    a = np.array(0, \"f8\")\n    assert m.ndim(a) == 0\n    assert all(m.shape(a) == [])\n    assert all(m.strides(a) == [])\n    with pytest.raises(IndexError) as excinfo:\n        m.shape(a, 0)\n    assert str(excinfo.value) == \"invalid axis: 0 (ndim = 0)\"\n    with pytest.raises(IndexError) as excinfo:\n        m.strides(a, 0)\n    assert str(excinfo.value) == \"invalid axis: 0 (ndim = 0)\"\n    assert m.writeable(a)\n    assert m.size(a) == 1\n    assert m.itemsize(a) == 8\n    assert m.nbytes(a) == 8\n    assert m.owndata(a)\n\n    a = np.array([[1, 2, 3], [4, 5, 6]], \"u2\").view()\n    a.flags.writeable = False\n    assert m.ndim(a) == 2\n    assert all(m.shape(a) == [2, 3])\n    assert m.shape(a, 0) == 2\n    assert m.shape(a, 1) == 3\n    assert all(m.strides(a) == [6, 2])\n    assert m.strides(a, 0) == 6\n    assert m.strides(a, 1) == 2\n    with pytest.raises(IndexError) as excinfo:\n        m.shape(a, 2)\n    assert str(excinfo.value) == \"invalid axis: 2 (ndim = 2)\"\n    with pytest.raises(IndexError) as excinfo:\n        m.strides(a, 2)\n    assert str(excinfo.value) == \"invalid axis: 2 (ndim = 2)\"\n    assert not m.writeable(a)\n    assert m.size(a) == 6\n    assert m.itemsize(a) == 2\n    assert m.nbytes(a) == 12\n    assert not m.owndata(a)\n\n\n@pytest.mark.parametrize(\n    \"args, ret\", [([], 0), ([0], 0), ([1], 3), ([0, 1], 1), ([1, 2], 5)]\n)\ndef test_index_offset(arr, args, ret):\n    assert m.index_at(arr, *args) == ret\n    assert m.index_at_t(arr, *args) == ret\n    assert m.offset_at(arr, *args) == ret * arr.dtype.itemsize\n    assert m.offset_at_t(arr, *args) == ret * arr.dtype.itemsize\n\n\ndef test_dim_check_fail(arr):\n    for func in (\n        m.index_at,\n        m.index_at_t,\n        m.offset_at,\n        m.offset_at_t,\n        m.data,\n        m.data_t,\n        m.mutate_data,\n        m.mutate_data_t,\n    ):\n        with pytest.raises(IndexError) as excinfo:\n            func(arr, 1, 2, 3)\n        assert str(excinfo.value) == \"too many indices for an array: 3 (ndim = 2)\"\n\n\n@pytest.mark.parametrize(\n    \"args, ret\",\n    [\n        ([], [1, 2, 3, 4, 5, 6]),\n        ([1], [4, 5, 6]),\n        ([0, 1], [2, 3, 4, 5, 6]),\n        ([1, 2], [6]),\n    ],\n)\ndef test_data(arr, args, ret):\n    from sys import byteorder\n\n    assert all(m.data_t(arr, *args) == ret)\n    assert all(m.data(arr, *args)[(0 if byteorder == \"little\" else 1) :: 2] == ret)\n    assert all(m.data(arr, *args)[(1 if byteorder == \"little\" else 0) :: 2] == 0)\n\n\n@pytest.mark.parametrize(\"dim\", [0, 1, 3])\ndef test_at_fail(arr, dim):\n    for func in m.at_t, m.mutate_at_t:\n        with pytest.raises(IndexError) as excinfo:\n            func(arr, *([0] * dim))\n        assert str(excinfo.value) == f\"index dimension mismatch: {dim} (ndim = 2)\"\n\n\ndef test_at(arr):\n    assert m.at_t(arr, 0, 2) == 3\n    assert m.at_t(arr, 1, 0) == 4\n\n    assert all(m.mutate_at_t(arr, 0, 2).ravel() == [1, 2, 4, 4, 5, 6])\n    assert all(m.mutate_at_t(arr, 1, 0).ravel() == [1, 2, 4, 5, 5, 6])\n\n\ndef test_mutate_readonly(arr):\n    arr.flags.writeable = False\n    for func, args in (\n        (m.mutate_data, ()),\n        (m.mutate_data_t, ()),\n        (m.mutate_at_t, (0, 0)),\n    ):\n        with pytest.raises(ValueError) as excinfo:\n            func(arr, *args)\n        assert str(excinfo.value) == \"array is not writeable\"\n\n\ndef test_mutate_data(arr):\n    assert all(m.mutate_data(arr).ravel() == [2, 4, 6, 8, 10, 12])\n    assert all(m.mutate_data(arr).ravel() == [4, 8, 12, 16, 20, 24])\n    assert all(m.mutate_data(arr, 1).ravel() == [4, 8, 12, 32, 40, 48])\n    assert all(m.mutate_data(arr, 0, 1).ravel() == [4, 16, 24, 64, 80, 96])\n    assert all(m.mutate_data(arr, 1, 2).ravel() == [4, 16, 24, 64, 80, 192])\n\n    assert all(m.mutate_data_t(arr).ravel() == [5, 17, 25, 65, 81, 193])\n    assert all(m.mutate_data_t(arr).ravel() == [6, 18, 26, 66, 82, 194])\n    assert all(m.mutate_data_t(arr, 1).ravel() == [6, 18, 26, 67, 83, 195])\n    assert all(m.mutate_data_t(arr, 0, 1).ravel() == [6, 19, 27, 68, 84, 196])\n    assert all(m.mutate_data_t(arr, 1, 2).ravel() == [6, 19, 27, 68, 84, 197])\n\n\ndef test_bounds_check(arr):\n    for func in (\n        m.index_at,\n        m.index_at_t,\n        m.data,\n        m.data_t,\n        m.mutate_data,\n        m.mutate_data_t,\n        m.at_t,\n        m.mutate_at_t,\n    ):\n        with pytest.raises(IndexError) as excinfo:\n            func(arr, 2, 0)\n        assert str(excinfo.value) == \"index 2 is out of bounds for axis 0 with size 2\"\n        with pytest.raises(IndexError) as excinfo:\n            func(arr, 0, 4)\n        assert str(excinfo.value) == \"index 4 is out of bounds for axis 1 with size 3\"\n\n\ndef test_make_c_f_array():\n    assert m.make_c_array().flags.c_contiguous\n    assert not m.make_c_array().flags.f_contiguous\n    assert m.make_f_array().flags.f_contiguous\n    assert not m.make_f_array().flags.c_contiguous\n\n\ndef test_make_empty_shaped_array():\n    m.make_empty_shaped_array()\n\n    # empty shape means numpy scalar, PEP 3118\n    assert m.scalar_int().ndim == 0\n    assert m.scalar_int().shape == ()\n    assert m.scalar_int() == 42\n\n\ndef test_wrap():\n    def assert_references(a, b, base=None):\n        if base is None:\n            base = a\n        assert a is not b\n        assert a.__array_interface__[\"data\"][0] == b.__array_interface__[\"data\"][0]\n        assert a.shape == b.shape\n        assert a.strides == b.strides\n        assert a.flags.c_contiguous == b.flags.c_contiguous\n        assert a.flags.f_contiguous == b.flags.f_contiguous\n        assert a.flags.writeable == b.flags.writeable\n        assert a.flags.aligned == b.flags.aligned\n        # 1.13 supported Python 3.6\n        if tuple(int(x) for x in np.__version__.split(\".\")[:2]) >= (1, 14):\n            assert a.flags.writebackifcopy == b.flags.writebackifcopy\n        else:\n            assert a.flags.updateifcopy == b.flags.updateifcopy\n        assert np.all(a == b)\n        assert not b.flags.owndata\n        assert b.base is base\n        if a.flags.writeable and a.ndim == 2:\n            a[0, 0] = 1234\n            assert b[0, 0] == 1234\n\n    a1 = np.array([1, 2], dtype=np.int16)\n    assert a1.flags.owndata and a1.base is None\n    a2 = m.wrap(a1)\n    assert_references(a1, a2)\n\n    a1 = np.array([[1, 2], [3, 4]], dtype=np.float32, order=\"F\")\n    assert a1.flags.owndata and a1.base is None\n    a2 = m.wrap(a1)\n    assert_references(a1, a2)\n\n    a1 = np.array([[1, 2], [3, 4]], dtype=np.float32, order=\"C\")\n    a1.flags.writeable = False\n    a2 = m.wrap(a1)\n    assert_references(a1, a2)\n\n    a1 = np.random.random((4, 4, 4))\n    a2 = m.wrap(a1)\n    assert_references(a1, a2)\n\n    a1t = a1.transpose()\n    a2 = m.wrap(a1t)\n    assert_references(a1t, a2, a1)\n\n    a1d = a1.diagonal()\n    a2 = m.wrap(a1d)\n    assert_references(a1d, a2, a1)\n\n    a1m = a1[::-1, ::-1, ::-1]\n    a2 = m.wrap(a1m)\n    assert_references(a1m, a2, a1)\n\n\ndef test_numpy_view(capture):\n    with capture:\n        ac = m.ArrayClass()\n        ac_view_1 = ac.numpy_view()\n        ac_view_2 = ac.numpy_view()\n        assert np.all(ac_view_1 == np.array([1, 2], dtype=np.int32))\n        del ac\n        pytest.gc_collect()\n    assert (\n        capture\n        == \"\"\"\n        ArrayClass()\n        ArrayClass::numpy_view()\n        ArrayClass::numpy_view()\n    \"\"\"\n    )\n    ac_view_1[0] = 4\n    ac_view_1[1] = 3\n    assert ac_view_2[0] == 4\n    assert ac_view_2[1] == 3\n    with capture:\n        del ac_view_1\n        del ac_view_2\n        pytest.gc_collect()\n        pytest.gc_collect()\n    assert (\n        capture\n        == \"\"\"\n        ~ArrayClass()\n    \"\"\"\n    )\n\n\ndef test_cast_numpy_int64_to_uint64():\n    m.function_taking_uint64(123)\n    m.function_taking_uint64(np.uint64(123))\n\n\ndef test_isinstance():\n    assert m.isinstance_untyped(np.array([1, 2, 3]), \"not an array\")\n    assert m.isinstance_typed(np.array([1.0, 2.0, 3.0]))\n\n\ndef test_constructors():\n    defaults = m.default_constructors()\n    for a in defaults.values():\n        assert a.size == 0\n    assert defaults[\"array\"].dtype == np.array([]).dtype\n    assert defaults[\"array_t<int32>\"].dtype == np.int32\n    assert defaults[\"array_t<double>\"].dtype == np.float64\n\n    results = m.converting_constructors([1, 2, 3])\n    for a in results.values():\n        np.testing.assert_array_equal(a, [1, 2, 3])\n    assert results[\"array\"].dtype == np.int_\n    assert results[\"array_t<int32>\"].dtype == np.int32\n    assert results[\"array_t<double>\"].dtype == np.float64\n\n\ndef test_overload_resolution(msg):\n    # Exact overload matches:\n    assert m.overloaded(np.array([1], dtype=\"float64\")) == \"double\"\n    assert m.overloaded(np.array([1], dtype=\"float32\")) == \"float\"\n    assert m.overloaded(np.array([1], dtype=\"ushort\")) == \"unsigned short\"\n    assert m.overloaded(np.array([1], dtype=\"intc\")) == \"int\"\n    assert m.overloaded(np.array([1], dtype=\"longlong\")) == \"long long\"\n    assert m.overloaded(np.array([1], dtype=\"complex\")) == \"double complex\"\n    assert m.overloaded(np.array([1], dtype=\"csingle\")) == \"float complex\"\n\n    # No exact match, should call first convertible version:\n    assert m.overloaded(np.array([1], dtype=\"uint8\")) == \"double\"\n\n    with pytest.raises(TypeError) as excinfo:\n        m.overloaded(\"not an array\")\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        overloaded(): incompatible function arguments. The following argument types are supported:\n            1. (arg0: numpy.ndarray[numpy.float64]) -> str\n            2. (arg0: numpy.ndarray[numpy.float32]) -> str\n            3. (arg0: numpy.ndarray[numpy.int32]) -> str\n            4. (arg0: numpy.ndarray[numpy.uint16]) -> str\n            5. (arg0: numpy.ndarray[numpy.int64]) -> str\n            6. (arg0: numpy.ndarray[numpy.complex128]) -> str\n            7. (arg0: numpy.ndarray[numpy.complex64]) -> str\n\n        Invoked with: 'not an array'\n    \"\"\"\n    )\n\n    assert m.overloaded2(np.array([1], dtype=\"float64\")) == \"double\"\n    assert m.overloaded2(np.array([1], dtype=\"float32\")) == \"float\"\n    assert m.overloaded2(np.array([1], dtype=\"complex64\")) == \"float complex\"\n    assert m.overloaded2(np.array([1], dtype=\"complex128\")) == \"double complex\"\n    assert m.overloaded2(np.array([1], dtype=\"float32\")) == \"float\"\n\n    assert m.overloaded3(np.array([1], dtype=\"float64\")) == \"double\"\n    assert m.overloaded3(np.array([1], dtype=\"intc\")) == \"int\"\n    expected_exc = \"\"\"\n        overloaded3(): incompatible function arguments. The following argument types are supported:\n            1. (arg0: numpy.ndarray[numpy.int32]) -> str\n            2. (arg0: numpy.ndarray[numpy.float64]) -> str\n\n        Invoked with: \"\"\"\n\n    with pytest.raises(TypeError) as excinfo:\n        m.overloaded3(np.array([1], dtype=\"uintc\"))\n    assert msg(excinfo.value) == expected_exc + repr(np.array([1], dtype=\"uint32\"))\n    with pytest.raises(TypeError) as excinfo:\n        m.overloaded3(np.array([1], dtype=\"float32\"))\n    assert msg(excinfo.value) == expected_exc + repr(np.array([1.0], dtype=\"float32\"))\n    with pytest.raises(TypeError) as excinfo:\n        m.overloaded3(np.array([1], dtype=\"complex\"))\n    assert msg(excinfo.value) == expected_exc + repr(np.array([1.0 + 0.0j]))\n\n    # Exact matches:\n    assert m.overloaded4(np.array([1], dtype=\"double\")) == \"double\"\n    assert m.overloaded4(np.array([1], dtype=\"longlong\")) == \"long long\"\n    # Non-exact matches requiring conversion.  Since float to integer isn't a\n    # save conversion, it should go to the double overload, but short can go to\n    # either (and so should end up on the first-registered, the long long).\n    assert m.overloaded4(np.array([1], dtype=\"float32\")) == \"double\"\n    assert m.overloaded4(np.array([1], dtype=\"short\")) == \"long long\"\n\n    assert m.overloaded5(np.array([1], dtype=\"double\")) == \"double\"\n    assert m.overloaded5(np.array([1], dtype=\"uintc\")) == \"unsigned int\"\n    assert m.overloaded5(np.array([1], dtype=\"float32\")) == \"unsigned int\"\n\n\ndef test_greedy_string_overload():\n    \"\"\"Tests fix for #685 - ndarray shouldn't go to std::string overload\"\"\"\n\n    assert m.issue685(\"abc\") == \"string\"\n    assert m.issue685(np.array([97, 98, 99], dtype=\"b\")) == \"array\"\n    assert m.issue685(123) == \"other\"\n\n\ndef test_array_unchecked_fixed_dims(msg):\n    z1 = np.array([[1, 2], [3, 4]], dtype=\"float64\")\n    m.proxy_add2(z1, 10)\n    assert np.all(z1 == [[11, 12], [13, 14]])\n\n    with pytest.raises(ValueError) as excinfo:\n        m.proxy_add2(np.array([1.0, 2, 3]), 5.0)\n    assert (\n        msg(excinfo.value) == \"array has incorrect number of dimensions: 1; expected 2\"\n    )\n\n    expect_c = np.ndarray(shape=(3, 3, 3), buffer=np.array(range(3, 30)), dtype=\"int\")\n    assert np.all(m.proxy_init3(3.0) == expect_c)\n    expect_f = np.transpose(expect_c)\n    assert np.all(m.proxy_init3F(3.0) == expect_f)\n\n    assert m.proxy_squared_L2_norm(np.array(range(6))) == 55\n    assert m.proxy_squared_L2_norm(np.array(range(6), dtype=\"float64\")) == 55\n\n    assert m.proxy_auxiliaries2(z1) == [11, 11, True, 2, 8, 2, 2, 4, 32]\n    assert m.proxy_auxiliaries2(z1) == m.array_auxiliaries2(z1)\n\n    assert m.proxy_auxiliaries1_const_ref(z1[0, :])\n    assert m.proxy_auxiliaries2_const_ref(z1)\n\n\ndef test_array_unchecked_dyn_dims():\n    z1 = np.array([[1, 2], [3, 4]], dtype=\"float64\")\n    m.proxy_add2_dyn(z1, 10)\n    assert np.all(z1 == [[11, 12], [13, 14]])\n\n    expect_c = np.ndarray(shape=(3, 3, 3), buffer=np.array(range(3, 30)), dtype=\"int\")\n    assert np.all(m.proxy_init3_dyn(3.0) == expect_c)\n\n    assert m.proxy_auxiliaries2_dyn(z1) == [11, 11, True, 2, 8, 2, 2, 4, 32]\n    assert m.proxy_auxiliaries2_dyn(z1) == m.array_auxiliaries2(z1)\n\n\ndef test_array_failure():\n    with pytest.raises(ValueError) as excinfo:\n        m.array_fail_test()\n    assert str(excinfo.value) == \"cannot create a pybind11::array from a nullptr\"\n\n    with pytest.raises(ValueError) as excinfo:\n        m.array_t_fail_test()\n    assert str(excinfo.value) == \"cannot create a pybind11::array_t from a nullptr\"\n\n    with pytest.raises(ValueError) as excinfo:\n        m.array_fail_test_negative_size()\n    assert str(excinfo.value) == \"negative dimensions are not allowed\"\n\n\ndef test_initializer_list():\n    assert m.array_initializer_list1().shape == (1,)\n    assert m.array_initializer_list2().shape == (1, 2)\n    assert m.array_initializer_list3().shape == (1, 2, 3)\n    assert m.array_initializer_list4().shape == (1, 2, 3, 4)\n\n\ndef test_array_resize():\n    a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=\"float64\")\n    m.array_reshape2(a)\n    assert a.size == 9\n    assert np.all(a == [[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n\n    # total size change should succced with refcheck off\n    m.array_resize3(a, 4, False)\n    assert a.size == 64\n    # ... and fail with refcheck on\n    try:\n        m.array_resize3(a, 3, True)\n    except ValueError as e:\n        assert str(e).startswith(\"cannot resize an array\")\n    # transposed array doesn't own data\n    b = a.transpose()\n    try:\n        m.array_resize3(b, 3, False)\n    except ValueError as e:\n        assert str(e).startswith(\"cannot resize this array: it does not own its data\")\n    # ... but reshape should be fine\n    m.array_reshape2(b)\n    assert b.shape == (8, 8)\n\n\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_array_create_and_resize():\n    a = m.create_and_resize(2)\n    assert a.size == 4\n    assert np.all(a == 42.0)\n\n\ndef test_array_view():\n    a = np.ones(100 * 4).astype(\"uint8\")\n    a_float_view = m.array_view(a, \"float32\")\n    assert a_float_view.shape == (100 * 1,)  # 1 / 4 bytes = 8 / 32\n\n    a_int16_view = m.array_view(a, \"int16\")  # 1 / 2 bytes = 16 / 32\n    assert a_int16_view.shape == (100 * 2,)\n\n\ndef test_array_view_invalid():\n    a = np.ones(100 * 4).astype(\"uint8\")\n    with pytest.raises(TypeError):\n        m.array_view(a, \"deadly_dtype\")\n\n\ndef test_reshape_initializer_list():\n    a = np.arange(2 * 7 * 3) + 1\n    x = m.reshape_initializer_list(a, 2, 7, 3)\n    assert x.shape == (2, 7, 3)\n    assert list(x[1][4]) == [34, 35, 36]\n    with pytest.raises(ValueError) as excinfo:\n        m.reshape_initializer_list(a, 1, 7, 3)\n    assert str(excinfo.value) == \"cannot reshape array of size 42 into shape (1,7,3)\"\n\n\ndef test_reshape_tuple():\n    a = np.arange(3 * 7 * 2) + 1\n    x = m.reshape_tuple(a, (3, 7, 2))\n    assert x.shape == (3, 7, 2)\n    assert list(x[1][4]) == [23, 24]\n    y = m.reshape_tuple(x, (x.size,))\n    assert y.shape == (42,)\n    with pytest.raises(ValueError) as excinfo:\n        m.reshape_tuple(a, (3, 7, 1))\n    assert str(excinfo.value) == \"cannot reshape array of size 42 into shape (3,7,1)\"\n    with pytest.raises(ValueError) as excinfo:\n        m.reshape_tuple(a, ())\n    assert str(excinfo.value) == \"cannot reshape array of size 42 into shape ()\"\n\n\ndef test_index_using_ellipsis():\n    a = m.index_using_ellipsis(np.zeros((5, 6, 7)))\n    assert a.shape == (6,)\n\n\n@pytest.mark.parametrize(\n    \"test_func\",\n    [\n        m.test_fmt_desc_float,\n        m.test_fmt_desc_double,\n        m.test_fmt_desc_const_float,\n        m.test_fmt_desc_const_double,\n    ],\n)\ndef test_format_descriptors_for_floating_point_types(test_func):\n    assert \"numpy.ndarray[numpy.float\" in test_func.__doc__\n\n\n@pytest.mark.parametrize(\"forcecast\", [False, True])\n@pytest.mark.parametrize(\"contiguity\", [None, \"C\", \"F\"])\n@pytest.mark.parametrize(\"noconvert\", [False, True])\n@pytest.mark.filterwarnings(\n    \"ignore:Casting complex values to real discards the imaginary part:numpy.ComplexWarning\"\n)\ndef test_argument_conversions(forcecast, contiguity, noconvert):\n    function_name = \"accept_double\"\n    if contiguity == \"C\":\n        function_name += \"_c_style\"\n    elif contiguity == \"F\":\n        function_name += \"_f_style\"\n    if forcecast:\n        function_name += \"_forcecast\"\n    if noconvert:\n        function_name += \"_noconvert\"\n    function = getattr(m, function_name)\n\n    for dtype in [np.dtype(\"float32\"), np.dtype(\"float64\"), np.dtype(\"complex128\")]:\n        for order in [\"C\", \"F\"]:\n            for shape in [(2, 2), (1, 3, 1, 1), (1, 1, 1), (0,)]:\n                if not noconvert:\n                    # If noconvert is not passed, only complex128 needs to be truncated and\n                    # \"cannot be safely obtained\". So without `forcecast`, the argument shouldn't\n                    # be accepted.\n                    should_raise = dtype.name == \"complex128\" and not forcecast\n                else:\n                    # If noconvert is passed, only float64 and the matching order is accepted.\n                    # If at most one dimension has a size greater than 1, the array is also\n                    # trivially contiguous.\n                    trivially_contiguous = sum(1 for d in shape if d > 1) <= 1\n                    should_raise = dtype.name != \"float64\" or (\n                        contiguity is not None\n                        and contiguity != order\n                        and not trivially_contiguous\n                    )\n\n                array = np.zeros(shape, dtype=dtype, order=order)\n                if not should_raise:\n                    function(array)\n                else:\n                    with pytest.raises(\n                        TypeError, match=\"incompatible function arguments\"\n                    ):\n                        function(array)\n\n\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_dtype_refcount_leak():\n    from sys import getrefcount\n\n    dtype = np.dtype(np.float_)\n    a = np.array([1], dtype=dtype)\n    before = getrefcount(dtype)\n    m.ndim(a)\n    after = getrefcount(dtype)\n    assert after == before\n\n\ndef test_round_trip_float():\n    arr = np.zeros((), np.float64)\n    arr[()] = 37.2\n    assert m.round_trip_float(arr) == 37.2\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_numpy_dtypes.cpp",
    "content": "/*\n  tests/test_numpy_dtypes.cpp -- Structured and compound NumPy dtypes\n\n  Copyright (c) 2016 Ivan Smirnov\n\n  All rights reserved. Use of this source code is governed by a\n  BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/numpy.h>\n\n#include \"pybind11_tests.h\"\n\n#ifdef __GNUC__\n#    define PYBIND11_PACKED(cls) cls __attribute__((__packed__))\n#else\n#    define PYBIND11_PACKED(cls) __pragma(pack(push, 1)) cls __pragma(pack(pop))\n#endif\n\nnamespace py = pybind11;\n\nstruct SimpleStruct {\n    bool bool_;\n    uint32_t uint_;\n    float float_;\n    long double ldbl_;\n};\n\nstd::ostream &operator<<(std::ostream &os, const SimpleStruct &v) {\n    return os << \"s:\" << v.bool_ << \",\" << v.uint_ << \",\" << v.float_ << \",\" << v.ldbl_;\n}\n\nstruct SimpleStructReordered {\n    bool bool_;\n    float float_;\n    uint32_t uint_;\n    long double ldbl_;\n};\n\nPYBIND11_PACKED(struct PackedStruct {\n    bool bool_;\n    uint32_t uint_;\n    float float_;\n    long double ldbl_;\n});\n\nstd::ostream &operator<<(std::ostream &os, const PackedStruct &v) {\n    return os << \"p:\" << v.bool_ << \",\" << v.uint_ << \",\" << v.float_ << \",\" << v.ldbl_;\n}\n\nPYBIND11_PACKED(struct NestedStruct {\n    SimpleStruct a;\n    PackedStruct b;\n});\n\nstd::ostream &operator<<(std::ostream &os, const NestedStruct &v) {\n    return os << \"n:a=\" << v.a << \";b=\" << v.b;\n}\n\nstruct PartialStruct {\n    bool bool_;\n    uint32_t uint_;\n    float float_;\n    uint64_t dummy2;\n    long double ldbl_;\n};\n\nstruct PartialNestedStruct {\n    uint64_t dummy1;\n    PartialStruct a;\n    uint64_t dummy2;\n};\n\nstruct UnboundStruct {};\n\nstruct StringStruct {\n    char a[3];\n    std::array<char, 3> b;\n};\n\nstruct ComplexStruct {\n    std::complex<float> cflt;\n    std::complex<double> cdbl;\n};\n\nstd::ostream &operator<<(std::ostream &os, const ComplexStruct &v) {\n    return os << \"c:\" << v.cflt << \",\" << v.cdbl;\n}\n\nstruct ArrayStruct {\n    char a[3][4];\n    int32_t b[2];\n    std::array<uint8_t, 3> c;\n    std::array<float, 2> d[4];\n};\n\nPYBIND11_PACKED(struct StructWithUglyNames {\n    int8_t __x__;\n    uint64_t __y__;\n});\n\nenum class E1 : int64_t { A = -1, B = 1 };\nenum E2 : uint8_t { X = 1, Y = 2 };\n\nPYBIND11_PACKED(struct EnumStruct {\n    E1 e1;\n    E2 e2;\n});\n\nstd::ostream &operator<<(std::ostream &os, const StringStruct &v) {\n    os << \"a='\";\n    for (size_t i = 0; i < 3 && (v.a[i] != 0); i++) {\n        os << v.a[i];\n    }\n    os << \"',b='\";\n    for (size_t i = 0; i < 3 && (v.b[i] != 0); i++) {\n        os << v.b[i];\n    }\n    return os << \"'\";\n}\n\nstd::ostream &operator<<(std::ostream &os, const ArrayStruct &v) {\n    os << \"a={\";\n    for (int i = 0; i < 3; i++) {\n        if (i > 0) {\n            os << ',';\n        }\n        os << '{';\n        for (int j = 0; j < 3; j++) {\n            os << v.a[i][j] << ',';\n        }\n        os << v.a[i][3] << '}';\n    }\n    os << \"},b={\" << v.b[0] << ',' << v.b[1];\n    os << \"},c={\" << int(v.c[0]) << ',' << int(v.c[1]) << ',' << int(v.c[2]);\n    os << \"},d={\";\n    for (int i = 0; i < 4; i++) {\n        if (i > 0) {\n            os << ',';\n        }\n        os << '{' << v.d[i][0] << ',' << v.d[i][1] << '}';\n    }\n    return os << '}';\n}\n\nstd::ostream &operator<<(std::ostream &os, const EnumStruct &v) {\n    return os << \"e1=\" << (v.e1 == E1::A ? \"A\" : \"B\") << \",e2=\" << (v.e2 == E2::X ? \"X\" : \"Y\");\n}\n\ntemplate <typename T>\npy::array mkarray_via_buffer(size_t n) {\n    return py::array(py::buffer_info(\n        nullptr, sizeof(T), py::format_descriptor<T>::format(), 1, {n}, {sizeof(T)}));\n}\n\n#define SET_TEST_VALS(s, i)                                                                       \\\n    do {                                                                                          \\\n        (s).bool_ = (i) % 2 != 0;                                                                 \\\n        (s).uint_ = (uint32_t) (i);                                                               \\\n        (s).float_ = (float) (i) *1.5f;                                                           \\\n        (s).ldbl_ = (long double) (i) * -2.5L;                                                    \\\n    } while (0)\n\ntemplate <typename S>\npy::array_t<S, 0> create_recarray(size_t n) {\n    auto arr = mkarray_via_buffer<S>(n);\n    auto req = arr.request();\n    auto *ptr = static_cast<S *>(req.ptr);\n    for (size_t i = 0; i < n; i++) {\n        SET_TEST_VALS(ptr[i], i);\n    }\n    return arr;\n}\n\ntemplate <typename S>\npy::list print_recarray(py::array_t<S, 0> arr) {\n    const auto req = arr.request();\n    auto *const ptr = static_cast<S *>(req.ptr);\n    auto l = py::list();\n    for (py::ssize_t i = 0; i < req.size; i++) {\n        std::stringstream ss;\n        ss << ptr[i];\n        l.append(py::str(ss.str()));\n    }\n    return l;\n}\n\npy::array_t<int32_t, 0> test_array_ctors(int i) {\n    using arr_t = py::array_t<int32_t, 0>;\n\n    std::vector<int32_t> data{1, 2, 3, 4, 5, 6};\n    std::vector<py::ssize_t> shape{3, 2};\n    std::vector<py::ssize_t> strides{8, 4};\n\n    auto *ptr = data.data();\n    auto *vptr = (void *) ptr;\n    auto dtype = py::dtype(\"int32\");\n\n    py::buffer_info buf_ndim1(vptr, 4, \"i\", 6);\n    py::buffer_info buf_ndim1_null(nullptr, 4, \"i\", 6);\n    py::buffer_info buf_ndim2(vptr, 4, \"i\", 2, shape, strides);\n    py::buffer_info buf_ndim2_null(nullptr, 4, \"i\", 2, shape, strides);\n\n    auto fill = [](py::array arr) {\n        auto req = arr.request();\n        for (int i = 0; i < 6; i++) {\n            ((int32_t *) req.ptr)[i] = i + 1;\n        }\n        return arr;\n    };\n\n    switch (i) {\n        // shape: (3, 2)\n        case 10:\n            return arr_t(shape, strides, ptr);\n        case 11:\n            return py::array(shape, strides, ptr);\n        case 12:\n            return py::array(dtype, shape, strides, vptr);\n        case 13:\n            return arr_t(shape, ptr);\n        case 14:\n            return py::array(shape, ptr);\n        case 15:\n            return py::array(dtype, shape, vptr);\n        case 16:\n            return arr_t(buf_ndim2);\n        case 17:\n            return py::array(buf_ndim2);\n        // shape: (3, 2) - post-fill\n        case 20:\n            return fill(arr_t(shape, strides));\n        case 21:\n            return py::array(shape, strides, ptr); // can't have nullptr due to templated ctor\n        case 22:\n            return fill(py::array(dtype, shape, strides));\n        case 23:\n            return fill(arr_t(shape));\n        case 24:\n            return py::array(shape, ptr); // can't have nullptr due to templated ctor\n        case 25:\n            return fill(py::array(dtype, shape));\n        case 26:\n            return fill(arr_t(buf_ndim2_null));\n        case 27:\n            return fill(py::array(buf_ndim2_null));\n        // shape: (6, )\n        case 30:\n            return arr_t(6, ptr);\n        case 31:\n            return py::array(6, ptr);\n        case 32:\n            return py::array(dtype, 6, vptr);\n        case 33:\n            return arr_t(buf_ndim1);\n        case 34:\n            return py::array(buf_ndim1);\n        // shape: (6, )\n        case 40:\n            return fill(arr_t(6));\n        case 41:\n            return py::array(6, ptr); // can't have nullptr due to templated ctor\n        case 42:\n            return fill(py::array(dtype, 6));\n        case 43:\n            return fill(arr_t(buf_ndim1_null));\n        case 44:\n            return fill(py::array(buf_ndim1_null));\n    }\n    return arr_t();\n}\n\npy::list test_dtype_ctors() {\n    py::list list;\n    list.append(py::dtype(\"int32\"));\n    list.append(py::dtype(std::string(\"float64\")));\n    list.append(py::dtype::from_args(py::str(\"bool\")));\n    py::list names, offsets, formats;\n    py::dict dict;\n    names.append(py::str(\"a\"));\n    names.append(py::str(\"b\"));\n    dict[\"names\"] = names;\n    offsets.append(py::int_(1));\n    offsets.append(py::int_(10));\n    dict[\"offsets\"] = offsets;\n    formats.append(py::dtype(\"int32\"));\n    formats.append(py::dtype(\"float64\"));\n    dict[\"formats\"] = formats;\n    dict[\"itemsize\"] = py::int_(20);\n    list.append(py::dtype::from_args(dict));\n    list.append(py::dtype(names, formats, offsets, 20));\n    list.append(py::dtype(py::buffer_info((void *) nullptr, sizeof(unsigned int), \"I\", 1)));\n    list.append(py::dtype(py::buffer_info((void *) nullptr, 0, \"T{i:a:f:b:}\", 1)));\n    list.append(py::dtype(py::detail::npy_api::NPY_DOUBLE_));\n    return list;\n}\n\nstruct A {};\nstruct B {};\n\nTEST_SUBMODULE(numpy_dtypes, m) {\n    try {\n        py::module_::import(\"numpy\");\n    } catch (const py::error_already_set &) {\n        return;\n    }\n\n    // typeinfo may be registered before the dtype descriptor for scalar casts to work...\n    py::class_<SimpleStruct>(m, \"SimpleStruct\")\n        // Explicit construct to ensure zero-valued initialization.\n        .def(py::init([]() { return SimpleStruct(); }))\n        .def_readwrite(\"bool_\", &SimpleStruct::bool_)\n        .def_readwrite(\"uint_\", &SimpleStruct::uint_)\n        .def_readwrite(\"float_\", &SimpleStruct::float_)\n        .def_readwrite(\"ldbl_\", &SimpleStruct::ldbl_)\n        .def(\"astuple\",\n             [](const SimpleStruct &self) {\n                 return py::make_tuple(self.bool_, self.uint_, self.float_, self.ldbl_);\n             })\n        .def_static(\"fromtuple\", [](const py::tuple &tup) {\n            if (py::len(tup) != 4) {\n                throw py::cast_error(\"Invalid size\");\n            }\n            return SimpleStruct{tup[0].cast<bool>(),\n                                tup[1].cast<uint32_t>(),\n                                tup[2].cast<float>(),\n                                tup[3].cast<long double>()};\n        });\n\n    PYBIND11_NUMPY_DTYPE(SimpleStruct, bool_, uint_, float_, ldbl_);\n    PYBIND11_NUMPY_DTYPE(SimpleStructReordered, bool_, uint_, float_, ldbl_);\n    PYBIND11_NUMPY_DTYPE(PackedStruct, bool_, uint_, float_, ldbl_);\n    PYBIND11_NUMPY_DTYPE(NestedStruct, a, b);\n    PYBIND11_NUMPY_DTYPE(PartialStruct, bool_, uint_, float_, ldbl_);\n    PYBIND11_NUMPY_DTYPE(PartialNestedStruct, a);\n    PYBIND11_NUMPY_DTYPE(StringStruct, a, b);\n    PYBIND11_NUMPY_DTYPE(ArrayStruct, a, b, c, d);\n    PYBIND11_NUMPY_DTYPE(EnumStruct, e1, e2);\n    PYBIND11_NUMPY_DTYPE(ComplexStruct, cflt, cdbl);\n\n    // ... or after\n    py::class_<PackedStruct>(m, \"PackedStruct\");\n\n    PYBIND11_NUMPY_DTYPE_EX(StructWithUglyNames, __x__, \"x\", __y__, \"y\");\n\n#ifdef PYBIND11_NEVER_DEFINED_EVER\n    // If enabled, this should produce a static_assert failure telling the user that the struct\n    // is not a POD type\n    struct NotPOD {\n        std::string v;\n        NotPOD() : v(\"hi\"){};\n    };\n    PYBIND11_NUMPY_DTYPE(NotPOD, v);\n#endif\n\n    // Check that dtypes can be registered programmatically, both from\n    // initializer lists of field descriptors and from other containers.\n    py::detail::npy_format_descriptor<A>::register_dtype({});\n    py::detail::npy_format_descriptor<B>::register_dtype(\n        std::vector<py::detail::field_descriptor>{});\n\n    // test_recarray, test_scalar_conversion\n    m.def(\"create_rec_simple\", &create_recarray<SimpleStruct>);\n    m.def(\"create_rec_packed\", &create_recarray<PackedStruct>);\n    m.def(\"create_rec_nested\", [](size_t n) { // test_signature\n        py::array_t<NestedStruct, 0> arr = mkarray_via_buffer<NestedStruct>(n);\n        auto req = arr.request();\n        auto *ptr = static_cast<NestedStruct *>(req.ptr);\n        for (size_t i = 0; i < n; i++) {\n            SET_TEST_VALS(ptr[i].a, i);\n            SET_TEST_VALS(ptr[i].b, i + 1);\n        }\n        return arr;\n    });\n    m.def(\"create_rec_partial\", &create_recarray<PartialStruct>);\n    m.def(\"create_rec_partial_nested\", [](size_t n) {\n        py::array_t<PartialNestedStruct, 0> arr = mkarray_via_buffer<PartialNestedStruct>(n);\n        auto req = arr.request();\n        auto *ptr = static_cast<PartialNestedStruct *>(req.ptr);\n        for (size_t i = 0; i < n; i++) {\n            SET_TEST_VALS(ptr[i].a, i);\n        }\n        return arr;\n    });\n    m.def(\"print_rec_simple\", &print_recarray<SimpleStruct>);\n    m.def(\"print_rec_packed\", &print_recarray<PackedStruct>);\n    m.def(\"print_rec_nested\", &print_recarray<NestedStruct>);\n\n    // test_format_descriptors\n    m.def(\"get_format_unbound\", []() { return py::format_descriptor<UnboundStruct>::format(); });\n    m.def(\"print_format_descriptors\", []() {\n        py::list l;\n        for (const auto &fmt : {py::format_descriptor<SimpleStruct>::format(),\n                                py::format_descriptor<PackedStruct>::format(),\n                                py::format_descriptor<NestedStruct>::format(),\n                                py::format_descriptor<PartialStruct>::format(),\n                                py::format_descriptor<PartialNestedStruct>::format(),\n                                py::format_descriptor<StringStruct>::format(),\n                                py::format_descriptor<ArrayStruct>::format(),\n                                py::format_descriptor<EnumStruct>::format(),\n                                py::format_descriptor<ComplexStruct>::format()}) {\n            l.append(py::cast(fmt));\n        }\n        return l;\n    });\n\n    // test_dtype\n    std::vector<const char *> dtype_names{\n        \"byte\",    \"short\",   \"intc\",        \"int_\",  \"longlong\",   \"ubyte\",       \"ushort\",\n        \"uintc\",   \"uint\",    \"ulonglong\",   \"half\",  \"single\",     \"double\",      \"longdouble\",\n        \"csingle\", \"cdouble\", \"clongdouble\", \"bool_\", \"datetime64\", \"timedelta64\", \"object_\"};\n\n    m.def(\"print_dtypes\", []() {\n        py::list l;\n        for (const py::handle &d : {py::dtype::of<SimpleStruct>(),\n                                    py::dtype::of<PackedStruct>(),\n                                    py::dtype::of<NestedStruct>(),\n                                    py::dtype::of<PartialStruct>(),\n                                    py::dtype::of<PartialNestedStruct>(),\n                                    py::dtype::of<StringStruct>(),\n                                    py::dtype::of<ArrayStruct>(),\n                                    py::dtype::of<EnumStruct>(),\n                                    py::dtype::of<StructWithUglyNames>(),\n                                    py::dtype::of<ComplexStruct>()}) {\n            l.append(py::str(d));\n        }\n        return l;\n    });\n    m.def(\"test_dtype_ctors\", &test_dtype_ctors);\n    m.def(\"test_dtype_kind\", [dtype_names]() {\n        py::list list;\n        for (const auto &dt_name : dtype_names) {\n            list.append(py::dtype(dt_name).kind());\n        }\n        return list;\n    });\n    m.def(\"test_dtype_char_\", [dtype_names]() {\n        py::list list;\n        for (const auto &dt_name : dtype_names) {\n            list.append(py::dtype(dt_name).char_());\n        }\n        return list;\n    });\n    m.def(\"test_dtype_num\", [dtype_names]() {\n        py::list list;\n        for (const auto &dt_name : dtype_names) {\n            list.append(py::dtype(dt_name).num());\n        }\n        return list;\n    });\n    m.def(\"test_dtype_byteorder\", [dtype_names]() {\n        py::list list;\n        for (const auto &dt_name : dtype_names) {\n            list.append(py::dtype(dt_name).byteorder());\n        }\n        return list;\n    });\n    m.def(\"test_dtype_alignment\", [dtype_names]() {\n        py::list list;\n        for (const auto &dt_name : dtype_names) {\n            list.append(py::dtype(dt_name).alignment());\n        }\n        return list;\n    });\n    m.def(\"test_dtype_flags\", [dtype_names]() {\n        py::list list;\n        for (const auto &dt_name : dtype_names) {\n            list.append(py::dtype(dt_name).flags());\n        }\n        return list;\n    });\n    m.def(\"test_dtype_methods\", []() {\n        py::list list;\n        auto dt1 = py::dtype::of<int32_t>();\n        auto dt2 = py::dtype::of<SimpleStruct>();\n        list.append(dt1);\n        list.append(dt2);\n        list.append(py::bool_(dt1.has_fields()));\n        list.append(py::bool_(dt2.has_fields()));\n        list.append(py::int_(dt1.itemsize()));\n        list.append(py::int_(dt2.itemsize()));\n        return list;\n    });\n    struct TrailingPaddingStruct {\n        int32_t a;\n        char b;\n    };\n    PYBIND11_NUMPY_DTYPE(TrailingPaddingStruct, a, b);\n    m.def(\"trailing_padding_dtype\", []() { return py::dtype::of<TrailingPaddingStruct>(); });\n\n    // test_string_array\n    m.def(\"create_string_array\", [](bool non_empty) {\n        py::array_t<StringStruct, 0> arr = mkarray_via_buffer<StringStruct>(non_empty ? 4 : 0);\n        if (non_empty) {\n            auto req = arr.request();\n            auto *ptr = static_cast<StringStruct *>(req.ptr);\n            for (py::ssize_t i = 0; i < req.size * req.itemsize; i++) {\n                static_cast<char *>(req.ptr)[i] = 0;\n            }\n            ptr[1].a[0] = 'a';\n            ptr[1].b[0] = 'a';\n            ptr[2].a[0] = 'a';\n            ptr[2].b[0] = 'a';\n            ptr[3].a[0] = 'a';\n            ptr[3].b[0] = 'a';\n\n            ptr[2].a[1] = 'b';\n            ptr[2].b[1] = 'b';\n            ptr[3].a[1] = 'b';\n            ptr[3].b[1] = 'b';\n\n            ptr[3].a[2] = 'c';\n            ptr[3].b[2] = 'c';\n        }\n        return arr;\n    });\n    m.def(\"print_string_array\", &print_recarray<StringStruct>);\n\n    // test_array_array\n    m.def(\"create_array_array\", [](size_t n) {\n        py::array_t<ArrayStruct, 0> arr = mkarray_via_buffer<ArrayStruct>(n);\n        auto *ptr = (ArrayStruct *) arr.mutable_data();\n        for (size_t i = 0; i < n; i++) {\n            for (size_t j = 0; j < 3; j++) {\n                for (size_t k = 0; k < 4; k++) {\n                    ptr[i].a[j][k] = char('A' + (i * 100 + j * 10 + k) % 26);\n                }\n            }\n            for (size_t j = 0; j < 2; j++) {\n                ptr[i].b[j] = int32_t(i * 1000 + j);\n            }\n            for (size_t j = 0; j < 3; j++) {\n                ptr[i].c[j] = uint8_t(i * 10 + j);\n            }\n            for (size_t j = 0; j < 4; j++) {\n                for (size_t k = 0; k < 2; k++) {\n                    ptr[i].d[j][k] = float(i) * 100.0f + float(j) * 10.0f + float(k);\n                }\n            }\n        }\n        return arr;\n    });\n    m.def(\"print_array_array\", &print_recarray<ArrayStruct>);\n\n    // test_enum_array\n    m.def(\"create_enum_array\", [](size_t n) {\n        py::array_t<EnumStruct, 0> arr = mkarray_via_buffer<EnumStruct>(n);\n        auto *ptr = (EnumStruct *) arr.mutable_data();\n        for (size_t i = 0; i < n; i++) {\n            ptr[i].e1 = static_cast<E1>(-1 + ((int) i % 2) * 2);\n            ptr[i].e2 = static_cast<E2>(1 + (i % 2));\n        }\n        return arr;\n    });\n    m.def(\"print_enum_array\", &print_recarray<EnumStruct>);\n\n    // test_complex_array\n    m.def(\"create_complex_array\", [](size_t n) {\n        py::array_t<ComplexStruct, 0> arr = mkarray_via_buffer<ComplexStruct>(n);\n        auto *ptr = (ComplexStruct *) arr.mutable_data();\n        for (size_t i = 0; i < n; i++) {\n            ptr[i].cflt.real(float(i));\n            ptr[i].cflt.imag(float(i) + 0.25f);\n            ptr[i].cdbl.real(double(i) + 0.5);\n            ptr[i].cdbl.imag(double(i) + 0.75);\n        }\n        return arr;\n    });\n    m.def(\"print_complex_array\", &print_recarray<ComplexStruct>);\n\n    // test_array_constructors\n    m.def(\"test_array_ctors\", &test_array_ctors);\n\n    // test_compare_buffer_info\n    struct CompareStruct {\n        bool x;\n        uint32_t y;\n        float z;\n    };\n    PYBIND11_NUMPY_DTYPE(CompareStruct, x, y, z);\n    m.def(\"compare_buffer_info\", []() {\n        py::list list;\n        list.append(py::bool_(py::detail::compare_buffer_info<float>::compare(\n            py::buffer_info(nullptr, sizeof(float), \"f\", 1))));\n        list.append(py::bool_(py::detail::compare_buffer_info<unsigned>::compare(\n            py::buffer_info(nullptr, sizeof(int), \"I\", 1))));\n        list.append(py::bool_(py::detail::compare_buffer_info<long>::compare(\n            py::buffer_info(nullptr, sizeof(long), \"l\", 1))));\n        list.append(py::bool_(py::detail::compare_buffer_info<long>::compare(\n            py::buffer_info(nullptr, sizeof(long), sizeof(long) == sizeof(int) ? \"i\" : \"q\", 1))));\n        list.append(py::bool_(py::detail::compare_buffer_info<CompareStruct>::compare(\n            py::buffer_info(nullptr, sizeof(CompareStruct), \"T{?:x:3xI:y:f:z:}\", 1))));\n        return list;\n    });\n    m.def(\"buffer_to_dtype\", [](py::buffer &buf) { return py::dtype(buf.request()); });\n\n    // test_scalar_conversion\n    auto f_simple = [](SimpleStruct s) { return s.uint_ * 10; };\n    m.def(\"f_simple\", f_simple);\n    m.def(\"f_packed\", [](PackedStruct s) { return s.uint_ * 10; });\n    m.def(\"f_nested\", [](NestedStruct s) { return s.a.uint_ * 10; });\n\n    // test_vectorize\n    m.def(\"f_simple_vectorized\", py::vectorize(f_simple));\n    auto f_simple_pass_thru = [](SimpleStruct s) { return s; };\n    m.def(\"f_simple_pass_thru_vectorized\", py::vectorize(f_simple_pass_thru));\n\n    // test_register_dtype\n    m.def(\"register_dtype\",\n          []() { PYBIND11_NUMPY_DTYPE(SimpleStruct, bool_, uint_, float_, ldbl_); });\n\n    // test_str_leak\n    m.def(\"dtype_wrapper\", [](const py::object &d) { return py::dtype::from_args(d); });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_numpy_dtypes.py",
    "content": "import re\n\nimport pytest\n\nimport env  # noqa: F401\nfrom pybind11_tests import numpy_dtypes as m\n\nnp = pytest.importorskip(\"numpy\")\n\n\n@pytest.fixture(scope=\"module\")\ndef simple_dtype():\n    ld = np.dtype(\"longdouble\")\n    return np.dtype(\n        {\n            \"names\": [\"bool_\", \"uint_\", \"float_\", \"ldbl_\"],\n            \"formats\": [\"?\", \"u4\", \"f4\", f\"f{ld.itemsize}\"],\n            \"offsets\": [0, 4, 8, (16 if ld.alignment > 4 else 12)],\n        }\n    )\n\n\n@pytest.fixture(scope=\"module\")\ndef packed_dtype():\n    return np.dtype([(\"bool_\", \"?\"), (\"uint_\", \"u4\"), (\"float_\", \"f4\"), (\"ldbl_\", \"g\")])\n\n\ndef dt_fmt():\n    from sys import byteorder\n\n    e = \"<\" if byteorder == \"little\" else \">\"\n    return (\n        \"{{'names':['bool_','uint_','float_','ldbl_'],\"\n        \"'formats':['?','\" + e + \"u4','\" + e + \"f4','\" + e + \"f{}'],\"\n        \"'offsets':[0,4,8,{}],'itemsize':{}}}\"\n    )\n\n\ndef simple_dtype_fmt():\n    ld = np.dtype(\"longdouble\")\n    simple_ld_off = 12 + 4 * (ld.alignment > 4)\n    return dt_fmt().format(ld.itemsize, simple_ld_off, simple_ld_off + ld.itemsize)\n\n\ndef packed_dtype_fmt():\n    from sys import byteorder\n\n    return \"[('bool_','?'),('uint_','{e}u4'),('float_','{e}f4'),('ldbl_','{e}f{}')]\".format(\n        np.dtype(\"longdouble\").itemsize, e=\"<\" if byteorder == \"little\" else \">\"\n    )\n\n\ndef partial_ld_offset():\n    return (\n        12\n        + 4 * (np.dtype(\"uint64\").alignment > 4)\n        + 8\n        + 8 * (np.dtype(\"longdouble\").alignment > 8)\n    )\n\n\ndef partial_dtype_fmt():\n    ld = np.dtype(\"longdouble\")\n    partial_ld_off = partial_ld_offset()\n    partial_size = partial_ld_off + ld.itemsize\n    partial_end_padding = partial_size % np.dtype(\"uint64\").alignment\n    return dt_fmt().format(\n        ld.itemsize, partial_ld_off, partial_size + partial_end_padding\n    )\n\n\ndef partial_nested_fmt():\n    ld = np.dtype(\"longdouble\")\n    partial_nested_off = 8 + 8 * (ld.alignment > 8)\n    partial_ld_off = partial_ld_offset()\n    partial_size = partial_ld_off + ld.itemsize\n    partial_end_padding = partial_size % np.dtype(\"uint64\").alignment\n    partial_nested_size = partial_nested_off * 2 + partial_size + partial_end_padding\n    return \"{{'names':['a'],'formats':[{}],'offsets':[{}],'itemsize':{}}}\".format(\n        partial_dtype_fmt(), partial_nested_off, partial_nested_size\n    )\n\n\ndef assert_equal(actual, expected_data, expected_dtype):\n    np.testing.assert_equal(actual, np.array(expected_data, dtype=expected_dtype))\n\n\ndef test_format_descriptors():\n    with pytest.raises(RuntimeError) as excinfo:\n        m.get_format_unbound()\n    assert re.match(\n        \"^NumPy type info missing for .*UnboundStruct.*$\", str(excinfo.value)\n    )\n\n    ld = np.dtype(\"longdouble\")\n    ldbl_fmt = (\"4x\" if ld.alignment > 4 else \"\") + ld.char\n    ss_fmt = \"^T{?:bool_:3xI:uint_:f:float_:\" + ldbl_fmt + \":ldbl_:}\"\n    dbl = np.dtype(\"double\")\n    end_padding = ld.itemsize % np.dtype(\"uint64\").alignment\n    partial_fmt = (\n        \"^T{?:bool_:3xI:uint_:f:float_:\"\n        + str(4 * (dbl.alignment > 4) + dbl.itemsize + 8 * (ld.alignment > 8))\n        + \"xg:ldbl_:\"\n        + (str(end_padding) + \"x}\" if end_padding > 0 else \"}\")\n    )\n    nested_extra = str(max(8, ld.alignment))\n    assert m.print_format_descriptors() == [\n        ss_fmt,\n        \"^T{?:bool_:I:uint_:f:float_:g:ldbl_:}\",\n        \"^T{\" + ss_fmt + \":a:^T{?:bool_:I:uint_:f:float_:g:ldbl_:}:b:}\",\n        partial_fmt,\n        \"^T{\" + nested_extra + \"x\" + partial_fmt + \":a:\" + nested_extra + \"x}\",\n        \"^T{3s:a:3s:b:}\",\n        \"^T{(3)4s:a:(2)i:b:(3)B:c:1x(4, 2)f:d:}\",\n        \"^T{q:e1:B:e2:}\",\n        \"^T{Zf:cflt:Zd:cdbl:}\",\n    ]\n\n\ndef test_dtype(simple_dtype):\n    from sys import byteorder\n\n    e = \"<\" if byteorder == \"little\" else \">\"\n\n    assert [x.replace(\" \", \"\") for x in m.print_dtypes()] == [\n        simple_dtype_fmt(),\n        packed_dtype_fmt(),\n        f\"[('a',{simple_dtype_fmt()}),('b',{packed_dtype_fmt()})]\",\n        partial_dtype_fmt(),\n        partial_nested_fmt(),\n        \"[('a','S3'),('b','S3')]\",\n        (\n            \"{{'names':['a','b','c','d'],\"\n            + \"'formats':[('S4',(3,)),('\"\n            + e\n            + \"i4',(2,)),('u1',(3,)),('\"\n            + e\n            + \"f4',(4,2))],\"\n            + \"'offsets':[0,12,20,24],'itemsize':56}}\"\n        ).format(e=e),\n        \"[('e1','\" + e + \"i8'),('e2','u1')]\",\n        \"[('x','i1'),('y','\" + e + \"u8')]\",\n        \"[('cflt','\" + e + \"c8'),('cdbl','\" + e + \"c16')]\",\n    ]\n\n    d1 = np.dtype(\n        {\n            \"names\": [\"a\", \"b\"],\n            \"formats\": [\"int32\", \"float64\"],\n            \"offsets\": [1, 10],\n            \"itemsize\": 20,\n        }\n    )\n    d2 = np.dtype([(\"a\", \"i4\"), (\"b\", \"f4\")])\n    assert m.test_dtype_ctors() == [\n        np.dtype(\"int32\"),\n        np.dtype(\"float64\"),\n        np.dtype(\"bool\"),\n        d1,\n        d1,\n        np.dtype(\"uint32\"),\n        d2,\n        np.dtype(\"d\"),\n    ]\n\n    assert m.test_dtype_methods() == [\n        np.dtype(\"int32\"),\n        simple_dtype,\n        False,\n        True,\n        np.dtype(\"int32\").itemsize,\n        simple_dtype.itemsize,\n    ]\n\n    assert m.trailing_padding_dtype() == m.buffer_to_dtype(\n        np.zeros(1, m.trailing_padding_dtype())\n    )\n\n    expected_chars = \"bhilqBHILQefdgFDG?MmO\"\n    assert m.test_dtype_kind() == list(\"iiiiiuuuuuffffcccbMmO\")\n    assert m.test_dtype_char_() == list(expected_chars)\n    assert m.test_dtype_num() == [np.dtype(ch).num for ch in expected_chars]\n    assert m.test_dtype_byteorder() == [np.dtype(ch).byteorder for ch in expected_chars]\n    assert m.test_dtype_alignment() == [np.dtype(ch).alignment for ch in expected_chars]\n    assert m.test_dtype_flags() == [chr(np.dtype(ch).flags) for ch in expected_chars]\n\n\ndef test_recarray(simple_dtype, packed_dtype):\n    elements = [(False, 0, 0.0, -0.0), (True, 1, 1.5, -2.5), (False, 2, 3.0, -5.0)]\n\n    for func, dtype in [\n        (m.create_rec_simple, simple_dtype),\n        (m.create_rec_packed, packed_dtype),\n    ]:\n        arr = func(0)\n        assert arr.dtype == dtype\n        assert_equal(arr, [], simple_dtype)\n        assert_equal(arr, [], packed_dtype)\n\n        arr = func(3)\n        assert arr.dtype == dtype\n        assert_equal(arr, elements, simple_dtype)\n        assert_equal(arr, elements, packed_dtype)\n\n        # Show what recarray's look like in NumPy.\n        assert type(arr[0]) == np.void\n        assert type(arr[0].item()) == tuple\n\n        if dtype == simple_dtype:\n            assert m.print_rec_simple(arr) == [\n                \"s:0,0,0,-0\",\n                \"s:1,1,1.5,-2.5\",\n                \"s:0,2,3,-5\",\n            ]\n        else:\n            assert m.print_rec_packed(arr) == [\n                \"p:0,0,0,-0\",\n                \"p:1,1,1.5,-2.5\",\n                \"p:0,2,3,-5\",\n            ]\n\n    nested_dtype = np.dtype([(\"a\", simple_dtype), (\"b\", packed_dtype)])\n\n    arr = m.create_rec_nested(0)\n    assert arr.dtype == nested_dtype\n    assert_equal(arr, [], nested_dtype)\n\n    arr = m.create_rec_nested(3)\n    assert arr.dtype == nested_dtype\n    assert_equal(\n        arr,\n        [\n            ((False, 0, 0.0, -0.0), (True, 1, 1.5, -2.5)),\n            ((True, 1, 1.5, -2.5), (False, 2, 3.0, -5.0)),\n            ((False, 2, 3.0, -5.0), (True, 3, 4.5, -7.5)),\n        ],\n        nested_dtype,\n    )\n    assert m.print_rec_nested(arr) == [\n        \"n:a=s:0,0,0,-0;b=p:1,1,1.5,-2.5\",\n        \"n:a=s:1,1,1.5,-2.5;b=p:0,2,3,-5\",\n        \"n:a=s:0,2,3,-5;b=p:1,3,4.5,-7.5\",\n    ]\n\n    arr = m.create_rec_partial(3)\n    assert str(arr.dtype).replace(\" \", \"\") == partial_dtype_fmt()\n    partial_dtype = arr.dtype\n    assert \"\" not in arr.dtype.fields\n    assert partial_dtype.itemsize > simple_dtype.itemsize\n    assert_equal(arr, elements, simple_dtype)\n    assert_equal(arr, elements, packed_dtype)\n\n    arr = m.create_rec_partial_nested(3)\n    assert str(arr.dtype).replace(\" \", \"\") == partial_nested_fmt()\n    assert \"\" not in arr.dtype.fields\n    assert \"\" not in arr.dtype.fields[\"a\"][0].fields\n    assert arr.dtype.itemsize > partial_dtype.itemsize\n    np.testing.assert_equal(arr[\"a\"], m.create_rec_partial(3))\n\n\ndef test_array_constructors():\n    data = np.arange(1, 7, dtype=\"int32\")\n    for i in range(8):\n        np.testing.assert_array_equal(m.test_array_ctors(10 + i), data.reshape((3, 2)))\n        np.testing.assert_array_equal(m.test_array_ctors(20 + i), data.reshape((3, 2)))\n    for i in range(5):\n        np.testing.assert_array_equal(m.test_array_ctors(30 + i), data)\n        np.testing.assert_array_equal(m.test_array_ctors(40 + i), data)\n\n\ndef test_string_array():\n    arr = m.create_string_array(True)\n    assert str(arr.dtype) == \"[('a', 'S3'), ('b', 'S3')]\"\n    assert m.print_string_array(arr) == [\n        \"a='',b=''\",\n        \"a='a',b='a'\",\n        \"a='ab',b='ab'\",\n        \"a='abc',b='abc'\",\n    ]\n    dtype = arr.dtype\n    assert arr[\"a\"].tolist() == [b\"\", b\"a\", b\"ab\", b\"abc\"]\n    assert arr[\"b\"].tolist() == [b\"\", b\"a\", b\"ab\", b\"abc\"]\n    arr = m.create_string_array(False)\n    assert dtype == arr.dtype\n\n\ndef test_array_array():\n    from sys import byteorder\n\n    e = \"<\" if byteorder == \"little\" else \">\"\n\n    arr = m.create_array_array(3)\n    assert str(arr.dtype).replace(\" \", \"\") == (\n        \"{{'names':['a','b','c','d'],\"\n        + \"'formats':[('S4',(3,)),('\"\n        + e\n        + \"i4',(2,)),('u1',(3,)),('{e}f4',(4,2))],\"\n        + \"'offsets':[0,12,20,24],'itemsize':56}}\"\n    ).format(e=e)\n    assert m.print_array_array(arr) == [\n        \"a={{A,B,C,D},{K,L,M,N},{U,V,W,X}},b={0,1},\"\n        + \"c={0,1,2},d={{0,1},{10,11},{20,21},{30,31}}\",\n        \"a={{W,X,Y,Z},{G,H,I,J},{Q,R,S,T}},b={1000,1001},\"\n        + \"c={10,11,12},d={{100,101},{110,111},{120,121},{130,131}}\",\n        \"a={{S,T,U,V},{C,D,E,F},{M,N,O,P}},b={2000,2001},\"\n        + \"c={20,21,22},d={{200,201},{210,211},{220,221},{230,231}}\",\n    ]\n    assert arr[\"a\"].tolist() == [\n        [b\"ABCD\", b\"KLMN\", b\"UVWX\"],\n        [b\"WXYZ\", b\"GHIJ\", b\"QRST\"],\n        [b\"STUV\", b\"CDEF\", b\"MNOP\"],\n    ]\n    assert arr[\"b\"].tolist() == [[0, 1], [1000, 1001], [2000, 2001]]\n    assert m.create_array_array(0).dtype == arr.dtype\n\n\ndef test_enum_array():\n    from sys import byteorder\n\n    e = \"<\" if byteorder == \"little\" else \">\"\n\n    arr = m.create_enum_array(3)\n    dtype = arr.dtype\n    assert dtype == np.dtype([(\"e1\", e + \"i8\"), (\"e2\", \"u1\")])\n    assert m.print_enum_array(arr) == [\"e1=A,e2=X\", \"e1=B,e2=Y\", \"e1=A,e2=X\"]\n    assert arr[\"e1\"].tolist() == [-1, 1, -1]\n    assert arr[\"e2\"].tolist() == [1, 2, 1]\n    assert m.create_enum_array(0).dtype == dtype\n\n\ndef test_complex_array():\n    from sys import byteorder\n\n    e = \"<\" if byteorder == \"little\" else \">\"\n\n    arr = m.create_complex_array(3)\n    dtype = arr.dtype\n    assert dtype == np.dtype([(\"cflt\", e + \"c8\"), (\"cdbl\", e + \"c16\")])\n    assert m.print_complex_array(arr) == [\n        \"c:(0,0.25),(0.5,0.75)\",\n        \"c:(1,1.25),(1.5,1.75)\",\n        \"c:(2,2.25),(2.5,2.75)\",\n    ]\n    assert arr[\"cflt\"].tolist() == [0.0 + 0.25j, 1.0 + 1.25j, 2.0 + 2.25j]\n    assert arr[\"cdbl\"].tolist() == [0.5 + 0.75j, 1.5 + 1.75j, 2.5 + 2.75j]\n    assert m.create_complex_array(0).dtype == dtype\n\n\ndef test_signature(doc):\n    assert (\n        doc(m.create_rec_nested)\n        == \"create_rec_nested(arg0: int) -> numpy.ndarray[NestedStruct]\"\n    )\n\n\ndef test_scalar_conversion():\n    n = 3\n    arrays = [\n        m.create_rec_simple(n),\n        m.create_rec_packed(n),\n        m.create_rec_nested(n),\n        m.create_enum_array(n),\n    ]\n    funcs = [m.f_simple, m.f_packed, m.f_nested]\n\n    for i, func in enumerate(funcs):\n        for j, arr in enumerate(arrays):\n            if i == j and i < 2:\n                assert [func(arr[k]) for k in range(n)] == [k * 10 for k in range(n)]\n            else:\n                with pytest.raises(TypeError) as excinfo:\n                    func(arr[0])\n                assert \"incompatible function arguments\" in str(excinfo.value)\n\n\ndef test_vectorize():\n    n = 3\n    array = m.create_rec_simple(n)\n    values = m.f_simple_vectorized(array)\n    np.testing.assert_array_equal(values, [0, 10, 20])\n    array_2 = m.f_simple_pass_thru_vectorized(array)\n    np.testing.assert_array_equal(array, array_2)\n\n\ndef test_cls_and_dtype_conversion(simple_dtype):\n    s = m.SimpleStruct()\n    assert s.astuple() == (False, 0, 0.0, 0.0)\n    assert m.SimpleStruct.fromtuple(s.astuple()).astuple() == s.astuple()\n\n    s.uint_ = 2\n    assert m.f_simple(s) == 20\n\n    # Try as recarray of shape==(1,).\n    s_recarray = np.array([(False, 2, 0.0, 0.0)], dtype=simple_dtype)\n    # Show that this will work for vectorized case.\n    np.testing.assert_array_equal(m.f_simple_vectorized(s_recarray), [20])\n\n    # Show as a scalar that inherits from np.generic.\n    s_scalar = s_recarray[0]\n    assert isinstance(s_scalar, np.void)\n    assert m.f_simple(s_scalar) == 20\n\n    # Show that an *array* scalar (np.ndarray.shape == ()) does not convert.\n    # More specifically, conversion to SimpleStruct is not implicit.\n    s_recarray_scalar = s_recarray.reshape(())\n    assert isinstance(s_recarray_scalar, np.ndarray)\n    assert s_recarray_scalar.dtype == simple_dtype\n    with pytest.raises(TypeError) as excinfo:\n        m.f_simple(s_recarray_scalar)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    # Explicitly convert to m.SimpleStruct.\n    assert m.f_simple(m.SimpleStruct.fromtuple(s_recarray_scalar.item())) == 20\n\n    # Show that an array of dtype=object does *not* convert.\n    s_array_object = np.array([s])\n    assert s_array_object.dtype == object\n    with pytest.raises(TypeError) as excinfo:\n        m.f_simple_vectorized(s_array_object)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n    # Explicitly convert to `np.array(..., dtype=simple_dtype)`\n    s_array = np.array([s.astuple()], dtype=simple_dtype)\n    np.testing.assert_array_equal(m.f_simple_vectorized(s_array), [20])\n\n\ndef test_register_dtype():\n    with pytest.raises(RuntimeError) as excinfo:\n        m.register_dtype()\n    assert \"dtype is already registered\" in str(excinfo.value)\n\n\n@pytest.mark.xfail(\"env.PYPY\")\ndef test_str_leak():\n    from sys import getrefcount\n\n    fmt = \"f4\"\n    pytest.gc_collect()\n    start = getrefcount(fmt)\n    d = m.dtype_wrapper(fmt)\n    assert d is np.dtype(\"f4\")\n    del d\n    pytest.gc_collect()\n    assert getrefcount(fmt) == start\n\n\ndef test_compare_buffer_info():\n    assert all(m.compare_buffer_info())\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_numpy_vectorize.cpp",
    "content": "/*\n    tests/test_numpy_vectorize.cpp -- auto-vectorize functions over NumPy array\n    arguments\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/numpy.h>\n\n#include \"pybind11_tests.h\"\n\n#include <utility>\n\ndouble my_func(int x, float y, double z) {\n    py::print(\"my_func(x:int={}, y:float={:.0f}, z:float={:.0f})\"_s.format(x, y, z));\n    return (float) x * y * z;\n}\n\nTEST_SUBMODULE(numpy_vectorize, m) {\n    try {\n        py::module_::import(\"numpy\");\n    } catch (const py::error_already_set &) {\n        return;\n    }\n\n    // test_vectorize, test_docs, test_array_collapse\n    // Vectorize all arguments of a function (though non-vector arguments are also allowed)\n    m.def(\"vectorized_func\", py::vectorize(my_func));\n\n    // Vectorize a lambda function with a capture object (e.g. to exclude some arguments from the\n    // vectorization)\n    m.def(\"vectorized_func2\", [](py::array_t<int> x, py::array_t<float> y, float z) {\n        return py::vectorize([z](int x, float y) { return my_func(x, y, z); })(std::move(x),\n                                                                               std::move(y));\n    });\n\n    // Vectorize a complex-valued function\n    m.def(\"vectorized_func3\",\n          py::vectorize([](std::complex<double> c) { return c * std::complex<double>(2.f); }));\n\n    // test_type_selection\n    // NumPy function which only accepts specific data types\n    // A lot of these no lints could be replaced with const refs, and probably should at some\n    // point.\n    m.def(\"selective_func\",\n          [](const py::array_t<int, py::array::c_style> &) { return \"Int branch taken.\"; });\n    m.def(\"selective_func\",\n          [](const py::array_t<float, py::array::c_style> &) { return \"Float branch taken.\"; });\n    m.def(\"selective_func\", [](const py::array_t<std::complex<float>, py::array::c_style> &) {\n        return \"Complex float branch taken.\";\n    });\n\n    // test_passthrough_arguments\n    // Passthrough test: references and non-pod types should be automatically passed through (in\n    // the function definition below, only `b`, `d`, and `g` are vectorized):\n    struct NonPODClass {\n        explicit NonPODClass(int v) : value{v} {}\n        int value;\n    };\n    py::class_<NonPODClass>(m, \"NonPODClass\")\n        .def(py::init<int>())\n        .def_readwrite(\"value\", &NonPODClass::value);\n    m.def(\"vec_passthrough\",\n          py::vectorize([](const double *a,\n                           double b,\n                           // Changing this broke things\n                           // NOLINTNEXTLINE(performance-unnecessary-value-param)\n                           py::array_t<double> c,\n                           const int &d,\n                           int &e,\n                           NonPODClass f,\n                           const double g) { return *a + b + c.at(0) + d + e + f.value + g; }));\n\n    // test_method_vectorization\n    struct VectorizeTestClass {\n        explicit VectorizeTestClass(int v) : value{v} {};\n        float method(int x, float y) const { return y + (float) (x + value); }\n        int value = 0;\n    };\n    py::class_<VectorizeTestClass> vtc(m, \"VectorizeTestClass\");\n    vtc.def(py::init<int>()).def_readwrite(\"value\", &VectorizeTestClass::value);\n\n    // Automatic vectorizing of methods\n    vtc.def(\"method\", py::vectorize(&VectorizeTestClass::method));\n\n    // test_trivial_broadcasting\n    // Internal optimization test for whether the input is trivially broadcastable:\n    py::enum_<py::detail::broadcast_trivial>(m, \"trivial\")\n        .value(\"f_trivial\", py::detail::broadcast_trivial::f_trivial)\n        .value(\"c_trivial\", py::detail::broadcast_trivial::c_trivial)\n        .value(\"non_trivial\", py::detail::broadcast_trivial::non_trivial);\n    m.def(\"vectorized_is_trivial\",\n          [](const py::array_t<int, py::array::forcecast> &arg1,\n             const py::array_t<float, py::array::forcecast> &arg2,\n             const py::array_t<double, py::array::forcecast> &arg3) {\n              py::ssize_t ndim = 0;\n              std::vector<py::ssize_t> shape;\n              std::array<py::buffer_info, 3> buffers{\n                  {arg1.request(), arg2.request(), arg3.request()}};\n              return py::detail::broadcast(buffers, ndim, shape);\n          });\n\n    m.def(\"add_to\", py::vectorize([](NonPODClass &x, int a) { x.value += a; }));\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_numpy_vectorize.py",
    "content": "import pytest\n\nfrom pybind11_tests import numpy_vectorize as m\n\nnp = pytest.importorskip(\"numpy\")\n\n\ndef test_vectorize(capture):\n    assert np.isclose(m.vectorized_func3(np.array(3 + 7j)), [6 + 14j])\n\n    for f in [m.vectorized_func, m.vectorized_func2]:\n        with capture:\n            assert np.isclose(f(1, 2, 3), 6)\n        assert capture == \"my_func(x:int=1, y:float=2, z:float=3)\"\n        with capture:\n            assert np.isclose(f(np.array(1), np.array(2), 3), 6)\n        assert capture == \"my_func(x:int=1, y:float=2, z:float=3)\"\n        with capture:\n            assert np.allclose(f(np.array([1, 3]), np.array([2, 4]), 3), [6, 36])\n        assert (\n            capture\n            == \"\"\"\n            my_func(x:int=1, y:float=2, z:float=3)\n            my_func(x:int=3, y:float=4, z:float=3)\n        \"\"\"\n        )\n        with capture:\n            a = np.array([[1, 2], [3, 4]], order=\"F\")\n            b = np.array([[10, 20], [30, 40]], order=\"F\")\n            c = 3\n            result = f(a, b, c)\n            assert np.allclose(result, a * b * c)\n            assert result.flags.f_contiguous\n        # All inputs are F order and full or singletons, so we the result is in col-major order:\n        assert (\n            capture\n            == \"\"\"\n            my_func(x:int=1, y:float=10, z:float=3)\n            my_func(x:int=3, y:float=30, z:float=3)\n            my_func(x:int=2, y:float=20, z:float=3)\n            my_func(x:int=4, y:float=40, z:float=3)\n        \"\"\"\n        )\n        with capture:\n            a, b, c = (\n                np.array([[1, 3, 5], [7, 9, 11]]),\n                np.array([[2, 4, 6], [8, 10, 12]]),\n                3,\n            )\n            assert np.allclose(f(a, b, c), a * b * c)\n        assert (\n            capture\n            == \"\"\"\n            my_func(x:int=1, y:float=2, z:float=3)\n            my_func(x:int=3, y:float=4, z:float=3)\n            my_func(x:int=5, y:float=6, z:float=3)\n            my_func(x:int=7, y:float=8, z:float=3)\n            my_func(x:int=9, y:float=10, z:float=3)\n            my_func(x:int=11, y:float=12, z:float=3)\n        \"\"\"\n        )\n        with capture:\n            a, b, c = np.array([[1, 2, 3], [4, 5, 6]]), np.array([2, 3, 4]), 2\n            assert np.allclose(f(a, b, c), a * b * c)\n        assert (\n            capture\n            == \"\"\"\n            my_func(x:int=1, y:float=2, z:float=2)\n            my_func(x:int=2, y:float=3, z:float=2)\n            my_func(x:int=3, y:float=4, z:float=2)\n            my_func(x:int=4, y:float=2, z:float=2)\n            my_func(x:int=5, y:float=3, z:float=2)\n            my_func(x:int=6, y:float=4, z:float=2)\n        \"\"\"\n        )\n        with capture:\n            a, b, c = np.array([[1, 2, 3], [4, 5, 6]]), np.array([[2], [3]]), 2\n            assert np.allclose(f(a, b, c), a * b * c)\n        assert (\n            capture\n            == \"\"\"\n            my_func(x:int=1, y:float=2, z:float=2)\n            my_func(x:int=2, y:float=2, z:float=2)\n            my_func(x:int=3, y:float=2, z:float=2)\n            my_func(x:int=4, y:float=3, z:float=2)\n            my_func(x:int=5, y:float=3, z:float=2)\n            my_func(x:int=6, y:float=3, z:float=2)\n        \"\"\"\n        )\n        with capture:\n            a, b, c = (\n                np.array([[1, 2, 3], [4, 5, 6]], order=\"F\"),\n                np.array([[2], [3]]),\n                2,\n            )\n            assert np.allclose(f(a, b, c), a * b * c)\n        assert (\n            capture\n            == \"\"\"\n            my_func(x:int=1, y:float=2, z:float=2)\n            my_func(x:int=2, y:float=2, z:float=2)\n            my_func(x:int=3, y:float=2, z:float=2)\n            my_func(x:int=4, y:float=3, z:float=2)\n            my_func(x:int=5, y:float=3, z:float=2)\n            my_func(x:int=6, y:float=3, z:float=2)\n        \"\"\"\n        )\n        with capture:\n            a, b, c = np.array([[1, 2, 3], [4, 5, 6]])[::, ::2], np.array([[2], [3]]), 2\n            assert np.allclose(f(a, b, c), a * b * c)\n        assert (\n            capture\n            == \"\"\"\n            my_func(x:int=1, y:float=2, z:float=2)\n            my_func(x:int=3, y:float=2, z:float=2)\n            my_func(x:int=4, y:float=3, z:float=2)\n            my_func(x:int=6, y:float=3, z:float=2)\n        \"\"\"\n        )\n        with capture:\n            a, b, c = (\n                np.array([[1, 2, 3], [4, 5, 6]], order=\"F\")[::, ::2],\n                np.array([[2], [3]]),\n                2,\n            )\n            assert np.allclose(f(a, b, c), a * b * c)\n        assert (\n            capture\n            == \"\"\"\n            my_func(x:int=1, y:float=2, z:float=2)\n            my_func(x:int=3, y:float=2, z:float=2)\n            my_func(x:int=4, y:float=3, z:float=2)\n            my_func(x:int=6, y:float=3, z:float=2)\n        \"\"\"\n        )\n\n\ndef test_type_selection():\n    assert m.selective_func(np.array([1], dtype=np.int32)) == \"Int branch taken.\"\n    assert m.selective_func(np.array([1.0], dtype=np.float32)) == \"Float branch taken.\"\n    assert (\n        m.selective_func(np.array([1.0j], dtype=np.complex64))\n        == \"Complex float branch taken.\"\n    )\n\n\ndef test_docs(doc):\n    assert (\n        doc(m.vectorized_func)\n        == \"\"\"\n        vectorized_func(arg0: numpy.ndarray[numpy.int32], arg1: numpy.ndarray[numpy.float32], arg2: numpy.ndarray[numpy.float64]) -> object\n    \"\"\"  # noqa: E501 line too long\n    )\n\n\ndef test_trivial_broadcasting():\n    trivial, vectorized_is_trivial = m.trivial, m.vectorized_is_trivial\n\n    assert vectorized_is_trivial(1, 2, 3) == trivial.c_trivial\n    assert vectorized_is_trivial(np.array(1), np.array(2), 3) == trivial.c_trivial\n    assert (\n        vectorized_is_trivial(np.array([1, 3]), np.array([2, 4]), 3)\n        == trivial.c_trivial\n    )\n    assert trivial.c_trivial == vectorized_is_trivial(\n        np.array([[1, 3, 5], [7, 9, 11]]), np.array([[2, 4, 6], [8, 10, 12]]), 3\n    )\n    assert (\n        vectorized_is_trivial(np.array([[1, 2, 3], [4, 5, 6]]), np.array([2, 3, 4]), 2)\n        == trivial.non_trivial\n    )\n    assert (\n        vectorized_is_trivial(np.array([[1, 2, 3], [4, 5, 6]]), np.array([[2], [3]]), 2)\n        == trivial.non_trivial\n    )\n    z1 = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], dtype=\"int32\")\n    z2 = np.array(z1, dtype=\"float32\")\n    z3 = np.array(z1, dtype=\"float64\")\n    assert vectorized_is_trivial(z1, z2, z3) == trivial.c_trivial\n    assert vectorized_is_trivial(1, z2, z3) == trivial.c_trivial\n    assert vectorized_is_trivial(z1, 1, z3) == trivial.c_trivial\n    assert vectorized_is_trivial(z1, z2, 1) == trivial.c_trivial\n    assert vectorized_is_trivial(z1[::2, ::2], 1, 1) == trivial.non_trivial\n    assert vectorized_is_trivial(1, 1, z1[::2, ::2]) == trivial.c_trivial\n    assert vectorized_is_trivial(1, 1, z3[::2, ::2]) == trivial.non_trivial\n    assert vectorized_is_trivial(z1, 1, z3[1::4, 1::4]) == trivial.c_trivial\n\n    y1 = np.array(z1, order=\"F\")\n    y2 = np.array(y1)\n    y3 = np.array(y1)\n    assert vectorized_is_trivial(y1, y2, y3) == trivial.f_trivial\n    assert vectorized_is_trivial(y1, 1, 1) == trivial.f_trivial\n    assert vectorized_is_trivial(1, y2, 1) == trivial.f_trivial\n    assert vectorized_is_trivial(1, 1, y3) == trivial.f_trivial\n    assert vectorized_is_trivial(y1, z2, 1) == trivial.non_trivial\n    assert vectorized_is_trivial(z1[1::4, 1::4], y2, 1) == trivial.f_trivial\n    assert vectorized_is_trivial(y1[1::4, 1::4], z2, 1) == trivial.c_trivial\n\n    assert m.vectorized_func(z1, z2, z3).flags.c_contiguous\n    assert m.vectorized_func(y1, y2, y3).flags.f_contiguous\n    assert m.vectorized_func(z1, 1, 1).flags.c_contiguous\n    assert m.vectorized_func(1, y2, 1).flags.f_contiguous\n    assert m.vectorized_func(z1[1::4, 1::4], y2, 1).flags.f_contiguous\n    assert m.vectorized_func(y1[1::4, 1::4], z2, 1).flags.c_contiguous\n\n\ndef test_passthrough_arguments(doc):\n    assert doc(m.vec_passthrough) == (\n        \"vec_passthrough(\"\n        + \", \".join(\n            [\n                \"arg0: float\",\n                \"arg1: numpy.ndarray[numpy.float64]\",\n                \"arg2: numpy.ndarray[numpy.float64]\",\n                \"arg3: numpy.ndarray[numpy.int32]\",\n                \"arg4: int\",\n                \"arg5: m.numpy_vectorize.NonPODClass\",\n                \"arg6: numpy.ndarray[numpy.float64]\",\n            ]\n        )\n        + \") -> object\"\n    )\n\n    b = np.array([[10, 20, 30]], dtype=\"float64\")\n    c = np.array([100, 200])  # NOT a vectorized argument\n    d = np.array([[1000], [2000], [3000]], dtype=\"int\")\n    g = np.array([[1000000, 2000000, 3000000]], dtype=\"int\")  # requires casting\n    assert np.all(\n        m.vec_passthrough(1, b, c, d, 10000, m.NonPODClass(100000), g)\n        == np.array(\n            [\n                [1111111, 2111121, 3111131],\n                [1112111, 2112121, 3112131],\n                [1113111, 2113121, 3113131],\n            ]\n        )\n    )\n\n\ndef test_method_vectorization():\n    o = m.VectorizeTestClass(3)\n    x = np.array([1, 2], dtype=\"int\")\n    y = np.array([[10], [20]], dtype=\"float32\")\n    assert np.all(o.method(x, y) == [[14, 15], [24, 25]])\n\n\ndef test_array_collapse():\n    assert not isinstance(m.vectorized_func(1, 2, 3), np.ndarray)\n    assert not isinstance(m.vectorized_func(np.array(1), 2, 3), np.ndarray)\n    z = m.vectorized_func([1], 2, 3)\n    assert isinstance(z, np.ndarray)\n    assert z.shape == (1,)\n    z = m.vectorized_func(1, [[[2]]], 3)\n    assert isinstance(z, np.ndarray)\n    assert z.shape == (1, 1, 1)\n\n\ndef test_vectorized_noreturn():\n    x = m.NonPODClass(0)\n    assert x.value == 0\n    m.add_to(x, [1, 2, 3, 4])\n    assert x.value == 10\n    m.add_to(x, 1)\n    assert x.value == 11\n    m.add_to(x, [[1, 1], [2, 3]])\n    assert x.value == 18\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_opaque_types.cpp",
    "content": "/*\n    tests/test_opaque_types.cpp -- opaque types, passing void pointers\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/stl.h>\n\n#include \"pybind11_tests.h\"\n\n#include <vector>\n\n// IMPORTANT: Disable internal pybind11 translation mechanisms for STL data structures\n//\n// This also deliberately doesn't use the below StringList type alias to test\n// that MAKE_OPAQUE can handle a type containing a `,`.  (The `std::allocator`\n// bit is just the default `std::vector` allocator).\nPYBIND11_MAKE_OPAQUE(std::vector<std::string, std::allocator<std::string>>);\n\nusing StringList = std::vector<std::string, std::allocator<std::string>>;\n\nTEST_SUBMODULE(opaque_types, m) {\n    // test_string_list\n    py::class_<StringList>(m, \"StringList\")\n        .def(py::init<>())\n        .def(\"pop_back\", &StringList::pop_back)\n        /* There are multiple versions of push_back(), etc. Select the right ones. */\n        .def(\"push_back\", (void(StringList::*)(const std::string &)) & StringList::push_back)\n        .def(\"back\", (std::string & (StringList::*) ()) & StringList::back)\n        .def(\"__len__\", [](const StringList &v) { return v.size(); })\n        .def(\n            \"__iter__\",\n            [](StringList &v) { return py::make_iterator(v.begin(), v.end()); },\n            py::keep_alive<0, 1>());\n\n    class ClassWithSTLVecProperty {\n    public:\n        StringList stringList;\n    };\n    py::class_<ClassWithSTLVecProperty>(m, \"ClassWithSTLVecProperty\")\n        .def(py::init<>())\n        .def_readwrite(\"stringList\", &ClassWithSTLVecProperty::stringList);\n\n    m.def(\"print_opaque_list\", [](const StringList &l) {\n        std::string ret = \"Opaque list: [\";\n        bool first = true;\n        for (const auto &entry : l) {\n            if (!first) {\n                ret += \", \";\n            }\n            ret += entry;\n            first = false;\n        }\n        return ret + \"]\";\n    });\n\n    // test_pointers\n    m.def(\"return_void_ptr\", []() { return (void *) 0x1234; });\n    m.def(\"get_void_ptr_value\", [](void *ptr) { return reinterpret_cast<std::intptr_t>(ptr); });\n    m.def(\"return_null_str\", []() { return (char *) nullptr; });\n    m.def(\"get_null_str_value\", [](char *ptr) { return reinterpret_cast<std::intptr_t>(ptr); });\n\n    m.def(\"return_unique_ptr\", []() -> std::unique_ptr<StringList> {\n        auto *result = new StringList();\n        result->push_back(\"some value\");\n        return std::unique_ptr<StringList>(result);\n    });\n\n    // test unions\n    py::class_<IntFloat>(m, \"IntFloat\")\n        .def(py::init<>())\n        .def_readwrite(\"i\", &IntFloat::i)\n        .def_readwrite(\"f\", &IntFloat::f);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_opaque_types.py",
    "content": "import pytest\n\nfrom pybind11_tests import ConstructorStats, UserType\nfrom pybind11_tests import opaque_types as m\n\n\ndef test_string_list():\n    lst = m.StringList()\n    lst.push_back(\"Element 1\")\n    lst.push_back(\"Element 2\")\n    assert m.print_opaque_list(lst) == \"Opaque list: [Element 1, Element 2]\"\n    assert lst.back() == \"Element 2\"\n\n    for i, k in enumerate(lst, start=1):\n        assert k == f\"Element {i}\"\n    lst.pop_back()\n    assert m.print_opaque_list(lst) == \"Opaque list: [Element 1]\"\n\n    cvp = m.ClassWithSTLVecProperty()\n    assert m.print_opaque_list(cvp.stringList) == \"Opaque list: []\"\n\n    cvp.stringList = lst\n    cvp.stringList.push_back(\"Element 3\")\n    assert m.print_opaque_list(cvp.stringList) == \"Opaque list: [Element 1, Element 3]\"\n\n\ndef test_pointers(msg):\n    living_before = ConstructorStats.get(UserType).alive()\n    assert m.get_void_ptr_value(m.return_void_ptr()) == 0x1234\n    assert m.get_void_ptr_value(UserType())  # Should also work for other C++ types\n    assert ConstructorStats.get(UserType).alive() == living_before\n\n    with pytest.raises(TypeError) as excinfo:\n        m.get_void_ptr_value([1, 2, 3])  # This should not work\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        get_void_ptr_value(): incompatible function arguments. The following argument types are supported:\n            1. (arg0: capsule) -> int\n\n        Invoked with: [1, 2, 3]\n    \"\"\"\n    )\n\n    assert m.return_null_str() is None\n    assert m.get_null_str_value(m.return_null_str()) is not None\n\n    ptr = m.return_unique_ptr()\n    assert \"StringList\" in repr(ptr)\n    assert m.print_opaque_list(ptr) == \"Opaque list: [some value]\"\n\n\ndef test_unions():\n    int_float_union = m.IntFloat()\n    int_float_union.i = 42\n    assert int_float_union.i == 42\n    int_float_union.f = 3.0\n    assert int_float_union.f == 3.0\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_operator_overloading.cpp",
    "content": "/*\n    tests/test_operator_overloading.cpp -- operator overloading\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/operators.h>\n#include <pybind11/stl.h>\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\n#include <functional>\n\nclass Vector2 {\npublic:\n    Vector2(float x, float y) : x(x), y(y) { print_created(this, toString()); }\n    Vector2(const Vector2 &v) : x(v.x), y(v.y) { print_copy_created(this); }\n    Vector2(Vector2 &&v) noexcept : x(v.x), y(v.y) {\n        print_move_created(this);\n        v.x = v.y = 0;\n    }\n    Vector2 &operator=(const Vector2 &v) {\n        x = v.x;\n        y = v.y;\n        print_copy_assigned(this);\n        return *this;\n    }\n    Vector2 &operator=(Vector2 &&v) noexcept {\n        x = v.x;\n        y = v.y;\n        v.x = v.y = 0;\n        print_move_assigned(this);\n        return *this;\n    }\n    ~Vector2() { print_destroyed(this); }\n\n    std::string toString() const {\n        return \"[\" + std::to_string(x) + \", \" + std::to_string(y) + \"]\";\n    }\n\n    Vector2 operator-() const { return Vector2(-x, -y); }\n    Vector2 operator+(const Vector2 &v) const { return Vector2(x + v.x, y + v.y); }\n    Vector2 operator-(const Vector2 &v) const { return Vector2(x - v.x, y - v.y); }\n    Vector2 operator-(float value) const { return Vector2(x - value, y - value); }\n    Vector2 operator+(float value) const { return Vector2(x + value, y + value); }\n    Vector2 operator*(float value) const { return Vector2(x * value, y * value); }\n    Vector2 operator/(float value) const { return Vector2(x / value, y / value); }\n    Vector2 operator*(const Vector2 &v) const { return Vector2(x * v.x, y * v.y); }\n    Vector2 operator/(const Vector2 &v) const { return Vector2(x / v.x, y / v.y); }\n    Vector2 &operator+=(const Vector2 &v) {\n        x += v.x;\n        y += v.y;\n        return *this;\n    }\n    Vector2 &operator-=(const Vector2 &v) {\n        x -= v.x;\n        y -= v.y;\n        return *this;\n    }\n    Vector2 &operator*=(float v) {\n        x *= v;\n        y *= v;\n        return *this;\n    }\n    Vector2 &operator/=(float v) {\n        x /= v;\n        y /= v;\n        return *this;\n    }\n    Vector2 &operator*=(const Vector2 &v) {\n        x *= v.x;\n        y *= v.y;\n        return *this;\n    }\n    Vector2 &operator/=(const Vector2 &v) {\n        x /= v.x;\n        y /= v.y;\n        return *this;\n    }\n\n    friend Vector2 operator+(float f, const Vector2 &v) { return Vector2(f + v.x, f + v.y); }\n    friend Vector2 operator-(float f, const Vector2 &v) { return Vector2(f - v.x, f - v.y); }\n    friend Vector2 operator*(float f, const Vector2 &v) { return Vector2(f * v.x, f * v.y); }\n    friend Vector2 operator/(float f, const Vector2 &v) { return Vector2(f / v.x, f / v.y); }\n\n    bool operator==(const Vector2 &v) const { return x == v.x && y == v.y; }\n    bool operator!=(const Vector2 &v) const { return x != v.x || y != v.y; }\n\nprivate:\n    float x, y;\n};\n\nclass C1 {};\nclass C2 {};\n\nint operator+(const C1 &, const C1 &) { return 11; }\nint operator+(const C2 &, const C2 &) { return 22; }\nint operator+(const C2 &, const C1 &) { return 21; }\nint operator+(const C1 &, const C2 &) { return 12; }\n\nstruct HashMe {\n    std::string member;\n};\n\nbool operator==(const HashMe &lhs, const HashMe &rhs) { return lhs.member == rhs.member; }\n\n// Note: Specializing explicit within `namespace std { ... }` is done due to a\n// bug in GCC<7. If you are supporting compilers later than this, consider\n// specializing `using template<> struct std::hash<...>` in the global\n// namespace instead, per this recommendation:\n// https://en.cppreference.com/w/cpp/language/extending_std#Adding_template_specializations\nnamespace std {\ntemplate <>\nstruct hash<Vector2> {\n    // Not a good hash function, but easy to test\n    size_t operator()(const Vector2 &) { return 4; }\n};\n\n// HashMe has a hash function in C++ but no `__hash__` for Python.\ntemplate <>\nstruct hash<HashMe> {\n    std::size_t operator()(const HashMe &selector) const {\n        return std::hash<std::string>()(selector.member);\n    }\n};\n} // namespace std\n\n// Not a good abs function, but easy to test.\nstd::string abs(const Vector2 &) { return \"abs(Vector2)\"; }\n\n// clang 7.0.0 and Apple LLVM 10.0.1 introduce `-Wself-assign-overloaded` to\n// `-Wall`, which is used here for overloading (e.g. `py::self += py::self `).\n// Here, we suppress the warning\n// Taken from: https://github.com/RobotLocomotion/drake/commit/aaf84b46\n// TODO(eric): This could be resolved using a function / functor (e.g. `py::self()`).\n#if defined(__APPLE__) && defined(__clang__)\n#    if (__clang_major__ >= 10)\nPYBIND11_WARNING_DISABLE_CLANG(\"-Wself-assign-overloaded\")\n#    endif\n#elif defined(__clang__)\n#    if (__clang_major__ >= 7)\nPYBIND11_WARNING_DISABLE_CLANG(\"-Wself-assign-overloaded\")\n#    endif\n#endif\n\nTEST_SUBMODULE(operators, m) {\n\n    // test_operator_overloading\n    py::class_<Vector2>(m, \"Vector2\")\n        .def(py::init<float, float>())\n        .def(py::self + py::self)\n        .def(py::self + float())\n        .def(py::self - py::self)\n        .def(py::self - float())\n        .def(py::self * float())\n        .def(py::self / float())\n        .def(py::self * py::self)\n        .def(py::self / py::self)\n        .def(py::self += py::self)\n        .def(py::self -= py::self)\n        .def(py::self *= float())\n        .def(py::self /= float())\n        .def(py::self *= py::self)\n        .def(py::self /= py::self)\n        .def(float() + py::self)\n        .def(float() - py::self)\n        .def(float() * py::self)\n        .def(float() / py::self)\n        .def(-py::self)\n        .def(\"__str__\", &Vector2::toString)\n        .def(\"__repr__\", &Vector2::toString)\n        .def(py::self == py::self)\n        .def(py::self != py::self)\n        .def(py::hash(py::self))\n        // N.B. See warning about usage of `py::detail::abs(py::self)` in\n        // `operators.h`.\n        .def(\"__abs__\", [](const Vector2 &v) { return abs(v); });\n\n    m.attr(\"Vector\") = m.attr(\"Vector2\");\n\n    // test_operators_notimplemented\n    // #393: need to return NotSupported to ensure correct arithmetic operator behavior\n    py::class_<C1>(m, \"C1\").def(py::init<>()).def(py::self + py::self);\n\n    py::class_<C2>(m, \"C2\")\n        .def(py::init<>())\n        .def(py::self + py::self)\n        .def(\"__add__\", [](const C2 &c2, const C1 &c1) { return c2 + c1; })\n        .def(\"__radd__\", [](const C2 &c2, const C1 &c1) { return c1 + c2; });\n\n    // test_nested\n    // #328: first member in a class can't be used in operators\n    struct NestABase {\n        int value = -2;\n    };\n    py::class_<NestABase>(m, \"NestABase\")\n        .def(py::init<>())\n        .def_readwrite(\"value\", &NestABase::value);\n\n    struct NestA : NestABase {\n        int value = 3;\n        NestA &operator+=(int i) {\n            value += i;\n            return *this;\n        }\n    };\n    py::class_<NestA>(m, \"NestA\")\n        .def(py::init<>())\n        .def(py::self += int())\n        .def(\n            \"as_base\",\n            [](NestA &a) -> NestABase & { return (NestABase &) a; },\n            py::return_value_policy::reference_internal);\n    m.def(\"get_NestA\", [](const NestA &a) { return a.value; });\n\n    struct NestB {\n        NestA a;\n        int value = 4;\n        NestB &operator-=(int i) {\n            value -= i;\n            return *this;\n        }\n    };\n    py::class_<NestB>(m, \"NestB\")\n        .def(py::init<>())\n        .def(py::self -= int())\n        .def_readwrite(\"a\", &NestB::a);\n    m.def(\"get_NestB\", [](const NestB &b) { return b.value; });\n\n    struct NestC {\n        NestB b;\n        int value = 5;\n        NestC &operator*=(int i) {\n            value *= i;\n            return *this;\n        }\n    };\n    py::class_<NestC>(m, \"NestC\")\n        .def(py::init<>())\n        .def(py::self *= int())\n        .def_readwrite(\"b\", &NestC::b);\n    m.def(\"get_NestC\", [](const NestC &c) { return c.value; });\n\n    // test_overriding_eq_reset_hash\n    // #2191 Overriding __eq__ should set __hash__ to None\n    struct Comparable {\n        int value;\n        bool operator==(const Comparable &rhs) const { return value == rhs.value; }\n    };\n\n    struct Hashable : Comparable {\n        explicit Hashable(int value) : Comparable{value} {};\n        size_t hash() const { return static_cast<size_t>(value); }\n    };\n\n    struct Hashable2 : Hashable {\n        using Hashable::Hashable;\n    };\n\n    py::class_<Comparable>(m, \"Comparable\").def(py::init<int>()).def(py::self == py::self);\n\n    py::class_<Hashable>(m, \"Hashable\")\n        .def(py::init<int>())\n        .def(py::self == py::self)\n        .def(\"__hash__\", &Hashable::hash);\n\n    // define __hash__ before __eq__\n    py::class_<Hashable2>(m, \"Hashable2\")\n        .def(\"__hash__\", &Hashable::hash)\n        .def(py::init<int>())\n        .def(py::self == py::self);\n\n    // define __eq__ but not __hash__\n    py::class_<HashMe>(m, \"HashMe\").def(py::self == py::self);\n\n    m.def(\"get_unhashable_HashMe_set\", []() { return std::unordered_set<HashMe>{{\"one\"}}; });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_operator_overloading.py",
    "content": "import pytest\n\nfrom pybind11_tests import ConstructorStats\nfrom pybind11_tests import operators as m\n\n\ndef test_operator_overloading():\n    v1 = m.Vector2(1, 2)\n    v2 = m.Vector(3, -1)\n    v3 = m.Vector2(1, 2)  # Same value as v1, but different instance.\n    assert v1 is not v3\n\n    assert str(v1) == \"[1.000000, 2.000000]\"\n    assert str(v2) == \"[3.000000, -1.000000]\"\n\n    assert str(-v2) == \"[-3.000000, 1.000000]\"\n\n    assert str(v1 + v2) == \"[4.000000, 1.000000]\"\n    assert str(v1 - v2) == \"[-2.000000, 3.000000]\"\n    assert str(v1 - 8) == \"[-7.000000, -6.000000]\"\n    assert str(v1 + 8) == \"[9.000000, 10.000000]\"\n    assert str(v1 * 8) == \"[8.000000, 16.000000]\"\n    assert str(v1 / 8) == \"[0.125000, 0.250000]\"\n    assert str(8 - v1) == \"[7.000000, 6.000000]\"\n    assert str(8 + v1) == \"[9.000000, 10.000000]\"\n    assert str(8 * v1) == \"[8.000000, 16.000000]\"\n    assert str(8 / v1) == \"[8.000000, 4.000000]\"\n    assert str(v1 * v2) == \"[3.000000, -2.000000]\"\n    assert str(v2 / v1) == \"[3.000000, -0.500000]\"\n\n    assert v1 == v3\n    assert v1 != v2\n    assert hash(v1) == 4\n    # TODO(eric.cousineau): Make this work.\n    # assert abs(v1) == \"abs(Vector2)\"\n\n    v1 += 2 * v2\n    assert str(v1) == \"[7.000000, 0.000000]\"\n    v1 -= v2\n    assert str(v1) == \"[4.000000, 1.000000]\"\n    v1 *= 2\n    assert str(v1) == \"[8.000000, 2.000000]\"\n    v1 /= 16\n    assert str(v1) == \"[0.500000, 0.125000]\"\n    v1 *= v2\n    assert str(v1) == \"[1.500000, -0.125000]\"\n    v2 /= v1\n    assert str(v2) == \"[2.000000, 8.000000]\"\n\n    cstats = ConstructorStats.get(m.Vector2)\n    assert cstats.alive() == 3\n    del v1\n    assert cstats.alive() == 2\n    del v2\n    assert cstats.alive() == 1\n    del v3\n    assert cstats.alive() == 0\n    assert cstats.values() == [\n        \"[1.000000, 2.000000]\",\n        \"[3.000000, -1.000000]\",\n        \"[1.000000, 2.000000]\",\n        \"[-3.000000, 1.000000]\",\n        \"[4.000000, 1.000000]\",\n        \"[-2.000000, 3.000000]\",\n        \"[-7.000000, -6.000000]\",\n        \"[9.000000, 10.000000]\",\n        \"[8.000000, 16.000000]\",\n        \"[0.125000, 0.250000]\",\n        \"[7.000000, 6.000000]\",\n        \"[9.000000, 10.000000]\",\n        \"[8.000000, 16.000000]\",\n        \"[8.000000, 4.000000]\",\n        \"[3.000000, -2.000000]\",\n        \"[3.000000, -0.500000]\",\n        \"[6.000000, -2.000000]\",\n    ]\n    assert cstats.default_constructions == 0\n    assert cstats.copy_constructions == 0\n    assert cstats.move_constructions >= 10\n    assert cstats.copy_assignments == 0\n    assert cstats.move_assignments == 0\n\n\ndef test_operators_notimplemented():\n    \"\"\"#393: need to return NotSupported to ensure correct arithmetic operator behavior\"\"\"\n\n    c1, c2 = m.C1(), m.C2()\n    assert c1 + c1 == 11\n    assert c2 + c2 == 22\n    assert c2 + c1 == 21\n    assert c1 + c2 == 12\n\n\ndef test_nested():\n    \"\"\"#328: first member in a class can't be used in operators\"\"\"\n\n    a = m.NestA()\n    b = m.NestB()\n    c = m.NestC()\n\n    a += 10\n    assert m.get_NestA(a) == 13\n    b.a += 100\n    assert m.get_NestA(b.a) == 103\n    c.b.a += 1000\n    assert m.get_NestA(c.b.a) == 1003\n    b -= 1\n    assert m.get_NestB(b) == 3\n    c.b -= 3\n    assert m.get_NestB(c.b) == 1\n    c *= 7\n    assert m.get_NestC(c) == 35\n\n    abase = a.as_base()\n    assert abase.value == -2\n    a.as_base().value += 44\n    assert abase.value == 42\n    assert c.b.a.as_base().value == -2\n    c.b.a.as_base().value += 44\n    assert c.b.a.as_base().value == 42\n\n    del c\n    pytest.gc_collect()\n    del a  # Shouldn't delete while abase is still alive\n    pytest.gc_collect()\n\n    assert abase.value == 42\n    del abase, b\n    pytest.gc_collect()\n\n\ndef test_overriding_eq_reset_hash():\n    assert m.Comparable(15) is not m.Comparable(15)\n    assert m.Comparable(15) == m.Comparable(15)\n\n    with pytest.raises(TypeError) as excinfo:\n        hash(m.Comparable(15))\n    assert str(excinfo.value).startswith(\"unhashable type:\")\n\n    for hashable in (m.Hashable, m.Hashable2):\n        assert hashable(15) is not hashable(15)\n        assert hashable(15) == hashable(15)\n\n        assert hash(hashable(15)) == 15\n        assert hash(hashable(15)) == hash(hashable(15))\n\n\ndef test_return_set_of_unhashable():\n    with pytest.raises(TypeError) as excinfo:\n        m.get_unhashable_HashMe_set()\n    assert str(excinfo.value.__cause__).startswith(\"unhashable type:\")\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_pickling.cpp",
    "content": "/*\n    tests/test_pickling.cpp -- pickle support\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n    Copyright (c) 2021 The Pybind Development Team.\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"pybind11_tests.h\"\n\n#include <memory>\n#include <stdexcept>\n#include <utility>\n\nnamespace exercise_trampoline {\n\nstruct SimpleBase {\n    int num = 0;\n    virtual ~SimpleBase() = default;\n\n    // For compatibility with old clang versions:\n    SimpleBase() = default;\n    SimpleBase(const SimpleBase &) = default;\n};\n\nstruct SimpleBaseTrampoline : SimpleBase {};\n\nstruct SimpleCppDerived : SimpleBase {};\n\nvoid wrap(py::module m) {\n    py::class_<SimpleBase, SimpleBaseTrampoline>(m, \"SimpleBase\")\n        .def(py::init<>())\n        .def_readwrite(\"num\", &SimpleBase::num)\n        .def(py::pickle(\n            [](const py::object &self) {\n                py::dict d;\n                if (py::hasattr(self, \"__dict__\")) {\n                    d = self.attr(\"__dict__\");\n                }\n                return py::make_tuple(self.attr(\"num\"), d);\n            },\n            [](const py::tuple &t) {\n                if (t.size() != 2) {\n                    throw std::runtime_error(\"Invalid state!\");\n                }\n                auto cpp_state = std::unique_ptr<SimpleBase>(new SimpleBaseTrampoline);\n                cpp_state->num = t[0].cast<int>();\n                auto py_state = t[1].cast<py::dict>();\n                return std::make_pair(std::move(cpp_state), py_state);\n            }));\n\n    m.def(\"make_SimpleCppDerivedAsBase\",\n          []() { return std::unique_ptr<SimpleBase>(new SimpleCppDerived); });\n    m.def(\"check_dynamic_cast_SimpleCppDerived\", [](const SimpleBase *base_ptr) {\n        return dynamic_cast<const SimpleCppDerived *>(base_ptr) != nullptr;\n    });\n}\n\n} // namespace exercise_trampoline\n\nTEST_SUBMODULE(pickling, m) {\n    m.def(\"simple_callable\", []() { return 20220426; });\n\n    // test_roundtrip\n    class Pickleable {\n    public:\n        explicit Pickleable(const std::string &value) : m_value(value) {}\n        const std::string &value() const { return m_value; }\n\n        void setExtra1(int extra1) { m_extra1 = extra1; }\n        void setExtra2(int extra2) { m_extra2 = extra2; }\n        int extra1() const { return m_extra1; }\n        int extra2() const { return m_extra2; }\n\n    private:\n        std::string m_value;\n        int m_extra1 = 0;\n        int m_extra2 = 0;\n    };\n\n    class PickleableNew : public Pickleable {\n    public:\n        using Pickleable::Pickleable;\n    };\n\n    py::class_<Pickleable> pyPickleable(m, \"Pickleable\");\n    pyPickleable.def(py::init<std::string>())\n        .def(\"value\", &Pickleable::value)\n        .def(\"extra1\", &Pickleable::extra1)\n        .def(\"extra2\", &Pickleable::extra2)\n        .def(\"setExtra1\", &Pickleable::setExtra1)\n        .def(\"setExtra2\", &Pickleable::setExtra2)\n        // For details on the methods below, refer to\n        // http://docs.python.org/3/library/pickle.html#pickling-class-instances\n        .def(\"__getstate__\", [](const Pickleable &p) {\n            /* Return a tuple that fully encodes the state of the object */\n            return py::make_tuple(p.value(), p.extra1(), p.extra2());\n        });\n    ignoreOldStyleInitWarnings([&pyPickleable]() {\n        pyPickleable.def(\"__setstate__\", [](Pickleable &p, const py::tuple &t) {\n            if (t.size() != 3) {\n                throw std::runtime_error(\"Invalid state!\");\n            }\n            /* Invoke the constructor (need to use in-place version) */\n            new (&p) Pickleable(t[0].cast<std::string>());\n\n            /* Assign any additional state */\n            p.setExtra1(t[1].cast<int>());\n            p.setExtra2(t[2].cast<int>());\n        });\n    });\n\n    py::class_<PickleableNew, Pickleable>(m, \"PickleableNew\")\n        .def(py::init<std::string>())\n        .def(py::pickle(\n            [](const PickleableNew &p) {\n                return py::make_tuple(p.value(), p.extra1(), p.extra2());\n            },\n            [](const py::tuple &t) {\n                if (t.size() != 3) {\n                    throw std::runtime_error(\"Invalid state!\");\n                }\n                auto p = PickleableNew(t[0].cast<std::string>());\n\n                p.setExtra1(t[1].cast<int>());\n                p.setExtra2(t[2].cast<int>());\n                return p;\n            }));\n\n#if !defined(PYPY_VERSION)\n    // test_roundtrip_with_dict\n    class PickleableWithDict {\n    public:\n        explicit PickleableWithDict(const std::string &value) : value(value) {}\n\n        std::string value;\n        int extra;\n    };\n\n    class PickleableWithDictNew : public PickleableWithDict {\n    public:\n        using PickleableWithDict::PickleableWithDict;\n    };\n\n    py::class_<PickleableWithDict> pyPickleableWithDict(\n        m, \"PickleableWithDict\", py::dynamic_attr());\n    pyPickleableWithDict.def(py::init<std::string>())\n        .def_readwrite(\"value\", &PickleableWithDict::value)\n        .def_readwrite(\"extra\", &PickleableWithDict::extra)\n        .def(\"__getstate__\", [](const py::object &self) {\n            /* Also include __dict__ in state */\n            return py::make_tuple(self.attr(\"value\"), self.attr(\"extra\"), self.attr(\"__dict__\"));\n        });\n    ignoreOldStyleInitWarnings([&pyPickleableWithDict]() {\n        pyPickleableWithDict.def(\"__setstate__\", [](const py::object &self, const py::tuple &t) {\n            if (t.size() != 3) {\n                throw std::runtime_error(\"Invalid state!\");\n            }\n            /* Cast and construct */\n            auto &p = self.cast<PickleableWithDict &>();\n            new (&p) PickleableWithDict(t[0].cast<std::string>());\n\n            /* Assign C++ state */\n            p.extra = t[1].cast<int>();\n\n            /* Assign Python state */\n            self.attr(\"__dict__\") = t[2];\n        });\n    });\n\n    py::class_<PickleableWithDictNew, PickleableWithDict>(m, \"PickleableWithDictNew\")\n        .def(py::init<std::string>())\n        .def(py::pickle(\n            [](const py::object &self) {\n                return py::make_tuple(\n                    self.attr(\"value\"), self.attr(\"extra\"), self.attr(\"__dict__\"));\n            },\n            [](const py::tuple &t) {\n                if (t.size() != 3) {\n                    throw std::runtime_error(\"Invalid state!\");\n                }\n\n                auto cpp_state = PickleableWithDictNew(t[0].cast<std::string>());\n                cpp_state.extra = t[1].cast<int>();\n\n                auto py_state = t[2].cast<py::dict>();\n                return std::make_pair(cpp_state, py_state);\n            }));\n#endif\n\n    exercise_trampoline::wrap(m);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_pickling.py",
    "content": "import pickle\nimport re\n\nimport pytest\n\nimport env\nfrom pybind11_tests import pickling as m\n\n\ndef test_pickle_simple_callable():\n    assert m.simple_callable() == 20220426\n    if env.PYPY:\n        serialized = pickle.dumps(m.simple_callable)\n        deserialized = pickle.loads(serialized)\n        assert deserialized() == 20220426\n    else:\n        # To document broken behavior: currently it fails universally with\n        # all C Python versions.\n        with pytest.raises(TypeError) as excinfo:\n            pickle.dumps(m.simple_callable)\n        assert re.search(\"can.*t pickle .*PyCapsule.* object\", str(excinfo.value))\n\n\n@pytest.mark.parametrize(\"cls_name\", [\"Pickleable\", \"PickleableNew\"])\ndef test_roundtrip(cls_name):\n    cls = getattr(m, cls_name)\n    p = cls(\"test_value\")\n    p.setExtra1(15)\n    p.setExtra2(48)\n\n    data = pickle.dumps(p, 2)  # Must use pickle protocol >= 2\n    p2 = pickle.loads(data)\n    assert p2.value() == p.value()\n    assert p2.extra1() == p.extra1()\n    assert p2.extra2() == p.extra2()\n\n\n@pytest.mark.xfail(\"env.PYPY\")\n@pytest.mark.parametrize(\"cls_name\", [\"PickleableWithDict\", \"PickleableWithDictNew\"])\ndef test_roundtrip_with_dict(cls_name):\n    cls = getattr(m, cls_name)\n    p = cls(\"test_value\")\n    p.extra = 15\n    p.dynamic = \"Attribute\"\n\n    data = pickle.dumps(p, pickle.HIGHEST_PROTOCOL)\n    p2 = pickle.loads(data)\n    assert p2.value == p.value\n    assert p2.extra == p.extra\n    assert p2.dynamic == p.dynamic\n\n\ndef test_enum_pickle():\n    from pybind11_tests import enums as e\n\n    data = pickle.dumps(e.EOne, 2)\n    assert e.EOne == pickle.loads(data)\n\n\n#\n# exercise_trampoline\n#\nclass SimplePyDerived(m.SimpleBase):\n    pass\n\n\ndef test_roundtrip_simple_py_derived():\n    p = SimplePyDerived()\n    p.num = 202\n    p.stored_in_dict = 303\n    data = pickle.dumps(p, pickle.HIGHEST_PROTOCOL)\n    p2 = pickle.loads(data)\n    assert isinstance(p2, SimplePyDerived)\n    assert p2.num == 202\n    assert p2.stored_in_dict == 303\n\n\ndef test_roundtrip_simple_cpp_derived():\n    p = m.make_SimpleCppDerivedAsBase()\n    assert m.check_dynamic_cast_SimpleCppDerived(p)\n    p.num = 404\n    if not env.PYPY:\n        # To ensure that this unit test is not accidentally invalidated.\n        with pytest.raises(AttributeError):\n            # Mimics the `setstate` C++ implementation.\n            setattr(p, \"__dict__\", {})  # noqa: B010\n    data = pickle.dumps(p, pickle.HIGHEST_PROTOCOL)\n    p2 = pickle.loads(data)\n    assert isinstance(p2, m.SimpleBase)\n    assert p2.num == 404\n    # Issue #3062: pickleable base C++ classes can incur object slicing\n    #              if derived typeid is not registered with pybind11\n    assert not m.check_dynamic_cast_SimpleCppDerived(p2)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_pytypes.cpp",
    "content": "/*\n    tests/test_pytypes.cpp -- Python type casters\n\n    Copyright (c) 2017 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"pybind11_tests.h\"\n\n#include <utility>\n\nnamespace external {\nnamespace detail {\nbool check(PyObject *o) { return PyFloat_Check(o) != 0; }\n\nPyObject *conv(PyObject *o) {\n    PyObject *ret = nullptr;\n    if (PyLong_Check(o)) {\n        double v = PyLong_AsDouble(o);\n        if (!(v == -1.0 && PyErr_Occurred())) {\n            ret = PyFloat_FromDouble(v);\n        }\n    } else {\n        PyErr_SetString(PyExc_TypeError, \"Unexpected type\");\n    }\n    return ret;\n}\n\nPyObject *default_constructed() { return PyFloat_FromDouble(0.0); }\n} // namespace detail\nclass float_ : public py::object {\n    PYBIND11_OBJECT_CVT(float_, py::object, external::detail::check, external::detail::conv)\n\n    float_() : py::object(external::detail::default_constructed(), stolen_t{}) {}\n\n    double get_value() const { return PyFloat_AsDouble(this->ptr()); }\n};\n} // namespace external\n\nnamespace implicit_conversion_from_0_to_handle {\n// Uncomment to trigger compiler error. Note: Before PR #4008 this used to compile successfully.\n// void expected_to_trigger_compiler_error() { py::handle(0); }\n} // namespace implicit_conversion_from_0_to_handle\n\n// Used to validate systematically that PR #4008 does/did NOT change the behavior.\nvoid pure_compile_tests_for_handle_from_PyObject_pointers() {\n    {\n        PyObject *ptr = Py_None;\n        py::handle{ptr};\n    }\n    {\n        PyObject *const ptr = Py_None;\n        py::handle{ptr};\n    }\n    // Uncomment to trigger compiler errors.\n    // PyObject const *               ptr = Py_None; py::handle{ptr};\n    // PyObject const *const          ptr = Py_None; py::handle{ptr};\n    // PyObject volatile *            ptr = Py_None; py::handle{ptr};\n    // PyObject volatile *const       ptr = Py_None; py::handle{ptr};\n    // PyObject const volatile *      ptr = Py_None; py::handle{ptr};\n    // PyObject const volatile *const ptr = Py_None; py::handle{ptr};\n}\n\nnamespace handle_from_move_only_type_with_operator_PyObject {\n\n// Reduced from\n// https://github.com/pytorch/pytorch/blob/279634f384662b7c3a9f8bf7ccc3a6afd2f05657/torch/csrc/utils/object_ptr.h\nstruct operator_ncnst {\n    operator_ncnst() = default;\n    operator_ncnst(operator_ncnst &&) = default;\n    operator PyObject *() /* */ { return Py_None; } // NOLINT(google-explicit-constructor)\n};\n\nstruct operator_const {\n    operator_const() = default;\n    operator_const(operator_const &&) = default;\n    operator PyObject *() const { return Py_None; } // NOLINT(google-explicit-constructor)\n};\n\nbool from_ncnst() {\n    operator_ncnst obj;\n    auto h = py::handle(obj);  // Critical part of test: does this compile?\n    return h.ptr() == Py_None; // Just something.\n}\n\nbool from_const() {\n    operator_const obj;\n    auto h = py::handle(obj);  // Critical part of test: does this compile?\n    return h.ptr() == Py_None; // Just something.\n}\n\nvoid m_defs(py::module_ &m) {\n    m.def(\"handle_from_move_only_type_with_operator_PyObject_ncnst\", from_ncnst);\n    m.def(\"handle_from_move_only_type_with_operator_PyObject_const\", from_const);\n}\n\n} // namespace handle_from_move_only_type_with_operator_PyObject\n\nTEST_SUBMODULE(pytypes, m) {\n    m.def(\"obj_class_name\", [](py::handle obj) { return py::detail::obj_class_name(obj.ptr()); });\n\n    handle_from_move_only_type_with_operator_PyObject::m_defs(m);\n\n    // test_bool\n    m.def(\"get_bool\", [] { return py::bool_(false); });\n    // test_int\n    m.def(\"get_int\", [] { return py::int_(0); });\n    // test_iterator\n    m.def(\"get_iterator\", [] { return py::iterator(); });\n    // test_iterable\n    m.def(\"get_iterable\", [] { return py::iterable(); });\n    m.def(\"get_frozenset_from_iterable\",\n          [](const py::iterable &iter) { return py::frozenset(iter); });\n    m.def(\"get_list_from_iterable\", [](const py::iterable &iter) { return py::list(iter); });\n    m.def(\"get_set_from_iterable\", [](const py::iterable &iter) { return py::set(iter); });\n    m.def(\"get_tuple_from_iterable\", [](const py::iterable &iter) { return py::tuple(iter); });\n    // test_float\n    m.def(\"get_float\", [] { return py::float_(0.0f); });\n    // test_list\n    m.def(\"list_no_args\", []() { return py::list{}; });\n    m.def(\"list_ssize_t\", []() { return py::list{(py::ssize_t) 0}; });\n    m.def(\"list_size_t\", []() { return py::list{(py::size_t) 0}; });\n    m.def(\"list_insert_ssize_t\", [](py::list *l) { return l->insert((py::ssize_t) 1, 83); });\n    m.def(\"list_insert_size_t\", [](py::list *l) { return l->insert((py::size_t) 3, 57); });\n    m.def(\"get_list\", []() {\n        py::list list;\n        list.append(\"value\");\n        py::print(\"Entry at position 0:\", list[0]);\n        list[0] = py::str(\"overwritten\");\n        list.insert(0, \"inserted-0\");\n        list.insert(2, \"inserted-2\");\n        return list;\n    });\n    m.def(\"print_list\", [](const py::list &list) {\n        int index = 0;\n        for (auto item : list) {\n            py::print(\"list item {}: {}\"_s.format(index++, item));\n        }\n    });\n    // test_none\n    m.def(\"get_none\", [] { return py::none(); });\n    m.def(\"print_none\", [](const py::none &none) { py::print(\"none: {}\"_s.format(none)); });\n\n    // test_set, test_frozenset\n    m.def(\"get_set\", []() {\n        py::set set;\n        set.add(py::str(\"key1\"));\n        set.add(\"key2\");\n        set.add(std::string(\"key3\"));\n        return set;\n    });\n    m.def(\"get_frozenset\", []() {\n        py::set set;\n        set.add(py::str(\"key1\"));\n        set.add(\"key2\");\n        set.add(std::string(\"key3\"));\n        return py::frozenset(set);\n    });\n    m.def(\"print_anyset\", [](const py::anyset &set) {\n        for (auto item : set) {\n            py::print(\"key:\", item);\n        }\n    });\n    m.def(\"anyset_size\", [](const py::anyset &set) { return set.size(); });\n    m.def(\"anyset_empty\", [](const py::anyset &set) { return set.empty(); });\n    m.def(\"anyset_contains\",\n          [](const py::anyset &set, const py::object &key) { return set.contains(key); });\n    m.def(\"anyset_contains\",\n          [](const py::anyset &set, const char *key) { return set.contains(key); });\n    m.def(\"set_add\", [](py::set &set, const py::object &key) { set.add(key); });\n    m.def(\"set_clear\", [](py::set &set) { set.clear(); });\n\n    // test_dict\n    m.def(\"get_dict\", []() { return py::dict(\"key\"_a = \"value\"); });\n    m.def(\"print_dict\", [](const py::dict &dict) {\n        for (auto item : dict) {\n            py::print(\"key: {}, value={}\"_s.format(item.first, item.second));\n        }\n    });\n    m.def(\"dict_keyword_constructor\", []() {\n        auto d1 = py::dict(\"x\"_a = 1, \"y\"_a = 2);\n        auto d2 = py::dict(\"z\"_a = 3, **d1);\n        return d2;\n    });\n    m.def(\"dict_contains\",\n          [](const py::dict &dict, const py::object &val) { return dict.contains(val); });\n    m.def(\"dict_contains\",\n          [](const py::dict &dict, const char *val) { return dict.contains(val); });\n\n    // test_tuple\n    m.def(\"tuple_no_args\", []() { return py::tuple{}; });\n    m.def(\"tuple_ssize_t\", []() { return py::tuple{(py::ssize_t) 0}; });\n    m.def(\"tuple_size_t\", []() { return py::tuple{(py::size_t) 0}; });\n    m.def(\"get_tuple\", []() { return py::make_tuple(42, py::none(), \"spam\"); });\n\n    // test_simple_namespace\n    m.def(\"get_simple_namespace\", []() {\n        auto ns = py::module_::import(\"types\").attr(\"SimpleNamespace\")(\n            \"attr\"_a = 42, \"x\"_a = \"foo\", \"wrong\"_a = 1);\n        py::delattr(ns, \"wrong\");\n        py::setattr(ns, \"right\", py::int_(2));\n        return ns;\n    });\n\n    // test_str\n    m.def(\"str_from_char_ssize_t\", []() { return py::str{\"red\", (py::ssize_t) 3}; });\n    m.def(\"str_from_char_size_t\", []() { return py::str{\"blue\", (py::size_t) 4}; });\n    m.def(\"str_from_string\", []() { return py::str(std::string(\"baz\")); });\n    m.def(\"str_from_std_string_input\", [](const std::string &stri) { return py::str(stri); });\n    m.def(\"str_from_cstr_input\", [](const char *c_str) { return py::str(c_str); });\n    m.def(\"str_from_bytes\", []() { return py::str(py::bytes(\"boo\", 3)); });\n    m.def(\"str_from_bytes_input\",\n          [](const py::bytes &encoded_str) { return py::str(encoded_str); });\n\n    m.def(\"str_from_object\", [](const py::object &obj) { return py::str(obj); });\n    m.def(\"repr_from_object\", [](const py::object &obj) { return py::repr(obj); });\n    m.def(\"str_from_handle\", [](py::handle h) { return py::str(h); });\n    m.def(\"str_from_string_from_str\",\n          [](const py::str &obj) { return py::str(static_cast<std::string>(obj)); });\n\n    m.def(\"str_format\", []() {\n        auto s1 = \"{} + {} = {}\"_s.format(1, 2, 3);\n        auto s2 = \"{a} + {b} = {c}\"_s.format(\"a\"_a = 1, \"b\"_a = 2, \"c\"_a = 3);\n        return py::make_tuple(s1, s2);\n    });\n\n    // test_bytes\n    m.def(\"bytes_from_char_ssize_t\", []() { return py::bytes{\"green\", (py::ssize_t) 5}; });\n    m.def(\"bytes_from_char_size_t\", []() { return py::bytes{\"purple\", (py::size_t) 6}; });\n    m.def(\"bytes_from_string\", []() { return py::bytes(std::string(\"foo\")); });\n    m.def(\"bytes_from_str\", []() { return py::bytes(py::str(\"bar\", 3)); });\n\n    // test bytearray\n    m.def(\"bytearray_from_char_ssize_t\", []() { return py::bytearray{\"$%\", (py::ssize_t) 2}; });\n    m.def(\"bytearray_from_char_size_t\", []() { return py::bytearray{\"@$!\", (py::size_t) 3}; });\n    m.def(\"bytearray_from_string\", []() { return py::bytearray(std::string(\"foo\")); });\n    m.def(\"bytearray_size\", []() { return py::bytearray(\"foo\").size(); });\n\n    // test_capsule\n    m.def(\"return_capsule_with_destructor\", []() {\n        py::print(\"creating capsule\");\n        return py::capsule([]() { py::print(\"destructing capsule\"); });\n    });\n\n    m.def(\"return_renamed_capsule_with_destructor\", []() {\n        py::print(\"creating capsule\");\n        auto cap = py::capsule([]() { py::print(\"destructing capsule\"); });\n        static const char *capsule_name = \"test_name1\";\n        py::print(\"renaming capsule\");\n        cap.set_name(capsule_name);\n        return cap;\n    });\n\n    m.def(\"return_capsule_with_destructor_2\", []() {\n        py::print(\"creating capsule\");\n        return py::capsule((void *) 1234, [](void *ptr) {\n            py::print(\"destructing capsule: {}\"_s.format((size_t) ptr));\n        });\n    });\n\n    m.def(\"return_renamed_capsule_with_destructor_2\", []() {\n        py::print(\"creating capsule\");\n        auto cap = py::capsule((void *) 1234, [](void *ptr) {\n            py::print(\"destructing capsule: {}\"_s.format((size_t) ptr));\n        });\n        static const char *capsule_name = \"test_name2\";\n        py::print(\"renaming capsule\");\n        cap.set_name(capsule_name);\n        return cap;\n    });\n\n    m.def(\"return_capsule_with_name_and_destructor\", []() {\n        auto capsule = py::capsule((void *) 12345, \"pointer type description\", [](PyObject *ptr) {\n            if (ptr) {\n                const auto *name = PyCapsule_GetName(ptr);\n                py::print(\"destructing capsule ({}, '{}')\"_s.format(\n                    (size_t) PyCapsule_GetPointer(ptr, name), name));\n            }\n        });\n\n        capsule.set_pointer((void *) 1234);\n\n        // Using get_pointer<T>()\n        void *contents1 = static_cast<void *>(capsule);\n        void *contents2 = capsule.get_pointer();\n        void *contents3 = capsule.get_pointer<void>();\n\n        auto result1 = reinterpret_cast<size_t>(contents1);\n        auto result2 = reinterpret_cast<size_t>(contents2);\n        auto result3 = reinterpret_cast<size_t>(contents3);\n\n        py::print(\n            \"created capsule ({}, '{}')\"_s.format(result1 & result2 & result3, capsule.name()));\n        return capsule;\n    });\n\n    m.def(\"return_capsule_with_explicit_nullptr_dtor\", []() {\n        py::print(\"creating capsule with explicit nullptr dtor\");\n        return py::capsule(reinterpret_cast<void *>(1234),\n                           static_cast<void (*)(void *)>(nullptr)); // PR #4221\n    });\n\n    // test_accessors\n    m.def(\"accessor_api\", [](const py::object &o) {\n        auto d = py::dict();\n\n        d[\"basic_attr\"] = o.attr(\"basic_attr\");\n\n        auto l = py::list();\n        for (auto item : o.attr(\"begin_end\")) {\n            l.append(item);\n        }\n        d[\"begin_end\"] = l;\n\n        d[\"operator[object]\"] = o.attr(\"d\")[\"operator[object]\"_s];\n        d[\"operator[char *]\"] = o.attr(\"d\")[\"operator[char *]\"];\n\n        d[\"attr(object)\"] = o.attr(\"sub\").attr(\"attr_obj\");\n        d[\"attr(char *)\"] = o.attr(\"sub\").attr(\"attr_char\");\n        try {\n            o.attr(\"sub\").attr(\"missing\").ptr();\n        } catch (const py::error_already_set &) {\n            d[\"missing_attr_ptr\"] = \"raised\"_s;\n        }\n        try {\n            o.attr(\"missing\").attr(\"doesn't matter\");\n        } catch (const py::error_already_set &) {\n            d[\"missing_attr_chain\"] = \"raised\"_s;\n        }\n\n        d[\"is_none\"] = o.attr(\"basic_attr\").is_none();\n\n        d[\"operator()\"] = o.attr(\"func\")(1);\n        d[\"operator*\"] = o.attr(\"func\")(*o.attr(\"begin_end\"));\n\n        // Test implicit conversion\n        py::list implicit_list = o.attr(\"begin_end\");\n        d[\"implicit_list\"] = implicit_list;\n        py::dict implicit_dict = o.attr(\"__dict__\");\n        d[\"implicit_dict\"] = implicit_dict;\n\n        return d;\n    });\n\n    m.def(\"tuple_accessor\", [](const py::tuple &existing_t) {\n        try {\n            existing_t[0] = 1;\n        } catch (const py::error_already_set &) {\n            // --> Python system error\n            // Only new tuples (refcount == 1) are mutable\n            auto new_t = py::tuple(3);\n            for (size_t i = 0; i < new_t.size(); ++i) {\n                new_t[i] = i;\n            }\n            return new_t;\n        }\n        return py::tuple();\n    });\n\n    m.def(\"accessor_assignment\", []() {\n        auto l = py::list(1);\n        l[0] = 0;\n\n        auto d = py::dict();\n        d[\"get\"] = l[0];\n        auto var = l[0];\n        d[\"deferred_get\"] = var;\n        l[0] = 1;\n        d[\"set\"] = l[0];\n        var = 99; // this assignment should not overwrite l[0]\n        d[\"deferred_set\"] = l[0];\n        d[\"var\"] = var;\n\n        return d;\n    });\n\n    m.def(\"accessor_moves\", []() { // See PR #3970\n        py::list return_list;\n#ifdef PYBIND11_HANDLE_REF_DEBUG\n        py::int_ py_int_0(0);\n        py::int_ py_int_42(42);\n        py::str py_str_count(\"count\");\n\n        auto tup = py::make_tuple(0);\n\n        py::sequence seq(tup);\n\n        py::list lst;\n        lst.append(0);\n\n#    define PYBIND11_LOCAL_DEF(...)                                                               \\\n        {                                                                                         \\\n            std::size_t inc_refs = py::handle::inc_ref_counter();                                 \\\n            __VA_ARGS__;                                                                          \\\n            inc_refs = py::handle::inc_ref_counter() - inc_refs;                                  \\\n            return_list.append(inc_refs);                                                         \\\n        }\n\n        PYBIND11_LOCAL_DEF(tup[py_int_0])    // l-value (to have a control)\n        PYBIND11_LOCAL_DEF(tup[py::int_(0)]) // r-value\n\n        PYBIND11_LOCAL_DEF(tup.attr(py_str_count))     // l-value\n        PYBIND11_LOCAL_DEF(tup.attr(py::str(\"count\"))) // r-value\n\n        PYBIND11_LOCAL_DEF(seq[py_int_0])    // l-value\n        PYBIND11_LOCAL_DEF(seq[py::int_(0)]) // r-value\n\n        PYBIND11_LOCAL_DEF(seq.attr(py_str_count))     // l-value\n        PYBIND11_LOCAL_DEF(seq.attr(py::str(\"count\"))) // r-value\n\n        PYBIND11_LOCAL_DEF(lst[py_int_0])    // l-value\n        PYBIND11_LOCAL_DEF(lst[py::int_(0)]) // r-value\n\n        PYBIND11_LOCAL_DEF(lst.attr(py_str_count))     // l-value\n        PYBIND11_LOCAL_DEF(lst.attr(py::str(\"count\"))) // r-value\n\n        auto lst_acc = lst[py::int_(0)];\n        lst_acc = py::int_(42);                    // Detaches lst_acc from lst.\n        PYBIND11_LOCAL_DEF(lst_acc = py_int_42)    // l-value\n        PYBIND11_LOCAL_DEF(lst_acc = py::int_(42)) // r-value\n#    undef PYBIND11_LOCAL_DEF\n#endif\n        return return_list;\n    });\n\n    // test_constructors\n    m.def(\"default_constructors\", []() {\n        return py::dict(\"bytes\"_a = py::bytes(),\n                        \"bytearray\"_a = py::bytearray(),\n                        \"str\"_a = py::str(),\n                        \"bool\"_a = py::bool_(),\n                        \"int\"_a = py::int_(),\n                        \"float\"_a = py::float_(),\n                        \"tuple\"_a = py::tuple(),\n                        \"list\"_a = py::list(),\n                        \"dict\"_a = py::dict(),\n                        \"set\"_a = py::set());\n    });\n\n    m.def(\"converting_constructors\", [](const py::dict &d) {\n        return py::dict(\"bytes\"_a = py::bytes(d[\"bytes\"]),\n                        \"bytearray\"_a = py::bytearray(d[\"bytearray\"]),\n                        \"str\"_a = py::str(d[\"str\"]),\n                        \"bool\"_a = py::bool_(d[\"bool\"]),\n                        \"int\"_a = py::int_(d[\"int\"]),\n                        \"float\"_a = py::float_(d[\"float\"]),\n                        \"tuple\"_a = py::tuple(d[\"tuple\"]),\n                        \"list\"_a = py::list(d[\"list\"]),\n                        \"dict\"_a = py::dict(d[\"dict\"]),\n                        \"set\"_a = py::set(d[\"set\"]),\n                        \"frozenset\"_a = py::frozenset(d[\"frozenset\"]),\n                        \"memoryview\"_a = py::memoryview(d[\"memoryview\"]));\n    });\n\n    m.def(\"cast_functions\", [](const py::dict &d) {\n        // When converting between Python types, obj.cast<T>() should be the same as T(obj)\n        return py::dict(\"bytes\"_a = d[\"bytes\"].cast<py::bytes>(),\n                        \"bytearray\"_a = d[\"bytearray\"].cast<py::bytearray>(),\n                        \"str\"_a = d[\"str\"].cast<py::str>(),\n                        \"bool\"_a = d[\"bool\"].cast<py::bool_>(),\n                        \"int\"_a = d[\"int\"].cast<py::int_>(),\n                        \"float\"_a = d[\"float\"].cast<py::float_>(),\n                        \"tuple\"_a = d[\"tuple\"].cast<py::tuple>(),\n                        \"list\"_a = d[\"list\"].cast<py::list>(),\n                        \"dict\"_a = d[\"dict\"].cast<py::dict>(),\n                        \"set\"_a = d[\"set\"].cast<py::set>(),\n                        \"frozenset\"_a = d[\"frozenset\"].cast<py::frozenset>(),\n                        \"memoryview\"_a = d[\"memoryview\"].cast<py::memoryview>());\n    });\n\n    m.def(\"convert_to_pybind11_str\", [](const py::object &o) { return py::str(o); });\n\n    m.def(\"nonconverting_constructor\",\n          [](const std::string &type, py::object value, bool move) -> py::object {\n              if (type == \"bytes\") {\n                  return move ? py::bytes(std::move(value)) : py::bytes(value);\n              }\n              if (type == \"none\") {\n                  return move ? py::none(std::move(value)) : py::none(value);\n              }\n              if (type == \"ellipsis\") {\n                  return move ? py::ellipsis(std::move(value)) : py::ellipsis(value);\n              }\n              if (type == \"type\") {\n                  return move ? py::type(std::move(value)) : py::type(value);\n              }\n              throw std::runtime_error(\"Invalid type\");\n          });\n\n    m.def(\"get_implicit_casting\", []() {\n        py::dict d;\n        d[\"char*_i1\"] = \"abc\";\n        const char *c2 = \"abc\";\n        d[\"char*_i2\"] = c2;\n        d[\"char*_e\"] = py::cast(c2);\n        d[\"char*_p\"] = py::str(c2);\n\n        d[\"int_i1\"] = 42;\n        int i = 42;\n        d[\"int_i2\"] = i;\n        i++;\n        d[\"int_e\"] = py::cast(i);\n        i++;\n        d[\"int_p\"] = py::int_(i);\n\n        d[\"str_i1\"] = std::string(\"str\");\n        std::string s2(\"str1\");\n        d[\"str_i2\"] = s2;\n        s2[3] = '2';\n        d[\"str_e\"] = py::cast(s2);\n        s2[3] = '3';\n        d[\"str_p\"] = py::str(s2);\n\n        py::list l(2);\n        l[0] = 3;\n        l[1] = py::cast(6);\n        l.append(9);\n        l.append(py::cast(12));\n        l.append(py::int_(15));\n\n        return py::dict(\"d\"_a = d, \"l\"_a = l);\n    });\n\n    // test_print\n    m.def(\"print_function\", []() {\n        py::print(\"Hello, World!\");\n        py::print(1, 2.0, \"three\", true, std::string(\"-- multiple args\"));\n        auto args = py::make_tuple(\"and\", \"a\", \"custom\", \"separator\");\n        py::print(\"*args\", *args, \"sep\"_a = \"-\");\n        py::print(\"no new line here\", \"end\"_a = \" -- \");\n        py::print(\"next print\");\n\n        auto py_stderr = py::module_::import(\"sys\").attr(\"stderr\");\n        py::print(\"this goes to stderr\", \"file\"_a = py_stderr);\n\n        py::print(\"flush\", \"flush\"_a = true);\n\n        py::print(\n            \"{a} + {b} = {c}\"_s.format(\"a\"_a = \"py::print\", \"b\"_a = \"str.format\", \"c\"_a = \"this\"));\n    });\n\n    m.def(\"print_failure\", []() { py::print(42, UnregisteredType()); });\n\n    m.def(\"hash_function\", [](py::object obj) { return py::hash(std::move(obj)); });\n\n    m.def(\"obj_contains\",\n          [](py::object &obj, const py::object &key) { return obj.contains(key); });\n\n    m.def(\"test_number_protocol\", [](const py::object &a, const py::object &b) {\n        py::list l;\n        l.append(a.equal(b));\n        l.append(a.not_equal(b));\n        l.append(a < b);\n        l.append(a <= b);\n        l.append(a > b);\n        l.append(a >= b);\n        l.append(a + b);\n        l.append(a - b);\n        l.append(a * b);\n        l.append(a / b);\n        l.append(a | b);\n        l.append(a & b);\n        l.append(a ^ b);\n        l.append(a >> b);\n        l.append(a << b);\n        return l;\n    });\n\n    m.def(\"test_list_slicing\", [](const py::list &a) { return a[py::slice(0, -1, 2)]; });\n\n    // See #2361\n    m.def(\"issue2361_str_implicit_copy_none\", []() {\n        py::str is_this_none = py::none();\n        return is_this_none;\n    });\n    m.def(\"issue2361_dict_implicit_copy_none\", []() {\n        py::dict is_this_none = py::none();\n        return is_this_none;\n    });\n\n    m.def(\"test_memoryview_object\", [](const py::buffer &b) { return py::memoryview(b); });\n\n    m.def(\"test_memoryview_buffer_info\",\n          [](const py::buffer &b) { return py::memoryview(b.request()); });\n\n    m.def(\"test_memoryview_from_buffer\", [](bool is_unsigned) {\n        static const int16_t si16[] = {3, 1, 4, 1, 5};\n        static const uint16_t ui16[] = {2, 7, 1, 8};\n        if (is_unsigned) {\n            return py::memoryview::from_buffer(ui16, {4}, {sizeof(uint16_t)});\n        }\n        return py::memoryview::from_buffer(si16, {5}, {sizeof(int16_t)});\n    });\n\n    m.def(\"test_memoryview_from_buffer_nativeformat\", []() {\n        static const char *format = \"@i\";\n        static const int32_t arr[] = {4, 7, 5};\n        return py::memoryview::from_buffer(arr, sizeof(int32_t), format, {3}, {sizeof(int32_t)});\n    });\n\n    m.def(\"test_memoryview_from_buffer_empty_shape\", []() {\n        static const char *buf = \"\";\n        return py::memoryview::from_buffer(buf, 1, \"B\", {}, {});\n    });\n\n    m.def(\"test_memoryview_from_buffer_invalid_strides\", []() {\n        static const char *buf = \"\\x02\\x03\\x04\";\n        return py::memoryview::from_buffer(buf, 1, \"B\", {3}, {});\n    });\n\n    m.def(\"test_memoryview_from_buffer_nullptr\", []() {\n        return py::memoryview::from_buffer(static_cast<void *>(nullptr), 1, \"B\", {}, {});\n    });\n\n    m.def(\"test_memoryview_from_memory\", []() {\n        const char *buf = \"\\xff\\xe1\\xab\\x37\";\n        return py::memoryview::from_memory(buf, static_cast<py::ssize_t>(strlen(buf)));\n    });\n\n    // test_builtin_functions\n    m.def(\"get_len\", [](py::handle h) { return py::len(h); });\n\n#ifdef PYBIND11_STR_LEGACY_PERMISSIVE\n    m.attr(\"PYBIND11_STR_LEGACY_PERMISSIVE\") = true;\n#endif\n\n    m.def(\"isinstance_pybind11_bytes\",\n          [](py::object o) { return py::isinstance<py::bytes>(std::move(o)); });\n    m.def(\"isinstance_pybind11_str\",\n          [](py::object o) { return py::isinstance<py::str>(std::move(o)); });\n\n    m.def(\"pass_to_pybind11_bytes\", [](py::bytes b) { return py::len(std::move(b)); });\n    m.def(\"pass_to_pybind11_str\", [](py::str s) { return py::len(std::move(s)); });\n    m.def(\"pass_to_std_string\", [](const std::string &s) { return s.size(); });\n\n    // test_weakref\n    m.def(\"weakref_from_handle\", [](py::handle h) { return py::weakref(h); });\n    m.def(\"weakref_from_handle_and_function\",\n          [](py::handle h, py::function f) { return py::weakref(h, std::move(f)); });\n    m.def(\"weakref_from_object\", [](const py::object &o) { return py::weakref(o); });\n    m.def(\"weakref_from_object_and_function\",\n          [](py::object o, py::function f) { return py::weakref(std::move(o), std::move(f)); });\n\n// See PR #3263 for background (https://github.com/pybind/pybind11/pull/3263):\n// pytypes.h could be changed to enforce the \"most correct\" user code below, by removing\n// `const` from iterator `reference` using type aliases, but that will break existing\n// user code.\n#if (defined(__APPLE__) && defined(__clang__)) || defined(PYPY_VERSION)\n// This is \"most correct\" and enforced on these platforms.\n#    define PYBIND11_AUTO_IT auto it\n#else\n// This works on many platforms and is (unfortunately) reflective of existing user code.\n// NOLINTNEXTLINE(bugprone-macro-parentheses)\n#    define PYBIND11_AUTO_IT auto &it\n#endif\n\n    m.def(\"tuple_iterator\", []() {\n        auto tup = py::make_tuple(5, 7);\n        int tup_sum = 0;\n        for (PYBIND11_AUTO_IT : tup) {\n            tup_sum += it.cast<int>();\n        }\n        return tup_sum;\n    });\n\n    m.def(\"dict_iterator\", []() {\n        py::dict dct;\n        dct[py::int_(3)] = 5;\n        dct[py::int_(7)] = 11;\n        int kv_sum = 0;\n        for (PYBIND11_AUTO_IT : dct) {\n            kv_sum += it.first.cast<int>() * 100 + it.second.cast<int>();\n        }\n        return kv_sum;\n    });\n\n    m.def(\"passed_iterator\", [](const py::iterator &py_it) {\n        int elem_sum = 0;\n        for (PYBIND11_AUTO_IT : py_it) {\n            elem_sum += it.cast<int>();\n        }\n        return elem_sum;\n    });\n\n#undef PYBIND11_AUTO_IT\n\n    // Tests below this line are for pybind11 IMPLEMENTATION DETAILS:\n\n    m.def(\"sequence_item_get_ssize_t\", [](const py::object &o) {\n        return py::detail::accessor_policies::sequence_item::get(o, (py::ssize_t) 1);\n    });\n    m.def(\"sequence_item_set_ssize_t\", [](const py::object &o) {\n        auto s = py::str{\"peppa\", 5};\n        py::detail::accessor_policies::sequence_item::set(o, (py::ssize_t) 1, s);\n    });\n    m.def(\"sequence_item_get_size_t\", [](const py::object &o) {\n        return py::detail::accessor_policies::sequence_item::get(o, (py::size_t) 2);\n    });\n    m.def(\"sequence_item_set_size_t\", [](const py::object &o) {\n        auto s = py::str{\"george\", 6};\n        py::detail::accessor_policies::sequence_item::set(o, (py::size_t) 2, s);\n    });\n    m.def(\"list_item_get_ssize_t\", [](const py::object &o) {\n        return py::detail::accessor_policies::list_item::get(o, (py::ssize_t) 3);\n    });\n    m.def(\"list_item_set_ssize_t\", [](const py::object &o) {\n        auto s = py::str{\"rebecca\", 7};\n        py::detail::accessor_policies::list_item::set(o, (py::ssize_t) 3, s);\n    });\n    m.def(\"list_item_get_size_t\", [](const py::object &o) {\n        return py::detail::accessor_policies::list_item::get(o, (py::size_t) 4);\n    });\n    m.def(\"list_item_set_size_t\", [](const py::object &o) {\n        auto s = py::str{\"richard\", 7};\n        py::detail::accessor_policies::list_item::set(o, (py::size_t) 4, s);\n    });\n    m.def(\"tuple_item_get_ssize_t\", [](const py::object &o) {\n        return py::detail::accessor_policies::tuple_item::get(o, (py::ssize_t) 5);\n    });\n    m.def(\"tuple_item_set_ssize_t\", []() {\n        auto s0 = py::str{\"emely\", 5};\n        auto s1 = py::str{\"edmond\", 6};\n        auto o = py::tuple{2};\n        py::detail::accessor_policies::tuple_item::set(o, (py::ssize_t) 0, s0);\n        py::detail::accessor_policies::tuple_item::set(o, (py::ssize_t) 1, s1);\n        return o;\n    });\n    m.def(\"tuple_item_get_size_t\", [](const py::object &o) {\n        return py::detail::accessor_policies::tuple_item::get(o, (py::size_t) 6);\n    });\n    m.def(\"tuple_item_set_size_t\", []() {\n        auto s0 = py::str{\"candy\", 5};\n        auto s1 = py::str{\"cat\", 3};\n        auto o = py::tuple{2};\n        py::detail::accessor_policies::tuple_item::set(o, (py::size_t) 1, s1);\n        py::detail::accessor_policies::tuple_item::set(o, (py::size_t) 0, s0);\n        return o;\n    });\n\n    m.def(\"square_float_\", [](const external::float_ &x) -> double {\n        double v = x.get_value();\n        return v * v;\n    });\n\n    m.def(\"tuple_rvalue_getter\", [](const py::tuple &tup) {\n        // tests accessing tuple object with rvalue int\n        for (size_t i = 0; i < tup.size(); i++) {\n            auto o = py::handle(tup[py::int_(i)]);\n            if (!o) {\n                throw py::value_error(\"tuple is malformed\");\n            }\n        }\n        return tup;\n    });\n    m.def(\"list_rvalue_getter\", [](const py::list &l) {\n        // tests accessing list with rvalue int\n        for (size_t i = 0; i < l.size(); i++) {\n            auto o = py::handle(l[py::int_(i)]);\n            if (!o) {\n                throw py::value_error(\"list is malformed\");\n            }\n        }\n        return l;\n    });\n    m.def(\"populate_dict_rvalue\", [](int population) {\n        auto d = py::dict();\n        for (int i = 0; i < population; i++) {\n            d[py::int_(i)] = py::int_(i);\n        }\n        return d;\n    });\n    m.def(\"populate_obj_str_attrs\", [](py::object &o, int population) {\n        for (int i = 0; i < population; i++) {\n            o.attr(py::str(py::int_(i))) = py::str(py::int_(i));\n        }\n        return o;\n    });\n\n    // testing immutable object augmented assignment: #issue 3812\n    m.def(\"inplace_append\", [](py::object &a, const py::object &b) {\n        a += b;\n        return a;\n    });\n    m.def(\"inplace_subtract\", [](py::object &a, const py::object &b) {\n        a -= b;\n        return a;\n    });\n    m.def(\"inplace_multiply\", [](py::object &a, const py::object &b) {\n        a *= b;\n        return a;\n    });\n    m.def(\"inplace_divide\", [](py::object &a, const py::object &b) {\n        a /= b;\n        return a;\n    });\n    m.def(\"inplace_or\", [](py::object &a, const py::object &b) {\n        a |= b;\n        return a;\n    });\n    m.def(\"inplace_and\", [](py::object &a, const py::object &b) {\n        a &= b;\n        return a;\n    });\n    m.def(\"inplace_lshift\", [](py::object &a, const py::object &b) {\n        a <<= b;\n        return a;\n    });\n    m.def(\"inplace_rshift\", [](py::object &a, const py::object &b) {\n        a >>= b;\n        return a;\n    });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_pytypes.py",
    "content": "import contextlib\nimport sys\nimport types\n\nimport pytest\n\nimport env\nfrom pybind11_tests import detailed_error_messages_enabled\nfrom pybind11_tests import pytypes as m\n\n\ndef test_obj_class_name():\n    assert m.obj_class_name(None) == \"NoneType\"\n    assert m.obj_class_name(list) == \"list\"\n    assert m.obj_class_name([]) == \"list\"\n\n\ndef test_handle_from_move_only_type_with_operator_PyObject():  # noqa: N802\n    assert m.handle_from_move_only_type_with_operator_PyObject_ncnst()\n    assert m.handle_from_move_only_type_with_operator_PyObject_const()\n\n\ndef test_bool(doc):\n    assert doc(m.get_bool) == \"get_bool() -> bool\"\n\n\ndef test_int(doc):\n    assert doc(m.get_int) == \"get_int() -> int\"\n\n\ndef test_iterator(doc):\n    assert doc(m.get_iterator) == \"get_iterator() -> Iterator\"\n\n\n@pytest.mark.parametrize(\n    \"pytype, from_iter_func\",\n    [\n        (frozenset, m.get_frozenset_from_iterable),\n        (list, m.get_list_from_iterable),\n        (set, m.get_set_from_iterable),\n        (tuple, m.get_tuple_from_iterable),\n    ],\n)\ndef test_from_iterable(pytype, from_iter_func):\n    my_iter = iter(range(10))\n    s = from_iter_func(my_iter)\n    assert type(s) == pytype\n    assert s == pytype(range(10))\n\n\ndef test_iterable(doc):\n    assert doc(m.get_iterable) == \"get_iterable() -> Iterable\"\n\n\ndef test_float(doc):\n    assert doc(m.get_float) == \"get_float() -> float\"\n\n\ndef test_list(capture, doc):\n    assert m.list_no_args() == []\n    assert m.list_ssize_t() == []\n    assert m.list_size_t() == []\n    lins = [1, 2]\n    m.list_insert_ssize_t(lins)\n    assert lins == [1, 83, 2]\n    m.list_insert_size_t(lins)\n    assert lins == [1, 83, 2, 57]\n\n    with capture:\n        lst = m.get_list()\n        assert lst == [\"inserted-0\", \"overwritten\", \"inserted-2\"]\n\n        lst.append(\"value2\")\n        m.print_list(lst)\n    assert (\n        capture.unordered\n        == \"\"\"\n        Entry at position 0: value\n        list item 0: inserted-0\n        list item 1: overwritten\n        list item 2: inserted-2\n        list item 3: value2\n    \"\"\"\n    )\n\n    assert doc(m.get_list) == \"get_list() -> list\"\n    assert doc(m.print_list) == \"print_list(arg0: list) -> None\"\n\n\ndef test_none(capture, doc):\n    assert doc(m.get_none) == \"get_none() -> None\"\n    assert doc(m.print_none) == \"print_none(arg0: None) -> None\"\n\n\ndef test_set(capture, doc):\n    s = m.get_set()\n    assert isinstance(s, set)\n    assert s == {\"key1\", \"key2\", \"key3\"}\n\n    s.add(\"key4\")\n    with capture:\n        m.print_anyset(s)\n    assert (\n        capture.unordered\n        == \"\"\"\n        key: key1\n        key: key2\n        key: key3\n        key: key4\n    \"\"\"\n    )\n\n    m.set_add(s, \"key5\")\n    assert m.anyset_size(s) == 5\n\n    m.set_clear(s)\n    assert m.anyset_empty(s)\n\n    assert not m.anyset_contains(set(), 42)\n    assert m.anyset_contains({42}, 42)\n    assert m.anyset_contains({\"foo\"}, \"foo\")\n\n    assert doc(m.get_set) == \"get_set() -> set\"\n    assert doc(m.print_anyset) == \"print_anyset(arg0: anyset) -> None\"\n\n\ndef test_frozenset(capture, doc):\n    s = m.get_frozenset()\n    assert isinstance(s, frozenset)\n    assert s == frozenset({\"key1\", \"key2\", \"key3\"})\n\n    with capture:\n        m.print_anyset(s)\n    assert (\n        capture.unordered\n        == \"\"\"\n        key: key1\n        key: key2\n        key: key3\n    \"\"\"\n    )\n    assert m.anyset_size(s) == 3\n    assert not m.anyset_empty(s)\n\n    assert not m.anyset_contains(frozenset(), 42)\n    assert m.anyset_contains(frozenset({42}), 42)\n    assert m.anyset_contains(frozenset({\"foo\"}), \"foo\")\n\n    assert doc(m.get_frozenset) == \"get_frozenset() -> frozenset\"\n\n\ndef test_dict(capture, doc):\n    d = m.get_dict()\n    assert d == {\"key\": \"value\"}\n\n    with capture:\n        d[\"key2\"] = \"value2\"\n        m.print_dict(d)\n    assert (\n        capture.unordered\n        == \"\"\"\n        key: key, value=value\n        key: key2, value=value2\n    \"\"\"\n    )\n\n    assert not m.dict_contains({}, 42)\n    assert m.dict_contains({42: None}, 42)\n    assert m.dict_contains({\"foo\": None}, \"foo\")\n\n    assert doc(m.get_dict) == \"get_dict() -> dict\"\n    assert doc(m.print_dict) == \"print_dict(arg0: dict) -> None\"\n\n    assert m.dict_keyword_constructor() == {\"x\": 1, \"y\": 2, \"z\": 3}\n\n\nclass CustomContains:\n    d = {\"key\": None}\n\n    def __contains__(self, m):\n        return m in self.d\n\n\n@pytest.mark.parametrize(\n    \"arg,func\",\n    [\n        (set(), m.anyset_contains),\n        (dict(), m.dict_contains),\n        (CustomContains(), m.obj_contains),\n    ],\n)\n@pytest.mark.xfail(\"env.PYPY and sys.pypy_version_info < (7, 3, 10)\", strict=False)\ndef test_unhashable_exceptions(arg, func):\n    class Unhashable:\n        __hash__ = None\n\n    with pytest.raises(TypeError) as exc_info:\n        func(arg, Unhashable())\n    assert \"unhashable type:\" in str(exc_info.value)\n\n\ndef test_tuple():\n    assert m.tuple_no_args() == ()\n    assert m.tuple_ssize_t() == ()\n    assert m.tuple_size_t() == ()\n    assert m.get_tuple() == (42, None, \"spam\")\n\n\ndef test_simple_namespace():\n    ns = m.get_simple_namespace()\n    assert ns.attr == 42\n    assert ns.x == \"foo\"\n    assert ns.right == 2\n    assert not hasattr(ns, \"wrong\")\n\n\ndef test_str(doc):\n    assert m.str_from_char_ssize_t().encode().decode() == \"red\"\n    assert m.str_from_char_size_t().encode().decode() == \"blue\"\n    assert m.str_from_string().encode().decode() == \"baz\"\n    assert m.str_from_bytes().encode().decode() == \"boo\"\n\n    assert doc(m.str_from_bytes) == \"str_from_bytes() -> str\"\n\n    class A:\n        def __str__(self):\n            return \"this is a str\"\n\n        def __repr__(self):\n            return \"this is a repr\"\n\n    assert m.str_from_object(A()) == \"this is a str\"\n    assert m.repr_from_object(A()) == \"this is a repr\"\n    assert m.str_from_handle(A()) == \"this is a str\"\n\n    s1, s2 = m.str_format()\n    assert s1 == \"1 + 2 = 3\"\n    assert s1 == s2\n\n    malformed_utf8 = b\"\\x80\"\n    if hasattr(m, \"PYBIND11_STR_LEGACY_PERMISSIVE\"):\n        assert m.str_from_object(malformed_utf8) is malformed_utf8\n    else:\n        assert m.str_from_object(malformed_utf8) == \"b'\\\\x80'\"\n    assert m.str_from_handle(malformed_utf8) == \"b'\\\\x80'\"\n\n    assert m.str_from_string_from_str(\"this is a str\") == \"this is a str\"\n    ucs_surrogates_str = \"\\udcc3\"\n    with pytest.raises(UnicodeEncodeError):\n        m.str_from_string_from_str(ucs_surrogates_str)\n\n\n@pytest.mark.parametrize(\n    \"func\",\n    [\n        m.str_from_bytes_input,\n        m.str_from_cstr_input,\n        m.str_from_std_string_input,\n    ],\n)\ndef test_surrogate_pairs_unicode_error(func):\n    input_str = \"\\ud83d\\ude4f\".encode(\"utf-8\", \"surrogatepass\")\n    with pytest.raises(UnicodeDecodeError):\n        func(input_str)\n\n\ndef test_bytes(doc):\n    assert m.bytes_from_char_ssize_t().decode() == \"green\"\n    assert m.bytes_from_char_size_t().decode() == \"purple\"\n    assert m.bytes_from_string().decode() == \"foo\"\n    assert m.bytes_from_str().decode() == \"bar\"\n\n    assert doc(m.bytes_from_str) == \"bytes_from_str() -> bytes\"\n\n\ndef test_bytearray(doc):\n    assert m.bytearray_from_char_ssize_t().decode() == \"$%\"\n    assert m.bytearray_from_char_size_t().decode() == \"@$!\"\n    assert m.bytearray_from_string().decode() == \"foo\"\n    assert m.bytearray_size() == len(\"foo\")\n\n\ndef test_capsule(capture):\n    pytest.gc_collect()\n    with capture:\n        a = m.return_capsule_with_destructor()\n        del a\n        pytest.gc_collect()\n    assert (\n        capture.unordered\n        == \"\"\"\n        creating capsule\n        destructing capsule\n    \"\"\"\n    )\n\n    with capture:\n        a = m.return_renamed_capsule_with_destructor()\n        del a\n        pytest.gc_collect()\n    assert (\n        capture.unordered\n        == \"\"\"\n        creating capsule\n        renaming capsule\n        destructing capsule\n    \"\"\"\n    )\n\n    with capture:\n        a = m.return_capsule_with_destructor_2()\n        del a\n        pytest.gc_collect()\n    assert (\n        capture.unordered\n        == \"\"\"\n        creating capsule\n        destructing capsule: 1234\n    \"\"\"\n    )\n\n    with capture:\n        a = m.return_renamed_capsule_with_destructor_2()\n        del a\n        pytest.gc_collect()\n    assert (\n        capture.unordered\n        == \"\"\"\n        creating capsule\n        renaming capsule\n        destructing capsule: 1234\n    \"\"\"\n    )\n\n    with capture:\n        a = m.return_capsule_with_name_and_destructor()\n        del a\n        pytest.gc_collect()\n    assert (\n        capture.unordered\n        == \"\"\"\n        created capsule (1234, 'pointer type description')\n        destructing capsule (1234, 'pointer type description')\n    \"\"\"\n    )\n\n    with capture:\n        a = m.return_capsule_with_explicit_nullptr_dtor()\n        del a\n        pytest.gc_collect()\n    assert (\n        capture.unordered\n        == \"\"\"\n        creating capsule with explicit nullptr dtor\n    \"\"\"\n    )\n\n\ndef test_accessors():\n    class SubTestObject:\n        attr_obj = 1\n        attr_char = 2\n\n    class TestObject:\n        basic_attr = 1\n        begin_end = [1, 2, 3]\n        d = {\"operator[object]\": 1, \"operator[char *]\": 2}\n        sub = SubTestObject()\n\n        def func(self, x, *args):\n            return self.basic_attr + x + sum(args)\n\n    d = m.accessor_api(TestObject())\n    assert d[\"basic_attr\"] == 1\n    assert d[\"begin_end\"] == [1, 2, 3]\n    assert d[\"operator[object]\"] == 1\n    assert d[\"operator[char *]\"] == 2\n    assert d[\"attr(object)\"] == 1\n    assert d[\"attr(char *)\"] == 2\n    assert d[\"missing_attr_ptr\"] == \"raised\"\n    assert d[\"missing_attr_chain\"] == \"raised\"\n    assert d[\"is_none\"] is False\n    assert d[\"operator()\"] == 2\n    assert d[\"operator*\"] == 7\n    assert d[\"implicit_list\"] == [1, 2, 3]\n    assert all(x in TestObject.__dict__ for x in d[\"implicit_dict\"])\n\n    assert m.tuple_accessor(tuple()) == (0, 1, 2)\n\n    d = m.accessor_assignment()\n    assert d[\"get\"] == 0\n    assert d[\"deferred_get\"] == 0\n    assert d[\"set\"] == 1\n    assert d[\"deferred_set\"] == 1\n    assert d[\"var\"] == 99\n\n\ndef test_accessor_moves():\n    inc_refs = m.accessor_moves()\n    if inc_refs:\n        assert inc_refs == [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]\n    else:\n        pytest.skip(\"Not defined: PYBIND11_HANDLE_REF_DEBUG\")\n\n\ndef test_constructors():\n    \"\"\"C++ default and converting constructors are equivalent to type calls in Python\"\"\"\n    types = [bytes, bytearray, str, bool, int, float, tuple, list, dict, set]\n    expected = {t.__name__: t() for t in types}\n    assert m.default_constructors() == expected\n\n    data = {\n        bytes: b\"41\",  # Currently no supported or working conversions.\n        bytearray: bytearray(b\"41\"),\n        str: 42,\n        bool: \"Not empty\",\n        int: \"42\",\n        float: \"+1e3\",\n        tuple: range(3),\n        list: range(3),\n        dict: [(\"two\", 2), (\"one\", 1), (\"three\", 3)],\n        set: [4, 4, 5, 6, 6, 6],\n        frozenset: [4, 4, 5, 6, 6, 6],\n        memoryview: b\"abc\",\n    }\n    inputs = {k.__name__: v for k, v in data.items()}\n    expected = {k.__name__: k(v) for k, v in data.items()}\n\n    assert m.converting_constructors(inputs) == expected\n    assert m.cast_functions(inputs) == expected\n\n    # Converting constructors and cast functions should just reference rather\n    # than copy when no conversion is needed:\n    noconv1 = m.converting_constructors(expected)\n    for k in noconv1:\n        assert noconv1[k] is expected[k]\n\n    noconv2 = m.cast_functions(expected)\n    for k in noconv2:\n        assert noconv2[k] is expected[k]\n\n\ndef test_non_converting_constructors():\n    non_converting_test_cases = [\n        (\"bytes\", range(10)),\n        (\"none\", 42),\n        (\"ellipsis\", 42),\n        (\"type\", 42),\n    ]\n    for t, v in non_converting_test_cases:\n        for move in [True, False]:\n            with pytest.raises(TypeError) as excinfo:\n                m.nonconverting_constructor(t, v, move)\n            expected_error = (\n                f\"Object of type '{type(v).__name__}' is not an instance of '{t}'\"\n            )\n            assert str(excinfo.value) == expected_error\n\n\ndef test_pybind11_str_raw_str():\n    # specifically to exercise pybind11::str::raw_str\n    cvt = m.convert_to_pybind11_str\n    assert cvt(\"Str\") == \"Str\"\n    assert cvt(b\"Bytes\") == \"b'Bytes'\"\n    assert cvt(None) == \"None\"\n    assert cvt(False) == \"False\"\n    assert cvt(True) == \"True\"\n    assert cvt(42) == \"42\"\n    assert cvt(2**65) == \"36893488147419103232\"\n    assert cvt(-1.50) == \"-1.5\"\n    assert cvt(()) == \"()\"\n    assert cvt((18,)) == \"(18,)\"\n    assert cvt([]) == \"[]\"\n    assert cvt([28]) == \"[28]\"\n    assert cvt({}) == \"{}\"\n    assert cvt({3: 4}) == \"{3: 4}\"\n    assert cvt(set()) == \"set()\"\n    assert cvt({3, 3}) == \"{3}\"\n\n    valid_orig = \"Ǳ\"\n    valid_utf8 = valid_orig.encode(\"utf-8\")\n    valid_cvt = cvt(valid_utf8)\n    if hasattr(m, \"PYBIND11_STR_LEGACY_PERMISSIVE\"):\n        assert valid_cvt is valid_utf8\n    else:\n        assert type(valid_cvt) is str\n        assert valid_cvt == \"b'\\\\xc7\\\\xb1'\"\n\n    malformed_utf8 = b\"\\x80\"\n    if hasattr(m, \"PYBIND11_STR_LEGACY_PERMISSIVE\"):\n        assert cvt(malformed_utf8) is malformed_utf8\n    else:\n        malformed_cvt = cvt(malformed_utf8)\n        assert type(malformed_cvt) is str\n        assert malformed_cvt == \"b'\\\\x80'\"\n\n\ndef test_implicit_casting():\n    \"\"\"Tests implicit casting when assigning or appending to dicts and lists.\"\"\"\n    z = m.get_implicit_casting()\n    assert z[\"d\"] == {\n        \"char*_i1\": \"abc\",\n        \"char*_i2\": \"abc\",\n        \"char*_e\": \"abc\",\n        \"char*_p\": \"abc\",\n        \"str_i1\": \"str\",\n        \"str_i2\": \"str1\",\n        \"str_e\": \"str2\",\n        \"str_p\": \"str3\",\n        \"int_i1\": 42,\n        \"int_i2\": 42,\n        \"int_e\": 43,\n        \"int_p\": 44,\n    }\n    assert z[\"l\"] == [3, 6, 9, 12, 15]\n\n\ndef test_print(capture):\n    with capture:\n        m.print_function()\n    assert (\n        capture\n        == \"\"\"\n        Hello, World!\n        1 2.0 three True -- multiple args\n        *args-and-a-custom-separator\n        no new line here -- next print\n        flush\n        py::print + str.format = this\n    \"\"\"\n    )\n    assert capture.stderr == \"this goes to stderr\"\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.print_failure()\n    assert str(excinfo.value) == \"Unable to convert call argument \" + (\n        \"'1' of type 'UnregisteredType' to Python object\"\n        if detailed_error_messages_enabled\n        else \"to Python object (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)\"\n    )\n\n\ndef test_hash():\n    class Hashable:\n        def __init__(self, value):\n            self.value = value\n\n        def __hash__(self):\n            return self.value\n\n    class Unhashable:\n        __hash__ = None\n\n    assert m.hash_function(Hashable(42)) == 42\n    with pytest.raises(TypeError):\n        m.hash_function(Unhashable())\n\n\ndef test_number_protocol():\n    for a, b in [(1, 1), (3, 5)]:\n        li = [\n            a == b,\n            a != b,\n            a < b,\n            a <= b,\n            a > b,\n            a >= b,\n            a + b,\n            a - b,\n            a * b,\n            a / b,\n            a | b,\n            a & b,\n            a ^ b,\n            a >> b,\n            a << b,\n        ]\n        assert m.test_number_protocol(a, b) == li\n\n\ndef test_list_slicing():\n    li = list(range(100))\n    assert li[::2] == m.test_list_slicing(li)\n\n\ndef test_issue2361():\n    # See issue #2361\n    assert m.issue2361_str_implicit_copy_none() == \"None\"\n    with pytest.raises(TypeError) as excinfo:\n        assert m.issue2361_dict_implicit_copy_none()\n    assert \"NoneType\" in str(excinfo.value)\n    assert \"iterable\" in str(excinfo.value)\n\n\n@pytest.mark.parametrize(\n    \"method, args, fmt, expected_view\",\n    [\n        (m.test_memoryview_object, (b\"red\",), \"B\", b\"red\"),\n        (m.test_memoryview_buffer_info, (b\"green\",), \"B\", b\"green\"),\n        (m.test_memoryview_from_buffer, (False,), \"h\", [3, 1, 4, 1, 5]),\n        (m.test_memoryview_from_buffer, (True,), \"H\", [2, 7, 1, 8]),\n        (m.test_memoryview_from_buffer_nativeformat, (), \"@i\", [4, 7, 5]),\n    ],\n)\ndef test_memoryview(method, args, fmt, expected_view):\n    view = method(*args)\n    assert isinstance(view, memoryview)\n    assert view.format == fmt\n    assert list(view) == list(expected_view)\n\n\n@pytest.mark.xfail(\"env.PYPY\", reason=\"getrefcount is not available\")\n@pytest.mark.parametrize(\n    \"method\",\n    [\n        m.test_memoryview_object,\n        m.test_memoryview_buffer_info,\n    ],\n)\ndef test_memoryview_refcount(method):\n    buf = b\"\\x0a\\x0b\\x0c\\x0d\"\n    ref_before = sys.getrefcount(buf)\n    view = method(buf)\n    ref_after = sys.getrefcount(buf)\n    assert ref_before < ref_after\n    assert list(view) == list(buf)\n\n\ndef test_memoryview_from_buffer_empty_shape():\n    view = m.test_memoryview_from_buffer_empty_shape()\n    assert isinstance(view, memoryview)\n    assert view.format == \"B\"\n    assert bytes(view) == b\"\"\n\n\ndef test_test_memoryview_from_buffer_invalid_strides():\n    with pytest.raises(RuntimeError):\n        m.test_memoryview_from_buffer_invalid_strides()\n\n\ndef test_test_memoryview_from_buffer_nullptr():\n    with pytest.raises(ValueError):\n        m.test_memoryview_from_buffer_nullptr()\n\n\ndef test_memoryview_from_memory():\n    view = m.test_memoryview_from_memory()\n    assert isinstance(view, memoryview)\n    assert view.format == \"B\"\n    assert bytes(view) == b\"\\xff\\xe1\\xab\\x37\"\n\n\ndef test_builtin_functions():\n    assert m.get_len([i for i in range(42)]) == 42\n    with pytest.raises(TypeError) as exc_info:\n        m.get_len(i for i in range(42))\n    assert str(exc_info.value) in [\n        \"object of type 'generator' has no len()\",\n        \"'generator' has no length\",\n    ]  # PyPy\n\n\ndef test_isinstance_string_types():\n    assert m.isinstance_pybind11_bytes(b\"\")\n    assert not m.isinstance_pybind11_bytes(\"\")\n\n    assert m.isinstance_pybind11_str(\"\")\n    if hasattr(m, \"PYBIND11_STR_LEGACY_PERMISSIVE\"):\n        assert m.isinstance_pybind11_str(b\"\")\n    else:\n        assert not m.isinstance_pybind11_str(b\"\")\n\n\ndef test_pass_bytes_or_unicode_to_string_types():\n    assert m.pass_to_pybind11_bytes(b\"Bytes\") == 5\n    with pytest.raises(TypeError):\n        m.pass_to_pybind11_bytes(\"Str\")\n\n    if hasattr(m, \"PYBIND11_STR_LEGACY_PERMISSIVE\"):\n        assert m.pass_to_pybind11_str(b\"Bytes\") == 5\n    else:\n        with pytest.raises(TypeError):\n            m.pass_to_pybind11_str(b\"Bytes\")\n    assert m.pass_to_pybind11_str(\"Str\") == 3\n\n    assert m.pass_to_std_string(b\"Bytes\") == 5\n    assert m.pass_to_std_string(\"Str\") == 3\n\n    malformed_utf8 = b\"\\x80\"\n    if hasattr(m, \"PYBIND11_STR_LEGACY_PERMISSIVE\"):\n        assert m.pass_to_pybind11_str(malformed_utf8) == 1\n    else:\n        with pytest.raises(TypeError):\n            m.pass_to_pybind11_str(malformed_utf8)\n\n\n@pytest.mark.parametrize(\n    \"create_weakref, create_weakref_with_callback\",\n    [\n        (m.weakref_from_handle, m.weakref_from_handle_and_function),\n        (m.weakref_from_object, m.weakref_from_object_and_function),\n    ],\n)\ndef test_weakref(create_weakref, create_weakref_with_callback):\n    from weakref import getweakrefcount\n\n    # Apparently, you cannot weakly reference an object()\n    class WeaklyReferenced:\n        pass\n\n    callback_called = False\n\n    def callback(wr):\n        nonlocal callback_called\n        callback_called = True\n\n    obj = WeaklyReferenced()\n    assert getweakrefcount(obj) == 0\n    wr = create_weakref(obj)\n    assert getweakrefcount(obj) == 1\n\n    obj = WeaklyReferenced()\n    assert getweakrefcount(obj) == 0\n    wr = create_weakref_with_callback(obj, callback)  # noqa: F841\n    assert getweakrefcount(obj) == 1\n    assert not callback_called\n    del obj\n    pytest.gc_collect()\n    assert callback_called\n\n\n@pytest.mark.parametrize(\n    \"create_weakref, has_callback\",\n    [\n        (m.weakref_from_handle, False),\n        (m.weakref_from_object, False),\n        (m.weakref_from_handle_and_function, True),\n        (m.weakref_from_object_and_function, True),\n    ],\n)\ndef test_weakref_err(create_weakref, has_callback):\n    class C:\n        __slots__ = []\n\n    def callback(_):\n        pass\n\n    ob = C()\n    # Should raise TypeError on CPython\n    with pytest.raises(TypeError) if not env.PYPY else contextlib.nullcontext():\n        if has_callback:\n            _ = create_weakref(ob, callback)\n        else:\n            _ = create_weakref(ob)\n\n\ndef test_cpp_iterators():\n    assert m.tuple_iterator() == 12\n    assert m.dict_iterator() == 305 + 711\n    assert m.passed_iterator(iter((-7, 3))) == -4\n\n\ndef test_implementation_details():\n    lst = [39, 43, 92, 49, 22, 29, 93, 98, 26, 57, 8]\n    tup = tuple(lst)\n    assert m.sequence_item_get_ssize_t(lst) == 43\n    assert m.sequence_item_set_ssize_t(lst) is None\n    assert lst[1] == \"peppa\"\n    assert m.sequence_item_get_size_t(lst) == 92\n    assert m.sequence_item_set_size_t(lst) is None\n    assert lst[2] == \"george\"\n    assert m.list_item_get_ssize_t(lst) == 49\n    assert m.list_item_set_ssize_t(lst) is None\n    assert lst[3] == \"rebecca\"\n    assert m.list_item_get_size_t(lst) == 22\n    assert m.list_item_set_size_t(lst) is None\n    assert lst[4] == \"richard\"\n    assert m.tuple_item_get_ssize_t(tup) == 29\n    assert m.tuple_item_set_ssize_t() == (\"emely\", \"edmond\")\n    assert m.tuple_item_get_size_t(tup) == 93\n    assert m.tuple_item_set_size_t() == (\"candy\", \"cat\")\n\n\ndef test_external_float_():\n    r1 = m.square_float_(2.0)\n    assert r1 == 4.0\n\n\ndef test_tuple_rvalue_getter():\n    pop = 1000\n    tup = tuple(range(pop))\n    m.tuple_rvalue_getter(tup)\n\n\ndef test_list_rvalue_getter():\n    pop = 1000\n    my_list = list(range(pop))\n    m.list_rvalue_getter(my_list)\n\n\ndef test_populate_dict_rvalue():\n    pop = 1000\n    my_dict = {i: i for i in range(pop)}\n    assert m.populate_dict_rvalue(pop) == my_dict\n\n\ndef test_populate_obj_str_attrs():\n    pop = 1000\n    o = types.SimpleNamespace(**{str(i): i for i in range(pop)})\n    new_o = m.populate_obj_str_attrs(o, pop)\n    new_attrs = {k: v for k, v in new_o.__dict__.items() if not k.startswith(\"_\")}\n    assert all(isinstance(v, str) for v in new_attrs.values())\n    assert len(new_attrs) == pop\n\n\n@pytest.mark.parametrize(\n    \"a,b\", [(\"foo\", \"bar\"), (1, 2), (1.0, 2.0), (list(range(3)), list(range(3, 6)))]\n)\ndef test_inplace_append(a, b):\n    expected = a + b\n    assert m.inplace_append(a, b) == expected\n\n\n@pytest.mark.parametrize(\"a,b\", [(3, 2), (3.0, 2.0), (set(range(3)), set(range(2)))])\ndef test_inplace_subtract(a, b):\n    expected = a - b\n    assert m.inplace_subtract(a, b) == expected\n\n\n@pytest.mark.parametrize(\"a,b\", [(3, 2), (3.0, 2.0), ([1], 3)])\ndef test_inplace_multiply(a, b):\n    expected = a * b\n    assert m.inplace_multiply(a, b) == expected\n\n\n@pytest.mark.parametrize(\"a,b\", [(6, 3), (6.0, 3.0)])\ndef test_inplace_divide(a, b):\n    expected = a / b\n    assert m.inplace_divide(a, b) == expected\n\n\n@pytest.mark.parametrize(\n    \"a,b\",\n    [\n        (False, True),\n        (\n            set(),\n            {\n                1,\n            },\n        ),\n    ],\n)\ndef test_inplace_or(a, b):\n    expected = a | b\n    assert m.inplace_or(a, b) == expected\n\n\n@pytest.mark.parametrize(\n    \"a,b\",\n    [\n        (True, False),\n        (\n            {1, 2, 3},\n            {\n                1,\n            },\n        ),\n    ],\n)\ndef test_inplace_and(a, b):\n    expected = a & b\n    assert m.inplace_and(a, b) == expected\n\n\n@pytest.mark.parametrize(\"a,b\", [(8, 1), (-3, 2)])\ndef test_inplace_lshift(a, b):\n    expected = a << b\n    assert m.inplace_lshift(a, b) == expected\n\n\n@pytest.mark.parametrize(\"a,b\", [(8, 1), (-2, 2)])\ndef test_inplace_rshift(a, b):\n    expected = a >> b\n    assert m.inplace_rshift(a, b) == expected\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_sequences_and_iterators.cpp",
    "content": "/*\n    tests/test_sequences_and_iterators.cpp -- supporting Pythons' sequence protocol, iterators,\n    etc.\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/operators.h>\n#include <pybind11/stl.h>\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\n#include <algorithm>\n#include <utility>\n#include <vector>\n\n#ifdef PYBIND11_HAS_OPTIONAL\n#    include <optional>\n#endif // PYBIND11_HAS_OPTIONAL\n\ntemplate <typename T>\nclass NonZeroIterator {\n    const T *ptr_;\n\npublic:\n    explicit NonZeroIterator(const T *ptr) : ptr_(ptr) {}\n    const T &operator*() const { return *ptr_; }\n    NonZeroIterator &operator++() {\n        ++ptr_;\n        return *this;\n    }\n};\n\nclass NonZeroSentinel {};\n\ntemplate <typename A, typename B>\nbool operator==(const NonZeroIterator<std::pair<A, B>> &it, const NonZeroSentinel &) {\n    return !(*it).first || !(*it).second;\n}\n\n/* Iterator where dereferencing returns prvalues instead of references. */\ntemplate <typename T>\nclass NonRefIterator {\n    const T *ptr_;\n\npublic:\n    explicit NonRefIterator(const T *ptr) : ptr_(ptr) {}\n    T operator*() const { return T(*ptr_); }\n    NonRefIterator &operator++() {\n        ++ptr_;\n        return *this;\n    }\n    bool operator==(const NonRefIterator &other) const { return ptr_ == other.ptr_; }\n};\n\nclass NonCopyableInt {\npublic:\n    explicit NonCopyableInt(int value) : value_(value) {}\n    NonCopyableInt(const NonCopyableInt &) = delete;\n    NonCopyableInt(NonCopyableInt &&other) noexcept : value_(other.value_) {\n        other.value_ = -1; // detect when an unwanted move occurs\n    }\n    NonCopyableInt &operator=(const NonCopyableInt &) = delete;\n    NonCopyableInt &operator=(NonCopyableInt &&other) noexcept {\n        value_ = other.value_;\n        other.value_ = -1; // detect when an unwanted move occurs\n        return *this;\n    }\n    int get() const { return value_; }\n    void set(int value) { value_ = value; }\n    ~NonCopyableInt() = default;\n\nprivate:\n    int value_;\n};\nusing NonCopyableIntPair = std::pair<NonCopyableInt, NonCopyableInt>;\nPYBIND11_MAKE_OPAQUE(std::vector<NonCopyableInt>);\nPYBIND11_MAKE_OPAQUE(std::vector<NonCopyableIntPair>);\n\ntemplate <typename PythonType>\npy::list test_random_access_iterator(PythonType x) {\n    if (x.size() < 5) {\n        throw py::value_error(\"Please provide at least 5 elements for testing.\");\n    }\n\n    auto checks = py::list();\n    auto assert_equal = [&checks](py::handle a, py::handle b) {\n        auto result = PyObject_RichCompareBool(a.ptr(), b.ptr(), Py_EQ);\n        if (result == -1) {\n            throw py::error_already_set();\n        }\n        checks.append(result != 0);\n    };\n\n    auto it = x.begin();\n    assert_equal(x[0], *it);\n    assert_equal(x[0], it[0]);\n    assert_equal(x[1], it[1]);\n\n    assert_equal(x[1], *(++it));\n    assert_equal(x[1], *(it++));\n    assert_equal(x[2], *it);\n    assert_equal(x[3], *(it += 1));\n    assert_equal(x[2], *(--it));\n    assert_equal(x[2], *(it--));\n    assert_equal(x[1], *it);\n    assert_equal(x[0], *(it -= 1));\n\n    assert_equal(it->attr(\"real\"), x[0].attr(\"real\"));\n    assert_equal((it + 1)->attr(\"real\"), x[1].attr(\"real\"));\n\n    assert_equal(x[1], *(it + 1));\n    assert_equal(x[1], *(1 + it));\n    it += 3;\n    assert_equal(x[1], *(it - 2));\n\n    checks.append(static_cast<std::size_t>(x.end() - x.begin()) == x.size());\n    checks.append((x.begin() + static_cast<std::ptrdiff_t>(x.size())) == x.end());\n    checks.append(x.begin() < x.end());\n\n    return checks;\n}\n\nTEST_SUBMODULE(sequences_and_iterators, m) {\n    // test_sliceable\n    class Sliceable {\n    public:\n        explicit Sliceable(int n) : size(n) {}\n        int start, stop, step;\n        int size;\n    };\n    py::class_<Sliceable>(m, \"Sliceable\")\n        .def(py::init<int>())\n        .def(\"__getitem__\", [](const Sliceable &s, const py::slice &slice) {\n            py::ssize_t start = 0, stop = 0, step = 0, slicelength = 0;\n            if (!slice.compute(s.size, &start, &stop, &step, &slicelength)) {\n                throw py::error_already_set();\n            }\n            int istart = static_cast<int>(start);\n            int istop = static_cast<int>(stop);\n            int istep = static_cast<int>(step);\n            return std::make_tuple(istart, istop, istep);\n        });\n\n    m.def(\"make_forward_slice_size_t\", []() { return py::slice(0, -1, 1); });\n    m.def(\"make_reversed_slice_object\",\n          []() { return py::slice(py::none(), py::none(), py::int_(-1)); });\n#ifdef PYBIND11_HAS_OPTIONAL\n    m.attr(\"has_optional\") = true;\n    m.def(\"make_reversed_slice_size_t_optional_verbose\",\n          []() { return py::slice(std::nullopt, std::nullopt, -1); });\n    // Warning: The following spelling may still compile if optional<> is not present and give\n    // wrong answers. Please use with caution.\n    m.def(\"make_reversed_slice_size_t_optional\", []() { return py::slice({}, {}, -1); });\n#else\n    m.attr(\"has_optional\") = false;\n#endif\n\n    // test_sequence\n    class Sequence {\n    public:\n        explicit Sequence(size_t size) : m_size(size) {\n            print_created(this, \"of size\", m_size);\n            // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n            m_data = new float[size];\n            memset(m_data, 0, sizeof(float) * size);\n        }\n        explicit Sequence(const std::vector<float> &value) : m_size(value.size()) {\n            print_created(this, \"of size\", m_size, \"from std::vector\");\n            // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n            m_data = new float[m_size];\n            memcpy(m_data, &value[0], sizeof(float) * m_size);\n        }\n        Sequence(const Sequence &s) : m_size(s.m_size) {\n            print_copy_created(this);\n            // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)\n            m_data = new float[m_size];\n            memcpy(m_data, s.m_data, sizeof(float) * m_size);\n        }\n        Sequence(Sequence &&s) noexcept : m_size(s.m_size), m_data(s.m_data) {\n            print_move_created(this);\n            s.m_size = 0;\n            s.m_data = nullptr;\n        }\n\n        ~Sequence() {\n            print_destroyed(this);\n            delete[] m_data;\n        }\n\n        Sequence &operator=(const Sequence &s) {\n            if (&s != this) {\n                delete[] m_data;\n                m_size = s.m_size;\n                m_data = new float[m_size];\n                memcpy(m_data, s.m_data, sizeof(float) * m_size);\n            }\n            print_copy_assigned(this);\n            return *this;\n        }\n\n        Sequence &operator=(Sequence &&s) noexcept {\n            if (&s != this) {\n                delete[] m_data;\n                m_size = s.m_size;\n                m_data = s.m_data;\n                s.m_size = 0;\n                s.m_data = nullptr;\n            }\n            print_move_assigned(this);\n            return *this;\n        }\n\n        bool operator==(const Sequence &s) const {\n            if (m_size != s.size()) {\n                return false;\n            }\n            for (size_t i = 0; i < m_size; ++i) {\n                if (m_data[i] != s[i]) {\n                    return false;\n                }\n            }\n            return true;\n        }\n        bool operator!=(const Sequence &s) const { return !operator==(s); }\n\n        float operator[](size_t index) const { return m_data[index]; }\n        float &operator[](size_t index) { return m_data[index]; }\n\n        bool contains(float v) const {\n            for (size_t i = 0; i < m_size; ++i) {\n                if (v == m_data[i]) {\n                    return true;\n                }\n            }\n            return false;\n        }\n\n        Sequence reversed() const {\n            Sequence result(m_size);\n            for (size_t i = 0; i < m_size; ++i) {\n                result[m_size - i - 1] = m_data[i];\n            }\n            return result;\n        }\n\n        size_t size() const { return m_size; }\n\n        const float *begin() const { return m_data; }\n        const float *end() const { return m_data + m_size; }\n\n    private:\n        size_t m_size;\n        float *m_data;\n    };\n    py::class_<Sequence>(m, \"Sequence\")\n        .def(py::init<size_t>())\n        .def(py::init<const std::vector<float> &>())\n        /// Bare bones interface\n        .def(\"__getitem__\",\n             [](const Sequence &s, size_t i) {\n                 if (i >= s.size()) {\n                     throw py::index_error();\n                 }\n                 return s[i];\n             })\n        .def(\"__setitem__\",\n             [](Sequence &s, size_t i, float v) {\n                 if (i >= s.size()) {\n                     throw py::index_error();\n                 }\n                 s[i] = v;\n             })\n        .def(\"__len__\", &Sequence::size)\n        /// Optional sequence protocol operations\n        .def(\n            \"__iter__\",\n            [](const Sequence &s) { return py::make_iterator(s.begin(), s.end()); },\n            py::keep_alive<0, 1>() /* Essential: keep object alive while iterator exists */)\n        .def(\"__contains__\", [](const Sequence &s, float v) { return s.contains(v); })\n        .def(\"__reversed__\", [](const Sequence &s) -> Sequence { return s.reversed(); })\n        /// Slicing protocol (optional)\n        .def(\"__getitem__\",\n             [](const Sequence &s, const py::slice &slice) -> Sequence * {\n                 size_t start = 0, stop = 0, step = 0, slicelength = 0;\n                 if (!slice.compute(s.size(), &start, &stop, &step, &slicelength)) {\n                     throw py::error_already_set();\n                 }\n                 auto *seq = new Sequence(slicelength);\n                 for (size_t i = 0; i < slicelength; ++i) {\n                     (*seq)[i] = s[start];\n                     start += step;\n                 }\n                 return seq;\n             })\n        .def(\"__setitem__\",\n             [](Sequence &s, const py::slice &slice, const Sequence &value) {\n                 size_t start = 0, stop = 0, step = 0, slicelength = 0;\n                 if (!slice.compute(s.size(), &start, &stop, &step, &slicelength)) {\n                     throw py::error_already_set();\n                 }\n                 if (slicelength != value.size()) {\n                     throw std::runtime_error(\n                         \"Left and right hand size of slice assignment have different sizes!\");\n                 }\n                 for (size_t i = 0; i < slicelength; ++i) {\n                     s[start] = value[i];\n                     start += step;\n                 }\n             })\n        /// Comparisons\n        .def(py::self == py::self)\n        .def(py::self != py::self)\n        // Could also define py::self + py::self for concatenation, etc.\n        ;\n\n    // test_map_iterator\n    // Interface of a map-like object that isn't (directly) an unordered_map, but provides some\n    // basic map-like functionality.\n    class StringMap {\n    public:\n        StringMap() = default;\n        explicit StringMap(std::unordered_map<std::string, std::string> init)\n            : map(std::move(init)) {}\n\n        void set(const std::string &key, std::string val) { map[key] = std::move(val); }\n        std::string get(const std::string &key) const { return map.at(key); }\n        size_t size() const { return map.size(); }\n\n    private:\n        std::unordered_map<std::string, std::string> map;\n\n    public:\n        decltype(map.cbegin()) begin() const { return map.cbegin(); }\n        decltype(map.cend()) end() const { return map.cend(); }\n    };\n    py::class_<StringMap>(m, \"StringMap\")\n        .def(py::init<>())\n        .def(py::init<std::unordered_map<std::string, std::string>>())\n        .def(\"__getitem__\",\n             [](const StringMap &map, const std::string &key) {\n                 try {\n                     return map.get(key);\n                 } catch (const std::out_of_range &) {\n                     throw py::key_error(\"key '\" + key + \"' does not exist\");\n                 }\n             })\n        .def(\"__setitem__\", &StringMap::set)\n        .def(\"__len__\", &StringMap::size)\n        .def(\n            \"__iter__\",\n            [](const StringMap &map) { return py::make_key_iterator(map.begin(), map.end()); },\n            py::keep_alive<0, 1>())\n        .def(\n            \"items\",\n            [](const StringMap &map) { return py::make_iterator(map.begin(), map.end()); },\n            py::keep_alive<0, 1>())\n        .def(\n            \"values\",\n            [](const StringMap &map) { return py::make_value_iterator(map.begin(), map.end()); },\n            py::keep_alive<0, 1>());\n\n    // test_generalized_iterators\n    class IntPairs {\n    public:\n        explicit IntPairs(std::vector<std::pair<int, int>> data) : data_(std::move(data)) {}\n        const std::pair<int, int> *begin() const { return data_.data(); }\n        // .end() only required for py::make_iterator(self) overload\n        const std::pair<int, int> *end() const { return data_.data() + data_.size(); }\n\n    private:\n        std::vector<std::pair<int, int>> data_;\n    };\n    py::class_<IntPairs>(m, \"IntPairs\")\n        .def(py::init<std::vector<std::pair<int, int>>>())\n        .def(\n            \"nonzero\",\n            [](const IntPairs &s) {\n                return py::make_iterator(NonZeroIterator<std::pair<int, int>>(s.begin()),\n                                         NonZeroSentinel());\n            },\n            py::keep_alive<0, 1>())\n        .def(\n            \"nonzero_keys\",\n            [](const IntPairs &s) {\n                return py::make_key_iterator(NonZeroIterator<std::pair<int, int>>(s.begin()),\n                                             NonZeroSentinel());\n            },\n            py::keep_alive<0, 1>())\n        .def(\n            \"nonzero_values\",\n            [](const IntPairs &s) {\n                return py::make_value_iterator(NonZeroIterator<std::pair<int, int>>(s.begin()),\n                                               NonZeroSentinel());\n            },\n            py::keep_alive<0, 1>())\n\n        // test iterator that returns values instead of references\n        .def(\n            \"nonref\",\n            [](const IntPairs &s) {\n                return py::make_iterator(NonRefIterator<std::pair<int, int>>(s.begin()),\n                                         NonRefIterator<std::pair<int, int>>(s.end()));\n            },\n            py::keep_alive<0, 1>())\n        .def(\n            \"nonref_keys\",\n            [](const IntPairs &s) {\n                return py::make_key_iterator(NonRefIterator<std::pair<int, int>>(s.begin()),\n                                             NonRefIterator<std::pair<int, int>>(s.end()));\n            },\n            py::keep_alive<0, 1>())\n        .def(\n            \"nonref_values\",\n            [](const IntPairs &s) {\n                return py::make_value_iterator(NonRefIterator<std::pair<int, int>>(s.begin()),\n                                               NonRefIterator<std::pair<int, int>>(s.end()));\n            },\n            py::keep_alive<0, 1>())\n\n        // test single-argument make_iterator\n        .def(\n            \"simple_iterator\",\n            [](IntPairs &self) { return py::make_iterator(self); },\n            py::keep_alive<0, 1>())\n        .def(\n            \"simple_keys\",\n            [](IntPairs &self) { return py::make_key_iterator(self); },\n            py::keep_alive<0, 1>())\n        .def(\n            \"simple_values\",\n            [](IntPairs &self) { return py::make_value_iterator(self); },\n            py::keep_alive<0, 1>())\n\n        // Test iterator with an Extra (doesn't do anything useful, so not used\n        // at runtime, but tests need to be able to compile with the correct\n        // overload. See PR #3293.\n        .def(\n            \"_make_iterator_extras\",\n            [](IntPairs &self) { return py::make_iterator(self, py::call_guard<int>()); },\n            py::keep_alive<0, 1>())\n        .def(\n            \"_make_key_extras\",\n            [](IntPairs &self) { return py::make_key_iterator(self, py::call_guard<int>()); },\n            py::keep_alive<0, 1>())\n        .def(\n            \"_make_value_extras\",\n            [](IntPairs &self) { return py::make_value_iterator(self, py::call_guard<int>()); },\n            py::keep_alive<0, 1>());\n\n    // test_iterator_referencing\n    py::class_<NonCopyableInt>(m, \"NonCopyableInt\")\n        .def(py::init<int>())\n        .def(\"set\", &NonCopyableInt::set)\n        .def(\"__int__\", &NonCopyableInt::get);\n    py::class_<std::vector<NonCopyableInt>>(m, \"VectorNonCopyableInt\")\n        .def(py::init<>())\n        .def(\"append\",\n             [](std::vector<NonCopyableInt> &vec, int value) { vec.emplace_back(value); })\n        .def(\"__iter__\", [](std::vector<NonCopyableInt> &vec) {\n            return py::make_iterator(vec.begin(), vec.end());\n        });\n    py::class_<std::vector<NonCopyableIntPair>>(m, \"VectorNonCopyableIntPair\")\n        .def(py::init<>())\n        .def(\"append\",\n             [](std::vector<NonCopyableIntPair> &vec, const std::pair<int, int> &value) {\n                 vec.emplace_back(NonCopyableInt(value.first), NonCopyableInt(value.second));\n             })\n        .def(\"keys\",\n             [](std::vector<NonCopyableIntPair> &vec) {\n                 return py::make_key_iterator(vec.begin(), vec.end());\n             })\n        .def(\"values\", [](std::vector<NonCopyableIntPair> &vec) {\n            return py::make_value_iterator(vec.begin(), vec.end());\n        });\n\n#if 0\n    // Obsolete: special data structure for exposing custom iterator types to python\n    // kept here for illustrative purposes because there might be some use cases which\n    // are not covered by the much simpler py::make_iterator\n\n    struct PySequenceIterator {\n        PySequenceIterator(const Sequence &seq, py::object ref) : seq(seq), ref(ref) { }\n\n        float next() {\n            if (index == seq.size())\n                throw py::stop_iteration();\n            return seq[index++];\n        }\n\n        const Sequence &seq;\n        py::object ref; // keep a reference\n        size_t index = 0;\n    };\n\n    py::class_<PySequenceIterator>(seq, \"Iterator\")\n        .def(\"__iter__\", [](PySequenceIterator &it) -> PySequenceIterator& { return it; })\n        .def(\"__next__\", &PySequenceIterator::next);\n\n    On the actual Sequence object, the iterator would be constructed as follows:\n    .def(\"__iter__\", [](py::object s) { return PySequenceIterator(s.cast<const Sequence &>(), s); })\n#endif\n\n    // test_python_iterator_in_cpp\n    m.def(\"object_to_list\", [](const py::object &o) {\n        auto l = py::list();\n        for (auto item : o) {\n            l.append(item);\n        }\n        return l;\n    });\n\n    m.def(\"iterator_to_list\", [](py::iterator it) {\n        auto l = py::list();\n        while (it != py::iterator::sentinel()) {\n            l.append(*it);\n            ++it;\n        }\n        return l;\n    });\n\n    // test_sequence_length: check that Python sequences can be converted to py::sequence.\n    m.def(\"sequence_length\", [](const py::sequence &seq) { return seq.size(); });\n\n    // Make sure that py::iterator works with std algorithms\n    m.def(\"count_none\", [](const py::object &o) {\n        return std::count_if(o.begin(), o.end(), [](py::handle h) { return h.is_none(); });\n    });\n\n    m.def(\"find_none\", [](const py::object &o) {\n        auto it = std::find_if(o.begin(), o.end(), [](py::handle h) { return h.is_none(); });\n        return it->is_none();\n    });\n\n    m.def(\"count_nonzeros\", [](const py::dict &d) {\n        return std::count_if(d.begin(), d.end(), [](std::pair<py::handle, py::handle> p) {\n            return p.second.cast<int>() != 0;\n        });\n    });\n\n    m.def(\"tuple_iterator\", &test_random_access_iterator<py::tuple>);\n    m.def(\"list_iterator\", &test_random_access_iterator<py::list>);\n    m.def(\"sequence_iterator\", &test_random_access_iterator<py::sequence>);\n\n    // test_iterator_passthrough\n    // #181: iterator passthrough did not compile\n    m.def(\"iterator_passthrough\", [](py::iterator s) -> py::iterator {\n        return py::make_iterator(std::begin(s), std::end(s));\n    });\n\n    // test_iterator_rvp\n    // #388: Can't make iterators via make_iterator() with different r/v policies\n    static std::vector<int> list = {1, 2, 3};\n    m.def(\"make_iterator_1\",\n          []() { return py::make_iterator<py::return_value_policy::copy>(list); });\n    m.def(\"make_iterator_2\",\n          []() { return py::make_iterator<py::return_value_policy::automatic>(list); });\n\n    // test_iterator on c arrays\n    // #4100: ensure lvalue required as increment operand\n    class CArrayHolder {\n    public:\n        CArrayHolder(double x, double y, double z) {\n            values[0] = x;\n            values[1] = y;\n            values[2] = z;\n        };\n        double values[3];\n    };\n\n    py::class_<CArrayHolder>(m, \"CArrayHolder\")\n        .def(py::init<double, double, double>())\n        .def(\n            \"__iter__\",\n            [](const CArrayHolder &v) { return py::make_iterator(v.values, v.values + 3); },\n            py::keep_alive<0, 1>());\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_sequences_and_iterators.py",
    "content": "import pytest\nfrom pytest import approx\n\nfrom pybind11_tests import ConstructorStats\nfrom pybind11_tests import sequences_and_iterators as m\n\n\ndef test_slice_constructors():\n    assert m.make_forward_slice_size_t() == slice(0, -1, 1)\n    assert m.make_reversed_slice_object() == slice(None, None, -1)\n\n\n@pytest.mark.skipif(not m.has_optional, reason=\"no <optional>\")\ndef test_slice_constructors_explicit_optional():\n    assert m.make_reversed_slice_size_t_optional() == slice(None, None, -1)\n    assert m.make_reversed_slice_size_t_optional_verbose() == slice(None, None, -1)\n\n\ndef test_generalized_iterators():\n    assert list(m.IntPairs([(1, 2), (3, 4), (0, 5)]).nonzero()) == [(1, 2), (3, 4)]\n    assert list(m.IntPairs([(1, 2), (2, 0), (0, 3), (4, 5)]).nonzero()) == [(1, 2)]\n    assert list(m.IntPairs([(0, 3), (1, 2), (3, 4)]).nonzero()) == []\n\n    assert list(m.IntPairs([(1, 2), (3, 4), (0, 5)]).nonzero_keys()) == [1, 3]\n    assert list(m.IntPairs([(1, 2), (2, 0), (0, 3), (4, 5)]).nonzero_keys()) == [1]\n    assert list(m.IntPairs([(0, 3), (1, 2), (3, 4)]).nonzero_keys()) == []\n\n    assert list(m.IntPairs([(1, 2), (3, 4), (0, 5)]).nonzero_values()) == [2, 4]\n    assert list(m.IntPairs([(1, 2), (2, 0), (0, 3), (4, 5)]).nonzero_values()) == [2]\n    assert list(m.IntPairs([(0, 3), (1, 2), (3, 4)]).nonzero_values()) == []\n\n    # __next__ must continue to raise StopIteration\n    it = m.IntPairs([(0, 0)]).nonzero()\n    for _ in range(3):\n        with pytest.raises(StopIteration):\n            next(it)\n\n    it = m.IntPairs([(0, 0)]).nonzero_keys()\n    for _ in range(3):\n        with pytest.raises(StopIteration):\n            next(it)\n\n\ndef test_nonref_iterators():\n    pairs = m.IntPairs([(1, 2), (3, 4), (0, 5)])\n    assert list(pairs.nonref()) == [(1, 2), (3, 4), (0, 5)]\n    assert list(pairs.nonref_keys()) == [1, 3, 0]\n    assert list(pairs.nonref_values()) == [2, 4, 5]\n\n\ndef test_generalized_iterators_simple():\n    assert list(m.IntPairs([(1, 2), (3, 4), (0, 5)]).simple_iterator()) == [\n        (1, 2),\n        (3, 4),\n        (0, 5),\n    ]\n    assert list(m.IntPairs([(1, 2), (3, 4), (0, 5)]).simple_keys()) == [1, 3, 0]\n    assert list(m.IntPairs([(1, 2), (3, 4), (0, 5)]).simple_values()) == [2, 4, 5]\n\n\ndef test_iterator_referencing():\n    \"\"\"Test that iterators reference rather than copy their referents.\"\"\"\n    vec = m.VectorNonCopyableInt()\n    vec.append(3)\n    vec.append(5)\n    assert [int(x) for x in vec] == [3, 5]\n    # Increment everything to make sure the referents can be mutated\n    for x in vec:\n        x.set(int(x) + 1)\n    assert [int(x) for x in vec] == [4, 6]\n\n    vec = m.VectorNonCopyableIntPair()\n    vec.append([3, 4])\n    vec.append([5, 7])\n    assert [int(x) for x in vec.keys()] == [3, 5]\n    assert [int(x) for x in vec.values()] == [4, 7]\n    for x in vec.keys():\n        x.set(int(x) + 1)\n    for x in vec.values():\n        x.set(int(x) + 10)\n    assert [int(x) for x in vec.keys()] == [4, 6]\n    assert [int(x) for x in vec.values()] == [14, 17]\n\n\ndef test_sliceable():\n    sliceable = m.Sliceable(100)\n    assert sliceable[::] == (0, 100, 1)\n    assert sliceable[10::] == (10, 100, 1)\n    assert sliceable[:10:] == (0, 10, 1)\n    assert sliceable[::10] == (0, 100, 10)\n    assert sliceable[-10::] == (90, 100, 1)\n    assert sliceable[:-10:] == (0, 90, 1)\n    assert sliceable[::-10] == (99, -1, -10)\n    assert sliceable[50:60:1] == (50, 60, 1)\n    assert sliceable[50:60:-1] == (50, 60, -1)\n\n\ndef test_sequence():\n    cstats = ConstructorStats.get(m.Sequence)\n\n    s = m.Sequence(5)\n    assert cstats.values() == [\"of size\", \"5\"]\n\n    assert \"Sequence\" in repr(s)\n    assert len(s) == 5\n    assert s[0] == 0 and s[3] == 0\n    assert 12.34 not in s\n    s[0], s[3] = 12.34, 56.78\n    assert 12.34 in s\n    assert s[0] == approx(12.34, rel=1e-05)\n    assert s[3] == approx(56.78, rel=1e-05)\n\n    rev = reversed(s)\n    assert cstats.values() == [\"of size\", \"5\"]\n\n    rev2 = s[::-1]\n    assert cstats.values() == [\"of size\", \"5\"]\n\n    it = iter(m.Sequence(0))\n    for _ in range(3):  # __next__ must continue to raise StopIteration\n        with pytest.raises(StopIteration):\n            next(it)\n    assert cstats.values() == [\"of size\", \"0\"]\n\n    expected = [0, 56.78, 0, 0, 12.34]\n    assert rev == approx(expected, rel=1e-05)\n    assert rev2 == approx(expected, rel=1e-05)\n    assert rev == rev2\n\n    rev[0::2] = m.Sequence([2.0, 2.0, 2.0])\n    assert cstats.values() == [\"of size\", \"3\", \"from std::vector\"]\n\n    assert rev == approx([2, 56.78, 2, 0, 2], rel=1e-05)\n\n    assert cstats.alive() == 4\n    del it\n    assert cstats.alive() == 3\n    del s\n    assert cstats.alive() == 2\n    del rev\n    assert cstats.alive() == 1\n    del rev2\n    assert cstats.alive() == 0\n\n    assert cstats.values() == []\n    assert cstats.default_constructions == 0\n    assert cstats.copy_constructions == 0\n    assert cstats.move_constructions >= 1\n    assert cstats.copy_assignments == 0\n    assert cstats.move_assignments == 0\n\n\ndef test_sequence_length():\n    \"\"\"#2076: Exception raised by len(arg) should be propagated\"\"\"\n\n    class BadLen(RuntimeError):\n        pass\n\n    class SequenceLike:\n        def __getitem__(self, i):\n            return None\n\n        def __len__(self):\n            raise BadLen()\n\n    with pytest.raises(BadLen):\n        m.sequence_length(SequenceLike())\n\n    assert m.sequence_length([1, 2, 3]) == 3\n    assert m.sequence_length(\"hello\") == 5\n\n\ndef test_map_iterator():\n    sm = m.StringMap({\"hi\": \"bye\", \"black\": \"white\"})\n    assert sm[\"hi\"] == \"bye\"\n    assert len(sm) == 2\n    assert sm[\"black\"] == \"white\"\n\n    with pytest.raises(KeyError):\n        assert sm[\"orange\"]\n    sm[\"orange\"] = \"banana\"\n    assert sm[\"orange\"] == \"banana\"\n\n    expected = {\"hi\": \"bye\", \"black\": \"white\", \"orange\": \"banana\"}\n    for k in sm:\n        assert sm[k] == expected[k]\n    for k, v in sm.items():\n        assert v == expected[k]\n    assert list(sm.values()) == [expected[k] for k in sm]\n\n    it = iter(m.StringMap({}))\n    for _ in range(3):  # __next__ must continue to raise StopIteration\n        with pytest.raises(StopIteration):\n            next(it)\n\n\ndef test_python_iterator_in_cpp():\n    t = (1, 2, 3)\n    assert m.object_to_list(t) == [1, 2, 3]\n    assert m.object_to_list(iter(t)) == [1, 2, 3]\n    assert m.iterator_to_list(iter(t)) == [1, 2, 3]\n\n    with pytest.raises(TypeError) as excinfo:\n        m.object_to_list(1)\n    assert \"object is not iterable\" in str(excinfo.value)\n\n    with pytest.raises(TypeError) as excinfo:\n        m.iterator_to_list(1)\n    assert \"incompatible function arguments\" in str(excinfo.value)\n\n    def bad_next_call():\n        raise RuntimeError(\"py::iterator::advance() should propagate errors\")\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.iterator_to_list(iter(bad_next_call, None))\n    assert str(excinfo.value) == \"py::iterator::advance() should propagate errors\"\n\n    lst = [1, None, 0, None]\n    assert m.count_none(lst) == 2\n    assert m.find_none(lst) is True\n    assert m.count_nonzeros({\"a\": 0, \"b\": 1, \"c\": 2}) == 2\n\n    r = range(5)\n    assert all(m.tuple_iterator(tuple(r)))\n    assert all(m.list_iterator(list(r)))\n    assert all(m.sequence_iterator(r))\n\n\ndef test_iterator_passthrough():\n    \"\"\"#181: iterator passthrough did not compile\"\"\"\n    from pybind11_tests.sequences_and_iterators import iterator_passthrough\n\n    values = [3, 5, 7, 9, 11, 13, 15]\n    assert list(iterator_passthrough(iter(values))) == values\n\n\ndef test_iterator_rvp():\n    \"\"\"#388: Can't make iterators via make_iterator() with different r/v policies\"\"\"\n    import pybind11_tests.sequences_and_iterators as m\n\n    assert list(m.make_iterator_1()) == [1, 2, 3]\n    assert list(m.make_iterator_2()) == [1, 2, 3]\n    assert not isinstance(m.make_iterator_1(), type(m.make_iterator_2()))\n\n\ndef test_carray_iterator():\n    \"\"\"#4100: Check for proper iterator overload with C-Arrays\"\"\"\n    args_gt = list(float(i) for i in range(3))\n    arr_h = m.CArrayHolder(*args_gt)\n    args = list(arr_h)\n    assert args_gt == args\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_smart_ptr.cpp",
    "content": "/*\n    tests/test_smart_ptr.cpp -- binding classes with custom reference counting,\n    implicit conversions between types\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"object.h\"\n#include \"pybind11_tests.h\"\n\nnamespace {\n\n// This is just a wrapper around unique_ptr, but with extra fields to deliberately bloat up the\n// holder size to trigger the non-simple-layout internal instance layout for single inheritance\n// with large holder type:\ntemplate <typename T>\nclass huge_unique_ptr {\n    std::unique_ptr<T> ptr;\n    uint64_t padding[10];\n\npublic:\n    explicit huge_unique_ptr(T *p) : ptr(p) {}\n    T *get() { return ptr.get(); }\n};\n\n// Simple custom holder that works like unique_ptr\ntemplate <typename T>\nclass custom_unique_ptr {\n    std::unique_ptr<T> impl;\n\npublic:\n    explicit custom_unique_ptr(T *p) : impl(p) {}\n    T *get() const { return impl.get(); }\n    T *release_ptr() { return impl.release(); }\n};\n\n// Simple custom holder that works like shared_ptr and has operator& overload\n// To obtain address of an instance of this holder pybind should use std::addressof\n// Attempt to get address via operator& may leads to segmentation fault\ntemplate <typename T>\nclass shared_ptr_with_addressof_operator {\n    std::shared_ptr<T> impl;\n\npublic:\n    shared_ptr_with_addressof_operator() = default;\n    explicit shared_ptr_with_addressof_operator(T *p) : impl(p) {}\n    T *get() const { return impl.get(); }\n    T **operator&() { throw std::logic_error(\"Call of overloaded operator& is not expected\"); }\n};\n\n// Simple custom holder that works like unique_ptr and has operator& overload\n// To obtain address of an instance of this holder pybind should use std::addressof\n// Attempt to get address via operator& may leads to segmentation fault\ntemplate <typename T>\nclass unique_ptr_with_addressof_operator {\n    std::unique_ptr<T> impl;\n\npublic:\n    unique_ptr_with_addressof_operator() = default;\n    explicit unique_ptr_with_addressof_operator(T *p) : impl(p) {}\n    T *get() const { return impl.get(); }\n    T *release_ptr() { return impl.release(); }\n    T **operator&() { throw std::logic_error(\"Call of overloaded operator& is not expected\"); }\n};\n\n// Custom object with builtin reference counting (see 'object.h' for the implementation)\nclass MyObject1 : public Object {\npublic:\n    explicit MyObject1(int value) : value(value) { print_created(this, toString()); }\n    std::string toString() const override { return \"MyObject1[\" + std::to_string(value) + \"]\"; }\n\nprotected:\n    ~MyObject1() override { print_destroyed(this); }\n\nprivate:\n    int value;\n};\n\n// Object managed by a std::shared_ptr<>\nclass MyObject2 {\npublic:\n    MyObject2(const MyObject2 &) = default;\n    explicit MyObject2(int value) : value(value) { print_created(this, toString()); }\n    std::string toString() const { return \"MyObject2[\" + std::to_string(value) + \"]\"; }\n    virtual ~MyObject2() { print_destroyed(this); }\n\nprivate:\n    int value;\n};\n\n// Object managed by a std::shared_ptr<>, additionally derives from std::enable_shared_from_this<>\nclass MyObject3 : public std::enable_shared_from_this<MyObject3> {\npublic:\n    MyObject3(const MyObject3 &) = default;\n    explicit MyObject3(int value) : value(value) { print_created(this, toString()); }\n    std::string toString() const { return \"MyObject3[\" + std::to_string(value) + \"]\"; }\n    virtual ~MyObject3() { print_destroyed(this); }\n\nprivate:\n    int value;\n};\n\n// test_unique_nodelete\n// Object with a private destructor\nclass MyObject4;\nstd::unordered_set<MyObject4 *> myobject4_instances;\nclass MyObject4 {\npublic:\n    explicit MyObject4(int value) : value{value} {\n        print_created(this);\n        myobject4_instances.insert(this);\n    }\n    int value;\n\n    static void cleanupAllInstances() {\n        auto tmp = std::move(myobject4_instances);\n        myobject4_instances.clear();\n        for (auto *o : tmp) {\n            delete o;\n        }\n    }\n\nprivate:\n    ~MyObject4() {\n        myobject4_instances.erase(this);\n        print_destroyed(this);\n    }\n};\n\n// test_unique_deleter\n// Object with std::unique_ptr<T, D> where D is not matching the base class\n// Object with a protected destructor\nclass MyObject4a;\nstd::unordered_set<MyObject4a *> myobject4a_instances;\nclass MyObject4a {\npublic:\n    explicit MyObject4a(int i) : value{i} {\n        print_created(this);\n        myobject4a_instances.insert(this);\n    };\n    int value;\n\n    static void cleanupAllInstances() {\n        auto tmp = std::move(myobject4a_instances);\n        myobject4a_instances.clear();\n        for (auto *o : tmp) {\n            delete o;\n        }\n    }\n\nprotected:\n    virtual ~MyObject4a() {\n        myobject4a_instances.erase(this);\n        print_destroyed(this);\n    }\n};\n\n// Object derived but with public destructor and no Deleter in default holder\nclass MyObject4b : public MyObject4a {\npublic:\n    explicit MyObject4b(int i) : MyObject4a(i) { print_created(this); }\n    ~MyObject4b() override { print_destroyed(this); }\n};\n\n// test_large_holder\nclass MyObject5 { // managed by huge_unique_ptr\npublic:\n    explicit MyObject5(int value) : value{value} { print_created(this); }\n    ~MyObject5() { print_destroyed(this); }\n    int value;\n};\n\n// test_shared_ptr_and_references\nstruct SharedPtrRef {\n    struct A {\n        A() { print_created(this); }\n        A(const A &) { print_copy_created(this); }\n        A(A &&) noexcept { print_move_created(this); }\n        ~A() { print_destroyed(this); }\n    };\n\n    A value = {};\n    std::shared_ptr<A> shared = std::make_shared<A>();\n};\n\n// test_shared_ptr_from_this_and_references\nstruct SharedFromThisRef {\n    struct B : std::enable_shared_from_this<B> {\n        B() { print_created(this); }\n        // NOLINTNEXTLINE(bugprone-copy-constructor-init)\n        B(const B &) : std::enable_shared_from_this<B>() { print_copy_created(this); }\n        B(B &&) noexcept : std::enable_shared_from_this<B>() { print_move_created(this); }\n        ~B() { print_destroyed(this); }\n    };\n\n    B value = {};\n    std::shared_ptr<B> shared = std::make_shared<B>();\n};\n\n// Issue #865: shared_from_this doesn't work with virtual inheritance\nstruct SharedFromThisVBase : std::enable_shared_from_this<SharedFromThisVBase> {\n    SharedFromThisVBase() = default;\n    SharedFromThisVBase(const SharedFromThisVBase &) = default;\n    virtual ~SharedFromThisVBase() = default;\n};\nstruct SharedFromThisVirt : virtual SharedFromThisVBase {};\n\n// test_move_only_holder\nstruct C {\n    C() { print_created(this); }\n    ~C() { print_destroyed(this); }\n};\n\n// test_holder_with_addressof_operator\nstruct TypeForHolderWithAddressOf {\n    TypeForHolderWithAddressOf() { print_created(this); }\n    TypeForHolderWithAddressOf(const TypeForHolderWithAddressOf &) { print_copy_created(this); }\n    TypeForHolderWithAddressOf(TypeForHolderWithAddressOf &&) noexcept {\n        print_move_created(this);\n    }\n    ~TypeForHolderWithAddressOf() { print_destroyed(this); }\n    std::string toString() const {\n        return \"TypeForHolderWithAddressOf[\" + std::to_string(value) + \"]\";\n    }\n    int value = 42;\n};\n\n// test_move_only_holder_with_addressof_operator\nstruct TypeForMoveOnlyHolderWithAddressOf {\n    explicit TypeForMoveOnlyHolderWithAddressOf(int value) : value{value} { print_created(this); }\n    ~TypeForMoveOnlyHolderWithAddressOf() { print_destroyed(this); }\n    std::string toString() const {\n        return \"MoveOnlyHolderWithAddressOf[\" + std::to_string(value) + \"]\";\n    }\n    int value;\n};\n\n// test_smart_ptr_from_default\nstruct HeldByDefaultHolder {};\n\n// test_shared_ptr_gc\n// #187: issue involving std::shared_ptr<> return value policy & garbage collection\nstruct ElementBase {\n    virtual ~ElementBase() = default; /* Force creation of virtual table */\n    ElementBase() = default;\n    ElementBase(const ElementBase &) = delete;\n};\n\nstruct ElementA : ElementBase {\n    explicit ElementA(int v) : v(v) {}\n    int value() const { return v; }\n    int v;\n};\n\nstruct ElementList {\n    void add(const std::shared_ptr<ElementBase> &e) { l.push_back(e); }\n    std::vector<std::shared_ptr<ElementBase>> l;\n};\n\n} // namespace\n\n// ref<T> is a wrapper for 'Object' which uses intrusive reference counting\n// It is always possible to construct a ref<T> from an Object* pointer without\n// possible inconsistencies, hence the 'true' argument at the end.\n// Make pybind11 aware of the non-standard getter member function\nnamespace PYBIND11_NAMESPACE {\nnamespace detail {\ntemplate <typename T>\nstruct holder_helper<ref<T>> {\n    static const T *get(const ref<T> &p) { return p.get_ptr(); }\n};\n} // namespace detail\n} // namespace PYBIND11_NAMESPACE\n\n// Make pybind aware of the ref-counted wrapper type (s):\nPYBIND11_DECLARE_HOLDER_TYPE(T, ref<T>, true);\n// The following is not required anymore for std::shared_ptr, but it should compile without error:\nPYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>);\nPYBIND11_DECLARE_HOLDER_TYPE(T, huge_unique_ptr<T>);\nPYBIND11_DECLARE_HOLDER_TYPE(T, custom_unique_ptr<T>);\nPYBIND11_DECLARE_HOLDER_TYPE(T, shared_ptr_with_addressof_operator<T>);\nPYBIND11_DECLARE_HOLDER_TYPE(T, unique_ptr_with_addressof_operator<T>);\n\nTEST_SUBMODULE(smart_ptr, m) {\n    // Please do not interleave `struct` and `class` definitions with bindings code,\n    // but implement `struct`s and `class`es in the anonymous namespace above.\n    // This helps keeping the smart_holder branch in sync with master.\n\n    // test_smart_ptr\n\n    // Object implementation in `object.h`\n    py::class_<Object, ref<Object>> obj(m, \"Object\");\n    obj.def(\"getRefCount\", &Object::getRefCount);\n\n    py::class_<MyObject1, ref<MyObject1>>(m, \"MyObject1\", obj).def(py::init<int>());\n    py::implicitly_convertible<py::int_, MyObject1>();\n\n    m.def(\"make_object_1\", []() -> Object * { return new MyObject1(1); });\n    m.def(\"make_object_2\", []() -> ref<Object> { return ref<Object>(new MyObject1(2)); });\n    m.def(\"make_myobject1_1\", []() -> MyObject1 * { return new MyObject1(4); });\n    m.def(\"make_myobject1_2\", []() -> ref<MyObject1> { return ref<MyObject1>(new MyObject1(5)); });\n    m.def(\"print_object_1\", [](const Object *obj) { py::print(obj->toString()); });\n    m.def(\"print_object_2\", [](ref<Object> obj) { py::print(obj->toString()); });\n    m.def(\"print_object_3\", [](const ref<Object> &obj) { py::print(obj->toString()); });\n    m.def(\"print_object_4\", [](const ref<Object> *obj) { py::print((*obj)->toString()); });\n    m.def(\"print_myobject1_1\", [](const MyObject1 *obj) { py::print(obj->toString()); });\n    m.def(\"print_myobject1_2\", [](ref<MyObject1> obj) { py::print(obj->toString()); });\n    m.def(\"print_myobject1_3\", [](const ref<MyObject1> &obj) { py::print(obj->toString()); });\n    m.def(\"print_myobject1_4\", [](const ref<MyObject1> *obj) { py::print((*obj)->toString()); });\n\n    // Expose constructor stats for the ref type\n    m.def(\"cstats_ref\", &ConstructorStats::get<ref_tag>);\n\n    py::class_<MyObject2, std::shared_ptr<MyObject2>>(m, \"MyObject2\").def(py::init<int>());\n    m.def(\"make_myobject2_1\", []() { return new MyObject2(6); });\n    m.def(\"make_myobject2_2\", []() { return std::make_shared<MyObject2>(7); });\n    m.def(\"print_myobject2_1\", [](const MyObject2 *obj) { py::print(obj->toString()); });\n    // NOLINTNEXTLINE(performance-unnecessary-value-param)\n    m.def(\"print_myobject2_2\", [](std::shared_ptr<MyObject2> obj) { py::print(obj->toString()); });\n    m.def(\"print_myobject2_3\",\n          [](const std::shared_ptr<MyObject2> &obj) { py::print(obj->toString()); });\n    m.def(\"print_myobject2_4\",\n          [](const std::shared_ptr<MyObject2> *obj) { py::print((*obj)->toString()); });\n\n    py::class_<MyObject3, std::shared_ptr<MyObject3>>(m, \"MyObject3\").def(py::init<int>());\n    m.def(\"make_myobject3_1\", []() { return new MyObject3(8); });\n    m.def(\"make_myobject3_2\", []() { return std::make_shared<MyObject3>(9); });\n    m.def(\"print_myobject3_1\", [](const MyObject3 *obj) { py::print(obj->toString()); });\n    // NOLINTNEXTLINE(performance-unnecessary-value-param)\n    m.def(\"print_myobject3_2\", [](std::shared_ptr<MyObject3> obj) { py::print(obj->toString()); });\n    m.def(\"print_myobject3_3\",\n          [](const std::shared_ptr<MyObject3> &obj) { py::print(obj->toString()); });\n    m.def(\"print_myobject3_4\",\n          [](const std::shared_ptr<MyObject3> *obj) { py::print((*obj)->toString()); });\n\n    // test_smart_ptr_refcounting\n    m.def(\"test_object1_refcounting\", []() {\n        auto o = ref<MyObject1>(new MyObject1(0));\n        bool good = o->getRefCount() == 1;\n        py::object o2 = py::cast(o, py::return_value_policy::reference);\n        // always request (partial) ownership for objects with intrusive\n        // reference counting even when using the 'reference' RVP\n        good &= o->getRefCount() == 2;\n        return good;\n    });\n\n    // test_unique_nodelete\n    py::class_<MyObject4, std::unique_ptr<MyObject4, py::nodelete>>(m, \"MyObject4\")\n        .def(py::init<int>())\n        .def_readwrite(\"value\", &MyObject4::value)\n        .def_static(\"cleanup_all_instances\", &MyObject4::cleanupAllInstances);\n\n    // test_unique_deleter\n    py::class_<MyObject4a, std::unique_ptr<MyObject4a, py::nodelete>>(m, \"MyObject4a\")\n        .def(py::init<int>())\n        .def_readwrite(\"value\", &MyObject4a::value)\n        .def_static(\"cleanup_all_instances\", &MyObject4a::cleanupAllInstances);\n\n    py::class_<MyObject4b, MyObject4a, std::unique_ptr<MyObject4b>>(m, \"MyObject4b\")\n        .def(py::init<int>());\n\n    // test_large_holder\n    py::class_<MyObject5, huge_unique_ptr<MyObject5>>(m, \"MyObject5\")\n        .def(py::init<int>())\n        .def_readwrite(\"value\", &MyObject5::value);\n\n    // test_shared_ptr_and_references\n    using A = SharedPtrRef::A;\n    py::class_<A, std::shared_ptr<A>>(m, \"A\");\n    py::class_<SharedPtrRef, std::unique_ptr<SharedPtrRef>>(m, \"SharedPtrRef\")\n        .def(py::init<>())\n        .def_readonly(\"ref\", &SharedPtrRef::value)\n        .def_property_readonly(\n            \"copy\", [](const SharedPtrRef &s) { return s.value; }, py::return_value_policy::copy)\n        .def_readonly(\"holder_ref\", &SharedPtrRef::shared)\n        .def_property_readonly(\n            \"holder_copy\",\n            [](const SharedPtrRef &s) { return s.shared; },\n            py::return_value_policy::copy)\n        .def(\"set_ref\", [](SharedPtrRef &, const A &) { return true; })\n        // NOLINTNEXTLINE(performance-unnecessary-value-param)\n        .def(\"set_holder\", [](SharedPtrRef &, std::shared_ptr<A>) { return true; });\n\n    // test_shared_ptr_from_this_and_references\n    using B = SharedFromThisRef::B;\n    py::class_<B, std::shared_ptr<B>>(m, \"B\");\n    py::class_<SharedFromThisRef, std::unique_ptr<SharedFromThisRef>>(m, \"SharedFromThisRef\")\n        .def(py::init<>())\n        .def_readonly(\"bad_wp\", &SharedFromThisRef::value)\n        .def_property_readonly(\"ref\",\n                               [](const SharedFromThisRef &s) -> const B & { return *s.shared; })\n        .def_property_readonly(\n            \"copy\",\n            [](const SharedFromThisRef &s) { return s.value; },\n            py::return_value_policy::copy)\n        .def_readonly(\"holder_ref\", &SharedFromThisRef::shared)\n        .def_property_readonly(\n            \"holder_copy\",\n            [](const SharedFromThisRef &s) { return s.shared; },\n            py::return_value_policy::copy)\n        .def(\"set_ref\", [](SharedFromThisRef &, const B &) { return true; })\n        // NOLINTNEXTLINE(performance-unnecessary-value-param)\n        .def(\"set_holder\", [](SharedFromThisRef &, std::shared_ptr<B>) { return true; });\n\n    // Issue #865: shared_from_this doesn't work with virtual inheritance\n    static std::shared_ptr<SharedFromThisVirt> sft(new SharedFromThisVirt());\n    py::class_<SharedFromThisVirt, std::shared_ptr<SharedFromThisVirt>>(m, \"SharedFromThisVirt\")\n        .def_static(\"get\", []() { return sft.get(); });\n\n    // test_move_only_holder\n    py::class_<C, custom_unique_ptr<C>>(m, \"TypeWithMoveOnlyHolder\")\n        .def_static(\"make\", []() { return custom_unique_ptr<C>(new C); })\n        .def_static(\"make_as_object\", []() { return py::cast(custom_unique_ptr<C>(new C)); });\n\n    // test_holder_with_addressof_operator\n    using HolderWithAddressOf = shared_ptr_with_addressof_operator<TypeForHolderWithAddressOf>;\n    py::class_<TypeForHolderWithAddressOf, HolderWithAddressOf>(m, \"TypeForHolderWithAddressOf\")\n        .def_static(\"make\", []() { return HolderWithAddressOf(new TypeForHolderWithAddressOf); })\n        .def(\"get\", [](const HolderWithAddressOf &self) { return self.get(); })\n        .def(\"print_object_1\",\n             [](const TypeForHolderWithAddressOf *obj) { py::print(obj->toString()); })\n        // NOLINTNEXTLINE(performance-unnecessary-value-param)\n        .def(\"print_object_2\", [](HolderWithAddressOf obj) { py::print(obj.get()->toString()); })\n        .def(\"print_object_3\",\n             [](const HolderWithAddressOf &obj) { py::print(obj.get()->toString()); })\n        .def(\"print_object_4\",\n             [](const HolderWithAddressOf *obj) { py::print((*obj).get()->toString()); });\n\n    // test_move_only_holder_with_addressof_operator\n    using MoveOnlyHolderWithAddressOf\n        = unique_ptr_with_addressof_operator<TypeForMoveOnlyHolderWithAddressOf>;\n    py::class_<TypeForMoveOnlyHolderWithAddressOf, MoveOnlyHolderWithAddressOf>(\n        m, \"TypeForMoveOnlyHolderWithAddressOf\")\n        .def_static(\"make\",\n                    []() {\n                        return MoveOnlyHolderWithAddressOf(\n                            new TypeForMoveOnlyHolderWithAddressOf(0));\n                    })\n        .def_readwrite(\"value\", &TypeForMoveOnlyHolderWithAddressOf::value)\n        .def(\"print_object\",\n             [](const TypeForMoveOnlyHolderWithAddressOf *obj) { py::print(obj->toString()); });\n\n    // test_smart_ptr_from_default\n    py::class_<HeldByDefaultHolder, std::unique_ptr<HeldByDefaultHolder>>(m, \"HeldByDefaultHolder\")\n        .def(py::init<>())\n        // NOLINTNEXTLINE(performance-unnecessary-value-param)\n        .def_static(\"load_shared_ptr\", [](std::shared_ptr<HeldByDefaultHolder>) {});\n\n    // test_shared_ptr_gc\n    // #187: issue involving std::shared_ptr<> return value policy & garbage collection\n    py::class_<ElementBase, std::shared_ptr<ElementBase>>(m, \"ElementBase\");\n\n    py::class_<ElementA, ElementBase, std::shared_ptr<ElementA>>(m, \"ElementA\")\n        .def(py::init<int>())\n        .def(\"value\", &ElementA::value);\n\n    py::class_<ElementList, std::shared_ptr<ElementList>>(m, \"ElementList\")\n        .def(py::init<>())\n        .def(\"add\", &ElementList::add)\n        .def(\"get\", [](ElementList &el) {\n            py::list list;\n            for (auto &e : el.l) {\n                list.append(py::cast(e));\n            }\n            return list;\n        });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_smart_ptr.py",
    "content": "import pytest\n\nm = pytest.importorskip(\"pybind11_tests.smart_ptr\")\nfrom pybind11_tests import ConstructorStats  # noqa: E402\n\n\ndef test_smart_ptr(capture):\n    # Object1\n    for i, o in enumerate(\n        [m.make_object_1(), m.make_object_2(), m.MyObject1(3)], start=1\n    ):\n        assert o.getRefCount() == 1\n        with capture:\n            m.print_object_1(o)\n            m.print_object_2(o)\n            m.print_object_3(o)\n            m.print_object_4(o)\n        assert capture == f\"MyObject1[{i}]\\n\" * 4\n\n    for i, o in enumerate(\n        [m.make_myobject1_1(), m.make_myobject1_2(), m.MyObject1(6), 7], start=4\n    ):\n        print(o)\n        with capture:\n            if not isinstance(o, int):\n                m.print_object_1(o)\n                m.print_object_2(o)\n                m.print_object_3(o)\n                m.print_object_4(o)\n            m.print_myobject1_1(o)\n            m.print_myobject1_2(o)\n            m.print_myobject1_3(o)\n            m.print_myobject1_4(o)\n\n        times = 4 if isinstance(o, int) else 8\n        assert capture == f\"MyObject1[{i}]\\n\" * times\n\n    cstats = ConstructorStats.get(m.MyObject1)\n    assert cstats.alive() == 0\n    expected_values = [f\"MyObject1[{i}]\" for i in range(1, 7)] + [\"MyObject1[7]\"] * 4\n    assert cstats.values() == expected_values\n    assert cstats.default_constructions == 0\n    assert cstats.copy_constructions == 0\n    # assert cstats.move_constructions >= 0 # Doesn't invoke any\n    assert cstats.copy_assignments == 0\n    assert cstats.move_assignments == 0\n\n    # Object2\n    for i, o in zip(\n        [8, 6, 7], [m.MyObject2(8), m.make_myobject2_1(), m.make_myobject2_2()]\n    ):\n        print(o)\n        with capture:\n            m.print_myobject2_1(o)\n            m.print_myobject2_2(o)\n            m.print_myobject2_3(o)\n            m.print_myobject2_4(o)\n        assert capture == f\"MyObject2[{i}]\\n\" * 4\n\n    cstats = ConstructorStats.get(m.MyObject2)\n    assert cstats.alive() == 1\n    o = None\n    assert cstats.alive() == 0\n    assert cstats.values() == [\"MyObject2[8]\", \"MyObject2[6]\", \"MyObject2[7]\"]\n    assert cstats.default_constructions == 0\n    assert cstats.copy_constructions == 0\n    # assert cstats.move_constructions >= 0 # Doesn't invoke any\n    assert cstats.copy_assignments == 0\n    assert cstats.move_assignments == 0\n\n    # Object3\n    for i, o in zip(\n        [9, 8, 9], [m.MyObject3(9), m.make_myobject3_1(), m.make_myobject3_2()]\n    ):\n        print(o)\n        with capture:\n            m.print_myobject3_1(o)\n            m.print_myobject3_2(o)\n            m.print_myobject3_3(o)\n            m.print_myobject3_4(o)\n        assert capture == f\"MyObject3[{i}]\\n\" * 4\n\n    cstats = ConstructorStats.get(m.MyObject3)\n    assert cstats.alive() == 1\n    o = None\n    assert cstats.alive() == 0\n    assert cstats.values() == [\"MyObject3[9]\", \"MyObject3[8]\", \"MyObject3[9]\"]\n    assert cstats.default_constructions == 0\n    assert cstats.copy_constructions == 0\n    # assert cstats.move_constructions >= 0 # Doesn't invoke any\n    assert cstats.copy_assignments == 0\n    assert cstats.move_assignments == 0\n\n    # Object\n    cstats = ConstructorStats.get(m.Object)\n    assert cstats.alive() == 0\n    assert cstats.values() == []\n    assert cstats.default_constructions == 10\n    assert cstats.copy_constructions == 0\n    # assert cstats.move_constructions >= 0 # Doesn't invoke any\n    assert cstats.copy_assignments == 0\n    assert cstats.move_assignments == 0\n\n    # ref<>\n    cstats = m.cstats_ref()\n    assert cstats.alive() == 0\n    assert cstats.values() == [\"from pointer\"] * 10\n    assert cstats.default_constructions == 30\n    assert cstats.copy_constructions == 12\n    # assert cstats.move_constructions >= 0 # Doesn't invoke any\n    assert cstats.copy_assignments == 30\n    assert cstats.move_assignments == 0\n\n\ndef test_smart_ptr_refcounting():\n    assert m.test_object1_refcounting()\n\n\ndef test_unique_nodelete():\n    o = m.MyObject4(23)\n    assert o.value == 23\n    cstats = ConstructorStats.get(m.MyObject4)\n    assert cstats.alive() == 1\n    del o\n    assert cstats.alive() == 1\n    m.MyObject4.cleanup_all_instances()\n    assert cstats.alive() == 0\n\n\ndef test_unique_nodelete4a():\n    o = m.MyObject4a(23)\n    assert o.value == 23\n    cstats = ConstructorStats.get(m.MyObject4a)\n    assert cstats.alive() == 1\n    del o\n    assert cstats.alive() == 1\n    m.MyObject4a.cleanup_all_instances()\n    assert cstats.alive() == 0\n\n\ndef test_unique_deleter():\n    m.MyObject4a(0)\n    o = m.MyObject4b(23)\n    assert o.value == 23\n    cstats4a = ConstructorStats.get(m.MyObject4a)\n    assert cstats4a.alive() == 2\n    cstats4b = ConstructorStats.get(m.MyObject4b)\n    assert cstats4b.alive() == 1\n    del o\n    assert cstats4a.alive() == 1  # Should now only be one leftover\n    assert cstats4b.alive() == 0  # Should be deleted\n    m.MyObject4a.cleanup_all_instances()\n    assert cstats4a.alive() == 0\n    assert cstats4b.alive() == 0\n\n\ndef test_large_holder():\n    o = m.MyObject5(5)\n    assert o.value == 5\n    cstats = ConstructorStats.get(m.MyObject5)\n    assert cstats.alive() == 1\n    del o\n    assert cstats.alive() == 0\n\n\ndef test_shared_ptr_and_references():\n    s = m.SharedPtrRef()\n    stats = ConstructorStats.get(m.A)\n    assert stats.alive() == 2\n\n    ref = s.ref  # init_holder_helper(holder_ptr=false, owned=false)\n    assert stats.alive() == 2\n    assert s.set_ref(ref)\n    with pytest.raises(RuntimeError) as excinfo:\n        assert s.set_holder(ref)\n    assert \"Unable to cast from non-held to held instance\" in str(excinfo.value)\n\n    copy = s.copy  # init_holder_helper(holder_ptr=false, owned=true)\n    assert stats.alive() == 3\n    assert s.set_ref(copy)\n    assert s.set_holder(copy)\n\n    holder_ref = s.holder_ref  # init_holder_helper(holder_ptr=true, owned=false)\n    assert stats.alive() == 3\n    assert s.set_ref(holder_ref)\n    assert s.set_holder(holder_ref)\n\n    holder_copy = s.holder_copy  # init_holder_helper(holder_ptr=true, owned=true)\n    assert stats.alive() == 3\n    assert s.set_ref(holder_copy)\n    assert s.set_holder(holder_copy)\n\n    del ref, copy, holder_ref, holder_copy, s\n    assert stats.alive() == 0\n\n\ndef test_shared_ptr_from_this_and_references():\n    s = m.SharedFromThisRef()\n    stats = ConstructorStats.get(m.B)\n    assert stats.alive() == 2\n\n    ref = s.ref  # init_holder_helper(holder_ptr=false, owned=false, bad_wp=false)\n    assert stats.alive() == 2\n    assert s.set_ref(ref)\n    assert s.set_holder(\n        ref\n    )  # std::enable_shared_from_this can create a holder from a reference\n\n    bad_wp = s.bad_wp  # init_holder_helper(holder_ptr=false, owned=false, bad_wp=true)\n    assert stats.alive() == 2\n    assert s.set_ref(bad_wp)\n    with pytest.raises(RuntimeError) as excinfo:\n        assert s.set_holder(bad_wp)\n    assert \"Unable to cast from non-held to held instance\" in str(excinfo.value)\n\n    copy = s.copy  # init_holder_helper(holder_ptr=false, owned=true, bad_wp=false)\n    assert stats.alive() == 3\n    assert s.set_ref(copy)\n    assert s.set_holder(copy)\n\n    holder_ref = (\n        s.holder_ref\n    )  # init_holder_helper(holder_ptr=true, owned=false, bad_wp=false)\n    assert stats.alive() == 3\n    assert s.set_ref(holder_ref)\n    assert s.set_holder(holder_ref)\n\n    holder_copy = (\n        s.holder_copy\n    )  # init_holder_helper(holder_ptr=true, owned=true, bad_wp=false)\n    assert stats.alive() == 3\n    assert s.set_ref(holder_copy)\n    assert s.set_holder(holder_copy)\n\n    del ref, bad_wp, copy, holder_ref, holder_copy, s\n    assert stats.alive() == 0\n\n    z = m.SharedFromThisVirt.get()\n    y = m.SharedFromThisVirt.get()\n    assert y is z\n\n\ndef test_move_only_holder():\n    a = m.TypeWithMoveOnlyHolder.make()\n    b = m.TypeWithMoveOnlyHolder.make_as_object()\n    stats = ConstructorStats.get(m.TypeWithMoveOnlyHolder)\n    assert stats.alive() == 2\n    del b\n    assert stats.alive() == 1\n    del a\n    assert stats.alive() == 0\n\n\ndef test_holder_with_addressof_operator():\n    # this test must not throw exception from c++\n    a = m.TypeForHolderWithAddressOf.make()\n    a.print_object_1()\n    a.print_object_2()\n    a.print_object_3()\n    a.print_object_4()\n\n    stats = ConstructorStats.get(m.TypeForHolderWithAddressOf)\n    assert stats.alive() == 1\n\n    np = m.TypeForHolderWithAddressOf.make()\n    assert stats.alive() == 2\n    del a\n    assert stats.alive() == 1\n    del np\n    assert stats.alive() == 0\n\n    b = m.TypeForHolderWithAddressOf.make()\n    c = b\n    assert b.get() is c.get()\n    assert stats.alive() == 1\n\n    del b\n    assert stats.alive() == 1\n\n    del c\n    assert stats.alive() == 0\n\n\ndef test_move_only_holder_with_addressof_operator():\n    a = m.TypeForMoveOnlyHolderWithAddressOf.make()\n    a.print_object()\n\n    stats = ConstructorStats.get(m.TypeForMoveOnlyHolderWithAddressOf)\n    assert stats.alive() == 1\n\n    a.value = 42\n    assert a.value == 42\n\n    del a\n    assert stats.alive() == 0\n\n\ndef test_smart_ptr_from_default():\n    instance = m.HeldByDefaultHolder()\n    with pytest.raises(RuntimeError) as excinfo:\n        m.HeldByDefaultHolder.load_shared_ptr(instance)\n    assert (\n        \"Unable to load a custom holder type from a \"\n        \"default-holder instance\" in str(excinfo.value)\n    )\n\n\ndef test_shared_ptr_gc():\n    \"\"\"#187: issue involving std::shared_ptr<> return value policy & garbage collection\"\"\"\n    el = m.ElementList()\n    for i in range(10):\n        el.add(m.ElementA(i))\n    pytest.gc_collect()\n    for i, v in enumerate(el.get()):\n        assert i == v.value()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_stl.cpp",
    "content": "/*\n    tests/test_stl.cpp -- STL type casters\n\n    Copyright (c) 2017 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/stl.h>\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\n#ifndef PYBIND11_HAS_FILESYSTEM_IS_OPTIONAL\n#    define PYBIND11_HAS_FILESYSTEM_IS_OPTIONAL\n#endif\n#include <pybind11/stl/filesystem.h>\n\n#include <string>\n#include <vector>\n\n#if defined(PYBIND11_TEST_BOOST)\n#    include <boost/optional.hpp>\n\nnamespace PYBIND11_NAMESPACE {\nnamespace detail {\ntemplate <typename T>\nstruct type_caster<boost::optional<T>> : optional_caster<boost::optional<T>> {};\n\ntemplate <>\nstruct type_caster<boost::none_t> : void_caster<boost::none_t> {};\n} // namespace detail\n} // namespace PYBIND11_NAMESPACE\n#endif\n\n// Test with `std::variant` in C++17 mode, or with `boost::variant` in C++11/14\n#if defined(PYBIND11_HAS_VARIANT)\nusing std::variant;\n#    define PYBIND11_TEST_VARIANT 1\n#elif defined(PYBIND11_TEST_BOOST)\n#    include <boost/variant.hpp>\n#    define PYBIND11_TEST_VARIANT 1\nusing boost::variant;\n\nnamespace PYBIND11_NAMESPACE {\nnamespace detail {\ntemplate <typename... Ts>\nstruct type_caster<boost::variant<Ts...>> : variant_caster<boost::variant<Ts...>> {};\n\ntemplate <>\nstruct visit_helper<boost::variant> {\n    template <typename... Args>\n    static auto call(Args &&...args) -> decltype(boost::apply_visitor(args...)) {\n        return boost::apply_visitor(args...);\n    }\n};\n} // namespace detail\n} // namespace PYBIND11_NAMESPACE\n#endif\n\nPYBIND11_MAKE_OPAQUE(std::vector<std::string, std::allocator<std::string>>);\n\n/// Issue #528: templated constructor\nstruct TplCtorClass {\n    template <typename T>\n    explicit TplCtorClass(const T &) {}\n    bool operator==(const TplCtorClass &) const { return true; }\n};\n\nnamespace std {\ntemplate <>\nstruct hash<TplCtorClass> {\n    size_t operator()(const TplCtorClass &) const { return 0; }\n};\n} // namespace std\n\ntemplate <template <typename> class OptionalImpl, typename T>\nstruct OptionalHolder {\n    // NOLINTNEXTLINE(modernize-use-equals-default): breaks GCC 4.8\n    OptionalHolder(){};\n    bool member_initialized() const { return member && member->initialized; }\n    OptionalImpl<T> member = T{};\n};\n\nenum class EnumType {\n    kSet = 42,\n    kUnset = 85,\n};\n\n// This is used to test that return-by-ref and return-by-copy policies are\n// handled properly for optional types. This is a regression test for a dangling\n// reference issue. The issue seemed to require the enum value type to\n// reproduce - it didn't seem to happen if the value type is just an integer.\ntemplate <template <typename> class OptionalImpl>\nclass OptionalProperties {\npublic:\n    using OptionalEnumValue = OptionalImpl<EnumType>;\n\n    OptionalProperties() : value(EnumType::kSet) {}\n    ~OptionalProperties() {\n        // Reset value to detect use-after-destruction.\n        // This is set to a specific value rather than nullopt to ensure that\n        // the memory that contains the value gets re-written.\n        value = EnumType::kUnset;\n    }\n\n    OptionalEnumValue &access_by_ref() { return value; }\n    OptionalEnumValue access_by_copy() { return value; }\n\nprivate:\n    OptionalEnumValue value;\n};\n\n// This type mimics aspects of boost::optional from old versions of Boost,\n// which exposed a dangling reference bug in Pybind11. Recent versions of\n// boost::optional, as well as libstdc++'s std::optional, don't seem to be\n// affected by the same issue. This is meant to be a minimal implementation\n// required to reproduce the issue, not fully standard-compliant.\n// See issue #3330 for more details.\ntemplate <typename T>\nclass ReferenceSensitiveOptional {\npublic:\n    using value_type = T;\n\n    ReferenceSensitiveOptional() = default;\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    ReferenceSensitiveOptional(const T &value) : storage{value} {}\n    // NOLINTNEXTLINE(google-explicit-constructor)\n    ReferenceSensitiveOptional(T &&value) : storage{std::move(value)} {}\n    ReferenceSensitiveOptional &operator=(const T &value) {\n        storage = {value};\n        return *this;\n    }\n    ReferenceSensitiveOptional &operator=(T &&value) {\n        storage = {std::move(value)};\n        return *this;\n    }\n\n    template <typename... Args>\n    T &emplace(Args &&...args) {\n        storage.clear();\n        storage.emplace_back(std::forward<Args>(args)...);\n        return storage.back();\n    }\n\n    const T &value() const noexcept {\n        assert(!storage.empty());\n        return storage[0];\n    }\n\n    const T &operator*() const noexcept { return value(); }\n\n    const T *operator->() const noexcept { return &value(); }\n\n    explicit operator bool() const noexcept { return !storage.empty(); }\n\nprivate:\n    std::vector<T> storage;\n};\n\nnamespace PYBIND11_NAMESPACE {\nnamespace detail {\ntemplate <typename T>\nstruct type_caster<ReferenceSensitiveOptional<T>>\n    : optional_caster<ReferenceSensitiveOptional<T>> {};\n} // namespace detail\n} // namespace PYBIND11_NAMESPACE\n\nTEST_SUBMODULE(stl, m) {\n    // test_vector\n    m.def(\"cast_vector\", []() { return std::vector<int>{1}; });\n    m.def(\"load_vector\", [](const std::vector<int> &v) { return v.at(0) == 1 && v.at(1) == 2; });\n    // `std::vector<bool>` is special because it returns proxy objects instead of references\n    m.def(\"cast_bool_vector\", []() { return std::vector<bool>{true, false}; });\n    m.def(\"load_bool_vector\",\n          [](const std::vector<bool> &v) { return v.at(0) == true && v.at(1) == false; });\n    // Unnumbered regression (caused by #936): pointers to stl containers aren't castable\n    m.def(\n        \"cast_ptr_vector\",\n        []() {\n            // Using no-destructor idiom to side-step warnings from overzealous compilers.\n            static auto *v = new std::vector<RValueCaster>{2};\n            return v;\n        },\n        py::return_value_policy::reference);\n\n    // test_deque\n    m.def(\"cast_deque\", []() { return std::deque<int>{1}; });\n    m.def(\"load_deque\", [](const std::deque<int> &v) { return v.at(0) == 1 && v.at(1) == 2; });\n\n    // test_array\n    m.def(\"cast_array\", []() { return std::array<int, 2>{{1, 2}}; });\n    m.def(\"load_array\", [](const std::array<int, 2> &a) { return a[0] == 1 && a[1] == 2; });\n\n    // test_valarray\n    m.def(\"cast_valarray\", []() { return std::valarray<int>{1, 4, 9}; });\n    m.def(\"load_valarray\", [](const std::valarray<int> &v) {\n        return v.size() == 3 && v[0] == 1 && v[1] == 4 && v[2] == 9;\n    });\n\n    // test_map\n    m.def(\"cast_map\", []() { return std::map<std::string, std::string>{{\"key\", \"value\"}}; });\n    m.def(\"load_map\", [](const std::map<std::string, std::string> &map) {\n        return map.at(\"key\") == \"value\" && map.at(\"key2\") == \"value2\";\n    });\n\n    // test_set\n    m.def(\"cast_set\", []() { return std::set<std::string>{\"key1\", \"key2\"}; });\n    m.def(\"load_set\", [](const std::set<std::string> &set) {\n        return (set.count(\"key1\") != 0u) && (set.count(\"key2\") != 0u) && (set.count(\"key3\") != 0u);\n    });\n\n    // test_recursive_casting\n    m.def(\"cast_rv_vector\", []() { return std::vector<RValueCaster>{2}; });\n    m.def(\"cast_rv_array\", []() { return std::array<RValueCaster, 3>(); });\n    // NB: map and set keys are `const`, so while we technically do move them (as `const Type &&`),\n    // casters don't typically do anything with that, which means they fall to the `const Type &`\n    // caster.\n    m.def(\"cast_rv_map\", []() {\n        return std::unordered_map<std::string, RValueCaster>{{\"a\", RValueCaster{}}};\n    });\n    m.def(\"cast_rv_nested\", []() {\n        std::vector<std::array<std::list<std::unordered_map<std::string, RValueCaster>>, 2>> v;\n        v.emplace_back();           // add an array\n        v.back()[0].emplace_back(); // add a map to the array\n        v.back()[0].back().emplace(\"b\", RValueCaster{});\n        v.back()[0].back().emplace(\"c\", RValueCaster{});\n        v.back()[1].emplace_back(); // add a map to the array\n        v.back()[1].back().emplace(\"a\", RValueCaster{});\n        return v;\n    });\n    static std::array<RValueCaster, 2> lva;\n    static std::unordered_map<std::string, RValueCaster> lvm{{\"a\", RValueCaster{}},\n                                                             {\"b\", RValueCaster{}}};\n    static std::unordered_map<std::string, std::vector<std::list<std::array<RValueCaster, 2>>>>\n        lvn;\n    lvn[\"a\"].emplace_back();        // add a list\n    lvn[\"a\"].back().emplace_back(); // add an array\n    lvn[\"a\"].emplace_back();        // another list\n    lvn[\"a\"].back().emplace_back(); // add an array\n    lvn[\"b\"].emplace_back();        // add a list\n    lvn[\"b\"].back().emplace_back(); // add an array\n    lvn[\"b\"].back().emplace_back(); // add another array\n    static std::vector<RValueCaster> lvv{2};\n    m.def(\"cast_lv_vector\", []() -> const decltype(lvv) & { return lvv; });\n    m.def(\"cast_lv_array\", []() -> const decltype(lva) & { return lva; });\n    m.def(\"cast_lv_map\", []() -> const decltype(lvm) & { return lvm; });\n    m.def(\"cast_lv_nested\", []() -> const decltype(lvn) & { return lvn; });\n    // #853:\n    m.def(\"cast_unique_ptr_vector\", []() {\n        std::vector<std::unique_ptr<UserType>> v;\n        v.emplace_back(new UserType{7});\n        v.emplace_back(new UserType{42});\n        return v;\n    });\n\n    pybind11::enum_<EnumType>(m, \"EnumType\")\n        .value(\"kSet\", EnumType::kSet)\n        .value(\"kUnset\", EnumType::kUnset);\n\n    // test_move_out_container\n    struct MoveOutContainer {\n        struct Value {\n            int value;\n        };\n        std::list<Value> move_list() const { return {{0}, {1}, {2}}; }\n    };\n    py::class_<MoveOutContainer::Value>(m, \"MoveOutContainerValue\")\n        .def_readonly(\"value\", &MoveOutContainer::Value::value);\n    py::class_<MoveOutContainer>(m, \"MoveOutContainer\")\n        .def(py::init<>())\n        .def_property_readonly(\"move_list\", &MoveOutContainer::move_list);\n\n    // Class that can be move- and copy-constructed, but not assigned\n    struct NoAssign {\n        int value;\n\n        explicit NoAssign(int value = 0) : value(value) {}\n        NoAssign(const NoAssign &) = default;\n        NoAssign(NoAssign &&) = default;\n\n        NoAssign &operator=(const NoAssign &) = delete;\n        NoAssign &operator=(NoAssign &&) = delete;\n    };\n    py::class_<NoAssign>(m, \"NoAssign\", \"Class with no C++ assignment operators\")\n        .def(py::init<>())\n        .def(py::init<int>());\n\n    struct MoveOutDetector {\n        MoveOutDetector() = default;\n        MoveOutDetector(const MoveOutDetector &) = default;\n        MoveOutDetector(MoveOutDetector &&other) noexcept : initialized(other.initialized) {\n            // steal underlying resource\n            other.initialized = false;\n        }\n        bool initialized = true;\n    };\n    py::class_<MoveOutDetector>(m, \"MoveOutDetector\", \"Class with move tracking\")\n        .def(py::init<>())\n        .def_readonly(\"initialized\", &MoveOutDetector::initialized);\n\n#ifdef PYBIND11_HAS_OPTIONAL\n    // test_optional\n    m.attr(\"has_optional\") = true;\n\n    using opt_int = std::optional<int>;\n    using opt_no_assign = std::optional<NoAssign>;\n    m.def(\"double_or_zero\", [](const opt_int &x) -> int { return x.value_or(0) * 2; });\n    m.def(\"half_or_none\", [](int x) -> opt_int { return x != 0 ? opt_int(x / 2) : opt_int(); });\n    m.def(\n        \"test_nullopt\",\n        [](opt_int x) { return x.value_or(42); },\n        py::arg_v(\"x\", std::nullopt, \"None\"));\n    m.def(\n        \"test_no_assign\",\n        [](const opt_no_assign &x) { return x ? x->value : 42; },\n        py::arg_v(\"x\", std::nullopt, \"None\"));\n\n    m.def(\"nodefer_none_optional\", [](std::optional<int>) { return true; });\n    m.def(\"nodefer_none_optional\", [](const py::none &) { return false; });\n\n    using opt_holder = OptionalHolder<std::optional, MoveOutDetector>;\n    py::class_<opt_holder>(m, \"OptionalHolder\", \"Class with optional member\")\n        .def(py::init<>())\n        .def_readonly(\"member\", &opt_holder::member)\n        .def(\"member_initialized\", &opt_holder::member_initialized);\n\n    using opt_props = OptionalProperties<std::optional>;\n    pybind11::class_<opt_props>(m, \"OptionalProperties\")\n        .def(pybind11::init<>())\n        .def_property_readonly(\"access_by_ref\", &opt_props::access_by_ref)\n        .def_property_readonly(\"access_by_copy\", &opt_props::access_by_copy);\n#endif\n\n#ifdef PYBIND11_HAS_EXP_OPTIONAL\n    // test_exp_optional\n    m.attr(\"has_exp_optional\") = true;\n\n    using exp_opt_int = std::experimental::optional<int>;\n    using exp_opt_no_assign = std::experimental::optional<NoAssign>;\n    m.def(\"double_or_zero_exp\", [](const exp_opt_int &x) -> int { return x.value_or(0) * 2; });\n    m.def(\"half_or_none_exp\",\n          [](int x) -> exp_opt_int { return x ? exp_opt_int(x / 2) : exp_opt_int(); });\n    m.def(\n        \"test_nullopt_exp\",\n        [](exp_opt_int x) { return x.value_or(42); },\n        py::arg_v(\"x\", std::experimental::nullopt, \"None\"));\n    m.def(\n        \"test_no_assign_exp\",\n        [](const exp_opt_no_assign &x) { return x ? x->value : 42; },\n        py::arg_v(\"x\", std::experimental::nullopt, \"None\"));\n\n    using opt_exp_holder = OptionalHolder<std::experimental::optional, MoveOutDetector>;\n    py::class_<opt_exp_holder>(m, \"OptionalExpHolder\", \"Class with optional member\")\n        .def(py::init<>())\n        .def_readonly(\"member\", &opt_exp_holder::member)\n        .def(\"member_initialized\", &opt_exp_holder::member_initialized);\n\n    using opt_exp_props = OptionalProperties<std::experimental::optional>;\n    pybind11::class_<opt_exp_props>(m, \"OptionalExpProperties\")\n        .def(pybind11::init<>())\n        .def_property_readonly(\"access_by_ref\", &opt_exp_props::access_by_ref)\n        .def_property_readonly(\"access_by_copy\", &opt_exp_props::access_by_copy);\n#endif\n\n#if defined(PYBIND11_TEST_BOOST)\n    // test_boost_optional\n    m.attr(\"has_boost_optional\") = true;\n\n    using boost_opt_int = boost::optional<int>;\n    using boost_opt_no_assign = boost::optional<NoAssign>;\n    m.def(\"double_or_zero_boost\", [](const boost_opt_int &x) -> int { return x.value_or(0) * 2; });\n    m.def(\"half_or_none_boost\",\n          [](int x) -> boost_opt_int { return x != 0 ? boost_opt_int(x / 2) : boost_opt_int(); });\n    m.def(\n        \"test_nullopt_boost\",\n        [](boost_opt_int x) { return x.value_or(42); },\n        py::arg_v(\"x\", boost::none, \"None\"));\n    m.def(\n        \"test_no_assign_boost\",\n        [](const boost_opt_no_assign &x) { return x ? x->value : 42; },\n        py::arg_v(\"x\", boost::none, \"None\"));\n\n    using opt_boost_holder = OptionalHolder<boost::optional, MoveOutDetector>;\n    py::class_<opt_boost_holder>(m, \"OptionalBoostHolder\", \"Class with optional member\")\n        .def(py::init<>())\n        .def_readonly(\"member\", &opt_boost_holder::member)\n        .def(\"member_initialized\", &opt_boost_holder::member_initialized);\n\n    using opt_boost_props = OptionalProperties<boost::optional>;\n    pybind11::class_<opt_boost_props>(m, \"OptionalBoostProperties\")\n        .def(pybind11::init<>())\n        .def_property_readonly(\"access_by_ref\", &opt_boost_props::access_by_ref)\n        .def_property_readonly(\"access_by_copy\", &opt_boost_props::access_by_copy);\n#endif\n\n    // test_refsensitive_optional\n    using refsensitive_opt_int = ReferenceSensitiveOptional<int>;\n    using refsensitive_opt_no_assign = ReferenceSensitiveOptional<NoAssign>;\n    m.def(\"double_or_zero_refsensitive\",\n          [](const refsensitive_opt_int &x) -> int { return (x ? x.value() : 0) * 2; });\n    m.def(\"half_or_none_refsensitive\", [](int x) -> refsensitive_opt_int {\n        return x != 0 ? refsensitive_opt_int(x / 2) : refsensitive_opt_int();\n    });\n    m.def(\n        \"test_nullopt_refsensitive\",\n        // NOLINTNEXTLINE(performance-unnecessary-value-param)\n        [](refsensitive_opt_int x) { return x ? x.value() : 42; },\n        py::arg_v(\"x\", refsensitive_opt_int(), \"None\"));\n    m.def(\n        \"test_no_assign_refsensitive\",\n        [](const refsensitive_opt_no_assign &x) { return x ? x->value : 42; },\n        py::arg_v(\"x\", refsensitive_opt_no_assign(), \"None\"));\n\n    using opt_refsensitive_holder = OptionalHolder<ReferenceSensitiveOptional, MoveOutDetector>;\n    py::class_<opt_refsensitive_holder>(\n        m, \"OptionalRefSensitiveHolder\", \"Class with optional member\")\n        .def(py::init<>())\n        .def_readonly(\"member\", &opt_refsensitive_holder::member)\n        .def(\"member_initialized\", &opt_refsensitive_holder::member_initialized);\n\n    using opt_refsensitive_props = OptionalProperties<ReferenceSensitiveOptional>;\n    pybind11::class_<opt_refsensitive_props>(m, \"OptionalRefSensitiveProperties\")\n        .def(pybind11::init<>())\n        .def_property_readonly(\"access_by_ref\", &opt_refsensitive_props::access_by_ref)\n        .def_property_readonly(\"access_by_copy\", &opt_refsensitive_props::access_by_copy);\n\n#ifdef PYBIND11_HAS_FILESYSTEM\n    // test_fs_path\n    m.attr(\"has_filesystem\") = true;\n    m.def(\"parent_path\", [](const std::filesystem::path &p) { return p.parent_path(); });\n#endif\n\n#ifdef PYBIND11_TEST_VARIANT\n    static_assert(std::is_same<py::detail::variant_caster_visitor::result_type, py::handle>::value,\n                  \"visitor::result_type is required by boost::variant in C++11 mode\");\n\n    struct visitor {\n        using result_type = const char *;\n\n        result_type operator()(int) { return \"int\"; }\n        result_type operator()(const std::string &) { return \"std::string\"; }\n        result_type operator()(double) { return \"double\"; }\n        result_type operator()(std::nullptr_t) { return \"std::nullptr_t\"; }\n#    if defined(PYBIND11_HAS_VARIANT)\n        result_type operator()(std::monostate) { return \"std::monostate\"; }\n#    endif\n    };\n\n    // test_variant\n    m.def(\"load_variant\", [](const variant<int, std::string, double, std::nullptr_t> &v) {\n        return py::detail::visit_helper<variant>::call(visitor(), v);\n    });\n    m.def(\"load_variant_2pass\", [](variant<double, int> v) {\n        return py::detail::visit_helper<variant>::call(visitor(), v);\n    });\n    m.def(\"cast_variant\", []() {\n        using V = variant<int, std::string>;\n        return py::make_tuple(V(5), V(\"Hello\"));\n    });\n\n#    if defined(PYBIND11_HAS_VARIANT)\n    // std::monostate tests.\n    m.def(\"load_monostate_variant\",\n          [](const variant<std::monostate, int, std::string> &v) -> const char * {\n              return py::detail::visit_helper<variant>::call(visitor(), v);\n          });\n    m.def(\"cast_monostate_variant\", []() {\n        using V = variant<std::monostate, int, std::string>;\n        return py::make_tuple(V{}, V(5), V(\"Hello\"));\n    });\n#    endif\n#endif\n\n    // #528: templated constructor\n    // (no python tests: the test here is that this compiles)\n    m.def(\"tpl_ctor_vector\", [](std::vector<TplCtorClass> &) {});\n    m.def(\"tpl_ctor_map\", [](std::unordered_map<TplCtorClass, TplCtorClass> &) {});\n    m.def(\"tpl_ctor_set\", [](std::unordered_set<TplCtorClass> &) {});\n#if defined(PYBIND11_HAS_OPTIONAL)\n    m.def(\"tpl_constr_optional\", [](std::optional<TplCtorClass> &) {});\n#endif\n#if defined(PYBIND11_HAS_EXP_OPTIONAL)\n    m.def(\"tpl_constr_optional_exp\", [](std::experimental::optional<TplCtorClass> &) {});\n#endif\n#if defined(PYBIND11_TEST_BOOST)\n    m.def(\"tpl_constr_optional_boost\", [](boost::optional<TplCtorClass> &) {});\n#endif\n\n    // test_vec_of_reference_wrapper\n    // #171: Can't return STL structures containing reference wrapper\n    m.def(\"return_vec_of_reference_wrapper\", [](std::reference_wrapper<UserType> p4) {\n        static UserType p1{1}, p2{2}, p3{3};\n        return std::vector<std::reference_wrapper<UserType>>{\n            std::ref(p1), std::ref(p2), std::ref(p3), p4};\n    });\n\n    // test_stl_pass_by_pointer\n    m.def(\n        \"stl_pass_by_pointer\", [](std::vector<int> *v) { return *v; }, \"v\"_a = nullptr);\n\n    // #1258: pybind11/stl.h converts string to vector<string>\n    m.def(\"func_with_string_or_vector_string_arg_overload\",\n          [](const std::vector<std::string> &) { return 1; });\n    m.def(\"func_with_string_or_vector_string_arg_overload\",\n          [](const std::list<std::string> &) { return 2; });\n    m.def(\"func_with_string_or_vector_string_arg_overload\", [](const std::string &) { return 3; });\n\n    class Placeholder {\n    public:\n        Placeholder() { print_created(this); }\n        Placeholder(const Placeholder &) = delete;\n        ~Placeholder() { print_destroyed(this); }\n    };\n    py::class_<Placeholder>(m, \"Placeholder\");\n\n    /// test_stl_vector_ownership\n    m.def(\n        \"test_stl_ownership\",\n        []() {\n            std::vector<Placeholder *> result;\n            result.push_back(new Placeholder());\n            return result;\n        },\n        py::return_value_policy::take_ownership);\n\n    m.def(\"array_cast_sequence\", [](std::array<int, 3> x) { return x; });\n\n    /// test_issue_1561\n    struct Issue1561Inner {\n        std::string data;\n    };\n    struct Issue1561Outer {\n        std::vector<Issue1561Inner> list;\n    };\n\n    py::class_<Issue1561Inner>(m, \"Issue1561Inner\")\n        .def(py::init<std::string>())\n        .def_readwrite(\"data\", &Issue1561Inner::data);\n\n    py::class_<Issue1561Outer>(m, \"Issue1561Outer\")\n        .def(py::init<>())\n        .def_readwrite(\"list\", &Issue1561Outer::list);\n\n    m.def(\n        \"return_vector_bool_raw_ptr\",\n        []() { return new std::vector<bool>(4513); },\n        // Without explicitly specifying `take_ownership`, this function leaks.\n        py::return_value_policy::take_ownership);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_stl.py",
    "content": "import pytest\n\nfrom pybind11_tests import ConstructorStats, UserType\nfrom pybind11_tests import stl as m\n\n\ndef test_vector(doc):\n    \"\"\"std::vector <-> list\"\"\"\n    lst = m.cast_vector()\n    assert lst == [1]\n    lst.append(2)\n    assert m.load_vector(lst)\n    assert m.load_vector(tuple(lst))\n\n    assert m.cast_bool_vector() == [True, False]\n    assert m.load_bool_vector([True, False])\n    assert m.load_bool_vector(tuple([True, False]))\n\n    assert doc(m.cast_vector) == \"cast_vector() -> List[int]\"\n    assert doc(m.load_vector) == \"load_vector(arg0: List[int]) -> bool\"\n\n    # Test regression caused by 936: pointers to stl containers weren't castable\n    assert m.cast_ptr_vector() == [\"lvalue\", \"lvalue\"]\n\n\ndef test_deque(doc):\n    \"\"\"std::deque <-> list\"\"\"\n    lst = m.cast_deque()\n    assert lst == [1]\n    lst.append(2)\n    assert m.load_deque(lst)\n    assert m.load_deque(tuple(lst))\n\n\ndef test_array(doc):\n    \"\"\"std::array <-> list\"\"\"\n    lst = m.cast_array()\n    assert lst == [1, 2]\n    assert m.load_array(lst)\n    assert m.load_array(tuple(lst))\n\n    assert doc(m.cast_array) == \"cast_array() -> List[int[2]]\"\n    assert doc(m.load_array) == \"load_array(arg0: List[int[2]]) -> bool\"\n\n\ndef test_valarray(doc):\n    \"\"\"std::valarray <-> list\"\"\"\n    lst = m.cast_valarray()\n    assert lst == [1, 4, 9]\n    assert m.load_valarray(lst)\n    assert m.load_valarray(tuple(lst))\n\n    assert doc(m.cast_valarray) == \"cast_valarray() -> List[int]\"\n    assert doc(m.load_valarray) == \"load_valarray(arg0: List[int]) -> bool\"\n\n\ndef test_map(doc):\n    \"\"\"std::map <-> dict\"\"\"\n    d = m.cast_map()\n    assert d == {\"key\": \"value\"}\n    assert \"key\" in d\n    d[\"key2\"] = \"value2\"\n    assert \"key2\" in d\n    assert m.load_map(d)\n\n    assert doc(m.cast_map) == \"cast_map() -> Dict[str, str]\"\n    assert doc(m.load_map) == \"load_map(arg0: Dict[str, str]) -> bool\"\n\n\ndef test_set(doc):\n    \"\"\"std::set <-> set\"\"\"\n    s = m.cast_set()\n    assert s == {\"key1\", \"key2\"}\n    s.add(\"key3\")\n    assert m.load_set(s)\n    assert m.load_set(frozenset(s))\n\n    assert doc(m.cast_set) == \"cast_set() -> Set[str]\"\n    assert doc(m.load_set) == \"load_set(arg0: Set[str]) -> bool\"\n\n\ndef test_recursive_casting():\n    \"\"\"Tests that stl casters preserve lvalue/rvalue context for container values\"\"\"\n    assert m.cast_rv_vector() == [\"rvalue\", \"rvalue\"]\n    assert m.cast_lv_vector() == [\"lvalue\", \"lvalue\"]\n    assert m.cast_rv_array() == [\"rvalue\", \"rvalue\", \"rvalue\"]\n    assert m.cast_lv_array() == [\"lvalue\", \"lvalue\"]\n    assert m.cast_rv_map() == {\"a\": \"rvalue\"}\n    assert m.cast_lv_map() == {\"a\": \"lvalue\", \"b\": \"lvalue\"}\n    assert m.cast_rv_nested() == [[[{\"b\": \"rvalue\", \"c\": \"rvalue\"}], [{\"a\": \"rvalue\"}]]]\n    assert m.cast_lv_nested() == {\n        \"a\": [[[\"lvalue\", \"lvalue\"]], [[\"lvalue\", \"lvalue\"]]],\n        \"b\": [[[\"lvalue\", \"lvalue\"], [\"lvalue\", \"lvalue\"]]],\n    }\n\n    # Issue #853 test case:\n    z = m.cast_unique_ptr_vector()\n    assert z[0].value == 7 and z[1].value == 42\n\n\ndef test_move_out_container():\n    \"\"\"Properties use the `reference_internal` policy by default. If the underlying function\n    returns an rvalue, the policy is automatically changed to `move` to avoid referencing\n    a temporary. In case the return value is a container of user-defined types, the policy\n    also needs to be applied to the elements, not just the container.\"\"\"\n    c = m.MoveOutContainer()\n    moved_out_list = c.move_list\n    assert [x.value for x in moved_out_list] == [0, 1, 2]\n\n\n@pytest.mark.skipif(not hasattr(m, \"has_optional\"), reason=\"no <optional>\")\ndef test_optional():\n    assert m.double_or_zero(None) == 0\n    assert m.double_or_zero(42) == 84\n    pytest.raises(TypeError, m.double_or_zero, \"foo\")\n\n    assert m.half_or_none(0) is None\n    assert m.half_or_none(42) == 21\n    pytest.raises(TypeError, m.half_or_none, \"foo\")\n\n    assert m.test_nullopt() == 42\n    assert m.test_nullopt(None) == 42\n    assert m.test_nullopt(42) == 42\n    assert m.test_nullopt(43) == 43\n\n    assert m.test_no_assign() == 42\n    assert m.test_no_assign(None) == 42\n    assert m.test_no_assign(m.NoAssign(43)) == 43\n    pytest.raises(TypeError, m.test_no_assign, 43)\n\n    assert m.nodefer_none_optional(None)\n\n    holder = m.OptionalHolder()\n    mvalue = holder.member\n    assert mvalue.initialized\n    assert holder.member_initialized()\n\n    props = m.OptionalProperties()\n    assert int(props.access_by_ref) == 42\n    assert int(props.access_by_copy) == 42\n\n\n@pytest.mark.skipif(\n    not hasattr(m, \"has_exp_optional\"), reason=\"no <experimental/optional>\"\n)\ndef test_exp_optional():\n    assert m.double_or_zero_exp(None) == 0\n    assert m.double_or_zero_exp(42) == 84\n    pytest.raises(TypeError, m.double_or_zero_exp, \"foo\")\n\n    assert m.half_or_none_exp(0) is None\n    assert m.half_or_none_exp(42) == 21\n    pytest.raises(TypeError, m.half_or_none_exp, \"foo\")\n\n    assert m.test_nullopt_exp() == 42\n    assert m.test_nullopt_exp(None) == 42\n    assert m.test_nullopt_exp(42) == 42\n    assert m.test_nullopt_exp(43) == 43\n\n    assert m.test_no_assign_exp() == 42\n    assert m.test_no_assign_exp(None) == 42\n    assert m.test_no_assign_exp(m.NoAssign(43)) == 43\n    pytest.raises(TypeError, m.test_no_assign_exp, 43)\n\n    holder = m.OptionalExpHolder()\n    mvalue = holder.member\n    assert mvalue.initialized\n    assert holder.member_initialized()\n\n    props = m.OptionalExpProperties()\n    assert int(props.access_by_ref) == 42\n    assert int(props.access_by_copy) == 42\n\n\n@pytest.mark.skipif(not hasattr(m, \"has_boost_optional\"), reason=\"no <boost/optional>\")\ndef test_boost_optional():\n    assert m.double_or_zero_boost(None) == 0\n    assert m.double_or_zero_boost(42) == 84\n    pytest.raises(TypeError, m.double_or_zero_boost, \"foo\")\n\n    assert m.half_or_none_boost(0) is None\n    assert m.half_or_none_boost(42) == 21\n    pytest.raises(TypeError, m.half_or_none_boost, \"foo\")\n\n    assert m.test_nullopt_boost() == 42\n    assert m.test_nullopt_boost(None) == 42\n    assert m.test_nullopt_boost(42) == 42\n    assert m.test_nullopt_boost(43) == 43\n\n    assert m.test_no_assign_boost() == 42\n    assert m.test_no_assign_boost(None) == 42\n    assert m.test_no_assign_boost(m.NoAssign(43)) == 43\n    pytest.raises(TypeError, m.test_no_assign_boost, 43)\n\n    holder = m.OptionalBoostHolder()\n    mvalue = holder.member\n    assert mvalue.initialized\n    assert holder.member_initialized()\n\n    props = m.OptionalBoostProperties()\n    assert int(props.access_by_ref) == 42\n    assert int(props.access_by_copy) == 42\n\n\ndef test_reference_sensitive_optional():\n    assert m.double_or_zero_refsensitive(None) == 0\n    assert m.double_or_zero_refsensitive(42) == 84\n    pytest.raises(TypeError, m.double_or_zero_refsensitive, \"foo\")\n\n    assert m.half_or_none_refsensitive(0) is None\n    assert m.half_or_none_refsensitive(42) == 21\n    pytest.raises(TypeError, m.half_or_none_refsensitive, \"foo\")\n\n    assert m.test_nullopt_refsensitive() == 42\n    assert m.test_nullopt_refsensitive(None) == 42\n    assert m.test_nullopt_refsensitive(42) == 42\n    assert m.test_nullopt_refsensitive(43) == 43\n\n    assert m.test_no_assign_refsensitive() == 42\n    assert m.test_no_assign_refsensitive(None) == 42\n    assert m.test_no_assign_refsensitive(m.NoAssign(43)) == 43\n    pytest.raises(TypeError, m.test_no_assign_refsensitive, 43)\n\n    holder = m.OptionalRefSensitiveHolder()\n    mvalue = holder.member\n    assert mvalue.initialized\n    assert holder.member_initialized()\n\n    props = m.OptionalRefSensitiveProperties()\n    assert int(props.access_by_ref) == 42\n    assert int(props.access_by_copy) == 42\n\n\n@pytest.mark.skipif(not hasattr(m, \"has_filesystem\"), reason=\"no <filesystem>\")\ndef test_fs_path():\n    from pathlib import Path\n\n    class PseudoStrPath:\n        def __fspath__(self):\n            return \"foo/bar\"\n\n    class PseudoBytesPath:\n        def __fspath__(self):\n            return b\"foo/bar\"\n\n    assert m.parent_path(Path(\"foo/bar\")) == Path(\"foo\")\n    assert m.parent_path(\"foo/bar\") == Path(\"foo\")\n    assert m.parent_path(b\"foo/bar\") == Path(\"foo\")\n    assert m.parent_path(PseudoStrPath()) == Path(\"foo\")\n    assert m.parent_path(PseudoBytesPath()) == Path(\"foo\")\n\n\n@pytest.mark.skipif(not hasattr(m, \"load_variant\"), reason=\"no <variant>\")\ndef test_variant(doc):\n    assert m.load_variant(1) == \"int\"\n    assert m.load_variant(\"1\") == \"std::string\"\n    assert m.load_variant(1.0) == \"double\"\n    assert m.load_variant(None) == \"std::nullptr_t\"\n\n    assert m.load_variant_2pass(1) == \"int\"\n    assert m.load_variant_2pass(1.0) == \"double\"\n\n    assert m.cast_variant() == (5, \"Hello\")\n\n    assert (\n        doc(m.load_variant) == \"load_variant(arg0: Union[int, str, float, None]) -> str\"\n    )\n\n\n@pytest.mark.skipif(\n    not hasattr(m, \"load_monostate_variant\"), reason=\"no std::monostate\"\n)\ndef test_variant_monostate(doc):\n    assert m.load_monostate_variant(None) == \"std::monostate\"\n    assert m.load_monostate_variant(1) == \"int\"\n    assert m.load_monostate_variant(\"1\") == \"std::string\"\n\n    assert m.cast_monostate_variant() == (None, 5, \"Hello\")\n\n    assert (\n        doc(m.load_monostate_variant)\n        == \"load_monostate_variant(arg0: Union[None, int, str]) -> str\"\n    )\n\n\ndef test_vec_of_reference_wrapper():\n    \"\"\"#171: Can't return reference wrappers (or STL structures containing them)\"\"\"\n    assert (\n        str(m.return_vec_of_reference_wrapper(UserType(4)))\n        == \"[UserType(1), UserType(2), UserType(3), UserType(4)]\"\n    )\n\n\ndef test_stl_pass_by_pointer(msg):\n    \"\"\"Passing nullptr or None to an STL container pointer is not expected to work\"\"\"\n    with pytest.raises(TypeError) as excinfo:\n        m.stl_pass_by_pointer()  # default value is `nullptr`\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        stl_pass_by_pointer(): incompatible function arguments. The following argument types are supported:\n            1. (v: List[int] = None) -> List[int]\n\n        Invoked with:\n    \"\"\"\n    )\n\n    with pytest.raises(TypeError) as excinfo:\n        m.stl_pass_by_pointer(None)\n    assert (\n        msg(excinfo.value)\n        == \"\"\"\n        stl_pass_by_pointer(): incompatible function arguments. The following argument types are supported:\n            1. (v: List[int] = None) -> List[int]\n\n        Invoked with: None\n    \"\"\"\n    )\n\n    assert m.stl_pass_by_pointer([1, 2, 3]) == [1, 2, 3]\n\n\ndef test_missing_header_message():\n    \"\"\"Trying convert `list` to a `std::vector`, or vice versa, without including\n    <pybind11/stl.h> should result in a helpful suggestion in the error message\"\"\"\n    import pybind11_cross_module_tests as cm\n\n    expected_message = (\n        \"Did you forget to `#include <pybind11/stl.h>`? Or <pybind11/complex.h>,\\n\"\n        \"<pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic\\n\"\n        \"conversions are optional and require extra headers to be included\\n\"\n        \"when compiling your pybind11 module.\"\n    )\n\n    with pytest.raises(TypeError) as excinfo:\n        cm.missing_header_arg([1.0, 2.0, 3.0])\n    assert expected_message in str(excinfo.value)\n\n    with pytest.raises(TypeError) as excinfo:\n        cm.missing_header_return()\n    assert expected_message in str(excinfo.value)\n\n\ndef test_function_with_string_and_vector_string_arg():\n    \"\"\"Check if a string is NOT implicitly converted to a list, which was the\n    behavior before fix of issue #1258\"\"\"\n    assert m.func_with_string_or_vector_string_arg_overload((\"A\", \"B\")) == 2\n    assert m.func_with_string_or_vector_string_arg_overload([\"A\", \"B\"]) == 2\n    assert m.func_with_string_or_vector_string_arg_overload(\"A\") == 3\n\n\ndef test_stl_ownership():\n    cstats = ConstructorStats.get(m.Placeholder)\n    assert cstats.alive() == 0\n    r = m.test_stl_ownership()\n    assert len(r) == 1\n    del r\n    assert cstats.alive() == 0\n\n\ndef test_array_cast_sequence():\n    assert m.array_cast_sequence((1, 2, 3)) == [1, 2, 3]\n\n\ndef test_issue_1561():\n    \"\"\"check fix for issue #1561\"\"\"\n    bar = m.Issue1561Outer()\n    bar.list = [m.Issue1561Inner(\"bar\")]\n    bar.list\n    assert bar.list[0].data == \"bar\"\n\n\ndef test_return_vector_bool_raw_ptr():\n    # Add `while True:` for manual leak checking.\n    v = m.return_vector_bool_raw_ptr()\n    assert isinstance(v, list)\n    assert len(v) == 4513\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_stl_binders.cpp",
    "content": "/*\n    tests/test_stl_binders.cpp -- Usage of stl_binders functions\n\n    Copyright (c) 2016 Sergey Lyskov\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/numpy.h>\n#include <pybind11/stl_bind.h>\n\n#include \"pybind11_tests.h\"\n\n#include <deque>\n#include <map>\n#include <unordered_map>\n\nclass El {\npublic:\n    El() = delete;\n    explicit El(int v) : a(v) {}\n\n    int a;\n};\n\nstd::ostream &operator<<(std::ostream &s, El const &v) {\n    s << \"El{\" << v.a << '}';\n    return s;\n}\n\n/// Issue #487: binding std::vector<E> with E non-copyable\nclass E_nc {\npublic:\n    explicit E_nc(int i) : value{i} {}\n    E_nc(const E_nc &) = delete;\n    E_nc &operator=(const E_nc &) = delete;\n    E_nc(E_nc &&) = default;\n    E_nc &operator=(E_nc &&) = default;\n\n    int value;\n};\n\ntemplate <class Container>\nContainer *one_to_n(int n) {\n    auto *v = new Container();\n    for (int i = 1; i <= n; i++) {\n        v->emplace_back(i);\n    }\n    return v;\n}\n\ntemplate <class Map>\nMap *times_ten(int n) {\n    auto *m = new Map();\n    for (int i = 1; i <= n; i++) {\n        m->emplace(int(i), E_nc(10 * i));\n    }\n    return m;\n}\n\ntemplate <class NestMap>\nNestMap *times_hundred(int n) {\n    auto *m = new NestMap();\n    for (int i = 1; i <= n; i++) {\n        for (int j = 1; j <= n; j++) {\n            (*m)[i].emplace(int(j * 10), E_nc(100 * j));\n        }\n    }\n    return m;\n}\n\nTEST_SUBMODULE(stl_binders, m) {\n    // test_vector_int\n    py::bind_vector<std::vector<unsigned int>>(m, \"VectorInt\", py::buffer_protocol());\n\n    // test_vector_custom\n    py::class_<El>(m, \"El\").def(py::init<int>());\n    py::bind_vector<std::vector<El>>(m, \"VectorEl\");\n    py::bind_vector<std::vector<std::vector<El>>>(m, \"VectorVectorEl\");\n\n    // test_map_string_double\n    py::bind_map<std::map<std::string, double>>(m, \"MapStringDouble\");\n    py::bind_map<std::unordered_map<std::string, double>>(m, \"UnorderedMapStringDouble\");\n\n    // test_map_string_double_const\n    py::bind_map<std::map<std::string, double const>>(m, \"MapStringDoubleConst\");\n    py::bind_map<std::unordered_map<std::string, double const>>(m,\n                                                                \"UnorderedMapStringDoubleConst\");\n\n    py::class_<E_nc>(m, \"ENC\").def(py::init<int>()).def_readwrite(\"value\", &E_nc::value);\n\n    // test_noncopyable_containers\n    py::bind_vector<std::vector<E_nc>>(m, \"VectorENC\");\n    m.def(\"get_vnc\", &one_to_n<std::vector<E_nc>>);\n    py::bind_vector<std::deque<E_nc>>(m, \"DequeENC\");\n    m.def(\"get_dnc\", &one_to_n<std::deque<E_nc>>);\n    py::bind_map<std::map<int, E_nc>>(m, \"MapENC\");\n    m.def(\"get_mnc\", &times_ten<std::map<int, E_nc>>);\n    py::bind_map<std::unordered_map<int, E_nc>>(m, \"UmapENC\");\n    m.def(\"get_umnc\", &times_ten<std::unordered_map<int, E_nc>>);\n    // Issue #1885: binding nested std::map<X, Container<E>> with E non-copyable\n    py::bind_map<std::map<int, std::vector<E_nc>>>(m, \"MapVecENC\");\n    m.def(\"get_nvnc\", [](int n) {\n        auto *m = new std::map<int, std::vector<E_nc>>();\n        for (int i = 1; i <= n; i++) {\n            for (int j = 1; j <= n; j++) {\n                (*m)[i].emplace_back(j);\n            }\n        }\n        return m;\n    });\n    py::bind_map<std::map<int, std::map<int, E_nc>>>(m, \"MapMapENC\");\n    m.def(\"get_nmnc\", &times_hundred<std::map<int, std::map<int, E_nc>>>);\n    py::bind_map<std::unordered_map<int, std::unordered_map<int, E_nc>>>(m, \"UmapUmapENC\");\n    m.def(\"get_numnc\", &times_hundred<std::unordered_map<int, std::unordered_map<int, E_nc>>>);\n\n    // test_vector_buffer\n    py::bind_vector<std::vector<unsigned char>>(m, \"VectorUChar\", py::buffer_protocol());\n    // no dtype declared for this version:\n    struct VUndeclStruct {\n        bool w;\n        uint32_t x;\n        double y;\n        bool z;\n    };\n    m.def(\"create_undeclstruct\", [m]() mutable {\n        py::bind_vector<std::vector<VUndeclStruct>>(\n            m, \"VectorUndeclStruct\", py::buffer_protocol());\n    });\n\n    // The rest depends on numpy:\n    try {\n        py::module_::import(\"numpy\");\n    } catch (...) {\n        return;\n    }\n\n    // test_vector_buffer_numpy\n    struct VStruct {\n        bool w;\n        uint32_t x;\n        double y;\n        bool z;\n    };\n    PYBIND11_NUMPY_DTYPE(VStruct, w, x, y, z);\n    py::class_<VStruct>(m, \"VStruct\").def_readwrite(\"x\", &VStruct::x);\n    py::bind_vector<std::vector<VStruct>>(m, \"VectorStruct\", py::buffer_protocol());\n    m.def(\"get_vectorstruct\", [] {\n        return std::vector<VStruct>{{false, 5, 3.0, true}, {true, 30, -1e4, false}};\n    });\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_stl_binders.py",
    "content": "import pytest\n\nfrom pybind11_tests import stl_binders as m\n\n\ndef test_vector_int():\n    v_int = m.VectorInt([0, 0])\n    assert len(v_int) == 2\n    assert bool(v_int) is True\n\n    # test construction from a generator\n    v_int1 = m.VectorInt(x for x in range(5))\n    assert v_int1 == m.VectorInt([0, 1, 2, 3, 4])\n\n    v_int2 = m.VectorInt([0, 0])\n    assert v_int == v_int2\n    v_int2[1] = 1\n    assert v_int != v_int2\n\n    v_int2.append(2)\n    v_int2.insert(0, 1)\n    v_int2.insert(0, 2)\n    v_int2.insert(0, 3)\n    v_int2.insert(6, 3)\n    assert str(v_int2) == \"VectorInt[3, 2, 1, 0, 1, 2, 3]\"\n    with pytest.raises(IndexError):\n        v_int2.insert(8, 4)\n\n    v_int.append(99)\n    v_int2[2:-2] = v_int\n    assert v_int2 == m.VectorInt([3, 2, 0, 0, 99, 2, 3])\n    del v_int2[1:3]\n    assert v_int2 == m.VectorInt([3, 0, 99, 2, 3])\n    del v_int2[0]\n    assert v_int2 == m.VectorInt([0, 99, 2, 3])\n\n    v_int2.extend(m.VectorInt([4, 5]))\n    assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5])\n\n    v_int2.extend([6, 7])\n    assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5, 6, 7])\n\n    # test error handling, and that the vector is unchanged\n    with pytest.raises(RuntimeError):\n        v_int2.extend([8, \"a\"])\n\n    assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5, 6, 7])\n\n    # test extending from a generator\n    v_int2.extend(x for x in range(5))\n    assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4])\n\n    # test negative indexing\n    assert v_int2[-1] == 4\n\n    # insert with negative index\n    v_int2.insert(-1, 88)\n    assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 88, 4])\n\n    # delete negative index\n    del v_int2[-1]\n    assert v_int2 == m.VectorInt([0, 99, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 88])\n\n    v_int2.clear()\n    assert len(v_int2) == 0\n\n\n# Older PyPy's failed here, related to the PyPy's buffer protocol.\ndef test_vector_buffer():\n    b = bytearray([1, 2, 3, 4])\n    v = m.VectorUChar(b)\n    assert v[1] == 2\n    v[2] = 5\n    mv = memoryview(v)  # We expose the buffer interface\n    assert mv[2] == 5\n    mv[2] = 6\n    assert v[2] == 6\n\n    mv = memoryview(b)\n    v = m.VectorUChar(mv[::2])\n    assert v[1] == 3\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.create_undeclstruct()  # Undeclared struct contents, no buffer interface\n    assert \"NumPy type info missing for \" in str(excinfo.value)\n\n\ndef test_vector_buffer_numpy():\n    np = pytest.importorskip(\"numpy\")\n    a = np.array([1, 2, 3, 4], dtype=np.int32)\n    with pytest.raises(TypeError):\n        m.VectorInt(a)\n\n    a = np.array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]], dtype=np.uintc)\n    v = m.VectorInt(a[0, :])\n    assert len(v) == 4\n    assert v[2] == 3\n    ma = np.asarray(v)\n    ma[2] = 5\n    assert v[2] == 5\n\n    v = m.VectorInt(a[:, 1])\n    assert len(v) == 3\n    assert v[2] == 10\n\n    v = m.get_vectorstruct()\n    assert v[0].x == 5\n    ma = np.asarray(v)\n    ma[1][\"x\"] = 99\n    assert v[1].x == 99\n\n    v = m.VectorStruct(\n        np.zeros(\n            3,\n            dtype=np.dtype(\n                [(\"w\", \"bool\"), (\"x\", \"I\"), (\"y\", \"float64\"), (\"z\", \"bool\")], align=True\n            ),\n        )\n    )\n    assert len(v) == 3\n\n    b = np.array([1, 2, 3, 4], dtype=np.uint8)\n    v = m.VectorUChar(b[::2])\n    assert v[1] == 3\n\n\ndef test_vector_bool():\n    import pybind11_cross_module_tests as cm\n\n    vv_c = cm.VectorBool()\n    for i in range(10):\n        vv_c.append(i % 2 == 0)\n    for i in range(10):\n        assert vv_c[i] == (i % 2 == 0)\n    assert str(vv_c) == \"VectorBool[1, 0, 1, 0, 1, 0, 1, 0, 1, 0]\"\n\n\ndef test_vector_custom():\n    v_a = m.VectorEl()\n    v_a.append(m.El(1))\n    v_a.append(m.El(2))\n    assert str(v_a) == \"VectorEl[El{1}, El{2}]\"\n\n    vv_a = m.VectorVectorEl()\n    vv_a.append(v_a)\n    vv_b = vv_a[0]\n    assert str(vv_b) == \"VectorEl[El{1}, El{2}]\"\n\n\ndef test_map_string_double():\n    mm = m.MapStringDouble()\n    mm[\"a\"] = 1\n    mm[\"b\"] = 2.5\n\n    assert list(mm) == [\"a\", \"b\"]\n    assert str(mm) == \"MapStringDouble{a: 1, b: 2.5}\"\n    assert \"b\" in mm\n    assert \"c\" not in mm\n    assert 123 not in mm\n\n    # Check that keys, values, items are views, not merely iterable\n    keys = mm.keys()\n    values = mm.values()\n    items = mm.items()\n    assert list(keys) == [\"a\", \"b\"]\n    assert len(keys) == 2\n    assert \"a\" in keys\n    assert \"c\" not in keys\n    assert 123 not in keys\n    assert list(items) == [(\"a\", 1), (\"b\", 2.5)]\n    assert len(items) == 2\n    assert (\"b\", 2.5) in items\n    assert \"hello\" not in items\n    assert (\"b\", 2.5, None) not in items\n    assert list(values) == [1, 2.5]\n    assert len(values) == 2\n    assert 1 in values\n    assert 2 not in values\n    # Check that views update when the map is updated\n    mm[\"c\"] = -1\n    assert list(keys) == [\"a\", \"b\", \"c\"]\n    assert list(values) == [1, 2.5, -1]\n    assert list(items) == [(\"a\", 1), (\"b\", 2.5), (\"c\", -1)]\n\n    um = m.UnorderedMapStringDouble()\n    um[\"ua\"] = 1.1\n    um[\"ub\"] = 2.6\n\n    assert sorted(list(um)) == [\"ua\", \"ub\"]\n    assert list(um.keys()) == list(um)\n    assert sorted(list(um.items())) == [(\"ua\", 1.1), (\"ub\", 2.6)]\n    assert list(zip(um.keys(), um.values())) == list(um.items())\n    assert \"UnorderedMapStringDouble\" in str(um)\n\n\ndef test_map_string_double_const():\n    mc = m.MapStringDoubleConst()\n    mc[\"a\"] = 10\n    mc[\"b\"] = 20.5\n    assert str(mc) == \"MapStringDoubleConst{a: 10, b: 20.5}\"\n\n    umc = m.UnorderedMapStringDoubleConst()\n    umc[\"a\"] = 11\n    umc[\"b\"] = 21.5\n\n    str(umc)\n\n\ndef test_noncopyable_containers():\n    # std::vector\n    vnc = m.get_vnc(5)\n    for i in range(0, 5):\n        assert vnc[i].value == i + 1\n\n    for i, j in enumerate(vnc, start=1):\n        assert j.value == i\n\n    # std::deque\n    dnc = m.get_dnc(5)\n    for i in range(0, 5):\n        assert dnc[i].value == i + 1\n\n    i = 1\n    for j in dnc:\n        assert j.value == i\n        i += 1\n\n    # std::map\n    mnc = m.get_mnc(5)\n    for i in range(1, 6):\n        assert mnc[i].value == 10 * i\n\n    vsum = 0\n    for k, v in mnc.items():\n        assert v.value == 10 * k\n        vsum += v.value\n\n    assert vsum == 150\n\n    # std::unordered_map\n    mnc = m.get_umnc(5)\n    for i in range(1, 6):\n        assert mnc[i].value == 10 * i\n\n    vsum = 0\n    for k, v in mnc.items():\n        assert v.value == 10 * k\n        vsum += v.value\n\n    assert vsum == 150\n\n    # nested std::map<std::vector>\n    nvnc = m.get_nvnc(5)\n    for i in range(1, 6):\n        for j in range(0, 5):\n            assert nvnc[i][j].value == j + 1\n\n    # Note: maps do not have .values()\n    for _, v in nvnc.items():\n        for i, j in enumerate(v, start=1):\n            assert j.value == i\n\n    # nested std::map<std::map>\n    nmnc = m.get_nmnc(5)\n    for i in range(1, 6):\n        for j in range(10, 60, 10):\n            assert nmnc[i][j].value == 10 * j\n\n    vsum = 0\n    for _, v_o in nmnc.items():\n        for k_i, v_i in v_o.items():\n            assert v_i.value == 10 * k_i\n            vsum += v_i.value\n\n    assert vsum == 7500\n\n    # nested std::unordered_map<std::unordered_map>\n    numnc = m.get_numnc(5)\n    for i in range(1, 6):\n        for j in range(10, 60, 10):\n            assert numnc[i][j].value == 10 * j\n\n    vsum = 0\n    for _, v_o in numnc.items():\n        for k_i, v_i in v_o.items():\n            assert v_i.value == 10 * k_i\n            vsum += v_i.value\n\n    assert vsum == 7500\n\n\ndef test_map_delitem():\n    mm = m.MapStringDouble()\n    mm[\"a\"] = 1\n    mm[\"b\"] = 2.5\n\n    assert list(mm) == [\"a\", \"b\"]\n    assert list(mm.items()) == [(\"a\", 1), (\"b\", 2.5)]\n    del mm[\"a\"]\n    assert list(mm) == [\"b\"]\n    assert list(mm.items()) == [(\"b\", 2.5)]\n\n    um = m.UnorderedMapStringDouble()\n    um[\"ua\"] = 1.1\n    um[\"ub\"] = 2.6\n\n    assert sorted(list(um)) == [\"ua\", \"ub\"]\n    assert sorted(list(um.items())) == [(\"ua\", 1.1), (\"ub\", 2.6)]\n    del um[\"ua\"]\n    assert sorted(list(um)) == [\"ub\"]\n    assert sorted(list(um.items())) == [(\"ub\", 2.6)]\n\n\ndef test_map_view_types():\n    map_string_double = m.MapStringDouble()\n    unordered_map_string_double = m.UnorderedMapStringDouble()\n    map_string_double_const = m.MapStringDoubleConst()\n    unordered_map_string_double_const = m.UnorderedMapStringDoubleConst()\n\n    assert map_string_double.keys().__class__.__name__ == \"KeysView[str]\"\n    assert map_string_double.values().__class__.__name__ == \"ValuesView[float]\"\n    assert map_string_double.items().__class__.__name__ == \"ItemsView[str, float]\"\n\n    keys_type = type(map_string_double.keys())\n    assert type(unordered_map_string_double.keys()) is keys_type\n    assert type(map_string_double_const.keys()) is keys_type\n    assert type(unordered_map_string_double_const.keys()) is keys_type\n\n    values_type = type(map_string_double.values())\n    assert type(unordered_map_string_double.values()) is values_type\n    assert type(map_string_double_const.values()) is values_type\n    assert type(unordered_map_string_double_const.values()) is values_type\n\n    items_type = type(map_string_double.items())\n    assert type(unordered_map_string_double.items()) is items_type\n    assert type(map_string_double_const.items()) is items_type\n    assert type(unordered_map_string_double_const.items()) is items_type\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_tagbased_polymorphic.cpp",
    "content": "/*\n    tests/test_tagbased_polymorphic.cpp -- test of polymorphic_type_hook\n\n    Copyright (c) 2018 Hudson River Trading LLC <opensource@hudson-trading.com>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/stl.h>\n\n#include \"pybind11_tests.h\"\n\nstruct Animal {\n    // Make this type also a \"standard\" polymorphic type, to confirm that\n    // specializing polymorphic_type_hook using enable_if_t still works\n    // (https://github.com/pybind/pybind11/pull/2016/).\n    virtual ~Animal() = default;\n\n    // Enum for tag-based polymorphism.\n    enum class Kind {\n        Unknown = 0,\n        Dog = 100,\n        Labrador,\n        Chihuahua,\n        LastDog = 199,\n        Cat = 200,\n        Panther,\n        LastCat = 299\n    };\n    static const std::type_info *type_of_kind(Kind kind);\n    static std::string name_of_kind(Kind kind);\n\n    const Kind kind;\n    const std::string name;\n\nprotected:\n    Animal(const std::string &_name, Kind _kind) : kind(_kind), name(_name) {}\n};\n\nstruct Dog : Animal {\n    explicit Dog(const std::string &_name, Kind _kind = Kind::Dog) : Animal(_name, _kind) {}\n    std::string bark() const { return name_of_kind(kind) + \" \" + name + \" goes \" + sound; }\n    std::string sound = \"WOOF!\";\n};\n\nstruct Labrador : Dog {\n    explicit Labrador(const std::string &_name, int _excitement = 9001)\n        : Dog(_name, Kind::Labrador), excitement(_excitement) {}\n    int excitement;\n};\n\nstruct Chihuahua : Dog {\n    explicit Chihuahua(const std::string &_name) : Dog(_name, Kind::Chihuahua) {\n        sound = \"iyiyiyiyiyi\";\n    }\n    std::string bark() const { return Dog::bark() + \" and runs in circles\"; }\n};\n\nstruct Cat : Animal {\n    explicit Cat(const std::string &_name, Kind _kind = Kind::Cat) : Animal(_name, _kind) {}\n    std::string purr() const { return \"mrowr\"; }\n};\n\nstruct Panther : Cat {\n    explicit Panther(const std::string &_name) : Cat(_name, Kind::Panther) {}\n    std::string purr() const { return \"mrrrRRRRRR\"; }\n};\n\nstd::vector<std::unique_ptr<Animal>> create_zoo() {\n    std::vector<std::unique_ptr<Animal>> ret;\n    ret.emplace_back(new Labrador(\"Fido\", 15000));\n\n    // simulate some new type of Dog that the Python bindings\n    // haven't been updated for; it should still be considered\n    // a Dog, not just an Animal.\n    ret.emplace_back(new Dog(\"Ginger\", Dog::Kind(150)));\n\n    ret.emplace_back(new Chihuahua(\"Hertzl\"));\n    ret.emplace_back(new Cat(\"Tiger\", Cat::Kind::Cat));\n    ret.emplace_back(new Panther(\"Leo\"));\n    return ret;\n}\n\nconst std::type_info *Animal::type_of_kind(Kind kind) {\n    switch (kind) {\n        case Kind::Unknown:\n        case Kind::Dog:\n            break;\n\n        case Kind::Labrador:\n            return &typeid(Labrador);\n        case Kind::Chihuahua:\n            return &typeid(Chihuahua);\n\n        case Kind::LastDog:\n        case Kind::Cat:\n            break;\n        case Kind::Panther:\n            return &typeid(Panther);\n        case Kind::LastCat:\n            break;\n    }\n\n    if (kind >= Kind::Dog && kind <= Kind::LastDog) {\n        return &typeid(Dog);\n    }\n    if (kind >= Kind::Cat && kind <= Kind::LastCat) {\n        return &typeid(Cat);\n    }\n    return nullptr;\n}\n\nstd::string Animal::name_of_kind(Kind kind) {\n    std::string raw_name = type_of_kind(kind)->name();\n    py::detail::clean_type_id(raw_name);\n    return raw_name;\n}\n\nnamespace PYBIND11_NAMESPACE {\ntemplate <typename itype>\nstruct polymorphic_type_hook<itype, detail::enable_if_t<std::is_base_of<Animal, itype>::value>> {\n    static const void *get(const itype *src, const std::type_info *&type) {\n        type = src ? Animal::type_of_kind(src->kind) : nullptr;\n        return src;\n    }\n};\n} // namespace PYBIND11_NAMESPACE\n\nTEST_SUBMODULE(tagbased_polymorphic, m) {\n    py::class_<Animal>(m, \"Animal\").def_readonly(\"name\", &Animal::name);\n    py::class_<Dog, Animal>(m, \"Dog\")\n        .def(py::init<std::string>())\n        .def_readwrite(\"sound\", &Dog::sound)\n        .def(\"bark\", &Dog::bark);\n    py::class_<Labrador, Dog>(m, \"Labrador\")\n        .def(py::init<std::string, int>(), \"name\"_a, \"excitement\"_a = 9001)\n        .def_readwrite(\"excitement\", &Labrador::excitement);\n    py::class_<Chihuahua, Dog>(m, \"Chihuahua\")\n        .def(py::init<std::string>())\n        .def(\"bark\", &Chihuahua::bark);\n    py::class_<Cat, Animal>(m, \"Cat\").def(py::init<std::string>()).def(\"purr\", &Cat::purr);\n    py::class_<Panther, Cat>(m, \"Panther\")\n        .def(py::init<std::string>())\n        .def(\"purr\", &Panther::purr);\n    m.def(\"create_zoo\", &create_zoo);\n};\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_tagbased_polymorphic.py",
    "content": "from pybind11_tests import tagbased_polymorphic as m\n\n\ndef test_downcast():\n    zoo = m.create_zoo()\n    assert [type(animal) for animal in zoo] == [\n        m.Labrador,\n        m.Dog,\n        m.Chihuahua,\n        m.Cat,\n        m.Panther,\n    ]\n    assert [animal.name for animal in zoo] == [\n        \"Fido\",\n        \"Ginger\",\n        \"Hertzl\",\n        \"Tiger\",\n        \"Leo\",\n    ]\n    zoo[1].sound = \"woooooo\"\n    assert [dog.bark() for dog in zoo[:3]] == [\n        \"Labrador Fido goes WOOF!\",\n        \"Dog Ginger goes woooooo\",\n        \"Chihuahua Hertzl goes iyiyiyiyiyi and runs in circles\",\n    ]\n    assert [cat.purr() for cat in zoo[3:]] == [\"mrowr\", \"mrrrRRRRRR\"]\n    zoo[0].excitement -= 1000\n    assert zoo[0].excitement == 14000\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_thread.cpp",
    "content": "/*\n    tests/test_thread.cpp -- call pybind11 bound methods in threads\n\n    Copyright (c) 2021 Laramie Leavitt (Google LLC) <lar@google.com>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/cast.h>\n#include <pybind11/pybind11.h>\n\n#include \"pybind11_tests.h\"\n\n#include <chrono>\n#include <thread>\n\nnamespace py = pybind11;\n\nnamespace {\n\nstruct IntStruct {\n    explicit IntStruct(int v) : value(v){};\n    ~IntStruct() { value = -value; }\n    IntStruct(const IntStruct &) = default;\n    IntStruct &operator=(const IntStruct &) = default;\n\n    int value;\n};\n\n} // namespace\n\nTEST_SUBMODULE(thread, m) {\n\n    py::class_<IntStruct>(m, \"IntStruct\").def(py::init([](const int i) { return IntStruct(i); }));\n\n    // implicitly_convertible uses loader_life_support when an implicit\n    // conversion is required in order to lifetime extend the reference.\n    //\n    // This test should be run with ASAN for better effectiveness.\n    py::implicitly_convertible<int, IntStruct>();\n\n    m.def(\"test\", [](int expected, const IntStruct &in) {\n        {\n            py::gil_scoped_release release;\n            std::this_thread::sleep_for(std::chrono::milliseconds(5));\n        }\n\n        if (in.value != expected) {\n            throw std::runtime_error(\"Value changed!!\");\n        }\n    });\n\n    m.def(\n        \"test_no_gil\",\n        [](int expected, const IntStruct &in) {\n            std::this_thread::sleep_for(std::chrono::milliseconds(5));\n            if (in.value != expected) {\n                throw std::runtime_error(\"Value changed!!\");\n            }\n        },\n        py::call_guard<py::gil_scoped_release>());\n\n    // NOTE: std::string_view also uses loader_life_support to ensure that\n    // the string contents remain alive, but that's a C++ 17 feature.\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_thread.py",
    "content": "import threading\n\nfrom pybind11_tests import thread as m\n\n\nclass Thread(threading.Thread):\n    def __init__(self, fn):\n        super().__init__()\n        self.fn = fn\n        self.e = None\n\n    def run(self):\n        try:\n            for i in range(10):\n                self.fn(i, i)\n        except Exception as e:\n            self.e = e\n\n    def join(self):\n        super().join()\n        if self.e:\n            raise self.e\n\n\ndef test_implicit_conversion():\n    a = Thread(m.test)\n    b = Thread(m.test)\n    c = Thread(m.test)\n    for x in [a, b, c]:\n        x.start()\n    for x in [c, b, a]:\n        x.join()\n\n\ndef test_implicit_conversion_no_gil():\n    a = Thread(m.test_no_gil)\n    b = Thread(m.test_no_gil)\n    c = Thread(m.test_no_gil)\n    for x in [a, b, c]:\n        x.start()\n    for x in [c, b, a]:\n        x.join()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_union.cpp",
    "content": "/*\n    tests/test_class.cpp -- test py::class_ definitions and basic functionality\n\n    Copyright (c) 2019 Roland Dreier <roland.dreier@gmail.com>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include \"pybind11_tests.h\"\n\nTEST_SUBMODULE(union_, m) {\n    union TestUnion {\n        int value_int;\n        unsigned value_uint;\n    };\n\n    py::class_<TestUnion>(m, \"TestUnion\")\n        .def(py::init<>())\n        .def_readonly(\"as_int\", &TestUnion::value_int)\n        .def_readwrite(\"as_uint\", &TestUnion::value_uint);\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_union.py",
    "content": "from pybind11_tests import union_ as m\n\n\ndef test_union():\n    instance = m.TestUnion()\n\n    instance.as_uint = 10\n    assert instance.as_int == 10\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_virtual_functions.cpp",
    "content": "/*\n    tests/test_virtual_functions.cpp -- overriding virtual functions from Python\n\n    Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>\n\n    All rights reserved. Use of this source code is governed by a\n    BSD-style license that can be found in the LICENSE file.\n*/\n\n#include <pybind11/functional.h>\n\n#include \"constructor_stats.h\"\n#include \"pybind11_tests.h\"\n\n#include <thread>\n\n/* This is an example class that we'll want to be able to extend from Python */\nclass ExampleVirt {\npublic:\n    explicit ExampleVirt(int state) : state(state) { print_created(this, state); }\n    ExampleVirt(const ExampleVirt &e) : state(e.state) { print_copy_created(this); }\n    ExampleVirt(ExampleVirt &&e) noexcept : state(e.state) {\n        print_move_created(this);\n        e.state = 0;\n    }\n    virtual ~ExampleVirt() { print_destroyed(this); }\n\n    virtual int run(int value) {\n        py::print(\"Original implementation of \"\n                  \"ExampleVirt::run(state={}, value={}, str1={}, str2={})\"_s.format(\n                      state, value, get_string1(), *get_string2()));\n        return state + value;\n    }\n\n    virtual bool run_bool() = 0;\n    virtual void pure_virtual() = 0;\n\n    // Returning a reference/pointer to a type converted from python (numbers, strings, etc.) is a\n    // bit trickier, because the actual int& or std::string& or whatever only exists temporarily,\n    // so we have to handle it specially in the trampoline class (see below).\n    virtual const std::string &get_string1() { return str1; }\n    virtual const std::string *get_string2() { return &str2; }\n\nprivate:\n    int state;\n    const std::string str1{\"default1\"}, str2{\"default2\"};\n};\n\n/* This is a wrapper class that must be generated */\nclass PyExampleVirt : public ExampleVirt {\npublic:\n    using ExampleVirt::ExampleVirt; /* Inherit constructors */\n\n    int run(int value) override {\n        /* Generate wrapping code that enables native function overloading */\n        PYBIND11_OVERRIDE(int,         /* Return type */\n                          ExampleVirt, /* Parent class */\n                          run,         /* Name of function */\n                          value        /* Argument(s) */\n        );\n    }\n\n    bool run_bool() override {\n        PYBIND11_OVERRIDE_PURE(bool,        /* Return type */\n                               ExampleVirt, /* Parent class */\n                               run_bool,    /* Name of function */\n                                            /* This function has no arguments. The trailing comma\n                                               in the previous line is needed for some compilers */\n        );\n    }\n\n    void pure_virtual() override {\n        PYBIND11_OVERRIDE_PURE(void,         /* Return type */\n                               ExampleVirt,  /* Parent class */\n                               pure_virtual, /* Name of function */\n                                             /* This function has no arguments. The trailing comma\n                                                in the previous line is needed for some compilers */\n        );\n    }\n\n    // We can return reference types for compatibility with C++ virtual interfaces that do so, but\n    // note they have some significant limitations (see the documentation).\n    const std::string &get_string1() override {\n        PYBIND11_OVERRIDE(const std::string &, /* Return type */\n                          ExampleVirt,         /* Parent class */\n                          get_string1,         /* Name of function */\n                                               /* (no arguments) */\n        );\n    }\n\n    const std::string *get_string2() override {\n        PYBIND11_OVERRIDE(const std::string *, /* Return type */\n                          ExampleVirt,         /* Parent class */\n                          get_string2,         /* Name of function */\n                                               /* (no arguments) */\n        );\n    }\n};\n\nclass NonCopyable {\npublic:\n    NonCopyable(int a, int b) : value{new int(a * b)} { print_created(this, a, b); }\n    NonCopyable(NonCopyable &&o) noexcept : value{std::move(o.value)} { print_move_created(this); }\n    NonCopyable(const NonCopyable &) = delete;\n    NonCopyable() = delete;\n    void operator=(const NonCopyable &) = delete;\n    void operator=(NonCopyable &&) = delete;\n    std::string get_value() const {\n        if (value) {\n            return std::to_string(*value);\n        }\n        return \"(null)\";\n    }\n    ~NonCopyable() { print_destroyed(this); }\n\nprivate:\n    std::unique_ptr<int> value;\n};\n\n// This is like the above, but is both copy and movable.  In effect this means it should get moved\n// when it is not referenced elsewhere, but copied if it is still referenced.\nclass Movable {\npublic:\n    Movable(int a, int b) : value{a + b} { print_created(this, a, b); }\n    Movable(const Movable &m) : value{m.value} { print_copy_created(this); }\n    Movable(Movable &&m) noexcept : value{m.value} { print_move_created(this); }\n    std::string get_value() const { return std::to_string(value); }\n    ~Movable() { print_destroyed(this); }\n\nprivate:\n    int value;\n};\n\nclass NCVirt {\npublic:\n    virtual ~NCVirt() = default;\n    NCVirt() = default;\n    NCVirt(const NCVirt &) = delete;\n    virtual NonCopyable get_noncopyable(int a, int b) { return NonCopyable(a, b); }\n    virtual Movable get_movable(int a, int b) = 0;\n\n    std::string print_nc(int a, int b) { return get_noncopyable(a, b).get_value(); }\n    std::string print_movable(int a, int b) { return get_movable(a, b).get_value(); }\n};\nclass NCVirtTrampoline : public NCVirt {\n#if !defined(__INTEL_COMPILER) && !defined(__CUDACC__) && !defined(__PGIC__)\n    NonCopyable get_noncopyable(int a, int b) override {\n        PYBIND11_OVERRIDE(NonCopyable, NCVirt, get_noncopyable, a, b);\n    }\n#endif\n    Movable get_movable(int a, int b) override {\n        PYBIND11_OVERRIDE_PURE(Movable, NCVirt, get_movable, a, b);\n    }\n};\n\nstruct Base {\n    virtual std::string dispatch() const = 0;\n    virtual ~Base() = default;\n    Base() = default;\n    Base(const Base &) = delete;\n};\n\nstruct DispatchIssue : Base {\n    std::string dispatch() const override {\n        PYBIND11_OVERRIDE_PURE(std::string, Base, dispatch, /* no arguments */);\n    }\n};\n\n// An abstract adder class that uses visitor pattern to add two data\n// objects and send the result to the visitor functor\nstruct AdderBase {\n    struct Data {};\n    using DataVisitor = std::function<void(const Data &)>;\n\n    virtual void\n    operator()(const Data &first, const Data &second, const DataVisitor &visitor) const\n        = 0;\n    virtual ~AdderBase() = default;\n    AdderBase() = default;\n    AdderBase(const AdderBase &) = delete;\n};\n\nstruct Adder : AdderBase {\n    void\n    operator()(const Data &first, const Data &second, const DataVisitor &visitor) const override {\n        PYBIND11_OVERRIDE_PURE_NAME(\n            void, AdderBase, \"__call__\", operator(), first, second, visitor);\n    }\n};\n\nstatic void test_gil() {\n    {\n        py::gil_scoped_acquire lock;\n        py::print(\"1st lock acquired\");\n    }\n\n    {\n        py::gil_scoped_acquire lock;\n        py::print(\"2nd lock acquired\");\n    }\n}\n\nstatic void test_gil_from_thread() {\n    py::gil_scoped_release release;\n\n    std::thread t(test_gil);\n    t.join();\n}\n\nclass test_override_cache_helper {\n\npublic:\n    virtual int func() { return 0; }\n\n    test_override_cache_helper() = default;\n    virtual ~test_override_cache_helper() = default;\n    // Non-copyable\n    test_override_cache_helper &operator=(test_override_cache_helper const &Right) = delete;\n    test_override_cache_helper(test_override_cache_helper const &Copy) = delete;\n};\n\nclass test_override_cache_helper_trampoline : public test_override_cache_helper {\n    int func() override { PYBIND11_OVERRIDE(int, test_override_cache_helper, func); }\n};\n\ninline int test_override_cache(std::shared_ptr<test_override_cache_helper> const &instance) {\n    return instance->func();\n}\n\n// Forward declaration (so that we can put the main tests here; the inherited virtual approaches\n// are rather long).\nvoid initialize_inherited_virtuals(py::module_ &m);\n\nTEST_SUBMODULE(virtual_functions, m) {\n    // test_override\n    py::class_<ExampleVirt, PyExampleVirt>(m, \"ExampleVirt\")\n        .def(py::init<int>())\n        /* Reference original class in function definitions */\n        .def(\"run\", &ExampleVirt::run)\n        .def(\"run_bool\", &ExampleVirt::run_bool)\n        .def(\"pure_virtual\", &ExampleVirt::pure_virtual);\n\n    py::class_<NonCopyable>(m, \"NonCopyable\").def(py::init<int, int>());\n\n    py::class_<Movable>(m, \"Movable\").def(py::init<int, int>());\n\n    // test_move_support\n#if !defined(__INTEL_COMPILER) && !defined(__CUDACC__) && !defined(__PGIC__)\n    py::class_<NCVirt, NCVirtTrampoline>(m, \"NCVirt\")\n        .def(py::init<>())\n        .def(\"get_noncopyable\", &NCVirt::get_noncopyable)\n        .def(\"get_movable\", &NCVirt::get_movable)\n        .def(\"print_nc\", &NCVirt::print_nc)\n        .def(\"print_movable\", &NCVirt::print_movable);\n#endif\n\n    m.def(\"runExampleVirt\", [](ExampleVirt *ex, int value) { return ex->run(value); });\n    m.def(\"runExampleVirtBool\", [](ExampleVirt *ex) { return ex->run_bool(); });\n    m.def(\"runExampleVirtVirtual\", [](ExampleVirt *ex) { ex->pure_virtual(); });\n\n    m.def(\"cstats_debug\", &ConstructorStats::get<ExampleVirt>);\n    initialize_inherited_virtuals(m);\n\n    // test_alias_delay_initialization1\n    // don't invoke Python dispatch classes by default when instantiating C++ classes\n    // that were not extended on the Python side\n    struct A {\n        A() = default;\n        A(const A &) = delete;\n        virtual ~A() = default;\n        virtual void f() { py::print(\"A.f()\"); }\n    };\n\n    struct PyA : A {\n        PyA() { py::print(\"PyA.PyA()\"); }\n        PyA(const PyA &) = delete;\n        ~PyA() override { py::print(\"PyA.~PyA()\"); }\n\n        void f() override {\n            py::print(\"PyA.f()\");\n            // This convolution just gives a `void`, but tests that PYBIND11_TYPE() works to\n            // protect a type containing a ,\n            PYBIND11_OVERRIDE(PYBIND11_TYPE(typename std::enable_if<true, void>::type), A, f);\n        }\n    };\n\n    py::class_<A, PyA>(m, \"A\").def(py::init<>()).def(\"f\", &A::f);\n\n    m.def(\"call_f\", [](A *a) { a->f(); });\n\n    // test_alias_delay_initialization2\n    // ... unless we explicitly request it, as in this example:\n    struct A2 {\n        A2() = default;\n        A2(const A2 &) = delete;\n        virtual ~A2() = default;\n        virtual void f() { py::print(\"A2.f()\"); }\n    };\n\n    struct PyA2 : A2 {\n        PyA2() { py::print(\"PyA2.PyA2()\"); }\n        PyA2(const PyA2 &) = delete;\n        ~PyA2() override { py::print(\"PyA2.~PyA2()\"); }\n        void f() override {\n            py::print(\"PyA2.f()\");\n            PYBIND11_OVERRIDE(void, A2, f);\n        }\n    };\n\n    py::class_<A2, PyA2>(m, \"A2\")\n        .def(py::init_alias<>())\n        .def(py::init([](int) { return new PyA2(); }))\n        .def(\"f\", &A2::f);\n\n    m.def(\"call_f\", [](A2 *a2) { a2->f(); });\n\n    // test_dispatch_issue\n    // #159: virtual function dispatch has problems with similar-named functions\n    py::class_<Base, DispatchIssue>(m, \"DispatchIssue\")\n        .def(py::init<>())\n        .def(\"dispatch\", &Base::dispatch);\n\n    m.def(\"dispatch_issue_go\", [](const Base *b) { return b->dispatch(); });\n\n    // test_recursive_dispatch_issue\n    // #3357: Recursive dispatch fails to find python function override\n    pybind11::class_<AdderBase, Adder>(m, \"Adder\")\n        .def(pybind11::init<>())\n        .def(\"__call__\", &AdderBase::operator());\n\n    pybind11::class_<AdderBase::Data>(m, \"Data\").def(pybind11::init<>());\n\n    m.def(\"add2\",\n          [](const AdderBase::Data &first,\n             const AdderBase::Data &second,\n             const AdderBase &adder,\n             const AdderBase::DataVisitor &visitor) { adder(first, second, visitor); });\n\n    m.def(\"add3\",\n          [](const AdderBase::Data &first,\n             const AdderBase::Data &second,\n             const AdderBase::Data &third,\n             const AdderBase &adder,\n             const AdderBase::DataVisitor &visitor) {\n              adder(first, second, [&](const AdderBase::Data &first_plus_second) {\n                  // NOLINTNEXTLINE(readability-suspicious-call-argument)\n                  adder(first_plus_second, third, visitor);\n              });\n          });\n\n    // test_override_ref\n    // #392/397: overriding reference-returning functions\n    class OverrideTest {\n    public:\n        struct A {\n            std::string value = \"hi\";\n        };\n        std::string v;\n        A a;\n        explicit OverrideTest(const std::string &v) : v{v} {}\n        OverrideTest() = default;\n        OverrideTest(const OverrideTest &) = delete;\n        virtual std::string str_value() { return v; }\n        virtual std::string &str_ref() { return v; }\n        virtual A A_value() { return a; }\n        virtual A &A_ref() { return a; }\n        virtual ~OverrideTest() = default;\n    };\n\n    class PyOverrideTest : public OverrideTest {\n    public:\n        using OverrideTest::OverrideTest;\n        std::string str_value() override {\n            PYBIND11_OVERRIDE(std::string, OverrideTest, str_value);\n        }\n        // Not allowed (enabling the below should hit a static_assert failure): we can't get a\n        // reference to a python numeric value, since we only copy values in the numeric type\n        // caster:\n#ifdef PYBIND11_NEVER_DEFINED_EVER\n        std::string &str_ref() override {\n            PYBIND11_OVERRIDE(std::string &, OverrideTest, str_ref);\n        }\n#endif\n        // But we can work around it like this:\n    private:\n        std::string _tmp;\n        std::string str_ref_helper() { PYBIND11_OVERRIDE(std::string, OverrideTest, str_ref); }\n\n    public:\n        std::string &str_ref() override { return _tmp = str_ref_helper(); }\n\n        A A_value() override { PYBIND11_OVERRIDE(A, OverrideTest, A_value); }\n        A &A_ref() override { PYBIND11_OVERRIDE(A &, OverrideTest, A_ref); }\n    };\n\n    py::class_<OverrideTest::A>(m, \"OverrideTest_A\")\n        .def_readwrite(\"value\", &OverrideTest::A::value);\n    py::class_<OverrideTest, PyOverrideTest>(m, \"OverrideTest\")\n        .def(py::init<const std::string &>())\n        .def(\"str_value\", &OverrideTest::str_value)\n#ifdef PYBIND11_NEVER_DEFINED_EVER\n        .def(\"str_ref\", &OverrideTest::str_ref)\n#endif\n        .def(\"A_value\", &OverrideTest::A_value)\n        .def(\"A_ref\", &OverrideTest::A_ref);\n\n    py::class_<test_override_cache_helper,\n               test_override_cache_helper_trampoline,\n               std::shared_ptr<test_override_cache_helper>>(m, \"test_override_cache_helper\")\n        .def(py::init_alias<>())\n        .def(\"func\", &test_override_cache_helper::func);\n\n    m.def(\"test_override_cache\", test_override_cache);\n}\n\n// Inheriting virtual methods.  We do two versions here: the repeat-everything version and the\n// templated trampoline versions mentioned in docs/advanced.rst.\n//\n// These base classes are exactly the same, but we technically need distinct\n// classes for this example code because we need to be able to bind them\n// properly (pybind11, sensibly, doesn't allow us to bind the same C++ class to\n// multiple python classes).\nclass A_Repeat {\n#define A_METHODS                                                                                 \\\npublic:                                                                                           \\\n    virtual int unlucky_number() = 0;                                                             \\\n    virtual std::string say_something(unsigned times) {                                           \\\n        std::string s = \"\";                                                                       \\\n        for (unsigned i = 0; i < times; ++i)                                                      \\\n            s += \"hi\";                                                                            \\\n        return s;                                                                                 \\\n    }                                                                                             \\\n    std::string say_everything() {                                                                \\\n        return say_something(1) + \" \" + std::to_string(unlucky_number());                         \\\n    }\n    A_METHODS\n    A_Repeat() = default;\n    A_Repeat(const A_Repeat &) = delete;\n    virtual ~A_Repeat() = default;\n};\nclass B_Repeat : public A_Repeat {\n#define B_METHODS                                                                                 \\\npublic:                                                                                           \\\n    int unlucky_number() override { return 13; }                                                  \\\n    std::string say_something(unsigned times) override {                                          \\\n        return \"B says hi \" + std::to_string(times) + \" times\";                                   \\\n    }                                                                                             \\\n    virtual double lucky_number() { return 7.0; }\n    B_METHODS\n};\nclass C_Repeat : public B_Repeat {\n#define C_METHODS                                                                                 \\\npublic:                                                                                           \\\n    int unlucky_number() override { return 4444; }                                                \\\n    double lucky_number() override { return 888; }\n    C_METHODS\n};\nclass D_Repeat : public C_Repeat {\n#define D_METHODS // Nothing overridden.\n    D_METHODS\n};\n\n// Base classes for templated inheritance trampolines.  Identical to the repeat-everything version:\nclass A_Tpl {\n    A_METHODS;\n    A_Tpl() = default;\n    A_Tpl(const A_Tpl &) = delete;\n    virtual ~A_Tpl() = default;\n};\nclass B_Tpl : public A_Tpl {\n    B_METHODS\n};\nclass C_Tpl : public B_Tpl {\n    C_METHODS\n};\nclass D_Tpl : public C_Tpl {\n    D_METHODS\n};\n\n// Inheritance approach 1: each trampoline gets every virtual method (11 in total)\nclass PyA_Repeat : public A_Repeat {\npublic:\n    using A_Repeat::A_Repeat;\n    int unlucky_number() override { PYBIND11_OVERRIDE_PURE(int, A_Repeat, unlucky_number, ); }\n    std::string say_something(unsigned times) override {\n        PYBIND11_OVERRIDE(std::string, A_Repeat, say_something, times);\n    }\n};\nclass PyB_Repeat : public B_Repeat {\npublic:\n    using B_Repeat::B_Repeat;\n    int unlucky_number() override { PYBIND11_OVERRIDE(int, B_Repeat, unlucky_number, ); }\n    std::string say_something(unsigned times) override {\n        PYBIND11_OVERRIDE(std::string, B_Repeat, say_something, times);\n    }\n    double lucky_number() override { PYBIND11_OVERRIDE(double, B_Repeat, lucky_number, ); }\n};\nclass PyC_Repeat : public C_Repeat {\npublic:\n    using C_Repeat::C_Repeat;\n    int unlucky_number() override { PYBIND11_OVERRIDE(int, C_Repeat, unlucky_number, ); }\n    std::string say_something(unsigned times) override {\n        PYBIND11_OVERRIDE(std::string, C_Repeat, say_something, times);\n    }\n    double lucky_number() override { PYBIND11_OVERRIDE(double, C_Repeat, lucky_number, ); }\n};\nclass PyD_Repeat : public D_Repeat {\npublic:\n    using D_Repeat::D_Repeat;\n    int unlucky_number() override { PYBIND11_OVERRIDE(int, D_Repeat, unlucky_number, ); }\n    std::string say_something(unsigned times) override {\n        PYBIND11_OVERRIDE(std::string, D_Repeat, say_something, times);\n    }\n    double lucky_number() override { PYBIND11_OVERRIDE(double, D_Repeat, lucky_number, ); }\n};\n\n// Inheritance approach 2: templated trampoline classes.\n//\n// Advantages:\n// - we have only 2 (template) class and 4 method declarations (one per virtual method, plus one\n//   for any override of a pure virtual method), versus 4 classes and 6 methods (MI) or 4 classes\n//   and 11 methods (repeat).\n// - Compared to MI, we also don't have to change the non-trampoline inheritance to virtual, and\n//   can properly inherit constructors.\n//\n// Disadvantage:\n// - the compiler must still generate and compile 14 different methods (more, even, than the 11\n//   required for the repeat approach) instead of the 6 required for MI.  (If there was no pure\n//   method (or no pure method override), the number would drop down to the same 11 as the repeat\n//   approach).\ntemplate <class Base = A_Tpl>\nclass PyA_Tpl : public Base {\npublic:\n    using Base::Base; // Inherit constructors\n    int unlucky_number() override { PYBIND11_OVERRIDE_PURE(int, Base, unlucky_number, ); }\n    std::string say_something(unsigned times) override {\n        PYBIND11_OVERRIDE(std::string, Base, say_something, times);\n    }\n};\ntemplate <class Base = B_Tpl>\nclass PyB_Tpl : public PyA_Tpl<Base> {\npublic:\n    using PyA_Tpl<Base>::PyA_Tpl; // Inherit constructors (via PyA_Tpl's inherited constructors)\n    // NOLINTNEXTLINE(bugprone-parent-virtual-call)\n    int unlucky_number() override { PYBIND11_OVERRIDE(int, Base, unlucky_number, ); }\n    double lucky_number() override { PYBIND11_OVERRIDE(double, Base, lucky_number, ); }\n};\n// Since C_Tpl and D_Tpl don't declare any new virtual methods, we don't actually need these\n// (we can use PyB_Tpl<C_Tpl> and PyB_Tpl<D_Tpl> for the trampoline classes instead):\n/*\ntemplate <class Base = C_Tpl> class PyC_Tpl : public PyB_Tpl<Base> {\npublic:\n    using PyB_Tpl<Base>::PyB_Tpl;\n};\ntemplate <class Base = D_Tpl> class PyD_Tpl : public PyC_Tpl<Base> {\npublic:\n    using PyC_Tpl<Base>::PyC_Tpl;\n};\n*/\n\nvoid initialize_inherited_virtuals(py::module_ &m) {\n    // test_inherited_virtuals\n\n    // Method 1: repeat\n    py::class_<A_Repeat, PyA_Repeat>(m, \"A_Repeat\")\n        .def(py::init<>())\n        .def(\"unlucky_number\", &A_Repeat::unlucky_number)\n        .def(\"say_something\", &A_Repeat::say_something)\n        .def(\"say_everything\", &A_Repeat::say_everything);\n    py::class_<B_Repeat, A_Repeat, PyB_Repeat>(m, \"B_Repeat\")\n        .def(py::init<>())\n        .def(\"lucky_number\", &B_Repeat::lucky_number);\n    py::class_<C_Repeat, B_Repeat, PyC_Repeat>(m, \"C_Repeat\").def(py::init<>());\n    py::class_<D_Repeat, C_Repeat, PyD_Repeat>(m, \"D_Repeat\").def(py::init<>());\n\n    // test_\n    // Method 2: Templated trampolines\n    py::class_<A_Tpl, PyA_Tpl<>>(m, \"A_Tpl\")\n        .def(py::init<>())\n        .def(\"unlucky_number\", &A_Tpl::unlucky_number)\n        .def(\"say_something\", &A_Tpl::say_something)\n        .def(\"say_everything\", &A_Tpl::say_everything);\n    py::class_<B_Tpl, A_Tpl, PyB_Tpl<>>(m, \"B_Tpl\")\n        .def(py::init<>())\n        .def(\"lucky_number\", &B_Tpl::lucky_number);\n    py::class_<C_Tpl, B_Tpl, PyB_Tpl<C_Tpl>>(m, \"C_Tpl\").def(py::init<>());\n    py::class_<D_Tpl, C_Tpl, PyB_Tpl<D_Tpl>>(m, \"D_Tpl\").def(py::init<>());\n\n    // Fix issue #1454 (crash when acquiring/releasing GIL on another thread in Python 2.7)\n    m.def(\"test_gil\", &test_gil);\n    m.def(\"test_gil_from_thread\", &test_gil_from_thread);\n};\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/test_virtual_functions.py",
    "content": "import pytest\n\nimport env  # noqa: F401\n\nm = pytest.importorskip(\"pybind11_tests.virtual_functions\")\nfrom pybind11_tests import ConstructorStats  # noqa: E402\n\n\ndef test_override(capture, msg):\n    class ExtendedExampleVirt(m.ExampleVirt):\n        def __init__(self, state):\n            super().__init__(state + 1)\n            self.data = \"Hello world\"\n\n        def run(self, value):\n            print(f\"ExtendedExampleVirt::run({value}), calling parent..\")\n            return super().run(value + 1)\n\n        def run_bool(self):\n            print(\"ExtendedExampleVirt::run_bool()\")\n            return False\n\n        def get_string1(self):\n            return \"override1\"\n\n        def pure_virtual(self):\n            print(f\"ExtendedExampleVirt::pure_virtual(): {self.data}\")\n\n    class ExtendedExampleVirt2(ExtendedExampleVirt):\n        def __init__(self, state):\n            super().__init__(state + 1)\n\n        def get_string2(self):\n            return \"override2\"\n\n    ex12 = m.ExampleVirt(10)\n    with capture:\n        assert m.runExampleVirt(ex12, 20) == 30\n    assert (\n        capture\n        == \"\"\"\n        Original implementation of ExampleVirt::run(state=10, value=20, str1=default1, str2=default2)\n    \"\"\"\n    )\n\n    with pytest.raises(RuntimeError) as excinfo:\n        m.runExampleVirtVirtual(ex12)\n    assert (\n        msg(excinfo.value)\n        == 'Tried to call pure virtual function \"ExampleVirt::pure_virtual\"'\n    )\n\n    ex12p = ExtendedExampleVirt(10)\n    with capture:\n        assert m.runExampleVirt(ex12p, 20) == 32\n    assert (\n        capture\n        == \"\"\"\n        ExtendedExampleVirt::run(20), calling parent..\n        Original implementation of ExampleVirt::run(state=11, value=21, str1=override1, str2=default2)\n    \"\"\"\n    )\n    with capture:\n        assert m.runExampleVirtBool(ex12p) is False\n    assert capture == \"ExtendedExampleVirt::run_bool()\"\n    with capture:\n        m.runExampleVirtVirtual(ex12p)\n    assert capture == \"ExtendedExampleVirt::pure_virtual(): Hello world\"\n\n    ex12p2 = ExtendedExampleVirt2(15)\n    with capture:\n        assert m.runExampleVirt(ex12p2, 50) == 68\n    assert (\n        capture\n        == \"\"\"\n        ExtendedExampleVirt::run(50), calling parent..\n        Original implementation of ExampleVirt::run(state=17, value=51, str1=override1, str2=override2)\n    \"\"\"\n    )\n\n    cstats = ConstructorStats.get(m.ExampleVirt)\n    assert cstats.alive() == 3\n    del ex12, ex12p, ex12p2\n    assert cstats.alive() == 0\n    assert cstats.values() == [\"10\", \"11\", \"17\"]\n    assert cstats.copy_constructions == 0\n    assert cstats.move_constructions >= 0\n\n\ndef test_alias_delay_initialization1(capture):\n    \"\"\"`A` only initializes its trampoline class when we inherit from it\n\n    If we just create and use an A instance directly, the trampoline initialization is\n    bypassed and we only initialize an A() instead (for performance reasons).\n    \"\"\"\n\n    class B(m.A):\n        def __init__(self):\n            super().__init__()\n\n        def f(self):\n            print(\"In python f()\")\n\n    # C++ version\n    with capture:\n        a = m.A()\n        m.call_f(a)\n        del a\n        pytest.gc_collect()\n    assert capture == \"A.f()\"\n\n    # Python version\n    with capture:\n        b = B()\n        m.call_f(b)\n        del b\n        pytest.gc_collect()\n    assert (\n        capture\n        == \"\"\"\n        PyA.PyA()\n        PyA.f()\n        In python f()\n        PyA.~PyA()\n    \"\"\"\n    )\n\n\ndef test_alias_delay_initialization2(capture):\n    \"\"\"`A2`, unlike the above, is configured to always initialize the alias\n\n    While the extra initialization and extra class layer has small virtual dispatch\n    performance penalty, it also allows us to do more things with the trampoline\n    class such as defining local variables and performing construction/destruction.\n    \"\"\"\n\n    class B2(m.A2):\n        def __init__(self):\n            super().__init__()\n\n        def f(self):\n            print(\"In python B2.f()\")\n\n    # No python subclass version\n    with capture:\n        a2 = m.A2()\n        m.call_f(a2)\n        del a2\n        pytest.gc_collect()\n        a3 = m.A2(1)\n        m.call_f(a3)\n        del a3\n        pytest.gc_collect()\n    assert (\n        capture\n        == \"\"\"\n        PyA2.PyA2()\n        PyA2.f()\n        A2.f()\n        PyA2.~PyA2()\n        PyA2.PyA2()\n        PyA2.f()\n        A2.f()\n        PyA2.~PyA2()\n    \"\"\"\n    )\n\n    # Python subclass version\n    with capture:\n        b2 = B2()\n        m.call_f(b2)\n        del b2\n        pytest.gc_collect()\n    assert (\n        capture\n        == \"\"\"\n        PyA2.PyA2()\n        PyA2.f()\n        In python B2.f()\n        PyA2.~PyA2()\n    \"\"\"\n    )\n\n\n# PyPy: Reference count > 1 causes call with noncopyable instance\n# to fail in ncv1.print_nc()\n@pytest.mark.xfail(\"env.PYPY\")\n@pytest.mark.skipif(\n    not hasattr(m, \"NCVirt\"), reason=\"NCVirt does not work on Intel/PGI/NVCC compilers\"\n)\ndef test_move_support():\n    class NCVirtExt(m.NCVirt):\n        def get_noncopyable(self, a, b):\n            # Constructs and returns a new instance:\n            nc = m.NonCopyable(a * a, b * b)\n            return nc\n\n        def get_movable(self, a, b):\n            # Return a referenced copy\n            self.movable = m.Movable(a, b)\n            return self.movable\n\n    class NCVirtExt2(m.NCVirt):\n        def get_noncopyable(self, a, b):\n            # Keep a reference: this is going to throw an exception\n            self.nc = m.NonCopyable(a, b)\n            return self.nc\n\n        def get_movable(self, a, b):\n            # Return a new instance without storing it\n            return m.Movable(a, b)\n\n    ncv1 = NCVirtExt()\n    assert ncv1.print_nc(2, 3) == \"36\"\n    assert ncv1.print_movable(4, 5) == \"9\"\n    ncv2 = NCVirtExt2()\n    assert ncv2.print_movable(7, 7) == \"14\"\n    # Don't check the exception message here because it differs under debug/non-debug mode\n    with pytest.raises(RuntimeError):\n        ncv2.print_nc(9, 9)\n\n    nc_stats = ConstructorStats.get(m.NonCopyable)\n    mv_stats = ConstructorStats.get(m.Movable)\n    assert nc_stats.alive() == 1\n    assert mv_stats.alive() == 1\n    del ncv1, ncv2\n    assert nc_stats.alive() == 0\n    assert mv_stats.alive() == 0\n    assert nc_stats.values() == [\"4\", \"9\", \"9\", \"9\"]\n    assert mv_stats.values() == [\"4\", \"5\", \"7\", \"7\"]\n    assert nc_stats.copy_constructions == 0\n    assert mv_stats.copy_constructions == 1\n    assert nc_stats.move_constructions >= 0\n    assert mv_stats.move_constructions >= 0\n\n\ndef test_dispatch_issue(msg):\n    \"\"\"#159: virtual function dispatch has problems with similar-named functions\"\"\"\n\n    class PyClass1(m.DispatchIssue):\n        def dispatch(self):\n            return \"Yay..\"\n\n    class PyClass2(m.DispatchIssue):\n        def dispatch(self):\n            with pytest.raises(RuntimeError) as excinfo:\n                super().dispatch()\n            assert (\n                msg(excinfo.value)\n                == 'Tried to call pure virtual function \"Base::dispatch\"'\n            )\n\n            return m.dispatch_issue_go(PyClass1())\n\n    b = PyClass2()\n    assert m.dispatch_issue_go(b) == \"Yay..\"\n\n\ndef test_recursive_dispatch_issue(msg):\n    \"\"\"#3357: Recursive dispatch fails to find python function override\"\"\"\n\n    class Data(m.Data):\n        def __init__(self, value):\n            super().__init__()\n            self.value = value\n\n    class Adder(m.Adder):\n        def __call__(self, first, second, visitor):\n            # lambda is a workaround, which adds extra frame to the\n            # current CPython thread. Removing lambda reveals the bug\n            # [https://github.com/pybind/pybind11/issues/3357]\n            (lambda: visitor(Data(first.value + second.value)))()\n\n    class StoreResultVisitor:\n        def __init__(self):\n            self.result = None\n\n        def __call__(self, data):\n            self.result = data.value\n\n    store = StoreResultVisitor()\n\n    m.add2(Data(1), Data(2), Adder(), store)\n    assert store.result == 3\n\n    # without lambda in Adder class, this function fails with\n    # RuntimeError: Tried to call pure virtual function \"AdderBase::__call__\"\n    m.add3(Data(1), Data(2), Data(3), Adder(), store)\n    assert store.result == 6\n\n\ndef test_override_ref():\n    \"\"\"#392/397: overriding reference-returning functions\"\"\"\n    o = m.OverrideTest(\"asdf\")\n\n    # Not allowed (see associated .cpp comment)\n    # i = o.str_ref()\n    # assert o.str_ref() == \"asdf\"\n    assert o.str_value() == \"asdf\"\n\n    assert o.A_value().value == \"hi\"\n    a = o.A_ref()\n    assert a.value == \"hi\"\n    a.value = \"bye\"\n    assert a.value == \"bye\"\n\n\ndef test_inherited_virtuals():\n    class AR(m.A_Repeat):\n        def unlucky_number(self):\n            return 99\n\n    class AT(m.A_Tpl):\n        def unlucky_number(self):\n            return 999\n\n    obj = AR()\n    assert obj.say_something(3) == \"hihihi\"\n    assert obj.unlucky_number() == 99\n    assert obj.say_everything() == \"hi 99\"\n\n    obj = AT()\n    assert obj.say_something(3) == \"hihihi\"\n    assert obj.unlucky_number() == 999\n    assert obj.say_everything() == \"hi 999\"\n\n    for obj in [m.B_Repeat(), m.B_Tpl()]:\n        assert obj.say_something(3) == \"B says hi 3 times\"\n        assert obj.unlucky_number() == 13\n        assert obj.lucky_number() == 7.0\n        assert obj.say_everything() == \"B says hi 1 times 13\"\n\n    for obj in [m.C_Repeat(), m.C_Tpl()]:\n        assert obj.say_something(3) == \"B says hi 3 times\"\n        assert obj.unlucky_number() == 4444\n        assert obj.lucky_number() == 888.0\n        assert obj.say_everything() == \"B says hi 1 times 4444\"\n\n    class CR(m.C_Repeat):\n        def lucky_number(self):\n            return m.C_Repeat.lucky_number(self) + 1.25\n\n    obj = CR()\n    assert obj.say_something(3) == \"B says hi 3 times\"\n    assert obj.unlucky_number() == 4444\n    assert obj.lucky_number() == 889.25\n    assert obj.say_everything() == \"B says hi 1 times 4444\"\n\n    class CT(m.C_Tpl):\n        pass\n\n    obj = CT()\n    assert obj.say_something(3) == \"B says hi 3 times\"\n    assert obj.unlucky_number() == 4444\n    assert obj.lucky_number() == 888.0\n    assert obj.say_everything() == \"B says hi 1 times 4444\"\n\n    class CCR(CR):\n        def lucky_number(self):\n            return CR.lucky_number(self) * 10\n\n    obj = CCR()\n    assert obj.say_something(3) == \"B says hi 3 times\"\n    assert obj.unlucky_number() == 4444\n    assert obj.lucky_number() == 8892.5\n    assert obj.say_everything() == \"B says hi 1 times 4444\"\n\n    class CCT(CT):\n        def lucky_number(self):\n            return CT.lucky_number(self) * 1000\n\n    obj = CCT()\n    assert obj.say_something(3) == \"B says hi 3 times\"\n    assert obj.unlucky_number() == 4444\n    assert obj.lucky_number() == 888000.0\n    assert obj.say_everything() == \"B says hi 1 times 4444\"\n\n    class DR(m.D_Repeat):\n        def unlucky_number(self):\n            return 123\n\n        def lucky_number(self):\n            return 42.0\n\n    for obj in [m.D_Repeat(), m.D_Tpl()]:\n        assert obj.say_something(3) == \"B says hi 3 times\"\n        assert obj.unlucky_number() == 4444\n        assert obj.lucky_number() == 888.0\n        assert obj.say_everything() == \"B says hi 1 times 4444\"\n\n    obj = DR()\n    assert obj.say_something(3) == \"B says hi 3 times\"\n    assert obj.unlucky_number() == 123\n    assert obj.lucky_number() == 42.0\n    assert obj.say_everything() == \"B says hi 1 times 123\"\n\n    class DT(m.D_Tpl):\n        def say_something(self, times):\n            return \"DT says:\" + (\" quack\" * times)\n\n        def unlucky_number(self):\n            return 1234\n\n        def lucky_number(self):\n            return -4.25\n\n    obj = DT()\n    assert obj.say_something(3) == \"DT says: quack quack quack\"\n    assert obj.unlucky_number() == 1234\n    assert obj.lucky_number() == -4.25\n    assert obj.say_everything() == \"DT says: quack 1234\"\n\n    class DT2(DT):\n        def say_something(self, times):\n            return \"DT2: \" + (\"QUACK\" * times)\n\n        def unlucky_number(self):\n            return -3\n\n    class BT(m.B_Tpl):\n        def say_something(self, times):\n            return \"BT\" * times\n\n        def unlucky_number(self):\n            return -7\n\n        def lucky_number(self):\n            return -1.375\n\n    obj = BT()\n    assert obj.say_something(3) == \"BTBTBT\"\n    assert obj.unlucky_number() == -7\n    assert obj.lucky_number() == -1.375\n    assert obj.say_everything() == \"BT -7\"\n\n\ndef test_issue_1454():\n    # Fix issue #1454 (crash when acquiring/releasing GIL on another thread in Python 2.7)\n    m.test_gil()\n    m.test_gil_from_thread()\n\n\ndef test_python_override():\n    def func():\n        class Test(m.test_override_cache_helper):\n            def func(self):\n                return 42\n\n        return Test()\n\n    def func2():\n        class Test(m.test_override_cache_helper):\n            pass\n\n        return Test()\n\n    for _ in range(1500):\n        assert m.test_override_cache(func()) == 42\n        assert m.test_override_cache(func2()) == 0\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/valgrind-numpy-scipy.supp",
    "content": "# Valgrind suppression file for NumPy & SciPy errors and leaks in pybind11 tests\n#\n# On updating a dependency, to get a list of \"default\" leaks in e.g. NumPy, run\n# `PYTHONMALLOC=malloc valgrind --leak-check=full --show-leak-kinds=definite,indirect python3.9-dbg -c \"import numpy\"`\n# To use these suppression files, add e.g. `--suppressions=valgrind-numpy-scipy.supp`\n\n{\n   Leaks when importing NumPy\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyObject_Malloc\n   fun:_PyObject_GC_Alloc\n   fun:_PyObject_GC_Malloc\n   fun:_PyObject_GC_NewVar\n   fun:tuple_alloc\n   fun:PyTuple_Pack\n   ...\n   fun:__pyx_pymod_exec_*\n}\n\n{\n   Leaks when importing NumPy (bis)\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyObject_Malloc\n   fun:_PyObject_New\n   fun:PyCode_NewWithPosOnlyArgs\n   fun:PyCode_New\n   ...\n   fun:__pyx_pymod_exec_*\n}\n\n{\n   Leaks when importing NumPy (ter)\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyObject_Malloc\n   fun:_PyObject_GC_Alloc\n   fun:_PyObject_GC_Malloc\n   fun:_PyObject_GC_NewVar\n   fun:tuple_alloc\n   fun:_PyTuple_FromArray\n   fun:_PyObject_MakeTpCall\n   fun:_PyObject_VectorcallTstate\n   fun:PyObject_Vectorcall\n   fun:call_function\n   fun:_PyEval_EvalFrameDefault\n   fun:_PyEval_EvalFrame\n   fun:function_code_fastcall\n   fun:_PyFunction_Vectorcall\n}\n\n{\n   Leaks when importing NumPy (quater)\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyObject_Malloc\n   fun:_PyObject_GC_Alloc\n   fun:_PyObject_GC_Malloc\n   fun:_PyObject_GC_NewVar\n   fun:tuple_alloc\n   fun:_PyTuple_FromArray\n   fun:_PyObject_MakeTpCall\n   fun:_PyObject_VectorcallTstate\n   fun:_PyObject_CallFunctionVa\n   fun:PyObject_CallFunction\n   fun:PyImport_Import\n}\n\n{\n   Leaks when importing NumPy (quinquies)\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyObject_Malloc\n   fun:_PyObject_GC_Alloc\n   fun:_PyObject_GC_Malloc\n   fun:_PyObject_GC_NewVar\n   fun:tuple_alloc\n   fun:PyTuple_New\n   fun:r_object\n   fun:r_object\n   fun:r_object\n   fun:r_object\n}\n\n{\n   Leaks when importing NumPy (sexies)\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyObject_Malloc\n   fun:_PyObject_GC_Alloc\n   fun:_PyObject_GC_Malloc\n   fun:_PyObject_GC_NewVar\n   fun:tuple_alloc\n   fun:PyTuple_New\n   fun:dictiter_iternextitem\n   fun:list_extend\n   fun:_PyList_Extend\n   fun:PySequence_List\n}\n\n{\n   Leak when importing scipy.fft\n   Memcheck:Leak\n   fun:_Znwm\n   fun:PyInit_pypocketfft\n   fun:_PyImport_LoadDynamicModuleWithSpec\n   fun:_imp_create_dynamic_impl*\n   fun:_imp_create_dynamic\n   fun:cfunction_vectorcall_FASTCALL\n   fun:PyVectorcall_Call\n   fun:_PyObject_Call\n   fun:PyObject_Call\n   fun:do_call_core\n   fun:_PyEval_EvalFrameDefault\n   fun:_PyEval_EvalFrame\n   fun:_PyEval_EvalCode\n}\n\n{\n   NumPy leaks when spawning a subprocess\n   Memcheck:Leak\n   fun:malloc\n   ...\n   fun:_buffer_get_info\n   fun:array_getbuffer\n   fun:PyObject_GetBuffer\n   fun:__Pyx__GetBufferAndValidate*\n   fun:__pyx_f_5numpy_6random_13bit_generator_12SeedSequence_mix_entropy\n   fun:__pyx_pw_5numpy_6random_13bit_generator_12SeedSequence_1__init__\n   fun:type_call\n   fun:__Pyx__PyObject_CallOneArg\n   fun:__pyx_pw_5numpy_6random_13bit_generator_12BitGenerator_1__init__\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tests/valgrind-python.supp",
    "content": "# Valgrind suppression file for CPython errors and leaks in pybind11 tests\n\n# Taken verbatim from https://github.com/python/cpython/blob/3.9/Misc/valgrind-python.supp#L266-L272\n{\n   Uninitialised byte(s) false alarm, see bpo-35561\n   Memcheck:Param\n   epoll_ctl(event)\n   fun:epoll_ctl\n   fun:pyepoll_internal_ctl\n}\n\n{\n   Python leaks when spawning a subprocess\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyMem_RawMalloc\n   fun:PyThread_allocate_lock\n   fun:_PyEval_InitState\n   fun:PyInterpreterState_New\n   ...\n   fun:pyinit_core*\n   fun:Py_InitializeFromConfig\n   fun:pymain_init\n   fun:pymain_main\n}\n\n{\n   Python leaks when spawning a subprocess\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:_PyMem_DebugRawAlloc\n   fun:_PyMem_DebugRawMalloc\n   fun:PyMem_RawMalloc\n   fun:PyThread_allocate_lock\n   fun:_PyRuntimeState_Init_impl\n   fun:_PyRuntimeState_Init\n   fun:_PyRuntime_Initialize\n   fun:pymain_init\n   fun:pymain_main\n   fun:Py_BytesMain\n}\n\n{\n   Python leaks when spawning a subprocess\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyMem_RawMalloc\n   fun:PyThread_allocate_lock\n   fun:_PyImport_AcquireLock\n   fun:_imp_acquire_lock_impl*\n   fun:_imp_acquire_lock\n   fun:cfunction_vectorcall_NOARGS\n   fun:_PyObject_VectorcallTstate\n   fun:PyObject_Vectorcall\n   fun:call_function\n   fun:_PyEval_EvalFrameDefault\n   fun:_PyEval_EvalFrame\n   fun:function_code_fastcall\n}\n\n{\n   Python leaks when spawning a subprocess\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyMem_RawMalloc\n   fun:PyThread_allocate_lock\n   fun:newlockobject\n   ...\n   fun:cfunction_vectorcall_NOARGS\n   fun:_PyObject_VectorcallTstate\n   fun:PyObject_Vectorcall\n   fun:call_function\n   fun:_PyEval_EvalFrameDefault\n   fun:_PyEval_EvalFrame\n   fun:function_code_fastcall\n   fun:_PyFunction_Vectorcall\n}\n\n{\n   Python leaks when spawning a subprocess\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyMem_RawMalloc\n   fun:PyMem_RawMalloc\n   fun:PyThread_allocate_lock\n   fun:rlock_new\n   fun:type_call\n   fun:_PyObject_Call\n   fun:PyObject_Call\n   fun:do_call_core\n   fun:_PyEval_EvalFrameDefault\n   fun:_PyEval_EvalFrame\n   fun:_PyEval_EvalCode\n   fun:_PyFunction_Vectorcall\n}\n\n# Not really CPython-specific, see link\n{\n   dlopen leak (https://stackoverflow.com/questions/1542457/memory-leak-reported-by-valgrind-in-dlopen)\n   Memcheck:Leak\n   fun:malloc\n   ...\n   fun:dl_open_worker\n   fun:_dl_catch_exception\n   fun:_dl_open\n   fun:dlopen_doit\n   fun:_dl_catch_exception\n   fun:_dl_catch_error\n   fun:_dlerror_run\n   fun:dlopen@@GLIBC_2.2.5\n   fun:_PyImport_FindSharedFuncptr\n   fun:_PyImport_LoadDynamicModuleWithSpec\n}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/FindCatch.cmake",
    "content": "# - Find the Catch test framework or download it (single header)\n#\n# This is a quick module for internal use. It assumes that Catch is\n# REQUIRED and that a minimum version is provided (not EXACT). If\n# a suitable version isn't found locally, the single header file\n# will be downloaded and placed in the build dir: PROJECT_BINARY_DIR.\n#\n# This code sets the following variables:\n#  CATCH_INCLUDE_DIR      - path to catch.hpp\n#  CATCH_VERSION          - version number\n\noption(DOWNLOAD_CATCH \"Download catch2 if not found\")\n\nif(NOT Catch_FIND_VERSION)\n  message(FATAL_ERROR \"A version number must be specified.\")\nelseif(Catch_FIND_REQUIRED)\n  message(FATAL_ERROR \"This module assumes Catch is not required.\")\nelseif(Catch_FIND_VERSION_EXACT)\n  message(FATAL_ERROR \"Exact version numbers are not supported, only minimum.\")\nendif()\n\n# Extract the version number from catch.hpp\nfunction(_get_catch_version)\n  file(\n    STRINGS \"${CATCH_INCLUDE_DIR}/catch.hpp\" version_line\n    REGEX \"Catch v.*\"\n    LIMIT_COUNT 1)\n  if(version_line MATCHES \"Catch v([0-9]+)\\\\.([0-9]+)\\\\.([0-9]+)\")\n    set(CATCH_VERSION\n        \"${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}\"\n        PARENT_SCOPE)\n  endif()\nendfunction()\n\n# Download the single-header version of Catch\nfunction(_download_catch version destination_dir)\n  message(STATUS \"Downloading catch v${version}...\")\n  set(url https://github.com/philsquared/Catch/releases/download/v${version}/catch.hpp)\n  file(DOWNLOAD ${url} \"${destination_dir}/catch.hpp\" STATUS status)\n  list(GET status 0 error)\n  if(error)\n    message(FATAL_ERROR \"Could not download ${url}\")\n  endif()\n  set(CATCH_INCLUDE_DIR\n      \"${destination_dir}\"\n      CACHE INTERNAL \"\")\nendfunction()\n\n# Look for catch locally\nfind_path(\n  CATCH_INCLUDE_DIR\n  NAMES catch.hpp\n  PATH_SUFFIXES catch2)\nif(CATCH_INCLUDE_DIR)\n  _get_catch_version()\nendif()\n\n# Download the header if it wasn't found or if it's outdated\nif(NOT CATCH_VERSION OR CATCH_VERSION VERSION_LESS ${Catch_FIND_VERSION})\n  if(DOWNLOAD_CATCH)\n    _download_catch(${Catch_FIND_VERSION} \"${PROJECT_BINARY_DIR}/catch/\")\n    _get_catch_version()\n  else()\n    set(CATCH_FOUND FALSE)\n    return()\n  endif()\nendif()\n\nadd_library(Catch2::Catch2 IMPORTED INTERFACE)\nset_property(TARGET Catch2::Catch2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES \"${CATCH_INCLUDE_DIR}\")\n\nset(CATCH_FOUND TRUE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/FindEigen3.cmake",
    "content": "# - Try to find Eigen3 lib\n#\n# This module supports requiring a minimum version, e.g. you can do\n#   find_package(Eigen3 3.1.2)\n# to require version 3.1.2 or newer of Eigen3.\n#\n# Once done this will define\n#\n#  EIGEN3_FOUND - system has eigen lib with correct version\n#  EIGEN3_INCLUDE_DIR - the eigen include directory\n#  EIGEN3_VERSION - eigen version\n\n# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>\n# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>\n# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>\n# Redistribution and use is allowed according to the terms of the 2-clause BSD license.\n\nif(NOT Eigen3_FIND_VERSION)\n  if(NOT Eigen3_FIND_VERSION_MAJOR)\n    set(Eigen3_FIND_VERSION_MAJOR 2)\n  endif(NOT Eigen3_FIND_VERSION_MAJOR)\n  if(NOT Eigen3_FIND_VERSION_MINOR)\n    set(Eigen3_FIND_VERSION_MINOR 91)\n  endif(NOT Eigen3_FIND_VERSION_MINOR)\n  if(NOT Eigen3_FIND_VERSION_PATCH)\n    set(Eigen3_FIND_VERSION_PATCH 0)\n  endif(NOT Eigen3_FIND_VERSION_PATCH)\n\n  set(Eigen3_FIND_VERSION\n      \"${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}\")\nendif(NOT Eigen3_FIND_VERSION)\n\nmacro(_eigen3_check_version)\n  file(READ \"${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h\" _eigen3_version_header)\n\n  string(REGEX MATCH \"define[ \\t]+EIGEN_WORLD_VERSION[ \\t]+([0-9]+)\" _eigen3_world_version_match\n               \"${_eigen3_version_header}\")\n  set(EIGEN3_WORLD_VERSION \"${CMAKE_MATCH_1}\")\n  string(REGEX MATCH \"define[ \\t]+EIGEN_MAJOR_VERSION[ \\t]+([0-9]+)\" _eigen3_major_version_match\n               \"${_eigen3_version_header}\")\n  set(EIGEN3_MAJOR_VERSION \"${CMAKE_MATCH_1}\")\n  string(REGEX MATCH \"define[ \\t]+EIGEN_MINOR_VERSION[ \\t]+([0-9]+)\" _eigen3_minor_version_match\n               \"${_eigen3_version_header}\")\n  set(EIGEN3_MINOR_VERSION \"${CMAKE_MATCH_1}\")\n\n  set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})\n  if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})\n    set(EIGEN3_VERSION_OK FALSE)\n  else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})\n    set(EIGEN3_VERSION_OK TRUE)\n  endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})\n\n  if(NOT EIGEN3_VERSION_OK)\n\n    message(STATUS \"Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, \"\n                   \"but at least version ${Eigen3_FIND_VERSION} is required\")\n  endif(NOT EIGEN3_VERSION_OK)\nendmacro(_eigen3_check_version)\n\nif(EIGEN3_INCLUDE_DIR)\n\n  # in cache already\n  _eigen3_check_version()\n  set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})\n\nelse(EIGEN3_INCLUDE_DIR)\n  if(NOT DEFINED KDE4_INCLUDE_DIR)\n    set(KDE4_INCLUDE_DIR \"\")\n  endif()\n\n  find_path(\n    EIGEN3_INCLUDE_DIR\n    NAMES signature_of_eigen3_matrix_library\n    PATHS ${CMAKE_INSTALL_PREFIX}/include ${KDE4_INCLUDE_DIR}\n    PATH_SUFFIXES eigen3 eigen)\n\n  if(EIGEN3_INCLUDE_DIR)\n    _eigen3_check_version()\n  endif(EIGEN3_INCLUDE_DIR)\n\n  include(FindPackageHandleStandardArgs)\n  find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)\n\n  mark_as_advanced(EIGEN3_INCLUDE_DIR)\n\nendif(EIGEN3_INCLUDE_DIR)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/FindPythonLibsNew.cmake",
    "content": "# - Find python libraries\n# This module finds the libraries corresponding to the Python interpreter\n# FindPythonInterp provides.\n# This code sets the following variables:\n#\n#  PYTHONLIBS_FOUND           - have the Python libs been found\n#  PYTHON_PREFIX              - path to the Python installation\n#  PYTHON_LIBRARIES           - path to the python library\n#  PYTHON_INCLUDE_DIRS        - path to where Python.h is found\n#  PYTHON_MODULE_EXTENSION    - lib extension, e.g. '.so' or '.pyd'\n#  PYTHON_MODULE_PREFIX       - lib name prefix: usually an empty string\n#  PYTHON_SITE_PACKAGES       - path to installation site-packages\n#  PYTHON_IS_DEBUG            - whether the Python interpreter is a debug build\n#\n# Thanks to talljimbo for the patch adding the 'LDVERSION' config\n# variable usage.\n\n#=============================================================================\n# Copyright 2001-2009 Kitware, Inc.\n# Copyright 2012 Continuum Analytics, Inc.\n#\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n#\n# * Redistributions in binary form must reproduce the above copyright\n# notice, this list of conditions and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n#\n# * Neither the names of Kitware, Inc., the Insight Software Consortium,\n# nor the names of their contributors may be used to endorse or promote\n# products derived from this software without specific prior written\n# permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#=============================================================================\n\n# Checking for the extension makes sure that `LibsNew` was found and not just `Libs`.\nif(PYTHONLIBS_FOUND AND PYTHON_MODULE_EXTENSION)\n  return()\nendif()\n\nif(PythonLibsNew_FIND_QUIETLY)\n  set(_pythonlibs_quiet QUIET)\nelse()\n  set(_pythonlibs_quiet \"\")\nendif()\n\nif(PythonLibsNew_FIND_REQUIRED)\n  set(_pythonlibs_required REQUIRED)\nendif()\n\n# Check to see if the `python` command is present and from a virtual\n# environment, conda, or GHA activation - if it is, try to use that.\n\nif(NOT DEFINED PYTHON_EXECUTABLE)\n  if(DEFINED ENV{VIRTUAL_ENV})\n    find_program(\n      PYTHON_EXECUTABLE python\n      PATHS \"$ENV{VIRTUAL_ENV}\" \"$ENV{VIRTUAL_ENV}/bin\"\n      NO_DEFAULT_PATH)\n  elseif(DEFINED ENV{CONDA_PREFIX})\n    find_program(\n      PYTHON_EXECUTABLE python\n      PATHS \"$ENV{CONDA_PREFIX}\" \"$ENV{CONDA_PREFIX}/bin\"\n      NO_DEFAULT_PATH)\n  elseif(DEFINED ENV{pythonLocation})\n    find_program(\n      PYTHON_EXECUTABLE python\n      PATHS \"$ENV{pythonLocation}\" \"$ENV{pythonLocation}/bin\"\n      NO_DEFAULT_PATH)\n  endif()\n  if(NOT PYTHON_EXECUTABLE)\n    unset(PYTHON_EXECUTABLE)\n  endif()\nendif()\n\n# Use the Python interpreter to find the libs.\nif(NOT PythonLibsNew_FIND_VERSION)\n  set(PythonLibsNew_FIND_VERSION \"3.6\")\nendif()\n\nfind_package(PythonInterp ${PythonLibsNew_FIND_VERSION} ${_pythonlibs_required}\n             ${_pythonlibs_quiet})\n\nif(NOT PYTHONINTERP_FOUND)\n  set(PYTHONLIBS_FOUND FALSE)\n  set(PythonLibsNew_FOUND FALSE)\n  return()\nendif()\n\n# According to https://stackoverflow.com/questions/646518/python-how-to-detect-debug-interpreter\n# testing whether sys has the gettotalrefcount function is a reliable, cross-platform\n# way to detect a CPython debug interpreter.\n#\n# The library suffix is from the config var LDVERSION sometimes, otherwise\n# VERSION. VERSION will typically be like \"2.7\" on unix, and \"27\" on windows.\nexecute_process(\n  COMMAND\n    \"${PYTHON_EXECUTABLE}\" \"-c\" \"\nimport sys;import struct;\nimport sysconfig as s\nUSE_SYSCONFIG = sys.version_info >= (3, 10)\nif not USE_SYSCONFIG:\n    from distutils import sysconfig as ds\nprint('.'.join(str(v) for v in sys.version_info));\nprint(sys.prefix);\nif USE_SYSCONFIG:\n    scheme = s.get_default_scheme()\n    if scheme == 'posix_local':\n        # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/\n        scheme = 'posix_prefix'\n    print(s.get_path('platinclude', scheme))\n    print(s.get_path('platlib'))\n    print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO'))\nelse:\n    print(ds.get_python_inc(plat_specific=True));\n    print(ds.get_python_lib(plat_specific=True));\n    print(ds.get_config_var('EXT_SUFFIX') or ds.get_config_var('SO'));\nprint(hasattr(sys, 'gettotalrefcount')+0);\nprint(struct.calcsize('@P'));\nprint(s.get_config_var('LDVERSION') or s.get_config_var('VERSION'));\nprint(s.get_config_var('LIBDIR') or '');\nprint(s.get_config_var('MULTIARCH') or '');\n\"\n  RESULT_VARIABLE _PYTHON_SUCCESS\n  OUTPUT_VARIABLE _PYTHON_VALUES\n  ERROR_VARIABLE _PYTHON_ERROR_VALUE)\n\nif(NOT _PYTHON_SUCCESS MATCHES 0)\n  if(PythonLibsNew_FIND_REQUIRED)\n    message(FATAL_ERROR \"Python config failure:\\n${_PYTHON_ERROR_VALUE}\")\n  endif()\n  set(PYTHONLIBS_FOUND FALSE)\n  set(PythonLibsNew_FOUND FALSE)\n  return()\nendif()\n\noption(\n  PYBIND11_PYTHONLIBS_OVERWRITE\n  \"Overwrite cached values read from Python library (classic search). Turn off if cross-compiling and manually setting these values.\"\n  ON)\n# Can manually set values when cross-compiling\nmacro(_PYBIND11_GET_IF_UNDEF lst index name)\n  if(PYBIND11_PYTHONLIBS_OVERWRITE OR NOT DEFINED \"${name}\")\n    list(GET \"${lst}\" \"${index}\" \"${name}\")\n  endif()\nendmacro()\n\n# Convert the process output into a list\nif(WIN32)\n  string(REGEX REPLACE \"\\\\\\\\\" \"/\" _PYTHON_VALUES ${_PYTHON_VALUES})\nendif()\nstring(REGEX REPLACE \";\" \"\\\\\\\\;\" _PYTHON_VALUES ${_PYTHON_VALUES})\nstring(REGEX REPLACE \"\\n\" \";\" _PYTHON_VALUES ${_PYTHON_VALUES})\n_pybind11_get_if_undef(_PYTHON_VALUES 0 _PYTHON_VERSION_LIST)\n_pybind11_get_if_undef(_PYTHON_VALUES 1 PYTHON_PREFIX)\n_pybind11_get_if_undef(_PYTHON_VALUES 2 PYTHON_INCLUDE_DIR)\n_pybind11_get_if_undef(_PYTHON_VALUES 3 PYTHON_SITE_PACKAGES)\n_pybind11_get_if_undef(_PYTHON_VALUES 4 PYTHON_MODULE_EXTENSION)\n_pybind11_get_if_undef(_PYTHON_VALUES 5 PYTHON_IS_DEBUG)\n_pybind11_get_if_undef(_PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P)\n_pybind11_get_if_undef(_PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX)\n_pybind11_get_if_undef(_PYTHON_VALUES 8 PYTHON_LIBDIR)\n_pybind11_get_if_undef(_PYTHON_VALUES 9 PYTHON_MULTIARCH)\n\n# Make sure the Python has the same pointer-size as the chosen compiler\n# Skip if CMAKE_SIZEOF_VOID_P is not defined\n# This should be skipped for (non-Apple) cross-compiles (like EMSCRIPTEN)\nif(NOT CMAKE_CROSSCOMPILING\n   AND CMAKE_SIZEOF_VOID_P\n   AND (NOT \"${PYTHON_SIZEOF_VOID_P}\" STREQUAL \"${CMAKE_SIZEOF_VOID_P}\"))\n  if(PythonLibsNew_FIND_REQUIRED)\n    math(EXPR _PYTHON_BITS \"${PYTHON_SIZEOF_VOID_P} * 8\")\n    math(EXPR _CMAKE_BITS \"${CMAKE_SIZEOF_VOID_P} * 8\")\n    message(FATAL_ERROR \"Python config failure: Python is ${_PYTHON_BITS}-bit, \"\n                        \"chosen compiler is  ${_CMAKE_BITS}-bit\")\n  endif()\n  set(PYTHONLIBS_FOUND FALSE)\n  set(PythonLibsNew_FOUND FALSE)\n  return()\nendif()\n\n# The built-in FindPython didn't always give the version numbers\nstring(REGEX REPLACE \"\\\\.\" \";\" _PYTHON_VERSION_LIST ${_PYTHON_VERSION_LIST})\nlist(GET _PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)\nlist(GET _PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)\nlist(GET _PYTHON_VERSION_LIST 2 PYTHON_VERSION_PATCH)\nset(PYTHON_VERSION \"${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH}\")\n\n# Make sure all directory separators are '/'\nstring(REGEX REPLACE \"\\\\\\\\\" \"/\" PYTHON_PREFIX \"${PYTHON_PREFIX}\")\nstring(REGEX REPLACE \"\\\\\\\\\" \"/\" PYTHON_INCLUDE_DIR \"${PYTHON_INCLUDE_DIR}\")\nstring(REGEX REPLACE \"\\\\\\\\\" \"/\" PYTHON_SITE_PACKAGES \"${PYTHON_SITE_PACKAGES}\")\n\nif(DEFINED PYTHON_LIBRARY)\n  # Don't write to PYTHON_LIBRARY if it's already set\nelseif(CMAKE_HOST_WIN32)\n  set(PYTHON_LIBRARY \"${PYTHON_PREFIX}/libs/python${PYTHON_LIBRARY_SUFFIX}.lib\")\n\n  # when run in a venv, PYTHON_PREFIX points to it. But the libraries remain in the\n  # original python installation. They may be found relative to PYTHON_INCLUDE_DIR.\n  if(NOT EXISTS \"${PYTHON_LIBRARY}\")\n    get_filename_component(_PYTHON_ROOT ${PYTHON_INCLUDE_DIR} DIRECTORY)\n    set(PYTHON_LIBRARY \"${_PYTHON_ROOT}/libs/python${PYTHON_LIBRARY_SUFFIX}.lib\")\n  endif()\n\n  # if we are in MSYS & MINGW, and we didn't find windows python lib, look for system python lib\n  if(DEFINED ENV{MSYSTEM}\n     AND MINGW\n     AND NOT EXISTS \"${PYTHON_LIBRARY}\")\n    if(PYTHON_MULTIARCH)\n      set(_PYTHON_LIBS_SEARCH \"${PYTHON_LIBDIR}/${PYTHON_MULTIARCH}\" \"${PYTHON_LIBDIR}\")\n    else()\n      set(_PYTHON_LIBS_SEARCH \"${PYTHON_LIBDIR}\")\n    endif()\n    unset(PYTHON_LIBRARY)\n    find_library(\n      PYTHON_LIBRARY\n      NAMES \"python${PYTHON_LIBRARY_SUFFIX}\"\n      PATHS ${_PYTHON_LIBS_SEARCH}\n      NO_DEFAULT_PATH)\n  endif()\n\n  # raise an error if the python libs are still not found.\n  if(NOT EXISTS \"${PYTHON_LIBRARY}\")\n    message(FATAL_ERROR \"Python libraries not found\")\n  endif()\n\nelse()\n  if(PYTHON_MULTIARCH)\n    set(_PYTHON_LIBS_SEARCH \"${PYTHON_LIBDIR}/${PYTHON_MULTIARCH}\" \"${PYTHON_LIBDIR}\")\n  else()\n    set(_PYTHON_LIBS_SEARCH \"${PYTHON_LIBDIR}\")\n  endif()\n  #message(STATUS \"Searching for Python libs in ${_PYTHON_LIBS_SEARCH}\")\n  # Probably this needs to be more involved. It would be nice if the config\n  # information the python interpreter itself gave us were more complete.\n  find_library(\n    PYTHON_LIBRARY\n    NAMES \"python${PYTHON_LIBRARY_SUFFIX}\"\n    PATHS ${_PYTHON_LIBS_SEARCH}\n    NO_DEFAULT_PATH)\n\n  # If all else fails, just set the name/version and let the linker figure out the path.\n  if(NOT PYTHON_LIBRARY)\n    set(PYTHON_LIBRARY python${PYTHON_LIBRARY_SUFFIX})\n  endif()\nendif()\n\nmark_as_advanced(PYTHON_LIBRARY PYTHON_INCLUDE_DIR)\n\n# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the\n# cache entries because they are meant to specify the location of a single\n# library. We now set the variables listed by the documentation for this\n# module.\nset(PYTHON_INCLUDE_DIRS \"${PYTHON_INCLUDE_DIR}\")\nset(PYTHON_LIBRARIES \"${PYTHON_LIBRARY}\")\nif(NOT PYTHON_DEBUG_LIBRARY)\n  set(PYTHON_DEBUG_LIBRARY \"\")\nendif()\nset(PYTHON_DEBUG_LIBRARIES \"${PYTHON_DEBUG_LIBRARY}\")\n\nfind_package_message(PYTHON \"Found PythonLibs: ${PYTHON_LIBRARIES}\"\n                     \"${PYTHON_EXECUTABLE}${PYTHON_VERSION_STRING}\")\n\nset(PYTHONLIBS_FOUND TRUE)\nset(PythonLibsNew_FOUND TRUE)\n\nif(NOT PYTHON_MODULE_PREFIX)\n  set(PYTHON_MODULE_PREFIX \"\")\nendif()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/JoinPaths.cmake",
    "content": "# This module provides function for joining paths\n# known from most languages\n#\n# SPDX-License-Identifier: (MIT OR CC0-1.0)\n# Copyright 2020 Jan Tojnar\n# https://github.com/jtojnar/cmake-snips\n#\n# Modelled after Python’s os.path.join\n# https://docs.python.org/3.7/library/os.path.html#os.path.join\n# Windows not supported\nfunction(join_paths joined_path first_path_segment)\n    set(temp_path \"${first_path_segment}\")\n    foreach(current_segment IN LISTS ARGN)\n        if(NOT (\"${current_segment}\" STREQUAL \"\"))\n            if(IS_ABSOLUTE \"${current_segment}\")\n                set(temp_path \"${current_segment}\")\n            else()\n                set(temp_path \"${temp_path}/${current_segment}\")\n            endif()\n        endif()\n    endforeach()\n    set(${joined_path} \"${temp_path}\" PARENT_SCOPE)\nendfunction()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/check-style.sh",
    "content": "#!/bin/bash\n#\n# Script to check include/test code for common pybind11 code style errors.\n#\n# This script currently checks for\n#\n# 1. missing space between keyword and parenthesis, e.g.: for(, if(, while(\n# 2. Missing space between right parenthesis and brace, e.g. 'for (...){'\n# 3. opening brace on its own line. It should always be on the same line as the\n#    if/while/for/do statement.\n#\n# Invoke as: tools/check-style.sh <filenames>\n#\n\ncheck_style_errors=0\nIFS=$'\\n'\n\n\nfound=\"$(grep '\\<\\(if\\|for\\|while\\|catch\\)(\\|){' \"$@\" -rn --color=always)\"\nif [ -n \"$found\" ]; then\n    echo -e '\\033[31;01mError: found the following coding style problems:\\033[0m'\n    check_style_errors=1\n    echo \"${found//^/    /}\"\nfi\n\nfound=\"$(awk '\nfunction prefix(filename, lineno) {\n    return \"    \\033[35m\" filename \"\\033[36m:\\033[32m\" lineno \"\\033[36m:\\033[0m\"\n}\nfunction mark(pattern, string) { sub(pattern, \"\\033[01;31m&\\033[0m\", string); return string }\nlast && /^\\s*{/ {\n    print prefix(FILENAME, FNR-1) mark(\"\\\\)\\\\s*$\", last)\n    print prefix(FILENAME, FNR)   mark(\"^\\\\s*{\", $0)\n    last=\"\"\n}\n{ last = /(if|for|while|catch|switch)\\s*\\(.*\\)\\s*$/ ? $0 : \"\" }\n' \"$(find include -type f)\" \"$@\")\"\nif [ -n \"$found\" ]; then\n    check_style_errors=1\n    echo -e '\\033[31;01mError: braces should occur on the same line as the if/while/.. statement. Found issues in the following files:\\033[0m'\n    echo \"$found\"\nfi\n\nexit $check_style_errors\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/cmake_uninstall.cmake.in",
    "content": "# Source: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake\n\nif(NOT EXISTS \"@CMAKE_BINARY_DIR@/install_manifest.txt\")\n  message(FATAL_ERROR \"Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt\")\nendif()\n\nfile(READ \"@CMAKE_BINARY_DIR@/install_manifest.txt\" files)\nstring(REGEX REPLACE \"\\n\" \";\" files \"${files}\")\nforeach(file ${files})\n  message(STATUS \"Uninstalling $ENV{DESTDIR}${file}\")\n  if(IS_SYMLINK \"$ENV{DESTDIR}${file}\" OR EXISTS \"$ENV{DESTDIR}${file}\")\n    exec_program(\n      \"@CMAKE_COMMAND@\" ARGS\n      \"-E remove \\\"$ENV{DESTDIR}${file}\\\"\"\n      OUTPUT_VARIABLE rm_out\n      RETURN_VALUE rm_retval)\n    if(NOT \"${rm_retval}\" STREQUAL 0)\n      message(FATAL_ERROR \"Problem when removing $ENV{DESTDIR}${file}\")\n    endif()\n  else(IS_SYMLINK \"$ENV{DESTDIR}${file}\" OR EXISTS \"$ENV{DESTDIR}${file}\")\n    message(STATUS \"File $ENV{DESTDIR}${file} does not exist.\")\n  endif()\nendforeach()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/codespell_ignore_lines_from_errors.py",
    "content": "\"\"\"Simple script for rebuilding .codespell-ignore-lines\n\nUsage:\n\ncat < /dev/null > .codespell-ignore-lines\npre-commit run --all-files codespell >& /tmp/codespell_errors.txt\npython3 tools/codespell_ignore_lines_from_errors.py /tmp/codespell_errors.txt > .codespell-ignore-lines\n\ngit diff to review changes, then commit, push.\n\"\"\"\n\nimport sys\nfrom typing import List\n\n\ndef run(args: List[str]) -> None:\n    assert len(args) == 1, \"codespell_errors.txt\"\n    cache = {}\n    done = set()\n    for line in sorted(open(args[0]).read().splitlines()):\n        i = line.find(\" ==> \")\n        if i > 0:\n            flds = line[:i].split(\":\")\n            if len(flds) >= 2:\n                filename, line_num = flds[:2]\n                if filename not in cache:\n                    cache[filename] = open(filename).read().splitlines()\n                supp = cache[filename][int(line_num) - 1]\n                if supp not in done:\n                    print(supp)\n                    done.add(supp)\n\n\nif __name__ == \"__main__\":\n    run(args=sys.argv[1:])\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/libsize.py",
    "content": "import os\nimport sys\n\n# Internal build script for generating debugging test .so size.\n# Usage:\n#     python libsize.py file.so save.txt -- displays the size of file.so and, if save.txt exists, compares it to the\n#                                           size in it, then overwrites save.txt with the new size for future runs.\n\nif len(sys.argv) != 3:\n    sys.exit(\"Invalid arguments: usage: python libsize.py file.so save.txt\")\n\nlib = sys.argv[1]\nsave = sys.argv[2]\n\nif not os.path.exists(lib):\n    sys.exit(f\"Error: requested file ({lib}) does not exist\")\n\nlibsize = os.path.getsize(lib)\n\nprint(\"------\", os.path.basename(lib), \"file size:\", libsize, end=\"\")\n\nif os.path.exists(save):\n    with open(save) as sf:\n        oldsize = int(sf.readline())\n\n    if oldsize > 0:\n        change = libsize - oldsize\n        if change == 0:\n            print(\" (no change)\")\n        else:\n            print(f\" (change of {change:+} bytes = {change / oldsize:+.2%})\")\nelse:\n    print()\n\nwith open(save, \"w\") as sf:\n    sf.write(str(libsize))\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/make_changelog.py",
    "content": "#!/usr/bin/env python3\n\nimport re\n\nimport ghapi.all\nfrom rich import print\nfrom rich.syntax import Syntax\n\nENTRY = re.compile(\n    r\"\"\"\n    Suggested \\s changelog \\s entry:\n    .*\n    ```rst\n    \\s*\n    (.*?)\n    \\s*\n    ```\n\"\"\",\n    re.DOTALL | re.VERBOSE,\n)\n\nprint()\n\n\napi = ghapi.all.GhApi(owner=\"pybind\", repo=\"pybind11\")\n\nissues_pages = ghapi.page.paged(\n    api.issues.list_for_repo, labels=\"needs changelog\", state=\"closed\"\n)\nissues = (issue for page in issues_pages for issue in page)\nmissing = []\n\nfor issue in issues:\n    changelog = ENTRY.findall(issue.body or \"\")\n    if not changelog or not changelog[0]:\n        missing.append(issue)\n    else:\n        (msg,) = changelog\n        if not msg.startswith(\"* \"):\n            msg = \"* \" + msg\n        if not msg.endswith(\".\"):\n            msg += \".\"\n\n        msg += f\"\\n  `#{issue.number} <{issue.html_url}>`_\"\n\n        print(Syntax(msg, \"rst\", theme=\"ansi_light\", word_wrap=True))\n        print()\n\nif missing:\n    print()\n    print(\"[blue]\" + \"-\" * 30)\n    print()\n\n    for issue in missing:\n        print(f\"[red bold]Missing:[/red bold][red] {issue.title}\")\n        print(f\"[red]  {issue.html_url}\\n\")\n\n    print(\"[bold]Template:\\n\")\n    msg = \"## Suggested changelog entry:\\n\\n```rst\\n\\n```\"\n    print(Syntax(msg, \"md\", theme=\"ansi_light\"))\n\nprint()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/pybind11.pc.in",
    "content": "prefix=@prefix_for_pc_file@\nincludedir=@includedir_for_pc_file@\n\nName: @PROJECT_NAME@\nDescription: Seamless operability between C++11 and Python\nVersion: @PROJECT_VERSION@\nCflags: -I${includedir}\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/pybind11Common.cmake",
    "content": "#[======================================================[.rst\n\nAdds the following targets::\n\n    pybind11::pybind11 - link to headers and pybind11\n    pybind11::module - Adds module links\n    pybind11::embed - Adds embed links\n    pybind11::lto - Link time optimizations (manual selection)\n    pybind11::thin_lto - Link time optimizations (manual selection)\n    pybind11::python_link_helper - Adds link to Python libraries\n    pybind11::windows_extras - MSVC bigobj and mp for building multithreaded\n    pybind11::opt_size - avoid optimizations that increase code size\n\nAdds the following functions::\n\n    pybind11_strip(target) - strip target after building on linux/macOS\n    pybind11_find_import(module) - See if a module is installed.\n\n#]======================================================]\n\n# CMake 3.10 has an include_guard command, but we can't use that yet\n# include_guard(global) (pre-CMake 3.10)\nif(TARGET pybind11::lto)\n  return()\nendif()\n\n# If we are in subdirectory mode, all IMPORTED targets must be GLOBAL. If we\n# are in CONFIG mode, they should be \"normal\" targets instead.\n# In CMake 3.11+ you can promote a target to global after you create it,\n# which might be simpler than this check.\nget_property(\n  is_config\n  TARGET pybind11::headers\n  PROPERTY IMPORTED)\nif(NOT is_config)\n  set(optional_global GLOBAL)\nendif()\n\n# If not run in Python mode, we still would like this to at least\n# include pybind11's include directory:\nset(pybind11_INCLUDE_DIRS\n    \"${pybind11_INCLUDE_DIR}\"\n    CACHE INTERNAL \"Include directory for pybind11 (Python not requested)\")\n\n# --------------------- Shared targets ----------------------------\n\n# Build an interface library target:\nadd_library(pybind11::pybind11 IMPORTED INTERFACE ${optional_global})\nset_property(\n  TARGET pybind11::pybind11\n  APPEND\n  PROPERTY INTERFACE_LINK_LIBRARIES pybind11::headers)\n\n# Build a module target:\nadd_library(pybind11::module IMPORTED INTERFACE ${optional_global})\nset_property(\n  TARGET pybind11::module\n  APPEND\n  PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11)\n\n# Build an embed library target:\nadd_library(pybind11::embed IMPORTED INTERFACE ${optional_global})\nset_property(\n  TARGET pybind11::embed\n  APPEND\n  PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11)\n\n# --------------------------- link helper ---------------------------\n\nadd_library(pybind11::python_link_helper IMPORTED INTERFACE ${optional_global})\n\nif(CMAKE_VERSION VERSION_LESS 3.13)\n  # In CMake 3.11+, you can set INTERFACE properties via the normal methods, and\n  # this would be simpler.\n  set_property(\n    TARGET pybind11::python_link_helper\n    APPEND\n    PROPERTY INTERFACE_LINK_LIBRARIES \"$<$<PLATFORM_ID:Darwin>:-undefined dynamic_lookup>\")\nelse()\n  # link_options was added in 3.13+\n  # This is safer, because you are ensured the deduplication pass in CMake will not consider\n  # these separate and remove one but not the other.\n  set_property(\n    TARGET pybind11::python_link_helper\n    APPEND\n    PROPERTY INTERFACE_LINK_OPTIONS \"$<$<PLATFORM_ID:Darwin>:LINKER:-undefined,dynamic_lookup>\")\nendif()\n\n# ------------------------ Windows extras -------------------------\n\nadd_library(pybind11::windows_extras IMPORTED INTERFACE ${optional_global})\n\nif(MSVC) # That's also clang-cl\n  # /bigobj is needed for bigger binding projects due to the limit to 64k\n  # addressable sections\n  set_property(\n    TARGET pybind11::windows_extras\n    APPEND\n    PROPERTY INTERFACE_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:CXX>:/bigobj>)\n\n  # /MP enables multithreaded builds (relevant when there are many files) for MSVC\n  if(\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"MSVC\") # no Clang no Intel\n    if(CMAKE_VERSION VERSION_LESS 3.11)\n      set_property(\n        TARGET pybind11::windows_extras\n        APPEND\n        PROPERTY INTERFACE_COMPILE_OPTIONS $<$<NOT:$<CONFIG:Debug>>:/MP>)\n    else()\n      # Only set these options for C++ files.  This is important so that, for\n      # instance, projects that include other types of source files like CUDA\n      # .cu files don't get these options propagated to nvcc since that would\n      # cause the build to fail.\n      set_property(\n        TARGET pybind11::windows_extras\n        APPEND\n        PROPERTY INTERFACE_COMPILE_OPTIONS\n                 $<$<NOT:$<CONFIG:Debug>>:$<$<COMPILE_LANGUAGE:CXX>:/MP>>)\n    endif()\n  endif()\nendif()\n\n# ----------------------- Optimize binary size --------------------------\n\nadd_library(pybind11::opt_size IMPORTED INTERFACE ${optional_global})\n\nif(MSVC)\n  set(PYBIND11_OPT_SIZE /Os)\nelse()\n  set(PYBIND11_OPT_SIZE -Os)\nendif()\n\nset_property(\n  TARGET pybind11::opt_size\n  APPEND\n  PROPERTY INTERFACE_COMPILE_OPTIONS $<$<CONFIG:Release>:${PYBIND11_OPT_SIZE}>\n           $<$<CONFIG:MinSizeRel>:${PYBIND11_OPT_SIZE}>\n           $<$<CONFIG:RelWithDebInfo>:${PYBIND11_OPT_SIZE}>)\n\n# ----------------------- Legacy option --------------------------\n\n# Warn or error if old variable name used\nif(PYBIND11_CPP_STANDARD)\n  string(REGEX MATCH [[..$]] VAL \"${PYBIND11_CPP_STANDARD}\")\n  if(CMAKE_CXX_STANDARD)\n    if(NOT CMAKE_CXX_STANDARD STREQUAL VAL)\n      message(WARNING \"CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} does not match \"\n                      \"PYBIND11_CPP_STANDARD=${PYBIND11_CPP_STANDARD}, \"\n                      \"please remove PYBIND11_CPP_STANDARD from your cache\")\n    endif()\n  else()\n    set(supported_standards 11 14 17 20)\n    if(\"${VAL}\" IN_LIST supported_standards)\n      message(WARNING \"USE -DCMAKE_CXX_STANDARD=${VAL} instead of PYBIND11_CPP_STANDARD\")\n      set(CMAKE_CXX_STANDARD\n          ${VAL}\n          CACHE STRING \"From PYBIND11_CPP_STANDARD\")\n    else()\n      message(FATAL_ERROR \"PYBIND11_CPP_STANDARD should be replaced with CMAKE_CXX_STANDARD \"\n                          \"(last two chars: ${VAL} not understood as a valid CXX std)\")\n    endif()\n  endif()\nendif()\n\n# --------------------- Python specifics -------------------------\n\n# Check to see which Python mode we are in, new, old, or no python\nif(PYBIND11_NOPYTHON)\n  set(_pybind11_nopython ON)\nelseif(\n  PYBIND11_FINDPYTHON\n  OR Python_FOUND\n  OR Python2_FOUND\n  OR Python3_FOUND)\n  # New mode\n  include(\"${CMAKE_CURRENT_LIST_DIR}/pybind11NewTools.cmake\")\n\nelse()\n\n  # Classic mode\n  include(\"${CMAKE_CURRENT_LIST_DIR}/pybind11Tools.cmake\")\n\nendif()\n\n# --------------------- pybind11_find_import -------------------------------\n\nif(NOT _pybind11_nopython)\n  # Check to see if modules are importable. Use REQUIRED to force an error if\n  # one of the modules is not found. <package_name>_FOUND will be set if the\n  # package was found (underscores replace dashes if present). QUIET will hide\n  # the found message, and VERSION will require a minimum version. A successful\n  # find will cache the result.\n  function(pybind11_find_import PYPI_NAME)\n    # CMake variables need underscores (PyPI doesn't care)\n    string(REPLACE \"-\" \"_\" NORM_PYPI_NAME \"${PYPI_NAME}\")\n\n    # Return if found previously\n    if(${NORM_PYPI_NAME}_FOUND)\n      return()\n    endif()\n\n    set(options \"REQUIRED;QUIET\")\n    set(oneValueArgs \"VERSION\")\n    cmake_parse_arguments(ARG \"${options}\" \"${oneValueArgs}\" \"\" ${ARGN})\n\n    if(ARG_REQUIRED)\n      set(status_level FATAL_ERROR)\n    else()\n      set(status_level WARNING)\n    endif()\n\n    execute_process(\n      COMMAND\n        ${${_Python}_EXECUTABLE} -c\n        \"from pkg_resources import get_distribution; print(get_distribution('${PYPI_NAME}').version)\"\n      RESULT_VARIABLE RESULT_PRESENT\n      OUTPUT_VARIABLE PKG_VERSION\n      ERROR_QUIET)\n\n    string(STRIP \"${PKG_VERSION}\" PKG_VERSION)\n\n    # If a result is present, this failed\n    if(RESULT_PRESENT)\n      set(${NORM_PYPI_NAME}_FOUND\n          ${NORM_PYPI_NAME}-NOTFOUND\n          CACHE INTERNAL \"\")\n      # Always warn or error\n      message(\n        ${status_level}\n        \"Missing: ${PYPI_NAME} ${ARG_VERSION}\\nTry: ${${_Python}_EXECUTABLE} -m pip install ${PYPI_NAME}\"\n      )\n    else()\n      if(ARG_VERSION AND PKG_VERSION VERSION_LESS ARG_VERSION)\n        message(\n          ${status_level}\n          \"Version incorrect: ${PYPI_NAME} ${PKG_VERSION} found, ${ARG_VERSION} required - try upgrading\"\n        )\n      else()\n        set(${NORM_PYPI_NAME}_FOUND\n            YES\n            CACHE INTERNAL \"\")\n        set(${NORM_PYPI_NAME}_VERSION\n            ${PKG_VERSION}\n            CACHE INTERNAL \"\")\n      endif()\n      if(NOT ARG_QUIET)\n        message(STATUS \"Found ${PYPI_NAME} ${PKG_VERSION}\")\n      endif()\n    endif()\n    if(NOT ARG_VERSION OR (NOT PKG_VERSION VERSION_LESS ARG_VERSION))\n      # We have successfully found a good version, cache to avoid calling again.\n    endif()\n  endfunction()\nendif()\n\n# --------------------- LTO -------------------------------\n\ninclude(CheckCXXCompilerFlag)\n\n# Checks whether the given CXX/linker flags can compile and link a cxx file.\n# cxxflags and linkerflags are lists of flags to use.  The result variable is a\n# unique variable name for each set of flags: the compilation result will be\n# cached base on the result variable.  If the flags work, sets them in\n# cxxflags_out/linkerflags_out internal cache variables (in addition to\n# ${result}).\nfunction(_pybind11_return_if_cxx_and_linker_flags_work result cxxflags linkerflags cxxflags_out\n         linkerflags_out)\n  set(CMAKE_REQUIRED_LIBRARIES ${linkerflags})\n  check_cxx_compiler_flag(\"${cxxflags}\" ${result})\n  if(${result})\n    set(${cxxflags_out}\n        \"${cxxflags}\"\n        PARENT_SCOPE)\n    set(${linkerflags_out}\n        \"${linkerflags}\"\n        PARENT_SCOPE)\n  endif()\nendfunction()\n\nfunction(_pybind11_generate_lto target prefer_thin_lto)\n  if(MINGW)\n    message(STATUS \"${target} disabled (problems with undefined symbols for MinGW for now)\")\n    return()\n  endif()\n\n  if(CMAKE_CXX_COMPILER_ID MATCHES \"GNU|Clang\")\n    set(cxx_append \"\")\n    set(linker_append \"\")\n    if(CMAKE_CXX_COMPILER_ID MATCHES \"Clang\" AND NOT APPLE)\n      # Clang Gold plugin does not support -Os; append -O3 to MinSizeRel builds to override it\n      set(linker_append \";$<$<CONFIG:MinSizeRel>:-O3>\")\n    elseif(CMAKE_CXX_COMPILER_ID MATCHES \"GNU\" AND NOT MINGW)\n      set(cxx_append \";-fno-fat-lto-objects\")\n    endif()\n\n    if(CMAKE_SYSTEM_PROCESSOR MATCHES \"ppc64le\" OR CMAKE_SYSTEM_PROCESSOR MATCHES \"mips64\")\n      set(NO_FLTO_ARCH TRUE)\n    else()\n      set(NO_FLTO_ARCH FALSE)\n    endif()\n\n    if(CMAKE_CXX_COMPILER_ID MATCHES \"Clang\"\n       AND prefer_thin_lto\n       AND NOT NO_FLTO_ARCH)\n      _pybind11_return_if_cxx_and_linker_flags_work(\n        HAS_FLTO_THIN \"-flto=thin${cxx_append}\" \"-flto=thin${linker_append}\"\n        PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)\n    endif()\n\n    if(NOT HAS_FLTO_THIN AND NOT NO_FLTO_ARCH)\n      _pybind11_return_if_cxx_and_linker_flags_work(\n        HAS_FLTO \"-flto${cxx_append}\" \"-flto${linker_append}\" PYBIND11_LTO_CXX_FLAGS\n        PYBIND11_LTO_LINKER_FLAGS)\n    endif()\n  elseif(CMAKE_CXX_COMPILER_ID MATCHES \"IntelLLVM\")\n    # IntelLLVM equivalent to LTO is called IPO; also IntelLLVM is WIN32/UNIX\n    # WARNING/HELP WANTED: This block of code is currently not covered by pybind11 GitHub Actions!\n    if(WIN32)\n      _pybind11_return_if_cxx_and_linker_flags_work(\n        HAS_INTEL_IPO \"-Qipo\" \"-Qipo\" PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)\n    else()\n      _pybind11_return_if_cxx_and_linker_flags_work(\n        HAS_INTEL_IPO \"-ipo\" \"-ipo\" PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)\n    endif()\n  elseif(CMAKE_CXX_COMPILER_ID MATCHES \"Intel\")\n    # Intel equivalent to LTO is called IPO\n    _pybind11_return_if_cxx_and_linker_flags_work(HAS_INTEL_IPO \"-ipo\" \"-ipo\"\n                                                  PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)\n  elseif(MSVC)\n    # cmake only interprets libraries as linker flags when they start with a - (otherwise it\n    # converts /LTCG to \\LTCG as if it was a Windows path).  Luckily MSVC supports passing flags\n    # with - instead of /, even if it is a bit non-standard:\n    _pybind11_return_if_cxx_and_linker_flags_work(HAS_MSVC_GL_LTCG \"/GL\" \"-LTCG\"\n                                                  PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)\n  endif()\n\n  # Enable LTO flags if found, except for Debug builds\n  if(PYBIND11_LTO_CXX_FLAGS)\n    # CONFIG takes multiple values in CMake 3.19+, until then we have to use OR\n    set(is_debug \"$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>\")\n    set(not_debug \"$<NOT:${is_debug}>\")\n    set(cxx_lang \"$<COMPILE_LANGUAGE:CXX>\")\n    if(MSVC AND CMAKE_VERSION VERSION_LESS 3.11)\n      set(genex \"${not_debug}\")\n    else()\n      set(genex \"$<AND:${not_debug},${cxx_lang}>\")\n    endif()\n    set_property(\n      TARGET ${target}\n      APPEND\n      PROPERTY INTERFACE_COMPILE_OPTIONS \"$<${genex}:${PYBIND11_LTO_CXX_FLAGS}>\")\n    if(CMAKE_PROJECT_NAME STREQUAL \"pybind11\")\n      message(STATUS \"${target} enabled\")\n    endif()\n  else()\n    if(CMAKE_PROJECT_NAME STREQUAL \"pybind11\")\n      message(STATUS \"${target} disabled (not supported by the compiler and/or linker)\")\n    endif()\n  endif()\n\n  if(PYBIND11_LTO_LINKER_FLAGS)\n    if(CMAKE_VERSION VERSION_LESS 3.11)\n      set_property(\n        TARGET ${target}\n        APPEND\n        PROPERTY INTERFACE_LINK_LIBRARIES \"$<${not_debug}:${PYBIND11_LTO_LINKER_FLAGS}>\")\n    else()\n      set_property(\n        TARGET ${target}\n        APPEND\n        PROPERTY INTERFACE_LINK_OPTIONS \"$<${not_debug}:${PYBIND11_LTO_LINKER_FLAGS}>\")\n    endif()\n  endif()\nendfunction()\n\nadd_library(pybind11::lto IMPORTED INTERFACE ${optional_global})\n_pybind11_generate_lto(pybind11::lto FALSE)\n\nadd_library(pybind11::thin_lto IMPORTED INTERFACE ${optional_global})\n_pybind11_generate_lto(pybind11::thin_lto TRUE)\n\n# ---------------------- pybind11_strip -----------------------------\n\nfunction(pybind11_strip target_name)\n  # Strip unnecessary sections of the binary on Linux/macOS\n  if(CMAKE_STRIP)\n    if(APPLE)\n      set(x_opt -x)\n    endif()\n\n    add_custom_command(\n      TARGET ${target_name}\n      POST_BUILD\n      COMMAND ${CMAKE_STRIP} ${x_opt} $<TARGET_FILE:${target_name}>)\n  endif()\nendfunction()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/pybind11Config.cmake.in",
    "content": "#[=============================================================================[.rst:\n\npybind11Config.cmake\n####################\n\nExported variables\n==================\n\nThis module sets the following variables in your project:\n\n``pybind11_FOUND``\n  true if pybind11 and all required components found on the system\n``pybind11_VERSION``\n  pybind11 version in format Major.Minor.Release\n``pybind11_VERSION_TYPE``\n  pybind11 version type (``dev*`` or empty for a release)\n``pybind11_INCLUDE_DIRS``\n  Directories where pybind11 and python headers are located.\n``pybind11_INCLUDE_DIR``\n  Directory where pybind11 headers are located.\n``pybind11_DEFINITIONS``\n  Definitions necessary to use pybind11, namely USING_pybind11.\n``pybind11_LIBRARIES``\n  Compile flags and python libraries (as needed) to link against.\n``pybind11_LIBRARY``\n  Empty.\n\nAvailable components: None\n\n\nExported targets\n================\n\nIf pybind11 is found, this module defines the following ``IMPORTED``\ninterface library targets:\n\n``pybind11::module``\n  for extension modules.\n``pybind11::embed``\n  for embedding the Python interpreter.\n\nPython headers, libraries (as needed by platform), and the C++ standard\nare attached to the target.\n\nAdvanced targets are also supplied - these are primary for users building\ncomplex applications, and they are available in all modes:\n\n``pybind11::headers``\n  Just the pybind11 headers and minimum compile requirements.\n``pybind11::pybind11``\n  Python headers too.\n``pybind11::python_link_helper``\n  Just the \"linking\" part of ``pybind11:module``, for CMake < 3.15.\n``pybind11::thin_lto``\n  An alternative to ``INTERPROCEDURAL_OPTIMIZATION``.\n``pybind11::lto``\n  An alternative to ``INTERPROCEDURAL_OPTIMIZATION`` (also avoids thin LTO on clang).\n``pybind11::windows_extras``\n  Adds bigobj and mp for MSVC.\n\nModes\n=====\n\nThere are two modes provided; classic, which is built on the old Python\ndiscovery packages in CMake, or the new FindPython mode, which uses FindPython\nfrom 3.12+ forward (3.15+ _highly_ recommended).\n\nNew FindPython mode\n^^^^^^^^^^^^^^^^^^^\n\nTo activate this mode, either call ``find_package(Python COMPONENTS Interpreter Development)``\nbefore finding this package, or set the ``PYBIND11_FINDPYTHON`` variable to ON. In this mode,\nyou can either use the basic targets, or use the FindPython tools:\n\n.. code-block:: cmake\n\n  find_package(Python COMPONENTS Interpreter Development)\n  find_package(pybind11 CONFIG)\n\n  # pybind11 method:\n  pybind11_add_module(MyModule1 src1.cpp)\n\n  # Python method:\n  Python_add_library(MyModule2 src2.cpp)\n  target_link_libraries(MyModule2 pybind11::headers)\n  set_target_properties(MyModule2 PROPERTIES\n                                  INTERPROCEDURAL_OPTIMIZATION ON\n                                  CXX_VISIBILITY_PRESET ON\n                                  VISIBILITY_INLINES_HIDDEN ON)\n\nIf you build targets yourself, you may be interested in stripping the output\nfor reduced size; this is the one other feature that the helper function gives you.\n\nClassic mode\n^^^^^^^^^^^^\n\nSet PythonLibsNew variables to influence python detection and\nCMAKE_CXX_STANDARD to influence standard setting.\n\n.. code-block:: cmake\n\n  find_package(pybind11 CONFIG REQUIRED)\n\n  # Create an extension module\n  add_library(mylib MODULE main.cpp)\n  target_link_libraries(mylib PUBLIC pybind11::module)\n\n  # Or embed the Python interpreter into an executable\n  add_executable(myexe main.cpp)\n  target_link_libraries(myexe PUBLIC pybind11::embed)\n\n\nHints\n=====\n\nThe following variables can be set to guide the search for this package:\n\n``pybind11_DIR``\n  CMake variable, set to directory containing this Config file.\n``CMAKE_PREFIX_PATH``\n  CMake variable, set to root directory of this package.\n``PATH``\n  Environment variable, set to bin directory of this package.\n``CMAKE_DISABLE_FIND_PACKAGE_pybind11``\n  CMake variable, disables ``find_package(pybind11)`` when not ``REQUIRED``,\n  perhaps to force internal build.\n\nCommands\n========\n\npybind11_add_module\n^^^^^^^^^^^^^^^^^^^\n\nThis module defines the following commands to assist with creating Python modules:\n\n.. code-block:: cmake\n\n  pybind11_add_module(<target>\n    [STATIC|SHARED|MODULE]\n    [THIN_LTO] [OPT_SIZE] [NO_EXTRAS] [WITHOUT_SOABI]\n    <files>...\n    )\n\nAdd a module and setup all helpers. You can select the type of the library; the\ndefault is ``MODULE``. There are several options:\n\n``OPT_SIZE``\n  Optimize for size, even if the ``CMAKE_BUILD_TYPE`` is not ``MinSizeRel``.\n``THIN_LTO``\n  Use thin TLO instead of regular if there's a choice (pybind11's selection\n  is disabled if ``CMAKE_INTERPROCEDURAL_OPTIMIZATIONS`` is set).\n``WITHOUT_SOABI``\n  Disable the SOABI component (``PYBIND11_NEWPYTHON`` mode only).\n``NO_EXTRAS``\n  Disable all extras, exit immediately after making the module.\n\npybind11_strip\n^^^^^^^^^^^^^^\n\n.. code-block:: cmake\n\n  pybind11_strip(<target>)\n\nStrip a target after building it (linux/macOS), called by ``pybind11_add_module``.\n\npybind11_extension\n^^^^^^^^^^^^^^^^^^\n\n.. code-block:: cmake\n\n    pybind11_extension(<target>)\n\nSets the Python extension name correctly for Python on your platform, called by\n``pybind11_add_module``.\n\npybind11_find_import(module)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: cmake\n\n    pybind11_find_import(<module> [VERSION <number>] [REQUIRED] [QUIET])\n\nSee if a module is installed. Use the registered name (the one on PyPI). You\ncan specify a ``VERSION``, and you can specify ``REQUIRED`` or ``QUIET``. Only available if\n``NOPYTHON`` mode is not active.  Sets ``module_VERSION`` and ``module_FOUND``. Caches the\nresult once a valid install is found.\n\nSuggested usage\n===============\n\nUsing ``find_package`` with version info is not recommended except for release versions.\n\n.. code-block:: cmake\n\n  find_package(pybind11 CONFIG)\n  find_package(pybind11 2.9 EXACT CONFIG REQUIRED)\n\n#]=============================================================================]\n@PACKAGE_INIT@\n\n# Location of pybind11/pybind11.h\n# This will be relative unless explicitly set as absolute\nset(pybind11_INCLUDE_DIR \"@pybind11_INCLUDEDIR@\")\n\nset(pybind11_LIBRARY \"\")\nset(pybind11_DEFINITIONS USING_pybind11)\nset(pybind11_VERSION_TYPE \"@pybind11_VERSION_TYPE@\")\n\ncheck_required_components(pybind11)\n\nif(TARGET pybind11::python_link_helper)\n  # This has already been setup elsewhere, such as with a previous call or\n  # add_subdirectory\n  return()\nendif()\n\ninclude(\"${CMAKE_CURRENT_LIST_DIR}/pybind11Targets.cmake\")\n\n# Easier to use / remember\nadd_library(pybind11::headers IMPORTED INTERFACE)\nset_target_properties(pybind11::headers PROPERTIES INTERFACE_LINK_LIBRARIES\n                                                   pybind11::pybind11_headers)\n\ninclude(\"${CMAKE_CURRENT_LIST_DIR}/pybind11Common.cmake\")\n\nif(NOT pybind11_FIND_QUIETLY)\n  message(\n    STATUS\n      \"Found pybind11: ${pybind11_INCLUDE_DIR} (found version \\\"${pybind11_VERSION}${pybind11_VERSION_TYPE}\\\")\"\n  )\nendif()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/pybind11NewTools.cmake",
    "content": "# tools/pybind11NewTools.cmake -- Build system for the pybind11 modules\n#\n# Copyright (c) 2020 Wenzel Jakob <wenzel@inf.ethz.ch> and Henry Schreiner\n#\n# All rights reserved. Use of this source code is governed by a\n# BSD-style license that can be found in the LICENSE file.\n\nif(CMAKE_VERSION VERSION_LESS 3.12)\n  message(FATAL_ERROR \"You cannot use the new FindPython module with CMake < 3.12\")\nendif()\n\ninclude_guard(DIRECTORY)\n\nget_property(\n  is_config\n  TARGET pybind11::headers\n  PROPERTY IMPORTED)\n\nif(pybind11_FIND_QUIETLY)\n  set(_pybind11_quiet QUIET)\nelse()\n  set(_pybind11_quiet \"\")\nendif()\n\nif(NOT Python_FOUND AND NOT Python3_FOUND)\n  if(NOT DEFINED Python_FIND_IMPLEMENTATIONS)\n    set(Python_FIND_IMPLEMENTATIONS CPython PyPy)\n  endif()\n\n  # GitHub Actions like activation\n  if(NOT DEFINED Python_ROOT_DIR AND DEFINED ENV{pythonLocation})\n    set(Python_ROOT_DIR \"$ENV{pythonLocation}\")\n  endif()\n\n  find_package(Python 3.6 REQUIRED COMPONENTS Interpreter Development ${_pybind11_quiet})\n\n  # If we are in submodule mode, export the Python targets to global targets.\n  # If this behavior is not desired, FindPython _before_ pybind11.\n  if(NOT is_config)\n    set_property(TARGET Python::Python PROPERTY IMPORTED_GLOBAL TRUE)\n    set_property(TARGET Python::Interpreter PROPERTY IMPORTED_GLOBAL TRUE)\n    if(TARGET Python::Module)\n      set_property(TARGET Python::Module PROPERTY IMPORTED_GLOBAL TRUE)\n    endif()\n  endif()\nendif()\n\nif(Python_FOUND)\n  set(_Python\n      Python\n      CACHE INTERNAL \"\" FORCE)\nelseif(Python3_FOUND)\n  set(_Python\n      Python3\n      CACHE INTERNAL \"\" FORCE)\nendif()\n\nif(PYBIND11_MASTER_PROJECT)\n  if(${_Python}_INTERPRETER_ID MATCHES \"PyPy\")\n    message(STATUS \"PyPy ${${_Python}_PyPy_VERSION} (Py ${${_Python}_VERSION})\")\n  else()\n    message(STATUS \"${_Python} ${${_Python}_VERSION}\")\n  endif()\nendif()\n\n# If a user finds Python, they may forget to include the Interpreter component\n# and the following two steps require it. It is highly recommended by CMake\n# when finding development libraries anyway, so we will require it.\nif(NOT DEFINED ${_Python}_EXECUTABLE)\n  message(\n    FATAL_ERROR\n      \"${_Python} was found without the Interpreter component. Pybind11 requires this component.\")\n\nendif()\n\nif(NOT ${_Python}_EXECUTABLE STREQUAL PYBIND11_PYTHON_EXECUTABLE_LAST)\n  # Detect changes to the Python version/binary in subsequent CMake runs, and refresh config if needed\n  unset(PYTHON_IS_DEBUG CACHE)\n  unset(PYTHON_MODULE_EXTENSION CACHE)\n  set(PYBIND11_PYTHON_EXECUTABLE_LAST\n      \"${${_Python}_EXECUTABLE}\"\n      CACHE INTERNAL \"Python executable during the last CMake run\")\nendif()\n\nif(NOT DEFINED PYTHON_IS_DEBUG)\n  # Debug check - see https://stackoverflow.com/questions/646518/python-how-to-detect-debug-Interpreter\n  execute_process(\n    COMMAND \"${${_Python}_EXECUTABLE}\" \"-c\"\n            \"import sys; sys.exit(hasattr(sys, 'gettotalrefcount'))\"\n    RESULT_VARIABLE _PYTHON_IS_DEBUG)\n  set(PYTHON_IS_DEBUG\n      \"${_PYTHON_IS_DEBUG}\"\n      CACHE INTERNAL \"Python debug status\")\nendif()\n\n# Get the suffix - SO is deprecated, should use EXT_SUFFIX, but this is\n# required for PyPy3 (as of 7.3.1)\nif(NOT DEFINED PYTHON_MODULE_EXTENSION)\n  execute_process(\n    COMMAND\n      \"${${_Python}_EXECUTABLE}\" \"-c\"\n      \"import sys, importlib; s = importlib.import_module('distutils.sysconfig' if sys.version_info < (3, 10) else 'sysconfig'); print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO'))\"\n    OUTPUT_VARIABLE _PYTHON_MODULE_EXTENSION\n    ERROR_VARIABLE _PYTHON_MODULE_EXTENSION_ERR\n    OUTPUT_STRIP_TRAILING_WHITESPACE)\n\n  if(_PYTHON_MODULE_EXTENSION STREQUAL \"\")\n    message(\n      FATAL_ERROR \"pybind11 could not query the module file extension, likely the 'distutils'\"\n                  \"package is not installed. Full error message:\\n${_PYTHON_MODULE_EXTENSION_ERR}\")\n  endif()\n\n  # This needs to be available for the pybind11_extension function\n  set(PYTHON_MODULE_EXTENSION\n      \"${_PYTHON_MODULE_EXTENSION}\"\n      CACHE INTERNAL \"\")\nendif()\n\n# Python debug libraries expose slightly different objects before 3.8\n# https://docs.python.org/3.6/c-api/intro.html#debugging-builds\n# https://stackoverflow.com/questions/39161202/how-to-work-around-missing-pymodule-create2-in-amd64-win-python35-d-lib\nif(PYTHON_IS_DEBUG)\n  set_property(\n    TARGET pybind11::pybind11\n    APPEND\n    PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG)\nendif()\n\n# Check on every access - since Python can change - do nothing in that case.\n\nif(DEFINED ${_Python}_INCLUDE_DIRS)\n  # Only add Python for build - must be added during the import for config\n  # since it has to be re-discovered.\n  #\n  # This needs to be a target to be included after the local pybind11\n  # directory, just in case there there is an installed pybind11 sitting\n  # next to Python's includes. It also ensures Python is a SYSTEM library.\n  add_library(pybind11::python_headers INTERFACE IMPORTED)\n  set_property(\n    TARGET pybind11::python_headers PROPERTY INTERFACE_INCLUDE_DIRECTORIES\n                                             \"$<BUILD_INTERFACE:${${_Python}_INCLUDE_DIRS}>\")\n  set_property(\n    TARGET pybind11::pybind11\n    APPEND\n    PROPERTY INTERFACE_LINK_LIBRARIES pybind11::python_headers)\n  set(pybind11_INCLUDE_DIRS\n      \"${pybind11_INCLUDE_DIR}\" \"${${_Python}_INCLUDE_DIRS}\"\n      CACHE INTERNAL \"Directories where pybind11 and possibly Python headers are located\")\nendif()\n\n# In CMake 3.18+, you can find these separately, so include an if\nif(TARGET ${_Python}::Python)\n  set_property(\n    TARGET pybind11::embed\n    APPEND\n    PROPERTY INTERFACE_LINK_LIBRARIES ${_Python}::Python)\nendif()\n\n# CMake 3.15+ has this\nif(TARGET ${_Python}::Module)\n  set_property(\n    TARGET pybind11::module\n    APPEND\n    PROPERTY INTERFACE_LINK_LIBRARIES ${_Python}::Module)\nelse()\n  set_property(\n    TARGET pybind11::module\n    APPEND\n    PROPERTY INTERFACE_LINK_LIBRARIES pybind11::python_link_helper)\nendif()\n\n# WITHOUT_SOABI and WITH_SOABI will disable the custom extension handling used by pybind11.\n# WITH_SOABI is passed on to python_add_library.\nfunction(pybind11_add_module target_name)\n  cmake_parse_arguments(PARSE_ARGV 1 ARG\n                        \"STATIC;SHARED;MODULE;THIN_LTO;OPT_SIZE;NO_EXTRAS;WITHOUT_SOABI\" \"\" \"\")\n\n  if(ARG_STATIC)\n    set(lib_type STATIC)\n  elseif(ARG_SHARED)\n    set(lib_type SHARED)\n  else()\n    set(lib_type MODULE)\n  endif()\n\n  if(\"${_Python}\" STREQUAL \"Python\")\n    python_add_library(${target_name} ${lib_type} ${ARG_UNPARSED_ARGUMENTS})\n  elseif(\"${_Python}\" STREQUAL \"Python3\")\n    python3_add_library(${target_name} ${lib_type} ${ARG_UNPARSED_ARGUMENTS})\n  else()\n    message(FATAL_ERROR \"Cannot detect FindPython version: ${_Python}\")\n  endif()\n\n  target_link_libraries(${target_name} PRIVATE pybind11::headers)\n\n  if(lib_type STREQUAL \"MODULE\")\n    target_link_libraries(${target_name} PRIVATE pybind11::module)\n  else()\n    target_link_libraries(${target_name} PRIVATE pybind11::embed)\n  endif()\n\n  if(MSVC)\n    target_link_libraries(${target_name} PRIVATE pybind11::windows_extras)\n  endif()\n\n  # -fvisibility=hidden is required to allow multiple modules compiled against\n  # different pybind versions to work properly, and for some features (e.g.\n  # py::module_local).  We force it on everything inside the `pybind11`\n  # namespace; also turning it on for a pybind module compilation here avoids\n  # potential warnings or issues from having mixed hidden/non-hidden types.\n  if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)\n    set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET \"hidden\")\n  endif()\n\n  if(NOT DEFINED CMAKE_CUDA_VISIBILITY_PRESET)\n    set_target_properties(${target_name} PROPERTIES CUDA_VISIBILITY_PRESET \"hidden\")\n  endif()\n\n  # If we don't pass a WITH_SOABI or WITHOUT_SOABI, use our own default handling of extensions\n  if(NOT ARG_WITHOUT_SOABI AND NOT \"WITH_SOABI\" IN_LIST ARG_UNPARSED_ARGUMENTS)\n    pybind11_extension(${target_name})\n  endif()\n\n  if(ARG_NO_EXTRAS)\n    return()\n  endif()\n\n  if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)\n    if(ARG_THIN_LTO)\n      target_link_libraries(${target_name} PRIVATE pybind11::thin_lto)\n    else()\n      target_link_libraries(${target_name} PRIVATE pybind11::lto)\n    endif()\n  endif()\n\n  # Use case-insensitive comparison to match the result of $<CONFIG:cfgs>\n  string(TOUPPER \"${CMAKE_BUILD_TYPE}\" uppercase_CMAKE_BUILD_TYPE)\n  if(NOT MSVC AND NOT \"${uppercase_CMAKE_BUILD_TYPE}\" MATCHES DEBUG|RELWITHDEBINFO)\n    # Strip unnecessary sections of the binary on Linux/macOS\n    pybind11_strip(${target_name})\n  endif()\n\n  if(MSVC)\n    target_link_libraries(${target_name} PRIVATE pybind11::windows_extras)\n  endif()\n\n  if(ARG_OPT_SIZE)\n    target_link_libraries(${target_name} PRIVATE pybind11::opt_size)\n  endif()\nendfunction()\n\nfunction(pybind11_extension name)\n  # The extension is precomputed\n  set_target_properties(${name} PROPERTIES PREFIX \"\" SUFFIX \"${PYTHON_MODULE_EXTENSION}\")\n\nendfunction()\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/pybind11Tools.cmake",
    "content": "# tools/pybind11Tools.cmake -- Build system for the pybind11 modules\n#\n# Copyright (c) 2020 Wenzel Jakob <wenzel.jakob@epfl.ch>\n#\n# All rights reserved. Use of this source code is governed by a\n# BSD-style license that can be found in the LICENSE file.\n\n# include_guard(global) (pre-CMake 3.10)\nif(TARGET pybind11::python_headers)\n  return()\nendif()\n\n# Built-in in CMake 3.5+\ninclude(CMakeParseArguments)\n\nif(pybind11_FIND_QUIETLY)\n  set(_pybind11_quiet QUIET)\nelse()\n  set(_pybind11_quiet \"\")\nendif()\n\n# If this is the first run, PYTHON_VERSION can stand in for PYBIND11_PYTHON_VERSION\nif(NOT DEFINED PYBIND11_PYTHON_VERSION AND DEFINED PYTHON_VERSION)\n  message(WARNING \"Set PYBIND11_PYTHON_VERSION to search for a specific version, not \"\n                  \"PYTHON_VERSION (which is an output). Assuming that is what you \"\n                  \"meant to do and continuing anyway.\")\n  set(PYBIND11_PYTHON_VERSION\n      \"${PYTHON_VERSION}\"\n      CACHE STRING \"Python version to use for compiling modules\")\n  unset(PYTHON_VERSION)\n  unset(PYTHON_VERSION CACHE)\nelseif(DEFINED PYBIND11_PYTHON_VERSION)\n  # If this is set as a normal variable, promote it\n  set(PYBIND11_PYTHON_VERSION\n      \"${PYBIND11_PYTHON_VERSION}\"\n      CACHE STRING \"Python version to use for compiling modules\")\nelse()\n  # Make an empty cache variable.\n  set(PYBIND11_PYTHON_VERSION\n      \"\"\n      CACHE STRING \"Python version to use for compiling modules\")\nendif()\n\n# A user can set versions manually too\nset(Python_ADDITIONAL_VERSIONS\n    \"3.11;3.10;3.9;3.8;3.7;3.6\"\n    CACHE INTERNAL \"\")\n\nlist(APPEND CMAKE_MODULE_PATH \"${CMAKE_CURRENT_LIST_DIR}\")\nfind_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} MODULE REQUIRED ${_pybind11_quiet})\nlist(REMOVE_AT CMAKE_MODULE_PATH -1)\n\n# Makes a normal variable a cached variable\nmacro(_PYBIND11_PROMOTE_TO_CACHE NAME)\n  set(_tmp_ptc \"${${NAME}}\")\n  # CMake 3.21 complains if a cached variable is shadowed by a normal one\n  unset(${NAME})\n  set(${NAME}\n      \"${_tmp_ptc}\"\n      CACHE INTERNAL \"\")\nendmacro()\n\n# Cache variables so pybind11_add_module can be used in parent projects\n_pybind11_promote_to_cache(PYTHON_INCLUDE_DIRS)\n_pybind11_promote_to_cache(PYTHON_LIBRARIES)\n_pybind11_promote_to_cache(PYTHON_MODULE_PREFIX)\n_pybind11_promote_to_cache(PYTHON_MODULE_EXTENSION)\n_pybind11_promote_to_cache(PYTHON_VERSION_MAJOR)\n_pybind11_promote_to_cache(PYTHON_VERSION_MINOR)\n_pybind11_promote_to_cache(PYTHON_VERSION)\n_pybind11_promote_to_cache(PYTHON_IS_DEBUG)\n\nif(PYBIND11_MASTER_PROJECT)\n  if(PYTHON_MODULE_EXTENSION MATCHES \"pypy\")\n    if(NOT DEFINED PYPY_VERSION)\n      execute_process(\n        COMMAND ${PYTHON_EXECUTABLE} -c\n                [=[import sys; sys.stdout.write(\".\".join(map(str, sys.pypy_version_info[:3])))]=]\n        OUTPUT_VARIABLE pypy_version)\n      set(PYPY_VERSION\n          ${pypy_version}\n          CACHE INTERNAL \"\")\n    endif()\n    message(STATUS \"PYPY ${PYPY_VERSION} (Py ${PYTHON_VERSION})\")\n  else()\n    message(STATUS \"PYTHON ${PYTHON_VERSION}\")\n  endif()\nendif()\n\n# Only add Python for build - must be added during the import for config since\n# it has to be re-discovered.\n#\n# This needs to be an target to it is included after the local pybind11\n# directory, just in case there are multiple versions of pybind11, we want the\n# one we expect.\nadd_library(pybind11::python_headers INTERFACE IMPORTED)\nset_property(TARGET pybind11::python_headers PROPERTY INTERFACE_INCLUDE_DIRECTORIES\n                                                      \"$<BUILD_INTERFACE:${PYTHON_INCLUDE_DIRS}>\")\nset_property(\n  TARGET pybind11::pybind11\n  APPEND\n  PROPERTY INTERFACE_LINK_LIBRARIES pybind11::python_headers)\n\nset(pybind11_INCLUDE_DIRS\n    \"${pybind11_INCLUDE_DIR}\" \"${PYTHON_INCLUDE_DIRS}\"\n    CACHE INTERNAL \"Directories where pybind11 and possibly Python headers are located\")\n\n# Python debug libraries expose slightly different objects before 3.8\n# https://docs.python.org/3.6/c-api/intro.html#debugging-builds\n# https://stackoverflow.com/questions/39161202/how-to-work-around-missing-pymodule-create2-in-amd64-win-python35-d-lib\nif(PYTHON_IS_DEBUG)\n  set_property(\n    TARGET pybind11::pybind11\n    APPEND\n    PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG)\nendif()\n\n# The <3.11 code here does not support release/debug builds at the same time, like on vcpkg\nif(CMAKE_VERSION VERSION_LESS 3.11)\n  set_property(\n    TARGET pybind11::module\n    APPEND\n    PROPERTY\n      INTERFACE_LINK_LIBRARIES\n      pybind11::python_link_helper\n      \"$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>>\"\n  )\n\n  set_property(\n    TARGET pybind11::embed\n    APPEND\n    PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>)\nelse()\n  # The IMPORTED INTERFACE library here is to ensure that \"debug\" and \"release\" get processed outside\n  # of a generator expression - https://gitlab.kitware.com/cmake/cmake/-/issues/18424, as they are\n  # target_link_library keywords rather than real libraries.\n  add_library(pybind11::_ClassicPythonLibraries IMPORTED INTERFACE)\n  target_link_libraries(pybind11::_ClassicPythonLibraries INTERFACE ${PYTHON_LIBRARIES})\n  target_link_libraries(\n    pybind11::module\n    INTERFACE\n      pybind11::python_link_helper\n      \"$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:pybind11::_ClassicPythonLibraries>\")\n\n  target_link_libraries(pybind11::embed INTERFACE pybind11::pybind11\n                                                  pybind11::_ClassicPythonLibraries)\nendif()\n\nfunction(pybind11_extension name)\n  # The prefix and extension are provided by FindPythonLibsNew.cmake\n  set_target_properties(${name} PROPERTIES PREFIX \"${PYTHON_MODULE_PREFIX}\"\n                                           SUFFIX \"${PYTHON_MODULE_EXTENSION}\")\nendfunction()\n\n# Build a Python extension module:\n# pybind11_add_module(<name> [MODULE | SHARED] [EXCLUDE_FROM_ALL]\n#                     [NO_EXTRAS] [THIN_LTO] [OPT_SIZE] source1 [source2 ...])\n#\nfunction(pybind11_add_module target_name)\n  set(options \"MODULE;SHARED;EXCLUDE_FROM_ALL;NO_EXTRAS;SYSTEM;THIN_LTO;OPT_SIZE\")\n  cmake_parse_arguments(ARG \"${options}\" \"\" \"\" ${ARGN})\n\n  if(ARG_MODULE AND ARG_SHARED)\n    message(FATAL_ERROR \"Can't be both MODULE and SHARED\")\n  elseif(ARG_SHARED)\n    set(lib_type SHARED)\n  else()\n    set(lib_type MODULE)\n  endif()\n\n  if(ARG_EXCLUDE_FROM_ALL)\n    set(exclude_from_all EXCLUDE_FROM_ALL)\n  else()\n    set(exclude_from_all \"\")\n  endif()\n\n  add_library(${target_name} ${lib_type} ${exclude_from_all} ${ARG_UNPARSED_ARGUMENTS})\n\n  target_link_libraries(${target_name} PRIVATE pybind11::module)\n\n  if(ARG_SYSTEM)\n    message(\n      STATUS\n        \"Warning: this does not have an effect - use NO_SYSTEM_FROM_IMPORTED if using imported targets\"\n    )\n  endif()\n\n  pybind11_extension(${target_name})\n\n  # -fvisibility=hidden is required to allow multiple modules compiled against\n  # different pybind versions to work properly, and for some features (e.g.\n  # py::module_local).  We force it on everything inside the `pybind11`\n  # namespace; also turning it on for a pybind module compilation here avoids\n  # potential warnings or issues from having mixed hidden/non-hidden types.\n  if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)\n    set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET \"hidden\")\n  endif()\n\n  if(NOT DEFINED CMAKE_CUDA_VISIBILITY_PRESET)\n    set_target_properties(${target_name} PROPERTIES CUDA_VISIBILITY_PRESET \"hidden\")\n  endif()\n\n  if(ARG_NO_EXTRAS)\n    return()\n  endif()\n\n  if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)\n    if(ARG_THIN_LTO)\n      target_link_libraries(${target_name} PRIVATE pybind11::thin_lto)\n    else()\n      target_link_libraries(${target_name} PRIVATE pybind11::lto)\n    endif()\n  endif()\n\n  # Use case-insensitive comparison to match the result of $<CONFIG:cfgs>\n  string(TOUPPER \"${CMAKE_BUILD_TYPE}\" uppercase_CMAKE_BUILD_TYPE)\n  if(NOT MSVC AND NOT \"${uppercase_CMAKE_BUILD_TYPE}\" MATCHES DEBUG|RELWITHDEBINFO)\n    pybind11_strip(${target_name})\n  endif()\n\n  if(MSVC)\n    target_link_libraries(${target_name} PRIVATE pybind11::windows_extras)\n  endif()\n\n  if(ARG_OPT_SIZE)\n    target_link_libraries(${target_name} PRIVATE pybind11::opt_size)\n  endif()\nendfunction()\n\n# Provide general way to call common Python commands in \"common\" file.\nset(_Python\n    PYTHON\n    CACHE INTERNAL \"\" FORCE)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/pyproject.toml",
    "content": "[build-system]\nrequires = [\"setuptools>=42\", \"wheel\"]\nbuild-backend = \"setuptools.build_meta\"\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/setup_global.py.in",
    "content": "#!/usr/bin/env python3\n\n# Setup script for pybind11-global (in the sdist or in tools/setup_global.py in the repository)\n# This package is targeted for easy use from CMake.\n\nimport glob\nimport os\nimport re\n\n# Setuptools has to be before distutils\nfrom setuptools import setup\n\nfrom distutils.command.install_headers import install_headers\n\nclass InstallHeadersNested(install_headers):\n    def run(self):\n        headers = self.distribution.headers or []\n        for header in headers:\n            # Remove pybind11/include/\n            short_header = header.split(\"/\", 2)[-1]\n\n            dst = os.path.join(self.install_dir, os.path.dirname(short_header))\n            self.mkpath(dst)\n            (out, _) = self.copy_file(header, dst)\n            self.outfiles.append(out)\n\n\nmain_headers = glob.glob(\"pybind11/include/pybind11/*.h\")\ndetail_headers = glob.glob(\"pybind11/include/pybind11/detail/*.h\")\neigen_headers = glob.glob(\"pybind11/include/pybind11/eigen/*.h\")\nstl_headers = glob.glob(\"pybind11/include/pybind11/stl/*.h\")\ncmake_files = glob.glob(\"pybind11/share/cmake/pybind11/*.cmake\")\npkgconfig_files = glob.glob(\"pybind11/share/pkgconfig/*.pc\")\nheaders = main_headers + detail_headers + stl_headers + eigen_headers\n\ncmdclass = {\"install_headers\": InstallHeadersNested}\n$extra_cmd\n\n# This will _not_ affect installing from wheels,\n# only building wheels or installing from SDist.\n# Primarily intended on Windows, where this is sometimes\n# customized (for example, conda-forge uses Library/)\nbase = os.environ.get(\"PYBIND11_GLOBAL_PREFIX\", \"\")\n\n# Must have a separator\nif base and not base.endswith(\"/\"):\n    base += \"/\"\n\nsetup(\n    name=\"pybind11_global\",\n    version=\"$version\",\n    packages=[],\n    headers=headers,\n    data_files=[\n        (base + \"share/cmake/pybind11\", cmake_files),\n        (base + \"share/pkgconfig\", pkgconfig_files),\n        (base + \"include/pybind11\", main_headers),\n        (base + \"include/pybind11/detail\", detail_headers),\n        (base + \"include/pybind11/eigen\", eigen_headers),\n        (base + \"include/pybind11/stl\", stl_headers),\n    ],\n    cmdclass=cmdclass,\n)\n"
  },
  {
    "path": "pkg/gocv/cgo/third_path/pybind11/tools/setup_main.py.in",
    "content": "#!/usr/bin/env python3\n\n# Setup script (in the sdist or in tools/setup_main.py in the repository)\n\nfrom setuptools import setup\n\ncmdclass = {}\n$extra_cmd\n\nsetup(\n    name=\"pybind11\",\n    version=\"$version\",\n    download_url='https://github.com/pybind/pybind11/tarball/v$version',\n    packages=[\n        \"pybind11\",\n        \"pybind11.include.pybind11\",\n        \"pybind11.include.pybind11.detail\",\n        \"pybind11.include.pybind11.eigen\",\n        \"pybind11.include.pybind11.stl\",\n        \"pybind11.share.cmake.pybind11\",\n        \"pybind11.share.pkgconfig\",\n    ],\n    package_data={\n        \"pybind11\": [\"py.typed\"],\n        \"pybind11.include.pybind11\": [\"*.h\"],\n        \"pybind11.include.pybind11.detail\": [\"*.h\"],\n        \"pybind11.include.pybind11.eigen\": [\"*.h\"],\n        \"pybind11.include.pybind11.stl\": [\"*.h\"],\n        \"pybind11.share.cmake.pybind11\": [\"*.cmake\"],\n        \"pybind11.share.pkgconfig\": [\"*.pc\"],\n    },\n    extras_require={\n        \"global\": [\"pybind11_global==$version\"]\n        },\n    entry_points={\n        \"console_scripts\": [\n             \"pybind11-config = pybind11.__main__:main\",\n        ],\n        \"pipx.run\": [\n             \"pybind11 = pybind11.__main__:main\",\n        ]\n    },\n    cmdclass=cmdclass\n)\n"
  },
  {
    "path": "pkg/gocv/cvtable/cvtable.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage cvtable\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\texp_ \"github.com/kaydxh/golang/go/math/exp\"\n)\n\nconst (\n\tvalidateRows = 101\n\tmaxScore     = 100\n\tminScore     = 0\n)\n\ntype CVTable struct {\n\ttable []float64\n}\n\nfunc NewCVTable(filepath string) (*CVTable, error) {\n\ttable, err := io_.ReadFileLines(filepath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc := &CVTable{}\n\tif table[0] != \"0\" {\n\t\tc.table = append(c.table, 0)\n\t}\n\n\tfor _, v := range table {\n\t\tsim, err := strconv.ParseFloat(v, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tc.table = append(c.table, sim)\n\t}\n\terr = c.Validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c, nil\n}\n\nfunc (c CVTable) Validate() error {\n\tif len(c.table) != validateRows {\n\t\treturn fmt.Errorf(\"invalid cv table rows %v, must be %v\", len(c.table), validateRows)\n\t}\n\n\treturn nil\n}\n\n// score 0-100, mapping to sim\nfunc (c CVTable) Sim(score float64) float64 {\n\tif score <= minScore {\n\t\treturn 0\n\t}\n\n\t// integerPart integer part of a decimal\n\t// decimalPart  decimal part of a decimal\n\tintegerPart := int(score)\n\tdecimalPart := score - float64(integerPart)\n\n\t// len(c.table) - 1 == 100\n\tif integerPart >= len(c.table)-1 {\n\t\treturn 1\n\t}\n\n\treturn c.table[integerPart] + (c.table[integerPart+1]-c.table[integerPart])*decimalPart\n}\n\nfunc (c CVTable) Score(sim float64) float64 {\n\tif sim <= 0 {\n\t\treturn minScore\n\t}\n\tif sim >= 1 {\n\t\treturn maxScore\n\t}\n\n\tpos := sort.Search(len(c.table), func(i int) bool { return c.table[i] >= sim })\n\tscore := float64(pos)\n\tif pos > 0 && pos < len(c.table) {\n\t\tscore += -1.0 + (sim-c.table[pos-1])/(c.table[pos]-c.table[pos-1])\n\t}\n\n\treturn exp_.Value(score, minScore, maxScore)\n}\n"
  },
  {
    "path": "pkg/gocv/cvtable/cvtable_test.go",
    "content": "package cvtable_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tcvtable_ \"github.com/kaydxh/golang/pkg/gocv/cvtable\"\n)\n\nfunc TestSim(t *testing.T) {\n\tcvtable, err := cvtable_.NewCVTable(\"./testdata/cvtable.conf\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed to new cvtable, err: %v\", err)\n\t}\n\n\ttestCases := []struct {\n\t\tscore    float64\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tscore:    95.13,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tscore:    200.13,\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%v\", i), func(t *testing.T) {\n\t\t\tsim := cvtable.Sim(testCase.score)\n\t\t\tt.Logf(\"get sim %v for score %v\", sim, testCase.score)\n\t\t})\n\t}\n}\n\nfunc TestScore(t *testing.T) {\n\tcvtable, err := cvtable_.NewCVTable(\"./testdata/cvtable.conf\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed to new cvtable, err: %v\", err)\n\t}\n\n\ttestCases := []struct {\n\t\tsim      float64\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tsim:      0.9513,\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tsim:      1.20013,\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case-%v\", i), func(t *testing.T) {\n\t\t\tscore := cvtable.Score(testCase.sim)\n\t\t\tt.Logf(\"get score %v for sim %v\", score, testCase.sim)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/gocv/cvtable/testdata/cvtable.conf",
    "content": "0.07337\n0.129694\n0.142051\n0.154408\n0.166765\n0.179122\n0.191479\n0.203836\n0.216193\n0.228550\n0.240907\n0.253264\n0.265621\n0.277978\n0.290335\n0.302692\n0.315049\n0.327406\n0.339763\n0.352120\n0.364477\n0.376834\n0.389191\n0.401548\n0.413905\n0.426262\n0.438619\n0.450976\n0.463333\n0.475690\n0.488047\n0.500404\n0.512761\n0.525118\n0.537475\n0.549832\n0.562189\n0.574546\n0.586903\n0.599260\n0.611617\n0.623974\n0.636331\n0.648688\n0.661045\n0.673402\n0.685759\n0.698116\n0.710473\n0.722830\n0.735187\n0.747544\n0.759901\n0.772258\n0.784615\n0.796972\n0.809329\n0.821686\n0.834043\n0.846400\n0.850240\n0.854080\n0.857920\n0.861760\n0.865600\n0.869440\n0.873280\n0.877120\n0.880960\n0.884800\n0.888640\n0.892480\n0.896320\n0.900160\n0.904000\n0.907840\n0.911680\n0.915520\n0.919360\n0.923200\n0.927040\n0.930880\n0.934720\n0.938560\n0.942400\n0.946240\n0.950080\n0.953920\n0.957760\n0.961600\n0.965440\n0.969280\n0.973120\n0.976960\n0.980800\n0.984640\n0.988480\n0.992320\n0.996160\n1.000000\n"
  },
  {
    "path": "pkg/gocv/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/gocv\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nrequire (\n\tgithub.com/kaydxh/golang/go v0.0.0-00010101000000-000000000000\n\tgolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n"
  },
  {
    "path": "pkg/gocv/go.sum",
    "content": "github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 h1:zfMcR1Cs4KNuomFFgGefv5N0czO2XZpUbxGUy8i8ug0=\ngolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\n"
  },
  {
    "path": "pkg/gocv/point.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage gocv\n\ntype Point struct {\n\tX int32\n\tY int32\n}\n\ntype Pointf struct {\n\tX float32\n\tY float32\n}\n\ntype Polygonf []Pointf\n"
  },
  {
    "path": "pkg/gocv/rect.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage gocv\n\ntype Rect struct {\n\tX      int32\n\tY      int32\n\tWidth  int32\n\tHeight int32\n}\n\nvar ZR Rect\n\nfunc (r Rect) Scale(factor float32) Rect {\n\tox := r.X + r.Width/2\n\toy := r.Y + r.Height/2\n\tr.X = ox + int32(float32((r.X-ox))*factor)\n\tr.Y = oy + int32(float32((r.Y-oy))*factor)\n\tr.Width = int32(float32(r.Width) * factor)\n\tr.Height = int32(float32(r.Height) * factor)\n\n\treturn r\n}\n\n// Empty reports whether the rectangle contains no points.\nfunc (r Rect) Empty() bool {\n\treturn r.Width <= 0 || r.Height <= 0\n}\n\nfunc (r Rect) Area() int32 {\n\treturn r.Width * r.Height\n}\n\nfunc (r Rect) Intersect(s Rect) Rect {\n\trMaxX := r.X + r.Width\n\tsMaxX := s.X + s.Width\n\tif rMaxX > sMaxX {\n\t\trMaxX = sMaxX\n\t}\n\tr.Width = rMaxX - r.X\n\n\trMaxY := r.Y + r.Height\n\tsMaxY := s.Y + s.Height\n\tif rMaxY > sMaxY {\n\t\trMaxY = sMaxY\n\t}\n\n\tif r.X < s.X {\n\t\tr.X = s.X\n\t}\n\tr.Width = rMaxX - r.X\n\n\tif r.Y < s.Y {\n\t\tr.Y = s.Y\n\t}\n\tif rMaxY > sMaxY {\n\t\trMaxY = sMaxY\n\t}\n\tr.Height = rMaxY - r.Y\n\n\t// Letting r0 and s0 be the values of r and s at the time that the method\n\t// is called, this next line is equivalent to:\n\t//\n\t// if max(r0.Min.X, s0.Min.X) >= min(r0.Max.X, s0.Max.X) || likewiseForY { etc }\n\tif r.Empty() {\n\t\treturn ZR\n\t}\n\treturn r\n}\n\n// Union returns the smallest rect that contains both r and s.\nfunc (r Rect) Union(s Rect) Rect {\n\tif r.Empty() {\n\t\treturn s\n\t}\n\tif s.Empty() {\n\t\treturn r\n\t}\n\tif r.X > s.X {\n\t\tr.X = s.X\n\t}\n\tif r.Y > s.Y {\n\t\tr.Y = s.Y\n\t}\n\n\trMaxX := r.X + r.Width\n\tsMaxX := s.X + s.Width\n\tif rMaxX < sMaxX {\n\t\trMaxX = sMaxX\n\t}\n\tr.Width = rMaxX - r.X\n\n\trMaxY := r.Y + r.Height\n\tsMaxY := s.Y + s.Height\n\tif rMaxY < sMaxY {\n\t\trMaxY = sMaxY\n\t}\n\tr.Height = rMaxY - r.Y\n\treturn r\n}\n\n// In reports whether every point in r is in s.\n// true means s is larger than r\nfunc (r Rect) In(s Rect) bool {\n\tif r.Empty() {\n\t\treturn true\n\t}\n\t// Note that r.Max is an exclusive bound for r, so that r.In(s)\n\t// does not require that r.Max.In(s).\n\treturn s.X <= r.X && r.Y <= s.Y &&\n\t\ts.Width <= r.Width && r.Height <= s.Height\n}\n\n// return closest rect\nfunc (r Rect) Closest(rects ...Rect) (float32, Rect) {\n\tif len(rects) == 0 {\n\t\treturn 0, ZR\n\t}\n\tif r.Empty() {\n\t\treturn 0, ZR\n\t}\n\n\tvar (\n\t\tmaxAreaRatio float32\n\t\tclosestRect  Rect\n\t)\n\tfor _, s := range rects {\n\t\tvar areaRatio float32\n\t\tia := r.Intersect(s)\n\t\tif !ia.Empty() {\n\t\t\tareaRatio = float32(ia.Area()) / float32(r.Area())\n\t\t\tif maxAreaRatio < areaRatio {\n\t\t\t\tmaxAreaRatio = areaRatio\n\t\t\t\tclosestRect = s\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn maxAreaRatio, closestRect\n}\n"
  },
  {
    "path": "pkg/gocv/rect_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage gocv_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tgocv_ \"github.com/kaydxh/golang/pkg/gocv\"\n)\n\nfunc TestScale(t *testing.T) {\n\ttestCases := []struct {\n\t\tX      int32\n\t\tY      int32\n\t\tWidth  int32\n\t\tHeight int32\n\t\tfactor float32\n\t}{\n\t\t{\n\t\t\tX:      100,\n\t\t\tY:      100,\n\t\t\tWidth:  100,\n\t\t\tHeight: 100,\n\t\t\tfactor: 1.1,\n\t\t},\n\t\t{\n\t\t\tX:      100,\n\t\t\tY:      100,\n\t\t\tWidth:  100,\n\t\t\tHeight: 100,\n\t\t\tfactor: 0.9,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tr := gocv_.Rect{\n\t\t\t\tX:      testCase.X,\n\t\t\t\tY:      testCase.Y,\n\t\t\t\tWidth:  testCase.Width,\n\t\t\t\tHeight: testCase.Height,\n\t\t\t}\n\t\t\tr2 := r.Scale(testCase.factor).Intersect(r)\n\t\t\tt.Logf(\"r2: %v\", r2)\n\t\t})\n\t}\n}\n\nfunc TestClosest(t *testing.T) {\n\ttestCases := []struct {\n\t\tr  gocv_.Rect\n\t\trs []gocv_.Rect\n\t}{\n\t\t/*\n\t\t\t{\n\t\t\t\tr: gocv_.Rect{\n\t\t\t\t\tX:      1042,\n\t\t\t\t\tY:      518,\n\t\t\t\t\tWidth:  389,\n\t\t\t\t\tHeight: 467,\n\t\t\t\t},\n\t\t\t\trs: []gocv_.Rect{\n\t\t\t\t\t// out\n\t\t\t\t\t{\n\t\t\t\t\t\tX:      0,\n\t\t\t\t\t\tY:      10,\n\t\t\t\t\t\tWidth:  10,\n\t\t\t\t\t\tHeight: 10,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tX:      400,\n\t\t\t\t\t\tY:      600,\n\t\t\t\t\t\tWidth:  700,\n\t\t\t\t\t\tHeight: 700,\n\t\t\t\t\t},\n\n\t\t\t\t\t// small in\n\t\t\t\t\t{\n\t\t\t\t\t\tX:      1100,\n\t\t\t\t\t\tY:      600,\n\t\t\t\t\t\tWidth:  300,\n\t\t\t\t\t\tHeight: 300,\n\t\t\t\t\t},\n\n\t\t\t\t\t//big in\n\t\t\t\t\t{\n\t\t\t\t\t\tX:      938,\n\t\t\t\t\t\tY:      245,\n\t\t\t\t\t\tWidth:  807,\n\t\t\t\t\t\tHeight: 819,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t*/\n\t\t{\n\t\t\tr: gocv_.Rect{\n\t\t\t\tX:      1031,\n\t\t\t\tY:      728,\n\t\t\t\tWidth:  561,\n\t\t\t\tHeight: 340,\n\t\t\t},\n\t\t\trs: []gocv_.Rect{\n\t\t\t\t//big in\n\t\t\t\t{\n\t\t\t\t\tX:      938,\n\t\t\t\t\tY:      244,\n\t\t\t\t\tWidth:  808,\n\t\t\t\t\tHeight: 820,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tarea, cr := testCase.r.Closest(testCase.rs...)\n\t\t\tt.Logf(\"cr: %v, area: %v\", cr, area)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/gocv/vector/vector.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage vector\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"math\"\n\n\trand_ \"github.com/kaydxh/golang/go/math/rand\"\n\t\"golang.org/x/exp/constraints\"\n)\n\ntype Vector[T constraints.Integer | constraints.Float] struct {\n\tdata []T\n}\n\nfunc NewVector[T constraints.Integer | constraints.Float](data ...T) *Vector[T] {\n\tv := &Vector[T]{\n\t\tdata: make([]T, 0),\n\t}\n\tif len(data) > 0 {\n\t\tv.data = data\n\t}\n\treturn v\n}\n\nfunc (v *Vector[T]) Append(t T) {\n\tv.data = append(v.data, t)\n}\n\nfunc (v *Vector[T]) Norm() {\n\tvar sum T\n\tfor _, data := range v.data {\n\t\tsum += data * data\n\t}\n\tmagnitude := math.Sqrt(float64(sum))\n\n\tfor i, value := range v.data {\n\t\tv.data[i] = T(float64(value) / magnitude)\n\t}\n}\n\nfunc (v *Vector[T]) Assign(data []byte) error {\n\tbuf := bytes.NewReader(data)\n\terr := binary.Read(buf, binary.LittleEndian, v.data)\n\treturn err\n}\n\nfunc (v *Vector[T]) Dims() int {\n\treturn len(v.data)\n}\n\nfunc (v *Vector[T]) Len() int {\n\treturn len(v.data)\n}\n\nfunc (v *Vector[T]) Data() []T {\n\treturn v.data\n}\n\nfunc (v Vector[T]) Bytes() ([]byte, error) {\n\tbuf := new(bytes.Buffer)\n\terr := binary.Write(buf, binary.LittleEndian, v.data)\n\treturn buf.Bytes(), err\n}\n\nfunc (v Vector[T]) String() (string, error) {\n\tvar err error\n\tbuf := bytes.NewBuffer([]byte{'['})\n\tfor i, value := range v.data {\n\t\tif i < len(v.data)-1 {\n\t\t\t_, err = buf.WriteString(fmt.Sprintf(\"%v,\", value))\n\t\t} else {\n\t\t\t_, err = buf.WriteString(fmt.Sprintf(\"%v\", value))\n\t\t}\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\t_, err = buf.Write([]byte{']'})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn buf.String(), nil\n}\n\nfunc (v Vector[T]) CosineDistance(r *Vector[T]) float64 {\n\tif v.Len() != r.Len() {\n\t\treturn 0\n\t}\n\n\tvar (\n\t\tsum   float64\n\t\tnormL float64\n\t\tnormR float64\n\t)\n\tfor i := 0; i < v.Len(); i++ {\n\t\tsum += float64(v.Data()[i] * r.Data()[i])\n\t\tnormL += float64(v.Data()[i] * v.Data()[i])\n\t\tnormR += float64(r.Data()[i] * r.Data()[i])\n\t}\n\n\treturn sum / (math.Sqrt(normL) * math.Sqrt(normR))\n}\n\nfunc (v Vector[T]) EuclideanDistance(r *Vector[T]) float64 {\n\tif v.Len() != r.Len() {\n\t\treturn 0\n\t}\n\n\tvar sum float64\n\tfor i := 0; i < v.Len(); i++ {\n\t\tsum += math.Pow(float64(v.Data()[i]-r.Data()[i]), 2)\n\t}\n\n\treturn math.Sqrt(sum)\n}\n\nfunc CreateNormalizedVector[T constraints.Integer | constraints.Float](dim int) []T {\n\tvar ve Vector[T]\n\tfor i := 0; i < dim; i++ {\n\t\tve.Append(T(rand_.Float64()))\n\t}\n\tve.Norm()\n\n\treturn ve.Data()\n}\n\nfunc CosineDistance[T constraints.Integer | constraints.Float](l, r []T) float64 {\n\tv1 := NewVector(l...)\n\tv2 := NewVector(r...)\n\treturn v1.CosineDistance(v2)\n}\n\nfunc EuclideanDistance[T constraints.Integer | constraints.Float](l, r []T) float64 {\n\tv1 := NewVector(l...)\n\tv2 := NewVector(r...)\n\treturn v1.EuclideanDistance(v2)\n}\n"
  },
  {
    "path": "pkg/gocv/vector/vector_test.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage vector_test\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n\n\t\"github.com/kaydxh/golang/pkg/gocv/vector\"\n)\n\nfunc TestVector(t *testing.T) {\n\tvar ve vector.Vector[float32]\n\tfor i := 0; i < 1024; i++ {\n\t\tve.Append(rand.Float32())\n\t}\n\tt.Logf(\"len: %v\", ve.Len())\n\ts, err := ve.String()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get string, err: %v\", err)\n\t}\n\tt.Logf(\"String: %v\", s)\n\n\tve.Norm()\n\ts, err = ve.String()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to get norm string, err: %v\", err)\n\t}\n\tt.Logf(\"Norm string: %v\", s)\n}\n\nfunc TestCreateNormalizedVector(t *testing.T) {\n\tdim := 1024\n\tdata := vector.CreateNormalizedVector[float32](dim)\n\tt.Logf(\"data: %v\", data)\n}\n\nfunc TestCosineDistance(t *testing.T) {\n\tdim := 1024\n\tdata1 := vector.CreateNormalizedVector[float32](dim)\n\tdata2 := vector.CreateNormalizedVector[float32](dim)\n\tv1 := vector.NewVector(data1...)\n\tv2 := vector.NewVector(data2...)\n\tdistance := v1.CosineDistance(v2)\n\tt.Logf(\"cosine distance: %v\", distance)\n\n\tdistance = vector.CosineDistance(data1, data2)\n\tt.Logf(\"cosine distance: %v\", distance)\n\n\tdistance = vector.CosineDistance(data1, data1)\n\tt.Logf(\"cosine distance: %v\", distance)\n}\n\nfunc TestEuclideanDistance(t *testing.T) {\n\tdim := 1024\n\tdata1 := vector.CreateNormalizedVector[float32](dim)\n\tdata2 := vector.CreateNormalizedVector[float32](dim)\n\tv1 := vector.NewVector(data1...)\n\tv2 := vector.NewVector(data2...)\n\tdistance := v1.EuclideanDistance(v2)\n\tt.Logf(\"euclidean distance: %v\", distance)\n\n\tdistance = vector.EuclideanDistance(data1, data2)\n\tt.Logf(\"euclidean distance: %v\", distance)\n}\n"
  },
  {
    "path": "pkg/grpc-gateway/date/date.pb.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.27.0\n// \tprotoc        v3.13.0\n// source: date/date.proto\n\npackage date\n\nimport (\n\t_ \"github.com/golang/protobuf/protoc-gen-go/descriptor\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype DateRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRequestId string `protobuf:\"bytes,1,opt,name=request_id,json=requestId,proto3\" json:\"request_id,omitempty\"`\n}\n\nfunc (x *DateRequest) Reset() {\n\t*x = DateRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_date_date_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *DateRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DateRequest) ProtoMessage() {}\n\nfunc (x *DateRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_date_date_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use DateRequest.ProtoReflect.Descriptor instead.\nfunc (*DateRequest) Descriptor() ([]byte, []int) {\n\treturn file_date_date_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *DateRequest) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\ntype DateResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRequestId string `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"`\n\tDate      string `protobuf:\"bytes,2,opt,name=date,proto3\" json:\"date,omitempty\"`\n}\n\nfunc (x *DateResponse) Reset() {\n\t*x = DateResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_date_date_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *DateResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DateResponse) ProtoMessage() {}\n\nfunc (x *DateResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_date_date_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use DateResponse.ProtoReflect.Descriptor instead.\nfunc (*DateResponse) Descriptor() ([]byte, []int) {\n\treturn file_date_date_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *DateResponse) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\nfunc (x *DateResponse) GetDate() string {\n\tif x != nil {\n\t\treturn x.Date\n\t}\n\treturn \"\"\n}\n\nvar File_date_date_proto protoreflect.FileDescriptor\n\nvar file_date_date_proto_rawDesc = []byte{\n\t0x0a, 0x0f, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,\n\t0x6f, 0x12, 0x0f, 0x73, 0x65, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x64, 0x61,\n\t0x74, 0x65, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70,\n\t0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75,\n\t0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69,\n\t0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,\n\t0x49, 0x64, 0x22, 0x41, 0x0a, 0x0c, 0x44, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,\n\t0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64,\n\t0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49,\n\t0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,\n\t0x04, 0x64, 0x61, 0x74, 0x65, 0x32, 0x53, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72,\n\t0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x03, 0x4e, 0x6f, 0x77, 0x12, 0x1c, 0x2e, 0x73, 0x65,\n\t0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x44, 0x61,\n\t0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x65, 0x61, 0x2e,\n\t0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65,\n\t0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69,\n\t0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f,\n\t0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d,\n\t0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3b, 0x64, 0x61, 0x74,\n\t0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_date_date_proto_rawDescOnce sync.Once\n\tfile_date_date_proto_rawDescData = file_date_date_proto_rawDesc\n)\n\nfunc file_date_date_proto_rawDescGZIP() []byte {\n\tfile_date_date_proto_rawDescOnce.Do(func() {\n\t\tfile_date_date_proto_rawDescData = protoimpl.X.CompressGZIP(file_date_date_proto_rawDescData)\n\t})\n\treturn file_date_date_proto_rawDescData\n}\n\nvar file_date_date_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_date_date_proto_goTypes = []interface{}{\n\t(*DateRequest)(nil),  // 0: sea.api.v1.date.DateRequest\n\t(*DateResponse)(nil), // 1: sea.api.v1.date.DateResponse\n}\nvar file_date_date_proto_depIdxs = []int32{\n\t0, // 0: sea.api.v1.date.DateService.Now:input_type -> sea.api.v1.date.DateRequest\n\t1, // 1: sea.api.v1.date.DateService.Now:output_type -> sea.api.v1.date.DateResponse\n\t1, // [1:2] is the sub-list for method output_type\n\t0, // [0:1] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_date_date_proto_init() }\nfunc file_date_date_proto_init() {\n\tif File_date_date_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_date_date_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*DateRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_date_date_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*DateResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_date_date_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_date_date_proto_goTypes,\n\t\tDependencyIndexes: file_date_date_proto_depIdxs,\n\t\tMessageInfos:      file_date_date_proto_msgTypes,\n\t}.Build()\n\tFile_date_date_proto = out.File\n\tfile_date_date_proto_rawDesc = nil\n\tfile_date_date_proto_goTypes = nil\n\tfile_date_date_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/grpc-gateway/date/date.pb.gw.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.\n// source: date/date.proto\n\n/*\nPackage date is a reverse proxy.\n\nIt translates gRPC into RESTful JSON APIs.\n*/\npackage date\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net/http\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/utilities\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/grpclog\"\n\t\"google.golang.org/grpc/metadata\"\n\t\"google.golang.org/grpc/status\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// Suppress \"imported and not used\" errors\nvar _ codes.Code\nvar _ io.Reader\nvar _ status.Status\nvar _ = runtime.String\nvar _ = utilities.NewDoubleArray\nvar _ = metadata.Join\n\nfunc request_DateService_Now_0(ctx context.Context, marshaler runtime.Marshaler, client DateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {\n\tvar protoReq DateRequest\n\tvar metadata runtime.ServerMetadata\n\n\tnewReader, berr := utilities.IOReaderFactory(req.Body)\n\tif berr != nil {\n\t\treturn nil, metadata, status.Errorf(codes.InvalidArgument, \"%v\", berr)\n\t}\n\tif err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {\n\t\treturn nil, metadata, status.Errorf(codes.InvalidArgument, \"%v\", err)\n\t}\n\n\tmsg, err := client.Now(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))\n\treturn msg, metadata, err\n\n}\n\nfunc local_request_DateService_Now_0(ctx context.Context, marshaler runtime.Marshaler, server DateServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {\n\tvar protoReq DateRequest\n\tvar metadata runtime.ServerMetadata\n\n\tnewReader, berr := utilities.IOReaderFactory(req.Body)\n\tif berr != nil {\n\t\treturn nil, metadata, status.Errorf(codes.InvalidArgument, \"%v\", berr)\n\t}\n\tif err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {\n\t\treturn nil, metadata, status.Errorf(codes.InvalidArgument, \"%v\", err)\n\t}\n\n\tmsg, err := server.Now(ctx, &protoReq)\n\treturn msg, metadata, err\n\n}\n\n// RegisterDateServiceHandlerServer registers the http handlers for service DateService to \"mux\".\n// UnaryRPC     :call DateServiceServer directly.\n// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.\n// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDateServiceHandlerFromEndpoint instead.\nfunc RegisterDateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DateServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_DateService_Now_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/sea.api.v1.date.DateService/Now\", runtime.WithHTTPPathPattern(\"/Now\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DateService_Now_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DateService_Now_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}\n\n// RegisterDateServiceHandlerFromEndpoint is same as RegisterDateServiceHandler but\n// automatically dials to \"endpoint\" and closes the connection when \"ctx\" gets done.\nfunc RegisterDateServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {\n\tconn, err := grpc.Dial(endpoint, opts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tif cerr := conn.Close(); cerr != nil {\n\t\t\t\tgrpclog.Infof(\"Failed to close conn to %s: %v\", endpoint, cerr)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tgo func() {\n\t\t\t<-ctx.Done()\n\t\t\tif cerr := conn.Close(); cerr != nil {\n\t\t\t\tgrpclog.Infof(\"Failed to close conn to %s: %v\", endpoint, cerr)\n\t\t\t}\n\t\t}()\n\t}()\n\n\treturn RegisterDateServiceHandler(ctx, mux, conn)\n}\n\n// RegisterDateServiceHandler registers the http handlers for service DateService to \"mux\".\n// The handlers forward requests to the grpc endpoint over \"conn\".\nfunc RegisterDateServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterDateServiceHandlerClient(ctx, mux, NewDateServiceClient(conn))\n}\n\n// RegisterDateServiceHandlerClient registers the http handlers for service DateService\n// to \"mux\". The handlers forward requests to the grpc endpoint over the given implementation of \"DateServiceClient\".\n// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in \"DateServiceClient\"\n// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in\n// \"DateServiceClient\" to call the correct interceptors.\nfunc RegisterDateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DateServiceClient) error {\n\n\tmux.Handle(\"POST\", pattern_DateService_Now_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/sea.api.v1.date.DateService/Now\", runtime.WithHTTPPathPattern(\"/Now\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_DateService_Now_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DateService_Now_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}\n\nvar (\n\tpattern_DateService_Now_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{\"Now\"}, \"\"))\n)\n\nvar (\n\tforward_DateService_Now_0 = runtime.ForwardResponseMessage\n)\n"
  },
  {
    "path": "pkg/grpc-gateway/date/date.proto",
    "content": "syntax = \"proto3\";\n\npackage sea.api.v1.date;\nimport \"google/protobuf/descriptor.proto\";\n// import\n// \"github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/annotations.proto\";\n// import \"github.com/mwitkow/go-proto-validators/validator.proto\";\n\noption go_package = \"github.com/kaydxh/golang/pkg/grpc-gateway/date;date\";\n\nservice DateService {\n  rpc Now(DateRequest) returns (DateResponse) {\n    // option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {\n    // tags: \"query date\"\n    // consumes: \"\"\n    // produces: \"application/json\"\n    // description: \"return date of the node\\n\"\n    //  };\n  };\n}\n\nmessage DateRequest {\n  string request_id = 1;\n}\n\nmessage DateResponse {\n  string request_id = 1 [json_name = \"RequestId\"];\n  string date = 2;\n}\n"
  },
  {
    "path": "pkg/grpc-gateway/date/date.yaml",
    "content": "# The configuration schema is defined by service.proto file\n# https://github.com/googleapis/googleapis/blob/master/google/api/service.proto\ntype: google.api.Service\nconfig_version: 3\n\n#\n# Name of the service configuration.\n#\nname: sea.date.com\n\n#\n# API title to appear in the user interface (Swagger).\n#\ntitle: Sea Service Date API\n\n#\n# API usage restrictions.\n#\nusage:\n  rules:\n    # Allow unregistered calls for all methods.\n    - selector: \"*\"\n      allow_unregistered_calls: true\n\n#\n# HTTP rules define translation from HTTP/REST/JSON to gRPC. With these rules\n# HTTP/REST/JSON clients will be able to call the DeviceManage service.\n#\nhttp:\n  rules:\n    #\n    # HTTP/REST/JSON clients can call the 'ListShelves' method of the Bookstore\n    # service using the GET HTTP verb and the '/shelves' URL path. The response\n    # will the JSON representation of the 'ListShelvesResponse' message.\n    #\n    # Client example (Assuming your service is hosted at the given 'DOMAIN_NAME'):\n    #   curl http://DOMAIN_NAME/v1/shelves\n    #\n    - selector: sea.api.v1.date.DateService.Now\n      # just for gin, ignore this path for grpc_gateway\n      additional_bindings:\n        - post: '/Now'\n          body: \"*\"\n"
  },
  {
    "path": "pkg/grpc-gateway/date/date_grpc.pb.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-go-grpc. DO NOT EDIT.\n\npackage date\n\nimport (\n\tcontext \"context\"\n\tgrpc \"google.golang.org/grpc\"\n\tcodes \"google.golang.org/grpc/codes\"\n\tstatus \"google.golang.org/grpc/status\"\n)\n\n// This is a compile-time assertion to ensure that this generated file\n// is compatible with the grpc package it is being compiled against.\n// Requires gRPC-Go v1.32.0 or later.\nconst _ = grpc.SupportPackageIsVersion7\n\n// DateServiceClient is the client API for DateService service.\n//\n// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.\ntype DateServiceClient interface {\n\tNow(ctx context.Context, in *DateRequest, opts ...grpc.CallOption) (*DateResponse, error)\n}\n\ntype dateServiceClient struct {\n\tcc grpc.ClientConnInterface\n}\n\nfunc NewDateServiceClient(cc grpc.ClientConnInterface) DateServiceClient {\n\treturn &dateServiceClient{cc}\n}\n\nfunc (c *dateServiceClient) Now(ctx context.Context, in *DateRequest, opts ...grpc.CallOption) (*DateResponse, error) {\n\tout := new(DateResponse)\n\terr := c.cc.Invoke(ctx, \"/sea.api.v1.date.DateService/Now\", in, out, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}\n\n// DateServiceServer is the server API for DateService service.\n// All implementations must embed UnimplementedDateServiceServer\n// for forward compatibility\ntype DateServiceServer interface {\n\tNow(context.Context, *DateRequest) (*DateResponse, error)\n\tmustEmbedUnimplementedDateServiceServer()\n}\n\n// UnimplementedDateServiceServer must be embedded to have forward compatible implementations.\ntype UnimplementedDateServiceServer struct {\n}\n\nfunc (UnimplementedDateServiceServer) Now(context.Context, *DateRequest) (*DateResponse, error) {\n\treturn nil, status.Errorf(codes.Unimplemented, \"method Now not implemented\")\n}\nfunc (UnimplementedDateServiceServer) mustEmbedUnimplementedDateServiceServer() {}\n\n// UnsafeDateServiceServer may be embedded to opt out of forward compatibility for this service.\n// Use of this interface is not recommended, as added methods to DateServiceServer will\n// result in compilation errors.\ntype UnsafeDateServiceServer interface {\n\tmustEmbedUnimplementedDateServiceServer()\n}\n\nfunc RegisterDateServiceServer(s grpc.ServiceRegistrar, srv DateServiceServer) {\n\ts.RegisterService(&DateService_ServiceDesc, srv)\n}\n\nfunc _DateService_Now_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {\n\tin := new(DateRequest)\n\tif err := dec(in); err != nil {\n\t\treturn nil, err\n\t}\n\tif interceptor == nil {\n\t\treturn srv.(DateServiceServer).Now(ctx, in)\n\t}\n\tinfo := &grpc.UnaryServerInfo{\n\t\tServer:     srv,\n\t\tFullMethod: \"/sea.api.v1.date.DateService/Now\",\n\t}\n\thandler := func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\treturn srv.(DateServiceServer).Now(ctx, req.(*DateRequest))\n\t}\n\treturn interceptor(ctx, in, info, handler)\n}\n\n// DateService_ServiceDesc is the grpc.ServiceDesc for DateService service.\n// It's only intended for direct use with grpc.RegisterService,\n// and not to be introspected or modified (even as a copy)\nvar DateService_ServiceDesc = grpc.ServiceDesc{\n\tServiceName: \"sea.api.v1.date.DateService\",\n\tHandlerType: (*DateServiceServer)(nil),\n\tMethods: []grpc.MethodDesc{\n\t\t{\n\t\t\tMethodName: \"Now\",\n\t\t\tHandler:    _DateService_Now_Handler,\n\t\t},\n\t},\n\tStreams:  []grpc.StreamDesc{},\n\tMetadata: \"date/date.proto\",\n}\n"
  },
  {
    "path": "pkg/grpc-gateway/gateway_handler.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpcgateway\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\t\"golang.org/x/net/http2\"\n\t\"golang.org/x/net/http2/h2c\"\n\t\"google.golang.org/grpc\"\n)\n\ntype GRPCHandler interface {\n\tRegister(srv *grpc.Server)\n}\n\ntype GRPCHandlerFunc func(srv *grpc.Server)\n\nfunc (h GRPCHandlerFunc) Register(srv *grpc.Server) {\n\th(srv)\n}\n\ntype HTTPHandler interface {\n\tRegister(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error\n}\n\ntype HTTPHandlerFunc func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error\n\n// ServeMux is a request multiplexer for grpc-gateway.\n// It matches http requests to patterns and invokes the corresponding handler.\n\n// grpc.DialOption configures how we set up the connection. grpc client->\n// grpc server\n\nfunc (h HTTPHandlerFunc) Register(\n\tctx context.Context,\n\tmux *runtime.ServeMux,\n\tendpoint string,\n\topts []grpc.DialOption,\n) error {\n\treturn h(ctx, mux, endpoint, opts)\n}\n\n// grpcHandlerFunc returns an http.Handler that delegates to grpcServer on incoming gRPC\n// connections or otherHandler otherwise. Copied from cockroachdb.\nfunc grpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Handler {\n\treturn h2c.NewHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t// TODO(tamird): point to merged gRPC code rather than a PR.\n\t\t// This is a partial recreation of gRPC's internal checks https://github.com/grpc/grpc-go/pull/514/files#diff-95e9a25b738459a2d3030e1e6fa2a718R61\n\t\tif r.ProtoMajor == 2 && strings.Contains(r.Header.Get(\"Content-Type\"), \"application/grpc\") {\n\t\t\tgrpcServer.ServeHTTP(w, r)\n\t\t} else {\n\t\t\totherHandler.ServeHTTP(w, r)\n\t\t}\n\n\t}), &http2.Server{})\n}\n"
  },
  {
    "path": "pkg/grpc-gateway/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/grpc-gateway\n\ngo 1.25.3\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nreplace github.com/kaydxh/golang/pkg/middleware => ../middleware\n\nreplace github.com/kaydxh/golang/pkg/webserver => ../webserver\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/discovery => ../discovery\n\nreplace github.com/kaydxh/golang/pkg/logs => ../logs\n\nreplace github.com/kaydxh/golang/pkg/file-cleanup => ../file-cleanup\n\nreplace github.com/kaydxh/golang/pkg/file-rotate => ../file-rotate\n\nreplace github.com/kaydxh/golang/pkg/opentelemetry => ../opentelemetry\n\nrequire (\n\tgithub.com/gin-gonic/gin v1.11.0\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/grpc-ecosystem/go-grpc-middleware v1.4.0\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/middleware v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgolang.org/x/net v0.48.0\n\tgoogle.golang.org/grpc v1.77.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect\n\tgithub.com/beorn7/perks v1.0.1 // indirect\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/go-logr/logr v1.4.3 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/google/uuid v1.6.0 // indirect\n\tgithub.com/inconshreveable/mousetrap v1.1.0 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/logs v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-20251125160242-e06b25c89946 // indirect\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946 // indirect\n\tgithub.com/kaydxh/golang/pkg/webserver v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/moby/term v0.5.2 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/prometheus/client_golang v1.23.2 // indirect\n\tgithub.com/prometheus/client_model v0.6.2 // indirect\n\tgithub.com/prometheus/common v0.66.1 // indirect\n\tgithub.com/prometheus/procfs v0.17.0 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/cobra v1.10.1 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/spf13/viper v1.21.0 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.opentelemetry.io/auto/sdk v1.2.1 // indirect\n\tgo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect\n\tgo.opentelemetry.io/otel v1.38.0 // indirect\n\tgo.opentelemetry.io/otel/metric v1.38.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.38.0 // indirect\n\tgo.uber.org/atomic v1.11.0 // indirect\n\tgo.yaml.in/yaml/v2 v2.4.2 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n)\n"
  },
  {
    "path": "pkg/grpc-gateway/go.sum",
    "content": "cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=\ngithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=\ngithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=\ngithub.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=\ngithub.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=\ngithub.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=\ngithub.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=\ngithub.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=\ngithub.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=\ngithub.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=\ngithub.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=\ngithub.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=\ngithub.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=\ngithub.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=\ngithub.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=\ngithub.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=\ngithub.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=\ngithub.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=\ngithub.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=\ngithub.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=\ngithub.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4=\ngithub.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=\ngithub.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=\ngithub.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=\ngithub.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=\ngithub.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=\ngithub.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=\ngithub.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=\ngithub.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=\ngithub.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\ngithub.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=\ngithub.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=\ngithub.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=\ngithub.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=\ngithub.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=\ngithub.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=\ngithub.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=\ngithub.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngithub.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=\ngo.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=\ngo.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=\ngo.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=\ngo.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=\ngo.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=\ngo.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=\ngo.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=\ngolang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=\ngolang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=\ngolang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=\ngolang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=\ngolang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=\ngolang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=\ngolang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=\ngolang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=\ngolang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=\ngolang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=\ngolang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=\ngolang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=\ngolang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=\ngoogle.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=\ngoogle.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=\ngoogle.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=\ngoogle.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=\ngoogle.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=\ngoogle.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=\ngoogle.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=\ngoogle.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=\ngoogle.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=\ngoogle.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\nhonnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=\nhonnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=\n"
  },
  {
    "path": "pkg/grpc-gateway/grpc_gateway.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpcgateway\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"sync\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\tgrpc_ \"github.com/kaydxh/golang/go/net/grpc\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\n\t\"google.golang.org/grpc\"\n)\n\ntype InterceptorOption struct {\n\tgrpcServerOpts struct {\n\t\tunaryInterceptors  []grpc.UnaryServerInterceptor\n\t\tstreamInterceptors []grpc.StreamServerInterceptor\n\t}\n\thttpServerOpts struct {\n\t\thandlerChain http_.HandlerChain\n\t\t/*\n\t\t\t//invoke before http handler\n\t\t\tPreHttpInterceptors []http_.HandlerInterceptor\n\t\t\t//invoke after http handler\n\t\t\tPostHttpInterceptors []http_.HandlerInterceptor\n\t\t*/\n\t}\n}\n\ntype GRPCGateway struct {\n\tgrpcServer *grpc.Server\n\thttp.Server\n\t//assigned by ginRouter in PrepareRun\n\tHandler http.Handler\n\t//gatewayMux for http handler\n\tgatewayMux *runtime.ServeMux\n\tonce       sync.Once\n\n\topts struct {\n\t\tinterceptionOptions InterceptorOption\n\t\tserverOptions       []grpc.ServerOption\n\t\tgatewayMuxOptions   []runtime.ServeMuxOption\n\t\tclientDialOptions   []grpc.DialOption\n\t}\n}\n\nfunc NewGRPCGateWay(addr string, options ...GRPCGatewayOption) *GRPCGateway {\n\tserver := &GRPCGateway{\n\t\tServer: http.Server{\n\t\t\tAddr: addr,\n\t\t},\n\t}\n\tserver.ApplyOptions(options...)\n\n\treturn server\n}\n\nfunc (g *GRPCGateway) initOnce() {\n\tg.once.Do(func() {\n\t\t//now not support tls\n\t\tg.opts.clientDialOptions = append(g.opts.clientDialOptions, grpc_.ClientDialOptions(\n\t\t\t0, 0, 0, // 使用默认值\n\t\t\tnil, nil, // 客户端拦截器为空\n\t\t)...)\n\n\t\tserverOptions := []grpc.ServerOption{}\n\t\tserverOptions = append(\n\t\t\tg.opts.serverOptions,\n\t\t\tgrpc.ChainUnaryInterceptor(g.opts.interceptionOptions.grpcServerOpts.unaryInterceptors...),\n\t\t\tgrpc.ChainStreamInterceptor(g.opts.interceptionOptions.grpcServerOpts.streamInterceptors...),\n\t\t)\n\n\t\tg.opts.gatewayMuxOptions = append(g.opts.gatewayMuxOptions,\n\t\t\truntime.WithRoutingErrorHandler(\n\t\t\t\tfunc(ctx context.Context, mux *runtime.ServeMux,\n\t\t\t\t\tmarshaler runtime.Marshaler,\n\t\t\t\t\tw http.ResponseWriter, r *http.Request, code int) {\n\n\t\t\t\t\t//g.Handler is gin handler\n\t\t\t\t\thttpHandler := g.Handler\n\t\t\t\t\tif httpHandler == nil {\n\t\t\t\t\t\thttpHandler = http.DefaultServeMux\n\t\t\t\t\t}\n\n\t\t\t\t\t// NotFound and NotAllowed, use gin handler\n\t\t\t\t\tif code == http.StatusNotFound || code == http.StatusMethodNotAllowed {\n\t\t\t\t\t\thttpHandler.ServeHTTP(w, r)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\truntime.DefaultRoutingErrorHandler(ctx, mux, marshaler, w, r, code)\n\t\t\t\t}))\n\n\t\tg.grpcServer = grpc.NewServer(serverOptions...)\n\t\tg.gatewayMux = runtime.NewServeMux(g.opts.gatewayMuxOptions...)\n\t\tg.Server.Handler = grpcHandlerFunc(g.grpcServer, g)\n\t})\n}\n\n// ServeHTTP, wrap g.gateMux httpServerOpts, and called by grpcHandlerFunc\nfunc (g *GRPCGateway) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tg.opts.interceptionOptions.httpServerOpts.handlerChain.WrapH(g.gatewayMux).ServeHTTP(w, r)\n}\n\nfunc (g *GRPCGateway) ListenAndServe() error {\n\tg.initOnce()\n\treturn g.Server.ListenAndServe()\n}\n\nfunc (g *GRPCGateway) registerGRPCFunc(h GRPCHandler) {\n\tg.initOnce()\n\th.Register(g.grpcServer)\n}\n\nfunc (g *GRPCGateway) RegisterGRPCHandler(h func(srv *grpc.Server)) {\n\tg.initOnce()\n\tg.registerGRPCFunc(GRPCHandlerFunc(h))\n}\n\nfunc (g *GRPCGateway) registerHTTPFunc(ctx context.Context, h HTTPHandler) error {\n\tg.initOnce()\n\treturn h.Register(ctx, g.gatewayMux, g.Server.Addr, g.opts.clientDialOptions)\n}\n\nfunc (g *GRPCGateway) RegisterHTTPHandler(ctx context.Context,\n\th func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error,\n) error {\n\tg.initOnce()\n\treturn g.registerHTTPFunc(ctx, HTTPHandlerFunc(h))\n}\n"
  },
  {
    "path": "pkg/grpc-gateway/grpc_gateway_grpc.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpcgateway\n\nimport (\n\t\"runtime/debug\"\n\t\"time\"\n\n\tinterceptorlogrus_ \"github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus\"\n\tinterceptorrecovery_ \"github.com/grpc-ecosystem/go-grpc-middleware/recovery\"\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\trate_ \"github.com/kaydxh/golang/go/time/rate\"\n\tinterceptortcloud_ \"github.com/kaydxh/golang/pkg/middleware/api/tcloud/v3.0\"\n\tinterceptordebug_ \"github.com/kaydxh/golang/pkg/middleware/grpc-middleware/debug\"\n\tinterceptoropentelemetry_ \"github.com/kaydxh/golang/pkg/middleware/grpc-middleware/opentelemetry\"\n\tinterceptorratelimit_ \"github.com/kaydxh/golang/pkg/middleware/grpc-middleware/ratelimit\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\n// QPSLimitConfig QPS限流配置\ntype QPSLimitConfig struct {\n\t// DefaultQPS 默认QPS限制，0表示不限制\n\tDefaultQPS float64\n\t// DefaultBurst 默认突发容量\n\tDefaultBurst int\n\t// MaxConcurrency 最大并发数限制，0表示不限制\n\t// 与QPS限流不同，并发控制限制的是同时处理的请求数，请求完成后令牌会归还\n\tMaxConcurrency int\n\t// MethodQPS 方法级QPS配置，key为完整方法名（如 /package.Service/Method）\n\tMethodQPS map[string]float64\n\t// MethodBurst 方法级突发容量配置\n\tMethodBurst map[string]int\n\t// MethodMaxConcurrency 方法级最大并发数配置\n\tMethodMaxConcurrency map[string]int\n}\n\nfunc WithServerOptions(opts ...grpc.ServerOption) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tc.opts.serverOptions = append(c.opts.serverOptions, opts...)\n\t})\n}\n\nfunc WithClientDialOptions(opts ...grpc.DialOption) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tc.opts.clientDialOptions = append(c.opts.clientDialOptions, opts...)\n\t})\n}\n\nfunc WithServerUnaryInterceptorsOptions(opts ...grpc.UnaryServerInterceptor) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tc.opts.interceptionOptions.grpcServerOpts.unaryInterceptors = append(\n\t\t\tc.opts.interceptionOptions.grpcServerOpts.unaryInterceptors,\n\t\t\topts...)\n\t})\n}\n\nfunc WithServerStreamInterceptorsOptions(opts ...grpc.StreamServerInterceptor) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tc.opts.interceptionOptions.grpcServerOpts.streamInterceptors = append(\n\t\t\tc.opts.interceptionOptions.grpcServerOpts.streamInterceptors,\n\t\t\topts...)\n\t})\n}\n\nfunc WithServerInterceptorsLogrusOptions(\n\tlogger *logrus.Logger,\n) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tl := logrus.NewEntry(logger)\n\t\tWithServerUnaryInterceptorsOptions(interceptorlogrus_.UnaryServerInterceptor(l)).apply(c)\n\t\tWithServerStreamInterceptorsOptions(interceptorlogrus_.StreamServerInterceptor(l)).apply(c)\n\t})\n}\n\n// recover\nfunc WithServerInterceptorsRecoveryOptions() GRPCGatewayOption {\n\topts := []interceptorrecovery_.Option{\n\t\tinterceptorrecovery_.WithRecoveryHandler(func(r interface{}) (err error) {\n\t\t\tout, err := runtime_.FormatStack()\n\t\t\tif err != nil {\n\t\t\t\tlogrus.WithError(status.Errorf(codes.Internal, \"%s\", r)).Errorf(\"%s\", debug.Stack())\n\t\t\t} else {\n\t\t\t\tlogrus.WithError(status.Errorf(codes.Internal, \"%s\", r)).Errorf(\"%s\", out)\n\t\t\t}\n\n\t\t\treturn status.Errorf(codes.Internal, \"panic: %v\", r)\n\t\t}),\n\t}\n\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithServerUnaryInterceptorsOptions(interceptorrecovery_.UnaryServerInterceptor(opts...)).apply(c)\n\t\tWithServerStreamInterceptorsOptions(interceptorrecovery_.StreamServerInterceptor(opts...)).apply(c)\n\t})\n}\n\n// Deprecated: Use WithServerUnaryMetricInterceptorOptions instead\nfunc WithServerUnaryInterceptorsTimerOptions(enabledMetric bool) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tif enabledMetric {\n\t\t\tWithServerUnaryInterceptorsOptions(interceptoropentelemetry_.UnaryServerMetricInterceptor()).apply(c)\n\t\t}\n\t})\n}\n\n// Deprecated: Use WithServerUnaryMetricInterceptorOptions instead\nfunc WithServerUnaryInterceptorsCodeMessageOptions(enabledMetric bool) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tif enabledMetric {\n\t\t\tWithServerUnaryInterceptorsOptions(\n\t\t\t\tinterceptoropentelemetry_.UnaryServerMetricInterceptor(),\n\t\t\t).apply(\n\t\t\t\tc,\n\t\t\t)\n\t\t}\n\t})\n}\n\nfunc WithServerUnaryMetricInterceptorOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithServerUnaryInterceptorsOptions(\n\t\t\tinterceptoropentelemetry_.UnaryServerMetricInterceptor(),\n\t\t).apply(\n\t\t\tc,\n\t\t)\n\t})\n}\n\n// WithServerUnaryTraceInterceptorOptions adds OpenTelemetry trace interceptor\nfunc WithServerUnaryTraceInterceptorOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithServerUnaryInterceptorsOptions(\n\t\t\tinterceptoropentelemetry_.UnaryServerTraceInterceptor(),\n\t\t).apply(c)\n\t\tWithServerStreamInterceptorsOptions(\n\t\t\tinterceptoropentelemetry_.StreamServerTraceInterceptor(),\n\t\t).apply(c)\n\t})\n}\n\nfunc WithServerUnaryInterceptorsRequestIdOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithServerUnaryInterceptorsOptions(interceptordebug_.UnaryServerInterceptorOfRequestId()).apply(c)\n\t})\n}\n\nfunc WithServerUnaryInterceptorsErrorOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithServerUnaryInterceptorsOptions(interceptortcloud_.UnaryServerInterceptorOfError()).apply(c)\n\t\t//WithServerStreamInterceptorsOptions(interceptortcloud_.StreamServerInterceptor()).apply(c)\n\t})\n}\n\n//limiter rate for grpc api\nfunc WithServerInterceptorsLimitRateOptions(burstUnary, burstStream int) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tif burstUnary > 0 {\n\t\t\tlimiterUnary := rate_.NewLimiter(burstUnary)\n\t\t\tWithServerUnaryInterceptorsOptions(interceptorratelimit_.UnaryServerInterceptor(limiterUnary)).apply(c)\n\t\t}\n\n\t\tif burstStream > 0 {\n\t\t\tlimiterStream := rate_.NewLimiter(burstStream)\n\t\t\tWithServerStreamInterceptorsOptions(interceptorratelimit_.StreamServerInterceptor(limiterStream)).apply(c)\n\t\t}\n\t})\n}\n\n// WithServerInterceptorsQPSLimitOptions QPS限流拦截器选项\n// 支持全局默认QPS和方法级QPS配置\nfunc WithServerInterceptorsQPSLimitOptions(config QPSLimitConfig) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\t// QPS限流\n\t\tif config.DefaultQPS > 0 || len(config.MethodQPS) > 0 {\n\t\t\t// 创建方法级QPS限流器\n\t\t\tdefaultBurst := config.DefaultBurst\n\t\t\tif defaultBurst <= 0 {\n\t\t\t\tdefaultBurst = int(config.DefaultQPS)\n\t\t\t}\n\t\t\tmethodLimiter := rate_.NewMethodQPSLimiter(config.DefaultQPS, defaultBurst)\n\n\t\t\t// 设置方法级QPS配置\n\t\t\tfor method, qps := range config.MethodQPS {\n\t\t\t\tburst := config.MethodBurst[method]\n\t\t\t\tif burst <= 0 {\n\t\t\t\t\tburst = int(qps)\n\t\t\t\t}\n\t\t\t\tmethodLimiter.SetMethodQPS(method, qps, burst)\n\t\t\t}\n\n\t\t\tWithServerUnaryInterceptorsOptions(\n\t\t\t\tinterceptorratelimit_.UnaryServerInterceptorQPS(methodLimiter),\n\t\t\t).apply(c)\n\t\t}\n\n\t\t// 并发控制\n\t\tif config.MaxConcurrency > 0 || len(config.MethodMaxConcurrency) > 0 {\n\t\t\tdefaultConcurrency := config.MaxConcurrency\n\t\t\tif defaultConcurrency <= 0 {\n\t\t\t\tdefaultConcurrency = 0 // 不限制\n\t\t\t}\n\t\t\tconcurrencyLimiter := rate_.NewMethodLimiter(defaultConcurrency)\n\n\t\t\t// 设置方法级并发配置\n\t\t\tfor method, maxConcurrency := range config.MethodMaxConcurrency {\n\t\t\t\tif maxConcurrency > 0 {\n\t\t\t\t\tconcurrencyLimiter.AddLimiter(method, rate_.NewLimiter(maxConcurrency))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tWithServerUnaryInterceptorsOptions(\n\t\t\t\tinterceptorratelimit_.UnaryServerInterceptorConcurrency(concurrencyLimiter),\n\t\t\t).apply(c)\n\t\t}\n\t})\n}\n\nfunc WithServerUnaryInterceptorsInOutPacketOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithServerUnaryInterceptorsOptions(interceptordebug_.UnaryServerInterceptorOfInOutputPrinter()).apply(c)\n\t})\n}\n\n// timeout\nfunc WithServerInterceptorTimeoutOptions(timeout time.Duration) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tif timeout > 0 {\n\t\t\truntime.DefaultContextTimeout = timeout\n\t\t}\n\t})\n}\n\n/*\n// WithHttpHandlerInterceptorOptions\nfunc WithHttpHandlerInterceptorOptions(opts ...http_.HandlerChainOption) GRPCGatewayOption {\n\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tc.opts.interceptionOptions.httpServerOpts.handlerChain.ApplyOptions(opts...)\n\t})\n}\n\n// WithHttpHandlerInterceptorOptions\nfunc WithHttpHandlerInterceptorOptions(opts ...http_.HandlerInterceptorsOption) GRPCGatewayOption {\n\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tc.opts.interceptionOptions.httpServerOpts.httpInterceptors.ApplyOptions(opts...)\n\t})\n}\n\nfunc WithHttpHandlerInterceptor(handler func(http.Handler) http.Handler) GRPCGatewayOption {\n\n\treturn WithHttpHandlerInterceptorOptions(\n\t\thttp_.HandlerInterceptorsOptionFunc(func(handlers *http_.HandlerInterceptors) {\n\t\t\thandlers.Interceptors = append(handlers.Interceptors, handler)\n\t\t}),\n\t)\n}\n*/\n\n// WithHttpHandlerInterceptorTraceIDOptions\n/*\nfunc WithHttpHandlerInterceptorInOutPacketOptions() GRPCGatewayOption {\n\t//return WithHttpHandlerInterceptor(httpinterceptorinoutpacket_.InOutPacket)\n\treturn WithHttpHandlerInterceptor(httpinterceptorinoutpacket_.InOutPacket)\n}\n*/\n"
  },
  {
    "path": "pkg/grpc-gateway/grpc_gateway_http.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpcgateway\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/gin-gonic/gin/binding\"\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\tmarshaler_ \"github.com/kaydxh/golang/go/runtime/marshaler\"\n\tinterceptortcloud3_ \"github.com/kaydxh/golang/pkg/middleware/api/tcloud/v3.0\"\n\tinterceptortrivialv1_ \"github.com/kaydxh/golang/pkg/middleware/api/trivial/v1\"\n\tinterceptortrivialv2_ \"github.com/kaydxh/golang/pkg/middleware/api/trivial/v2\"\n\thttpinterceptorcors_ \"github.com/kaydxh/golang/pkg/middleware/http-middleware/cors\"\n\thttpinterceptordebug_ \"github.com/kaydxh/golang/pkg/middleware/http-middleware/debug\"\n\thttpinterceptorhttp_ \"github.com/kaydxh/golang/pkg/middleware/http-middleware/http\"\n\thttpinterceptoropentelemetr_ \"github.com/kaydxh/golang/pkg/middleware/http-middleware/opentelemetry\"\n\thttpinterceptorlimiter_ \"github.com/kaydxh/golang/pkg/middleware/http-middleware/ratelimiter\"\n\thttpinterceptortimer_ \"github.com/kaydxh/golang/pkg/middleware/http-middleware/timer\"\n)\n\nfunc WithGatewayMuxOptions(opts ...runtime.ServeMuxOption) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tc.opts.gatewayMuxOptions = append(c.opts.gatewayMuxOptions, opts...)\n\t})\n}\n\n//now unused, only called by successed response, only append message to response\nfunc WithServerInterceptorsHTTPForwardResponseOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithGatewayMuxOptions(runtime.WithForwardResponseOption(interceptortcloud3_.HTTPForwardResponse)).apply(c)\n\t})\n}\n\n//now unused, only called by successed response\nfunc WithServerInterceptorsTrivialV1HTTPForwardResponseOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithGatewayMuxOptions(runtime.WithForwardResponseOption(interceptortrivialv1_.HTTPForwardResponse)).apply(c)\n\t})\n}\n\n//tcloud api3.0 http response formatter\nfunc WithServerInterceptorsTCloud30HTTPResponseOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithGatewayMuxOptions(\n\t\t\truntime.WithMarshalerOption(runtime.MIMEWildcard, interceptortcloud3_.NewDefaultJSONPb()),\n\t\t).apply(\n\t\t\tc,\n\t\t)\n\n\t\tWithGatewayMuxOptions(\n\t\t\truntime.WithMarshalerOption(binding.MIMEJSON, interceptortcloud3_.NewDefaultJSONPb()),\n\t\t).apply(\n\t\t\tc,\n\t\t)\n\t})\n}\n\n//trivial api1.0 http response formatter\nfunc WithServerInterceptorsTrivialV1HTTPResponseOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithGatewayMuxOptions(\n\t\t\truntime.WithMarshalerOption(runtime.MIMEWildcard, marshaler_.NewDefaultJSONPb()),\n\t\t).apply(\n\t\t\tc,\n\t\t)\n\n\t\tWithGatewayMuxOptions(\n\t\t\truntime.WithMarshalerOption(binding.MIMEJSON, marshaler_.NewDefaultJSONPb()),\n\t\t).apply(\n\t\t\tc,\n\t\t)\n\t})\n}\n\n//trivial api2.0 http response formatter\nfunc WithServerInterceptorsTrivialV2HTTPResponseOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithGatewayMuxOptions(\n\t\t\truntime.WithMarshalerOption(runtime.MIMEWildcard, marshaler_.NewDefaultJSONPb()),\n\t\t).apply(\n\t\t\tc,\n\t\t)\n\n\t\tWithGatewayMuxOptions(\n\t\t\truntime.WithMarshalerOption(binding.MIMEJSON, marshaler_.NewDefaultJSONPb()),\n\t\t).apply(\n\t\t\tc,\n\t\t)\n\t})\n}\n\n// http body proto Marshal\nfunc WithServerInterceptorsHttpBodyProtoOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithGatewayMuxOptions(\n\t\t\truntime.WithMarshalerOption(\n\t\t\t\tbinding.MIMEPROTOBUF,\n\t\t\t\t&marshaler_.ProtoMarshaller{},\n\t\t\t),\n\t\t).apply(\n\t\t\tc,\n\t\t)\n\t})\n}\n\n//HTTP, only called by failed response\nfunc WithServerInterceptorsTCloud30HttpErrorOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithGatewayMuxOptions(runtime.WithErrorHandler(interceptortcloud3_.HTTPError)).apply(c)\n\t})\n}\n\n//HTTP, only called by failed response\nfunc WithServerInterceptorsTrivialV1HttpErrorOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithGatewayMuxOptions(runtime.WithErrorHandler(interceptortrivialv1_.HTTPError)).apply(c)\n\t})\n}\n\n//HTTP, only called by failed response\nfunc WithServerInterceptorsTrivialV2HttpErrorOptions() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tWithGatewayMuxOptions(runtime.WithErrorHandler(interceptortrivialv2_.HTTPError)).apply(c)\n\t})\n}\n\n// WithHttpPreHandlerInterceptorOptions\nfunc WithHttpPreHandlerInterceptorOptions(\n\thandlers ...func(w http.ResponseWriter, r *http.Request) error,\n) GRPCGatewayOption {\n\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tc.opts.interceptionOptions.httpServerOpts.handlerChain.PreHandlers = append(\n\t\t\tc.opts.interceptionOptions.httpServerOpts.handlerChain.PreHandlers,\n\t\t\thandlers...)\n\t})\n}\n\n// WithHttpHandlerInterceptorOptions\nfunc WithHttpHandlerInterceptorOptions(handlers ...http_.HandlerInterceptor) GRPCGatewayOption {\n\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tif handlers != nil {\n\t\t\tc.opts.interceptionOptions.httpServerOpts.handlerChain.Handlers = append(\n\t\t\t\tc.opts.interceptionOptions.httpServerOpts.handlerChain.Handlers,\n\t\t\t\thandlers...)\n\t\t}\n\t})\n}\n\n// WithHttpPostHandlerInterceptorOptions\nfunc WithHttpPostHandlerInterceptorOptions(\n\thandlers ...func(w http.ResponseWriter, r *http.Request),\n) GRPCGatewayOption {\n\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\tc.opts.interceptionOptions.httpServerOpts.handlerChain.PostHandlers = append(\n\t\t\tc.opts.interceptionOptions.httpServerOpts.handlerChain.PostHandlers,\n\t\t\thandlers...)\n\t})\n}\n\n// WithHttpHandlerInterceptorRequestIDAndTraceIDOptions extracts X-Request-ID and X-Traceid\n// from HTTP request into context. If absent, X-Request-ID is auto-generated and X-Traceid\n// defaults to the same value as X-Request-ID.\nfunc WithHttpHandlerInterceptorRequestIDAndTraceIDOptions() GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptordebug_.RequestIDAndTraceID,\n\t})\n}\n\n// WithHttpHandlerInterceptorRequestIDOptions is an alias for backward compatibility.\n// Deprecated: Use WithHttpHandlerInterceptorRequestIDAndTraceIDOptions instead.\nfunc WithHttpHandlerInterceptorRequestIDOptions() GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorRequestIDAndTraceIDOptions()\n}\n\nfunc WithHttpHandlerInterceptorsTimerOptions() GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptortimer_.ServerInterceptorOfTimer,\n\t})\n}\n\nfunc WithHttpHandlerInterceptorsMetricOptions() GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptoropentelemetr_.Metric,\n\t})\n}\n\n// WithHttpHandlerInterceptorsTraceOptions adds OpenTelemetry trace interceptor for HTTP requests\nfunc WithHttpHandlerInterceptorsTraceOptions() GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptoropentelemetr_.Trace,\n\t})\n}\n\nfunc WithHttpHandlerInterceptorInOutputPrinterOptions(enabled bool) GRPCGatewayOption {\n\tif enabled {\n\t\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\t\tInterceptor: httpinterceptordebug_.InOutputPrinter,\n\t\t})\n\t}\n\n\treturn WithHttpHandlerInterceptorOptions()\n}\n\nfunc WithHttpHandlerInterceptorInOutputHeaderPrinterOptions(enabled bool) GRPCGatewayOption {\n\tif enabled {\n\t\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\t\tInterceptor: httpinterceptordebug_.InOutputHeaderPrinter,\n\t\t})\n\t}\n\treturn WithHttpHandlerInterceptorOptions()\n}\n\n// timeout\nfunc WithHttpHandlerInterceptorTimeoutOptions(timeout time.Duration) GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptorhttp_.Timeout(timeout),\n\t})\n}\n\nfunc WithHttpHandlerInterceptorsLimitAllOptions(burst int) GRPCGatewayOption {\n\thandler := http_.HandlerInterceptor{}\n\tif burst > 0 {\n\t\thandler.Interceptor = httpinterceptorlimiter_.LimitAll(burst).Handler\n\t}\n\n\treturn WithHttpHandlerInterceptorOptions(handler)\n}\n\n// HTTPQPSLimitConfig HTTP QPS限流配置\ntype HTTPQPSLimitConfig struct {\n\t// DefaultQPS 默认QPS限制，0表示不限制\n\tDefaultQPS float64\n\t// DefaultBurst 默认突发容量\n\tDefaultBurst int\n\t// MaxConcurrency 最大并发数限制，0表示不限制\n\t// 与QPS限流不同，并发控制限制的是同时处理的请求数，请求完成后令牌会归还\n\tMaxConcurrency int\n\t// PathQPS 路径级QPS配置，key为URL路径（如 /api/v1/users）\n\tPathQPS map[string]float64\n\t// PathBurst 路径级突发容量配置\n\tPathBurst map[string]int\n\t// PathMaxConcurrency 路径级最大并发数配置\n\tPathMaxConcurrency map[string]int\n}\n\n// WithHttpHandlerInterceptorsQPSLimitOptions HTTP QPS限流中间件选项\n// 支持全局默认QPS和路径级QPS配置\nfunc WithHttpHandlerInterceptorsQPSLimitOptions(config HTTPQPSLimitConfig) GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(c *GRPCGateway) {\n\t\t// QPS限流\n\t\tif config.DefaultQPS > 0 || len(config.PathQPS) > 0 {\n\t\t\t// 创建方法级QPS限流器\n\t\t\tdefaultBurst := config.DefaultBurst\n\t\t\tif defaultBurst <= 0 {\n\t\t\t\tdefaultBurst = int(config.DefaultQPS)\n\t\t\t}\n\t\t\tlimiter := httpinterceptorlimiter_.NewQPSRateLimiter(config.DefaultQPS, defaultBurst)\n\n\t\t\t// 设置路径级QPS配置\n\t\t\tfor path, qps := range config.PathQPS {\n\t\t\t\tburst := config.PathBurst[path]\n\t\t\t\tif burst <= 0 {\n\t\t\t\t\tburst = int(qps)\n\t\t\t\t}\n\t\t\t\tlimiter.SetPathQPS(path, qps, burst)\n\t\t\t}\n\n\t\t\tWithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\t\t\tInterceptor: limiter.Handler,\n\t\t\t}).apply(c)\n\t\t}\n\n\t\t// 并发控制\n\t\tif config.MaxConcurrency > 0 || len(config.PathMaxConcurrency) > 0 {\n\t\t\tlimiter := httpinterceptorlimiter_.NewConcurrencyLimiter(config.MaxConcurrency)\n\n\t\t\t// 设置路径级并发配置\n\t\t\tfor path, maxConcurrency := range config.PathMaxConcurrency {\n\t\t\t\tif maxConcurrency > 0 {\n\t\t\t\t\tlimiter.SetPathConcurrency(path, maxConcurrency)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tWithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\t\t\tInterceptor: limiter.Handler,\n\t\t\t}).apply(c)\n\t\t}\n\t})\n}\n\n// CleanPath\nfunc WithHttpHandlerInterceptorCleanPathOptions() GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptorhttp_.CleanPath,\n\t})\n}\n\n// recovery\nfunc WithHttpHandlerInterceptorRecoveryOptions() GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptordebug_.Recovery,\n\t})\n}\n\n// WithHttpHandlerInterceptorCORSOptions 添加 CORS 跨域中间件。\n// 使用指定的 CORSConfig 配置允许的来源、方法、请求头等。\nfunc WithHttpHandlerInterceptorCORSOptions(config httpinterceptorcors_.CORSConfig) GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptorcors_.CORS(config),\n\t})\n}\n\n// WithHttpHandlerInterceptorCORSAllowAllOptions 添加允许所有来源的 CORS 中间件。\n// 适用于开发环境或内部服务，生产环境建议使用 WithHttpHandlerInterceptorCORSOptions 指定来源。\nfunc WithHttpHandlerInterceptorCORSAllowAllOptions() GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptorcors_.CORSAllowAll,\n\t})\n}\n\n// WithHttpHandlerInterceptorStripPrefixOptions 添加路径前缀 Strip 中间件。\n// 用于 Kubernetes Ingress / 负载均衡器配置了路径前缀路由时，\n// 后端服务 strip 掉该前缀以正确匹配内部路由。\n// 例如：prefix=\"/palm-racer\"，请求 /palm-racer/api/v1 → /api/v1\nfunc WithHttpHandlerInterceptorStripPrefixOptions(prefix string) GRPCGatewayOption {\n\treturn WithHttpHandlerInterceptorOptions(http_.HandlerInterceptor{\n\t\tInterceptor: httpinterceptorhttp_.StripPrefix(prefix),\n\t})\n}\n"
  },
  {
    "path": "pkg/grpc-gateway/grpc_gateway_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpcgateway\n\n// A GRPCGatewayOption sets options.\ntype GRPCGatewayOption interface {\n\tapply(*GRPCGateway)\n}\n\n// EmptyGRPCGatewayOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyGRPCGatewayOption struct{}\n\nfunc (EmptyGRPCGatewayOption) apply(*GRPCGateway) {}\n\n// GRPCGatewayOptionFunc wraps a function that modifies Client into an\n// implementation of the GRPCGatewayOption interface.\ntype GRPCGatewayOptionFunc func(*GRPCGateway)\n\nfunc (f GRPCGatewayOptionFunc) apply(do *GRPCGateway) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _GRPCGatewayOptionWithDefault() GRPCGatewayOption {\n\treturn GRPCGatewayOptionFunc(func(*GRPCGateway) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *GRPCGateway) ApplyOptions(options ...GRPCGatewayOption) *GRPCGateway {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/grpc-gateway/grpc_gateway_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage grpcgateway_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\tgw_ \"github.com/kaydxh/golang/pkg/grpc-gateway\"\n\n\t\"github.com/kaydxh/golang/pkg/grpc-gateway/date\"\n\t\"google.golang.org/grpc\"\n)\n\ntype Controller struct {\n\n\t// Embed the unimplemented server\n\tdate.UnimplementedDateServiceServer\n}\n\n// 日期查询\nfunc (c *Controller) Now(\n\t_ context.Context,\n\treq *date.DateRequest,\n) (resp *date.DateResponse, err error) {\n\tfmt.Println(\">>>>>NOW\")\n\treturn &date.DateResponse{\n\t\tRequestId: req.GetRequestId(),\n\t\tDate:      time.Now().String(),\n\t}, nil\n}\n\nfunc TestGRPCGateway(t *testing.T) {\n\ts := Controller{}\n\tgwServer := gw_.NewGRPCGateWay(\":10002\")\n\tgwServer.RegisterGRPCHandler(func(srv *grpc.Server) {\n\t\tdate.RegisterDateServiceServer(srv, &s)\n\t})\n\n\terr := gwServer.RegisterHTTPHandler(\n\t\tcontext.Background(),\n\t\tfunc(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error {\n\t\t\treturn date.RegisterDateServiceHandlerFromEndpoint(ctx, mux, endpoint, opts)\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tt.Fatalf(\"failed to RegisterHTTPHandler got: %s\", err)\n\t}\n\n\tgwServer.ListenAndServe()\n}\n"
  },
  {
    "path": "pkg/logs/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logs\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n\n\t\"github.com/go-playground/validator/v10\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tlogrus_ \"github.com/kaydxh/golang/pkg/logs/logrus\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"google.golang.org/protobuf/types/known/durationpb\"\n\n\t\"github.com/spf13/viper\"\n)\n\nconst (\n\tDefaultMaxAge         = 72 * time.Hour\n\tDefaultMaxCount       = 72\n\tDefaultRotateInterval = time.Hour\n\t//100MB\n\tDefaultRotateSize = 104857600\n)\n\ntype Config struct {\n\tProto     Log\n\tValidator *validator.Validate\n\topts      struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\n// Validate checks Config.\nfunc (c *completedConfig) Validate() error {\n\treturn c.Validator.Struct(c)\n}\n\nfunc (c *completedConfig) Apply() error {\n\tif c.completeError != nil {\n\t\treturn c.completeError\n\t}\n\tif c.Validator == nil {\n\t\tc.Validator = validator.New()\n\t}\n\n\treturn c.install()\n}\n\nfunc (c *completedConfig) install() error {\n\tlogrus.Infof(\"Installing Logs\")\n\n\tswitch c.Proto.GetFormatter() {\n\tcase Log_json:\n\t\tlogrus.SetFormatter(&logrus.JSONFormatter{\n\t\t\tCallerPrettyfier: GenShortCallPrettyfier(),\n\t\t})\n\n\tcase Log_text:\n\t\t//DisableColors set true, out format:\n\t\t//time=\"2021-08-07 20:21:46.468\" level=info msg=\"Installing WebHandler\" func=\"options.(*CompletedServerRunOptions).Run()\" file=\"options.go:59\"\n\t\t//DisableColors set false, out format:\n\t\t//INFO[2021-08-07T19:53:42+08:00]options.go:59 options.(*CompletedServerRunOptions).Run() Installing WebHandler\n\n\t\t//DisableQuote: ture, this config can format newline characters(\\n) in the log message\n\t\tlogrus.SetFormatter(&logrus.TextFormatter{\n\t\t\t//ForceQuote:       true,\n\t\t\tDisableColors:    true,\n\t\t\tDisableQuote:     true,\n\t\t\tFullTimestamp:    true,\n\t\t\tTimestampFormat:  time_.DefaultTimeMillFormat,\n\t\t\tCallerPrettyfier: GenShortCallPrettyfier(),\n\t\t})\n\n\tdefault:\n\t\tlogrus.SetFormatter(&logrus_.GlogFormatter{\n\t\t\t//ForceQuote:       true,\n\t\t\tDisableColors:     true,\n\t\t\tDisableQuote:      true,\n\t\t\tFullTimestamp:     true,\n\t\t\tTimestampFormat:   time_.DefaultTimeMillFormat,\n\t\t\tCallerPrettyfier:  GenShortCallPrettyfier(),\n\t\t\tEnableGoroutineId: c.Proto.GetEnableGoroutineId(),\n\t\t})\n\t}\n\n\tlevel, err := logrus.ParseLevel(c.Proto.GetLevel().String())\n\tif err != nil {\n\t\treturn err\n\t}\n\tlogrus.SetLevel(level)\n\tlogrus.SetReportCaller(c.Proto.GetReportCaller())\n\n\terr = WithRotate(\n\t\tlogrus.StandardLogger(),\n\t\tc.Proto.GetFilepath(),\n\t\tc.Proto.GetRedirect(),\n\t\tWithMaxAge(c.Proto.GetMaxAge().AsDuration()),\n\t\tWithMaxCount(c.Proto.GetMaxCount()),\n\t\tWithRotateSize(c.Proto.GetRotateSize()),\n\t\tWithRotateInterval(c.Proto.GetRotateInterval().AsDuration()),\n\t\tWithPrefixName(filepath.Base(os.Args[0])),\n\t\tWithSuffixName(\".log\"),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogrus.WithField(\n\t\t\"path\",\n\t\tc.Proto.GetFilepath(),\n\t).WithField(\n\t\t\"rotate_interval\", c.Proto.GetRotateInterval().AsDuration(),\n\t).WithField(\n\t\t\"rotate_size\", c.Proto.GetRotateSize(),\n\t).Infof(\n\t\t\"Installed log\",\n\t)\n\n\treturn nil\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\tc.parseViper()\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) parseViper() {\n\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{\n\t\tProto: Log{\n\t\t\tLevel:          Log_info,\n\t\t\tFormatter:      Log_text,\n\t\t\tMaxAge:         durationpb.New(DefaultMaxAge),\n\t\t\tMaxCount:       DefaultMaxCount,\n\t\t\tRotateInterval: durationpb.New(DefaultRotateInterval),\n\t\t\tRotateSize:     DefaultRotateSize,\n\n\t\t\tFilepath: \"./log/\" + filepath.Base(os.Args[0]),\n\t\t},\n\t}\n\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/logs/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logs\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/logs/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logs\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/logs/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/logs\n\ngo 1.24.0\n\nrequire (\n\tgithub.com/go-playground/validator/v10 v10.28.0\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgolang.org/x/sys v0.39.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.uber.org/atomic v1.11.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n"
  },
  {
    "path": "pkg/logs/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 h1:Q0arlJiD7BygvPMDHcvTdg1urHqADnd7P2qk3r2HlyE=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228/go.mod h1:ML4gUddcaOo55zQ9/m8SxjZYYVTJACriuUFcqs1BEd4=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 h1:7zmih7dDhXTVDxbWy4Cp0OrSqMdQaQzlRUtCzZXMVgc=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228/go.mod h1:DeGVCOtdDQNg6/hVvPwYqeH0EbGcbFiQcKNvMrD+NyY=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\n"
  },
  {
    "path": "pkg/logs/hook.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logs\n\nimport \"github.com/sirupsen/logrus\"\n\ntype HookHandler func(entry *logrus.Entry) error\n\nfunc (h HookHandler) Levels() []logrus.Level {\n\treturn logrus.AllLevels\n}\n\nfunc (h HookHandler) Fire(entry *logrus.Entry) error {\n\treturn h(entry)\n}\n"
  },
  {
    "path": "pkg/logs/log.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logs\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\trotate_ \"github.com/kaydxh/golang/pkg/file-rotate\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype Rotate struct {\n\tmaxAge         time.Duration\n\tmaxCount       int64\n\trotateSize     int64\n\trotateInterval time.Duration\n\tprefixName     string\n\tsuffixName     string\n}\n\nfunc WithRotate(log *logrus.Logger, filedir string, redirect Log_Redirect, options ...RotateOption) error {\n\tif log == nil {\n\t\treturn fmt.Errorf(\"log is nil\")\n\t}\n\n\tvar rotate Rotate\n\trotate.ApplyOptions(options...)\n\n\trotateFiler, _ := rotate_.NewRotateFiler(\n\t\tfiledir,\n\t\trotate_.WithMaxAge(rotate.maxAge),\n\t\trotate_.WithMaxCount(rotate.maxCount),\n\t\trotate_.WithRotateInterval(rotate.rotateInterval),\n\t\trotate_.WithRotateSize(rotate.rotateSize),\n\t\trotate_.WithPrefixName(rotate.prefixName),\n\t\trotate_.WithSuffixName(rotate.suffixName),\n\t)\n\tlog.AddHook(HookHandler(func(entry *logrus.Entry) error {\n\t\tvar (\n\t\t\tmsg []byte\n\t\t\terr error\n\t\t)\n\n\t\tif log.Formatter == nil {\n\t\t\tmsg, err = entry.Bytes()\n\t\t} else {\n\t\t\tmsg, err = log.Formatter.Format(entry)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t//if opt.MuteDirectlyOutput && entry.Level <= logrus.WarnLevel {\n\t\t/*\n\t\t\tif entry.Level <= logrus.WarnLevel {\n\t\t\t\tif out != nil {\n\t\t\t\t\t_, _ = out.Write(msg)\n\t\t\t\t}\n\t\t\t}\n\t\t*/\n\t\t//https://eli.thegreenplace.net/2020/faking-stdin-and-stdout-in-go/\n\t\t//https://github.com/eliben/code-for-blog/blob/master/2020/go-fake-stdio/snippets/redirect-cgo-stdout.go\n\t\tfile, _, err := rotateFiler.Write([]byte(msg))\n\t\tif err == nil {\n\t\t\tif redirect == Log_file {\n\t\t\t\tos.Stdout = file\n\t\t\t\tos.Stderr = file\n\t\t\t}\n\t\t}\n\n\t\treturn err\n\t}))\n\n\treturn nil\n}\n\nfunc GetLogger(ctx context.Context) *logrus.Entry {\n\trequestId := context_.ExtractRequestIDFromContext(ctx)\n\ttraceId := context_.ExtractTraceIDFromContext(ctx)\n\tif traceId == \"\" {\n\t\ttraceId = requestId\n\t}\n\tlogger := logrus.WithField(\"request_id\", requestId).WithField(\"trace_id\", traceId)\n\treturn logger\n}\n\nfunc GetLoggerOrFallback(ctx context.Context, defaultValue string) *logrus.Entry {\n\trequestId := context_.ExtractRequestIDFromContext(ctx)\n\tif requestId == \"\" {\n\t\trequestId = defaultValue\n\t}\n\ttraceId := context_.ExtractTraceIDFromContext(ctx)\n\tif traceId == \"\" {\n\t\ttraceId = requestId\n\t}\n\tlogger := logrus.WithField(\"request_id\", requestId).WithField(\"trace_id\", traceId)\n\treturn logger\n}\n"
  },
  {
    "path": "pkg/logs/log.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logs\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"time\"\n)\n\nfunc WithPrefixName(prefixName string) RotateOption {\n\treturn RotateOptionFunc(func(c *Rotate) {\n\t\tc.prefixName = prefixName\n\t})\n}\n\nfunc WithSuffixName(suffixName string) RotateOption {\n\treturn RotateOptionFunc(func(c *Rotate) {\n\t\tc.suffixName = suffixName\n\t})\n}\n\nfunc WithMaxAge(maxAge time.Duration) RotateOption {\n\treturn RotateOptionFunc(func(c *Rotate) {\n\t\tc.maxAge = maxAge\n\t})\n}\n\nfunc WithMaxCount(maxCount int64) RotateOption {\n\treturn RotateOptionFunc(func(c *Rotate) {\n\t\tc.maxCount = maxCount\n\t})\n}\n\nfunc WithRotateSize(rotateSize int64) RotateOption {\n\treturn RotateOptionFunc(func(c *Rotate) {\n\t\tc.rotateSize = rotateSize\n\t})\n}\n\nfunc WithRotateInterval(rotateInterval time.Duration) RotateOption {\n\treturn RotateOptionFunc(func(c *Rotate) {\n\t\tc.rotateInterval = rotateInterval\n\t})\n}\n\ntype CallerPrettyfierFunc func(f *runtime.Frame) (function string, file string)\n\nfunc GenShortCallPrettyfier() CallerPrettyfierFunc {\n\treturn func(f *runtime.Frame) (function string, file string) {\n\t\tfuncname := path.Base(f.Function)\n\t\tdir := path.Dir(f.File)\n\t\tfilename := filepath.Join(path.Base(dir), path.Base(f.File))\n\t\t//filename := path.Base(f.File)\n\t\treturn fmt.Sprintf(\"%s()\", funcname), fmt.Sprintf(\"%s:%d\", filename, f.Line)\n\t}\n}\n"
  },
  {
    "path": "pkg/logs/log.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.36.10\n// \tprotoc        v5.29.3\n// source: log.proto\n\npackage logs\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tdurationpb \"google.golang.org/protobuf/types/known/durationpb\"\n\treflect \"reflect\"\n\tsync \"sync\"\n\tunsafe \"unsafe\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Log_Level int32\n\nconst (\n\tLog_panic Log_Level = 0\n\tLog_fatal Log_Level = 1\n\tLog_error Log_Level = 2\n\tLog_warn  Log_Level = 3\n\tLog_info  Log_Level = 4\n\tLog_debug Log_Level = 5\n\tLog_trace Log_Level = 6\n)\n\n// Enum value maps for Log_Level.\nvar (\n\tLog_Level_name = map[int32]string{\n\t\t0: \"panic\",\n\t\t1: \"fatal\",\n\t\t2: \"error\",\n\t\t3: \"warn\",\n\t\t4: \"info\",\n\t\t5: \"debug\",\n\t\t6: \"trace\",\n\t}\n\tLog_Level_value = map[string]int32{\n\t\t\"panic\": 0,\n\t\t\"fatal\": 1,\n\t\t\"error\": 2,\n\t\t\"warn\":  3,\n\t\t\"info\":  4,\n\t\t\"debug\": 5,\n\t\t\"trace\": 6,\n\t}\n)\n\nfunc (x Log_Level) Enum() *Log_Level {\n\tp := new(Log_Level)\n\t*p = x\n\treturn p\n}\n\nfunc (x Log_Level) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Log_Level) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_log_proto_enumTypes[0].Descriptor()\n}\n\nfunc (Log_Level) Type() protoreflect.EnumType {\n\treturn &file_log_proto_enumTypes[0]\n}\n\nfunc (x Log_Level) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Log_Level.Descriptor instead.\nfunc (Log_Level) EnumDescriptor() ([]byte, []int) {\n\treturn file_log_proto_rawDescGZIP(), []int{0, 0}\n}\n\ntype Log_Formatter int32\n\nconst (\n\tLog_text Log_Formatter = 0\n\tLog_json Log_Formatter = 1\n\tLog_glog Log_Formatter = 2\n)\n\n// Enum value maps for Log_Formatter.\nvar (\n\tLog_Formatter_name = map[int32]string{\n\t\t0: \"text\",\n\t\t1: \"json\",\n\t\t2: \"glog\",\n\t}\n\tLog_Formatter_value = map[string]int32{\n\t\t\"text\": 0,\n\t\t\"json\": 1,\n\t\t\"glog\": 2,\n\t}\n)\n\nfunc (x Log_Formatter) Enum() *Log_Formatter {\n\tp := new(Log_Formatter)\n\t*p = x\n\treturn p\n}\n\nfunc (x Log_Formatter) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Log_Formatter) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_log_proto_enumTypes[1].Descriptor()\n}\n\nfunc (Log_Formatter) Type() protoreflect.EnumType {\n\treturn &file_log_proto_enumTypes[1]\n}\n\nfunc (x Log_Formatter) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Log_Formatter.Descriptor instead.\nfunc (Log_Formatter) EnumDescriptor() ([]byte, []int) {\n\treturn file_log_proto_rawDescGZIP(), []int{0, 1}\n}\n\ntype Log_Redirect int32\n\nconst (\n\tLog_stdout Log_Redirect = 0\n\tLog_file   Log_Redirect = 1\n)\n\n// Enum value maps for Log_Redirect.\nvar (\n\tLog_Redirect_name = map[int32]string{\n\t\t0: \"stdout\",\n\t\t1: \"file\",\n\t}\n\tLog_Redirect_value = map[string]int32{\n\t\t\"stdout\": 0,\n\t\t\"file\":   1,\n\t}\n)\n\nfunc (x Log_Redirect) Enum() *Log_Redirect {\n\tp := new(Log_Redirect)\n\t*p = x\n\treturn p\n}\n\nfunc (x Log_Redirect) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Log_Redirect) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_log_proto_enumTypes[2].Descriptor()\n}\n\nfunc (Log_Redirect) Type() protoreflect.EnumType {\n\treturn &file_log_proto_enumTypes[2]\n}\n\nfunc (x Log_Redirect) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Log_Redirect.Descriptor instead.\nfunc (Log_Redirect) EnumDescriptor() ([]byte, []int) {\n\treturn file_log_proto_rawDescGZIP(), []int{0, 2}\n}\n\ntype Log struct {\n\tstate             protoimpl.MessageState `protogen:\"open.v1\"`\n\tLevel             Log_Level              `protobuf:\"varint,1,opt,name=level,proto3,enum=api.v1.viper.logs.Log_Level\" json:\"level,omitempty\"`\n\tFormatter         Log_Formatter          `protobuf:\"varint,2,opt,name=formatter,proto3,enum=api.v1.viper.logs.Log_Formatter\" json:\"formatter,omitempty\"`\n\tFilepath          string                 `protobuf:\"bytes,3,opt,name=filepath,proto3\" json:\"filepath,omitempty\"`\n\tMaxAge            *durationpb.Duration   `protobuf:\"bytes,4,opt,name=max_age,json=maxAge,proto3\" json:\"max_age,omitempty\"`\n\tMaxCount          int64                  `protobuf:\"varint,5,opt,name=max_count,json=maxCount,proto3\" json:\"max_count,omitempty\"`\n\tRotateInterval    *durationpb.Duration   `protobuf:\"bytes,6,opt,name=rotate_interval,json=rotateInterval,proto3\" json:\"rotate_interval,omitempty\"`\n\tRotateSize        int64                  `protobuf:\"varint,7,opt,name=rotate_size,json=rotateSize,proto3\" json:\"rotate_size,omitempty\"`\n\tReportCaller      bool                   `protobuf:\"varint,8,opt,name=report_caller,json=reportCaller,proto3\" json:\"report_caller,omitempty\"`\n\tEnableGoroutineId bool                   `protobuf:\"varint,9,opt,name=enable_goroutine_id,json=enableGoroutineId,proto3\" json:\"enable_goroutine_id,omitempty\"`\n\tRedirect          Log_Redirect           `protobuf:\"varint,10,opt,name=redirect,proto3,enum=api.v1.viper.logs.Log_Redirect\" json:\"redirect,omitempty\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *Log) Reset() {\n\t*x = Log{}\n\tmi := &file_log_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Log) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Log) ProtoMessage() {}\n\nfunc (x *Log) ProtoReflect() protoreflect.Message {\n\tmi := &file_log_proto_msgTypes[0]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Log.ProtoReflect.Descriptor instead.\nfunc (*Log) Descriptor() ([]byte, []int) {\n\treturn file_log_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Log) GetLevel() Log_Level {\n\tif x != nil {\n\t\treturn x.Level\n\t}\n\treturn Log_panic\n}\n\nfunc (x *Log) GetFormatter() Log_Formatter {\n\tif x != nil {\n\t\treturn x.Formatter\n\t}\n\treturn Log_text\n}\n\nfunc (x *Log) GetFilepath() string {\n\tif x != nil {\n\t\treturn x.Filepath\n\t}\n\treturn \"\"\n}\n\nfunc (x *Log) GetMaxAge() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.MaxAge\n\t}\n\treturn nil\n}\n\nfunc (x *Log) GetMaxCount() int64 {\n\tif x != nil {\n\t\treturn x.MaxCount\n\t}\n\treturn 0\n}\n\nfunc (x *Log) GetRotateInterval() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.RotateInterval\n\t}\n\treturn nil\n}\n\nfunc (x *Log) GetRotateSize() int64 {\n\tif x != nil {\n\t\treturn x.RotateSize\n\t}\n\treturn 0\n}\n\nfunc (x *Log) GetReportCaller() bool {\n\tif x != nil {\n\t\treturn x.ReportCaller\n\t}\n\treturn false\n}\n\nfunc (x *Log) GetEnableGoroutineId() bool {\n\tif x != nil {\n\t\treturn x.EnableGoroutineId\n\t}\n\treturn false\n}\n\nfunc (x *Log) GetRedirect() Log_Redirect {\n\tif x != nil {\n\t\treturn x.Redirect\n\t}\n\treturn Log_stdout\n}\n\nvar File_log_proto protoreflect.FileDescriptor\n\nconst file_log_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"\\tlog.proto\\x12\\x11api.v1.viper.logs\\x1a\\x1egoogle/protobuf/duration.proto\\\"\\xfe\\x04\\n\" +\n\t\"\\x03Log\\x122\\n\" +\n\t\"\\x05level\\x18\\x01 \\x01(\\x0e2\\x1c.api.v1.viper.logs.Log.LevelR\\x05level\\x12>\\n\" +\n\t\"\\tformatter\\x18\\x02 \\x01(\\x0e2 .api.v1.viper.logs.Log.FormatterR\\tformatter\\x12\\x1a\\n\" +\n\t\"\\bfilepath\\x18\\x03 \\x01(\\tR\\bfilepath\\x122\\n\" +\n\t\"\\amax_age\\x18\\x04 \\x01(\\v2\\x19.google.protobuf.DurationR\\x06maxAge\\x12\\x1b\\n\" +\n\t\"\\tmax_count\\x18\\x05 \\x01(\\x03R\\bmaxCount\\x12B\\n\" +\n\t\"\\x0frotate_interval\\x18\\x06 \\x01(\\v2\\x19.google.protobuf.DurationR\\x0erotateInterval\\x12\\x1f\\n\" +\n\t\"\\vrotate_size\\x18\\a \\x01(\\x03R\\n\" +\n\t\"rotateSize\\x12#\\n\" +\n\t\"\\rreport_caller\\x18\\b \\x01(\\bR\\freportCaller\\x12.\\n\" +\n\t\"\\x13enable_goroutine_id\\x18\\t \\x01(\\bR\\x11enableGoroutineId\\x12;\\n\" +\n\t\"\\bredirect\\x18\\n\" +\n\t\" \\x01(\\x0e2\\x1f.api.v1.viper.logs.Log.RedirectR\\bredirect\\\"R\\n\" +\n\t\"\\x05Level\\x12\\t\\n\" +\n\t\"\\x05panic\\x10\\x00\\x12\\t\\n\" +\n\t\"\\x05fatal\\x10\\x01\\x12\\t\\n\" +\n\t\"\\x05error\\x10\\x02\\x12\\b\\n\" +\n\t\"\\x04warn\\x10\\x03\\x12\\b\\n\" +\n\t\"\\x04info\\x10\\x04\\x12\\t\\n\" +\n\t\"\\x05debug\\x10\\x05\\x12\\t\\n\" +\n\t\"\\x05trace\\x10\\x06\\\")\\n\" +\n\t\"\\tFormatter\\x12\\b\\n\" +\n\t\"\\x04text\\x10\\x00\\x12\\b\\n\" +\n\t\"\\x04json\\x10\\x01\\x12\\b\\n\" +\n\t\"\\x04glog\\x10\\x02\\\" \\n\" +\n\t\"\\bRedirect\\x12\\n\" +\n\t\"\\n\" +\n\t\"\\x06stdout\\x10\\x00\\x12\\b\\n\" +\n\t\"\\x04file\\x10\\x01B(Z&github.com/kaydxh/golang/pkg/logs;logsb\\x06proto3\"\n\nvar (\n\tfile_log_proto_rawDescOnce sync.Once\n\tfile_log_proto_rawDescData []byte\n)\n\nfunc file_log_proto_rawDescGZIP() []byte {\n\tfile_log_proto_rawDescOnce.Do(func() {\n\t\tfile_log_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_log_proto_rawDesc), len(file_log_proto_rawDesc)))\n\t})\n\treturn file_log_proto_rawDescData\n}\n\nvar file_log_proto_enumTypes = make([]protoimpl.EnumInfo, 3)\nvar file_log_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_log_proto_goTypes = []any{\n\t(Log_Level)(0),              // 0: api.v1.viper.logs.Log.Level\n\t(Log_Formatter)(0),          // 1: api.v1.viper.logs.Log.Formatter\n\t(Log_Redirect)(0),           // 2: api.v1.viper.logs.Log.Redirect\n\t(*Log)(nil),                 // 3: api.v1.viper.logs.Log\n\t(*durationpb.Duration)(nil), // 4: google.protobuf.Duration\n}\nvar file_log_proto_depIdxs = []int32{\n\t0, // 0: api.v1.viper.logs.Log.level:type_name -> api.v1.viper.logs.Log.Level\n\t1, // 1: api.v1.viper.logs.Log.formatter:type_name -> api.v1.viper.logs.Log.Formatter\n\t4, // 2: api.v1.viper.logs.Log.max_age:type_name -> google.protobuf.Duration\n\t4, // 3: api.v1.viper.logs.Log.rotate_interval:type_name -> google.protobuf.Duration\n\t2, // 4: api.v1.viper.logs.Log.redirect:type_name -> api.v1.viper.logs.Log.Redirect\n\t5, // [5:5] is the sub-list for method output_type\n\t5, // [5:5] is the sub-list for method input_type\n\t5, // [5:5] is the sub-list for extension type_name\n\t5, // [5:5] is the sub-list for extension extendee\n\t0, // [0:5] is the sub-list for field type_name\n}\n\nfunc init() { file_log_proto_init() }\nfunc file_log_proto_init() {\n\tif File_log_proto != nil {\n\t\treturn\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: unsafe.Slice(unsafe.StringData(file_log_proto_rawDesc), len(file_log_proto_rawDesc)),\n\t\t\tNumEnums:      3,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_log_proto_goTypes,\n\t\tDependencyIndexes: file_log_proto_depIdxs,\n\t\tEnumInfos:         file_log_proto_enumTypes,\n\t\tMessageInfos:      file_log_proto_msgTypes,\n\t}.Build()\n\tFile_log_proto = out.File\n\tfile_log_proto_goTypes = nil\n\tfile_log_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/logs/log.proto",
    "content": "syntax = \"proto3\";\n\npackage api.v1.viper.logs;\n\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/golang/pkg/logs;logs\";\n\nmessage Log {\n  Level level = 1;\n  Formatter formatter = 2;\n  string filepath = 3;\n  google.protobuf.Duration max_age = 4;\n  int64 max_count = 5;\n  google.protobuf.Duration rotate_interval = 6;\n  int64 rotate_size = 7;\n  bool report_caller = 8;\n  bool enable_goroutine_id = 9;\n  Redirect redirect = 10;\n\n  enum Level {\n    panic = 0;\n    fatal = 1;\n    error = 2;\n    warn = 3;\n    info = 4;\n    debug = 5;\n    trace = 6;\n  }\n\n  enum Formatter {\n    text = 0;\n    json = 1;\n    glog = 2;\n  }\n\n  enum Redirect {\n    stdout = 0;\n    file = 1;\n  }\n}\n"
  },
  {
    "path": "pkg/logs/log.yaml",
    "content": "log:\n  formatter: glog\n  level: info\n  filepath: ./log\n  max_age: 604800s #168h\n  max_count: 200\n  rotate_interval: 3600s #1h\n  rotate_size: 104857600 #100M\n  report_caller: true\n  enable_goroutine_id: false\n  redirect: file #file, stdout\n"
  },
  {
    "path": "pkg/logs/log_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logs\n\n// A RotateOption sets options.\ntype RotateOption interface {\n\tapply(*Rotate)\n}\n\n// EmptyRotateOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyRotateOption struct{}\n\nfunc (EmptyRotateOption) apply(*Rotate) {}\n\n// RotateOptionFunc wraps a function that modifies Client into an\n// implementation of the RotateOption interface.\ntype RotateOptionFunc func(*Rotate)\n\nfunc (f RotateOptionFunc) apply(do *Rotate) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _RotateOptionWithDefault() RotateOption {\n\treturn RotateOptionFunc(func(*Rotate) {\n\t\t// nothing to change\n\t})\n}\n\nfunc (o *Rotate) ApplyOptions(options ...RotateOption) *Rotate {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/logs/log_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logs_test\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc TestInit(t *testing.T) {\n\tcfgFile := \"./log.yaml\"\n\tconfig := logs_.NewConfig(logs_.WithViper(viper_.GetViper(cfgFile, \"log\")))\n\terr := config.Complete().Apply()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to apply log config err: %v\", err)\n\t}\n\tlogrus.WithField(\n\t\t\"module\",\n\t\tos.Args,\n\t).WithField(\n\t\t\"log_dir\",\n\t\tconfig.Proto.GetFilepath(),\n\t).Infof(\n\t\t\"successed to apply log config: %#v\", config.Proto.String(),\n\t)\n\n\tfor i := 1; i <= 10; i++ {\n\t\tlogrus.Infof(\"test time: %v\", i)\n\t\tfmt.Println(\"---------write to stdout----------\")\n\t\ttime.Sleep(time.Second)\n\t}\n\n}\n"
  },
  {
    "path": "pkg/logs/logrus/formatter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logrus\n\nimport (\n\t\"time\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\n// Default key names for the default fields\nconst (\n\tdefaultTimestampFormat = time.RFC3339\n\tFieldKeyMsg            = \"msg\"\n\tFieldKeyLevel          = \"level\"\n\tFieldKeyTime           = \"time\"\n\tFieldKeyLogrusError    = \"logrus_error\"\n\tFieldKeyFunc           = \"func\"\n\tFieldKeyFile           = \"file\"\n)\n\ntype fieldKey string\n\n// FieldMap allows customization of the key names for default fields.\ntype FieldMap map[fieldKey]string\n\nfunc (f FieldMap) resolve(key fieldKey) string {\n\tif k, ok := f[key]; ok {\n\t\treturn k\n\t}\n\n\treturn string(key)\n}\n\n// This is to not silently overwrite `time`, `msg`, `func` and `level` fields when\n// dumping it. If this code wasn't there doing:\n//\n//  logrus.WithField(\"level\", 1).Info(\"hello\")\n//\n// Would just silently drop the user provided level. Instead with this code\n// it'll logged as:\n//\n//  {\"level\": \"info\", \"fields.level\": 1, \"msg\": \"hello\", \"time\": \"...\"}\n//\n// It's not exported because it's still using Data in an opinionated way. It's to\n// avoid code duplication between the two default formatters.\nfunc prefixFieldClashes(data logrus.Fields, fieldMap FieldMap, reportCaller bool) {\n\ttimeKey := fieldMap.resolve(FieldKeyTime)\n\tif t, ok := data[timeKey]; ok {\n\t\tdata[\"fields.\"+timeKey] = t\n\t\tdelete(data, timeKey)\n\t}\n\n\tmsgKey := fieldMap.resolve(FieldKeyMsg)\n\tif m, ok := data[msgKey]; ok {\n\t\tdata[\"fields.\"+msgKey] = m\n\t\tdelete(data, msgKey)\n\t}\n\n\tlevelKey := fieldMap.resolve(FieldKeyLevel)\n\tif l, ok := data[levelKey]; ok {\n\t\tdata[\"fields.\"+levelKey] = l\n\t\tdelete(data, levelKey)\n\t}\n\n\tlogrusErrKey := fieldMap.resolve(FieldKeyLogrusError)\n\tif l, ok := data[logrusErrKey]; ok {\n\t\tdata[\"fields.\"+logrusErrKey] = l\n\t\tdelete(data, logrusErrKey)\n\t}\n\n\t// If reportCaller is not set, 'func' will not conflict.\n\tif reportCaller {\n\t\tfuncKey := fieldMap.resolve(FieldKeyFunc)\n\t\tif l, ok := data[funcKey]; ok {\n\t\t\tdata[\"fields.\"+funcKey] = l\n\t\t}\n\t\tfileKey := fieldMap.resolve(FieldKeyFile)\n\t\tif l, ok := data[fileKey]; ok {\n\t\t\tdata[\"fields.\"+fileKey] = l\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "pkg/logs/logrus/glog_formatter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logrus\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\t\"unicode/utf8\"\n\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst (\n\tred    = 31\n\tyellow = 33\n\tblue   = 36\n\tgray   = 37\n)\n\nvar (\n\tbaseTimestamp time.Time\n\tpid           int\n)\n\nfunc init() {\n\tbaseTimestamp = time.Now()\n\tpid = os.Getpid()\n}\n\n/*\nhttps://medium.com/technical-tips/google-log-glog-output-format-7eb31b3f0ce5\n[IWEF]yyyymmdd hh:mm:ss.uuuuuu threadid file:line] msg\nIWEF — Log Levels, I for INFO, W for WARNING, E for ERROR and `F` for FATAL.\nyyyymmdd — Year, Month and Date.\nhh:mm:ss.uuuuuu — Hours, Minutes, Seconds and Microseconds.\nthreadid — PID/TID of the process/thread.\nfile:line — File name and line number.\nmsg — Actual user-specified log message.\n*/\n\n// GlogFormatter formats logs into text\ntype GlogFormatter struct {\n\t// Set to true to bypass checking for a TTY before outputting colors.\n\tForceColors bool\n\n\t// Force disabling colors.\n\tDisableColors bool\n\n\t// Force quoting of all values\n\tForceQuote bool\n\n\t// DisableQuote disables quoting for all values.\n\t// DisableQuote will have a lower priority than ForceQuote.\n\t// If both of them are set to true, quote will be forced on all values.\n\tDisableQuote bool\n\n\t// Override coloring based on CLICOLOR and CLICOLOR_FORCE. - https://bixense.com/clicolors/\n\tEnvironmentOverrideColors bool\n\n\t// Disable timestamp logging. useful when output is redirected to logging\n\t// system that already adds timestamps.\n\tDisableTimestamp bool\n\n\t// Enable logging the full timestamp when a TTY is attached instead of just\n\t// the time passed since beginning of execution.\n\tFullTimestamp bool\n\n\t// TimestampFormat to use for display when a full timestamp is printed\n\tTimestampFormat string\n\n\t// The fields are sorted by default for a consistent output. For applications\n\t// that log extremely frequently and don't use the JSON formatter this may not\n\t// be desired.\n\tDisableSorting bool\n\n\t// The keys sorting function, when uninitialized it uses sort.Strings.\n\tSortingFunc func([]string)\n\n\t// Disables the truncation of the level text to 4 characters.\n\tDisableLevelTruncation bool\n\n\t// PadLevelText Adds padding the level text so that all the levels output at the same length\n\t// PadLevelText is a superset of the DisableLevelTruncation option\n\tPadLevelText bool\n\n\t// QuoteEmptyFields will wrap empty fields in quotes if true\n\tQuoteEmptyFields bool\n\n\t// Whether the logger's out is to a terminal\n\tisTerminal bool\n\n\t// FieldMap allows users to customize the names of keys for default fields.\n\t// As an example:\n\t// formatter := &TextFormatter{\n\t//     FieldMap: FieldMap{\n\t//         FieldKeyTime:  \"@timestamp\",\n\t//         FieldKeyLevel: \"@level\",\n\t//         FieldKeyMsg:   \"@message\"}}\n\tFieldMap FieldMap\n\n\t// CallerPrettyfier can be set by the user to modify the content\n\t// of the function and file keys in the data when ReportCaller is\n\t// activated. If any of the returned value is the empty string the\n\t// corresponding key will be removed from fields.\n\tCallerPrettyfier func(*runtime.Frame) (function string, file string)\n\n\tterminalInitOnce sync.Once\n\n\t// The max length of the level text, generated dynamically on init\n\tlevelTextMaxLength int\n\n\t// Disables the glog style ：[IWEF]yyyymmdd hh:mm:ss.uuuuuu threadid file:line] msg msg...\n\t// replace with ：[IWEF] [yyyymmdd] [hh:mm:ss.uuuuuu] [threadid] [file:line] msg msg...\n\t//EnablePrettyLog   bool\n\tEnableGoroutineId bool\n}\n\nfunc (f *GlogFormatter) init(entry *logrus.Entry) {\n\tif entry.Logger != nil {\n\t\tf.isTerminal = checkIfTerminal(entry.Logger.Out)\n\t}\n\t// Get the max length of the level text\n\tfor _, level := range logrus.AllLevels {\n\t\tlevelTextLength := utf8.RuneCount([]byte(level.String()))\n\t\tif levelTextLength > f.levelTextMaxLength {\n\t\t\tf.levelTextMaxLength = levelTextLength\n\t\t}\n\t}\n}\n\nfunc (f *GlogFormatter) isColored() bool {\n\tisColored := f.ForceColors || (f.isTerminal && (runtime.GOOS != \"windows\"))\n\n\tif f.EnvironmentOverrideColors {\n\t\tswitch force, ok := os.LookupEnv(\"CLICOLOR_FORCE\"); {\n\t\tcase ok && force != \"0\":\n\t\t\tisColored = true\n\t\tcase ok && force == \"0\", os.Getenv(\"CLICOLOR\") == \"0\":\n\t\t\tisColored = false\n\t\t}\n\t}\n\n\treturn isColored && !f.DisableColors\n}\n\n// Format renders a single log entry\nfunc (f *GlogFormatter) Format(entry *logrus.Entry) ([]byte, error) {\n\tdata := make(logrus.Fields)\n\tfor k, v := range entry.Data {\n\t\tdata[k] = v\n\t}\n\tprefixFieldClashes(data, f.FieldMap, entry.HasCaller())\n\tkeys := make([]string, 0, len(data))\n\tfor k := range data {\n\t\tkeys = append(keys, k)\n\t}\n\n\tfixedKeys := make([]string, 0, 4+len(data))\n\tif entry.Message != \"\" {\n\t\tfixedKeys = append(fixedKeys, f.FieldMap.resolve(logrus.FieldKeyMsg))\n\t}\n\n\tif !f.DisableSorting {\n\t\tif f.SortingFunc == nil {\n\t\t\tsort.Strings(keys)\n\t\t\tfixedKeys = append(fixedKeys, keys...)\n\t\t} else {\n\t\t\tif !f.isColored() {\n\t\t\t\tfixedKeys = append(fixedKeys, keys...)\n\t\t\t\tf.SortingFunc(fixedKeys)\n\t\t\t} else {\n\t\t\t\tf.SortingFunc(keys)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfixedKeys = append(fixedKeys, keys...)\n\t}\n\n\tvar b *bytes.Buffer\n\tif entry.Buffer != nil {\n\t\tb = entry.Buffer\n\t} else {\n\t\tb = &bytes.Buffer{}\n\t}\n\n\tf.terminalInitOnce.Do(func() { f.init(entry) })\n\n\ttimestampFormat := f.TimestampFormat\n\tif timestampFormat == \"\" {\n\t\ttimestampFormat = defaultTimestampFormat\n\t}\n\n\tlevelText := f.level(entry)\n\tb.Write(f.formatHeader(entry, levelText))\n\n\tfor _, key := range fixedKeys {\n\t\tvar value interface{}\n\t\tswitch {\n\t\tcase key == f.FieldMap.resolve(FieldKeyMsg):\n\t\t\tvalue = entry.Message\n\t\t\tf.appendValue(b, value)\n\t\t\t//continue means msg not need call f.appendKeyValue(b, key, value)\n\t\t\t//or will duplicate write message\n\t\t\tcontinue\n\t\tcase key == f.FieldMap.resolve(fieldKey(logrus.ErrorKey)):\n\t\t\tvalue = data[logrus.ErrorKey]\n\t\tdefault:\n\t\t\tvalue = data[key]\n\t\t}\n\t\tkey = fmt.Sprintf(\"%s\", key)\n\t\tf.appendKeyValue(b, key, value)\n\t}\n\n\tb.WriteByte('\\n')\n\treturn b.Bytes(), nil\n}\n\nfunc (f *GlogFormatter) level(entry *logrus.Entry) string {\n\tlevelText := strings.ToUpper(entry.Level.String())\n\tif !f.DisableLevelTruncation && !f.PadLevelText {\n\t\tlevelText = levelText[0:4]\n\t}\n\tif f.PadLevelText {\n\t\t// Generates the format string used in the next line, for example \"%-6s\" or \"%-7s\".\n\t\t// Based on the max level text length.\n\t\tformatString := \"%-\" + strconv.Itoa(f.levelTextMaxLength) + \"s\"\n\t\t// Formats the level text by appending spaces up to the max length, for example:\n\t\t// \t- \"INFO   \"\n\t\t//\t- \"WARNING\"\n\t\tlevelText = fmt.Sprintf(formatString, levelText)\n\t}\n\n\treturn levelText\n}\n\nfunc (f *GlogFormatter) needsQuoting(text string) bool {\n\tif f.ForceQuote {\n\t\treturn true\n\t}\n\tif f.QuoteEmptyFields && len(text) == 0 {\n\t\treturn true\n\t}\n\tif f.DisableQuote {\n\t\treturn false\n\t}\n\tfor _, ch := range text {\n\t\tif !((ch >= 'a' && ch <= 'z') ||\n\t\t\t(ch >= 'A' && ch <= 'Z') ||\n\t\t\t(ch >= '0' && ch <= '9') ||\n\t\t\tch == '-' || ch == '.' || ch == '_' || ch == '/' || ch == '@' || ch == '^' || ch == '+') {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (f *GlogFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) {\n\tif b.Len() > 0 {\n\t\tb.WriteByte(' ')\n\t}\n\tb.WriteString(key)\n\tb.WriteByte('=')\n\tf.appendValue(b, value)\n}\n\nfunc (f *GlogFormatter) appendValue(b *bytes.Buffer, value interface{}) {\n\tstringVal, ok := value.(string)\n\tif !ok {\n\t\tstringVal = fmt.Sprint(value)\n\t}\n\n\tif !f.needsQuoting(stringVal) {\n\t\tb.WriteString(stringVal)\n\t} else {\n\t\tb.WriteString(fmt.Sprintf(\"%q\", stringVal))\n\t}\n}\n\n// Log line format: [IWEF]yyyymmdd hh:mm:ss.uuuuuu threadid file:line] msg\nfunc (f *GlogFormatter) formatHeader(entry *logrus.Entry, levelText string) []byte {\n\n\tvar buf bytes.Buffer\n\tswitch {\n\tcase f.DisableTimestamp:\n\t\tbuf.WriteString(fmt.Sprintf(\"[%s]\", levelText))\n\tcase !f.FullTimestamp:\n\t\tbuf.WriteString(fmt.Sprintf(\"[%s] [%04d]\", levelText, int(entry.Time.Sub(baseTimestamp)/time.Second)))\n\tdefault:\n\t\tbuf.WriteString(fmt.Sprintf(\"[%s] [%s]\", levelText,\n\t\t\tentry.Time.Format(f.TimestampFormat),\n\t\t))\n\t}\n\n\tif f.EnableGoroutineId {\n\t\tbuf.WriteString(fmt.Sprintf(\" [%d]\", runtime_.GoroutineID()))\n\t} else {\n\t\t//use pid instead of goroutine id\n\t\tbuf.WriteString(fmt.Sprintf(\" [%d]\", pid))\n\t}\n\n\tvar (\n\t\tfunction string\n\t\tfileline string = \"???:-1\"\n\t)\n\n\tif entry.HasCaller() {\n\t\tif f.CallerPrettyfier != nil {\n\t\t\tfunction, fileline = f.CallerPrettyfier(entry.Caller)\n\t\t} else {\n\t\t\tfunction = entry.Caller.Function\n\t\t\tfileline = fmt.Sprintf(\"%s:%d\", entry.Caller.File, entry.Caller.Line)\n\t\t}\n\n\t\tbuf.WriteString(fmt.Sprintf(\" [%s](%s)\", fileline, function))\n\t}\n\n\t//split head and body\n\tbuf.WriteString(\" \")\n\n\treturn buf.Bytes()\n}\n"
  },
  {
    "path": "pkg/logs/logrus/glog_formatter_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logrus_test\n\nimport (\n\t\"testing\"\n\n\tlogrus_ \"github.com/kaydxh/golang/pkg/logs/logrus\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc TestGlogFormatting(t *testing.T) {\n\ttf := &logrus_.GlogFormatter{\n\t\tDisableColors:     true,\n\t\tEnableGoroutineId: true,\n\t}\n\n\ttestCases := []struct {\n\t\tvalue    string\n\t\texpected string\n\t}{\n\t\t{`foo`, \"time=\\\"0001-01-01T00:00:00Z\\\" level=panic test=foo\\n\"},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tb, _ := tf.Format(logrus.WithField(\"test\", tc.value))\n\n\t\tif string(b) != tc.expected {\n\t\t\tt.Errorf(\"formatting expected for %q (result was %q instead of %q)\", tc.value, string(b), tc.expected)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "pkg/logs/logrus/terminal_check_bsd.go",
    "content": "//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && !js\n// +build darwin dragonfly freebsd netbsd openbsd\n// +build !js\n\n/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage logrus\n\nimport \"golang.org/x/sys/unix\"\n\nconst ioctlReadTermios = unix.TIOCGETA\n\nfunc isTerminal(fd int) bool {\n\t_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)\n\treturn err == nil\n}\n"
  },
  {
    "path": "pkg/logs/logrus/terminal_check_js.go",
    "content": "//go:build js\n// +build js\n\n/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage logrus\n\nfunc isTerminal(fd int) bool {\n\treturn false\n}\n"
  },
  {
    "path": "pkg/logs/logrus/terminal_check_notappengine.go",
    "content": "//go:build !appengine && !js && !windows && !nacl && !plan9\n// +build !appengine,!js,!windows,!nacl,!plan9\n\n/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage logrus\n\nimport (\n\t\"io\"\n\t\"os\"\n)\n\nfunc checkIfTerminal(w io.Writer) bool {\n\tswitch v := w.(type) {\n\tcase *os.File:\n\t\treturn isTerminal(int(v.Fd()))\n\tdefault:\n\t\treturn false\n\t}\n}\n"
  },
  {
    "path": "pkg/logs/logrus/terminal_check_solaris.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage logrus\n\nimport (\n\t\"golang.org/x/sys/unix\"\n)\n\n// IsTerminal returns true if the given file descriptor is a terminal.\nfunc isTerminal(fd int) bool {\n\t_, err := unix.IoctlGetTermio(fd, unix.TCGETA)\n\treturn err == nil\n}\n"
  },
  {
    "path": "pkg/logs/logrus/terminal_check_unix.go",
    "content": "//go:build (linux || aix || zos) && !js\n// +build linux aix zos\n// +build !js\n\n/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage logrus\n\nimport \"golang.org/x/sys/unix\"\n\nconst ioctlReadTermios = unix.TCGETS\n\nfunc isTerminal(fd int) bool {\n\t_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)\n\treturn err == nil\n}\n"
  },
  {
    "path": "pkg/logs/logrus/terminal_check_windows.go",
    "content": "//go:build !appengine && !js && windows\n// +build !appengine,!js,windows\n\n/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage logrus\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nfunc checkIfTerminal(w io.Writer) bool {\n\tswitch v := w.(type) {\n\tcase *os.File:\n\t\thandle := windows.Handle(v.Fd())\n\t\tvar mode uint32\n\t\tif err := windows.GetConsoleMode(handle, &mode); err != nil {\n\t\t\treturn false\n\t\t}\n\t\tmode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING\n\t\tif err := windows.SetConsoleMode(handle, mode); err != nil {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "pkg/logs/slog_test.go",
    "content": "package logs\n\nimport (\n\t\"github.com/sirupsen/logrus\"\n\t\"log/slog\"\n\t\"os\"\n\t\"testing\"\n)\n\n// Address 地址结构体\ntype Address struct {\n\tProvince string\n\tCity     string\n\tStreet   string\n\tZipCode  string\n}\n\n// Contact 联系方式结构体\ntype Contact struct {\n\tPhone   string\n\tEmail   string\n\tAddress *Address // 嵌套指针\n}\n\n// Person 人员结构体\ntype Person struct {\n\tName    string\n\tAge     int\n\tContact *Contact // 嵌套指针\n}\n\n// Company 公司结构体\ntype Company struct {\n\tName      string\n\tCEO       *Person  // 嵌套指针\n\tAddress   *Address // 嵌套指针\n\tEmployNum int\n}\n\nfunc TestSlog(t *testing.T) {\n\t// 创建一个 JSON 格式的 logger\n\t//logger := slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{\n\t//\tLevel: slog.LevelInfo,\n\t//}))\n\n\tlogger := slog.New(slog.NewTextHandler(os.Stdout, nil))\n\n\t// 创建嵌套指针对象并赋值\n\tcompany := &Company{\n\t\tName: \"科技有限公司\",\n\t\tCEO: &Person{\n\t\t\tName: \"张三\",\n\t\t\tAge:  45,\n\t\t\tContact: &Contact{\n\t\t\t\tPhone: \"13800138000\",\n\t\t\t\tEmail: \"zhangsan@example.com\",\n\t\t\t\tAddress: &Address{\n\t\t\t\t\tProvince: \"广东省\",\n\t\t\t\t\tCity:     \"深圳市\",\n\t\t\t\t\tStreet:   \"科技园南路1号\",\n\t\t\t\t\tZipCode:  \"518000\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tAddress: &Address{\n\t\t\tProvince: \"广东省\",\n\t\t\tCity:     \"深圳市\",\n\t\t\tStreet:   \"高新技术产业园区\",\n\t\t\tZipCode:  \"518057\",\n\t\t},\n\t\tEmployNum: 500,\n\t}\n\n\t// 使用 slog 打印结构化日志\n\tlogger.Info(\"公司信息\",\n\t\tslog.String(\"company_name\", company.Name),\n\t\tslog.Int(\"employee_count\", company.EmployNum),\n\t\tslog.Group(\"ceo\",\n\t\t\tslog.String(\"name\", company.CEO.Name),\n\t\t\tslog.Int(\"age\", company.CEO.Age),\n\t\t\tslog.Group(\"contact\",\n\t\t\t\tslog.String(\"phone\", company.CEO.Contact.Phone),\n\t\t\t\tslog.String(\"email\", company.CEO.Contact.Email),\n\t\t\t\tslog.Group(\"address\",\n\t\t\t\t\tslog.String(\"province\", company.CEO.Contact.Address.Province),\n\t\t\t\t\tslog.String(\"city\", company.CEO.Contact.Address.City),\n\t\t\t\t\tslog.String(\"street\", company.CEO.Contact.Address.Street),\n\t\t\t\t\tslog.String(\"zipcode\", company.CEO.Contact.Address.ZipCode),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\tslog.Group(\"company_address\",\n\t\t\tslog.String(\"province\", company.Address.Province),\n\t\t\tslog.String(\"city\", company.Address.City),\n\t\t\tslog.String(\"street\", company.Address.Street),\n\t\t\tslog.String(\"zipcode\", company.Address.ZipCode),\n\t\t),\n\t)\n\n\t// 也可以使用 slog.Any 直接打印整个对象\n\tlogger.Info(\"完整公司对象 slog \", slog.Any(\"company\", company))\n\tlogrus.Info(\"logrus 完整公司对象:\", company)\n\n\t// 测试 nil 指针的情况\n\temptyCompany := &Company{\n\t\tName:      \"空公司\",\n\t\tCEO:       nil,\n\t\tAddress:   nil,\n\t\tEmployNum: 0,\n\t}\n\tlogger.Info(\"空公司信息\", slog.Any(\"empty_company\", emptyCompany))\n}\n"
  },
  {
    "path": "pkg/middleware/api/tcloud/v3.0/http.interceptor.error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage tcloud\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\tstrings_ \"github.com/kaydxh/golang/go/strings\"\n\tjsonpb_ \"github.com/kaydxh/golang/pkg/protobuf/jsonpb\"\n\t\"github.com/sirupsen/logrus\"\n\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// HTTPError uses the mux-configured error handler.\nfunc HTTPError(ctx context.Context, mux *runtime.ServeMux,\n\tmarshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error) {\n\n\trequestId := context_.ExtractStringFromContext(ctx, http_.DefaultHTTPRequestIDKey)\n\tif requestId == \"\" {\n\t\trequestId = strings_.GetStringOrFallback(\n\t\t\tappend(runtime_.GetMetadata(ctx, http_.DefaultHTTPRequestIDKey), \"\")...)\n\t}\n\n\terrResponse := &ErrorResponse{\n\t\tError: &TCloudError{\n\t\t\tCode:    errors_.ErrorToCodeString(err),\n\t\t\tMessage: errors_.ErrorToString(err),\n\t\t},\n\t\tRequestId: requestId,\n\t}\n\tlogrus.WithField(\"request_id\", requestId).WithField(\"response\", errResponse).Errorf(\"send\")\n\n\t// ForwardResponseMessage forwards the message \"resp\" from gRPC server to REST client\n\truntime.ForwardResponseMessage(ctx, mux, marshaler, w, r, errResponse)\n}\n\n//cant not rewrite message, only append message to response\nfunc HTTPForwardResponse(ctx context.Context, r http.ResponseWriter, message proto.Message) error {\n\trespStruct, err := jsonpb_.MarshaToStructpb(message)\n\tif err != nil {\n\t\treturn err\n\t}\n\terrResponse := &TCloudResponse{\n\t\tResponse: respStruct,\n\t}\n\n\tjb, err := json.Marshal(errResponse)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"jsonpb.Marshal: %v\", err)\n\t}\n\n\tr.Write(jb)\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/middleware/api/tcloud/v3.0/interceptor.error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage tcloud\n\nimport (\n\t\"context\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\t\"github.com/sirupsen/logrus\"\n\t\"google.golang.org/grpc\"\n)\n\n// UnaryServerInterceptorOfError returns a new unary server interceptors\nfunc UnaryServerInterceptorOfError() grpc.UnaryServerInterceptor {\n\treturn func(ctx context.Context, req interface{},\n\t\tinfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\n\t\tresp, err := handler(ctx, req)\n\t\tif err == nil {\n\t\t\treturn resp, err\n\t\t}\n\n\t\terrResponse := &ErrorResponse{\n\t\t\tError: &TCloudError{\n\t\t\t\tCode:    errors_.ErrorToCode(err).String(),\n\t\t\t\tMessage: errors_.ErrorToString(err),\n\t\t\t},\n\t\t\tRequestId: reflect_.RetrieveId(req, reflect_.FieldNameRequestId),\n\t\t}\n\t\tlogrus.WithField(\"request_id\", errResponse.RequestId).WithField(\"response\", errResponse).Errorf(\"send\")\n\n\t\treturn errResponse, nil\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/api/tcloud/v3.0/jsonpb.marshaler.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage tcloud\n\nimport (\n\tmarshaler_ \"github.com/kaydxh/golang/go/runtime/marshaler\"\n)\n\ntype JSONPb struct {\n\t*marshaler_.JSONPb\n}\n\nfunc NewDefaultJSONPb() *JSONPb {\n\treturn &JSONPb{\n\t\tmarshaler_.NewDefaultJSONPb(),\n\t}\n}\n\n// Marshal marshals \"v\" into JSON.\nfunc (j *JSONPb) Marshal(v interface{}) ([]byte, error) {\n\trespStruct, err := j.JSONPb.MarshaToStructpb(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbody := &TCloudResponse{\n\t\tResponse: respStruct,\n\t}\n\n\treturn j.JSONPb.Marshal(body)\n}\n"
  },
  {
    "path": "pkg/middleware/api/tcloud/v3.0/tcloud.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: pkg/middleware/api/tcloud/v3.0/tcloud.proto\n\npackage tcloud\n\nimport (\n\t_ \"github.com/golang/protobuf/ptypes/duration\"\n\t_struct \"github.com/golang/protobuf/ptypes/struct\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\n// github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go\n// BaseRequest\ntype TCloudBaseRequest struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tHttpMethod string            `protobuf:\"bytes,1,opt,name=http_method,json=httpMethod,proto3\" json:\"http_method,omitempty\"`\n\tScheme     string            `protobuf:\"bytes,2,opt,name=scheme,proto3\" json:\"scheme,omitempty\"`\n\tRootDomain string            `protobuf:\"bytes,3,opt,name=root_domain,json=rootDomain,proto3\" json:\"root_domain,omitempty\"`\n\tDomain     string            `protobuf:\"bytes,4,opt,name=domain,proto3\" json:\"domain,omitempty\"`\n\tPath       string            `protobuf:\"bytes,5,opt,name=path,proto3\" json:\"path,omitempty\"`\n\tParams     map[string]string `protobuf:\"bytes,6,rep,name=params,proto3\" json:\"params,omitempty\" protobuf_key:\"bytes,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value,proto3\"`\n\tFormParams map[string]string `protobuf:\"bytes,7,rep,name=form_params,json=formParams,proto3\" json:\"form_params,omitempty\" protobuf_key:\"bytes,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value,proto3\"`\n\tService    string            `protobuf:\"bytes,8,opt,name=service,proto3\" json:\"service,omitempty\"`\n\tVersion    string            `protobuf:\"bytes,9,opt,name=version,proto3\" json:\"version,omitempty\"`\n\tAction     string            `protobuf:\"bytes,10,opt,name=action,proto3\" json:\"action,omitempty\"`\n}\n\nfunc (x *TCloudBaseRequest) Reset() {\n\t*x = TCloudBaseRequest{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *TCloudBaseRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TCloudBaseRequest) ProtoMessage() {}\n\nfunc (x *TCloudBaseRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use TCloudBaseRequest.ProtoReflect.Descriptor instead.\nfunc (*TCloudBaseRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *TCloudBaseRequest) GetHttpMethod() string {\n\tif x != nil {\n\t\treturn x.HttpMethod\n\t}\n\treturn \"\"\n}\n\nfunc (x *TCloudBaseRequest) GetScheme() string {\n\tif x != nil {\n\t\treturn x.Scheme\n\t}\n\treturn \"\"\n}\n\nfunc (x *TCloudBaseRequest) GetRootDomain() string {\n\tif x != nil {\n\t\treturn x.RootDomain\n\t}\n\treturn \"\"\n}\n\nfunc (x *TCloudBaseRequest) GetDomain() string {\n\tif x != nil {\n\t\treturn x.Domain\n\t}\n\treturn \"\"\n}\n\nfunc (x *TCloudBaseRequest) GetPath() string {\n\tif x != nil {\n\t\treturn x.Path\n\t}\n\treturn \"\"\n}\n\nfunc (x *TCloudBaseRequest) GetParams() map[string]string {\n\tif x != nil {\n\t\treturn x.Params\n\t}\n\treturn nil\n}\n\nfunc (x *TCloudBaseRequest) GetFormParams() map[string]string {\n\tif x != nil {\n\t\treturn x.FormParams\n\t}\n\treturn nil\n}\n\nfunc (x *TCloudBaseRequest) GetService() string {\n\tif x != nil {\n\t\treturn x.Service\n\t}\n\treturn \"\"\n}\n\nfunc (x *TCloudBaseRequest) GetVersion() string {\n\tif x != nil {\n\t\treturn x.Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *TCloudBaseRequest) GetAction() string {\n\tif x != nil {\n\t\treturn x.Action\n\t}\n\treturn \"\"\n}\n\n// https://github.com/TencentCloud/tencentcloud-sdk-go/blob/master/tencentcloud/common/http/response.go\ntype TCloudResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tResponse *_struct.Struct `protobuf:\"bytes,1,opt,name=response,json=Response,proto3\" json:\"response,omitempty\"`\n}\n\nfunc (x *TCloudResponse) Reset() {\n\t*x = TCloudResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *TCloudResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TCloudResponse) ProtoMessage() {}\n\nfunc (x *TCloudResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use TCloudResponse.ProtoReflect.Descriptor instead.\nfunc (*TCloudResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *TCloudResponse) GetResponse() *_struct.Struct {\n\tif x != nil {\n\t\treturn x.Response\n\t}\n\treturn nil\n}\n\ntype TCloudErrorResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\t// ErrorResponse\n\tResponse *ErrorResponse `protobuf:\"bytes,1,opt,name=response,json=Response,proto3\" json:\"response,omitempty\"`\n}\n\nfunc (x *TCloudErrorResponse) Reset() {\n\t*x = TCloudErrorResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *TCloudErrorResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TCloudErrorResponse) ProtoMessage() {}\n\nfunc (x *TCloudErrorResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use TCloudErrorResponse.ProtoReflect.Descriptor instead.\nfunc (*TCloudErrorResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (x *TCloudErrorResponse) GetResponse() *ErrorResponse {\n\tif x != nil {\n\t\treturn x.Response\n\t}\n\treturn nil\n}\n\n// ErrorResponse\ntype ErrorResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRequestId string       `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"`\n\tError     *TCloudError `protobuf:\"bytes,1000,opt,name=error,json=Error,proto3\" json:\"error,omitempty\"`\n}\n\nfunc (x *ErrorResponse) Reset() {\n\t*x = ErrorResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[3]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ErrorResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ErrorResponse) ProtoMessage() {}\n\nfunc (x *ErrorResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[3]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.\nfunc (*ErrorResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *ErrorResponse) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ErrorResponse) GetError() *TCloudError {\n\tif x != nil {\n\t\treturn x.Error\n\t}\n\treturn nil\n}\n\ntype TCloudError struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tCode    string `protobuf:\"bytes,1,opt,name=code,json=Code,proto3\" json:\"code,omitempty\"`\n\tMessage string `protobuf:\"bytes,2,opt,name=message,json=Message,proto3\" json:\"message,omitempty\"`\n}\n\nfunc (x *TCloudError) Reset() {\n\t*x = TCloudError{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[4]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *TCloudError) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TCloudError) ProtoMessage() {}\n\nfunc (x *TCloudError) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[4]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use TCloudError.ProtoReflect.Descriptor instead.\nfunc (*TCloudError) Descriptor() ([]byte, []int) {\n\treturn file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescGZIP(), []int{4}\n}\n\nfunc (x *TCloudError) GetCode() string {\n\tif x != nil {\n\t\treturn x.Code\n\t}\n\treturn \"\"\n}\n\nfunc (x *TCloudError) GetMessage() string {\n\tif x != nil {\n\t\treturn x.Message\n\t}\n\treturn \"\"\n}\n\nvar File_pkg_middleware_api_tcloud_v3_0_tcloud_proto protoreflect.FileDescriptor\n\nvar file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDesc = []byte{\n\t0x0a, 0x2b, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65,\n\t0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x76, 0x33, 0x2e, 0x30,\n\t0x2f, 0x74, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x61,\n\t0x70, 0x69, 0x2e, 0x74, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x76, 0x33, 0x1a, 0x1e, 0x67, 0x6f,\n\t0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75,\n\t0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f,\n\t0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74,\n\t0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x03, 0x0a, 0x11, 0x54,\n\t0x43, 0x6c, 0x6f, 0x75, 0x64, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,\n\t0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18,\n\t0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x4d, 0x65, 0x74, 0x68, 0x6f,\n\t0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x6f, 0x6f,\n\t0x74, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,\n\t0x72, 0x6f, 0x6f, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f,\n\t0x6d, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61,\n\t0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,\n\t0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x44, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73,\n\t0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x63, 0x6c,\n\t0x6f, 0x75, 0x64, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x42, 0x61, 0x73,\n\t0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45,\n\t0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x51, 0x0a, 0x0b,\n\t0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28,\n\t0x0b, 0x32, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x76,\n\t0x33, 0x2e, 0x54, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75,\n\t0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e,\n\t0x74, 0x72, 0x79, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12,\n\t0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,\n\t0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72,\n\t0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73,\n\t0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20,\n\t0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x50,\n\t0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,\n\t0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,\n\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c,\n\t0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x6d, 0x50, 0x61,\n\t0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,\n\t0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,\n\t0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,\n\t0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x45, 0x0a, 0x0e, 0x54, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x52,\n\t0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f,\n\t0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67,\n\t0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75,\n\t0x63, 0x74, 0x52, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0x0a, 0x13,\n\t0x54, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,\n\t0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18,\n\t0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x63, 0x6c, 0x6f,\n\t0x75, 0x64, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,\n\t0x6e, 0x73, 0x65, 0x52, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x61, 0x0a,\n\t0x0d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d,\n\t0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,\n\t0x28, 0x09, 0x52, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a,\n\t0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,\n\t0x61, 0x70, 0x69, 0x2e, 0x74, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x43,\n\t0x6c, 0x6f, 0x75, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72,\n\t0x22, 0x3b, 0x0a, 0x0b, 0x54, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12,\n\t0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43,\n\t0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02,\n\t0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x50, 0x5a,\n\t0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64,\n\t0x78, 0x68, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x69,\n\t0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x6d, 0x69,\n\t0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x63, 0x6c,\n\t0x6f, 0x75, 0x64, 0x2f, 0x76, 0x33, 0x2e, 0x30, 0x3b, 0x74, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x62,\n\t0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescOnce sync.Once\n\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescData = file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDesc\n)\n\nfunc file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescGZIP() []byte {\n\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescData)\n\t})\n\treturn file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDescData\n}\n\nvar file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes = make([]protoimpl.MessageInfo, 7)\nvar file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_goTypes = []interface{}{\n\t(*TCloudBaseRequest)(nil),   // 0: api.tcloud.v3.TCloudBaseRequest\n\t(*TCloudResponse)(nil),      // 1: api.tcloud.v3.TCloudResponse\n\t(*TCloudErrorResponse)(nil), // 2: api.tcloud.v3.TCloudErrorResponse\n\t(*ErrorResponse)(nil),       // 3: api.tcloud.v3.ErrorResponse\n\t(*TCloudError)(nil),         // 4: api.tcloud.v3.TCloudError\n\tnil,                         // 5: api.tcloud.v3.TCloudBaseRequest.ParamsEntry\n\tnil,                         // 6: api.tcloud.v3.TCloudBaseRequest.FormParamsEntry\n\t(*_struct.Struct)(nil),      // 7: google.protobuf.Struct\n}\nvar file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_depIdxs = []int32{\n\t5, // 0: api.tcloud.v3.TCloudBaseRequest.params:type_name -> api.tcloud.v3.TCloudBaseRequest.ParamsEntry\n\t6, // 1: api.tcloud.v3.TCloudBaseRequest.form_params:type_name -> api.tcloud.v3.TCloudBaseRequest.FormParamsEntry\n\t7, // 2: api.tcloud.v3.TCloudResponse.response:type_name -> google.protobuf.Struct\n\t3, // 3: api.tcloud.v3.TCloudErrorResponse.response:type_name -> api.tcloud.v3.ErrorResponse\n\t4, // 4: api.tcloud.v3.ErrorResponse.error:type_name -> api.tcloud.v3.TCloudError\n\t5, // [5:5] is the sub-list for method output_type\n\t5, // [5:5] is the sub-list for method input_type\n\t5, // [5:5] is the sub-list for extension type_name\n\t5, // [5:5] is the sub-list for extension extendee\n\t0, // [0:5] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_init() }\nfunc file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_init() {\n\tif File_pkg_middleware_api_tcloud_v3_0_tcloud_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*TCloudBaseRequest); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*TCloudResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*TCloudErrorResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ErrorResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*TCloudError); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   7,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_middleware_api_tcloud_v3_0_tcloud_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_middleware_api_tcloud_v3_0_tcloud_proto = out.File\n\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_rawDesc = nil\n\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_goTypes = nil\n\tfile_pkg_middleware_api_tcloud_v3_0_tcloud_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/middleware/api/tcloud/v3.0/tcloud.proto",
    "content": "syntax = \"proto3\";\n\npackage api.tcloud.v3;\n\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/struct.proto\";\n\noption go_package = \"github.com/kaydxh/golang/pkg/middleware/grpc-middleware/api/tcloud/v3.0;tcloud\";\n\n// github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go\n// BaseRequest\nmessage TCloudBaseRequest {\n  string http_method = 1 [json_name = \"httpMethod\"];\n  string scheme = 2 [json_name = \"scheme\"];\n  string root_domain = 3 [json_name = \"rootDomain\"];\n  string domain = 4 [json_name = \"domain\"];\n  string path = 5 [json_name = \"path\"];\n  map<string, string> params = 6 [json_name = \"params\"];\n  map<string, string> form_params = 7 [json_name = \"formParams\"];\n\n  string service = 8 [json_name = \"service\"];\n  string version = 9 [json_name = \"version\"];\n  string action = 10 [json_name = \"action\"];\n}\n\n// https://github.com/TencentCloud/tencentcloud-sdk-go/blob/master/tencentcloud/common/http/response.go\nmessage TCloudResponse {\n  google.protobuf.Struct response = 1 [json_name = \"Response\"];\n}\n\nmessage TCloudErrorResponse {\n  // ErrorResponse\n  ErrorResponse response = 1 [json_name = \"Response\"];\n}\n\n// ErrorResponse\nmessage ErrorResponse {\n  string request_id = 1 [json_name = \"RequestId\"];\n  TCloudError error = 1000 [json_name = \"Error\"];\n}\n\nmessage TCloudError {\n  string code = 1 [json_name = \"Code\"];\n  string message = 2 [json_name = \"Message\"];\n}\n"
  },
  {
    "path": "pkg/middleware/api/trivial/v1/api.pb.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.27.0\n// \tprotoc        v3.13.0\n// source: pkg/middleware/api/trivial/v1/api.proto\n\npackage v1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype TrivialResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tSessionId string `protobuf:\"bytes,1,opt,name=session_id,proto3\" json:\"session_id,omitempty\"`\n\tErrorCode int32  `protobuf:\"varint,2,opt,name=error_code,json=errorcode,proto3\" json:\"error_code,omitempty\"`\n\tErrorMsg  string `protobuf:\"bytes,3,opt,name=error_msg,json=errormsg,proto3\" json:\"error_msg,omitempty\"`\n}\n\nfunc (x *TrivialResponse) Reset() {\n\t*x = TrivialResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_middleware_api_trivial_v1_api_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *TrivialResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TrivialResponse) ProtoMessage() {}\n\nfunc (x *TrivialResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_middleware_api_trivial_v1_api_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use TrivialResponse.ProtoReflect.Descriptor instead.\nfunc (*TrivialResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_middleware_api_trivial_v1_api_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *TrivialResponse) GetSessionId() string {\n\tif x != nil {\n\t\treturn x.SessionId\n\t}\n\treturn \"\"\n}\n\nfunc (x *TrivialResponse) GetErrorCode() int32 {\n\tif x != nil {\n\t\treturn x.ErrorCode\n\t}\n\treturn 0\n}\n\nfunc (x *TrivialResponse) GetErrorMsg() string {\n\tif x != nil {\n\t\treturn x.ErrorMsg\n\t}\n\treturn \"\"\n}\n\ntype TrivialErrorResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tSessionId string `protobuf:\"bytes,1,opt,name=session_id,proto3\" json:\"session_id,omitempty\"`\n\tErrorCode int32  `protobuf:\"varint,2,opt,name=error_code,json=errorcode,proto3\" json:\"error_code,omitempty\"`\n\tErrorMsg  string `protobuf:\"bytes,3,opt,name=error_msg,json=errormsg,proto3\" json:\"error_msg,omitempty\"`\n}\n\nfunc (x *TrivialErrorResponse) Reset() {\n\t*x = TrivialErrorResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_middleware_api_trivial_v1_api_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *TrivialErrorResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TrivialErrorResponse) ProtoMessage() {}\n\nfunc (x *TrivialErrorResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_middleware_api_trivial_v1_api_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use TrivialErrorResponse.ProtoReflect.Descriptor instead.\nfunc (*TrivialErrorResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_middleware_api_trivial_v1_api_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *TrivialErrorResponse) GetSessionId() string {\n\tif x != nil {\n\t\treturn x.SessionId\n\t}\n\treturn \"\"\n}\n\nfunc (x *TrivialErrorResponse) GetErrorCode() int32 {\n\tif x != nil {\n\t\treturn x.ErrorCode\n\t}\n\treturn 0\n}\n\nfunc (x *TrivialErrorResponse) GetErrorMsg() string {\n\tif x != nil {\n\t\treturn x.ErrorMsg\n\t}\n\treturn \"\"\n}\n\nvar File_pkg_middleware_api_trivial_v1_api_proto protoreflect.FileDescriptor\n\nvar file_pkg_middleware_api_trivial_v1_api_proto_rawDesc = []byte{\n\t0x0a, 0x27, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65,\n\t0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x72, 0x69, 0x76, 0x69, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x2f,\n\t0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x61, 0x70, 0x69, 0x2e, 0x74,\n\t0x72, 0x69, 0x76, 0x69, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x22, 0x6d, 0x0a, 0x0f, 0x54, 0x72, 0x69,\n\t0x76, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a,\n\t0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,\n\t0x52, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a,\n\t0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,\n\t0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65,\n\t0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,\n\t0x65, 0x72, 0x72, 0x6f, 0x72, 0x6d, 0x73, 0x67, 0x22, 0x72, 0x0a, 0x14, 0x54, 0x72, 0x69, 0x76,\n\t0x69, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,\n\t0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01,\n\t0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64,\n\t0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02,\n\t0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x12,\n\t0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01,\n\t0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x6d, 0x73, 0x67, 0x42, 0x3b, 0x5a, 0x39,\n\t0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78,\n\t0x68, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x69, 0x64,\n\t0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x72, 0x69, 0x76,\n\t0x69, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x33,\n}\n\nvar (\n\tfile_pkg_middleware_api_trivial_v1_api_proto_rawDescOnce sync.Once\n\tfile_pkg_middleware_api_trivial_v1_api_proto_rawDescData = file_pkg_middleware_api_trivial_v1_api_proto_rawDesc\n)\n\nfunc file_pkg_middleware_api_trivial_v1_api_proto_rawDescGZIP() []byte {\n\tfile_pkg_middleware_api_trivial_v1_api_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_middleware_api_trivial_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_middleware_api_trivial_v1_api_proto_rawDescData)\n\t})\n\treturn file_pkg_middleware_api_trivial_v1_api_proto_rawDescData\n}\n\nvar file_pkg_middleware_api_trivial_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_pkg_middleware_api_trivial_v1_api_proto_goTypes = []interface{}{\n\t(*TrivialResponse)(nil),      // 0: api.trivial.v1.TrivialResponse\n\t(*TrivialErrorResponse)(nil), // 1: api.trivial.v1.TrivialErrorResponse\n}\nvar file_pkg_middleware_api_trivial_v1_api_proto_depIdxs = []int32{\n\t0, // [0:0] is the sub-list for method output_type\n\t0, // [0:0] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_middleware_api_trivial_v1_api_proto_init() }\nfunc file_pkg_middleware_api_trivial_v1_api_proto_init() {\n\tif File_pkg_middleware_api_trivial_v1_api_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_middleware_api_trivial_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*TrivialResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_middleware_api_trivial_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*TrivialErrorResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_middleware_api_trivial_v1_api_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_middleware_api_trivial_v1_api_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_middleware_api_trivial_v1_api_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_middleware_api_trivial_v1_api_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_middleware_api_trivial_v1_api_proto = out.File\n\tfile_pkg_middleware_api_trivial_v1_api_proto_rawDesc = nil\n\tfile_pkg_middleware_api_trivial_v1_api_proto_goTypes = nil\n\tfile_pkg_middleware_api_trivial_v1_api_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/middleware/api/trivial/v1/api.proto",
    "content": "syntax = \"proto3\";\n\npackage api.trivial.v1;\n\noption go_package = \"github.com/kaydxh/golang/pkg/middleware/api/trivial/v1;v1\";\n\nmessage TrivialResponse {\n  string session_id = 1 [json_name = \"session_id\"];\n  int32 error_code = 2 [json_name = \"errorcode\"];\n  string error_msg = 3 [json_name = \"errormsg\"];\n}\n\nmessage TrivialErrorResponse {\n  string session_id = 1 [json_name = \"session_id\"];\n  int32 error_code = 2 [json_name = \"errorcode\"];\n  string error_msg = 3 [json_name = \"errormsg\"];\n}\n"
  },
  {
    "path": "pkg/middleware/api/trivial/v1/http.interceptor.error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage v1\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\tstrings_ \"github.com/kaydxh/golang/go/strings\"\n\t\"github.com/sirupsen/logrus\"\n\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// HTTPError uses the mux-configured error handler.\nfunc HTTPError(ctx context.Context, mux *runtime.ServeMux,\n\tmarshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error) {\n\n\trequestId := context_.ExtractStringFromContext(ctx, http_.DefaultHTTPRequestIDKey)\n\tif requestId == \"\" {\n\t\trequestId = strings_.GetStringOrFallback(\n\t\t\tappend(runtime_.GetMetadata(ctx, http_.DefaultHTTPRequestIDKey), \"\")...)\n\t}\n\n\terrResponse := &TrivialErrorResponse{\n\t\tErrorCode: int32(errors_.ErrorToCode(err)),\n\t\tErrorMsg:  errors_.ErrorToString(err),\n\t\tSessionId: requestId,\n\t}\n\tlogrus.WithField(\"request_id\", requestId).WithField(\"response\", errResponse).Errorf(\"send\")\n\n\t// ForwardResponseMessage forwards the message \"resp\" from gRPC server to REST client\n\truntime.ForwardResponseMessage(ctx, mux, marshaler, w, r, errResponse)\n}\n\n//cant not rewrite message, only append message to response\nfunc HTTPForwardResponse(ctx context.Context, r http.ResponseWriter, message proto.Message) error {\n\tjb, err := json.Marshal(message)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"jsonpb.Marshal: %v\", err)\n\t}\n\n\tr.Write(jb)\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/middleware/api/trivial/v1/interceptor.error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage v1\n\nimport (\n\t\"context\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\t\"github.com/sirupsen/logrus\"\n\t\"google.golang.org/grpc\"\n)\n\n// UnaryServerInterceptorOfError returns a new unary server interceptors\nfunc UnaryServerInterceptorOfError() grpc.UnaryServerInterceptor {\n\treturn func(ctx context.Context, req interface{},\n\t\tinfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\n\t\tresp, err := handler(ctx, req)\n\t\tif err == nil {\n\t\t\treturn resp, err\n\t\t}\n\n\t\terrResponse := &TrivialErrorResponse{\n\t\t\tErrorCode: int32(errors_.ErrorToCode(err)),\n\t\t\tErrorMsg:  errors_.ErrorToString(err),\n\t\t\tSessionId: reflect_.RetrieveId(req, reflect_.FieldNameSessionId),\n\t\t}\n\t\tlogrus.WithField(\"request_id\", errResponse.SessionId).WithField(\"response\", errResponse).Errorf(\"send\")\n\n\t\treturn errResponse, nil\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/api/trivial/v2/api.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: pkg/middleware/api/trivial/v2/api.proto\n\npackage v2\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\n// ErrorResponse\ntype ErrorResponse struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tRequestId string       `protobuf:\"bytes,1,opt,name=request_id,json=RequestId,proto3\" json:\"request_id,omitempty\"`\n\tError     *TCloudError `protobuf:\"bytes,1000,opt,name=error,json=Error,proto3\" json:\"error,omitempty\"`\n}\n\nfunc (x *ErrorResponse) Reset() {\n\t*x = ErrorResponse{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_middleware_api_trivial_v2_api_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ErrorResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ErrorResponse) ProtoMessage() {}\n\nfunc (x *ErrorResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_middleware_api_trivial_v2_api_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.\nfunc (*ErrorResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_middleware_api_trivial_v2_api_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *ErrorResponse) GetRequestId() string {\n\tif x != nil {\n\t\treturn x.RequestId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ErrorResponse) GetError() *TCloudError {\n\tif x != nil {\n\t\treturn x.Error\n\t}\n\treturn nil\n}\n\ntype TCloudError struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tCode    string `protobuf:\"bytes,1,opt,name=code,json=Code,proto3\" json:\"code,omitempty\"`\n\tMessage string `protobuf:\"bytes,2,opt,name=message,json=Message,proto3\" json:\"message,omitempty\"`\n}\n\nfunc (x *TCloudError) Reset() {\n\t*x = TCloudError{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_middleware_api_trivial_v2_api_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *TCloudError) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TCloudError) ProtoMessage() {}\n\nfunc (x *TCloudError) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_middleware_api_trivial_v2_api_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use TCloudError.ProtoReflect.Descriptor instead.\nfunc (*TCloudError) Descriptor() ([]byte, []int) {\n\treturn file_pkg_middleware_api_trivial_v2_api_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *TCloudError) GetCode() string {\n\tif x != nil {\n\t\treturn x.Code\n\t}\n\treturn \"\"\n}\n\nfunc (x *TCloudError) GetMessage() string {\n\tif x != nil {\n\t\treturn x.Message\n\t}\n\treturn \"\"\n}\n\nvar File_pkg_middleware_api_trivial_v2_api_proto protoreflect.FileDescriptor\n\nvar file_pkg_middleware_api_trivial_v2_api_proto_rawDesc = []byte{\n\t0x0a, 0x27, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65,\n\t0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x72, 0x69, 0x76, 0x69, 0x61, 0x6c, 0x2f, 0x76, 0x32, 0x2f,\n\t0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x61, 0x70, 0x69, 0x2e, 0x74,\n\t0x72, 0x69, 0x76, 0x69, 0x61, 0x6c, 0x2e, 0x76, 0x32, 0x22, 0x62, 0x0a, 0x0d, 0x45, 0x72, 0x72,\n\t0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65,\n\t0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,\n\t0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x05, 0x65, 0x72, 0x72,\n\t0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e,\n\t0x74, 0x72, 0x69, 0x76, 0x69, 0x61, 0x6c, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x43, 0x6c, 0x6f, 0x75,\n\t0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3b, 0x0a,\n\t0x0b, 0x54, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04,\n\t0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65,\n\t0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69,\n\t0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f,\n\t0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x69, 0x64, 0x64, 0x6c,\n\t0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x72, 0x69, 0x76, 0x69, 0x61,\n\t0x6c, 0x2f, 0x76, 0x32, 0x3b, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_middleware_api_trivial_v2_api_proto_rawDescOnce sync.Once\n\tfile_pkg_middleware_api_trivial_v2_api_proto_rawDescData = file_pkg_middleware_api_trivial_v2_api_proto_rawDesc\n)\n\nfunc file_pkg_middleware_api_trivial_v2_api_proto_rawDescGZIP() []byte {\n\tfile_pkg_middleware_api_trivial_v2_api_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_middleware_api_trivial_v2_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_middleware_api_trivial_v2_api_proto_rawDescData)\n\t})\n\treturn file_pkg_middleware_api_trivial_v2_api_proto_rawDescData\n}\n\nvar file_pkg_middleware_api_trivial_v2_api_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_pkg_middleware_api_trivial_v2_api_proto_goTypes = []interface{}{\n\t(*ErrorResponse)(nil), // 0: api.trivial.v2.ErrorResponse\n\t(*TCloudError)(nil),   // 1: api.trivial.v2.TCloudError\n}\nvar file_pkg_middleware_api_trivial_v2_api_proto_depIdxs = []int32{\n\t1, // 0: api.trivial.v2.ErrorResponse.error:type_name -> api.trivial.v2.TCloudError\n\t1, // [1:1] is the sub-list for method output_type\n\t1, // [1:1] is the sub-list for method input_type\n\t1, // [1:1] is the sub-list for extension type_name\n\t1, // [1:1] is the sub-list for extension extendee\n\t0, // [0:1] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_middleware_api_trivial_v2_api_proto_init() }\nfunc file_pkg_middleware_api_trivial_v2_api_proto_init() {\n\tif File_pkg_middleware_api_trivial_v2_api_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_middleware_api_trivial_v2_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ErrorResponse); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_middleware_api_trivial_v2_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*TCloudError); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_middleware_api_trivial_v2_api_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_middleware_api_trivial_v2_api_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_middleware_api_trivial_v2_api_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_middleware_api_trivial_v2_api_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_middleware_api_trivial_v2_api_proto = out.File\n\tfile_pkg_middleware_api_trivial_v2_api_proto_rawDesc = nil\n\tfile_pkg_middleware_api_trivial_v2_api_proto_goTypes = nil\n\tfile_pkg_middleware_api_trivial_v2_api_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/middleware/api/trivial/v2/api.proto",
    "content": "syntax = \"proto3\";\n\npackage api.trivial.v2;\n\noption go_package = \"github.com/kaydxh/golang/pkg/middleware/api/trivial/v2;v2\";\n\n// ErrorResponse\nmessage ErrorResponse {\n  string request_id = 1 [json_name = \"RequestId\"];\n  TCloudError error = 1000 [json_name = \"Error\"];\n}\n\nmessage TCloudError {\n  string code = 1 [json_name = \"Code\"];\n  string message = 2 [json_name = \"Message\"];\n}\n"
  },
  {
    "path": "pkg/middleware/api/trivial/v2/http.interceptor.error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage v2\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\tstrings_ \"github.com/kaydxh/golang/go/strings\"\n\t\"github.com/sirupsen/logrus\"\n\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// HTTPError uses the mux-configured error handler.\nfunc HTTPError(ctx context.Context, mux *runtime.ServeMux,\n\tmarshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error) {\n\n\trequestId := context_.ExtractStringFromContext(ctx, http_.DefaultHTTPRequestIDKey)\n\tif requestId == \"\" {\n\t\trequestId = strings_.GetStringOrFallback(\n\t\t\tappend(runtime_.GetMetadata(ctx, http_.DefaultHTTPRequestIDKey), \"\")...)\n\t}\n\n\terrResponse := &ErrorResponse{\n\t\tError: &TCloudError{\n\t\t\tCode:    errors_.ErrorToCodeString(err),\n\t\t\tMessage: errors_.ErrorToString(err),\n\t\t},\n\t\tRequestId: requestId,\n\t}\n\tlogrus.WithField(\"request_id\", requestId).WithField(\"response\", errResponse).Errorf(\"send\")\n\n\t// ForwardResponseMessage forwards the message \"resp\" from gRPC server to REST client\n\truntime.ForwardResponseMessage(ctx, mux, marshaler, w, r, errResponse)\n}\n\n// cant not rewrite message, only append message to response\nfunc HTTPForwardResponse(ctx context.Context, r http.ResponseWriter, message proto.Message) error {\n\tjb, err := json.Marshal(message)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"jsonpb.Marshal: %v\", err)\n\t}\n\n\tr.Write(jb)\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/middleware/api/trivial/v2/interceptor.error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage v2\n\nimport (\n\t\"context\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\t\"github.com/sirupsen/logrus\"\n\t\"google.golang.org/grpc\"\n)\n\n// UnaryServerInterceptorOfError returns a new unary server interceptors\nfunc UnaryServerInterceptorOfError() grpc.UnaryServerInterceptor {\n\treturn func(ctx context.Context, req interface{},\n\t\tinfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\n\t\tresp, err := handler(ctx, req)\n\t\tif err == nil {\n\t\t\treturn resp, err\n\t\t}\n\n\t\terrResponse := &ErrorResponse{\n\t\t\tError: &TCloudError{\n\t\t\t\tCode:    errors_.ErrorToCode(err).String(),\n\t\t\t\tMessage: errors_.ErrorToString(err),\n\t\t\t},\n\t\t\tRequestId: reflect_.RetrieveId(req, reflect_.FieldNameRequestId),\n\t\t}\n\t\tlogrus.WithField(\"request_id\", errResponse.RequestId).WithField(\"response\", errResponse).Errorf(\"send\")\n\n\t\treturn errResponse, nil\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/middleware\n\ngo 1.25.3\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/webserver => ../webserver\n\nreplace github.com/kaydxh/golang/pkg/opentelemetry => ../opentelemetry\n\nrequire (\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/google/uuid v1.6.0\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/logs v0.0.0-20251125132602-62c26b682228\n\tgithub.com/kaydxh/golang/pkg/opentelemetry v0.0.0-00010101000000-000000000000\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/webserver v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0\n\tgo.opentelemetry.io/otel v1.38.0\n\tgo.opentelemetry.io/otel/metric v1.38.0\n\tgo.opentelemetry.io/otel/trace v1.38.0\n\tgoogle.golang.org/grpc v1.77.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect\n\tgithub.com/beorn7/perks v1.0.1 // indirect\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-logr/logr v1.4.3 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/inconshreveable/mousetrap v1.1.0 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/moby/term v0.5.2 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/prometheus/client_model v0.6.2 // indirect\n\tgithub.com/prometheus/common v0.66.1 // indirect\n\tgithub.com/prometheus/procfs v0.17.0 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/cobra v1.10.1 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/spf13/viper v1.21.0 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.opentelemetry.io/auto/sdk v1.2.1 // indirect\n\tgo.uber.org/atomic v1.11.0 // indirect\n\tgo.yaml.in/yaml/v2 v2.4.2 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n)\n"
  },
  {
    "path": "pkg/middleware/go.sum",
    "content": "github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=\ngithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=\ngithub.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=\ngithub.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=\ngithub.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=\ngithub.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=\ngithub.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4=\ngithub.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=\ngithub.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 h1:Q0arlJiD7BygvPMDHcvTdg1urHqADnd7P2qk3r2HlyE=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228/go.mod h1:ML4gUddcaOo55zQ9/m8SxjZYYVTJACriuUFcqs1BEd4=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 h1:7zmih7dDhXTVDxbWy4Cp0OrSqMdQaQzlRUtCzZXMVgc=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228/go.mod h1:DeGVCOtdDQNg6/hVvPwYqeH0EbGcbFiQcKNvMrD+NyY=\ngithub.com/kaydxh/golang/pkg/logs v0.0.0-20251125132602-62c26b682228 h1:Z9rIRFQ5Fpa5VibJaRbZeKvcbAET/Ckfwq1nvboE4SE=\ngithub.com/kaydxh/golang/pkg/logs v0.0.0-20251125132602-62c26b682228/go.mod h1:QFp3TpQ/DR3CEQpIhmPGWugfDvmvAxK6AvPxMXgHNj0=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=\ngithub.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=\ngithub.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=\ngithub.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=\ngithub.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=\ngithub.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=\ngithub.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=\ngithub.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=\ngithub.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=\ngithub.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=\ngithub.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=\ngo.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=\ngo.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=\ngo.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=\ngolang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/debug/in_output_printer_client.interceptor.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptordebug\n\nimport (\n\t\"context\"\n\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\tstrings_ \"github.com/kaydxh/golang/go/strings\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\nfunc UnaryClientInterceptorOfInOutputPrinter(filterMethods ...string) grpc.UnaryClientInterceptor {\n\n\treturn func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {\n\n\t\tlogger := logs_.GetLogger(ctx)\n\n\t\tenablePrint := !strings_.SliceContainsCaseInSensitive(filterMethods, method)\n\t\tif enablePrint {\n\t\t\treqProto, ok := any(req).(proto.Message)\n\t\t\tif ok {\n\t\t\t\tlogger.WithField(\"request\", reflect_.TruncateBytesAndStrings(proto.Clone(reqProto))).Info(\"send\")\n\t\t\t}\n\t\t}\n\n\t\terr := invoker(ctx, method, req, reply, cc, opts...)\n\n\t\tif enablePrint {\n\t\t\trespProto, ok := any(reply).(proto.Message)\n\t\t\tif ok {\n\t\t\t\tlogger.WithField(\"response\", reflect_.TruncateBytesAndStrings(proto.Clone(respProto))).Info(\"recv\")\n\t\t\t}\n\t\t}\n\n\t\treturn err\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/debug/in_output_printer_server.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptordebug\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/protobuf/encoding/protojson\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype JsonpbMarshaller struct {\n\tproto.Message\n}\n\nfunc (j *JsonpbMarshaller) MarshalJson() ([]byte, error) {\n\tdata, err := protojson.Marshal(j.Message)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to marshaJson: %v\", err)\n\t}\n\n\treturn data, nil\n}\n\n//  UnaryServerInterceptorOfInOutputPrinter log in-output packet\nfunc UnaryServerInterceptorOfInOutputPrinter() grpc.UnaryServerInterceptor {\n\n\treturn func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\t\treturn HandleInOutputPrinter(info, handler)(ctx, req)\n\t}\n}\n\nfunc HandleInOutputPrinter[REQ any, RESP any](info *grpc.UnaryServerInfo, handler func(ctx context.Context, req REQ) (RESP, error)) func(ctx context.Context, req REQ) (RESP, error) {\n\treturn func(ctx context.Context, req REQ) (RESP, error) {\n\t\tlogger := logs_.GetLogger(ctx)\n\n\t\tvar method string\n\t\tif info != nil {\n\t\t\tmethod = info.FullMethod\n\t\t} else {\n\t\t\tmethod, _ = runtime.RPCMethod(ctx)\n\t\t}\n\n\t\treqProto, ok := any(req).(proto.Message)\n\t\tif ok {\n\t\t\tlogger.WithField(\"method\", method).WithField(\"request\", reflect_.TruncateBytesAndStrings(proto.Clone(reqProto))).Info(\"recv\")\n\t\t}\n\n\t\tresp, err := handler(ctx, req)\n\t\trespProto, ok := any(resp).(proto.Message)\n\t\tif ok {\n\t\t\tlogger.WithField(\"method\", method).WithField(\"response\", reflect_.TruncateBytesAndStrings(proto.Clone(respProto))).Info(\"send\")\n\t\t}\n\n\t\treturn resp, err\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/debug/request_id_server.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptordebug\n\nimport (\n\t\"context\"\n\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\n\t\"github.com/google/uuid\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\n\tresource_ \"github.com/kaydxh/golang/pkg/middleware/resource\"\n\t\"github.com/sirupsen/logrus\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/metadata\"\n)\n\n// UnaryServerInterceptorOfRequestId returns a new unary server interceptors with tags in context with request_id.\nfunc UnaryServerInterceptorOfRequestId() grpc.UnaryServerInterceptor {\n\treturn func(ctx context.Context, req interface{},\n\t\tinfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\t\treturn HandleReuestId(resource_.HandlerWithContext[any, any](handler))(ctx, req)\n\t}\n}\n\nfunc HandleReuestId[REQ any, RESP any](handler resource_.HandlerWithContext[REQ, RESP]) resource_.HandlerWithContext[REQ, RESP] {\n\t//func HandleReuestId[REQ any, RESP any](handler func(ctx context.Context, req REQ) (RESP, error)) func(ctx context.Context, req REQ) (RESP, error) {\n\treturn func(ctx context.Context, req REQ) (RESP, error) {\n\t\t// retrieve requestId from request\n\t\tid := reflect_.RetrieveId(req, reflect_.FieldNameRequestId)\n\t\tif id == \"\" {\n\t\t\tid = context_.ExtractRequestIDFromContext(ctx)\n\t\t\tif id == \"\" {\n\t\t\t\t//if id is empty, set new uuid to request\n\t\t\t\tid = uuid.NewString()\n\t\t\t\treflect_.TrySetId(req, reflect_.FieldNameRequestId, id)\n\t\t\t}\n\t\t}\n\n\t\t//set \"X-Request-ID\" to context\n\t\tctx = context_.SetPairContext(ctx, http_.DefaultHTTPRequestIDKey, id)\n\n\t\t// extract traceId from context, fallback to requestId\n\t\ttraceId := context_.ExtractTraceIDFromContext(ctx)\n\t\tif traceId == \"\" {\n\t\t\ttraceId = id\n\t\t}\n\t\tctx = context_.SetPairContext(ctx, http_.DefaultHTTPTraceIDKey, traceId)\n\n\t\tresp, err := handler(ctx, req)\n\t\t// try set requestId to response\n\t\treflect_.TrySetId(resp, reflect_.FieldNameRequestId, id)\n\t\t// write RequestId to HTTP Header\n\t\tif err_ := grpc.SetHeader(ctx, metadata.Pairs(http_.DefaultHTTPRequestIDKey, id)); err_ != nil {\n\t\t\tlogrus.WithError(err_).WithField(\"request_id\", id).Warningf(\"grpc.SendHeader, ignore\")\n\t\t}\n\t\treturn resp, err\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/opentelemetry/metric_server.interceptor.go",
    "content": "package interceptoropentelemetry\n\nimport (\n\t\"context\"\n\n\t\"github.com/grpc-ecosystem/grpc-gateway/v2/runtime\"\n\tgrpc_ \"github.com/kaydxh/golang/go/net/grpc\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\tresource_ \"github.com/kaydxh/golang/pkg/middleware/resource\"\n\t\"google.golang.org/grpc\"\n)\n\nfunc UnaryServerMetricInterceptor() grpc.UnaryServerInterceptor {\n\n\treturn func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\n\t\treturn handleMetric(info, resource_.HandlerWithContext[any, any](handler))(ctx, req)\n\t}\n}\n\nfunc HandleMetric[REQ any, RESP any](\n\thandler resource_.HandlerWithContext[REQ, RESP],\n) resource_.HandlerWithContext[REQ, RESP] {\n\treturn handleMetric(nil, handler)\n}\n\nfunc handleMetric[REQ any, RESP any](\n\tinfo *grpc.UnaryServerInfo,\n\thandler resource_.HandlerWithContext[REQ, RESP],\n) resource_.HandlerWithContext[REQ, RESP] {\n\treturn func(ctx context.Context, req REQ) (RESP, error) {\n\n\t\ttc := time_.New(true)\n\n\t\tctx = resource_.AddKeysContext(ctx, resource_.AddAttrKeysContext, resource_.AddMetricKeysContext)\n\n\t\tresp, err := handler(ctx, req)\n\n\t\tvar method string\n\t\tif info != nil {\n\t\t\tmethod = info.FullMethod\n\t\t} else {\n\t\t\tmethod, _ = runtime.RPCMethod(ctx)\n\t\t}\n\n\t\tresource_.ReportMetric(ctx,\n\t\t\tresource_.Dimension{\n\t\t\t\tCalleeMethod: method,\n\t\t\t\tError:        err,\n\t\t\t},\n\t\t\ttc.Elapse(),\n\t\t)\n\t\ttc.Tick(method)\n\n\t\tlogger := logs_.GetLogger(ctx)\n\t\tpeerAddr, _ := grpc_.GetIPFromContext(ctx)\n\t\tsummary := func() {\n\t\t\tlogger.WithField(\"cost\", tc.String()).Infof(\n\t\t\t\t\"called by peer addr: %v\",\n\t\t\t\tpeerAddr.String(),\n\t\t\t)\n\t\t}\n\t\tdefer summary()\n\n\t\treturn resp, err\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/opentelemetry/modular_client.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptoropentelemetry\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\tnet_ \"github.com/kaydxh/golang/go/net\"\n\t\"github.com/kaydxh/golang/pkg/opentelemetry/metric/report\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/metadata\"\n)\n\n// ModularClientConfig holds configuration for the modular client interceptor\ntype ModularClientConfig struct {\n\t// AppName is the application name for this client\n\tAppName string\n\t// ServerName is the server name for this client\n\tServerName string\n\t// ServiceName is the service name for this client\n\tServiceName string\n}\n\n// UnaryClientModularInterceptor returns a unary client interceptor for modular reporting (主调上报)\nfunc UnaryClientModularInterceptor(cfg ModularClientConfig) grpc.UnaryClientInterceptor {\n\treturn func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {\n\t\tstartTime := time.Now()\n\n\t\t// Add caller info to metadata\n\t\tctx = injectCallerMetadata(ctx, cfg)\n\n\t\t// Execute call\n\t\terr := invoker(ctx, method, req, reply, cc, opts...)\n\n\t\t// Calculate cost\n\t\tcostMs := float64(time.Since(startTime).Milliseconds())\n\n\t\t// Build dimension\n\t\tdim := buildClientDimension(ctx, method, cc.Target(), err, cfg)\n\n\t\t// Report metric\n\t\treport.ReportClientMetric(ctx, dim, costMs)\n\n\t\treturn err\n\t}\n}\n\n// StreamClientModularInterceptor returns a stream client interceptor for modular reporting (主调上报)\nfunc StreamClientModularInterceptor(cfg ModularClientConfig) grpc.StreamClientInterceptor {\n\treturn func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {\n\t\tstartTime := time.Now()\n\n\t\t// Add caller info to metadata\n\t\tctx = injectCallerMetadata(ctx, cfg)\n\n\t\t// Execute call\n\t\tstream, err := streamer(ctx, desc, cc, method, opts...)\n\n\t\t// Calculate cost\n\t\tcostMs := float64(time.Since(startTime).Milliseconds())\n\n\t\t// Build dimension\n\t\tdim := buildClientDimension(ctx, method, cc.Target(), err, cfg)\n\n\t\t// Report metric\n\t\treport.ReportClientMetric(ctx, dim, costMs)\n\n\t\treturn stream, err\n\t}\n}\n\nfunc injectCallerMetadata(ctx context.Context, cfg ModularClientConfig) context.Context {\n\tmd, ok := metadata.FromOutgoingContext(ctx)\n\tif !ok {\n\t\tmd = metadata.New(nil)\n\t} else {\n\t\tmd = md.Copy()\n\t}\n\n\t// Add caller app name\n\tif cfg.AppName != \"\" {\n\t\tmd.Set(\"x-caller-app\", cfg.AppName)\n\t}\n\n\treturn metadata.NewOutgoingContext(ctx, md)\n}\n\nfunc buildClientDimension(_ context.Context, fullMethod, target string, err error, cfg ModularClientConfig) *report.ClientDimension {\n\t// Parse service and method from fullMethod\n\tservice, method := parseFullMethod(fullMethod)\n\n\t// Get local IP\n\tlocalIP := \"\"\n\tif hostIP, ipErr := net_.GetHostIP(); ipErr == nil {\n\t\tlocalIP = hostIP.String()\n\t}\n\n\treturn &report.ClientDimension{\n\t\tRetCode:    report.ErrorToRetCode(err),\n\t\tAIp:        localIP,\n\t\tAApp:       cfg.AppName,\n\t\tAServer:    cfg.ServerName,\n\t\tAService:   cfg.ServiceName,\n\t\tAInterface: method,\n\t\tPIp:        target,\n\t\tPService:   service,\n\t\tPInterface: method,\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/opentelemetry/modular_server.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptoropentelemetry\n\nimport (\n\t\"context\"\n\t\"strings\"\n\t\"time\"\n\n\tnet_ \"github.com/kaydxh/golang/go/net\"\n\tgrpc_ \"github.com/kaydxh/golang/go/net/grpc\"\n\t\"github.com/kaydxh/golang/pkg/opentelemetry/metric/report\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/metadata\"\n)\n\n// ModularServerConfig holds configuration for the modular server interceptor\ntype ModularServerConfig struct {\n\t// AppName is the application name for this service\n\tAppName string\n\t// ServerName is the server name for this service\n\tServerName string\n}\n\n// UnaryServerModularInterceptor returns a unary server interceptor for modular reporting (被调上报)\nfunc UnaryServerModularInterceptor(cfg ModularServerConfig) grpc.UnaryServerInterceptor {\n\treturn func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\t\tstartTime := time.Now()\n\n\t\t// Execute handler\n\t\tresp, err := handler(ctx, req)\n\n\t\t// Calculate cost\n\t\tcostMs := float64(time.Since(startTime).Milliseconds())\n\n\t\t// Build dimension\n\t\tdim := buildServerDimension(ctx, info.FullMethod, err, cfg)\n\n\t\t// Report metric\n\t\treport.ReportServerMetric(ctx, dim, costMs)\n\n\t\treturn resp, err\n\t}\n}\n\n// StreamServerModularInterceptor returns a stream server interceptor for modular reporting (被调上报)\nfunc StreamServerModularInterceptor(cfg ModularServerConfig) grpc.StreamServerInterceptor {\n\treturn func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\t\tstartTime := time.Now()\n\n\t\t// Execute handler\n\t\terr := handler(srv, ss)\n\n\t\t// Calculate cost\n\t\tcostMs := float64(time.Since(startTime).Milliseconds())\n\n\t\t// Build dimension\n\t\tdim := buildServerDimension(ss.Context(), info.FullMethod, err, cfg)\n\n\t\t// Report metric\n\t\treport.ReportServerMetric(ss.Context(), dim, costMs)\n\n\t\treturn err\n\t}\n}\n\nfunc buildServerDimension(ctx context.Context, fullMethod string, err error, cfg ModularServerConfig) *report.ServerDimension {\n\t// Parse service and method from fullMethod\n\t// fullMethod format: /package.Service/Method\n\tservice, method := parseFullMethod(fullMethod)\n\n\t// Get local IP\n\tlocalIP := \"\"\n\tif hostIP, ipErr := net_.GetHostIP(); ipErr == nil {\n\t\tlocalIP = hostIP.String()\n\t}\n\n\t// Get peer IP\n\tpeerIP := \"\"\n\tif peerAddr, peerErr := grpc_.GetIPFromContext(ctx); peerErr == nil {\n\t\tpeerIP = peerAddr.String()\n\t}\n\n\t// Get caller app from metadata\n\tcallerApp := \"\"\n\tif md, ok := metadata.FromIncomingContext(ctx); ok {\n\t\tif apps := md.Get(\"x-caller-app\"); len(apps) > 0 {\n\t\t\tcallerApp = apps[0]\n\t\t}\n\t}\n\n\treturn &report.ServerDimension{\n\t\tRetCode:    report.ErrorToRetCode(err),\n\t\tPIp:        localIP,\n\t\tPApp:       cfg.AppName,\n\t\tPServer:    cfg.ServerName,\n\t\tPService:   service,\n\t\tPInterface: method,\n\t\tAIp:        peerIP,\n\t\tAApp:       callerApp,\n\t}\n}\n\n// parseFullMethod parses the gRPC full method into service and method\n// fullMethod format: /package.Service/Method\nfunc parseFullMethod(fullMethod string) (service, method string) {\n\t// Remove leading slash\n\tfullMethod = strings.TrimPrefix(fullMethod, \"/\")\n\n\t// Split by last slash\n\tidx := strings.LastIndex(fullMethod, \"/\")\n\tif idx < 0 {\n\t\treturn fullMethod, \"\"\n\t}\n\n\treturn fullMethod[:idx], fullMethod[idx+1:]\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/opentelemetry/trace_client.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptoropentelemetry\n\nimport (\n\t\"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc\"\n\t\"go.opentelemetry.io/otel/trace\"\n\t\"google.golang.org/grpc\"\n)\n\n// UnaryClientTraceInterceptor returns a unary client interceptor that adds OpenTelemetry tracing\nfunc UnaryClientTraceInterceptor(opts ...otelgrpc.Option) grpc.UnaryClientInterceptor {\n\treturn otelgrpc.UnaryClientInterceptor(opts...)\n}\n\n// StreamClientTraceInterceptor returns a stream client interceptor that adds OpenTelemetry tracing\nfunc StreamClientTraceInterceptor(opts ...otelgrpc.Option) grpc.StreamClientInterceptor {\n\treturn otelgrpc.StreamClientInterceptor(opts...)\n}\n\n// UnaryClientTraceInterceptorWithTracer returns a unary client interceptor with custom tracer provider\nfunc UnaryClientTraceInterceptorWithTracer(tracerProvider trace.TracerProvider, opts ...otelgrpc.Option) grpc.UnaryClientInterceptor {\n\tdefaultOpts := []otelgrpc.Option{\n\t\totelgrpc.WithTracerProvider(tracerProvider),\n\t}\n\tdefaultOpts = append(defaultOpts, opts...)\n\treturn otelgrpc.UnaryClientInterceptor(defaultOpts...)\n}\n\n// StreamClientTraceInterceptorWithTracer returns a stream client interceptor with custom tracer provider\nfunc StreamClientTraceInterceptorWithTracer(tracerProvider trace.TracerProvider, opts ...otelgrpc.Option) grpc.StreamClientInterceptor {\n\tdefaultOpts := []otelgrpc.Option{\n\t\totelgrpc.WithTracerProvider(tracerProvider),\n\t}\n\tdefaultOpts = append(defaultOpts, opts...)\n\treturn otelgrpc.StreamClientInterceptor(defaultOpts...)\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/opentelemetry/trace_server.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptoropentelemetry\n\nimport (\n\t\"context\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc\"\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/trace\"\n\t\"google.golang.org/grpc\"\n)\n\n// UnaryServerTraceInterceptor returns a unary server interceptor that adds OpenTelemetry tracing\n// Note: Uses otel.GetTracerProvider() at request time to get the current global TracerProvider\nfunc UnaryServerTraceInterceptor(opts ...otelgrpc.Option) grpc.UnaryServerInterceptor {\n\t// Get current global TracerProvider and pass it explicitly\n\t// This ensures the interceptor uses whatever TracerProvider is set at creation time\n\ttp := otel.GetTracerProvider()\n\tlogrus.Infof(\"UnaryServerTraceInterceptor: creating trace interceptor, TracerProvider type=%T\", tp)\n\tdefaultOpts := []otelgrpc.Option{\n\t\totelgrpc.WithTracerProvider(tp),\n\t}\n\tdefaultOpts = append(defaultOpts, opts...)\n\treturn otelgrpc.UnaryServerInterceptor(defaultOpts...)\n}\n\n// StreamServerTraceInterceptor returns a stream server interceptor that adds OpenTelemetry tracing\nfunc StreamServerTraceInterceptor(opts ...otelgrpc.Option) grpc.StreamServerInterceptor {\n\ttp := otel.GetTracerProvider()\n\tlogrus.Infof(\"StreamServerTraceInterceptor: creating trace interceptor, TracerProvider type=%T\", tp)\n\tdefaultOpts := []otelgrpc.Option{\n\t\totelgrpc.WithTracerProvider(tp),\n\t}\n\tdefaultOpts = append(defaultOpts, opts...)\n\treturn otelgrpc.StreamServerInterceptor(defaultOpts...)\n}\n\n// UnaryServerTraceInterceptorWithTracer returns a unary server interceptor with custom tracer provider\nfunc UnaryServerTraceInterceptorWithTracer(tracerProvider trace.TracerProvider, opts ...otelgrpc.Option) grpc.UnaryServerInterceptor {\n\tdefaultOpts := []otelgrpc.Option{\n\t\totelgrpc.WithTracerProvider(tracerProvider),\n\t}\n\tdefaultOpts = append(defaultOpts, opts...)\n\treturn otelgrpc.UnaryServerInterceptor(defaultOpts...)\n}\n\n// StreamServerTraceInterceptorWithTracer returns a stream server interceptor with custom tracer provider\nfunc StreamServerTraceInterceptorWithTracer(tracerProvider trace.TracerProvider, opts ...otelgrpc.Option) grpc.StreamServerInterceptor {\n\tdefaultOpts := []otelgrpc.Option{\n\t\totelgrpc.WithTracerProvider(tracerProvider),\n\t}\n\tdefaultOpts = append(defaultOpts, opts...)\n\treturn otelgrpc.StreamServerInterceptor(defaultOpts...)\n}\n\n// GetSpanFromContext extracts the current span from the context\nfunc GetSpanFromContext(ctx context.Context) trace.Span {\n\treturn trace.SpanFromContext(ctx)\n}\n\n// GetTracerProvider returns the global tracer provider\nfunc GetTracerProvider() trace.TracerProvider {\n\treturn otel.GetTracerProvider()\n}\n\n// GetTracer returns a tracer with the given name\nfunc GetTracer(name string, opts ...trace.TracerOption) trace.Tracer {\n\treturn otel.Tracer(name, opts...)\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/ratelimit/ratelimit_qps_server.interceptor.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage ratelimit\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\trate_ \"github.com/kaydxh/golang/go/time/rate\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\n// QPSLimiter is the interface for QPS-based rate limiting.\ntype QPSLimiter interface {\n\tAllow(method string) bool\n\tAllowFor(method string, timeout time.Duration) bool\n\tWait(ctx context.Context, method string) error\n}\n\n// UnaryServerInterceptorQPS returns a new unary server interceptor\n// that performs QPS-based rate limiting with per-method configuration.\nfunc UnaryServerInterceptorQPS(limiter QPSLimiter) grpc.UnaryServerInterceptor {\n\treturn func(\n\t\tctx context.Context,\n\t\treq interface{},\n\t\tinfo *grpc.UnaryServerInfo,\n\t\thandler grpc.UnaryHandler,\n\t) (interface{}, error) {\n\t\tif !limiter.Allow(info.FullMethod) {\n\t\t\tlogger := logs_.GetLogger(ctx)\n\t\t\terr := status.Errorf(\n\t\t\t\tcodes.ResourceExhausted,\n\t\t\t\t\"%s is rejected by grpc_ratelimit_qps middleware, QPS limit exceeded, please retry later.\",\n\t\t\t\tinfo.FullMethod,\n\t\t\t)\n\t\t\tlogger.WithField(\"method\", info.FullMethod).Errorf(\"rate limited: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\treturn handler(ctx, req)\n\t}\n}\n\n// UnaryServerInterceptorQPSWait returns a new unary server interceptor\n// that waits for rate limit token instead of rejecting immediately.\nfunc UnaryServerInterceptorQPSWait(limiter QPSLimiter, timeout time.Duration) grpc.UnaryServerInterceptor {\n\treturn func(\n\t\tctx context.Context,\n\t\treq interface{},\n\t\tinfo *grpc.UnaryServerInfo,\n\t\thandler grpc.UnaryHandler,\n\t) (interface{}, error) {\n\t\t// Try with timeout\n\t\tif !limiter.AllowFor(info.FullMethod, timeout) {\n\t\t\tlogger := logs_.GetLogger(ctx)\n\t\t\terr := status.Errorf(\n\t\t\t\tcodes.ResourceExhausted,\n\t\t\t\t\"%s is rejected by grpc_ratelimit_qps middleware after waiting %v, QPS limit exceeded.\",\n\t\t\t\tinfo.FullMethod,\n\t\t\t\ttimeout,\n\t\t\t)\n\t\t\tlogger.WithField(\"method\", info.FullMethod).Errorf(\"rate limited: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\treturn handler(ctx, req)\n\t}\n}\n\n// StreamServerInterceptorQPS returns a new stream server interceptor\n// that performs QPS-based rate limiting with per-method configuration.\nfunc StreamServerInterceptorQPS(limiter QPSLimiter) grpc.StreamServerInterceptor {\n\treturn func(\n\t\tsrv interface{},\n\t\tstream grpc.ServerStream,\n\t\tinfo *grpc.StreamServerInfo,\n\t\thandler grpc.StreamHandler,\n\t) error {\n\t\tif !limiter.Allow(info.FullMethod) {\n\t\t\tlogger := logs_.GetLogger(stream.Context())\n\t\t\terr := status.Errorf(\n\t\t\t\tcodes.ResourceExhausted,\n\t\t\t\t\"%s is rejected by grpc_ratelimit_qps middleware, QPS limit exceeded, please retry later.\",\n\t\t\t\tinfo.FullMethod,\n\t\t\t)\n\t\t\tlogger.WithField(\"method\", info.FullMethod).Errorf(\"rate limited: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\treturn handler(srv, stream)\n\t}\n}\n\n// StreamServerInterceptorQPSWait returns a new stream server interceptor\n// that waits for rate limit token instead of rejecting immediately.\nfunc StreamServerInterceptorQPSWait(limiter QPSLimiter, timeout time.Duration) grpc.StreamServerInterceptor {\n\treturn func(\n\t\tsrv interface{},\n\t\tstream grpc.ServerStream,\n\t\tinfo *grpc.StreamServerInfo,\n\t\thandler grpc.StreamHandler,\n\t) error {\n\t\tif !limiter.AllowFor(info.FullMethod, timeout) {\n\t\t\tlogger := logs_.GetLogger(stream.Context())\n\t\t\terr := status.Errorf(\n\t\t\t\tcodes.ResourceExhausted,\n\t\t\t\t\"%s is rejected by grpc_ratelimit_qps middleware after waiting %v, QPS limit exceeded.\",\n\t\t\t\tinfo.FullMethod,\n\t\t\t\ttimeout,\n\t\t\t)\n\t\t\tlogger.WithField(\"method\", info.FullMethod).Errorf(\"rate limited: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\treturn handler(srv, stream)\n\t}\n}\n\n// NewMethodQPSLimiter creates a pre-configured method QPS limiter.\n// This is a convenience wrapper for rate_.NewMethodQPSLimiter.\nfunc NewMethodQPSLimiter(defaultQPS float64, defaultBurst int) *rate_.MethodQPSLimiter {\n\treturn rate_.NewMethodQPSLimiter(defaultQPS, defaultBurst)\n}\n\n// NewMethodQPSLimiterWithConfigs creates a limiter with method configurations.\nfunc NewMethodQPSLimiterWithConfigs(\n\tdefaultQPS float64,\n\tdefaultBurst int,\n\tconfigs []rate_.MethodQPSConfig,\n) (*rate_.MethodQPSLimiter, error) {\n\treturn rate_.NewMethodQPSLimiterWithConfigs(defaultQPS, defaultBurst, configs)\n}\n\n// ConcurrencyLimiter is the interface for concurrency-based rate limiting.\n// Unlike QPS limiting, concurrency control limits the number of requests being processed simultaneously.\n// Tokens are returned when request processing completes.\ntype ConcurrencyLimiter interface {\n\tAllow(method string) bool\n\tPut(method string)\n}\n\n// UnaryServerInterceptorConcurrency returns a new unary server interceptor\n// that performs concurrency-based rate limiting with per-method configuration.\nfunc UnaryServerInterceptorConcurrency(limiter ConcurrencyLimiter) grpc.UnaryServerInterceptor {\n\treturn func(\n\t\tctx context.Context,\n\t\treq interface{},\n\t\tinfo *grpc.UnaryServerInfo,\n\t\thandler grpc.UnaryHandler,\n\t) (interface{}, error) {\n\t\tif !limiter.Allow(info.FullMethod) {\n\t\t\tlogger := logs_.GetLogger(ctx)\n\t\t\terr := status.Errorf(\n\t\t\t\tcodes.ResourceExhausted,\n\t\t\t\t\"%s is rejected by grpc_concurrency middleware, max concurrency exceeded, please retry later.\",\n\t\t\t\tinfo.FullMethod,\n\t\t\t)\n\t\t\tlogger.WithField(\"method\", info.FullMethod).Errorf(\"concurrency limited: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer limiter.Put(info.FullMethod)\n\t\treturn handler(ctx, req)\n\t}\n}\n\n// StreamServerInterceptorConcurrency returns a new stream server interceptor\n// that performs concurrency-based rate limiting with per-method configuration.\nfunc StreamServerInterceptorConcurrency(limiter ConcurrencyLimiter) grpc.StreamServerInterceptor {\n\treturn func(\n\t\tsrv interface{},\n\t\tstream grpc.ServerStream,\n\t\tinfo *grpc.StreamServerInfo,\n\t\thandler grpc.StreamHandler,\n\t) error {\n\t\tif !limiter.Allow(info.FullMethod) {\n\t\t\tlogger := logs_.GetLogger(stream.Context())\n\t\t\terr := status.Errorf(\n\t\t\t\tcodes.ResourceExhausted,\n\t\t\t\t\"%s is rejected by grpc_concurrency middleware, max concurrency exceeded, please retry later.\",\n\t\t\t\tinfo.FullMethod,\n\t\t\t)\n\t\t\tlogger.WithField(\"method\", info.FullMethod).Errorf(\"concurrency limited: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\tdefer limiter.Put(info.FullMethod)\n\t\treturn handler(srv, stream)\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/ratelimit/ratelimit_server.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage ratelimit\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\ntype Limiter interface {\n\tAllow() bool\n\tAllowFor(timeout time.Duration) bool\n\tPut()\n}\n\n// UnaryServerInterceptor returns a new unary server interceptors that performs request rate limiting.\nfunc UnaryServerInterceptor(limiter Limiter) grpc.UnaryServerInterceptor {\n\treturn func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\t\tif !limiter.Allow() {\n\t\t\tlogger := logs_.GetLogger(ctx)\n\t\t\terr := status.Errorf(\n\t\t\t\tcodes.ResourceExhausted,\n\t\t\t\t\"%s is rejected by grpc_ratelimit middleware, please retry later.\",\n\t\t\t\tinfo.FullMethod,\n\t\t\t)\n\t\t\tlogger.Errorf(\"%#v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer limiter.Put()\n\t\treturn handler(ctx, req)\n\t}\n}\n\n// StreamServerInterceptor returns a new stream server interceptor that performs rate limiting on the request.\nfunc StreamServerInterceptor(limiter Limiter) grpc.StreamServerInterceptor {\n\treturn func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {\n\t\tif !limiter.Allow() {\n\t\t\tlogger := logs_.GetLogger(stream.Context())\n\t\t\terr := status.Errorf(\n\t\t\t\tcodes.ResourceExhausted,\n\t\t\t\t\"%s is rejected by grpc_ratelimit middleware, please retry later.\",\n\t\t\t\tinfo.FullMethod,\n\t\t\t)\n\n\t\t\tlogger.Errorf(\"%#v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\tdefer limiter.Put()\n\t\treturn handler(srv, stream)\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/timer/timer_client.interceptor.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptortimer\n\nimport (\n\t\"context\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\t\"google.golang.org/grpc\"\n)\n\nfunc UnaryClientInterceptorOfTimer() grpc.UnaryClientInterceptor {\n\n\treturn func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {\n\n\t\ttc := time_.New(true)\n\t\tlogger := logs_.GetLogger(ctx)\n\t\tsummary := func() {\n\t\t\ttc.Tick(method)\n\t\t\tlogger.WithField(\"method\", method).Infof(tc.String())\n\t\t}\n\t\tdefer summary()\n\n\t\treturn invoker(ctx, method, req, reply, cc, opts...)\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/grpc-middleware/timer/timer_server.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptortimer\n\nimport (\n\t\"context\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\n\t\"google.golang.org/grpc\"\n)\n\n//  UnaryServerInterceptorOfTimer returns a new unary server interceptors that timing request\nfunc UnaryServerInterceptorOfTimer() grpc.UnaryServerInterceptor {\n\n\treturn func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\n\t\ttc := time_.New(true)\n\t\tlogger := logs_.GetLogger(ctx)\n\t\tsummary := func() {\n\t\t\ttc.Tick(info.FullMethod)\n\t\t\tlogger.WithField(\"method\", info.FullMethod).Infof(tc.String())\n\t\t}\n\t\tdefer summary()\n\n\t\treturn handler(ctx, req)\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/cors/cors.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptorcors\n\nimport (\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// CORSConfig 跨域资源共享配置。\ntype CORSConfig struct {\n\t// AllowOrigins 允许的来源列表。\n\t// 使用 \"*\" 表示允许所有来源（不建议在生产环境中使用）。\n\t// 默认值: [\"*\"]\n\tAllowOrigins []string\n\n\t// AllowMethods 允许的 HTTP 方法列表。\n\t// 默认值: [\"GET\", \"POST\", \"PUT\", \"DELETE\", \"OPTIONS\"]\n\tAllowMethods []string\n\n\t// AllowHeaders 允许的请求头列表。\n\t// 使用 \"*\" 表示允许所有请求头。\n\t// 默认值: [\"*\"]\n\tAllowHeaders []string\n\n\t// ExposeHeaders 允许浏览器访问的响应头列表。\n\tExposeHeaders []string\n\n\t// AllowCredentials 是否允许携带凭证（cookies、HTTP认证等）。\n\t// 注意：当设置为 true 时，AllowOrigins 不能为 \"*\"。\n\tAllowCredentials bool\n\n\t// MaxAge 预检请求结果的缓存时间（秒）。\n\t// 默认值: 86400（24小时）\n\tMaxAge int\n}\n\n// DefaultCORSConfig 返回默认的 CORS 配置（允许所有来源）。\nfunc DefaultCORSConfig() CORSConfig {\n\treturn CORSConfig{\n\t\tAllowOrigins: []string{\"*\"},\n\t\tAllowMethods: []string{\"GET\", \"POST\", \"PUT\", \"DELETE\", \"OPTIONS\"},\n\t\tAllowHeaders: []string{\"*\"},\n\t\tMaxAge:       86400,\n\t}\n}\n\n// CORS 返回一个使用指定配置的 CORS 中间件。\nfunc CORS(config CORSConfig) func(http.Handler) http.Handler {\n\t// 填充默认值\n\tif len(config.AllowOrigins) == 0 {\n\t\tconfig.AllowOrigins = []string{\"*\"}\n\t}\n\tif len(config.AllowMethods) == 0 {\n\t\tconfig.AllowMethods = []string{\"GET\", \"POST\", \"PUT\", \"DELETE\", \"OPTIONS\"}\n\t}\n\tif len(config.AllowHeaders) == 0 {\n\t\tconfig.AllowHeaders = []string{\"*\"}\n\t}\n\tif config.MaxAge <= 0 {\n\t\tconfig.MaxAge = 86400\n\t}\n\n\tallowMethodsStr := strings.Join(config.AllowMethods, \", \")\n\tallowHeadersStr := strings.Join(config.AllowHeaders, \", \")\n\texposeHeadersStr := strings.Join(config.ExposeHeaders, \", \")\n\tmaxAgeStr := strconv.Itoa(config.MaxAge)\n\n\tallowAllOrigins := len(config.AllowOrigins) == 1 && config.AllowOrigins[0] == \"*\"\n\n\treturn func(next http.Handler) http.Handler {\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\torigin := r.Header.Get(\"Origin\")\n\n\t\t\t// 设置 CORS 响应头\n\t\t\tif allowAllOrigins {\n\t\t\t\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\t\t\t} else if origin != \"\" && isOriginAllowed(origin, config.AllowOrigins) {\n\t\t\t\tw.Header().Set(\"Access-Control-Allow-Origin\", origin)\n\t\t\t\tw.Header().Set(\"Vary\", \"Origin\")\n\t\t\t}\n\n\t\t\tif config.AllowCredentials {\n\t\t\t\tw.Header().Set(\"Access-Control-Allow-Credentials\", \"true\")\n\t\t\t}\n\n\t\t\tif exposeHeadersStr != \"\" {\n\t\t\t\tw.Header().Set(\"Access-Control-Expose-Headers\", exposeHeadersStr)\n\t\t\t}\n\n\t\t\t// 处理预检请求\n\t\t\tif r.Method == http.MethodOptions {\n\t\t\t\tw.Header().Set(\"Access-Control-Allow-Methods\", allowMethodsStr)\n\t\t\t\tw.Header().Set(\"Access-Control-Allow-Headers\", allowHeadersStr)\n\t\t\t\tw.Header().Set(\"Access-Control-Max-Age\", maxAgeStr)\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tnext.ServeHTTP(w, r)\n\t\t})\n\t}\n}\n\n// CORSAllowAll 返回一个允许所有来源的 CORS 中间件（使用默认配置）。\n// 适用于开发环境或内部服务。\nfunc CORSAllowAll(next http.Handler) http.Handler {\n\treturn CORS(DefaultCORSConfig())(next)\n}\n\n// isOriginAllowed 检查给定的 origin 是否在允许列表中。\nfunc isOriginAllowed(origin string, allowedOrigins []string) bool {\n\tfor _, allowed := range allowedOrigins {\n\t\tif allowed == \"*\" || allowed == origin {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/cors/cors_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptorcors\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\nfunc TestCORSAllowAll(t *testing.T) {\n\thandler := CORSAllowAll(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusOK)\n\t}))\n\n\tt.Run(\"normal request sets allow-origin header\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/api/test\", nil)\n\t\treq.Header.Set(\"Origin\", \"http://example.com\")\n\t\tw := httptest.NewRecorder()\n\n\t\thandler.ServeHTTP(w, req)\n\n\t\tif got := w.Header().Get(\"Access-Control-Allow-Origin\"); got != \"*\" {\n\t\t\tt.Errorf(\"expected Access-Control-Allow-Origin '*', got '%s'\", got)\n\t\t}\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t})\n\n\tt.Run(\"preflight request returns 204\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodOptions, \"/api/test\", nil)\n\t\treq.Header.Set(\"Origin\", \"http://example.com\")\n\t\tw := httptest.NewRecorder()\n\n\t\thandler.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusNoContent {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusNoContent, w.Code)\n\t\t}\n\t\tif got := w.Header().Get(\"Access-Control-Allow-Methods\"); got == \"\" {\n\t\t\tt.Error(\"expected Access-Control-Allow-Methods to be set\")\n\t\t}\n\t\tif got := w.Header().Get(\"Access-Control-Max-Age\"); got != \"86400\" {\n\t\t\tt.Errorf(\"expected Access-Control-Max-Age '86400', got '%s'\", got)\n\t\t}\n\t})\n}\n\nfunc TestCORSWithSpecificOrigins(t *testing.T) {\n\tconfig := CORSConfig{\n\t\tAllowOrigins:     []string{\"http://example.com\", \"http://localhost:3000\"},\n\t\tAllowMethods:     []string{\"GET\", \"POST\"},\n\t\tAllowHeaders:     []string{\"Content-Type\", \"Authorization\"},\n\t\tAllowCredentials: true,\n\t\tMaxAge:           3600,\n\t}\n\thandler := CORS(config)(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusOK)\n\t}))\n\n\tt.Run(\"allowed origin gets reflected\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/api/test\", nil)\n\t\treq.Header.Set(\"Origin\", \"http://example.com\")\n\t\tw := httptest.NewRecorder()\n\n\t\thandler.ServeHTTP(w, req)\n\n\t\tif got := w.Header().Get(\"Access-Control-Allow-Origin\"); got != \"http://example.com\" {\n\t\t\tt.Errorf(\"expected Access-Control-Allow-Origin 'http://example.com', got '%s'\", got)\n\t\t}\n\t\tif got := w.Header().Get(\"Access-Control-Allow-Credentials\"); got != \"true\" {\n\t\t\tt.Errorf(\"expected Access-Control-Allow-Credentials 'true', got '%s'\", got)\n\t\t}\n\t\tif got := w.Header().Get(\"Vary\"); got != \"Origin\" {\n\t\t\tt.Errorf(\"expected Vary 'Origin', got '%s'\", got)\n\t\t}\n\t})\n\n\tt.Run(\"disallowed origin gets no header\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/api/test\", nil)\n\t\treq.Header.Set(\"Origin\", \"http://evil.com\")\n\t\tw := httptest.NewRecorder()\n\n\t\thandler.ServeHTTP(w, req)\n\n\t\tif got := w.Header().Get(\"Access-Control-Allow-Origin\"); got != \"\" {\n\t\t\tt.Errorf(\"expected no Access-Control-Allow-Origin, got '%s'\", got)\n\t\t}\n\t})\n\n\tt.Run(\"preflight with specific methods\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodOptions, \"/api/test\", nil)\n\t\treq.Header.Set(\"Origin\", \"http://localhost:3000\")\n\t\tw := httptest.NewRecorder()\n\n\t\thandler.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusNoContent {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusNoContent, w.Code)\n\t\t}\n\t\tif got := w.Header().Get(\"Access-Control-Allow-Methods\"); got != \"GET, POST\" {\n\t\t\tt.Errorf(\"expected 'GET, POST', got '%s'\", got)\n\t\t}\n\t\tif got := w.Header().Get(\"Access-Control-Allow-Headers\"); got != \"Content-Type, Authorization\" {\n\t\t\tt.Errorf(\"expected 'Content-Type, Authorization', got '%s'\", got)\n\t\t}\n\t\tif got := w.Header().Get(\"Access-Control-Max-Age\"); got != \"3600\" {\n\t\t\tt.Errorf(\"expected '3600', got '%s'\", got)\n\t\t}\n\t})\n}\n\nfunc TestIsOriginAllowed(t *testing.T) {\n\ttests := []struct {\n\t\tname     string\n\t\torigin   string\n\t\tallowed  []string\n\t\texpected bool\n\t}{\n\t\t{\"wildcard allows all\", \"http://any.com\", []string{\"*\"}, true},\n\t\t{\"exact match\", \"http://example.com\", []string{\"http://example.com\"}, true},\n\t\t{\"no match\", \"http://evil.com\", []string{\"http://example.com\"}, false},\n\t\t{\"multiple origins match\", \"http://b.com\", []string{\"http://a.com\", \"http://b.com\"}, true},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tif got := isOriginAllowed(tt.origin, tt.allowed); got != tt.expected {\n\t\t\t\tt.Errorf(\"isOriginAllowed(%q, %v) = %v, want %v\", tt.origin, tt.allowed, got, tt.expected)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/debug/in.output_printer.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptordebug\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n)\n\nfunc InOutputPrinter(handler http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tlogger := logs_.GetLogger(r.Context())\n\t\tww := http_.NewResponseWriterWrapper(w)\n\n\t\tcalleeMethod := fmt.Sprintf(\"%v %v\", r.Method, r.URL.Path)\n\n\t\tdefer func() {\n\t\t\tlogger.WithField(\"method\", calleeMethod).WithField(\"response\", ww.String()).Info(\"send\")\n\t\t}()\n\t\tif r != nil {\n\t\t\tbuf, err := io.ReadAll(r.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\trdr := io.NopCloser(bytes.NewBuffer(buf))\n\t\t\tr.Body = rdr\n\t\t\tlogger.WithField(\"method\", calleeMethod).WithField(\"request\", string(buf)).Info(\"recv\")\n\n\t\t}\n\n\t\thandler.ServeHTTP(ww, r)\n\n\t})\n}\n\nfunc InOutputHeaderPrinter(handler http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tlogger := logs_.GetLogger(r.Context())\n\t\tlogger.WithField(\"request headers\", r.Header).Info(\"recv\")\n\n\t\tdefer func() {\n\t\t\tlogger.WithField(\"response headers\", w.Header()).Info(\"send\")\n\t\t}()\n\n\t\thandler.ServeHTTP(w, r)\n\t})\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/debug/in.output_printer_truncate.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptordebug\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n)\n\n// truncateStringForLog 按 reflect_ 包的默认阈值/前缀对单个字符串做截断，\n// 输出格式与 reflect_.TruncateBytesAndStrings 对 string 字段的输出保持一致，\n// 便于 HTTP 与 gRPC 两侧日志格式统一。\nfunc truncateStringForLog(s string) string {\n\tthreshold := reflect_.DefaultTruncateThreshold\n\tprefix := reflect_.DefaultTruncatePrefix\n\tif len(s) <= threshold {\n\t\treturn s\n\t}\n\tif prefix > 0 && prefix < len(s) {\n\t\treturn fmt.Sprintf(\"%s...(string len: %d)\", s[:prefix], len(s))\n\t}\n\treturn fmt.Sprintf(\"string len: %d\", len(s))\n}\n\n// truncateLogValue 递归遍历 JSON 反序列化后的对象，对所有超长 string 字段做截断。\n// map/slice 递归处理；string 调用 truncateStringForLog；其他类型（number/bool/null）原样返回。\nfunc truncateLogValue(v interface{}) interface{} {\n\tswitch val := v.(type) {\n\tcase string:\n\t\treturn truncateStringForLog(val)\n\tcase map[string]interface{}:\n\t\tfor k, sub := range val {\n\t\t\tval[k] = truncateLogValue(sub)\n\t\t}\n\t\treturn val\n\tcase []interface{}:\n\t\tfor i, sub := range val {\n\t\t\tval[i] = truncateLogValue(sub)\n\t\t}\n\t\treturn val\n\tdefault:\n\t\treturn v\n\t}\n}\n\n// formatBodyForLog 将原始 body 转成适合打印的字符串：\n//   - 尝试按 JSON 解析并递归截断长 string 字段；\n//   - 解析失败（非 JSON），如果 body 本身超阈值就整体按 string 截断；短则原样返回。\nfunc formatBodyForLog(buf []byte) string {\n\tif len(buf) == 0 {\n\t\treturn \"\"\n\t}\n\tvar parsed interface{}\n\tif err := json.Unmarshal(buf, &parsed); err != nil {\n\t\treturn truncateStringForLog(string(buf))\n\t}\n\ttruncated := truncateLogValue(parsed)\n\tout, err := json.Marshal(truncated)\n\tif err != nil {\n\t\treturn truncateStringForLog(string(buf))\n\t}\n\treturn string(out)\n}\n\n// InOutputPrinterWithTruncate HTTP 请求/响应日志中间件，对超长 string 字段做截断。\n//\n// 与 InOutputPrinter 的差异：\n//   - 自动识别 request/response 中的 JSON 结构；\n//   - 对 JSON 里超长的 string 字段（例如 base64 图片数据）做截断，\n//     格式为 `前 N 字节...(string len: 总长度)`，与 gRPC 侧\n//     UnaryServerInterceptorOfInOutputPrinter 的截断输出保持一致；\n//   - 非 JSON 的 body 也会按整体超长做截断，避免日志被一次性刷爆；\n//   - response 字段仅打印 body（不含 headers），status 作为独立字段输出。\n//\n// 注意：仅影响日志打印，不会修改实际转发给 handler 的 body。\nfunc InOutputPrinterWithTruncate(handler http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tlogger := logs_.GetLogger(r.Context())\n\t\tww := http_.NewResponseWriterWrapper(w)\n\n\t\tcalleeMethod := fmt.Sprintf(\"%v %v\", r.Method, r.URL.Path)\n\n\t\tdefer func() {\n\t\t\tlogger.WithField(\"method\", calleeMethod).\n\t\t\t\tWithField(\"status\", ww.StatusCode()).\n\t\t\t\tWithField(\"response\", formatBodyForLog(ww.BodyBytes())).\n\t\t\t\tInfo(\"send\")\n\t\t}()\n\n\t\tif r != nil && r.Body != nil {\n\t\t\tbuf, err := io.ReadAll(r.Body)\n\t\t\tif err == nil {\n\t\t\t\t// 把读出来的 body 再塞回去，不影响下游 handler 读取。\n\t\t\t\tr.Body = io.NopCloser(bytes.NewBuffer(buf))\n\t\t\t\tlogger.WithField(\"method\", calleeMethod).\n\t\t\t\t\tWithField(\"request\", formatBodyForLog(buf)).\n\t\t\t\t\tInfo(\"recv\")\n\t\t\t}\n\t\t}\n\n\t\thandler.ServeHTTP(ww, r)\n\t})\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/debug/recoverer.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptordebug\n\nimport (\n\t\"net/http\"\n\t\"runtime/debug\"\n\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\nfunc Recovery(handler http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tdefer func() {\n\t\t\tif r := recover(); r != nil && r != http.ErrAbortHandler {\n\n\t\t\t\tout, err := runtime_.FormatStack()\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogrus.WithError(status.Errorf(codes.Internal, \"%s\", r)).Errorf(\"%s\", debug.Stack())\n\t\t\t\t} else {\n\t\t\t\t\tlogrus.WithError(status.Errorf(codes.Internal, \"%s\", r)).Errorf(\"%s\", out)\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t\thandler.ServeHTTP(w, r)\n\t})\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/debug/request_id.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptordebug\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/google/uuid\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n)\n\n// RequestID extracts X-Request-ID from HTTP request, generates one if absent, and sets it into context.\n// Deprecated: Use RequestIDAndTraceID instead.\nfunc RequestID(handler http.Handler) http.Handler {\n\treturn RequestIDAndTraceID(handler)\n}\n\n// RequestIDAndTraceID extracts X-Request-ID and X-Traceid from HTTP request into context.\n// If X-Request-ID is absent, a new UUID is generated.\n// If X-Traceid is absent, it defaults to the same value as X-Request-ID.\nfunc RequestIDAndTraceID(handler http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\trequestID := http_.ExtractRequestIdHTTPAndContext(r)\n\t\tif requestID == \"\" {\n\t\t\trequestID = uuid.New().String()\n\t\t}\n\t\tr = http_.SetRequestIdContext(r, requestID)\n\n\t\ttraceID := http_.ExtractTraceIdHTTPAndContext(r)\n\t\tif traceID == \"\" {\n\t\t\ttraceID = requestID\n\t\t}\n\t\tr = http_.SetTraceIdContext(r, traceID)\n\n\t\thandler.ServeHTTP(w, r)\n\t})\n}\n\nfunc SetPairsContext(keys []string) func(handler http.Handler) http.Handler {\n\treturn func(handler http.Handler) http.Handler {\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tfor _, key := range keys {\n\t\t\t\tvalue := http_.ExtractHTTPAndContext(r, key)\n\t\t\t\tif value != \"\" {\n\t\t\t\t\tr = http_.SetPairContext(r, key, value)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\thandler.ServeHTTP(w, r)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/http/clean_path.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptorhttp\n\nimport (\n\t\"net/http\"\n\t\"path\"\n)\n\n// CleanPath middleware will clean out double slash mistakes from a user's request path.\n// For example, if a user requests /users//1 or //users////1 will both be treated as: /users/1\nfunc CleanPath(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\n\t\tvar routePath string\n\t\tif r.URL.RawPath != \"\" {\n\t\t\t//RawPath has some like %2F characters.\n\t\t\troutePath = r.URL.RawPath\n\t\t} else {\n\t\t\troutePath = r.URL.Path\n\t\t}\n\t\tr.URL.Path = path.Clean(routePath)\n\n\t\tnext.ServeHTTP(w, r)\n\t})\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/http/strip_prefix.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptorhttp\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// StripPrefix 返回一个 HTTP 中间件，用于去除请求路径中的指定前缀。\n//\n// 典型使用场景：在 Kubernetes Ingress / 负载均衡器配置了路径前缀路由时，\n// 后端服务需要 strip 掉该前缀才能正确匹配内部路由。\n//\n// 例如：Ingress 配置 /palm-racer 路由到后端，后端路由为 /api/xxx，\n// 请求 /palm-racer/api/xxx 经过 StripPrefix(\"/palm-racer\") 后变为 /api/xxx。\n//\n// 如果请求路径不以 prefix 开头，则不做任何修改直接传递给下一个 handler。\nfunc StripPrefix(prefix string) func(http.Handler) http.Handler {\n\t// 规范化前缀：确保不以 \"/\" 结尾\n\tprefix = strings.TrimRight(prefix, \"/\")\n\n\treturn func(next http.Handler) http.Handler {\n\t\t// 空前缀或仅为 \"/\" 时，不做任何处理\n\t\tif prefix == \"\" || prefix == \"/\" {\n\t\t\treturn next\n\t\t}\n\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tp := r.URL.Path\n\t\t\tif p == prefix || strings.HasPrefix(p, prefix+\"/\") {\n\t\t\t\tnewPath := strings.TrimPrefix(p, prefix)\n\t\t\t\tif newPath == \"\" {\n\t\t\t\t\tnewPath = \"/\"\n\t\t\t\t}\n\t\t\t\tr.URL.Path = newPath\n\n\t\t\t\tif r.URL.RawPath != \"\" {\n\t\t\t\t\tr.URL.RawPath = strings.TrimPrefix(r.URL.RawPath, prefix)\n\t\t\t\t\tif r.URL.RawPath == \"\" {\n\t\t\t\t\t\tr.URL.RawPath = \"/\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnext.ServeHTTP(w, r)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/http/strip_prefix_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptorhttp\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\nfunc TestStripPrefix(t *testing.T) {\n\ttests := []struct {\n\t\tname         string\n\t\tprefix       string\n\t\trequestPath  string\n\t\texpectedPath string\n\t}{\n\t\t{\n\t\t\tname:         \"strip prefix from path\",\n\t\t\tprefix:       \"/palm-racer\",\n\t\t\trequestPath:  \"/palm-racer/api/v1/users\",\n\t\t\texpectedPath: \"/api/v1/users\",\n\t\t},\n\t\t{\n\t\t\tname:         \"strip prefix exact match becomes root\",\n\t\t\tprefix:       \"/palm-racer\",\n\t\t\trequestPath:  \"/palm-racer\",\n\t\t\texpectedPath: \"/\",\n\t\t},\n\t\t{\n\t\t\tname:         \"strip prefix with trailing slash\",\n\t\t\tprefix:       \"/palm-racer\",\n\t\t\trequestPath:  \"/palm-racer/\",\n\t\t\texpectedPath: \"/\",\n\t\t},\n\t\t{\n\t\t\tname:         \"no match leaves path unchanged\",\n\t\t\tprefix:       \"/palm-racer\",\n\t\t\trequestPath:  \"/other/api/v1\",\n\t\t\texpectedPath: \"/other/api/v1\",\n\t\t},\n\t\t{\n\t\t\tname:         \"partial match not stripped\",\n\t\t\tprefix:       \"/palm\",\n\t\t\trequestPath:  \"/palm-racer/api\",\n\t\t\texpectedPath: \"/palm-racer/api\",\n\t\t},\n\t\t{\n\t\t\tname:         \"empty prefix does nothing\",\n\t\t\tprefix:       \"\",\n\t\t\trequestPath:  \"/api/v1/users\",\n\t\t\texpectedPath: \"/api/v1/users\",\n\t\t},\n\t\t{\n\t\t\tname:         \"root prefix does nothing\",\n\t\t\tprefix:       \"/\",\n\t\t\trequestPath:  \"/api/v1/users\",\n\t\t\texpectedPath: \"/api/v1/users\",\n\t\t},\n\t\t{\n\t\t\tname:         \"prefix with trailing slash normalized\",\n\t\t\tprefix:       \"/palm-racer/\",\n\t\t\trequestPath:  \"/palm-racer/api/v1\",\n\t\t\texpectedPath: \"/api/v1\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tvar gotPath string\n\t\t\thandler := StripPrefix(tt.prefix)(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tgotPath = r.URL.Path\n\t\t\t\tw.WriteHeader(http.StatusOK)\n\t\t\t}))\n\n\t\t\treq := httptest.NewRequest(http.MethodGet, tt.requestPath, nil)\n\t\t\tw := httptest.NewRecorder()\n\n\t\t\thandler.ServeHTTP(w, req)\n\n\t\t\tif gotPath != tt.expectedPath {\n\t\t\t\tt.Errorf(\"StripPrefix(%q): path %q -> got %q, want %q\",\n\t\t\t\t\ttt.prefix, tt.requestPath, gotPath, tt.expectedPath)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestStripPrefixRawPath(t *testing.T) {\n\thandler := StripPrefix(\"/app\")(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tif r.URL.Path != \"/api/v1\" {\n\t\t\tt.Errorf(\"expected Path '/api/v1', got '%s'\", r.URL.Path)\n\t\t}\n\t\tif r.URL.RawPath != \"/api/v1\" {\n\t\t\tt.Errorf(\"expected RawPath '/api/v1', got '%s'\", r.URL.RawPath)\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t}))\n\n\treq := httptest.NewRequest(http.MethodGet, \"/app/api/v1\", nil)\n\treq.URL.RawPath = \"/app/api/v1\"\n\tw := httptest.NewRecorder()\n\n\thandler.ServeHTTP(w, req)\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/http/timeout.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptorhttp\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n)\n\n// DefaultTimeoutHandler is a convenient timeout handler which\n// simply returns \"504 Service timeout\".\nvar DefaultTimeoutHandler = http.HandlerFunc(\n\tfunc(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusGatewayTimeout)\n\t\tw.Write([]byte(\"Service timeout\"))\n\t})\n\ntype timeoutWriter struct {\n\tw http.ResponseWriter\n\n\tstatus int\n\tbuf    *bytes.Buffer\n}\n\nfunc (tw timeoutWriter) Header() http.Header {\n\treturn tw.w.Header()\n}\n\nfunc (tw *timeoutWriter) WriteHeader(status int) {\n\ttw.status = status\n}\n\nfunc (tw *timeoutWriter) Write(b []byte) (int, error) {\n\tif tw.status == 0 {\n\t\ttw.status = http.StatusOK\n\t}\n\n\treturn tw.buf.Write(b)\n}\n\nfunc (tw *timeoutWriter) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\thttp.Error(w, http.StatusText(http.StatusInternalServerError),\n\t\thttp.StatusInternalServerError)\n}\n\n// Timeout is a middleware that cancels ctx after a given timeout and return\n// a 504 Gateway Timeout error to the client.\nfunc Timeout(timeout time.Duration) func(next http.Handler) http.Handler {\n\treturn func(next http.Handler) http.Handler {\n\t\tfn := func(w http.ResponseWriter, r *http.Request) {\n\n\t\t\tlogger := logs_.GetLogger(r.Context())\n\t\t\tbackground := r.Context()\n\t\t\ttCtx, tCancel := context.WithTimeout(background, timeout)\n\t\t\tcCtx, cCancel := context.WithCancel(background)\n\t\t\tr = r.WithContext(cCtx)\n\t\t\tdefer tCancel()\n\n\t\t\ttw := &timeoutWriter{w: w, buf: bytes.NewBuffer(nil)}\n\t\t\tgo func() {\n\t\t\t\t//next.ServeHTTP(tw, r)\n\t\t\t\tnext.ServeHTTP(w, r)\n\t\t\t\tcCancel()\n\t\t\t}()\n\n\t\t\tselect {\n\t\t\tcase <-cCtx.Done():\n\t\t\t\tfmt.Printf(\"----normal\\n\")\n\t\t\tcase <-tCtx.Done():\n\t\t\t\tif err := tCtx.Err(); err == context.DeadlineExceeded {\n\t\t\t\t\tlogger.WithField(\"method\", fmt.Sprintf(\"%s %s\", r.Method, r.URL.Path)).Errorf(\"server %v timeout\", timeout)\n\t\t\t\t\tcCancel()\n\t\t\t\t\t//\t\tDefaultTimeoutHandler.ServeHTTP(w, r)\n\t\t\t\t\ttw.ServeHTTP(w, r)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn http.HandlerFunc(fn)\n\t}\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/opentelemetry/metric.interceptor.go",
    "content": "package interceptoropentelemetry\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\tresource_ \"github.com/kaydxh/golang/pkg/middleware/resource\"\n)\n\n// responseWriter wraps http.ResponseWriter to capture status code\ntype responseWriter struct {\n\thttp.ResponseWriter\n\tstatusCode int\n}\n\nfunc newResponseWriter(w http.ResponseWriter) *responseWriter {\n\treturn &responseWriter{\n\t\tResponseWriter: w,\n\t\tstatusCode:     http.StatusOK, // default status code\n\t}\n}\n\nfunc (rw *responseWriter) WriteHeader(code int) {\n\trw.statusCode = code\n\trw.ResponseWriter.WriteHeader(code)\n}\n\nfunc (rw *responseWriter) Status() int {\n\treturn rw.statusCode\n}\n\nfunc Metric(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\n\t\ttc := time_.New(true)\n\n\t\t// Wrap ResponseWriter to capture status code\n\t\twrapped := newResponseWriter(w)\n\t\tnext.ServeHTTP(wrapped, r)\n\n\t\tctx := r.Context()\n\t\tcalleeMethod := fmt.Sprintf(\"%v %v\", r.Method, r.URL.Path)\n\n\t\t// Convert HTTP status code to error for metric reporting\n\t\t// Only 2xx status codes are considered successful\n\t\tvar err error\n\t\tstatusCode := wrapped.Status()\n\t\tif statusCode < 200 || statusCode >= 300 {\n\t\t\terr = errors_.Errorf(statusCode, http.StatusText(statusCode))\n\t\t}\n\n\t\tresource_.ReportMetric(ctx,\n\t\t\tresource_.Dimension{\n\t\t\t\tCalleeMethod: calleeMethod,\n\t\t\t\tError:        err,\n\t\t\t},\n\t\t\ttc.Elapse(),\n\t\t)\n\t\ttc.Tick(calleeMethod)\n\n\t\tlogger := logs_.GetLogger(ctx)\n\t\tpeerAddr, _ := http_.GetIPFromRequest(r)\n\t\tsummary := func() {\n\t\t\tlogger.WithField(\"cost\", tc.String()).WithField(\"status\", statusCode).Infof(\n\t\t\t\t\"called by peer addr: %v\",\n\t\t\t\tpeerAddr.String(),\n\t\t\t)\n\t\t}\n\t\tdefer summary()\n\t})\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/opentelemetry/trace.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptoropentelemetry\n\nimport (\n\t\"net/http\"\n\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/propagation\"\n\tsemconv \"go.opentelemetry.io/otel/semconv/v1.26.0\"\n\t\"go.opentelemetry.io/otel/trace\"\n)\n\nconst tracerName = \"github.com/kaydxh/golang/pkg/middleware/http-middleware/opentelemetry\"\n\n// Trace is an HTTP middleware that creates spans for incoming HTTP requests\nfunc Trace(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tctx := r.Context()\n\n\t\t// Extract trace context from incoming request headers\n\t\tpropagator := otel.GetTextMapPropagator()\n\t\tctx = propagator.Extract(ctx, propagation.HeaderCarrier(r.Header))\n\n\t\t// Get tracer from global TracerProvider\n\t\ttracer := otel.Tracer(tracerName)\n\n\t\t// Create span name from HTTP method and path\n\t\tspanName := r.Method + \" \" + r.URL.Path\n\n\t\t// Start a new span\n\t\tctx, span := tracer.Start(ctx, spanName,\n\t\t\ttrace.WithSpanKind(trace.SpanKindServer),\n\t\t\ttrace.WithAttributes(\n\t\t\t\tsemconv.HTTPRequestMethodKey.String(r.Method),\n\t\t\t\tsemconv.URLPath(r.URL.Path),\n\t\t\t\tsemconv.URLScheme(r.URL.Scheme),\n\t\t\t\tsemconv.ServerAddress(r.Host),\n\t\t\t\tsemconv.UserAgentOriginal(r.UserAgent()),\n\t\t\t\tsemconv.ClientAddress(r.RemoteAddr),\n\t\t\t),\n\t\t)\n\t\tdefer span.End()\n\n\t\t// Wrap response writer to capture status code (reuse from metric.interceptor.go)\n\t\trw := newResponseWriter(w)\n\n\t\t// Update request with new context\n\t\tr = r.WithContext(ctx)\n\n\t\t// Call next handler\n\t\tnext.ServeHTTP(rw, r)\n\n\t\t// Set response attributes\n\t\tspan.SetAttributes(\n\t\t\tsemconv.HTTPResponseStatusCode(rw.statusCode),\n\t\t)\n\n\t\t// Mark span as error if status code >= 400\n\t\tif rw.statusCode >= 400 {\n\t\t\tspan.SetAttributes(attribute.Bool(\"error\", true))\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/ratelimiter/ratelimiter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage ratelimit\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n\n\trate_ \"github.com/kaydxh/golang/go/time/rate\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\ntype Limiter interface {\n\tAllow() bool\n\tAllowFor(timeout time.Duration) bool\n\tPut()\n}\n\ntype RateLimiter struct {\n\tLimiter\n}\n\n/*\nfunc LimitAll(burst int) http.Handler {\n\tlimiter := rate_.NewLimiter(burst)\n\trl := &RateLimiter{\n\t\tLimiter: limiter,\n\t}\n\th := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {})\n\treturn rl.Handler(h)\n}\n*/\n\nfunc LimitAll(burst int) *RateLimiter {\n\tlimiter := rate_.NewLimiter(burst)\n\trl := &RateLimiter{\n\t\tLimiter: limiter,\n\t}\n\t//h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {})\n\treturn rl\n}\n\nfunc (l *RateLimiter) Handler(handler http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tif !l.Allow() {\n\t\t\tlogger := logs_.GetLogger(r.Context())\n\t\t\terr := status.Errorf(\n\t\t\t\tcodes.ResourceExhausted,\n\t\t\t\t\"%s is rejected by http_ratelimit middleware, please retry later.\",\n\t\t\t\tfmt.Sprintf(\"%s %s\", r.Method, r.URL.Path),\n\t\t\t)\n\t\t\tlogger.Errorf(\"%v\", err.Error())\n\t\t\treturn\n\t\t}\n\t\tdefer l.Put()\n\n\t\thandler.ServeHTTP(w, r)\n\t})\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/ratelimiter/ratelimiter_qps.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage ratelimit\n\nimport (\n  \"encoding/json\"\n  \"fmt\"\n  \"net/http\"\n  \"time\"\n\n  rate_ \"github.com/kaydxh/golang/go/time/rate\"\n  logs_ \"github.com/kaydxh/golang/pkg/logs\"\n)\n\n// QPSRateLimiter provides QPS-based rate limiting for HTTP handlers.\n// It supports different QPS limits for different URL paths.\ntype QPSRateLimiter struct {\n  limiter *rate_.MethodQPSLimiter\n}\n\n// NewQPSRateLimiter creates a new QPS-based rate limiter.\n// defaultQPS: default queries per second for paths without specific config\n// defaultBurst: default burst size for paths without specific config\nfunc NewQPSRateLimiter(defaultQPS float64, defaultBurst int) *QPSRateLimiter {\n  return &QPSRateLimiter{\n    limiter: rate_.NewMethodQPSLimiter(defaultQPS, defaultBurst),\n  }\n}\n\n// NewQPSRateLimiterWithConfigs creates a QPS limiter with predefined path configurations.\nfunc NewQPSRateLimiterWithConfigs(\n  defaultQPS float64,\n  defaultBurst int,\n  configs []rate_.MethodQPSConfig,\n) (*QPSRateLimiter, error) {\n  limiter, err := rate_.NewMethodQPSLimiterWithConfigs(defaultQPS, defaultBurst, configs)\n  if err != nil {\n    return nil, err\n  }\n  return &QPSRateLimiter{limiter: limiter}, nil\n}\n\n// AddPath adds a QPS limit for a specific URL path.\nfunc (l *QPSRateLimiter) AddPath(path string, qps float64, burst int) error {\n  return l.limiter.AddMethod(path, qps, burst)\n}\n\n// SetPathQPS dynamically updates the QPS for a specific path.\nfunc (l *QPSRateLimiter) SetPathQPS(path string, qps float64, burst int) error {\n  return l.limiter.SetMethodQPS(path, qps, burst)\n}\n\n// RemovePath removes the QPS limit for a specific path.\nfunc (l *QPSRateLimiter) RemovePath(path string) {\n  l.limiter.RemoveMethod(path)\n}\n\n// Handler returns an HTTP middleware that applies QPS rate limiting.\n// The rate limit is based on the request URL path.\nfunc (l *QPSRateLimiter) Handler(next http.Handler) http.Handler {\n  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n    path := r.URL.Path\n\n    if !l.limiter.Allow(path) {\n      logger := logs_.GetLogger(r.Context())\n      logger.WithField(\"path\", path).\n        WithField(\"method\", r.Method).\n        Warn(\"request rejected by QPS rate limiter\")\n\n      w.Header().Set(\"Content-Type\", \"application/json\")\n      w.Header().Set(\"Retry-After\", \"1\") // Suggest retry after 1 second\n      w.WriteHeader(http.StatusTooManyRequests)\n\n      resp := map[string]interface{}{\n        \"error\":   \"rate_limit_exceeded\",\n        \"message\": fmt.Sprintf(\"%s %s is rejected by http_ratelimit_qps middleware, QPS limit exceeded\", r.Method, path),\n        \"code\":    http.StatusTooManyRequests,\n      }\n      json.NewEncoder(w).Encode(resp)\n      return\n    }\n\n    next.ServeHTTP(w, r)\n  })\n}\n\n// HandlerFunc returns an HTTP middleware function.\nfunc (l *QPSRateLimiter) HandlerFunc(next http.HandlerFunc) http.HandlerFunc {\n  return l.Handler(next).ServeHTTP\n}\n\n// HandlerWait returns an HTTP middleware that waits for rate limit token\n// instead of rejecting immediately.\nfunc (l *QPSRateLimiter) HandlerWait(next http.Handler, timeout time.Duration) http.Handler {\n  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n    path := r.URL.Path\n\n    if !l.limiter.AllowFor(path, timeout) {\n      logger := logs_.GetLogger(r.Context())\n      logger.WithField(\"path\", path).\n        WithField(\"method\", r.Method).\n        WithField(\"timeout\", timeout).\n        Warn(\"request rejected by QPS rate limiter after waiting\")\n\n      w.Header().Set(\"Content-Type\", \"application/json\")\n      w.Header().Set(\"Retry-After\", \"1\")\n      w.WriteHeader(http.StatusTooManyRequests)\n\n      resp := map[string]interface{}{\n        \"error\":   \"rate_limit_exceeded\",\n        \"message\": fmt.Sprintf(\"%s %s is rejected after waiting %v, QPS limit exceeded\", r.Method, path, timeout),\n        \"code\":    http.StatusTooManyRequests,\n      }\n      json.NewEncoder(w).Encode(resp)\n      return\n    }\n\n    next.ServeHTTP(w, r)\n  })\n}\n\n// Stats returns the QPS statistics for all configured paths.\nfunc (l *QPSRateLimiter) Stats() []rate_.MethodQPSStats {\n  return l.limiter.Stats()\n}\n\n// StatsHandler returns an HTTP handler that exposes rate limit stats.\nfunc (l *QPSRateLimiter) StatsHandler() http.Handler {\n  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n    w.Header().Set(\"Content-Type\", \"application/json\")\n    stats := l.limiter.Stats()\n    json.NewEncoder(w).Encode(map[string]interface{}{\n      \"rate_limits\": stats,\n    })\n  })\n}\n\n// LimitAllQPS creates a simple QPS limiter that applies the same limit to all paths.\n// This is a convenience function for simple use cases.\nfunc LimitAllQPS(qps float64, burst int) *QPSRateLimiter {\n  return NewQPSRateLimiter(qps, burst)\n}\n\n// ConcurrencyLimiter provides concurrency-based rate limiting for HTTP handlers.\n// Unlike QPS limiting, concurrency control limits the number of requests being processed simultaneously.\n// Tokens are returned when request processing completes.\ntype ConcurrencyLimiter struct {\n  limiter *rate_.MethodLimiter\n}\n\n// NewConcurrencyLimiter creates a new concurrency-based rate limiter.\n// defaultConcurrency: default max concurrency for paths without specific config, 0 means unlimited\nfunc NewConcurrencyLimiter(defaultConcurrency int) *ConcurrencyLimiter {\n  return &ConcurrencyLimiter{\n    limiter: rate_.NewMethodLimiter(defaultConcurrency),\n  }\n}\n\n// SetPathConcurrency sets the max concurrency for a specific path.\nfunc (l *ConcurrencyLimiter) SetPathConcurrency(path string, maxConcurrency int) error {\n  return l.limiter.AddLimiter(path, rate_.NewLimiter(maxConcurrency))\n}\n\n// Handler returns an HTTP middleware that applies concurrency rate limiting.\n// The rate limit is based on the request URL path.\nfunc (l *ConcurrencyLimiter) Handler(next http.Handler) http.Handler {\n  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n    path := r.URL.Path\n\n    if !l.limiter.Allow(path) {\n      logger := logs_.GetLogger(r.Context())\n      logger.WithField(\"path\", path).\n        WithField(\"method\", r.Method).\n        Warn(\"request rejected by concurrency limiter\")\n\n      w.Header().Set(\"Content-Type\", \"application/json\")\n      w.Header().Set(\"Retry-After\", \"1\")\n      w.WriteHeader(http.StatusTooManyRequests)\n\n      resp := map[string]interface{}{\n        \"error\":   \"concurrency_limit_exceeded\",\n        \"message\": fmt.Sprintf(\"%s %s is rejected by http_concurrency middleware, max concurrency exceeded\", r.Method, path),\n        \"code\":    http.StatusTooManyRequests,\n      }\n      json.NewEncoder(w).Encode(resp)\n      return\n    }\n    defer l.limiter.Put(path)\n\n    next.ServeHTTP(w, r)\n  })\n}\n\n// HandlerFunc returns an HTTP middleware function.\nfunc (l *ConcurrencyLimiter) HandlerFunc(next http.HandlerFunc) http.HandlerFunc {\n  return l.Handler(next).ServeHTTP\n}\n"
  },
  {
    "path": "pkg/middleware/http-middleware/timer/timer_server.interceptor.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage interceptortimer\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n)\n\nfunc ServerInterceptorOfTimer(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\n\t\ttc := time_.New(true)\n\t\tnext.ServeHTTP(w, r)\n\n\t\tctx := r.Context()\n\t\tcalleeMethod := fmt.Sprintf(\"%v %v\", r.Method, r.URL.Path)\n\n\t\ttc.Tick(calleeMethod)\n\n\t\tlogger := logs_.GetLogger(ctx)\n\t\tsummary := func() {\n\t\t\tlogger.WithField(\"method\", calleeMethod).Infof(\"http cost %v\", tc.String())\n\t\t}\n\t\tdefer summary()\n\t})\n\n}\n"
  },
  {
    "path": "pkg/middleware/local.middleware.wrap.go",
    "content": "package middleware\n\nimport (\n\t\"context\"\n\n\tinterceptordebug_ \"github.com/kaydxh/golang/pkg/middleware/grpc-middleware/debug\"\n\tinterceptoropentelemetry_ \"github.com/kaydxh/golang/pkg/middleware/grpc-middleware/opentelemetry\"\n)\n\n// the function need to called by controller\nfunc LocalMiddlewareWrap[REQ any, RESP any](handler func(ctx context.Context, req REQ) (RESP, error)) func(ctx context.Context, req REQ) (RESP, error) {\n\treturn interceptordebug_.HandleReuestId(\n\t\tinterceptordebug_.HandleInOutputPrinter(\n\t\t\tnil,\n\t\t\tinterceptoropentelemetry_.HandleMetric(\n\t\t\t\thandler,\n\t\t\t)))\n}\n\n// the function need to called by controller, without inout printer\nfunc LocalTinyMiddlewareWrap[REQ any, RESP any](handler func(ctx context.Context, req REQ) (RESP, error)) func(ctx context.Context, req REQ) (RESP, error) {\n\treturn interceptordebug_.HandleReuestId(\n\t\tinterceptoropentelemetry_.HandleMetric(\n\t\t\thandler,\n\t\t))\n}\n"
  },
  {
    "path": "pkg/middleware/resource/middleware.handler.go",
    "content": "package resource\n\nimport \"context\"\n\ntype HandlerWithContext[REQ any, RESP any] func(context.Context, REQ) (RESP, error)\n"
  },
  {
    "path": "pkg/middleware/resource/monitor.metrics.go",
    "content": "package resource\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"time\"\n\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/metric\"\n)\n\nconst (\n\tinstrumentationName    = \"github/kaydxh/golang/pkg/middleware/resource\"\n\tinstrumentationVersion = \"v0.0.1\"\n)\n\nvar (\n\t// metricGroup is the scope name for meter, can be overridden by SetMetricGroup\n\t// For ZhiYan, common values: \"server_report\", \"client_report\", \"default\"\n\tmetricGroup   = instrumentationName\n\tmetricGroupMu sync.RWMutex\n\n\tmeter     metric.Meter\n\tmeterOnce sync.Once\n)\n\n// SetMetricGroup sets the metric group (scope name) for meter\n// Should be called before any metrics are created\n// For ZhiYan, use \"server_report\" or \"client_report\"\nfunc SetMetricGroup(group string) {\n\tmetricGroupMu.Lock()\n\tdefer metricGroupMu.Unlock()\n\tif group != \"\" {\n\t\tmetricGroup = group\n\t}\n}\n\n// GetMetricGroup returns the current metric group\nfunc GetMetricGroup() string {\n\tmetricGroupMu.RLock()\n\tdefer metricGroupMu.RUnlock()\n\treturn metricGroup\n}\n\nfunc getMeter() metric.Meter {\n\tmeterOnce.Do(func() {\n\t\tmetricGroupMu.RLock()\n\t\tgroup := metricGroup\n\t\tmetricGroupMu.RUnlock()\n\t\tmeter = otel.GetMeterProvider().Meter(\n\t\t\tgroup,\n\t\t\tmetric.WithInstrumentationVersion(instrumentationVersion),\n\t\t)\n\t})\n\treturn meter\n}\n\ntype MetricMonitor struct {\n\tTotalReqCounter   metric.Int64Counter\n\tFailCntCounter    metric.Int64Counter\n\tCostTimeHistogram metric.Float64Histogram\n\n\tBusinessCounters   map[string]metric.Int64Counter\n\tbusinessCountersMu sync.RWMutex\n\n\tBusinessHistogram   map[string]metric.Float64Histogram\n\tbusinessHistogramMu sync.RWMutex\n}\n\nvar (\n\tDefaultMetricMonitor *MetricMonitor\n\tdefaultMonitorOnce   sync.Once\n)\n\nfunc GetDefaultMetricMonitor() *MetricMonitor {\n\tdefaultMonitorOnce.Do(func() {\n\t\tDefaultMetricMonitor = NewMetricMonitor()\n\t})\n\treturn DefaultMetricMonitor\n}\n\nfunc GlobalMeter() metric.Meter {\n\treturn getMeter()\n}\n\nfunc NewMetricMonitor() *MetricMonitor {\n\tvar err error\n\tm := &MetricMonitor{\n\t\tBusinessCounters:  make(map[string]metric.Int64Counter, 0),\n\t\tBusinessHistogram: make(map[string]metric.Float64Histogram, 0),\n\t}\n\tcall := func(f func()) {\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tf()\n\t}\n\tcall(func() {\n\t\tm.TotalReqCounter, err = getMeter().Int64Counter(\"total_req\")\n\t})\n\tcall(func() {\n\t\tm.FailCntCounter, err = getMeter().Int64Counter(\"fail_cnt\")\n\t})\n\tcall(func() {\n\t\tm.CostTimeHistogram, err = getMeter().Float64Histogram(\"cost_time\")\n\t})\n\tif err != nil {\n\t\totel.Handle(err)\n\t}\n\n\treturn m\n}\n\nfunc (m *MetricMonitor) GetOrNewBusinessCounter(key string) (metric.Int64Counter, error) {\n\tm.businessCountersMu.Lock()\n\tdefer m.businessCountersMu.Unlock()\n\tcounter, ok := m.BusinessCounters[key]\n\tif ok {\n\t\treturn counter, nil\n\t}\n\n\tcounter, err := getMeter().Int64Counter(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tm.BusinessCounters[key] = counter\n\treturn counter, nil\n}\n\nfunc (m *MetricMonitor) GetOrNewBusinessHistogram(key string) (metric.Float64Histogram, error) {\n\tm.businessHistogramMu.Lock()\n\tdefer m.businessHistogramMu.Unlock()\n\thistogram, ok := m.BusinessHistogram[key]\n\tif ok {\n\t\treturn histogram, nil\n\t}\n\n\thistogram, err := getMeter().Float64Histogram(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tm.BusinessHistogram[key] = histogram\n\treturn histogram, nil\n}\n\nfunc ReportMetric(ctx context.Context, dim Dimension, costTime time.Duration) {\n\tattrs := ExtractAttrsWithContext(ctx)\n\tattrs = append(attrs, Attrs(dim)...)\n\n\t// Use GetDefaultMetricMonitor() to ensure lazy initialization\n\tmonitor := GetDefaultMetricMonitor()\n\tmonitor.TotalReqCounter.Add(ctx, 1, metric.WithAttributes(attrs...))\n\tif dim.Error != nil {\n\t\tmonitor.FailCntCounter.Add(ctx, 1, metric.WithAttributes(attrs...))\n\t}\n\tmonitor.CostTimeHistogram.Record(ctx, float64(costTime.Milliseconds()), metric.WithAttributes(attrs...))\n\tReportBusinessMetric(ctx, attrs)\n}\n"
  },
  {
    "path": "pkg/middleware/resource/monitor.resource.go",
    "content": "package resource\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\tnet_ \"github.com/kaydxh/golang/go/net\"\n\tapp_ \"github.com/kaydxh/golang/pkg/webserver/app\"\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/metric\"\n)\n\n// dims\nvar (\n\tCallerMethodKey = attribute.Key(\"caller_method\") // caller method\n\tCalleeMethodKey = attribute.Key(\"callee_method\") // callee method\n\tPodIpKey        = attribute.Key(\"pod_ip\")        // pod ip\n\tServerNameKey   = attribute.Key(\"server_name\")   // server name\n\tErrorCodeKey    = attribute.Key(\"error_code\")    // error code\n)\n\nvar OpentelemetryDimsKey = \"opentelemetry_dims_key\"\nvar OpentelemetryMetricsKey = \"opentelemetry_metrics_key\"\n\ntype Dimension struct {\n\tCalleeMethod string\n\tError        error\n}\n\ntype AddKeyContexFunc func(ctx context.Context) context.Context\n\nfunc AddKeysContext(ctx context.Context, ops ...AddKeyContexFunc) context.Context {\n\tfor _, op := range ops {\n\t\tctx = op(ctx)\n\t}\n\treturn ctx\n}\n\nfunc AddAttrKeysContext(ctx context.Context) context.Context {\n\treturn context.WithValue(ctx, OpentelemetryDimsKey, map[string]interface{}{})\n}\n\nfunc UpdateAttrsContext(ctx context.Context, values map[string]interface{}) error {\n\treturn context_.UpdateContext(ctx, OpentelemetryDimsKey, values)\n}\n\nfunc AddMetricKeysContext(ctx context.Context) context.Context {\n\treturn context.WithValue(ctx, OpentelemetryMetricsKey, map[string]interface{}{})\n}\n\nfunc UpdateMetricContext(ctx context.Context, values map[string]interface{}) error {\n\treturn context_.UpdateContext(ctx, OpentelemetryMetricsKey, values)\n}\n\nfunc AppendAttrsContext(ctx context.Context, values ...string) context.Context {\n\treturn context_.AppendContext(ctx, OpentelemetryDimsKey, values...)\n}\n\nfunc AppendMetricCountContext(ctx context.Context, values ...string) context.Context {\n\treturn context_.AppendContext(ctx, OpentelemetryMetricsKey, values...)\n}\n\nfunc ExtractAttrsWithContext(ctx context.Context) []attribute.KeyValue {\n\tvar attrs []attribute.KeyValue\n\n\tvalues, ok := ctx.Value(OpentelemetryDimsKey).(map[string]interface{})\n\tif !ok {\n\t\treturn nil\n\t}\n\tfor key, value := range values {\n\t\tvar dimKey = attribute.Key(key)\n\t\tswitch value := value.(type) {\n\t\tcase string:\n\t\t\tattrs = append(attrs, dimKey.String(value))\n\n\t\tcase int:\n\t\t\tattrs = append(attrs, dimKey.Int(value))\n\t\tcase int32:\n\t\t\tattrs = append(attrs, dimKey.Int(int(value)))\n\t\tcase int64:\n\t\t\tattrs = append(attrs, dimKey.Int64(int64(value)))\n\n\t\tcase uint:\n\t\t\tattrs = append(attrs, dimKey.Int(int(value)))\n\t\tcase uint32:\n\t\t\tattrs = append(attrs, dimKey.Int(int(value)))\n\t\tcase uint64:\n\t\t\tattrs = append(attrs, dimKey.Int64(int64(value)))\n\n\t\tcase float32:\n\t\t\tattrs = append(attrs, dimKey.Float64(float64(value)))\n\t\tcase float64:\n\t\t\tattrs = append(attrs, dimKey.Float64(value))\n\n\t\tcase bool:\n\t\t\tattrs = append(attrs, dimKey.Bool(value))\n\t\t}\n\t}\n\n\treturn attrs\n}\n\nfunc ReportBusinessMetric(ctx context.Context, attrs []attribute.KeyValue) {\n\tvalues, ok := ctx.Value(OpentelemetryMetricsKey).(map[string]interface{})\n\tif !ok {\n\t\treturn\n\t}\n\n\t// Use GetDefaultMetricMonitor() to ensure lazy initialization\n\tmonitor := GetDefaultMetricMonitor()\n\n\tfor key, value := range values {\n\n\t\tvar (\n\t\t\tn           int64\n\t\t\tf           float64\n\t\t\tcounterType bool\n\t\t)\n\t\tswitch value := value.(type) {\n\t\tcase int:\n\t\t\tn = int64(value)\n\t\t\tcounterType = true\n\n\t\tcase int32:\n\t\t\tn = int64(value)\n\t\t\tcounterType = true\n\t\tcase int64:\n\t\t\tn = int64(value)\n\t\t\tcounterType = true\n\n\t\tcase uint:\n\t\t\tn = int64(value)\n\t\t\tcounterType = true\n\t\tcase uint32:\n\t\t\tn = int64(value)\n\t\t\tcounterType = true\n\t\tcase uint64:\n\t\t\tn = int64(value)\n\t\t\tcounterType = true\n\n\t\tcase float32:\n\t\t\tf = float64(value)\n\t\tcase float64:\n\t\t\tf = float64(value)\n\t\t}\n\n\t\tif counterType {\n\t\t\tcounter, err := monitor.GetOrNewBusinessCounter(key)\n\t\t\tif err != nil {\n\t\t\t\totel.Handle(err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcounter.Add(ctx, n, metric.WithAttributes(attrs...))\n\n\t\t} else {\n\n\t\t\thistogram, err := monitor.GetOrNewBusinessHistogram(key)\n\t\t\tif err != nil {\n\t\t\t\totel.Handle(err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\thistogram.Record(ctx, f, metric.WithAttributes(attrs...))\n\t\t}\n\t}\n\n\treturn\n}\n\nfunc Attrs(dim Dimension) []attribute.KeyValue {\n\tvar attrs []attribute.KeyValue\n\thostIP, err := net_.GetHostIP()\n\tif err == nil && hostIP.String() != \"\" {\n\t\tattrs = append(attrs, PodIpKey.String(hostIP.String()))\n\t}\n\tif dim.CalleeMethod != \"\" {\n\t\tattrs = append(attrs, CalleeMethodKey.String(dim.CalleeMethod))\n\t}\n\n\tif dim.Error != nil {\n\t\terrorCode := int64(errors_.ErrorToCode(dim.Error))\n\t\tmessage := errors_.ErrorToString(dim.Error)\n\t\tattrs = append(attrs, ErrorCodeKey.String(fmt.Sprintf(\"%d:%s\", errorCode, message)))\n\t} else {\n\t\tattrs = append(attrs, ErrorCodeKey.String(\"0:OK\"))\n\t}\n\n\tappName := app_.GetVersion().AppName\n\tif appName != \"\" {\n\t\tattrs = append(attrs, ServerNameKey.String(appName))\n\t}\n\n\treturn attrs\n}\n"
  },
  {
    "path": "pkg/mq/consumer.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mq\n\nimport \"context\"\n\ntype Consumer interface {\n\tReadStream(ctx context.Context) <-chan Message\n\tTopic() string\n\tClose()\n}\n"
  },
  {
    "path": "pkg/mq/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/mq\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/segmentio/kafka-go v0.4.49\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgolang.org/x/net v0.48.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/compress v1.18.0 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pierrec/lz4/v4 v4.1.18 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n"
  },
  {
    "path": "pkg/mq/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/segmentio/kafka-go v0.4.49 h1:GJiNX1d/g+kG6ljyJEoi9++PUMdXGAxb7JGPiDCuNmk=\ngithub.com/segmentio/kafka-go v0.4.49/go.mod h1:Y1gn60kzLEEaW28YshXyk2+VCUKbJ3Qr6DrnT3i4+9E=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=\ngithub.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=\ngithub.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=\ngithub.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=\ngithub.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=\ngithub.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\n"
  },
  {
    "path": "pkg/mq/kafka/config.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage kafka\n\nimport (\n\t\"context\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto Kafka\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context) (*MQ, error) {\n\n\tlogrus.Infof(\"Installing Kafka\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\tlogrus.Warnf(\"Kafka disenabled\")\n\t\treturn nil, nil\n\t}\n\n\tmq, err := c.install(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed Kafka\")\n\n\treturn mq, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context) (*MQ, error) {\n\tmq := NewMQ(\n\t\tMQConfig{\n\t\t\tBrokers: c.Proto.GetBrokers(),\n\t\t},\n\t)\n\n\treturn mq.InstallMQ(\n\t\tctx,\n\t\tc.Proto.GetMaxWaitDuration().AsDuration(),\n\t\tc.Proto.GetFailAfterDuration().AsDuration(),\n\t)\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/mq/kafka/config.option.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage kafka\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/mq/kafka/config_option.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage kafka\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/mq/kafka/kafka.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage kafka\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tmq_ \"github.com/kaydxh/golang/pkg/mq\"\n\tkafka \"github.com/segmentio/kafka-go\"\n\t\"golang.org/x/net/context\"\n)\n\ntype MQConfig struct {\n\tBrokers []string\n}\n\ntype MQOptions struct {\n\tSaslUsername string\n\tSaslPassword string\n\n\tdialTimeout         time.Duration\n\treconnectBackOff    time.Duration\n\treconnectBackOffMax time.Duration\n\n\tproducerOpts ProducerOptions\n\tconsumerOpts ConsumerOptions\n}\n\ntype ProducerOptions struct {\n\t// The default is to use a target batch size of 100 messages.\n\tbatchSize int\n\n\t// Limit the maximum size of a request in bytes before being\n\t// sent to\n\t// a partition.\n\t//\n\t// The default is to use a kafka default value of\n\t// 1048576.\n\tbatchBytes int\n\n\t// Time limit on how often incomplete message batches will be\n\t// flushed to\n\t// kafka.\n\t//\n\t// The default is to flush at least every second.\n\tbatchTimeout time.Duration\n}\n\ntype ConsumerOptions struct {\n\tgroupID   string\n\tpartition int\n\n\t// MinBytes indicates to the broker the minimum batch size that the consumer\n\t// will accept. Setting a high minimum when consuming from a low-volume topic\n\t// may result in delayed delivery when the broker does not have enough data to\n\t// satisfy the defined minimum.\n\t//\n\t// Default: 1\n\tminBytes int\n\n\t// MaxBytes indicates to the broker the maximum batch size that the consumer\n\t// will accept. The broker will truncate a message to satisfy this maximum, so\n\t// choose a value that is high enough for your largest message size.\n\t//\n\t// Default: 1MB\n\tmaxBytes int\n\n\t// Maximum amount of time to wait for new data to come when fetching batches\n\t// of messages from kafka.\n\t//\n\t// Default: 10s\n\tmaxWait time.Duration\n}\n\ntype MQ struct {\n\t*kafka.Conn\n\tproducers map[string]*Producer // key topic\n\tconsumers map[string]*Consumer // key topic\n\n\tproducerLock sync.Mutex\n\tconsumerLock sync.Mutex\n\n\tConf MQConfig\n\topts MQOptions\n}\n\nfunc NewMQ(conf MQConfig, opts ...MQOption) *MQ {\n\tc := &MQ{\n\t\tConf:      conf,\n\t\tproducers: make(map[string]*Producer),\n\t\tconsumers: make(map[string]*Consumer),\n\t}\n\tc.ApplyOptions(opts...)\n\n\treturn c\n\n}\n\nfunc newController(broker string) (*kafka.Conn, error) {\n\tconn, err := kafka.Dial(\"tcp\", broker)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer conn.Close()\n\n\tcontroller, err := conn.Controller()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcontrollerConn, err := kafka.Dial(\"tcp\", net.JoinHostPort(controller.Host, strconv.Itoa(controller.Port)))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn controllerConn, nil\n}\n\nfunc (q *MQ) InstallMQ(\n\tctx context.Context,\n\tmaxWaitInterval time.Duration,\n\tfailAfter time.Duration,\n) (*MQ, error) {\n\texp := time_.NewExponentialBackOff(\n\t\ttime_.WithExponentialBackOffOptionMaxInterval(maxWaitInterval),\n\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(failAfter),\n\t)\n\n\tvar (\n\t\terrs []error\n\t\tconn *kafka.Conn\n\t)\n\terr := time_.BackOffUntilWithContext(ctx, func(ctx context.Context) (err_ error) {\n\t\tfor _, broker := range q.Conf.Brokers {\n\t\t\tconn, err_ = newController(broker)\n\t\t\tif err_ != nil {\n\t\t\t\terrs = append(errs, err_)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"failed to connect kafka: %v, err: %v\", q.Conf.Brokers, errors_.NewAggregate(errs))\n\t}, exp, true, false)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get kafka connection fail after: %v\", failAfter)\n\t}\n\n\tq.Conn = conn\n\n\treturn q, nil\n}\n\nfunc (q *MQ) AsProducers(ctx context.Context, topics ...string) (producers []*Producer, err error) {\n\tfor _, topic := range topics {\n\n\t\tfn := func() (*Producer, error) {\n\n\t\t\tdialer := &kafka.Dialer{\n\t\t\t\tTimeout:   q.opts.dialTimeout,\n\t\t\t\tDualStack: true,\n\t\t\t}\n\t\t\tproducer, err := NewProducer(kafka.WriterConfig{\n\t\t\t\tBrokers:  q.Conf.Brokers,\n\t\t\t\tTopic:    topic,\n\t\t\t\tBalancer: &kafka.Hash{},\n\t\t\t\tDialer:   dialer,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tq.producerLock.Lock()\n\t\t\tdefer q.producerLock.Unlock()\n\t\t\tq.producers[topic] = producer\n\t\t\treturn producer, nil\n\t\t}\n\n\t\texp := time_.NewExponentialBackOff(\n\t\t\ttime_.WithExponentialBackOffOptionMaxInterval(q.opts.reconnectBackOff),\n\t\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(q.opts.reconnectBackOffMax),\n\t\t)\n\t\terr := time_.BackOffUntilWithContext(ctx, func(ctx context.Context) (err_ error) {\n\t\t\tproducer, err_ := fn()\n\t\t\tif err_ != nil {\n\t\t\t\treturn err_\n\t\t\t}\n\t\t\tproducers = append(producers, producer)\n\t\t\treturn nil\n\t\t}, exp, true, false)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"create producer for %v fail after: %v\", topic, q.opts.reconnectBackOffMax.Milliseconds())\n\t\t}\n\n\t}\n\n\treturn producers, nil\n}\n\nfunc (q *MQ) GetProducer(topic string) (*Producer, error) {\n\tq.producerLock.Lock()\n\tdefer q.producerLock.Unlock()\n\tproducer, ok := q.producers[topic]\n\tif ok {\n\t\treturn producer, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"not exist producer %v\", topic)\n}\n\nfunc (q *MQ) Send(ctx context.Context, topic string, msgs ...kafka.Message) error {\n\tp, err := q.GetProducer(topic)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn p.Send(ctx, msgs...)\n}\n\nfunc (q *MQ) AsConsumers(ctx context.Context, topics ...string) (consumers []*Consumer, err error) {\n\tfor _, topic := range topics {\n\n\t\tcheckFn := func() bool {\n\t\t\tq.consumerLock.Lock()\n\t\t\tdefer q.consumerLock.Unlock()\n\t\t\t_, ok := q.consumers[topic]\n\t\t\tif ok {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\n\t\texist := checkFn()\n\t\tif exist {\n\t\t\tcontinue\n\t\t}\n\n\t\tfn := func() (*Consumer, error) {\n\n\t\t\tdialer := &kafka.Dialer{\n\t\t\t\tTimeout:   q.opts.dialTimeout,\n\t\t\t\tDualStack: true,\n\t\t\t}\n\t\t\tconsumer, err := NewConsumer(kafka.ReaderConfig{\n\t\t\t\tBrokers:  q.Conf.Brokers,\n\t\t\t\tGroupID:  q.opts.consumerOpts.groupID,\n\t\t\t\tTopic:    topic,\n\t\t\t\tDialer:   dialer,\n\t\t\t\tMinBytes: q.opts.consumerOpts.minBytes,\n\t\t\t\tMaxBytes: q.opts.consumerOpts.maxBytes,\n\t\t\t\tMaxWait:  q.opts.consumerOpts.maxWait,\n\t\t\t\t//\tCommitInterval: time.Second, // flushes commits to Kafka every second\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tq.consumerLock.Lock()\n\t\t\tdefer q.consumerLock.Unlock()\n\t\t\tq.consumers[topic] = consumer\n\t\t\treturn consumer, nil\n\t\t}\n\n\t\texp := time_.NewExponentialBackOff(\n\t\t\ttime_.WithExponentialBackOffOptionMaxInterval(q.opts.reconnectBackOff),\n\t\t\ttime_.WithExponentialBackOffOptionMaxElapsedTime(q.opts.reconnectBackOffMax),\n\t\t)\n\t\terr := time_.BackOffUntilWithContext(ctx, func(ctx context.Context) (err_ error) {\n\t\t\tconsumer, err_ := fn()\n\t\t\tif err_ != nil {\n\t\t\t\treturn err_\n\t\t\t}\n\t\t\tconsumers = append(consumers, consumer)\n\t\t\treturn nil\n\t\t}, exp, true, false)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"create consumer for %v fail after: %v\", topic, q.opts.reconnectBackOffMax.Milliseconds())\n\t\t}\n\n\t}\n\n\treturn consumers, nil\n}\n\nfunc (q *MQ) GetConsumer(topic string) (*Consumer, error) {\n\tq.consumerLock.Lock()\n\tdefer q.consumerLock.Unlock()\n\tconsumer, ok := q.consumers[topic]\n\tif ok {\n\t\treturn consumer, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"not exist consumer %v\", topic)\n}\n\nfunc (q *MQ) ReadStream(ctx context.Context, topic string) <-chan mq_.Message {\n\tc, err := q.GetConsumer(topic)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn c.ReadStream(ctx)\n}\n\nfunc (q *MQ) Close() {\n\tfor _, producer := range q.producers {\n\t\tproducer.Close()\n\t}\n\tfor _, consumer := range q.consumers {\n\t\tconsumer.Close()\n\t}\n\tif q.Conn != nil {\n\t\tq.Conn.Close()\n\t}\n}\n"
  },
  {
    "path": "pkg/mq/kafka/kafka.option.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage kafka\n\nimport \"time\"\n\n// base options\nfunc WithDialTimeout(dialTimeout time.Duration) MQOption {\n\treturn MQOptionFunc(func(m *MQ) {\n\t\tm.opts.dialTimeout = dialTimeout\n\t})\n}\n\n// producer options\nfunc WithProducerBatchSize(batchSize int) MQOption {\n\treturn MQOptionFunc(func(m *MQ) {\n\t\tm.opts.producerOpts.batchSize = batchSize\n\t})\n}\n\nfunc WithProducerBatchBytes(batchBytes int) MQOption {\n\treturn MQOptionFunc(func(m *MQ) {\n\t\tm.opts.producerOpts.batchBytes = batchBytes\n\t})\n}\n\nfunc WithProducerBatchTimeout(batchTimeout time.Duration) MQOption {\n\treturn MQOptionFunc(func(m *MQ) {\n\t\tm.opts.producerOpts.batchTimeout = batchTimeout\n\t})\n}\n\n// consumer options\nfunc WithConsumerGroupID(groupID string) MQOption {\n\treturn MQOptionFunc(func(m *MQ) {\n\t\tm.opts.consumerOpts.groupID = groupID\n\t})\n}\n\nfunc WithConsumerPartition(partition int) MQOption {\n\treturn MQOptionFunc(func(m *MQ) {\n\t\tm.opts.consumerOpts.partition = partition\n\t})\n}\n\nfunc WithConsumerMinBytes(minBytes int) MQOption {\n\treturn MQOptionFunc(func(m *MQ) {\n\t\tm.opts.consumerOpts.minBytes = minBytes\n\t})\n}\n\nfunc WithConsumerMaxBytes(maxBytes int) MQOption {\n\treturn MQOptionFunc(func(m *MQ) {\n\t\tm.opts.consumerOpts.maxBytes = maxBytes\n\t})\n}\n\nfunc WithConsumerMaxWait(maxWait time.Duration) MQOption {\n\treturn MQOptionFunc(func(m *MQ) {\n\t\tm.opts.consumerOpts.maxWait = maxWait\n\t})\n}\n"
  },
  {
    "path": "pkg/mq/kafka/kafka.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: pkg/mq/kafka/kafka.proto\n\npackage kafka\n\nimport (\n\tduration \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\n// https://github.com/confluentinc/librdkafka/blob/master/CONFIGURATION.md\ntype Kafka struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled             bool               `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tBrokers             []string           `protobuf:\"bytes,2,rep,name=brokers,proto3\" json:\"brokers,omitempty\"`\n\tApiVersionRequest   bool               `protobuf:\"varint,3,opt,name=api_version_request,json=apiVersionRequest,proto3\" json:\"api_version_request,omitempty\"`\n\tReconnectBackoff    *duration.Duration `protobuf:\"bytes,4,opt,name=reconnect_backoff,json=reconnectBackoff,proto3\" json:\"reconnect_backoff,omitempty\"`\n\tReconnectBackoffMax *duration.Duration `protobuf:\"bytes,5,opt,name=reconnect_backoff_max,json=reconnectBackoffMax,proto3\" json:\"reconnect_backoff_max,omitempty\"`\n\tMaxWaitDuration     *duration.Duration `protobuf:\"bytes,6,opt,name=max_wait_duration,json=maxWaitDuration,proto3\" json:\"max_wait_duration,omitempty\"`\n\tFailAfterDuration   *duration.Duration `protobuf:\"bytes,7,opt,name=fail_after_duration,json=failAfterDuration,proto3\" json:\"fail_after_duration,omitempty\"`\n}\n\nfunc (x *Kafka) Reset() {\n\t*x = Kafka{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_mq_kafka_kafka_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Kafka) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Kafka) ProtoMessage() {}\n\nfunc (x *Kafka) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_mq_kafka_kafka_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Kafka.ProtoReflect.Descriptor instead.\nfunc (*Kafka) Descriptor() ([]byte, []int) {\n\treturn file_pkg_mq_kafka_kafka_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Kafka) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Kafka) GetBrokers() []string {\n\tif x != nil {\n\t\treturn x.Brokers\n\t}\n\treturn nil\n}\n\nfunc (x *Kafka) GetApiVersionRequest() bool {\n\tif x != nil {\n\t\treturn x.ApiVersionRequest\n\t}\n\treturn false\n}\n\nfunc (x *Kafka) GetReconnectBackoff() *duration.Duration {\n\tif x != nil {\n\t\treturn x.ReconnectBackoff\n\t}\n\treturn nil\n}\n\nfunc (x *Kafka) GetReconnectBackoffMax() *duration.Duration {\n\tif x != nil {\n\t\treturn x.ReconnectBackoffMax\n\t}\n\treturn nil\n}\n\nfunc (x *Kafka) GetMaxWaitDuration() *duration.Duration {\n\tif x != nil {\n\t\treturn x.MaxWaitDuration\n\t}\n\treturn nil\n}\n\nfunc (x *Kafka) GetFailAfterDuration() *duration.Duration {\n\tif x != nil {\n\t\treturn x.FailAfterDuration\n\t}\n\treturn nil\n}\n\ntype Kafka_Consumer struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n}\n\nfunc (x *Kafka_Consumer) Reset() {\n\t*x = Kafka_Consumer{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_mq_kafka_kafka_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Kafka_Consumer) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Kafka_Consumer) ProtoMessage() {}\n\nfunc (x *Kafka_Consumer) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_mq_kafka_kafka_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Kafka_Consumer.ProtoReflect.Descriptor instead.\nfunc (*Kafka_Consumer) Descriptor() ([]byte, []int) {\n\treturn file_pkg_mq_kafka_kafka_proto_rawDescGZIP(), []int{0, 0}\n}\n\ntype Kafka_Producer struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n}\n\nfunc (x *Kafka_Producer) Reset() {\n\t*x = Kafka_Producer{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_mq_kafka_kafka_proto_msgTypes[2]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Kafka_Producer) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Kafka_Producer) ProtoMessage() {}\n\nfunc (x *Kafka_Producer) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_mq_kafka_kafka_proto_msgTypes[2]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Kafka_Producer.ProtoReflect.Descriptor instead.\nfunc (*Kafka_Producer) Descriptor() ([]byte, []int) {\n\treturn file_pkg_mq_kafka_kafka_proto_rawDescGZIP(), []int{0, 1}\n}\n\nvar File_pkg_mq_kafka_kafka_proto protoreflect.FileDescriptor\n\nvar file_pkg_mq_kafka_kafka_proto_rawDesc = []byte{\n\t0x0a, 0x18, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x71, 0x2f, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x2f, 0x6b,\n\t0x61, 0x66, 0x6b, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x2e, 0x70,\n\t0x6b, 0x67, 0x2e, 0x6d, 0x71, 0x2e, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, 0x1e, 0x67, 0x6f, 0x6f,\n\t0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72,\n\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x03, 0x0a, 0x05,\n\t0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,\n\t0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12,\n\t0x18, 0x0a, 0x07, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,\n\t0x52, 0x07, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x70, 0x69,\n\t0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,\n\t0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69,\n\t0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x11, 0x72, 0x65, 0x63,\n\t0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x04,\n\t0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,\n\t0x10, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66,\n\t0x66, 0x12, 0x4d, 0x0a, 0x15, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x62,\n\t0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,\n\t0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x72, 0x65, 0x63,\n\t0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x4d, 0x61, 0x78,\n\t0x12, 0x45, 0x0a, 0x11, 0x6d, 0x61, 0x78, 0x5f, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x64, 0x75, 0x72,\n\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f,\n\t0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75,\n\t0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x57, 0x61, 0x69, 0x74, 0x44,\n\t0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x13, 0x66, 0x61, 0x69, 0x6c, 0x5f,\n\t0x61, 0x66, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07,\n\t0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,\n\t0x11, 0x66, 0x61, 0x69, 0x6c, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69,\n\t0x6f, 0x6e, 0x1a, 0x0a, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x1a, 0x0a,\n\t0x0a, 0x08, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69,\n\t0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f,\n\t0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x71, 0x2f, 0x6b, 0x61,\n\t0x66, 0x6b, 0x61, 0x3b, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x33,\n}\n\nvar (\n\tfile_pkg_mq_kafka_kafka_proto_rawDescOnce sync.Once\n\tfile_pkg_mq_kafka_kafka_proto_rawDescData = file_pkg_mq_kafka_kafka_proto_rawDesc\n)\n\nfunc file_pkg_mq_kafka_kafka_proto_rawDescGZIP() []byte {\n\tfile_pkg_mq_kafka_kafka_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_mq_kafka_kafka_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_mq_kafka_kafka_proto_rawDescData)\n\t})\n\treturn file_pkg_mq_kafka_kafka_proto_rawDescData\n}\n\nvar file_pkg_mq_kafka_kafka_proto_msgTypes = make([]protoimpl.MessageInfo, 3)\nvar file_pkg_mq_kafka_kafka_proto_goTypes = []interface{}{\n\t(*Kafka)(nil),             // 0: go.pkg.mq.kafka.Kafka\n\t(*Kafka_Consumer)(nil),    // 1: go.pkg.mq.kafka.Kafka.Consumer\n\t(*Kafka_Producer)(nil),    // 2: go.pkg.mq.kafka.Kafka.Producer\n\t(*duration.Duration)(nil), // 3: google.protobuf.Duration\n}\nvar file_pkg_mq_kafka_kafka_proto_depIdxs = []int32{\n\t3, // 0: go.pkg.mq.kafka.Kafka.reconnect_backoff:type_name -> google.protobuf.Duration\n\t3, // 1: go.pkg.mq.kafka.Kafka.reconnect_backoff_max:type_name -> google.protobuf.Duration\n\t3, // 2: go.pkg.mq.kafka.Kafka.max_wait_duration:type_name -> google.protobuf.Duration\n\t3, // 3: go.pkg.mq.kafka.Kafka.fail_after_duration:type_name -> google.protobuf.Duration\n\t4, // [4:4] is the sub-list for method output_type\n\t4, // [4:4] is the sub-list for method input_type\n\t4, // [4:4] is the sub-list for extension type_name\n\t4, // [4:4] is the sub-list for extension extendee\n\t0, // [0:4] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_mq_kafka_kafka_proto_init() }\nfunc file_pkg_mq_kafka_kafka_proto_init() {\n\tif File_pkg_mq_kafka_kafka_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_mq_kafka_kafka_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Kafka); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_mq_kafka_kafka_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Kafka_Consumer); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_mq_kafka_kafka_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Kafka_Producer); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_mq_kafka_kafka_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   3,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_mq_kafka_kafka_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_mq_kafka_kafka_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_mq_kafka_kafka_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_mq_kafka_kafka_proto = out.File\n\tfile_pkg_mq_kafka_kafka_proto_rawDesc = nil\n\tfile_pkg_mq_kafka_kafka_proto_goTypes = nil\n\tfile_pkg_mq_kafka_kafka_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/mq/kafka/kafka.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.mq.kafka;\n\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/golang/pkg/mq/kafka;kafka\";\n\n// https://github.com/confluentinc/librdkafka/blob/master/CONFIGURATION.md\nmessage Kafka {\n  bool enabled = 1;\n  repeated string brokers = 2;\n  bool api_version_request = 3;\n  google.protobuf.Duration reconnect_backoff = 4;\n  google.protobuf.Duration reconnect_backoff_max = 5;\n  google.protobuf.Duration max_wait_duration = 6;\n  google.protobuf.Duration fail_after_duration = 7;\n\n  message Consumer {}\n\n  message Producer {}\n}\n"
  },
  {
    "path": "pkg/mq/kafka/kafka.yaml",
    "content": "mq:\n  kafka:\n    enabled: true\n    brokers: [\"127.0.0.1:9092\"]\n    max_wait_duration: 5s\n    fail_after_duration: 30s\n\n"
  },
  {
    "path": "pkg/mq/kafka/kafka_consumer.go",
    "content": "package kafka\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\tmq_ \"github.com/kaydxh/golang/pkg/mq\"\n\tkafka \"github.com/segmentio/kafka-go\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype Consumer struct {\n\t*kafka.Reader\n\tconfig     kafka.ReaderConfig\n\tmsgCh      chan mq_.Message\n\tstreamOnce sync.Once\n\tcloseOnce  sync.Once\n\tcloseCh    chan struct{}\n}\n\nfunc NewConsumer(config kafka.ReaderConfig) (*Consumer, error) {\n\tc := &Consumer{\n\t\tconfig:  config,\n\t\tmsgCh:   make(chan mq_.Message, 1024),\n\t\tcloseCh: make(chan struct{}),\n\t}\n\tr := kafka.NewReader(config)\n\n\tc.Reader = r\n\treturn c, nil\n}\n\nfunc (c *Consumer) Topic() string {\n\treturn c.config.Topic\n}\n\nfunc (c *Consumer) ReadStream(ctx context.Context) <-chan mq_.Message {\n\tc.streamOnce.Do(func() {\n\t\tgo func() {\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase <-c.closeCh:\n\t\t\t\t\terr := c.Reader.Close()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlogrus.WithError(err).Errorf(\"failed to close consumer\")\n\t\t\t\t\t}\n\n\t\t\t\t\tif c.msgCh != nil {\n\t\t\t\t\t\tclose(c.msgCh)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn\n\n\t\t\t\tdefault:\n\t\t\t\t\tmsg, err := c.Reader.ReadMessage(ctx)\n\t\t\t\t\tc.msgCh <- KafkaMessage{\n\t\t\t\t\t\tErr: err,\n\t\t\t\t\t\tMsg: &msg,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t})\n\n\treturn c.msgCh\n}\n\nfunc (c *Consumer) Close() {\n\tc.closeOnce.Do(func() {\n\t\tif c.closeCh != nil {\n\t\t\tclose(c.closeCh)\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "pkg/mq/kafka/kafka_message.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage kafka\n\nimport \"github.com/segmentio/kafka-go\"\n\ntype KafkaMessage struct {\n\tErr error\n\tMsg *kafka.Message\n}\n\nfunc (m KafkaMessage) Error() error {\n\treturn m.Err\n}\n\nfunc (m KafkaMessage) Key() []byte {\n\treturn m.Msg.Key\n}\n\nfunc (m KafkaMessage) Value() []byte {\n\treturn m.Msg.Value\n}\n"
  },
  {
    "path": "pkg/mq/kafka/kafka_option.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage kafka\n\n// A MQOption sets options.\ntype MQOption interface {\n\tapply(*MQ)\n}\n\n// EmptyMQUrlOption does not alter the MQuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyMQOption struct{}\n\nfunc (EmptyMQOption) apply(*MQ) {}\n\n// MQOptionFunc wraps a function that modifies MQ into an\n// implementation of the MQOption interface.\ntype MQOptionFunc func(*MQ)\n\nfunc (f MQOptionFunc) apply(do *MQ) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _MQOptionWithDefault() MQOption {\n\treturn MQOptionFunc(func(*MQ) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *MQ) ApplyOptions(options ...MQOption) *MQ {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/mq/kafka/kafka_producer.go",
    "content": "package kafka\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\tkafka \"github.com/segmentio/kafka-go\"\n)\n\ntype Producer struct {\n\t*kafka.Writer\n\tconfig    kafka.WriterConfig\n\ttopic     string\n\tcloseOnce sync.Once\n\tcloseCh   chan struct{}\n}\n\nfunc NewProducer(config kafka.WriterConfig) (*Producer, error) {\n\tp := &Producer{\n\t\tconfig:  config,\n\t\tcloseCh: make(chan struct{}),\n\t}\n\tw := kafka.NewWriter(config)\n\tp.Writer = w\n\treturn p, nil\n}\n\nfunc (p *Producer) Send(ctx context.Context, msgs ...kafka.Message) error {\n\treturn p.Writer.WriteMessages(ctx, msgs...)\n}\n\nfunc (p *Producer) Close() {\n\tp.closeOnce.Do(func() {\n\t\tif p.closeCh != nil {\n\t\t\tclose(p.closeCh)\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "pkg/mq/kafka/kafka_test.go",
    "content": "package kafka_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\tkafka_ \"github.com/kaydxh/golang/pkg/mq/kafka\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/segmentio/kafka-go\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc TestCreateTopic(t *testing.T) {\n\tctx := context.Background()\n\n\tmq := kafka_.NewMQ(kafka_.MQConfig{\n\t\tBrokers: []string{\"localhost:9092\"},\n\t})\n\t_, err := mq.InstallMQ(ctx, time.Second, 10*time.Second)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to new mq, err: %v\", err)\n\t}\n\ttopic := \"topic-test-1\"\n\terr = mq.CreateTopics(\n\t\tkafka.TopicConfig{\n\t\t\tTopic:             topic,\n\t\t\tNumPartitions:     1,\n\t\t\tReplicationFactor: 1,\n\t\t},\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create topic, err: %v\", err)\n\t}\n\n}\n\nfunc TestProducer(t *testing.T) {\n\n\tctx := context.Background()\n\tmq := kafka_.NewMQ(kafka_.MQConfig{\n\t\tBrokers: []string{\"localhost:9092\"},\n\t})\n\t_, err := mq.InstallMQ(ctx, time.Second, 10*time.Second)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to new mq, err: %v\", err)\n\t}\n\n\ttopic := \"topic-test-1\"\n\tps, err := mq.AsProducers(ctx, topic)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to as producers, err: %v\", err)\n\t}\n\n\terr = ps[0].Send(ctx,\n\t\tkafka.Message{\n\t\t\tKey:   []byte(\"Key-A\"),\n\t\t\tValue: []byte(\"Hello World!\"),\n\t\t},\n\t\tkafka.Message{\n\t\t\tKey:   []byte(\"Key-B\"),\n\t\t\tValue: []byte(\"One!\"),\n\t\t},\n\t\tkafka.Message{\n\t\t\tKey:   []byte(\"Key-C\"),\n\t\t\tValue: []byte(\"Two!\"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to send messages, err: %v\", err)\n\t}\n\n}\n\nfunc TestConsumer(t *testing.T) {\n\n\tctx := context.Background()\n\tmq := kafka_.NewMQ(kafka_.MQConfig{\n\t\tBrokers: []string{\"localhost:9092\"},\n\t})\n\t_, err := mq.InstallMQ(ctx, time.Second, 10*time.Second)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to new mq, err: %v\", err)\n\t}\n\n\ttopic := \"topic-test-1\"\n\tcs, err := mq.AsConsumers(ctx, topic)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to as producers, err: %v\", err)\n\t}\n\n\tfor msg := range cs[0].ReadStream(ctx) {\n\t\tif msg.Error() != nil {\n\t\t\tt.Errorf(\"failed to read stream err: %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tstas := cs[0].Stats()\n\t\tt.Logf(\"read msg key[%v], value[%v], stas: %+v\", string(msg.Key()), string(msg.Value()), stas)\n\t}\n\n}\n\nfunc TestNew(t *testing.T) {\n\n\tcfgFile := \"./kafka.yaml\"\n\tconfig := kafka_.NewConfig(kafka_.WithViper(viper_.GetViper(cfgFile, \"mq.kafka\")))\n\n\tmq, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\n\tt.Logf(\"mq: %#v\", mq)\n}\n"
  },
  {
    "path": "pkg/mq/message.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mq\n\ntype Message interface {\n\tError() error\n\tKey() []byte\n\tValue() []byte\n}\n"
  },
  {
    "path": "pkg/mq/producer.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mq\n\ntype Producer interface {\n\tClose()\n}\n"
  },
  {
    "path": "pkg/opentelemetry/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage opentelemetry\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/gin-gonic/gin\"\n\tmiddleware_resource \"github.com/kaydxh/golang/pkg/middleware/resource\"\n\totlpmetric_ \"github.com/kaydxh/golang/pkg/opentelemetry/metric/otlp\"\n\tprometheus_ \"github.com/kaydxh/golang/pkg/opentelemetry/metric/prometheus\"\n\tstdoutmetric_ \"github.com/kaydxh/golang/pkg/opentelemetry/metric/stdout\"\n\t\"github.com/kaydxh/golang/pkg/opentelemetry/resource\"\n\totlptrace_ \"github.com/kaydxh/golang/pkg/opentelemetry/tracer/otlp\"\n\tstdouttrace_ \"github.com/kaydxh/golang/pkg/opentelemetry/tracer/stdout\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto OpenTelemetry\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper                       *viper.Viper\n\t\tresourceStatsServiceOptions []resource.ResourceStatsServiceOption\n\t\t// ginRouter is used to register /metrics endpoint\n\t\tginRouter gin.IRouter\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\n// New installs all OpenTelemetry components (Tracer + Meter) together\n// Use this when you don't need to control the initialization order\nfunc (c *completedConfig) New(ctx context.Context) error {\n\tlogrus.Infof(\"Installing OpenTelemetry\")\n\n\tif c.completeError != nil {\n\t\treturn c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\treturn nil\n\t}\n\n\t// Install tracer first\n\tif err := c.InstallTracer(ctx); err != nil {\n\t\treturn err\n\t}\n\n\t// Then install meter\n\tif err := c.InstallMeter(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tlogrus.Infof(\"Installed OpenTelemetry\")\n\treturn nil\n}\n\n// InstallTracer installs only the TracerProvider\n// This should be called BEFORE webserver creation so that trace interceptors can use the correct TracerProvider\nfunc (c *completedConfig) InstallTracer(ctx context.Context) error {\n\tif c.completeError != nil {\n\t\treturn c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\treturn nil\n\t}\n\n\tlogrus.Infof(\"======== OpenTelemetry Tracer install starting ========\")\n\n\tvar openTelemetryOpts []OpenTelemetryServiceOption\n\n\t// Install resource for tracer\n\tresOpts, err := c.installResourceAttributesForTracer(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\topenTelemetryOpts = append(openTelemetryOpts, resOpts...)\n\n\t// Install tracer exporter\n\topts, err := c.installTracerExporter(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\topenTelemetryOpts = append(openTelemetryOpts, opts...)\n\n\tif len(opts) > 0 {\n\t\tot := NewOpenTelemetryService(openTelemetryOpts...)\n\t\terr = ot.Install(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlogrus.Infof(\"Installed OpenTelemetry Tracer\")\n\t}\n\n\treturn nil\n}\n\n// InstallMeter installs MeterProvider (Global + App if configured)\n// This can be called after InstallTracer, or independently if tracer is not needed\nfunc (c *completedConfig) InstallMeter(ctx context.Context) error {\n\tif c.completeError != nil {\n\t\treturn c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\treturn nil\n\t}\n\n\tlogrus.Infof(\"======== OpenTelemetry Meter install starting ========\")\n\n\tvar openTelemetryOpts []OpenTelemetryServiceOption\n\n\t// Install resource for meter only\n\tresOpts, err := c.installResourceAttributesForMeter(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\topenTelemetryOpts = append(openTelemetryOpts, resOpts...)\n\n\t// Install global meter exporter\n\topts, err := c.installMeterExporter(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\topenTelemetryOpts = append(openTelemetryOpts, opts...)\n\n\t// Install App MeterProvider if configured\n\tappOpts, err := c.installAppMeterExporter(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\topenTelemetryOpts = append(openTelemetryOpts, appOpts...)\n\n\tot := NewOpenTelemetryService(openTelemetryOpts...)\n\terr = ot.Install(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Install resource stats service\n\t_, err = c.installResourceStats(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogrus.Infof(\"Installed OpenTelemetry Meter\")\n\treturn nil\n}\n\n// installResourceAttributesForTracer creates resource attributes for tracer\n// Uses WithResource which sets both tracer and meter resource options\nfunc (c *completedConfig) installResourceAttributesForTracer(ctx context.Context) ([]OpenTelemetryServiceOption, error) {\n\tvar opts []OpenTelemetryServiceOption\n\n\tresourceConfig := c.Proto.GetResource()\n\n\t// Build resource options\n\tvar resourceOpts []resource.ResourceOption\n\n\t// Service name\n\tif resourceConfig.GetServiceName() != \"\" {\n\t\tresourceOpts = append(resourceOpts, resource.WithServiceName(resourceConfig.GetServiceName()))\n\t}\n\n\t// Custom attributes\n\tif len(resourceConfig.GetAttrs()) > 0 {\n\t\tresourceOpts = append(resourceOpts, resource.WithAttrs(resourceConfig.GetAttrs()))\n\t}\n\n\t// K8s attributes (enabled by default)\n\t// Note: After regenerating pb.go, use resourceConfig.GetK8S().GetEnabled()\n\tresourceOpts = append(resourceOpts, resource.WithK8s(true))\n\n\t// Set meter type as Global for ZhiYan global_app_mark selection\n\tresourceOpts = append(resourceOpts, resource.WithMeterType(resource.MeterTypeGlobal))\n\n\t// APM Token (Tencent Cloud APM)\n\tapmConfig := resourceConfig.GetApm()\n\tif apmConfig != nil && apmConfig.GetToken() != \"\" {\n\t\tresourceOpts = append(resourceOpts, resource.WithApmToken(apmConfig.GetToken()))\n\t\tlogrus.Infof(\"APM Token configured for resource attributes\")\n\t}\n\n\t// ZhiYan platform configuration\n\tzhiyanConfig := resourceConfig.GetZhiyan()\n\tif zhiyanConfig != nil {\n\t\tif zhiyanConfig.GetAppMark() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanAppMark(zhiyanConfig.GetAppMark()))\n\t\t}\n\t\tif zhiyanConfig.GetGlobalAppMark() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanGlobalAppMark(zhiyanConfig.GetGlobalAppMark()))\n\t\t}\n\t\tif zhiyanConfig.GetEnv() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanEnv(zhiyanConfig.GetEnv()))\n\t\t}\n\t\tif zhiyanConfig.GetInstanceMark() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanInstanceMark(zhiyanConfig.GetInstanceMark()))\n\t\t}\n\t\tif zhiyanConfig.GetZhiyanApmToken() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanApmToken(zhiyanConfig.GetZhiyanApmToken()))\n\t\t\tlogrus.Infof(\"ZhiYan APM Token configured for trace reporting\")\n\t\t}\n\t\tif zhiyanConfig.GetExpandKey() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanExpandKey(zhiyanConfig.GetExpandKey()))\n\t\t}\n\t\tif zhiyanConfig.GetMetricGroup() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanMetricGroup(zhiyanConfig.GetMetricGroup()))\n\t\t\t// Set metric group for middleware metrics (must be called before metrics are created)\n\t\t\tmiddleware_resource.SetMetricGroup(zhiyanConfig.GetMetricGroup())\n\t\t}\n\t\t// TODO: Uncomment after regenerating pb.go with new proto fields (data_grain, data_type)\n\t\t// if zhiyanConfig.GetDataGrain() > 0 {\n\t\t// \tresourceOpts = append(resourceOpts, resource.WithZhiYanDataGrain(int(zhiyanConfig.GetDataGrain())))\n\t\t// }\n\t\t// if zhiyanConfig.GetDataType() != \"\" {\n\t\t// \tresourceOpts = append(resourceOpts, resource.WithZhiYanDataType(zhiyanConfig.GetDataType()))\n\t\t// }\n\n\t\t// Log ZhiYan configuration\n\t\tif zhiyanConfig.GetAppMark() != \"\" || zhiyanConfig.GetGlobalAppMark() != \"\" {\n\t\t\tlogrus.Infof(\"ZhiYan platform configured: app_mark=%s, global_app_mark=%s, env=%s, metric_group=%s\",\n\t\t\t\tzhiyanConfig.GetAppMark(), zhiyanConfig.GetGlobalAppMark(), zhiyanConfig.GetEnv(), zhiyanConfig.GetMetricGroup())\n\t\t}\n\t}\n\n\t// Create resource with K8s attributes\n\tres, err := resource.NewResource(resourceOpts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating resource: %w\", err)\n\t}\n\n\topts = append(opts, WithResource(res))\n\treturn opts, nil\n}\n\n// installResourceAttributesForMeter creates resource attributes for meter only\n// Uses WithMeterResource to avoid setting tracer options (tracer already initialized)\nfunc (c *completedConfig) installResourceAttributesForMeter(ctx context.Context) ([]OpenTelemetryServiceOption, error) {\n\tvar opts []OpenTelemetryServiceOption\n\n\tresourceConfig := c.Proto.GetResource()\n\n\t// Build resource options\n\tvar resourceOpts []resource.ResourceOption\n\n\t// Service name\n\tif resourceConfig.GetServiceName() != \"\" {\n\t\tresourceOpts = append(resourceOpts, resource.WithServiceName(resourceConfig.GetServiceName()))\n\t}\n\n\t// Custom attributes\n\tif len(resourceConfig.GetAttrs()) > 0 {\n\t\tresourceOpts = append(resourceOpts, resource.WithAttrs(resourceConfig.GetAttrs()))\n\t}\n\n\t// K8s attributes (enabled by default)\n\tresourceOpts = append(resourceOpts, resource.WithK8s(true))\n\n\t// Set meter type as Global for ZhiYan global_app_mark selection\n\tresourceOpts = append(resourceOpts, resource.WithMeterType(resource.MeterTypeGlobal))\n\n\t// ZhiYan platform configuration\n\tzhiyanConfig := resourceConfig.GetZhiyan()\n\tif zhiyanConfig != nil {\n\t\tif zhiyanConfig.GetAppMark() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanAppMark(zhiyanConfig.GetAppMark()))\n\t\t}\n\t\tif zhiyanConfig.GetGlobalAppMark() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanGlobalAppMark(zhiyanConfig.GetGlobalAppMark()))\n\t\t}\n\t\tif zhiyanConfig.GetEnv() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanEnv(zhiyanConfig.GetEnv()))\n\t\t}\n\t\tif zhiyanConfig.GetInstanceMark() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanInstanceMark(zhiyanConfig.GetInstanceMark()))\n\t\t}\n\t\tif zhiyanConfig.GetMetricGroup() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanMetricGroup(zhiyanConfig.GetMetricGroup()))\n\t\t}\n\t}\n\n\t// Create resource with K8s attributes\n\tres, err := resource.NewResource(resourceOpts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating resource: %w\", err)\n\t}\n\n\t// Use WithMeterResource instead of WithResource to avoid setting tracer options\n\topts = append(opts, WithMeterResource(res))\n\treturn opts, nil\n}\n\n// installMeterExporter configures the global meter exporter\nfunc (c *completedConfig) installMeterExporter(ctx context.Context) ([]OpenTelemetryServiceOption, error) {\n\n\tvar opts []OpenTelemetryServiceOption\n\tcollectDuration := c.Proto.GetMetricCollectDuration().AsDuration()\n\tif collectDuration > 0 {\n\t\topts = append(opts, WithMetricCollectDuration(collectDuration))\n\t}\n\n\tmetricType := c.Proto.OtelMetricExporterType\n\tlogrus.Infof(\"installMeter: metricType=%v (%s)\", metricType, metricType.String())\n\tswitch metricType {\n\tcase OtelMetricExporterType_metric_prometheus:\n\t\turlPath := c.Proto.GetOtelMetricExporter().GetPrometheus().GetUrl()\n\t\tif urlPath == \"\" {\n\t\t\turlPath = \"/metrics\"\n\t\t}\n\t\tbuilder := prometheus_.NewPrometheusExporterBuilder(\n\t\t\tprometheus_.WithMetricUrlPath(urlPath),\n\t\t)\n\t\topts = append(opts, WithMeterPullExporter(builder))\n\n\t\t// Register /metrics route if gin router is provided\n\t\tc.registerMetricsRoute(urlPath)\n\n\tcase OtelMetricExporterType_metric_stdout:\n\t\tbuilder := stdoutmetric_.NewStdoutExporterBuilder(\n\t\t\tstdoutmetric_.WithPrettyPrint(c.Proto.GetOtelMetricExporter().GetStdout().GetPrettyPrint()),\n\t\t)\n\t\topts = append(opts, WithMeterPushExporter(builder))\n\n\tcase OtelMetricExporterType_metric_otlp:\n\t\totlpConfig := c.Proto.GetOtelMetricExporter().GetOtlp()\n\t\tvar otlpOpts []otlpmetric_.OTLPExporterBuilderOption\n\n\t\tif otlpConfig.GetEndpoint() != \"\" {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithEndpoint(otlpConfig.GetEndpoint()))\n\t\t}\n\n\t\t// Set protocol\n\t\tprotocol := otlpConfig.GetProtocol()\n\t\tif protocol == \"grpc\" {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithProtocol(otlpmetric_.ProtocolGRPC))\n\t\t} else {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithProtocol(otlpmetric_.ProtocolHTTP))\n\t\t}\n\n\t\t// Set insecure\n\t\totlpOpts = append(otlpOpts, otlpmetric_.WithInsecure(otlpConfig.GetInsecure()))\n\n\t\t// Set URL path for HTTP\n\t\tif otlpConfig.GetUrlPath() != \"\" {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithURLPath(otlpConfig.GetUrlPath()))\n\t\t}\n\n\t\t// Set compression (gzip)\n\t\tcompression := otlpConfig.GetCompression()\n\t\totlpOpts = append(otlpOpts, otlpmetric_.WithCompression(compression))\n\t\tlogrus.Debugf(\"OTLP config: compression=%v (from config)\", compression)\n\n\t\t// Set temporality (Delta for ZhiYan)\n\t\ttemporalityDelta := otlpConfig.GetTemporalityDelta()\n\t\totlpOpts = append(otlpOpts, otlpmetric_.WithTemporalityDelta(temporalityDelta))\n\t\tlogrus.Debugf(\"OTLP config: temporality_delta=%v (from config)\", temporalityDelta)\n\n\t\t// Set headers (including token)\n\t\theaders := make(map[string]string)\n\t\tfor k, v := range otlpConfig.GetHeaders() {\n\t\t\theaders[k] = v\n\t\t}\n\t\tif otlpConfig.GetToken() != \"\" {\n\t\t\theaders[\"Authorization\"] = \"Bearer \" + otlpConfig.GetToken()\n\t\t}\n\t\tif len(headers) > 0 {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithHeaders(headers))\n\t\t}\n\n\t\tbuilder := otlpmetric_.NewOTLPExporterBuilder(otlpOpts...)\n\t\topts = append(opts, WithMeterPushExporter(builder))\n\t\t// Enable export logging for OTLP exporter\n\t\topts = append(opts, WithMeterExporterLogging(\"OTLP\", otlpConfig.GetEndpoint()))\n\t\tlogrus.Infof(\"OTLP metric exporter configured: endpoint=%s, protocol=%s, insecure=%v, compression=%v, temporality_delta=%v\",\n\t\t\totlpConfig.GetEndpoint(), otlpConfig.GetProtocol(), otlpConfig.GetInsecure(),\n\t\t\totlpConfig.GetCompression(), otlpConfig.GetTemporalityDelta())\n\n\tcase OtelMetricExporterType_metric_none:\n\t\t// not enable metric\n\t\treturn nil, nil\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"not support the metricType[%v]\", metricType.String())\n\n\t}\n\n\treturn opts, nil\n}\n\n// installAppMeter installs the App MeterProvider (separate from global)\n// installAppMeterExporter configures the App MeterProvider exporter (separate from global)\nfunc (c *completedConfig) installAppMeterExporter(ctx context.Context) ([]OpenTelemetryServiceOption, error) {\n\tappConfig := c.Proto.GetAppMeterProvider()\n\tif appConfig == nil || !appConfig.GetEnabled() {\n\t\treturn nil, nil\n\t}\n\n\tvar opts []OpenTelemetryServiceOption\n\n\t// Set collect duration\n\tcollectDuration := appConfig.GetCollectDuration().AsDuration()\n\tif collectDuration > 0 {\n\t\topts = append(opts, WithAppMetricCollectDuration(collectDuration))\n\t} else if c.Proto.GetMetricCollectDuration().AsDuration() > 0 {\n\t\t// Fallback to global collect duration\n\t\topts = append(opts, WithAppMetricCollectDuration(c.Proto.GetMetricCollectDuration().AsDuration()))\n\t}\n\n\t// Set resource for app meter\n\tappResource := appConfig.GetResource()\n\tglobalResource := c.Proto.GetResource()\n\n\tvar resourceOpts []resource.ResourceOption\n\n\t// Service name\n\tif appResource != nil && appResource.GetServiceName() != \"\" {\n\t\tresourceOpts = append(resourceOpts, resource.WithServiceName(appResource.GetServiceName()))\n\t} else if globalResource.GetServiceName() != \"\" {\n\t\tresourceOpts = append(resourceOpts, resource.WithServiceName(globalResource.GetServiceName()))\n\t}\n\n\t// Custom attributes\n\tif appResource != nil && len(appResource.GetAttrs()) > 0 {\n\t\tresourceOpts = append(resourceOpts, resource.WithAttrs(appResource.GetAttrs()))\n\t}\n\n\t// K8s attributes\n\tresourceOpts = append(resourceOpts, resource.WithK8s(true))\n\n\t// Set meter type as App for ZhiYan app mark selection\n\tresourceOpts = append(resourceOpts, resource.WithMeterType(resource.MeterTypeApp))\n\n\t// ZhiYan configuration from global resource (for App MeterProvider)\n\tzhiyanConfig := globalResource.GetZhiyan()\n\tif zhiyanConfig != nil {\n\t\tif zhiyanConfig.GetAppMark() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanAppMark(zhiyanConfig.GetAppMark()))\n\t\t}\n\t\tif zhiyanConfig.GetEnv() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanEnv(zhiyanConfig.GetEnv()))\n\t\t}\n\t\tif zhiyanConfig.GetInstanceMark() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanInstanceMark(zhiyanConfig.GetInstanceMark()))\n\t\t}\n\t\tif zhiyanConfig.GetExpandKey() != \"\" {\n\t\t\tresourceOpts = append(resourceOpts, resource.WithZhiYanExpandKey(zhiyanConfig.GetExpandKey()))\n\t\t}\n\t}\n\n\tres, err := resource.NewResource(resourceOpts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating app resource: %w\", err)\n\t}\n\topts = append(opts, WithAppMeterResource(res))\n\n\t// Determine exporter type (use app-specific or fallback to global)\n\texporterType := appConfig.GetExporterType()\n\tif exporterType == OtelMetricExporterType_metric_none {\n\t\texporterType = c.Proto.OtelMetricExporterType\n\t}\n\n\t// Get exporter config (use app-specific or fallback to global)\n\texporterConfig := appConfig.GetExporter()\n\tif exporterConfig == nil {\n\t\texporterConfig = c.Proto.GetOtelMetricExporter()\n\t}\n\n\tswitch exporterType {\n\tcase OtelMetricExporterType_metric_prometheus:\n\t\tbuilder := prometheus_.NewPrometheusExporterBuilder(\n\t\t\tprometheus_.WithMetricUrlPath(exporterConfig.GetPrometheus().GetUrl()),\n\t\t)\n\t\topts = append(opts, WithAppMeterPullExporter(builder))\n\n\tcase OtelMetricExporterType_metric_stdout:\n\t\tbuilder := stdoutmetric_.NewStdoutExporterBuilder(\n\t\t\tstdoutmetric_.WithPrettyPrint(exporterConfig.GetStdout().GetPrettyPrint()),\n\t\t)\n\t\topts = append(opts, WithAppMeterPushExporter(builder))\n\n\tcase OtelMetricExporterType_metric_otlp:\n\t\totlpConfig := exporterConfig.GetOtlp()\n\t\tvar otlpOpts []otlpmetric_.OTLPExporterBuilderOption\n\n\t\tif otlpConfig.GetEndpoint() != \"\" {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithEndpoint(otlpConfig.GetEndpoint()))\n\t\t}\n\n\t\tprotocol := otlpConfig.GetProtocol()\n\t\tif protocol == \"grpc\" {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithProtocol(otlpmetric_.ProtocolGRPC))\n\t\t} else {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithProtocol(otlpmetric_.ProtocolHTTP))\n\t\t}\n\n\t\totlpOpts = append(otlpOpts, otlpmetric_.WithInsecure(otlpConfig.GetInsecure()))\n\n\t\tif otlpConfig.GetUrlPath() != \"\" {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithURLPath(otlpConfig.GetUrlPath()))\n\t\t}\n\n\t\theaders := make(map[string]string)\n\t\tfor k, v := range otlpConfig.GetHeaders() {\n\t\t\theaders[k] = v\n\t\t}\n\t\tif otlpConfig.GetToken() != \"\" {\n\t\t\theaders[\"Authorization\"] = \"Bearer \" + otlpConfig.GetToken()\n\t\t}\n\t\tif len(headers) > 0 {\n\t\t\totlpOpts = append(otlpOpts, otlpmetric_.WithHeaders(headers))\n\t\t}\n\n\t\tbuilder := otlpmetric_.NewOTLPExporterBuilder(otlpOpts...)\n\t\topts = append(opts, WithAppMeterPushExporter(builder))\n\t\t// Enable export logging for App OTLP exporter\n\t\topts = append(opts, WithAppMeterExporterLogging(\"AppOTLP\", otlpConfig.GetEndpoint()))\n\n\tcase OtelMetricExporterType_metric_none:\n\t\treturn nil, nil\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"app meter: not support the metricType[%v]\", exporterType.String())\n\t}\n\n\tlogrus.Infof(\"App MeterProvider configured with exporter type: %s\", exporterType.String())\n\treturn opts, nil\n}\n\n// installTracerExporter configures the tracer exporter\nfunc (c *completedConfig) installTracerExporter(ctx context.Context) ([]OpenTelemetryServiceOption, error) {\n\n\tvar opts []OpenTelemetryServiceOption\n\ttracerType := c.Proto.OtelTraceExporterType\n\tlogrus.Infof(\"installTracerExporter: tracerType=%s (%s)\", tracerType.String(), tracerType)\n\n\tswitch tracerType {\n\tcase OtelTraceExporterType_trace_stdout:\n\t\tprettyPrint := c.Proto.GetOtelTraceExporter().GetStdout().GetPrettyPrint()\n\t\tbuilder := stdouttrace_.NewStdoutExporterBuilder(\n\t\t\tstdouttrace_.WithPrettyPrint(prettyPrint),\n\t\t)\n\t\topts = append(opts, WithTracerExporter(builder))\n\t\tlogrus.Infof(\"Stdout trace exporter configured: pretty_print=%v\", prettyPrint)\n\n\tcase OtelTraceExporterType_trace_otlp:\n\t\totlpConfig := c.Proto.GetOtelTraceExporter().GetOtlp()\n\t\tvar otlpOpts []otlptrace_.OTLPTraceExporterBuilderOption\n\n\t\tif otlpConfig.GetEndpoint() != \"\" {\n\t\t\totlpOpts = append(otlpOpts, otlptrace_.WithEndpoint(otlpConfig.GetEndpoint()))\n\t\t}\n\n\t\t// Set protocol\n\t\tprotocol := otlpConfig.GetProtocol()\n\t\tif protocol == \"grpc\" {\n\t\t\totlpOpts = append(otlpOpts, otlptrace_.WithProtocol(otlptrace_.ProtocolGRPC))\n\t\t} else {\n\t\t\totlpOpts = append(otlpOpts, otlptrace_.WithProtocol(otlptrace_.ProtocolHTTP))\n\t\t}\n\n\t\t// Set insecure\n\t\totlpOpts = append(otlpOpts, otlptrace_.WithInsecure(otlpConfig.GetInsecure()))\n\n\t\t// Set URL path for HTTP (default: /v1/traces)\n\t\tif otlpConfig.GetUrlPath() != \"\" {\n\t\t\totlpOpts = append(otlpOpts, otlptrace_.WithURLPath(otlpConfig.GetUrlPath()))\n\t\t}\n\n\t\t// Set headers (including token)\n\t\theaders := make(map[string]string)\n\t\tfor k, v := range otlpConfig.GetHeaders() {\n\t\t\theaders[k] = v\n\t\t}\n\t\tif otlpConfig.GetToken() != \"\" {\n\t\t\theaders[\"Authorization\"] = \"Bearer \" + otlpConfig.GetToken()\n\t\t}\n\t\tif len(headers) > 0 {\n\t\t\totlpOpts = append(otlpOpts, otlptrace_.WithHeaders(headers))\n\t\t}\n\n\t\tbuilder := otlptrace_.NewOTLPTraceExporterBuilder(otlpOpts...)\n\t\topts = append(opts, WithTracerExporter(builder))\n\t\t// Enable export logging for OTLP trace exporter\n\t\topts = append(opts, WithTracerExporterLogging(\"OTLP\", otlpConfig.GetEndpoint()))\n\t\tlogrus.Infof(\"OTLP trace exporter configured: endpoint=%s, protocol=%s, insecure=%v, url_path=%s\",\n\t\t\totlpConfig.GetEndpoint(), otlpConfig.GetProtocol(), otlpConfig.GetInsecure(), otlpConfig.GetUrlPath())\n\n\tcase OtelTraceExporterType_trace_none:\n\t\tlogrus.Infof(\"Trace exporter disabled (trace_none)\")\n\t\treturn nil, nil\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"not support the tracerType[%v]\", tracerType.String())\n\t}\n\n\treturn opts, nil\n}\n\n// installResourceStats installs the resource stats service for monitoring\nfunc (c *completedConfig) installResourceStats(ctx context.Context) (*resource.ResourceStatsService, error) {\n\n\tvar opts []resource.ResourceStatsServiceOption\n\tcollectDuration := c.Proto.GetMetricCollectDuration().AsDuration()\n\tif collectDuration > 0 {\n\t\topts = append(opts, resource.WithStatsCheckInterval(collectDuration))\n\t}\n\topts = append(opts, c.opts.resourceStatsServiceOptions...)\n\n\tstatsServer, err := resource.NewResourceStatsService(opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstatsServer.Run(ctx)\n\n\treturn statsServer, nil\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n\n// registerMetricsRoute registers /metrics endpoint to gin router if provided.\nfunc (c *completedConfig) registerMetricsRoute(urlPath string) {\n\tif c.opts.ginRouter == nil {\n\t\tlogrus.Warnf(\"Prometheus exporter enabled but no gin router provided, /metrics endpoint will not be registered. Use WithGinRouter() option to enable automatic registration.\")\n\t\treturn\n\t}\n\n\tc.opts.ginRouter.GET(urlPath, gin.WrapH(prometheus_.GetMetricsHandler()))\n\tlogrus.Infof(\"Registered Prometheus metrics handler at %s\", urlPath)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage opentelemetry\n\nimport (\n\t\"github.com/gin-gonic/gin\"\n\t\"github.com/kaydxh/golang/pkg/opentelemetry/resource\"\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n\nfunc WithMemoryCallBack(f func(total, free uint64, usage float64)) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.resourceStatsServiceOptions = append(c.opts.resourceStatsServiceOptions, resource.WithMemoryCallBack(f))\n\t})\n}\n\n// WithGinRouter sets the gin router for registering /metrics endpoint.\n// When set, the /metrics route will be automatically registered when using prometheus exporter.\nfunc WithGinRouter(router gin.IRouter) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.ginRouter = router\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage opentelemetry\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/opentelemetry/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/opentelemetry\n\ngo 1.25.3\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nreplace github.com/kaydxh/golang/pkg/middleware => ../middleware\n\nreplace github.com/kaydxh/golang/pkg/webserver => ../webserver\n\nreplace github.com/kaydxh/golang/pkg/logs => ../logs\n\nrequire (\n\tgithub.com/gin-gonic/gin v1.11.0\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/middleware v0.0.0-00010101000000-000000000000\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/webserver v0.0.0-00010101000000-000000000000\n\tgithub.com/prometheus/client_golang v1.23.2\n\tgithub.com/shirou/gopsutil v3.21.11+incompatible\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgo.opentelemetry.io/otel v1.38.0\n\tgo.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0\n\tgo.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0\n\tgo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0\n\tgo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0\n\tgo.opentelemetry.io/otel/exporters/prometheus v0.50.0\n\tgo.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0\n\tgo.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0\n\tgo.opentelemetry.io/otel/metric v1.38.0\n\tgo.opentelemetry.io/otel/sdk v1.38.0\n\tgo.opentelemetry.io/otel/sdk/metric v1.38.0\n\tgo.opentelemetry.io/otel/trace v1.38.0\n\tgolang.org/x/net v0.48.0\n\tgoogle.golang.org/grpc v1.77.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect\n\tgithub.com/beorn7/perks v1.0.1 // indirect\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cenkalti/backoff/v4 v4.3.0 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-contrib/sse v1.1.0 // indirect\n\tgithub.com/go-logr/logr v1.4.3 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/go-ole/go-ole v1.2.6 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/golang/protobuf v1.5.4 // indirect\n\tgithub.com/google/uuid v1.6.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/inconshreveable/mousetrap v1.1.0 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-20251125160242-e06b25c89946 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/mattn/go-isatty v0.0.20 // indirect\n\tgithub.com/moby/term v0.5.2 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/prometheus/client_model v0.6.2 // indirect\n\tgithub.com/prometheus/common v0.66.1 // indirect\n\tgithub.com/prometheus/procfs v0.17.0 // indirect\n\tgithub.com/quic-go/qpack v0.5.1 // indirect\n\tgithub.com/quic-go/quic-go v0.54.0 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/cobra v1.10.1 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgithub.com/yusufpapurcu/wmi v1.2.4 // indirect\n\tgo.opentelemetry.io/auto/sdk v1.2.1 // indirect\n\tgo.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect\n\tgo.opentelemetry.io/proto/otlp v1.3.1 // indirect\n\tgo.uber.org/mock v0.5.0 // indirect\n\tgo.yaml.in/yaml/v2 v2.4.2 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/mod v0.30.0 // indirect\n\tgolang.org/x/sync v0.19.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgolang.org/x/tools v0.39.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n)\n"
  },
  {
    "path": "pkg/opentelemetry/go.sum",
    "content": "github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=\ngithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=\ngithub.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=\ngithub.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=\ngithub.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=\ngithub.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=\ngithub.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=\ngithub.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=\ngithub.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=\ngithub.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4=\ngithub.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=\ngithub.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=\ngithub.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=\ngithub.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=\ngithub.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=\ngithub.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=\ngithub.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=\ngithub.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=\ngithub.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=\ngithub.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=\ngithub.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=\ngithub.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=\ngithub.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=\ngithub.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=\ngithub.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=\ngithub.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=\ngithub.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg=\ngithub.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=\ngithub.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=\ngithub.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=\ngo.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 h1:U2guen0GhqH8o/G2un8f/aG/y++OuW6MyCo6hT9prXk=\ngo.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0/go.mod h1:yeGZANgEcpdx/WK0IvvRFC+2oLiMS2u4L/0Rj2M2Qr0=\ngo.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0 h1:aLmmtjRke7LPDQ3lvpFz+kNEH43faFhzW7v8BFIEydg=\ngo.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0/go.mod h1:TC1pyCt6G9Sjb4bQpShH+P5R53pO6ZuGnHuuln9xMeE=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 h1:j9+03ymgYhPKmeXGk5Zu+cIZOlVzd9Zv7QIiyItjFBU=\ngo.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0/go.mod h1:Y5+XiUG4Emn1hTfciPzGPJaSI+RpDts6BnCIir0SLqk=\ngo.opentelemetry.io/otel/exporters/prometheus v0.50.0 h1:2Ewsda6hejmbhGFyUvWZjUThC98Cf8Zy6g0zkIimOng=\ngo.opentelemetry.io/otel/exporters/prometheus v0.50.0/go.mod h1:pMm5PkUo5YwbLiuEf7t2xg4wbP0/eSJrMxIMxKosynY=\ngo.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 h1:BJee2iLkfRfl9lc7aFmBwkWxY/RI1RDdXepSF6y8TPE=\ngo.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0/go.mod h1:DIzlHs3DRscCIBU3Y9YSzPfScwnYnzfnCd4g8zA7bZc=\ngo.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ=\ngo.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=\ngo.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=\ngo.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=\ngo.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=\ngo.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=\ngo.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=\ngo.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=\ngo.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=\ngo.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=\ngolang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=\ngolang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=\ngolang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=\ngolang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=\ngolang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngolang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=\ngolang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\n"
  },
  {
    "path": "pkg/opentelemetry/metric/api/api.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage api\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"sync\"\n\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\totelmetric \"go.opentelemetry.io/otel/metric\"\n\t\"go.opentelemetry.io/otel/metric/noop\"\n)\n\n// Default histogram bounds for common use cases\nvar (\n\t// DefaultDurationBounds for latency in milliseconds\n\tDefaultDurationBounds = []float64{1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000}\n\t// DefaultSizeBounds for size in bytes\n\tDefaultSizeBounds = []float64{100, 1000, 10000, 100000, 1000000, 10000000}\n)\n\nvar (\n\tappMeterProvider   otelmetric.MeterProvider\n\tappMeterProviderMu sync.RWMutex\n\n\tcounterCache   = &instrumentCache[otelmetric.Int64Counter]{cache: make(map[string]otelmetric.Int64Counter)}\n\thistogramCache = &instrumentCache[otelmetric.Float64Histogram]{cache: make(map[string]otelmetric.Float64Histogram)}\n)\n\n// instrumentCache is a generic cache for metric instruments\ntype instrumentCache[T any] struct {\n\tcache map[string]T\n\tmu    sync.RWMutex\n}\n\nfunc (c *instrumentCache[T]) get(key string) (T, bool) {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\tv, ok := c.cache[key]\n\treturn v, ok\n}\n\nfunc (c *instrumentCache[T]) set(key string, v T) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tc.cache[key] = v\n}\n\n// SetAppMeterProvider sets the application-level MeterProvider\n// This allows separation between global infrastructure metrics and application metrics\nfunc SetAppMeterProvider(mp otelmetric.MeterProvider) {\n\tappMeterProviderMu.Lock()\n\tdefer appMeterProviderMu.Unlock()\n\tappMeterProvider = mp\n}\n\n// GetAppMeterProvider returns the application-level MeterProvider\n// Falls back to global MeterProvider if not set\nfunc GetAppMeterProvider() otelmetric.MeterProvider {\n\tappMeterProviderMu.RLock()\n\tdefer appMeterProviderMu.RUnlock()\n\tif appMeterProvider != nil {\n\t\treturn appMeterProvider\n\t}\n\treturn otel.GetMeterProvider()\n}\n\n// attributeContextKey is used to store attributes in context\ntype attributeContextKey struct {\n\tmeterName string\n}\n\n// WithAttribute adds a custom attribute to the context for a specific meter\n// value supports string, int, float, bool types\nfunc WithAttribute(ctx context.Context, meterName, key string, value any) context.Context {\n\tattrs := getContextAttributes(ctx, meterName)\n\tif attrs == nil {\n\t\tattrs = make(map[string]attribute.KeyValue)\n\t} else {\n\t\t// Copy to avoid mutation\n\t\tnewAttrs := make(map[string]attribute.KeyValue, len(attrs)+1)\n\t\tfor k, v := range attrs {\n\t\t\tnewAttrs[k] = v\n\t\t}\n\t\tattrs = newAttrs\n\t}\n\tattrs[key] = ToAttribute(key, value)\n\treturn context.WithValue(ctx, attributeContextKey{meterName: meterName}, attrs)\n}\n\n// WithAttributes adds multiple custom attributes to the context for a specific meter\nfunc WithAttributes(ctx context.Context, meterName string, kvs map[string]any) context.Context {\n\tattrs := getContextAttributes(ctx, meterName)\n\tif attrs == nil {\n\t\tattrs = make(map[string]attribute.KeyValue, len(kvs))\n\t} else {\n\t\t// Copy to avoid mutation\n\t\tnewAttrs := make(map[string]attribute.KeyValue, len(attrs)+len(kvs))\n\t\tfor k, v := range attrs {\n\t\t\tnewAttrs[k] = v\n\t\t}\n\t\tattrs = newAttrs\n\t}\n\tfor k, v := range kvs {\n\t\tattrs[k] = ToAttribute(k, v)\n\t}\n\treturn context.WithValue(ctx, attributeContextKey{meterName: meterName}, attrs)\n}\n\n// getContextAttributes retrieves attributes from context for a specific meter\nfunc getContextAttributes(ctx context.Context, meterName string) map[string]attribute.KeyValue {\n\tif attrs, ok := ctx.Value(attributeContextKey{meterName: meterName}).(map[string]attribute.KeyValue); ok {\n\t\treturn attrs\n\t}\n\treturn nil\n}\n\n// getAttributeSlice converts context attributes to a slice\nfunc getAttributeSlice(ctx context.Context, meterName string) []attribute.KeyValue {\n\tattrs := getContextAttributes(ctx, meterName)\n\tif len(attrs) == 0 {\n\t\treturn nil\n\t}\n\tresult := make([]attribute.KeyValue, 0, len(attrs))\n\tfor _, kv := range attrs {\n\t\tresult = append(result, kv)\n\t}\n\treturn result\n}\n\n// ToAttribute converts a value to an attribute.KeyValue\nfunc ToAttribute(key string, value any) attribute.KeyValue {\n\tswitch v := value.(type) {\n\tcase string:\n\t\treturn attribute.String(key, v)\n\tcase int:\n\t\treturn attribute.Int(key, v)\n\tcase int64:\n\t\treturn attribute.Int64(key, v)\n\tcase float64:\n\t\treturn attribute.Float64(key, v)\n\tcase bool:\n\t\treturn attribute.Bool(key, v)\n\tcase int8:\n\t\treturn attribute.Int64(key, int64(v))\n\tcase int16:\n\t\treturn attribute.Int64(key, int64(v))\n\tcase int32:\n\t\treturn attribute.Int64(key, int64(v))\n\tcase uint:\n\t\treturn attribute.Int64(key, int64(v))\n\tcase uint8:\n\t\treturn attribute.Int64(key, int64(v))\n\tcase uint16:\n\t\treturn attribute.Int64(key, int64(v))\n\tcase uint32:\n\t\treturn attribute.Int64(key, int64(v))\n\tcase uint64:\n\t\treturn attribute.Int64(key, int64(v))\n\tcase float32:\n\t\treturn attribute.Float64(key, float64(v))\n\tdefault:\n\t\treturn attribute.String(key, fmt.Sprintf(\"%v\", v))\n\t}\n}\n\n// ToAttributeString converts a value to string for attribute\nfunc ToAttributeString(value any) string {\n\tswitch v := value.(type) {\n\tcase string:\n\t\treturn v\n\tcase int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:\n\t\treturn fmt.Sprintf(\"%d\", v)\n\tcase float32, float64:\n\t\treturn fmt.Sprintf(\"%g\", v)\n\tcase bool:\n\t\treturn strconv.FormatBool(v)\n\tdefault:\n\t\treturn fmt.Sprintf(\"%v\", v)\n\t}\n}\n\n// getCounter retrieves or creates a counter instrument\nfunc getCounter(meterName, instrumentName string, provider otelmetric.MeterProvider) otelmetric.Int64Counter {\n\tkey := fmt.Sprintf(\"%s_%s\", meterName, instrumentName)\n\n\tif counter, ok := counterCache.get(key); ok {\n\t\treturn counter\n\t}\n\n\tmeter := provider.Meter(meterName)\n\tcounter, err := meter.Int64Counter(instrumentName)\n\tif err != nil {\n\t\totel.Handle(err)\n\t\treturn noop.Int64Counter{}\n\t}\n\n\tcounterCache.set(key, counter)\n\treturn counter\n}\n\n// getHistogram retrieves or creates a histogram instrument\nfunc getHistogram(meterName, instrumentName string, bounds []float64, provider otelmetric.MeterProvider) otelmetric.Float64Histogram {\n\tkey := fmt.Sprintf(\"%s_%s\", meterName, instrumentName)\n\n\tif histogram, ok := histogramCache.get(key); ok {\n\t\treturn histogram\n\t}\n\n\tmeter := provider.Meter(meterName)\n\tvar opts []otelmetric.Float64HistogramOption\n\tif len(bounds) > 0 {\n\t\topts = append(opts, otelmetric.WithExplicitBucketBoundaries(bounds...))\n\t}\n\thistogram, err := meter.Float64Histogram(instrumentName, opts...)\n\tif err != nil {\n\t\totel.Handle(err)\n\t\treturn noop.Float64Histogram{}\n\t}\n\n\thistogramCache.set(key, histogram)\n\treturn histogram\n}\n\n// ========================================\n// Application-level Metric APIs (使用 App MeterProvider)\n// ========================================\n\n// AddCounter reports a counter value to the application MeterProvider\n// meterName: metric group name\n// instrumentName: metric name\n// value: counter value to add\nfunc AddCounter(ctx context.Context, meterName, instrumentName string, value int64) {\n\tcounter := getCounter(meterName, instrumentName, GetAppMeterProvider())\n\tattrs := getAttributeSlice(ctx, meterName)\n\tcounter.Add(ctx, value, otelmetric.WithAttributes(attrs...))\n}\n\n// IncrCounter increments a counter by 1 to the application MeterProvider\n// meterName: metric group name\n// instrumentName: metric name\nfunc IncrCounter(ctx context.Context, meterName, instrumentName string) {\n\tAddCounter(ctx, meterName, instrumentName, 1)\n}\n\n// RecordHistogram records a histogram value to the application MeterProvider\n// meterName: metric group name\n// instrumentName: metric name\n// value: histogram value to record\n// bounds: histogram bucket boundaries (use nil for default)\nfunc RecordHistogram(ctx context.Context, meterName, instrumentName string, value float64, bounds []float64) {\n\tif bounds == nil {\n\t\tbounds = DefaultDurationBounds\n\t}\n\thistogram := getHistogram(meterName, instrumentName, bounds, GetAppMeterProvider())\n\tattrs := getAttributeSlice(ctx, meterName)\n\thistogram.Record(ctx, value, otelmetric.WithAttributes(attrs...))\n}\n\n// RecordDuration records a duration value (in milliseconds) with default duration bounds\nfunc RecordDuration(ctx context.Context, meterName, instrumentName string, durationMs float64) {\n\tRecordHistogram(ctx, meterName, instrumentName, durationMs, DefaultDurationBounds)\n}\n\n// ========================================\n// Global-level Metric APIs (使用 Global MeterProvider)\n// ========================================\n\n// GlobalAddCounter reports a counter value to the global MeterProvider\n// meterName: metric group name\n// instrumentName: metric name\n// value: counter value to add\nfunc GlobalAddCounter(ctx context.Context, meterName, instrumentName string, value int64) {\n\tcounter := getCounter(meterName, instrumentName, otel.GetMeterProvider())\n\tattrs := getAttributeSlice(ctx, meterName)\n\tcounter.Add(ctx, value, otelmetric.WithAttributes(attrs...))\n}\n\n// GlobalIncrCounter increments a counter by 1 to the global MeterProvider\n// meterName: metric group name\n// instrumentName: metric name\nfunc GlobalIncrCounter(ctx context.Context, meterName, instrumentName string) {\n\tGlobalAddCounter(ctx, meterName, instrumentName, 1)\n}\n\n// GlobalRecordHistogram records a histogram value to the global MeterProvider\n// meterName: metric group name\n// instrumentName: metric name\n// value: histogram value to record\n// bounds: histogram bucket boundaries (use nil for default)\nfunc GlobalRecordHistogram(ctx context.Context, meterName, instrumentName string, value float64, bounds []float64) {\n\tif bounds == nil {\n\t\tbounds = DefaultDurationBounds\n\t}\n\thistogram := getHistogram(meterName, instrumentName, bounds, otel.GetMeterProvider())\n\tattrs := getAttributeSlice(ctx, meterName)\n\thistogram.Record(ctx, value, otelmetric.WithAttributes(attrs...))\n}\n\n// GlobalRecordDuration records a duration value (in milliseconds) with default duration bounds\nfunc GlobalRecordDuration(ctx context.Context, meterName, instrumentName string, durationMs float64) {\n\tGlobalRecordHistogram(ctx, meterName, instrumentName, durationMs, DefaultDurationBounds)\n}\n\n// ========================================\n// Convenient APIs with attributes (直接传入属性，不依赖 context)\n// ========================================\n\n// AddCounterWithAttrs reports a counter value with explicit attributes\nfunc AddCounterWithAttrs(ctx context.Context, meterName, instrumentName string, value int64, attrs ...attribute.KeyValue) {\n\tcounter := getCounter(meterName, instrumentName, GetAppMeterProvider())\n\tcounter.Add(ctx, value, otelmetric.WithAttributes(attrs...))\n}\n\n// IncrCounterWithAttrs increments a counter by 1 with explicit attributes\nfunc IncrCounterWithAttrs(ctx context.Context, meterName, instrumentName string, attrs ...attribute.KeyValue) {\n\tAddCounterWithAttrs(ctx, meterName, instrumentName, 1, attrs...)\n}\n\n// RecordHistogramWithAttrs records a histogram value with explicit attributes\nfunc RecordHistogramWithAttrs(ctx context.Context, meterName, instrumentName string, value float64, bounds []float64, attrs ...attribute.KeyValue) {\n\tif bounds == nil {\n\t\tbounds = DefaultDurationBounds\n\t}\n\thistogram := getHistogram(meterName, instrumentName, bounds, GetAppMeterProvider())\n\thistogram.Record(ctx, value, otelmetric.WithAttributes(attrs...))\n}\n\n// RecordDurationWithAttrs records a duration value with explicit attributes\nfunc RecordDurationWithAttrs(ctx context.Context, meterName, instrumentName string, durationMs float64, attrs ...attribute.KeyValue) {\n\tRecordHistogramWithAttrs(ctx, meterName, instrumentName, durationMs, DefaultDurationBounds, attrs...)\n}\n\n// GlobalAddCounterWithAttrs reports a counter value with explicit attributes to global provider\nfunc GlobalAddCounterWithAttrs(ctx context.Context, meterName, instrumentName string, value int64, attrs ...attribute.KeyValue) {\n\tcounter := getCounter(meterName, instrumentName, otel.GetMeterProvider())\n\tcounter.Add(ctx, value, otelmetric.WithAttributes(attrs...))\n}\n\n// GlobalIncrCounterWithAttrs increments a counter by 1 with explicit attributes to global provider\nfunc GlobalIncrCounterWithAttrs(ctx context.Context, meterName, instrumentName string, attrs ...attribute.KeyValue) {\n\tGlobalAddCounterWithAttrs(ctx, meterName, instrumentName, 1, attrs...)\n}\n\n// GlobalRecordHistogramWithAttrs records a histogram value with explicit attributes to global provider\nfunc GlobalRecordHistogramWithAttrs(ctx context.Context, meterName, instrumentName string, value float64, bounds []float64, attrs ...attribute.KeyValue) {\n\tif bounds == nil {\n\t\tbounds = DefaultDurationBounds\n\t}\n\thistogram := getHistogram(meterName, instrumentName, bounds, otel.GetMeterProvider())\n\thistogram.Record(ctx, value, otelmetric.WithAttributes(attrs...))\n}\n\n// GlobalRecordDurationWithAttrs records a duration value with explicit attributes to global provider\nfunc GlobalRecordDurationWithAttrs(ctx context.Context, meterName, instrumentName string, durationMs float64, attrs ...attribute.KeyValue) {\n\tGlobalRecordHistogramWithAttrs(ctx, meterName, instrumentName, durationMs, DefaultDurationBounds, attrs...)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/api/example_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage api_test\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/kaydxh/golang/pkg/opentelemetry/metric/api\"\n\t\"go.opentelemetry.io/otel/attribute\"\n)\n\nfunc Example_simpleCounter() {\n\tctx := context.Background()\n\n\t// Method 1: Using context attributes\n\tctx = api.WithAttribute(ctx, \"my_app\", \"user_id\", \"12345\")\n\tctx = api.WithAttribute(ctx, \"my_app\", \"action\", \"login\")\n\tapi.IncrCounter(ctx, \"my_app\", \"user_actions\")\n\n\t// Method 2: Using explicit attributes\n\tapi.IncrCounterWithAttrs(ctx, \"my_app\", \"requests\",\n\t\tattribute.String(\"endpoint\", \"/api/v1/users\"),\n\t\tattribute.Int(\"status\", 200),\n\t)\n\n\t// Method 3: Using Instrument object\n\tcounter := api.NewCounter(\"my_app\", \"api_calls\")\n\tcounter.SetAttribute(\"service\", \"user-service\")\n\tcounter.Incr(ctx)\n\n\t// Method 4: Chaining with With\n\tcounter.With(\"method\", \"GET\").With(\"path\", \"/users\").Incr(ctx)\n}\n\nfunc Example_histogram() {\n\tctx := context.Background()\n\n\t// Record latency with context attributes\n\tctx = api.WithAttribute(ctx, \"latency\", \"endpoint\", \"/api/v1/query\")\n\tapi.RecordDuration(ctx, \"latency\", \"request_duration\", 125.5)\n\n\t// Record with explicit attributes\n\tapi.RecordDurationWithAttrs(ctx, \"latency\", \"db_query_duration\", 45.2,\n\t\tattribute.String(\"table\", \"users\"),\n\t\tattribute.String(\"operation\", \"select\"),\n\t)\n\n\t// Using Histogram object\n\thistogram := api.NewHistogram(\"latency\", \"processing_time\",\n\t\tapi.WithBounds([]float64{10, 50, 100, 500, 1000}),\n\t)\n\thistogram.SetAttribute(\"processor\", \"image\")\n\thistogram.Record(ctx, 234.5)\n}\n\nfunc Example_timer() {\n\tctx := context.Background()\n\n\t// Create a timer for measuring operation duration\n\ttimer := api.NewTimer(\"performance\", \"operation_duration\")\n\ttimer.SetAttribute(\"operation\", \"data_processing\")\n\n\tstart := time.Now()\n\t// ... do some work ...\n\t_ = start // simulate work\n\n\t// Record the duration\n\telapsed := float64(time.Since(start).Milliseconds())\n\ttimer.Record(ctx, elapsed)\n\n\t// With chaining for different operations\n\ttimer.With(\"operation\", \"file_upload\").Record(ctx, 150.0)\n\ttimer.With(\"operation\", \"database_write\").Record(ctx, 25.5)\n}\n\nfunc Example_globalVsApp() {\n\tctx := context.Background()\n\n\t// Global metrics (infrastructure level)\n\tapi.GlobalIncrCounter(ctx, \"infrastructure\", \"gc_cycles\")\n\tapi.GlobalRecordDuration(ctx, \"infrastructure\", \"gc_pause\", 5.2)\n\n\t// App metrics (application level)\n\tapi.IncrCounter(ctx, \"business\", \"orders_created\")\n\tapi.RecordDuration(ctx, \"business\", \"checkout_time\", 1250.0)\n\n\t// Using Instrument objects\n\tglobalCounter := api.NewGlobalCounter(\"system\", \"memory_allocations\")\n\tglobalCounter.Incr(ctx)\n\n\tappCounter := api.NewCounter(\"app\", \"user_signups\")\n\tappCounter.Incr(ctx)\n}\n\nfunc Example_batchAttributes() {\n\tctx := context.Background()\n\n\t// Add multiple attributes at once\n\tctx = api.WithAttributes(ctx, \"my_service\", map[string]any{\n\t\t\"user_id\":    \"12345\",\n\t\t\"session_id\": \"abc-def-ghi\",\n\t\t\"region\":     \"us-west-2\",\n\t\t\"version\":    \"1.2.3\",\n\t})\n\n\tapi.IncrCounter(ctx, \"my_service\", \"api_calls\")\n\tapi.RecordDuration(ctx, \"my_service\", \"latency\", 45.2)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/api/instrument.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage api\n\nimport (\n\t\"context\"\n\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\totelmetric \"go.opentelemetry.io/otel/metric\"\n)\n\n// Instrument represents a metric instrument with pre-configured meter and attributes\ntype Instrument struct {\n\tmeterProvider  otelmetric.MeterProvider\n\tmeterName      string\n\tinstrumentName string\n\tattributes     map[string]attribute.KeyValue\n\tbounds         []float64 // for histogram\n}\n\n// InstrumentOption configures an Instrument\ntype InstrumentOption func(*Instrument)\n\n// WithBounds sets histogram bucket boundaries\nfunc WithBounds(bounds []float64) InstrumentOption {\n\treturn func(i *Instrument) {\n\t\ti.bounds = bounds\n\t}\n}\n\n// WithInstrumentAttrs sets initial attributes\nfunc WithInstrumentAttrs(attrs map[string]any) InstrumentOption {\n\treturn func(i *Instrument) {\n\t\tfor k, v := range attrs {\n\t\t\ti.attributes[k] = ToAttribute(k, v)\n\t\t}\n\t}\n}\n\n// NewInstrument creates an instrument using the application MeterProvider\nfunc NewInstrument(meterName, instrumentName string, opts ...InstrumentOption) *Instrument {\n\ti := &Instrument{\n\t\tmeterProvider:  GetAppMeterProvider(),\n\t\tmeterName:      meterName,\n\t\tinstrumentName: instrumentName,\n\t\tattributes:     make(map[string]attribute.KeyValue),\n\t\tbounds:         DefaultDurationBounds,\n\t}\n\tfor _, opt := range opts {\n\t\topt(i)\n\t}\n\treturn i\n}\n\n// NewGlobalInstrument creates an instrument using the global MeterProvider\nfunc NewGlobalInstrument(meterName, instrumentName string, opts ...InstrumentOption) *Instrument {\n\ti := &Instrument{\n\t\tmeterProvider:  otel.GetMeterProvider(),\n\t\tmeterName:      meterName,\n\t\tinstrumentName: instrumentName,\n\t\tattributes:     make(map[string]attribute.KeyValue),\n\t\tbounds:         DefaultDurationBounds,\n\t}\n\tfor _, opt := range opts {\n\t\topt(i)\n\t}\n\treturn i\n}\n\n// Clone creates a copy of the instrument with the same configuration\nfunc (i *Instrument) Clone() *Instrument {\n\tnewAttrs := make(map[string]attribute.KeyValue, len(i.attributes))\n\tfor k, v := range i.attributes {\n\t\tnewAttrs[k] = v\n\t}\n\treturn &Instrument{\n\t\tmeterProvider:  i.meterProvider,\n\t\tmeterName:      i.meterName,\n\t\tinstrumentName: i.instrumentName,\n\t\tattributes:     newAttrs,\n\t\tbounds:         i.bounds,\n\t}\n}\n\n// SetAttribute sets an attribute on the instrument\n// Returns the instrument for chaining\nfunc (i *Instrument) SetAttribute(key string, value any) *Instrument {\n\ti.attributes[key] = ToAttribute(key, value)\n\treturn i\n}\n\n// SetAttributes sets multiple attributes on the instrument\n// Returns the instrument for chaining\nfunc (i *Instrument) SetAttributes(attrs map[string]any) *Instrument {\n\tfor k, v := range attrs {\n\t\ti.attributes[k] = ToAttribute(k, v)\n\t}\n\treturn i\n}\n\n// ClearAttributes clears all attributes\nfunc (i *Instrument) ClearAttributes() *Instrument {\n\ti.attributes = make(map[string]attribute.KeyValue)\n\treturn i\n}\n\n// GetAttributes returns all configured attributes as a slice\nfunc (i *Instrument) GetAttributes() []attribute.KeyValue {\n\tresult := make([]attribute.KeyValue, 0, len(i.attributes))\n\tfor _, kv := range i.attributes {\n\t\tresult = append(result, kv)\n\t}\n\treturn result\n}\n\n// AddCounter adds a value to the counter\nfunc (i *Instrument) AddCounter(ctx context.Context, value int64) {\n\tcounter := getCounter(i.meterName, i.instrumentName, i.meterProvider)\n\tcounter.Add(ctx, value, otelmetric.WithAttributes(i.GetAttributes()...))\n}\n\n// IncrCounter increments the counter by 1\nfunc (i *Instrument) IncrCounter(ctx context.Context) {\n\ti.AddCounter(ctx, 1)\n}\n\n// RecordHistogram records a value to the histogram\nfunc (i *Instrument) RecordHistogram(ctx context.Context, value float64) {\n\thistogram := getHistogram(i.meterName, i.instrumentName, i.bounds, i.meterProvider)\n\thistogram.Record(ctx, value, otelmetric.WithAttributes(i.GetAttributes()...))\n}\n\n// RecordDuration records a duration value in milliseconds\nfunc (i *Instrument) RecordDuration(ctx context.Context, durationMs float64) {\n\ti.RecordHistogram(ctx, durationMs)\n}\n\n// ========================================\n// Counter is a specialized instrument for counter metrics\n// ========================================\n\n// Counter represents a counter metric instrument\ntype Counter struct {\n\t*Instrument\n}\n\n// NewCounter creates a counter using the application MeterProvider\nfunc NewCounter(meterName, instrumentName string, opts ...InstrumentOption) *Counter {\n\treturn &Counter{Instrument: NewInstrument(meterName, instrumentName, opts...)}\n}\n\n// NewGlobalCounter creates a counter using the global MeterProvider\nfunc NewGlobalCounter(meterName, instrumentName string, opts ...InstrumentOption) *Counter {\n\treturn &Counter{Instrument: NewGlobalInstrument(meterName, instrumentName, opts...)}\n}\n\n// Add adds a value to the counter\nfunc (c *Counter) Add(ctx context.Context, value int64) {\n\tc.AddCounter(ctx, value)\n}\n\n// Incr increments the counter by 1\nfunc (c *Counter) Incr(ctx context.Context) {\n\tc.IncrCounter(ctx)\n}\n\n// With returns a new Counter with additional attributes (for chaining)\nfunc (c *Counter) With(key string, value any) *Counter {\n\tnewCounter := &Counter{Instrument: c.Clone()}\n\tnewCounter.SetAttribute(key, value)\n\treturn newCounter\n}\n\n// ========================================\n// Histogram is a specialized instrument for histogram metrics\n// ========================================\n\n// Histogram represents a histogram metric instrument\ntype Histogram struct {\n\t*Instrument\n}\n\n// NewHistogram creates a histogram using the application MeterProvider\nfunc NewHistogram(meterName, instrumentName string, opts ...InstrumentOption) *Histogram {\n\treturn &Histogram{Instrument: NewInstrument(meterName, instrumentName, opts...)}\n}\n\n// NewGlobalHistogram creates a histogram using the global MeterProvider\nfunc NewGlobalHistogram(meterName, instrumentName string, opts ...InstrumentOption) *Histogram {\n\treturn &Histogram{Instrument: NewGlobalInstrument(meterName, instrumentName, opts...)}\n}\n\n// Record records a value to the histogram\nfunc (h *Histogram) Record(ctx context.Context, value float64) {\n\th.RecordHistogram(ctx, value)\n}\n\n// With returns a new Histogram with additional attributes (for chaining)\nfunc (h *Histogram) With(key string, value any) *Histogram {\n\tnewHistogram := &Histogram{Instrument: h.Clone()}\n\tnewHistogram.SetAttribute(key, value)\n\treturn newHistogram\n}\n\n// ========================================\n// Timer is a helper for measuring duration\n// ========================================\n\n// Timer is a helper for measuring and recording duration\ntype Timer struct {\n\thistogram *Histogram\n}\n\n// NewTimer creates a timer using the application MeterProvider\nfunc NewTimer(meterName, instrumentName string, opts ...InstrumentOption) *Timer {\n\treturn &Timer{histogram: NewHistogram(meterName, instrumentName, opts...)}\n}\n\n// NewGlobalTimer creates a timer using the global MeterProvider\nfunc NewGlobalTimer(meterName, instrumentName string, opts ...InstrumentOption) *Timer {\n\treturn &Timer{histogram: NewGlobalHistogram(meterName, instrumentName, opts...)}\n}\n\n// SetAttribute sets an attribute on the timer\nfunc (t *Timer) SetAttribute(key string, value any) *Timer {\n\tt.histogram.SetAttribute(key, value)\n\treturn t\n}\n\n// Record records a duration in milliseconds\nfunc (t *Timer) Record(ctx context.Context, durationMs float64) {\n\tt.histogram.Record(ctx, durationMs)\n}\n\n// With returns a new Timer with additional attributes\nfunc (t *Timer) With(key string, value any) *Timer {\n\treturn &Timer{histogram: t.histogram.With(key, value)}\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/meter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage metric\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"go.opentelemetry.io/otel\"\n\totelmetric \"go.opentelemetry.io/otel/metric\"\n\t\"go.opentelemetry.io/otel/sdk/metric\"\n\t\"go.opentelemetry.io/otel/sdk/resource\"\n)\n\ntype MeterOptinos struct {\n\tPushExporterBuilder PushExporterBuilder\n\tPullExporterBuilder PullExporterBuilder\n\tcollectPeriod       time.Duration\n\tresource            *resource.Resource\n\texporterName        string // exporter name for logging (e.g., \"OTLP\", \"stdout\")\n\texporterEndpoint    string // endpoint for logging\n}\n\ntype Meter struct {\n\topts     MeterOptinos\n\tprovider *metric.MeterProvider\n}\n\nfunc defaultMeterOptions() MeterOptinos {\n\treturn MeterOptinos{\n\t\tcollectPeriod: time.Minute,\n\t}\n}\n\nfunc NewMeter(opts ...MeterOption) *Meter {\n\tm := &Meter{\n\t\topts: defaultMeterOptions(),\n\t}\n\tm.ApplyOptions(opts...)\n\treturn m\n}\n\n// https://github.com/open-telemetry/opentelemetry-go/blob/example/prometheus/v0.30.0/example/prometheus/main.go\n// https://github.com/kaydxh/newrelic-opentelemetry-examples/blob/main/go/metrics.go\nfunc (m *Meter) Install(ctx context.Context) (err error) {\n\tprovider, err := m.createMeterProvider(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif provider != nil {\n\t\tm.provider = provider\n\t\totel.SetMeterProvider(provider)\n\t}\n\treturn nil\n}\n\n// InstallAsAppProvider creates a MeterProvider but does NOT set it as global.\n// Returns the provider for use as App MeterProvider.\nfunc (m *Meter) InstallAsAppProvider(ctx context.Context) (otelmetric.MeterProvider, error) {\n\tprovider, err := m.createMeterProvider(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tm.provider = provider\n\treturn provider, nil\n}\n\n// GetProvider returns the created MeterProvider\nfunc (m *Meter) GetProvider() otelmetric.MeterProvider {\n\treturn m.provider\n}\n\n// createMeterProvider creates a MeterProvider with configured exporters\nfunc (m *Meter) createMeterProvider(ctx context.Context) (*metric.MeterProvider, error) {\n\tvar readers []metric.Reader\n\n\tif m.opts.PushExporterBuilder != nil {\n\t\texporter, err := m.createPushExporter(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif exporter != nil { // such as prometheus, that's a puller actually\n\t\t\tvar opts []metric.PeriodicReaderOption\n\t\t\tif m.opts.collectPeriod > 0 {\n\t\t\t\topts = append(opts, metric.WithInterval(m.opts.collectPeriod))\n\t\t\t}\n\t\t\treader := metric.NewPeriodicReader(exporter, opts...)\n\t\t\treaders = append(readers, reader)\n\t\t}\n\t}\n\tif m.opts.PullExporterBuilder != nil {\n\t\treader, err := m.createPullReader(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treaders = append(readers, reader)\n\t}\n\n\tif len(readers) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tvar metricProviderOptions []metric.Option\n\n\tfor _, reader := range readers {\n\t\tmetricProviderOptions = append(metricProviderOptions, metric.WithReader(reader)) // 默认cumulative\n\t}\n\n\t// Add resource if provided\n\tif m.opts.resource != nil {\n\t\tmetricProviderOptions = append(metricProviderOptions, metric.WithResource(m.opts.resource))\n\t}\n\n\treturn metric.NewMeterProvider(metricProviderOptions...), nil\n}\n\nfunc (m *Meter) createPushExporter(ctx context.Context) (metric.Exporter, error) {\n\tif m.opts.PushExporterBuilder == nil {\n\t\treturn nil, fmt.Errorf(\"push metric reader builder is nil\")\n\t}\n\n\texporter, err := m.opts.PushExporterBuilder.Build(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Wrap with logging exporter if name is provided\n\tif m.opts.exporterName != \"\" {\n\t\treturn NewLoggingExporter(exporter, m.opts.exporterName, m.opts.exporterEndpoint), nil\n\t}\n\n\treturn exporter, nil\n}\n\n// Pull Exporter supports Prometheus pulls.  It does not implement the\n// sdk/export/metric.Exporter interface--instead it creates a pull\n// controller and reads the latest checkpointed data on-scrape.\nfunc (m *Meter) createPullReader(ctx context.Context,\n) (metric.Reader, error) {\n\tif m.opts.PullExporterBuilder == nil {\n\t\treturn nil, fmt.Errorf(\"pull metric exporter builder is nil\")\n\t}\n\n\treturn m.opts.PullExporterBuilder.Build(ctx)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/meter.logging_exporter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage metric\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"go.opentelemetry.io/otel/sdk/metric\"\n\t\"go.opentelemetry.io/otel/sdk/metric/metricdata\"\n)\n\n// LoggingExporter wraps a metric.Exporter and logs export results\ntype LoggingExporter struct {\n\tinner    metric.Exporter\n\tname     string // exporter name for logging (e.g., \"OTLP\", \"stdout\")\n\tendpoint string // endpoint for logging\n}\n\n// NewLoggingExporter creates a new LoggingExporter that wraps the given exporter\nfunc NewLoggingExporter(inner metric.Exporter, name, endpoint string) *LoggingExporter {\n\treturn &LoggingExporter{\n\t\tinner:    inner,\n\t\tname:     name,\n\t\tendpoint: endpoint,\n\t}\n}\n\n// Temporality returns the Temporality to use for an instrument kind.\nfunc (e *LoggingExporter) Temporality(kind metric.InstrumentKind) metricdata.Temporality {\n\treturn e.inner.Temporality(kind)\n}\n\n// Aggregation returns the Aggregation to use for an instrument kind.\nfunc (e *LoggingExporter) Aggregation(kind metric.InstrumentKind) metric.Aggregation {\n\treturn e.inner.Aggregation(kind)\n}\n\n// Export exports metrics and logs the result\nfunc (e *LoggingExporter) Export(ctx context.Context, rm *metricdata.ResourceMetrics) error {\n\tstart := time.Now()\n\n\t// Count metrics and check temporality\n\tmetricCount := 0\n\tdataPointCount := 0\n\ttemporality := \"unknown\"\n\tfor _, sm := range rm.ScopeMetrics {\n\t\tmetricCount += len(sm.Metrics)\n\t\tfor _, m := range sm.Metrics {\n\t\t\tdataPointCount += countDataPoints(m)\n\t\t\tif temporality == \"unknown\" {\n\t\t\t\ttemporality = getTemporality(m)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Log resource attributes for debugging (first export only)\n\t//if rm.Resource != nil {\n\t//\tattrs := rm.Resource.Attributes()\n\t//\tfor _, attr := range attrs {\n\t//\t\tif attr.Key == \"__zhiyan_app_mark__\" {\n\t//\t\t\tlogrus.Debugf(\"[%s] resource attribute: %s=%s\", e.name, attr.Key, attr.Value.AsString())\n\t//\t\t}\n\t//\t}\n\t//}\n\n\terr := e.inner.Export(ctx, rm)\n\tduration := time.Since(start)\n\n\tif err != nil {\n\t\tlogrus.Errorf(\"[%s] metric export failed: endpoint=%s, metrics=%d, datapoints=%d, temporality=%s, duration=%v, error=%v\",\n\t\t\te.name, e.endpoint, metricCount, dataPointCount, temporality, duration, err)\n\t} else {\n\t\tlogrus.Infof(\"[%s] metric export success: endpoint=%s, metrics=%d, datapoints=%d, temporality=%s, duration=%v\",\n\t\t\te.name, e.endpoint, metricCount, dataPointCount, temporality, duration)\n\t}\n\n\treturn err\n}\n\n// ForceFlush flushes the exporter\nfunc (e *LoggingExporter) ForceFlush(ctx context.Context) error {\n\treturn e.inner.ForceFlush(ctx)\n}\n\n// Shutdown shuts down the exporter\nfunc (e *LoggingExporter) Shutdown(ctx context.Context) error {\n\tlogrus.Infof(\"[%s] metric exporter shutting down: endpoint=%s\", e.name, e.endpoint)\n\treturn e.inner.Shutdown(ctx)\n}\n\n// countDataPoints counts the number of data points in a metric\nfunc countDataPoints(m metricdata.Metrics) int {\n\tswitch data := m.Data.(type) {\n\tcase metricdata.Sum[int64]:\n\t\treturn len(data.DataPoints)\n\tcase metricdata.Sum[float64]:\n\t\treturn len(data.DataPoints)\n\tcase metricdata.Gauge[int64]:\n\t\treturn len(data.DataPoints)\n\tcase metricdata.Gauge[float64]:\n\t\treturn len(data.DataPoints)\n\tcase metricdata.Histogram[int64]:\n\t\treturn len(data.DataPoints)\n\tcase metricdata.Histogram[float64]:\n\t\treturn len(data.DataPoints)\n\tcase metricdata.ExponentialHistogram[int64]:\n\t\treturn len(data.DataPoints)\n\tcase metricdata.ExponentialHistogram[float64]:\n\t\treturn len(data.DataPoints)\n\tdefault:\n\t\treturn 0\n\t}\n}\n\n// getTemporality returns the temporality string of a metric\nfunc getTemporality(m metricdata.Metrics) string {\n\tswitch data := m.Data.(type) {\n\tcase metricdata.Sum[int64]:\n\t\treturn data.Temporality.String()\n\tcase metricdata.Sum[float64]:\n\t\treturn data.Temporality.String()\n\tcase metricdata.Histogram[int64]:\n\t\treturn data.Temporality.String()\n\tcase metricdata.Histogram[float64]:\n\t\treturn data.Temporality.String()\n\tcase metricdata.ExponentialHistogram[int64]:\n\t\treturn data.Temporality.String()\n\tcase metricdata.ExponentialHistogram[float64]:\n\t\treturn data.Temporality.String()\n\tdefault:\n\t\treturn \"gauge\"\n\t}\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/meter.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage metric\n\nimport (\n\t\"time\"\n\n\t\"go.opentelemetry.io/otel/sdk/resource\"\n)\n\nfunc WithPushExporter(pushExporterBuilder PushExporterBuilder) MeterOption {\n\treturn MeterOptionFunc(func(m *Meter) {\n\t\tm.opts.PushExporterBuilder = pushExporterBuilder\n\t})\n}\n\nfunc WithPullExporter(pullExporterBuilder PullExporterBuilder) MeterOption {\n\treturn MeterOptionFunc(func(m *Meter) {\n\t\tm.opts.PullExporterBuilder = pullExporterBuilder\n\t})\n}\n\nfunc WithCollectPeriod(period time.Duration) MeterOption {\n\treturn MeterOptionFunc(func(m *Meter) {\n\t\tm.opts.collectPeriod = period\n\t})\n}\n\n// WithResource sets a custom resource for the meter\nfunc WithResource(res *resource.Resource) MeterOption {\n\treturn MeterOptionFunc(func(m *Meter) {\n\t\tm.opts.resource = res\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/meter.pull.exporter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage metric\n\nimport (\n\t\"context\"\n\n\t\"go.opentelemetry.io/otel/sdk/metric\"\n)\n\ntype PullExporterBuilder interface {\n\tBuild(ctx context.Context) (metric.Reader, error)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/meter.push.exporter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage metric\n\nimport (\n\t\"context\"\n\n\t\"go.opentelemetry.io/otel/sdk/metric\"\n)\n\ntype PushExporterBuilder interface {\n\tBuild(ctx context.Context) (metric.Exporter, error)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/meter_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage metric\n\n// A MeterOption sets options.\ntype MeterOption interface {\n\tapply(*Meter)\n}\n\n// EmptyMeterOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyMeterOption struct{}\n\nfunc (EmptyMeterOption) apply(*Meter) {}\n\n// MeterOptionFunc wraps a function that modifies Client into an\n// implementation of the MeterOption interface.\ntype MeterOptionFunc func(*Meter)\n\nfunc (f MeterOptionFunc) apply(do *Meter) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _MeterOptionWithDefault() MeterOption {\n\treturn MeterOptionFunc(func(*Meter) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Meter) ApplyOptions(options ...MeterOption) *Meter {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n\n// WithExporterLogging enables logging for metric export operations\n// name: exporter name for logging (e.g., \"OTLP\", \"stdout\")\n// endpoint: endpoint address for logging\nfunc WithExporterLogging(name, endpoint string) MeterOption {\n\treturn MeterOptionFunc(func(m *Meter) {\n\t\tm.opts.exporterName = name\n\t\tm.opts.exporterEndpoint = endpoint\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/otlp/otlp.metric.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage otlp\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc\"\n\t\"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp\"\n\t\"go.opentelemetry.io/otel/sdk/metric\"\n\t\"go.opentelemetry.io/otel/sdk/metric/metricdata\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/credentials/insecure\"\n)\n\ntype Protocol int\n\nconst (\n\tProtocolHTTP Protocol = iota\n\tProtocolGRPC\n)\n\ntype OTLPExporterBuilderOptions struct {\n\t// Endpoint is the target endpoint URL (without scheme for gRPC, with scheme for HTTP)\n\t// For Tencent Cloud Prometheus, use the Remote Write address\n\tEndpoint string\n\n\t// Headers for authentication (e.g., Token for Tencent Cloud Prometheus)\n\tHeaders map[string]string\n\n\t// Protocol specifies HTTP or gRPC\n\tProtocol Protocol\n\n\t// Insecure disables TLS (default: false)\n\tInsecure bool\n\n\t// Timeout for the exporter\n\tTimeout time.Duration\n\n\t// URLPath is the URL path for HTTP protocol (default: \"/v1/metrics\")\n\tURLPath string\n\n\t// Compression enables gzip compression\n\tCompression bool\n\n\t// TemporalityDelta uses Delta temporality instead of Cumulative\n\tTemporalityDelta bool\n}\n\ntype OTLPExporterBuilder struct {\n\topts OTLPExporterBuilderOptions\n}\n\nfunc defaultBuilderOptions() OTLPExporterBuilderOptions {\n\treturn OTLPExporterBuilderOptions{\n\t\tProtocol: ProtocolHTTP,\n\t\tInsecure: false,\n\t\tTimeout:  30 * time.Second,\n\t\tURLPath:  \"/v1/metrics\",\n\t}\n}\n\nfunc NewOTLPExporterBuilder(opts ...OTLPExporterBuilderOption) *OTLPExporterBuilder {\n\tbuilder := &OTLPExporterBuilder{\n\t\topts: defaultBuilderOptions(),\n\t}\n\tbuilder.ApplyOptions(opts...)\n\treturn builder\n}\n\nfunc (p *OTLPExporterBuilder) Build(ctx context.Context) (metric.Exporter, error) {\n\tswitch p.opts.Protocol {\n\tcase ProtocolHTTP:\n\t\treturn p.buildHTTPExporter(ctx)\n\tcase ProtocolGRPC:\n\t\treturn p.buildGRPCExporter(ctx)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported protocol: %d\", p.opts.Protocol)\n\t}\n}\n\nfunc (p *OTLPExporterBuilder) buildHTTPExporter(ctx context.Context) (metric.Exporter, error) {\n\tif p.opts.Endpoint == \"\" {\n\t\treturn nil, fmt.Errorf(\"endpoint is required for OTLP HTTP exporter\")\n\t}\n\n\topts := []otlpmetrichttp.Option{\n\t\totlpmetrichttp.WithEndpoint(p.opts.Endpoint),\n\t}\n\n\tif p.opts.Insecure {\n\t\topts = append(opts, otlpmetrichttp.WithInsecure())\n\t}\n\n\tif len(p.opts.Headers) > 0 {\n\t\topts = append(opts, otlpmetrichttp.WithHeaders(p.opts.Headers))\n\t}\n\n\tif p.opts.Timeout > 0 {\n\t\topts = append(opts, otlpmetrichttp.WithTimeout(p.opts.Timeout))\n\t}\n\n\tif p.opts.URLPath != \"\" {\n\t\topts = append(opts, otlpmetrichttp.WithURLPath(p.opts.URLPath))\n\t}\n\n\tif p.opts.Compression {\n\t\topts = append(opts, otlpmetrichttp.WithCompression(otlpmetrichttp.GzipCompression))\n\t}\n\n\tif p.opts.TemporalityDelta {\n\t\topts = append(opts, otlpmetrichttp.WithTemporalitySelector(deltaTemporalitySelector))\n\t}\n\n\texporter, err := otlpmetrichttp.New(ctx, opts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating OTLP HTTP metric exporter: %w\", err)\n\t}\n\n\treturn exporter, nil\n}\n\nfunc (p *OTLPExporterBuilder) buildGRPCExporter(ctx context.Context) (metric.Exporter, error) {\n\tif p.opts.Endpoint == \"\" {\n\t\treturn nil, fmt.Errorf(\"endpoint is required for OTLP gRPC exporter\")\n\t}\n\n\topts := []otlpmetricgrpc.Option{\n\t\totlpmetricgrpc.WithEndpoint(p.opts.Endpoint),\n\t}\n\n\tif p.opts.Insecure {\n\t\topts = append(opts, otlpmetricgrpc.WithInsecure())\n\t\topts = append(opts, otlpmetricgrpc.WithDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())))\n\t}\n\n\tif len(p.opts.Headers) > 0 {\n\t\topts = append(opts, otlpmetricgrpc.WithHeaders(p.opts.Headers))\n\t}\n\n\tif p.opts.Timeout > 0 {\n\t\topts = append(opts, otlpmetricgrpc.WithTimeout(p.opts.Timeout))\n\t}\n\n\tif p.opts.Compression {\n\t\topts = append(opts, otlpmetricgrpc.WithCompressor(\"gzip\"))\n\t}\n\n\tif p.opts.TemporalityDelta {\n\t\topts = append(opts, otlpmetricgrpc.WithTemporalitySelector(deltaTemporalitySelector))\n\t}\n\n\texporter, err := otlpmetricgrpc.New(ctx, opts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating OTLP gRPC metric exporter: %w\", err)\n\t}\n\n\treturn exporter, nil\n}\n\n// deltaTemporalitySelector returns Delta temporality for all instrument kinds\n// ZhiYan platform requires Delta temporality\nfunc deltaTemporalitySelector(kind metric.InstrumentKind) metricdata.Temporality {\n\treturn metricdata.DeltaTemporality\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/otlp/otlp.metric.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage otlp\n\nimport \"time\"\n\ntype OTLPExporterBuilderOption interface {\n\tapply(*OTLPExporterBuilder)\n}\n\ntype funcOTLPExporterBuilderOption struct {\n\tf func(*OTLPExporterBuilder)\n}\n\nfunc (fdo *funcOTLPExporterBuilderOption) apply(do *OTLPExporterBuilder) {\n\tfdo.f(do)\n}\n\nfunc newFuncOTLPExporterBuilderOption(f func(*OTLPExporterBuilder)) *funcOTLPExporterBuilderOption {\n\treturn &funcOTLPExporterBuilderOption{f: f}\n}\n\nfunc (o *OTLPExporterBuilder) ApplyOptions(opts ...OTLPExporterBuilderOption) {\n\tfor _, opt := range opts {\n\t\topt.apply(o)\n\t}\n}\n\n// WithEndpoint sets the target endpoint URL\n// For HTTP: include scheme, e.g., \"https://prometheus.example.com\"\n// For gRPC: without scheme, e.g., \"prometheus.example.com:4317\"\nfunc WithEndpoint(endpoint string) OTLPExporterBuilderOption {\n\treturn newFuncOTLPExporterBuilderOption(func(o *OTLPExporterBuilder) {\n\t\to.opts.Endpoint = endpoint\n\t})\n}\n\n// WithHeaders sets HTTP headers for authentication\n// For Tencent Cloud Prometheus, set Authorization header with Token\nfunc WithHeaders(headers map[string]string) OTLPExporterBuilderOption {\n\treturn newFuncOTLPExporterBuilderOption(func(o *OTLPExporterBuilder) {\n\t\to.opts.Headers = headers\n\t})\n}\n\n// WithProtocol sets the protocol (HTTP or gRPC)\nfunc WithProtocol(protocol Protocol) OTLPExporterBuilderOption {\n\treturn newFuncOTLPExporterBuilderOption(func(o *OTLPExporterBuilder) {\n\t\to.opts.Protocol = protocol\n\t})\n}\n\n// WithInsecure disables TLS\nfunc WithInsecure(insecure bool) OTLPExporterBuilderOption {\n\treturn newFuncOTLPExporterBuilderOption(func(o *OTLPExporterBuilder) {\n\t\to.opts.Insecure = insecure\n\t})\n}\n\n// WithTimeout sets the timeout for the exporter\nfunc WithTimeout(timeout time.Duration) OTLPExporterBuilderOption {\n\treturn newFuncOTLPExporterBuilderOption(func(o *OTLPExporterBuilder) {\n\t\to.opts.Timeout = timeout\n\t})\n}\n\n// WithURLPath sets the URL path for HTTP protocol\nfunc WithURLPath(urlPath string) OTLPExporterBuilderOption {\n\treturn newFuncOTLPExporterBuilderOption(func(o *OTLPExporterBuilder) {\n\t\to.opts.URLPath = urlPath\n\t})\n}\n\n// WithCompression enables gzip compression\nfunc WithCompression(compression bool) OTLPExporterBuilderOption {\n\treturn newFuncOTLPExporterBuilderOption(func(o *OTLPExporterBuilder) {\n\t\to.opts.Compression = compression\n\t})\n}\n\n// WithTemporalityDelta uses Delta temporality instead of Cumulative\n// ZhiYan platform requires Delta temporality\nfunc WithTemporalityDelta(delta bool) OTLPExporterBuilderOption {\n\treturn newFuncOTLPExporterBuilderOption(func(o *OTLPExporterBuilder) {\n\t\to.opts.TemporalityDelta = delta\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/otlp/otlp.metric_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage otlp\n\nimport (\n\t\"time\"\n\n\tmeter_ \"github.com/kaydxh/golang/pkg/opentelemetry/metric\"\n)\n\n// WithOTLPPushExporter creates an OTLP push exporter builder\n// for Tencent Cloud Prometheus Remote Write\nfunc WithOTLPPushExporter(\n\tendpoint string,\n\topts ...OTLPExporterBuilderOption,\n) meter_.MeterOption {\n\tallOpts := append([]OTLPExporterBuilderOption{WithEndpoint(endpoint)}, opts...)\n\treturn meter_.WithPushExporter(NewOTLPExporterBuilder(allOpts...))\n}\n\n// WithTencentCloudPrometheus creates an OTLP exporter configured for Tencent Cloud Prometheus\n// endpoint: Remote Write URL from Tencent Cloud Prometheus console\n// token: Authentication token from Tencent Cloud Prometheus console\n// insecure: Whether to use insecure connection (typically false for Tencent Cloud)\nfunc WithTencentCloudPrometheus(\n\tendpoint string,\n\ttoken string,\n\tinsecure bool,\n) meter_.MeterOption {\n\theaders := make(map[string]string)\n\tif token != \"\" {\n\t\theaders[\"Authorization\"] = \"Bearer \" + token\n\t}\n\n\treturn meter_.WithPushExporter(NewOTLPExporterBuilder(\n\t\tWithEndpoint(endpoint),\n\t\tWithHeaders(headers),\n\t\tWithProtocol(ProtocolHTTP),\n\t\tWithInsecure(insecure),\n\t\tWithTimeout(30*time.Second),\n\t))\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/prometheus/prometheus.metric.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage prometheus\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"sync\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n\t\"github.com/prometheus/client_golang/prometheus/promhttp\"\n\tprometheusmetric \"go.opentelemetry.io/otel/exporters/prometheus\"\n\t\"go.opentelemetry.io/otel/sdk/metric\"\n)\n\nconst (\n\tdefaultMetricsUrl = \"/metrics\"\n)\n\n// Global registry and handler for Prometheus metrics\nvar (\n\tglobalRegistry     *prometheus.Registry\n\tglobalHandler      http.Handler\n\tglobalRegistryOnce sync.Once\n)\n\n// GetGlobalRegistry returns the global Prometheus registry.\n// Creates it on first call.\nfunc GetGlobalRegistry() *prometheus.Registry {\n\tglobalRegistryOnce.Do(func() {\n\t\tglobalRegistry = prometheus.NewRegistry()\n\t\t// Register Go runtime metrics and process metrics\n\t\tglobalRegistry.MustRegister(prometheus.NewGoCollector())\n\t\tglobalRegistry.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))\n\t\tglobalHandler = promhttp.HandlerFor(globalRegistry, promhttp.HandlerOpts{\n\t\t\tEnableOpenMetrics: true,\n\t\t})\n\t})\n\treturn globalRegistry\n}\n\n// GetMetricsHandler returns the HTTP handler for /metrics endpoint.\n// Must be called after GetGlobalRegistry() or Build().\nfunc GetMetricsHandler() http.Handler {\n\tGetGlobalRegistry() // Ensure initialized\n\treturn globalHandler\n}\n\ntype PrometheusExporterBuilderOptions struct {\n\tUrl string\n}\n\ntype PrometheusExporterBuilder struct {\n\topts PrometheusExporterBuilderOptions\n}\n\nfunc defaultBuilderOptions() PrometheusExporterBuilderOptions {\n\treturn PrometheusExporterBuilderOptions{\n\t\tUrl: defaultMetricsUrl,\n\t}\n}\n\nfunc NewPrometheusExporterBuilder(opts ...PrometheusExporterBuilderOption) *PrometheusExporterBuilder {\n\n\tbuilder := &PrometheusExporterBuilder{\n\t\topts: defaultBuilderOptions(),\n\t}\n\tbuilder.ApplyOptions(opts...)\n\n\treturn builder\n}\n\nfunc (p *PrometheusExporterBuilder) Build(ctx context.Context) (metric.Reader, error) {\n\t// Use global registry to ensure HTTP handler can access metrics\n\treturn NewPrometheusReader(ctx, GetGlobalRegistry())\n}\n\n// GetUrlPath returns the configured URL path for metrics endpoint.\nfunc (p *PrometheusExporterBuilder) GetUrlPath() string {\n\treturn p.opts.Url\n}\n\n// NewPrometheusReader creates a new Prometheus exporter with the given registry.\nfunc NewPrometheusReader(ctx context.Context, reg prometheus.Registerer) (*prometheusmetric.Exporter, error) {\n\treturn prometheusmetric.New(prometheusmetric.WithRegisterer(reg))\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/prometheus/prometheus.metric.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage prometheus\n\nfunc WithMetricUrlPath(url string) PrometheusExporterBuilderOption {\n\treturn PrometheusExporterBuilderOptionFunc(func(m *PrometheusExporterBuilder) {\n\t\tm.opts.Url = url\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/prometheus/prometheus.metric_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage prometheus\n\n// A PrometheusExporterBuilderOption sets options.\ntype PrometheusExporterBuilderOption interface {\n\tapply(*PrometheusExporterBuilder)\n}\n\n// EmptyPrometheusExporterBuilderOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyPrometheusExporterBuilderOption struct{}\n\nfunc (EmptyPrometheusExporterBuilderOption) apply(*PrometheusExporterBuilder) {}\n\n// PrometheusExporterBuilderOptionFunc wraps a function that modifies Client into an\n// implementation of the PrometheusExporterBuilderOption interface.\ntype PrometheusExporterBuilderOptionFunc func(*PrometheusExporterBuilder)\n\nfunc (f PrometheusExporterBuilderOptionFunc) apply(do *PrometheusExporterBuilder) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _PrometheusExporterBuilderOptionWithDefault() PrometheusExporterBuilderOption {\n\treturn PrometheusExporterBuilderOptionFunc(func(*PrometheusExporterBuilder) {\n\t\t// nothing to change\n\t})\n}\n\nfunc (o *PrometheusExporterBuilder) ApplyOptions(\n\toptions ...PrometheusExporterBuilderOption,\n) *PrometheusExporterBuilder {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/report/dimension.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage report\n\nimport (\n\t\"context\"\n\t\"strconv\"\n\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\n// RetCode constants\nconst (\n\tRetCodeSuccess = 0\n\tRetCodeTimeout = -1 // 超时错误码\n)\n\n// ServerDimension represents server-side (被调) dimension attributes\ntype ServerDimension struct {\n\t// RetCode - 返回码\n\tRetCode int\n\n\t// Passive side (被调方 P)\n\tPIp        string // 被调 IP\n\tPApp       string // 被调应用名\n\tPServer    string // 被调服务名\n\tPService   string // 被调 Service (gRPC service name)\n\tPInterface string // 被调接口 (gRPC method)\n\n\t// Active side (主调方 A)\n\tAIp  string // 主调 IP (from peer)\n\tAApp string // 主调应用名 (from metadata)\n}\n\n// IsSuccess returns true if the request was successful\nfunc (d *ServerDimension) IsSuccess() bool {\n\treturn d.RetCode == RetCodeSuccess\n}\n\n// IsTimeout returns true if the request timed out\nfunc (d *ServerDimension) IsTimeout() bool {\n\treturn d.RetCode == RetCodeTimeout\n}\n\n// ToAttributes converts dimension to OpenTelemetry attributes\nfunc (d *ServerDimension) ToAttributes() []attribute.KeyValue {\n\tattrs := []attribute.KeyValue{\n\t\tRetCodeKey.String(strconv.Itoa(d.RetCode)),\n\t}\n\n\tif d.PIp != \"\" {\n\t\tattrs = append(attrs, PIpKey.String(d.PIp))\n\t}\n\tif d.PApp != \"\" {\n\t\tattrs = append(attrs, PAppKey.String(d.PApp))\n\t}\n\tif d.PServer != \"\" {\n\t\tattrs = append(attrs, PServerKey.String(d.PServer))\n\t}\n\tif d.PService != \"\" {\n\t\tattrs = append(attrs, PServiceKey.String(d.PService))\n\t}\n\tif d.PInterface != \"\" {\n\t\tattrs = append(attrs, PInterfaceKey.String(d.PInterface))\n\t}\n\tif d.AIp != \"\" {\n\t\tattrs = append(attrs, AIpKey.String(d.AIp))\n\t}\n\tif d.AApp != \"\" {\n\t\tattrs = append(attrs, AAppKey.String(d.AApp))\n\t}\n\n\treturn attrs\n}\n\n// ClientDimension represents client-side (主调) dimension attributes\ntype ClientDimension struct {\n\t// RetCode - 返回码\n\tRetCode int\n\n\t// Active side (主调方 A)\n\tAIp        string // 主调 IP\n\tAApp       string // 主调应用名\n\tAServer    string // 主调服务名\n\tAService   string // 主调 Service\n\tAInterface string // 主调接口\n\n\t// Passive side (被调方 P)\n\tPIp        string // 被调 IP (target address)\n\tPApp       string // 被调应用名\n\tPServer    string // 被调服务名\n\tPService   string // 被调 Service (gRPC service name)\n\tPInterface string // 被调接口 (gRPC method)\n}\n\n// IsSuccess returns true if the request was successful\nfunc (d *ClientDimension) IsSuccess() bool {\n\treturn d.RetCode == RetCodeSuccess\n}\n\n// IsTimeout returns true if the request timed out\nfunc (d *ClientDimension) IsTimeout() bool {\n\treturn d.RetCode == RetCodeTimeout\n}\n\n// ToAttributes converts dimension to OpenTelemetry attributes\nfunc (d *ClientDimension) ToAttributes() []attribute.KeyValue {\n\tattrs := []attribute.KeyValue{\n\t\tRetCodeKey.String(strconv.Itoa(d.RetCode)),\n\t}\n\n\t// Active side (主调方)\n\tif d.AIp != \"\" {\n\t\tattrs = append(attrs, AIpKey.String(d.AIp))\n\t}\n\tif d.AApp != \"\" {\n\t\tattrs = append(attrs, AAppKey.String(d.AApp))\n\t}\n\tif d.AServer != \"\" {\n\t\tattrs = append(attrs, AServerKey.String(d.AServer))\n\t}\n\tif d.AService != \"\" {\n\t\tattrs = append(attrs, AServiceKey.String(d.AService))\n\t}\n\tif d.AInterface != \"\" {\n\t\tattrs = append(attrs, AInterfaceKey.String(d.AInterface))\n\t}\n\n\t// Passive side (被调方)\n\tif d.PIp != \"\" {\n\t\tattrs = append(attrs, PIpKey.String(d.PIp))\n\t}\n\tif d.PApp != \"\" {\n\t\tattrs = append(attrs, PAppKey.String(d.PApp))\n\t}\n\tif d.PServer != \"\" {\n\t\tattrs = append(attrs, PServerKey.String(d.PServer))\n\t}\n\tif d.PService != \"\" {\n\t\tattrs = append(attrs, PServiceKey.String(d.PService))\n\t}\n\tif d.PInterface != \"\" {\n\t\tattrs = append(attrs, PInterfaceKey.String(d.PInterface))\n\t}\n\n\treturn attrs\n}\n\n// ErrorToRetCode converts an error to a return code\nfunc ErrorToRetCode(err error) int {\n\tif err == nil {\n\t\treturn RetCodeSuccess\n\t}\n\n\t// Check for gRPC status\n\tst, ok := status.FromError(err)\n\tif ok {\n\t\tswitch st.Code() {\n\t\tcase codes.OK:\n\t\t\treturn RetCodeSuccess\n\t\tcase codes.DeadlineExceeded:\n\t\t\treturn RetCodeTimeout\n\t\tcase codes.Canceled:\n\t\t\treturn -2 // Canceled\n\t\tdefault:\n\t\t\treturn int(st.Code())\n\t\t}\n\t}\n\n\t// Check for context errors\n\tif err == context.DeadlineExceeded {\n\t\treturn RetCodeTimeout\n\t}\n\tif err == context.Canceled {\n\t\treturn -2\n\t}\n\n\t// Default error code\n\treturn -999\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/report/report.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage report\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\totelmetric \"go.opentelemetry.io/otel/metric\"\n\t\"go.opentelemetry.io/otel/metric/noop\"\n)\n\nconst (\n\t// Meter names\n\tServerReportMeterName = \"server_report\" // 被调上报\n\tClientReportMeterName = \"client_report\" // 主调上报\n\n\t// Metric names\n\tRequestsMetricName  = \"requests\"  // 请求数\n\tSuccessMetricName   = \"success\"   // 成功数\n\tTimeoutMetricName   = \"timeout\"   // 超时数\n\tAbnormalMetricName  = \"abnormal\"  // 异常数\n\tCostMetricName      = \"cost\"      // 耗时(ms)\n\tDurationMetricName  = \"duration\"  // 耗时分布 Histogram\n)\n\n// Attribute keys for callee (被调方)\nvar (\n\tRetCodeKey    = attribute.Key(\"ret_code\")    // 返回码\n\tPIpKey        = attribute.Key(\"p_ip\")        // 被调 IP\n\tPAppKey       = attribute.Key(\"p_app\")       // 被调应用名\n\tPServerKey    = attribute.Key(\"p_server\")    // 被调服务名\n\tPServiceKey   = attribute.Key(\"p_service\")   // 被调 Service\n\tPInterfaceKey = attribute.Key(\"p_interface\") // 被调接口\n)\n\n// Attribute keys for caller (主调方)\nvar (\n\tAIpKey        = attribute.Key(\"a_ip\")        // 主调 IP\n\tAAppKey       = attribute.Key(\"a_app\")       // 主调应用名\n\tAServerKey    = attribute.Key(\"a_server\")    // 主调服务名\n\tAServiceKey   = attribute.Key(\"a_service\")   // 主调 Service\n\tAInterfaceKey = attribute.Key(\"a_interface\") // 主调接口\n)\n\n// Default histogram bounds for duration (in milliseconds)\nvar DefaultDurationBounds = []float64{5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000}\n\n// MetricReporter handles metric reporting\ntype MetricReporter struct {\n\tmeterProvider otelmetric.MeterProvider\n\n\tcounters   map[string]otelmetric.Int64Counter\n\thistograms map[string]otelmetric.Float64Histogram\n\tmu         sync.RWMutex\n}\n\nvar (\n\tglobalReporter     *MetricReporter\n\tglobalReporterOnce sync.Once\n)\n\n// GetGlobalReporter returns the global metric reporter\nfunc GetGlobalReporter() *MetricReporter {\n\tglobalReporterOnce.Do(func() {\n\t\tglobalReporter = NewMetricReporter(otel.GetMeterProvider())\n\t})\n\treturn globalReporter\n}\n\n// NewMetricReporter creates a new metric reporter\nfunc NewMetricReporter(provider otelmetric.MeterProvider) *MetricReporter {\n\tif provider == nil {\n\t\tprovider = otel.GetMeterProvider()\n\t}\n\treturn &MetricReporter{\n\t\tmeterProvider: provider,\n\t\tcounters:      make(map[string]otelmetric.Int64Counter),\n\t\thistograms:    make(map[string]otelmetric.Float64Histogram),\n\t}\n}\n\nfunc (r *MetricReporter) getCounter(meterName, metricName string) otelmetric.Int64Counter {\n\tkey := fmt.Sprintf(\"%s_%s\", meterName, metricName)\n\n\tr.mu.RLock()\n\tif counter, ok := r.counters[key]; ok {\n\t\tr.mu.RUnlock()\n\t\treturn counter\n\t}\n\tr.mu.RUnlock()\n\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\t// Double check\n\tif counter, ok := r.counters[key]; ok {\n\t\treturn counter\n\t}\n\n\tmeter := r.meterProvider.Meter(meterName)\n\tcounter, err := meter.Int64Counter(metricName)\n\tif err != nil {\n\t\totel.Handle(err)\n\t\treturn noop.Int64Counter{}\n\t}\n\tr.counters[key] = counter\n\treturn counter\n}\n\nfunc (r *MetricReporter) getHistogram(meterName, metricName string, bounds []float64) otelmetric.Float64Histogram {\n\tkey := fmt.Sprintf(\"%s_%s\", meterName, metricName)\n\n\tr.mu.RLock()\n\tif histogram, ok := r.histograms[key]; ok {\n\t\tr.mu.RUnlock()\n\t\treturn histogram\n\t}\n\tr.mu.RUnlock()\n\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\t// Double check\n\tif histogram, ok := r.histograms[key]; ok {\n\t\treturn histogram\n\t}\n\n\tmeter := r.meterProvider.Meter(meterName)\n\tvar opts []otelmetric.Float64HistogramOption\n\tif len(bounds) > 0 {\n\t\topts = append(opts, otelmetric.WithExplicitBucketBoundaries(bounds...))\n\t}\n\thistogram, err := meter.Float64Histogram(metricName, opts...)\n\tif err != nil {\n\t\totel.Handle(err)\n\t\treturn noop.Float64Histogram{}\n\t}\n\tr.histograms[key] = histogram\n\treturn histogram\n}\n\n// ReportServerMetric reports server-side (被调) metrics\nfunc (r *MetricReporter) ReportServerMetric(ctx context.Context, dim *ServerDimension, costMs float64) {\n\tattrs := dim.ToAttributes()\n\n\t// requests\n\tr.getCounter(ServerReportMeterName, RequestsMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n\n\t// success / timeout / abnormal\n\tif dim.IsSuccess() {\n\t\tr.getCounter(ServerReportMeterName, SuccessMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n\t} else if dim.IsTimeout() {\n\t\tr.getCounter(ServerReportMeterName, TimeoutMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n\t} else {\n\t\tr.getCounter(ServerReportMeterName, AbnormalMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n\t}\n\n\t// cost\n\tr.getCounter(ServerReportMeterName, CostMetricName).Add(ctx, int64(costMs), otelmetric.WithAttributes(attrs...))\n\n\t// duration histogram\n\tr.getHistogram(ServerReportMeterName, DurationMetricName, DefaultDurationBounds).Record(ctx, costMs, otelmetric.WithAttributes(attrs...))\n}\n\n// ReportClientMetric reports client-side (主调) metrics\nfunc (r *MetricReporter) ReportClientMetric(ctx context.Context, dim *ClientDimension, costMs float64) {\n\tattrs := dim.ToAttributes()\n\n\t// requests\n\tr.getCounter(ClientReportMeterName, RequestsMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n\n\t// success / timeout / abnormal\n\tif dim.IsSuccess() {\n\t\tr.getCounter(ClientReportMeterName, SuccessMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n\t} else if dim.IsTimeout() {\n\t\tr.getCounter(ClientReportMeterName, TimeoutMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n\t} else {\n\t\tr.getCounter(ClientReportMeterName, AbnormalMetricName).Add(ctx, 1, otelmetric.WithAttributes(attrs...))\n\t}\n\n\t// cost\n\tr.getCounter(ClientReportMeterName, CostMetricName).Add(ctx, int64(costMs), otelmetric.WithAttributes(attrs...))\n\n\t// duration histogram\n\tr.getHistogram(ClientReportMeterName, DurationMetricName, DefaultDurationBounds).Record(ctx, costMs, otelmetric.WithAttributes(attrs...))\n}\n\n// ReportServerMetric is a convenience function using the global reporter\nfunc ReportServerMetric(ctx context.Context, dim *ServerDimension, costMs float64) {\n\tGetGlobalReporter().ReportServerMetric(ctx, dim, costMs)\n}\n\n// ReportClientMetric is a convenience function using the global reporter\nfunc ReportClientMetric(ctx context.Context, dim *ClientDimension, costMs float64) {\n\tGetGlobalReporter().ReportClientMetric(ctx, dim, costMs)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/stdout/stdout.metric.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage stdout\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"go.opentelemetry.io/otel/exporters/stdout/stdoutmetric\"\n\t\"go.opentelemetry.io/otel/sdk/metric\"\n)\n\ntype StdoutExporterBuilderOptions struct {\n\tstdoutmetricOpts []stdoutmetric.Option\n}\n\ntype StdoutExporterBuilder struct {\n\topts StdoutExporterBuilderOptions\n}\n\nfunc defaultBuilderOptions() StdoutExporterBuilderOptions {\n\treturn StdoutExporterBuilderOptions{}\n}\n\nfunc NewStdoutExporterBuilder(opts ...StdoutExporterBuilderOption) *StdoutExporterBuilder {\n\n\tbuilder := &StdoutExporterBuilder{\n\t\topts: defaultBuilderOptions(),\n\t}\n\tbuilder.ApplyOptions(opts...)\n\treturn builder\n}\n\nfunc (p *StdoutExporterBuilder) Build(\n\tctx context.Context,\n) (metric.Exporter, error) {\n\n\texporter, err := stdoutmetric.New(p.opts.stdoutmetricOpts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating stdoutmetric exporter: %w\", err)\n\t}\n\n\treturn exporter, nil\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/stdout/stdout.metric.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage stdout\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\n\t\"go.opentelemetry.io/otel/exporters/stdout/stdoutmetric\"\n)\n\nfunc WithPrettyPrint(prettyPrint bool) StdoutExporterBuilderOption {\n\treturn StdoutExporterBuilderOptionFunc(func(m *StdoutExporterBuilder) {\n\t\tif prettyPrint {\n\t\t\t// Print with a JSON encoder that indents with two spaces.\n\t\t\tenc := json.NewEncoder(os.Stdout)\n\t\t\tenc.SetIndent(\"\", \"  \")\n\t\t\tm.opts.stdoutmetricOpts = append(m.opts.stdoutmetricOpts, stdoutmetric.WithEncoder(enc))\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/metric/stdout/stdout.metric_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage stdout\n\n// A StdoutExporterBuilderOption sets options.\ntype StdoutExporterBuilderOption interface {\n\tapply(*StdoutExporterBuilder)\n}\n\n// EmptyStdoutExporterBuilderOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyStdoutExporterBuilderOption struct{}\n\nfunc (EmptyStdoutExporterBuilderOption) apply(*StdoutExporterBuilder) {}\n\n// StdoutExporterBuilderOptionFunc wraps a function that modifies Client into an\n// implementation of the StdoutExporterBuilderOption interface.\ntype StdoutExporterBuilderOptionFunc func(*StdoutExporterBuilder)\n\nfunc (f StdoutExporterBuilderOptionFunc) apply(do *StdoutExporterBuilder) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _StdoutExporterBuilderOptionWithDefault() StdoutExporterBuilderOption {\n\treturn StdoutExporterBuilderOptionFunc(func(*StdoutExporterBuilder) {\n\t\t// nothing to change\n\t})\n}\n\nfunc (o *StdoutExporterBuilder) ApplyOptions(\n\toptions ...StdoutExporterBuilderOption,\n) *StdoutExporterBuilder {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/opentelemetry/opentelemetry.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage opentelemetry\n\nimport (\n\t\"context\"\n\n\tmetric_ \"github.com/kaydxh/golang/pkg/opentelemetry/metric\"\n\t\"github.com/kaydxh/golang/pkg/opentelemetry/metric/api\"\n\ttracer_ \"github.com/kaydxh/golang/pkg/opentelemetry/tracer\"\n)\n\ntype OpenTelemetryServiceOptions struct {\n\tmeterOptions    []metric_.MeterOption\n\tappMeterOptions []metric_.MeterOption // App MeterProvider options\n\ttracerOptions   []tracer_.TracerOption\n}\n\ntype OpenTelemetryService struct {\n\topts OpenTelemetryServiceOptions\n}\n\nfunc NewOpenTelemetryService(opts ...OpenTelemetryServiceOption) *OpenTelemetryService {\n\tt := &OpenTelemetryService{}\n\tt.ApplyOptions(opts...)\n\n\treturn t\n}\n\nfunc (t *OpenTelemetryService) Install(ctx context.Context) error {\n\n\t// Install Global MeterProvider\n\tif len(t.opts.meterOptions) > 0 {\n\t\tmeter := metric_.NewMeter(t.opts.meterOptions...)\n\t\terr := meter.Install(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Install App MeterProvider (separate from global)\n\tif len(t.opts.appMeterOptions) > 0 {\n\t\tappMeter := metric_.NewMeter(t.opts.appMeterOptions...)\n\t\tappProvider, err := appMeter.InstallAsAppProvider(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif appProvider != nil {\n\t\t\tapi.SetAppMeterProvider(appProvider)\n\t\t}\n\t}\n\n\tif len(t.opts.tracerOptions) > 0 {\n\t\ttracer := tracer_.NewTracer(t.opts.tracerOptions...)\n\t\terr := tracer.Install(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/opentelemetry/opentelemetry.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage opentelemetry\n\nimport (\n\t\"time\"\n\n\t\"github.com/kaydxh/golang/pkg/opentelemetry/metric\"\n\t\"github.com/kaydxh/golang/pkg/opentelemetry/tracer\"\n\t\"go.opentelemetry.io/otel/sdk/resource\"\n)\n\nfunc WithMeterPushExporter(pushExporterBuilder metric.PushExporterBuilder) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.meterOptions = append(o.opts.meterOptions, metric.WithPushExporter(pushExporterBuilder))\n\n\t})\n}\n\nfunc WithMeterPullExporter(pullExporterBuilder metric.PullExporterBuilder) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.meterOptions = append(o.opts.meterOptions, metric.WithPullExporter(pullExporterBuilder))\n\t})\n}\n\nfunc WithMetricCollectDuration(period time.Duration) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.meterOptions = append(o.opts.meterOptions, metric.WithCollectPeriod(period))\n\t})\n}\n\nfunc WithTracerExporter(exporterBuilder tracer.TracerExporterBuilder) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.tracerOptions = append(o.opts.tracerOptions, tracer.WithExporterBuilder(exporterBuilder))\n\t})\n}\n\n// WithResource sets a custom resource for both tracer and meter\nfunc WithResource(res *resource.Resource) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.meterOptions = append(o.opts.meterOptions, metric.WithResource(res))\n\t\to.opts.tracerOptions = append(o.opts.tracerOptions, tracer.WithResource(res))\n\t})\n}\n\n// WithMeterResource sets a custom resource for meter only (not tracer)\n// Use this when tracer is initialized separately\nfunc WithMeterResource(res *resource.Resource) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.meterOptions = append(o.opts.meterOptions, metric.WithResource(res))\n\t})\n}\n\n// ========================================\n// App MeterProvider Options (双 Provider 支持)\n// ========================================\n\n// WithAppMeterPushExporter sets the push exporter for App MeterProvider\nfunc WithAppMeterPushExporter(pushExporterBuilder metric.PushExporterBuilder) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.appMeterOptions = append(o.opts.appMeterOptions, metric.WithPushExporter(pushExporterBuilder))\n\t})\n}\n\n// WithAppMeterPullExporter sets the pull exporter for App MeterProvider\nfunc WithAppMeterPullExporter(pullExporterBuilder metric.PullExporterBuilder) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.appMeterOptions = append(o.opts.appMeterOptions, metric.WithPullExporter(pullExporterBuilder))\n\t})\n}\n\n// WithAppMetricCollectDuration sets the collect duration for App MeterProvider\nfunc WithAppMetricCollectDuration(period time.Duration) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.appMeterOptions = append(o.opts.appMeterOptions, metric.WithCollectPeriod(period))\n\t})\n}\n\n// WithAppMeterResource sets a custom resource for App MeterProvider\nfunc WithAppMeterResource(res *resource.Resource) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.appMeterOptions = append(o.opts.appMeterOptions, metric.WithResource(res))\n\t})\n}\n\n// WithMeterExporterLogging enables logging for metric export operations\n// name: exporter name for logging (e.g., \"OTLP\", \"stdout\")\n// endpoint: endpoint address for logging\nfunc WithMeterExporterLogging(name, endpoint string) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.meterOptions = append(o.opts.meterOptions, metric.WithExporterLogging(name, endpoint))\n\t})\n}\n\n// WithAppMeterExporterLogging enables logging for App MeterProvider export operations\nfunc WithAppMeterExporterLogging(name, endpoint string) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.appMeterOptions = append(o.opts.appMeterOptions, metric.WithExporterLogging(name, endpoint))\n\t})\n}\n\n// WithTracerExporterLogging enables logging for trace export operations\n// name: exporter name for logging (e.g., \"OTLP\", \"Jaeger\", \"stdout\")\n// endpoint: endpoint address for logging\nfunc WithTracerExporterLogging(name, endpoint string) OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(o *OpenTelemetryService) {\n\t\to.opts.tracerOptions = append(o.opts.tracerOptions, tracer.WithExporterLogging(name, endpoint))\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/opentelemetry.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.36.10\n// \tprotoc        v5.29.3\n// source: pkg/opentelemetry/opentelemetry.proto\n\npackage opentelemetry\n\nimport (\n\treflect \"reflect\"\n\tsync \"sync\"\n\tunsafe \"unsafe\"\n\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tdurationpb \"google.golang.org/protobuf/types/known/durationpb\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype OtelTraceExporterType int32\n\nconst (\n\tOtelTraceExporterType_trace_none   OtelTraceExporterType = 0\n\tOtelTraceExporterType_trace_stdout OtelTraceExporterType = 1\n\tOtelTraceExporterType_trace_otlp   OtelTraceExporterType = 2\n)\n\n// Enum value maps for OtelTraceExporterType.\nvar (\n\tOtelTraceExporterType_name = map[int32]string{\n\t\t0: \"trace_none\",\n\t\t1: \"trace_stdout\",\n\t\t2: \"trace_otlp\",\n\t}\n\tOtelTraceExporterType_value = map[string]int32{\n\t\t\"trace_none\":   0,\n\t\t\"trace_stdout\": 1,\n\t\t\"trace_otlp\":   2,\n\t}\n)\n\nfunc (x OtelTraceExporterType) Enum() *OtelTraceExporterType {\n\tp := new(OtelTraceExporterType)\n\t*p = x\n\treturn p\n}\n\nfunc (x OtelTraceExporterType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (OtelTraceExporterType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_enumTypes[0].Descriptor()\n}\n\nfunc (OtelTraceExporterType) Type() protoreflect.EnumType {\n\treturn &file_pkg_opentelemetry_opentelemetry_proto_enumTypes[0]\n}\n\nfunc (x OtelTraceExporterType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use OtelTraceExporterType.Descriptor instead.\nfunc (OtelTraceExporterType) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{0}\n}\n\ntype OtelMetricExporterType int32\n\nconst (\n\tOtelMetricExporterType_metric_none       OtelMetricExporterType = 0\n\tOtelMetricExporterType_metric_stdout     OtelMetricExporterType = 1\n\tOtelMetricExporterType_metric_otlp       OtelMetricExporterType = 2\n\tOtelMetricExporterType_metric_prometheus OtelMetricExporterType = 3\n)\n\n// Enum value maps for OtelMetricExporterType.\nvar (\n\tOtelMetricExporterType_name = map[int32]string{\n\t\t0: \"metric_none\",\n\t\t1: \"metric_stdout\",\n\t\t2: \"metric_otlp\",\n\t\t3: \"metric_prometheus\",\n\t}\n\tOtelMetricExporterType_value = map[string]int32{\n\t\t\"metric_none\":       0,\n\t\t\"metric_stdout\":     1,\n\t\t\"metric_otlp\":       2,\n\t\t\"metric_prometheus\": 3,\n\t}\n)\n\nfunc (x OtelMetricExporterType) Enum() *OtelMetricExporterType {\n\tp := new(OtelMetricExporterType)\n\t*p = x\n\treturn p\n}\n\nfunc (x OtelMetricExporterType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (OtelMetricExporterType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_enumTypes[1].Descriptor()\n}\n\nfunc (OtelMetricExporterType) Type() protoreflect.EnumType {\n\treturn &file_pkg_opentelemetry_opentelemetry_proto_enumTypes[1]\n}\n\nfunc (x OtelMetricExporterType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use OtelMetricExporterType.Descriptor instead.\nfunc (OtelMetricExporterType) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{1}\n}\n\ntype OtelLogExporterType int32\n\nconst (\n\tOtelLogExporterType_log_none OtelLogExporterType = 0\n\tOtelLogExporterType_log_otlp OtelLogExporterType = 1\n)\n\n// Enum value maps for OtelLogExporterType.\nvar (\n\tOtelLogExporterType_name = map[int32]string{\n\t\t0: \"log_none\",\n\t\t1: \"log_otlp\",\n\t}\n\tOtelLogExporterType_value = map[string]int32{\n\t\t\"log_none\": 0,\n\t\t\"log_otlp\": 1,\n\t}\n)\n\nfunc (x OtelLogExporterType) Enum() *OtelLogExporterType {\n\tp := new(OtelLogExporterType)\n\t*p = x\n\treturn p\n}\n\nfunc (x OtelLogExporterType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (OtelLogExporterType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_enumTypes[2].Descriptor()\n}\n\nfunc (OtelLogExporterType) Type() protoreflect.EnumType {\n\treturn &file_pkg_opentelemetry_opentelemetry_proto_enumTypes[2]\n}\n\nfunc (x OtelLogExporterType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use OtelLogExporterType.Descriptor instead.\nfunc (OtelLogExporterType) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{2}\n}\n\n// OpenTelemetry 统一监控配置（去掉 Monitor 包装层）\ntype OpenTelemetry struct {\n\tstate                  protoimpl.MessageState `protogen:\"open.v1\"`\n\tEnabled                bool                   `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tMetricCollectDuration  *durationpb.Duration   `protobuf:\"bytes,2,opt,name=metric_collect_duration,json=metricCollectDuration,proto3\" json:\"metric_collect_duration,omitempty\"`\n\tOtelTraceExporterType  OtelTraceExporterType  `protobuf:\"varint,3,opt,name=otel_trace_exporter_type,json=otelTraceExporterType,proto3,enum=go.pkg.opentelemetry.OtelTraceExporterType\" json:\"otel_trace_exporter_type,omitempty\"`\n\tOtelMetricExporterType OtelMetricExporterType `protobuf:\"varint,4,opt,name=otel_metric_exporter_type,json=otelMetricExporterType,proto3,enum=go.pkg.opentelemetry.OtelMetricExporterType\" json:\"otel_metric_exporter_type,omitempty\"`\n\tOtelLogExporterType    OtelLogExporterType    `protobuf:\"varint,5,opt,name=otel_log_exporter_type,json=otelLogExporterType,proto3,enum=go.pkg.opentelemetry.OtelLogExporterType\" json:\"otel_log_exporter_type,omitempty\"`\n\tOtelMetricExporter     *OtelMetricExporter    `protobuf:\"bytes,6,opt,name=otel_metric_exporter,json=otelMetricExporter,proto3\" json:\"otel_metric_exporter,omitempty\"`\n\tOtelTraceExporter      *OtelTraceExporter     `protobuf:\"bytes,7,opt,name=otel_trace_exporter,json=otelTraceExporter,proto3\" json:\"otel_trace_exporter,omitempty\"`\n\tResource               *Resource              `protobuf:\"bytes,10,opt,name=resource,proto3\" json:\"resource,omitempty\"`\n\t// App MeterProvider configuration (separate from global)\n\t// If enabled, creates an independent MeterProvider for application-level metrics\n\tAppMeterProvider *AppMeterProvider `protobuf:\"bytes,11,opt,name=app_meter_provider,json=appMeterProvider,proto3\" json:\"app_meter_provider,omitempty\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *OpenTelemetry) Reset() {\n\t*x = OpenTelemetry{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *OpenTelemetry) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*OpenTelemetry) ProtoMessage() {}\n\nfunc (x *OpenTelemetry) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[0]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use OpenTelemetry.ProtoReflect.Descriptor instead.\nfunc (*OpenTelemetry) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *OpenTelemetry) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *OpenTelemetry) GetMetricCollectDuration() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.MetricCollectDuration\n\t}\n\treturn nil\n}\n\nfunc (x *OpenTelemetry) GetOtelTraceExporterType() OtelTraceExporterType {\n\tif x != nil {\n\t\treturn x.OtelTraceExporterType\n\t}\n\treturn OtelTraceExporterType_trace_none\n}\n\nfunc (x *OpenTelemetry) GetOtelMetricExporterType() OtelMetricExporterType {\n\tif x != nil {\n\t\treturn x.OtelMetricExporterType\n\t}\n\treturn OtelMetricExporterType_metric_none\n}\n\nfunc (x *OpenTelemetry) GetOtelLogExporterType() OtelLogExporterType {\n\tif x != nil {\n\t\treturn x.OtelLogExporterType\n\t}\n\treturn OtelLogExporterType_log_none\n}\n\nfunc (x *OpenTelemetry) GetOtelMetricExporter() *OtelMetricExporter {\n\tif x != nil {\n\t\treturn x.OtelMetricExporter\n\t}\n\treturn nil\n}\n\nfunc (x *OpenTelemetry) GetOtelTraceExporter() *OtelTraceExporter {\n\tif x != nil {\n\t\treturn x.OtelTraceExporter\n\t}\n\treturn nil\n}\n\nfunc (x *OpenTelemetry) GetResource() *Resource {\n\tif x != nil {\n\t\treturn x.Resource\n\t}\n\treturn nil\n}\n\nfunc (x *OpenTelemetry) GetAppMeterProvider() *AppMeterProvider {\n\tif x != nil {\n\t\treturn x.AppMeterProvider\n\t}\n\treturn nil\n}\n\n// AppMeterProvider configuration for application-level metrics\n// Allows separation between infrastructure metrics (global) and business metrics (app)\ntype AppMeterProvider struct {\n\tstate   protoimpl.MessageState `protogen:\"open.v1\"`\n\tEnabled bool                   `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"` // Enable separate App MeterProvider\n\t// Exporter type for app metrics (if different from global)\n\t// If not set, uses the same exporter type as global\n\tExporterType OtelMetricExporterType `protobuf:\"varint,2,opt,name=exporter_type,json=exporterType,proto3,enum=go.pkg.opentelemetry.OtelMetricExporterType\" json:\"exporter_type,omitempty\"`\n\t// Exporter configuration (if different from global)\n\tExporter *OtelMetricExporter `protobuf:\"bytes,3,opt,name=exporter,proto3\" json:\"exporter,omitempty\"`\n\t// Collect duration for app metrics (if different from global)\n\tCollectDuration *durationpb.Duration `protobuf:\"bytes,4,opt,name=collect_duration,json=collectDuration,proto3\" json:\"collect_duration,omitempty\"`\n\t// Resource attributes specific to app metrics\n\t// If not set, inherits from global resource\n\tResource      *Resource `protobuf:\"bytes,5,opt,name=resource,proto3\" json:\"resource,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *AppMeterProvider) Reset() {\n\t*x = AppMeterProvider{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *AppMeterProvider) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*AppMeterProvider) ProtoMessage() {}\n\nfunc (x *AppMeterProvider) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[1]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use AppMeterProvider.ProtoReflect.Descriptor instead.\nfunc (*AppMeterProvider) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{1}\n}\n\nfunc (x *AppMeterProvider) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *AppMeterProvider) GetExporterType() OtelMetricExporterType {\n\tif x != nil {\n\t\treturn x.ExporterType\n\t}\n\treturn OtelMetricExporterType_metric_none\n}\n\nfunc (x *AppMeterProvider) GetExporter() *OtelMetricExporter {\n\tif x != nil {\n\t\treturn x.Exporter\n\t}\n\treturn nil\n}\n\nfunc (x *AppMeterProvider) GetCollectDuration() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.CollectDuration\n\t}\n\treturn nil\n}\n\nfunc (x *AppMeterProvider) GetResource() *Resource {\n\tif x != nil {\n\t\treturn x.Resource\n\t}\n\treturn nil\n}\n\ntype Resource struct {\n\tstate          protoimpl.MessageState `protogen:\"open.v1\"`\n\tServiceName    string                 `protobuf:\"bytes,1,opt,name=service_name,json=serviceName,proto3\" json:\"service_name,omitempty\"`          // default use process name\n\tServiceVersion string                 `protobuf:\"bytes,2,opt,name=service_version,json=serviceVersion,proto3\" json:\"service_version,omitempty\"` // service version\n\tAttrs          map[string]string      `protobuf:\"bytes,3,rep,name=attrs,proto3\" json:\"attrs,omitempty\" protobuf_key:\"bytes,1,opt,name=key\" protobuf_val:\"bytes,2,opt,name=value\"`\n\t// K8s resource configuration\n\tK8S *K8SResource `protobuf:\"bytes,10,opt,name=k8s,proto3\" json:\"k8s,omitempty\"`\n\t// APM (Application Performance Management) configuration\n\t// For Tencent Cloud APM: https://console.cloud.tencent.com/apm/monitor/access\n\tApm *Apm `protobuf:\"bytes,11,opt,name=apm,proto3\" json:\"apm,omitempty\"`\n\t// ZhiYan platform configuration for internal monitoring\n\tZhiyan        *ZhiYan `protobuf:\"bytes,12,opt,name=zhiyan,proto3\" json:\"zhiyan,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Resource) Reset() {\n\t*x = Resource{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Resource) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Resource) ProtoMessage() {}\n\nfunc (x *Resource) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[2]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Resource.ProtoReflect.Descriptor instead.\nfunc (*Resource) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{2}\n}\n\nfunc (x *Resource) GetServiceName() string {\n\tif x != nil {\n\t\treturn x.ServiceName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Resource) GetServiceVersion() string {\n\tif x != nil {\n\t\treturn x.ServiceVersion\n\t}\n\treturn \"\"\n}\n\nfunc (x *Resource) GetAttrs() map[string]string {\n\tif x != nil {\n\t\treturn x.Attrs\n\t}\n\treturn nil\n}\n\nfunc (x *Resource) GetK8S() *K8SResource {\n\tif x != nil {\n\t\treturn x.K8S\n\t}\n\treturn nil\n}\n\nfunc (x *Resource) GetApm() *Apm {\n\tif x != nil {\n\t\treturn x.Apm\n\t}\n\treturn nil\n}\n\nfunc (x *Resource) GetZhiyan() *ZhiYan {\n\tif x != nil {\n\t\treturn x.Zhiyan\n\t}\n\treturn nil\n}\n\n// APM configuration for Application Performance Management\n// Token is required for APM data reporting and will be added as resource attribute\ntype Apm struct {\n\tstate protoimpl.MessageState `protogen:\"open.v1\"`\n\t// APM Token for authentication, associated with business system\n\t// Get from: https://console.cloud.tencent.com/apm/monitor/access\n\tToken         string `protobuf:\"bytes,1,opt,name=token,proto3\" json:\"token,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Apm) Reset() {\n\t*x = Apm{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Apm) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Apm) ProtoMessage() {}\n\nfunc (x *Apm) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[3]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Apm.ProtoReflect.Descriptor instead.\nfunc (*Apm) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{3}\n}\n\nfunc (x *Apm) GetToken() string {\n\tif x != nil {\n\t\treturn x.Token\n\t}\n\treturn \"\"\n}\n\n// ZhiYan platform configuration for internal monitoring\ntype ZhiYan struct {\n\tstate protoimpl.MessageState `protogen:\"open.v1\"`\n\t// App mark for metric reporting (上报 appMark)\n\t// Used for business data reporting\n\tAppMark string `protobuf:\"bytes,1,opt,name=app_mark,json=appMark,proto3\" json:\"app_mark,omitempty\"`\n\t// Global app mark for modcall and system-level metric reporting\n\t// Used for infrastructure/global metrics\n\tGlobalAppMark string `protobuf:\"bytes,2,opt,name=global_app_mark,json=globalAppMark,proto3\" json:\"global_app_mark,omitempty\"`\n\t// Environment for metric reporting (e.g., \"prod\", \"test\", \"dev\")\n\t// If empty, defaults to \"prod\" for production environment\n\tEnv string `protobuf:\"bytes,3,opt,name=env,proto3\" json:\"env,omitempty\"`\n\t// Instance mark for attribute reporting\n\t// If empty, uses pod IP or host IP\n\tInstanceMark string `protobuf:\"bytes,4,opt,name=instance_mark,json=instanceMark,proto3\" json:\"instance_mark,omitempty\"`\n\t// APM Token for trace reporting to ZhiYan APM\n\t// Format: \"空间ID#日志租户#监控宝租户\" e.g., \"1481#sdk-xxx#5546_35686___apm\"\n\t// 监控宝 > 应用性能监控 > 接入管理\n\tZhiyanApmToken string `protobuf:\"bytes,5,opt,name=zhiyan_apm_token,json=zhiyanApmToken,proto3\" json:\"zhiyan_apm_token,omitempty\"`\n\t// Whether to expand resource attributes to metric dimensions\n\t// \"yes\" or \"no\" (default: \"no\")\n\tExpandKey string `protobuf:\"bytes,6,opt,name=expand_key,json=expandKey,proto3\" json:\"expand_key,omitempty\"`\n\t// Metric group for ZhiYan (指标组)\n\t// This is used as the scope name when creating Meter\n\t// If empty, defaults to \"default\"\n\t// Common values: \"default\", \"client_report\", \"server_report\"\n\tMetricGroup string `protobuf:\"bytes,7,opt,name=metric_group,json=metricGroup,proto3\" json:\"metric_group,omitempty\"`\n\t// Data granularity for metric reporting (数据粒度)\n\t// Valid values: 10, 30, 60 (default: 60, minutes)\n\t// For sub-minute reporting, set data_type to \"second\"\n\tDataGrain int32 `protobuf:\"varint,8,opt,name=data_grain,json=dataGrain,proto3\" json:\"data_grain,omitempty\"`\n\t// Data type for metric reporting (数据类型)\n\t// Set to \"second\" for sub-minute granularity data\n\tDataType      string `protobuf:\"bytes,9,opt,name=data_type,json=dataType,proto3\" json:\"data_type,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *ZhiYan) Reset() {\n\t*x = ZhiYan{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ZhiYan) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ZhiYan) ProtoMessage() {}\n\nfunc (x *ZhiYan) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[4]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ZhiYan.ProtoReflect.Descriptor instead.\nfunc (*ZhiYan) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{4}\n}\n\nfunc (x *ZhiYan) GetAppMark() string {\n\tif x != nil {\n\t\treturn x.AppMark\n\t}\n\treturn \"\"\n}\n\nfunc (x *ZhiYan) GetGlobalAppMark() string {\n\tif x != nil {\n\t\treturn x.GlobalAppMark\n\t}\n\treturn \"\"\n}\n\nfunc (x *ZhiYan) GetEnv() string {\n\tif x != nil {\n\t\treturn x.Env\n\t}\n\treturn \"\"\n}\n\nfunc (x *ZhiYan) GetInstanceMark() string {\n\tif x != nil {\n\t\treturn x.InstanceMark\n\t}\n\treturn \"\"\n}\n\nfunc (x *ZhiYan) GetZhiyanApmToken() string {\n\tif x != nil {\n\t\treturn x.ZhiyanApmToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ZhiYan) GetExpandKey() string {\n\tif x != nil {\n\t\treturn x.ExpandKey\n\t}\n\treturn \"\"\n}\n\nfunc (x *ZhiYan) GetMetricGroup() string {\n\tif x != nil {\n\t\treturn x.MetricGroup\n\t}\n\treturn \"\"\n}\n\nfunc (x *ZhiYan) GetDataGrain() int32 {\n\tif x != nil {\n\t\treturn x.DataGrain\n\t}\n\treturn 0\n}\n\nfunc (x *ZhiYan) GetDataType() string {\n\tif x != nil {\n\t\treturn x.DataType\n\t}\n\treturn \"\"\n}\n\ntype K8SResource struct {\n\tstate   protoimpl.MessageState `protogen:\"open.v1\"`\n\tEnabled bool                   `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"` // enable K8s attribute detection from env vars (default: true)\n\t// Override values (if not set, read from environment variables)\n\tNodeIp            string `protobuf:\"bytes,2,opt,name=node_ip,json=nodeIp,proto3\" json:\"node_ip,omitempty\"`                                  // override NODE_IP env var\n\tPodNamespace      string `protobuf:\"bytes,3,opt,name=pod_namespace,json=podNamespace,proto3\" json:\"pod_namespace,omitempty\"`                // override POD_NAMESPACE env var\n\tPodName           string `protobuf:\"bytes,4,opt,name=pod_name,json=podName,proto3\" json:\"pod_name,omitempty\"`                               // override POD_NAME env var\n\tPodIp             string `protobuf:\"bytes,5,opt,name=pod_ip,json=podIp,proto3\" json:\"pod_ip,omitempty\"`                                     // override POD_IP env var\n\tContainerName     string `protobuf:\"bytes,6,opt,name=container_name,json=containerName,proto3\" json:\"container_name,omitempty\"`             // override CONTAINER_NAME env var\n\tContainerPlatform string `protobuf:\"bytes,7,opt,name=container_platform,json=containerPlatform,proto3\" json:\"container_platform,omitempty\"` // override CONTAINER_PLATFORM env var (e.g., STKE, TKE)\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *K8SResource) Reset() {\n\t*x = K8SResource{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *K8SResource) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*K8SResource) ProtoMessage() {}\n\nfunc (x *K8SResource) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[5]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use K8SResource.ProtoReflect.Descriptor instead.\nfunc (*K8SResource) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{5}\n}\n\nfunc (x *K8SResource) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *K8SResource) GetNodeIp() string {\n\tif x != nil {\n\t\treturn x.NodeIp\n\t}\n\treturn \"\"\n}\n\nfunc (x *K8SResource) GetPodNamespace() string {\n\tif x != nil {\n\t\treturn x.PodNamespace\n\t}\n\treturn \"\"\n}\n\nfunc (x *K8SResource) GetPodName() string {\n\tif x != nil {\n\t\treturn x.PodName\n\t}\n\treturn \"\"\n}\n\nfunc (x *K8SResource) GetPodIp() string {\n\tif x != nil {\n\t\treturn x.PodIp\n\t}\n\treturn \"\"\n}\n\nfunc (x *K8SResource) GetContainerName() string {\n\tif x != nil {\n\t\treturn x.ContainerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *K8SResource) GetContainerPlatform() string {\n\tif x != nil {\n\t\treturn x.ContainerPlatform\n\t}\n\treturn \"\"\n}\n\ntype OtelMetricExporter struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tPrometheus    *Prometheus            `protobuf:\"bytes,1,opt,name=prometheus,proto3\" json:\"prometheus,omitempty\"`\n\tStdout        *Stdout                `protobuf:\"bytes,2,opt,name=stdout,proto3\" json:\"stdout,omitempty\"`\n\tOtlp          *OTLP                  `protobuf:\"bytes,3,opt,name=otlp,proto3\" json:\"otlp,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *OtelMetricExporter) Reset() {\n\t*x = OtelMetricExporter{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *OtelMetricExporter) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*OtelMetricExporter) ProtoMessage() {}\n\nfunc (x *OtelMetricExporter) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[6]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use OtelMetricExporter.ProtoReflect.Descriptor instead.\nfunc (*OtelMetricExporter) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{6}\n}\n\nfunc (x *OtelMetricExporter) GetPrometheus() *Prometheus {\n\tif x != nil {\n\t\treturn x.Prometheus\n\t}\n\treturn nil\n}\n\nfunc (x *OtelMetricExporter) GetStdout() *Stdout {\n\tif x != nil {\n\t\treturn x.Stdout\n\t}\n\treturn nil\n}\n\nfunc (x *OtelMetricExporter) GetOtlp() *OTLP {\n\tif x != nil {\n\t\treturn x.Otlp\n\t}\n\treturn nil\n}\n\ntype OtelTraceExporter struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tStdout        *Stdout                `protobuf:\"bytes,1,opt,name=stdout,proto3\" json:\"stdout,omitempty\"`\n\tOtlp          *OTLP                  `protobuf:\"bytes,2,opt,name=otlp,proto3\" json:\"otlp,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *OtelTraceExporter) Reset() {\n\t*x = OtelTraceExporter{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *OtelTraceExporter) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*OtelTraceExporter) ProtoMessage() {}\n\nfunc (x *OtelTraceExporter) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[7]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use OtelTraceExporter.ProtoReflect.Descriptor instead.\nfunc (*OtelTraceExporter) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{7}\n}\n\nfunc (x *OtelTraceExporter) GetStdout() *Stdout {\n\tif x != nil {\n\t\treturn x.Stdout\n\t}\n\treturn nil\n}\n\nfunc (x *OtelTraceExporter) GetOtlp() *OTLP {\n\tif x != nil {\n\t\treturn x.Otlp\n\t}\n\treturn nil\n}\n\ntype Prometheus struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tUrl           string                 `protobuf:\"bytes,1,opt,name=url,proto3\" json:\"url,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Prometheus) Reset() {\n\t*x = Prometheus{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Prometheus) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Prometheus) ProtoMessage() {}\n\nfunc (x *Prometheus) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[8]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Prometheus.ProtoReflect.Descriptor instead.\nfunc (*Prometheus) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{8}\n}\n\nfunc (x *Prometheus) GetUrl() string {\n\tif x != nil {\n\t\treturn x.Url\n\t}\n\treturn \"\"\n}\n\ntype Stdout struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tPrettyPrint   bool                   `protobuf:\"varint,1,opt,name=pretty_print,json=prettyPrint,proto3\" json:\"pretty_print,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Stdout) Reset() {\n\t*x = Stdout{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Stdout) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Stdout) ProtoMessage() {}\n\nfunc (x *Stdout) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[9]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Stdout.ProtoReflect.Descriptor instead.\nfunc (*Stdout) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{9}\n}\n\nfunc (x *Stdout) GetPrettyPrint() bool {\n\tif x != nil {\n\t\treturn x.PrettyPrint\n\t}\n\treturn false\n}\n\n// OTLP exporter configuration for Tencent Cloud Prometheus or other OTLP-compatible backends\ntype OTLP struct {\n\tstate protoimpl.MessageState `protogen:\"open.v1\"`\n\t// Endpoint URL (e.g., \"prometheus.tencentcloudapi.com:4317\" for gRPC)\n\t// For Tencent Cloud Prometheus, use the Remote Write address from console\n\tEndpoint string `protobuf:\"bytes,1,opt,name=endpoint,proto3\" json:\"endpoint,omitempty\"`\n\t// Authentication token (e.g., Tencent Cloud Prometheus Token)\n\tToken string `protobuf:\"bytes,2,opt,name=token,proto3\" json:\"token,omitempty\"`\n\t// Protocol: \"http\" or \"grpc\" (default: \"http\")\n\tProtocol string `protobuf:\"bytes,3,opt,name=protocol,proto3\" json:\"protocol,omitempty\"`\n\t// Use insecure connection (default: false)\n\tInsecure bool `protobuf:\"varint,4,opt,name=insecure,proto3\" json:\"insecure,omitempty\"`\n\t// Custom headers for authentication\n\tHeaders map[string]string `protobuf:\"bytes,5,rep,name=headers,proto3\" json:\"headers,omitempty\" protobuf_key:\"bytes,1,opt,name=key\" protobuf_val:\"bytes,2,opt,name=value\"`\n\t// URL path for HTTP protocol (default: \"/v1/metrics\")\n\tUrlPath string `protobuf:\"bytes,6,opt,name=url_path,json=urlPath,proto3\" json:\"url_path,omitempty\"`\n\t// Enable gzip compression (ZhiYan requires compression=gzip)\n\tCompression bool `protobuf:\"varint,7,opt,name=compression,proto3\" json:\"compression,omitempty\"`\n\t// Use Delta temporality instead of Cumulative (ZhiYan requires temporality_selector=delta)\n\tTemporalityDelta bool `protobuf:\"varint,8,opt,name=temporality_delta,json=temporalityDelta,proto3\" json:\"temporality_delta,omitempty\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *OTLP) Reset() {\n\t*x = OTLP{}\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *OTLP) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*OTLP) ProtoMessage() {}\n\nfunc (x *OTLP) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_opentelemetry_opentelemetry_proto_msgTypes[10]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use OTLP.ProtoReflect.Descriptor instead.\nfunc (*OTLP) Descriptor() ([]byte, []int) {\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP(), []int{10}\n}\n\nfunc (x *OTLP) GetEndpoint() string {\n\tif x != nil {\n\t\treturn x.Endpoint\n\t}\n\treturn \"\"\n}\n\nfunc (x *OTLP) GetToken() string {\n\tif x != nil {\n\t\treturn x.Token\n\t}\n\treturn \"\"\n}\n\nfunc (x *OTLP) GetProtocol() string {\n\tif x != nil {\n\t\treturn x.Protocol\n\t}\n\treturn \"\"\n}\n\nfunc (x *OTLP) GetInsecure() bool {\n\tif x != nil {\n\t\treturn x.Insecure\n\t}\n\treturn false\n}\n\nfunc (x *OTLP) GetHeaders() map[string]string {\n\tif x != nil {\n\t\treturn x.Headers\n\t}\n\treturn nil\n}\n\nfunc (x *OTLP) GetUrlPath() string {\n\tif x != nil {\n\t\treturn x.UrlPath\n\t}\n\treturn \"\"\n}\n\nfunc (x *OTLP) GetCompression() bool {\n\tif x != nil {\n\t\treturn x.Compression\n\t}\n\treturn false\n}\n\nfunc (x *OTLP) GetTemporalityDelta() bool {\n\tif x != nil {\n\t\treturn x.TemporalityDelta\n\t}\n\treturn false\n}\n\nvar File_pkg_opentelemetry_opentelemetry_proto protoreflect.FileDescriptor\n\nconst file_pkg_opentelemetry_opentelemetry_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"%pkg/opentelemetry/opentelemetry.proto\\x12\\x14go.pkg.opentelemetry\\x1a\\x1egoogle/protobuf/duration.proto\\\"\\xf2\\x05\\n\" +\n\t\"\\rOpenTelemetry\\x12\\x18\\n\" +\n\t\"\\aenabled\\x18\\x01 \\x01(\\bR\\aenabled\\x12Q\\n\" +\n\t\"\\x17metric_collect_duration\\x18\\x02 \\x01(\\v2\\x19.google.protobuf.DurationR\\x15metricCollectDuration\\x12d\\n\" +\n\t\"\\x18otel_trace_exporter_type\\x18\\x03 \\x01(\\x0e2+.go.pkg.opentelemetry.OtelTraceExporterTypeR\\x15otelTraceExporterType\\x12g\\n\" +\n\t\"\\x19otel_metric_exporter_type\\x18\\x04 \\x01(\\x0e2,.go.pkg.opentelemetry.OtelMetricExporterTypeR\\x16otelMetricExporterType\\x12^\\n\" +\n\t\"\\x16otel_log_exporter_type\\x18\\x05 \\x01(\\x0e2).go.pkg.opentelemetry.OtelLogExporterTypeR\\x13otelLogExporterType\\x12Z\\n\" +\n\t\"\\x14otel_metric_exporter\\x18\\x06 \\x01(\\v2(.go.pkg.opentelemetry.OtelMetricExporterR\\x12otelMetricExporter\\x12W\\n\" +\n\t\"\\x13otel_trace_exporter\\x18\\a \\x01(\\v2'.go.pkg.opentelemetry.OtelTraceExporterR\\x11otelTraceExporter\\x12:\\n\" +\n\t\"\\bresource\\x18\\n\" +\n\t\" \\x01(\\v2\\x1e.go.pkg.opentelemetry.ResourceR\\bresource\\x12T\\n\" +\n\t\"\\x12app_meter_provider\\x18\\v \\x01(\\v2&.go.pkg.opentelemetry.AppMeterProviderR\\x10appMeterProvider\\\"\\xc7\\x02\\n\" +\n\t\"\\x10AppMeterProvider\\x12\\x18\\n\" +\n\t\"\\aenabled\\x18\\x01 \\x01(\\bR\\aenabled\\x12Q\\n\" +\n\t\"\\rexporter_type\\x18\\x02 \\x01(\\x0e2,.go.pkg.opentelemetry.OtelMetricExporterTypeR\\fexporterType\\x12D\\n\" +\n\t\"\\bexporter\\x18\\x03 \\x01(\\v2(.go.pkg.opentelemetry.OtelMetricExporterR\\bexporter\\x12D\\n\" +\n\t\"\\x10collect_duration\\x18\\x04 \\x01(\\v2\\x19.google.protobuf.DurationR\\x0fcollectDuration\\x12:\\n\" +\n\t\"\\bresource\\x18\\x05 \\x01(\\v2\\x1e.go.pkg.opentelemetry.ResourceR\\bresource\\\"\\xe9\\x02\\n\" +\n\t\"\\bResource\\x12!\\n\" +\n\t\"\\fservice_name\\x18\\x01 \\x01(\\tR\\vserviceName\\x12'\\n\" +\n\t\"\\x0fservice_version\\x18\\x02 \\x01(\\tR\\x0eserviceVersion\\x12?\\n\" +\n\t\"\\x05attrs\\x18\\x03 \\x03(\\v2).go.pkg.opentelemetry.Resource.AttrsEntryR\\x05attrs\\x123\\n\" +\n\t\"\\x03k8s\\x18\\n\" +\n\t\" \\x01(\\v2!.go.pkg.opentelemetry.K8sResourceR\\x03k8s\\x12+\\n\" +\n\t\"\\x03apm\\x18\\v \\x01(\\v2\\x19.go.pkg.opentelemetry.ApmR\\x03apm\\x124\\n\" +\n\t\"\\x06zhiyan\\x18\\f \\x01(\\v2\\x1c.go.pkg.opentelemetry.ZhiYanR\\x06zhiyan\\x1a8\\n\" +\n\t\"\\n\" +\n\t\"AttrsEntry\\x12\\x10\\n\" +\n\t\"\\x03key\\x18\\x01 \\x01(\\tR\\x03key\\x12\\x14\\n\" +\n\t\"\\x05value\\x18\\x02 \\x01(\\tR\\x05value:\\x028\\x01\\\"\\x1b\\n\" +\n\t\"\\x03Apm\\x12\\x14\\n\" +\n\t\"\\x05token\\x18\\x01 \\x01(\\tR\\x05token\\\"\\xaa\\x02\\n\" +\n\t\"\\x06ZhiYan\\x12\\x19\\n\" +\n\t\"\\bapp_mark\\x18\\x01 \\x01(\\tR\\aappMark\\x12&\\n\" +\n\t\"\\x0fglobal_app_mark\\x18\\x02 \\x01(\\tR\\rglobalAppMark\\x12\\x10\\n\" +\n\t\"\\x03env\\x18\\x03 \\x01(\\tR\\x03env\\x12#\\n\" +\n\t\"\\rinstance_mark\\x18\\x04 \\x01(\\tR\\finstanceMark\\x12(\\n\" +\n\t\"\\x10zhiyan_apm_token\\x18\\x05 \\x01(\\tR\\x0ezhiyanApmToken\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"expand_key\\x18\\x06 \\x01(\\tR\\texpandKey\\x12!\\n\" +\n\t\"\\fmetric_group\\x18\\a \\x01(\\tR\\vmetricGroup\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"data_grain\\x18\\b \\x01(\\x05R\\tdataGrain\\x12\\x1b\\n\" +\n\t\"\\tdata_type\\x18\\t \\x01(\\tR\\bdataType\\\"\\xed\\x01\\n\" +\n\t\"\\vK8sResource\\x12\\x18\\n\" +\n\t\"\\aenabled\\x18\\x01 \\x01(\\bR\\aenabled\\x12\\x17\\n\" +\n\t\"\\anode_ip\\x18\\x02 \\x01(\\tR\\x06nodeIp\\x12#\\n\" +\n\t\"\\rpod_namespace\\x18\\x03 \\x01(\\tR\\fpodNamespace\\x12\\x19\\n\" +\n\t\"\\bpod_name\\x18\\x04 \\x01(\\tR\\apodName\\x12\\x15\\n\" +\n\t\"\\x06pod_ip\\x18\\x05 \\x01(\\tR\\x05podIp\\x12%\\n\" +\n\t\"\\x0econtainer_name\\x18\\x06 \\x01(\\tR\\rcontainerName\\x12-\\n\" +\n\t\"\\x12container_platform\\x18\\a \\x01(\\tR\\x11containerPlatform\\\"\\xbc\\x01\\n\" +\n\t\"\\x12OtelMetricExporter\\x12@\\n\" +\n\t\"\\n\" +\n\t\"prometheus\\x18\\x01 \\x01(\\v2 .go.pkg.opentelemetry.PrometheusR\\n\" +\n\t\"prometheus\\x124\\n\" +\n\t\"\\x06stdout\\x18\\x02 \\x01(\\v2\\x1c.go.pkg.opentelemetry.StdoutR\\x06stdout\\x12.\\n\" +\n\t\"\\x04otlp\\x18\\x03 \\x01(\\v2\\x1a.go.pkg.opentelemetry.OTLPR\\x04otlp\\\"y\\n\" +\n\t\"\\x11OtelTraceExporter\\x124\\n\" +\n\t\"\\x06stdout\\x18\\x01 \\x01(\\v2\\x1c.go.pkg.opentelemetry.StdoutR\\x06stdout\\x12.\\n\" +\n\t\"\\x04otlp\\x18\\x02 \\x01(\\v2\\x1a.go.pkg.opentelemetry.OTLPR\\x04otlp\\\"\\x1e\\n\" +\n\t\"\\n\" +\n\t\"Prometheus\\x12\\x10\\n\" +\n\t\"\\x03url\\x18\\x01 \\x01(\\tR\\x03url\\\"+\\n\" +\n\t\"\\x06Stdout\\x12!\\n\" +\n\t\"\\fpretty_print\\x18\\x01 \\x01(\\bR\\vprettyPrint\\\"\\xd9\\x02\\n\" +\n\t\"\\x04OTLP\\x12\\x1a\\n\" +\n\t\"\\bendpoint\\x18\\x01 \\x01(\\tR\\bendpoint\\x12\\x14\\n\" +\n\t\"\\x05token\\x18\\x02 \\x01(\\tR\\x05token\\x12\\x1a\\n\" +\n\t\"\\bprotocol\\x18\\x03 \\x01(\\tR\\bprotocol\\x12\\x1a\\n\" +\n\t\"\\binsecure\\x18\\x04 \\x01(\\bR\\binsecure\\x12A\\n\" +\n\t\"\\aheaders\\x18\\x05 \\x03(\\v2'.go.pkg.opentelemetry.OTLP.HeadersEntryR\\aheaders\\x12\\x19\\n\" +\n\t\"\\burl_path\\x18\\x06 \\x01(\\tR\\aurlPath\\x12 \\n\" +\n\t\"\\vcompression\\x18\\a \\x01(\\bR\\vcompression\\x12+\\n\" +\n\t\"\\x11temporality_delta\\x18\\b \\x01(\\bR\\x10temporalityDelta\\x1a:\\n\" +\n\t\"\\fHeadersEntry\\x12\\x10\\n\" +\n\t\"\\x03key\\x18\\x01 \\x01(\\tR\\x03key\\x12\\x14\\n\" +\n\t\"\\x05value\\x18\\x02 \\x01(\\tR\\x05value:\\x028\\x01*I\\n\" +\n\t\"\\x15OtelTraceExporterType\\x12\\x0e\\n\" +\n\t\"\\n\" +\n\t\"trace_none\\x10\\x00\\x12\\x10\\n\" +\n\t\"\\ftrace_stdout\\x10\\x01\\x12\\x0e\\n\" +\n\t\"\\n\" +\n\t\"trace_otlp\\x10\\x02*d\\n\" +\n\t\"\\x16OtelMetricExporterType\\x12\\x0f\\n\" +\n\t\"\\vmetric_none\\x10\\x00\\x12\\x11\\n\" +\n\t\"\\rmetric_stdout\\x10\\x01\\x12\\x0f\\n\" +\n\t\"\\vmetric_otlp\\x10\\x02\\x12\\x15\\n\" +\n\t\"\\x11metric_prometheus\\x10\\x03*1\\n\" +\n\t\"\\x13OtelLogExporterType\\x12\\f\\n\" +\n\t\"\\blog_none\\x10\\x00\\x12\\f\\n\" +\n\t\"\\blog_otlp\\x10\\x01B:Z8github.com/kaydxh/golang/pkg/opentelemetry;opentelemetryb\\x06proto3\"\n\nvar (\n\tfile_pkg_opentelemetry_opentelemetry_proto_rawDescOnce sync.Once\n\tfile_pkg_opentelemetry_opentelemetry_proto_rawDescData []byte\n)\n\nfunc file_pkg_opentelemetry_opentelemetry_proto_rawDescGZIP() []byte {\n\tfile_pkg_opentelemetry_opentelemetry_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_opentelemetry_opentelemetry_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_pkg_opentelemetry_opentelemetry_proto_rawDesc), len(file_pkg_opentelemetry_opentelemetry_proto_rawDesc)))\n\t})\n\treturn file_pkg_opentelemetry_opentelemetry_proto_rawDescData\n}\n\nvar file_pkg_opentelemetry_opentelemetry_proto_enumTypes = make([]protoimpl.EnumInfo, 3)\nvar file_pkg_opentelemetry_opentelemetry_proto_msgTypes = make([]protoimpl.MessageInfo, 13)\nvar file_pkg_opentelemetry_opentelemetry_proto_goTypes = []any{\n\t(OtelTraceExporterType)(0),  // 0: go.pkg.opentelemetry.OtelTraceExporterType\n\t(OtelMetricExporterType)(0), // 1: go.pkg.opentelemetry.OtelMetricExporterType\n\t(OtelLogExporterType)(0),    // 2: go.pkg.opentelemetry.OtelLogExporterType\n\t(*OpenTelemetry)(nil),       // 3: go.pkg.opentelemetry.OpenTelemetry\n\t(*AppMeterProvider)(nil),    // 4: go.pkg.opentelemetry.AppMeterProvider\n\t(*Resource)(nil),            // 5: go.pkg.opentelemetry.Resource\n\t(*Apm)(nil),                 // 6: go.pkg.opentelemetry.Apm\n\t(*ZhiYan)(nil),              // 7: go.pkg.opentelemetry.ZhiYan\n\t(*K8SResource)(nil),         // 8: go.pkg.opentelemetry.K8sResource\n\t(*OtelMetricExporter)(nil),  // 9: go.pkg.opentelemetry.OtelMetricExporter\n\t(*OtelTraceExporter)(nil),   // 10: go.pkg.opentelemetry.OtelTraceExporter\n\t(*Prometheus)(nil),          // 11: go.pkg.opentelemetry.Prometheus\n\t(*Stdout)(nil),              // 12: go.pkg.opentelemetry.Stdout\n\t(*OTLP)(nil),                // 13: go.pkg.opentelemetry.OTLP\n\tnil,                         // 14: go.pkg.opentelemetry.Resource.AttrsEntry\n\tnil,                         // 15: go.pkg.opentelemetry.OTLP.HeadersEntry\n\t(*durationpb.Duration)(nil), // 16: google.protobuf.Duration\n}\nvar file_pkg_opentelemetry_opentelemetry_proto_depIdxs = []int32{\n\t16, // 0: go.pkg.opentelemetry.OpenTelemetry.metric_collect_duration:type_name -> google.protobuf.Duration\n\t0,  // 1: go.pkg.opentelemetry.OpenTelemetry.otel_trace_exporter_type:type_name -> go.pkg.opentelemetry.OtelTraceExporterType\n\t1,  // 2: go.pkg.opentelemetry.OpenTelemetry.otel_metric_exporter_type:type_name -> go.pkg.opentelemetry.OtelMetricExporterType\n\t2,  // 3: go.pkg.opentelemetry.OpenTelemetry.otel_log_exporter_type:type_name -> go.pkg.opentelemetry.OtelLogExporterType\n\t9,  // 4: go.pkg.opentelemetry.OpenTelemetry.otel_metric_exporter:type_name -> go.pkg.opentelemetry.OtelMetricExporter\n\t10, // 5: go.pkg.opentelemetry.OpenTelemetry.otel_trace_exporter:type_name -> go.pkg.opentelemetry.OtelTraceExporter\n\t5,  // 6: go.pkg.opentelemetry.OpenTelemetry.resource:type_name -> go.pkg.opentelemetry.Resource\n\t4,  // 7: go.pkg.opentelemetry.OpenTelemetry.app_meter_provider:type_name -> go.pkg.opentelemetry.AppMeterProvider\n\t1,  // 8: go.pkg.opentelemetry.AppMeterProvider.exporter_type:type_name -> go.pkg.opentelemetry.OtelMetricExporterType\n\t9,  // 9: go.pkg.opentelemetry.AppMeterProvider.exporter:type_name -> go.pkg.opentelemetry.OtelMetricExporter\n\t16, // 10: go.pkg.opentelemetry.AppMeterProvider.collect_duration:type_name -> google.protobuf.Duration\n\t5,  // 11: go.pkg.opentelemetry.AppMeterProvider.resource:type_name -> go.pkg.opentelemetry.Resource\n\t14, // 12: go.pkg.opentelemetry.Resource.attrs:type_name -> go.pkg.opentelemetry.Resource.AttrsEntry\n\t8,  // 13: go.pkg.opentelemetry.Resource.k8s:type_name -> go.pkg.opentelemetry.K8sResource\n\t6,  // 14: go.pkg.opentelemetry.Resource.apm:type_name -> go.pkg.opentelemetry.Apm\n\t7,  // 15: go.pkg.opentelemetry.Resource.zhiyan:type_name -> go.pkg.opentelemetry.ZhiYan\n\t11, // 16: go.pkg.opentelemetry.OtelMetricExporter.prometheus:type_name -> go.pkg.opentelemetry.Prometheus\n\t12, // 17: go.pkg.opentelemetry.OtelMetricExporter.stdout:type_name -> go.pkg.opentelemetry.Stdout\n\t13, // 18: go.pkg.opentelemetry.OtelMetricExporter.otlp:type_name -> go.pkg.opentelemetry.OTLP\n\t12, // 19: go.pkg.opentelemetry.OtelTraceExporter.stdout:type_name -> go.pkg.opentelemetry.Stdout\n\t13, // 20: go.pkg.opentelemetry.OtelTraceExporter.otlp:type_name -> go.pkg.opentelemetry.OTLP\n\t15, // 21: go.pkg.opentelemetry.OTLP.headers:type_name -> go.pkg.opentelemetry.OTLP.HeadersEntry\n\t22, // [22:22] is the sub-list for method output_type\n\t22, // [22:22] is the sub-list for method input_type\n\t22, // [22:22] is the sub-list for extension type_name\n\t22, // [22:22] is the sub-list for extension extendee\n\t0,  // [0:22] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_opentelemetry_opentelemetry_proto_init() }\nfunc file_pkg_opentelemetry_opentelemetry_proto_init() {\n\tif File_pkg_opentelemetry_opentelemetry_proto != nil {\n\t\treturn\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: unsafe.Slice(unsafe.StringData(file_pkg_opentelemetry_opentelemetry_proto_rawDesc), len(file_pkg_opentelemetry_opentelemetry_proto_rawDesc)),\n\t\t\tNumEnums:      3,\n\t\t\tNumMessages:   13,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_opentelemetry_opentelemetry_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_opentelemetry_opentelemetry_proto_depIdxs,\n\t\tEnumInfos:         file_pkg_opentelemetry_opentelemetry_proto_enumTypes,\n\t\tMessageInfos:      file_pkg_opentelemetry_opentelemetry_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_opentelemetry_opentelemetry_proto = out.File\n\tfile_pkg_opentelemetry_opentelemetry_proto_goTypes = nil\n\tfile_pkg_opentelemetry_opentelemetry_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/opentelemetry/opentelemetry.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.opentelemetry;\n\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/golang/pkg/opentelemetry;opentelemetry\";\n\n// OpenTelemetry 统一监控配置（去掉 Monitor 包装层）\nmessage OpenTelemetry {\n  bool enabled = 1;\n\n  google.protobuf.Duration metric_collect_duration = 2;\n  OtelTraceExporterType otel_trace_exporter_type = 3;\n  OtelMetricExporterType otel_metric_exporter_type = 4;\n  OtelLogExporterType otel_log_exporter_type = 5;\n\n  OtelMetricExporter otel_metric_exporter = 6;\n  OtelTraceExporter otel_trace_exporter = 7;\n\n  Resource resource = 10;\n\n  // App MeterProvider configuration (separate from global)\n  // If enabled, creates an independent MeterProvider for application-level metrics\n  AppMeterProvider app_meter_provider = 11;\n}\n\n// AppMeterProvider configuration for application-level metrics\n// Allows separation between infrastructure metrics (global) and business metrics (app)\nmessage AppMeterProvider {\n  bool enabled = 1;  // Enable separate App MeterProvider\n\n  // Exporter type for app metrics (if different from global)\n  // If not set, uses the same exporter type as global\n  OtelMetricExporterType exporter_type = 2;\n\n  // Exporter configuration (if different from global)\n  OtelMetricExporter exporter = 3;\n\n  // Collect duration for app metrics (if different from global)\n  google.protobuf.Duration collect_duration = 4;\n\n  // Resource attributes specific to app metrics\n  // If not set, inherits from global resource\n  Resource resource = 5;\n}\n\nmessage Resource {\n  string service_name = 1;     // default use process name\n  string service_version = 2;  // service version\n  map<string, string> attrs = 3;\n\n  // K8s resource configuration\n  K8sResource k8s = 10;\n\n  // APM (Application Performance Management) configuration\n  Apm apm = 11;\n\n  // ZhiYan platform configuration for internal monitoring\n  ZhiYan zhiyan = 12;\n}\n\n// APM configuration for Application Performance Management\n// Token is required for APM data reporting and will be added as resource attribute\nmessage Apm {\n  // APM Token for authentication, associated with business system\n  string token = 1;\n}\n\n// ZhiYan platform configuration for internal monitoring\nmessage ZhiYan {\n  // App mark for metric reporting (上报 appMark)\n  // Used for business data reporting\n  string app_mark = 1;\n\n  // Global app mark for modcall and system-level metric reporting\n  // Used for infrastructure/global metrics\n  string global_app_mark = 2;\n\n  // Environment for metric reporting (e.g., \"prod\", \"test\", \"dev\")\n  // If empty, defaults to \"prod\" for production environment\n  string env = 3;\n\n  // Instance mark for attribute reporting\n  // If empty, uses pod IP or host IP\n  string instance_mark = 4;\n\n  // APM Token for trace reporting to ZhiYan APM\n  string zhiyan_apm_token = 5;\n\n  // Whether to expand resource attributes to metric dimensions\n  // \"yes\" or \"no\" (default: \"no\")\n  string expand_key = 6;\n\n  // Metric group for ZhiYan (指标组)\n  // This is used as the scope name when creating Meter\n  // If empty, defaults to \"default\"\n  // Common values: \"default\", \"client_report\", \"server_report\"\n  string metric_group = 7;\n\n  // Data granularity for metric reporting (数据粒度)\n  // Valid values: 10, 30, 60 (default: 60, minutes)\n  // For sub-minute reporting, set data_type to \"second\"\n  int32 data_grain = 8;\n\n  // Data type for metric reporting (数据类型)\n  // Set to \"second\" for sub-minute granularity data\n  string data_type = 9;\n}\n\nmessage K8sResource {\n  bool enabled = 1;  // enable K8s attribute detection from env vars (default: true)\n\n  // Override values (if not set, read from environment variables)\n  string node_ip = 2;           // override NODE_IP env var\n  string pod_namespace = 3;     // override POD_NAMESPACE env var\n  string pod_name = 4;          // override POD_NAME env var\n  string pod_ip = 5;            // override POD_IP env var\n  string container_name = 6;    // override CONTAINER_NAME env var\n  string container_platform = 7; // override CONTAINER_PLATFORM env var (e.g., STKE, TKE)\n}\n\nmessage OtelMetricExporter {\n  Prometheus prometheus = 1;\n  Stdout stdout = 2;\n  OTLP otlp = 3;\n}\n\nmessage OtelTraceExporter {\n  Stdout stdout = 1;\n  OTLP otlp = 2;\n}\n\nmessage Prometheus {\n  string url = 1;\n}\n\nmessage Stdout {\n  bool pretty_print = 1;\n}\n\n// OTLP exporter configuration for Tencent Cloud Prometheus or other OTLP-compatible backends\nmessage OTLP {\n  // Endpoint URL (e.g., \"prometheus.tencentcloudapi.com:4317\" for gRPC)\n  // For Tencent Cloud Prometheus, use the Remote Write address from console\n  string endpoint = 1;\n\n  // Authentication token (e.g., Tencent Cloud Prometheus Token)\n  string token = 2;\n\n  // Protocol: \"http\" or \"grpc\" (default: \"http\")\n  string protocol = 3;\n\n  // Use insecure connection (default: false)\n  bool insecure = 4;\n\n  // Custom headers for authentication\n  map<string, string> headers = 5;\n\n  // URL path for HTTP protocol (default: \"/v1/metrics\")\n  string url_path = 6;\n\n  // Enable gzip compression (ZhiYan requires compression=gzip)\n  bool compression = 7;\n\n  // Use Delta temporality instead of Cumulative (ZhiYan requires temporality_selector=delta)\n  bool temporality_delta = 8;\n}\n\nenum OtelTraceExporterType {\n  trace_none = 0;\n  trace_stdout = 1;\n  trace_otlp = 2;\n}\n\nenum OtelMetricExporterType {\n  metric_none = 0;\n  metric_stdout = 1;\n  metric_otlp = 2;\n  metric_prometheus = 3;\n}\n\nenum OtelLogExporterType {\n  log_none = 0;\n  log_otlp = 1;\n}\n"
  },
  {
    "path": "pkg/opentelemetry/opentelemetry.yaml",
    "content": "# OpenTelemetry 统一监控配置（去掉 monitor 包装层）\nopen_telemetry:\n  enabled: true\n\n  # ========================================\n  # Global MeterProvider - 基础设施/运维指标\n  # ========================================\n  # 用途：CPU、内存、GC、网络、gRPC 调用统计等基础指标\n  # 使用 API：api.GlobalIncrCounter(), api.GlobalRecordHistogram()\n  metric_collect_duration: 60s           # 采集周期：60秒（基础指标变化慢）\n  otel_metric_exporter_type: metric_prometheus  # 本地 Prometheus 拉取\n  otel_metric_exporter:\n    stdout:\n      pretty_print: true\n    prometheus:\n      url: /metrics                      # Prometheus 拉取端点\n    # OTLP 配置（用于腾讯云 Prometheus 等）\n    otlp:\n      endpoint: \"\"           # 腾讯云 Prometheus Remote Write 地址\n      token: \"\"              # 认证 Token\n      protocol: \"http\"       # http 或 grpc\n      insecure: false        # 是否禁用 TLS\n      url_path: \"/v1/metrics\"\n      headers: {}\n\n  # ========================================\n  # App MeterProvider - 应用级/业务指标\n  # ========================================\n  # 用途：订单数、用户注册、业务延迟、API 调用等业务指标\n  # 使用 API：api.IncrCounter(), api.RecordHistogram()\n  app_meter_provider:\n    enabled: true                        # 启用独立的 App MeterProvider\n    exporter_type: metric_otlp           # 推送到远程 OTLP（腾讯云 Prometheus）\n    collect_duration: 30s                # 采集周期：30秒（业务指标需要更实时）\n    exporter:\n      otlp:\n        endpoint: \"prometheus.tencentcloudapi.com:4317\"  # 腾讯云 Prometheus 地址\n        token: \"your-app-metrics-token\"  # 认证 Token\n        protocol: \"grpc\"                 # 使用 gRPC 协议\n        insecure: false\n        url_path: \"/v1/metrics\"\n        headers: {}\n    resource:\n      service_name: \"my-app-business\"    # 业务指标专用服务名\n      attrs:\n        metric_type: \"business\"          # 标记为业务指标\n        team: \"platform\"\n\n  # ========================================\n  # Trace 配置\n  # ========================================\n  otel_trace_exporter_type: trace_stdout\n  otel_log_exporter_type: log_none\n  otel_trace_exporter:\n    stdout:\n      pretty_print: true\n    # OTLP 配置（用于腾讯云 APM、Jaeger OTLP、Tempo 等）\n    otlp:\n      endpoint: \"\"              # e.g., \"tempo.example.com:4317\" for gRPC\n      token: \"\"                 # Bearer token for authentication\n      protocol: \"grpc\"          # http 或 grpc\n      insecure: false           # 是否禁用 TLS\n      url_path: \"/v1/traces\"    # HTTP 协议的 URL 路径\n      headers: {}               # 自定义 headers\n\n  # ========================================\n  # 通用资源配置（Global Provider 使用）\n  # ========================================\n  resource:\n    service_name: \"\"           # 服务名称（默认使用进程名）\n    service_version: \"\"        # 服务版本\n    attrs: {}                  # 自定义属性\n    # K8s 资源属性配置\n    k8s:\n      enabled: true            # 是否启用 K8s 属性自动检测（默认 true）\n      # 以下属性会自动从环境变量读取，也可以手动覆盖\n      # node_ip: \"\"            # 覆盖 NODE_IP 环境变量\n      # pod_namespace: \"\"      # 覆盖 POD_NAMESPACE 环境变量\n      # pod_name: \"\"           # 覆盖 POD_NAME 环境变量\n      # pod_ip: \"\"             # 覆盖 POD_IP 环境变量\n      # container_name: \"\"     # 覆盖 CONTAINER_NAME 环境变量\n      # container_platform: \"\" # 覆盖 CONTAINER_PLATFORM 环境变量 (e.g., STKE, TKE)\n    # APM (Application Performance Management) 配置\n    # 用于腾讯云 APM\n    apm:\n      token: \"\"                # APM Token，与业务系统关联，从 APM 控制台获取\n\n    # (ZhiYan) 平台配置\n    zhiyan:\n      # 业务指标上报 appMark（用于 App MeterProvider）\n      # 平台获取，用于业务数据上报\n      app_mark: \"\"\n\n      # 全局指标上报 appMark（用于 Global MeterProvider）\n      # 用于模调上报和系统层面监控上报\n      global_app_mark: \"\"\n\n      # 环境标识：prod / test / dev\n      # 如果为空，默认为 prod\n      env: \"prod\"\n\n      # 实例标识，用于属性上报\n      # 如果为空，使用 Pod IP 或 Host IP\n      instance_mark: \"\"\n\n      # APM Token，用于 Trace 上报\n      zhiyan_apm_token: \"\"\n\n      # 是否将 resource 属性扩展到指标维度\n      # \"yes\" 或 \"no\"（默认 \"no\"）\n      expand_key: \"no\"\n\n"
  },
  {
    "path": "pkg/opentelemetry/opentelemetry_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage opentelemetry\n\n// A OpenTelemetryServiceOption sets options.\ntype OpenTelemetryServiceOption interface {\n\tapply(*OpenTelemetryService)\n}\n\n// EmptyOpenTelemetryServiceOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyOpenTelemetryServiceOption struct{}\n\nfunc (EmptyOpenTelemetryServiceOption) apply(*OpenTelemetryService) {}\n\n// OpenTelemetryServiceOptionFunc wraps a function that modifies Client into an\n// implementation of the OpenTelemetryServiceOption interface.\ntype OpenTelemetryServiceOptionFunc func(*OpenTelemetryService)\n\nfunc (f OpenTelemetryServiceOptionFunc) apply(do *OpenTelemetryService) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _OpenTelemetryServiceOptionWithDefault() OpenTelemetryServiceOption {\n\treturn OpenTelemetryServiceOptionFunc(func(*OpenTelemetryService) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *OpenTelemetryService) ApplyOptions(options ...OpenTelemetryServiceOption) *OpenTelemetryService {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/opentelemetry/opentelemetry_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage opentelemetry_test\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\topentelemetry_ \"github.com/kaydxh/golang/pkg/opentelemetry\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/metric\"\n\t\"golang.org/x/net/context\"\n)\n\nconst (\n\tinstrumentationName    = \"github/kaydxh/instrument\"\n\tinstrumentationVersion = \"v0.0.1\"\n)\n\nvar (\n\tmeter = otel.GetMeterProvider().Meter(\n\t\t\"\",\n\t\tmetric.WithInstrumentationVersion(instrumentationVersion),\n\t)\n\n\tfuncLoopCounter, _ = meter.Int64Counter(\"function_loops\")\n\tfuncNameKey        = attribute.Key(\"function_name\")\n)\n\nfunc memoryUsageCallBack(total, free uint64, usage float64) {\n\tlogrus.Infof(\"memory total: %v, free: %v, usage: %v\", total, free, usage)\n}\n\nfunc TestMetric(t *testing.T) {\n\tcfgFile := \"./opentelemetry.yaml\"\n\tconfig := opentelemetry_.NewConfig(\n\t\topentelemetry_.WithViper(viper_.GetViper(cfgFile, \"open_telemetry\")),\n\t\topentelemetry_.WithMemoryCallBack(memoryUsageCallBack),\n\t)\n\n\tctx := context.Background()\n\terr := config.Complete().New(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\tfmt.Printf(\"config: %+v\", config.Proto.String())\n\n\tgo func() {\n\t\t_ = http.ListenAndServe(\":2222\", nil)\n\t}()\n\n\tfor {\n\t\tmetrics(ctx, 100)\n\t\ttime.Sleep(time.Second)\n\t}\n\n}\n\nfunc metrics(ctx context.Context, n int) {\n\tfuncNameKV := funcNameKey.String(\"metrics\")\n\tfor i := 0; i < n; i++ {\n\t\tfuncLoopCounter.Add(ctx, 1, metric.WithAttributes(funcNameKV))\n\t}\n}\n\nfunc TestTrace(t *testing.T) {\n\tcfgFile := \"./opentelemetry.yaml\"\n\tconfig := opentelemetry_.NewConfig(opentelemetry_.WithViper(viper_.GetViper(cfgFile, \"open_telemetry\")))\n\n\tctx := context.Background()\n\terr := config.Complete().New(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\tfmt.Printf(\"config: %+v\", config.Proto.String())\n\n\ttrace := otel.GetTracerProvider()\n\ttr := trace.Tracer(instrumentationName)\n\n\tctx, span := tr.Start(ctx, \"traceFunc\")\n\tdefer span.End()\n\n\tfor {\n\t\tdoTrace(ctx)\n\t\ttime.Sleep(time.Second)\n\t}\n\n}\n\nfunc doTrace(ctx context.Context) {\n\t// Use the global TracerProvider.\n\ttr := otel.Tracer(\"component-doTrace\")\n\t_, span := tr.Start(ctx, \"doTrace\")\n\tspan.SetAttributes(attribute.Key(\"testset\").String(\"value\"))\n\tdefer span.End()\n\n\ttime.Sleep(200 * time.Millisecond)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/resource/resource.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resource\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/sdk/resource\"\n\tsemconv \"go.opentelemetry.io/otel/semconv/v1.21.0\"\n)\n\n// K8s environment variable names\nconst (\n\tEnvNodeIP            = \"NODE_IP\"\n\tEnvPodNamespace      = \"POD_NAMESPACE\"\n\tEnvPodName           = \"POD_NAME\"\n\tEnvPodIP             = \"POD_IP\"\n\tEnvContainerName     = \"CONTAINER_NAME\"\n\tEnvContainerPlatform = \"CONTAINER_PLATFORM\"\n)\n\n// Custom attribute keys for K8s\nvar (\n\tK8SNodeIPKey            = attribute.Key(\"k8s.node.ip\")\n\tK8SPodIPKey             = attribute.Key(\"k8s.pod.ip\")\n\tK8SContainerPlatformKey = attribute.Key(\"k8s.container.platform\")\n)\n\n// APM Token key for Tencent Cloud APM\n// https://console.cloud.tencent.com/apm/monitor/access\nvar (\n\tApmTokenKey = attribute.Key(\"token\")\n)\n\n// ZhiYan platform attribute keys\nvar (\n\t// ZhiYanAppMarkKey is the app mark for metric reporting (必填，上报应用标记)\n\tZhiYanAppMarkKey = attribute.Key(\"__zhiyan_app_mark__\")\n\n\t// ZhiYanInstanceMarkKey is the instance identifier for attribute reporting (选填，上报实例标识)\n\tZhiYanInstanceMarkKey = attribute.Key(\"__zhiyan_instance_mark__\")\n\n\t// ZhiYanEnvKey is the environment for attribute reporting\n\tZhiYanEnvKey = attribute.Key(\"__zhiyan_env__\")\n\n\t// ZhiYanExpandKey controls whether to expand resource attributes to metric dimensions\n\tZhiYanExpandKey = attribute.Key(\"__zhiyan_expand_tag_enable__\")\n\n\t// ZhiYanDataGrainKey is the data granularity (选填，数据粒度，int类型，默认60，可接受10,30,60)\n\tZhiYanDataGrainKey = attribute.Key(\"__zhiyan_data_grain__\")\n\n\t// ZhiYanDataTypeKey is the data type (选填，秒级粒度数据时填写\"second\")\n\tZhiYanDataTypeKey = attribute.Key(\"__zhiyan_data_type__\")\n\n\t// ZhiYanTpsTenantIDKey is the tenant ID for ZhiYan APM trace reporting\n\t// Format: \"空间ID#日志租户#监控宝租户\"\n\tZhiYanTpsTenantIDKey = attribute.Key(\"tps.tenant.id\")\n)\n\n// ResourceOptions holds options for creating a Resource\ntype ResourceOptions struct {\n\tServiceName    string\n\tServiceVersion string\n\tAttrs          map[string]string\n\tEnableK8s      bool\n\tApmToken       string // APM Token for Tencent Cloud APM\n\n\t// ZhiYan platform options\n\tZhiYanAppMark       string // App mark for business metric reporting\n\tZhiYanGlobalAppMark string // Global app mark for infrastructure metrics\n\tZhiYanEnv           string // Environment (prod/test/dev)\n\tZhiYanInstanceMark  string // Instance identifier\n\tZhiYanApmToken      string // APM Token for ZhiYan trace reporting\n\tZhiYanExpandKey     string // Expand resource attrs to dimensions (yes/no)\n\tZhiYanMetricGroup   string // Metric group (scope name) for ZhiYan\n\tZhiYanDataGrain     int    // Data granularity: 10, 30, or 60 (default 60, minutes)\n\tZhiYanDataType      string // Data type: \"second\" for sub-minute granularity\n\n\t// MeterType indicates whether this is for global or app metrics\n\t// Used to determine which ZhiYan app mark to use\n\tMeterType string\n}\n\n// ResourceOption is a function that configures ResourceOptions\ntype ResourceOption func(*ResourceOptions)\n\n// WithServiceName sets the service name\nfunc WithServiceName(name string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ServiceName = name\n\t}\n}\n\n// WithServiceVersion sets the service version\nfunc WithServiceVersion(version string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ServiceVersion = version\n\t}\n}\n\n// WithAttrs sets additional attributes\nfunc WithAttrs(attrs map[string]string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.Attrs = attrs\n\t}\n}\n\n// WithK8s enables K8s attribute detection\nfunc WithK8s(enable bool) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.EnableK8s = enable\n\t}\n}\n\n// WithApmToken sets the APM Token for Tencent Cloud APM\nfunc WithApmToken(token string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ApmToken = token\n\t}\n}\n\n// ZhiYan platform options\n\n// WithZhiYanAppMark sets the app mark for business metric reporting\nfunc WithZhiYanAppMark(appMark string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ZhiYanAppMark = appMark\n\t}\n}\n\n// WithZhiYanGlobalAppMark sets the global app mark for infrastructure metrics\nfunc WithZhiYanGlobalAppMark(globalAppMark string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ZhiYanGlobalAppMark = globalAppMark\n\t}\n}\n\n// WithZhiYanEnv sets the ZhiYan environment\nfunc WithZhiYanEnv(env string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ZhiYanEnv = env\n\t}\n}\n\n// WithZhiYanInstanceMark sets the instance identifier\nfunc WithZhiYanInstanceMark(instanceMark string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ZhiYanInstanceMark = instanceMark\n\t}\n}\n\n// WithZhiYanApmToken sets the APM token for ZhiYan trace reporting\nfunc WithZhiYanApmToken(token string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ZhiYanApmToken = token\n\t}\n}\n\n// WithZhiYanExpandKey sets whether to expand resource attrs to dimensions\nfunc WithZhiYanExpandKey(expand string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ZhiYanExpandKey = expand\n\t}\n}\n\n// WithZhiYanMetricGroup sets the metric group (scope name) for ZhiYan\n// Common values: \"default\", \"client_report\", \"server_report\"\nfunc WithZhiYanMetricGroup(group string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ZhiYanMetricGroup = group\n\t}\n}\n\n// WithZhiYanDataGrain sets the data granularity for ZhiYan\n// Valid values: 10, 30, 60 (default 60, minutes)\nfunc WithZhiYanDataGrain(grain int) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ZhiYanDataGrain = grain\n\t}\n}\n\n// WithZhiYanDataType sets the data type for ZhiYan\n// Set to \"second\" for sub-minute granularity data\nfunc WithZhiYanDataType(dataType string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.ZhiYanDataType = dataType\n\t}\n}\n\n// WithMeterType sets the meter type (global or app)\nfunc WithMeterType(meterType string) ResourceOption {\n\treturn func(o *ResourceOptions) {\n\t\to.MeterType = meterType\n\t}\n}\n\n// MeterType constants\nconst (\n\tMeterTypeGlobal = \"global\"\n\tMeterTypeApp    = \"app\"\n)\n\n// NewResource creates a new OpenTelemetry Resource with the given options\nfunc NewResource(opts ...ResourceOption) (*resource.Resource, error) {\n\toptions := &ResourceOptions{\n\t\tEnableK8s: true, // Enable K8s by default\n\t}\n\tfor _, opt := range opts {\n\t\topt(options)\n\t}\n\n\t// Base attributes\n\tattrs := []attribute.KeyValue{}\n\n\t// Service name (default to process name)\n\tserviceName := options.ServiceName\n\tif serviceName == \"\" {\n\t\tserviceName = filepath.Base(os.Args[0])\n\t}\n\tattrs = append(attrs, semconv.ServiceName(serviceName))\n\n\t// Service version\n\tif options.ServiceVersion != \"\" {\n\t\tattrs = append(attrs, semconv.ServiceVersion(options.ServiceVersion))\n\t}\n\n\t// K8s attributes from environment variables\n\tif options.EnableK8s {\n\t\tk8sAttrs := GetK8sAttributes()\n\t\tattrs = append(attrs, k8sAttrs...)\n\t}\n\n\t// APM Token (Tencent Cloud APM)\n\tif options.ApmToken != \"\" {\n\t\tattrs = append(attrs, ApmTokenKey.String(options.ApmToken))\n\t}\n\n\t// ZhiYan platform attributes\n\tattrs = append(attrs, getZhiYanAttributes(options)...)\n\n\t// Custom attributes\n\tfor k, v := range options.Attrs {\n\t\tattrs = append(attrs, attribute.String(k, v))\n\t}\n\n\treturn resource.NewWithAttributes(\n\t\tsemconv.SchemaURL,\n\t\tattrs...,\n\t), nil\n}\n\n// getZhiYanAttributes returns ZhiYan-specific resource attributes\nfunc getZhiYanAttributes(options *ResourceOptions) []attribute.KeyValue {\n\tvar attrs []attribute.KeyValue\n\n\t// Determine which app mark to use based on meter type\n\tappMark := \"\"\n\tif options.MeterType == MeterTypeApp && options.ZhiYanAppMark != \"\" {\n\t\tappMark = options.ZhiYanAppMark\n\t} else if options.MeterType == MeterTypeGlobal && options.ZhiYanGlobalAppMark != \"\" {\n\t\tappMark = options.ZhiYanGlobalAppMark\n\t}\n\n\t// Debug log for ZhiYan attributes selection\n\tlogrus.Debugf(\"getZhiYanAttributes: MeterType=%s, ZhiYanAppMark=%s, ZhiYanGlobalAppMark=%s, selected appMark=%s\",\n\t\toptions.MeterType, options.ZhiYanAppMark, options.ZhiYanGlobalAppMark, appMark)\n\n\t// Only add ZhiYan attributes if app mark is set\n\tif appMark != \"\" {\n\t\tattrs = append(attrs, ZhiYanAppMarkKey.String(appMark))\n\t\tlogrus.Infof(\"ZhiYan resource attribute added: %s=%s\", ZhiYanAppMarkKey, appMark)\n\n\t\t// Environment (default to \"prod\" if not set)\n\t\tenv := options.ZhiYanEnv\n\t\tif env == \"\" {\n\t\t\tenv = \"prod\"\n\t\t}\n\t\tattrs = append(attrs, ZhiYanEnvKey.String(env))\n\n\t\t// Instance mark\n\t\tif options.ZhiYanInstanceMark != \"\" {\n\t\t\tattrs = append(attrs, ZhiYanInstanceMarkKey.String(options.ZhiYanInstanceMark))\n\t\t}\n\n\t\t// Expand key (default to \"no\")\n\t\texpandKey := options.ZhiYanExpandKey\n\t\tif expandKey != \"yes\" {\n\t\t\texpandKey = \"no\"\n\t\t}\n\t\tattrs = append(attrs, ZhiYanExpandKey.String(expandKey))\n\n\t\t// Data grain (选填，数据粒度，默认60)\n\t\tif options.ZhiYanDataGrain > 0 {\n\t\t\tattrs = append(attrs, ZhiYanDataGrainKey.Int(options.ZhiYanDataGrain))\n\t\t}\n\n\t\t// Data type (选填，秒级粒度数据时填写\"second\")\n\t\tif options.ZhiYanDataType != \"\" {\n\t\t\tattrs = append(attrs, ZhiYanDataTypeKey.String(options.ZhiYanDataType))\n\t\t}\n\t}\n\n\t// ZhiYan APM Token for trace reporting\n\tif options.ZhiYanApmToken != \"\" {\n\t\tattrs = append(attrs, ZhiYanTpsTenantIDKey.String(options.ZhiYanApmToken))\n\t\t// Also add service namespace for ZhiYan APM\n\t\tenv := options.ZhiYanEnv\n\t\tif env == \"\" {\n\t\t\tenv = \"prod\"\n\t\t}\n\t\tattrs = append(attrs, semconv.ServiceNamespace(env))\n\t}\n\n\treturn attrs\n}\n\n// GetK8sAttributes returns K8s-related attributes from environment variables\nfunc GetK8sAttributes() []attribute.KeyValue {\n\tvar attrs []attribute.KeyValue\n\n\t// Node IP\n\tif nodeIP := os.Getenv(EnvNodeIP); nodeIP != \"\" {\n\t\tattrs = append(attrs, K8SNodeIPKey.String(nodeIP))\n\t}\n\n\t// Pod Namespace\n\tif podNamespace := os.Getenv(EnvPodNamespace); podNamespace != \"\" {\n\t\tattrs = append(attrs, semconv.K8SNamespaceName(podNamespace))\n\t}\n\n\t// Pod Name\n\tif podName := os.Getenv(EnvPodName); podName != \"\" {\n\t\tattrs = append(attrs, semconv.K8SPodName(podName))\n\t}\n\n\t// Pod IP\n\tif podIP := os.Getenv(EnvPodIP); podIP != \"\" {\n\t\tattrs = append(attrs, K8SPodIPKey.String(podIP))\n\t}\n\n\t// Container Name\n\tif containerName := os.Getenv(EnvContainerName); containerName != \"\" {\n\t\tattrs = append(attrs, semconv.K8SContainerName(containerName))\n\t}\n\n\t// Container Platform (e.g., STKE, TKE)\n\tif containerPlatform := os.Getenv(EnvContainerPlatform); containerPlatform != \"\" {\n\t\tattrs = append(attrs, K8SContainerPlatformKey.String(containerPlatform))\n\t}\n\n\treturn attrs\n}\n\n// IsInK8s checks if the application is running in a K8s environment\nfunc IsInK8s() bool {\n\t// Check common K8s environment variables\n\treturn os.Getenv(EnvPodName) != \"\" || os.Getenv(EnvPodNamespace) != \"\"\n}\n"
  },
  {
    "path": "pkg/opentelemetry/resource/resource.memory.go",
    "content": "package resource\n\nimport (\n\t\"context\"\n\n\tnet_ \"github.com/kaydxh/golang/go/net\"\n\tresource_ \"github.com/kaydxh/golang/pkg/middleware/resource\"\n\tapp_ \"github.com/kaydxh/golang/pkg/webserver/app\"\n\t\"github.com/shirou/gopsutil/mem\"\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/metric\"\n)\n\nconst (\n\tMemoryTotalKey     = \"memory_total\"\n\tMemoryUsageKey     = \"memory_usage\"\n\tMemoryAvailableKey = \"memory_available\"\n)\n\ntype ResourceStatsMetrics struct {\n\tMemoryTotalHistogram     metric.Float64Histogram\n\tMemoryUsageHistogram     metric.Float64Histogram\n\tMemoryAvailableHistogram metric.Float64Histogram\n}\n\n/*\nfunc RecordOptions() []metric.RecordOption {\n\tattrs := Attrs()\n\topts := make([]metric.RecordOption, 0, len(attrs))\n\tfor _, attr := range attrs {\n\t\topts = append(opts, metric.WithAttribute(attr))\n\t}\n\treturn opts\n}\n*/\n\nfunc Attrs() []attribute.KeyValue {\n\tvar attrs []attribute.KeyValue\n\thostIP, err := net_.GetHostIP()\n\tif err == nil && hostIP.String() != \"\" {\n\t\tattrs = append(attrs, resource_.PodIpKey.String(hostIP.String()))\n\t}\n\tappName := app_.GetVersion().AppName\n\tif appName != \"\" {\n\t\tattrs = append(attrs, resource_.ServerNameKey.String(appName))\n\t}\n\n\treturn attrs\n}\n\nfunc NewResourceStatsMetrics() (*ResourceStatsMetrics, error) {\n\t/*\n\t\tvar err error\n\t\tr := &ResourceStatsMetrics{}\n\t\tcall := func(f func()) {\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tf()\n\t\t}\n\t\tcall(func() {\n\t\t\tr.MemoryTotalHistogram, err = resource_.GlobalMeter().Float64Histogram(MemoryTotalKey)\n\t\t})\n\t\tcall(func() {\n\t\t\tr.MemoryUsageHistogram, err = resource_.GlobalMeter().Float64Histogram(MemoryUsageKey)\n\t\t})\n\t\tcall(func() {\n\t\t\tr.MemoryAvaliableHistogram, err = resource_.GlobalMeter().Float64Histogram(MemoryAvaliableKey)\n\t\t})\n\t\tif err != nil {\n\t\t\totel.Handle(err)\n\t\t}\n\n\t\treturn r, nil\n\t*/\n\n\tvar err error\n\tr := &ResourceStatsMetrics{}\n\n\t// 获取全局 meter\n\tmeter := resource_.GlobalMeter()\n\n\t// 创建 histogram 的辅助函数\n\tcreateHistogram := func(name string) (metric.Float64Histogram, error) {\n\t\treturn meter.Float64Histogram(name,\n\t\t\tmetric.WithDescription(\"Resource \"+name+\" metrics\"),\n\t\t\tmetric.WithUnit(\"bytes\"), // 根据需要调整单位\n\t\t)\n\t}\n\n\t// 创建内存总量 histogram\n\tr.MemoryTotalHistogram, err = createHistogram(MemoryTotalKey)\n\tif err != nil {\n\t\totel.Handle(err)\n\t\treturn nil, err\n\t}\n\n\t// 创建内存使用量 histogram\n\tr.MemoryUsageHistogram, err = meter.Float64Histogram(MemoryUsageKey,\n\t\tmetric.WithDescription(\"Memory usage percentage\"),\n\t\tmetric.WithUnit(\"%\"),\n\t)\n\tif err != nil {\n\t\totel.Handle(err)\n\t\treturn nil, err\n\t}\n\n\t// 创建内存可用量 histogram\n\tr.MemoryAvailableHistogram, err = createHistogram(MemoryAvailableKey)\n\tif err != nil {\n\t\totel.Handle(err)\n\t\treturn nil, err\n\t}\n\n\treturn r, nil\n\n}\n\nfunc (r *ResourceStatsMetrics) ReportMetric(ctx context.Context) (total, available, usage float64) {\n\tattrs := Attrs()\n\n\tv, err := mem.VirtualMemory()\n\tif err != nil {\n\t\treturn 0, 0, 0\n\t}\n\n\ttotal = float64(v.Total)\n\tavailable = float64(v.Available)\n\tusage = v.UsedPercent\n\n\tr.MemoryTotalHistogram.Record(ctx, total, metric.WithAttributes(attrs...))\n\tr.MemoryAvailableHistogram.Record(ctx, available, metric.WithAttributes(attrs...))\n\tr.MemoryUsageHistogram.Record(ctx, usage, metric.WithAttributes(attrs...))\n\n\t// r.MemoryTotalHistogram.Record(ctx, float64(v.Total), attrs...)\n\t// r.MemoryAvaliableHistogram.Record(ctx, float64(v.Available), attrs...)\n\t// r.MemoryUsageHistogram.Record(ctx, v.UsedPercent, attrs...)\n\n\treturn total, available, usage\n}\n"
  },
  {
    "path": "pkg/opentelemetry/resource/resource.stats.go",
    "content": "package resource\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/kaydxh/golang/go/errors\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst (\n\tDefaultCheckInterval time.Duration = time.Minute\n)\n\ntype ResourceStatsOptions struct {\n\tcheckInterval  time.Duration\n\tmemoryCallBack func(total, free uint64, usage float64)\n}\n\ntype ResourceStatsService struct {\n\tinShutdown atomic.Bool // true when when server is in shutdown\n\n\topts ResourceStatsOptions\n\n\tmetrics *ResourceStatsMetrics\n\n\tmu     sync.Mutex\n\tcancel func()\n}\n\nfunc NewResourceStatsService(opts ...ResourceStatsServiceOption) (*ResourceStatsService, error) {\n\tvar err error\n\tr := &ResourceStatsService{}\n\n\tm, err := NewResourceStatsMetrics()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr.metrics = m\n\tr.ApplyOptions(opts...)\n\tif r.opts.checkInterval <= 0 {\n\t\tr.opts.checkInterval = DefaultCheckInterval\n\t}\n\n\treturn r, nil\n}\n\n// Run will initialize the backend. It must not block, but may run go routines in the background.\nfunc (s *ResourceStatsService) Run(ctx context.Context) error {\n\tlogger := s.getLogger()\n\tlogger.Infoln(\"ResourceStatsService Run\")\n\tif s.inShutdown.Load() {\n\t\tlogger.Infoln(\"ResourceStatsService Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\tgo func() {\n\t\terrors.HandleError(s.Serve(ctx))\n\t}()\n\treturn nil\n}\n\nfunc (s *ResourceStatsService) getLogger() *logrus.Entry {\n\treturn logrus.WithField(\"module\", \"ResourceStatsService\")\n}\n\n// Serve ...\nfunc (s *ResourceStatsService) Serve(ctx context.Context) error {\n\tlogger := s.getLogger()\n\tlogger.Infoln(\"ResourceStats Serve\")\n\n\tif s.inShutdown.Load() {\n\t\tlogger.Infoln(\"ResourceStats Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\n\tdefer s.inShutdown.Store(true)\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\ts.mu.Lock()\n\ts.cancel = cancel\n\ts.mu.Unlock()\n\n\ttime_.UntilWithContxt(ctx, func(ctx context.Context) error {\n\t\ttotal, avaiable, usage := s.metrics.ReportMetric(ctx)\n\t\tif s.opts.memoryCallBack != nil {\n\t\t\ts.opts.memoryCallBack(uint64(total), uint64(avaiable), usage)\n\t\t}\n\t\treturn nil\n\t}, s.opts.checkInterval)\n\tif err := ctx.Err(); err != nil {\n\t\tlogger.WithError(err).Errorf(\"stopped checking\")\n\t\treturn err\n\t}\n\tlogger.Info(\"stopped checking\")\n\treturn nil\n}\n\n// Shutdown ...\nfunc (s *ResourceStatsService) Shutdown() {\n\ts.inShutdown.Store(true)\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tif s.cancel != nil {\n\t\ts.cancel()\n\t}\n}\n"
  },
  {
    "path": "pkg/opentelemetry/resource/resource_stats.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resource\n\nimport (\n\t\"time\"\n)\n\nfunc WithStatsCheckInterval(interval time.Duration) ResourceStatsServiceOption {\n\treturn ResourceStatsServiceOptionFunc(func(c *ResourceStatsService) {\n\t\tc.opts.checkInterval = interval\n\t})\n}\n\nfunc WithMemoryCallBack(f func(total uint64, free uint64, usage float64)) ResourceStatsServiceOption {\n\treturn ResourceStatsServiceOptionFunc(func(c *ResourceStatsService) {\n\t\tc.opts.memoryCallBack = f\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/resource/resource_stats_option.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resource\n\n// A ResourceStatsServiceOption sets options.\ntype ResourceStatsServiceOption interface {\n\tapply(*ResourceStatsService)\n}\n\n// EmptyResourceStatsServiceOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyResourceStatsServiceOption struct{}\n\nfunc (EmptyResourceStatsServiceOption) apply(*ResourceStatsService) {}\n\n// ResourceStatsServiceOptionFunc wraps a function that modifies Client into an\n// implementation of the ResourceStatsServiceOption interface.\ntype ResourceStatsServiceOptionFunc func(*ResourceStatsService)\n\nfunc (f ResourceStatsServiceOptionFunc) apply(do *ResourceStatsService) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ResourceStatsServiceOptionWithDefault() ResourceStatsServiceOption {\n\treturn ResourceStatsServiceOptionFunc(func(*ResourceStatsService) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *ResourceStatsService) ApplyOptions(options ...ResourceStatsServiceOption) *ResourceStatsService {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/otlp/otlp.trace.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage otlp\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc\"\n\t\"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp\"\n\tsdktrace \"go.opentelemetry.io/otel/sdk/trace\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/credentials/insecure\"\n)\n\ntype Protocol int\n\nconst (\n\tProtocolHTTP Protocol = iota\n\tProtocolGRPC\n)\n\ntype OTLPTraceExporterBuilderOptions struct {\n\t// Endpoint is the target endpoint URL (without scheme for gRPC, with scheme for HTTP)\n\tEndpoint string\n\n\t// Headers for authentication\n\tHeaders map[string]string\n\n\t// Protocol specifies HTTP or gRPC\n\tProtocol Protocol\n\n\t// Insecure disables TLS (default: false)\n\tInsecure bool\n\n\t// Timeout for the exporter\n\tTimeout time.Duration\n\n\t// URLPath is the URL path for HTTP protocol (default: \"/v1/traces\")\n\tURLPath string\n\n\t// Compression enables gzip compression\n\tCompression bool\n}\n\ntype OTLPTraceExporterBuilder struct {\n\topts OTLPTraceExporterBuilderOptions\n}\n\nfunc defaultBuilderOptions() OTLPTraceExporterBuilderOptions {\n\treturn OTLPTraceExporterBuilderOptions{\n\t\tProtocol: ProtocolHTTP,\n\t\tInsecure: false,\n\t\tTimeout:  30 * time.Second,\n\t\tURLPath:  \"/v1/traces\",\n\t}\n}\n\nfunc NewOTLPTraceExporterBuilder(opts ...OTLPTraceExporterBuilderOption) *OTLPTraceExporterBuilder {\n\tbuilder := &OTLPTraceExporterBuilder{\n\t\topts: defaultBuilderOptions(),\n\t}\n\tbuilder.ApplyOptions(opts...)\n\treturn builder\n}\n\nfunc (b *OTLPTraceExporterBuilder) Build(ctx context.Context) (sdktrace.SpanExporter, error) {\n\tswitch b.opts.Protocol {\n\tcase ProtocolHTTP:\n\t\treturn b.buildHTTPExporter(ctx)\n\tcase ProtocolGRPC:\n\t\treturn b.buildGRPCExporter(ctx)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported protocol: %d\", b.opts.Protocol)\n\t}\n}\n\nfunc (b *OTLPTraceExporterBuilder) buildHTTPExporter(ctx context.Context) (sdktrace.SpanExporter, error) {\n\tif b.opts.Endpoint == \"\" {\n\t\treturn nil, fmt.Errorf(\"endpoint is required for OTLP HTTP trace exporter\")\n\t}\n\n\topts := []otlptracehttp.Option{\n\t\totlptracehttp.WithEndpoint(b.opts.Endpoint),\n\t}\n\n\tif b.opts.Insecure {\n\t\topts = append(opts, otlptracehttp.WithInsecure())\n\t}\n\n\tif len(b.opts.Headers) > 0 {\n\t\topts = append(opts, otlptracehttp.WithHeaders(b.opts.Headers))\n\t}\n\n\tif b.opts.Timeout > 0 {\n\t\topts = append(opts, otlptracehttp.WithTimeout(b.opts.Timeout))\n\t}\n\n\tif b.opts.URLPath != \"\" {\n\t\topts = append(opts, otlptracehttp.WithURLPath(b.opts.URLPath))\n\t}\n\n\tif b.opts.Compression {\n\t\topts = append(opts, otlptracehttp.WithCompression(otlptracehttp.GzipCompression))\n\t}\n\n\texporter, err := otlptracehttp.New(ctx, opts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating OTLP HTTP trace exporter: %w\", err)\n\t}\n\n\treturn exporter, nil\n}\n\nfunc (b *OTLPTraceExporterBuilder) buildGRPCExporter(ctx context.Context) (sdktrace.SpanExporter, error) {\n\tif b.opts.Endpoint == \"\" {\n\t\treturn nil, fmt.Errorf(\"endpoint is required for OTLP gRPC trace exporter\")\n\t}\n\n\topts := []otlptracegrpc.Option{\n\t\totlptracegrpc.WithEndpoint(b.opts.Endpoint),\n\t}\n\n\tif b.opts.Insecure {\n\t\topts = append(opts, otlptracegrpc.WithInsecure())\n\t\topts = append(opts, otlptracegrpc.WithDialOption(grpc.WithTransportCredentials(insecure.NewCredentials())))\n\t}\n\n\tif len(b.opts.Headers) > 0 {\n\t\topts = append(opts, otlptracegrpc.WithHeaders(b.opts.Headers))\n\t}\n\n\tif b.opts.Timeout > 0 {\n\t\topts = append(opts, otlptracegrpc.WithTimeout(b.opts.Timeout))\n\t}\n\n\tif b.opts.Compression {\n\t\topts = append(opts, otlptracegrpc.WithCompressor(\"gzip\"))\n\t}\n\n\texporter, err := otlptracegrpc.New(ctx, opts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating OTLP gRPC trace exporter: %w\", err)\n\t}\n\n\treturn exporter, nil\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/otlp/otlp.trace.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage otlp\n\nimport \"time\"\n\ntype OTLPTraceExporterBuilderOption interface {\n\tapply(*OTLPTraceExporterBuilder)\n}\n\ntype funcOTLPTraceExporterBuilderOption struct {\n\tf func(*OTLPTraceExporterBuilder)\n}\n\nfunc (fdo *funcOTLPTraceExporterBuilderOption) apply(do *OTLPTraceExporterBuilder) {\n\tfdo.f(do)\n}\n\nfunc newFuncOTLPTraceExporterBuilderOption(f func(*OTLPTraceExporterBuilder)) *funcOTLPTraceExporterBuilderOption {\n\treturn &funcOTLPTraceExporterBuilderOption{f: f}\n}\n\nfunc (o *OTLPTraceExporterBuilder) ApplyOptions(opts ...OTLPTraceExporterBuilderOption) {\n\tfor _, opt := range opts {\n\t\topt.apply(o)\n\t}\n}\n\n// WithEndpoint sets the target endpoint URL\n// For HTTP: include scheme, e.g., \"https://tracing.example.com\"\n// For gRPC: without scheme, e.g., \"tracing.example.com:4317\"\nfunc WithEndpoint(endpoint string) OTLPTraceExporterBuilderOption {\n\treturn newFuncOTLPTraceExporterBuilderOption(func(o *OTLPTraceExporterBuilder) {\n\t\to.opts.Endpoint = endpoint\n\t})\n}\n\n// WithHeaders sets HTTP headers for authentication\nfunc WithHeaders(headers map[string]string) OTLPTraceExporterBuilderOption {\n\treturn newFuncOTLPTraceExporterBuilderOption(func(o *OTLPTraceExporterBuilder) {\n\t\to.opts.Headers = headers\n\t})\n}\n\n// WithProtocol sets the protocol (HTTP or gRPC)\nfunc WithProtocol(protocol Protocol) OTLPTraceExporterBuilderOption {\n\treturn newFuncOTLPTraceExporterBuilderOption(func(o *OTLPTraceExporterBuilder) {\n\t\to.opts.Protocol = protocol\n\t})\n}\n\n// WithInsecure disables TLS\nfunc WithInsecure(insecure bool) OTLPTraceExporterBuilderOption {\n\treturn newFuncOTLPTraceExporterBuilderOption(func(o *OTLPTraceExporterBuilder) {\n\t\to.opts.Insecure = insecure\n\t})\n}\n\n// WithTimeout sets the timeout for the exporter\nfunc WithTimeout(timeout time.Duration) OTLPTraceExporterBuilderOption {\n\treturn newFuncOTLPTraceExporterBuilderOption(func(o *OTLPTraceExporterBuilder) {\n\t\to.opts.Timeout = timeout\n\t})\n}\n\n// WithURLPath sets the URL path for HTTP protocol\nfunc WithURLPath(urlPath string) OTLPTraceExporterBuilderOption {\n\treturn newFuncOTLPTraceExporterBuilderOption(func(o *OTLPTraceExporterBuilder) {\n\t\to.opts.URLPath = urlPath\n\t})\n}\n\n// WithCompression enables gzip compression\nfunc WithCompression(compression bool) OTLPTraceExporterBuilderOption {\n\treturn newFuncOTLPTraceExporterBuilderOption(func(o *OTLPTraceExporterBuilder) {\n\t\to.opts.Compression = compression\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/stdout/stdout.trace.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage stdout\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"go.opentelemetry.io/otel/exporters/stdout/stdouttrace\"\n\tsdktrace \"go.opentelemetry.io/otel/sdk/trace\"\n)\n\ntype StdoutExporterBuilderOptions struct {\n\tstdouttraceOpts []stdouttrace.Option\n}\n\ntype StdoutExporterBuilder struct {\n\topts StdoutExporterBuilderOptions\n}\n\nfunc defaultBuilderOptions() StdoutExporterBuilderOptions {\n\treturn StdoutExporterBuilderOptions{}\n}\n\nfunc NewStdoutExporterBuilder(opts ...StdoutExporterBuilderOption) *StdoutExporterBuilder {\n\n\tbuilder := &StdoutExporterBuilder{\n\t\topts: defaultBuilderOptions(),\n\t}\n\tbuilder.ApplyOptions(opts...)\n\treturn builder\n}\n\nfunc (p *StdoutExporterBuilder) Build(\n\tctx context.Context,\n) (sdktrace.SpanExporter, error) {\n\n\texporter, err := stdouttrace.New(p.opts.stdouttraceOpts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating stdouttrace exporter: %w\", err)\n\t}\n\n\treturn exporter, nil\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/stdout/stdout.trace.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage stdout\n\nimport \"go.opentelemetry.io/otel/exporters/stdout/stdouttrace\"\n\nfunc WithPrettyPrint(prettyPrint bool) StdoutExporterBuilderOption {\n\treturn StdoutExporterBuilderOptionFunc(func(m *StdoutExporterBuilder) {\n\t\tif prettyPrint {\n\t\t\tm.opts.stdouttraceOpts = append(m.opts.stdouttraceOpts, stdouttrace.WithPrettyPrint())\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/stdout/stdout.trace_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage stdout\n\n// A StdoutExporterBuilderOption sets options.\ntype StdoutExporterBuilderOption interface {\n\tapply(*StdoutExporterBuilder)\n}\n\n// EmptyStdoutExporterBuilderOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyStdoutExporterBuilderOption struct{}\n\nfunc (EmptyStdoutExporterBuilderOption) apply(*StdoutExporterBuilder) {}\n\n// StdoutExporterBuilderOptionFunc wraps a function that modifies Client into an\n// implementation of the StdoutExporterBuilderOption interface.\ntype StdoutExporterBuilderOptionFunc func(*StdoutExporterBuilder)\n\nfunc (f StdoutExporterBuilderOptionFunc) apply(do *StdoutExporterBuilder) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _StdoutExporterBuilderOptionWithDefault() StdoutExporterBuilderOption {\n\treturn StdoutExporterBuilderOptionFunc(func(*StdoutExporterBuilder) {\n\t\t// nothing to change\n\t})\n}\n\nfunc (o *StdoutExporterBuilder) ApplyOptions(\n\toptions ...StdoutExporterBuilderOption,\n) *StdoutExporterBuilder {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/tracer.exporter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage tracer\n\nimport (\n\t\"context\"\n\n\tsdktrace \"go.opentelemetry.io/otel/sdk/trace\"\n)\n\ntype TracerExporterBuilder interface {\n\tBuild(ctx context.Context) (sdktrace.SpanExporter, error)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/tracer.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage tracer\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/sdk/resource\"\n\tsdktrace \"go.opentelemetry.io/otel/sdk/trace\"\n\tsemconv \"go.opentelemetry.io/otel/semconv/v1.26.0\"\n\t\"go.opentelemetry.io/otel/trace\"\n)\n\ntype TracerOptions struct {\n\tbuiler           TracerExporterBuilder\n\tserviceName      string\n\tserviceVersion   string\n\tserviceNamespace string\n\ttracerProvider   *sdktrace.TracerProvider\n\tresource         *resource.Resource\n\texporterName     string // for logging\n\texporterEndpoint string // for logging\n}\n\ntype Tracer struct {\n\topts TracerOptions\n}\n\nfunc NewTracer(opts ...TracerOption) *Tracer {\n\tt := &Tracer{}\n\tt.ApplyOptions(opts...)\n\n\treturn t\n}\n\n// https://github.com/open-telemetry/opentelemetry-go/blob/main/example/jaeger/main.go\nfunc (t *Tracer) Install(ctx context.Context) (err error) {\n\texp, err := t.createExporter(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Use custom resource if provided\n\tvar res *resource.Resource\n\tif t.opts.resource != nil {\n\t\tres = t.opts.resource\n\t} else {\n\t\t// Build resource attributes\n\t\tresourceAttrs := []resource.Option{\n\t\t\tresource.WithSchemaURL(semconv.SchemaURL),\n\t\t}\n\n\t\t// Add service information if provided\n\t\tif t.opts.serviceName != \"\" {\n\t\t\tattrs := []attribute.KeyValue{\n\t\t\t\tsemconv.ServiceName(t.opts.serviceName),\n\t\t\t}\n\t\t\tif t.opts.serviceVersion != \"\" {\n\t\t\t\tattrs = append(attrs, semconv.ServiceVersion(t.opts.serviceVersion))\n\t\t\t}\n\t\t\tif t.opts.serviceNamespace != \"\" {\n\t\t\t\tattrs = append(attrs, semconv.ServiceNamespace(t.opts.serviceNamespace))\n\t\t\t}\n\t\t\tresourceAttrs = append(resourceAttrs, resource.WithAttributes(attrs...))\n\t\t}\n\n\t\tres, err = resource.New(ctx, resourceAttrs...)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"creating resource: %w\", err)\n\t\t}\n\t}\n\n\t// Configure BatchSpanProcessor with shorter export interval for better observability\n\tbatchOpts := []sdktrace.BatchSpanProcessorOption{\n\t\tsdktrace.WithBatchTimeout(5 * time.Second), // Export every 5 seconds\n\t}\n\n\ttp := sdktrace.NewTracerProvider(\n\t\t// Always be sure to batch in production.\n\t\tsdktrace.WithBatcher(exp, batchOpts...),\n\t\t// Record information about this application in a Resource.\n\t\tsdktrace.WithResource(res),\n\t\t// Always sample - ensure all spans are recorded\n\t\tsdktrace.WithSampler(sdktrace.AlwaysSample()),\n\t)\n\n\tlogrus.Infof(\"TracerProvider created with BatchSpanProcessor (batch_timeout=5s, sampler=AlwaysSample)\")\n\n\t// Register our TracerProvider as the global so any imported\n\t// instrumentation in the future will default to using it.\n\totel.SetTracerProvider(tp)\n\n\t// Store the tracer provider for later use\n\tt.opts.tracerProvider = tp\n\n\treturn nil\n}\n\nfunc (t *Tracer) createExporter(ctx context.Context) (sdktrace.SpanExporter, error) {\n\tif t.opts.builer == nil {\n\t\treturn nil, fmt.Errorf(\"trace exporter builder is nil\")\n\t}\n\n\texp, err := t.opts.builer.Build(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Wrap with logging exporter if configured\n\tif t.opts.exporterName != \"\" {\n\t\texp = NewLoggingExporter(exp, t.opts.exporterName, t.opts.exporterEndpoint)\n\t}\n\n\treturn exp, nil\n}\n\n// TracerProvider returns the configured TracerProvider\nfunc (t *Tracer) TracerProvider() trace.TracerProvider {\n\tif t.opts.tracerProvider != nil {\n\t\treturn t.opts.tracerProvider\n\t}\n\treturn otel.GetTracerProvider()\n}\n\n// Shutdown shuts down the tracer provider\nfunc (t *Tracer) Shutdown(ctx context.Context) error {\n\tif t.opts.tracerProvider != nil {\n\t\treturn t.opts.tracerProvider.Shutdown(ctx)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/tracer.logging_exporter.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage tracer\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/sirupsen/logrus\"\n\tsdktrace \"go.opentelemetry.io/otel/sdk/trace\"\n)\n\n// LoggingExporter wraps a trace.SpanExporter and logs export results\ntype LoggingExporter struct {\n\tinner    sdktrace.SpanExporter\n\tname     string // exporter name for logging (e.g., \"OTLP\", \"Jaeger\", \"stdout\")\n\tendpoint string // endpoint for logging\n}\n\n// NewLoggingExporter creates a new LoggingExporter that wraps the given exporter\nfunc NewLoggingExporter(inner sdktrace.SpanExporter, name, endpoint string) *LoggingExporter {\n\treturn &LoggingExporter{\n\t\tinner:    inner,\n\t\tname:     name,\n\t\tendpoint: endpoint,\n\t}\n}\n\n// ExportSpans exports spans and logs the result\nfunc (e *LoggingExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error {\n\tstart := time.Now()\n\n\tspanCount := len(spans)\n\n\t// Log span details for debugging\n\tif spanCount > 0 {\n\t\tlogrus.Debugf(\"[%s] exporting %d spans to %s\", e.name, spanCount, e.endpoint)\n\t}\n\n\terr := e.inner.ExportSpans(ctx, spans)\n\tduration := time.Since(start)\n\n\tif err != nil {\n\t\tlogrus.Errorf(\"[%s] trace export failed: endpoint=%s, spans=%d, duration=%v, error=%v\",\n\t\t\te.name, e.endpoint, spanCount, duration, err)\n\t} else {\n\t\tif spanCount > 0 {\n\t\t\tlogrus.Infof(\"[%s] trace export success: endpoint=%s, spans=%d, duration=%v\",\n\t\t\t\te.name, e.endpoint, spanCount, duration)\n\t\t}\n\t}\n\n\treturn err\n}\n\n// Shutdown shuts down the exporter\nfunc (e *LoggingExporter) Shutdown(ctx context.Context) error {\n\tlogrus.Infof(\"[%s] trace exporter shutting down: endpoint=%s\", e.name, e.endpoint)\n\treturn e.inner.Shutdown(ctx)\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/tracer.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage tracer\n\nimport (\n\t\"go.opentelemetry.io/otel/sdk/resource\"\n)\n\nfunc WithExporterBuilder(builder TracerExporterBuilder) TracerOption {\n\treturn TracerOptionFunc(func(m *Tracer) {\n\t\tm.opts.builer = builder\n\t})\n}\n\n// WithServiceName sets the service name for the tracer\nfunc WithServiceName(name string) TracerOption {\n\treturn TracerOptionFunc(func(m *Tracer) {\n\t\tm.opts.serviceName = name\n\t})\n}\n\n// WithServiceVersion sets the service version for the tracer\nfunc WithServiceVersion(version string) TracerOption {\n\treturn TracerOptionFunc(func(m *Tracer) {\n\t\tm.opts.serviceVersion = version\n\t})\n}\n\n// WithServiceNamespace sets the service namespace for the tracer\nfunc WithServiceNamespace(namespace string) TracerOption {\n\treturn TracerOptionFunc(func(m *Tracer) {\n\t\tm.opts.serviceNamespace = namespace\n\t})\n}\n\n// WithResource sets a custom resource for the tracer\nfunc WithResource(res *resource.Resource) TracerOption {\n\treturn TracerOptionFunc(func(m *Tracer) {\n\t\tm.opts.resource = res\n\t})\n}\n\n// WithExporterLogging enables logging for trace export operations\n// name: exporter name for logging (e.g., \"OTLP\", \"Jaeger\", \"stdout\")\n// endpoint: endpoint address for logging\nfunc WithExporterLogging(name, endpoint string) TracerOption {\n\treturn TracerOptionFunc(func(m *Tracer) {\n\t\tm.opts.exporterName = name\n\t\tm.opts.exporterEndpoint = endpoint\n\t})\n}\n"
  },
  {
    "path": "pkg/opentelemetry/tracer/tracer_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage tracer\n\n// A TracerOption sets options.\ntype TracerOption interface {\n\tapply(*Tracer)\n}\n\n// EmptyTracerOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyTracerOption struct{}\n\nfunc (EmptyTracerOption) apply(*Tracer) {}\n\n// TracerOptionFunc wraps a function that modifies Client into an\n// implementation of the TracerOption interface.\ntype TracerOptionFunc func(*Tracer)\n\nfunc (f TracerOptionFunc) apply(do *Tracer) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _TracerOptionWithDefault() TracerOption {\n\treturn TracerOptionFunc(func(*Tracer) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Tracer) ApplyOptions(options ...TracerOption) *Tracer {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/pool/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/pool\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/database => ../database\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/go-redis/redis/v8 v8.11.5\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/google/uuid v1.6.0\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/database v0.0.0-00010101000000-000000000000\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgolang.org/x/net v0.48.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n"
  },
  {
    "path": "pkg/pool/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=\ngithub.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=\ngithub.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=\ngithub.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=\ngithub.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=\ngithub.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=\ngithub.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=\ngopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\n"
  },
  {
    "path": "pkg/pool/instance/call.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage instance\n"
  },
  {
    "path": "pkg/pool/instance/error.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage instance\n\ntype ContextCanceledError struct {\n\tMessage string\n}\n\nfunc (e ContextCanceledError) Error() string {\n\treturn e.Message\n}\n\ntype TimeoutError struct {\n\tMessage string\n}\n\nfunc (e TimeoutError) Error() string {\n\treturn e.Message\n}\n"
  },
  {
    "path": "pkg/pool/instance/instance.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage instance\n\n// CoreInstanceHolder is a instance which is used by core (gpu or cpu or npu).\ntype CoreInstanceHolder struct {\n\tInstance   interface{}\n\tName       string\n\tCoreID     int64\n\tModelPaths []string\n\tBatchSize  int64\n\tThread\n}\n"
  },
  {
    "path": "pkg/pool/instance/pool.instance.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage instance\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"sync\"\n\t\"time\"\n\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype GlobalInitFunc func() error\ntype GlobalReleaseFunc func() error\ntype LocalInitFunc func(instance interface{}) error\ntype LocalReleaseFunc func(instance interface{}) error\ntype NewFunc func() interface{}\ntype DeleteFunc func(instance interface{})\n\ntype LoadBalanceMode int\n\nconst (\n\tRoundRobinBalanceMode LoadBalanceMode = 0\n\tRandomLoadBalanceMode LoadBalanceMode = 1\n\tLeastLoadBalanceMode  LoadBalanceMode = 2\n)\n\ntype PoolOptions struct {\n\tname                    string\n\tresevePoolSizePerCore   int64\n\tcapacityPoolSizePerCore int64\n\tidleTimeout             time.Duration\n\t// the wait time to try get instance again, 0 means wait forever,\n\t// execute the block without any timeout\n\twaitTimeoutOnce time.Duration\n\n\t// the total wait time to try get instance, 0 means wait forever,\n\t// execute the block without any timeout\n\twaitTimeoutTotal time.Duration\n\tloadBalanceMode  LoadBalanceMode\n\n\tcoreIDs []int64\n\n\tmodelPaths []string\n\tbatchSize  int64\n\n\tglobalInitFunc    GlobalInitFunc\n\tglobalReleaseFunc GlobalReleaseFunc\n\tlocalInitFunc     LocalInitFunc\n\tlocalReleaseFunc  LocalReleaseFunc\n\tdeleteFunc        DeleteFunc\n\n\tenabledPrintCostTime bool\n}\n\ntype Pool struct {\n\tnewFunc NewFunc\n\n\tholders map[int64]chan *CoreInstanceHolder\n\topts    PoolOptions\n\tmu      sync.RWMutex\n}\n\nfunc defaultPoolOptions() PoolOptions {\n\treturn PoolOptions{\n\t\tresevePoolSizePerCore:   0,\n\t\tcapacityPoolSizePerCore: 1,\n\t\tidleTimeout:             10 * time.Second,\n\t\twaitTimeoutOnce:         10 * time.Millisecond,\n\t}\n}\n\nfunc NewPool(newFunc NewFunc, opts ...PoolOption) (*Pool, error) {\n\tif newFunc == nil {\n\t\treturn nil, fmt.Errorf(\"new func is nil\")\n\n\t}\n\tp := &Pool{\n\t\tnewFunc: newFunc,\n\t\tholders: make(map[int64]chan *CoreInstanceHolder),\n\t\topts:    defaultPoolOptions(),\n\t}\n\tp.ApplyOptions(opts...)\n\n\tif p.opts.resevePoolSizePerCore < 0 {\n\t\tp.opts.resevePoolSizePerCore = 0\n\t}\n\n\tif p.opts.capacityPoolSizePerCore < p.opts.resevePoolSizePerCore {\n\t\tp.opts.capacityPoolSizePerCore = p.opts.resevePoolSizePerCore\n\t}\n\n\treturn p, nil\n}\n\nfunc (p *Pool) init(ctx context.Context) error {\n\n\tfor _, id := range p.opts.coreIDs {\n\t\tif id < 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tp.holders[id] = make(chan *CoreInstanceHolder, p.opts.capacityPoolSizePerCore)\n\t\tfor i := int64(0); i < p.opts.resevePoolSizePerCore; i++ {\n\t\t\tholder := &CoreInstanceHolder{\n\t\t\t\tName:       p.opts.name,\n\t\t\t\tCoreID:     id,\n\t\t\t\tModelPaths: p.opts.modelPaths,\n\t\t\t\tBatchSize:  p.opts.batchSize,\n\t\t\t}\n\t\t\terr := holder.Do(ctx, func() {\n\t\t\t\tholder.Instance = p.newFunc()\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif holder.Instance == nil {\n\t\t\t\treturn fmt.Errorf(\"instance the result of new func is nil\")\n\t\t\t}\n\n\t\t\tvar processErr error\n\t\t\terr = holder.Do(ctx, func() {\n\t\t\t\tprocessErr = p.opts.localInitFunc(holder.Instance)\n\t\t\t})\n\n\t\t\tif processErr != nil {\n\t\t\t\treturn processErr\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tp.holders[id] <- holder\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (p *Pool) GlobalInit(ctx context.Context) error {\n\terr := p.globalInit(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn p.init(ctx)\n}\n\nfunc (p *Pool) globalInit(ctx context.Context) error {\n\tif p.opts.globalInitFunc == nil {\n\t\treturn nil\n\t}\n\n\treturn p.opts.globalInitFunc()\n}\n\nfunc (p *Pool) GlobalRelease(ctx context.Context) error {\n\tfor _, ch := range p.holders {\n\t\tselect {\n\t\tcase holder := <-ch:\n\t\t\tholder.Do(ctx, func() {\n\t\t\t\tif p.opts.localReleaseFunc != nil {\n\t\t\t\t\tp.opts.localReleaseFunc(holder.Instance)\n\t\t\t\t}\n\n\t\t\t\tif p.opts.deleteFunc != nil {\n\t\t\t\t\tp.opts.deleteFunc(holder.Instance)\n\t\t\t\t}\n\t\t\t})\n\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\n\t\tdefault:\n\t\t}\n\t}\n\n\treturn p.opts.globalReleaseFunc()\n}\n\nfunc (p *Pool) globalRelease(ctx context.Context) error {\n\tif p.opts.globalReleaseFunc == nil {\n\t\treturn nil\n\t}\n\n\treturn p.opts.globalReleaseFunc()\n}\n\nfunc (p *Pool) GetByCoreId(ctx context.Context, coreID int64) (*CoreInstanceHolder, error) {\n\tif p.opts.capacityPoolSizePerCore <= 0 {\n\t\treturn nil, fmt.Errorf(\"no instance, capacity pool size per core is <= 0\")\n\t}\n\n\tif p.opts.waitTimeoutOnce == 0 {\n\t\tselect {\n\t\tcase holder := <-p.holders[coreID]:\n\t\t\tlogrus.Infof(\"get a instance in core id: %v\", coreID)\n\t\t\treturn holder, nil\n\t\tcase <-ctx.Done():\n\t\t\treturn nil, ContextCanceledError{Message: ctx.Err().Error()}\n\t\t}\n\t}\n\n\ttimer := time.NewTimer(p.opts.waitTimeoutOnce)\n\tdefer timer.Stop()\n\n\tselect {\n\tcase holder := <-p.holders[coreID]:\n\t\tlogrus.Infof(\"get a instance in core id: %v\", coreID)\n\t\treturn holder, nil\n\tcase <-ctx.Done():\n\t\tlogrus.WithError(ctx.Err()).Errorf(\"get a instance in core id: %v context canceled\", coreID)\n\t\treturn nil, ContextCanceledError{Message: ctx.Err().Error()}\n\tcase <-timer.C:\n\t\tmsg := fmt.Sprintf(\"get instance timeout: %v, try again.\", p.opts.waitTimeoutOnce)\n\t\tlogrus.Warnf(msg)\n\t\treturn nil, TimeoutError{Message: msg}\n\t}\n\n}\n\nfunc (p *Pool) Get(ctx context.Context) (*CoreInstanceHolder, error) {\n\n\tswitch p.opts.loadBalanceMode {\n\tcase RoundRobinBalanceMode:\n\t\treturn p.GetWithRoundRobinMode(ctx)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"not support the loadBalance mode: %v\", p.opts.loadBalanceMode)\n\t}\n}\n\n// until get instance, unless context canceled\nfunc (p *Pool) GetWithRoundRobinMode(ctx context.Context) (*CoreInstanceHolder, error) {\n\n\tremain := p.opts.waitTimeoutTotal\n\n\tfor {\n\t\tfor _, id := range p.opts.coreIDs {\n\t\t\ttc := time_.New(true)\n\n\t\t\tholder, err := p.GetByCoreId(ctx, id)\n\t\t\tif err == nil {\n\t\t\t\treturn holder, nil\n\t\t\t}\n\n\t\t\tif p.opts.waitTimeoutTotal > 0 {\n\t\t\t\tremain -= tc.Elapse()\n\t\t\t\tif remain <= 0 {\n\t\t\t\t\tmsg := fmt.Sprintf(\"get instance total timeout: %v, remain: %v\", p.opts.waitTimeoutTotal, remain)\n\t\t\t\t\tlogrus.Errorf(msg)\n\t\t\t\t\treturn nil, TimeoutError{Message: msg}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch err.(type) {\n\t\t\tcase ContextCanceledError:\n\t\t\t\treturn nil, err\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (p *Pool) Put(ctx context.Context, holder *CoreInstanceHolder) error {\n\tselect {\n\tcase p.holders[holder.CoreID] <- holder:\n\t\tfmt.Println(\"put\")\n\t\treturn nil\n\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\n\tdefault:\n\t}\n\n\t// if get this line, it means put instance error, then we delete this instance\n\tif p.opts.localReleaseFunc != nil {\n\t\tholder.Do(ctx, func() {\n\t\t\tp.opts.localReleaseFunc(holder.Instance)\n\t\t})\n\n\t}\n\tif p.opts.deleteFunc != nil {\n\t\tholder.Do(ctx, func() {\n\t\t\tp.opts.deleteFunc(holder.Instance)\n\t\t})\n\t}\n\n\treturn nil\n}\n\nfunc (p *Pool) Invoke(\n\tctx context.Context,\n\tf func(ctx context.Context, instance interface{}) (interface{}, error),\n) (response interface{}, err error) {\n\n\tholder := &CoreInstanceHolder{}\n\ttc := time_.New(p.opts.enabledPrintCostTime)\n\tsummary := func() {\n\t\tvar coreID int64 = -1\n\t\tif holder != nil {\n\t\t\tcoreID = holder.CoreID\n\t\t}\n\t\ttc.Tick(fmt.Sprintf(\"Invoke %v no coreID: %v\", filepath.Base(runtime_.NameOfFunction(f)), coreID))\n\t\tlogrus.Infof(tc.String())\n\t}\n\tdefer summary()\n\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\tholder, err = p.Get(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer p.Put(ctx, holder)\n\n\tvar processErr error\n\terr = holder.Do(ctx, func() {\n\t\tresponse, processErr = f(ctx, holder.Instance)\n\t})\n\n\tif processErr != nil {\n\t\terr = processErr\n\t}\n\n\treturn response, err\n}\n"
  },
  {
    "path": "pkg/pool/instance/pool.instance.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage instance\n\nimport \"time\"\n\nfunc WithName(name string) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.name = name\n\t})\n}\n\nfunc WithResevePoolSizePerCore(resevePoolSizePerCore int64) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.resevePoolSizePerCore = resevePoolSizePerCore\n\t})\n}\n\nfunc WithCapacityPoolSizePerCore(capacityPoolSizePerCore int64) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.capacityPoolSizePerCore = capacityPoolSizePerCore\n\t})\n}\n\nfunc WithWaitTimeoutOnce(waitTimeout time.Duration) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.waitTimeoutOnce = waitTimeout\n\t})\n}\n\nfunc WithWaitTimeoutTotal(waitTimeout time.Duration) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.waitTimeoutTotal = waitTimeout\n\t})\n}\n\nfunc WithLoadBalanceMode(loadBalanceMode LoadBalanceMode) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.loadBalanceMode = loadBalanceMode\n\t})\n}\n\nfunc WithCoreIDs(coreIDs []int64) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.coreIDs = coreIDs\n\t})\n}\n\nfunc WithModelPaths(modelPaths []string) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.modelPaths = modelPaths\n\t})\n}\n\nfunc WithBatchSize(batchSize int64) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.batchSize = batchSize\n\t})\n}\n\nfunc WithGlobalInitFunc(f GlobalInitFunc) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.globalInitFunc = f\n\t})\n}\n\nfunc WithGlobalReleaseFunc(f GlobalReleaseFunc) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.globalReleaseFunc = f\n\t})\n}\n\nfunc WithLocalInitFunc(f LocalInitFunc) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.localInitFunc = f\n\t})\n}\n\nfunc WithLocalReleaseFunc(f LocalReleaseFunc) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.localReleaseFunc = f\n\t})\n}\n\nfunc WithDeleteFunc(f DeleteFunc) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.deleteFunc = f\n\t})\n}\n\nfunc WithEnabledPrintCostTime(enabled bool) PoolOption {\n\treturn PoolOptionFunc(func(p *Pool) {\n\t\tp.opts.enabledPrintCostTime = enabled\n\t})\n}\n"
  },
  {
    "path": "pkg/pool/instance/pool.instance_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage instance\n\n// A PoolOption sets options.\ntype PoolOption interface {\n\tapply(*Pool)\n}\n\n// EmptyPoolUrlOption does not alter the Pooluration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyPoolOption struct{}\n\nfunc (EmptyPoolOption) apply(*Pool) {}\n\n// PoolOptionFunc wraps a function that modifies Pool into an\n// implementation of the PoolOption interface.\ntype PoolOptionFunc func(*Pool)\n\nfunc (f PoolOptionFunc) apply(do *Pool) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _PoolOptionWithDefault() PoolOption {\n\treturn PoolOptionFunc(func(*Pool) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Pool) ApplyOptions(options ...PoolOption) *Pool {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/pool/instance/pool.instance_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage instance_test\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\tinstance_ \"github.com/kaydxh/golang/pkg/pool/instance\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype InstancePool struct {\n\tpool *instance_.Pool\n}\n\ntype Sdk struct {\n}\n\nfunc (s *Sdk) DoSdk() error {\n\tlogrus.Infof(\"do DoSdk\")\n\ttime.Sleep(2 * time.Second)\n\treturn nil\n}\n\nfunc (s *InstancePool) InvokeProcess(ctx context.Context) error {\n\t//logrus.Infof(\"do InvokeProcess\")\n\tresp, err := s.pool.Invoke(ctx, func(ctx context.Context, instance interface{}) (interface{}, error) {\n\t\treturn nil, instance.(*Sdk).DoSdk()\n\t})\n\tif err != nil {\n\t\tlogrus.Errorf(\"do DoSdk err: %v\", err)\n\t}\n\t_ = resp\n\n\treturn err\n}\n\nfunc GlobalInit() error {\n\tlogrus.Infof(\"do GlobaInit\")\n\treturn nil\n}\n\nfunc GlobalRelease() error {\n\tlogrus.Infof(\"do GlobalRelease\")\n\treturn nil\n}\n\nfunc LocalInit() error {\n\tlogrus.Infof(\"do LocalInit\")\n\treturn nil\n}\n\nfunc LocalRelease() error {\n\tlogrus.Infof(\"do LocalRelease\")\n\treturn nil\n}\n\nfunc New() error {\n\tlogrus.Infof(\"do New\")\n\treturn nil\n}\n\nfunc Delete() {\n\tlogrus.Infof(\"do Delete\")\n}\n\nfunc TestNewPool(t *testing.T) {\n\tctx := context.Background()\n\tpool, err := instance_.NewPool(func() interface{} {\n\t\tNew()\n\t\treturn &Sdk{}\n\t},\n\t\tinstance_.WithCoreIDs([]int64{0, 1, 2}),\n\t\tinstance_.WithBatchSize(8),\n\t\tinstance_.WithWaitTimeoutOnce(50*time.Millisecond),\n\t\tinstance_.WithWaitTimeoutTotal(time.Second),\n\t\tinstance_.WithName(\"test-instance\"),\n\t\tinstance_.WithEnabledPrintCostTime(true),\n\t\t//instance_.WithWaitTimeout(time.Millisecond),\n\t\tinstance_.WithResevePoolSizePerCore(1),\n\t\tinstance_.WithCapacityPoolSizePerCore(1),\n\t\tinstance_.WithGlobalInitFunc(func() error {\n\t\t\treturn GlobalInit()\n\t\t}),\n\t\tinstance_.WithGlobalReleaseFunc(func() error {\n\t\t\treturn GlobalRelease()\n\t\t}),\n\t\tinstance_.WithLocalInitFunc(func(instace interface{}) error {\n\t\t\treturn LocalInit()\n\t\t}),\n\t\tinstance_.WithLocalReleaseFunc(func(instace interface{}) error {\n\t\t\treturn LocalRelease()\n\t\t}),\n\t\tinstance_.WithDeleteFunc(func(instace interface{}) {\n\t\t\tDelete()\n\t\t}),\n\t)\n\n\terr = pool.GlobalInit(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"global init err: %v\", err)\n\t\treturn\n\t}\n\n\tdefer pool.GlobalRelease(ctx)\n\n\t//do somthing\n\tinstancePool := &InstancePool{\n\t\tpool: pool,\n\t}\n\n\tvar wg sync.WaitGroup\n\tfor i := 0; i < 10; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\terr = instancePool.InvokeProcess(ctx)\n\t\t}()\n\t}\n\n\twg.Wait()\n\n\treturn\n\n}\n"
  },
  {
    "path": "pkg/pool/instance/thread.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage instance\n\nimport (\n\t\"context\"\n\t\"runtime\"\n\t\"sync\"\n\n\truntime_ \"github.com/kaydxh/golang/go/runtime\"\n)\n\ntype Thread struct {\n\tenableOsThread bool\n\n\tctx       context.Context\n\tcancel    context.CancelFunc\n\thandlerCh chan func()\n\tonce      sync.Once\n\tmu        sync.Mutex\n}\n\nfunc NewThread(enableOsThread bool) *Thread {\n\tt := &Thread{\n\t\tenableOsThread: enableOsThread,\n\t}\n\tt.initOnce()\n\treturn t\n}\n\nfunc (t *Thread) initOnce() {\n\tt.once.Do(func() {\n\t\tt.mu.Lock()\n\t\tdefer t.mu.Unlock()\n\t\tt.ctx, t.cancel = context.WithCancel(context.Background())\n\n\t\tt.handlerCh = make(chan func())\n\t\tgo t.DoInOSThread()\n\t})\n}\n\nfunc (t *Thread) Do(ctx context.Context, f func()) error {\n\tt.initOnce()\n\n\t// wait group make Do func and f func return in sync\n\tvar wg sync.WaitGroup\n\tdefer wg.Wait()\n\twg.Add(1)\n\n\thandler := func() {\n\t\tdefer wg.Done()\n\t\tdefer runtime_.Recover()\n\t\tf()\n\t}\n\n\tselect {\n\tcase t.handlerCh <- handler:\n\t\treturn nil\n\n\tcase <-ctx.Done():\n\t\twg.Done()\n\t\treturn ctx.Err()\n\n\tcase <-t.ctx.Done():\n\t\twg.Done()\n\t\treturn t.ctx.Err()\n\t}\n}\n\nfunc (t *Thread) DoInOSThread() {\n\n\tif t.enableOsThread {\n\t\truntime.LockOSThread()\n\t\tdefer runtime.UnlockOSThread()\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase handler, ok := <-t.handlerCh:\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif handler == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\thandler()\n\n\t\tcase <-t.ctx.Done():\n\t\t\treturn\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "pkg/pool/task/batch_process.go",
    "content": "package task\n\nimport \"fmt\"\n\nfunc BatchProcess[T any](data []T, batchSize int, f func(d []T) error) error {\n\tif batchSize <= 0 {\n\t\treturn fmt.Errorf(\"invalid batchSize %d\", batchSize)\n\t}\n\n\tif f == nil {\n\t\treturn fmt.Errorf(\"porcess func is nil\")\n\t}\n\n\tfor start, end := 0, 0; start < len(data); start = end {\n\t\tend = start + batchSize\n\t\tif end > len(data) {\n\t\t\tend = len(data)\n\t\t}\n\t\tbatch := data[start:end]\n\t\terr := f(batch)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/pool/task/batch_process_test.go",
    "content": "package task_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\ttask_ \"github.com/kaydxh/golang/pkg/pool/task\"\n)\n\nfunc processTask(data []int) error {\n\tfmt.Printf(\"process %v\\n\", data)\n\treturn nil\n}\n\nfunc TestBatchProcessSync(t *testing.T) {\n\ttestCases := []struct {\n\t\tdata      []int\n\t\tbatchSize int\n\t\texpected  string\n\t}{\n\t\t{\n\t\t\tdata:      []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20},\n\t\t\tbatchSize: 4,\n\t\t\texpected:  \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\\n\", i), func(t *testing.T) {\n\t\t\terr := task_.BatchProcess(testCase.data, testCase.batchSize, processTask)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to batch process task %d, got : %v\", i, err)\n\n\t\t\t}\n\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "pkg/pool/task/pool.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage task\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\trate_ \"github.com/kaydxh/golang/go/time/rate\"\n)\n\ntype TaskHandler func(task interface{}) error\n\ntype PoolConfig struct {\n\tburst int\n\t// errstop, only take effect to the tasks that excessed the number burst,\n\terrStop bool\n}\n\nfunc defaultPoolConfig() PoolConfig {\n\treturn PoolConfig{\n\t\tburst:   1,\n\t\terrStop: false,\n\t}\n}\n\ntype Pool struct {\n\tTaskFunc TaskHandler\n\topts     PoolConfig\n\tctx      context.Context\n\n\ttaskChan     chan interface{}\n\terrs         []error\n\tcancel       context.CancelFunc\n\tworkDoneChan chan struct{}\n\n\twg    sync.WaitGroup\n\terrMu sync.Mutex\n}\n\nfunc New(taskFunc TaskHandler, opts ...PoolOptions) *Pool {\n\tp := &Pool{\n\t\tTaskFunc:     taskFunc,\n\t\ttaskChan:     make(chan interface{}),\n\t\tworkDoneChan: make(chan struct{}),\n\t\topts:         defaultPoolConfig(),\n\t}\n\tp.ctx, p.cancel = context.WithCancel(context.Background())\n\tp.ApplyOptions(opts...)\n\n\tgo p.run()\n\treturn p\n}\n\nfunc (p *Pool) Put(task interface{}) error {\n\tselect {\n\tcase p.taskChan <- task:\n\tcase <-p.workDoneChan:\n\t\treturn fmt.Errorf(\"workdone channel is closed, work goroutine is exit\")\n\tcase <-p.ctx.Done():\n\t\treturn fmt.Errorf(\"work is stoped, work goroutine is exit\")\n\n\t}\n\n\treturn nil\n}\n\nfunc (p *Pool) Wait() {\n\tp.wg.Wait()\n}\n\nfunc (p *Pool) Stop() {\n\tp.cancel()\n}\n\nfunc (p *Pool) Error() error {\n\tp.errMu.Lock()\n\tdefer p.errMu.Unlock()\n\n\treturn errors_.NewAggregate(p.errs)\n}\n\nfunc (p *Pool) trySetError(err error) {\n\tp.errMu.Lock()\n\tdefer p.errMu.Unlock()\n\tp.errs = append(p.errs, err)\n}\n\nfunc (p *Pool) run() (doneC <-chan struct{}) {\n\n\tgo func() {\n\t\tdefer close(p.workDoneChan)\n\n\t\tlimiter := rate_.NewLimiter(int(p.opts.burst))\n\t\tfor {\n\t\t\t//util the condition is met, need one token, or will be blocked\n\t\t\tlimiter.AllowWaitUntil()\n\n\t\t\tselect {\n\t\t\tcase task, ok := <-p.taskChan:\n\t\t\t\tif !ok {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tp.wg.Add(1)\n\n\t\t\t\tgo func(t interface{}) {\n\t\t\t\t\tdefer limiter.Put()\n\t\t\t\t\tdefer p.wg.Done()\n\n\t\t\t\t\tif err := p.TaskFunc(t); err != nil {\n\t\t\t\t\t\tp.trySetError(err)\n\t\t\t\t\t\tif p.opts.errStop {\n\t\t\t\t\t\t\tp.cancel()\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t}(task)\n\n\t\t\tcase <-p.ctx.Done():\n\t\t\t\t//  err: context canceled\n\t\t\t\tp.trySetError(p.ctx.Err())\n\t\t\t\treturn\n\t\t\t}\n\n\t\t}\n\t}()\n\n\treturn p.workDoneChan\n}\n"
  },
  {
    "path": "pkg/pool/task/pool.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage task\n\nfunc WithBurst(burst int) PoolOptions {\n\treturn PoolOptionsFunc(func(p *Pool) {\n\t\tp.opts.burst = burst\n\t})\n}\n\nfunc WithErrStop(errStop bool) PoolOptions {\n\treturn PoolOptionsFunc(func(p *Pool) {\n\t\tp.opts.errStop = errStop\n\t})\n}\n"
  },
  {
    "path": "pkg/pool/task/pool_options.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage task\n\n// A PoolOptions sets options.\ntype PoolOptions interface {\n\tapply(*Pool)\n}\n\n// EmptyPoolUrlOption does not alter the Pooluration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyPoolOptions struct{}\n\nfunc (EmptyPoolOptions) apply(*Pool) {}\n\n// PoolOptionsFunc wraps a function that modifies Pool into an\n// implementation of the PoolOptions interface.\ntype PoolOptionsFunc func(*Pool)\n\nfunc (f PoolOptionsFunc) apply(do *Pool) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _PoolOptionsWithDefault() PoolOptions {\n\treturn PoolOptionsFunc(func(*Pool) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Pool) ApplyOptions(options ...PoolOptions) *Pool {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/pool/task/pool_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage task_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\tpool_ \"github.com/kaydxh/golang/pkg/pool/task\"\n)\n\nfunc TestProcessOk(t *testing.T) {\n\n\tp := pool_.New(func(task interface{}) error {\n\t\tfmt.Printf(\"start task[%v]\\n\", task)\n\t\ttime.Sleep(time.Second)\n\t\tfmt.Printf(\"finish task[%v]\\n\", task)\n\t\treturn nil //must return nil\n\t}, pool_.WithBurst(5))\n\n\t//\tdefer p.Wait()\n\tfor i := 0; i < 10; i++ {\n\t\terr := p.Put(fmt.Sprintf(\"%d\", i))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"put work err: %v\", err)\n\t\t\treturn\n\t\t}\n\t\t//p.Stop()\n\t}\n\t//\tp.Stop()\n\tp.Wait()\n\tt.Logf(\"err: %v\", p.Error())\n}\n\nfunc TestProcessFail(t *testing.T) {\n\n\tp := pool_.New(func(task interface{}) error {\n\t\tfmt.Printf(\"start task[%v]\\n\", task)\n\t\ttime.Sleep(time.Second)\n\t\tfmt.Printf(\"finish task[%v]\\n\", task)\n\t\treturn fmt.Errorf(\"failed to process task: %v\\n\", task)\n\t}, pool_.WithBurst(2), pool_.WithErrStop(true))\n\n\t//defer p.Wait()\n\tfor i := 0; i < 4; i++ {\n\t\terr := p.Put(fmt.Sprintf(\"%d\", i))\n\t\tif err != nil {\n\t\t\tt.Errorf(\"put work err: %v\", err)\n\t\t\treturn\n\t\t}\n\t}\n\tp.Stop()\n\tp.Wait()\n\tt.Logf(\"err: %v\", p.Error())\n}\n"
  },
  {
    "path": "pkg/pool/task/worker.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage task\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\trate_ \"github.com/kaydxh/golang/go/time/rate\"\n)\n\ntype WorkFunc func(work interface{}) error\n\ntype Worker struct {\n\tBurst int32\n\n\tcancel context.CancelFunc\n\twg     sync.WaitGroup\n\terrs   []error\n\terrMu  sync.Mutex\n}\n\nfunc (w *Worker) Work(\n\tctx context.Context,\n\tworkChan <-chan interface{},\n\tworkFn WorkFunc,\n\terrStop bool,\n) (doneC <-chan struct{}) {\n\tdone := make(chan struct{})\n\tif w.Burst == 0 {\n\t\tw.Burst = 1\n\t}\n\n\tgo func() {\n\t\tdefer close(done)\n\n\t\tctx, w.cancel = context.WithCancel(ctx)\n\t\tlimiter := rate_.NewLimiter(int(w.Burst))\n\t\tfor {\n\n\t\t\t//util the condition is met, need one token, or will be blocked\n\t\t\tlimiter.AllowWaitUntil()\n\n\t\t\tselect {\n\t\t\tcase work, ok := <-workChan:\n\t\t\t\tif !ok {\n\t\t\t\t\t//workChan is closed\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tw.wg.Add(1)\n\n\t\t\t\tgo func(wk interface{}) {\n\t\t\t\t\tdefer limiter.Put()\n\t\t\t\t\tdefer w.wg.Done()\n\n\t\t\t\t\tif err := workFn(wk); err != nil {\n\t\t\t\t\t\tw.TrySetError(err)\n\t\t\t\t\t\tif errStop {\n\t\t\t\t\t\t\tw.cancel()\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t}(work)\n\n\t\t\tcase <-ctx.Done():\n\t\t\t\t//  err: context canceled\n\t\t\t\tw.TrySetError(ctx.Err())\n\t\t\t\treturn\n\t\t\t}\n\n\t\t}\n\t}()\n\n\treturn done\n\n}\n\nfunc (w *Worker) Error() error {\n\tw.errMu.Lock()\n\tdefer w.errMu.Unlock()\n\n\treturn errors_.NewAggregate(w.errs)\n}\n\nfunc (w *Worker) TrySetError(err error) {\n\tw.errMu.Lock()\n\tdefer w.errMu.Unlock()\n\tw.errs = append(w.errs, err)\n}\n\nfunc (w *Worker) Wait() {\n\tw.wg.Wait()\n}\n\nfunc (w *Worker) Stop() {\n\tw.cancel()\n}\n"
  },
  {
    "path": "pkg/pool/task/worker_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage task_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\tpool_ \"github.com/kaydxh/golang/pkg/pool/task\"\n)\n\nfunc TestWork(t *testing.T) {\n\tp := pool_.Worker{\n\t\tBurst: 10,\n\t}\n\n\tworkChan := make(chan interface{})\n\tctx := context.Background()\n\tworkDoneChan := p.Work(ctx, workChan, func(work interface{}) error {\n\t\tfmt.Printf(\"process task[%v]\\n\", work)\n\t\ttime.Sleep(5 * time.Second)\n\t\t//return nil\n\t\treturn fmt.Errorf(\"error\")\n\t}, false)\n\t_ = workDoneChan\n\n\tworks := []int{1, 2, 3}\n\tfor _, w := range works {\n\t\t// 这里select workDoneChan和ctx.Done可能无法感知，因为work func执\n\t\t// 行比较耗时，而for循环在burst足够多的情况下，立马就执行结束了\n\t\tselect {\n\t\tcase workChan <- w:\n\t\t\t// 这里和woker func函数执行顺序是不确定的，workChan <- w返回，\n\t\t\t// 代表work func已经接收数据，开始执行woker处理协程\n\t\t\tt.Logf(\"start to do work %v\", w)\n\n\t\tcase <-workDoneChan:\n\t\t\tt.Logf(\"workdone channel is closed, work goroutine is exit\")\n\t\t\treturn\n\n\t\tcase <-ctx.Done():\n\t\t\t//canceled, get Error messgae\n\t\t\tt.Errorf(\"err: %v\\n\", p.Error())\n\t\t\treturn\n\n\t\t}\n\n\t\t// stop后，将会在workDoneChan读取到任务协助退出\n\t\t//p.Stop()\n\t}\n\n\t// if need wait finish\n\tp.Wait()\n\tt.Logf(\"wait finish, err: %v\", p.Error())\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage taskqueue\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tredis_ \"github.com/kaydxh/golang/pkg/database/redis\"\n\tqueue_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue\"\n\tredisq_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue/redis\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto TaskQueue\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context, opts ...PoolOption) (*Pool, error) {\n\n\tlogrus.Infof(\"Installing TaskQueue\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\tlogrus.Warnf(\"TaskQueue disenabled\")\n\t\treturn nil, nil\n\t}\n\n\trs, err := c.install(ctx, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed TaskQueue\")\n\n\treturn rs, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context, opts ...PoolOption) (*Pool, error) {\n\n\tconfig := &c.Proto\n\n\tvar queue queue_.Queue\n\tswitch config.GetQueueType() {\n\tcase TaskQueue_queue_type_redis:\n\t\tdb := redis_.GetDB()\n\t\tif db == nil {\n\t\t\treturn nil, fmt.Errorf(\"db is not first installed\")\n\t\t}\n\t\tqueue = redisq_.NewQueue(db, queue_.QueueOptions{Name: \"redis\"})\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"queue type %v is not support\", config.GetQueueType())\n\t}\n\n\tpool := NewPool(queue,\n\t\tWithFetcherBurst(config.GetFetcherBurst()),\n\t\tWithWorkerBurst(config.GetWorkerBurst()),\n\t\tWithWorkTimeout(config.GetWorkTimeout().AsDuration()),\n\t\tWithFetchTimeout(config.GetFetchTimeout().AsDuration()),\n\t\tWithResultExpired(config.GetResultExpired().AsDuration()),\n\t)\n\tpool.ApplyOptions(opts...)\n\n\terr := pool.Consume(ctx)\n\tif err != nil {\n\t\tlogrus.Errorf(\"failed to start consume task, err: %v\", err)\n\t\treturn nil, err\n\t}\n\n\treturn pool, nil\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage taskqueue\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage taskqueue\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/pool.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage taskqueue\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tqueue_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype PoolOptions struct {\n\tworkerBurst   uint32\n\tfetcherBurst  uint32\n\tfetchTimeout  time.Duration\n\tresultExpired time.Duration\n\tworkTimeout   time.Duration\n\n\tresultCallbackFunc queue_.ResultCallbackFunc\n}\n\ntype Pool struct {\n\tmsgChan chan *queue_.Message\n\topts    PoolOptions\n\ttaskq   queue_.Queue\n\n\twg sync.WaitGroup\n}\n\nfunc defaultPoolOptions() PoolOptions {\n\treturn PoolOptions{\n\t\tworkerBurst:   1,\n\t\tfetcherBurst:  1,\n\t\tfetchTimeout:  10 * time.Second,\n\t\tresultExpired: 30 * time.Minute,\n\t}\n}\n\nfunc NewPool(taskq queue_.Queue, opts ...PoolOption) *Pool {\n\tp := &Pool{\n\t\tmsgChan: make(chan *queue_.Message),\n\t\ttaskq:   taskq,\n\t\topts:    defaultPoolOptions(),\n\t}\n\tp.ApplyOptions(opts...)\n\n\treturn p\n}\n\nfunc (p *Pool) Publish(ctx context.Context, msg *queue_.Message) (string, error) {\n\ttaskId, err := p.taskq.Add(ctx, msg)\n\tif err != nil {\n\t\tlogrus.WithError(err).Errorf(\"failed to publish msg: %v\", msg)\n\t\treturn \"\", err\n\t}\n\tlogrus.Infof(\"succeed in publishing msg: %v\", msg)\n\n\tresult := &queue_.MessageResult{\n\t\tId:      msg.Id,\n\t\tInnerId: msg.InnerId,\n\t\tName:    msg.Name,\n\t\tScheme:  msg.Scheme,\n\t\tStatus:  queue_.MessageStatus_Doing,\n\t}\n\n\t//write to queue\n\t_, err = p.taskq.AddResult(ctx, result, p.opts.resultExpired)\n\tif err != nil {\n\t\t//only log error, this error not stop to handle msg\n\t\tlogrus.WithError(err).Errorf(\"failed to add msg result: %v\", result)\n\t}\n\treturn taskId, nil\n}\n\nfunc (p *Pool) Consume(ctx context.Context) (err error) {\n\n\tvar i uint32\n\tfor i = 0; i < p.opts.workerBurst; i++ {\n\t\tp.wg.Add(1)\n\t\tgo func() {\n\t\t\tdefer p.wg.Done()\n\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase msg, ok := <-p.msgChan:\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\tlogrus.Errorf(\"message channel is closed.\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\terr := p.Work(ctx, msg)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlogrus.Errorf(\"faild to process msg, err: %v\", err)\n\t\t\t\t\t}\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t//  err: context canceled\n\t\t\t\t\treturn\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}()\n\t}\n\n\tfor i = 0; i < p.opts.fetcherBurst; i++ {\n\t\tp.wg.Add(1)\n\t\tgo func() {\n\t\t\tdefer p.wg.Done()\n\n\t\t\tfor {\n\n\t\t\t\tconst backoff = time.Second\n\t\t\t\tmsg, err := p.taskq.FetchOne(ctx, p.opts.fetchTimeout)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogrus.Errorf(\"faild to fetch msg, err: %v\", err)\n\t\t\t\t\t//todo backoff\n\t\t\t\t\ttime.Sleep(backoff)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif msg == nil {\n\t\t\t\t\tlogrus.Debugf(\"no msg to fetch\")\n\t\t\t\t\ttime.Sleep(backoff)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tselect {\n\t\t\t\tcase p.msgChan <- msg:\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t//  err: context canceled\n\t\t\t\t\treturn\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}()\n\n\t}\n\n\treturn nil\n}\n\nfunc (p *Pool) FetchResult(ctx context.Context, key string) (*queue_.MessageResult, error) {\n\tresult, err := p.taskq.FetchResult(ctx, key)\n\tif err != nil {\n\t\tlogrus.WithError(err).Errorf(\"failed to fetch result of msg %v\", key)\n\t\treturn nil, err\n\t}\n\n\treturn result, nil\n}\n\nfunc (p *Pool) Work(ctx context.Context, msg *queue_.Message) error {\n\n\ttasker := Get(msg.Scheme)\n\tif tasker == nil {\n\t\treturn fmt.Errorf(\"not regiter task scheme %v\", msg.Scheme)\n\t}\n\n\tvar errs []error\n\tclean := func() {\n\t\terr := p.taskq.Delete(ctx, msg)\n\t\tif err != nil {\n\t\t\t// only log error\n\t\t\tlogrus.WithError(err).Errorf(\"failed to delete msg: %v\", msg)\n\t\t\treturn\n\t\t}\n\t\tlogrus.Infof(\"delete msg: %v\", msg)\n\t}\n\tdefer clean()\n\n\tresult := &queue_.MessageResult{\n\t\tId:      msg.Id,\n\t\tInnerId: msg.InnerId,\n\t\tName:    msg.Name,\n\t\tScheme:  msg.Scheme,\n\t\tStatus:  queue_.MessageStatus_Doing,\n\t}\n\terr := time_.CallWithTimeout(ctx, p.opts.workTimeout, func(ctx context.Context) error {\n\t\tresult_, err_ := tasker.TaskHandler(ctx, msg)\n\t\tif err_ != nil {\n\t\t\terrs = append(errs, err_)\n\t\t\tlogrus.WithError(err_).Errorf(\"failed to handle task %v, err: %v\", msg, err_)\n\t\t} else {\n\n\t\t\tif result_ != nil {\n\t\t\t\tresult = result_\n\t\t\t}\n\t\t}\n\t\treturn err_\n\t})\n\tresult.Err = err\n\n\tif err == time_.ErrTimeout || err == context.Canceled {\n\t\tresult.Status = queue_.MessageStatus_Fail\n\t} else {\n\t\t// success means the message is processed, but not means hander\n\t\t// function return nil, just not run timeout or canceled\n\t\tresult.Status = queue_.MessageStatus_Success\n\t}\n\n\t//callback result\n\tif p.opts.resultCallbackFunc != nil {\n\t\tp.opts.resultCallbackFunc(ctx, result)\n\t}\n\n\t//write to queue\n\t_, err = p.taskq.AddResult(ctx, result, p.opts.resultExpired)\n\tif err != nil {\n\t\terrs = append(errs, err)\n\t\t//only log error\n\t\tlogrus.WithError(err).Errorf(\"failed to add msg result: %v\", result)\n\t\treturn errors_.NewAggregate(errs)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/pool.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage taskqueue\n\nimport (\n\t\"time\"\n\n\tqueue_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue\"\n)\n\nfunc WithWorkerBurst(burst uint32) PoolOption {\n\treturn PoolOptionFunc(func(c *Pool) {\n\t\tc.opts.workerBurst = burst\n\t})\n}\n\nfunc WithFetcherBurst(burst uint32) PoolOption {\n\treturn PoolOptionFunc(func(c *Pool) {\n\t\tc.opts.fetcherBurst = burst\n\t})\n}\n\nfunc WithFetchTimeout(timeout time.Duration) PoolOption {\n\treturn PoolOptionFunc(func(c *Pool) {\n\t\tc.opts.fetchTimeout = timeout\n\t})\n}\n\nfunc WithResultExpired(resultExpired time.Duration) PoolOption {\n\treturn PoolOptionFunc(func(c *Pool) {\n\t\tc.opts.resultExpired = resultExpired\n\t})\n}\n\nfunc WithWorkTimeout(timeout time.Duration) PoolOption {\n\treturn PoolOptionFunc(func(c *Pool) {\n\t\tc.opts.workTimeout = timeout\n\t})\n}\n\nfunc WithResultCallbackFunc(callback queue_.ResultCallbackFunc) PoolOption {\n\treturn PoolOptionFunc(func(c *Pool) {\n\t\tc.opts.resultCallbackFunc = callback\n\t})\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/pool_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage taskqueue\n\n// A PoolOption sets options.\ntype PoolOption interface {\n\tapply(*Pool)\n}\n\n// EmptyPoolUrlOption does not alter the Pooluration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyPoolOption struct{}\n\nfunc (EmptyPoolOption) apply(*Pool) {}\n\n// PoolOptionFunc wraps a function that modifies Pool into an\n// implementation of the PoolOption interface.\ntype PoolOptionFunc func(*Pool)\n\nfunc (f PoolOptionFunc) apply(do *Pool) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _PoolOptionWithDefault() PoolOption {\n\treturn PoolOptionFunc(func(*Pool) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Pool) ApplyOptions(options ...PoolOption) *Pool {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/pool_test.go",
    "content": "package taskqueue_test\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/go-redis/redis/v8\"\n\tredis_ \"github.com/kaydxh/golang/pkg/database/redis\"\n\ttaskq_ \"github.com/kaydxh/golang/pkg/pool/taskqueue\"\n\tqueue_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue\"\n\tredisq_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue/redis\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"golang.org/x/net/context\"\n)\n\ntype TaskA struct {\n}\n\ntype TaskAArgs struct {\n\tParam1 string\n\tParam2 int\n}\n\ntype TaskAResult struct {\n\tResult1 string\n\tResult2 int\n}\n\nfunc (t TaskA) Scheme() string {\n\treturn \"taskA\"\n}\n\nfunc (t TaskA) TaskHandler(ctx context.Context, msg *queue_.Message) (*queue_.MessageResult, error) {\n\n\ttime.Sleep(30 * time.Second)\n\tvar args TaskAArgs\n\terr := json.Unmarshal([]byte(msg.Args), &args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t//fmt.Printf(\"get args: %v\\n\", args)\n\tfmt.Printf(\"process task id: %v, name: %v\\n\", msg.Id, msg.Name)\n\n\tresult := &queue_.MessageResult{\n\t\tId:      msg.Id,\n\t\tInnerId: msg.InnerId,\n\t\tName:    msg.Name,\n\t\tScheme:  msg.Scheme,\n\t}\n\n\ttaskResult := &TaskAResult{\n\t\tResult1: \"Result1\",\n\t\tResult2: 2,\n\t}\n\n\tdata, err := json.Marshal(taskResult)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresult.Result = string(data)\n\treturn result, nil\n}\n\nvar (\n\tonce sync.Once\n\tdb   *redis.Client\n\terr  error\n)\n\nfunc GetDBOrDie() *redis.Client {\n\tonce.Do(func() {\n\t\tcfgFile := \"./taskq.yaml\"\n\t\tconfig := redis_.NewConfig(redis_.WithViper(viper_.GetViper(cfgFile, \"database.redis\")))\n\n\t\tdb, err = config.Complete().New(context.Background())\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif db == nil {\n\t\t\tpanic(\"db is not enable\")\n\t\t}\n\t})\n\n\treturn db\n}\n\nfunc TestTaskQueue(t *testing.T) {\n\n\ttaskq_.Register(TaskA{})\n\n\tdb := GetDBOrDie()\n\n\tredisq := redisq_.NewQueue(db, queue_.QueueOptions{\n\t\tName: \"redis\",\n\t})\n\n\tpool := taskq_.NewPool(redisq, taskq_.WithFetcherBurst(1), taskq_.WithWorkTimeout(-1), taskq_.WithResultCallbackFunc(func(ctx context.Context, result *queue_.MessageResult) {\n\t\tt.Logf(\"--> callback fetch result %v of msg\", result)\n\t}))\n\tctx := context.Background()\n\terr = pool.Consume(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to consume task, err: %v\", err)\n\t\treturn\n\t}\n\n\targs := TaskAArgs{\n\t\tParam1: \"param1\",\n\t\tParam2: 10,\n\t}\n\n\tdata, err := json.Marshal(args)\n\tif err != nil {\n\t\tt.Errorf(\"failed to marshal args, err: %v\", err)\n\t\treturn\n\t}\n\n\tvar (\n\t\tids []string\n\t\twg  sync.WaitGroup\n\t)\n\tfor i := 0; i < 10; i++ {\n\t\tmsg := &queue_.Message{\n\t\t\tScheme: \"taskA\",\n\t\t\tArgs:   string(data),\n\t\t}\n\t\twg.Add(1)\n\t\tgo func(i int, m *queue_.Message) {\n\t\t\tdefer wg.Done()\n\t\t\tm.Name = fmt.Sprintf(\"taskA-%v\", i)\n\t\t\tid, err := pool.Publish(ctx, m)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"failed to pulibsh task, err: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt.Logf(\"pulibsh task, innerId: %v, msg: %v\", id, m)\n\t\t\tids = append(ids, id)\n\t\t}(i, msg)\n\t}\n\n\twg.Wait()\n\n\t//\ttime.Sleep(5 * time.Second)\n\n\t/*\n\t\tfor _, id := range ids {\n\t\t\tresult, err := pool.FetchResult(ctx, id)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"%v\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt.Logf(\"fetch result %v of msg %v\", result, id)\n\t\t}\n\t*/\n\tselect {}\n\n}\n\nfunc TestTaskQueueServer(t *testing.T) {\n\n\tGetDBOrDie()\n\ttaskq_.Register(TaskA{})\n\tcfgFile := \"./taskq.yaml\"\n\tconfig := taskq_.NewConfig(taskq_.WithViper(viper_.GetViper(cfgFile, \"taskqueue\")))\n\n\tctx := context.Background()\n\tpool, err := config.Complete().New(ctx,\n\t\ttaskq_.WithResultCallbackFunc(func(ctx context.Context, result *queue_.MessageResult) {\n\t\t\tt.Logf(\"--> callback fetch result %v of msg\", result)\n\t\t}))\n\tif err != nil {\n\t\tt.Errorf(\"failed to install taskqueue, err: %v\", err)\n\t\treturn\n\t}\n\tif pool == nil {\n\t\treturn\n\t}\n\n\targs := TaskAArgs{\n\t\tParam1: \"param1\",\n\t\tParam2: 10,\n\t}\n\n\tdata, err := json.Marshal(args)\n\tif err != nil {\n\t\tt.Errorf(\"failed to marshal args, err: %v\", err)\n\t\treturn\n\t}\n\n\tvar (\n\t\tids []string\n\t\twg  sync.WaitGroup\n\t)\n\tfor i := 0; i < 10; i++ {\n\t\tmsg := &queue_.Message{\n\t\t\tScheme: \"taskA\",\n\t\t\tArgs:   string(data),\n\t\t}\n\t\twg.Add(1)\n\t\tgo func(i int, m *queue_.Message) {\n\t\t\tdefer wg.Done()\n\t\t\tm.Name = fmt.Sprintf(\"taskA-%v\", i)\n\t\t\tid, err := pool.Publish(ctx, m)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"failed to pulibsh task, err: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt.Logf(\"pulibsh task, innerId: %v, msg: %v\", id, m)\n\t\t\tids = append(ids, id)\n\t\t}(i, msg)\n\t}\n\n\twg.Wait()\n\n\tselect {}\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/queue/message.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage queue\n\ntype Message struct {\n\t// 业务标识\n\tId string\n\n\t//内部标识,内部自动生成\n\tInnerId string\n\tName    string\n\n\t// the same Scheme for the same task handler\n\tScheme string\n\n\t// Args is json format, for run task\n\tArgs string\n}\n\ntype MessageStatus = string\n\nconst (\n\tMessageStatus_Unknown MessageStatus = \"Status_Unknown\"\n\tMessageStatus_Pending MessageStatus = \"Status_Pending\"\n\tMessageStatus_Success MessageStatus = \"Status_Success\"\n\tMessageStatus_Doing   MessageStatus = \"Status_Doing\"\n\tMessageStatus_Fail    MessageStatus = \"Status_Fail\"\n)\n\ntype MessageResult struct {\n\t// 业务标识\n\tId string\n\n\t//内部标识,内部自动生成\n\tInnerId string\n\tName    string\n\n\t// the same Scheme for the same task handler\n\tScheme string\n\n\t// Args is json format, for run task\n\tResult string\n\n\tStatus MessageStatus\n\n\tErr error\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/queue/queue.go",
    "content": "package queue\n\nimport (\n\t\"context\"\n\t\"time\"\n)\n\nconst (\n\tTaskQueuePrefix = \"taskq\"\n)\n\ntype QueueOptions struct {\n\tName string\n}\n\ntype Queue interface {\n\tAdd(ctx context.Context, msg *Message) (string, error)\n\tFetchOne(ctx context.Context, waitTimeout time.Duration) (*Message, error)\n\tDelete(ctx context.Context, msg *Message) error\n\n\tAddResult(ctx context.Context, result *MessageResult, expired time.Duration) (string, error)\n\tFetchResult(ctx context.Context, key string) (*MessageResult, error)\n}\n\ntype ResultCallbackFunc func(ctx context.Context, result *MessageResult)\n"
  },
  {
    "path": "pkg/pool/taskqueue/queue/redis/queue.redis.go",
    "content": "package redisq\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/go-redis/redis/v8\"\n\t\"github.com/google/uuid\"\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\tqueue_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype Queue struct {\n\topts queue_.QueueOptions\n\n\tstream       string\n\tstreamGroup  string\n\tconsumerName string\n\tdb           *redis.Client\n}\n\nfunc NewQueue(db *redis.Client, opts queue_.QueueOptions) *Queue {\n\tq := &Queue{\n\t\tdb:           db,\n\t\tstream:       fmt.Sprintf(\"taskq-%s-stream\", opts.Name),\n\t\tstreamGroup:  \"taskq\",\n\t\tconsumerName: os_.GetProcId(),\n\t}\n\n\treturn q\n}\n\n// https://redis.io/commands/xadd/\n// * 为自动生成Id\n// XADD taskq-redis-stream  *  taskq \"123\"\nfunc (q *Queue) Add(ctx context.Context, msg *queue_.Message) (string, error) {\n\tif msg.Name == \"\" {\n\t\treturn \"\", fmt.Errorf(\"messgae name is empty\")\n\t}\n\tif msg.Id == \"\" {\n\t\tmsg.Id = uuid.NewString()\n\t}\n\n\t//todo check message name if exists\n\tdata, err := json.Marshal(msg)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// xadd msg to redis\n\tcmd := q.db.XAdd(ctx, &redis.XAddArgs{\n\t\tStream: q.stream,\n\t\tValues: map[string]interface{}{\n\t\t\t\"message\": string(data),\n\t\t},\n\t})\n\terr = cmd.Err()\n\tif err != nil {\n\t\tlogrus.WithError(err).Errorf(\"failed to xadd msg [name: %v, id: %v]\", msg.Name, msg.Id)\n\t\treturn \"\", err\n\t}\n\tmsg.InnerId = cmd.Val()\n\treturn cmd.Val(), nil\n}\n\n// get all\n// XRANGE taskq-redis-stream  - +\n\nfunc (q *Queue) fetchN(ctx context.Context, n int64, waitTimeout time.Duration) ([]*queue_.Message, error) {\n\tstreams, err := q.db.XReadGroup(ctx, &redis.XReadGroupArgs{\n\t\tStreams:  []string{q.stream, \">\"},\n\t\tGroup:    q.streamGroup,\n\t\tConsumer: q.consumerName,\n\t\tCount:    n,\n\t\tBlock:    waitTimeout,\n\t}).Result()\n\tif err != nil {\n\t\tif err == redis.Nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\n\tstream := &streams[0]\n\tmsgs := make([]*queue_.Message, len(stream.Messages))\n\tfor i := range stream.Messages {\n\t\txmsg := &stream.Messages[i]\n\t\tmsgs[i] = &queue_.Message{}\n\t\tmsg := msgs[i]\n\t\t//\tmsg.Ctx = ctx\n\t\tdata, ok := xmsg.Values[\"message\"].(string)\n\t\tif !ok {\n\t\t\tlogrus.Errorf(\"message type is not string\")\n\t\t\tcontinue\n\t\t}\n\t\terr = json.Unmarshal([]byte(data), msg)\n\t\tif err != nil {\n\t\t\t//msg.Err = err\n\t\t\tlogrus.WithError(err).Errorf(\"failed to unmarshal msg %v\", string(data))\n\t\t\treturn nil, err\n\t\t}\n\t\tmsg.InnerId = xmsg.ID\n\t}\n\n\treturn msgs, nil\n}\n\nfunc (q *Queue) FetchN(ctx context.Context, n int64, waitTimeout time.Duration) ([]*queue_.Message, error) {\n\tmsgs, err := q.fetchN(ctx, n, waitTimeout)\n\tif err != nil {\n\t\tif strings.HasPrefix(err.Error(), \"NOGROUP\") {\n\t\t\tq.createMkStreamGroup(ctx)\n\t\t\treturn q.fetchN(ctx, n, waitTimeout)\n\t\t}\n\t}\n\treturn msgs, err\n}\n\nfunc (q *Queue) FetchOne(ctx context.Context, waitTimeout time.Duration) (*queue_.Message, error) {\n\tmsgs, err := q.FetchN(ctx, 1, waitTimeout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(msgs) == 0 {\n\t\t//return nil, fmt.Errorf(\"fetch %v number messages\", len(msgs))\n\t\treturn nil, nil\n\t}\n\treturn msgs[0], nil\n}\n\nfunc (q *Queue) createMkStreamGroup(ctx context.Context) {\n\tlogrus.Infof(\"createMkStreamGroup stream: %v, streamGroup: %v\", q.stream, q.streamGroup)\n\t_ = q.db.XGroupCreateMkStream(ctx, q.stream, q.streamGroup, \"0\").Err()\n}\n\n// XLEN taskq-redis-stream\nfunc (q *Queue) Len() (int64, error) {\n\treturn q.db.XLen(context.Background(), q.stream).Result()\n}\n\n// XACK taskq-redis-stream taskq 1671960330664-0\n// XDEL taskq-redis-stream 1671960330664-0\nfunc (q *Queue) Delete(ctx context.Context, msg *queue_.Message) error {\n\terr := q.db.XAck(ctx, q.stream, q.streamGroup, msg.InnerId).Err()\n\tif err != nil {\n\t\tlogrus.WithError(err).Errorf(\"failed to XAck msg %v, stream[%v], stremaGroup[%v], id[%v], innerId[%v]\", msg, q.stream, q.streamGroup, msg.Id, msg.InnerId)\n\t\treturn err\n\t}\n\treturn q.db.XDel(ctx, q.stream, msg.InnerId).Err()\n}\n\nfunc (q *Queue) AddResult(ctx context.Context, result *queue_.MessageResult, expired time.Duration) (string, error) {\n\n\tif result.InnerId == \"\" {\n\t\treturn \"\", fmt.Errorf(\"innerId is empty\")\n\t}\n\n\tdata, err := json.Marshal(result)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t_, err = q.db.Set(ctx, result.InnerId, string(data), expired).Result()\n\tif err != nil {\n\t\tlogrus.WithError(err).Errorf(\"failed to set msg result[name: %v, id: %v]\", result.Name, result.Id)\n\t\treturn \"\", err\n\t}\n\n\treturn result.InnerId, nil\n}\n\nfunc (q *Queue) FetchResult(ctx context.Context, key string) (*queue_.MessageResult, error) {\n\n\tif key == \"\" {\n\t\treturn nil, fmt.Errorf(\"key is empty\")\n\t}\n\n\tval, err := q.db.Get(ctx, key).Result()\n\tif err != nil {\n\t\t// redis has't the key\n\t\tif err == redis.Nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\tlogrus.WithError(err).Errorf(\"failed to get msg result of %v\", key)\n\t\treturn nil, err\n\t}\n\n\tresult := &queue_.MessageResult{}\n\terr = json.Unmarshal([]byte(val), result)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result, nil\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/redis.yaml",
    "content": "database:\n  redis:\n    enabled: true\n    addresses: \n      - \"localhost:6380\"\n    password: \"\"\n    db: 0 \n    max_connections: 100\n    max_idle_connections: 10\n    dial_timeout: 5s\n    max_wait_duration: 20s\n    fail_after_duration: 30s\n"
  },
  {
    "path": "pkg/pool/taskqueue/registry.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage taskqueue\n\nimport \"sync\"\n\nvar (\n\ttaskMu sync.RWMutex\n\tm      TaskerMap\n)\n\n// Register registers the tasker to the tasker map. b.Name will be\n// used as the name registered with this builder.\n//\nfunc Register(b Tasker) {\n\ttaskMu.Lock()\n\tdefer taskMu.Unlock()\n\n\tif b == nil {\n\t\tpanic(\"register tasker is nil\")\n\t}\n\n\ttasker := Get(b.Scheme())\n\tif tasker != nil {\n\t\tpanic(\"double register tasker \" + b.Scheme())\n\t}\n\tm.Store(b.Scheme(), b)\n}\n\n// Get returns the tasker registered with the given scheme.\n//\n// If no tasker is register with the scheme, nil will be returned.\nfunc Get(scheme string) Tasker {\n\ttaskMu.Lock()\n\tdefer taskMu.Unlock()\n\n\tb, has := m.Load(scheme)\n\tif !has {\n\t\treturn nil\n\t}\n\n\treturn b\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/task.go",
    "content": "package taskqueue\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\tqueue_ \"github.com/kaydxh/golang/pkg/pool/taskqueue/queue\"\n)\n\ntype TaskOptions struct {\n\tName string\n}\n\ntype Task struct {\n\topts TaskOptions\n}\n\ntype TaskerMap sync.Map\n\ntype Tasker interface {\n\tTaskHandler(ctx context.Context, message *queue_.Message) (*queue_.MessageResult, error)\n\tScheme() string\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/tasker_syncmap.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage taskqueue\n\nimport (\n\t\"sync\" // Used by sync.Map.\n)\n\n// Generate code that will fail if the constants change value.\nfunc _() {\n\t// An \"cannot convert TaskerMap literal (type TaskerMap) to type sync.Map\" compiler error signifies that the base type have changed.\n\t// Re-run the go-syncmap command to generate them again.\n\t_ = (sync.Map)(TaskerMap{})\n}\n\nvar _nil_TaskerMap_Tasker_value = func() (val Tasker) { return }()\n\n// Load returns the value stored in the map for a key, or nil if no\n// value is present.\n// The ok result indicates whether value was found in the map.\nfunc (m *TaskerMap) Load(key string) (Tasker, bool) {\n\tvalue, ok := (*sync.Map)(m).Load(key)\n\tif value == nil {\n\t\treturn _nil_TaskerMap_Tasker_value, ok\n\t}\n\treturn value.(Tasker), ok\n}\n\n// Store sets the value for a key.\nfunc (m *TaskerMap) Store(key string, value Tasker) {\n\t(*sync.Map)(m).Store(key, value)\n}\n\n// LoadOrStore returns the existing value for the key if present.\n// Otherwise, it stores and returns the given value.\n// The loaded result is true if the value was loaded, false if stored.\nfunc (m *TaskerMap) LoadOrStore(key string, value Tasker) (Tasker, bool) {\n\tactual, loaded := (*sync.Map)(m).LoadOrStore(key, value)\n\tif actual == nil {\n\t\treturn _nil_TaskerMap_Tasker_value, loaded\n\t}\n\treturn actual.(Tasker), loaded\n}\n\n// LoadAndDelete deletes the value for a key, returning the previous value if any.\n// The loaded result reports whether the key was present.\nfunc (m *TaskerMap) LoadAndDelete(key string) (value Tasker, loaded bool) {\n\tactual, loaded := (*sync.Map)(m).LoadAndDelete(key)\n\tif actual == nil {\n\t\treturn _nil_TaskerMap_Tasker_value, loaded\n\t}\n\treturn actual.(Tasker), loaded\n}\n\n// Delete deletes the value for a key.\nfunc (m *TaskerMap) Delete(key string) {\n\t(*sync.Map)(m).Delete(key)\n}\n\n// Range calls f sequentially for each key and value present in the map.\n// If f returns false, range stops the iteration.\n//\n// Range does not necessarily correspond to any consistent snapshot of the Map's\n// contents: no key will be visited more than once, but if the value for any key\n// is stored or deleted concurrently, Range may reflect any mapping for that key\n// from any point during the Range call.\n//\n// Range may be O(N) with the number of elements in the map even if f returns\n// false after a constant number of calls.\nfunc (m *TaskerMap) Range(f func(key string, value Tasker) bool) {\n\t(*sync.Map)(m).Range(func(key, value interface{}) bool {\n\t\treturn f(key.(string), value.(Tasker))\n\t})\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/taskq.yaml",
    "content": "database:\n  redis:\n    enabled: true\n    addresses: \n      - \"localhost:6380\"\n    password: \"\"\n    db: 0 \n    max_connections: 100\n    max_idle_connections: 10\n    dial_timeout: 5s\n    max_wait_duration: 20s\n    fail_after_duration: 300s\n\ntaskqueue:\n    enabled: true\n    worker_burst: 8\n    fetcher_burst: 8\n    work_timeout: 0s\n    fetch_timeout: 10s\n    result_expired: 0s\n    queue_type: queue_type_redis\n\n"
  },
  {
    "path": "pkg/pool/taskqueue/taskqueue.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: pkg/pool/taskqueue/taskqueue.proto\n\npackage taskqueue\n\nimport (\n\tduration \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype TaskQueue_QueueType int32\n\nconst (\n\tTaskQueue_queue_type_redis TaskQueue_QueueType = 0\n)\n\n// Enum value maps for TaskQueue_QueueType.\nvar (\n\tTaskQueue_QueueType_name = map[int32]string{\n\t\t0: \"queue_type_redis\",\n\t}\n\tTaskQueue_QueueType_value = map[string]int32{\n\t\t\"queue_type_redis\": 0,\n\t}\n)\n\nfunc (x TaskQueue_QueueType) Enum() *TaskQueue_QueueType {\n\tp := new(TaskQueue_QueueType)\n\t*p = x\n\treturn p\n}\n\nfunc (x TaskQueue_QueueType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (TaskQueue_QueueType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_pool_taskqueue_taskqueue_proto_enumTypes[0].Descriptor()\n}\n\nfunc (TaskQueue_QueueType) Type() protoreflect.EnumType {\n\treturn &file_pkg_pool_taskqueue_taskqueue_proto_enumTypes[0]\n}\n\nfunc (x TaskQueue_QueueType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use TaskQueue_QueueType.Descriptor instead.\nfunc (TaskQueue_QueueType) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_pool_taskqueue_taskqueue_proto_rawDescGZIP(), []int{0, 0}\n}\n\ntype TaskQueue struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled       bool                `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tWorkerBurst   uint32              `protobuf:\"varint,2,opt,name=worker_burst,json=workerBurst,proto3\" json:\"worker_burst,omitempty\"`\n\tFetcherBurst  uint32              `protobuf:\"varint,3,opt,name=fetcher_burst,json=fetcherBurst,proto3\" json:\"fetcher_burst,omitempty\"`\n\tWorkTimeout   *duration.Duration  `protobuf:\"bytes,4,opt,name=work_timeout,json=workTimeout,proto3\" json:\"work_timeout,omitempty\"`\n\tFetchTimeout  *duration.Duration  `protobuf:\"bytes,5,opt,name=fetch_timeout,json=fetchTimeout,proto3\" json:\"fetch_timeout,omitempty\"`\n\tResultExpired *duration.Duration  `protobuf:\"bytes,6,opt,name=result_expired,json=resultExpired,proto3\" json:\"result_expired,omitempty\"`\n\tQueueType     TaskQueue_QueueType `protobuf:\"varint,7,opt,name=queue_type,json=queueType,proto3,enum=go.pkg.pool.taskqueue.TaskQueue_QueueType\" json:\"queue_type,omitempty\"`\n}\n\nfunc (x *TaskQueue) Reset() {\n\t*x = TaskQueue{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_pool_taskqueue_taskqueue_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *TaskQueue) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TaskQueue) ProtoMessage() {}\n\nfunc (x *TaskQueue) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_pool_taskqueue_taskqueue_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use TaskQueue.ProtoReflect.Descriptor instead.\nfunc (*TaskQueue) Descriptor() ([]byte, []int) {\n\treturn file_pkg_pool_taskqueue_taskqueue_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *TaskQueue) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *TaskQueue) GetWorkerBurst() uint32 {\n\tif x != nil {\n\t\treturn x.WorkerBurst\n\t}\n\treturn 0\n}\n\nfunc (x *TaskQueue) GetFetcherBurst() uint32 {\n\tif x != nil {\n\t\treturn x.FetcherBurst\n\t}\n\treturn 0\n}\n\nfunc (x *TaskQueue) GetWorkTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.WorkTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *TaskQueue) GetFetchTimeout() *duration.Duration {\n\tif x != nil {\n\t\treturn x.FetchTimeout\n\t}\n\treturn nil\n}\n\nfunc (x *TaskQueue) GetResultExpired() *duration.Duration {\n\tif x != nil {\n\t\treturn x.ResultExpired\n\t}\n\treturn nil\n}\n\nfunc (x *TaskQueue) GetQueueType() TaskQueue_QueueType {\n\tif x != nil {\n\t\treturn x.QueueType\n\t}\n\treturn TaskQueue_queue_type_redis\n}\n\nvar File_pkg_pool_taskqueue_taskqueue_proto protoreflect.FileDescriptor\n\nvar file_pkg_pool_taskqueue_taskqueue_proto_rawDesc = []byte{\n\t0x0a, 0x22, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x71,\n\t0x75, 0x65, 0x75, 0x65, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x71, 0x75, 0x65, 0x75, 0x65, 0x2e, 0x70,\n\t0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x6f, 0x6f,\n\t0x6c, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x71, 0x75, 0x65, 0x75, 0x65, 0x1a, 0x1e, 0x67, 0x6f, 0x6f,\n\t0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72,\n\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9b, 0x03, 0x0a, 0x09,\n\t0x54, 0x61, 0x73, 0x6b, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61,\n\t0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62,\n\t0x6c, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x62, 0x75,\n\t0x72, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x65,\n\t0x72, 0x42, 0x75, 0x72, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65,\n\t0x72, 0x5f, 0x62, 0x75, 0x72, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x66,\n\t0x65, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x75, 0x72, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x77,\n\t0x6f, 0x72, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,\n\t0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x77, 0x6f,\n\t0x72, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x66, 0x65, 0x74,\n\t0x63, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,\n\t0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x66, 0x65, 0x74,\n\t0x63, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x40, 0x0a, 0x0e, 0x72, 0x65, 0x73,\n\t0x75, 0x6c, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28,\n\t0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x72, 0x65,\n\t0x73, 0x75, 0x6c, 0x74, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x49, 0x0a, 0x0a, 0x71,\n\t0x75, 0x65, 0x75, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32,\n\t0x2a, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x74, 0x61,\n\t0x73, 0x6b, 0x71, 0x75, 0x65, 0x75, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x51, 0x75, 0x65, 0x75,\n\t0x65, 0x2e, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x71, 0x75, 0x65,\n\t0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x21, 0x0a, 0x09, 0x51, 0x75, 0x65, 0x75, 0x65, 0x54,\n\t0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x71, 0x75, 0x65, 0x75, 0x65, 0x5f, 0x74, 0x79, 0x70,\n\t0x65, 0x5f, 0x72, 0x65, 0x64, 0x69, 0x73, 0x10, 0x00, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74,\n\t0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f, 0x67,\n\t0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x74,\n\t0x61, 0x73, 0x6b, 0x71, 0x75, 0x65, 0x75, 0x65, 0x3b, 0x74, 0x61, 0x73, 0x6b, 0x71, 0x75, 0x65,\n\t0x75, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_pool_taskqueue_taskqueue_proto_rawDescOnce sync.Once\n\tfile_pkg_pool_taskqueue_taskqueue_proto_rawDescData = file_pkg_pool_taskqueue_taskqueue_proto_rawDesc\n)\n\nfunc file_pkg_pool_taskqueue_taskqueue_proto_rawDescGZIP() []byte {\n\tfile_pkg_pool_taskqueue_taskqueue_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_pool_taskqueue_taskqueue_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_pool_taskqueue_taskqueue_proto_rawDescData)\n\t})\n\treturn file_pkg_pool_taskqueue_taskqueue_proto_rawDescData\n}\n\nvar file_pkg_pool_taskqueue_taskqueue_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_pkg_pool_taskqueue_taskqueue_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_pkg_pool_taskqueue_taskqueue_proto_goTypes = []interface{}{\n\t(TaskQueue_QueueType)(0),  // 0: go.pkg.pool.taskqueue.TaskQueue.QueueType\n\t(*TaskQueue)(nil),         // 1: go.pkg.pool.taskqueue.TaskQueue\n\t(*duration.Duration)(nil), // 2: google.protobuf.Duration\n}\nvar file_pkg_pool_taskqueue_taskqueue_proto_depIdxs = []int32{\n\t2, // 0: go.pkg.pool.taskqueue.TaskQueue.work_timeout:type_name -> google.protobuf.Duration\n\t2, // 1: go.pkg.pool.taskqueue.TaskQueue.fetch_timeout:type_name -> google.protobuf.Duration\n\t2, // 2: go.pkg.pool.taskqueue.TaskQueue.result_expired:type_name -> google.protobuf.Duration\n\t0, // 3: go.pkg.pool.taskqueue.TaskQueue.queue_type:type_name -> go.pkg.pool.taskqueue.TaskQueue.QueueType\n\t4, // [4:4] is the sub-list for method output_type\n\t4, // [4:4] is the sub-list for method input_type\n\t4, // [4:4] is the sub-list for extension type_name\n\t4, // [4:4] is the sub-list for extension extendee\n\t0, // [0:4] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_pool_taskqueue_taskqueue_proto_init() }\nfunc file_pkg_pool_taskqueue_taskqueue_proto_init() {\n\tif File_pkg_pool_taskqueue_taskqueue_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_pool_taskqueue_taskqueue_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*TaskQueue); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_pool_taskqueue_taskqueue_proto_rawDesc,\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_pool_taskqueue_taskqueue_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_pool_taskqueue_taskqueue_proto_depIdxs,\n\t\tEnumInfos:         file_pkg_pool_taskqueue_taskqueue_proto_enumTypes,\n\t\tMessageInfos:      file_pkg_pool_taskqueue_taskqueue_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_pool_taskqueue_taskqueue_proto = out.File\n\tfile_pkg_pool_taskqueue_taskqueue_proto_rawDesc = nil\n\tfile_pkg_pool_taskqueue_taskqueue_proto_goTypes = nil\n\tfile_pkg_pool_taskqueue_taskqueue_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/pool/taskqueue/taskqueue.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.pool.taskqueue;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/golang/pkg/pool/taskqueue;taskqueue\";\n\nmessage TaskQueue {\n  bool enabled = 1;\n\n  uint32 worker_burst = 2;\n  uint32 fetcher_burst = 3;\n\n  google.protobuf.Duration work_timeout = 4;\n  google.protobuf.Duration fetch_timeout = 5;\n\n  google.protobuf.Duration result_expired = 6;\n\n  QueueType queue_type = 7;\n  enum QueueType { queue_type_redis = 0; }\n}\n"
  },
  {
    "path": "pkg/profile/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/profile\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nrequire (\n\tgithub.com/kaydxh/golang/go v0.0.0-00010101000000-000000000000\n\tgithub.com/pkg/profile v1.7.0\n)\n\nrequire (\n\tgithub.com/felixge/fgprof v0.9.3 // indirect\n\tgithub.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/sirupsen/logrus v1.9.3 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n\tgoogle.golang.org/protobuf v1.36.10 // indirect\n)\n"
  },
  {
    "path": "pkg/profile/go.sum",
    "content": "github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=\ngithub.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=\ngithub.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=\ngithub.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=\ngithub.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA=\ngithub.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\n"
  },
  {
    "path": "pkg/profile/profile.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage profile\n\nimport (\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\t\"github.com/pkg/profile\"\n)\n\n//no profile\ntype nop struct {\n}\n\nfunc (p *nop) Stop() {\n}\n\nfunc StartWithEnv() interface {\n\tStop()\n} {\n\n\tprofileEnv := os_.GetEnvAsStringOrFallback(\"PROFILING\", \"\")\n\tprofilePath := os_.GetEnvAsStringOrFallback(\"PROFILEPATH\", \"\")\n\tif profilePath != \"\" {\n\t\tprofilePath = filepath.Join(profilePath, \"profile\"+time.Now().Format(time_.TimeMillFormat))\n\t}\n\n\treturn start(profileEnv, profilePath)\n\t//\tprofiles := strings.Split(profileEnv, \",\")\n\t/*\n\t\tfor _, pf := range profiles {\n\t\t\tstart(pf)\n\t\t}\n\t*/\n}\n\nfunc start(pf, dir string) interface {\n\tStop()\n} {\n\tswitch strings.ToLower(pf) {\n\tcase \"cpu\":\n\t\treturn profile.Start(profile.CPUProfile, profile.NoShutdownHook, profile.ProfilePath(dir))\n\tcase \"mem\":\n\t\treturn profile.Start(profile.MemProfile, profile.NoShutdownHook, profile.ProfilePath(dir))\n\tcase \"mutex\":\n\t\treturn profile.Start(profile.MutexProfile, profile.NoShutdownHook, profile.ProfilePath(dir))\n\tcase \"block\":\n\t\treturn profile.Start(profile.BlockProfile, profile.NoShutdownHook, profile.ProfilePath(dir))\n\tcase \"trace\":\n\t\treturn profile.Start(profile.TraceProfile, profile.NoShutdownHook, profile.ProfilePath(dir))\n\tcase \"thread_create\":\n\t\treturn profile.Start(profile.ThreadcreationProfile, profile.NoShutdownHook, profile.ProfilePath(dir))\n\tcase \"goroutine\":\n\t\treturn profile.Start(profile.GoroutineProfile, profile.NoShutdownHook, profile.ProfilePath(dir))\n\tdefault:\n\t\t//do nothing\n\t\treturn new(nop)\n\t}\n}\n"
  },
  {
    "path": "pkg/profile/profile_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage profile_test\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n\n\tprofile_ \"github.com/kaydxh/golang/pkg/profile\"\n)\n\nfunc doCpu() {\n\tvar (\n\t\ta uint64 = 2\n\t\ti uint64\n\t)\n\tfor i = 0; i < 10000000000; i++ {\n\t\ta += 2\n\t}\n\tfmt.Printf(\"a: %d\\n\", a)\n}\n\nfunc TestStartWithEnv(t *testing.T) {\n\tos.Setenv(\"PROFILING\", \"cpu\")\n\tdefer profile_.StartWithEnv().Stop()\n\n\tdoCpu()\n}\n"
  },
  {
    "path": "pkg/protobuf/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/protobuf\n\ngo 1.24.0\n\nrequire (\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n\nreplace github.com/kaydxh/golang/go => ../../go\n"
  },
  {
    "path": "pkg/protobuf/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "pkg/protobuf/jsonpb/jsonpb_marshal.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage jsonpb\n\nimport (\n\tstructpb \"github.com/golang/protobuf/ptypes/struct\"\n\tmarshaler_ \"github.com/kaydxh/golang/go/runtime/marshaler\"\n)\n\nfunc MarshaToStructpb(v interface{}) (*structpb.Struct, error) {\n\n\tjsonpb := marshaler_.NewDefaultJSONPb()\n\treturn jsonpb.MarshaToStructpb(v)\n}\n"
  },
  {
    "path": "pkg/protobuf/jsonpb/jsonpb_unmarshal.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage jsonpb\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\n\tmarshaler_ \"github.com/kaydxh/golang/go/runtime/marshaler\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\nfunc UnmarshalReaderWithAllowUnknownFields(r io.Reader, pb proto.Message) error {\n\tbuf := new(bytes.Buffer)\n\t_, err := buf.ReadFrom(r)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn UnmarshalWithAllowUnknownFields(buf.Bytes(), pb)\n}\n\nfunc UnmarshalWithAllowUnknownFields(data []byte, pb proto.Message) error {\n\tjsonpb := marshaler_.NewDefaultJSONPb()\n\treturn jsonpb.Unmarshal(data, pb)\n}\n"
  },
  {
    "path": "pkg/protobuf/prototext/encode.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage prototext\n\nimport (\n\t\"google.golang.org/protobuf/encoding/prototext\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// Format formats the message as a multiline string and only return\n// first n characters.\n// This function is only intended for human consumption and ignores errors.\n// Do not depend on the output being stable. It may change over time across\n// different versions of the program.\nfunc FormatWithLength(m proto.Message, n int) string {\n\ts := prototext.Format(m)\n\tif n >= len(s) || n == 0 {\n\t\treturn s\n\t}\n\treturn s[0:n]\n}\n\nfunc Marshal(m proto.Message) ([]byte, error) {\n\treturn prototext.MarshalOptions{\n\t\tAllowPartial: true,\n\t\tEmitUnknown:  true,\n\t}.Marshal(m)\n}\n"
  },
  {
    "path": "pkg/proxy/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/proxy\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/logs => ../logs\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/gin-gonic/gin v1.11.0\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/logs v0.0.0-00010101000000-000000000000\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-contrib/sse v1.1.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/golang/protobuf v1.5.4 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/mattn/go-isatty v0.0.20 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/quic-go/qpack v0.5.1 // indirect\n\tgithub.com/quic-go/quic-go v0.54.0 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sirupsen/logrus v1.9.3 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/spf13/viper v1.21.0 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.uber.org/atomic v1.11.0 // indirect\n\tgo.uber.org/mock v0.5.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/mod v0.30.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sync v0.19.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgolang.org/x/tools v0.39.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n\tgoogle.golang.org/protobuf v1.36.10 // indirect\n)\n"
  },
  {
    "path": "pkg/proxy/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=\ngithub.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 h1:Q0arlJiD7BygvPMDHcvTdg1urHqADnd7P2qk3r2HlyE=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228/go.mod h1:ML4gUddcaOo55zQ9/m8SxjZYYVTJACriuUFcqs1BEd4=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 h1:7zmih7dDhXTVDxbWy4Cp0OrSqMdQaQzlRUtCzZXMVgc=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228/go.mod h1:DeGVCOtdDQNg6/hVvPwYqeH0EbGcbFiQcKNvMrD+NyY=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=\ngithub.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=\ngithub.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=\ngithub.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg=\ngithub.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=\ngo.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngolang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\n"
  },
  {
    "path": "pkg/proxy/proxy.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage proxy\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\n\t\"github.com/gin-gonic/gin\"\n\t\"github.com/gin-gonic/gin/render\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tlogs_ \"github.com/kaydxh/golang/pkg/logs\"\n)\n\ntype ProxyMode int32\n\nconst (\n\tReverse_ProxyMode  ProxyMode = 0\n\tForward_ProxyMode  ProxyMode = 1\n\tRedirect_ProxyMode ProxyMode = 2\n)\n\ntype ProxyMatchedFunc func(c *gin.Context) bool\ntype ProxyTargetResolverFunc func(c *gin.Context) (host string, err error)\n\ntype proxyOptions struct {\n\tproxyMatchedFunc        ProxyMatchedFunc\n\tproxyTargetResolverFunc ProxyTargetResolverFunc\n\tproxyMode               ProxyMode\n}\n\ntype Proxy struct {\n\trouter gin.IRouter\n\topts   proxyOptions\n}\n\nfunc defaultProxyOptions() proxyOptions {\n\treturn proxyOptions{\n\t\tproxyMode: Reverse_ProxyMode,\n\t}\n}\n\nfunc NewProxy(router gin.IRouter, options ...ProxyOption) (*Proxy, error) {\n\tp := &Proxy{\n\t\trouter: router,\n\t}\n\tp.opts = defaultProxyOptions()\n\tp.ApplyOptions(options...)\n\n\tp.setProxy()\n\treturn p, nil\n}\n\nfunc (p *Proxy) ProxyHandler() gin.HandlerFunc {\n\n\treturn func(c *gin.Context) {\n\t\ttc := time_.New(true)\n\t\tlogger := logs_.GetLogger(c.Request.Context())\n\t\tsummary := func() {\n\t\t\ttc.Tick(\"proxy handler\")\n\t\t\tlogger.Infof(tc.String())\n\t\t}\n\t\tdefer summary()\n\n\t\tif p.opts.proxyMatchedFunc != nil {\n\t\t\t// not apply proxy, process inplace\n\t\t\tif !p.opts.proxyMatchedFunc(c) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tif p.opts.proxyTargetResolverFunc == nil {\n\t\t\t// proxy target resolver func is nil, process inplace\n\t\t\treturn\n\t\t}\n\t\ttargetAddr, err := p.opts.proxyTargetResolverFunc(c)\n\t\tif err != nil {\n\t\t\tc.Render(http.StatusOK, render.JSON{Data: fmt.Errorf(\"resolve proxy target err: %v\", err)})\n\t\t\treturn\n\t\t}\n\t\tif targetAddr == \"\" {\n\t\t\t// proxy target is empty, process inplace\n\t\t\treturn\n\t\t}\n\n\t\ttargetUrl := http_.CloneURL(c.Request.URL)\n\t\tif targetUrl.Scheme == \"\" {\n\t\t\ttargetUrl.Scheme = \"http\"\n\t\t}\n\t\ttargetUrl.Host = targetAddr\n\t\ttargetUrl.Path = \"/\"\n\n\t\tswitch p.opts.proxyMode {\n\t\tcase Redirect_ProxyMode:\n\t\t\tc.Redirect(http.StatusTemporaryRedirect, targetUrl.String())\n\t\t\tc.Abort()\n\t\t\treturn\n\n\t\tcase Reverse_ProxyMode:\n\t\t\tc.Request.Host = targetUrl.Host\n\n\t\tcase Forward_ProxyMode:\n\t\t}\n\n\t\trp := httputil.NewSingleHostReverseProxy(targetUrl)\n\t\trp.ServeHTTP(c.Writer, c.Request)\n\t\tc.Abort()\n\t}\n}\n\nfunc (p *Proxy) setProxy() {\n\tp.router.Use(p.ProxyHandler())\n\t/*\n\t\tfor _, pattern := range p.opts.routerPatterns {\n\t\t\tp.router.Any(pattern, p.ProxyHandler())\n\t\t}\n\t*/\n}\n"
  },
  {
    "path": "pkg/proxy/proxy.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage proxy\n\nfunc WithProxyMatchedFunc(proxyMatchedFunc ProxyMatchedFunc) ProxyOption {\n\treturn ProxyOptionFunc(func(c *Proxy) {\n\t\tc.opts.proxyMatchedFunc = proxyMatchedFunc\n\t})\n}\n\nfunc WithProxyTargetResolverFunc(proxyTargetResolverFunc ProxyTargetResolverFunc) ProxyOption {\n\treturn ProxyOptionFunc(func(c *Proxy) {\n\t\tc.opts.proxyTargetResolverFunc = proxyTargetResolverFunc\n\t})\n}\n\nfunc WithProxyMode(proxyMode ProxyMode) ProxyOption {\n\treturn ProxyOptionFunc(func(c *Proxy) {\n\t\tc.opts.proxyMode = proxyMode\n\t})\n}\n"
  },
  {
    "path": "pkg/proxy/proxy_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage proxy\n\n// A ProxyOption sets options.\ntype ProxyOption interface {\n\tapply(*Proxy)\n}\n\n// EmptyProxyOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyProxyOption struct{}\n\nfunc (EmptyProxyOption) apply(*Proxy) {}\n\n// ProxyOptionFunc wraps a function that modifies Client into an\n// implementation of the ProxyOption interface.\ntype ProxyOptionFunc func(*Proxy)\n\nfunc (f ProxyOptionFunc) apply(do *Proxy) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ProxyOptionWithDefault() ProxyOption {\n\treturn ProxyOptionFunc(func(*Proxy) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Proxy) ApplyOptions(options ...ProxyOption) *Proxy {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/proxy/proxy_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage proxy_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/gin-gonic/gin\"\n\tproxy_ \"github.com/kaydxh/golang/pkg/proxy\"\n)\n\nfunc TestNewProxy(t *testing.T) {\n\ttype args struct {\n\t\trouter  gin.IRouter\n\t\toptions []proxy_.ProxyOption\n\t}\n\tr := gin.Default()\n\ttests := []struct {\n\t\tname    string\n\t\targs    args\n\t\twant    *proxy_.Proxy\n\t\twantErr bool\n\t}{\n\t\t// TODO: Add test cases.\n\t\t{\n\t\t\tname: \"proxy\",\n\t\t\targs: args{\n\t\t\t\trouter: r,\n\t\t\t\toptions: []proxy_.ProxyOption{\n\t\t\t\t\tproxy_.WithProxyTargetResolverFunc(\n\t\t\t\t\t\tfunc(c *gin.Context) (string, error) {\n\t\t\t\t\t\t\treturn \"127.0.0.1:8081\", nil\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\t//\tproxy_.WithProxyMode(proxy_.Redirect_ProxyMode),\n\t\t\t\t},\n\t\t\t},\n\t\t\twantErr: false,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tproxy, err := proxy_.NewProxy(tt.args.router, tt.args.options...)\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"NewProxy() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Use attaches a global middleware to the router. ie. the middleware attached though Use() will be\n\t\t\t// included in the handlers chain for every single request. Even 404, 405, static files...\n\t\t\t// For example, this is the right place for a logger or error management middleware.\n\t\t\tr.Use(proxy.ProxyHandler())\n\t\t\tr.GET(\"/ping\", func(c *gin.Context) {\n\t\t\t\tc.JSON(200, gin.H{\n\t\t\t\t\t\"message\": \"pong\",\n\t\t\t\t})\n\t\t\t})\n\t\t\tr.Run()\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/resolver/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport (\n\t\"context\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\ntype Config struct {\n\tProto Resolver\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context, opts ...ResolverQueryOption) (*ResolverService, error) {\n\n\tlogrus.Infof(\"Installing Resolver\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\treturn nil, nil\n\t}\n\n\trs, err := c.install(ctx, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed Resolver\")\n\n\treturn rs, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context, opts ...ResolverQueryOption) (*ResolverService, error) {\n\tresolverInterval := c.Proto.GetResolveInterval().AsDuration()\n\trs := NewResolverService(resolverInterval)\n\n\tvar (\n\t\trOpts       []ResolverQueryOption\n\t\tserverNames []string\n\t)\n\n\trOpts = append(rOpts,\n\t\tWithResolverType(c.Proto.GetResolverType()),\n\t\tWithLoadBalanceMode(c.Proto.GetLoadBalanceMode()),\n\t)\n\n\tif c.Proto.ResolverType == Resolver_resolver_type_k8s {\n\t\trOpts = append(rOpts,\n\t\t\tWithNodeGroup(c.Proto.GetK8S().GetNodeGroup()),\n\t\t\tWithNodeUnit(c.Proto.GetK8S().GetNodeUnit()),\n\t\t)\n\t\trOpts = append(rOpts, opts...)\n\n\t\tserverNames = c.Proto.GetK8S().GetServiceNames()\n\n\t} else {\n\n\t\trOpts = append(rOpts, opts...)\n\t\tserverNames = c.Proto.GetDomains()\n\n\t}\n\n\tfor _, domain := range serverNames {\n\t\trq, err := NewResolverQuery(\n\t\t\tdomain,\n\t\t\trOpts...,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trs.AddService(rq)\n\t}\n\n\treturn rs, nil\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/resolver/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/resolver/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/resolver/dns/dns_resolver.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage dns\n\nimport \"context\"\n\ntype DNSResolver interface {\n\t// host domain\n\tLookupHostIPv4(ctx context.Context, host string) (addrs []string, err error)\n}\n"
  },
  {
    "path": "pkg/resolver/dns/k8s-resolver/k8s_dns_resolver.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage k8sdns\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"time\"\n\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\tnet_ \"github.com/kaydxh/golang/go/net\"\n\tcorev1 \"k8s.io/api/core/v1\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/labels\"\n\t\"k8s.io/apimachinery/pkg/selection\"\n\t\"k8s.io/client-go/informers\"\n\tinformerv1 \"k8s.io/client-go/informers/core/v1\"\n\t\"k8s.io/client-go/kubernetes\"\n\tv1 \"k8s.io/client-go/listers/core/v1\"\n\t\"k8s.io/client-go/rest\"\n\t\"k8s.io/client-go/tools/cache\"\n\t\"k8s.io/client-go/tools/clientcmd\"\n)\n\nvar (\n\tdefaultInClusterConfig = true\n\tdefaultUseInformer     = true\n\tdefaultNamespace       = corev1.NamespaceAll\n\tdefaultTimeout         = 10 * time.Second\n)\n\ntype ResolverConfig struct {\n\tnodeGroup          string\n\tnodeUnit           string\n\tnamespace          string\n\tuseInClusterConfig bool\n\tuseInformer        bool\n\tkubeConfig         string\n\ttimeout            time.Duration\n}\n\ntype K8sDNSResolver struct {\n\topts        ResolverConfig\n\tstopCh      chan struct{}\n\tkubeClient  kubernetes.Interface\n\tfactory     informers.SharedInformerFactory\n\tpodInformer informerv1.PodInformer\n}\n\nfunc NewK8sDNSResolver(opts ...K8sDNSResolverOption) (*K8sDNSResolver, error) {\n\n\tr := &K8sDNSResolver{\n\t\tstopCh: make(chan struct{}),\n\t}\n\tr.opts.useInClusterConfig = defaultInClusterConfig\n\tr.opts.useInformer = defaultUseInformer\n\tr.opts.namespace = defaultNamespace\n\tr.opts.timeout = defaultTimeout\n\tr.ApplyOptions(opts...)\n\n\tvar (\n\t\trestConfig *rest.Config\n\t\terr        error\n\t)\n\n\tif r.opts.useInClusterConfig {\n\t\trestConfig, err = rest.InClusterConfig()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t} else if r.opts.kubeConfig != \"\" {\n\t\trestConfig, err = clientcmd.BuildConfigFromFlags(\"\", r.opts.kubeConfig)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t} else {\n\t\treturn nil, fmt.Errorf(\"useInClusterConfig false and kubeConfig is empty\")\n\t}\n\n\tr.kubeClient, err = kubernetes.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t//r.factory = informers.NewSharedInformerFactory(r.kubeClient, 0, informers.WithNamespace(r.opts.namespace))\n\tr.factory = informers.NewSharedInformerFactory(r.kubeClient, 0)\n\tr.podInformer = r.factory.Core().V1().Pods()\n\n\t//only run once\n\tgo r.podInformer.Informer().Run(r.stopCh)\n\n\treturn r, nil\n}\n\nfunc (r *K8sDNSResolver) Pods(ctx context.Context, svcs ...string) ([]corev1.Pod, error) {\n\n\tvar pods []corev1.Pod\n\tserviceLabel, _ := labels.NewRequirement(\"k8s-app\", selection.Equals, svcs)\n\tselector := labels.NewSelector()\n\tselector = selector.Add(*serviceLabel)\n\n\tctx, cancel := context_.WithTimeout(ctx, r.opts.timeout)\n\tdefer cancel()\n\n\twaitCh := make(chan struct{})\n\t//var selector string\n\tif r.opts.useInformer {\n\n\t\tgo func() {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\tr.stopCh <- struct{}{}\n\t\t\tcase <-waitCh:\n\t\t\t}\n\t\t}()\n\n\t\tif synced := cache.WaitForCacheSync(r.stopCh, r.podInformer.Informer().HasSynced); !synced {\n\t\t\treturn nil, errors.New(\"pod cache sync failed\")\n\n\t\t}\n\t\twaitCh <- struct{}{}\n\n\t\t/*\n\t\t\ts, err := labels.Parse(selector)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t*/\n\n\t\tpodLister := r.podInformer.Lister()\n\t\tes, err := podLister.(v1.PodLister).Pods(r.opts.namespace).List(selector)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, e := range es {\n\t\t\tpods = append(pods, *e)\n\t\t}\n\n\t} else {\n\t\toptions := metav1.ListOptions{LabelSelector: selector.String()}\n\t\tpodList, err := r.kubeClient.CoreV1().Pods(r.opts.namespace).List(ctx, options)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tpods = podList.Items\n\t}\n\n\treturn pods, nil\n}\n\nfunc (r *K8sDNSResolver) LookupHostIPv4(ctx context.Context, svc string) ([]string, error) {\n\tvar addrs []string\n\n\tpods, err := r.Pods(ctx, svc)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, pod := range pods {\n\t\tif pod.Status.Phase != corev1.PodRunning {\n\t\t\tcontinue\n\t\t}\n\n\t\tif r.opts.nodeGroup != \"\" {\n\t\t\tnodeUnit, ok := pod.Spec.NodeSelector[r.opts.nodeGroup]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif nodeUnit != r.opts.nodeUnit {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif net_.IsIPv4String(pod.Status.PodIP) {\n\t\t\taddrs = append(addrs, pod.Status.PodIP)\n\t\t}\n\t}\n\n\treturn addrs, nil\n}\n"
  },
  {
    "path": "pkg/resolver/dns/k8s-resolver/k8s_dns_resolver_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage k8sdns_test\n\nimport (\n\t\"context\"\n\t\"flag\"\n\t\"testing\"\n\n\tk8sdns_ \"github.com/kaydxh/golang/pkg/resolver/dns/k8s-resolver\"\n)\n\nvar svc string\n\nfunc init() {\n\tflag.StringVar(&svc, \"s\", \"test-cube-algo-backend\", \"k8s service\")\n}\n\nfunc TestK8sDNSResolverGetPodsUsingInformer(t *testing.T) {\n\tresolver, err := k8sdns_.NewK8sDNSResolver()\n\tif err != nil {\n\t\tt.Fatalf(\"new k8s dns reslover, err: %v\", err)\n\t}\n\n\tt.Logf(\"svc: %v\", svc)\n\tpods, err := resolver.Pods(context.Background(), svc)\n\tif err != nil {\n\t\tt.Fatalf(\"resolver get pods, err: %v\", err)\n\t}\n\n\tt.Logf(\"get pods: %v\", pods)\n}\n"
  },
  {
    "path": "pkg/resolver/dns/k8s-resolver/k8s_resolver.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage k8sdns\n\nfunc WithNodeGroup(nodeGroup string) K8sDNSResolverOption {\n\treturn K8sDNSResolverOptionFunc(func(r *K8sDNSResolver) {\n\t\tr.opts.nodeGroup = nodeGroup\n\t})\n}\n\nfunc WithNodeUnit(nodeUnit string) K8sDNSResolverOption {\n\treturn K8sDNSResolverOptionFunc(func(r *K8sDNSResolver) {\n\t\tr.opts.nodeUnit = nodeUnit\n\t})\n}\n\nfunc WithkubeConfig(kubeConfig string) K8sDNSResolverOption {\n\treturn K8sDNSResolverOptionFunc(func(r *K8sDNSResolver) {\n\t\tr.opts.kubeConfig = kubeConfig\n\t})\n}\n\nfunc WithNamespace(namespace string) K8sDNSResolverOption {\n\treturn K8sDNSResolverOptionFunc(func(r *K8sDNSResolver) {\n\t\tr.opts.namespace = namespace\n\t})\n}\n\nfunc WithUseInClusterConfig(useInClusterConfig bool) K8sDNSResolverOption {\n\treturn K8sDNSResolverOptionFunc(func(r *K8sDNSResolver) {\n\t\tr.opts.useInClusterConfig = useInClusterConfig\n\t})\n}\n\nfunc WithUseInformer(useInformer bool) K8sDNSResolverOption {\n\treturn K8sDNSResolverOptionFunc(func(r *K8sDNSResolver) {\n\t\tr.opts.useInformer = useInformer\n\t})\n}\n"
  },
  {
    "path": "pkg/resolver/dns/k8s-resolver/k8s_resolver_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage k8sdns\n\n// A K8sDNSResolverOption sets options.\ntype K8sDNSResolverOption interface {\n\tapply(*K8sDNSResolver)\n}\n\n// EmptyK8sDNSResolverUrlOption does not alter the K8sDNSResolveruration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyK8sDNSResolverOption struct{}\n\nfunc (EmptyK8sDNSResolverOption) apply(*K8sDNSResolver) {}\n\n// K8sDNSResolverOptionFunc wraps a function that modifies K8sDNSResolver into an\n// implementation of the K8sDNSResolverOption interface.\ntype K8sDNSResolverOptionFunc func(*K8sDNSResolver)\n\nfunc (f K8sDNSResolverOptionFunc) apply(do *K8sDNSResolver) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _K8sDNSResolverOptionWithDefault() K8sDNSResolverOption {\n\treturn K8sDNSResolverOptionFunc(func(*K8sDNSResolver) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *K8sDNSResolver) ApplyOptions(options ...K8sDNSResolverOption) *K8sDNSResolver {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/resolver/dns/net-resolver/net_dns_resolver.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage netdns\n\nimport (\n\t\"context\"\n\n\tnet_ \"github.com/kaydxh/golang/go/net\"\n\tdns_ \"github.com/kaydxh/golang/pkg/resolver/dns\"\n)\n\ntype NetResolver struct {\n}\n\nfunc (n NetResolver) LookupHostIPv4(ctx context.Context, host string) (addrs []string, err error) {\n\treturn net_.LookupHostIPv4WithContext(ctx, host)\n}\n\nvar DefaultResolver dns_.DNSResolver = NetResolver{}\n"
  },
  {
    "path": "pkg/resolver/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/resolver\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nrequire (\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgo.uber.org/atomic v1.11.0\n\tgoogle.golang.org/protobuf v1.36.10\n\tk8s.io/api v0.34.2\n\tk8s.io/apimachinery v0.34.2\n\tk8s.io/client-go v0.34.2\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect\n\tgithub.com/emicklei/go-restful/v3 v3.12.2 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/fxamacker/cbor/v2 v2.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-logr/logr v1.4.3 // indirect\n\tgithub.com/go-openapi/jsonpointer v0.21.0 // indirect\n\tgithub.com/go-openapi/jsonreference v0.20.2 // indirect\n\tgithub.com/go-openapi/swag v0.23.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/gogo/protobuf v1.3.2 // indirect\n\tgithub.com/google/gnostic-models v0.7.0 // indirect\n\tgithub.com/google/go-cmp v0.7.0 // indirect\n\tgithub.com/google/uuid v1.6.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/josharian/intern v1.0.0 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-20251125160242-e06b25c89946 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/mailru/easyjson v0.7.7 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgithub.com/x448/float16 v0.8.4 // indirect\n\tgo.yaml.in/yaml/v2 v2.4.2 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/oauth2 v0.32.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/term v0.38.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n\tgopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect\n\tgopkg.in/inf.v0 v0.9.1 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n\tk8s.io/klog/v2 v2.130.1 // indirect\n\tk8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect\n\tk8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect\n\tsigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect\n\tsigs.k8s.io/randfill v1.0.0 // indirect\n\tsigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect\n\tsigs.k8s.io/yaml v1.6.0 // indirect\n)\n"
  },
  {
    "path": "pkg/resolver/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=\ngithub.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=\ngithub.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=\ngithub.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=\ngithub.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=\ngithub.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=\ngithub.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=\ngithub.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=\ngithub.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=\ngithub.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=\ngithub.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=\ngithub.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=\ngithub.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=\ngithub.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=\ngithub.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=\ngithub.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=\ngithub.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=\ngithub.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=\ngithub.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM=\ngithub.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=\ngithub.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=\ngithub.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b h1:h+3JX2VoWTFuyQEo87pStk/a99dzIO1mM9KxIyLPGTU=\ngithub.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=\ngithub.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=\ngithub.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=\ngithub.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngithub.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=\ngo.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=\ngo.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=\ngo.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=\ngolang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=\ngolang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=\ngolang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=\ngolang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=\ngopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=\ngopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=\ngopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\nk8s.io/api v0.34.2 h1:fsSUNZhV+bnL6Aqrp6O7lMTy6o5x2C4XLjnh//8SLYY=\nk8s.io/api v0.34.2/go.mod h1:MMBPaWlED2a8w4RSeanD76f7opUoypY8TFYkSM+3XHw=\nk8s.io/apimachinery v0.34.2 h1:zQ12Uk3eMHPxrsbUJgNF8bTauTVR2WgqJsTmwTE/NW4=\nk8s.io/apimachinery v0.34.2/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=\nk8s.io/client-go v0.34.2 h1:Co6XiknN+uUZqiddlfAjT68184/37PS4QAzYvQvDR8M=\nk8s.io/client-go v0.34.2/go.mod h1:2VYDl1XXJsdcAxw7BenFslRQX28Dxz91U9MWKjX97fE=\nk8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=\nk8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=\nk8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOPolHyvO06MXG5TUIj2mNAA=\nk8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=\nk8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=\nk8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=\nsigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=\nsigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=\nsigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=\nsigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=\nsigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=\nsigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=\nsigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=\nsigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=\n"
  },
  {
    "path": "pkg/resolver/resolver.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math/rand\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/kaydxh/golang/go/errors\"\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\ttime_ \"github.com/kaydxh/golang/go/time\"\n\tdns_ \"github.com/kaydxh/golang/pkg/resolver/dns\"\n\tk8sdns_ \"github.com/kaydxh/golang/pkg/resolver/dns/k8s-resolver\"\n\tnetdns_ \"github.com/kaydxh/golang/pkg/resolver/dns/net-resolver\"\n\t\"github.com/serialx/hashring\"\n\t\"github.com/sirupsen/logrus\"\n\t\"go.uber.org/atomic\"\n)\n\ntype ResolverQueryMap sync.Map\n\ntype ResolverOptions struct {\n\tresolverType    Resolver_ResolverType\n\tloadBalanceMode Resolver_LoadBalanceMode\n\t//k8s\n\tnodeGroup string\n\tnodeUnit  string\n}\n\ntype ResolverQuery struct {\n\t// domain: domain for net resolver, Ex: cube-svc.ns.svc\n\t// domain: svc name for k8s resolver, Ex: cube\n\tDomain   string\n\tnodes    []string\n\thashring *hashring.HashRing\n\topts     ResolverOptions\n\tresolver dns_.DNSResolver\n}\n\n//NewDefaultResolverQuery, dns reslover, bls consist hash\nfunc NewDefaultResolverQuery(domain string) ResolverQuery {\n\trq := ResolverQuery{\n\t\tDomain: domain,\n\t}\n\trq.SetDefault()\n\treturn rq\n}\n\nfunc defaultResolverOptions() ResolverOptions {\n\treturn ResolverOptions{\n\t\tresolverType:    Resolver_resolver_type_dns,\n\t\tloadBalanceMode: Resolver_load_balance_mode_consist,\n\t}\n}\n\nfunc (r *ResolverQuery) SetDefault() {\n\tr.opts = defaultResolverOptions()\n}\n\nfunc NewResolverQuery(domain string, opts ...ResolverQueryOption) (ResolverQuery, error) {\n\trq := NewDefaultResolverQuery(domain)\n\trq.ApplyOptions(opts...)\n\n\t// if resolver is not set, use default\n\tif rq.resolver == nil {\n\t\terr := rq.SetResolver()\n\t\tif err != nil {\n\t\t\treturn rq, err\n\t\t}\n\t}\n\n\treturn rq, nil\n}\n\nfunc (r *ResolverQuery) SetResolver() error {\n\tvar err error\n\tswitch r.opts.resolverType {\n\tcase Resolver_resolver_type_k8s:\n\t\tr.resolver, err = k8sdns_.NewK8sDNSResolver(\n\t\t\tk8sdns_.WithNodeGroup(r.opts.nodeGroup),\n\t\t\tk8sdns_.WithNodeUnit(r.opts.nodeUnit),\n\t\t)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"new k8s resolver, err: %v\", err)\n\t\t\treturn err\n\t\t}\n\tdefault:\n\t\tr.resolver = netdns_.DefaultResolver\n\t}\n\n\treturn nil\n}\n\ntype ResolverService struct {\n\tresolverInterval time.Duration\n\tserviceByName    ResolverQueryMap\n\tinShutdown       atomic.Bool\n\tmu               sync.Mutex\n\tcancel           func()\n}\n\nfunc NewDefaultResolverServices(resolverInterval time.Duration, domains ...string) *ResolverService {\n\trs := NewResolverService(resolverInterval)\n\tfor _, domain := range domains {\n\t\trq := NewDefaultResolverQuery(domain)\n\t\trs.AddService(rq)\n\t}\n\treturn rs\n}\n\nfunc NewResolverService(resolverInterval time.Duration, services ...ResolverQuery) *ResolverService {\n\trs := &ResolverService{\n\t\tresolverInterval: resolverInterval,\n\t}\n\tif rs.resolverInterval == 0 {\n\t\trs.resolverInterval = 10 * time.Second\n\t}\n\n\trs.AddServices(services...)\n\treturn rs\n}\n\nfunc (srv *ResolverService) logger() logrus.FieldLogger {\n\treturn logrus.WithField(\"module\", \"ResolverService\")\n}\n\nfunc (srv *ResolverService) Run(ctx context.Context) error {\n\tlogger := srv.logger()\n\tlogger.Infoln(\"ResolverService Run\")\n\tif srv.inShutdown.Load() {\n\t\tlogger.Infoln(\"ResolverService Shutdown\")\n\t\treturn fmt.Errorf(\"server closed\")\n\t}\n\tgo func() {\n\t\terrors.HandleError(srv.Serve(ctx))\n\t}()\n\treturn nil\n\n}\n\nfunc (srv *ResolverService) Serve(ctx context.Context) error {\n\tlogger := srv.logger()\n\tlogger.Infoln(\"ServiceResolver Serve\")\n\n\tif srv.inShutdown.Load() {\n\t\terr := fmt.Errorf(\"server closed\")\n\t\tlogger.WithError(err).Errorf(\"ServiceResolver Serve canceled\")\n\t\treturn err\n\t}\n\n\tdefer srv.inShutdown.Store(true)\n\tctx, cancel := context.WithCancel(ctx)\n\tsrv.mu.Lock()\n\tsrv.cancel = cancel\n\tsrv.mu.Unlock()\n\n\ttime_.UntilWithContxt(ctx, func(ctx context.Context) error {\n\t\tlogger.Debugf(\"querying services\")\n\t\terr := srv.QueryServices()\n\t\tif err != nil {\n\t\t\tlogger.WithError(err).Errorf(\"query services failed\")\n\t\t\treturn err\n\t\t}\n\t\tlogger.Debugf(\"query services\")\n\t\treturn nil\n\t}, srv.resolverInterval)\n\tlogger.Info(\"stopped query services\")\n\treturn nil\n}\n\nfunc (srv *ResolverService) Shutdown() {\n\tsrv.inShutdown.Store(true)\n\tsrv.mu.Lock()\n\tdefer srv.mu.Unlock()\n\tif srv.cancel != nil {\n\t\tsrv.cancel()\n\t}\n}\n\nfunc (srv *ResolverService) QueryServices() (err error) {\n\tvar (\n\t\terrs []error\n\t)\n\n\tlogger := srv.logger()\n\tsrv.serviceByName.Range(func(name string, service ResolverQuery) bool {\n\n\t\tservice.nodes, err = service.resolver.LookupHostIPv4(context.Background(), service.Domain)\n\t\tif err != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"failed to query service: %v, err: %v\", service.Domain, err))\n\t\t\treturn true\n\t\t}\n\t\tlogger.Debugf(\"the results of lookup domain[%s] are nodes[%v]\", service.Domain, service.nodes)\n\n\t\tif service.opts.loadBalanceMode == Resolver_load_balance_mode_consist {\n\t\t\tservice.hashring = hashring.New(service.nodes)\n\t\t}\n\t\tsrv.serviceByName.Store(name, service)\n\t\treturn true\n\n\t})\n\n\treturn errors_.NewAggregate(errs)\n}\n\nfunc (srv *ResolverService) PickNode(name string, consistKey string) (node string, has bool) {\n\tservice, has := srv.serviceByName.Load(name)\n\tif !has {\n\t\treturn \"\", false\n\t}\n\n\tif service.opts.loadBalanceMode == Resolver_load_balance_mode_consist {\n\t\tif service.hashring == nil {\n\t\t\terr := srv.QueryServices()\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", false\n\t\t\t}\n\t\t\tservice, has = srv.serviceByName.Load(name)\n\t\t\tif !has {\n\t\t\t\treturn \"\", false\n\t\t\t}\n\t\t}\n\t\treturn service.hashring.GetNode(consistKey)\n\t}\n\n\tif len(service.nodes) == 0 {\n\t\treturn \"\", false\n\t}\n\ts := service.nodes[rand.Intn(len(service.nodes))]\n\treturn s, true\n}\n\n// AddService, if exist, it will update\nfunc (srv *ResolverService) AddService(service ResolverQuery) {\n\tsrv.serviceByName.Store(service.Domain, service)\n}\n\n// AddServices, if exist, it will update\nfunc (srv *ResolverService) AddServices(services ...ResolverQuery) {\n\tfor _, service := range services {\n\t\tsrv.AddService(service)\n\t}\n}\n"
  },
  {
    "path": "pkg/resolver/resolver.pb.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.27.0\n// \tprotoc        v3.13.0\n// source: pkg/resolver/resolver.proto\n\npackage resolver\n\nimport (\n\tduration \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Resolver_ResolverType int32\n\nconst (\n\tResolver_resolver_type_dns    Resolver_ResolverType = 0\n\tResolver_resolver_type_consul Resolver_ResolverType = 1\n\tResolver_resolver_type_k8s    Resolver_ResolverType = 2\n)\n\n// Enum value maps for Resolver_ResolverType.\nvar (\n\tResolver_ResolverType_name = map[int32]string{\n\t\t0: \"resolver_type_dns\",\n\t\t1: \"resolver_type_consul\",\n\t\t2: \"resolver_type_k8s\",\n\t}\n\tResolver_ResolverType_value = map[string]int32{\n\t\t\"resolver_type_dns\":    0,\n\t\t\"resolver_type_consul\": 1,\n\t\t\"resolver_type_k8s\":    2,\n\t}\n)\n\nfunc (x Resolver_ResolverType) Enum() *Resolver_ResolverType {\n\tp := new(Resolver_ResolverType)\n\t*p = x\n\treturn p\n}\n\nfunc (x Resolver_ResolverType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Resolver_ResolverType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_resolver_resolver_proto_enumTypes[0].Descriptor()\n}\n\nfunc (Resolver_ResolverType) Type() protoreflect.EnumType {\n\treturn &file_pkg_resolver_resolver_proto_enumTypes[0]\n}\n\nfunc (x Resolver_ResolverType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Resolver_ResolverType.Descriptor instead.\nfunc (Resolver_ResolverType) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_resolver_resolver_proto_rawDescGZIP(), []int{0, 0}\n}\n\ntype Resolver_LoadBalanceMode int32\n\nconst (\n\tResolver_load_balance_mode_random  Resolver_LoadBalanceMode = 0\n\tResolver_load_balance_mode_consist Resolver_LoadBalanceMode = 1\n)\n\n// Enum value maps for Resolver_LoadBalanceMode.\nvar (\n\tResolver_LoadBalanceMode_name = map[int32]string{\n\t\t0: \"load_balance_mode_random\",\n\t\t1: \"load_balance_mode_consist\",\n\t}\n\tResolver_LoadBalanceMode_value = map[string]int32{\n\t\t\"load_balance_mode_random\":  0,\n\t\t\"load_balance_mode_consist\": 1,\n\t}\n)\n\nfunc (x Resolver_LoadBalanceMode) Enum() *Resolver_LoadBalanceMode {\n\tp := new(Resolver_LoadBalanceMode)\n\t*p = x\n\treturn p\n}\n\nfunc (x Resolver_LoadBalanceMode) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Resolver_LoadBalanceMode) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_resolver_resolver_proto_enumTypes[1].Descriptor()\n}\n\nfunc (Resolver_LoadBalanceMode) Type() protoreflect.EnumType {\n\treturn &file_pkg_resolver_resolver_proto_enumTypes[1]\n}\n\nfunc (x Resolver_LoadBalanceMode) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Resolver_LoadBalanceMode.Descriptor instead.\nfunc (Resolver_LoadBalanceMode) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_resolver_resolver_proto_rawDescGZIP(), []int{0, 1}\n}\n\ntype Resolver struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled         bool                     `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tResolverType    Resolver_ResolverType    `protobuf:\"varint,2,opt,name=resolver_type,json=resolverType,proto3,enum=go.pkg.resolver.Resolver_ResolverType\" json:\"resolver_type,omitempty\"`\n\tLoadBalanceMode Resolver_LoadBalanceMode `protobuf:\"varint,3,opt,name=load_balance_mode,json=loadBalanceMode,proto3,enum=go.pkg.resolver.Resolver_LoadBalanceMode\" json:\"load_balance_mode,omitempty\"`\n\tResolveInterval *duration.Duration       `protobuf:\"bytes,4,opt,name=resolve_interval,json=resolveInterval,proto3\" json:\"resolve_interval,omitempty\"`\n\tDomains         []string                 `protobuf:\"bytes,5,rep,name=domains,proto3\" json:\"domains,omitempty\"`\n\tK8S             *Resolver_K8S            `protobuf:\"bytes,6,opt,name=k8s,proto3\" json:\"k8s,omitempty\"`\n}\n\nfunc (x *Resolver) Reset() {\n\t*x = Resolver{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_resolver_resolver_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Resolver) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Resolver) ProtoMessage() {}\n\nfunc (x *Resolver) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_resolver_resolver_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Resolver.ProtoReflect.Descriptor instead.\nfunc (*Resolver) Descriptor() ([]byte, []int) {\n\treturn file_pkg_resolver_resolver_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Resolver) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Resolver) GetResolverType() Resolver_ResolverType {\n\tif x != nil {\n\t\treturn x.ResolverType\n\t}\n\treturn Resolver_resolver_type_dns\n}\n\nfunc (x *Resolver) GetLoadBalanceMode() Resolver_LoadBalanceMode {\n\tif x != nil {\n\t\treturn x.LoadBalanceMode\n\t}\n\treturn Resolver_load_balance_mode_random\n}\n\nfunc (x *Resolver) GetResolveInterval() *duration.Duration {\n\tif x != nil {\n\t\treturn x.ResolveInterval\n\t}\n\treturn nil\n}\n\nfunc (x *Resolver) GetDomains() []string {\n\tif x != nil {\n\t\treturn x.Domains\n\t}\n\treturn nil\n}\n\nfunc (x *Resolver) GetK8S() *Resolver_K8S {\n\tif x != nil {\n\t\treturn x.K8S\n\t}\n\treturn nil\n}\n\ntype Resolver_K8S struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tServiceNames []string `protobuf:\"bytes,1,rep,name=service_names,json=serviceNames,proto3\" json:\"service_names,omitempty\"`\n\tNodeGroup    string   `protobuf:\"bytes,2,opt,name=node_group,json=nodeGroup,proto3\" json:\"node_group,omitempty\"`\n\tNodeUnit     string   `protobuf:\"bytes,3,opt,name=node_unit,json=nodeUnit,proto3\" json:\"node_unit,omitempty\"`\n}\n\nfunc (x *Resolver_K8S) Reset() {\n\t*x = Resolver_K8S{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_resolver_resolver_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *Resolver_K8S) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Resolver_K8S) ProtoMessage() {}\n\nfunc (x *Resolver_K8S) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_resolver_resolver_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Resolver_K8S.ProtoReflect.Descriptor instead.\nfunc (*Resolver_K8S) Descriptor() ([]byte, []int) {\n\treturn file_pkg_resolver_resolver_proto_rawDescGZIP(), []int{0, 0}\n}\n\nfunc (x *Resolver_K8S) GetServiceNames() []string {\n\tif x != nil {\n\t\treturn x.ServiceNames\n\t}\n\treturn nil\n}\n\nfunc (x *Resolver_K8S) GetNodeGroup() string {\n\tif x != nil {\n\t\treturn x.NodeGroup\n\t}\n\treturn \"\"\n}\n\nfunc (x *Resolver_K8S) GetNodeUnit() string {\n\tif x != nil {\n\t\treturn x.NodeUnit\n\t}\n\treturn \"\"\n}\n\nvar File_pkg_resolver_resolver_proto protoreflect.FileDescriptor\n\nvar file_pkg_resolver_resolver_proto_rawDesc = []byte{\n\t0x0a, 0x1b, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, 0x72,\n\t0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67,\n\t0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x1a, 0x1e,\n\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,\n\t0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe9,\n\t0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x65,\n\t0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e,\n\t0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x4b, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65,\n\t0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x67,\n\t0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x52,\n\t0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72,\n\t0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x54, 0x79,\n\t0x70, 0x65, 0x12, 0x55, 0x0a, 0x11, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e,\n\t0x63, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e,\n\t0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e,\n\t0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c,\n\t0x61, 0x6e, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0f, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x61,\n\t0x6c, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x72, 0x65, 0x73,\n\t0x6f, 0x6c, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20,\n\t0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,\n\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f,\n\t0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12,\n\t0x18, 0x0a, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09,\n\t0x52, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x2f, 0x0a, 0x03, 0x6b, 0x38, 0x73,\n\t0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e,\n\t0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65,\n\t0x72, 0x2e, 0x4b, 0x38, 0x73, 0x52, 0x03, 0x6b, 0x38, 0x73, 0x1a, 0x66, 0x0a, 0x03, 0x4b, 0x38,\n\t0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d,\n\t0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,\n\t0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x67,\n\t0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65,\n\t0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x75, 0x6e,\n\t0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x55, 0x6e,\n\t0x69, 0x74, 0x22, 0x56, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x54, 0x79,\n\t0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x5f, 0x74,\n\t0x79, 0x70, 0x65, 0x5f, 0x64, 0x6e, 0x73, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x72, 0x65, 0x73,\n\t0x6f, 0x6c, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75,\n\t0x6c, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x5f,\n\t0x74, 0x79, 0x70, 0x65, 0x5f, 0x6b, 0x38, 0x73, 0x10, 0x02, 0x22, 0x4e, 0x0a, 0x0f, 0x4c, 0x6f,\n\t0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a,\n\t0x18, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6d, 0x6f,\n\t0x64, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x6c,\n\t0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65,\n\t0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x10, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69,\n\t0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f,\n\t0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x3b,\n\t0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_resolver_resolver_proto_rawDescOnce sync.Once\n\tfile_pkg_resolver_resolver_proto_rawDescData = file_pkg_resolver_resolver_proto_rawDesc\n)\n\nfunc file_pkg_resolver_resolver_proto_rawDescGZIP() []byte {\n\tfile_pkg_resolver_resolver_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_resolver_resolver_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_resolver_resolver_proto_rawDescData)\n\t})\n\treturn file_pkg_resolver_resolver_proto_rawDescData\n}\n\nvar file_pkg_resolver_resolver_proto_enumTypes = make([]protoimpl.EnumInfo, 2)\nvar file_pkg_resolver_resolver_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_pkg_resolver_resolver_proto_goTypes = []interface{}{\n\t(Resolver_ResolverType)(0),    // 0: go.pkg.resolver.Resolver.ResolverType\n\t(Resolver_LoadBalanceMode)(0), // 1: go.pkg.resolver.Resolver.LoadBalanceMode\n\t(*Resolver)(nil),              // 2: go.pkg.resolver.Resolver\n\t(*Resolver_K8S)(nil),          // 3: go.pkg.resolver.Resolver.K8s\n\t(*duration.Duration)(nil),     // 4: google.protobuf.Duration\n}\nvar file_pkg_resolver_resolver_proto_depIdxs = []int32{\n\t0, // 0: go.pkg.resolver.Resolver.resolver_type:type_name -> go.pkg.resolver.Resolver.ResolverType\n\t1, // 1: go.pkg.resolver.Resolver.load_balance_mode:type_name -> go.pkg.resolver.Resolver.LoadBalanceMode\n\t4, // 2: go.pkg.resolver.Resolver.resolve_interval:type_name -> google.protobuf.Duration\n\t3, // 3: go.pkg.resolver.Resolver.k8s:type_name -> go.pkg.resolver.Resolver.K8s\n\t4, // [4:4] is the sub-list for method output_type\n\t4, // [4:4] is the sub-list for method input_type\n\t4, // [4:4] is the sub-list for extension type_name\n\t4, // [4:4] is the sub-list for extension extendee\n\t0, // [0:4] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_resolver_resolver_proto_init() }\nfunc file_pkg_resolver_resolver_proto_init() {\n\tif File_pkg_resolver_resolver_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_resolver_resolver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Resolver); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_resolver_resolver_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*Resolver_K8S); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_resolver_resolver_proto_rawDesc,\n\t\t\tNumEnums:      2,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_resolver_resolver_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_resolver_resolver_proto_depIdxs,\n\t\tEnumInfos:         file_pkg_resolver_resolver_proto_enumTypes,\n\t\tMessageInfos:      file_pkg_resolver_resolver_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_resolver_resolver_proto = out.File\n\tfile_pkg_resolver_resolver_proto_rawDesc = nil\n\tfile_pkg_resolver_resolver_proto_goTypes = nil\n\tfile_pkg_resolver_resolver_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/resolver/resolver.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.resolver;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.resolver;resolver\";\n\nmessage Resolver {\n  bool enabled = 1;\n  ResolverType resolver_type = 2;\n  LoadBalanceMode load_balance_mode = 3;\n  google.protobuf.Duration resolve_interval = 4;\n  repeated string domains = 5;\n  K8s k8s = 6;\n\n  message K8s {\n    repeated string service_names = 1;\n    string node_group = 2;\n    string node_unit = 3;\n  }\n\n  enum ResolverType {\n    resolver_type_dns = 0;\n    resolver_type_consul = 1;\n    resolver_type_k8s = 2;\n  }\n  enum LoadBalanceMode {\n    load_balance_mode_random = 0;\n    load_balance_mode_consist = 1;\n  }\n}\n"
  },
  {
    "path": "pkg/resolver/resolver.yaml",
    "content": "resolver:\n  enabled: true\n  resolver_type: resolver_type_k8s\n  load_balance_mode: load_balance_mode_consist\n  domains: []\n  k8s:\n    service_names: []\n    node_group:\n    node_unit:\n  resolve_interval : 10s\n"
  },
  {
    "path": "pkg/resolver/resolver_query.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport dns_ \"github.com/kaydxh/golang/pkg/resolver/dns\"\n\nfunc WithResolverType(resolverType Resolver_ResolverType) ResolverQueryOption {\n\treturn ResolverQueryOptionFunc(func(r *ResolverQuery) {\n\t\tr.opts.resolverType = resolverType\n\t})\n}\n\nfunc WithLoadBalanceMode(loadBalanceMode Resolver_LoadBalanceMode) ResolverQueryOption {\n\treturn ResolverQueryOptionFunc(func(r *ResolverQuery) {\n\t\tr.opts.loadBalanceMode = loadBalanceMode\n\t})\n}\n\nfunc WithNodeGroup(nodeGroup string) ResolverQueryOption {\n\treturn ResolverQueryOptionFunc(func(r *ResolverQuery) {\n\t\tr.opts.nodeGroup = nodeGroup\n\t})\n}\n\nfunc WithNodeUnit(nodeUnit string) ResolverQueryOption {\n\treturn ResolverQueryOptionFunc(func(r *ResolverQuery) {\n\t\tr.opts.nodeUnit = nodeUnit\n\t})\n}\n\nfunc WithResolver(resolver dns_.DNSResolver) ResolverQueryOption {\n\treturn ResolverQueryOptionFunc(func(r *ResolverQuery) {\n\t\tr.resolver = resolver\n\t})\n}\n"
  },
  {
    "path": "pkg/resolver/resolver_query_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\n// A ResolverQueryOption sets options.\ntype ResolverQueryOption interface {\n\tapply(*ResolverQuery)\n}\n\n// EmptyResolverQueryUrlOption does not alter the ResolverQueryuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyResolverQueryOption struct{}\n\nfunc (EmptyResolverQueryOption) apply(*ResolverQuery) {}\n\n// ResolverQueryOptionFunc wraps a function that modifies ResolverQuery into an\n// implementation of the ResolverQueryOption interface.\ntype ResolverQueryOptionFunc func(*ResolverQuery)\n\nfunc (f ResolverQueryOptionFunc) apply(do *ResolverQuery) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ResolverQueryOptionWithDefault() ResolverQueryOption {\n\treturn ResolverQueryOptionFunc(func(*ResolverQuery) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *ResolverQuery) ApplyOptions(options ...ResolverQueryOption) *ResolverQuery {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/resolver/resolver_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\tresolver_ \"github.com/kaydxh/golang/pkg/resolver\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n)\n\n/*\nfunc TestNewResolverService(t *testing.T) {\n\tcfgFile := \"./resolver.yaml\"\n\tconfig := resolver_.NewConfig(resolver_.WithViper(viper_.GetViper(cfgFile, \"resolver\")))\n\ts, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\ts.Run(context.Background())\n\t//\tnet.DefaultResolver\n\n\ttype args struct {\n\t\tconsistkey       string\n\t\tresolverInterval time.Duration\n\t\tservices         []resolver_.ResolverQuery\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs args\n\t\twant *resolver_.ResolverService\n\t}{\n\t\t// TODO: Add test cases.\n\t\t{\n\t\t\tname: \"www.baidu.com\",\n\t\t\targs: args{\n\t\t\t\tconsistkey:       \"1\",\n\t\t\t\tresolverInterval: 0,\n\t\t\t\tservices: []resolver_.ResolverQuery{\n\t\t\t\t\t{\n\t\t\t\t\t\tDomain: \"www.baidu.com\",\n\t\t\t\t\t\tOpts: resolver_.ResolverOptions{\n\t\t\t\t\t\t\tResolverType:    resolver_.Resolver_resolver_type_dns,\n\t\t\t\t\t\t\tLoadBalanceMode: resolver_.Resolver_load_balance_mode_consist,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\terr = s.AddServices(tt.args.services...)\n\t\t\tfor i := 0; i < 100; i++ {\n\t\t\t\tconsistkey := fmt.Sprintf(\"consist-key-%d\", i)\n\t\t\t\tnode, has := s.PickNode(tt.name, consistkey)\n\t\t\t\tt.Logf(\"pick node: %v, has: %v, consistkey: %v\", node, has, consistkey)\n\t\t\t}\n\t\t})\n\t}\n}\n*/\n\nfunc TestNewResolverService2(t *testing.T) {\n\tcfgFile := \"./resolver.yaml\"\n\tconfig := resolver_.NewConfig(resolver_.WithViper(viper_.GetViper(cfgFile, \"resolver\")))\n\ts, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\ts.Run(context.Background())\n\n\ttype args struct {\n\t\tconsistkey       string\n\t\tresolverInterval time.Duration\n\t\tservices         []resolver_.ResolverQuery\n\t}\n\n\ttests := []struct {\n\t\tserviceName      string\n\t\tnodeGroup        string\n\t\tnodeUnit         string\n\t\tconsistkey       string\n\t\tloadBalanceMode  resolver_.Resolver_LoadBalanceMode\n\t\tresolverType     resolver_.Resolver_ResolverType\n\t\tresolverInterval time.Duration\n\t}{\n\t\t// TODO: Add test cases.\n\t\t{\n\t\t\tserviceName:      \"test-cube-algo-backend\",\n\t\t\tnodeGroup:        \"edge-global-group\",\n\t\t\tnodeUnit:         \"edge-node-zone\",\n\t\t\tconsistkey:       \"1\",\n\t\t\tresolverInterval: 0,\n\t\t\tresolverType:     resolver_.Resolver_resolver_type_k8s,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.serviceName, func(t *testing.T) {\n\t\t\trq, err := resolver_.NewResolverQuery(\n\t\t\t\ttt.serviceName,\n\t\t\t\tresolver_.WithLoadBalanceMode(tt.loadBalanceMode),\n\t\t\t\tresolver_.WithResolverType(tt.resolverType),\n\t\t\t\tresolver_.WithNodeGroup(tt.nodeGroup),\n\t\t\t\tresolver_.WithNodeUnit(tt.nodeUnit),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"new resolver query err: %v\", err)\n\t\t\t}\n\t\t\ts.AddServices(rq)\n\t\t\ttime.Sleep(5 * time.Second)\n\t\t\tfor i := 0; i < 100; i++ {\n\t\t\t\tconsistkey := fmt.Sprintf(\"consist-key-%d\", i)\n\t\t\t\tnode, has := s.PickNode(tt.serviceName, consistkey)\n\t\t\t\tt.Logf(\"pick node: %v, has: %v, consistkey: %v\", node, has, consistkey)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "pkg/resolver/resolverquerymap_syncmap.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage resolver\n\nimport (\n\t\"sync\" // Used by sync.Map.\n)\n\n// Generate code that will fail if the constants change value.\nfunc _() {\n\t// An \"cannot convert ResolverQueryMap literal (type ResolverQueryMap) to type sync.Map\" compiler error signifies that the base type have changed.\n\t// Re-run the go-syncmap command to generate them again.\n\t_ = (sync.Map)(ResolverQueryMap{})\n}\n\nvar _nil_ResolverQueryMap_ResolverQuery_value = func() (val ResolverQuery) { return }()\n\n// Load returns the value stored in the map for a key, or nil if no\n// value is present.\n// The ok result indicates whether value was found in the map.\nfunc (m *ResolverQueryMap) Load(key string) (ResolverQuery, bool) {\n\tvalue, ok := (*sync.Map)(m).Load(key)\n\tif value == nil {\n\t\treturn _nil_ResolverQueryMap_ResolverQuery_value, ok\n\t}\n\treturn value.(ResolverQuery), ok\n}\n\n// Store sets the value for a key.\nfunc (m *ResolverQueryMap) Store(key string, value ResolverQuery) {\n\t(*sync.Map)(m).Store(key, value)\n}\n\n// LoadOrStore returns the existing value for the key if present.\n// Otherwise, it stores and returns the given value.\n// The loaded result is true if the value was loaded, false if stored.\nfunc (m *ResolverQueryMap) LoadOrStore(key string, value ResolverQuery) (ResolverQuery, bool) {\n\tactual, loaded := (*sync.Map)(m).LoadOrStore(key, value)\n\tif actual == nil {\n\t\treturn _nil_ResolverQueryMap_ResolverQuery_value, loaded\n\t}\n\treturn actual.(ResolverQuery), loaded\n}\n\n// LoadAndDelete deletes the value for a key, returning the previous value if any.\n// The loaded result reports whether the key was present.\nfunc (m *ResolverQueryMap) LoadAndDelete(key string) (value ResolverQuery, loaded bool) {\n\tactual, loaded := (*sync.Map)(m).LoadAndDelete(key)\n\tif actual == nil {\n\t\treturn _nil_ResolverQueryMap_ResolverQuery_value, loaded\n\t}\n\treturn actual.(ResolverQuery), loaded\n}\n\n// Delete deletes the value for a key.\nfunc (m *ResolverQueryMap) Delete(key string) {\n\t(*sync.Map)(m).Delete(key)\n}\n\n// Range calls f sequentially for each key and value present in the map.\n// If f returns false, range stops the iteration.\n//\n// Range does not necessarily correspond to any consistent snapshot of the Map's\n// contents: no key will be visited more than once, but if the value for any key\n// is stored or deleted concurrently, Range may reflect any mapping for that key\n// from any point during the Range call.\n//\n// Range may be O(N) with the number of elements in the map even if f returns\n// false after a constant number of calls.\nfunc (m *ResolverQueryMap) Range(f func(key string, value ResolverQuery) bool) {\n\t(*sync.Map)(m).Range(func(key, value interface{}) bool {\n\t\treturn f(key.(string), value.(ResolverQuery))\n\t})\n}\n"
  },
  {
    "path": "pkg/scheduler/backend/backend.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage backend\n\nimport (\n\t\"github.com/kaydxh/golang/pkg/scheduler/task\"\n\t\"github.com/kaydxh/golang/pkg/scheduler/types\"\n)\n\ntype Backend interface {\n\tSetState(state types.TaskState, task *task.Task) error\n\tGetState(taskId string) (types.TaskState, error)\n}\n"
  },
  {
    "path": "pkg/scheduler/broker/broker.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage broker\n\nimport (\n\t\"context\"\n\n\t\"github.com/kaydxh/golang/pkg/scheduler/task\"\n)\n\n// Broker - a common interface for all brokers\n// local node\n// remote(ip:port) node\n// the mq\ntype Broker interface {\n\tSetTaskDispatcher(dispatcher Taskdispatcher)\n\tPublish(ctx context.Context, task *task.Task) error\n}\n\n// TaskProcessor - can process a delivered task\n// This will probably always be a worker instance\ntype Taskdispatcher interface {\n\tAddTask(task *task.Task) error\n}\n"
  },
  {
    "path": "pkg/scheduler/broker/memory/memory.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage memory\n\nimport (\n\t\"context\"\n\t\"errors\"\n\n\t\"github.com/kaydxh/golang/pkg/scheduler/broker\"\n\t\"github.com/kaydxh/golang/pkg/scheduler/task\"\n)\n\ntype Broker struct {\n\tdispatcher broker.Taskdispatcher\n}\n\nfunc NewBroker() *Broker {\n\treturn &Broker{}\n}\n\nfunc (b *Broker) SetTaskDispatcher(dispatcher broker.Taskdispatcher) {\n\tb.dispatcher = dispatcher\n\n}\n\nfunc (b *Broker) Publish(ctx context.Context, task *task.Task) error {\n\n\tif b.dispatcher == nil {\n\t\treturn errors.New(\"dispatcher is not assigned in memory-mode\")\n\t}\n\n\treturn b.dispatcher.AddTask(task)\n}\n"
  },
  {
    "path": "pkg/scheduler/dispatcher.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage scheduler\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/kaydxh/golang/pkg/scheduler/task\"\n\ttask_ \"github.com/kaydxh/golang/pkg/scheduler/task\"\n)\n\ntype Dispatcher struct {\n\t//\ttasks   *sync.Map\n\tworkersChCh chan chan *task.Task\n\ttaskQueCh   chan *task.Task\n\tworkers     []*Worker\n\tburst       int\n\tstopCh      chan struct{}\n}\n\nfunc NewDispatcher(burst int) *Dispatcher {\n\td := &Dispatcher{\n\t\tworkersChCh: make(chan chan *task.Task, burst),\n\t\ttaskQueCh:   make(chan *task.Task, 100),\n\t\tburst:       burst,\n\t\tstopCh:      make(chan struct{}),\n\t}\n\tgo d.run()\n\treturn d\n}\n\nfunc (d *Dispatcher) run() {\n\tfor i := 0; i < d.burst; i++ {\n\t\tworker := NewWorker(i, d.workersChCh)\n\t\tgo worker.Process(context.Background())\n\t\td.workers = append(d.workers, worker)\n\n\t\tgo d.dispatch()\n\t}\n}\n\nfunc (d *Dispatcher) dispatch() {\n\n\tfor {\n\t\tselect {\n\t\tcase task := <-d.taskQueCh:\n\t\t\ttaskCh := <-d.workersChCh\n\t\t\ttaskCh <- task\n\n\t\tcase <-d.stopCh:\n\t\t\td.stopWokrs()\n\t\t\treturn\n\t\t}\n\n\t}\n}\n\nfunc (d *Dispatcher) stopWokrs() {\n\twg := new(sync.WaitGroup)\n\twg.Add(len(d.workers))\n\tfor _, v := range d.workers {\n\t\tgo func(w *Worker, wg *sync.WaitGroup) {\n\t\t\tdefer wg.Done()\n\t\t\tif w.working {\n\t\t\t\tw.Stop()\n\t\t\t}\n\t\t}(v, wg)\n\n\t}\n\n\twg.Wait()\n}\n\nfunc (d *Dispatcher) AddTask(task *task_.Task) error {\n\terr := task_.Validate(task)\n\tif err != nil {\n\t\treturn err\n\t}\n\td.taskQueCh <- task\n\tfmt.Println(\"add task\")\n\n\treturn nil\n}\n\nfunc (d *Dispatcher) Stop() {\n\tclose(d.stopCh)\n}\n"
  },
  {
    "path": "pkg/scheduler/dispatcher_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage scheduler_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/google/uuid\"\n\tscheduler_ \"github.com/kaydxh/golang/pkg/scheduler\"\n\ttask_ \"github.com/kaydxh/golang/pkg/scheduler/task\"\n)\n\nfunc TestDispatcher(t *testing.T) {\n\tburst := 1\n\t//\tbroker := memory_.NewBroker()\n\tdispatcher := scheduler_.NewDispatcher(burst)\n\tdispatcher.AddTask(&task_.Task{\n\t\tTaskId: uuid.New().String(),\n\t\tTaskFunc: func(a int, b string) error {\n\t\t\tfmt.Printf(\"do task: %v:%v\\n\", a, b)\n\t\t\treturn nil\n\t\t},\n\t\tArgs: []task_.TaskArgument{\n\t\t\ttask_.TaskArgument{\n\t\t\t\tType:  \"int\",\n\t\t\t\tValue: 8,\n\t\t\t},\n\t\t\ttask_.TaskArgument{\n\t\t\t\tType:  \"int\",\n\t\t\t\tValue: \"hello\",\n\t\t\t},\n\t\t},\n\t})\n\tdispatcher.Stop()\n\tfmt.Println(\"out\")\n\n}\n"
  },
  {
    "path": "pkg/scheduler/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/scheduler\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nrequire (\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/google/uuid v1.6.0\n\tgithub.com/kaydxh/golang/go v0.0.0-00010101000000-000000000000\n\tgolang.org/x/net v0.48.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n"
  },
  {
    "path": "pkg/scheduler/go.sum",
    "content": "github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "pkg/scheduler/server.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage scheduler\n\nimport (\n\t\"github.com/kaydxh/golang/pkg/scheduler/broker\"\n\ttask_ \"github.com/kaydxh/golang/pkg/scheduler/task\"\n\t\"golang.org/x/net/context\"\n)\n\ntype Server struct {\n\tbroker broker.Broker\n\tburst  int\n}\n\nfunc NewServer(burst int, broker broker.Broker) *Server {\n\ts := &Server{\n\t\tbroker: broker,\n\t}\n\ts.broker.SetTaskDispatcher(NewDispatcher(burst))\n\n\treturn s\n}\n\nfunc (s *Server) AddTask(ctx context.Context, task *task_.Task) error {\n\terr := task_.Validate(task)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn s.broker.Publish(ctx, task)\n\n}\n"
  },
  {
    "path": "pkg/scheduler/server_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage scheduler_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/google/uuid\"\n\tscheduler_ \"github.com/kaydxh/golang/pkg/scheduler\"\n\tmemory_ \"github.com/kaydxh/golang/pkg/scheduler/broker/memory\"\n\ttask_ \"github.com/kaydxh/golang/pkg/scheduler/task\"\n)\n\nfunc TestServer(t *testing.T) {\n\tburst := 1\n\tbroker := memory_.NewBroker()\n\tserver := scheduler_.NewServer(burst, broker)\n\n\tserver.AddTask(context.Background(), &task_.Task{\n\t\tTaskId: uuid.New().String(),\n\t\tTaskFunc: func(a int, b string) error {\n\t\t\tfmt.Printf(\"do task: %v:%v\\n\", a, b)\n\t\t\treturn nil\n\t\t},\n\t\tArgs: []task_.TaskArgument{\n\t\t\ttask_.TaskArgument{\n\t\t\t\tType:  \"int\",\n\t\t\t\tValue: 8,\n\t\t\t},\n\t\t\ttask_.TaskArgument{\n\t\t\t\tType:  \"string\",\n\t\t\t\tValue: \"hello\",\n\t\t\t},\n\t\t},\n\t})\n\n\tselect {}\n\n}\n"
  },
  {
    "path": "pkg/scheduler/task/result.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage task\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n)\n\n// TaskResult represents an actual return value of a processed task\ntype TaskResult struct {\n\tType  string      `json:\"type\"`\n\tValue interface{} `json:\"value\"`\n}\n\n// ReflectTaskResults ...\nfunc ReflectTaskResults(taskResults []*TaskResult) ([]reflect.Value, error) {\n\tresultValues := make([]reflect.Value, len(taskResults))\n\tfor i, taskResult := range taskResults {\n\t\tresultValue, err := reflect_.ReflectValue(taskResult.Type, taskResult.Value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresultValues[i] = resultValue\n\t}\n\treturn resultValues, nil\n}\n\n// HumanReadableResults ...\nfunc HumanReadableResults(results []reflect.Value) string {\n\tif len(results) == 1 {\n\t\treturn fmt.Sprintf(\"%v\", results[0].Interface())\n\t}\n\n\treadableResults := make([]string, len(results))\n\tfor i := 0; i < len(results); i++ {\n\t\treadableResults[i] = fmt.Sprintf(\"%v\", results[i].Interface())\n\t}\n\n\treturn fmt.Sprintf(\"[%s]\", strings.Join(readableResults, \", \"))\n}\n"
  },
  {
    "path": "pkg/scheduler/task/task.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage task\n\nimport (\n\t\"reflect\"\n\n\treflect_ \"github.com/kaydxh/golang/go/reflect\"\n)\n\ntype Task struct {\n\tTaskId   string\n\tTaskFunc interface{}\n\tArgs     []TaskArgument\n\t//\tTaskStatus\n\tPreTaskHandler  func(*Task) error\n\tPostTaskHandler func(*Task) error\n}\n\n// Types which can be used: bool, string, int int8 int16 int32 int64, uint uint8 uint16 uint32 uint64, float32 float64\ntype TaskArgument struct {\n\tType  string      `json:\"type\"`\n\tValue interface{} `json:\"value\"`\n}\n\nfunc (t *Task) Run() ([]*TaskResult, error) {\n\n\treflectTaskFunc := reflect.ValueOf(t.TaskFunc)\n\treflectTaskArgs, err := reflectTaskArgs(t.Args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresults := reflectTaskFunc.Call(reflectTaskArgs)\n\treturn reflectTaskResults(results)\n}\n\nfunc reflectTaskArgs(args []TaskArgument) ([]reflect.Value, error) {\n\targValues := make([]reflect.Value, len(args))\n\n\tfor i, arg := range args {\n\t\targValue, err := reflect_.ReflectValue(arg.Type, arg.Value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\targValues[i] = argValue\n\t}\n\n\treturn argValues, nil\n}\n\nfunc reflectTaskResults(results []reflect.Value) ([]*TaskResult, error) {\n\t// Task must return at least a value\n\tif len(results) == 0 {\n\t\treturn nil, ErrTaskReturnsNoValue\n\t}\n\n\t// Last returned value\n\tlastResult := results[len(results)-1]\n\tif !lastResult.IsNil() {\n\t\t// check that the result implements the standard error interface,\n\t\t// if not, return ErrLastReturnValueMustBeError error\n\t\terrorInterface := reflect.TypeOf((*error)(nil)).Elem()\n\t\tif !lastResult.Type().Implements(errorInterface) {\n\t\t\treturn nil, ErrLastReturnValueMustBeError\n\t\t}\n\n\t\t// Return the standard error\n\t\treturn nil, lastResult.Interface().(error)\n\t}\n\n\t// Convert reflect values to task results\n\ttaskResults := make([]*TaskResult, len(results)-1)\n\tfor i := 0; i < len(results)-1; i++ {\n\t\tval := results[i].Interface()\n\t\ttypeStr := reflect.TypeOf(val).String()\n\t\ttaskResults[i] = &TaskResult{\n\t\t\tType:  typeStr,\n\t\t\tValue: val,\n\t\t}\n\t}\n\n\treturn taskResults, nil\n}\n"
  },
  {
    "path": "pkg/scheduler/task/validate.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage task\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n)\n\nvar (\n\tErrTaskNil = errors.New(\"Task must be not nil\")\n\t// ErrTaskMustBeFunc ...\n\tErrTaskMustBeFunc = errors.New(\"Task must be a func type\")\n\t// ErrTaskReturnsNoValue ...\n\tErrTaskReturnsNoValue = errors.New(\"Task must return at least a single value\")\n\t// ErrLastReturnValueMustBeError ..\n\tErrLastReturnValueMustBeError = errors.New(\"Last return value of a task must be error\")\n)\n\n// Validate validates task function using reflection and makes sure\n// it has a proper signature. Functions used as tasks must return at least a\n// single value and the last return type must be error\nfunc Validate(task *Task) error {\n\tif task == nil {\n\t\treturn ErrTaskNil\n\t}\n\tv := reflect.ValueOf(task.TaskFunc)\n\tt := v.Type()\n\n\t// TaskFunc must be a function\n\tif t.Kind() != reflect.Func {\n\t\treturn ErrTaskMustBeFunc\n\t}\n\n\t// TaskFunc must return at least a single value\n\tif t.NumOut() < 1 {\n\t\treturn ErrTaskReturnsNoValue\n\t}\n\n\t// Last return value must be error\n\tlastReturnType := t.Out(t.NumOut() - 1)\n\terrorInterface := reflect.TypeOf((*error)(nil)).Elem()\n\tif !lastReturnType.Implements(errorInterface) {\n\t\treturn ErrLastReturnValueMustBeError\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/scheduler/types/task.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: pkg/scheduler/types/task.proto\n\npackage types\n\nimport (\n\t_ \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype TaskState int32\n\nconst (\n\tTaskState_TASK_STATE_RESERVE  TaskState = 0\n\tTaskState_TASK_STATE_PENDING  TaskState = 1\n\tTaskState_TASK_STATE_RUNNING  TaskState = 2\n\tTaskState_TASK_STATE_SUCCEED  TaskState = 3\n\tTaskState_TASK_STATE_FAILED   TaskState = 4\n\tTaskState_TASK_STATE_STOPPING TaskState = 5\n\tTaskState_TASK_STATE_STOPPED  TaskState = 6\n)\n\n// Enum value maps for TaskState.\nvar (\n\tTaskState_name = map[int32]string{\n\t\t0: \"TASK_STATE_RESERVE\",\n\t\t1: \"TASK_STATE_PENDING\",\n\t\t2: \"TASK_STATE_RUNNING\",\n\t\t3: \"TASK_STATE_SUCCEED\",\n\t\t4: \"TASK_STATE_FAILED\",\n\t\t5: \"TASK_STATE_STOPPING\",\n\t\t6: \"TASK_STATE_STOPPED\",\n\t}\n\tTaskState_value = map[string]int32{\n\t\t\"TASK_STATE_RESERVE\":  0,\n\t\t\"TASK_STATE_PENDING\":  1,\n\t\t\"TASK_STATE_RUNNING\":  2,\n\t\t\"TASK_STATE_SUCCEED\":  3,\n\t\t\"TASK_STATE_FAILED\":   4,\n\t\t\"TASK_STATE_STOPPING\": 5,\n\t\t\"TASK_STATE_STOPPED\":  6,\n\t}\n)\n\nfunc (x TaskState) Enum() *TaskState {\n\tp := new(TaskState)\n\t*p = x\n\treturn p\n}\n\nfunc (x TaskState) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (TaskState) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_scheduler_types_task_proto_enumTypes[0].Descriptor()\n}\n\nfunc (TaskState) Type() protoreflect.EnumType {\n\treturn &file_pkg_scheduler_types_task_proto_enumTypes[0]\n}\n\nfunc (x TaskState) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use TaskState.Descriptor instead.\nfunc (TaskState) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_scheduler_types_task_proto_rawDescGZIP(), []int{0}\n}\n\nvar File_pkg_scheduler_types_task_proto protoreflect.FileDescriptor\n\nvar file_pkg_scheduler_types_task_proto_rawDesc = []byte{\n\t0x0a, 0x1e, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f,\n\t0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t0x12, 0x16, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c,\n\t0x65, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,\n\t0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0xb3, 0x01, 0x0a, 0x09, 0x54, 0x61, 0x73,\n\t0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53,\n\t0x54, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x10, 0x00, 0x12, 0x16,\n\t0x0a, 0x12, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x45, 0x4e,\n\t0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53,\n\t0x54, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x16,\n\t0x0a, 0x12, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x55, 0x43,\n\t0x43, 0x45, 0x45, 0x44, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53,\n\t0x54, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x17, 0x0a,\n\t0x13, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x50,\n\t0x50, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x53,\n\t0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x06, 0x42, 0x30,\n\t0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79,\n\t0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64,\n\t0x75, 0x6c, 0x65, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73,\n\t0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_scheduler_types_task_proto_rawDescOnce sync.Once\n\tfile_pkg_scheduler_types_task_proto_rawDescData = file_pkg_scheduler_types_task_proto_rawDesc\n)\n\nfunc file_pkg_scheduler_types_task_proto_rawDescGZIP() []byte {\n\tfile_pkg_scheduler_types_task_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_scheduler_types_task_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_scheduler_types_task_proto_rawDescData)\n\t})\n\treturn file_pkg_scheduler_types_task_proto_rawDescData\n}\n\nvar file_pkg_scheduler_types_task_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_pkg_scheduler_types_task_proto_goTypes = []interface{}{\n\t(TaskState)(0), // 0: go.pkg.scheduler.types.TaskState\n}\nvar file_pkg_scheduler_types_task_proto_depIdxs = []int32{\n\t0, // [0:0] is the sub-list for method output_type\n\t0, // [0:0] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_scheduler_types_task_proto_init() }\nfunc file_pkg_scheduler_types_task_proto_init() {\n\tif File_pkg_scheduler_types_task_proto != nil {\n\t\treturn\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_scheduler_types_task_proto_rawDesc,\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   0,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_scheduler_types_task_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_scheduler_types_task_proto_depIdxs,\n\t\tEnumInfos:         file_pkg_scheduler_types_task_proto_enumTypes,\n\t}.Build()\n\tFile_pkg_scheduler_types_task_proto = out.File\n\tfile_pkg_scheduler_types_task_proto_rawDesc = nil\n\tfile_pkg_scheduler_types_task_proto_goTypes = nil\n\tfile_pkg_scheduler_types_task_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/scheduler/types/task.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.scheduler.types;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.scheduler.types;types\";\n\n\nenum TaskState {\n  TASK_STATE_RESERVE = 0;\n  TASK_STATE_PENDING = 1;\n  TASK_STATE_RUNNING = 2;\n  TASK_STATE_SUCCEED = 3;\n  TASK_STATE_FAILED = 4;\n  TASK_STATE_STOPPING = 5;\n  TASK_STATE_STOPPED = 6;\n}\n"
  },
  {
    "path": "pkg/scheduler/worker.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage scheduler\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/kaydxh/golang/pkg/scheduler/task\"\n)\n\ntype Worker struct {\n\tid        int\n\tstopCh    chan struct{}\n\tworking   bool\n\tworksChCh chan chan *task.Task\n\ttaskCh    chan *task.Task\n}\n\nfunc NewWorker(id int, worksChCh chan chan *task.Task) *Worker {\n\tw := &Worker{\n\t\tid:        id,\n\t\tworksChCh: worksChCh,\n\t\ttaskCh:    make(chan *task.Task),\n\t\tstopCh:    make(chan struct{}),\n\t}\n\n\treturn w\n}\n\nfunc (w *Worker) doProcess(ctx context.Context, task *task.Task) error {\n\tfmt.Println(\" doProcess\")\n\tif task.PreTaskHandler != nil {\n\t\ttask.PreTaskHandler(task)\n\t}\n\n\t//do task\n\t_, err := task.Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif task.PostTaskHandler != nil {\n\t\ttask.PostTaskHandler(task)\n\t}\n\n\treturn nil\n}\n\nfunc (w *Worker) Process(ctx context.Context) {\n\tw.worksChCh <- w.taskCh\n\n\tfmt.Println(\" Process task\")\n\tfor {\n\t\tselect {\n\t\tcase task := <-w.taskCh:\n\t\t\tw.working = true\n\t\t\tfmt.Println(\" get task\")\n\t\t\tw.doProcess(ctx, task)\n\t\t\tw.worksChCh <- w.taskCh\n\n\t\tcase <-w.stopCh:\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (w *Worker) Stop() {\n\tif !w.working {\n\t\treturn\n\t}\n\n\tclose(w.stopCh)\n\tw.working = false\n}\n"
  },
  {
    "path": "pkg/storage/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/storage\n\ngo 1.24.0\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nreplace github.com/kaydxh/golang/pkg/logs => ../logs\n\nrequire (\n\tgithub.com/aws/aws-sdk-go v1.55.8\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-00010101000000-000000000000\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/viper v1.21.0\n\tgocloud.dev v0.40.0\n\tgolang.org/x/net v0.48.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/aws/aws-sdk-go-v2 v1.36.5 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/config v1.29.17 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/credentials v1.17.70 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.84 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/s3 v1.84.0 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/sso v1.25.5 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 // indirect\n\tgithub.com/aws/aws-sdk-go-v2/service/sts v1.34.0 // indirect\n\tgithub.com/aws/smithy-go v1.22.4 // indirect\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect\n\tgithub.com/google/wire v0.6.0 // indirect\n\tgithub.com/googleapis/gax-go/v2 v2.13.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/jmespath/go-jmespath v0.4.0 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.opencensus.io v0.24.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgolang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect\n\tgoogle.golang.org/api v0.195.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n\tgopkg.in/yaml.v2 v2.4.0 // indirect\n)\n"
  },
  {
    "path": "pkg/storage/go.sum",
    "content": "cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=\ncloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ=\ncloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc=\ncloud.google.com/go/auth v0.9.1 h1:+pMtLEV2k0AXKvs/tGZojuj6QaioxfUjOpMsG5Gtx+w=\ncloud.google.com/go/auth v0.9.1/go.mod h1:Sw8ocT5mhhXxFklyhT12Eiy0ed6tTrPMCJjSI8KhYLk=\ncloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY=\ncloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc=\ncloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs=\ncloud.google.com/go/iam v1.1.13 h1:7zWBXG9ERbMLrzQBRhFliAV+kjcRToDTgQT3CTwYyv4=\ncloud.google.com/go/iam v1.1.13/go.mod h1:K8mY0uSXwEXS30KrnVb+j54LB/ntfZu1dr+4zFMNbus=\ncloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs=\ncloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0=\ngithub.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=\ngithub.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ=\ngithub.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk=\ngithub.com/aws/aws-sdk-go-v2 v1.36.5 h1:0OF9RiEMEdDdZEMqF9MRjevyxAQcf6gY+E7vwBILFj0=\ngithub.com/aws/aws-sdk-go-v2 v1.36.5/go.mod h1:EYrzvCCN9CMUTa5+6lf6MM4tq3Zjp8UhSGR/cBsjai0=\ngithub.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11 h1:12SpdwU8Djs+YGklkinSSlcrPyj3H4VifVsKf78KbwA=\ngithub.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11/go.mod h1:dd+Lkp6YmMryke+qxW/VnKyhMBDTYP41Q2Bb+6gNZgY=\ngithub.com/aws/aws-sdk-go-v2/config v1.29.17 h1:jSuiQ5jEe4SAMH6lLRMY9OVC+TqJLP5655pBGjmnjr0=\ngithub.com/aws/aws-sdk-go-v2/config v1.29.17/go.mod h1:9P4wwACpbeXs9Pm9w1QTh6BwWwJjwYvJ1iCt5QbCXh8=\ngithub.com/aws/aws-sdk-go-v2/credentials v1.17.70 h1:ONnH5CM16RTXRkS8Z1qg7/s2eDOhHhaXVd72mmyv4/0=\ngithub.com/aws/aws-sdk-go-v2/credentials v1.17.70/go.mod h1:M+lWhhmomVGgtuPOhO85u4pEa3SmssPTdcYpP/5J/xc=\ngithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 h1:KAXP9JSHO1vKGCr5f4O6WmlVKLFFXgWYAGoJosorxzU=\ngithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32/go.mod h1:h4Sg6FQdexC1yYG9RDnOvLbW1a/P986++/Y/a+GyEM8=\ngithub.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.84 h1:cTXRdLkpBanlDwISl+5chq5ui1d1YWg4PWMR9c3kXyw=\ngithub.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.84/go.mod h1:kwSy5X7tfIHN39uucmjQVs2LvDdXEjQucgQQEqCggEo=\ngithub.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 h1:SsytQyTMHMDPspp+spo7XwXTP44aJZZAC7fBV2C5+5s=\ngithub.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36/go.mod h1:Q1lnJArKRXkenyog6+Y+zr7WDpk4e6XlR6gs20bbeNo=\ngithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 h1:i2vNHQiXUvKhs3quBR6aqlgJaiaexz/aNvdCktW/kAM=\ngithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36/go.mod h1:UdyGa7Q91id/sdyHPwth+043HhmP6yP9MBHgbZM0xo8=\ngithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=\ngithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=\ngithub.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36 h1:GMYy2EOWfzdP3wfVAGXBNKY5vK4K8vMET4sYOYltmqs=\ngithub.com/aws/aws-sdk-go-v2/internal/v4a v1.3.36/go.mod h1:gDhdAV6wL3PmPqBhiPbnlS447GoWs8HTTOYef9/9Inw=\ngithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 h1:CXV68E2dNqhuynZJPB80bhPQwAKqBWVer887figW6Jc=\ngithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4/go.mod h1:/xFi9KtvBXP97ppCz1TAEvU1Uf66qvid89rbem3wCzQ=\ngithub.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4 h1:nAP2GYbfh8dd2zGZqFRSMlq+/F6cMPBUuCsGAMkN074=\ngithub.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.4/go.mod h1:LT10DsiGjLWh4GbjInf9LQejkYEhBgBCjLG5+lvk4EE=\ngithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 h1:t0E6FzREdtCsiLIoLCWsYliNsRBgyGD/MCK571qk4MI=\ngithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17/go.mod h1:ygpklyoaypuyDvOM5ujWGrYWpAK3h7ugnmKCU/76Ys4=\ngithub.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17 h1:qcLWgdhq45sDM9na4cvXax9dyLitn8EYBRl8Ak4XtG4=\ngithub.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.17/go.mod h1:M+jkjBFZ2J6DJrjMv2+vkBbuht6kxJYtJiwoVgX4p4U=\ngithub.com/aws/aws-sdk-go-v2/service/s3 v1.84.0 h1:0reDqfEN+tB+sozj2r92Bep8MEwBZgtAXTND1Kk9OXg=\ngithub.com/aws/aws-sdk-go-v2/service/s3 v1.84.0/go.mod h1:kUklwasNoCn5YpyAqC/97r6dzTA1SRKJfKq16SXeoDU=\ngithub.com/aws/aws-sdk-go-v2/service/sso v1.25.5 h1:AIRJ3lfb2w/1/8wOOSqYb9fUKGwQbtysJ2H1MofRUPg=\ngithub.com/aws/aws-sdk-go-v2/service/sso v1.25.5/go.mod h1:b7SiVprpU+iGazDUqvRSLf5XmCdn+JtT1on7uNL6Ipc=\ngithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 h1:BpOxT3yhLwSJ77qIY3DoHAQjZsc4HEGfMCE4NGy3uFg=\ngithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3/go.mod h1:vq/GQR1gOFLquZMSrxUK/cpvKCNVYibNyJ1m7JrU88E=\ngithub.com/aws/aws-sdk-go-v2/service/sts v1.34.0 h1:NFOJ/NXEGV4Rq//71Hs1jC/NvPs1ezajK+yQmkwnPV0=\ngithub.com/aws/aws-sdk-go-v2/service/sts v1.34.0/go.mod h1:7ph2tGpfQvwzgistp2+zga9f+bCjlQJPkPUmMgDSD7w=\ngithub.com/aws/smithy-go v1.22.4 h1:uqXzVZNuNexwc/xrh6Tb56u89WDlJY6HS+KC0S4QSjw=\ngithub.com/aws/smithy-go v1.22.4/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=\ngithub.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=\ngithub.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=\ngithub.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=\ngithub.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=\ngithub.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=\ngithub.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=\ngithub.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=\ngithub.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=\ngithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=\ngithub.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=\ngithub.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=\ngithub.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=\ngithub.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=\ngithub.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=\ngithub.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=\ngithub.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=\ngithub.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=\ngithub.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=\ngithub.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=\ngithub.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=\ngithub.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/go-replayers/grpcreplay v1.3.0 h1:1Keyy0m1sIpqstQmgz307zhiJ1pV4uIlFds5weTmxbo=\ngithub.com/google/go-replayers/grpcreplay v1.3.0/go.mod h1:v6NgKtkijC0d3e3RW8il6Sy5sqRVUwoQa4mHOGEy8DI=\ngithub.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk=\ngithub.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc=\ngithub.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0=\ngithub.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM=\ngithub.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA=\ngithub.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=\ngithub.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI=\ngithub.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA=\ngithub.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=\ngithub.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=\ngithub.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s=\ngithub.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=\ngithub.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=\ngithub.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=\ngithub.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=\ngo.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=\ngo.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngocloud.dev v0.40.0 h1:f8LgP+4WDqOG/RXoUcyLpeIAGOcAbZrZbDQCUee10ng=\ngocloud.dev v0.40.0/go.mod h1:drz+VyYNBvrMTW0KZiBAYEdl8lbNZx+OQ7oQvdrFmSQ=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=\ngolang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=\ngolang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=\ngolang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=\ngolang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=\ngolang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=\ngolang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=\ngolang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=\ngolang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=\ngolang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=\ngolang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=\ngolang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=\ngolang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=\ngolang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=\ngolang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=\ngolang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=\ngolang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=\ngolang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=\ngolang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=\ngolang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=\ngolang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=\ngolang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=\ngolang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=\ngolang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=\ngolang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=\ngolang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=\ngolang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=\ngolang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=\ngolang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=\ngolang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=\ngolang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=\ngolang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=\ngolang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=\ngolang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=\ngolang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=\ngolang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=\ngolang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY=\ngolang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/api v0.195.0 h1:Ude4N8FvTKnnQJHU48RFI40jOBgIrL8Zqr3/QeST6yU=\ngoogle.golang.org/api v0.195.0/go.mod h1:DOGRWuv3P8TU8Lnz7uQc4hyNqrBpMtD9ppW3wBJurgc=\ngoogle.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=\ngoogle.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=\ngoogle.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=\ngoogle.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=\ngoogle.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=\ngoogle.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c h1:TYOEhrQMrNDTAd2rX9m+WgGr8Ku6YNuj1D7OX6rWSok=\ngoogle.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c/go.mod h1:2rC5OendXvZ8wGEo/cSLheztrZDZaSoHanUcd1xtZnw=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=\ngoogle.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=\ngoogle.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=\ngoogle.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=\ngoogle.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=\ngoogle.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=\ngoogle.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=\ngoogle.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=\ngoogle.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=\ngoogle.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=\ngoogle.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=\ngoogle.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=\ngoogle.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\nhonnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=\nhonnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=\n"
  },
  {
    "path": "pkg/storage/mount/mount.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mount\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n\n\tio_ \"github.com/kaydxh/golang/go/io\"\n\n\tos_ \"github.com/kaydxh/golang/go/os\"\n\texec_ \"github.com/kaydxh/golang/go/os/exec\"\n)\n\nconst (\n\tmountLabelFileName = \"mount-label-file-75248\"\n)\n\nfunc MountCeph(\n\tprefixMountPath, userName, address, keyring, workDir string, forceMount bool, timeout int,\n) (mountPoint string, err error) {\n\tkeyringFilePath, err := genCephKeyringConfFile(prefixMountPath, userName, keyring)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tworkDir = filepath.Join(\"/\", workDir)\n\n\tcmd := fmt.Sprintf(\n\t\t`ceph-fuse -m %s -k %s -n client.%s -o rw.nonempty -r %s %s`,\n\t\taddress,\n\t\tkeyringFilePath,\n\t\tuserName,\n\t\tworkDir,\n\t\tmountPoint,\n\t)\n\treturn doMountCmd(prefixMountPath, workDir, cmd, forceMount, timeout)\n}\n\nfunc MountCfs(\n\tprefixMountPath, address, workDir string,\n\tforceMount bool,\n\ttimeout int,\n) (mountPoint string, err error) {\n\n\tmountPoint = filepath.Join(prefixMountPath, workDir)\n\tworkDir = filepath.Join(\"/\", workDir)\n\n\tcmd := fmt.Sprintf(\n\t\t`mount -t nfs -o vers=4 %s:%s %s`,\n\t\taddress,\n\t\tworkDir,\n\t\tmountPoint,\n\t)\n\treturn doMountCmd(prefixMountPath, workDir, cmd, forceMount, timeout)\n}\n\nfunc doMountCmd(\n\tprefixMountPath, workDir, cmd string,\n\tforceMount bool,\n\ttimeout int,\n) (mountPoint string, err error) {\n\n\tmountPoint = filepath.Join(\"/\", prefixMountPath, workDir)\n\tif !forceMount {\n\t\tlabelFilePath := filepath.Join(mountPoint, mountLabelFileName)\n\t\texist, err := os_.PathExist(labelFilePath)\n\t\tif err == nil && exist {\n\t\t\treturn mountPoint, nil\n\t\t}\n\t}\n\n\terr = os.MkdirAll(mountPoint, 0755)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t_, _, err = exec_.Exec(time.Duration(timeout), cmd)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn mountPoint, nil\n}\n\nfunc genCephKeyringConfFile(prefixMountPath, userName, keyring string) (string, error) {\n\tkeyringFileName := userName + \".keyring\"\n\tkeyringFilePath := filepath.Join(prefixMountPath, keyringFileName)\n\n\tline1 := \"[client.\" + userName + \"]\"\n\tline2 := fmt.Sprintf(\"    key =  %s\\n\", keyring)\n\tlines := []string{line1, line2}\n\n\terr := io_.WriteFileLines(keyringFilePath, lines, false)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn keyringFilePath, nil\n}\n"
  },
  {
    "path": "pkg/storage/mount/mount_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage mount_test\n\nimport (\n\t\"testing\"\n\n\tmount_ \"github.com/kaydxh/golang/pkg/storage/mount\"\n)\n\nfunc TestMountCeph(t *testing.T) {\n\tmountPoint, err := mount_.MountCeph(\"/mnt\", \"admin\", \"127.0.0.1:9090\", \"password\", \"/data\", false, 30)\n\tif err != nil {\n\t\tt.Errorf(\"expect nil, got %v\", err)\n\t}\n\n\tt.Logf(\"mountPoint: %v\", mountPoint)\n}\n"
  },
  {
    "path": "pkg/storage/s3/config.go",
    "content": "package s3\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n\t\"gocloud.dev/blob\"\n)\n\nvar (\n\tErrNotEnabled = errors.New(\"not enabled\")\n)\n\ntype Config struct {\n\tProto S3\n\topts  struct {\n\t\t// If set, overrides params below\n\t\tviper *viper.Viper\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\nfunc (c *completedConfig) New(ctx context.Context) (*blob.Bucket, error) {\n\n\tlogrus.Infof(\"Installing S3\")\n\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\n\tif !c.Proto.GetEnabled() {\n\t\treturn nil, nil\n\t}\n\n\tbucket, err := c.install(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogrus.Infof(\"Installed S3\")\n\n\treturn bucket, nil\n}\n\nfunc (c *completedConfig) install(ctx context.Context) (*blob.Bucket, error) {\n\ts3Config := &c.Proto\n\tstorageConfig, err := ParseUrl(s3Config.Url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif s3Config.GetSecretId() == \"\" || s3Config.GetSecretKey() == \"\" {\n\t\treturn nil, fmt.Errorf(\"secret is empty\")\n\t}\n\tstorageConfig.SecretId = s3Config.GetSecretId()\n\tstorageConfig.SecretKey = s3Config.GetSecretKey()\n\n\ts, err := NewStorage(\n\t\tctx,\n\t\t*storageConfig,\n\t)\n\n\treturn s.Bucket, err\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/storage/s3/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage s3\n\nimport (\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n"
  },
  {
    "path": "pkg/storage/s3/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage s3\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/storage/s3/s3.go",
    "content": "package s3\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/session\"\n\thttp_ \"github.com/kaydxh/golang/go/net/http\"\n\t\"gocloud.dev/blob\"\n\t\"gocloud.dev/blob/s3blob\"\n)\n\n// url: http://examplebucket-1250000000.cos.ap-beijing.myqcloud.com\ntype StorageConfig struct {\n\t// 机房分布区域, cos的数据存放在这些地域的存储桶中\n\tRegion string\n\t// 存储桶名字,存储桶是对象的载体,可理解为存放对象的容器\n\tBucketName string\n\t// 对象被存放到存储桶中,用户可通过访问域名访问和下载对象\n\tEndpoint string\n\t// 与账户对应的ID\n\tAppId string\n\t// 密钥\n\tSecretId     string\n\tSecretKey    string\n\tSessionToken string\n\n\tDisableSSL bool\n}\n\ntype Storage struct {\n\tConf StorageConfig\n\t*blob.Bucket\n\topts struct {\n\n\t\t// 前缀路径,一般以\"/\"结尾, 操作子目录\n\t\t// the PrefixPath should end with \"/\", so that the resulting operates in a subfoleder\n\t\tPrefixPath string\n\t}\n}\n\nfunc NewStorage(ctx context.Context, conf StorageConfig, opts ...StorageOption) (*Storage, error) {\n\ts := &Storage{\n\t\tConf: conf,\n\t}\n\ts.ApplyOptions(opts...)\n\n\tclient, _ := http_.NewClient()\n\ts3Config := aws.NewConfig().\n\t\tWithRegion(conf.Region).\n\t\tWithCredentials(credentials.NewStaticCredentials(conf.SecretId, conf.SecretKey, conf.SessionToken)).\n\t\tWithDisableSSL(conf.DisableSSL).\n\t\tWithHTTPClient(&client.Client).\n\t\tWithEndpoint(conf.Endpoint)\n\n\tsess, err := session.NewSession(s3Config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbucket, err := s3blob.OpenBucket(ctx, sess, conf.BucketName, &s3blob.Options{\n\t\tUseLegacyList: true,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif s.opts.PrefixPath != \"\" {\n\t\tbucket = blob.PrefixedBucket(bucket, s.opts.PrefixPath)\n\t}\n\n\ts.Bucket = bucket\n\treturn s, nil\n}\n\n// url: http://examplebucket-1250000000.cos.ap-beijing.myqcloud.com\nfunc ParseUrl(rawUrl string) (*StorageConfig, error) {\n\tvar conf StorageConfig\n\ts3Url, err := url.Parse(rawUrl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif s3Url.Scheme != \"https\" {\n\t\tconf.DisableSSL = true\n\t}\n\tss := strings.Split(s3Url.Host, \".\")\n\tif len(ss) < 3 {\n\t\treturn nil, fmt.Errorf(\"the number of dot in %v too less\", s3Url.Host)\n\t}\n\tbucketName := ss[0]\n\tconf.Region = ss[2]\n\n\t// len(ss) >= 3 so strings.Index(s3Url.Host, \".\") must >= 0\n\tconf.Endpoint = s3Url.Host[strings.Index(s3Url.Host, \".\")+1:]\n\n\t// bucket-AppId\n\tidx := strings.LastIndex(bucketName, \"-\")\n\tif idx < 0 {\n\t\treturn nil, fmt.Errorf(\"missed - in url\")\n\t}\n\tconf.BucketName = bucketName\n\tconf.AppId = bucketName[idx+1:]\n\n\treturn &conf, nil\n}\n"
  },
  {
    "path": "pkg/storage/s3/s3.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage s3\n\nfunc WithPrefixPath(prefixPath string) StorageOption {\n\treturn StorageOptionFunc(func(c *Storage) {\n\t\tc.opts.PrefixPath = prefixPath\n\t})\n}\n"
  },
  {
    "path": "pkg/storage/s3/s3.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v3.13.0\n// source: pkg/storage/s3/s3.proto\n\npackage s3\n\nimport (\n\t_ \"github.com/golang/protobuf/ptypes/duration\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype S3 struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tEnabled   bool   `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tUrl       string `protobuf:\"bytes,2,opt,name=url,proto3\" json:\"url,omitempty\"`\n\tSecretId  string `protobuf:\"bytes,3,opt,name=secret_id,json=secretId,proto3\" json:\"secret_id,omitempty\"`\n\tSecretKey string `protobuf:\"bytes,4,opt,name=secret_key,json=secretKey,proto3\" json:\"secret_key,omitempty\"`\n}\n\nfunc (x *S3) Reset() {\n\t*x = S3{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_storage_s3_s3_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *S3) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*S3) ProtoMessage() {}\n\nfunc (x *S3) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_storage_s3_s3_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use S3.ProtoReflect.Descriptor instead.\nfunc (*S3) Descriptor() ([]byte, []int) {\n\treturn file_pkg_storage_s3_s3_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *S3) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *S3) GetUrl() string {\n\tif x != nil {\n\t\treturn x.Url\n\t}\n\treturn \"\"\n}\n\nfunc (x *S3) GetSecretId() string {\n\tif x != nil {\n\t\treturn x.SecretId\n\t}\n\treturn \"\"\n}\n\nfunc (x *S3) GetSecretKey() string {\n\tif x != nil {\n\t\treturn x.SecretKey\n\t}\n\treturn \"\"\n}\n\nvar File_pkg_storage_s3_s3_proto protoreflect.FileDescriptor\n\nvar file_pkg_storage_s3_s3_proto_rawDesc = []byte{\n\t0x0a, 0x17, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x73, 0x33,\n\t0x2f, 0x73, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x67, 0x6f, 0x2e, 0x70, 0x6b,\n\t0x67, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x73, 0x33, 0x1a, 0x1e, 0x67, 0x6f,\n\t0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75,\n\t0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6c, 0x0a, 0x02,\n\t0x53, 0x33, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20,\n\t0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x10, 0x0a, 0x03,\n\t0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1b,\n\t0x0a, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x08, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73,\n\t0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,\n\t0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69,\n\t0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x79, 0x64, 0x78, 0x68, 0x2f,\n\t0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x73,\n\t0x33, 0x3b, 0x73, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_storage_s3_s3_proto_rawDescOnce sync.Once\n\tfile_pkg_storage_s3_s3_proto_rawDescData = file_pkg_storage_s3_s3_proto_rawDesc\n)\n\nfunc file_pkg_storage_s3_s3_proto_rawDescGZIP() []byte {\n\tfile_pkg_storage_s3_s3_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_storage_s3_s3_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_storage_s3_s3_proto_rawDescData)\n\t})\n\treturn file_pkg_storage_s3_s3_proto_rawDescData\n}\n\nvar file_pkg_storage_s3_s3_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_pkg_storage_s3_s3_proto_goTypes = []interface{}{\n\t(*S3)(nil), // 0: go.pkg.storage.s3.S3\n}\nvar file_pkg_storage_s3_s3_proto_depIdxs = []int32{\n\t0, // [0:0] is the sub-list for method output_type\n\t0, // [0:0] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_storage_s3_s3_proto_init() }\nfunc file_pkg_storage_s3_s3_proto_init() {\n\tif File_pkg_storage_s3_s3_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_storage_s3_s3_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*S3); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_storage_s3_s3_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_storage_s3_s3_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_storage_s3_s3_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_storage_s3_s3_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_storage_s3_s3_proto = out.File\n\tfile_pkg_storage_s3_s3_proto_rawDesc = nil\n\tfile_pkg_storage_s3_s3_proto_goTypes = nil\n\tfile_pkg_storage_s3_s3_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/storage/s3/s3.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.storage.s3;\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.storage.s3;s3\";\n\nmessage S3 {\n  bool enabled = 1;\n  string url = 2;\n  string secret_id = 3;\n  string secret_key = 4;\n}\n"
  },
  {
    "path": "pkg/storage/s3/s3.yaml",
    "content": "storage:\n  s3:\n    enabled: false\n    url: \"\"\n    secret_id: \"\"\n    secret_key: \"\"\n"
  },
  {
    "path": "pkg/storage/s3/s3_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage s3\n\n// A StorageOption sets options.\ntype StorageOption interface {\n\tapply(*Storage)\n}\n\n// EmptyStorageUrlOption does not alter the Storageuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyStorageOption struct{}\n\nfunc (EmptyStorageOption) apply(*Storage) {}\n\n// StorageOptionFunc wraps a function that modifies Storage into an\n// implementation of the StorageOption interface.\ntype StorageOptionFunc func(*Storage)\n\nfunc (f StorageOptionFunc) apply(do *Storage) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _StorageOptionWithDefault() StorageOption {\n\treturn StorageOptionFunc(func(*Storage) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Storage) ApplyOptions(options ...StorageOption) *Storage {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/storage/s3/s3_test.go",
    "content": "package s3_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\ts3_ \"github.com/kaydxh/golang/pkg/storage/s3\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc TestS3Upload(t *testing.T) {\n\tcfgFile := \"./s3.yaml\"\n\tconfig := s3_.NewConfig(s3_.WithViper(viper_.GetViper(cfgFile, \"storage.s3\")))\n\n\ts3Bucket, err := config.Complete().New(context.Background())\n\tif err != nil || s3Bucket == nil {\n\t\tt.Fatalf(\"failed to new config err: %v\", err)\n\t}\n\n\ttestCases := []struct {\n\t\tkey  string\n\t\tdata []byte\n\t}{\n\t\t{\n\t\t\tkey:  \"keytest\",\n\t\t\tdata: []byte(\"123\"),\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\terr = s3Bucket.WriteAll(ctx, testCase.key, testCase.data, nil)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to WriteAll, got : %s\", err)\n\t\t\t}\n\t\t})\n\t}\n\n}\n\nfunc TestS3Down(t *testing.T) {\n\tcfgFile := \"./s3.yaml\"\n\tconfig := s3_.NewConfig(s3_.WithViper(viper_.GetViper(cfgFile, \"storage.s3\")))\n\n\ts3Bucket, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Fatalf(\"failed to new config err: %v\", err)\n\t}\n\n\ttestCases := []struct {\n\t\tkey  string\n\t\tdata []byte\n\t}{\n\t\t{\n\t\t\tkey: \"test_data/dongfangmingzhu.jpeg\",\n\t\t},\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tdata, err := s3Bucket.ReadAll(ctx, testCase.key)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to WriteAll, got : %s\", err)\n\t\t\t}\n\t\t\tt.Logf(\"data len: %v\", len(data))\n\t\t})\n\t}\n\n}\n"
  },
  {
    "path": "pkg/viper/code/error.template.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.28.1\n// \tprotoc        v4.24.2\n// source: pkg/viper/code/error.template.proto\n\n// 错误码\n\npackage code\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\t_ \"google.golang.org/protobuf/types/descriptorpb\"\n\treflect \"reflect\"\n\tsync \"sync\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype ErrorTemplate struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tErrorTemplate []*ErrorTemplate_ErrorItem `protobuf:\"bytes,1,rep,name=error_template,json=errorTemplate,proto3\" json:\"error_template,omitempty\"`\n}\n\nfunc (x *ErrorTemplate) Reset() {\n\t*x = ErrorTemplate{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_viper_code_error_template_proto_msgTypes[0]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ErrorTemplate) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ErrorTemplate) ProtoMessage() {}\n\nfunc (x *ErrorTemplate) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_viper_code_error_template_proto_msgTypes[0]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ErrorTemplate.ProtoReflect.Descriptor instead.\nfunc (*ErrorTemplate) Descriptor() ([]byte, []int) {\n\treturn file_pkg_viper_code_error_template_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *ErrorTemplate) GetErrorTemplate() []*ErrorTemplate_ErrorItem {\n\tif x != nil {\n\t\treturn x.ErrorTemplate\n\t}\n\treturn nil\n}\n\ntype ErrorTemplate_ErrorItem struct {\n\tstate         protoimpl.MessageState\n\tsizeCache     protoimpl.SizeCache\n\tunknownFields protoimpl.UnknownFields\n\n\tErrorCode    string            `protobuf:\"bytes,1,opt,name=error_code,json=errorCode,proto3\" json:\"error_code,omitempty\"`\n\tErrorDesc    string            `protobuf:\"bytes,2,opt,name=error_desc,json=errorDesc,proto3\" json:\"error_desc,omitempty\"`\n\tErrorMessage map[string]string `protobuf:\"bytes,3,rep,name=error_message,json=errorMessage,proto3\" json:\"error_message,omitempty\" protobuf_key:\"bytes,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value,proto3\"`\n}\n\nfunc (x *ErrorTemplate_ErrorItem) Reset() {\n\t*x = ErrorTemplate_ErrorItem{}\n\tif protoimpl.UnsafeEnabled {\n\t\tmi := &file_pkg_viper_code_error_template_proto_msgTypes[1]\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tms.StoreMessageInfo(mi)\n\t}\n}\n\nfunc (x *ErrorTemplate_ErrorItem) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ErrorTemplate_ErrorItem) ProtoMessage() {}\n\nfunc (x *ErrorTemplate_ErrorItem) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_viper_code_error_template_proto_msgTypes[1]\n\tif protoimpl.UnsafeEnabled && x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use ErrorTemplate_ErrorItem.ProtoReflect.Descriptor instead.\nfunc (*ErrorTemplate_ErrorItem) Descriptor() ([]byte, []int) {\n\treturn file_pkg_viper_code_error_template_proto_rawDescGZIP(), []int{0, 0}\n}\n\nfunc (x *ErrorTemplate_ErrorItem) GetErrorCode() string {\n\tif x != nil {\n\t\treturn x.ErrorCode\n\t}\n\treturn \"\"\n}\n\nfunc (x *ErrorTemplate_ErrorItem) GetErrorDesc() string {\n\tif x != nil {\n\t\treturn x.ErrorDesc\n\t}\n\treturn \"\"\n}\n\nfunc (x *ErrorTemplate_ErrorItem) GetErrorMessage() map[string]string {\n\tif x != nil {\n\t\treturn x.ErrorMessage\n\t}\n\treturn nil\n}\n\nvar File_pkg_viper_code_error_template_proto protoreflect.FileDescriptor\n\nvar file_pkg_viper_code_error_template_proto_rawDesc = []byte{\n\t0x0a, 0x23, 0x70, 0x6b, 0x67, 0x2f, 0x76, 0x69, 0x70, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65,\n\t0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e,\n\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x76, 0x69,\n\t0x70, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,\n\t0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x02, 0x0a, 0x0d, 0x45,\n\t0x72, 0x72, 0x6f, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x51, 0x0a, 0x0e,\n\t0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01,\n\t0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x76, 0x69,\n\t0x70, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x65,\n\t0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x74, 0x65, 0x6d,\n\t0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x1a,\n\t0xed, 0x01, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1d, 0x0a,\n\t0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,\n\t0x09, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a,\n\t0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,\n\t0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x65, 0x73, 0x63, 0x12, 0x61, 0x0a, 0x0d, 0x65,\n\t0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03,\n\t0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x76, 0x69, 0x70, 0x65,\n\t0x72, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x65, 0x6d, 0x70,\n\t0x6c, 0x61, 0x74, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x45,\n\t0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79,\n\t0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x3f,\n\t0x0a, 0x11, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e,\n\t0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,\n\t0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,\n\t0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42,\n\t0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61,\n\t0x79, 0x64, 0x78, 0x68, 0x2f, 0x67, 0x6f, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x76, 0x69, 0x70, 0x65,\n\t0x72, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x3b, 0x63, 0x6f, 0x64, 0x65,\n\t0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n}\n\nvar (\n\tfile_pkg_viper_code_error_template_proto_rawDescOnce sync.Once\n\tfile_pkg_viper_code_error_template_proto_rawDescData = file_pkg_viper_code_error_template_proto_rawDesc\n)\n\nfunc file_pkg_viper_code_error_template_proto_rawDescGZIP() []byte {\n\tfile_pkg_viper_code_error_template_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_viper_code_error_template_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_viper_code_error_template_proto_rawDescData)\n\t})\n\treturn file_pkg_viper_code_error_template_proto_rawDescData\n}\n\nvar file_pkg_viper_code_error_template_proto_msgTypes = make([]protoimpl.MessageInfo, 3)\nvar file_pkg_viper_code_error_template_proto_goTypes = []interface{}{\n\t(*ErrorTemplate)(nil),           // 0: go.pkg.viper.code.ErrorTemplate\n\t(*ErrorTemplate_ErrorItem)(nil), // 1: go.pkg.viper.code.ErrorTemplate.ErrorItem\n\tnil,                             // 2: go.pkg.viper.code.ErrorTemplate.ErrorItem.ErrorMessageEntry\n}\nvar file_pkg_viper_code_error_template_proto_depIdxs = []int32{\n\t1, // 0: go.pkg.viper.code.ErrorTemplate.error_template:type_name -> go.pkg.viper.code.ErrorTemplate.ErrorItem\n\t2, // 1: go.pkg.viper.code.ErrorTemplate.ErrorItem.error_message:type_name -> go.pkg.viper.code.ErrorTemplate.ErrorItem.ErrorMessageEntry\n\t2, // [2:2] is the sub-list for method output_type\n\t2, // [2:2] is the sub-list for method input_type\n\t2, // [2:2] is the sub-list for extension type_name\n\t2, // [2:2] is the sub-list for extension extendee\n\t0, // [0:2] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_viper_code_error_template_proto_init() }\nfunc file_pkg_viper_code_error_template_proto_init() {\n\tif File_pkg_viper_code_error_template_proto != nil {\n\t\treturn\n\t}\n\tif !protoimpl.UnsafeEnabled {\n\t\tfile_pkg_viper_code_error_template_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ErrorTemplate); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tfile_pkg_viper_code_error_template_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {\n\t\t\tswitch v := v.(*ErrorTemplate_ErrorItem); i {\n\t\t\tcase 0:\n\t\t\t\treturn &v.state\n\t\t\tcase 1:\n\t\t\t\treturn &v.sizeCache\n\t\t\tcase 2:\n\t\t\t\treturn &v.unknownFields\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: file_pkg_viper_code_error_template_proto_rawDesc,\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   3,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_viper_code_error_template_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_viper_code_error_template_proto_depIdxs,\n\t\tMessageInfos:      file_pkg_viper_code_error_template_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_viper_code_error_template_proto = out.File\n\tfile_pkg_viper_code_error_template_proto_rawDesc = nil\n\tfile_pkg_viper_code_error_template_proto_goTypes = nil\n\tfile_pkg_viper_code_error_template_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/viper/code/error.template.proto",
    "content": "syntax = \"proto3\";\n\n// 错误码\npackage go.pkg.viper.code;\nimport \"google/protobuf/descriptor.proto\";\n// import \"github.com/googleapis/googleapis/google/rpc/code.proto\";\n\noption go_package = \"github.com/kaydxh/go.pkg.viper.code/code;code\";\n\nmessage ErrorTemplate {\n  repeated ErrorItem error_template = 1;\n\n  message ErrorItem {\n    string error_code = 1;\n    string error_desc = 2;\n    map<string, string> error_message = 3;\n  }\n}\n\n"
  },
  {
    "path": "pkg/viper/error.yaml",
    "content": "error_template:\n  - error_code: InternalError.DeadlineExceeded\n    error_desc: #\n    error_message:\n      zh: 内部错误，超出请求时限\n      en: Internal error, deadline exceeded\n"
  },
  {
    "path": "pkg/viper/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/viper\n\ngo 1.24.0\n\nrequire (\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-00010101000000-000000000000\n\tgithub.com/spf13/viper v1.21.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-gonic/gin v1.11.0 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-playground/validator/v10 v10.28.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/golang/protobuf v1.5.4 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/grpc v1.77.0 // indirect\n)\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n"
  },
  {
    "path": "pkg/viper/go.sum",
    "content": "github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "pkg/viper/unmarshaler.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage viper\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n\n\tmapstructure \"github.com/go-viper/mapstructure/v2\"\n\tjsonpb_ \"github.com/kaydxh/golang/pkg/protobuf/jsonpb\"\n\t\"github.com/spf13/viper\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\nfunc UnmarshalProtoMessageWithJsonPb(v *viper.Viper, msg proto.Message, options ...viper.DecoderConfigOption) error {\n\tif v == nil {\n\t\treturn fmt.Errorf(\"viper is nil\")\n\t}\n\n\tvar opts []viper.DecoderConfigOption\n\topts = append(opts, func(decoderConfig *mapstructure.DecoderConfig) {\n\t\tdecoderConfig.TagName = \"json\" // trick of protobuf, which generates json tag only\n\t\tdecoderConfig.WeaklyTypedInput = true\n\t\tdecoderConfig.DecodeHook = UnmarshalProtoMessageWithJsonpbHookFunc(msg)\n\t})\n\topts = append(opts, options...)\n\treturn v.Unmarshal(msg, opts...)\n}\n\nfunc UnmarshalProtoMessageWithJsonpbHookFunc(v proto.Message) mapstructure.DecodeHookFunc {\n\treturn func(src reflect.Type, dst reflect.Type, data interface{}) (interface{}, error) {\n\t\t// Convert it by parsing\n\t\tdataBytes, err := json.Marshal(data)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\terr = jsonpb_.UnmarshalWithAllowUnknownFields(dataBytes, v)\n\t\tif err != nil {\n\t\t\treturn data, err\n\t\t}\n\n\t\treturn v, nil\n\t}\n}\n"
  },
  {
    "path": "pkg/viper/viper.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage viper\n\nimport (\n\t\"strings\"\n\n\t\"github.com/spf13/viper\"\n)\n\n// keys delim with dot(.), eg: \"database.mysql\"\nfunc GetViper(configFile string, subKeys string) *viper.Viper {\n\tif configFile == \"\" {\n\t\tv := viper.GetViper()\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn v\n\t}\n\n\tviper.SetConfigFile(configFile)\n\terr := viper.ReadInConfig()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tif subKeys == \"\" {\n\t\treturn viper.GetViper()\n\t}\n\n\tv := viper.GetViper()\n\tkeys := strings.Split(subKeys, \".\")\n\n\tfor _, k := range keys {\n\t\tv = v.Sub(k)\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn v\n}\n\nfunc GetNewViper(configFile string, subKeys string) *viper.Viper {\n\tif configFile == \"\" {\n\t\treturn nil\n\t}\n\n\tviperNew := viper.New()\n\tviperNew.SetConfigFile(configFile)\n\terr := viperNew.ReadInConfig()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tif subKeys == \"\" {\n\t\treturn viperNew\n\t}\n\n\tv := viperNew\n\tkeys := strings.Split(subKeys, \".\")\n\n\tfor _, k := range keys {\n\t\tv = v.Sub(k)\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn v\n}\n"
  },
  {
    "path": "pkg/viper/viper_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage viper_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"github.com/kaydxh/golang/pkg/viper/code\"\n)\n\nfunc TestViper(t *testing.T) {\n\tv := viper_.GetViper(\"./error.yaml\", \"\")\n\tvar ErrorTemplateConfig code.ErrorTemplate\n\terr := viper_.UnmarshalProtoMessageWithJsonPb(v, &ErrorTemplateConfig)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfmt.Printf(\"ErrorTemplateConfig: %v\\n\", ErrorTemplateConfig.String())\n\n}\n"
  },
  {
    "path": "pkg/webserver/app/cmd.go",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage app\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/spf13/cobra\"\n)\n\n// NewSeaDateCommand creates a *cobra.Command object with default parameters\nfunc NewCommand(ctx context.Context, runCommand func(ctx context.Context, cmd *cobra.Command) error) *cobra.Command {\n\tname := GetVersion().AppName\n\tcmd := &cobra.Command{\n\t\tUse:   name,\n\t\tShort: fmt.Sprintf(\"%s Public HTTP/2 and GRPC APIs\", name),\n\t\t// stop printing usage when the command errors\n\t\tLong: fmt.Sprintf(`%s is a gateway serve which you can use curl over HTTP 1.1 or grpc protocal on the same host:port.\nExample: curl -X POST -k https://localhost:port/healthz\nSee [Sea](https://github.com/kaydxh/sea/blob/master/README.md) for more information.`, name),\n\t\t//SilenceUsage: true,\n\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn runCommand(ctx, cmd)\n\t\t},\n\n\t\tPostRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tfmt.Printf(\"server exit\")\n\t\t\treturn nil\n\t\t},\n\n\t\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\t\tfor _, arg := range args {\n\t\t\t\tif len(arg) > 0 {\n\t\t\t\t\t//%q a single-quoted character literal safely escaped with Go syntax\n\t\t\t\t\treturn fmt.Errorf(\"%q does not take any arguments, got %q\", cmd.CommandPath(), args)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tappFlag := NewAppFlags(cmd)\n\tappFlag.Install()\n\treturn cmd\n}\n"
  },
  {
    "path": "pkg/webserver/app/flags.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage app\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\tflag_ \"github.com/kaydxh/golang/go/flag\"\n\tterm_ \"github.com/kaydxh/golang/go/os/term\"\n\t\"github.com/spf13/cobra\"\n)\n\n// defaultConfigPath returns config file's default path\nfunc defaultConfigPath() string {\n\treturn fmt.Sprintf(\"./conf/%s.yaml\", filepath.Base(os.Args[0]))\n}\n\nfunc defaultUseConfigPath() string {\n\treturn fmt.Sprintf(\n\t\tfilepath.Join(filepath.Dir(defaultConfigPath()), \".use.%s.yaml\"), filepath.Base(os.Args[0]),\n\t)\n}\n\ntype AppFlags struct {\n\tConfigFile    string\n\tUseConfigFile string\n\tcmd           *cobra.Command\n\tflags         flag_.NamedFlagSets\n}\n\n//  NewAppFlags if cmd is nil, then use default cobra.Command\nfunc NewAppFlags(cmd *cobra.Command) *AppFlags {\n\tappFlags := &AppFlags{\n\t\tConfigFile:    defaultConfigPath(),\n\t\tUseConfigFile: defaultUseConfigPath(),\n\t\tcmd:           cmd,\n\t}\n\n\tif appFlags.cmd == nil {\n\t\tappFlags.cmd = &cobra.Command{}\n\t}\n\n\tappFlags.initFlags()\n\treturn appFlags\n}\n\nfunc (f *AppFlags) Apply() {\n\tfs := f.cmd.Flags()\n\tfor _, flag := range f.flags.FlagSets {\n\t\tfs.AddFlagSet(flag)\n\t}\n}\n\n/*\nfunc (f *AppFlags) AddFlags(mainfs *pflag.FlagSet) {\n\tfs := pflag.NewFlagSet(\"\", pflag.ExitOnError)\n\tfs.StringVar(&f.SeaConfigFile, \"config\", f.SeaConfigFile, \"sea config file\")\n}\n*/\n\nfunc (f *AppFlags) initFlags() {\n\n\tfs := f.flags.FlagSet(\"misc\")\n\tfs.StringVarP(&f.ConfigFile, \"config\", \"c\", f.ConfigFile, \"The path to the configuration file.\")\n\tfs.StringVar(\n\t\t&f.UseConfigFile,\n\t\t\"use-config\",\n\t\tf.UseConfigFile,\n\t\t\"If set, write the configuration values to this file and exit.\",\n\t)\n\n}\n\nfunc (f *AppFlags) SetUsageAndHelpFunc() {\n\tcols, _, _ := term_.TerminalSize(f.cmd.OutOrStdout())\n\tflag_.SetUsageAndHelpFunc(f.cmd, f.flags, cols)\n}\n\nfunc (f *AppFlags) Install() {\n\tf.SetUsageAndHelpFunc()\n\tf.Apply()\n}\n"
  },
  {
    "path": "pkg/webserver/app/version.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage app\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n)\n\ntype Version struct {\n\tGitVersion   string `json:\"gitVersion\"`\n\tGitCommit    string `json:\"gitCommit\"`\n\tGitTreeState string `json:\"gitTreeState\"`\n\tBuildDate    string `json:\"buildDate\"`\n\tGoVersion    string `json:\"goVersion\"`\n\tCompiler     string `json:\"compiler\"`\n\tPlatform     string `json:\"platform\"`\n\tAppName      string `json:\"appName\"`\n}\n\nvar (\n\t// semantic version, derived by build scripts (see\n\t// https://git.k8s.io/community/contributors/design-proposals/release/versioning.md\n\t// for a detailed discussion of this field)\n\t//\n\t// TODO: This field is still called \"gitVersion\" for legacy\n\t// reasons. For prerelease versions, the build metadata on the\n\t// semantic version is a git hash, but the version itself is no\n\t// longer the direct output of \"git describe\", but a slight\n\t// translation to be semver compliant.\n\n\t// NOTE: The $Format strings are replaced during 'git archive' thanks to the\n\t// companion .gitattributes file containing 'export-subst' in this same\n\t// directory.  See also https://git-scm.com/docs/gitattributes\n\tgitVersion   string = \"v0.0.0-master+$Format:%H$\"\n\tgitCommit    string = \"$Format:%H$\" // sha1 from git, output of $(git rev-parse HEAD)\n\tgitTreeState string = \"\"            // state of git tree, either \"clean\" or \"dirty\"\n\n\tbuildDate string = \"1970-01-01T00:00:00Z\" // build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ')\n\tappName   string = \"\"                     // app name\n)\n\nfunc GetVersion() Version {\n\t// These variables typically come from -ldflags settings and in\n\t// their absence fallback to the settings in pkg/version/base.go\n\treturn Version{\n\t\tGitVersion:   gitVersion,\n\t\tGitCommit:    gitCommit,\n\t\tGitTreeState: gitTreeState,\n\t\tBuildDate:    buildDate,\n\t\tGoVersion:    runtime.Version(),\n\t\tCompiler:     runtime.Compiler,\n\t\tPlatform:     fmt.Sprintf(\"%s/%s\", runtime.GOOS, runtime.GOARCH),\n\t\tAppName:      appName,\n\t}\n}\n"
  },
  {
    "path": "pkg/webserver/config.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage webserver\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math\"\n\t\"time\"\n\n\t\"github.com/gin-gonic/gin\"\n\t\"github.com/go-playground/validator/v10\"\n\n\t//\tinterceptorratetimer_ \"github.com/kaydxh/golang/pkg/middleware/grpc-middleware/timer\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\t\"google.golang.org/grpc\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\tgw_ \"github.com/kaydxh/golang/pkg/grpc-gateway\"\n\thealthz_ \"github.com/kaydxh/golang/pkg/webserver/controller/healthz\"\n\tprofiler_ \"github.com/kaydxh/golang/pkg/webserver/controller/profiler\"\n\t\"github.com/spf13/viper\"\n)\n\nconst (\n\tdefaultBindAddress             = \":80\"\n\tdefaultExternalAddress         = \":80\"\n\tdefaultShutdownDelayDuration   = time.Duration(0)\n\tdefaultShutdownTimeoutDuration = 5 * time.Second\n\n\tdefaultMaxReceiveMessageSize = math.MaxInt32\n\tdefaultMaxSendMessageSize    = math.MaxInt32\n)\n\ntype Config struct {\n\tProto     Web\n\tValidator *validator.Validate\n\topts      struct {\n\t\t// If set, overrides params below\n\t\tviper       *viper.Viper\n\t\tbindAddress string\n\t\t// ExternalAddress is the address (hostname or IP and port) that should be used in\n\t\t// external (public internet) URLs for this GenericWebServer.\n\t\texternalAddress string\n\t\t// ShutdownDelayDuration allows to block shutdown for some time, e.g. until endpoints pointing to this API server\n\t\t// have converged on all node. During this time, the API server keeps serving, /healthz will return 200,\n\t\t// but /readyz will return failure.\n\t\tshutdownDelayDuration time.Duration\n\t\t//shutdownTimeoutDuration force shutdonw server after some time\n\t\tshutdownTimeoutDuration time.Duration\n\t\tgatewayOptions          []gw_.GRPCGatewayOption\n\t\t// QPS限流配置（扩展配置，不依赖proto）\n\t\tgrpcQPSLimit *QPSLimitConfig\n\t\thttpQPSLimit *QPSLimitConfig\n\t\t// healthz 控制器选项\n\t\thealthzOptions []healthz_.ControllerOption\n\t}\n}\n\ntype completedConfig struct {\n\t*Config\n\tcompleteError error\n}\n\ntype CompletedConfig struct {\n\t// Embed a private pointer that cannot be instantiated outside of this package.\n\t*completedConfig\n}\n\n// Validate checks Config.\nfunc (c *completedConfig) Validate() error {\n\treturn c.Validator.Struct(c)\n}\n\nfunc (c *completedConfig) New(ctx context.Context, opts ...gw_.GRPCGatewayOption) (*GenericWebServer, error) {\n\tif c.completeError != nil {\n\t\treturn nil, c.completeError\n\t}\n\terr := c.Validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c.install(ctx, opts...)\n}\n\nfunc (c *completedConfig) install(ctx context.Context, opts ...gw_.GRPCGatewayOption) (*GenericWebServer, error) {\n\tc.Config.opts.gatewayOptions = append(c.Config.opts.gatewayOptions, c.installGrpcMessageSizeOptions()...)\n\tc.Config.opts.gatewayOptions = append(c.Config.opts.gatewayOptions, c.installHttpMiddlewareChain()...)\n\tc.Config.opts.gatewayOptions = append(c.Config.opts.gatewayOptions, c.installGrpcMiddlewareChain()...)\n\n\t//append opts...\n\tc.Config.opts.gatewayOptions = append(c.Config.opts.gatewayOptions, opts...)\n\tgrpcBackend := gw_.NewGRPCGateWay(c.opts.bindAddress, c.Config.opts.gatewayOptions...)\n\t//grpcBackend.ApplyOptions()\n\tgin.SetMode(gin.ReleaseMode)\n\tginBackend := gin.New()\n\tfmt.Printf(\" - listen address[%s]\\n\", c.opts.bindAddress)\n\n\tws := &GenericWebServer{\n\t\tginBackend:        ginBackend,\n\t\tgrpcBackend:       grpcBackend,\n\t\tHealthzController: healthz_.NewController(c.Config.opts.healthzOptions...),\n\t\tpostStartHooks:    map[string]postStartHookEntry{},\n\t\tpreShutdownHooks:  map[string]preShutdownHookEntry{},\n\t\treadinessStopCh:   make(chan struct{}),\n\t}\n\n\tvar errs []error\n\tif c.Proto.GetDebug().GetEnableProfiling() {\n\t\tfmt.Printf(\"- install debug handler\")\n\t\tws.InstallWebHandlers(profiler_.NewController())\n\t}\n\terr := c.installDefaultHander(ws)\n\tif err != nil {\n\t\terrs = append(errs, err)\n\t}\n\n\treturn ws, errors_.NewAggregate(errs)\n}\n\nfunc (c *completedConfig) installDefaultHander(ws *GenericWebServer) error {\n\tws.InstallWebHandlers(ws.HealthzController)\n\treturn nil\n}\n\n// Complete set default ServerRunOptions.\nfunc (c *Config) Complete() CompletedConfig {\n\terr := c.loadViper()\n\tif err != nil {\n\t\treturn CompletedConfig{&completedConfig{\n\t\t\tConfig:        c,\n\t\t\tcompleteError: err,\n\t\t}}\n\t}\n\tc.parseViper()\n\n\tif c.Validator == nil {\n\t\tc.Validator = validator.New()\n\t}\n\n\treturn CompletedConfig{&completedConfig{Config: c}}\n}\n\nfunc (c *Config) installGrpcMessageSizeOptions() []gw_.GRPCGatewayOption {\n\tmaxRecvMsgSize := defaultMaxReceiveMessageSize\n\tmaxSendMsgSize := defaultMaxSendMessageSize\n\n\tvar opts []gw_.GRPCGatewayOption\n\t// request\n\t// http -> grpc client -> grpc server\n\t// ---------------------------------  -> gin server\n\tif c.Proto.GetGrpc().GetMaxReceiveMessageSize() > 0 {\n\n\t\tmaxRecvMsgSize = int(c.Proto.GetGrpc().GetMaxReceiveMessageSize())\n\t}\n\topts = append(\n\t\topts,\n\t\tgw_.WithServerOptions(grpc.MaxRecvMsgSize(maxRecvMsgSize)),\n\t)\n\topts = append(\n\t\topts,\n\t\tgw_.WithClientDialOptions(\n\t\t\tgrpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(maxRecvMsgSize)),\n\t\t),\n\t)\n\n\t// response\n\t// http <- grpc client <- grpc server\n\tif c.Proto.GetGrpc().GetMaxSendMessageSize() > 0 {\n\t\tmaxSendMsgSize = int(c.Proto.GetGrpc().GetMaxSendMessageSize())\n\t}\n\topts = append(\n\t\topts,\n\t\tgw_.WithServerOptions(grpc.MaxSendMsgSize(maxSendMsgSize)),\n\t)\n\topts = append(\n\t\topts,\n\t\tgw_.WithClientDialOptions(grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxSendMsgSize))),\n\t)\n\n\treturn opts\n}\n\n// use LocalMiddlewareWrap instead of request id, metric, cost time, print request and response middleware\nfunc (c *Config) installHttpMiddlewareChain() []gw_.GRPCGatewayOption {\n\n\thttpConfig := c.Proto.GetHttp()\n\tvar opts []gw_.GRPCGatewayOption\n\topts = append(\n\t\topts,\n\t\t// request id and trace id\n\t\tgw_.WithHttpHandlerInterceptorRequestIDAndTraceIDOptions(),\n\n\t\t// http recoverer\n\t\tgw_.WithHttpHandlerInterceptorRecoveryOptions(),\n\n\t\t// clean path\n\t\t// gw_.WithHttpHandlerInterceptorCleanPathOptions(),\n\n\t\t// http body proto\n\t\tgw_.WithServerInterceptorsHttpBodyProtoOptions(),\n\n\t\t// OpenTelemetry trace interceptor for HTTP\n\t\tgw_.WithHttpHandlerInterceptorsTraceOptions(),\n\n\t\tgw_.WithHttpHandlerInterceptorsTimerOptions(),\n\n\t\t// http metric (total req, fail req, cost time, error code)\n\t\tgw_.WithHttpHandlerInterceptorsMetricOptions(),\n\t)\n\n\t// QPS限流和并发控制（通过扩展配置）\n\tif c.opts.httpQPSLimit != nil {\n\t\topts = append(opts, gw_.WithHttpHandlerInterceptorsQPSLimitOptions(\n\t\t\tc.opts.httpQPSLimit.ToHTTPQPSLimitConfig(),\n\t\t))\n\t}\n\n\t//options\n\t/*\n\t\tdifferent api formatter return http error response:\n\t\t\texamples:\n\t\t\t Web_Http_tcloud_api_v30:\n\t\t\t  {\n\t\t\t\t\"Response\": {\n\t\t\t\t\t\"Error\": {\n\t\t\t\t\t\t\"Code\": \"InvalidArgument\",\n\t\t\t\t\t\t\"Message\": \"InvalidArgument\"\n\t\t\t\t\t},\n\t\t\t\t\t\"RequestId\": \"22679249-b2e5-4970-8f55-3b5a31e70eb4\"\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tWeb_Http_trivial_api_v10:\n\t\t\t{\n\t\t\t\t\"errorcode\": 3,\n\t\t\t\t\"errormsg\": \"InvalidArgument\",\n\t\t\t\t\"session_id\": \"efd82a7e-cb2f-4bd6-8bf2-d357fb4e1032\"\n\t\t\t}\n\n\t\t\tWeb_Http_trivial_api_v20:\n\t\t\t{\n\t\t\t\t\"Error\": {\n\t\t\t\t\t\"Code\": \"InvalidArgument\",\n\t\t\t\t\t\"Message\": \"InvalidArgument\"\n\t\t\t\t},\n\t\t\t\t\"RequestId\": \"96755708-9561-45b8-9bb7-da0bf777f155\"\n\t\t\t}\n\n\t\t\tWeb_Http_api_noop : {\"code\":3,\"message\":\"InvalidArgument\",\"details\":[]}\n\t*/\n\tswitch httpConfig.GetApiFormatter() {\n\tcase Web_Http_tcloud_api_v30:\n\t\topts = append(opts,\n\t\t\tgw_.WithServerInterceptorsTCloud30HTTPResponseOptions(),\n\t\t\tgw_.WithServerInterceptorsTCloud30HttpErrorOptions(),\n\t\t)\n\tcase Web_Http_trivial_api_v10:\n\t\topts = append(opts,\n\t\t\tgw_.WithServerInterceptorsTrivialV1HTTPResponseOptions(),\n\t\t\tgw_.WithServerInterceptorsTrivialV1HttpErrorOptions(),\n\t\t)\n\tcase Web_Http_trivial_api_v20:\n\t\topts = append(opts,\n\t\t\tgw_.WithServerInterceptorsTrivialV2HTTPResponseOptions(),\n\t\t\tgw_.WithServerInterceptorsTrivialV2HttpErrorOptions(),\n\t\t)\n\n\tdefault:\n\t}\n\n\treturn opts\n}\n\nfunc (c *Config) installGrpcMiddlewareChain() []gw_.GRPCGatewayOption {\n\tvar opts []gw_.GRPCGatewayOption\n\topts = append(\n\t\topts,\n\n\t\t// requestId\n\t\tgw_.WithServerUnaryInterceptorsRequestIdOptions(),\n\n\t\t// recovery\n\t\tgw_.WithServerInterceptorsRecoveryOptions(),\n\n\t\t// OpenTelemetry trace interceptor\n\t\tgw_.WithServerUnaryTraceInterceptorOptions(),\n\n\t\t// total req, fail req, cost time metrics, errorcode ip dims\n\t\tgw_.WithServerUnaryMetricInterceptorOptions(),\n\n\t\t// print input and output body\n\t\tgw_.WithServerUnaryInterceptorsInOutPacketOptions(),\n\t\t//gw_.WithServerInterceptorTimeoutOptions(grpcConfig.GetTimeout().AsDuration()),\n\t)\n\n\t// QPS限流和并发控制（通过扩展配置）\n\tif c.opts.grpcQPSLimit != nil {\n\t\topts = append(opts, gw_.WithServerInterceptorsQPSLimitOptions(\n\t\t\tc.opts.grpcQPSLimit.ToGRPCQPSLimitConfig(),\n\t\t))\n\t}\n\n\treturn opts\n}\n\nfunc (c *Config) WithWebConfigOptions(opts ...ConfigOption) {\n\tc.ApplyOptions(opts...)\n}\n\nfunc (c *Config) AppendGRPCGatewayOptions(opts ...gw_.GRPCGatewayOption) {\n\tc.opts.gatewayOptions = append(c.opts.gatewayOptions, opts...)\n}\n\nfunc (c *Config) parseViper() {\n\tc.opts.bindAddress = c.Proto.GetBindHostPort()\n}\n\nfunc (c *Config) loadViper() error {\n\tif c.opts.viper != nil {\n\t\treturn viper_.UnmarshalProtoMessageWithJsonPb(c.opts.viper, &c.Proto)\n\t}\n\n\treturn nil\n}\n\nfunc (c *Config) GetBindAddress() string {\n\treturn c.opts.bindAddress\n}\n\n// default bind port 80\nfunc NewConfig(options ...ConfigOption) *Config {\n\tc := &Config{}\n\tc.ApplyOptions(options...)\n\n\tif c.opts.bindAddress == \"\" {\n\t\tc.opts.bindAddress = defaultBindAddress\n\t}\n\n\tif c.opts.externalAddress == \"\" {\n\t\tc.opts.externalAddress = defaultExternalAddress\n\t}\n\n\treturn c\n}\n"
  },
  {
    "path": "pkg/webserver/config.option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage webserver\n\nimport (\n\t\"time\"\n\n\tgw_ \"github.com/kaydxh/golang/pkg/grpc-gateway\"\n\thealthz_ \"github.com/kaydxh/golang/pkg/webserver/controller/healthz\"\n\t\"github.com/spf13/viper\"\n)\n\nfunc WithViper(v *viper.Viper) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.viper = v\n\t})\n}\n\nfunc WithShutdownDelayDuration(shutdownDelayDuration time.Duration) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.shutdownDelayDuration = shutdownDelayDuration\n\t})\n}\n\nfunc WithGRPCGatewayOptions(opts ...gw_.GRPCGatewayOption) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.gatewayOptions = append(c.opts.gatewayOptions, opts...)\n\t})\n}\n\n// WithGRPCQPSLimit 设置gRPC QPS限流配置\nfunc WithGRPCQPSLimit(config *QPSLimitConfig) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.grpcQPSLimit = config\n\t})\n}\n\n// WithHTTPQPSLimit 设置HTTP QPS限流配置\nfunc WithHTTPQPSLimit(config *QPSLimitConfig) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.httpQPSLimit = config\n\t})\n}\n\n// WithQPSLimit 同时设置gRPC和HTTP QPS限流配置\nfunc WithQPSLimit(grpcConfig, httpConfig *QPSLimitConfig) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.grpcQPSLimit = grpcConfig\n\t\tc.opts.httpQPSLimit = httpConfig\n\t})\n}\n\n// WithHealthzOptions 设置 healthz 控制器的选项。\n// 例如：WithHealthzOptions(healthz.WithDisableRootRoute()) 可禁用根路径健康检查，\n// 避免与 SPA 前端的 static 控制器冲突。\nfunc WithHealthzOptions(opts ...healthz_.ControllerOption) ConfigOption {\n\treturn ConfigOptionFunc(func(c *Config) {\n\t\tc.opts.healthzOptions = opts\n\t})\n}\n"
  },
  {
    "path": "pkg/webserver/config_option.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage webserver\n\n// A ConfigOption sets options.\ntype ConfigOption interface {\n\tapply(*Config)\n}\n\n// EmptyConfigOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyConfigOption struct{}\n\nfunc (EmptyConfigOption) apply(*Config) {}\n\n// ConfigOptionFunc wraps a function that modifies Client into an\n// implementation of the ConfigOption interface.\ntype ConfigOptionFunc func(*Config)\n\nfunc (f ConfigOptionFunc) apply(do *Config) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ConfigOptionWithDefault() ConfigOption {\n\treturn ConfigOptionFunc(func(*Config) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Config) ApplyOptions(options ...ConfigOption) *Config {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n"
  },
  {
    "path": "pkg/webserver/controller/healthz/checker.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage healthz\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync\"\n\t\"time\"\n)\n\n// HealthChecker is the interface for health check implementations.\ntype HealthChecker interface {\n\t// Name returns the name of the health check.\n\tName() string\n\t// Check performs the health check and returns an error if unhealthy.\n\tCheck(ctx context.Context) error\n}\n\n// HealthCheckResult represents the result of a single health check.\ntype HealthCheckResult struct {\n\tName    string `json:\"name\"`\n\tHealthy bool   `json:\"healthy\"`\n\tError   string `json:\"error,omitempty\"`\n\tLatency string `json:\"latency,omitempty\"`\n}\n\n// HealthCheckResponse represents the overall health check response.\ntype HealthCheckResponse struct {\n\tStatus    string              `json:\"status\"`\n\tChecks    []HealthCheckResult `json:\"checks,omitempty\"`\n\tTimestamp string              `json:\"timestamp\"`\n}\n\n// PingHealthChecker is a basic health check that always returns healthy.\ntype PingHealthChecker struct{}\n\nfunc (p PingHealthChecker) Name() string {\n\treturn \"ping\"\n}\n\nfunc (p PingHealthChecker) Check(ctx context.Context) error {\n\treturn nil\n}\n\n// HTTPHealthChecker checks the health of an HTTP endpoint.\ntype HTTPHealthChecker struct {\n\tname    string\n\turl     string\n\ttimeout time.Duration\n\tclient  *http.Client\n}\n\n// NewHTTPHealthChecker creates a new HTTP health checker.\nfunc NewHTTPHealthChecker(name, url string, timeout time.Duration) *HTTPHealthChecker {\n\treturn &HTTPHealthChecker{\n\t\tname:    name,\n\t\turl:     url,\n\t\ttimeout: timeout,\n\t\tclient: &http.Client{\n\t\t\tTimeout: timeout,\n\t\t},\n\t}\n}\n\nfunc (h *HTTPHealthChecker) Name() string {\n\treturn h.name\n}\n\nfunc (h *HTTPHealthChecker) Check(ctx context.Context) error {\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, h.url, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create request: %w\", err)\n\t}\n\n\tresp, err := h.client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to connect: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode < 200 || resp.StatusCode >= 300 {\n\t\treturn fmt.Errorf(\"unhealthy status code: %d\", resp.StatusCode)\n\t}\n\n\treturn nil\n}\n\n// TCPHealthChecker checks the health of a TCP endpoint.\ntype TCPHealthChecker struct {\n\tname    string\n\taddr    string\n\ttimeout time.Duration\n}\n\n// NewTCPHealthChecker creates a new TCP health checker.\nfunc NewTCPHealthChecker(name, addr string, timeout time.Duration) *TCPHealthChecker {\n\treturn &TCPHealthChecker{\n\t\tname:    name,\n\t\taddr:    addr,\n\t\ttimeout: timeout,\n\t}\n}\n\nfunc (t *TCPHealthChecker) Name() string {\n\treturn t.name\n}\n\nfunc (t *TCPHealthChecker) Check(ctx context.Context) error {\n\tdialer := &net.Dialer{\n\t\tTimeout: t.timeout,\n\t}\n\n\tconn, err := dialer.DialContext(ctx, \"tcp\", t.addr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to connect to %s: %w\", t.addr, err)\n\t}\n\tdefer conn.Close()\n\n\treturn nil\n}\n\n// FuncHealthChecker wraps a function as a health checker.\ntype FuncHealthChecker struct {\n\tname      string\n\tcheckFunc func(ctx context.Context) error\n}\n\n// NewFuncHealthChecker creates a new function-based health checker.\nfunc NewFuncHealthChecker(name string, checkFunc func(ctx context.Context) error) *FuncHealthChecker {\n\treturn &FuncHealthChecker{\n\t\tname:      name,\n\t\tcheckFunc: checkFunc,\n\t}\n}\n\nfunc (f *FuncHealthChecker) Name() string {\n\treturn f.name\n}\n\nfunc (f *FuncHealthChecker) Check(ctx context.Context) error {\n\tif f.checkFunc == nil {\n\t\treturn nil\n\t}\n\treturn f.checkFunc(ctx)\n}\n\n// CompositeHealthChecker combines multiple health checkers.\ntype CompositeHealthChecker struct {\n\tmu       sync.RWMutex\n\tcheckers []HealthChecker\n}\n\n// NewCompositeHealthChecker creates a new composite health checker.\nfunc NewCompositeHealthChecker(checkers ...HealthChecker) *CompositeHealthChecker {\n\treturn &CompositeHealthChecker{\n\t\tcheckers: checkers,\n\t}\n}\n\n// AddChecker adds a health checker to the composite.\nfunc (c *CompositeHealthChecker) AddChecker(checker HealthChecker) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tc.checkers = append(c.checkers, checker)\n}\n\n// RemoveChecker removes a health checker by name.\nfunc (c *CompositeHealthChecker) RemoveChecker(name string) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\tfor i, checker := range c.checkers {\n\t\tif checker.Name() == name {\n\t\t\tc.checkers = append(c.checkers[:i], c.checkers[i+1:]...)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// Check performs all health checks and returns an error if any fails.\nfunc (c *CompositeHealthChecker) Check(ctx context.Context) error {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\n\tfor _, checker := range c.checkers {\n\t\tif err := checker.Check(ctx); err != nil {\n\t\t\treturn fmt.Errorf(\"%s: %w\", checker.Name(), err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// CheckAll performs all health checks and returns detailed results.\nfunc (c *CompositeHealthChecker) CheckAll(ctx context.Context) ([]HealthCheckResult, bool) {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\n\tresults := make([]HealthCheckResult, 0, len(c.checkers))\n\tallHealthy := true\n\n\tfor _, checker := range c.checkers {\n\t\tstart := time.Now()\n\t\terr := checker.Check(ctx)\n\t\tlatency := time.Since(start)\n\n\t\tresult := HealthCheckResult{\n\t\t\tName:    checker.Name(),\n\t\t\tHealthy: err == nil,\n\t\t\tLatency: latency.String(),\n\t\t}\n\n\t\tif err != nil {\n\t\t\tresult.Error = err.Error()\n\t\t\tallHealthy = false\n\t\t}\n\n\t\tresults = append(results, result)\n\t}\n\n\treturn results, allHealthy\n}\n\n// Checkers returns a copy of the registered checkers.\nfunc (c *CompositeHealthChecker) Checkers() []HealthChecker {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\n\tcheckers := make([]HealthChecker, len(c.checkers))\n\tcopy(checkers, c.checkers)\n\treturn checkers\n}\n"
  },
  {
    "path": "pkg/webserver/controller/healthz/healthz.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage healthz\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/gin-gonic/gin\"\n\tgw_ \"github.com/kaydxh/golang/pkg/grpc-gateway\"\n)\n\nconst (\n\tdefaultCheckTimeout = 10 * time.Second\n)\n\n// Controller handles health check endpoints.\n// Supports Kubernetes-style /healthz, /livez, /readyz endpoints.\ntype Controller struct {\n\t// livezCheckers are used for liveness checks.\n\t// Liveness probes determine if the application is running.\n\tlivezCheckers *CompositeHealthChecker\n\n\t// readyzCheckers are used for readiness checks.\n\t// Readiness probes determine if the application is ready to receive traffic.\n\treadyzCheckers *CompositeHealthChecker\n\n\t// ready indicates if the server is ready to receive traffic.\n\t// This is set to false during shutdown.\n\tready atomic.Bool\n\n\t// checkTimeout is the timeout for health checks.\n\tcheckTimeout time.Duration\n\n\t// disableRootRoute 是否禁用根路径 \"/\" 的健康检查路由注册。\n\t// 当项目使用 SPA 前端（static 控制器的 SPAMode=true）时，应设为 true，\n\t// 避免与 static 控制器的 GET \"/\" 路由冲突。\n\t// 禁用后，负载均衡器应使用 /healthz 或 /livez 进行健康探测。\n\tdisableRootRoute bool\n}\n\n// ControllerOption is a functional option for Controller.\ntype ControllerOption func(*Controller)\n\n// WithCheckTimeout sets the timeout for health checks.\nfunc WithCheckTimeout(timeout time.Duration) ControllerOption {\n\treturn func(c *Controller) {\n\t\tc.checkTimeout = timeout\n\t}\n}\n\n// WithLivezCheckers sets the liveness checkers.\nfunc WithLivezCheckers(checkers ...HealthChecker) ControllerOption {\n\treturn func(c *Controller) {\n\t\tfor _, checker := range checkers {\n\t\t\tc.livezCheckers.AddChecker(checker)\n\t\t}\n\t}\n}\n\n// WithReadyzCheckers sets the readiness checkers.\nfunc WithReadyzCheckers(checkers ...HealthChecker) ControllerOption {\n\treturn func(c *Controller) {\n\t\tfor _, checker := range checkers {\n\t\t\tc.readyzCheckers.AddChecker(checker)\n\t\t}\n\t}\n}\n\n// WithDisableRootRoute 禁用根路径 \"/\" 的健康检查路由。\n// 当项目使用 SPA 前端时，根路径应由 static 控制器处理（返回 index.html），\n// 而非返回健康检查结果。负载均衡器应改用 /healthz 或 /livez 进行探测。\nfunc WithDisableRootRoute() ControllerOption {\n\treturn func(c *Controller) {\n\t\tc.disableRootRoute = true\n\t}\n}\n\n// NewController creates a new health check controller.\nfunc NewController(opts ...ControllerOption) *Controller {\n\tc := &Controller{\n\t\tlivezCheckers:  NewCompositeHealthChecker(PingHealthChecker{}),\n\t\treadyzCheckers: NewCompositeHealthChecker(PingHealthChecker{}),\n\t\tcheckTimeout:   defaultCheckTimeout,\n\t}\n\tc.ready.Store(true)\n\n\tfor _, opt := range opts {\n\t\topt(c)\n\t}\n\n\treturn c\n}\n\n// SetRoutes registers health check endpoints.\nfunc (c *Controller) SetRoutes(ginRouter gin.IRouter, grpcRouter *gw_.GRPCGateway) {\n\t// / - root path health check for load balancer probes (supports GET and HEAD)\n\t// 当 disableRootRoute=true 时跳过，避免与 SPA 前端的 static 控制器冲突。\n\tif !c.disableRootRoute {\n\t\tginRouter.GET(\"/\", c.RootHealthz())\n\t\tginRouter.HEAD(\"/\", c.RootHealthz())\n\t}\n\n\t// /healthz - general health check (combines livez and readyz)\n\tginRouter.GET(\"/healthz\", c.Healthz())\n\n\t// /livez - liveness probe\n\t// Returns 200 if the application is alive\n\tginRouter.GET(\"/livez\", c.Livez())\n\n\t// /readyz - readiness probe\n\t// Returns 200 if the application is ready to receive traffic\n\tginRouter.GET(\"/readyz\", c.Readyz())\n\n\t// /healthz/verbose - detailed health check with all checker results\n\tginRouter.GET(\"/healthz/verbose\", c.HealthzVerbose())\n\n\t// /livez/verbose - detailed liveness check\n\tginRouter.GET(\"/livez/verbose\", c.LivezVerbose())\n\n\t// /readyz/verbose - detailed readiness check\n\tginRouter.GET(\"/readyz/verbose\", c.ReadyzVerbose())\n}\n\n// RootHealthz returns a handler for the root path \"/\" endpoint.\n// This is a lightweight health check designed for load balancer probes\n// that send HEAD or GET requests to the root path.\nfunc (c *Controller) RootHealthz() gin.HandlerFunc {\n\treturn func(ctx *gin.Context) {\n\t\tif !c.ready.Load() {\n\t\t\tctx.Status(http.StatusServiceUnavailable)\n\t\t\treturn\n\t\t}\n\t\tctx.String(http.StatusOK, \"ok\")\n\t}\n}\n\n// Healthz returns a handler for the /healthz endpoint.\n// It combines liveness and readiness checks.\nfunc (c *Controller) Healthz() gin.HandlerFunc {\n\treturn func(ctx *gin.Context) {\n\t\tcheckCtx, cancel := context.WithTimeout(ctx.Request.Context(), c.checkTimeout)\n\t\tdefer cancel()\n\n\t\t// Check liveness\n\t\tif err := c.livezCheckers.Check(checkCtx); err != nil {\n\t\t\tctx.JSON(http.StatusServiceUnavailable, gin.H{\n\t\t\t\t\"status\": \"unhealthy\",\n\t\t\t\t\"type\":   \"livez\",\n\t\t\t\t\"error\":  err.Error(),\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\t// Check readiness\n\t\tif !c.ready.Load() {\n\t\t\tctx.JSON(http.StatusServiceUnavailable, gin.H{\n\t\t\t\t\"status\": \"not ready\",\n\t\t\t\t\"type\":   \"readyz\",\n\t\t\t\t\"error\":  \"server is shutting down\",\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\tif err := c.readyzCheckers.Check(checkCtx); err != nil {\n\t\t\tctx.JSON(http.StatusServiceUnavailable, gin.H{\n\t\t\t\t\"status\": \"not ready\",\n\t\t\t\t\"type\":   \"readyz\",\n\t\t\t\t\"error\":  err.Error(),\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\tctx.String(http.StatusOK, \"ok\")\n\t}\n}\n\n// Livez returns a handler for the /livez endpoint.\nfunc (c *Controller) Livez() gin.HandlerFunc {\n\treturn func(ctx *gin.Context) {\n\t\tcheckCtx, cancel := context.WithTimeout(ctx.Request.Context(), c.checkTimeout)\n\t\tdefer cancel()\n\n\t\tif err := c.livezCheckers.Check(checkCtx); err != nil {\n\t\t\tctx.JSON(http.StatusServiceUnavailable, gin.H{\n\t\t\t\t\"status\": \"unhealthy\",\n\t\t\t\t\"error\":  err.Error(),\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\tctx.String(http.StatusOK, \"ok\")\n\t}\n}\n\n// Readyz returns a handler for the /readyz endpoint.\nfunc (c *Controller) Readyz() gin.HandlerFunc {\n\treturn func(ctx *gin.Context) {\n\t\t// Check if server is marked as not ready (e.g., during shutdown)\n\t\tif !c.ready.Load() {\n\t\t\tctx.JSON(http.StatusServiceUnavailable, gin.H{\n\t\t\t\t\"status\": \"not ready\",\n\t\t\t\t\"error\":  \"server is shutting down\",\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\tcheckCtx, cancel := context.WithTimeout(ctx.Request.Context(), c.checkTimeout)\n\t\tdefer cancel()\n\n\t\tif err := c.readyzCheckers.Check(checkCtx); err != nil {\n\t\t\tctx.JSON(http.StatusServiceUnavailable, gin.H{\n\t\t\t\t\"status\": \"not ready\",\n\t\t\t\t\"error\":  err.Error(),\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\tctx.String(http.StatusOK, \"ok\")\n\t}\n}\n\n// HealthzVerbose returns a handler for detailed health check information.\nfunc (c *Controller) HealthzVerbose() gin.HandlerFunc {\n\treturn func(ctx *gin.Context) {\n\t\tcheckCtx, cancel := context.WithTimeout(ctx.Request.Context(), c.checkTimeout)\n\t\tdefer cancel()\n\n\t\tresponse := HealthCheckResponse{\n\t\t\tTimestamp: time.Now().UTC().Format(time.RFC3339),\n\t\t}\n\n\t\t// Check liveness\n\t\tlivezResults, livezHealthy := c.livezCheckers.CheckAll(checkCtx)\n\n\t\t// Check readiness\n\t\treadyzResults, readyzHealthy := c.readyzCheckers.CheckAll(checkCtx)\n\n\t\t// Combine results\n\t\tresponse.Checks = append(response.Checks, livezResults...)\n\t\tresponse.Checks = append(response.Checks, readyzResults...)\n\n\t\tallHealthy := livezHealthy && readyzHealthy && c.ready.Load()\n\t\tif allHealthy {\n\t\t\tresponse.Status = \"healthy\"\n\t\t\tctx.JSON(http.StatusOK, response)\n\t\t} else {\n\t\t\tresponse.Status = \"unhealthy\"\n\t\t\tctx.JSON(http.StatusServiceUnavailable, response)\n\t\t}\n\t}\n}\n\n// LivezVerbose returns a handler for detailed liveness check information.\nfunc (c *Controller) LivezVerbose() gin.HandlerFunc {\n\treturn func(ctx *gin.Context) {\n\t\tcheckCtx, cancel := context.WithTimeout(ctx.Request.Context(), c.checkTimeout)\n\t\tdefer cancel()\n\n\t\tresults, allHealthy := c.livezCheckers.CheckAll(checkCtx)\n\n\t\tresponse := HealthCheckResponse{\n\t\t\tChecks:    results,\n\t\t\tTimestamp: time.Now().UTC().Format(time.RFC3339),\n\t\t}\n\n\t\tif allHealthy {\n\t\t\tresponse.Status = \"healthy\"\n\t\t\tctx.JSON(http.StatusOK, response)\n\t\t} else {\n\t\t\tresponse.Status = \"unhealthy\"\n\t\t\tctx.JSON(http.StatusServiceUnavailable, response)\n\t\t}\n\t}\n}\n\n// ReadyzVerbose returns a handler for detailed readiness check information.\nfunc (c *Controller) ReadyzVerbose() gin.HandlerFunc {\n\treturn func(ctx *gin.Context) {\n\t\tresponse := HealthCheckResponse{\n\t\t\tTimestamp: time.Now().UTC().Format(time.RFC3339),\n\t\t}\n\n\t\t// Check if server is marked as not ready\n\t\tif !c.ready.Load() {\n\t\t\tresponse.Status = \"not ready\"\n\t\t\tresponse.Checks = []HealthCheckResult{\n\t\t\t\t{\n\t\t\t\t\tName:    \"shutdown\",\n\t\t\t\t\tHealthy: false,\n\t\t\t\t\tError:   \"server is shutting down\",\n\t\t\t\t},\n\t\t\t}\n\t\t\tctx.JSON(http.StatusServiceUnavailable, response)\n\t\t\treturn\n\t\t}\n\n\t\tcheckCtx, cancel := context.WithTimeout(ctx.Request.Context(), c.checkTimeout)\n\t\tdefer cancel()\n\n\t\tresults, allHealthy := c.readyzCheckers.CheckAll(checkCtx)\n\t\tresponse.Checks = results\n\n\t\tif allHealthy {\n\t\t\tresponse.Status = \"ready\"\n\t\t\tctx.JSON(http.StatusOK, response)\n\t\t} else {\n\t\t\tresponse.Status = \"not ready\"\n\t\t\tctx.JSON(http.StatusServiceUnavailable, response)\n\t\t}\n\t}\n}\n\n// SetReady sets the readiness state of the server.\nfunc (c *Controller) SetReady(ready bool) {\n\tc.ready.Store(ready)\n}\n\n// IsReady returns the current readiness state.\nfunc (c *Controller) IsReady() bool {\n\treturn c.ready.Load()\n}\n\n// AddLivezChecker adds a liveness checker.\nfunc (c *Controller) AddLivezChecker(checker HealthChecker) {\n\tc.livezCheckers.AddChecker(checker)\n}\n\n// AddReadyzChecker adds a readiness checker.\nfunc (c *Controller) AddReadyzChecker(checker HealthChecker) {\n\tc.readyzCheckers.AddChecker(checker)\n}\n\n// RemoveLivezChecker removes a liveness checker by name.\nfunc (c *Controller) RemoveLivezChecker(name string) {\n\tc.livezCheckers.RemoveChecker(name)\n}\n\n// RemoveReadyzChecker removes a readiness checker by name.\nfunc (c *Controller) RemoveReadyzChecker(name string) {\n\tc.readyzCheckers.RemoveChecker(name)\n}\n"
  },
  {
    "path": "pkg/webserver/controller/healthz/healthz_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage healthz_test\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gin-gonic/gin\"\n\thealthz_ \"github.com/kaydxh/golang/pkg/webserver/controller/healthz\"\n)\n\nfunc init() {\n\tgin.SetMode(gin.TestMode)\n}\n\nfunc TestPingHealthChecker(t *testing.T) {\n\tchecker := healthz_.PingHealthChecker{}\n\n\tif checker.Name() != \"ping\" {\n\t\tt.Errorf(\"expected name 'ping', got '%s'\", checker.Name())\n\t}\n\n\tif err := checker.Check(context.Background()); err != nil {\n\t\tt.Errorf(\"expected no error, got: %v\", err)\n\t}\n}\n\nfunc TestFuncHealthChecker(t *testing.T) {\n\tt.Run(\"healthy check\", func(t *testing.T) {\n\t\tchecker := healthz_.NewFuncHealthChecker(\"test\", func(ctx context.Context) error {\n\t\t\treturn nil\n\t\t})\n\n\t\tif checker.Name() != \"test\" {\n\t\t\tt.Errorf(\"expected name 'test', got '%s'\", checker.Name())\n\t\t}\n\n\t\tif err := checker.Check(context.Background()); err != nil {\n\t\t\tt.Errorf(\"expected no error, got: %v\", err)\n\t\t}\n\t})\n\n\tt.Run(\"unhealthy check\", func(t *testing.T) {\n\t\texpectedErr := errors.New(\"service unavailable\")\n\t\tchecker := healthz_.NewFuncHealthChecker(\"test\", func(ctx context.Context) error {\n\t\t\treturn expectedErr\n\t\t})\n\n\t\tif err := checker.Check(context.Background()); err == nil {\n\t\t\tt.Error(\"expected error, got nil\")\n\t\t}\n\t})\n\n\tt.Run(\"nil check func\", func(t *testing.T) {\n\t\tchecker := healthz_.NewFuncHealthChecker(\"test\", nil)\n\n\t\tif err := checker.Check(context.Background()); err != nil {\n\t\t\tt.Errorf(\"expected no error for nil func, got: %v\", err)\n\t\t}\n\t})\n}\n\nfunc TestCompositeHealthChecker(t *testing.T) {\n\tt.Run(\"all healthy\", func(t *testing.T) {\n\t\tcomposite := healthz_.NewCompositeHealthChecker(\n\t\t\thealthz_.PingHealthChecker{},\n\t\t\thealthz_.NewFuncHealthChecker(\"check1\", func(ctx context.Context) error {\n\t\t\t\treturn nil\n\t\t\t}),\n\t\t)\n\n\t\tif err := composite.Check(context.Background()); err != nil {\n\t\t\tt.Errorf(\"expected no error, got: %v\", err)\n\t\t}\n\n\t\tresults, healthy := composite.CheckAll(context.Background())\n\t\tif !healthy {\n\t\t\tt.Error(\"expected all healthy\")\n\t\t}\n\t\tif len(results) != 2 {\n\t\t\tt.Errorf(\"expected 2 results, got %d\", len(results))\n\t\t}\n\t})\n\n\tt.Run(\"one unhealthy\", func(t *testing.T) {\n\t\tcomposite := healthz_.NewCompositeHealthChecker(\n\t\t\thealthz_.PingHealthChecker{},\n\t\t\thealthz_.NewFuncHealthChecker(\"failing\", func(ctx context.Context) error {\n\t\t\t\treturn errors.New(\"failed\")\n\t\t\t}),\n\t\t)\n\n\t\tif err := composite.Check(context.Background()); err == nil {\n\t\t\tt.Error(\"expected error, got nil\")\n\t\t}\n\n\t\tresults, healthy := composite.CheckAll(context.Background())\n\t\tif healthy {\n\t\t\tt.Error(\"expected not all healthy\")\n\t\t}\n\t\tif len(results) != 2 {\n\t\t\tt.Errorf(\"expected 2 results, got %d\", len(results))\n\t\t}\n\t})\n\n\tt.Run(\"add and remove checker\", func(t *testing.T) {\n\t\tcomposite := healthz_.NewCompositeHealthChecker()\n\n\t\tchecker := healthz_.NewFuncHealthChecker(\"dynamic\", func(ctx context.Context) error {\n\t\t\treturn nil\n\t\t})\n\n\t\tcomposite.AddChecker(checker)\n\t\tif len(composite.Checkers()) != 1 {\n\t\t\tt.Errorf(\"expected 1 checker, got %d\", len(composite.Checkers()))\n\t\t}\n\n\t\tcomposite.RemoveChecker(\"dynamic\")\n\t\tif len(composite.Checkers()) != 0 {\n\t\t\tt.Errorf(\"expected 0 checkers, got %d\", len(composite.Checkers()))\n\t\t}\n\t})\n}\n\nfunc TestController_Healthz(t *testing.T) {\n\tcontroller := healthz_.NewController()\n\n\trouter := gin.New()\n\tcontroller.SetRoutes(router, nil)\n\n\tt.Run(\"root path GET returns ok\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t\tif w.Body.String() != \"ok\" {\n\t\t\tt.Errorf(\"expected body 'ok', got '%s'\", w.Body.String())\n\t\t}\n\t})\n\n\tt.Run(\"root path HEAD returns ok\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodHead, \"/\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t})\n\n\tt.Run(\"healthz returns ok\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/healthz\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t\tif w.Body.String() != \"ok\" {\n\t\t\tt.Errorf(\"expected body 'ok', got '%s'\", w.Body.String())\n\t\t}\n\t})\n\n\tt.Run(\"livez returns ok\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/livez\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t})\n\n\tt.Run(\"readyz returns ok\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/readyz\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t})\n}\n\nfunc TestController_NotReady(t *testing.T) {\n\tcontroller := healthz_.NewController()\n\tcontroller.SetReady(false)\n\n\trouter := gin.New()\n\tcontroller.SetRoutes(router, nil)\n\n\tt.Run(\"root path returns service unavailable when not ready\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusServiceUnavailable {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusServiceUnavailable, w.Code)\n\t\t}\n\t})\n\n\tt.Run(\"root path HEAD returns service unavailable when not ready\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodHead, \"/\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusServiceUnavailable {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusServiceUnavailable, w.Code)\n\t\t}\n\t})\n\n\tt.Run(\"readyz returns service unavailable when not ready\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/readyz\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusServiceUnavailable {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusServiceUnavailable, w.Code)\n\t\t}\n\t})\n\n\tt.Run(\"healthz returns service unavailable when not ready\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/healthz\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusServiceUnavailable {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusServiceUnavailable, w.Code)\n\t\t}\n\t})\n\n\tt.Run(\"livez still returns ok when not ready\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/livez\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t})\n}\n\nfunc TestController_WithFailingChecker(t *testing.T) {\n\tfailingChecker := healthz_.NewFuncHealthChecker(\"failing\", func(ctx context.Context) error {\n\t\treturn errors.New(\"service down\")\n\t})\n\n\tcontroller := healthz_.NewController(\n\t\thealthz_.WithLivezCheckers(failingChecker),\n\t)\n\n\trouter := gin.New()\n\tcontroller.SetRoutes(router, nil)\n\n\tt.Run(\"livez returns service unavailable with failing checker\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/livez\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusServiceUnavailable {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusServiceUnavailable, w.Code)\n\t\t}\n\t})\n}\n\nfunc TestController_VerboseEndpoints(t *testing.T) {\n\tcontroller := healthz_.NewController()\n\n\trouter := gin.New()\n\tcontroller.SetRoutes(router, nil)\n\n\tendpoints := []string{\"/healthz/verbose\", \"/livez/verbose\", \"/readyz/verbose\"}\n\n\tfor _, endpoint := range endpoints {\n\t\tt.Run(endpoint, func(t *testing.T) {\n\t\t\treq := httptest.NewRequest(http.MethodGet, endpoint, nil)\n\t\t\tw := httptest.NewRecorder()\n\t\t\trouter.ServeHTTP(w, req)\n\n\t\t\tif w.Code != http.StatusOK {\n\t\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t\t}\n\n\t\t\tcontentType := w.Header().Get(\"Content-Type\")\n\t\t\tif contentType != \"application/json; charset=utf-8\" {\n\t\t\t\tt.Errorf(\"expected JSON content type, got '%s'\", contentType)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestController_WithOptions(t *testing.T) {\n\tcontroller := healthz_.NewController(\n\t\thealthz_.WithCheckTimeout(5*time.Second),\n\t\thealthz_.WithLivezCheckers(healthz_.PingHealthChecker{}),\n\t\thealthz_.WithReadyzCheckers(healthz_.PingHealthChecker{}),\n\t)\n\n\tif !controller.IsReady() {\n\t\tt.Error(\"expected controller to be ready by default\")\n\t}\n}\n\nfunc TestController_AddRemoveCheckers(t *testing.T) {\n\tcontroller := healthz_.NewController()\n\n\tchecker := healthz_.NewFuncHealthChecker(\"dynamic\", func(ctx context.Context) error {\n\t\treturn nil\n\t})\n\n\tcontroller.AddLivezChecker(checker)\n\tcontroller.AddReadyzChecker(checker)\n\n\tcontroller.RemoveLivezChecker(\"dynamic\")\n\tcontroller.RemoveReadyzChecker(\"dynamic\")\n}\n"
  },
  {
    "path": "pkg/webserver/controller/profiler/profiler.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage profiler\n\nimport (\n\t\"net/http\"\n\t\"runtime\"\n\n\t_ \"net/http/pprof\"\n\n\t\"github.com/gin-gonic/gin\"\n\tgw_ \"github.com/kaydxh/golang/pkg/grpc-gateway\"\n)\n\ntype Controller struct {\n}\n\nfunc NewController() *Controller {\n\treturn &Controller{}\n}\n\nfunc (c *Controller) SetRoutes(ginRouter gin.IRouter, grpcRouter *gw_.GRPCGateway) {\n\tginRouter.GET(\"/debug/pprof/*path\", c.Profile())\n}\n\nfunc (c *Controller) Profile() gin.HandlerFunc {\n\truntime.SetBlockProfileRate(1)\n\truntime.SetMutexProfileFraction(1)\n\treturn gin.WrapH(http.DefaultServeMux)\n}\n"
  },
  {
    "path": "pkg/webserver/controller/static/static.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage static\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/gin-gonic/gin\"\n\tgw_ \"github.com/kaydxh/golang/pkg/grpc-gateway\"\n)\n\n// Config 静态文件服务配置。\ntype Config struct {\n\t// Root 静态文件根目录路径。\n\t// 可通过 EnvKey 环境变量覆盖。\n\tRoot string\n\n\t// IndexFile SPA 入口文件名（相对于 Root）。\n\t// 默认值: \"index.html\"\n\tIndexFile string\n\n\t// AssetDirs 额外的静态资源目录映射。\n\t// key 为 URL 路径前缀，value 为相对于 Root 的子目录名。\n\t// 例如: {\"assets\": \"assets\", \"models\": \"models\"}\n\tAssetDirs map[string]string\n\n\t// StaticFiles 单个静态文件映射。\n\t// key 为 URL 路径，value 为相对于 Root 的文件路径。\n\t// 例如: {\"/favicon.ico\": \"favicon.ico\"}\n\tStaticFiles map[string]string\n\n\t// EnvKey 用于覆盖 Root 的环境变量名。\n\t// 如果设置了该环境变量，其值将覆盖 Root 配置。\n\t// 默认值: \"STATIC_ROOT\"\n\tEnvKey string\n\n\t// SPAMode 是否启用 SPA 模式。\n\t// 启用后，所有未匹配的 GET 请求将返回 IndexFile（Vue/React SPA fallback）。\n\tSPAMode bool\n}\n\n// Controller 静态文件服务控制器。\n// 实现 WebHandler 接口，用于在 GenericWebServer 中注册静态文件路由。\ntype Controller struct {\n\tconfig Config\n\troot   string // 解析后的实际根目录\n}\n\n// NewController 创建静态文件服务控制器。\nfunc NewController(config Config) *Controller {\n\t// 填充默认值\n\tif config.IndexFile == \"\" {\n\t\tconfig.IndexFile = \"index.html\"\n\t}\n\tif config.EnvKey == \"\" {\n\t\tconfig.EnvKey = \"STATIC_ROOT\"\n\t}\n\tif config.Root == \"\" {\n\t\tconfig.Root = \"./static\"\n\t}\n\n\t// 环境变量覆盖\n\troot := config.Root\n\tif v := os.Getenv(config.EnvKey); v != \"\" {\n\t\troot = v\n\t}\n\n\treturn &Controller{\n\t\tconfig: config,\n\t\troot:   root,\n\t}\n}\n\n// SetRoutes 注册静态文件服务路由到 Gin 路由器。\nfunc (c *Controller) SetRoutes(ginRouter gin.IRouter, grpcRouter *gw_.GRPCGateway) {\n\t// 注册额外的静态资源目录\n\tfor urlPath, dirName := range c.config.AssetDirs {\n\t\tabsDir := filepath.Join(c.root, dirName)\n\t\tginRouter.Static(\"/\"+urlPath, absDir)\n\t}\n\n\t// 注册单个静态文件\n\tfor urlPath, filePath := range c.config.StaticFiles {\n\t\tabsFile := filepath.Join(c.root, filePath)\n\t\tginRouter.StaticFile(urlPath, absFile)\n\t}\n\n\t// SPA 模式：根路径返回 index.html。\n\t// 注意：使用 SPAMode 时，healthz 控制器应配置 WithDisableRootRoute()，\n\t// 避免与此处的 GET \"/\" 路由冲突。负载均衡器应改用 /healthz 或 /livez 探测。\n\tif c.config.SPAMode {\n\t\tindexFile := filepath.Join(c.root, c.config.IndexFile)\n\t\tginRouter.GET(\"/\", func(ctx *gin.Context) {\n\t\t\tctx.File(indexFile)\n\t\t})\n\t\tginRouter.HEAD(\"/\", func(ctx *gin.Context) {\n\t\t\tctx.File(indexFile)\n\t\t})\n\t}\n}\n\n// GetRoot 返回解析后的静态文件根目录路径。\nfunc (c *Controller) GetRoot() string {\n\treturn c.root\n}\n"
  },
  {
    "path": "pkg/webserver/controller/static/static_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage static\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/gin-gonic/gin\"\n)\n\nfunc TestNewController(t *testing.T) {\n\tt.Run(\"default config\", func(t *testing.T) {\n\t\tctrl := NewController(Config{})\n\t\tif ctrl.config.IndexFile != \"index.html\" {\n\t\t\tt.Errorf(\"expected IndexFile 'index.html', got '%s'\", ctrl.config.IndexFile)\n\t\t}\n\t\tif ctrl.config.EnvKey != \"STATIC_ROOT\" {\n\t\t\tt.Errorf(\"expected EnvKey 'STATIC_ROOT', got '%s'\", ctrl.config.EnvKey)\n\t\t}\n\t\tif ctrl.root != \"./static\" {\n\t\t\tt.Errorf(\"expected root './static', got '%s'\", ctrl.root)\n\t\t}\n\t})\n\n\tt.Run(\"custom config\", func(t *testing.T) {\n\t\tctrl := NewController(Config{\n\t\t\tRoot:      \"/var/www\",\n\t\t\tIndexFile: \"app.html\",\n\t\t\tEnvKey:    \"MY_STATIC\",\n\t\t})\n\t\tif ctrl.root != \"/var/www\" {\n\t\t\tt.Errorf(\"expected root '/var/www', got '%s'\", ctrl.root)\n\t\t}\n\t\tif ctrl.config.IndexFile != \"app.html\" {\n\t\t\tt.Errorf(\"expected IndexFile 'app.html', got '%s'\", ctrl.config.IndexFile)\n\t\t}\n\t})\n\n\tt.Run(\"env override\", func(t *testing.T) {\n\t\tos.Setenv(\"TEST_STATIC_ROOT\", \"/tmp/override\")\n\t\tdefer os.Unsetenv(\"TEST_STATIC_ROOT\")\n\n\t\tctrl := NewController(Config{\n\t\t\tRoot:   \"/var/www\",\n\t\t\tEnvKey: \"TEST_STATIC_ROOT\",\n\t\t})\n\t\tif ctrl.root != \"/tmp/override\" {\n\t\t\tt.Errorf(\"expected root '/tmp/override', got '%s'\", ctrl.root)\n\t\t}\n\t})\n}\n\nfunc TestController_SetRoutes(t *testing.T) {\n\t// 创建临时目录和文件\n\ttmpDir := t.TempDir()\n\tassetsDir := filepath.Join(tmpDir, \"assets\")\n\tos.MkdirAll(assetsDir, 0755)\n\tos.WriteFile(filepath.Join(tmpDir, \"index.html\"), []byte(\"<html>hello</html>\"), 0644)\n\tos.WriteFile(filepath.Join(assetsDir, \"app.js\"), []byte(\"console.log('hi')\"), 0644)\n\tos.WriteFile(filepath.Join(tmpDir, \"favicon.ico\"), []byte(\"icon\"), 0644)\n\n\tgin.SetMode(gin.TestMode)\n\trouter := gin.New()\n\n\tctrl := NewController(Config{\n\t\tRoot:      tmpDir,\n\t\tSPAMode:   true,\n\t\tAssetDirs: map[string]string{\"assets\": \"assets\"},\n\t\tStaticFiles: map[string]string{\n\t\t\t\"/favicon.ico\": \"favicon.ico\",\n\t\t},\n\t})\n\tctrl.SetRoutes(router, nil)\n\n\tt.Run(\"SPA root returns index.html\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t\tif w.Body.String() != \"<html>hello</html>\" {\n\t\t\tt.Errorf(\"expected index.html content, got '%s'\", w.Body.String())\n\t\t}\n\t})\n\n\tt.Run(\"static asset file served\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/assets/app.js\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t\tif w.Body.String() != \"console.log('hi')\" {\n\t\t\tt.Errorf(\"expected js content, got '%s'\", w.Body.String())\n\t\t}\n\t})\n\n\tt.Run(\"static file served\", func(t *testing.T) {\n\t\treq := httptest.NewRequest(http.MethodGet, \"/favicon.ico\", nil)\n\t\tw := httptest.NewRecorder()\n\t\trouter.ServeHTTP(w, req)\n\n\t\tif w.Code != http.StatusOK {\n\t\t\tt.Errorf(\"expected status %d, got %d\", http.StatusOK, w.Code)\n\t\t}\n\t})\n}\n\nfunc TestController_GetRoot(t *testing.T) {\n\tctrl := NewController(Config{Root: \"/my/path\"})\n\tif ctrl.GetRoot() != \"/my/path\" {\n\t\tt.Errorf(\"expected '/my/path', got '%s'\", ctrl.GetRoot())\n\t}\n}\n"
  },
  {
    "path": "pkg/webserver/go.mod",
    "content": "module github.com/kaydxh/golang/pkg/webserver\n\ngo 1.25.3\n\nreplace github.com/kaydxh/golang/go => ../../go\n\nreplace github.com/kaydxh/golang/pkg/viper => ../viper\n\nreplace github.com/kaydxh/golang/pkg/protobuf => ../protobuf\n\nreplace github.com/kaydxh/golang/pkg/grpc-gateway => ../grpc-gateway\n\nreplace github.com/kaydxh/golang/pkg/middleware => ../middleware\n\nreplace github.com/kaydxh/golang/pkg/discovery => ../discovery\n\nreplace github.com/kaydxh/golang/pkg/logs => ../logs\n\nrequire (\n\tgithub.com/gin-gonic/gin v1.11.0\n\tgithub.com/go-playground/validator/v10 v10.28.0\n\tgithub.com/golang/protobuf v1.5.4\n\tgithub.com/kaydxh/golang/go v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/discovery v0.0.0-00010101000000-000000000000\n\tgithub.com/kaydxh/golang/pkg/grpc-gateway v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/protobuf v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/kaydxh/golang/pkg/viper v0.0.0-20251125160242-e06b25c89946\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgithub.com/spf13/cobra v1.10.1\n\tgithub.com/spf13/viper v1.21.0\n\tgoogle.golang.org/grpc v1.77.0\n\tgoogle.golang.org/protobuf v1.36.10\n)\n\nrequire (\n\tgithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect\n\tgithub.com/armon/go-metrics v0.4.1 // indirect\n\tgithub.com/beorn7/perks v1.0.1 // indirect\n\tgithub.com/bytedance/sonic v1.14.0 // indirect\n\tgithub.com/bytedance/sonic/loader v0.3.0 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/cloudwego/base64x v0.1.6 // indirect\n\tgithub.com/fatih/color v1.16.0 // indirect\n\tgithub.com/fsnotify/fsnotify v1.9.0 // indirect\n\tgithub.com/gabriel-vasile/mimetype v1.4.10 // indirect\n\tgithub.com/gin-contrib/sse v1.1.0 // indirect\n\tgithub.com/go-logr/logr v1.4.3 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/go-playground/locales v0.14.1 // indirect\n\tgithub.com/go-playground/universal-translator v0.18.1 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/goccy/go-json v0.10.2 // indirect\n\tgithub.com/goccy/go-yaml v1.18.0 // indirect\n\tgithub.com/google/uuid v1.6.0 // indirect\n\tgithub.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/hashicorp/consul/api v1.33.0 // indirect\n\tgithub.com/hashicorp/errwrap v1.1.0 // indirect\n\tgithub.com/hashicorp/go-cleanhttp v0.5.2 // indirect\n\tgithub.com/hashicorp/go-hclog v1.5.0 // indirect\n\tgithub.com/hashicorp/go-immutable-radix v1.3.1 // indirect\n\tgithub.com/hashicorp/go-multierror v1.1.1 // indirect\n\tgithub.com/hashicorp/go-rootcerts v1.0.2 // indirect\n\tgithub.com/hashicorp/golang-lru v0.5.4 // indirect\n\tgithub.com/hashicorp/serf v0.10.1 // indirect\n\tgithub.com/inconshreveable/mousetrap v1.1.0 // indirect\n\tgithub.com/json-iterator/go v1.1.12 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/logs v0.0.0-20251125132602-62c26b682228 // indirect\n\tgithub.com/kaydxh/golang/pkg/middleware v0.0.0-00010101000000-000000000000 // indirect\n\tgithub.com/klauspost/cpuid/v2 v2.3.0 // indirect\n\tgithub.com/leodido/go-urn v1.4.0 // indirect\n\tgithub.com/mattn/go-colorable v0.1.13 // indirect\n\tgithub.com/mattn/go-isatty v0.0.20 // indirect\n\tgithub.com/mitchellh/go-homedir v1.1.0 // indirect\n\tgithub.com/moby/term v0.5.2 // indirect\n\tgithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect\n\tgithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect\n\tgithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect\n\tgithub.com/pelletier/go-toml/v2 v2.2.4 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/prometheus/client_golang v1.23.2 // indirect\n\tgithub.com/prometheus/client_model v0.6.2 // indirect\n\tgithub.com/prometheus/common v0.66.1 // indirect\n\tgithub.com/prometheus/procfs v0.17.0 // indirect\n\tgithub.com/quic-go/qpack v0.5.1 // indirect\n\tgithub.com/quic-go/quic-go v0.54.0 // indirect\n\tgithub.com/sagikazarmark/locafero v0.11.0 // indirect\n\tgithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect\n\tgithub.com/spf13/afero v1.15.0 // indirect\n\tgithub.com/spf13/cast v1.10.0 // indirect\n\tgithub.com/spf13/pflag v1.0.10 // indirect\n\tgithub.com/stretchr/objx v0.5.2 // indirect\n\tgithub.com/subosito/gotenv v1.6.0 // indirect\n\tgithub.com/twitchyliquid64/golang-asm v0.15.1 // indirect\n\tgithub.com/ugorji/go/codec v1.3.0 // indirect\n\tgo.opentelemetry.io/auto/sdk v1.2.1 // indirect\n\tgo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect\n\tgo.opentelemetry.io/otel v1.38.0 // indirect\n\tgo.opentelemetry.io/otel/metric v1.38.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.38.0 // indirect\n\tgo.uber.org/atomic v1.11.0 // indirect\n\tgo.uber.org/mock v0.5.0 // indirect\n\tgo.yaml.in/yaml/v2 v2.4.2 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/arch v0.20.0 // indirect\n\tgolang.org/x/crypto v0.46.0 // indirect\n\tgolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 // indirect\n\tgolang.org/x/mod v0.30.0 // indirect\n\tgolang.org/x/net v0.48.0 // indirect\n\tgolang.org/x/sync v0.19.0 // indirect\n\tgolang.org/x/sys v0.39.0 // indirect\n\tgolang.org/x/text v0.32.0 // indirect\n\tgolang.org/x/time v0.14.0 // indirect\n\tgolang.org/x/tools v0.39.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect\n)\n"
  },
  {
    "path": "pkg/webserver/go.sum",
    "content": "cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=\ngithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=\ngithub.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=\ngithub.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=\ngithub.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=\ngithub.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=\ngithub.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=\ngithub.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=\ngithub.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=\ngithub.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=\ngithub.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=\ngithub.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA=\ngithub.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=\ngithub.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=\ngithub.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=\ngithub.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=\ngithub.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=\ngithub.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=\ngithub.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=\ngithub.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=\ngithub.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=\ngithub.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=\ngithub.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=\ngithub.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=\ngithub.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=\ngithub.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=\ngithub.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=\ngithub.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=\ngithub.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=\ngithub.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=\ngithub.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=\ngithub.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=\ngithub.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=\ngithub.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=\ngithub.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=\ngithub.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=\ngithub.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=\ngithub.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=\ngithub.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=\ngithub.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=\ngithub.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=\ngithub.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=\ngithub.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=\ngithub.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=\ngithub.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=\ngithub.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=\ngithub.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=\ngithub.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=\ngithub.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=\ngithub.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=\ngithub.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=\ngithub.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=\ngithub.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=\ngithub.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=\ngithub.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=\ngithub.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=\ngithub.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=\ngithub.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=\ngithub.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=\ngithub.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=\ngithub.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=\ngithub.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=\ngithub.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=\ngithub.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=\ngithub.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=\ngithub.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=\ngithub.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=\ngithub.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=\ngithub.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=\ngithub.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=\ngithub.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=\ngithub.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=\ngithub.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=\ngithub.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=\ngithub.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=\ngithub.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=\ngithub.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=\ngithub.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=\ngithub.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=\ngithub.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=\ngithub.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=\ngithub.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=\ngithub.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=\ngithub.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4=\ngithub.com/hashicorp/consul/api v1.33.0 h1:MnFUzN1Bo6YDGi/EsRLbVNgA4pyCymmcswrE5j4OHBM=\ngithub.com/hashicorp/consul/api v1.33.0/go.mod h1:vLz2I/bqqCYiG0qRHGerComvbwSWKswc8rRFtnYBrIw=\ngithub.com/hashicorp/consul/sdk v0.17.0 h1:N/JigV6y1yEMfTIhXoW0DXUecM2grQnFuRpY7PcLHLI=\ngithub.com/hashicorp/consul/sdk v0.17.0/go.mod h1:8dgIhY6VlPUprRH7o7UenVuFEgq017qUn3k9wS5mCt4=\ngithub.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=\ngithub.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=\ngithub.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=\ngithub.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=\ngithub.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=\ngithub.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=\ngithub.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=\ngithub.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=\ngithub.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=\ngithub.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=\ngithub.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=\ngithub.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=\ngithub.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=\ngithub.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=\ngithub.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=\ngithub.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=\ngithub.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=\ngithub.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=\ngithub.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=\ngithub.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=\ngithub.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=\ngithub.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=\ngithub.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc=\ngithub.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=\ngithub.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=\ngithub.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=\ngithub.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=\ngithub.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=\ngithub.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=\ngithub.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI=\ngithub.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=\ngithub.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=\ngithub.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=\ngithub.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=\ngithub.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=\ngithub.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc=\ngithub.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM=\ngithub.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0=\ngithub.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY=\ngithub.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=\ngithub.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=\ngithub.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=\ngithub.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=\ngithub.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=\ngithub.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=\ngithub.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=\ngithub.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228 h1:Q0arlJiD7BygvPMDHcvTdg1urHqADnd7P2qk3r2HlyE=\ngithub.com/kaydxh/golang/pkg/file-cleanup v0.0.0-20251125132602-62c26b682228/go.mod h1:ML4gUddcaOo55zQ9/m8SxjZYYVTJACriuUFcqs1BEd4=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228 h1:7zmih7dDhXTVDxbWy4Cp0OrSqMdQaQzlRUtCzZXMVgc=\ngithub.com/kaydxh/golang/pkg/file-rotate v0.0.0-20251125132602-62c26b682228/go.mod h1:DeGVCOtdDQNg6/hVvPwYqeH0EbGcbFiQcKNvMrD+NyY=\ngithub.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=\ngithub.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=\ngithub.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=\ngithub.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=\ngithub.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=\ngithub.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=\ngithub.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=\ngithub.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=\ngithub.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=\ngithub.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=\ngithub.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=\ngithub.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=\ngithub.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=\ngithub.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=\ngithub.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=\ngithub.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=\ngithub.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=\ngithub.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=\ngithub.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=\ngithub.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=\ngithub.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=\ngithub.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=\ngithub.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=\ngithub.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=\ngithub.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=\ngithub.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=\ngithub.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY=\ngithub.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=\ngithub.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=\ngithub.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=\ngithub.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=\ngithub.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=\ngithub.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=\ngithub.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=\ngithub.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=\ngithub.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=\ngithub.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=\ngithub.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=\ngithub.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=\ngithub.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=\ngithub.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=\ngithub.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=\ngithub.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=\ngithub.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=\ngithub.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=\ngithub.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=\ngithub.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=\ngithub.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=\ngithub.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=\ngithub.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=\ngithub.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=\ngithub.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=\ngithub.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=\ngithub.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=\ngithub.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=\ngithub.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=\ngithub.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\ngithub.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\ngithub.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=\ngithub.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=\ngithub.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=\ngithub.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=\ngithub.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=\ngithub.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=\ngithub.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=\ngithub.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=\ngithub.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=\ngithub.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=\ngithub.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=\ngithub.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=\ngithub.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=\ngithub.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=\ngithub.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg=\ngithub.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=\ngithub.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=\ngithub.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=\ngithub.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=\ngithub.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=\ngithub.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=\ngithub.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=\ngithub.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=\ngithub.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=\ngithub.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=\ngithub.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=\ngithub.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=\ngithub.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=\ngithub.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=\ngithub.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=\ngithub.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=\ngithub.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=\ngithub.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=\ngithub.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=\ngithub.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=\ngithub.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=\ngithub.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngithub.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=\ngithub.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=\ngithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=\ngithub.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=\ngithub.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=\ngithub.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=\ngithub.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=\ngithub.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=\ngithub.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=\ngithub.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngithub.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=\ngithub.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=\ngithub.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=\ngo.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=\ngo.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=\ngo.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=\ngo.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=\ngo.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=\ngo.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=\ngo.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=\ngo.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=\ngo.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=\ngo.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=\ngo.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=\ngo.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=\ngo.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=\ngo.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=\ngo.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=\ngo.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=\ngo.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=\ngo.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=\ngo.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=\ngo.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=\ngo.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=\ngolang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=\ngolang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=\ngolang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=\ngolang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=\ngolang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=\ngolang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=\ngolang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=\ngolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 h1:zfMcR1Cs4KNuomFFgGefv5N0czO2XZpUbxGUy8i8ug0=\ngolang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0=\ngolang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=\ngolang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=\ngolang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=\ngolang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=\ngolang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=\ngolang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=\ngolang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=\ngolang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=\ngolang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=\ngolang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=\ngolang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=\ngolang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=\ngolang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=\ngolang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=\ngolang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=\ngolang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=\ngolang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=\ngolang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=\ngolang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=\ngolang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=\ngolang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=\ngolang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=\ngolang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=\ngolang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=\ngolang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=\ngolang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=\ngolang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=\ngoogle.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=\ngoogle.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=\ngoogle.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=\ngoogle.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=\ngoogle.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=\ngoogle.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=\ngoogle.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=\ngoogle.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=\ngoogle.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=\ngoogle.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=\ngoogle.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=\ngoogle.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig=\ngoogle.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=\ngoogle.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=\ngotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\nhonnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=\nhonnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=\n"
  },
  {
    "path": "pkg/webserver/hooks.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage webserver\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"runtime/debug\"\n\n\terrors_ \"github.com/kaydxh/golang/go/errors\"\n\t\"github.com/sirupsen/logrus\"\n)\n\n// PostStartHookFunc is a function that is called after the server has started.\n// It must properly handle cases like:\n//  1. asynchronous start in multiple API server processes\n//  2. conflicts between the different processes all trying to perform the same action\n//  3. partially complete work (API server crashes while running your hook)\n//  4. API server access **BEFORE** your hook has completed\n// Think of it like a mini-controller that is super privileged and gets to run in-process\n// If you use this feature, tag @deads2k on github who has promised to review code for anyone's PostStartHook\n// until it becomes easier to use.\ntype PostStartHookFunc func(ctx context.Context) error\n\n// PreShutdownHookFunc is a function that can be added to the shutdown logic.\ntype PreShutdownHookFunc func() error\n\n// PostStartHookProvider is an interface in addition to provide a post start hook for the api server\ntype PostStartHookProvider interface {\n\tPostStartHook() (string, PostStartHookFunc, error)\n}\n\ntype postStartHookEntry struct {\n\thook PostStartHookFunc\n\t// originatingStack holds the stack that registered postStartHooks. This allows us to show a more helpful message\n\t// for duplicate registration.\n\toriginatingStack string\n\n\t// done will be closed when the postHook is finished\n\tdone chan struct{}\n}\n\ntype preShutdownHookEntry struct {\n\thook PreShutdownHookFunc\n}\n\n// AddPostStartHook allows you to add a PostStartHook.\nfunc (s *GenericWebServer) AddPostStartHook(name string, hook PostStartHookFunc) error {\n\tif len(name) == 0 {\n\t\treturn fmt.Errorf(\"missing name\")\n\t}\n\tif hook == nil {\n\t\treturn fmt.Errorf(\"hook func may not be nil: %q\", name)\n\t}\n\n\ts.postStartHookLock.Lock()\n\tdefer s.postStartHookLock.Unlock()\n\n\tif s.postStartHooksCalled {\n\t\treturn fmt.Errorf(\"unable to add %q because PostStartHooks have already been called\", name)\n\t}\n\tif postStartHook, exists := s.postStartHooks[name]; exists {\n\t\t// this is programmer error, but it can be hard to debug\n\t\treturn fmt.Errorf(\n\t\t\t\"unable to add %q because it was already registered by: %s\",\n\t\t\tname,\n\t\t\tpostStartHook.originatingStack,\n\t\t)\n\t}\n\n\t// done is closed when the poststarthook is finished.  This is used by the health check to be able to indicate\n\t// that the poststarthook is finished\n\tdone := make(chan struct{})\n\ts.postStartHooks[name] = postStartHookEntry{hook: hook, originatingStack: string(debug.Stack()), done: done}\n\n\treturn nil\n}\n\n// AddPostStartHookOrDie allows you to add a PostStartHook, but dies on failure\nfunc (s *GenericWebServer) AddPostStartHookOrDie(name string, hook PostStartHookFunc) {\n\tif err := s.AddPostStartHook(name, hook); err != nil {\n\t\tlogrus.Fatalf(\"Error registering PostStartHook %q: %v\", name, err)\n\t}\n}\n\n// AddPreShutdownHook allows you to add a PreShutdownHook.\nfunc (s *GenericWebServer) AddPreShutdownHook(name string, hook PreShutdownHookFunc) error {\n\tif len(name) == 0 {\n\t\treturn fmt.Errorf(\"missing name\")\n\t}\n\tif hook == nil {\n\t\treturn nil\n\t}\n\n\ts.preShutdownHookLock.Lock()\n\tdefer s.preShutdownHookLock.Unlock()\n\n\tif s.preShutdownHooksCalled {\n\t\treturn fmt.Errorf(\"unable to add %q because PreShutdownHooks have already been called\", name)\n\t}\n\tif _, exists := s.preShutdownHooks[name]; exists {\n\t\treturn fmt.Errorf(\"unable to add %q because it is already registered\", name)\n\t}\n\n\ts.preShutdownHooks[name] = preShutdownHookEntry{hook: hook}\n\n\treturn nil\n}\n\n// AddPreShutdownHookOrDie allows you to add a PostStartHook, but dies on failure\nfunc (s *GenericWebServer) AddPreShutdownHookOrDie(name string, hook PreShutdownHookFunc) {\n\tif err := s.AddPreShutdownHook(name, hook); err != nil {\n\t\tlogrus.Fatalf(\"Error registering PreShutdownHook %q: %v\", name, err)\n\t}\n}\n\n// RunPostStartHooks runs the PostStartHooks for the server\nfunc (s *GenericWebServer) RunPostStartHooks(ctx context.Context) {\n\ts.postStartHookLock.Lock()\n\tdefer s.postStartHookLock.Unlock()\n\ts.postStartHooksCalled = true\n\n\tfor hookName, hookEntry := range s.postStartHooks {\n\t\tgo runPostStartHook(ctx, hookName, hookEntry)\n\t}\n}\n\n// RunPreShutdownHooks runs the PreShutdownHooks for the server\nfunc (s *GenericWebServer) RunPreShutdownHooks() error {\n\tvar errorList []error\n\n\ts.preShutdownHookLock.Lock()\n\tdefer s.preShutdownHookLock.Unlock()\n\ts.preShutdownHooksCalled = true\n\n\tfor hookName, hookEntry := range s.preShutdownHooks {\n\t\tif err := runPreShutdownHook(hookName, hookEntry); err != nil {\n\t\t\terrorList = append(errorList, err)\n\t\t}\n\t}\n\treturn errors_.NewAggregate(errorList)\n}\n\n// isPostStartHookRegistered checks whether a given PostStartHook is registered\nfunc (s *GenericWebServer) isPostStartHookRegistered(name string) bool {\n\ts.postStartHookLock.Lock()\n\tdefer s.postStartHookLock.Unlock()\n\t_, exists := s.postStartHooks[name]\n\treturn exists\n}\n\nfunc runPostStartHook(ctx context.Context, name string, entry postStartHookEntry) {\n\tvar err error\n\tfunc() {\n\t\t// don't let the hook *accidentally* panic and kill the server\n\t\t//defer utilruntime.HandleCrash()\n\t\terr = entry.hook(ctx)\n\t}()\n\t// if the hook intentionally wants to kill server, let it.\n\tif err != nil {\n\t\tlogrus.Fatalf(\"PostStartHook %q failed: %v\", name, err)\n\t}\n\tclose(entry.done)\n}\n\nfunc runPreShutdownHook(name string, entry preShutdownHookEntry) error {\n\tvar err error\n\tfunc() {\n\t\t// don't let the hook *accidentally* panic and kill the server\n\t\t//\tdefer utilruntime.HandleCrash()\n\t\terr = entry.hook()\n\t}()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"PreShutdownHook %q failed: %v\", name, err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "pkg/webserver/symbolizer.go",
    "content": "//go:build linux\n// +build linux\n\n/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n\npackage webserver\n\n//import _ \"github.com/ianlancetaylor/cgosymbolizer\"\n"
  },
  {
    "path": "pkg/webserver/webserver.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage webserver\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/gin-gonic/gin\"\n\tcontext_ \"github.com/kaydxh/golang/go/context\"\n\tsyscall_ \"github.com/kaydxh/golang/go/syscall\"\n\t\"github.com/kaydxh/golang/pkg/discovery/consul\"\n\tgw_ \"github.com/kaydxh/golang/pkg/grpc-gateway\"\n\thealthz_ \"github.com/kaydxh/golang/pkg/webserver/controller/healthz\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype WebHandler interface {\n\tSetRoutes(ginRouter gin.IRouter, grpcRouter *gw_.GRPCGateway)\n}\n\ntype GenericWebServer struct {\n\t// Server Register. The backend is started after the server starts listening.\n\tServiceRegistryBackend *consul.ServiceRegistryServer\n\n\tginBackend  *gin.Engine\n\tgrpcBackend *gw_.GRPCGateway\n\n\t// PostStartHooks are each called after the server has started listening, in a separate go func for each\n\t// with no guarantee of ordering between them.  The map key is a name used for error reporting.\n\t// It may kill the process with a panic if it wishes to by returning an error.\n\tpostStartHookLock    sync.Mutex\n\tpostStartHooks       map[string]postStartHookEntry\n\tpostStartHooksCalled bool\n\n\tpreShutdownHookLock    sync.Mutex\n\tpreShutdownHooks       map[string]preShutdownHookEntry\n\tpreShutdownHooksCalled bool\n\n\t// HealthzController handles /healthz, /livez, /readyz endpoints.\n\tHealthzController *healthz_.Controller\n\n\t// the readiness stop channel is used to signal that the apiserver has initiated a shutdown sequence, this\n\t// will cause readyz to return unhealthy.\n\treadinessStopCh chan struct{}\n\n\t// ShutdownDelayDuration allows to block shutdown for some time, e.g. until endpoints pointing to this API server\n\t// have converged on all node. During this time, the API server keeps serving, /healthz will return 200,\n\t// but /readyz will return failure.\n\tShutdownDelayDuration time.Duration\n\n\tShutdownTimeoutDuration time.Duration\n\n\t// The limit on the request body size that would be accepted and decoded in a write request.\n\t// 0 means no limit.\n\tmaxRequestBodyBytes int64\n\n\t// WebServerID is the ID of this Web server\n\tWebServerID string\n}\n\n// preparedGenericWebServer is a private wrapper that enforces a call of PrepareRun() before Run can be invoked.\ntype preparedGenericWebServer struct {\n\t*GenericWebServer\n}\n\nfunc (s preparedGenericWebServer) NonBlockingRun(ctx context.Context) (context.Context, error) {\n\n\tctx, cancel := context.WithCancel(ctx)\n\tgo func() {\n\t\tdefer cancel()\n\t\terr := s.grpcBackend.ListenAndServe()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}()\n\n\treturn ctx, nil\n}\n\nfunc (s preparedGenericWebServer) Run(ctx context.Context) error {\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\tlogrus.Infof(\"Installing http server on %s\", s.grpcBackend.Addr)\n\tctx, err := s.NonBlockingRun(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.RunPostStartHooks(ctx)\n\tlogrus.Infof(\"Installed http server on %s\", s.grpcBackend.Addr)\n\n\t<-ctx.Done()\n\n\t// Mark server as not ready to stop receiving new requests\n\tif s.HealthzController != nil {\n\t\ts.HealthzController.SetReady(false)\n\t}\n\n\t// Wait for shutdown delay to allow load balancers to drain connections\n\tif s.ShutdownDelayDuration > 0 {\n\t\tlogrus.Infof(\"Waiting %v before shutdown for connection draining\", s.ShutdownDelayDuration)\n\t\ttime.Sleep(s.ShutdownDelayDuration)\n\t}\n\n\t// run shutdown hooks directly. This includes deregistering from the kubernetes endpoint in case of kube-apiserver.\n\terr = s.RunPreShutdownHooks()\n\tif err != nil {\n\t\tlogrus.Errorf(\"failed to run pre shutted down hook, err: %v\", err)\n\t\treturn err\n\t}\n\n\t//shutdown\n\tshutDownCtx, shutDownCancel := context_.WithTimeout(context.Background(), s.ShutdownTimeoutDuration)\n\tdefer shutDownCancel()\n\n\terr = s.grpcBackend.Shutdown(shutDownCtx)\n\tif err != nil {\n\t\tlogrus.Errorf(\"failed to shutted down http server on %s, err: %v\", s.grpcBackend.Addr, err)\n\t\treturn err\n\t}\n\tlogrus.Infof(\"Shutted down http server on %s\", s.grpcBackend.Addr)\n\treturn nil\n}\n\nfunc (s *GenericWebServer) PrepareRun() (preparedGenericWebServer, error) {\n\tif s.grpcBackend != nil {\n\t\t// assgined ginBackend to grpc handler\n\t\ts.grpcBackend.Handler = s.ginBackend\n\t}\n\n\tcurOpenFiles, err := syscall_.SetMaxNumFiles()\n\tif err != nil {\n\t\tlogrus.Errorf(\"failed to set max num files, err: %v\", err)\n\t\treturn preparedGenericWebServer{}, err\n\t}\n\tlogrus.Infof(\"set %v num files\", curOpenFiles)\n\treturn preparedGenericWebServer{s}, nil\n}\n\nfunc (s *GenericWebServer) InstallWebHandlers(handlers ...WebHandler) {\n\tfor _, h := range handlers {\n\t\tif h == nil {\n\t\t\tcontinue\n\t\t}\n\t\th.SetRoutes(s.ginBackend, s.grpcBackend)\n\t}\n}\n\n// AddLivezChecker adds a liveness checker.\n// Liveness probes determine if the application is running.\nfunc (s *GenericWebServer) AddLivezChecker(checker healthz_.HealthChecker) {\n\tif s.HealthzController != nil {\n\t\ts.HealthzController.AddLivezChecker(checker)\n\t}\n}\n\n// AddReadyzChecker adds a readiness checker.\n// Readiness probes determine if the application is ready to receive traffic.\nfunc (s *GenericWebServer) AddReadyzChecker(checker healthz_.HealthChecker) {\n\tif s.HealthzController != nil {\n\t\ts.HealthzController.AddReadyzChecker(checker)\n\t}\n}\n\n// SetReady sets the readiness state of the server.\nfunc (s *GenericWebServer) SetReady(ready bool) {\n\tif s.HealthzController != nil {\n\t\ts.HealthzController.SetReady(ready)\n\t}\n}\n\n// IsReady returns the current readiness state.\nfunc (s *GenericWebServer) IsReady() bool {\n\tif s.HealthzController != nil {\n\t\treturn s.HealthzController.IsReady()\n\t}\n\treturn true\n}\n\n// GetGinEngine returns the underlying gin.Engine for registering custom routes.\nfunc (s *GenericWebServer) GetGinEngine() *gin.Engine {\n\treturn s.ginBackend\n}\n"
  },
  {
    "path": "pkg/webserver/webserver.pb.go",
    "content": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.36.10\n// \tprotoc        v5.29.3\n// source: pkg/webserver/webserver.proto\n\npackage webserver\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tdurationpb \"google.golang.org/protobuf/types/known/durationpb\"\n\treflect \"reflect\"\n\tsync \"sync\"\n\tunsafe \"unsafe\"\n)\n\nconst (\n\t// Verify that this generated code is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)\n\t// Verify that runtime/protoimpl is sufficiently up-to-date.\n\t_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)\n)\n\ntype Web_Http_ApiFormatter int32\n\nconst (\n\tWeb_Http_api_noop        Web_Http_ApiFormatter = 0\n\tWeb_Http_tcloud_api_v30  Web_Http_ApiFormatter = 1\n\tWeb_Http_trivial_api_v10 Web_Http_ApiFormatter = 2\n\tWeb_Http_trivial_api_v20 Web_Http_ApiFormatter = 3\n)\n\n// Enum value maps for Web_Http_ApiFormatter.\nvar (\n\tWeb_Http_ApiFormatter_name = map[int32]string{\n\t\t0: \"api_noop\",\n\t\t1: \"tcloud_api_v30\",\n\t\t2: \"trivial_api_v10\",\n\t\t3: \"trivial_api_v20\",\n\t}\n\tWeb_Http_ApiFormatter_value = map[string]int32{\n\t\t\"api_noop\":        0,\n\t\t\"tcloud_api_v30\":  1,\n\t\t\"trivial_api_v10\": 2,\n\t\t\"trivial_api_v20\": 3,\n\t}\n)\n\nfunc (x Web_Http_ApiFormatter) Enum() *Web_Http_ApiFormatter {\n\tp := new(Web_Http_ApiFormatter)\n\t*p = x\n\treturn p\n}\n\nfunc (x Web_Http_ApiFormatter) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Web_Http_ApiFormatter) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_webserver_webserver_proto_enumTypes[0].Descriptor()\n}\n\nfunc (Web_Http_ApiFormatter) Type() protoreflect.EnumType {\n\treturn &file_pkg_webserver_webserver_proto_enumTypes[0]\n}\n\nfunc (x Web_Http_ApiFormatter) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Web_Http_ApiFormatter.Descriptor instead.\nfunc (Web_Http_ApiFormatter) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 2, 0}\n}\n\ntype Web_OpenTelemetry_OtelTraceExporterType int32\n\nconst (\n\tWeb_OpenTelemetry_trace_none   Web_OpenTelemetry_OtelTraceExporterType = 0\n\tWeb_OpenTelemetry_trace_stdout Web_OpenTelemetry_OtelTraceExporterType = 1\n\tWeb_OpenTelemetry_trace_otlp   Web_OpenTelemetry_OtelTraceExporterType = 2\n\tWeb_OpenTelemetry_trace_jaeger Web_OpenTelemetry_OtelTraceExporterType = 3\n\tWeb_OpenTelemetry_trace_zipkin Web_OpenTelemetry_OtelTraceExporterType = 4\n)\n\n// Enum value maps for Web_OpenTelemetry_OtelTraceExporterType.\nvar (\n\tWeb_OpenTelemetry_OtelTraceExporterType_name = map[int32]string{\n\t\t0: \"trace_none\",\n\t\t1: \"trace_stdout\",\n\t\t2: \"trace_otlp\",\n\t\t3: \"trace_jaeger\",\n\t\t4: \"trace_zipkin\",\n\t}\n\tWeb_OpenTelemetry_OtelTraceExporterType_value = map[string]int32{\n\t\t\"trace_none\":   0,\n\t\t\"trace_stdout\": 1,\n\t\t\"trace_otlp\":   2,\n\t\t\"trace_jaeger\": 3,\n\t\t\"trace_zipkin\": 4,\n\t}\n)\n\nfunc (x Web_OpenTelemetry_OtelTraceExporterType) Enum() *Web_OpenTelemetry_OtelTraceExporterType {\n\tp := new(Web_OpenTelemetry_OtelTraceExporterType)\n\t*p = x\n\treturn p\n}\n\nfunc (x Web_OpenTelemetry_OtelTraceExporterType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Web_OpenTelemetry_OtelTraceExporterType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_webserver_webserver_proto_enumTypes[1].Descriptor()\n}\n\nfunc (Web_OpenTelemetry_OtelTraceExporterType) Type() protoreflect.EnumType {\n\treturn &file_pkg_webserver_webserver_proto_enumTypes[1]\n}\n\nfunc (x Web_OpenTelemetry_OtelTraceExporterType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry_OtelTraceExporterType.Descriptor instead.\nfunc (Web_OpenTelemetry_OtelTraceExporterType) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4, 0}\n}\n\ntype Web_OpenTelemetry_OtelMetricExporterType int32\n\nconst (\n\tWeb_OpenTelemetry_metric_none       Web_OpenTelemetry_OtelMetricExporterType = 0\n\tWeb_OpenTelemetry_metric_stdout     Web_OpenTelemetry_OtelMetricExporterType = 1\n\tWeb_OpenTelemetry_metric_otlp       Web_OpenTelemetry_OtelMetricExporterType = 2\n\tWeb_OpenTelemetry_metric_prometheus Web_OpenTelemetry_OtelMetricExporterType = 3\n)\n\n// Enum value maps for Web_OpenTelemetry_OtelMetricExporterType.\nvar (\n\tWeb_OpenTelemetry_OtelMetricExporterType_name = map[int32]string{\n\t\t0: \"metric_none\",\n\t\t1: \"metric_stdout\",\n\t\t2: \"metric_otlp\",\n\t\t3: \"metric_prometheus\",\n\t}\n\tWeb_OpenTelemetry_OtelMetricExporterType_value = map[string]int32{\n\t\t\"metric_none\":       0,\n\t\t\"metric_stdout\":     1,\n\t\t\"metric_otlp\":       2,\n\t\t\"metric_prometheus\": 3,\n\t}\n)\n\nfunc (x Web_OpenTelemetry_OtelMetricExporterType) Enum() *Web_OpenTelemetry_OtelMetricExporterType {\n\tp := new(Web_OpenTelemetry_OtelMetricExporterType)\n\t*p = x\n\treturn p\n}\n\nfunc (x Web_OpenTelemetry_OtelMetricExporterType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Web_OpenTelemetry_OtelMetricExporterType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_webserver_webserver_proto_enumTypes[2].Descriptor()\n}\n\nfunc (Web_OpenTelemetry_OtelMetricExporterType) Type() protoreflect.EnumType {\n\treturn &file_pkg_webserver_webserver_proto_enumTypes[2]\n}\n\nfunc (x Web_OpenTelemetry_OtelMetricExporterType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry_OtelMetricExporterType.Descriptor instead.\nfunc (Web_OpenTelemetry_OtelMetricExporterType) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4, 1}\n}\n\ntype Web_OpenTelemetry_OtelLogExporterType int32\n\nconst (\n\tWeb_OpenTelemetry_log_none Web_OpenTelemetry_OtelLogExporterType = 0\n\tWeb_OpenTelemetry_log_otlp Web_OpenTelemetry_OtelLogExporterType = 1\n)\n\n// Enum value maps for Web_OpenTelemetry_OtelLogExporterType.\nvar (\n\tWeb_OpenTelemetry_OtelLogExporterType_name = map[int32]string{\n\t\t0: \"log_none\",\n\t\t1: \"log_otlp\",\n\t}\n\tWeb_OpenTelemetry_OtelLogExporterType_value = map[string]int32{\n\t\t\"log_none\": 0,\n\t\t\"log_otlp\": 1,\n\t}\n)\n\nfunc (x Web_OpenTelemetry_OtelLogExporterType) Enum() *Web_OpenTelemetry_OtelLogExporterType {\n\tp := new(Web_OpenTelemetry_OtelLogExporterType)\n\t*p = x\n\treturn p\n}\n\nfunc (x Web_OpenTelemetry_OtelLogExporterType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Web_OpenTelemetry_OtelLogExporterType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_pkg_webserver_webserver_proto_enumTypes[3].Descriptor()\n}\n\nfunc (Web_OpenTelemetry_OtelLogExporterType) Type() protoreflect.EnumType {\n\treturn &file_pkg_webserver_webserver_proto_enumTypes[3]\n}\n\nfunc (x Web_OpenTelemetry_OtelLogExporterType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry_OtelLogExporterType.Descriptor instead.\nfunc (Web_OpenTelemetry_OtelLogExporterType) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4, 2}\n}\n\ntype Web struct {\n\tstate       protoimpl.MessageState `protogen:\"open.v1\"`\n\tBindAddress *Web_Net               `protobuf:\"bytes,1,opt,name=bind_address,json=bindAddress,proto3\" json:\"bind_address,omitempty\"`\n\tGrpc        *Web_Grpc              `protobuf:\"bytes,3,opt,name=grpc,proto3\" json:\"grpc,omitempty\"`\n\tHttp        *Web_Http              `protobuf:\"bytes,4,opt,name=http,proto3\" json:\"http,omitempty\"`\n\tDebug       *Web_Debug             `protobuf:\"bytes,10,opt,name=debug,proto3\" json:\"debug,omitempty\"`\n\t// OpenTelemetry 统一监控配置（替代旧的 Monitor）\n\tOpenTelemetry *Web_OpenTelemetry `protobuf:\"bytes,12,opt,name=open_telemetry,json=openTelemetry,proto3\" json:\"open_telemetry,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Web) Reset() {\n\t*x = Web{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web) ProtoMessage() {}\n\nfunc (x *Web) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[0]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web.ProtoReflect.Descriptor instead.\nfunc (*Web) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0}\n}\n\nfunc (x *Web) GetBindAddress() *Web_Net {\n\tif x != nil {\n\t\treturn x.BindAddress\n\t}\n\treturn nil\n}\n\nfunc (x *Web) GetGrpc() *Web_Grpc {\n\tif x != nil {\n\t\treturn x.Grpc\n\t}\n\treturn nil\n}\n\nfunc (x *Web) GetHttp() *Web_Http {\n\tif x != nil {\n\t\treturn x.Http\n\t}\n\treturn nil\n}\n\nfunc (x *Web) GetDebug() *Web_Debug {\n\tif x != nil {\n\t\treturn x.Debug\n\t}\n\treturn nil\n}\n\nfunc (x *Web) GetOpenTelemetry() *Web_OpenTelemetry {\n\tif x != nil {\n\t\treturn x.OpenTelemetry\n\t}\n\treturn nil\n}\n\ntype Web_Net struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tHost          string                 `protobuf:\"bytes,1,opt,name=host,proto3\" json:\"host,omitempty\"`\n\tPort          int32                  `protobuf:\"varint,2,opt,name=port,proto3\" json:\"port,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Web_Net) Reset() {\n\t*x = Web_Net{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_Net) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_Net) ProtoMessage() {}\n\nfunc (x *Web_Net) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[1]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_Net.ProtoReflect.Descriptor instead.\nfunc (*Web_Net) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 0}\n}\n\nfunc (x *Web_Net) GetHost() string {\n\tif x != nil {\n\t\treturn x.Host\n\t}\n\treturn \"\"\n}\n\nfunc (x *Web_Net) GetPort() int32 {\n\tif x != nil {\n\t\treturn x.Port\n\t}\n\treturn 0\n}\n\ntype Web_Grpc struct {\n\tstate                 protoimpl.MessageState `protogen:\"open.v1\"`\n\tMaxReceiveMessageSize int32                  `protobuf:\"varint,3,opt,name=max_receive_message_size,json=maxReceiveMessageSize,proto3\" json:\"max_receive_message_size,omitempty\"`\n\tMaxSendMessageSize    int32                  `protobuf:\"varint,4,opt,name=max_send_message_size,json=maxSendMessageSize,proto3\" json:\"max_send_message_size,omitempty\"`\n\tTimeout               *durationpb.Duration   `protobuf:\"bytes,5,opt,name=timeout,proto3\" json:\"timeout,omitempty\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *Web_Grpc) Reset() {\n\t*x = Web_Grpc{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_Grpc) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_Grpc) ProtoMessage() {}\n\nfunc (x *Web_Grpc) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[2]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_Grpc.ProtoReflect.Descriptor instead.\nfunc (*Web_Grpc) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 1}\n}\n\nfunc (x *Web_Grpc) GetMaxReceiveMessageSize() int32 {\n\tif x != nil {\n\t\treturn x.MaxReceiveMessageSize\n\t}\n\treturn 0\n}\n\nfunc (x *Web_Grpc) GetMaxSendMessageSize() int32 {\n\tif x != nil {\n\t\treturn x.MaxSendMessageSize\n\t}\n\treturn 0\n}\n\nfunc (x *Web_Grpc) GetTimeout() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.Timeout\n\t}\n\treturn nil\n}\n\ntype Web_Http struct {\n\tstate        protoimpl.MessageState `protogen:\"open.v1\"`\n\tApiFormatter Web_Http_ApiFormatter  `protobuf:\"varint,1,opt,name=api_formatter,json=apiFormatter,proto3,enum=go.pkg.webserver.Web_Http_ApiFormatter\" json:\"api_formatter,omitempty\"`\n\t// timeout 0 is not unlimited\n\tTimeout       *durationpb.Duration `protobuf:\"bytes,3,opt,name=timeout,proto3\" json:\"timeout,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Web_Http) Reset() {\n\t*x = Web_Http{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_Http) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_Http) ProtoMessage() {}\n\nfunc (x *Web_Http) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[3]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_Http.ProtoReflect.Descriptor instead.\nfunc (*Web_Http) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 2}\n}\n\nfunc (x *Web_Http) GetApiFormatter() Web_Http_ApiFormatter {\n\tif x != nil {\n\t\treturn x.ApiFormatter\n\t}\n\treturn Web_Http_api_noop\n}\n\nfunc (x *Web_Http) GetTimeout() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.Timeout\n\t}\n\treturn nil\n}\n\ntype Web_Debug struct {\n\tstate                       protoimpl.MessageState `protogen:\"open.v1\"`\n\tEnableProfiling             bool                   `protobuf:\"varint,1,opt,name=enable_profiling,json=enableProfiling,proto3\" json:\"enable_profiling,omitempty\"`\n\tDisablePrintInoutputMethods []string               `protobuf:\"bytes,2,rep,name=disable_print_inoutput_methods,json=disablePrintInoutputMethods,proto3\" json:\"disable_print_inoutput_methods,omitempty\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *Web_Debug) Reset() {\n\t*x = Web_Debug{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_Debug) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_Debug) ProtoMessage() {}\n\nfunc (x *Web_Debug) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[4]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_Debug.ProtoReflect.Descriptor instead.\nfunc (*Web_Debug) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 3}\n}\n\nfunc (x *Web_Debug) GetEnableProfiling() bool {\n\tif x != nil {\n\t\treturn x.EnableProfiling\n\t}\n\treturn false\n}\n\nfunc (x *Web_Debug) GetDisablePrintInoutputMethods() []string {\n\tif x != nil {\n\t\treturn x.DisablePrintInoutputMethods\n\t}\n\treturn nil\n}\n\ntype Web_OpenTelemetry struct {\n\tstate                  protoimpl.MessageState                   `protogen:\"open.v1\"`\n\tEnabled                bool                                     `protobuf:\"varint,1,opt,name=enabled,proto3\" json:\"enabled,omitempty\"`\n\tMetricCollectDuration  *durationpb.Duration                     `protobuf:\"bytes,2,opt,name=metric_collect_duration,json=metricCollectDuration,proto3\" json:\"metric_collect_duration,omitempty\"`\n\tOtelTraceExporterType  Web_OpenTelemetry_OtelTraceExporterType  `protobuf:\"varint,3,opt,name=otel_trace_exporter_type,json=otelTraceExporterType,proto3,enum=go.pkg.webserver.Web_OpenTelemetry_OtelTraceExporterType\" json:\"otel_trace_exporter_type,omitempty\"`\n\tOtelMetricExporterType Web_OpenTelemetry_OtelMetricExporterType `protobuf:\"varint,4,opt,name=otel_metric_exporter_type,json=otelMetricExporterType,proto3,enum=go.pkg.webserver.Web_OpenTelemetry_OtelMetricExporterType\" json:\"otel_metric_exporter_type,omitempty\"`\n\tOtelLogExporterType    Web_OpenTelemetry_OtelLogExporterType    `protobuf:\"varint,5,opt,name=otel_log_exporter_type,json=otelLogExporterType,proto3,enum=go.pkg.webserver.Web_OpenTelemetry_OtelLogExporterType\" json:\"otel_log_exporter_type,omitempty\"`\n\tOtelMetricExporter     *Web_OpenTelemetry_OtelMetricExporter    `protobuf:\"bytes,6,opt,name=otel_metric_exporter,json=otelMetricExporter,proto3\" json:\"otel_metric_exporter,omitempty\"`\n\tOtelTraceExporter      *Web_OpenTelemetry_OtelTraceExporter     `protobuf:\"bytes,7,opt,name=otel_trace_exporter,json=otelTraceExporter,proto3\" json:\"otel_trace_exporter,omitempty\"`\n\tResource               *Web_OpenTelemetry_Resource              `protobuf:\"bytes,10,opt,name=resource,proto3\" json:\"resource,omitempty\"`\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *Web_OpenTelemetry) Reset() {\n\t*x = Web_OpenTelemetry{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_OpenTelemetry) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_OpenTelemetry) ProtoMessage() {}\n\nfunc (x *Web_OpenTelemetry) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[5]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry.ProtoReflect.Descriptor instead.\nfunc (*Web_OpenTelemetry) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4}\n}\n\nfunc (x *Web_OpenTelemetry) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.Enabled\n\t}\n\treturn false\n}\n\nfunc (x *Web_OpenTelemetry) GetMetricCollectDuration() *durationpb.Duration {\n\tif x != nil {\n\t\treturn x.MetricCollectDuration\n\t}\n\treturn nil\n}\n\nfunc (x *Web_OpenTelemetry) GetOtelTraceExporterType() Web_OpenTelemetry_OtelTraceExporterType {\n\tif x != nil {\n\t\treturn x.OtelTraceExporterType\n\t}\n\treturn Web_OpenTelemetry_trace_none\n}\n\nfunc (x *Web_OpenTelemetry) GetOtelMetricExporterType() Web_OpenTelemetry_OtelMetricExporterType {\n\tif x != nil {\n\t\treturn x.OtelMetricExporterType\n\t}\n\treturn Web_OpenTelemetry_metric_none\n}\n\nfunc (x *Web_OpenTelemetry) GetOtelLogExporterType() Web_OpenTelemetry_OtelLogExporterType {\n\tif x != nil {\n\t\treturn x.OtelLogExporterType\n\t}\n\treturn Web_OpenTelemetry_log_none\n}\n\nfunc (x *Web_OpenTelemetry) GetOtelMetricExporter() *Web_OpenTelemetry_OtelMetricExporter {\n\tif x != nil {\n\t\treturn x.OtelMetricExporter\n\t}\n\treturn nil\n}\n\nfunc (x *Web_OpenTelemetry) GetOtelTraceExporter() *Web_OpenTelemetry_OtelTraceExporter {\n\tif x != nil {\n\t\treturn x.OtelTraceExporter\n\t}\n\treturn nil\n}\n\nfunc (x *Web_OpenTelemetry) GetResource() *Web_OpenTelemetry_Resource {\n\tif x != nil {\n\t\treturn x.Resource\n\t}\n\treturn nil\n}\n\ntype Web_OpenTelemetry_Resource struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tServiceName   string                 `protobuf:\"bytes,1,opt,name=service_name,json=serviceName,proto3\" json:\"service_name,omitempty\"`\n\tAttrs         map[string]string      `protobuf:\"bytes,2,rep,name=attrs,proto3\" json:\"attrs,omitempty\" protobuf_key:\"bytes,1,opt,name=key\" protobuf_val:\"bytes,2,opt,name=value\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Web_OpenTelemetry_Resource) Reset() {\n\t*x = Web_OpenTelemetry_Resource{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_OpenTelemetry_Resource) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_OpenTelemetry_Resource) ProtoMessage() {}\n\nfunc (x *Web_OpenTelemetry_Resource) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[6]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry_Resource.ProtoReflect.Descriptor instead.\nfunc (*Web_OpenTelemetry_Resource) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4, 0}\n}\n\nfunc (x *Web_OpenTelemetry_Resource) GetServiceName() string {\n\tif x != nil {\n\t\treturn x.ServiceName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Web_OpenTelemetry_Resource) GetAttrs() map[string]string {\n\tif x != nil {\n\t\treturn x.Attrs\n\t}\n\treturn nil\n}\n\ntype Web_OpenTelemetry_OtelMetricExporter struct {\n\tstate         protoimpl.MessageState        `protogen:\"open.v1\"`\n\tPrometheus    *Web_OpenTelemetry_Prometheus `protobuf:\"bytes,1,opt,name=prometheus,proto3\" json:\"prometheus,omitempty\"`\n\tStdout        *Web_OpenTelemetry_Stdout     `protobuf:\"bytes,2,opt,name=stdout,proto3\" json:\"stdout,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Web_OpenTelemetry_OtelMetricExporter) Reset() {\n\t*x = Web_OpenTelemetry_OtelMetricExporter{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_OpenTelemetry_OtelMetricExporter) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_OpenTelemetry_OtelMetricExporter) ProtoMessage() {}\n\nfunc (x *Web_OpenTelemetry_OtelMetricExporter) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[7]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry_OtelMetricExporter.ProtoReflect.Descriptor instead.\nfunc (*Web_OpenTelemetry_OtelMetricExporter) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4, 1}\n}\n\nfunc (x *Web_OpenTelemetry_OtelMetricExporter) GetPrometheus() *Web_OpenTelemetry_Prometheus {\n\tif x != nil {\n\t\treturn x.Prometheus\n\t}\n\treturn nil\n}\n\nfunc (x *Web_OpenTelemetry_OtelMetricExporter) GetStdout() *Web_OpenTelemetry_Stdout {\n\tif x != nil {\n\t\treturn x.Stdout\n\t}\n\treturn nil\n}\n\ntype Web_OpenTelemetry_OtelTraceExporter struct {\n\tstate         protoimpl.MessageState    `protogen:\"open.v1\"`\n\tJaeger        *Web_OpenTelemetry_Jaeger `protobuf:\"bytes,1,opt,name=jaeger,proto3\" json:\"jaeger,omitempty\"`\n\tStdout        *Web_OpenTelemetry_Stdout `protobuf:\"bytes,2,opt,name=stdout,proto3\" json:\"stdout,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Web_OpenTelemetry_OtelTraceExporter) Reset() {\n\t*x = Web_OpenTelemetry_OtelTraceExporter{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_OpenTelemetry_OtelTraceExporter) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_OpenTelemetry_OtelTraceExporter) ProtoMessage() {}\n\nfunc (x *Web_OpenTelemetry_OtelTraceExporter) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[8]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry_OtelTraceExporter.ProtoReflect.Descriptor instead.\nfunc (*Web_OpenTelemetry_OtelTraceExporter) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4, 2}\n}\n\nfunc (x *Web_OpenTelemetry_OtelTraceExporter) GetJaeger() *Web_OpenTelemetry_Jaeger {\n\tif x != nil {\n\t\treturn x.Jaeger\n\t}\n\treturn nil\n}\n\nfunc (x *Web_OpenTelemetry_OtelTraceExporter) GetStdout() *Web_OpenTelemetry_Stdout {\n\tif x != nil {\n\t\treturn x.Stdout\n\t}\n\treturn nil\n}\n\ntype Web_OpenTelemetry_Prometheus struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tUrl           string                 `protobuf:\"bytes,1,opt,name=url,proto3\" json:\"url,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Web_OpenTelemetry_Prometheus) Reset() {\n\t*x = Web_OpenTelemetry_Prometheus{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_OpenTelemetry_Prometheus) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_OpenTelemetry_Prometheus) ProtoMessage() {}\n\nfunc (x *Web_OpenTelemetry_Prometheus) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[9]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry_Prometheus.ProtoReflect.Descriptor instead.\nfunc (*Web_OpenTelemetry_Prometheus) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4, 3}\n}\n\nfunc (x *Web_OpenTelemetry_Prometheus) GetUrl() string {\n\tif x != nil {\n\t\treturn x.Url\n\t}\n\treturn \"\"\n}\n\ntype Web_OpenTelemetry_Jaeger struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tUrl           string                 `protobuf:\"bytes,1,opt,name=url,proto3\" json:\"url,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Web_OpenTelemetry_Jaeger) Reset() {\n\t*x = Web_OpenTelemetry_Jaeger{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_OpenTelemetry_Jaeger) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_OpenTelemetry_Jaeger) ProtoMessage() {}\n\nfunc (x *Web_OpenTelemetry_Jaeger) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[10]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry_Jaeger.ProtoReflect.Descriptor instead.\nfunc (*Web_OpenTelemetry_Jaeger) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4, 4}\n}\n\nfunc (x *Web_OpenTelemetry_Jaeger) GetUrl() string {\n\tif x != nil {\n\t\treturn x.Url\n\t}\n\treturn \"\"\n}\n\ntype Web_OpenTelemetry_Stdout struct {\n\tstate         protoimpl.MessageState `protogen:\"open.v1\"`\n\tPrettyPrint   bool                   `protobuf:\"varint,1,opt,name=pretty_print,json=prettyPrint,proto3\" json:\"pretty_print,omitempty\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *Web_OpenTelemetry_Stdout) Reset() {\n\t*x = Web_OpenTelemetry_Stdout{}\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Web_OpenTelemetry_Stdout) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Web_OpenTelemetry_Stdout) ProtoMessage() {}\n\nfunc (x *Web_OpenTelemetry_Stdout) ProtoReflect() protoreflect.Message {\n\tmi := &file_pkg_webserver_webserver_proto_msgTypes[11]\n\tif x != nil {\n\t\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\t\tif ms.LoadMessageInfo() == nil {\n\t\t\tms.StoreMessageInfo(mi)\n\t\t}\n\t\treturn ms\n\t}\n\treturn mi.MessageOf(x)\n}\n\n// Deprecated: Use Web_OpenTelemetry_Stdout.ProtoReflect.Descriptor instead.\nfunc (*Web_OpenTelemetry_Stdout) Descriptor() ([]byte, []int) {\n\treturn file_pkg_webserver_webserver_proto_rawDescGZIP(), []int{0, 4, 5}\n}\n\nfunc (x *Web_OpenTelemetry_Stdout) GetPrettyPrint() bool {\n\tif x != nil {\n\t\treturn x.PrettyPrint\n\t}\n\treturn false\n}\n\nvar File_pkg_webserver_webserver_proto protoreflect.FileDescriptor\n\nconst file_pkg_webserver_webserver_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"\\x1dpkg/webserver/webserver.proto\\x12\\x10go.pkg.webserver\\x1a\\x1egoogle/protobuf/duration.proto\\\"\\xd1\\x13\\n\" +\n\t\"\\x03Web\\x12<\\n\" +\n\t\"\\fbind_address\\x18\\x01 \\x01(\\v2\\x19.go.pkg.webserver.Web.NetR\\vbindAddress\\x12.\\n\" +\n\t\"\\x04grpc\\x18\\x03 \\x01(\\v2\\x1a.go.pkg.webserver.Web.GrpcR\\x04grpc\\x12.\\n\" +\n\t\"\\x04http\\x18\\x04 \\x01(\\v2\\x1a.go.pkg.webserver.Web.HttpR\\x04http\\x121\\n\" +\n\t\"\\x05debug\\x18\\n\" +\n\t\" \\x01(\\v2\\x1b.go.pkg.webserver.Web.DebugR\\x05debug\\x12J\\n\" +\n\t\"\\x0eopen_telemetry\\x18\\f \\x01(\\v2#.go.pkg.webserver.Web.OpenTelemetryR\\ropenTelemetry\\x1a-\\n\" +\n\t\"\\x03Net\\x12\\x12\\n\" +\n\t\"\\x04host\\x18\\x01 \\x01(\\tR\\x04host\\x12\\x12\\n\" +\n\t\"\\x04port\\x18\\x02 \\x01(\\x05R\\x04port\\x1a\\xa7\\x01\\n\" +\n\t\"\\x04Grpc\\x127\\n\" +\n\t\"\\x18max_receive_message_size\\x18\\x03 \\x01(\\x05R\\x15maxReceiveMessageSize\\x121\\n\" +\n\t\"\\x15max_send_message_size\\x18\\x04 \\x01(\\x05R\\x12maxSendMessageSize\\x123\\n\" +\n\t\"\\atimeout\\x18\\x05 \\x01(\\v2\\x19.google.protobuf.DurationR\\atimeout\\x1a\\xe5\\x01\\n\" +\n\t\"\\x04Http\\x12L\\n\" +\n\t\"\\rapi_formatter\\x18\\x01 \\x01(\\x0e2'.go.pkg.webserver.Web.Http.ApiFormatterR\\fapiFormatter\\x123\\n\" +\n\t\"\\atimeout\\x18\\x03 \\x01(\\v2\\x19.google.protobuf.DurationR\\atimeout\\\"Z\\n\" +\n\t\"\\fApiFormatter\\x12\\f\\n\" +\n\t\"\\bapi_noop\\x10\\x00\\x12\\x12\\n\" +\n\t\"\\x0etcloud_api_v30\\x10\\x01\\x12\\x13\\n\" +\n\t\"\\x0ftrivial_api_v10\\x10\\x02\\x12\\x13\\n\" +\n\t\"\\x0ftrivial_api_v20\\x10\\x03\\x1aw\\n\" +\n\t\"\\x05Debug\\x12)\\n\" +\n\t\"\\x10enable_profiling\\x18\\x01 \\x01(\\bR\\x0fenableProfiling\\x12C\\n\" +\n\t\"\\x1edisable_print_inoutput_methods\\x18\\x02 \\x03(\\tR\\x1bdisablePrintInoutputMethods\\x1a\\xe3\\f\\n\" +\n\t\"\\rOpenTelemetry\\x12\\x18\\n\" +\n\t\"\\aenabled\\x18\\x01 \\x01(\\bR\\aenabled\\x12Q\\n\" +\n\t\"\\x17metric_collect_duration\\x18\\x02 \\x01(\\v2\\x19.google.protobuf.DurationR\\x15metricCollectDuration\\x12r\\n\" +\n\t\"\\x18otel_trace_exporter_type\\x18\\x03 \\x01(\\x0e29.go.pkg.webserver.Web.OpenTelemetry.OtelTraceExporterTypeR\\x15otelTraceExporterType\\x12u\\n\" +\n\t\"\\x19otel_metric_exporter_type\\x18\\x04 \\x01(\\x0e2:.go.pkg.webserver.Web.OpenTelemetry.OtelMetricExporterTypeR\\x16otelMetricExporterType\\x12l\\n\" +\n\t\"\\x16otel_log_exporter_type\\x18\\x05 \\x01(\\x0e27.go.pkg.webserver.Web.OpenTelemetry.OtelLogExporterTypeR\\x13otelLogExporterType\\x12h\\n\" +\n\t\"\\x14otel_metric_exporter\\x18\\x06 \\x01(\\v26.go.pkg.webserver.Web.OpenTelemetry.OtelMetricExporterR\\x12otelMetricExporter\\x12e\\n\" +\n\t\"\\x13otel_trace_exporter\\x18\\a \\x01(\\v25.go.pkg.webserver.Web.OpenTelemetry.OtelTraceExporterR\\x11otelTraceExporter\\x12H\\n\" +\n\t\"\\bresource\\x18\\n\" +\n\t\" \\x01(\\v2,.go.pkg.webserver.Web.OpenTelemetry.ResourceR\\bresource\\x1a\\xb6\\x01\\n\" +\n\t\"\\bResource\\x12!\\n\" +\n\t\"\\fservice_name\\x18\\x01 \\x01(\\tR\\vserviceName\\x12M\\n\" +\n\t\"\\x05attrs\\x18\\x02 \\x03(\\v27.go.pkg.webserver.Web.OpenTelemetry.Resource.AttrsEntryR\\x05attrs\\x1a8\\n\" +\n\t\"\\n\" +\n\t\"AttrsEntry\\x12\\x10\\n\" +\n\t\"\\x03key\\x18\\x01 \\x01(\\tR\\x03key\\x12\\x14\\n\" +\n\t\"\\x05value\\x18\\x02 \\x01(\\tR\\x05value:\\x028\\x01\\x1a\\xa8\\x01\\n\" +\n\t\"\\x12OtelMetricExporter\\x12N\\n\" +\n\t\"\\n\" +\n\t\"prometheus\\x18\\x01 \\x01(\\v2..go.pkg.webserver.Web.OpenTelemetry.PrometheusR\\n\" +\n\t\"prometheus\\x12B\\n\" +\n\t\"\\x06stdout\\x18\\x02 \\x01(\\v2*.go.pkg.webserver.Web.OpenTelemetry.StdoutR\\x06stdout\\x1a\\x9b\\x01\\n\" +\n\t\"\\x11OtelTraceExporter\\x12B\\n\" +\n\t\"\\x06jaeger\\x18\\x01 \\x01(\\v2*.go.pkg.webserver.Web.OpenTelemetry.JaegerR\\x06jaeger\\x12B\\n\" +\n\t\"\\x06stdout\\x18\\x02 \\x01(\\v2*.go.pkg.webserver.Web.OpenTelemetry.StdoutR\\x06stdout\\x1a\\x1e\\n\" +\n\t\"\\n\" +\n\t\"Prometheus\\x12\\x10\\n\" +\n\t\"\\x03url\\x18\\x01 \\x01(\\tR\\x03url\\x1a\\x1a\\n\" +\n\t\"\\x06Jaeger\\x12\\x10\\n\" +\n\t\"\\x03url\\x18\\x01 \\x01(\\tR\\x03url\\x1a+\\n\" +\n\t\"\\x06Stdout\\x12!\\n\" +\n\t\"\\fpretty_print\\x18\\x01 \\x01(\\bR\\vprettyPrint\\\"m\\n\" +\n\t\"\\x15OtelTraceExporterType\\x12\\x0e\\n\" +\n\t\"\\n\" +\n\t\"trace_none\\x10\\x00\\x12\\x10\\n\" +\n\t\"\\ftrace_stdout\\x10\\x01\\x12\\x0e\\n\" +\n\t\"\\n\" +\n\t\"trace_otlp\\x10\\x02\\x12\\x10\\n\" +\n\t\"\\ftrace_jaeger\\x10\\x03\\x12\\x10\\n\" +\n\t\"\\ftrace_zipkin\\x10\\x04\\\"d\\n\" +\n\t\"\\x16OtelMetricExporterType\\x12\\x0f\\n\" +\n\t\"\\vmetric_none\\x10\\x00\\x12\\x11\\n\" +\n\t\"\\rmetric_stdout\\x10\\x01\\x12\\x0f\\n\" +\n\t\"\\vmetric_otlp\\x10\\x02\\x12\\x15\\n\" +\n\t\"\\x11metric_prometheus\\x10\\x03\\\"1\\n\" +\n\t\"\\x13OtelLogExporterType\\x12\\f\\n\" +\n\t\"\\blog_none\\x10\\x00\\x12\\f\\n\" +\n\t\"\\blog_otlp\\x10\\x01J\\x04\\b\\v\\x10\\fR\\amonitorB2Z0github.com/kaydxh/golang/pkg/webserver;webserverb\\x06proto3\"\n\nvar (\n\tfile_pkg_webserver_webserver_proto_rawDescOnce sync.Once\n\tfile_pkg_webserver_webserver_proto_rawDescData []byte\n)\n\nfunc file_pkg_webserver_webserver_proto_rawDescGZIP() []byte {\n\tfile_pkg_webserver_webserver_proto_rawDescOnce.Do(func() {\n\t\tfile_pkg_webserver_webserver_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_pkg_webserver_webserver_proto_rawDesc), len(file_pkg_webserver_webserver_proto_rawDesc)))\n\t})\n\treturn file_pkg_webserver_webserver_proto_rawDescData\n}\n\nvar file_pkg_webserver_webserver_proto_enumTypes = make([]protoimpl.EnumInfo, 4)\nvar file_pkg_webserver_webserver_proto_msgTypes = make([]protoimpl.MessageInfo, 13)\nvar file_pkg_webserver_webserver_proto_goTypes = []any{\n\t(Web_Http_ApiFormatter)(0),                    // 0: go.pkg.webserver.Web.Http.ApiFormatter\n\t(Web_OpenTelemetry_OtelTraceExporterType)(0),  // 1: go.pkg.webserver.Web.OpenTelemetry.OtelTraceExporterType\n\t(Web_OpenTelemetry_OtelMetricExporterType)(0), // 2: go.pkg.webserver.Web.OpenTelemetry.OtelMetricExporterType\n\t(Web_OpenTelemetry_OtelLogExporterType)(0),    // 3: go.pkg.webserver.Web.OpenTelemetry.OtelLogExporterType\n\t(*Web)(nil),                                  // 4: go.pkg.webserver.Web\n\t(*Web_Net)(nil),                              // 5: go.pkg.webserver.Web.Net\n\t(*Web_Grpc)(nil),                             // 6: go.pkg.webserver.Web.Grpc\n\t(*Web_Http)(nil),                             // 7: go.pkg.webserver.Web.Http\n\t(*Web_Debug)(nil),                            // 8: go.pkg.webserver.Web.Debug\n\t(*Web_OpenTelemetry)(nil),                    // 9: go.pkg.webserver.Web.OpenTelemetry\n\t(*Web_OpenTelemetry_Resource)(nil),           // 10: go.pkg.webserver.Web.OpenTelemetry.Resource\n\t(*Web_OpenTelemetry_OtelMetricExporter)(nil), // 11: go.pkg.webserver.Web.OpenTelemetry.OtelMetricExporter\n\t(*Web_OpenTelemetry_OtelTraceExporter)(nil),  // 12: go.pkg.webserver.Web.OpenTelemetry.OtelTraceExporter\n\t(*Web_OpenTelemetry_Prometheus)(nil),         // 13: go.pkg.webserver.Web.OpenTelemetry.Prometheus\n\t(*Web_OpenTelemetry_Jaeger)(nil),             // 14: go.pkg.webserver.Web.OpenTelemetry.Jaeger\n\t(*Web_OpenTelemetry_Stdout)(nil),             // 15: go.pkg.webserver.Web.OpenTelemetry.Stdout\n\tnil,                                          // 16: go.pkg.webserver.Web.OpenTelemetry.Resource.AttrsEntry\n\t(*durationpb.Duration)(nil),                  // 17: google.protobuf.Duration\n}\nvar file_pkg_webserver_webserver_proto_depIdxs = []int32{\n\t5,  // 0: go.pkg.webserver.Web.bind_address:type_name -> go.pkg.webserver.Web.Net\n\t6,  // 1: go.pkg.webserver.Web.grpc:type_name -> go.pkg.webserver.Web.Grpc\n\t7,  // 2: go.pkg.webserver.Web.http:type_name -> go.pkg.webserver.Web.Http\n\t8,  // 3: go.pkg.webserver.Web.debug:type_name -> go.pkg.webserver.Web.Debug\n\t9,  // 4: go.pkg.webserver.Web.open_telemetry:type_name -> go.pkg.webserver.Web.OpenTelemetry\n\t17, // 5: go.pkg.webserver.Web.Grpc.timeout:type_name -> google.protobuf.Duration\n\t0,  // 6: go.pkg.webserver.Web.Http.api_formatter:type_name -> go.pkg.webserver.Web.Http.ApiFormatter\n\t17, // 7: go.pkg.webserver.Web.Http.timeout:type_name -> google.protobuf.Duration\n\t17, // 8: go.pkg.webserver.Web.OpenTelemetry.metric_collect_duration:type_name -> google.protobuf.Duration\n\t1,  // 9: go.pkg.webserver.Web.OpenTelemetry.otel_trace_exporter_type:type_name -> go.pkg.webserver.Web.OpenTelemetry.OtelTraceExporterType\n\t2,  // 10: go.pkg.webserver.Web.OpenTelemetry.otel_metric_exporter_type:type_name -> go.pkg.webserver.Web.OpenTelemetry.OtelMetricExporterType\n\t3,  // 11: go.pkg.webserver.Web.OpenTelemetry.otel_log_exporter_type:type_name -> go.pkg.webserver.Web.OpenTelemetry.OtelLogExporterType\n\t11, // 12: go.pkg.webserver.Web.OpenTelemetry.otel_metric_exporter:type_name -> go.pkg.webserver.Web.OpenTelemetry.OtelMetricExporter\n\t12, // 13: go.pkg.webserver.Web.OpenTelemetry.otel_trace_exporter:type_name -> go.pkg.webserver.Web.OpenTelemetry.OtelTraceExporter\n\t10, // 14: go.pkg.webserver.Web.OpenTelemetry.resource:type_name -> go.pkg.webserver.Web.OpenTelemetry.Resource\n\t16, // 15: go.pkg.webserver.Web.OpenTelemetry.Resource.attrs:type_name -> go.pkg.webserver.Web.OpenTelemetry.Resource.AttrsEntry\n\t13, // 16: go.pkg.webserver.Web.OpenTelemetry.OtelMetricExporter.prometheus:type_name -> go.pkg.webserver.Web.OpenTelemetry.Prometheus\n\t15, // 17: go.pkg.webserver.Web.OpenTelemetry.OtelMetricExporter.stdout:type_name -> go.pkg.webserver.Web.OpenTelemetry.Stdout\n\t14, // 18: go.pkg.webserver.Web.OpenTelemetry.OtelTraceExporter.jaeger:type_name -> go.pkg.webserver.Web.OpenTelemetry.Jaeger\n\t15, // 19: go.pkg.webserver.Web.OpenTelemetry.OtelTraceExporter.stdout:type_name -> go.pkg.webserver.Web.OpenTelemetry.Stdout\n\t20, // [20:20] is the sub-list for method output_type\n\t20, // [20:20] is the sub-list for method input_type\n\t20, // [20:20] is the sub-list for extension type_name\n\t20, // [20:20] is the sub-list for extension extendee\n\t0,  // [0:20] is the sub-list for field type_name\n}\n\nfunc init() { file_pkg_webserver_webserver_proto_init() }\nfunc file_pkg_webserver_webserver_proto_init() {\n\tif File_pkg_webserver_webserver_proto != nil {\n\t\treturn\n\t}\n\ttype x struct{}\n\tout := protoimpl.TypeBuilder{\n\t\tFile: protoimpl.DescBuilder{\n\t\t\tGoPackagePath: reflect.TypeOf(x{}).PkgPath(),\n\t\t\tRawDescriptor: unsafe.Slice(unsafe.StringData(file_pkg_webserver_webserver_proto_rawDesc), len(file_pkg_webserver_webserver_proto_rawDesc)),\n\t\t\tNumEnums:      4,\n\t\t\tNumMessages:   13,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_pkg_webserver_webserver_proto_goTypes,\n\t\tDependencyIndexes: file_pkg_webserver_webserver_proto_depIdxs,\n\t\tEnumInfos:         file_pkg_webserver_webserver_proto_enumTypes,\n\t\tMessageInfos:      file_pkg_webserver_webserver_proto_msgTypes,\n\t}.Build()\n\tFile_pkg_webserver_webserver_proto = out.File\n\tfile_pkg_webserver_webserver_proto_goTypes = nil\n\tfile_pkg_webserver_webserver_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "pkg/webserver/webserver.proto",
    "content": "syntax = \"proto3\";\n\npackage go.pkg.webserver;\n\nimport \"google/protobuf/duration.proto\";\n\noption go_package = \"github.com/kaydxh/golang/pkg/webserver;webserver\";\n\nmessage Web {\n  Net bind_address = 1;\n  message Net {\n    string host = 1;\n    int32 port = 2;\n  }\n\n  Grpc grpc = 3;\n  message Grpc {\n    int32 max_receive_message_size = 3;\n    int32 max_send_message_size = 4;\n    google.protobuf.Duration timeout = 5;\n  }\n\n  Http http = 4;\n  message Http {\n    ApiFormatter api_formatter = 1;\n    // timeout 0 is not unlimited\n    google.protobuf.Duration timeout = 3;\n\n    enum ApiFormatter {\n      api_noop = 0;\n      tcloud_api_v30 = 1;\n      trivial_api_v10 = 2;\n      trivial_api_v20 = 3;\n    }\n  }\n\n  Debug debug = 10;\n  message Debug {\n    bool enable_profiling = 1;\n    repeated string disable_print_inoutput_methods = 2;\n  }\n\n  // OpenTelemetry 统一监控配置（替代旧的 Monitor）\n  OpenTelemetry open_telemetry = 12;\n  message OpenTelemetry {\n    bool enabled = 1;\n\n    google.protobuf.Duration metric_collect_duration = 2;\n    OtelTraceExporterType otel_trace_exporter_type = 3;\n    OtelMetricExporterType otel_metric_exporter_type = 4;\n    OtelLogExporterType otel_log_exporter_type = 5;\n\n    OtelMetricExporter otel_metric_exporter = 6;\n    OtelTraceExporter otel_trace_exporter = 7;\n\n    Resource resource = 10;\n\n    message Resource {\n      string service_name = 1;\n      map<string, string> attrs = 2;\n    }\n\n    message OtelMetricExporter {\n      Prometheus prometheus = 1;\n      Stdout stdout = 2;\n    }\n\n    message OtelTraceExporter {\n      Jaeger jaeger = 1;\n      Stdout stdout = 2;\n    }\n\n    message Prometheus {\n      string url = 1;\n    }\n\n    message Jaeger {\n      string url = 1;\n    }\n\n    message Stdout {\n      bool pretty_print = 1;\n    }\n\n    enum OtelTraceExporterType {\n      trace_none = 0;\n      trace_stdout = 1;\n      trace_otlp = 2;\n      trace_jaeger = 3;\n      trace_zipkin = 4;\n    }\n\n    enum OtelMetricExporterType {\n      metric_none = 0;\n      metric_stdout = 1;\n      metric_otlp = 2;\n      metric_prometheus = 3;\n    }\n\n    enum OtelLogExporterType {\n      log_none = 0;\n      log_otlp = 1;\n    }\n  }\n\n  // Deprecated: 使用 open_telemetry 替代\n  // 保留字段编号以保持向后兼容\n  reserved 11;\n  reserved \"monitor\";\n}\n"
  },
  {
    "path": "pkg/webserver/webserver.proto.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage webserver\n\nimport \"fmt\"\n\nfunc (w *Web) GetBindHostPort() string {\n\taddr := w.GetBindAddress()\n\n\treturn fmt.Sprintf(\"%s:%d\", addr.GetHost(), addr.GetPort())\n}\n"
  },
  {
    "path": "pkg/webserver/webserver.yaml",
    "content": "web:\n  bind_address:\n    host: 0.0.0.0\n    port: 10000\n  grpc:\n    max_receive_message_size: 0 # 0 means max message size \n    max_send_message_size : 0\n    timeout: 0s\n  http:\n    timeout: 0s\n  debug:\n    enable_profiling: true\n    # print inoutput use local middleware function\n    disable_print_inoutput_methods: [\"\"]\n  \n  # OpenTelemetry 统一监控配置\n  open_telemetry:\n    enabled: true\n    metric_collect_duration: 60s\n    otel_trace_exporter_type: trace_stdout\n    otel_metric_exporter_type: metric_stdout\n    otel_log_exporter_type: log_none\n    otel_metric_exporter:\n      stdout:\n        pretty_print: true\n      prometheus:\n        url: /metrics\n    otel_trace_exporter:\n      stdout:\n        pretty_print: true\n      jaeger:\n        url: http://localhost:14268/api/traces\n    resource:\n      service_name: \"\"  # 默认使用进程名\n      attrs: {}\n\n  # QPS限流配置\n  qps_limit:\n    grpc:\n      default_qps: 0        # 默认QPS，0表示不限制\n      default_burst: 0      # 默认突发容量\n      max_concurrency: 0    # 最大并发数限制，0表示不限制\n      method_qps: []\n    http:\n      default_qps: 0\n      default_burst: 0\n      max_concurrency: 0\n      method_qps: []\n\n"
  },
  {
    "path": "pkg/webserver/webserver_qps_limit.go",
    "content": "/*\n *Copyright (c) 2024, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage webserver\n\nimport (\n\tgw_ \"github.com/kaydxh/golang/pkg/grpc-gateway\"\n)\n\n// QPSLimitConfig QPS限流配置\ntype QPSLimitConfig struct {\n\t// DefaultQPS 默认QPS限制，0表示不限制\n\tDefaultQPS float64 `json:\"default_qps\" yaml:\"default_qps\"`\n\t// DefaultBurst 默认突发容量，0表示使用DefaultQPS值\n\tDefaultBurst int `json:\"default_burst\" yaml:\"default_burst\"`\n\t// MaxConcurrency 最大并发数限制，0表示不限制\n\t// 与QPS限流不同，并发控制限制的是同时处理的请求数，请求完成后令牌会归还\n\tMaxConcurrency int `json:\"max_concurrency\" yaml:\"max_concurrency\"`\n\t// MethodQPS 方法/路径级QPS配置\n\tMethodQPS []MethodQPSConfigItem `json:\"method_qps\" yaml:\"method_qps\"`\n}\n\n// MethodQPSConfigItem 方法级QPS配置项\ntype MethodQPSConfigItem struct {\n\t// Method 方法名（gRPC: /package.Service/Method）或路径（HTTP: /api/v1/users）\n\tMethod string `json:\"method\" yaml:\"method\"`\n\t// QPS 每秒请求数限制\n\tQPS float64 `json:\"qps\" yaml:\"qps\"`\n\t// Burst 突发容量，0表示使用QPS值\n\tBurst int `json:\"burst\" yaml:\"burst\"`\n\t// MaxConcurrency 方法级最大并发数限制，0表示不限制\n\tMaxConcurrency int `json:\"max_concurrency\" yaml:\"max_concurrency\"`\n}\n\n// ExtendedConfig 扩展配置，用于支持proto中未定义的字段\n// 通过yaml配置文件或代码方式设置\ntype ExtendedConfig struct {\n\t// GrpcQPSLimit gRPC QPS限流配置\n\tGrpcQPSLimit *QPSLimitConfig `json:\"grpc_qps_limit\" yaml:\"grpc_qps_limit\"`\n\t// HttpQPSLimit HTTP QPS限流配置\n\tHttpQPSLimit *QPSLimitConfig `json:\"http_qps_limit\" yaml:\"http_qps_limit\"`\n}\n\n// ToGRPCQPSLimitConfig 转换为gRPC网关QPS限流配置\nfunc (c *QPSLimitConfig) ToGRPCQPSLimitConfig() gw_.QPSLimitConfig {\n\tconfig := gw_.QPSLimitConfig{\n\t\tDefaultQPS:           c.DefaultQPS,\n\t\tDefaultBurst:         c.DefaultBurst,\n\t\tMaxConcurrency:       c.MaxConcurrency,\n\t\tMethodQPS:            make(map[string]float64),\n\t\tMethodBurst:          make(map[string]int),\n\t\tMethodMaxConcurrency: make(map[string]int),\n\t}\n\tfor _, item := range c.MethodQPS {\n\t\tconfig.MethodQPS[item.Method] = item.QPS\n\t\tif item.Burst > 0 {\n\t\t\tconfig.MethodBurst[item.Method] = item.Burst\n\t\t}\n\t\tif item.MaxConcurrency > 0 {\n\t\t\tconfig.MethodMaxConcurrency[item.Method] = item.MaxConcurrency\n\t\t}\n\t}\n\treturn config\n}\n\n// ToHTTPQPSLimitConfig 转换为HTTP QPS限流配置\nfunc (c *QPSLimitConfig) ToHTTPQPSLimitConfig() gw_.HTTPQPSLimitConfig {\n\tconfig := gw_.HTTPQPSLimitConfig{\n\t\tDefaultQPS:         c.DefaultQPS,\n\t\tDefaultBurst:       c.DefaultBurst,\n\t\tMaxConcurrency:     c.MaxConcurrency,\n\t\tPathQPS:            make(map[string]float64),\n\t\tPathBurst:          make(map[string]int),\n\t\tPathMaxConcurrency: make(map[string]int),\n\t}\n\tfor _, item := range c.MethodQPS {\n\t\tconfig.PathQPS[item.Method] = item.QPS\n\t\tif item.Burst > 0 {\n\t\t\tconfig.PathBurst[item.Method] = item.Burst\n\t\t}\n\t\tif item.MaxConcurrency > 0 {\n\t\t\tconfig.PathMaxConcurrency[item.Method] = item.MaxConcurrency\n\t\t}\n\t}\n\treturn config\n}\n"
  },
  {
    "path": "pkg/webserver/webserver_test.go",
    "content": "/*\n *Copyright (c) 2022, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\npackage webserver_test\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"context\"\n\n\tprototext_ \"github.com/kaydxh/golang/pkg/protobuf/prototext\"\n\tviper_ \"github.com/kaydxh/golang/pkg/viper\"\n\twebserver_ \"github.com/kaydxh/golang/pkg/webserver\"\n)\n\nfunc TestNew(t *testing.T) {\n\t/*\n\t\tviper.SetConfigName(\"webserver\")\n\t\tviper.SetConfigType(\"yaml\")\n\t\tviper.AddConfigPath(\".\")\n\t*/\n\t/*\n\t\tviper.SetConfigFile(\"./webserver.yaml\")\n\t\terr := viper.ReadInConfig()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"failed to read config err: %v\", err)\n\t\t\treturn\n\t\t}\n\t\tsubv := viper.Sub(\"web\")\n\t*/\n\n\tcfgFile := \"./webserver.yaml\"\n\tconfig := webserver_.NewConfig(webserver_.WithViper(viper_.GetViper(cfgFile, \"web\")))\n\n\ts, err := config.Complete().New(context.Background())\n\tif err != nil {\n\t\tt.Errorf(\"failed to new config err: %v\", err)\n\t}\n\ts.InstallWebHandlers()\n\tprepared, err := s.PrepareRun()\n\tif err != nil {\n\t\tt.Errorf(\"failed to PrepareRun err: %v\", err)\n\t}\n\n\tt.Logf(\"bind address: %v\", config.GetBindAddress())\n\n\tprepared.Run(context.Background())\n\n}\n\nfunc TestPrintProto(t *testing.T) {\n\tconfig := &webserver_.Web{\n\t\tBindAddress: &webserver_.Web_Net{\n\t\t\tHost: \"192.168.0.1\",\n\t\t},\n\t}\n\ts := prototext_.FormatWithLength(config, 30)\n\t//s := prototext.MarshalOptions{}.Format(config)\n\tfmt.Printf(\"%s\\n\", s)\n}\n"
  },
  {
    "path": "script/copyright.sh",
    "content": "#!/usr/bin/env bash\n\n# Fail on any error.\nset -euo pipefail\n# set -o xtrace\n\npushd \"$(dirname $0)\" > /dev/null || exit\nSCRIPT_PATH=$(pwd -P)\npopd > /dev/null || exit\n\nfor i in $(find . -name '*.go')\ndo\n  if  ! grep -q Copyright \"$i\" ; then\n     # exclud third_party and tutorial\n     if [[ \"$i\" != *\"third_party\"* && \"$i\" != *\"tutorial\"* && \"$i\" != *\".pb.\"* ]]; then\n       #echo \"$i\"\n       cat \"${SCRIPT_PATH}\"/copyright.txt \"$i\" >\"$i\".new && mv \"$i\".new \"$i\"\n     fi\n  fi\ndone\n"
  },
  {
    "path": "script/copyright.txt",
    "content": "/*\n *Copyright (c) 2023, kaydxh\n *\n *Permission is hereby granted, free of charge, to any person obtaining a copy\n *of this software and associated documentation files (the \"Software\"), to deal\n *in the Software without restriction, including without limitation the rights\n *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *copies of the Software, and to permit persons to whom the Software is\n *furnished to do so, subject to the following conditions:\n *\n *The above copyright notice and this permission notice shall be included in all\n *copies or substantial portions of the Software.\n *\n *THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n *SOFTWARE.\n */\n"
  },
  {
    "path": "script/go_proto_gen.sh",
    "content": "# Created by kayxhding on 2020-10-11 12:40:37\n#!/usr/bin/env bash\n\n# exit by command return non-zero exit code\nset -o errexit\n# Indicate an error when it encounters an undefined variable\nset -o nounset\n# Fail on any error.\nset -o pipefail\n#set -o xtrace\n\n# example, generate golang proto files\n# bash go_proto_gen.sh -I . --proto_file_path pkg/webserver/webserver.proto --with-go\n\n# if script called by source, $0 is the name of father script, not the name of source run script\nSCRIPT_PATH=$(cd `dirname \"${BASH_SOURCE[0]}\"`;pwd)\n\n<<'COMMENT'\nSCRIPT=$(readlink -f \"${BASH_SOURCE[0]}\")\nSCRIPT_PATH=$(dirname \"$SCRIPT\")\necho ${SCRIPT_PATH}\nCOMMENT\n\nPROTOC_FILE_DIR=\nPROTO_HEADERS=\n# 从 Go Module 缓存中获取 grpc-gateway v1 的路径，其 third_party/googleapis 包含 google/api/annotations.proto\nGRPC_GATEWAY_DIR=$(go list -m -f '{{.Dir}}' github.com/grpc-ecosystem/grpc-gateway 2>/dev/null || echo \"\")\n# 兼容本地 third_party 目录（当 go module 不可用时作为回退）\nTHIRD_PARTY_DIR=\"${SCRIPT_PATH}/third_party\"\nWITH_DOC=\nWITH_CPP=\nWITH_GO=\n\nfunction die() {\n  echo 1>&2 \"$*\"\n  exit 1\n}\n\nfunction getopts() {\n  local -a protodirs\n  while test $# -ne 0\n  do\n    case \"$1\" in\n       -I|--proto_path)\n             protodirs+=(\n             \"-I $(realpath \"$2\")\"\n            )\n            shift\n            ;;\n       --third_party_path)\n           THIRD_PARTY_DIR=$(realpath \"$2\")\n           GRPC_GATEWAY_DIR=\"\"\n            shift\n            ;;\n       --with-doc)\n            WITH_DOC=1\n            ;;\n       --proto_file_path)\n            PROTOC_FILE_DIR=$(realpath \"$2\")\n            shift\n            ;;\n       --with-cpp)\n           WITH_CPP=1\n           ;;\n       --with-go)\n           WITH_GO=1\n           ;;\n     esac\n     shift\n done\n\n PROTO_HEADERS=\"${protodirs[*]}\"\n # echo \"${protodirs[*]}\"\n}\n\n<<'COMMENT'\n# This will place three binaries in your $GOBIN\n# Make sure that your $GOBIN is in your $PATH\n# install protoc-gen-doc on mac=> https:\n# github.com/pseudomuto/protoc-gen-doc/issues/20  (make build, cp bin/protoc-gen-doc ${GOBIN})\n go install \\\n    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \\\n    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \\\n    google.golang.org/protobuf/cmd/protoc-gen-go \\\n    google.golang.org/grpc/cmd/protoc-gen-go-grpc \\\n    github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc \\\n    github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \nCOMMENT\n\necho `pwd`\n\ngetopts $@\n\necho \"==> Checking tools...\"\n\n# 确保 GOPATH/bin 和 GOBIN 在 PATH 中，go install 安装的二进制文件才能被找到\nGOBIN_DIR=\"${GOBIN:-$(go env GOBIN)}\"\nGOPATH_BIN=\"$(go env GOPATH)/bin\"\nif [[ -n \"${GOBIN_DIR}\" ]] && [[ \":${PATH}:\" != *\":${GOBIN_DIR}:\"* ]]; then\n  export PATH=\"${GOBIN_DIR}:${PATH}\"\nfi\nif [[ -n \"${GOPATH_BIN}\" ]] && [[ \":${PATH}:\" != *\":${GOPATH_BIN}:\"* ]]; then\n  export PATH=\"${GOPATH_BIN}:${PATH}\"\nfi\n\n# 工具名 -> go install 路径的映射\ndeclare -A TOOL_INSTALL_MAP=(\n  [\"protoc-gen-go\"]=\"google.golang.org/protobuf/cmd/protoc-gen-go@latest\"\n  [\"protoc-gen-go-grpc\"]=\"google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest\"\n  [\"protoc-gen-grpc-gateway\"]=\"github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest\"\n  [\"protoc-gen-doc\"]=\"github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest\"\n)\n\n# 工具名 -> 期望的模块路径前缀（用于版本校验，防止 v1/v2 混装）\n# 通过 go version -m <binary> 检查已安装二进制的来源模块是否匹配\ndeclare -A TOOL_EXPECTED_MODULE=(\n  [\"protoc-gen-grpc-gateway\"]=\"github.com/grpc-ecosystem/grpc-gateway/v2\"\n)\n\n# 检查已安装工具的模块路径是否与期望匹配\n# 返回 0 表示匹配，1 表示不匹配\nfunction check_tool_module() {\n  local tool_name=\"$1\"\n  local expected_module=\"${TOOL_EXPECTED_MODULE[${tool_name}]:-}\"\n  # 没有配置期望模块的工具，跳过校验\n  if [[ -z \"${expected_module}\" ]]; then\n    return 0\n  fi\n  local tool_path\n  tool_path=$(command -v \"${tool_name}\" 2>/dev/null || echo \"\")\n  if [[ -z \"${tool_path}\" ]]; then\n    return 1\n  fi\n  # 使用 go version -m 获取二进制的构建信息，检查模块路径\n  local build_info\n  build_info=$(go version -m \"${tool_path}\" 2>/dev/null || echo \"\")\n  if echo \"${build_info}\" | grep -q \"${expected_module}\"; then\n    return 0\n  else\n    echo 1>&2 \"WARNING: ${tool_name} at ${tool_path} is not from expected module '${expected_module}', will reinstall\"\n    return 1\n  fi\n}\n\n#GEN_PROTO_TOOLS=(protoc protoc-gen-go protoc-gen-grpc-gateway protoc-gen-govalidators)\nGEN_PROTO_TOOLS=(protoc protoc-gen-go protoc-gen-go-grpc protoc-gen-grpc-gateway protoc-gen-doc)\nfor tool in \"${GEN_PROTO_TOOLS[@]}\"; do\n   need_install=false\n   if command -v ${tool} &>/dev/null; then\n     # 工具存在，但需要校验版本/模块是否匹配\n     if check_tool_module \"${tool}\"; then\n       echo 1>&2 \"${tool}: $(command -v ${tool})\"\n     else\n       need_install=true\n     fi\n   else\n     need_install=true\n   fi\n\n   if [[ \"${need_install}\" == \"true\" ]]; then\n     install_pkg=\"${TOOL_INSTALL_MAP[${tool}]:-}\"\n     if [[ -n \"${install_pkg}\" ]]; then\n       echo 1>&2 \"${tool} not found or version mismatch, installing via: go install ${install_pkg}\"\n       go install \"${install_pkg}\" || die \"failed to install ${tool}\"\n       # 刷新 hash 缓存，确保 shell 能找到新安装的二进制\n       hash -r 2>/dev/null || true\n       echo 1>&2 \"${tool}: $(command -v ${tool})\"\n     else\n       die \"didn't find ${tool}, please install it manually\"\n     fi\n   fi\ndone\n\n\necho \"==> Generating proto...\"\n# \"-I .\" need behind PROTO_HEADERS, or remove it\nproto_headers=\"${PROTO_HEADERS} -I `pwd`\"\n# 优先从 Go Module 缓存获取 google/api proto 依赖，无需在项目内维护 third_party 副本\nif [[ -n \"${GRPC_GATEWAY_DIR}\" ]]; then\n  proto_headers=\"${proto_headers} -I ${GRPC_GATEWAY_DIR}/third_party/googleapis\"\nelif [[ -d \"${THIRD_PARTY_DIR}/github.com/grpc-ecosystem/grpc-gateway\" ]]; then\n  proto_headers=\"${proto_headers} -I ${THIRD_PARTY_DIR}/github.com/grpc-ecosystem/grpc-gateway\"\nelse\n  die \"无法找到 google/api proto 依赖，请确保 go.mod 中包含 github.com/grpc-ecosystem/grpc-gateway 或通过 --third_party_path 指定\"\nfi\nsource_relative_option=\"paths=source_relative:.\"\ngo_opt_option=\"\"\ngo_out_option=\"\"\ngo_tag_option=\"\"\ngo_grpc_option=\"\"\ndoc_option=\"\"\ndoc_out_option=\"\"\ncpp_option=\"\"\ncpp_out_option=\"\"\ncpp_grpc_option=\"\"\n# HTTP 路由优先从 proto 里的 google.api.http 注解读取，同时支持 yaml 配置文件兜底。\ngrpc_gateway_out_option=\"--grpc-gateway_out=logtostderr=true\"\ngrpc_gateway_delete_option=\"--grpc-gateway_opt=allow_delete_body=true\"\ngrpc_gateway_option=\"\"\n\nfor proto in $(find ${PROTOC_FILE_DIR} -type f -name '*.proto' -print0 | xargs -0); do\n  echo \"Generating ${proto}\"\n  proto_base_name=\"$(basename ${proto} .proto)\"\n  api_conf_yaml_base_name=\"${proto_base_name}.yaml\"\n  api_conf_yaml_dir=\"$(dirname ${proto})\"\n  api_conf_yaml=\"${api_conf_yaml_dir}/$api_conf_yaml_base_name\"\n  grpc_api_yaml_option=\"\"\n  grpc_gateway_option=\"\"\n\n  # 如果存在同名 yaml 配置文件，则使用 grpc_api_configuration 指定 HTTP 路由映射\n  if [[ -f \"${api_conf_yaml}\" ]];then\n    grpc_api_yaml_option=\"grpc_api_configuration=${api_conf_yaml},${source_relative_option}\"\n    grpc_gateway_option=\"${grpc_gateway_out_option},${grpc_api_yaml_option} ${grpc_gateway_delete_option}\"\n  else\n    grpc_gateway_option=\"${grpc_gateway_out_option},${source_relative_option} ${grpc_gateway_delete_option}\"\n  fi\n\n  if [[ \"${WITH_DOC}\" -eq 1 ]]; then\n    # output file name\n    doc_option=\"--doc_opt=markdown,${proto_base_name}.md\"\n    # docs output directory is created on demand so downstream projects do not need to pre-create it\n    doc_out_dir=\"${SCRIPT_PATH}/../docs\"\n    mkdir -p \"${doc_out_dir}\"\n    doc_out_option=\"--doc_out=${doc_out_dir}\"\n  fi\n\n  if [[ \"${WITH_CPP}\" -eq 1 ]]; then\n    cpp_option=\"--cpp_out=.\"\n    cpp_out_option=\"--grpc_out=.\"\n    cpp_grpc_option=\"--plugin=protoc-gen-grpc=`which grpc_cpp_plugin`\"\n  fi\n\n  if [[ \"${WITH_GO}\" -eq 1 ]]; then\n    # go_tag_option=\"--go-tag_out=${source_relative_option}\"\n    go_out_option=\"--go_out=.\"\n    go_opt_option=\"--go_opt=paths=source_relative\"\n    go_grpc_option=\"--go-grpc_out=${source_relative_option}\"\n  fi\n\n  # 打印最终 protoc 调用命令，便于排查 proto 生成问题。\n  echo \"+ protoc ${proto_headers} ${go_out_option} ${go_tag_option} ${go_opt_option} ${go_grpc_option} ${grpc_gateway_option} ${cpp_out_option} ${cpp_option} ${doc_option} ${doc_out_option} ${cpp_grpc_option} ${proto}\"\n  protoc ${proto_headers} ${go_out_option} ${go_tag_option} ${go_opt_option} ${go_grpc_option} ${grpc_gateway_option} ${cpp_out_option} ${cpp_option} ${doc_option} ${doc_out_option} ${cpp_grpc_option} \"${proto}\"\n  #protoc -I . ${proto_headers} --go-tag_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. --grpc-gateway_out=logtostderr=true,grpc_api_configuration=${api_conf_yaml},paths=source_relative:. --grpc-gateway_opt=allow_delete_body=true ${f}\ndone\n"
  },
  {
    "path": "script/tools/cat.sh",
    "content": "#!/bin/sh\n\nif [ \"$#\" -lt 1 ]; then\n    echo \"Usage: $0 filename [keyword]\"\n    exit 1\nfi\n\nFILENAME=$1\nKEYWORD=$2\nLINES=$3\n\nif [ ! -f \"$FILENAME\" ]; then\n    echo \"File not found: $FILENAME\"\n    exit 1\nfi\n\nif [ -z \"$KEYWORD\" ] && [ -z \"$LINES\" ]; then\n    cat \"$FILENAME\"\nelif [ -z \"$KEYWORD\" ]; then\n    head -n \"$LINES\" \"$FILENAME\"\nelif [ -z \"$LINES\" ]; then\n    grep --color=auto \"$KEYWORD\" \"$FILENAME\"\nelse\n    grep --color=auto \"$KEYWORD\" \"$FILENAME\" | head -n \"$LINES\"\nfi\n"
  },
  {
    "path": "script/tools/dmesg.sh",
    "content": "#!/usr/bin/env bash\n#\n# exit by command return non-zero exit code\nset -o errexit\n# Indicate an error when it encounters an undefined variable\nset -o nounset\n# Fail on any error.\nset -o pipefail\n# set -o xtrace\n#\n# bash dmesg.sh \"abc\" 10\n\ngrep_pattern=${1:-''}\ngrep_n=${2:-0}\ntail_n=${3:-$((${grep_n} + 1))}\n\ndmesg -T | grep -C ${grep_n} \"${grep_pattern}\" | tail -n ${tail_n}\n"
  },
  {
    "path": "third_party/README.md",
    "content": "# `/third_party`\n\nExternal helper tools, forked code and other 3rd party utilities (e.g., Swagger UI).\n"
  },
  {
    "path": "third_party/github.com/grpc-ecosystem/grpc-gateway/google/api/annotations.proto",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage google.api;\n\nimport \"google/api/http.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\noption go_package = \"google.golang.org/genproto/googleapis/api/annotations;annotations\";\noption java_multiple_files = true;\noption java_outer_classname = \"AnnotationsProto\";\noption java_package = \"com.google.api\";\noption objc_class_prefix = \"GAPI\";\n\nextend google.protobuf.MethodOptions {\n  // See `HttpRule`.\n  HttpRule http = 72295728;\n}\n"
  },
  {
    "path": "third_party/github.com/grpc-ecosystem/grpc-gateway/google/api/http.proto",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage google.api;\n\noption go_package = \"google.golang.org/genproto/googleapis/api/annotations;annotations\";\noption java_multiple_files = true;\noption java_outer_classname = \"HttpProto\";\noption java_package = \"com.google.api\";\noption objc_class_prefix = \"GAPI\";\n\n// Defines the HTTP configuration for an API service. It contains a list of\n// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method\n// to one or more HTTP REST API methods.\nmessage Http {\n  // A list of HTTP configuration rules that apply to individual API methods.\n  //\n  // **NOTE:** All service configuration rules follow \"last one wins\" order.\n  repeated HttpRule rules = 1;\n\n  // When set to true, URL path parameters will be fully URI-decoded except in\n  // cases of single segment matches in reserved expansion, where \"%2F\" will be\n  // left encoded.\n  //\n  // The default behavior is to not decode RFC 6570 reserved characters in multi\n  // segment matches.\n  bool fully_decode_reserved_expansion = 2;\n}\n\n// gRPC Transcoding\n//\n// gRPC Transcoding is a feature for mapping between a gRPC method and one or\n// more HTTP REST endpoints. It allows developers to build a single API service\n// that supports both gRPC APIs and REST APIs. Many systems, including [Google\n// APIs](https://github.com/googleapis/googleapis),\n// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC\n// Gateway](https://github.com/grpc-ecosystem/grpc-gateway),\n// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature\n// and use it for large scale production services.\n//\n// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies\n// how different portions of the gRPC request message are mapped to the URL\n// path, URL query parameters, and HTTP request body. It also controls how the\n// gRPC response message is mapped to the HTTP response body. `HttpRule` is\n// typically specified as an `google.api.http` annotation on the gRPC method.\n//\n// Each mapping specifies a URL path template and an HTTP method. The path\n// template may refer to one or more fields in the gRPC request message, as long\n// as each field is a non-repeated field with a primitive (non-message) type.\n// The path template controls how fields of the request message are mapped to\n// the URL path.\n//\n// Example:\n//\n//     service Messaging {\n//       rpc GetMessage(GetMessageRequest) returns (Message) {\n//         option (google.api.http) = {\n//             get: \"/v1/{name=messages/*}\"\n//         };\n//       }\n//     }\n//     message GetMessageRequest {\n//       string name = 1; // Mapped to URL path.\n//     }\n//     message Message {\n//       string text = 1; // The resource content.\n//     }\n//\n// This enables an HTTP REST to gRPC mapping as below:\n//\n// - HTTP: `GET /v1/messages/123456`\n// - gRPC: `GetMessage(name: \"messages/123456\")`\n//\n// Any fields in the request message which are not bound by the path template\n// automatically become HTTP query parameters if there is no HTTP request body.\n// For example:\n//\n//     service Messaging {\n//       rpc GetMessage(GetMessageRequest) returns (Message) {\n//         option (google.api.http) = {\n//             get:\"/v1/messages/{message_id}\"\n//         };\n//       }\n//     }\n//     message GetMessageRequest {\n//       message SubMessage {\n//         string subfield = 1;\n//       }\n//       string message_id = 1; // Mapped to URL path.\n//       int64 revision = 2;    // Mapped to URL query parameter `revision`.\n//       SubMessage sub = 3;    // Mapped to URL query parameter `sub.subfield`.\n//     }\n//\n// This enables a HTTP JSON to RPC mapping as below:\n//\n// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`\n// - gRPC: `GetMessage(message_id: \"123456\" revision: 2 sub:\n// SubMessage(subfield: \"foo\"))`\n//\n// Note that fields which are mapped to URL query parameters must have a\n// primitive type or a repeated primitive type or a non-repeated message type.\n// In the case of a repeated type, the parameter can be repeated in the URL\n// as `...?param=A&param=B`. In the case of a message type, each field of the\n// message is mapped to a separate parameter, such as\n// `...?foo.a=A&foo.b=B&foo.c=C`.\n//\n// For HTTP methods that allow a request body, the `body` field\n// specifies the mapping. Consider a REST update method on the\n// message resource collection:\n//\n//     service Messaging {\n//       rpc UpdateMessage(UpdateMessageRequest) returns (Message) {\n//         option (google.api.http) = {\n//           patch: \"/v1/messages/{message_id}\"\n//           body: \"message\"\n//         };\n//       }\n//     }\n//     message UpdateMessageRequest {\n//       string message_id = 1; // mapped to the URL\n//       Message message = 2;   // mapped to the body\n//     }\n//\n// The following HTTP JSON to RPC mapping is enabled, where the\n// representation of the JSON in the request body is determined by\n// protos JSON encoding:\n//\n// - HTTP: `PATCH /v1/messages/123456 { \"text\": \"Hi!\" }`\n// - gRPC: `UpdateMessage(message_id: \"123456\" message { text: \"Hi!\" })`\n//\n// The special name `*` can be used in the body mapping to define that\n// every field not bound by the path template should be mapped to the\n// request body.  This enables the following alternative definition of\n// the update method:\n//\n//     service Messaging {\n//       rpc UpdateMessage(Message) returns (Message) {\n//         option (google.api.http) = {\n//           patch: \"/v1/messages/{message_id}\"\n//           body: \"*\"\n//         };\n//       }\n//     }\n//     message Message {\n//       string message_id = 1;\n//       string text = 2;\n//     }\n//\n//\n// The following HTTP JSON to RPC mapping is enabled:\n//\n// - HTTP: `PATCH /v1/messages/123456 { \"text\": \"Hi!\" }`\n// - gRPC: `UpdateMessage(message_id: \"123456\" text: \"Hi!\")`\n//\n// Note that when using `*` in the body mapping, it is not possible to\n// have HTTP parameters, as all fields not bound by the path end in\n// the body. This makes this option more rarely used in practice when\n// defining REST APIs. The common usage of `*` is in custom methods\n// which don't use the URL at all for transferring data.\n//\n// It is possible to define multiple HTTP methods for one RPC by using\n// the `additional_bindings` option. Example:\n//\n//     service Messaging {\n//       rpc GetMessage(GetMessageRequest) returns (Message) {\n//         option (google.api.http) = {\n//           get: \"/v1/messages/{message_id}\"\n//           additional_bindings {\n//             get: \"/v1/users/{user_id}/messages/{message_id}\"\n//           }\n//         };\n//       }\n//     }\n//     message GetMessageRequest {\n//       string message_id = 1;\n//       string user_id = 2;\n//     }\n//\n// This enables the following two alternative HTTP JSON to RPC mappings:\n//\n// - HTTP: `GET /v1/messages/123456`\n// - gRPC: `GetMessage(message_id: \"123456\")`\n//\n// - HTTP: `GET /v1/users/me/messages/123456`\n// - gRPC: `GetMessage(user_id: \"me\" message_id: \"123456\")`\n//\n// Rules for HTTP mapping\n//\n// 1. Leaf request fields (recursive expansion nested messages in the request\n//    message) are classified into three categories:\n//    - Fields referred by the path template. They are passed via the URL path.\n//    - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They\n//    are passed via the HTTP\n//      request body.\n//    - All other fields are passed via the URL query parameters, and the\n//      parameter name is the field path in the request message. A repeated\n//      field can be represented as multiple query parameters under the same\n//      name.\n//  2. If [HttpRule.body][google.api.HttpRule.body] is \"*\", there is no URL\n//  query parameter, all fields\n//     are passed via URL path and HTTP request body.\n//  3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP\n//  request body, all\n//     fields are passed via URL path and URL query parameters.\n//\n// Path template syntax\n//\n//     Template = \"/\" Segments [ Verb ] ;\n//     Segments = Segment { \"/\" Segment } ;\n//     Segment  = \"*\" | \"**\" | LITERAL | Variable ;\n//     Variable = \"{\" FieldPath [ \"=\" Segments ] \"}\" ;\n//     FieldPath = IDENT { \".\" IDENT } ;\n//     Verb     = \":\" LITERAL ;\n//\n// The syntax `*` matches a single URL path segment. The syntax `**` matches\n// zero or more URL path segments, which must be the last part of the URL path\n// except the `Verb`.\n//\n// The syntax `Variable` matches part of the URL path as specified by its\n// template. A variable template must not contain other variables. If a variable\n// matches a single path segment, its template may be omitted, e.g. `{var}`\n// is equivalent to `{var=*}`.\n//\n// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`\n// contains any reserved character, such characters should be percent-encoded\n// before the matching.\n//\n// If a variable contains exactly one path segment, such as `\"{var}\"` or\n// `\"{var=*}\"`, when such a variable is expanded into a URL path on the client\n// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The\n// server side does the reverse decoding. Such variables show up in the\n// [Discovery\n// Document](https://developers.google.com/discovery/v1/reference/apis) as\n// `{var}`.\n//\n// If a variable contains multiple path segments, such as `\"{var=foo/*}\"`\n// or `\"{var=**}\"`, when such a variable is expanded into a URL path on the\n// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.\n// The server side does the reverse decoding, except \"%2F\" and \"%2f\" are left\n// unchanged. Such variables show up in the\n// [Discovery\n// Document](https://developers.google.com/discovery/v1/reference/apis) as\n// `{+var}`.\n//\n// Using gRPC API Service Configuration\n//\n// gRPC API Service Configuration (service config) is a configuration language\n// for configuring a gRPC service to become a user-facing product. The\n// service config is simply the YAML representation of the `google.api.Service`\n// proto message.\n//\n// As an alternative to annotating your proto file, you can configure gRPC\n// transcoding in your service config YAML files. You do this by specifying a\n// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same\n// effect as the proto annotation. This can be particularly useful if you\n// have a proto that is reused in multiple services. Note that any transcoding\n// specified in the service config will override any matching transcoding\n// configuration in the proto.\n//\n// The following example selects a gRPC method and applies an `HttpRule` to it:\n//\n//     http:\n//       rules:\n//         - selector: example.v1.Messaging.GetMessage\n//           get: /v1/messages/{message_id}/{sub.subfield}\n//\n// Special notes\n//\n// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the\n// proto to JSON conversion must follow the [proto3\n// specification](https://developers.google.com/protocol-buffers/docs/proto3#json).\n//\n// While the single segment variable follows the semantics of\n// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String\n// Expansion, the multi segment variable **does not** follow RFC 6570 Section\n// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion\n// does not expand special characters like `?` and `#`, which would lead\n// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding\n// for multi segment variables.\n//\n// The path variables **must not** refer to any repeated or mapped field,\n// because client libraries are not capable of handling such variable expansion.\n//\n// The path variables **must not** capture the leading \"/\" character. The reason\n// is that the most common use case \"{var}\" does not capture the leading \"/\"\n// character. For consistency, all path variables must share the same behavior.\n//\n// Repeated message fields must not be mapped to URL query parameters, because\n// no client library can support such complicated mapping.\n//\n// If an API needs to use a JSON array for request or response body, it can map\n// the request or response body to a repeated field. However, some gRPC\n// Transcoding implementations may not support this feature.\nmessage HttpRule {\n  // Selects a method to which this rule applies.\n  //\n  // Refer to [selector][google.api.DocumentationRule.selector] for syntax\n  // details.\n  string selector = 1;\n\n  // Determines the URL pattern is matched by this rules. This pattern can be\n  // used with any of the {get|put|post|delete|patch} methods. A custom method\n  // can be defined using the 'custom' field.\n  oneof pattern {\n    // Maps to HTTP GET. Used for listing and getting information about\n    // resources.\n    string get = 2;\n\n    // Maps to HTTP PUT. Used for replacing a resource.\n    string put = 3;\n\n    // Maps to HTTP POST. Used for creating a resource or performing an action.\n    string post = 4;\n\n    // Maps to HTTP DELETE. Used for deleting a resource.\n    string delete = 5;\n\n    // Maps to HTTP PATCH. Used for updating a resource.\n    string patch = 6;\n\n    // The custom pattern is used for specifying an HTTP method that is not\n    // included in the `pattern` field, such as HEAD, or \"*\" to leave the\n    // HTTP method unspecified for this rule. The wild-card rule is useful\n    // for services that provide content to Web (HTML) clients.\n    CustomHttpPattern custom = 8;\n  }\n\n  // The name of the request field whose value is mapped to the HTTP request\n  // body, or `*` for mapping all request fields not captured by the path\n  // pattern to the HTTP body, or omitted for not having any HTTP request body.\n  //\n  // NOTE: the referred field must be present at the top-level of the request\n  // message type.\n  string body = 7;\n\n  // Optional. The name of the response field whose value is mapped to the HTTP\n  // response body. When omitted, the entire response message will be used\n  // as the HTTP response body.\n  //\n  // NOTE: The referred field must be present at the top-level of the response\n  // message type.\n  string response_body = 12;\n\n  // Additional HTTP bindings for the selector. Nested bindings must\n  // not contain an `additional_bindings` field themselves (that is,\n  // the nesting may only be one level deep).\n  repeated HttpRule additional_bindings = 11;\n}\n\n// A custom pattern is used for defining custom HTTP verb.\nmessage CustomHttpPattern {\n  // The name of this custom HTTP verb.\n  string kind = 1;\n\n  // The path matched by this custom verb.\n  string path = 2;\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/control.inverse_test.go",
    "content": "package tutorial\n\nimport (\n\t\"errors\"\n\t\"testing\"\n)\n\n// Undo 是控制逻辑，与业务逻辑分开，业务逻辑依赖控制逻辑Undo，而不是控制\n// 逻辑依赖业务逻辑\ntype Undo []func()\n\nfunc (undo *Undo) Add(function func()) {\n\t*undo = append(*undo, function)\n}\n\nfunc (undo *Undo) Undo() error {\n\tfunctions := *undo\n\tif len(functions) == 0 {\n\t\treturn errors.New(\"No functions to undo\")\n\t}\n\tindex := len(functions) - 1\n\tif function := functions[index]; function != nil {\n\t\tfunction()\n\t\tfunctions[index] = nil // For garbage collection\n\t}\n\t*undo = functions[:index]\n\treturn nil\n}\n\ntype IntSet struct {\n\tdata map[int]bool\n\tundo Undo\n}\n\nfunc NewIntSet() IntSet {\n\treturn IntSet{data: make(map[int]bool)}\n}\n\nfunc (set *IntSet) Undo() error {\n\treturn set.undo.Undo()\n}\n\nfunc (set *IntSet) Contains(x int) bool {\n\treturn set.data[x]\n}\n\nfunc (set *IntSet) Add(x int) {\n\tif !set.Contains(x) {\n\t\tset.data[x] = true\n\t\tset.undo.Add(func() { set.Delete(x) })\n\t} else {\n\t\tset.undo.Add(nil)\n\t}\n}\n\nfunc (set *IntSet) Delete(x int) {\n\tif set.Contains(x) {\n\t\tdelete(set.data, x)\n\t\tset.undo.Add(func() { set.Add(x) })\n\t} else {\n\t\tset.undo.Add(nil)\n\t}\n}\n\nfunc TestUndo(t *testing.T) {\n\ts := NewIntSet()\n\ts.Add(10)\n\ts.Add(5)\n\tt.Logf(\"s: %v\", s)\n\ts.Undo()\n\tt.Logf(\"s: %v\", s)\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/decorator_test.go",
    "content": "package tutorial\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"testing\"\n)\n\n//http 中间件采用修饰器编程规范\ntype HttpHandlerDecorator func(http.HandlerFunc) http.HandlerFunc\n\nfunc Handler(h http.HandlerFunc, decors ...HttpHandlerDecorator) http.HandlerFunc {\n\tfor i := range decors {\n\t\td := decors[len(decors)-1-i] // iterate in reverse\n\t\th = d(h)\n\t}\n\treturn h\n}\n\nfunc WithServerHeader(h http.HandlerFunc) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tlog.Println(\"--->WithServerHeader()\")\n\t\tw.Header().Set(\"Server\", \"HelloServer v0.0.1\")\n\t\th(w, r)\n\t}\n}\n\nfunc WithAuthCookie(h http.HandlerFunc) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tlog.Println(\"--->WithAuthCookie()\")\n\t\tcookie := &http.Cookie{Name: \"Auth\", Value: \"Pass\", Path: \"/\"}\n\t\thttp.SetCookie(w, cookie)\n\t\th(w, r)\n\t}\n}\n\nfunc WithBasicAuth(h http.HandlerFunc) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tlog.Println(\"--->WithBasicAuth()\")\n\t\t//cookie, _ := r.Cookie(\"Auth\")\n\n\t\t/*\n\t\t\tif err != nil || cookie.Value != \"Pass\" {\n\t\t\t\tw.WriteHeader(http.StatusForbidden)\n\t\t\t\treturn\n\t\t\t}\n\t\t*/\n\t\th(w, r)\n\t}\n}\n\nfunc WithDebugLog(h http.HandlerFunc) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tlog.Println(\"--->WithDebugLog\")\n\t\tr.ParseForm()\n\t\t/*\n\t\t\t\t\tlog.Println(r.Form)\n\t\t\t//\t\tlog.Println(\"path\", r.URL.Path)\n\t\t\t//\t\tlog.Println(\"scheme\", r.URL.Scheme)\n\t\t\t//\t\tlog.Println(r.Form[\"url_long\"])\n\t\t\t\t\tfor k, v := range r.Form {\n\t\t\t\t\t\tlog.Println(\"key:\", k)\n\t\t\t\t\t\tlog.Println(\"val:\", strings.Join(v, \"\"))\n\t\t\t\t\t}\n\t\t*/\n\t\th(w, r)\n\t}\n}\n\n//handler function\nfunc hello(w http.ResponseWriter, r *http.Request) {\n\tlog.Printf(\"Recieved Request %s from %s\\n\", r.URL.Path, r.RemoteAddr)\n\tfmt.Fprintf(w, \"Hello, World! \"+r.URL.Path)\n}\n\nfunc TestHttpMiddleware(t *testing.T) {\n\thttp.HandleFunc(\"/v4/hello\", Handler(hello,\n\t\tWithServerHeader, WithBasicAuth, WithDebugLog))\n\terr := http.ListenAndServe(\":8080\", nil)\n\tif err != nil {\n\t\tlog.Fatal(\"ListenAndServe: \", err)\n\t}\n\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/error.handle_test.go",
    "content": "package tutorial\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\n// 通过Closure方式抽象相同逻辑代码，去除每次调用都需要if err!=nil判断\n// 这样内部多一个err 和一个内部函数，感觉不是特别干净\nfunc parse(r io.Reader) (*Person, error) {\n\tvar p Person\n\tvar err error\n\tread := func(data interface{}) {\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terr = binary.Read(r, binary.BigEndian, data)\n\t}\n\n\tread(&p.Name)\n\tread(&p.Age)\n\tread(&p.Weight)\n\tif err != nil {\n\t\treturn &p, err\n\t}\n\treturn &p, nil\n}\n\n/*\nthis parttern reference go standard library lib\nscanner := bufio.NewScanner(input)\n// no error  return\nfor scanner.Scan() {\n    token := scanner.Text()\n    // process token\n}\n\n// call function finish, use Err() get error\nif err := scanner.Err(); err != nil {\n    // process the error\n}\n*/\n// 支持流式调用, 调用完成后，检查error\n// 对于同一个对象调用多个方法，如果有多个对象，就需要每个对象中定义一个error\ntype Person struct {\n\tr *bytes.Reader\n\t//Buf    []byte // read data for name, age and weight\n\tName   [10]byte\n\tAge    uint8\n\tWeight uint8\n\terr    error\n}\n\nfunc (p *Person) read(data interface{}) {\n\tif p.err == nil {\n\t\tp.err = binary.Read(p.r, binary.BigEndian, data)\n\t}\n}\n\nfunc (p *Person) ReadName() *Person {\n\tp.read(&p.Name)\n\treturn p\n}\n\nfunc (p *Person) ReadAge() *Person {\n\tp.read(&p.Age)\n\treturn p\n}\n\nfunc (p *Person) ReadWeight() *Person {\n\tp.read(&p.Weight)\n\treturn p\n}\n\nfunc (p *Person) Print() *Person {\n\tif p.err == nil {\n\t\tfmt.Printf(\"Name=%s, Age=%d, Weight=%d\\n\", p.Name, p.Age, p.Weight)\n\t}\n\treturn p\n}\n\nfunc TestError(t *testing.T) {\n\ttestCases := []struct {\n\t\tb        []byte\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tb:        []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\t_ = testCase\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tr := bytes.NewReader(testCase.b)\n\t\t\tp := Person{r: r}\n\t\t\t//can use ppl way to call method, not need to check error\n\t\t\tp.ReadName().ReadAge().ReadWeight().Print()\n\n\t\t\t// get error when call pppl over\n\t\t\tassert.Equal(t, io.EOF, p.err)\n\t\t\tt.Logf(\"%+v\\n\", p) // EOF\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/factory_test.go",
    "content": "package tutorial\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/go-playground/validator/v10\"\n)\n\ntype FactoryConfigFunc func(c *FactoryConfig) error\n\ntype FactoryConfig struct {\n\tValidator *validator.Validate\n\tAddr      string\n\tTimeout   time.Duration //接口处理超时时间\n}\n\nfunc (fc *FactoryConfig) ApplyOptions(configFuncs ...FactoryConfigFunc) error {\n\n\tfor _, f := range configFuncs {\n\t\terr := f(fc)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to apply factory config, err: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (fc FactoryConfig) Validate() error {\n\tvalid := fc.Validator\n\tif valid == nil {\n\t\tvalid = validator.New()\n\t}\n\treturn valid.Struct(fc)\n}\n\nfunc (fc FactoryConfig) Do(ctx context.Context) error {\n\tfmt.Println(\"done\")\n\treturn nil\n}\n\ntype Factory struct {\n\tfc FactoryConfig\n}\n\nfunc NewFactory(fc FactoryConfig, configFuncs ...FactoryConfigFunc) (Factory, error) {\n\terr := fc.ApplyOptions(configFuncs...)\n\tif err != nil {\n\t\treturn Factory{}, err\n\t}\n\n\terr = fc.Validate()\n\tif err != nil {\n\t\treturn Factory{}, err\n\t}\n\n\treturn Factory{fc: fc}, nil\n}\n\nfunc (f Factory) NewRepository(ctx context.Context) (Repository, error) {\n\t//the Repository can also not FactoryConfig instance\n\t// the example use FactoryConfig\n\treturn f.fc, nil\n}\n\ntype Repository interface {\n\tDo(ctx context.Context) error\n}\n\nfunc (f Factory) Do(ctx context.Context) error {\n\treturn f.fc.Do(ctx)\n}\n\nfunc TestFactroy(t *testing.T) {\n\tfactory, err := NewFactory(FactoryConfig{\n\t\tAddr:    \"localhost:10001\",\n\t\tTimeout: 5 * time.Second,\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"failed to new factory, err: %v\", err)\n\t}\n\n\tctx := context.Background()\n\trepository, err := factory.NewRepository(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to new repository, err: %v\", err)\n\t}\n\terr = repository.Do(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"failed to call Do method, err: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/function.options_test.go",
    "content": "package tutorial\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\n// A ServerOption sets options.\ntype ServerOption interface {\n\tapply(*Server)\n}\n\n// EmptyServerOption does not alter the configuration. It can be embedded\n// in another structure to build custom options.\n//\n// This API is EXPERIMENTAL.\ntype EmptyServerOption struct{}\n\nfunc (EmptyServerOption) apply(*Server) {}\n\n// ServerOptionFunc wraps a function that modifies Client into an\n// implementation of the ServerOption interface.\ntype ServerOptionFunc func(*Server)\n\nfunc (f ServerOptionFunc) apply(do *Server) {\n\tf(do)\n}\n\n// sample code for option, default for nothing to change\nfunc _ServerOptionWithDefault() ServerOption {\n\treturn ServerOptionFunc(func(*Server) {\n\t\t// nothing to change\n\t})\n}\nfunc (o *Server) ApplyOptions(options ...ServerOption) *Server {\n\tfor _, opt := range options {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\topt.apply(o)\n\t}\n\treturn o\n}\n\nfunc WithProtocol(protocol string) ServerOption {\n\treturn ServerOptionFunc(func(s *Server) {\n\t\ts.opts.Protocol = protocol\n\t})\n}\n\nfunc WithTimeout(timeout time.Duration) ServerOption {\n\treturn ServerOptionFunc(func(s *Server) {\n\t\ts.opts.Timeout = timeout\n\t})\n}\n\nfunc WithMaxConns(maxConns int) ServerOption {\n\treturn ServerOptionFunc(func(s *Server) {\n\t\ts.opts.MaxConns = maxConns\n\t})\n}\n\ntype Server struct {\n\tAddr string\n\tPort int\n\topts struct {\n\t\tProtocol string\n\t\tTimeout  time.Duration\n\t\tMaxConns int\n\t}\n}\n\nfunc NewServer(addr string, port int, opts ...ServerOption) *Server {\n\ts := &Server{\n\t\tAddr: addr,\n\t\tPort: port,\n\t}\n\tfor _, opt := range opts {\n\t\ts.ApplyOptions(opt)\n\t}\n\n\treturn s\n}\n\nfunc TestNewServer(t *testing.T) {\n\ttestCases := []struct {\n\t\tAddr     string\n\t\tPort     int\n\t\tProtocol string\n\t\tTimeout  time.Duration\n\t\tMaxConns int\n\t}{\n\t\t{\n\t\t\tAddr:     \"127.0.0.1\",\n\t\t\tPort:     10000,\n\t\t\tProtocol: \"tcp\",\n\t\t\tTimeout:  time.Second,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\ts := NewServer(testCase.Addr, testCase.Port, WithTimeout(testCase.Timeout), WithProtocol(testCase.Protocol))\n\t\t\tt.Logf(\"s: %v\", s)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/interface.check_test.go",
    "content": "package tutorial\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\ntype Shape interface {\n\tSides() int\n\tArea() int\n}\ntype Square struct {\n\tlength int\n}\n\nfunc NewSquare(length int) *Square {\n\treturn &Square{\n\t\tlength: length,\n\t}\n}\n\nfunc (s *Square) Sides() int {\n\treturn 4\n}\n\nfunc (s *Square) Area() int {\n\treturn 16\n}\n\n// check interface complete\n// if not implete Area method, it will report InvalidIfaceAssign: cannot use (*Square)(nil) (value of type *Square)\n//as Shape value in variable declaration: missing method Area\nvar _ Shape = (*Square)(nil)\n\nfunc TestNewSquare(t *testing.T) {\n\ttestCases := []struct {\n\t\tlength   int\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tlength:   5,\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\ts := NewSquare(testCase.length)\n\t\t\tt.Logf(\"s: %v\", s.Sides())\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/interface.program_test.go",
    "content": "package tutorial\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\n//Program to an interface not an implementation\ntype Country struct {\n\tName string\n}\n\ntype City struct {\n\tName string\n}\n\ntype Stringable interface {\n\tToString() string\n}\n\nfunc (c Country) ToString() string {\n\treturn \"Country = \" + c.Name\n}\nfunc (c City) ToString() string {\n\treturn \"City = \" + c.Name\n}\n\n// Program to an interface not an implementation\nfunc PrintStr(p Stringable) {\n\tfmt.Println(p.ToString())\n}\n\nfunc TestPrintStr(t *testing.T) {\n\ttestCases := []struct {\n\t\tobj      Stringable\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tobj:      Country{\"USA\"},\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tobj:      City{\"Los Angeles\"},\n\t\t\texpected: \"\",\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tPrintStr(testCase.obj)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/map.reduce_test.go",
    "content": "package tutorial\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\ntype Employee struct {\n\tName     string\n\tAge      int\n\tVacation int\n\tSalary   int\n}\n\nvar list = []Employee{\n\t{\"Hao\", 44, 0, 8000},\n\t{\"Bob\", 34, 10, 5000},\n\t{\"Alice\", 23, 5, 9000},\n\t{\"Jack\", 26, 0, 4000},\n\t{\"Tom\", 48, 9, 7500},\n\t{\"Marry\", 29, 0, 6000},\n\t{\"Mike\", 32, 8, 4000},\n}\n\n// 控制逻辑通过传递函数方式与业务逻辑分开\nfunc EmployeeCountIf(list []Employee, fn func(e *Employee) bool) int {\n\tcount := 0\n\tfor i, _ := range list {\n\t\tif fn(&list[i]) {\n\t\t\tcount += 1\n\t\t}\n\t}\n\treturn count\n}\n\nfunc EmployeeFilterIn(list []Employee, fn func(e *Employee) bool) []Employee {\n\tvar newList []Employee\n\tfor i, _ := range list {\n\t\tif fn(&list[i]) {\n\t\t\tnewList = append(newList, list[i])\n\t\t}\n\t}\n\treturn newList\n}\n\nfunc EmployeeSumIf(list []Employee, fn func(e *Employee) int) int {\n\tvar sum = 0\n\tfor i, _ := range list {\n\t\tsum += fn(&list[i])\n\t}\n\treturn sum\n}\n\nfunc TestEmployeeCountIf(t *testing.T) {\n\ttestCases := []struct {\n\t\tAge    int\n\t\tSalary int\n\t}{\n\t\t{\n\t\t\tAge:    40,\n\t\t\tSalary: 6000,\n\t\t},\n\t}\n\n\tfor i, testCase := range testCases {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), func(t *testing.T) {\n\t\t\tcount := EmployeeCountIf(list, func(e *Employee) bool {\n\t\t\t\treturn e.Age > testCase.Age\n\t\t\t})\n\t\t\tt.Logf(\"the number of age > %v is %v\", testCase.Age, count)\n\t\t\tcount = EmployeeCountIf(list, func(e *Employee) bool {\n\t\t\t\treturn e.Salary > testCase.Salary\n\t\t\t})\n\t\t\tt.Logf(\"the number of salary > %v is %v\", testCase.Salary, count)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/pipeline_test.go",
    "content": "package tutorial\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sync\"\n\t\"testing\"\n)\n\n//通过channel 与 gorutinue 实现Fan in/Out, 1对多/多对1\n//Multiple functions can read from the same channel until that channel\n//is closed; this is called fan-out\n//https://go.dev/blog/pipelines\n\n// echo 将整数数组放入到channel中，并返回 channel\nfunc echo(nums []int) <-chan int {\n\tout := make(chan int)\n\tgo func() {\n\t\tfor _, n := range nums {\n\t\t\tout <- n\n\t\t}\n\t\tclose(out)\n\t}()\n\treturn out\n}\n\n// sum内部使用一个协程处理从in读取的数据, 如果多次调用sum，就可以实现将\n// 同一个chan 中的数据分成多个协程进行并发处理(读取数据这块是串行，单处理是并发)\nfunc sum(in <-chan int) <-chan int {\n\tout := make(chan int)\n\tgo func() {\n\t\tvar sum = 0\n\t\tfor n := range in {\n\t\t\tsum += n\n\t\t}\n\t\tout <- sum\n\t\t//close 作用的是让外部读取out chanel停止调，不会会永远阻塞\n\t\tclose(out)\n\t}()\n\treturn out\n}\n\nfunc is_prime(value int) bool {\n\tfor i := 2; i <= int(math.Floor(float64(value)/2)); i++ {\n\t\tif value%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn value > 1\n}\n\nfunc prime(in <-chan int) <-chan int {\n\tout := make(chan int)\n\tgo func() {\n\t\tfor n := range in {\n\t\t\tif is_prime(n) {\n\t\t\t\tout <- n\n\t\t\t}\n\t\t}\n\t\tclose(out)\n\t}()\n\treturn out\n}\n\n//\nfunc merge(cs []<-chan int) <-chan int {\n\tvar wg sync.WaitGroup\n\tout := make(chan int)\n\n\twg.Add(len(cs))\n\tfor _, c := range cs {\n\t\tgo func(c <-chan int) {\n\t\t\tfor n := range c {\n\t\t\t\tout <- n\n\t\t\t}\n\t\t\twg.Done()\n\t\t}(c)\n\t}\n\t//协程的目的是让外部读取out的函数先工作起来，等到所有协程都完成工作\n\t//后，close调，中断外部读取操作\n\tgo func() {\n\t\twg.Wait()\n\t\t// 关闭读取前，等待所有的协程完成任务\n\t\tclose(out)\n\t}()\n\treturn out\n}\n\n//生成指定范围的数组\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc TestPipleline(t *testing.T) {\n\tnums := makeRange(1, 10000)\n\t// echo 将整数数组放入到channel中，并返回 channel\n\tin := echo(nums)\n\n\tconst nProcess = 5\n\tvar chans [nProcess]<-chan int\n\tfor i := range chans {\n\n\t\t// 将chan in中的数据分成5个协程处理, 结果输出到5个chan中\n\t\tchans[i] = sum(prime(in))\n\t}\n\n\t/*\n\t\tn := <-sum(merge(chans[:]))\n\t\tfmt.Println(n)\n\t*/\n\t//如果有多个结果的话，使用range读取结果\n\tfor n := range sum(merge(chans[:])) {\n\t\tfmt.Println(n)\n\t}\n\n}\n"
  },
  {
    "path": "tutorial/programming_paradigm/visitor_test.go",
    "content": "package tutorial\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\n//kubectl 使用了build模式和visitor模式\n//https://github.com/kubernetes/kubernetes/blob/cea1d4e20b4a7886d8ff65f34c6d4f95efcb4742/staging/src/k8s.io/cli-runtime/pkg/resource/visitor.go\ntype VisitorFunc func(*Info, error) error\n\ntype Visitor interface {\n\tVisit(VisitorFunc) error\n}\n\ntype Info struct {\n\tNamespace   string\n\tName        string\n\tOtherThings string\n}\n\nfunc (info *Info) Visit(fn VisitorFunc) error {\n\treturn fn(info, nil)\n}\n\ntype NameVisitor struct {\n\tvisitor Visitor\n}\n\nfunc (v NameVisitor) Visit(fn VisitorFunc) error {\n\treturn v.visitor.Visit(func(info *Info, err error) error {\n\t\tfmt.Println(\"NameVisitor() before call function\")\n\t\terr = fn(info, err)\n\t\tif err == nil {\n\t\t\tfmt.Printf(\"==> Name=%s, NameSpace=%s\\n\", info.Name, info.Namespace)\n\t\t}\n\t\tfmt.Println(\"NameVisitor() after call function\")\n\t\treturn err\n\t})\n}\n\nfunc WithNameVisitor() VisitorFunc {\n\treturn func(info *Info, err error) error {\n\t\tfmt.Println(\"NameVisitor() before call function\")\n\t\tinfo.Name = \"kay.name\"\n\t\treturn nil\n\t}\n}\n\ntype OtherVisitor struct {\n\tvisitor Visitor\n}\n\nfunc (v OtherVisitor) Visit(fn VisitorFunc) error {\n\treturn v.visitor.Visit(func(info *Info, err error) error {\n\t\tfmt.Println(\"OtherThingsVisitor() before call function\")\n\t\terr = fn(info, err)\n\t\tif err == nil {\n\t\t\tfmt.Printf(\"==> OtherThings=%s\\n\", info.OtherThings)\n\t\t}\n\t\tfmt.Println(\"OtherThingsVisitor() after call function\")\n\t\treturn err\n\t})\n}\n\nfunc WithOtherVisitor() VisitorFunc {\n\treturn func(info *Info, err error) error {\n\t\tfmt.Println(\"WithOtherVisitor() before call function\")\n\t\tinfo.Namespace = \"nanjing\"\n\t\treturn nil\n\t}\n}\n\ntype DecoratedVisitor struct {\n\tvisitor    Visitor\n\tdecorators []VisitorFunc\n}\n\nfunc NewDecoratedVisitor(v Visitor, fn ...VisitorFunc) Visitor {\n\tif len(fn) == 0 {\n\t\treturn v\n\t}\n\treturn DecoratedVisitor{v, fn}\n}\n\n// Visit implements Visitor\nfunc (v DecoratedVisitor) Visit(fn VisitorFunc) error {\n\treturn v.visitor.Visit(func(info *Info, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor i := range v.decorators {\n\t\t\tif err := v.decorators[i](info, nil); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err := fn(info, nil); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc TestDecoratedVisitor(t *testing.T) {\n\n\tinfo := Info{}\n\tvar v Visitor = &info\n\n\tv = NewDecoratedVisitor(v, WithNameVisitor(), WithOtherVisitor())\n\tloadFile := func(info *Info, err error) error {\n\t\tfmt.Println(\"process loadFile\")\n\t\tinfo.OtherThings = \"We are running as remote team.\"\n\t\tfmt.Printf(\"info: %v\", info)\n\t\treturn nil\n\t}\n\tv.Visit(loadFile)\n}\n"
  }
]